Index: /AUTHORS
===================================================================
--- /AUTHORS	(revision 5)
+++ /AUTHORS	(revision 5)
@@ -0,0 +1,106 @@
+AUTHORS
+=======
+
+OGRE Team 
+---------
+Steve Streeting	(sinbad)              
+Thomas Muldowney (temas)
+James O'Sullivan (_mental_)
+Wladimir J. van der Laan (miathan6/wumpus)
+
+Feature Contributors
+--------------------
+The following list includes developers who have contributed features to OGRE:
+
+Contributor                             Subject Areas 
+-----------                             --------------------------------------
+Adrian Cearnau (cearny)               : Codecs, dynamic library loading
+Jon Anderson (janders)                : octree plugin
+Martin Persson                        : Nature plugin
+Jesse Rusak (jder) 	  				  : Mac OSX port
+Etienne Mallard (earthquakeproof)	  : 3D Studio Model Exporter
+Banania								  : ditto
+Paolo Gavocanov (cTh) 				  : Initial D3D9 port, Meshviewer, 
+                                        3D Studio Scene Exporter
+Ivica Aracic (macross/bytelord)       : Ogre4J, Maya exporter, .scene format
+Jeff Leigh							  : Sky enhancements, debug overlay
+Jose A Milan (jamilan/spoke)          : Paging landscape plugin
+Tuan Kuranes (kuranes)                : ditto
+Stephan Kaiser (psyclonist)           : OgreFsrad, OgreLMTS, .scene format
+Philippe Culet                        : Attaching objects to bones
+Jon L. Griffeth (silent3)             : GUI enhancements
+Dan Sonnemann (oberleutnantdan)       : Timers
+Amit Mathew                           : Profiler
+Dennis Verbeek                        : Lightwave exporter
+David Whittaker                       : Displacement mapping terrain
+Chris Groskopf (staringmonkey)        : OgreTok
+Jeff Doyle (nfz)                      : ATI_fragment_shader compiler, 
+                                        paging landscape
+Patrick Kooman                        : Overlay editor
+Doug Wolanick (icetec)                : DotSceneOctree exporter & plugin
+John Van Vliet (granite/fifty1)       : Maya exporter
+Marcin Zukowski (eru)                 : Demo_CubeMapping and Demo_Water
+Jens Hoffmann                         : Blender exporter
+Michael Reimpell                      : Blender exporter
+Sam le Pirate                         : BMP support
+Attila Tajti (attis)                  : Wings3D exporter
+? (Firestorm)                         : Particle scale and rotate affectors
+Lee Sandberg                          : Hardware occlusion query support
+Phillip Castaneda (pjcast)            : External texture sources / dynamic
+										textures
+Henry Goffin (qsilver)				  : Ultra-fast scaling code in 
+										OgreImageResampler.h
+Federico Di Gregorio (fog)			  : Debian packaging
+
+Others
+------
+The following people have been notable in their support of OGRE through the
+fixing of bugs, testing patches, and various other miscellaneous contributions:
+
+Timo Keller (norondion) 
+Kai-Peter Backman
+Daniel Wessl?n
+Benny Kramek (wolfman8k) 
+Riku Nurminen (rakkis)
+Christopher John Gilbert (thegilb)
+Martin Pollard (xmp)
+Nikita Mikros (santanopoulos)
+Chris Heald (antiarc)
+Michael Casaday
+Evgeni Popov
+Chris McGuirk (leedgitar)
+Te'ja (thiveertm)
+Keith Jackson
+G Nikolakis
+Genva
+Christian Larsen (DWORD)
+Chris Heald (Antiarc)
+Green Eyed Monster (monster)
+
+
+
+
+If we've forgotten you in the above list, please contact us!
+
+See Readme.html in the Docs folder for more details, in particular information on the media supplied with the demos.
+
+-----
+
+Copyright 1999-2004 The OGRE Team.
+
+This file is part of OGRE (Object-Oriented Graphics Rendering Engine).
+
+OGRE 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, or (at your option)
+any later version.
+
+OGRE 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 Lesser General Public License
+along with OGRE; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
Index: /BUGS
===================================================================
--- /BUGS	(revision 5)
+++ /BUGS	(revision 5)
@@ -0,0 +1,23 @@
+Please go to http://sourceforge.net/projects/ogre for a full 
+list of known bugs.
+
+-----
+
+Copyright 1999-2002 The OGRE Team.
+
+This file is part of OGRE (Object-Oriented Graphics Rendering Engine).
+
+OGRE is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+OGRE 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 OGRE; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
Index: /COPYING
===================================================================
--- /COPYING	(revision 5)
+++ /COPYING	(revision 5)
@@ -0,0 +1,514 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+
Index: /INSTALL
===================================================================
--- /INSTALL	(revision 5)
+++ /INSTALL	(revision 5)
@@ -0,0 +1,22 @@
+Please see Readme.html in the Docs folder for full instructions.
+
+-----
+
+Copyright 1999-2005 The OGRE Team.
+
+This file is part of OGRE (Object-Oriented Graphics Rendering Engine).
+
+OGRE is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+OGRE 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 OGRE; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
Index: /LINUX.DEV
===================================================================
--- /LINUX.DEV	(revision 5)
+++ /LINUX.DEV	(revision 5)
@@ -0,0 +1,32 @@
+[Modified: pjcast - Aug 25, 2006]
+
+Here are a few notes on using OGRE in a linux or linux like environment.  First
+keep your life simple by using the pkg-config system.  Using this script you can
+easily add in the required library and include dir flags like this:
+
+    pkg-config --cflags --libs OGRE
+
+If the script complains about not finding the OGRE module and possibly needing
+PKG_CONFIG_PATH set, you can do so like this:
+
+    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
+
+Most commonly your pkgconfig directory will be under the directory that
+libOgreMain was installed to.
+
+There are sone other flags to be aware of, GCC_3_1 and EXT_HASH.  These are
+currently set by pkg-config flags.  Their meaning is
+so:
+
+    GCC_3_1:  This means you are using g++ version 3.1 or greater.  This allows 
+              for direct usage of the standard library.
+    EXT_HASH:  This means that your hash_map and other none standard STL 
+               components are in the ext/ subdir of your normal headers.
+           
+Otherwise you should be able to generally get things going.  If you have other
+questions feel free to ask on the forums: http://www.ogre3d.org/phpBB2/index.php, IRC
+<irc.freenode.net #ogre3d>
+
+--temas
+
+
Index: /Makefile.am
===================================================================
--- /Makefile.am	(revision 5)
+++ /Makefile.am	(revision 5)
@@ -0,0 +1,6 @@
+SUBDIRS = OgreMain PlugIns RenderSystems Samples Tools Tests
+ACLOCAL_AMFLAGS = -I Scripts/m4
+AUTOMAKE_OPTIONS = foreign
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = OGRE.pc
Index: /Makefile.in
===================================================================
--- /Makefile.in	(revision 5)
+++ /Makefile.in	(revision 5)
@@ -0,0 +1,705 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = .
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(srcdir)/OGRE.pc.in \
+	$(top_srcdir)/configure AUTHORS COPYING INSTALL config.guess \
+	config.sub depcomp install-sh ltmain.sh missing
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno configure.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES = OGRE.pc
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
+pkgconfigDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(pkgconfig_DATA)
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  { test ! -d $(distdir) \
+    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = OgreMain PlugIns RenderSystems Samples Tools Tests
+ACLOCAL_AMFLAGS = -I Scripts/m4
+AUTOMAKE_OPTIONS = foreign
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = OGRE.pc
+all: all-recursive
+
+.SUFFIXES:
+am--refresh:
+	@:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+	      cd $(srcdir) && $(AUTOMAKE) --foreign  \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    echo ' $(SHELL) ./config.status'; \
+	    $(SHELL) ./config.status;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+OGRE.pc: $(top_builddir)/config.status $(srcdir)/OGRE.pc.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+install-pkgconfigDATA: $(pkgconfig_DATA)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkgconfigdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfigdir)"
+	@list='$(pkgconfig_DATA)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
+	  $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
+	done
+
+uninstall-pkgconfigDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkgconfig_DATA)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
+	done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	$(am__remove_distdir)
+	mkdir $(distdir)
+	$(mkdir_p) $(distdir)/. $(distdir)/Samples/Common/CEGUIRenderer $(distdir)/Scripts/m4
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+	|| chmod -R a+r $(distdir)
+dist-gzip: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+dist-bzip2: distdir
+	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+	$(am__remove_distdir)
+
+dist-tarZ: distdir
+	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+	$(am__remove_distdir)
+
+dist-shar: distdir
+	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	$(am__remove_distdir)
+
+dist-zip: distdir
+	-rm -f $(distdir).zip
+	zip -rq $(distdir).zip $(distdir)
+	$(am__remove_distdir)
+
+dist dist-all: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+	case '$(DIST_ARCHIVES)' in \
+	*.tar.gz*) \
+	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+	*.tar.bz2*) \
+	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.Z*) \
+	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+	*.shar.gz*) \
+	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+	*.zip*) \
+	  unzip $(distdir).zip ;;\
+	esac
+	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	mkdir $(distdir)/_build
+	mkdir $(distdir)/_inst
+	chmod a-w $(distdir)
+	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+	  && cd $(distdir)/_build \
+	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) check \
+	  && $(MAKE) $(AM_MAKEFLAGS) install \
+	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+	        distuninstallcheck \
+	  && chmod -R a-w "$$dc_install_base" \
+	  && ({ \
+	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
+	  && rm -rf "$$dc_destdir" \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist \
+	  && rm -rf $(DIST_ARCHIVES) \
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+	$(am__remove_distdir)
+	@(echo "$(distdir) archives ready for distribution: "; \
+	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+	  sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+distuninstallcheck:
+	@cd $(distuninstallcheck_dir) \
+	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+	   || { echo "ERROR: files left after uninstall:" ; \
+	        if test -n "$(DESTDIR)"; then \
+	          echo "  (check DESTDIR support)"; \
+	        fi ; \
+	        $(distuninstallcheck_listfiles) ; \
+	        exit 1; } >&2
+distcleancheck: distclean
+	@if test '$(srcdir)' = . ; then \
+	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+	  exit 1 ; \
+	fi
+	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+	  || { echo "ERROR: files left in build directory after distclean:" ; \
+	       $(distcleancheck_listfiles) ; \
+	       exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-pkgconfigDATA
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -rf $(top_srcdir)/autom4te.cache
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkgconfigDATA
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
+	check-am clean clean-generic clean-libtool clean-recursive \
+	ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+	dist-shar dist-tarZ dist-zip distcheck distclean \
+	distclean-generic distclean-libtool distclean-recursive \
+	distclean-tags distcleancheck distdir distuninstallcheck dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-exec install-exec-am \
+	install-info install-info-am install-man install-pkgconfigDATA \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	maintainer-clean-recursive mostlyclean mostlyclean-generic \
+	mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
+	tags tags-recursive uninstall uninstall-am uninstall-info-am \
+	uninstall-pkgconfigDATA
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /OGRE.pc.in
===================================================================
--- /OGRE.pc.in	(revision 5)
+++ /OGRE.pc.in	(revision 5)
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+plugindir=@libdir@/@PACKAGE@
+
+Name: OGRE
+Description: Object-Oriented Graphics Rendering Engine
+Version: @VERSION@
+Libs: -L${libdir} -lOgreMain @OGRE_THREAD_LIBS@
+Cflags: -I${includedir} -I${includedir}/@PACKAGE@ @OGRE_CFLAGS@
Index: /Ogre.sln
===================================================================
--- /Ogre.sln	(revision 5)
+++ /Ogre.sln	(revision 5)
@@ -0,0 +1,618 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OgreMain", "OgreMain\scripts\OgreMain.vcproj", "{35AFBABB-DF05-43DE-91A7-BB828A874015}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_BSPSceneManager", "PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.vcproj", "{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}"
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_CgProgramManager", "PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.vcproj", "{1C741C2F-3278-43D8-9FD2-E631A64B70AE}"
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_OctreeSceneManager", "PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.vcproj", "{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}"
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_ParticleFX", "PlugIns\ParticleFX\scripts\Plugin_ParticleFX.vcproj", "{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}"
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReferenceAppLayer", "ReferenceApplication\ReferenceAppLayer\scripts\ReferenceAppLayer.vcproj", "{6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9}"
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_BspCollision", "ReferenceApplication\BspCollision\scripts\BspCollision.vcproj", "{1982C73F-3D1C-46A6-9DFB-C7B03310365B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9} = {6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RenderSystem_Direct3D9", "RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.vcproj", "{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}"
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RenderSystem_GL", "RenderSystems\GL\scripts\RenderSystem_GL.vcproj", "{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}"
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_BezierPatch", "Samples\BezierPatch\scripts\Demo_BezierPatch.vcproj", "{EDD4B978-5ABA-448B-8DA7-A02F99714D66}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_BSP", "Samples\BSP\scripts\Demo_BSP.vcproj", "{D5EAD9CA-691E-4367-BFCC-C671581851E4}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_CameraTrack", "Samples\CameraTrack\scripts\Demo_CameraTrack.vcproj", "{161D4349-5DB6-4BCC-A890-FC20A2BB181A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_CelShading", "Samples\CelShading\scripts\Demo_CelShading.vcproj", "{A0C80324-EF9A-41AE-A833-1CC909C38ABB}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_CubeMapping", "Samples\CubeMapping\scripts\Demo_CubeMapping.vcproj", "{89C04C44-50A4-47E3-BA46-8EA257329C80}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Dot3Bump", "Samples\Dot3Bump\scripts\Demo_Dot3Bump.vcproj", "{279EA6C7-59CF-48E4-BAC7-3C356A8114F6}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_EnvMapping", "Samples\EnvMapping\scripts\Demo_EnvMapping.vcproj", "{40308138-609B-4162-AA55-E8E02BF207F0}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Fresnel", "Samples\Fresnel\scripts\Demo_Fresnel.vcproj", "{B5E6BAD4-960F-418B-8904-FE93EC51947B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Lighting", "Samples\Lighting\scripts\Demo_Lighting.vcproj", "{09F9E809-02CF-4926-8203-2B9C02FBD916}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_ParticleFX", "Samples\ParticleFX\scripts\Demo_ParticleFX.vcproj", "{74204563-3B14-42A3-B9E6-8E3201D571BC}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_RenderToTexture", "Samples\RenderToTexture\scripts\Demo_RenderToTexture.vcproj", "{109F610E-9B23-4D05-819E-A7F27A42AA94}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_SkeletalAnimation", "Samples\SkeletalAnimation\scripts\Demo_SkeletalAnimation.vcproj", "{43E76713-7E47-4AB0-A2FE-F4296B5C3EF8}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_SkyBox", "Samples\SkyBox\scripts\Demo_SkyBox.vcproj", "{BC7E19F4-4B5D-4549-B473-E234011B6719}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_SkyDome", "Samples\SkyDome\scripts\Demo_SkyDome.vcproj", "{C9AF3D1F-44A3-413A-B137-264C6D559CED}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_SkyPlane", "Samples\SkyPlane\scripts\Demo_SkyPlane.vcproj", "{2EF34790-42A6-4722-925A-8255120A90E3}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Smoke", "Samples\Smoke\scripts\Demo_Smoke.vcproj", "{86B4ED07-3D95-45C3-B387-512046E95C68}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Terrain", "Samples\Terrain\scripts\Demo_Terrain.vcproj", "{1BB416AA-358A-4B4B-B565-14CE1BF9D4FD}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_TextureFX", "Samples\TextureFX\scripts\Demo_TextureFX.vcproj", "{4C359709-9A70-4ED8-9071-8BCF1BCD83E7}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Transparency", "Samples\Transpacency\scripts\Demo_Transparency.vcproj", "{AB50ACAA-ADE7-4554-B56B-68991C41D29A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Water", "Samples\Water\scripts\Demo_Water.vcproj", "{C7167FBD-F166-4DEA-B50B-9F25E28B75F6}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MaterialUpgrader", "Tools\MaterialUpgrader\scripts\MaterialUpgrader.vcproj", "{2BA1BBEE-CE27-48D6-A89D-EBAA81D40B6D}"
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeshUpgrader", "Tools\MeshUpgrader\scripts\MeshUpgrader.vcproj", "{6B3CABED-0D07-4AF0-8931-929B9B28BA8B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MilkshapeExport", "Tools\MilkshapeExport\scripts\MilkshapeExport.vcproj", "{D4929E45-2A25-4F53-96A1-E1BCD91D9B6A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XMLConverter", "Tools\XMLConverter\scripts\XMLConverter.vcproj", "{B4FB6BCF-FA5A-42C2-9FA5-F1653B95ADE3}"
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Shadows", "Samples\Shadows\scripts\Demo_Shadows.vcproj", "{F6C5DBF5-AD48-4F33-B824-595092CFE850}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_DynTex", "Samples\DynTex\scripts\Demo_DynTex.vcproj", "{8330C155-7C4B-4564-A7D9-946DE5A19B27}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_VolumeTex", "Samples\VolumeTex\scripts\Demo_VolumeTex.vcproj", "{E779DB4B-06BE-4453-A4DA-87646D7F1505}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Gui", "Samples\Gui\scripts\Demo_Gui.vcproj", "{0F83CA41-4364-49FF-A230-613B08B5CF82}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33} = {2250CA22-7F4D-4BC0-A8E7-B4400D209B33}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Grass", "Samples\Grass\scripts\Demo_Grass.vcproj", "{A6698238-7305-11D9-AAC8-91EC5E497716}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OgreGUIRenderer", "Samples\Common\CEGUIRenderer\scripts\OgreGUIRenderer.vcproj", "{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}"
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_DeferredShading", "Samples\DeferredShading\scripts\Demo_DeferredShading.vcproj", "{64715BCF-1A2B-46E0-9E6C-18470FAC8D4D}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Compositor", "Samples\Compositor\scripts\Demo_Compositor.vcproj", "{FBD73586-AD33-4191-A604-68AE21278729}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_FacialAnimation", "Samples\FacialAnimation\scripts\Demo_FacialAnimation.vcproj", "{7576D7EA-D4C5-4E06-B46E-B9EBF78B265B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33} = {2250CA22-7F4D-4BC0-A8E7-B4400D209B33}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Ocean", "Samples\OceanDemo\script\Demo_Ocean.vcproj", "{35134523-6D5B-4AFA-BFB4-4D57C42C2169}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33} = {2250CA22-7F4D-4BC0-A8E7-B4400D209B33}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Crowd", "Samples\Instancing\scripts\Demo_Crowd.vcproj", "{AA219712-966C-40DA-9B9A-FB4812DDC17A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33} = {2250CA22-7F4D-4BC0-A8E7-B4400D209B33}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Instancing", "Samples\Instancing\scripts\Demo_Instancing.vcproj", "{E5D4F8AE-310D-4A1E-A77E-FBF9BCA04E05}"
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33} = {2250CA22-7F4D-4BC0-A8E7-B4400D209B33}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectDependencies) = postSolution
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.Debug.ActiveCfg = Debug|Win32
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.Debug.Build.0 = Debug|Win32
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.Release.ActiveCfg = Release|Win32
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.Release.Build.0 = Release|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Debug.ActiveCfg = Debug|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Debug.Build.0 = Debug|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release.ActiveCfg = Release|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release.Build.0 = Release|Win32
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE}.Debug.ActiveCfg = Debug|Win32
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE}.Debug.Build.0 = Debug|Win32
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE}.Release.ActiveCfg = Release|Win32
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE}.Release.Build.0 = Release|Win32
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}.Debug.ActiveCfg = Debug|Win32
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}.Debug.Build.0 = Debug|Win32
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}.Release.ActiveCfg = Release|Win32
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}.Release.Build.0 = Release|Win32
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}.Debug.ActiveCfg = Debug|Win32
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}.Debug.Build.0 = Debug|Win32
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}.Release.ActiveCfg = Release|Win32
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}.Release.Build.0 = Release|Win32
+		{6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9}.Debug.ActiveCfg = Debug|Win32
+		{6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9}.Debug.Build.0 = Debug|Win32
+		{6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9}.Release.ActiveCfg = Release|Win32
+		{6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9}.Release.Build.0 = Release|Win32
+		{1982C73F-3D1C-46A6-9DFB-C7B03310365B}.Debug.ActiveCfg = Debug|Win32
+		{1982C73F-3D1C-46A6-9DFB-C7B03310365B}.Debug.Build.0 = Debug|Win32
+		{1982C73F-3D1C-46A6-9DFB-C7B03310365B}.Release.ActiveCfg = Release|Win32
+		{1982C73F-3D1C-46A6-9DFB-C7B03310365B}.Release.Build.0 = Release|Win32
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}.Debug.ActiveCfg = Debug|Win32
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}.Debug.Build.0 = Debug|Win32
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}.Release.ActiveCfg = Release|Win32
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}.Release.Build.0 = Release|Win32
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}.Debug.ActiveCfg = Debug|Win32
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}.Debug.Build.0 = Debug|Win32
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}.Release.ActiveCfg = Release|Win32
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}.Release.Build.0 = Release|Win32
+		{EDD4B978-5ABA-448B-8DA7-A02F99714D66}.Debug.ActiveCfg = Debug|Win32
+		{EDD4B978-5ABA-448B-8DA7-A02F99714D66}.Debug.Build.0 = Debug|Win32
+		{EDD4B978-5ABA-448B-8DA7-A02F99714D66}.Release.ActiveCfg = Release|Win32
+		{EDD4B978-5ABA-448B-8DA7-A02F99714D66}.Release.Build.0 = Release|Win32
+		{D5EAD9CA-691E-4367-BFCC-C671581851E4}.Debug.ActiveCfg = Debug|Win32
+		{D5EAD9CA-691E-4367-BFCC-C671581851E4}.Debug.Build.0 = Debug|Win32
+		{D5EAD9CA-691E-4367-BFCC-C671581851E4}.Release.ActiveCfg = Release|Win32
+		{D5EAD9CA-691E-4367-BFCC-C671581851E4}.Release.Build.0 = Release|Win32
+		{161D4349-5DB6-4BCC-A890-FC20A2BB181A}.Debug.ActiveCfg = Debug|Win32
+		{161D4349-5DB6-4BCC-A890-FC20A2BB181A}.Debug.Build.0 = Debug|Win32
+		{161D4349-5DB6-4BCC-A890-FC20A2BB181A}.Release.ActiveCfg = Release|Win32
+		{161D4349-5DB6-4BCC-A890-FC20A2BB181A}.Release.Build.0 = Release|Win32
+		{A0C80324-EF9A-41AE-A833-1CC909C38ABB}.Debug.ActiveCfg = Debug|Win32
+		{A0C80324-EF9A-41AE-A833-1CC909C38ABB}.Debug.Build.0 = Debug|Win32
+		{A0C80324-EF9A-41AE-A833-1CC909C38ABB}.Release.ActiveCfg = Release|Win32
+		{A0C80324-EF9A-41AE-A833-1CC909C38ABB}.Release.Build.0 = Release|Win32
+		{89C04C44-50A4-47E3-BA46-8EA257329C80}.Debug.ActiveCfg = Debug|Win32
+		{89C04C44-50A4-47E3-BA46-8EA257329C80}.Debug.Build.0 = Debug|Win32
+		{89C04C44-50A4-47E3-BA46-8EA257329C80}.Release.ActiveCfg = Release|Win32
+		{89C04C44-50A4-47E3-BA46-8EA257329C80}.Release.Build.0 = Release|Win32
+		{279EA6C7-59CF-48E4-BAC7-3C356A8114F6}.Debug.ActiveCfg = Debug|Win32
+		{279EA6C7-59CF-48E4-BAC7-3C356A8114F6}.Debug.Build.0 = Debug|Win32
+		{279EA6C7-59CF-48E4-BAC7-3C356A8114F6}.Release.ActiveCfg = Release|Win32
+		{279EA6C7-59CF-48E4-BAC7-3C356A8114F6}.Release.Build.0 = Release|Win32
+		{40308138-609B-4162-AA55-E8E02BF207F0}.Debug.ActiveCfg = Debug|Win32
+		{40308138-609B-4162-AA55-E8E02BF207F0}.Debug.Build.0 = Debug|Win32
+		{40308138-609B-4162-AA55-E8E02BF207F0}.Release.ActiveCfg = Release|Win32
+		{40308138-609B-4162-AA55-E8E02BF207F0}.Release.Build.0 = Release|Win32
+		{B5E6BAD4-960F-418B-8904-FE93EC51947B}.Debug.ActiveCfg = Debug|Win32
+		{B5E6BAD4-960F-418B-8904-FE93EC51947B}.Debug.Build.0 = Debug|Win32
+		{B5E6BAD4-960F-418B-8904-FE93EC51947B}.Release.ActiveCfg = Release|Win32
+		{B5E6BAD4-960F-418B-8904-FE93EC51947B}.Release.Build.0 = Release|Win32
+		{09F9E809-02CF-4926-8203-2B9C02FBD916}.Debug.ActiveCfg = Debug|Win32
+		{09F9E809-02CF-4926-8203-2B9C02FBD916}.Debug.Build.0 = Debug|Win32
+		{09F9E809-02CF-4926-8203-2B9C02FBD916}.Release.ActiveCfg = Release|Win32
+		{09F9E809-02CF-4926-8203-2B9C02FBD916}.Release.Build.0 = Release|Win32
+		{74204563-3B14-42A3-B9E6-8E3201D571BC}.Debug.ActiveCfg = Debug|Win32
+		{74204563-3B14-42A3-B9E6-8E3201D571BC}.Debug.Build.0 = Debug|Win32
+		{74204563-3B14-42A3-B9E6-8E3201D571BC}.Release.ActiveCfg = Release|Win32
+		{74204563-3B14-42A3-B9E6-8E3201D571BC}.Release.Build.0 = Release|Win32
+		{109F610E-9B23-4D05-819E-A7F27A42AA94}.Debug.ActiveCfg = Debug|Win32
+		{109F610E-9B23-4D05-819E-A7F27A42AA94}.Debug.Build.0 = Debug|Win32
+		{109F610E-9B23-4D05-819E-A7F27A42AA94}.Release.ActiveCfg = Release|Win32
+		{109F610E-9B23-4D05-819E-A7F27A42AA94}.Release.Build.0 = Release|Win32
+		{43E76713-7E47-4AB0-A2FE-F4296B5C3EF8}.Debug.ActiveCfg = Debug|Win32
+		{43E76713-7E47-4AB0-A2FE-F4296B5C3EF8}.Debug.Build.0 = Debug|Win32
+		{43E76713-7E47-4AB0-A2FE-F4296B5C3EF8}.Release.ActiveCfg = Release|Win32
+		{43E76713-7E47-4AB0-A2FE-F4296B5C3EF8}.Release.Build.0 = Release|Win32
+		{BC7E19F4-4B5D-4549-B473-E234011B6719}.Debug.ActiveCfg = Debug|Win32
+		{BC7E19F4-4B5D-4549-B473-E234011B6719}.Debug.Build.0 = Debug|Win32
+		{BC7E19F4-4B5D-4549-B473-E234011B6719}.Release.ActiveCfg = Release|Win32
+		{BC7E19F4-4B5D-4549-B473-E234011B6719}.Release.Build.0 = Release|Win32
+		{C9AF3D1F-44A3-413A-B137-264C6D559CED}.Debug.ActiveCfg = Debug|Win32
+		{C9AF3D1F-44A3-413A-B137-264C6D559CED}.Debug.Build.0 = Debug|Win32
+		{C9AF3D1F-44A3-413A-B137-264C6D559CED}.Release.ActiveCfg = Release|Win32
+		{C9AF3D1F-44A3-413A-B137-264C6D559CED}.Release.Build.0 = Release|Win32
+		{2EF34790-42A6-4722-925A-8255120A90E3}.Debug.ActiveCfg = Debug|Win32
+		{2EF34790-42A6-4722-925A-8255120A90E3}.Debug.Build.0 = Debug|Win32
+		{2EF34790-42A6-4722-925A-8255120A90E3}.Release.ActiveCfg = Release|Win32
+		{2EF34790-42A6-4722-925A-8255120A90E3}.Release.Build.0 = Release|Win32
+		{86B4ED07-3D95-45C3-B387-512046E95C68}.Debug.ActiveCfg = Debug|Win32
+		{86B4ED07-3D95-45C3-B387-512046E95C68}.Debug.Build.0 = Debug|Win32
+		{86B4ED07-3D95-45C3-B387-512046E95C68}.Release.ActiveCfg = Release|Win32
+		{86B4ED07-3D95-45C3-B387-512046E95C68}.Release.Build.0 = Release|Win32
+		{1BB416AA-358A-4B4B-B565-14CE1BF9D4FD}.Debug.ActiveCfg = Debug|Win32
+		{1BB416AA-358A-4B4B-B565-14CE1BF9D4FD}.Debug.Build.0 = Debug|Win32
+		{1BB416AA-358A-4B4B-B565-14CE1BF9D4FD}.Release.ActiveCfg = Release|Win32
+		{1BB416AA-358A-4B4B-B565-14CE1BF9D4FD}.Release.Build.0 = Release|Win32
+		{4C359709-9A70-4ED8-9071-8BCF1BCD83E7}.Debug.ActiveCfg = Debug|Win32
+		{4C359709-9A70-4ED8-9071-8BCF1BCD83E7}.Debug.Build.0 = Debug|Win32
+		{4C359709-9A70-4ED8-9071-8BCF1BCD83E7}.Release.ActiveCfg = Release|Win32
+		{4C359709-9A70-4ED8-9071-8BCF1BCD83E7}.Release.Build.0 = Release|Win32
+		{AB50ACAA-ADE7-4554-B56B-68991C41D29A}.Debug.ActiveCfg = Debug|Win32
+		{AB50ACAA-ADE7-4554-B56B-68991C41D29A}.Debug.Build.0 = Debug|Win32
+		{AB50ACAA-ADE7-4554-B56B-68991C41D29A}.Release.ActiveCfg = Release|Win32
+		{AB50ACAA-ADE7-4554-B56B-68991C41D29A}.Release.Build.0 = Release|Win32
+		{C7167FBD-F166-4DEA-B50B-9F25E28B75F6}.Debug.ActiveCfg = Debug|Win32
+		{C7167FBD-F166-4DEA-B50B-9F25E28B75F6}.Debug.Build.0 = Debug|Win32
+		{C7167FBD-F166-4DEA-B50B-9F25E28B75F6}.Release.ActiveCfg = Release|Win32
+		{C7167FBD-F166-4DEA-B50B-9F25E28B75F6}.Release.Build.0 = Release|Win32
+		{2BA1BBEE-CE27-48D6-A89D-EBAA81D40B6D}.Debug.ActiveCfg = Debug|Win32
+		{2BA1BBEE-CE27-48D6-A89D-EBAA81D40B6D}.Debug.Build.0 = Debug|Win32
+		{2BA1BBEE-CE27-48D6-A89D-EBAA81D40B6D}.Release.ActiveCfg = Release|Win32
+		{2BA1BBEE-CE27-48D6-A89D-EBAA81D40B6D}.Release.Build.0 = Release|Win32
+		{6B3CABED-0D07-4AF0-8931-929B9B28BA8B}.Debug.ActiveCfg = Debug|Win32
+		{6B3CABED-0D07-4AF0-8931-929B9B28BA8B}.Debug.Build.0 = Debug|Win32
+		{6B3CABED-0D07-4AF0-8931-929B9B28BA8B}.Release.ActiveCfg = Release|Win32
+		{6B3CABED-0D07-4AF0-8931-929B9B28BA8B}.Release.Build.0 = Release|Win32
+		{D4929E45-2A25-4F53-96A1-E1BCD91D9B6A}.Debug.ActiveCfg = Debug|Win32
+		{D4929E45-2A25-4F53-96A1-E1BCD91D9B6A}.Debug.Build.0 = Debug|Win32
+		{D4929E45-2A25-4F53-96A1-E1BCD91D9B6A}.Release.ActiveCfg = Release|Win32
+		{D4929E45-2A25-4F53-96A1-E1BCD91D9B6A}.Release.Build.0 = Release|Win32
+		{B4FB6BCF-FA5A-42C2-9FA5-F1653B95ADE3}.Debug.ActiveCfg = Debug|Win32
+		{B4FB6BCF-FA5A-42C2-9FA5-F1653B95ADE3}.Debug.Build.0 = Debug|Win32
+		{B4FB6BCF-FA5A-42C2-9FA5-F1653B95ADE3}.Release.ActiveCfg = Release|Win32
+		{B4FB6BCF-FA5A-42C2-9FA5-F1653B95ADE3}.Release.Build.0 = Release|Win32
+		{F6C5DBF5-AD48-4F33-B824-595092CFE850}.Debug.ActiveCfg = Debug|Win32
+		{F6C5DBF5-AD48-4F33-B824-595092CFE850}.Debug.Build.0 = Debug|Win32
+		{F6C5DBF5-AD48-4F33-B824-595092CFE850}.Release.ActiveCfg = Release|Win32
+		{F6C5DBF5-AD48-4F33-B824-595092CFE850}.Release.Build.0 = Release|Win32
+		{8330C155-7C4B-4564-A7D9-946DE5A19B27}.Debug.ActiveCfg = Debug|Win32
+		{8330C155-7C4B-4564-A7D9-946DE5A19B27}.Debug.Build.0 = Debug|Win32
+		{8330C155-7C4B-4564-A7D9-946DE5A19B27}.Release.ActiveCfg = Release|Win32
+		{8330C155-7C4B-4564-A7D9-946DE5A19B27}.Release.Build.0 = Release|Win32
+		{E779DB4B-06BE-4453-A4DA-87646D7F1505}.Debug.ActiveCfg = Debug|Win32
+		{E779DB4B-06BE-4453-A4DA-87646D7F1505}.Debug.Build.0 = Debug|Win32
+		{E779DB4B-06BE-4453-A4DA-87646D7F1505}.Release.ActiveCfg = Release|Win32
+		{E779DB4B-06BE-4453-A4DA-87646D7F1505}.Release.Build.0 = Release|Win32
+		{0F83CA41-4364-49FF-A230-613B08B5CF82}.Debug.ActiveCfg = Debug|Win32
+		{0F83CA41-4364-49FF-A230-613B08B5CF82}.Debug.Build.0 = Debug|Win32
+		{0F83CA41-4364-49FF-A230-613B08B5CF82}.Release.ActiveCfg = Release|Win32
+		{0F83CA41-4364-49FF-A230-613B08B5CF82}.Release.Build.0 = Release|Win32
+		{A6698238-7305-11D9-AAC8-91EC5E497716}.Debug.ActiveCfg = Debug|Win32
+		{A6698238-7305-11D9-AAC8-91EC5E497716}.Debug.Build.0 = Debug|Win32
+		{A6698238-7305-11D9-AAC8-91EC5E497716}.Release.ActiveCfg = Release|Win32
+		{A6698238-7305-11D9-AAC8-91EC5E497716}.Release.Build.0 = Release|Win32
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}.Debug.ActiveCfg = Debug|Win32
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}.Debug.Build.0 = Debug|Win32
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}.Release.ActiveCfg = Release|Win32
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}.Release.Build.0 = Release|Win32
+		{64715BCF-1A2B-46E0-9E6C-18470FAC8D4D}.Debug.ActiveCfg = Debug|Win32
+		{64715BCF-1A2B-46E0-9E6C-18470FAC8D4D}.Debug.Build.0 = Debug|Win32
+		{64715BCF-1A2B-46E0-9E6C-18470FAC8D4D}.Release.ActiveCfg = Release|Win32
+		{64715BCF-1A2B-46E0-9E6C-18470FAC8D4D}.Release.Build.0 = Release|Win32
+		{FBD73586-AD33-4191-A604-68AE21278729}.Debug.ActiveCfg = Debug|Win32
+		{FBD73586-AD33-4191-A604-68AE21278729}.Debug.Build.0 = Debug|Win32
+		{FBD73586-AD33-4191-A604-68AE21278729}.Release.ActiveCfg = Release|Win32
+		{FBD73586-AD33-4191-A604-68AE21278729}.Release.Build.0 = Release|Win32
+		{7576D7EA-D4C5-4E06-B46E-B9EBF78B265B}.Debug.ActiveCfg = Debug|Win32
+		{7576D7EA-D4C5-4E06-B46E-B9EBF78B265B}.Debug.Build.0 = Debug|Win32
+		{7576D7EA-D4C5-4E06-B46E-B9EBF78B265B}.Release.ActiveCfg = Release|Win32
+		{7576D7EA-D4C5-4E06-B46E-B9EBF78B265B}.Release.Build.0 = Release|Win32
+		{35134523-6D5B-4AFA-BFB4-4D57C42C2169}.Debug.ActiveCfg = Debug|Win32
+		{35134523-6D5B-4AFA-BFB4-4D57C42C2169}.Debug.Build.0 = Debug|Win32
+		{35134523-6D5B-4AFA-BFB4-4D57C42C2169}.Release.ActiveCfg = Release|Win32
+		{35134523-6D5B-4AFA-BFB4-4D57C42C2169}.Release.Build.0 = Release|Win32
+		{AA219712-966C-40DA-9B9A-FB4812DDC17A}.Debug.ActiveCfg = Debug|Win32
+		{AA219712-966C-40DA-9B9A-FB4812DDC17A}.Debug.Build.0 = Debug|Win32
+		{AA219712-966C-40DA-9B9A-FB4812DDC17A}.Release.ActiveCfg = Release|Win32
+		{AA219712-966C-40DA-9B9A-FB4812DDC17A}.Release.Build.0 = Release|Win32
+		{E5D4F8AE-310D-4A1E-A77E-FBF9BCA04E05}.Debug.ActiveCfg = Debug|Win32
+		{E5D4F8AE-310D-4A1E-A77E-FBF9BCA04E05}.Debug.Build.0 = Debug|Win32
+		{E5D4F8AE-310D-4A1E-A77E-FBF9BCA04E05}.Release.ActiveCfg = Release|Win32
+		{E5D4F8AE-310D-4A1E-A77E-FBF9BCA04E05}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		DPBuild = 5
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
Index: /Ogre.workspace
===================================================================
--- /Ogre.workspace	(revision 5)
+++ /Ogre.workspace	(revision 5)
@@ -0,0 +1,335 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_workspace_file>
+	<Workspace title="Ogre  workspace">
+		<Project filename="OgreMain\scripts\OgreMain.cbp" active="1" />
+		<Project filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+		</Project>
+		<Project filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+		</Project>
+		<Project filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+		</Project>
+		<Project filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+		</Project>
+		<Project filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+		</Project>
+		<Project filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+		</Project>
+		<Project filename="Samples\Common\CEGUIRenderer\scripts\OgreGUIRenderer.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+		</Project>
+		<Project filename="ReferenceApplication\ReferenceAppLayer\scripts\ReferenceAppLayer.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+		</Project>
+		<Project filename="Samples\BezierPatch\scripts\Demo_BezierPatch.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\BSP\scripts\Demo_BSP.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="ReferenceApplication\BspCollision\scripts\BspCollision.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+			<Depends filename="ReferenceApplication\ReferenceAppLayer\scripts\ReferenceAppLayer.cbp" />
+		</Project>
+		<Project filename="Samples\CameraTrack\scripts\Demo_CameraTrack.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\CelShading\scripts\Demo_CelShading.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\Compositor\scripts\Demo_Compositor.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+			<Depends filename="Samples\Common\CEGUIRenderer\scripts\OgreGUIRenderer.cbp" />
+		</Project>
+		<Project filename="Samples\Instancing\scripts\Demo_Crowd.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+			<Depends filename="Samples\Common\CEGUIRenderer\scripts\OgreGUIRenderer.cbp" />
+		</Project>
+		<Project filename="Samples\CubeMapping\scripts\Demo_CubeMapping.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\DeferredShading\scripts\Demo_DeferredShading.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\Dot3Bump\scripts\Demo_Dot3Bump.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\DynTex\scripts\Demo_DynTex.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\EnvMapping\scripts\Demo_EnvMapping.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\FacialAnimation\scripts\Demo_FacialAnimation.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+			<Depends filename="Samples\Common\CEGUIRenderer\scripts\OgreGUIRenderer.cbp" />
+		</Project>
+		<Project filename="Samples\Fresnel\scripts\Demo_Fresnel.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\Grass\scripts\Demo_Grass.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\Gui\scripts\Demo_Gui.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+			<Depends filename="Samples\Common\CEGUIRenderer\scripts\OgreGUIRenderer.cbp" />
+		</Project>
+		<Project filename="Samples\Instancing\scripts\Demo_Instancing.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+			<Depends filename="Samples\Common\CEGUIRenderer\scripts\OgreGUIRenderer.cbp" />
+		</Project>
+		<Project filename="Samples\Lighting\scripts\Demo_Lighting.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\OceanDemo\script\Demo_Ocean.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+			<Depends filename="Samples\Common\CEGUIRenderer\scripts\OgreGUIRenderer.cbp" />
+		</Project>
+		<Project filename="Samples\ParticleFX\scripts\Demo_ParticleFX.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\RenderToTexture\scripts\Demo_RenderToTexture.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\Shadows\scripts\Demo_Shadows.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+			<Depends filename="Samples\Common\CEGUIRenderer\scripts\OgreGUIRenderer.cbp" />
+		</Project>
+		<Project filename="Samples\SkeletalAnimation\scripts\Demo_SkeletalAnimation.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\SkyBox\scripts\Demo_SkyBox.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\SkyDome\scripts\Demo_SkyDome.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\SkyPlane\scripts\Demo_SkyPlane.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\Smoke\scripts\Demo_Smoke.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\Terrain\scripts\Demo_Terrain.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\TextureFX\scripts\Demo_TextureFX.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\Transpacency\scripts\Demo_Transparency.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\VolumeTex\scripts\Demo_VolumeTex.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Samples\Water\scripts\Demo_Water.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL.cbp" />
+		</Project>
+		<Project filename="Tools\XMLConverter\scripts\XMLConverter.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+		</Project>
+		<Project filename="Tools\MeshUpgrader\scripts\MeshUpgrader.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+		</Project>
+		<Project filename="Tools\MaterialUpgrader\scripts\MaterialUpgrader.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain.cbp" />
+		</Project>
+	</Workspace>
+</CodeBlocks_workspace_file>
Index: /OgreMain/Makefile.am
===================================================================
--- /OgreMain/Makefile.am	(revision 5)
+++ /OgreMain/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /OgreMain/Makefile.in
===================================================================
--- /OgreMain/Makefile.in	(revision 5)
+++ /OgreMain/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = OgreMain
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  OgreMain/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  OgreMain/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /OgreMain/include/GLX/Makefile.am
===================================================================
--- /OgreMain/include/GLX/Makefile.am	(revision 5)
+++ /OgreMain/include/GLX/Makefile.am	(revision 5)
@@ -0,0 +1,4 @@
+pkgincludedir=$(prefix)/include/OGRE/GLX
+pkginclude_HEADERS = OgreConfigDialogImp.h \
+                     OgreErrorDialogImp.h \
+                     OgreTimerImp.h
Index: /OgreMain/include/GLX/Makefile.in
===================================================================
--- /OgreMain/include/GLX/Makefile.in	(revision 5)
+++ /OgreMain/include/GLX/Makefile.in	(revision 5)
@@ -0,0 +1,468 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = OgreMain/include/GLX
+DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkgincludedir)"
+pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(pkginclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+pkgincludedir = $(prefix)/include/OGRE/GLX
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+pkginclude_HEADERS = OgreConfigDialogImp.h \
+                     OgreErrorDialogImp.h \
+                     OgreTimerImp.h
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  OgreMain/include/GLX/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  OgreMain/include/GLX/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+install-pkgincludeHEADERS: $(pkginclude_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkgincludedir)" || $(mkdir_p) "$(DESTDIR)$(pkgincludedir)"
+	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
+	  $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
+	done
+
+uninstall-pkgincludeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(pkgincludedir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-pkgincludeHEADERS
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkgincludeHEADERS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-pkgincludeHEADERS \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-pkgincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /OgreMain/include/GLX/OgreConfigDialogImp.h
===================================================================
--- /OgreMain/include/GLX/OgreConfigDialogImp.h	(revision 5)
+++ /OgreMain/include/GLX/OgreConfigDialogImp.h	(revision 5)
@@ -0,0 +1,76 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+ 
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+ 
+This program 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 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 Lesser General Public License for more details.
+ 
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __GLXCONFIGDIALOG_H__
+#define __GLXCONFIGDIALOG_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+
+namespace Ogre
+{
+	/** Defines the behaviour of an automatic renderer configuration dialog.
+	@remarks
+		OGRE comes with it's own renderer configuration dialog, which
+		applications can use to easily allow the user to configure the
+		settings appropriate to their machine. This class defines the
+		interface to this standard dialog. Because dialogs are inherently
+		tied to a particular platform's windowing system, there will be a
+		different subclass for each platform.
+	@author
+		Steven J. Streeting
+	*/
+	class _OgreExport ConfigDialog
+	{
+	public:
+		ConfigDialog();
+
+		/** Displays the dialog.
+		@remarks
+			This method displays the dialog and from then on the dialog
+			interacts with the user independently. The dialog will be
+			calling the relevant OGRE rendering systems to query them for
+			options and to set the options the user selects. The method
+			returns when the user closes the dialog.
+		@returns
+			If the user accepted the dialog, <b>true</b> is returned.
+		@par
+			If the user cancelled the dialog (indicating the application
+			should probably terminate), <b>false</b> is returned.
+		@see
+			RenderSystem
+		*/
+		bool display();
+
+	protected:
+		RenderSystem* mSelectedRenderSystem;
+	};
+}
+#endif
Index: /OgreMain/include/GLX/OgreErrorDialogImp.h
===================================================================
--- /OgreMain/include/GLX/OgreErrorDialogImp.h	(revision 5)
+++ /OgreMain/include/GLX/OgreErrorDialogImp.h	(revision 5)
@@ -0,0 +1,53 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+ 
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+ 
+This program 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 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 Lesser General Public License for more details.
+ 
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OGRE_GLX_ERROR_DIALOG_H__
+#define __OGRE_GLX_ERROR_DIALOG_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre
+{
+	/** Class for displaying the error dialog if Ogre fails badly. */
+	class _OgreExport ErrorDialog
+	{
+	public:
+		ErrorDialog();
+
+		/**
+		@remarks
+			Displays the error dialog.
+		@param
+			errorMessage The error message which has caused the failure.
+		@param
+			logName Optional name of the log to display in the detail pane.
+		*/
+		void display(const String& errorMessage, String logName = "");
+	};
+}
+#endif
Index: /OgreMain/include/GLX/OgreTimerImp.h
===================================================================
--- /OgreMain/include/GLX/OgreTimerImp.h	(revision 5)
+++ /OgreMain/include/GLX/OgreTimerImp.h	(revision 5)
@@ -0,0 +1,63 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+ 
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+ 
+This program 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 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 Lesser General Public License for more details.
+ 
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __GLXTimer_H__
+#define __GLXTimer_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre
+{
+	/** Timer class */
+	class _OgreExport Timer
+	{
+	private:
+		struct timeval start;
+		clock_t zeroClock;
+	public:
+		Timer();
+		~Timer();
+
+		/** Resets timer */
+		void reset();
+
+		/** Returns milliseconds since initialisation or last reset */
+		unsigned long getMilliseconds();
+
+		/** Returns microseconds since initialisation or last reset */
+		unsigned long getMicroseconds();
+
+		/** Returns milliseconds since initialisation or last reset, only CPU time measured */	
+		unsigned long getMillisecondsCPU();
+
+		/** Returns microseconds since initialisation or last reset, only CPU time measured */	
+		unsigned long getMicrosecondsCPU();
+	};
+}
+#endif
Index: /OgreMain/include/Makefile.am
===================================================================
--- /OgreMain/include/Makefile.am	(revision 5)
+++ /OgreMain/include/Makefile.am	(revision 5)
@@ -0,0 +1,217 @@
+if !SAME_PLATFORM_AND_GUI
+	INCLUDE_SUBDIRS = $(OGRE_GUI)
+endif
+SUBDIRS = $(OGRE_PLATFORM) $(INCLUDE_SUBDIRS)
+
+pkginclude_HEADERS = Ogre.h \
+                     OgreAlignedAllocator.h \
+                     OgreArchive.h \
+                     OgreAnimable.h \
+                     OgreAnimation.h \
+                     OgreAnimationState.h \
+                     OgreAnimationTrack.h \
+                     OgreAny.h \
+                     OgreArchiveFactory.h \
+                     OgreArchiveManager.h \
+                     OgreAutoParamDataSource.h \
+                     OgreAxisAlignedBox.h \
+                     OgreBillboard.h \
+                     OgreBillboardChain.h \
+                     OgreBillboardParticleRenderer.h \
+                     OgreBillboardSet.h \
+                     OgreBitwise.h \
+                     OgreBlendMode.h \
+                     OgreBone.h \
+                     OgreBorderPanelOverlayElement.h \
+                     OgreCamera.h \
+                     OgreCodec.h \
+                     OgreColourValue.h \
+                     OgreCommon.h \
+                     OgreConfig.h \
+                     OgreConfigDialog.h \
+                     OgreConfigFile.h \
+                     OgreConfigOptionMap.h \
+                     OgreController.h \
+                     OgreControllerManager.h \
+                     OgreConvexBody.h \
+                     OgreDataStream.h \
+                     OgreDDSCodec.h \
+                     OgreDefaultHardwareBufferManager.h \
+                     OgreDynLib.h \
+                     OgreDynLibManager.h \
+                     OgreEdgeListBuilder.h \
+                     OgreEntity.h \
+                     OgreErrorDialog.h \
+                     OgreException.h \
+                     OgreExternalTextureSource.h \
+                     OgreExternalTextureSourceManager.h \
+                     OgreFactoryObj.h \
+                     OgreFileSystem.h \
+                     OgreFont.h \
+                     OgreFontManager.h \
+                     OgreFrameListener.h \
+                     OgreFreeImageCodec.h \
+                     OgreFrustum.h \
+                     OgreGpuProgram.h \
+                     OgreGpuProgramManager.h \
+                     OgreGpuProgramUsage.h \
+                     OgreHardwareBuffer.h \
+                     OgreHardwareBufferManager.h \
+                     OgreHardwareIndexBuffer.h \
+                     OgreHardwareOcclusionQuery.h \
+                     OgreHardwarePixelBuffer.h \
+                     OgreHardwareVertexBuffer.h \
+                     OgreHighLevelGpuProgram.h \
+                     OgreHighLevelGpuProgramManager.h \
+                     OgreILUtil.h \
+                     OgreILCodecs.h \
+                     OgreILImageCodec.h \
+                     OgreImage.h \
+                     OgreImageCodec.h \
+                     OgreInstancedGeometry.h \
+                     OgreIteratorWrappers.h \
+                     OgreKeyFrame.h \
+                     OgreLight.h \
+                     OgreLog.h \
+                     OgreLogManager.h \
+                     OgreManualObject.h \
+                     OgreMaterial.h \
+                     OgreMaterialManager.h \
+                     OgreMaterialSerializer.h \
+                     OgreMaterialScriptCompiler.h \
+                     OgreMath.h \
+                     OgreMatrix3.h \
+                     OgreMatrix4.h \
+                     OgreMemoryMacros.h \
+                     OgreMemoryManager.h \
+                     OgreMesh.h \
+                     OgreMeshFileFormat.h \
+                     OgreMeshManager.h \
+                     OgreMeshSerializer.h \
+                     OgreMeshSerializerImpl.h \
+                     OgreMovableObject.h \
+                     OgreMovablePlane.h \
+                     OgreNoMemoryMacros.h \
+                     OgreNode.h \
+                     OgreNumerics.h \
+                     OgreOverlay.h \
+                     OgreOverlayContainer.h \
+                     OgreOverlayElement.h \
+                     OgreOverlayElementCommands.h \
+                     OgreOverlayElementFactory.h \
+                     OgreOverlayManager.h \
+                     OgrePanelOverlayElement.h \
+                     OgreParticle.h \
+                     OgreParticleAffector.h \
+                     OgreParticleAffectorFactory.h \
+                     OgreParticleEmitter.h \
+                     OgreParticleEmitterCommands.h \
+                     OgreParticleEmitterFactory.h \
+                     OgreParticleIterator.h \
+                     OgreParticleSystem.h \
+                     OgreParticleSystemManager.h \
+                     OgreParticleSystemRenderer.h \
+                     OgrePass.h \
+                     OgrePatchMesh.h \
+                     OgrePatchSurface.h \
+                     OgrePixelFormat.h \
+                     OgrePlane.h \
+                     OgrePlaneBoundedVolume.h \
+                     OgrePlatform.h \
+                     OgrePlugin.h \
+                     OgrePolygon.h \
+                     OgrePose.h \
+                     OgrePredefinedControllers.h \
+                     OgrePrefabFactory.h \
+                     OgrePrerequisites.h \
+                     OgreProfiler.h \
+                     OgreProgressiveMesh.h \
+                     OgreQuaternion.h \
+                     OgreRadixSort.h \
+                     OgreRay.h \
+                     OgreRectangle.h \
+                     OgreRectangle2D.h \
+                     OgreRenderOperation.h \
+                     OgreRenderQueue.h \
+                     OgreRenderQueueInvocation.h \
+                     OgreRenderQueueListener.h \
+                     OgreRenderQueueSortingGrouping.h \
+                     OgreRenderSystem.h \
+                     OgreRenderSystemCapabilities.h \
+                     OgreRenderTarget.h \
+                     OgreRenderTargetListener.h \
+                     OgreRenderTexture.h \
+                     OgreRenderWindow.h \
+                     OgreRenderable.h \
+                     OgreResource.h \
+                     OgreResourceBackgroundQueue.h \
+                     OgreResourceGroupManager.h \
+                     OgreResourceManager.h \
+                     OgreRibbonTrail.h \
+                     OgreRoot.h \
+                     OgreRotationalSpline.h \
+                     OgreSceneManager.h \
+                     OgreSceneManagerEnumerator.h \
+                     OgreSceneNode.h \
+                     OgreSceneQuery.h \
+                     OgreScriptLoader.h \
+                     OgreSearchOps.h \
+                     OgreSerializer.h \
+                     OgreShadowCameraSetup.h \
+                     OgreShadowCameraSetupFocused.h \
+                     OgreShadowCameraSetupLiSPSM.h \
+                     OgreShadowCameraSetupPlaneOptimal.h \
+                     OgreShadowCaster.h \
+                     OgreShadowTextureManager.h \
+                     OgreShadowVolumeExtrudeProgram.h \
+                     OgreSharedPtr.h \
+                     OgreSimpleRenderable.h \
+                     OgreSimpleSpline.h \
+                     OgreSingleton.h \
+                     OgreSkeleton.h \
+                     OgreSkeletonInstance.h \
+                     OgreSkeletonFileFormat.h \
+                     OgreSkeletonManager.h \
+                     OgreSkeletonSerializer.h \
+                     OgreSphere.h \
+                     OgreSpotShadowFadePng.h \
+                     OgreStableHeaders.h \
+                     OgreStaticFaceGroup.h \
+                     OgreStaticGeometry.h \
+                     OgreStdHeaders.h \
+                     OgreString.h \
+                     OgreStringConverter.h \
+                     OgreStringInterface.h \
+                     OgreStringVector.h \
+                     OgreSubEntity.h \
+                     OgreSubMesh.h \
+                     OgreTagPoint.h \
+                     OgreTechnique.h \
+                     OgreTextAreaOverlayElement.h \
+                     OgreTextureUnitState.h \
+                     OgreTexture.h \
+                     OgreTextureManager.h \
+                     OgreTimer.h \
+                     OgreUnifiedHighLevelGpuProgram.h \
+                     OgreUserDefinedObject.h \
+                     OgreUTFString.h \
+                     OgreVector2.h \
+                     OgreVector3.h \
+                     OgreVector4.h \
+                     OgreVertexBoneAssignment.h \
+                     OgreVertexIndexData.h \
+                     OgreViewport.h \
+                     OgreWireBoundingBox.h \
+                     OgreZip.h \
+                     OgreCompositor.h \
+                     OgreCompositorChain.h \
+                     OgreCompositorInstance.h \
+                     OgreCompositorManager.h \
+                     OgreCompositorSerializer.h \
+                     OgreCompositionTechnique.h \
+                     OgreCompositionPass.h \
+                     OgreCompositionTargetPass.h \
+                     OgreCompositorScriptCompiler.h \
+                     OgreCompiler2Pass.h \
+                     asm_math.h \
+                     OgreWindowEventUtilities.h
Index: /OgreMain/include/Makefile.in
===================================================================
--- /OgreMain/include/Makefile.in	(revision 5)
+++ /OgreMain/include/Makefile.in	(revision 5)
@@ -0,0 +1,809 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = OgreMain/include
+DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(srcdir)/config.h.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkgincludedir)"
+pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(pkginclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = $(OGRE_PLATFORM) $(INCLUDE_SUBDIRS)
+pkginclude_HEADERS = Ogre.h \
+                     OgreAlignedAllocator.h \
+                     OgreArchive.h \
+                     OgreAnimable.h \
+                     OgreAnimation.h \
+                     OgreAnimationState.h \
+                     OgreAnimationTrack.h \
+                     OgreAny.h \
+                     OgreArchiveFactory.h \
+                     OgreArchiveManager.h \
+                     OgreAutoParamDataSource.h \
+                     OgreAxisAlignedBox.h \
+                     OgreBillboard.h \
+                     OgreBillboardChain.h \
+                     OgreBillboardParticleRenderer.h \
+                     OgreBillboardSet.h \
+                     OgreBitwise.h \
+                     OgreBlendMode.h \
+                     OgreBone.h \
+                     OgreBorderPanelOverlayElement.h \
+                     OgreCamera.h \
+                     OgreCodec.h \
+                     OgreColourValue.h \
+                     OgreCommon.h \
+                     OgreConfig.h \
+                     OgreConfigDialog.h \
+                     OgreConfigFile.h \
+                     OgreConfigOptionMap.h \
+                     OgreController.h \
+                     OgreControllerManager.h \
+                     OgreConvexBody.h \
+                     OgreDataStream.h \
+                     OgreDDSCodec.h \
+                     OgreDefaultHardwareBufferManager.h \
+                     OgreDynLib.h \
+                     OgreDynLibManager.h \
+                     OgreEdgeListBuilder.h \
+                     OgreEntity.h \
+                     OgreErrorDialog.h \
+                     OgreException.h \
+                     OgreExternalTextureSource.h \
+                     OgreExternalTextureSourceManager.h \
+                     OgreFactoryObj.h \
+                     OgreFileSystem.h \
+                     OgreFont.h \
+                     OgreFontManager.h \
+                     OgreFrameListener.h \
+                     OgreFreeImageCodec.h \
+                     OgreFrustum.h \
+                     OgreGpuProgram.h \
+                     OgreGpuProgramManager.h \
+                     OgreGpuProgramUsage.h \
+                     OgreHardwareBuffer.h \
+                     OgreHardwareBufferManager.h \
+                     OgreHardwareIndexBuffer.h \
+                     OgreHardwareOcclusionQuery.h \
+                     OgreHardwarePixelBuffer.h \
+                     OgreHardwareVertexBuffer.h \
+                     OgreHighLevelGpuProgram.h \
+                     OgreHighLevelGpuProgramManager.h \
+                     OgreILUtil.h \
+                     OgreILCodecs.h \
+                     OgreILImageCodec.h \
+                     OgreImage.h \
+                     OgreImageCodec.h \
+                     OgreInstancedGeometry.h \
+                     OgreIteratorWrappers.h \
+                     OgreKeyFrame.h \
+                     OgreLight.h \
+                     OgreLog.h \
+                     OgreLogManager.h \
+                     OgreManualObject.h \
+                     OgreMaterial.h \
+                     OgreMaterialManager.h \
+                     OgreMaterialSerializer.h \
+                     OgreMaterialScriptCompiler.h \
+                     OgreMath.h \
+                     OgreMatrix3.h \
+                     OgreMatrix4.h \
+                     OgreMemoryMacros.h \
+                     OgreMemoryManager.h \
+                     OgreMesh.h \
+                     OgreMeshFileFormat.h \
+                     OgreMeshManager.h \
+                     OgreMeshSerializer.h \
+                     OgreMeshSerializerImpl.h \
+                     OgreMovableObject.h \
+                     OgreMovablePlane.h \
+                     OgreNoMemoryMacros.h \
+                     OgreNode.h \
+                     OgreNumerics.h \
+                     OgreOverlay.h \
+                     OgreOverlayContainer.h \
+                     OgreOverlayElement.h \
+                     OgreOverlayElementCommands.h \
+                     OgreOverlayElementFactory.h \
+                     OgreOverlayManager.h \
+                     OgrePanelOverlayElement.h \
+                     OgreParticle.h \
+                     OgreParticleAffector.h \
+                     OgreParticleAffectorFactory.h \
+                     OgreParticleEmitter.h \
+                     OgreParticleEmitterCommands.h \
+                     OgreParticleEmitterFactory.h \
+                     OgreParticleIterator.h \
+                     OgreParticleSystem.h \
+                     OgreParticleSystemManager.h \
+                     OgreParticleSystemRenderer.h \
+                     OgrePass.h \
+                     OgrePatchMesh.h \
+                     OgrePatchSurface.h \
+                     OgrePixelFormat.h \
+                     OgrePlane.h \
+                     OgrePlaneBoundedVolume.h \
+                     OgrePlatform.h \
+                     OgrePlugin.h \
+                     OgrePolygon.h \
+                     OgrePose.h \
+                     OgrePredefinedControllers.h \
+                     OgrePrefabFactory.h \
+                     OgrePrerequisites.h \
+                     OgreProfiler.h \
+                     OgreProgressiveMesh.h \
+                     OgreQuaternion.h \
+                     OgreRadixSort.h \
+                     OgreRay.h \
+                     OgreRectangle.h \
+                     OgreRectangle2D.h \
+                     OgreRenderOperation.h \
+                     OgreRenderQueue.h \
+                     OgreRenderQueueInvocation.h \
+                     OgreRenderQueueListener.h \
+                     OgreRenderQueueSortingGrouping.h \
+                     OgreRenderSystem.h \
+                     OgreRenderSystemCapabilities.h \
+                     OgreRenderTarget.h \
+                     OgreRenderTargetListener.h \
+                     OgreRenderTexture.h \
+                     OgreRenderWindow.h \
+                     OgreRenderable.h \
+                     OgreResource.h \
+                     OgreResourceBackgroundQueue.h \
+                     OgreResourceGroupManager.h \
+                     OgreResourceManager.h \
+                     OgreRibbonTrail.h \
+                     OgreRoot.h \
+                     OgreRotationalSpline.h \
+                     OgreSceneManager.h \
+                     OgreSceneManagerEnumerator.h \
+                     OgreSceneNode.h \
+                     OgreSceneQuery.h \
+                     OgreScriptLoader.h \
+                     OgreSearchOps.h \
+                     OgreSerializer.h \
+                     OgreShadowCameraSetup.h \
+                     OgreShadowCameraSetupFocused.h \
+                     OgreShadowCameraSetupLiSPSM.h \
+                     OgreShadowCameraSetupPlaneOptimal.h \
+                     OgreShadowCaster.h \
+                     OgreShadowTextureManager.h \
+                     OgreShadowVolumeExtrudeProgram.h \
+                     OgreSharedPtr.h \
+                     OgreSimpleRenderable.h \
+                     OgreSimpleSpline.h \
+                     OgreSingleton.h \
+                     OgreSkeleton.h \
+                     OgreSkeletonInstance.h \
+                     OgreSkeletonFileFormat.h \
+                     OgreSkeletonManager.h \
+                     OgreSkeletonSerializer.h \
+                     OgreSphere.h \
+                     OgreSpotShadowFadePng.h \
+                     OgreStableHeaders.h \
+                     OgreStaticFaceGroup.h \
+                     OgreStaticGeometry.h \
+                     OgreStdHeaders.h \
+                     OgreString.h \
+                     OgreStringConverter.h \
+                     OgreStringInterface.h \
+                     OgreStringVector.h \
+                     OgreSubEntity.h \
+                     OgreSubMesh.h \
+                     OgreTagPoint.h \
+                     OgreTechnique.h \
+                     OgreTextAreaOverlayElement.h \
+                     OgreTextureUnitState.h \
+                     OgreTexture.h \
+                     OgreTextureManager.h \
+                     OgreTimer.h \
+                     OgreUnifiedHighLevelGpuProgram.h \
+                     OgreUserDefinedObject.h \
+                     OgreUTFString.h \
+                     OgreVector2.h \
+                     OgreVector3.h \
+                     OgreVector4.h \
+                     OgreVertexBoneAssignment.h \
+                     OgreVertexIndexData.h \
+                     OgreViewport.h \
+                     OgreWireBoundingBox.h \
+                     OgreZip.h \
+                     OgreCompositor.h \
+                     OgreCompositorChain.h \
+                     OgreCompositorInstance.h \
+                     OgreCompositorManager.h \
+                     OgreCompositorSerializer.h \
+                     OgreCompositionTechnique.h \
+                     OgreCompositionPass.h \
+                     OgreCompositionTargetPass.h \
+                     OgreCompositorScriptCompiler.h \
+                     OgreCompiler2Pass.h \
+                     asm_math.h \
+                     OgreWindowEventUtilities.h
+
+all: config.h
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  OgreMain/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  OgreMain/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+config.h: stamp-h1
+	@if test ! -f $@; then \
+	  rm -f stamp-h1; \
+	  $(MAKE) stamp-h1; \
+	else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+	@rm -f stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status OgreMain/include/config.h
+$(srcdir)/config.h.in:  $(am__configure_deps) 
+	cd $(top_srcdir) && $(AUTOHEADER)
+	rm -f stamp-h1
+	touch $@
+
+distclean-hdr:
+	-rm -f config.h stamp-h1
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+install-pkgincludeHEADERS: $(pkginclude_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkgincludedir)" || $(mkdir_p) "$(DESTDIR)$(pkgincludedir)"
+	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
+	  $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
+	done
+
+uninstall-pkgincludeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
+	done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(HEADERS) config.h
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(pkgincludedir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+	distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-pkgincludeHEADERS
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkgincludeHEADERS
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-hdr \
+	distclean-libtool distclean-recursive distclean-tags distdir \
+	dvi dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-exec install-exec-am \
+	install-info install-info-am install-man \
+	install-pkgincludeHEADERS install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am \
+	uninstall-pkgincludeHEADERS
+
+@SAME_PLATFORM_AND_GUI_FALSE@	INCLUDE_SUBDIRS = $(OGRE_GUI)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /OgreMain/include/OSX/OgreConfigDialogImp.h
===================================================================
--- /OgreMain/include/OSX/OgreConfigDialogImp.h	(revision 5)
+++ /OgreMain/include/OSX/OgreConfigDialogImp.h	(revision 5)
@@ -0,0 +1,42 @@
+#ifndef __OSXConfigDialog_H__
+#define __OSXConfigDialog_H__
+
+#include <Ogre/OgrePrerequisites.h>
+#include <Ogre/OgreRoot.h>
+#include <Ogre/OgreRenderSystem.h>
+
+namespace Ogre
+{
+	class ConfigDialog
+	{
+	public:
+		ConfigDialog();
+		~ConfigDialog();
+	
+	public:
+		void initialise();
+		void run();
+		void cancel();
+
+		bool display();
+
+	public:
+		static pascal OSStatus windowEventHandler( EventHandlerCallRef aNextHandler, EventRef aEvent, void* aUserData );
+
+	protected:
+		RenderSystem* iSelectedRenderSystem;
+		HIViewRef	iLogoViewRef;
+		HIViewRef	iVideoModeRef;
+		HIViewRef	iColorDepthRef;
+		HIViewRef	iFSAARef;
+		HIViewRef	iRTTPrefModeRef;
+		HIViewRef	iFullScreenRef;
+		WindowRef	iWindowRef;
+		IBNibRef	iNibRef;
+		MenuRef		iMenuRef;
+		MenuID		iMenuID;
+		bool		iDisplayStatus;		
+	};
+}
+
+#endif // __OSX_CONFIG_DIALOG_H__
Index: /OgreMain/include/OSX/OgreErrorDialogImp.h
===================================================================
--- /OgreMain/include/OSX/OgreErrorDialogImp.h	(revision 5)
+++ /OgreMain/include/OSX/OgreErrorDialogImp.h	(revision 5)
@@ -0,0 +1,53 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+ 
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+ 
+This program 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 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 Lesser General Public License for more details.
+ 
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OSXErrorDialog_H__
+#define __OSXErrorDialog_H__
+
+#include <Ogre/OgrePrerequisites.h>
+
+namespace Ogre
+{
+	/** Class for displaying the error dialog if Ogre fails badly. */
+	class ErrorDialog
+	{
+	public:
+		ErrorDialog();
+
+		/**
+		@remarks
+			Displays the error dialog.
+		@param
+			errorMessage The error message which has caused the failure.
+		@param
+			logName Optional name of the log to display in the detail pane.
+		*/
+		void display(const String& errorMessage, String logName = "");
+	};
+}
+#endif
Index: /OgreMain/include/OSX/OgreTimerImp.h
===================================================================
--- /OgreMain/include/OSX/OgreTimerImp.h	(revision 5)
+++ /OgreMain/include/OSX/OgreTimerImp.h	(revision 5)
@@ -0,0 +1,63 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+ 
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+ 
+This program 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 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 Lesser General Public License for more details.
+ 
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __OSXTimer_H__
+#define __OSXTimer_H__
+
+#include <Ogre/OgrePrerequisites.h>
+
+namespace Ogre
+{
+	/** Timer class */
+	class Timer
+	{
+	private:
+		struct timeval start;
+		clock_t zeroClock;
+	public:
+		Timer();
+		~Timer();
+
+		/** Resets timer */
+		void reset();
+
+		/** Returns milliseconds since initialisation or last reset */
+		unsigned long getMilliseconds();
+
+		/** Returns microseconds since initialisation or last reset */
+		unsigned long getMicroseconds();
+
+		/** Returns milliseconds since initialisation or last reset, only CPU time measured */	
+		unsigned long getMillisecondsCPU();
+
+		/** Returns microseconds since initialisation or last reset, only CPU time measured */	
+		unsigned long getMicrosecondsCPU();
+	};
+}
+#endif
Index: /OgreMain/include/Ogre.h
===================================================================
--- /OgreMain/include/Ogre.h	(revision 5)
+++ /OgreMain/include/Ogre.h	(revision 5)
@@ -0,0 +1,130 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _Ogre_H__
+#define _Ogre_H__
+// This file includes all the other files which you will need to build a client application
+#include "OgrePrerequisites.h"
+
+#include "OgreAnimation.h"
+#include "OgreAnimationState.h"
+#include "OgreAnimationTrack.h"
+#include "OgreAny.h"
+#include "OgreArchive.h"
+#include "OgreArchiveManager.h"
+#include "OgreAxisAlignedBox.h"
+#include "OgreBillboardChain.h"
+#include "OgreBillboardSet.h"
+#include "OgreBone.h"
+#include "OgreCamera.h"
+#include "OgreConfigFile.h"
+#include "OgreControllerManager.h"
+#include "OgreDataStream.h"
+#include "OgreEntity.h"
+#include "OgreException.h"
+#include "OgreFrustum.h"
+#include "OgreGpuProgram.h"
+#include "OgreGpuProgramManager.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreHardwareIndexBuffer.h"
+#include "OgreHardwarePixelBuffer.h"
+#include "OgreHardwareOcclusionQuery.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreHardwarePixelBuffer.h"
+#include "OgreHighLevelGpuProgram.h"
+#include "OgreHighLevelGpuProgramManager.h"
+#include "OgreKeyFrame.h"
+#include "OgreLight.h"
+#include "OgreLogManager.h"
+#include "OgreManualObject.h"
+#include "OgreMaterial.h"
+#include "OgreMaterialManager.h"
+#include "OgreMaterialSerializer.h"
+#include "OgreMath.h"
+#include "OgreMatrix3.h"
+#include "OgreMatrix4.h"
+#include "OgreMesh.h"
+#include "OgreMeshManager.h"
+#include "OgreMeshSerializer.h"
+#include "OgreOverlay.h"
+#include "OgreOverlayContainer.h"
+#include "OgreOverlayElement.h"
+#include "OgreOverlayManager.h"
+#include "OgreParticleAffector.h"
+#include "OgreParticleEmitter.h"
+#include "OgreParticleSystemManager.h"
+#include "OgrePass.h"
+#include "OgrePatchMesh.h"
+#include "OgrePatchSurface.h"
+#include "OgreProfiler.h"
+#include "OgreRadixSort.h"
+#include "OgreRenderQueueInvocation.h"
+#include "OgreRenderQueueListener.h"
+#include "OgreRenderSystem.h"
+#include "OgreRenderTargetListener.h"
+#include "OgreRenderTexture.h"
+#include "OgreRenderWindow.h"
+#include "OgreResourceBackgroundQueue.h"
+#include "OgreResourceGroupManager.h"
+#include "OgreRibbonTrail.h"
+#include "OgreRoot.h"
+#include "OgreSceneManager.h"
+#include "OgreSceneManagerEnumerator.h"
+#include "OgreSceneNode.h"
+#include "OgreSimpleRenderable.h"
+#include "OgreSkeleton.h"
+#include "OgreSkeletonInstance.h"
+#include "OgreSkeletonManager.h"
+#include "OgreSkeletonSerializer.h"
+#include "OgreStaticGeometry.h"
+#include "OgreString.h"
+#include "OgreStringConverter.h"
+#include "OgreStringVector.h"
+#include "OgreSubEntity.h"
+#include "OgreSubMesh.h"
+#include "OgreTechnique.h"
+#include "OgreTextureManager.h"
+#include "OgreTextureUnitState.h"
+#include "OgreUserDefinedObject.h"
+#include "OgreVector2.h"
+#include "OgreViewport.h"
+#include "OgreCompositor.h"
+#include "OgreCompositorManager.h"
+#include "OgreCompositorChain.h"
+#include "OgreCompositorInstance.h"
+#include "OgreCompositionTechnique.h"
+#include "OgreCompositionPass.h"
+#include "OgreCompositionTargetPass.h"
+#include "OgreWindowEventUtilities.h"
+#include "OgreShadowCameraSetup.h"
+#include "OgreShadowCameraSetupFocused.h"
+#include "OgreShadowCameraSetupLiSPSM.h"
+#include "OgreShadowCameraSetupPlaneOptimal.h"
+// .... more to come
+
+#endif
Index: /OgreMain/include/OgreAlignedAllocator.h
===================================================================
--- /OgreMain/include/OgreAlignedAllocator.h	(revision 5)
+++ /OgreMain/include/OgreAlignedAllocator.h	(revision 5)
@@ -0,0 +1,181 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __AlignedAllocator_H__
+#define __AlignedAllocator_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+    /** Class to provide aligned memory allocate functionality.
+    @remarks
+        All SIMD processing are friendly with aligned memory, and some SIMD routines
+        are designed for working with aligned memory only. If the data are intented to
+        use SIMD processing, it's need to be aligned for better performance boost.
+        In additional, most time cache boundary aligned data also lead to better
+        performance even if didn't used SIMD processing. So this class provides a couple
+        of functions for allocate aligned memory.
+    @par
+        Anyways, in general, you don't need to use this class directly, Ogre internally
+        will take care with most SIMD and cache friendly optimisation if possible.
+    @par
+        This isn't a "one-step" optimisation, there are a lot of underlying work to
+        achieve performance boost. If you didn't know what are you doing or what there
+        are going, just ignore this class.
+    @note
+        This class intented to use by advanced user only.
+    */
+	class _OgreExport AlignedMemory
+	{
+	public:
+        /** Allocate memory with given alignment.
+            @param
+                size The size of memory need to allocate.
+            @param
+                alignment The alignment of result pointer, must be power of two
+                and in range [1, 128].
+            @returns
+                The allocated memory pointer.
+            @par
+                On failiure, exception will be throw.
+        */
+        static void* allocate(size_t size, size_t alignment);
+
+        /** Allocate memory with default platform dependent alignment.
+            @remarks
+                The default alignment depend on target machine, this function
+                guarantee aligned memory according with SIMD processing and
+                cache boundary friendly.
+            @param
+                size The size of memory need to allocate.
+            @returns
+                The allocated memory pointer.
+            @par
+                On failiure, exception will be throw.
+        */
+        static void* allocate(size_t size);
+
+        /** Deallocate memory that allocated by this class.
+            @param
+                p Pointer to the memory allocated by this class or <b>NULL</b> pointer.
+            @par
+                On <b>NULL</b> pointer, nothing happen.
+        */
+        static void deallocate(void* p);
+	};
+
+    /** STL compatible allocator with aligned memory allocate, used for tweak
+        STL containers work with aligned memory.
+    @remarks
+        This class designed for work with STL containers, by use this
+        class instead of std::allocator, the STL containers can work
+        with aligned memory allocate seamless.
+    @note
+        template parameter Alignment equal to zero means use default
+        platform dependent alignment.
+    */
+    template <typename T, unsigned Alignment = 0>
+    class AlignedAllocator
+    {
+        // compile-time check alignment is available.
+        typedef int IsValidAlignment
+            [Alignment <= 128 && ((Alignment & (Alignment-1)) == 0) ? +1 : -1];
+
+    public:
+        //--- typedefs for STL compatible
+
+        typedef T value_type;
+
+        typedef value_type * pointer;
+        typedef const value_type * const_pointer;
+        typedef value_type & reference;
+        typedef const value_type & const_reference;
+        typedef std::size_t size_type;
+        typedef std::ptrdiff_t difference_type;
+
+        template <typename U>
+        struct rebind
+        {
+            typedef AlignedAllocator<U, Alignment> other;
+        };
+
+    public:
+        AlignedAllocator() { /* nothing to do */ }
+
+        // default copy constructor
+
+        // default assignment operator
+
+        // not explicit, mimicking std::allocator [20.4.1]
+        template <typename U, unsigned A>
+        AlignedAllocator(const AlignedAllocator<U, A> &) { /* nothing to do */ }
+
+        // default destructor
+
+        //--- functions for STL compatible
+
+        static pointer address(reference r)
+        { return &r; }
+        static const_pointer address(const_reference s)
+        { return &s; }
+        static size_type max_size()
+        { return (std::numeric_limits<size_type>::max)(); }
+        static void construct(const pointer ptr, const value_type & t)
+        { new (ptr) T(t); }
+        static void destroy(const pointer ptr)
+        {
+            ptr->~T();
+            (void) ptr; // avoid unused variable warning
+        }
+
+        bool operator==(const AlignedAllocator &) const
+        { return true; }
+        bool operator!=(const AlignedAllocator &) const
+        { return false; }
+
+        static pointer allocate(const size_type n)
+        {
+            // use default platform dependent alignment if 'Alignment' equal to zero.
+            const pointer ret = static_cast<pointer>(Alignment ?
+                AlignedMemory::allocate(sizeof(T) * n, Alignment) :
+                AlignedMemory::allocate(sizeof(T) * n));
+            return ret;
+        }
+        static pointer allocate(const size_type n, const void * const)
+        {
+            return allocate(n);
+        }
+        static void deallocate(const pointer ptr, const size_type)
+        {
+            AlignedMemory::deallocate(ptr);
+        }
+    };
+}
+
+#endif  // __AlignedAllocator_H__
Index: /OgreMain/include/OgreAnimable.h
===================================================================
--- /OgreMain/include/OgreAnimable.h	(revision 5)
+++ /OgreMain/include/OgreAnimable.h	(revision 5)
@@ -0,0 +1,299 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ANIMABLE_H__
+#define __ANIMABLE_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreVector2.h"
+#include "OgreVector3.h"
+#include "OgreVector4.h"
+#include "OgreQuaternion.h"
+#include "OgreColourValue.h"
+#include "OgreSharedPtr.h"
+#include "OgreStringVector.h"
+#include "OgreException.h"
+#include "OgreAny.h"
+
+namespace Ogre {
+
+	/** Defines an object property which is animable, ie may be keyframed.
+	@remarks
+		Animable properties are those which can be altered over time by a 
+		predefined keyframe sequence. They may be set directly, or they may
+		be modified from their existing state (common if multiple animations
+		are expected to apply at once). Implementors of this interface are
+		expected to override the 'setValue', 'setCurrentStateAsBaseValue' and 
+		'applyDeltaValue' methods appropriate to the type in question, and to 
+		initialise the type.
+	@par
+		AnimableValue instances are accessible through any class which extends
+		AnimableObject in order to expose it's animable properties.
+	@note
+		This class is an instance of the Adapter pattern, since it generalises
+		access to a particular property. Whilst it could have been templated
+		such that the type which was being referenced was compiled in, this would
+		make it more difficult to aggregated generically, and since animations
+		are often comprised of multiple properties it helps to be able to deal
+		with all values through a single class.
+	*/
+	class _OgreExport AnimableValue
+	{
+	public:
+		/// The type of the value being animated
+		enum ValueType
+		{
+			INT,
+			REAL,
+			VECTOR2,
+			VECTOR3,
+			VECTOR4,
+			QUATERNION,
+			COLOUR
+		};
+	protected:
+		/// Value type
+		ValueType mType;
+
+		/// Base value data
+		union
+		{
+			int mBaseValueInt;
+			Real mBaseValueReal[4];
+		};
+
+		/// Internal method to set a value as base
+		virtual void setAsBaseValue(int val) { mBaseValueInt = val; }
+		/// Internal method to set a value as base
+		virtual void setAsBaseValue(Real val) { mBaseValueReal[0] = val; }
+		/// Internal method to set a value as base
+		virtual void setAsBaseValue(const Vector2& val) 
+		{ memcpy(mBaseValueReal, val.ptr(), sizeof(Real)*2); }
+		/// Internal method to set a value as base
+		virtual void setAsBaseValue(const Vector3& val) 
+		{ memcpy(mBaseValueReal, val.ptr(), sizeof(Real)*3); }
+		/// Internal method to set a value as base
+		virtual void setAsBaseValue(const Vector4& val) 
+		{ memcpy(mBaseValueReal, val.ptr(), sizeof(Real)*4); }
+		/// Internal method to set a value as base
+		virtual void setAsBaseValue(const Quaternion& val) 
+		{ memcpy(mBaseValueReal, val.ptr(), sizeof(Real)*4); }
+		/// Internal method to set a value as base
+		virtual void setAsBaseValue(const Any& val);
+		/// Internal method to set a value as base
+		virtual void setAsBaseValue(const ColourValue& val)
+		{ 
+			mBaseValueReal[0] = val.r;
+			mBaseValueReal[1] = val.g;
+			mBaseValueReal[2] = val.b;
+			mBaseValueReal[3] = val.a;
+		}
+
+
+	public:
+		AnimableValue(ValueType t) : mType(t) {}
+		virtual ~AnimableValue() {}
+
+		/// Gets the value type of this animable value
+		ValueType getType(void) const { return mType; }
+
+		/// Sets the current state as the 'base' value; used for delta animation
+		virtual void setCurrentStateAsBaseValue(void) = 0;
+
+		/// Set value 
+		virtual void setValue(int) {
+			OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "", "");
+		}
+		/// Set value 
+		virtual void setValue(Real) {
+			OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "", "");
+		}
+		/// Set value 
+		virtual void setValue(const Vector2&) {
+			OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "", "");
+		}
+		/// Set value 
+		virtual void setValue(const Vector3&) {
+			OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "", "");
+		}
+		/// Set value 
+		virtual void setValue(const Vector4&) {
+			OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "", "");
+		}
+		/// Set value 
+		virtual void setValue(const Quaternion&) {
+			OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "", "");
+		}
+		/// Set value 
+		virtual void setValue(const ColourValue&) {
+			OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "", "");
+		}
+		/// Set value 
+		virtual void setValue(const Any& val);
+
+		// reset to base value
+		virtual void resetToBaseValue(void);
+
+		/// Apply delta value
+		virtual void applyDeltaValue(int) {
+			OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "", "");
+		}
+		/// Set value 
+		virtual void applyDeltaValue(Real) {
+			OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "", "");
+		}
+		/// Apply delta value 
+		virtual void applyDeltaValue(const Vector2&) {
+			OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "", "");
+		}
+		/// Apply delta value 
+		virtual void applyDeltaValue(const Vector3&) {
+			OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "", "");
+		}
+		/// Apply delta value 
+		virtual void applyDeltaValue(const Vector4&) {
+			OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "", "");
+		}
+		/// Apply delta value 
+		virtual void applyDeltaValue(const Quaternion&) {
+			OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "", "");
+		}
+		/// Apply delta value 
+		virtual void applyDeltaValue(const ColourValue&) {
+			OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "", "");
+		}
+		/// Apply delta value 
+		virtual void applyDeltaValue(const Any& val);
+
+
+	};
+
+	typedef SharedPtr<AnimableValue> AnimableValuePtr;
+
+
+
+	/** Defines an interface to classes which have one or more AnimableValue
+		instances to expose.
+	*/
+	class _OgreExport AnimableObject
+	{
+	protected:
+		typedef std::map<String, StringVector> AnimableDictionaryMap;
+		/// Static map of class name to list of animable value names
+		static AnimableDictionaryMap msAnimableDictionary;
+		/** Get the name of the animable dictionary for this class.
+		@remarks
+			Subclasses must override this if they want to support animation of
+			their values.
+		*/
+		virtual const String& getAnimableDictionaryName(void) const 
+		{ return StringUtil::BLANK; }
+        /** Internal method for creating a dictionary of animable value names 
+			for the class, if it does not already exist.
+        */
+        void createAnimableDictionary(void) const
+        {
+            if (msAnimableDictionary.find(getAnimableDictionaryName()) 
+				== msAnimableDictionary.end())
+            {
+				StringVector vec;
+				initialiseAnimableDictionary(vec);
+				msAnimableDictionary[getAnimableDictionaryName()] = vec;
+            }
+
+        }
+	
+		/// Get an updateable reference to animable value list
+		StringVector& _getAnimableValueNames(void)
+		{
+			AnimableDictionaryMap::iterator i = 
+				msAnimableDictionary.find(getAnimableDictionaryName());
+			if (i != msAnimableDictionary.end())
+			{
+				return i->second;
+			}
+			else
+			{
+				OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+					"Animable value list not found for " + getAnimableDictionaryName(), 
+					"AnimableObject::getAnimableValueNames");
+			}
+
+		}
+
+		/** Internal method for initialising dictionary; should be implemented by 
+			subclasses wanting to expose animable parameters.
+		*/
+		virtual void initialiseAnimableDictionary(StringVector&) const {}
+
+
+	public:
+		AnimableObject() {}
+		virtual ~AnimableObject() {}
+
+		/** Gets a list of animable value names for this object. */
+		const StringVector& getAnimableValueNames(void) const
+		{
+			createAnimableDictionary();
+
+			AnimableDictionaryMap::iterator i = 
+				msAnimableDictionary.find(getAnimableDictionaryName());
+			if (i != msAnimableDictionary.end())
+			{
+				return i->second;
+			}
+			else
+			{
+				OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+					"Animable value list not found for " + getAnimableDictionaryName(), 
+					"AnimableObject::getAnimableValueNames");
+			}
+
+		}
+
+		/** Create a reference-counted AnimableValuePtr for the named value.
+		@remarks
+			You can use the returned object to animate a value on this object,
+			using AnimationTrack. Subclasses must override this if they wish 
+			to support animation of their values.
+		*/
+		virtual AnimableValuePtr createAnimableValue(const String& valueName)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"No animable value named '" + valueName + "' present.", 
+				"AnimableObject::createAnimableValue");
+		}
+
+
+
+	};
+
+
+}
+#endif
+
Index: /OgreMain/include/OgreAnimation.h
===================================================================
--- /OgreMain/include/OgreAnimation.h	(revision 5)
+++ /OgreMain/include/OgreAnimation.h	(revision 5)
@@ -0,0 +1,406 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __Animation_H__
+#define __Animation_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreAnimable.h"
+#include "OgreAnimationTrack.h"
+
+
+namespace Ogre {
+
+    /** An animation sequence. 
+    @remarks
+        This class defines the interface for a sequence of animation, whether that
+        be animation of a mesh, a path along a spline, or possibly more than one
+        type of animation in one. An animation is made up of many 'tracks', which are
+        the more specific types of animation.
+    @par
+        You should not create these animations directly. They will be created via a parent
+        object which owns the animation, e.g. Skeleton.
+    */
+    class _OgreExport Animation
+    {
+
+    public:
+        /** The types of animation interpolation available. */
+        enum InterpolationMode
+        {
+            /** Values are interpolated along straight lines. */
+            IM_LINEAR,
+            /** Values are interpolated along a spline, resulting in smoother changes in direction. */
+            IM_SPLINE
+        };
+
+        /** The types of rotational interpolation available. */
+        enum RotationInterpolationMode
+        {
+            /** Values are interpolated linearly. This is faster but does not 
+                necessarily give a completely accurate result.
+            */
+            RIM_LINEAR,
+            /** Values are interpolated spherically. This is more accurate but
+                has a higher cost.
+            */
+            RIM_SPHERICAL
+        };
+        /** You should not use this constructor directly, use the parent object such as Skeleton instead.
+        @param name The name of the animation, should be unique within it's parent (e.g. Skeleton)
+        @param length The length of the animation in seconds.
+        */
+        Animation(const String& name, Real length);
+        virtual ~Animation();
+
+        /** Gets the name of this animation. */
+        const String& getName(void) const;
+
+        /** Gets the total length of the animation. */
+        Real getLength(void) const;
+
+        /** Creates a NodeAnimationTrack for animating a Node.
+        @param handle Handle to give the track, used for accessing the track later. 
+            Must be unique within this Animation.
+        */
+        NodeAnimationTrack* createNodeTrack(unsigned short handle);
+
+		/** Creates a NumericAnimationTrack for animating any numeric value.
+		@param handle Handle to give the track, used for accessing the track later. 
+		Must be unique within this Animation.
+		*/
+		NumericAnimationTrack* createNumericTrack(unsigned short handle);
+
+		/** Creates a VertexAnimationTrack for animating vertex position data.
+		@param handle Handle to give the track, used for accessing the track later. 
+		Must be unique within this Animation, and is used to identify the target. For example
+		when applied to a Mesh, the handle must reference the index of the geometry being 
+		modified; 0 for the shared geometry, and 1+ for SubMesh geometry with the same index-1.
+		@param animType Either morph or pose animation, 
+		*/
+		VertexAnimationTrack* createVertexTrack(unsigned short handle, VertexAnimationType animType);
+
+		/** Creates a new AnimationTrack automatically associated with a Node. 
+        @remarks
+            This method creates a standard AnimationTrack, but also associates it with a
+            target Node which will receive all keyframe effects.
+        @param handle Numeric handle to give the track, used for accessing the track later. 
+            Must be unique within this Animation.
+        @param node A pointer to the Node object which will be affected by this track
+        */
+        NodeAnimationTrack* createNodeTrack(unsigned short handle, Node* node);
+
+		/** Creates a NumericAnimationTrack and associates it with an animable. 
+		@param handle Handle to give the track, used for accessing the track later. 
+		@param anim Animable object link
+		Must be unique within this Animation.
+		*/
+		NumericAnimationTrack* createNumericTrack(unsigned short handle, 
+			const AnimableValuePtr& anim);
+
+		/** Creates a VertexAnimationTrack and associates it with VertexData. 
+		@param handle Handle to give the track, used for accessing the track later. 
+		@param data VertexData object link
+		@param animType The animation type 
+		Must be unique within this Animation.
+		*/
+		VertexAnimationTrack* createVertexTrack(unsigned short handle, 
+			VertexData* data, VertexAnimationType animType);
+
+		/** Gets the number of NodeAnimationTrack objects contained in this animation. */
+        unsigned short getNumNodeTracks(void) const;
+
+        /** Gets a node track by it's handle. */
+        NodeAnimationTrack* getNodeTrack(unsigned short handle) const;
+
+		/** Does a track exist with the given handle? */
+		bool hasNodeTrack(unsigned short handle) const;
+
+		/** Gets the number of NumericAnimationTrack objects contained in this animation. */
+		unsigned short getNumNumericTracks(void) const;
+
+		/** Gets a numeric track by it's handle. */
+		NumericAnimationTrack* getNumericTrack(unsigned short handle) const;
+
+		/** Does a track exist with the given handle? */
+		bool hasNumericTrack(unsigned short handle) const;
+
+		/** Gets the number of VertexAnimationTrack objects contained in this animation. */
+		unsigned short getNumVertexTracks(void) const;
+
+		/** Gets a Vertex track by it's handle. */
+		VertexAnimationTrack* getVertexTrack(unsigned short handle) const;
+
+		/** Does a track exist with the given handle? */
+		bool hasVertexTrack(unsigned short handle) const;
+		
+		/** Destroys the node track with the given handle. */
+        void destroyNodeTrack(unsigned short handle);
+
+		/** Destroys the numeric track with the given handle. */
+		void destroyNumericTrack(unsigned short handle);
+
+		/** Destroys the Vertex track with the given handle. */
+		void destroyVertexTrack(unsigned short handle);
+
+		/** Removes and destroys all tracks making up this animation. */
+        void destroyAllTracks(void);
+
+		/** Removes and destroys all tracks making up this animation. */
+		void destroyAllNodeTracks(void);
+		/** Removes and destroys all tracks making up this animation. */
+		void destroyAllNumericTracks(void);
+		/** Removes and destroys all tracks making up this animation. */
+		void destroyAllVertexTracks(void);
+
+        /** Applies an animation given a specific time point and weight.
+        @remarks
+            Where you have associated animation tracks with objects, you can eaily apply
+            an animation to those objects by calling this method.
+        @param timePos The time position in the animation to apply.
+        @param weight The influence to give to this track, 1.0 for full influence, less to blend with
+          other animations.
+	    @param scale The scale to apply to translations and scalings, useful for 
+			adapting an animation to a different size target.
+        */
+        void apply(Real timePos, Real weight = 1.0, Real scale = 1.0f);
+
+        /** Applies all node tracks given a specific time point and weight to a given skeleton.
+        @remarks
+        Where you have associated animation tracks with Node objects, you can eaily apply
+        an animation to those nodes by calling this method.
+        @param timePos The time position in the animation to apply.
+        @param weight The influence to give to this track, 1.0 for full influence, less to blend with
+        other animations.
+	    @param scale The scale to apply to translations and scalings, useful for 
+			adapting an animation to a different size target.
+        */
+        void apply(Skeleton* skeleton, Real timePos, Real weight = 1.0, Real scale = 1.0f);
+
+		/** Applies all vertex tracks given a specific time point and weight to a given entity.
+		@remarks
+		@param entity The Entity to which this animation should be applied
+		@param timePos The time position in the animation to apply.
+		@param weight The weight at which the animation should be applied 
+			(only affects pose animation)
+		@param software Whether to populate the software morph vertex data
+		@param hardware Whether to populate the hardware morph vertex data
+		*/
+		void apply(Entity* entity, Real timePos, Real weight, bool software, 
+			bool hardware);
+
+        /** Tells the animation how to interpolate between keyframes.
+        @remarks
+            By default, animations normally interpolate linearly between keyframes. This is
+            fast, but when animations include quick changes in direction it can look a little
+            unnatural because directions change instantly at keyframes. An alternative is to
+            tell the animation to interpolate along a spline, which is more expensive in terms
+            of calculation time, but looks smoother because major changes in direction are 
+            distributed around the keyframes rather than just at the keyframe.
+        @par
+            You can also change the default animation behaviour by calling 
+            Animation::setDefaultInterpolationMode.
+        */
+        void setInterpolationMode(InterpolationMode im);
+
+        /** Gets the current interpolation mode of this animation. 
+        @remarks
+            See setInterpolationMode for more info.
+        */
+        InterpolationMode getInterpolationMode(void) const;
+        /** Tells the animation how to interpolate rotations.
+        @remarks
+            By default, animations interpolate linearly between rotations. This
+            is fast but not necessarily completely accurate. If you want more 
+            accurate interpolation, use spherical interpolation, but be aware 
+            that it will incur a higher cost.
+        @par
+            You can also change the default rotation behaviour by calling 
+            Animation::setDefaultRotationInterpolationMode.
+        */
+        void setRotationInterpolationMode(RotationInterpolationMode im);
+
+        /** Gets the current rotation interpolation mode of this animation. 
+        @remarks
+            See setRotationInterpolationMode for more info.
+        */
+        RotationInterpolationMode getRotationInterpolationMode(void) const;
+
+        // Methods for setting the defaults
+        /** Sets the default animation interpolation mode. 
+        @remarks
+            Every animation created after this option is set will have the new interpolation
+            mode specified. You can also change the mode per animation by calling the 
+            setInterpolationMode method on the instance in question.
+        */
+        static void setDefaultInterpolationMode(InterpolationMode im);
+
+        /** Gets the default interpolation mode for all animations. */
+        static InterpolationMode getDefaultInterpolationMode(void);
+
+        /** Sets the default rotation interpolation mode. 
+        @remarks
+            Every animation created after this option is set will have the new interpolation
+            mode specified. You can also change the mode per animation by calling the 
+            setInterpolationMode method on the instance in question.
+        */
+        static void setDefaultRotationInterpolationMode(RotationInterpolationMode im);
+
+        /** Gets the default rotation interpolation mode for all animations. */
+        static RotationInterpolationMode getDefaultRotationInterpolationMode(void);
+
+        typedef std::map<unsigned short, NodeAnimationTrack*> NodeTrackList;
+        typedef ConstMapIterator<NodeTrackList> NodeTrackIterator;
+
+		typedef std::map<unsigned short, NumericAnimationTrack*> NumericTrackList;
+		typedef ConstMapIterator<NumericTrackList> NumericTrackIterator;
+
+		typedef std::map<unsigned short, VertexAnimationTrack*> VertexTrackList;
+		typedef ConstMapIterator<VertexTrackList> VertexTrackIterator;
+
+		/// Fast access to NON-UPDATEABLE node track list
+        const NodeTrackList& _getNodeTrackList(void) const;
+
+        /// Get non-updateable iterator over node tracks
+        NodeTrackIterator getNodeTrackIterator(void) const
+        { return NodeTrackIterator(mNodeTrackList.begin(), mNodeTrackList.end()); }
+        
+		/// Fast access to NON-UPDATEABLE numeric track list
+		const NumericTrackList& _getNumericTrackList(void) const;
+
+		/// Get non-updateable iterator over node tracks
+		NumericTrackIterator getNumericTrackIterator(void) const
+		{ return NumericTrackIterator(mNumericTrackList.begin(), mNumericTrackList.end()); }
+
+		/// Fast access to NON-UPDATEABLE Vertex track list
+		const VertexTrackList& _getVertexTrackList(void) const;
+
+		/// Get non-updateable iterator over node tracks
+		VertexTrackIterator getVertexTrackIterator(void) const
+		{ return VertexTrackIterator(mVertexTrackList.begin(), mVertexTrackList.end()); }
+
+		/** Optimise an animation by removing unnecessary tracks and keyframes.
+		@remarks
+			When you export an animation, it is possible that certain tracks
+			have been keyframed but actually don't include anything useful - the
+			keyframes include no transformation. These tracks can be completely
+			eliminated from the animation and thus speed up the animation. 
+			In addition, if several keyframes in a row have the same value, 
+			then they are just adding overhead and can be removed.
+        @note
+            Since track-less and identity track has difference behavior for
+            accumulate animation blending if corresponding track presenting at
+            other animation that is non-identity, and in normally this method
+            didn't known about the situation of other animation, it can't deciding
+            whether or not discards identity tracks. So there have a parameter
+            allow you choose what you want, in case you aren't sure how to do that,
+            you should use Skeleton::optimiseAllAnimations instead.
+        @param
+            discardIdentityNodeTracks If true, discard identity node tracks.
+		*/
+		void optimise(bool discardIdentityNodeTracks = true);
+
+        /// A list of track handles
+        typedef std::set<ushort> TrackHandleList;
+
+        /** Internal method for collecting identity node tracks.
+        @remarks
+            This method remove non-identity node tracks form the track handle list.
+        @param
+            tracks A list of track handle of non-identity node tracks, where this
+            method will remove non-identity node track handles.
+        */
+        void _collectIdentityNodeTracks(TrackHandleList& tracks) const;
+
+        /** Internal method for destroy given node tracks.
+        */
+        void _destroyNodeTracks(const TrackHandleList& tracks);
+
+		/** Clone this animation.
+		@note
+			The pointer returned from this method is the only one recorded, 
+			thus it is up to the caller to arrange for the deletion of this
+			object.
+		*/
+		Animation* clone(const String& newName) const;
+		
+        /** Internal method used to tell the animation that keyframe list has been
+            changed, which may cause it to rebuild some internal data */
+        void _keyFrameListChanged(void) { mKeyFrameTimesDirty = true; }
+
+        /** Internal method used to convert time position to time index object.
+        @note
+            The time index returns by this function are associated with state of
+            the animation object, if the animation object altered (e.g. create/remove
+            keyframe or track), all related time index will invalidated.
+        @param timePos The time position.
+        @returns The time index object which contains wrapped time position (in
+            relation to the whole animation sequence) and lower bound index of
+            global keyframe time list.
+        */
+        TimeIndex _getTimeIndex(Real timePos) const;
+
+    protected:
+        /// Node tracks, indexed by handle
+        NodeTrackList mNodeTrackList;
+		/// Numeric tracks, indexed by handle
+		NumericTrackList mNumericTrackList;
+		/// Vertex tracks, indexed by handle
+		VertexTrackList mVertexTrackList;
+        String mName;
+
+        Real mLength;
+
+        InterpolationMode mInterpolationMode;
+        RotationInterpolationMode mRotationInterpolationMode;
+
+        static InterpolationMode msDefaultInterpolationMode;
+        static RotationInterpolationMode msDefaultRotationInterpolationMode;
+
+        /// Global keyframe time list used to search global keyframe index.
+        typedef std::vector<Real> KeyFrameTimeList;
+        mutable KeyFrameTimeList mKeyFrameTimes;
+        /// Dirty flag indicate that keyframe time list need to rebuild
+        mutable bool mKeyFrameTimesDirty;
+
+		void optimiseNodeTracks(bool discardIdentityTracks);
+		void optimiseVertexTracks(void);
+
+        /// Internal method to build global keyframe time list
+        void buildKeyFrameTimeList(void) const;
+    };
+
+
+}
+
+
+#endif
+
Index: /OgreMain/include/OgreAnimationState.h
===================================================================
--- /OgreMain/include/OgreAnimationState.h	(revision 5)
+++ /OgreMain/include/OgreAnimationState.h	(revision 5)
@@ -0,0 +1,229 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __AnimationSet_H__
+#define __AnimationSet_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreString.h"
+#include "OgreController.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre {
+
+    /** Represents the state of an animation and the weight of it's influence. 
+    @remarks
+        Other classes can hold instances of this class to store the state of any animations
+        they are using.
+    */
+    class _OgreExport AnimationState 
+    {
+    public:
+        /// Normal constructor with all params supplied
+        AnimationState(const String& animName, AnimationStateSet *parent, 
+			Real timePos, Real length, Real weight = 1.0, bool enabled = false);
+		/// constructor to copy from an existing state with new parent
+		AnimationState(AnimationStateSet* parent, const AnimationState &rhs);
+		/** Destructor - is here because class has virtual functions and some compilers 
+			would whine if it won't exist.
+		*/
+		virtual ~AnimationState();
+        
+        /// Gets the name of the animation to which this state applies
+        const String& getAnimationName() const;
+        /// Gets the time position for this animation
+        Real getTimePosition(void) const;
+        /// Sets the time position for this animation
+        void setTimePosition(Real timePos);
+        /// Gets the total length of this animation (may be shorter than whole animation)
+        Real getLength() const;
+        /// Sets the total length of this animation (may be shorter than whole animation)
+        void setLength(Real len);
+        /// Gets the weight (influence) of this animation
+        Real getWeight(void) const;
+        /// Sets the weight (influence) of this animation
+        void setWeight(Real weight);
+        /** Modifies the time position, adjusting for animation length
+        @remarks
+            This method loops at the edges if animation looping is enabled.
+        */
+        void addTime(Real offset);
+
+		/// Returns true if the animation has reached the end and is not looping
+		bool hasEnded(void) const;
+
+        /// Returns true if this animation is currently enabled
+        bool getEnabled(void) const;
+        /// Sets whether this animation is enabled
+        void setEnabled(bool enabled);
+
+        /// Equality operator
+        bool operator==(const AnimationState& rhs) const;
+        // Inequality operator
+        bool operator!=(const AnimationState& rhs) const;
+
+        /** Sets whether or not an animation loops at the start and end of
+            the animation if the time continues to be altered.
+        */
+        void setLoop(bool loop) { mLoop = loop; }
+        /// Gets whether or not this animation loops            
+        bool getLoop(void) const { return mLoop; }
+     
+        /** Copies the states from another animation state, preserving the animation name
+        (unlike operator=) but copying everything else.
+        @param animState Reference to animation state which will use as source.
+        */
+        void copyStateFrom(const AnimationState& animState);
+
+		/// Get the parent animation state set
+		AnimationStateSet* getParent(void) const { return mParent; }
+
+    protected:
+        String mAnimationName;
+		AnimationStateSet* mParent;
+        Real mTimePos;
+        Real mLength;
+        Real mWeight;
+        bool mEnabled;
+        bool mLoop;
+
+    };
+
+	// A map of animation states
+	typedef std::map<String, AnimationState*> AnimationStateMap;
+	typedef MapIterator<AnimationStateMap> AnimationStateIterator;
+	typedef ConstMapIterator<AnimationStateMap> ConstAnimationStateIterator;
+    // A list of enabled animation states
+    typedef std::list<AnimationState*> EnabledAnimationStateList;
+    typedef ConstVectorIterator<EnabledAnimationStateList> ConstEnabledAnimationStateIterator;
+
+	/** Class encapsulating a set of AnimationState objects.
+	*/
+	class _OgreExport AnimationStateSet
+	{
+	public:
+		/// Mutex, public for external locking if needed
+		OGRE_AUTO_MUTEX
+		/// Create a blank animation state set
+		AnimationStateSet();
+		/// Create an animation set by copying the contents of another
+		AnimationStateSet(const AnimationStateSet& rhs);
+
+		~AnimationStateSet();
+
+		/** Create a new AnimationState instance. 
+		@param animName The name of the animation
+		@param timePos Starting time position
+		@param length Length of the animation to play
+		@param weight Weight to apply the animation with 
+		@param enabled Whether the animation is enabled
+		*/
+		AnimationState* createAnimationState(const String& animName,  
+			Real timePos, Real length, Real weight = 1.0, bool enabled = false);
+		/// Get an animation state by the name of the animation
+		AnimationState* getAnimationState(const String& name) const;
+		/// Tests if state for the named animation is present
+		bool hasAnimationState(const String& name) const;
+		/// Remove animation state with the given name
+		void removeAnimationState(const String& name);
+		/// Remove all animation states
+		void removeAllAnimationStates(void);
+
+		/** Get an iterator over all the animation states in this set.
+		@note
+			The iterator returned from this method is not threadsafe,
+			you will need to manually lock the public mutex on this
+			class to ensure thread safety if you need it.
+		*/
+		AnimationStateIterator getAnimationStateIterator(void);
+		/** Get an iterator over all the animation states in this set.
+		@note
+			The iterator returned from this method is not threadsafe,
+			you will need to manually lock the public mutex on this
+			class to ensure thread safety if you need it.
+		*/
+		ConstAnimationStateIterator getAnimationStateIterator(void) const;
+		/// Copy the state of any matching animation states from this to another
+		void copyMatchingState(AnimationStateSet* target) const;
+		/// Set the dirty flag and dirty frame number on this state set
+		void _notifyDirty(void);
+		/// Get the latest animation state been altered frame number
+		unsigned long getDirtyFrameNumber(void) const { return mDirtyFrameNumber; }
+
+        /// Internal method respond to enable/disable an animation state
+        void _notifyAnimationStateEnabled(AnimationState* target, bool enabled);
+        /// Tests if exists enabled animation state in this set
+        bool hasEnabledAnimationState(void) const { return !mEnabledAnimationStates.empty(); }
+		/** Get an iterator over all the enabled animation states in this set
+		@note
+			The iterator returned from this method is not threadsafe,
+			you will need to manually lock the public mutex on this
+			class to ensure thread safety if you need it.
+		*/
+		ConstEnabledAnimationStateIterator getEnabledAnimationStateIterator(void) const;
+
+	protected:
+		unsigned long mDirtyFrameNumber;
+		AnimationStateMap mAnimationStates;
+        EnabledAnimationStateList mEnabledAnimationStates;
+
+	};
+
+	/** ControllerValue wrapper class for AnimationState.
+	@remarks
+		In Azathoth and earlier, AnimationState was a ControllerValue but this
+		actually causes memory problems since Controllers delete their values
+		automatically when there are no further references to them, but AnimationState
+		is deleted explicitly elsewhere so this causes double-free problems.
+		This wrapper acts as a bridge and it is this which is destroyed automatically.
+	*/
+	class _OgreExport AnimationStateControllerValue : public ControllerValue<Real>
+	{
+	protected:
+		AnimationState* mTargetAnimationState;
+	public:
+		/** Constructor, pass in the target animation state. */
+		AnimationStateControllerValue(AnimationState* targetAnimationState)
+			: mTargetAnimationState(targetAnimationState) {}
+		/// Destructor (parent already virtual)
+		~AnimationStateControllerValue() {}
+		/** ControllerValue implementation. */
+		Real getValue(void) const;
+
+		/** ControllerValue implementation. */
+		void setValue(Real value);
+
+	};
+
+
+}
+
+#endif
+
Index: /OgreMain/include/OgreAnimationTrack.h
===================================================================
--- /OgreMain/include/OgreAnimationTrack.h	(revision 5)
+++ /OgreMain/include/OgreAnimationTrack.h	(revision 5)
@@ -0,0 +1,549 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __AnimationTrack_H__
+#define __AnimationTrack_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreSimpleSpline.h"
+#include "OgreRotationalSpline.h"
+#include "OgreKeyFrame.h"
+#include "OgreAnimable.h"
+#include "OgrePose.h"
+
+namespace Ogre 
+{
+    /** Time index object used to search keyframe at the given position.
+    */
+    class _OgreExport TimeIndex
+    {
+    protected:
+        /** The time position (in relation to the whole animation sequence)
+        */
+        Real mTimePos;
+        /** The global keyframe index (in relation to the whole animation sequence)
+            that used to convert to local keyframe index, or INVALID_KEY_INDEX which
+            means global keyframe index unavailable, and then slight slow method will
+            used to search local keyframe index.
+        */
+        uint mKeyIndex;
+
+        /** Indicate it's an invalid global keyframe index.
+        */
+        static const uint INVALID_KEY_INDEX = (uint)-1;
+
+    public:
+        /** Construct time index object by the given time position.
+        */
+        TimeIndex(Real timePos)
+            : mTimePos(timePos)
+            , mKeyIndex(INVALID_KEY_INDEX)
+        {
+        }
+
+        /** Construct time index object by the given time position and
+            global keyframe index.
+        @note In normally, you don't need to use this constructor directly, use
+            Animation::_getTimeIndex instead.
+        */
+        TimeIndex(Real timePos, uint keyIndex)
+            : mTimePos(timePos)
+            , mKeyIndex(keyIndex)
+        {
+        }
+
+        bool hasKeyIndex(void) const
+        {
+            return mKeyIndex != INVALID_KEY_INDEX;
+        }
+
+        Real getTimePos(void) const
+        {
+            return mTimePos;
+        }
+
+        uint getKeyIndex(void) const
+        {
+            return mKeyIndex;
+        }
+    };
+
+    /** A 'track' in an animation sequence, ie a sequence of keyframes which affect a
+        certain type of animable object.
+    @remarks
+        This class is intended as a base for more complete classes which will actually
+        animate specific types of object, e.g. a bone in a skeleton to affect
+        skeletal animation. An animation will likely include multiple tracks each of which
+        can be made up of many KeyFrame instances. Note that the use of tracks allows each animable
+        object to have it's own number of keyframes, i.e. you do not have to have the
+        maximum number of keyframes for all animable objects just to cope with the most
+        animated one.
+    @remarks
+        Since the most common animable object is a Node, there are options in this class for associating
+        the track with a Node which will receive keyframe updates automatically when the 'apply' method
+        is called.
+	@remarks
+		By default rotation is done using shortest-path algorithm.
+		It is possible to change this behaviour using
+		setUseShortestRotationPath() method.
+    */
+    class _OgreExport AnimationTrack
+    {
+    public:
+        /// Constructor
+        AnimationTrack(Animation* parent, unsigned short handle);
+
+        virtual ~AnimationTrack();
+
+		/** Get the handle associated with this track. */
+		unsigned short getHandle(void) const { return mHandle; }
+
+        /** Returns the number of keyframes in this animation. */
+        virtual unsigned short getNumKeyFrames(void) const;
+
+        /** Returns the KeyFrame at the specified index. */
+        virtual KeyFrame* getKeyFrame(unsigned short index) const;
+
+        /** Gets the 2 KeyFrame objects which are active at the time given, and the blend value between them.
+        @remarks
+            At any point in time  in an animation, there are either 1 or 2 keyframes which are 'active',
+            1 if the time index is exactly on a keyframe, 2 at all other times i.e. the keyframe before
+            and the keyframe after.
+        @par
+            This method returns those keyframes given a time index, and also returns a parametric
+            value indicating the value of 't' representing where the time index falls between them.
+            E.g. if it returns 0, the time index is exactly on keyFrame1, if it returns 0.5 it is
+            half way between keyFrame1 and keyFrame2 etc.
+        @param timeIndex The time index.
+        @param keyFrame1 Pointer to a KeyFrame pointer which will receive the pointer to the 
+            keyframe just before or at this time index.
+        @param keyFrame2 Pointer to a KeyFrame pointer which will receive the pointer to the 
+            keyframe just after this time index. 
+        @param firstKeyIndex Pointer to an unsigned short which, if supplied, will receive the 
+            index of the 'from' keyframe incase the caller needs it.
+        @returns Parametric value indicating how far along the gap between the 2 keyframes the timeIndex
+            value is, e.g. 0.0 for exactly at 1, 0.25 for a quarter etc. By definition the range of this 
+            value is:  0.0 <= returnValue < 1.0 .
+        */
+        virtual Real getKeyFramesAtTime(const TimeIndex& timeIndex, KeyFrame** keyFrame1, KeyFrame** keyFrame2,
+            unsigned short* firstKeyIndex = 0) const;
+
+        /** Creates a new KeyFrame and adds it to this animation at the given time index.
+        @remarks
+            It is better to create KeyFrames in time order. Creating them out of order can result 
+            in expensive reordering processing. Note that a KeyFrame at time index 0.0 is always created
+            for you, so you don't need to create this one, just access it using getKeyFrame(0);
+		@note this method will always create a keyframe even if the track already has a keyframe
+			at the given time position.
+        @param timePos The time from which this KeyFrame will apply.
+        */
+        virtual KeyFrame* createKeyFrame(Real timePos);
+
+        /** Removes a KeyFrame by it's index. */
+        virtual void removeKeyFrame(unsigned short index);
+
+        /** Removes all the KeyFrames from this track. */
+        virtual void removeAllKeyFrames(void);
+
+
+        /** Gets a KeyFrame object which contains the interpolated transforms at the time index specified.
+        @remarks
+            The KeyFrame objects held by this class are transformation snapshots at 
+            discrete points in time. Normally however, you want to interpolate between these
+            keyframes to produce smooth movement, and this method allows you to do this easily.
+            In animation terminology this is called 'tweening'. 
+        @param timeIndex The time (in relation to the whole animation sequence)
+        @param kf Keyframe object to store results
+        */
+        virtual void getInterpolatedKeyFrame(const TimeIndex& timeIndex, KeyFrame* kf) const = 0;
+
+        /** Applies an animation track to the designated target.
+        @param timeIndex The time position in the animation to apply.
+        @param weight The influence to give to this track, 1.0 for full influence, less to blend with
+          other animations.
+	    @param scale The scale to apply to translations and scalings, useful for 
+			adapting an animation to a different size target.
+        */
+        virtual void apply(const TimeIndex& timeIndex, Real weight = 1.0, Real scale = 1.0f) = 0;
+
+        /** Internal method used to tell the track that keyframe data has been 
+            changed, which may cause it to rebuild some internal data. */
+		virtual void _keyFrameDataChanged(void) const {}
+
+		/** Method to determine if this track has any KeyFrames which are
+		doing anything useful - can be used to determine if this track
+		can be optimised out.
+		*/
+		virtual bool hasNonZeroKeyFrames(void) const { return true; }
+
+		/** Optimise the current track by removing any duplicate keyframes. */
+		virtual void optimise(void) {}
+
+        /** Internal method to collect keyframe times, in unique, ordered format. */
+        virtual void _collectKeyFrameTimes(std::vector<Real>& keyFrameTimes);
+
+        /** Internal method to build keyframe time index map to translate global lower
+            bound index to local lower bound index. */
+        virtual void _buildKeyFrameIndexMap(const std::vector<Real>& keyFrameTimes);
+
+    protected:
+        typedef std::vector<KeyFrame*> KeyFrameList;
+        KeyFrameList mKeyFrames;
+        Animation* mParent;
+		unsigned short mHandle;
+
+        /// Map used to translate global keyframe time lower bound index to local lower bound index
+        typedef std::vector<ushort> KeyFrameIndexMap;
+        KeyFrameIndexMap mKeyFrameIndexMap;
+
+		/// Create a keyframe implementation - must be overridden
+		virtual KeyFrame* createKeyFrameImpl(Real time) = 0;
+
+		/// Internal method for clone implementation
+		virtual void populateClone(AnimationTrack* clone) const;
+		
+
+
+    };
+
+	/** Specialised AnimationTrack for dealing with generic animable values.
+	*/
+	class _OgreExport NumericAnimationTrack : public AnimationTrack
+	{
+	public:
+		/// Constructor
+		NumericAnimationTrack(Animation* parent, unsigned short handle);
+		/// Constructor, associates with an AnimableValue
+		NumericAnimationTrack(Animation* parent, unsigned short handle, 
+			AnimableValuePtr& target);
+
+        /** Creates a new KeyFrame and adds it to this animation at the given time index.
+        @remarks
+            It is better to create KeyFrames in time order. Creating them out of order can result 
+            in expensive reordering processing. Note that a KeyFrame at time index 0.0 is always created
+            for you, so you don't need to create this one, just access it using getKeyFrame(0);
+        @param timePos The time from which this KeyFrame will apply.
+        */
+        virtual NumericKeyFrame* createNumericKeyFrame(Real timePos);
+
+		/// @copydoc AnimationTrack::getInterpolatedKeyFrame
+        virtual void getInterpolatedKeyFrame(const TimeIndex& timeIndex, KeyFrame* kf) const;
+
+		/// @copydoc AnimationTrack::apply
+		virtual void apply(const TimeIndex& timeIndex, Real weight = 1.0, Real scale = 1.0f);
+
+        /** Applies an animation track to a given animable value.
+		@param anim The AnimableValue to which to apply the animation
+        @param timeIndex The time position in the animation to apply.
+        @param weight The influence to give to this track, 1.0 for full influence, less to blend with
+          other animations.
+	    @param scale The scale to apply to translations and scalings, useful for 
+			adapting an animation to a different size target.
+        */
+		void applyToAnimable(const AnimableValuePtr& anim, const TimeIndex& timeIndex, 
+			Real weight = 1.0, Real scale = 1.0f);
+
+		/** Returns a pointer to the associated animable object (if any). */
+		virtual const AnimableValuePtr& getAssociatedAnimable(void) const;
+
+		/** Sets the associated animable object which will be automatically 
+			affected by calls to 'apply'. */
+		virtual void setAssociatedAnimable(const AnimableValuePtr& val);
+
+		/** Returns the KeyFrame at the specified index. */
+		NumericKeyFrame* getNumericKeyFrame(unsigned short index) const;
+
+		/** Clone this track (internal use only) */
+		NumericAnimationTrack* _clone(Animation* newParent) const;
+
+
+	protected:
+		/// Target to animate
+		AnimableValuePtr mTargetAnim;
+
+		/// @copydoc AnimationTrack::createKeyFrameImpl
+		KeyFrame* createKeyFrameImpl(Real time);
+
+
+	};
+
+	/** Specialised AnimationTrack for dealing with node transforms.
+	*/
+	class _OgreExport NodeAnimationTrack : public AnimationTrack
+	{
+	public:
+		/// Constructor
+		NodeAnimationTrack(Animation* parent, unsigned short handle);
+		/// Constructor, associates with a Node
+		NodeAnimationTrack(Animation* parent, unsigned short handle, 
+			Node* targetNode);
+        /// Destructor
+        virtual ~NodeAnimationTrack();
+        /** Creates a new KeyFrame and adds it to this animation at the given time index.
+        @remarks
+            It is better to create KeyFrames in time order. Creating them out of order can result 
+            in expensive reordering processing. Note that a KeyFrame at time index 0.0 is always created
+            for you, so you don't need to create this one, just access it using getKeyFrame(0);
+        @param timePos The time from which this KeyFrame will apply.
+        */
+        virtual TransformKeyFrame* createNodeKeyFrame(Real timePos);
+		/** Returns a pointer to the associated Node object (if any). */
+		virtual Node* getAssociatedNode(void) const;
+
+		/** Sets the associated Node object which will be automatically affected by calls to 'apply'. */
+		virtual void setAssociatedNode(Node* node);
+
+		/** As the 'apply' method but applies to a specified Node instead of associated node. */
+		virtual void applyToNode(Node* node, const TimeIndex& timeIndex, Real weight = 1.0, 
+			Real scale = 1.0f);
+
+		/** Sets the method of rotation calculation */
+		virtual void setUseShortestRotationPath(bool useShortestPath);
+
+		/** Gets the method of rotation calculation */
+		virtual bool getUseShortestRotationPath() const;
+
+		/// @copydoc AnimationTrack::getInterpolatedKeyFrame
+        virtual void getInterpolatedKeyFrame(const TimeIndex& timeIndex, KeyFrame* kf) const;
+
+		/// @copydoc AnimationTrack::apply
+		virtual void apply(const TimeIndex& timeIndex, Real weight = 1.0, Real scale = 1.0f);
+
+		/// @copydoc AnimationTrack::_keyFrameDataChanged
+		void _keyFrameDataChanged(void) const;
+
+		/** Returns the KeyFrame at the specified index. */
+		virtual TransformKeyFrame* getNodeKeyFrame(unsigned short index) const;
+
+
+		/** Method to determine if this track has any KeyFrames which are
+			doing anything useful - can be used to determine if this track
+			can be optimised out.
+		*/
+		virtual bool hasNonZeroKeyFrames(void) const;
+
+		/** Optimise the current track by removing any duplicate keyframes. */
+		virtual void optimise(void);
+
+		/** Clone this track (internal use only) */
+		NodeAnimationTrack* _clone(Animation* newParent) const;
+		
+	protected:
+		/// Specialised keyframe creation
+		KeyFrame* createKeyFrameImpl(Real time);
+		// Flag indicating we need to rebuild the splines next time
+		virtual void buildInterpolationSplines(void) const;
+
+        // Struct for store splines, allocate on demand for better memory footprint
+        struct Splines
+        {
+		    SimpleSpline positionSpline;
+		    SimpleSpline scaleSpline;
+		    RotationalSpline rotationSpline;
+        };
+
+		Node* mTargetNode;
+		// Prebuilt splines, must be mutable since lazy-update in const method
+		mutable Splines* mSplines;
+		mutable bool mSplineBuildNeeded;
+		/// Defines if rotation is done using shortest path
+		mutable bool mUseShortestRotationPath ;
+
+
+	};
+
+	/** Type of vertex animation.
+		Vertex animation comes in 2 types, morph and pose. The reason
+		for the 2 types is that we have 2 different potential goals - to encapsulate
+		a complete, flowing morph animation with multiple keyframes (a typical animation,
+		but implemented by having snapshots of the vertex data at each keyframe), 
+		or to represent a single pose change, for example a facial expression. 
+		Whilst both could in fact be implemented using the same system, we choose
+		to separate them since the requirements and limitations of each are quite
+		different.
+	@par
+		Morph animation is a simple approach where we have a whole series of 
+		snapshots of vertex data which must be interpolated, e.g. a running 
+		animation implemented as morph targets. Because this is based on simple
+		snapshots, it's quite fast to use when animating an entire mesh because 
+		it's a simple linear change between keyframes. However, this simplistic 
+		approach does not support blending between multiple morph animations. 
+		If you need animation blending, you are advised to use skeletal animation
+		for full-mesh animation, and pose animation for animation of subsets of 
+		meshes or where skeletal animation doesn't fit - for example facial animation.
+		For animating in a vertex shader, morph animation is quite simple and 
+		just requires the 2 vertex buffers (one the original position buffer) 
+		of absolute position data, and an interpolation factor. Each track in 
+		a morph animation refrences a unique set of vertex data.
+	@par
+		Pose animation is more complex. Like morph animation each track references
+		a single unique set of vertex data, but unlike morph animation, each 
+		keyframe references 1 or more 'poses', each with an influence level. 
+		A pose is a series of offsets to the base vertex data, and may be sparse - ie it
+		may not reference every vertex. Because they're offsets, they can be 
+		blended - both within a track and between animations. This set of features
+		is very well suited to facial animation.
+	@par
+		For example, let's say you modelled a face (one set of vertex data), and 
+		defined a set of poses which represented the various phonetic positions 
+		of the face. You could then define an animation called 'SayHello', containing
+		a single track which referenced the face vertex data, and which included 
+		a series of keyframes, each of which referenced one or more of the facial 
+		positions at different influence levels - the combination of which over
+		time made the face form the shapes required to say the word 'hello'. Since
+		the poses are only stored once, but can be referenced may times in 
+		many animations, this is a very powerful way to build up a speech system.
+	@par
+		The downside of pose animation is that it can be more difficult to set up.
+		Also, since it uses more buffers (one for the base data, and one for each
+		active pose), if you're animating in hardware using vertex shaders you need
+		to keep an eye on how many poses you're blending at once. You define a
+		maximum supported number in your vertex program definition, see the 
+		includes_pose_animation material script entry. 
+	@par
+		So, by partitioning the vertex animation approaches into 2, we keep the
+		simple morph technique easy to use, whilst still allowing all 
+		the powerful techniques to be used. Note that morph animation cannot
+		be blended with other types of vertex animation (pose animation or other
+		morph animation); pose animation can be blended with other pose animation
+		though, and both types can be combined with skeletal animation. Also note
+		that all morph animation can be expressed as pose animation, but not vice
+		versa.
+	*/
+	enum VertexAnimationType
+	{
+		/// No animation
+		VAT_NONE = 0,
+		/// Morph animation is made up of many interpolated snapshot keyframes
+		VAT_MORPH = 1,
+		/// Pose animation is made up of a single delta pose keyframe
+		VAT_POSE = 2
+	};
+
+	/** Specialised AnimationTrack for dealing with changing vertex position information.
+	@see VertexAnimationType
+	*/
+	class _OgreExport VertexAnimationTrack : public AnimationTrack
+	{
+	public:
+		/** The target animation mode */
+		enum TargetMode
+		{
+			/// Interpolate vertex positions in software
+			TM_SOFTWARE, 
+			/** Bind keyframe 1 to position, and keyframe 2 to a texture coordinate
+				for interpolation in hardware */
+			TM_HARDWARE
+		};
+		/// Constructor
+		VertexAnimationTrack(Animation* parent, unsigned short handle, VertexAnimationType animType);
+		/// Constructor, associates with target VertexData and temp buffer (for software)
+		VertexAnimationTrack(Animation* parent, unsigned short handle, VertexAnimationType animType, 
+			VertexData* targetData, TargetMode target = TM_SOFTWARE);
+
+		/** Get the type of vertex animation we're performing. */
+		VertexAnimationType getAnimationType(void) const { return mAnimationType; }
+
+		/** Creates a new morph KeyFrame and adds it to this animation at the given time index.
+		@remarks
+		It is better to create KeyFrames in time order. Creating them out of order can result 
+		in expensive reordering processing. Note that a KeyFrame at time index 0.0 is always created
+		for you, so you don't need to create this one, just access it using getKeyFrame(0);
+		@param timePos The time from which this KeyFrame will apply.
+		*/
+		virtual VertexMorphKeyFrame* createVertexMorphKeyFrame(Real timePos);
+
+		/** Creates the single pose KeyFrame and adds it to this animation.
+		*/
+		virtual VertexPoseKeyFrame* createVertexPoseKeyFrame(Real timePos);
+
+		/** This method in fact does nothing, since interpolation is not performed
+			inside the keyframes for this type of track. 
+		*/
+        virtual void getInterpolatedKeyFrame(const TimeIndex& timeIndex, KeyFrame* kf) const {}
+
+		/// @copydoc AnimationTrack::apply
+		virtual void apply(const TimeIndex& timeIndex, Real weight = 1.0, Real scale = 1.0f);
+
+		/** As the 'apply' method but applies to specified VertexData instead of 
+			associated data. */
+		virtual void applyToVertexData(VertexData* data, 
+			const TimeIndex& timeIndex, Real weight = 1.0, 
+			const PoseList* poseList = 0);
+
+
+		/** Returns the morph KeyFrame at the specified index. */
+		VertexMorphKeyFrame* getVertexMorphKeyFrame(unsigned short index) const;
+
+		/** Returns the pose KeyFrame at the specified index. */
+		VertexPoseKeyFrame* getVertexPoseKeyFrame(unsigned short index) const;
+
+		/** Sets the associated VertexData which this track will update. */
+		void setAssociatedVertexData(VertexData* data) { mTargetVertexData = data; }
+		/** Gets the associated VertexData which this track will update. */
+		VertexData* getAssociatedVertexData(void) const { return mTargetVertexData; }
+
+		/// Set the target mode
+		void setTargetMode(TargetMode m) { mTargetMode = m; }
+		/// Get the target mode
+		TargetMode getTargetMode(void) const { return mTargetMode; }
+
+		/** Method to determine if this track has any KeyFrames which are
+		doing anything useful - can be used to determine if this track
+		can be optimised out.
+		*/
+		virtual bool hasNonZeroKeyFrames(void) const;
+
+		/** Optimise the current track by removing any duplicate keyframes. */
+		virtual void optimise(void);
+
+		/** Clone this track (internal use only) */
+		VertexAnimationTrack* _clone(Animation* newParent) const;
+
+	protected:
+		/// Animation type
+		VertexAnimationType mAnimationType;
+		/// Target to animate
+		VertexData* mTargetVertexData;
+		/// Mode to apply
+		TargetMode mTargetMode;
+
+		/// @copydoc AnimationTrack::createKeyFrameImpl
+		KeyFrame* createKeyFrameImpl(Real time);
+
+		/// Utility method for applying pose animation
+		void applyPoseToVertexData(const Pose* pose, VertexData* data, Real influence);
+
+
+	};
+
+
+}
+
+#endif
Index: /OgreMain/include/OgreAny.h
===================================================================
--- /OgreMain/include/OgreAny.h	(revision 5)
+++ /OgreMain/include/OgreAny.h	(revision 5)
@@ -0,0 +1,405 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+// -- Based on boost::any, original copyright information follows --
+// Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved.
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompAnying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// -- End original copyright --
+
+#ifndef __OGRE_ANY_H__
+#define __OGRE_ANY_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreException.h"
+#include "OgreString.h"
+#include <algorithm>
+#include <typeinfo>
+
+
+namespace Ogre
+{
+	/** Variant type that can hold Any other type.
+	*/
+    class Any
+    {
+    public: // constructors
+
+        Any()
+          : mContent(0)
+        {
+        }
+
+        template<typename ValueType>
+        explicit Any(const ValueType & value)
+          : mContent(new holder<ValueType>(value))
+        {
+        }
+
+        Any(const Any & other)
+          : mContent(other.mContent ? other.mContent->clone() : 0)
+        {
+        }
+
+        virtual ~Any()
+        {
+            delete mContent;
+        }
+
+    public: // modifiers
+
+        Any& swap(Any & rhs)
+        {
+            std::swap(mContent, rhs.mContent);
+            return *this;
+        }
+
+        template<typename ValueType>
+        Any& operator=(const ValueType & rhs)
+        {
+            Any(rhs).swap(*this);
+            return *this;
+        }
+
+        Any & operator=(const Any & rhs)
+        {
+            Any(rhs).swap(*this);
+            return *this;
+        }
+
+    public: // queries
+
+        bool isEmpty() const
+        {
+            return !mContent;
+        }
+
+        const std::type_info& getType() const
+        {
+            return mContent ? mContent->getType() : typeid(void);
+        }
+
+		inline friend std::ostream& operator <<
+			( std::ostream& o, const Any& v )
+		{
+			if (v.mContent)
+				v.mContent->writeToStream(o);
+			return o;
+		}
+
+
+    protected: // types
+
+        class placeholder
+        {
+        public: // structors
+    
+            virtual ~placeholder()
+            {
+            }
+
+        public: // queries
+
+            virtual const std::type_info& getType() const = 0;
+
+            virtual placeholder * clone() const = 0;
+    
+			virtual void writeToStream(std::ostream& o) = 0;
+
+        };
+
+        template<typename ValueType>
+        class holder : public placeholder
+        {
+        public: // structors
+
+            holder(const ValueType & value)
+              : held(value)
+            {
+            }
+
+        public: // queries
+
+            virtual const std::type_info & getType() const
+            {
+                return typeid(ValueType);
+            }
+
+            virtual placeholder * clone() const
+            {
+                return new holder(held);
+            }
+
+			virtual void writeToStream(std::ostream& o)
+			{
+				o << held;
+			}
+
+
+        public: // representation
+
+            ValueType held;
+
+        };
+
+
+
+    protected: // representation
+        placeholder * mContent;
+
+        template<typename ValueType>
+        friend ValueType * any_cast(Any *);
+
+
+    public: 
+
+	    template<typename ValueType>
+    	ValueType operator()() const
+    	{
+			if (!mContent) 
+			{
+				OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+					"Bad cast from uninitialised Any", 
+					"Any::operator()");
+			}
+			else if(getType() == typeid(ValueType))
+			{
+             	return static_cast<Any::holder<ValueType> *>(mContent)->held;
+			}
+			else
+			{
+				StringUtil::StrStreamType str;
+				str << "Bad cast from type '" << getType().name() << "' "
+					<< "to '" << typeid(ValueType).name() << "'";
+				OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+					 str.str(), 
+					"Any::operator()");
+			}
+		}
+
+		
+
+    };
+
+
+	/** Specialised Any class which has built in arithmetic operators, but can 
+		hold only types which support operator +,-,* and / .
+	*/
+	class AnyNumeric : public Any
+	{
+	public:
+		AnyNumeric()
+		: Any()
+		{
+		}
+
+		template<typename ValueType>
+		AnyNumeric(const ValueType & value)
+			
+		{
+			mContent = new numholder<ValueType>(value);
+		}
+
+		AnyNumeric(const AnyNumeric & other)
+            : Any()
+		{
+			mContent = other.mContent ? other.mContent->clone() : 0; 
+		}
+	protected:
+		class numplaceholder : public Any::placeholder
+		{
+		public: // structors
+
+			~numplaceholder()
+			{
+			}
+			virtual placeholder* add(placeholder* rhs) = 0;
+			virtual placeholder* subtract(placeholder* rhs) = 0;
+			virtual placeholder* multiply(placeholder* rhs) = 0;
+			virtual placeholder* multiply(Real factor) = 0;
+			virtual placeholder* divide(placeholder* rhs) = 0;
+		};
+
+		template<typename ValueType>
+		class numholder : public numplaceholder
+		{
+		public: // structors
+
+			numholder(const ValueType & value)
+				: held(value)
+			{
+			}
+
+		public: // queries
+
+			virtual const std::type_info & getType() const
+			{
+				return typeid(ValueType);
+			}
+
+			virtual placeholder * clone() const
+			{
+				return new numholder(held);
+			}
+
+			virtual placeholder* add(placeholder* rhs)
+			{
+				return new numholder(held + static_cast<numholder*>(rhs)->held);
+			}
+			virtual placeholder* subtract(placeholder* rhs)
+			{
+				return new numholder(held - static_cast<numholder*>(rhs)->held);
+			}
+			virtual placeholder* multiply(placeholder* rhs)
+			{
+				return new numholder(held * static_cast<numholder*>(rhs)->held);
+			}
+			virtual placeholder* multiply(Real factor)
+			{
+				return new numholder(held * factor);
+			}
+			virtual placeholder* divide(placeholder* rhs)
+			{
+				return new numholder(held / static_cast<numholder*>(rhs)->held);
+			}
+			virtual void writeToStream(std::ostream& o)
+			{
+				o << held;
+			}
+
+		public: // representation
+
+			ValueType held;
+
+		};
+
+		/// Construct from holder
+		AnyNumeric(placeholder* pholder)
+		{
+			mContent = pholder;
+		}
+
+	public:
+		AnyNumeric & operator=(const AnyNumeric & rhs)
+		{
+			AnyNumeric(rhs).swap(*this);
+			return *this;
+		}
+		AnyNumeric operator+(const AnyNumeric& rhs) const
+		{
+			return AnyNumeric(
+				static_cast<numplaceholder*>(mContent)->add(rhs.mContent));
+		}
+		AnyNumeric operator-(const AnyNumeric& rhs) const
+		{
+			return AnyNumeric(
+				static_cast<numplaceholder*>(mContent)->subtract(rhs.mContent));
+		}
+		AnyNumeric operator*(const AnyNumeric& rhs) const
+		{
+			return AnyNumeric(
+				static_cast<numplaceholder*>(mContent)->multiply(rhs.mContent));
+		}
+		AnyNumeric operator*(Real factor) const
+		{
+			return AnyNumeric(
+				static_cast<numplaceholder*>(mContent)->multiply(factor));
+		}
+		AnyNumeric operator/(const AnyNumeric& rhs) const
+		{
+			return AnyNumeric(
+				static_cast<numplaceholder*>(mContent)->divide(rhs.mContent));
+		}
+		AnyNumeric& operator+=(const AnyNumeric& rhs)
+		{
+			*this = AnyNumeric(
+				static_cast<numplaceholder*>(mContent)->add(rhs.mContent));
+			return *this;
+		}
+		AnyNumeric& operator-=(const AnyNumeric& rhs)
+		{
+			*this = AnyNumeric(
+				static_cast<numplaceholder*>(mContent)->subtract(rhs.mContent));
+			return *this;
+		}
+		AnyNumeric& operator*=(const AnyNumeric& rhs)
+		{
+			*this = AnyNumeric(
+				static_cast<numplaceholder*>(mContent)->multiply(rhs.mContent));
+			return *this;
+		}
+		AnyNumeric& operator/=(const AnyNumeric& rhs)
+		{
+			*this = AnyNumeric(
+				static_cast<numplaceholder*>(mContent)->divide(rhs.mContent));
+			return *this;
+		}
+
+
+
+
+	};
+
+
+    template<typename ValueType>
+    ValueType * any_cast(Any * operand)
+    {
+        return operand && operand->getType() == typeid(ValueType)
+                    ? &static_cast<Any::holder<ValueType> *>(operand->mContent)->held
+                    : 0;
+    }
+
+    template<typename ValueType>
+    const ValueType * any_cast(const Any * operand)
+    {
+        return any_cast<ValueType>(const_cast<Any *>(operand));
+    }
+
+    template<typename ValueType>
+    ValueType any_cast(const Any & operand)
+    {
+        const ValueType * result = any_cast<ValueType>(&operand);
+        if(!result)
+		{
+			StringUtil::StrStreamType str;
+			str << "Bad cast from type '" << operand.getType().name() << "' "
+				<< "to '" << typeid(ValueType).name() << "'";
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				str.str(), 
+				"Ogre::any_cast");
+		}
+        return *result;
+    }
+
+
+}
+
+#endif
+
Index: /OgreMain/include/OgreArchive.h
===================================================================
--- /OgreMain/include/OgreArchive.h	(revision 5)
+++ /OgreMain/include/OgreArchive.h	(revision 5)
@@ -0,0 +1,191 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _Archive_H__
+#define _Archive_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include "OgreDataStream.h"
+#include "OgreSharedPtr.h"
+#include "OgreStringVector.h"
+
+namespace Ogre {
+
+    /** Information about a file/directory within the archive will be
+    returned using a FileInfo struct.
+    @see
+    Archive
+    */
+    struct FileInfo {
+		/// The archive in which the file has been found (for info when performing
+		/// multi-Archive searches, note you should still open through ResourceGroupManager)
+		Archive* archive;
+        /// The file's fully qualified name
+        String filename;
+        /// Path name; separated by '/' and ending with '/'
+        String path;
+        /// Base filename
+        String basename;
+        /// Compressed size
+        size_t compressedSize;
+        /// Uncompressed size
+        size_t uncompressedSize;
+    };
+
+    typedef std::vector<FileInfo> FileInfoList;
+    typedef SharedPtr<FileInfoList> FileInfoListPtr;
+
+    /** Archive-handling class.
+    @remarks
+        An archive is a generic term for a container of files. This may be a
+        filesystem folder, it may be a compressed archive, it may even be 
+        a remote location shared on the web. This class is designed to be 
+        subclassed to provide access to a range of file locations. 
+    @par
+        Instances of this class are never constructed or even handled by end-user
+        applications. They are constructed by custom ArchiveFactory classes, 
+        which plugins can register new instances of using ArchiveManager. 
+        End-user applications will typically use ResourceManager or 
+        ResourceGroupManager to manage resources at a higher level, rather than 
+        reading files directly through this class. Doing it this way allows you
+        to benefit from OGRE's automatic searching of multiple file locations 
+        for the resources you are looking for.
+    */
+    class _OgreExport Archive  
+    {
+    protected:
+        /// Archive name
+        String mName; 
+        /// Archive type code
+        String mType;
+    public:
+
+
+        /** Constructor - don't call direct, used by ArchiveFactory.
+        */
+        Archive( const String& name, const String& archType )
+            : mName(name), mType(archType) {}
+
+        /** Default destructor.
+        */
+        virtual ~Archive() {}
+
+		/// Get the name of this archive
+		const String& getName(void) const { return mName; }
+
+        /// Returns whether this archive is case sensitive in the way it matches files
+        virtual bool isCaseSensitive(void) const = 0;
+
+        /** Loads the archive.
+        @remarks
+            This initializes all the internal data of the class.
+        @warning
+            Do not call this function directly, it is ment to be used
+            only by the ArchiveManager class.
+        */
+        virtual void load() = 0;
+
+        /** Unloads the archive.
+        @warning
+            Do not call this function directly, it is ment to be used
+            only by the ArchiveManager class.
+        */
+        virtual void unload() = 0;
+
+        /** Open a stream on a given file. 
+        @note
+            There is no equivalent 'close' method; the returned stream
+            controls the lifecycle of this file operation.
+        @param filename The fully qualified name of the file
+        @returns A shared pointer to a DataStream which can be used to 
+            read / write the file. If the file is not present, returns a null
+			shared pointer.
+        */
+        virtual DataStreamPtr open(const String& filename) const = 0;
+
+        /** List all file names in the archive.
+        @note
+            This method only returns filenames, you can also retrieve other
+            information using listFileInfo.
+        @param recursive Whether all paths of the archive are searched (if the 
+            archive has a concept of that)
+        @param dirs Set to true if you want the directories to be listed
+            instead of files
+        @returns A list of filenames matching the criteria, all are fully qualified
+        */
+        virtual StringVectorPtr list(bool recursive = true, bool dirs = false) = 0;
+        
+        /** List all files in the archive with accompanying information.
+        @param recursive Whether all paths of the archive are searched (if the 
+            archive has a concept of that)
+        @param dirs Set to true if you want the directories to be listed
+            instead of files
+        @returns A list of structures detailing quite a lot of information about
+            all the files in the archive.
+        */
+        virtual FileInfoListPtr listFileInfo(bool recursive = true, bool dirs = false) = 0;
+
+        /** Find all file or directory names matching a given pattern
+            in this archive.
+        @note
+            This method only returns filenames, you can also retrieve other
+            information using findFileInfo.
+        @param pattern The pattern to search for; wildcards (*) are allowed
+        @param recursive Whether all paths of the archive are searched (if the 
+            archive has a concept of that)
+        @param dirs Set to true if you want the directories to be listed
+            instead of files
+        @returns A list of filenames matching the criteria, all are fully qualified
+        */
+        virtual StringVectorPtr find(const String& pattern, bool recursive = true,
+            bool dirs = false) = 0;
+
+        /** Find out if the named file exists (note: fully qualified filename required) */
+        virtual bool exists(const String& filename) = 0; 
+
+        /** Find all files or directories matching a given pattern in this
+            archive and get some detailed information about them.
+        @param pattern The pattern to search for; wildcards (*) are allowed
+        @param recursive Whether all paths of the archive are searched (if the 
+        archive has a concept of that)
+        @param dirs Set to true if you want the directories to be listed
+            instead of files
+        @returns A list of file information structures for all files matching 
+            the criteria.
+        */
+        virtual FileInfoListPtr findFileInfo(const String& pattern, 
+            bool recursive = true, bool dirs = false) = 0;
+
+        /// Return the type code of this Archive
+        const String& getType(void) const { return mType; }
+        
+    };
+}
+
+#endif
Index: /OgreMain/include/OgreArchiveFactory.h
===================================================================
--- /OgreMain/include/OgreArchiveFactory.h	(revision 5)
+++ /OgreMain/include/OgreArchiveFactory.h	(revision 5)
@@ -0,0 +1,62 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _ArchiveFactory_H__
+#define _ArchiveFactory_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreFactoryObj.h"
+
+namespace Ogre {
+
+    /** Abstract factory class, archive codec plugins can register concrete
+        subclasses of this.
+        @remarks
+            All access to 'archives' (collections of files, compressed or
+            just folders, maybe even remote) is managed via the abstract
+            Archive class. Plugins are expected to provide the
+            implementation for the actual codec itself, but because a
+            subclass of Archive has to be created for every archive, a
+            factory class is required to create the appropriate subclass.
+        @par
+            So archive plugins create a subclass of Archive AND a subclass
+            of ArchiveFactory which creates instances of the Archive
+            subclass. See the 'Zip' and 'FileSystem' plugins for examples.
+            Each Archive and ArchiveFactory subclass pair deal with a
+            single archive type (identified by a string).
+    */
+    class _OgreExport ArchiveFactory : public FactoryObj< Archive >
+    {
+    public:
+        // No methods, must just override all methods inherited from FactoryObj
+    };
+
+} // namespace
+
+#endif
Index: /OgreMain/include/OgreArchiveManager.h
===================================================================
--- /OgreMain/include/OgreArchiveManager.h	(revision 5)
+++ /OgreMain/include/OgreArchiveManager.h	(revision 5)
@@ -0,0 +1,130 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _ArchiveManager_H__
+#define _ArchiveManager_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreResourceManager.h"
+#include "OgreSingleton.h"
+
+namespace Ogre {
+
+    /** This class manages the available ArchiveFactory plugins. 
+    */
+    class _OgreExport ArchiveManager : public Singleton<ArchiveManager>
+    {
+    protected:
+        typedef std::map<String, ArchiveFactory*> ArchiveFactoryMap;
+        /// Factories available to create archives, indexed by archive type (String identifier e.g. 'Zip')
+        ArchiveFactoryMap mArchFactories;
+        /// Currently loaded archives
+        typedef std::map<String, Archive*> ArchiveMap;
+        ArchiveMap mArchives;
+
+    public:
+        /** Default constructor - should never get called by a client app.
+        */
+        ArchiveManager() {}
+        /** Default destructor.
+        */
+        virtual ~ArchiveManager();
+
+        /** Opens an archive for file reading.
+            @remarks
+                The archives are created using class factories within
+                extension libraries.
+            @param filename
+                The filename that will be opened
+            @param refLibrary
+                The library that contains the data-handling code
+            @returns
+                If the function succeeds, a valid pointer to an Archive
+                object is returened.
+            @par
+                If the function fails, an exception is thrown.
+        */
+        Archive* load( const String& filename, const String& archiveType);
+
+		/** Unloads an archive.
+		@remarks
+			You must ensure that this archive is not being used before removing it.
+		*/
+		void unload(Archive* arch);
+		/** Unloads an archive by name.
+		@remarks
+			You must ensure that this archive is not being used before removing it.
+		*/
+		void unload(const String& filename);
+
+
+        /** Adds a new ArchiveFactory to the list of available factories.
+            @remarks
+                Plugin developers who add new archive codecs need to call
+                this after defining their ArchiveFactory subclass and
+                Archive subclasses for their archive type.
+        */
+        void addArchiveFactory(ArchiveFactory* factory);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static ArchiveManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static ArchiveManager* getSingletonPtr(void);
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgreAutoParamDataSource.h
===================================================================
--- /OgreMain/include/OgreAutoParamDataSource.h	(revision 5)
+++ /OgreMain/include/OgreAutoParamDataSource.h	(revision 5)
@@ -0,0 +1,225 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __AutoParamDataSource_H_
+#define __AutoParamDataSource_H_
+
+#include "OgrePrerequisites.h"
+#include "OgreCommon.h"
+#include "OgreMatrix4.h"
+#include "OgreVector4.h"
+#include "OgreLight.h"
+#include "OgreColourValue.h"
+
+namespace Ogre {
+
+	// forward decls
+	struct VisibleObjectsBoundsInfo;
+
+
+    /** This utility class is used to hold the information used to generate the matrices
+    and other information required to automatically populate GpuProgramParameters.
+    @remarks
+        This class exercises a lazy-update scheme in order to avoid having to update all
+        the information a GpuProgramParameters class could possibly want all the time. 
+        It relies on the SceneManager to update it when the base data has changed, and
+        will calculate concatenated matrices etc only when required, passing back precalculated
+        matrices when they are requested more than once when the underlying information has
+        not altered.
+    */
+    class _OgreExport AutoParamDataSource
+    {
+    protected:
+        mutable Matrix4 mWorldMatrix[256];
+        mutable size_t mWorldMatrixCount;
+        mutable const Matrix4* mWorldMatrixArray;
+        mutable Matrix4 mWorldViewMatrix;
+        mutable Matrix4 mViewProjMatrix;
+        mutable Matrix4 mWorldViewProjMatrix;
+        mutable Matrix4 mInverseWorldMatrix;
+        mutable Matrix4 mInverseWorldViewMatrix;
+        mutable Matrix4 mInverseViewMatrix;
+        mutable Matrix4 mInverseTransposeWorldMatrix;
+        mutable Matrix4 mInverseTransposeWorldViewMatrix;
+        mutable Vector4 mCameraPositionObjectSpace;
+        mutable Matrix4 mTextureViewProjMatrix[OGRE_MAX_SIMULTANEOUS_LIGHTS];
+        mutable Matrix4 mViewMatrix;
+        mutable Matrix4 mProjectionMatrix;
+		mutable Real mDirLightExtrusionDistance;
+        mutable Vector4 mCameraPosition;
+
+        mutable bool mWorldMatrixDirty;
+        mutable bool mViewMatrixDirty;
+        mutable bool mProjMatrixDirty;
+        mutable bool mWorldViewMatrixDirty;
+        mutable bool mViewProjMatrixDirty;
+        mutable bool mWorldViewProjMatrixDirty;
+        mutable bool mInverseWorldMatrixDirty;
+        mutable bool mInverseWorldViewMatrixDirty;
+        mutable bool mInverseViewMatrixDirty;
+        mutable bool mInverseTransposeWorldMatrixDirty;
+        mutable bool mInverseTransposeWorldViewMatrixDirty;
+        mutable bool mCameraPositionObjectSpaceDirty;
+        mutable bool mCameraPositionDirty;
+        mutable bool mTextureViewProjMatrixDirty[OGRE_MAX_SIMULTANEOUS_LIGHTS];
+		mutable ColourValue mAmbientLight;
+        mutable ColourValue mFogColour;
+        mutable Vector4 mFogParams;
+        mutable int mPassNumber;
+		mutable Vector4 mSceneDepthRange;
+		mutable bool mSceneDepthRangeDirty;
+		// Ordered by light, populated on demand, dirtied when lights change
+		mutable std::vector<Vector4> mShadowCamDepthRanges;
+		mutable bool mShadowCamDepthRangesDirty;
+
+        const Renderable* mCurrentRenderable;
+        const Camera* mCurrentCamera;
+        const LightList* mCurrentLightList;
+        const Frustum* mCurrentTextureProjector[OGRE_MAX_SIMULTANEOUS_LIGHTS];
+        const RenderTarget* mCurrentRenderTarget;
+        const Viewport* mCurrentViewport;
+		const SceneManager* mCurrentSceneManager;
+		const VisibleObjectsBoundsInfo* mMainCamBoundsInfo;
+        const Pass* mCurrentPass;
+
+        Light mBlankLight;
+    public:
+        AutoParamDataSource();
+        ~AutoParamDataSource();
+        /** Updates the current renderable */
+        void setCurrentRenderable(const Renderable* rend);
+        /** Sets the world matrices, avoid query from renderable again */
+        void setWorldMatrices(const Matrix4* m, size_t count);
+        /** Updates the current camera */
+        void setCurrentCamera(const Camera* cam);
+        /** Sets the light list that should be used */
+        void setCurrentLightList(const LightList* ll);
+        /** Sets the current texture projector for a index */
+        void setTextureProjector(const Frustum* frust, size_t index);
+        /** Sets the current render target */
+        void setCurrentRenderTarget(const RenderTarget* target);
+        /** Sets the current viewport */
+        void setCurrentViewport(const Viewport* viewport);
+		/** Sets the shadow extrusion distance to be used for point lights. */
+		void setShadowDirLightExtrusionDistance(Real dist);
+		/** Sets the main camera's scene bounding information */
+		void setMainCamBoundsInfo(VisibleObjectsBoundsInfo* info);
+		/** Set the current scene manager for enquiring on demand */
+		void setCurrentSceneManager(const SceneManager* sm);
+        /** Sets the current pass */
+        void setCurrentPass(const Pass* pass);
+
+
+
+        const Matrix4& getWorldMatrix(void) const;
+        const Matrix4* getWorldMatrixArray(void) const;
+        size_t getWorldMatrixCount(void) const;
+        const Matrix4& getViewMatrix(void) const;
+        const Matrix4& getViewProjectionMatrix(void) const;
+        const Matrix4& getProjectionMatrix(void) const;
+        const Matrix4& getWorldViewProjMatrix(void) const;
+        const Matrix4& getWorldViewMatrix(void) const;
+        const Matrix4& getInverseWorldMatrix(void) const;
+        const Matrix4& getInverseWorldViewMatrix(void) const;
+        const Matrix4& getInverseViewMatrix(void) const;
+        const Matrix4& getInverseTransposeWorldMatrix(void) const;
+        const Matrix4& getInverseTransposeWorldViewMatrix(void) const;
+        const Vector4& getCameraPosition(void) const;
+        const Vector4& getCameraPositionObjectSpace(void) const;
+        /** Get the light which is 'index'th closest to the current object */
+        const Light& getLight(size_t index) const;
+		void setAmbientLightColour(const ColourValue& ambient);
+		const ColourValue& getAmbientLightColour(void) const;
+        const ColourValue& getSurfaceAmbientColour(void) const;
+        const ColourValue& getSurfaceDiffuseColour(void) const;
+        const ColourValue& getSurfaceSpecularColour(void) const;
+        const ColourValue& getSurfaceEmissiveColour(void) const;
+        Real getSurfaceShininess(void) const;
+        ColourValue getDerivedAmbientLightColour(void) const;
+        ColourValue getDerivedSceneColour(void) const;
+        void setFog(FogMode mode, const ColourValue& colour, Real expDensity, Real linearStart, Real linearEnd);
+        const ColourValue& getFogColour(void) const;
+        const Vector4& getFogParams(void) const;
+        const Matrix4& getTextureViewProjMatrix(size_t index) const;
+        const RenderTarget* getCurrentRenderTarget(void) const;
+        const Renderable* getCurrentRenderable(void) const;
+        const Pass* getCurrentPass(void) const;
+        Vector4 getTextureSize(size_t index) const;
+        Vector4 getInverseTextureSize(size_t index) const;
+        Vector4 getPackedTextureSize(size_t index) const;
+		Real getShadowExtrusionDistance(void) const;
+		const Vector4& getSceneDepthRange() const;
+		const Vector4& getShadowSceneDepthRange(size_t lightIndex) const;
+		Matrix4 getInverseViewProjMatrix(void) const;
+		Matrix4 getInverseTransposeViewProjMatrix() const;
+		Matrix4 getTransposeViewProjMatrix() const;
+		Matrix4 getTransposeViewMatrix() const;
+        Matrix4 getInverseTransposeViewMatrix() const;
+		Matrix4 getTransposeProjectionMatrix() const;
+		Matrix4 getInverseProjectionMatrix() const;
+		Matrix4 getInverseTransposeProjectionMatrix() const;
+		Matrix4 getTransposeWorldViewProjMatrix() const;
+		Matrix4 getInverseWorldViewProjMatrix() const;
+		Matrix4 getInverseTransposeWorldViewProjMatrix() const;
+		Matrix4 getTransposeWorldViewMatrix() const;
+		Matrix4 getTransposeWorldMatrix() const;
+        Real getTime(void) const;
+		Real getTime_0_X(Real x) const;
+		Real getCosTime_0_X(Real x) const;
+		Real getSinTime_0_X(Real x) const;
+		Real getTanTime_0_X(Real x) const;
+		Vector4 getTime_0_X_packed(Real x) const;
+		Real getTime_0_1(Real x) const;
+		Real getCosTime_0_1(Real x) const;
+		Real getSinTime_0_1(Real x) const;
+		Real getTanTime_0_1(Real x) const;
+		Vector4 getTime_0_1_packed(Real x) const;
+		Real getTime_0_2Pi(Real x) const;
+		Real getCosTime_0_2Pi(Real x) const;
+		Real getSinTime_0_2Pi(Real x) const;
+		Real getTanTime_0_2Pi(Real x) const;
+		Vector4 getTime_0_2Pi_packed(Real x) const;
+        Real getFrameTime(void) const;
+		Real getFPS() const;
+		Real getViewportWidth() const;
+		Real getViewportHeight() const;
+		Real getInverseViewportWidth() const;
+		Real getInverseViewportHeight() const;
+		Vector3 getViewDirection() const;
+		Vector3 getViewSideVector() const;
+		Vector3 getViewUpVector() const;
+		Real getFOV() const;
+		Real getNearClipDistance() const;
+		Real getFarClipDistance() const;
+        int getPassNumber(void) const;
+        void setPassNumber(const int passNumber);
+        void incPassNumber(void);
+    };
+}
+
+#endif
Index: /OgreMain/include/OgreAxisAlignedBox.h
===================================================================
--- /OgreMain/include/OgreAxisAlignedBox.h	(revision 5)
+++ /OgreMain/include/OgreAxisAlignedBox.h	(revision 5)
@@ -0,0 +1,793 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __AxisAlignedBox_H_
+#define __AxisAlignedBox_H_
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+
+#include "OgreVector3.h"
+#include "OgreMatrix4.h"
+
+namespace Ogre {
+
+	/** A 3D box aligned with the x/y/z axes.
+	@remarks
+	This class represents a simple box which is aligned with the
+	axes. Internally it only stores 2 points as the extremeties of
+	the box, one which is the minima of all 3 axes, and the other
+	which is the maxima of all 3 axes. This class is typically used
+	for an axis-aligned bounding box (AABB) for collision and
+	visibility determination.
+	*/
+	class _OgreExport AxisAlignedBox
+	{
+	protected:
+		enum Extent
+		{
+			EXTENT_NULL,
+			EXTENT_FINITE,
+			EXTENT_INFINITE
+		};
+
+		Vector3 mMinimum;
+		Vector3 mMaximum;
+		Extent mExtent;
+		mutable Vector3* mpCorners;
+
+	public:
+		/*
+		1-----2
+		/|    /|
+		/ |   / |
+		5-----4  |
+		|  0--|--3
+		| /   | /
+		|/    |/
+		6-----7
+		*/
+		typedef enum {
+			FAR_LEFT_BOTTOM = 0,
+			FAR_LEFT_TOP = 1,
+			FAR_RIGHT_TOP = 2,
+			FAR_RIGHT_BOTTOM = 3,
+			NEAR_RIGHT_BOTTOM = 7,
+			NEAR_LEFT_BOTTOM = 6,
+			NEAR_LEFT_TOP = 5,
+			NEAR_RIGHT_TOP = 4
+		} CornerEnum;
+		inline AxisAlignedBox() : mpCorners(0)
+		{
+			// Default to a null box 
+			setMinimum( -0.5, -0.5, -0.5 );
+			setMaximum( 0.5, 0.5, 0.5 );
+			mExtent = EXTENT_NULL;
+		}
+
+		inline AxisAlignedBox(const AxisAlignedBox & rkBox) : mpCorners(0)
+		{
+			if (rkBox.isNull())
+				setNull();
+			else if (rkBox.isInfinite())
+				setInfinite();
+			else
+				setExtents( rkBox.mMinimum, rkBox.mMaximum );
+		}
+
+		inline AxisAlignedBox( const Vector3& min, const Vector3& max ) : mpCorners(0)
+		{
+			setExtents( min, max );
+		}
+
+		inline AxisAlignedBox(
+			Real mx, Real my, Real mz,
+			Real Mx, Real My, Real Mz ) : mpCorners(0)
+		{
+			setExtents( mx, my, mz, Mx, My, Mz );
+		}
+
+		AxisAlignedBox& operator=(const AxisAlignedBox& rhs)
+		{
+			// Specifically override to avoid copying mpCorners
+			if (rhs.isNull())
+				setNull();
+			else if (rhs.isInfinite())
+				setInfinite();
+			else
+				setExtents(rhs.mMinimum, rhs.mMaximum);
+
+			return *this;
+		}
+
+		~AxisAlignedBox()
+		{
+			if (mpCorners)
+				delete [] mpCorners;
+		}
+
+
+		/** Gets the minimum corner of the box.
+		*/
+		inline const Vector3& getMinimum(void) const
+		{ 
+			return mMinimum; 
+		}
+
+		/** Gets a modifiable version of the minimum
+		corner of the box.
+		*/
+		inline Vector3& getMinimum(void)
+		{ 
+			return mMinimum; 
+		}
+
+		/** Gets the maximum corner of the box.
+		*/
+		inline const Vector3& getMaximum(void) const
+		{ 
+			return mMaximum;
+		}
+
+		/** Gets a modifiable version of the maximum
+		corner of the box.
+		*/
+		inline Vector3& getMaximum(void)
+		{ 
+			return mMaximum;
+		}
+
+
+		/** Sets the minimum corner of the box.
+		*/
+		inline void setMinimum( const Vector3& vec )
+		{
+			mExtent = EXTENT_FINITE;
+			mMinimum = vec;
+		}
+
+		inline void setMinimum( Real x, Real y, Real z )
+		{
+			mExtent = EXTENT_FINITE;
+			mMinimum.x = x;
+			mMinimum.y = y;
+			mMinimum.z = z;
+		}
+
+		/** Changes one of the components of the minimum corner of the box
+		used to resize only one dimension of the box
+		*/
+		inline void setMinimumX(Real x)
+		{
+			mMinimum.x = x;
+		}
+
+		inline void setMinimumY(Real y)
+		{
+			mMinimum.y = y;
+		}
+
+		inline void setMinimumZ(Real z)
+		{
+			mMinimum.z = z;
+		}
+
+		/** Sets the maximum corner of the box.
+		*/
+		inline void setMaximum( const Vector3& vec )
+		{
+			mExtent = EXTENT_FINITE;
+			mMaximum = vec;
+		}
+
+		inline void setMaximum( Real x, Real y, Real z )
+		{
+			mExtent = EXTENT_FINITE;
+			mMaximum.x = x;
+			mMaximum.y = y;
+			mMaximum.z = z;
+		}
+
+		/** Changes one of the components of the maximum corner of the box
+		used to resize only one dimension of the box
+		*/
+		inline void setMaximumX( Real x )
+		{
+			mMaximum.x = x;
+		}
+
+		inline void setMaximumY( Real y )
+		{
+			mMaximum.y = y;
+		}
+
+		inline void setMaximumZ( Real z )
+		{
+			mMaximum.z = z;
+		}
+
+		/** Sets both minimum and maximum extents at once.
+		*/
+		inline void setExtents( const Vector3& min, const Vector3& max )
+		{
+            assert( (min.x <= max.x && min.y <= max.y && min.z <= max.z) &&
+                "The minimum corner of the box must be less than or equal to maximum corner" );
+
+			mExtent = EXTENT_FINITE;
+			mMinimum = min;
+			mMaximum = max;
+		}
+
+		inline void setExtents(
+			Real mx, Real my, Real mz,
+			Real Mx, Real My, Real Mz )
+		{
+            assert( (mx <= Mx && my <= My && mz <= Mz) &&
+                "The minimum corner of the box must be less than or equal to maximum corner" );
+
+			mExtent = EXTENT_FINITE;
+
+			mMinimum.x = mx;
+			mMinimum.y = my;
+			mMinimum.z = mz;
+
+			mMaximum.x = Mx;
+			mMaximum.y = My;
+			mMaximum.z = Mz;
+
+		}
+
+		/** Returns a pointer to an array of 8 corner points, useful for
+		collision vs. non-aligned objects.
+		@remarks
+		If the order of these corners is important, they are as
+		follows: The 4 points of the minimum Z face (note that
+		because Ogre uses right-handed coordinates, the minimum Z is
+		at the 'back' of the box) starting with the minimum point of
+		all, then anticlockwise around this face (if you are looking
+		onto the face from outside the box). Then the 4 points of the
+		maximum Z face, starting with maximum point of all, then
+		anticlockwise around this face (looking onto the face from
+		outside the box). Like this:
+		<pre>
+		1-----2
+		/|    /|
+		/ |   / |
+		5-----4  |
+		|  0--|--3
+		| /   | /
+		|/    |/
+		6-----7
+		</pre>
+		@remarks as this implementation uses a static member, make sure to use your own copy !
+		*/
+		inline const Vector3* getAllCorners(void) const
+		{
+			assert( (mExtent == EXTENT_FINITE) && "Can't get corners of a null or infinite AAB" );
+
+			// The order of these items is, using right-handed co-ordinates:
+			// Minimum Z face, starting with Min(all), then anticlockwise
+			//   around face (looking onto the face)
+			// Maximum Z face, starting with Max(all), then anticlockwise
+			//   around face (looking onto the face)
+			// Only for optimization/compatibility.
+			if (!mpCorners)
+				mpCorners = new Vector3[8];
+
+			mpCorners[0] = mMinimum;
+			mpCorners[1].x = mMinimum.x; mpCorners[1].y = mMaximum.y; mpCorners[1].z = mMinimum.z;
+			mpCorners[2].x = mMaximum.x; mpCorners[2].y = mMaximum.y; mpCorners[2].z = mMinimum.z;
+			mpCorners[3].x = mMaximum.x; mpCorners[3].y = mMinimum.y; mpCorners[3].z = mMinimum.z;            
+
+			mpCorners[4] = mMaximum;
+			mpCorners[5].x = mMinimum.x; mpCorners[5].y = mMaximum.y; mpCorners[5].z = mMaximum.z;
+			mpCorners[6].x = mMinimum.x; mpCorners[6].y = mMinimum.y; mpCorners[6].z = mMaximum.z;
+			mpCorners[7].x = mMaximum.x; mpCorners[7].y = mMinimum.y; mpCorners[7].z = mMaximum.z;
+
+			return mpCorners;
+		}
+
+		/** gets the position of one of the corners
+		*/
+		Vector3 getCorner(CornerEnum cornerToGet) const
+		{
+			switch(cornerToGet)
+			{
+			case FAR_LEFT_BOTTOM:
+				return mMinimum;
+			case FAR_LEFT_TOP:
+				return Vector3(mMinimum.x, mMaximum.y, mMinimum.z);
+			case FAR_RIGHT_TOP:
+				return Vector3(mMaximum.x, mMaximum.y, mMinimum.z);
+			case FAR_RIGHT_BOTTOM:
+				return Vector3(mMaximum.x, mMinimum.y, mMinimum.z);
+			case NEAR_RIGHT_BOTTOM:
+				return Vector3(mMaximum.x, mMinimum.y, mMaximum.z);
+			case NEAR_LEFT_BOTTOM:
+				return Vector3(mMinimum.x, mMinimum.y, mMaximum.z);
+			case NEAR_LEFT_TOP:
+				return Vector3(mMinimum.x, mMaximum.y, mMaximum.z);
+			case NEAR_RIGHT_TOP:
+				return mMaximum;
+			default:
+				return Vector3();
+			}
+		}
+
+		_OgreExport friend std::ostream& operator<<( std::ostream& o, const AxisAlignedBox aab )
+		{
+			switch (aab.mExtent)
+			{
+			case EXTENT_NULL:
+				o << "AxisAlignedBox(null)";
+				return o;
+
+			case EXTENT_FINITE:
+				o << "AxisAlignedBox(min=" << aab.mMinimum << ", max=" << aab.mMaximum << ")";
+				return o;
+
+			case EXTENT_INFINITE:
+				o << "AxisAlignedBox(infinite)";
+				return o;
+
+			default: // shut up compiler
+				assert( false && "Never reached" );
+				return o;
+			}
+		}
+
+		/** Merges the passed in box into the current box. The result is the
+		box which encompasses both.
+		*/
+		void merge( const AxisAlignedBox& rhs )
+		{
+			// Do nothing if rhs null, or this is infinite
+			if ((rhs.mExtent == EXTENT_NULL) || (mExtent == EXTENT_INFINITE))
+			{
+				return;
+			}
+			// Otherwise if rhs is infinite, make this infinite, too
+			else if (rhs.mExtent == EXTENT_INFINITE)
+			{
+				mExtent = EXTENT_INFINITE;
+			}
+			// Otherwise if current null, just take rhs
+			else if (mExtent == EXTENT_NULL)
+			{
+				setExtents(rhs.mMinimum, rhs.mMaximum);
+			}
+			// Otherwise merge
+			else
+			{
+				Vector3 min = mMinimum;
+				Vector3 max = mMaximum;
+				max.makeCeil(rhs.mMaximum);
+				min.makeFloor(rhs.mMinimum);
+
+				setExtents(min, max);
+			}
+
+		}
+
+		/** Extends the box to encompass the specified point (if needed).
+		*/
+		inline void merge( const Vector3& point )
+		{
+			switch (mExtent)
+			{
+			case EXTENT_NULL: // if null, use this point
+				setExtents(point, point);
+				return;
+
+			case EXTENT_FINITE:
+				mMaximum.makeCeil(point);
+				mMinimum.makeFloor(point);
+				return;
+
+			case EXTENT_INFINITE: // if infinite, makes no difference
+				return;
+			}
+
+			assert( false && "Never reached" );
+		}
+
+		/** Transforms the box according to the matrix supplied.
+		@remarks
+		By calling this method you get the axis-aligned box which
+		surrounds the transformed version of this box. Therefore each
+		corner of the box is transformed by the matrix, then the
+		extents are mapped back onto the axes to produce another
+		AABB. Useful when you have a local AABB for an object which
+		is then transformed.
+		*/
+		inline void transform( const Matrix4& matrix )
+		{
+			// Do nothing if current null or infinite
+			if( mExtent != EXTENT_FINITE )
+				return;
+
+			Vector3 oldMin, oldMax, currentCorner;
+
+			// Getting the old values so that we can use the existing merge method.
+			oldMin = mMinimum;
+			oldMax = mMaximum;
+
+			// reset
+			setNull();
+
+			// We sequentially compute the corners in the following order :
+			// 0, 6, 5, 1, 2, 4 ,7 , 3
+			// This sequence allows us to only change one member at a time to get at all corners.
+
+			// For each one, we transform it using the matrix
+			// Which gives the resulting point and merge the resulting point.
+
+			// First corner 
+			// min min min
+			currentCorner = oldMin;
+			merge( matrix * currentCorner );
+
+			// min,min,max
+			currentCorner.z = oldMax.z;
+			merge( matrix * currentCorner );
+
+			// min max max
+			currentCorner.y = oldMax.y;
+			merge( matrix * currentCorner );
+
+			// min max min
+			currentCorner.z = oldMin.z;
+			merge( matrix * currentCorner );
+
+			// max max min
+			currentCorner.x = oldMax.x;
+			merge( matrix * currentCorner );
+
+			// max max max
+			currentCorner.z = oldMax.z;
+			merge( matrix * currentCorner );
+
+			// max min max
+			currentCorner.y = oldMin.y;
+			merge( matrix * currentCorner );
+
+			// max min min
+			currentCorner.z = oldMin.z;
+			merge( matrix * currentCorner ); 
+		}
+
+		/** Transforms the box according to the affine matrix supplied.
+		@remarks
+		By calling this method you get the axis-aligned box which
+		surrounds the transformed version of this box. Therefore each
+		corner of the box is transformed by the matrix, then the
+		extents are mapped back onto the axes to produce another
+		AABB. Useful when you have a local AABB for an object which
+		is then transformed.
+		@note
+		The matrix must be an affine matrix. @see Matrix4::isAffine.
+		*/
+		void transformAffine(const Matrix4& m)
+		{
+			assert(m.isAffine());
+
+			// Do nothing if current null or infinite
+			if ( mExtent != EXTENT_FINITE )
+				return;
+
+			Vector3 centre = getCenter();
+			Vector3 halfSize = getHalfSize();
+
+			Vector3 newCentre = m.transformAffine(centre);
+			Vector3 newHalfSize(
+				Math::Abs(m[0][0]) * halfSize.x + Math::Abs(m[0][1]) * halfSize.y + Math::Abs(m[0][2]) * halfSize.z, 
+				Math::Abs(m[1][0]) * halfSize.x + Math::Abs(m[1][1]) * halfSize.y + Math::Abs(m[1][2]) * halfSize.z,
+				Math::Abs(m[2][0]) * halfSize.x + Math::Abs(m[2][1]) * halfSize.y + Math::Abs(m[2][2]) * halfSize.z);
+
+			setExtents(newCentre - newHalfSize, newCentre + newHalfSize);
+		}
+
+		/** Sets the box to a 'null' value i.e. not a box.
+		*/
+		inline void setNull()
+		{
+			mExtent = EXTENT_NULL;
+		}
+
+		/** Returns true if the box is null i.e. empty.
+		*/
+		inline bool isNull(void) const
+		{
+			return (mExtent == EXTENT_NULL);
+		}
+
+		/** Returns true if the box is finite.
+		*/
+		bool isFinite(void) const
+		{
+			return (mExtent == EXTENT_FINITE);
+		}
+
+		/** Sets the box to 'infinite'
+		*/
+		inline void setInfinite()
+		{
+			mExtent = EXTENT_INFINITE;
+		}
+
+		/** Returns true if the box is infinite.
+		*/
+		bool isInfinite(void) const
+		{
+			return (mExtent == EXTENT_INFINITE);
+		}
+
+		/** Returns whether or not this box intersects another. */
+		inline bool intersects(const AxisAlignedBox& b2) const
+		{
+			// Early-fail for nulls
+			if (this->isNull() || b2.isNull())
+				return false;
+
+			// Early-success for infinites
+			if (this->isInfinite() || b2.isInfinite())
+				return true;
+
+			// Use up to 6 separating planes
+			if (mMaximum.x < b2.mMinimum.x)
+				return false;
+			if (mMaximum.y < b2.mMinimum.y)
+				return false;
+			if (mMaximum.z < b2.mMinimum.z)
+				return false;
+
+			if (mMinimum.x > b2.mMaximum.x)
+				return false;
+			if (mMinimum.y > b2.mMaximum.y)
+				return false;
+			if (mMinimum.z > b2.mMaximum.z)
+				return false;
+
+			// otherwise, must be intersecting
+			return true;
+
+		}
+
+		/// Calculate the area of intersection of this box and another
+		inline AxisAlignedBox intersection(const AxisAlignedBox& b2) const
+		{
+            if (this->isNull() || b2.isNull())
+			{
+				return AxisAlignedBox();
+			}
+			else if (this->isInfinite())
+			{
+				return b2;
+			}
+			else if (b2.isInfinite())
+			{
+				return *this;
+			}
+
+			Vector3 intMin = mMinimum;
+            Vector3 intMax = mMaximum;
+
+            intMin.makeCeil(b2.getMinimum());
+            intMax.makeFloor(b2.getMaximum());
+
+            // Check intersection isn't null
+            if (intMin.x < intMax.x &&
+                intMin.y < intMax.y &&
+                intMin.z < intMax.z)
+            {
+                return AxisAlignedBox(intMin, intMax);
+            }
+
+            return AxisAlignedBox();
+		}
+
+		/// Calculate the volume of this box
+		Real volume(void) const
+		{
+			switch (mExtent)
+			{
+			case EXTENT_NULL:
+				return 0.0f;
+
+			case EXTENT_FINITE:
+				{
+					Vector3 diff = mMaximum - mMinimum;
+					return diff.x * diff.y * diff.z;
+				}
+
+			case EXTENT_INFINITE:
+				return Math::POS_INFINITY;
+
+			default: // shut up compiler
+				assert( false && "Never reached" );
+				return 0.0f;
+			}
+		}
+
+		/** Scales the AABB by the vector given. */
+		inline void scale(const Vector3& s)
+		{
+			// Do nothing if current null or infinite
+			if (mExtent != EXTENT_FINITE)
+				return;
+
+			// NB assumes centered on origin
+			Vector3 min = mMinimum * s;
+			Vector3 max = mMaximum * s;
+			setExtents(min, max);
+		}
+
+		/** Tests whether this box intersects a sphere. */
+		bool intersects(const Sphere& s) const
+		{
+			return Math::intersects(s, *this); 
+		}
+		/** Tests whether this box intersects a plane. */
+		bool intersects(const Plane& p) const
+		{
+			return Math::intersects(p, *this);
+		}
+		/** Tests whether the vector point is within this box. */
+		bool intersects(const Vector3& v) const
+		{
+			switch (mExtent)
+			{
+			case EXTENT_NULL:
+				return false;
+
+			case EXTENT_FINITE:
+				return(v.x >= mMinimum.x  &&  v.x <= mMaximum.x  && 
+					v.y >= mMinimum.y  &&  v.y <= mMaximum.y  && 
+					v.z >= mMinimum.z  &&  v.z <= mMaximum.z);
+
+			case EXTENT_INFINITE:
+				return true;
+
+			default: // shut up compiler
+				assert( false && "Never reached" );
+				return false;
+			}
+		}
+		/// Gets the centre of the box
+		Vector3 getCenter(void) const
+		{
+			assert( (mExtent == EXTENT_FINITE) && "Can't get center of a null or infinite AAB" );
+
+			return Vector3(
+				(mMaximum.x + mMinimum.x) * 0.5,
+				(mMaximum.y + mMinimum.y) * 0.5,
+				(mMaximum.z + mMinimum.z) * 0.5);
+		}
+		/// Gets the size of the box
+		Vector3 getSize(void) const
+		{
+			switch (mExtent)
+			{
+			case EXTENT_NULL:
+				return Vector3::ZERO;
+
+			case EXTENT_FINITE:
+				return mMaximum - mMinimum;
+
+			case EXTENT_INFINITE:
+				return Vector3(
+					Math::POS_INFINITY,
+					Math::POS_INFINITY,
+					Math::POS_INFINITY);
+
+			default: // shut up compiler
+				assert( false && "Never reached" );
+				return Vector3::ZERO;
+			}
+		}
+		/// Gets the half-size of the box
+		Vector3 getHalfSize(void) const
+		{
+			switch (mExtent)
+			{
+			case EXTENT_NULL:
+				return Vector3::ZERO;
+
+			case EXTENT_FINITE:
+				return (mMaximum - mMinimum) * 0.5;
+
+			case EXTENT_INFINITE:
+				return Vector3(
+					Math::POS_INFINITY,
+					Math::POS_INFINITY,
+					Math::POS_INFINITY);
+
+			default: // shut up compiler
+				assert( false && "Never reached" );
+				return Vector3::ZERO;
+			}
+		}
+
+        /** Tests whether the given point contained by this box.
+        */
+        bool contains(const Vector3& v) const
+        {
+            if (isNull())
+                return false;
+            if (isInfinite())
+                return true;
+
+            return mMinimum.x <= v.x && v.x <= mMaximum.x &&
+                   mMinimum.y <= v.y && v.y <= mMaximum.y &&
+                   mMinimum.z <= v.z && v.z <= mMaximum.z;
+        }
+
+        /** Tests whether another box contained by this box.
+        */
+        bool contains(const AxisAlignedBox& other) const
+        {
+            if (other.isNull() || this->isInfinite())
+                return true;
+
+            if (this->isNull() || other.isInfinite())
+                return false;
+
+            return this->mMinimum.x <= other.mMinimum.x &&
+                   this->mMinimum.y <= other.mMinimum.y &&
+                   this->mMinimum.z <= other.mMinimum.z &&
+                   other.mMaximum.x <= this->mMaximum.x &&
+                   other.mMaximum.y <= this->mMaximum.y &&
+                   other.mMaximum.z <= this->mMaximum.z;
+        }
+
+        /** Tests 2 boxes for equality.
+        */
+        bool operator== (const AxisAlignedBox& rhs) const
+        {
+            if (this->mExtent != rhs.mExtent)
+                return false;
+
+            if (!this->isFinite())
+                return true;
+
+            return this->mMinimum == rhs.mMinimum &&
+                   this->mMaximum == rhs.mMaximum;
+        }
+
+        /** Tests 2 boxes for inequality.
+        */
+        bool operator!= (const AxisAlignedBox& rhs) const
+        {
+            return !(*this == rhs);
+        }
+
+	};
+
+} // namespace Ogre
+
+#endif
Index: /OgreMain/include/OgreBillboard.h
===================================================================
--- /OgreMain/include/OgreBillboard.h	(revision 5)
+++ /OgreMain/include/OgreBillboard.h	(revision 5)
@@ -0,0 +1,217 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __Billboard_H__
+#define __Billboard_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreVector3.h"
+#include "OgreColourValue.h"
+#include "OgreCommon.h"
+
+namespace Ogre {
+
+    /** A billboard is a primitive which always faces the camera in every frame.
+        @remarks
+            Billboards can be used for special effects or some other trickery which requires the
+            triangles to always facing the camera no matter where it is. Ogre groups billboards into
+            sets for efficiency, so you should never create a billboard on it's own (it's ok to have a
+            set of one if you need it).
+        @par
+            Billboards have their geometry generated every frame depending on where the camera is. It is most
+            beneficial for all billboards in a set to be identically sized since Ogre can take advantage of this and
+            save some calculations - useful when you have sets of hundreds of billboards as is possible with special
+            effects. You can deviate from this if you wish (example: a smoke effect would probably have smoke puffs
+            expanding as they rise, so each billboard will legitimately have it's own size) but be aware the extra
+            overhead this brings and try to avoid it if you can.
+        @par
+            Billboards are just the mechanism for rendering a range of effects such as particles. It is other classes
+            which use billboards to create their individual effects, so the methods here are quite generic.
+        @see
+            BillboardSet
+    */
+
+    class _OgreExport Billboard
+    {
+        friend class BillboardSet;
+        friend class BillboardParticleRenderer;
+    protected:
+        bool mOwnDimensions;
+        bool mUseTexcoordRect;
+        uint16 mTexcoordIndex;      // index into the BillboardSet array of texture coordinates
+        FloatRect mTexcoordRect;    // individual texture coordinates
+        Real mWidth;
+        Real mHeight;
+    public:
+        // Note the intentional public access to main internal variables used at runtime
+        // Forcing access via get/set would be too costly for 000's of billboards
+        Vector3 mPosition;
+        // Normalised direction vector
+        Vector3 mDirection;
+        BillboardSet* mParentSet;
+        ColourValue mColour;
+        Radian mRotation;
+
+        /** Default constructor.
+        */
+        Billboard();
+
+        /** Default destructor.
+        */
+        ~Billboard();
+
+        /** Normal constructor as called by BillboardSet.
+        */
+        Billboard(const Vector3& position, BillboardSet* owner, const ColourValue& colour = ColourValue::White);
+
+        /** Get the rotation of the billboard.
+            @remarks
+                This rotation is relative to the center of the billboard.
+        */
+        const Radian& getRotation(void) const { return mRotation; }
+
+        /** Set the rotation of the billboard.
+            @remarks
+                This rotation is relative to the center of the billboard.
+        */
+        void setRotation(const Radian& rotation);
+
+        /** Set the position of the billboard.
+            @remarks
+                This position is relative to a point on the quad which is the billboard. Depending on the BillboardSet,
+                this may be the center of the quad, the top-left etc. See BillboardSet::setBillboardOrigin for more info.
+        */
+        void setPosition(const Vector3& position);
+
+        /** Set the position of the billboard.
+            @remarks
+                This position is relative to a point on the quad which is the billboard. Depending on the BillboardSet,
+                this may be the center of the quad, the top-left etc. See BillboardSet::setBillboardOrigin for more info.
+        */
+        void setPosition(Real x, Real y, Real z);
+
+        /** Get the position of the billboard.
+            @remarks
+                This position is relative to a point on the quad which is the billboard. Depending on the BillboardSet,
+                this may be the center of the quad, the top-left etc. See BillboardSet::setBillboardOrigin for more info.
+        */
+        const Vector3& getPosition(void) const;
+
+        /** Sets the width and height for this billboard.
+            @remarks
+                Note that it is most efficient for every billboard in a BillboardSet to have the same dimensions. If you
+                choose to alter the dimensions of an individual billboard the set will be less efficient. Do not call
+                this method unless you really need to have different billboard dimensions within the same set. Otherwise
+                just call the BillboardSet::setDefaultDimensions method instead.
+        */
+        void setDimensions(Real width, Real height);
+
+        /** Resets this Billboard to use the parent BillboardSet's dimensions instead of it's own. */
+        void resetDimensions(void) { mOwnDimensions = false; }
+        /** Sets the colour of this billboard.
+            @remarks
+                Billboards can be tinted based on a base colour. This allows variations in colour irresective of the
+                base colour of the material allowing more varied billboards. The default colour is white.
+                The tinting is effected using vertex colours.
+        */
+        void setColour(const ColourValue& colour);
+
+        /** Gets the colour of this billboard.
+        */
+        const ColourValue& getColour(void) const;
+
+        /** Returns true if this billboard deviates from the BillboardSet's default dimensions (i.e. if the
+            Billboard::setDimensions method has been called for this instance).
+            @see
+                Billboard::setDimensions
+        */
+        bool hasOwnDimensions(void) const;
+
+        /** Retrieves the billboard's personal width, if hasOwnDimensions is true. */
+        Real getOwnWidth(void) const;
+
+        /** Retrieves the billboard's personal width, if hasOwnDimensions is true. */
+        Real getOwnHeight(void) const;
+
+        /** Internal method for notifying the billboard of it's owner.
+        */
+        void _notifyOwner(BillboardSet* owner);
+
+        /** Returns true if this billboard use individual texture coordinate rect (i.e. if the 
+            Billboard::setTexcoordRect method has been called for this instance), or returns
+            false if use texture coordinates defined in the parent BillboardSet's texture
+            coordinates array (i.e. if the Billboard::setTexcoordIndex method has been called
+            for this instance).
+            @see
+                Billboard::setTexcoordIndex()
+                Billboard::setTexcoordRect()
+        */
+        bool isUseTexcoordRect(void) const { return mUseTexcoordRect; }
+
+        /** setTexcoordIndex() sets which texture coordinate rect this billboard will use 
+            when rendering. The parent billboard set may contain more than one, in which 
+            case a billboard can be textured with different pieces of a larger texture 
+            sheet very efficiently.
+          @see
+            BillboardSet::setTextureCoords()
+          */
+        void setTexcoordIndex(uint16 texcoordIndex);
+
+        /** getTexcoordIndex() returns the previous value set by setTexcoordIndex(). 
+            The default value is 0, which is always a valid texture coordinate set.
+            @remarks
+                This value is useful only when isUseTexcoordRect return false.
+          */
+        uint16 getTexcoordIndex(void) const { return mTexcoordIndex; }
+
+        /** setTexcoordRect() sets the individual texture coordinate rect of this billboard
+            will use when rendering. The parent billboard set may contain more than one, in
+            which case a billboard can be textured with different pieces of a larger texture
+            sheet very efficiently.
+        */
+        void setTexcoordRect(const FloatRect& texcoordRect);
+
+        /** setTexcoordRect() sets the individual texture coordinate rect of this billboard
+            will use when rendering. The parent billboard set may contain more than one, in
+            which case a billboard can be textured with different pieces of a larger texture
+            sheet very efficiently.
+        */
+        void setTexcoordRect(Real u0, Real v0, Real u1, Real v1);
+
+        /** getTexcoordRect() returns the previous value set by setTexcoordRect(). 
+            @remarks
+                This value is useful only when isUseTexcoordRect return true.
+        */
+        const FloatRect& getTexcoordRect(void) const { return mTexcoordRect; }
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgreBillboardChain.h
===================================================================
--- /OgreMain/include/OgreBillboardChain.h	(revision 5)
+++ /OgreMain/include/OgreBillboardChain.h	(revision 5)
@@ -0,0 +1,343 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+// Thanks to Vincent Cantin (karmaGfa) for the original implementation of this
+// class, although it has now been mostly rewritten
+
+#ifndef _BillboardChain_H__
+#define _BillboardChain_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreMovableObject.h"
+#include "OgreRenderable.h"
+
+namespace Ogre {
+
+
+	/** Allows the rendering of a chain of connected billboards.
+	@remarks
+		A billboard chain operates much like a traditional billboard, ie its
+		segments always face the camera; the difference being that instead of
+		a set of disconnected quads, the elements in this class are connected
+		together in a chain which must always stay in a continuous strip. This
+		kind of effect is useful for creating effects such as trails, beams,
+		lightning effects, etc.
+	@par
+		A single instance of this class can actually render multiple separate
+		chain segments in a single render operation, provided they all use the
+		same material. To clarify the terminology: a 'segment' is a separate 
+		sub-part of the chain with its own start and end (called the 'head'
+		and the 'tail'. An 'element' is a single position / colour / texcoord
+		entry in a segment. You can add items to the head of a chain, and 
+		remove them from the tail, very efficiently. Each segment has a max
+		size, and if adding an element to the segment would exceed this size, 
+		the tail element is automatically removed and re-used as the new item
+		on the head.
+	@par
+		This class has no auto-updating features to do things like alter the
+		colour of the elements or to automatically add / remove elements over
+		time - you have to do all this yourself as a user of the class. 
+		Subclasses can however be used to provide this kind of behaviour 
+		automatically. @see RibbonTrail
+	*/
+	class _OgreExport BillboardChain : public MovableObject, public Renderable
+	{
+
+	public:
+
+		/** Contains the data of an element of the BillboardChain.
+		*/
+		class _OgreExport Element
+		{
+
+		public:
+
+			Element();
+
+			Element(Vector3 position,
+				Real width,
+				Real texCoord,
+				ColourValue colour);
+
+			Vector3 position;
+			Real width;
+			/// U or V texture coord depending on options
+			Real texCoord;
+			ColourValue colour;
+
+		};
+		typedef std::vector<Element> ElementList;
+
+		/** Constructor (don't use directly, use factory) 
+		@param name The name to give this object
+		@param maxElements The maximum number of elements per chain
+		@param numberOfChains The number of separate chain segments contained in this object
+		@param useTextureCoords If true, use texture coordinates from the chain elements
+		@param useVertexColours If true, use vertex colours from the chain elements
+		@param dynamic If true, buffers are created with the intention of being updated
+		*/
+		BillboardChain(const String& name, size_t maxElements = 20, size_t numberOfChains = 1, 
+			bool useTextureCoords = true, bool useColours = true, bool dynamic = true);
+		/// destructor
+		virtual ~BillboardChain();
+
+		/** Set the maximum number of chain elements per chain 
+		*/
+		virtual void setMaxChainElements(size_t maxElements);
+		/** Get the maximum number of chain elements per chain 
+		*/
+		virtual size_t getMaxChainElements(void) const { return mMaxElementsPerChain; }
+		/** Set the number of chain segments (this class can render multiple chains
+			at once using the same material). 
+		*/
+		virtual void setNumberOfChains(size_t numChains);
+		/** Get the number of chain segments (this class can render multiple chains
+		at once using the same material). 
+		*/
+		virtual size_t getNumberOfChains(void) const { return mChainCount; }
+
+		/** Sets whether texture coordinate information should be included in the
+			final buffers generated.
+		@note You must use either texture coordinates or vertex colour since the
+			vertices have no normals and without one of these there is no source of
+			colour for the vertices.
+		*/
+		virtual void setUseTextureCoords(bool use);
+		/** Gets whether texture coordinate information should be included in the
+			final buffers generated.
+		*/
+		virtual bool getUseTextureCoords(void) const { return mUseTexCoords; }
+
+		/** The direction in which texture coordinates from elements of the
+			chain are used.
+		*/
+		enum TexCoordDirection
+		{
+			/// Tex coord in elements is treated as the 'u' texture coordinate
+			TCD_U,
+			/// Tex coord in elements is treated as the 'v' texture coordinate
+			TCD_V
+		};
+		/** Sets the direction in which texture coords specified on each element
+			are deemed to run along the length of the chain.
+		@param dir The direction, default is TCD_U.
+		*/
+		virtual void setTextureCoordDirection(TexCoordDirection dir);
+		/** Gets the direction in which texture coords specified on each element
+			are deemed to run.
+		*/
+		virtual TexCoordDirection getTextureCoordDirection(void) { return mTexCoordDir; }
+
+		/** Set the range of the texture coordinates generated across the width of
+			the chain elements.
+		@param start Start coordinate, default 0.0
+		@param end End coordinate, default 1.0
+		*/
+		virtual void setOtherTextureCoordRange(Real start, Real end);
+		/** Get the range of the texture coordinates generated across the width of
+			the chain elements.
+		*/
+		virtual const Real* getOtherTextureCoordRange(void) const { return mOtherTexCoordRange; }
+
+		/** Sets whether vertex colour information should be included in the
+			final buffers generated.
+		@note You must use either texture coordinates or vertex colour since the
+			vertices have no normals and without one of these there is no source of
+			colour for the vertices.
+		*/
+		virtual void setUseVertexColours(bool use);
+		/** Gets whether vertex colour information should be included in the
+			final buffers generated.
+		*/
+		virtual bool getUseVertexColours(void) const { return mUseVertexColour; }
+
+		/** Sets whether or not the buffers created for this object are suitable
+			for dynamic alteration.
+		*/
+		virtual void setDynamic(bool dyn);
+
+		/** Gets whether or not the buffers created for this object are suitable
+			for dynamic alteration.
+		*/
+		virtual bool getDynamic(void) const { return mDynamic; }
+		
+		/** Add an element to the 'head' of a chain.
+		@remarks
+			If this causes the number of elements to exceed the maximum elements
+			per chain, the last element in the chain (the 'tail') will be removed
+			to allow the additional element to be added.
+		@param chainIndex The index of the chain
+		@param billboardChainElement The details to add
+		*/
+		virtual void addChainElement(size_t chainIndex, 
+			const Element& billboardChainElement);
+		/** Remove an element from the 'tail' of a chain.
+		@param chainIndex The index of the chain
+		*/
+		virtual void removeChainElement(size_t chainIndex);
+		/** Update the details of an existing chain element.
+		@param chainIndex The index of the chain
+		@param elementIndex The element index within the chain, measured from 
+			the 'head' of the chain
+		@param billboardChainElement The details to set
+		*/
+		virtual void updateChainElement(size_t chainIndex, size_t elementIndex, 
+			const Element& billboardChainElement);
+		/** Get the detail of a chain element.
+		@param chainIndex The index of the chain
+		@param elementIndex The element index within the chain, measured from
+			the 'head' of the chain
+		*/
+		virtual const Element& getChainElement(size_t chainIndex, size_t elementIndex) const;
+
+		/** Remove all elements of a given chain (but leave the chain intact). */
+		virtual void clearChain(size_t chainIndex);
+		/** Remove all elements from all chains (but leave the chains themselves intact). */
+		virtual void clearAllChains(void);
+
+		/// Get the material name in use
+		virtual const String& getMaterialName(void) const { return mMaterialName; }
+		/// Set the material name to use for rendering
+		virtual void setMaterialName(const String& name);
+
+
+		// Overridden members follow
+		void _notifyCurrentCamera(Camera* cam);
+		Real getSquaredViewDepth(const Camera* cam) const;
+		Real getBoundingRadius(void) const;
+		const AxisAlignedBox& getBoundingBox(void) const;
+		const MaterialPtr& getMaterial(void) const;
+		const String& getMovableType(void) const;
+		void _updateRenderQueue(RenderQueue *);
+		void getRenderOperation(RenderOperation &);
+		void getWorldTransforms(Matrix4 *) const;
+		const Quaternion& getWorldOrientation(void) const;
+		const Vector3& getWorldPosition(void) const;
+		const LightList& getLights(void) const;
+
+
+
+	protected:
+
+		/// Maximum length of each chain
+		size_t mMaxElementsPerChain;
+		/// Number of chains
+		size_t mChainCount;
+		/// Use texture coords?
+		bool mUseTexCoords;
+		/// Use vertex colour?
+		bool mUseVertexColour;
+		/// Dynamic use?
+		bool mDynamic;
+		/// Vertex data
+		VertexData* mVertexData;
+		/// Index data (to allow multiple unconnected chains)
+		IndexData* mIndexData;
+		/// Is the vertex declaration dirty?
+		bool mVertexDeclDirty;
+		/// Do the buffers need recreating?
+		bool mBuffersNeedRecreating;
+		/// Do the bounds need redefining?
+		mutable bool mBoundsDirty;
+		/// Is the index buffer dirty?
+		bool mIndexContentDirty;
+		/// AABB
+		mutable AxisAlignedBox mAABB;
+		/// Bounding radius
+		mutable Real mRadius;
+		/// Material 
+		String mMaterialName;
+		MaterialPtr mMaterial;
+		/// Tetxure coord direction
+		TexCoordDirection mTexCoordDir;
+		/// Other texture coord range
+		Real mOtherTexCoordRange[2];
+
+
+		/// The list holding the chain elements
+		ElementList mChainElementList;
+
+		/** Simple struct defining a chain segment by referencing a subset of
+			the preallocated buffer (which will be mMaxElementsPerChain * mChainCount
+			long), by it's chain index, and a head and tail value which describe
+			the current chain. The buffer subset wraps at mMaxElementsPerChain
+			so that head and tail can move freely. head and tail are inclusive,
+			when the chain is empty head and tail are filled with high-values.
+		*/
+		struct ChainSegment
+		{
+			/// The start of this chains subset of the buffer
+			size_t start;
+			/// The 'head' of the chain, relative to start
+			size_t head;
+			/// The 'tail' of the chain, relative to start
+			size_t tail;
+		};
+		typedef std::vector<ChainSegment> ChainSegmentList;
+		ChainSegmentList mChainSegmentList;
+
+		/// Setup the STL collections
+		virtual void setupChainContainers(void);
+		/// Setup vertex declaration
+		virtual void setupVertexDeclaration(void);
+		// Setup buffers
+		virtual void setupBuffers(void);
+		/// Update the contents of the vertex buffer
+		virtual void updateVertexBuffer(Camera* cam);
+		/// Update the contents of the index buffer
+		virtual void updateIndexBuffer(void);
+		virtual void updateBoundingBox(void) const;
+
+		/// Chain segment has no elements
+		static const size_t SEGMENT_EMPTY;
+	};
+
+
+	/** Factory object for creating BillboardChain instances */
+	class _OgreExport BillboardChainFactory : public MovableObjectFactory
+	{
+	protected:
+		MovableObject* createInstanceImpl( const String& name, const NameValuePairList* params);
+	public:
+		BillboardChainFactory() {}
+		~BillboardChainFactory() {}
+
+		static String FACTORY_TYPE_NAME;
+
+		const String& getType(void) const;
+		void destroyInstance( MovableObject* obj);  
+
+	};
+
+
+} // namespace
+
+#endif
+
Index: /OgreMain/include/OgreBillboardParticleRenderer.h
===================================================================
--- /OgreMain/include/OgreBillboardParticleRenderer.h	(revision 5)
+++ /OgreMain/include/OgreBillboardParticleRenderer.h	(revision 5)
@@ -0,0 +1,250 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __BillboardParticleRenderer_H__
+#define __BillboardParticleRenderer_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreParticleSystemRenderer.h"
+#include "OgreBillboardSet.h"
+
+namespace Ogre {
+
+    /** Specialisation of ParticleSystemRenderer to render particles using 
+        a BillboardSet. 
+    @remarks
+        This renderer has a few more options than the standard particle system,
+        which will be passed to it automatically when the particle system itself
+        does not understand them.
+    */
+    class _OgreExport BillboardParticleRenderer : public ParticleSystemRenderer
+    {
+    protected:
+        /// The billboard set that's doing the rendering
+        BillboardSet* mBillboardSet;
+    public:
+        BillboardParticleRenderer();
+        ~BillboardParticleRenderer();
+
+        /** Command object for billboard type (see ParamCommand).*/
+        class _OgrePrivate CmdBillboardType : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for billboard origin (see ParamCommand).*/
+        class _OgrePrivate CmdBillboardOrigin : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for billboard rotation type (see ParamCommand).*/
+        class _OgrePrivate CmdBillboardRotationType : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for common direction (see ParamCommand).*/
+        class _OgrePrivate CmdCommonDirection : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for common up-vector (see ParamCommand).*/
+        class _OgrePrivate CmdCommonUpVector : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for point rendering (see ParamCommand).*/
+        class _OgrePrivate CmdPointRendering : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+		/** Command object for accurate facing(see ParamCommand).*/
+		class _OgrePrivate CmdAccurateFacing : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+
+        /** Sets the type of billboard to render.
+        @remarks
+            The default sort of billboard (BBT_POINT), always has both x and y axes parallel to 
+            the camera's local axes. This is fine for 'point' style billboards (e.g. flares,
+            smoke, anything which is symmetrical about a central point) but does not look good for
+            billboards which have an orientation (e.g. an elongated raindrop). In this case, the
+            oriented billboards are more suitable (BBT_ORIENTED_COMMON or BBT_ORIENTED_SELF) since they retain an independant Y axis
+            and only the X axis is generated, perpendicular to both the local Y and the camera Z.
+        @param bbt The type of billboard to render
+        */
+        void setBillboardType(BillboardType bbt);
+
+        /** Returns the billboard type in use. */
+        BillboardType getBillboardType(void) const;
+
+		/// @copydoc BillboardSet::setUseAccurateFacing
+		void setUseAccurateFacing(bool acc);
+		/// @copydoc BillboardSet::getUseAccurateFacing
+		bool getUseAccurateFacing(void) const;
+
+        /** Sets the point which acts as the origin point for all billboards in this set.
+        @remarks
+        This setting controls the fine tuning of where a billboard appears in relation to it's
+        position. It could be that a billboard's position represents it's center (e.g. for fireballs),
+        it could mean the center of the bottom edge (e.g. a tree which is positioned on the ground),
+        the top-left corner (e.g. a cursor).
+        @par
+        The default setting is BBO_CENTER.
+        @param
+        origin A member of the BillboardOrigin enum specifying the origin for all the billboards in this set.
+        */
+        void setBillboardOrigin(BillboardOrigin origin) { mBillboardSet->setBillboardOrigin(origin); }
+
+        /** Gets the point which acts as the origin point for all billboards in this set.
+        @returns
+        A member of the BillboardOrigin enum specifying the origin for all the billboards in this set.
+        */
+        BillboardOrigin getBillboardOrigin(void) const { return mBillboardSet->getBillboardOrigin(); }
+
+        /** Sets billboard rotation type.
+            @remarks
+                This setting controls the billboard rotation type, you can deciding rotate the billboard's vertices
+                around their facing direction or rotate the billboard's texture coordinates.
+            @par
+                The default settings is BBR_TEXCOORD.
+            @param
+                rotationType A member of the BillboardRotationType enum specifying the rotation type for all the billboards in this set.
+        */
+        void setBillboardRotationType(BillboardRotationType rotationType);
+
+        /** Sets billboard rotation type.
+            @returns
+                A member of the BillboardRotationType enum specifying the rotation type for all the billboards in this set.
+        */
+        BillboardRotationType getBillboardRotationType(void) const;
+
+        /** Use this to specify the common direction given to billboards of type BBT_ORIENTED_COMMON.
+        @remarks
+            Use BBT_ORIENTED_COMMON when you want oriented billboards but you know they are always going to 
+            be oriented the same way (e.g. rain in calm weather). It is faster for the system to calculate
+            the billboard vertices if they have a common direction.
+        @param vec The direction for all billboards.
+        */
+        void setCommonDirection(const Vector3& vec);
+
+        /** Gets the common direction for all billboards (BBT_ORIENTED_COMMON) */
+        const Vector3& getCommonDirection(void) const;
+
+        /** Use this to specify the common up-vector given to billboards of type BBT_PERPENDICULAR_SELF.
+        @remarks
+            Use BBT_PERPENDICULAR_SELF when you want oriented billboards perpendicular to their own
+            direction vector and doesn't face to camera. In this case, we need an additional vector
+            to determine the billboard X, Y axis. The generated X axis perpendicular to both the own
+            direction and up-vector, the Y axis will coplanar with both own direction and up-vector,
+            and perpendicular to own direction.
+        @param vec The up-vector for all billboards.
+        */
+        void setCommonUpVector(const Vector3& vec);
+
+        /** Gets the common up-vector for all billboards (BBT_PERPENDICULAR_SELF) */
+        const Vector3& getCommonUpVector(void) const;
+
+		/// @copydoc BillboardSet::setPointRenderingEnabled
+		void setPointRenderingEnabled(bool enabled);
+
+		/// @copydoc BillboardSet::isPointRenderingEnabled
+		bool isPointRenderingEnabled(void) const;
+
+
+
+        /// @copydoc ParticleSystemRenderer::getType
+        const String& getType(void) const;
+        /// @copydoc ParticleSystemRenderer::_updateRenderQueue
+        void _updateRenderQueue(RenderQueue* queue, 
+            std::list<Particle*>& currentParticles, bool cullIndividually);
+        /// @copydoc ParticleSystemRenderer::_setMaterial
+        void _setMaterial(MaterialPtr& mat);
+        /// @copydoc ParticleSystemRenderer::_notifyCurrentCamera
+        void _notifyCurrentCamera(Camera* cam);
+        /// @copydoc ParticleSystemRenderer::_notifyParticleRotated
+        void _notifyParticleRotated(void);
+        /// @copydoc ParticleSystemRenderer::_notifyParticleResized
+        void _notifyParticleResized(void);
+        /// @copydoc ParticleSystemRenderer::_notifyParticleQuota
+        void _notifyParticleQuota(size_t quota);
+        /// @copydoc ParticleSystemRenderer::_notifyAttached
+        void _notifyAttached(Node* parent, bool isTagPoint = false);
+        /// @copydoc ParticleSystemRenderer::_notifyDefaultDimensions
+        void _notifyDefaultDimensions(Real width, Real height);
+		/// @copydoc ParticleSystemRenderer::setRenderQueueGroup
+		void setRenderQueueGroup(uint8 queueID);
+		/// @copydoc ParticleSystemRenderer::setKeepParticlesInLocalSpace
+		void setKeepParticlesInLocalSpace(bool keepLocal);
+        /// @copydoc ParticleSystemRenderer::_getSortMode
+        SortMode _getSortMode(void) const;
+
+		/// Access BillboardSet in use
+		BillboardSet* getBillboardSet(void) const { return mBillboardSet; }
+
+    protected:
+        static CmdBillboardType msBillboardTypeCmd;
+        static CmdBillboardOrigin msBillboardOriginCmd;
+        static CmdBillboardRotationType msBillboardRotationTypeCmd;
+        static CmdCommonDirection msCommonDirectionCmd;
+        static CmdCommonUpVector msCommonUpVectorCmd;
+        static CmdPointRendering msPointRenderingCmd;
+		static CmdAccurateFacing msAccurateFacingCmd;
+
+
+    };
+
+    /** Factory class for BillboardParticleRenderer */
+    class _OgreExport BillboardParticleRendererFactory : public ParticleSystemRendererFactory
+    {
+    public:
+        /// @copydoc FactoryObj::getType
+        const String& getType() const;
+        /// @copydoc FactoryObj::createInstance
+        ParticleSystemRenderer* createInstance( const String& name );    
+        /// @copydoc FactoryObj::destroyInstance
+        void destroyInstance( ParticleSystemRenderer* inst);    
+    };
+
+}
+
+#endif
+
Index: /OgreMain/include/OgreBillboardSet.h
===================================================================
--- /OgreMain/include/OgreBillboardSet.h	(revision 5)
+++ /OgreMain/include/OgreBillboardSet.h	(revision 5)
@@ -0,0 +1,841 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __BillboardSet_H__
+#define __BillboardSet_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreMovableObject.h"
+#include "OgreRenderable.h"
+#include "OgreRadixSort.h"
+#include "OgreCommon.h"
+
+namespace Ogre {
+
+    /** Enum covering what exactly a billboard's position means (center,
+        top-left etc).
+        @see
+            BillboardSet::setBillboardOrigin
+    */
+    enum BillboardOrigin
+    {
+        BBO_TOP_LEFT,
+        BBO_TOP_CENTER,
+        BBO_TOP_RIGHT,
+        BBO_CENTER_LEFT,
+        BBO_CENTER,
+        BBO_CENTER_RIGHT,
+        BBO_BOTTOM_LEFT,
+        BBO_BOTTOM_CENTER,
+        BBO_BOTTOM_RIGHT
+    };
+    /** The rotation type of billboard. */
+    enum BillboardRotationType
+    {
+        /// Rotate the billboard's vertices around their facing direction
+        BBR_VERTEX,
+        /// Rotate the billboard's texture coordinates
+        BBR_TEXCOORD
+    };
+    /** The type of billboard to use. */
+    enum BillboardType
+    {
+        /// Standard point billboard (default), always faces the camera completely and is always upright
+        BBT_POINT,
+        /// Billboards are oriented around a shared direction vector (used as Y axis) and only rotate around this to face the camera
+        BBT_ORIENTED_COMMON,
+        /// Billboards are oriented around their own direction vector (their own Y axis) and only rotate around this to face the camera
+        BBT_ORIENTED_SELF,
+        /// Billboards are perpendicular to a shared direction vector (used as Z axis, the facing direction) and X, Y axis are determined by a shared up-vertor
+        BBT_PERPENDICULAR_COMMON,
+        /// Billboards are perpendicular to their own direction vector (their own Z axis, the facing direction) and X, Y axis are determined by a shared up-vertor
+        BBT_PERPENDICULAR_SELF
+    };
+
+    /** A collection of billboards (faces which are always facing the given direction) with the same (default) dimensions, material
+        and which are fairly close proximity to each other.
+        @remarks
+            Billboards are rectangles made up of 2 tris which are always facing the given direction. They are typically used
+            for special effects like particles. This class collects together a set of billboards with the same (default) dimensions,
+            material and relative locality in order to process them more efficiently. The entire set of billboards will be
+            culled as a whole (by default, although this can be changed if you want a large set of billboards
+            which are spread out and you want them culled individually), individual Billboards have locations which are relative to the set (which itself derives it's
+            position from the SceneNode it is attached to since it is a MoveableObject), they will be rendered as a single rendering operation,
+            and some calculations will be sped up by the fact that they use the same dimensions so some workings can be reused.
+        @par
+            A BillboardSet can be created using the SceneManager::createBillboardSet method. They can also be used internally
+            by other classes to create effects.
+		@note
+			Billboard bounds are only automatically calculated when you create them.
+			If you modify the position of a billboard you may need to call 
+			_updateBounds if the billboard moves outside the original bounds. 
+			Similarly, the bounds do no shrink when you remove a billboard, 
+			if you want them to call _updateBounds, but note this requires a
+			potentially expensive examination of every billboard in the set.
+    */
+    class _OgreExport BillboardSet : public MovableObject, public Renderable
+    {
+    protected:
+        /** Private constructor (instances cannot be created directly).
+        */
+        BillboardSet();
+
+        /// Bounds of all billboards in this set
+        AxisAlignedBox mAABB;
+		/// Bounding radius
+		Real mBoundingRadius;
+
+        /// Origin of each billboard
+        BillboardOrigin mOriginType;
+        /// Rotation type of each billboard
+        BillboardRotationType mRotationType;
+
+        /// Default width of each billboard
+        Real mDefaultWidth;
+        /// Default height of each billboard
+        Real mDefaultHeight;
+
+        /// Name of the material to use
+        String mMaterialName;
+        /// Pointer to the material to use
+        MaterialPtr mpMaterial;
+
+        /// True if no billboards in this set have been resized - greater efficiency.
+        bool mAllDefaultSize;
+
+        /// Flag indicating whether to autoextend pool
+        bool mAutoExtendPool;
+
+		/// Flag indicating whether the billboards has to be sorted
+		bool mSortingEnabled;
+
+        // Use 'true' billboard to cam position facing, rather than camera direcion
+        bool mAccurateFacing;
+
+        bool mAllDefaultRotation;
+        bool mWorldSpace;
+
+        typedef std::list<Billboard*> ActiveBillboardList;
+        typedef std::list<Billboard*> FreeBillboardList;
+        typedef std::vector<Billboard*> BillboardPool;
+
+        /** Active billboard list.
+            @remarks
+                This is a linked list of pointers to billboards in the billboard pool.
+            @par
+                This allows very fast instertions and deletions from anywhere in the list to activate / deactivate billboards
+                (required for particle systems etc)    as well as resuse of Billboard instances in the pool
+                without construction & destruction which avoids memory thrashing.
+        */
+        ActiveBillboardList mActiveBillboards;
+
+        /** Free billboard queue.
+            @remarks
+                This contains a list of the billboards free for use as new instances
+                as required by the set. Billboard instances are preconstructed up to the estimated size in the
+                mBillboardPool vector and are referenced on this deque at startup. As they get used this deque
+                reduces, as they get released back to to the set they get added back to the deque.
+        */
+        FreeBillboardList mFreeBillboards;
+
+        /** Pool of billboard instances for use and reuse in the active billboard list.
+            @remarks
+                This vector will be preallocated with the estimated size of the set,and will extend as required.
+        */
+        BillboardPool mBillboardPool;
+
+        /// The vertex position data for all billboards in this set.
+        VertexData* mVertexData;
+        /// Shortcut to main buffer (positions, colours, texture coords)
+        HardwareVertexBufferSharedPtr mMainBuf;
+        /// Locked pointer to buffer
+        float* mLockPtr;
+        /// Boundary offsets based on origin and camera orientation
+        /// Vector3 vLeftOff, vRightOff, vTopOff, vBottomOff;
+        /// Final vertex offsets, used where sizes all default to save calcs
+        Vector3 mVOffset[4];
+        /// Current camera
+        Camera* mCurrentCamera;
+        // Parametric offsets of origin
+        Real mLeftOff, mRightOff, mTopOff, mBottomOff;
+        // Camera axes in billboard space
+        Vector3 mCamX, mCamY;
+        // Camera direction in billboard space
+        Vector3 mCamDir;
+        // Camera orientation in billboard space
+        Quaternion mCamQ;
+        // Camera position in billboard space
+        Vector3 mCamPos;
+
+        /// The vertex index data for all billboards in this set (1 set only)
+        //unsigned short* mpIndexes;
+        IndexData* mIndexData;
+
+        /// Flag indicating whether each billboard should be culled separately (default: false)
+        bool mCullIndividual;
+
+        typedef std::vector< Ogre::FloatRect > TextureCoordSets;
+        TextureCoordSets mTextureCoords;
+
+        /// The type of billboard to render
+        BillboardType mBillboardType;
+
+        /// Common direction for billboards of type BBT_ORIENTED_COMMON and BBT_PERPENDICULAR_COMMON
+        Vector3 mCommonDirection;
+        /// Common up-vector for billboards of type BBT_PERPENDICULAR_SELF and BBT_PERPENDICULAR_COMMON
+        Vector3 mCommonUpVector;
+
+        /// Internal method for culling individual billboards
+        inline bool billboardVisible(Camera* cam, const Billboard& bill);
+
+        // Number of visible billboards (will be == getNumBillboards if mCullIndividual == false)
+        unsigned short mNumVisibleBillboards;
+
+        /// Internal method for increasing pool size
+        virtual void increasePool(size_t size);
+
+
+        //-----------------------------------------------------------------------
+        // The internal methods which follow are here to allow maximum flexibility as to 
+        //  when various components of the calculation are done. Depending on whether the
+        //  billboards are of fixed size and whether they are point or oriented type will
+        //  determine how much calculation has to be done per-billboard. NOT a one-size fits all approach.
+        //-----------------------------------------------------------------------
+        /** Internal method for generating billboard corners. 
+        @remarks
+            Optional parameter pBill is only present for type BBT_ORIENTED_SELF and BBT_PERPENDICULAR_SELF
+        */
+        void genBillboardAxes(Vector3* pX, Vector3 *pY, const Billboard* pBill = 0);
+
+        /** Internal method, generates parametric offsets based on origin.
+        */
+        void getParametricOffsets(Real& left, Real& right, Real& top, Real& bottom);
+
+        /** Internal method for generating vertex data. 
+        @param offsets Array of 4 Vector3 offsets
+        @param bb Referenceto billboard
+        */
+        void genVertices(const Vector3* const offsets, const Billboard& pBillboard);
+
+        /** Internal method generates vertex offsets.
+        @remarks
+            Takes in parametric offsets as generated from getParametericOffsets, width and height values
+            and billboard x and y axes as generated from genBillboardAxes. 
+            Fills output array of 4 vectors with vector offsets
+            from origin for left-top, right-top, left-bottom, right-bottom corners.
+        */
+        void genVertOffsets(Real inleft, Real inright, Real intop, Real inbottom,
+            Real width, Real height,
+            const Vector3& x, const Vector3& y, Vector3* pDestVec);
+
+
+        /** Sort by direction functor */
+        struct SortByDirectionFunctor
+        {
+            /// Direction to sort in
+            Vector3 sortDir;
+
+            SortByDirectionFunctor(const Vector3& dir);
+            float operator()(Billboard* bill) const;
+        };
+
+        /** Sort by distance functor */
+        struct SortByDistanceFunctor
+        {
+            /// Position to sort in
+            Vector3 sortPos;
+
+            SortByDistanceFunctor(const Vector3& pos);
+            float operator()(Billboard* bill) const;
+        };
+
+		static RadixSort<ActiveBillboardList, Billboard*, float> mRadixSorter;
+
+		/// Use point rendering?
+		bool mPointRendering;
+
+
+
+    private:
+        /// Flag indicating whether the HW buffers have been created.
+        bool mBuffersCreated;
+        /// The number of billboard in the pool.
+        size_t mPoolSize;
+        /// Is external billboard data in use?
+        bool mExternalData;
+
+        /** Internal method creates vertex and index buffers.
+        */
+        void _createBuffers(void);
+        /** Internal method destroys vertex and index buffers.
+        */
+        void _destroyBuffers(void);
+
+    public:
+
+        /** Usual constructor - this is called by the SceneManager.
+            @param
+                name The name to give the billboard set (must be unique)
+            @param
+                poolSize The initial size of the billboard pool. Estimate of the number of billboards
+                which will be required, and pass it using this parameter. The set will
+                preallocate this number to avoid memory fragmentation. The default behaviour
+                once this pool has run out is to double it.
+            @param
+                externalDataSource If true, the source of data for drawing the 
+                billboards will not be the internal billboard list, but external 
+                data. When driving thebillboard from external data, you must call
+                _notifyCurrentCamera to reorient the billboards, setPoolSize to set
+                the maximum billboards you want to use, beginBillboards to 
+                start the update, and injectBillboard per billboard, 
+                followed by endBillboards.
+            @see
+                BillboardSet::setAutoextend
+        */
+        BillboardSet( const String& name, unsigned int poolSize = 20, 
+            bool externalDataSource = false);
+
+        virtual ~BillboardSet();
+
+        /** Creates a new billboard and adds it to this set.
+            @remarks
+                Behaviour once the billboard pool has been exhausted depends on the
+                BillboardSet::setAutoextendPool option.
+            @param
+                position The position of the new billboard realtive to the certer of the set
+            @param
+                colour Optional base colour of the billboard.
+            @returns
+                On success, a pointer to a newly created Billboard is
+                returned.
+            @par
+                On failiure (i.e. no more space and can't autoextend),
+                <b>NULL</b> is returned.
+            @see
+                BillboardSet::setAutoextend
+        */
+        Billboard* createBillboard(
+            const Vector3& position,
+            const ColourValue& colour = ColourValue::White );
+
+        /** Creates a new billboard and adds it to this set.
+            @remarks
+                Behaviour once the billboard pool has been exhausted depends on the
+                BillboardSet::setAutoextendPool option.
+            @param
+                x
+            @param
+                y
+            @param
+                z The position of the new billboard realtive to the certer of the set
+            @param
+                colour Optional base colour of the billboard.
+            @returns
+                On success, a pointer to a newly created Billboard is
+                returned.
+            @par
+                On failiure (i.e. no more space and can't autoextend),
+                <b>NULL</b> is returned.
+            @see
+                BillboardSet::setAutoextend
+        */
+        Billboard* createBillboard(
+            Real x, Real y, Real z,
+            const ColourValue& colour = ColourValue::White );
+
+        /** Returns the number of active billboards which currently make up this set.
+        */
+        virtual int getNumBillboards(void) const;
+
+        /** Tells the set whether to allow automatic extension of the pool of billboards.
+            @remarks
+                A BillboardSet stores a pool of pre-constructed billboards which are used as needed when
+                a new billboard is requested. This allows applications to create / remove billboards efficiently
+                without incurring construction / destruction costs (a must for sets with lots of billboards like
+                particle effects). This method allows you to configure the behaviour when a new billboard is requested
+                but the billboard pool has been exhausted.
+            @par
+                The default behaviour is to allow the pool to extend (typically this allocates double the current
+                pool of billboards when the pool is expended), equivalent to calling this method with
+                autoExtend = true. If you set the parameter to false however, any attempt to create a new billboard
+                when the pool has expired will simply fail silently, returning a null pointer.
+            @param autoextend true to double the pool every time it runs out, false to fail silently.
+        */
+        virtual void setAutoextend(bool autoextend);
+
+        /** Returns true if the billboard pool automatically extends.
+            @see
+                BillboardSet::setAutoextend
+        */
+        virtual bool getAutoextend(void) const;
+
+		/** Enables sorting for this BillboardSet. (default: off)
+			@param sortenable true to sort the billboards according to their distance to the camera
+		*/
+		virtual void setSortingEnabled(bool sortenable);
+
+		/** Returns true if sorting of billboards is enabled based on their distance from the camera
+		    @see
+				BillboardSet::setSortingEnabled
+		*/
+		virtual bool getSortingEnabled(void) const;
+
+        /** Adjusts the size of the pool of billboards available in this set.
+            @remarks
+                See the BillboardSet::setAutoextend method for full details of the billboard pool. This method adjusts
+                the preallocated size of the pool. If you try to reduce the size of the pool, the set has the option
+                of ignoring you if too many billboards are already in use. Bear in mind that calling this method will
+                incur significant construction / destruction calls so should be avoided in time-critical code. The same
+                goes for auto-extension, try to avoid it by estimating the pool size correctly up-front.
+            @param
+                size The new size for the pool.
+        */
+        virtual void setPoolSize(size_t size);
+
+        /** Returns the current size of the billboard pool.
+            @returns
+                The current size of the billboard pool.
+            @see
+                BillboardSet::setAutoextend
+        */
+        virtual unsigned int getPoolSize(void) const;
+
+
+        /** Empties this set of all billboards.
+        */
+        virtual void clear();
+
+        /** Returns a pointer to the billboard at the supplied index.
+            @note
+                This method requires linear time since the billboard list is a linked list.
+            @param
+                index The index of the billboard that is requested.
+            @returns
+                On success, a valid pointer to the requested billboard is
+                returned.
+            @par
+                On failiure, <b>NULL</b> is returned.
+        */
+        virtual Billboard* getBillboard(unsigned int index) const;
+
+        /** Removes the billboard at the supplied index.
+            @note
+                This method requires linear time since the billboard list is a linked list.
+        */
+        virtual void removeBillboard(unsigned int index);
+
+        /** Removes a billboard from the set.
+            @note
+                This version is more efficient than removing by index.
+        */
+        virtual void removeBillboard(Billboard* pBill);
+
+        /** Sets the point which acts as the origin point for all billboards in this set.
+            @remarks
+                This setting controls the fine tuning of where a billboard appears in relation to it's
+                position. It could be that a billboard's position represents it's center (e.g. for fireballs),
+                it could mean the center of the bottom edge (e.g. a tree which is positioned on the ground),
+                the top-left corner (e.g. a cursor).
+            @par
+                The default setting is BBO_CENTER.
+            @param
+                origin A member of the BillboardOrigin enum specifying the origin for all the billboards in this set.
+        */
+        virtual void setBillboardOrigin(BillboardOrigin origin);
+
+        /** Gets the point which acts as the origin point for all billboards in this set.
+            @returns
+                A member of the BillboardOrigin enum specifying the origin for all the billboards in this set.
+        */
+        virtual BillboardOrigin getBillboardOrigin(void) const;
+
+        /** Sets billboard rotation type.
+            @remarks
+                This setting controls the billboard rotation type, you can deciding rotate the billboard's vertices
+                around their facing direction or rotate the billboard's texture coordinates.
+            @par
+                The default settings is BBR_TEXCOORD.
+            @param
+                rotationType A member of the BillboardRotationType enum specifying the rotation type for all the billboards in this set.
+        */
+        virtual void setBillboardRotationType(BillboardRotationType rotationType);
+
+        /** Sets billboard rotation type.
+            @returns
+                A member of the BillboardRotationType enum specifying the rotation type for all the billboards in this set.
+        */
+        virtual BillboardRotationType getBillboardRotationType(void) const;
+
+        /** Sets the default dimensions of the billboards in this set.
+            @remarks
+                All billboards in a set are created with these default dimensions. The set will render most efficiently if
+                all the billboards in the set are the default size. It is possible to alter the size of individual
+                billboards at the expense of extra calculation. See the Billboard class for more info.
+            @param width
+                The new default width for the billboards in this set.
+            @param height
+                The new default height for the billboards in this set.
+        */
+        virtual void setDefaultDimensions(Real width, Real height);
+
+        /** See setDefaultDimensions - this sets 1 component individually. */
+        virtual void setDefaultWidth(Real width);
+        /** See setDefaultDimensions - this gets 1 component individually. */
+        virtual Real getDefaultWidth(void) const;
+        /** See setDefaultDimensions - this sets 1 component individually. */
+        virtual void setDefaultHeight(Real height);
+        /** See setDefaultDimensions - this gets 1 component individually. */
+        virtual Real getDefaultHeight(void) const;
+
+        /** Sets the name of the material to be used for this billboard set.
+            @param
+                name The new name of the material to use for this set.
+        */
+        virtual void setMaterialName(const String& name);
+
+        /** Sets the name of the material to be used for this billboard set.
+            @returns The name of the material that is used for this set.
+        */
+        virtual const String& getMaterialName(void) const;
+
+        /** Overridden from MovableObject
+            @see
+                MovableObject
+        */
+        virtual void _notifyCurrentCamera(Camera* cam);
+
+        /** Begin injection of billboard data; applicable when 
+            constructing the BillboardSet for external data use.
+		@param numBillboards If you know the number of billboards you will be 
+			issuing, state it here to make the update more efficient.
+        */
+        void beginBillboards(size_t numBillboards = 0);
+        /** Define a billboard. */
+        void injectBillboard(const Billboard& bb);
+        /** Finish defining billboards. */
+        void endBillboards(void);
+		/** Set the bounds of the BillboardSet.
+		@remarks
+			You may need to call this if you're injecting billboards manually, 
+			and you're relying on the BillboardSet to determine culling.
+		*/
+		void setBounds(const AxisAlignedBox& box, Real radius);
+
+
+        /** Overridden from MovableObject
+            @see
+                MovableObject
+        */
+        virtual const AxisAlignedBox& getBoundingBox(void) const;
+
+        /** Overridden from MovableObject
+            @see
+                MovableObject
+        */
+        virtual Real getBoundingRadius(void) const;
+        /** Overridden from MovableObject
+            @see
+                MovableObject
+        */
+        virtual void _updateRenderQueue(RenderQueue* queue);
+
+        /** Overridden from MovableObject
+            @see
+                MovableObject
+        */
+        virtual const MaterialPtr& getMaterial(void) const;
+
+        /** Overridden from MovableObject
+            @see
+                MovableObject
+        */
+        virtual void getRenderOperation(RenderOperation& op);
+
+        /** Overridden from MovableObject
+            @see
+                MovableObject
+        */
+        virtual void getWorldTransforms(Matrix4* xform) const;
+
+        /** @copydoc Renderable::getWorldOrientation */
+        const Quaternion& getWorldOrientation(void) const;
+        /** @copydoc Renderable::getWorldPosition */
+        const Vector3& getWorldPosition(void) const;
+        /** Internal callback used by Billboards to notify their parent that they have been resized.
+        */
+        virtual void _notifyBillboardResized(void);
+
+        /** Internal callback used by Billboards to notify their parent that they have been rotated..
+        */
+        virtual void _notifyBillboardRotated(void);
+
+        /** Returns whether or not billbards in this are tested individually for culling. */
+        virtual bool getCullIndividually(void) const;
+        /** Sets whether culling tests billboards in this individually as well as in a group.
+        @remarks
+            Billboard sets are always culled as a whole group, based on a bounding box which 
+            encloses all billboards in the set. For fairly localised sets, this is enough. However, you
+            can optionally tell the set to also cull individual billboards in the set, i.e. to test
+            each individual billboard before rendering. The default is not to do this.
+        @par
+            This is useful when you have a large, fairly distributed set of billboards, like maybe 
+            trees on a landscape. You probably still want to group them into more than one
+            set (maybe one set per section of landscape), which will be culled coarsely, but you also
+            want to cull the billboards individually because they are spread out. Whilst you could have
+            lots of single-tree sets which are culled separately, this would be inefficient to render
+            because each tree would be issued as it's own rendering operation.
+        @par
+            By calling this method with a parameter of true, you can have large billboard sets which 
+            are spaced out and so get the benefit of batch rendering and coarse culling, but also have
+            fine-grained culling so unnecessary rendering is avoided.
+        @param cullIndividual If true, each billboard is tested before being sent to the pipeline as well 
+            as the whole set having to pass the coarse group bounding test.
+        */
+        virtual void setCullIndividually(bool cullIndividual);
+
+        /** Sets the type of billboard to render.
+        @remarks
+            The default sort of billboard (BBT_POINT), always has both x and y axes parallel to 
+            the camera's local axes. This is fine for 'point' style billboards (e.g. flares,
+            smoke, anything which is symmetrical about a central point) but does not look good for
+            billboards which have an orientation (e.g. an elongated raindrop). In this case, the
+            oriented billboards are more suitable (BBT_ORIENTED_COMMON or BBT_ORIENTED_SELF) since
+            they retain an independant Y axis and only the X axis is generated, perpendicular to both
+            the local Y and the camera Z.
+        @par
+            In some case you might want the billboard has fixed Z axis and doesn't need to face to
+            camera (e.g. an aureola around the player and parallel to the ground). You can use
+            BBT_PERPENDICULAR_SELF which the billboard plane perpendicular to the billboard own
+            direction. Or BBT_PERPENDICULAR_COMMON which the billboard plane perpendicular to the
+            common direction.
+        @note
+            BBT_PERPENDICULAR_SELF and BBT_PERPENDICULAR_COMMON can't guarantee counterclockwise, you might
+            use double-side material (<b>cull_hardware node</b>) to ensure no billboard are culled.
+        @param bbt The type of billboard to render
+        */
+        virtual void setBillboardType(BillboardType bbt);
+
+        /** Returns the billboard type in use. */
+        virtual BillboardType getBillboardType(void) const;
+
+        /** Use this to specify the common direction given to billboards of type BBT_ORIENTED_COMMON or BBT_PERPENDICULAR_COMMON.
+        @remarks
+            Use BBT_ORIENTED_COMMON when you want oriented billboards but you know they are always going to 
+            be oriented the same way (e.g. rain in calm weather). It is faster for the system to calculate
+            the billboard vertices if they have a common direction.
+        @par
+            The common direction also use in BBT_PERPENDICULAR_COMMON, in this case the common direction
+            treat as Z axis, and an additional common up-vector was use to determine billboard X and Y
+            axis.
+            @see setCommonUpVector
+        @param vec The direction for all billboards.
+        @note
+            The direction are use as is, never normalised in internal, user are supposed to normalise it himself.
+        */
+        virtual void setCommonDirection(const Vector3& vec);
+
+        /** Gets the common direction for all billboards (BBT_ORIENTED_COMMON) */
+        virtual const Vector3& getCommonDirection(void) const;
+
+        /** Use this to specify the common up-vector given to billboards of type BBT_PERPENDICULAR_SELF or BBT_PERPENDICULAR_COMMON.
+        @remarks
+            Use BBT_PERPENDICULAR_SELF or BBT_PERPENDICULAR_COMMON when you want oriented billboards
+            perpendicular to specify direction vector (or, Z axis), and doesn't face to camera.
+            In this case, we need an additional up-vector to determine the billboard X and Y axis.
+            The generated billboard plane and X-axis guarantee perpendicular to specify direction.
+            @see setCommonDirection
+        @par
+            The specify direction is billboard own direction when billboard type is BBT_PERPENDICULAR_SELF,
+            and it's shared common direction when billboard type is BBT_PERPENDICULAR_COMMON.
+        @param vec The up-vector for all billboards.
+        @note
+            The up-vector are use as is, never normalised in internal, user are supposed to normalise it himself.
+        */
+        virtual void setCommonUpVector(const Vector3& vec);
+
+        /** Gets the common up-vector for all billboards (BBT_PERPENDICULAR_SELF and BBT_PERPENDICULAR_COMMON) */
+        virtual const Vector3& getCommonUpVector(void) const;
+        
+        /** Sets whether or not billboards should use an 'accurate' facing model
+            based on the vector from each billboard to the camera, rather than 
+            an optimised version using just the camera direction.
+        @remarks
+            By default, the axes for all billboards are calulated using the 
+            camera's view direction, not the vector from the camera position to
+            the billboard. The former is faster, and most of the time the difference
+            is not noticeable. However for some purposes (e.g. very large, static
+            billboards) the changing billboard orientation when rotating the camera
+            can be off putting, therefore you can enable this option to use a
+            more expensive, but more accurate version.
+        @param acc True to use the slower but more accurate model. Default is false.
+        */
+        virtual void setUseAccurateFacing(bool acc) { mAccurateFacing = acc; }
+        /** Gets whether or not billboards use an 'accurate' facing model
+            based on the vector from each billboard to the camera, rather than 
+            an optimised version using just the camera direction.
+        */
+        virtual bool getUseAccurateFacing(void) const { return mAccurateFacing; }
+
+        /** Overridden from MovableObject */
+        virtual const String& getMovableType(void) const;
+
+        /** Overridden, see Renderable */
+        Real getSquaredViewDepth(const Camera* cam) const;
+
+        /** Update the bounds of the billboardset */
+        virtual void _updateBounds(void);
+        /** @copydoc Renderable::getLights */
+        const LightList& getLights(void) const;
+
+        /** Sort the billboard set. Only called when enabled via setSortingEnabled */
+		virtual void _sortBillboards( Camera* cam);
+
+        /** Gets the sort mode of this billboard set */
+        virtual SortMode _getSortMode(void) const;
+
+        /** Sets whether billboards should be treated as being in world space. 
+        @remarks
+            This is most useful when you are driving the billboard set from 
+            an external data source.
+        */
+        virtual void setBillboardsInWorldSpace(bool ws) { mWorldSpace = ws; }
+
+        /** BillboardSet can use custom texture coordinates for various billboards. 
+            This is useful for selecting one of many particle images out of a tiled 
+            texture sheet, or doing flipbook animation within a single texture.
+          @par
+            The generic functionality is setTextureCoords(), which will copy the 
+            texture coordinate rects you supply into internal storage for the 
+            billboard set. If your texture sheet is a square grid, you can also 
+            use setTextureStacksAndSlices() for more convenience, which will construct 
+            the set of texture coordinates for you.
+          @par
+            When a Billboard is created, it can be assigned a texture coordinate 
+            set from within the sets you specify (that set can also be re-specified 
+            later). When drawn, the billboard will use those texture coordinates, 
+            rather than the full 0-1 range.
+          @par
+          @param coords is a vector of texture coordinates (in UV space) to choose 
+            from for each billboard created in the set.
+          @param numCoords is how many such coordinate rectangles there are to 
+            choose from.
+          @remarks
+            Set 'coords' to 0 and/or 'numCoords' to 0 to reset the texture coord 
+            rects to the initial set of a single rectangle spanning 0 through 1 in 
+            both U and V (i e, the entire texture).
+          @see
+            BillboardSet::setTextureStacksAndSlices()
+            Billboard::setTexcoordIndex()
+          */
+        virtual void setTextureCoords( Ogre::FloatRect const * coords, uint16 numCoords );
+
+        /** setTextureStacksAndSlices() will generate texture coordinate rects as if the 
+            texture for the billboard set contained 'stacks' rows of 'slices' 
+            images each, all equal size. Thus, if the texture size is 512x512 
+            and 'stacks' is 4 and 'slices' is 8, each sub-rectangle of the texture 
+            would be 128 texels tall and 64 texels wide.
+          @remarks
+            This function is short-hand for creating a regular set and calling 
+            setTextureCoords() yourself. The numbering used for Billboard::setTexcoordIndex() 
+            counts first across, then down, so top-left is 0, the one to the right 
+            of that is 1, and the lower-right is stacks*slices-1.
+          @see
+            BillboardSet::setTextureCoords()
+          */
+        virtual void setTextureStacksAndSlices( uchar stacks, uchar slices );
+
+        /** getTextureCoords() returns the current texture coordinate rects in 
+            effect. By default, there is only one texture coordinate rect in the 
+            set, spanning the entire texture from 0 through 1 in each direction.
+          @see
+            BillboardSet::setTextureCoords()
+          */
+        virtual Ogre::FloatRect const * getTextureCoords( uint16 * oNumCoords );
+
+		/** Set whether or not the BillboardSet will use point rendering
+			rather than manually generated quads.
+		@remarks
+			By default a billboardset is rendered by generating geometry for a
+			textured quad in memory, taking into account the size and 
+			orientation settings, and uploading it to the video card. 
+			The alternative is to use hardware point rendering, which means that
+			only one position needs to be sent per billboard rather than 4 and
+			the hardware sorts out how this is rendered based on the render
+			state.
+		@par
+			Using point rendering is faster than generating quads manually, but
+			is more restrictive. The following restrictions apply:
+			\li Only the BBT_POINT type is supported
+			\li Size and appearance of each billboard is controlled by the 
+				material (Pass::setPointSize, Pass::setPointSizeAttenuation, 
+				Pass::setPointSpritesEnabled)
+			\li Per-billboard size is not supported (stems from the above)
+			\li Per-billboard rotation is not supported, this can only be 
+				controlled through texture unit rotation
+			\li Only BBO_CENTER origin is supported
+			\li Per-billboard texture coordinates are not supported
+
+		@par
+			You will almost certainly want to enable in your material pass
+			both point attenuation and point sprites if you use this option. 
+		@param enabled True to enable point rendering, false otherwise
+		*/
+		virtual void setPointRenderingEnabled(bool enabled);
+
+		/** Returns whether point rendering is enabled. */
+		virtual bool isPointRenderingEnabled(void) const
+		{ return mPointRendering; }
+		
+		/// Override to return specific type flag
+		uint32 getTypeFlags(void) const;
+
+    };
+
+	/** Factory object for creating BillboardSet instances */
+	class _OgreExport BillboardSetFactory : public MovableObjectFactory
+	{
+	protected:
+		MovableObject* createInstanceImpl( const String& name, const NameValuePairList* params);
+	public:
+		BillboardSetFactory() {}
+		~BillboardSetFactory() {}
+
+		static String FACTORY_TYPE_NAME;
+
+		const String& getType(void) const;
+		void destroyInstance( MovableObject* obj);  
+
+	};
+
+
+}
+
+
+#endif
Index: /OgreMain/include/OgreBitwise.h
===================================================================
--- /OgreMain/include/OgreBitwise.h	(revision 5)
+++ /OgreMain/include/OgreBitwise.h	(revision 5)
@@ -0,0 +1,323 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _Bitwise_H__
+#define _Bitwise_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+    /** Class for manipulating bit patterns.
+    */
+    class Bitwise {
+    public:
+        /** Returns the most significant bit set in a value.
+        */
+        static FORCEINLINE unsigned int mostSignificantBitSet(unsigned int value)
+        {
+            unsigned int result = 0;
+            while (value != 0) {
+                ++result;
+                value >>= 1;
+            }
+            return result-1;
+        }
+        /** Returns the closest power-of-two number greater or equal to value.
+            @note 0 and 1 are powers of two, so 
+                firstPO2From(0)==0 and firstPO2From(1)==1.
+        */
+        static FORCEINLINE uint32 firstPO2From(uint32 n)
+        {
+            --n;            
+            n |= n >> 16;
+            n |= n >> 8;
+            n |= n >> 4;
+            n |= n >> 2;
+            n |= n >> 1;
+            ++n;
+            return n;
+        }
+        /** Determines whether the number is power-of-two or not.
+            @note 0 and 1 are tread as power of two.
+        */
+        template<typename T>
+        static FORCEINLINE bool isPO2(T n)
+        {
+            return (n & (n-1)) == 0;
+        }
+        /** Returns the number of bits a pattern must be shifted right by to
+            remove right-hand zeroes.
+        */
+		template<typename T>
+        static FORCEINLINE unsigned int getBitShift(T mask)
+		{
+			if (mask == 0)
+				return 0;
+
+			unsigned int result = 0;
+			while ((mask & 1) == 0) {
+				++result;
+				mask >>= 1;
+			}
+			return result;
+		}
+
+        /** Takes a value with a given src bit mask, and produces another
+            value with a desired bit mask.
+            @remarks
+                This routine is useful for colour conversion.
+        */
+		template<typename SrcT, typename DestT>
+        static inline DestT convertBitPattern(SrcT srcValue, SrcT srcBitMask, DestT destBitMask)
+		{
+			// Mask off irrelevant source value bits (if any)
+			srcValue = srcValue & srcBitMask;
+
+			// Shift source down to bottom of DWORD
+			const unsigned int srcBitShift = getBitShift(srcBitMask);
+			srcValue >>= srcBitShift;
+
+			// Get max value possible in source from srcMask
+			const SrcT srcMax = srcBitMask >> srcBitShift;
+
+			// Get max avaiable in dest
+			const unsigned int destBitShift = getBitShift(destBitMask);
+			const DestT destMax = destBitMask >> destBitShift;
+
+			// Scale source value into destination, and shift back
+			DestT destValue = (srcValue * destMax) / srcMax;
+			return (destValue << destBitShift);
+		}
+
+        /**
+         * Convert N bit colour channel value to P bits. It fills P bits with the
+         * bit pattern repeated. (this is /((1<<n)-1) in fixed point)
+         */
+        static inline unsigned int fixedToFixed(uint32 value, unsigned int n, unsigned int p) 
+        {
+            if(n > p) 
+            {
+                // Less bits required than available; this is easy
+                value >>= n-p;
+            } 
+            else if(n < p)
+            {
+                // More bits required than are there, do the fill
+                // Use old fashioned division, probably better than a loop
+                if(value == 0)
+                        value = 0;
+                else if(value == (static_cast<unsigned int>(1)<<n)-1)
+                        value = (1<<p)-1;
+                else    value = value*(1<<p)/((1<<n)-1);
+            }
+            return value;    
+        }
+
+        /**
+         * Convert floating point colour channel value between 0.0 and 1.0 (otherwise clamped) 
+         * to integer of a certain number of bits. Works for any value of bits between 0 and 31.
+         */
+        static inline unsigned int floatToFixed(const float value, const unsigned int bits)
+        {
+            if(value <= 0.0f) return 0;
+            else if (value >= 1.0f) return (1<<bits)-1;
+            else return (unsigned int)(value * (1<<bits));     
+        }
+
+        /**
+         * Fixed point to float
+         */
+        static inline float fixedToFloat(unsigned value, unsigned int bits)
+        {
+            return (float)value/(float)((1<<bits)-1);
+        }
+
+        /**
+         * Write a n*8 bits integer value to memory in native endian.
+         */
+        static inline void intWrite(void *dest, const int n, const unsigned int value)
+        {
+            switch(n) {
+                case 1:
+                    ((uint8*)dest)[0] = (uint8)value;
+                    break;
+                case 2:
+                    ((uint16*)dest)[0] = (uint16)value;
+                    break;
+                case 3:
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG      
+                    ((uint8*)dest)[0] = (uint8)((value >> 16) & 0xFF);
+                    ((uint8*)dest)[1] = (uint8)((value >> 8) & 0xFF);
+                    ((uint8*)dest)[2] = (uint8)(value & 0xFF);
+#else
+                    ((uint8*)dest)[2] = (uint8)((value >> 16) & 0xFF);
+                    ((uint8*)dest)[1] = (uint8)((value >> 8) & 0xFF);
+                    ((uint8*)dest)[0] = (uint8)(value & 0xFF);
+#endif
+                    break;
+                case 4:
+                    ((uint32*)dest)[0] = (uint32)value;                
+                    break;                
+            }        
+        }
+        /**
+         * Read a n*8 bits integer value to memory in native endian.
+         */
+        static inline unsigned int intRead(const void *src, int n) {
+            switch(n) {
+                case 1:
+                    return ((uint8*)src)[0];
+                case 2:
+                    return ((uint16*)src)[0];
+                case 3:
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG      
+                    return ((uint32)((uint8*)src)[0]<<16)|
+                            ((uint32)((uint8*)src)[1]<<8)|
+                            ((uint32)((uint8*)src)[2]);
+#else
+                    return ((uint32)((uint8*)src)[0])|
+                            ((uint32)((uint8*)src)[1]<<8)|
+                            ((uint32)((uint8*)src)[2]<<16);
+#endif
+                case 4:
+                    return ((uint32*)src)[0];
+            } 
+            return 0; // ?
+        }
+
+        /** Convert a float32 to a float16 (NV_half_float)
+         	Courtesy of OpenEXR
+        */
+        static inline uint16 floatToHalf(float i)
+        {
+            union { float f; uint32 i; } v;
+            v.f = i;
+            return floatToHalfI(v.i);
+        }
+		/** Converts float in uint32 format to a a half in uint16 format
+		*/
+        static inline uint16 floatToHalfI(uint32 i)
+        {
+            register int s =  (i >> 16) & 0x00008000;
+            register int e = ((i >> 23) & 0x000000ff) - (127 - 15);
+            register int m =   i        & 0x007fffff;
+        
+            if (e <= 0)
+            {
+                if (e < -10)
+                {
+                    return 0;
+                }
+                m = (m | 0x00800000) >> (1 - e);
+        
+                return s | (m >> 13);
+            }
+            else if (e == 0xff - (127 - 15))
+            {
+                if (m == 0) // Inf
+                {
+                    return s | 0x7c00;
+                } 
+                else    // NAN
+                {
+                    m >>= 13;
+                    return s | 0x7c00 | m | (m == 0);
+                }
+            }
+            else
+            {
+                if (e > 30) // Overflow
+                {
+                    return s | 0x7c00;
+                }
+        
+                return s | (e << 10) | (m >> 13);
+            }
+        }
+        
+        /**
+         * Convert a float16 (NV_half_float) to a float32
+         * Courtesy of OpenEXR
+         */
+        static inline float halfToFloat(uint16 y)
+        {
+            union { float f; uint32 i; } v;
+            v.i = halfToFloatI(y);
+            return v.f;
+        }
+		/** Converts a half in uint16 format to a float
+		 	in uint32 format
+		 */
+        static inline uint32 halfToFloatI(uint16 y)
+        {
+            register int s = (y >> 15) & 0x00000001;
+            register int e = (y >> 10) & 0x0000001f;
+            register int m =  y        & 0x000003ff;
+        
+            if (e == 0)
+            {
+                if (m == 0) // Plus or minus zero
+                {
+                    return s << 31;
+                }
+                else // Denormalized number -- renormalize it
+                {
+                    while (!(m & 0x00000400))
+                    {
+                        m <<= 1;
+                        e -=  1;
+                    }
+        
+                    e += 1;
+                    m &= ~0x00000400;
+                }
+            }
+            else if (e == 31)
+            {
+                if (m == 0) // Inf
+                {
+                    return (s << 31) | 0x7f800000;
+                }
+                else // NaN
+                {
+                    return (s << 31) | 0x7f800000 | (m << 13);
+                }
+            }
+        
+            e = e + (127 - 15);
+            m = m << 13;
+        
+            return (s << 31) | (e << 23) | m;
+        }
+         
+
+    };
+}
+
+#endif
Index: /OgreMain/include/OgreBlendMode.h
===================================================================
--- /OgreMain/include/OgreBlendMode.h	(revision 5)
+++ /OgreMain/include/OgreBlendMode.h	(revision 5)
@@ -0,0 +1,245 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __BLENDMODE_H__
+#define __BLENDMODE_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreColourValue.h"
+
+namespace Ogre {
+
+    /** Type of texture blend mode.
+    */
+    enum LayerBlendType
+    {
+        LBT_COLOUR,
+        LBT_ALPHA
+    };
+
+    /** List of valid texture blending operations, for use with TextureUnitState::setColourOperation.
+        @remarks
+            This list is a more limited list than LayerBlendOperationEx because it only
+            includes operations that are supportable in both multipass and multitexture
+            rendering and thus provides automatic fallback if multitexture hardware
+            is lacking or insufficient.
+    */
+    enum LayerBlendOperation {
+        /// Replace all colour with texture with no adjustment
+        LBO_REPLACE,
+        /// Add colour components together.
+        LBO_ADD,
+        /// Multiply colour components together.
+        LBO_MODULATE,
+        /// Blend based on texture alpha
+        LBO_ALPHA_BLEND
+
+    };
+
+    /** Expert list of valid texture blending operations, for use with TextureUnitState::setColourOperationEx
+        and TextureUnitState::setAlphaOperation, and internally in the LayerBlendModeEx class. It's worth
+        noting that these operations are for blending <i>between texture layers</i> and not between rendered objects
+        and the existing scene. Because all of these modes are only supported in multitexture hardware it may be
+        required to set up a fallback operation where this hardware is not available.
+    */
+    enum LayerBlendOperationEx {
+        /// use source1 without modification
+        LBX_SOURCE1,
+        /// use source2 without modification
+        LBX_SOURCE2,
+        /// multiply source1 and source2 together
+        LBX_MODULATE,
+        /// as LBX_MODULATE but brighten afterwards (x2)
+        LBX_MODULATE_X2,
+        /// as LBX_MODULATE but brighten more afterwards (x4)
+        LBX_MODULATE_X4,
+        /// add source1 and source2 together
+        LBX_ADD,
+        /// as LBX_ADD, but subtract 0.5 from the result
+        LBX_ADD_SIGNED,
+        /// as LBX_ADD, but subtract product from the sum
+        LBX_ADD_SMOOTH,
+        /// subtract source2 from source1
+        LBX_SUBTRACT,
+        /// use interpolated alpha value from vertices to scale source1, then add source2 scaled by (1-alpha)
+        LBX_BLEND_DIFFUSE_ALPHA,
+        /// as LBX_BLEND_DIFFUSE_ALPHA, but use alpha from texture
+        LBX_BLEND_TEXTURE_ALPHA,
+        /// as LBX_BLEND_DIFFUSE_ALPHA, but use current alpha from previous stages
+        LBX_BLEND_CURRENT_ALPHA,
+        /// as LBX_BLEND_DIFFUSE_ALPHA but use a constant manual blend value (0.0-1.0)
+        LBX_BLEND_MANUAL,
+        /// dotproduct of color1 and color2 
+        LBX_DOTPRODUCT,
+        /// use interpolated color values from vertices to scale source1, then add source2 scaled by (1-color)
+        LBX_BLEND_DIFFUSE_COLOUR
+    };
+
+    /** List of valid sources of values for blending operations used
+        in TextureUnitState::setColourOperation and TextureUnitState::setAlphaOperation,
+        and internally in the LayerBlendModeEx class.
+    */
+    enum LayerBlendSource
+    {
+        /// the colour as built up from previous stages
+        LBS_CURRENT,
+        /// the colour derived from the texture assigned to this layer
+        LBS_TEXTURE,
+        /// the interpolated diffuse colour from the vertices
+        LBS_DIFFUSE,
+        /// the interpolated specular colour from the vertices
+        LBS_SPECULAR,
+        /// a colour supplied manually as a separate argument
+        LBS_MANUAL
+    };
+    /** Class which manages blending of both colour and alpha components.
+        @remarks
+            This class is a utility class used by both TextureUnitState and
+            RenderSystem to wrap up the details of a blending operation. This blending
+            operation could be used for blending colour or alpha in a texture layer.
+            This class is really only for use by OGRE, since apps can deal with
+            blending modes through the TextureUnitState class methods
+            setColourOperation and setAlphaOperation.
+        @par
+            It's worth noting that these operations are for blending <i>between texture
+            layers</i> and not between rendered objects and the existing scene. If
+            you wish to make an object blend with others in the scene, e.g. to make
+            transparent objects etc, use the Material::setSceneBlending method.
+    */
+    class _OgreExport LayerBlendModeEx
+    {
+    public:
+        /// The type of blending (colour or alpha)
+        LayerBlendType blendType;
+        /// The operation to be applied
+        LayerBlendOperationEx operation;
+        /// The first source of colour/alpha
+        LayerBlendSource source1;
+        /// The second source of colour/alpha
+        LayerBlendSource source2;
+
+        /// Manual colour value for manual source1
+        ColourValue colourArg1;
+        /// Manual colour value for manual source2
+        ColourValue colourArg2;
+        /// Manual alpha value for manual source1
+        Real alphaArg1;
+        /// Manual alpha value for manual source2
+        Real alphaArg2;
+        /// Manual blending factor
+        Real factor;
+
+        bool operator==(const LayerBlendModeEx& rhs) const
+        {
+            if (blendType != rhs.blendType) return false;
+
+            if (blendType == LBT_COLOUR)
+            {
+
+                if (operation == rhs.operation &&
+                    source1 == rhs.source1 &&
+                    source2 == rhs.source2 &&
+                    colourArg1 == rhs.colourArg1 &&
+                    colourArg2 == rhs.colourArg2 &&
+                    factor == rhs.factor)
+                {
+                    return true;
+                }
+            }
+            else // if (blendType == LBT_ALPHA)
+            {
+                if (operation == rhs.operation &&
+                    source1 == rhs.source1 &&
+                    source2 == rhs.source2 &&
+                    alphaArg1 == rhs.alphaArg1 &&
+                    alphaArg2 == rhs.alphaArg2 &&
+                    factor == rhs.factor)
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        bool operator!=(const LayerBlendModeEx& rhs) const
+        {
+            return !(*this == rhs);
+        }
+
+
+
+    };
+
+    /** Types of blending that you can specify between an object and the existing contents of the scene.
+        @remarks
+            As opposed to the LayerBlendType, which classifies blends between texture layers, these blending
+            types blend between the output of the texture units and the pixels already in the viewport,
+            allowing for object transparency, glows, etc.
+        @par
+            These types are provided to give quick and easy access to common effects. You can also use
+            the more manual method of supplying source and destination blending factors.
+            See Material::setSceneBlending for more details.
+        @see
+            Material::setSceneBlending
+    */
+    enum SceneBlendType
+    {
+        /// Make the object transparent based on the final alpha values in the texture
+        SBT_TRANSPARENT_ALPHA,
+        /// Make the object transparent based on the colour values in the texture (brighter = more opaque)
+        SBT_TRANSPARENT_COLOUR,
+        /// Add the texture values to the existing scene content
+        SBT_ADD,
+		/// Multiply the 2 colours together
+		SBT_MODULATE,
+        /// The default blend mode where source replaces destination
+        SBT_REPLACE
+        // TODO : more
+    };
+
+    /** Blending factors for manually blending objects with the scene. If there isn't a predefined
+        SceneBlendType that you like, then you can specify the blending factors directly to affect the
+        combination of object and the existing scene. See Material::setSceneBlending for more details.
+    */
+    enum SceneBlendFactor
+    {
+        SBF_ONE,
+        SBF_ZERO,
+        SBF_DEST_COLOUR,
+        SBF_SOURCE_COLOUR,
+        SBF_ONE_MINUS_DEST_COLOUR,
+        SBF_ONE_MINUS_SOURCE_COLOUR,
+        SBF_DEST_ALPHA,
+        SBF_SOURCE_ALPHA,
+        SBF_ONE_MINUS_DEST_ALPHA,
+        SBF_ONE_MINUS_SOURCE_ALPHA
+
+    };
+}
+
+#endif
Index: /OgreMain/include/OgreBone.h
===================================================================
--- /OgreMain/include/OgreBone.h	(revision 5)
+++ /OgreMain/include/OgreBone.h	(revision 5)
@@ -0,0 +1,142 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __Bone_H__
+#define __Bone_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreNode.h"
+
+
+namespace Ogre 
+{
+    /** A bone in a skeleton.
+    @remarks
+        See Skeleton for more information about the principles behind skeletal animation.
+        This class is a node in the joint hierarchy. Mesh vertices also have assignments
+        to bones to define how they move in relation to the skeleton.
+    */
+    class _OgreExport Bone : public Node
+    {
+    public:
+        /** Constructor, not to be used directly (use Bone::createChild or Skeleton::createBone) */
+        Bone(unsigned short handle, Skeleton* creator);
+        /** Constructor, not to be used directly (use Bone::createChild or Skeleton::createBone) */
+        Bone(const String& name, unsigned short handle, Skeleton* creator);
+        ~Bone();
+
+        /** Creates a new Bone as a child of this bone.
+        @remarks
+            This method creates a new bone which will inherit the transforms of this
+            bone, with the handle specified.
+            @param 
+                handle The numeric handle to give the new bone; must be unique within the Skeleton.
+            @param
+                translate Initial translation offset of child relative to parent
+            @param
+                rotate Initial rotation relative to parent
+        */
+        Bone* createChild(unsigned short handle, 
+            const Vector3& translate = Vector3::ZERO, const Quaternion& rotate = Quaternion::IDENTITY);
+
+
+        /** Gets the numeric handle for this bone (unique within the skeleton). */
+        unsigned short getHandle(void) const;
+
+        /** Sets the current position / orientation to be the 'binding pose' ie the layout in which 
+            bones were originally bound to a mesh.
+        */
+        void setBindingPose(void);
+
+        /** Resets the position and orientation of this Bone to the original binding position.
+        @remarks
+            Bones are bound to the mesh in a binding pose. They are then modified from this
+            position during animation. This method returns the bone to it's original position and
+            orientation.
+        */
+        void reset(void);
+
+        /** Sets whether or not this bone is manually controlled. 
+        @remarks
+            Manually controlled bones can be altered by the application at runtime, 
+            and their positions will not be reset by the animation routines. Note 
+            that you should also make sure that there are no AnimationTrack objects
+            referencing this bone, or if there are, you should disable them using
+            pAnimation->destroyTrack(pBone->getHandle());
+        */
+        void setManuallyControlled(bool manuallyControlled);
+
+        /** Getter for mManuallyControlled Flag */
+        bool isManuallyControlled() const;
+
+        
+        /** Gets the transform which takes bone space to current from the binding pose. 
+        @remarks
+            Internal use only.
+        */
+        void _getOffsetTransform(Matrix4& m) const;
+
+		/** Gets the inverted binding pose scale. */
+		const Vector3& _getBindingPoseInverseScale(void) const { return mBindDerivedInverseScale; }
+		/** Gets the inverted binding pose position. */
+		const Vector3& _getBindingPoseInversePosition(void) const { return mBindDerivedInversePosition; }
+		/** Gets the inverted binding pose orientation. */
+		const Quaternion& _getBindingPoseInverseOrientation(void) const { return mBindDerivedInverseOrientation; }
+
+		/// @see Node::needUpdate
+		void needUpdate(bool forceParentUpdate = false);
+
+
+    protected:
+        /// The numeric handle of this bone
+        unsigned short mHandle;
+
+        /** Bones set as manuallyControlled are not reseted in Skeleton::reset() */
+        bool mManuallyControlled;
+
+        /** See Node. */
+        Node* createChildImpl(void);
+        /** See Node. */
+        Node* createChildImpl(const String& name);
+
+        /// Pointer back to creator, for child creation (not smart ptr so child does not preserve parent)
+        Skeleton* mCreator;
+
+        /// The inversed derived scale of the bone in the binding pose
+        Vector3 mBindDerivedInverseScale;
+        /// The inversed derived orientation of the bone in the binding pose
+        Quaternion mBindDerivedInverseOrientation;
+        /// The inversed derived position of the bone in the binding pose
+        Vector3 mBindDerivedInversePosition;
+    };
+
+
+}
+
+#endif
Index: /OgreMain/include/OgreBorderPanelOverlayElement.h
===================================================================
--- /OgreMain/include/OgreBorderPanelOverlayElement.h	(revision 5)
+++ /OgreMain/include/OgreBorderPanelOverlayElement.h	(revision 5)
@@ -0,0 +1,344 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __BorderPanelOverlayElement_H__
+#define __BorderPanelOverlayElement_H__
+
+#include "OgrePanelOverlayElement.h"
+
+namespace Ogre {
+
+    class BorderRenderable;
+    
+    /** A specialisation of the PanelOverlayElement to provide a panel with a border.
+    @remarks
+        Whilst the standard panel can use a single tiled material, this class allows
+        panels with a tileable backdrop plus a border texture. This is handy for large
+        panels that are too big to use a single large texture with a border, or
+        for multiple different size panels where you want the border a constant width
+        but the center to repeat.
+    @par
+        In addition to the usual PanelOverlayElement properties, this class has a 'border
+        material', which specifies the material used for the edges of the panel,
+        a border width (which can either be constant all the way around, or specified
+        per edge), and the texture coordinates for each of the border sections.
+    */
+    class _OgreExport BorderPanelOverlayElement : public PanelOverlayElement
+    {
+        friend class BorderRenderable;
+    public:
+        /** Constructor */
+        BorderPanelOverlayElement(const String& name);
+        virtual ~BorderPanelOverlayElement();
+
+        virtual void initialise(void);
+
+		const String& getTypeName(void) const;
+        /** Sets the size of the border.
+        @remarks
+            This method sets a constant size for all borders. There are also alternative
+            methods which allow you to set border widths for individual edges separately.
+            Remember that the dimensions specified here are in relation to the size of
+            the screen, so 0.1 is 1/10th of the screen width or height. Also note that because
+            most screen resolutions are 1.333:1 width:height ratio that using the same
+            border size will look slightly bigger across than up.
+        @param size The size of the border as a factor of the screen dimensions ie 0.2 is one-fifth
+            of the screen size.
+        */
+        void setBorderSize(Real size);
+
+        /** Sets the size of the border, with different sizes for vertical and horizontal borders.
+        @remarks
+            This method sets a size for the side and top / bottom borders separately. 
+            Remember that the dimensions specified here are in relation to the size of
+            the screen, so 0.1 is 1/10th of the screen width or height. Also note that because
+            most screen resolutions are 1.333:1 width:height ratio that using the same
+            border size will look slightly bigger across than up.
+        @param sides The size of the side borders as a factor of the screen dimensions ie 0.2 is one-fifth
+            of the screen size.
+        @param topAndBottom The size of the top and bottom borders as a factor of the screen dimensions.
+        */
+        void setBorderSize(Real sides, Real topAndBottom);
+
+        /** Sets the size of the border separately for all borders.
+        @remarks
+            This method sets a size all borders separately. 
+            Remember that the dimensions specified here are in relation to the size of
+            the screen, so 0.1 is 1/10th of the screen width or height. Also note that because
+            most screen resolutions are 1.333:1 width:height ratio that using the same
+            border size will look slightly bigger across than up.
+        @param left The size of the left border as a factor of the screen dimensions ie 0.2 is one-fifth
+            of the screen size.
+        @param right The size of the left border as a factor of the screen dimensions.
+        @param top The size of the top border as a factor of the screen dimensions.
+        @param bottom The size of the bottom border as a factor of the screen dimensions.
+        */
+        void setBorderSize(Real left, Real right, Real top, Real bottom);
+
+        /** Gets the size of the left border. */
+        Real getLeftBorderSize(void) const;
+        /** Gets the size of the right border. */
+        Real getRightBorderSize(void) const;
+        /** Gets the size of the top border. */
+        Real getTopBorderSize(void) const;
+        /** Gets the size of the bottom border. */
+        Real getBottomBorderSize(void) const;
+
+        /** Sets the texture coordinates for the left edge of the border.
+        @remarks
+            The border panel uses 8 panels for the border (9 including the center). 
+            Imagine a table with 3 rows and 3 columns. The corners are always the same size,
+            but the edges stretch depending on how big the panel is. Those who have done
+            resizable HTML tables will be familiar with this approach.
+        @par
+            We only require 2 sets of uv coordinates, one for the top-left and one for the
+            bottom-right of the panel, since it is assumed the sections are aligned on the texture.
+        */
+        void setLeftBorderUV(Real u1, Real v1, Real u2, Real v2);
+        /** Sets the texture coordinates for the right edge of the border. 
+        @remarks See setLeftBorderUV.
+        */
+        void setRightBorderUV(Real u1, Real v1, Real u2, Real v2);
+        /** Sets the texture coordinates for the top edge of the border. 
+        @remarks See setLeftBorderUV.
+        */
+        void setTopBorderUV(Real u1, Real v1, Real u2, Real v2);
+        /** Sets the texture coordinates for the bottom edge of the border. 
+        @remarks See setLeftBorderUV.
+        */
+        void setBottomBorderUV(Real u1, Real v1, Real u2, Real v2);
+        /** Sets the texture coordinates for the top-left corner of the border. 
+        @remarks See setLeftBorderUV.
+        */
+        void setTopLeftBorderUV(Real u1, Real v1, Real u2, Real v2);
+        /** Sets the texture coordinates for the top-right corner of the border. 
+        @remarks See setLeftBorderUV.
+        */
+        void setTopRightBorderUV(Real u1, Real v1, Real u2, Real v2);
+        /** Sets the texture coordinates for the bottom-left corner of the border. 
+        @remarks See setLeftBorderUV.
+        */
+        void setBottomLeftBorderUV(Real u1, Real v1, Real u2, Real v2);
+        /** Sets the texture coordinates for the bottom-right corner of the border. 
+        @remarks See setLeftBorderUV.
+        */
+        void setBottomRightBorderUV(Real u1, Real v1, Real u2, Real v2);
+
+		String getLeftBorderUVString() const;
+		String getRightBorderUVString() const;
+		String getTopBorderUVString() const;
+		String getBottomBorderUVString() const;
+		String getTopLeftBorderUVString() const;
+		String getTopRightBorderUVString() const;
+		String getBottomLeftBorderUVString() const;
+		String getBottomRightBorderUVString() const;
+
+
+
+
+        /** Sets the name of the material to use for the borders. */
+        void setBorderMaterialName(const String& name);
+        /** Gets the name of the material to use for the borders. */
+        const String& getBorderMaterialName(void) const;
+
+        /** Overridden from OverlayContainer */
+        void _updateRenderQueue(RenderQueue* queue);
+
+        /** Overridden from OverlayElement */
+        void setMetricsMode(GuiMetricsMode gmm);
+
+        /** Overridden from OverlayElement */
+        void _update(void);
+
+
+        /** Command object for specifying border sizes (see ParamCommand).*/
+        class _OgrePrivate CmdBorderSize : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for specifying the Material for the border (see ParamCommand).*/
+        class _OgrePrivate CmdBorderMaterial : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for specifying texture coordinates for the border (see ParamCommand).*/
+        class _OgrePrivate CmdBorderLeftUV : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for specifying texture coordinates for the border (see ParamCommand).*/
+        class _OgrePrivate CmdBorderTopUV : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for specifying texture coordinates for the border (see ParamCommand).*/
+        class _OgrePrivate CmdBorderRightUV : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for specifying texture coordinates for the border (see ParamCommand).*/
+        class _OgrePrivate CmdBorderBottomUV : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for specifying texture coordinates for the border (see ParamCommand).*/
+        class _OgrePrivate CmdBorderTopLeftUV : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for specifying texture coordinates for the border (see ParamCommand).*/
+        class _OgrePrivate CmdBorderBottomLeftUV : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for specifying texture coordinates for the border (see ParamCommand).*/
+        class _OgrePrivate CmdBorderBottomRightUV : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for specifying texture coordinates for the border (see ParamCommand).*/
+        class _OgrePrivate CmdBorderTopRightUV : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+    protected:
+        Real mLeftBorderSize;
+        Real mRightBorderSize;
+        Real mTopBorderSize;
+        Real mBottomBorderSize;
+		struct CellUV {
+			Real u1, v1, u2, v2;
+		};
+		CellUV mBorderUV[8];
+
+        ushort mPixelLeftBorderSize;
+        ushort mPixelRightBorderSize;
+        ushort mPixelTopBorderSize;
+        ushort mPixelBottomBorderSize;
+
+        String mBorderMaterialName;
+        MaterialPtr mpBorderMaterial;
+
+        // Render operation for the border area
+        RenderOperation mRenderOp2;
+
+        static String msTypeName;
+
+        /// internal method for setting up geometry, called by OverlayElement::update
+        void updatePositionGeometry(void);
+		/// internal method for setting up geometry, called by OverlayElement::update
+		void updateTextureGeometry(void);
+        /// Internal method for setting up parameters
+        void addBaseParameters(void);
+
+        enum BorderCellIndex {
+            BCELL_TOP_LEFT = 0,
+            BCELL_TOP = 1,
+            BCELL_TOP_RIGHT = 2,
+            BCELL_LEFT = 3,
+            BCELL_RIGHT = 4,
+            BCELL_BOTTOM_LEFT = 5,
+            BCELL_BOTTOM = 6,
+            BCELL_BOTTOM_RIGHT = 7
+        };
+	    String getCellUVString(BorderCellIndex idx) const;
+
+        // Command objects
+        static CmdBorderSize msCmdBorderSize;
+        static CmdBorderMaterial msCmdBorderMaterial;
+        static CmdBorderLeftUV msCmdBorderLeftUV;
+        static CmdBorderTopUV msCmdBorderTopUV;
+        static CmdBorderBottomUV msCmdBorderBottomUV;
+        static CmdBorderRightUV msCmdBorderRightUV;
+        static CmdBorderTopLeftUV msCmdBorderTopLeftUV;
+        static CmdBorderBottomLeftUV msCmdBorderBottomLeftUV;
+        static CmdBorderTopRightUV msCmdBorderTopRightUV;
+        static CmdBorderBottomRightUV msCmdBorderBottomRightUV;
+
+        BorderRenderable* mBorderRenderable;
+    };
+
+    /** Class for rendering the border of a BorderPanelOverlayElement.
+    @remarks
+        We need this because we have to render twice, once with the inner panel's repeating
+        material (handled by superclass) and once for the border's separate meterial. 
+    */
+    class _OgreExport BorderRenderable : public Renderable
+    {
+    protected:
+        BorderPanelOverlayElement* mParent;
+    public:
+        /** Constructed with pointers to parent. */
+        BorderRenderable(BorderPanelOverlayElement* parent) : mParent(parent)
+        {
+            mUseIdentityProjection = true;
+            mUseIdentityView = true;
+        }
+        const MaterialPtr& getMaterial(void) const { return mParent->mpBorderMaterial; }
+        void getRenderOperation(RenderOperation& op) { op = mParent->mRenderOp2; }
+        void getWorldTransforms(Matrix4* xform) const { mParent->getWorldTransforms(xform); }
+        const Quaternion& getWorldOrientation(void) const { return Quaternion::IDENTITY; }
+        const Vector3& getWorldPosition(void) const { return Vector3::ZERO; }
+        unsigned short getNumWorldTransforms(void) const { return 1; }
+        Real getSquaredViewDepth(const Camera* cam) const { return mParent->getSquaredViewDepth(cam); }
+        const LightList& getLights(void) const
+        {
+            // N/A, panels are not lit
+            static LightList ll;
+            return ll;
+        }
+		bool getPolygonModeOverrideable(void) const
+		{
+			return mParent->getPolygonModeOverrideable();
+		}
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgreCamera.h
===================================================================
--- /OgreMain/include/OgreCamera.h	(revision 5)
+++ /OgreMain/include/OgreCamera.h	(revision 5)
@@ -0,0 +1,566 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Camera_H__
+#define __Camera_H__
+
+// Default options
+#include "OgrePrerequisites.h"
+
+#include "OgreString.h"
+#include "OgreMovableObject.h"
+
+// Matrices & Vectors
+#include "OgreMatrix4.h"
+#include "OgreVector3.h"
+#include "OgrePlane.h"
+#include "OgreQuaternion.h"
+#include "OgreCommon.h"
+#include "OgreFrustum.h"
+#include "OgreRay.h"
+
+
+namespace Ogre {
+
+
+
+    /** A viewpoint from which the scene will be rendered.
+        @remarks
+            OGRE renders scenes from a camera viewpoint into a buffer of
+            some sort, normally a window or a texture (a subclass of
+            RenderTarget). OGRE cameras support both perspective projection (the default,
+            meaning objects get smaller the further away they are) and
+            orthographic projection (blueprint-style, no decrease in size
+            with distance). Each camera carries with it a style of rendering,
+            e.g. full textured, flat shaded, wireframe), field of view,
+            rendering distances etc, allowing you to use OGRE to create
+            complex multi-window views if required. In addition, more than
+            one camera can point at a single render target if required,
+            each rendering to a subset of the target, allowing split screen
+            and picture-in-picture views.
+        @par
+            Cameras maintain their own aspect ratios, field of view, and frustrum,
+            and project co-ordinates into a space measured from -1 to 1 in x and y,
+            and 0 to 1 in z. At render time, the camera will be rendering to a
+            Viewport which will translate these parametric co-ordinates into real screen
+            co-ordinates. Obviously it is advisable that the viewport has the same
+            aspect ratio as the camera to avoid distortion (unless you want it!).
+        @par
+            Note that a Camera can be attached to a SceneNode, using the method
+            SceneNode::attachObject. If this is done the Camera will combine it's own
+            position/orientation settings with it's parent SceneNode. 
+            This is useful for implementing more complex Camera / object
+            relationships i.e. having a camera attached to a world object.
+    */
+    class _OgreExport Camera : public Frustum
+    {
+    protected:
+        /// Camera name
+        String mName;
+        /// Scene manager responsible for the scene
+        SceneManager *mSceneMgr;
+
+        /// Camera orientation, quaternion style
+        Quaternion mOrientation;
+
+        /// Camera position - default (0,0,0)
+        Vector3 mPosition;
+
+        /// Derived orientation/position of the camera, including reflection
+        mutable Quaternion mDerivedOrientation;
+        mutable Vector3 mDerivedPosition;
+
+        /// Real world orientation/position of the camera
+        mutable Quaternion mRealOrientation;
+        mutable Vector3 mRealPosition;
+
+        /// Whether to yaw around a fixed axis.
+        bool mYawFixed;
+        /// Fixed axis to yaw around
+        Vector3 mYawFixedAxis;
+
+        /// Rendering type
+        PolygonMode mSceneDetail;
+
+        /// Stored number of visible faces in the last render
+        unsigned int mVisFacesLastRender;
+
+        /// Stored number of visible faces in the last render
+        unsigned int mVisBatchesLastRender;
+
+        /// Shared class-level name for Movable type
+        static String msMovableType;
+
+        /// SceneNode which this Camera will automatically track
+        SceneNode* mAutoTrackTarget;
+        /// Tracking offset for fine tuning
+        Vector3 mAutoTrackOffset;
+
+		// Scene LOD factor used to adjust overall LOD
+		Real mSceneLodFactor;
+		/// Inverted scene LOD factor, can be used by Renderables to adjust their LOD
+		Real mSceneLodFactorInv;
+
+
+        /** Viewing window. 
+        @remarks
+        Generalize camera class for the case, when viewing frustum doesn't cover all viewport.
+        */
+        Real mWLeft, mWTop, mWRight, mWBottom;
+        /// Is viewing window used.
+        bool mWindowSet;
+        /// Windowed viewport clip planes 
+        mutable std::vector<Plane> mWindowClipPlanes;
+        // Was viewing window changed.
+        mutable bool mRecalcWindow;
+        /// The last viewport to be added using this camera
+        Viewport* mLastViewport;
+        /** Whether aspect ratio will automaticaally be recalculated 
+            when a vieport changes its size
+        */
+        bool mAutoAspectRatio;
+		/// Custom culling frustum
+		Frustum *mCullFrustum;
+		/// Whether or not the rendering distance of objects should take effect for this camera
+		bool mUseRenderingDistance;
+
+
+        // Internal functions for calcs
+        bool isViewOutOfDate(void) const;
+        /// Signal to update frustum information.
+        void invalidateFrustum(void) const;
+        /// Signal to update view information.
+        void invalidateView(void) const;
+
+
+        /** Do actual window setting, using parameters set in SetWindow call
+        @remarks
+            The method will called on demand.
+        */
+        virtual void setWindowImpl(void) const;
+        /** Get the derived position of this frustum. */
+        const Vector3& getPositionForViewUpdate(void) const;
+        /** Get the derived orientation of this frustum. */
+        const Quaternion& getOrientationForViewUpdate(void) const;
+
+		/** Helper function for forwardIntersect that intersects rays with canonical plane */
+		virtual std::vector<Vector4> getRayForwardIntersect(const Vector3& anchor, const Vector3 *dir, Real planeOffset) const;
+
+    public:
+        /** Standard constructor.
+        */
+        Camera( const String& name, SceneManager* sm);
+
+        /** Standard destructor.
+        */
+        virtual ~Camera();
+
+
+        /** Returns a pointer to the SceneManager this camera is rendering through.
+        */
+        SceneManager* getSceneManager(void) const;
+
+        /** Gets the camera's name.
+        */
+        virtual const String& getName(void) const;
+
+
+        /** Sets the level of rendering detail required from this camera.
+            @remarks
+                Each camera is set to render at full detail by default, that is
+                with full texturing, lighting etc. This method lets you change
+                that behaviour, allowing you to make the camera just render a
+                wireframe view, for example.
+        */
+        void setPolygonMode(PolygonMode sd);
+
+        /** Retrieves the level of detail that the camera will render.
+        */
+        PolygonMode getPolygonMode(void) const;
+
+        /** Sets the camera's position.
+        */
+        void setPosition(Real x, Real y, Real z);
+
+        /** Sets the camera's position.
+        */
+        void setPosition(const Vector3& vec);
+
+        /** Retrieves the camera's position.
+        */
+        const Vector3& getPosition(void) const;
+
+        /** Moves the camera's position by the vector offset provided along world axes.
+        */
+        void move(const Vector3& vec);
+
+        /** Moves the camera's position by the vector offset provided along it's own axes (relative to orientation).
+        */
+        void moveRelative(const Vector3& vec);
+
+        /** Sets the camera's direction vector.
+            @remarks
+                Note that the 'up' vector for the camera will automatically be recalculated based on the
+                current 'up' vector (i.e. the roll will remain the same).
+        */
+        void setDirection(Real x, Real y, Real z);
+
+        /** Sets the camera's direction vector.
+        */
+        void setDirection(const Vector3& vec);
+
+        /* Gets the camera's direction.
+        */
+        Vector3 getDirection(void) const;
+
+        /** Gets the camera's up vector.
+        */
+        Vector3 getUp(void) const;
+
+        /** Gets the camera's right vector.
+        */
+        Vector3 getRight(void) const;
+
+        /** Points the camera at a location in worldspace.
+            @remarks
+                This is a helper method to automatically generate the
+                direction vector for the camera, based on it's current position
+                and the supplied look-at point.
+            @param
+                targetPoint A vector specifying the look at point.
+        */
+        void lookAt( const Vector3& targetPoint );
+        /** Points the camera at a location in worldspace.
+            @remarks
+                This is a helper method to automatically generate the
+                direction vector for the camera, based on it's current position
+                and the supplied look-at point.
+            @param
+                x
+            @param
+                y
+            @param
+                z Co-ordinates of the point to look at.
+        */
+        void lookAt(Real x, Real y, Real z);
+
+        /** Rolls the camera anticlockwise, around its local z axis.
+        */
+        void roll(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        void roll(Real degrees) { roll ( Angle(degrees) ); }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Rotates the camera anticlockwise around it's local y axis.
+        */
+        void yaw(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        void yaw(Real degrees) { yaw ( Angle(degrees) ); }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Pitches the camera up/down anticlockwise around it's local z axis.
+        */
+        void pitch(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        void pitch(Real degrees) { pitch ( Angle(degrees) ); }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Rotate the camera around an arbitrary axis.
+        */
+        void rotate(const Vector3& axis, const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        void rotate(const Vector3& axis, Real degrees) { rotate ( axis, Angle(degrees) ); }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Rotate the camera around an aritrary axis using a Quarternion.
+        */
+        void rotate(const Quaternion& q);
+
+        /** Tells the camera whether to yaw around it's own local Y axis or a 
+			fixed axis of choice.
+            @remarks
+                This method allows you to change the yaw behaviour of the camera
+				- by default, the camera yaws around a fixed Y axis. This is 
+				often what you want - for example if you're making a first-person 
+				shooter, you really don't want the yaw axis to reflect the local 
+				camera Y, because this would mean a different yaw axis if the 
+				player is looking upwards rather than when they are looking
+                straight ahead. You can change this behaviour by calling this 
+				method, which you will want to do if you are making a completely
+				free camera like the kind used in a flight simulator. 
+            @param
+                useFixed If true, the axis passed in the second parameter will 
+				always be the yaw axis no matter what the camera orientation. 
+				If false, the camera yaws around the local Y.
+            @param
+                fixedAxis The axis to use if the first parameter is true.
+        */
+        void setFixedYawAxis( bool useFixed, const Vector3& fixedAxis = Vector3::UNIT_Y );
+
+
+        /** Returns the camera's current orientation.
+        */
+        const Quaternion& getOrientation(void) const;
+
+        /** Sets the camera's orientation.
+        */
+        void setOrientation(const Quaternion& q);
+
+        /** Tells the Camera to contact the SceneManager to render from it's viewpoint.
+        @param vp The viewport to render to
+        @param includeOverlays Whether or not any overlay objects should be included
+        */
+        void _renderScene(Viewport *vp, bool includeOverlays);
+
+        /** Function for outputting to a stream.
+        */
+        _OgreExport friend std::ostream& operator<<(std::ostream& o, const Camera& c);
+
+        /** Internal method to notify camera of the visible faces in the last render.
+        */
+        void _notifyRenderedFaces(unsigned int numfaces);
+
+        /** Internal method to notify camera of the visible batches in the last render.
+        */
+        void _notifyRenderedBatches(unsigned int numbatches);
+
+        /** Internal method to retrieve the number of visible faces in the last render.
+        */
+        unsigned int _getNumRenderedFaces(void) const;
+
+        /** Internal method to retrieve the number of visible batches in the last render.
+        */
+        unsigned int _getNumRenderedBatches(void) const;
+
+        /** Gets the derived orientation of the camera, including any
+            rotation inherited from a node attachment and reflection matrix. */
+        const Quaternion& getDerivedOrientation(void) const;
+        /** Gets the derived position of the camera, including any
+            translation inherited from a node attachment and reflection matrix. */
+        const Vector3& getDerivedPosition(void) const;
+        /** Gets the derived direction vector of the camera, including any
+            rotation inherited from a node attachment and reflection matrix. */
+        Vector3 getDerivedDirection(void) const;
+        /** Gets the derived up vector of the camera, including any
+            rotation inherited from a node attachment and reflection matrix. */
+        Vector3 getDerivedUp(void) const;
+        /** Gets the derived right vector of the camera, including any
+            rotation inherited from a node attachment and reflection matrix. */
+        Vector3 getDerivedRight(void) const;
+
+        /** Gets the real world orientation of the camera, including any
+            rotation inherited from a node attachment */
+        const Quaternion& getRealOrientation(void) const;
+        /** Gets the real world position of the camera, including any
+            translation inherited from a node attachment. */
+        const Vector3& getRealPosition(void) const;
+        /** Gets the real world direction vector of the camera, including any
+            rotation inherited from a node attachment. */
+        Vector3 getRealDirection(void) const;
+        /** Gets the real world up vector of the camera, including any
+            rotation inherited from a node attachment. */
+        Vector3 getRealUp(void) const;
+        /** Gets the real world right vector of the camera, including any
+            rotation inherited from a node attachment. */
+        Vector3 getRealRight(void) const;
+
+        /** Overridden from MovableObject */
+        const String& getMovableType(void) const;
+
+        /** Enables / disables automatic tracking of a SceneNode.
+        @remarks
+            If you enable auto-tracking, this Camera will automatically rotate to
+            look at the target SceneNode every frame, no matter how 
+            it or SceneNode move. This is handy if you want a Camera to be focused on a
+            single object or group of objects. Note that by default the Camera looks at the 
+            origin of the SceneNode, if you want to tweak this, e.g. if the object which is
+            attached to this target node is quite big and you want to point the camera at
+            a specific point on it, provide a vector in the 'offset' parameter and the 
+            camera's target point will be adjusted.
+        @param enabled If true, the Camera will track the SceneNode supplied as the next 
+            parameter (cannot be null). If false the camera will cease tracking and will
+            remain in it's current orientation.
+        @param target Pointer to the SceneNode which this Camera will track. Make sure you don't
+            delete this SceneNode before turning off tracking (e.g. SceneManager::clearScene will
+            delete it so be careful of this). Can be null if and only if the enabled param is false.
+        @param offset If supplied, the camera targets this point in local space of the target node
+            instead of the origin of the target node. Good for fine tuning the look at point.
+        */
+        void setAutoTracking(bool enabled, SceneNode* target = 0, 
+            const Vector3& offset = Vector3::ZERO);
+
+
+		/** Sets the level-of-detail factor for this Camera.
+		@remarks
+			This method can be used to influence the overall level of detail of the scenes 
+			rendered using this camera. Various elements of the scene have level-of-detail
+			reductions to improve rendering speed at distance; this method allows you 
+			to hint to those elements that you would like to adjust the level of detail that
+			they would normally use (up or down). 
+		@par
+			The most common use for this method is to reduce the overall level of detail used
+			for a secondary camera used for sub viewports like rear-view mirrors etc.
+			Note that scene elements are at liberty to ignore this setting if they choose,
+			this is merely a hint.
+		@param factor The factor to apply to the usual level of detail calculation. Higher
+			values increase the detail, so 2.0 doubles the normal detail and 0.5 halves it.
+		*/
+		void setLodBias(Real factor = 1.0);
+
+		/** Returns the level-of-detail bias factor currently applied to this camera. 
+		@remarks
+			See Camera::setLodBias for more details.
+		*/
+		Real getLodBias(void) const;
+
+
+
+        /** Gets a world space ray as cast from the camera through a viewport position.
+        @param screenx, screeny The x and y position at which the ray should intersect the viewport, 
+            in normalised screen coordinates [0,1]
+        */
+        Ray getCameraToViewportRay(Real screenx, Real screeny) const;
+
+		/** Internal method for OGRE to use for LOD calculations. */
+		Real _getLodBiasInverse(void) const;
+
+
+        /** Internal method used by OGRE to update auto-tracking cameras. */
+        void _autoTrack(void);
+
+
+        /** Sets the viewing window inside of viewport.
+        @remarks
+        This method can be used to set a subset of the viewport as the rendering
+        target. 
+        @param Left Relative to Viewport - 0 corresponds to left edge, 1 - to right edge (default - 0).
+        @param Top Relative to Viewport - 0 corresponds to top edge, 1 - to bottom edge (default - 0).
+        @param Right Relative to Viewport - 0 corresponds to left edge, 1 - to right edge (default - 1).
+        @param Bottom Relative to Viewport - 0 corresponds to top edge, 1 - to bottom edge (default - 1).
+        */
+        virtual void setWindow (Real Left, Real Top, Real Right, Real Bottom);
+        /// Cancel view window.
+        virtual void resetWindow (void);
+        /// Returns if a viewport window is being used
+        virtual bool isWindowSet(void) const { return mWindowSet; }
+        /// Gets the window clip planes, only applicable if isWindowSet == true
+        const std::vector<Plane>& getWindowPlanes(void) const;
+
+        /** Overridden from MovableObject */
+        Real getBoundingRadius(void) const;
+		/** Get the auto tracking target for this camera, if any. */
+        SceneNode* getAutoTrackTarget(void) const { return mAutoTrackTarget; }
+		/** Get the auto tracking offset for this camera, if it is auto tracking. */
+		const Vector3& getAutoTrackOffset(void) const { return mAutoTrackOffset; }
+		
+        /** Get the last viewport which was attached to this camera. 
+        @note This is not guaranteed to be the only viewport which is
+        using this camera, just the last once which was created referring
+        to it.
+        */
+        Viewport* getViewport(void) const {return mLastViewport;}
+        /** Notifies this camera that a viewport is using it.*/
+        void _notifyViewport(Viewport* viewport) {mLastViewport = viewport;}
+
+        /** If set to true a vieport that owns this frustum will be able to 
+            recalculate the aspect ratio whenever the frustum is resized.
+        @remarks
+            You should set this to true only if the frustum / camera is used by 
+            one viewport at the same time. Otherwise the aspect ratio for other 
+            viewports may be wrong.
+        */    
+        void setAutoAspectRatio(bool autoratio);
+
+        /** Retreives if AutoAspectRatio is currently set or not
+        */
+        bool getAutoAspectRatio(void) const;
+
+		/** Tells the camera to use a separate Frustum instance to perform culling.
+		@remarks
+			By calling this method, you can tell the camera to perform culling
+			against a different frustum to it's own. This is mostly useful for
+			debug cameras that allow you to show the culling behaviour of another
+			camera, or a manual frustum instance. 
+		@param frustum Pointer to a frustum to use; this can either be a manual
+			Frustum instance (which you can attach to scene nodes like any other
+			MovableObject), or another camera. If you pass 0 to this method it
+			reverts the camera to normal behaviour.
+		*/
+		void setCullingFrustum(Frustum* frustum) { mCullFrustum = frustum; }
+		/** Returns the custom culling frustum in use. */
+		Frustum* getCullingFrustum(void) { return mCullFrustum; }
+
+		/** Forward projects frustum rays to find forward intersection with plane.
+		 @remarks
+		    Forward projection may lead to intersections at infinity.
+		*/
+		virtual void forwardIntersect(const Plane& worldPlane, std::vector<Vector4>* intersect3d) const;
+
+		/// @copydoc Frustum::isVisible
+		bool isVisible(const AxisAlignedBox& bound, FrustumPlane* culledBy = 0) const;
+		/// @copydoc Frustum::isVisible
+		bool isVisible(const Sphere& bound, FrustumPlane* culledBy = 0) const;
+		/// @copydoc Frustum::isVisible
+		bool isVisible(const Vector3& vert, FrustumPlane* culledBy = 0) const;
+		/// @copydoc Frustum::getWorldSpaceCorners
+		const Vector3* getWorldSpaceCorners(void) const;
+		/// @copydoc Frustum::getFrustumPlane
+		const Plane& getFrustumPlane( unsigned short plane ) const;
+		/// @copydoc Frustum::projectSphere
+		bool projectSphere(const Sphere& sphere, 
+			Real* left, Real* top, Real* right, Real* bottom) const;
+		/// @copydoc Frustum::getNearClipDistance
+		Real getNearClipDistance(void) const;
+		/// @copydoc Frustum::getFarClipDistance
+		Real getFarClipDistance(void) const;
+		/// @copydoc Frustum::getViewMatrix
+		const Matrix4& getViewMatrix(void) const;
+		/** Specialised version of getViewMatrix allowing caller to differentiate
+			whether the custom culling frustum should be allowed or not. 
+		@remarks
+			The default behaviour of the standard getViewMatrix is to delegate to 
+			the alternate culling frustum, if it is set. This is expected when 
+			performing CPU calculations, but the final rendering must be performed
+			using the real view matrix in order to display the correct debug view.
+		*/
+		const Matrix4& getViewMatrix(bool ownFrustumOnly) const;
+		/** Set whether this camera should use the 'rendering distance' on
+			objects to exclude distant objects from the final image. The
+			default behaviour is to use it.
+		@param use True to use the rendering distance, false not to.
+		*/
+		virtual void setUseRenderingDistance(bool use) { mUseRenderingDistance = use; }
+		/** Get whether this camera should use the 'rendering distance' on
+			objects to exclude distant objects from the final image.
+		*/
+		virtual bool getUseRenderingDistance(void) const { return mUseRenderingDistance; }
+
+     };
+
+} // namespace Ogre
+#endif
Index: /OgreMain/include/OgreCodec.h
===================================================================
--- /OgreMain/include/OgreCodec.h	(revision 5)
+++ /OgreMain/include/OgreCodec.h	(revision 5)
@@ -0,0 +1,133 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _Codec_H__
+#define _Codec_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreSharedPtr.h"
+#include "OgreDataStream.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreStringVector.h"
+
+namespace Ogre {
+
+    /** Abstract class that defines a 'codec'.
+        @remarks
+            A codec class works like a two-way filter for data - data entered on
+            one end (the decode end) gets processed and transformed into easily
+            usable data while data passed the other way around codes it back.
+        @par
+            The codec concept is a pretty generic one - you can easily understand
+            how it can be used for images, sounds, archives, even compressed data.
+    */
+    class _OgreExport Codec
+    {
+    protected:
+        typedef std::map< String, Codec* > CodecList; 
+        /** A map that contains all the registered codecs.
+        */
+        static CodecList ms_mapCodecs;
+
+    public:
+        class _OgrePrivate CodecData 
+        {
+        public:
+            virtual ~CodecData() {};
+
+            /** Returns the type of the data.
+            */
+            virtual String dataType() const { return "CodecData"; };
+        };
+        typedef SharedPtr<CodecData> CodecDataPtr;
+
+        typedef ConstMapIterator<CodecList> CodecIterator;
+
+    public:
+    	virtual ~Codec();
+    	
+        /** Registers a new codec in the database.
+        */
+        static void registerCodec( Codec *pCodec )
+        {
+            ms_mapCodecs[pCodec->getType()] = pCodec;
+        }
+
+        /** Unregisters a codec from the database.
+        */
+        static void unRegisterCodec( Codec *pCodec )
+        {
+            ms_mapCodecs.erase(pCodec->getType());
+        }
+
+        /** Gets the iterator for the registered codecs. */
+        static CodecIterator getCodecIterator(void)
+        {
+            return CodecIterator(ms_mapCodecs.begin(), ms_mapCodecs.end());
+        }
+
+        /** Gets the file extension list for the registered codecs. */
+        static StringVector getExtensions(void);
+
+        /** Gets the codec registered for the passed in file extension. */
+        static Codec* getCodec(const String& extension);
+
+        /** Codes the data in the input stream and saves the result in the output
+            stream.
+        */
+        virtual DataStreamPtr code(MemoryDataStreamPtr& input, CodecDataPtr& pData) const = 0;
+        /** Codes the data in the input chunk and saves the result in the output
+            filename provided. Provided for efficiency since coding to memory is
+            progressive therefore memory required is unknown leading to reallocations.
+        @param input The input data
+        @param outFileName The filename to write to
+        @param pData Extra information to be passed to the codec (codec type specific)
+        */
+        virtual void codeToFile(MemoryDataStreamPtr& input, const String& outFileName, CodecDataPtr& pData) const = 0;
+
+        /// Result of a decoding; both a decoded data stream and CodecData metadata
+        typedef std::pair<MemoryDataStreamPtr, CodecDataPtr> DecodeResult;
+        /** Codes the data from the input chunk into the output chunk.
+            @param input Stream containing the encoded data
+            @note
+                Has a variable number of arguments, which depend on the codec type.
+        */
+        virtual DecodeResult decode(DataStreamPtr& input) const = 0;
+
+        /** Returns the type of the codec as a String
+        */
+        virtual String getType() const = 0;
+
+        /** Returns the type of the data that supported by this codec as a String
+        */
+        virtual String getDataType() const = 0;
+    };
+
+} // namespace
+
+#endif
Index: /OgreMain/include/OgreColourValue.h
===================================================================
--- /OgreMain/include/OgreColourValue.h	(revision 5)
+++ /OgreMain/include/OgreColourValue.h	(revision 5)
@@ -0,0 +1,319 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _COLOURVALUE_H__
+#define _COLOURVALUE_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+    typedef uint32 RGBA;
+    typedef uint32 ARGB;
+    typedef uint32 ABGR;
+	typedef uint32 BGRA;
+
+    /** Class representing colour.
+	    @remarks
+		    Colour is represented as 4 components, each of which is a
+		    floating-point value from 0.0 to 1.0.
+	    @par
+		    The 3 'normal' colour components are red, green and blue, a higher
+		    number indicating greater amounts of that component in the colour.
+		    The forth component is the 'alpha' value, which represents
+		    transparency. In this case, 0.0 is completely transparent and 1.0 is
+		    fully opaque.
+    */
+    class _OgreExport ColourValue
+    {
+    public:
+        static const ColourValue ZERO;
+        static const ColourValue Black;
+        static const ColourValue White;
+        static const ColourValue Red;
+        static const ColourValue Green;
+        static const ColourValue Blue;
+
+	    explicit ColourValue( float red = 1.0f,
+				    float green = 1.0f,
+				    float blue = 1.0f,
+				    float alpha = 1.0f ) : r(red), g(green), b(blue), a(alpha)
+        { }
+
+	    bool operator==(const ColourValue& rhs) const;
+	    bool operator!=(const ColourValue& rhs) const;
+
+        float r,g,b,a;
+
+	    /** Retrieves colour as RGBA.
+	    */
+	    RGBA getAsRGBA(void) const;
+
+	    /** Retrieves colour as ARGB.
+	    */
+	    ARGB getAsARGB(void) const;
+
+		/** Retrieves colour as BGRA.
+		*/
+		BGRA getAsBGRA(void) const;
+
+		/** Retrieves colours as ABGR */
+	    ABGR getAsABGR(void) const;
+
+	    /** Sets colour as RGBA.
+	    */
+        void setAsRGBA(const RGBA val);
+
+	    /** Sets colour as ARGB.
+	    */
+        void setAsARGB(const ARGB val);
+
+		/** Sets colour as BGRA.
+		*/
+		void setAsBGRA(const BGRA val);
+
+	    /** Sets colour as ABGR.
+	    */
+        void setAsABGR(const ABGR val);
+
+        /** Clamps colour value to the range [0, 1].
+        */
+        void saturate(void)
+        {
+            if (r < 0)
+                r = 0;
+            else if (r > 1)
+                r = 1;
+
+            if (g < 0)
+                g = 0;
+            else if (g > 1)
+                g = 1;
+
+            if (b < 0)
+                b = 0;
+            else if (b > 1)
+                b = 1;
+
+            if (a < 0)
+                a = 0;
+            else if (a > 1)
+                a = 1;
+        }
+
+        /** As saturate, except that this colour value is unaffected and
+            the saturated colour value is returned as a copy. */
+        ColourValue saturateCopy(void) const
+        {
+            ColourValue ret = *this;
+            ret.saturate();
+            return ret;
+        }
+
+		/// Array accessor operator
+		inline float operator [] ( const size_t i ) const
+		{
+			assert( i < 4 );
+
+			return *(&r+i);
+		}
+
+		/// Array accessor operator
+		inline float& operator [] ( const size_t i )
+		{
+			assert( i < 4 );
+
+			return *(&r+i);
+		}
+
+		/// Pointer accessor for direct copying
+		inline float* ptr()
+		{
+			return &r;
+		}
+		/// Pointer accessor for direct copying
+		inline const float* ptr() const
+		{
+			return &r;
+		}
+
+		
+		// arithmetic operations
+        inline ColourValue operator + ( const ColourValue& rkVector ) const
+        {
+            ColourValue kSum;
+
+            kSum.r = r + rkVector.r;
+            kSum.g = g + rkVector.g;
+            kSum.b = b + rkVector.b;
+            kSum.a = a + rkVector.a;
+
+            return kSum;
+        }
+
+        inline ColourValue operator - ( const ColourValue& rkVector ) const
+        {
+            ColourValue kDiff;
+
+            kDiff.r = r - rkVector.r;
+            kDiff.g = g - rkVector.g;
+            kDiff.b = b - rkVector.b;
+            kDiff.a = a - rkVector.a;
+
+            return kDiff;
+        }
+
+        inline ColourValue operator * (const float fScalar ) const
+        {
+            ColourValue kProd;
+
+            kProd.r = fScalar*r;
+            kProd.g = fScalar*g;
+            kProd.b = fScalar*b;
+            kProd.a = fScalar*a;
+
+            return kProd;
+        }
+
+        inline ColourValue operator * ( const ColourValue& rhs) const
+        {
+            ColourValue kProd;
+
+            kProd.r = rhs.r * r;
+            kProd.g = rhs.g * g;
+            kProd.b = rhs.b * b;
+            kProd.a = rhs.a * a;
+
+            return kProd;
+        }
+
+        inline ColourValue operator / ( const ColourValue& rhs) const
+        {
+            ColourValue kProd;
+
+            kProd.r = rhs.r / r;
+            kProd.g = rhs.g / g;
+            kProd.b = rhs.b / b;
+            kProd.a = rhs.a / a;
+
+            return kProd;
+        }
+
+        inline ColourValue operator / (const float fScalar ) const
+        {
+            assert( fScalar != 0.0 );
+
+            ColourValue kDiv;
+
+            float fInv = 1.0 / fScalar;
+            kDiv.r = r * fInv;
+            kDiv.g = g * fInv;
+            kDiv.b = b * fInv;
+            kDiv.a = a * fInv;
+
+            return kDiv;
+        }
+
+        inline friend ColourValue operator * (const float fScalar, const ColourValue& rkVector )
+        {
+            ColourValue kProd;
+
+            kProd.r = fScalar * rkVector.r;
+            kProd.g = fScalar * rkVector.g;
+            kProd.b = fScalar * rkVector.b;
+            kProd.a = fScalar * rkVector.a;
+
+            return kProd;
+        }
+
+        // arithmetic updates
+        inline ColourValue& operator += ( const ColourValue& rkVector )
+        {
+            r += rkVector.r;
+            g += rkVector.g;
+            b += rkVector.b;
+            a += rkVector.a;
+
+            return *this;
+        }
+
+        inline ColourValue& operator -= ( const ColourValue& rkVector )
+        {
+            r -= rkVector.r;
+            g -= rkVector.g;
+            b -= rkVector.b;
+            a -= rkVector.a;
+
+            return *this;
+        }
+
+        inline ColourValue& operator *= (const float fScalar )
+        {
+            r *= fScalar;
+            g *= fScalar;
+            b *= fScalar;
+            a *= fScalar;
+            return *this;
+        }
+
+        inline ColourValue& operator /= (const float fScalar )
+        {
+            assert( fScalar != 0.0 );
+
+            float fInv = 1.0 / fScalar;
+
+            r *= fInv;
+            g *= fInv;
+            b *= fInv;
+            a *= fInv;
+
+            return *this;
+        }
+
+		/** Set a colour value from Hue, Saturation and Brightness.
+		@param hue Hue value, scaled to the [0,1] range as opposed to the 0-360
+		@param saturation Saturation level, [0,1]
+		@param brightness Brightness level, [0,1]
+		*/
+		void setHSB(Real hue, Real saturation, Real brightness);
+
+
+		/** Function for writing to a stream.
+		*/
+		inline _OgreExport friend std::ostream& operator <<
+			( std::ostream& o, const ColourValue& c )
+		{
+			o << "ColourValue(" << c.r << ", " << c.g << ", " << c.b << ", " << c.a << ")";
+			return o;
+		}
+
+    };
+
+} // namespace
+
+#endif
Index: /OgreMain/include/OgreCommon.h
===================================================================
--- /OgreMain/include/OgreCommon.h	(revision 5)
+++ /OgreMain/include/OgreCommon.h	(revision 5)
@@ -0,0 +1,425 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Common_H__
+#define __Common_H__
+// Common stuff
+
+#include "OgreString.h"
+
+#if defined ( OGRE_GCC_VISIBILITY )
+#   pragma GCC visibility push(default)
+#endif
+
+#include <utility>
+#include <vector>
+#include <map>
+
+#if defined ( OGRE_GCC_VISIBILITY )
+#   pragma GCC visibility pop
+#endif
+
+namespace Ogre {
+
+
+    /** Comparison functions used for the depth/stencil buffer operations and 
+		others. */
+    enum CompareFunction
+    {
+        CMPF_ALWAYS_FAIL,
+        CMPF_ALWAYS_PASS,
+        CMPF_LESS,
+        CMPF_LESS_EQUAL,
+        CMPF_EQUAL,
+        CMPF_NOT_EQUAL,
+        CMPF_GREATER_EQUAL,
+        CMPF_GREATER
+    };
+
+    /** High-level filtering options providing shortcuts to settings the
+        minification, magnification and mip filters. */
+    enum TextureFilterOptions
+    {
+        /// Equal to: min=FO_POINT, mag=FO_POINT, mip=FO_NONE
+        TFO_NONE,
+        /// Equal to: min=FO_LINEAR, mag=FO_LINEAR, mip=FO_POINT
+        TFO_BILINEAR,
+        /// Equal to: min=FO_LINEAR, mag=FO_LINEAR, mip=FO_LINEAR
+        TFO_TRILINEAR,
+        /// Equal to: min=FO_ANISOTROPIC, max=FO_ANISOTROPIC, mip=FO_LINEAR
+		TFO_ANISOTROPIC
+    };
+
+    enum FilterType
+    {
+        /// The filter used when shrinking a texture
+        FT_MIN,
+        /// The filter used when magnifiying a texture
+        FT_MAG,
+        /// The filter used when determining the mipmap
+        FT_MIP
+    };
+    /** Filtering options for textures / mipmaps. */
+    enum FilterOptions
+    {
+        /// No filtering, used for FILT_MIP to turn off mipmapping
+        FO_NONE,
+        /// Use the closest pixel
+        FO_POINT,
+        /// Average of a 2x2 pixel area, denotes bilinear for MIN and MAG, trilinear for MIP
+        FO_LINEAR,
+        /// Similar to FO_LINEAR, but compensates for the angle of the texture plane
+        FO_ANISOTROPIC
+    };
+
+    /** Light shading modes. */
+    enum ShadeOptions
+    {
+        SO_FLAT,
+        SO_GOURAUD,
+        SO_PHONG
+    };
+
+    /** Fog modes. */
+    enum FogMode
+    {
+        /// No fog. Duh.
+        FOG_NONE,
+        /// Fog density increases  exponentially from the camera (fog = 1/e^(distance * density))
+        FOG_EXP,
+        /// Fog density increases at the square of FOG_EXP, i.e. even quicker (fog = 1/e^(distance * density)^2)
+        FOG_EXP2,
+        /// Fog density increases linearly between the start and end distances
+        FOG_LINEAR
+    };
+
+    /** Hardware culling modes based on vertex winding.
+        This setting applies to how the hardware API culls triangles it is sent. */
+    enum CullingMode
+    {
+        /// Hardware never culls triangles and renders everything it receives.
+        CULL_NONE = 1,
+        /// Hardware culls triangles whose vertices are listed clockwise in the view (default).
+        CULL_CLOCKWISE = 2,
+        /// Hardware culls triangles whose vertices are listed anticlockwise in the view.
+        CULL_ANTICLOCKWISE = 3
+    };
+
+    /** Manual culling modes based on vertex normals.
+        This setting applies to how the software culls triangles before sending them to the 
+		hardware API. This culling mode is used by scene managers which choose to implement it -
+		normally those which deal with large amounts of fixed world geometry which is often 
+		planar (software culling movable variable geometry is expensive). */
+    enum ManualCullingMode
+    {
+        /// No culling so everything is sent to the hardware.
+        MANUAL_CULL_NONE = 1,
+        /// Cull triangles whose normal is pointing away from the camera (default).
+        MANUAL_CULL_BACK = 2,
+        /// Cull triangles whose normal is pointing towards the camera.
+        MANUAL_CULL_FRONT = 3
+    };
+
+    /** Enumerates the wave types usable with the Ogre engine. */
+    enum WaveformType
+    {
+        /// Standard sine wave which smoothly changes from low to high and back again.
+        WFT_SINE,
+        /// An angular wave with a constant increase / decrease speed with pointed peaks.
+        WFT_TRIANGLE,
+        /// Half of the time is spent at the min, half at the max with instant transition between.
+        WFT_SQUARE,
+        /// Gradual steady increase from min to max over the period with an instant return to min at the end.
+        WFT_SAWTOOTH,
+        /// Gradual steady decrease from max to min over the period, with an instant return to max at the end.
+        WFT_INVERSE_SAWTOOTH,
+		/// Pulse Width Modulation. Works like WFT_SQUARE, except the high to low transition is controlled by duty cycle. 
+		/// With a duty cycle of 50% (0.5) will give the same output as WFT_SQUARE.
+		WFT_PWM
+    };
+
+    /** The polygon mode to use when rasterising. */
+    enum PolygonMode
+    {
+		/// Only points are rendered.
+        PM_POINTS = 1,
+		/// Wireframe models are rendered.
+        PM_WIREFRAME = 2,
+		/// Solid polygons are rendered.
+        PM_SOLID = 3
+    };
+
+    /** An enumeration of broad shadow techniques */
+    enum ShadowTechnique
+    {
+        /** No shadows */
+        SHADOWTYPE_NONE = 0x00,
+		/** Mask for additive shadows (not for direct use, use  SHADOWTYPE_ enum instead)
+		*/
+		SHADOWDETAILTYPE_ADDITIVE = 0x01,
+		/** Mask for modulative shadows (not for direct use, use  SHADOWTYPE_ enum instead)
+		*/
+		SHADOWDETAILTYPE_MODULATIVE = 0x02,
+		/** Mask for integrated shadows (not for direct use, use SHADOWTYPE_ enum instead)
+		*/
+		SHADOWDETAILTYPE_INTEGRATED = 0x04,
+		/** Mask for stencil shadows (not for direct use, use  SHADOWTYPE_ enum instead)
+		*/
+		SHADOWDETAILTYPE_STENCIL = 0x10,
+		/** Mask for texture shadows (not for direct use, use  SHADOWTYPE_ enum instead)
+		*/
+		SHADOWDETAILTYPE_TEXTURE = 0x20,
+		
+        /** Stencil shadow technique which renders all shadow volumes as
+            a modulation after all the non-transparent areas have been 
+            rendered. This technique is considerably less fillrate intensive 
+            than the additive stencil shadow approach when there are multiple
+            lights, but is not an accurate model. 
+        */
+        SHADOWTYPE_STENCIL_MODULATIVE = 0x12,
+        /** Stencil shadow technique which renders each light as a separate
+            additive pass to the scene. This technique can be very fillrate
+            intensive because it requires at least 2 passes of the entire
+            scene, more if there are multiple lights. However, it is a more
+            accurate model than the modulative stencil approach and this is
+            especially apparant when using coloured lights or bump mapping.
+        */
+        SHADOWTYPE_STENCIL_ADDITIVE = 0x11,
+        /** Texture-based shadow technique which involves a monochrome render-to-texture
+            of the shadow caster and a projection of that texture onto the 
+            shadow receivers as a modulative pass. 
+        */
+        SHADOWTYPE_TEXTURE_MODULATIVE = 0x22,
+		
+        /** Texture-based shadow technique which involves a render-to-texture
+            of the shadow caster and a projection of that texture onto the 
+            shadow receivers, built up per light as additive passes. 
+			This technique can be very fillrate intensive because it requires numLights + 2 
+			passes of the entire scene. However, it is a more accurate model than the 
+			modulative approach and this is especially apparant when using coloured lights 
+			or bump mapping.
+        */
+        SHADOWTYPE_TEXTURE_ADDITIVE = 0x21,
+
+		/** Texture-based shadow technique which involves a render-to-texture
+		of the shadow caster and a projection of that texture on to the shadow
+		receivers, with the usage of those shadow textures completely controlled
+		by the materials of the receivers.
+		This technique is easily the most flexible of all techniques because 
+		the material author is in complete control over how the shadows are
+		combined with regular rendering. It can perform shadows as accurately
+		as SHADOWTYPE_TEXTURE_ADDITIVE but more efficiently because it requires
+		less passes. However it also requires more expertise to use, and 
+		in almost all cases, shader capable hardware to really use to the full.
+		@note The 'additive' part of this mode means that the colour of
+		the rendered shadow texture is by default plain black. It does
+		not mean it does the adding on your receivers automatically though, how you
+		use that result is up to you.
+		*/
+		SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED = 0x25,
+		/** Texture-based shadow technique which involves a render-to-texture
+			of the shadow caster and a projection of that texture on to the shadow
+			receivers, with the usage of those shadow textures completely controlled
+			by the materials of the receivers.
+			This technique is easily the most flexible of all techniques because 
+			the material author is in complete control over how the shadows are
+			combined with regular rendering. It can perform shadows as accurately
+			as SHADOWTYPE_TEXTURE_ADDITIVE but more efficiently because it requires
+			less passes. However it also requires more expertise to use, and 
+			in almost all cases, shader capable hardware to really use to the full.
+			@note The 'modulative' part of this mode means that the colour of
+			the rendered shadow texture is by default the 'shadow colour'. It does
+			not mean it modulates on your receivers automatically though, how you
+			use that result is up to you.
+		*/
+		SHADOWTYPE_TEXTURE_MODULATIVE_INTEGRATED = 0x26
+    };
+
+    /** An enumeration describing which material properties should track the vertex colours */
+    typedef int TrackVertexColourType;
+    enum TrackVertexColourEnum {
+        TVC_NONE        = 0x0,
+        TVC_AMBIENT     = 0x1,        
+        TVC_DIFFUSE     = 0x2,
+        TVC_SPECULAR    = 0x4,
+        TVC_EMISSIVE    = 0x8
+    };
+
+    /** Sort mode for billboard-set and particle-system */
+    enum SortMode
+    {
+        /** Sort by direction of the camera */
+        SM_DIRECTION,
+        /** Sort by distance from the camera */
+        SM_DISTANCE
+    };
+
+    /** Defines the frame buffer types. */
+    enum FrameBufferType {
+        FBT_COLOUR  = 0x1,
+        FBT_DEPTH   = 0x2,
+        FBT_STENCIL = 0x4
+    };
+    
+	
+    class Light;
+	typedef std::vector<Light*> LightList;
+
+    typedef std::map<String, bool> UnaryOptionList;
+    typedef std::map<String, String> BinaryOptionList;
+
+	/// Name / value parameter pair (first = name, second = value)
+	typedef std::map<String, String> NameValuePairList;
+
+    /// Alias / Texture name pair (first = alias, second = texture name)
+    typedef std::map<String, String> AliasTextureNamePairList;
+
+        template< typename T > struct TRect
+        {
+          T left, top, right, bottom;
+          TRect() {}
+          TRect( T const & l, T const & t, T const & r, T const & b )
+            : left( l ), top( t ), right( r ), bottom( b )
+          {
+          }
+          TRect( TRect const & o )
+            : left( o.left ), top( o.top ), right( o.right ), bottom( o.bottom )
+          {
+          }
+          TRect & operator=( TRect const & o )
+          {
+            left = o.left;
+            top = o.top;
+            right = o.right;
+            bottom = o.bottom;
+            return *this;
+          }
+          T width() const
+          {
+            return right - left;
+          }
+          T height() const
+          {
+            return bottom - top;
+          }
+        };
+
+        /** Structure used to define a rectangle in a 2-D floating point space.
+        */
+        typedef TRect<float> FloatRect;
+
+        /** Structure used to define a rectangle in a 2-D integer space.
+        */
+        typedef TRect< long > Rect;
+
+        /** Structure used to define a box in a 3-D integer space.
+         	Note that the left, top, and front edges are included but the right, 
+         	bottom and back ones are not.
+         */
+        struct Box
+        {
+            size_t left, top, right, bottom, front, back;
+			/// Parameterless constructor for setting the members manually
+            Box()
+            {
+            }
+            /** Define a box from left, top, right and bottom coordinates
+            	This box will have depth one (front=0 and back=1).
+            	@param	l	x value of left edge
+            	@param	t	y value of top edge
+            	@param	r	x value of right edge
+            	@param	b	y value of bottom edge
+            	@note Note that the left, top, and front edges are included 
+ 		           	but the right, bottom and back ones are not.
+            */
+            Box( size_t l, size_t t, size_t r, size_t b ):
+                left(l),
+                top(t),   
+                right(r),
+                bottom(b),
+                front(0),
+                back(1)
+            {
+          		assert(right >= left && bottom >= top && back >= front);
+            }
+            /** Define a box from left, top, front, right, bottom and back
+            	coordinates.
+            	@param	l	x value of left edge
+            	@param	t	y value of top edge
+            	@param  ff  z value of front edge
+            	@param	r	x value of right edge
+            	@param	b	y value of bottom edge
+            	@param  bb  z value of back edge
+            	@note Note that the left, top, and front edges are included 
+ 		           	but the right, bottom and back ones are not.
+            */
+            Box( size_t l, size_t t, size_t ff, size_t r, size_t b, size_t bb ):
+                left(l),
+                top(t),   
+                right(r),
+                bottom(b),
+                front(ff),
+                back(bb)
+            {
+          		assert(right >= left && bottom >= top && back >= front);
+            }
+            
+            /// Return true if the other box is a part of this one
+            bool contains(const Box &def) const
+            {
+            	return (def.left >= left && def.top >= top && def.front >= front &&
+					def.right <= right && def.bottom <= bottom && def.back <= back);
+            }
+            
+            /// Get the width of this box
+            size_t getWidth() const { return right-left; }
+            /// Get the height of this box
+            size_t getHeight() const { return bottom-top; }
+            /// Get the depth of this box
+            size_t getDepth() const { return back-front; }
+        };
+
+    
+	
+	/** Locate command-line options of the unary form '-blah' and of the
+        binary form '-blah foo', passing back the index of the next non-option.
+    @param numargs, argv The standard parameters passed to the main method
+    @param unaryOptList Map of unary options (ie those that do not require a parameter).
+        Should be pre-populated with, for example '-e' in the key and false in the 
+        value. Options which are found will be set to true on return.
+    @param binOptList Map of binnary options (ie those that require a parameter
+        e.g. '-e afile.txt').
+        Should be pre-populated with, for example '-e' and the default setting. 
+        Options which are found will have the value updated.
+    */
+    int _OgreExport findCommandLineOpts(int numargs, char** argv, UnaryOptionList& unaryOptList, 
+        BinaryOptionList& binOptList);
+
+}
+
+#endif
Index: /OgreMain/include/OgreCompiler2Pass.h
===================================================================
--- /OgreMain/include/OgreCompiler2Pass.h	(revision 5)
+++ /OgreMain/include/OgreCompiler2Pass.h	(revision 5)
@@ -0,0 +1,667 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+
+#ifndef __Compiler2Pass_H__
+#define __Compiler2Pass_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreStdHeaders.h"
+
+namespace Ogre {
+
+    /** Compiler2Pass is a generic 2 pass compiler/assembler
+    @remarks
+	    provides a tokenizer in pass 1 and relies on the subclass to provide the virtual method for pass 2
+
+	    PASS 1 - tokenize source: this is a simple brute force lexical scanner/analyzer that also parses
+			    the formed token for proper semantics and context in one pass
+			    it uses top down (recursive descent) ruling based on Backus - Naur Form (BNF) notation for semantic
+			    checking.
+
+			    During Pass1, if a terminal token is identified as having an action then that action gets triggered
+			    when the next terminal token is uncountered that has an action.
+
+	    PASS 2 - generate application specific instructions ie native instructions based on the tokens in the instruction container.
+
+    @par
+	    this class must be subclassed with the subclass providing some implementation details for Pass 2.  The subclass
+	    is responsible for setting up the token libraries along with defining the language syntax and handling
+        token actions during the second pass.
+
+    @par
+        The sub class normally supplies a simplified BNF text description in its constructor prior to doing any parsing/tokenizing of source.
+        The simplified BNF text description defines the language syntax and rule structure.
+        The meta-symbols used in the BNF text description are:
+    @par
+        ::=  meaning "is defined as". "::=" starts the definition of a rule.  The left side of ::= must contain an <identifier>
+    @par
+        <>   angle brackets are used to surround syntax rule names. A syntax rule name is also called a non-terminal in that
+             it does not generate a terminal token in the instruction container for pass 2 processing.
+    @par
+        |    meaning "or". if the item on the left of the | fails then the item on the right is tested.
+             Example: <true_false> ::= 'true' | 'false';
+             whitespace is used to imply AND operation between left and right items.
+             Example: <terrain_shadaws> ::= 'terrain_shadows' <true_false>
+             the 'terrain_shadows' terminal token must be found and <true_false> rule must pass in order for <terrain_shadows> rule
+             to pass.
+    @par
+        []   optional rule identifier is enclosed in meta symbols [ and ].
+             Note that only one identifier or terminal token can take [] modifier.
+    @par
+        {}   repetitive identifier (zero or more times) is enclosed in meta symbols { and }
+             Note that only one identifier or terminal token can take {} modifier.
+    @par
+        ''   terminal tokens are surrounded by single quotes.  A terminal token is always one or more characters.
+             For example: 'Colour' defines a character sequence that must be matched in whole.  Note that matching is case
+             sensitive.
+    @par
+        @    turn on single character scanning and don't skip white space.
+             Mainly used for label processing that allow white space.
+             Example: '@ ' prevents the white space between the quotes from being skipped
+    @par
+        -''  no terminal token is generated when a - precedes the first single quote but the text in between the quotes is still
+             tested against the characters in the source being parsed.
+    @par
+        (?! ) negative lookahead (not test) inspired by Perl 5. Scans ahead for a non-terminal or terminal expression
+             that should fail in order to make the rule production pass.
+             Does not generate a token or advance the cursur.  If the lookahead result fails ie token is found,
+             then the current rule fails and rollback occurs.  Mainly used to solve multiple contexts of a token.
+             An Example of where not test is used to solve multiple contexts:
+
+             <rule>       ::=  <identifier>  "::="  <expression>\n
+             <expression> ::=  <and_term> { <or_term> }\n
+             <or_term>    ::=  "|" <and_term>\n
+             <and_term>   ::=  <term> { <term> }\n
+             <term>       ::=  <identifier_right> | <terminal_symbol> | <repeat_expression> | <optional_expression>\n
+             <identifier_right> ::= <identifier> (?!"::=")
+
+             <identiefier> appears on both sides of the ::= so (?!"::=") test to make sure that ::= is not on the
+             right which would indicate that a new rule was being formed.
+
+             Works on both terminals and non-terminals.
+             Note: lookahead failure causes the whole rule to fail and rollback to occur
+
+    @par
+        <#name> # indicates that a numerical value is to be parsed to form a terminal token.  Name is optional and is just a descriptor
+             to help with understanding what the value will be used for.
+             Example: <Colour> ::= <#red> <#green> <#blue>
+
+    @par
+        ()   parentheses enclose a set of characters that can be used to generate a user identifier. for example:
+             (0123456789) matches a single character found in that set.
+             An example of a user identifier:
+
+    @par
+             <Label> ::= <Character> {<Character>}\n
+             <Character> ::= (abcdefghijklmnopqrstuvwxyz)
+
+             This will generate a rule that accepts one or more lowercase letters to make up the Label.  The User identifier
+             stops collecting the characters into a string when a match cannot be found in the rule.
+
+    @par
+        (! ) if the first character in the set is a ! then any input character not found in the set will be
+             accepted.
+             An example:
+
+             <Label> ::= <AnyCharacter_NoLineBreak> {<AnyCharacter_NoLineBreak>}\n
+             <AnyCharacter_NoLineBreak> ::= (!\n\r)
+
+             any character but \n or \r is accepted in the input.
+
+    @par
+        :   Insert the terminal token on the left before the next terminal token on the right if the next terminal token on right parses.
+             Usefull for when terminal tokens don't have a definate text state but only context state based on another terminal or character token.
+             An example:
+
+             <Last_Resort> ::= 'external_command' : <Special_Label>\n
+             <Special_Label> ::= (!\n\r\t)
+
+             In the example, <Last_Resort> gets processed when all other rules fail to parse.
+             if <Special_Label> parses (reads in any character but \n\r\t) then the terminal token 'external_command'
+             is inserted prior to the Special_Label for pass 2 processing.  'external_command' does not have have an explicit text
+             representation but based on the context of no other rules matching and <Special_Label> parsing, 'external_command' is
+             considered parsed.
+    */
+    class _OgreExport Compiler2Pass
+    {
+
+    protected:
+
+	    // BNF operation types
+	    enum OperationType {otUNKNOWN, otRULE, otAND, otOR, otOPTIONAL,
+                            otREPEAT, otDATA, otNOT_TEST, otINSERT_TOKEN, otEND};
+
+	    /** structure used to build rule paths
+
+	    */
+	    struct TokenRule
+        {
+		    OperationType operation;
+		    size_t tokenID;
+
+            TokenRule(void) : operation(otUNKNOWN), tokenID(0) {}
+            TokenRule(const OperationType ot, const size_t token)
+                : operation(ot), tokenID(token) {}
+	    };
+
+	    typedef std::vector<TokenRule> TokenRuleContainer;
+	    typedef TokenRuleContainer::iterator TokenRuleIterator;
+
+        static const size_t SystemTokenBase = 1000;
+        enum SystemRuleToken {
+            _no_token_ = SystemTokenBase,
+            _character_,
+            _value_,
+            _no_space_skip_
+        };
+
+	    enum BNF_ID {BNF_UNKOWN = 0,
+            BNF_SYNTAX, BNF_RULE, BNF_IDENTIFIER, BNF_IDENTIFIER_RIGHT, BNF_IDENTIFIER_CHARACTERS, BNF_ID_BEGIN, BNF_ID_END,
+            BNF_CONSTANT_BEGIN, BNF_SET_RULE, BNF_EXPRESSION,
+            BNF_AND_TERM, BNF_OR_TERM, BNF_TERM, BNF_TERM_ID, BNF_CONSTANT, BNF_OR, BNF_TERMINAL_SYMBOL, BNF_TERMINAL_START,
+            BNF_REPEAT_EXPRESSION, BNF_REPEAT_BEGIN, BNF_REPEAT_END, BNF_SET, BNF_SET_BEGIN, BNF_SET_END,
+            BNF_NOT_TEST, BNF_NOT_TEST_BEGIN, BNF_CONDITIONAL_TOKEN_INSERT, BNF_OPTIONAL_EXPRESSION,
+            BNF_NOT_EXPRESSION, BNF_NOT_CHK,
+            BNF_OPTIONAL_BEGIN, BNF_OPTIONAL_END, BNF_NO_TOKEN_START, BNF_SINGLEQUOTE, BNF_SINGLE_QUOTE_EXC, BNF_SET_END_EXC,
+            BNF_ANY_CHARACTER, BNF_SPECIAL_CHARACTERS1,
+            BNF_SPECIAL_CHARACTERS2, BNF_WHITE_SPACE_CHK,
+
+            BNF_LETTER, BNF_LETTER_DIGIT, BNF_DIGIT, BNF_WHITE_SPACE,
+            BNF_ALPHA_SET, BNF_NUMBER_SET, BNF_SPECIAL_CHARACTER_SET1,
+			BNF_SPECIAL_CHARACTER_SET2, BNF_SPECIAL_CHARACTER_SET3, BNF_NOT_CHARS,
+
+            // do not remove - this indicates where manually defined tokens end and where auto-gen ones start
+            BNF_AUTOTOKENSTART
+        };
+
+
+	    /** structure used to build lexeme Type library */
+	    struct LexemeTokenDef
+        {
+	        size_t ID;					/// Token ID which is the index into the Lexeme Token Definition Container
+            bool hasAction;            /// has an action associated with it. only applicable to terminal tokens
+            bool isNonTerminal;        /// if true then token is non-terminal
+	        size_t ruleID;				/// index into Rule database for non-terminal token rulepath and lexeme
+	        bool isCaseSensitive;        /// if true use case sensitivity when comparing lexeme to source
+            String lexeme;             /// text representation of token or valid characters for label parsing
+
+            LexemeTokenDef(void) : ID(0), hasAction(false), isNonTerminal(false), ruleID(0), isCaseSensitive(false) {}
+            LexemeTokenDef( const size_t ID, const String& lexeme, const bool hasAction = false, const bool caseSensitive = false )
+                : ID(ID)
+                , hasAction(hasAction)
+                , isNonTerminal(false)
+                , ruleID(0)
+                , isCaseSensitive(caseSensitive)
+                , lexeme(lexeme)
+            {
+            }
+
+	    };
+
+        typedef std::vector<LexemeTokenDef> LexemeTokenDefContainer;
+        typedef LexemeTokenDefContainer::iterator LexemeTokenDefIterator;
+
+        typedef std::map<std::string, size_t> LexemeTokenMap;
+        typedef LexemeTokenMap::iterator TokenKeyIterator;
+        /// map used to lookup client token based on previously defined lexeme
+
+
+	    /** structure for Token instructions that are constructed during first pass*/
+	    struct TokenInst
+        {
+	    size_t NTTRuleID;			/// Non-Terminal Token Rule ID that generated Token
+	    size_t tokenID;					/// expected Token ID. Could be UNKNOWN if valid token was not found.
+	    size_t line;				/// line number in source code where Token was found
+	    size_t pos;				/// Character position in source where Token was found
+        bool found;                /// is true if expected token was found
+	    };
+
+	    typedef std::vector<TokenInst> TokenInstContainer;
+	    typedef TokenInstContainer::iterator TokenInstIterator;
+
+        // token que, definitions, rules
+        struct TokenState
+        {
+            TokenInstContainer       tokenQue;
+            LexemeTokenDefContainer  lexemeTokenDefinitions;
+	        TokenRuleContainer       rootRulePath;
+            LexemeTokenMap           lexemeTokenMap;
+        };
+
+        TokenState* mClientTokenState;
+
+	    /// Active token que, definitions, rules currntly being used by parser
+        TokenState* mActiveTokenState;
+        /// the location within the token instruction container where pass 2 is
+        mutable size_t mPass2TokenQuePosition;
+        /** the que position of the previous token that had an action.
+            A token's action is fired on the next token having an action.
+        */
+        size_t mPreviousActionQuePosition;
+        /** the que position for the next token that has an action.
+        */
+        size_t mNextActionQuePosition;
+
+	    /// pointer to the source to be compiled
+	    const String* mSource;
+	    /// name of the source to be compiled
+	    String mSourceName;
+	    size_t mEndOfSource;
+
+	    size_t mCurrentLine; /// current line number in source being tokenized
+        size_t mCharPos;     /// position in current line in source being tokenized
+        size_t mErrorCharPos; /// character position in source where last error occured
+
+	    /// storage container for constants defined in source
+        /// container uses Token index as a key associated with a float constant
+	    std::map<size_t, float> mConstants;
+	    /// storage container for string labels defined in source
+        /// container uses Token index as a key associated with a label
+        typedef std::map<size_t, String> LabelContainer;
+        LabelContainer mLabels;
+        /// flag indicates when a label is being parsed.
+        /// It gets set false when a terminal token not of _character_ is encountered
+        bool mLabelIsActive;
+        /// the key of the active label being built during pass 1.
+        /// a new key is calculated when mLabelIsActive switches from false to true
+        size_t mActiveLabelKey;
+        /// The active label that is receiving characters during pass 1.
+        String* mActiveLabel;
+        /// flag being true indicates that spaces are not to be skipped
+        /// automatically gets set to false when mLabelIsActive goes to false
+        bool mNoSpaceSkip;
+        /// if flag is true then next terminal token is not added to token que if found
+        /// but does effect rule path flow
+        bool mNoTerminalToken;
+        /// TokenID to insert if next rule finds a terminal token
+        /// if zero then no token inserted
+        size_t mInsertTokenID;
+
+	    /// Active Contexts pattern used in pass 1 to determine which tokens are valid for a certain context
+	    uint mActiveContexts;
+
+	    /** perform pass 1 of compile process
+		    scans source for lexemes that can be tokenized and then
+		    performs general semantic and context verification on each lexeme before it is tokenized.
+		    A tokenized instruction list is built to be used by Pass 2.
+            A rule path can trigger Pass 2 execution if enough tokens have been generated in Pass 1.
+            Pass 1 will then pass control to pass 2 temporarily until the current tokens have been consumed.
+
+	    */
+	    bool doPass1();
+
+	    /** performs Pass 2 of compile process which is execution of the tokens
+	    @remark
+		    Pass 2 takes the token instructions generated in Pass 1 and
+		    builds the application specific instructions along with verifying
+		    symantic and context rules that could not be checked in Pass 1.
+        @par
+            Pass 2 execution consumes tokens and moves the Pass 2 token instruction position towards the end
+            of the token container.  Token execution can insert new tokens into the token container.
+	    */
+	    bool doPass2();
+
+        /** execute the action associated with the token pointed to by the Pass 2 token instruction position.
+        @remarks
+            Its upto the child class to implement how it will associate a token key with and action.
+            Actions should be placed at positions withing the BNF grammer (instruction que) that indicate
+            enough tokens exist for pass 2 processing to take place.
+        */
+        virtual void executeTokenAction(const size_t tokenID) = 0;
+        /** Get the start ID for auto generated token IDs.  This is also one pass the end of manually set token IDs.
+            Manually set Token ID are usually setup in the client code through an enum type so its best to make the
+            last entry the auto ID start position and return this enum value.
+            This method gets called automatically just prior to setupTokenDefinitions() to ensure that any tokens that are auto generated are placed after
+            the manually set ones.
+        */
+        virtual size_t getAutoTokenIDStart() const = 0;
+        /** setup client token definitions.  Gets called when BNF grammer is being setup.
+        */
+        virtual void setupTokenDefinitions(void) = 0;
+        /** Gets the next token from the instruction que.
+        @remarks
+            If an unkown token is found then an exception is raised but
+            the instruction pointer is still moved passed the unknown token.  The subclass should catch the exception,
+            provide an error message, and attempt recovery.
+
+        @param expectedTokenID if greater than 0 then an exception is raised if tokenID does not match.
+        */
+        const TokenInst& getNextToken(const size_t expectedTokenID = 0) const
+        {
+            skipToken();
+            return getCurrentToken(expectedTokenID);
+        }
+        /** Gets the current token from the instruction que.
+        @remarks
+            If an unkown token is found then an exception is raised.
+            The subclass should catch the exception, provide an error message, and attempt recovery.
+
+        @param expectedTokenID if greater than 0 then an exception is raised if tokenID does not match.
+
+        */
+        const TokenInst& getCurrentToken(const size_t expectedTokenID = 0) const;
+        /** If a next token instruction exist then test if its token ID matches.
+        @remarks
+            This method is usefull for peeking ahead during pass 2 to see if a certain
+            token exists.  If the tokens don't match or there is no next token (end of que)
+            then false is returned.
+        @param expectedTokenID is the ID of the token to match.
+        */
+        bool testNextTokenID(const size_t expectedTokenID) const;
+
+        /** If a current token instruction exist then test if its token ID matches.
+        @param expectedTokenID is the ID of the token to match.
+        */
+        bool testCurrentTokenID(const size_t expectedTokenID) const
+        {
+            return mActiveTokenState->tokenQue[mPass2TokenQuePosition].tokenID == expectedTokenID;
+        }
+        /** skip to the next token in the pass2 queue.
+        */
+        void skipToken(void) const;
+        /** go back to the previous token in the pass2 queue.
+        */
+        void replaceToken(void);
+        /** Gets the next token's associated floating point value in the instruction que that was parsed from the
+            text source.  If an unkown token is found or no associated value was found then an exception is raised but
+            the instruction pointer is still moved passed the unknown token.  The subclass should catch the exception,
+            provide an error message, and attempt recovery.
+        */
+        float getNextTokenValue(void) const
+        {
+            skipToken();
+            return getCurrentTokenValue();
+        }
+        /** Gets the current token's associated floating point value in the instruction que that was parsed from the
+            text source.
+        @remarks
+            If an unkown token is found or no associated value was found then an exception is raised.
+            The subclass should catch the exception, provide an error message, and attempt recovery.
+        */
+        float getCurrentTokenValue(void) const;
+        /** Gets the next token's associated text label in the instruction que that was parsed from the
+            text source.
+        @remarks
+            If an unkown token is found or no associated label was found then an exception is raised but
+            the instruction pointer is still moved passed the unknown token.  The subclass should catch the exception,
+            provide an error message, and attempt recovery.
+        */
+        const String& getNextTokenLabel(void) const
+        {
+            skipToken();
+            return getCurrentTokenLabel();
+        }
+        /** Gets the next token's associated text label in the instruction que that was parsed from the
+            text source.  If an unkown token is found or no associated label was found then an exception is raised.
+            The subclass should catch the exception, provide an error message, and attempt recovery.
+        */
+        const String& getCurrentTokenLabel(void) const;
+        /** Get the next token's ID value.
+        */
+        size_t getNextTokenID(void) const { return getNextToken().tokenID; }
+        /** Get the current token's ID value.
+        */
+        size_t getCurrentTokenID(void) const { return getCurrentToken().tokenID; }
+        /** Get the next token's lexeme string.  Handy when you don't want the ID but want the string
+            representation.
+        */
+        const String& getNextTokenLexeme(void) const
+        {
+            skipToken();
+            return getCurrentTokenLexeme();
+        }
+        /** Get the current token's lexeme string.  Handy when you don't want the ID but want the string
+            representation.
+        */
+        const String& getCurrentTokenLexeme(void) const;
+        /** Gets the number of tokens waiting in the instruction que that need to be processed by an token action in pass 2.
+        */
+        size_t getPass2TokenQueCount(void) const;
+        /** Get the number of tokens not processed by action token.
+            Client Actions should use this method to retreive the number of parameters(tokens)
+            remaining to be processed in the action.
+        */
+        size_t getRemainingTokensForAction(void) const;
+        /** Manualy set the Pass2 Token que position.
+        @remarks
+            This method will also set the position of the next token in the pass2 que that
+            has an action ensuring that getRemainingTokensForAction works currectly.
+            This method is useful for when the token que must be reprocessed after
+            pass1 and the position in the que must be changed so that an action will be triggered.
+        @param pos is the new position within the Pass2 que
+        @param activateAction if set true and the token at the new position has an action then the
+            action is activated.
+        */
+        void setPass2TokenQuePosition(size_t pos, const bool activateAction = false);
+        /** Get the current position in the Pass2 Token Que.
+        */
+        size_t getPass2TokenQuePosition(void) const { return mPass2TokenQuePosition; }
+        /** Set the position of the next token action in the Pass2 Token Que.
+        @remarks
+            If the position is not within the que or there is no action associated with
+            the token at the position in the que then NextActionQuePosition is not set.
+        @param pos is the position in the Pass2 Token Que where the next action is.
+        @param search if true then the que is searched from pos until an action is found.
+            If the end of the que is reached and no action has been found then NextActionQuePosition
+            is set to the end of the que and false is returned.
+        */
+        bool setNextActionQuePosition(size_t pos, const bool search = false);
+        /** Add a lexeme token association.
+        @remarks
+            The backend compiler uses the associations between lexeme and token when
+            building the rule base from the BNF script so all associations must  be done
+            prior to compiling a source.
+        @param lexeme is the name of the token and use when parsing the source to determin a match for a token.
+        @param token is the ID associated with the lexeme. If token is 0 then the token ID is auto generated and returned.
+        @param hasAction must be set true if the client wants an action triggered when this token is generated
+        @param caseSensitive should be set true if lexeme match should use case sensitivity
+        @return the ID of the token.  Useful when auto generating token IDs.
+        */
+        size_t addLexemeToken(const String& lexeme, const size_t token, const bool hasAction = false, const bool caseSensitive = false);
+
+        /** Sets up the parser rules for the client based on the BNF Grammer text passed in.
+        @remarks
+            Raises an exception if the grammer did not compile successfully.  This method gets called
+            when a call to compile occurs and no compiled BNF grammer exists, otherwise nothing will happen since the compiler has no rules to work
+            with.  The grammer only needs to be set once during the lifetime of the compiler unless the
+            grammer changes.
+        @note
+            BNF Grammer rules are cached once the BNF grammer source is compiled.
+            The client should never have to call this method directly.
+        */
+        void setClientBNFGrammer(void);
+
+
+
+        /// find the eol charater
+	    void findEOL();
+
+	    /** check to see if the text at the present position in the source is a numerical constant
+	    @param fvalue is a reference that will receive the float value that is in the source
+	    @param charsize reference to receive number of characters that make of the value in the source
+	    @return
+		    true if characters form a valid float representation
+		    false if a number value could not be extracted
+	    */
+	    bool isFloatValue(float& fvalue, size_t& charsize) const;
+
+        /** Check if source at current position is supposed to be a user defined character label.
+        A new label is processed when previous operation was not _character_ otherwise the processed
+        character (if match was found) is added to the current label.  This allows _character_ operations
+        to be chained together to form a crude regular expression to build a label.
+	    @param rulepathIDX index into rule path database of token to validate.
+	    @return
+		    true if token was found for character label.
+        */
+        bool isCharacterLabel(const size_t rulepathIDX);
+	    /** check to see if the text is in the lexeme text library
+	    @param lexeme points to begining of text where a lexem token might exist
+	    @param caseSensitive set to true if match should be case sensitive
+	    @return
+		    true if a matching token could be found in the token type library
+		    false if could not be tokenized
+	    */
+	    bool isLexemeMatch(const String& lexeme, const bool caseSensitive) const;
+	    /// Check if pass 1 has parsed to the end of the source
+	    bool isEndOfSource() const { return mCharPos >= mEndOfSource; }
+	    /// position to the next possible valid sysmbol
+	    bool positionToNextLexeme();
+	    /** process input source text using rulepath to determine allowed tokens
+	    @remarks
+		    the method is reentrant and recursive
+		    if a non-terminal token is encountered in the current rule path then the method is
+		    called using the new rule path referenced by the non-terminal token
+		    Tokens can have the following operation states which effects the flow path of the rule
+			    RULE: defines a rule path for the non-terminal token
+			    AND: the token is required for the rule to pass
+			    OR: if the previous tokens failed then try these ones
+			    OPTIONAL: the token is optional and does not cause the rule to fail if the token is not found
+			    REPEAT: the token is required but there can be more than one in a sequence
+                DATA: Used by a previous token ie for character sets
+                NOTTEST: performs negative lookahead ie make sure the next token is not of a certain type
+			    END: end of the rule path - the method returns the succuss of the rule
+
+	    @param rulepathIDX index into an array of Token Rules that define a rule path to be processed
+	    @return
+		    true if rule passed - all required tokens found
+		    false if one or more tokens required to complete the rule were not found
+	    */
+	    bool processRulePath( size_t rulepathIDX);
+
+
+	    /** setup ActiveContexts - should be called by subclass to setup initial language contexts
+        */
+	    void setActiveContexts(const uint contexts){ mActiveContexts = contexts; }
+
+	    /// comment specifiers are hard coded
+	    void skipComments();
+
+	    /// find end of line marker and move past it
+	    void skipEOL();
+
+	    /// skip all the white space which includes spaces and tabs
+	    void skipWhiteSpace();
+
+
+	    /** check if current position in source has the lexeme text equivalent to the TokenID
+	    @param rulepathIDX index into rule path database of token to validate
+	    @param activeRuleID index of non-terminal rule that generated the token
+	    @return
+		    true if token was found
+		    false if token lexeme text does not match the source text
+		    if token is non-terminal then processRulePath is called
+	    */
+	    bool ValidateToken(const size_t rulepathIDX, const size_t activeRuleID);
+
+	    /** scan through all the rules and initialize token definition with index to rules for non-terminal tokens.
+            Gets called when internal grammer is being verified or after client grammer has been parsed.
+        @param grammerName is the name of the grammer the token rules are for
+	    */
+	    void verifyTokenRuleLinks(const String& grammerName);
+	    /** Checks the last token instruction and if it has an action then it triggers the action of the previously
+            found token having an action.
+	    */
+	    void checkTokenActionTrigger(void);
+	    /** Get the text representation of the rule path.  This is a good way to way to visually verify
+	    that the BNF grammer did compile correctly.
+	    @param ruleID is the index into the rule path.
+	    @param level is the number of levels a non-terminal will expand to. Defaults to 0 if not set which
+            will cause non-terminals to not expand.
+	    */
+	    String getBNFGrammerTextFromRulePath(size_t ruleID, const size_t level = 0);
+
+
+    private:
+        // used for interpreting BNF script
+        // keep it as static so that only one structure is created
+        // no matter how many times this class is instantiated.
+        static TokenState mBNFTokenState;
+        // maintain a map of BNF grammer
+        typedef std::map<String, TokenState> TokenStateContainer;
+        static TokenStateContainer mClientTokenStates;
+        /// if a previous token action was setup then activate it now
+        void activatePreviousTokenAction(void);
+        /// initialize token definitions and rule paths
+        void initBNFCompiler(void);
+        /// Convert BNF grammer token que created in pass 1 into a BNF rule path
+        void buildClientBNFRulePaths(void);
+        /// modify the last rule in the container. An end operation is added to the rule path.
+        void modifyLastRule(const OperationType pendingRuleOp, const size_t tokenID);
+        /** get the token ID for a lexeme in the client state. If the lexeme is not found then
+            it is added to the map and definition container and a new tokenID created.
+        @return the ID of the token.
+        */
+        size_t getClientLexemeTokenID(const String& lexeme, const bool isCaseSensitive = false);
+        /// Extract a Non Terminal identifier from the token que
+        void extractNonTerminal(const OperationType pendingRuleOp);
+        /// Extract a Terminal lexeme from the token que and add to current rule expression
+        void extractTerminal(const OperationType pendingRuleOp, const bool notoken = false);
+        /// Extract a set from the token que and add to current rule expression
+        void extractSet(const OperationType pendingRuleOp);
+        /// Extract a numeric constant from the token que and add it to the current rule expression
+        void extractNumericConstant(const OperationType pendingRuleOp);
+        /// changes previous terminal token rule into a conditional terminal token insert rule
+        void setConditionalTokenInsert(void);
+        /// get the lexeme text of a rule.
+        String getLexemeText(size_t& ruleID, const size_t level = 0);
+
+
+    public:
+
+	    /// constructor
+	    Compiler2Pass();
+        virtual ~Compiler2Pass() {}
+
+	    /** compile the source - performs 2 passes.
+		    First pass is to tokinize, check semantics and context.
+		    The second pass is performed by using tokens to look up function implementors and executing
+            them which convert tokens to application specific instructions.
+	    @remark
+		    Pass 2 only gets executed if Pass 1 has built enough tokens to complete a rule path and found no errors
+	    @param source a pointer to the source text to be compiled
+	    @return
+		    true if Pass 1 and Pass 2 are successfull
+		    false if any errors occur in Pass 1 or Pass 2
+	    */
+	    bool compile(const String& source, const String& sourceName);
+        /** gets BNF Grammer.  Gets called when BNF grammer has to be compiled for the first time.
+        */
+        virtual const String& getClientBNFGrammer(void) const = 0;
+
+        /** get the name of the BNF grammer.
+        */
+        virtual const String& getClientGrammerName(void) const = 0;
+
+    };
+
+}
+
+#endif
+
Index: /OgreMain/include/OgreCompositionPass.h
===================================================================
--- /OgreMain/include/OgreCompositionPass.h	(revision 5)
+++ /OgreMain/include/OgreCompositionPass.h	(revision 5)
@@ -0,0 +1,271 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __CompositionPass_H__
+#define __CompositionPass_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMaterial.h"
+#include "OgreRenderSystem.h"
+#include "OgreRenderQueue.h"
+
+namespace Ogre {
+	/** Object representing one pass or operation in a composition sequence. This provides a 
+		method to conviently interleave RenderSystem commands between Render Queues.
+	 */
+    class _OgreExport CompositionPass
+    {
+    public:
+        CompositionPass(CompositionTargetPass *parent);
+        ~CompositionPass();
+        
+        /** Enumeration that enumerates the various composition pass types.
+        */
+        enum PassType
+        {
+            PT_CLEAR,           // Clear target to one colour
+			PT_STENCIL,			// Set stencil operation
+            PT_RENDERSCENE,     // Render the scene or part of it
+            PT_RENDERQUAD       // Render a full screen quad
+        };
+        
+        /** Set the type of composition pass */
+        void setType(PassType type);
+        /** Get the type of composition pass */
+        PassType getType() const;
+        
+		/** Set an identifier for this pass. This identifier can be used to
+			"listen in" on this pass with an CompositorInstance::Listener. 
+		*/
+		void setIdentifier(uint32 id);
+		/** Get the identifier for this pass */
+		uint32 getIdentifier() const;
+
+        /** Set the material used by this pass
+			@note applies when PassType is RENDERQUAD 
+		*/
+        void setMaterial(const MaterialPtr& mat);
+        /** Set the material used by this pass 
+			@note applies when PassType is RENDERQUAD 
+		*/
+        void setMaterialName(const String &name);
+        /** Get the material used by this pass 
+			@note applies when PassType is RENDERQUAD 
+		*/
+        const MaterialPtr& getMaterial() const;
+		/** Set the first render queue to be rendered in this pass (inclusive) 
+			@note applies when PassType is RENDERSCENE
+		*/
+        void setFirstRenderQueue(uint8 id);
+		/** Get the first render queue to be rendered in this pass (inclusive) 
+			@note applies when PassType is RENDERSCENE
+		*/
+		uint8 getFirstRenderQueue();
+		/** Set the last render queue to be rendered in this pass (inclusive) 
+			@note applies when PassType is RENDERSCENE
+		*/
+        void setLastRenderQueue(uint8 id);
+		/** Get the last render queue to be rendered in this pass (inclusive) 
+			@note applies when PassType is RENDERSCENE
+		*/
+		uint8 getLastRenderQueue();
+
+		/** Would be nice to have for RENDERSCENE:
+			flags to:
+				exclude transparents
+				override material (at least -- color)
+		*/
+
+        /** Set the viewport clear buffers  (defaults to FBT_COLOUR|FBT_DEPTH)
+            @param val is a combination of FBT_COLOUR, FBT_DEPTH, FBT_STENCIL.
+			@note applies when PassType is CLEAR
+        */
+        void setClearBuffers(uint32 val);
+        /** Get the viewport clear buffers.
+			@note applies when PassType is CLEAR
+        */
+        uint32 getClearBuffers();
+        /** Set the viewport clear colour (defaults to 0,0,0,0) 
+			@note applies when PassType is CLEAR
+		 */
+        void setClearColour(ColourValue val);
+        /** Get the viewport clear colour (defaults to 0,0,0,0)	
+			@note applies when PassType is CLEAR
+		 */
+        const ColourValue &getClearColour();
+        /** Set the viewport clear depth (defaults to 1.0) 
+			@note applies when PassType is CLEAR
+		*/
+        void setClearDepth(Real depth);
+        /** Get the viewport clear depth (defaults to 1.0) 
+			@note applies when PassType is CLEAR
+		*/
+        Real getClearDepth();
+		/** Set the viewport clear stencil value (defaults to 0) 
+			@note applies when PassType is CLEAR
+		*/
+        void setClearStencil(uint32 value);
+        /** Get the viewport clear stencil value (defaults to 0) 
+			@note applies when PassType is CLEAR
+		*/
+        uint32 getClearStencil();
+
+		/** Set stencil check on or off.
+			@note applies when PassType is STENCIL
+		*/
+		void setStencilCheck(bool value);
+		/** Get stencil check enable.
+			@note applies when PassType is STENCIL
+		*/
+		bool getStencilCheck();
+		/** Set stencil compare function.
+			@note applies when PassType is STENCIL
+		*/
+		void setStencilFunc(CompareFunction value); 
+		/** Get stencil compare function.
+			@note applies when PassType is STENCIL
+		*/
+		CompareFunction getStencilFunc(); 
+		/** Set stencil reference value.
+			@note applies when PassType is STENCIL
+		*/
+		void setStencilRefValue(uint32 value);
+		/** Get stencil reference value.
+			@note applies when PassType is STENCIL
+		*/
+		uint32 getStencilRefValue();
+		/** Set stencil mask.
+			@note applies when PassType is STENCIL
+		*/
+		void setStencilMask(uint32 value);
+		/** Get stencil mask.
+			@note applies when PassType is STENCIL
+		*/
+		uint32 getStencilMask();
+		/** Set stencil fail operation.
+			@note applies when PassType is STENCIL
+		*/
+		void setStencilFailOp(StencilOperation value);
+		/** Get stencil fail operation.
+			@note applies when PassType is STENCIL
+		*/
+		StencilOperation getStencilFailOp();
+		/** Set stencil depth fail operation.
+			@note applies when PassType is STENCIL
+		*/
+		void setStencilDepthFailOp(StencilOperation value);
+		/** Get stencil depth fail operation.
+			@note applies when PassType is STENCIL
+		*/
+		StencilOperation getStencilDepthFailOp();
+		/** Set stencil pass operation.
+			@note applies when PassType is STENCIL
+		*/
+		void setStencilPassOp(StencilOperation value);
+		/** Get stencil pass operation.
+			@note applies when PassType is STENCIL
+		*/
+		StencilOperation getStencilPassOp();
+		/** Set two sided stencil operation.
+			@note applies when PassType is STENCIL
+		*/
+		void setStencilTwoSidedOperation(bool value);
+		/** Get two sided stencil operation.
+			@note applies when PassType is STENCIL
+		*/
+		bool getStencilTwoSidedOperation();
+
+        /** Set an input local texture. An empty string clears the input.
+            @param id    Input to set. Must be in 0..OGRE_MAX_TEXTURE_LAYERS-1
+            @param input Which texture to bind to this input. An empty string clears the input.
+			@note applies when PassType is RENDERQUAD 
+        */
+        void setInput(size_t id, const String &input="");
+        
+        /** Get the value of an input.
+            @param id    Input to get. Must be in 0..OGRE_MAX_TEXTURE_LAYERS-1.
+			@note applies when PassType is RENDERQUAD 
+        */
+        const String &getInput(size_t id);
+        
+        /** Get the number of inputs used.
+			@note applies when PassType is RENDERQUAD 
+        */
+        size_t getNumInputs();
+        
+        /** Clear all inputs.
+			@note applies when PassType is RENDERQUAD 
+        */
+        void clearAllInputs();
+        
+        /** Get parent object 
+			@note applies when PassType is RENDERQUAD 
+		*/
+        CompositionTargetPass *getParent();
+
+        /** Determine if this target pass is supported on the current rendering device. 
+         */
+        bool _isSupported(void);
+
+    private:
+        /// Parent technique
+        CompositionTargetPass *mParent;
+        /// Type of composition pass
+        PassType mType;
+		/// Identifier for this pass
+		uint32 mIdentifier;
+        /// Material used for rendering
+        MaterialPtr mMaterial;
+        /// [first,last] render queue to render this pass (in case of PT_RENDERSCENE)
+		uint8 mFirstRenderQueue;
+		uint8 mLastRenderQueue;
+        /// Clear buffers (in case of PT_CLEAR)
+        uint32 mClearBuffers;
+        /// Clear colour (in case of PT_CLEAR)
+        ColourValue mClearColour;
+		/// Clear depth (in case of PT_CLEAR)
+		Real mClearDepth;
+		/// Clear stencil value (in case of PT_CLEAR)
+		uint32 mClearStencil;
+        /// Inputs (for material used for rendering the quad)
+        /// An empty string signifies that no input is used
+        String mInputs[OGRE_MAX_TEXTURE_LAYERS];
+		/// Stencil operation parameters
+		bool mStencilCheck;
+		CompareFunction mStencilFunc; 
+		uint32 mStencilRefValue;
+		uint32 mStencilMask;
+		StencilOperation mStencilFailOp;
+		StencilOperation mStencilDepthFailOp;
+		StencilOperation mStencilPassOp;
+		bool mStencilTwoSidedOperation;
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgreCompositionTargetPass.h
===================================================================
--- /OgreMain/include/OgreCompositionTargetPass.h	(revision 5)
+++ /OgreMain/include/OgreCompositionTargetPass.h	(revision 5)
@@ -0,0 +1,167 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __CompositionTargetPass_H__
+#define __CompositionTargetPass_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre {
+	/** Object representing one render to a RenderTarget or Viewport in the Ogre Composition
+		framework.
+	 */
+    class _OgreExport CompositionTargetPass
+    {
+    public:
+        CompositionTargetPass(CompositionTechnique *parent);
+        ~CompositionTargetPass();
+        
+        /** Input mode of a TargetPass
+        */
+        enum InputMode
+        {
+            IM_NONE,        // No input
+            IM_PREVIOUS     // Output of previous Composition in chain
+        };
+        typedef std::vector<CompositionPass *> Passes;
+        typedef VectorIterator<Passes> PassIterator;
+        
+        /** Set input mode of this TargetPass
+        */
+        void setInputMode(InputMode mode);
+        /** Get input mode */
+        InputMode getInputMode() const;
+        
+        /** Set output local texture name */
+        void setOutputName(const String &out);
+        /** Get output local texture name */
+        const String &getOutputName() const;
+        
+        /** Set "only initial" flag. This makes that this target pass is only executed initially 
+            after the effect has been enabled.
+        */
+        void setOnlyInitial(bool value);
+        /** Get "only initial" flag.
+        */
+        bool getOnlyInitial();
+        
+        /** Set the scene visiblity mask used by this pass 
+        */
+        void setVisibilityMask(uint32 mask);
+        /** Get the scene visiblity mask used by this pass 
+        */
+        uint32 getVisibilityMask();
+
+		/** Set the material scheme used by this target pass.
+		@remarks
+			Only applicable to targets that render the scene as
+			one of their passes.
+			@see Technique::setScheme.
+		*/
+		void setMaterialScheme(const String& schemeName);
+		/** Get the material scheme used by this target pass.
+		@remarks
+			Only applicable to targets that render the scene as
+			one of their passes.
+			@see Technique::setScheme.
+		*/
+		const String& getMaterialScheme(void) const;
+        
+		/** Set whether shadows are enabled in this target pass.
+		@remarks
+			Only applicable to targets that render the scene as
+			one of their passes.
+		*/
+		void setShadowsEnabled(bool enabled);
+		/** Get whether shadows are enabled in this target pass.
+		@remarks
+			Only applicable to targets that render the scene as
+			one of their passes.
+		*/
+		bool getShadowsEnabled(void) const;
+        /** Set the scene LOD bias used by this pass. The default is 1.0,
+            everything below that means lower quality, higher means higher quality.
+        */
+        void setLodBias(float bias);
+        /** Get the scene LOD bias used by this pass 
+        */
+        float getLodBias();
+        
+        /** Create a new pass, and return a pointer to it.
+        */
+        CompositionPass *createPass();
+        /** Remove a pass. It will also be destroyed.
+        */
+        void removePass(size_t idx);
+        /** Get a pass.
+        */
+        CompositionPass *getPass(size_t idx);
+        /** Get the number of passes.
+        */
+        size_t getNumPasses();
+        
+        /** Remove all passes
+        */
+        void removeAllPasses();
+    
+        /** Get an iterator over the Passes in this TargetPass. */
+        PassIterator getPassIterator(void);
+        
+        /** Get parent object */
+        CompositionTechnique *getParent();
+
+        /** Determine if this target pass is supported on the current rendering device. 
+         */
+        bool _isSupported(void);
+
+    private:
+        /// Parent technique
+        CompositionTechnique *mParent;
+        /// Input name
+        InputMode mInputMode;
+        /// (local) output texture
+        String mOutputName;
+        /// Passes
+        Passes mPasses;
+        /// This target pass is only executed initially after the effect
+        /// has been enabled.
+        bool mOnlyInitial;
+        /// Visibility mask for this render
+        uint32 mVisibilityMask;
+        /// LOD bias of this render
+        float mLodBias;
+		/// Material scheme name
+		String mMaterialScheme;
+		/// Shadows option
+		bool mShadowsEnabled;
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgreCompositionTechnique.h
===================================================================
--- /OgreMain/include/OgreCompositionTechnique.h	(revision 5)
+++ /OgreMain/include/OgreCompositionTechnique.h	(revision 5)
@@ -0,0 +1,146 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __CompositionTechnique_H__
+#define __CompositionTechnique_H__
+
+#include "OgrePrerequisites.h"
+#include "OgrePixelFormat.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre {
+    /** Base composition technique, can be subclassed in plugins.
+     */
+    class _OgreExport CompositionTechnique
+    {
+    public:
+        CompositionTechnique(Compositor *parent);
+        virtual ~CompositionTechnique();
+    
+        /// Local texture definition
+        class TextureDefinition
+        {
+        public:
+            String name;
+            size_t width;       // 0 means adapt to target width
+            size_t height;      // 0 means adapt to target height
+            PixelFormat format;
+
+			TextureDefinition() :width(0), height(0), format(PF_R8G8B8A8){}
+        };
+        /// Typedefs for several iterators
+        typedef std::vector<CompositionTargetPass *> TargetPasses;
+        typedef VectorIterator<TargetPasses> TargetPassIterator;
+        typedef std::vector<TextureDefinition*> TextureDefinitions;
+        typedef VectorIterator<TextureDefinitions> TextureDefinitionIterator;
+        
+        /** Create a new local texture definition, and return a pointer to it.
+            @param name     Name of the local texture
+        */
+        TextureDefinition *createTextureDefinition(const String &name);
+        
+        /** Remove and destroy a local texture definition.
+        */
+        void removeTextureDefinition(size_t idx);
+        
+        /** Get a local texture definition.
+        */
+        TextureDefinition *getTextureDefinition(size_t idx);
+        
+        /** Get the number of local texture definitions.
+        */
+        size_t getNumTextureDefinitions();
+        
+        /** Remove all Texture Definitions
+        */
+        void removeAllTextureDefinitions();
+        
+        /** Get an iterator over the TextureDefinitions in this Technique. */
+        TextureDefinitionIterator getTextureDefinitionIterator(void);
+        
+        /** Create a new target pass, and return a pointer to it.
+        */
+        CompositionTargetPass *createTargetPass();
+        
+        /** Remove a target pass. It will also be destroyed.
+        */
+        void removeTargetPass(size_t idx);
+        
+        /** Get a target pass.
+        */
+        CompositionTargetPass *getTargetPass(size_t idx);
+        
+        /** Get the number of target passes.
+        */
+        size_t getNumTargetPasses();
+        
+        /** Remove all target passes.
+        */
+        void removeAllTargetPasses();
+        
+        /** Get an iterator over the TargetPasses in this Technique. */
+        TargetPassIterator getTargetPassIterator(void);
+        
+        /** Get output (final) target pass
+         */
+        CompositionTargetPass *getOutputTargetPass();
+        
+        /** Determine if this technique is supported on the current rendering device. 
+		@param allowTextureDegradation True to accept a reduction in texture depth
+         */
+        virtual bool isSupported(bool allowTextureDegradation);
+        
+        /** Create an instance of this technique.
+         */
+        virtual CompositorInstance *createInstance(CompositorChain *chain);
+        
+        /** Destroy an instance of this technique.
+         */
+        virtual void destroyInstance(CompositorInstance *instance);
+        
+        /** Get parent object */
+        Compositor *getParent();
+    private:
+        /// Parent compositor
+        Compositor *mParent;
+        /// Local texture definitions
+        TextureDefinitions mTextureDefinitions;
+        
+        /// Intermediate target passes
+        TargetPasses mTargetPasses;
+        /// Output target pass (can be only one)
+        CompositionTargetPass *mOutputTarget;    
+
+		/// List of instances
+		typedef std::vector<CompositorInstance *> Instances;
+		Instances mInstances;
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgreCompositor.h
===================================================================
--- /OgreMain/include/OgreCompositor.h	(revision 5)
+++ /OgreMain/include/OgreCompositor.h	(revision 5)
@@ -0,0 +1,179 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Compositor_H__
+#define __Compositor_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreResource.h"
+
+namespace Ogre {
+    /** Class representing a Compositor object. Compositors provide the means 
+        to flexibly "composite" the final rendering result from multiple scene renders
+        and intermediate operations like rendering fullscreen quads. This makes 
+        it possible to apply postfilter effects, HDRI postprocessing, and shadow 
+        effects to a Viewport.
+     */
+    class _OgreExport Compositor: public Resource
+    {
+    public:
+        Compositor(ResourceManager* creator, const String& name, ResourceHandle handle,
+            const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
+        ~Compositor();
+        
+        /// Data types for internal lists
+        typedef std::vector<CompositionTechnique *> Techniques;
+        typedef VectorIterator<Techniques> TechniqueIterator;
+        
+        /** Create a new technique, and return a pointer to it.
+        */
+        CompositionTechnique *createTechnique();
+        
+        /** Remove a technique. It will also be destroyed.
+        */
+        void removeTechnique(size_t idx);
+        
+        /** Get a technique.
+        */
+        CompositionTechnique *getTechnique(size_t idx);
+        
+        /** Get the number of techniques.
+        */
+        size_t getNumTechniques();
+        
+        /** Remove all techniques
+        */
+        void removeAllTechniques();
+        
+        /** Get an iterator over the Techniques in this compositor. */
+        TechniqueIterator getTechniqueIterator(void);
+        
+        /** Get a supported technique.
+        @remarks
+            The supported technique list is only available after this compositor has been compiled,
+            which typically happens on loading it. Therefore, if this method returns
+            an empty list, try calling Compositor::load.
+        */
+        CompositionTechnique *getSupportedTechnique(size_t idx);
+        
+        /** Get the number of supported techniques.
+        @remarks
+            The supported technique list is only available after this compositor has been compiled,
+            which typically happens on loading it. Therefore, if this method returns
+            an empty list, try calling Compositor::load.
+        */
+        size_t getNumSupportedTechniques();
+        
+        /** Gets an iterator over all the Techniques which are supported by the current card. 
+        @remarks
+            The supported technique list is only available after this compositor has been compiled,
+            which typically happens on loading it. Therefore, if this method returns
+            an empty list, try calling Compositor::load.
+        */
+        TechniqueIterator getSupportedTechniqueIterator(void);
+    protected:
+        /// @copydoc Resource::loadImpl
+        void loadImpl(void);
+
+        /// @copydoc Resource::unloadImpl
+        void unloadImpl(void);
+        /// @copydoc Resource::calculateSize
+        size_t calculateSize(void) const;
+        
+        /** Check supportedness of techniques.
+         */
+        void compile();
+    private:
+        Techniques mTechniques;
+        Techniques mSupportedTechniques;
+        
+        /// Compilation required
+        /// This is set if the techniques change and the supportedness of techniques has to be
+        /// re-evaluated.
+        bool mCompilationRequired;
+    };
+
+    /** Specialisation of SharedPtr to allow SharedPtr to be assigned to CompositorPtr 
+    @note Has to be a subclass since we need operator=.
+    We could templatise this instead of repeating per Resource subclass, 
+    except to do so requires a form VC6 does not support i.e.
+    ResourceSubclassPtr<T> : public SharedPtr<T>
+    */
+    class _OgreExport CompositorPtr : public SharedPtr<Compositor> 
+    {
+    public:
+        CompositorPtr() : SharedPtr<Compositor>() {}
+        explicit CompositorPtr(Compositor* rep) : SharedPtr<Compositor>(rep) {}
+        CompositorPtr(const CompositorPtr& r) : SharedPtr<Compositor>(r) {} 
+        CompositorPtr(const ResourcePtr& r) : SharedPtr<Compositor>()
+        {
+            // lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+                OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+                OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+                pRep = static_cast<Compositor*>(r.getPointer());
+                pUseCount = r.useCountPointer();
+                if (pUseCount)
+                {
+                    ++(*pUseCount);
+                }
+            }
+        }
+
+        /// Operator used to convert a ResourcePtr to a CompositorPtr
+        CompositorPtr& operator=(const ResourcePtr& r)
+        {
+            if (pRep == static_cast<Compositor*>(r.getPointer()))
+                return *this;
+            release();
+            // lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+                OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+                OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+                pRep = static_cast<Compositor*>(r.getPointer());
+                pUseCount = r.useCountPointer();
+                if (pUseCount)
+                {
+                    ++(*pUseCount);
+                }
+            }
+			else
+			{
+				// RHS must be a null pointer
+				assert(r.isNull() && "RHS must be null if it has no mutex!");
+				setNull();
+			}
+            return *this;
+        }
+    };
+}
+
+#endif
Index: /OgreMain/include/OgreCompositorChain.h
===================================================================
--- /OgreMain/include/OgreCompositorChain.h	(revision 5)
+++ /OgreMain/include/OgreCompositorChain.h	(revision 5)
@@ -0,0 +1,211 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __CompositorChain_H__
+#define __CompositorChain_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreRenderTargetListener.h"
+#include "OgreRenderQueueListener.h"
+#include "OgreCompositorInstance.h"
+#include "OgreCompositor.h"
+namespace Ogre {
+    
+    /** Chain of compositor effects applying to one viewport.
+     */
+    class _OgreExport CompositorChain: public RenderTargetListener
+    {
+    public:
+        CompositorChain(Viewport *vp);
+        /** Another gcc warning here, which is no problem because RenderTargetListener is never used
+            to delete an object.
+            warning: `class Ogre::CompositorChain' has virtual functions but non-virtual destructor
+        */
+        virtual ~CompositorChain();
+        
+        /// Data types
+        typedef std::vector<CompositorInstance*> Instances;
+        typedef VectorIterator<Instances> InstanceIterator;
+        
+        /// Identifier for "last" compositor in chain
+        static const size_t LAST = (size_t)-1;
+        /// Identifier for best technique
+        static const size_t BEST = 0;
+        
+        /** Apply a compositor. Initially, the filter is enabled.
+        @param filter     Filter to apply
+        @param addPosition    Position in filter chain to insert this filter at; defaults to the end (last applied filter)
+        @param technique      Technique to use; CompositorChain::BEST (default) chooses to the best one 
+                            available (first technique supported)
+        */
+        CompositorInstance* addCompositor(CompositorPtr filter, size_t addPosition=LAST, size_t technique=BEST);
+    
+        /** Remove a compositor.
+        @param position    Position in filter chain of filter to remove; defaults to the end (last applied filter)
+        */
+        void removeCompositor(size_t position=LAST);
+        
+        /** Get the number of compositors.
+        */
+        size_t getNumCompositors();
+        
+        /** Remove all compositors.
+        */
+        void removeAllCompositors();
+        
+        /** Get compositor instance by position.
+         */
+        CompositorInstance *getCompositor(size_t index);
+
+		/** Get the original scene compositor instance for this chain (internal use). 
+		*/
+		CompositorInstance* _getOriginalSceneCompositor(void) { return mOriginalScene; }
+    
+        /** Get an iterator over the compositor instances. The first compositor in this list is applied first, the last one is applied last.
+        */
+        InstanceIterator getCompositors();
+    
+        /** Enable or disable a compositor, by position. Disabling a compositor stops it from rendering
+            but does not free any resources. This can be more efficient than using removeCompositor and 
+			addCompositor in cases the filter is switched on and off a lot.
+        @param position    Position in filter chain of filter
+        */
+        void setCompositorEnabled(size_t position, bool state);
+    
+        /** @see RenderTargetListener::preRenderTargetUpdate */
+		virtual void preRenderTargetUpdate(const RenderTargetEvent& evt);
+		/** @see RenderTargetListener::preViewportUpdate */
+        virtual void preViewportUpdate(const RenderTargetViewportEvent& evt);
+        /** @see RenderTargetListener::postViewportUpdate */
+        virtual void postViewportUpdate(const RenderTargetViewportEvent& evt);
+		/** @see RenderTargetListener::viewportRemoved */
+		virtual void viewportRemoved(const RenderTargetViewportEvent& evt);
+        
+        /** Mark state as dirty, and to be recompiled next frame.
+         */
+        void _markDirty();
+        
+        /** Get viewport that is the target of this chain
+         */
+        Viewport *getViewport();
+
+		/** Remove a compositor by pointer. This is internally used by CompositionTechnique to
+			"weak" remove any instanced of a deleted technique.
+        */
+        void _removeInstance(CompositorInstance *i);
+
+		/** Internal method for registering a queued operation for deletion later **/
+		void _queuedOperation(CompositorInstance::RenderSystemOperation* op);
+
+		/** Compile this Composition chain into a series of RenderTarget operations.
+		*/
+		void _compile();
+    protected:    
+        /// Viewport affected by this CompositorChain
+        Viewport *mViewport;
+        
+        /** Plainly renders the scene; implicit first compositor in the chain.
+        */
+        CompositorInstance *mOriginalScene;
+        
+        /// Postfilter instances in this chain
+        Instances mInstances;
+        
+        /// State needs recompile
+        bool mDirty;
+		/// Any compositors enabled?
+		bool mAnyCompositorsEnabled;
+
+        /// Compiled state (updated with _compile)
+        CompositorInstance::CompiledState mCompiledState;
+        CompositorInstance::TargetOperation mOutputOperation;
+		/// Render System operations queued by last compile, these are created by this
+		/// instance thus managed and deleted by it. The list is cleared with 
+		/// clearCompilationState()
+		typedef std::vector<CompositorInstance::RenderSystemOperation*> RenderSystemOperations;
+		RenderSystemOperations mRenderSystemOperations;
+
+        
+		/** Clear compiled state */
+		void clearCompiledState();
+        
+        /** Prepare a viewport, the camera and the scene for a rendering operation
+         */
+        void preTargetOperation(CompositorInstance::TargetOperation &op, Viewport *vp, Camera *cam);
+        
+        /** Restore a viewport, the camera and the scene after a rendering operation
+         */
+        void postTargetOperation(CompositorInstance::TargetOperation &op, Viewport *vp, Camera *cam);
+
+		/// destroy internal resources
+		void destroyResources(void);
+
+		/** Render queue listener used to set up rendering events. */
+		class _OgreExport RQListener: public RenderQueueListener
+		{
+		public:
+			/** @copydoc RenderQueueListener::renderQueueStarted
+			*/
+			virtual void renderQueueStarted(uint8 id, const String& invocation, bool& skipThisQueue);
+			/** @copydoc RenderQueueListener::renderQueueEnded
+			*/
+			virtual void renderQueueEnded(uint8 id, const String& invocation, bool& repeatThisQueue);
+
+			/** Set current operation and target */
+			void setOperation(CompositorInstance::TargetOperation *op,SceneManager *sm,RenderSystem *rs);
+
+			/** Notify current destination viewport  */
+			void notifyViewport(Viewport* vp) { mViewport = vp; }
+
+			/** Flush remaining render system operations */
+			void flushUpTo(uint8 id);
+		private:
+			CompositorInstance::TargetOperation *mOperation;
+			SceneManager *mSceneManager;
+			RenderSystem *mRenderSystem;
+			Viewport* mViewport;
+			CompositorInstance::RenderSystemOpPairs::iterator currentOp, lastOp;
+		};
+		RQListener mOurListener;
+		/// Old viewport settings
+		unsigned int mOldClearEveryFrameBuffers;
+		/// Store old scene visibility mask
+		uint32 mOldVisibilityMask;
+		/// Store old find visible objects
+		bool mOldFindVisibleObjects;
+        /// Store old camera LOD bias      
+        float mOldLodBias;     
+		///	Store old viewport material scheme
+		String mOldMaterialScheme;
+		/// Store old shadows enabled flag
+		bool mOldShadowsEnabled;
+
+    };
+}
+
+#endif
Index: /OgreMain/include/OgreCompositorInstance.h
===================================================================
--- /OgreMain/include/OgreCompositorInstance.h	(revision 5)
+++ /OgreMain/include/OgreCompositorInstance.h	(revision 5)
@@ -0,0 +1,265 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __CompositorInstance_H__
+#define __CompositorInstance_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMaterial.h"
+#include "OgreTexture.h"
+#include "OgreRenderQueue.h"
+namespace Ogre {
+    const size_t RENDER_QUEUE_COUNT = RENDER_QUEUE_OVERLAY+1;       
+            
+    /** An instance of a Compositor object for one Viewport. It is part of the CompositorChain
+		for a Viewport.
+     */
+    class _OgreExport CompositorInstance
+    {
+    public:
+        CompositorInstance(Compositor *filter, CompositionTechnique *technique, CompositorChain *chain);
+        virtual ~CompositorInstance();
+		/** Provides an interface to "listen in" to to render system operations executed by this 
+			CompositorInstance.
+		*/
+		class _OgreExport Listener
+		{
+		public:
+			virtual ~Listener();
+
+			/** Notification of when a render target operation involving a material (like
+				rendering a quad) is compiled, so that miscelleneous parameters that are different
+				per Compositor instance can be set up.
+				@param pass_id	Pass identifier within Compositor instance, this is speficied 
+								by the user by CompositionPass::setIdentifier().
+				@param mat		Material, this may be changed at will and will only affect
+								the current instance of the Compositor, not the global material
+								it was cloned from.
+			 */
+			virtual void notifyMaterialSetup(uint32 pass_id, MaterialPtr &mat);
+
+			/** Notification before a render target operation involving a material (like
+				rendering a quad), so that material parameters can be varied.
+				@param pass_id	Pass identifier within Compositor instance, this is speficied 
+								by the user by CompositionPass::setIdentifier().
+				@param mat		Material, this may be changed at will and will only affect
+								the current instance of the Compositor, not the global material
+								it was cloned from.
+			 */
+			virtual void notifyMaterialRender(uint32 pass_id, MaterialPtr &mat);
+		};
+        /** Specific render system operation. A render target operation does special operations
+		    between render queues like rendering a quad, clearing the frame buffer or 
+			setting stencil state.
+		*/
+		class RenderSystemOperation
+		{
+		public:
+			virtual ~RenderSystemOperation();
+			/// Set state to SceneManager and RenderSystem
+			virtual void execute(SceneManager *sm, RenderSystem *rs) = 0;
+		};
+		typedef std::map<int, MaterialPtr> QuadMaterialMap;
+		typedef std::pair<int, RenderSystemOperation*> RenderSystemOpPair;
+		typedef std::vector<RenderSystemOpPair> RenderSystemOpPairs;
+        /** Operation setup for a RenderTarget (collected).
+        */
+        class TargetOperation
+        {
+        public:
+            TargetOperation()
+            { 
+            }
+            TargetOperation(RenderTarget *target):
+                target(target), currentQueueGroupID(0), visibilityMask(0xFFFFFFFF),
+                lodBias(1.0f),
+                onlyInitial(false), hasBeenRendered(false), findVisibleObjects(false), 
+				shadowsEnabled(true)
+            { 
+            }
+            /// Target
+            RenderTarget *target;
+
+			/// Current group ID
+			int currentQueueGroupID;
+
+			/// RenderSystem operations to queue into the scene manager, by
+			/// uint8
+			RenderSystemOpPairs renderSystemOperations;
+
+			/// Scene visibility mask
+            /// If this is 0, the scene is not rendered at all
+            uint32 visibilityMask;
+            
+            /// LOD offset. This is multiplied with the camera LOD offset
+            /// 1.0 is default, lower means lower detail, higher means higher detail
+            float lodBias;
+            
+            /** A set of render queues to either include or exclude certain render queues.
+	 		*/
+            typedef std::bitset<RENDER_QUEUE_COUNT> RenderQueueBitSet;
+
+			/// Which renderqueues to render from scene
+			RenderQueueBitSet renderQueues;
+            
+            /** @see CompositionTargetPass::mOnlyInitial
+            */
+            bool onlyInitial;
+            /** "Has been rendered" flag; used in combination with
+                onlyInitial to determine whether to skip this target operation.
+            */
+            bool hasBeenRendered;
+            /** Whether this op needs to find visible scene objects or not 
+            */
+            bool findVisibleObjects;
+			/** Which material scheme this op will use */
+			String materialScheme;
+			/** Whether shadows will be enabled */
+			bool shadowsEnabled;
+        };
+        typedef std::vector<TargetOperation> CompiledState;
+        
+        /** Set enabled flag. The compositor instance will only render if it is
+            enabled, otherwise it is pass-through.
+        */
+        void setEnabled(bool value);
+        
+        /** Get enabled flag.
+        */
+        bool getEnabled();
+
+		/** Get the instance name for a local texture.
+		@note It is only valid to call this when local textures have been loaded, 
+			which in practice means that the compositor instance is active. Calling
+			it at other times will cause an exception. Note that since textures
+			are cleaned up aggressively, this name is not guaranteed to stay the
+			same if you disable and renable the compositor instance.
+		@param name The name of the texture in the original compositor definition
+		@returns The instance name for the texture, corresponds to a real texture
+		*/
+		const String& getTextureInstanceName(const String& name);
+
+       
+        /** Recursively collect target states (except for final Pass).
+            @param compiledState    This vector will contain a list of TargetOperation objects
+        */
+        virtual void _compileTargetOperations(CompiledState &compiledState);
+        
+        /** Compile the final (output) operation. This is done seperately because this
+            is combined with the input in chained filters.
+        */
+        virtual void _compileOutputOperation(TargetOperation &finalState);
+        
+        /** Get Compositor of which this is an instance
+        */
+        Compositor *getCompositor();
+        
+        /** Get CompositionTechnique used by this instance
+        */
+        CompositionTechnique *getTechnique();
+
+		/** Get Chain that this instance is part of
+        */
+        CompositorChain *getChain();
+
+		/** Add a listener. Listeners provide an interface to "listen in" to to render system 
+			operations executed by this CompositorInstance so that materials can be 
+			programmatically set up.
+			@see CompositorInstance::Listener
+		*/
+		void addListener(Listener *l);
+
+		/** Remove a listener.
+			@see CompositorInstance::Listener
+		*/
+		void removeListener(Listener *l);
+
+		/** Notify listeners of a material compilation.
+		*/
+		void _fireNotifyMaterialSetup(uint32 pass_id, MaterialPtr &mat);
+
+		/** Notify listeners of a material render.
+		*/
+		void _fireNotifyMaterialRender(uint32 pass_id, MaterialPtr &mat);
+	private:
+        /// Compositor of which this is an instance
+        Compositor *mCompositor;
+        /// Composition technique used by this instance
+        CompositionTechnique *mTechnique;
+        /// Composition chain of which this instance is part
+        CompositorChain *mChain;
+        /// Is this instance enabled?
+        bool mEnabled;
+        /// Map from name->local texture
+        typedef std::map<String,TexturePtr> LocalTextureMap;
+        LocalTextureMap mLocalTextures;
+
+		/// Vector of listeners
+		typedef std::vector<Listener*> Listeners;
+		Listeners mListeners;
+        
+        /// Previous instance (set by chain)
+        CompositorInstance *mPreviousInstance;
+		
+		/** Collect rendering passes. Here, passes are converted into render target operations
+			and queued with queueRenderSystemOp.
+        */
+        virtual void collectPasses(TargetOperation &finalState, CompositionTargetPass *target);
+        
+        /** Create a local dummy material with one technique but no passes.
+            The material is detached from the Material Manager to make sure it is destroyed
+			when going out of scope.
+        */
+        MaterialPtr createLocalMaterial();
+        
+        /** Create local rendertextures and other resources. Builds mLocalTextures.
+        */
+        void createResources();
+        
+        /** Destroy local rendertextures and other resources.
+        */
+        void freeResources();
+
+        /** Get RenderTarget for a named local texture.
+        */
+        RenderTarget *getTargetForTex(const String &name);
+        
+        /** Get source texture name for a named local texture.
+        */
+        const String &getSourceForTex(const String &name);
+
+		/** Queue a render system operation.
+			@returns destination pass
+		 */
+		void queueRenderSystemOp(TargetOperation &finalState, RenderSystemOperation *op);
+        
+        friend class CompositorChain;
+    };
+}
+
+#endif
Index: /OgreMain/include/OgreCompositorManager.h
===================================================================
--- /OgreMain/include/OgreCompositorManager.h	(revision 5)
+++ /OgreMain/include/OgreCompositorManager.h	(revision 5)
@@ -0,0 +1,170 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __CompositorManager_H__
+#define __CompositorManager_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreResourceManager.h"
+#include "OgreCompositor.h"
+#include "OgreRectangle2D.h"
+#include "OgreCompositorSerializer.h"
+
+#if OGRE_THREAD_SUPPORT
+// boost::thread_specific_ptr has 'new' in header but delete in lib
+// so if we use our memory manager it reports leaks incorrectly
+#	include "OgreNoMemoryMacros.h"
+#	include <boost/thread/tss.hpp>
+#	include "OgreMemoryMacros.h"
+#endif
+
+namespace Ogre {
+    /** Class for managing Compositor settings for Ogre. Compositors provide the means
+        to flexibly "composite" the final rendering result from multiple scene renders
+        and intermediate operations like rendering fullscreen quads. This makes
+        it possible to apply postfilter effects, HDRI postprocessing, and shadow
+        effects to a Viewport.
+        @par
+            When loaded from a script, a Compositor is in an 'unloaded' state and only stores the settings
+            required. It does not at that stage load any textures. This is because the material settings may be
+            loaded 'en masse' from bulk material script files, but only a subset will actually be required.
+        @par
+            Because this is a subclass of ResourceManager, any files loaded will be searched for in any path or
+            archive added to the resource paths/archives. See ResourceManager for details.
+    */
+    class _OgreExport CompositorManager : public ResourceManager, public Singleton<CompositorManager>
+    {
+    public:
+        CompositorManager();
+        virtual ~CompositorManager();
+
+        /// Overridden from ResourceManager
+        Resource* createImpl(const String& name, ResourceHandle handle,
+            const String& group, bool isManual, ManualResourceLoader* loader,
+            const NameValuePairList* params);
+
+        /** Intialises the Compositor manager, which also triggers it to
+            parse all available .compositor scripts. */
+        void initialise(void);
+
+        /** @see ScriptLoader::parseScript
+        */
+        void parseScript(DataStreamPtr& stream, const String& groupName);
+
+        /** Get the compositor chain for a Viewport. If there is none yet, a new
+			compositor chain is registered.
+			XXX We need a _notifyViewportRemoved to find out when this viewport disappears,
+			so we can destroy its chain as well.
+        */
+        CompositorChain *getCompositorChain(Viewport *vp);
+
+		/** Returns whether exists compositor chain for a viewport.
+        */
+		bool hasCompositorChain(Viewport *vp) const;
+
+		/** Remove the compositor chain from a viewport if exists.
+		*/
+        void removeCompositorChain(Viewport *vp);
+
+		/** Add a compositor to a viewport. By default, it is added to end of the chain,
+			after the other compositors.
+			@param vp			Viewport to modify
+			@param compositor	The name of the compositor to apply
+			@param addPosition	At which position to add, defaults to the end (-1).
+			@returns pointer to instance, or 0 if it failed.
+		*/
+		CompositorInstance *addCompositor(Viewport *vp, const String &compositor, int addPosition=-1);
+
+		/** Remove a compositor from a viewport
+		*/
+		void removeCompositor(Viewport *vp, const String &compositor);
+
+		/** Set the state of a compositor on a viewport to enabled or disabled.
+			Disabling a compositor stops it from rendering but does not free any resources.
+			This can be more efficient than using removeCompositor and addCompositor in cases
+			the filter is switched on and off a lot.
+		*/
+		void setCompositorEnabled(Viewport *vp, const String &compositor, bool value);
+
+		/** Get a textured fullscreen 2D rectangle, for internal use.
+		*/
+		Renderable *_getTexturedRectangle2D();
+
+		/** Overridden from ResourceManager since we have to clean up chains too. */
+		void removeAll(void);
+
+		/** Override standard Singleton retrieval.
+		@remarks
+		Why do we do this? Well, it's because the Singleton
+		implementation is in a .h file, which means it gets compiled
+		into anybody who includes it. This is needed for the
+		Singleton template to work, but we actually only want it
+		compiled into the implementation of the class based on the
+		Singleton, not all of them. If we don't change this, we get
+		link errors when trying to use the Singleton-based class from
+		an outside dll.
+		@par
+		This method just delegates to the template version anyway,
+		but the implementation stays in this single compilation unit,
+		preventing link errors.
+		*/
+		static CompositorManager& getSingleton(void);
+		/** Override standard Singleton retrieval.
+		@remarks
+		Why do we do this? Well, it's because the Singleton
+		implementation is in a .h file, which means it gets compiled
+		into anybody who includes it. This is needed for the
+		Singleton template to work, but we actually only want it
+		compiled into the implementation of the class based on the
+		Singleton, not all of them. If we don't change this, we get
+		link errors when trying to use the Singleton-based class from
+		an outside dll.
+		@par
+		This method just delegates to the template version anyway,
+		but the implementation stays in this single compilation unit,
+		preventing link errors.
+		*/
+		static CompositorManager* getSingletonPtr(void);
+
+	
+	private:
+        typedef std::map<Viewport*, CompositorChain*> Chains;
+        Chains mChains;
+
+		/// Serializer - Hold instance per thread if necessary
+		OGRE_THREAD_POINTER(CompositorSerializer, mSerializer);
+
+        /** Clear composition chains for all viewports
+         */
+        void freeChains();
+
+		Rectangle2D *mRectangle;
+    };
+}
+
+#endif
Index: /OgreMain/include/OgreCompositorScriptCompiler.h
===================================================================
--- /OgreMain/include/OgreCompositorScriptCompiler.h	(revision 5)
+++ /OgreMain/include/OgreCompositorScriptCompiler.h	(revision 5)
@@ -0,0 +1,186 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __CompositorScriptScompiler_H__
+#define __CompositorScriptScompiler_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreCompiler2Pass.h"
+#include "OgreCompositor.h"
+#include "OgreRenderSystem.h"
+
+
+namespace Ogre {
+
+	/** Compiler for parsing & lexing .compositor scripts */
+	class _OgreExport CompositorScriptCompiler : public Compiler2Pass
+	{
+
+	public:
+		CompositorScriptCompiler(void);
+		~CompositorScriptCompiler(void);
+
+        /** gets BNF Grammer for Compositor script.
+        */
+        virtual const String& getClientBNFGrammer(void) const;
+
+        /** get the name of the Compositor script BNF grammer.
+        */
+        virtual const String& getClientGrammerName(void) const;
+
+        /** Compile a compositor script from a data stream using a specific resource group name.
+        @param stream Weak reference to a data stream which is the source of the material script
+        @param groupName The name of the resource group that resources which are
+			parsed are to become a member of. If this group is loaded or unloaded,
+			then the resources discovered in this script will be loaded / unloaded
+			with it.
+        */
+        void parseScript(DataStreamPtr& stream, const String& groupName)
+        {
+            mScriptContext.groupName = groupName;
+            Compiler2Pass::compile(stream->getAsString(),  stream->getName());
+        }
+
+	protected:
+		// Token ID enumeration
+		enum TokenID {
+			// Terminal Tokens section
+			ID_UNKOWN = 0,
+			// Techniques
+			ID_TARGET_WIDTH, ID_TARGET_HEIGHT,
+			ID_PF_A8R8G8B8, ID_PF_R8G8B8A8, ID_PF_R8G8B8, 
+			ID_PF_FLOAT16_R, ID_PF_FLOAT16_RGB, ID_PF_FLOAT16_RGBA,
+			ID_PF_FLOAT32_R, ID_PF_FLOAT32_RGB, ID_PF_FLOAT32_RGBA,
+			ID_PF_FLOAT16_GR, ID_PF_FLOAT32_GR,
+			// Targets
+			ID_PREVIOUS, ID_NONE,
+			// Passes
+			ID_RENDER_QUAD, ID_CLEAR, ID_STENCIL, ID_RENDER_SCENE,
+			// Clear section
+			ID_CLR_COLOUR, ID_CLR_DEPTH,
+			// Stencil section
+
+			// compare functions
+            ID_ST_ALWAYS_FAIL, ID_ST_ALWAYS_PASS, ID_ST_LESS,
+            ID_ST_LESS_EQUAL, ID_ST_EQUAL, ID_ST_NOT_EQUAL,
+            ID_ST_GREATER_EQUAL, ID_ST_GREATER,
+
+            // stencil operations
+            ID_ST_KEEP, ID_ST_ZERO, ID_ST_REPLACE, ID_ST_INCREMENT,
+            ID_ST_DECREMENT, ID_ST_INCREMENT_WRAP, ID_ST_DECREMENT_WRAP,
+            ID_ST_INVERT,
+
+			// general
+			ID_ON, ID_OFF, ID_TRUE, ID_FALSE,
+            // where auto generated tokens start so donot remove
+            ID_AUTOTOKENSTART
+		};
+
+		/** Enum to identify compositor sections. */
+		enum CompositorScriptSection
+		{
+			CSS_NONE,
+			CSS_COMPOSITOR,
+			CSS_TECHNIQUE,
+			CSS_TARGET,
+			CSS_PASS
+		};
+		/** Struct for holding the script context while parsing. */
+		struct CompositorScriptContext
+		{
+			CompositorScriptSection section;
+		    String groupName;
+			CompositorPtr compositor;
+			CompositionTechnique* technique;
+			CompositionTargetPass* target;
+			CompositionPass* pass;
+		};
+
+		CompositorScriptContext mScriptContext;
+
+		typedef void (CompositorScriptCompiler::* CSC_Action)(void);
+		typedef std::map<size_t, CSC_Action> TokenActionMap;
+		typedef TokenActionMap::iterator TokenActionIterator;
+		/** Map of Token value as key to an Action.  An Action converts tokens into
+		the final format.
+            All instances use the same Token Action Map.
+		*/
+		static TokenActionMap mTokenActionMap;
+
+		/** Execute an Action associated with a token.  Gets called when the compiler finishes tokenizing a
+		section of the source that has been parsed.
+		**/
+		virtual void executeTokenAction(const size_t tokenID);
+        /** Get the start position of auto generated token IDs.
+        */
+        virtual size_t getAutoTokenIDStart() const {return ID_AUTOTOKENSTART;}
+		/** Associate all the lexemes used in a material script with their corresponding tokens and actions.
+		**/
+        virtual void setupTokenDefinitions(void);
+		void addLexemeTokenAction(const String& lexeme, const size_t token, const CSC_Action action = 0);
+        void addLexemeAction(const String& lexeme, const CSC_Action action) { addLexemeTokenAction(lexeme, 0, action); }
+
+		void logParseError(const String& error);
+
+		// Token Actions which get called when tokens are created during parsing.
+		void parseOpenBrace(void);
+		void parseCloseBrace(void);
+		void parseCompositor(void);
+		void parseTechnique(void);
+		void parseTexture(void);
+		void parseTarget(void);
+		void parseInput(void);
+		void parseTargetOutput(void);
+		void parseOnlyInitial(void);
+		void parseVisibilityMask(void);
+		void parseLodBias(void);
+		void parseMaterialScheme(void);
+		void parsePass(void);
+		void parseMaterial(void);
+		void parseFirstRenderQueue(void);
+		void parseLastRenderQueue(void);
+		void parseIdentifier(void);
+		void parseClearBuffers(void);
+		void parseClearColourValue(void);
+		void parseClearDepthValue(void);
+		void parseClearStencilValue(void);
+		void parseStencilCheck(void);
+		void parseStencilFunc(void);
+		void parseStencilRefVal(void);
+		void parseStencilMask(void);
+		void parseStencilFailOp(void);
+		void parseStencilDepthFailOp(void);
+		void parseStencilPassOp(void);
+		void parseStencilTwoSided(void);
+		StencilOperation extractStencilOp(void);
+        CompareFunction extractCompareFunc(void);
+	};
+}
+
+#endif
Index: /OgreMain/include/OgreCompositorSerializer.h
===================================================================
--- /OgreMain/include/OgreCompositorSerializer.h	(revision 5)
+++ /OgreMain/include/OgreCompositorSerializer.h	(revision 5)
@@ -0,0 +1,59 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __CompositorSerializer_H__
+#define __CompositorSerializer_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreDataStream.h"
+
+namespace Ogre {
+
+    class CompositorScriptCompiler;
+
+    /** Class for serializing Compositors to / from a .compositor script.*/
+    class _OgreExport CompositorSerializer
+    {
+
+    public:
+		/** default constructor*/
+		CompositorSerializer();
+		/** default destructor*/
+		virtual ~CompositorSerializer();
+        /** Parses a Compositor script file passed as a stream.
+        */
+        void parseScript(DataStreamPtr& stream, const String& groupName);
+
+    protected:
+        CompositorScriptCompiler* mScriptCompiler;
+
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgreConfig.h
===================================================================
--- /OgreMain/include/OgreConfig.h	(revision 5)
+++ /OgreMain/include/OgreConfig.h	(revision 5)
@@ -0,0 +1,128 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Config_H_
+#define __Config_H_
+
+// Read configuration options; some systems use an auto-generated config.h,
+// other use a manually generated config.h; in any case just define
+// HAVE_CONFIG_H to include the custom config.h file.
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+/** If set to 1, profiling code will be included in the application. When you
+	are deploying your application you will probably want to set this to 0 */
+#define OGRE_PROFILING 0
+
+/** There are three modes for handling asserts in OGRE:
+0 - STANDARD - Standard asserts in debug builds, nothing in release builds
+1 - RELEASE_EXCEPTIONS - Standard asserts in debug builds, exceptions in release builds
+2 - EXCEPTIONS - Exceptions in debug builds, exceptions in release builds
+*/
+#define OGRE_ASSERT_MODE 0
+
+/** If set to >0, OGRE will always 'think' that the graphics card only has the
+    number of texture units specified. Very useful for testing multipass fallback.
+*/
+#define OGRE_PRETEND_TEXTURE_UNITS 0
+
+/** If set to 1, Real is typedef'ed to double. Otherwise, Real is typedef'ed
+    to float. Setting this allows you to perform mathematical operations in the
+	CPU (Quaternion, Vector3 etc) with more precision, but bear in mind that the
+	GPU still operates in single-precision mode.
+*/
+#ifndef OGRE_DOUBLE_PRECISION
+#define OGRE_DOUBLE_PRECISION 0
+#endif
+
+/** Define number of texture coordinate sets allowed per vertex.
+*/
+#define OGRE_MAX_TEXTURE_COORD_SETS 6
+
+/** Define max number of texture layers allowed per pass on any card.
+*/
+#define OGRE_MAX_TEXTURE_LAYERS 16
+
+/** Define max number of lights allowed per pass.
+*/
+#define OGRE_MAX_SIMULTANEOUS_LIGHTS 8
+
+/** Define max number of blending weights allowed per vertex.
+*/
+#define OGRE_MAX_BLEND_WEIGHTS 4
+
+/** Define this if you want to link OGRE as a static lib (preferably as a project file)
+*/
+//#define OGRE_STATIC_LIB
+
+
+/** Set this to 0 if you want to use the standard memory manager in Debug builds
+    Release builds always use the standard memory manager
+*/
+#ifndef OGRE_DEBUG_MEMORY_MANAGER
+#define OGRE_DEBUG_MEMORY_MANAGER 0
+#endif
+/** Define max number of multiple render targets (MRTs) to render to at once.
+*/
+#define OGRE_MAX_MULTIPLE_RENDER_TARGETS 8
+
+/** Indicate general support for multithreading.
+	This will enable threading support in certain parts of the
+	engine, mainly resource loading and SharedPtr handling.
+	The places where threading is available are clearly
+	marked, you should assume state is NOT thread safe unless otherwise
+	stated in relation to this flag.
+*/
+#ifndef OGRE_THREAD_SUPPORT
+#define OGRE_THREAD_SUPPORT 0
+#endif
+
+/** Disables use of the FreeImage image library for loading images.
+WARNING: Use only when you want to provide your own image loading code via codecs.
+*/
+#ifndef OGRE_NO_FREEIMAGE
+#define OGRE_NO_FREEIMAGE 0
+#endif
+
+/** Disables use of the DevIL image library for loading images.
+By default DevIL is disabled in Eihort in favour of FreeImage, but you may re-enable
+it if you choose
+*/
+#ifndef OGRE_NO_DEVIL
+#define OGRE_NO_DEVIL 1
+#endif
+
+/** Disables use of the internal image codec for loading DDS files.
+WARNING: Use only when you want to provide your own image loading code via codecs.
+*/
+#ifndef OGRE_NO_DDS_CODEC
+#define OGRE_NO_DDS_CODEC 0
+#endif
+
+#endif
Index: /OgreMain/include/OgreConfigDialog.h
===================================================================
--- /OgreMain/include/OgreConfigDialog.h	(revision 5)
+++ /OgreMain/include/OgreConfigDialog.h	(revision 5)
@@ -0,0 +1,50 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __CommonConfigDialog_H__
+#define __CommonConfigDialog_H__
+
+#include "OgrePrerequisites.h"
+#include "OgrePlatform.h"
+
+// Bring in the specific platform's header file: first allow forced override
+#if defined OGRE_GUI_WIN32
+# include "WIN32/OgreConfigDialogImp.h"
+#elif defined OGRE_GUI_gtk
+# include "gtk/OgreConfigDialogImp.h"
+#elif defined OGRE_GUI_GLX
+# include "GLX/OgreConfigDialogImp.h"
+#elif OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+# include "WIN32/OgreConfigDialogImp.h"
+#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
+# include "GLX/OgreConfigDialogImp.h"
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+# include "OSX/OgreConfigDialogImp.h"
+#endif
+
+#endif
Index: /OgreMain/include/OgreConfigFile.h
===================================================================
--- /OgreMain/include/OgreConfigFile.h	(revision 5)
+++ /OgreMain/include/OgreConfigFile.h	(revision 5)
@@ -0,0 +1,102 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ConfigFile_H__
+#define __ConfigFile_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreString.h"
+#include "OgreStringVector.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreDataStream.h"
+
+namespace Ogre {
+
+    /** Class for quickly loading settings from a text file.
+        @remarks
+            This class is designed to quickly parse a simple file containing
+            key/value pairs, mainly for use in configuration settings.
+        @par
+            This is a very simplified approach, no multiple values per key
+            are allowed, no grouping or context is being kept etc.
+        @par
+            By default the key/values pairs are tokenised based on a
+            separator of Tab, the colon (:) or equals (=) character. Each
+            key - value pair must end in a carriage return.
+        @par
+            Settings can be optionally grouped in sections, using a header
+            beforehand of the form [SectionName]. 
+    */
+    class _OgreExport ConfigFile
+    {
+    public:
+
+        ConfigFile();
+        virtual ~ConfigFile();
+        /// load from a filename (not using resource group locations)
+        void load(const String& filename, const String& separators = "\t:=", bool trimWhitespace = true);
+        /// load from a filename (using resource group locations)
+        void load(const String& filename, const String& resourceGroup, const String& separators = "\t:=", bool trimWhitespace = true);
+        /// load from a data stream
+        void load(const DataStreamPtr& stream, const String& separators = "\t:=", bool trimWhitespace = true);
+		/// load from a filename (not using resource group locations)
+		void loadDirect(const String& filename, const String& separators = "\t:=", bool trimWhitespace = true);
+		/// load from a filename (using resource group locations)
+		void loadFromResourceSystem(const String& filename, const String& resourceGroup, const String& separators = "\t:=", bool trimWhitespace = true);
+
+        /** Gets the first setting from the file with the named key. 
+        @param key The name of the setting
+        @param section The name of the section it must be in (if any)
+        */
+        String getSetting(const String& key, const String& section = StringUtil::BLANK) const;
+        /** Gets all settings from the file with the named key. */
+        StringVector getMultiSetting(const String& key, const String& section = StringUtil::BLANK) const;
+
+        typedef std::multimap<String, String> SettingsMultiMap;
+        typedef MapIterator<SettingsMultiMap> SettingsIterator;
+        /** Gets an iterator for stepping through all the keys / values in the file. */
+        typedef std::map<String, SettingsMultiMap*> SettingsBySection;
+        typedef MapIterator<SettingsBySection> SectionIterator;
+        /** Get an iterator over all the available sections in the config file */
+        SectionIterator getSectionIterator(void);
+        /** Get an iterator over all the available settings in a section */
+        SettingsIterator getSettingsIterator(const String& section = StringUtil::BLANK);
+
+
+        
+        /** Clear the settings */
+        void clear(void);
+    protected:
+        SettingsBySection mSettings;
+    };
+
+}
+
+
+#endif
Index: /OgreMain/include/OgreConfigOptionMap.h
===================================================================
--- /OgreMain/include/OgreConfigOptionMap.h	(revision 5)
+++ /OgreMain/include/OgreConfigOptionMap.h	(revision 5)
@@ -0,0 +1,56 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef _ConfigOptionMap_H__
+#define _ConfigOptionMap_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreStringVector.h"
+#include "OgreString.h"
+
+
+namespace Ogre {
+    /** Packages the details of a configuration option.
+        @remarks
+            Used for RenderSystem::getConfigOptions. If immutable is true, this
+            option must be disabled for modifying.
+    */
+    typedef struct _ConfigOption
+    {
+        String name;
+        String currentValue;
+        StringVector possibleValues;
+        bool immutable;
+    } ConfigOption;
+
+    typedef std::map< String, ConfigOption > ConfigOptionMap;
+}
+
+#endif
Index: /OgreMain/include/OgreController.h
===================================================================
--- /OgreMain/include/OgreController.h	(revision 5)
+++ /OgreMain/include/OgreController.h	(revision 5)
@@ -0,0 +1,227 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Controller_H__
+#define __Controller_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreSharedPtr.h"
+
+namespace Ogre {
+
+
+	
+	
+	/** Subclasses of this class are responsible for performing a function on an input value for a Controller.
+        @remarks
+            This abstract class provides the interface that needs to be supported for a custom function which
+            can be 'plugged in' to a Controller instance, which controls some object value based on an input value.
+            For example, the WaveControllerFunction class provided by Ogre allows you to use various waveforms to
+            translate an input value to an output value.
+        @par
+            You are free to create your own subclasses in order to define any function you wish.
+    */
+	template <typename T>
+    class ControllerFunction
+    {
+    protected:
+        /// If true, function will add imput values together and wrap at 1.0 before evaluating
+        bool mDeltaInput;
+        T mDeltaCount;
+
+        /** Gets the input value as adjusted by any delta.
+        */
+        T getAdjustedInput(T input)
+        {
+            if (mDeltaInput)
+            {
+                mDeltaCount += input;
+                // Wrap
+                while (mDeltaCount >= 1.0)
+                    mDeltaCount -= 1.0;
+                while (mDeltaCount < 0.0)
+                    mDeltaCount += 1.0;
+
+                return mDeltaCount;
+            }
+            else
+			{
+                return input;
+            }
+        }
+
+    public:
+        /** Constructor.
+            @param
+                deltaInput If true, signifies that the input will be a delta value such that the function should
+                add it to an internal counter before calculating the output.
+        */
+        ControllerFunction(bool deltaInput)
+        {
+            mDeltaInput = deltaInput;
+            mDeltaCount = 0;
+        }
+
+		virtual ~ControllerFunction() {}
+
+        virtual T calculate(T sourceValue) = 0;
+    };
+
+
+    /** Can either be used as an input or output value.
+    */
+	template <typename T>
+    class ControllerValue
+    {
+
+    public:
+        virtual ~ControllerValue() { }
+        virtual T getValue(void) const = 0;
+        virtual void setValue(T value) = 0;
+
+    };
+
+    /** Instances of this class 'control' the value of another object in the system.
+        @remarks
+            Controller classes are used to manage the values of object automatically based
+            on the value of some input. For example, a Controller could animate a texture
+            by controlling the current frame of the texture based on time, or a different Controller
+            could change the colour of a material used for a spaceship shield mesh based on the remaining
+            shield power level of the ship.
+        @par
+            The Controller is an intentionally abstract concept - it can generate values
+            based on input and a function, which can either be one of the standard ones
+            supplied, or a function can be 'plugged in' for custom behaviour - see the ControllerFunction class for details.
+            Both the input and output values are via ControllerValue objects, meaning that any value can be both
+            input and output of the controller.
+        @par
+            Whilst this is very flexible, it can be a little bit confusing so to make it simpler the most often used
+            controller setups are available by calling methods on the ControllerManager object.
+        @see
+            ControllerFunction
+
+    */
+	template <typename T>
+    class Controller
+    {
+    protected:
+        /// Source value
+        SharedPtr< ControllerValue<T> > mSource;
+        /// Destination value
+        SharedPtr< ControllerValue<T> > mDest;
+        /// Function
+        SharedPtr< ControllerFunction<T> > mFunc;
+		/// Controller is enabled or not
+        bool mEnabled;
+
+
+    public:
+
+        /** Usual constructor.
+            @remarks
+                Requires source and destination values, and a function object. None of these are destroyed
+                with the Controller when it is deleted (they can be shared) so you must delete these as appropriate.
+        */
+        Controller(const SharedPtr< ControllerValue<T> >& src, 
+			const SharedPtr< ControllerValue<T> >& dest, const SharedPtr< ControllerFunction<T> >& func)
+			: mSource(src), mDest(dest), mFunc(func)
+		{
+			mEnabled = true;
+		}
+
+        /** Default d-tor.
+        */
+		virtual ~Controller() {}
+
+
+		/// Sets the input controller value
+        void setSource(const SharedPtr< ControllerValue<T> >& src)
+		{
+			mSource = src;
+		}
+		/// Gets the input controller value
+        const SharedPtr< ControllerValue<T> >& getSource(void) const
+		{
+			return mSource;
+		}
+		/// Sets the output controller value
+        void setDestination(const SharedPtr< ControllerValue<T> >& dest)
+		{
+			mDest = dest;
+		}
+
+		/// Gets the output controller value
+        const SharedPtr< ControllerValue<T> >& getDestination(void) const
+		{
+			return mDest;
+		}
+
+        /// Returns true if this controller is currently enabled
+        bool getEnabled(void) const
+		{
+			return mEnabled;
+		}
+
+        /// Sets whether this controller is enabled
+        void setEnabled(bool enabled)
+		{
+			mEnabled = enabled;
+		}
+
+        /** Sets the function object to be used by this controller.
+        */
+        void setFunction(const SharedPtr< ControllerFunction<T> >& func)
+		{
+			mFunc = func;
+		}
+
+        /** Returns a pointer to the function object used by this controller.
+        */
+        const SharedPtr< ControllerFunction<T> >& getFunction(void) const
+		{
+			return mFunc;
+		}
+
+		/** Tells this controller to map it's input controller value
+		    to it's output controller value, via the controller function. 
+		@remarks
+			This method is called automatically every frame by ControllerManager.
+		*/
+		void update(void)
+		{
+			if(mEnabled)
+				mDest->setValue(mFunc->calculate(mSource->getValue()));
+		}
+
+    };
+
+
+}
+
+#endif
Index: /OgreMain/include/OgreControllerManager.h
===================================================================
--- /OgreMain/include/OgreControllerManager.h	(revision 5)
+++ /OgreMain/include/OgreControllerManager.h	(revision 5)
@@ -0,0 +1,287 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ControllerManager_H__
+#define __ControllerManager_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreCommon.h"
+#include "OgreSingleton.h"
+#include "OgreController.h"
+#include "OgrePredefinedControllers.h"
+#include "OgreTextureUnitState.h"
+#include "OgreSharedPtr.h"
+
+namespace Ogre {
+
+    typedef SharedPtr< ControllerValue<Real> > ControllerValueRealPtr;
+    typedef SharedPtr< ControllerFunction<Real> > ControllerFunctionRealPtr;
+
+    /** Class for managing Controller instances.
+        @remarks
+            This class is responsible to keeping tabs on all the Controller instances registered
+            and updating them when requested. It also provides a number of convenience methods
+            for creating commonly used controllers (such as texture animators).
+    */
+    class _OgreExport ControllerManager : public Singleton<ControllerManager>
+    {
+    protected:
+        typedef std::set<Controller<Real>*> ControllerList;
+        ControllerList mControllers;
+
+        /// Global predefined controller
+        ControllerValueRealPtr mFrameTimeController;
+        
+		/// Global predefined controller
+		ControllerFunctionRealPtr mPassthroughFunction;
+
+		// Last frame number updated
+        unsigned long mLastFrameNumber;
+
+    public:
+        ControllerManager();
+        ~ControllerManager();
+
+        /** Creates a new controller and registers it with the manager.
+        */
+        Controller<Real>* createController(const ControllerValueRealPtr& src,
+            const ControllerValueRealPtr& dest, const ControllerFunctionRealPtr& func);
+
+        /** Creates a new controller use frame time source and passthrough controller function.
+        */
+        Controller<Real>* createFrameTimePassthroughController(
+            const ControllerValueRealPtr& dest);
+
+        /** Destroys all the controllers in existence.
+        */
+        void clearControllers(void);
+
+        /** Updates all the registered controllers.
+        */
+        void updateAllControllers(void);
+
+
+        /** Returns a ControllerValue which provides the time since the last frame as a control value source.
+            @remarks
+                A common source value to use to feed into a controller is the time since the last frame. This method
+                returns a pointer to a common source value which provides this information.
+            @par
+                Remember the value will only be up to date after the RenderSystem::beginFrame method is called.
+            @see
+                RenderSystem::beginFrame
+        */
+        const ControllerValueRealPtr& getFrameTimeSource(void) const;
+
+		/** Retrieve a simple passthrough controller function. */
+		const ControllerFunctionRealPtr& getPassthroughControllerFunction(void) const;
+
+        /** Creates a texture layer animator controller.
+            @remarks
+                This helper method creates the Controller, ControllerValue and ControllerFunction classes required
+                to animate a texture.
+            @param
+                layer TextureUnitState object to animate
+            @param
+                sequenceTime The amount of time in seconds it will take to loop through all the frames.
+        */
+        Controller<Real>* createTextureAnimator(TextureUnitState* layer, Real sequenceTime);
+
+		/** Creates a basic time-based texture uv coordinate modifier designed for creating scrolling textures.
+            @remarks
+                This simple method allows you to easily create constant-speed uv scrolling textures. If you want to 
+				specify different speed values for horizontal and vertical scroll, use the specific methods
+				ControllerManager::createTextureUScroller and ControllerManager::createTextureVScroller.
+				If you want more control, look up the ControllerManager::createTextureWaveTransformer 
+				for more complex wave-based scrollers / stretchers / rotaters.
+            @param
+                layer The texture layer to animate.
+            @param
+                speed Speed of horizontal (u-coord) and vertical (v-coord) scroll, in complete wraps per second
+        */
+        Controller<Real>* createTextureUVScroller(TextureUnitState* layer, Real speed);
+
+        /** Creates a basic time-based texture u coordinate modifier designed for creating scrolling textures.
+            @remarks
+                This simple method allows you to easily create constant-speed u scrolling textures. If you want more
+                control, look up the ControllerManager::createTextureWaveTransformer for more complex wave-based
+                scrollers / stretchers / rotaters.
+            @param
+                layer The texture layer to animate.
+            @param
+                uSpeed Speed of horizontal (u-coord) scroll, in complete wraps per second
+        */
+        Controller<Real>* createTextureUScroller(TextureUnitState* layer, Real uSpeed);
+
+		/** Creates a basic time-based texture v coordinate modifier designed for creating scrolling textures.
+            @remarks
+                This simple method allows you to easily create constant-speed v scrolling textures. If you want more
+                control, look up the ControllerManager::createTextureWaveTransformer for more complex wave-based
+                scrollers / stretchers / rotaters.
+            @param
+                layer The texture layer to animate.            
+            @param
+                vSpeed Speed of vertical (v-coord) scroll, in complete wraps per second
+        */
+        Controller<Real>* createTextureVScroller(TextureUnitState* layer, Real vSpeed);
+
+        /** Creates a basic time-based texture coordinate modifier designed for creating rotating textures.
+            @return
+                This simple method allows you to easily create constant-speed rotating textures. If you want more
+                control, look up the ControllerManager::createTextureWaveTransformer for more complex wave-based
+                scrollers / stretchers / rotaters.
+            @param
+                layer The texture layer to rotate.
+            @param
+                vSpeed Speed of rotation, in complete anticlockwise revolutions per second
+        */
+        Controller<Real>* createTextureRotater(TextureUnitState* layer, Real speed);
+
+        /** Creates a very flexible time-based texture transformation which can alter the scale, position or
+            rotation of a texture based on a wave function.
+            @param
+                layer The texture layer to affect
+            @param
+                ttype The type of transform, either translate (scroll), scale (stretch) or rotate (spin)
+            @param
+                waveType The shape of the wave, see WaveformType enum for details
+            @param
+                base The base value of the output
+            @param
+                frequency The speed of the wave in cycles per second
+            @param
+                phase The offset of the start of the wave, e.g. 0.5 to start half-way through the wave
+            @param
+                amplitude Scales the output so that instead of lying within 0..1 it lies within 0..1*amplitude for exaggerated effects
+        */
+        Controller<Real>* createTextureWaveTransformer(TextureUnitState* layer, TextureUnitState::TextureTransformType ttype,
+            WaveformType waveType, Real base = 0, Real frequency = 1, Real phase = 0, Real amplitude = 1);
+
+        /** Creates a controller for passing a frame time value through to a vertex / fragment program parameter.
+        @remarks
+            The destination parameter is expected to be a float, and the '.x' attribute will be populated
+            with the appropriately scaled time value.
+        @param params The parameters to update
+        @param paramIndex The index of the parameter to update; if you want a named parameter, then
+            retrieve the index beforehand using GpuProgramParameters::getParamIndex
+        @param factor The factor by which to adjust the time elapsed by before passing it to the program
+        */
+        Controller<Real>* createGpuProgramTimerParam(GpuProgramParameters* params, size_t paramIndex,
+            Real timeFactor = 1.0f);
+
+        /** Removes & destroys the controller passed in as a pointer.
+        */
+        void destroyController(Controller<Real>* controller);
+
+		/** Return relative speed of time as perceived by time based controllers.
+        @remarks
+            See setTimeFactor for full information on the meaning of this value.
+		*/
+		Real getTimeFactor(void) const;
+
+		/** Set the relative speed to update frame time based controllers.
+        @remarks
+            Normally any controllers which use time as an input (FrameTimeController) are updated
+            automatically in line with the real passage of time. This method allows you to change
+            that, so that controllers are told that the time is passing slower or faster than it
+            actually is. Use this to globally speed up / slow down the effect of time-based controllers.
+        @param tf The virtual speed of time (1.0 is real time).
+		*/
+		void setTimeFactor(Real tf);
+
+		/** Gets the constant that is added to time lapsed between each frame.
+		@remarks
+			See setFrameDelay for full information on the meaning of this value.
+		*/
+		Real getFrameDelay(void) const;
+
+		/** Sets a constant frame rate.
+		@remarks
+			This function is useful when rendering a sequence to
+			files that should create a film clip with constant frame
+			rate.
+			It will ensure that scrolling textures and animations
+			move at a constant frame rate.
+		@param fd The delay in seconds wanted between each frame 
+			(1.0f / 25.0f means a seconds worth of animation is done 
+			in 25 frames).
+		*/
+		void setFrameDelay(Real fd);
+
+		/** Return the elapsed time.
+        @remarks
+            See setElapsedTime for full information on the meaning of this value.
+        */
+        Real getElapsedTime(void) const;
+
+        /** Set the elapsed time.
+        @remarks
+            Normally elapsed time accumulated all frames time (which speed relative to time
+            factor) since the rendering loop started. This method allows your to change that to
+            special time, so some elapsed-time-based globally effect is repeatable.
+        @param elapsedTime The new elapsed time
+        */
+        void setElapsedTime(Real elapsedTime);
+
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static ControllerManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static ControllerManager* getSingletonPtr(void);
+    };
+
+
+}
+#endif
Index: /OgreMain/include/OgreConvexBody.h
===================================================================
--- /OgreMain/include/OgreConvexBody.h	(revision 5)
+++ /OgreMain/include/OgreConvexBody.h	(revision 5)
@@ -0,0 +1,252 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Copyright (c) 2006 Matthias Fink, netAllied GmbH <matthias.fink@web.de>								
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ConvexBody_H__
+#define __ConvexBody_H__
+
+#include "OgrePrerequisites.h"
+#include "OgrePolygon.h"
+
+
+namespace Ogre
+{
+
+	/** Holds a solid representation of a convex body.
+		@remarks
+			Administers a convex body. All polygons of the body are convex and
+			planar. Several operations may be applied, ranging from intersection
+			to join where each result it itself a convex body.
+	*/
+	class _OgreExport ConvexBody
+	{
+	public:
+		typedef std::vector< Polygon* >	PolygonList;
+
+	protected:
+		PolygonList mPolygons;
+
+		// Static 'free list' of polygons to save reallocation, shared between all bodies
+		static PolygonList msFreePolygons;
+#if OGRE_THREAD_SUPPORT
+		static boost::recursive_mutex msFreePolygonsMutex;
+#endif
+
+	public:
+		ConvexBody();
+		~ConvexBody();
+		ConvexBody( const ConvexBody& cpy );
+
+		/** Build a new polygon representation from a frustum.
+		*/
+		void define(const Frustum& frustum);
+
+		/** Build a new polygon representation from an AAB.
+		*/
+		void define(const AxisAlignedBox& aab);
+
+		/** Clips the body with a frustum. The resulting holes
+			are filled with new polygons.
+		*/
+		void clip( const Frustum& frustum );
+
+		/** Clips the body with an AAB. The resulting holes
+			are filled with new polygons.
+		*/
+		void clip( const AxisAlignedBox& aab );
+
+		/** Clips the body with another body.
+		*/
+		void clip(const ConvexBody& body);
+
+		/** Clips the object by the positive half space of a plane
+		*/
+		void clip(const Plane& pl, bool keepNegative = true);
+
+		/** Extends the existing body to incorporate the passed in point as a
+			convex hull.
+		@remarks
+			You must already have constructed a basic body using a 'construct' 
+			method.
+		*/
+		void extend(const Vector3& pt);
+
+		/** Resets the object.
+		*/
+		void reset( void );
+
+		/** Returns the current number of polygons.
+		*/
+		size_t getPolygonCount( void ) const;
+
+		/** Returns the number of vertices for a polygon
+		*/
+		size_t getVertexCount( size_t poly ) const;
+
+		/** Returns a polygon.
+		*/
+		const Polygon& getPolygon( size_t poly ) const;
+
+		/** Returns a specific vertex of a polygon.
+		*/
+		const Vector3& getVertex( size_t poly, size_t vertex ) const;
+
+		/** Returns the normal of a specified polygon.
+		*/
+		const Vector3& getNormal( size_t poly );
+
+		/** Returns an AABB representation.
+		*/
+		AxisAlignedBox getAABB( void ) const;
+
+		/** Checks if the body has a closed hull.
+		*/
+		bool hasClosedHull( void ) const;
+
+		/** Merges all neighboring polygons into one single polygon if they are
+			lay in the same plane.
+		*/
+		void mergePolygons( void );
+
+		/** Determines if the current object is equal to the compared one.
+		*/
+		bool operator == ( const ConvexBody& rhs ) const;
+
+		/** Determines if the current object is not equal to the compared one.
+		*/
+		bool operator != ( const ConvexBody& rhs ) const
+		{ return !( *this == rhs ); }
+
+		/** Prints out the body with all its polygons.
+		*/
+		_OgreExport friend std::ostream& operator<< ( std::ostream& strm, const ConvexBody& body );
+
+		/** Log details of this body */
+		void logInfo() const;
+
+		/// Initialise the internal polygon pool used to minimise allocations
+		static void _initialisePool();
+		/// Tear down the internal polygon pool used to minimise allocations
+		static void _destroyPool();
+
+
+	protected:
+		/** Get a new polygon from the pool.
+		*/
+		static Polygon* allocatePolygon();
+		/** Release a polygon back tot he pool. */
+		static void freePolygon(Polygon* poly);
+		/** Inserts a polygon at a partcular point in the body.
+		@note
+			After this method is called, the ConvexBody 'owns' this Polygon
+			and will be responsible for deleting it.
+		*/
+		void insertPolygon(Polygon* pdata, size_t poly);
+		/** Inserts a polygon at the end.
+		@note
+			After this method is called, the ConvexBody 'owns' this Polygon
+			and will be responsible for deleting it.
+		*/
+		void insertPolygon(Polygon* pdata);
+
+		/** Inserts a vertex for a polygon at a particular point.
+		@note
+			No checks are done whether the assembled polygon is (still) planar, 
+			the caller must ensure that this is the case.
+		*/
+		void insertVertex(size_t poly, const Vector3& vdata, size_t vertex);
+		/** Inserts a vertex for a polygon at the end.
+		@note
+			No checks are done whether the assembled polygon is (still) planar, 
+			the caller must ensure that this is the case.
+		*/
+		void insertVertex(size_t poly, const Vector3& vdata);
+		/** Deletes a specific polygon.
+		*/
+		void deletePolygon(size_t poly);
+
+		/** Removes a specific polygon from the body without deleting it.
+		@note
+			The retrieved polygon needs to be deleted later by the caller.
+		*/
+		Polygon* unlinkPolygon(size_t poly);
+
+		/** Moves all polygons from the parameter body to this instance.
+		@note Both the passed in object and this instance are modified
+		*/
+		void moveDataFromBody(ConvexBody& body);
+
+		/** Deletes a specific vertex of a specific polygon.
+		*/
+		void deleteVertex(size_t poly, size_t vertex);
+
+		/** Replace a polygon at a particular index.
+		@note Again, the passed in polygon is owned by this object after this
+			call returns, and this object is resonsible for deleting it.
+		*/
+		void setPolygon(Polygon* pdata, size_t poly );
+
+		/** Replace a specific vertex of a polygon.
+		@note
+			No checks are done whether the assembled polygon is (still) planar, 
+			the caller must ensure that this is the case.
+		*/
+		void setVertex( size_t poly, const Vector3& vdata, size_t vertex );
+
+		/** Returns the single edges in an EdgeMap (= edges where one side is a vertex and the
+			other is empty space (a hole in the body)).
+		*/
+		Polygon::EdgeMap getSingleEdges() const;
+
+		/** Stores the edges of a specific polygon in a passed in structure.
+		*/
+		void storeEdgesOfPolygon(size_t poly, Polygon::EdgeMap *edgeMap) const;
+			
+		/** Allocates space for an specified amount of polygons with
+			each of them having a specified number of vertices.
+			@note
+				Old data (if available) will be erased.
+		*/
+		void allocateSpace(size_t numPolygons, size_t numVertices);
+
+		/** Searches for a pair (an edge) in the intersectionList with an entry
+			that equals vec, and removes it from the passed in list.
+		@param vec The vertex to search for in intersectionEdges
+		@param intersectionEdges A list of edges, which is updated if a match is found
+		@param vNext A reference to a vector which will be filled with the other
+			vertex at the matching edge, if found.
+		@returns True if a match was found
+		*/
+		bool findAndEraseEdgePair(const Vector3& vec, 
+			Polygon::EdgeMap& intersectionEdges, Vector3& vNext ) const;
+
+	};
+}
+
+#endif 
+
Index: /OgreMain/include/OgreDDSCodec.h
===================================================================
--- /OgreMain/include/OgreDDSCodec.h	(revision 5)
+++ /OgreMain/include/OgreDDSCodec.h	(revision 5)
@@ -0,0 +1,90 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OgreDDSCodec_H__
+#define __OgreDDSCodec_H__
+
+#include "OgreImageCodec.h"
+namespace Ogre {
+
+	// Forward declarations
+	struct DXTColourBlock;
+	struct DXTExplicitAlphaBlock;
+	struct DXTInterpolatedAlphaBlock;
+
+    /** Codec specialized in loading DDS (Direct Draw Surface) images.
+	@remarks
+		We implement our own codec here since we need to be able to keep DXT
+		data compressed if the card supports it.
+    */
+    class _OgreExport DDSCodec : public ImageCodec
+    {
+    private:
+        String mType;
+
+    	void flipEndian(void * pData, size_t size, size_t count) const;
+	    void flipEndian(void * pData, size_t size) const;
+
+		PixelFormat convertFourCCFormat(uint32 fourcc) const;
+		PixelFormat convertPixelFormat(uint32 rgbBits, uint32 rMask, 
+			uint32 gMask, uint32 bMask, uint32 aMask) const;
+
+		/// Unpack DXT colours into array of 16 colour values
+		void unpackDXTColour(PixelFormat pf, const DXTColourBlock& block, ColourValue* pCol) const;
+		/// Unpack DXT alphas into array of 16 colour values
+		void unpackDXTAlpha(const DXTExplicitAlphaBlock& block, ColourValue* pCol) const;
+		/// Unpack DXT alphas into array of 16 colour values
+		void unpackDXTAlpha(const DXTInterpolatedAlphaBlock& block, ColourValue* pCol) const;
+
+		/// Single registered codec instance
+		static DDSCodec* msInstance;
+	public:
+        DDSCodec();
+        virtual ~DDSCodec() { }
+
+        /// @copydoc Codec::code
+        DataStreamPtr code(MemoryDataStreamPtr& input, CodecDataPtr& pData) const;
+        /// @copydoc Codec::codeToFile
+        void codeToFile(MemoryDataStreamPtr& input, const String& outFileName, CodecDataPtr& pData) const;
+        /// @copydoc Codec::decode
+        DecodeResult decode(DataStreamPtr& input) const;
+
+        
+        virtual String getType() const;        
+
+		/// Static method to startup and register the DDS codec
+		static void startup(void);
+		/// Static method to shutdown and unregister the DDS codec
+		static void shutdown(void);
+
+    };
+
+} // namespace
+
+#endif
+
Index: /OgreMain/include/OgreDataStream.h
===================================================================
--- /OgreMain/include/OgreDataStream.h	(revision 5)
+++ /OgreMain/include/OgreDataStream.h	(revision 5)
@@ -0,0 +1,442 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __DataStream_H__
+#define __DataStream_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include "OgreSharedPtr.h"
+#include <istream>
+
+namespace Ogre {
+
+	/** General purpose class used for encapsulating the reading of data.
+	@remarks
+		This class performs basically the same tasks as std::basic_istream, 
+		except that it does not have any formatting capabilities, and is
+		designed to be subclassed to receive data from multiple sources,
+		including libraries which have no compatiblity with the STL's
+		stream interfaces. As such, this is an abstraction of a set of 
+		wrapper classes which pretend to be standard stream classes but 
+		can actually be implemented quite differently. 
+	@par
+		Generally, if a plugin or application provides an ArchiveFactory, 
+		it should also provide a DataStream subclass which will be used
+		to stream data out of that Archive implementation, unless it can 
+		use one of the common implementations included.
+	@note
+		Ogre makes no guarantees about thread safety, for performance reasons.
+		If you wish to access stream data asynchronously then you should
+		organise your own mutexes to avoid race conditions. 
+	*/
+	class _OgreExport DataStream
+	{
+	protected:
+		/// The name (e.g. resource name) that can be used to identify the source fot his data (optional)
+		String mName;		
+        /// Size of the data in the stream (may be 0 if size cannot be determined)
+        size_t mSize;
+        #define OGRE_STREAM_TEMP_SIZE 128
+	public:
+		/// Constructor for creating unnamed streams
+        DataStream() : mSize(0) {}
+		/// Constructor for creating named streams
+		DataStream(const String& name) : mName(name), mSize(0) {}
+		/// Returns the name of the stream, if it has one.
+		const String& getName(void) { return mName; }
+        virtual ~DataStream() {}
+		// Streaming operators
+        template<typename T> DataStream& operator>>(T& val);
+		/** Read the requisite number of bytes from the stream, 
+			stopping at the end of the file.
+		@param buf Reference to a buffer pointer
+		@param count Number of bytes to read
+		@returns The number of bytes read
+		*/
+		virtual size_t read(void* buf, size_t count) = 0;
+		/** Get a single line from the stream.
+		@remarks
+			The delimiter character is not included in the data
+			returned, and it is skipped over so the next read will occur
+			after it. The buffer contents will include a
+			terminating character.
+        @note
+            If you used this function, you <b>must</b> open the stream in <b>binary mode</b>,
+            otherwise, it'll produce unexpected results.
+		@param buf Reference to a buffer pointer
+		@param maxCount The maximum length of data to be read, excluding the terminating character
+		@param delim The delimiter to stop at
+		@returns The number of bytes read, excluding the terminating character
+		*/
+		virtual size_t readLine(char* buf, size_t maxCount, const String& delim = "\n");
+		
+	    /** Returns a String containing the next line of data, optionally 
+		    trimmed for whitespace. 
+	    @remarks
+		    This is a convenience method for text streams only, allowing you to 
+		    retrieve a String object containing the next line of data. The data
+		    is read up to the next newline character and the result trimmed if
+		    required.
+        @note
+            If you used this function, you <b>must</b> open the stream in <b>binary mode</b>,
+            otherwise, it'll produce unexpected results.
+	    @param 
+		    trimAfter If true, the line is trimmed for whitespace (as in 
+		    String.trim(true,true))
+	    */
+	    virtual String getLine( bool trimAfter = true );
+
+	    /** Returns a String containing the entire stream. 
+	    @remarks
+		    This is a convenience method for text streams only, allowing you to 
+		    retrieve a String object containing all the data in the stream.
+	    */
+	    virtual String getAsString(void);
+
+		/** Skip a single line from the stream.
+        @note
+            If you used this function, you <b>must</b> open the stream in <b>binary mode</b>,
+            otherwise, it'll produce unexpected results.
+		@param delim The delimiter(s) to stop at
+		@returns The number of bytes skipped
+		*/
+		virtual size_t skipLine(const String& delim = "\n");
+
+		/** Skip a defined number of bytes. This can also be a negative value, in which case
+		the file pointer rewinds a defined number of bytes. */
+		virtual void skip(long count) = 0;
+	
+		/** Repositions the read point to a specified byte.
+	    */
+	    virtual void seek( size_t pos ) = 0;
+		
+		/** Returns the current byte offset from beginning */
+	    virtual size_t tell(void) const = 0;
+
+		/** Returns true if the stream has reached the end.
+	    */
+	    virtual bool eof(void) const = 0;
+
+		/** Returns the total size of the data to be read from the stream, 
+			or 0 if this is indeterminate for this stream. 
+		*/
+        size_t size(void) const { return mSize; }
+
+        /** Close the stream; this makes further operations invalid. */
+        virtual void close(void) = 0;
+		
+
+	};
+
+	/** Shared pointer to allow data streams to be passed around without
+		worrying about deallocation
+	*/
+	typedef SharedPtr<DataStream> DataStreamPtr;
+
+	/// List of DataStream items
+	typedef std::list<DataStreamPtr> DataStreamList;
+	/// Shared pointer to list of DataStream items
+	typedef SharedPtr<DataStreamList> DataStreamListPtr;
+
+	/** Common subclass of DataStream for handling data from chunks of memory.
+	*/
+	class _OgreExport MemoryDataStream : public DataStream
+	{
+	protected:
+        /// Pointer to the start of the data area
+	    uchar* mData;
+        /// Pointer to the current position in the memory
+	    uchar* mPos;
+        /// Pointer to the end of the memory
+	    uchar* mEnd;
+        /// Do we delete the memory on close
+		bool mFreeOnClose;			
+	public:
+		
+		/** Wrap an existing memory chunk in a stream.
+		@param pMem Pointer to the exising memory
+		@param size The size of the memory chunk in bytes
+		@param freeOnClose If true, the memory associated will be destroyed
+			when the stream is destroyed.
+		*/
+		MemoryDataStream(void* pMem, size_t size, bool freeOnClose = false);
+		
+		/** Wrap an existing memory chunk in a named stream.
+		@param name The name to give the stream
+		@param pMem Pointer to the exising memory
+		@param size The size of the memory chunk in bytes
+		@param freeOnClose If true, the memory associated will be destroyed
+			when the stream is destroyed.
+		*/
+		MemoryDataStream(const String& name, void* pMem, size_t size, 
+				bool freeOnClose = false);
+
+		/** Create a stream which pre-buffers the contents of another stream.
+		@remarks
+			This constructor can be used to intentionally read in the entire
+			contents of another stream, copying them to the internal buffer
+			and thus making them available in memory as a single unit.
+		@param sourceStream Another DataStream which will provide the source
+			of data
+		@param freeOnClose If true, the memory associated will be destroyed
+			when the stream is destroyed.
+		*/
+		MemoryDataStream(DataStream& sourceStream, 
+				bool freeOnClose = true);
+		
+		/** Create a stream which pre-buffers the contents of another stream.
+		@remarks
+			This constructor can be used to intentionally read in the entire
+			contents of another stream, copying them to the internal buffer
+			and thus making them available in memory as a single unit.
+		@param sourceStream Weak reference to another DataStream which will provide the source
+			of data
+		@param freeOnClose If true, the memory associated will be destroyed
+			when the stream is destroyed.
+		*/
+		MemoryDataStream(DataStreamPtr& sourceStream, 
+				bool freeOnClose = true);
+
+		/** Create a named stream which pre-buffers the contents of 
+			another stream.
+		@remarks
+			This constructor can be used to intentionally read in the entire
+			contents of another stream, copying them to the internal buffer
+			and thus making them available in memory as a single unit.
+		@param name The name to give the stream
+		@param sourceStream Another DataStream which will provide the source
+			of data
+		@param freeOnClose If true, the memory associated will be destroyed
+			when the stream is destroyed.
+		*/
+		MemoryDataStream(const String& name, DataStream& sourceStream, 
+				bool freeOnClose = true);
+
+        /** Create a named stream which pre-buffers the contents of 
+        another stream.
+        @remarks
+        This constructor can be used to intentionally read in the entire
+        contents of another stream, copying them to the internal buffer
+        and thus making them available in memory as a single unit.
+        @param name The name to give the stream
+        @param sourceStream Another DataStream which will provide the source
+        of data
+        @param freeOnClose If true, the memory associated will be destroyed
+        when the stream is destroyed.
+        */
+        MemoryDataStream(const String& name, const DataStreamPtr& sourceStream, 
+            bool freeOnClose = true);
+
+        /** Create a stream with a brand new empty memory chunk.
+		@param size The size of the memory chunk to create in bytes
+		@param freeOnClose If true, the memory associated will be destroyed
+			when the stream is destroyed.
+		*/
+		MemoryDataStream(size_t size, bool freeOnClose = true);
+		/** Create a named stream with a brand new empty memory chunk.
+		@param name The name to give the stream
+		@param size The size of the memory chunk to create in bytes
+		@param freeOnClose If true, the memory associated will be destroyed
+			when the stream is destroyed.
+		*/
+		MemoryDataStream(const String& name, size_t size, 
+				bool freeOnClose = true);
+
+		~MemoryDataStream();
+
+		/** Get a pointer to the start of the memory block this stream holds. */
+		uchar* getPtr(void) { return mData; }
+		
+		/** Get a pointer to the current position in the memory block this stream holds. */
+		uchar* getCurrentPtr(void) { return mPos; }
+		
+		/** @copydoc DataStream::read
+		*/
+		size_t read(void* buf, size_t count);
+		/** @copydoc DataStream::readLine
+		*/
+		size_t readLine(char* buf, size_t maxCount, const String& delim = "\n");
+		
+		/** @copydoc DataStream::skipLine
+		*/
+		size_t skipLine(const String& delim = "\n");
+
+		/** @copydoc DataStream::skip
+		*/
+		void skip(long count);
+	
+		/** @copydoc DataStream::seek
+		*/
+	    void seek( size_t pos );
+		
+		/** @copydoc DataStream::tell
+		*/
+	    size_t tell(void) const;
+
+		/** @copydoc DataStream::eof
+		*/
+	    bool eof(void) const;
+
+        /** @copydoc DataStream::close
+        */
+        void close(void);
+
+		/** Sets whether or not to free the encapsulated memory on close. */
+		void setFreeOnClose(bool free) { mFreeOnClose = free; }
+	};
+
+    /** Shared pointer to allow memory data streams to be passed around without
+    worrying about deallocation
+    */
+    typedef SharedPtr<MemoryDataStream> MemoryDataStreamPtr;
+
+    /** Common subclass of DataStream for handling data from 
+		std::basic_istream.
+	*/
+	class _OgreExport FileStreamDataStream : public DataStream
+	{
+	protected:
+		/// Reference to source stream
+		std::ifstream* mpStream;
+        bool mFreeOnClose;			
+	public:
+		/** Construct stream from an STL stream
+        @param s Pointer to source stream
+        @param freeOnClose Whether to delete the underlying stream on 
+            destruction of this class
+        */
+		FileStreamDataStream(std::ifstream* s, 
+            bool freeOnClose = true);
+		/** Construct named stream from an STL stream
+        @param name The name to give this stream
+        @param s Pointer to source stream
+        @param freeOnClose Whether to delete the underlying stream on 
+            destruction of this class
+        */
+		FileStreamDataStream(const String& name, 
+            std::ifstream* s, 
+            bool freeOnClose = true);
+
+		/** Construct named stream from an STL stream, and tell it the size
+        @remarks
+            This variant tells the class the size of the stream too, which 
+            means this class does not need to seek to the end of the stream 
+            to determine the size up-front. This can be beneficial if you have
+            metadata about the contents of the stream already.
+        @param name The name to give this stream
+        @param s Pointer to source stream
+        @param size Size of the stream contents in bytes
+        @param freeOnClose Whether to delete the underlying stream on 
+            destruction of this class
+        */
+		FileStreamDataStream(const String& name, 
+            std::ifstream* s, 
+            size_t size, 
+            bool freeOnClose = true);
+
+        ~FileStreamDataStream();
+
+		/** @copydoc DataStream::read
+		*/
+		size_t read(void* buf, size_t count);
+		/** @copydoc DataStream::readLine
+		*/
+        size_t readLine(char* buf, size_t maxCount, const String& delim = "\n");
+		
+		/** @copydoc DataStream::skip
+		*/
+		void skip(long count);
+	
+		/** @copydoc DataStream::seek
+		*/
+	    void seek( size_t pos );
+
+		/** @copydoc DataStream::tell
+		*/
+		size_t tell(void) const;
+
+		/** @copydoc DataStream::eof
+		*/
+	    bool eof(void) const;
+
+        /** @copydoc DataStream::close
+        */
+        void close(void);
+		
+		
+	};
+
+	/** Common subclass of DataStream for handling data from C-style file 
+		handles.
+    @remarks
+        Use of this class is generally discouraged; if you want to wrap file
+        access in a DataStream, you should definitely be using the C++ friendly
+        FileStreamDataStream. However, since there are quite a few applications
+        and libraries still wedded to the old FILE handle access, this stream
+        wrapper provides some backwards compatibility.
+	*/
+	class _OgreExport FileHandleDataStream : public DataStream
+	{
+	protected:
+		FILE* mFileHandle;
+	public:
+		/// Create stream from a C file handle
+		FileHandleDataStream(FILE* handle);
+		/// Create named stream from a C file handle
+		FileHandleDataStream(const String& name, FILE* handle);
+        ~FileHandleDataStream();
+
+		/** @copydoc DataStream::read
+		*/
+		size_t read(void* buf, size_t count);
+
+		/** @copydoc DataStream::skip
+		*/
+		void skip(long count);
+	
+		/** @copydoc DataStream::seek
+		*/
+	    void seek( size_t pos );
+
+		/** @copydoc DataStream::tell
+		*/
+		size_t tell(void) const;
+
+		/** @copydoc DataStream::eof
+		*/
+	    bool eof(void) const;
+
+        /** @copydoc DataStream::close
+        */
+        void close(void);
+
+	};
+}
+#endif
+
Index: /OgreMain/include/OgreDefaultHardwareBufferManager.h
===================================================================
--- /OgreMain/include/OgreDefaultHardwareBufferManager.h	(revision 5)
+++ /OgreMain/include/OgreDefaultHardwareBufferManager.h	(revision 5)
@@ -0,0 +1,116 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __DefaultHardwareBufferManager_H__
+#define __DefaultHardwareBufferManager_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreHardwareIndexBuffer.h"
+
+namespace Ogre {
+
+    /// Specialisation of HardwareVertexBuffer for emulation
+    class _OgreExport DefaultHardwareVertexBuffer : public HardwareVertexBuffer 
+    {
+	protected:
+		unsigned char* mpData;
+        /** See HardwareBuffer. */
+        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        /** See HardwareBuffer. */
+		void unlockImpl(void);
+    public:
+		DefaultHardwareVertexBuffer(size_t vertexSize, size_t numVertices, 
+            HardwareBuffer::Usage usage);
+        ~DefaultHardwareVertexBuffer();
+        /** See HardwareBuffer. */
+        void readData(size_t offset, size_t length, void* pDest);
+        /** See HardwareBuffer. */
+        void writeData(size_t offset, size_t length, const void* pSource,
+				bool discardWholeBuffer = false);
+        /** Override HardwareBuffer to turn off all shadowing. */
+        void* lock(size_t offset, size_t length, LockOptions options);
+        /** Override HardwareBuffer to turn off all shadowing. */
+		void unlock(void);
+
+
+    };
+
+	/// Specialisation of HardwareIndexBuffer for emulation
+    class _OgreExport DefaultHardwareIndexBuffer : public HardwareIndexBuffer
+    {
+	protected:
+		unsigned char* mpData;
+        /** See HardwareBuffer. */
+        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        /** See HardwareBuffer. */
+		void unlockImpl(void);
+    public:
+		DefaultHardwareIndexBuffer(IndexType idxType, size_t numIndexes, HardwareBuffer::Usage usage);
+        ~DefaultHardwareIndexBuffer();
+        /** See HardwareBuffer. */
+        void readData(size_t offset, size_t length, void* pDest);
+        /** See HardwareBuffer. */
+        void writeData(size_t offset, size_t length, const void* pSource,
+				bool discardWholeBuffer = false);
+        /** Override HardwareBuffer to turn off all shadowing. */
+        void* lock(size_t offset, size_t length, LockOptions options);
+        /** Override HardwareBuffer to turn off all shadowing. */
+		void unlock(void);
+
+    };
+
+	/** Specialisation of HardwareBufferManager to emulate hardware buffers.
+	@remarks
+		You might want to instantiate this class if you want to utilise
+		classes like MeshSerializer without having initialised the 
+		rendering system (which is required to create a 'real' hardware
+		buffer manager.
+	*/
+	class _OgreExport DefaultHardwareBufferManager : public HardwareBufferManager
+	{
+    public:
+        DefaultHardwareBufferManager();
+        ~DefaultHardwareBufferManager();
+        /// Creates a vertex buffer
+		HardwareVertexBufferSharedPtr 
+            createVertexBuffer(size_t vertexSize, size_t numVerts, 
+				HardwareBuffer::Usage usage, bool useShadowBuffer = false);
+		/// Create a hardware vertex buffer
+		HardwareIndexBufferSharedPtr 
+            createIndexBuffer(HardwareIndexBuffer::IndexType itype, size_t numIndexes, 
+				HardwareBuffer::Usage usage, bool useShadowBuffer = false);
+
+    };
+
+
+}
+
+#endif
Index: /OgreMain/include/OgreDynLib.h
===================================================================
--- /OgreMain/include/OgreDynLib.h	(revision 5)
+++ /OgreMain/include/OgreDynLib.h	(revision 5)
@@ -0,0 +1,116 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _DynLib_H__
+#define _DynLib_H__
+
+#include "OgrePrerequisites.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#    define DYNLIB_HANDLE hInstance
+#    define DYNLIB_LOAD( a ) LoadLibrary( a )
+#    define DYNLIB_GETSYM( a, b ) GetProcAddress( a, b )
+#    define DYNLIB_UNLOAD( a ) !FreeLibrary( a )
+
+struct HINSTANCE__;
+typedef struct HINSTANCE__* hInstance;
+
+#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
+#    define DYNLIB_HANDLE void*
+#    define DYNLIB_LOAD( a ) dlopen( a, RTLD_LAZY | RTLD_GLOBAL)
+#    define DYNLIB_GETSYM( a, b ) dlsym( a, b )
+#    define DYNLIB_UNLOAD( a ) dlclose( a )
+
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#    define DYNLIB_HANDLE CFBundleRef
+#    define DYNLIB_LOAD( a ) mac_loadExeBundle( a )
+#    define DYNLIB_GETSYM( a, b ) mac_getBundleSym( a, b )
+#    define DYNLIB_UNLOAD( a ) mac_unloadExeBundle( a )
+#endif
+
+namespace Ogre {
+
+    /** Resource holding data about a dynamic library.
+        @remarks
+            This class holds the data required to get symbols from
+            libraries loaded at run-time (i.e. from DLL's for so's)
+        @author
+            Adrian Cearnãu (cearny@cearny.ro)
+        @since
+            27 January 2002
+        @see
+            Resource
+    */
+    class _OgreExport DynLib
+    {
+	protected:
+		String mName;
+        /// Gets the last loading error
+        String dynlibError(void);
+    public:
+        /** Default constructor - used by DynLibManager.
+            @warning
+                Do not call directly
+        */
+        DynLib( const String& name );
+
+        /** Default destructor.
+        */
+        ~DynLib();
+
+        /** Load the library
+        */
+        void load();
+        /** Unload the library
+        */
+        void unload();
+		/// Get the name of the library
+		const String& getName(void) const { return mName; }
+
+        /**
+            Returns the address of the given symbol from the loaded library.
+            @param
+                strName The name of the symbol to search for
+            @returns
+                If the function succeeds, the returned value is a handle to
+                the symbol.
+            @par
+                If the function fails, the returned value is <b>NULL</b>.
+
+        */
+        void* getSymbol( const String& strName ) const throw();
+
+    protected:
+
+        /// Handle to the loaded library.
+        DYNLIB_HANDLE m_hInst;
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgreDynLibManager.h
===================================================================
--- /OgreMain/include/OgreDynLibManager.h	(revision 5)
+++ /OgreMain/include/OgreDynLibManager.h	(revision 5)
@@ -0,0 +1,110 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __DynLibManager_H__
+#define __DynLibManager_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreSingleton.h"
+
+namespace Ogre {
+    /** Manager for Dynamic-loading Libraries.
+        @remarks
+            This manager keeps a track of all the open dynamic-loading
+            libraries, opens them and returns references to already-open
+            libraries.
+    */
+    class _OgreExport DynLibManager: public Singleton<DynLibManager>
+    {
+	protected:
+		typedef std::map<String, DynLib*> DynLibList;
+		DynLibList mLibList;
+    public:
+        /** Default constructor.
+            @note
+                <br>Should never be called as the singleton is automatically
+                created during the creation of the Root object.
+            @see
+                Root::Root
+        */
+        DynLibManager();
+
+        /** Default destructor.
+            @see
+                Root::~Root
+        */
+        virtual ~DynLibManager();
+
+        /** Loads the passed library.
+            @param
+                filename The name of the library. The extension can be ommitted
+        */
+        DynLib* load(const String& filename);
+
+		/** Unloads the passed library.
+		@param
+		filename The name of the library. The extension can be ommitted
+		*/
+		void unload(DynLib* lib);
+
+		/** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static DynLibManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static DynLibManager* getSingletonPtr(void);
+    };
+}
+
+#endif
Index: /OgreMain/include/OgreEdgeListBuilder.h
===================================================================
--- /OgreMain/include/OgreEdgeListBuilder.h	(revision 5)
+++ /OgreMain/include/OgreEdgeListBuilder.h	(revision 5)
@@ -0,0 +1,261 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __EdgeListBuilder_H__
+#define __EdgeListBuilder_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreVector4.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreRenderOperation.h"
+#include "OgreAlignedAllocator.h"
+
+namespace Ogre {
+
+
+    /** This class contains the information required to describe the edge connectivity of a
+        given set of vertices and indexes. 
+    @remarks 
+        This information is built using the EdgeListBuilder class. Note that for a given mesh,
+        which can be made up of multiple submeshes, there are separate edge lists for when 
+    */
+    class _OgreExport EdgeData
+    {
+    public:
+        /** Basic triangle structure. */
+        struct Triangle {
+            /** The set of indexes this triangle came from (NB it is possible that the triangles on 
+               one side of an edge are using a different vertex buffer from those on the other side.) */
+            size_t indexSet; 
+            /** The vertex set these vertices came from. */
+            size_t vertexSet;
+            size_t vertIndex[3];/// Vertex indexes, relative to the original buffer
+            size_t sharedVertIndex[3]; /// Vertex indexes, relative to a shared vertex buffer with 
+                                        // duplicates eliminated (this buffer is not exposed)
+        };
+        /** Edge data. */
+        struct Edge {
+            /** The indexes of the 2 tris attached, note that tri 0 is the one where the 
+                indexes run _anti_ clockwise along the edge. Indexes must be
+                reversed for tri 1. */
+            size_t triIndex[2];
+            /** The vertex indices for this edge. Note that both vertices will be in the vertex
+                set as specified in 'vertexSet', which will also be the same as tri 0 */
+            size_t vertIndex[2];
+            /** Vertex indices as used in the shared vertex list, not exposed. */
+            size_t sharedVertIndex[2];
+            /** Indicates if this is a degenerate edge, ie it does not have 2 triangles */
+            bool degenerate;
+        };
+
+        // Array of 4D vector of triangle face normal, which is unit vector othogonal
+        // to the triangles, plus distance from origin.
+        // Use aligned allocator here because we are intented to use in SIMD optimised routines .
+        typedef std::vector<Vector4, AlignedAllocator<Vector4> > TriangleFaceNormalList;
+
+        // Working vector used when calculating the silhouette.
+        // Use std::vector<char> instead of std::vector<bool> which might implemented
+        // similar bit-fields causing loss performance.
+        typedef std::vector<char> TriangleLightFacingList;
+
+        typedef std::vector<Triangle> TriangleList;
+        typedef std::vector<Edge> EdgeList;
+
+        /** A group of edges sharing the same vertex data. */
+        struct EdgeGroup
+        {
+            /** The vertex set index that contains the vertices for this edge group. */
+            size_t vertexSet;
+            /** Pointer to vertex data used by this edge group. */
+            const VertexData* vertexData;
+            /** Index to main triangles array, indicate the first triangle of this edge
+                group, and all triangles of this edge group are stored continuous in
+                main triangles array.
+            */
+            size_t triStart;
+            /** Number triangles of this edge group. */
+            size_t triCount;
+            /** The edges themselves. */
+            EdgeList edges;
+
+        };
+
+        typedef std::vector<EdgeGroup> EdgeGroupList;
+
+        /** Main triangles array, stores all triangles of this edge list. Note that
+            triangles are grouping against edge group.
+        */
+        TriangleList triangles;
+        /** All triangle face normals. It should be 1:1 with triangles. */
+        TriangleFaceNormalList triangleFaceNormals;
+        /** Triangle light facing states. It should be 1:1 with triangles. */
+        TriangleLightFacingList triangleLightFacings;
+        /** All edge groups of this edge list. */
+        EdgeGroupList edgeGroups;
+        /** Flag indicate the mesh is manifold. */
+        bool isClosed;
+
+
+        /** Calculate the light facing state of the triangles in this edge list
+        @remarks
+            This is normally the first stage of calculating a silhouette, ie
+            establishing which tris are facing the light and which are facing
+            away. This state is stored in the 'triangleLightFacings'.
+        @param lightPos 4D position of the light in object space, note that 
+            for directional lights (which have no position), the w component
+            is 0 and the x/y/z position are the direction.
+        */
+        void updateTriangleLightFacing(const Vector4& lightPos);
+        /** Updates the face normals for this edge list based on (changed)
+            position information, useful for animated objects. 
+        @param vertexSet The vertex set we are updating
+        @param positionBuffer The updated position buffer, must contain ONLY xyz
+        */
+        void updateFaceNormals(size_t vertexSet, const HardwareVertexBufferSharedPtr& positionBuffer);
+
+
+
+        // Debugging method
+        void log(Log* log);
+        
+    };
+
+    /** General utility class for building edge lists for geometry.
+    @remarks
+        You can add multiple sets of vertex and index data to build and edge list. 
+        Edges will be built between the various sets as well as within sets; this allows 
+        you to use a model which is built from multiple SubMeshes each using 
+        separate index and (optionally) vertex data and still get the same connectivity 
+        information. It's important to note that the indexes for the edge will be constrained
+        to a single vertex buffer though (this is required in order to render the edge).
+    */
+    class _OgreExport EdgeListBuilder 
+    {
+    public:
+
+        EdgeListBuilder();
+        virtual ~EdgeListBuilder();
+        /** Add a set of vertex geometry data to the edge builder. 
+        @remarks
+            You must add at least one set of vertex data to the builder before invoking the
+            build method.
+        */
+        void addVertexData(const VertexData* vertexData);
+        /** Add a set of index geometry data to the edge builder. 
+        @remarks
+            You must add at least one set of index data to the builder before invoking the
+            build method.
+        @param indexData The index information which describes the triangles.
+        @param vertexSet The vertex data set this index data refers to; you only need to alter this
+            if you have added multiple sets of vertices
+        @param opType The operation type used to render these indexes. Only triangle types
+            are supported (no point or line types)
+        */
+        void addIndexData(const IndexData* indexData, size_t vertexSet = 0, 
+            RenderOperation::OperationType opType = RenderOperation::OT_TRIANGLE_LIST);
+
+        /** Builds the edge information based on the information built up so far.
+        @remarks
+            The caller takes responsibility for deleting the returned structure.
+        */
+        EdgeData* build(void);
+
+        /// Debugging method
+        void log(Log* l);
+    protected:
+
+        /** A vertex can actually represent several vertices in the final model, because
+		vertices along texture seams etc will have been duplicated. In order to properly
+		evaluate the surface properties, a single common vertex is used for these duplicates,
+		and the faces hold the detail of the duplicated vertices.
+		*/
+        struct CommonVertex {
+            Vector3  position;  // location of point in euclidean space
+	        size_t index;       // place of vertex in common vertex list
+            size_t vertexSet;   // The vertex set this came from
+            size_t indexSet;    // The index set this was referenced (first) from
+            size_t originalIndex; // place of vertex in original vertex set
+        };
+        /** A set of indexed geometry data */
+        struct Geometry {
+            size_t vertexSet;           // The vertex data set this geometry data refers to
+            size_t indexSet;            // The index data set this geometry data refers to
+            const IndexData* indexData; // The index information which describes the triangles.
+            RenderOperation::OperationType opType;  // The operation type used to render this geometry
+        };
+        /** Comparator for sorting geometries by vertex set */
+        struct geometryLess {
+            bool operator()(const Geometry& a, const Geometry& b) const
+            {
+                if (a.vertexSet < b.vertexSet) return true;
+                if (a.vertexSet > b.vertexSet) return false;
+                return a.indexSet < b.indexSet;
+            }
+        };
+        /** Comparator for unique vertex list */
+        struct vectorLess {
+            bool operator()(const Vector3& a, const Vector3& b) const
+            {
+                if (a.x < b.x) return true;
+                if (a.x > b.x) return false;
+                if (a.y < b.y) return true;
+                if (a.y > b.y) return false;
+                return a.z < b.z;
+            }
+        };
+
+        typedef std::vector<const VertexData*> VertexDataList;
+        typedef std::vector<Geometry> GeometryList;
+        typedef std::vector<CommonVertex> CommonVertexList;
+
+        GeometryList mGeometryList;
+        VertexDataList mVertexDataList;
+        CommonVertexList mVertices;
+        EdgeData* mEdgeData;
+		/// Map for identifying common vertices
+		typedef std::map<Vector3, size_t, vectorLess> CommonVertexMap;
+		CommonVertexMap mCommonVertexMap;
+        /** Edge map, used to connect edges. Note we allow many triangles on an edge,
+        after connected an existing edge, we will remove it and never used again.
+        */
+        typedef std::multimap< std::pair<size_t, size_t>, std::pair<size_t, size_t> > EdgeMap;
+        EdgeMap mEdgeMap;
+
+        void buildTrianglesEdges(const Geometry &geometry);
+
+        /// Finds an existing common vertex, or inserts a new one
+        size_t findOrCreateCommonVertex(const Vector3& vec, size_t vertexSet, 
+            size_t indexSet, size_t originalIndex);
+        /// Connect existing edge or create a new edge - utility method during building
+        void connectOrCreateEdge(size_t vertexSet, size_t triangleIndex, size_t vertIndex0, size_t vertIndex1, 
+            size_t sharedVertIndex0, size_t sharedVertIndex1);
+    };
+
+}
+#endif
+
Index: /OgreMain/include/OgreEntity.h
===================================================================
--- /OgreMain/include/OgreEntity.h	(revision 5)
+++ /OgreMain/include/OgreEntity.h	(revision 5)
@@ -0,0 +1,771 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Entity_H__
+#define __Entity_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreCommon.h"
+
+#include "OgreString.h"
+#include "OgreMovableObject.h"
+#include "OgreQuaternion.h"
+#include "OgreVector3.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreMesh.h"
+
+namespace Ogre {
+	/** Defines an instance of a discrete, movable object based on a Mesh.
+	@remarks
+	Ogre generally divides renderable objects into 2 groups, discrete
+	(separate) and relatively small objects which move around the world,
+	and large, sprawling geometry which makes up generally immovable
+	scenery, aka 'level geometry'.
+	@par
+	The Mesh and SubMesh classes deal with the definition of the geometry
+	used by discrete movable objects. Entities are actual instances of
+	objects based on this geometry in the world. Therefore there is
+	usually a single set Mesh for a car, but there may be multiple
+	entities based on it in the world. Entities are able to override
+	aspects of the Mesh it is defined by, such as changing material
+	properties per instance (so you can have many cars using the same
+	geometry but different textures for example). Because a Mesh is split
+	into SubMeshes for this purpose, the Entity class is a grouping class
+	(much like the Mesh class) and much of the detail regarding
+	individual changes is kept in the SubEntity class. There is a 1:1
+	relationship between SubEntity instances and the SubMesh instances
+	associated with the Mesh the Entity is based on.
+	@par
+	Entity and SubEntity classes are never created directly. Use the
+	createEntity method of the SceneManager (passing a model name) to
+	create one.
+	@par
+	Entities are included in the scene by associating them with a
+	SceneNode, using the attachEntity method. See the SceneNode class
+	for full information.
+	@note
+	No functions were declared virtual to improve performance.
+	*/
+	class _OgreExport Entity: public MovableObject, public Resource::Listener
+	{
+		// Allow EntityFactory full access
+		friend class EntityFactory;
+		friend class SubEntity;
+	public:
+		typedef std::set<Entity*> EntitySet;
+
+	protected:
+
+		/** Private constructor (instances cannot be created directly).
+		*/
+		Entity();
+		/** Private constructor - specify name (the usual constructor used).
+		*/
+		Entity( const String& name, MeshPtr& mesh);
+
+		/** The Mesh that this Entity is based on.
+		*/
+		MeshPtr mMesh;
+
+		/** List of SubEntities (point to SubMeshes).
+		*/
+		typedef std::vector<SubEntity*> SubEntityList;
+		SubEntityList mSubEntityList;
+
+
+		/// State of animation for animable meshes
+		AnimationStateSet* mAnimationState;
+
+
+		/// Temp buffer details for software skeletal anim of shared geometry
+		TempBlendedBufferInfo mTempSkelAnimInfo;
+		/// Vertex data details for software skeletal anim of shared geometry
+		VertexData* mSkelAnimVertexData;
+		/// Temp buffer details for software vertex anim of shared geometry
+		TempBlendedBufferInfo mTempVertexAnimInfo;
+		/// Vertex data details for software vertex anim of shared geometry
+		VertexData* mSoftwareVertexAnimVertexData;
+		/// Vertex data details for hardware vertex anim of shared geometry
+		/// - separate since we need to s/w anim for shadows whilst still altering
+		///   the vertex data for hardware morphing (pos2 binding)
+		VertexData* mHardwareVertexAnimVertexData;
+		/// Have we applied any vertex animation to shared geometry?
+		bool mVertexAnimationAppliedThisFrame;
+        /// Have the temp buffers already had their geometry prepared for use in rendering shadow volumes?
+        bool mPreparedForShadowVolumes;
+
+		/** Internal method - given vertex data which could be from the Mesh or
+		any submesh, finds the temporary blend copy. */
+		const VertexData* findBlendedVertexData(const VertexData* orig);
+		/** Internal method - given vertex data which could be from the Mesh or
+		any SubMesh, finds the corresponding SubEntity. */
+		SubEntity* findSubEntityForVertexData(const VertexData* orig);
+
+		/** Internal method for extracting metadata out of source vertex data
+		for fast assignment of temporary buffers later. */
+		void extractTempBufferInfo(VertexData* sourceData, TempBlendedBufferInfo* info);
+		/** Internal method to clone vertex data definitions but to remove blend buffers. */
+		VertexData* cloneVertexDataRemoveBlendInfo(const VertexData* source);
+		/** Internal method for preparing this Entity for use in animation. */
+		void prepareTempBlendBuffers(void);
+		/** Mark all vertex data as so far unanimated.
+		*/
+		void markBuffersUnusedForAnimation(void);
+		/** Internal method to restore original vertex data where we didn't
+			perform any vertex animation this frame.
+		*/
+		void restoreBuffersForUnusedAnimation(bool hardwareAnimation);
+
+		/** Ensure that any unbound  pose animation buffers are bound to a safe
+			default.
+			@param srcData Original vertex data containing original positions
+			@param destData Hardware animation vertex data to be checked
+		*/
+		void bindMissingHardwarePoseBuffers(const VertexData* srcData, 
+			VertexData* destData);
+
+		/// Cached bone matrices, including any world transform
+        Matrix4 *mBoneWorldMatrices;
+        /// Cached bone matrices in skeleton local space, might shares with other entity instances.
+		Matrix4 *mBoneMatrices;
+		unsigned short mNumBoneMatrices;
+		/// Records the last frame in which animation was updated
+		unsigned long mFrameAnimationLastUpdated;
+
+		/// Perform all the updates required for an animated entity
+		void updateAnimation(void);
+
+		/// Records the last frame in which the bones was updated
+		/// It's a pointer because it can be shared between different entities with
+		/// a shared skeleton.
+		unsigned long *mFrameBonesLastUpdated;
+
+		/**
+		* A set of all the entities which shares a single SkeletonInstance.
+		* This is only created if the entity is in fact sharing it's SkeletonInstance with
+		* other Entities.
+		*/
+		EntitySet* mSharedSkeletonEntities;
+
+		/// Private method to cache bone matrices from skeleton
+		void cacheBoneMatrices(void);
+
+		/// Flag determines whether or not to display skeleton
+		bool mDisplaySkeleton;
+		/// Flag indicating whether hardware animation is supported by this entities materials
+		bool mHardwareAnimation;
+		/// Number of hardware poses supported by materials
+		ushort mHardwarePoseCount;
+		/// Flag indicating whether we have a vertex program in use on any of our subentities
+		bool mVertexProgramInUse;
+        /// Counter indicating number of requests for software animation.
+        int mSoftwareAnimationRequests;
+        /// Counter indicating number of requests for software blended normals.
+        int mSoftwareAnimationNormalsRequests;
+
+
+		/// The LOD number of the mesh to use, calculated by _notifyCurrentCamera
+		ushort mMeshLodIndex;
+
+		/// LOD bias factor, inverted for optimisation when calculating adjusted depth
+		Real mMeshLodFactorInv;
+		/// Index of minimum detail LOD (NB higher index is lower detail)
+		ushort mMinMeshLodIndex;
+		/// Index of maximum detail LOD (NB lower index is higher detail)
+		ushort mMaxMeshLodIndex;
+
+		/// LOD bias factor, inverted for optimisation when calculating adjusted depth
+		Real mMaterialLodFactorInv;
+		/// Index of minimum detail LOD (NB higher index is lower detail)
+		ushort mMinMaterialLodIndex;
+		/// Index of maximum detail LOD (NB lower index is higher detail)
+		ushort mMaxMaterialLodIndex;
+
+		/** List of LOD Entity instances (for manual LODs).
+		We don't know when the mesh is using manual LODs whether one LOD to the next will have the
+		same number of SubMeshes, therefore we have to allow a separate Entity list
+		with each alternate one.
+		*/
+		typedef std::vector<Entity*> LODEntityList;
+		LODEntityList mLodEntityList;
+
+		/** This Entity's personal copy of the skeleton, if skeletally animated
+		*/
+		SkeletonInstance* mSkeletonInstance;
+
+		/// Has this entity been initialised yet?
+		bool mInitialised;
+
+		/// Last parent xform
+		Matrix4 mLastParentXform;
+
+		/** Builds a list of SubEntities based on the SubMeshes contained in the Mesh. */
+		void buildSubEntityList(MeshPtr& mesh, SubEntityList* sublist);
+
+		/// internal implementation of attaching a 'child' object to this entity and assign the parent node to the child entity
+		void attachObjectImpl(MovableObject *pMovable, TagPoint *pAttachingPoint);
+
+		/// internal implementation of detaching a 'child' object of this entity and clear the parent node of the child entity
+		void detachObjectImpl(MovableObject* pObject);
+
+		/// internal implementation of detaching all 'child' objects of this entity
+		void detachAllObjectsImpl(void);
+
+		/// Trigger reevaluation of the kind of vertex processing in use
+		void reevaluateVertexProcessing(void);
+
+		/// Apply vertex animation
+		void applyVertexAnimation(bool hardwareAnimation, bool stencilShadows);
+		/// Initialise the hardware animation elements for given vertex data
+		void initHardwareAnimationElements(VertexData* vdata,
+			ushort numberOfElements);
+		/// Are software vertex animation temp buffers bound?
+		bool tempVertexAnimBuffersBound(void) const;
+        /// Are software skeleton animation temp buffers bound?
+        bool tempSkelAnimBuffersBound(bool requestNormals) const;
+
+	public:
+		/// Contains the child objects (attached to bones) indexed by name
+		typedef std::map<String, MovableObject*> ChildObjectList;
+	protected:
+		ChildObjectList mChildObjectList;
+
+
+		/// Bounding box that 'contains' all the mesh of each child entity
+		mutable AxisAlignedBox mFullBoundingBox;
+
+		bool mNormaliseNormals;
+
+		ShadowRenderableList mShadowRenderables;
+
+		/** Nested class to allow entity shadows. */
+		class _OgreExport EntityShadowRenderable : public ShadowRenderable
+		{
+		protected:
+			Entity* mParent;
+			// Shared link to position buffer
+			HardwareVertexBufferSharedPtr mPositionBuffer;
+			// Shared link to w-coord buffer (optional)
+			HardwareVertexBufferSharedPtr mWBuffer;
+			// Link to current vertex data used to bind (maybe changes)
+			const VertexData* mCurrentVertexData;
+			// Original position buffer source binding
+			unsigned short mOriginalPosBufferBinding;
+			/// Link to SubEntity, only present if SubEntity has it's own geometry
+			SubEntity* mSubEntity;
+
+
+		public:
+			EntityShadowRenderable(Entity* parent,
+				HardwareIndexBufferSharedPtr* indexBuffer, const VertexData* vertexData,
+				bool createSeparateLightCap, SubEntity* subent, bool isLightCap = false);
+			~EntityShadowRenderable();
+			/// Overridden from ShadowRenderable
+			void getWorldTransforms(Matrix4* xform) const;
+			/// Overridden from ShadowRenderable
+			const Quaternion& getWorldOrientation(void) const;
+			/// Overridden from ShadowRenderable
+			const Vector3& getWorldPosition(void) const;
+			HardwareVertexBufferSharedPtr getPositionBuffer(void) { return mPositionBuffer; }
+			HardwareVertexBufferSharedPtr getWBuffer(void) { return mWBuffer; }
+			/// Rebind the source positions (for temp buffer users)
+			void rebindPositionBuffer(const VertexData* vertexData, bool force);
+			/// Overridden from ShadowRenderable
+			bool isVisible(void) const;
+
+		};
+	public:
+		/** Default destructor.
+		*/
+		~Entity();
+
+		/** Gets the Mesh that this Entity is based on.
+		*/
+		const MeshPtr& getMesh(void) const;
+
+		/** Gets a pointer to a SubEntity, ie a part of an Entity.
+		*/
+		SubEntity* getSubEntity(unsigned int index) const;
+
+		/** Gets a pointer to a SubEntity by name
+		@remarks - names should be initialized during a Mesh creation.
+		*/
+		SubEntity* getSubEntity( const String& name ) const;
+
+		/** Retrieves the number of SubEntity objects making up this entity.
+		*/
+		unsigned int getNumSubEntities(void) const;
+
+		/** Clones this entity and returns a pointer to the clone.
+		@remarks
+		Useful method for duplicating an entity. The new entity must be
+		given a unique name, and is not attached to the scene in any way
+		so must be attached to a SceneNode to be visible (exactly as
+		entities returned from SceneManager::createEntity).
+		@param
+		newName Name for the new entity.
+		*/
+		Entity* clone( const String& newName ) const;
+
+		/** Sets the material to use for the whole of this entity.
+		@remarks
+		This is a shortcut method to set all the materials for all
+		subentities of this entity. Only use this method is you want to
+		set the same material for all subentities or if you know there
+		is only one. Otherwise call getSubEntity() and call the same
+		method on the individual SubEntity.
+		*/
+		void setMaterialName(const String& name);
+
+		/** Overridden - see MovableObject.
+		*/
+		void _notifyCurrentCamera(Camera* cam);
+
+		/// Overridden - see MovableObject.
+		void setRenderQueueGroup(uint8 queueID);
+
+		/** Overridden - see MovableObject.
+		*/
+		const AxisAlignedBox& getBoundingBox(void) const;
+
+		/// merge all the child object Bounds a return it
+		AxisAlignedBox getChildObjectsBoundingBox(void) const;
+
+		/** Overridden - see MovableObject.
+		*/
+		void _updateRenderQueue(RenderQueue* queue);
+
+		/** Overridden from MovableObject */
+		const String& getMovableType(void) const;
+
+		/** For entities based on animated meshes, gets the AnimationState object for a single animation.
+		@remarks
+		You animate an entity by updating the animation state objects. Each of these represents the
+		current state of each animation available to the entity. The AnimationState objects are
+		initialised from the Mesh object.
+		*/
+		AnimationState* getAnimationState(const String& name) const;
+		/** For entities based on animated meshes, gets the AnimationState objects for all animations.
+		@returns
+		In case the entity is animated, this functions returns the pointer to a AnimationStateSet
+		containing all animations of the entries. If the entity is not animated, it returns 0.
+		@remarks
+		You animate an entity by updating the animation state objects. Each of these represents the
+		current state of each animation available to the entity. The AnimationState objects are
+		initialised from the Mesh object.
+		*/
+		AnimationStateSet* getAllAnimationStates(void) const;
+
+		/** Tells the Entity whether or not it should display it's skeleton, if it has one.
+		*/
+		void setDisplaySkeleton(bool display);
+
+		/** Returns whether or not the entity is currently displaying its skeleton.
+		*/
+		bool getDisplaySkeleton(void) const;
+
+
+        /** Gets a pointer to the entity representing the numbered manual level of detail.
+        @remarks
+            The zero-based index never includes the original entity, unlike
+			Mesh::getLodLevel.
+        */
+        Entity* getManualLodLevel(size_t index) const;
+
+        /** Returns the number of manual levels of detail that this entity supports.
+        @remarks
+            This number never includes the original entity, it is difference
+            with Mesh::getNumLodLevels.
+        */
+        size_t getNumManualLodLevels(void) const;
+
+		/** Sets a level-of-detail bias for the mesh detail of this entity.
+		@remarks
+		Level of detail reduction is normally applied automatically based on the Mesh
+		settings. However, it is possible to influence this behaviour for this entity
+		by adjusting the LOD bias. This 'nudges' the mesh level of detail used for this
+		entity up or down depending on your requirements. You might want to use this
+		if there was a particularly important entity in your scene which you wanted to
+		detail better than the others, such as a player model.
+		@par
+		There are three parameters to this method; the first is a factor to apply; it
+		defaults to 1.0 (no change), by increasing this to say 2.0, this model would
+		take twice as long to reduce in detail, whilst at 0.5 this entity would use lower
+		detail versions twice as quickly. The other 2 parameters are hard limits which
+		let you set the maximum and minimum level-of-detail version to use, after all
+		other calculations have been made. This lets you say that this entity should
+		never be simplified, or that it can only use LODs below a certain level even
+		when right next to the camera.
+		@param factor Proportional factor to apply to the distance at which LOD is changed.
+		Higher values increase the distance at which higher LODs are displayed (2.0 is
+		twice the normal distance, 0.5 is half).
+		@param maxDetailIndex The index of the maximum LOD this entity is allowed to use (lower
+		indexes are higher detail: index 0 is the original full detail model).
+		@param minDetailIndex The index of the minimum LOD this entity is allowed to use (higher
+		indexes are lower detail). Use something like 99 if you want unlimited LODs (the actual
+		LOD will be limited by the number in the Mesh)
+		*/
+		void setMeshLodBias(Real factor, ushort maxDetailIndex = 0, ushort minDetailIndex = 99);
+
+		/** Sets a level-of-detail bias for the material detail of this entity.
+		@remarks
+		Level of detail reduction is normally applied automatically based on the Material
+		settings. However, it is possible to influence this behaviour for this entity
+		by adjusting the LOD bias. This 'nudges' the material level of detail used for this
+		entity up or down depending on your requirements. You might want to use this
+		if there was a particularly important entity in your scene which you wanted to
+		detail better than the others, such as a player model.
+		@par
+		There are three parameters to this method; the first is a factor to apply; it
+		defaults to 1.0 (no change), by increasing this to say 2.0, this entity would
+		take twice as long to use a lower detail material, whilst at 0.5 this entity
+		would use lower detail versions twice as quickly. The other 2 parameters are
+		hard limits which let you set the maximum and minimum level-of-detail index
+		to use, after all other calculations have been made. This lets you say that
+		this entity should never be simplified, or that it can only use LODs below
+		a certain level even when right next to the camera.
+		@param factor Proportional factor to apply to the distance at which LOD is changed.
+		Higher values increase the distance at which higher LODs are displayed (2.0 is
+		twice the normal distance, 0.5 is half).
+		@param maxDetailIndex The index of the maximum LOD this entity is allowed to use (lower
+		indexes are higher detail: index 0 is the original full detail model).
+		@param minDetailIndex The index of the minimum LOD this entity is allowed to use (higher
+		indexes are lower detail. Use something like 99 if you want unlimited LODs (the actual
+		LOD will be limited by the number of lod indexes used in the Material)
+		*/
+		void setMaterialLodBias(Real factor, ushort maxDetailIndex = 0, ushort minDetailIndex = 99);
+
+		/** Sets whether the polygon mode of this entire entity may be
+		overridden by the camera detail settings.
+		*/
+		void setPolygonModeOverrideable(bool PolygonModeOverrideable);
+		/** Attaches another object to a certain bone of the skeleton which this entity uses.
+		@remarks
+		This method can be used to attach another object to an animated part of this entity,
+		by attaching it to a bone in the skeleton (with an offset if required). As this entity
+		is animated, the attached object will move relative to the bone to which it is attached.
+		@par
+		An exception is thrown if the movable object is already attached to the bone, another bone or scenenode.
+		If the entity has no skeleton or the bone name cannot be found then an exception is thrown.
+		@param boneName The name of the bone (in the skeleton) to attach this object
+		@param pMovable Pointer to the object to attach
+		@param offsetOrientation An adjustment to the orientation of the attached object, relative to the bone.
+		@param offsetPosition An adjustment to the position of the attached object, relative to the bone.
+		@returns The TagPoint to which the object has been attached
+		*/
+		TagPoint* attachObjectToBone(const String &boneName,
+			MovableObject *pMovable,
+			const Quaternion &offsetOrientation = Quaternion::IDENTITY,
+			const Vector3 &offsetPosition = Vector3::ZERO);
+
+		/** Detach a MovableObject previously attached using attachObjectToBone.
+            If the movable object name is not found then an exception is raised.
+        @param movableName is the name of the movable object to be detached.
+		*/
+		MovableObject* detachObjectFromBone(const String &movableName);
+
+		/** Detaches an object by pointer.
+		@remarks
+		Use this method to destroy a MovableObject which is attached to a bone of belonging this entity.
+		But sometimes the object may be not in the child object list because it is a lod entity,
+		this method can safely detect and ignore in this case and won't raise an exception.
+		*/
+		void detachObjectFromBone(MovableObject* obj);
+
+		/// Detach all MovableObjects previously attached using attachObjectToBone
+		void detachAllObjectsFromBone(void);
+
+		typedef MapIterator<ChildObjectList> ChildObjectListIterator;
+		/** Gets an iterator to the list of objects attached to bones on this entity. */
+		ChildObjectListIterator getAttachedObjectIterator(void);
+		/** @see MovableObject::getBoundingRadius */
+		Real getBoundingRadius(void) const;
+
+		/** @copy MovableObject::getWorldBoundingBox */
+		const AxisAlignedBox& getWorldBoundingBox(bool derive = false) const;
+		/** @copy MovableObject::getWorldBoundingSphere */
+		const Sphere& getWorldBoundingSphere(bool derive = false) const;
+
+        /** If set to true, this forces normals of this entity to be normalised
+            dynamically by the hardware.
+        @remarks
+            This option can be used to prevent lighting variations when scaling an
+            Entity using a SceneNode - normally because this scaling is hardware
+            based, the normals get scaled too which causes lighting to become inconsistent.
+            However, this has an overhead so only do this if you really need to.
+        */
+        void setNormaliseNormals(bool normalise) { mNormaliseNormals = normalise; }
+
+        /** Returns true if this entity has auto-normalisation of normals set. */
+        bool getNormaliseNormals(void) const {return mNormaliseNormals; }
+
+
+        /** Overridden member from ShadowCaster. */
+        EdgeData* getEdgeList(void);
+		/** Overridden member from ShadowCaster. */
+		bool hasEdgeList(void);
+        /** Overridden member from ShadowCaster. */
+        ShadowRenderableListIterator getShadowVolumeRenderableIterator(
+            ShadowTechnique shadowTechnique, const Light* light,
+            HardwareIndexBufferSharedPtr* indexBuffer,
+            bool extrudeVertices, Real extrusionDistance, unsigned long flags = 0 );
+
+		/** Internal method for retrieving bone matrix information. */
+		const Matrix4* _getBoneMatrices(void) const { return mBoneMatrices;}
+		/** Internal method for retrieving bone matrix information. */
+		unsigned short _getNumBoneMatrices(void) const { return mNumBoneMatrices; }
+		/** Returns whether or not this entity is skeletally animated. */
+		bool hasSkeleton(void) const { return mSkeletonInstance != 0; }
+		/** Get this Entity's personal skeleton instance. */
+		SkeletonInstance* getSkeleton(void) const { return mSkeletonInstance; }
+		/** Returns whether or not hardware animation is enabled.
+		@remarks
+		Because fixed-function indexed vertex blending is rarely supported
+		by existing graphics cards, hardware animation can only be done if
+		the vertex programs in the materials used to render an entity support
+		it. Therefore, this method will only return true if all the materials
+		assigned to this entity have vertex programs assigned, and all those
+		vertex programs must support 'includes_morph_animation true' if using
+        morph animation, 'includes_pose_animation true' if using pose animation
+        and 'includes_skeletal_animation true' if using skeletal animation.
+		*/
+		bool isHardwareAnimationEnabled(void) const { return mHardwareAnimation; }
+
+		/** Overridden from MovableObject */
+		void _notifyAttached(Node* parent, bool isTagPoint = false);
+        /** Returns the number of requests that have been made for software animation
+        @remarks
+            If non-zero then software animation will be performed in updateAnimation
+            regardless of the current setting of isHardwareAnimationEnabled or any
+            internal optimise for eliminate software animation. Requests for software
+            animation are made by calling the addSoftwareAnimationRequest() method.
+        */
+        int getSoftwareAnimationRequests(void) const { return mSoftwareAnimationRequests; }
+        /** Returns the number of requests that have been made for software animation of normals
+        @remarks
+            If non-zero, and getSoftwareAnimationRequests() also returns non-zero,
+            then software animation of normals will be performed in updateAnimation
+            regardless of the current setting of isHardwareAnimationEnabled or any
+            internal optimise for eliminate software animation. Currently it is not
+            possible to force software animation of only normals. Consequently this
+            value is always less than or equal to that returned by getSoftwareAnimationRequests().
+            Requests for software animation of normals are made by calling the
+            addSoftwareAnimationRequest() method with 'true' as the parameter.
+        */
+        int getSoftwareAnimationNormalsRequests(void) const { return mSoftwareAnimationNormalsRequests; }
+        /** Add a request for software animation
+        @remarks
+            Tells the entity to perform animation calculations for skeletal/vertex
+            animations in software, regardless of the current setting of
+            isHardwareAnimationEnabled().  Software animation will be performed
+            any time one or more requests have been made.  If 'normalsAlso' is
+            'true', then the entity will also do software blending on normal
+            vectors, in addition to positions. This advanced method useful for
+            situations in which access to actual mesh vertices is required,
+            such as accurate collision detection or certain advanced shading
+            techniques. When software animation is no longer needed,
+            the caller of this method should always remove the request by calling
+            removeSoftwareAnimationRequest(), passing the same value for
+            'normalsAlso'.
+        */
+        void addSoftwareAnimationRequest(bool normalsAlso);
+        /** Removes a request for software animation
+        @remarks
+            Calling this decrements the entity's internal counter of the number
+            of requests for software animation.  If the counter is already zero
+            then calling this method throws an exception.  The 'normalsAlso'
+            flag if set to 'true' will also decrement the internal counter of
+            number of requests for software animation of normals.
+        */
+        void removeSoftwareAnimationRequest(bool normalsAlso);
+
+		/** Shares the SkeletonInstance with the supplied entity.
+		*   Note that in order for this to work, both entities must have the same
+		*   Skeleton.
+		*/
+		void shareSkeletonInstanceWith(Entity* entity);
+
+		/** Returns whether or not this entity is either morph or pose animated.
+		*/
+		bool hasVertexAnimation(void) const;
+
+
+		/** Stops sharing the SkeletonInstance with other entities.
+		*/
+		void stopSharingSkeletonInstance();
+
+
+		/**
+		* Returns whether this entity shares it's SkeltonInstance with other entity instances.
+		*/
+		inline bool sharesSkeletonInstance() const { return mSharedSkeletonEntities != NULL; }
+
+		/**
+		* Returns a pointer to the set of entities which share a SkeletonInstance.
+		* If this instance does not share it's SkeletonInstance with other instances NULL will be returned
+		*/
+		inline const EntitySet* getSkeletonInstanceSharingSet() const { return mSharedSkeletonEntities; }
+
+		/** Updates the internal animation state set to include the latest
+		available animations from the attached skeleton.
+		@remarks
+		Use this method if you manually add animations to a skeleton, or have
+		linked the skeleton to another for animation purposes since creating
+		this entity.
+		@note
+		If you have called getAnimationState prior to calling this method,
+		the pointers will still remain valid.
+		*/
+		void refreshAvailableAnimationState(void);
+
+		/** Advanced method to perform all the updates required for an animated entity.
+		@remarks
+		You don't normally need to call this, but it's here incase you wish
+		to manually update the animation of an Entity at a specific point in
+		time. Animation will not be updated more than once a frame no matter
+		how many times you call this method.
+		*/
+		void _updateAnimation(void);
+
+        /** Tests if any animation applied to this entity.
+        @remarks
+            An entity is animated if any animation state is enabled, or any manual bone
+            applied to the skeleton.
+        */
+        bool _isAnimated(void) const;
+
+        /** Tests if skeleton was animated.
+        */
+        bool _isSkeletonAnimated(void) const;
+
+		/** Advanced method to get the temporarily blended skeletal vertex information
+		for entities which are software skinned.
+        @remarks
+            Internal engine will eliminate software animation if possible, this
+            information is unreliable unless added request for software animation
+            via addSoftwareAnimationRequest.
+        @note
+            The positions/normals of the returned vertex data is in object space.
+		*/
+		VertexData* _getSkelAnimVertexData(void) const;
+		/** Advanced method to get the temporarily blended software vertex animation information
+        @remarks
+            Internal engine will eliminate software animation if possible, this
+            information is unreliable unless added request for software animation
+            via addSoftwareAnimationRequest.
+        @note
+            The positions/normals of the returned vertex data is in object space.
+		*/
+		VertexData* _getSoftwareVertexAnimVertexData(void) const;
+		/** Advanced method to get the hardware morph vertex information
+        @note
+            The positions/normals of the returned vertex data is in object space.
+		*/
+		VertexData* _getHardwareVertexAnimVertexData(void) const;
+		/** Advanced method to get the temp buffer information for software
+		skeletal animation.
+		*/
+		TempBlendedBufferInfo* _getSkelAnimTempBufferInfo(void);
+		/** Advanced method to get the temp buffer information for software
+		morph animation.
+		*/
+		TempBlendedBufferInfo* _getVertexAnimTempBufferInfo(void);
+		/// Override to return specific type flag
+		uint32 getTypeFlags(void) const;
+		/// Retrieve the VertexData which should be used for GPU binding
+		VertexData* getVertexDataForBinding(void);
+
+		/// Identify which vertex data we should be sending to the renderer
+		enum VertexDataBindChoice
+		{
+			BIND_ORIGINAL,
+			BIND_SOFTWARE_SKELETAL,
+			BIND_SOFTWARE_MORPH,
+			BIND_HARDWARE_MORPH
+		};
+		/// Choose which vertex data to bind to the renderer
+		VertexDataBindChoice chooseVertexDataForBinding(bool hasVertexAnim) const;
+
+		/** Are buffers already marked as vertex animated? */
+		bool _getBuffersMarkedForAnimation(void) const { return mVertexAnimationAppliedThisFrame; }
+		/** Mark just this vertex data as animated.
+		*/
+		void _markBuffersUsedForAnimation(void);
+
+		/** Has this Entity been initialised yet?
+		@remarks	
+			If this returns false, it means this Entity hasn't been completely
+			constructed yet from the underlying resources (Mesh, Skeleton), which 
+			probably means they were delay-loaded and aren't available yet. This
+			Entity won't render until it has been successfully initialised, nor
+			will many of the manipulation methods function.
+		*/
+		bool isInitialised(void) const { return mInitialised; }
+
+		/** Try to initialise the Entity from the underlying resources.
+		@remarks
+			This method builds the internal structures of the Entity based on it
+			resources (Mesh, Skeleton). This may or may not succeed if the 
+			resources it references have been earmarked for background loading,
+			so you should check isInitialised afterwards to see if it was sucessful.
+		@param forceReinitialise If true, this forces the Entity to tear down it's
+			internal structures and try to rebuild them. Useful if you changed the
+			content of a Mesh or Skeleton at runtime.
+		*/
+		void _initialise(bool forceReinitialise = false);
+		/** Tear down the internal structures of this Entity, rendering it uninitialised. */
+		void _deinitialise(void);
+
+		/** Resource::Listener hook to notify Entity that a delay-loaded Mesh is
+			complete.
+		*/
+		void backgroundLoadingComplete(Resource* res);
+
+
+
+	};
+
+	/** Factory object for creating Entity instances */
+	class _OgreExport EntityFactory : public MovableObjectFactory
+	{
+	protected:
+		MovableObject* createInstanceImpl( const String& name, const NameValuePairList* params);
+	public:
+		EntityFactory() {}
+		~EntityFactory() {}
+
+		static String FACTORY_TYPE_NAME;
+
+		const String& getType(void) const;
+		void destroyInstance( MovableObject* obj);
+
+	};
+
+} // namespace
+
+#endif
Index: /OgreMain/include/OgreErrorDialog.h
===================================================================
--- /OgreMain/include/OgreErrorDialog.h	(revision 5)
+++ /OgreMain/include/OgreErrorDialog.h	(revision 5)
@@ -0,0 +1,50 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __COMMON_OGRE_ERRORDIALOG_H__
+#define __COMMON_OGRE_ERRORDIALOG_H__
+
+#include "OgrePrerequisites.h"
+#include "OgrePlatform.h"
+
+// Bring in the specific platform's header file
+#if defined OGRE_GUI_WIN32
+# include "WIN32/OgreErrorDialogImp.h"
+#elif defined OGRE_GUI_gtk
+# include "gtk/OgreErrorDialogImp.h"
+#elif defined OGRE_GUI_GLX
+# include "GLX/OgreErrorDialogImp.h"
+#elif OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+# include "WIN32/OgreErrorDialogImp.h"
+#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
+# include "GLX/OgreErrorDialogImp.h"
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+# include "OSX/OgreErrorDialogImp.h"
+#endif
+
+#endif
Index: /OgreMain/include/OgreException.h
===================================================================
--- /OgreMain/include/OgreException.h	(revision 5)
+++ /OgreMain/include/OgreException.h	(revision 5)
@@ -0,0 +1,341 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Exception_H_
+#define __Exception_H_
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include <exception>
+
+// Backwards compatibility with old assert mode definitions
+#if OGRE_RELEASE_ASSERT == 1
+#   define OGRE_ASSERT_MODE 1
+#endif
+
+// Check for OGRE assert mode
+
+// RELEASE_EXCEPTIONS mode
+#if OGRE_ASSERT_MODE == 1
+#   ifdef _DEBUG
+#       define OgreAssert( a, b ) assert( (a) && (b) )
+
+#   else
+#       if OGRE_COMP != OGRE_COMPILER_BORL
+#           define OgreAssert( a, b ) if( !(a) ) OGRE_EXCEPT( Ogre::Exception::ERR_RT_ASSERTION_FAILED, (b), "no function info")
+#       else
+#           define OgreAssert( a, b ) if( !(a) ) OGRE_EXCEPT( Ogre::Exception::ERR_RT_ASSERTION_FAILED, (b), __FUNC__ )
+#       endif
+
+#   endif
+
+// EXCEPTIONS mode
+#elif OGRE_ASSERT_MODE == 2
+#   if OGRE_COMP != OGRE_COMPILER_BORL
+#       define OgreAssert( a, b ) if( !(a) ) OGRE_EXCEPT( Ogre::Exception::ERR_RT_ASSERTION_FAILED, (b), "no function info")
+#   else
+#       define OgreAssert( a, b ) if( !(a) ) OGRE_EXCEPT( Ogre::Exception::ERR_RT_ASSERTION_FAILED, (b), __FUNC__ )
+#   endif
+
+// STANDARD mode
+#else
+#   define OgreAssert( a, b ) assert( (a) && (b) )
+
+#endif
+
+namespace Ogre {
+    /** When thrown, provides information about an error that has occurred inside the engine.
+        @remarks
+            OGRE never uses return values to indicate errors. Instead, if an
+            error occurs, an exception is thrown, and this is the object that
+            encapsulates the detail of the problem. The application using
+            OGRE should always ensure that the exceptions are caught, so all
+            OGRE engine functions should occur within a
+            try{} catch(Ogre::Exception& e) {} block.
+        @par
+            The user application should never create any instances of this
+            object unless it wishes to unify its error handling using the
+            same object.
+    */
+	class _OgreExport Exception : public std::exception
+    {
+    protected:
+        long line;
+        int number;
+		String typeName;
+        String description;
+        String source;
+        String file;
+		mutable String fullDesc;
+    public:
+        /** Static definitions of error codes.
+            @todo
+                Add many more exception codes, since we want the user to be able
+                to catch most of them.
+        */
+        enum ExceptionCodes {
+            ERR_CANNOT_WRITE_TO_FILE,
+            ERR_INVALID_STATE,
+            ERR_INVALIDPARAMS,
+            ERR_RENDERINGAPI_ERROR,
+            ERR_DUPLICATE_ITEM,
+            ERR_ITEM_NOT_FOUND,
+            ERR_FILE_NOT_FOUND,
+            ERR_INTERNAL_ERROR,
+            ERR_RT_ASSERTION_FAILED, 
+			ERR_NOT_IMPLEMENTED
+        };
+
+        /** Default constructor.
+        */
+        Exception( int number, const String& description, const String& source );
+
+        /** Advanced constructor.
+        */
+        Exception( int number, const String& description, const String& source, const char* type, const char* file, long line );
+
+        /** Copy constructor.
+        */
+        Exception(const Exception& rhs);
+
+		/// Needed for  compatibility with std::exception
+		~Exception() throw() {}
+
+        /** Assignment operator.
+        */
+        void operator = (const Exception& rhs);
+
+        /** Returns a string with the full description of this error.
+            @remarks
+                The description contains the error number, the description
+                supplied by the thrower, what routine threw the exception,
+                and will also supply extra platform-specific information
+                where applicable. For example - in the case of a rendering
+                library error, the description of the error will include both
+                the place in which OGRE found the problem, and a text
+                description from the 3D rendering library, if available.
+        */
+        virtual const String& getFullDescription(void) const;
+
+        /** Gets the error code.
+        */
+        virtual int getNumber(void) const throw();
+
+        /** Gets the source function.
+        */
+        virtual const String &getSource() const { return source; }
+
+        /** Gets source file name.
+        */
+        virtual const String &getFile() const { return file; }
+
+        /** Gets line number.
+        */
+        virtual long getLine() const { return line; }
+
+		/** Returns a string with only the 'description' field of this exception. Use 
+			getFullDescriptionto get a full description of the error including line number,
+			error number and what function threw the exception.
+        */
+		virtual const String &getDescription(void) const { return description; }
+
+		/// Override std::exception::what
+		const char* what() const throw() { return getFullDescription().c_str(); }
+        
+    };
+
+
+	/** Template struct which creates a distinct type for each exception code.
+	@note
+	This is useful because it allows us to create an overloaded method
+	for returning different exception types by value without ambiguity. 
+	From 'Modern C++ Design' (Alexandrescu 2001).
+	*/
+	template <int num>
+	struct ExceptionCodeType
+	{
+		enum { number = num };
+	};
+
+	// Specialised exceptions allowing each to be caught specifically
+	// backwards-compatible since exception codes still used
+
+	class _OgreExport UnimplementedException : public Exception 
+	{
+	public:
+		UnimplementedException(int number, const String& description, const String& source, const char* file, long line)
+			: Exception(number, description, source, "UnimplementedException", file, line) {}
+	};
+	class _OgreExport FileNotFoundException : public Exception
+	{
+	public:
+		FileNotFoundException(int number, const String& description, const String& source, const char* file, long line)
+			: Exception(number, description, source, "FileNotFoundException", file, line) {}
+	};
+	class _OgreExport IOException : public Exception
+	{
+	public:
+		IOException(int number, const String& description, const String& source, const char* file, long line)
+			: Exception(number, description, source, "IOException", file, line) {}
+	};
+	class _OgreExport InvalidStateException : public Exception
+	{
+	public:
+		InvalidStateException(int number, const String& description, const String& source, const char* file, long line)
+			: Exception(number, description, source, "InvalidStateException", file, line) {}
+	};
+	class _OgreExport InvalidParametersException : public Exception
+	{
+	public:
+		InvalidParametersException(int number, const String& description, const String& source, const char* file, long line)
+			: Exception(number, description, source, "InvalidParametersException", file, line) {}
+	};
+	class _OgreExport ItemIdentityException : public Exception
+	{
+	public:
+		ItemIdentityException(int number, const String& description, const String& source, const char* file, long line)
+			: Exception(number, description, source, "ItemIdentityException", file, line) {}
+	};
+	class _OgreExport InternalErrorException : public Exception
+	{
+	public:
+		InternalErrorException(int number, const String& description, const String& source, const char* file, long line)
+			: Exception(number, description, source, "InternalErrorException", file, line) {}
+	};
+	class _OgreExport RenderingAPIException : public Exception
+	{
+	public:
+		RenderingAPIException(int number, const String& description, const String& source, const char* file, long line)
+			: Exception(number, description, source, "RenderingAPIException", file, line) {}
+	};
+	class _OgreExport RuntimeAssertionException : public Exception
+	{
+	public:
+		RuntimeAssertionException(int number, const String& description, const String& source, const char* file, long line)
+			: Exception(number, description, source, "RuntimeAssertionException", file, line) {}
+	};
+
+
+	/** Class implementing dispatch methods in order to construct by-value
+		exceptions of a derived type based just on an exception code.
+	@remarks
+		This nicely handles construction of derived Exceptions by value (needed
+		for throwing) without suffering from ambiguity - each code is turned into
+		a distinct type so that methods can be overloaded. This allows OGRE_EXCEPT
+		to stay small in implementation (desirable since it is embedded) whilst
+		still performing rich code-to-type mapping. 
+	*/
+	class ExceptionFactory
+	{
+	private:
+		/// Private constructor, no construction
+		ExceptionFactory() {}
+	public:
+		static UnimplementedException create(
+			ExceptionCodeType<Exception::ERR_NOT_IMPLEMENTED> code, 
+			const String& desc, 
+			const String& src, const char* file, long line)
+		{
+			return UnimplementedException(code.number, desc, src, file, line);
+		}
+		static FileNotFoundException create(
+			ExceptionCodeType<Exception::ERR_FILE_NOT_FOUND> code, 
+			const String& desc, 
+			const String& src, const char* file, long line)
+		{
+			return FileNotFoundException(code.number, desc, src, file, line);
+		}
+		static IOException create(
+			ExceptionCodeType<Exception::ERR_CANNOT_WRITE_TO_FILE> code, 
+			const String& desc, 
+			const String& src, const char* file, long line)
+		{
+			return IOException(code.number, desc, src, file, line);
+		}
+		static InvalidStateException create(
+			ExceptionCodeType<Exception::ERR_INVALID_STATE> code, 
+			const String& desc, 
+			const String& src, const char* file, long line)
+		{
+			return InvalidStateException(code.number, desc, src, file, line);
+		}
+		static InvalidParametersException create(
+			ExceptionCodeType<Exception::ERR_INVALIDPARAMS> code, 
+			const String& desc, 
+			const String& src, const char* file, long line)
+		{
+			return InvalidParametersException(code.number, desc, src, file, line);
+		}
+		static ItemIdentityException create(
+			ExceptionCodeType<Exception::ERR_ITEM_NOT_FOUND> code, 
+			const String& desc, 
+			const String& src, const char* file, long line)
+		{
+			return ItemIdentityException(code.number, desc, src, file, line);
+		}
+		static ItemIdentityException create(
+			ExceptionCodeType<Exception::ERR_DUPLICATE_ITEM> code, 
+			const String& desc, 
+			const String& src, const char* file, long line)
+		{
+			return ItemIdentityException(code.number, desc, src, file, line);
+		}
+		static InternalErrorException create(
+			ExceptionCodeType<Exception::ERR_INTERNAL_ERROR> code, 
+			const String& desc, 
+			const String& src, const char* file, long line)
+		{
+			return InternalErrorException(code.number, desc, src, file, line);
+		}
+		static RenderingAPIException create(
+			ExceptionCodeType<Exception::ERR_RENDERINGAPI_ERROR> code, 
+			const String& desc, 
+			const String& src, const char* file, long line)
+		{
+			return RenderingAPIException(code.number, desc, src, file, line);
+		}
+		static RuntimeAssertionException create(
+			ExceptionCodeType<Exception::ERR_RT_ASSERTION_FAILED> code, 
+			const String& desc, 
+			const String& src, const char* file, long line)
+		{
+			return RuntimeAssertionException(code.number, desc, src, file, line);
+		}
+
+	};
+	
+
+	
+#ifndef OGRE_EXCEPT
+#define OGRE_EXCEPT(num, desc, src) throw Ogre::ExceptionFactory::create( \
+	Ogre::ExceptionCodeType<num>(), desc, src, __FILE__, __LINE__ );
+#endif
+
+} // Namespace Ogre
+#endif
Index: /OgreMain/include/OgreExternalTextureSource.h
===================================================================
--- /OgreMain/include/OgreExternalTextureSource.h	(revision 5)
+++ /OgreMain/include/OgreExternalTextureSource.h	(revision 5)
@@ -0,0 +1,184 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _OgreExternalTextureSource_H
+#define _OgreExternalTextureSource_H
+ 
+/***************************************************************************
+OgreExternalTextureSource.h  -  
+	Base class that texture plugins need to derive from. This provides the hooks
+	neccessary for a plugin developer to easily extend the functionality of dynamic textures.
+	It makes creation/destruction of dynamic textures more streamlined. While the plugin
+	will need to talk with Ogre for the actual modification of textures, this class allows
+	easy integration with Ogre apps. Material script files can be used to aid in the 
+	creation of dynamic textures. Functionality can be added that is not defined here
+	through the use of the base dictionary. For an exmaple of how to use this class and the
+	string interface see ffmpegVideoPlugIn.
+
+-------------------
+date                 : Jan 1 2004
+email                : pjcast@yahoo.com
+***************************************************************************/
+
+#include "OgreStringInterface.h"
+#include "OgreResourceGroupManager.h"
+
+namespace Ogre
+{
+	/** Enum for type of texture play mode */
+	enum eTexturePlayMode
+	{
+		TextureEffectPause = 0,			//! Video starts out paused
+		TextureEffectPlay_ASAP = 1,		//! Video starts playing as soon as posible
+		TextureEffectPlay_Looping = 2	//! Video Plays Instantly && Loops
+	};
+
+	/** IMPORTANT: **Plugins must override default dictionary name!** 
+	Base class that texture plugins derive from. Any specific 
+	requirements that the plugin needs to have defined before 
+	texture/material creation must be define using the stringinterface
+	before calling create defined texture... or it will fail, though, it 
+	is up to the plugin to report errors to the log file, or raise an 
+	exception if need be. */
+	class _OgreExport ExternalTextureSource : public StringInterface
+	{
+	public:
+		/** Constructor */
+		ExternalTextureSource();
+		/** Virtual destructor */
+		virtual ~ExternalTextureSource() {}
+
+		//------------------------------------------------------------------------------//
+		/* Command objects for specifying some base features							*/
+		/* Any PlugIns wishing to add more specific params to "ExternalTextureSourcePlugins"*/
+		/* dictionary, feel free to do so, that's why this is here						*/
+        class _OgrePrivate CmdInputFileName : public ParamCommand
+        {
+        public:
+			String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        class _OgrePrivate CmdFPS : public ParamCommand
+        {
+        public:
+			String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        class _OgrePrivate CmdPlayMode : public ParamCommand
+        {
+        public:
+			String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        class _OgrePrivate CmdTecPassState : public ParamCommand
+        {
+        public:
+			String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+		//--------------------------------------------------------//
+		//Base Functions that work with Command String Interface... Or can be called
+		//manually to create video through code 
+
+		//! Sets an input file name - if needed by plugin
+		void setInputName( String sIN ) { mInputFileName = sIN; }
+		//! Gets currently set input file name
+		const String& getInputName( ) const	{ return mInputFileName; }
+		//! Sets the frames per second - plugin may or may not use this
+		void setFPS( int iFPS ) { mFramesPerSecond = iFPS; }
+		//! Gets currently set frames per second
+		const int getFPS( ) const { return mFramesPerSecond; }
+		//! Sets a play mode
+		void setPlayMode( eTexturePlayMode eMode )	{ mMode = eMode; }
+		//! Gets currently set play mode
+		eTexturePlayMode getPlayMode() const { return mMode; }
+
+		//! Used for attaching texture to Technique, State, and texture unit layer
+		void setTextureTecPassStateLevel( int t, int p, int s ) 
+				{ mTechniqueLevel = t;mPassLevel = p;mStateLevel = s; }
+		//! Get currently selected Textute attribs.
+		void getTextureTecPassStateLevel( int& t, int& p, int& s ) const
+				{t = mTechniqueLevel;	p = mPassLevel;	s = mStateLevel;}
+		
+		/** Call from derived classes to ensure the dictionary is setup */
+		void addBaseParams();
+
+		/** Returns the string name of this PlugIn (as set by the PlugIn)*/
+		const String& getPlugInStringName( void ) const { return mPlugInName; }
+		/** Returns dictionary name */
+		const String& getDictionaryStringName( void ) const { return mDictionaryName; }
+
+		//Pure virtual functions that plugins must Override
+		/** Call this function from manager to init system */
+		virtual bool initialise() = 0;
+		/** Shuts down PlugIn */
+		virtual void shutDown() = 0;
+
+		/** Creates a texture into an already defined material or one that is created new
+		(it's up to plugin to use a material or create one)
+		Before calling, ensure that needed params have been defined via the stringInterface
+		or regular methods */
+		virtual void createDefinedTexture( const String& sMaterialName,
+			const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME) = 0;
+		/** What this destroys is dependent on the plugin... See specific plugin
+		doc to know what is all destroyed (normally, plugins will destroy only
+		what they created, or used directly - ie. just texture unit) */
+		virtual void destroyAdvancedTexture( const String& sTextureName,
+			const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME) = 0;
+
+	protected:
+        static CmdInputFileName msCmdInputFile;		//! Command for setting input file name
+		static CmdFPS msCmdFramesPerSecond;			//! Command for setting frames per second
+		static CmdPlayMode msCmdPlayMode;			//! Command for setting play mode
+		static CmdTecPassState msCmdTecPassState;	//! Command for setting the tecnique, pass, & state level
+
+
+		//! String Name of this PlugIn
+		String mPlugInName;
+	
+		//------ Vars used for setting/getting dictionary stuff -----------//
+		eTexturePlayMode mMode;
+		
+		String mInputFileName;
+		
+		bool mUpdateEveryFrame;
+		
+		int mFramesPerSecond,
+			mTechniqueLevel,
+			mPassLevel,	
+			mStateLevel;
+		//------------------------------------------------------------------//
+
+	protected:
+		/** The string name of the dictionary name - each plugin
+		must override default name */
+		String mDictionaryName;
+	};
+}
+
+#endif
Index: /OgreMain/include/OgreExternalTextureSourceManager.h
===================================================================
--- /OgreMain/include/OgreExternalTextureSourceManager.h	(revision 5)
+++ /OgreMain/include/OgreExternalTextureSourceManager.h	(revision 5)
@@ -0,0 +1,117 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _OgreExternalTextureSourceManager_H
+#define _OgreExternalTextureSourceManager_H
+
+/***************************************************************************
+OgreExternalTextureSourceManager.h  -  
+	Handles the registering / unregistering of texture modifier plugins
+
+-------------------
+date                 : Jan 1 2004
+email                : pjcast@yahoo.com
+***************************************************************************/
+#include "OgreSingleton.h"
+#include "OgreString.h"
+#include "OgreResourceGroupManager.h"
+#include "OgreExternalTextureSource.h"
+
+namespace Ogre
+{
+	/** 
+	Singleton Class which handles the registering and control of texture plugins. The plugins
+	will be mostly controlled via a string interface. */
+	class _OgreExport ExternalTextureSourceManager : public Singleton<ExternalTextureSourceManager>
+	{
+	public:
+		/** Constructor */
+		ExternalTextureSourceManager();
+		/** Destructor */
+		~ExternalTextureSourceManager();
+
+		/** Sets active plugin (ie. "video", "effect", "generic", etc..) */
+		void setCurrentPlugIn( const String& sTexturePlugInType );
+
+		/** Returns currently selected plugin, may be null if none selected */
+		ExternalTextureSource* getCurrentPlugIn( void ) const { return mpCurrExternalTextureSource; }
+	
+		/** Calls the destroy method of all registered plugins... 
+		Only the owner plugin should perform the destroy action. */
+		void destroyAdvancedTexture( const String& sTextureName,
+			const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+
+		/** Returns the plugin which reistered itself with a specific name 
+		(eg. "video"), or null if specified plugin not found */
+		ExternalTextureSource* getExternalTextureSource( const String& sTexturePlugInType );
+
+		/** Called from plugin to register itself */
+		void setExternalTextureSource( const String& sTexturePlugInType, ExternalTextureSource* pTextureSystem );
+
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static ExternalTextureSourceManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static ExternalTextureSourceManager* getSingletonPtr(void);
+	protected:
+		//The current texture controller selected
+		ExternalTextureSource* mpCurrExternalTextureSource;
+		
+        // Collection of loaded texture System PlugIns, keyed by registered type
+        typedef std::map< String, ExternalTextureSource*> TextureSystemList;
+        TextureSystemList mTextureSystems;
+    };
+} 
+#endif
Index: /OgreMain/include/OgreFactoryObj.h
===================================================================
--- /OgreMain/include/OgreFactoryObj.h	(revision 5)
+++ /OgreMain/include/OgreFactoryObj.h	(revision 5)
@@ -0,0 +1,65 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _FactoryObj_H__
+#define _FactoryObj_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+    /** Abstract factory class. Does nothing by itself, but derived classes can add
+        functionality.
+    */
+    template< typename T > class FactoryObj
+    {
+    public:
+        virtual ~FactoryObj() {};
+
+        /** Returns the factory type.
+            @return
+                The factory type.
+        */
+        virtual const String& getType() const = 0;
+
+        /** Creates a new object.
+        @param name Name of the object to create
+        @return
+            An object created by the factory. The type of the object depends on
+            the factory.
+        */
+        virtual T* createInstance( const String& name ) = 0;    
+        /** Destroys an object which was created by this factory.
+        @param ptr Pointer to the object to destroy
+        */
+        virtual void destroyInstance( T* ) = 0;    
+    };
+
+} // namespace
+
+#endif
Index: /OgreMain/include/OgreFileSystem.h
===================================================================
--- /OgreMain/include/OgreFileSystem.h	(revision 5)
+++ /OgreMain/include/OgreFileSystem.h	(revision 5)
@@ -0,0 +1,111 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __FileSystem_H__
+#define __FileSystem_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreArchive.h"
+#include "OgreArchiveFactory.h"
+
+namespace Ogre {
+
+    /** Specialisation of the Archive class to allow reading of files from 
+        filesystem folders / directories.
+    */
+    class _OgreExport FileSystemArchive : public Archive 
+    {
+    protected:
+        /** Utility method to retrieve all files in a directory matching pattern.
+        @param pattern File pattern
+        @param recursive Whether to cascade down directories
+        @param dirs Set to true if you want the directories to be listed
+            instead of files
+        @param simpleList Populated if retrieving a simple list
+        @param detailList Populated if retrieving a detailed list
+        @param currentDir The current directory relative to the base of the 
+            archive, for file naming
+        */
+        void findFiles(const String& pattern, bool recursive, bool dirs,
+            StringVector* simpleList, FileInfoList* detailList);
+
+    public:
+        FileSystemArchive(const String& name, const String& archType );
+        ~FileSystemArchive();
+
+        /// @copydoc Archive::isCaseSensitive
+        bool isCaseSensitive(void) const;
+
+        /// @copydoc Archive::load
+        void load();
+        /// @copydoc Archive::unload
+        void unload();
+
+        /// @copydoc Archive::open
+        DataStreamPtr open(const String& filename) const;
+
+        /// @copydoc Archive::list
+        StringVectorPtr list(bool recursive = true, bool dirs = false);
+
+        /// @copydoc Archive::listFileInfo
+        FileInfoListPtr listFileInfo(bool recursive = true, bool dirs = false);
+
+        /// @copydoc Archive::find
+        StringVectorPtr find(const String& pattern, bool recursive = true,
+            bool dirs = false);
+
+        /// @copydoc Archive::findFileInfo
+        FileInfoListPtr findFileInfo(const String& pattern, bool recursive = true,
+            bool dirs = false);
+
+        /// @copydoc Archive::exists
+        bool exists(const String& filename);
+
+    };
+
+    /** Specialisation of ArchiveFactory for FileSystem files. */
+    class _OgrePrivate FileSystemArchiveFactory : public ArchiveFactory
+    {
+    public:
+        virtual ~FileSystemArchiveFactory() {}
+        /// @copydoc FactoryObj::getType
+        const String& getType(void) const;
+        /// @copydoc FactoryObj::createInstance
+        Archive *createInstance( const String& name ) 
+        {
+            return new FileSystemArchive(name, "FileSystem");
+        }
+        /// @copydoc FactoryObj::destroyInstance
+        void destroyInstance( Archive* arch) { delete arch; }
+    };
+
+
+}
+
+#endif
Index: /OgreMain/include/OgreFont.h
===================================================================
--- /OgreMain/include/OgreFont.h	(revision 5)
+++ /OgreMain/include/OgreFont.h	(revision 5)
@@ -0,0 +1,432 @@
+/*-------------------------------------------------------------------------
+This source file is a part of OGRE
+(Object-oriented Graphics Rendering Engine)
+
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License (LGPL) as 
+published by the Free Software Foundation; either version 2.1 of the 
+License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful, but 
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
+or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License 
+along with this library; if not, write to the Free Software Foundation, 
+Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA or go to
+http://www.gnu.org/copyleft/lesser.txt
+-------------------------------------------------------------------------*/
+
+#ifndef _Font_H__
+#define _Font_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreResource.h"
+#include "OgreTexture.h"
+#include "OgreMaterial.h"
+#include "OgreCommon.h"
+
+namespace Ogre
+{
+    /** Enumerates the types of Font usable in the engine. */
+    enum FontType
+    {
+        /// Generated from a truetype (.ttf) font
+        FT_TRUETYPE = 1,
+        /// Loaded from an image created by an artist
+        FT_IMAGE = 2
+    };
+
+
+    /** Class representing a font in the system.
+    @remarks
+    This class is simply a way of getting a font texture into the OGRE system and
+    to easily retrieve the texture coordinates required to accurately render them.
+    Fonts can either be loaded from precreated textures, or the texture can be generated
+    using a truetype font. You can either create the texture manually in code, or you
+    can use a .fontdef script to define it (probably more practical since you can reuse
+    the definition more easily)
+	@note
+	This class extends both Resource and ManualResourceLoader since it is
+	both a resource in it's own right, but it also provides the manual load
+	implementation for the Texture it creates.
+    */
+	class _OgreExport Font : public Resource, public ManualResourceLoader
+    {
+    protected:
+		/// Command object for Font - see ParamCommand 
+		class _OgreExport CmdType : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+		/// Command object for Font - see ParamCommand 
+		class _OgreExport CmdSource : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+		/// Command object for Font - see ParamCommand 
+		class _OgreExport CmdSize : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+		/// Command object for Font - see ParamCommand 
+		class _OgreExport CmdResolution : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+		/// Command object for Font - see ParamCommand 
+		class _OgreExport CmdCodePoints : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+
+		// Command object for setting / getting parameters
+		static CmdType msTypeCmd;
+		static CmdSource msSourceCmd;
+		static CmdSize msSizeCmd;
+		static CmdResolution msResolutionCmd;
+		static CmdCodePoints msCodePointsCmd;
+
+		/// The type of font
+        FontType mType;
+
+        /// Source of the font (either an image name or a truetype font)
+        String mSource;
+
+        /// Size of the truetype font, in points
+        Real mTtfSize;
+        /// Resolution (dpi) of truetype font
+        uint mTtfResolution;
+
+
+	public:
+		typedef Ogre::uint32 CodePoint;
+		typedef Ogre::FloatRect UVRect;
+		/// Information about the position and size of a glyph in a texture
+		struct GlyphInfo 
+		{
+			CodePoint codePoint;
+			UVRect uvRect;
+			Real aspectRatio;
+
+			GlyphInfo(CodePoint id, const UVRect& rect, Real aspect)
+				: codePoint(id), uvRect(rect), aspectRatio(aspect)
+			{
+
+			}
+		};
+		/// A range of code points, inclusive on both ends
+		typedef std::pair<CodePoint, CodePoint> CodePointRange;
+		typedef std::vector<CodePointRange> CodePointRangeList;
+	protected:
+		/// Map from unicode code point to texture coordinates
+		typedef std::map<CodePoint, GlyphInfo> CodePointMap;
+		CodePointMap mCodePointMap;
+
+        /// The material which is generated for this font
+        MaterialPtr mpMaterial;
+
+		/// Texture pointer
+		TexturePtr mTexture;
+
+        /// for TRUE_TYPE font only
+        bool mAntialiasColour;
+
+		/// Range of code points to generate glyphs for (truetype only)
+		CodePointRangeList mCodePointRangeList;
+
+        /// Internal method for loading from ttf
+        void createTextureFromFont(void);
+
+		/// @copydoc Resource::loadImpl
+		virtual void loadImpl();
+		/// @copydoc Resource::unloadImpl
+		virtual void unloadImpl();
+		/// @copydoc Resource::calculateSize
+		size_t calculateSize(void) const { return 0; } // permanent resource is in the texture 
+    public:
+
+        /** Constructor.
+		@see Resource
+        */
+		Font(ResourceManager* creator, const String& name, ResourceHandle handle,
+			const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
+        virtual ~Font();
+
+        /** Sets the type of font. Must be set before loading. */
+        void setType(FontType ftype);
+
+        /** Gets the type of font. */
+        FontType getType(void) const;
+
+        /** Sets the source of the font.
+        @remarks
+            If you have created a font of type FT_IMAGE, this method tells the
+            Font which image to use as the source for the characters. So the parameter 
+            should be the name of an appropriate image file. Note that when using an image
+            as a font source, you will also need to tell the font where each character is
+            located using setGlyphTexCoords (for each character).
+        @par
+            If you have created a font of type FT_TRUETYPE, this method tells the
+            Font which .ttf file to use to generate the text. You will also need to call 
+            setTrueTypeSize and setTrueTypeResolution, and call addCodePointRange
+			as many times as required to define the range of glyphs you want to be
+			available.
+        @param source An image file or a truetype font, depending on the type of this font
+        */
+        void setSource(const String& source);
+
+        /** Gets the source this font (either an image or a truetype font).
+        */
+        const String& getSource(void) const;
+
+        /** Sets the size of a truetype font (only required for FT_TRUETYPE). 
+        @param ttfSize The size of the font in points. Note that the
+            size of the font does not affect how big it is on the screen, just how large it is in
+            the texture and thus how detailed it is.
+        */
+        void setTrueTypeSize(Real ttfSize);
+        /** Gets the resolution (dpi) of the font used to generate the texture
+        (only required for FT_TRUETYPE).
+        @param ttfResolution The resolution in dpi
+        */
+        void setTrueTypeResolution(uint ttfResolution);
+
+        /** Gets the point size of the font used to generate the texture.
+        @remarks
+            Only applicable for FT_TRUETYPE Font objects.
+            Note that the size of the font does not affect how big it is on the screen, 
+            just how large it is in the texture and thus how detailed it is.            
+        */
+        Real getTrueTypeSize(void) const;
+        /** Gets the resolution (dpi) of the font used to generate the texture.
+        @remarks
+            Only applicable for FT_TRUETYPE Font objects.
+        */
+        uint getTrueTypeResolution(void) const;
+
+
+        /** Returns the teture coordinates of the associated glyph. 
+            @remarks Parameter is a short to allow both ASCII and wide chars.
+            @param id The code point (unicode)
+            @returns A rectangle with the UV coordinates, or null UVs if the
+				code point was not present
+        */
+        inline const UVRect& getGlyphTexCoords(CodePoint id) const
+        {
+			CodePointMap::const_iterator i = mCodePointMap.find(id);
+			if (i != mCodePointMap.end())
+			{
+				return i->second.uvRect;
+			}
+			else
+			{
+				static UVRect nullRect(0.0, 0.0, 0.0, 0.0);
+				return nullRect;
+			}
+        }
+
+        /** Sets the texture coordinates of a glyph.
+        @remarks
+            You only need to call this if you're setting up a font loaded from a texture manually.
+        @note
+            Also sets the aspect ratio (width / height) of this character. textureAspect
+			is the width/height of the texture (may be non-square)
+        */
+        inline void setGlyphTexCoords(CodePoint id, Real u1, Real v1, Real u2, Real v2, Real textureAspect)
+        {
+			CodePointMap::iterator i = mCodePointMap.find(id);
+			if (i != mCodePointMap.end())
+			{
+				i->second.uvRect.left = u1;
+				i->second.uvRect.top = v1;
+				i->second.uvRect.right = u2;
+				i->second.uvRect.bottom = v2;
+				i->second.aspectRatio = textureAspect * (u2 - u1)  / (v2 - v1);
+			}
+			else
+			{
+				mCodePointMap.insert(
+					CodePointMap::value_type(id, 
+						GlyphInfo(id, UVRect(u1, v1, u2, v2), 
+							textureAspect * (u2 - u1)  / (v2 - v1))));
+			}
+
+        }
+        /** Gets the aspect ratio (width / height) of this character. */
+        inline Real getGlyphAspectRatio(CodePoint id) const
+        {
+			CodePointMap::const_iterator i = mCodePointMap.find(id);
+			if (i != mCodePointMap.end())
+			{
+				return i->second.aspectRatio;
+			}
+			else
+			{
+				return 1.0;
+			}
+        }
+        /** Sets the aspect ratio (width / height) of this character.
+        @remarks
+            You only need to call this if you're setting up a font loaded from a 
+			texture manually.
+        */
+        inline void setGlyphAspectRatio(CodePoint id, Real ratio)
+        {
+			CodePointMap::iterator i = mCodePointMap.find(id);
+			if (i != mCodePointMap.end())
+			{
+				i->second.aspectRatio = ratio;
+			}
+        }
+
+		/** Gets the information available for a glyph corresponding to a
+			given code point, or throws an exception if it doesn't exist;
+		*/
+		const GlyphInfo& getGlyphInfo(CodePoint id) const;
+
+		/** Adds a range of code points to the list of code point ranges to generate
+			glyphs for, if this is a truetype based font.
+		@remarks
+			In order to save texture space, only the glyphs which are actually
+			needed by the application are generated into the texture. Before this
+			object is loaded you must call this method as many times as necessary
+			to define the code point range that you need.
+		*/
+		void addCodePointRange(const CodePointRange& range)
+		{
+			mCodePointRangeList.push_back(range);
+		}
+
+		/** Clear the list of code point ranges.
+		*/
+		void clearCodePointRanges()
+		{
+			mCodePointRangeList.clear();
+		}
+		/** Get a const reference to the list of code point ranges to be used to
+			generate glyphs from a truetype font.
+		*/
+		const CodePointRangeList& getCodePointRangeList() const
+		{
+			return mCodePointRangeList;
+		}
+        /** Gets the material generated for this font, as a weak reference. 
+        @remarks
+            This will only be valid after the Font has been loaded. 
+        */
+        inline const MaterialPtr& getMaterial() const
+        {
+            return mpMaterial;
+        }
+        /** Gets the material generated for this font, as a weak reference. 
+        @remarks
+            This will only be valid after the Font has been loaded. 
+        */
+        inline const MaterialPtr& getMaterial()
+        {
+            return mpMaterial;
+        }
+        /** Sets whether or not the colour of this font is antialiased as it is generated
+            from a true type font.
+        @remarks
+        	This is valid only for a FT_TRUETYPE font. If you are planning on using 
+            alpha blending to draw your font, then it is a good idea to set this to
+            false (which is the default), otherwise the darkening of the font will combine
+            with the fading out of the alpha around the edges and make your font look thinner
+            than it should. However, if you intend to blend your font using a colour blending
+            mode (add or modulate for example) then it's a good idea to set this to true, in
+            order to soften your font edges.
+        */
+        inline void setAntialiasColour(bool enabled)
+        {
+        	mAntialiasColour = enabled;
+        }
+
+		/** Gets whether or not the colour of this font is antialiased as it is generated
+		from a true type font.
+		*/
+        inline bool getAntialiasColour(void) const
+        {
+            return mAntialiasColour;
+        }
+
+		/** Implementation of ManualResourceLoader::loadResource, called
+			when the Texture that this font creates needs to (re)load.
+		*/
+		void loadResource(Resource* resource);
+    };
+	/** Specialisation of SharedPtr to allow SharedPtr to be assigned to FontPtr 
+	@note Has to be a subclass since we need operator=.
+	We could templatise this instead of repeating per Resource subclass, 
+	except to do so requires a form VC6 does not support i.e.
+	ResourceSubclassPtr<T> : public SharedPtr<T>
+	*/
+	class _OgreExport FontPtr : public SharedPtr<Font> 
+	{
+	public:
+		FontPtr() : SharedPtr<Font>() {}
+		explicit FontPtr(Font* rep) : SharedPtr<Font>(rep) {}
+		FontPtr(const FontPtr& r) : SharedPtr<Font>(r) {} 
+		FontPtr(const ResourcePtr& r) : SharedPtr<Font>()
+		{
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+			    pRep = static_cast<Font*>(r.getPointer());
+			    pUseCount = r.useCountPointer();
+			    if (pUseCount)
+			    {
+				    ++(*pUseCount);
+			    }
+            }
+		}
+
+		/// Operator used to convert a ResourcePtr to a FontPtr
+		FontPtr& operator=(const ResourcePtr& r)
+		{
+			if (pRep == static_cast<Font*>(r.getPointer()))
+				return *this;
+			release();
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+                OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+			    pRep = static_cast<Font*>(r.getPointer());
+			    pUseCount = r.useCountPointer();
+			    if (pUseCount)
+			    {
+				    ++(*pUseCount);
+			    }
+            }
+			else
+			{
+				// RHS must be a null pointer
+				assert(r.isNull() && "RHS must be null if it has no mutex!");
+				setNull();
+			}
+			return *this;
+		}
+	};
+}
+
+#endif
Index: /OgreMain/include/OgreFontManager.h
===================================================================
--- /OgreMain/include/OgreFontManager.h	(revision 5)
+++ /OgreMain/include/OgreFontManager.h	(revision 5)
@@ -0,0 +1,93 @@
+/*-------------------------------------------------------------------------
+This source file is a part of OGRE
+(Object-oriented Graphics Rendering Engine)
+
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License (LGPL) as 
+published by the Free Software Foundation; either version 2.1 of the 
+License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful, but 
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
+or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License 
+along with this library; if not, write to the Free Software Foundation, 
+Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA or go to
+http://www.gnu.org/copyleft/lesser.txt
+-------------------------------------------------------------------------*/
+
+#ifndef _FontManager_H__
+#define _FontManager_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreSingleton.h"
+#include "OgreResourceManager.h"
+#include "OgreFont.h"
+
+namespace Ogre
+{
+    /** Manages Font resources, parsing .fontdef files and generally organising them.*/
+    class _OgreExport FontManager : public ResourceManager, public Singleton< FontManager >
+    {
+    public:
+
+		FontManager();
+		~FontManager();
+
+        /** @copydoc ScriptLoader::parseScript */
+        void parseScript(DataStreamPtr& stream, const String& groupName);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static FontManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static FontManager* getSingletonPtr(void);
+
+    protected:
+
+        /// Internal methods
+		Resource* createImpl(const String& name, ResourceHandle handle, 
+			const String& group, bool isManual, ManualResourceLoader* loader, 
+            const NameValuePairList* params);
+		void parseAttribute(const String& line, FontPtr& pFont);
+
+        void logBadAttrib(const String& line, FontPtr& pFont);
+
+
+    };
+}
+
+#endif
Index: /OgreMain/include/OgreFrameListener.h
===================================================================
--- /OgreMain/include/OgreFrameListener.h	(revision 5)
+++ /OgreMain/include/OgreFrameListener.h	(revision 5)
@@ -0,0 +1,106 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __FrameListener_H__
+#define __FrameListener_H__
+
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+    /** Struct containing information about a frame event.
+    */
+    struct FrameEvent
+    {
+        /** Elapsed time in seconds since the last event.
+            This gives you time between frame start & frame end,
+            and between frame end and next frame start.
+            @remarks
+                This may not be the elapsed time but the average
+                elapsed time between recently fired events.
+        */
+        Real timeSinceLastEvent;
+        /** Elapsed time in seconds since the last event of the same type,
+            i.e. time for a complete frame.
+            @remarks
+                This may not be the elapsed time but the average
+                elapsed time between recently fired events of the same type.
+        */
+        Real timeSinceLastFrame;
+    };
+
+
+    /** A interface class defining a listener which can be used to receive
+        notifications of frame events.
+        @remarks
+            A 'listener' is an interface designed to be called back when
+            particular events are called. This class defines the
+            interface relating to frame events. In order to receive
+            notifications of frame events, you should create a subclass of
+            FrameListener and override the methods for which you would like
+            to customise the resulting processing. You should then call
+            Root::addFrameListener passing an instance of this class.
+            There is no limit to the number of frame listeners you can register,
+            allowing you to register multiple listeners for different purposes.
+            Frame events only occur when Ogre is in continuous rendering mode,
+            ie. after Root::startRendering is called. If the application is
+            doing ad-hoc rendering without entering a rendering loop, frame
+            events are not generated. Note that a frame event occurs once for
+            all rendering targets, not once per target.
+    */
+    class _OgreExport FrameListener
+    {
+        /*
+        Note that this could have been an abstract class, but I made
+        the explicit choice not to do this, because I wanted to give
+        people the option of only implementing the methods they wanted,
+        rather than having to create 'do nothing' implementations for
+        those they weren't interested in. As such this class follows
+        the 'Adapter' classes in Java rather than pure interfaces.
+        */
+    public:
+        /** Called when a frame is about to begin rendering.
+            @return
+                True to go ahead, false to abort rendering and drop
+                out of the rendering loop.
+        */
+        virtual bool frameStarted(const FrameEvent& evt) { return true; }
+        /** Called just after a frame has been rendered.
+            @return
+                True to continue with the next frame, false to drop
+                out of the rendering loop.
+        */
+        virtual bool frameEnded(const FrameEvent& evt) { return true; }
+
+		virtual ~FrameListener() {}
+		
+    };
+}
+
+#endif
Index: /OgreMain/include/OgreFreeImageCodec.h
===================================================================
--- /OgreMain/include/OgreFreeImageCodec.h	(revision 5)
+++ /OgreMain/include/OgreFreeImageCodec.h	(revision 5)
@@ -0,0 +1,77 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _FreeImageCodec_H__
+#define _FreeImageCodec_H__
+
+#include "OgreImageCodec.h"
+// Forward-declaration to avoid external dependency on FreeImage
+struct FIBITMAP;
+
+namespace Ogre {
+
+    /** Codec specialized in images loaded using FreeImage.
+        @remarks
+            The users implementing subclasses of ImageCodec are required to return
+            a valid pointer to a ImageData class from the decode(...) function.
+    */
+    class _OgreExport FreeImageCodec : public ImageCodec
+    {
+    private:
+        String mType;
+        unsigned int mFreeImageType;
+
+		typedef std::list<ImageCodec*> RegisteredCodecList;
+		static RegisteredCodecList msCodecList;
+
+		/** Common encoding routine. */
+		FIBITMAP* encode(MemoryDataStreamPtr& input, CodecDataPtr& pData) const;
+
+    public:
+        FreeImageCodec(const String &type, unsigned int fiType);
+        virtual ~FreeImageCodec() { }
+
+        /// @copydoc Codec::code
+        DataStreamPtr code(MemoryDataStreamPtr& input, CodecDataPtr& pData) const;
+        /// @copydoc Codec::codeToFile
+        void codeToFile(MemoryDataStreamPtr& input, const String& outFileName, CodecDataPtr& pData) const;
+        /// @copydoc Codec::decode
+        DecodeResult decode(DataStreamPtr& input) const;
+
+        
+        virtual String getType() const;        
+
+		/// Static method to startup FreeImage and register the FreeImage codecs
+		static void startup(void);
+		/// Static method to shutdown FreeImage and unregister the FreeImage codecs
+		static void shutdown(void);
+    };
+
+} // namespace
+
+#endif
Index: /OgreMain/include/OgreFrustum.h
===================================================================
--- /OgreMain/include/OgreFrustum.h	(revision 5)
+++ /OgreMain/include/OgreFrustum.h	(revision 5)
@@ -0,0 +1,590 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Frustum_H__
+#define __Frustum_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMovableObject.h"
+#include "OgreRenderable.h"
+#include "OgreAxisAlignedBox.h"
+#include "OgreVertexIndexData.h"
+#include "OgreMovablePlane.h"
+
+namespace Ogre
+{
+    /** Specifies perspective (realistic) or orthographic (architectural) projection.
+    */
+    enum ProjectionType
+    {
+        PT_ORTHOGRAPHIC,
+        PT_PERSPECTIVE
+    };
+
+    /** Worldspace clipping planes.
+    */
+    enum FrustumPlane
+    {
+        FRUSTUM_PLANE_NEAR   = 0,
+        FRUSTUM_PLANE_FAR    = 1,
+        FRUSTUM_PLANE_LEFT   = 2,
+        FRUSTUM_PLANE_RIGHT  = 3,
+        FRUSTUM_PLANE_TOP    = 4,
+        FRUSTUM_PLANE_BOTTOM = 5
+    };
+
+    /** A frustum represents a pyramid, capped at the near and far end which is
+        used to represent either a visible area or a projection area. Can be used
+        for a number of applications.
+    */
+    class _OgreExport Frustum : public MovableObject, public Renderable
+    {
+    protected:
+        /// Orthographic or perspective?
+        ProjectionType mProjType;
+
+        /// y-direction field-of-view (default 45)
+        Radian mFOVy;
+        /// Far clip distance - default 10000
+        Real mFarDist;
+        /// Near clip distance - default 100
+        Real mNearDist;
+        /// x/y viewport ratio - default 1.3333
+        Real mAspect;
+        /// Off-axis frustum center offset - default (0.0, 0.0)
+        Vector2 mFrustumOffset;
+        /// Focal length of frustum (for stereo rendering, defaults to 1.0)
+        Real mFocalLength;
+
+        /// The 6 main clipping planes
+        mutable Plane mFrustumPlanes[6];
+
+        /// Stored versions of parent orientation / position
+        mutable Quaternion mLastParentOrientation;
+        mutable Vector3 mLastParentPosition;
+
+        /// Pre-calced projection matrix for the specific render system
+        mutable Matrix4 mProjMatrixRS;
+        /// Pre-calced standard projection matrix but with render system depth range
+        mutable Matrix4 mProjMatrixRSDepth;
+        /// Pre-calced standard projection matrix
+        mutable Matrix4 mProjMatrix;
+        /// Pre-calced view matrix
+        mutable Matrix4 mViewMatrix;
+        /// Something's changed in the frustrum shape?
+        mutable bool mRecalcFrustum;
+        /// Something re the view pos has changed
+        mutable bool mRecalcView;
+        /// Something re the frustum planes has changed
+        mutable bool mRecalcFrustumPlanes;
+        /// Something re the world space corners has changed
+        mutable bool mRecalcWorldSpaceCorners;
+        /// Something re the vertex data has changed
+        mutable bool mRecalcVertexData;
+		/// Are we using a custom view matrix?
+		bool mCustomViewMatrix;
+		/// Are we using a custom projection matrix?
+		bool mCustomProjMatrix;
+
+		
+        // Internal functions for calcs
+        virtual void calcProjectionParameters(Real& left, Real& right, Real& bottom, Real& top) const;
+		/// Update frustum if out of date
+        virtual void updateFrustum(void) const;
+		/// Update view if out of date
+        virtual void updateView(void) const;
+		/// Implementation of updateFrustum (called if out of date)
+		virtual void updateFrustumImpl(void) const;
+		/// Implementation of updateView (called if out of date)
+		virtual void updateViewImpl(void) const;
+        virtual void updateFrustumPlanes(void) const;
+		/// Implementation of updateFrustumPlanes (called if out of date)
+		virtual void updateFrustumPlanesImpl(void) const;
+        virtual void updateWorldSpaceCorners(void) const;
+		/// Implementation of updateWorldSpaceCorners (called if out of date)
+		virtual void updateWorldSpaceCornersImpl(void) const;
+        virtual void updateVertexData(void) const;
+        virtual bool isViewOutOfDate(void) const;
+        virtual bool isFrustumOutOfDate(void) const;
+        /// Signal to update frustum information.
+        virtual void invalidateFrustum(void) const;
+        /// Signal to update view information.
+        virtual void invalidateView(void) const;
+
+        /// Shared class-level name for Movable type
+        static String msMovableType;
+
+        mutable AxisAlignedBox mBoundingBox;
+        mutable VertexData mVertexData;
+
+        MaterialPtr mMaterial;
+        mutable Vector3 mWorldSpaceCorners[8];
+
+        /// Is this frustum to act as a reflection of itself?
+        bool mReflect;
+		/// Derived reflection matrix
+        mutable Matrix4 mReflectMatrix;
+        /// Fixed reflection plane
+		mutable Plane mReflectPlane;
+		/// Pointer to a reflection plane (automatically updated)
+		const MovablePlane* mLinkedReflectPlane;
+		/// Record of the last world-space reflection plane info used
+		mutable Plane mLastLinkedReflectionPlane;
+		
+        /// Is this frustum using an oblique depth projection?
+		bool mObliqueDepthProjection;
+		/// Fixed oblique projection plane
+		mutable Plane mObliqueProjPlane;
+		/// Pointer to oblique projection plane (automatically updated)
+		const MovablePlane* mLinkedObliqueProjPlane;
+		/// Record of the last world-space oblique depth projection plane info used
+		mutable Plane mLastLinkedObliqueProjPlane;
+
+		
+		/** Get the derived position of this frustum. */
+        virtual const Vector3& getPositionForViewUpdate(void) const;
+        /** Get the derived orientation of this frustum. */
+        virtual const Quaternion& getOrientationForViewUpdate(void) const;
+
+
+    public:
+
+        Frustum();
+        virtual ~Frustum();
+        /** Sets the Y-dimension Field Of View (FOV) of the frustum.
+            @remarks
+                Field Of View (FOV) is the angle made between the frustum's position, and the edges
+                of the 'screen' onto which the scene is projected. High values (90+ degrees) result in a wide-angle,
+                fish-eye kind of view, low values (30- degrees) in a stretched, telescopic kind of view. Typical values
+                are between 45 and 60 degrees.
+            @par
+                This value represents the VERTICAL field-of-view. The horizontal field of view is calculated from
+                this depending on the dimensions of the viewport (they will only be the same if the viewport is square).
+            @note
+                Setting the FOV overrides the value supplied for frustum::setNearClipPlane.
+         */
+        virtual void setFOVy(const Radian& fovy);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void setFOVy(Real fovy) {
+            setFOVy ( Angle(fovy) );
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Retrieves the frustums Y-dimension Field Of View (FOV).
+        */
+        virtual const Radian& getFOVy(void) const;
+
+        /** Sets the position of the near clipping plane.
+            @remarks
+                The position of the near clipping plane is the distance from the frustums position to the screen
+                on which the world is projected. The near plane distance, combined with the field-of-view and the
+                aspect ratio, determines the size of the viewport through which the world is viewed (in world
+                co-ordinates). Note that this world viewport is different to a screen viewport, which has it's
+                dimensions expressed in pixels. The frustums viewport should have the same aspect ratio as the
+                screen viewport it renders into to avoid distortion.
+            @param
+                near The distance to the near clipping plane from the frustum in world coordinates.
+         */
+        virtual void setNearClipDistance(Real nearDist);
+
+        /** Sets the position of the near clipping plane.
+        */
+        virtual Real getNearClipDistance(void) const;
+
+        /** Sets the distance to the far clipping plane.
+            @remarks
+                The view frustrum is a pyramid created from the frustum position and the edges of the viewport.
+                This method sets the distance for the far end of that pyramid. 
+                Different applications need different values: e.g. a flight sim
+                needs a much further far clipping plane than a first-person 
+                shooter. An important point here is that the larger the ratio 
+                between near and far clipping planes, the lower the accuracy of
+                the Z-buffer used to depth-cue pixels. This is because the
+                Z-range is limited to the size of the Z buffer (16 or 32-bit) 
+                and the max values must be spread over the gap between near and
+                far clip planes. As it happens, you can affect the accuracy far 
+                more by altering the near distance rather than the far distance, 
+                but keep this in mind.
+            @param
+                far The distance to the far clipping plane from the frustum in 
+                world coordinates.If you specify 0, this means an infinite view
+                distance which is useful especially when projecting shadows; but
+                be careful not to use a near distance too close.
+        */
+        virtual void setFarClipDistance(Real farDist);
+
+        /** Retrieves the distance from the frustum to the far clipping plane.
+        */
+        virtual Real getFarClipDistance(void) const;
+
+        /** Sets the aspect ratio for the frustum viewport.
+            @remarks
+                The ratio between the x and y dimensions of the rectangular area visible through the frustum
+                is known as aspect ratio: aspect = width / height .
+            @par
+                The default for most fullscreen windows is 1.3333 - this is also assumed by Ogre unless you
+                use this method to state otherwise.
+        */
+        virtual void setAspectRatio(Real ratio);
+
+        /** Retreives the current aspect ratio.
+        */
+        virtual Real getAspectRatio(void) const;
+
+        /** Sets frustum offsets, used in stereo rendering.
+            @remarks
+                You can set both horizontal and vertical plane offsets of "eye"; in
+                stereo rendering frustum is moved in horizontal plane. To be able to
+                render from two "eyes" you'll need two cameras rendering on two
+                RenderTargets.
+            @par
+                The frustum offsets is in world coordinates, and default to (0, 0) - no offsets.
+            @param
+                offset The horizontal and vertical plane offsets.
+        */
+        virtual void setFrustumOffset(const Vector2& offset);
+
+        /** Sets frustum offsets, used in stereo rendering.
+            @remarks
+                You can set both horizontal and vertical plane offsets of "eye"; in
+                stereo rendering frustum is moved in horizontal plane. To be able to
+                render from two "eyes" you'll need two cameras rendering on two
+                RenderTargets.
+            @par
+                The frustum offsets is in world coordinates, and default to (0, 0) - no offsets.
+            @param
+                horizontal The horizontal plane offset.
+            @param
+                vertical The vertical plane offset.
+        */
+        virtual void setFrustumOffset(Real horizontal = 0.0, Real vertical = 0.0);
+
+        /** Retreives the frustum offsets.
+        */
+        virtual const Vector2& getFrustumOffset() const;
+
+        /** Sets frustum focal length (used in stereo rendering).
+            @param
+                focalLength The distance to the focal plane from the frustum in world coordinates.
+        */
+        virtual void setFocalLength(Real focalLength = 1.0);
+
+        /** Returns focal length of frustum.
+        */
+        virtual Real getFocalLength() const;
+
+        /** Gets the projection matrix for this frustum adjusted for the current
+			rendersystem specifics (may be right or left-handed, depth range
+			may vary).
+        @remarks
+            This method retrieves the rendering-API dependent version of the projection
+            matrix. If you want a 'typical' projection matrix then use 
+            getProjectionMatrix.
+
+        */
+        virtual const Matrix4& getProjectionMatrixRS(void) const;
+        /** Gets the depth-adjusted projection matrix for the current rendersystem,
+			but one which still conforms to right-hand rules.
+        @remarks
+            This differs from the rendering-API dependent getProjectionMatrix
+            in that it always returns a right-handed projection matrix result 
+            no matter what rendering API is being used - this is required for
+            vertex and fragment programs for example. However, the resulting depth
+            range may still vary between render systems since D3D uses [0,1] and 
+            GL uses [-1,1], and the range must be kept the same between programmable
+            and fixed-function pipelines.
+        */
+        virtual const Matrix4& getProjectionMatrixWithRSDepth(void) const;
+        /** Gets the normal projection matrix for this frustum, ie the 
+        projection matrix which conforms to standard right-handed rules and
+        uses depth range [-1,+1].
+        @remarks
+            This differs from the rendering-API dependent getProjectionMatrixRS
+            in that it always returns a right-handed projection matrix with depth
+            range [-1,+1], result no matter what rendering API is being used - this
+            is required for some uniform algebra for example.
+        */
+        virtual const Matrix4& getProjectionMatrix(void) const;
+
+        /** Gets the view matrix for this frustum. Mainly for use by OGRE internally.
+        */
+        virtual const Matrix4& getViewMatrix(void) const;
+
+		/** Set whether to use a custom view matrix on this frustum.
+		@remarks
+			This is an advanced method which allows you to manually set
+			the view matrix on this frustum, rather than having it calculate
+			itself based on it's position and orientation. 
+		@note
+			After enabling a custom view matrix, the frustum will no longer
+			update on its own based on position / orientation changes. You 
+			are completely responsible for keeping the view matrix up to date.
+			The custom matrix will be returned from getViewMatrix.
+		@param enable If true, the custom view matrix passed as the second 
+			parameter will be used in preference to an auto calculated one. If
+			false, the frustum will revert to auto calculating the view matrix.
+		@param viewMatrix The custom view matrix to use, the matrix must be an
+            affine matrix.
+		@see Frustum::setCustomProjectionMatrix, Matrix4::isAffine
+		*/
+		virtual void setCustomViewMatrix(bool enable, 
+			const Matrix4& viewMatrix = Matrix4::IDENTITY);
+		/// Returns whether a custom view matrix is in use
+		virtual bool isCustomViewMatrixEnabled(void) const 
+		{ return mCustomViewMatrix; }
+		
+		/** Set whether to use a custom projection matrix on this frustum.
+		@remarks
+			This is an advanced method which allows you to manually set
+			the projection matrix on this frustum, rather than having it 
+			calculate itself based on it's position and orientation. 
+		@note
+			After enabling a custom projection matrix, the frustum will no 
+			longer update on its own based on field of view and near / far
+			distance changes. You are completely responsible for keeping the 
+			projection matrix up to date if those values change. The custom 
+			matrix will be returned from getProjectionMatrix and derivative
+			functions.
+		@param enable If true, the custom projection matrix passed as the 
+			second parameter will be used in preference to an auto calculated 
+			one. If	false, the frustum will revert to auto calculating the 
+			projection matrix.
+		@param projectionMatrix The custom view matrix to use
+		@see Frustum::setCustomViewMatrix
+		*/
+		virtual void setCustomProjectionMatrix(bool enable, 
+			const Matrix4& projectionMatrix = Matrix4::IDENTITY);
+		/// Returns whether a custom projection matrix is in use
+		virtual bool isCustomProjectionMatrixEnabled(void) const
+		{ return mCustomProjMatrix; }
+
+		/** Retrieves the clipping planes of the frustum (world space).
+        @remarks
+            The clipping planes are ordered as declared in enumerate constants FrustumPlane.
+        */
+        virtual const Plane* getFrustumPlanes(void) const;
+
+        /** Retrieves a specified plane of the frustum (world space).
+            @remarks
+                Gets a reference to one of the planes which make up the frustum frustum, e.g. for clipping purposes.
+        */
+        virtual const Plane& getFrustumPlane( unsigned short plane ) const;
+
+        /** Tests whether the given container is visible in the Frustum.
+            @param
+                bound Bounding box to be checked (world space)
+            @param
+                culledBy Optional pointer to an int which will be filled by the plane number which culled
+                the box if the result was false;
+            @returns
+                If the box was visible, true is returned.
+            @par
+                Otherwise, false is returned.
+        */
+        virtual bool isVisible(const AxisAlignedBox& bound, FrustumPlane* culledBy = 0) const;
+
+        /** Tests whether the given container is visible in the Frustum.
+            @param
+                bound Bounding sphere to be checked (world space)
+            @param
+                culledBy Optional pointer to an int which will be filled by the plane number which culled
+                the box if the result was false;
+            @returns
+                If the sphere was visible, true is returned.
+            @par
+                Otherwise, false is returned.
+        */
+        virtual bool isVisible(const Sphere& bound, FrustumPlane* culledBy = 0) const;
+
+        /** Tests whether the given vertex is visible in the Frustum.
+            @param
+                vert Vertex to be checked (world space)
+            @param
+                culledBy Optional pointer to an int which will be filled by the plane number which culled
+                the box if the result was false;
+            @returns
+                If the box was visible, true is returned.
+            @par
+                Otherwise, false is returned.
+        */
+        virtual bool isVisible(const Vector3& vert, FrustumPlane* culledBy = 0) const;
+
+
+        /** Overridden from MovableObject */
+        const AxisAlignedBox& getBoundingBox(void) const;
+
+        /** Overridden from MovableObject */
+		Real getBoundingRadius(void) const;
+
+		/** Overridden from MovableObject */
+        void _updateRenderQueue(RenderQueue* queue);
+
+        /** Overridden from MovableObject */
+        const String& getMovableType(void) const;
+
+        /** Overridden from MovableObject */
+        void _notifyCurrentCamera(Camera* cam);
+
+        /** Overridden from Renderable */
+        const MaterialPtr& getMaterial(void) const;
+
+        /** Overridden from Renderable */
+        void getRenderOperation(RenderOperation& op);
+
+        /** Overridden from Renderable */
+        void getWorldTransforms(Matrix4* xform) const;
+
+        /** Overridden from Renderable */
+        const Quaternion& getWorldOrientation(void) const;
+
+        /** Overridden from Renderable */
+        const Vector3& getWorldPosition(void) const;
+
+        /** Overridden from Renderable */
+        Real getSquaredViewDepth(const Camera* cam) const;
+
+        /** Overridden from Renderable */
+        const LightList& getLights(void) const;
+
+        /** Gets the world space corners of the frustum.
+        @remarks
+            The corners are ordered as follows: top-right near, 
+            top-left near, bottom-left near, bottom-right near, 
+            top-right far, top-left far, bottom-left far, bottom-right far.
+        */
+        virtual const Vector3* getWorldSpaceCorners(void) const;
+
+        /** Sets the type of projection to use (orthographic or perspective). Default is perspective.
+        */
+        virtual void setProjectionType(ProjectionType pt);
+
+        /** Retrieves info on the type of projection used (orthographic or perspective).
+        */
+        virtual ProjectionType getProjectionType(void) const;
+
+        /** Modifies this frustum so it always renders from the reflection of itself through the
+        plane specified.
+        @remarks
+        This is obviously useful for performing planar reflections. 
+        */
+        virtual void enableReflection(const Plane& p);
+        /** Modifies this frustum so it always renders from the reflection of itself through the
+        plane specified. Note that this version of the method links to a plane
+		so that changes to it are picked up automatically. It is important that
+		this plane continues to exist whilst this object does; do not destroy
+		the plane before the frustum.
+        @remarks
+        This is obviously useful for performing planar reflections. 
+        */
+        virtual void enableReflection(const MovablePlane* p);
+
+        /** Disables reflection modification previously turned on with enableReflection */
+        virtual void disableReflection(void);
+
+        /// Returns whether this frustum is being reflected
+        virtual bool isReflected(void) const { return mReflect; }
+        /// Returns the reflection matrix of the frustum if appropriate
+        virtual const Matrix4& getReflectionMatrix(void) const { return mReflectMatrix; }
+        /// Returns the reflection plane of the frustum if appropriate
+        virtual const Plane& getReflectionPlane(void) const { return mReflectPlane; }
+
+        /** Project a sphere onto the near plane and get the bounding rectangle. 
+        @param sphere The world-space sphere to project
+        @param radius Radius of the sphere
+        @param left, top, right, bottom Pointers to destination values, these
+            will be completed with the normalised device coordinates (in the 
+            range {-1,1})
+        @returns true if the sphere was projected to a subset of the near plane,
+            false if the entire near plane was contained
+        */
+        virtual bool projectSphere(const Sphere& sphere, 
+            Real* left, Real* top, Real* right, Real* bottom) const;
+
+
+		/** Links the frustum to a custom near clip plane, which can be used
+			to clip geometry in a custom manner without using user clip planes.
+		@remarks
+			There are several applications for clipping a scene arbitrarily by
+			a single plane; the most common is when rendering a reflection to 
+			a texture, and you only want to render geometry that is above the 
+			water plane (to do otherwise results in artefacts). Whilst it is
+			possible to use user clip planes, they are not supported on all
+			cards, and sometimes are not hardware accelerated when they are
+			available. Instead, where a single clip plane is involved, this
+			technique uses a 'fudging' of the near clip plane, which is 
+			available and fast on all hardware, to perform as the arbitrary
+			clip plane. This does change the shape of the frustum, leading 
+			to some depth buffer loss of precision, but for many of the uses of
+			this technique that is not an issue.
+		@par 
+			This version of the method links to a plane, rather than requiring
+			a by-value plane definition, and therefore you can 
+			make changes to the plane (e.g. by moving / rotating the node it is
+			attached to) and they will automatically affect this object.
+		@note This technique only works for perspective projection.
+		@param plane The plane to link to to perform the clipping. This plane
+			must continue to exist while the camera is linked to it; do not
+			destroy it before the frustum. 
+		*/
+		virtual void enableCustomNearClipPlane(const MovablePlane* plane);
+		/** Links the frustum to a custom near clip plane, which can be used
+			to clip geometry in a custom manner without using user clip planes.
+		@remarks
+			There are several applications for clipping a scene arbitrarily by
+			a single plane; the most common is when rendering a reflection to  
+			a texture, and you only want to render geometry that is above the 
+			water plane (to do otherwise results in artefacts). Whilst it is
+			possible to use user clip planes, they are not supported on all
+			cards, and sometimes are not hardware accelerated when they are
+			available. Instead, where a single clip plane is involved, this
+			technique uses a 'fudging' of the near clip plane, which is 
+			available and fast on all hardware, to perform as the arbitrary
+			clip plane. This does change the shape of the frustum, leading 
+			to some depth buffer loss of precision, but for many of the uses of
+			this technique that is not an issue.
+		@note This technique only works for perspective projection.
+		@param plane The plane to link to to perform the clipping. This plane
+			must continue to exist while the camera is linked to it; do not
+			destroy it before the frustum. 
+		*/
+		virtual void enableCustomNearClipPlane(const Plane& plane);
+		/** Disables any custom near clip plane. */
+		virtual void disableCustomNearClipPlane(void);
+		/** Is a custom near clip plane in use? */
+		virtual bool isCustomNearClipPlaneEnabled(void) const 
+		{ return mObliqueDepthProjection; }
+		
+
+        /// Small constant used to reduce far plane projection to avoid inaccuracies
+        static const Real INFINITE_FAR_PLANE_ADJUST;
+    };
+
+
+}
+
+#endif 
Index: /OgreMain/include/OgreGpuProgram.h
===================================================================
--- /OgreMain/include/OgreGpuProgram.h	(revision 5)
+++ /OgreMain/include/OgreGpuProgram.h	(revision 5)
@@ -0,0 +1,1632 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __GpuProgram_H_
+#define __GpuProgram_H_
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+#include "OgreResource.h"
+#include "OgreSharedPtr.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre {
+
+	/** Enumerates the types of programs which can run on the GPU. */
+	enum GpuProgramType
+	{
+		GPT_VERTEX_PROGRAM,
+		GPT_FRAGMENT_PROGRAM
+	};
+
+	/** Enumeration of the types of constant we may encounter in programs. 
+	@note Low-level programs, by definition, will always use either
+	float4 or int4 constant types since that is the fundamental underlying
+	type in assembler.
+	*/
+	enum GpuConstantType
+	{
+		GCT_FLOAT1,
+		GCT_FLOAT2,
+		GCT_FLOAT3,
+		GCT_FLOAT4,
+		GCT_SAMPLER1D,
+		GCT_SAMPLER2D,
+		GCT_SAMPLER3D,
+		GCT_SAMPLERCUBE,
+		GCT_SAMPLER1DSHADOW,
+		GCT_SAMPLER2DSHADOW,
+		GCT_MATRIX_2X2,
+		GCT_MATRIX_2X3,
+		GCT_MATRIX_2X4,
+		GCT_MATRIX_3X2,
+		GCT_MATRIX_3X3,
+		GCT_MATRIX_3X4,
+		GCT_MATRIX_4X2,
+		GCT_MATRIX_4X3,
+		GCT_MATRIX_4X4,
+		GCT_INT1,
+		GCT_INT2,
+		GCT_INT3,
+		GCT_INT4,
+		GCT_UNKNOWN
+	};
+
+	/** Information about predefined program constants. 
+	@note Only available for high-level programs but is referenced generically
+		by GpuProgramParameters.
+	*/
+	struct _OgreExport GpuConstantDefinition
+	{
+		/// Data type
+		GpuConstantType constType;
+		/// Physical start index in buffer (either float or int buffer)
+		size_t physicalIndex;
+		/** Number of raw buffer slots per element 
+		(some programs pack each array element to float4, some do not) */
+		size_t elementSize;
+		/// Length of array
+		size_t arraySize;
+
+		bool isFloat() const
+		{
+			switch(constType)
+			{
+			case GCT_INT1:
+			case GCT_INT2:
+			case GCT_INT3:
+			case GCT_INT4:
+			case GCT_SAMPLER1D:
+			case GCT_SAMPLER2D:
+			case GCT_SAMPLER3D:
+			case GCT_SAMPLERCUBE:
+			case GCT_SAMPLER1DSHADOW:
+			case GCT_SAMPLER2DSHADOW:
+				return false;
+			default:
+				return true;
+			};
+
+		}
+
+		bool isSampler() const
+		{
+			switch(constType)
+			{
+			case GCT_SAMPLER1D:
+			case GCT_SAMPLER2D:
+			case GCT_SAMPLER3D:
+			case GCT_SAMPLERCUBE:
+			case GCT_SAMPLER1DSHADOW:
+			case GCT_SAMPLER2DSHADOW:
+				return true;
+			default:
+				return false;
+			};
+
+		}
+
+		GpuConstantDefinition()
+			: constType(GCT_UNKNOWN)
+			, physicalIndex((std::numeric_limits<size_t>::max)())
+			, elementSize(0)
+			, arraySize(1) {}
+	};
+	typedef std::map<String, GpuConstantDefinition> GpuConstantDefinitionMap;
+	typedef ConstMapIterator<GpuConstantDefinitionMap> GpuConstantDefinitionIterator;
+
+	/// Struct collecting together the information for named constants.
+	struct _OgreExport GpuNamedConstants
+	{
+		/// Total size of the float buffer required
+		size_t floatBufferSize;
+		/// Total size of the int buffer required
+		size_t intBufferSize;
+		/// Map of parameter names to GpuConstantDefinition
+		GpuConstantDefinitionMap map;
+
+		/** Generate additional constant entries for arrays based on a base definition.
+		@remarks
+			Array uniforms will be added just with their base name with no array
+			suffix. This method will add named entries for array suffixes too
+			so individual array entries can be addressed. Note that we only 
+			individually index array elements if the array size is up to 16
+			entries in size. Anything larger than that only gets a [0] entry
+			as well as the main entry, to save cluttering up the name map. After
+			all, you can address the larger arrays in a bulk fashion much more
+			easily anyway. 
+		*/
+		void generateConstantDefinitionArrayEntries(const String& paramName, 
+			const GpuConstantDefinition& baseDef);
+
+	};
+
+	/** Structure recording the use of a physical buffer by a logical parameter
+		index. Only used for low-level programs.
+	*/
+	struct _OgreExport GpuLogicalIndexUse
+	{
+		/// Physical buffer index
+		size_t physicalIndex;
+		/// Current physical size allocation
+		size_t currentSize;
+
+		GpuLogicalIndexUse(size_t bufIdx, size_t curSz) 
+			: physicalIndex(bufIdx), currentSize(curSz) {}
+	};
+	typedef std::map<size_t, GpuLogicalIndexUse> GpuLogicalIndexUseMap;
+	/// Container struct to allow params to safely & update shared list of logical buffer assignments
+	struct _OgreExport GpuLogicalBufferStruct
+	{
+		OGRE_MUTEX(mutex)
+		/// Map from logical index to physical buffer location
+		GpuLogicalIndexUseMap map;
+		/// Shortcut to know the buffer size needs
+		size_t bufferSize;
+		GpuLogicalBufferStruct() : bufferSize(0) {}
+	};
+
+    /** Collects together the program parameters used for a GpuProgram.
+    @remarks
+        Gpu program state includes constant parameters used by the program, and
+        bindings to render system state which is propagated into the constants 
+        by the engine automatically if requested.
+    @par
+        GpuProgramParameters objects should be created through the GpuProgram and
+        may be shared between multiple Pass instances. For this reason they
+        are managed using a shared pointer, which will ensure they are automatically
+        deleted when no Pass is using them anymore. 
+	@par
+		High-level programs use named parameters (uniforms), low-level programs 
+		use indexed constants. This class supports both, but you can tell whether 
+		named constants are supported by calling hasNamedParameters(). There are
+		references in the documentation below to 'logical' and 'physical' indexes;
+		logical indexes are the indexes used by low-level programs and represent 
+		indexes into an array of float4's, some of which may be settable, some of
+		which may be predefined constants in the program. We only store those
+		constants which have actually been set, therefore our buffer could have 
+		gaps if we used the logical indexes in our own buffers. So instead we map
+		these logical indexes to physical indexes in our buffer. When using 
+		high-level programs, logical indexes don't necessarily exist, although they
+		might if the high-level program has a direct, exposed mapping from parameter
+		names to logical indexes. In addition, high-level languages may or may not pack
+		arrays of elements that are smaller than float4 (e.g. float2/vec2) contiguously.
+		This kind of information is held in the ConstantDefinition structure which 
+		is only populated for high-level programs. You don't have to worry about
+		any of this unless you intend to read parameters back from this structure
+		rather than just setting them.
+    */
+    class _OgreExport GpuProgramParameters
+    {
+    public:
+        /** Defines the types of automatically updated values that may be bound to GpuProgram
+        parameters, or used to modify parameters on a per-object basis.
+        */
+        enum AutoConstantType
+        {
+            /// The current world matrix
+            ACT_WORLD_MATRIX,
+            /// The current world matrix, inverted
+            ACT_INVERSE_WORLD_MATRIX,
+ 			/** Provides transpose of world matrix.
+ 			Equivalent to RenderMonkey's "WorldTranspose".
+ 			*/
+ 			ACT_TRANSPOSE_WORLD_MATRIX,
+            /// The current world matrix, inverted & transposed
+            ACT_INVERSE_TRANSPOSE_WORLD_MATRIX,
+
+
+            /// The current array of world matrices, as a 3x4 matrix, used for blending
+            ACT_WORLD_MATRIX_ARRAY_3x4,
+            /// The current array of world matrices, used for blending
+            ACT_WORLD_MATRIX_ARRAY,
+
+            /// The current view matrix
+            ACT_VIEW_MATRIX,
+			/// The current view matrix, inverted
+			ACT_INVERSE_VIEW_MATRIX,
+			/** Provides transpose of view matrix.
+			Equivalent to RenderMonkey's "ViewTranspose".
+			*/
+			ACT_TRANSPOSE_VIEW_MATRIX,
+			/** Provides inverse transpose of view matrix.
+			Equivalent to RenderMonkey's "ViewInverseTranspose".
+			*/
+			ACT_INVERSE_TRANSPOSE_VIEW_MATRIX,
+
+
+            /// The current projection matrix
+            ACT_PROJECTION_MATRIX,
+			/** Provides inverse of projection matrix.
+			Equivalent to RenderMonkey's "ProjectionInverse".
+			*/
+			ACT_INVERSE_PROJECTION_MATRIX,
+			/** Provides transpose of projection matrix.
+			Equivalent to RenderMonkey's "ProjectionTranspose".
+			*/
+			ACT_TRANSPOSE_PROJECTION_MATRIX,
+			/** Provides inverse transpose of projection matrix.
+			Equivalent to RenderMonkey's "ProjectionInverseTranspose".
+			*/
+			ACT_INVERSE_TRANSPOSE_PROJECTION_MATRIX,
+
+
+            /// The current view & projection matrices concatenated
+            ACT_VIEWPROJ_MATRIX,
+			/** Provides inverse of concatenated view and projection matrices.
+			Equivalent to RenderMonkey's "ViewProjectionInverse".
+			*/
+			ACT_INVERSE_VIEWPROJ_MATRIX,
+			/** Provides transpose of concatenated view and projection matrices.
+			Equivalent to RenderMonkey's "ViewProjectionTranspose".
+			*/
+			ACT_TRANSPOSE_VIEWPROJ_MATRIX,
+			/** Provides inverse transpose of concatenated view and projection matrices.
+			Equivalent to RenderMonkey's "ViewProjectionInverseTranspose".
+			*/
+			ACT_INVERSE_TRANSPOSE_VIEWPROJ_MATRIX,
+
+
+            /// The current world & view matrices concatenated
+            ACT_WORLDVIEW_MATRIX,
+            /// The current world & view matrices concatenated, then inverted
+            ACT_INVERSE_WORLDVIEW_MATRIX,
+ 			/** Provides transpose of concatenated world and view matrices.
+ 				Equivalent to RenderMonkey's "WorldViewTranspose".
+ 			*/
+ 			ACT_TRANSPOSE_WORLDVIEW_MATRIX,
+            /// The current world & view matrices concatenated, then inverted & tranposed
+            ACT_INVERSE_TRANSPOSE_WORLDVIEW_MATRIX,
+			/// view matrices.
+
+
+            /// The current world, view & projection matrices concatenated
+            ACT_WORLDVIEWPROJ_MATRIX,
+			/** Provides inverse of concatenated world, view and projection matrices.
+			Equivalent to RenderMonkey's "WorldViewProjectionInverse".
+			*/
+			ACT_INVERSE_WORLDVIEWPROJ_MATRIX,
+			/** Provides transpose of concatenated world, view and projection matrices.
+			Equivalent to RenderMonkey's "WorldViewProjectionTranspose".
+			*/
+			ACT_TRANSPOSE_WORLDVIEWPROJ_MATRIX,
+			/** Provides inverse transpose of concatenated world, view and projection
+			matrices. Equivalent to RenderMonkey's "WorldViewProjectionInverseTranspose".
+ 			*/
+			ACT_INVERSE_TRANSPOSE_WORLDVIEWPROJ_MATRIX,
+
+
+            /// render target related values
+            /** -1 if requires texture flipping, +1 otherwise. It's useful when you bypassed
+            projection matrix transform, still able use this value to adjust transformed y position.
+            */
+            ACT_RENDER_TARGET_FLIPPING,
+
+
+            /// Fog colour
+            ACT_FOG_COLOUR,
+            /// Fog params: density, linear start, linear end, 1/(end-start)
+            ACT_FOG_PARAMS,
+
+
+            /// Surface ambient colour, as set in Pass::setAmbient
+            ACT_SURFACE_AMBIENT_COLOUR,
+            /// Surface diffuse colour, as set in Pass::setDiffuse
+            ACT_SURFACE_DIFFUSE_COLOUR,
+            /// Surface specular colour, as set in Pass::setSpecular
+            ACT_SURFACE_SPECULAR_COLOUR,
+            /// Surface emissive colour, as set in Pass::setSelfIllumination
+            ACT_SURFACE_EMISSIVE_COLOUR,
+            /// Surface shininess, as set in Pass::setShininess
+            ACT_SURFACE_SHININESS,
+
+
+			/// The ambient light colour set in the scene
+			ACT_AMBIENT_LIGHT_COLOUR, 
+
+            /// Light diffuse colour (index determined by setAutoConstant call)
+            ACT_LIGHT_DIFFUSE_COLOUR,
+            /// Light specular colour (index determined by setAutoConstant call)
+            ACT_LIGHT_SPECULAR_COLOUR,
+            /// Light attenuation parameters, Vector4(range, constant, linear, quadric)
+            ACT_LIGHT_ATTENUATION,
+			/** Spotlight parameters, Vector4(innerFactor, outerFactor, falloff, isSpot)
+				innerFactor and outerFactor are cos(angle/2)
+				The isSpot parameter is 0.0f for non-spotlights, 1.0f for spotlights.
+				Also for non-spotlights the inner and outer factors are 1 and nearly 1 respectively
+			*/ 
+			ACT_SPOTLIGHT_PARAMS,
+            /// A light position in world space (index determined by setAutoConstant call)
+            ACT_LIGHT_POSITION,
+            /// A light position in object space (index determined by setAutoConstant call)
+            ACT_LIGHT_POSITION_OBJECT_SPACE,
+			/// A light position in view space (index determined by setAutoConstant call)
+            ACT_LIGHT_POSITION_VIEW_SPACE,
+            /// A light direction in world space (index determined by setAutoConstant call)
+            ACT_LIGHT_DIRECTION,
+            /// A light direction in object space (index determined by setAutoConstant call)
+            ACT_LIGHT_DIRECTION_OBJECT_SPACE,
+			/// A light direction in view space (index determined by setAutoConstant call)
+			ACT_LIGHT_DIRECTION_VIEW_SPACE,
+			/** The distance of the light from the center of the object
+				a useful approximation as an alternative to per-vertex distance
+				calculations.
+			*/
+			ACT_LIGHT_DISTANCE_OBJECT_SPACE,
+			/** Light power level, a single scalar as set in Light::setPowerScale  (index determined by setAutoConstant call) */
+			ACT_LIGHT_POWER_SCALE,
+			/// Array of light diffuse colours (count set by extra param)
+			ACT_LIGHT_DIFFUSE_COLOUR_ARRAY,
+			/// Array of light specular colours (count set by extra param)
+			ACT_LIGHT_SPECULAR_COLOUR_ARRAY,
+			/// Array of light attenuation parameters, Vector4(range, constant, linear, quadric) (count set by extra param)
+			ACT_LIGHT_ATTENUATION_ARRAY,
+			/// Array of light positions in world space (count set by extra param)
+			ACT_LIGHT_POSITION_ARRAY,
+			/// Array of light positions in object space (count set by extra param)
+			ACT_LIGHT_POSITION_OBJECT_SPACE_ARRAY,
+			/// Array of light positions in view space (count set by extra param)
+			ACT_LIGHT_POSITION_VIEW_SPACE_ARRAY,
+			/// Array of light directions in world space (count set by extra param)
+			ACT_LIGHT_DIRECTION_ARRAY,
+			/// Array of light directions in object space (count set by extra param)
+			ACT_LIGHT_DIRECTION_OBJECT_SPACE_ARRAY,
+			/// Array of light directions in view space (count set by extra param)
+			ACT_LIGHT_DIRECTION_VIEW_SPACE_ARRAY,
+			/** Array of distances of the lights from the center of the object
+			a useful approximation as an alternative to per-vertex distance
+			calculations. (count set by extra param)
+			*/
+			ACT_LIGHT_DISTANCE_OBJECT_SPACE_ARRAY,
+			/** Array of light power levels, a single scalar as set in Light::setPowerScale 
+			 (count set by extra param)
+			*/
+			ACT_LIGHT_POWER_SCALE_ARRAY,
+			/** Spotlight parameters array of Vector4(innerFactor, outerFactor, falloff, isSpot)
+			innerFactor and outerFactor are cos(angle/2)
+			The isSpot parameter is 0.0f for non-spotlights, 1.0f for spotlights.
+			Also for non-spotlights the inner and outer factors are 1 and nearly 1 respectively.
+			(count set by extra param)
+			*/ 
+			ACT_SPOTLIGHT_PARAMS_ARRAY,
+
+            /** The derived ambient light colour, with 'r', 'g', 'b' components filled with
+                product of surface ambient colour and ambient light colour, respectively,
+                and 'a' component filled with surface ambient alpha component.
+            */
+            ACT_DERIVED_AMBIENT_LIGHT_COLOUR,
+            /** The derived scene colour, with 'r', 'g' and 'b' components filled with sum
+                of derived ambient light colour and surface emissive colour, respectively,
+                and 'a' component filled with surface diffuse alpha component.
+            */
+            ACT_DERIVED_SCENE_COLOUR,
+
+            /** The derived light diffuse colour (index determined by setAutoConstant call),
+                with 'r', 'g' and 'b' components filled with product of surface diffuse colour
+                and light diffuse colour, respectively, and 'a' component filled with surface
+                diffuse alpha component.
+            */
+            ACT_DERIVED_LIGHT_DIFFUSE_COLOUR,
+            /** The derived light specular colour (index determined by setAutoConstant call),
+                with 'r', 'g' and 'b' components filled with product of surface specular colour
+                and light specular colour, respectively, and 'a' component filled with surface
+                specular alpha component.
+            */
+            ACT_DERIVED_LIGHT_SPECULAR_COLOUR,
+
+			/// Array of derived light diffuse colours (count set by extra param)
+            ACT_DERIVED_LIGHT_DIFFUSE_COLOUR_ARRAY,
+			/// Array of derived light specular colours (count set by extra param)
+            ACT_DERIVED_LIGHT_SPECULAR_COLOUR_ARRAY,
+
+
+			/** The distance a shadow volume should be extruded when using
+			    finite extrusion programs.
+			*/
+			ACT_SHADOW_EXTRUSION_DISTANCE,
+            /// The current camera's position in world space
+            ACT_CAMERA_POSITION,
+            /// The current camera's position in object space 
+            ACT_CAMERA_POSITION_OBJECT_SPACE,
+            /// The view/projection matrix of the assigned texture projection frustum
+            ACT_TEXTURE_VIEWPROJ_MATRIX,
+            /// A custom parameter which will come from the renderable, using 'data' as the identifier
+            ACT_CUSTOM,
+            /** provides current elapsed time
+            */
+            ACT_TIME,
+			/** Single float value, which repeats itself based on given as
+			parameter "cycle time". Equivalent to RenderMonkey's "Time0_X".
+			*/
+			ACT_TIME_0_X,
+			/// Cosine of "Time0_X". Equivalent to RenderMonkey's "CosTime0_X".
+			ACT_COSTIME_0_X,
+			/// Sine of "Time0_X". Equivalent to RenderMonkey's "SinTime0_X".
+			ACT_SINTIME_0_X,
+			/// Tangent of "Time0_X". Equivalent to RenderMonkey's "TanTime0_X".
+			ACT_TANTIME_0_X,
+			/** Vector of "Time0_X", "SinTime0_X", "CosTime0_X", 
+			"TanTime0_X". Equivalent to RenderMonkey's "Time0_X_Packed".
+			*/
+			ACT_TIME_0_X_PACKED,
+			/** Single float value, which represents scaled time value [0..1],
+			which repeats itself based on given as parameter "cycle time".
+			Equivalent to RenderMonkey's "Time0_1".
+			*/
+			ACT_TIME_0_1,
+			/// Cosine of "Time0_1". Equivalent to RenderMonkey's "CosTime0_1".
+			ACT_COSTIME_0_1,
+			/// Sine of "Time0_1". Equivalent to RenderMonkey's "SinTime0_1".
+			ACT_SINTIME_0_1,
+			/// Tangent of "Time0_1". Equivalent to RenderMonkey's "TanTime0_1".
+			ACT_TANTIME_0_1,
+			/** Vector of "Time0_1", "SinTime0_1", "CosTime0_1",
+			"TanTime0_1". Equivalent to RenderMonkey's "Time0_1_Packed".
+			*/
+			ACT_TIME_0_1_PACKED,
+			/**	Single float value, which represents scaled time value [0..2*Pi],
+			which repeats itself based on given as parameter "cycle time".
+			Equivalent to RenderMonkey's "Time0_2PI".
+			*/
+			ACT_TIME_0_2PI,
+			/// Cosine of "Time0_2PI". Equivalent to RenderMonkey's "CosTime0_2PI".
+			ACT_COSTIME_0_2PI,
+			/// Sine of "Time0_2PI". Equivalent to RenderMonkey's "SinTime0_2PI".
+			ACT_SINTIME_0_2PI,
+			/// Tangent of "Time0_2PI". Equivalent to RenderMonkey's "TanTime0_2PI".
+			ACT_TANTIME_0_2PI,
+			/** Vector of "Time0_2PI", "SinTime0_2PI", "CosTime0_2PI",
+			"TanTime0_2PI". Equivalent to RenderMonkey's "Time0_2PI_Packed".
+			*/
+			ACT_TIME_0_2PI_PACKED,
+			/// provides the scaled frame time, returned as a floating point value.
+            ACT_FRAME_TIME,
+			/// provides the calculated frames per second, returned as a floating point value.
+			ACT_FPS,
+			/// viewport-related values
+			/** Current viewport width (in pixels) as floating point value.
+			Equivalent to RenderMonkey's "ViewportWidth".
+			*/
+			ACT_VIEWPORT_WIDTH,
+			/** Current viewport height (in pixels) as floating point value.
+			Equivalent to RenderMonkey's "ViewportHeight".
+			*/
+			ACT_VIEWPORT_HEIGHT,
+			/** This variable represents 1.0/ViewportWidth. 
+			Equivalent to RenderMonkey's "ViewportWidthInverse".
+			*/
+			ACT_INVERSE_VIEWPORT_WIDTH,
+			/** This variable represents 1.0/ViewportHeight.
+			Equivalent to RenderMonkey's "ViewportHeightInverse".
+			*/
+			ACT_INVERSE_VIEWPORT_HEIGHT,
+            /** Packed of "ViewportWidth", "ViewportHeight", "ViewportWidthInverse",
+            "ViewportHeightInverse".
+            */
+            ACT_VIEWPORT_SIZE,
+
+			/// view parameters
+			/** This variable provides the view direction vector (world space).
+			Equivalent to RenderMonkey's "ViewDirection".
+			*/
+			ACT_VIEW_DIRECTION,
+			/** This variable provides the view side vector (world space).
+			Equivalent to RenderMonkey's "ViewSideVector".
+			*/
+			ACT_VIEW_SIDE_VECTOR,
+			/** This variable provides the view up vector (world space).
+			Equivalent to RenderMonkey's "ViewUpVector".
+			*/
+			ACT_VIEW_UP_VECTOR,
+			/** This variable provides the field of view as a floating point value.
+			Equivalent to RenderMonkey's "FOV".
+			*/
+			ACT_FOV,
+			/**	This variable provides the near clip distance as a floating point value.
+			Equivalent to RenderMonkey's "NearClipPlane".
+			*/
+			ACT_NEAR_CLIP_DISTANCE,
+			/**	This variable provides the far clip distance as a floating point value.
+			Equivalent to RenderMonkey's "FarClipPlane".
+			*/
+			ACT_FAR_CLIP_DISTANCE,
+
+            /** provides the pass index number within the technique
+                of the active materil.
+            */
+            ACT_PASS_NUMBER,
+
+            /** provides the current iteration number of the pass. The iteration
+                number is the number of times the current render operation has
+                been drawn for the acitve pass.
+            */
+            ACT_PASS_ITERATION_NUMBER,
+
+
+			/** Provides a parametric animation value [0..1], only available
+				where the renderable specifically implements it.
+			*/
+			ACT_ANIMATION_PARAMETRIC,
+
+			/** Provides the texel offsets required by this rendersystem to map
+				texels to pixels. Packed as 
+				float4(absoluteHorizontalOffset, absoluteVerticalOffset, 
+					horizontalOffset / viewportWidth, verticalOffset / viewportHeight)
+			*/
+			ACT_TEXEL_OFFSETS,
+
+			/** Provides information about the depth range of the scene as viewed
+				from the current camera. 
+				Passed as float4(minDepth, maxDepth, depthRange, 1 / depthRange)
+			*/
+			ACT_SCENE_DEPTH_RANGE,
+
+			/** Provides information about the depth range of the scene as viewed
+			from a given shadow camera. Requires an index parameter which maps
+			to a light index relative to the current light list.
+			Passed as float4(minDepth, maxDepth, depthRange, 1 / depthRange)
+			*/
+			ACT_SHADOW_SCENE_DEPTH_RANGE,
+
+            /** Provides texture size of the texture unit (index determined by setAutoConstant
+                call). Packed as float4(width, height, depth, 1)
+            */
+            ACT_TEXTURE_SIZE,
+            /** Provides inverse texture size of the texture unit (index determined by setAutoConstant
+                call). Packed as float4(1 / width, 1 / height, 1 / depth, 1)
+            */
+            ACT_INVERSE_TEXTURE_SIZE,
+            /** Provides packed texture size of the texture unit (index determined by setAutoConstant
+                call). Packed as float4(width, height, 1 / width, 1 / height)
+            */
+            ACT_PACKED_TEXTURE_SIZE,
+
+
+        };
+
+        /** Defines the type of the extra data item used by the auto constant.
+
+        */
+        enum ACDataType {
+            /// no data is required
+            ACDT_NONE,
+            /// the auto constant requires data of type int
+            ACDT_INT,
+            /// the auto constant requires data of type real
+            ACDT_REAL
+        };
+
+        /** Defines the base element type of the auto constant
+        */
+        enum ElementType {
+            ET_INT,
+            ET_REAL
+        };
+
+        /** Structure defining an auto constant that's available for use in 
+			a parameters object.
+		*/
+		struct AutoConstantDefinition
+        {
+            AutoConstantType acType;
+            String name;
+            size_t elementCount;
+			/// The type of the constant in the program
+            ElementType elementType;
+			/// The type of any extra data
+            ACDataType dataType;
+
+			AutoConstantDefinition(AutoConstantType _acType, const String& _name, 
+				size_t _elementCount, ElementType _elementType, 
+				ACDataType _dataType)
+				:acType(_acType), name(_name), elementCount(_elementCount), 
+				elementType(_elementType), dataType(_dataType)
+			{
+				
+			}
+        };
+
+        /** Structure recording the use of an automatic parameter. */
+        class AutoConstantEntry
+        {
+        public:
+            /// The type of parameter
+            AutoConstantType paramType;
+			/// The target (physical) constant index
+            size_t physicalIndex;
+			/** The number of elements per individual entry in this constant
+				Used in case people used packed elements smaller than 4 (e.g. GLSL)
+				and bind an auto which is 4-element packed to it */
+			size_t elementCount;
+            /// Additional information to go with the parameter
+			union{
+				size_t data;
+				Real fData;
+			};
+
+            AutoConstantEntry(AutoConstantType theType, size_t theIndex, size_t theData, 
+				size_t theElemCount = 4)
+                : paramType(theType), physicalIndex(theIndex), elementCount(theElemCount), data(theData) {}
+
+			AutoConstantEntry(AutoConstantType theType, size_t theIndex, Real theData, 
+				size_t theElemCount = 4)
+				: paramType(theType), physicalIndex(theIndex), elementCount(theElemCount), fData(theData) {}
+
+        };
+		// Auto parameter storage
+		typedef std::vector<AutoConstantEntry> AutoConstantList;
+
+		/** Definition of container that holds the current float constants.
+		@note Not necessarily in direct index order to constant indexes, logical
+			to physical index map is derived from GpuProgram
+		*/
+		typedef std::vector<float> FloatConstantList;
+		/** Definition of container that holds the current float constants.
+		@note Not necessarily in direct index order to constant indexes, logical
+			to physical index map is derived from GpuProgram
+		*/
+		typedef std::vector<int> IntConstantList;
+
+	protected:
+        static AutoConstantDefinition AutoConstantDictionary[];
+		/// Packed list of floating-point constants (physical indexing)
+        FloatConstantList mFloatConstants;
+        /// Packed list of integer constants (physical indexing)
+        IntConstantList mIntConstants;
+		/** Logical index to physical index map - for low-level programs
+			or high-level programs which pass params this way. */
+		GpuLogicalBufferStruct* mFloatLogicalToPhysical;
+		/** Logical index to physical index map - for low-level programs
+		or high-level programs which pass params this way. */
+		GpuLogicalBufferStruct* mIntLogicalToPhysical;
+		/// Mapping from parameter names to def - high-level programs are expected to populate this
+		const GpuNamedConstants* mNamedConstants;
+        /// List of automatically updated parameters
+        AutoConstantList mAutoConstants;
+        /// Do we need to transpose matrices?
+        bool mTransposeMatrices;
+		/// flag to indicate if names not found will be ignored
+		bool mIgnoreMissingParams;
+        /// physical index for active pass iteration parameter real constant entry;
+        size_t mActivePassIterationIndex;
+
+    public:
+		GpuProgramParameters();
+		~GpuProgramParameters() {}
+
+        /// Copy constructor
+        GpuProgramParameters(const GpuProgramParameters& oth);
+        /// Operator = overload
+        GpuProgramParameters& operator=(const GpuProgramParameters& oth);
+
+		/** Internal method for providing a link to a name->definition map for parameters. */
+		void _setNamedConstants(const GpuNamedConstants* constantmap);
+
+		/** Internal method for providing a link to a logical index->physical index map for parameters. */
+		void _setLogicalIndexes(GpuLogicalBufferStruct* floatIndexMap, 
+			GpuLogicalBufferStruct* intIndexMap);
+
+
+		/// Does this parameter set include named parameters?
+		bool hasNamedParameters() const { return mNamedConstants != 0;}
+		/** Does this parameter set include logically indexed parameters?
+		@note Not mutually exclusive with hasNamedParameters since some high-level
+			programs still use logical indexes to set the parameters on the 
+			rendersystem.
+		*/
+		bool hasLogicalIndexedParameters() const { return mFloatLogicalToPhysical != 0;}
+
+		/** Sets a 4-element floating-point parameter to the program.
+		@param index The logical constant index at which to place the parameter 
+			(each constant is a 4D float)
+		@param vec The value to set
+		*/
+		void setConstant(size_t index, const Vector4& vec);
+		/** Sets a single floating-point parameter to the program.
+		@note This is actually equivalent to calling 
+		setConstant(index Vector4(val, 0, 0, 0)) since all constants are 4D.
+		@param index The logical constant index at which to place the parameter (each constant is
+		a 4D float)
+		@param val The value to set
+		*/
+		void setConstant(size_t index, Real val);
+		/** Sets a 4-element floating-point parameter to the program via Vector3.
+		@param index The logical constant index at which to place the parameter (each constant is
+            a 4D float).
+            Note that since you're passing a Vector3, the last element of the 4-element
+            value will be set to 1 (a homogenous vector)
+		@param vec The value to set
+		*/
+		void setConstant(size_t index, const Vector3& vec);
+		/** Sets a Matrix4 parameter to the program.
+		@param index The logical constant index at which to place the parameter (each constant is
+            a 4D float).
+            NB since a Matrix4 is 16 floats long, this parameter will take up 4 indexes.
+		@param m The value to set
+		*/
+		void setConstant(size_t index, const Matrix4& m);
+        /** Sets a list of Matrix4 parameters to the program.
+        @param index The logical constant index at which to start placing the parameter (each constant is
+        a 4D float).
+        NB since a Matrix4 is 16 floats long, so each entry will take up 4 indexes.
+        @param m Pointer to an array of matrices to set
+        @param numEntries Number of Matrix4 entries
+        */
+        void setConstant(size_t index, const Matrix4* m, size_t numEntries);
+		/** Sets a multiple value constant floating-point parameter to the program.
+		@param index The logical constant index at which to start placing parameters (each constant is
+            a 4D float)
+		@param val Pointer to the values to write, must contain 4*count floats
+		@param count The number of groups of 4 floats to write
+		*/
+		void setConstant(size_t index, const float *val, size_t count);
+		/** Sets a multiple value constant floating-point parameter to the program.
+		@param index The logical constant index at which to start placing parameters (each constant is
+            a 4D float)
+		@param val Pointer to the values to write, must contain 4*count floats
+		@param count The number of groups of 4 floats to write
+		*/
+		void setConstant(size_t index, const double *val, size_t count);
+		/** Sets a ColourValue parameter to the program.
+		@param index The logical constant index at which to place the parameter (each constant is
+            a 4D float)
+		@param colour The value to set
+		*/
+        void setConstant(size_t index, const ColourValue& colour);
+		
+		/** Sets a multiple value constant integer parameter to the program.
+        @remarks
+            Different types of GPU programs support different types of constant parameters.
+            For example, it's relatively common to find that vertex programs only support
+            floating point constants, and that fragment programs only support integer (fixed point)
+            parameters. This can vary depending on the program version supported by the
+            graphics card being used. You should consult the documentation for the type of
+            low level program you are using, or alternatively use the methods
+            provided on RenderSystemCapabilities to determine the options.
+		@param index The logical constant index at which to place the parameter (each constant is
+            a 4D integer)
+		@param val Pointer to the values to write, must contain 4*count ints
+		@param count The number of groups of 4 ints to write
+		*/
+		void setConstant(size_t index, const int *val, size_t count);
+
+		/** Write a series of floating point values into the underlying float 
+			constant buffer at the given physical index.
+		@param physicalIndex The buffer position to start writing
+		@param val Pointer to a list of values to write
+		@param count The number of floats to write
+		*/
+		void _writeRawConstants(size_t physicalIndex, const float* val, size_t count);
+		/** Write a series of floating point values into the underlying float 
+		constant buffer at the given physical index.
+		@param physicalIndex The buffer position to start writing
+		@param val Pointer to a list of values to write
+		@param count The number of floats to write
+		*/
+		void _writeRawConstants(size_t physicalIndex, const double* val, size_t count);
+		/** Write a series of integer values into the underlying integer
+			constant buffer at the given physical index.
+		@param physicalIndex The buffer position to start writing
+		@param val Pointer to a list of values to write
+		@param count The number of ints to write
+		*/
+		void _writeRawConstants(size_t physicalIndex, const int* val, size_t count);
+		/** Read a series of floating point values from the underlying float 
+			constant buffer at the given physical index.
+		@param physicalIndex The buffer position to start reading
+		@param count The number of floats to read
+		@param dest Pointer to a buffer to receive the values
+		*/
+		void _readRawConstants(size_t physicalIndex, size_t count, float* dest);
+		/** Read a series of integer values from the underlying integer 
+		constant buffer at the given physical index.
+		@param physicalIndex The buffer position to start reading
+		@param count The number of ints to read
+		@param dest Pointer to a buffer to receive the values
+		*/
+		void _readRawConstants(size_t physicalIndex, size_t count, int* dest);
+
+		/** Write a 4-element floating-point parameter to the program directly to 
+			the underlying constants buffer.
+		@note You can use these methods if you have already derived the physical
+			constant buffer location, for a slight speed improvement over using
+			the named / logical index versions.
+		@param physicalIndex The physical buffer index at which to place the parameter 
+		@param vec The value to set
+		@param count The number of floats to write; if for example
+			the uniform constant 'slot' is smaller than a Vector4
+		*/
+		void _writeRawConstant(size_t physicalIndex, const Vector4& vec, 
+			size_t count = 4);
+		/** Write a single floating-point parameter to the program.
+		@note You can use these methods if you have already derived the physical
+		constant buffer location, for a slight speed improvement over using
+		the named / logical index versions.
+		@param physicalIndex The physical buffer index at which to place the parameter 
+		@param val The value to set
+		*/
+		void _writeRawConstant(size_t physicalIndex, Real val);
+		/** Write a single integer parameter to the program.
+		@note You can use these methods if you have already derived the physical
+		constant buffer location, for a slight speed improvement over using
+		the named / logical index versions.
+		@param physicalIndex The physical buffer index at which to place the parameter 
+		@param val The value to set
+		*/
+		void _writeRawConstant(size_t physicalIndex, int val);
+		/** Write a 3-element floating-point parameter to the program via Vector3.
+		@note You can use these methods if you have already derived the physical
+		constant buffer location, for a slight speed improvement over using
+		the named / logical index versions.
+		@param physicalIndex The physical buffer index at which to place the parameter 
+		@param vec The value to set
+		*/
+		void _writeRawConstant(size_t physicalIndex, const Vector3& vec);
+		/** Write a Matrix4 parameter to the program.
+		@note You can use these methods if you have already derived the physical
+		constant buffer location, for a slight speed improvement over using
+		the named / logical index versions.
+		@param physicalIndex The physical buffer index at which to place the parameter 
+		@param m The value to set
+		*/
+		void _writeRawConstant(size_t physicalIndex, const Matrix4& m);
+        /** Write a list of Matrix4 parameters to the program.
+		@note You can use these methods if you have already derived the physical
+		constant buffer location, for a slight speed improvement over using
+		the named / logical index versions.
+		@param physicalIndex The physical buffer index at which to place the parameter 
+        @param numEntries Number of Matrix4 entries
+        */
+        void _writeRawConstant(size_t physicalIndex, const Matrix4* m, size_t numEntries);
+		/** Write a ColourValue parameter to the program.
+		@note You can use these methods if you have already derived the physical
+		constant buffer location, for a slight speed improvement over using
+		the named / logical index versions.
+		@param physicalIndex The physical buffer index at which to place the parameter 
+		@param colour The value to set
+		@param count The number of floats to write; if for example
+			the uniform constant 'slot' is smaller than a Vector4
+		*/
+        void _writeRawConstant(size_t physicalIndex, const ColourValue& colour, 
+			size_t count = 4);
+		
+
+        /** Gets an iterator over the named GpuConstantDefinition instances as defined
+			by the program for which these parameters exist.
+		@note
+			Only available if this parameters object has named parameters.
+		*/
+        GpuConstantDefinitionIterator getConstantDefinitionIterator(void) const;
+
+		/** Get a specific GpuConstantDefinition for a named parameter.
+		@note
+			Only available if this parameters object has named parameters.
+		*/
+		const GpuConstantDefinition& getConstantDefinition(const String& name) const;
+
+		/** Get the full list of GpuConstantDefinition instances.
+		@note
+		Only available if this parameters object has named parameters.
+		*/
+		const GpuNamedConstants& getConstantDefinitions() const;
+
+		/** Get the current list of mappings from low-level logical param indexes
+			to physical buffer locations in the float buffer.
+		@note
+			Only applicable to low-level programs.
+		*/
+		const GpuLogicalBufferStruct* getFloatLogicalBufferStruct() const { return mFloatLogicalToPhysical; }
+
+		/** Retrieves the logical index relating to a physical index in the float
+			buffer, for programs which support that (low-level programs and 
+			high-level programs which use logical parameter indexes).
+			@returns std::numeric_limits<size_t>::max() if not found
+		*/
+		size_t getFloatLogicalIndexForPhysicalIndex(size_t physicalIndex);
+		/** Retrieves the logical index relating to a physical index in the int
+		buffer, for programs which support that (low-level programs and 
+		high-level programs which use logical parameter indexes).
+		@returns std::numeric_limits<size_t>::max() if not found
+		*/
+		size_t getIntLogicalIndexForPhysicalIndex(size_t physicalIndex);
+
+		/** Get the current list of mappings from low-level logical param indexes
+			to physical buffer locations in the integer buffer.
+		@note
+			Only applicable to low-level programs.
+		*/
+		const GpuLogicalBufferStruct* getIntLogicalBufferStruct() const { return mIntLogicalToPhysical; }
+		/// Get a reference to the list of float constants
+		const FloatConstantList& getFloatConstantList() const { return mFloatConstants; }
+		/// Get a pointer to the 'nth' item in the float buffer
+		float* getFloatPointer(size_t pos) { return &mFloatConstants[pos]; }
+		/// Get a pointer to the 'nth' item in the float buffer
+		const float* getFloatPointer(size_t pos) const { return &mFloatConstants[pos]; }
+		/// Get a reference to the list of int constants
+		const IntConstantList& getIntConstantList() const { return mIntConstants; }
+		/// Get a pointer to the 'nth' item in the int buffer
+		int* getIntPointer(size_t pos) { return &mIntConstants[pos]; }
+		/// Get a pointer to the 'nth' item in the int buffer
+		const int* getIntPointer(size_t pos) const { return &mIntConstants[pos]; }
+		/// Get a reference to the list of auto constant bindings
+		const AutoConstantList& getAutoConstantList() const { return mAutoConstants; }
+
+        /** Sets up a constant which will automatically be updated by the system.
+        @remarks
+            Vertex and fragment programs often need parameters which are to do with the
+            current render state, or particular values which may very well change over time,
+            and often between objects which are being rendered. This feature allows you 
+            to set up a certain number of predefined parameter mappings that are kept up to 
+            date for you.
+        @param index The location in the constant list to place this updated constant every time
+            it is changed. Note that because of the nature of the types, we know how big the 
+            parameter details will be so you don't need to set that like you do for manual constants.
+        @param acType The type of automatic constant to set
+        @param extraInfo If the constant type needs more information (like a light index) put it here.
+        */
+        void setAutoConstant(size_t index, AutoConstantType acType, size_t extraInfo = 0);
+		void setAutoConstantReal(size_t index, AutoConstantType acType, Real rData);
+
+		/** As setAutoConstant, but sets up the auto constant directly against a
+			physical buffer index.
+		*/
+		void _setRawAutoConstant(size_t physicalIndex, AutoConstantType acType, size_t extraInfo, 
+			size_t elementSize = 4);
+		/** As setAutoConstantReal, but sets up the auto constant directly against a
+		physical buffer index.
+		*/
+		void _setRawAutoConstantReal(size_t physicalIndex, AutoConstantType acType, Real rData, 
+			size_t elementSize = 4);
+
+
+		/** Unbind an auto constant so that the constant is manually controlled again. */
+		void clearAutoConstant(size_t index);
+
+        /** Sets a named parameter up to track a derivation of the current time.
+        @param index The index of the parameter
+        @param factor The amount by which to scale the time value
+        */  
+        void setConstantFromTime(size_t index, Real factor);
+
+        /** Clears all the existing automatic constants. */
+        void clearAutoConstants(void);
+        typedef ConstVectorIterator<AutoConstantList> AutoConstantIterator;
+        /** Gets an iterator over the automatic constant bindings currently in place. */
+        AutoConstantIterator getAutoConstantIterator(void) const;
+        /// Gets the number of int constants that have been set
+        size_t getAutoConstantCount(void) const { return mAutoConstants.size(); }
+		/** Gets a specific Auto Constant entry if index is in valid range
+			otherwise returns a NULL
+		@parem index which entry is to be retrieved
+		*/
+		AutoConstantEntry* getAutoConstantEntry(const size_t index);
+        /** Returns true if this instance has any automatic constants. */
+        bool hasAutoConstants(void) const { return !(mAutoConstants.empty()); }
+		/** Finds an auto constant that's affecting a given logical parameter 
+			index for floating-point values.
+		@note Only applicable for low-level programs.
+		*/
+		const AutoConstantEntry* findFloatAutoConstantEntry(size_t logicalIndex);
+		/** Finds an auto constant that's affecting a given logical parameter 
+		index for integer values.
+		@note Only applicable for low-level programs.
+		*/
+		const AutoConstantEntry* findIntAutoConstantEntry(size_t logicalIndex);
+		/** Finds an auto constant that's affecting a given named parameter index.
+		@note Only applicable to high-level programs.
+		*/
+		const AutoConstantEntry* findAutoConstantEntry(const String& paramName);
+		/** Finds an auto constant that's affecting a given physical position in 
+			the floating-point buffer
+		*/
+		const AutoConstantEntry* _findRawAutoConstantEntryFloat(size_t physicalIndex);
+		/** Finds an auto constant that's affecting a given physical position in 
+		the integer buffer
+		*/
+		const AutoConstantEntry* _findRawAutoConstantEntryInt(size_t physicalIndex);
+
+        /** Updates the automatic parameters (except lights) based on the details provided. */
+        void _updateAutoParamsNoLights(const AutoParamDataSource& source);
+        /** Updates the automatic parameters for lights based on the details provided. */
+        void _updateAutoParamsLightsOnly(const AutoParamDataSource& source);
+
+		/** Tells the program whether to ignore missing parameters or not.
+		*/
+		void setIgnoreMissingParams(bool state) { mIgnoreMissingParams = state; }
+
+		/** Sets a single value constant floating-point parameter to the program.
+        @remarks
+            Different types of GPU programs support different types of constant parameters.
+            For example, it's relatively common to find that vertex programs only support
+            floating point constants, and that fragment programs only support integer (fixed point)
+            parameters. This can vary depending on the program version supported by the
+            graphics card being used. You should consult the documentation for the type of
+            low level program you are using, or alternatively use the methods
+            provided on RenderSystemCapabilities to determine the options.
+        @par
+            Another possible limitation is that some systems only allow constants to be set
+            on certain boundaries, e.g. in sets of 4 values for example. Again, see
+            RenderSystemCapabilities for full details.
+        @note
+            This named option will only work if you are using a parameters object created
+            from a high-level program (HighLevelGpuProgram).
+		@param name The name of the parameter
+		@param val The value to set
+		*/
+		void setNamedConstant(const String& name, Real val);
+		/** Sets a single value constant integer parameter to the program.
+        @remarks
+            Different types of GPU programs support different types of constant parameters.
+            For example, it's relatively common to find that vertex programs only support
+            floating point constants, and that fragment programs only support integer (fixed point)
+            parameters. This can vary depending on the program version supported by the
+            graphics card being used. You should consult the documentation for the type of
+            low level program you are using, or alternatively use the methods
+            provided on RenderSystemCapabilities to determine the options.
+        @par
+            Another possible limitation is that some systems only allow constants to be set
+            on certain boundaries, e.g. in sets of 4 values for example. Again, see
+            RenderSystemCapabilities for full details.
+        @note
+            This named option will only work if you are using a parameters object created
+            from a high-level program (HighLevelGpuProgram).
+        @param name The name of the parameter
+		@param val The value to set
+		*/
+		void setNamedConstant(const String& name, int val);
+		/** Sets a Vector4 parameter to the program.
+        @param name The name of the parameter
+		@param vec The value to set
+		*/
+		void setNamedConstant(const String& name, const Vector4& vec);
+		/** Sets a Vector3 parameter to the program.
+        @note
+            This named option will only work if you are using a parameters object created
+            from a high-level program (HighLevelGpuProgram).
+		@param index The index at which to place the parameter
+			NB this index refers to the number of floats, so a Vector3 is 3. Note that many 
+            rendersystems & programs assume that every floating point parameter is passed in
+            as a vector of 4 items, so you are strongly advised to check with 
+            RenderSystemCapabilities before using this version - if in doubt use Vector4
+            or ColourValue instead (both are 4D).
+		@param vec The value to set
+		*/
+		void setNamedConstant(const String& name, const Vector3& vec);
+		/** Sets a Matrix4 parameter to the program.
+        @param name The name of the parameter
+		@param m The value to set
+		*/
+		void setNamedConstant(const String& name, const Matrix4& m);
+        /** Sets a list of Matrix4 parameters to the program.
+        @param name The name of the parameter; this must be the first index of an array,
+            for examples 'matrices[0]'
+        NB since a Matrix4 is 16 floats long, so each entry will take up 4 indexes.
+        @param m Pointer to an array of matrices to set
+        @param numEntries Number of Matrix4 entries
+        */
+        void setNamedConstant(const String& name, const Matrix4* m, size_t numEntries);
+		/** Sets a multiple value constant floating-point parameter to the program.
+        @par
+            Some systems only allow constants to be set on certain boundaries, 
+			e.g. in sets of 4 values for example. The 'multiple' parameter allows
+			you to control that although you should only change it if you know
+			your chosen language supports that (at the time of writing, only
+			GLSL allows constants which are not a multiple of 4).
+        @note
+            This named option will only work if you are using a parameters object created
+            from a high-level program (HighLevelGpuProgram).
+        @param name The name of the parameter
+		@param val Pointer to the values to write
+		@param count The number of 'multiples' of floats to write
+		@param multiple The number of raw entries in each element to write, 
+			the default is 4 so count = 1 would write 4 floats.
+		*/
+		void setNamedConstant(const String& name, const float *val, size_t count, 
+			size_t multiple = 4);
+		/** Sets a multiple value constant floating-point parameter to the program.
+        @par
+            Some systems only allow constants to be set on certain boundaries, 
+			e.g. in sets of 4 values for example. The 'multiple' parameter allows
+			you to control that although you should only change it if you know
+			your chosen language supports that (at the time of writing, only
+			GLSL allows constants which are not a multiple of 4).
+        @note
+            This named option will only work if you are using a parameters object created
+            from a high-level program (HighLevelGpuProgram).
+        @param name The name of the parameter
+		@param val Pointer to the values to write
+		@param count The number of 'multiples' of floats to write
+		@param multiple The number of raw entries in each element to write, 
+			the default is 4 so count = 1 would write 4 floats.
+		*/
+		void setNamedConstant(const String& name, const double *val, size_t count, 
+			size_t multiple = 4);
+		/** Sets a ColourValue parameter to the program.
+        @param name The name of the parameter
+		@param colour The value to set
+		*/
+        void setNamedConstant(const String& name, const ColourValue& colour);
+		
+		/** Sets a multiple value constant floating-point parameter to the program.
+        @par
+            Some systems only allow constants to be set on certain boundaries, 
+			e.g. in sets of 4 values for example. The 'multiple' parameter allows
+			you to control that although you should only change it if you know
+			your chosen language supports that (at the time of writing, only
+			GLSL allows constants which are not a multiple of 4).
+        @note
+            This named option will only work if you are using a parameters object created
+            from a high-level program (HighLevelGpuProgram).
+        @param name The name of the parameter
+		@param val Pointer to the values to write
+		@param count The number of 'multiples' of floats to write
+		@param multiple The number of raw entries in each element to write, 
+			the default is 4 so count = 1 would write 4 floats.
+		*/
+		void setNamedConstant(const String& name, const int *val, size_t count, 
+			size_t multiple = 4);
+
+        /** Sets up a constant which will automatically be updated by the system.
+        @remarks
+            Vertex and fragment programs often need parameters which are to do with the
+            current render state, or particular values which may very well change over time,
+            and often between objects which are being rendered. This feature allows you 
+            to set up a certain number of predefined parameter mappings that are kept up to 
+            date for you.
+        @note
+            This named option will only work if you are using a parameters object created
+            from a high-level program (HighLevelGpuProgram).
+        @param name The name of the parameter
+        @param acType The type of automatic constant to set
+        @param extraInfo If the constant type needs more information (like a light index) put it here.
+        */
+        void setNamedAutoConstant(const String& name, AutoConstantType acType, size_t extraInfo = 0);
+		void setNamedAutoConstantReal(const String& name, AutoConstantType acType, Real rData);
+
+        /** Sets a named parameter up to track a derivation of the current time.
+        @note
+            This named option will only work if you are using a parameters object created
+            from a high-level program (HighLevelGpuProgram).
+        @param name The name of the parameter
+        @param factor The amount by which to scale the time value
+        */  
+        void setNamedConstantFromTime(const String& name, Real factor);
+
+		/** Unbind an auto constant so that the constant is manually controlled again. */
+		void clearNamedAutoConstant(const String& name);
+
+        /** Find a constant definition for a named parameter.
+		@remarks
+			This method returns null if the named parameter did not exist, unlike
+			getConstantDefinition which is more strict; unless you set the 
+			last parameter to true.
+		@param name The name to look up
+		@param throwExceptionIfMissing If set to true, failure to find an entry
+			will throw an exception.
+		*/
+        const GpuConstantDefinition* _findNamedConstantDefinition(
+			const String& name, bool throwExceptionIfMissing = false) const;
+		/** Gets the physical buffer index associated with a logical float constant index. 
+		@note Only applicable to low-level programs.
+		@param logicalIndex The logical parameter index
+		@param requestedSize The requested size - pass 0 to ignore missing entries
+			and return std::numeric_limits<size_t>::max() 
+		*/
+		size_t _getFloatConstantPhysicalIndex(size_t logicalIndex, size_t requestedSize);
+		/** Gets the physical buffer index associated with a logical int constant index. 
+		@note Only applicable to low-level programs.
+		@param logicalIndex The logical parameter index
+		@param requestedSize The requested size - pass 0 to ignore missing entries
+			and return std::numeric_limits<size_t>::max() 
+		*/
+		size_t _getIntConstantPhysicalIndex(size_t logicalIndex, size_t requestedSize);
+
+
+        /** Sets whether or not we need to transpose the matrices passed in from the rest of OGRE.
+        @remarks
+            D3D uses transposed matrices compared to GL and OGRE; this is not important when you
+            use programs which are written to process row-major matrices, such as those generated
+            by Cg, but if you use a program written to D3D's matrix layout you will need to enable
+            this flag.
+        */
+        void setTransposeMatrices(bool val) { mTransposeMatrices = val; } 
+        /// Gets whether or not matrices are to be transposed when set
+        bool getTransposeMatrices(void) const { return mTransposeMatrices; } 
+
+		/** Copies the values of all constants (including auto constants) from another
+			GpuProgramParameters object.
+		*/
+		void copyConstantsFrom(const GpuProgramParameters& source);
+
+        /** gets the auto constant definition associated with name if found else returns NULL
+        @param name The name of the auto constant
+        */
+        static const AutoConstantDefinition* getAutoConstantDefinition(const String& name);
+        /** gets the auto constant definition using an index into the auto constant definition array.
+            If the index is out of bounds then NULL is returned;
+        @param idx The auto constant index
+        */
+        static const AutoConstantDefinition* getAutoConstantDefinition(const size_t idx);
+        /** Returns the number of auto constant definitions
+        */
+        static size_t getNumAutoConstantDefinitions(void);
+
+
+        /** increments the multipass number entry by 1 if it exists
+        */
+        void incPassIterationNumber(void);
+		/** Does this parameters object have a pass iteration number constant? */
+		bool hasPassIterationNumber() const 
+		{ return mActivePassIterationIndex != (std::numeric_limits<size_t>::max)(); }
+		/** Get the physical buffer index of the pass iteration number constant */
+		size_t getPassIterationNumberIndex() const 
+		{ return mActivePassIterationIndex; }
+
+
+    };
+
+    /// Shared pointer used to hold references to GpuProgramParameters instances
+    typedef SharedPtr<GpuProgramParameters> GpuProgramParametersSharedPtr;
+
+    // Forward declaration 
+    class GpuProgramPtr;
+
+	/** Defines a program which runs on the GPU such as a vertex or fragment program. 
+	@remarks
+		This class defines the low-level program in assembler code, the sort used to
+		directly assemble into machine instructions for the GPU to execute. By nature,
+		this means that the assembler source is rendersystem specific, which is why this
+		is an abstract class - real instances are created through the RenderSystem. 
+		If you wish to use higher level shading languages like HLSL and Cg, you need to 
+		use the HighLevelGpuProgram class instead.
+	*/
+	class _OgreExport GpuProgram : public Resource
+	{
+	protected:
+		/// Command object - see ParamCommand 
+		class _OgreExport CmdType : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+		class _OgreExport CmdSyntax : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+		class _OgreExport CmdSkeletal : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+		class _OgreExport CmdMorph : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+		class _OgreExport CmdPose : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+		class _OgreExport CmdVTF : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+		// Command object for setting / getting parameters
+		static CmdType msTypeCmd;
+		static CmdSyntax msSyntaxCmd;
+		static CmdSkeletal msSkeletalCmd;
+		static CmdMorph msMorphCmd;
+		static CmdPose msPoseCmd;
+		static CmdVTF msVTFCmd;
+	
+		/// The type of the program
+		GpuProgramType mType;
+		/// The name of the file to load source from (may be blank)
+		String mFilename;
+        /// The assembler source of the program (may be blank until file loaded)
+        String mSource;
+        /// Whether we need to load source from file or not
+        bool mLoadFromFile;
+        /// Syntax code eg arbvp1, vs_2_0 etc
+        String mSyntaxCode;
+        /// Does this (vertex) program include skeletal animation?
+        bool mSkeletalAnimation;
+		/// Does this (vertex) program include morph animation?
+		bool mMorphAnimation;
+		/// Does this (vertex) program include pose animation (count of number of poses supported)
+		ushort mPoseAnimation;
+		/// Does this (vertex) program require support for vertex texture fetch?
+		bool mVertexTextureFetch;
+		/// The default parameters for use with this object
+		GpuProgramParametersSharedPtr mDefaultParams;
+		/// Does this program want light states passed through fixed pipeline
+		bool mPassSurfaceAndLightStates;
+		/// Did we encounter a compilation error?
+		bool mCompileError;
+		/** Record of logical to physical buffer maps. Mandatory for low-level
+			programs or high-level programs which set their params the same way. */
+		mutable GpuLogicalBufferStruct mFloatLogicalToPhysical;
+		/** Record of logical to physical buffer maps. Mandatory for low-level
+			programs or high-level programs which set their params the same way. */
+		mutable GpuLogicalBufferStruct mIntLogicalToPhysical;
+
+		/** Internal method for setting up the basic parameter definitions for a subclass. 
+		@remarks
+		Because StringInterface holds a dictionary of parameters per class, subclasses need to
+		call this to ask the base class to add it's parameters to their dictionary as well.
+		Can't do this in the constructor because that runs in a non-virtual context.
+		@par
+		The subclass must have called it's own createParamDictionary before calling this method.
+		*/
+		void setupBaseParamDictionary(void);
+
+        /** Internal method returns whether required capabilities for this program is supported.
+        */
+        bool isRequiredCapabilitiesSupported(void) const;
+
+		/// @copydoc Resource::calculateSize
+		size_t calculateSize(void) const { return 0; } // TODO 
+
+		/// @copydoc Resource::loadImpl
+		void loadImpl(void);
+	public:
+
+		GpuProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
+			const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
+
+		virtual ~GpuProgram() {}
+
+        /** Sets the filename of the source assembly for this program.
+        @remarks
+            Setting this will have no effect until you (re)load the program.
+        */
+        virtual void setSourceFile(const String& filename);
+
+		/** Sets the source assembly for this program from an in-memory string.
+        @remarks
+            Setting this will have no effect until you (re)load the program.
+        */
+        virtual void setSource(const String& source);
+
+        /** Gets the syntax code for this program e.g. arbvp1, fp20, vs_1_1 etc */
+        virtual const String& getSyntaxCode(void) const { return mSyntaxCode; }
+
+		/** Sets the syntax code for this program e.g. arbvp1, fp20, vs_1_1 etc */
+		virtual void setSyntaxCode(const String& syntax);
+
+		/** Gets the name of the file used as source for this program. */
+		virtual const String& getSourceFile(void) const { return mFilename; }
+        /** Gets the assembler source for this program. */
+        virtual const String& getSource(void) const { return mSource; }
+		/// Set the program type (only valid before load)
+		virtual void setType(GpuProgramType t);
+        /// Get the program type
+        virtual GpuProgramType getType(void) const { return mType; }
+
+        /** Returns the GpuProgram which should be bound to the pipeline.
+        @remarks
+            This method is simply to allow some subclasses of GpuProgram to delegate
+            the program which is bound to the pipeline to a delegate, if required. */
+        virtual GpuProgram* _getBindingDelegate(void) { return this; }
+
+        /** Returns whether this program can be supported on the current renderer and hardware. */
+        virtual bool isSupported(void) const;
+
+        /** Creates a new parameters object compatible with this program definition. 
+        @remarks
+            It is recommended that you use this method of creating parameters objects
+            rather than going direct to GpuProgramManager, because this method will
+            populate any implementation-specific extras (like named parameters) where
+            they are appropriate.
+        */
+        virtual GpuProgramParametersSharedPtr createParameters(void);
+
+        /** Sets whether a vertex program includes the required instructions
+        to perform skeletal animation. 
+        @remarks
+        If this is set to true, OGRE will not blend the geometry according to 
+        skeletal animation, it will expect the vertex program to do it.
+        */
+        virtual void setSkeletalAnimationIncluded(bool included) 
+        { mSkeletalAnimation = included; }
+
+        /** Returns whether a vertex program includes the required instructions
+            to perform skeletal animation. 
+        @remarks
+            If this returns true, OGRE will not blend the geometry according to 
+            skeletal animation, it will expect the vertex program to do it.
+        */
+        virtual bool isSkeletalAnimationIncluded(void) const { return mSkeletalAnimation; }
+
+        /** Sets whether a vertex program includes the required instructions
+        to perform morph animation. 
+        @remarks
+        If this is set to true, OGRE will not blend the geometry according to 
+        morph animation, it will expect the vertex program to do it.
+        */
+        virtual void setMorphAnimationIncluded(bool included) 
+		{ mMorphAnimation = included; }
+
+        /** Sets whether a vertex program includes the required instructions
+        to perform pose animation. 
+        @remarks
+        If this is set to true, OGRE will not blend the geometry according to 
+        pose animation, it will expect the vertex program to do it.
+		@param poseCount The number of simultaneous poses the program can blend
+        */
+        virtual void setPoseAnimationIncluded(ushort poseCount) 
+		{ mPoseAnimation = poseCount; }
+
+		/** Returns whether a vertex program includes the required instructions
+            to perform morph animation. 
+        @remarks
+            If this returns true, OGRE will not blend the geometry according to 
+            morph animation, it will expect the vertex program to do it.
+        */
+        virtual bool isMorphAnimationIncluded(void) const { return mMorphAnimation; }
+
+		/** Returns whether a vertex program includes the required instructions
+            to perform pose animation. 
+        @remarks
+            If this returns true, OGRE will not blend the geometry according to 
+            pose animation, it will expect the vertex program to do it.
+        */
+        virtual bool isPoseAnimationIncluded(void) const { return mPoseAnimation > 0; }
+		/** Returns the number of simultaneous poses the vertex program can 
+			blend, for use in pose animation.
+        */
+        virtual ushort getNumberOfPosesIncluded(void) const { return mPoseAnimation; }
+		/** Sets whether this vertex program requires support for vertex 
+			texture fetch from the hardware.
+		*/
+		virtual void setVertexTextureFetchRequired(bool r) { mVertexTextureFetch = r; }
+		/** Returns whether this vertex program requires support for vertex 
+			texture fetch from the hardware.
+		*/
+		virtual bool isVertexTextureFetchRequired(void) const { return mVertexTextureFetch; }
+
+		/** Get a reference to the default parameters which are to be used for all
+			uses of this program.
+		@remarks
+			A program can be set up with a list of default parameters, which can save time when 
+			using a program many times in a material with roughly the same settings. By 
+			retrieving the default parameters and populating it with the most used options, 
+			any new parameter objects created from this program afterwards will automatically include
+			the default parameters; thus users of the program need only change the parameters
+			which are unique to their own usage of the program.
+		*/
+		virtual GpuProgramParametersSharedPtr getDefaultParameters(void);
+
+        /** Returns true if default parameters have been set up.  
+        */
+        virtual bool hasDefaultParameters(void) const { return !mDefaultParams.isNull(); }
+
+		/** Sets whether a vertex program requires light and material states to be passed
+		to through fixed pipeline low level API rendering calls.
+		@remarks
+		If this is set to true, OGRE will pass all active light states to the fixed function
+		pipeline.  This is useful for high level shaders like GLSL that can read the OpenGL
+		light and material states.  This way the user does not have to use autoparameters to 
+		pass light position, color etc.
+		*/
+		virtual void setSurfaceAndPassLightStates(bool state)
+			{ mPassSurfaceAndLightStates = state; }
+
+		/** Returns whether a vertex program wants light and material states to be passed
+		through fixed pipeline low level API rendering calls
+		*/
+		virtual bool getPassSurfaceAndLightStates(void) const { return mPassSurfaceAndLightStates; }
+
+        /** Returns a string that specifies the language of the gpu programs as specified
+        in a material script. ie: asm, cg, hlsl, glsl
+        */
+        virtual const String& getLanguage(void) const;
+
+		/** Did this program encounter a compile error when loading?
+		*/
+		virtual bool hasCompileError(void) const { return mCompileError; }
+
+		/** Reset a compile error if it occurred, allowing the load to be retried
+		*/
+		virtual void resetCompileError(void) { mCompileError = false; }
+    protected:
+        /// Virtual method which must be implemented by subclasses, load from mSource
+        virtual void loadFromSource(void) = 0;
+
+	};
+
+
+	/** Specialisation of SharedPtr to allow SharedPtr to be assigned to GpuProgramPtr 
+	@note Has to be a subclass since we need operator=.
+	We could templatise this instead of repeating per Resource subclass, 
+	except to do so requires a form VC6 does not support i.e.
+	ResourceSubclassPtr<T> : public SharedPtr<T>
+	*/
+	class _OgreExport GpuProgramPtr : public SharedPtr<GpuProgram> 
+	{
+	public:
+		GpuProgramPtr() : SharedPtr<GpuProgram>() {}
+		explicit GpuProgramPtr(GpuProgram* rep) : SharedPtr<GpuProgram>(rep) {}
+		GpuProgramPtr(const GpuProgramPtr& r) : SharedPtr<GpuProgram>(r) {} 
+		GpuProgramPtr(const ResourcePtr& r) : SharedPtr<GpuProgram>()
+		{
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+			    pRep = static_cast<GpuProgram*>(r.getPointer());
+			    pUseCount = r.useCountPointer();
+			    if (pUseCount)
+			    {
+				    ++(*pUseCount);
+			    }
+            }
+		}
+
+		/// Operator used to convert a ResourcePtr to a GpuProgramPtr
+		GpuProgramPtr& operator=(const ResourcePtr& r)
+		{
+			if (pRep == static_cast<GpuProgram*>(r.getPointer()))
+				return *this;
+			release();
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+                OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+			    pRep = static_cast<GpuProgram*>(r.getPointer());
+			    pUseCount = r.useCountPointer();
+			    if (pUseCount)
+			    {
+				    ++(*pUseCount);
+			    }
+            }
+			else
+			{
+				// RHS must be a null pointer
+				assert(r.isNull() && "RHS must be null if it has no mutex!");
+				setNull();
+			}
+			return *this;
+		}
+        /// Operator used to convert a HighLevelGpuProgramPtr to a GpuProgramPtr
+        GpuProgramPtr& operator=(const HighLevelGpuProgramPtr& r);
+	};
+}
+
+#endif
Index: /OgreMain/include/OgreGpuProgramManager.h
===================================================================
--- /OgreMain/include/OgreGpuProgramManager.h	(revision 5)
+++ /OgreMain/include/OgreGpuProgramManager.h	(revision 5)
@@ -0,0 +1,190 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __GpuProgramManager_H_
+#define __GpuProgramManager_H_
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+#include "OgreResourceManager.h"
+#include "OgreException.h"
+#include "OgreGpuProgram.h"
+#include "OgreSingleton.h"
+
+namespace Ogre {
+
+	class _OgreExport GpuProgramManager : public ResourceManager, public Singleton<GpuProgramManager>
+	{
+	public:
+		typedef std::set<String> SyntaxCodes;
+
+	protected:
+		/// Supported program syntax codes
+		SyntaxCodes mSyntaxCodes;
+        /// Specialised create method with specific parameters
+        virtual Resource* createImpl(const String& name, ResourceHandle handle, 
+            const String& group, bool isManual, ManualResourceLoader* loader,
+            GpuProgramType gptype, const String& syntaxCode) = 0;
+	public:
+		GpuProgramManager();
+		virtual ~GpuProgramManager();
+
+        /** Loads a GPU program from a file of assembly. 
+		@remarks
+			This method creates a new program of the type specified as the second parameter.
+			As with all types of ResourceManager, this class will search for the file in
+			all resource locations it has been configured to look in.
+		@param name The name of the GpuProgram
+		@param groupName The name of the resource group
+		@param filename The file to load
+		@param gptype The type of program to create
+        @param syntaxCode The name of the syntax to be used for this program e.g. arbvp1, vs_1_1
+		*/
+		virtual GpuProgramPtr load(const String& name, const String& groupName, 
+			const String& filename, GpuProgramType gptype, 
+            const String& syntaxCode);
+
+		/** Loads a GPU program from a string of assembly code.
+		@remarks
+			The assembly code must be compatible with this manager - call the 
+			getSupportedSyntax method for details of the supported syntaxes 
+		@param name The identifying name to give this program, which can be used to
+			retrieve this program later with getByName.
+		@param groupName The name of the resource group
+		@param code A string of assembly code which will form the program to run
+		@param gptype The type of prgram to create.
+        @param syntaxCode The name of the syntax to be used for this program e.g. arbvp1, vs_1_1
+		*/
+		virtual GpuProgramPtr loadFromString(const String& name, const String& groupName,
+			const String& code, GpuProgramType gptype,
+            const String& syntaxCode);
+
+		/** Returns the syntaxes that this manager supports. */
+		virtual const SyntaxCodes& getSupportedSyntax(void) const { return mSyntaxCodes; };
+
+        /** Returns whether a given syntax code (e.g. "ps_1_3", "fp20", "arbvp1") is supported. */
+        virtual bool isSyntaxSupported(const String& syntaxCode) const;
+		
+		/** Creates a new GpuProgramParameters instance which can be used to bind
+            parameters to your programs.
+        @remarks
+            Program parameters can be shared between multiple programs if you wish.
+        */
+        virtual GpuProgramParametersSharedPtr createParameters(void);
+        
+        /** Create a new, unloaded GpuProgram from a file of assembly. 
+        @remarks    
+            Use this method in preference to the 'load' methods if you wish to define
+            a GpuProgram, but not load it yet; useful for saving memory.
+		@par
+			This method creates a new program of the type specified as the second parameter.
+			As with all types of ResourceManager, this class will search for the file in
+			all resource locations it has been configured to look in. 
+		@param name The name of the program
+		@param groupName The name of the resource group
+		@param filename The file to load
+        @param syntaxCode The name of the syntax to be used for this program e.g. arbvp1, vs_1_1
+		@param gptype The type of program to create
+		*/
+		virtual GpuProgramPtr createProgram(const String& name, 
+			const String& groupName, const String& filename, 
+			GpuProgramType gptype, const String& syntaxCode);
+
+		/** Create a GPU program from a string of assembly code.
+        @remarks    
+            Use this method in preference to the 'load' methods if you wish to define
+            a GpuProgram, but not load it yet; useful for saving memory.
+		@par
+			The assembly code must be compatible with this manager - call the 
+			getSupportedSyntax method for details of the supported syntaxes 
+		@param name The identifying name to give this program, which can be used to
+			retrieve this program later with getByName.
+		@param groupName The name of the resource group
+		@param code A string of assembly code which will form the program to run
+		@param gptype The type of prgram to create.
+        @param syntaxCode The name of the syntax to be used for this program e.g. arbvp1, vs_1_1
+		*/
+		virtual GpuProgramPtr createProgramFromString(const String& name, 
+			const String& groupName, const String& code, 
+            GpuProgramType gptype, const String& syntaxCode);
+
+        /** General create method, using specific create parameters
+            instead of name / value pairs. 
+        */
+        virtual ResourcePtr create(const String& name, const String& group, 
+            GpuProgramType gptype, const String& syntaxCode, bool isManual = false, 
+            ManualResourceLoader* loader = 0);
+
+        /** Internal method for populating the supported syntax codes, called by RenderSystem. */
+        virtual void _pushSyntaxCode(const String& syntaxCode) { mSyntaxCodes.insert(syntaxCode); }
+        /** Overrides the standard ResourceManager getByName method.
+        @param name The name of the program to retrieve
+        @param preferHighLevelPrograms If set to true (the default), high level programs will be
+            returned in preference to low-level programs.
+        */
+        ResourcePtr getByName(const String& name, bool preferHighLevelPrograms = true);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static GpuProgramManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static GpuProgramManager* getSingletonPtr(void);
+    
+
+
+	};
+
+}
+
+#endif
Index: /OgreMain/include/OgreGpuProgramUsage.h
===================================================================
--- /OgreMain/include/OgreGpuProgramUsage.h	(revision 5)
+++ /OgreMain/include/OgreGpuProgramUsage.h	(revision 5)
@@ -0,0 +1,129 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __GpuProgramUsage_H__
+#define __GpuProgramUsage_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreGpuProgram.h"
+
+
+namespace Ogre 
+{
+    /** This class makes the usage of a vertex and fragment programs (low-level or high-level), 
+        with a given set of parameters, explicit.
+    @remarks
+        Using a vertex or fragment program can get fairly complex; besides the fairly rudimentary
+        process of binding a program to the GPU for rendering, managing usage has few
+        complications, such as:
+        <ul>
+        <li>Programs can be high level (e.g. Cg, RenderMonkey) or low level (assembler). Using
+        either should be relatively seamless, although high-level programs give you the advantage
+        of being able to use named parameters, instead of just indexed registers</li>
+        <li>Programs and parameters can be shared between multiple usages, in order to save
+        memory</li>
+        <li>When you define a user of a program, such as a material, you often want to be able to
+        set up the definition but not load / compile / assemble the program at that stage, because
+        it is not needed just yet. The program should be loaded when it is first needed, or
+        earlier if specifically requested. The program may not be defined at this time, you
+        may want to have scripts that can set up the definitions independent of the order in which
+        those scripts are loaded.</li>
+        </ul>
+        This class packages up those details so you don't have to worry about them. For example,
+        this class lets you define a high-level program and set up the parameters for it, without
+        having loaded the program (which you normally could not do). When the program is loaded and
+        compiled, this class will then validate the parameters you supplied earlier and turn them
+        into runtime parameters.
+    @par
+        Just incase it wasn't clear from the above, this class provides linkage to both 
+        GpuProgram and HighLevelGpuProgram, despite its name.
+    */
+    class _OgreExport GpuProgramUsage
+    {
+    protected:
+        GpuProgramType mType;
+        // The program link
+        GpuProgramPtr mProgram;
+
+        /// program parameters
+        GpuProgramParametersSharedPtr mParameters;
+
+
+    public:
+        /** Default constructor.
+        @param gptype The type of program to link to
+        */
+        GpuProgramUsage(GpuProgramType gptype);
+
+		/** Copy constructor */
+		GpuProgramUsage(const GpuProgramUsage& rhs);
+
+        /** Gets the type of program we're trying to link to. */
+        GpuProgramType getType(void) const { return mType; }
+
+		/** Sets the name of the program to use. 
+        @param name The name of the program to use
+        @param resetParams
+            If true, this will create a fresh set of parameters from the
+            new program being linked, so if you had previously set parameters
+            you will have to set them again. If you set this to false, you must
+            be absolutely sure that the parameters match perfectly, and in the
+            case of named parameters refers to the indexes underlying them, 
+            not just the names.
+        */
+		void setProgramName(const String& name, bool resetParams = true);
+		/** Sets the program to use.
+        @remarks
+            Note that this will create a fresh set of parameters from the
+            new program being linked, so if you had previously set parameters
+            you will have to set them again.
+        */
+        void setProgram(GpuProgramPtr& prog);
+		/** Gets the program being used. */
+        const GpuProgramPtr& getProgram() const { return mProgram; }
+		/** Gets the program being used. */
+        const String& getProgramName(void) const { return mProgram->getName(); }
+
+        /** Sets the program parameters that should be used; because parameters can be
+            shared between multiple usages for efficiency, this method is here for you
+            to register externally created parameter objects. Otherwise, the parameters
+            will be created for you when a program is linked.
+        */
+        void setParameters(GpuProgramParametersSharedPtr params);
+        /** Gets the parameters being used here. 
+        */
+        GpuProgramParametersSharedPtr getParameters(void);
+
+        /// Load this usage (and ensure program is loaded)
+        void _load(void);
+        /// Unload this usage 
+        void _unload(void);
+
+    };
+}
+#endif
Index: /OgreMain/include/OgreHardwareBuffer.h
===================================================================
--- /OgreMain/include/OgreHardwareBuffer.h	(revision 5)
+++ /OgreMain/include/OgreHardwareBuffer.h	(revision 5)
@@ -0,0 +1,330 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __HardwareBuffer__
+#define __HardwareBuffer__
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+    /** Abstract class defining common features of hardware buffers.
+    @remarks
+ 	    A 'hardware buffer' is any area of memory held outside of core system ram,
+	    and in our case refers mostly to video ram, although in theory this class
+	    could be used with other memory areas such as sound card memory, custom
+	    coprocessor memory etc.
+    @par
+ 	    This reflects the fact that memory held outside of main system RAM must 
+	    be interacted with in a more formal fashion in order to promote
+	    cooperative and optimal usage of the buffers between the various 
+	    processing units which manipulate them.
+    @par
+ 	    This abstract class defines the core interface which is common to all
+	    buffers, whether it be vertex buffers, index buffers, texture memory
+	    or framebuffer memory etc.
+	@par
+		Buffers have the ability to be 'shadowed' in system memory, this is because
+		the kinds of access allowed on hardware buffers is not always as flexible as
+		that allowed for areas of system memory - for example it is often either 
+		impossible, or extremely undesirable from a performance standpoint to read from
+		a hardware buffer; when writing to hardware buffers, you should also write every
+		byte and do it sequentially. In situations where this is too restrictive, 
+		it is possible to create a hardware, write-only buffer (the most efficient kind) 
+		and to back it with a system memory 'shadow' copy which can be read and updated arbitrarily.
+		Ogre handles synchronising this buffer with the real hardware buffer (which should still be
+		created with the HBU_DYNAMIC flag if you intend to update it very frequently). Whilst this
+		approach does have it's own costs, such as increased memory overhead, these costs can 
+		often be outweighed by the performance benefits of using a more hardware efficient buffer.
+		You should look for the 'useShadowBuffer' parameter on the creation methods used to create
+		the buffer of the type you require (see HardwareBufferManager) to enable this feature.
+    */
+    class _OgreExport HardwareBuffer 
+    {
+
+	    public:
+		    /// Enums describing buffer usage; not mutually exclusive
+		    enum Usage 
+		    {
+                /** Static buffer which the application rarely modifies once created. Modifying 
+                the contents of this buffer will involve a performance hit.
+                */
+                HBU_STATIC = 1,
+			    /** Indicates the application would like to modify this buffer with the CPU
+			    fairly often. 
+			    Buffers created with this flag will typically end up in AGP memory rather 
+			    than video memory.
+			    */
+			    HBU_DYNAMIC = 2,
+			    /** Indicates the application will never read the contents of the buffer back, 
+			    it will only ever write data. Locking a buffer with this flag will ALWAYS 
+			    return a pointer to new, blank memory rather than the memory associated 
+			    with the contents of the buffer; this avoids DMA stalls because you can 
+			    write to a new memory area while the previous one is being used. 
+			    */
+			    HBU_WRITE_ONLY = 4,
+                /** Indicates that the application will be refilling the contents
+                of the buffer regularly (not just updating, but generating the
+                contents from scratch), and therefore does not mind if the contents 
+                of the buffer are lost somehow and need to be recreated. This
+                allows and additional level of optimisation on the buffer.
+                This option only really makes sense when combined with 
+                HBU_DYNAMIC_WRITE_ONLY.
+                */
+                HBU_DISCARDABLE = 8,
+				/// Combination of HBU_STATIC and HBU_WRITE_ONLY
+				HBU_STATIC_WRITE_ONLY = 5, 
+				/** Combination of HBU_DYNAMIC and HBU_WRITE_ONLY. If you use 
+                this, strongly consider using HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE
+                instead if you update the entire contents of the buffer very 
+                regularly. 
+                */
+				HBU_DYNAMIC_WRITE_ONLY = 6,
+                /// Combination of HBU_DYNAMIC, HBU_WRITE_ONLY and HBU_DISCARDABLE
+                HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE = 14
+
+
+		    };
+		    /// Locking options
+		    enum LockOptions
+		    {
+                /** Normal mode, ie allows read/write and contents are preserved. */
+                HBL_NORMAL,
+			    /** Discards the <em>entire</em> buffer while locking; this allows optimisation to be 
+				performed because synchronisation issues are relaxed. Only allowed on buffers 
+			    created with the HBU_DYNAMIC flag. 
+			    */
+			    HBL_DISCARD,
+			    /** Lock the buffer for reading only. Not allowed in buffers which are created with HBU_WRITE_ONLY. 
+				Mandatory on statuc buffers, ie those created without the HBU_DYNAMIC flag. 
+				*/ 
+			    HBL_READ_ONLY,
+                /** As HBL_NORMAL, except the application guarantees not to overwrite any 
+                region of the buffer which has already been used in this frame, can allow
+                some optimisation on some APIs. */
+                HBL_NO_OVERWRITE
+    			
+		    };
+	    protected:
+		    size_t mSizeInBytes;
+		    Usage mUsage;
+		    bool mIsLocked;
+			size_t mLockStart;
+			size_t mLockSize;
+			bool mSystemMemory;
+            bool mUseShadowBuffer;
+            HardwareBuffer* mpShadowBuffer;
+            bool mShadowUpdated;
+            bool mSuppressHardwareUpdate;
+    		
+            /// Internal implementation of lock()
+		    virtual void* lockImpl(size_t offset, size_t length, LockOptions options) = 0;
+            /// Internal implementation of unlock()
+		    virtual void unlockImpl(void) = 0;
+
+    public:
+		    /// Constructor, to be called by HardwareBufferManager only
+            HardwareBuffer(Usage usage, bool systemMemory, bool useShadowBuffer) 
+				: mUsage(usage), mIsLocked(false), mSystemMemory(systemMemory), 
+                mUseShadowBuffer(useShadowBuffer), mpShadowBuffer(NULL), mShadowUpdated(false), 
+                mSuppressHardwareUpdate(false) 
+            {
+                // If use shadow buffer, upgrade to WRITE_ONLY on hardware side
+                if (useShadowBuffer && usage == HBU_DYNAMIC)
+                {
+                    mUsage = HBU_DYNAMIC_WRITE_ONLY;
+                }
+                else if (useShadowBuffer && usage == HBU_STATIC)
+                {
+                    mUsage = HBU_STATIC_WRITE_ONLY;
+                }
+            }
+            virtual ~HardwareBuffer() {}
+		    /** Lock the buffer for (potentially) reading / writing.
+		    @param offset The byte offset from the start of the buffer to lock
+		    @param length The size of the area to lock, in bytes
+		    @param options Locking options
+		    @returns Pointer to the locked memory
+		    */
+		    virtual void* lock(size_t offset, size_t length, LockOptions options)
+            {
+                assert(!isLocked() && "Cannot lock this buffer, it is already locked!");
+                void* ret;
+				if (mUseShadowBuffer)
+                {
+					if (options != HBL_READ_ONLY)
+					{
+						// we have to assume a read / write lock so we use the shadow buffer
+						// and tag for sync on unlock()
+                        mShadowUpdated = true;
+                    }
+
+                    ret = mpShadowBuffer->lock(offset, length, options);
+                }
+                else
+                {
+					// Lock the real buffer if there is no shadow buffer 
+                    ret = lockImpl(offset, length, options);
+                    mIsLocked = true;
+                }
+				mLockStart = offset;
+				mLockSize = length;
+                return ret;
+            }
+
+            /** Lock the entire buffer for (potentially) reading / writing.
+		    @param options Locking options
+		    @returns Pointer to the locked memory
+            */
+            void* lock(LockOptions options)
+            {
+                return this->lock(0, mSizeInBytes, options);
+            }
+		    /** Releases the lock on this buffer. 
+            @remarks 
+                Locking and unlocking a buffer can, in some rare circumstances such as 
+                switching video modes whilst the buffer is locked, corrupt the 
+                contents of a buffer. This is pretty rare, but if it occurs, 
+                this method will throw an exception, meaning you
+                must re-upload the data.
+            @par
+                Note that using the 'read' and 'write' forms of updating the buffer does not
+                suffer from this problem, so if you want to be 100% sure your
+                data will not be lost, use the 'read' and 'write' forms instead.
+            */
+		    virtual void unlock(void)
+            {
+                assert(isLocked() && "Cannot unlock this buffer, it is not locked!");
+
+				// If we used the shadow buffer this time...
+                if (mUseShadowBuffer && mpShadowBuffer->isLocked())
+                {
+                    mpShadowBuffer->unlock();
+                    // Potentially update the 'real' buffer from the shadow buffer
+                    _updateFromShadow();
+                }
+                else
+                {
+					// Otherwise, unlock the real one
+                    unlockImpl();
+                    mIsLocked = false;
+                }
+
+            }
+
+            /** Reads data from the buffer and places it in the memory pointed to by pDest.
+		    @param offset The byte offset from the start of the buffer to read
+		    @param length The size of the area to read, in bytes
+            @param pDest The area of memory in which to place the data, must be large enough to 
+                accommodate the data!
+            */
+            virtual void readData(size_t offset, size_t length, void* pDest) = 0;
+            /** Writes data to the buffer from an area of system memory; note that you must
+                ensure that your buffer is big enough.
+		    @param offset The byte offset from the start of the buffer to start writing
+		    @param length The size of the data to write to, in bytes
+            @param pSource The source of the data to be written
+			@param discardWholeBuffer If true, this allows the driver to discard the entire buffer when writing,
+				such that DMA stalls can be avoided; use if you can.
+            */
+            virtual void writeData(size_t offset, size_t length, const void* pSource,
+					bool discardWholeBuffer = false) = 0;
+
+			/** Copy data from another buffer into this one.
+			@remarks
+				Note that the source buffer must not be created with the
+                usage HBU_WRITE_ONLY otherwise this will fail. 
+			@param srcBuffer The buffer from which to read the copied data
+			@param srcOffset Offset in the source buffer at which to start reading
+			@param dstOffset Offset in the destination buffer to start writing
+			@param length Length of the data to copy, in bytes.
+			@param discardWholeBuffer If true, will discard the entire contents of this buffer before copying
+			*/
+			virtual void copyData(HardwareBuffer& srcBuffer, size_t srcOffset, 
+				size_t dstOffset, size_t length, bool discardWholeBuffer = false)
+			{
+				const void *srcData = srcBuffer.lock(
+					srcOffset, length, HBL_READ_ONLY);
+				this->writeData(dstOffset, length, srcData, discardWholeBuffer);
+				srcBuffer.unlock();
+			}
+
+            /// Updates the real buffer from the shadow buffer, if required
+            virtual void _updateFromShadow(void)
+            {
+                if (mUseShadowBuffer && mShadowUpdated && !mSuppressHardwareUpdate)
+                {
+                    // Do this manually to avoid locking problems
+                    const void *srcData = mpShadowBuffer->lockImpl(
+    					mLockStart, mLockSize, HBL_READ_ONLY);
+					// Lock with discard if the whole buffer was locked, otherwise normal
+					LockOptions lockOpt;
+					if (mLockStart == 0 && mLockSize == mSizeInBytes)
+						lockOpt = HBL_DISCARD;
+					else
+						lockOpt = HBL_NORMAL;
+					
+                    void *destData = this->lockImpl(
+    					mLockStart, mLockSize, lockOpt);
+					// Copy shadow to real
+                    memcpy(destData, srcData, mLockSize);
+                    this->unlockImpl();
+                    mpShadowBuffer->unlockImpl();
+                    mShadowUpdated = false;
+                }
+            }
+
+            /// Returns the size of this buffer in bytes
+            size_t getSizeInBytes(void) const { return mSizeInBytes; }
+            /// Returns the Usage flags with which this buffer was created
+            Usage getUsage(void) const { return mUsage; }
+			/// Returns whether this buffer is held in system memory
+			bool isSystemMemory(void) const { return mSystemMemory; }
+			/// Returns whether this buffer has a system memory shadow for quicker reading
+			bool hasShadowBuffer(void) const { return mUseShadowBuffer; }
+            /// Returns whether or not this buffer is currently locked.
+            bool isLocked(void) const { 
+                return mIsLocked || (mUseShadowBuffer && mpShadowBuffer->isLocked()); 
+            }
+            /// Pass true to suppress hardware upload of shadow buffer changes
+            void suppressHardwareUpdate(bool suppress) {
+                mSuppressHardwareUpdate = suppress;
+                if (!suppress)
+                    _updateFromShadow();
+            }
+
+
+
+
+    		
+    };
+}
+#endif
+
+
Index: /OgreMain/include/OgreHardwareBufferManager.h
===================================================================
--- /OgreMain/include/OgreHardwareBufferManager.h	(revision 5)
+++ /OgreMain/include/OgreHardwareBufferManager.h	(revision 5)
@@ -0,0 +1,399 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __HardwareBufferManager__
+#define __HardwareBufferManager__
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+
+#include "OgreSingleton.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreHardwareIndexBuffer.h"
+
+
+namespace Ogre {
+
+    /** Abtract interface representing a 'licensee' of a hardware buffer copy.
+    remarks
+        Often it's useful to have temporary buffers which are used for working
+        but are not necessarily needed permanently. However, creating and 
+        destroying buffers is expensive, so we need a way to share these 
+        working areas, especially those based on existing fixed buffers. 
+        This class represents a licensee of one of those temporary buffers, 
+        and must be implemented by any user of a temporary buffer if they 
+        wish to be notified when the license is expired. 
+    */
+    class _OgreExport HardwareBufferLicensee
+    {
+    public:
+        virtual ~HardwareBufferLicensee() { }
+        /** This method is called when the buffer license is expired and is about
+        to be returned to the shared pool. */
+        virtual void licenseExpired(HardwareBuffer* buffer) = 0;
+    };
+
+    /** Structure for recording the use of temporary blend buffers */
+    class _OgreExport TempBlendedBufferInfo : public HardwareBufferLicensee
+    {
+    private:
+        // Pre-blended 
+        HardwareVertexBufferSharedPtr srcPositionBuffer;
+        HardwareVertexBufferSharedPtr srcNormalBuffer;
+        // Post-blended 
+        HardwareVertexBufferSharedPtr destPositionBuffer;
+        HardwareVertexBufferSharedPtr destNormalBuffer;
+        /// Both positions and normals are contained in the same buffer
+        bool posNormalShareBuffer;
+        unsigned short posBindIndex;
+        unsigned short normBindIndex;
+        bool bindPositions;
+        bool bindNormals;
+
+    public:
+        ~TempBlendedBufferInfo(void);
+        /// Utility method, extract info from the given VertexData
+        void extractFrom(const VertexData* sourceData);
+        /// Utility method, checks out temporary copies of src into dest
+        void checkoutTempCopies(bool positions = true, bool normals = true);
+        /// Utility method, binds dest copies into a given VertexData struct
+        void bindTempCopies(VertexData* targetData, bool suppressHardwareUpload);
+        /** Overridden member from HardwareBufferLicensee. */
+        void licenseExpired(HardwareBuffer* buffer);
+		/** Detect currently have buffer copies checked out and touch it */
+		bool buffersCheckedOut(bool positions = true, bool normals = true) const;
+    };
+
+
+    /** Abstract singleton class for managing hardware buffers, a concrete instance
+    of this will be created by the RenderSystem. */
+    class _OgreExport HardwareBufferManager : public Singleton<HardwareBufferManager>
+    {
+        friend class HardwareVertexBufferSharedPtr;
+        friend class HardwareIndexBufferSharedPtr;
+    protected:
+        /** WARNING: The following two members should place before all other members.
+            Members destruct order is very important here, because destructing other
+            members will cause notify back to this class, and then will access to this
+            two members.
+        */
+        typedef std::set<HardwareVertexBuffer*> VertexBufferList;
+        typedef std::set<HardwareIndexBuffer*> IndexBufferList;
+        VertexBufferList mVertexBuffers;
+        IndexBufferList mIndexBuffers;
+
+
+        typedef std::set<VertexDeclaration*> VertexDeclarationList;
+		typedef std::set<VertexBufferBinding*> VertexBufferBindingList;
+        VertexDeclarationList mVertexDeclarations;
+		VertexBufferBindingList mVertexBufferBindings;
+
+		// Mutexes
+		OGRE_MUTEX(mVertexBuffersMutex)
+		OGRE_MUTEX(mIndexBuffersMutex)
+		OGRE_MUTEX(mVertexDeclarationsMutex)
+		OGRE_MUTEX(mVertexBufferBindingsMutex)
+
+        /// Internal method for destroys all vertex declarations
+        virtual void destroyAllDeclarations(void);
+        /// Internal method for destroys all vertex buffer bindings
+        virtual void destroyAllBindings(void);
+
+        /// Internal method for creates a new vertex declaration, may be overridden by certain rendering APIs
+        virtual VertexDeclaration* createVertexDeclarationImpl(void);
+        /// Internal method for destroys a vertex declaration, may be overridden by certain rendering APIs
+        virtual void destroyVertexDeclarationImpl(VertexDeclaration* decl);
+
+		/// Internal method for creates a new VertexBufferBinding, may be overridden by certain rendering APIs
+		virtual VertexBufferBinding* createVertexBufferBindingImpl(void);
+		/// Internal method for destroys a VertexBufferBinding, may be overridden by certain rendering APIs
+		virtual void destroyVertexBufferBindingImpl(VertexBufferBinding* binding);
+
+    public:
+
+        enum BufferLicenseType
+        {
+            /// Licensee will only release buffer when it says so
+            BLT_MANUAL_RELEASE,
+            /// Licensee can have license revoked
+            BLT_AUTOMATIC_RELEASE
+        };
+
+    protected:
+        /** Struct holding details of a license to use a temporary shared buffer. */
+        class _OgrePrivate VertexBufferLicense
+        {
+        public:
+            HardwareVertexBuffer* originalBufferPtr;
+            BufferLicenseType licenseType;
+            size_t expiredDelay;
+            HardwareVertexBufferSharedPtr buffer;
+            HardwareBufferLicensee* licensee;
+            VertexBufferLicense(
+                HardwareVertexBuffer* orig,
+                BufferLicenseType ltype, 
+                size_t delay,
+                HardwareVertexBufferSharedPtr buf, 
+                HardwareBufferLicensee* lic) 
+                : originalBufferPtr(orig)
+                , licenseType(ltype)
+                , expiredDelay(delay)
+                , buffer(buf)
+                , licensee(lic)
+            {}
+
+        };
+
+        /// Map from original buffer to temporary buffers
+        typedef std::multimap<HardwareVertexBuffer*, HardwareVertexBufferSharedPtr> FreeTemporaryVertexBufferMap;
+        /// Map of current available temp buffers 
+        FreeTemporaryVertexBufferMap mFreeTempVertexBufferMap;
+        /// Map from temporary buffer to details of a license
+        typedef std::map<HardwareVertexBuffer*, VertexBufferLicense> TemporaryVertexBufferLicenseMap;
+        /// Map of currently licensed temporary buffers
+        TemporaryVertexBufferLicenseMap mTempVertexBufferLicenses;
+        /// Number of frames elapsed since temporary buffers utilization was above half the available
+        size_t mUnderUsedFrameCount;
+        /// Number of frames to wait before free unused temporary buffers
+        static const size_t UNDER_USED_FRAME_THRESHOLD;
+        /// Frame delay for BLT_AUTOMATIC_RELEASE temporary buffers
+        static const size_t EXPIRED_DELAY_FRAME_THRESHOLD;
+		// Mutexes
+		OGRE_MUTEX(mTempBuffersMutex)
+
+
+        /// Creates  a new buffer as a copy of the source, does not copy data
+        HardwareVertexBufferSharedPtr makeBufferCopy(
+            const HardwareVertexBufferSharedPtr& source, 
+            HardwareBuffer::Usage usage, bool useShadowBuffer);
+
+    public:
+        HardwareBufferManager();
+        virtual ~HardwareBufferManager();
+		/** Create a hardware vertex buffer.
+        @remarks
+            This method creates a new vertex buffer; this will act as a source of geometry
+            data for rendering objects. Note that because the meaning of the contents of
+            the vertex buffer depends on the usage, this method does not specify a
+            vertex format; the user of this buffer can actually insert whatever data 
+            they wish, in any format. However, in order to use this with a RenderOperation,
+            the data in this vertex buffer will have to be associated with a semantic element
+            of the rendering pipeline, e.g. a position, or texture coordinates. This is done 
+            using the VertexDeclaration class, which itself contains VertexElement structures
+            referring to the source data.
+        @remarks Note that because vertex buffers can be shared, they are reference
+            counted so you do not need to worry about destroying themm this will be done
+            automatically.
+        @param vertexSize The size in bytes of each vertex in this buffer; you must calculate
+            this based on the kind of data you expect to populate this buffer with.
+        @param numVerts The number of vertices in this buffer.
+        @param usage One or more members of the HardwareBuffer::Usage enumeration; you are
+            strongly advised to use HBU_STATIC_WRITE_ONLY wherever possible, if you need to 
+            update regularly, consider HBU_DYNAMIC_WRITE_ONLY and useShadowBuffer=true.
+		@param useShadowBuffer If set to true, this buffer will be 'shadowed' by one stored in 
+            system memory rather than GPU or AGP memory. You should set this flag if you intend 
+            to read data back from the vertex buffer, because reading data from a buffer
+			in the GPU or AGP memory is very expensive, and is in fact impossible if you
+            specify HBU_WRITE_ONLY for the main buffer. If you use this option, all 
+            reads and writes will be done to the shadow buffer, and the shadow buffer will
+            be synchronised with the real buffer at an appropriate time.
+        */
+		virtual HardwareVertexBufferSharedPtr 
+            createVertexBuffer(size_t vertexSize, size_t numVerts, HardwareBuffer::Usage usage, 
+			bool useShadowBuffer = false) = 0;
+		/** Create a hardware index buffer.
+        @remarks Note that because buffers can be shared, they are reference
+            counted so you do not need to worry about destroying themm this will be done
+            automatically.
+		@param itype The type in index, either 16- or 32-bit, depending on how many vertices
+			you need to be able to address
+		@param numIndexes The number of indexes in the buffer
+        @param usage One or more members of the HardwareBuffer::Usage enumeration.
+		@param useShadowBuffer If set to true, this buffer will be 'shadowed' by one stored in 
+            system memory rather than GPU or AGP memory. You should set this flag if you intend 
+            to read data back from the index buffer, because reading data from a buffer
+			in the GPU or AGP memory is very expensive, and is in fact impossible if you
+            specify HBU_WRITE_ONLY for the main buffer. If you use this option, all 
+            reads and writes will be done to the shadow buffer, and the shadow buffer will
+            be synchronised with the real buffer at an appropriate time.
+        */
+		virtual HardwareIndexBufferSharedPtr 
+            createIndexBuffer(HardwareIndexBuffer::IndexType itype, size_t numIndexes, 
+			HardwareBuffer::Usage usage, bool useShadowBuffer = false) = 0;
+
+        /** Creates a new vertex declaration. */
+        virtual VertexDeclaration* createVertexDeclaration(void);
+        /** Destroys a vertex declaration. */
+        virtual void destroyVertexDeclaration(VertexDeclaration* decl);
+
+		/** Creates a new VertexBufferBinding. */
+		virtual VertexBufferBinding* createVertexBufferBinding(void);
+		/** Destroys a VertexBufferBinding. */
+		virtual void destroyVertexBufferBinding(VertexBufferBinding* binding);
+
+		/** Registers a vertex buffer as a copy of another.
+		@remarks
+			This is useful for registering an existing buffer as a temporary buffer
+			which can be allocated just like a copy.
+		*/
+		virtual void registerVertexBufferSourceAndCopy(
+			const HardwareVertexBufferSharedPtr& sourceBuffer,
+			const HardwareVertexBufferSharedPtr& copy);
+
+        /** Allocates a copy of a given vertex buffer.
+        @remarks
+            This method allocates a temporary copy of an existing vertex buffer.
+            This buffer is subsequently stored and can be made available for 
+            other purposes later without incurring the cost of construction / 
+            destruction.
+        @param sourceBuffer The source buffer to use as a copy
+        @param licenseType The type of license required on this buffer - automatic
+            release causes this class to release licenses every frame so that 
+            they can be reallocated anew.
+        @param licensee Pointer back to the class requesting the copy, which must
+            implement HardwareBufferLicense in order to be notified when the license
+            expires.
+        @param copyData If true, the current data is copied as well as the 
+            structure of the buffer
+        */
+        virtual HardwareVertexBufferSharedPtr allocateVertexBufferCopy(
+            const HardwareVertexBufferSharedPtr& sourceBuffer, 
+            BufferLicenseType licenseType,
+            HardwareBufferLicensee* licensee,
+            bool copyData = false);
+
+        /** Manually release a vertex buffer copy for others to subsequently use.
+        @remarks
+            Only required if the original call to allocateVertexBufferCopy
+            included a licenseType of BLT_MANUAL_RELEASE. 
+        @param bufferCopy The buffer copy. The caller is expected to delete
+            or at least no longer use this reference, since another user may
+            well begin to modify the contents of the buffer.
+        */
+        virtual void releaseVertexBufferCopy(
+            const HardwareVertexBufferSharedPtr& bufferCopy); 
+
+        /** Tell engine that the vertex buffer copy intent to reuse.
+        @remarks
+            Ogre internal keep an expired delay counter of BLT_AUTOMATIC_RELEASE
+            buffers, when the counter count down to zero, it'll release for other
+            purposes later. But you can use this function to reset the counter to
+            the internal configured value, keep the buffer not get released for
+            some frames.
+        @param bufferCopy The buffer copy. The caller is expected to keep this
+            buffer copy for use.
+        */
+        virtual void touchVertexBufferCopy(
+            const HardwareVertexBufferSharedPtr& bufferCopy);
+
+        /** Free all unused vertex buffer copies.
+        @remarks
+            This method free all temporary vertex buffers that not in used.
+            In normally, temporary vertex buffers are subsequently stored and can
+            be made available for other purposes later without incurring the cost
+            of construction / destruction. But in some cases you want to free them
+            to save hardware memory (e.g. application was runs in a long time, you
+            might free temporary buffers periodically to avoid memory overload).
+        */
+        virtual void _freeUnusedBufferCopies(void);
+
+        /** Internal method for releasing all temporary buffers which have been 
+           allocated using BLT_AUTOMATIC_RELEASE; is called by OGRE.
+        @param forceFreeUnused If true, free all unused temporary buffers.
+            If false, auto detect and free all unused temporary buffers based on
+            temporary buffers utilization.
+        */
+        virtual void _releaseBufferCopies(bool forceFreeUnused = false);
+
+        /** Internal method that forces the release of copies of a given buffer.
+        @remarks
+            This usually means that the buffer which the copies are based on has
+            been changed in some fundamental way, and the owner of the original 
+            wishes to make that known so that new copies will reflect the
+            changes.
+        @param sourceBuffer the source buffer as a shared pointer.  Any buffer copies created from the source buffer
+            are deleted.
+        */
+        virtual void _forceReleaseBufferCopies(
+            const HardwareVertexBufferSharedPtr& sourceBuffer);
+
+        /** Internal method that forces the release of copies of a given buffer.
+        @remarks
+            This usually means that the buffer which the copies are based on has
+            been changed in some fundamental way, and the owner of the original 
+            wishes to make that known so that new copies will reflect the
+            changes.
+        @param sourceBuffer the source buffer as a pointer.  Any buffer copies created from the source buffer
+            are deleted.
+        */
+        virtual void _forceReleaseBufferCopies(HardwareVertexBuffer* sourceBuffer);
+
+		/// Notification that a hardware vertex buffer has been destroyed
+		void _notifyVertexBufferDestroyed(HardwareVertexBuffer* buf);
+		/// Notification that a hardware index buffer has been destroyed
+		void _notifyIndexBufferDestroyed(HardwareIndexBuffer* buf);
+
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static HardwareBufferManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static HardwareBufferManager* getSingletonPtr(void);
+            
+    };
+
+}
+
+#endif
+
Index: /OgreMain/include/OgreHardwareIndexBuffer.h
===================================================================
--- /OgreMain/include/OgreHardwareIndexBuffer.h	(revision 5)
+++ /OgreMain/include/OgreHardwareIndexBuffer.h	(revision 5)
@@ -0,0 +1,78 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __HardwareIndexBuffer__
+#define __HardwareIndexBuffer__
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+#include "OgreHardwareBuffer.h"
+#include "OgreSharedPtr.h"
+
+namespace Ogre {
+
+    /** Specialisation of HardwareBuffer for vertex index buffers, still abstract. */
+    class _OgreExport HardwareIndexBuffer : public HardwareBuffer
+    {
+	    public:
+		    enum IndexType {
+			    IT_16BIT,
+			    IT_32BIT
+		    };
+
+	    protected:
+		    IndexType mIndexType;
+		    size_t mNumIndexes;
+            size_t mIndexSize;
+
+	    public:
+		    /// Should be called by HardwareBufferManager
+		    HardwareIndexBuffer(IndexType idxType, size_t numIndexes, HardwareBuffer::Usage usage,
+                bool useSystemMemory, bool useShadowBuffer);
+            ~HardwareIndexBuffer();
+    		/// Get the type of indexes used in this buffer
+            IndexType getType(void) const { return mIndexType; }
+            /// Get the number of indexes in this buffer
+            size_t getNumIndexes(void) const { return mNumIndexes; }
+            /// Get the size in bytes of each index
+            size_t getIndexSize(void) const { return mIndexSize; }
+
+		    // NB subclasses should override lock, unlock, readData, writeData
+    };
+
+
+    /** Shared pointer implementation used to share index buffers. */
+    class _OgreExport HardwareIndexBufferSharedPtr : public SharedPtr<HardwareIndexBuffer>
+    {
+    public:
+        HardwareIndexBufferSharedPtr() : SharedPtr<HardwareIndexBuffer>() {}
+        explicit HardwareIndexBufferSharedPtr(HardwareIndexBuffer* buf);
+    };
+}
+#endif
+
Index: /OgreMain/include/OgreHardwareOcclusionQuery.h
===================================================================
--- /OgreMain/include/OgreHardwareOcclusionQuery.h	(revision 5)
+++ /OgreMain/include/OgreHardwareOcclusionQuery.h	(revision 5)
@@ -0,0 +1,125 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _HardwareOcclusionQuery__
+#define _HardwareOcclusionQuery__
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+
+
+/**
+  * This is a abstract class that that provides the interface for the query class for 
+  * hardware occlusion.
+  *
+  * @author Lee Sandberg
+  * Updated on 13/8/2005 by Tuan Kuranes email: tuan.kuranes@free.fr
+  */
+class _OgreExport HardwareOcclusionQuery
+{
+//----------------------------------------------------------------------
+// Public methods
+//--
+public:
+	/**
+	  * Object public member functions
+	  */
+
+	/**
+	  * Default object constructor
+	  * 
+	  */
+	HardwareOcclusionQuery();
+
+	/**
+	  * Object destructor
+	  */
+	virtual ~HardwareOcclusionQuery();
+
+	/**
+	  * Starts the hardware occlusion query
+	  * @Remarks	Simple usage: Create one or more OcclusionQuery object one per outstanding query or one per tested object 
+	  *				OcclusionQuery* m_pOcclusionQuery;
+	  *				createOcclusionQuery( &m_pOcclusionQuery );
+	  *				In the rendering loop:
+	  *				Draw all occluders
+	  *				m_pOcclusionQuery->startOcclusionQuery();
+	  *				Draw the polygons to be tested
+	  *				m_pOcclusionQuery->endOcclusionQuery();
+	  *
+	  *				Results must be pulled using:
+	  *				UINT	m_uintNumberOfPixelsVisable;
+	  *				pullOcclusionQuery( &m_dwNumberOfPixelsVisable );
+	  *			
+	  */
+	virtual void beginOcclusionQuery() = 0;
+
+	/**
+	  * Ends the hardware occlusion test
+	  */
+	virtual void endOcclusionQuery() = 0;
+
+	/**
+      * Pulls the hardware occlusion query.
+	  * @note Waits until the query result is available; use isStillOutstanding
+	  *		if just want to test if the result is available.
+      * @retval NumOfFragments will get the resulting number of fragments.
+      * @return True if success or false if not.
+      */
+	virtual bool pullOcclusionQuery(unsigned int* NumOfFragments) = 0;
+
+	/**
+	  * Let's you get the last pixel count with out doing the hardware occlusion test
+	  * @return The last fragment count from the last test.
+	  * Remarks This function won't give you new values, just the old value.
+	  */
+	unsigned int getLastQuerysPixelcount() const { return mPixelCount; }
+
+	/**
+	  * Lets you know when query is done, or still be processed by the Hardware
+	  * @return true if query isn't finished.
+	  */
+	 virtual bool isStillOutstanding(void) = 0; 
+
+
+    //----------------------------------------------------------------------
+    // protected members
+    //--
+    protected :
+        // numbers of visible pixels determined by last query
+        unsigned int mPixelCount;
+        // is query hasn't yet returned a result.
+		bool		 mIsQueryResultStillOutstanding;
+};
+
+}
+#endif
+
Index: /OgreMain/include/OgreHardwarePixelBuffer.h
===================================================================
--- /OgreMain/include/OgreHardwarePixelBuffer.h	(revision 5)
+++ /OgreMain/include/OgreHardwarePixelBuffer.h	(revision 5)
@@ -0,0 +1,198 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __HardwarePixelBuffer__
+#define __HardwarePixelBuffer__
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+#include "OgreHardwareBuffer.h"
+#include "OgreSharedPtr.h"
+#include "OgrePixelFormat.h"
+#include "OgreImage.h"
+
+namespace Ogre {
+
+    /** Specialisation of HardwareBuffer for a pixel buffer. The
+    	HardwarePixelbuffer abstracts an 1D, 2D or 3D quantity of pixels
+    	stored by the rendering API. The buffer can be located on the card
+    	or in main memory depending on its usage. One mipmap level of a
+    	texture is an example of a HardwarePixelBuffer.
+    */
+    class _OgreExport HardwarePixelBuffer : public HardwareBuffer
+    {
+    protected: 
+        // Extents
+        size_t mWidth, mHeight, mDepth;
+        // Pitches (offsets between rows and slices)
+        size_t mRowPitch, mSlicePitch;
+        // Internal format
+        PixelFormat mFormat;
+        // Currently locked region
+        PixelBox mCurrentLock;
+        
+        /// Internal implementation of lock(), must be overridden in subclasses
+        virtual PixelBox lockImpl(const Image::Box lockBox,  LockOptions options) = 0;
+
+        /// Internal implementation of lock(), do not OVERRIDE or CALL this
+        /// for HardwarePixelBuffer implementations, but override the previous method
+        virtual void* lockImpl(size_t offset, size_t length, LockOptions options);
+
+        /// Internal implementation of unlock(), must be overridden in subclasses
+        // virtual void unlockImpl(void) = 0;
+
+		/** Notify TextureBuffer of destruction of render target.
+			Called by RenderTexture when destroyed.
+		*/
+		virtual void _clearSliceRTT(size_t zoffset);
+		friend class RenderTexture;
+    public:
+        /// Should be called by HardwareBufferManager
+        HardwarePixelBuffer(size_t mWidth, size_t mHeight, size_t mDepth,
+                PixelFormat mFormat,
+                HardwareBuffer::Usage usage, bool useSystemMemory, bool useShadowBuffer);
+        ~HardwarePixelBuffer();
+
+        /** make every lock method from HardwareBuffer available.
+        See http://www.research.att.com/~bs/bs_faq2.html#overloadderived
+        */
+        using HardwareBuffer::lock;	
+
+        /** Lock the buffer for (potentially) reading / writing.
+		    @param lockBox Region of the buffer to lock
+		    @param options Locking options
+		    @returns PixelBox containing the locked region, the pitches and
+		    	the pixel format
+		*/
+		virtual const PixelBox& lock(const Image::Box& lockBox, LockOptions options);
+		/// @copydoc HardwareBuffer::lock
+        virtual void* lock(size_t offset, size_t length, LockOptions options);
+
+		/** Get the current locked region. This is the same value as returned
+		    by lock(const Image::Box, LockOptions)
+		    @returns PixelBox containing the locked region
+		*/        
+        const PixelBox& getCurrentLock();
+		
+		/// @copydoc HardwareBuffer::readData
+		virtual void readData(size_t offset, size_t length, void* pDest);
+		/// @copydoc HardwareBuffer::writeData
+		virtual void writeData(size_t offset, size_t length, const void* pSource,
+				bool discardWholeBuffer = false);
+        
+        /** Copies a box from another PixelBuffer to a region of the 
+        	this PixelBuffer. 
+			@param dst		Source pixel buffer
+        	@param srcBox	Image::Box describing the source region in src
+        	@param dstBox	Image::Box describing the destination region in this buffer
+			@remarks The source and destination regions dimensions don't have to match, in which
+		   	case scaling is done. This scaling is generally done using a bilinear filter in hardware,
+            but it is faster to pass the source image in the right dimensions.
+			@note Only call this function when both  buffers are unlocked. 
+         */        
+        virtual void blit(const HardwarePixelBufferSharedPtr &src, const Image::Box &srcBox, const Image::Box &dstBox);
+
+		/** Convience function that blits the entire source pixel buffer to this buffer. 
+			If source and destination dimensions don't match, scaling is done.
+			@param src		PixelBox containing the source pixels and format in memory
+			@note Only call this function when the buffer is unlocked. 
+		*/
+		void blit(const HardwarePixelBufferSharedPtr &src); 
+		
+		/** Copies a region from normal memory to a region of this pixelbuffer. The source
+			image can be in any pixel format supported by OGRE, and in any size. 
+		   	@param src		PixelBox containing the source pixels and format in memory
+		   	@param dstBox	Image::Box describing the destination region in this buffer
+            @remarks The source and destination regions dimensions don't have to match, in which
+            case scaling is done. This scaling is generally done using a bilinear filter in hardware,
+            but it is faster to pass the source image in the right dimensions.
+			@note Only call this function when the buffer is unlocked. 
+		*/
+		virtual void blitFromMemory(const PixelBox &src, const Image::Box &dstBox) = 0;
+		
+		/** Convience function that blits a pixelbox from memory to the entire 
+			buffer. The source image is scaled as needed.
+			@param src		PixelBox containing the source pixels and format in memory
+			@note Only call this function when the buffer is unlocked. 
+		*/
+		void blitFromMemory(const PixelBox &src)
+		{
+			blitFromMemory(src, Box(0,0,0,mWidth,mHeight,mDepth));
+		}
+		
+		/** Copies a region of this pixelbuffer to normal memory.
+		   	@param srcBox	Image::Box describing the source region of this buffer
+		   	@param dst		PixelBox describing the destination pixels and format in memory
+		   	@remarks The source and destination regions don't have to match, in which
+		   	case scaling is done.
+			@note Only call this function when the buffer is unlocked. 
+		 */
+		virtual void blitToMemory(const Image::Box &srcBox, const PixelBox &dst) = 0;
+
+		/** Convience function that blits this entire buffer to a pixelbox.
+			The image is scaled as needed.
+			@param src		PixelBox containing the source pixels and format in memory
+			@note Only call this function when the buffer is unlocked. 
+		*/
+		void blitToMemory(const PixelBox &dst)
+		{
+			blitToMemory(Box(0,0,0,mWidth,mHeight,mDepth), dst);
+		}
+        
+        /** Get a render target for this PixelBuffer, or a slice of it. The texture this
+            was acquired from must have TU_RENDERTARGET set, otherwise it is possible to
+            render to it and this method will throw an ERR_RENDERSYSTEM exception.
+            @param slice    Which slice
+            @returns A pointer to the render target. This pointer has the lifespan of this
+            PixelBuffer.
+        */
+        virtual RenderTexture *getRenderTarget(size_t slice=0);
+        
+        /// Gets the width of this buffer
+        size_t getWidth() const { return mWidth; }
+        /// Gets the height of this buffer
+        size_t getHeight() const { return mHeight; }
+        /// Gets the depth of this buffer
+        size_t getDepth() const { return mDepth; }
+        /// Gets the native pixel format of this buffer
+        PixelFormat getFormat() const { return mFormat; }
+    };
+
+    /** Shared pointer implementation used to share pixel buffers. */
+    class _OgreExport HardwarePixelBufferSharedPtr : public SharedPtr<HardwarePixelBuffer>
+    {
+    public:
+        HardwarePixelBufferSharedPtr() : SharedPtr<HardwarePixelBuffer>() {}
+        explicit HardwarePixelBufferSharedPtr(HardwarePixelBuffer* buf);
+
+
+    };
+
+}
+#endif
+
Index: /OgreMain/include/OgreHardwareVertexBuffer.h
===================================================================
--- /OgreMain/include/OgreHardwareVertexBuffer.h	(revision 5)
+++ /OgreMain/include/OgreHardwareVertexBuffer.h	(revision 5)
@@ -0,0 +1,541 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __HardwareVertexBuffer__
+#define __HardwareVertexBuffer__
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+#include "OgreHardwareBuffer.h"
+#include "OgreSharedPtr.h"
+#include "OgreColourValue.h"
+
+namespace Ogre {
+    /** Specialisation of HardwareBuffer for a vertex buffer. */
+    class _OgreExport HardwareVertexBuffer : public HardwareBuffer
+    {
+	    protected:
+
+		    size_t mNumVertices;
+            size_t mVertexSize;
+
+	    public:
+		    /// Should be called by HardwareBufferManager
+		    HardwareVertexBuffer(size_t vertexSize, size_t numVertices,
+                HardwareBuffer::Usage usage, bool useSystemMemory, bool useShadowBuffer);
+            ~HardwareVertexBuffer();
+            /// Gets the size in bytes of a single vertex in this buffer
+            size_t getVertexSize(void) const { return mVertexSize; }
+            /// Get the number of vertices in this buffer
+            size_t getNumVertices(void) const { return mNumVertices; }
+
+
+
+		    // NB subclasses should override lock, unlock, readData, writeData
+
+    };
+
+    /** Shared pointer implementation used to share index buffers. */
+    class _OgreExport HardwareVertexBufferSharedPtr : public SharedPtr<HardwareVertexBuffer>
+    {
+    public:
+        HardwareVertexBufferSharedPtr() : SharedPtr<HardwareVertexBuffer>() {}
+        explicit HardwareVertexBufferSharedPtr(HardwareVertexBuffer* buf);
+
+
+    };
+
+    /// Vertex element semantics, used to identify the meaning of vertex buffer contents
+	enum VertexElementSemantic {
+		/// Position, 3 reals per vertex
+		VES_POSITION = 1,
+		/// Blending weights
+		VES_BLEND_WEIGHTS = 2,
+        /// Blending indices
+        VES_BLEND_INDICES = 3,
+		/// Normal, 3 reals per vertex
+		VES_NORMAL = 4,
+		/// Diffuse colours
+		VES_DIFFUSE = 5,
+		/// Specular colours
+		VES_SPECULAR = 6,
+		/// Texture coordinates
+		VES_TEXTURE_COORDINATES = 7,
+        /// Binormal (Y axis if normal is Z)
+        VES_BINORMAL = 8,
+        /// Tangent (X axis if normal is Z)
+        VES_TANGENT = 9
+
+	};
+
+    /// Vertex element type, used to identify the base types of the vertex contents
+    enum VertexElementType
+    {
+        VET_FLOAT1 = 0,
+        VET_FLOAT2 = 1,
+        VET_FLOAT3 = 2,
+        VET_FLOAT4 = 3,
+        /// alias to more specific colour type - use the current rendersystem's colour packing
+		VET_COLOUR = 4,
+		VET_SHORT1 = 5,
+		VET_SHORT2 = 6,
+		VET_SHORT3 = 7,
+		VET_SHORT4 = 8,
+        VET_UBYTE4 = 9,
+        /// D3D style compact colour
+        VET_COLOUR_ARGB = 10,
+        /// GL style compact colour
+        VET_COLOUR_ABGR = 11
+    };
+
+    /** This class declares the usage of a single vertex buffer as a component
+        of a complete VertexDeclaration.
+        @remarks
+        Several vertex buffers can be used to supply the input geometry for a
+        rendering operation, and in each case a vertex buffer can be used in
+        different ways for different operations; the buffer itself does not
+        define the semantics (position, normal etc), the VertexElement
+        class does.
+    */
+    class _OgreExport VertexElement
+    {
+    protected:
+        /// The source vertex buffer, as bound to an index using VertexBufferBinding
+        unsigned short mSource;
+        /// The offset in the buffer that this element starts at
+        size_t mOffset;
+        /// The type of element
+        VertexElementType mType;
+        /// The meaning of the element
+        VertexElementSemantic mSemantic;
+        /// Index of the item, only applicable for some elements like texture coords
+        unsigned short mIndex;
+    public:
+        /// Constructor, should not be called directly, call VertexDeclaration::addElement
+        VertexElement(unsigned short source, size_t offset, VertexElementType theType,
+            VertexElementSemantic semantic, unsigned short index = 0);
+        /// Gets the vertex buffer index from where this element draws it's values
+        unsigned short getSource(void) const { return mSource; }
+        /// Gets the offset into the buffer where this element starts
+        size_t getOffset(void) const { return mOffset; }
+        /// Gets the data format of this element
+        VertexElementType getType(void) const { return mType; }
+        /// Gets the meaning of this element
+        VertexElementSemantic getSemantic(void) const { return mSemantic; }
+        /// Gets the index of this element, only applicable for repeating elements
+        unsigned short getIndex(void) const { return mIndex; }
+		/// Gets the size of this element in bytes
+		size_t getSize(void) const;
+		/// Utility method for helping to calculate offsets
+		static size_t getTypeSize(VertexElementType etype);
+		/// Utility method which returns the count of values in a given type
+		static unsigned short getTypeCount(VertexElementType etype);
+		/** Simple converter function which will turn a single-value type into a
+			multi-value type based on a parameter.
+		*/
+		static VertexElementType multiplyTypeCount(VertexElementType baseType, unsigned short count);
+		/** Simple converter function which will a type into it's single-value
+			equivalent - makes switches on type easier.
+		*/
+		static VertexElementType getBaseType(VertexElementType multiType);
+
+		/** Utility method for converting colour from
+			one packed 32-bit colour type to another.
+		@param srcType The source type
+		@param dstType The destination type
+		@param ptr Read / write value to change
+		*/
+		static void convertColourValue(VertexElementType srcType,
+			VertexElementType dstType, uint32* ptr);
+
+		/** Utility method for converting colour to
+			a packed 32-bit colour type.
+		@param src source colour
+		@param dst The destination type
+		*/
+		static uint32 convertColourValue(const ColourValue& src,
+			VertexElementType dst);
+
+		/** Utility method to get the most appropriate packed colour vertex element format. */
+		static VertexElementType getBestColourVertexElementType(void);
+
+        inline bool operator== (const VertexElement& rhs) const
+        {
+            if (mType != rhs.mType ||
+                mIndex != rhs.mIndex ||
+                mOffset != rhs.mOffset ||
+                mSemantic != rhs.mSemantic ||
+                mSource != rhs.mSource)
+                return false;
+            else
+                return true;
+
+        }
+        /** Adjusts a pointer to the base of a vertex to point at this element.
+        @remarks
+            This variant is for void pointers, passed as a parameter because we can't
+            rely on covariant return types.
+        @param pBase Pointer to the start of a vertex in this buffer.
+        @param pElem Pointer to a pointer which will be set to the start of this element.
+        */
+        inline void baseVertexPointerToElement(void* pBase, void** pElem) const
+        {
+            // The only way we can do this is to cast to char* in order to use byte offset
+            // then cast back to void*.
+            *pElem = static_cast<void*>(
+            	static_cast<unsigned char*>(pBase) + mOffset);
+        }
+        /** Adjusts a pointer to the base of a vertex to point at this element.
+        @remarks
+            This variant is for float pointers, passed as a parameter because we can't
+            rely on covariant return types.
+        @param pBase Pointer to the start of a vertex in this buffer.
+        @param pElem Pointer to a pointer which will be set to the start of this element.
+        */
+        inline void baseVertexPointerToElement(void* pBase, float** pElem) const
+        {
+            // The only way we can do this is to cast to char* in order to use byte offset
+            // then cast back to float*. However we have to go via void* because casting
+            // directly is not allowed
+            *pElem = static_cast<float*>(
+                static_cast<void*>(
+                    static_cast<unsigned char*>(pBase) + mOffset));
+        }
+
+        /** Adjusts a pointer to the base of a vertex to point at this element.
+        @remarks
+            This variant is for RGBA pointers, passed as a parameter because we can't
+            rely on covariant return types.
+        @param pBase Pointer to the start of a vertex in this buffer.
+        @param pElem Pointer to a pointer which will be set to the start of this element.
+        */
+        inline void baseVertexPointerToElement(void* pBase, RGBA** pElem) const
+        {
+            *pElem = static_cast<RGBA*>(
+                static_cast<void*>(
+                    static_cast<unsigned char*>(pBase) + mOffset));
+        }
+        /** Adjusts a pointer to the base of a vertex to point at this element.
+        @remarks
+            This variant is for char pointers, passed as a parameter because we can't
+            rely on covariant return types.
+        @param pBase Pointer to the start of a vertex in this buffer.
+        @param pElem Pointer to a pointer which will be set to the start of this element.
+        */
+        inline void baseVertexPointerToElement(void* pBase, unsigned char** pElem) const
+        {
+            *pElem = static_cast<unsigned char*>(pBase) + mOffset;
+        }
+
+        /** Adjusts a pointer to the base of a vertex to point at this element.
+        @remarks
+        This variant is for ushort pointers, passed as a parameter because we can't
+        rely on covariant return types.
+        @param pBase Pointer to the start of a vertex in this buffer.
+        @param pElem Pointer to a pointer which will be set to the start of this element.
+        */
+        inline void baseVertexPointerToElement(void* pBase, unsigned short** pElem) const
+        {
+            *pElem = static_cast<unsigned short*>(pBase) + mOffset;
+        }
+
+
+    };
+    /** This class declares the format of a set of vertex inputs, which
+        can be issued to the rendering API through a RenderOperation.
+	@remarks
+	You should be aware that the ordering and structure of the
+	VertexDeclaration can be very important on DirectX with older
+	cards,so if you want to maintain maximum compatibility with
+	all render systems and all cards you should be careful to follow these
+	rules:<ol>
+	<li>VertexElements should be added in the following order, and the order of the
+	elements within a shared buffer should be as follows:
+	position, blending weights, normals, diffuse colours, specular colours,
+            texture coordinates (in order, with no gaps)</li>
+	<li>You must not have unused gaps in your buffers which are not referenced
+	by any VertexElement</li>
+	<li>You must not cause the buffer & offset settings of 2 VertexElements to overlap</li>
+	</ol>
+	Whilst GL and more modern graphics cards in D3D will allow you to defy these rules,
+	sticking to them will ensure that your buffers have the maximum compatibility.
+	@par
+	Like the other classes in this functional area, these declarations should be created and
+	destroyed using the HardwareBufferManager.
+    */
+    class _OgreExport VertexDeclaration
+    {
+    public:
+		/// Defines the list of vertex elements that makes up this declaration
+        typedef std::list<VertexElement> VertexElementList;
+        /// Sort routine for vertex elements
+        static bool vertexElementLess(const VertexElement& e1, const VertexElement& e2);
+    protected:
+        VertexElementList mElementList;
+    public:
+        /// Standard constructor, not you should use HardwareBufferManager::createVertexDeclaration
+        VertexDeclaration();
+        virtual ~VertexDeclaration();
+
+        /** Get the number of elements in the declaration. */
+        size_t getElementCount(void) { return mElementList.size(); }
+        /** Gets read-only access to the list of vertex elements. */
+        const VertexElementList& getElements(void) const;
+        /** Get a single element. */
+        const VertexElement* getElement(unsigned short index);
+
+        /** Sorts the elements in this list to be compatible with the maximum
+            number of rendering APIs / graphics cards.
+        @remarks
+            Older graphics cards require vertex data to be presented in a more
+            rigid way, as defined in the main documentation for this class. As well
+            as the ordering being important, where shared source buffers are used, the
+            declaration must list all the elements for each source in turn.
+        */
+        void sort(void);
+
+        /** Remove any gaps in the source buffer list used by this declaration.
+        @remarks
+            This is useful if you've modified a declaration and want to remove
+            any gaps in the list of buffers being used. Note, however, that if this
+            declaration is already being used with a VertexBufferBinding, you will
+            need to alter that too. This method is mainly useful when reorganising
+            buffers based on an altered declaration.
+        @note
+            This will cause the vertex declaration to be re-sorted.
+        */
+        void closeGapsInSource(void);
+
+        /** Generates a new VertexDeclaration for optimal usage based on the current
+            vertex declaration, which can be used with VertexData::reorganiseBuffers later
+            if you wish, or simply used as a template.
+		@remarks
+			Different buffer organisations and buffer usages will be returned
+            depending on the parameters passed to this method.
+        @param skeletalAnimation Whether this vertex data is going to be
+			skeletally animated
+		@param vertexAnimation Whether this vertex data is going to be vertex animated
+        */
+        VertexDeclaration* getAutoOrganisedDeclaration(bool skeletalAnimation,
+			bool vertexAnimation);
+
+        /** Gets the indeex of the highest source value referenced by this declaration. */
+        unsigned short getMaxSource(void) const;
+
+
+
+        /** Adds a new VertexElement to this declaration.
+        @remarks
+            This method adds a single element (positions, normals etc) to the end of the
+            vertex declaration. <b>Please read the information in VertexDeclaration about
+	    the importance of ordering and structure for compatibility with older D3D drivers</b>.
+	    @param source The binding index of HardwareVertexBuffer which will provide the source for this element.
+			See VertexBufferBindingState for full information.
+        @param offset The offset in bytes where this element is located in the buffer
+        @param theType The data format of the element (3 floats, a colour etc)
+        @param semantic The meaning of the data (position, normal, diffuse colour etc)
+        @param index Optional index for multi-input elements like texture coordinates
+		@returns A reference to the VertexElement added.
+        */
+        virtual const VertexElement& addElement(unsigned short source, size_t offset, VertexElementType theType,
+            VertexElementSemantic semantic, unsigned short index = 0);
+        /** Inserts a new VertexElement at a given position in this declaration.
+        @remarks
+        This method adds a single element (positions, normals etc) at a given position in this
+        vertex declaration. <b>Please read the information in VertexDeclaration about
+        the importance of ordering and structure for compatibility with older D3D drivers</b>.
+        @param source The binding index of HardwareVertexBuffer which will provide the source for this element.
+        See VertexBufferBindingState for full information.
+        @param offset The offset in bytes where this element is located in the buffer
+        @param theType The data format of the element (3 floats, a colour etc)
+        @param semantic The meaning of the data (position, normal, diffuse colour etc)
+        @param index Optional index for multi-input elements like texture coordinates
+        @returns A reference to the VertexElement added.
+        */
+        virtual const VertexElement& insertElement(unsigned short atPosition,
+            unsigned short source, size_t offset, VertexElementType theType,
+            VertexElementSemantic semantic, unsigned short index = 0);
+
+        /** Remove the element at the given index from this declaration. */
+        virtual void removeElement(unsigned short elem_index);
+
+        /** Remove the element with the given semantic and usage index.
+        @remarks
+            In this case 'index' means the usage index for repeating elements such
+            as texture coordinates. For other elements this will always be 0 and does
+            not refer to the index in the vector.
+        */
+        virtual void removeElement(VertexElementSemantic semantic, unsigned short index = 0);
+
+		/** Remove all elements. */
+		virtual void removeAllElements(void);
+
+        /** Modify an element in-place, params as addElement.
+	   @remarks
+	   <b>Please read the information in VertexDeclaration about
+	    the importance of ordering and structure for compatibility with older D3D drivers</b>.
+	 */
+        virtual void modifyElement(unsigned short elem_index, unsigned short source, size_t offset, VertexElementType theType,
+            VertexElementSemantic semantic, unsigned short index = 0);
+
+		/** Finds a VertexElement with the given semantic, and index if there is more than
+			one element with the same semantic.
+        @remarks
+            If the element is not found, this method returns null.
+		*/
+		virtual const VertexElement* findElementBySemantic(VertexElementSemantic sem, unsigned short index = 0);
+		/** Based on the current elements, gets the size of the vertex for a given buffer source.
+		@param source The buffer binding index for which to get the vertex size.
+		*/
+
+		/** Gets a list of elements which use a given source.
+		@remarks
+			Note that the list of elements is returned by value therefore is separate from
+			the declaration as soon as this method returns.
+		*/
+		virtual VertexElementList findElementsBySource(unsigned short source);
+
+		/** Gets the vertex size defined by this declaration for a given source. */
+        virtual size_t getVertexSize(unsigned short source);
+
+        /** Clones this declaration. */
+        virtual VertexDeclaration* clone(void);
+
+        inline bool operator== (const VertexDeclaration& rhs) const
+        {
+            if (mElementList.size() != rhs.mElementList.size())
+                return false;
+
+            VertexElementList::const_iterator i, iend, rhsi, rhsiend;
+            iend = mElementList.end();
+            rhsiend = rhs.mElementList.end();
+            rhsi = rhs.mElementList.begin();
+            for (i = mElementList.begin(); i != iend && rhsi != rhsiend; ++i, ++rhsi)
+            {
+                if ( !(*i == *rhsi) )
+                    return false;
+            }
+
+            return true;
+        }
+        inline bool operator!= (const VertexDeclaration& rhs) const
+        {
+            return !(*this == rhs);
+        }
+
+    };
+
+	/** Records the state of all the vertex buffer bindings required to provide a vertex declaration
+		with the input data it needs for the vertex elements.
+	@remarks
+		Why do we have this binding list rather than just have VertexElement referring to the
+		vertex buffers direct? Well, in the underlying APIs, binding the vertex buffers to an
+		index (or 'stream') is the way that vertex data is linked, so this structure better
+		reflects the realities of that. In addition, by separating the vertex declaration from
+		the list of vertex buffer bindings, it becomes possible to reuse bindings between declarations
+		and vice versa, giving opportunities to reduce the state changes required to perform rendering.
+	@par
+		Like the other classes in this functional area, these binding maps should be created and
+		destroyed using the HardwareBufferManager.
+	*/
+	class _OgreExport VertexBufferBinding
+	{
+	public:
+		/// Defines the vertex buffer bindings used as source for vertex declarations
+		typedef std::map<unsigned short, HardwareVertexBufferSharedPtr> VertexBufferBindingMap;
+	protected:
+		VertexBufferBindingMap mBindingMap;
+		mutable unsigned short mHighIndex;
+	public:
+		/// Constructor, should not be called direct, use HardwareBufferManager::createVertexBufferBinding
+		VertexBufferBinding();
+		virtual ~VertexBufferBinding();
+		/** Set a binding, associating a vertex buffer with a given index.
+		@remarks
+			If the index is already associated with a vertex buffer,
+            the association will be replaced. This may cause the old buffer
+            to be destroyed if nothing else is referring to it.
+			You should assign bindings from 0 and not leave gaps, although you can
+			bind them in any order.
+		*/
+		virtual void setBinding(unsigned short index, const HardwareVertexBufferSharedPtr& buffer);
+		/** Removes an existing binding. */
+		virtual void unsetBinding(unsigned short index);
+
+        /** Removes all the bindings. */
+        virtual void unsetAllBindings(void);
+
+		/// Gets a read-only version of the buffer bindings
+		virtual const VertexBufferBindingMap& getBindings(void) const;
+
+		/// Gets the buffer bound to the given source index
+		virtual const HardwareVertexBufferSharedPtr& getBuffer(unsigned short index) const;
+		/// Gets whether a buffer is bound to the given source index
+		virtual bool isBufferBound(unsigned short index) const;
+
+        virtual size_t getBufferCount(void) const { return mBindingMap.size(); }
+
+		/** Gets the highest index which has already been set, plus 1.
+		@remarks
+			This is to assist in binding the vertex buffers such that there are
+			not gaps in the list.
+		*/
+		virtual unsigned short getNextIndex(void) const { return mHighIndex++; }
+
+        /** Gets the last bound index.
+        */
+        virtual unsigned short getLastBoundIndex(void) const;
+
+        typedef std::map<ushort, ushort> BindingIndexMap;
+
+        /** Check whether any gaps in the bindings.
+        */
+        virtual bool hasGaps(void) const;
+
+        /** Remove any gaps in the bindings.
+        @remarks
+            This is useful if you've removed vertex buffer from this vertex buffer
+            bindings and want to remove any gaps in the bindings. Note, however,
+            that if this bindings is already being used with a VertexDeclaration,
+            you will need to alter that too. This method is mainly useful when
+            reorganising buffers manually.
+        @param
+            bindingIndexMap To be retrieve the binding index map that used to
+            translation old index to new index; will be cleared by this method
+            before fill-in.
+        */
+        virtual void closeGaps(BindingIndexMap& bindingIndexMap);
+
+
+	};
+
+
+
+}
+#endif
+
Index: /OgreMain/include/OgreHighLevelGpuProgram.h
===================================================================
--- /OgreMain/include/OgreHighLevelGpuProgram.h	(revision 5)
+++ /OgreMain/include/OgreHighLevelGpuProgram.h	(revision 5)
@@ -0,0 +1,185 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __HighLevelGpuProgram_H__
+#define __HighLevelGpuProgram_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreGpuProgram.h"
+
+namespace Ogre {
+
+    /** Abstract base class representing a high-level program (a vertex or
+        fragment program).
+    @remarks
+        High-level programs are vertex and fragment programs written in a high-level
+        language such as Cg or HLSL, and as such do not require you to write assembler code
+        like GpuProgram does. However, the high-level program does eventually 
+        get converted (compiled) into assembler and then eventually microcode which is
+        what runs on the GPU. As well as the convenience, some high-level languages like Cg allow
+        you to write a program which will operate under both Direct3D and OpenGL, something
+        which you cannot do with just GpuProgram (which requires you to write 2 programs and
+        use each in a Technique to provide cross-API compatibility). Ogre will be creating
+        a GpuProgram for you based on the high-level program, which is compiled specifically 
+        for the API being used at the time, but this process is transparent.
+    @par
+        You cannot create high-level programs direct - use HighLevelGpuProgramManager instead.
+        Plugins can register new implementations of HighLevelGpuProgramFactory in order to add
+        support for new languages without requiring changes to the core Ogre API. To allow 
+        custom parameters to be set, this class extends StringInterface - the application
+        can query on the available custom parameters and get/set them without having to 
+        link specifically with it.
+    */
+    class _OgreExport HighLevelGpuProgram : public GpuProgram
+    {
+    protected:
+        /// Whether the high-level program (and it's parameter defs) is loaded
+        bool mHighLevelLoaded;
+        /// The underlying assembler program
+        GpuProgramPtr mAssemblerProgram;
+		/// Have we built the name->index parameter map yet?
+		mutable bool mConstantDefsBuilt;
+		/// Parameter name -> ConstantDefinition map, shared instance used by all parameter objects
+		mutable GpuNamedConstants mConstantDefs;
+
+        /// Internal load high-level portion if not loaded
+        virtual void loadHighLevel(void);
+        /// Internal unload high-level portion if loaded
+        virtual void unloadHighLevel(void);
+        /** Internal load implementation, loads just the high-level portion, enough to 
+            get parameters.
+        */
+        virtual void loadHighLevelImpl(void);
+        /** Internal method for creating an appropriate low-level program from this
+        high-level program, must be implemented by subclasses. */
+        virtual void createLowLevelImpl(void) = 0;
+        /// Internal unload implementation, must be implemented by subclasses
+        virtual void unloadHighLevelImpl(void) = 0;
+        /// Populate the passed parameters with name->index map
+        virtual void populateParameterNames(GpuProgramParametersSharedPtr params);
+		/** Build the constant definition map, must be overridden.
+		@note The implementation must fill in the mConstantDefs field at a minimum, 
+			and if the program requires that parameters are bound using logical 
+			parameter indexes then the mFloatLogicalToPhysical and mIntLogicalToPhysical
+			maps must also be populated.
+		*/
+		virtual void buildConstantDefinitions() const = 0;
+
+        /** @copydoc Resource::loadImpl */
+        void loadImpl();
+        /** @copydoc Resource::unloadImpl */
+        void unloadImpl();
+    public:
+        /** Constructor, should be used only by factory classes. */
+        HighLevelGpuProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
+            const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
+        ~HighLevelGpuProgram();
+
+
+        /** Creates a new parameters object compatible with this program definition. 
+        @remarks
+            Unlike low-level assembly programs, parameters objects are specific to the
+            program and therefore must be created from it rather than by the 
+            HighLevelGpuProgramManager. This method creates a new instance of a parameters
+            object containing the definition of the parameters this program understands.
+        */
+        GpuProgramParametersSharedPtr createParameters(void);
+        /** @copydoc GpuProgram::getBindingDelegate */
+        GpuProgram* _getBindingDelegate(void) { return mAssemblerProgram.getPointer(); }
+
+		/** Get the full list of GpuConstantDefinition instances.
+		@note
+		Only available if this parameters object has named parameters.
+		*/
+		const GpuNamedConstants& getConstantDefinitions() const;
+
+
+
+
+    };
+
+    /** Specialisation of SharedPtr to allow SharedPtr to be assigned to HighLevelGpuProgramPtr 
+    @note Has to be a subclass since we need operator=.
+    We could templatise this instead of repeating per Resource subclass, 
+    except to do so requires a form VC6 does not support i.e.
+    ResourceSubclassPtr<T> : public SharedPtr<T>
+    */
+    class _OgreExport HighLevelGpuProgramPtr : public SharedPtr<HighLevelGpuProgram> 
+    {
+    public:
+        HighLevelGpuProgramPtr() : SharedPtr<HighLevelGpuProgram>() {}
+        explicit HighLevelGpuProgramPtr(HighLevelGpuProgram* rep) : SharedPtr<HighLevelGpuProgram>(rep) {}
+        HighLevelGpuProgramPtr(const HighLevelGpuProgramPtr& r) : SharedPtr<HighLevelGpuProgram>(r) {} 
+        HighLevelGpuProgramPtr(const ResourcePtr& r) : SharedPtr<HighLevelGpuProgram>()
+        {
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+                pRep = static_cast<HighLevelGpuProgram*>(r.getPointer());
+                pUseCount = r.useCountPointer();
+                if (pUseCount)
+                {
+                    ++(*pUseCount);
+                }
+            }
+        }
+
+        /// Operator used to convert a ResourcePtr to a HighLevelGpuProgramPtr
+        HighLevelGpuProgramPtr& operator=(const ResourcePtr& r)
+        {
+            if (pRep == static_cast<HighLevelGpuProgram*>(r.getPointer()))
+                return *this;
+            release();
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+                OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+                pRep = static_cast<HighLevelGpuProgram*>(r.getPointer());
+                pUseCount = r.useCountPointer();
+                if (pUseCount)
+                {
+                    ++(*pUseCount);
+                }
+            }
+			else
+			{
+				// RHS must be a null pointer
+				assert(r.isNull() && "RHS must be null if it has no mutex!");
+				setNull();
+			}
+            return *this;
+        }
+		/// Operator used to convert a GpuProgramPtr to a HighLevelGpuProgramPtr
+		HighLevelGpuProgramPtr& operator=(const GpuProgramPtr& r);
+    };
+
+}
+#endif
Index: /OgreMain/include/OgreHighLevelGpuProgramManager.h
===================================================================
--- /OgreMain/include/OgreHighLevelGpuProgramManager.h	(revision 5)
+++ /OgreMain/include/OgreHighLevelGpuProgramManager.h	(revision 5)
@@ -0,0 +1,148 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __HighLevelGpuProgramManager_H__
+#define __HighLevelGpuProgramManager_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreResourceManager.h"
+#include "OgreSingleton.h"
+#include "OgreException.h"
+#include "OgreHighLevelGpuProgram.h"
+
+namespace Ogre {
+
+	/** Interface definition for factories of HighLevelGpuProgram. */
+	class _OgreExport HighLevelGpuProgramFactory
+	{
+	public:
+        HighLevelGpuProgramFactory() {}
+        virtual ~HighLevelGpuProgramFactory();
+		/// Get the name of the language this factory creates programs for
+		virtual const String& getLanguage(void) const = 0;
+        virtual HighLevelGpuProgram* create(ResourceManager* creator, 
+            const String& name, ResourceHandle handle,
+            const String& group, bool isManual, ManualResourceLoader* loader) = 0;
+		virtual void destroy(HighLevelGpuProgram* prog) = 0;
+	};
+	/** This ResourceManager manages high-level vertex and fragment programs. 
+	@remarks
+		High-level vertex and fragment programs can be used instead of assembler programs
+		as managed by GpuProgramManager; however they typically result in a GpuProgram
+		being created as a derivative of the high-level program. High-level programs are
+		easier to write, and can often be API-independent, unlike assembler programs. 
+	@par
+		This class not only manages the programs themselves, it also manages the factory
+		classes which allow the creation of high-level programs using a variety of high-level
+		syntaxes. Plugins can be created which register themselves as high-level program
+		factories and as such the engine can be extended to accept virtually any kind of
+		program provided a plugin is written.
+	*/
+	class _OgreExport HighLevelGpuProgramManager 
+		: public ResourceManager, public Singleton<HighLevelGpuProgramManager>
+	{
+	public:
+		typedef std::map<String, HighLevelGpuProgramFactory*> FactoryMap;
+	protected:
+		/// Factories capable of creating HighLevelGpuProgram instances
+		FactoryMap mFactories;
+
+		/// Factory for dealing with programs for languages we can't create
+		HighLevelGpuProgramFactory* mNullFactory;
+		/// Factory for unified high-level programs
+		HighLevelGpuProgramFactory* mUnifiedFactory;
+
+		HighLevelGpuProgramFactory* getFactory(const String& language);
+
+        /// @copydoc ResourceManager::createImpl
+        Resource* createImpl(const String& name, ResourceHandle handle, 
+            const String& group, bool isManual, ManualResourceLoader* loader,
+            const NameValuePairList* params);
+	public:
+		HighLevelGpuProgramManager();
+		~HighLevelGpuProgramManager();
+		/** Add a new factory object for high-level programs of a given language. */
+		void addFactory(HighLevelGpuProgramFactory* factory);
+		/** Remove a factory object for high-level programs of a given language. */
+		void removeFactory(HighLevelGpuProgramFactory* factory);
+
+
+        /** Create a new, unloaded HighLevelGpuProgram. 
+		@par
+			This method creates a new program of the type specified as the second and third parameters.
+			You will have to call further methods on the returned program in order to 
+			define the program fully before you can load it.
+		@param name The identifying name of the program
+        @param groupName The name of the resource group which this program is
+            to be a member of
+		@param language Code of the language to use (e.g. "cg")
+		@param gptype The type of program to create
+		*/
+		virtual HighLevelGpuProgramPtr createProgram(
+			const String& name, const String& groupName, 
+            const String& language, GpuProgramType gptype);
+
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static HighLevelGpuProgramManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static HighLevelGpuProgramManager* getSingletonPtr(void);
+
+
+	};
+
+}
+
+#endif
Index: /OgreMain/include/OgreILCodecs.h
===================================================================
--- /OgreMain/include/OgreILCodecs.h	(revision 5)
+++ /OgreMain/include/OgreILCodecs.h	(revision 5)
@@ -0,0 +1,52 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _ILCodecs_H__
+#define _ILCodecs_H__
+
+#include <list>
+
+namespace Ogre 
+{
+    class ILImageCodec;
+    
+    class _OgrePrivate ILCodecs {
+    protected:
+       static std::list<ILImageCodec*> codeclist;
+    public:
+    	// Register all codecs provided by this module
+	   static void registerCodecs(void);
+	   // Delete all codecs provided by this module
+	   static void deleteCodecs(void);
+    };
+
+} // namespace Ogre
+
+
+#endif // #ifndef _DDSCodec_H__
+
Index: /OgreMain/include/OgreILImageCodec.h
===================================================================
--- /OgreMain/include/OgreILImageCodec.h	(revision 5)
+++ /OgreMain/include/OgreILImageCodec.h	(revision 5)
@@ -0,0 +1,67 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _ILImageCodec_H__
+#define _ILImageCodec_H__
+
+#include "OgreImageCodec.h"
+
+namespace Ogre {
+
+    /** Codec specialized in images loaded using DevIL.
+        @remarks
+            The users implementing subclasses of ImageCodec are required to return
+            a valid pointer to a ImageData class from the decode(...) function.
+    */
+    class _OgreExport ILImageCodec : public ImageCodec
+    {
+    private:
+		static bool _is_initialised;
+        String mType;
+        unsigned int mIlType;
+
+    public:
+        ILImageCodec(const String &type, unsigned int ilType);
+        virtual ~ILImageCodec() { }
+
+        /// @copydoc Codec::code
+        DataStreamPtr code(MemoryDataStreamPtr& input, CodecDataPtr& pData) const;
+        /// @copydoc Codec::codeToFile
+        void codeToFile(MemoryDataStreamPtr& input, const String& outFileName, CodecDataPtr& pData) const;
+        /// @copydoc Codec::decode
+        DecodeResult decode(DataStreamPtr& input) const;
+
+        /// Initialise DevIL
+        void initialiseIL(void);
+        
+        virtual String getType() const;        
+    };
+
+} // namespace
+
+#endif
Index: /OgreMain/include/OgreILUtil.h
===================================================================
--- /OgreMain/include/OgreILUtil.h	(revision 5)
+++ /OgreMain/include/OgreILUtil.h	(revision 5)
@@ -0,0 +1,91 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _Ogre_ILUtil_H__
+#define _Ogre_ILUtil_H__
+
+#include <OgrePrerequisites.h>
+#include <OgreCommon.h>
+#include <OgrePixelFormat.h>
+
+namespace Ogre {
+
+    /* 
+     * DevIL specific utility class
+     **/    
+    class _OgrePrivate ILUtil {
+    public:
+    	/// Structure that encapsulates a devIL image format definition
+		struct ILFormat {
+			/// Construct an invalidated ILFormat structure
+			ILFormat():
+				numberOfChannels(0), format(-1), type(-1) {};
+
+			/// Construct a ILFormat from parameters
+			ILFormat(int channels, int format, int type=-1):
+				numberOfChannels(channels), format(format), type(type) {}
+
+			/// Return wether this structure represents a valid DevIL format
+			bool isValid() { return format!=-1; }
+
+			/// Number of channels, usually 3 or 4
+			int numberOfChannels;
+			/// IL_RGBA,IL_BGRA,IL_DXTx, ...
+  			int format;
+			/// IL_UNSIGNED_BYTE, IL_UNSIGNED_SHORT, ... may be -1 for compressed formats
+  			int type;
+		};
+
+        /** Get OGRE format to which a given IL format can be most optimally converted.
+         */
+        static PixelFormat ilFormat2OgreFormat( int ImageFormat, int ImageType );
+        /**	Get IL format that matches a given OGRE format exactly in memory.
+        	@remarks	Returns an invalid ILFormat (.isValid()==false) when
+        		there is no IL format that matches this.
+         */
+        static ILFormat OgreFormat2ilFormat( PixelFormat format );      
+        /** Convert current IL image to an OGRE format. The size of the target will be
+          	PixelUtil::getNumElemBytes(fmt) * ilGetInteger( IL_IMAGE_WIDTH ) * ilGetInteger( IL_IMAGE_HEIGHT ) * ilGetInteger( IL_IMAGE_DEPTH )
+          	The IL image type must be IL(_UNSIGNED_)BYTE or IL_FLOAT.
+        	The IL image format must be IL_RGBA, IL_BGRA, IL_RGB, IL_BGR, IL_LUMINANCE or IL_LUMINANCE_ALPHA
+         
+         	@param tar       Target pointer
+         	@param ogrefmt   Ogre pixel format to employ
+        */
+        static void toOgre(const PixelBox &dst);
+
+        /** Convert an OGRE format image to current IL image.
+         	@param src       Pixelbox; encapsulates source pointer, width, height, 
+         					 depth and format
+        */
+        static void fromOgre(const PixelBox &src);
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgreImage.h
===================================================================
--- /OgreMain/include/OgreImage.h	(revision 5)
+++ /OgreMain/include/OgreImage.h	(revision 5)
@@ -0,0 +1,428 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _Image_H__
+#define _Image_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreCommon.h"
+#include "OgrePixelFormat.h"
+#include "OgreDataStream.h"
+
+namespace Ogre {
+
+    enum ImageFlags
+    {
+        IF_COMPRESSED = 0x00000001,
+        IF_CUBEMAP    = 0x00000002,
+        IF_3D_TEXTURE = 0x00000004
+    };
+    /** Class representing an image file.
+        @remarks
+            The Image class usually holds uncompressed image data and is the
+            only object that can be loaded in a texture. Image  objects handle 
+            image data decoding themselves by the means of locating the correct 
+            Codec object for each data type.
+        @par
+            Typically, you would want to use an Image object to load a texture
+            when extra processing needs to be done on an image before it is
+            loaded or when you want to blit to an existing texture.
+    */
+    class _OgreExport Image
+    {
+    public:
+    	typedef Ogre::Box Box;
+    	typedef Ogre::Rect Rect;
+    public:
+        /** Standard constructor.
+        */
+        Image();
+        /** Copy-constructor - copies all the data from the target image.
+        */
+        Image( const Image &img );
+
+        /** Standard destructor.
+        */
+        virtual ~Image();
+
+        /** Assignment operator - copies all the data from the target image.
+        */
+        Image & operator = ( const Image & img );
+
+        /** Flips (mirrors) the image around the Y-axis. 
+            @remarks
+                An example of an original and flipped image:
+                <pre>                
+                originalimg
+                00000000000
+                00000000000
+                00000000000
+                00000000000
+                00000000000
+                ------------> flip axis
+                00000000000
+                00000000000
+                00000000000
+                00000000000
+                00000000000
+                originalimg
+                </pre>
+        */
+        Image & flipAroundY();
+
+        /** Flips (mirrors) the image around the X-axis.
+            @remarks
+                An example of an original and flipped image:
+                <pre>
+                        flip axis
+                            |
+                originalimg|gmilanigiro
+                00000000000|00000000000
+                00000000000|00000000000
+                00000000000|00000000000
+                00000000000|00000000000
+                00000000000|00000000000
+                </pre>
+        */                 
+        Image & flipAroundX();
+
+        /** Stores a pointer to raw data in memory. The pixel format has to be specified.
+            @remarks
+                This method loads an image into memory held in the object. The 
+                pixel format will be either greyscale or RGB with an optional
+                Alpha component.
+                The type can be determined by calling getFormat().             
+            @note
+				Whilst typically your image is likely to be a simple 2D image,
+				you can define complex images including cube maps, volume maps,
+				and images including custom mip levels. The layout of the 
+				internal memory should be:
+				<ul><li>face 0, mip 0 (top), width x height (x depth)</li>
+				<li>face 0, mip 1, width/2 x height/2 (x depth/2)</li>
+				<li>face 0, mip 2, width/4 x height/4 (x depth/4)</li>
+				<li>.. remaining mips for face 0 .. </li>
+				<li>face 1, mip 0 (top), width x height (x depth)</li
+				<li>.. and so on. </li>
+				</ul>
+				Of course, you will never have multiple faces (cube map) and
+				depth too.
+			@param
+                The data pointer
+            @param
+				Width of image
+            @param
+				Height of image
+			@param
+                Image Depth (in 3d images, numbers of layers, otherwhise 1)
+            @param
+				Pixel Format
+            @param
+                if memory associated with this buffer is to be destroyed
+                with the Image object.
+			@param
+				the number of faces the image data has inside (6 for cubemaps, 1 otherwise)
+            @param
+                the number of mipmaps the image data has inside
+            @note
+                 The memory associated with this buffer is NOT destroyed with the
+                 Image object, unless autoDelete is set to true.
+			@remarks 
+				The size of the buffer must be numFaces*PixelUtil::getMemorySize(width, height, depth, format)
+         */
+		Image& loadDynamicImage( uchar* pData, size_t uWidth, size_t uHeight, 
+							size_t depth,
+							 PixelFormat eFormat, bool autoDelete = false, 
+							 size_t numFaces = 1, size_t numMipMaps = 0);
+		
+		/** Stores a pointer to raw data in memory. The pixel format has to be specified.
+            @remarks
+                This method loads an image into memory held in the object. The 
+                pixel format will be either greyscale or RGB with an optional
+                Alpha component.
+                The type can be determined by calling getFormat().             
+            @note
+				Whilst typically your image is likely to be a simple 2D image,
+				you can define complex images including cube maps
+				and images including custom mip levels. The layout of the 
+				internal memory should be:
+				<ul><li>face 0, mip 0 (top), width x height</li>
+				<li>face 0, mip 1, width/2 x height/2 </li>
+				<li>face 0, mip 2, width/4 x height/4 </li>
+				<li>.. remaining mips for face 0 .. </li>
+				<li>face 1, mip 0 (top), width x height (x depth)</li
+				<li>.. and so on. </li>
+				</ul>
+				Of course, you will never have multiple faces (cube map) and
+				depth too.
+            @param
+                The data pointer
+            @param
+				Width of image
+            @param
+				Height of image
+            @param
+				Pixel Format
+            @note
+                 The memory associated with this buffer is NOT destroyed with the
+                 Image object.
+			@remarks This function is deprecated; one should really use the
+				Image::loadDynamicImage(pData, width, height, depth, format, ...) to be compatible
+				with future Ogre versions.
+         */
+ 		Image& loadDynamicImage( uchar* pData, size_t uWidth,
+								 size_t uHeight, PixelFormat eFormat)
+		{
+			return loadDynamicImage(pData, uWidth, uHeight, 1, eFormat);
+		}
+		/** Loads raw data from a stream. See the function
+			loadDynamicImage for a description of the parameters.
+			@remarks 
+				The size of the buffer must be numFaces*PixelUtil::getMemorySize(width, height, depth, format)
+            @note
+				Whilst typically your image is likely to be a simple 2D image,
+				you can define complex images including cube maps
+				and images including custom mip levels. The layout of the 
+				internal memory should be:
+				<ul><li>face 0, mip 0 (top), width x height (x depth)</li>
+				<li>face 0, mip 1, width/2 x height/2 (x depth/2)</li>
+				<li>face 0, mip 2, width/4 x height/4 (x depth/4)</li>
+				<li>.. remaining mips for face 0 .. </li>
+				<li>face 1, mip 0 (top), width x height (x depth)</li
+				<li>.. and so on. </li>
+				</ul>
+				Of course, you will never have multiple faces (cube map) and
+				depth too.
+        */
+        Image & loadRawData( 
+            DataStreamPtr& stream, 
+            size_t uWidth, size_t uHeight, size_t uDepth,
+            PixelFormat eFormat,
+			size_t numFaces = 1, size_t numMipMaps = 0);
+        /** Loads raw data from a stream. The pixel format has to be specified. 
+			@remarks This function is deprecated; one should really use the
+				Image::loadRawData(stream, width, height, depth, format, ...) to be compatible
+				with future Ogre versions.
+            @note
+				Whilst typically your image is likely to be a simple 2D image,
+				you can define complex images including cube maps
+				and images including custom mip levels. The layout of the 
+				internal memory should be:
+				<ul><li>face 0, mip 0 (top), width x height</li>
+				<li>face 0, mip 1, width/2 x height/2 </li>
+				<li>face 0, mip 2, width/4 x height/4 </li>
+				<li>.. remaining mips for face 0 .. </li>
+				<li>face 1, mip 0 (top), width x height (x depth)</li
+				<li>.. and so on. </li>
+				</ul>
+				Of course, you will never have multiple faces (cube map) and
+				depth too.
+        */
+        Image & loadRawData( 
+            DataStreamPtr& stream, 
+            size_t uWidth, size_t uHeight, 
+            PixelFormat eFormat )
+		{
+			return loadRawData(stream, uWidth, uHeight, 1, eFormat);
+		}
+
+        /** Loads an image file.
+            @remarks
+                This method loads an image into memory. Any format for which 
+				and associated ImageCodec is registered can be loaded. 
+				This can include complex formats like DDS with embedded custom 
+				mipmaps, cube faces and volume textures.
+                The type can be determined by calling getFormat().             
+            @param
+                strFileName Name of a file file to load.
+            @param
+                groupName Name of the resource group to search for the image
+            @note
+                The memory associated with this buffer is destroyed with the
+                Image object.
+        */
+        Image & load( const String& strFileName, const String& groupName );
+
+        /** Loads an image file from a stream.
+            @remarks
+                This method works in the same way as the filename-based load 
+                method except it loads the image from a DataStream object. 
+				This DataStream is expected to contain the 
+                encoded data as it would be held in a file. 
+                Any format for which and associated ImageCodec is registered 
+				can be loaded. 
+				This can include complex formats like DDS with embedded custom 
+				mipmaps, cube faces and volume textures.
+                The type can be determined by calling getFormat().             
+            @param
+                stream The source data.
+            @param
+                type The type of the image. Used to decide what decompression
+                codec to use.
+            @see
+                Image::load( const String& strFileName )
+        */
+        Image & load(DataStreamPtr& stream, const String& type );
+        
+        /** Save the image as a file. */
+        void save(const String& filename);
+
+        /** Returns a pointer to the internal image buffer.
+		@remarks
+			Be careful with this method. You will almost certainly
+			prefer to use getPixelBox, especially with complex images
+			which include many faces or custom mipmaps.
+        */
+        uchar* getData(void);
+
+        /** Returns a const pointer to the internal image buffer.
+		@remarks
+			Be careful with this method. You will almost certainly
+			prefer to use getPixelBox, especially with complex images
+			which include many faces or custom mipmaps.
+        */
+        const uchar * getData() const;       
+
+        /** Returns the size of the data buffer.
+        */
+        size_t getSize() const;
+
+        /** Returns the number of mipmaps contained in the image.
+        */
+        size_t getNumMipmaps() const;
+
+        /** Returns true if the image has the appropriate flag set.
+        */
+        bool hasFlag(const ImageFlags imgFlag) const;
+
+        /** Gets the width of the image in pixels.
+        */
+        size_t getWidth(void) const;
+
+        /** Gets the height of the image in pixels.
+        */
+        size_t getHeight(void) const;
+
+        /** Gets the depth of the image.
+        */
+        size_t getDepth(void) const;
+		
+		/** Get the numer of faces of the image. This is usually 6 for a cubemap, and
+		    1 for a normal image.
+		*/
+		size_t getNumFaces(void) const;
+
+        /** Gets the physical width in bytes of each row of pixels.
+        */
+        size_t getRowSpan(void) const;
+
+        /** Returns the image format.
+        */
+        PixelFormat getFormat() const;
+
+        /** Returns the number of bits per pixel.
+        */
+        uchar getBPP() const;
+
+        /** Returns true if the image has an alpha component.
+        */
+        bool getHasAlpha() const;
+		
+		/** Does gamma adjustment.
+            @note
+                Basic algo taken from Titan Engine, copyright (c) 2000 Ignacio 
+                Castano Iguado
+        */
+        static void applyGamma( uchar *buffer, Real gamma, size_t size, uchar bpp );
+
+        /**
+         * Get colour value from a certain location in the image. The z coordinate
+         * is only valid for cubemaps and volume textures. This uses the first (largest)
+         * mipmap.
+         */
+        ColourValue getColourAt(int x, int y, int z);
+        
+        /**
+         * Get a PixelBox encapsulating the image data of a mipmap
+         */
+        PixelBox getPixelBox(size_t face = 0, size_t mipmap = 0) const;
+
+		enum Filter
+		{
+			FILTER_NEAREST,
+			FILTER_LINEAR,
+			FILTER_BILINEAR,
+			FILTER_BOX,
+			FILTER_TRIANGLE,
+			FILTER_BICUBIC
+		};
+		/** Scale a 1D, 2D or 3D image volume. 
+			@param 	src			PixelBox containing the source pointer, dimensions and format
+			@param 	dst			PixelBox containing the destination pointer, dimensions and format
+			@param 	filter		Which filter to use
+			@remarks 	This function can do pixel format conversion in the process.
+			@note	dst and src can point to the same PixelBox object without any problem
+		*/
+		static void scale(const PixelBox &src, const PixelBox &dst, Filter filter = FILTER_BILINEAR);
+		
+		/** Resize a 2D image, applying the appropriate filter. */
+		void resize(ushort width, ushort height, Filter filter = FILTER_BILINEAR);
+		
+        // Static function to calculate size in bytes from the number of mipmaps, faces and the dimensions
+        static size_t calculateSize(size_t mipmaps, size_t faces, size_t width, size_t height, size_t depth, PixelFormat format);
+    private:
+        // The width of the image in pixels
+        size_t m_uWidth;
+        // The height of the image in pixels
+        size_t m_uHeight;
+        // The depth of the image
+        size_t m_uDepth;
+        // The size of the image buffer
+        size_t m_uSize;
+        // The number of mipmaps the image contains
+        size_t m_uNumMipmaps;
+        // Image specific flags.
+        int m_uFlags;
+
+        // The pixel format of the image
+        PixelFormat m_eFormat;
+
+        // The number of bytes per pixel
+        uchar m_ucPixelSize;
+        uchar* m_pBuffer;
+
+		// A bool to determine if we delete the buffer or the calling app does
+		bool m_bAutoDelete;
+    };
+
+	typedef std::vector<Image*> ImagePtrList;
+	typedef std::vector<const Image*> ConstImagePtrList;
+
+
+} // namespace
+
+#endif
Index: /OgreMain/include/OgreImageCodec.h
===================================================================
--- /OgreMain/include/OgreImageCodec.h	(revision 5)
+++ /OgreMain/include/OgreImageCodec.h	(revision 5)
@@ -0,0 +1,82 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _ImageCodec_H__
+#define _ImageCodec_H__
+
+#include "OgreCodec.h"
+#include "OgrePixelFormat.h"
+
+namespace Ogre {
+
+    /** Codec specialized in images.
+        @remarks
+            The users implementing subclasses of ImageCodec are required to return
+            a valid pointer to a ImageData class from the decode(...) function.
+    */
+    class _OgreExport ImageCodec : public Codec
+    {
+    public:
+        virtual ~ImageCodec();
+        /** Codec return class for images. Has imformation about the size and the
+            pixel format of the image. */
+        class _OgrePrivate ImageData : public Codec::CodecData
+        {
+        public:
+			ImageData():
+				height(0), width(0), depth(1), size(0),
+				num_mipmaps(0), flags(0), format(PF_UNKNOWN)
+			{
+			}
+            size_t height;
+            size_t width;
+			size_t depth;
+            size_t size;
+            
+            ushort num_mipmaps;
+            uint flags;
+
+            PixelFormat format;
+
+        public:
+            String dataType() const
+            {
+                return "ImageData";
+            }
+        };
+
+    public:
+        String getDataType() const
+        {
+            return "ImageData";
+        }
+    };
+
+} // namespace
+
+#endif
Index: /OgreMain/include/OgreInstancedGeometry.h
===================================================================
--- /OgreMain/include/OgreInstancedGeometry.h	(revision 5)
+++ /OgreMain/include/OgreInstancedGeometry.h	(revision 5)
@@ -0,0 +1,833 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __InstancedGeometry_H__
+#define __InstancedGeometry_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMovableObject.h"
+#include "OgreSimpleRenderable.h"
+#include "OgreSkeleton.h"
+#include "OgreSkeletonInstance.h"
+#include "OgreAnimationTrack.h"
+#include "OgreBone.h"
+
+namespace Ogre {
+
+	/** Pre-transforms and batches up meshes for efficient use as instanced geometry
+		in a scene
+	@remarks
+		Shader instancing allows to save both memory and draw calls. While 
+		StaticGeometry stores 500 times the same object in a batch to display 500 
+		objects, this shader instancing implementation stores only 80 times the object, 
+		and then re-uses the vertex data with different shader parameter.
+		Although you save memory, you make more draw call. However, you still 
+		make less draw calls than if you were rendering each object independently.
+		Plus, you can move the batched objects independently of one another which 
+		you cannot do with StaticGeometry.
+	@par
+		Therefore it is important when you are rendering a lot of geometry to 
+		batch things up into as few rendering calls as possible. This
+		class allows you to build a batched object from a series of entities 
+		in order to benefit from this behaviour.
+		Batching has implications of it's own though:
+		@li Batched geometry cannot be subdivided; that means that the whole
+			group will be displayed, or none of it will. This obivously has
+			culling issues.
+		@li A single material must apply for each batch. In fact this class 
+			allows you to use multiple materials, but you should be aware that 
+			internally this means that there is one batch per material. 
+			Therefore you won't gain as much benefit from the batching if you 
+			use many different materials; try to keep the number down.
+	@par
+		The bounding box information is computed whith object position only. 
+		It doesn't take account of the object orientation. 
+	@par
+		The LOD settings of both the Mesh and the Materials used in 
+		constructing this instanced geometry will be respected. This means that 
+		if you use meshes/materials which have LOD, batches in the distance 
+		will have a lower polygon count or material detail to those in the 
+		foreground. Since each mesh might have different LOD distances, during 
+		build the furthest distance at each LOD level from all meshes  
+		in that BatchInstance is used. This means all the LOD levels change at the 
+		same time, but at the furthest distance of any of them (so quality is 
+		not degraded). Be aware that using Mesh LOD in this class will 
+		further increase the memory required. Only generated LOD
+		is supported for meshes.
+	@par
+		There are 2 ways you can add geometry to this class; you can add
+		Entity objects directly with predetermined positions, scales and 
+		orientations, or you can add an entire SceneNode and it's subtree, 
+		including all the objects attached to it. Once you've added everthing
+		you need to, you have to call build() the fix the geometry in place. 
+	@par
+		You should not construct instances of this class directly; instead, call 
+		SceneManager::createInstancedGeometry, which gives the SceneManager the 
+		option of providing you with a specialised version of this class if it
+		wishes, and also handles the memory management for you like other 
+		classes.
+	*/
+	class _OgreExport  InstancedGeometry
+	{
+	public:
+		/** Struct holding geometry optimised per SubMesh / lod level, ready
+			for copying to instances. 
+		@remarks
+			Since we're going to be duplicating geometry lots of times, it's
+			far more important that we don't have redundant vertex data. If a 
+			SubMesh uses shared geometry, or we're looking at a lower LOD, not
+			all the vertices are being referenced by faces on that submesh.
+			Therefore to duplicate them, potentially hundreds or even thousands
+			of times, would be extremely wasteful. Therefore, if a SubMesh at
+			a given LOD has wastage, we create an optimised version of it's
+			geometry which is ready for copying with no wastage.
+		*/
+		class _OgrePrivate OptimisedSubMeshGeometry
+		{
+		public:
+			OptimisedSubMeshGeometry() :vertexData(0), indexData(0) {}
+			~OptimisedSubMeshGeometry() 
+			{
+				delete vertexData;
+				delete indexData;
+			}
+			VertexData *vertexData;
+			IndexData *indexData;
+		};
+		typedef std::list<OptimisedSubMeshGeometry*> OptimisedSubMeshGeometryList;
+		/// Saved link between SubMesh at a LOD and vertex/index data
+		/// May point to original or optimised geometry
+		struct SubMeshLodGeometryLink
+		{
+			VertexData* vertexData;
+			IndexData* indexData;
+		};
+		typedef std::vector<SubMeshLodGeometryLink> SubMeshLodGeometryLinkList;
+		typedef std::map<SubMesh*, SubMeshLodGeometryLinkList*> SubMeshGeometryLookup;
+		/// Structure recording a queued submesh for the build
+		struct QueuedSubMesh
+		{
+			SubMesh* submesh;
+			/// Link to LOD list of geometry, potentially optimised
+			SubMeshLodGeometryLinkList* geometryLodList;
+			String materialName;
+			Vector3 position;
+			Quaternion orientation;
+			Vector3 scale;
+			/// Pre-transformed world AABB 
+			AxisAlignedBox worldBounds;
+			unsigned int ID;
+		};
+		typedef std::vector<QueuedSubMesh*> QueuedSubMeshList;
+		typedef std::vector<String> QueuedSubMeshOriginList;
+		/// Structure recording a queued geometry for low level builds
+		struct QueuedGeometry
+		{
+			SubMeshLodGeometryLink* geometry;
+			Vector3 position;
+			Quaternion orientation;
+			Vector3 scale;
+			unsigned int ID;
+		};
+		typedef std::vector<QueuedGeometry*> QueuedGeometryList;
+		
+		// forward declarations
+		class LODBucket;
+		class MaterialBucket;
+		class BatchInstance;
+		class InstancedObject;
+
+		/** A GeometryBucket is a the lowest level bucket where geometry with 
+			the same vertex & index format is stored. It also acts as the 
+			renderable.
+		*/
+		class _OgreExport  GeometryBucket :	public SimpleRenderable
+		{
+		protected:
+			
+			/// Geometry which has been queued up pre-build (not for deallocation)
+			QueuedGeometryList mQueuedGeometry;
+			/// Pointer to the Batch
+			InstancedGeometry*mBatch;
+			/// Pointer to parent bucket
+			MaterialBucket* mParent;
+			/// String identifying the vertex / index format
+			String mFormatString;
+			/// Vertex information, includes current number of vertices
+			/// committed to be a part of this bucket
+			VertexData* mVertexData;
+			/// Index information, includes index type which limits the max
+			/// number of vertices which are allowed in one bucket
+			IndexData* mIndexData;
+			/// Size of indexes
+			HardwareIndexBuffer::IndexType mIndexType;
+			/// Maximum vertex indexable
+			size_t mMaxVertexIndex;
+			///	Index of the Texcoord where the index is stored
+			unsigned short mTexCoordIndex;
+			AxisAlignedBox mAABB;
+
+			template<typename T>
+			void copyIndexes(const T* src, T* dst, size_t count, size_t indexOffset)
+			{
+				if (indexOffset == 0)
+				{
+					memcpy(dst, src, sizeof(T) * count);
+				}
+				else
+				{
+					while(count--)
+					{
+						*dst++ = static_cast<T>(*src++ + indexOffset);
+					}
+				}
+			}
+		public:
+			GeometryBucket(MaterialBucket* parent, const String& formatString, 
+				const VertexData* vData, const IndexData* iData);
+			GeometryBucket(MaterialBucket* parent,const String& formatString,GeometryBucket*bucket);
+			virtual ~GeometryBucket();
+			MaterialBucket* getParent(void) { return mParent; }
+			Real getBoundingRadius(void) const;
+			/// Get the vertex data for this geometry 
+			const VertexData* getVertexData(void) const { return mVertexData; }
+			/// Get the index data for this geometry 
+			const IndexData* getIndexData(void) const { return mIndexData; }
+			/// @copydoc Renderable::getMaterial
+			const MaterialPtr& getMaterial(void) const;
+			Technique* getTechnique(void) const;
+	        void getWorldTransforms(Matrix4* xform) const;
+			virtual unsigned short getNumWorldTransforms(void) const ;
+	        const Quaternion& getWorldOrientation(void) const;
+	        const Vector3& getWorldPosition(void) const;
+			Real getSquaredViewDepth(const Camera* cam) const;
+	        const LightList& getLights(void) const;
+			bool getCastsShadows(void) const;
+			String getFormatString(void) const;
+			/** Try to assign geometry to this bucket.
+			@returns false if there is no room left in this bucket
+			*/
+			bool assign(QueuedGeometry* qsm);
+			/// Build
+			void build();
+			/// Dump contents for diagnostics
+			void dump(std::ofstream& of) const;
+			/// retun the BoundingBox information. Usefull when cloning the batch instance.
+			AxisAlignedBox & getAABB(void){return mAABB;};
+		};
+		class _OgreExport  InstancedObject
+		{
+			friend class GeometryBucket;
+		public:
+			 enum TransformSpace
+        {
+            /// Transform is relative to the local space
+            TS_LOCAL,
+            /// Transform is relative to the space of the parent node
+            TS_PARENT,
+            /// Transform is relative to world space
+            TS_WORLD
+        };
+			/// list of Geometry Buckets that contains the instanced object
+			typedef std::vector<GeometryBucket*> GeometryBucketList;
+		protected:
+			GeometryBucketList mGeometryBucketList;
+			unsigned short mIndex;
+			Matrix4  mTransformation;
+			Quaternion mOrientation;
+			Vector3	mScale;
+			Vector3 mPosition;
+			SkeletonInstance* mSkeletonInstance;
+			/// Cached bone matrices, including any world transform
+			Matrix4 *mBoneWorldMatrices;
+			/// Cached bone matrices in skeleton local space
+			Matrix4 *mBoneMatrices;
+			/// State of animation for animable meshes
+			AnimationStateSet* mAnimationState;
+			unsigned short mNumBoneMatrices;
+			/// Records the last frame in which animation was updated
+			unsigned long mFrameAnimationLastUpdated;
+		public:
+			InstancedObject(int index);
+			InstancedObject(int index,SkeletonInstance *skeleton,AnimationStateSet*animations);
+			~InstancedObject();
+			void setPosition( Vector3  position);
+			Vector3 & getPosition(void);
+			void yaw(const Radian& angle);
+			void pitch(const Radian& angle);
+			void roll(const Radian& angle);
+			void rotate(const Quaternion& q);
+			void setScale(const Vector3& scale);
+			void addBucketToList(GeometryBucket* bucket);
+			void needUpdate();
+			GeometryBucketList&getGeometryBucketList(void){return mGeometryBucketList;}
+			void translate(const Matrix3& axes, const Vector3& move);
+			void translate(const Vector3& d);
+			Matrix3 getLocalAxes(void) const;
+			void updateAnimation(void);
+			AnimationState* getAnimationState(const String& name) const;
+			SkeletonInstance*getSkeletonInstance(void){return mSkeletonInstance;}
+
+		};
+		/** A MaterialBucket is a collection of smaller buckets with the same 
+			Material (and implicitly the same LOD). */
+		class _OgreExport  MaterialBucket
+		{
+		public:
+			/// list of Geometry Buckets in this BatchInstance
+			typedef std::vector<GeometryBucket*> GeometryBucketList;
+		protected:
+			/// Pointer to parent LODBucket
+			LODBucket* mParent;
+			/// Material being used
+			String mMaterialName;
+			/// Pointer to material being used
+			MaterialPtr mMaterial;
+			/// Active technique
+			Technique* mTechnique;
+			int mLastIndex;
+			/// list of Geometry Buckets in this BatchInstance
+			GeometryBucketList mGeometryBucketList;
+			// index to current Geometry Buckets for a given geometry format
+			typedef std::map<String, GeometryBucket*> CurrentGeometryMap;
+			CurrentGeometryMap mCurrentGeometryMap;
+			/// Get a packed string identifying the geometry format
+			String getGeometryFormatString(SubMeshLodGeometryLink* geom);
+			
+		public:
+			MaterialBucket(LODBucket* parent, const String& materialName);
+			virtual ~MaterialBucket();
+			LODBucket* getParent(void) { return mParent; }
+			/// Get the material name
+			const String& getMaterialName(void) const { return mMaterialName; }
+			/// Assign geometry to this bucket
+			void assign(QueuedGeometry* qsm);
+			/// Build
+			void build();
+			/// Add children to the render queue
+			void addRenderables(RenderQueue* queue, uint8 group, 
+				Real camSquaredDist);
+			/// Get the material for this bucket
+			const MaterialPtr& getMaterial(void) const { return mMaterial; }
+			/// Iterator over geometry
+			typedef VectorIterator<GeometryBucketList> GeometryIterator;
+			/// Get an iterator over the contained geometry
+			GeometryIterator getGeometryIterator(void);
+			/// Get the current Technique
+			Technique* getCurrentTechnique(void) const { return mTechnique; }
+			/// Dump contents for diagnostics
+			void dump(std::ofstream& of) const;
+			/// Return the geometry map
+			MaterialBucket::CurrentGeometryMap* getMaterialBucketMap(void) const;
+			/// Return the geometry list
+			MaterialBucket::GeometryBucketList*getGeometryBucketList(void) const;
+			/// fill in the map and the list
+			void updateContainers(GeometryBucket* bucket, const String &format);
+			void setLastIndex(int index){mLastIndex=index;}
+			int getLastIndex(){return mLastIndex;}
+			void setMaterial(const String & name);
+		
+		};
+		/** A LODBucket is a collection of smaller buckets with the same LOD. 
+		@remarks
+			LOD refers to Mesh LOD here. Material LOD can change separately
+			at the next bucket down from this.
+		*/
+		class _OgreExport  LODBucket
+		{
+		public:
+			/// Lookup of Material Buckets in this BatchInstance
+			typedef std::map<String, MaterialBucket*> MaterialBucketMap;
+		protected:
+			/// Pointer to parent BatchInstance
+			BatchInstance* mParent;
+			/// LOD level (0 == full LOD)
+			unsigned short mLod;
+			/// distance at which this LOD starts to apply (squared)
+			Real mSquaredDistance;
+			/// Lookup of Material Buckets in this BatchInstance
+			MaterialBucketMap mMaterialBucketMap;
+			/// Geometry queued for a single LOD (deallocated here)
+			QueuedGeometryList mQueuedGeometryList;
+		public:
+			LODBucket(BatchInstance* parent, unsigned short lod, Real lodDist);
+			virtual ~LODBucket();
+			BatchInstance* getParent(void) { return mParent; }
+			/// Get the lod index
+			ushort getLod(void) const { return mLod; }
+			/// Get the lod squared distance
+			Real getSquaredDistance(void) const { return mSquaredDistance; }
+			/// Assign a queued submesh to this bucket, using specified mesh LOD
+			void assign(QueuedSubMesh* qsm, ushort atLod);
+			/// Build
+			void build();
+			/// Add children to the render queue
+			void addRenderables(RenderQueue* queue, uint8 group, 
+				Real camSquaredDistance);
+			/// Iterator over the materials in this LOD
+			typedef MapIterator<MaterialBucketMap> MaterialIterator;
+			/// Get an iterator over the materials in this LOD
+			MaterialIterator getMaterialIterator(void);
+			/// Dump contents for diagnostics
+			void dump(std::ofstream& of) const;
+			/// fill the map
+			void updateContainers(MaterialBucket* bucket, String& name );
+			
+		};
+		/** The details of a topological BatchInstance which is the highest level of
+			partitioning for this class.
+		@remarks
+			The size & shape of BatchInstances entirely depends on the SceneManager
+			specific implementation. It is a MovableObject since it will be
+			attached to a node based on the local centre - in practice it
+			won't actually move (although in theory it could).
+		*/
+		class _OgreExport  BatchInstance : public MovableObject
+		{
+			public:
+		
+
+			/// list of LOD Buckets in this BatchInstance
+			typedef std::vector<LODBucket*> LODBucketList;
+			typedef std::map<int, InstancedObject*> ObjectsMap;
+		protected:
+			
+			/// Parent static geometry
+			InstancedGeometry* mParent;
+			/// Scene manager link
+			SceneManager* mSceneMgr;
+			/// Scene node
+			SceneNode* mNode;
+			/// Local list of queued meshes (not used for deallocation)
+			QueuedSubMeshList mQueuedSubMeshes;
+			/// Unique identifier for the BatchInstance
+			uint32 mBatchInstanceID;
+
+			ObjectsMap mInstancesMap;
+		public:
+			/// LOD distances (squared) as built up - use the max at each level
+			std::vector<Real> mLodSquaredDistances;
+			/// Local AABB relative to BatchInstance centre
+			AxisAlignedBox mAABB;
+			/// Local bounding radius
+			Real mBoundingRadius;
+			/// The current lod level, as determined from the last camera
+			ushort mCurrentLod;
+			/// Current camera distance, passed on to do material lod later
+			Real mCamDistanceSquared;
+		protected:
+			/// List of LOD buckets			
+			LODBucketList mLodBucketList;
+
+		public:
+			BatchInstance(InstancedGeometry* parent, const String& name, SceneManager* mgr, 
+				uint32 BatchInstanceID);
+			virtual ~BatchInstance();
+			// more fields can be added in subclasses
+			InstancedGeometry* getParent(void) const { return mParent;}
+			/// Assign a queued mesh to this BatchInstance, read for final build
+			void assign(QueuedSubMesh* qmesh);
+			/// Build this BatchInstance
+			void build();
+			/// Get the BatchInstance ID of this BatchInstance
+			uint32 getID(void) const { return mBatchInstanceID; }
+			/// Get the centre point of the BatchInstance
+//			const Vector3& getCentre(void) const { return mCentre; }
+			const String& getMovableType(void) const;
+			void _notifyCurrentCamera(Camera* cam);
+			const AxisAlignedBox& getBoundingBox(void) const;
+			void  setBoundingBox(AxisAlignedBox& box);
+			Real getBoundingRadius(void) const;
+			void _updateRenderQueue(RenderQueue* queue);
+			bool isVisible(void) const;
+		//	uint32 getTypeFlags(void) const;
+
+			typedef VectorIterator<LODBucketList> LODIterator;
+			/// Get an iterator over the LODs in this BatchInstance
+			LODIterator getLODIterator(void);
+			/// Shared set of lights for all GeometryBuckets
+			const LightList& getLights(void) const;
+
+			/// update the bounding box of the BatchInstance according to the positions of the objects
+			void updateBoundingBox();
+
+			/// Dump contents for diagnostics
+			void dump(std::ofstream& of) const;
+			/// fill in the list 
+			void updateContainers(LODBucket* bucket );
+			/// attach the BatchInstance to the scene
+			void attachToScene();
+			void addInstancedObject(int index, InstancedObject* object);
+			InstancedObject*  isInstancedObjectPresent(int index);
+			InstancedObject** getObjectsAsArray(unsigned short & size);
+			SceneNode*getSceneNode(void){return mNode;}
+			ObjectsMap&getInstancesMap(void){return  mInstancesMap;};
+			/// change the shader used to render the batch instance
+			
+		};
+		/** Indexed BatchInstance map based on packed x/y/z BatchInstance index, 10 bits for
+			each axis.
+		*/
+		typedef std::map<uint32, BatchInstance*> BatchInstanceMap;
+		/** Simple vectors where are stored all the renderoperations of the Batch.
+			This vector is used when we want to delete the batch, in order to delete only one time each
+			render operation.
+
+		*/
+		typedef std::vector<RenderOperation*> RenderOperationVector;
+	protected:
+		// General state & settings
+		SceneManager* mOwner;
+		String mName;
+		bool mBuilt;
+		Real mUpperDistance;
+		Real mSquaredUpperDistance;
+		bool mCastShadows;
+		Vector3 mBatchInstanceDimensions;
+		Vector3 mHalfBatchInstanceDimensions;
+		Vector3 mOrigin;
+		bool mVisible;
+        /// The render queue to use when rendering this object
+        uint8 mRenderQueueID;
+		/// Flags whether the RenderQueue's default should be used.
+		bool mRenderQueueIDSet;
+		/// number of objects in the batch
+		unsigned int mObjectCount;
+		QueuedSubMeshList mQueuedSubMeshes;
+		BatchInstance*mInstancedGeometryInstance;
+		/**this is just a pointer to the base skeleton that will be used for each animated object in the batches
+		This pointer has a value only during the creation of the InstancedGeometry
+		*/
+		SkeletonPtr mBaseSkeleton;
+		SkeletonInstance *mSkeletonInstance;
+		/**This is the main animation state. All "objects" in the batch will use an instance of this animation
+		state
+		*/
+		AnimationStateSet* mAnimationState;
+		/// List of geometry which has been optimised for SubMesh use
+		/// This is the primary storage used for cleaning up later
+		OptimisedSubMeshGeometryList mOptimisedSubMeshGeometryList;
+
+		/** Cached links from SubMeshes to (potentially optimised) geometry
+			This is not used for deletion since the lookup may reference
+			original vertex data
+		*/
+		SubMeshGeometryLookup mSubMeshGeometryLookup;
+			
+		/// Map of BatchInstances
+		BatchInstanceMap mBatchInstanceMap;
+		/** This vector stores all the renderOperation used in the batch. 
+		See the type definition for more details.
+		*/
+		RenderOperationVector mRenderOps;
+		/** Virtual method for getting a BatchInstance most suitable for the
+			passed in bounds. Can be overridden by subclasses.
+		*/
+		virtual BatchInstance* getBatchInstance(const AxisAlignedBox& bounds, bool autoCreate);
+		/** Get the BatchInstance within which a point lies */
+		virtual BatchInstance* getBatchInstance(const Vector3& point, bool autoCreate);
+		/** Get the BatchInstance using indexes */
+		virtual BatchInstance* getBatchInstance(ushort x, ushort y, ushort z, bool autoCreate);
+		/** Get the BatchInstance using a packed index, returns null if it doesn't exist. */
+		virtual BatchInstance* getBatchInstance(uint32 index);
+		/** Get the BatchInstance indexes for a point.
+		*/
+		virtual void getBatchInstanceIndexes(const Vector3& point, 
+			ushort& x, ushort& y, ushort& z);
+		/** get the first BatchInstance or create on if it does not exists.
+		*/
+		virtual BatchInstance* getInstancedGeometryInstance(void);
+		/** Pack 3 indexes into a single index value
+		*/
+		virtual uint32 packIndex(ushort x, ushort y, ushort z);
+		/** Get the volume intersection for an indexed BatchInstance with some bounds.
+		*/
+		virtual Real getVolumeIntersection(const AxisAlignedBox& box,  
+			ushort x, ushort y, ushort z);
+		/** Get the bounds of an indexed BatchInstance.
+		*/
+		virtual AxisAlignedBox getBatchInstanceBounds(ushort x, ushort y, ushort z);
+		/** Get the centre of an indexed BatchInstance.
+		*/
+		virtual Vector3 getBatchInstanceCentre(ushort x, ushort y, ushort z);
+		/** Calculate world bounds from a set of vertex data. */
+		virtual AxisAlignedBox calculateBounds(VertexData* vertexData, 
+			const Vector3& position, const Quaternion& orientation, 
+			const Vector3& scale);
+		/** Look up or calculate the geometry data to use for this SubMesh */
+		SubMeshLodGeometryLinkList* determineGeometry(SubMesh* sm);
+		/** Split some shared geometry into dedicated geometry. */
+		void splitGeometry(VertexData* vd, IndexData* id, 
+			SubMeshLodGeometryLink* targetGeomLink);
+
+		typedef std::map<size_t, size_t> IndexRemap;
+		/** Method for figuring out which vertices are used by an index buffer
+			and calculating a remap lookup for a vertex buffer just containing
+			those vertices. 
+		*/
+		template <typename T>
+		void buildIndexRemap(T* pBuffer, size_t numIndexes, IndexRemap& remap)
+		{
+			remap.clear();
+			for (size_t i = 0; i < numIndexes; ++i)
+			{
+				// use insert since duplicates are silently discarded
+				remap.insert(IndexRemap::value_type(*pBuffer++, remap.size()));
+				// this will have mapped oldindex -> new index IF oldindex
+				// wasn't already there
+			}
+		}
+		/** Method for altering indexes based on a remap. */
+		template <typename T>
+		void remapIndexes(T* src, T* dst, const IndexRemap& remap, 
+				size_t numIndexes)
+		{
+			for (size_t i = 0; i < numIndexes; ++i)
+			{
+				// look up original and map to target
+				IndexRemap::const_iterator ix = remap.find(*src++);
+				assert(ix != remap.end());
+				*dst++ = static_cast<T>(ix->second);
+			}
+		}
+		
+	public:
+		/// Constructor; do not use directly (@see SceneManager::createInstancedGeometry)
+		InstancedGeometry(SceneManager* owner, const String& name);
+		/// Destructor
+		virtual ~InstancedGeometry();
+
+		/// Get the name of this object
+		const String& getName(void) const { return mName; }
+		/** Adds an Entity to the static geometry.
+		@remarks
+			This method takes an existing Entity and adds its details to the 
+			list of	elements to include when building. Note that the Entity
+			itself is not copied or referenced in this method; an Entity is 
+			passed simply so that you can change the materials of attached 
+			SubEntity objects if you want. You can add the same Entity 
+			instance multiple times with different material settings 
+			completely safely, and destroy the Entity before destroying 
+			this InstancedGeometry if you like. The Entity passed in is simply 
+			used as a definition.
+		@note Must be called before 'build'.
+		@param ent The Entity to use as a definition (the Mesh and Materials 
+			referenced will be recorded for the build call).
+		@param position The world position at which to add this Entity
+		@param orientation The world orientation at which to add this Entity
+		@param scale The scale at which to add this entity
+		*/
+		virtual void addEntity(Entity* ent, const Vector3& position,
+			const Quaternion& orientation = Quaternion::IDENTITY, 
+			const Vector3& scale = Vector3::UNIT_SCALE);
+
+		/** Adds all the Entity objects attached to a SceneNode and all it's
+			children to the static geometry.
+		@remarks
+			This method performs just like addEntity, except it adds all the 
+			entities attached to an entire sub-tree to the geometry. 
+			The position / orientation / scale parameters are taken from the
+			node structure instead of being specified manually. 
+		@note
+			The SceneNode you pass in will not be automatically detached from 
+			it's parent, so if you have this node already attached to the scene
+			graph, you will need to remove it if you wish to avoid the overhead
+			of rendering <i>both</i> the original objects and their new static
+			versions! We don't do this for you incase you are preparing this 
+			in advance and so don't want the originals detached yet. 
+		@note Must be called before 'build'.
+		@param node Pointer to the node to use to provide a set of Entity 
+			templates
+		*/
+		virtual void addSceneNode(const SceneNode* node);
+
+		/** Build the geometry. 
+		@remarks
+			Based on all the entities which have been added, and the batching 
+			options which have been set, this method constructs	the batched 
+			geometry structures required. The batches are added to the scene 
+			and will be rendered unless you specifically hide them.
+		@note
+			Once you have called this method, you can no longer add any more 
+			entities.
+		*/
+		virtual void build(void);
+			/** Add a new batch instance
+		@remarks
+				This method add a new instance of the whole batch, by creating a new 
+				BatchInstance, containing new lod buckets, material buckets and geometry buckets.
+				The new geometry bukets will use the same buffers as the base bucket.
+		@note
+			no note
+		*/
+		void addBatchInstance(void);
+		/** Destroys all the built geometry state (reverse of build). 
+		@remarks
+			You can call build() again after this and it will pick up all the
+			same entities / nodes you queued last time.
+		*/
+		virtual void destroy(void);
+
+		/** Clears any of the entities / nodes added to this geometry and 
+			destroys anything which has already been built.
+		*/
+		virtual void reset(void);
+
+		/** Sets the distance at which batches are no longer rendered.
+		@remarks
+			This lets you turn off batches at a given distance. This can be 
+			useful for things like detail meshes (grass, foliage etc) and could
+			be combined with a shader which fades the geometry out beforehand 
+			to lessen the effect.
+		@param dist Distance beyond which the batches will not be rendered 
+			(the default is 0, which means batches are always rendered).
+		*/
+		virtual void setRenderingDistance(Real dist) { 
+			mUpperDistance = dist; 
+			mSquaredUpperDistance = mUpperDistance * mUpperDistance;
+		}
+
+		/** Gets the distance at which batches are no longer rendered. */
+		virtual Real getRenderingDistance(void) const { return mUpperDistance; }
+
+		/** Gets the squared distance at which batches are no longer rendered. */
+		virtual Real getSquaredRenderingDistance(void) const 
+		{ return mSquaredUpperDistance; }
+
+		/** Hides or shows all the batches. */
+		virtual void setVisible(bool visible);
+
+		/** Are the batches visible? */
+		virtual bool isVisible(void) const { return mVisible; }
+
+		/** Sets whether this geometry should cast shadows.
+		@remarks
+			No matter what the settings on the original entities,
+			the InstancedGeometry class defaults to not casting shadows. 
+			This is because, being static, unless you have moving lights
+			you'd be better to use precalculated shadows of some sort.
+			However, if you need them, you can enable them using this
+			method. If the SceneManager is set up to use stencil shadows,
+			edge lists will be copied from the underlying meshes on build.
+			It is essential that all meshes support stencil shadows in this
+			case.
+		@note If you intend to use stencil shadows, you must set this to 
+			true before calling 'build' as well as making sure you set the
+			scene's shadow type (that should always be the first thing you do
+			anyway). You can turn shadows off temporarily but they can never 
+			be turned on if they were not at the time of the build. 
+		*/
+		virtual void setCastShadows(bool castShadows);
+		/// Will the geometry from this object cast shadows?
+		virtual bool getCastShadows(void) { return mCastShadows; }
+
+		/** Sets the size of a single BatchInstance of geometry.
+		@remarks
+			This method allows you to configure the physical world size of 
+			each BatchInstance, so you can balance culling against batch size. Entities
+			will be fitted within the batch they most closely fit, and the 
+			eventual bounds of each batch may well be slightly larger than this
+			if they overlap a little. The default is Vector3(1000, 1000, 1000).
+		@note Must be called before 'build'.
+		@param size Vector3 expressing the 3D size of each BatchInstance.
+		*/
+		virtual void setBatchInstanceDimensions(const Vector3& size) { 
+			mBatchInstanceDimensions = size; 
+			mHalfBatchInstanceDimensions = size * 0.5;
+		}
+		/** Gets the size of a single batch of geometry. */
+		virtual const Vector3& getBatchInstanceDimensions(void) const { return mBatchInstanceDimensions; }
+		/** Sets the origin of the geometry.
+		@remarks
+			This method allows you to configure the world centre of the geometry,
+			thus the place which all BatchInstances surround. You probably don't need 
+			to mess with this unless you have a seriously large world, since the
+			default set up can handle an area 1024 * mBatchInstanceDimensions, and 
+			the sparseness of population is no issue when it comes to rendering.
+			The default is Vector3(0,0,0).
+		@note Must be called before 'build'.
+		@param size Vector3 expressing the 3D origin of the geometry.
+		*/
+		virtual void setOrigin(const Vector3& origin) { mOrigin = origin; }
+		/** Gets the origin of this geometry. */
+		virtual const Vector3& getOrigin(void) const { return mOrigin; }
+
+        /** Sets the render queue group this object will be rendered through.
+        @remarks
+            Render queues are grouped to allow you to more tightly control the ordering
+            of rendered objects. If you do not call this method, all  objects default
+            to the default queue (RenderQueue::getDefaultQueueGroup), which is fine for 
+			most objects. You may want to alter this if you want to perform more complex
+			rendering.
+        @par
+            See RenderQueue for more details.
+        @param queueID Enumerated value of the queue group to use.
+        */
+        virtual void setRenderQueueGroup(uint8 queueID);
+
+        /** Gets the queue group for this entity, see setRenderQueueGroup for full details. */
+        virtual uint8 getRenderQueueGroup(void) const;
+		/// Iterator for iterating over contained BatchInstances
+		typedef MapIterator<BatchInstanceMap> BatchInstanceIterator;
+		/// Get an iterator over the BatchInstances in this geometry
+		BatchInstanceIterator getBatchInstanceIterator(void);
+		/// get the mRenderOps vector.
+		RenderOperationVector& getRenderOperationVector(){return mRenderOps;}
+		/** Dump the contents of this InstancedGeometry to a file for diagnostic
+		 	purposes.
+		*/
+		virtual void dump(const String& filename) const;
+		/**
+		@remarks
+		Return the skeletonInstance that will be used 
+		*/
+		SkeletonInstance *getBaseSkeletonInstance(void){return mSkeletonInstance;}
+		/**
+		@remarks
+		Return the skeleton that is shared by all instanced objects.
+		*/
+		SkeletonPtr getBaseSkeleton(void){return mBaseSkeleton;}
+		/**
+		@remarks
+		Return the animation state that will be cloned each time an InstancedObject is made
+		*/
+		AnimationStateSet* getBaseAnimationState(void){return mAnimationState;}
+		/**
+		@remarks
+		return the total number of object that are in all the batches
+		*/
+		unsigned int getObjectCount(void){return mObjectCount;}
+		                  
+
+
+	};
+
+}
+
+#endif
+
Index: /OgreMain/include/OgreIteratorWrappers.h
===================================================================
--- /OgreMain/include/OgreIteratorWrappers.h	(revision 5)
+++ /OgreMain/include/OgreIteratorWrappers.h	(revision 5)
@@ -0,0 +1,359 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __IteratorWrappers_H__
+#define __IteratorWrappers_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+    /** Wraps iteration over a vector.
+    @remarks
+        This class is here just to allow clients to iterate over an internal
+        vector of a class without having to have access to the vector itself
+        (typically to iterate you need both the iterator and the end() iterator
+        to test for the end condition, which is messy).
+        No updates are allowed through this interface, it is purely for 
+        iterating and reading.
+    @par
+        Note that like STL iterators, these iterators are only valid whilst no 
+        updates are made to the underlying collection. You should not attempt to
+        use this iterator if a change is made to the collection. In fact, treat this
+        iterator as a transient object, do NOT store it and try to use it repeatedly.
+    */
+    template <class T>
+    class VectorIterator
+    {
+    private:
+        typename T::iterator mCurrent;
+        typename T::iterator mEnd;
+		/// Private constructor since only the parameterised constructor should be used
+        VectorIterator() {};
+    public:
+        typedef typename T::value_type ValueType;
+
+        /** Constructor.
+        @remarks
+            Provide a start and end iterator to initialise.
+        */
+        VectorIterator(typename T::iterator start, typename T::iterator end)
+            : mCurrent(start), mEnd(end)
+        {
+        }
+
+        /** Constructor.
+        @remarks
+            Provide a container to initialise.
+        */
+        explicit VectorIterator(T& c)
+            : mCurrent(c.begin()), mEnd(c.end())
+        {
+        }
+
+        /** Returns true if there are more items in the collection. */
+        bool hasMoreElements(void) const
+        {
+            return mCurrent != mEnd;
+        }
+
+        /** Returns the next element in the collection, and advances to the next. */
+        typename T::value_type getNext(void)
+        {
+            return *mCurrent++;
+        }
+        /** Returns the next element in the collection, without advancing to the next. */
+        typename T::value_type peekNext(void)
+        {
+            return *mCurrent;
+        }
+        /** Returns a pointer to the next element in the collection, without advancing to the next afterwards. */
+        typename T::pointer peekNextPtr(void)
+        {
+            return &(*mCurrent);
+        }
+        /** Moves the iterator on one element. */
+        void moveNext(void)
+        {
+            ++mCurrent;
+        }
+
+
+
+    };
+
+    /** Wraps iteration over a map.
+    @remarks
+        This class is here just to allow clients to iterate over an internal
+        map of a class without having to have access to the map itself
+        (typically to iterate you need both the iterator and the end() iterator
+        to test for the end condition, which is messy).
+        No updates are allowed through this interface, it is purely for 
+        iterating and reading.
+    @par
+        Note that like STL iterators, these iterators are only valid whilst no 
+        updates are made to the underlying collection. You should not attempt to
+        use this iterator if a change is made to the collection. In fact, treat this
+        iterator as a transient object, do NOT store it and try to use it repeatedly.
+    */
+    template <class T>
+    class MapIterator
+    {
+    private:
+        typename T::iterator mCurrent;
+        typename T::iterator mEnd;
+        /// Private constructor since only the parameterised constructor should be used
+        MapIterator() {};
+    public:
+        typedef typename T::mapped_type MappedType;
+        typedef typename T::key_type KeyType;
+
+        /** Constructor.
+        @remarks
+            Provide a start and end iterator to initialise.
+        */
+        MapIterator(typename T::iterator start, typename T::iterator end)
+            : mCurrent(start), mEnd(end)
+        {
+        }
+
+        /** Constructor.
+        @remarks
+            Provide a container to initialise.
+        */
+        explicit MapIterator(T& c)
+            : mCurrent(c.begin()), mEnd(c.end())
+        {
+        }
+
+        /** Returns true if there are more items in the collection. */
+        bool hasMoreElements(void) const
+        {
+            return mCurrent != mEnd;
+        }
+
+        /** Returns the next value element in the collection, and advances to the next. */
+        typename T::mapped_type getNext(void)
+        {
+            return (mCurrent++)->second;
+        }
+        /** Returns the next value element in the collection, without advancing to the next. */
+        typename T::mapped_type peekNextValue(void)
+        {
+            return mCurrent->second;
+        }
+        /** Returns the next key element in the collection, without advancing to the next. */
+        typename T::key_type peekNextKey(void)
+        {
+            return mCurrent->first;
+        }
+        /** Required to overcome intermittent bug */
+ 	    MapIterator<T> & operator=( MapIterator<T> &rhs )
+ 	    {
+ 		    mCurrent = rhs.mCurrent;
+ 		    mEnd = rhs.mEnd;
+ 		    return *this;
+ 	    }
+        /** Returns a pointer to the next value element in the collection, without 
+            advancing to the next afterwards. */
+        typename T::mapped_type* peekNextValuePtr(void)
+        {
+            return &(mCurrent->second);
+        }
+        /** Moves the iterator on one element. */
+        void moveNext(void)
+        {
+            ++mCurrent;
+        }
+
+
+
+    };
+    /** Wraps iteration over a const vector.
+    @remarks
+    This class is here just to allow clients to iterate over an internal
+    vector of a class without having to have access to the vector itself
+    (typically to iterate you need both the iterator and the end() iterator
+    to test for the end condition, which is messy).
+    No updates are allowed through this interface, it is purely for 
+    iterating and reading.
+    @par
+    Note that like STL iterators, these iterators are only valid whilst no 
+    updates are made to the underlying collection. You should not attempt to
+    use this iterator if a change is made to the collection. In fact, treat this
+    iterator as a transient object, do NOT store it and try to use it repeatedly.
+    */
+    template <class T>
+    class ConstVectorIterator
+    {
+    private:
+        mutable typename T::const_iterator mCurrent;
+        typename T::const_iterator mEnd;
+        /// Private constructor since only the parameterised constructor should be used
+        ConstVectorIterator() {};
+    public:
+        typedef typename T::value_type ValueType;
+
+        /** Constructor.
+        @remarks
+        Provide a start and end iterator to initialise.
+        */
+        ConstVectorIterator(typename T::const_iterator start, typename T::const_iterator end)
+            : mCurrent(start), mEnd(end)
+        {
+        }
+
+        /** Constructor.
+        @remarks
+            Provide a container to initialise.
+        */
+        explicit ConstVectorIterator(const T& c)
+            : mCurrent(c.begin()), mEnd(c.end())
+        {
+        }
+
+        /** Returns true if there are more items in the collection. */
+        bool hasMoreElements(void) const
+        {
+            return mCurrent != mEnd;
+        }
+
+        /** Returns the next element in the collection, and advances to the next. */
+        typename T::value_type getNext(void)
+        {
+            return *mCurrent++;
+        }
+        /** Returns the next element in the collection, without advancing to the next. */
+        typename T::value_type peekNext(void) const
+        {
+            return *mCurrent;
+        }
+        /** Returns a pointer to the next element in the collection, without advancing to the next afterwards. */
+        typename T::const_pointer peekNextPtr(void) const
+        {
+            return &(*mCurrent);
+        }
+        /** Moves the iterator on one element. */
+        void moveNext(void) const
+        {
+            ++mCurrent;
+        }
+
+
+
+    };
+
+    /** Wraps iteration over a const map.
+    @remarks
+    This class is here just to allow clients to iterate over an internal
+    map of a class without having to have access to the map itself
+    (typically to iterate you need both the iterator and the end() iterator
+    to test for the end condition, which is messy).
+    No updates are allowed through this interface, it is purely for 
+    iterating and reading.
+    @par
+    Note that like STL iterators, these iterators are only valid whilst no 
+    updates are made to the underlying collection. You should not attempt to
+    use this iterator if a change is made to the collection. In fact, treat this
+    iterator as a transient object, do NOT store it and try to use it repeatedly.
+    */
+    template <class T>
+    class ConstMapIterator
+    {
+    private:
+        mutable typename T::const_iterator mCurrent;
+        typename T::const_iterator mEnd;
+        /// Private constructor since only the parameterised constructor should be used
+        ConstMapIterator() {};
+    public:
+        typedef typename T::mapped_type MappedType;
+        typedef typename T::key_type KeyType;
+
+        /** Constructor.
+        @remarks
+        Provide a start and end iterator to initialise.
+        */
+        ConstMapIterator(typename T::const_iterator start, typename T::const_iterator end)
+            : mCurrent(start), mEnd(end)
+        {
+        }
+
+        /** Constructor.
+        @remarks
+            Provide a container to initialise.
+        */
+        explicit ConstMapIterator(const T& c)
+            : mCurrent(c.begin()), mEnd(c.end())
+        {
+        }
+
+        /** Returns true if there are more items in the collection. */
+        bool hasMoreElements(void) const
+        {
+            return mCurrent != mEnd;
+        }
+
+        /** Returns the next value element in the collection, and advances to the next. */
+        typename T::mapped_type getNext(void)
+        {
+            return (mCurrent++)->second;
+        }
+        /** Returns the next value element in the collection, without advancing to the next. */
+        typename T::mapped_type peekNextValue(void) const
+        {
+            return mCurrent->second;
+        }
+        /** Returns the next key element in the collection, without advancing to the next. */
+        typename T::key_type peekNextKey(void) const
+        {
+            return mCurrent->first;
+        }
+        /** Required to overcome intermittent bug */
+        ConstMapIterator<T> & operator=( ConstMapIterator<T> &rhs )
+        {
+            mCurrent = rhs.mCurrent;
+            mEnd = rhs.mEnd;
+            return *this;
+        }
+        /** Returns a pointer to the next value element in the collection, without 
+        advancing to the next afterwards. */
+        const typename T::mapped_type* peekNextValuePtr(void) const
+        {
+            return &(mCurrent->second);
+        }
+        /** Moves the iterator on one element. */
+        void moveNext(void) const
+        {
+            ++mCurrent;
+        }
+
+
+
+    };
+}
+#endif
Index: /OgreMain/include/OgreKeyFrame.h
===================================================================
--- /OgreMain/include/OgreKeyFrame.h	(revision 5)
+++ /OgreMain/include/OgreKeyFrame.h	(revision 5)
@@ -0,0 +1,248 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __KeyFrame_H__
+#define __KeyFrame_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreVector3.h"
+#include "OgreQuaternion.h"
+#include "OgreAny.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre 
+{
+
+    /** A key frame in an animation sequence defined by an AnimationTrack.
+    @remarks
+        This class can be used as a basis for all kinds of key frames. 
+        The unifying principle is that multiple KeyFrames define an 
+        animation sequence, with the exact state of the animation being an 
+        interpolation between these key frames. 
+    */
+    class _OgreExport KeyFrame
+    {
+    public:
+
+        /** Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead. */
+        KeyFrame(const AnimationTrack* parent, Real time);
+
+		virtual ~KeyFrame() {}
+
+        /** Gets the time of this keyframe in the animation sequence. */
+        Real getTime(void) const { return mTime; }
+
+		/** Clone a keyframe (internal use only) */
+		virtual KeyFrame* _clone(AnimationTrack* newParent) const;
+
+
+    protected:
+        Real mTime;
+        const AnimationTrack* mParentTrack;
+    };
+
+
+	/** Specialised KeyFrame which stores any numeric value.
+	*/
+	class _OgreExport NumericKeyFrame : public KeyFrame
+	{
+	public:
+		/** Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead. */
+		NumericKeyFrame(const AnimationTrack* parent, Real time);
+		~NumericKeyFrame() {}
+
+		/** Get the value at this keyframe. */
+		virtual const AnyNumeric& getValue(void) const;
+		/** Set the value at this keyframe.
+		@remarks
+			All keyframe values must have a consistent type. 
+		*/
+		virtual void setValue(const AnyNumeric& val);
+
+		/** Clone a keyframe (internal use only) */
+		KeyFrame* _clone(AnimationTrack* newParent) const;
+	protected:
+		AnyNumeric mValue;
+	};
+
+
+	/** Specialised KeyFrame which stores a full transform. */
+	class _OgreExport TransformKeyFrame : public KeyFrame
+	{
+	public:
+		/** Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead. */
+		TransformKeyFrame(const AnimationTrack* parent, Real time);
+		~TransformKeyFrame() {}
+		/** Sets the translation associated with this keyframe. 
+		@remarks    
+		The translation factor affects how much the keyframe translates (moves) it's animable
+		object at it's time index.
+		@param trans The vector to translate by
+		*/
+		virtual void setTranslate(const Vector3& trans);
+
+		/** Gets the translation applied by this keyframe. */
+		const Vector3& getTranslate(void) const;
+
+		/** Sets the scaling factor applied by this keyframe to the animable
+		object at it's time index.
+		@param scale The vector to scale by (beware of supplying zero values for any component of this
+		vector, it will scale the object to zero dimensions)
+		*/
+		virtual void setScale(const Vector3& scale);
+
+		/** Gets the scaling factor applied by this keyframe. */
+		virtual const Vector3& getScale(void) const;
+
+		/** Sets the rotation applied by this keyframe.
+		@param rot The rotation applied; use Quaternion methods to convert from angle/axis or Matrix3 if
+		you don't like using Quaternions directly.
+		*/
+		virtual void setRotation(const Quaternion& rot);
+
+		/** Gets the rotation applied by this keyframe. */
+		virtual const Quaternion& getRotation(void) const;
+
+		/** Clone a keyframe (internal use only) */
+		KeyFrame* _clone(AnimationTrack* newParent) const;
+	protected:
+		Vector3 mTranslate;
+		Vector3 mScale;
+		Quaternion mRotate;
+
+
+	};
+
+
+
+	/** Specialised KeyFrame which stores absolute vertex positions for a complete
+		buffer, designed to be interpolated with other keys in the same track. 
+	*/
+	class _OgreExport VertexMorphKeyFrame : public KeyFrame
+	{
+	public:
+		/** Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead. */
+		VertexMorphKeyFrame(const AnimationTrack* parent, Real time);
+		~VertexMorphKeyFrame() {}
+		/** Sets the vertex buffer containing the source positions for this keyframe. 
+		@remarks    
+			We assume that positions are the first 3 float elements in this buffer,
+			although we don't necessarily assume they're the only ones in there.
+		@param buf Vertex buffer link; will not be modified so can be shared
+			read-only data
+		*/
+		void setVertexBuffer(const HardwareVertexBufferSharedPtr& buf);
+
+		/** Gets the vertex buffer containing positions for this keyframe. */
+		const HardwareVertexBufferSharedPtr& getVertexBuffer(void) const;
+
+		/** Clone a keyframe (internal use only) */
+		KeyFrame* _clone(AnimationTrack* newParent) const;		
+
+	protected:
+		HardwareVertexBufferSharedPtr mBuffer;
+
+	};
+
+	/** Specialised KeyFrame which references a Mesh::Pose at a certain influence
+		level, which stores offsets for a subset of the vertices 
+		in a buffer to provide a blendable pose.
+	*/
+	class _OgreExport VertexPoseKeyFrame : public KeyFrame
+	{
+	public:
+		/** Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead. */
+		VertexPoseKeyFrame(const AnimationTrack* parent, Real time);
+		~VertexPoseKeyFrame() {}
+
+		/** Reference to a pose at a given influence level 
+		@remarks
+			Each keyframe can refer to many poses each at a given influence level.
+		**/
+		struct PoseRef
+		{
+			/** The linked pose index.
+			@remarks
+				The Mesh contains all poses for all vertex data in one list, both 
+				for the shared vertex data and the dedicated vertex data on submeshes.
+				The 'target' on the parent track must match the 'target' on the 
+				linked pose.
+			*/
+			ushort poseIndex;
+			/** Influence level of the linked pose. 
+				1.0 for full influence (full offset), 0.0 for no influence.
+			*/
+			Real influence;
+
+			PoseRef(ushort p, Real i) : poseIndex(p), influence(i) {}
+		};
+		typedef std::vector<PoseRef> PoseRefList;
+
+		/** Add a new pose reference. 
+		@see PoseRef
+		*/
+		void addPoseReference(ushort poseIndex, Real influence);
+		/** Update the influence of a pose reference. 
+		@see PoseRef
+		*/
+		void updatePoseReference(ushort poseIndex, Real influence);
+		/** Remove reference to a given pose. 
+		@param poseIndex The pose index (not the index of the reference)
+		*/
+		void removePoseReference(ushort poseIndex);
+		/** Remove all pose references. */
+		void removeAllPoseReferences(void);
+
+
+		/** Get a const reference to the list of pose references. */
+		const PoseRefList& getPoseReferences(void) const;
+
+		typedef VectorIterator<PoseRefList> PoseRefIterator;
+		typedef ConstVectorIterator<PoseRefList> ConstPoseRefIterator;
+
+		/** Get an iterator over the pose references. */
+		PoseRefIterator getPoseReferenceIterator(void);
+
+		/** Get a const iterator over the pose references. */
+		ConstPoseRefIterator getPoseReferenceIterator(void) const;
+
+		/** Clone a keyframe (internal use only) */
+		KeyFrame* _clone(AnimationTrack* newParent) const;
+		
+	protected:
+		PoseRefList mPoseRefs;
+
+	};
+
+}
+
+
+#endif
+
Index: /OgreMain/include/OgreLight.h
===================================================================
--- /OgreMain/include/OgreLight.h	(revision 5)
+++ /OgreMain/include/OgreLight.h	(revision 5)
@@ -0,0 +1,433 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _LIGHT_H__
+#define _LIGHT_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreColourValue.h"
+#include "OgreVector3.h"
+#include "OgreVector4.h"
+#include "OgreString.h"
+#include "OgreMovableObject.h"
+#include "OgrePlaneBoundedVolume.h"
+#include "OgreShadowCameraSetup.h"
+
+namespace Ogre {
+
+
+    /** Representation of a dynamic light source in the scene.
+        @remarks
+            Lights are added to the scene like any other object. They contain various
+            parameters like type, position, attenuation (how light intensity fades with
+            distance), colour etc.
+        @par
+            The defaults when a light is created is pure white diffues light, with no
+            attenuation (does not decrease with distance) and a range of 1000 world units.
+        @par
+            Lights are created by using the SceneManager::createLight method. They can subsequently be
+            added to a SceneNode if required to allow them to move relative to a node in the scene. A light attached
+            to a SceneNode is assumed to havea base position of (0,0,0) and a direction of (0,0,1) before modification
+            by the SceneNode's own orientation. If not attached to a SceneNode,
+            the light's position and direction is as set using setPosition and setDirection.
+        @par
+            Remember also that dynamic lights rely on modifying the colour of vertices based on the position of
+            the light compared to an object's vertex normals. Dynamic lighting will only look good if the
+            object being lit has a fair level of tesselation and the normals are properly set. This is particularly
+            true for the spotlight which will only look right on highly tesselated models. In the future OGRE may be
+            extended for certain scene types so an alternative to the standard dynamic lighting may be used, such
+            as dynamic lightmaps.
+    */
+    class _OgreExport Light : public MovableObject
+    {
+    public:
+        /// Temp tag used for sorting
+        Real tempSquareDist;
+
+        /// Defines the type of light
+        enum LightTypes
+        {
+            /// Point light sources give off light equally in all directions, so require only position not direction
+            LT_POINT,
+            /// Directional lights simulate parallel light beams from a distant source, hence have direction but no position
+            LT_DIRECTIONAL,
+            /// Spotlights simulate a cone of light from a source so require position and direction, plus extra values for falloff
+            LT_SPOTLIGHT
+        };
+
+        /** Default constructor (for Python mainly).
+        */
+        Light();
+
+        /** Normal constructor. Should not be called directly, but rather the SceneManager::createLight method should be used.
+        */
+        Light(const String& name);
+
+        /** Standard destructor.
+        */
+        ~Light();
+
+        /** Sets the type of light - see LightTypes for more info.
+        */
+        void setType(LightTypes type);
+
+        /** Returns the light type.
+        */
+        LightTypes getType(void) const;
+
+        /** Sets the colour of the diffuse light given off by this source.
+            @remarks
+                Material objects have ambient, diffuse and specular values which indicate how much of each type of
+                light an object reflects. This value denotes the amount and colour of this type of light the light
+                exudes into the scene. The actual appearance of objects is a combination of the two.
+            @par
+                Diffuse light simulates the typical light emenating from light sources and affects the base colour
+                of objects together with ambient light.
+        */
+        void setDiffuseColour(Real red, Real green, Real blue);
+
+        /** Sets the colour of the diffuse light given off by this source.
+            @remarks
+                Material objects have ambient, diffuse and specular values which indicate how much of each type of
+                light an object reflects. This value denotes the amount and colour of this type of light the light
+                exudes into the scene. The actual appearance of objects is a combination of the two.
+            @par
+                Diffuse light simulates the typical light emenating from light sources and affects the base colour
+                of objects together with ambient light.
+        */
+        void setDiffuseColour(const ColourValue& colour);
+
+        /** Returns the colour of the diffuse light given off by this light source (see setDiffuseColour for more info).
+        */
+        const ColourValue& getDiffuseColour(void) const;
+
+        /** Sets the colour of the specular light given off by this source.
+            @remarks
+                Material objects have ambient, diffuse and specular values which indicate how much of each type of
+                light an object reflects. This value denotes the amount and colour of this type of light the light
+                exudes into the scene. The actual appearance of objects is a combination of the two.
+            @par
+                Specular light affects the appearance of shiny highlights on objects, and is also dependent on the
+                'shininess' Material value.
+        */
+        void setSpecularColour(Real red, Real green, Real blue);
+
+        /** Sets the colour of the specular light given off by this source.
+            @remarks
+                Material objects have ambient, diffuse and specular values which indicate how much of each type of
+                light an object reflects. This value denotes the amount and colour of this type of light the light
+                exudes into the scene. The actual appearance of objects is a combination of the two.
+            @par
+                Specular light affects the appearance of shiny highlights on objects, and is also dependent on the
+                'shininess' Material value.
+        */
+        void setSpecularColour(const ColourValue& colour);
+
+        /** Returns the colour of specular light given off by this light source.
+        */
+        const ColourValue& getSpecularColour(void) const;
+
+        /** Sets the attenuation parameters of the light source ie how it diminishes with distance.
+            @remarks
+                Lights normally get fainter the further they are away. Also, each light is given a maximum range
+                beyond which it cannot affect any objects.
+            @par
+                Light attentuation is not applicable to directional lights since they have an infinite range and
+                constant intensity.
+            @par
+                This follows a standard attenuation approach - see any good 3D text for the details of what they mean
+                since i don't have room here!
+            @param
+                range The absolute upper range of the light in world units
+            @param
+                constant The constant factor in the attenuation formula: 1.0 means never attenuate, 0.0 is complete attenuation
+            @param
+                linear The linear factor in the attenuation formula: 1 means attenuate evenly over the distance
+            @param
+                quadratic The quadratic factor in the attenuation formula: adds a curvature to the attenuation formula.
+        */
+        void setAttenuation(Real range, Real constant, Real linear, Real quadratic);
+
+        /** Returns the absolute upper range of the light.
+        */
+        Real getAttenuationRange(void) const;
+
+        /** Returns the constant factor in the attenuation formula.
+        */
+        Real getAttenuationConstant(void) const;
+
+        /** Returns the linear factor in the attenuation formula.
+        */
+        Real getAttenuationLinear(void) const;
+
+        /** Returns the quadric factor in the attenuation formula.
+        */
+        Real getAttenuationQuadric(void) const;
+
+        /** Sets the position of the light.
+            @remarks
+                Applicable to point lights and spotlights only.
+            @note
+                This will be overridden if the light is attached to a SceneNode.
+        */
+        void setPosition(Real x, Real y, Real z);
+
+        /** Sets the position of the light.
+            @remarks
+                Applicable to point lights and spotlights only.
+            @note
+                This will be overridden if the light is attached to a SceneNode.
+        */
+        void setPosition(const Vector3& vec);
+
+        /** Returns the position of the light.
+            @note
+                Applicable to point lights and spotlights only.
+        */
+        const Vector3& getPosition(void) const;
+
+        /** Sets the direction in which a light points.
+            @remarks
+                Applicable only to the spotlight and directional light types.
+            @note
+                This will be overridden if the light is attached to a SceneNode.
+        */
+        void setDirection(Real x, Real y, Real z);
+
+        /** Sets the direction in which a light points.
+            @remarks
+                Applicable only to the spotlight and directional light types.
+            @note
+                This will be overridden if the light is attached to a SceneNode.
+        */
+        void setDirection(const Vector3& vec);
+
+        /** Returns the light's direction.
+            @remarks
+                Applicable only to the spotlight and directional light types.
+        */
+        const Vector3& getDirection(void) const;
+
+        /** Sets the range of a spotlight, i.e. the angle of the inner and outer cones and the rate of falloff between them.
+            @param
+                innerAngle Angle covered by the bright inner cone
+                @node
+                    The inner cone applicable only to Direct3D, it'll always treat as zero in OpenGL.
+            @param
+                outerAngle Angle covered by the outer cone
+            @param
+                falloff The rate of falloff between the inner and outer cones. 1.0 means a linear falloff, less means slower falloff, higher means faster falloff.
+        */
+        void setSpotlightRange(const Radian& innerAngle, const Radian& outerAngle, Real falloff = 1.0);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void setSpotlightRange(Real innerAngle, Real outerAngle, Real falloff = 1.0) {
+            setSpotlightRange ( Angle(innerAngle), Angle(outerAngle), falloff );
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Returns the angle covered by the spotlights inner cone.
+        */
+        const Radian& getSpotlightInnerAngle(void) const;
+
+        /** Returns the angle covered by the spotlights outer cone.
+        */
+        const Radian& getSpotlightOuterAngle(void) const;
+
+        /** Returns the falloff between the inner and outer cones of the spotlight.
+        */
+        Real getSpotlightFalloff(void) const;
+
+		/** Sets the angle covered by the spotlights inner cone.
+		*/
+		void setSpotlightInnerAngle(const Radian& val);
+
+		/** Sets the angle covered by the spotlights outer cone.
+		*/
+		void setSpotlightOuterAngle(const Radian& val);
+
+		/** Sets the falloff between the inner and outer cones of the spotlight.
+		*/
+		void setSpotlightFalloff(Real val);
+
+		/** Set a scaling factor to indicate the relative power of a light.
+		@remarks
+			This factor is only useful in High Dynamic Range (HDR) rendering.
+			You can bind it to a shader variable to take it into account,
+			@see GpuProgramParameters
+		@param power The power rating of this light, default is 1.0.
+		*/
+		void setPowerScale(Real power);
+
+		/** Set the scaling factor which indicates the relative power of a 
+			light.
+		*/
+		Real getPowerScale(void) const;
+
+        /** Overridden from MovableObject */
+        void _notifyAttached(Node* parent, bool isTagPoint = false);
+
+        /** Overridden from MovableObject */
+        void _notifyMoved(void);
+
+        /** Overridden from MovableObject */
+        const AxisAlignedBox& getBoundingBox(void) const;
+
+        /** Overridden from MovableObject */
+        void _updateRenderQueue(RenderQueue* queue);
+
+        /** Overridden from MovableObject */
+        const String& getMovableType(void) const;
+
+        /** Retrieves the position of the light including any transform from nodes it is attached to. */
+        const Vector3& getDerivedPosition(void) const;
+
+        /** Retrieves the direction of the light including any transform from nodes it is attached to. */
+        const Vector3& getDerivedDirection(void) const;
+
+        /** Overridden from MovableObject.
+        @remarks
+            Although lights themselves are not 'visible', setting a light to invisible
+            means it no longer affects the scene.
+        */
+        void setVisible(bool visible);
+
+        /** Overridden from MovableObject */
+        Real getBoundingRadius(void) const { return 0; /* not visible */ }
+
+		/** Gets the details of this light as a 4D vector.
+		@remarks
+			Getting details of a light as a 4D vector can be useful for
+			doing general calculations between different light types; for
+			example the vector can represent both position lights (w=1.0f)
+			and directional lights (w=0.0f) and be used in the same 
+			calculations.
+		*/
+		Vector4 getAs4DVector(void) const;
+
+        /** Internal method for calculating the 'near clip volume', which is
+            the volume formed between the near clip rectangle of the 
+            camera and the light.
+        @remarks This volume is a pyramid for a point/spot light and
+            a cuboid for a directional light. It can used to detect whether
+            an object could be casting a shadow on the viewport. Note that
+            the reference returned is to a shared volume which will be 
+            reused across calls to this method.
+        */
+        virtual const PlaneBoundedVolume& _getNearClipVolume(const Camera* const cam) const;
+
+        /** Internal method for calculating the clip volumes outside of the 
+            frustum which can be used to determine which objects are casting
+            shadow on the frustum as a whole. 
+        @remarks Each of the volumes is a pyramid for a point/spot light and
+            a cuboid for a directional light. 
+        */
+        virtual const PlaneBoundedVolumeList& _getFrustumClipVolumes(const Camera* const cam) const;
+
+		/// Override to return specific type flag
+		uint32 getTypeFlags(void) const;
+
+		/// @copydoc AnimableObject::createAnimableValue
+		AnimableValuePtr createAnimableValue(const String& valueName);
+
+		/** Set this light to use a custom shadow camera when rendering texture shadows.
+		@remarks
+			This changes the shadow camera setup for just this light,  you can set
+			the shadow camera setup globally using SceneManager::setShadowCameraSetup
+		@see ShadowCameraSetup
+		*/
+		void setCustomShadowCameraSetup(const ShadowCameraSetupPtr& customShadowSetup);
+
+		/** Reset the shadow camera setup to the default. 
+		@see ShadowCameraSetup
+		*/
+		void resetCustomShadowCameraSetup(void);
+
+		/** return a pointer to the custom shadow camera setup (null means use SceneManager global version). */
+		const ShadowCameraSetupPtr& getCustomShadowCameraSetup(void) const;
+
+    protected:
+        /// internal method for synchronising with parent node (if any)
+        virtual void update(void) const;
+
+		/// @copydoc AnimableObject::getAnimableDictionaryName
+		const String& getAnimableDictionaryName(void) const;
+		/// @copydoc AnimableObject::initialiseAnimableDictionary
+		void initialiseAnimableDictionary(StringVector& vec) const;
+
+		LightTypes mLightType;
+        Vector3 mPosition;
+        ColourValue mDiffuse;
+        ColourValue mSpecular;
+
+        Vector3 mDirection;
+
+        Radian mSpotOuter;
+        Radian mSpotInner;
+        Real mSpotFalloff;
+        Real mRange;
+        Real mAttenuationConst;
+        Real mAttenuationLinear;
+        Real mAttenuationQuad;
+		Real mPowerScale;
+
+
+        mutable Vector3 mDerivedPosition;
+        mutable Vector3 mDerivedDirection;
+
+        /// Shared class-level name for Movable type
+        static String msMovableType;
+
+        mutable PlaneBoundedVolume mNearClipVolume;
+        mutable PlaneBoundedVolumeList mFrustumClipVolumes;
+        /// Is the derived transform dirty?
+        mutable bool mDerivedTransformDirty;
+
+		/// Pointer to a custom shadow camera setup
+		mutable ShadowCameraSetupPtr mCustomShadowCameraSetup;
+
+    };
+
+	/** Factory object for creating Light instances */
+	class _OgreExport LightFactory : public MovableObjectFactory
+	{
+	protected:
+		MovableObject* createInstanceImpl( const String& name, const NameValuePairList* params);
+	public:
+		LightFactory() {}
+		~LightFactory() {}
+
+		static String FACTORY_TYPE_NAME;
+
+		const String& getType(void) const;
+		void destroyInstance( MovableObject* obj);  
+
+	};
+
+} // Namespace
+#endif
Index: /OgreMain/include/OgreLog.h
===================================================================
--- /OgreMain/include/OgreLog.h	(revision 5)
+++ /OgreMain/include/OgreLog.h	(revision 5)
@@ -0,0 +1,149 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __Log_H__
+#define __Log_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+    // LogMessageLevel + LoggingLevel > OGRE_LOG_THRESHOLD = message logged
+    #define OGRE_LOG_THRESHOLD 4
+
+    /** The level of detail to which the log will go into.
+    */
+    enum LoggingLevel
+    {
+        LL_LOW = 1,
+        LL_NORMAL = 2,
+        LL_BOREME = 3
+    };
+
+    /** The importance of a logged message.
+    */
+    enum LogMessageLevel
+    {
+        LML_TRIVIAL = 1,
+        LML_NORMAL = 2,
+        LML_CRITICAL = 3
+    };
+
+    /** @remarks Pure Abstract class, derive this class and register to the Log to listen to log messages */
+    class LogListener
+    {
+	public:
+        virtual ~LogListener() {};
+
+        /**
+        @remarks
+            This is called whenever the log recieves a message and is about to write it out
+        @param message
+            The message to be logged
+        @param lml
+            The message level the log is using
+        @param maskDebug
+            If we are printing to the console or not
+        @param logName
+            the name of this log (so you can have several listeners for different logs, and identify them)
+        */
+        virtual void messageLogged( const String& message, LogMessageLevel lml, bool maskDebug, const String &logName ) = 0;
+    };
+
+    /**
+    @remarks
+         Log class for writing debug/log data to files.
+    @note
+        <br>Should not be used directly, but trough the LogManager class.
+    */
+    class _OgreExport Log
+    {
+    protected:
+        std::ofstream	mfpLog;
+        LoggingLevel	mLogLevel;
+        bool			mDebugOut;
+        bool			mSuppressFile;
+        String			mLogName;
+
+        typedef std::vector<LogListener*> mtLogListener;
+        mtLogListener mListeners;
+
+    public:
+		OGRE_AUTO_MUTEX // public to allow external locking
+        /**
+        @remarks
+            Usual constructor - called by LogManager.
+        */
+        Log( const String& name, bool debugOutput = true, bool suppressFileOutput = false);
+
+        /**
+        @remarks
+        Default destructor.
+        */
+        ~Log();
+
+		/// Return the name of the log
+		const String& getName() const { return mLogName; }
+		/// Get whether debug output is enabled for this log
+		bool isDebugOutputEnabled() const { return mDebugOut; }
+		/// Get whether file output is suppressed for this log
+		bool isFileOutputSuppressed() const { return mSuppressFile; }
+
+        /** Log a message to the debugger and to log file (the default is
+            "<code>OGRE.log</code>"),
+        */
+        void logMessage( const String& message, LogMessageLevel lml = LML_NORMAL, bool maskDebug = false );
+
+        /**
+        @remarks
+            Sets the level of the log detail.
+        */
+        void setLogDetail(LoggingLevel ll);
+		/** Gets the level of the log detail.
+		*/
+		LoggingLevel getLogDetail() const { return mLogLevel; }
+        /**
+        @remarks
+            Register a listener to this log
+        @param
+            A valid listener derived class
+        */
+        void addListener(LogListener* listener);
+
+        /**
+        @remarks
+            Unregister a listener from this log
+        @param
+            A valid listener derived class
+        */
+        void removeListener(LogListener* listener);
+    };
+}
+
+#endif
Index: /OgreMain/include/OgreLogManager.h
===================================================================
--- /OgreMain/include/OgreLogManager.h	(revision 5)
+++ /OgreMain/include/OgreLogManager.h	(revision 5)
@@ -0,0 +1,163 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __LogManager_H__
+#define __LogManager_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreLog.h"
+#include "OgreSingleton.h"
+#include "OgreString.h"
+
+namespace Ogre
+{
+    /** The log manager handles the creation and retrieval of logs for the
+        application.
+        @remarks
+            This class will create new log files and will retrieve instances
+            of existing ones. Other classes wishing to log output can either
+            create a fresh log or retrieve an existing one to output to.
+            One log is the default log, and is the one written to when the
+            logging methods of this class are called.
+		@par
+			By default, Root will instantiate a LogManager (which becomes the 
+			Singleton instance) on construction, and will create a default log
+			based on the Root construction parameters. If you want more control,
+			for example redirecting log output right from the start or suppressing
+			debug output, you need to create a LogManager yourself before creating
+			a Root instance, then create a default log. Root will detect that 
+			you've created one yourself and won't create one of its own, thus
+			using all your logging preferences from the first instance.
+    */
+    class _OgreExport LogManager : public Singleton<LogManager>
+    {
+	protected:
+        typedef std::map<String, Log*, std::less<String> >	LogList;
+
+        /// A list of all the logs the manager can access
+        LogList mLogs;
+
+        /// The default log to which output is done
+        Log* mDefaultLog;
+
+    public:
+		OGRE_AUTO_MUTEX // public to allow external locking
+
+        LogManager();
+        ~LogManager();
+
+        /** Creates a new log with the given name.
+            @param
+                name The name to give the log e.g. 'Ogre.log'
+            @param
+                defaultLog If true, this is the default log output will be
+                sent to if the generic logging methods on this class are
+                used. The first log created is always the default log unless
+                this parameter is set.
+            @param
+                debuggerOutput If true, output to this log will also be
+                routed to the debugger's output window.
+            @param
+                suppressFileOutput If true, this is a logical rather than a physical
+				log and no file output will be written. If you do this you should
+				register a LogListener so log output is not lost.
+        */
+        Log* createLog( const String& name, bool defaultLog = false, bool debuggerOutput = true, 
+			bool suppressFileOutput = false);
+
+        /** Retrieves a log managed by this class.
+        */
+        Log* getLog( const String& name);
+
+        /** Returns a pointer to the default log.
+        */
+        Log* getDefaultLog();
+
+		/** Closes and removes a named log. */
+		void destroyLog(const String& name);
+		/** Closes and removes a log. */
+		void destroyLog(Log* log);
+
+		/** Sets the passed in log as the default log.
+        @returns The previous default log.
+        */
+        Log* setDefaultLog(Log* newLog);
+
+        /** Log a message to the default log.
+        */
+        void logMessage( const String& message, LogMessageLevel lml = LML_NORMAL, 
+            bool maskDebug = false);
+
+        /** Log a message to the default log (signature for backward compatibility).
+        */
+        void logMessage( LogMessageLevel lml, const String& message,  
+			bool maskDebug = false) { logMessage(message, lml, maskDebug); }
+
+		/** Sets the level of detail of the default log.
+        */
+        void setLogDetail(LoggingLevel ll);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static LogManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static LogManager* getSingletonPtr(void);
+
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgreManualObject.h
===================================================================
--- /OgreMain/include/OgreManualObject.h	(revision 5)
+++ /OgreMain/include/OgreManualObject.h	(revision 5)
@@ -0,0 +1,513 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __OgreManualObject_H__
+#define __OgreManualObject_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMovableObject.h"
+#include "OgreRenderable.h"
+#include "OgreResourceGroupManager.h"
+
+
+namespace Ogre
+{
+	/** Class providing a much simplified interface to generating manual
+	 	objects with custom geometry.
+	@remarks
+		Building one-off geometry objects manually usually requires getting
+		down and dirty with the vertex buffer and vertex declaration API, 
+		which some people find a steep learning curve. This class gives you 
+		a simpler interface specifically for the purpose of building a 
+		3D object simply and quickly. Note that if you intend to instance your
+		object you will still need to become familiar with the Mesh class. 
+	@par
+		This class draws heavily on the interface for OpenGL 
+		immediate-mode (glBegin, glVertex, glNormal etc), since this
+		is generally well-liked by people. There are a couple of differences
+		in the results though - internally this class still builds hardware 
+		buffers which can be re-used, so you can render the resulting object
+		multiple times without re-issuing all the same commands again. 
+		Secondly, the rendering is not immediate, it is still queued just like
+		all OGRE objects. This makes this object more efficient than the 
+		equivalent GL immediate-mode commands, so it's feasible to use it for
+		large objects if you really want to.
+	@par
+		To construct some geometry with this object:
+		  -# If you know roughly how many vertices (and indices, if you use them)
+		     you're going to submit, call estimateVertexCount and estimateIndexCount.
+			 This is not essential but will make the process more efficient by saving
+			 memory reallocations.
+		  -# Call begin() to begin entering data
+		  -# For each vertex, call position(), normal(), textureCoord(), colour()
+		     to define your vertex data. Note that each time you call position()
+			 you start a new vertex. Note that the first vertex defines the 
+			 components of the vertex - you can't add more after that. For example
+			 if you didn't call normal() in the first vertex, you cannot call it
+			 in any others. You ought to call the same combination of methods per
+			 vertex.
+		  -# If you want to define triangles (or lines/points) by indexing into the vertex list, 
+			 you can call index() as many times as you need to define them.
+			 If you don't do this, the class will assume you want triangles drawn
+			 directly as defined by the vertex list, ie non-indexed geometry. Note
+			 that stencil shadows are only supported on indexed geometry, and that
+			 indexed geometry is a little faster; so you should try to use it.
+		  -# Call end() to finish entering data.
+		  -# Optionally repeat the begin-end cycle if you want more geometry 
+		  	using different rendering operation types, or different materials
+	    After calling end(), the class will organise the data for that section
+		internally and make it ready to render with. Like any other 
+		MovableObject you should attach the object to a SceneNode to make it 
+		visible. Other aspects like the relative render order can be controlled
+		using standard MovableObject methods like setRenderQueueGroup.
+	@par
+		You can also use beginUpdate() to alter the geometry later on if you wish.
+		If you do this, you should call setDynamic(true) before your first call 
+		to begin(), and also consider using estimateVertexCount / estimateIndexCount
+		if your geometry is going to be growing, to avoid buffer recreation during
+		growth.
+	@par
+		Note that like all OGRE geometry, triangles should be specified in 
+		anti-clockwise winding order (whether you're doing it with just
+		vertices, or using indexes too). That is to say that the front of the
+		face is the one where the vertices are listed in anti-clockwise order.
+	*/
+	class _OgreExport ManualObject : public MovableObject
+	{
+	public:
+		ManualObject(const String& name);
+		virtual ~ManualObject();
+
+		//pre-declare ManualObjectSection
+		class ManualObjectSection;
+
+		/** Completely clear the contents of the object.
+		@remarks
+			Clearing the contents of this object and rebuilding from scratch
+			is not the optimal way to manage dynamic vertex data, since the 
+			buffers are recreated. If you want to keep the same structure but
+			update the content within that structure, use beginUpdate() instead 
+			of clear() begin(). However if you do want to modify the structure 
+			from time to time you can do so by clearing and re-specifying the data.
+		*/
+		virtual void clear(void);
+		
+		/** Estimate the number of vertices ahead of time.
+		@remarks
+			Calling this helps to avoid memory reallocation when you define
+			vertices. Also very handy when using beginUpdate() to manage dynamic
+			data - you can make the vertex buffers a little larger than their
+			initial needs to allow for growth later with this method.
+		*/
+		virtual void estimateVertexCount(size_t vcount);
+
+		/** Estimate the number of indices ahead of time.
+		@remarks
+			Calling this helps to avoid memory reallocation when you define
+			indices. Also very handy when using beginUpdate() to manage dynamic
+			data - you can make the index buffer a little larger than the
+			initial need to allow for growth later with this method.
+		*/
+		virtual void estimateIndexCount(size_t icount);
+
+		/** Start defining a part of the object.
+		@remarks
+			Each time you call this method, you start a new section of the
+			object with its own material and potentially its own type of
+			rendering operation (triangles, points or lines for example).
+		@param materialName The name of the material to render this part of the
+			object with.
+		@param opType The type of operation to use to render. 
+		*/
+		virtual void begin(const String& materialName, 
+			RenderOperation::OperationType opType = RenderOperation::OT_TRIANGLE_LIST);
+
+		/** Use before defining gometry to indicate that you intend to update the
+			geometry regularly and want the internal structure to reflect that.
+		*/
+		virtual void setDynamic(bool dyn) { mDynamic = dyn; }
+		/** Gets whether this object is marked as dynamic */
+		virtual bool getDynamic() const { return mDynamic; }
+
+		/** Start the definition of an update to a part of the object.
+		@remarks
+			Using this method, you can update an existing section of the object
+			efficiently. You do not have the option of changing the operation type
+			obviously, since it must match the one that was used before. 
+		@note If your sections are changing size, particularly growing, use
+			estimateVertexCount and estimateIndexCount to pre-size the buffers a little
+			larger than the initial needs to avoid buffer reconstruction.
+		@param sectionIndex The index of the section you want to update. The first
+			call to begin() would have created section 0, the second section 1, etc.
+		*/
+		virtual void beginUpdate(size_t sectionIndex);
+		/** Add a vertex position, starting a new vertex at the same time. 
+		@remarks A vertex position is slightly special among the other vertex data
+			methods like normal() and textureCoord(), since calling it indicates
+			the start of a new vertex. All other vertex data methods you call 
+			after this are assumed to be adding more information (like normals or
+			texture coordinates) to the last vertex started with position().
+		*/
+		virtual void position(const Vector3& pos);
+		/// @copydoc ManualObject::position(const Vector3&)
+		virtual void position(Real x, Real y, Real z);
+
+		/** Add a vertex normal to the current vertex.
+		@remarks
+			Vertex normals are most often used for dynamic lighting, and 
+			their components should be normalised.
+		*/
+		virtual void normal(const Vector3& norm);
+		/// @copydoc ManualObject::normal(const Vector3&)
+		virtual void normal(Real x, Real y, Real z);
+
+		/** Add a texture coordinate to the current vertex.
+		@remarks
+			You can call this method multiple times between position() calls
+			to add multiple texture coordinates to a vertex. Each one can have
+			between 1 and 3 dimensions, depending on your needs, although 2 is
+			most common. There are several versions of this method for the 
+			variations in number of dimensions.
+		*/
+		virtual void textureCoord(Real u);
+		/// @copydoc ManualObject::textureCoord(Real)
+		virtual void textureCoord(Real u, Real v);
+		/// @copydoc ManualObject::textureCoord(Real)
+		virtual void textureCoord(Real u, Real v, Real w);
+		/// @copydoc ManualObject::textureCoord(Real)
+		virtual void textureCoord(const Vector2& uv);
+		/// @copydoc ManualObject::textureCoord(Real)
+		virtual void textureCoord(const Vector3& uvw);
+
+		/** Add a vertex colour to a vertex.
+		*/
+		virtual void colour(const ColourValue& col);
+		/** Add a vertex colour to a vertex.
+		@param r,g,b,a Colour components expressed as floating point numbers from 0-1
+		*/
+		virtual void colour(Real r, Real g, Real b, Real a = 1.0f);
+
+		/** Add a vertex index to construct faces / lines / points via indexing
+			rather than just by a simple list of vertices. 
+		@remarks
+			You will have to call this 3 times for each face for a triangle list, 
+			or use the alternative 3-parameter version. Other operation types
+			require different numbers of indexes, @see RenderOperation::OperationType.
+		@note
+			32-bit indexes are not supported on all cards which is why this 
+			class only allows 16-bit indexes, for simplicity and ease of use.
+		@param idx A vertex index from 0 to 65535. 
+		*/
+		virtual void index(uint16 idx);
+		/** Add a set of 3 vertex indices to construct a triangle; this is a
+			shortcut to calling index() 3 times. It is only valid for triangle 
+			lists.
+		@note
+			32-bit indexes are not supported on all cards which is why this 
+			class only allows 16-bit indexes, for simplicity and ease of use.
+		@param i1, i2, i3 3 vertex indices from 0 to 65535 defining a face. 
+		*/
+		virtual void triangle(uint16 i1, uint16 i2, uint16 i3);
+		/** Add a set of 4 vertex indices to construct a quad (out of 2 
+			triangles); this is a shortcut to calling index() 6 times, 
+			or triangle() twice. It's only valid for triangle list operations.
+		@note
+			32-bit indexes are not supported on all cards which is why this 
+			class only allows 16-bit indexes, for simplicity and ease of use.
+		@param i1, i2, i3 3 vertex indices from 0 to 65535 defining a face. 
+		*/
+		virtual void quad(uint16 i1, uint16 i2, uint16 i3, uint16 i4);
+
+		/** Finish defining the object and compile the final renderable version. 
+		@note
+			Will return a pointer to the finished section or NULL if the section was discarded (i.e. has zero vertices/indices).
+		*/
+		virtual ManualObjectSection* end(void);
+
+		/** Alter the material for a subsection of this object after it has been
+			specified.
+		@remarks
+			You specify the material to use on a section of this object during the
+			call to begin(), however if you want to change the material afterwards
+			you can do so by calling this method.
+		@param subIndex The index of the subsection to alter
+		@param name The name of the new material to use
+		*/
+		virtual void setMaterialName(size_t subindex, const String& name);
+
+		/** Convert this object to a Mesh. 
+		@remarks
+			After you've finished building this object, you may convert it to 
+			a Mesh if you want in order to be able to create many instances of
+			it in the world (via Entity). This is optional, since this instance
+			can be directly attached to a SceneNode itself, but of course only
+			one instance of it can exist that way. 
+		@note Only objects which use indexed geometry may be converted to a mesh.
+		@param meshName The name to give the mesh
+		@param groupName The resource group to create the mesh in
+		*/
+		virtual MeshPtr convertToMesh(const String& meshName, 
+			const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+
+		/** Sets whether or not to use an 'identity' projection.
+		@remarks
+			Usually ManualObjects will use a projection matrix as determined
+			by the active camera. However, if they want they can cancel this out
+			and use an identity projection, which effectively projects in 2D using
+			a {-1, 1} view space. Useful for overlay rendering. Normally you don't
+			need to change this. The default is false.
+		@see ManualObject::getUseIdentityProjection
+		*/
+		void setUseIdentityProjection(bool useIdentityProjection);
+
+		/** Returns whether or not to use an 'identity' projection.
+		@remarks
+			Usually ManualObjects will use a projection matrix as determined
+			by the active camera. However, if they want they can cancel this out
+			and use an identity projection, which effectively projects in 2D using
+			a {-1, 1} view space. Useful for overlay rendering. Normally you don't
+			need to change this.
+		@see ManualObject::setUseIdentityProjection
+		*/
+		bool getUseIdentityProjection(void) const { return mUseIdentityProjection; }
+
+		/** Sets whether or not to use an 'identity' view.
+		@remarks
+			Usually ManualObjects will use a view matrix as determined
+			by the active camera. However, if they want they can cancel this out
+			and use an identity matrix, which means all geometry is assumed
+			to be relative to camera space already. Useful for overlay rendering. 
+			Normally you don't need to change this. The default is false.
+		@see ManualObject::getUseIdentityView
+		*/
+		void setUseIdentityView(bool useIdentityView);
+
+		/** Returns whether or not to use an 'identity' view.
+		@remarks
+			Usually ManualObjects will use a view matrix as determined
+			by the active camera. However, if they want they can cancel this out
+			and use an identity matrix, which means all geometry is assumed
+			to be relative to camera space already. Useful for overlay rendering. 
+			Normally you don't need to change this.
+		@see ManualObject::setUseIdentityView
+		*/
+		bool getUseIdentityView(void) const { return mUseIdentityView; }
+
+		/** Sets the bounding box.
+			@remarks Call this after having finished creating sections to modify the
+				bounding box. E.g. if you're using ManualObject to create 2D overlays
+				you can call things function to set an infinite bounding box so that
+				the object always stays visible when attached.
+			@see ManualObject::setUseIdentityProjection, ManualObject::setUseIdentityView,
+				AxisAlignedBox::setInfinite */
+		void setBoundingBox(const AxisAlignedBox& box) { mAABB = box; }
+
+		/** Gets a pointer to a ManualObjectSection, ie a part of a ManualObject.
+		*/
+		ManualObjectSection* getSection(unsigned int index) const;
+
+		/** Retrieves the number of ManualObjectSection objects making up this ManualObject.
+		*/
+		unsigned int getNumSections(void) const;
+
+		// MovableObject overrides
+
+		/** @copydoc MovableObject::getMovableType. */
+		const String& getMovableType(void) const;
+		/** @copydoc MovableObject::getBoundingBox. */
+		const AxisAlignedBox& getBoundingBox(void) const;
+		/** @copydoc MovableObject::getBoundingRadius. */
+		Real getBoundingRadius(void) const;
+		/** @copydoc MovableObject::_updateRenderQueue. */
+		void _updateRenderQueue(RenderQueue* queue);
+		/** Implement this method to enable stencil shadows. */
+		EdgeData* getEdgeList(void);
+		/** Overridden member from ShadowCaster. */
+		bool hasEdgeList(void);
+		/** Implement this method to enable stencil shadows. */
+		ShadowRenderableListIterator getShadowVolumeRenderableIterator(
+			ShadowTechnique shadowTechnique, const Light* light, 
+			HardwareIndexBufferSharedPtr* indexBuffer, 
+			bool extrudeVertices, Real extrusionDist, unsigned long flags = 0);
+
+
+		/// Built, renderable section of geometry
+		class _OgreExport ManualObjectSection : public Renderable
+		{
+		protected:
+			ManualObject* mParent;
+			String mMaterialName;
+			mutable MaterialPtr mMaterial;
+			RenderOperation mRenderOperation;
+			
+		public:
+			ManualObjectSection(ManualObject* parent, const String& materialName,
+				RenderOperation::OperationType opType);
+			virtual ~ManualObjectSection();
+			
+			/// Retrieve render operation for manipulation
+			RenderOperation* getRenderOperation(void);
+			/// Retrieve the material name in use
+			const String& getMaterialName(void) const { return mMaterialName; }
+			/// update the material name in use
+			void setMaterialName(const String& name);
+			
+			// Renderable overrides
+			/** @copydoc Renderable::getMaterial. */
+			const MaterialPtr& getMaterial(void) const;
+			/** @copydoc Renderable::getRenderOperation. */
+			void getRenderOperation(RenderOperation& op);
+			/** @copydoc Renderable::getWorldTransforms. */
+			void getWorldTransforms(Matrix4* xform) const;
+			/** @copydoc Renderable::getWorldOrientation. */
+			const Quaternion& getWorldOrientation(void) const;
+			/** @copydoc Renderable::getWorldPosition. */
+			const Vector3& getWorldPosition(void) const;
+			/** @copydoc Renderable::getSquaredViewDepth. */
+			Real getSquaredViewDepth(const Ogre::Camera *) const;
+			/** @copydoc Renderable::getLights. */
+			const LightList &getLights(void) const;
+					
+		};
+		/** Nested class to allow shadows. */
+		class _OgreExport ManualObjectSectionShadowRenderable : public ShadowRenderable
+		{
+		protected:
+			ManualObject* mParent;
+			// Shared link to position buffer
+			HardwareVertexBufferSharedPtr mPositionBuffer;
+			// Shared link to w-coord buffer (optional)
+			HardwareVertexBufferSharedPtr mWBuffer;
+
+		public:
+			ManualObjectSectionShadowRenderable(ManualObject* parent, 
+				HardwareIndexBufferSharedPtr* indexBuffer, const VertexData* vertexData, 
+				bool createSeparateLightCap, bool isLightCap = false);
+			~ManualObjectSectionShadowRenderable();
+			/// Overridden from ShadowRenderable
+			void getWorldTransforms(Matrix4* xform) const;
+			/// Overridden from ShadowRenderable
+			const Quaternion& getWorldOrientation(void) const;
+			/// Overridden from ShadowRenderable
+			const Vector3& getWorldPosition(void) const;
+			HardwareVertexBufferSharedPtr getPositionBuffer(void) { return mPositionBuffer; }
+			HardwareVertexBufferSharedPtr getWBuffer(void) { return mWBuffer; }
+
+		};
+
+		typedef std::vector<ManualObjectSection*> SectionList;
+		
+	protected:
+		/// Dynamic?
+		bool mDynamic;
+		/// List of subsections
+		SectionList mSectionList;
+		/// Current section
+		ManualObjectSection* mCurrentSection;
+		/// Are we updating?
+		bool mCurrentUpdating;
+		/// Temporary vertex structure
+		struct TempVertex
+		{
+			Vector3 position;
+			Vector3 normal;
+			Vector3 texCoord[OGRE_MAX_TEXTURE_COORD_SETS];
+			ushort texCoordDims[OGRE_MAX_TEXTURE_COORD_SETS];
+			ColourValue colour;
+		};
+		/// Temp storage
+		TempVertex mTempVertex;
+		/// First vertex indicator
+		bool mFirstVertex;
+		/// Temp vertex data to copy?
+		bool mTempVertexPending;
+		/// System-memory buffer whilst we establish the size required
+		char* mTempVertexBuffer;
+		/// System memory allocation size, in bytes
+		size_t mTempVertexSize;
+		/// System-memory buffer whilst we establish the size required
+		uint16* mTempIndexBuffer;
+		/// System memory allocation size, in bytes
+		size_t mTempIndexSize;
+		/// Current declaration vertex size
+		size_t mDeclSize;
+		/// Estimated vertex count
+		size_t mEstVertexCount;
+		/// Estimated index count
+		size_t mEstIndexCount;
+		/// Current texture coordinate
+		ushort mTexCoordIndex;
+		/// Bounding box
+		AxisAlignedBox mAABB;
+		/// Bounding sphere
+		Real mRadius;
+		/// Any indexed geoemtry on any sections?
+		bool mAnyIndexed;
+		/// Edge list, used if stencil shadow casting is enabled 
+		EdgeData* mEdgeList;
+		/// List of shadow renderables
+		ShadowRenderableList mShadowRenderables;
+		/// Whether to use identity projection for sections
+		bool mUseIdentityProjection;
+		/// Whether to use identity view for sections
+		bool mUseIdentityView;
+
+
+		/// Delete temp buffers and reset init counts
+		virtual void resetTempAreas(void);
+		/// Resize the temp vertex buffer?
+		virtual void resizeTempVertexBufferIfNeeded(size_t numVerts);
+		/// Resize the temp index buffer?
+		virtual void resizeTempIndexBufferIfNeeded(size_t numInds);
+
+		/// Copy current temp vertex into buffer
+		virtual void copyTempVertexToBuffer(void);
+
+	};
+
+
+	/** Factory object for creating ManualObject instances */
+	class _OgreExport ManualObjectFactory : public MovableObjectFactory
+	{
+	protected:
+		MovableObject* createInstanceImpl( const String& name, const NameValuePairList* params);
+	public:
+		ManualObjectFactory() {}
+		~ManualObjectFactory() {}
+
+		static String FACTORY_TYPE_NAME;
+
+		const String& getType(void) const;
+		void destroyInstance( MovableObject* obj);  
+
+	};
+}
+
+#endif
+
Index: /OgreMain/include/OgreMaterial.h
===================================================================
--- /OgreMain/include/OgreMaterial.h	(revision 5)
+++ /OgreMain/include/OgreMaterial.h	(revision 5)
@@ -0,0 +1,680 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _Material_H__
+#define _Material_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreResource.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreCommon.h"
+#include "OgreColourValue.h"
+#include "OgreBlendMode.h"
+
+
+namespace Ogre {
+
+	// Forward declaration
+	class MaterialPtr;
+
+	/** Class encapsulates rendering properties of an object.
+    @remarks
+    Ogre's material class encapsulates ALL aspects of the visual appearance,
+    of an object. It also includes other flags which 
+    might not be traditionally thought of as material properties such as 
+    culling modes and depth buffer settings, but these affect the 
+    appearance of the rendered object and are convenient to attach to the 
+    material since it keeps all the settings in one place. This is 
+    different to Direct3D which treats a material as just the colour 
+    components (diffuse, specular) and not texture maps etc. An Ogre 
+    Material can be thought of as equivalent to a 'Shader'.
+    @par
+    A Material can be rendered in multiple different ways depending on the
+    hardware available. You may configure a Material to use high-complexity
+    fragment shaders, but these won't work on every card; therefore a Technique
+    is an approach to creating the visual effect you are looking for. You are advised
+    to create fallback techniques with lower hardware requirements if you decide to
+    use advanced features. In addition, you also might want lower-detail techniques
+    for distant geometry.
+    @par
+    Each technique can be made up of multiple passes. A fixed-function pass
+    may combine multiple texture layers using multitexrtuing, but Ogre can 
+    break that into multiple passes automatically if the active card cannot
+    handle that many simultaneous textures. Programmable passes, however, cannot
+    be split down automatically, so if the active graphics card cannot handle the
+    technique which contains these passes, OGRE will try to find another technique
+    which the card can do. If, at the end of the day, the card cannot handle any of the
+    techniques which are listed for the material, the engine will render the 
+    geometry plain white, which should alert you to the problem.
+    @par
+    Ogre comes configured with a number of default settings for a newly 
+    created material. These can be changed if you wish by retrieving the 
+    default material settings through 
+    SceneManager::getDefaultMaterialSettings. Any changes you make to the 
+    Material returned from this method will apply to any materials created 
+    from this point onward.
+    */
+    class _OgreExport Material : public Resource
+    {
+        friend class SceneManager;
+        friend class MaterialManager;
+
+    public:
+        /// distance list used to specify LOD
+        typedef std::vector<Real> LodDistanceList;
+        typedef ConstVectorIterator<LodDistanceList> LodDistanceIterator;
+    protected:
+
+
+        /** Internal method which sets the material up from the default settings.
+        */
+        void applyDefaults(void);
+
+        typedef std::vector<Technique*> Techniques;
+		/// All techniques, supported and unsupported
+        Techniques mTechniques;
+		/// Supported techniques of any sort
+        Techniques mSupportedTechniques;
+		typedef std::map<unsigned short, Technique*> LodTechniques;
+        typedef std::map<unsigned short, LodTechniques*> BestTechniquesBySchemeList;
+		/** Map of scheme -> list of LOD techniques. 
+			Current scheme is set on MaterialManager,
+			and can be set per Viewport for auto activation.
+		*/
+        BestTechniquesBySchemeList mBestTechniquesBySchemeList;
+
+        LodDistanceList mLodDistances;
+        bool mReceiveShadows;
+		bool mTransparencyCastsShadows;
+        /// Does this material require compilation?
+        bool mCompilationRequired;
+		/// Text description of why any techniques are not supported
+		String mUnsupportedReasons;
+
+		/** Insert a supported technique into the local collections. */
+		void insertSupportedTechnique(Technique* t);
+
+		/** Clear the best technique list.
+		*/
+		void clearBestTechniqueList(void);
+
+		/** Overridden from Resource.
+		*/
+		void loadImpl(void);
+
+		/** Unloads the material, frees resources etc.
+		@see
+		Resource
+		*/
+		void unloadImpl(void);
+		/// @copydoc Resource::calculateSize
+		size_t calculateSize(void) const { return 0; } // TODO 
+    public:
+
+        /** Constructor - use resource manager's create method rather than this.
+        */
+		Material(ResourceManager* creator, const String& name, ResourceHandle handle,
+			const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
+
+        ~Material();
+        /** Assignment operator to allow easy copying between materials.
+        */
+        Material& operator=( const Material& rhs );
+
+        /** Determines if the material has any transparency with the rest of the scene (derived from 
+            whether any Techniques say they involve transparency).
+        */
+        bool isTransparent(void) const;
+
+        /** Sets whether objects using this material will receive shadows.
+        @remarks
+            This method allows a material to opt out of receiving shadows, if
+            it would otherwise do so. Shadows will not be cast on any objects
+            unless the scene is set up to support shadows 
+            (@see SceneManager::setShadowTechnique), and not all techniques cast
+            shadows on all objects. In any case, if you have a need to prevent
+            shadows being received by material, this is the method you call to
+            do it.
+        @note 
+            Transparent materials never receive shadows despite this setting. 
+            The default is to receive shadows.
+        */
+        void setReceiveShadows(bool enabled) { mReceiveShadows = enabled; }
+        /** Returns whether or not objects using this material will receive shadows. */
+        bool getReceiveShadows(void) const { return mReceiveShadows; }
+
+		/** Sets whether objects using this material be classified as opaque to	the shadow caster system.
+		@remarks
+		This method allows a material to cast a shadow, even if it is transparent.
+		By default, transparent materials neither cast nor receive shadows. Shadows
+		will not be cast on any objects unless the scene is set up to support shadows 
+		(@see SceneManager::setShadowTechnique), and not all techniques cast
+		shadows on all objects.
+		*/
+		void setTransparencyCastsShadows(bool enabled) { mTransparencyCastsShadows = enabled; }
+		/** Returns whether or not objects using this material be classified as opaque to the shadow caster system. */
+		bool getTransparencyCastsShadows(void) const { return mTransparencyCastsShadows; }
+
+        /** Creates a new Technique for this Material.
+        @remarks
+            A Technique is a single way of rendering geometry in order to achieve the effect
+            you are intending in a material. There are many reason why you would want more than
+            one - the main one being to handle variable graphics card abilities; you might have
+            one technique which is impressive but only runs on 4th-generation graphics cards, 
+            for example. In this case you will want to create at least one fallback Technique.
+            OGRE will work out which Techniques a card can support and pick the best one.
+        @par
+            If multiple Techniques are available, the order in which they are created is 
+            important - the engine will consider lower-indexed Techniques to be preferable
+            to higher-indexed Techniques, ie when asked for the 'best' technique it will
+            return the first one in the technique list which is supported by the hardware.
+        */
+        Technique* createTechnique(void);
+        /** Gets the indexed technique. */
+        Technique* getTechnique(unsigned short index);
+        /** searches for the named technique.
+            Return 0 if technique with name is not found
+        */
+        Technique* getTechnique(const String& name);
+		/** Retrieves the number of techniques. */
+        unsigned short getNumTechniques(void) const;
+        /** Removes the technique at the given index. */		
+        void removeTechnique(unsigned short index);		
+        /** Removes all the techniques in this Material. */
+        void removeAllTechniques(void);
+        typedef VectorIterator<Techniques> TechniqueIterator;
+        /** Get an iterator over the Techniques in this Material. */
+        TechniqueIterator getTechniqueIterator(void);
+        /** Gets an iterator over all the Techniques which are supported by the current card. 
+        @remarks
+            The supported technique list is only available after this material has been compiled,
+            which typically happens on loading the material. Therefore, if this method returns
+            an empty list, try calling Material::load.
+        */
+        TechniqueIterator getSupportedTechniqueIterator(void);
+		
+		/** Gets the indexed supported technique. */
+        Technique* getSupportedTechnique(unsigned short index);
+		/** Retrieves the number of supported techniques. */
+        unsigned short getNumSupportedTechniques(void) const;
+		/** Gets a string explaining why any techniques are not supported. */
+		const String& getUnsupportedTechniquesExplanation() const { return mUnsupportedReasons; }
+
+        /** Gets the number of levels-of-detail this material has in the 
+			given scheme, based on Technique::setLodIndex. 
+        @remarks
+            Note that this will not be up to date until the material has been compiled.
+        */
+        unsigned short getNumLodLevels(unsigned short schemeIndex) const;
+        /** Gets the number of levels-of-detail this material has in the 
+			given scheme, based on Technique::setLodIndex. 
+        @remarks
+            Note that this will not be up to date until the material has been compiled.
+        */
+        unsigned short getNumLodLevels(const String& schemeName) const;
+
+        /** Gets the best supported technique. 
+        @remarks
+            This method returns the lowest-index supported Technique in this material
+            (since lower-indexed Techniques are considered to be better than higher-indexed
+            ones).
+        @par
+            The best supported technique is only available after this material has been compiled,
+            which typically happens on loading the material. Therefore, if this method returns
+            NULL, try calling Material::load.
+		@param lodIndex The material lod index to use
+        */
+        Technique* getBestTechnique(unsigned short lodIndex = 0);
+
+
+        /** Creates a new copy of this material with the same settings but a new name.
+		@param newName The name for the cloned material
+		@param changeGroup If true, the resource group of the clone is changed
+		@param newGroup Only required if changeGroup is true; the new group to assign
+        */
+        MaterialPtr clone(const String& newName, bool changeGroup = false, 
+			const String& newGroup = StringUtil::BLANK) const;
+
+        /** Copies the details of this material into another, preserving the target's handle and name
+        (unlike operator=) but copying everything else.
+        @param mat Weak reference to material which will receive this material's settings.
+        */
+        void copyDetailsTo(MaterialPtr& mat) const;
+
+        /** 'Compiles' this Material.
+        @remarks
+            Compiling a material involves determining which Techniques are supported on the
+            card on which OGRE is currently running, and for fixed-function Passes within those
+            Techniques, splitting the passes down where they contain more TextureUnitState 
+            instances than the current card has texture units.
+        @par
+            This process is automatically done when the Material is loaded, but may be
+            repeated if you make some procedural changes.
+        @param
+            autoManageTextureUnits If true, when a fixed function pass has too many TextureUnitState
+                entries than the card has texture units, the Pass in question will be split into
+                more than one Pass in order to emulate the Pass. If you set this to false and
+                this situation arises, an Exception will be thrown.
+        */
+        void compile(bool autoManageTextureUnits = true);
+
+        // -------------------------------------------------------------------------------
+        // The following methods are to make migration from previous versions simpler
+        // and to make code easier to write when dealing with simple materials
+        // They set the properties which have been moved to Pass for all Techniques and all Passes
+
+        /** Sets the point size properties for every Pass in every Technique.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setPointSize
+        */
+        void setPointSize(Real ps);
+
+        /** Sets the ambient colour reflectance properties for every Pass in every Technique.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setAmbient
+        */
+        void setAmbient(Real red, Real green, Real blue);
+
+        /** Sets the ambient colour reflectance properties for every Pass in every Technique.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setAmbient
+        */
+        void setAmbient(const ColourValue& ambient);
+
+        /** Sets the diffuse colour reflectance properties of every Pass in every Technique.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setDiffuse
+        */
+        void setDiffuse(Real red, Real green, Real blue, Real alpha);
+
+        /** Sets the diffuse colour reflectance properties of every Pass in every Technique.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setDiffuse
+        */
+        void setDiffuse(const ColourValue& diffuse);
+
+        /** Sets the specular colour reflectance properties of every Pass in every Technique.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setSpecular
+        */
+        void setSpecular(Real red, Real green, Real blue, Real alpha);
+
+        /** Sets the specular colour reflectance properties of every Pass in every Technique.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setSpecular
+        */
+        void setSpecular(const ColourValue& specular);
+
+        /** Sets the shininess properties of every Pass in every Technique.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setShininess
+        */
+        void setShininess(Real val);
+
+        /** Sets the amount of self-illumination of every Pass in every Technique.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setSelfIllumination
+        */
+        void setSelfIllumination(Real red, Real green, Real blue);
+
+        /** Sets the amount of self-illumination of every Pass in every Technique.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setSelfIllumination
+        */
+        void setSelfIllumination(const ColourValue& selfIllum);
+
+		/** Sets whether or not each Pass renders with depth-buffer checking on or not.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setDepthCheckEnabled
+        */
+        void setDepthCheckEnabled(bool enabled);
+
+        /** Sets whether or not each Pass renders with depth-buffer writing on or not.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setDepthWriteEnabled
+        */
+        void setDepthWriteEnabled(bool enabled);
+
+        /** Sets the function used to compare depth values when depth checking is on.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setDepthFunction
+        */
+        void setDepthFunction( CompareFunction func );
+
+		/** Sets whether or not colour buffer writing is enabled for each Pass.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setColourWriteEnabled
+		*/
+		void setColourWriteEnabled(bool enabled);
+
+        /** Sets the culling mode for each pass  based on the 'vertex winding'.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setCullingMode
+        */
+        void setCullingMode( CullingMode mode );
+
+        /** Sets the manual culling mode, performed by CPU rather than hardware.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setManualCullingMode
+        */
+        void setManualCullingMode( ManualCullingMode mode );
+
+        /** Sets whether or not dynamic lighting is enabled for every Pass.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setLightingEnabled
+        */
+        void setLightingEnabled(bool enabled);
+
+        /** Sets the type of light shading required
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setShadingMode
+        */
+        void setShadingMode( ShadeOptions mode );
+
+        /** Sets the fogging mode applied to each pass.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setFog
+        */
+        void setFog(
+            bool overrideScene,
+            FogMode mode = FOG_NONE,
+            const ColourValue& colour = ColourValue::White,
+            Real expDensity = 0.001, Real linearStart = 0.0, Real linearEnd = 1.0 );
+
+        /** Sets the depth bias to be used for each Pass.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setDepthBias
+        */
+        void setDepthBias(float constantBias, float slopeScaleBias);
+
+        /** Set texture filtering for every texture unit in every Technique and Pass
+        @note
+            This property has been moved to the TextureUnitState class, which is accessible via the 
+            Technique and Pass. For simplicity, this method allows you to set these properties for 
+            every current TeextureUnitState, If you need more precision, retrieve the Technique, 
+            Pass and TextureUnitState instances and set the property there.
+        @see TextureUnitState::setTextureFiltering
+        */
+        void setTextureFiltering(TextureFilterOptions filterType);
+        /** Sets the anisotropy level to be used for all textures.
+        @note
+            This property has been moved to the TextureUnitState class, which is accessible via the 
+            Technique and Pass. For simplicity, this method allows you to set these properties for 
+            every current TeextureUnitState, If you need more precision, retrieve the Technique, 
+            Pass and TextureUnitState instances and set the property there.
+        @see TextureUnitState::setTextureAnisotropy
+        */
+        void setTextureAnisotropy(int maxAniso);
+
+        /** Sets the kind of blending every pass has with the existing contents of the scene.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setSceneBlending
+        */
+        void setSceneBlending( const SceneBlendType sbt );
+
+        /** Allows very fine control of blending every Pass with the existing contents of the scene.
+        @note
+            This property has been moved to the Pass class, which is accessible via the 
+            Technique. For simplicity, this method allows you to set these properties for 
+            every current Technique, and for every current Pass within those Techniques. If 
+            you need more precision, retrieve the Technique and Pass instances and set the
+            property there.
+        @see Pass::setSceneBlending
+        */
+        void setSceneBlending( const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor);
+
+
+        /** Tells the material that it needs recompilation. */
+        void _notifyNeedsRecompile(void);
+
+        /** Sets the distance at which level-of-detail (LOD) levels come into effect.
+        @remarks
+            You should only use this if you have assigned LOD indexes to the Technique
+            instances attached to this Material. If you have done so, you should call this
+            method to determine the distance at which the lowe levels of detail kick in.
+            The decision about what distance is actually used is a combination of this
+            and the LOD bias applied to both the current Camera and the current Entity.
+        @param lodDistances A vector of Reals which indicate the distance at which to 
+            switch to lower details. They are listed in LOD index order, starting at index
+            1 (ie the first level down from the highest level 0, which automatically applies
+            from a distance of 0).
+        */
+        void setLodLevels(const LodDistanceList& lodDistances);
+        /** Gets an iterator over the list of distances at which each LOD comes into effect. 
+        @remarks
+            Note that the iterator returned from this method is not totally anagolous to 
+            the one passed in by calling setLodLevels - the list includes a zero
+            entry at the start (since the highest LOD starts at distance 0), and
+            the other distances are held as their squared value for efficiency.
+        */
+        LodDistanceIterator getLodDistanceIterator(void) const;
+
+        /** Gets the LOD index to use at the given distance. */
+        unsigned short getLodIndex(Real d) const;
+        /** Gets the LOD index to use at the given squared distance. */
+        unsigned short getLodIndexSquaredDepth(Real squaredDepth) const;
+
+        /** @copydoc Resource::touch
+        */
+        void touch(void) 
+        { 
+            if (mCompilationRequired) 
+                compile();
+            // call superclass
+            Resource::touch();
+        }
+        
+        /** Applies texture names to Texture Unit State with matching texture name aliases.
+            All techniques, passes, and Texture Unit States within the material are checked.
+            If matching texture aliases are found then true is returned.
+
+        @param
+            aliasList is a map container of texture alias, texture name pairs
+        @param
+            apply set true to apply the texture aliases else just test to see if texture alias matches are found.
+        @return
+            True if matching texture aliases were found in the material.
+        */
+        bool applyTextureAliases(const AliasTextureNamePairList& aliasList, const bool apply = true) const;
+
+	    /** Gets the compilation status of the material.
+        @return True if the material needs recompilation.
+        */
+	    bool getCompilationRequired() const
+	    {
+		    return mCompilationRequired;
+	    }
+
+
+    };
+
+	/** Specialisation of SharedPtr to allow SharedPtr to be assigned to MaterialPtr 
+	@note Has to be a subclass since we need operator=.
+	We could templatise this instead of repeating per Resource subclass, 
+	except to do so requires a form VC6 does not support i.e.
+	ResourceSubclassPtr<T> : public SharedPtr<T>
+	*/
+	class _OgreExport MaterialPtr : public SharedPtr<Material> 
+	{
+	public:
+		MaterialPtr() : SharedPtr<Material>() {}
+		explicit MaterialPtr(Material* rep) : SharedPtr<Material>(rep) {}
+		MaterialPtr(const MaterialPtr& r) : SharedPtr<Material>(r) {} 
+		MaterialPtr(const ResourcePtr& r) : SharedPtr<Material>()
+		{
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+			    pRep = static_cast<Material*>(r.getPointer());
+			    pUseCount = r.useCountPointer();
+			    if (pUseCount)
+			    {
+				    ++(*pUseCount);
+			    }
+            }
+		}
+
+		/// Operator used to convert a ResourcePtr to a MaterialPtr
+		MaterialPtr& operator=(const ResourcePtr& r)
+		{
+			if (pRep == static_cast<Material*>(r.getPointer()))
+				return *this;
+			release();
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+			    pRep = static_cast<Material*>(r.getPointer());
+			    pUseCount = r.useCountPointer();
+			    if (pUseCount)
+			    {
+				    ++(*pUseCount);
+			    }
+            }
+			else
+			{
+				// RHS must be a null pointer
+				assert(r.isNull() && "RHS must be null if it has no mutex!");
+				setNull();
+			}
+			return *this;
+		}
+	};
+
+} //namespace 
+
+#endif
Index: /OgreMain/include/OgreMaterialManager.h
===================================================================
--- /OgreMain/include/OgreMaterialManager.h	(revision 5)
+++ /OgreMain/include/OgreMaterialManager.h	(revision 5)
@@ -0,0 +1,242 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __MATERIALMANAGER_H__
+#define __MATERIALMANAGER_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreSingleton.h"
+#include "OgreResourceManager.h"
+#include "OgreMaterial.h"
+#include "OgreStringVector.h"
+#include "OgreMaterialSerializer.h"
+
+#if OGRE_THREAD_SUPPORT
+// boost::thread_specific_ptr has 'new' in header but delete in lib
+// so if we use our memory manager it reports leaks incorrectly
+#	include "OgreNoMemoryMacros.h"
+#	include <boost/thread/tss.hpp>
+#	include "OgreMemoryMacros.h"
+#endif
+
+namespace Ogre {
+
+
+    /** Class for managing Material settings for Ogre.
+        @remarks
+            Materials control the eventual surface rendering properties of geometry. This class
+            manages the library of materials, dealing with programmatic registrations and lookups,
+            as well as loading predefined Material settings from scripts.
+        @par
+            When loaded from a script, a Material is in an 'unloaded' state and only stores the settings
+            required. It does not at that stage load any textures. This is because the material settings may be
+            loaded 'en masse' from bulk material script files, but only a subset will actually be required.
+        @par
+            Because this is a subclass of ResourceManager, any files loaded will be searched for in any path or
+            archive added to the resource paths/archives. See ResourceManager for details.
+        @par
+            For a definition of the material script format, see the Tutorials/MaterialScript.html file.
+    */
+    class _OgreExport MaterialManager : public ResourceManager, public Singleton<MaterialManager>
+    {
+    protected:
+
+        /// Default Texture filtering - minification
+        FilterOptions mDefaultMinFilter;
+        /// Default Texture filtering - magnification
+        FilterOptions mDefaultMagFilter;
+        /// Default Texture filtering - mipmapping
+        FilterOptions mDefaultMipFilter;
+        /// Default Texture anisotropy
+        unsigned int mDefaultMaxAniso;
+		/// New material compiler. Hold instance per thread if necessary
+        OGRE_THREAD_POINTER(MaterialScriptCompiler, mScriptCompiler);
+        /// Serializer - Hold instance per thread if necessary
+        OGRE_THREAD_POINTER(MaterialSerializer, mSerializer);
+		/// Default settings
+		MaterialPtr mDefaultSettings;
+		/// Overridden from ResourceManager
+		Resource* createImpl(const String& name, ResourceHandle handle, 
+			const String& group, bool isManual, ManualResourceLoader* loader,
+            const NameValuePairList* params);
+
+		/// Scheme name -> index. Never shrinks! Should be pretty static anyway
+		typedef std::map<String, unsigned short> SchemeMap;
+		/// List of material schemes
+		SchemeMap mSchemes;
+		/// Current material scheme
+		String mActiveSchemeName;
+		/// Current material scheme
+		unsigned short mActiveSchemeIndex;
+
+    public:
+		/// Default material scheme
+		static String DEFAULT_SCHEME_NAME;
+		
+        /** Default constructor.
+        */
+        MaterialManager();
+
+        /** Default destructor.
+        */
+        virtual ~MaterialManager();
+
+		/** Intialises the material manager, which also triggers it to 
+		 * parse all available .program and .material scripts. */
+		void initialise(void);
+        
+		/** @see ScriptLoader::parseScript
+        */
+        void parseScript(DataStreamPtr& stream, const String& groupName);
+
+
+        /** Sets the default texture filtering to be used for loaded textures, for when textures are
+            loaded automatically (e.g. by Material class) or when 'load' is called with the default
+            parameters by the application.
+            @note
+                The default value is TFO_BILINEAR.
+        */
+        virtual void setDefaultTextureFiltering(TextureFilterOptions fo);
+        /** Sets the default texture filtering to be used for loaded textures, for when textures are
+            loaded automatically (e.g. by Material class) or when 'load' is called with the default
+            parameters by the application.
+        */
+        virtual void setDefaultTextureFiltering(FilterType ftype, FilterOptions opts);
+        /** Sets the default texture filtering to be used for loaded textures, for when textures are
+            loaded automatically (e.g. by Material class) or when 'load' is called with the default
+            parameters by the application.
+        */
+        virtual void setDefaultTextureFiltering(FilterOptions minFilter, FilterOptions magFilter, FilterOptions mipFilter);
+
+		/// get the default texture filtering
+        virtual FilterOptions getDefaultTextureFiltering(FilterType ftype) const;
+
+        /** Sets the default anisotropy level to be used for loaded textures, for when textures are
+            loaded automatically (e.g. by Material class) or when 'load' is called with the default
+            parameters by the application.
+            @note
+                The default value is 1 (no anisotropy).
+        */
+		void setDefaultAnisotropy(unsigned int maxAniso);
+		/// get the default maxAnisotropy
+		unsigned int getDefaultAnisotropy() const;
+
+        /** Returns a pointer to the default Material settings.
+            @remarks
+                Ogre comes configured with a set of defaults for newly created
+                materials. If you wish to have a different set of defaults,
+                simply call this method and change the returned Material's
+                settings. All materials created from then on will be configured
+                with the new defaults you have specified.
+            @par
+                The default settings begin as a single Technique with a single, non-programmable Pass:
+                <ul>
+                <li>ambient = ColourValue::White</li>
+                <li>diffuse = ColourValue::White</li>
+                <li>specular = ColourValue::Black</li>
+                <li>emmissive = ColourValue::Black</li>
+                <li>shininess = 0</li>
+                <li>No texture unit settings (& hence no textures)</li>
+                <li>SourceBlendFactor = SBF_ONE</li>
+                <li>DestBlendFactor = SBF_ZERO (no blend, replace with new
+                  colour)</li>
+                <li>Depth buffer checking on</li>
+                <li>Depth buffer writing on</li>
+                <li>Depth buffer comparison function = CMPF_LESS_EQUAL</li>
+                <li>Colour buffer writing on for all channels</li>
+                <li>Culling mode = CULL_CLOCKWISE</li>
+                <li>Ambient lighting = ColourValue(0.5, 0.5, 0.5) (mid-grey)</li>
+                <li>Dynamic lighting enabled</li>
+                <li>Gourad shading mode</li>
+                <li>Bilinear texture filtering</li>
+                </ul>
+        */
+		virtual MaterialPtr getDefaultSettings(void) const { return mDefaultSettings; }
+
+		/** Internal method - returns index for a given material scheme name.
+		@see Technique::setSchemeName
+		*/
+		virtual unsigned short _getSchemeIndex(const String& name);
+		/** Internal method - returns name for a given material scheme index.
+		@see Technique::setSchemeName
+		*/
+		virtual const String& _getSchemeName(unsigned short index);
+		/** Internal method - returns the active scheme index.
+		@see Technique::setSchemeName
+		*/
+		virtual unsigned short _getActiveSchemeIndex(void) const;
+
+		/** Returns the name of the active material scheme. 
+		@see Technique::setSchemeName
+		*/
+		virtual const String& getActiveScheme(void) const;
+		
+		/** Sets the name of the active material scheme. 
+		@see Technique::setSchemeName
+		*/
+		virtual void setActiveScheme(const String& schemeName);
+
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static MaterialManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static MaterialManager* getSingletonPtr(void);
+
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgreMaterialScriptCompiler.h
===================================================================
--- /OgreMain/include/OgreMaterialScriptCompiler.h	(revision 5)
+++ /OgreMain/include/OgreMaterialScriptCompiler.h	(revision 5)
@@ -0,0 +1,330 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __MaterialScriptScompiler_H__
+#define __MaterialScriptScompiler_H__
+
+#include "OgreCompiler2Pass.h"
+#include "OgreTextureUnitState.h"
+#include "OgreMaterial.h"
+#include "OgreGpuProgram.h"
+#include "OgreStringVector.h"
+
+namespace Ogre {
+
+    class _OgreExport MaterialScriptCompiler : public Compiler2Pass
+    {
+
+    public:
+        MaterialScriptCompiler(void);
+        ~MaterialScriptCompiler(void);
+
+        /** gets BNF Grammer for Compositor script.
+        */
+        virtual const String& getClientBNFGrammer(void) const;
+
+        /** get the name of the BNF grammer.
+        */
+        virtual const String& getClientGrammerName(void) const;
+
+        /** Compile a material script from a data stream using a specific resource group name.
+        @param stream Weak reference to a data stream which is the source of the material script
+        @param groupName The name of the resource group that resources which are
+			parsed are to become a member of. If this group is loaded or unloaded,
+			then the resources discovered in this script will be loaded / unloaded
+			with it.
+        @param allowOverride if material or gpu program name already exists then use definition
+            in the material script being parsed to override the existing instance.  The default
+            value is false which causes an exception to be thrown if a duplicate is found.
+        */
+        void parseScript(DataStreamPtr& stream, const String& groupName, const bool allowOverride = false);
+
+    protected:
+	    // Token ID enumeration
+	    enum TokenID {
+		    // Terminal Tokens section
+            ID_UNKOWN = 0,
+            // GPU Program
+            ID_VERTEX_PROGRAM, ID_FRAGMENT_PROGRAM,
+
+            // material
+            ID_CLONE,
+
+            // technique
+
+            // pass
+
+            ID_VERTEXCOLOUR,
+            // scene blend
+            ID_COLOUR_BLEND, ID_DEST_COLOUR,
+            ID_SRC_COLOUR, ID_ONE_MINUS_DEST_COLOUR, ID_ONE_MINUS_SRC_COLOUR,
+            ID_DEST_ALPHA, ID_SRC_ALPHA, ID_ONE_MINUS_DEST_ALPHA, ID_ONE_MINUS_SRC_ALPHA,
+            // Depth
+            ID_ALWAYS_FAIL, ID_ALWAYS_PASS,
+            ID_LESS_EQUAL, ID_LESS, ID_EQUAL, ID_NOT_EQUAL, ID_GREATER_EQUAL, ID_GREATER,
+            // culling
+            ID_CLOCKWISE, ID_ANTICLOCKWISE,
+            ID_CULL_BACK, ID_CULL_FRONT,
+            // shading
+            ID_FLAT, ID_GOURAUD, ID_PHONG,
+            // polygon mode
+            ID_SOLID, ID_WIREFRAME, ID_POINTS,
+            // fog overide
+            ID_EXP, ID_EXP2,
+            // iteration
+            ID_ONCE, ID_ONCE_PER_LIGHT, ID_PER_LIGHT, ID_PER_N_LIGHTS, ID_DIRECTIONAL, ID_SPOT,
+
+            // texture unit state
+            // texture
+            ID_1D, ID_2D, ID_3D, ID_CUBIC, ID_UNLIMITED, ID_ALPHA,
+            // cubic texture
+            ID_SEPARATE_UV, ID_COMBINED_UVW,
+            // address mode
+            ID_WRAP, ID_CLAMP, ID_MIRROR, ID_BORDER,
+            // filtering
+            ID_BILINEAR, ID_TRILINEAR, ID_ANISOTROPIC,
+            // color op
+            ID_REPLACE,
+            ID_SOURCE1, ID_SOURCE2, ID_MODULATE_X2, ID_MODULATE_X4, ID_ADD_SIGNED,
+            ID_ADD_SMOOTH, ID_SUBTRACT, ID_BLEND_DIFFUSE_COLOUR, ID_BLEND_DIFFUSE_ALPHA,
+            ID_BLEND_TEXTURE_ALPHA, ID_BLEND_CURRENT_ALPHA, ID_BLEND_MANUAL, ID_DOTPRODUCT,
+            ID_SRC_CURRENT, ID_SRC_TEXTURE, ID_SRC_DIFFUSE, ID_SRC_SPECULAR, ID_SRC_MANUAL,
+
+            // env map
+            ID_SPHERICAL, ID_PLANAR, ID_CUBIC_REFLECTION, ID_CUBIC_NORMAL,
+            // wave transform
+            ID_SCROLL_X, ID_SCROLL_Y, ID_SCALE_X, ID_SCALE_Y, ID_SINE, ID_TRIANGLE,
+            ID_SQUARE, ID_SAWTOOTH, ID_INVERSE_SAWTOOTH, ID_ROTATE,
+			// content type
+			ID_NAMED, ID_SHADOW,
+
+            // GPU program references
+            // GPU Parameters
+
+            // general
+            ID_ON, ID_OFF, ID_TRUE, ID_FALSE, ID_NONE, ID_POINT, ID_LINEAR, ID_ADD, ID_MODULATE, ID_ALPHA_BLEND,
+            ID_ONE, ID_ZERO, ID_VERTEX, ID_FRAGMENT,
+
+            // where auto generated tokens start so donot remove
+            ID_AUTOTOKENSTART
+        };
+
+        /** Enum to identify material sections. */
+        enum MaterialScriptSection
+        {
+            MSS_NONE,
+            MSS_MATERIAL,
+            MSS_TECHNIQUE,
+            MSS_PASS,
+            MSS_TEXTUREUNIT,
+            MSS_PROGRAM_REF,
+		    MSS_PROGRAM,
+            MSS_DEFAULT_PARAMETERS,
+		    MSS_TEXTURESOURCE
+        };
+	    /** Struct for holding a program definition which is in progress. */
+	    struct MaterialScriptProgramDefinition
+	    {
+		    String name;
+		    GpuProgramType progType;
+            String language;
+		    String source;
+		    String syntax;
+            bool supportsSkeletalAnimation;
+		    bool supportsMorphAnimation;
+		    ushort supportsPoseAnimation; // number of simultaneous poses supported
+            bool usesVertexTextureFetch;
+			std::vector<std::pair<String, String> > customParameters;
+	    };
+        /** Struct for holding the script context while parsing. */
+        struct MaterialScriptContext
+        {
+            MaterialScriptSection section;
+		    String groupName;
+            MaterialPtr material;
+            Technique* technique;
+            Pass* pass;
+            TextureUnitState* textureUnit;
+            GpuProgramPtr program; // used when referencing a program, not when defining it
+            bool isProgramShadowCaster; // when referencing, are we in context of shadow caster
+            bool isVertexProgramShadowReceiver; // when referencing, are we in context of shadow caster
+            bool isFragmentProgramShadowReceiver; // when referencing, are we in context of shadow caster
+            bool allowOverride; // if true then allow existing materials and gpu programs to be overriden
+            GpuProgramParametersSharedPtr programParams;
+			ushort numAnimationParametrics;
+		    MaterialScriptProgramDefinition* programDef; // this is used while defining a program
+
+		    int techLev,	//Keep track of what tech, pass, and state level we are in
+			    passLev,
+			    stateLev;
+            // container of token que positions for default params that require pass 2 processing
+            std::vector<size_t> pendingDefaultParams;
+
+            AliasTextureNamePairList textureAliases;
+        };
+
+        MaterialScriptContext mScriptContext;
+
+        typedef void (MaterialScriptCompiler::* MSC_Action)(void);
+        typedef std::map<size_t, MSC_Action> TokenActionMap;
+        typedef TokenActionMap::iterator TokenActionIterator;
+        /** Map of Token value as key to an Action.  An Action converts tokens into
+            the final format.
+            All instances use the same Token Action Map.
+        */
+        static TokenActionMap mTokenActionMap;
+
+        /** Execute an Action associated with a token.  Gets called when the compiler finishes tokenizing a
+            section of the source that has been parsed.
+        **/
+        virtual void executeTokenAction(const size_t tokenID);
+        /** Get the start position of auto generated token IDs.
+        */
+        virtual size_t getAutoTokenIDStart() const {return ID_AUTOTOKENSTART;}
+
+        /** Associate all the lexemes used in a material script with their corresponding tokens and actions.
+        **/
+        virtual void setupTokenDefinitions(void);
+        void addLexemeTokenAction(const String& lexeme, const size_t token, const MSC_Action action = 0);
+        /** Associate all the lexemes used in a material script with their corresponding actions and have
+            token IDs auto-generated.
+        **/
+        void addLexemeAction(const String& lexeme, const MSC_Action action) {addLexemeTokenAction(lexeme, 0, action);}
+
+        void logParseError(const String& error);
+
+        // support methods that convert tokens
+        ColourValue _parseColourValue(void);
+        CompareFunction convertCompareFunction(void);
+
+        // Token Actions which get called when tokens are created during parsing.
+        void parseOpenBrace(void);
+        void parseCloseBrace(void);
+        // material section Actions
+        void parseMaterial(void);
+        void parseLodDistances(void);
+        void parseReceiveShadows(void);
+        void parseTransparencyCastsShadows(void);
+        void parseSetTextureAlias(void);
+        // Technique related actions
+        void parseTechnique(void);
+        void parseScheme(void);
+        void parseLodIndex(void);
+        // Pass related Actions
+        void parsePass(void);
+        void parseAmbient(void);
+        void parseDiffuse(void);
+        void parseSpecular(void);
+        void parseEmissive(void);
+        void parseSceneBlend(void);
+        SceneBlendFactor convertBlendFactor(void);
+        void parseDepthCheck(void);
+        void parseDepthWrite(void);
+        void parseDepthFunc(void);
+        void parseDepthBias(void);
+        void parseAlphaRejection(void);
+        void parseCullHardware(void);
+        void parseCullSoftware(void);
+        void parseLighting(void);
+        void parseShading(void);
+        void parsePolygonMode(void);
+        void parseFogOverride(void);
+        void parseMaxLights(void);
+		void parseStartLight(void);
+        void parseIteration(void);
+        void parseIterationLightTypes(void);
+        void parseColourWrite(void);
+        void parsePointSize(void);
+        void parsePointSprites(void);
+        void parsePointSizeMin(void);
+        void parsePointSizeMax(void);
+        void parsePointSizeAttenuation(void);
+        // Texture Unit related Actions
+        void parseTextureUnit(void);
+        void parseTextureAlias(void);
+        void parseTexture(void);
+        void parseAnimTexture(void);
+        void parseCubicTexture(void);
+        void parseTexCoord(void);
+        TextureUnitState::TextureAddressingMode convTexAddressMode(void);
+        void parseTexAddressMode(void);
+        void parseTexBorderColour(void);
+        void parseFiltering(void);
+        FilterOptions convertFiltering();
+        void parseMaxAnisotropy(void);
+        void parseMipMapBias(void);
+        void parseColourOp(void);
+        void parseColourOpEx(void);
+        LayerBlendOperationEx convertBlendOpEx(void);
+        LayerBlendSource convertBlendSource(void);
+        void parseColourOpMultipassFallback(void);
+        void parseAlphaOpEx(void);
+        void parseEnvMap(void);
+        void parseScroll(void);
+        void parseScrollAnim(void);
+        void parseRotate(void);
+        void parseRotateAnim(void);
+        void parseScale(void);
+        void parseWaveXform(void);
+        void parseTransform(void);
+        void parseTextureCustomParameter(void);
+    	void parseBindingType(void);
+		void parseContentType(void);
+
+        // GPU Program
+        void parseGPUProgram(void);
+        void parseProgramSource(void);
+        void parseProgramSyntax(void);
+        void parseProgramCustomParameter(void);
+        void parseDefaultParams(void);
+        void parseProgramSkeletalAnimation(void);
+        void parseProgramMorphAnimation(void);
+        void parseProgramPoseAnimation(void);
+        void parseProgramVertexTextureFetch(void);
+        void parseVertexProgramRef(void);
+        void parseFragmentProgramRef(void);
+        void parseShadowCasterVertexProgramRef(void);
+        void parseShadowReceiverVertexProgramRef(void);
+        void parseShadowReceiverFragmentProgramRef(void);
+        void parseParamIndexed(void);
+        void parseParamIndexedAuto(void);
+        void parseParamNamed(void);
+        void parseParamNamedAuto(void);
+        void processManualProgramParam(bool isNamed, const String commandName, 
+			size_t index = 0, const String& paramName = StringUtil::BLANK);
+		void processAutoProgramParam(bool isNamed, const String commandName, 
+			size_t index, const String& paramName = StringUtil::BLANK);
+
+
+    	void finishProgramDefinition(void);
+
+    };
+}
+
+#endif
Index: /OgreMain/include/OgreMaterialSerializer.h
===================================================================
--- /OgreMain/include/OgreMaterialSerializer.h	(revision 5)
+++ /OgreMain/include/OgreMaterialSerializer.h	(revision 5)
@@ -0,0 +1,278 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __MaterialSerializer_H__
+#define __MaterialSerializer_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMaterial.h"
+#include "OgreBlendMode.h"
+#include "OgreTextureUnitState.h"
+#include "OgreGpuProgram.h"
+#include "OgreStringVector.h"
+
+namespace Ogre {
+
+    /** Enum to identify material sections. */
+    enum MaterialScriptSection
+    {
+        MSS_NONE,
+        MSS_MATERIAL,
+        MSS_TECHNIQUE,
+        MSS_PASS,
+        MSS_TEXTUREUNIT,
+        MSS_PROGRAM_REF,
+		MSS_PROGRAM,
+        MSS_DEFAULT_PARAMETERS,
+		MSS_TEXTURESOURCE
+    };
+	/** Struct for holding a program definition which is in progress. */
+	struct MaterialScriptProgramDefinition
+	{
+		String name;
+		GpuProgramType progType;
+        String language;
+		String source;
+		String syntax;
+        bool supportsSkeletalAnimation;
+		bool supportsMorphAnimation;
+		ushort supportsPoseAnimation; // number of simultaneous poses supported
+		bool usesVertexTextureFetch;
+		std::vector<std::pair<String, String> > customParameters;
+	};
+    /** Struct for holding the script context while parsing. */
+    struct MaterialScriptContext 
+    {
+        MaterialScriptSection section;
+		String groupName;
+        MaterialPtr material;
+        Technique* technique;
+        Pass* pass;
+        TextureUnitState* textureUnit;
+        GpuProgramPtr program; // used when referencing a program, not when defining it
+        bool isProgramShadowCaster; // when referencing, are we in context of shadow caster
+        bool isVertexProgramShadowReceiver; // when referencing, are we in context of shadow caster
+		bool isFragmentProgramShadowReceiver; // when referencing, are we in context of shadow caster
+        GpuProgramParametersSharedPtr programParams;
+		ushort numAnimationParametrics;
+		MaterialScriptProgramDefinition* programDef; // this is used while defining a program
+
+		int techLev,	//Keep track of what tech, pass, and state level we are in
+			passLev,
+			stateLev;
+        StringVector defaultParamLines;
+
+		// Error reporting state
+        size_t lineNo;
+        String filename;
+        AliasTextureNamePairList textureAliases;
+    };
+    /// Function def for material attribute parser; return value determines if the next line should be {
+    typedef bool (*ATTRIBUTE_PARSER)(String& params, MaterialScriptContext& context);
+
+    /** Class for serializing Materials to / from a .material script.*/
+    class _OgreExport MaterialSerializer
+    {
+    protected:
+        /// Keyword-mapped attribute parsers.
+        typedef std::map<String, ATTRIBUTE_PARSER> AttribParserList;
+
+        MaterialScriptContext mScriptContext;
+
+        /** internal method for parsing a material
+        @returns true if it expects the next line to be a {
+        */
+        bool parseScriptLine(String& line);
+        /** internal method for finding & invoking an attribute parser. */
+        bool invokeParser(String& line, AttribParserList& parsers);
+		/** Internal method for saving a program definition which has been
+		    built up.
+		*/
+		void finishProgramDefinition(void);
+        /// Parsers for the root of the material script
+        AttribParserList mRootAttribParsers;
+        /// Parsers for the material section of a script
+        AttribParserList mMaterialAttribParsers;
+        /// Parsers for the technique section of a script
+        AttribParserList mTechniqueAttribParsers;
+        /// Parsers for the pass section of a script
+        AttribParserList mPassAttribParsers;
+        /// Parsers for the texture unit section of a script
+        AttribParserList mTextureUnitAttribParsers;
+        /// Parsers for the program reference section of a script
+        AttribParserList mProgramRefAttribParsers;
+        /// Parsers for the program definition section of a script
+        AttribParserList mProgramAttribParsers;
+        /// Parsers for the program definition section of a script
+        AttribParserList mProgramDefaultParamAttribParsers;
+
+        void writeMaterial(const MaterialPtr& pMat);
+        void writeTechnique(const Technique* pTech);
+        void writePass(const Pass* pPass);
+        void writeVertexProgramRef(const Pass* pPass);
+        void writeShadowCasterVertexProgramRef(const Pass* pPass);
+        void writeShadowReceiverVertexProgramRef(const Pass* pPass);
+        void writeShadowReceiverFragmentProgramRef(const Pass* pPass);
+        void writeFragmentProgramRef(const Pass* pPass);
+        void writeGpuProgramRef(const String& attrib, const GpuProgramPtr& program, const GpuProgramParametersSharedPtr& params);
+        void writeGpuPrograms(void);
+        void writeGPUProgramParameters(const GpuProgramParametersSharedPtr& params, GpuProgramParameters* defaultParams,
+            const int level = 4, const bool useMainBuffer = true);
+		void writeNamedGpuProgramParameters(const GpuProgramParametersSharedPtr& params, GpuProgramParameters* defaultParams,
+			const int level = 4, const bool useMainBuffer = true);
+		void writeLowLevelGpuProgramParameters(const GpuProgramParametersSharedPtr& params, GpuProgramParameters* defaultParams,
+			const int level = 4, const bool useMainBuffer = true);
+		void writeGpuProgramParameter(
+			const String& commandName, const String& identifier, 
+			const GpuProgramParameters::AutoConstantEntry* autoEntry, 
+			const GpuProgramParameters::AutoConstantEntry* defaultAutoEntry, 
+			bool isFloat, size_t physicalIndex, size_t physicalSize,
+			const GpuProgramParametersSharedPtr& params, GpuProgramParameters* defaultParams,
+			const int level, const bool useMainBuffer);
+		void writeTextureUnit(const TextureUnitState *pTex);
+		void writeSceneBlendFactor(const SceneBlendFactor sbf_src, const SceneBlendFactor sbf_dest);
+		void writeSceneBlendFactor(const SceneBlendFactor sbf);
+		void writeCompareFunction(const CompareFunction cf);
+		void writeColourValue(const ColourValue &colour, bool writeAlpha = false);
+		void writeLayerBlendOperationEx(const LayerBlendOperationEx op);
+		void writeLayerBlendSource(const LayerBlendSource lbs);
+		
+		typedef std::multimap<TextureUnitState::TextureEffectType, TextureUnitState::TextureEffect> EffectMap;
+
+		void writeRotationEffect(const TextureUnitState::TextureEffect& effect, const TextureUnitState *pTex);
+		void writeTransformEffect(const TextureUnitState::TextureEffect& effect, const TextureUnitState *pTex);
+		void writeScrollEffect(const TextureUnitState::TextureEffect& effect, const TextureUnitState *pTex);
+		void writeEnvironmentMapEffect(const TextureUnitState::TextureEffect& effect, const TextureUnitState *pTex);
+
+        String convertFiltering(FilterOptions fo);
+    public:
+		/** default constructor*/
+		MaterialSerializer();
+		/** default destructor*/
+		virtual ~MaterialSerializer() {};
+
+		/** Queue an in-memory Material to the internal buffer for export.
+		@param pMat Material pointer
+		@param clearQueued If true, any materials already queued will be removed
+		@param exportDefaults If true, attributes which are defaulted will be
+			included in the script exported, otherwise they will be omitted
+		*/
+        void queueForExport(const MaterialPtr& pMat, bool clearQueued = false, 
+			bool exportDefaults = false);
+        /** Exports queued material(s) to a named material script file.
+        @param filename the file name of the material script to be exported
+		@param includeProgDef If true, vertex program and fragment program 
+			definitions will be written at the top of the material script
+        @param programFilename the file name of the vertex / fragment program 
+			script to be exported. This is only used if there are program definitions
+            to be exported and includeProgDef is false 
+			when calling queueForExport.
+        */
+		void exportQueued(const String& filename, const bool includeProgDef = false, const String& programFilename = "");
+        /** Exports a single in-memory Material to the named material script file.
+        @param exportDefaults if true then exports all values including defaults
+        @param includeProgDef if true includes Gpu shader program definitions in the
+            export material script otherwise if false then program definitions will
+            be exported to a seperate file with name programFilename if
+            programFilename is not empty
+        @param programFilename the file name of the vertex / fragment program 
+			script to be exported. This is only used if includeProgDef is false.
+        */
+        void exportMaterial(const MaterialPtr& pMat, const String& filename, bool exportDefaults = false,
+            const bool includeProgDef = false, const String& programFilename = "");
+		/** Returns a string representing the parsed material(s) */
+		const String &getQueuedAsString() const;
+		/** Clears the internal buffer */
+		void clearQueue();
+
+        /** Parses a Material script file passed as a stream.
+        */
+        void parseScript(DataStreamPtr& stream, const String& groupName);
+
+
+
+	private:
+		String mBuffer;
+        String mGpuProgramBuffer;
+        typedef std::set<String> GpuProgramDefinitionContainer;
+        typedef GpuProgramDefinitionContainer::iterator GpuProgramDefIterator;
+        GpuProgramDefinitionContainer mGpuProgramDefinitionContainer;
+		bool mDefaults;
+
+        void beginSection(unsigned short level, const bool useMainBuffer = true)
+		{
+            String& buffer = (useMainBuffer ? mBuffer : mGpuProgramBuffer);
+			buffer += "\n";
+            for (unsigned short i = 0; i < level; ++i)
+            {
+                buffer += "\t";
+            }
+            buffer += "{";
+		}
+		void endSection(unsigned short level, const bool useMainBuffer = true)
+		{
+            String& buffer = (useMainBuffer ? mBuffer : mGpuProgramBuffer);
+			buffer += "\n";
+            for (unsigned short i = 0; i < level; ++i)
+            {
+                buffer += "\t";
+            }
+            buffer += "}";
+		}
+
+		void writeAttribute(unsigned short level, const String& att, const bool useMainBuffer = true)
+		{
+            String& buffer = (useMainBuffer ? mBuffer : mGpuProgramBuffer);
+			buffer += "\n";
+            for (unsigned short i = 0; i < level; ++i)
+            {
+                buffer += "\t";
+            }
+            buffer += att;
+		}
+
+		void writeValue(const String& val, const bool useMainBuffer = true)
+		{
+            String& buffer = (useMainBuffer ? mBuffer : mGpuProgramBuffer);
+			buffer += (" " + val);
+		}
+
+		void writeComment(unsigned short level, const String& comment, const bool useMainBuffer = true)
+		{
+            String& buffer = (useMainBuffer ? mBuffer : mGpuProgramBuffer);
+			buffer += "\n";
+            for (unsigned short i = 0; i < level; ++i)
+            {
+                buffer += "\t";
+            }
+            buffer += "// " + comment;
+		}
+
+    };
+}
+#endif
Index: /OgreMain/include/OgreMath.h
===================================================================
--- /OgreMain/include/OgreMath.h	(revision 5)
+++ /OgreMain/include/OgreMath.h	(revision 5)
@@ -0,0 +1,606 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Math_H__
+#define __Math_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre
+{
+    /** Wrapper class which indicates a given angle value is in Radians.
+    @remarks
+        Radian values are interchangeable with Degree values, and conversions
+        will be done automatically between them.
+    */
+	class Radian
+	{
+		Real mRad;
+
+	public:
+		explicit Radian ( Real r=0 ) : mRad(r) {}
+		Radian ( const Degree& d );
+		Radian& operator = ( const Real& f ) { mRad = f; return *this; }
+		Radian& operator = ( const Radian& r ) { mRad = r.mRad; return *this; }
+		Radian& operator = ( const Degree& d );
+
+		Real valueDegrees() const; // see bottom of this file
+		Real valueRadians() const { return mRad; }
+		Real valueAngleUnits() const;
+
+        const Radian& operator + () const { return *this; }
+		Radian operator + ( const Radian& r ) const { return Radian ( mRad + r.mRad ); }
+		Radian operator + ( const Degree& d ) const;
+		Radian& operator += ( const Radian& r ) { mRad += r.mRad; return *this; }
+		Radian& operator += ( const Degree& d );
+		Radian operator - () const { return Radian(-mRad); }
+		Radian operator - ( const Radian& r ) const { return Radian ( mRad - r.mRad ); }
+		Radian operator - ( const Degree& d ) const;
+		Radian& operator -= ( const Radian& r ) { mRad -= r.mRad; return *this; }
+		Radian& operator -= ( const Degree& d );
+		Radian operator * ( Real f ) const { return Radian ( mRad * f ); }
+        Radian operator * ( const Radian& f ) const { return Radian ( mRad * f.mRad ); }
+		Radian& operator *= ( Real f ) { mRad *= f; return *this; }
+		Radian operator / ( Real f ) const { return Radian ( mRad / f ); }
+		Radian& operator /= ( Real f ) { mRad /= f; return *this; }
+
+		bool operator <  ( const Radian& r ) const { return mRad <  r.mRad; }
+		bool operator <= ( const Radian& r ) const { return mRad <= r.mRad; }
+		bool operator == ( const Radian& r ) const { return mRad == r.mRad; }
+		bool operator != ( const Radian& r ) const { return mRad != r.mRad; }
+		bool operator >= ( const Radian& r ) const { return mRad >= r.mRad; }
+		bool operator >  ( const Radian& r ) const { return mRad >  r.mRad; }
+	};
+
+    /** Wrapper class which indicates a given angle value is in Degrees.
+    @remarks
+        Degree values are interchangeable with Radian values, and conversions
+        will be done automatically between them.
+    */
+	class Degree
+	{
+		Real mDeg; // if you get an error here - make sure to define/typedef 'Real' first
+
+	public:
+		explicit Degree ( Real d=0 ) : mDeg(d) {}
+		Degree ( const Radian& r ) : mDeg(r.valueDegrees()) {}
+		Degree& operator = ( const Real& f ) { mDeg = f; return *this; }
+		Degree& operator = ( const Degree& d ) { mDeg = d.mDeg; return *this; }
+		Degree& operator = ( const Radian& r ) { mDeg = r.valueDegrees(); return *this; }
+
+		Real valueDegrees() const { return mDeg; }
+		Real valueRadians() const; // see bottom of this file
+		Real valueAngleUnits() const;
+
+		const Degree& operator + () const { return *this; }
+		Degree operator + ( const Degree& d ) const { return Degree ( mDeg + d.mDeg ); }
+		Degree operator + ( const Radian& r ) const { return Degree ( mDeg + r.valueDegrees() ); }
+		Degree& operator += ( const Degree& d ) { mDeg += d.mDeg; return *this; }
+		Degree& operator += ( const Radian& r ) { mDeg += r.valueDegrees(); return *this; }
+		Degree operator - () const { return Degree(-mDeg); }
+		Degree operator - ( const Degree& d ) const { return Degree ( mDeg - d.mDeg ); }
+		Degree operator - ( const Radian& r ) const { return Degree ( mDeg - r.valueDegrees() ); }
+		Degree& operator -= ( const Degree& d ) { mDeg -= d.mDeg; return *this; }
+		Degree& operator -= ( const Radian& r ) { mDeg -= r.valueDegrees(); return *this; }
+		Degree operator * ( Real f ) const { return Degree ( mDeg * f ); }
+        Degree operator * ( const Degree& f ) const { return Degree ( mDeg * f.mDeg ); }
+		Degree& operator *= ( Real f ) { mDeg *= f; return *this; }
+		Degree operator / ( Real f ) const { return Degree ( mDeg / f ); }
+		Degree& operator /= ( Real f ) { mDeg /= f; return *this; }
+
+		bool operator <  ( const Degree& d ) const { return mDeg <  d.mDeg; }
+		bool operator <= ( const Degree& d ) const { return mDeg <= d.mDeg; }
+		bool operator == ( const Degree& d ) const { return mDeg == d.mDeg; }
+		bool operator != ( const Degree& d ) const { return mDeg != d.mDeg; }
+		bool operator >= ( const Degree& d ) const { return mDeg >= d.mDeg; }
+		bool operator >  ( const Degree& d ) const { return mDeg >  d.mDeg; }
+	};
+
+    /** Wrapper class which identifies a value as the currently default angle 
+        type, as defined by Math::setAngleUnit.
+    @remarks
+        Angle values will be automatically converted between radians and degrees,
+        as appropriate.
+    */
+	class Angle
+	{
+		Real mAngle;
+	public:
+		explicit Angle ( Real angle ) : mAngle(angle) {}
+		operator Radian() const;
+		operator Degree() const;
+	};
+
+	// these functions could not be defined within the class definition of class
+	// Radian because they required class Degree to be defined
+	inline Radian::Radian ( const Degree& d ) : mRad(d.valueRadians()) {
+	}
+	inline Radian& Radian::operator = ( const Degree& d ) {
+		mRad = d.valueRadians(); return *this;
+	}
+	inline Radian Radian::operator + ( const Degree& d ) const {
+		return Radian ( mRad + d.valueRadians() );
+	}
+	inline Radian& Radian::operator += ( const Degree& d ) {
+		mRad += d.valueRadians();
+		return *this;
+	}
+	inline Radian Radian::operator - ( const Degree& d ) const {
+		return Radian ( mRad - d.valueRadians() );
+	}
+	inline Radian& Radian::operator -= ( const Degree& d ) {
+		mRad -= d.valueRadians();
+		return *this;
+	}
+
+    /** Class to provide access to common mathematical functions.
+        @remarks
+            Most of the maths functions are aliased versions of the C runtime
+            library functions. They are aliased here to provide future
+            optimisation opportunities, either from faster RTLs or custom
+            math approximations.
+        @note
+            <br>This is based on MgcMath.h from
+            <a href="http://www.geometrictools.com/">Wild Magic</a>.
+    */
+    class _OgreExport Math 
+    {
+   public:
+       /** The angular units used by the API. This functionality is now deprecated in favor
+	       of discreet angular unit types ( see Degree and Radian above ). The only place
+		   this functionality is actually still used is when parsing files. Search for
+		   usage of the Angle class for those instances
+       */
+       enum AngleUnit
+       {
+           AU_DEGREE,
+           AU_RADIAN
+       };
+
+    protected:
+       // angle units used by the api
+       static AngleUnit msAngleUnit;
+
+        /// Size of the trig tables as determined by constructor.
+        static int mTrigTableSize;
+
+        /// Radian -> index factor value ( mTrigTableSize / 2 * PI )
+        static Real mTrigTableFactor;
+        static Real* mSinTable;
+        static Real* mTanTable;
+
+        /** Private function to build trig tables.
+        */
+        void buildTrigTables();
+
+		static Real SinTable (Real fValue);
+		static Real TanTable (Real fValue);
+    public:
+        /** Default constructor.
+            @param
+                trigTableSize Optional parameter to set the size of the
+                tables used to implement Sin, Cos, Tan
+        */
+        Math(unsigned int trigTableSize = 4096);
+
+        /** Default destructor.
+        */
+        ~Math();
+
+		static inline int IAbs (int iValue) { return ( iValue >= 0 ? iValue : -iValue ); }
+		static inline int ICeil (float fValue) { return int(ceil(fValue)); }
+		static inline int IFloor (float fValue) { return int(floor(fValue)); }
+        static int ISign (int iValue);
+
+		static inline Real Abs (Real fValue) { return Real(fabs(fValue)); }
+		static inline Degree Abs (const Degree& dValue) { return Degree(fabs(dValue.valueDegrees())); }
+		static inline Radian Abs (const Radian& rValue) { return Radian(fabs(rValue.valueRadians())); }
+		static Radian ACos (Real fValue);
+		static Radian ASin (Real fValue);
+		static inline Radian ATan (Real fValue) { return Radian(atan(fValue)); }
+		static inline Radian ATan2 (Real fY, Real fX) { return Radian(atan2(fY,fX)); }
+		static inline Real Ceil (Real fValue) { return Real(ceil(fValue)); }
+
+        /** Cosine function.
+            @param
+                fValue Angle in radians
+            @param
+                useTables If true, uses lookup tables rather than
+                calculation - faster but less accurate.
+        */
+        static inline Real Cos (const Radian& fValue, bool useTables = false) {
+			return (!useTables) ? Real(cos(fValue.valueRadians())) : SinTable(fValue.valueRadians() + HALF_PI);
+		}
+        /** Cosine function.
+            @param
+                fValue Angle in radians
+            @param
+                useTables If true, uses lookup tables rather than
+                calculation - faster but less accurate.
+        */
+        static inline Real Cos (Real fValue, bool useTables = false) {
+			return (!useTables) ? Real(cos(fValue)) : SinTable(fValue + HALF_PI);
+		}
+
+		static inline Real Exp (Real fValue) { return Real(exp(fValue)); }
+
+		static inline Real Floor (Real fValue) { return Real(floor(fValue)); }
+
+		static inline Real Log (Real fValue) { return Real(log(fValue)); }
+
+		static inline Real Pow (Real fBase, Real fExponent) { return Real(pow(fBase,fExponent)); }
+
+        static Real Sign (Real fValue);
+		static inline Radian Sign ( const Radian& rValue )
+		{
+			return Radian(Sign(rValue.valueRadians()));
+		}
+		static inline Degree Sign ( const Degree& dValue )
+		{
+			return Degree(Sign(dValue.valueDegrees()));
+		}
+
+        /** Sine function.
+            @param
+                fValue Angle in radians
+            @param
+                useTables If true, uses lookup tables rather than
+                calculation - faster but less accurate.
+        */
+        static inline Real Sin (const Radian& fValue, bool useTables = false) {
+			return (!useTables) ? Real(sin(fValue.valueRadians())) : SinTable(fValue.valueRadians());
+		}
+        /** Sine function.
+            @param
+                fValue Angle in radians
+            @param
+                useTables If true, uses lookup tables rather than
+                calculation - faster but less accurate.
+        */
+        static inline Real Sin (Real fValue, bool useTables = false) {
+			return (!useTables) ? Real(sin(fValue)) : SinTable(fValue);
+		}
+
+		static inline Real Sqr (Real fValue) { return fValue*fValue; }
+
+		static inline Real Sqrt (Real fValue) { return Real(sqrt(fValue)); }
+
+        static inline Radian Sqrt (const Radian& fValue) { return Radian(sqrt(fValue.valueRadians())); }
+
+        static inline Degree Sqrt (const Degree& fValue) { return Degree(sqrt(fValue.valueDegrees())); }
+
+        /** Inverse square root i.e. 1 / Sqrt(x), good for vector
+            normalisation.
+        */
+		static Real InvSqrt(Real fValue);
+
+        static Real UnitRandom ();  // in [0,1]
+
+        static Real RangeRandom (Real fLow, Real fHigh);  // in [fLow,fHigh]
+
+        static Real SymmetricRandom ();  // in [-1,1]
+
+        /** Tangent function.
+            @param
+                fValue Angle in radians
+            @param
+                useTables If true, uses lookup tables rather than
+                calculation - faster but less accurate.
+        */
+		static inline Real Tan (const Radian& fValue, bool useTables = false) {
+			return (!useTables) ? Real(tan(fValue.valueRadians())) : TanTable(fValue.valueRadians());
+		}
+        /** Tangent function.
+            @param
+                fValue Angle in radians
+            @param
+                useTables If true, uses lookup tables rather than
+                calculation - faster but less accurate.
+        */
+		static inline Real Tan (Real fValue, bool useTables = false) {
+			return (!useTables) ? Real(tan(fValue)) : TanTable(fValue);
+		}
+
+		static inline Real DegreesToRadians(Real degrees) { return degrees * fDeg2Rad; }
+        static inline Real RadiansToDegrees(Real radians) { return radians * fRad2Deg; }
+
+       /** These functions used to set the assumed angle units (radians or degrees) 
+            expected when using the Angle type.
+       @par
+            You can set this directly after creating a new Root, and also before/after resource creation,
+            depending on whether you want the change to affect resource files.
+       */
+       static void setAngleUnit(AngleUnit unit);
+       /** Get the unit being used for angles. */
+       static AngleUnit getAngleUnit(void);
+
+       /** Convert from the current AngleUnit to radians. */
+       static Real AngleUnitsToRadians(Real units);
+       /** Convert from radians to the current AngleUnit . */
+       static Real RadiansToAngleUnits(Real radians);
+       /** Convert from the current AngleUnit to degrees. */
+       static Real AngleUnitsToDegrees(Real units);
+       /** Convert from degrees to the current AngleUnit. */
+       static Real DegreesToAngleUnits(Real degrees);
+
+       /** Checks whether a given point is inside a triangle, in a
+            2-dimensional (Cartesian) space.
+            @remarks
+                The vertices of the triangle must be given in either
+                trigonometrical (anticlockwise) or inverse trigonometrical
+                (clockwise) order.
+            @param
+                p The point.
+            @param
+                a The triangle's first vertex.
+            @param
+                b The triangle's second vertex.
+            @param
+                c The triangle's third vertex.
+            @returns
+                If the point resides in the triangle, <b>true</b> is
+                returned.
+            @par
+                If the point is outside the triangle, <b>false</b> is
+                returned.
+        */
+        static bool pointInTri2D(const Vector2& p, const Vector2& a, 
+			const Vector2& b, const Vector2& c);
+
+       /** Checks whether a given 3D point is inside a triangle.
+       @remarks
+            The vertices of the triangle must be given in either
+            trigonometrical (anticlockwise) or inverse trigonometrical
+            (clockwise) order, and the point must be guaranteed to be in the
+			same plane as the triangle
+        @param
+            p The point.
+        @param
+            a The triangle's first vertex.
+        @param
+            b The triangle's second vertex.
+        @param
+            c The triangle's third vertex.
+		@param 
+			normal The triangle plane's normal (passed in rather than calculated
+				on demand since the callermay already have it)
+        @returns
+            If the point resides in the triangle, <b>true</b> is
+            returned.
+        @par
+            If the point is outside the triangle, <b>false</b> is
+            returned.
+        */
+        static bool pointInTri3D(const Vector3& p, const Vector3& a, 
+			const Vector3& b, const Vector3& c, const Vector3& normal);
+        /** Ray / plane intersection, returns boolean result and distance. */
+        static std::pair<bool, Real> intersects(const Ray& ray, const Plane& plane);
+
+        /** Ray / sphere intersection, returns boolean result and distance. */
+        static std::pair<bool, Real> intersects(const Ray& ray, const Sphere& sphere, 
+            bool discardInside = true);
+        
+        /** Ray / box intersection, returns boolean result and distance. */
+        static std::pair<bool, Real> intersects(const Ray& ray, const AxisAlignedBox& box);
+
+        /** Ray / box intersection, returns boolean result and two intersection distance.
+        @param
+            ray The ray.
+        @param
+            box The box.
+        @param
+            d1 A real pointer to retrieve the near intersection distance
+                from the ray origin, maybe <b>null</b> which means don't care
+                about the near intersection distance.
+        @param
+            d2 A real pointer to retrieve the far intersection distance
+                from the ray origin, maybe <b>null</b> which means don't care
+                about the far intersection distance.
+        @returns
+            If the ray is intersects the box, <b>true</b> is returned, and
+            the near intersection distance is return by <i>d1</i>, the
+            far intersection distance is return by <i>d2</i>. Guarantee
+            <b>0</b> <= <i>d1</i> <= <i>d2</i>.
+        @par
+            If the ray isn't intersects the box, <b>false</b> is returned, and
+            <i>d1</i> and <i>d2</i> is unmodified.
+        */
+        static bool intersects(const Ray& ray, const AxisAlignedBox& box,
+            Real* d1, Real* d2);
+
+        /** Ray / triangle intersection, returns boolean result and distance.
+        @param
+            ray The ray.
+        @param
+            a The triangle's first vertex.
+        @param
+            b The triangle's second vertex.
+        @param
+            c The triangle's third vertex.
+		@param 
+			normal The triangle plane's normal (passed in rather than calculated
+				on demand since the callermay already have it), doesn't need
+                normalised since we don't care.
+        @param
+            positiveSide Intersect with "positive side" of the triangle
+        @param
+            negativeSide Intersect with "negative side" of the triangle
+        @returns
+            If the ray is intersects the triangle, a pair of <b>true</b> and the
+            distance between intersection point and ray origin returned.
+        @par
+            If the ray isn't intersects the triangle, a pair of <b>false</b> and
+            <b>0</b> returned.
+        */
+        static std::pair<bool, Real> intersects(const Ray& ray, const Vector3& a,
+            const Vector3& b, const Vector3& c, const Vector3& normal,
+            bool positiveSide = true, bool negativeSide = true);
+
+        /** Ray / triangle intersection, returns boolean result and distance.
+        @param
+            ray The ray.
+        @param
+            a The triangle's first vertex.
+        @param
+            b The triangle's second vertex.
+        @param
+            c The triangle's third vertex.
+        @param
+            positiveSide Intersect with "positive side" of the triangle
+        @param
+            negativeSide Intersect with "negative side" of the triangle
+        @returns
+            If the ray is intersects the triangle, a pair of <b>true</b> and the
+            distance between intersection point and ray origin returned.
+        @par
+            If the ray isn't intersects the triangle, a pair of <b>false</b> and
+            <b>0</b> returned.
+        */
+        static std::pair<bool, Real> intersects(const Ray& ray, const Vector3& a,
+            const Vector3& b, const Vector3& c,
+            bool positiveSide = true, bool negativeSide = true);
+
+        /** Sphere / box intersection test. */
+        static bool intersects(const Sphere& sphere, const AxisAlignedBox& box);
+
+        /** Plane / box intersection test. */
+        static bool intersects(const Plane& plane, const AxisAlignedBox& box);
+
+        /** Ray / convex plane list intersection test. 
+        @param ray The ray to test with
+        @param plaeList List of planes which form a convex volume
+        @param normalIsOutside Does the normal point outside the volume
+        */
+        static std::pair<bool, Real> intersects(
+            const Ray& ray, const std::vector<Plane>& planeList, 
+            bool normalIsOutside);
+        /** Ray / convex plane list intersection test. 
+        @param ray The ray to test with
+        @param plaeList List of planes which form a convex volume
+        @param normalIsOutside Does the normal point outside the volume
+        */
+        static std::pair<bool, Real> intersects(
+            const Ray& ray, const std::list<Plane>& planeList, 
+            bool normalIsOutside);
+
+        /** Sphere / plane intersection test. 
+        @remarks NB just do a plane.getDistance(sphere.getCenter()) for more detail!
+        */
+        static bool intersects(const Sphere& sphere, const Plane& plane);
+
+        /** Compare 2 reals, using tolerance for inaccuracies.
+        */
+        static bool RealEqual(Real a, Real b,
+            Real tolerance = std::numeric_limits<Real>::epsilon());
+
+        /** Calculates the tangent space vector for a given set of positions / texture coords. */
+        static Vector3 calculateTangentSpaceVector(
+            const Vector3& position1, const Vector3& position2, const Vector3& position3,
+            Real u1, Real v1, Real u2, Real v2, Real u3, Real v3);
+
+        /** Build a reflection matrix for the passed in plane. */
+        static Matrix4 buildReflectionMatrix(const Plane& p);
+        /** Calculate a face normal, including the w component which is the offset from the origin. */
+        static Vector4 calculateFaceNormal(const Vector3& v1, const Vector3& v2, const Vector3& v3);
+        /** Calculate a face normal, no w-information. */
+        static Vector3 calculateBasicFaceNormal(const Vector3& v1, const Vector3& v2, const Vector3& v3);
+        /** Calculate a face normal without normalize, including the w component which is the offset from the origin. */
+        static Vector4 calculateFaceNormalWithoutNormalize(const Vector3& v1, const Vector3& v2, const Vector3& v3);
+        /** Calculate a face normal without normalize, no w-information. */
+        static Vector3 calculateBasicFaceNormalWithoutNormalize(const Vector3& v1, const Vector3& v2, const Vector3& v3);
+
+		/** Generates a value based on the gaussian (normal) distribution function
+			with the given offset and scale parameters.
+		*/
+		static Real gaussianDistribution(Real x, Real offset = 0.0f, Real scale = 1.0f);
+
+        static const Real POS_INFINITY;
+        static const Real NEG_INFINITY;
+        static const Real PI;
+        static const Real TWO_PI;
+        static const Real HALF_PI;
+		static const Real fDeg2Rad;
+		static const Real fRad2Deg;
+
+    };
+
+	// these functions must be defined down here, because they rely on the
+	// angle unit conversion functions in class Math:
+
+	inline Real Radian::valueDegrees() const
+	{
+		return Math::RadiansToDegrees ( mRad );
+	}
+
+	inline Real Radian::valueAngleUnits() const
+	{
+		return Math::RadiansToAngleUnits ( mRad );
+	}
+
+	inline Real Degree::valueRadians() const
+	{
+		return Math::DegreesToRadians ( mDeg );
+	}
+
+	inline Real Degree::valueAngleUnits() const
+	{
+		return Math::DegreesToAngleUnits ( mDeg );
+	}
+
+	inline Angle::operator Radian() const
+	{
+		return Radian(Math::AngleUnitsToRadians(mAngle));
+	}
+
+	inline Angle::operator Degree() const
+	{
+		return Degree(Math::AngleUnitsToDegrees(mAngle));
+	}
+
+	inline Radian operator * ( Real a, const Radian& b )
+	{
+		return Radian ( a * b.valueRadians() );
+	}
+
+	inline Radian operator / ( Real a, const Radian& b )
+	{
+		return Radian ( a / b.valueRadians() );
+	}
+
+	inline Degree operator * ( Real a, const Degree& b )
+	{
+		return Degree ( a * b.valueDegrees() );
+	}
+
+	inline Degree operator / ( Real a, const Degree& b )
+	{
+		return Degree ( a / b.valueDegrees() );
+	}
+
+}
+#endif
Index: /OgreMain/include/OgreMatrix3.h
===================================================================
--- /OgreMain/include/OgreMatrix3.h	(revision 5)
+++ /OgreMain/include/OgreMatrix3.h	(revision 5)
@@ -0,0 +1,306 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Matrix3_H__
+#define __Matrix3_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreVector3.h"
+
+// NB All code adapted from Wild Magic 0.2 Matrix math (free source code)
+// http://www.geometrictools.com/
+
+// NOTE.  The (x,y,z) coordinate system is assumed to be right-handed.
+// Coordinate axis rotation matrices are of the form
+//   RX =    1       0       0
+//           0     cos(t) -sin(t)
+//           0     sin(t)  cos(t)
+// where t > 0 indicates a counterclockwise rotation in the yz-plane
+//   RY =  cos(t)    0     sin(t)
+//           0       1       0
+//        -sin(t)    0     cos(t)
+// where t > 0 indicates a counterclockwise rotation in the zx-plane
+//   RZ =  cos(t) -sin(t)    0
+//         sin(t)  cos(t)    0
+//           0       0       1
+// where t > 0 indicates a counterclockwise rotation in the xy-plane.
+
+namespace Ogre
+{
+    /** A 3x3 matrix which can represent rotations around axes.
+        @note
+            <b>All the code is adapted from the Wild Magic 0.2 Matrix
+            library (http://www.geometrictools.com/).</b>
+        @par
+            The coordinate system is assumed to be <b>right-handed</b>.
+    */
+    class _OgreExport Matrix3
+    {
+    public:
+        /** Default constructor.
+            @note
+                It does <b>NOT</b> initialize the matrix for efficiency.
+        */
+		inline Matrix3 () {};
+        inline explicit Matrix3 (const Real arr[3][3])
+		{
+			memcpy(m,arr,9*sizeof(Real));
+		}
+        inline Matrix3 (const Matrix3& rkMatrix)
+		{
+			memcpy(m,rkMatrix.m,9*sizeof(Real));
+		}
+        Matrix3 (Real fEntry00, Real fEntry01, Real fEntry02,
+                    Real fEntry10, Real fEntry11, Real fEntry12,
+                    Real fEntry20, Real fEntry21, Real fEntry22)
+		{
+			m[0][0] = fEntry00;
+			m[0][1] = fEntry01;
+			m[0][2] = fEntry02;
+			m[1][0] = fEntry10;
+			m[1][1] = fEntry11;
+			m[1][2] = fEntry12;
+			m[2][0] = fEntry20;
+			m[2][1] = fEntry21;
+			m[2][2] = fEntry22;
+		}
+
+        // member access, allows use of construct mat[r][c]
+        inline Real* operator[] (size_t iRow) const
+		{
+			return (Real*)m[iRow];
+		}
+        /*inline operator Real* ()
+		{
+			return (Real*)m[0];
+		}*/
+        Vector3 GetColumn (size_t iCol) const;
+        void SetColumn(size_t iCol, const Vector3& vec);
+        void FromAxes(const Vector3& xAxis, const Vector3& yAxis, const Vector3& zAxis);
+
+        // assignment and comparison
+        inline Matrix3& operator= (const Matrix3& rkMatrix)
+		{
+			memcpy(m,rkMatrix.m,9*sizeof(Real));
+			return *this;
+		}
+        bool operator== (const Matrix3& rkMatrix) const;
+        inline bool operator!= (const Matrix3& rkMatrix) const
+		{
+			return !operator==(rkMatrix);
+		}
+
+        // arithmetic operations
+        Matrix3 operator+ (const Matrix3& rkMatrix) const;
+        Matrix3 operator- (const Matrix3& rkMatrix) const;
+        Matrix3 operator* (const Matrix3& rkMatrix) const;
+        Matrix3 operator- () const;
+
+        // matrix * vector [3x3 * 3x1 = 3x1]
+        Vector3 operator* (const Vector3& rkVector) const;
+
+        // vector * matrix [1x3 * 3x3 = 1x3]
+        _OgreExport friend Vector3 operator* (const Vector3& rkVector,
+            const Matrix3& rkMatrix);
+
+        // matrix * scalar
+        Matrix3 operator* (Real fScalar) const;
+
+        // scalar * matrix
+        _OgreExport friend Matrix3 operator* (Real fScalar, const Matrix3& rkMatrix);
+
+        // utilities
+        Matrix3 Transpose () const;
+        bool Inverse (Matrix3& rkInverse, Real fTolerance = 1e-06) const;
+        Matrix3 Inverse (Real fTolerance = 1e-06) const;
+        Real Determinant () const;
+
+        // singular value decomposition
+        void SingularValueDecomposition (Matrix3& rkL, Vector3& rkS,
+            Matrix3& rkR) const;
+        void SingularValueComposition (const Matrix3& rkL,
+            const Vector3& rkS, const Matrix3& rkR);
+
+        // Gram-Schmidt orthonormalization (applied to columns of rotation matrix)
+        void Orthonormalize ();
+
+        // orthogonal Q, diagonal D, upper triangular U stored as (u01,u02,u12)
+        void QDUDecomposition (Matrix3& rkQ, Vector3& rkD,
+            Vector3& rkU) const;
+
+        Real SpectralNorm () const;
+
+        // matrix must be orthonormal
+        void ToAxisAngle (Vector3& rkAxis, Radian& rfAngle) const;
+		inline void ToAxisAngle (Vector3& rkAxis, Degree& rfAngle) const {
+			Radian r;
+			ToAxisAngle ( rkAxis, r );
+			rfAngle = r;
+		}
+        void FromAxisAngle (const Vector3& rkAxis, const Radian& fRadians);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void ToAxisAngle (Vector3& rkAxis, Real& rfRadians) const {
+			Radian r;
+			ToAxisAngle ( rkAxis, r );
+			rfRadians = r.valueRadians();
+		}
+        inline void FromAxisAngle (const Vector3& rkAxis, Real fRadians) {
+			FromAxisAngle ( rkAxis, Radian(fRadians) );
+		}
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        // The matrix must be orthonormal.  The decomposition is yaw*pitch*roll
+        // where yaw is rotation about the Up vector, pitch is rotation about the
+        // Right axis, and roll is rotation about the Direction axis.
+        bool ToEulerAnglesXYZ (Radian& rfYAngle, Radian& rfPAngle,
+            Radian& rfRAngle) const;
+        bool ToEulerAnglesXZY (Radian& rfYAngle, Radian& rfPAngle,
+            Radian& rfRAngle) const;
+        bool ToEulerAnglesYXZ (Radian& rfYAngle, Radian& rfPAngle,
+            Radian& rfRAngle) const;
+        bool ToEulerAnglesYZX (Radian& rfYAngle, Radian& rfPAngle,
+            Radian& rfRAngle) const;
+        bool ToEulerAnglesZXY (Radian& rfYAngle, Radian& rfPAngle,
+            Radian& rfRAngle) const;
+        bool ToEulerAnglesZYX (Radian& rfYAngle, Radian& rfPAngle,
+            Radian& rfRAngle) const;
+        void FromEulerAnglesXYZ (const Radian& fYAngle, const Radian& fPAngle, const Radian& fRAngle);
+        void FromEulerAnglesXZY (const Radian& fYAngle, const Radian& fPAngle, const Radian& fRAngle);
+        void FromEulerAnglesYXZ (const Radian& fYAngle, const Radian& fPAngle, const Radian& fRAngle);
+        void FromEulerAnglesYZX (const Radian& fYAngle, const Radian& fPAngle, const Radian& fRAngle);
+        void FromEulerAnglesZXY (const Radian& fYAngle, const Radian& fPAngle, const Radian& fRAngle);
+        void FromEulerAnglesZYX (const Radian& fYAngle, const Radian& fPAngle, const Radian& fRAngle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline bool ToEulerAnglesXYZ (float& rfYAngle, float& rfPAngle,
+            float& rfRAngle) const {
+			Radian y, p, r;
+			bool b = ToEulerAnglesXYZ(y,p,r);
+			rfYAngle = y.valueRadians();
+			rfPAngle = p.valueRadians();
+			rfRAngle = r.valueRadians();
+			return b;
+		}
+        inline bool ToEulerAnglesXZY (float& rfYAngle, float& rfPAngle,
+            float& rfRAngle) const {
+			Radian y, p, r;
+			bool b = ToEulerAnglesXZY(y,p,r);
+			rfYAngle = y.valueRadians();
+			rfPAngle = p.valueRadians();
+			rfRAngle = r.valueRadians();
+			return b;
+		}
+        inline bool ToEulerAnglesYXZ (float& rfYAngle, float& rfPAngle,
+            float& rfRAngle) const {
+			Radian y, p, r;
+			bool b = ToEulerAnglesYXZ(y,p,r);
+			rfYAngle = y.valueRadians();
+			rfPAngle = p.valueRadians();
+			rfRAngle = r.valueRadians();
+			return b;
+		}
+        inline bool ToEulerAnglesYZX (float& rfYAngle, float& rfPAngle,
+            float& rfRAngle) const {
+			Radian y, p, r;
+			bool b = ToEulerAnglesYZX(y,p,r);
+			rfYAngle = y.valueRadians();
+			rfPAngle = p.valueRadians();
+			rfRAngle = r.valueRadians();
+			return b;
+		}
+        inline bool ToEulerAnglesZXY (float& rfYAngle, float& rfPAngle,
+            float& rfRAngle) const {
+			Radian y, p, r;
+			bool b = ToEulerAnglesZXY(y,p,r);
+			rfYAngle = y.valueRadians();
+			rfPAngle = p.valueRadians();
+			rfRAngle = r.valueRadians();
+			return b;
+		}
+        inline bool ToEulerAnglesZYX (float& rfYAngle, float& rfPAngle,
+            float& rfRAngle) const {
+			Radian y, p, r;
+			bool b = ToEulerAnglesZYX(y,p,r);
+			rfYAngle = y.valueRadians();
+			rfPAngle = p.valueRadians();
+			rfRAngle = r.valueRadians();
+			return b;
+		}
+        inline void FromEulerAnglesXYZ (float fYAngle, float fPAngle, float fRAngle) {
+			FromEulerAnglesXYZ ( Radian(fYAngle), Radian(fPAngle), Radian(fRAngle) );
+		}
+        inline void FromEulerAnglesXZY (float fYAngle, float fPAngle, float fRAngle) {
+			FromEulerAnglesXZY ( Radian(fYAngle), Radian(fPAngle), Radian(fRAngle) );
+		}
+        inline void FromEulerAnglesYXZ (float fYAngle, float fPAngle, float fRAngle) {
+			FromEulerAnglesYXZ ( Radian(fYAngle), Radian(fPAngle), Radian(fRAngle) );
+		}
+        inline void FromEulerAnglesYZX (float fYAngle, float fPAngle, float fRAngle) {
+			FromEulerAnglesYZX ( Radian(fYAngle), Radian(fPAngle), Radian(fRAngle) );
+		}
+        inline void FromEulerAnglesZXY (float fYAngle, float fPAngle, float fRAngle) {
+			FromEulerAnglesZXY ( Radian(fYAngle), Radian(fPAngle), Radian(fRAngle) );
+		}
+        inline void FromEulerAnglesZYX (float fYAngle, float fPAngle, float fRAngle) {
+			FromEulerAnglesZYX ( Radian(fYAngle), Radian(fPAngle), Radian(fRAngle) );
+		}
+#endif//OGRE_FORCE_ANGLE_TYPES
+        // eigensolver, matrix must be symmetric
+        void EigenSolveSymmetric (Real afEigenvalue[3],
+            Vector3 akEigenvector[3]) const;
+
+        static void TensorProduct (const Vector3& rkU, const Vector3& rkV,
+            Matrix3& rkProduct);
+
+        static const Real EPSILON;
+        static const Matrix3 ZERO;
+        static const Matrix3 IDENTITY;
+
+    protected:
+        // support for eigensolver
+        void Tridiagonal (Real afDiag[3], Real afSubDiag[3]);
+        bool QLAlgorithm (Real afDiag[3], Real afSubDiag[3]);
+
+        // support for singular value decomposition
+        static const Real ms_fSvdEpsilon;
+        static const unsigned int ms_iSvdMaxIterations;
+        static void Bidiagonalize (Matrix3& kA, Matrix3& kL,
+            Matrix3& kR);
+        static void GolubKahanStep (Matrix3& kA, Matrix3& kL,
+            Matrix3& kR);
+
+        // support for spectral norm
+        static Real MaxCubicRoot (Real afCoeff[3]);
+
+        Real m[3][3];
+
+        // for faster access
+        friend class Matrix4;
+    };
+}
+#endif
Index: /OgreMain/include/OgreMatrix4.h
===================================================================
--- /OgreMain/include/OgreMatrix4.h	(revision 5)
+++ /OgreMain/include/OgreMatrix4.h	(revision 5)
@@ -0,0 +1,603 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Matrix4__
+#define __Matrix4__
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+
+#include "OgreVector3.h"
+#include "OgreMatrix3.h"
+#include "OgreVector4.h"
+#include "OgrePlane.h"
+namespace Ogre
+{
+    /** Class encapsulating a standard 4x4 homogenous matrix.
+        @remarks
+            OGRE uses column vectors when applying matrix multiplications,
+            This means a vector is represented as a single column, 4-row
+            matrix. This has the effect that the tranformations implemented
+            by the matrices happens right-to-left e.g. if vector V is to be
+            transformed by M1 then M2 then M3, the calculation would be
+            M3 * M2 * M1 * V. The order that matrices are concatenated is
+            vital since matrix multiplication is not cummatative, i.e. you
+            can get a different result if you concatenate in the wrong order.
+        @par
+            The use of column vectors and right-to-left ordering is the
+            standard in most mathematical texts, and id the same as used in
+            OpenGL. It is, however, the opposite of Direct3D, which has
+            inexplicably chosen to differ from the accepted standard and uses
+            row vectors and left-to-right matrix multiplication.
+        @par
+            OGRE deals with the differences between D3D and OpenGL etc.
+            internally when operating through different render systems. OGRE
+            users only need to conform to standard maths conventions, i.e.
+            right-to-left matrix multiplication, (OGRE transposes matrices it
+            passes to D3D to compensate).
+        @par
+            The generic form M * V which shows the layout of the matrix 
+            entries is shown below:
+            <pre>
+                [ m[0][0]  m[0][1]  m[0][2]  m[0][3] ]   {x}
+                | m[1][0]  m[1][1]  m[1][2]  m[1][3] | * {y}
+                | m[2][0]  m[2][1]  m[2][2]  m[2][3] |   {z}
+                [ m[3][0]  m[3][1]  m[3][2]  m[3][3] ]   {1}
+            </pre>
+    */
+    class _OgreExport Matrix4
+    {
+    protected:
+        /// The matrix entries, indexed by [row][col].
+        union {
+            Real m[4][4];
+            Real _m[16];
+        };
+    public:
+        /** Default constructor.
+            @note
+                It does <b>NOT</b> initialize the matrix for efficiency.
+        */
+        inline Matrix4()
+        {
+        }
+
+        inline Matrix4(
+            Real m00, Real m01, Real m02, Real m03,
+            Real m10, Real m11, Real m12, Real m13,
+            Real m20, Real m21, Real m22, Real m23,
+            Real m30, Real m31, Real m32, Real m33 )
+        {
+            m[0][0] = m00;
+            m[0][1] = m01;
+            m[0][2] = m02;
+            m[0][3] = m03;
+            m[1][0] = m10;
+            m[1][1] = m11;
+            m[1][2] = m12;
+            m[1][3] = m13;
+            m[2][0] = m20;
+            m[2][1] = m21;
+            m[2][2] = m22;
+            m[2][3] = m23;
+            m[3][0] = m30;
+            m[3][1] = m31;
+            m[3][2] = m32;
+            m[3][3] = m33;
+        }
+
+        /** Creates a standard 4x4 transformation matrix with a zero translation part from a rotation/scaling 3x3 matrix.
+         */
+
+        inline Matrix4(const Matrix3& m3x3)
+        {
+          operator=(IDENTITY);
+          operator=(m3x3);
+        }
+
+        /** Creates a standard 4x4 transformation matrix with a zero translation part from a rotation/scaling Quaternion.
+         */
+        
+        inline Matrix4(const Quaternion& rot)
+        {
+          Matrix3 m3x3;
+          rot.ToRotationMatrix(m3x3);
+          operator=(IDENTITY);
+          operator=(m3x3);
+        }
+        
+
+        inline Real* operator [] ( size_t iRow )
+        {
+            assert( iRow < 4 );
+            return m[iRow];
+        }
+
+        inline const Real *const operator [] ( size_t iRow ) const
+        {
+            assert( iRow < 4 );
+            return m[iRow];
+        }
+
+        inline Matrix4 concatenate(const Matrix4 &m2) const
+        {
+            Matrix4 r;
+            r.m[0][0] = m[0][0] * m2.m[0][0] + m[0][1] * m2.m[1][0] + m[0][2] * m2.m[2][0] + m[0][3] * m2.m[3][0];
+            r.m[0][1] = m[0][0] * m2.m[0][1] + m[0][1] * m2.m[1][1] + m[0][2] * m2.m[2][1] + m[0][3] * m2.m[3][1];
+            r.m[0][2] = m[0][0] * m2.m[0][2] + m[0][1] * m2.m[1][2] + m[0][2] * m2.m[2][2] + m[0][3] * m2.m[3][2];
+            r.m[0][3] = m[0][0] * m2.m[0][3] + m[0][1] * m2.m[1][3] + m[0][2] * m2.m[2][3] + m[0][3] * m2.m[3][3];
+
+            r.m[1][0] = m[1][0] * m2.m[0][0] + m[1][1] * m2.m[1][0] + m[1][2] * m2.m[2][0] + m[1][3] * m2.m[3][0];
+            r.m[1][1] = m[1][0] * m2.m[0][1] + m[1][1] * m2.m[1][1] + m[1][2] * m2.m[2][1] + m[1][3] * m2.m[3][1];
+            r.m[1][2] = m[1][0] * m2.m[0][2] + m[1][1] * m2.m[1][2] + m[1][2] * m2.m[2][2] + m[1][3] * m2.m[3][2];
+            r.m[1][3] = m[1][0] * m2.m[0][3] + m[1][1] * m2.m[1][3] + m[1][2] * m2.m[2][3] + m[1][3] * m2.m[3][3];
+
+            r.m[2][0] = m[2][0] * m2.m[0][0] + m[2][1] * m2.m[1][0] + m[2][2] * m2.m[2][0] + m[2][3] * m2.m[3][0];
+            r.m[2][1] = m[2][0] * m2.m[0][1] + m[2][1] * m2.m[1][1] + m[2][2] * m2.m[2][1] + m[2][3] * m2.m[3][1];
+            r.m[2][2] = m[2][0] * m2.m[0][2] + m[2][1] * m2.m[1][2] + m[2][2] * m2.m[2][2] + m[2][3] * m2.m[3][2];
+            r.m[2][3] = m[2][0] * m2.m[0][3] + m[2][1] * m2.m[1][3] + m[2][2] * m2.m[2][3] + m[2][3] * m2.m[3][3];
+
+            r.m[3][0] = m[3][0] * m2.m[0][0] + m[3][1] * m2.m[1][0] + m[3][2] * m2.m[2][0] + m[3][3] * m2.m[3][0];
+            r.m[3][1] = m[3][0] * m2.m[0][1] + m[3][1] * m2.m[1][1] + m[3][2] * m2.m[2][1] + m[3][3] * m2.m[3][1];
+            r.m[3][2] = m[3][0] * m2.m[0][2] + m[3][1] * m2.m[1][2] + m[3][2] * m2.m[2][2] + m[3][3] * m2.m[3][2];
+            r.m[3][3] = m[3][0] * m2.m[0][3] + m[3][1] * m2.m[1][3] + m[3][2] * m2.m[2][3] + m[3][3] * m2.m[3][3];
+
+            return r;
+        }
+
+        /** Matrix concatenation using '*'.
+        */
+        inline Matrix4 operator * ( const Matrix4 &m2 ) const
+        {
+            return concatenate( m2 );
+        }
+
+        /** Vector transformation using '*'.
+            @remarks
+                Transforms the given 3-D vector by the matrix, projecting the 
+                result back into <i>w</i> = 1.
+            @note
+                This means that the initial <i>w</i> is considered to be 1.0,
+                and then all the tree elements of the resulting 3-D vector are
+                divided by the resulting <i>w</i>.
+        */
+        inline Vector3 operator * ( const Vector3 &v ) const
+        {
+            Vector3 r;
+
+            Real fInvW = 1.0 / ( m[3][0] * v.x + m[3][1] * v.y + m[3][2] * v.z + m[3][3] );
+
+            r.x = ( m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3] ) * fInvW;
+            r.y = ( m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3] ) * fInvW;
+            r.z = ( m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3] ) * fInvW;
+
+            return r;
+        }
+        inline Vector4 operator * (const Vector4& v) const
+        {
+            return Vector4(
+                m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3] * v.w, 
+                m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3] * v.w,
+                m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3] * v.w,
+                m[3][0] * v.x + m[3][1] * v.y + m[3][2] * v.z + m[3][3] * v.w
+                );
+        }
+        inline Plane operator * (const Plane& p) const
+        {
+            Plane ret;
+			Matrix4 invTrans = inverse().transpose();
+			Vector4 v4( p.normal.x, p.normal.y, p.normal.z, p.d );
+			v4 = invTrans * v4;
+			ret.normal.x = v4.x; 
+			ret.normal.y = v4.y; 
+			ret.normal.z = v4.z;
+			ret.d = v4.w / ret.normal.normalise();
+
+            return ret;
+        }
+
+
+        /** Matrix addition.
+        */
+        inline Matrix4 operator + ( const Matrix4 &m2 ) const
+        {
+            Matrix4 r;
+
+            r.m[0][0] = m[0][0] + m2.m[0][0];
+            r.m[0][1] = m[0][1] + m2.m[0][1];
+            r.m[0][2] = m[0][2] + m2.m[0][2];
+            r.m[0][3] = m[0][3] + m2.m[0][3];
+
+            r.m[1][0] = m[1][0] + m2.m[1][0];
+            r.m[1][1] = m[1][1] + m2.m[1][1];
+            r.m[1][2] = m[1][2] + m2.m[1][2];
+            r.m[1][3] = m[1][3] + m2.m[1][3];
+
+            r.m[2][0] = m[2][0] + m2.m[2][0];
+            r.m[2][1] = m[2][1] + m2.m[2][1];
+            r.m[2][2] = m[2][2] + m2.m[2][2];
+            r.m[2][3] = m[2][3] + m2.m[2][3];
+
+            r.m[3][0] = m[3][0] + m2.m[3][0];
+            r.m[3][1] = m[3][1] + m2.m[3][1];
+            r.m[3][2] = m[3][2] + m2.m[3][2];
+            r.m[3][3] = m[3][3] + m2.m[3][3];
+
+            return r;
+        }
+
+        /** Matrix subtraction.
+        */
+        inline Matrix4 operator - ( const Matrix4 &m2 ) const
+        {
+            Matrix4 r;
+            r.m[0][0] = m[0][0] - m2.m[0][0];
+            r.m[0][1] = m[0][1] - m2.m[0][1];
+            r.m[0][2] = m[0][2] - m2.m[0][2];
+            r.m[0][3] = m[0][3] - m2.m[0][3];
+
+            r.m[1][0] = m[1][0] - m2.m[1][0];
+            r.m[1][1] = m[1][1] - m2.m[1][1];
+            r.m[1][2] = m[1][2] - m2.m[1][2];
+            r.m[1][3] = m[1][3] - m2.m[1][3];
+
+            r.m[2][0] = m[2][0] - m2.m[2][0];
+            r.m[2][1] = m[2][1] - m2.m[2][1];
+            r.m[2][2] = m[2][2] - m2.m[2][2];
+            r.m[2][3] = m[2][3] - m2.m[2][3];
+
+            r.m[3][0] = m[3][0] - m2.m[3][0];
+            r.m[3][1] = m[3][1] - m2.m[3][1];
+            r.m[3][2] = m[3][2] - m2.m[3][2];
+            r.m[3][3] = m[3][3] - m2.m[3][3];
+
+            return r;
+        }
+
+        /** Tests 2 matrices for equality.
+        */
+        inline bool operator == ( const Matrix4& m2 ) const
+        {
+            if( 
+                m[0][0] != m2.m[0][0] || m[0][1] != m2.m[0][1] || m[0][2] != m2.m[0][2] || m[0][3] != m2.m[0][3] ||
+                m[1][0] != m2.m[1][0] || m[1][1] != m2.m[1][1] || m[1][2] != m2.m[1][2] || m[1][3] != m2.m[1][3] ||
+                m[2][0] != m2.m[2][0] || m[2][1] != m2.m[2][1] || m[2][2] != m2.m[2][2] || m[2][3] != m2.m[2][3] ||
+                m[3][0] != m2.m[3][0] || m[3][1] != m2.m[3][1] || m[3][2] != m2.m[3][2] || m[3][3] != m2.m[3][3] )
+                return false;
+            return true;
+        }
+
+        /** Tests 2 matrices for inequality.
+        */
+        inline bool operator != ( const Matrix4& m2 ) const
+        {
+            if( 
+                m[0][0] != m2.m[0][0] || m[0][1] != m2.m[0][1] || m[0][2] != m2.m[0][2] || m[0][3] != m2.m[0][3] ||
+                m[1][0] != m2.m[1][0] || m[1][1] != m2.m[1][1] || m[1][2] != m2.m[1][2] || m[1][3] != m2.m[1][3] ||
+                m[2][0] != m2.m[2][0] || m[2][1] != m2.m[2][1] || m[2][2] != m2.m[2][2] || m[2][3] != m2.m[2][3] ||
+                m[3][0] != m2.m[3][0] || m[3][1] != m2.m[3][1] || m[3][2] != m2.m[3][2] || m[3][3] != m2.m[3][3] )
+                return true;
+            return false;
+        }
+
+        /** Assignment from 3x3 matrix.
+        */
+        inline void operator = ( const Matrix3& mat3 )
+        {
+            m[0][0] = mat3.m[0][0]; m[0][1] = mat3.m[0][1]; m[0][2] = mat3.m[0][2];
+            m[1][0] = mat3.m[1][0]; m[1][1] = mat3.m[1][1]; m[1][2] = mat3.m[1][2];
+            m[2][0] = mat3.m[2][0]; m[2][1] = mat3.m[2][1]; m[2][2] = mat3.m[2][2];
+        }
+
+        inline Matrix4 transpose(void) const
+        {
+            return Matrix4(m[0][0], m[1][0], m[2][0], m[3][0],
+                           m[0][1], m[1][1], m[2][1], m[3][1],
+                           m[0][2], m[1][2], m[2][2], m[3][2],
+                           m[0][3], m[1][3], m[2][3], m[3][3]);
+        }
+
+        /*
+        -----------------------------------------------------------------------
+        Translation Transformation
+        -----------------------------------------------------------------------
+        */
+        /** Sets the translation transformation part of the matrix.
+        */
+        inline void setTrans( const Vector3& v )
+        {
+            m[0][3] = v.x;
+            m[1][3] = v.y;
+            m[2][3] = v.z;
+        }
+
+        /** Extracts the translation transformation part of the matrix.
+         */
+        inline Vector3 getTrans() const
+        {
+          return Vector3(m[0][3], m[1][3], m[2][3]);
+        }
+        
+
+        /** Builds a translation matrix
+        */
+        inline void makeTrans( const Vector3& v )
+        {
+            m[0][0] = 1.0; m[0][1] = 0.0; m[0][2] = 0.0; m[0][3] = v.x;
+            m[1][0] = 0.0; m[1][1] = 1.0; m[1][2] = 0.0; m[1][3] = v.y;
+            m[2][0] = 0.0; m[2][1] = 0.0; m[2][2] = 1.0; m[2][3] = v.z;
+            m[3][0] = 0.0; m[3][1] = 0.0; m[3][2] = 0.0; m[3][3] = 1.0;
+        }
+
+        inline void makeTrans( Real tx, Real ty, Real tz )
+        {
+            m[0][0] = 1.0; m[0][1] = 0.0; m[0][2] = 0.0; m[0][3] = tx;
+            m[1][0] = 0.0; m[1][1] = 1.0; m[1][2] = 0.0; m[1][3] = ty;
+            m[2][0] = 0.0; m[2][1] = 0.0; m[2][2] = 1.0; m[2][3] = tz;
+            m[3][0] = 0.0; m[3][1] = 0.0; m[3][2] = 0.0; m[3][3] = 1.0;
+        }
+
+        /** Gets a translation matrix.
+        */
+        inline static Matrix4 getTrans( const Vector3& v )
+        {
+            Matrix4 r;
+
+            r.m[0][0] = 1.0; r.m[0][1] = 0.0; r.m[0][2] = 0.0; r.m[0][3] = v.x;
+            r.m[1][0] = 0.0; r.m[1][1] = 1.0; r.m[1][2] = 0.0; r.m[1][3] = v.y;
+            r.m[2][0] = 0.0; r.m[2][1] = 0.0; r.m[2][2] = 1.0; r.m[2][3] = v.z;
+            r.m[3][0] = 0.0; r.m[3][1] = 0.0; r.m[3][2] = 0.0; r.m[3][3] = 1.0;
+
+            return r;
+        }
+
+        /** Gets a translation matrix - variation for not using a vector.
+        */
+        inline static Matrix4 getTrans( Real t_x, Real t_y, Real t_z )
+        {
+            Matrix4 r;
+
+            r.m[0][0] = 1.0; r.m[0][1] = 0.0; r.m[0][2] = 0.0; r.m[0][3] = t_x;
+            r.m[1][0] = 0.0; r.m[1][1] = 1.0; r.m[1][2] = 0.0; r.m[1][3] = t_y;
+            r.m[2][0] = 0.0; r.m[2][1] = 0.0; r.m[2][2] = 1.0; r.m[2][3] = t_z;
+            r.m[3][0] = 0.0; r.m[3][1] = 0.0; r.m[3][2] = 0.0; r.m[3][3] = 1.0;
+
+            return r;
+        }
+
+        /*
+        -----------------------------------------------------------------------
+        Scale Transformation
+        -----------------------------------------------------------------------
+        */
+        /** Sets the scale part of the matrix.
+        */
+        inline void setScale( const Vector3& v )
+        {
+            m[0][0] = v.x;
+            m[1][1] = v.y;
+            m[2][2] = v.z;
+        }
+
+        /** Gets a scale matrix.
+        */
+        inline static Matrix4 getScale( const Vector3& v )
+        {
+            Matrix4 r;
+            r.m[0][0] = v.x; r.m[0][1] = 0.0; r.m[0][2] = 0.0; r.m[0][3] = 0.0;
+            r.m[1][0] = 0.0; r.m[1][1] = v.y; r.m[1][2] = 0.0; r.m[1][3] = 0.0;
+            r.m[2][0] = 0.0; r.m[2][1] = 0.0; r.m[2][2] = v.z; r.m[2][3] = 0.0;
+            r.m[3][0] = 0.0; r.m[3][1] = 0.0; r.m[3][2] = 0.0; r.m[3][3] = 1.0;
+
+            return r;
+        }
+
+        /** Gets a scale matrix - variation for not using a vector.
+        */
+        inline static Matrix4 getScale( Real s_x, Real s_y, Real s_z )
+        {
+            Matrix4 r;
+            r.m[0][0] = s_x; r.m[0][1] = 0.0; r.m[0][2] = 0.0; r.m[0][3] = 0.0;
+            r.m[1][0] = 0.0; r.m[1][1] = s_y; r.m[1][2] = 0.0; r.m[1][3] = 0.0;
+            r.m[2][0] = 0.0; r.m[2][1] = 0.0; r.m[2][2] = s_z; r.m[2][3] = 0.0;
+            r.m[3][0] = 0.0; r.m[3][1] = 0.0; r.m[3][2] = 0.0; r.m[3][3] = 1.0;
+
+            return r;
+        }
+
+        /** Extracts the rotation / scaling part of the Matrix as a 3x3 matrix. 
+        @param m3x3 Destination Matrix3
+        */
+        inline void extract3x3Matrix(Matrix3& m3x3) const
+        {
+            m3x3.m[0][0] = m[0][0];
+            m3x3.m[0][1] = m[0][1];
+            m3x3.m[0][2] = m[0][2];
+            m3x3.m[1][0] = m[1][0];
+            m3x3.m[1][1] = m[1][1];
+            m3x3.m[1][2] = m[1][2];
+            m3x3.m[2][0] = m[2][0];
+            m3x3.m[2][1] = m[2][1];
+            m3x3.m[2][2] = m[2][2];
+
+        }
+
+        /** Extracts the rotation / scaling part as a quaternion from the Matrix.
+         */
+        inline Quaternion extractQuaternion() const
+        {
+          Matrix3 m3x3;
+          extract3x3Matrix(m3x3);
+          return Quaternion(m3x3);
+        }
+
+        static const Matrix4 ZERO;
+        static const Matrix4 IDENTITY;
+        /** Useful little matrix which takes 2D clipspace {-1, 1} to {0,1}
+            and inverts the Y. */
+        static const Matrix4 CLIPSPACE2DTOIMAGESPACE;
+
+        inline Matrix4 operator*(Real scalar) const
+        {
+            return Matrix4(
+                scalar*m[0][0], scalar*m[0][1], scalar*m[0][2], scalar*m[0][3],
+                scalar*m[1][0], scalar*m[1][1], scalar*m[1][2], scalar*m[1][3],
+                scalar*m[2][0], scalar*m[2][1], scalar*m[2][2], scalar*m[2][3],
+                scalar*m[3][0], scalar*m[3][1], scalar*m[3][2], scalar*m[3][3]);
+        }
+
+        /** Function for writing to a stream.
+        */
+        inline _OgreExport friend std::ostream& operator <<
+            ( std::ostream& o, const Matrix4& m )
+        {
+            o << "Matrix4(";
+			for (size_t i = 0; i < 4; ++i)
+            {
+                o << " row" << (unsigned)i << "{";
+                for(size_t j = 0; j < 4; ++j)
+                {
+                    o << m[i][j] << " ";
+                }
+                o << "}";
+            }
+            o << ")";
+            return o;
+        }
+		
+		Matrix4 adjoint() const;
+		Real determinant() const;
+		Matrix4 inverse() const;
+
+        /** Building a Matrix4 from orientation / scale / position.
+        @remarks
+            Transform is performed in the order scale, rotate, translation, i.e. translation is independent
+            of orientation axes, scale does not affect size of translation, rotation and scaling are always
+            centered on the origin.
+        */
+        void makeTransform(const Vector3& position, const Vector3& scale, const Quaternion& orientation);
+
+        /** Building an inverse Matrix4 from orientation / scale / position.
+        @remarks
+            As makeTransform except it build the inverse given the same data as makeTransform, so
+            performing -translation, -rotate, 1/scale in that order.
+        */
+        void makeInverseTransform(const Vector3& position, const Vector3& scale, const Quaternion& orientation);
+
+        /** Check whether or not the matrix is affine matrix.
+            @remarks
+                An affine matrix is a 4x4 matrix with row 3 equal to (0, 0, 0, 1),
+                e.g. no projective coefficients.
+        */
+        inline bool isAffine(void) const
+        {
+            return m[3][0] == 0 && m[3][1] == 0 && m[3][2] == 0 && m[3][3] == 1;
+        }
+
+        /** Returns the inverse of the affine matrix.
+            @note
+                The matrix must be an affine matrix. @see Matrix4::isAffine.
+        */
+        Matrix4 inverseAffine(void) const;
+
+        /** Concatenate two affine matrix.
+            @note
+                The matrices must be affine matrix. @see Matrix4::isAffine.
+        */
+        inline Matrix4 concatenateAffine(const Matrix4 &m2) const
+        {
+            assert(isAffine() && m2.isAffine());
+
+            return Matrix4(
+                m[0][0] * m2.m[0][0] + m[0][1] * m2.m[1][0] + m[0][2] * m2.m[2][0],
+                m[0][0] * m2.m[0][1] + m[0][1] * m2.m[1][1] + m[0][2] * m2.m[2][1],
+                m[0][0] * m2.m[0][2] + m[0][1] * m2.m[1][2] + m[0][2] * m2.m[2][2],
+                m[0][0] * m2.m[0][3] + m[0][1] * m2.m[1][3] + m[0][2] * m2.m[2][3] + m[0][3],
+
+                m[1][0] * m2.m[0][0] + m[1][1] * m2.m[1][0] + m[1][2] * m2.m[2][0],
+                m[1][0] * m2.m[0][1] + m[1][1] * m2.m[1][1] + m[1][2] * m2.m[2][1],
+                m[1][0] * m2.m[0][2] + m[1][1] * m2.m[1][2] + m[1][2] * m2.m[2][2],
+                m[1][0] * m2.m[0][3] + m[1][1] * m2.m[1][3] + m[1][2] * m2.m[2][3] + m[1][3],
+
+                m[2][0] * m2.m[0][0] + m[2][1] * m2.m[1][0] + m[2][2] * m2.m[2][0],
+                m[2][0] * m2.m[0][1] + m[2][1] * m2.m[1][1] + m[2][2] * m2.m[2][1],
+                m[2][0] * m2.m[0][2] + m[2][1] * m2.m[1][2] + m[2][2] * m2.m[2][2],
+                m[2][0] * m2.m[0][3] + m[2][1] * m2.m[1][3] + m[2][2] * m2.m[2][3] + m[2][3],
+
+                0, 0, 0, 1);
+        }
+
+        /** 3-D Vector transformation specially for affine matrix.
+            @remarks
+                Transforms the given 3-D vector by the matrix, projecting the 
+                result back into <i>w</i> = 1.
+            @note
+                The matrix must be an affine matrix. @see Matrix4::isAffine.
+        */
+        inline Vector3 transformAffine(const Vector3& v) const
+        {
+            assert(isAffine());
+
+            return Vector3(
+                    m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3], 
+                    m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3],
+                    m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3]);
+        }
+
+        /** 4-D Vector transformation specially for affine matrix.
+            @note
+                The matrix must be an affine matrix. @see Matrix4::isAffine.
+        */
+        inline Vector4 transformAffine(const Vector4& v) const
+        {
+            assert(isAffine());
+
+            return Vector4(
+                m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3] * v.w, 
+                m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3] * v.w,
+                m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3] * v.w,
+                v.w);
+        }
+    };
+
+    /* Removed from Vector4 and made a non-member here because otherwise
+       OgreMatrix4.h and OgreVector4.h have to try to include and inline each 
+       other, which frankly doesn't work ;)
+   */
+    inline Vector4 operator * (const Vector4& v, const Matrix4& mat)
+    {
+        return Vector4(
+            v.x*mat[0][0] + v.y*mat[1][0] + v.z*mat[2][0] + v.w*mat[3][0],
+            v.x*mat[0][1] + v.y*mat[1][1] + v.z*mat[2][1] + v.w*mat[3][1],
+            v.x*mat[0][2] + v.y*mat[1][2] + v.z*mat[2][2] + v.w*mat[3][2],
+            v.x*mat[0][3] + v.y*mat[1][3] + v.z*mat[2][3] + v.w*mat[3][3]
+            );
+    }
+
+}
+#endif
Index: /OgreMain/include/OgreMemoryMacros.h
===================================================================
--- /OgreMain/include/OgreMemoryMacros.h	(revision 5)
+++ /OgreMain/include/OgreMemoryMacros.h	(revision 5)
@@ -0,0 +1,69 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+//---- ORIGINAL COPYRIGHT FOLLOWS -------------------------------------------
+// ---------------------------------------------------------------------------------------------------------------------------------
+// Copyright 2000, Paul Nettle. All rights reserved.
+//
+// You are free to use this source code in any commercial or non-commercial product.
+//
+// mmgr.cpp - Memory manager & tracking software
+//
+// The most recent version of this software can be found at: ftp://ftp.GraphicsPapers.com/pub/ProgrammingTools/MemoryManagers/
+//
+// [NOTE: Best when viewed with 8-character tabs]
+//
+// ---------------------------------------------------------------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// How does this work?
+// Remember that before the compiler starts to process a source file, it runs
+// a neat tool called a preprocessor on it. What this preprocessor does in
+// this case is replace all the instances of *alloc/free with the expanded
+// macros - this way we cleverly replace all the calls to the standard C
+// memory (de)allocation functions. The same is done for new/delete
+//
+// Of course, we have the drawback that we can't name a member function of
+// a class *alloc or free and we can't overload the new/delete operators without
+// first undefining these macros - ah, a C++ preprocessor with RE replacement,
+// that would be a dream come true :)
+//
+#ifndef OGRE_MEMORY_MACROS
+#define OGRE_MEMORY_MACROS
+
+#if OGRE_DEBUG_MEMORY_MANAGER && OGRE_DEBUG_MODE
+#   define new    (::Ogre::MemoryManager::instance().setOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL                                                 : new
+#   define delete (::Ogre::MemoryManager::instance().setOwner(__FILE__,__LINE__,__FUNCTION__),false) ? ::Ogre::MemoryManager::instance().setOwner("",0,"") : delete
+#   define malloc(sz)      ::Ogre::MemoryManager::instance().allocMem(__FILE__,__LINE__,__FUNCTION__, ::Ogre::m_alloc_malloc, sz,      gProcessID)
+#   define calloc(num,sz)  ::Ogre::MemoryManager::instance().allocMem(__FILE__,__LINE__,__FUNCTION__, ::Ogre::m_alloc_calloc, num*sz,  gProcessID)
+#   define realloc(ptr,sz) ::Ogre::MemoryManager::instance().rllocMem(__FILE__,__LINE__,__FUNCTION__, ::Ogre::m_alloc_realloc,sz, ptr, gProcessID)
+#   define free(ptr)       ::Ogre::MemoryManager::instance().dllocMem(__FILE__,__LINE__,__FUNCTION__, ::Ogre::m_alloc_free,       ptr, gProcessID)
+#endif // OGRE_DEBUG_MEMORY_MANAGER
+
+#endif // OGRE_MEMORY_MACROS
+//-----------------------------------------------------------------------------
Index: /OgreMain/include/OgreMemoryManager.h
===================================================================
--- /OgreMain/include/OgreMemoryManager.h	(revision 5)
+++ /OgreMain/include/OgreMemoryManager.h	(revision 5)
@@ -0,0 +1,422 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+//---- ORIGINAL COPYRIGHT FOLLOWS -------------------------------------------
+// ---------------------------------------------------------------------------------------------------------------------------------
+// Copyright 2000, Paul Nettle. All rights reserved.
+//
+// You are free to use this source code in any commercial or non-commercial product.
+//
+// mmgr.cpp - Memory manager & tracking software
+//
+// The most recent version of this software can be found at: ftp://ftp.GraphicsPapers.com/pub/ProgrammingTools/MemoryManagers/
+//
+// [NOTE: Best when viewed with 8-character tabs]
+//
+// ---------------------------------------------------------------------------------------------------------------------------------
+#ifndef __MemoryManager_H__
+#define __MemoryManager_H__
+
+#include "OgrePlatform.h"
+#include "OgreStdHeaders.h"
+
+namespace Ogre {
+
+    /** @page memory_manager The memory manager information page
+	
+		@subsection desc Description
+			The memory manager is a class that handles memory (de)allocation requests.
+        @par
+            This class works like a wrapper between the actual C memory allocation 
+            functions (*alloc, free) and the memory (de)allocation requests of the
+            application.
+        @par
+            Why would such a class be needed? First of all, because we had some 
+            major issues with memory getting misued (read: deleted) over DLL 
+            boundaries. One thing this memory manager does is solve the problem by
+            allocating all the memory in the OgreMain.dll/so process.
+        @par
+            Another use would be leak detection and memory misuse detection. With
+            a custom memory manager, calls to new/delete and *alloc/free could be
+            overseed and logged.
+        @par
+            Yet another use is the optimization of memory allocation for certain
+            object types. One of the most common examples is a small object 
+            allocator.
+		@subsection types Manager types
+			There actually are two classes, one is the standard memory manager
+			which only addresses memory allocation problems when deallocating
+			across processes. 
+		@par
+			The other is a modified version of the debugging memory manager written 
+			by Paul 'MidNight' Nettle (aka. the Fluid Studios Memory Manager). 
+			Obviously, the second one should be used only when debugging your 
+			application as it adds some visible overhead.
+		@par
+			You can switch between the two memory managers by setting the value of
+			the OGRE_DEBUG_MEMORY_MANAGER macro in OgreConfig.h
+        @subsection notes Implementation Note
+            The class contains a static member of type MemoryManager. That is 
+            because we want the memory manager to be created even before we 
+            override the new([])/delete([]) operators.
+		@subsection see See also
+			<a href="http://www.flipcode.com/cgi-bin/msg.cgi?showThread=12September2000-PresentingAMemoryManager&forum=askmid&id=-1">Paul Nettle's Memory Manager page at flipCode</a> - you can get the original source form here.
+    */
+
+#if OGRE_DEBUG_MEMORY_MANAGER && OGRE_DEBUG_MODE
+
+#ifndef __FUNCTION__
+#define __FUNCTION__ "???"
+#endif
+
+}
+
+//-----------------------------------------------------------------------------
+// We have to declare the global new([])/delete([]) operators before declaring 
+// the Ogre::MemoryManager class since it lists them as friend functions
+void *operator new(size_t reportedSize);
+void *operator new[](size_t reportedSize);
+void operator delete(void *reportedAddress);
+void operator delete[](void *reportedAddress);
+//-----------------------------------------------------------------------------
+
+namespace Ogre {
+
+    /** For internal use only.
+        \internal.
+        @remarks
+            This structure holds the allocation tracking information. So,
+            for each allocation made, the overhead this memory manager adds
+            is the size of this structure, the lengths of the names of the
+            file and function in which the allocation was made and the
+            padding size (which can be adjusted).
+    */
+    typedef struct tag_au
+    {
+        size_t actualSize;
+        size_t reportedSize;
+
+        void *actualAddress;
+        void *reportedAddress;
+
+        char sourceFile[40];
+        char sourceFunc[40];
+
+        unsigned int sourceLine;
+        unsigned int allocationType;
+
+        bool breakOnDealloc;
+        bool breakOnRealloc;
+
+        unsigned int allocationNumber;
+        unsigned int processID;
+
+        struct tag_au *next;
+        struct tag_au *prev;
+    } sAllocUnit;
+
+    typedef struct
+    {
+        size_t totalReportedMemory;
+        size_t totalActualMemory;
+
+        size_t peakReportedMemory;
+        size_t peakActualMemory;
+
+        size_t accumulatedReportedMemory;
+        size_t accumulatedActualMemory;
+        size_t accumulatedAllocUnitCount;
+
+        size_t totalAllocUnitCount;
+        size_t peakAllocUnitCount;
+    } sMStats;
+    
+    enum
+    {
+        m_alloc_unknown        = 0,
+        m_alloc_new            = 1,
+        m_alloc_new_array      = 2,
+        m_alloc_malloc         = 3,
+        m_alloc_calloc         = 4,
+        m_alloc_realloc        = 5,
+        m_alloc_delete         = 6,
+        m_alloc_delete_array   = 7,
+        m_alloc_free           = 8
+    };
+
+	/** See the \ref memory_manager.
+	*/
+    class _OgreExport MemoryManager
+    {
+        friend void * ::operator new(size_t);
+        friend void * ::operator new[](size_t);
+        friend void ::operator delete(void*);
+        friend void ::operator delete[](void*);
+
+    public:
+        static MemoryManager& instance(void);
+
+    private:
+        /// This is used in the process tracking part of the memory manager.
+        unsigned m_uProcessIDs;
+        /// This is set to true when deinitialization takes place.
+        bool m_bDeinitTime;
+
+#ifndef __BORLANDC__
+    private:
+#else
+    public:
+#endif
+        //-------------------------------------------------------------------------
+        // Wrappers for the new/delete functions        
+        void *op_new_sc( size_t reportedSize, unsigned processID );
+        void *op_new_vc( size_t reportedSize, unsigned processID );
+
+        void *op_new_sc( size_t reportedSize, const char *sourceFile, int sourceLine, unsigned processID );
+        void *op_new_vc( size_t reportedSize, const char *sourceFile, int sourceLine, unsigned processID );
+
+        void op_del_sc( void *reportedAddress, unsigned processID );
+        void op_del_vc( void *reportedAddress, unsigned processID );
+        //-------------------------------------------------------------------------
+
+        /** This function is intended for internal use only.
+            \internal
+            @remarks
+                This function is used to return an unique handle for each process 
+                calling it. The returned unsigned int is then passed to the memory
+                manager every time a re/de/allocation request is made, in order
+                to check that deallocations don't occur in processes other than the 
+                ones in which allcations were made and so on.
+            @par
+                Actually, the problem of re/de/allocating in other processes was
+                solved with the addition of the new memory manager, but you may
+                want to limit the occurence of such events anyway, and this function
+                helps you do just that.
+        */
+        unsigned _getProcessID();
+
+    public:
+        MemoryManager();
+        ~MemoryManager();
+
+        //-------------------------------------------------------------------------
+        // Used by the macros     
+        void setOwner(const char *file, const unsigned int line, const char *func);
+        //-------------------------------------------------------------------------
+
+        //-------------------------------------------------------------------------
+        // Allocation breakpoints        
+        bool &breakOnRealloc(void *reportedAddress);
+        bool &breakOnDealloc( void *reportedAddress );
+        void breakOnAlloc( unsigned int count );
+        //-------------------------------------------------------------------------
+
+        //-------------------------------------------------------------------------
+        // The meat & potatoes of the memory tracking software
+
+        /** This function is intended for internal use only.
+            \internal
+            @remarks
+                This function is the actual memory allocator and acts as a bridge
+                between OGRE and the C/C++ alloc/calloc functions. 
+            @par
+                While memory allocation requests are made trough this function, 
+                the tracking of memory addresses is possible. Therefore, attempting 
+                to deallocate a portion of memory that was not allocated using 
+                this function will result in a warning given by the deallocator, 
+                dllocMem.
+        */
+        void * allocMem(
+            const char *sourceFile, 
+            const unsigned int sourceLine, 
+            const char *sourceFunc,
+            const unsigned int allocationType, 
+            const size_t reportedSize, 
+            const unsigned processID );
+
+        /** This function is intended for internal use only.
+            \internal
+            @remarks
+                This function is the actual memory reallocator and acts as a bridge
+                between OGRE and the C/C++ realloc function. 
+            @par
+                While memory reallocation requests are made trough this function, 
+                the tracking of memory addresses is possible. Therefore, attempting 
+                to deallocate a portion of memory that was not reallocated using 
+                this function will result in a warning given by the deallocator, 
+                dllocMem. 
+            @par
+                As well, trying to reallocate memory that was not allocated using
+                mallc/calloc will result in a warning.
+        */
+        void * rllocMem(
+            const char *sourceFile, 
+            const unsigned int sourceLine, 
+            const char *sourceFunc,
+            const unsigned int reallocationType, 
+            const size_t reportedSize, 
+            void *reportedAddress, 
+            const unsigned processID );
+
+        /** This function is intended for internal use only.
+            \internal
+            @remarks
+                This function is the actual memory deallocator and acts as a
+                bridge between OGRE and the C/C++ free function.
+            @par
+                While memory deallocation requests are made trough this function, 
+                the tracking of memory addresses is possible. Therefore, attempting 
+                to deallocate a portion of memory that was not allocated using 
+                allocMem or rllocMem, trying to deallocate memory that was
+                allocated with malloc using delete (and the corresponding 
+                permutations) or trying to deallocate memory allocated from from
+                process will result in a warning.
+            @note
+                Actually, memory can be allocated in one process and deallocated
+                in another, since the actual (de)allocation takes place in the
+                memory space of the OgreMain library. 
+            @par
+                Tracking this kind of (possible) errors exists because users may 
+                want to write their own memory allocator later on or they'd like 
+                to get rid of OGRE's memory allocator.
+        */
+        void dllocMem(
+            const char *sourceFile, 
+            const unsigned int sourceLine, 
+            const char *sourceFunc,
+            const unsigned int deallocationType, 
+            const void *reportedAddress, 
+            const unsigned processID );
+        //-------------------------------------------------------------------------
+
+        //-------------------------------------------------------------------------
+        // Utilitarian functions        
+        bool validateAddr(const void *reportedAddress);
+        bool validateAlloc(const sAllocUnit *allocUnit);
+        bool validateAllAllocs();
+        //-------------------------------------------------------------------------
+
+        //-------------------------------------------------------------------------
+        // Unused RAM calculations        
+        unsigned int calcUnused( const sAllocUnit *allocUnit );
+        unsigned int calcAllUnused();
+        //-------------------------------------------------------------------------
+
+        //-------------------------------------------------------------------------
+        // Logging and reporting        
+        void dumpAllocUnit( const sAllocUnit *allocUnit, const char *prefix = "" );
+        void dumpMemReport( const char *filename = "memreport.log", const bool overwrite = true );
+        sMStats getMemStats();            
+        //-------------------------------------------------------------------------        
+    };
+}
+
+/** This variable exists separately in each module that links to the OGRE library
+    and is used to track the ID of the current process from the perspective
+    of the memory manager.
+    @see
+        unsigned Ogre::MemoryManager::_getProcessID()
+*/
+static unsigned gProcessID = 0;
+
+// When compiling in Visual C++ (occuring in VS2005 Express but not for VC 7.1) with
+// managed C++, should put the new([])/delete([]) overrides inside unmanaged context,
+// otherwise Visual C++ will link with overridden version of new([]) and CRT version
+// of delete([]), thus, mess up both of OGRE memory manager and CRT memory manager.
+#if defined(__cplusplus_cli)
+#pragma managed(push, off)
+#endif
+//-----------------------------------------------------------------------------
+// Overridden global new([])/delete([]) functions
+//
+inline void *operator new(size_t reportedSize)
+{
+    if( !gProcessID )
+        gProcessID = Ogre::MemoryManager::instance()._getProcessID();
+    return Ogre::MemoryManager::instance().op_new_sc( reportedSize, gProcessID );
+}
+inline void *operator new[](size_t reportedSize)
+{
+    if( !gProcessID )
+        gProcessID = Ogre::MemoryManager::instance()._getProcessID();
+    return Ogre::MemoryManager::instance().op_new_vc( reportedSize, gProcessID );
+}
+
+inline void operator delete(void *reportedAddress)
+{
+    Ogre::MemoryManager::instance().op_del_sc( reportedAddress, gProcessID );    
+}
+inline void operator delete[](void *reportedAddress)
+{
+    Ogre::MemoryManager::instance().op_del_vc( reportedAddress, gProcessID );
+}
+//-----------------------------------------------------------------------------
+#if defined(__cplusplus_cli)
+#pragma managed(pop)
+#endif
+
+//-----------------------------------------------------------------------------
+// This header adds the *alloc/free macros, wrapping the C functions
+#include "OgreMemoryMacros.h"
+//-----------------------------------------------------------------------------
+
+#else
+
+	/** See the \ref memory_manager.
+	*/
+    class _OgreExport MemoryManager
+    {
+    public:
+        static MemoryManager& instance(void);
+
+        MemoryManager();
+        ~MemoryManager();
+
+        /** Memory allocator - uses plain old malloc.
+        */
+        void *allocMem( const char *szFile, size_t uLine, size_t count ) throw ( );
+
+        /** Memory re-allocator - uses plain old realloc.
+        */
+        void *rllocMem( const char *szFile, size_t uLine, void *ptr , size_t count ) throw ( );
+
+        /** Memory allocator - uses plain old calloc.
+        */
+        void *cllocMem( const char *szFile, size_t uLine, size_t num, size_t size ) throw ( );
+
+        /** Memory de-allocator - uses plain old free.
+        */
+        void dllocMem( const char *szFile, size_t uLine, void *ptr ) throw ( );
+    };
+
+}
+
+#endif
+
+#endif
+
Index: /OgreMain/include/OgreMesh.h
===================================================================
--- /OgreMain/include/OgreMesh.h	(revision 5)
+++ /OgreMain/include/OgreMesh.h	(revision 5)
@@ -0,0 +1,875 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Mesh_H__
+#define __Mesh_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreResource.h"
+#include "OgreVertexIndexData.h"
+#include "OgreAxisAlignedBox.h"
+#include "OgreVertexBoneAssignment.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreProgressiveMesh.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreSkeleton.h"
+#include "OgreAnimationTrack.h"
+#include "OgrePose.h"
+
+
+namespace Ogre {
+
+
+    /** Resource holding data about 3D mesh.
+        @remarks
+            This class holds the data used to represent a discrete
+            3-dimensional object. Mesh data usually contains more
+            than just vertices and triangle information; it also
+            includes references to materials (and the faces which use them),
+            level-of-detail reduction information, convex hull definition,
+            skeleton/bones information, keyframe animation etc.
+            However, it is important to note the emphasis on the word
+            'discrete' here. This class does not cover the large-scale
+            sprawling geometry found in level / landscape data.
+        @par
+            Multiple world objects can (indeed should) be created from a
+            single mesh object - see the Entity class for more info.
+            The mesh object will have it's own default
+            material properties, but potentially each world instance may
+            wish to customise the materials from the original. When the object
+            is instantiated into a scene node, the mesh material properties
+            will be taken by default but may be changed. These properties
+            are actually held at the SubMesh level since a single mesh may
+            have parts with different materials.
+        @par
+            As described above, because the mesh may have sections of differing
+            material properties, a mesh is inherently a compound contruct,
+            consisting of one or more SubMesh objects.
+            However, it strongly 'owns' it's SubMeshes such that they
+            are loaded / unloaded at the same time. This is contrary to
+            the approach taken to hierarchically related (but loosely owned)
+            scene nodes, where data is loaded / unloaded separately. Note
+            also that mesh sub-sections (when used in an instantiated object)
+            share the same scene node as the parent.
+    */
+
+
+    struct MeshLodUsage;
+
+    class _OgreExport Mesh: public Resource
+    {
+        friend class SubMesh;
+        friend class MeshSerializerImpl;
+        friend class MeshSerializerImpl_v1_2;
+        friend class MeshSerializerImpl_v1_1;
+
+    public:
+		typedef std::vector<Real> LodDistanceList;
+        /// Multimap of vertex bone assignments (orders by vertex index)
+        typedef std::multimap<size_t, VertexBoneAssignment> VertexBoneAssignmentList;
+        typedef MapIterator<VertexBoneAssignmentList> BoneAssignmentIterator;
+        typedef std::vector<SubMesh*> SubMeshList;
+        typedef std::vector<unsigned short> IndexMap;
+
+    protected:
+        /** A list of submeshes which make up this mesh.
+            Each mesh is made up of 1 or more submeshes, which
+            are each based on a single material and can have their
+            own vertex data (they may not - they can share vertex data
+            from the Mesh, depending on preference).
+        */
+        SubMeshList mSubMeshList;
+	
+        /** Internal method for making the space for a vertex element to hold tangents. */
+        void organiseTangentsBuffer(VertexData *vertexData, 
+			VertexElementSemantic targetSemantic, unsigned short index, 
+			unsigned short sourceTexCoordSet);
+
+    public:
+		/** A hashmap used to store optional SubMesh names.
+			Translates a name into SubMesh index
+		*/
+		typedef HashMap<String, ushort> SubMeshNameMap ;
+
+		
+    protected:
+		SubMeshNameMap mSubMeshNameMap ;
+
+        /// Local bounding box volume
+        AxisAlignedBox mAABB;
+		/// Local bounding sphere radius (centered on object)
+		Real mBoundRadius;
+
+        /// Optional linked skeleton
+        String mSkeletonName;
+        SkeletonPtr mSkeleton;
+
+       
+        VertexBoneAssignmentList mBoneAssignments;
+
+        /// Flag indicating that bone assignments need to be recompiled
+        bool mBoneAssignmentsOutOfDate;
+
+        /** Build the index map between bone index and blend index */
+        void buildIndexMap(const VertexBoneAssignmentList& boneAssignments,
+            IndexMap& boneIndexToBlendIndexMap, IndexMap& blendIndexToBoneIndexMap);
+        /** Compile bone assignments into blend index and weight buffers. */
+        void compileBoneAssignments(const VertexBoneAssignmentList& boneAssignments,
+            unsigned short numBlendWeightsPerVertex, 
+            IndexMap& blendIndexToBoneIndexMap,
+            VertexData* targetVertexData);
+
+		bool mIsLodManual;
+		ushort mNumLods;
+		typedef std::vector<MeshLodUsage> MeshLodUsageList;
+		MeshLodUsageList mMeshLodUsageList;
+
+		HardwareBuffer::Usage mVertexBufferUsage;
+		HardwareBuffer::Usage mIndexBufferUsage;
+		bool mVertexBufferShadowBuffer;
+		bool mIndexBufferShadowBuffer;
+
+
+        bool mPreparedForShadowVolumes;
+        bool mEdgeListsBuilt;
+        bool mAutoBuildEdgeLists;
+
+		/// Storage of morph animations, lookup by name
+		typedef std::map<String, Animation*> AnimationList;
+		AnimationList mAnimationsList;
+		/// The vertex animation type associated with the shared vertex data
+		mutable VertexAnimationType mSharedVertexDataAnimationType;
+		/// Do we need to scan animations for animation types?
+		mutable bool mAnimationTypesDirty;
+
+		/// List of available poses for shared and dedicated geometryPoseList
+		PoseList mPoseList;
+
+
+        /// @copydoc Resource::loadImpl
+        void loadImpl(void);
+		/// @copydoc Resource::postLoadImpl
+		void postLoadImpl(void);
+        /// @copydoc Resource::unloadImpl
+        void unloadImpl(void);
+		/// @copydoc Resource::calculateSize
+		size_t calculateSize(void) const;
+
+
+
+    public:
+        /** Default constructor - used by MeshManager
+            @warning
+                Do not call this method directly.
+        */
+        Mesh(ResourceManager* creator, const String& name, ResourceHandle handle,
+            const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
+        ~Mesh();
+
+		// NB All methods below are non-virtual since they will be
+        // called in the rendering loop - speed is of the essence.
+
+        /** Creates a new SubMesh.
+            @remarks
+                Method for manually creating geometry for the mesh.
+                Note - use with extreme caution - you must be sure that
+                you have set up the geometry properly.
+        */
+        SubMesh* createSubMesh(void);
+
+		/** Creates a new SubMesh and gives it a name
+		*/
+		SubMesh* createSubMesh(const String& name);
+		
+		/** Gives a name to a SubMesh
+		*/
+		void nameSubMesh(const String& name, ushort index);
+		
+		/** Gets the index of a submesh with a given name.
+        @remarks
+            Useful if you identify the SubMeshes by name (using nameSubMesh)
+            but wish to have faster repeat access.
+        */
+		ushort _getSubMeshIndex(const String& name) const;
+
+        /** Gets the number of sub meshes which comprise this mesh.
+        */
+        unsigned short getNumSubMeshes(void) const;
+
+        /** Gets a pointer to the submesh indicated by the index.
+        */
+        SubMesh* getSubMesh(unsigned short index) const;
+
+		/** Gets a SubMesh by name
+		*/
+		SubMesh* getSubMesh(const String& name) const ;
+
+        typedef VectorIterator<SubMeshList> SubMeshIterator;
+        /// Gets an iterator over the available submeshes
+        SubMeshIterator getSubMeshIterator(void)
+        { return SubMeshIterator(mSubMeshList.begin(), mSubMeshList.end()); }
+      
+        /** Shared vertex data.
+            @remarks
+                This vertex data can be shared among multiple submeshes. SubMeshes may not have
+                their own VertexData, they may share this one.
+            @par
+                The use of shared or non-shared buffers is determined when
+                model data is converted to the OGRE .mesh format.
+        */
+        VertexData *sharedVertexData;
+
+        /** Shared index map for translating blend index to bone index.
+            @remarks
+                This index map can be shared among multiple submeshes. SubMeshes might not have
+                their own IndexMap, they might share this one.
+            @par
+                We collect actually used bones of all bone assignments, and build the
+                blend index in 'packed' form, then the range of the blend index in vertex
+                data VES_BLEND_INDICES element is continuous, with no gaps. Thus, by
+                minimising the world matrix array constants passing to GPU, we can support
+                more bones for a mesh when hardware skinning is used. The hardware skinning
+                support limit is applied to each set of vertex data in the mesh, in other words, the
+                hardware skinning support limit is applied only to the actually used bones of each
+                SubMeshes, not all bones across the entire Mesh.
+            @par
+                Because the blend index is different to the bone index, therefore, we use
+                the index map to translate the blend index to bone index.
+            @par
+                The use of shared or non-shared index map is determined when
+                model data is converted to the OGRE .mesh format.
+        */
+        IndexMap sharedBlendIndexToBoneIndexMap;
+
+        /** Makes a copy of this mesh object and gives it a new name.
+            @remarks
+                This is useful if you want to tweak an existing mesh without affecting the original one. The
+                newly cloned mesh is registered with the MeshManager under the new name.
+            @param newName The name to give the clone
+            @param newGroup Optional name of the new group to assign the clone to;
+                if you leave this blank, the clone will be assigned to the same
+                group as this Mesh.
+        */
+        MeshPtr clone(const String& newName, const String& newGroup = StringUtil::BLANK);
+
+        /** Get the axis-aligned bounding box for this mesh.
+        */
+        const AxisAlignedBox& getBounds(void) const;
+
+		/** Gets the radius of the bounding sphere surrounding this mesh. */
+		Real getBoundingSphereRadius(void) const;
+
+        /** Manually set the bounding box for this Mesh.
+            @remarks
+            Calling this method is required when building manual meshes now, because OGRE can no longer 
+            update the bounds for you, because it cannot necessarily read vertex data back from 
+            the vertex buffers which this mesh uses (they very well might be write-only, and even
+            if they are not, reading data from a hardware buffer is a bottleneck).
+            @param pad If true, a certain padding will be added to the bounding box to separate it from the mesh
+        */
+        void _setBounds(const AxisAlignedBox& bounds, bool pad = true);
+
+        /** Manually set the bounding radius. 
+        @remarks
+            Calling this method is required when building manual meshes now, because OGRE can no longer 
+            update the bounds for you, because it cannot necessarily read vertex data back from 
+            the vertex buffers which this mesh uses (they very well might be write-only, and even
+            if they are not, reading data from a hardware buffer is a bottleneck).
+        */
+        void _setBoundingSphereRadius(Real radius);
+
+        /** Sets the name of the skeleton this Mesh uses for animation.
+        @remarks
+            Meshes can optionally be assigned a skeleton which can be used to animate
+            the mesh through bone assignments. The default is for the Mesh to use no
+            skeleton. Calling this method with a valid skeleton filename will cause the
+            skeleton to be loaded if it is not already (a single skeleton can be shared
+            by many Mesh objects).
+        @param skelName The name of the .skeleton file to use, or an empty string to use
+            no skeleton
+        */
+        void setSkeletonName(const String& skelName);
+
+        /** Returns true if this Mesh has a linked Skeleton. */
+        bool hasSkeleton(void) const;
+
+		/** Returns whether or not this mesh has some kind of vertex animation. 
+		*/
+		bool hasVertexAnimation(void) const;
+
+		/** Gets a pointer to any linked Skeleton. 
+        @returns Weak reference to the skeleton - copy this if you want to hold a strong pointer.
+        */
+        const SkeletonPtr& getSkeleton(void) const;
+
+        /** Gets the name of any linked Skeleton */
+        const String& getSkeletonName(void) const;
+        /** Initialise an animation set suitable for use with this mesh. 
+        @remarks
+            Only recommended for use inside the engine, not by applications.
+        */
+        void _initAnimationState(AnimationStateSet* animSet);
+
+		/** Refresh an animation set suitable for use with this mesh. 
+		@remarks
+		Only recommended for use inside the engine, not by applications.
+		*/
+		void _refreshAnimationState(AnimationStateSet* animSet);
+        /** Assigns a vertex to a bone with a given weight, for skeletal animation. 
+        @remarks    
+            This method is only valid after calling setSkeletonName.
+            Since this is a one-off process there exists only 'addBoneAssignment' and
+            'clearBoneAssignments' methods, no 'editBoneAssignment'. You should not need
+            to modify bone assignments during rendering (only the positions of bones) and OGRE
+            reserves the right to do some internal data reformatting of this information, depending
+            on render system requirements.
+        @par
+            This method is for assigning weights to the shared geometry of the Mesh. To assign
+            weights to the per-SubMesh geometry, see the equivalent methods on SubMesh.
+        */
+        void addBoneAssignment(const VertexBoneAssignment& vertBoneAssign);
+
+        /** Removes all bone assignments for this mesh. 
+        @remarks
+            This method is for modifying weights to the shared geometry of the Mesh. To assign
+            weights to the per-SubMesh geometry, see the equivalent methods on SubMesh.
+        */
+        void clearBoneAssignments(void);
+
+        /** Internal notification, used to tell the Mesh which Skeleton to use without loading it. 
+        @remarks
+            This is only here for unusual situation where you want to manually set up a
+            Skeleton. Best to let OGRE deal with this, don't call it yourself unless you
+            really know what you're doing.
+        */
+        void _notifySkeleton(SkeletonPtr& pSkel);
+
+
+        /** Gets an iterator for access all bone assignments. 
+        */
+        BoneAssignmentIterator getBoneAssignmentIterator(void);
+
+
+		/** Automatically generates lower level of detail versions of this mesh for use
+			when a simpler version of the model is acceptable for rendering.
+		@remarks
+			There are 2 ways that you can create level-of-detail (LOD) versions of a mesh;
+			the first is to call this method, which does fairly extensive calculations to
+			work out how to simplify the mesh whilst having the minimum affect on the model.
+			The alternative is to actually create simpler versions of the mesh yourself in 
+			a modelling tool, and having exported them, tell the 'master' mesh to use these
+			alternative meshes for lower detail versions; this is done by calling the 
+			createManualLodLevel method.
+		@par
+			As well as creating the lower detail versions of the mesh, this method will
+			also associate them with depth values. As soon as an object is at least as far
+			away from the camera as the depth value associated with it's LOD, it will drop 
+			to that level of detail. 
+		@par
+			I recommend calling this method before mesh export, not at runtime.
+		@param lodDistances A list of depth values indicating the distances at which new lods should be
+			generated. 
+		@param reductionMethod The way to determine the number of vertices collapsed per LOD
+		@param reductionValue Meaning depends on reductionMethod, typically either the proportion
+			of remaining vertices to collapse or a fixed number of vertices.
+		*/
+		void generateLodLevels(const LodDistanceList& lodDistances, 
+			ProgressiveMesh::VertexReductionQuota reductionMethod, Real reductionValue);
+
+		/** Returns the number of levels of detail that this mesh supports. 
+		@remarks
+			This number includes the original model.
+		*/
+		ushort getNumLodLevels(void) const;
+		/** Gets details of the numbered level of detail entry. */
+		const MeshLodUsage& getLodLevel(ushort index) const;
+		/** Adds a new manual level-of-detail entry to this Mesh.
+		@remarks
+			As an alternative to generating lower level of detail versions of a mesh, you can
+			use your own manually modelled meshes as lower level versions. This lets you 
+			have complete control over the LOD, and in addition lets you scale down other
+			aspects of the model which cannot be done using the generated method; for example, 
+			you could use less detailed materials and / or use less bones in the skeleton if
+			this is an animated mesh. Therefore for complex models you are likely to be better off
+			modelling your LODs yourself and using this method, whilst for models with fairly
+			simple materials and no animation you can just use the generateLodLevels method.
+		@param fromDepth The z value from which this Lod will apply.
+		@param meshName The name of the mesh which will be the lower level detail version.
+		*/
+		void createManualLodLevel(Real fromDepth, const String& meshName);
+
+		/** Changes the alternate mesh to use as a manual LOD at the given index.
+		@remarks
+			Note that the index of a LOD may change if you insert other LODs. If in doubt,
+			use getLodIndex().
+		@param index The index of the level to be changed
+		@param meshName The name of the mesh which will be the lower level detail version.
+		*/
+		void updateManualLodLevel(ushort index, const String& meshName);
+
+		/** Retrieves the level of detail index for the given depth value. 
+		*/
+		ushort getLodIndex(Real depth) const;
+
+		/** Retrieves the level of detail index for the given squared depth value. 
+		@remarks
+			Internally the lods are stored at squared depths to avoid having to perform
+			square roots when determining the lod. This method allows you to provide a
+			squared length depth value to avoid having to do your own square roots.
+		*/
+		ushort getLodIndexSquaredDepth(Real squaredDepth) const;
+
+		/** Returns true if this mesh is using manual LOD.
+		@remarks
+			A mesh can either use automatically generated LOD, or it can use alternative
+			meshes as provided by an artist. A mesh can only use either all manual LODs 
+			or all generated LODs, not a mixture of both.
+		*/
+		bool isLodManual(void) const { return mIsLodManual; }
+
+		/** Internal methods for loading LOD, do not use. */
+		void _setLodInfo(unsigned short numLevels, bool isManual);
+		/** Internal methods for loading LOD, do not use. */
+		void _setLodUsage(unsigned short level, MeshLodUsage& usage);
+		/** Internal methods for loading LOD, do not use. */
+		void _setSubMeshLodFaceList(unsigned short subIdx, unsigned short level, IndexData* facedata);
+
+        /** Removes all LOD data from this Mesh. */
+        void removeLodLevels(void);
+
+		/** Sets the policy for the vertex buffers to be used when loading
+			this Mesh.
+		@remarks
+			By default, when loading the Mesh, static, write-only vertex and index buffers 
+			will be used where possible in order to improve rendering performance. 
+			However, such buffers
+			cannot be manipulated on the fly by CPU code (although shader code can). If you
+			wish to use the CPU to modify these buffers, you should call this method. Note,
+			however, that it only takes effect after the Mesh has been reloaded. Note that you
+			still have the option of manually repacing the buffers in this mesh with your
+			own if you see fit too, in which case you don't need to call this method since it
+			only affects buffers created by the mesh itself.
+		@par
+			You can define the approach to a Mesh by changing the default parameters to 
+			MeshManager::load if you wish; this means the Mesh is loaded with those options
+			the first time instead of you having to reload the mesh after changing these options.
+		@param usage The usage flags, which by default are 
+			HardwareBuffer::HBU_STATIC_WRITE_ONLY
+		@param shadowBuffer If set to true, the vertex buffers will be created with a
+            system memory shadow buffer. You should set this if you want to be able to
+			read from the buffer, because reading from a hardware buffer is a no-no.
+		*/
+		void setVertexBufferPolicy(HardwareBuffer::Usage usage, bool shadowBuffer = false);
+		/** Sets the policy for the index buffers to be used when loading
+			this Mesh.
+		@remarks
+			By default, when loading the Mesh, static, write-only vertex and index buffers 
+			will be used where possible in order to improve rendering performance. 
+			However, such buffers
+			cannot be manipulated on the fly by CPU code (although shader code can). If you
+			wish to use the CPU to modify these buffers, you should call this method. Note,
+			however, that it only takes effect after the Mesh has been reloaded. Note that you
+			still have the option of manually repacing the buffers in this mesh with your
+			own if you see fit too, in which case you don't need to call this method since it
+			only affects buffers created by the mesh itself.
+		@par
+			You can define the approach to a Mesh by changing the default parameters to 
+			MeshManager::load if you wish; this means the Mesh is loaded with those options
+			the first time instead of you having to reload the mesh after changing these options.
+		@param usage The usage flags, which by default are 
+			HardwareBuffer::HBU_STATIC_WRITE_ONLY
+		@param shadowBuffer If set to true, the index buffers will be created with a
+            system memory shadow buffer. You should set this if you want to be able to
+			read from the buffer, because reading from a hardware buffer is a no-no.
+		*/
+		void setIndexBufferPolicy(HardwareBuffer::Usage usage, bool shadowBuffer = false);
+        /** Gets the usage setting for this meshes vertex buffers. */
+        HardwareBuffer::Usage getVertexBufferUsage(void) const { return mVertexBufferUsage; }
+        /** Gets the usage setting for this meshes index buffers. */
+        HardwareBuffer::Usage getIndexBufferUsage(void) const { return mIndexBufferUsage; }
+        /** Gets whether or not this meshes vertex buffers are shadowed. */
+        bool isVertexBufferShadowed(void) const { return mVertexBufferShadowBuffer; }
+        /** Gets whether or not this meshes index buffers are shadowed. */
+        bool isIndexBufferShadowed(void) const { return mIndexBufferShadowBuffer; }
+       
+
+        /** Rationalises the passed in bone assignment list.
+        @remarks
+            OGRE supports up to 4 bone assignments per vertex. The reason for this limit
+            is that this is the maximum number of assignments that can be passed into
+            a hardware-assisted blending algorithm. This method identifies where there are
+            more than 4 bone assignments for a given vertex, and eliminates the bone
+            assignments with the lowest weights to reduce to this limit. The remaining
+            weights are then re-balanced to ensure that they sum to 1.0.
+        @param vertexCount The number of vertices.
+        @param assignments The bone assignment list to rationalise. This list will be modified and
+            entries will be removed where the limits are exceeded.
+        @returns The maximum number of bone assignments per vertex found, clamped to [1-4]
+        */
+        unsigned short _rationaliseBoneAssignments(size_t vertexCount, VertexBoneAssignmentList& assignments);
+
+        /** Internal method, be called once to compile bone assignments into geometry buffer. 
+        @remarks
+            The OGRE engine calls this method automatically. It compiles the information 
+            submitted as bone assignments into a format usable in realtime. It also 
+            eliminates excessive bone assignments (max is OGRE_MAX_BLEND_WEIGHTS)
+            and re-normalises the remaining assignments.
+        */
+        void _compileBoneAssignments(void);
+
+        /** Internal method, be called once to update the compiled bone assignments.
+        @remarks
+            The OGRE engine calls this method automatically. It updates the compiled bone
+            assignments if requested.
+        */
+        void _updateCompiledBoneAssignments(void);
+
+        /** This method builds a set of tangent vectors for a given mesh into a 3D texture coordinate buffer.
+        @remarks
+            Tangent vectors are vectors representing the local 'X' axis for a given vertex based
+            on the orientation of the 2D texture on the geometry. They are built from a combination
+            of existing normals, and from the 2D texture coordinates already baked into the model.
+            They can be used for a number of things, but most of all they are useful for 
+            vertex and fragment programs, when you wish to arrive at a common space for doing
+            per-pixel calculations.
+        @par
+            The prerequisites for calling this method include that the vertex data used by every
+            SubMesh has both vertex normals and 2D texture coordinates.
+		@param targetSemantic The semantic to store the tangents in. Defaults to 
+			the explicit tangent binding, but note that this is only usable on more
+			modern hardware (Shader Model 2), so if you need portability with older
+			cards you should change this to a texture coordinate binding instead.
+        @param sourceTexCoordSet The texture coordinate index which should be used as the source
+            of 2D texture coordinates, with which to calculate the tangents.
+        @param index The element index, ie the texture coordinate set which should be used to store the 3D
+            coordinates representing a tangent vector per vertex, if targetSemantic is 
+			VES_TEXTURE_COORDINATES. If this already exists, it will be overwritten.
+        */
+        void buildTangentVectors(VertexElementSemantic targetSemantic = VES_TANGENT,
+			unsigned short sourceTexCoordSet = 0, unsigned short index = 0);
+
+        /** Ask the mesh to suggest parameters to a future buildTangentVectors call, 
+			should you wish to use texture coordinates to store the tangents. 
+        @remarks
+            This helper method will suggest source and destination texture coordinate sets
+            for a call to buildTangentVectors. It will detect when there are inappropriate
+            conditions (such as multiple geometry sets which don't agree). 
+            Moreover, it will return 'true' if it detects that there are aleady 3D 
+            coordinates in the mesh, and therefore tangents may have been prepared already.
+		@param targetSemantic The semantic you intend to use to store the tangents
+			if they are not already present;
+			most likely options are VES_TEXTURE_COORDINATES or VES_TANGENT; you should
+			use texture coordinates if you want compatibility with older, pre-SM2
+			graphics cards, and the tangent binding otherwise.
+        @param outSourceCoordSet Reference to a source texture coordinate set which 
+            will be populated
+        @param outIndex Reference to a destination element index (e.g. texture coord set)
+			which will be populated
+        */
+        bool suggestTangentVectorBuildParams(VertexElementSemantic targetSemantic,
+			unsigned short& outSourceCoordSet, unsigned short& outIndex);
+
+        /** Builds an edge list for this mesh, which can be used for generating a shadow volume
+            among other things.
+        */
+        void buildEdgeList(void);
+        /** Destroys and frees the edge lists this mesh has built. */
+        void freeEdgeList(void);
+
+        /** This method prepares the mesh for generating a renderable shadow volume. 
+        @remarks
+            Preparing a mesh to generate a shadow volume involves firstly ensuring that the 
+            vertex buffer containing the positions for the mesh is a standalone vertex buffer,
+            with no other components in it. This method will therefore break apart any existing
+            vertex buffers this mesh holds if position is sharing a vertex buffer. 
+            Secondly, it will double the size of this vertex buffer so that there are 2 copies of 
+            the position data for the mesh. The first half is used for the original, and the second 
+            half is used for the 'extruded' version of the mesh. The vertex count of the main 
+            VertexData used to render the mesh will remain the same though, so as not to add any 
+            overhead to regular rendering of the object.
+            Both copies of the position are required in one buffer because shadow volumes stretch 
+            from the original mesh to the extruded version. 
+        @par
+            Because shadow volumes are rendered in turn, no additional
+            index buffer space is allocated by this method, a shared index buffer allocated by the
+            shadow rendering algorithm is used for addressing this extended vertex buffer.
+        */
+        void prepareForShadowVolume(void);
+
+        /** Return the edge list for this mesh, building it if required. 
+        @remarks
+            You must ensure that the Mesh as been prepared for shadow volume 
+            rendering if you intend to use this information for that purpose.
+        @lodIndex The LOD at which to get the edge list, 0 being the highest.
+        */
+        EdgeData* getEdgeList(unsigned int lodIndex = 0);
+
+        /** Return the edge list for this mesh, building it if required. 
+        @remarks
+            You must ensure that the Mesh as been prepared for shadow volume 
+            rendering if you intend to use this information for that purpose.
+        @lodIndex The LOD at which to get the edge list, 0 being the highest.
+        */
+        const EdgeData* getEdgeList(unsigned int lodIndex = 0) const;
+
+        /** Returns whether this mesh has already had it's geometry prepared for use in 
+            rendering shadow volumes. */
+        bool isPreparedForShadowVolumes(void) const { return mPreparedForShadowVolumes; }
+
+		/** Returns whether this mesh has an attached edge list. */
+		bool isEdgeListBuilt(void) const { return mEdgeListsBuilt; }
+
+        /** Prepare matrices for software indexed vertex blend.
+            @remarks
+                This function organise bone indexed matrices to blend indexed matrices,
+                so software vertex blending can access to the matrix via blend index
+                directly.
+            @param blendMatrices Pointer to an array of matrix pointers to store
+                prepared results, which indexed by blend index
+            @param boneMatrices Pointer to an array of matrices to be used to blend,
+                which indexed by bone index
+            @param indexMap The index map used to translate blend index to bone index
+        */
+        static void prepareMatricesForVertexBlend(const Matrix4** blendMatrices,
+            const Matrix4* boneMatrices, const IndexMap& indexMap);
+
+        /** Performs a software indexed vertex blend, of the kind used for
+            skeletal animation although it can be used for other purposes. 
+        @remarks
+        This function is supplied to update vertex data with blends 
+        done in software, either because no hardware support is available, 
+        or that you need the results of the blend for some other CPU operations.
+        @param sourceVertexData VertexData class containing positions, normals,
+            blend indices and blend weights.
+        @param targetVertexData VertexData class containing target position
+            and normal buffers which will be updated with the blended versions.
+            Note that the layout of the source and target position / normal 
+            buffers must be identical, ie they must use the same buffer indexes
+        @param blendMatrices Pointer to an array of matrix pointers to be used to blend,
+            indexed by blend indices in the sourceVertexData
+        @param numMatrices Number of matrices in the blendMatrices, it might be used
+            as a hint for optimisation.
+        @param blendNormals If true, normals are blended as well as positions
+        */
+        static void softwareVertexBlend(const VertexData* sourceVertexData, 
+            const VertexData* targetVertexData,
+            const Matrix4* const* blendMatrices, size_t numMatrices,
+            bool blendNormals);
+
+        /** Performs a software vertex morph, of the kind used for
+            morph animation although it can be used for other purposes. 
+        @remarks
+			This function will linearly interpolate positions between two
+			source buffers, into a third buffer.
+        @param t Parametric distance between the start and end buffer positions
+        @param b1 Vertex buffer containing VET_FLOAT3 entries for the start positions
+		@param b2 Vertex buffer containing VET_FLOAT3 entries for the end positions
+		@param targetVertexData VertexData destination; assumed to have a separate position
+			buffer already bound, and the number of vertices must agree with the
+			number in start and end
+		*/
+        static void softwareVertexMorph(Real t, 
+            const HardwareVertexBufferSharedPtr& b1, 
+			const HardwareVertexBufferSharedPtr& b2, 
+			VertexData* targetVertexData);
+
+        /** Performs a software vertex pose blend, of the kind used for
+            morph animation although it can be used for other purposes. 
+        @remarks
+			This function will apply a weighted offset to the positions in the 
+			incoming vertex data (therefore this is a read/write operation, and 
+			if you expect to call it more than once with the same data, then
+			you would be best to suppress hardware uploads of the position buffer
+			for the duration)
+        @param weight Parametric weight to scale the offsets by
+		@param vertexOffsetMap Potentially sparse map of vertex index -> offset
+		@param targetVertexData VertexData destination; assumed to have a separate position
+			buffer already bound, and the number of vertices must agree with the
+			number in start and end
+		*/
+		static void softwareVertexPoseBlend(Real weight, 
+			const std::map<size_t, Vector3>& vertexOffsetMap,
+			VertexData* targetVertexData);
+        /** Gets a reference to the optional name assignments of the SubMeshes. */
+        const SubMeshNameMap& getSubMeshNameMap(void) const { return mSubMeshNameMap; }
+
+        /** Sets whether or not this Mesh should automatically build edge lists
+            when asked for them, or whether it should never build them if
+            they are not already provided.
+        @remarks
+            This allows you to create meshes which do not have edge lists calculated, 
+            because you never want to use them. This value defaults to 'true'
+            for mesh formats which did not include edge data, and 'false' for 
+            newer formats, where edge lists are expected to have been generated
+            in advance.
+        */
+        void setAutoBuildEdgeLists(bool autobuild) { mAutoBuildEdgeLists = autobuild; }
+        /** Sets whether or not this Mesh should automatically build edge lists
+            when asked for them, or whether it should never build them if
+            they are not already provided.
+        */
+        bool getAutoBuildEdgeLists(void) const { return mAutoBuildEdgeLists; }
+
+		/** Gets the type of vertex animation the shared vertex data of this mesh supports.
+		*/
+		virtual VertexAnimationType getSharedVertexDataAnimationType(void) const;
+
+		/** Creates a new Animation object for vertex animating this mesh. 
+        @param name The name of this animation
+        @param length The length of the animation in seconds
+        */
+        virtual Animation* createAnimation(const String& name, Real length);
+
+        /** Returns the named vertex Animation object. 
+		@param name The name of the animation
+		*/
+        virtual Animation* getAnimation(const String& name) const;
+
+		/** Internal access to the named vertex Animation object - returns null 
+			if it does not exist. 
+		@param name The name of the animation
+		*/
+		virtual Animation* _getAnimationImpl(const String& name) const;
+
+		/** Returns whether this mesh contains the named vertex animation. */
+		virtual bool hasAnimation(const String& name);
+
+        /** Removes vertex Animation from this mesh. */
+        virtual void removeAnimation(const String& name);
+
+		/** Gets the number of morph animations in this mesh. */
+		virtual unsigned short getNumAnimations(void) const;
+
+		/** Gets a single morph animation by index. 
+		*/
+		virtual Animation* getAnimation(unsigned short index) const;
+
+		/** Removes all morph Animations from this mesh. */
+		virtual void removeAllAnimations(void);
+		/** Gets a pointer to a vertex data element based on a morph animation 
+			track handle.
+		@remarks
+			0 means the shared vertex data, 1+ means a submesh vertex data (index+1)
+		*/
+		VertexData* getVertexDataByTrackHandle(unsigned short handle);
+        /** Iterates through all submeshes and requests them 
+            to apply their texture aliases to the material they use.
+        @remarks
+            The submesh will only apply texture aliases to the material if matching
+            texture alias names are found in the material.  If a match is found, the
+            submesh will automatically clone the original material and then apply its
+            texture to the new material.
+        @par
+            This method is normally called by the protected method loadImpl when a 
+            mesh if first loaded.
+        */
+  		void updateMaterialForAllSubMeshes(void);
+
+		/** Internal method which, if animation types have not been determined,
+			scans any vertex animations and determines the type for each set of
+			vertex data (cannot have 2 different types).
+		*/
+		void _determineAnimationTypes(void) const;
+		/** Are the derived animation types out of date? */
+		bool _getAnimationTypesDirty(void) const { return mAnimationTypesDirty; }
+
+		/** Create a new Pose for this mesh or one of its submeshes.
+  	    @param target The target geometry index; 0 is the shared Mesh geometry, 1+ is the
+			dedicated SubMesh geometry belonging to submesh index + 1.
+		@param name Name to give the pose, which is optional
+		@returns A new Pose ready for population
+		*/
+		Pose* createPose(ushort target, const String& name = StringUtil::BLANK);
+		/** Get the number of poses.*/
+		size_t getPoseCount(void) const { return mPoseList.size(); }
+		/** Retrieve an existing Pose by index.*/
+		Pose* getPose(ushort index);
+		/** Retrieve an existing Pose by name.*/
+		Pose* getPose(const String& name);
+		/** Destroy a pose by index.
+		@note This will invalidate any animation tracks referring to this pose or those after it.
+		*/
+		void removePose(ushort index);
+		/** Destroy a pose by name.
+		@note This will invalidate any animation tracks referring to this pose or those after it.
+		*/
+		void removePose(const String& name);
+		/** Destroy all poses */
+		void removeAllPoses(void);
+
+		typedef VectorIterator<PoseList> PoseIterator;
+		typedef ConstVectorIterator<PoseList> ConstPoseIterator;
+
+		/** Get an iterator over all the poses defined. */
+		PoseIterator getPoseIterator(void);
+		/** Get an iterator over all the poses defined. */
+		ConstPoseIterator getPoseIterator(void) const;
+		/** Get pose list */
+		const PoseList& getPoseList(void) const;
+
+    };
+
+    /** Specialisation of SharedPtr to allow SharedPtr to be assigned to MeshPtr 
+    @note Has to be a subclass since we need operator=.
+    We could templatise this instead of repeating per Resource subclass, 
+    except to do so requires a form VC6 does not support i.e.
+    ResourceSubclassPtr<T> : public SharedPtr<T>
+    */
+    class _OgreExport MeshPtr : public SharedPtr<Mesh> 
+    {
+    public:
+        MeshPtr() : SharedPtr<Mesh>() {}
+        explicit MeshPtr(Mesh* rep) : SharedPtr<Mesh>(rep) {}
+        MeshPtr(const MeshPtr& r) : SharedPtr<Mesh>(r) {} 
+        MeshPtr(const ResourcePtr& r);
+        /// Operator used to convert a ResourcePtr to a MeshPtr
+        MeshPtr& operator=(const ResourcePtr& r);
+    protected:
+        /// Override destroy since we need to delete Mesh after fully defined
+        void destroy(void);
+    };
+
+	/** A way of recording the way each LODs is recorded this Mesh. */
+	struct MeshLodUsage
+	{
+		/// squared Z value from which this LOD will apply
+		Real fromDepthSquared;
+		/// Only relevant if mIsLodManual is true, the name of the alternative mesh to use
+		String manualName;
+		/// Hard link to mesh to avoid looking up each time
+		mutable MeshPtr manualMesh;
+        /// Edge list for this LOD level (may be derived from manual mesh)
+        mutable EdgeData* edgeData;
+	};
+
+
+
+} // namespace
+
+#endif
Index: /OgreMain/include/OgreMeshFileFormat.h
===================================================================
--- /OgreMain/include/OgreMeshFileFormat.h	(revision 5)
+++ /OgreMain/include/OgreMeshFileFormat.h	(revision 5)
@@ -0,0 +1,277 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __MeshFileFormat_H__
+#define __MeshFileFormat_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+/** Definition of the OGRE .mesh file format 
+
+    .mesh files are binary files (for read efficiency at runtime) and are arranged into chunks 
+    of data, very like 3D Studio's format.
+    A chunk always consists of:
+        unsigned short CHUNK_ID        : one of the following chunk ids identifying the chunk
+        unsigned long  LENGTH          : length of the chunk in bytes, including this header
+        void*          DATA            : the data, which may contain other sub-chunks (various data types)
+    
+    A .mesh file can contain both the definition of the Mesh itself, and optionally the definitions
+    of the materials is uses (although these can be omitted, if so the Mesh assumes that at runtime the
+    Materials referred to by name in the Mesh are loaded/created from another source)
+
+    A .mesh file only contains a single mesh, which can itself have multiple submeshes.
+
+*/
+
+	enum MeshChunkID {
+        M_HEADER                = 0x1000,
+            // char*          version           : Version number check
+        M_MESH                = 0x3000,
+			// bool skeletallyAnimated   // important flag which affects h/w buffer policies
+            // Optional M_GEOMETRY chunk
+            M_SUBMESH             = 0x4000, 
+                // char* materialName
+                // bool useSharedVertices
+                // unsigned int indexCount
+                // bool indexes32Bit
+                // unsigned int* faceVertexIndices (indexCount)
+                // OR
+                // unsigned short* faceVertexIndices (indexCount)
+                // M_GEOMETRY chunk (Optional: present only if useSharedVertices = false)
+                M_SUBMESH_OPERATION = 0x4010, // optional, trilist assumed if missing
+                    // unsigned short operationType
+                M_SUBMESH_BONE_ASSIGNMENT = 0x4100,
+                    // Optional bone weights (repeating section)
+                    // unsigned int vertexIndex;
+                    // unsigned short boneIndex;
+                    // float weight;
+    			// Optional chunk that matches a texture name to an alias
+                // a texture alias is sent to the submesh material to use this texture name
+                // instead of the one in the texture unit with a matching alias name
+                M_SUBMESH_TEXTURE_ALIAS = 0x4200, // Repeating section
+                    // char* aliasName;
+                    // char* textureName;
+
+            M_GEOMETRY          = 0x5000, // NB this chunk is embedded within M_MESH and M_SUBMESH
+                // unsigned int vertexCount
+				M_GEOMETRY_VERTEX_DECLARATION = 0x5100,
+					M_GEOMETRY_VERTEX_ELEMENT = 0x5110, // Repeating section
+						// unsigned short source;  	// buffer bind source
+						// unsigned short type;    	// VertexElementType
+						// unsigned short semantic; // VertexElementSemantic
+						// unsigned short offset;	// start offset in buffer in bytes
+						// unsigned short index;	// index of the semantic (for colours and texture coords)
+				M_GEOMETRY_VERTEX_BUFFER = 0x5200, // Repeating section
+					// unsigned short bindIndex;	// Index to bind this buffer to
+					// unsigned short vertexSize;	// Per-vertex size, must agree with declaration at this index
+					M_GEOMETRY_VERTEX_BUFFER_DATA = 0x5210,
+						// raw buffer data
+            M_MESH_SKELETON_LINK = 0x6000,
+                // Optional link to skeleton
+                // char* skeletonName           : name of .skeleton to use
+            M_MESH_BONE_ASSIGNMENT = 0x7000,
+                // Optional bone weights (repeating section)
+                // unsigned int vertexIndex;
+                // unsigned short boneIndex;
+                // float weight;
+            M_MESH_LOD = 0x8000,
+                // Optional LOD information
+                // unsigned short numLevels;
+                // bool manual;  (true for manual alternate meshes, false for generated)
+                M_MESH_LOD_USAGE = 0x8100,
+                // Repeating section, ordered in increasing depth
+				// NB LOD 0 (full detail from 0 depth) is omitted
+                // float fromSquaredDepth;
+                    M_MESH_LOD_MANUAL = 0x8110,
+                    // Required if M_MESH_LOD section manual = true
+                    // String manualMeshName;
+                    M_MESH_LOD_GENERATED = 0x8120,
+                    // Required if M_MESH_LOD section manual = false
+					// Repeating section (1 per submesh)
+                    // unsigned int indexCount;
+                    // bool indexes32Bit
+                    // unsigned short* faceIndexes;  (indexCount)
+                    // OR
+                    // unsigned int* faceIndexes;  (indexCount)
+            M_MESH_BOUNDS = 0x9000,
+                // float minx, miny, minz
+                // float maxx, maxy, maxz
+                // float radius
+                    
+			// Added By DrEvil
+			// optional chunk that contains a table of submesh indexes and the names of
+			// the sub-meshes.
+			M_SUBMESH_NAME_TABLE = 0xA000,
+				// Subchunks of the name table. Each chunk contains an index & string
+				M_SUBMESH_NAME_TABLE_ELEMENT = 0xA100,
+	                // short index
+                    // char* name
+			
+			// Optional chunk which stores precomputed edge data					 
+			M_EDGE_LISTS = 0xB000,
+				// Each LOD has a separate edge list
+				M_EDGE_LIST_LOD = 0xB100,
+					// unsigned short lodIndex
+					// bool isManual			// If manual, no edge data here, loaded from manual mesh
+                        // bool isClosed
+                        // unsigned long numTriangles
+                        // unsigned long numEdgeGroups
+						// Triangle* triangleList
+                            // unsigned long indexSet
+                            // unsigned long vertexSet
+                            // unsigned long vertIndex[3]
+                            // unsigned long sharedVertIndex[3] 
+                            // float normal[4] 
+
+                        M_EDGE_GROUP = 0xB110,
+                            // unsigned long vertexSet
+                            // unsigned long triStart
+                            // unsigned long triCount
+                            // unsigned long numEdges
+						    // Edge* edgeList
+                                // unsigned long  triIndex[2]
+                                // unsigned long  vertIndex[2]
+                                // unsigned long  sharedVertIndex[2]
+                                // bool degenerate
+
+			// Optional poses section, referred to by pose keyframes
+			M_POSES = 0xC000,
+				M_POSE = 0xC100,
+					// char* name (may be blank)
+					// unsigned short target	// 0 for shared geometry, 
+												// 1+ for submesh index + 1
+					M_POSE_VERTEX = 0xC111,
+						// unsigned long vertexIndex
+						// float xoffset, yoffset, zoffset
+			// Optional vertex animation chunk
+			M_ANIMATIONS = 0xD000, 
+				M_ANIMATION = 0xD100,
+				// char* name
+				// float length
+				M_ANIMATION_TRACK = 0xD110,
+					// unsigned short type			// 1 == morph, 2 == pose
+					// unsigned short target		// 0 for shared geometry, 
+													// 1+ for submesh index + 1
+					M_ANIMATION_MORPH_KEYFRAME = 0xD111,
+						// float time
+						// float x,y,z			// repeat by number of vertices in original geometry
+					M_ANIMATION_POSE_KEYFRAME = 0xD112,
+						// float time
+						M_ANIMATION_POSE_REF = 0xD113, // repeat for number of referenced poses
+							// unsigned short poseIndex 
+							// float influence
+
+			// Optional submesh extreme vertex list chink
+			M_TABLE_EXTREMES = 0xE000,
+			// unsigned short submesh_index;
+			// float extremes [n_extremes][3];
+
+	/* Version 1.2 of the .mesh fornmat (deprecated)
+	enum MeshChunkID {
+        M_HEADER                = 0x1000,
+            // char*          version           : Version number check
+        M_MESH                = 0x3000,
+			// bool skeletallyAnimated   // important flag which affects h/w buffer policies
+            // Optional M_GEOMETRY chunk
+            M_SUBMESH             = 0x4000, 
+                // char* materialName
+                // bool useSharedVertices
+                // unsigned int indexCount
+                // bool indexes32Bit
+                // unsigned int* faceVertexIndices (indexCount)
+                // OR
+                // unsigned short* faceVertexIndices (indexCount)
+                // M_GEOMETRY chunk (Optional: present only if useSharedVertices = false)
+                M_SUBMESH_OPERATION = 0x4010, // optional, trilist assumed if missing
+                    // unsigned short operationType
+                M_SUBMESH_BONE_ASSIGNMENT = 0x4100,
+                    // Optional bone weights (repeating section)
+                    // unsigned int vertexIndex;
+                    // unsigned short boneIndex;
+                    // float weight;
+            M_GEOMETRY          = 0x5000, // NB this chunk is embedded within M_MESH and M_SUBMESH
+			*/
+                // unsigned int vertexCount
+                // float* pVertices (x, y, z order x numVertices)
+                M_GEOMETRY_NORMALS = 0x5100,    //(Optional)
+                    // float* pNormals (x, y, z order x numVertices)
+                M_GEOMETRY_COLOURS = 0x5200,    //(Optional)
+                    // unsigned long* pColours (RGBA 8888 format x numVertices)
+                M_GEOMETRY_TEXCOORDS = 0x5300,    //(Optional, REPEATABLE, each one adds an extra set)
+                    // unsigned short dimensions    (1 for 1D, 2 for 2D, 3 for 3D)
+                    // float* pTexCoords  (u [v] [w] order, dimensions x numVertices)
+			/*
+            M_MESH_SKELETON_LINK = 0x6000,
+                // Optional link to skeleton
+                // char* skeletonName           : name of .skeleton to use
+            M_MESH_BONE_ASSIGNMENT = 0x7000,
+                // Optional bone weights (repeating section)
+                // unsigned int vertexIndex;
+                // unsigned short boneIndex;
+                // float weight;
+            M_MESH_LOD = 0x8000,
+                // Optional LOD information
+                // unsigned short numLevels;
+                // bool manual;  (true for manual alternate meshes, false for generated)
+                M_MESH_LOD_USAGE = 0x8100,
+                // Repeating section, ordered in increasing depth
+				// NB LOD 0 (full detail from 0 depth) is omitted
+                // float fromSquaredDepth;
+                    M_MESH_LOD_MANUAL = 0x8110,
+                    // Required if M_MESH_LOD section manual = true
+                    // String manualMeshName;
+                    M_MESH_LOD_GENERATED = 0x8120,
+                    // Required if M_MESH_LOD section manual = false
+					// Repeating section (1 per submesh)
+                    // unsigned int indexCount;
+                    // bool indexes32Bit
+                    // unsigned short* faceIndexes;  (indexCount)
+                    // OR
+                    // unsigned int* faceIndexes;  (indexCount)
+            M_MESH_BOUNDS = 0x9000
+                // float minx, miny, minz
+                // float maxx, maxy, maxz
+                // float radius
+
+			// Added By DrEvil
+			// optional chunk that contains a table of submesh indexes and the names of
+			// the sub-meshes.
+			M_SUBMESH_NAME_TABLE,
+				// Subchunks of the name table. Each chunk contains an index & string
+				M_SUBMESH_NAME_TABLE_ELEMENT,
+	                // short index
+                    // char* name
+
+	*/
+    };
+} // namespace
+
+
+#endif
Index: /OgreMain/include/OgreMeshManager.h
===================================================================
--- /OgreMain/include/OgreMeshManager.h	(revision 5)
+++ /OgreMain/include/OgreMeshManager.h	(revision 5)
@@ -0,0 +1,431 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __MeshManager_H__
+#define __MeshManager_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreResourceManager.h"
+#include "OgreSingleton.h"
+#include "OgreVector3.h"
+#include "OgreHardwareBuffer.h"
+#include "OgreMesh.h"
+#include "OgrePatchMesh.h"
+
+namespace Ogre {
+
+    /** Handles the management of mesh resources.
+        @remarks
+            This class deals with the runtime management of
+            mesh data; like other resource managers it handles
+            the creation of resources (in this case mesh data),
+            working within a fixed memory budget.
+    */
+    class _OgreExport MeshManager: public ResourceManager, public Singleton<MeshManager>, 
+        public ManualResourceLoader
+    {
+    public:
+        MeshManager();
+        ~MeshManager();
+
+        /** Initialises the manager, only to be called by OGRE internally. */
+        void _initialise(void);
+
+        /** Loads a mesh from a file, making it immediately available for use.
+            @note
+                If the model has already been loaded, the existing instance
+                will be returned.
+            @remarks
+                Ogre loads model files from it's own proprietary
+                format called .mesh. This is because having a single file
+                format is better for runtime performance, and we also have
+                control over pre-processed data (such as
+                collision boxes, LOD reductions etc).
+			@param filename The name of the .mesh file
+            @param groupName The name of the resource group to assign the mesh to 
+			@param vertexBufferUsage The usage flags with which the vertex buffer(s)
+				will be created
+			@param indexBufferUsage The usage flags with which the index buffer(s) created for 
+				this mesh will be created with.
+			@param vertexBufferShadowed If true, the vertex buffers will be shadowed by system memory 
+                copies for faster read access
+			@param indexBufferShadowed If true, the index buffers will be shadowed by system memory 
+                copies for faster read access
+			@param priority The priority of this mesh in the resource system
+        */
+        MeshPtr load( const String& filename, const String& groupName,
+			HardwareBuffer::Usage vertexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
+			HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
+			bool vertexBufferShadowed = true, bool indexBufferShadowed = true);
+
+
+        /** Creates a new Mesh specifically for manual definition rather
+            than loading from an object file. 
+		@remarks
+			Note that once you've defined your mesh, you must call Mesh::_setBounds and
+            Mesh::_setBoundingRadius in order to define the bounds of your mesh. In previous
+            versions of OGRE you could call Mesh::_updateBounds, but OGRE's support of 
+            write-only vertex buffers makes this no longer appropriate.
+        @param name The name to give the new mesh
+        @param groupName The name of the resource group to assign the mesh to 
+        @param loader ManualResourceLoader which will be called to load this mesh
+            when the time comes. It is recommended that you populate this field
+            in order that the mesh can be rebuilt should the need arise
+        */
+        MeshPtr createManual( const String& name, const String& groupName, 
+            ManualResourceLoader* loader = 0);
+
+        /** Creates a basic plane, by default majoring on the x/y axes facing positive Z.
+            @param
+                name The name to give the resulting mesh
+            @param 
+                groupName The name of the resource group to assign the mesh to 
+            @param
+                plane The orientation of the plane and distance from the origin
+            @param
+                width The width of the plane in world coordinates
+            @param
+                height The height of the plane in world coordinates
+            @param
+                xsegments The number of segements to the plane in the x direction
+            @param
+                ysegments The number of segements to the plane in the y direction
+            @param
+                normals If true, normals are created perpendicular to the plane
+            @param
+                numTexCoordSets The number of 2D texture coordinate sets created - by default the corners
+                are created to be the corner of the texture.
+            @param
+                uTile The number of times the texture should be repeated in the u direction
+            @param
+                vTile The number of times the texture should be repeated in the v direction
+            @param
+                upVector The 'Up' direction of the plane.
+			@param
+				vertexBufferUsage The usage flag with which the vertex buffer for this plane will be created
+			@param
+				indexBufferUsage The usage flag with which the index buffer for this plane will be created
+			@param
+				vertexShadowBuffer If this flag is set to true, the vertex buffer will be created 
+				with a system memory shadow buffer,
+				allowing you to read it back more efficiently than if it is in hardware
+			@param
+				indexShadowBuffer If this flag is set to true, the index buffer will be 
+				created with a system memory shadow buffer,
+				allowing you to read it back more efficiently than if it is in hardware
+        */
+        MeshPtr createPlane(
+            const String& name, const String& groupName, const Plane& plane,
+            Real width, Real height,
+            int xsegments = 1, int ysegments = 1,
+            bool normals = true, int numTexCoordSets = 1,
+            Real uTile = 1.0f, Real vTile = 1.0f, const Vector3& upVector = Vector3::UNIT_Y,
+			HardwareBuffer::Usage vertexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
+			HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
+			bool vertexShadowBuffer = true, bool indexShadowBuffer = true);
+
+        
+        /** Creates a plane, which because of it's texture coordinates looks like a curved
+			surface, useful for skies in a skybox. 
+            @param
+                name The name to give the resulting mesh
+            @param 
+                groupName The name of the resource group to assign the mesh to 
+            @param
+                plane The orientation of the plane and distance from the origin
+            @param
+                width The width of the plane in world coordinates
+            @param
+                height The height of the plane in world coordinates
+            @param
+				curvature The curvature of the plane. Good values are
+                between 2 and 65. Higher values are more curved leading to
+                a smoother effect, lower values are less curved meaning
+                more distortion at the horizons but a better distance effect.
+			@param
+                xsegments The number of segements to the plane in the x direction
+            @param
+                ysegments The number of segements to the plane in the y direction
+            @param
+                normals If true, normals are created perpendicular to the plane
+            @param
+                numTexCoordSets The number of 2D texture coordinate sets created - by default the corners
+                are created to be the corner of the texture.
+            @param
+                uTile The number of times the texture should be repeated in the u direction
+            @param
+                vTile The number of times the texture should be repeated in the v direction
+            @param
+                upVector The 'Up' direction of the plane.
+            @param
+                orientation The orientation of the overall sphere that's used to create the illusion
+			@param
+				vertexBufferUsage The usage flag with which the vertex buffer for this plane will be created
+			@param
+				indexBufferUsage The usage flag with which the index buffer for this plane will be created
+			@param
+				vertexShadowBuffer If this flag is set to true, the vertex buffer will be created 
+				with a system memory shadow buffer,
+				allowing you to read it back more efficiently than if it is in hardware
+			@param
+				indexShadowBuffer If this flag is set to true, the index buffer will be 
+				created with a system memory shadow buffer,
+				allowing you to read it back more efficiently than if it is in hardware
+            @param ySegmentsToKeep The number of segments from the top of the dome
+                downwards to keep. -1 keeps all of them. This can save fillrate if
+                you cannot see much of the sky lower down.
+        */
+		MeshPtr createCurvedIllusionPlane(
+            const String& name, const String& groupName, const Plane& plane,
+            Real width, Real height, Real curvature,
+            int xsegments = 1, int ysegments = 1,
+            bool normals = true, int numTexCoordSets = 1,
+            Real uTile = 1.0f, Real vTile = 1.0f, const Vector3& upVector = Vector3::UNIT_Y,
+            const Quaternion& orientation = Quaternion::IDENTITY,
+			HardwareBuffer::Usage vertexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
+			HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
+			bool vertexShadowBuffer = true, bool indexShadowBuffer = true, 
+            int ySegmentsToKeep = -1);
+
+		/** Creates a genuinely curved plane, by default majoring on the x/y axes facing positive Z.
+            @param
+                name The name to give the resulting mesh
+            @param 
+                groupName The name of the resource group to assign the mesh to 
+            @param
+                plane The orientation of the plane and distance from the origin
+            @param
+                width The width of the plane in world coordinates
+            @param
+                height The height of the plane in world coordinates
+			@param
+				bow The amount of 'bow' in the curved plane.  (Could also be concidered the depth.)
+            @param
+                xsegments The number of segements to the plane in the x direction
+            @param
+                ysegments The number of segements to the plane in the y direction
+            @param
+                normals If true, normals are created perpendicular to the plane
+            @param
+                numTexCoordSets The number of 2D texture coordinate sets created - by default the corners
+                are created to be the corner of the texture.
+            @param
+                uTile The number of times the texture should be repeated in the u direction
+            @param
+                vTile The number of times the texture should be repeated in the v direction
+            @param
+                upVector The 'Up' direction of the plane.
+			@param
+				vertexBufferUsage The usage flag with which the vertex buffer for this plane will be created
+			@param
+				indexBufferUsage The usage flag with which the index buffer for this plane will be created
+			@param
+				vertexShadowBuffer If this flag is set to true, the vertex buffer will be created 
+				with a system memory shadow buffer,
+				allowing you to read it back more efficiently than if it is in hardware
+			@param
+				indexShadowBuffer If this flag is set to true, the index buffer will be 
+				created with a system memory shadow buffer,
+				allowing you to read it back more efficiently than if it is in hardware
+        */
+		MeshPtr createCurvedPlane( 
+			const String& name, const String& groupName, const Plane& plane, 
+			Real width, Real height, Real bow = 0.5f, 
+			int xsegments = 1, int ysegments = 1,
+			bool normals = false, int numTexCoordSets = 1, 
+			Real xTile = 1.0f, Real yTile = 1.0f, const Vector3& upVector = Vector3::UNIT_Y,
+			HardwareBuffer::Usage vertexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
+			HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
+			bool vertexShadowBuffer = true, bool indexShadowBuffer = true);
+
+        /** Creates a Bezier patch based on an array of control vertices.
+            @param
+                name The name to give the newly created mesh. 
+            @param 
+                groupName The name of the resource group to assign the mesh to 
+            @param
+                controlPointBuffer A pointer to a buffer containing the vertex data which defines control points 
+                of the curves rather than actual vertices. Note that you are expected to provide not
+                just position information, but potentially normals and texture coordinates too. The
+                format of the buffer is defined in the VertexDeclaration parameter
+            @param
+                decaration VertexDeclaration describing the contents of the buffer. 
+                Note this declaration must _only_ draw on buffer source 0!
+            @param
+                width Specifies the width of the patch in control points.
+                Note this parameter must greater than or equal to 3.
+            @param
+                height Specifies the height of the patch in control points. 
+                Note this parameter must greater than or equal to 3.
+            @param
+                uMaxSubdivisionLevel,vMaxSubdivisionLevel If you want to manually set the top level of subdivision, 
+                do it here, otherwise let the system decide.
+            @param
+                visibleSide Determines which side of the patch (or both) triangles are generated for.
+            @param
+                vbUsage Vertex buffer usage flags. Recommend the default since vertex buffer should be static.
+            @param
+                ibUsage Index buffer usage flags. Recommend the default since index buffer should 
+                be dynamic to change levels but not readable.
+            @param
+                vbUseShadow Flag to determine if a shadow buffer is generated for the vertex buffer. See
+                    HardwareBuffer for full details.
+            @param
+                ibUseShadow Flag to determine if a shadow buffer is generated for the index buffer. See
+                    HardwareBuffer for full details.
+        */
+        PatchMeshPtr createBezierPatch(
+            const String& name, const String& groupName, void* controlPointBuffer, 
+            VertexDeclaration *declaration, size_t width, size_t height,
+            size_t uMaxSubdivisionLevel = PatchSurface::AUTO_LEVEL, 
+            size_t vMaxSubdivisionLevel = PatchSurface::AUTO_LEVEL,
+            PatchSurface::VisibleSide visibleSide = PatchSurface::VS_FRONT,
+            HardwareBuffer::Usage vbUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
+            HardwareBuffer::Usage ibUsage = HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY,
+            bool vbUseShadow = true, bool ibUseShadow = true);
+        
+        /** Tells the mesh manager that all future meshes should prepare themselves for
+            shadow volumes on loading.
+        */
+        void setPrepareAllMeshesForShadowVolumes(bool enable);
+        /** Retrieves whether all Meshes should prepare themselves for shadow volumes. */
+        bool getPrepareAllMeshesForShadowVolumes(void);
+
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static MeshManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static MeshManager* getSingletonPtr(void);
+
+	    /** Gets the factor by which the bounding box of an entity is padded.
+	        Default is 0.01
+	    */
+        Real getBoundsPaddingFactor(void);
+	
+	    /** Sets the factor by which the bounding box of an entity is padded
+	    */
+        void setBoundsPaddingFactor(Real paddingFactor);
+
+        /** @see ManualResourceLoader::loadResource */
+        void loadResource(Resource* res);
+
+    protected:
+        /// @copydoc ResourceManager::createImpl
+        Resource* createImpl(const String& name, ResourceHandle handle, 
+            const String& group, bool isManual, ManualResourceLoader* loader, 
+            const NameValuePairList* createParams);
+        
+        /** Utility method for tesselating 2D meshes.
+        */
+        void tesselate2DMesh(SubMesh* pSub, int meshWidth, int meshHeight, 
+			bool doubleSided = false, 
+			HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
+			bool indexSysMem = false);
+
+        void createPrefabPlane(void);
+		void createPrefabCube(void);
+		void createPrefabSphere(void);
+    
+        /** Enum identifying the types of manual mesh built by this manager */
+        enum MeshBuildType
+        {
+            MBT_PLANE,
+            MBT_CURVED_ILLUSION_PLANE,
+            MBT_CURVED_PLANE
+        };
+        /** Saved parameters used to (re)build a manual mesh built by this class */
+        struct MeshBuildParams
+        {
+            MeshBuildType type;
+            Plane plane;
+            Real width;
+            Real height;
+            Real curvature;
+            int xsegments;
+            int ysegments;
+            bool normals;
+            int numTexCoordSets;
+            Real xTile;
+            Real yTile;
+            Vector3 upVector;
+            Quaternion orientation;
+            HardwareBuffer::Usage vertexBufferUsage;
+            HardwareBuffer::Usage indexBufferUsage;
+            bool vertexShadowBuffer;
+            bool indexShadowBuffer;
+            int ySegmentsToKeep;
+        };
+        /** Map from resource pointer to parameter set */
+        typedef std::map<Resource*, MeshBuildParams> MeshBuildParamsMap;
+        MeshBuildParamsMap mMeshBuildParams;
+
+        /** Utility method for manual loading a plane */
+        void loadManualPlane(Mesh* pMesh, MeshBuildParams& params);
+        /** Utility method for manual loading a curved plane */
+        void loadManualCurvedPlane(Mesh* pMesh, MeshBuildParams& params);
+        /** Utility method for manual loading a curved illusion plane */
+        void loadManualCurvedIllusionPlane(Mesh* pMesh, MeshBuildParams& params);
+
+        bool mPrepAllMeshesForShadowVolumes;
+	
+	//the factor by which the bounding box of an entity is padded	
+	Real mBoundsPaddingFactor;
+    };
+
+
+} //namespace
+
+#endif
Index: /OgreMain/include/OgreMeshSerializer.h
===================================================================
--- /OgreMain/include/OgreMeshSerializer.h	(revision 5)
+++ /OgreMain/include/OgreMeshSerializer.h	(revision 5)
@@ -0,0 +1,99 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __MeshSerializer_H__
+#define __MeshSerializer_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMeshSerializerImpl.h"
+#include "OgreSerializer.h"
+
+namespace Ogre {
+
+    /** Class for serialising mesh data to/from an OGRE .mesh file.
+    @remarks
+        This class allows exporters to write OGRE .mesh files easily, and allows the
+        OGRE engine to import .mesh files into instatiated OGRE Meshes.
+        Note that a .mesh file can include not only the Mesh, but also definitions of
+        any Materials it uses (although this is optional, the .mesh can rely on the
+        Material being loaded from another source, especially useful if you want to
+        take advantage of OGRE's advanced Material properties which may not be available
+        in your modeller).
+    @par
+        To export a Mesh:<OL>
+        <LI>Use the MaterialManager methods to create any dependent Material objects, if you want
+            to export them with the Mesh.</LI>
+        <LI>Create a Mesh object and populate it using it's methods.</LI>
+        <LI>Call the exportMesh method</LI>
+        </OL>
+    @par
+        It's important to realise that this exporter uses OGRE terminology. In this context,
+        'Mesh' means a top-level mesh structure which can actually contain many SubMeshes, each
+        of which has only one Material. Modelling packages may refer to these differently, for
+        example in Milkshape, it says 'Model' instead of 'Mesh' and 'Mesh' instead of 'SubMesh', 
+        but the theory is the same.
+    */
+    class _OgreExport MeshSerializer : public Serializer
+    {
+    public:
+        MeshSerializer();
+        virtual ~MeshSerializer();
+
+
+        /** Exports a mesh to the file specified. 
+        @remarks
+            This method takes an externally created Mesh object, and exports both it
+            and optionally the Materials it uses to a .mesh file.
+        @param pMesh Pointer to the Mesh to export
+        @param filename The destination filename
+		@param endianMode The endian mode of the written file
+        */
+        void exportMesh(const Mesh* pMesh, const String& filename,
+			Endian endianMode = ENDIAN_NATIVE);
+
+        /** Imports Mesh and (optionally) Material data from a .mesh file DataStream.
+        @remarks
+            This method imports data from a DataStream opened from a .mesh file and places it's
+            contents into the Mesh object which is passed in. 
+        @param stream The DataStream holding the .mesh data. Must be initialised (pos at the start of the buffer).
+        @param pDest Pointer to the Mesh object which will receive the data. Should be blank already.
+        */
+        void importMesh(DataStreamPtr& stream, Mesh* pDest);
+    protected:
+        static String msCurrentVersion;
+
+        typedef std::map<String, MeshSerializerImpl* > MeshSerializerImplMap;
+        MeshSerializerImplMap mImplementations;
+
+    };
+
+}
+
+
+#endif
Index: /OgreMain/include/OgreMeshSerializerImpl.h
===================================================================
--- /OgreMain/include/OgreMeshSerializerImpl.h	(revision 5)
+++ /OgreMain/include/OgreMeshSerializerImpl.h	(revision 5)
@@ -0,0 +1,218 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __MeshSerializerImpl_H__
+#define __MeshSerializerImpl_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include "OgreSerializer.h"
+#include "OgreMaterial.h"
+#include "OgreMesh.h"
+#include "OgreEdgeListBuilder.h"
+
+namespace Ogre {
+
+
+    /** Internal implementation of Mesh reading / writing for the latest version of the
+    .mesh format.
+    @remarks
+    In order to maintain compatibility with older versions of the .mesh format, there
+    will be alternative subclasses of this class to load older versions, whilst this class
+    will remain to load the latest version.
+    */
+    class _OgrePrivate MeshSerializerImpl : public Serializer
+    {
+    public:
+        MeshSerializerImpl();
+        virtual ~MeshSerializerImpl();
+        /** Exports a mesh to the file specified. 
+        @remarks
+        This method takes an externally created Mesh object, and exports both it
+        and optionally the Materials it uses to a .mesh file.
+        @param pMesh Pointer to the Mesh to export
+        @param filename The destination filename
+		@param endianMode The endian mode for the written file
+        */
+        void exportMesh(const Mesh* pMesh, const String& filename,
+			Endian endianMode = ENDIAN_NATIVE);
+
+        /** Imports Mesh and (optionally) Material data from a .mesh file DataStream.
+        @remarks
+        This method imports data from a DataStream opened from a .mesh file and places it's
+        contents into the Mesh object which is passed in. 
+        @param stream The DataStream holding the .mesh data. Must be initialised (pos at the start of the buffer).
+        @param pDest Pointer to the Mesh object which will receive the data. Should be blank already.
+        */
+        void importMesh(DataStreamPtr& stream, Mesh* pDest);
+
+    protected:
+
+        // Internal methods
+        virtual void writeSubMeshNameTable(const Mesh* pMesh);
+        virtual void writeMesh(const Mesh* pMesh);
+        virtual void writeSubMesh(const SubMesh* s);
+        virtual void writeSubMeshOperation(const SubMesh* s);
+        virtual void writeSubMeshTextureAliases(const SubMesh* s);
+        virtual void writeGeometry(const VertexData* pGeom);
+        virtual void writeSkeletonLink(const String& skelName);
+        virtual void writeMeshBoneAssignment(const VertexBoneAssignment& assign);
+        virtual void writeSubMeshBoneAssignment(const VertexBoneAssignment& assign);
+        virtual void writeLodInfo(const Mesh* pMesh);
+        virtual void writeLodSummary(unsigned short numLevels, bool manual);
+        virtual void writeLodUsageManual(const MeshLodUsage& usage);
+        virtual void writeLodUsageGenerated(const Mesh* pMesh, const MeshLodUsage& usage, unsigned short lodNum);
+        virtual void writeBoundsInfo(const Mesh* pMesh);
+        virtual void writeEdgeList(const Mesh* pMesh);
+		virtual void writeAnimations(const Mesh* pMesh);
+		virtual void writeAnimation(const Animation* anim);
+		virtual void writePoses(const Mesh* pMesh);
+		virtual void writePose(const Pose* pose);
+		virtual void writeAnimationTrack(const VertexAnimationTrack* track);
+		virtual void writeMorphKeyframe(const VertexMorphKeyFrame* kf, size_t vertexCount);
+		virtual void writePoseKeyframe(const VertexPoseKeyFrame* kf);
+		virtual void writePoseKeyframePoseRef(const VertexPoseKeyFrame::PoseRef& poseRef);
+        virtual void writeExtremes(const Mesh *pMesh);
+        virtual void writeSubMeshExtremes(unsigned short idx, const SubMesh* s);
+
+        virtual size_t calcMeshSize(const Mesh* pMesh);
+        virtual size_t calcSubMeshSize(const SubMesh* pSub);
+        virtual size_t calcGeometrySize(const VertexData* pGeom);
+        virtual size_t calcSkeletonLinkSize(const String& skelName);
+        virtual size_t calcBoneAssignmentSize(void);
+        virtual size_t calcSubMeshOperationSize(const SubMesh* pSub);
+        virtual size_t calcSubMeshNameTableSize(const Mesh* pMesh);
+        virtual size_t calcEdgeListSize(const Mesh* pMesh);
+        virtual size_t calcEdgeListLodSize(const EdgeData* data, bool isManual);
+        virtual size_t calcEdgeGroupSize(const EdgeData::EdgeGroup& group);
+		virtual size_t calcPosesSize(const Mesh* pMesh);
+		virtual size_t calcPoseSize(const Pose* pose);
+		virtual size_t calcAnimationsSize(const Mesh* pMesh);
+		virtual size_t calcAnimationSize(const Animation* anim);
+		virtual size_t calcAnimationTrackSize(const VertexAnimationTrack* track);
+		virtual size_t calcMorphKeyframeSize(const VertexMorphKeyFrame* kf, size_t vertexCount);
+		virtual size_t calcPoseKeyframeSize(const VertexPoseKeyFrame* kf);
+		virtual size_t calcPoseKeyframePoseRefSize(void);
+		virtual size_t calcPoseVertexSize(void);
+        virtual size_t calcSubMeshTextureAliasesSize(const SubMesh* pSub);
+
+
+        virtual void readTextureLayer(DataStreamPtr& stream, Mesh* pMesh, MaterialPtr& pMat);
+        virtual void readSubMeshNameTable(DataStreamPtr& stream, Mesh* pMesh);
+        virtual void readMesh(DataStreamPtr& stream, Mesh* pMesh);
+        virtual void readSubMesh(DataStreamPtr& stream, Mesh* pMesh);
+        virtual void readSubMeshOperation(DataStreamPtr& stream, Mesh* pMesh, SubMesh* sub);
+        virtual void readSubMeshTextureAlias(DataStreamPtr& stream, Mesh* pMesh, SubMesh* sub);
+        virtual void readGeometry(DataStreamPtr& stream, Mesh* pMesh, VertexData* dest);
+        virtual void readGeometryVertexDeclaration(DataStreamPtr& stream, Mesh* pMesh, VertexData* dest);
+        virtual void readGeometryVertexElement(DataStreamPtr& stream, Mesh* pMesh, VertexData* dest);
+        virtual void readGeometryVertexBuffer(DataStreamPtr& stream, Mesh* pMesh, VertexData* dest);
+
+        virtual void readSkeletonLink(DataStreamPtr& stream, Mesh* pMesh);
+        virtual void readMeshBoneAssignment(DataStreamPtr& stream, Mesh* pMesh);
+        virtual void readSubMeshBoneAssignment(DataStreamPtr& stream, Mesh* pMesh, 
+            SubMesh* sub);
+        virtual void readMeshLodInfo(DataStreamPtr& stream, Mesh* pMesh);
+        virtual void readMeshLodUsageManual(DataStreamPtr& stream, Mesh* pMesh, 
+            unsigned short lodNum, MeshLodUsage& usage);
+        virtual void readMeshLodUsageGenerated(DataStreamPtr& stream, Mesh* pMesh, 
+            unsigned short lodNum, MeshLodUsage& usage);
+        virtual void readBoundsInfo(DataStreamPtr& stream, Mesh* pMesh);
+        virtual void readEdgeList(DataStreamPtr& stream, Mesh* pMesh);
+        virtual void readEdgeListLodInfo(DataStreamPtr& stream, EdgeData* edgeData);
+		virtual void readPoses(DataStreamPtr& stream, Mesh* pMesh);
+		virtual void readPose(DataStreamPtr& stream, Mesh* pMesh);
+		virtual void readAnimations(DataStreamPtr& stream, Mesh* pMesh);
+		virtual void readAnimation(DataStreamPtr& stream, Mesh* pMesh);
+		virtual void readAnimationTrack(DataStreamPtr& stream, Animation* anim, 
+			Mesh* pMesh);
+		virtual void readMorphKeyFrame(DataStreamPtr& stream, VertexAnimationTrack* track);
+		virtual void readPoseKeyFrame(DataStreamPtr& stream, VertexAnimationTrack* track);
+		virtual void readExtremes(DataStreamPtr& stream, Mesh *pMesh);
+
+
+        /// Flip an entire vertex buffer from little endian
+        virtual void flipFromLittleEndian(void* pData, size_t vertexCount, size_t vertexSize, const VertexDeclaration::VertexElementList& elems);
+        /// Flip an entire vertex buffer to little endian
+        virtual void flipToLittleEndian(void* pData, size_t vertexCount, size_t vertexSize, const VertexDeclaration::VertexElementList& elems);
+        /// Flip the endianness of an entire vertex buffer, passed in as a 
+        /// pointer to locked or temporary memory 
+        virtual void flipEndian(void* pData, size_t vertexCount, size_t vertexSize, const VertexDeclaration::VertexElementList& elems);
+
+
+
+    };
+
+    /** Class for providing backwards-compatibility for loading version 1.3 of the .mesh format. */
+    class _OgrePrivate MeshSerializerImpl_v1_3 : public MeshSerializerImpl
+    {
+    public:
+        MeshSerializerImpl_v1_3();
+        ~MeshSerializerImpl_v1_3();
+    protected:
+        virtual void readEdgeListLodInfo(DataStreamPtr& stream, EdgeData* edgeData);
+
+        /// Reorganise triangles of the edge list to group by vertex set
+        virtual void reorganiseTriangles(EdgeData* edgeData);
+    };
+
+    /** Class for providing backwards-compatibility for loading version 1.2 of the .mesh format. */
+    class _OgrePrivate MeshSerializerImpl_v1_2 : public MeshSerializerImpl_v1_3
+    {
+    public:
+        MeshSerializerImpl_v1_2();
+        ~MeshSerializerImpl_v1_2();
+    protected:
+        virtual void readMesh(DataStreamPtr& stream, Mesh* pMesh);
+        virtual void readGeometry(DataStreamPtr& stream, Mesh* pMesh, VertexData* dest);
+        virtual void readGeometryPositions(unsigned short bindIdx, DataStreamPtr& stream, 
+            Mesh* pMesh, VertexData* dest);
+        virtual void readGeometryNormals(unsigned short bindIdx, DataStreamPtr& stream, 
+            Mesh* pMesh, VertexData* dest);
+        virtual void readGeometryColours(unsigned short bindIdx, DataStreamPtr& stream, 
+            Mesh* pMesh, VertexData* dest);
+        virtual void readGeometryTexCoords(unsigned short bindIdx, DataStreamPtr& stream, 
+            Mesh* pMesh, VertexData* dest, unsigned short set);
+    };
+
+    /** Class for providing backwards-compatibility for loading version 1.1 of the .mesh format. */
+    class _OgrePrivate MeshSerializerImpl_v1_1 : public MeshSerializerImpl_v1_2
+    {
+    public:
+        MeshSerializerImpl_v1_1();
+        ~MeshSerializerImpl_v1_1();
+    protected:
+        void readGeometryTexCoords(unsigned short bindIdx, DataStreamPtr& stream, 
+            Mesh* pMesh, VertexData* dest, unsigned short set);
+    };
+
+
+}
+
+#endif
Index: /OgreMain/include/OgreMovableObject.h
===================================================================
--- /OgreMain/include/OgreMovableObject.h	(revision 5)
+++ /OgreMain/include/OgreMovableObject.h	(revision 5)
@@ -0,0 +1,530 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __MovableObject_H__
+#define __MovableObject_H__
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+#include "OgreRenderQueue.h"
+#include "OgreAxisAlignedBox.h"
+#include "OgreSphere.h"
+#include "OgreShadowCaster.h"
+#include "OgreFactoryObj.h"
+#include "OgreAnimable.h"
+#include "OgreAny.h"
+#include "OgreUserDefinedObject.h"
+
+namespace Ogre {
+
+	// Forward declaration
+	class MovableObjectFactory;
+
+    /** Abstract class definining a movable object in a scene.
+        @remarks
+            Instances of this class are discrete, relatively small, movable objects
+            which are attached to SceneNode objects to define their position.
+    */
+    class _OgreExport MovableObject : public ShadowCaster, public AnimableObject
+    {
+    public:
+        /** Listener which gets called back on MovableObject events.
+        */
+        class _OgreExport Listener
+        {
+        public:
+            Listener(void) {}
+            virtual ~Listener() {}
+            /** MovableObject is being destroyed */
+            virtual void objectDestroyed(MovableObject*) {}
+            /** MovableObject has been attached to a node */
+            virtual void objectAttached(MovableObject*) {}
+            /** MovableObject has been detached from a node */
+            virtual void objectDetached(MovableObject*) {}
+            /** MovableObject has been moved */
+            virtual void objectMoved(MovableObject*) {}
+            /** Called when the movable object of the camera to be used for rendering.
+            @returns
+                true if allows queue for rendering, false otherwise.
+            */
+            virtual bool objectRendering(const MovableObject*, const Camera*) { return true; }
+            /** Called when the movable object needs to query a light list.
+            @remarks
+                If you want to customize light finding for this object, you should override 
+				this method and hook into MovableObject via MovableObject::setListener.
+				Be aware that the default method caches results within a frame to 
+				prevent unnecessary recalculation, so if you override this you 
+				should provide your own cacheing to maintain performance.
+			@note
+				If you use texture shadows, there is an additional restriction - 
+				since the lights which should have shadow textures rendered for
+				them are determined based on the entire frustum, and not per-object,
+				it is important that the lights returned at the start of this 
+				list (up to the number of shadow textures available) are the same 
+				lights that were used to generate the shadow textures, 
+				and they are in the same order (particularly for additive effects).
+            @returns
+                A pointer to a light list if you populated the light list yourself, or
+                NULL to fall back on the default finding process.
+            */
+            virtual const LightList* objectQueryLights(const MovableObject*) { return 0; }
+        };
+
+    protected:
+		/// Name of this object
+		String mName;
+		/// Creator of this object (if created by a factory)
+		MovableObjectFactory* mCreator;
+		/// SceneManager holding this object (if applicable)
+		SceneManager* mManager;
+        /// node to which this object is attached
+        Node* mParentNode;
+        bool mParentIsTagPoint;
+        /// Is this object visible?
+        bool mVisible;
+		/// Upper distance to still render
+		Real mUpperDistance;
+		Real mSquaredUpperDistance;
+		/// Hidden because of distance?
+		bool mBeyondFarDistance;
+		/// User defined link to another object / value / whatever
+		Any mUserAny;
+        /// The render queue to use when rendering this object
+        uint8 mRenderQueueID;
+		/// Flags whether the RenderQueue's default should be used.
+		bool mRenderQueueIDSet;
+        /// Flags determining whether this object is included / excluded from scene queries
+        uint32 mQueryFlags;
+        /// Flags determining whether this object is visible (compared to SceneManager mask)
+        uint32 mVisibilityFlags;
+        /// Cached world AABB of this object
+        mutable AxisAlignedBox mWorldAABB;
+		// Cached world bounding sphere
+		mutable Sphere mWorldBoundingSphere;
+        /// World space AABB of this object's dark cap
+        mutable AxisAlignedBox mWorldDarkCapBounds;
+        /// Does this object cast shadows?
+        bool mCastShadows;
+
+        /// Does rendering this object disabled by listener?
+        bool mRenderingDisabled;
+        /// MovableObject listener - only one allowed (no list) for size & performance reasons. */
+        Listener* mListener;
+
+        /// List of lights for this object
+        mutable LightList mLightList;
+        /// The last frame that this light list was updated in
+        mutable ulong mLightListUpdated;
+
+		// Static members
+		/// Default query flags
+		static uint32 msDefaultQueryFlags;
+		/// Default visibility flags
+		static uint32 msDefaultVisibilityFlags;
+
+
+
+    public:
+        /// Constructor
+        MovableObject();
+
+		/// Named constructor
+		MovableObject(const String& name);
+        /** Virtual destructor - read Scott Meyers if you don't know why this is needed.
+        */
+        virtual ~MovableObject();
+
+		/** Notify the object of it's creator (internal use only) */
+		virtual void _notifyCreator(MovableObjectFactory* fact) { mCreator = fact; }
+		/** Get the creator of this object, if any (internal use only) */
+		virtual MovableObjectFactory*  _getCreator(void) const { return mCreator; }
+		/** Notify the object of it's manager (internal use only) */
+		virtual void _notifyManager(SceneManager* man) { mManager = man; }
+		/** Get the manager of this object, if any (internal use only) */
+		virtual SceneManager* _getManager(void) const { return mManager; }
+
+        /** Returns the name of this object. */
+		virtual const String& getName(void) const { return mName; }
+
+        /** Returns the type name of this object. */
+        virtual const String& getMovableType(void) const = 0;
+
+        /** Returns the node to which this object is attached.
+        @remarks
+            A MovableObject may be attached to either a SceneNode or to a TagPoint, 
+            the latter case if it's attached to a bone on an animated entity. 
+            Both are Node subclasses so this method will return either.
+        */
+        virtual Node* getParentNode(void) const;
+
+        /** Returns the scene node to which this object is attached.
+        @remarks
+            A MovableObject may be attached to either a SceneNode or to a TagPoint, 
+            the latter case if it's attached to a bone on an animated entity. 
+            This method will return the scene node of the parent entity 
+            if the latter is true.
+        */
+        virtual SceneNode* getParentSceneNode(void) const;
+
+        /** Internal method called to notify the object that it has been attached to a node.
+        */
+        virtual void _notifyAttached(Node* parent, bool isTagPoint = false);
+
+        /** Returns true if this object is attached to a SceneNode or TagPoint. */
+        virtual bool isAttached(void) const;
+
+        /** Returns true if this object is attached to a SceneNode or TagPoint, 
+			and this SceneNode / TagPoint is currently in an active part of the
+			scene graph. */
+        virtual bool isInScene(void) const;
+
+        /** Internal method called to notify the object that it has been moved.
+        */
+        virtual void _notifyMoved(void);
+
+		/** Internal method to notify the object of the camera to be used for the next rendering operation.
+            @remarks
+                Certain objects may want to do specific processing based on the camera position. This method notifies
+                them incase they wish to do this.
+        */
+        virtual void _notifyCurrentCamera(Camera* cam);
+
+        /** Retrieves the local axis-aligned bounding box for this object.
+            @remarks
+                This bounding box is in local coordinates.
+        */
+        virtual const AxisAlignedBox& getBoundingBox(void) const = 0;
+
+		/** Retrieves the radius of the origin-centered bounding sphere 
+		 	 for this object.
+		*/
+		virtual Real getBoundingRadius(void) const = 0;
+
+        /** Retrieves the axis-aligned bounding box for this object in world coordinates. */
+        virtual const AxisAlignedBox& getWorldBoundingBox(bool derive = false) const;
+		/** Retrieves the worldspace bounding sphere for this object. */
+        virtual const Sphere& getWorldBoundingSphere(bool derive = false) const;
+        /** Internal method by which the movable object must add Renderable subclass instances to the rendering queue.
+            @remarks
+                The engine will call this method when this object is to be rendered. The object must then create one or more
+                Renderable subclass instances which it places on the passed in Queue for rendering.
+        */
+        virtual void _updateRenderQueue(RenderQueue* queue) = 0;
+
+        /** Tells this object whether to be visible or not, if it has a renderable component. 
+		@note An alternative approach of making an object invisible is to detach it
+			from it's SceneNode, or to remove the SceneNode entirely. 
+			Detaching a node means that structurally the scene graph changes. 
+			Once this change has taken place, the objects / nodes that have been 
+			removed have less overhead to the visbility detection pass than simply
+			making the object invisible, so if you do this and leave the objects 
+			out of the tree for a long time, it's faster. However, the act of 
+			detaching / reattaching nodes is in itself more expensive than 
+			setting an object visibility flag, since in the latter case 
+			structural changes are not made. Therefore, small or frequent visbility
+			changes are best done using this method; large or more longer term
+			changes are best done by detaching.
+		*/
+        virtual void setVisible(bool visible);
+
+        /** Gets this object whether to be visible or not, if it has a renderable component. 
+        @remarks
+            Returns the value set by MovableObject::setVisible only.
+        */
+        virtual bool getVisible(void) const;
+
+        /** Returns whether or not this object is supposed to be visible or not. 
+		@remarks
+			Takes into account both upper rendering distance and visible flag.
+		*/
+        virtual bool isVisible(void) const;
+
+		/** Sets the distance at which the object is no longer rendered.
+		@param dist Distance beyond which the object will not be rendered 
+			(the default is 0, which means objects are always rendered).
+		*/
+		virtual void setRenderingDistance(Real dist) { 
+			mUpperDistance = dist; 
+			mSquaredUpperDistance = mUpperDistance * mUpperDistance;
+		}
+
+		/** Gets the distance at which batches are no longer rendered. */
+		virtual Real getRenderingDistance(void) const { return mUpperDistance; }
+
+        /** Call this to associate your own custom user object instance with this MovableObject.
+        @remarks
+            By simply making your game / application object a subclass of UserDefinedObject, you
+            can establish a link between an OGRE instance of MovableObject and your own application
+            classes. Call this method to establish the link.
+        */
+        virtual void setUserObject(UserDefinedObject* obj) { mUserAny = Any(obj); }
+        /** Retrieves a pointer to a custom application object associated with this movable by an earlier
+            call to setUserObject.
+        */
+        virtual UserDefinedObject* getUserObject(void) 
+		{ 
+			return mUserAny.isEmpty() ? 0 : any_cast<UserDefinedObject*>(mUserAny); 
+		}
+
+		/** Sets any kind of user value on this object.
+		@remarks
+			This method allows you to associate any user value you like with 
+			this MovableObject. This can be a pointer back to one of your own
+			classes for instance.
+		@note This value is shared with setUserObject so don't use both!
+		*/
+		virtual void setUserAny(const Any& anything) { mUserAny = anything; }
+
+		/** Retrieves the custom user value associated with this object.
+		*/
+		virtual const Any& getUserAny(void) const { return mUserAny; }
+
+        /** Sets the render queue group this entity will be rendered through.
+        @remarks
+            Render queues are grouped to allow you to more tightly control the ordering
+            of rendered objects. If you do not call this method, all Entity objects default
+            to the default queue (RenderQueue::getDefaultQueueGroup), which is fine for most objects. You may want to alter this
+            if you want this entity to always appear in front of other objects, e.g. for
+            a 3D menu system or such.
+        @par
+            See RenderQueue for more details.
+        @param queueID Enumerated value of the queue group to use.
+        */
+        virtual void setRenderQueueGroup(uint8 queueID);
+
+        /** Gets the queue group for this entity, see setRenderQueueGroup for full details. */
+        virtual uint8 getRenderQueueGroup(void) const;
+
+		/// return the full transformation of the parent sceneNode or the attachingPoint node
+		virtual const Matrix4& _getParentNodeFullTransform(void) const;
+
+        /** Sets the query flags for this object.
+        @remarks
+            When performing a scene query, this object will be included or excluded according
+            to flags on the object and flags on the query. This is a bitwise value, so only when
+            a bit on these flags is set, will it be included in a query asking for that flag. The
+            meaning of the bits is application-specific.
+        */
+        virtual void setQueryFlags(uint32 flags) { mQueryFlags = flags; }
+
+        /** As setQueryFlags, except the flags passed as parameters are appended to the
+        existing flags on this object. */
+        virtual void addQueryFlags(uint32 flags) { mQueryFlags |= flags; }
+            
+        /** As setQueryFlags, except the flags passed as parameters are removed from the
+        existing flags on this object. */
+        virtual void removeQueryFlags(unsigned long flags) { mQueryFlags &= ~flags; }
+        
+        /// Returns the query flags relevant for this object
+        virtual uint32 getQueryFlags(void) const { return mQueryFlags; }
+
+		/** Set the default query flags for all future MovableObject instances.
+		*/
+		static void setDefaultQueryFlags(uint32 flags) { msDefaultQueryFlags = flags; }
+
+		/** Get the default query flags for all future MovableObject instances.
+		*/
+		static uint32 getDefaultQueryFlags() { return msDefaultQueryFlags; }
+
+		
+        /** Sets the visiblity flags for this object.
+        @remarks
+			As well as a simple true/false value for visibility (as seen in setVisible), 
+			you can also set visiblity flags which when 'and'ed with the SceneManager's
+			visibility mask can also make an object invisible.
+        */
+        virtual void setVisibilityFlags(uint32 flags) { mVisibilityFlags = flags; }
+
+        /** As setVisibilityFlags, except the flags passed as parameters are appended to the
+        existing flags on this object. */
+        virtual void addVisibilityFlags(uint32 flags) { mVisibilityFlags |= flags; }
+            
+        /** As setVisibilityFlags, except the flags passed as parameters are removed from the
+        existing flags on this object. */
+        virtual void removeVisibilityFlags(uint32 flags) { mVisibilityFlags &= ~flags; }
+        
+        /// Returns the visibility flags relevant for this object
+        virtual uint32 getVisibilityFlags(void) const { return mVisibilityFlags; }
+
+		/** Set the default visibility flags for all future MovableObject instances.
+		*/
+		static void setDefaultVisibilityFlags(uint32 flags) { msDefaultVisibilityFlags = flags; }
+		
+		/** Get the default visibility flags for all future MovableObject instances.
+		*/
+		static uint32 getDefaultVisibilityFlags() { return msDefaultVisibilityFlags; }
+
+        /** Sets a listener for this object.
+        @remarks
+            Note for size and performance reasons only one listener per object
+            is allowed.
+        */
+        virtual void setListener(Listener* listener) { mListener = listener; }
+
+        /** Gets the current listener for this object.
+        */
+        virtual Listener* getListener(void) const { return mListener; }
+
+        /** Gets a list of lights, ordered relative to how close they are to this movable object.
+        @remarks
+            By default, this method gives the listener a chance to populate light list first,
+            if there is no listener or Listener::objectQueryLights returns NULL, it'll
+            query the light list from parent entity if it is present, or returns
+            SceneNode::findLights if it has parent scene node, otherwise it just returns
+            an empty list.
+        @par
+            The object internally caches the light list, so it will recalculate
+			it only when object is moved, or lights that affect the frustum have
+			been changed (@see SceneManager::_getLightsDirtyCounter),
+            but if listener exists, it will be called each time, so the listener 
+			should implement their own cache mechanism to optimise performance.
+        @par
+            This method can be useful when implementing Renderable::getLights in case
+            the renderable is a part of the movable.
+        @returns The list of lights use to lighting this object.
+        */
+        virtual const LightList& queryLights(void) const;
+
+		/// Define a default implementation of method from ShadowCaster which implements no shadows
+        EdgeData* getEdgeList(void) { return NULL; }
+		/// Define a default implementation of method from ShadowCaster which implements no shadows
+		bool hasEdgeList(void) { return false; }
+        /// Define a default implementation of method from ShadowCaster which implements no shadows
+        ShadowRenderableListIterator getShadowVolumeRenderableIterator(
+            ShadowTechnique shadowTechnique, const Light* light, 
+            HardwareIndexBufferSharedPtr* indexBuffer, 
+            bool extrudeVertices, Real extrusionDist, unsigned long flags = 0);
+		
+        /** Overridden member from ShadowCaster. */
+        const AxisAlignedBox& getLightCapBounds(void) const;
+        /** Overridden member from ShadowCaster. */
+        const AxisAlignedBox& getDarkCapBounds(const Light& light, Real dirLightExtrusionDist) const;
+        /** Sets whether or not this object will cast shadows.
+        @remarks
+        This setting simply allows you to turn on/off shadows for a given object.
+        An object will not cast shadows unless the scene supports it in any case
+        (see SceneManager::setShadowTechnique), and also the material which is
+        in use must also have shadow casting enabled. By default all entities cast
+        shadows. If, however, for some reason you wish to disable this for a single 
+        object then you can do so using this method.
+        @note This method normally refers to objects which block the light, but
+        since Light is also a subclass of MovableObject, in that context it means
+        whether the light causes shadows itself.
+        */
+        void setCastShadows(bool enabled) { mCastShadows = enabled; }
+        /** Returns whether shadow casting is enabled for this object. */
+        bool getCastShadows(void) const { return mCastShadows; }
+        /** Get the distance to extrude for a point/spot light */
+        Real getPointExtrusionDistance(const Light* l) const;
+		/** Get the 'type flags' for this MovableObject.
+		@remarks
+			A type flag identifies the type of the MovableObject as a bitpattern. 
+			This is used for categorical inclusion / exclusion in SceneQuery
+			objects. By default, this method returns all ones for objects not 
+			created by a MovableObjectFactory (hence always including them); 
+			otherwise it returns the value assigned to the MovableObjectFactory.
+			Custom objects which don't use MovableObjectFactory will need to 
+			override this if they want to be included in queries.
+		*/
+		virtual uint32 getTypeFlags(void) const;
+
+
+
+
+
+    };
+
+	/** Interface definition for a factory class which produces a certain
+		kind of MovableObject, and can be registered with Root in order
+		to allow all clients to produce new instances of this object, integrated
+		with the standard Ogre processing.
+	*/
+	class _OgreExport MovableObjectFactory 
+	{
+	protected:
+		/// Type flag, allocated if requested
+		unsigned long mTypeFlag;
+
+		/// Internal implementation of create method - must be overridden
+		virtual MovableObject* createInstanceImpl(
+			const String& name, const NameValuePairList* params = 0) = 0;
+	public:
+		MovableObjectFactory() : mTypeFlag(0xFFFFFFFF) {}
+		virtual ~MovableObjectFactory() {}
+		/// Get the type of the object to be created
+		virtual const String& getType(void) const = 0;
+
+		/** Create a new instance of the object.
+		@param name The name of the new object
+		@param manager The SceneManager instance that will be holding the
+			instance once created.
+		@param params Name/value pair list of additional parameters required to 
+			construct the object (defined per subtype). Optional.
+		*/
+		virtual MovableObject* createInstance(
+			const String& name, SceneManager* manager, 
+			const NameValuePairList* params = 0);
+		/** Destroy an instance of the object */
+		virtual void destroyInstance(MovableObject* obj) = 0;
+
+		/** Does this factory require the allocation of a 'type flag', used to 
+			selectively include / exclude this type from scene queries?
+		@remarks
+			The default implementation here is to return 'false', ie not to 
+			request a unique type mask from Root. For objects that
+			never need to be excluded in SceneQuery results, that's fine, since
+			the default implementation of MovableObject::getTypeFlags is to return
+			all ones, hence matching any query type mask. However, if you want the
+			objects created by this factory to be filterable by queries using a 
+			broad type, you have to give them a (preferably unique) type mask - 
+			and given that you don't know what other MovableObject types are 
+			registered, Root will allocate you one. 
+		*/
+		virtual bool requestTypeFlags(void) const { return false; }
+		/** Notify this factory of the type mask to apply. 
+		@remarks
+			This should normally only be called by Root in response to
+			a 'true' result from requestTypeMask. However, you can actually use
+			it yourself if you're careful; for example to assign the same mask
+			to a number of different types of object, should you always wish them
+			to be treated the same in queries.
+		*/
+		void _notifyTypeFlags(unsigned long flag) { mTypeFlag = flag; }
+
+		/** Gets the type flag for this factory.
+		@remarks
+			A type flag is like a query flag, except that it applies to all instances
+			of a certain type of object.
+		*/
+		unsigned long getTypeFlags(void) const { return mTypeFlag; }
+
+	};
+
+}
+#endif
Index: /OgreMain/include/OgreMovablePlane.h
===================================================================
--- /OgreMain/include/OgreMovablePlane.h	(revision 5)
+++ /OgreMain/include/OgreMovablePlane.h	(revision 5)
@@ -0,0 +1,87 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+// Original free version by:
+// Magic Software, Inc.
+// http://www.geometrictools.com/
+// Copyright (c) 2000, All Rights Reserved
+
+#ifndef __MovablePlane_H__
+#define __MovablePlane_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgrePlane.h"
+#include "OgreMovableObject.h"
+
+namespace Ogre {
+
+
+    /** Definition of a Plane that may be attached to a node, and the derived
+        details of it retrieved simply.
+    @remarks
+        This plane is not here for rendering purposes, it's to allow you to attach
+        planes to the scene in order to have them move and follow nodes on their
+        own, which is useful if you're using the plane for some kind of calculation,
+        e.g. reflection.
+    */
+    class _OgreExport MovablePlane : public Plane, public MovableObject
+    {
+    protected:
+        mutable Plane mDerivedPlane;
+        mutable Vector3 mLastTranslate;
+        mutable Quaternion mLastRotate;
+        AxisAlignedBox mNullBB;
+        mutable bool mDirty;
+        static String msMovableType;
+    public:
+
+        MovablePlane(const String& name);
+        MovablePlane (const Plane& rhs);
+        /** Construct a plane through a normal, and a distance to move the plane along the normal.*/
+        MovablePlane (const Vector3& rkNormal, Real fConstant);
+        MovablePlane (const Vector3& rkNormal, const Vector3& rkPoint);
+        MovablePlane (const Vector3& rkPoint0, const Vector3& rkPoint1,
+            const Vector3& rkPoint2);
+        ~MovablePlane() {}
+        /// Overridden from MovableObject
+        void _notifyCurrentCamera(Camera*) { /* don't care */ }
+        /// Overridden from MovableObject
+        const AxisAlignedBox& getBoundingBox(void) const { return mNullBB; }
+        /// Overridden from MovableObject
+        Real getBoundingRadius(void) const { return Math::POS_INFINITY; }
+        /// Overridden from MovableObject
+        void _updateRenderQueue(RenderQueue*) { /* do nothing */}
+        /// Overridden from MovableObject
+        const String& getMovableType(void) const;
+        /// Get the derived plane as transformed by its parent node. 
+        const Plane& _getDerivedPlane(void) const;
+
+    };
+}
+#endif
Index: /OgreMain/include/OgreNoMemoryMacros.h
===================================================================
--- /OgreMain/include/OgreNoMemoryMacros.h	(revision 5)
+++ /OgreMain/include/OgreNoMemoryMacros.h	(revision 5)
@@ -0,0 +1,42 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+//-----------------------------------------------------------------------------
+// If you want to use the real C(++) *alloc/free/new/delete functions, you must
+// include this header before the section that uses them.
+#ifdef OGRE_MEMORY_MACROS
+#undef OGRE_MEMORY_MACROS
+#undef new
+#undef delete
+#undef malloc
+#undef calloc
+#undef realloc
+#undef free
+#endif
+//-----------------------------------------------------------------------------
Index: /OgreMain/include/OgreNode.h
===================================================================
--- /OgreMain/include/OgreNode.h	(revision 5)
+++ /OgreMain/include/OgreNode.h	(revision 5)
@@ -0,0 +1,736 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _Node_H__
+#define _Node_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreMatrix3.h"
+#include "OgreMatrix4.h"
+#include "OgreQuaternion.h"
+#include "OgreString.h"
+#include "OgreRenderable.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre {
+
+
+    /** Class representing a general-purpose node an articulated scene graph.
+        @remarks
+            A node in the scene graph is a node in a structured tree. A node contains
+            information about the transformation which will apply to
+            it and all of it's children. Child nodes can have transforms of their own, which
+            are combined with their parent's transformations.
+        @par
+            This is an abstract class - concrete classes are based on this for specific purposes,
+            e.g. SceneNode, Bone
+    */
+    class _OgreExport Node : public Renderable
+    {
+    public:
+        /** Enumeration denoting the spaces which a transform can be relative to.
+        */
+        enum TransformSpace
+        {
+            /// Transform is relative to the local space
+            TS_LOCAL,
+            /// Transform is relative to the space of the parent node
+            TS_PARENT,
+            /// Transform is relative to world space
+            TS_WORLD
+        };
+        typedef HashMap<String, Node*> ChildNodeMap;
+        typedef MapIterator<ChildNodeMap> ChildNodeIterator;
+		typedef ConstMapIterator<ChildNodeMap> ConstChildNodeIterator;
+
+		/** Listener which gets called back on Node events.
+		*/
+		class _OgreExport Listener
+		{
+		public:
+			Listener() {}
+			virtual ~Listener() {}
+			/** Called when a node gets updated.
+			@remarks
+				Note that this happens when the node's derived update happens,
+				not every time a method altering it's state occurs. There may 
+				be several state-changing calls but only one of these calls, 
+				when the node graph is fully updated.
+			*/
+			virtual void nodeUpdated(const Node*) {}
+			/** Node is being destroyed */
+			virtual void nodeDestroyed(const Node*) {};
+			/** Node has been attached to a parent */
+			virtual void nodeAttached(const Node*) {};
+			/** Node has been detached from a parent */
+			virtual void nodeDetached(const Node*) {};
+		};
+
+    protected:
+        /// Pointer to parent node
+        Node* mParent;
+        /// Collection of pointers to direct children; hashmap for efficiency
+        ChildNodeMap mChildren;
+
+		typedef std::set<Node*> ChildUpdateSet;
+        /// List of children which need updating, used if self is not out of date but children are
+        mutable ChildUpdateSet mChildrenToUpdate;
+        /// Flag to indicate own transform from parent is out of date
+        mutable bool mNeedParentUpdate;
+		/// Flag indicating that all children need to be updated
+		mutable bool mNeedChildUpdate;
+		/// Flag indicating that parent has been notified about update request
+	    mutable bool mParentNotified ;
+        /// Flag indicating that the node has been queued for update
+        mutable bool mQueuedForUpdate;
+
+        /// Friendly name of this node, can be automatically generated if you don't care
+        String mName;
+
+        /// Incremented count for next name extension
+        static unsigned long msNextGeneratedNameExt;
+
+        /// Stores the orientation of the node relative to it's parent.
+        Quaternion mOrientation;
+
+        /// Stores the position/translation of the node relative to its parent.
+        Vector3 mPosition;
+
+        /// Stores the scaling factor applied to this node
+        Vector3 mScale;
+
+        /// Stores whether this node inherits orientation from it's parent
+        bool mInheritOrientation;
+
+        /// Stores whether this node inherits scale from it's parent
+        bool mInheritScale;
+
+		/// Material pointer should this node be rendered
+		mutable MaterialPtr mpMaterial;
+
+        /// Only available internally - notification of parent.
+        virtual void setParent(Node* parent);
+
+        /** Cached combined orientation.
+            @par
+                This member is the orientation derived by combining the
+                local transformations and those of it's parents.
+                This is updated when _updateFromParent is called by the
+                SceneManager or the nodes parent.
+        */
+        mutable Quaternion mDerivedOrientation;
+
+        /** Cached combined position.
+            @par
+                This member is the position derived by combining the
+                local transformations and those of it's parents.
+                This is updated when _updateFromParent is called by the
+                SceneManager or the nodes parent.
+        */
+        mutable Vector3 mDerivedPosition;
+
+        /** Cached combined scale.
+            @par
+                This member is the position derived by combining the
+                local transformations and those of it's parents.
+                This is updated when _updateFromParent is called by the
+                SceneManager or the nodes parent.
+        */
+        mutable Vector3 mDerivedScale;
+
+        /** Triggers the node to update it's combined transforms.
+            @par
+                This method is called internally by Ogre to ask the node
+                to update it's complete transformation based on it's parents
+                derived transform.
+        */
+        virtual void _updateFromParent(void) const;
+
+		/** Class-specific implementation of _updateFromParent.
+		@remarks
+			Splitting the implementation of the update away from the update call
+			itself allows the detail to be overridden without disrupting the 
+			general sequence of updateFromParent (e.g. raising events)
+		*/
+		virtual void updateFromParentImpl(void) const;
+
+
+        /** Internal method for creating a new child node - must be overridden per subclass. */
+        virtual Node* createChildImpl(void) = 0;
+
+        /** Internal method for creating a new child node - must be overridden per subclass. */
+        virtual Node* createChildImpl(const String& name) = 0;
+
+        /// The position to use as a base for keyframe animation
+        Vector3 mInitialPosition;
+        /// The orientation to use as a base for keyframe animation
+        Quaternion mInitialOrientation;
+        /// The scale to use as a base for keyframe animation
+        Vector3 mInitialScale;
+
+        /// Cached derived transform as a 4x4 matrix
+        mutable Matrix4 mCachedTransform;
+        mutable bool mCachedTransformOutOfDate;
+
+		/** Node listener - only one allowed (no list) for size & performance reasons. */
+		Listener* mListener;
+
+		typedef std::vector<Node*> QueuedUpdates;
+		static QueuedUpdates msQueuedUpdates;
+
+
+    public:
+        /** Constructor, should only be called by parent, not directly.
+        @remarks
+            Generates a name.
+        */
+        Node();
+        /** Constructor, should only be called by parent, not directly.
+        @remarks
+            Assigned a name.
+        */
+        Node(const String& name);
+
+        virtual ~Node();  
+
+        /** Returns the name of the node. */
+        const String& getName(void) const;
+
+        /** Gets this node's parent (NULL if this is the root).
+        */
+        virtual Node* getParent(void) const;
+
+        /** Returns a quaternion representing the nodes orientation.
+        */
+        virtual const Quaternion & getOrientation() const;
+
+        /** Sets the orientation of this node via a quaternion.
+        @remarks
+            Orientatings, unlike other transforms, are not always inherited by child nodes.
+            Whether or not orientatings affect the orientation of the child nodes depends on
+            the setInheritOrientation option of the child. In some cases you want a orientating
+            of a parent node to apply to a child node (e.g. where the child node is a part of
+            the same object, so you want it to be the same relative orientation based on the
+            parent's orientation), but not in other cases (e.g. where the child node is just
+            for positioning another object, you want it to maintain it's own orientation).
+            The default is to inherit as with other transforms.
+        @par
+            Note that rotations are oriented around the node's origin.
+        */
+        virtual void setOrientation( const Quaternion& q );
+
+        /** Sets the orientation of this node via quaternion parameters.
+        @remarks
+            Orientatings, unlike other transforms, are not always inherited by child nodes.
+            Whether or not orientatings affect the orientation of the child nodes depends on
+            the setInheritOrientation option of the child. In some cases you want a orientating
+            of a parent node to apply to a child node (e.g. where the child node is a part of
+            the same object, so you want it to be the same relative orientation based on the
+            parent's orientation), but not in other cases (e.g. where the child node is just
+            for positioning another object, you want it to maintain it's own orientation).
+            The default is to inherit as with other transforms.
+        @par
+            Note that rotations are oriented around the node's origin.
+        */
+        virtual void setOrientation( Real w, Real x, Real y, Real z);
+
+        /** Resets the nodes orientation (local axes as world axes, no rotation).
+        @remarks
+            Orientatings, unlike other transforms, are not always inherited by child nodes.
+            Whether or not orientatings affect the orientation of the child nodes depends on
+            the setInheritOrientation option of the child. In some cases you want a orientating
+            of a parent node to apply to a child node (e.g. where the child node is a part of
+            the same object, so you want it to be the same relative orientation based on the
+            parent's orientation), but not in other cases (e.g. where the child node is just
+            for positioning another object, you want it to maintain it's own orientation).
+            The default is to inherit as with other transforms.
+        @par
+            Note that rotations are oriented around the node's origin.
+        */
+        virtual void resetOrientation(void);
+
+        /** Sets the position of the node relative to it's parent.
+        */
+        virtual void setPosition(const Vector3& pos);
+
+        /** Sets the position of the node relative to it's parent.
+        */
+        virtual void setPosition(Real x, Real y, Real z);
+
+        /** Gets the position of the node relative to it's parent.
+        */
+        virtual const Vector3 & getPosition(void) const;
+
+        /** Sets the scaling factor applied to this node.
+        @remarks
+            Scaling factors, unlike other transforms, are not always inherited by child nodes.
+            Whether or not scalings affect the size of the child nodes depends on the setInheritScale
+            option of the child. In some cases you want a scaling factor of a parent node to apply to
+            a child node (e.g. where the child node is a part of the same object, so you want it to be
+            the same relative size based on the parent's size), but not in other cases (e.g. where the
+            child node is just for positioning another object, you want it to maintain it's own size).
+            The default is to inherit as with other transforms.
+        @par
+            Note that like rotations, scalings are oriented around the node's origin.
+        */
+        virtual void setScale(const Vector3& scale);
+
+        /** Sets the scaling factor applied to this node.
+        @remarks
+            Scaling factors, unlike other transforms, are not always inherited by child nodes.
+            Whether or not scalings affect the size of the child nodes depends on the setInheritScale
+            option of the child. In some cases you want a scaling factor of a parent node to apply to
+            a child node (e.g. where the child node is a part of the same object, so you want it to be
+            the same relative size based on the parent's size), but not in other cases (e.g. where the
+            child node is just for positioning another object, you want it to maintain it's own size).
+            The default is to inherit as with other transforms.
+        @par
+            Note that like rotations, scalings are oriented around the node's origin.
+        */
+        virtual void setScale(Real x, Real y, Real z);
+
+        /** Gets the scaling factor of this node.
+        */
+        virtual const Vector3 & getScale(void) const;
+
+        /** Tells the node whether it should inherit orientation from it's parent node.
+        @remarks
+            Orientatings, unlike other transforms, are not always inherited by child nodes.
+            Whether or not orientatings affect the orientation of the child nodes depends on
+            the setInheritOrientation option of the child. In some cases you want a orientating
+            of a parent node to apply to a child node (e.g. where the child node is a part of
+            the same object, so you want it to be the same relative orientation based on the
+            parent's orientation), but not in other cases (e.g. where the child node is just
+            for positioning another object, you want it to maintain it's own orientation).
+            The default is to inherit as with other transforms.
+        @param inherit If true, this node's orientation will be affected by its parent's orientation.
+            If false, it will not be affected.
+        */
+        virtual void setInheritOrientation(bool inherit);
+
+        /** Returns true if this node is affected by orientation applied to the parent node. 
+        @remarks
+            Orientatings, unlike other transforms, are not always inherited by child nodes.
+            Whether or not orientatings affect the orientation of the child nodes depends on
+            the setInheritOrientation option of the child. In some cases you want a orientating
+            of a parent node to apply to a child node (e.g. where the child node is a part of
+            the same object, so you want it to be the same relative orientation based on the
+            parent's orientation), but not in other cases (e.g. where the child node is just
+            for positioning another object, you want it to maintain it's own orientation).
+            The default is to inherit as with other transforms.
+        @remarks
+            See setInheritOrientation for more info.
+        */
+        virtual bool getInheritOrientation(void) const;
+
+        /** Tells the node whether it should inherit scaling factors from it's parent node.
+        @remarks
+            Scaling factors, unlike other transforms, are not always inherited by child nodes.
+            Whether or not scalings affect the size of the child nodes depends on the setInheritScale
+            option of the child. In some cases you want a scaling factor of a parent node to apply to
+            a child node (e.g. where the child node is a part of the same object, so you want it to be
+            the same relative size based on the parent's size), but not in other cases (e.g. where the
+            child node is just for positioning another object, you want it to maintain it's own size).
+            The default is to inherit as with other transforms.
+        @param inherit If true, this node's scale will be affected by its parent's scale. If false,
+            it will not be affected.
+        */
+        virtual void setInheritScale(bool inherit);
+
+        /** Returns true if this node is affected by scaling factors applied to the parent node. 
+        @remarks
+            See setInheritScale for more info.
+        */
+        virtual bool getInheritScale(void) const;
+
+        /** Scales the node, combining it's current scale with the passed in scaling factor. 
+        @remarks
+            This method applies an extra scaling factor to the node's existing scale, (unlike setScale
+            which overwrites it) combining it's current scale with the new one. E.g. calling this 
+            method twice with Vector3(2,2,2) would have the same effect as setScale(Vector3(4,4,4)) if
+            the existing scale was 1.
+        @par
+            Note that like rotations, scalings are oriented around the node's origin.
+        */
+        virtual void scale(const Vector3& scale);
+
+        /** Scales the node, combining it's current scale with the passed in scaling factor. 
+        @remarks
+            This method applies an extra scaling factor to the node's existing scale, (unlike setScale
+            which overwrites it) combining it's current scale with the new one. E.g. calling this 
+            method twice with Vector3(2,2,2) would have the same effect as setScale(Vector3(4,4,4)) if
+            the existing scale was 1.
+        @par
+            Note that like rotations, scalings are oriented around the node's origin.
+        */
+        virtual void scale(Real x, Real y, Real z);
+
+        /** Moves the node along the cartesian axes.
+            @par
+                This method moves the node by the supplied vector along the
+                world cartesian axes, i.e. along world x,y,z
+            @param 
+                d Vector with x,y,z values representing the translation.
+            @param
+                relativeTo The space which this transform is relative to.
+        */
+        virtual void translate(const Vector3& d, TransformSpace relativeTo = TS_PARENT);
+        /** Moves the node along the cartesian axes.
+            @par
+                This method moves the node by the supplied vector along the
+                world cartesian axes, i.e. along world x,y,z
+            @param 
+                x
+            @param
+                y
+            @param
+                z Real x, y and z values representing the translation.
+            @param
+            relativeTo The space which this transform is relative to.
+        */
+        virtual void translate(Real x, Real y, Real z, TransformSpace relativeTo = TS_PARENT);
+        /** Moves the node along arbitrary axes.
+            @remarks
+                This method translates the node by a vector which is relative to
+                a custom set of axes.
+            @param 
+                axes A 3x3 Matrix containg 3 column vectors each representing the
+                axes X, Y and Z respectively. In this format the standard cartesian
+                axes would be expressed as:
+                <pre>
+                1 0 0
+                0 1 0
+                0 0 1
+                </pre>
+                i.e. the identity matrix.
+            @param 
+                move Vector relative to the axes above.
+            @param
+            relativeTo The space which this transform is relative to.
+        */
+        virtual void translate(const Matrix3& axes, const Vector3& move, TransformSpace relativeTo = TS_PARENT);
+        /** Moves the node along arbitrary axes.
+            @remarks
+            This method translates the node by a vector which is relative to
+            a custom set of axes.
+            @param 
+                axes A 3x3 Matrix containg 3 column vectors each representing the
+                axes X, Y and Z respectively. In this format the standard cartesian
+                axes would be expressed as
+                <pre>
+                1 0 0
+                0 1 0
+                0 0 1
+                </pre>
+                i.e. the identity matrix.
+            @param 
+                x,y,z Translation components relative to the axes above.
+            @param
+                relativeTo The space which this transform is relative to.
+        */
+        virtual void translate(const Matrix3& axes, Real x, Real y, Real z, TransformSpace relativeTo = TS_PARENT);
+
+        /** Rotate the node around the Z-axis.
+        */
+        virtual void roll(const Radian& angle, TransformSpace relativeTo = TS_LOCAL);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void roll(Real degrees, TransformSpace relativeTo = TS_LOCAL) {
+			roll ( Angle(degrees), relativeTo );
+		}
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Rotate the node around the X-axis.
+        */
+        virtual void pitch(const Radian& angle, TransformSpace relativeTo = TS_LOCAL);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void pitch(Real degrees, TransformSpace relativeTo = TS_LOCAL) {
+			pitch ( Angle(degrees), relativeTo );
+		}
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Rotate the node around the Y-axis.
+        */
+        virtual void yaw(const Radian& angle, TransformSpace relativeTo = TS_LOCAL);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void yaw(Real degrees, TransformSpace relativeTo = TS_LOCAL) {
+			yaw ( Angle(degrees), relativeTo );
+		}
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Rotate the node around an arbitrary axis.
+        */
+        virtual void rotate(const Vector3& axis, const Radian& angle, TransformSpace relativeTo = TS_LOCAL);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void rotate(const Vector3& axis, Real degrees, TransformSpace relativeTo = TS_LOCAL) {
+			rotate ( axis, Angle(degrees), relativeTo );
+		}
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Rotate the node around an aritrary axis using a Quarternion.
+        */
+        virtual void rotate(const Quaternion& q, TransformSpace relativeTo = TS_LOCAL);
+
+        /** Gets a matrix whose columns are the local axes based on
+            the nodes orientation relative to it's parent. */
+        virtual Matrix3 getLocalAxes(void) const;
+
+        /** Creates an unnamed new Node as a child of this node.
+        @param
+            translate Initial translation offset of child relative to parent
+        @param
+            rotate Initial rotation relative to parent
+        */
+        virtual Node* createChild(
+            const Vector3& translate = Vector3::ZERO, 
+            const Quaternion& rotate = Quaternion::IDENTITY );
+
+        /** Creates a new named Node as a child of this node.
+        @remarks
+            This creates a child node with a given name, which allows you to look the node up from 
+            the parent which holds this collection of nodes.
+            @param
+                translate Initial translation offset of child relative to parent
+            @param
+                rotate Initial rotation relative to parent
+        */
+        virtual Node* createChild(const String& name, const Vector3& translate = Vector3::ZERO, const Quaternion& rotate = Quaternion::IDENTITY);
+
+        /** Adds a (precreated) child scene node to this node. If it is attached to another node,
+            it must be detached first.
+        @param child The Node which is to become a child node of this one
+        */
+        virtual void addChild(Node* child);
+
+        /** Reports the number of child nodes under this one.
+        */
+        virtual unsigned short numChildren(void) const;
+
+        /** Gets a pointer to a child node.
+        @remarks
+            There is an alternate getChild method which returns a named child.
+        */
+        virtual Node* getChild(unsigned short index) const;    
+
+        /** Gets a pointer to a named child node.
+        */
+        virtual Node* getChild(const String& name) const;
+
+        /** Retrieves an iterator for efficiently looping through all children of this node.
+        @remarks
+            Using this is faster than repeatedly calling getChild if you want to go through
+            all (or most of) the children of this node.
+            Note that the returned iterator is only valid whilst no children are added or
+            removed from this node. Thus you should not store this returned iterator for
+            later use, nor should you add / remove children whilst iterating through it;
+            store up changes for later. Note that calling methods on returned items in 
+            the iterator IS allowed and does not invalidate the iterator.
+        */
+        virtual ChildNodeIterator getChildIterator(void);
+
+        /** Retrieves an iterator for efficiently looping through all children of this node.
+        @remarks
+            Using this is faster than repeatedly calling getChild if you want to go through
+            all (or most of) the children of this node.
+            Note that the returned iterator is only valid whilst no children are added or
+            removed from this node. Thus you should not store this returned iterator for
+            later use, nor should you add / remove children whilst iterating through it;
+            store up changes for later. Note that calling methods on returned items in 
+            the iterator IS allowed and does not invalidate the iterator.
+        */
+		virtual ConstChildNodeIterator getChildIterator(void) const;
+
+        /** Drops the specified child from this node. 
+        @remarks
+            Does not delete the node, just detaches it from
+            this parent, potentially to be reattached elsewhere. 
+            There is also an alternate version which drops a named
+            child from this node.
+        */
+        virtual Node* removeChild(unsigned short index);
+        /** Drops the specified child from this node. 
+        @remarks
+        Does not delete the node, just detaches it from
+        this parent, potentially to be reattached elsewhere. 
+        There is also an alternate version which drops a named
+        child from this node.
+        */
+        virtual Node* removeChild(Node* child);
+
+        /** Drops the named child from this node. 
+        @remarks
+            Does not delete the node, just detaches it from
+            this parent, potentially to be reattached elsewhere.
+        */
+        virtual Node* removeChild(const String& name);
+        /** Removes all child Nodes attached to this node. Does not delete the nodes, just detaches them from
+            this parent, potentially to be reattached elsewhere.
+        */
+        virtual void removeAllChildren(void);
+
+        /** Gets the orientation of the node as derived from all parents.
+        */
+        virtual const Quaternion & _getDerivedOrientation(void) const;
+
+        /** Gets the position of the node as derived from all parents.
+        */
+        virtual const Vector3 & _getDerivedPosition(void) const;
+
+        /** Gets the scaling factor of the node as derived from all parents.
+        */
+        virtual const Vector3 & _getDerivedScale(void) const;
+
+        /** Gets the full transformation matrix for this node.
+            @remarks
+                This method returns the full transformation matrix
+                for this node, including the effect of any parent node
+                transformations, provided they have been updated using the Node::_update method.
+                This should only be called by a SceneManager which knows the
+                derived transforms have been updated before calling this method.
+                Applications using Ogre should just use the relative transforms.
+        */
+        virtual const Matrix4& _getFullTransform(void) const;
+
+        /** Internal method to update the Node.
+            @note
+                Updates this node and any relevant children to incorporate transforms etc.
+                Don't call this yourself unless you are writing a SceneManager implementation.
+            @param
+                updateChildren If true, the update cascades down to all children. Specify false if you wish to
+                update children separately, e.g. because of a more selective SceneManager implementation.
+            @param
+                parentHasChanged This flag indicates that the parent xform has changed,
+                    so the child should retrieve the parent's xform and combine it with its own
+                    even if it hasn't changed itself.
+        */
+        virtual void _update(bool updateChildren, bool parentHasChanged);
+
+        /** Sets a listener for this Node.
+		@remarks
+			Note for size and performance reasons only one listener per node is
+			allowed.
+		*/
+		virtual void setListener(Listener* listener) { mListener = listener; }
+		
+		/** Gets the current listener for this Node.
+		*/
+		virtual Listener* getListener(void) const { return mListener; }
+		
+		/** Overridden from Renderable.
+        @remarks
+            This is only used if the SceneManager chooses to render the node. This option can be set
+            for SceneNodes at SceneManager::setDisplaySceneNodes, and for entities based on skeletal 
+            models using Entity::setDisplayBones()
+        */
+        const MaterialPtr& getMaterial(void) const;
+        /** Overridden from Renderable.
+        @remarks
+            This is only used if the SceneManager chooses to render the node. This option can be set
+            for SceneNodes at SceneManager::setDisplaySceneNodes, and for entities based on skeletal 
+            models using Entity::setDisplaySkeleton()
+        */
+        void getRenderOperation(RenderOperation& op);
+        /** Overridden from Renderable.
+        @remarks
+            This is only used if the SceneManager chooses to render the node. This option can be set
+            for SceneNodes at SceneManager::setDisplaySceneNodes, and for entities based on skeletal 
+            models using Entity::setDisplaySkeleton()
+        */
+        void getWorldTransforms(Matrix4* xform) const;
+        /** @copydoc Renderable::getWorldOrientation */
+        const Quaternion& getWorldOrientation(void) const;
+        /** @copydoc Renderable::getWorldPosition */
+        const Vector3& getWorldPosition(void) const;
+
+        /** Sets the current transform of this node to be the 'initial state' ie that
+            position / orientation / scale to be used as a basis for delta values used
+            in keyframe animation.
+        @remarks
+            You never need to call this method unless you plan to animate this node. If you do
+            plan to animate it, call this method once you've loaded the node with it's base state,
+            ie the state on which all keyframes are based.
+        @par
+            If you never call this method, the initial state is the identity transform, ie do nothing.
+        */
+        virtual void setInitialState(void);
+
+        /** Resets the position / orientation / scale of this node to it's initial state, see setInitialState for more info. */
+        virtual void resetToInitialState(void);
+
+        /** Gets the initial position of this node, see setInitialState for more info. 
+        @remarks
+            Also resets the cumulative animation weight used for blending.
+        */
+        virtual const Vector3& getInitialPosition(void) const;
+
+        /** Gets the initial orientation of this node, see setInitialState for more info. */
+        virtual const Quaternion& getInitialOrientation(void) const;
+
+        /** Gets the initial position of this node, see setInitialState for more info. */
+        virtual const Vector3& getInitialScale(void) const;
+
+        /** Overridden, see Renderable */
+        Real getSquaredViewDepth(const Camera* cam) const;
+
+        /** To be called in the event of transform changes to this node that require it's recalculation.
+        @remarks
+            This not only tags the node state as being 'dirty', it also requests it's parent to 
+            know about it's dirtiness so it will get an update next time.
+		@param forceParentUpdate Even if the node thinks it has already told it's
+			parent, tell it anyway
+        */
+        virtual void needUpdate(bool forceParentUpdate = false);
+        /** Called by children to notify their parent that they need an update. 
+		@param forceParentUpdate Even if the node thinks it has already told it's
+			parent, tell it anyway
+		*/
+        virtual void requestUpdate(Node* child, bool forceParentUpdate = false);
+        /** Called by children to notify their parent that they no longer need an update. */
+        virtual void cancelUpdate(Node* child);
+
+		/** Queue a 'needUpdate' call to a node safely.
+		@ramarks
+			You can't call needUpdate() during the scene graph update, e.g. in
+			response to a Node::Listener hook, because the graph is already being 
+			updated, and update flag changes cannot be made reliably in that context. 
+			Call this method if you need to queue a needUpdate call in this case.
+		*/
+		static void queueNeedUpdate(Node* n);
+		/** Process queued 'needUpdate' calls. */
+		static void processQueuedUpdates(void);
+
+        /** @copydoc Renderable::getLights */
+        const LightList& getLights(void) const;
+
+
+
+    };
+
+} //namespace
+
+#endif
Index: /OgreMain/include/OgreNumerics.h
===================================================================
--- /OgreMain/include/OgreNumerics.h	(revision 5)
+++ /OgreMain/include/OgreNumerics.h	(revision 5)
@@ -0,0 +1,55 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2006  Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __NumericSolvers_H__
+#define __NumericSolvers_H__
+
+#include "OgrePrerequisites.h"
+
+
+namespace Ogre {
+
+	/** Real type for numeric solvers */
+	typedef double PreciseReal;
+
+
+    /** Provides numeric solvers for Ogre
+        @remarks
+            Handles linear algebra numerics.
+    */
+	class _OgreExport NumericSolver
+	{
+	public:
+		/** Solves a full rank NxN linear system of equations 
+		    @remarks
+			   This implements a naive gaussian elimination algorithm.
+			   The algorithm is destructive, so there are side effects in coeff and col.
+	    */
+		static bool solveNxNLinearSysDestr(int n, PreciseReal **coeff, PreciseReal *col);
+	};
+
+}
+
+#endif
Index: /OgreMain/include/OgreOptimisedUtil.h
===================================================================
--- /OgreMain/include/OgreOptimisedUtil.h	(revision 5)
+++ /OgreMain/include/OgreOptimisedUtil.h	(revision 5)
@@ -0,0 +1,221 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OptimisedUtil_H__
+#define __OptimisedUtil_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreEdgeListBuilder.h"
+
+namespace Ogre {
+
+    /** Utility class for provides optimised functions.
+    @note
+        This class are supposed used by internal engine only.
+    */
+    class _OgreExport OptimisedUtil
+    {
+    private:
+        /// Privated copy constructor, to prevent misuse
+        OptimisedUtil(const OptimisedUtil& rhs); /* do nothing, should not use */
+        /// Privated operator=, to prevent misuse
+        OptimisedUtil& operator=(const OptimisedUtil& rhs); /* do not use */
+
+    protected:
+        /// Store a pointer to the implementation
+        static OptimisedUtil* msImplementation;
+
+        /// Detect best implementation based on run-time environment
+        static OptimisedUtil* _detectImplementation(void);
+
+    public:
+        // Default constructor
+        OptimisedUtil(void) {}
+        // Destructor
+        virtual ~OptimisedUtil() {}
+
+        /** Gets the implementation of this class.
+        @note
+            Don't cache the pointer returned by this function, it'll change due
+            run-time environment detection to pick up the best implementation.
+        */
+        static OptimisedUtil* getImplementation(void) { return msImplementation; }
+
+        /** Performs software vertex skinning.
+        @param srcPosPtr Pointer to source position buffer.
+        @param destPosPtr Pointer to destination position buffer.
+        @param srcNormPtr Pointer to source normal buffer, if NULL,
+            means blend position only.
+        @param destNormPtr Pointer to destination normal buffer, it's
+            ignored if srcNormPtr is NULL.
+        @param blendWeightPtr Pointer to blend weight buffer.
+        @param blendIndexPtr Pointer to blend index buffer.
+        @param blendMatrices An array of pointer of blend matrix, the matrix
+            must be aligned to SIMD alignment, but not necessary for the array
+            itself.
+        @param srcPosStride The stride of source position in bytes.
+        @param destPosStride The stride of destination position in bytes.
+        @param srcNormStride The stride of source normal in bytes,
+            it's ignored if srcNormPtr is NULL.
+        @param destNormStride The stride of destination normal in bytes,
+            it's ignored if srcNormPtr is NULL.
+        @param blendWeightStride The stride of blend weight buffer in bytes.
+        @param blendIndexStride The stride of blend index buffer in bytes.
+        @param numWeightsPerVertex Number of blend weights per-vertex, as well
+            as for blend indices.
+        @param numVertices Number of vertices to blend.
+        */
+        virtual void softwareVertexSkinning(
+            const float *srcPosPtr, float *destPosPtr,
+            const float *srcNormPtr, float *destNormPtr,
+            const float *blendWeightPtr, const unsigned char* blendIndexPtr,
+            const Matrix4* const* blendMatrices,
+            size_t srcPosStride, size_t destPosStride,
+            size_t srcNormStride, size_t destNormStride,
+            size_t blendWeightStride, size_t blendIndexStride,
+            size_t numWeightsPerVertex,
+            size_t numVertices) = 0;
+
+        /** Performs a software vertex morph, of the kind used for
+            morph animation although it can be used for other purposes. 
+        @remarks
+            This function will linearly interpolate positions between two
+            source buffers, into a third buffer.
+        @param t Parametric distance between the start and end positions
+        @param srcPos1 Pointer to buffer for the start positions
+        @param srcPos2 Pointer to buffer for the end positions
+        @param dstPos Pointer to buffer for the destination positions
+        @param numVertices Number of vertices to morph, which agree with
+            the number in start, end and destination buffer. Bear in mind
+            three floating-point values per vertex
+        */
+        virtual void softwareVertexMorph(
+            Real t,
+            const float *srcPos1, const float *srcPos2,
+            float *dstPos,
+            size_t numVertices) = 0;
+
+        /** Concatenate an affine matrix to an array of affine matrices.
+        @note
+            An affine matrix is a 4x4 matrix with row 3 equal to (0, 0, 0, 1),
+            e.g. no projective coefficients.
+        @param baseMatrix The matrix used as first operand.
+        @param srcMatrices An array of matrix used as second operand.
+        @param dstMatrices An array of matrix to store matrix concatenate results.
+        @param numMatrices Number of matrices in the array.
+        */
+        virtual void concatenateAffineMatrices(
+            const Matrix4& baseMatrix,
+            const Matrix4* srcMatrices,
+            Matrix4* dstMatrices,
+            size_t numMatrices) = 0;
+
+        /** Calculate the face normals for the triangles based on position
+            information.
+        @param positions Pointer to position information, which packed in
+            (x, y, z) format, indexing by vertex index in the triangle. No
+            alignment requests.
+        @param triangles The triangles need to calculate face normal, the vertex
+            positions is indexed by vertex index to position information.
+        @param faceNormals The array of Vector4 used to store triangles face normal,
+            Must be aligned to SIMD alignment.
+        @param numTriangles Number of triangles to calculate face normal.
+        */
+        virtual void calculateFaceNormals(
+            const float *positions,
+            const EdgeData::Triangle *triangles,
+            Vector4 *faceNormals,
+            size_t numTriangles) = 0;
+
+        /** Calculate the light facing state of the triangle's face normals
+        @remarks
+            This is normally the first stage of calculating a silhouette, ie
+            establishing which tris are facing the light and which are facing
+            away.
+        @param lightPos 4D position of the light in object space, note that
+            for directional lights (which have no position), the w component
+            is 0 and the x/y/z position are the direction.
+        @param faceNormals An array of face normals for the triangles, the face
+            normal are unit vector othogonal to the triangles, plus distance
+            from origin. This array must be aligned to SIMD alignment.
+        @param lightFacings An array of flags for store light facing state
+            results, the result flag is true if corresponding face normal facing
+            the light, false otherwise. This array no alignment requires.
+        @param numFaces Number of face normals to calculate.
+        */
+        virtual void calculateLightFacing(
+            const Vector4& lightPos,
+            const Vector4* faceNormals,
+            char* lightFacings,
+            size_t numFaces) = 0;
+
+        /** Extruding vertices by a fixed distance based on light position.
+        @param lightPos 4D light position, when w=0.0f this represents a
+            directional light, otherwise, w must be equal to 1.0f, which
+            represents a point light.
+        @param extrudeDist The distance to extrude.
+        @param srcPositions Pointer to source vertex's position buffer, which
+            the position is a 3D vector packed in xyz format. No SIMD alignment
+            requirement but loss performance for unaligned data.
+        @param destPositions Pointer to destination vertex's position buffer,
+            which the position is a 3D vector packed in xyz format. No SIMD
+            alignment requirement but loss performance for unaligned data.
+        @param numVertices Number of vertices need to extruding, which agree
+            with source and destination buffers.
+        */
+        virtual void extrudeVertices(
+            const Vector4& lightPos,
+            Real extrudeDist,
+            const float* srcPositions,
+            float* destPositions,
+            size_t numVertices) = 0;
+    };
+
+    /** Returns raw offseted of the given pointer.
+    @note
+        The offset are in bytes, no matter what type of the pointer.
+    */
+    template <class T>
+    static FORCEINLINE T* rawOffsetPointer(T* ptr, ptrdiff_t offset)
+    {
+        return (T*)((char*)(ptr) + offset);
+    }
+
+    /** Advance the pointer with raw offset.
+    @note
+        The offset are in bytes, no matter what type of the pointer.
+    */
+    template <class T>
+    static FORCEINLINE void advanceRawPointer(T*& ptr, ptrdiff_t offset)
+    {
+        ptr = rawOffsetPointer(ptr, offset);
+    }
+
+}
+
+#endif  // __OptimisedUtil_H__
Index: /OgreMain/include/OgreOverlay.h
===================================================================
--- /OgreMain/include/OgreOverlay.h	(revision 5)
+++ /OgreMain/include/OgreOverlay.h	(revision 5)
@@ -0,0 +1,285 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __Overlay_H__
+#define __Overlay_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreSceneNode.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreMatrix4.h"
+
+namespace Ogre {
+
+
+    /** Represents a layer which is rendered on top of the 'normal' scene contents.
+    @remarks
+        An overlay is a container for visual components (2D and 3D) which will be 
+        rendered after the main scene in order to composite heads-up-displays, menus
+        or other layers on top of the contents of the scene.
+    @par
+        An overlay always takes up the entire size of the viewport, although the 
+        components attached to it do not have to. An overlay has no visual element
+        in itself, it it merely a container for visual elements.
+    @par
+        Overlays are created by calling OverlayManager::create, or by defining them
+        in special text scripts (.overlay files). As many overlays
+        as you like can be defined; after creation an overlay is hidden i.e. not
+        visible until you specifically enable it by calling 'show'. This allows you to have multiple
+        overlays predefined (menus etc) which you make visible only when you want.
+        It is possible to have multiple overlays enabled at once; in this case the
+        relative 'zorder' parameter of the overlays determine which one is displayed
+        on top.
+    @par
+        By default overlays are rendered into all viewports. This is fine when you only
+        have fullscreen viewports, but if you have picture-in-picture views, you probably
+        don't want the overlay displayed in the smaller viewports. You turn this off for 
+        a specific viewport by calling the Viewport::setDisplayOverlays method.
+    */
+    class _OgreExport Overlay 
+    {
+
+    public:
+              typedef std::list<OverlayContainer*> OverlayContainerList;
+    protected:
+        String mName;
+        /// Internal root node, used as parent for 3D objects
+        SceneNode* mRootNode;
+        // 2D elements
+        // OverlayContainers, linked list for easy sorting by zorder later
+        // Not a map because sort can be saved since changes infrequent (unlike render queue)
+        OverlayContainerList m2DElements;
+
+        // Degrees of rotation around center
+        Radian mRotate;
+        // Scroll values, offsets
+        Real mScrollX, mScrollY;
+        // Scale values
+        Real mScaleX, mScaleY;
+
+        mutable Matrix4 mTransform;
+        mutable bool mTransformOutOfDate;
+        bool mTransformUpdated;
+        ulong mZOrder;
+        bool mVisible;
+		bool mInitialised;
+		String mOrigin;
+        /** Internal lazy update method. */
+        void updateTransform(void) const;
+		/** Internal method for initialising an overlay */
+		void initialise(void);
+
+    public:
+        /// Constructor: do not call direct, use OverlayManager::create
+        Overlay(const String& name);
+        virtual ~Overlay();
+
+
+	    OverlayContainer* getChild(const String& name);
+
+        /** Gets the name of this overlay. */
+        const String& getName(void) const;
+        /** Alters the ZOrder of this overlay. 
+        @remarks
+            Values between 0 and 650 are valid here.
+        */
+        void setZOrder(ushort zorder);
+        /** Gets the ZOrder of this overlay. */
+        ushort getZOrder(void) const;
+
+        /** Gets whether the overlay is displayed or not. */
+        bool isVisible(void) const;
+
+		/** Gets whether the overlay is initialised or not. */
+		bool isInitialised(void) const { return mInitialised; }
+
+		/** Shows the overlay if it was hidden. */
+        void show(void);
+
+        /** Hides the overlay if it was visible. */
+        void hide(void);
+
+        /** Adds a 2D 'container' to the overlay.
+        @remarks
+            Containers are created and managed using the OverlayManager. A container
+            could be as simple as a square panel, or something more complex like
+            a grid or tree view. Containers group collections of other elements,
+            giving them a relative coordinate space and a common z-order.
+            If you want to attach a gui widget to an overlay, you have to do it via
+            a container.
+        @param cont Pointer to a container to add, created using OverlayManager.
+        */
+        void add2D(OverlayContainer* cont);
+
+
+        /** Removes a 2D container from the overlay. 
+        @remarks
+            NOT FAST. Consider OverlayElement::hide.
+        */
+        void remove2D(OverlayContainer* cont);
+
+        /** Adds a node capable of holding 3D objects to the overlay.
+        @remarks    
+            Although overlays are traditionally associated with 2D elements, there 
+            are reasons why you might want to attach 3D elements to the overlay too.
+            For example, if you wanted to have a 3D cockpit, which was overlaid with a
+            HUD, then you would create 2 overlays, one with a 3D object attached for the
+            cockpit, and one with the HUD elements attached (the zorder of the HUD 
+            overlay would be higher than the cockpit to ensure it was always on top).
+        @par    
+            A SceneNode can have any number of 3D objects attached to it. SceneNodes
+            are usually created using SceneManager::createSceneNode, but in this case
+			you should create a standard SceneNode instance <b>manually</b>; this is
+			because these scene nodes are not managed by the SceneManager and some custom
+			SceneManager plugins will rely on specialist behaviour the overlay does not
+			support. By attaching a SceneNode to an overlay, you indicate that:<OL>
+            <LI>You want the contents of this node to only appear when the overlay is active</LI>
+            <LI>You want the node to inherit a coordinate space relative to the camera,
+                rather than relative to the root scene node</LI>
+            <LI>You want these objects to be rendered after the contents of the main scene
+                to ensure they are rendered on top</LI>
+            </OL>
+            One major consideration when using 3D objects in overlays is the behaviour of 
+            the depth buffer. Overlays should use materials with depth checking off, to ensure
+            that their contents are always displayed on top of the main scene (to do 
+            otherwise would result in objects 'poking through' the overlay). The problem
+            with using 3D objects is that if they are concave, or self-overlap, then you
+            can get artefacts because of the lack of depth buffer checking. So you should 
+            ensure that any 3D objects you us in the overlay are convex, and don't overlap
+            each other. If they must overlap, split them up and put them in 2 overlays.
+			Alternatively, use a 2D element underneath them which will clear the depth buffer
+			values underneath ready for the 3D element to be rendered correctly.
+        */
+        void add3D(SceneNode* node);
+
+        /** Removes a 3D element from the overlay. */
+        void remove3D(SceneNode* node);
+
+        /** Clears the overlay of all attached items. */
+        void clear();
+
+        /** Sets the scrolling factor of this overlay.
+        @remarks
+            You can use this to set an offset to be used to scroll an 
+            overlay around the screen.
+        @param x Horizontal scroll value, where 0 = normal, -0.5 = scroll so that only
+            the right half the screen is visible etc
+        @param y Vertical scroll value, where 0 = normal, 0.5 = scroll down by half 
+            a screen etc.
+        */
+        void setScroll(Real x, Real y);
+
+        /** Gets the current X scroll value */
+        Real getScrollX(void) const;
+
+        /** Gets the current Y scroll value */
+        Real getScrollY(void) const;
+
+        /** Scrolls the overlay by the offsets provided.
+        @remarks
+            This method moves the overlay by the amounts provided. As with
+            other methods on this object, a full screen width / height is represented
+            by the value 1.0.
+        */
+        void scroll(Real xoff, Real yoff);
+
+        /** Sets the rotation applied to this overlay.*/
+        void setRotate(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void setRotate(Real degrees) {
+			setRotate ( Angle(degrees) );
+		}
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Gets the rotation applied to this overlay, in degrees.*/
+        const Radian &getRotate(void) const { return mRotate; }
+
+        /** Adds the passed in angle to the rotation applied to this overlay. */
+        void rotate(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+		inline void rotate(Real degrees) {
+			rotate ( Angle(degrees) );
+		}
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Sets the scaling factor of this overlay.
+        @remarks
+            You can use this to set an scale factor to be used to zoom an 
+            overlay.
+        @param x Horizontal scale value, where 1.0 = normal, 0.5 = half size etc
+        @param y Vertical scale value, where 1.0 = normal, 0.5 = half size etc
+        */
+        void setScale(Real x, Real y);
+
+        /** Gets the current X scale value */
+        Real getScaleX(void) const;
+
+        /** Gets the current Y scale value */
+        Real getScaleY(void) const;
+
+        /** Used to transform the overlay when scrolling, scaling etc. */
+        void _getWorldTransforms(Matrix4* xform) const;
+        /** @copydoc Renderable::getWorldOrientation */
+        const Quaternion& getWorldOrientation(void) const;
+        /** @copydoc Renderable::getWorldPosition */
+        const Vector3& getWorldPosition(void) const;
+
+        /** Internal method to put the overlay contents onto the render queue. */
+        void _findVisibleObjects(Camera* cam, RenderQueue* queue);
+
+        /** This returns a OverlayElement at position x,y. */
+		virtual OverlayElement* findElementAt(Real x, Real y);
+
+        /** Returns an iterator over all 2D elements in this manager.
+        @remarks
+            VectorIterator is actually a too generic name, since it also works for lists.
+        */
+        typedef VectorIterator<OverlayContainerList> Overlay2DElementsIterator ;
+        Overlay2DElementsIterator get2DElementsIterator ()
+        {
+            return Overlay2DElementsIterator (m2DElements.begin(), m2DElements.end());
+        }
+		/** Get the origin of this overlay, e.g. a script file name.
+		@remarks
+			This property will only contain something if the creator of
+			this overlay chose to populate it. Script loaders are advised
+			to populate it.
+		*/
+		const String& getOrigin(void) const { return mOrigin; }
+		/// Notify this overlay of it's origin
+		void _notifyOrigin(const String& origin) { mOrigin = origin; }
+
+
+    };
+
+}
+
+
+#endif
+
Index: /OgreMain/include/OgreOverlayContainer.h
===================================================================
--- /OgreMain/include/OgreOverlayContainer.h	(revision 5)
+++ /OgreMain/include/OgreOverlayContainer.h	(revision 5)
@@ -0,0 +1,145 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __OverlayContainer_H__
+#define __OverlayContainer_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreOverlayElement.h"
+#include "OgreIteratorWrappers.h"
+
+
+namespace Ogre {
+
+
+    /** A 2D element which contains other OverlayElement instances.
+    @remarks
+        This is a specialisation of OverlayElement for 2D elements that contain other
+        elements. These are also the smallest elements that can be attached directly
+        to an Overlay.
+    @remarks
+        OverlayContainers should be managed using OverlayManager. This class is responsible for
+        instantiating / deleting elements, and also for accepting new types of element
+        from plugins etc.
+    */
+    class _OgreExport OverlayContainer : public OverlayElement
+    {
+    public:
+        typedef std::map<String, OverlayElement*> ChildMap;
+        typedef MapIterator<ChildMap> ChildIterator;
+        typedef std::map<String, OverlayContainer*> ChildContainerMap;
+        typedef MapIterator<ChildContainerMap> ChildContainerIterator;
+    protected:
+        // Map of all children
+        ChildMap mChildren;
+        // Map of container children (subset of mChildren)
+        ChildContainerMap mChildContainers;
+
+		bool mChildrenProcessEvents;
+ 
+    public:
+        /// Constructor: do not call direct, use OverlayManager::createOverlayElement
+        OverlayContainer(const String& name);
+        virtual ~OverlayContainer();
+
+        /** Adds another OverlayElement to this container. */
+        virtual void addChild(OverlayElement* elem);
+        /** Adds another OverlayElement to this container. */
+        virtual void addChildImpl(OverlayElement* elem);
+        /** Add a nested container to this container. */
+        virtual void addChildImpl(OverlayContainer* cont);
+        /** Removes a named element from this container. */
+        virtual void removeChild(const String& name);
+        /** Gets the named child of this container. */
+        virtual OverlayElement* getChild(const String& name);
+
+		/** @copydoc OverlayElement::initialise */
+		void initialise(void);
+
+        void _addChild(OverlayElement* elem);
+        void _removeChild(OverlayElement* elem) { _removeChild(elem->getName()); }
+        void _removeChild(const String& name);
+
+        /** Gets an object for iterating over all the children of this object. */
+        virtual ChildIterator getChildIterator(void);
+
+        /** Gets an iterator for just the container children of this object.
+        @remarks
+            Good for cascading updates without having to use RTTI
+        */
+        virtual ChildContainerIterator getChildContainerIterator(void);
+
+		/** Tell the object and its children to recalculate */
+		virtual void _positionsOutOfDate(void);
+
+        /** Overridden from OverlayElement. */
+        virtual void _update(void);
+
+        /** Overridden from OverlayElement. */
+        virtual void _notifyZOrder(ushort newZOrder);
+
+        /** Overridden from OverlayElement. */
+        virtual void _notifyViewport();
+
+        /** Overridden from OverlayElement. */
+        virtual void _notifyWorldTransforms(const Matrix4& xform);
+
+        /** Overridden from OverlayElement. */
+	    virtual void _notifyParent(OverlayContainer* parent, Overlay* overlay);
+
+        /** Overridden from OverlayElement. */
+        virtual void _updateRenderQueue(RenderQueue* queue);
+
+        /** Overridden from OverlayElement. */
+		inline bool isContainer() const
+		{ return true; }
+
+		/** Should this container pass events to their children */
+		virtual inline bool isChildrenProcessEvents() const
+		{ return true; }
+
+		/** Should this container pass events to their children */
+		virtual inline void setChildrenProcessEvents(bool val)
+		{ mChildrenProcessEvents = val; }
+
+        /** This returns a OverlayElement at position x,y. */
+		virtual OverlayElement* findElementAt(Real x, Real y);		// relative to parent
+
+	    void copyFromTemplate(OverlayElement* templateOverlay);
+        virtual OverlayElement* clone(const String& instanceName);
+
+    };
+
+
+
+}
+
+
+#endif
+
Index: /OgreMain/include/OgreOverlayElement.h
===================================================================
--- /OgreMain/include/OgreOverlayElement.h	(revision 5)
+++ /OgreMain/include/OgreOverlayElement.h	(revision 5)
@@ -0,0 +1,490 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __OverlayElement_H__
+#define __OverlayElement_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include "OgreRenderable.h"
+#include "OgreUTFString.h"
+#include "OgreStringInterface.h"
+#include "OgreOverlayElementCommands.h"
+
+#include "OgreColourValue.h"
+#include "OgreRectangle.h"
+
+namespace Ogre {
+
+#if OGRE_UNICODE_SUPPORT
+	typedef UTFString DisplayString;
+#	define OGRE_DEREF_DISPLAYSTRING_ITERATOR(it) it.getCharacter()
+#else
+	typedef String DisplayString;
+#	define OGRE_DEREF_DISPLAYSTRING_ITERATOR(it) *it
+#endif
+    /** Enum describing how the position / size of an element is to be recorded. 
+    */
+    enum GuiMetricsMode
+    {
+        /// 'left', 'top', 'height' and 'width' are parametrics from 0.0 to 1.0
+        GMM_RELATIVE,
+        /// Positions & sizes are in absolute pixels
+        GMM_PIXELS,
+        /// Positions & sizes are in virtual pixels
+        GMM_RELATIVE_ASPECT_ADJUSTED
+    };
+
+    /** Enum describing where '0' is in relation to the parent in the horizontal dimension.
+    @remarks Affects how 'left' is interpreted.
+    */
+    enum GuiHorizontalAlignment
+    {
+        GHA_LEFT,
+        GHA_CENTER,
+        GHA_RIGHT
+    };
+    /** Enum describing where '0' is in relation to the parent in the vertical dimension.
+    @remarks Affects how 'top' is interpreted.
+    */
+    enum GuiVerticalAlignment
+    {
+        GVA_TOP,
+        GVA_CENTER,
+        GVA_BOTTOM
+    };
+
+    /** Abstract definition of a 2D element to be displayed in an Overlay.
+    @remarks
+    This class abstracts all the details of a 2D element which will appear in
+    an overlay. In fact, not all OverlayElement instances can be directly added to an
+    Overlay, only those which are OverlayContainer instances (a subclass of this class).
+    OverlayContainer objects can contain any OverlayElement however. This is just to 
+    enforce some level of grouping on widgets.
+    @par
+    OverlayElements should be managed using OverlayManager. This class is responsible for
+    instantiating / deleting elements, and also for accepting new types of element
+    from plugins etc.
+    @par
+    Note that positions / dimensions of 2D screen elements are expressed as parametric
+    values (0.0 - 1.0) because this makes them resolution-independent. However, most
+    screen resolutions have an aspect ratio of 1.3333:1 (width : height) so note that
+    in physical pixels 0.5 is wider than it is tall, so a 0.5x0.5 panel will not be
+    square on the screen (but it will take up exactly half the screen in both dimensions).
+    @par
+    Because this class is designed to be extensible, it subclasses from StringInterface
+    so its parameters can be set in a generic way.
+    */
+    class _OgreExport OverlayElement : public StringInterface, public Renderable
+    {
+    public:
+
+    protected:
+        // Command object for setting / getting parameters
+        static OverlayElementCommands::CmdLeft msLeftCmd;
+        static OverlayElementCommands::CmdTop msTopCmd;
+        static OverlayElementCommands::CmdWidth msWidthCmd;
+        static OverlayElementCommands::CmdHeight msHeightCmd;
+        static OverlayElementCommands::CmdMaterial msMaterialCmd;
+        static OverlayElementCommands::CmdCaption msCaptionCmd;
+        static OverlayElementCommands::CmdMetricsMode msMetricsModeCmd;
+        static OverlayElementCommands::CmdHorizontalAlign msHorizontalAlignCmd;
+        static OverlayElementCommands::CmdVerticalAlign msVerticalAlignCmd;
+        static OverlayElementCommands::CmdVisible msVisibleCmd;
+
+
+        String mName;
+        bool mVisible;
+        bool mCloneable;
+        Real mLeft;
+        Real mTop;
+        Real mWidth;
+        Real mHeight;
+        String mMaterialName;
+        MaterialPtr mpMaterial;
+        DisplayString mCaption;
+        ColourValue mColour;
+        Rectangle mClippingRegion;
+
+        GuiMetricsMode mMetricsMode;
+        GuiHorizontalAlignment mHorzAlign;
+        GuiVerticalAlignment mVertAlign;
+
+        // metric-mode positions, used in GMM_PIXELS & GMM_RELATIVE_ASPECT_ADJUSTED mode.
+        Real mPixelTop;
+        Real mPixelLeft;
+        Real mPixelWidth;
+        Real mPixelHeight;
+        Real mPixelScaleX;
+        Real mPixelScaleY;
+
+        // Parent pointer
+        OverlayContainer* mParent;
+        // Overlay attached to
+        Overlay* mOverlay;
+
+        // Derived positions from parent
+        Real mDerivedLeft;
+        Real mDerivedTop;
+        bool mDerivedOutOfDate;
+
+        /// Flag indicating if the vertex positons need recalculating
+        bool mGeomPositionsOutOfDate;
+		/// Flag indicating if the vertex uvs need recalculating
+		bool mGeomUVsOutOfDate;
+
+        // Zorder for when sending to render queue
+        // Derived from parent
+        ushort mZOrder;
+
+        // world transforms
+        Matrix4 mXForm;
+
+        // is element enabled
+        bool mEnabled;
+
+		// is element initialised
+		bool mInitialised;
+
+        // Used to see if this element is created from a Template
+        OverlayElement* mSourceTemplate ;
+
+        /** Internal method which is triggered when the positions of the element get updated,
+        meaning the element should be rebuilding it's mesh positions. Abstract since
+        subclasses must implement this.
+        */
+        virtual void updatePositionGeometry(void) = 0;
+		/** Internal method which is triggered when the UVs of the element get updated,
+		meaning the element should be rebuilding it's mesh UVs. Abstract since
+		subclasses must implement this.
+		*/
+		virtual void updateTextureGeometry(void) = 0;
+
+        /** Internal method for setting up the basic parameter definitions for a subclass. 
+        @remarks
+        Because StringInterface holds a dictionary of parameters per class, subclasses need to
+        call this to ask the base class to add it's parameters to their dictionary as well.
+        Can't do this in the constructor because that runs in a non-virtual context.
+        @par
+        The subclass must have called it's own createParamDictionary before calling this method.
+        */
+        virtual void addBaseParameters(void);
+
+    public:
+        /// Constructor: do not call direct, use OverlayManager::createElement
+        OverlayElement(const String& name);
+        virtual ~OverlayElement();
+
+        /** Initialise gui element */
+        virtual void initialise(void) = 0;
+
+        /** Gets the name of this overlay. */
+        const String& getName(void) const;
+
+
+        /** Shows this element if it was hidden. */
+        virtual void show(void);
+
+        /** Hides this element if it was visible. */
+        virtual void hide(void);
+
+        /** Returns whether or not the element is visible. */
+        bool isVisible(void) const;
+
+        bool isEnabled() const;
+        virtual void setEnabled(bool b);
+
+
+        /** Sets the dimensions of this element in relation to the screen (1.0 = screen width/height). */
+        void setDimensions(Real width, Real height);
+
+        /** Sets the position of the top-left corner of the element, relative to the screen size
+        (1.0 = screen width / height) */
+        void setPosition(Real left, Real top);
+
+        /** Sets the width of this element in relation to the screen (where 1.0 = screen width) */
+        void setWidth(Real width);
+        /** Gets the width of this element in relation to the screen (where 1.0 = screen width) */
+        Real getWidth(void) const;
+
+        /** Sets the height of this element in relation to the screen (where 1.0 = screen height) */
+        void setHeight(Real height);
+        /** Gets the height of this element in relation to the screen (where 1.0 = screen height) */
+        Real getHeight(void) const;
+
+        /** Sets the left of this element in relation to the screen (where 0 = far left, 1.0 = far right) */
+        void setLeft(Real left);
+        /** Gets the left of this element in relation to the screen (where 0 = far left, 1.0 = far right)  */
+        Real getLeft(void) const;
+
+        /** Sets the top of this element in relation to the screen (where 0 = top, 1.0 = bottom) */
+        void setTop(Real Top);
+        /** Gets the top of this element in relation to the screen (where 0 = top, 1.0 = bottom)  */
+        Real getTop(void) const;
+
+        /** Gets the left of this element in relation to the screen (where 0 = far left, 1.0 = far right)  */
+        Real _getLeft(void) const { return mLeft; }
+        /** Gets the top of this element in relation to the screen (where 0 = far left, 1.0 = far right)  */
+        Real _getTop(void) const { return mTop; }
+        /** Gets the width of this element in relation to the screen (where 1.0 = screen width)  */
+        Real _getWidth(void) const { return mWidth; }
+        /** Gets the height of this element in relation to the screen (where 1.0 = screen height)  */
+        Real _getHeight(void) const { return mHeight; }
+        /** Sets the left of this element in relation to the screen (where 1.0 = screen width) */
+        void _setLeft(Real left);
+        /** Sets the top of this element in relation to the screen (where 1.0 = screen width) */
+        void _setTop(Real top);
+        /** Sets the width of this element in relation to the screen (where 1.0 = screen width) */
+        void _setWidth(Real width);
+        /** Sets the height of this element in relation to the screen (where 1.0 = screen width) */
+        void _setHeight(Real height);
+        /** Sets the left and top of this element in relation to the screen (where 1.0 = screen width) */
+        void _setPosition(Real left, Real top);
+        /** Sets the width and height of this element in relation to the screen (where 1.0 = screen width) */
+        void _setDimensions(Real width, Real height);
+
+        /** Gets the name of the material this element uses. */
+        virtual const String& getMaterialName(void) const;
+
+        /** Sets the name of the material this element will use. 
+        @remarks
+        Different elements will use different materials. One constant about them
+        all though is that a Material used for a OverlayElement must have it's depth
+        checking set to 'off', which means it always gets rendered on top. OGRE
+        will set this flag for you if necessary. What it does mean though is that 
+        you should not use the same Material for rendering OverlayElements as standard 
+        scene objects. It's fine to use the same textures, just not the same
+        Material.
+        */
+        virtual void setMaterialName(const String& matName);
+
+
+        // --- Renderable Overrides ---
+        /** See Renderable */
+        const MaterialPtr& getMaterial(void) const;
+
+        // NB getRenderOperation not implemented, still abstract here
+
+        /** See Renderable */
+        void getWorldTransforms(Matrix4* xform) const;
+        /** @copydoc Renderable::getWorldOrientation */
+        const Quaternion& getWorldOrientation(void) const;
+        /** @copydoc Renderable::getWorldPosition */
+        const Vector3& getWorldPosition(void) const;
+
+        /** Tell the object to recalculate */
+        virtual void _positionsOutOfDate(void);
+
+        /** Internal method to update the element based on transforms applied. */
+        virtual void _update(void);
+
+        /** Updates this elements transform based on it's parent. */
+        virtual void _updateFromParent(void);
+
+        /** Internal method for notifying the gui element of it's parent and ultimate overlay. */
+        virtual void _notifyParent(OverlayContainer* parent, Overlay* overlay);
+
+        /** Gets the 'left' position as derived from own left and that of parents. */
+        virtual Real _getDerivedLeft(void);
+
+        /** Gets the 'top' position as derived from own left and that of parents. */
+        virtual Real _getDerivedTop(void);
+
+		/** Gets the 'width' as derived from own width and metrics mode. */
+		virtual Real _getRelativeWidth(void);
+		/** Gets the 'height' as derived from own height and metrics mode. */
+		virtual Real _getRelativeHeight(void);
+
+
+        /** Gets the clipping region of the element */
+        virtual void _getClippingRegion(Rectangle &clippingRegion);
+
+        /** Internal method to notify the element when Zorder of parent overlay
+        has changed.
+        @remarks
+        Overlays have explicit Z orders. OverlayElements do not, they inherit the 
+        ZOrder of the overlay, and the Zorder is incremented for every container
+        nested within this to ensure that containers are displayed behind contained
+        items. This method is used internally to notify the element of a change in
+        final zorder which is used to render the element.
+        */
+        virtual void _notifyZOrder(ushort newZOrder);
+
+        /** Internal method to notify the element when it's world transform
+         of parent overlay has changed.
+        */
+        virtual void _notifyWorldTransforms(const Matrix4& xform);
+
+        /** Internal method to notify the element when the viewport
+         of parent overlay has changed.
+        */
+        virtual void _notifyViewport();
+
+        /** Internal method to put the contents onto the render queue. */
+        virtual void _updateRenderQueue(RenderQueue* queue);
+
+        /** Gets the type name of the element. All concrete subclasses must implement this. */
+        virtual const String& getTypeName(void) const = 0;
+
+        /** Sets the caption on elements that support it. 
+        @remarks
+        This property doesn't do something on all elements, just those that support it.
+        However, being a common requirement it is in the top-level interface to avoid
+        having to set it via the StringInterface all the time.
+        */
+		virtual void setCaption(const DisplayString& text);
+        /** Gets the caption for this element. */
+        virtual const DisplayString& getCaption(void) const;
+        /** Sets the colour on elements that support it. 
+        @remarks
+        This property doesn't do something on all elements, just those that support it.
+        However, being a common requirement it is in the top-level interface to avoid
+        having to set it via the StringInterface all the time.
+        */
+        virtual void setColour(const ColourValue& col);
+
+        /** Gets the colour for this element. */
+        virtual const ColourValue& getColour(void) const;
+
+        /** Tells this element how to interpret the position and dimension values it is given.
+        @remarks
+        By default, OverlayElements are positioned and sized according to relative dimensions
+        of the screen. This is to ensure portability between different resolutions when you
+        want things to be positioned and sized the same way across all resolutions. However, 
+        sometimes you want things to be sized according to fixed pixels. In order to do this,
+        you can call this method with the parameter GMM_PIXELS. Note that if you then want
+        to place your element relative to the center, right or bottom of it's parent, you will
+        need to use the setHorizontalAlignment and setVerticalAlignment methods.
+        */
+        virtual void setMetricsMode(GuiMetricsMode gmm);
+        /** Retrieves the current settings of how the element metrics are interpreted. */
+        virtual GuiMetricsMode getMetricsMode(void) const;
+        /** Sets the horizontal origin for this element.
+        @remarks
+        By default, the horizontal origin for a OverlayElement is the left edge of the parent container
+        (or the screen if this is a root element). You can alter this by calling this method, which is
+        especially useful when you want to use pixel-based metrics (see setMetricsMode) since in this
+        mode you can't use relative positioning.
+        @par
+        For example, if you were using GMM_PIXELS metrics mode, and you wanted to place a 30x30 pixel
+        crosshair in the center of the screen, you would use GHA_CENTER with a 'left' property of -15.
+        @par
+        Note that neither GHA_CENTER or GHA_RIGHT alter the position of the element based
+        on it's width, you have to alter the 'left' to a negative number to do that; all this
+        does is establish the origin. This is because this way you can align multiple things
+        in the center and right with different 'left' offsets for maximum flexibility.
+        */
+        virtual void setHorizontalAlignment(GuiHorizontalAlignment gha);
+        /** Gets the horizontal alignment for this element. */
+        virtual GuiHorizontalAlignment getHorizontalAlignment(void) const;
+        /** Sets the vertical origin for this element. 
+        @remarks
+        By default, the vertical origin for a OverlayElement is the top edge of the parent container
+        (or the screen if this is a root element). You can alter this by calling this method, which is
+        especially useful when you want to use pixel-based metrics (see setMetricsMode) since in this
+        mode you can't use relative positioning.
+        @par
+        For example, if you were using GMM_PIXELS metrics mode, and you wanted to place a 30x30 pixel
+        crosshair in the center of the screen, you would use GHA_CENTER with a 'top' property of -15.
+        @par
+        Note that neither GVA_CENTER or GVA_BOTTOM alter the position of the element based
+        on it's height, you have to alter the 'top' to a negative number to do that; all this
+        does is establish the origin. This is because this way you can align multiple things
+        in the center and bottom with different 'top' offsets for maximum flexibility.
+        */
+        virtual void setVerticalAlignment(GuiVerticalAlignment gva);
+        /** Gets the vertical alignment for this element. */
+        virtual GuiVerticalAlignment getVerticalAlignment(void) const;
+
+
+
+
+        /** Returns true if xy is within the constraints of the component */
+        virtual bool contains(Real x, Real y) const;
+
+        /** Returns true if xy is within the constraints of the component */
+        virtual OverlayElement* findElementAt(Real x, Real y);		// relative to parent
+
+        /**
+        * returns false as this class is not a container type 
+        */
+        inline virtual bool isContainer() const
+        { return false; }
+
+        inline virtual bool isKeyEnabled() const
+        { return false; }
+
+        inline virtual bool isCloneable() const
+        { return mCloneable; }
+
+        inline virtual void setCloneable(bool c)
+        { mCloneable = c; }
+
+        /**
+        * Returns the parent container.
+        */
+        OverlayContainer* getParent() ;
+        void _setParent(OverlayContainer* parent) { mParent = parent; }
+
+        /**
+        * Returns the zOrder of the element
+        */
+        inline ushort getZOrder() const
+        { return mZOrder; }
+
+        /** Overridden from Renderable */
+        Real getSquaredViewDepth(const Camera* cam) const 
+        { 
+            return 10000 - getZOrder(); 
+        }
+
+        /** @copydoc Renderable::getLights */
+        const LightList& getLights(void) const
+        {
+            // Overlayelements should not be lit by the scene, this will not get called
+            static LightList ll;
+            return ll;
+        }
+
+        virtual void copyFromTemplate(OverlayElement* templateOverlay);
+        virtual OverlayElement* clone(const String& instanceName);
+
+        // Returns the SourceTemplate for this element
+        const OverlayElement* getSourceTemplate () const {
+          return mSourceTemplate ;
+        }
+    };
+
+
+
+}
+
+
+#endif
+
Index: /OgreMain/include/OgreOverlayElementCommands.h
===================================================================
--- /OgreMain/include/OgreOverlayElementCommands.h	(revision 5)
+++ /OgreMain/include/OgreOverlayElementCommands.h	(revision 5)
@@ -0,0 +1,115 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OverlayElementEmitterCommands_H__
+#define __OverlayElementEmitterCommands_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreStringInterface.h"
+
+namespace Ogre  {
+
+
+    namespace OverlayElementCommands {
+        /// Command object for OverlayElement  - see ParamCommand 
+        class _OgreExport CmdLeft : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for OverlayElement  - see ParamCommand 
+        class _OgreExport CmdTop : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for OverlayElement  - see ParamCommand 
+        class _OgreExport CmdWidth : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for OverlayElement  - see ParamCommand 
+        class _OgreExport CmdHeight : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for OverlayElement  - see ParamCommand 
+        class _OgreExport CmdMaterial : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for OverlayElement  - see ParamCommand 
+        class _OgreExport CmdCaption : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for OverlayElement  - see ParamCommand 
+        class _OgreExport CmdMetricsMode : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for OverlayElement  - see ParamCommand 
+        class _OgreExport CmdHorizontalAlign : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for OverlayElement  - see ParamCommand 
+        class _OgreExport CmdVerticalAlign : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for OverlayElement  - see ParamCommand 
+        class _OgreExport CmdVisible : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+    }
+}
+
+#endif
+
+
Index: /OgreMain/include/OgreOverlayElementFactory.h
===================================================================
--- /OgreMain/include/OgreOverlayElementFactory.h	(revision 5)
+++ /OgreMain/include/OgreOverlayElementFactory.h	(revision 5)
@@ -0,0 +1,121 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OverlayElementFactory_H__
+#define __OverlayElementFactory_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreOverlayElement.h"
+#include "OgrePanelOverlayElement.h"
+#include "OgreBorderPanelOverlayElement.h"
+#include "OgreTextAreaOverlayElement.h"
+
+namespace Ogre {
+
+    /** Defines the interface which all components wishing to 
+        supply OverlayElement subclasses must implement.
+    @remarks
+        To allow the OverlayElement types available for inclusion on 
+        overlays to be extended, OGRE allows external apps or plugins
+        to register their ability to create custom OverlayElements with
+        the OverlayManager, using the addOverlayElementFactory method. Classes
+        wanting to do this must implement this interface.
+    @par
+        Each OverlayElementFactory creates a single type of OverlayElement, 
+        identified by a 'type name' which must be unique.
+    */
+    class _OgreExport OverlayElementFactory
+    {
+    public:
+        /** Destroy the overlay element factory */
+        virtual ~OverlayElementFactory () {}
+        /** Creates a new OverlayElement instance with the name supplied. */
+        virtual OverlayElement* createOverlayElement(const String& instanceName) = 0;
+        /** Destroys a OverlayElement which this factory created previously. */
+        virtual void destroyOverlayElement(OverlayElement* pElement) { delete pElement; };
+        /** Gets the string uniquely identifying the type of element this factory creates. */
+        virtual const String& getTypeName(void) const = 0;
+    };
+
+
+    /** Factory for creating PanelOverlayElement instances. */
+    class _OgreExport PanelOverlayElementFactory: public OverlayElementFactory
+    {
+    public:
+        /** See OverlayElementFactory */
+        OverlayElement* createOverlayElement(const String& instanceName)
+        {
+            return new PanelOverlayElement(instanceName);
+        }
+        /** See OverlayElementFactory */
+        const String& getTypeName(void) const
+        {
+            static String name = "Panel";
+            return name;
+        }
+    };
+
+    /** Factory for creating BorderPanelOverlayElement instances. */
+    class _OgreExport BorderPanelOverlayElementFactory: public OverlayElementFactory
+    {
+    public:
+        /** See OverlayElementFactory */
+        OverlayElement* createOverlayElement(const String& instanceName)
+        {
+            return new BorderPanelOverlayElement(instanceName);
+        }
+        /** See OverlayElementFactory */
+        const String& getTypeName(void) const
+        {
+            static String name = "BorderPanel";
+            return name;
+        }
+    };
+
+    /** Factory for creating TextAreaOverlayElement instances. */
+    class _OgreExport TextAreaOverlayElementFactory: public OverlayElementFactory
+    {
+    public:
+        /** See OverlayElementFactory */
+        OverlayElement* createOverlayElement(const String& instanceName)
+        {
+            return new TextAreaOverlayElement(instanceName);
+        }
+        /** See OverlayElementFactory */
+        const String& getTypeName(void) const
+        {
+            static String name = "TextArea";
+            return name;
+        }
+    };
+
+}
+
+
+
+#endif
Index: /OgreMain/include/OgreOverlayManager.h
===================================================================
--- /OgreMain/include/OgreOverlayManager.h	(revision 5)
+++ /OgreMain/include/OgreOverlayManager.h	(revision 5)
@@ -0,0 +1,235 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OverlayManager_H__
+#define __OverlayManager_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreSingleton.h"
+#include "OgreStringVector.h"
+#include "OgreOverlay.h"
+#include "OgreScriptLoader.h"
+
+namespace Ogre {
+
+    /** Manages Overlay objects, parsing them from .overlay files and
+        storing a lookup library of them. Alo manages the creation of 
+		OverlayContainers and OverlayElements, used for non-interactive 2D 
+		elements such as HUDs.
+    */
+    class _OgreExport OverlayManager : public Singleton<OverlayManager>, public ScriptLoader
+    {
+    public:
+        typedef std::map<String, Overlay*> OverlayMap;
+		typedef std::map<String, OverlayElement*> ElementMap;
+    protected:
+        OverlayMap mOverlayMap;
+        StringVector mScriptPatterns;
+
+        void parseNewElement( DataStreamPtr& chunk, String& elemType, String& elemName, 
+            bool isContainer, Overlay* pOverlay, bool isTemplate, String templateName = String(""), OverlayContainer* container = 0);
+        void parseAttrib( const String& line, Overlay* pOverlay);
+        void parseElementAttrib( const String& line, Overlay* pOverlay, OverlayElement* pElement );
+        void skipToNextCloseBrace(DataStreamPtr& chunk);
+        void skipToNextOpenBrace(DataStreamPtr& chunk);
+        
+        int mLastViewportWidth, mLastViewportHeight;
+        bool mViewportDimensionsChanged;
+
+	    bool parseChildren( DataStreamPtr& chunk, const String& line,
+            Overlay* pOverlay, bool isTemplate, OverlayContainer* parent = NULL);
+
+		typedef std::map<String, OverlayElementFactory*> FactoryMap;
+		FactoryMap mFactories;
+
+		ElementMap mInstances;
+		ElementMap mTemplates;
+
+		typedef std::set<String> LoadedScripts;
+		LoadedScripts mLoadedScripts;
+
+
+
+
+		ElementMap& getElementMap(bool isTemplate);
+
+		OverlayElement* createOverlayElementImpl(const String& typeName, const String& instanceName, ElementMap& elementMap);
+
+		OverlayElement* getOverlayElementImpl(const String& name, ElementMap& elementMap);
+
+		void destroyOverlayElementImpl(const String& instanceName, ElementMap& elementMap);
+
+		void destroyOverlayElementImpl(OverlayElement* pInstance, ElementMap& elementMap);
+
+		void destroyAllOverlayElementsImpl(ElementMap& elementMap);
+
+    public:
+        OverlayManager();
+        virtual ~OverlayManager();
+
+        /// @copydoc ScriptLoader::getScriptPatterns
+        const StringVector& getScriptPatterns(void) const;
+        /// @copydoc ScriptLoader::parseScript
+        void parseScript(DataStreamPtr& stream, const String& groupName);
+        /// @copydoc ScriptLoader::getLoadingOrder
+        Real getLoadingOrder(void) const;
+
+        /** Create a new Overlay. */
+        Overlay* create(const String& name);
+        /** Retrieve an Overlay by name 
+        @returns A pointer to the Overlay, or 0 if not found
+        */
+        Overlay* getByName(const String& name);
+        /** Destroys an existing overlay by name */
+        void destroy(const String& name);
+        /** Destroys an existing overlay */
+        void destroy(Overlay* overlay);
+        /** Destroys all existing overlays */
+        void destroyAll(void);
+        typedef MapIterator<OverlayMap> OverlayMapIterator;
+        OverlayMapIterator getOverlayIterator(void);
+
+        /** Internal method for queueing the visible overlays for rendering. */
+        void _queueOverlaysForRendering(Camera* cam, RenderQueue* pQueue, Viewport *vp);
+
+        /** Method for determining if the viewport has changed dimensions. 
+        @remarks This is used by pixel-based OverlayElements to work out if they need to
+            reclaculate their sizes.
+        */
+        bool hasViewportChanged(void) const;
+
+        /** Gets the height of the destination viewport in pixels. */
+        int getViewportHeight(void) const;
+        
+        /** Gets the width of the destination viewport in pixels. */
+        int getViewportWidth(void) const;
+        Real getViewportAspectRatio(void) const;
+
+
+		/** Creates a new OverlayElement of the type requested.
+		@remarks
+		The type of element to create is passed in as a string because this
+		allows plugins to register new types of component.
+		@param typeName The type of element to create.
+		@param instanceName The name to give the new instance.
+		*/
+		OverlayElement* createOverlayElement(const String& typeName, const String& instanceName, bool isTemplate = false);
+
+		/** Gets a reference to an existing element. */
+		OverlayElement* getOverlayElement(const String& name, bool isTemplate = false);
+
+		/** Destroys a OverlayElement. 
+		@remarks
+		Make sure you're not still using this in an Overlay. If in
+		doubt, let OGRE destroy elements on shutdown.
+		*/
+		void destroyOverlayElement(const String& instanceName, bool isTemplate = false);
+
+		/** Destroys a OverlayElement. 
+		@remarks
+		Make sure you're not still using this in an Overlay. If in
+		doubt, let OGRE destroy elements on shutdown.
+		*/
+		void destroyOverlayElement(OverlayElement* pInstance, bool isTemplate = false);
+
+		/** Destroys all the OverlayElement  created so far.
+		@remarks
+		Best to leave this to the engine to call internally, there
+		should rarely be a need to call it yourself.
+		*/
+		void destroyAllOverlayElements(bool isTemplate = false);
+
+		/** Registers a new OverlayElementFactory with this manager.
+		@remarks
+		Should be used by plugins or other apps wishing to provide
+		a new OverlayElement subclass.
+		*/
+		void addOverlayElementFactory(OverlayElementFactory* elemFactory);
+
+		OverlayElement* createOverlayElementFromTemplate(const String& templateName, const String& typeName, const String& instanceName, bool isTemplate = false);
+		/**
+		*  @remarks
+		*  Creates a new OverlayElement object from the specified template name.  The new
+		*  object's name, and all of it's children, will be instanceName/orignalName.
+		*/
+		OverlayElement* cloneOverlayElementFromTemplate(const String& templateName, const String& instanceName);
+
+		OverlayElement* createOverlayElementFromFactory(const String& typeName, const String& instanceName);
+
+		typedef MapIterator<ElementMap> TemplateIterator;
+		/** Returns an iterator over all templates in this manager.*/
+		TemplateIterator getTemplateIterator ()
+		{
+			return TemplateIterator (mTemplates.begin (), mTemplates.end ()) ;
+		}
+		/* Returns whether the Element with the given name is a Template */
+		bool isTemplate (String strName) const {
+			return (mTemplates.find (strName) != mTemplates.end()) ;
+		}
+
+
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static OverlayManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static OverlayManager* getSingletonPtr(void);
+    };
+
+
+
+}
+
+
+#endif 
Index: /OgreMain/include/OgrePanelOverlayElement.h
===================================================================
--- /OgreMain/include/OgrePanelOverlayElement.h	(revision 5)
+++ /OgreMain/include/OgrePanelOverlayElement.h	(revision 5)
@@ -0,0 +1,154 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __PanelOverlayElement_H__
+#define __PanelOverlayElement_H__
+
+#include "OgreOverlayContainer.h"
+
+namespace Ogre {
+
+
+    /** OverlayElement representing a flat, single-material (or transparent) panel which can contain other elements.
+    @remarks
+        This class subclasses OverlayContainer because it can contain other elements. Like other
+        containers, if hidden it's contents are also hidden, if moved it's contents also move etc. 
+        The panel itself is a 2D rectangle which is either completely transparent, or is rendered 
+        with a single material. The texture(s) on the panel can be tiled depending on your requirements.
+    @par
+        This component is suitable for backgrounds and grouping other elements. Note that because
+        it has a single repeating material it cannot have a discrete border (unless the texture has one and
+        the texture is tiled only once). For a bordered panel, see it's subclass BorderPanelOverlayElement.
+    @par
+        Note that the material can have all the usual effects applied to it like multiple texture
+        layers, scrolling / animated textures etc. For multiple texture layers, you have to set 
+        the tiling level for each layer.
+    */
+    class _OgreExport PanelOverlayElement : public OverlayContainer
+    {
+    public:
+        /** Constructor. */
+        PanelOverlayElement(const String& name);
+        virtual ~PanelOverlayElement();
+
+        /** Initialise */
+        virtual void initialise(void);
+
+        /** Sets the number of times textures should repeat. 
+        @param x The number of times the texture should repeat horizontally
+        @param y The number of times the texture should repeat vertically
+        @param layer The texture layer to specify (only needs to be altered if 
+            you're using a multi-texture layer material)
+        */
+        void setTiling(Real x, Real y, ushort layer = 0);
+
+        Real getTileX(ushort layer = 0) const;
+        /** Gets the number of times the texture should repeat vertically. 
+        @param layer The texture layer to specify (only needs to be altered if 
+            you're using a multi-texture layer material)
+        */
+        Real getTileY(ushort layer = 0) const;
+
+        /** Sets the texture coordinates for the panel. */
+        void setUV(Real u1, Real v1, Real u2, Real v2);
+
+        /** Get the uv coordinates for the panel*/
+        void getUV(Real& u1, Real& v1, Real& u2, Real& v2) const;
+
+        /** Sets whether this panel is transparent (used only as a grouping level), or 
+            if it is actually renderred.
+        */
+        void setTransparent(bool isTransparent);
+
+        /** Returns whether this panel is transparent. */
+        bool isTransparent(void) const;
+
+        /** See OverlayElement. */
+        virtual const String& getTypeName(void) const;
+        /** See Renderable. */
+        void getRenderOperation(RenderOperation& op);
+        /** Overridden from OverlayElement */
+        void setMaterialName(const String& matName);
+        /** Overridden from OverlayContainer */
+        void _updateRenderQueue(RenderQueue* queue);
+
+
+        /** Command object for specifying tiling (see ParamCommand).*/
+        class _OgrePrivate CmdTiling : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for specifying transparency (see ParamCommand).*/
+        class _OgrePrivate CmdTransparent : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for specifying UV coordinates (see ParamCommand).*/
+        class _OgrePrivate CmdUVCoords : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+    protected:
+        // Flag indicating if this panel should be visual or just group things
+        bool mTransparent;
+        // Texture tiling
+        Real mTileX[OGRE_MAX_TEXTURE_LAYERS];
+        Real mTileY[OGRE_MAX_TEXTURE_LAYERS];
+        size_t mNumTexCoordsInBuffer;
+        Real mU1, mV1, mU2, mV2;
+
+        RenderOperation mRenderOp;
+
+        /// internal method for setting up geometry, called by OverlayElement::update
+        virtual void updatePositionGeometry(void);
+
+        /// Called to update the texture coords when layers change
+        virtual void updateTextureGeometry(void);
+
+        /// Method for setting up base parameters for this class
+        void addBaseParameters(void);
+
+        static String msTypeName;
+
+        // Command objects
+        static CmdTiling msCmdTiling;
+        static CmdTransparent msCmdTransparent;
+        static CmdUVCoords msCmdUVCoords;
+
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgreParticle.h
===================================================================
--- /OgreMain/include/OgreParticle.h	(revision 5)
+++ /OgreMain/include/OgreParticle.h	(revision 5)
@@ -0,0 +1,147 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Particle_H__
+#define __Particle_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreBillboard.h"
+
+namespace Ogre {
+
+	/** Abstract class containing any additional data required to be associated
+		with a particle to perform the required rendering. 
+	@remarks
+		Because you can specialise the way that particles are renderered by supplying
+		custom ParticleSystemRenderer classes, you might well need some additional 
+		data for your custom rendering routine which is not held on the default particle
+		class. If that's the case, then you should define a subclass of this class, 
+		and construct it when asked in your custom ParticleSystemRenderer class.
+	*/
+	class _OgreExport ParticleVisualData
+	{
+	public:
+		ParticleVisualData() {}
+		virtual ~ParticleVisualData() {}
+
+	};
+
+	/** Class representing a single particle instance. */
+    class _OgreExport Particle 
+    {
+    protected:
+        /// Parent ParticleSystem
+        ParticleSystem* mParentSystem;
+        /// Additional visual data you might want to associate with the Particle
+        ParticleVisualData* mVisual;
+    public:
+        /// Type of particle
+        enum ParticleType
+        {
+            Visual,
+            Emitter
+        };
+
+        /// Does this particle have it's own dimensions?
+        bool mOwnDimensions;
+        /// Personal width if mOwnDimensions == true
+        Real mWidth;
+        /// Personal height if mOwnDimensions == true
+        Real mHeight;
+        /// Current rotation value
+        Radian rotation;
+        // Note the intentional public access to internal variables
+        // Accessing via get/set would be too costly for 000's of particles
+        /// World position
+        Vector3 position;
+        /// Direction (and speed) 
+        Vector3 direction;
+        /// Current colour
+        ColourValue colour;
+        /// Time to live, number of seconds left of particles natural life
+        Real timeToLive;
+        /// Total Time to live, number of seconds of particles natural life
+        Real totalTimeToLive;
+        /// Speed of rotation in radians/sec
+        Radian rotationSpeed;
+        /// Determines the type of particle.
+        ParticleType particleType;
+
+        Particle()
+            : mParentSystem(0), mVisual(0), mOwnDimensions(false), rotation(0), 
+            position(Vector3::ZERO), direction(Vector3::ZERO), 
+            colour(ColourValue::White), timeToLive(10), totalTimeToLive(10), 
+            rotationSpeed(0), particleType(Visual)
+        {
+        }
+
+        /** Sets the width and height for this particle.
+        @remarks
+        Note that it is most efficient for every particle in a ParticleSystem to have the same dimensions. If you
+        choose to alter the dimensions of an individual particle the set will be less efficient. Do not call
+        this method unless you really need to have different particle dimensions within the same set. Otherwise
+        just call the ParticleSystem::setDefaultDimensions method instead.
+        */
+        void setDimensions(Real width, Real height); 
+
+        /** Returns true if this particle deviates from the ParticleSystem's default dimensions (i.e. if the
+        particle::setDimensions method has been called for this instance).
+        @see
+        particle::setDimensions
+        */
+        bool hasOwnDimensions(void) const { return mOwnDimensions; }
+
+        /** Retrieves the particle's personal width, if hasOwnDimensions is true. */
+        Real getOwnWidth(void) const { return mWidth; }
+
+        /** Retrieves the particle's personal width, if hasOwnDimensions is true. */
+        Real getOwnHeight(void) const { return mHeight; }
+        
+        /** Sets the current rotation */
+        void setRotation(const Radian& rad);
+
+        const Radian& getRotation(void) const { return rotation; }
+
+        /** Internal method for notifying the particle of it's owner.
+        */
+        void _notifyOwner(ParticleSystem* owner);
+
+        /** Internal method for notifying the particle of it's optional visual data.
+        */
+		void _notifyVisualData(ParticleVisualData* vis) { mVisual = vis; }
+
+		/// Get the optional visual data associated with the class
+		ParticleVisualData* getVisualData(void) const { return mVisual; }
+
+        /// Utility method to reset this particle
+        void resetDimensions(void);
+    };
+}
+
+#endif
+
Index: /OgreMain/include/OgreParticleAffector.h
===================================================================
--- /OgreMain/include/OgreParticleAffector.h	(revision 5)
+++ /OgreMain/include/OgreParticleAffector.h	(revision 5)
@@ -0,0 +1,116 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleAffector_H__
+#define __ParticleAffector_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include "OgreStringInterface.h"
+
+
+namespace Ogre {
+
+    /** Abstract class defining the interface to be implemented by particle affectors.
+    @remarks
+        Particle affectors modify particles in a particle system over their lifetime. They can be
+        grouped into types, e.g. 'vector force' affectors, 'fader' affectors etc; each type will 
+        modify particles in a different way, using different parameters.
+    @par
+        Because there are so many types of affectors you could use, OGRE chooses not to dictate
+        the available types. It comes with some in-built, but allows plugins or applications to extend the affector types available.
+        This is done by subclassing ParticleAffector to have the appropriate emission behaviour you want,
+        and also creating a subclass of ParticleAffectorFactory which is responsible for creating instances 
+        of your new affector type. You register this factory with the ParticleSystemManager using
+        addAffectorFactory, and from then on affectors of this type can be created either from code or through
+        text particle scripts by naming the type.
+    @par
+        This same approach is used for ParticleEmitters (which are the source of particles in a system).
+        This means that OGRE is particularly flexible when it comes to creating particle system effects,
+        with literally infinite combinations of affector and affector types, and paramters within those
+        types.
+    */
+    class _OgreExport ParticleAffector : public StringInterface
+    {
+    protected:
+        /// Name of the type of affector, MUST be initialised by subclasses
+        String mType;
+
+        /** Internal method for setting up the basic parameter definitions for a subclass. 
+        @remarks
+            Because StringInterface holds a dictionary of parameters per class, subclasses need to
+            call this to ask the base class to add it's parameters to their dictionary as well.
+            Can't do this in the constructor because that runs in a non-virtual context.
+        @par
+            The subclass must have called it's own createParamDictionary before calling this method.
+        */
+        void addBaseParameters(void) { /* actually do nothing - for future possible use */ }
+
+        ParticleSystem* mParent;
+    public:
+        ParticleAffector(ParticleSystem* parent): mParent(parent) {}
+
+        /** Virtual destructor essential. */
+        virtual ~ParticleAffector();
+
+        /** Method called to allow the affector to initialize all newly created particles in the system.
+        @remarks
+            This is where the affector gets the chance to initialize it's effects to the particles of a system.
+            The affector is expected to initialize some or all of the particles in the system
+            passed to it, depending on the affector's approach.
+        @param
+            pParticle Pointer to a Particle to initialize.
+        */
+		virtual void _initParticle(Particle* pParticle) { /* by default do nothing */ }
+
+        /** Method called to allow the affector to 'do it's stuff' on all active particles in the system.
+        @remarks
+            This is where the affector gets the chance to apply it's effects to the particles of a system.
+            The affector is expected to apply it's effect to some or all of the particles in the system
+            passed to it, depending on the affector's approach.
+        @param
+            pSystem Pointer to a ParticleSystem to affect.
+        @param
+            timeElapsed The number of seconds which have elapsed since the last call.
+        */
+        virtual void _affectParticles(ParticleSystem* pSystem, Real timeElapsed) = 0;
+
+        /** Returns the name of the type of affector. 
+        @remarks
+            This property is useful for determining the type of affector procedurally so another
+            can be created.
+        */
+        const String &getType(void) const { return mType; }
+
+    };
+
+}
+
+
+#endif
+
Index: /OgreMain/include/OgreParticleAffectorFactory.h
===================================================================
--- /OgreMain/include/OgreParticleAffectorFactory.h	(revision 5)
+++ /OgreMain/include/OgreParticleAffectorFactory.h	(revision 5)
@@ -0,0 +1,74 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleAffectorFactory_H__
+#define __ParticleAffectorFactory_H__
+
+
+#include "OgrePrerequisites.h"
+#include "OgreParticleAffector.h"
+
+namespace Ogre {
+
+    /** Abstract class defining the interface to be implemented by creators of ParticleAffector subclasses.
+    @remarks
+        Plugins or 3rd party applications can add new types of particle affectors to Ogre by creating
+        subclasses of the ParticleAffector class. Because multiple instances of these affectors may be
+        required, a factory class to manage the instances is also required. 
+    @par
+        ParticleAffectorFactory subclasses must allow the creation and destruction of ParticleAffector
+        subclasses. They must also be registered with the ParticleSystemManager. All factories have
+        a name which identifies them, examples might be 'force_vector', 'attractor', or 'fader', and these can be 
+        also be used from particle system scripts.
+    */
+    class _OgreExport ParticleAffectorFactory
+    {
+    protected:
+        std::vector<ParticleAffector*> mAffectors;
+    public:
+        ParticleAffectorFactory() {};
+        virtual ~ParticleAffectorFactory();
+        /** Returns the name of the factory, the name which identifies the particle affector type this factory creates. */
+        virtual String getName() const = 0;
+
+        /** Creates a new affector instance.
+        @remarks
+            The subclass MUST add a pointer to the created instance to mAffectors.
+        */
+        virtual ParticleAffector* createAffector(ParticleSystem* psys) = 0;
+
+        /** Destroys the affector pointed to by the parameter (for early clean up if reauired). */
+        virtual void destroyAffector(ParticleAffector* e);
+    };
+
+
+}
+
+
+#endif
+
Index: /OgreMain/include/OgreParticleEmitter.h
===================================================================
--- /OgreMain/include/OgreParticleEmitter.h	(revision 5)
+++ /OgreMain/include/OgreParticleEmitter.h	(revision 5)
@@ -0,0 +1,506 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleEmitter_H__
+#define __ParticleEmitter_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include "OgreVector3.h"
+#include "OgreColourValue.h"
+#include "OgreStringInterface.h"
+#include "OgreParticleEmitterCommands.h"
+#include "OgreParticle.h"
+
+
+namespace Ogre {
+
+
+    /** Abstract class defining the interface to be implemented by particle emitters.
+    @remarks
+        Particle emitters are the sources of particles in a particle system. 
+        This class defines the ParticleEmitter interface, and provides a basic implementation 
+        for tasks which most emitters will do (these are of course overridable).
+        Particle emitters can be  grouped into types, e.g. 'point' emitters, 'box' emitters etc; each type will 
+        create particles with a different starting point, direction and velocity (although
+        within the types you can configure the ranges of these parameters). 
+    @par
+        Because there are so many types of emitters you could use, OGRE chooses not to dictate
+        the available types. It comes with some in-built, but allows plugins or applications to extend the emitter types available.
+        This is done by subclassing ParticleEmitter to have the appropriate emission behaviour you want,
+        and also creating a subclass of ParticleEmitterFactory which is responsible for creating instances 
+        of your new emitter type. You register this factory with the ParticleSystemManager using
+        addEmitterFactory, and from then on emitters of this type can be created either from code or through
+        text particle scripts by naming the type.
+    @par
+        This same approach is used for ParticleAffectors (which modify existing particles per frame).
+        This means that OGRE is particularly flexible when it comes to creating particle system effects,
+        with literally infinite combinations of emitter and affector types, and paramters within those
+        types.
+    */
+    class _OgreExport ParticleEmitter : public StringInterface, public Particle
+    {
+    protected:
+
+        // Command object for setting / getting parameters
+        static EmitterCommands::CmdAngle msAngleCmd;
+        static EmitterCommands::CmdColour msColourCmd;
+        static EmitterCommands::CmdColourRangeStart msColourRangeStartCmd;
+        static EmitterCommands::CmdColourRangeEnd msColourRangeEndCmd;
+        static EmitterCommands::CmdDirection msDirectionCmd;
+        static EmitterCommands::CmdEmissionRate msEmissionRateCmd;
+        static EmitterCommands::CmdMaxTTL msMaxTTLCmd;
+        static EmitterCommands::CmdMaxVelocity msMaxVelocityCmd;
+        static EmitterCommands::CmdMinTTL msMinTTLCmd;
+        static EmitterCommands::CmdMinVelocity msMinVelocityCmd;
+        static EmitterCommands::CmdPosition msPositionCmd;
+        static EmitterCommands::CmdTTL msTTLCmd;
+        static EmitterCommands::CmdVelocity msVelocityCmd;
+        static EmitterCommands::CmdDuration msDurationCmd;
+        static EmitterCommands::CmdMinDuration msMinDurationCmd;
+        static EmitterCommands::CmdMaxDuration msMaxDurationCmd;
+        static EmitterCommands::CmdRepeatDelay msRepeatDelayCmd;
+        static EmitterCommands::CmdMinRepeatDelay msMinRepeatDelayCmd;
+        static EmitterCommands::CmdMaxRepeatDelay msMaxRepeatDelayCmd;
+		static EmitterCommands::CmdName msNameCmd;
+		static EmitterCommands::CmdEmittedEmitter msEmittedEmitterCmd;
+
+
+        /// Parent particle system
+        ParticleSystem* mParent;
+        /// Position relative to the center of the ParticleSystem
+        Vector3 mPosition;
+        /// Rate in particles per second at which this emitter wishes to emit particles
+        Real mEmissionRate;
+        /// Name of the type of emitter, MUST be initialised by subclasses
+        String mType;
+        /// Base direction of the emitter, may not be used by some emitters
+        Vector3 mDirection;
+        // Notional up vector, just used to speed up generation of variant directions
+        Vector3 mUp;
+        /// Angle around direction which particles may be emitted, internally radians but angleunits for interface
+        Radian mAngle;
+        /// Min speed of particles
+        Real mMinSpeed;
+        /// Max speed of particles
+        Real mMaxSpeed;
+        /// Initial time-to-live of particles (min)
+        Real mMinTTL;
+        /// Initial time-to-live of particles (max)
+        Real mMaxTTL;
+        /// Initial colour of particles (range start)
+        ColourValue mColourRangeStart;
+        /// Initial colour of particles (range end)
+        ColourValue mColourRangeEnd;
+
+        /// Whether this emitter is currently enabled (defaults to true)
+        bool mEnabled;
+
+        /// Start time (in seconds from start of first call to ParticleSystem to update)
+        Real mStartTime;
+        /// Minimum length of time emitter will run for (0 = forever)
+        Real mDurationMin;
+        /// Maximum length of time the emitter will run for (0 = forever)
+        Real mDurationMax;
+        /// Current duration remainder
+        Real mDurationRemain;
+
+        /// Time between each repeat
+        Real mRepeatDelayMin;
+        Real mRepeatDelayMax;
+        /// Repeat delay left
+        Real mRepeatDelayRemain;
+
+		// Fractions of particles wanted to be emitted last time
+		Real mRemainder;
+
+        /// The name of the emitter. The name is optional unless it is used as an emitter that is emitted itself.
+        String mName;
+
+		/// The name of the emitter to be emitted (optional)
+        String mEmittedEmitter;
+
+		// If 'true', this emitter is emitted by another emitter.
+		// NB. That doesn´t imply that the emitter itself emits other emitters (that could or could not be the case)
+		bool mEmitted;
+
+		// NB Method below here are to help out people implementing emitters by providing the
+        // most commonly used approaches as piecemeal methods
+
+        /** Internal utility method for generating particle exit direction
+        @param destVector Reference to vector to complete with new direction (normalised)
+        */
+        virtual void genEmissionDirection(Vector3& destVector);
+
+        /** Internal utility method to apply velocity to a particle direction.
+        @param destVector The vector to scale by a randomly generated scale between min and max speed.
+            Assumed normalised already, and likely already oriented in the right direction.
+        */
+        virtual void genEmissionVelocity(Vector3& destVector);
+
+        /** Internal utility method for generating a time-to-live for a particle. */
+        virtual Real genEmissionTTL(void);
+
+        /** Internal utility method for generating a colour for a particle. */
+        virtual void genEmissionColour(ColourValue& destColour);
+
+        /** Internal utility method for generating an emission count based on a constant emission rate. */
+        virtual unsigned short genConstantEmissionCount(Real timeElapsed);
+
+        /** Internal method for setting up the basic parameter definitions for a subclass. 
+        @remarks
+            Because StringInterface holds a dictionary of parameters per class, subclasses need to
+            call this to ask the base class to add it's parameters to their dictionary as well.
+            Can't do this in the constructor because that runs in a non-virtual context.
+        @par
+            The subclass must have called it's own createParamDictionary before calling this method.
+        */
+        void addBaseParameters(void);
+
+        /** Internal method for initialising the duration & repeat of an emitter. */
+        void initDurationRepeat(void);
+
+
+    public:
+        ParticleEmitter(ParticleSystem* psys);
+        /** Virtual destructor essential. */
+        virtual ~ParticleEmitter();
+
+		/** Sets the position of this emitter relative to the particle system center. */
+        virtual void setPosition(const Vector3& pos);
+
+        /** Returns the position of this emitter relative to thte center of the particle system. */
+        virtual const Vector3& getPosition(void) const;
+
+        /** Sets the direction of the emitter.
+        @remarks
+            Most emitters will have a base direction in which they emit particles (those which
+            emit in all directions will ignore this parameter). They may not emit exactly along this
+            vector for every particle, many will introduce a random scatter around this vector using 
+            the angle property.
+        @param direction
+            The base direction for particles emitted.
+        */
+        virtual void setDirection(const Vector3& direction);
+
+        /** Returns the base direction of the emitter. */
+        virtual const Vector3& getDirection(void) const;
+
+        /** Sets the maximum angle away from the emitter direction which particle will be emitted.
+        @remarks
+            Whilst the direction property defines the general direction of emission for particles, 
+            this property defines how far the emission angle can deviate away from this base direction.
+            This allows you to create a scatter effect - if set to 0, all particles will be emitted
+            exactly along the emitters direction vector, wheras if you set it to 180 degrees or more,
+            particles will be emitted in a sphere, i.e. in all directions.
+        @param degrees
+            Maximum angle which initial particle direction can deviate from the emitter base direction vector.
+        */
+        virtual void setAngle(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void setAngle(Real angle) {
+            setAngle ( Angle(angle) );
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Returns the maximum angle which the initial particle direction can deviate from the emitters base direction. */
+        virtual const Radian& getAngle(void) const;
+
+        /** Sets the initial velocity of particles emitted.
+        @remarks
+            This method sets a constant speed for emitted particles. See the alternate version
+            of this method which takes 2 parameters if you want a variable speed. 
+        @param
+            speed The initial speed in world units per second which every particle emitted starts with.
+        */
+        virtual void setParticleVelocity(Real speed);
+
+
+        /** Sets the initial velocity range of particles emitted.
+        @remarks
+            This method sets the range of starting speeds for emitted particles. 
+            See the alternate version of this method which takes 1 parameter if you want a 
+            constant speed. This emitter will randomly choose a speed between the minimum and 
+            maximum for each particle.
+        @param max The maximum speed in world units per second for the initial particle speed on emission.
+        @param min The minimum speed in world units per second for the initial particle speed on emission.
+        */
+        virtual void setParticleVelocity(Real min, Real max);
+        /** Returns the minimum particle velocity. */
+        virtual void setMinParticleVelocity(Real min);
+        /** Returns the maximum particle velocity. */
+        virtual void setMaxParticleVelocity(Real max);
+
+        /** Returns the initial velocity of particles emitted. */
+        virtual Real getParticleVelocity(void) const;
+
+        /** Returns the minimum particle velocity. */
+        virtual Real getMinParticleVelocity(void) const;
+
+        /** Returns the maximum particle velocity. */
+        virtual Real getMaxParticleVelocity(void) const;
+
+        /** Sets the emission rate for this emitter.
+        @remarks
+            This method tells the emitter how many particles per second should be emitted. The emitter
+            subclass does not have to emit these in a continuous burst - this is a relative parameter
+            and the emitter may choose to emit all of the second's worth of particles every half-second
+            for example. This is controlled by the emitter's getEmissionCount method.
+        @par
+            Also, if the ParticleSystem's particle quota is exceeded, not all the particles requested
+            may be actually emitted.
+        @param
+            particlesPerSecond The number of particles to be emitted every second.
+        */
+        virtual void setEmissionRate(Real particlesPerSecond);
+
+        /** Returns the emission rate set for this emitter. */
+        virtual Real getEmissionRate(void) const;
+
+        /** Sets the lifetime of all particles emitted.
+        @remarks
+            The emitter initialises particles with a time-to-live (TTL), the number of seconds a particle
+            will exist before being destroyed. This method sets a constant TTL for all particles emitted.
+            Note that affectors are able to modify the TTL of particles later.
+        @par
+            Also see the alternate version of this method which takes a min and max TTL in order to 
+            have the TTL vary per particle.
+        @param ttl The number of seconds each particle will live for.
+        */
+        virtual void setTimeToLive(Real ttl);
+        /** Sets the range of lifetime for particles emitted.
+        @remarks
+            The emitter initialises particles with a time-to-live (TTL), the number of seconds a particle
+            will exist before being destroyed. This method sets a range for the TTL for all particles emitted;
+            the ttl may be randomised between these 2 extremes or will vary some other way depending on the
+            emitter.
+            Note that affectors are able to modify the TTL of particles later.
+        @par
+            Also see the alternate version of this method which takes a single TTL in order to 
+            set a constant TTL for all particles.
+        @param minTtl The minimum number of seconds each particle will live for.
+        @param maxTtl The maximum number of seconds each particle will live for.
+        */
+        virtual void setTimeToLive(Real minTtl, Real maxTtl);
+
+        /** Sets the minimum time each particle will live for. */
+        virtual void setMinTimeToLive(Real min);
+        /** Sets the maximum time each particle will live for. */
+        virtual void setMaxTimeToLive(Real max);
+        
+        /** Gets the time each particle will live for. */
+        virtual Real getTimeToLive(void) const;
+
+        /** Gets the minimum time each particle will live for. */
+        virtual Real getMinTimeToLive(void) const;
+        /** Gets the maximum time each particle will live for. */
+        virtual Real getMaxTimeToLive(void) const;
+
+        /** Sets the initial colour of particles emitted.
+        @remarks
+            Particles have an initial colour on emission which the emitter sets. This method sets
+            this colour. See the alternate version of this method which takes 2 colours in order to establish 
+            a range of colours to be assigned to particles.
+        @param colour The colour which all particles will be given on emission.
+        */
+        virtual void setColour(const ColourValue& colour);
+        /** Sets the range of colours for emitted particles.
+        @remarks
+            Particles have an initial colour on emission which the emitter sets. This method sets
+            the range of this colour. See the alternate version of this method which takes a single colour
+            in order to set a constant colour for all particles. Emitters may choose to randomly assign
+            a colour in this range, or may use some other method to vary the colour.
+        @param colourStart The start of the colour range
+        @param colourEnd The end of the colour range
+        */
+        virtual void setColour(const ColourValue& colourStart, const ColourValue& colourEnd);
+        /** Sets the minimum colour of particles to be emitted. */
+        virtual void setColourRangeStart(const ColourValue& colour);
+        /** Sets the maximum colour of particles to be emitted. */
+        virtual void setColourRangeEnd(const ColourValue& colour);
+        /** Gets the colour of particles to be emitted. */
+        virtual const ColourValue& getColour(void) const;
+        /** Gets the minimum colour of particles to be emitted. */
+        virtual const ColourValue& getColourRangeStart(void) const;
+        /** Gets the maximum colour of particles to be emitted. */
+        virtual const ColourValue& getColourRangeEnd(void) const;
+
+        /** Gets the number of particles which this emitter would like to emit based on the time elapsed.
+        @remarks
+            For efficiency the emitter does not actually create new Particle instances (these are reused
+            by the ParticleSystem as existing particles 'die'). The implementation for this method must
+            return the number of particles the emitter would like to emit given the number of seconds which
+            have elapsed (passed in as a parameter).
+        @par
+            Based on the return value from this method, the ParticleSystem class will call 
+            _initParticle once for each particle it chooses to allow to be emitted by this emitter.
+            The emitter should not track these _initParticle calls, it should assume all emissions
+            requested were made (even if they could not be because of particle quotas).
+        */
+        virtual unsigned short _getEmissionCount(Real timeElapsed) = 0;
+
+        /** Initialises a particle based on the emitter's approach and parameters.
+        @remarks
+            See the _getEmissionCount method for details of why there is a separation between
+            'requested' emissions and actual initialised particles.
+        @param
+            pParticle Pointer to a particle which must be initialised based on how this emitter
+            starts particles. This is passed as a pointer rather than being created by the emitter so the
+            ParticleSystem can reuse Particle instances, and can also set defaults itself.
+        */
+        virtual void _initParticle(Particle* pParticle) {
+            // Initialise size incase it's been altered
+            pParticle->resetDimensions();
+        }
+
+
+        /** Returns the name of the type of emitter. 
+        @remarks
+            This property is useful for determining the type of emitter procedurally so another
+            can be created.
+        */
+        const String &getType(void) const { return mType; }
+
+        /** Sets whether or not the emitter is enabled.
+        @remarks
+            You can turn an emitter off completely by setting this parameter to false.
+        */
+        virtual void setEnabled(bool enabled);
+
+        /** Gets the flag indicating if this emitter is enabled or not. */
+        virtual bool getEnabled(void) const;
+
+        /** Sets the 'start time' of this emitter.
+        @remarks
+            By default an emitter starts straight away as soon as a ParticleSystem is first created,
+            or also just after it is re-enabled. This parameter allows you to set a time delay so
+            that the emitter does not 'kick in' until later.
+        @param startTime The time in seconds from the creation or enabling of the emitter.
+        */
+        virtual void setStartTime(Real startTime);
+        /** Gets the start time of the emitter. */
+        virtual Real getStartTime(void) const;
+
+        /** Sets the duration of the emitter.
+        @remarks
+            By default emitters run indefinitely (unless you manually disable them). By setting this
+            parameter, you can make an emitter turn off on it's own after a set number of seconds. It
+            will then remain disabled until either setEnabled(true) is called, or if the 'repeatAfter' parameter
+            has been set it will also repeat after a number of seconds.
+        @par
+            Also see the alternative version of this method which allows you to set a min and max duration for
+            a random variable duration.
+        @param duration The duration in seconds.
+        */
+        virtual void setDuration(Real duration);
+
+        /** Gets the duration of the emitter from when it is created or re-enabled. */
+        virtual Real getDuration(void) const;
+
+        /** Sets the range of random duration for this emitter. 
+        @remarks
+            By default emitters run indefinitely (unless you manually disable them). By setting this
+            parameter, you can make an emitter turn off on it's own after a random number of seconds. It
+            will then remain disabled until either setEnabled(true) is called, or if the 'repeatAfter' parameter
+            has been set it will also repeat after a number of seconds.
+        @par
+            Also see the alternative version of this method which allows you to set a constant duration.
+        @param min The minimum duration in seconds.
+        @param max The minimum duration in seconds.
+        */
+        virtual void setDuration(Real min, Real max);
+        /** Sets the minimum duration of this emitter in seconds (see setDuration for more details) */
+        virtual void setMinDuration(Real min);
+        /** Sets the maximum duration of this emitter in seconds (see setDuration for more details) */
+        virtual void setMaxDuration(Real max);
+        /** Gets the minimum duration of this emitter in seconds (see setDuration for more details) */
+        virtual Real getMinDuration(void) const;
+        /** Gets the maximum duration of this emitter in seconds (see setDuration for more details) */
+        virtual Real getMaxDuration(void) const;
+
+        /** Sets the time between repeats of the emitter.
+        @remarks
+            By default emitters run indefinitely (unless you manually disable them). However, if you manually
+            disable the emitter (by calling setEnabled(false), or it's duration runs out, it will cease to emit
+        @par
+            Also see the alternative version of this method which allows you to set a min and max duration for
+            a random variable duration.
+        @param duration The duration in seconds.
+        */
+        virtual void setRepeatDelay(Real duration);
+
+        /** Gets the duration of the emitter from when it is created or re-enabled. */
+        virtual Real getRepeatDelay(void) const;
+
+        /** Sets the range of random duration for this emitter. 
+        @remarks
+            By default emitters run indefinitely (unless you manually disable them). By setting this
+            parameter, you can make an emitter turn off on it's own after a random number of seconds. It
+            will then remain disabled until either setEnabled(true) is called, or if the 'repeatAfter' parameter
+            has been set it will also repeat after a number of seconds.
+        @par
+            Also see the alternative version of this method which allows you to set a constant duration.
+        @param min The minimum duration in seconds.
+        @param max The minimum duration in seconds.
+        */
+        virtual void setRepeatDelay(Real min, Real max);
+        /** Sets the minimum duration of this emitter in seconds (see setRepeatDelay for more details) */
+        virtual void setMinRepeatDelay(Real min);
+        /** Sets the maximum duration of this emitter in seconds (see setRepeatDelay for more details) */
+        virtual void setMaxRepeatDelay(Real max);
+        /** Gets the minimum duration of this emitter in seconds (see setRepeatDelay for more details) */
+        virtual Real getMinRepeatDelay(void) const;
+        /** Gets the maximum duration of this emitter in seconds (see setRepeatDelay for more details) */
+        virtual Real getMaxRepeatDelay(void) const;
+
+		/** Returns the name of the emitter */
+		const String &getName(void) const;
+
+		/** Sets the name of the emitter */
+		virtual void setName(const String& newName);
+
+		/** Returns the name of the emitter to be emitted */
+		const String &getEmittedEmitter(void) const;
+
+		/** Sets the name of the emitter to be emitted*/
+		virtual void setEmittedEmitter(const String& emittedEmitter);
+
+		/** Return ´true´ if the emitter is emitted by another emitter */
+		virtual bool isEmitted(void) const;
+
+		/** Set the indication (true/false) to indicate that the emitter is emitted by another emitter */
+		virtual void setEmitted(bool emitted);
+
+
+    };
+
+}
+
+
+#endif
+
Index: /OgreMain/include/OgreParticleEmitterCommands.h
===================================================================
--- /OgreMain/include/OgreParticleEmitterCommands.h	(revision 5)
+++ /OgreMain/include/OgreParticleEmitterCommands.h	(revision 5)
@@ -0,0 +1,200 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleEmitterCommands_H__
+#define __ParticleEmitterCommands_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreStringInterface.h"
+
+namespace Ogre  {
+
+
+    namespace EmitterCommands {
+        /// Command object for ParticleEmitter  - see ParamCommand 
+        class _OgreExport CmdAngle : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdColour : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdColourRangeStart : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdColourRangeEnd : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdDirection : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdEmissionRate : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdVelocity : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdMinVelocity : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdMaxVelocity : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdTTL : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdMinTTL : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdMaxTTL : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdPosition : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdDuration : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdMinDuration : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdMaxDuration : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdRepeatDelay : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdMinRepeatDelay : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdMaxRepeatDelay : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+		/// Command object for particle emitter  - see ParamCommand
+        class _OgreExport CmdName : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+		/// Command object for particle emitter  - see ParamCommand 
+        class _OgreExport CmdEmittedEmitter : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+    }
+
+}
+
+
+
+
+
+#endif
+
Index: /OgreMain/include/OgreParticleEmitterFactory.h
===================================================================
--- /OgreMain/include/OgreParticleEmitterFactory.h	(revision 5)
+++ /OgreMain/include/OgreParticleEmitterFactory.h	(revision 5)
@@ -0,0 +1,77 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleEmitterFactory_H__
+#define __ParticleEmitterFactory_H__
+
+
+#include "OgrePrerequisites.h"
+#include "OgreParticleEmitter.h"
+#include "OgreString.h"
+
+namespace Ogre {
+
+    /** Abstract class defining the interface to be implemented by creators of ParticleEmitter subclasses.
+    @remarks
+        Plugins or 3rd party applications can add new types of particle emitters to Ogre by creating
+        subclasses of the ParticleEmitter class. Because multiple instances of these emitters may be
+        required, a factory class to manage the instances is also required. 
+    @par
+        ParticleEmitterFactory subclasses must allow the creation and destruction of ParticleEmitter
+        subclasses. They must also be registered with the ParticleSystemManager. All factories have
+        a name which identifies them, examples might be 'point', 'cone', or 'box', and these can be 
+        also be used from particle system scripts.
+    */
+    class _OgreExport ParticleEmitterFactory
+    {
+    protected:
+        std::vector<ParticleEmitter*> mEmitters;
+    public:
+        ParticleEmitterFactory() {};
+        virtual ~ParticleEmitterFactory();
+
+        /** Returns the name of the factory, the name which identifies the particle emitter type this factory creates. */
+        virtual String getName() const = 0;
+
+        /** Creates a new emitter instance.
+        @remarks
+            The subclass MUST add a pointer to the created instance to mEmitters.
+        */
+        virtual ParticleEmitter* createEmitter(ParticleSystem* psys) = 0;
+
+        /** Destroys the emitter pointed to by the parameter (for early clean up if reauired). */
+        virtual void destroyEmitter(ParticleEmitter* e);
+
+    };
+
+
+}
+
+
+#endif
+
Index: /OgreMain/include/OgreParticleIterator.h
===================================================================
--- /OgreMain/include/OgreParticleIterator.h	(revision 5)
+++ /OgreMain/include/OgreParticleIterator.h	(revision 5)
@@ -0,0 +1,61 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleIterator_H__
+#define __ParticleIterator_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+
+    /** Convenience class to make it easy to step through all particles in a ParticleSystem.
+    */
+    class _OgreExport ParticleIterator
+    {
+        friend class ParticleSystem;
+    protected:
+        std::list<Particle*>::iterator mPos;
+        std::list<Particle*>::iterator mStart;
+        std::list<Particle*>::iterator mEnd;
+
+        /// Protected constructor, only available from ParticleSystem::getIterator
+        ParticleIterator(std::list<Particle*>::iterator start, std::list<Particle*>::iterator end);
+
+    public:
+        // Returns true when at the end of the particle list
+        bool end(void);
+
+        /** Returns a pointer to the next particle, and moves the iterator on by 1 element. */
+        Particle* getNext(void);
+    };
+}
+
+
+#endif
+
Index: /OgreMain/include/OgreParticleSystem.h
===================================================================
--- /OgreMain/include/OgreParticleSystem.h	(revision 5)
+++ /OgreMain/include/OgreParticleSystem.h	(revision 5)
@@ -0,0 +1,878 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleSystem_H__
+#define __ParticleSystem_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreVector3.h"
+#include "OgreString.h"
+#include "OgreParticleIterator.h"
+#include "OgreStringInterface.h"
+#include "OgreMovableObject.h"
+#include "OgreRadixSort.h"
+#include "OgreController.h"
+
+
+namespace Ogre {
+
+    /** Class defining particle system based special effects.
+    @remarks
+        Particle systems are special effects generators which are based on a 
+        number of moving points to create the impression of things like like 
+        sparkles, smoke, blood spurts, dust etc.
+    @par
+        This class simply manages a single collection of particles in world space
+        with a shared local origin for emission. The visual aspect of the 
+        particles is handled by a ParticleSystemRenderer instance.
+    @par
+        Particle systems are created using the SceneManager, never directly.
+        In addition, like all subclasses of MovableObject, the ParticleSystem 
+		will only be considered for rendering once it has been attached to a 
+		SceneNode. 
+    */
+    class _OgreExport ParticleSystem : public StringInterface, public MovableObject
+    {
+    public:
+
+        /** Command object for quota (see ParamCommand).*/
+        class _OgrePrivate CmdQuota : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for emittedEmitterQuota (see ParamCommand).*/
+        class _OgrePrivate CmdEmittedEmitterQuota : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for material (see ParamCommand).*/
+        class _OgrePrivate CmdMaterial : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for cull_each (see ParamCommand).*/
+        class _OgrePrivate CmdCull : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for particle_width (see ParamCommand).*/
+        class _OgrePrivate CmdWidth : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for particle_height (see ParamCommand).*/
+        class _OgrePrivate CmdHeight : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for renderer (see ParamCommand).*/
+        class _OgrePrivate CmdRenderer : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+		/** Command object for sorting (see ParamCommand).*/
+		class CmdSorted : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+		/** Command object for local space (see ParamCommand).*/
+		class CmdLocalSpace : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+		/** Command object for iteration interval(see ParamCommand).*/
+		class CmdIterationInterval : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+		/** Command object for nonvisible timeout (see ParamCommand).*/
+		class CmdNonvisibleTimeout : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+
+        /// Default constructor required for STL creation in manager
+        ParticleSystem();
+        /** Creates a particle system with no emitters or affectors.
+        @remarks
+            You should use the ParticleSystemManager to create particle systems rather than creating
+            them directly.
+        */
+        ParticleSystem(const String& name, const String& resourceGroupName);
+
+        virtual ~ParticleSystem();
+
+        /** Sets the ParticleRenderer to be used to render this particle system.
+        @remarks
+            The main ParticleSystem just manages the creation and movement of 
+            particles; they are rendered using functions in ParticleRenderer
+            and the ParticleVisual instances they create.
+		@param typeName String identifying the type of renderer to use; a new 
+			instance of this type will be created; a factory must have been registered
+			with ParticleSystemManager.
+        */
+        void setRenderer(const String& typeName);
+
+        /** Gets the ParticleRenderer to be used to render this particle system. */
+        ParticleSystemRenderer* getRenderer(void) const;
+        /** Gets the name of the ParticleRenderer to be used to render this particle system. */
+        const String& getRendererName(void) const;
+
+        /** Adds an emitter to this particle system.
+        @remarks
+            Particles are created in a particle system by emitters - see the ParticleEmitter
+            class for more details.
+        @param 
+            emitterType String identifying the emitter type to create. Emitter types are defined
+            by registering new factories with the manager - see ParticleEmitterFactory for more details.
+            Emitter types can be extended by OGRE, plugin authors or application developers.
+        */
+        ParticleEmitter* addEmitter(const String& emitterType);
+
+        /** Retrieves an emitter by it's index (zero-based).
+        @remarks
+            Used to retrieve a pointer to an emitter for a particle system to procedurally change
+            emission parameters etc.
+            You should check how many emitters are registered against this system before calling
+            this method with an arbitrary index using getNumEmitters.
+        @param
+            index Zero-based index of the emitter to retrieve.
+        */
+        ParticleEmitter* getEmitter(unsigned short index) const;
+
+        /** Returns the number of emitters for this particle system. */
+        unsigned short getNumEmitters(void) const;
+
+        /** Removes an emitter from the system.
+        @remarks
+            Drops the emitter with the index specified from this system.
+            You should check how many emitters are registered against this system before calling
+            this method with an arbitrary index using getNumEmitters.
+        @param
+            index Zero-based index of the emitter to retrieve.
+        */
+        void removeEmitter(unsigned short index);
+
+        /** Removes all the emitters from this system. */
+        void removeAllEmitters(void);
+
+
+        /** Adds an affector to this particle system.
+        @remarks
+            Particles are modified over time in a particle system by affectors - see the ParticleAffector
+            class for more details.
+        @param 
+            affectorType String identifying the affector type to create. Affector types are defined
+            by registering new factories with the manager - see ParticleAffectorFactory for more details.
+            Affector types can be extended by OGRE, plugin authors or application developers.
+        */
+        ParticleAffector* addAffector(const String& affectorType);
+
+        /** Retrieves an affector by it's index (zero-based).
+        @remarks
+            Used to retrieve a pointer to an affector for a particle system to procedurally change
+            affector parameters etc.
+            You should check how many affectors are registered against this system before calling
+            this method with an arbitrary index using getNumAffectors.
+        @param
+            index Zero-based index of the affector to retrieve.
+        */
+        ParticleAffector* getAffector(unsigned short index) const;
+
+        /** Returns the number of affectors for this particle system. */
+        unsigned short getNumAffectors(void) const;
+
+        /** Removes an affector from the system.
+        @remarks
+            Drops the affector with the index specified from this system.
+            You should check how many affectors are registered against this system before calling
+            this method with an arbitrary index using getNumAffectors.
+        @param
+            index Zero-based index of the affector to retrieve.
+        */
+        void removeAffector(unsigned short index);
+
+        /** Removes all the affectors from this system. */
+        void removeAllAffectors(void);
+
+        /** Empties this set of all particles.
+        */
+        void clear();
+
+        /** Gets the number of individual particles in the system right now.
+        @remarks
+            The number of particles active in a system at a point in time depends on 
+            the number of emitters, their emission rates, the time-to-live (TTL) each particle is
+            given on emission (and whether any affectors modify that TTL) and the maximum
+            number of particles allowed in this system at once (particle quota).
+        */
+        size_t getNumParticles(void) const;
+
+		/** Manually add a particle to the system. 
+		@remarks
+			Instead of using an emitter, you can manually add a particle to the system.
+			You must initialise the returned particle instance immediately with the
+			'emission' state.
+		@note
+			There is no corresponding 'destroyParticle' method - if you want to dispose of a
+			particle manually (say, if you've used setSpeedFactor(0) to make particles live forever)
+			you should use getParticle() and modify it's timeToLive to zero, meaning that it will
+			get cleaned up in the next update.
+		*/
+		Particle* createParticle(void);
+
+		/** Manually add an emitter particle to the system. 
+		@remarks
+			The purpose of a particle emitter is to emit particles. Besides visual particles, also other other
+			particle types can be emitted, other emitters for example. The emitted emitters have a double role;
+			they behave as particles and can be influenced by affectors, but they are still emitters and capable 
+			to emit other particles (or emitters). It is possible to create a chain of emitters - emitters 
+			emitting other emitters, which also emit emitters.
+		@param emitterName The name of a particle emitter that must be emitted.
+		*/
+		Particle* createEmitterParticle(const String& emitterName);
+
+		/** Retrieve a particle from the system for manual tweaking.
+		@remarks
+			Normally you use an affector to alter particles in flight, but
+			for small manually controlled particle systems you might want to use
+			this method.
+		*/
+		Particle* getParticle(size_t index);
+
+        /** Returns the maximum number of particles this system is allowed to have active at once.
+        @remarks
+            See ParticleSystem::setParticleQuota for more info.
+        */
+        size_t getParticleQuota(void) const;
+
+        /** Sets the maximum number of particles this system is allowed to have active at once.
+        @remarks
+            Particle systems all have a particle quota, i.e. a maximum number of particles they are 
+            allowed to have active at a time. This allows the application to set a keep particle systems
+            under control should they be affected by complex parameters which alter their emission rates
+            etc. If a particle system reaches it's particle quota, none of the emitters will be able to 
+            emit any more particles. As existing particles die, the spare capacity will be allocated
+            equally across all emitters to be as consistent to the origina particle system style as possible.
+        @param quota The maximum number of particles this system is allowed to have.
+        */
+        void setParticleQuota(size_t quota);
+
+        /** Returns the maximum number of emitted emitters this system is allowed to have active at once.
+        @remarks
+            See ParticleSystem::setEmittedEmitterQuota for more info.
+        */
+        size_t getEmittedEmitterQuota(void) const;
+
+        /** Sets the maximum number of emitted emitters this system is allowed to have active at once.
+        @remarks
+            Particle systems can have - besides a particle quota - also an emitted emitter quota.
+        @param quota The maximum number of emitted emitters this system is allowed to have.
+        */
+        void setEmittedEmitterQuota(size_t quota);
+
+		/** Assignment operator for copying.
+        @remarks
+            This operator deep copies all particle emitters and effectors, but not particles. The
+            system's name is also not copied.
+        */
+        ParticleSystem& operator=(const ParticleSystem& rhs);
+
+        /** Updates the particles in the system based on time elapsed.
+        @remarks
+            This is called automatically every frame by OGRE.
+        @param
+            timeElapsed The amount of time, in seconds, since the last frame.
+        */
+        void _update(Real timeElapsed);
+
+        /** Returns an iterator for stepping through all particles in this system.
+        @remarks
+            This method is designed to be used by people providing new ParticleAffector subclasses,
+            this is the easiest way to step through all the particles in a system and apply the
+            changes the affector wants to make.
+        */
+        ParticleIterator _getIterator(void);
+
+        /** Sets the name of the material to be used for this billboard set.
+            @param
+                name The new name of the material to use for this set.
+        */
+        virtual void setMaterialName(const String& name);
+
+        /** Sets the name of the material to be used for this billboard set.
+            @returns The name of the material that is used for this set.
+        */
+        virtual const String& getMaterialName(void) const;
+
+        /** Overridden from MovableObject
+            @see
+                MovableObject
+        */
+        virtual void _notifyCurrentCamera(Camera* cam);
+
+        /** Overridden from MovableObject
+        @see
+        MovableObject
+        */
+        void _notifyAttached(Node* parent, bool isTagPoint = false);
+
+        /** Overridden from MovableObject
+            @see
+                MovableObject
+        */
+        virtual const AxisAlignedBox& getBoundingBox(void) const { return mAABB; }
+
+        /** Overridden from MovableObject
+            @see
+                MovableObject
+        */
+        virtual Real getBoundingRadius(void) const { return mBoundingRadius; }
+
+        /** Overridden from MovableObject
+            @see
+                MovableObject
+        */
+        virtual void _updateRenderQueue(RenderQueue* queue);
+
+        /** Fast-forwards this system by the required number of seconds.
+        @remarks
+            This method allows you to fast-forward a system so that it effectively looks like
+            it has already been running for the time you specify. This is useful to avoid the
+            'startup sequence' of a system, when you want the system to be fully populated right
+            from the start.
+        @param
+            time The number of seconds to fast-forward by.
+        @param
+            interval The sampling interval used to generate particles, apply affectors etc. The lower this
+            is the more realistic the fast-forward, but it takes more iterations to do it.
+        */
+        void fastForward(Real time, Real interval = 0.1);
+
+		/** Sets a 'speed factor' on this particle system, which means it scales the elapsed
+			real time which has passed by this factor before passing it to the emitters, affectors,
+			and the particle life calculation.
+		@remarks
+			An interesting side effect - if you want to create a completely manual particle system
+			where you control the emission and life of particles yourself, you can set the speed
+			factor to 0.0f, thus disabling normal particle emission, alteration, and death.
+		*/
+		void setSpeedFactor(Real speedFactor) { mSpeedFactor = speedFactor; }
+
+		/** Gets the 'speed factor' on this particle system.
+		*/
+		Real getSpeedFactor(void) const { return mSpeedFactor; }
+
+        /** Sets a 'iteration interval' on this particle system.
+        @remarks
+            The default Particle system update interval, based on elapsed frame time,
+			will cause different behavior between low frame-rate and high frame-rate. 
+			By using this option, you can make the particle system update at
+			a fixed interval, keeping the behavior the same no matter what frame-rate 
+			is.
+        @par
+            When iteration interval is set to zero, it means the update occurs based 
+			on an elapsed frame time, otherwise each iteration will take place 
+			at the given interval, repeating until it has used up all the elapsed 
+			frame time.
+        @param
+            iterationInterval The iteration interval, default to zero.
+        */
+        void setIterationInterval(Real iterationInterval);
+
+        /** Gets a 'iteration interval' on this particle system.
+        */
+        Real getIterationInterval(void) const { return mIterationInterval; }
+
+		/** Set the default iteration interval for all ParticleSystem instances.
+		*/
+        static void setDefaultIterationInterval(Real iterationInterval) { msDefaultIterationInterval = iterationInterval; }
+
+		/** Get the default iteration interval for all ParticleSystem instances.
+		*/
+        static Real getDefaultIterationInterval(void) { return msDefaultIterationInterval; }
+
+		/** Sets when the particle system should stop updating after it hasn't been
+			visible for a while.
+		@remarks
+			By default, visible particle systems update all the time, even when 
+			not in view. This means that they are guaranteed to be consistent when 
+			they do enter view. However, this comes at a cost, updating particle
+			systems can be expensive, especially if they are perpetual.
+		@par
+			This option lets you set a 'timeout' on the particle system, so that
+			if it isn't visible for this amount of time, it will stop updating
+			until it is next visible.
+		@param timeout The time after which the particle system will be disabled
+			if it is no longer visible. 0 to disable the timeout and always update.
+		*/
+		void setNonVisibleUpdateTimeout(Real timeout);
+		/** Gets when the particle system should stop updating after it hasn't been
+			visible for a while.
+		*/
+		Real getNonVisibleUpdateTimeout(void) const { return mNonvisibleTimeout; }
+
+		/** Set the default nonvisible timeout for all ParticleSystem instances.
+		*/
+		static void setDefaultNonVisibleUpdateTimeout(Real timeout) 
+		{ msDefaultNonvisibleTimeout = timeout; }
+
+		/** Get the default nonvisible timeout for all ParticleSystem instances.
+		*/
+		static Real getDefaultNonVisibleUpdateTimeout(void) { return msDefaultNonvisibleTimeout; }
+
+		/** Overridden from MovableObject */
+        const String& getMovableType(void) const;
+
+        /** Internal callback used by Particles to notify their parent that they have been resized.
+        */
+        virtual void _notifyParticleResized(void);
+
+        /** Internal callback used by Particles to notify their parent that they have been rotated.
+        */
+        virtual void _notifyParticleRotated(void);
+
+        /** Sets the default dimensions of the particles in this set.
+            @remarks
+                All particles in a set are created with these default dimensions. The set will render most efficiently if
+                all the particles in the set are the default size. It is possible to alter the size of individual
+                particles at the expense of extra calculation. See the Particle class for more info.
+            @param width
+                The new default width for the particles in this set.
+            @param height
+                The new default height for the particles in this set.
+        */
+        virtual void setDefaultDimensions(Real width, Real height);
+
+        /** See setDefaultDimensions - this sets 1 component individually. */
+        virtual void setDefaultWidth(Real width);
+        /** See setDefaultDimensions - this gets 1 component individually. */
+        virtual Real getDefaultWidth(void) const;
+        /** See setDefaultDimensions - this sets 1 component individually. */
+        virtual void setDefaultHeight(Real height);
+        /** See setDefaultDimensions - this gets 1 component individually. */
+        virtual Real getDefaultHeight(void) const;
+        /** Returns whether or not particles in this are tested individually for culling. */
+        virtual bool getCullIndividually(void) const;
+        /** Sets whether culling tests particles in this individually as well as in a group.
+        @remarks
+            Particle sets are always culled as a whole group, based on a bounding box which 
+            encloses all particles in the set. For fairly localised sets, this is enough. However, you
+            can optionally tell the set to also cull individual particles in the set, i.e. to test
+            each individual particle before rendering. The default is not to do this.
+        @par
+            This is useful when you have a large, fairly distributed set of particles, like maybe 
+            trees on a landscape. You probably still want to group them into more than one
+            set (maybe one set per section of landscape), which will be culled coarsely, but you also
+            want to cull the particles individually because they are spread out. Whilst you could have
+            lots of single-tree sets which are culled separately, this would be inefficient to render
+            because each tree would be issued as it's own rendering operation.
+        @par
+            By calling this method with a parameter of true, you can have large particle sets which 
+            are spaced out and so get the benefit of batch rendering and coarse culling, but also have
+            fine-grained culling so unnecessary rendering is avoided.
+        @param cullIndividual If true, each particle is tested before being sent to the pipeline as well 
+            as the whole set having to pass the coarse group bounding test.
+        */
+        virtual void setCullIndividually(bool cullIndividual);
+        /// Return the resource group to be used to load dependent resources
+        virtual const String& getResourceGroupName(void) const { return mResourceGroupName; }
+		/** Get the origin of this particle system, e.g. a script file name.
+		@remarks
+			This property will only contain something if the creator of
+			this particle system chose to populate it. Script loaders are advised
+			to populate it.
+		*/
+		const String& getOrigin(void) const { return mOrigin; }
+		/// Notify this particle system of it's origin
+		void _notifyOrigin(const String& origin) { mOrigin = origin; }
+
+		/** @copydoc MovableObject::setRenderQueueGroup */
+		void setRenderQueueGroup(uint8 queueID);
+
+		/** Set whether or not particles are sorted according to the camera.
+		@remarks
+			Enabling sorting alters the order particles are sent to the renderer.
+			When enabled, particles are sent to the renderer in order of 
+			furthest distance from the camera.
+		*/
+		void setSortingEnabled(bool enabled) { mSorted = enabled; }
+		/// Gets whether particles are sorted relative to the camera.
+		bool getSortingEnabled(void) const { return mSorted; }
+
+        /** Set the (initial) bounds of the particle system manually. 
+        @remarks
+            If you can, set the bounds of a particle system up-front and 
+            call setBoundsAutoUpdated(false); this is the most efficient way to
+            organise it. Otherwise, set an initial bounds and let the bounds increase
+            for a little while (the default is 5 seconds), after which time the 
+            AABB is fixed to save time.
+        @param aabb Bounds in local space.
+        */
+        void setBounds(const AxisAlignedBox& aabb);
+
+        /** Sets whether the bounds will be automatically updated
+            for the life of the particle system
+        @remarks
+            If you have a stationary particle system, it would be a good idea to
+            call this method and set the value to 'false', since the maximum
+            bounds of the particle system will eventually be static. If you do
+            this, you can either set the bounds manually using the setBounds()
+            method, or set the second parameter of this method to a positive
+            number of seconds, so that the bounds are calculated for a few
+            seconds and then frozen.
+        @param autoUpdate If true (the default), the particle system will
+            update it's bounds every frame. If false, the bounds update will 
+            cease after the 'stopIn' number of seconds have passed.
+        @param stopIn Only applicable if the first parameter is true, this is the
+            number of seconds after which the automatic update will cease.
+        */
+        void setBoundsAutoUpdated(bool autoUpdate, Real stopIn = 0.0f);
+
+		/** Sets whether particles (and any affector effects) remain relative 
+			to the node the particle system is attached to.
+		@remarks
+			By defalt particles are in world space once emitted, so they are not
+			affected by movement in the parent node of the particle system. This
+			makes the most sense when dealing with completely independent particles, 
+			but if you want to constrain them to follow local motion too, you
+			can set this to true.
+		*/
+		void setKeepParticlesInLocalSpace(bool keepLocal);
+
+		/** Gets whether particles (and any affector effects) remain relative 
+			to the node the particle system is attached to.
+		*/
+		bool getKeepParticlesInLocalSpace(void) const { return mLocalSpace; }
+
+        /** Internal method for updating the bounds of the particle system.
+        @remarks
+            This is called automatically for a period of time after the system's
+            creation (10 seconds by default, settable by setBoundsAutoUpdated) 
+            to increase (and only increase) the bounds of the system according 
+            to the emitted and affected particles. After this period, the 
+            system is assumed to achieved its maximum size, and the bounds are
+            no longer computed for efficiency. You can tweak the behaviour by 
+            either setting the bounds manually (setBounds, preferred), or 
+            changing the time over which the bounds are updated (performance cost).
+            You can also call this method manually if you need to update the 
+            bounds on an ad-hoc basis.
+        */
+        void _updateBounds(void);
+
+		/// Override to return specific type flag
+		uint32 getTypeFlags(void) const;
+    protected:
+
+        /// Command objects
+        static CmdCull msCullCmd;
+        static CmdHeight msHeightCmd;
+        static CmdMaterial msMaterialCmd;
+        static CmdQuota msQuotaCmd;
+		static CmdEmittedEmitterQuota msEmittedEmitterQuotaCmd;
+        static CmdWidth msWidthCmd;
+        static CmdRenderer msRendererCmd;
+		static CmdSorted msSortedCmd;
+		static CmdLocalSpace msLocalSpaceCmd;
+		static CmdIterationInterval msIterationIntervalCmd;
+		static CmdNonvisibleTimeout msNonvisibleTimeoutCmd;
+
+
+        AxisAlignedBox mAABB;
+        Real mBoundingRadius;
+        bool mBoundsAutoUpdate;
+        Real mBoundsUpdateTime;
+        Real mUpdateRemainTime;
+
+        /// World AABB, only used to compare world-space positions to calc bounds
+        AxisAlignedBox mWorldAABB;
+
+        /// Name of the resource group to use to load materials
+        String mResourceGroupName;
+        /// Name of the material to use
+        String mMaterialName;
+        /// Have we set the material etc on the renderer?
+        bool mIsRendererConfigured;
+        /// Pointer to the material to use
+        MaterialPtr mpMaterial;
+        /// Default width of each particle
+        Real mDefaultWidth;
+        /// Default height of each particle
+        Real mDefaultHeight;
+		/// Speed factor
+		Real mSpeedFactor;
+        /// Iteration interval
+        Real mIterationInterval;
+        /// Iteration interval set? Otherwise track default
+        bool mIterationIntervalSet;
+		/// Particles sorted according to camera?
+		bool mSorted;
+		/// Particles in local space?
+		bool mLocalSpace;
+		/// Update timeout when nonvisible (0 for no timeout)
+		Real mNonvisibleTimeout;
+		/// Update timeout when nonvisible set? Otherwise track default
+		bool mNonvisibleTimeoutSet;
+		/// Amount of time non-visible so far
+		Real mTimeSinceLastVisible;
+		/// Last frame in which known to be visible
+		unsigned long mLastVisibleFrame;
+		/// Controller for time update
+		Controller<Real>* mTimeController;
+        /// Indication whether the emitted emitter pool (= pool with particle emitters that are emitted) is initialised
+		bool mEmittedEmitterPoolInitialised;
+
+        typedef std::list<Particle*> ActiveParticleList;
+        typedef std::list<Particle*> FreeParticleList;
+        typedef std::vector<Particle*> ParticlePool;
+
+        /** Sort by direction functor */
+        struct SortByDirectionFunctor
+        {
+            /// Direction to sort in
+            Vector3 sortDir;
+
+            SortByDirectionFunctor(const Vector3& dir);
+            float operator()(Particle* p) const;
+        };
+
+        /** Sort by distance functor */
+        struct SortByDistanceFunctor
+        {
+            /// Position to sort in
+            Vector3 sortPos;
+
+            SortByDistanceFunctor(const Vector3& pos);
+            float operator()(Particle* p) const;
+        };
+
+		static RadixSort<ActiveParticleList, Particle*, float> mRadixSorter;
+
+		/** Active particle list.
+            @remarks
+                This is a linked list of pointers to particles in the particle pool.
+            @par
+                This allows very fast instertions and deletions from anywhere in 
+                the list to activate / deactivate particles as well as resuse of 
+                Particle instances in the pool without construction & destruction 
+                which avoids memory thrashing.
+        */
+        ActiveParticleList mActiveParticles;
+
+        /** Free particle queue.
+            @remarks
+                This contains a list of the particles free for use as new instances
+                as required by the set. Particle instances are preconstructed up 
+                to the estimated size in the mParticlePool vector and are 
+                referenced on this deque at startup. As they get used this list
+                reduces, as they get released back to to the set they get added
+				back to the list.
+        */
+        FreeParticleList mFreeParticles;
+
+        /** Pool of particle instances for use and reuse in the active particle list.
+            @remarks
+                This vector will be preallocated with the estimated size of the set,and will extend as required.
+        */
+        ParticlePool mParticlePool;
+
+		typedef std::list<ParticleEmitter*> FreeEmittedEmitterList;
+		typedef std::list<ParticleEmitter*> ActiveEmittedEmitterList;
+		typedef std::vector<ParticleEmitter*> EmittedEmitterList;
+		typedef std::map<String, FreeEmittedEmitterList> FreeEmittedEmitterMap;
+		typedef std::map<String, EmittedEmitterList> EmittedEmitterPool;
+
+		/** Pool of emitted emitters for use and reuse in the active emitted emitter list.
+        @remarks
+			The emitters in this pool act as particles and as emitters. The pool is a map containing lists 
+			of emitters, identified by their name.
+        @par
+            The emitters in this pool are cloned using emitters that are kept in the main emitter list
+			of the ParticleSystem.
+        */
+		EmittedEmitterPool mEmittedEmitterPool;
+
+        /** Free emitted emitter list.
+            @remarks
+                This contains a list of the emitters free for use as new instances as required by the set.
+        */
+        FreeEmittedEmitterMap mFreeEmittedEmitters;
+
+		/** Active emitted emitter list.
+            @remarks
+                This is a linked list of pointers to emitters in the emitted emitter pool.
+				Emitters that are used are stored (their pointers) in both the list with active particles and in 
+				the list with active emitted emitters.        */
+        ActiveEmittedEmitterList mActiveEmittedEmitters;
+
+		typedef std::vector<ParticleEmitter*> ParticleEmitterList;
+        typedef std::vector<ParticleAffector*> ParticleAffectorList;
+        
+        /// List of particle emitters, ie sources of particles
+        ParticleEmitterList mEmitters;
+        /// List of particle affectors, ie modifiers of particles
+        ParticleAffectorList mAffectors;
+
+        /// The renderer used to render this particle system
+        ParticleSystemRenderer* mRenderer;
+
+        /// Do we cull each particle individually?
+        bool mCullIndividual;
+
+        /// The name of the type of renderer used to render this system
+        String mRendererType;
+        
+        /// The number of particles in the pool.
+        size_t mPoolSize;
+
+        /// The number of emitted emitters in the pool.
+        size_t mEmittedEmitterPoolSize;
+
+		/// Optional origin of this particle system (eg script name)
+		String mOrigin;
+
+        /// Default iteration interval
+        static Real msDefaultIterationInterval;
+        /// Default nonvisible update timeout
+        static Real msDefaultNonvisibleTimeout;
+
+        /** Internal method used to expire dead particles. */
+        void _expire(Real timeElapsed);
+
+        /** Spawn new particles based on free quota and emitter requirements. */
+        void _triggerEmitters(Real timeElapsed);
+
+		/** Helper function that actually performs the emission of particles
+        */
+		void _executeTriggerEmitters(ParticleEmitter* emitter, unsigned requested, Real timeElapsed);
+
+		/** Updates existing particle based on their momentum. */
+        void _applyMotion(Real timeElapsed);
+
+        /** Applies the effects of affectors. */
+        void _triggerAffectors(Real timeElapsed);
+
+		/** Sort the particles in the system **/
+		void _sortParticles(Camera* cam);
+
+        /** Resize the internal pool of particles. */
+        void increasePool(size_t size);
+
+		/** Resize the internal pool of emitted emitters.
+            @remarks
+                The pool consists of multiple vectors containing pointers to particle emitters. Increasing the 
+				pool with ´size´ implies that the vectors are equally increased. The quota of emitted emitters is 
+				defined on a particle system level and not on a particle emitter level. This is to prevent that
+				the number of created emitters becomes too high; the quota is shared amongst the emitted emitters.
+		*/
+		void increaseEmittedEmitterPool(size_t size);
+
+		/** Internal method for initialising string interface. */
+        void initParameters(void);
+
+        /** Internal method to configure the renderer. */
+        void configureRenderer(void);
+
+		/// Internal method for creating ParticleVisualData instances for the pool
+		void createVisualParticles(size_t poolstart, size_t poolend);
+		/// Internal method for destroying ParticleVisualData instances for the pool
+		void destroyVisualParticles(size_t poolstart, size_t poolend);
+
+		/** Create a pool of emitted emitters and assign them to the free emitter list.
+            @remarks
+                The emitters in the pool are grouped by name. This name is the name of the base emitter in the
+				main list with particle emitters, which forms the template of the created emitted emitters.
+        */
+		void initialiseEmittedEmitters(void);
+
+		/** Determine which emitters in the Particle Systems main emitter become a template for creating an
+			pool of emitters that can be emitted.
+        */
+		void initialiseEmittedEmitterPool(void);
+
+		/** Add  emitters from the pool to the free emitted emitter queue. */
+		void addFreeEmittedEmitters(void);
+
+		/** Removes all emitted emitters from this system.	*/
+		void removeAllEmittedEmitters(void);
+
+		/** Find the list with free emitted emitters.
+            @param name The name that identifies the list with free emitted emitters.
+        */
+		FreeEmittedEmitterList* findFreeEmittedEmitter (const String& name);
+
+		/** Removes an emitter from the active emitted emitter list.
+            @remarks
+                The emitter will not be destroyed!
+            @param emitter Pointer to a particle emitter.
+        */
+		void removeFromActiveEmittedEmitters (ParticleEmitter* emitter);
+
+		/** Moves all emitted emitters from the active list to the free list
+            @remarks
+                The active emitted emitter list will not be cleared and still keeps references to the emitters!
+        */
+		void addActiveEmittedEmittersToFreeList (void);
+
+		/** This function clears all data structures that are used in combination with emitted emitters and
+		    sets the flag to indicate that the emitted emitter pool must be initialised again.
+            @remarks
+                This function should be called if new emitters are added to a ParticleSystem or deleted from a
+				ParticleSystem. The emitted emitter data structures become out of sync and need to be build up
+				again. The data structures are not reorganised in this function, but by setting a ´flag´, 
+				they are rebuild in the regular process flow.
+        */
+		void _notifyReorganiseEmittedEmitterData (void);
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgreParticleSystemManager.h
===================================================================
--- /OgreMain/include/OgreParticleSystemManager.h	(revision 5)
+++ /OgreMain/include/OgreParticleSystemManager.h	(revision 5)
@@ -0,0 +1,389 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleSystemManager_H__
+#define __ParticleSystemManager_H__
+
+
+#include "OgrePrerequisites.h"
+#include "OgreParticleSystem.h"
+#include "OgreFrameListener.h"
+#include "OgreSingleton.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreScriptLoader.h"
+#include "OgreResourceGroupManager.h"
+
+namespace Ogre {
+
+	// Forward decl
+	class ParticleSystemFactory;
+	
+    /** Manages particle systems, particle system scripts (templates) and the 
+		available emitter & affector factories.
+    @remarks
+        This singleton class is responsible for creating and managing particle 
+		systems. All particle systems must be created and destroyed using this 
+		object, although the user interface to creating them is via
+		SceneManager. Remember that like all other MovableObject
+        subclasses, ParticleSystems do not get rendered until they are 
+		attached to a SceneNode object.
+    @par
+        This class also manages factories for ParticleEmitter and 
+		ParticleAffector classes. To enable easy extensions to the types of 
+		emitters (particle sources) and affectors (particle modifiers), the
+        ParticleSystemManager lets plugins or applications register factory 
+		classes which submit new subclasses to ParticleEmitter and 
+		ParticleAffector. Ogre comes with a number of them already provided,
+        such as cone, sphere and box-shaped emitters, and simple affectors such
+	   	as constant directional force and colour faders. However using this 
+		registration process, a plugin can create any behaviour required.
+    @par
+        This class also manages the loading and parsing of particle system 
+		scripts, which are text files describing named particle system 
+		templates. Instances of particle systems using these templates can
+        then be created easily through the createParticleSystem method.
+    */
+    class _OgreExport ParticleSystemManager: 
+		public Singleton<ParticleSystemManager>, public ScriptLoader
+    {
+		friend class ParticleSystemFactory;
+	public:
+        typedef std::map<String, ParticleSystem*> ParticleTemplateMap;
+		typedef std::map<String, ParticleAffectorFactory*> ParticleAffectorFactoryMap;
+		typedef std::map<String, ParticleEmitterFactory*> ParticleEmitterFactoryMap;
+		typedef std::map<String, ParticleSystemRendererFactory*> ParticleSystemRendererFactoryMap;
+    protected:
+		OGRE_AUTO_MUTEX
+        /// Templates based on scripts
+        ParticleTemplateMap mSystemTemplates;
+        
+        /// Factories for named emitter types (can be extended using plugins)
+        ParticleEmitterFactoryMap mEmitterFactories;
+
+        /// Factories for named affector types (can be extended using plugins)
+        ParticleAffectorFactoryMap mAffectorFactories;
+
+		/// Map of renderer types to factories
+		ParticleSystemRendererFactoryMap mRendererFactories;
+
+        StringVector mScriptPatterns;
+
+		// Factory instance
+		ParticleSystemFactory* mFactory;
+
+        /** Internal script parsing method. */
+        void parseNewEmitter(const String& type, DataStreamPtr& chunk, ParticleSystem* sys);
+        /** Internal script parsing method. */
+        void parseNewAffector(const String& type, DataStreamPtr& chunk, ParticleSystem* sys);
+        /** Internal script parsing method. */
+        void parseAttrib(const String& line, ParticleSystem* sys);
+        /** Internal script parsing method. */
+        void parseEmitterAttrib(const String& line, ParticleEmitter* sys);
+        /** Internal script parsing method. */
+        void parseAffectorAttrib(const String& line, ParticleAffector* sys);
+        /** Internal script parsing method. */
+        void skipToNextCloseBrace(DataStreamPtr& chunk);
+        /** Internal script parsing method. */
+        void skipToNextOpenBrace(DataStreamPtr& chunk);
+
+		/// Internal implementation of createSystem
+        ParticleSystem* createSystemImpl(const String& name, size_t quota, 
+			const String& resourceGroup);
+		/// Internal implementation of createSystem
+        ParticleSystem* createSystemImpl(const String& name, const String& templateName);
+		/// Internal implementation of destroySystem
+        void destroySystemImpl(ParticleSystem* sys);
+		
+		
+    public:
+
+        ParticleSystemManager();
+        virtual ~ParticleSystemManager();
+
+        /** Adds a new 'factory' object for emitters to the list of available emitter types.
+        @remarks
+            This method allows plugins etc to add new particle emitter types to Ogre. Particle emitters
+            are sources of particles, and generate new particles with their start positions, colours and
+            momentums appropriately. Plugins would create new subclasses of ParticleEmitter which 
+            emit particles a certain way, and register a subclass of ParticleEmitterFactory to create them (since multiple 
+            emitters can be created for different particle systems).
+        @par
+            All particle emitter factories have an assigned name which is used to identify the emitter
+            type. This must be unique.
+        @par
+            Note that the object passed to this function will not be destroyed by the ParticleSystemManager,
+            since it may have been allocted on a different heap in the case of plugins. The caller must
+            destroy the object later on, probably on plugin shutdown.
+        @param
+            factory Pointer to a ParticleEmitterFactory subclass created by the plugin or application code.
+        */
+        void addEmitterFactory(ParticleEmitterFactory* factory);
+
+        /** Adds a new 'factory' object for affectors to the list of available affector types.
+        @remarks
+            This method allows plugins etc to add new particle affector types to Ogre. Particle
+            affectors modify the particles in a system a certain way such as affecting their direction
+            or changing their colour, lifespan etc. Plugins would
+            create new subclasses of ParticleAffector which affect particles a certain way, and register
+            a subclass of ParticleAffectorFactory to create them.
+        @par
+            All particle affector factories have an assigned name which is used to identify the affector
+            type. This must be unique.
+        @par
+            Note that the object passed to this function will not be destroyed by the ParticleSystemManager,
+            since it may have been allocted on a different heap in the case of plugins. The caller must
+            destroy the object later on, probably on plugin shutdown.
+        @param
+            factory Pointer to a ParticleAffectorFactory subclass created by the plugin or application code.
+        */
+        void addAffectorFactory(ParticleAffectorFactory* factory);
+
+		/** Registers a factory class for creating ParticleSystemRenderer instances. 
+        @par
+            Note that the object passed to this function will not be destroyed by the ParticleSystemManager,
+            since it may have been allocted on a different heap in the case of plugins. The caller must
+            destroy the object later on, probably on plugin shutdown.
+        @param
+            factory Pointer to a ParticleSystemRendererFactory subclass created by the plugin or application code.
+		*/
+		void addRendererFactory(ParticleSystemRendererFactory* factory);
+
+        /** Adds a new particle system template to the list of available templates. 
+        @remarks
+            Instances of particle systems in a scene are not normally unique - often you want to place the
+            same effect in many places. This method allows you to register a ParticleSystem as a named template,
+            which can subsequently be used to create instances using the createSystem method.
+        @par
+            Note that particle system templates can either be created programmatically by an application 
+            and registered using this method, or they can be defined in a script file (*.particle) which is
+            loaded by the engine at startup, very much like Material scripts.
+        @param
+            name The name of the template. Must be unique across all templates.
+        @param
+            sysTemplate A pointer to a particle system to be used as a template. The manager
+                will take over ownership of this pointer.
+            
+        */
+        void addTemplate(const String& name, ParticleSystem* sysTemplate);
+
+        /** Removes a specified template from the ParticleSystemManager.
+        @remarks
+            This method removes a given template from the particle system manager, optionally deleting
+            the template if the deleteTemplate method is called.  Throws an exception if the template
+            could not be found.
+        @param
+            name The name of the template to remove.
+        @param
+            deleteTemplate Whether or not to delete the template before removing it.
+        */
+        void removeTemplate(const String& name, bool deleteTemplate = true);
+
+        /** Removes a specified template from the ParticleSystemManager.
+        @remarks
+            This method removes all templates from the ParticleSystemManager.
+        @param
+            deleteTemplate Whether or not to delete the templates before removing them.
+        */
+        void removeAllTemplates(bool deleteTemplate = true);
+
+        /** Create a new particle system template. 
+        @remarks
+            This method is similar to the addTemplate method, except this just creates a new template
+            and returns a pointer to it to be populated. Use this when you don't already have a system
+            to add as a template and just want to create a new template which you will build up in-place.
+        @param
+            name The name of the template. Must be unique across all templates.
+        @param
+            resourceGroup The name of the resource group which will be used to 
+                load any dependent resources.
+            
+        */
+        ParticleSystem* createTemplate(const String& name, const String& resourceGroup);
+
+        /** Retrieves a particle system template for possible modification. 
+        @remarks
+            Modifying a template does not affect the settings on any ParticleSystems already created
+            from this template.
+        */
+        ParticleSystem* getTemplate(const String& name);
+
+        /** Internal method for creating a new emitter from a factory.
+        @remarks
+            Used internally by the engine to create new ParticleEmitter instances from named
+            factories. Applications should use the ParticleSystem::addEmitter method instead, 
+            which calls this method to create an instance.
+        @param
+            emitterType String name of the emitter type to be created. A factory of this type must have been registered.
+        @param 
+            psys The particle system this is being created for
+        */
+        ParticleEmitter* _createEmitter(const String& emitterType, ParticleSystem* psys);
+
+        /** Internal method for destroying an emitter.
+        @remarks
+            Because emitters are created by factories which may allocate memory from separate heaps,
+            the memory allocated must be freed from the same place. This method is used to ask the factory
+            to destroy the instance passed in as a pointer.
+        @param
+            emitter Pointer to emitter to be destroyed. On return this pointer will point to invalid (freed) memory.
+        */
+        void _destroyEmitter(ParticleEmitter* emitter);
+
+        /** Internal method for creating a new affector from a factory.
+        @remarks
+            Used internally by the engine to create new ParticleAffector instances from named
+            factories. Applications should use the ParticleSystem::addAffector method instead, 
+            which calls this method to create an instance.
+        @param
+            effectorType String name of the affector type to be created. A factory of this type must have been registered.
+        @param
+            psys The particle system it is being created for
+        */
+        ParticleAffector* _createAffector(const String& affectorType, ParticleSystem* psys);
+
+        /** Internal method for destroying an affector.
+        @remarks
+            Because affectors are created by factories which may allocate memory from separate heaps,
+            the memory allocated must be freed from the same place. This method is used to ask the factory
+            to destroy the instance passed in as a pointer.
+        @param
+            affector Pointer to affector to be destroyed. On return this pointer will point to invalid (freed) memory.
+        */
+        void _destroyAffector(ParticleAffector* affector);
+
+        /** Internal method for creating a new renderer from a factory.
+        @remarks
+            Used internally by the engine to create new ParticleSystemRenderer instances from named
+            factories. Applications should use the ParticleSystem::setRenderer method instead, 
+            which calls this method to create an instance.
+        @param
+            rendererType String name of the renderer type to be created. A factory of this type must have been registered.
+        */
+        ParticleSystemRenderer* _createRenderer(const String& rendererType);
+
+        /** Internal method for destroying a renderer.
+        @remarks
+            Because renderer are created by factories which may allocate memory from separate heaps,
+            the memory allocated must be freed from the same place. This method is used to ask the factory
+            to destroy the instance passed in as a pointer.
+        @param
+            renderer Pointer to renderer to be destroyed. On return this pointer will point to invalid (freed) memory.
+        */
+        void _destroyRenderer(ParticleSystemRenderer* renderer);
+
+        /** Init method to be called by OGRE system.
+        @remarks
+            Due to dependencies between various objects certain initialisation tasks cannot be done
+            on construction. OGRE will call this method when the rendering subsystem is initialised.
+        */
+        void _initialise(void);
+
+        /// @copydoc ScriptLoader::getScriptPatterns
+        const StringVector& getScriptPatterns(void) const;
+        /// @copydoc ScriptLoader::parseScript
+        void parseScript(DataStreamPtr& stream, const String& groupName);
+        /// @copydoc ScriptLoader::getLoadingOrder
+        Real getLoadingOrder(void) const;
+
+		typedef MapIterator<ParticleAffectorFactoryMap> ParticleAffectorFactoryIterator;
+		typedef MapIterator<ParticleEmitterFactoryMap> ParticleEmitterFactoryIterator;
+		typedef MapIterator<ParticleSystemRendererFactoryMap> ParticleRendererFactoryIterator;
+		/** Return an iterator over the affector factories currently registered */
+		ParticleAffectorFactoryIterator getAffectorFactoryIterator(void);
+		/** Return an iterator over the emitter factories currently registered */
+		ParticleEmitterFactoryIterator getEmitterFactoryIterator(void);
+		/** Return an iterator over the renderer factories currently registered */
+		ParticleRendererFactoryIterator getRendererFactoryIterator(void);
+
+
+        typedef MapIterator<ParticleTemplateMap> ParticleSystemTemplateIterator;
+        /** Gets an iterator over the list of particle system templates. */
+        ParticleSystemTemplateIterator getTemplateIterator(void)
+        {
+            return ParticleSystemTemplateIterator(
+                mSystemTemplates.begin(), mSystemTemplates.end());
+        } 
+
+        /** Get an instance of ParticleSystemFactory (internal use). */
+		ParticleSystemFactory* _getFactory(void) { return mFactory; }
+		
+		/** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static ParticleSystemManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static ParticleSystemManager* getSingletonPtr(void);
+
+    };
+
+	/** Factory object for creating ParticleSystem instances */
+	class _OgreExport ParticleSystemFactory : public MovableObjectFactory
+	{
+	protected:
+		MovableObject* createInstanceImpl(const String& name, const NameValuePairList* params);
+	public:
+		ParticleSystemFactory() {}
+		~ParticleSystemFactory() {}
+		
+		static String FACTORY_TYPE_NAME;
+
+		const String& getType(void) const;
+		void destroyInstance( MovableObject* obj);  
+
+	};
+	
+}
+
+#endif
+
Index: /OgreMain/include/OgreParticleSystemRenderer.h
===================================================================
--- /OgreMain/include/OgreParticleSystemRenderer.h	(revision 5)
+++ /OgreMain/include/OgreParticleSystemRenderer.h	(revision 5)
@@ -0,0 +1,124 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleSystemRenderer_H__
+#define __ParticleSystemRenderer_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreStringInterface.h"
+#include "OgreFactoryObj.h"
+#include "OgreRenderQueue.h"
+#include "OgreCommon.h"
+
+namespace Ogre {
+
+    /** Abstract class defining the interface required to be implemented
+        by classes which provide rendering capability to ParticleSystem instances.
+    */
+    class _OgreExport ParticleSystemRenderer : public StringInterface
+    {
+    public:
+        /// Constructor
+        ParticleSystemRenderer() {}
+        /// Destructor
+        virtual ~ParticleSystemRenderer() {}
+
+        /** Gets the type of this renderer - must be implemented by subclasses */
+		virtual const String& getType(void) const = 0;
+
+		/** Delegated to by ParticleSystem::_updateRenderQueue
+        @remarks
+            The subclass must update the render queue using whichever Renderable
+            instance(s) it wishes.
+        */
+        virtual void _updateRenderQueue(RenderQueue* queue, 
+            std::list<Particle*>& currentParticles, bool cullIndividually) = 0;
+
+        /** Sets the material this renderer must use; called by ParticleSystem. */
+        virtual void _setMaterial(MaterialPtr& mat) = 0;
+        /** Delegated to by ParticleSystem::_notifyCurrentCamera */
+        virtual void _notifyCurrentCamera(Camera* cam) = 0;
+        /** Delegated to by ParticleSystem::_notifyAttached */
+        virtual void _notifyAttached(Node* parent, bool isTagPoint = false) = 0;
+        /** Optional callback notified when particles are rotated */
+        virtual void _notifyParticleRotated(void) {}
+        /** Optional callback notified when particles are resized individually */
+        virtual void _notifyParticleResized(void) {}
+        /** Tells the renderer that the particle quota has changed */
+        virtual void _notifyParticleQuota(size_t quota) = 0;
+        /** Tells the renderer that the particle default size has changed */
+        virtual void _notifyDefaultDimensions(Real width, Real height) = 0;
+        /** Optional callback notified when particle emitted */
+        virtual void _notifyParticleEmitted(Particle* particle) {}
+        /** Optional callback notified when particle expired */
+        virtual void _notifyParticleExpired(Particle* particle) {}
+        /** Optional callback notified when particles moved */
+        virtual void _notifyParticleMoved(std::list<Particle*>& currentParticles) {}
+        /** Optional callback notified when particles cleared */
+        virtual void _notifyParticleCleared(std::list<Particle*>& currentParticles) {}
+		/** Create a new ParticleVisualData instance for attachment to a particle.
+		@remarks
+			If this renderer needs additional data in each particle, then this should
+			be held in an instance of a subclass of ParticleVisualData, and this method
+			should be overridden to return a new instance of it. The default
+			behaviour is to return null.
+		*/
+		virtual ParticleVisualData* _createVisualData(void) { return 0; }
+		/** Destroy a ParticleVisualData instance.
+		@remarks
+			If this renderer needs additional data in each particle, then this should
+			be held in an instance of a subclass of ParticleVisualData, and this method
+			should be overridden to destroy an instance of it. The default
+			behaviour is to do nothing.
+		*/
+		virtual void _destroyVisualData(ParticleVisualData* vis) { assert (vis == 0); }
+
+		/** Sets which render queue group this renderer should target with it's
+			output.
+		*/
+		virtual void setRenderQueueGroup(uint8 queueID) = 0;
+
+		/** Setting carried over from ParticleSystem.
+		*/
+		virtual void setKeepParticlesInLocalSpace(bool keepLocal) = 0;
+
+        /** Gets the desired particles sort mode of this renderer */
+        virtual SortMode _getSortMode(void) const = 0;
+
+    };
+
+    /** Abstract class definition of a factory object for ParticleSystemRenderer. */
+    class _OgreExport ParticleSystemRendererFactory : public FactoryObj<ParticleSystemRenderer>
+    {
+    public:
+        // No methods, must just override all methods inherited from FactoryObj
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgrePass.h
===================================================================
--- /OgreMain/include/OgrePass.h	(revision 5)
+++ /OgreMain/include/OgrePass.h	(revision 5)
@@ -0,0 +1,1321 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Pass_H__
+#define __Pass_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreGpuProgram.h"
+#include "OgreColourValue.h"
+#include "OgreBlendMode.h"
+#include "OgreCommon.h"
+#include "OgreLight.h"
+#include "OgreTextureUnitState.h"
+
+namespace Ogre {
+    /** Class defining a single pass of a Technique (of a Material), ie
+        a single rendering call.
+    @remarks
+        Rendering can be repeated with many passes for more complex effects.
+        Each pass is either a fixed-function pass (meaning it does not use
+        a vertex or fragment program) or a programmable pass (meaning it does
+        use either a vertex and fragment program, or both).
+    @par
+        Programmable passes are complex to define, because they require custom
+        programs and you have to set all constant inputs to the programs (like
+        the position of lights, any base material colours you wish to use etc), but
+        they do give you much total flexibility over the algorithms used to render your
+        pass, and you can create some effects which are impossible with a fixed-function pass.
+        On the other hand, you can define a fixed-function pass in very little time, and
+        you can use a range of fixed-function effects like environment mapping very
+        easily, plus your pass will be more likely to be compatible with older hardware.
+        There are pros and cons to both, just remember that if you use a programmable
+        pass to create some great effects, allow more time for definition and testing.
+    */
+    class _OgreExport Pass
+    {
+	public:
+		/** Definition of a functor for calculating the hashcode of a Pass.
+		@remarks
+			The hashcode of a Pass is used to sort Passes for rendering, in order
+			to reduce the number of render state changes. Each Pass represents a
+			single unique set of states, but by ordering them, state changes can
+			be minimised between passes. An implementation of this functor should
+			order passes so that the elements that you want to keep constant are
+			sorted next to each other.
+		@see Pass::setHashFunc
+		*/
+		struct HashFunc
+		{
+			virtual uint32 operator()(const Pass* p) const = 0;
+			/// Need virtual destructor in case subclasses use it
+			virtual ~HashFunc() {}
+		};
+    protected:
+        Technique* mParent;
+        unsigned short mIndex; // pass index
+        String mName; // optional name for the pass
+        uint32 mHash; // pass hash
+        //-------------------------------------------------------------------------
+        // Colour properties, only applicable in fixed-function passes
+        ColourValue mAmbient;
+        ColourValue mDiffuse;
+        ColourValue mSpecular;
+        ColourValue mEmissive;
+        Real mShininess;
+        TrackVertexColourType mTracking;
+        //-------------------------------------------------------------------------
+
+        //-------------------------------------------------------------------------
+        // Blending factors
+        SceneBlendFactor mSourceBlendFactor;
+        SceneBlendFactor mDestBlendFactor;
+        //-------------------------------------------------------------------------
+
+        //-------------------------------------------------------------------------
+        // Depth buffer settings
+        bool mDepthCheck;
+        bool mDepthWrite;
+        CompareFunction mDepthFunc;
+        float mDepthBiasConstant;
+		float mDepthBiasSlopeScale;
+
+        // Colour buffer settings
+        bool mColourWrite;
+
+		// Alpha reject settings
+		CompareFunction mAlphaRejectFunc;
+		unsigned char mAlphaRejectVal;
+        //-------------------------------------------------------------------------
+
+        //-------------------------------------------------------------------------
+        // Culling mode
+        CullingMode mCullMode;
+        ManualCullingMode mManualCullMode;
+        //-------------------------------------------------------------------------
+
+        /// Lighting enabled?
+        bool mLightingEnabled;
+        /// Max simultaneous lights
+        unsigned short mMaxSimultaneousLights;
+		/// Starting light index
+		unsigned short mStartLight;
+		/// Run this pass once per light?
+		bool mIteratePerLight;
+		/// Iterate per how many lights?
+		unsigned short mLightsPerIteration;
+        // Should it only be run for a certain light type?
+        bool mRunOnlyForOneLightType;
+        Light::LightTypes mOnlyLightType;
+
+        /// Shading options
+        ShadeOptions mShadeOptions;
+		/// Polygon mode
+		PolygonMode mPolygonMode;
+
+        //-------------------------------------------------------------------------
+        // Fog
+        bool mFogOverride;
+        FogMode mFogMode;
+        ColourValue mFogColour;
+        Real mFogStart;
+        Real mFogEnd;
+        Real mFogDensity;
+        //-------------------------------------------------------------------------
+
+        /// Storage of texture unit states
+        typedef std::vector<TextureUnitState*> TextureUnitStates;
+        TextureUnitStates mTextureUnitStates;
+
+		// Vertex program details
+		GpuProgramUsage *mVertexProgramUsage;
+        // Vertex program details
+        GpuProgramUsage *mShadowCasterVertexProgramUsage;
+        // Vertex program details
+        GpuProgramUsage *mShadowReceiverVertexProgramUsage;
+		// Fragment program details
+		GpuProgramUsage *mFragmentProgramUsage;
+		// Fragment program details
+		GpuProgramUsage *mShadowReceiverFragmentProgramUsage;
+        // Is this pass queued for deletion?
+        bool mQueuedForDeletion;
+        // number of pass iterations to perform
+        size_t mPassIterationCount;
+		// point size, applies when not using per-vertex point size
+		Real mPointSize;
+		Real mPointMinSize;
+		Real mPointMaxSize;
+		bool mPointSpritesEnabled;
+		bool mPointAttenuationEnabled;
+		// constant, linear, quadratic coeffs
+		Real mPointAttenuationCoeffs[3];
+		// TU Content type lookups
+		typedef std::vector<unsigned short> ContentTypeLookup;
+		mutable ContentTypeLookup mShadowContentTypeLookup;
+		mutable bool mContentTypeLookupBuilt;
+
+	public:
+		typedef std::set<Pass*> PassSet;
+    protected:
+		/// List of Passes whose hashes need recalculating
+		static PassSet msDirtyHashList;
+        /// The place where passes go to die
+        static PassSet msPassGraveyard;
+		/// The Pass hash functor
+		static HashFunc* msHashFunc;
+    public:
+		OGRE_STATIC_MUTEX(msDirtyHashListMutex);
+		OGRE_STATIC_MUTEX(msPassGraveyardMutex);
+        /// Default constructor
+		Pass(Technique* parent, unsigned short index);
+        /// Copy constructor
+        Pass(Technique* parent, unsigned short index, const Pass& oth );
+        /// Operator = overload
+        Pass& operator=(const Pass& oth);
+        ~Pass();
+
+        /// Returns true if this pass is programmable ie includes either a vertex or fragment program.
+        bool isProgrammable(void) const { return mVertexProgramUsage || mFragmentProgramUsage; }
+        /// Returns true if this pass uses a programmable vertex pipeline
+        bool hasVertexProgram(void) const { return mVertexProgramUsage != NULL; }
+        /// Returns true if this pass uses a programmable fragment pipeline
+        bool hasFragmentProgram(void) const { return mFragmentProgramUsage != NULL; }
+        /// Returns true if this pass uses a shadow caster vertex program
+        bool hasShadowCasterVertexProgram(void) const { return mShadowCasterVertexProgramUsage != NULL; }
+        /// Returns true if this pass uses a shadow receiver vertex program
+        bool hasShadowReceiverVertexProgram(void) const { return mShadowReceiverVertexProgramUsage != NULL; }
+        /// Returns true if this pass uses a shadow receiver fragment program
+        bool hasShadowReceiverFragmentProgram(void) const { return mShadowReceiverFragmentProgramUsage != NULL; }
+
+
+        /// Gets the index of this Pass in the parent Technique
+        unsigned short getIndex(void) const { return mIndex; }
+        /* Set the name of the pass
+        @remarks
+        The name of the pass is optional.  Its usefull in material scripts where a material could inherit
+        from another material and only want to modify a particalar pass.
+        */
+        void setName(const String& name);
+        /// get the name of the pass
+        const String& getName(void) const { return mName; }
+
+        /** Sets the ambient colour reflectance properties of this pass.
+        @remarks
+        The base colour of a pass is determined by how much red, green and blue light is reflects
+        (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
+        much ambient light (directionless global light) is reflected. The default is full white, meaning
+        objects are completely globally illuminated. Reduce this if you want to see diffuse or specular light
+        effects, or change the blend of colours to make the object have a base colour other than white.
+        @note
+        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+        or if this is a programmable pass.
+        */
+        void setAmbient(Real red, Real green, Real blue);
+
+        /** Sets the ambient colour reflectance properties of this pass.
+        @remarks
+        The base colour of a pass is determined by how much red, green and blue light is reflects
+        (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
+        much ambient light (directionless global light) is reflected. The default is full white, meaning
+        objects are completely globally illuminated. Reduce this if you want to see diffuse or specular light
+        effects, or change the blend of colours to make the object have a base colour other than white.
+        @note
+        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+        or if this is a programmable pass.
+        */
+
+        void setAmbient(const ColourValue& ambient);
+
+        /** Sets the diffuse colour reflectance properties of this pass.
+        @remarks
+        The base colour of a pass is determined by how much red, green and blue light is reflects
+        (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
+        much diffuse light (light from instances of the Light class in the scene) is reflected. The default
+        is full white, meaning objects reflect the maximum white light they can from Light objects.
+        @note
+        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+        or if this is a programmable pass.
+        */
+        void setDiffuse(Real red, Real green, Real blue, Real alpha);
+
+        /** Sets the diffuse colour reflectance properties of this pass.
+        @remarks
+        The base colour of a pass is determined by how much red, green and blue light is reflects
+        (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
+        much diffuse light (light from instances of the Light class in the scene) is reflected. The default
+        is full white, meaning objects reflect the maximum white light they can from Light objects.
+        @note
+        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+        or if this is a programmable pass.
+        */
+        void setDiffuse(const ColourValue& diffuse);
+
+        /** Sets the specular colour reflectance properties of this pass.
+        @remarks
+        The base colour of a pass is determined by how much red, green and blue light is reflects
+        (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
+        much specular light (highlights from instances of the Light class in the scene) is reflected.
+        The default is to reflect no specular light.
+        @note
+        The size of the specular highlights is determined by the separate 'shininess' property.
+        @note
+        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+        or if this is a programmable pass.
+        */
+        void setSpecular(Real red, Real green, Real blue, Real alpha);
+
+        /** Sets the specular colour reflectance properties of this pass.
+        @remarks
+        The base colour of a pass is determined by how much red, green and blue light is reflects
+        (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
+        much specular light (highlights from instances of the Light class in the scene) is reflected.
+        The default is to reflect no specular light.
+        @note
+        The size of the specular highlights is determined by the separate 'shininess' property.
+        @note
+        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+        or if this is a programmable pass.
+        */
+        void setSpecular(const ColourValue& specular);
+
+        /** Sets the shininess of the pass, affecting the size of specular highlights.
+        @note
+        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+        or if this is a programmable pass.
+        */
+        void setShininess(Real val);
+
+        /** Sets the amount of self-illumination an object has.
+        @remarks
+        If an object is self-illuminating, it does not need external sources to light it, ambient or
+        otherwise. It's like the object has it's own personal ambient light. This property is rarely useful since
+        you can already specify per-pass ambient light, but is here for completeness.
+        @note
+        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+        or if this is a programmable pass.
+        */
+        void setSelfIllumination(Real red, Real green, Real blue);
+
+        /** Sets the amount of self-illumination an object has.
+        @remarks
+        If an object is self-illuminating, it does not need external sources to light it, ambient or
+        otherwise. It's like the object has it's own personal ambient light. This property is rarely useful since
+        you can already specify per-pass ambient light, but is here for completeness.
+        @note
+        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+        or if this is a programmable pass.
+        */
+        void setSelfIllumination(const ColourValue& selfIllum);
+
+        /** Sets which material properties follow the vertex colour
+         */
+        void setVertexColourTracking(TrackVertexColourType tracking);
+
+        /** Gets the point size of the pass.
+		@remarks
+			This property determines what point size is used to render a point
+			list.
+        */
+        Real getPointSize(void) const;
+
+		/** Sets the point size of this pass.
+		@remarks
+			This setting allows you to change the size of points when rendering
+			a point list, or a list of point sprites. The interpretation of this
+			command depends on the Pass::setPointSizeAttenuation option - if it
+			is off (the default), the point size is in screen pixels, if it is on,
+			it expressed as normalised screen coordinates (1.0 is the height of
+			the screen) when the point is at the origin.
+		@note
+			Some drivers have an upper limit on the size of points they support
+			- this can even vary between APIs on the same card! Don't rely on
+			point sizes that cause the point sprites to get very large on screen,
+			since they may get clamped on some cards. Upper sizes can range from
+			64 to 256 pixels.
+		*/
+		void setPointSize(Real ps);
+
+		/** Sets whether or not rendering points using OT_POINT_LIST will
+			render point sprites (textured quads) or plain points (dots).
+		@param enabled True enables point sprites, false returns to normal
+			point rendering.
+		*/
+		void setPointSpritesEnabled(bool enabled);
+
+		/** Returns whether point sprites are enabled when rendering a
+			point list.
+		*/
+		bool getPointSpritesEnabled(void) const;
+
+		/** Sets how points are attenuated with distance.
+		@remarks
+			When performing point rendering or point sprite rendering,
+			point size can be attenuated with distance. The equation for
+			doing this is attenuation = 1 / (constant + linear * dist + quadratic * d^2).
+		@par
+			For example, to disable distance attenuation (constant screensize)
+			you would set constant to 1, and linear and quadratic to 0. A
+			standard perspective attenuation would be 0, 1, 0 respectively.
+		@note
+			The resulting size is clamped to the minimum and maximum point
+			size.
+		@param enabled Whether point attenuation is enabled
+		@param constant, linear, quadratic Parameters to the attentuation
+			function defined above
+		*/
+		void setPointAttenuation(bool enabled,
+			Real constant = 0.0f, Real linear = 1.0f, Real quadratic = 0.0f);
+
+		/** Returns whether points are attenuated with distance. */
+		bool isPointAttenuationEnabled(void) const;
+
+		/** Returns the constant coefficient of point attenuation. */
+		Real getPointAttenuationConstant(void) const;
+		/** Returns the linear coefficient of point attenuation. */
+		Real getPointAttenuationLinear(void) const;
+		/** Returns the quadratic coefficient of point attenuation. */
+		Real getPointAttenuationQuadratic(void) const;
+
+		/** Set the minimum point size, when point attenuation is in use. */
+		void setPointMinSize(Real min);
+		/** Get the minimum point size, when point attenuation is in use. */
+		Real getPointMinSize(void) const;
+		/** Set the maximum point size, when point attenuation is in use.
+		@remarks Setting this to 0 indicates the max size supported by the card.
+		*/
+		void setPointMaxSize(Real max);
+		/** Get the maximum point size, when point attenuation is in use.
+		@remarks 0 indicates the max size supported by the card.
+		*/
+		Real getPointMaxSize(void) const;
+
+		/** Gets the ambient colour reflectance of the pass.
+        */
+        const ColourValue& getAmbient(void) const;
+
+        /** Gets the diffuse colour reflectance of the pass.
+        */
+        const ColourValue& getDiffuse(void) const;
+
+        /** Gets the specular colour reflectance of the pass.
+        */
+        const ColourValue& getSpecular(void) const;
+
+        /** Gets the self illumination colour of the pass.
+        */
+        const ColourValue& getSelfIllumination(void) const;
+
+        /** Gets the 'shininess' property of the pass (affects specular highlights).
+        */
+        Real getShininess(void) const;
+
+        /** Gets which material properties follow the vertex colour
+         */
+        TrackVertexColourType getVertexColourTracking(void) const;
+
+        /** Inserts a new TextureUnitState object into the Pass.
+        @remarks
+        This unit is is added on top of all previous units.
+        */
+        TextureUnitState* createTextureUnitState(void);
+        /** Inserts a new TextureUnitState object into the Pass.
+        @remarks
+        This unit is is added on top of all previous units.
+        @param
+        name The basic name of the texture e.g. brickwall.jpg, stonefloor.png
+        @param
+        texCoordSet The index of the texture coordinate set to use.
+        @note
+        Applies to both fixed-function and programmable passes.
+        */
+        TextureUnitState* createTextureUnitState( const String& textureName, unsigned short texCoordSet = 0);
+		/** Adds the passed in TextureUnitState, to the existing Pass.
+        @param
+        state The Texture Unit State to be attached to this pass.  It must not be attached to another pass.
+        @note
+            Throws an exception if the TextureUnitState is attached to another Pass.*/
+		void addTextureUnitState(TextureUnitState* state);
+        /** Retrieves a pointer to a texture unit state so it may be modified.
+        */
+        TextureUnitState* getTextureUnitState(unsigned short index);
+        /** Retrieves the Texture Unit State matching name.
+            Returns 0 if name match is not found.
+        */
+        TextureUnitState* getTextureUnitState(const String& name);
+		/** Retrieves a const pointer to a texture unit state.
+		*/
+		const TextureUnitState* getTextureUnitState(unsigned short index) const;
+		/** Retrieves the Texture Unit State matching name.
+		Returns 0 if name match is not found.
+		*/
+		const TextureUnitState* getTextureUnitState(const String& name) const;
+
+        /**  Retrieve the index of the Texture Unit State in the pass.
+        @param
+        state The Texture Unit State this is attached to this pass.
+        @note
+            Throws an exception if the state is not attached to the pass.
+        */
+        unsigned short getTextureUnitStateIndex(const TextureUnitState* state) const;
+
+        typedef VectorIterator<TextureUnitStates> TextureUnitStateIterator;
+        /** Get an iterator over the TextureUnitStates contained in this Pass. */
+        TextureUnitStateIterator getTextureUnitStateIterator(void);
+
+		typedef ConstVectorIterator<TextureUnitStates> ConstTextureUnitStateIterator;
+		/** Get an iterator over the TextureUnitStates contained in this Pass. */
+		ConstTextureUnitStateIterator getTextureUnitStateIterator(void) const;
+
+		/** Removes the indexed texture unit state from this pass.
+        @remarks
+            Note that removing a texture which is not the topmost will have a larger performance impact.
+        */
+        void removeTextureUnitState(unsigned short index);
+
+        /** Removes all texture unit settings.
+        */
+        void removeAllTextureUnitStates(void);
+
+        /** Returns the number of texture unit settings.
+        */
+        unsigned short getNumTextureUnitStates(void) const
+        {
+            return static_cast<unsigned short>(mTextureUnitStates.size());
+        }
+
+        /** Sets the kind of blending this pass has with the existing contents of the scene.
+        @remarks
+        Wheras the texture blending operations seen in the TextureUnitState class are concerned with
+        blending between texture layers, this blending is about combining the output of the Pass
+        as a whole with the existing contents of the rendering target. This blending therefore allows
+        object transparency and other special effects. If all passes in a technique have a scene
+        blend, then the whole technique is considered to be transparent.
+        @par
+        This method allows you to select one of a number of predefined blending types. If you require more
+        control than this, use the alternative version of this method which allows you to specify source and
+        destination blend factors.
+        @note
+        This method is applicable for both the fixed-function and programmable pipelines.
+        @param
+        sbt One of the predefined SceneBlendType blending types
+        */
+        void setSceneBlending( const SceneBlendType sbt );
+
+        /** Allows very fine control of blending this Pass with the existing contents of the scene.
+        @remarks
+        Wheras the texture blending operations seen in the TextureUnitState class are concerned with
+        blending between texture layers, this blending is about combining the output of the material
+        as a whole with the existing contents of the rendering target. This blending therefore allows
+        object transparency and other special effects.
+        @par
+        This version of the method allows complete control over the blending operation, by specifying the
+        source and destination blending factors. The result of the blending operation is:
+        <span align="center">
+        final = (texture * sourceFactor) + (pixel * destFactor)
+        </span>
+        @par
+        Each of the factors is specified as one of a number of options, as specified in the SceneBlendFactor
+        enumerated type.
+        @param
+        sourceFactor The source factor in the above calculation, i.e. multiplied by the texture colour components.
+        @param
+        destFactor The destination factor in the above calculation, i.e. multiplied by the pixel colour components.
+        @note
+        This method is applicable for both the fixed-function and programmable pipelines.
+        */
+        void setSceneBlending( const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor);
+
+        /** Retrieves the source blending factor for the material (as set using Materiall::setSceneBlending).
+        */
+        SceneBlendFactor getSourceBlendFactor() const;
+
+        /** Retrieves the destination blending factor for the material (as set using Materiall::setSceneBlending).
+        */
+        SceneBlendFactor getDestBlendFactor() const;
+
+		/** Returns true if this pass has some element of transparency. */
+		bool isTransparent(void) const;
+
+		/** Sets whether or not this pass renders with depth-buffer checking on or not.
+        @remarks
+        If depth-buffer checking is on, whenever a pixel is about to be written to the frame buffer
+        the depth buffer is checked to see if the pixel is in front of all other pixels written at that
+        point. If not, the pixel is not written.
+        @par
+        If depth checking is off, pixels are written no matter what has been rendered before.
+        Also see setDepthFunction for more advanced depth check configuration.
+        @see
+        setDepthFunction
+        */
+        void setDepthCheckEnabled(bool enabled);
+
+        /** Returns whether or not this pass renders with depth-buffer checking on or not.
+        @see
+        setDepthCheckEnabled
+        */
+        bool getDepthCheckEnabled(void) const;
+
+        /** Sets whether or not this pass renders with depth-buffer writing on or not.
+        @remarks
+        If depth-buffer writing is on, whenever a pixel is written to the frame buffer
+        the depth buffer is updated with the depth value of that new pixel, thus affecting future
+        rendering operations if future pixels are behind this one.
+        @par
+        If depth writing is off, pixels are written without updating the depth buffer Depth writing should
+        normally be on but can be turned off when rendering static backgrounds or when rendering a collection
+        of transparent objects at the end of a scene so that they overlap each other correctly.
+        */
+        void setDepthWriteEnabled(bool enabled);
+
+        /** Returns whether or not this pass renders with depth-buffer writing on or not.
+        @see
+        setDepthWriteEnabled
+        */
+        bool getDepthWriteEnabled(void) const;
+
+        /** Sets the function used to compare depth values when depth checking is on.
+        @remarks
+        If depth checking is enabled (see setDepthCheckEnabled) a comparison occurs between the depth
+        value of the pixel to be written and the current contents of the buffer. This comparison is
+        normally CMPF_LESS_EQUAL, i.e. the pixel is written if it is closer (or at the same distance)
+        than the current contents. If you wish you can change this comparison using this method.
+        */
+        void setDepthFunction( CompareFunction func );
+        /** Returns the function used to compare depth values when depth checking is on.
+        @see
+        setDepthFunction
+        */
+        CompareFunction getDepthFunction(void) const;
+
+		/** Sets whether or not colour buffer writing is enabled for this Pass.
+		@remarks
+			For some effects, you might wish to turn off the colour write operation
+			when rendering geometry; this means that only the depth buffer will be
+			updated (provided you have depth buffer writing enabled, which you
+			probably will do, although you may wish to only update the stencil
+			buffer for example - stencil buffer state is managed at the RenderSystem
+			level only, not the Material since you are likely to want to manage it
+			at a higher level).
+		*/
+		void setColourWriteEnabled(bool enabled);
+		/** Determines if colour buffer writing is enabled for this pass. */
+		bool getColourWriteEnabled(void) const;
+
+        /** Sets the culling mode for this pass  based on the 'vertex winding'.
+        @remarks
+        A typical way for the rendering engine to cull triangles is based on the 'vertex winding' of
+        triangles. Vertex winding refers to the direction in which the vertices are passed or indexed
+        to in the rendering operation as viewed from the camera, and will wither be clockwise or
+        anticlockwise (that's 'counterclockwise' for you Americans out there ;) The default is
+        CULL_CLOCKWISE i.e. that only triangles whose vertices are passed/indexed in anticlockwise order
+        are rendered - this is a common approach and is used in 3D studio models for example. You can
+        alter this culling mode if you wish but it is not advised unless you know what you are doing.
+        @par
+        You may wish to use the CULL_NONE option for mesh data that you cull yourself where the vertex
+        winding is uncertain.
+        */
+        void setCullingMode( CullingMode mode );
+
+        /** Returns the culling mode for geometry rendered with this pass. See setCullingMode for more information.
+        */
+        CullingMode getCullingMode(void) const;
+
+        /** Sets the manual culling mode, performed by CPU rather than hardware.
+        @pemarks
+        In some situations you want to use manual culling of triangles rather than sending the
+        triangles to the hardware and letting it cull them. This setting only takes effect on SceneManager's
+        that use it (since it is best used on large groups of planar world geometry rather than on movable
+        geometry since this would be expensive), but if used can cull geometry before it is sent to the
+        hardware.
+        @note
+        The default for this setting is MANUAL_CULL_BACK.
+        @param
+        mode The mode to use - see enum ManualCullingMode for details
+
+        */
+        void setManualCullingMode( ManualCullingMode mode );
+
+        /** Retrieves the manual culling mode for this pass
+        @see
+        setManualCullingMode
+        */
+        ManualCullingMode getManualCullingMode(void) const;
+
+        /** Sets whether or not dynamic lighting is enabled.
+        @param
+        enabled
+        If true, dynamic lighting is performed on geometry with normals supplied, geometry without
+        normals will not be displayed.
+        @par
+        If false, no lighting is applied and all geometry will be full brightness.
+        */
+        void setLightingEnabled(bool enabled);
+
+        /** Returns whether or not dynamic lighting is enabled.
+        */
+        bool getLightingEnabled(void) const;
+
+        /** Sets the maximum number of lights to be used by this pass.
+        @remarks
+            During rendering, if lighting is enabled (or if the pass uses an automatic
+            program parameter based on a light) the engine will request the nearest lights
+            to the object being rendered in order to work out which ones to use. This
+            parameter sets the limit on the number of lights which should apply to objects
+            rendered with this pass.
+        */
+        void setMaxSimultaneousLights(unsigned short maxLights);
+        /** Gets the maximum number of lights to be used by this pass. */
+        unsigned short getMaxSimultaneousLights(void) const;
+
+		/** Sets the light index that this pass will start at in the light list.
+		@remarks
+			Normally the lights passed to a pass will start from the beginning
+			of the light list for this object. This option allows you to make this
+			pass start from a higher light index, for example if one of your earlier
+			passes could deal with lights 0-3, and this pass dealt with lights 4+. 
+			This option also has an interaction with pass iteration, in that
+			if you choose to iterate this pass per light too, the iteration will
+			only begin from light 4.
+		*/
+		void setStartLight(unsigned short startLight);
+		/** Gets the light index that this pass will start at in the light list. */
+		unsigned short getStartLight(void) const;
+
+        /** Sets the type of light shading required
+        @note
+        The default shading method is Gouraud shading.
+        */
+        void setShadingMode( ShadeOptions mode );
+
+        /** Returns the type of light shading to be used.
+        */
+        ShadeOptions getShadingMode(void) const;
+
+		/** Sets the type of polygon rendering required
+		@note
+		The default shading method is Solid
+		*/
+		void setPolygonMode( PolygonMode mode );
+
+		/** Returns the type of light shading to be used.
+		*/
+		PolygonMode getPolygonMode(void) const;
+
+        /** Sets the fogging mode applied to this pass.
+        @remarks
+        Fogging is an effect that is applied as polys are rendered. Sometimes, you want
+        fog to be applied to an entire scene. Other times, you want it to be applied to a few
+        polygons only. This pass-level specification of fog parameters lets you easily manage
+        both.
+        @par
+        The SceneManager class also has a setFog method which applies scene-level fog. This method
+        lets you change the fog behaviour for this pass compared to the standard scene-level fog.
+        @param
+        overrideScene If true, you authorise this pass to override the scene's fog params with it's own settings.
+        If you specify false, so other parameters are necessary, and this is the default behaviour for passs.
+        @param
+        mode Only applicable if overrideScene is true. You can disable fog which is turned on for the
+        rest of the scene by specifying FOG_NONE. Otherwise, set a pass-specific fog mode as
+        defined in the enum FogMode.
+        @param
+        colour The colour of the fog. Either set this to the same as your viewport background colour,
+        or to blend in with a skydome or skybox.
+        @param
+        expDensity The density of the fog in FOG_EXP or FOG_EXP2 mode, as a value between 0 and 1.
+        The default is 0.001.
+        @param
+        linearStart Distance in world units at which linear fog starts to encroach.
+        Only applicable if mode is FOG_LINEAR.
+        @param
+        linearEnd Distance in world units at which linear fog becomes completely opaque.
+        Only applicable if mode is FOG_LINEAR.
+        */
+        void setFog(
+            bool overrideScene,
+            FogMode mode = FOG_NONE,
+            const ColourValue& colour = ColourValue::White,
+            Real expDensity = 0.001, Real linearStart = 0.0, Real linearEnd = 1.0 );
+
+        /** Returns true if this pass is to override the scene fog settings.
+        */
+        bool getFogOverride(void) const;
+
+        /** Returns the fog mode for this pass.
+        @note
+        Only valid if getFogOverride is true.
+        */
+        FogMode getFogMode(void) const;
+
+        /** Returns the fog colour for the scene.
+        */
+        const ColourValue& getFogColour(void) const;
+
+        /** Returns the fog start distance for this pass.
+        @note
+        Only valid if getFogOverride is true.
+        */
+        Real getFogStart(void) const;
+
+        /** Returns the fog end distance for this pass.
+        @note
+        Only valid if getFogOverride is true.
+        */
+        Real getFogEnd(void) const;
+
+        /** Returns the fog density for this pass.
+        @note
+        Only valid if getFogOverride is true.
+        */
+        Real getFogDensity(void) const;
+
+        /** Sets the depth bias to be used for this material.
+        @remarks
+        When polygons are coplanar, you can get problems with 'depth fighting' where
+        the pixels from the two polys compete for the same screen pixel. This is particularly
+        a problem for decals (polys attached to another surface to represent details such as
+        bulletholes etc.).
+        @par
+        A way to combat this problem is to use a depth bias to adjust the depth buffer value
+        used for the decal such that it is slightly higher than the true value, ensuring that
+        the decal appears on top. There are two aspects to the biasing, a constant
+		bias value and a slope-relative biasing value, which varies according to the
+		maximum depth slope relative to the camera, ie:
+		<pre>finalBias = maxSlope * slopeScaleBias + constantBias</pre>
+		Note that slope scale bias, whilst more accurate, may be ignored by old hardware.
+        @param constantBias The constant bias value, expressed as a factor of the
+			minimum observable depth
+		@param slopeScaleBias The slope-relative bias value, expressed as a factor
+			of the depth slope
+		*/
+        void setDepthBias(float constantBias, float slopeScaleBias = 0.0f);
+
+        /** Retrieves the const depth bias value as set by setDepthBias. */
+        float getDepthBiasConstant(void) const;
+		/** Retrieves the slope-scale depth bias value as set by setDepthBias. */
+		float getDepthBiasSlopeScale(void) const;
+
+        /** Sets the way the pass will have use alpha to totally reject pixels from the pipeline.
+        @remarks
+			The default is CMPF_ALWAYS_PASS i.e. alpha is not used to reject pixels.
+        @param func The comparison which must pass for the pixel to be written.
+        @param value 1 byte value against which alpha values will be tested(0-255)
+        @note
+			This option applies in both the fixed function and the programmable pipeline.
+        */
+        void setAlphaRejectSettings(CompareFunction func, unsigned char value);
+
+		/** Sets the alpha reject function. See setAlphaRejectSettings for more information.
+		*/
+		void setAlphaRejectFunction(CompareFunction func);
+
+		/** Gets the alpha reject value. See setAlphaRejectSettings for more information.
+		*/
+		void setAlphaRejectValue(unsigned char val);
+
+		/** Gets the alpha reject function. See setAlphaRejectSettings for more information.
+        */
+		CompareFunction getAlphaRejectFunction(void) const { return mAlphaRejectFunc; }
+
+        /** Gets the alpha reject value. See setAlphaRejectSettings for more information.
+        */
+		unsigned char getAlphaRejectValue(void) const { return mAlphaRejectVal; }
+        /** Sets whether or not this pass should iterate per light or number of
+			lights which can affect the object being rendered.
+		@remarks
+			The default behaviour for a pass (when this option is 'false'), is
+			for a pass to be rendered only once (or the number of times set in
+			setPassIterationCount), with all the lights which could
+			affect this object set at the same time (up to the maximum lights
+			allowed in the render system, which is typically 8).
+		@par
+			Setting this option to 'true' changes this behaviour, such that
+			instead of trying to issue render this pass once per object, it
+			is run <b>per light</b>, or for a group of 'n' lights each time
+			which can affect this object, the number of
+			times set in setPassIterationCount (default is once). In
+			this case, only light index 0 is ever used, and is a different light
+			every time the pass is issued, up to the total number of lights
+			which is affecting this object. This has 2 advantages:
+			<ul><li>There is no limit on the number of lights which can be
+			supported</li>
+			<li>It's easier to write vertex / fragment programs for this because
+			a single program can be used for any number of lights</li>
+			</ul>
+			However, this technique is more expensive, and typically you
+			will want an additional ambient pass, because if no lights are 
+			affecting the object it will not be rendered at all, which will look
+			odd even if ambient light is zero (imagine if there are lit objects
+			behind it - the objects silhouette would not show up). Therefore,
+			use this option with care, and you would be well advised to provide
+			a less expensive fallback technique for use in the distance.
+		@note
+			The number of times this pass runs is still limited by the maximum
+			number of lights allowed as set in setMaxSimultaneousLights, so
+			you will never get more passes than this. Also, the iteration is
+			started from the 'start light' as set in Pass::setStartLight, and
+			the number of passes is the number of lights to iterate over divided
+			by the number of lights per iteration (default 1, set by 
+			setLightCountPerIteration).
+        @param enabled Whether this feature is enabled
+        @param onlyForOneLightType If true, the pass will only be run for a single type
+            of light, other light types will be ignored.
+        @param lightType The single light type which will be considered for this pass
+		*/
+        void setIteratePerLight(bool enabled,
+            bool onlyForOneLightType = true, Light::LightTypes lightType = Light::LT_POINT);
+
+        /** Does this pass run once for every light in range? */
+		bool getIteratePerLight(void) const { return mIteratePerLight; }
+        /** Does this pass run only for a single light type (if getIteratePerLight is true). */
+        bool getRunOnlyForOneLightType(void) const { return mRunOnlyForOneLightType; }
+        /** Gets the single light type this pass runs for if  getIteratePerLight and
+            getRunOnlyForOneLightType are both true. */
+        Light::LightTypes getOnlyLightType() const { return mOnlyLightType; }
+
+		/** If light iteration is enabled, determine the number of lights per
+			iteration.
+		@remarks
+			The default for this setting is 1, so if you enable light iteration
+			(Pass::setIteratePerLight), the pass is rendered once per light. If
+			you set this value higher, the passes will occur once per 'n' lights.
+			The start of the iteration is set by Pass::setStartLight and the end
+			by Pass::setMaxSimultaneousLights.
+		*/
+		void setLightCountPerIteration(unsigned short c);
+		/** If light iteration is enabled, determine the number of lights per
+		iteration.
+		*/
+		unsigned short getLightCountPerIteration(void) const;
+		
+		/// Gets the parent Technique
+        Technique* getParent(void) const { return mParent; }
+
+		/// Gets the resource group of the ultimate parent Material
+		const String& getResourceGroup(void) const;
+
+		/** Sets the details of the vertex program to use.
+		@remarks
+			Only applicable to programmable passes, this sets the details of
+			the vertex program to use in this pass. The program will not be
+			loaded until the parent Material is loaded.
+		@param name The name of the program - this must have been
+			created using GpuProgramManager by the time that this Pass
+			is loaded. If this parameter is blank, any vertex program in this pass is disabled.
+        @param resetParams
+            If true, this will create a fresh set of parameters from the
+            new program being linked, so if you had previously set parameters
+            you will have to set them again. If you set this to false, you must
+            be absolutely sure that the parameters match perfectly, and in the
+            case of named parameters refers to the indexes underlying them,
+            not just the names.
+		*/
+		void setVertexProgram(const String& name, bool resetParams = true);
+		/** Sets the vertex program parameters.
+		@remarks
+			Only applicable to programmable passes, and this particular call is
+			designed for low-level programs; use the named parameter methods
+			for setting high-level program parameters.
+		*/
+		void setVertexProgramParameters(GpuProgramParametersSharedPtr params);
+		/** Gets the name of the vertex program used by this pass. */
+		const String& getVertexProgramName(void) const;
+        /** Gets the vertex program parameters used by this pass. */
+        GpuProgramParametersSharedPtr getVertexProgramParameters(void) const;
+		/** Gets the vertex program used by this pass, only available after _load(). */
+		const GpuProgramPtr& getVertexProgram(void) const;
+
+
+        /** Sets the details of the vertex program to use when rendering as a
+        shadow caster.
+        @remarks
+        Texture-based shadows require that the caster is rendered to a texture
+        in a solid colour (the shadow colour in the case of modulative texture
+        shadows). Whilst Ogre can arrange this for the fixed function
+        pipeline, passes which use vertex programs might need the vertex
+        programs still to run in order to preserve any deformation etc
+        that it does. However, lighting calculations must be a lot simpler,
+        with only the ambient colour being used (which the engine will ensure
+        is bound to the shadow colour).
+        @par
+        Therefore, it is up to implemetors of vertex programs to provide an
+        alternative vertex program which can be used to render the object
+        to a shadow texture. Do all the same vertex transforms, but set the
+        colour of the vertex to the ambient colour, as bound using the
+        standard auto parameter binding mechanism.
+        @note
+        Some vertex programs will work without doing this, because Ogre ensures
+        that all lights except for ambient are set black. However, the chances
+        are that your vertex program is doing a lot of unnecessary work in this
+        case, since the other lights are having no effect, and it is good practice
+        to supply an alternative.
+        @note
+        This is only applicable to programmable passes.
+        @par
+        The default behaviour is for Ogre to switch to fixed-function
+        rendering if an explict vertex program alternative is not set.
+        */
+        void setShadowCasterVertexProgram(const String& name);
+        /** Sets the vertex program parameters for rendering as a shadow caster.
+        @remarks
+        Only applicable to programmable passes, and this particular call is
+        designed for low-level programs; use the named parameter methods
+        for setting high-level program parameters.
+        */
+        void setShadowCasterVertexProgramParameters(GpuProgramParametersSharedPtr params);
+        /** Gets the name of the vertex program used by this pass when rendering shadow casters. */
+        const String& getShadowCasterVertexProgramName(void) const;
+        /** Gets the vertex program parameters used by this pass when rendering shadow casters. */
+        GpuProgramParametersSharedPtr getShadowCasterVertexProgramParameters(void) const;
+        /** Gets the vertex program used by this pass when rendering shadow casters,
+            only available after _load(). */
+        const GpuProgramPtr& getShadowCasterVertexProgram(void) const;
+
+        /** Sets the details of the vertex program to use when rendering as a
+            shadow receiver.
+        @remarks
+            Texture-based shadows require that the shadow receiver is rendered using
+            a projective texture. Whilst Ogre can arrange this for the fixed function
+            pipeline, passes which use vertex programs might need the vertex
+            programs still to run in order to preserve any deformation etc
+            that it does. So in this case, we need a vertex program which does the
+            appropriate vertex transformation, but generates projective texture
+            coordinates.
+        @par
+            Therefore, it is up to implemetors of vertex programs to provide an
+            alternative vertex program which can be used to render the object
+            as a shadow receiver. Do all the same vertex transforms, but generate
+            <strong>2 sets</strong> of texture coordinates using the auto parameter
+            ACT_TEXTURE_VIEWPROJ_MATRIX, which Ogre will bind to the parameter name /
+            index you supply as the second parameter to this method. 2 texture
+            sets are needed because Ogre needs to use 2 texture units for some
+            shadow effects.
+        @note
+            This is only applicable to programmable passes.
+        @par
+            The default behaviour is for Ogre to switch to fixed-function
+            rendering if an explict vertex program alternative is not set.
+        */
+        void setShadowReceiverVertexProgram(const String& name);
+        /** Sets the vertex program parameters for rendering as a shadow receiver.
+        @remarks
+        Only applicable to programmable passes, and this particular call is
+        designed for low-level programs; use the named parameter methods
+        for setting high-level program parameters.
+        */
+        void setShadowReceiverVertexProgramParameters(GpuProgramParametersSharedPtr params);
+
+		/** This method allows you to specify a fragment program for use when
+			rendering a texture shadow receiver.
+		@remarks
+			Texture shadows are applied by rendering the receiver. Modulative texture
+			shadows are performed as a post-render darkening pass, and as such
+			fragment programs are generally not required per-object. Additive
+			texture shadows, however, are applied by accumulating light masked
+			out using a texture shadow (black & white by default, unless you
+			customise this using SceneManager::setCustomShadowCasterMaterial).
+			OGRE can do this for you for most materials, but if you use a custom
+			lighting program (e.g. per pixel lighting) then you'll need to provide
+			a custom version for receiving shadows. You don't need to provide
+			this for shadow casters if you don't use self-shadowing since they
+			will never be shadow receivers too.
+		@par
+			The shadow texture is always bound to texture unit 0 when rendering
+			texture shadow passes. Therefore your custom shadow receiver program
+			may well just need to shift it's texture unit usage up by one unit,
+			and take the shadow texture into account in its calculations.
+		*/
+		void setShadowReceiverFragmentProgram(const String& name);
+        /** Sets the fragment program parameters for rendering as a shadow receiver.
+        @remarks
+        Only applicable to programmable passes, and this particular call is
+        designed for low-level programs; use the named parameter methods
+        for setting high-level program parameters.
+        */
+        void setShadowReceiverFragmentProgramParameters(GpuProgramParametersSharedPtr params);
+
+        /** Gets the name of the vertex program used by this pass when rendering shadow receivers. */
+        const String& getShadowReceiverVertexProgramName(void) const;
+        /** Gets the vertex program parameters used by this pass when rendering shadow receivers. */
+        GpuProgramParametersSharedPtr getShadowReceiverVertexProgramParameters(void) const;
+        /** Gets the vertex program used by this pass when rendering shadow receivers,
+        only available after _load(). */
+        const GpuProgramPtr& getShadowReceiverVertexProgram(void) const;
+
+		/** Gets the name of the fragment program used by this pass when rendering shadow receivers. */
+		const String& getShadowReceiverFragmentProgramName(void) const;
+		/** Gets the fragment program parameters used by this pass when rendering shadow receivers. */
+		GpuProgramParametersSharedPtr getShadowReceiverFragmentProgramParameters(void) const;
+		/** Gets the fragment program used by this pass when rendering shadow receivers,
+		only available after _load(). */
+		const GpuProgramPtr& getShadowReceiverFragmentProgram(void) const;
+
+		/** Sets the details of the fragment program to use.
+		@remarks
+			Only applicable to programmable passes, this sets the details of
+			the fragment program to use in this pass. The program will not be
+			loaded until the parent Material is loaded.
+		@param name The name of the program - this must have been
+			created using GpuProgramManager by the time that this Pass
+			is loaded. If this parameter is blank, any fragment program in this pass is disabled.
+        @param resetParams
+            If true, this will create a fresh set of parameters from the
+            new program being linked, so if you had previously set parameters
+            you will have to set them again. If you set this to false, you must
+            be absolutely sure that the parameters match perfectly, and in the
+            case of named parameters refers to the indexes underlying them,
+            not just the names.
+		*/
+		void setFragmentProgram(const String& name, bool resetParams = true);
+		/** Sets the fragment program parameters.
+		@remarks
+			Only applicable to programmable passes.
+		*/
+		void setFragmentProgramParameters(GpuProgramParametersSharedPtr params);
+		/** Gets the name of the fragment program used by this pass. */
+		const String& getFragmentProgramName(void) const;
+		/** Gets the fragment program parameters used by this pass. */
+		GpuProgramParametersSharedPtr getFragmentProgramParameters(void) const;
+		/** Gets the fragment program used by this pass, only available after _load(). */
+		const GpuProgramPtr& getFragmentProgram(void) const;
+
+		/** Splits this Pass to one which can be handled in the number of
+			texture units specified.
+		@remarks
+			Only works on non-programmable passes, programmable passes cannot be
+			split, it's up to the author to ensure that there is a fallback Technique
+			for less capable cards.
+		@param numUnits The target number of texture units
+		@returns A new Pass which contains the remaining units, and a scene_blend
+				setting appropriate to approximate the multitexture. This Pass will be
+				attached to the parent Technique of this Pass.
+		*/
+		Pass* _split(unsigned short numUnits);
+
+		/** Internal method to adjust pass index. */
+		void _notifyIndex(unsigned short index);
+
+		/** Internal method for loading this pass. */
+		void _load(void);
+		/** Internal method for unloading this pass. */
+		void _unload(void);
+        // Is this loaded?
+        bool isLoaded(void) const;
+
+        /** Gets the 'hash' of this pass, ie a precomputed number to use for sorting
+        @remarks
+            This hash is used to sort passes, and for this reason the pass is hashed
+            using firstly its index (so that all passes are rendered in order), then
+            by the textures which it's TextureUnitState instances are using.
+        */
+        uint32 getHash(void) const { return mHash; }
+		/// Mark the hash as dirty
+		void _dirtyHash(void);
+        /** Internal method for recalculating the hash.
+		@remarks
+			Do not call this unless you are sure the old hash is not still being
+			used by anything. If in doubt, call _dirtyHash if you want to force
+			recalculation of the has next time.
+		*/
+        void _recalculateHash(void);
+        /** Tells the pass that it needs recompilation. */
+        void _notifyNeedsRecompile(void);
+
+        /** Update any automatic parameters (except lights) on this pass */
+        void _updateAutoParamsNoLights(const AutoParamDataSource& source) const;
+        /** Update any automatic light parameters on this pass */
+        void _updateAutoParamsLightsOnly(const AutoParamDataSource& source) const;
+
+		/** Gets the 'nth' texture which references the given content type.
+		@remarks
+			If the 'nth' texture unit which references the content type doesn't
+			exist, then this method returns an arbitrary high-value outside the
+			valid range to index texture units.
+		*/
+		unsigned short _getTextureUnitWithContentTypeIndex(
+			TextureUnitState::ContentType contentType, unsigned short index) const;
+
+        /** Set texture filtering for every texture unit 
+        @note
+            This property actually exists on the TextureUnitState class
+            For simplicity, this method allows you to set these properties for
+            every current TeextureUnitState, If you need more precision, retrieve the
+            TextureUnitState instance and set the property there.
+        @see TextureUnitState::setTextureFiltering
+        */
+        void setTextureFiltering(TextureFilterOptions filterType);
+        /** Sets the anisotropy level to be used for all textures.
+        @note
+            This property has been moved to the TextureUnitState class, which is accessible via the
+            Technique and Pass. For simplicity, this method allows you to set these properties for
+            every current TeextureUnitState, If you need more precision, retrieve the Technique,
+            Pass and TextureUnitState instances and set the property there.
+        @see TextureUnitState::setTextureAnisotropy
+        */
+        void setTextureAnisotropy(unsigned int maxAniso);
+		/** Static method to retrieve all the Passes which need their
+		    hash values recalculated.
+		*/
+		static const PassSet& getDirtyHashList(void)
+		{ return msDirtyHashList; }
+        /** Static method to retrieve all the Passes which are pending deletion.
+        */
+        static const PassSet& getPassGraveyard(void)
+        { return msPassGraveyard; }
+		/** Static method to reset the list of passes which need their hash
+		    values recalculated.
+		@remarks
+			For performance, the dirty list is not updated progressively as
+			the hashes are recalculated, instead we expect the processor of the
+			dirty hash list to clear the list when they are done.
+		*/
+		static void clearDirtyHashList(void);
+
+        /** Process all dirty and pending deletion passes. */
+        static void processPendingPassUpdates(void);
+
+        /** Queue this pass for deletion when appropriate. */
+        void queueForDeletion(void);
+
+        /** Returns whether this pass is ambient only.
+        */
+        bool isAmbientOnly(void) const;
+
+        /** set the number of iterations that this pass
+        should perform when doing fast multi pass operation.
+        @remarks
+            Only applicable for programmable passes.
+        @param count number of iterations to perform fast multi pass operations.
+            A value greater than 1 will cause the pass to be executed count number of
+            times without changing the render state.  This is very usefull for passes
+            that use programmable shaders that have to iterate more than once but don't
+            need a render state change.  Using multi pass can dramatically speed up rendering
+            for materials that do things like fur, blur.
+            A value of 1 turns off multi pass operation and the pass does
+            the normal pass operation.
+        */
+        void setPassIterationCount(const size_t count) { mPassIterationCount = count; }
+
+        /** Gets the pass iteration count value.
+        */
+        size_t getPassIterationCount(void) const { return mPassIterationCount; }
+
+        /** Applies texture names to Texture Unit State with matching texture name aliases.
+            All Texture Unit States within the pass are checked.
+            If matching texture aliases are found then true is returned.
+
+        @param
+            aliasList is a map container of texture alias, texture name pairs
+        @param
+            apply set true to apply the texture aliases else just test to see if texture alias matches are found.
+        @return
+            True if matching texture aliases were found in the pass.
+        */
+        bool applyTextureAliases(const AliasTextureNamePairList& aliasList, const bool apply = true) const;
+
+
+		/** There are some default hash functions used to order passes so that
+			render state changes are minimised, this enumerates them.
+		*/
+		enum BuiltinHashFunction
+		{
+			/** Try to minimise the number of texture changes. */
+			MIN_TEXTURE_CHANGE,
+			/** Try to minimise the number of GPU program changes.
+			@note Only really useful if you use GPU programs for all of your
+				materials. 
+			*/
+			MIN_GPU_PROGRAM_CHANGE
+		};
+		/** Sets one of the default hash functions to be used.
+		@remarks
+			You absolutely must not change the hash function whilst any Pass instances
+			exist in the render queue. The only time you can do this is either
+			before you render anything, or directly after you manuall call
+			RenderQueue::clear(true) to completely destroy the queue structures.
+			The default is MIN_TEXTURE_CHANGE.
+		@note
+			You can also implement your own hash function, see the alternate version
+			of this method.
+		@see HashFunc
+		*/
+		static void setHashFunction(BuiltinHashFunction builtin);
+
+		/** Set the hash function used for all passes.
+		@remarks
+			You absolutely must not change the hash function whilst any Pass instances
+			exist in the render queue. The only time you can do this is either
+			before you render anything, or directly after you manuall call
+			RenderQueue::clear(true) to completely destroy the queue structures.
+		@note
+			You can also use one of the built-in hash functions, see the alternate version
+			of this method. The default is MIN_TEXTURE_CHANGE.
+		@see HashFunc
+		*/
+		static void setHashFunction(HashFunc* hashFunc) { msHashFunc = hashFunc; }
+
+		/** Get the hash function used for all passes.
+		*/
+		static HashFunc* getHashFunction(void) { return msHashFunc; }
+        
+    };
+
+    enum IlluminationStage
+    {
+        /// Part of the rendering which occurs without any kind of direct lighting
+        IS_AMBIENT,
+        /// Part of the rendering which occurs per light
+        IS_PER_LIGHT,
+        /// Post-lighting rendering
+        IS_DECAL
+    };
+    /** Struct recording a pass which can be used for a specific illumination stage.
+    @remarks
+        This structure is used to record categorised passes which fit into a
+        number of distinct illumination phases - ambient, diffuse / specular
+        (per-light) and decal (post-lighting texturing).
+        An original pass may fit into one of these categories already, or it
+        may require splitting into its component parts in order to be categorised
+        properly.
+    */
+    struct IlluminationPass
+    {
+        IlluminationStage stage;
+        /// The pass to use in this stage
+        Pass* pass;
+        /// Whether this pass is one which should be deleted itself
+        bool destroyOnShutdown;
+        /// The original pass which spawned this one
+        Pass* originalPass;
+    };
+
+    typedef std::vector<IlluminationPass*> IlluminationPassList;
+
+
+}
+
+#endif
Index: /OgreMain/include/OgrePatchMesh.h
===================================================================
--- /OgreMain/include/OgrePatchMesh.h	(revision 5)
+++ /OgreMain/include/OgrePatchMesh.h	(revision 5)
@@ -0,0 +1,152 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __PatchMesh_H__
+#define __PatchMesh_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMesh.h"
+#include "OgrePatchSurface.h"
+
+namespace Ogre {
+
+    /** Patch specialisation of Mesh. 
+    @remarks
+        Instances of this class should be created by calling MeshManager::createBezierPatch.
+    */
+    class _OgreExport PatchMesh : public Mesh
+    {
+    protected:
+        /// Internal surface definition
+        PatchSurface mSurface;
+        /// Vertex declaration, cloned from the input
+        VertexDeclaration* mDeclaration;
+    public:
+        /// Constructor
+        PatchMesh(ResourceManager* creator, const String& name, ResourceHandle handle,
+            const String& group);
+
+        /// Define the patch, as defined in MeshManager::createBezierPatch
+        void define(void* controlPointBuffer, 
+            VertexDeclaration *declaration, size_t width, size_t height,
+            size_t uMaxSubdivisionLevel = PatchSurface::AUTO_LEVEL, 
+            size_t vMaxSubdivisionLevel = PatchSurface::AUTO_LEVEL,
+            PatchSurface::VisibleSide visibleSide = PatchSurface::VS_FRONT,
+            HardwareBuffer::Usage vbUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
+            HardwareBuffer::Usage ibUsage = HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY,
+            bool vbUseShadow = false, bool ibUseShadow = false);
+
+        /* Sets the current subdivision level as a proportion of full detail.
+        @param factor Subdivision factor as a value from 0 (control points only) to 1 (maximum
+            subdivision). */
+        void setSubdivision(Real factor);
+    protected:
+        /// Overridden from Resource
+        void loadImpl(void);
+
+    };
+    /** Specialisation of SharedPtr to allow SharedPtr to be assigned to PatchMeshPtr 
+    @note Has to be a subclass since we need operator=.
+    We could templatise this instead of repeating per Resource subclass, 
+    except to do so requires a form VC6 does not support i.e.
+    ResourceSubclassPtr<T> : public SharedPtr<T>
+    */
+    class _OgreExport PatchMeshPtr : public SharedPtr<PatchMesh> 
+    {
+    public:
+        PatchMeshPtr() : SharedPtr<PatchMesh>() {}
+        explicit PatchMeshPtr(PatchMesh* rep) : SharedPtr<PatchMesh>(rep) {}
+        PatchMeshPtr(const PatchMeshPtr& r) : SharedPtr<PatchMesh>(r) {} 
+        PatchMeshPtr(const ResourcePtr& r) : SharedPtr<PatchMesh>()
+        {
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+                pRep = static_cast<PatchMesh*>(r.getPointer());
+                pUseCount = r.useCountPointer();
+                if (pUseCount)
+                {
+                    ++(*pUseCount);
+                }
+            }
+        }
+
+        /// Operator used to convert a ResourcePtr to a PatchMeshPtr
+        PatchMeshPtr& operator=(const ResourcePtr& r)
+        {
+            if (pRep == static_cast<PatchMesh*>(r.getPointer()))
+                return *this;
+            release();
+
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    // lock & copy other mutex pointer
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+                pRep = static_cast<PatchMesh*>(r.getPointer());
+                pUseCount = r.useCountPointer();
+                if (pUseCount)
+                {
+                    ++(*pUseCount);
+                }
+            }
+			else
+			{
+				// RHS must be a null pointer
+				assert(r.isNull() && "RHS must be null if it has no mutex!");
+				setNull();
+			}
+            return *this;
+        }
+        /// Operator used to convert a MeshPtr to a PatchMeshPtr
+        PatchMeshPtr& operator=(const MeshPtr& r)
+        {
+            if (pRep == static_cast<PatchMesh*>(r.getPointer()))
+                return *this;
+            release();
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+                pRep = static_cast<PatchMesh*>(r.getPointer());
+                pUseCount = r.useCountPointer();
+                if (pUseCount)
+                {
+                    ++(*pUseCount);
+                }
+            }
+            return *this;
+        }
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgrePatchSurface.h
===================================================================
--- /OgreMain/include/OgrePatchSurface.h	(revision 5)
+++ /OgreMain/include/OgrePatchSurface.h	(revision 5)
@@ -0,0 +1,233 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __PatchSurface_H__
+#define __PatchSurface_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreVector3.h"
+#include "OgreString.h"
+#include "OgreRenderOperation.h"
+#include "OgreAxisAlignedBox.h"
+
+namespace Ogre {
+
+    /** A surface which is defined by curves of some kind to form a patch, e.g. a Bezier patch.
+        @remarks
+            This object will take a list of control points with various assorted data, and will
+            subdivide it into a patch mesh. Currently only Bezier curves are supported for defining
+            the surface, but other techniques such as NURBS would follow the same basic approach.
+    */
+    class _OgreExport PatchSurface
+    {
+    public:
+        PatchSurface();
+        ~PatchSurface();
+
+        enum PatchSurfaceType
+        {
+            /// A patch defined by a set of bezier curves
+            PST_BEZIER
+        };
+
+        /// Constant for indicating automatic determination of subdivision level for patches
+        enum
+        {
+            AUTO_LEVEL = -1
+        };
+
+        enum VisibleSide {
+            /// The side from which u goes right and v goes up (as in texture coords)
+            VS_FRONT,
+            /// The side from which u goes right and v goes down (reverse of texture coords)
+            VS_BACK,
+            /// Both sides are visible - warning this creates 2x the number of triangles and adds extra overhead for calculating normals
+            VS_BOTH
+        };
+        /** Sets up the surface by defining it's control points, type and initial subdivision level.
+            @remarks
+                This method initialises the surface by passing it a set of control points. The type of curves to be used
+                are also defined here, although the only supported option currently is a bezier patch. You can also
+                specify a global subdivision level here if you like, although it is recommended that the parameter
+                is left as AUTO_LEVEL, which means the system decides how much subdivision is required (based on the
+                curvature of the surface)
+            @param
+                controlPointBuffer A pointer to a buffer containing the vertex data which defines control points 
+                of the curves rather than actual vertices. Note that you are expected to provide not
+                just position information, but potentially normals and texture coordinates too. The
+                format of the buffer is defined in the VertexDeclaration parameter
+            @param
+                decaration VertexDeclaration describing the contents of the buffer. 
+                Note this declaration must _only_ draw on buffer source 0!
+            @param
+                width Specifies the width of the patch in control points.
+            @param
+                height Specifies the height of the patch in control points. 
+            @param
+                pType The type of surface - currently only PST_BEZIER is supported
+            @param
+                uMaxSubdivisionLevel,vMaxSubdivisionLevel If you want to manually set the top level of subdivision, 
+                do it here, otherwise let the system decide.
+            @param
+                visibleSide Determines which side of the patch (or both) triangles are generated for.
+        */
+        void defineSurface(void* controlPointBuffer, 
+            VertexDeclaration *declaration, size_t width, size_t height,
+            PatchSurfaceType pType = PST_BEZIER, 
+            size_t uMaxSubdivisionLevel = AUTO_LEVEL, size_t vMaxSubdivisionLevel = AUTO_LEVEL,
+            VisibleSide visibleSide = VS_FRONT);
+
+        /** Based on a previous call to defineSurface, establishes the number of vertices required
+            to hold this patch at the maximum detail level. 
+            @remarks This is useful when you wish to build the patch into external vertex / index buffers.
+
+        */
+        size_t getRequiredVertexCount(void) const;
+        /** Based on a previous call to defineSurface, establishes the number of indexes required
+            to hold this patch at the maximum detail level. 
+            @remarks This is useful when you wish to build the patch into external vertex / index buffers.
+
+        */
+        size_t getRequiredIndexCount(void) const;
+
+        /** Gets the current index count based on the current subdivision level. */
+        size_t getCurrentIndexCount(void) const;
+        /// Returns the index offset used by this buffer to write data into the buffer
+        size_t getIndexOffset(void) const { return mIndexOffset; }
+        /// Returns the vertex offset used by this buffer to write data into the buffer
+        size_t getVertexOffset(void) const { return mVertexOffset; }
+
+
+        /** Gets the bounds of this patch, only valid after calling defineSurface. */
+        const AxisAlignedBox& getBounds(void) const;
+        /** Gets the radius of the bounding sphere for this patch, only valid after defineSurface 
+        has been called. */
+        Real getBoundingSphereRadius(void) const;
+        /** Tells the system to build the mesh relating to the surface into externally created
+            buffers.
+            @remarks
+                The VertexDeclaration of the vertex buffer must be identical to the one passed into
+                defineSurface.  In addition, there must be enough space in the buffer to 
+                accommodate the patch at full detail level; you should call getRequiredVertexCount
+                and getRequiredIndexCount to determine this. This method does not create an internal
+                mesh for this patch and so getMesh will return null if you call it after building the
+                patch this way.
+            @param destVertexBuffer The destination vertex buffer in which to build the patch.
+            @param vertexStart The offset at which to start writing vertices for this patch
+            @param destIndexBuffer The destination index buffer in which to build the patch.
+            @param vertexStart The offset at which to start writing indexes for this patch
+
+        */
+        void build(HardwareVertexBufferSharedPtr destVertexBuffer, size_t vertexStart,
+            HardwareIndexBufferSharedPtr destIndexBuffer, size_t indexStart);
+
+        /** Alters the level of subdivision for this surface.
+            @remarks
+                This method changes the proportionate detail level of the patch; since
+                the U and V directions can have different subdivision levels, this method
+                takes a single Real value where 0 is the minimum detail (the control points)
+                and 1 is the maximum detail level as supplied to the original call to 
+                defineSurface.
+        */
+        void setSubdivisionFactor(Real factor);
+
+        /** Gets the current level of subdivision. */
+        Real getSubdivisionFactor(void) const;
+
+        void* getControlPointBuffer(void) const
+        {
+            return mControlPointBuffer;
+        }
+        /** Convenience method for telling the patch that the control points have been 
+            deleted, since once the patch has been built they are not required. */
+        void notifyControlPointBufferDeallocated(void) { 
+            mControlPointBuffer = 0;
+        }
+    protected:
+        /// Vertex declaration describing the control point buffer
+        VertexDeclaration* mDeclaration;
+        /// Buffer containing the system-memory control points
+        void* mControlPointBuffer;
+        /// Type of surface
+        PatchSurfaceType mType;
+        /// Width in control points
+        size_t mCtlWidth;
+        /// Height in control points
+        size_t mCtlHeight;
+        /// TotalNumber of control points
+        size_t mCtlCount;
+        /// U-direction subdivision level
+        size_t mULevel;
+        /// V-direction subdivision level
+        size_t mVLevel;
+        /// Max subdivision level
+        size_t mMaxULevel;
+        size_t mMaxVLevel;
+        /// Width of the subdivided mesh (big enough for max level)
+        size_t mMeshWidth;
+        /// Height of the subdivided mesh (big enough for max level)
+        size_t mMeshHeight;
+        /// Which side is visible
+        VisibleSide mVSide;
+
+        Real mSubdivisionFactor;
+
+        std::vector<Vector3> mVecCtlPoints;
+
+        /** Internal method for finding the subdivision level given 3 control points.
+        */
+        size_t findLevel( Vector3& a, Vector3& b, Vector3& c);
+
+        void distributeControlPoints(void* lockedBuffer);
+        void subdivideCurve(void* lockedBuffer, size_t startIdx, size_t stepSize, size_t numSteps, size_t iterations);
+        void interpolateVertexData(void* lockedBuffer, size_t leftIndex, size_t rightIndex, size_t destIndex);
+        void makeTriangles(void);
+
+        size_t getAutoULevel(bool forMax = false);
+        size_t getAutoVLevel(bool forMax = false);
+
+        HardwareVertexBufferSharedPtr mVertexBuffer;
+        HardwareIndexBufferSharedPtr mIndexBuffer;
+        size_t mVertexOffset;
+        size_t mIndexOffset;
+        size_t mRequiredVertexCount;
+        size_t mRequiredIndexCount;
+        size_t mCurrIndexCount;
+
+        AxisAlignedBox mAABB;
+        Real mBoundingSphere;
+
+
+
+    };
+
+
+} // namespace
+
+#endif
Index: /OgreMain/include/OgrePixelFormat.h
===================================================================
--- /OgreMain/include/OgrePixelFormat.h	(revision 5)
+++ /OgreMain/include/OgrePixelFormat.h	(revision 5)
@@ -0,0 +1,473 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _PixelFormat_H__
+#define _PixelFormat_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreCommon.h"
+
+namespace Ogre {
+    /** The pixel format used for images, textures, and render surfaces */
+    enum PixelFormat
+    {
+        /// Unknown pixel format.
+        PF_UNKNOWN = 0,
+        /// 8-bit pixel format, all bits luminace.
+        PF_L8 = 1,
+		PF_BYTE_L = PF_L8,
+        /// 16-bit pixel format, all bits luminace.
+        PF_L16 = 2,
+		PF_SHORT_L = PF_L16,
+        /// 8-bit pixel format, all bits alpha.
+        PF_A8 = 3,
+		PF_BYTE_A = PF_A8,
+        /// 8-bit pixel format, 4 bits alpha, 4 bits luminace.
+        PF_A4L4 = 4,
+		/// 2 byte pixel format, 1 byte luminance, 1 byte alpha
+		PF_BYTE_LA = 5,
+        /// 16-bit pixel format, 5 bits red, 6 bits green, 5 bits blue.
+        PF_R5G6B5 = 6,
+		/// 16-bit pixel format, 5 bits red, 6 bits green, 5 bits blue.
+        PF_B5G6R5 = 7,
+        /// 8-bit pixel format, 2 bits blue, 3 bits green, 3 bits red.
+        PF_R3G3B2 = 31,
+        /// 16-bit pixel format, 4 bits for alpha, red, green and blue.
+        PF_A4R4G4B4 = 8,
+        /// 16-bit pixel format, 5 bits for blue, green, red and 1 for alpha.
+        PF_A1R5G5B5 = 9,
+        /// 24-bit pixel format, 8 bits for red, green and blue.
+        PF_R8G8B8 = 10,
+        /// 24-bit pixel format, 8 bits for blue, green and red.
+        PF_B8G8R8 = 11,
+        /// 32-bit pixel format, 8 bits for alpha, red, green and blue.
+        PF_A8R8G8B8 = 12,
+        /// 32-bit pixel format, 8 bits for blue, green, red and alpha.
+        PF_A8B8G8R8 = 13,
+        /// 32-bit pixel format, 8 bits for blue, green, red and alpha.
+        PF_B8G8R8A8 = 14,
+		/// 32-bit pixel format, 8 bits for red, green, blue and alpha.
+		PF_R8G8B8A8 = 28,
+        /// 32-bit pixel format, 8 bits for red, 8 bits for green, 8 bits for blue
+        /// like PF_A8R8G8B8, but alpha will get discarded
+        PF_X8R8G8B8 = 26,
+        /// 32-bit pixel format, 8 bits for blue, 8 bits for green, 8 bits for red
+        /// like PF_A8B8G8R8, but alpha will get discarded
+        PF_X8B8G8R8 = 27,
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+		/// 3 byte pixel format, 1 byte for red, 1 byte for green, 1 byte for blue
+		PF_BYTE_RGB = PF_R8G8B8,
+		/// 3 byte pixel format, 1 byte for blue, 1 byte for green, 1 byte for red
+		PF_BYTE_BGR = PF_B8G8R8,
+		/// 4 byte pixel format, 1 byte for blue, 1 byte for green, 1 byte for red and one byte for alpha
+		PF_BYTE_BGRA = PF_B8G8R8A8,
+		/// 4 byte pixel format, 1 byte for red, 1 byte for green, 1 byte for blue, and one byte for alpha
+		PF_BYTE_RGBA = PF_R8G8B8A8,
+#else
+		/// 3 byte pixel format, 1 byte for red, 1 byte for green, 1 byte for blue
+		PF_BYTE_RGB = PF_B8G8R8,
+		/// 3 byte pixel format, 1 byte for blue, 1 byte for green, 1 byte for red
+		PF_BYTE_BGR = PF_R8G8B8,
+		/// 4 byte pixel format, 1 byte for blue, 1 byte for green, 1 byte for red and one byte for alpha
+		PF_BYTE_BGRA = PF_A8R8G8B8,
+		/// 4 byte pixel format, 1 byte for red, 1 byte for green, 1 byte for blue, and one byte for alpha
+		PF_BYTE_RGBA = PF_A8B8G8R8,
+#endif        
+        /// 32-bit pixel format, 2 bits for alpha, 10 bits for red, green and blue.
+        PF_A2R10G10B10 = 15,
+        /// 32-bit pixel format, 10 bits for blue, green and red, 2 bits for alpha.
+        PF_A2B10G10R10 = 16,
+        /// DDS (DirectDraw Surface) DXT1 format
+        PF_DXT1 = 17,
+        /// DDS (DirectDraw Surface) DXT2 format
+        PF_DXT2 = 18,
+        /// DDS (DirectDraw Surface) DXT3 format
+        PF_DXT3 = 19,
+        /// DDS (DirectDraw Surface) DXT4 format
+        PF_DXT4 = 20,
+        /// DDS (DirectDraw Surface) DXT5 format
+        PF_DXT5 = 21,
+		// 16-bit pixel format, 16 bits (float) for red
+        PF_FLOAT16_R = 32,
+        // 48-bit pixel format, 16 bits (float) for red, 16 bits (float) for green, 16 bits (float) for blue
+        PF_FLOAT16_RGB = 22,
+        // 64-bit pixel format, 16 bits (float) for red, 16 bits (float) for green, 16 bits (float) for blue, 16 bits (float) for alpha
+        PF_FLOAT16_RGBA = 23,
+		// 16-bit pixel format, 16 bits (float) for red
+        PF_FLOAT32_R = 33,
+       // 96-bit pixel format, 32 bits (float) for red, 32 bits (float) for green, 32 bits (float) for blue
+        PF_FLOAT32_RGB = 24,
+        // 128-bit pixel format, 32 bits (float) for red, 32 bits (float) for green, 32 bits (float) for blue, 32 bits (float) for alpha
+        PF_FLOAT32_RGBA = 25,
+		// 32-bit, 2-channel s10e5 floating point pixel format, 16-bit green, 16-bit red
+		PF_FLOAT16_GR = 35,
+		// 64-bit, 2-channel floating point pixel format, 32-bit green, 32-bit red
+		PF_FLOAT32_GR = 36,
+		// Depth texture format
+		PF_DEPTH = 29,
+		// 64-bit pixel format, 16 bits for red, green, blue and alpha
+		PF_SHORT_RGBA = 30,
+		// 32-bit pixel format, 16-bit green, 16-bit red
+		PF_SHORT_GR = 34,
+		// 48-bit pixel format, 16 bits for red, green and blue
+		PF_SHORT_RGB = 37,
+		// Number of pixel formats currently defined
+        PF_COUNT = 38
+    };
+
+    /**
+     * Flags defining some on/off properties of pixel formats
+     */
+    enum PixelFormatFlags {
+        // This format has an alpha channel
+        PFF_HASALPHA        = 0x00000001,      
+        // This format is compressed. This invalidates the values in elemBytes,
+        // elemBits and the bit counts as these might not be fixed in a compressed format.
+        PFF_COMPRESSED    = 0x00000002,
+        // This is a floating point format
+        PFF_FLOAT           = 0x00000004,         
+        // This is a depth format (for depth textures)
+        PFF_DEPTH           = 0x00000008,
+        // Format is in native endian. Generally true for the 16, 24 and 32 bits
+        // formats which can be represented as machine integers.
+        PFF_NATIVEENDIAN    = 0x00000010,
+        // This is an intensity format instead of a RGB one. The luminance
+        // replaces R,G and B. (but not A)
+        PFF_LUMINANCE       = 0x00000020
+    };
+    
+    /** Pixel component format */
+    enum PixelComponentType
+    {
+        PCT_BYTE = 0,    /// Byte per component (8 bit fixed 0.0..1.0)
+        PCT_SHORT = 1,   /// Short per component (16 bit fixed 0.0..1.0))
+        PCT_FLOAT16 = 2, /// 16 bit float per component
+        PCT_FLOAT32 = 3, /// 32 bit float per component
+        PCT_COUNT = 4    /// Number of pixel types
+    };
+    
+	/** A primitive describing a volume (3D), image (2D) or line (1D) of pixels in memory.
+     	In case of a rectangle, depth must be 1. 
+     	Pixels are stored as a succession of "depth" slices, each containing "height" rows of 
+     	"width" pixels.
+    */
+    class _OgreExport PixelBox: public Box {
+    public:
+    	/// Parameter constructor for setting the members manually
+    	PixelBox() {}
+		/** Constructor providing extents in the form of a Box object. This constructor
+    		assumes the pixel data is laid out consecutively in memory. (this
+    		means row after row, slice after slice, with no space in between)
+    		@param extents	    Extents of the region defined by data
+    		@param pixelFormat	Format of this buffer
+    		@param pixelData	Pointer to the actual data
+    	*/
+		PixelBox(const Box &extents, PixelFormat pixelFormat, void *pixelData=0):
+			Box(extents), data(pixelData), format(pixelFormat)
+		{
+			setConsecutive();
+		}
+    	/** Constructor providing width, height and depth. This constructor
+    		assumes the pixel data is laid out consecutively in memory. (this
+    		means row after row, slice after slice, with no space in between)
+    		@param width	    Width of the region
+    		@param height	    Height of the region
+    		@param depth	    Depth of the region
+    		@param pixelFormat	Format of this buffer
+    		@param pixelData    Pointer to the actual data
+    	*/
+    	PixelBox(size_t width, size_t height, size_t depth, PixelFormat pixelFormat, void *pixelData=0):
+    		Box(0, 0, 0, width, height, depth),
+    		data(pixelData), format(pixelFormat)
+    	{
+    		setConsecutive();
+    	}
+    	
+        /// The data pointer 
+        void *data;
+        /// The pixel format 
+        PixelFormat format;
+        /** Number of elements between the leftmost pixel of one row and the left
+         	pixel of the next. This value must always be equal to getWidth() (consecutive) 
+			for compressed formats.
+        */
+        size_t rowPitch;
+        /** Number of elements between the top left pixel of one (depth) slice and 
+         	the top left pixel of the next. This can be a negative value. Must be a multiple of
+         	rowPitch. This value must always be equal to getWidth()*getHeight() (consecutive) 
+			for compressed formats.
+        */
+        size_t slicePitch;
+        
+        /** Set the rowPitch and slicePitch so that the buffer is laid out consecutive 
+         	in memory.
+        */        
+        void setConsecutive()
+        {
+            rowPitch = getWidth();
+            slicePitch = getWidth()*getHeight();
+        }
+        /**	Get the number of elements between one past the rightmost pixel of 
+         	one row and the leftmost pixel of the next row. (IE this is zero if rows
+         	are consecutive).
+        */
+        size_t getRowSkip() const { return rowPitch - getWidth(); }
+        /** Get the number of elements between one past the right bottom pixel of
+         	one slice and the left top pixel of the next slice. (IE this is zero if slices
+         	are consecutive).
+        */
+        size_t getSliceSkip() const { return slicePitch - (getHeight() * rowPitch); }
+
+        /** Return whether this buffer is laid out consecutive in memory (ie the pitches
+         	are equal to the dimensions)
+        */        
+        bool isConsecutive() const 
+		{ 
+			return rowPitch == getWidth() && slicePitch == getWidth()*getHeight(); 
+		}
+        /** Return the size (in bytes) this image would take if it was
+        	laid out consecutive in memory
+      	*/
+      	size_t getConsecutiveSize() const;
+      	/** Return a subvolume of this PixelBox.
+      		@param def	Defines the bounds of the subregion to return
+      		@returns	A pixel box describing the region and the data in it
+      		@remarks	This function does not copy any data, it just returns
+      			a PixelBox object with a data pointer pointing somewhere inside 
+      			the data of object.
+      		@throws	Exception(ERR_INVALIDPARAMS) if def is not fully contained
+      	*/
+      	PixelBox getSubVolume(const Box &def) const;
+    };
+    
+
+    /**
+     * Some utility functions for packing and unpacking pixel data
+     */
+    class _OgreExport PixelUtil {
+    public:
+        /** Returns the size in bytes of an element of the given pixel format.
+         @returns
+               The size in bytes of an element. See Remarks.
+         @remarks
+               Passing PF_UNKNOWN will result in returning a size of 0 bytes.
+        */
+        static size_t getNumElemBytes( PixelFormat format );
+
+        /** Returns the size in bits of an element of the given pixel format.
+          @returns
+               The size in bits of an element. See Remarks.
+           @remarks
+               Passing PF_UNKNOWN will result in returning a size of 0 bits.
+        */
+        static size_t getNumElemBits( PixelFormat format );
+
+		/** Returns the size in memory of a region with the given extents and pixel
+			format with consecutive memory layout.
+			@param width
+				The width of the area
+			@param height
+				The height of the area
+			@param depth
+				The depth of the area
+			@param format
+				The format of the area
+		  	@returns
+		  		The size in bytes
+			@remarks
+				In case that the format is non-compressed, this simply returns
+				width*height*depth*PixelUtil::getNumElemBytes(format). In the compressed
+				case, this does serious magic.
+		*/
+		static size_t getMemorySize(size_t width, size_t height, size_t depth, PixelFormat format);
+		
+        /** Returns the property flags for this pixel format
+          @returns
+               A bitfield combination of PFF_HASALPHA, PFF_ISCOMPRESSED,
+               PFF_FLOAT, PFF_DEPTH, PFF_NATIVEENDIAN, PFF_LUMINANCE
+          @remarks
+               This replaces the seperate functions for formatHasAlpha, formatIsFloat, ...
+        */
+        static unsigned int getFlags( PixelFormat format );
+
+        /** Shortcut method to determine if the format has an alpha component */
+        static bool hasAlpha(PixelFormat format);
+        /** Shortcut method to determine if the format is floating point */
+        static bool isFloatingPoint(PixelFormat format);
+        /** Shortcut method to determine if the format is compressed */
+        static bool isCompressed(PixelFormat format);
+        /** Shortcut method to determine if the format is a depth format. */
+        static bool isDepth(PixelFormat format);
+        /** Shortcut method to determine if the format is in native endian format. */
+        static bool isNativeEndian(PixelFormat format);
+        /** Shortcut method to determine if the format is a luminance format. */
+        static bool isLuminance(PixelFormat format);
+		
+		/** Return wether a certain image extent is valid for this image format.
+			@param width
+				The width of the area
+			@param height
+				The height of the area
+			@param depth
+				The depth of the area
+			@param format
+				The format of the area
+			@remarks For non-compressed formats, this is always true. For DXT formats,
+			only sizes with a width and height multiple of 4 and depth 1 are allowed.
+		*/
+		static bool isValidExtent(size_t width, size_t height, size_t depth, PixelFormat format);
+
+        /** Gives the number of bits (RGBA) for a format. See remarks.          
+          @remarks      For non-colour formats (dxt, depth) this returns [0,0,0,0].
+        */
+        static void getBitDepths(PixelFormat format, int rgba[4]);
+
+		/** Gives the masks for the R, G, B and A component
+		  @note			Only valid for native endian formats
+        */
+        static void getBitMasks(PixelFormat format, uint32 rgba[4]);
+
+        /** Gets the name of an image format
+        */
+        static String getFormatName(PixelFormat srcformat);
+
+        /** Returns wether the format can be packed or unpacked with the packColour()
+        and unpackColour() functions. This is generally not true for compressed and
+        depth formats as they are special. It can only be true for formats with a
+        fixed element size.
+          @returns 
+               true if yes, otherwise false
+        */
+        static bool isAccessible(PixelFormat srcformat);
+        
+        /** Returns the component type for a certain pixel format. Returns PCT_BYTE
+            in case there is no clear component type like with compressed formats.
+            This is one of PCT_BYTE, PCT_SHORT, PCT_FLOAT16, PCT_FLOAT32.
+        */
+        static PixelComponentType getComponentType(PixelFormat fmt);
+        
+        /** Returns the component count for a certain pixel format. Returns 3(no alpha) or 
+            4 (has alpha) in case there is no clear component type like with compressed formats.
+         */
+        static size_t getComponentCount(PixelFormat fmt);
+
+        /** Gets the format from given name.
+            @param  name            The string of format name
+            @param  accessibleOnly  If true, non-accessible format will treat as invalid format,
+                                    otherwise, all supported format are valid.
+            @param  caseSensitive   Should be set true if string match should use case sensitivity.
+            @returns                The format match the format name, or PF_UNKNOWN if is invalid name.
+        */
+        static PixelFormat getFormatFromName(const String& name, bool accessibleOnly = false, bool caseSensitive = false);
+
+        /** Gets the BNF expression of the pixel-formats.
+            @note                   The string returned by this function is intented to use as a BNF expression
+                                    to work with Compiler2Pass.
+            @param  accessibleOnly  If true, only accessible pixel format will take into account, otherwise all
+                                    pixel formats list in PixelFormat enumeration will being returned.
+            @returns                A string contains the BNF expression.
+        */
+        static String getBNFExpressionOfPixelFormats(bool accessibleOnly = false);
+
+        /** Returns the similar format but acoording with given bit depths.
+            @param fmt      The original foamt.
+            @param integerBits Preferred bit depth (pixel bits) for integer pixel format.
+                            Available values: 0, 16 and 32, where 0 (the default) means as it is.
+            @param floatBits Preferred bit depth (channel bits) for float pixel format.
+                            Available values: 0, 16 and 32, where 0 (the default) means as it is.
+            @returns        The format that similar original format with bit depth according
+                            with preferred bit depth, or original format if no convertion occuring.
+        */
+        static PixelFormat getFormatForBitDepths(PixelFormat fmt, ushort integerBits, ushort floatBits);
+
+        /** Pack a colour value to memory
+        	@param colour	The colour
+        	@param pf		Pixelformat in which to write the colour
+        	@param dest		Destination memory location
+        */
+        static void packColour(const ColourValue &colour, const PixelFormat pf,  void* dest);
+        /** Pack a colour value to memory
+        	@param r,g,b,a	The four colour components, range 0x00 to 0xFF
+        	@param pf		Pixelformat in which to write the colour
+        	@param dest		Destination memory location
+        */
+        static void packColour(const uint8 r, const uint8 g, const uint8 b, const uint8 a, const PixelFormat pf,  void* dest);
+         /** Pack a colour value to memory
+        	@param r,g,b,a	The four colour components, range 0.0f to 1.0f
+        					(an exception to this case exists for floating point pixel
+        					formats, which don't clamp to 0.0f..1.0f)
+        	@param pf		Pixelformat in which to write the colour
+        	@param dest		Destination memory location
+        */
+        static void packColour(const float r, const float g, const float b, const float a, const PixelFormat pf,  void* dest);
+
+        /** Unpack a colour value from memory
+        	@param colour	The colour is returned here
+        	@param pf		Pixelformat in which to read the colour
+        	@param src		Source memory location
+        */
+        static void unpackColour(ColourValue *colour, PixelFormat pf,  const void* src);
+        /** Unpack a colour value from memory
+        	@param r,g,b,a	The colour is returned here (as byte)
+        	@param pf		Pixelformat in which to read the colour
+        	@param src		Source memory location
+        	@remarks 	This function returns the colour components in 8 bit precision,
+        		this will lose precision when coming from PF_A2R10G10B10 or floating
+        		point formats.  
+        */
+        static void unpackColour(uint8 *r, uint8 *g, uint8 *b, uint8 *a, PixelFormat pf,  const void* src);
+        /** Unpack a colour value from memory
+        	@param r,g,b,a	The colour is returned here (as float)
+        	@param pf		Pixelformat in which to read the colour
+        	@param src		Source memory location
+        */
+        static void unpackColour(float *r, float *g, float *b, float *a, PixelFormat pf,  const void* src); 
+        
+        /** Convert consecutive pixels from one format to another. No dithering or filtering is being done. 
+         	Converting from RGB to luminance takes the R channel.  In case the source and destination format match,
+         	just a copy is done.
+         	@param	src			Pointer to source region
+         	@param	srcFormat	Pixel format of source region
+         	@param   dst			Pointer to destination region
+         	@param	dstFormat	Pixel format of destination region
+         */
+        static void bulkPixelConversion(void *src, PixelFormat srcFormat, void *dest, PixelFormat dstFormat, unsigned int count);
+
+      	/** Convert pixels from one format to another. No dithering or filtering is being done. Converting
+          	from RGB to luminance takes the R channel. 
+		 	@param	src			PixelBox containing the source pixels, pitches and format
+		 	@param	dst			PixelBox containing the destination pixels, pitches and format
+		 	@remarks The source and destination boxes must have the same
+         	dimensions. In case the source and destination format match, a plain copy is done.
+        */
+        static void bulkPixelConversion(const PixelBox &src, const PixelBox &dst);
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgrePlane.h
===================================================================
--- /OgreMain/include/OgrePlane.h	(revision 5)
+++ /OgreMain/include/OgrePlane.h	(revision 5)
@@ -0,0 +1,154 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+// Original free version by:
+// Magic Software, Inc.
+// http://www.geometrictools.com/
+// Copyright (c) 2000, All Rights Reserved
+
+#ifndef __Plane_H__
+#define __Plane_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreVector3.h"
+
+namespace Ogre {
+
+    /** Defines a plane in 3D space.
+        @remarks
+            A plane is defined in 3D space by the equation
+            Ax + By + Cz + D = 0
+        @par
+            This equates to a vector (the normal of the plane, whose x, y
+            and z components equate to the coefficients A, B and C
+            respectively), and a constant (D) which is the distance along
+            the normal you have to go to move the plane back to the origin.
+     */
+    class _OgreExport Plane
+    {
+    public:
+        /** Default constructor - sets everything to 0.
+        */
+        Plane ();
+        Plane (const Plane& rhs);
+        /** Construct a plane through a normal, and a distance to move the plane along the normal.*/
+        Plane (const Vector3& rkNormal, Real fConstant);
+        Plane (const Vector3& rkNormal, const Vector3& rkPoint);
+        Plane (const Vector3& rkPoint0, const Vector3& rkPoint1,
+            const Vector3& rkPoint2);
+
+        /** The "positive side" of the plane is the half space to which the
+            plane normal points. The "negative side" is the other half
+            space. The flag "no side" indicates the plane itself.
+        */
+        enum Side
+        {
+            NO_SIDE,
+            POSITIVE_SIDE,
+            NEGATIVE_SIDE,
+            BOTH_SIDE
+        };
+
+        Side getSide (const Vector3& rkPoint) const;
+
+        /**
+        returns the side where the aligneBox is. the flag BOTH_SIDE indicates an intersecting box.
+        one corner ON the plane is sufficient to consider the box and the plane intersecting.
+        */
+        Side getSide (const AxisAlignedBox& rkBox) const;
+
+        /** Returns which side of the plane that the given box lies on.
+            The box is defined as centre/half-size pairs for effectively.
+        @param centre The centre of the box.
+        @param halfSize The half-size of the box.
+        @returns
+            POSITIVE_SIDE if the box complete lies on the "positive side" of the plane,
+            NEGATIVE_SIDE if the box complete lies on the "negative side" of the plane,
+            and BOTH_SIDE if the box intersects the plane.
+        */
+        Side getSide (const Vector3& centre, const Vector3& halfSize) const;
+
+        /** This is a pseudodistance. The sign of the return value is
+            positive if the point is on the positive side of the plane,
+            negative if the point is on the negative side, and zero if the
+            point is on the plane.
+            @par
+            The absolute value of the return value is the true distance only
+            when the plane normal is a unit length vector.
+        */
+        Real getDistance (const Vector3& rkPoint) const;
+
+        /** Redefine this plane based on 3 points. */
+        void redefine(const Vector3& rkPoint0, const Vector3& rkPoint1,
+            const Vector3& rkPoint2);
+
+		/** Redefine this plane based on a normal and a point. */
+		void redefine(const Vector3& rkNormal, const Vector3& rkPoint);
+
+		/** Project a vector onto the plane. 
+		@remarks This gives you the element of the input vector that is perpendicular 
+			to the normal of the plane. You can get the element which is parallel
+			to the normal of the plane by subtracting the result of this method
+			from the original vector, since parallel + perpendicular = original.
+		@param v The input vector
+		*/
+		Vector3 projectVector(const Vector3& v) const;
+
+        /** Normalises the plane.
+            @remarks
+                This method normalises the plane's normal and the length scale of d
+                is as well.
+            @note
+                This function will not crash for zero-sized vectors, but there
+                will be no changes made to their components.
+            @returns The previous length of the plane's normal.
+        */
+        Real normalise(void);
+
+		Vector3 normal;
+        Real d;
+
+        /// Comparison operator
+        bool operator==(const Plane& rhs) const
+        {
+            return (rhs.d == d && rhs.normal == normal);
+        }
+        bool operator!=(const Plane& rhs) const
+        {
+            return (rhs.d != d && rhs.normal != normal);
+        }
+
+        _OgreExport friend std::ostream& operator<< (std::ostream& o, const Plane& p);
+    };
+
+    typedef std::vector<Plane> PlaneList;
+
+} // namespace Ogre
+
+#endif
Index: /OgreMain/include/OgrePlaneBoundedVolume.h
===================================================================
--- /OgreMain/include/OgrePlaneBoundedVolume.h	(revision 5)
+++ /OgreMain/include/OgrePlaneBoundedVolume.h	(revision 5)
@@ -0,0 +1,128 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __PlaneBoundedVolume_H_
+#define __PlaneBoundedVolume_H_
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+#include "OgreAxisAlignedBox.h"
+#include "OgreSphere.h"
+#include "OgreMath.h"
+#include "OgrePlane.h"
+
+namespace Ogre {
+
+    /** Represents a convex volume bounded by planes.
+    */
+    class _OgreExport PlaneBoundedVolume
+    {
+    public:
+        typedef std::vector<Plane> PlaneList;
+        /// Publicly accessible plane list, you can modify this direct
+        PlaneList planes;
+        Plane::Side outside;
+
+        PlaneBoundedVolume() :outside(Plane::NEGATIVE_SIDE) {}
+        /** Constructor, determines which side is deemed to be 'outside' */
+        PlaneBoundedVolume(Plane::Side theOutside) 
+            : outside(theOutside) {}
+
+        /** Intersection test with AABB
+        @remarks May return false positives but will never miss an intersection.
+        */
+        inline bool intersects(const AxisAlignedBox& box) const
+        {
+            if (box.isNull()) return false;
+            if (box.isInfinite()) return true;
+
+            // Get centre of the box
+            Vector3 centre = box.getCenter();
+            // Get the half-size of the box
+            Vector3 halfSize = box.getHalfSize();
+            
+            PlaneList::const_iterator i, iend;
+            iend = planes.end();
+            for (i = planes.begin(); i != iend; ++i)
+            {
+                const Plane& plane = *i;
+
+                Plane::Side side = plane.getSide(centre, halfSize);
+                if (side == outside)
+                {
+                    // Found a splitting plane therefore return not intersecting
+                    return false;
+                }
+            }
+
+            // couldn't find a splitting plane, assume intersecting
+            return true;
+
+        }
+        /** Intersection test with Sphere
+        @remarks May return false positives but will never miss an intersection.
+        */
+        inline bool intersects(const Sphere& sphere) const
+        {
+            PlaneList::const_iterator i, iend;
+            iend = planes.end();
+            for (i = planes.begin(); i != iend; ++i)
+            {
+                const Plane& plane = *i;
+
+                // Test which side of the plane the sphere is
+                Real d = plane.getDistance(sphere.getCenter());
+                // Negate d if planes point inwards
+                if (outside == Plane::NEGATIVE_SIDE) d = -d;
+
+                if ( (d - sphere.getRadius()) > 0)
+                    return false;
+            }
+
+            return true;
+
+        }
+
+        /** Intersection test with a Ray
+        @returns std::pair of hit (bool) and distance
+        @remarks May return false positives but will never miss an intersection.
+        */
+        inline std::pair<bool, Real> intersects(const Ray& ray)
+        {
+            return Math::intersects(ray, planes, outside == Plane::POSITIVE_SIDE);
+        }
+
+    };
+
+    typedef std::vector<PlaneBoundedVolume> PlaneBoundedVolumeList;
+
+
+}
+
+#endif
+
Index: /OgreMain/include/OgrePlatform.h
===================================================================
--- /OgreMain/include/OgrePlatform.h	(revision 5)
+++ /OgreMain/include/OgrePlatform.h	(revision 5)
@@ -0,0 +1,219 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Platform_H_
+#define __Platform_H_
+
+#include "OgreConfig.h"
+
+namespace Ogre {
+/* Initial platform/compiler-related stuff to set.
+*/
+#define OGRE_PLATFORM_WIN32 1
+#define OGRE_PLATFORM_LINUX 2
+#define OGRE_PLATFORM_APPLE 3
+
+#define OGRE_COMPILER_MSVC 1
+#define OGRE_COMPILER_GNUC 2
+#define OGRE_COMPILER_BORL 3
+
+#define OGRE_ENDIAN_LITTLE 1
+#define OGRE_ENDIAN_BIG 2
+
+#define OGRE_ARCHITECTURE_32 1
+#define OGRE_ARCHITECTURE_64 2
+
+/* Finds the compiler type and version.
+*/
+#if defined( _MSC_VER )
+#   define OGRE_COMPILER OGRE_COMPILER_MSVC
+#   define OGRE_COMP_VER _MSC_VER
+
+#elif defined( __GNUC__ )
+#   define OGRE_COMPILER OGRE_COMPILER_GNUC
+#   define OGRE_COMP_VER (((__GNUC__)*100) + \
+        (__GNUC_MINOR__*10) + \
+        __GNUC_PATCHLEVEL__)
+
+#elif defined( __BORLANDC__ )
+#   define OGRE_COMPILER OGRE_COMPILER_BORL
+#   define OGRE_COMP_VER __BCPLUSPLUS__
+
+#else
+#   pragma error "No known compiler. Abort! Abort!"
+
+#endif
+
+/* See if we can use __forceinline or if we need to use __inline instead */
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+#   if OGRE_COMP_VER >= 1200
+#       define FORCEINLINE __forceinline
+#   endif
+#elif defined(__MINGW32__)
+#   if !defined(FORCEINLINE)
+#       define FORCEINLINE __inline
+#   endif
+#else
+#   define FORCEINLINE __inline
+#endif
+
+/* Finds the current platform */
+
+#if defined( __WIN32__ ) || defined( _WIN32 )
+#   define OGRE_PLATFORM OGRE_PLATFORM_WIN32
+
+#elif defined( __APPLE_CC__)
+#   define OGRE_PLATFORM OGRE_PLATFORM_APPLE
+
+#else
+#   define OGRE_PLATFORM OGRE_PLATFORM_LINUX
+#endif
+
+    /* Find the arch type */
+#if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__)
+#   define OGRE_ARCH_TYPE OGRE_ARCHITECTURE_64
+#else
+#   define OGRE_ARCH_TYPE OGRE_ARCHITECTURE_32
+#endif
+
+// For generating compiler warnings - should work on any compiler
+// As a side note, if you start your message with 'Warning: ', the MSVC
+// IDE actually does catch a warning :)
+#define OGRE_QUOTE_INPLACE(x) # x
+#define OGRE_QUOTE(x) OGRE_QUOTE_INPLACE(x)
+#define OGRE_WARN( x )  message( __FILE__ "(" QUOTE( __LINE__ ) ") : " x "\n" )
+
+//----------------------------------------------------------------------------
+// Windows Settings
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+
+// If we're not including this from a client build, specify that the stuff
+// should get exported. Otherwise, import it.
+#	if defined( OGRE_STATIC_LIB )
+		// Linux compilers don't have symbol import/export directives.
+#   	define _OgreExport
+#   	define _OgrePrivate
+#   else
+#   	if defined( OGRE_NONCLIENT_BUILD )
+#       	define _OgreExport __declspec( dllexport )
+#   	else
+#           if defined( __MINGW32__ )
+#               define _OgreExport
+#           else
+#       	    define _OgreExport __declspec( dllimport )
+#           endif
+#   	endif
+#   	define _OgrePrivate
+#	endif
+// Win32 compilers use _DEBUG for specifying debug builds.
+#   ifdef _DEBUG
+#       define OGRE_DEBUG_MODE 1
+#   else
+#       define OGRE_DEBUG_MODE 0
+#   endif
+
+// Disable unicode support on MingW at the moment, poorly supported in stdlibc++
+// STLPORT fixes this though so allow if found
+// MinGW C++ Toolkit supports unicode and sets the define __MINGW32_TOOLKIT_UNICODE__ in _mingw.h
+#if defined( __MINGW32__ ) && !defined(_STLPORT_VERSION)
+#   include<_mingw.h>
+#   if defined(__MINGW32_TOOLBOX_UNICODE__)
+#	    define OGRE_UNICODE_SUPPORT 1
+#   else
+#       define OGRE_UNICODE_SUPPORT 0
+#   endif
+#else
+#	define OGRE_UNICODE_SUPPORT 1
+#endif
+
+#endif
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+// Linux/Apple Settings
+#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+
+// Enable GCC symbol visibility
+#   if defined( OGRE_GCC_VISIBILITY )
+#       define _OgreExport  __attribute__ ((visibility("default")))
+#       define _OgrePrivate __attribute__ ((visibility("hidden")))
+#   else
+#       define _OgreExport
+#       define _OgrePrivate
+#   endif
+
+// A quick define to overcome different names for the same function
+#   define stricmp strcasecmp
+
+// Unlike the Win32 compilers, Linux compilers seem to use DEBUG for when
+// specifying a debug build.
+// (??? this is wrong, on Linux debug builds aren't marked in any way unless
+// you mark it yourself any way you like it -- zap ???)
+#   ifdef DEBUG
+#       define OGRE_DEBUG_MODE 1
+#   else
+#       define OGRE_DEBUG_MODE 0
+#   endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+    #define OGRE_PLATFORM_LIB "OgrePlatform.bundle"
+#else
+    //OGRE_PLATFORM_LINUX
+    #define OGRE_PLATFORM_LIB "libOgrePlatform.so"
+#endif
+
+// Always enable unicode support for the moment
+// Perhaps disable in old versions of gcc if necessary
+#define OGRE_UNICODE_SUPPORT 1
+
+#endif
+
+//For apple, we always have a custom config.h file
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#    include "config.h"
+#endif
+
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+// Endian Settings
+// check for BIG_ENDIAN config flag, set OGRE_ENDIAN correctly
+#ifdef OGRE_CONFIG_BIG_ENDIAN
+#    define OGRE_ENDIAN OGRE_ENDIAN_BIG
+#else
+#    define OGRE_ENDIAN OGRE_ENDIAN_LITTLE
+#endif
+
+// Integer formats of fixed bit width
+typedef unsigned int uint32;
+typedef unsigned short uint16;
+typedef unsigned char uint8;
+
+}
+
+#endif
Index: /OgreMain/include/OgrePlatformInformation.h
===================================================================
--- /OgreMain/include/OgrePlatformInformation.h	(revision 5)
+++ /OgreMain/include/OgrePlatformInformation.h	(revision 5)
@@ -0,0 +1,168 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __PlatformInformation_H__
+#define __PlatformInformation_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+//
+// TODO: Puts following macros into OgrePlatform.h?
+//
+
+/* Initial CPU stuff to set.
+*/
+#define OGRE_CPU_UNKNOWN    0
+#define OGRE_CPU_X86        1
+#define OGRE_CPU_PPC        2
+
+/* Find CPU type
+*/
+#if (defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))) || \
+    (defined(__GNUC__) && (defined(__i386__) /*|| defined(__x86_64__)*/))
+#   define OGRE_CPU OGRE_CPU_X86
+
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE && defined(__BIG_ENDIAN__)
+#   define OGRE_CPU OGRE_CPU_PPC
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#	define OGRE_CPU OGRE_CPU_X86
+
+#else
+#   define OGRE_CPU OGRE_CPU_UNKNOWN
+#endif
+
+/* Find how to declare aligned variable.
+*/
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+#   define OGRE_ALIGNED_DECL(type, var, alignment)  __declspec(align(alignment)) type var
+
+#elif OGRE_COMPILER == OGRE_COMPILER_GNUC
+#   define OGRE_ALIGNED_DECL(type, var, alignment)  type var __attribute__((__aligned__(alignment)))
+
+#else
+#   define OGRE_ALIGNED_DECL(type, var, alignment)  type var
+#endif
+
+/** Find perfect alignment (should supports SIMD alignment if SIMD available)
+*/
+#if OGRE_CPU == OGRE_CPU_X86
+#   define OGRE_SIMD_ALIGNMENT  16
+
+#else
+#   define OGRE_SIMD_ALIGNMENT  16
+#endif
+
+/* Declare variable aligned to SIMD alignment.
+*/
+#define OGRE_SIMD_ALIGNED_DECL(type, var)   OGRE_ALIGNED_DECL(type, var, OGRE_SIMD_ALIGNMENT)
+
+/* Define whether or not Ogre compiled with SSE supports.
+*/
+#if OGRE_DOUBLE_PRECISION == 0 && OGRE_CPU == OGRE_CPU_X86 && OGRE_COMPILER == OGRE_COMPILER_MSVC
+#   define __OGRE_HAVE_SSE  1
+#elif OGRE_DOUBLE_PRECISION == 0 && OGRE_CPU == OGRE_CPU_X86 && OGRE_COMPILER == OGRE_COMPILER_GNUC
+#   define __OGRE_HAVE_SSE  1
+#endif
+
+
+#ifndef __OGRE_HAVE_SSE
+#   define __OGRE_HAVE_SSE  0
+#endif
+
+
+
+
+    /** Class which provides the run-time platform information Ogre runs on.
+        @remarks
+            Ogre is designed to be platform-independent, but there some platform
+            and run-time environment specific optimised functions are built-in
+            for maximise performance, and those special optimised routines are
+            need to determine run-time environment for select variant executing
+            path.
+        @par
+            This class manages that provides a couple of functions to determine
+            platform information of the run-time environment.
+        @note
+            This class is supposed to use by advanced user only.
+    */
+    class _OgreExport PlatformInformation
+    {
+    public:
+
+        /// Enum describing the different CPU features we want to check for, platform-dependent
+        enum CpuFeatures
+        {
+#if OGRE_CPU == OGRE_CPU_X86
+            CPU_FEATURE_SSE         = 1 << 0,
+            CPU_FEATURE_SSE2        = 1 << 1,
+            CPU_FEATURE_SSE3        = 1 << 2,
+            CPU_FEATURE_MMX         = 1 << 3,
+            CPU_FEATURE_MMXEXT      = 1 << 4,
+            CPU_FEATURE_3DNOW       = 1 << 5,
+            CPU_FEATURE_3DNOWEXT    = 1 << 6,
+            CPU_FEATURE_CMOV        = 1 << 7,
+            CPU_FEATURE_TSC         = 1 << 8,
+            CPU_FEATURE_FPU         = 1 << 9,
+            CPU_FEATURE_PRO         = 1 << 10,
+            CPU_FEATURE_HTT         = 1 << 11,
+#endif
+
+            CPU_FEATURE_NONE        = 0
+        };
+
+        /** Gets a string of the CPU identifier.
+        @note
+            Actual detecting are performs in the first time call to this function,
+            and then all future calls with return internal cached value.
+        */
+        static const String& getCpuIdentifier(void);
+
+        /** Gets a or-masked of enum CpuFeatures that are supported by the CPU.
+        @note
+            Actual detecting are performs in the first time call to this function,
+            and then all future calls with return internal cached value.
+        */
+        static uint getCpuFeatures(void);
+
+		/** Gets whether a specific feature is supported by the CPU.
+		@note
+			Actual detecting are performs in the first time call to this function,
+			and then all future calls with return internal cached value.
+		*/
+		static bool hasCpuFeature(CpuFeatures feature);
+
+
+		/** Write the CPU information to the passed in Log */
+		static void log(Log* pLog);
+
+    };
+
+}
+
+#endif  // __PlatformInformation_H__
Index: /OgreMain/include/OgrePlugin.h
===================================================================
--- /OgreMain/include/OgrePlugin.h	(revision 5)
+++ /OgreMain/include/OgrePlugin.h	(revision 5)
@@ -0,0 +1,132 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OGREPLUGIN_H__
+#define __OGREPLUGIN_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre
+{
+	/** Class defining a generic OGRE plugin.
+	@remarks
+		OGRE is very plugin-oriented and you can customise much of its behaviour
+		by registering new plugins, dynamically if you are using dynamic linking.
+		This class abstracts the generic interface that all plugins must support.
+		Within the implementations of this interface, the plugin must call other
+		OGRE classes in order to register the detailed customisations it is
+		providing, e.g. registering a new SceneManagerFactory, a new
+		MovableObjectFactory, or a new RenderSystem.
+	@par
+		Plugins can be linked statically or dynamically. If they are linked
+		dynamically (ie the plugin is in a DLL or Shared Object file), then you
+		load the plugin by calling the Root::loadPlugin method (or some other
+		mechanism which leads to that call, e.g. plugins.cfg), passing the name of
+		the DLL. OGRE will then call a global init function on that DLL, and it
+		will be expected to register one or more Plugin implementations using
+		Root::installPlugin. The procedure is very similar if you use a static
+		linked plugin, except that you simply instantiate the Plugin implementation
+		yourself and pass it to Root::installPlugin.
+	@note
+		Lifecycle of a Plugin instance is very important. The Plugin instance must
+		remain valid until the Plugin is uninstalled. Here are the things you
+		must bear in  mind:
+		<ul><li>If your plugin is in a DLL:
+		<ul><li>Create the Plugin instance and call Root::installPlugin in dllStartPlugin</li>
+		<li>Call Root::uninstallPlugin, then delete it in dllStopPlugin</li></ul>
+		<li>If your plugin is statically linked in your app:
+		<ul><li>Create the Plugin anytime you like</li>
+		<li>Call Root::installPlugin any time whilst Root is valid</li>
+		<li>Call Root::uninstallPlugin if you like so long as Root is valid. However,
+			it will be done for you when Root is destroyed, so the Plugin instance must
+			still be valid at that point if you haven't manually uninstalled it.</li></ul>
+		</ul>
+		The install and unninstall methods will be called when the plugin is
+		installed or uninstalled. The initialise and shutdown will be called when
+		there is a system initialisation or shutdown, e.g. when Root::initialise 
+		or Root::shutdown are called.
+	*/
+	class _OgreExport Plugin
+	{
+	public:
+		Plugin() {}
+		virtual ~Plugin() {}
+
+		/** Get the name of the plugin. 
+		@remarks An implementation must be supplied for this method to uniquely
+			identify the plugin.
+		*/
+		virtual const String& getName() const = 0;
+
+		/** Perform the plugin initial installation sequence. 
+		@remarks An implementation must be supplied for this method. It must perform
+		the startup tasks necessary to install any rendersystem customisations 
+		or anything else that is not dependent on system initialisation, ie
+		only dependent on the core of Ogre. It must not perform any
+		operations that would create rendersystem-specific objects at this stage,
+		that should be done in initialise().
+		*/
+		virtual void install() = 0;
+
+		/** Perform any tasks the plugin needs to perform on full system
+			initialisation.
+		@remarks An implementation must be supplied for this method. It is called 
+			just after the system is fully initialised (either after Root::initialise
+			if a window is created then, or after the frist window is created)
+			and therefore all rendersystem functionality is available at this
+			time. You can use this hook to create any resources which are 
+			dependent on a rendersystem or have rendersystem-specific implementations.
+		*/
+		virtual void initialise() = 0;
+
+		/** Perform any tasks the plugin needs to perform when the system is shut down.
+		@remarks An implementation must be supplied for this method.
+		This method is called just before key parts of the system are unloaded, 
+		such as rendersystems being shut down. You should use this hook to free up 
+		resources and decouple custom objects from the OGRE system, whilst all the
+		instances of other plugins (e.g. rendersystems) still exist.
+		*/
+		virtual void shutdown() = 0;
+
+		/** Perform the final plugin uninstallation sequence. 
+		@remarks An implementation must be supplied for this method. It must perform
+		the cleanup tasks which haven't already been performed in shutdown()
+		(e.g. final deletion of custom instances, if you kept them around incase
+		the system was reinitialised). At this stage you cannot be sure what other
+		plugins are still loaded or active. It must therefore not perform any
+		operations that would reference any rendersystem-specific objects - those
+		should have been sorted out in the 'shutdown' method.
+		*/
+		virtual void uninstall() = 0;
+	};
+
+}
+
+#endif
+
+
Index: /OgreMain/include/OgrePolygon.h
===================================================================
--- /OgreMain/include/OgrePolygon.h	(revision 5)
+++ /OgreMain/include/OgrePolygon.h	(revision 5)
@@ -0,0 +1,130 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Copyright (c) 2006 Matthias Fink, netAllied GmbH <matthias.fink@web.de>								
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Polygon_H__
+#define __Polygon_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreVector3.h"
+
+
+namespace Ogre
+{
+
+
+	/** The class represents a polygon in 3D space.
+	@remarks
+		It is made up of 3 or more vertices in a single plane, listed in 
+		counter-clockwise order.
+	*/
+	class _OgreExport Polygon
+	{
+
+	public:
+		typedef std::vector<Vector3>				VertexList;
+
+		typedef std::multimap<Vector3, Vector3>		EdgeMap;
+		typedef std::pair< Vector3, Vector3>		Edge;
+
+	protected:
+		VertexList		mVertexList;
+		Vector3			mNormal;
+		bool			mIsNormalSet;
+		/** Updates the normal.
+		*/
+		void updateNormal(void);
+
+
+	public:
+		Polygon();
+		~Polygon();
+		Polygon( const Polygon& cpy );
+
+		/** Inserts a vertex at a specific position.
+		@note Vertices must be coplanar.
+		*/
+		void insertVertex(const Vector3& vdata, size_t vertexIndex);
+		/** Inserts a vertex at the end of the polygon.
+		@note Vertices must be coplanar.
+		*/
+		void insertVertex(const Vector3& vdata);
+
+		/** Returns a vertex.
+		*/
+		const Vector3& getVertex(size_t vertex) const;
+
+		/** Sets a specific vertex of a polygon.
+		@note Vertices must be coplanar.
+		*/
+		void setVertex(const Vector3& vdata, size_t vertexIndex);
+
+		/** Removes duplicate vertices from a polygon.
+		*/
+		void removeDuplicates(void);
+
+		/** Vertex count.
+		*/
+		size_t getVertexCount(void) const;
+
+		/** Returns the polygon normal.
+		*/
+		const Vector3& getNormal(void);
+
+		/** Deletes a specific vertex.
+		*/
+		void deleteVertex(size_t vertex);
+
+		/** Stores the edges of the polygon in ccw order.
+			The vertices are copied so the user has to take the 
+			deletion into account.
+		*/
+		void storeEdges(EdgeMap *edgeMap) const;
+
+		/** Resets the object.
+		*/
+		void reset(void);
+
+		/** Determines if the current object is equal to the compared one.
+		*/
+		bool operator == (const Polygon& rhs) const;
+
+		/** Determines if the current object is not equal to the compared one.
+		*/
+		bool operator != (const Polygon& rhs) const
+		{ return !( *this == rhs ); }
+
+		/** Prints out the polygon data.
+		*/
+		_OgreExport friend std::ostream& operator<< ( std::ostream& strm, const Polygon& poly );
+
+	};
+
+}
+
+#endif
Index: /OgreMain/include/OgrePose.h
===================================================================
--- /OgreMain/include/OgrePose.h	(revision 5)
+++ /OgreMain/include/OgrePose.h	(revision 5)
@@ -0,0 +1,111 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2005 The OGRE Team
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OGRE_POSE_H
+#define __OGRE_POSE_H
+
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreVector3.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre {
+
+	/** A pose is a linked set of vertex offsets applying to one set of vertex
+		data. 
+	@remarks
+		The target index referred to by the pose has a meaning set by the user
+		of this class; but for example when used by Mesh it refers to either the
+		Mesh shared geometry (0) or a SubMesh dedicated geometry (1+).
+		Pose instances can be referred to by keyframes in VertexAnimationTrack in
+		order to animate based on blending poses together.
+	*/
+	class _OgreExport Pose
+	{
+	public:
+		/** Constructor
+			@param target The target vertexdata index (0 for shared, 1+ for 
+				dedicated at the submesh index + 1)
+			@param name Optional name
+		*/
+		Pose(ushort target, const String& name = StringUtil::BLANK);
+		virtual ~Pose();
+		/// Return the name of the pose (may be blank)
+		const String& getName(void) const { return mName; }
+		/// Return the target geometry index of the pose
+		ushort getTarget(void) const { return mTarget; }
+		/// A collection of vertex offsets based on the vertex index
+		typedef std::map<size_t, Vector3> VertexOffsetMap;
+		/// An iterator over the vertex offsets
+		typedef MapIterator<VertexOffsetMap> VertexOffsetIterator;
+		/// An iterator over the vertex offsets
+		typedef ConstMapIterator<VertexOffsetMap> ConstVertexOffsetIterator;
+
+		/** Adds an offset to a vertex for this pose. 
+		@param index The vertex index
+		@param offset The position offset for this pose
+		*/
+		void addVertex(size_t index, const Vector3& offset);
+
+		/** Remove a vertex offset. */
+		void removeVertex(size_t index);
+
+		/** Clear all vertex offsets. */
+		void clearVertexOffsets(void);
+
+		/** Gets an iterator over all the vertex offsets. */
+		ConstVertexOffsetIterator getVertexOffsetIterator(void) const;
+		/** Gets an iterator over all the vertex offsets. */
+		VertexOffsetIterator getVertexOffsetIterator(void);
+		/** Gets a const reference to the vertex offsets. */
+		const VertexOffsetMap& getVertexOffsets(void) const { return mVertexOffsetMap; }
+
+		/** Get a hardware vertex buffer version of the vertex offsets. */
+		const HardwareVertexBufferSharedPtr& _getHardwareVertexBuffer(size_t numVertices) const;
+
+		/** Clone this pose and create another one configured exactly the same
+			way (only really useful for cloning holders of this class).
+		*/
+		Pose* clone(void) const;
+	protected:
+		/// Target geometry index
+		ushort mTarget;
+		/// Optional name
+		String mName;
+		/// Primary storage, sparse vertex use
+		VertexOffsetMap mVertexOffsetMap;
+		/// Derived hardware buffer, covers all vertices
+		mutable HardwareVertexBufferSharedPtr mBuffer;
+	};
+	typedef std::vector<Pose*> PoseList;
+
+
+}
+
+#endif
Index: /OgreMain/include/OgrePredefinedControllers.h
===================================================================
--- /OgreMain/include/OgrePredefinedControllers.h	(revision 5)
+++ /OgreMain/include/OgrePredefinedControllers.h	(revision 5)
@@ -0,0 +1,285 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __PredefinedControllers_H__
+#define __PredefinedControllers_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreCommon.h"
+#include "OgreController.h"
+#include "OgreFrameListener.h"
+#include "OgreGpuProgram.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    // Controller Values
+    //-----------------------------------------------------------------------
+    /** Predefined controller value for getting the latest frame time.
+    */
+    class _OgreExport FrameTimeControllerValue : public ControllerValue<Real>, public FrameListener
+    {
+    protected:
+        Real mFrameTime;
+		Real mTimeFactor;
+		Real mElapsedTime;
+		Real mFrameDelay;
+
+    public:
+        FrameTimeControllerValue();
+        bool frameEnded(const FrameEvent &evt);
+        bool frameStarted(const FrameEvent &evt);
+        Real getValue(void) const;
+        void setValue(Real value);
+		Real getTimeFactor(void) const;
+		void setTimeFactor(Real tf);
+		Real getFrameDelay(void) const;
+		void setFrameDelay(Real fd);
+		Real getElapsedTime(void) const;
+		void setElapsedTime(Real elapsedTime);
+    };
+
+    //-----------------------------------------------------------------------
+    /** Predefined controller value for getting / setting the frame number of a texture layer
+    */
+    class _OgreExport TextureFrameControllerValue : public ControllerValue<Real>
+    {
+    protected:
+        TextureUnitState* mTextureLayer;
+    public:
+        TextureFrameControllerValue(TextureUnitState* t);
+
+        /** Gets the frame number as a parametric value in the range [0,1]
+        */
+        Real getValue(void) const;
+        /** Sets the frame number as a parametric value in the range [0,1]; the actual frame number is value * (numFrames-1).
+        */
+        void setValue(Real value);
+
+    };
+    //-----------------------------------------------------------------------
+    /** Predefined controller value for getting / setting a texture coordinate modifications (scales and translates).
+        @remarks
+            Effects can be applied to the scale or the offset of the u or v coordinates, or both. If separate
+            modifications are required to u and v then 2 instances are required to control both independently, or 4
+            if you ant separate u and v scales as well as separate u and v offsets.
+        @par
+            Because of the nature of this value, it can accept values outside the 0..1 parametric range.
+    */
+    class _OgreExport TexCoordModifierControllerValue : public ControllerValue<Real>
+    {
+    protected:
+        bool mTransU, mTransV;
+        bool mScaleU, mScaleV;
+        bool mRotate;
+        TextureUnitState* mTextureLayer;
+    public:
+        /** Constructor.
+            @param
+                t TextureUnitState to apply the modification to.
+            @param
+                translateU If true, the u coordinates will be translated by the modification.
+            @param
+                translateV If true, the v coordinates will be translated by the modification.
+            @param
+                scaleU If true, the u coordinates will be scaled by the modification.
+            @param
+                scaleV If true, the v coordinates will be scaled by the modification.
+            @param
+                rotate If true, the texture will be rotated by the modification.
+        */
+        TexCoordModifierControllerValue(TextureUnitState* t, bool translateU = false, bool translateV = false,
+            bool scaleU = false, bool scaleV = false, bool rotate = false );
+
+        Real getValue(void) const;
+        void setValue(Real value);
+
+    };
+
+    //-----------------------------------------------------------------------
+    /** Predefined controller value for setting a single floating-
+	    point value in a constant paramter of a vertex or fragment program.
+    @remarks
+		Any value is accepted, it is propagated into the 'x'
+		component of the constant register identified by the index. If you
+		need to use named parameters, retrieve the index from the param
+		object before setting this controller up.
+	@note
+		Retrieving a value from the program parameters is not currently 
+		supported, therefore do not use this controller value as a source,
+		only as a target.
+    */
+    class _OgreExport FloatGpuParameterControllerValue : public ControllerValue<Real>
+    {
+    protected:
+		/// The parameters to access
+		GpuProgramParameters* mParams;
+		/// The index of the parameter to e read or set
+		size_t mParamIndex;
+    public:
+        /** Constructor.
+		    @param
+				params The parameters object to access
+            @param
+                index The index of the parameter to be set
+        */
+        FloatGpuParameterControllerValue(GpuProgramParameters* params,
+				size_t index );
+
+        ~FloatGpuParameterControllerValue() {}
+
+        Real getValue(void) const;
+        void setValue(Real value);
+
+    };
+    //-----------------------------------------------------------------------
+    // Controller functions
+    //-----------------------------------------------------------------------
+
+	/** Predefined controller function which just passes through the original source
+	directly to dest.
+	*/
+	class _OgreExport PassthroughControllerFunction : public ControllerFunction<Real>
+	{
+	public:
+		/** Constructor.
+		@param
+		sequenceTime The amount of time in seconds it takes to loop through the whole animation sequence.
+		@param
+		timeOffset The offset in seconds at which to start (default is start at 0)
+		*/
+		PassthroughControllerFunction(bool deltaInput = false);
+
+		/** Overriden function.
+		*/
+		Real calculate(Real source);
+	};
+
+	/** Predefined controller function for dealing with animation.
+    */
+    class _OgreExport AnimationControllerFunction : public ControllerFunction<Real>
+    {
+    protected:
+        Real mSeqTime;
+        Real mTime;
+    public:
+        /** Constructor.
+            @param
+                sequenceTime The amount of time in seconds it takes to loop through the whole animation sequence.
+            @param
+                timeOffset The offset in seconds at which to start (default is start at 0)
+        */
+        AnimationControllerFunction(Real sequenceTime, Real timeOffset = 0.0f);
+
+        /** Overriden function.
+        */
+        Real calculate(Real source);
+
+		/** Set the time value manually. */
+		void setTime(Real timeVal);
+		/** Set the sequence duration value manually. */
+		void setSequenceTime(Real seqVal);
+    };
+
+	//-----------------------------------------------------------------------
+    /** Predefined controller function which simply scales an input to an output value.
+    */
+    class _OgreExport ScaleControllerFunction : public ControllerFunction<Real>
+    {
+    protected:
+        Real mScale;
+    public:
+        /** Constructor, requires a scale factor.
+            @param
+                scalefactor The multipier applied to the input to produce the output.
+            @param
+                deltaInput If true, signifies that the input will be a delta value such that the function should
+                 add it to an internal counter before calculating the output.
+        */
+        ScaleControllerFunction(Real scalefactor, bool deltaInput);
+
+        /** Overriden method.
+        */
+        Real calculate(Real source);
+
+    };
+
+    //-----------------------------------------------------------------------
+    /** Predefined controller function based on a waveform.
+        @remarks
+            A waveform function translates parametric intput to parametric output based on a wave. The factors
+            affecting the function are:
+            - wave type - the shape of the wave
+            - base - the base value of the output from the wave
+            - frequency - the speed of the wave in cycles per second
+            - phase - the offset of the start of the wave, e.g. 0.5 to start half-way through the wave
+            - amplitude - scales the output so that instead of lying within [0,1] it lies within [0,1] * amplitude
+			- duty cycle - the active width of a PWM signal
+        @par
+            Note that for simplicity of integration with the rest of the controller insfrastructure, the output of
+            the wave is parametric i.e. 0..1, rather than the typical wave output of [-1,1]. To compensate for this, the
+            traditional output of the wave is scaled by the following function before output:
+        @par
+            output = (waveoutput + 1) * 0.5
+        @par
+            Hence a wave output of -1 becomes 0, a wave ouput of 1 becomes 1, and a wave output of 0 becomes 0.5.
+    */
+    class _OgreExport WaveformControllerFunction : public ControllerFunction<Real>
+    {
+    protected:
+        WaveformType mWaveType;
+        Real mBase;
+        Real mFrequency;
+        Real mPhase;
+        Real mAmplitude;
+		Real mDutyCycle;
+
+        /** Overridden from ControllerFunction. */
+        Real getAdjustedInput(Real input);
+
+    public:
+        /** Default contructor, requires at least a wave type, other parameters can be defaulted unless required.
+            @param
+                deltaInput If true, signifies that the input will be a delta value such that the function should
+                add it to an internal counter before calculating the output.
+			@param
+				dutyCycle Used in PWM mode to specify the pulse width.
+        */
+        WaveformControllerFunction(WaveformType wType, Real base = 0, Real frequency = 1, Real phase = 0, Real amplitude = 1, bool deltaInput = true, Real dutyCycle = 0.5);
+
+        /** Overriden function.
+        */
+        Real calculate(Real source);
+
+    };
+    //-----------------------------------------------------------------------
+
+}
+
+#endif
Index: /OgreMain/include/OgrePrefabFactory.h
===================================================================
--- /OgreMain/include/OgrePrefabFactory.h	(revision 5)
+++ /OgreMain/include/OgrePrefabFactory.h	(revision 5)
@@ -0,0 +1,66 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __PrefabFactory_H__
+#define __PrefabFactory_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+	/** A factory class that can create various mesh prefabs. 
+	@remarks
+		This class is used by OgreMeshManager to offload the loading of various prefab types 
+		to a central location.
+	*/
+	class _OgreExport PrefabFactory
+	{
+	public:
+		/** If the given mesh has a known prefab resource name (e.g "Prefab_Plane") 
+		    then this prefab will be created as a submesh of the given mesh.
+
+			@param mesh The mesh that the potential prefab will be created in.
+			@returns true if a prefab has been created, otherwise false.
+		*/
+		static bool createPrefab(Mesh* mesh);
+
+	private:
+		/// Creates a plane as a submesh of the given mesh
+		static void createPlane(Mesh* mesh);
+
+		/// Creates a 100x100x100 cube as a submesh of the given mesh
+		static void createCube(Mesh* mesh);
+
+		/// Creates a sphere with a diameter of 100 units as a submesh of the given mesh
+		static void createSphere(Mesh* mesh);
+	};
+
+} // namespace Ogre
+
+#endif
Index: /OgreMain/include/OgrePrerequisites.h
===================================================================
--- /OgreMain/include/OgrePrerequisites.h	(revision 5)
+++ /OgreMain/include/OgrePrerequisites.h	(revision 5)
@@ -0,0 +1,390 @@
+/*-------------------------------------------------------------------------
+This source file is a part of OGRE
+(Object-oriented Graphics Rendering Engine)
+
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License (LGPL) as
+published by the Free Software Foundation; either version 2.1 of the
+License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA or go to
+http://www.gnu.org/copyleft/lesser.txt
+-------------------------------------------------------------------------*/
+#ifndef __OgrePrerequisites_H__
+#define __OgrePrerequisites_H__
+
+// undefine this to not require new angular units where applicable
+#define OGRE_FORCE_ANGLE_TYPES
+
+// Platform-specific stuff
+#include "OgrePlatform.h"
+
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+// Turn off warnings generated by long std templates
+// This warns about truncation to 255 characters in debug/browse info
+#   pragma warning (disable : 4786)
+
+// Turn off warnings generated by long std templates
+// This warns about truncation to 255 characters in debug/browse info
+#   pragma warning (disable : 4503)
+
+// disable: "conversion from 'double' to 'float', possible loss of data
+#   pragma warning (disable : 4244)
+
+// disable: "truncation from 'double' to 'float'
+#   pragma warning (disable : 4305)
+
+// disable: "<type> needs to have dll-interface to be used by clients'
+// Happens on STL member variables which are not public therefore is ok
+#   pragma warning (disable : 4251)
+
+// disable: "non dll-interface class used as base for dll-interface class"
+// Happens when deriving from Singleton because bug in compiler ignores
+// template export
+#   pragma warning (disable : 4275)
+
+// disable: "C++ Exception Specification ignored"
+// This is because MSVC 6 did not implement all the C++ exception
+// specifications in the ANSI C++ draft.
+#   pragma warning( disable : 4290 )
+
+// disable: "no suitable definition provided for explicit template
+// instantiation request" Occurs in VC7 for no justifiable reason on all
+// #includes of Singleton
+#   pragma warning( disable: 4661)
+
+// disable: deprecation warnings when using CRT calls in VC8
+// These show up on all C runtime lib code in VC8, disable since they clutter
+// the warnings with things we may not be able to do anything about (e.g.
+// generated code from nvparse etc). I doubt very much that these calls
+// will ever be actually removed from VC anyway, it would break too much code.
+#	pragma warning( disable: 4996)
+
+// disable: "conditional expression constant", always occurs on 
+// OGRE_MUTEX_CONDITIONAL when no threading enabled
+#   pragma warning (disable : 201)
+
+#endif
+
+/* Include all the standard header *after* all the configuration
+   settings have been made.
+*/
+//#include "OgreStdHeaders.h"
+
+
+#include "OgreMemoryManager.h"
+
+namespace Ogre {
+    // Define ogre version
+    #define OGRE_VERSION_MAJOR 1
+    #define OGRE_VERSION_MINOR 4
+    #define OGRE_VERSION_PATCH 5
+	#define OGRE_VERSION_SUFFIX ""
+    #define OGRE_VERSION_NAME "Eihort"
+
+    #define OGRE_VERSION    ((OGRE_VERSION_MAJOR << 16) | (OGRE_VERSION_MINOR << 8) | OGRE_VERSION_PATCH)
+
+    // define the real number values to be used
+    // default to use 'float' unless precompiler option set
+    #if OGRE_DOUBLE_PRECISION == 1
+		/** Software floating point type.
+		@note Not valid as a pointer to GPU buffers / parameters
+		*/
+        typedef double Real;
+    #else
+		/** Software floating point type.
+		@note Not valid as a pointer to GPU buffers / parameters
+		*/
+        typedef float Real;
+    #endif
+
+    #if OGRE_COMPILER == OGRE_COMPILER_GNUC && OGRE_COMP_VER >= 310 && !defined(STLPORT)
+    #   define HashMap ::__gnu_cxx::hash_map
+    #else
+    #   if OGRE_COMPILER == OGRE_COMPILER_MSVC
+    #       if OGRE_COMP_VER > 1300 && !defined(_STLP_MSVC)
+    #           define HashMap ::stdext::hash_map
+    #       else
+    #           define HashMap ::std::hash_map
+    #       endif
+    #   else
+    #       define HashMap ::std::hash_map
+    #   endif
+    #endif
+
+    /** In order to avoid finger-aches :)
+    */
+    typedef unsigned char uchar;
+    typedef unsigned short ushort;
+    typedef unsigned int uint;
+	typedef unsigned long ulong;
+
+    /// Useful macros
+    #define OGRE_DELETE(p)       { if(p) { delete (p);     (p)=NULL; } }
+    #define OGRE_DELETE_ARRAY(p) { if(p) { delete[] (p);   (p)=NULL; } }
+
+	#if OGRE_WCHAR_T_STRINGS
+		typedef std::wstring _StringBase;
+	#else
+		typedef std::string _StringBase;
+	#endif
+
+	typedef _StringBase String;
+
+	// Useful threading defines
+	#define OGRE_AUTO_MUTEX_NAME mutex
+	#if OGRE_THREAD_SUPPORT
+		#define OGRE_AUTO_MUTEX mutable boost::recursive_mutex OGRE_AUTO_MUTEX_NAME;
+		#define OGRE_LOCK_AUTO_MUTEX boost::recursive_mutex::scoped_lock ogreAutoMutexLock(OGRE_AUTO_MUTEX_NAME);
+		#define OGRE_MUTEX(name) mutable boost::recursive_mutex name;
+		#define OGRE_STATIC_MUTEX(name) static boost::recursive_mutex name;
+		#define OGRE_STATIC_MUTEX_INSTANCE(name) boost::recursive_mutex name;
+		#define OGRE_LOCK_MUTEX(name) boost::recursive_mutex::scoped_lock ogrenameLock(name);
+		#define OGRE_LOCK_MUTEX_NAMED(mutexName, lockName) boost::recursive_mutex::scoped_lock lockName(mutexName);
+		// like OGRE_AUTO_MUTEX but mutex held by pointer
+		#define OGRE_AUTO_SHARED_MUTEX mutable boost::recursive_mutex *OGRE_AUTO_MUTEX_NAME;
+		#define OGRE_LOCK_AUTO_SHARED_MUTEX assert(OGRE_AUTO_MUTEX_NAME); boost::recursive_mutex::scoped_lock ogreAutoMutexLock(*OGRE_AUTO_MUTEX_NAME);
+		#define OGRE_NEW_AUTO_SHARED_MUTEX assert(!OGRE_AUTO_MUTEX_NAME); OGRE_AUTO_MUTEX_NAME = new boost::recursive_mutex();
+        #define OGRE_DELETE_AUTO_SHARED_MUTEX assert(OGRE_AUTO_MUTEX_NAME); delete OGRE_AUTO_MUTEX_NAME;
+		#define OGRE_COPY_AUTO_SHARED_MUTEX(from) assert(!OGRE_AUTO_MUTEX_NAME); OGRE_AUTO_MUTEX_NAME = from;
+        #define OGRE_SET_AUTO_SHARED_MUTEX_NULL OGRE_AUTO_MUTEX_NAME = 0;
+        #define OGRE_MUTEX_CONDITIONAL(mutex) if (mutex)
+		#define OGRE_THREAD_SYNCHRONISER(sync) boost::condition sync;
+		#define OGRE_THREAD_WAIT(sync, lock) sync.wait(lock);
+		#define OGRE_THREAD_NOTIFY_ONE(sync) sync.notify_one(); 
+		#define OGRE_THREAD_NOTIFY_ALL(sync) sync.notify_all(); 
+		// Thread-local pointer
+		#define OGRE_THREAD_POINTER(T, var) boost::thread_specific_ptr<T> var
+		#define OGRE_THREAD_POINTER_SET(var, expr) var.reset(expr)
+		#define OGRE_THREAD_POINTER_DELETE(var) var.reset(0)
+		#define OGRE_THREAD_POINTER_GET(var) var.get()
+	#else
+		#define OGRE_AUTO_MUTEX
+		#define OGRE_LOCK_AUTO_MUTEX
+		#define OGRE_MUTEX(name)
+		#define OGRE_STATIC_MUTEX(name)
+		#define OGRE_STATIC_MUTEX_INSTANCE(name)
+		#define OGRE_LOCK_MUTEX(name)
+		#define OGRE_LOCK_MUTEX_NAMED(mutexName, lockName)
+		#define OGRE_AUTO_SHARED_MUTEX
+		#define OGRE_LOCK_AUTO_SHARED_MUTEX
+		#define OGRE_NEW_AUTO_SHARED_MUTEX
+		#define OGRE_DELETE_AUTO_SHARED_MUTEX
+		#define OGRE_COPY_AUTO_SHARED_MUTEX(from)
+        #define OGRE_SET_AUTO_SHARED_MUTEX_NULL
+        #define OGRE_MUTEX_CONDITIONAL(name) if(true)
+		#define OGRE_THREAD_SYNCHRONISER(sync) 
+		#define OGRE_THREAD_WAIT(sync, lock) 
+		#define OGRE_THREAD_NOTIFY_ONE(sync) 
+		#define OGRE_THREAD_NOTIFY_ALL(sync) 
+		#define OGRE_THREAD_POINTER(T, var) T* var
+		#define OGRE_THREAD_POINTER_SET(var, expr) var = expr
+		#define OGRE_THREAD_POINTER_DELETE(var) delete var; var = 0
+		#define OGRE_THREAD_POINTER_GET(var) var
+	#endif
+
+
+// Pre-declare classes
+// Allows use of pointers in header files without including individual .h
+// so decreases dependencies between files
+    class Angle;
+    class Animation;
+    class AnimationState;
+    class AnimationStateSet;
+    class AnimationTrack;
+    class Archive;
+    class ArchiveFactory;
+    class ArchiveManager;
+    class AutoParamDataSource;
+    class AxisAlignedBox;
+    class AxisAlignedBoxSceneQuery;
+    class Billboard;
+    class BillboardChain;
+    class BillboardSet;
+    class Bone;
+    class Camera;
+    class Codec;
+    class ColourValue;
+    class ConfigDialog;
+    template <typename T> class Controller;
+    template <typename T> class ControllerFunction;
+    class ControllerManager;
+    template <typename T> class ControllerValue;
+    class Degree;
+    class DynLib;
+    class DynLibManager;
+    class EdgeData;
+    class EdgeListBuilder;
+    class Entity;
+    class ErrorDialog;
+    class ExternalTextureSourceManager;
+    class Factory;
+    class Font;
+    class FontPtr;
+    class FontManager;
+    struct FrameEvent;
+    class FrameListener;
+    class Frustum;
+    class GpuProgram;
+    class GpuProgramPtr;
+    class GpuProgramManager;
+	class GpuProgramUsage;
+    class HardwareIndexBuffer;
+    class HardwareOcclusionQuery;
+    class HardwareVertexBuffer;
+	class HardwarePixelBuffer;
+    class HardwarePixelBufferSharedPtr;
+	class HighLevelGpuProgram;
+    class HighLevelGpuProgramPtr;
+	class HighLevelGpuProgramManager;
+	class HighLevelGpuProgramFactory;
+    class IndexData;
+    class IntersectionSceneQuery;
+    class IntersectionSceneQueryListener;
+    class Image;
+    class KeyFrame;
+    class Light;
+    class Log;
+    class LogManager;
+	class ManualResourceLoader;
+	class ManualObject;
+    class Material;
+    class MaterialPtr;
+    class MaterialManager;
+    class MaterialScriptCompiler;
+    class Math;
+    class Matrix3;
+    class Matrix4;
+    class MemoryManager;
+    class Mesh;
+    class MeshPtr;
+    class MeshSerializer;
+    class MeshSerializerImpl;
+    class MeshManager;
+    class MovableObject;
+    class MovablePlane;
+    class Node;
+	class NodeAnimationTrack;
+	class NodeKeyFrame;
+	class NumericAnimationTrack;
+	class NumericKeyFrame;
+    class Overlay;
+    class OverlayContainer;
+    class OverlayElement;
+    class OverlayElementFactory;
+    class OverlayManager;
+    class Particle;
+    class ParticleAffector;
+    class ParticleAffectorFactory;
+    class ParticleEmitter;
+    class ParticleEmitterFactory;
+    class ParticleSystem;
+    class ParticleSystemManager;
+    class ParticleSystemRenderer;
+    class ParticleSystemRendererFactory;
+    class ParticleVisualData;
+    class Pass;
+    class PatchMesh;
+    class PixelBox;
+    class Plane;
+    class PlaneBoundedVolume;
+	class Plugin;
+    class Pose;
+    class ProgressiveMesh;
+    class Profile;
+	class Profiler;
+    class Quaternion;
+	class Radian;
+    class Ray;
+    class RaySceneQuery;
+    class RaySceneQueryListener;
+    class Renderable;
+    class RenderPriorityGroup;
+    class RenderQueue;
+    class RenderQueueGroup;
+	class RenderQueueInvocation;
+	class RenderQueueInvocationSequence;
+    class RenderQueueListener;
+    class RenderSystem;
+    class RenderSystemCapabilities;
+    class RenderTarget;
+    class RenderTargetListener;
+    class RenderTexture;
+	class MultiRenderTarget;
+    class RenderWindow;
+    class RenderOperation;
+    class Resource;
+	class ResourceBackgroundQueue;
+	class ResourceGroupManager;
+    class ResourceManager;
+    class RibbonTrail;
+	class Root;
+    class SceneManager;
+    class SceneManagerEnumerator;
+    class SceneNode;
+    class SceneQuery;
+    class SceneQueryListener;
+	class ScriptLoader;
+    class Serializer;
+    class ShadowCaster;
+    class ShadowRenderable;
+	class ShadowTextureManager;
+    class SimpleRenderable;
+    class SimpleSpline;
+    class Skeleton;
+    class SkeletonPtr;
+    class SkeletonInstance;
+    class SkeletonManager;
+    class Sphere;
+    class SphereSceneQuery;
+	class StaticGeometry;
+    class StringConverter;
+    class StringInterface;
+    class SubEntity;
+    class SubMesh;
+	class TagPoint;
+    class Technique;
+	class TempBlendedBufferInfo;
+	class ExternalTextureSource;
+    class TextureUnitState;
+    class Texture;
+    class TexturePtr;
+	class TextureFont;
+    class TextureManager;
+    class TransformKeyFrame;
+	class Timer;
+    class UserDefinedObject;
+    class Vector2;
+    class Vector3;
+    class Vector4;
+    class Viewport;
+	class VertexAnimationTrack;
+    class VertexBufferBinding;
+    class VertexData;
+    class VertexDeclaration;
+	class VertexMorphKeyFrame;
+    class WireBoundingBox;
+    class Compositor;
+    class CompositorManager;
+    class CompositorChain;
+    class CompositorInstance;
+    class CompositionTechnique;
+    class CompositionPass;
+    class CompositionTargetPass;
+}
+
+#endif // __OgrePrerequisites_H__
+
+
Index: /OgreMain/include/OgreProfiler.h
===================================================================
--- /OgreMain/include/OgreProfiler.h	(revision 5)
+++ /OgreMain/include/OgreProfiler.h	(revision 5)
@@ -0,0 +1,415 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/*
+
+    Although the code is original, many of the ideas for the profiler were borrowed from 
+"Real-Time In-Game Profiling" by Steve Rabin which can be found in Game Programming
+Gems 1.
+
+    This code can easily be adapted to your own non-Ogre project. The only code that is 
+Ogre-dependent is in the visualization/logging routines and the use of the Timer class.
+
+    Enjoy!
+
+*/
+
+#ifndef __Profiler_H__
+#define __Profiler_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreSingleton.h"
+#include "OgreString.h"
+#include "OgreOverlay.h"
+
+#if OGRE_PROFILING == 1
+#   if OGRE_COMPILER != OGRE_COMPILER_BORL
+#       define OgreProfile( a ) Ogre::Profile _OgreProfileInstance( (a) )
+#       define OgreProfileBegin( a ) Ogre::Profiler::getSingleton().beginProfile( (a) )
+#       define OgreProfileEnd( a ) Ogre::Profiler::getSingleton().endProfile( (a) )
+#   else
+#	    define OgreProfile( a ) Ogre::Profile _OgreProfileInstance( __FUNC__ )
+#	    define OgreProfileBegin( a ) Ogre::Profiler::getSingleton().beginProfile( __FUNC__ )
+#	    define OgreProfileEnd( a ) Ogre::Profiler::getSingleton().endProfile( __FUNC__ )
+#   endif
+#else
+#   define OgreProfile( a )
+#   define OgreProfileBegin( a )
+#   define OgreProfileEnd( a )
+#endif
+
+namespace Ogre {
+
+    /** An individual profile that will be processed by the Profiler
+        @remarks
+            Use the macro OgreProfile(name) instead of instantiating this profile directly
+        @remarks
+            We use this Profile to allow scoping rules to signify the beginning and end of
+            the profile. Use the Profiler singleton (through the macro OgreProfileBegin(name)
+            and OgreProfileEnd(name)) directly if you want a profile to last
+            outside of a scope (ie the main game loop).
+        @author Amit Mathew (amitmathew (at) yahoo (dot) com)
+    */
+    class _OgreExport Profile {
+
+        public:
+            Profile(const String& profileName);
+            ~Profile();
+
+        protected:
+
+            /// The name of this profile
+            String mName;
+			
+
+    };
+
+    /** The profiler allows you to measure the performance of your code
+        @remarks
+            Do not create profiles directly from this unless you want a profile to last
+            outside of its scope (ie the main game loop). For most cases, use the macro
+            OgreProfile(name) and braces to limit the scope. You must enable the Profile
+            before you can used it with setEnabled(true). If you want to disable profiling
+            in Ogre, simply set the macro OGRE_PROFILING to 0.
+        @author Amit Mathew (amitmathew (at) yahoo (dot) com)
+        @todo resolve artificial cap on number of profiles displayed
+        @todo fix display ordering of profiles not called every frame
+    */
+    class _OgreExport Profiler : public Singleton<Profiler> {
+
+        public:
+            Profiler();
+            ~Profiler();
+
+            /** Sets the timer for the profiler */
+            void setTimer(Timer* t);
+
+            /** Retrieves the timer for the profiler */
+            Timer* getTimer();
+
+            /** Begins a profile
+            @remarks 
+                Use the macro OgreProfileBegin(name) instead of calling this directly 
+                so that profiling can be ignored in the release version of your app. 
+            @remarks 
+                You only use the macro (or this) if you want a profile to last outside
+                of its scope (ie the main game loop). If you use this function, make sure you 
+                use a corresponding OgreProfileEnd(name). Usually you would use the macro 
+                OgreProfile(name). This function will be ignored for a profile that has been 
+                disabled or if the profiler is disabled.
+            @param profileName Must be unique and must not be an empty string
+            */
+            void beginProfile(const String& profileName);
+
+            /** Ends a profile
+            @remarks 
+                Use the macro OgreProfileEnd(name) instead of calling this directly so that
+                profiling can be ignored in the release version of your app.
+            @remarks
+                This function is usually not called directly unless you want a profile to
+                last outside of its scope. In most cases, using the macro OgreProfile(name) 
+                which will call this function automatically when it goes out of scope. Make 
+                sure the name of this profile matches its corresponding beginProfile name. 
+                This function will be ignored for a profile that has been disabled or if the
+                profiler is disabled.
+            */
+            void endProfile(const String& profileName);
+
+            /** Sets whether this profiler is enabled. Only takes effect after the
+                the frame has ended.
+                @remarks When this is called the first time with the parameter true,
+                it initializes the GUI for the Profiler
+            */
+            void setEnabled(bool enabled);
+
+            /** Gets whether this profiler is enabled */
+            bool getEnabled() const;
+
+            /** Enables a previously disabled profile 
+            @remarks Only enables the profile if this function is not 
+            called during the profile it is trying to enable.
+            */
+            void enableProfile(const String& profileName);
+
+            /** Disables a profile
+            @remarks Only disables the profile if this function is not called during
+            the profile it is trying to disable.
+            */
+            void disableProfile(const String& profileName);
+
+            /** Returns true if the specified profile reaches a new frame time maximum
+            @remarks If this is called during a frame, it will be reading the results
+            from the previous frame. Therefore, it is best to use this after the frame
+            has ended.
+            */
+            bool watchForMax(const String& profileName);
+
+            /** Returns true if the specified profile reaches a new frame time minimum
+            @remarks If this is called during a frame, it will be reading the results
+            from the previous frame. Therefore, it is best to use this after the frame
+            has ended.
+            */
+            bool watchForMin(const String& profileName);
+
+            /** Returns true if the specified profile goes over or under the given limit
+                frame time
+            @remarks If this is called during a frame, it will be reading the results
+            from the previous frame. Therefore, it is best to use this after the frame
+            has ended.
+            @param limit A number between 0 and 1 representing the percentage of frame time
+            @param greaterThan If true, this will return whether the limit is exceeded. Otherwise,
+            it will return if the frame time has gone under this limit.
+            */
+            bool watchForLimit(const String& profileName, Real limit, bool greaterThan = true);
+
+            /** Outputs current profile statistics to the log */
+            void logResults();
+
+            /** Clears the profiler statistics */
+            void reset();
+
+            /** Sets the Profiler so the display of results are updated ever n frames*/
+            void setUpdateDisplayFrequency(uint freq);
+
+            /** Gets the frequency that the Profiler display is updated */
+            uint getUpdateDisplayFrequency() const;
+
+            /** Override standard Singleton retrieval.
+            @remarks
+            Why do we do this? Well, it's because the Singleton
+            implementation is in a .h file, which means it gets compiled
+            into anybody who includes it. This is needed for the
+            Singleton template to work, but we actually only want it
+            compiled into the implementation of the class based on the
+            Singleton, not all of them. If we don't change this, we get
+            link errors when trying to use the Singleton-based class from
+            an outside dll.
+            @par
+            This method just delegates to the template version anyway,
+            but the implementation stays in this single compilation unit,
+            preventing link errors.
+            */
+            static Profiler& getSingleton(void);
+            /** Override standard Singleton retrieval.
+            @remarks
+            Why do we do this? Well, it's because the Singleton
+            implementation is in a .h file, which means it gets compiled
+            into anybody who includes it. This is needed for the
+            Singleton template to work, but we actually only want it
+            compiled into the implementation of the class based on the
+            Singleton, not all of them. If we don't change this, we get
+            link errors when trying to use the Singleton-based class from
+            an outside dll.
+            @par
+            This method just delegates to the template version anyway,
+            but the implementation stays in this single compilation unit,
+            preventing link errors.
+            */
+            static Profiler* getSingletonPtr(void);
+
+        protected:
+
+            /** Initializes the profiler's gui elements */
+            void initialize();
+
+            /** Prints the profiling results of each frame */
+            void displayResults();
+
+            /** Processes the profiler data after each frame */
+            void processFrameStats();
+
+            /** Handles a change of the profiler's enabled state*/
+            void changeEnableState();
+
+            /** An internal function to create the container which will hold our display elements*/
+            OverlayContainer* createContainer();
+
+            /** An internal function to create a text area */
+            OverlayElement* createTextArea(const String& name, Real width, Real height, Real top, Real left, 
+                                       uint fontSize, const String& caption, bool show = true);
+
+            /** An internal function to create a panel */
+            OverlayElement* createPanel(const String& name, Real width, Real height, Real top, Real left, 
+                                    const String& materialName, bool show = true);
+
+            /// Represents an individual profile call
+            struct ProfileInstance {
+
+                /// The name of the profile
+                String		name;
+
+                /// The name of the parent, empty string if root
+                String		parent;
+
+                /// The time this profile was started
+                ulong		currTime;
+
+                /// Represents the total time of all child profiles to subtract
+                /// from this profile
+                ulong		accum;
+
+                /// The hierarchical level of this profile, 0 being the root profile
+                uint		hierarchicalLvl;
+            };
+
+            /// Represents the total timing information of a profile
+            /// since profiles can be called more than once each frame
+            struct ProfileFrame {
+				
+                /// The name of the profile
+                String	name;
+
+                /// The total time this profile has taken this frame
+                ulong	frameTime;
+
+                /// The number of times this profile was called this frame
+                uint	calls;
+
+                /// The hierarchical level of this profile, 0 being the main loop
+                uint	hierarchicalLvl;
+
+            };
+			
+            /// Represents a history of each profile during the duration of the app
+            struct ProfileHistory {
+
+                /// The name of the profile
+                String	name;
+
+                /// The current percentage of frame time this profile has taken
+                Real	currentTime; // %
+
+                /// The maximum percentage of frame time this profile has taken
+                Real	maxTime; // %
+
+                /// The minimum percentage of frame time this profile has taken
+                Real	minTime; // %
+
+                /// The number of times this profile has been called each frame
+                uint	numCallsThisFrame;
+
+                /// The total percentage of frame time this profile has taken
+                /// (used to calculate average)
+                Real	totalTime; // %
+
+                /// The total number of times this profile was called
+                /// (used to calculate average)
+                ulong	totalCalls; // %
+
+                /// The hierarchical level of this profile, 0 being the root profile
+                uint	hierarchicalLvl;
+
+			};
+
+			
+            typedef std::list<ProfileInstance> ProfileStack;
+            typedef std::list<ProfileFrame> ProfileFrameList;
+            typedef std::list<ProfileHistory> ProfileHistoryList;
+            typedef std::map<String, ProfileHistoryList::iterator> ProfileHistoryMap;
+            typedef std::map<String, bool> DisabledProfileMap;
+
+            typedef std::list<OverlayElement*> ProfileBarList;
+
+            /// A stack for each individual profile per frame
+            ProfileStack mProfiles;
+
+            /// Accumulates the results of each profile per frame (since a profile can be called
+            /// more than once a frame)
+            ProfileFrameList mProfileFrame;
+
+            /// Keeps track of the statistics of each profile
+            ProfileHistoryList mProfileHistory;
+
+            /// We use this for quick look-ups of profiles in the history list
+            ProfileHistoryMap mProfileHistoryMap;
+
+            /// Holds the names of disabled profiles
+            DisabledProfileMap mDisabledProfiles;
+
+            /// Holds the display bars for each profile results
+            ProfileBarList mProfileBars;
+
+            /// Whether the GUI elements have been initialized
+            bool mInitialized;
+
+            /// The max number of profiles we can display
+            uint maxProfiles;
+
+            /// The overlay which contains our profiler results display
+            Overlay* mOverlay;
+
+            /// The window that displays the profiler results
+            OverlayContainer* mProfileGui;
+
+            /// The height of each bar
+            Real mBarHeight;
+
+            /// The height of the stats window
+            Real mGuiHeight;
+
+            /// The width of the stats window
+            Real mGuiWidth;
+
+            /// The size of the indent for each profile display bar
+            Real mBarIndent;
+
+            /// The width of the border between the profile window and each bar
+            Real mGuiBorderWidth;
+
+            /// The width of the min, avg, and max lines in a profile display
+            Real mBarLineWidth;
+
+            /// The number of frames that must elapse before the current
+            /// frame display is updated
+            uint mUpdateDisplayFrequency;
+
+            /// The number of elasped frame, used with mUpdateDisplayFrequency
+            uint mCurrentFrame;
+
+            /// The timer used for profiling
+            Timer* mTimer;
+
+            /// The total time each frame takes
+            ulong mTotalFrameTime;
+
+            /// Whether this profiler is enabled
+            bool mEnabled;
+
+            /// Keeps track of whether this profiler has
+            /// received a request to be enabled/disabled
+            bool mEnableStateChangePending;
+
+            /// Keeps track of the new enabled/disabled state that the user has requested
+            /// which will be applied after the frame ends
+            bool mNewEnableState;
+
+    }; // end class
+
+} // end namespace
+
+#endif
Index: /OgreMain/include/OgreProgressiveMesh.h
===================================================================
--- /OgreMain/include/OgreProgressiveMesh.h	(revision 5)
+++ /OgreMain/include/OgreProgressiveMesh.h	(revision 5)
@@ -0,0 +1,248 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+// The underlying algorithms in this class are based heavily on:
+/*
+ *  Progressive Mesh type Polygon Reduction Algorithm
+ *  by Stan Melax (c) 1998
+ */
+
+#ifndef __ProgressiveMesh_H_
+#define __ProgressiveMesh_H_
+
+#include "OgrePrerequisites.h"
+#include "OgreVector3.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreHardwareIndexBuffer.h"
+#include "OgreRenderOperation.h"
+
+namespace Ogre {
+
+    /** This class reduces the complexity of the geometry it is given.
+        This class is dedicated to reducing the number of triangles in a given mesh
+        taking into account seams in both geometry and texture co-ordinates and meshes 
+        which have multiple frames.
+    @par
+        The primary use for this is generating LOD versions of Mesh objects, but it can be
+        used by any geometry provider. The only limitation at the moment is that the 
+        provider uses a common vertex buffer for all LODs and one index buffer per LOD.
+        Therefore at the moment this class can only handle indexed geometry.
+    @par
+        NB the interface of this class will certainly change when compiled vertex buffers are
+        supported.
+    */
+    class _OgreExport ProgressiveMesh
+    {
+    public:
+
+		/** The way to derive the quota of vertices which are reduced at each LOD. */
+        enum VertexReductionQuota
+		{
+			/// A set number of vertices are removed at each reduction
+			VRQ_CONSTANT,
+			/// A proportion of the remaining number of vertices are removed at each reduction
+			VRQ_PROPORTIONAL
+		};
+
+        typedef std::vector<IndexData*> LODFaceList;
+
+        /** Constructor, takes the geometry data and index buffer. 
+		@remarks
+			DO NOT pass write-only, unshadowed buffers to this method! They will not
+			work. Pass only shadowed buffers, or better yet perform mesh reduction as
+			an offline process using DefaultHardwareBufferManager to manage vertex
+			buffers in system memory.
+		*/
+        ProgressiveMesh(const VertexData* vertexData, const IndexData* indexData);
+        virtual ~ProgressiveMesh();
+
+        /** Adds an extra vertex position buffer. 
+        @remarks
+            As well as the main vertex buffer, the client of this class may add extra versions
+            of the vertex buffer which will also be taken into account when the cost of 
+            simplifying the mesh is taken into account. This is because the cost of
+            simplifying an animated mesh cannot be calculated from just the reference position,
+            multiple positions needs to be assessed in order to find the best simplification option.
+		@par
+			DO NOT pass write-only, unshadowed buffers to this method! They will not
+			work. Pass only shadowed buffers, or better yet perform mesh reduction as
+			an offline process using DefaultHardwareBufferManager to manage vertex
+			buffers in system memory.
+        @param buffer Pointer to x/y/z buffer with vertex positions. The number of vertices
+            must be the same as in the original GeometryData passed to the constructor.
+        */
+        virtual void addExtraVertexPositionBuffer(const VertexData* vertexData);
+
+        /** Builds the progressive mesh with the specified number of levels.
+        @param numLevels The number of levels to include in the output excluding the full detail version.
+        @param outList Pointer to a list of LOD geometry data which will be completed by the application.
+			Each entry is a reduced form of the mesh, in decreasing order of detail.
+		@param quota The way to derive the number of vertices removed at each LOD
+		@param reductionValue Either the proportion of vertices to remove at each level, or a fixed
+			number of vertices to remove at each level, depending on the value of quota
+        */
+        virtual void build(ushort numLevels, LODFaceList* outList, 
+			VertexReductionQuota quota = VRQ_PROPORTIONAL, Real reductionValue = 0.5f );
+
+    protected:
+        const VertexData *mpVertexData;
+        const IndexData *mpIndexData;
+
+        size_t mCurrNumIndexes;
+		size_t mNumCommonVertices;
+
+        // Internal classes
+        class PMTriangle;
+        class PMVertex;
+
+        public: // VC6 hack
+
+        /** A vertex as used by a face. This records the index of the actual vertex which is used
+		by the face, and a pointer to the common vertex used for surface evaluation. */
+		class _OgrePrivate PMFaceVertex {
+		public:
+			size_t realIndex;
+			PMVertex* commonVertex;
+		};
+
+        protected:
+
+        /** A triangle in the progressive mesh, holds extra info like face normal. */
+        class _OgrePrivate PMTriangle {
+        public:
+            PMTriangle();
+            void setDetails(size_t index, PMFaceVertex *v0, PMFaceVertex *v1, PMFaceVertex *v2);
+	        void computeNormal(void);
+	        void replaceVertex(PMFaceVertex *vold, PMFaceVertex *vnew);
+	        bool hasCommonVertex(PMVertex *v) const;
+	        bool hasFaceVertex(PMFaceVertex *v) const;
+			PMFaceVertex* getFaceVertexFromCommon(PMVertex* commonVert);
+	        void notifyRemoved(void);
+
+	        PMFaceVertex* vertex[3]; // the 3 points that make this tri
+	        Vector3   normal;    // unit vector othogonal to this face
+            bool      removed;   // true if this tri is now removed
+			size_t index;
+        };
+
+        /** A vertex in the progressive mesh, holds info like collapse cost etc. 
+		This vertex can actually represent several vertices in the final model, because
+		vertices along texture seams etc will have been duplicated. In order to properly
+		evaluate the surface properties, a single common vertex is used for these duplicates,
+		and the faces hold the detail of the duplicated vertices.
+		*/
+        class _OgrePrivate PMVertex {
+        public:
+            PMVertex();
+	        void setDetails(const Vector3& v, size_t index);
+	        void removeIfNonNeighbor(PMVertex *n);
+			bool isBorder(void);/// true if this vertex is on the edge of an open geometry patch
+			bool isManifoldEdgeWith(PMVertex* v); // is edge this->src a manifold edge?
+			void notifyRemoved(void);
+
+            Vector3  position;  // location of point in euclidean space
+	        size_t index;       // place of vertex in original list
+            typedef std::set<PMVertex *> NeighborList;
+            typedef std::set<PMVertex *> DuplicateList;
+            NeighborList neighbor; // adjacent vertices
+	        typedef std::set<PMTriangle *> FaceList;
+            FaceList face;     // adjacent triangles
+
+	        Real collapseCost;  // cached cost of collapsing edge
+	        PMVertex * collapseTo; // candidate vertex for collapse
+            bool      removed;   // true if this vert is now removed
+			bool	  toBeRemoved; // denug
+
+			bool seam;	/// true if this vertex is on a model seam where vertices are duplicated
+
+        };
+
+        typedef std::vector<PMTriangle> TriangleList;
+        typedef std::vector<PMFaceVertex> FaceVertexList;
+        typedef std::vector<PMVertex> CommonVertexList;
+        typedef std::vector<Real> WorstCostList;
+
+        /// Data used to calculate the collapse costs
+        struct PMWorkingData
+        {
+            TriangleList mTriList; /// List of faces
+            FaceVertexList mFaceVertList; // The vertex details referenced by the triangles
+			CommonVertexList mVertList; // The master list of common vertices
+        };
+
+        typedef std::vector<PMWorkingData> WorkingDataList;
+        /// Multiple copies, 1 per vertex buffer
+        WorkingDataList mWorkingData;
+
+        /// The worst collapse cost from all vertex buffers for each vertex
+        WorstCostList mWorstCosts;
+
+        /// Internal method for building PMWorkingData from geometry data
+        void addWorkingData(const VertexData* vertexData, const IndexData* indexData);
+
+        /// Internal method for initialising the edge collapse costs
+        void initialiseEdgeCollapseCosts(void);
+        /// Internal calculation method for deriving a collapse cost  from u to v
+        Real computeEdgeCollapseCost(PMVertex *src, PMVertex *dest);
+        /// Internal method evaluates all collapse costs from this vertex and picks the lowest for a single buffer
+        Real computeEdgeCostAtVertexForBuffer(WorkingDataList::iterator idata, size_t vertIndex);
+        /// Internal method evaluates all collapse costs from this vertex for every buffer and returns the worst
+        void computeEdgeCostAtVertex(size_t vertIndex);
+        /// Internal method to compute edge collapse costs for all buffers /
+        void computeAllCosts(void);
+        /// Internal method for getting the index of next best vertex to collapse
+        size_t getNextCollapser(void);
+        /// Internal method builds an new LOD based on the current state
+        void bakeNewLOD(IndexData* pData);
+
+        /** Internal method, collapses vertex onto it's saved collapse target. 
+        @remarks
+            This updates the working triangle list to drop a triangle and recalculates
+            the edge collapse costs around the collapse target. 
+            This also updates all the working vertex lists for the relevant buffer. 
+        */
+        void collapse(PMVertex *collapser);
+
+		/** Internal debugging method */
+		void dumpContents(const String& log);
+
+
+
+
+
+
+
+
+
+    };
+
+
+
+}
+
+#endif 
Index: /OgreMain/include/OgreQuaternion.h
===================================================================
--- /OgreMain/include/OgreQuaternion.h	(revision 5)
+++ /OgreMain/include/OgreQuaternion.h	(revision 5)
@@ -0,0 +1,277 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+// NOTE THAT THIS FILE IS BASED ON MATERIAL FROM:
+
+// Magic Software, Inc.
+// http://www.geometrictools.com/
+// Copyright (c) 2000, All Rights Reserved
+//
+// Source code from Magic Software is supplied under the terms of a license
+// agreement and may not be copied or disclosed except in accordance with the
+// terms of that agreement.  The various license agreements may be found at
+// the Magic Software web site.  This file is subject to the license
+//
+// FREE SOURCE CODE
+// http://www.geometrictools.com/License/WildMagic3License.pdf
+
+#ifndef __Quaternion_H__
+#define __Quaternion_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMath.h"
+
+namespace Ogre {
+
+    /** Implementation of a Quaternion, i.e. a rotation around an axis.
+    */
+    class _OgreExport Quaternion
+    {
+    public:
+        inline Quaternion (
+            Real fW = 1.0,
+            Real fX = 0.0, Real fY = 0.0, Real fZ = 0.0)
+		{
+			w = fW;
+			x = fX;
+			y = fY;
+			z = fZ;
+		}
+        inline Quaternion (const Quaternion& rkQ)
+		{
+			w = rkQ.w;
+			x = rkQ.x;
+			y = rkQ.y;
+			z = rkQ.z;
+		}
+        /// Construct a quaternion from a rotation matrix
+        inline Quaternion(const Matrix3& rot)
+        {
+            this->FromRotationMatrix(rot);
+        }
+        /// Construct a quaternion from an angle/axis
+        inline Quaternion(const Radian& rfAngle, const Vector3& rkAxis)
+        {
+            this->FromAngleAxis(rfAngle, rkAxis);
+        }
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline Quaternion(const Real& rfAngle, const Vector3& rkAxis)
+		{
+			this->FromAngleAxis(rfAngle, rkAxis);
+		}
+#endif//OGRE_FORCE_ANGLE_TYPES
+        /// Construct a quaternion from 3 orthonormal local axes
+        inline Quaternion(const Vector3& xaxis, const Vector3& yaxis, const Vector3& zaxis)
+        {
+            this->FromAxes(xaxis, yaxis, zaxis);
+        }
+        /// Construct a quaternion from 3 orthonormal local axes
+        inline Quaternion(const Vector3* akAxis)
+        {
+            this->FromAxes(akAxis);
+        }
+		/// Construct a quaternion from 4 manual w/x/y/z values
+		inline Quaternion(Real* valptr)
+		{
+			memcpy(&w, valptr, sizeof(Real)*4);
+		}
+
+		/// Array accessor operator
+		inline Real operator [] ( const size_t i ) const
+		{
+			assert( i < 4 );
+
+			return *(&w+i);
+		}
+
+		/// Array accessor operator
+		inline Real& operator [] ( const size_t i )
+		{
+			assert( i < 4 );
+
+			return *(&w+i);
+		}
+
+		/// Pointer accessor for direct copying
+		inline Real* ptr()
+		{
+			return &w;
+		}
+
+		/// Pointer accessor for direct copying
+		inline const Real* ptr() const
+		{
+			return &w;
+		}
+
+		void FromRotationMatrix (const Matrix3& kRot);
+        void ToRotationMatrix (Matrix3& kRot) const;
+        void FromAngleAxis (const Radian& rfAngle, const Vector3& rkAxis);
+        void ToAngleAxis (Radian& rfAngle, Vector3& rkAxis) const;
+        inline void ToAngleAxis (Degree& dAngle, Vector3& rkAxis) const {
+            Radian rAngle;
+            ToAngleAxis ( rAngle, rkAxis );
+            dAngle = rAngle;
+        }
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void FromAngleAxis (const Real& rfAngle, const Vector3& rkAxis) {
+			FromAngleAxis ( Angle(rfAngle), rkAxis );
+		}
+        inline void ToAngleAxis (Real& rfAngle, Vector3& rkAxis) const {
+			Radian r;
+			ToAngleAxis ( r, rkAxis );
+			rfAngle = r.valueAngleUnits();
+		}
+#endif//OGRE_FORCE_ANGLE_TYPES
+        void FromAxes (const Vector3* akAxis);
+        void FromAxes (const Vector3& xAxis, const Vector3& yAxis, const Vector3& zAxis);
+        void ToAxes (Vector3* akAxis) const;
+        void ToAxes (Vector3& xAxis, Vector3& yAxis, Vector3& zAxis) const;
+        /// Get the local x-axis
+        Vector3 xAxis(void) const;
+        /// Get the local y-axis
+        Vector3 yAxis(void) const;
+        /// Get the local z-axis
+        Vector3 zAxis(void) const;
+
+        inline Quaternion& operator= (const Quaternion& rkQ)
+		{
+			w = rkQ.w;
+			x = rkQ.x;
+			y = rkQ.y;
+			z = rkQ.z;
+			return *this;
+		}
+        Quaternion operator+ (const Quaternion& rkQ) const;
+        Quaternion operator- (const Quaternion& rkQ) const;
+        Quaternion operator* (const Quaternion& rkQ) const;
+        Quaternion operator* (Real fScalar) const;
+        _OgreExport friend Quaternion operator* (Real fScalar,
+            const Quaternion& rkQ);
+        Quaternion operator- () const;
+        inline bool operator== (const Quaternion& rhs) const
+		{
+			return (rhs.x == x) && (rhs.y == y) &&
+				(rhs.z == z) && (rhs.w == w);
+		}
+        inline bool operator!= (const Quaternion& rhs) const
+		{
+			return !operator==(rhs);
+		}
+        // functions of a quaternion
+        Real Dot (const Quaternion& rkQ) const;  // dot product
+        Real Norm () const;  // squared-length
+        /// Normalises this quaternion, and returns the previous length
+        Real normalise(void); 
+        Quaternion Inverse () const;  // apply to non-zero quaternion
+        Quaternion UnitInverse () const;  // apply to unit-length quaternion
+        Quaternion Exp () const;
+        Quaternion Log () const;
+
+        // rotation of a vector by a quaternion
+        Vector3 operator* (const Vector3& rkVector) const;
+
+   		/** Calculate the local roll element of this quaternion.
+		@param reprojectAxis By default the method returns the 'intuitive' result
+			that is, if you projected the local Y of the quaterion onto the X and
+			Y axes, the angle between them is returned. If set to false though, the
+			result is the actual yaw that will be used to implement the quaternion,
+			which is the shortest possible path to get to the same orientation and 
+			may involve less axial rotation. 
+		*/
+		Radian getRoll(bool reprojectAxis = true) const;
+   		/** Calculate the local pitch element of this quaternion
+		@param reprojectAxis By default the method returns the 'intuitive' result
+			that is, if you projected the local Z of the quaterion onto the X and
+			Y axes, the angle between them is returned. If set to true though, the
+			result is the actual yaw that will be used to implement the quaternion,
+			which is the shortest possible path to get to the same orientation and 
+			may involve less axial rotation. 
+		*/
+		Radian getPitch(bool reprojectAxis = true) const;
+   		/** Calculate the local yaw element of this quaternion
+		@param reprojectAxis By default the method returns the 'intuitive' result
+			that is, if you projected the local Z of the quaterion onto the X and
+			Z axes, the angle between them is returned. If set to true though, the
+			result is the actual yaw that will be used to implement the quaternion,
+			which is the shortest possible path to get to the same orientation and 
+			may involve less axial rotation. 
+		*/
+		Radian getYaw(bool reprojectAxis = true) const;		
+		/// Equality with tolerance (tolerance is max angle difference)
+		bool equals(const Quaternion& rhs, const Radian& tolerance) const;
+		
+	    // spherical linear interpolation
+        static Quaternion Slerp (Real fT, const Quaternion& rkP,
+            const Quaternion& rkQ, bool shortestPath = false);
+
+        static Quaternion SlerpExtraSpins (Real fT,
+            const Quaternion& rkP, const Quaternion& rkQ,
+            int iExtraSpins);
+
+        // setup for spherical quadratic interpolation
+        static void Intermediate (const Quaternion& rkQ0,
+            const Quaternion& rkQ1, const Quaternion& rkQ2,
+            Quaternion& rka, Quaternion& rkB);
+
+        // spherical quadratic interpolation
+        static Quaternion Squad (Real fT, const Quaternion& rkP,
+            const Quaternion& rkA, const Quaternion& rkB,
+            const Quaternion& rkQ, bool shortestPath = false);
+
+        // normalised linear interpolation - faster but less accurate (non-constant rotation velocity)
+        static Quaternion nlerp(Real fT, const Quaternion& rkP, 
+            const Quaternion& rkQ, bool shortestPath = false);
+
+        // cutoff for sine near zero
+        static const Real ms_fEpsilon;
+
+        // special values
+        static const Quaternion ZERO;
+        static const Quaternion IDENTITY;
+
+		Real w, x, y, z;
+
+        /** Function for writing to a stream. Outputs "Quaternion(w, x, y, z)" with w,x,y,z
+            being the member values of the quaternion.
+        */
+        inline _OgreExport friend std::ostream& operator <<
+            ( std::ostream& o, const Quaternion& q )
+        {
+            o << "Quaternion(" << q.w << ", " << q.x << ", " << q.y << ", " << q.z << ")";
+            return o;
+        }
+
+    };
+
+}
+
+
+
+
+#endif 
Index: /OgreMain/include/OgreRadixSort.h
===================================================================
--- /OgreMain/include/OgreRadixSort.h	(revision 5)
+++ /OgreMain/include/OgreRadixSort.h	(revision 5)
@@ -0,0 +1,322 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RadixSort_H__
+#define __RadixSort_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+	/** Class for performing a radix sort (fast comparison-less sort based on 
+		byte value) on various standard STL containers. 
+	@remarks
+		A radix sort is a very fast sort algorithm. It doesn't use comparisons
+		and thus is able to break the theoretical minimum O(N*logN) complexity. 
+		Radix sort is complexity O(k*N), where k is a constant. Note that radix
+		sorting is not in-place, it requires additional storage, so it trades
+		memory for speed. The overhead of copying means that it is only faster
+		for fairly large datasets, so you are advised to only use it for collections
+		of at least a few hundred items.
+	@par
+		This is a template class to allow it to deal with a variety of containers, 
+		and a variety of value types to sort on. In addition to providing the
+		container and value type on construction, you also need to supply a 
+		functor object which will retrieve the value to compare on for each item
+		in the list. For example, if you had an std::vector of by-value instances
+		of an object of class 'Bibble', and you wanted to sort on 
+		Bibble::getDoobrie(), you'd have to firstly create a functor
+		like this:
+	@code
+		struct BibbleSortFunctor
+		{
+			float operator()(const Bibble& val) const
+			{
+				return val.getDoobrie();
+			}
+		}
+	@endcode
+		Then, you need to declare a RadixSort class which names the container type, 
+		the value type in the container, and the type of the value you want to 
+		sort by. You can then call the sort function. E.g.
+	@code
+		RadixSort<BibbleList, Bibble, float> radixSorter;
+		BibbleSortFunctor functor;
+
+		radixSorter.sort(myBibbleList, functor);
+	@endcode
+		You should try to reuse RadixSort instances, since repeated allocation of the 
+		internal storage is then avoided.
+	@note
+		Radix sorting is often associated with just unsigned integer values. Our
+		implementation can handle both unsigned and signed integers, as well as
+		floats (which are often not supported by other radix sorters). doubles
+		are not supported; you will need to implement your functor object to convert
+		to float if you wish to use this sort routine.
+	*/
+	template <class TContainer, class TContainerValueType, typename TCompValueType>
+	class RadixSort
+	{
+	public:
+		typedef typename TContainer::iterator ContainerIter;
+	protected:
+		/// Alpha-pass counters of values (histogram)
+		/// 4 of them so we can radix sort a maximum of a 32bit value
+		int mCounters[4][256];
+		/// Beta-pass offsets 
+		int mOffsets[256];
+		/// Sort area size
+		int mSortSize;
+		/// Number of passes for this type
+		int mNumPasses;
+
+		struct SortEntry
+		{
+			TCompValueType key;
+			ContainerIter iter;
+			SortEntry() {}
+			SortEntry(TCompValueType k, ContainerIter it)
+				: key(k), iter(it) {}
+
+		};
+		/// Temp sort storage
+		std::vector<SortEntry> mSortArea1;
+		std::vector<SortEntry> mSortArea2;
+		std::vector<SortEntry>* mSrc;
+		std::vector<SortEntry>* mDest;
+		TContainer mTmpContainer; // initial copy
+
+
+		void sortPass(int byteIndex)
+		{
+			// Calculate offsets
+			// Basically this just leaves gaps for duplicate entries to fill
+			mOffsets[0] = 0;
+			for (int i = 1; i < 256; ++i)
+			{
+				mOffsets[i] = mOffsets[i-1] + mCounters[byteIndex][i-1];
+			}
+
+			// Sort pass
+			for (int i = 0; i < mSortSize; ++i)
+			{
+				unsigned char byteVal = getByte(byteIndex, (*mSrc)[i].key);
+				(*mDest)[mOffsets[byteVal]++] = (*mSrc)[i];
+			}
+
+		}
+		template <typename T>
+		void finalPass(int byteIndex, T val)
+		{
+			// default is to do normal pass
+			sortPass(byteIndex);
+		}
+		
+		// special case signed int
+		void finalPass(int byteIndex, int val)
+		{
+			int numNeg = 0;
+			// all negative values are in entries 128+ in most significant byte
+			for (int i = 128; i < 256; ++i)
+			{
+				numNeg += mCounters[byteIndex][i];
+			}
+			// Calculate offsets - positive ones start at the number of negatives
+			// do positive numbers
+			mOffsets[0] = numNeg;
+			for (int i = 1; i < 128; ++i)
+			{
+				mOffsets[i] = mOffsets[i-1] + mCounters[byteIndex][i-1];
+			}
+			// Do negative numbers (must start at zero)
+			// No need to invert ordering, already correct (-1 is highest number)
+			mOffsets[128] = 0;
+			for (int i = 129; i < 256; ++i)
+			{
+				mOffsets[i] = mOffsets[i-1] + mCounters[byteIndex][i-1];
+			}
+
+			// Sort pass
+			for (int i = 0; i < mSortSize; ++i)
+			{
+				unsigned char byteVal = getByte(byteIndex, (*mSrc)[i].key);
+				(*mDest)[mOffsets[byteVal]++] = (*mSrc)[i];
+			}
+		}
+		
+
+		// special case float
+		void finalPass(int byteIndex, float val)
+		{
+			// floats need to be special cased since negative numbers will come
+			// after positives (high bit = sign) and will be in reverse order
+			// (no ones-complement of the +ve value)
+			int numNeg = 0;
+			// all negative values are in entries 128+ in most significant byte
+			for (int i = 128; i < 256; ++i)
+			{
+				numNeg += mCounters[byteIndex][i];
+			}
+			// Calculate offsets - positive ones start at the number of negatives
+			// do positive numbers normally
+			mOffsets[0] = numNeg;
+			for (int i = 1; i < 128; ++i)
+			{
+				mOffsets[i] = mOffsets[i-1] + mCounters[byteIndex][i-1];
+			}
+			// Do negative numbers (must start at zero)
+			// Also need to invert ordering
+			// In order to preserve the stability of the sort (essential since
+			// we rely on previous bytes already being sorted) we have to count
+			// backwards in our offsets from 
+			mOffsets[255] = mCounters[byteIndex][255];
+			for (int i = 254; i > 127; --i)
+			{
+				mOffsets[i] = mOffsets[i+1] + mCounters[byteIndex][i];
+			}
+
+			// Sort pass
+			for (int i = 0; i < mSortSize; ++i)
+			{
+				unsigned char byteVal = getByte(byteIndex, (*mSrc)[i].key);
+				if (byteVal > 127)
+				{
+					// -ve; pre-decrement since offsets set to count
+					(*mDest)[--mOffsets[byteVal]] = (*mSrc)[i];
+				}
+				else
+				{
+					// +ve
+					(*mDest)[mOffsets[byteVal]++] = (*mSrc)[i];
+				}
+			}
+		}
+
+		inline unsigned char getByte(int byteIndex, TCompValueType val)
+		{
+#if OGRE_ENDIAN == OGRE_ENDIAN_LITTLE
+			return ((unsigned char*)(&val))[byteIndex];
+#else
+			return ((unsigned char*)(&val))[mNumPasses - byteIndex - 1];
+#endif
+		}
+
+	public:
+
+		RadixSort() {}
+		~RadixSort() {}
+
+		/** Main sort function
+		@param container A container of the type you declared when declaring
+		@param func A functor which returns the value for comparison when given
+			a container value
+		*/
+		template <class TFunction>
+		void sort(TContainer& container, TFunction func)
+		{
+			if (container.empty())
+				return;
+
+			// Set up the sort areas
+			mSortSize = static_cast<int>(container.size());
+			mSortArea1.resize(container.size());
+			mSortArea2.resize(container.size());
+
+			// Copy data now (we need constant iterators for sorting)
+			mTmpContainer = container;
+
+			mNumPasses = sizeof(TCompValueType);
+
+			// Counter pass
+			// Initialise the counts
+			int p;
+			for (p = 0; p < mNumPasses; ++p)
+				memset(mCounters[p], 0, sizeof(int) * 256);
+
+			// Perform alpha pass to count
+			ContainerIter i = mTmpContainer.begin();
+			TCompValueType prevValue = func.operator()(*i); 
+			bool needsSorting = false;
+			for (int u = 0; i != mTmpContainer.end(); ++i, ++u)
+			{
+				// get sort value
+				TCompValueType val = func.operator()(*i);
+				// cheap check to see if needs sorting (temporal coherence)
+				if (!needsSorting && val < prevValue)
+					needsSorting = true;
+
+				// Create a sort entry
+				mSortArea1[u].key = val;
+				mSortArea1[u].iter = i;
+
+				// increase counters
+				for (p = 0; p < mNumPasses; ++p)
+				{
+					unsigned char byteVal = getByte(p, val);
+					mCounters[p][byteVal]++;
+				}
+
+				prevValue = val;
+
+			}
+
+			// early exit if already sorted
+			if (!needsSorting)
+				return;
+
+
+			// Sort passes
+			mSrc = &mSortArea1;
+			mDest = &mSortArea2;
+
+			for (p = 0; p < mNumPasses - 1; ++p)
+			{
+				sortPass(p);
+				// flip src/dst
+				std::vector<SortEntry>* tmp = mSrc;
+				mSrc = mDest;
+				mDest = tmp;
+			}
+			// Final pass may differ, make polymorphic
+			finalPass(p, prevValue);
+
+			// Copy everything back
+			int c = 0;
+			for (i = container.begin(); 
+				i != container.end(); ++i, ++c)
+			{
+				*i = *((*mDest)[c].iter);
+			}
+		}
+
+	};
+
+
+}
+#endif
+
Index: /OgreMain/include/OgreRay.h
===================================================================
--- /OgreMain/include/OgreRay.h	(revision 5)
+++ /OgreMain/include/OgreRay.h	(revision 5)
@@ -0,0 +1,115 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Ray_H_
+#define __Ray_H_
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+
+#include "OgreVector3.h"
+#include "OgrePlaneBoundedVolume.h"
+
+namespace Ogre {
+
+    /** Representation of a ray in space, ie a line with an origin and direction. */
+    class _OgreExport Ray
+    {
+    protected:
+        Vector3 mOrigin;
+        Vector3 mDirection;
+    public:
+        Ray():mOrigin(Vector3::ZERO), mDirection(Vector3::UNIT_Z) {}
+        Ray(const Vector3& origin, const Vector3& direction)
+            :mOrigin(origin), mDirection(direction) {}
+
+        /** Sets the origin of the ray. */
+        void setOrigin(const Vector3& origin) {mOrigin = origin;} 
+        /** Gets the origin of the ray. */
+        const Vector3& getOrigin(void) const {return mOrigin;} 
+
+        /** Sets the direction of the ray. */
+        void setDirection(const Vector3& dir) {mDirection = dir;} 
+        /** Gets the direction of the ray. */
+        const Vector3& getDirection(void) const {return mDirection;} 
+
+		/** Gets the position of a point t units along the ray. */
+		Vector3 getPoint(Real t) const { 
+			return Vector3(mOrigin + (mDirection * t));
+		}
+		
+		/** Gets the position of a point t units along the ray. */
+		Vector3 operator*(Real t) const { 
+			return getPoint(t);
+		};
+
+		/** Tests whether this ray intersects the given plane. 
+		@returns A pair structure where the first element indicates whether
+			an intersection occurs, and if true, the second element will
+			indicate the distance along the ray at which it intersects. 
+			This can be converted to a point in space by calling getPoint().
+		*/
+		std::pair<bool, Real> intersects(const Plane& p) const
+		{
+			return Math::intersects(*this, p);
+		}
+        /** Tests whether this ray intersects the given plane bounded volume. 
+        @returns A pair structure where the first element indicates whether
+        an intersection occurs, and if true, the second element will
+        indicate the distance along the ray at which it intersects. 
+        This can be converted to a point in space by calling getPoint().
+        */
+        std::pair<bool, Real> intersects(const PlaneBoundedVolume& p) const
+        {
+            return Math::intersects(*this, p.planes, p.outside == Plane::POSITIVE_SIDE);
+        }
+		/** Tests whether this ray intersects the given sphere. 
+		@returns A pair structure where the first element indicates whether
+			an intersection occurs, and if true, the second element will
+			indicate the distance along the ray at which it intersects. 
+			This can be converted to a point in space by calling getPoint().
+		*/
+		std::pair<bool, Real> intersects(const Sphere& s) const
+		{
+			return Math::intersects(*this, s);
+		}
+		/** Tests whether this ray intersects the given box. 
+		@returns A pair structure where the first element indicates whether
+			an intersection occurs, and if true, the second element will
+			indicate the distance along the ray at which it intersects. 
+			This can be converted to a point in space by calling getPoint().
+		*/
+		std::pair<bool, Real> intersects(const AxisAlignedBox& box) const
+		{
+			return Math::intersects(*this, box);
+		}
+
+    };
+
+}
+#endif
Index: /OgreMain/include/OgreRectangle.h
===================================================================
--- /OgreMain/include/OgreRectangle.h	(revision 5)
+++ /OgreMain/include/OgreRectangle.h	(revision 5)
@@ -0,0 +1,69 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _Rectangle_H__
+#define _Rectangle_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+    struct _OgreExport Rectangle
+    {
+        Real left;
+        Real top;
+        Real right;
+        Real bottom;
+
+        inline bool inside(Real x, Real y) const { return x >= left && x <= right && y >= top && y <= bottom; }
+    };
+
+    /** Geometric intersection of two rectanglar regions.
+     *
+     * @remarks Calculates the geometric intersection of two rectangular
+     * regions.  Rectangle coordinates must be ([0-N], [0-N]), such that
+     * (0,0) is in the upper left hand corner.
+     *
+     * If the two input rectangles do not intersect, then the result will be
+     * a degenerate rectangle, i.e. left >= right or top >= bottom, or both.
+     */
+    inline Rectangle intersect(const Rectangle& lhs, const Rectangle& rhs)
+    {
+        Rectangle r;
+
+        r.left   = lhs.left   > rhs.left   ? lhs.left   : rhs.left;
+        r.top    = lhs.top    > rhs.top    ? lhs.top    : rhs.top;
+        r.right  = lhs.right  < rhs.right  ? lhs.right  : rhs.right;
+        r.bottom = lhs.bottom < rhs.bottom ? lhs.bottom : rhs.bottom;
+
+        return r;
+    }
+
+}
+
+#endif // _Rectangle_H__
Index: /OgreMain/include/OgreRectangle2D.h
===================================================================
--- /OgreMain/include/OgreRectangle2D.h	(revision 5)
+++ /OgreMain/include/OgreRectangle2D.h	(revision 5)
@@ -0,0 +1,79 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _Rectangle2D_H__
+#define _Rectangle2D_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreSimpleRenderable.h"
+
+namespace Ogre {
+
+    /** Allows the rendering of a simple 2D rectangle
+    This class renders a simple 2D rectangle; this rectangle has no depth and
+    therefore is best used with specific render queue and depth settings,
+    like RENDER_QUEUE_BACKGROUND and 'depth_write off' for backdrops, and 
+    RENDER_QUEUE_OVERLAY and 'depth_check off' for fullscreen quads.
+    */
+    class _OgreExport Rectangle2D : public SimpleRenderable
+    {
+    protected:
+        /** Override this method to prevent parent transforms (rotation,translation,scale)
+        */
+        void getWorldTransforms( Matrix4* xform ) const;
+        /** @copydoc Renderable::getWorldOrientation */
+        const Quaternion& getWorldOrientation(void) const;
+        /** @copydoc Renderable::getWorldPosition */
+        const Vector3& getWorldPosition(void) const;
+
+    public:
+
+        Rectangle2D(bool includeTextureCoordinates = false);
+        ~Rectangle2D();
+
+        /** Sets the corners of the rectangle, in relative coordinates.
+        @param
+        left Left position in screen relative coordinates, -1 = left edge, 1.0 = right edge
+        top Top position in screen relative coordinates, 1 = top edge, -1 = bottom edge
+        right Right position in screen relative coordinates
+        bottom Bottom position in screen relative coordinates
+        */
+        void setCorners(Real left, Real top, Real right, Real bottom);
+
+        Real getSquaredViewDepth(const Camera* cam) const { return 0; }
+
+        Real getBoundingRadius(void) const { return 0; }
+
+    };
+
+}// namespace
+
+#endif
+
+
Index: /OgreMain/include/OgreRenderOperation.h
===================================================================
--- /OgreMain/include/OgreRenderOperation.h	(revision 5)
+++ /OgreMain/include/OgreRenderOperation.h	(revision 5)
@@ -0,0 +1,84 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _RenderOperation_H__
+#define _RenderOperation_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreVertexIndexData.h"
+
+namespace Ogre {
+
+
+	/** 'New' rendering operation using vertex buffers. */
+	class _OgrePrivate RenderOperation {
+	public:
+		/// The rendering operation type to perform
+		enum OperationType {
+			/// A list of points, 1 vertex per point
+            OT_POINT_LIST = 1,
+			/// A list of lines, 2 vertices per line
+            OT_LINE_LIST = 2,
+			/// A strip of connected lines, 1 vertex per line plus 1 start vertex
+            OT_LINE_STRIP = 3,
+			/// A list of triangles, 3 vertices per triangle
+            OT_TRIANGLE_LIST = 4,
+			/// A strip of triangles, 3 vertices for the first triangle, and 1 per triangle after that 
+            OT_TRIANGLE_STRIP = 5,
+			/// A fan of triangles, 3 vertices for the first triangle, and 1 per triangle after that
+            OT_TRIANGLE_FAN = 6
+        };
+
+		/// Vertex source data
+		VertexData *vertexData;
+
+		/// The type of operation to perform
+		OperationType operationType;
+
+		/** Specifies whether to use indexes to determine the vertices to use as input. If false, the vertices are
+		 simply read in sequence to define the primitives. If true, indexes are used instead to identify vertices
+		 anywhere in the buffer, and allowing vertices to be used more than once.
+	   	 If true, then the indexBuffer, indexStart and numIndexes properties must be valid. */
+		bool useIndexes;
+
+		/// Index data - only valid if useIndexes is true
+		IndexData *indexData;
+		/// Debug pointer back to renderable which created this
+		const Renderable* srcRenderable;
+
+
+        RenderOperation() :
+            vertexData(0), operationType(OT_TRIANGLE_LIST), useIndexes(true),
+                indexData(0) {}
+
+	};
+}
+
+
+
+#endif
Index: /OgreMain/include/OgreRenderQueue.h
===================================================================
--- /OgreMain/include/OgreRenderQueue.h	(revision 5)
+++ /OgreMain/include/OgreRenderQueue.h	(revision 5)
@@ -0,0 +1,258 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderQueue_H__
+#define __RenderQueue_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre {
+
+    /** Enumeration of queue groups, by which the application may group queued renderables
+        so that they are rendered together with events in between
+	@remarks
+		When passed into methods these are actually passed as a uint8 to allow you
+		to use values in between if you want to.
+    */
+    enum RenderQueueGroupID
+    {
+        /// Use this queue for objects which must be rendered first e.g. backgrounds
+        RENDER_QUEUE_BACKGROUND = 0,
+        /// First queue (after backgrounds), used for skyboxes if rendered first
+        RENDER_QUEUE_SKIES_EARLY = 5,
+        RENDER_QUEUE_1 = 10,
+        RENDER_QUEUE_2 = 20,
+		RENDER_QUEUE_WORLD_GEOMETRY_1 = 25,
+        RENDER_QUEUE_3 = 30,
+        RENDER_QUEUE_4 = 40,
+		/// The default render queue
+        RENDER_QUEUE_MAIN = 50,
+        RENDER_QUEUE_6 = 60,
+        RENDER_QUEUE_7 = 70,
+		RENDER_QUEUE_WORLD_GEOMETRY_2 = 75,
+        RENDER_QUEUE_8 = 80,
+        RENDER_QUEUE_9 = 90,
+        /// Penultimate queue(before overlays), used for skyboxes if rendered last
+        RENDER_QUEUE_SKIES_LATE = 95,
+        /// Use this queue for objects which must be rendered last e.g. overlays
+        RENDER_QUEUE_OVERLAY = 100, 
+		/// Final possible render queue, don't exceed this
+		RENDER_QUEUE_MAX = 105
+    };
+
+    #define OGRE_RENDERABLE_DEFAULT_PRIORITY  100
+
+    /** Class to manage the scene object rendering queue.
+        @remarks
+            Objects are grouped by material to minimise rendering state changes. The map from
+            material to renderable object is wrapped in a class for ease of use.
+        @par
+            This class now includes the concept of 'queue groups' which allows the application
+            adding the renderable to specifically schedule it so that it is included in 
+            a discrete group. Good for separating renderables into the main scene,
+            backgrounds and overlays, and also could be used in the future for more
+            complex multipass routines like stenciling.
+    */
+    class _OgreExport RenderQueue
+    {
+    public:
+        typedef std::map< uint8, RenderQueueGroup* > RenderQueueGroupMap;
+        /// Iterator over queue groups
+        typedef MapIterator<RenderQueueGroupMap> QueueGroupIterator;
+		/** Class to listen in on items being added to the render queue. 
+		@remarks
+			Use RenderQueue::setRenderableListener to get callbacks when an item
+			is added to the render queue.
+		*/
+		class _OgreExport RenderableListener
+		{
+		public:
+			RenderableListener() {}
+			virtual ~RenderableListener() {}
+
+			/** Method called when a Renderable is added to the queue.
+			@remarks
+				You can use this event hook to alter the Technique used to
+				render a Renderable as the item is added to the queue. This is
+				a low-level way to override the material settings for a given
+				Renderable on the fly.
+			@param rend The Renderable being added to the queue
+			@param groupID The render queue group this Renderable is being added to
+			@param priority The priority the Renderable has been given
+			@param ppTech A pointer to the pointer to the Technique that is 
+				intended to be used; you can alter this to an alternate Technique
+				if you so wish (the Technique doesn't have to be from the same
+				Material either).
+			@returns true to allow the Renderable to be added to the queue, 
+				false if you want to prevent it being added
+			*/
+			virtual bool renderableQueued(Renderable* rend, uint8 groupID, 
+				ushort priority, Technique** ppTech) = 0;
+		};
+    protected:
+        RenderQueueGroupMap mGroups;
+        /// The current default queue group
+        uint8 mDefaultQueueGroup;
+        /// The default priority
+        ushort mDefaultRenderablePriority;
+
+        bool mSplitPassesByLightingType;
+        bool mSplitNoShadowPasses;
+		bool mShadowCastersCannotBeReceivers;
+
+		RenderableListener* mRenderableListener;
+    public:
+        RenderQueue();
+        virtual ~RenderQueue();
+
+        /** Empty the queue - should only be called by SceneManagers.
+		@param destroyPassMaps Set to true to destroy all pass maps so that
+			the queue is completely clean (useful when switching scene managers)
+        */
+        void clear(bool destroyPassMaps = false);
+
+		/** Get a render queue group.
+		@remarks
+			OGRE registers new queue groups as they are requested, 
+			therefore this method will always return a valid group.
+		*/
+		RenderQueueGroup* getQueueGroup(uint8 qid);
+
+        /** Add a renderable object to the queue.
+        @remarks
+            This methods adds a Renderable to the queue, which will be rendered later by 
+            the SceneManager. This is the advanced version of the call which allows the renderable
+            to be added to any queue.
+        @note
+            Called by implementation of MovableObject::_updateRenderQueue.
+        @param
+            pRend Pointer to the Renderable to be added to the queue
+        @param
+            groupID The group the renderable is to be added to. This
+            can be used to schedule renderable objects in separate groups such that the SceneManager
+            respects the divisions between the groupings and does not reorder them outside these
+            boundaries. This can be handy for overlays where no matter what you want the overlay to 
+            be rendered last.
+        @param
+            priority Controls the priority of the renderable within the queue group. If this number
+            is raised, the renderable will be rendered later in the group compared to it's peers.
+            Don't use this unless you really need to, manually ordering renderables prevents OGRE
+            from sorting them for best efficiency. However this could be useful for ordering 2D
+            elements manually for example.
+        */
+        void addRenderable(Renderable* pRend, uint8 groupID, ushort priority);
+
+        /** Add a renderable object to the queue.
+        @remarks
+            This methods adds a Renderable to the queue, which will be rendered later by 
+            the SceneManager. This is the simplified version of the call which does not 
+            require a priority to be specified. The queue priority is take from the
+            current default (see setDefaultRenderablePriority).
+        @note
+            Called by implementation of MovableObject::_updateRenderQueue.
+        @param
+            pRend Pointer to the Renderable to be added to the queue
+		@param
+            groupID The group the renderable is to be added to. This
+            can be used to schedule renderable objects in separate groups such that the SceneManager
+            respects the divisions between the groupings and does not reorder them outside these
+            boundaries. This can be handy for overlays where no matter what you want the overlay to 
+            be rendered last.
+        */
+        void addRenderable(Renderable* pRend, uint8 groupId);
+
+        /** Add a renderable object to the queue.
+        @remarks
+            This methods adds a Renderable to the queue, which will be rendered later by 
+            the SceneManager. This is the simplified version of the call which does not 
+            require a queue or priority to be specified. The queue group is taken from the
+            current default (see setDefaultQueueGroup).  The queue priority is take from the
+            current default (see setDefaultRenderablePriority).
+        @note
+            Called by implementation of MovableObject::_updateRenderQueue.
+        @param
+            pRend Pointer to the Renderable to be added to the queue
+        */
+        void addRenderable(Renderable* pRend);
+        
+        /** Gets the current default queue group, which will be used for all renderable which do not
+            specify which group they wish to be on.
+        */
+        uint8 getDefaultQueueGroup(void) const;
+
+        /** Sets the current default renderable priority, 
+            which will be used for all renderables which do not
+            specify which priority they wish to use.
+        */
+        void setDefaultRenderablePriority(ushort priority);
+
+        /** Gets the current default renderable priority, which will be used for all renderables which do not
+            specify which priority they wish to use.
+        */
+        ushort getDefaultRenderablePriority(void) const;
+
+        /** Sets the current default queue group, which will be used for all renderable which do not
+            specify which group they wish to be on.
+        */
+        void setDefaultQueueGroup(uint8 grp);
+        
+        /** Internal method, returns an iterator for the queue groups. */
+        QueueGroupIterator _getQueueGroupIterator(void);
+        /** Sets whether or not the queue will split passes by their lighting type,
+            ie ambient, per-light and decal. 
+        */
+        void setSplitPassesByLightingType(bool split);
+        /** Sets whether or not the queue will split passes which have shadow receive
+        turned off (in their parent material), which is needed when certain shadow
+        techniques are used.
+        */
+        void setSplitNoShadowPasses(bool split);
+		/** Sets whether or not objects which cast shadows should be treated as
+		never receiving shadows. 
+		*/
+		void setShadowCastersCannotBeReceivers(bool ind);
+
+		/** Set a renderable listener on the queue.
+		@remarks
+			There can only be a single renderable listener on the queue, since
+			that listener has complete control over the techniques in use.
+		*/
+		void setRenderableListener(RenderableListener* listener)
+		{ mRenderableListener = listener; }
+
+		RenderableListener* getRenderableListener(void) const
+		{ return mRenderableListener; }
+
+    };
+
+
+}
+
+
+#endif
Index: /OgreMain/include/OgreRenderQueueInvocation.h
===================================================================
--- /OgreMain/include/OgreRenderQueueInvocation.h	(revision 5)
+++ /OgreMain/include/OgreRenderQueueInvocation.h	(revision 5)
@@ -0,0 +1,218 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2005 The OGRE Team
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderQueueInvocation_H__
+#define __RenderQueueInvocation_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreRenderQueueSortingGrouping.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre {
+
+	/** Class representing the invocation of queue groups in a RenderQueue.
+	@remarks
+		The default behaviour for OGRE's render queue is to render each queue
+		group in turn, dealing with shadows automatically, and rendering solids
+		in grouped passes, followed by transparent objects in descending order.
+		This class, together with RenderQueueInvocationSequence and the ability
+		to associate one with a Viewport, allows you to change that behaviour
+		and render queue groups in arbitrary sequence, repeatedly, and to skip
+		shadows, change the ordering of solids, or even prevent OGRE controlling
+		the render state during a particular invocation for special effects.
+	@par
+		Note that whilst you can change the ordering of rendering solids, you 
+		can't change the ordering on transparent objects, since to do this would
+		cause them to render incorrectly.
+	@par
+		As well as using this class directly and using the options it provides you
+		with, you can also provide subclasses of it to a 
+		RenderQueueInvocationSequence instance if you want to gain ultimate control.
+	@note
+		Invocations will be skipped if there are scene-level options preventing
+		them being rendered - for example special-case render queues and
+		render queue listeners that dictate this.
+	*/
+	class _OgreExport RenderQueueInvocation
+	{
+	protected:
+		/// Target queue group
+		uint8 mRenderQueueGroupID;
+		/// Invocation identifier - used in listeners
+		String mInvocationName;
+		/// Solids ordering mode
+		QueuedRenderableCollection::OrganisationMode mSolidsOrganisation;
+		/// Suppress shadows processing in this invocation?
+		bool mSuppressShadows;
+		/// Suppress OGRE's render state management?
+		bool mSuppressRenderStateChanges;
+	public:
+		/** Constructor
+		@param renderQueueGroupID ID of the queue this will target
+		@param invocationName Optional name to uniquely identify this
+			invocation from others in a RenderQueueListener
+		*/
+		RenderQueueInvocation(uint8 renderQueueGroupID, 
+			const String& invocationName = StringUtil::BLANK);
+		virtual ~RenderQueueInvocation();
+
+		/// Get the render queue group id
+		virtual uint8 getRenderQueueGroupID(void) const { return mRenderQueueGroupID; }
+
+		/// Get the invocation name (may be blank if not set by creator)
+		virtual const String& getInvocationName(void) const { return mInvocationName; }
+
+		/** Set the organisation mode being used for solids in this queue group
+		invocation.
+		*/
+		virtual void setSolidsOrganisation(
+			QueuedRenderableCollection::OrganisationMode org)  
+		{ mSolidsOrganisation = org; }
+
+		/** Get the organisation mode being used for solids in this queue group
+			invocation.
+		*/
+		virtual QueuedRenderableCollection::OrganisationMode
+			getSolidsOrganisation(void) const { return mSolidsOrganisation; }
+
+		/** Sets whether shadows are suppressed when invoking this queue. 
+		@remarks
+			When doing effects you often will want to suppress shadow processing
+			if shadows will already have been done by a previous render.
+		*/
+		virtual void setSuppressShadows(bool suppress) 
+		{ mSuppressShadows =  suppress; }
+
+		/** Gets whether shadows are suppressed when invoking this queue. 
+		*/
+		virtual bool getSuppressShadows(void) const { return mSuppressShadows; }
+
+		/** Sets whether render state changes are suppressed when invoking this queue. 
+		@remarks
+			When doing special effects you may want to set up render state yourself
+			and have it apply for the entire rendering of a queue. In that case, 
+			you should call this method with a parameter of 'true', and use a
+			RenderQueueListener to set the render state directly on RenderSystem
+			yourself before the invocation.
+		@par
+			Suppressing render state changes is only intended for advanced use, 
+			don't use it if you're unsure of the effect. The only RenderSystem
+			calls made are to set the world matrix for each object (note - 
+			view an projection matrices are NOT SET - they are under your control) 
+			and to render the object; it is up to the caller to do everything else, 
+			including enabling any vertex / fragment programs and updating their 
+			parameter state, and binding parameters to the RenderSystem.
+			We advise you use a RenderQueueListener in order to get a notification
+			when this invocation is going to happen (use an invocation name to
+			identify it if you like), at which point you can set the state you
+			need to apply before the objects are rendered.
+		*/
+		virtual void setSuppressRenderStateChanges(bool suppress) 
+		{ mSuppressRenderStateChanges =  suppress; }
+
+		/** Gets whether shadows are suppressed when invoking this queue. 
+		*/
+		virtual bool getSuppressRenderStateChanges(void) const { return mSuppressRenderStateChanges; }
+
+		/** Invoke this class on a concrete queue group.
+		@remarks
+			Implementation will send the queue group to the target scene manager
+			after doing what it needs to do.
+		*/
+		virtual void invoke(RenderQueueGroup* group, SceneManager* targetSceneManager);
+
+		/// Invocation identifier for shadows
+		static String RENDER_QUEUE_INVOCATION_SHADOWS;
+	};
+
+
+	/// List of RenderQueueInvocations
+	typedef std::vector<RenderQueueInvocation*> RenderQueueInvocationList;
+	typedef VectorIterator<RenderQueueInvocationList> RenderQueueInvocationIterator;
+
+	/** Class to hold a linear sequence of RenderQueueInvocation objects. 
+	@remarks
+		This is just a simple data holder class which contains a list of 
+		RenderQueueInvocation objects representing the sequence of invocations
+		made for a viewport. It's only real purpose is to ensure that 
+		RenderQueueInvocation instances are deleted on shudown, since you can
+		provide your own subclass instances on RenderQueueInvocation. Remember
+		that any invocation instances you give to this class will be deleted
+		by it when it is cleared / destroyed.
+	*/
+	class _OgreExport RenderQueueInvocationSequence
+	{
+	protected:
+		String mName;
+		RenderQueueInvocationList mInvocations;
+	public:
+		RenderQueueInvocationSequence(const String& name);
+		virtual ~RenderQueueInvocationSequence();
+
+		/** Get the name of this sequence. */
+		const String& getName(void) const { return mName; }
+
+		/** Add a standard invocation to the sequence.
+		@param renderQueueGroupID The ID of the render queue group
+		@param invocationName Optional name to identify the invocation, useful
+			for listeners if a single queue group is invoked more than once
+		@returns A new RenderQueueInvocatin instance which you may customise
+		*/
+		RenderQueueInvocation* add(uint8 renderQueueGroupID, 
+			const String& invocationName);
+
+		/** Add a custom invocation to the sequence.
+		@remarks
+			Use this to add your own custom subclasses of RenderQueueInvocation
+			to the sequence; just remember that this class takes ownership of
+			deleting this pointer when it is cleared / destroyed.
+		*/
+		void add(RenderQueueInvocation* i);
+
+		/** Get the number of invocations in this sequence. */
+		size_t size(void) const { return mInvocations.size(); }
+
+		/** Clear and delete all invocations in this sequence. */
+		void clear(void);
+
+		/** Gets the details of an invocation at a given index. */
+		RenderQueueInvocation* get(size_t index);
+
+		/** Removes (and deletes) an invocation by index. */
+		void remove(size_t index);
+
+		/** Get an iterator over the invocations. */
+		RenderQueueInvocationIterator iterator(void);
+
+
+	};
+
+}
+
+#endif
+
Index: /OgreMain/include/OgreRenderQueueListener.h
===================================================================
--- /OgreMain/include/OgreRenderQueueListener.h	(revision 5)
+++ /OgreMain/include/OgreRenderQueueListener.h	(revision 5)
@@ -0,0 +1,89 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderQueueListener_H__
+#define __RenderQueueListener_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreRenderQueue.h"
+
+namespace Ogre {
+
+    /** Abstract interface which classes must implement if they wish to receive
+        events from the render queue. 
+    @remarks
+        The OGRE render queue is divided into several queue groups, as defined by
+        uint8. A class may implement this interface, and register itself
+        as a listener by calling SceneManager::addRenderQueueListener. After doing so,
+        the class will receive an event before and after each queue group is sent to 
+        the rendering system.
+    @par
+        The event listeners have an option to make a queue either be skipped, or to repeat.
+        Note that if multiple listeners are registered, the one registered last has the final
+        say, although options set by previous listeners will not be changed if the latest
+        does not express a preference.
+    */
+    class _OgreExport RenderQueueListener
+    {
+    public:
+		virtual ~RenderQueueListener() {}
+        /** Event raised before a queue group is rendered. 
+        @remarks
+            This method is called by the SceneManager before each queue group is
+            rendered. 
+        @param queueGroupId The id of the queue group which is about to be rendered
+		@param invocation Name of the invocation which is causing this to be 
+			called (@see RenderQueueInvocation)
+		@param skipThisInvocation A boolean passed by reference which is by default set to 
+			false. If the event sets this to true, the queue will be skipped and not
+			rendered. Note that in this case the renderQueueEnded event will not be raised
+			for this queue group.
+        */
+        virtual void renderQueueStarted(uint8 queueGroupId, const String& invocation, 
+			bool& skipThisInvocation) = 0;
+
+        /** Event raised after a queue group is rendered. 
+        @remarks
+            This method is called by the SceneManager after each queue group is
+            rendered. 
+        @param queueGroupId The id of the queue group which has just been rendered
+		@param invocation Name of the invocation which is causing this to be 
+			called (@see RenderQueueInvocation)
+		@param repeatThisInvocation A boolean passed by reference which is by default set to 
+			false. If the event sets this to true, the queue which has just been
+			rendered will be repeated, and the renderQueueStarted and renderQueueEnded
+			events will also be fired for it again.
+        */
+        virtual void renderQueueEnded(uint8 queueGroupId, const String& invocation, 
+			bool& repeatThisInvocation) = 0;
+    };
+
+}
+
+#endif
+
Index: /OgreMain/include/OgreRenderQueueSortingGrouping.h
===================================================================
--- /OgreMain/include/OgreRenderQueueSortingGrouping.h	(revision 5)
+++ /OgreMain/include/OgreRenderQueueSortingGrouping.h	(revision 5)
@@ -0,0 +1,653 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderQueueSortingGrouping_H__
+#define __RenderQueueSortingGrouping_H__
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreMaterial.h"
+#include "OgreTechnique.h"
+#include "OgrePass.h"
+#include "OgreRadixSort.h"
+
+namespace Ogre {
+
+	/** Struct associating a single Pass with a single Renderable. 
+		This is used to for objects sorted by depth and thus not
+		grouped by pass.
+	*/
+	struct RenderablePass
+	{
+		/// Pointer to the Renderable details
+		Renderable* renderable;
+		/// Pointer to the Pass
+		Pass* pass;
+
+		RenderablePass(Renderable* rend, Pass* p) :renderable(rend), pass(p) {}
+	};
+
+
+	/** Visitor interface for items in a QueuedRenderableCollection.
+	@remarks
+		Those wishing to iterate over the items in a 
+		QueuedRenderableCollection should implement this visitor pattern,
+		since internal organisation of the collection depends on the 
+		sorting method in use.
+	*/
+	class _OgreExport QueuedRenderableVisitor
+	{
+	public:
+		QueuedRenderableVisitor() {}
+		virtual ~QueuedRenderableVisitor() {}
+		
+		/** Called when visiting a RenderablePass, ie items in a
+			sorted collection where items are not grouped by pass.
+		@remarks
+			If this is called, neither of the other 2 visit methods
+			will be called.
+		*/
+		virtual void visit(const RenderablePass* rp) = 0;
+
+		/* When visiting a collection grouped by pass, this is
+			called when the grouping pass changes.
+		@remarks
+			If this method is called, the RenderablePass visit 
+			method will not be called for this collection. The 
+			Renderable visit method will be called for each item
+			underneath the pass grouping level.
+		@returns True to continue, false to skip the Renderables underneath
+		*/
+		virtual bool visit(const Pass* p) = 0;
+		/** Visit method called once per Renderable on a grouped 
+			collection.
+		@remarks
+			If this method is called, the RenderablePass visit 
+			method will not be called for this collection. 
+		*/
+		virtual void visit(const Renderable* r) = 0;
+		
+		
+	};
+
+	/** Lowest level collection of renderables.
+	@remarks
+		To iterate over items in this collection, you must call
+		the accept method and supply a QueuedRenderableVisitor.
+		The order of the iteration, and whether that iteration is
+		over a RenderablePass list or a 2-level grouped list which 
+		causes a visit call at the Pass level, and a call for each
+		Renderable underneath.
+	*/
+	class _OgreExport QueuedRenderableCollection
+	{
+	public:
+		/** Organisation modes required for this collection.
+		@remarks
+			This affects the internal placement of the items added to this collection;
+			if only one type of sorting / grouping is to be required, then renderables
+			can be stored only once, whilst if multiple types are going to be needed
+			then internally there will be multiple organisations. Changing the organisation
+			needs to be done when the collection is empty.
+		*/		
+		enum OrganisationMode
+		{
+			/// Group by pass
+			OM_PASS_GROUP = 1,
+			/// Sort descending camera distance
+			OM_SORT_DESCENDING = 2,
+			/** Sort ascending camera distance 
+				Note value overlaps with descending since both use same sort
+			*/
+			OM_SORT_ASCENDING = 6
+		};
+
+	protected:
+        /// Comparator to order pass groups
+        struct PassGroupLess
+        {
+            bool _OgreExport operator()(const Pass* a, const Pass* b) const
+            {
+                // Sort by passHash, which is pass, then texture unit changes
+                uint32 hasha = a->getHash();
+                uint32 hashb = b->getHash();
+                if (hasha == hashb)
+                {
+                    // Must differentTransparentQueueItemLessiate by pointer incase 2 passes end up with the same hash
+                    return a < b;
+                }
+                else
+                {
+                    return hasha < hashb;
+                }
+            }
+        };
+        /// Comparator to order objects by descending camera distance
+		struct DepthSortDescendingLess
+        {
+            const Camera* camera;
+
+            DepthSortDescendingLess(const Camera* cam)
+                : camera(cam)
+            {
+            }
+
+            bool _OgreExport operator()(const RenderablePass& a, const RenderablePass& b) const
+            {
+                if (a.renderable == b.renderable)
+                {
+                    // Same renderable, sort by pass hash
+                    return a.pass->getHash() < b.pass->getHash();
+                }
+                else
+                {
+                    // Different renderables, sort by depth
+                    Real adepth = a.renderable->getSquaredViewDepth(camera);
+                    Real bdepth = b.renderable->getSquaredViewDepth(camera);
+					if (Math::RealEqual(adepth, bdepth))
+				    {
+                        // Must return deterministic result, doesn't matter what
+                        return a.pass < b.pass;
+				    }
+				    else
+				    {
+				        // Sort DESCENDING by depth (ie far objects first)
+					    return (adepth > bdepth);
+				    }
+                }
+
+            }
+        };
+
+        /** Vector of RenderablePass objects, this is built on the assumption that
+         vectors only ever increase in size, so even if we do clear() the memory stays
+         allocated, ie fast */
+        typedef std::vector<RenderablePass> RenderablePassList;
+        typedef std::vector<Renderable*> RenderableList;
+        /** Map of pass to renderable lists, this is a grouping by pass. */
+        typedef std::map<Pass*, RenderableList*, PassGroupLess> PassGroupRenderableMap;
+
+		/// Functor for accessing sort value 1 for radix sort (Pass)
+		struct RadixSortFunctorPass
+		{
+			uint32 operator()(const RenderablePass& p) const
+            {
+                return p.pass->getHash();
+            }
+		};
+
+        /// Radix sorter for accessing sort value 1 (Pass)
+		static RadixSort<RenderablePassList, RenderablePass, uint32> msRadixSorter1;
+
+		/// Functor for descending sort value 2 for radix sort (distance)
+		struct RadixSortFunctorDistance
+		{
+			const Camera* camera;
+
+            RadixSortFunctorDistance(const Camera* cam)
+                : camera(cam)
+            {
+            }
+
+			float operator()(const RenderablePass& p) const
+            {
+                // Sort DESCENDING by depth (ie far objects first), use negative distance
+                // here because radix sorter always dealing with accessing sort
+                return static_cast<float>(- p.renderable->getSquaredViewDepth(camera));
+            }
+		};
+
+        /// Radix sorter for sort value 2 (distance)
+		static RadixSort<RenderablePassList, RenderablePass, float> msRadixSorter2;
+
+		/// Bitmask of the organisation modes requested
+		uint8 mOrganisationMode;
+
+		/// Grouped 
+		PassGroupRenderableMap mGrouped;
+		/// Sorted descending (can iterate backwards to get ascending)
+		RenderablePassList mSortedDescending;
+
+		/// Internal visitor implementation
+		void acceptVisitorGrouped(QueuedRenderableVisitor* visitor) const;
+		/// Internal visitor implementation
+		void acceptVisitorDescending(QueuedRenderableVisitor* visitor) const;
+		/// Internal visitor implementation
+		void acceptVisitorAscending(QueuedRenderableVisitor* visitor) const;
+
+	public:
+		QueuedRenderableCollection();
+		~QueuedRenderableCollection();
+
+		/// Empty the collection
+		void clear(void);
+
+		/** Remove the group entry (if any) for a given Pass.
+		@remarks
+			To be used when a pass is destroyed, such that any
+			grouping level for it becomes useless.
+		*/	
+		void removePassGroup(Pass* p);
+		
+		/** Reset the organisation modes required for this collection. 
+		@remarks
+			You can only do this when the collection is empty.
+		@see OrganisationMode
+		*/
+		void resetOrganisationModes(void) 
+		{ 
+			mOrganisationMode = 0; 
+		}
+		
+		/** Add a required sorting / grouping mode to this collection when next used.
+		@remarks
+			You can only do this when the collection is empty.
+		@see OrganisationMode
+		*/
+		void addOrganisationMode(OrganisationMode om) 
+		{ 
+			mOrganisationMode |= om; 
+		}
+
+        /// Add a renderable to the collection using a given pass
+        void addRenderable(Pass* pass, Renderable* rend);
+		
+		/** Perform any sorting that is required on this collection.
+		@param cam The camera
+		*/
+		void sort(const Camera* cam);
+
+		/** Accept a visitor over the collection contents.
+		@param visitor Visitor class which should be called back
+		@param om The organisation mode which you want to iterate over.
+			Note that this must have been included in an addOrganisationMode
+			call before any renderables were added.
+		*/
+		void acceptVisitor(QueuedRenderableVisitor* visitor, OrganisationMode om) const;
+		
+	};
+
+	/** Collection of renderables by priority.
+    @remarks
+        This class simply groups renderables for rendering. All the 
+        renderables contained in this class are destined for the same
+        RenderQueueGroup (coarse groupings like those between the main
+        scene and overlays) and have the same priority (fine groupings
+        for detailed overlap control).
+    @par
+        This class can order solid renderables by a number of criteria; 
+		it can optimise them into groups based on pass to reduce render 
+		state changes, or can sort them by ascending or descending view 
+		depth. Transparent objects are always ordered by descending depth.
+	@par
+		To iterate over items in the collections held by this object 
+	   	you should retrieve the collection in use (e.g. solids, solids with
+		no shadows, transparents) and use the accept() method, providing 
+		a class implementing QueuedRenderableVisitor.
+	
+    */
+    class _OgreExport RenderPriorityGroup
+    {
+	protected:
+
+		/// Parent queue group
+        RenderQueueGroup* mParent;
+        bool mSplitPassesByLightingType;
+        bool mSplitNoShadowPasses;
+		bool mShadowCastersNotReceivers;
+        /// Solid pass list, used when no shadows, modulative shadows, or ambient passes for additive
+		QueuedRenderableCollection mSolidsBasic;
+        /// Solid per-light pass list, used with additive shadows
+        QueuedRenderableCollection mSolidsDiffuseSpecular;
+        /// Solid decal (texture) pass list, used with additive shadows
+        QueuedRenderableCollection mSolidsDecal;
+        /// Solid pass list, used when shadows are enabled but shadow receive is turned off for these passes
+        QueuedRenderableCollection mSolidsNoShadowReceive;
+		/// Transparent list
+		QueuedRenderableCollection mTransparents;
+
+        /// remove a pass entry from all collections
+        void removePassEntry(Pass* p);
+
+        /// Internal method for adding a solid renderable
+        void addSolidRenderable(Technique* pTech, Renderable* rend, bool toNoShadowMap);
+        /// Internal method for adding a solid renderable
+        void addSolidRenderableSplitByLightType(Technique* pTech, Renderable* rend);
+        /// Internal method for adding a transparent renderable
+        void addTransparentRenderable(Technique* pTech, Renderable* rend);
+
+    public:
+        RenderPriorityGroup(RenderQueueGroup* parent, 
+            bool splitPassesByLightingType,
+            bool splitNoShadowPasses, 
+			bool shadowCastersNotReceivers); 
+           
+        ~RenderPriorityGroup() { }
+
+        /** Get the collection of basic solids currently queued, this includes
+			all solids when there are no shadows, or all solids which have shadow
+			receiving enabled when using modulative shadows, or all ambient passes
+			of solids which have shadow receive enabled for additive shadows. */
+        const QueuedRenderableCollection& getSolidsBasic(void) const
+        { return mSolidsBasic; }
+        /** Get the collection of solids currently queued per light (only applicable in 
+		 	additive shadow modes). */
+        const QueuedRenderableCollection& getSolidsDiffuseSpecular(void) const
+        { return mSolidsDiffuseSpecular; }
+        /** Get the collection of solids currently queued for decal passes (only 
+			applicable in additive shadow modes). */
+        const QueuedRenderableCollection& getSolidsDecal(void) const
+        { return mSolidsDecal; }
+        /** Get the collection of solids for which shadow receipt is disabled (only
+			applicable when shadows are enabled). */
+        const QueuedRenderableCollection& getSolidsNoShadowReceive(void) const
+        { return mSolidsNoShadowReceive; }
+        /** Get the collection of transparent objects currently queued */
+        const QueuedRenderableCollection& getTransparents(void) const
+        { return mTransparents; }
+
+
+		/** Reset the organisation modes required for the solids in this group. 
+		@remarks
+			You can only do this when the group is empty, ie after clearing the 
+			queue.
+		@see QueuedRenderableCollection::OrganisationMode
+		*/
+		void resetOrganisationModes(void);
+		
+		/** Add a required sorting / grouping mode for the solids in this group.
+		@remarks
+			You can only do this when the group is empty, ie after clearing the 
+			queue.
+		@see QueuedRenderableCollection::OrganisationMode
+		*/
+		void addOrganisationMode(QueuedRenderableCollection::OrganisationMode om); 
+
+		/** Set the sorting / grouping mode for the solids in this group to the default.
+		@remarks
+			You can only do this when the group is empty, ie after clearing the 
+			queue.
+		@see QueuedRenderableCollection::OrganisationMode
+		*/
+		void defaultOrganisationMode(void); 
+
+		/** Add a renderable to this group. */
+        void addRenderable(Renderable* pRend, Technique* pTech);
+
+		/** Sorts the objects which have been added to the queue; transparent objects by their 
+            depth in relation to the passed in Camera. */
+		void sort(const Camera* cam);
+
+        /** Clears this group of renderables. 
+        */
+        void clear(void);
+
+        /** Sets whether or not the queue will split passes by their lighting type,
+        ie ambient, per-light and decal. 
+        */
+        void setSplitPassesByLightingType(bool split)
+        {
+            mSplitPassesByLightingType = split;
+        }
+
+        /** Sets whether or not passes which have shadow receive disabled should
+            be separated. 
+        */
+        void setSplitNoShadowPasses(bool split)
+        {
+            mSplitNoShadowPasses = split;
+        }
+
+		/** Sets whether or not objects which cast shadows should be treated as
+			never receiving shadows. 
+		*/
+		void setShadowCastersCannotBeReceivers(bool ind)
+		{
+			mShadowCastersNotReceivers = ind;
+		}
+
+
+
+    };
+
+
+    /** A grouping level underneath RenderQueue which groups renderables
+    to be issued at coarsely the same time to the renderer.
+    @remarks
+        Each instance of this class itself hold RenderPriorityGroup instances, 
+        which are the groupings of renderables by priority for fine control
+        of ordering (not required for most instances).
+    */
+    class _OgreExport RenderQueueGroup
+    {
+    public:
+        typedef std::map<ushort, RenderPriorityGroup*, std::less<ushort> > PriorityMap;
+        typedef MapIterator<PriorityMap> PriorityMapIterator;
+    protected:
+        RenderQueue* mParent;
+        bool mSplitPassesByLightingType;
+        bool mSplitNoShadowPasses;
+		bool mShadowCastersNotReceivers;
+        /// Map of RenderPriorityGroup objects
+        PriorityMap mPriorityGroups;
+		/// Whether shadows are enabled for this queue
+		bool mShadowsEnabled;
+
+
+    public:
+		RenderQueueGroup(RenderQueue* parent,
+            bool splitPassesByLightingType,
+            bool splitNoShadowPasses,
+            bool shadowCastersNotReceivers) 
+            : mParent(parent)
+            , mSplitPassesByLightingType(splitPassesByLightingType)
+            , mSplitNoShadowPasses(splitNoShadowPasses)
+            , mShadowCastersNotReceivers(shadowCastersNotReceivers)
+            , mShadowsEnabled(true)
+        {
+        }
+
+        ~RenderQueueGroup() {
+            // destroy contents now
+            PriorityMap::iterator i;
+            for (i = mPriorityGroups.begin(); i != mPriorityGroups.end(); ++i)
+            {
+                delete i->second;
+            }
+        }
+
+        /** Get an iterator for browsing through child contents. */
+        PriorityMapIterator getIterator(void)
+        {
+            return PriorityMapIterator(mPriorityGroups.begin(), mPriorityGroups.end());
+        }
+
+        /** Add a renderable to this group, with the given priority. */
+        void addRenderable(Renderable* pRend, Technique* pTech, ushort priority)
+        {
+            // Check if priority group is there
+            PriorityMap::iterator i = mPriorityGroups.find(priority);
+            RenderPriorityGroup* pPriorityGrp;
+            if (i == mPriorityGroups.end())
+            {
+                // Missing, create
+                pPriorityGrp = new RenderPriorityGroup(this, 
+                    mSplitPassesByLightingType,
+                    mSplitNoShadowPasses, 
+					mShadowCastersNotReceivers);
+                mPriorityGroups.insert(PriorityMap::value_type(priority, pPriorityGrp));
+            }
+            else
+            {
+                pPriorityGrp = i->second;
+            }
+
+            // Add
+            pPriorityGrp->addRenderable(pRend, pTech);
+
+        }
+
+        /** Clears this group of renderables. 
+        @param destroy
+            If false, doesn't delete any priority groups, just empties them. Saves on 
+            memory deallocations since the chances are rougly the same kinds of 
+            renderables are going to be sent to the queue again next time. If
+			true, completely destroys.
+        */
+        void clear(bool destroy = false)
+        {
+            PriorityMap::iterator i, iend;
+            iend = mPriorityGroups.end();
+            for (i = mPriorityGroups.begin(); i != iend; ++i)
+            {
+				if (destroy)
+					delete i->second;
+				else
+					i->second->clear();
+            }
+
+			if (destroy)
+				mPriorityGroups.clear();
+
+        }
+
+		/** Indicate whether a given queue group will be doing any
+		shadow setup.
+		@remarks
+		This method allows you to inform the queue about a queue group, and to 
+		indicate whether this group will require shadow processing of any sort.
+		In order to preserve rendering order, OGRE has to treat queue groups
+		as very separate elements of the scene, and this can result in it
+		having to duplicate shadow setup for each group. Therefore, if you
+		know that a group which you are using will never need shadows, you
+		should preregister the group using this method in order to improve
+		the performance.
+		*/
+		void setShadowsEnabled(bool enabled) { mShadowsEnabled = enabled; }
+
+		/** Are shadows enabled for this queue? */
+		bool getShadowsEnabled(void) const { return mShadowsEnabled; }
+
+        /** Sets whether or not the queue will split passes by their lighting type,
+        ie ambient, per-light and decal. 
+        */
+        void setSplitPassesByLightingType(bool split)
+        {
+            mSplitPassesByLightingType = split;
+            PriorityMap::iterator i, iend;
+            iend = mPriorityGroups.end();
+            for (i = mPriorityGroups.begin(); i != iend; ++i)
+            {
+                i->second->setSplitPassesByLightingType(split);
+            }
+        }
+        /** Sets whether or not the queue will split passes which have shadow receive
+        turned off (in their parent material), which is needed when certain shadow
+        techniques are used.
+        */
+        void setSplitNoShadowPasses(bool split)
+        {
+            mSplitNoShadowPasses = split;
+            PriorityMap::iterator i, iend;
+            iend = mPriorityGroups.end();
+            for (i = mPriorityGroups.begin(); i != iend; ++i)
+            {
+                i->second->setSplitNoShadowPasses(split);
+            }
+        }
+		/** Sets whether or not objects which cast shadows should be treated as
+		never receiving shadows. 
+		*/
+		void setShadowCastersCannotBeReceivers(bool ind)
+		{
+			mShadowCastersNotReceivers = ind;
+			PriorityMap::iterator i, iend;
+			iend = mPriorityGroups.end();
+			for (i = mPriorityGroups.begin(); i != iend; ++i)
+			{
+				i->second->setShadowCastersCannotBeReceivers(ind);
+			}
+		}
+		/** Reset the organisation modes required for the solids in this group. 
+		@remarks
+			You can only do this when the group is empty, ie after clearing the 
+			queue.
+		@see QueuedRenderableCollection::OrganisationMode
+		*/
+		void resetOrganisationModes(void)
+		{
+			PriorityMap::iterator i, iend;
+			iend = mPriorityGroups.end();
+			for (i = mPriorityGroups.begin(); i != iend; ++i)
+			{
+				i->second->resetOrganisationModes();
+			}
+		}
+		
+		/** Add a required sorting / grouping mode for the solids in this group.
+		@remarks
+			You can only do this when the group is empty, ie after clearing the 
+			queue.
+		@see QueuedRenderableCollection::OrganisationMode
+		*/
+		void addOrganisationMode(QueuedRenderableCollection::OrganisationMode om)
+		{
+			PriorityMap::iterator i, iend;
+			iend = mPriorityGroups.end();
+			for (i = mPriorityGroups.begin(); i != iend; ++i)
+			{
+				i->second->addOrganisationMode(om);
+			}
+		}
+
+		/** Setthe  sorting / grouping mode for the solids in this group to the default.
+		@remarks
+			You can only do this when the group is empty, ie after clearing the 
+			queue.
+		@see QueuedRenderableCollection::OrganisationMode
+		*/
+		void defaultOrganisationMode(void)
+		{
+			PriorityMap::iterator i, iend;
+			iend = mPriorityGroups.end();
+			for (i = mPriorityGroups.begin(); i != iend; ++i)
+			{
+				i->second->defaultOrganisationMode();
+			}
+		}
+
+    };
+
+
+
+}
+
+#endif
+
+
Index: /OgreMain/include/OgreRenderSystem.h
===================================================================
--- /OgreMain/include/OgreRenderSystem.h	(revision 5)
+++ /OgreMain/include/OgreRenderSystem.h	(revision 5)
@@ -0,0 +1,1231 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderSystem_H_
+#define __RenderSystem_H_
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+
+#include "OgreString.h"
+
+#include "OgreTextureUnitState.h"
+#include "OgreCommon.h"
+
+#include "OgreRenderOperation.h"
+#include "OgreRenderSystemCapabilities.h"
+#include "OgreRenderTarget.h"
+#include "OgreRenderTexture.h"
+#include "OgreFrameListener.h"
+#include "OgreConfigOptionMap.h"
+#include "OgreGpuProgram.h"
+#include "OgrePlane.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre
+{
+    typedef std::map< String, RenderTarget * > RenderTargetMap;
+	typedef std::multimap<uchar, RenderTarget * > RenderTargetPriorityMap;
+
+    class TextureManager;
+    /// Enum describing the ways to generate texture coordinates
+    enum TexCoordCalcMethod
+    {
+        /// No calculated texture coordinates
+        TEXCALC_NONE,
+        /// Environment map based on vertex normals
+        TEXCALC_ENVIRONMENT_MAP,
+        /// Environment map based on vertex positions
+        TEXCALC_ENVIRONMENT_MAP_PLANAR,
+        TEXCALC_ENVIRONMENT_MAP_REFLECTION,
+        TEXCALC_ENVIRONMENT_MAP_NORMAL,
+        /// Projective texture
+        TEXCALC_PROJECTIVE_TEXTURE
+    };
+    /// Enum describing the various actions which can be taken onthe stencil buffer
+    enum StencilOperation
+    {
+        /// Leave the stencil buffer unchanged
+        SOP_KEEP,
+        /// Set the stencil value to zero
+        SOP_ZERO,
+        /// Set the stencil value to the reference value
+        SOP_REPLACE,
+        /// Increase the stencil value by 1, clamping at the maximum value
+        SOP_INCREMENT,
+        /// Decrease the stencil value by 1, clamping at 0
+        SOP_DECREMENT,
+        /// Increase the stencil value by 1, wrapping back to 0 when incrementing the maximum value
+        SOP_INCREMENT_WRAP,
+        /// Decrease the stencil value by 1, wrapping when decrementing 0
+        SOP_DECREMENT_WRAP,
+        /// Invert the bits of the stencil buffer
+        SOP_INVERT
+    };
+
+    /** Defines the functionality of a 3D API
+        @remarks
+            The RenderSystem class provides a base interface
+            which abstracts the general functionality of the 3D API
+            e.g. Direct3D or OpenGL. Whilst a few of the general
+            methods have implementations, most of this class is
+            abstract, requiring a subclass based on a specific API
+            to be constructed to provide the full functionality.
+            Note there are 2 levels to the interface - one which
+            will be used often by the caller of the Ogre library,
+            and one which is at a lower level and will be used by the
+            other classes provided by Ogre. These lower level
+            methods are prefixed with '_' to differentiate them.
+            The advanced user of the library may use these lower
+            level methods to access the 3D API at a more fundamental
+            level (dealing direct with render states and rendering
+            primitives), but still benefitting from Ogre's abstraction
+            of exactly which 3D API is in use.
+        @author
+            Steven Streeting
+        @version
+            1.0
+     */
+    class _OgreExport RenderSystem
+    {
+    public:
+        /** Default Constructor.
+        */
+        RenderSystem();
+
+        /** Destructor.
+        */
+        virtual ~RenderSystem();
+
+        /** Returns the name of the rendering system.
+        */
+        virtual const String& getName(void) const = 0;
+
+        /** Returns the details of this API's configuration options
+            @remarks
+                Each render system must be able to inform the world
+                of what options must/can be specified for it's
+                operation.
+            @par
+                These are passed as strings for portability, but
+                grouped into a structure (_ConfigOption) which includes
+                both options and current value.
+            @par
+                Note that the settings returned from this call are
+                affected by the options that have been set so far,
+                since some options are interdependent.
+            @par
+                This routine is called automatically by the default
+                configuration dialogue produced by Root::showConfigDialog
+                or may be used by the caller for custom settings dialogs
+            @returns
+                A 'map' of options, i.e. a list of options which is also
+                indexed by option name.
+         */
+        virtual ConfigOptionMap& getConfigOptions(void) = 0;
+
+        /** Sets an option for this API
+            @remarks
+                Used to confirm the settings (normally chosen by the user) in
+                order to make the renderer able to initialise with the settings as required.
+                This may be video mode, D3D driver, full screen / windowed etc.
+                Called automatically by the default configuration
+                dialog, and by the restoration of saved settings.
+                These settings are stored and only activated when
+                RenderSystem::initialise or RenderSystem::reinitialise
+                are called.
+            @par
+                If using a custom configuration dialog, it is advised that the
+                caller calls RenderSystem::getConfigOptions
+                again, since some options can alter resulting from a selection.
+            @param
+                name The name of the option to alter.
+            @param
+                value The value to set the option to.
+         */
+        virtual void setConfigOption(const String &name, const String &value) = 0;
+
+		/** Create an object for performing hardware occlusion queries. 
+		*/
+		virtual HardwareOcclusionQuery* createHardwareOcclusionQuery(void) = 0;
+
+		/** Destroy a hardware occlusion query object. 
+		*/
+		virtual void destroyHardwareOcclusionQuery(HardwareOcclusionQuery *hq);
+
+        /** Validates the options set for the rendering system, returning a message if there are problems.
+            @note
+                If the returned string is empty, there are no problems.
+        */
+        virtual String validateConfigOptions(void) = 0;
+
+        /** Start up the renderer using the settings selected (Or the defaults if none have been selected).
+            @remarks
+                Called by Root::setRenderSystem. Shouldn't really be called
+                directly, although  this can be done if the app wants to.
+            @param
+                autoCreateWindow If true, creates a render window
+                automatically, based on settings chosen so far. This saves
+                an extra call to RenderSystem::createRenderWindow
+                for the main render window.
+            @par
+                If an application has more specific window requirements,
+                however (e.g. a level design app), it should specify false
+                for this parameter and do it manually.
+            @returns
+                A pointer to the automatically created window, if requested, otherwise null.
+        */
+        virtual RenderWindow* initialise(bool autoCreateWindow, const String& windowTitle = "OGRE Render Window");
+
+        /** Restart the renderer (normally following a change in settings).
+        */
+        virtual void reinitialise(void) = 0;
+
+        /** Shutdown the renderer and cleanup resources.
+        */
+        virtual void shutdown(void);
+
+
+        /** Sets the colour & strength of the ambient (global directionless) light in the world.
+        */
+        virtual void setAmbientLight(float r, float g, float b) = 0;
+
+        /** Sets the type of light shading required (default = Gouraud).
+        */
+        virtual void setShadingType(ShadeOptions so) = 0;
+
+        /** Sets whether or not dynamic lighting is enabled.
+            @param
+                enabled If true, dynamic lighting is performed on geometry with normals supplied, geometry without
+                normals will not be displayed. If false, no lighting is applied and all geometry will be full brightness.
+        */
+        virtual void setLightingEnabled(bool enabled) = 0;
+
+        /** Sets whether or not W-buffers are enabled if they are avalible for this renderer.
+			@param
+				enabled If true and the renderer supports them W-buffers will be used.  If false 
+				W-buffers will not be used even if avalible.  W-buffers are enabled by default 
+				for 16bit depth buffers and disabled for all other depths.
+        */
+		void setWBufferEnabled(bool enabled);
+
+		/** Returns true if the renderer will try to use W-buffers when avalible.
+		*/
+		bool getWBufferEnabled(void) const;
+
+		/** Creates a new rendering window.
+            @remarks
+                This method creates a new rendering window as specified
+                by the paramteters. The rendering system could be
+                responible for only a single window (e.g. in the case
+                of a game), or could be in charge of multiple ones (in the
+                case of a level editor). The option to create the window
+                as a child of another is therefore given.
+                This method will create an appropriate subclass of
+                RenderWindow depending on the API and platform implementation.
+            @par
+                After creation, this window can be retrieved using getRenderTarget().
+            @param
+                name The name of the window. Used in other methods
+                later like setRenderTarget and getRenderWindow.
+            @param
+                width The width of the new window.
+            @param
+                height The height of the new window.
+            @param
+                fullScreen Specify true to make the window full screen
+                without borders, title bar or menu bar.
+            @param
+                miscParams A NameValuePairList describing the other parameters for the new rendering window. 
+					Options are case sensitive. Unrecognised parameters will be ignored silently.
+					These values might be platform dependent, but these are present for all platorms unless
+					indicated otherwise:
+				**
+				Key: "title"
+				Description: The title of the window that will appear in the title bar
+				Values: string
+				Default: RenderTarget name
+				**
+				Key: "colourDepth"
+				Description: Colour depth of the resulting rendering window; only applies if fullScreen
+					is set.
+				Values: 16 or 32
+				Default: desktop depth
+				Notes: [W32 specific]
+				**
+				Key: "left"
+				Description: screen x coordinate from left
+				Values: positive integers
+				Default: 'center window on screen'
+				Notes: Ignored in case of full screen
+				**
+				Key: "top"
+				Description: screen y coordinate from top
+				Values: positive integers
+				Default: 'center window on screen'
+				Notes: Ignored in case of full screen
+				**
+				Key: "depthBuffer" [DX9 specific]
+				Description: Use depth buffer
+				Values: false or true
+				Default: true
+				**
+				Key: "externalWindowHandle" [API specific]
+				Description: External window handle, for embedding the OGRE context
+				Values: positive integer for W32 (HWND handle)
+				        poslong:posint:poslong (display*:screen:windowHandle) or
+				        poslong:posint:poslong:poslong (display*:screen:windowHandle:XVisualInfo*) for GLX
+				Default: 0 (None)
+				**
+				Key: "externalGLControl" [Win32 OpenGL specific]
+				Description: Let the external window control OpenGL i.e. don't select a pixel format for the window,
+				             do not change v-sync and do not swap buffer. When set to true, the calling application
+				             is responsible of OpenGL initialization and buffer swapping. It should also create an
+				             OpenGL context for its own rendering, Ogre will create one for its use. Then the calling
+				             application must also enable Ogre OpenGL context before calling any Ogre function and
+				             restore its OpenGL context after these calls. The Ogre OpenGL context can be retrieved 
+				             after Ogre initialisation by calling wglGetCurrentDC() and wglGetCurrentContext().
+				             It is only used when the externalWindowHandle parameter is used.
+				Values: true, false
+				Default: false
+				**
+				Key: "externalGLContext" [Win32 OpenGL specific]
+				Description: Use an externally created GL context
+				Values: <Context as Unsigned Long>
+				Default: 0 (create own context)
+				**
+				Key: "parentWindowHandle" [API specific]
+				Description: Parent window handle, for embedding the OGRE context
+				Values: positive integer for W32 (HWND handle)
+				        poslong:posint:poslong for GLX (display*:screen:windowHandle)
+				Default: 0 (None)
+				**
+				Key: "FSAA"
+				Description: Full screen antialiasing factor
+				Values: 0,2,4,6,...
+				Default: 0 
+				**
+				Key: "displayFrequency"
+				Description: Display frequency rate, for fullscreen mode
+				Values: 60...?
+				Default: Desktop vsync rate
+				**
+				Key: "vsync"
+				Description: Synchronize buffer swaps to vsync
+				Values: true, false
+				Default: 0
+				** 
+				Key: "border" 
+				Description: The type of window border (in windowed mode)
+				Values: none, fixed, resize
+				Default: resize
+				**
+				Key: "outerDimensions" 
+				Description: Whether the width/height is expressed as the size of the 
+				outer window, rather than the content area
+				Values: true, false
+				Default: false 
+				**
+				Key: "useNVPerfHUD" [DX9 specific]
+				Description: Enable the use of nVidia NVPerfHUD
+				Values: true, false
+				Default: false
+        */
+		virtual RenderWindow* createRenderWindow(const String &name, unsigned int width, unsigned int height, 
+			bool fullScreen, const NameValuePairList *miscParams = 0) = 0;
+
+		/** Creates and registers a render texture object.
+			@param name 
+				The name for the new render texture. Note that names must be unique.
+			@param width
+				The requested width for the render texture. See Remarks for more info.
+			@param height
+				The requested width for the render texture. See Remarks for more info.
+			@param texType
+				The type of texture; defaults to TEX_TYPE_2D
+			@param internalFormat
+				The internal format of the texture; defaults to PF_X8R8G8B8
+			@param miscParams This parameter is ignored.
+			@returns
+				On succes, a pointer to a new platform-dependernt, RenderTexture-derived
+				class is returned. On failiure, NULL is returned.
+			@remarks
+				Because a render texture is basically a wrapper around a texture object,
+				the width and height parameters of this method just hint the preferred
+				size for the texture. Depending on the hardware driver or the underlying
+				API, these values might change when the texture is created. The same applies
+				to the internalFormat parameter.
+            @deprecated
+                This method is deprecated, and exists only for backward compatibility. You can create
+                arbitrary rendertextures with the TextureManager::createManual call with usage
+                TU_RENDERTARGET.
+		*/
+		RenderTexture * createRenderTexture( const String & name, unsigned int width, unsigned int height,
+		 	TextureType texType = TEX_TYPE_2D, PixelFormat internalFormat = PF_X8R8G8B8, 
+			const NameValuePairList *miscParams = 0 ); 
+
+		/**	Create a MultiRenderTarget, which is a render target that renders to multiple RenderTextures
+			at once. Surfaces can be bound and unbound at will.
+			This fails if mCapabilities->numMultiRenderTargets() is smaller than 2.
+		*/
+		virtual MultiRenderTarget * createMultiRenderTarget(const String & name) = 0; 
+
+        /** Destroys a render window */
+        virtual void destroyRenderWindow(const String& name);
+        /** Destroys a render texture */
+        virtual void destroyRenderTexture(const String& name);
+        /** Destroys a render target of any sort */
+        virtual void destroyRenderTarget(const String& name);
+
+        /** Attaches the passed render target to the render system.
+        */
+        virtual void attachRenderTarget( RenderTarget &target );
+        /** Returns a pointer to the render target with the passed name, or NULL if that
+            render target cannot be found.
+        */
+        virtual RenderTarget * getRenderTarget( const String &name );
+        /** Detaches the render target with the passed name from the render system and
+            returns a pointer to it.
+            @note
+                If the render target cannot be found, NULL is returned.
+        */
+        virtual RenderTarget * detachRenderTarget( const String &name );
+
+		/// Iterator over RenderTargets
+		typedef MapIterator<Ogre::RenderTargetMap> RenderTargetIterator;
+
+		/** Returns a specialised MapIterator over all render targets attached to the RenderSystem. */
+		virtual RenderTargetIterator getRenderTargetIterator(void) {
+			return RenderTargetIterator( mRenderTargets.begin(), mRenderTargets.end() );
+		}
+        /** Returns a description of an error code.
+        */
+        virtual String getErrorDescription(long errorNumber) const = 0;
+
+        /** Defines whether or now fullscreen render windows wait for the vertical blank before flipping buffers.
+            @remarks
+                By default, all rendering windows wait for a vertical blank (when the CRT beam turns off briefly to move
+                from the bottom right of the screen back to the top left) before flipping the screen buffers. This ensures
+                that the image you see on the screen is steady. However it restricts the frame rate to the refresh rate of
+                the monitor, and can slow the frame rate down. You can speed this up by not waiting for the blank, but
+                this has the downside of introducing 'tearing' artefacts where part of the previous frame is still displayed
+                as the buffers are switched. Speed vs quality, you choose.
+            @note
+                Has NO effect on windowed mode render targets. Only affects fullscreen mode.
+            @param
+                enabled If true, the system waits for vertical blanks - quality over speed. If false it doesn't - speed over quality.
+        */
+        void setWaitForVerticalBlank(bool enabled);
+
+        /** Returns true if the system is synchronising frames with the monitor vertical blank.
+        */
+        bool getWaitForVerticalBlank(void) const;
+
+        // ------------------------------------------------------------------------
+        //                     Internal Rendering Access
+        // All methods below here are normally only called by other OGRE classes
+        // They can be called by library user if required
+        // ------------------------------------------------------------------------
+
+
+        /** Tells the rendersystem to use the attached set of lights (and no others) 
+        up to the number specified (this allows the same list to be used with different
+        count limits) */
+        virtual void _useLights(const LightList& lights, unsigned short limit) = 0;
+        /** Sets the world transform matrix. */
+        virtual void _setWorldMatrix(const Matrix4 &m) = 0;
+        /** Sets multiple world matrices (vertex blending). */
+        virtual void _setWorldMatrices(const Matrix4* m, unsigned short count);
+        /** Sets the view transform matrix */
+        virtual void _setViewMatrix(const Matrix4 &m) = 0;
+        /** Sets the projection transform matrix */
+        virtual void _setProjectionMatrix(const Matrix4 &m) = 0;
+        /** Utility function for setting all the properties of a texture unit at once.
+            This method is also worth using over the individual texture unit settings because it
+            only sets those settings which are different from the current settings for this
+            unit, thus minimising render state changes.
+        */
+        virtual void _setTextureUnitSettings(size_t texUnit, TextureUnitState& tl);
+        /** Turns off a texture unit. */
+        virtual void _disableTextureUnit(size_t texUnit);
+        /** Disables all texture units from the given unit upwards */
+        virtual void _disableTextureUnitsFrom(size_t texUnit);
+        /** Sets the surface properties to be used for future rendering.
+
+            This method sets the the properties of the surfaces of objects
+            to be rendered after it. In this context these surface properties
+            are the amount of each type of light the object reflects (determining
+            it's colour under different types of light), whether it emits light
+            itself, and how shiny it is. Textures are not dealt with here,
+            see the _setTetxure method for details.
+            This method is used by _setMaterial so does not need to be called
+            direct if that method is being used.
+
+            @param ambient The amount of ambient (sourceless and directionless)
+            light an object reflects. Affected by the colour/amount of ambient light in the scene.
+            @param diffuse The amount of light from directed sources that is
+            reflected (affected by colour/amount of point, directed and spot light sources)
+            @param specular The amount of specular light reflected. This is also
+            affected by directed light sources but represents the colour at the
+            highlights of the object.
+            @param emissive The colour of light emitted from the object. Note that
+            this will make an object seem brighter and not dependent on lights in
+            the scene, but it will not act as a light, so will not illuminate other
+            objects. Use a light attached to the same SceneNode as the object for this purpose.
+            @param shininess A value which only has an effect on specular highlights (so
+            specular must be non-black). The higher this value, the smaller and crisper the
+            specular highlights will be, imitating a more highly polished surface.
+            This value is not constrained to 0.0-1.0, in fact it is likely to
+            be more (10.0 gives a modest sheen to an object).
+            @param tracking A bit field that describes which of the ambient, diffuse, specular
+            and emissive colours follow the vertex colour of the primitive. When a bit in this field is set
+            its ColourValue is ignored. This is a combination of TVC_AMBIENT, TVC_DIFFUSE, TVC_SPECULAR(note that the shininess value is still
+            taken from shininess) and TVC_EMISSIVE. TVC_NONE means that there will be no material property
+            tracking the vertex colours.
+        */
+        virtual void _setSurfaceParams(const ColourValue &ambient,
+            const ColourValue &diffuse, const ColourValue &specular,
+            const ColourValue &emissive, Real shininess,
+            TrackVertexColourType tracking = TVC_NONE) = 0;
+
+		/** Sets whether or not rendering points using OT_POINT_LIST will 
+			render point sprites (textured quads) or plain points.
+		@param enabled True enables point sprites, false returns to normal
+			point rendering.
+		*/	
+		virtual void _setPointSpritesEnabled(bool enabled) = 0;
+
+		/** Sets the size of points and how they are attenuated with distance.
+		@remarks
+			When performing point rendering or point sprite rendering,
+			point size can be attenuated with distance. The equation for
+			doing this is attenuation = 1 / (constant + linear * dist + quadratic * d^2) .
+		@par
+			For example, to disable distance attenuation (constant screensize) 
+			you would set constant to 1, and linear and quadratic to 0. A
+			standard perspective attenuation would be 0, 1, 0 respectively.
+		*/
+		virtual void _setPointParameters(Real size, bool attenuationEnabled, 
+			Real constant, Real linear, Real quadratic, Real minSize, Real maxSize) = 0;
+
+
+        /**
+          Sets the texture to bind to a given texture unit.
+
+          User processes would not normally call this direct unless rendering
+          primitives themselves.
+
+          @param unit The index of the texture unit to modify. Multitexturing 
+		  	hardware can support multiple units (see 
+			RenderSystemCapabilites::getNumTextureUnits)
+          @param enabled Boolean to turn the unit on/off
+          @param texPtr Pointer to the texture to use.
+         */
+        virtual void _setTexture(size_t unit, bool enabled, 
+			const TexturePtr &texPtr) = 0;
+        /**
+          Sets the texture to bind to a given texture unit.
+
+          User processes would not normally call this direct unless rendering
+          primitives themselves.
+
+          @param unit The index of the texture unit to modify. Multitexturing 
+		  	hardware can support multiple units (see 
+			RenderSystemCapabilites::getNumTextureUnits)
+          @param enabled Boolean to turn the unit on/off
+          @param texname The name of the texture to use - this should have
+              already been loaded with TextureManager::load.
+         */
+        virtual void _setTexture(size_t unit, bool enabled, const String &texname);
+
+		/** Binds a texture to a vertex sampler.
+		@remarks
+			Not all rendersystems support separate vertex samplers. For those that
+			do, you can set a texture for them, separate to the regular texture
+			samplers, using this method. For those that don't, you should use the
+			regular texture samplers which are shared between the vertex and
+			fragment units; calling this method will throw an exception.
+			@see RenderSystemCapabilites::getVertexTextureUnitsShared
+		*/
+		virtual void _setVertexTexture(size_t unit, const TexturePtr& tex);
+
+        /**
+          Sets the texture coordinate set to use for a texture unit.
+
+          Meant for use internally - not generally used directly by apps - the Material and TextureUnitState
+          classes let you manage textures far more easily.
+
+          @param unit Texture unit as above
+          @param index The index of the texture coordinate set to use.
+         */
+        virtual void _setTextureCoordSet(size_t unit, size_t index) = 0;
+
+        /**
+          Sets a method for automatically calculating texture coordinates for a stage.
+          Should not be used by apps - for use by Ogre only.
+          @param unit Texture unit as above
+          @param m Calculation method to use
+          @param frustum Optional Frustum param, only used for projective effects
+         */
+        virtual void _setTextureCoordCalculation(size_t unit, TexCoordCalcMethod m, 
+            const Frustum* frustum = 0) = 0;
+
+        /** Sets the texture blend modes from a TextureUnitState record.
+            Meant for use internally only - apps should use the Material
+            and TextureUnitState classes.
+            @param unit Texture unit as above
+            @param bm Details of the blending mode
+        */
+        virtual void _setTextureBlendMode(size_t unit, const LayerBlendModeEx& bm) = 0;
+
+        /** Sets the filtering options for a given texture unit.
+        @param unit The texture unit to set the filtering options for
+        @param minFilter The filter used when a texture is reduced in size
+        @param magFilter The filter used when a texture is magnified
+        @param mipFilter The filter used between mipmap levels, FO_NONE disables mipmapping
+        */
+        virtual void _setTextureUnitFiltering(size_t unit, FilterOptions minFilter,
+            FilterOptions magFilter, FilterOptions mipFilter);
+
+        /** Sets a single filter for a given texture unit.
+        @param unit The texture unit to set the filtering options for
+        @param ftype The filter type
+        @param filter The filter to be used
+        */
+        virtual void _setTextureUnitFiltering(size_t unit, FilterType ftype, FilterOptions filter) = 0;
+
+		/** Sets the maximal anisotropy for the specified texture unit.*/
+		virtual void _setTextureLayerAnisotropy(size_t unit, unsigned int maxAnisotropy) = 0;
+
+		/** Sets the texture addressing mode for a texture unit.*/
+        virtual void _setTextureAddressingMode(size_t unit, const TextureUnitState::UVWAddressingMode& uvw) = 0;
+
+		/** Sets the texture border colour for a texture unit.*/
+        virtual void _setTextureBorderColour(size_t unit, const ColourValue& colour) = 0;
+
+		/** Sets the mipmap bias value for a given texture unit.
+		@remarks
+			This allows you to adjust the mipmap calculation up or down for a
+			given texture unit. Negative values force a larger mipmap to be used, 
+			positive values force a smaller mipmap to be used. Units are in numbers
+			of levels, so +1 forces the mipmaps to one smaller level.
+		@note Only does something if render system has capability RSC_MIPMAP_LOD_BIAS.
+		*/
+		virtual void _setTextureMipmapBias(size_t unit, float bias) = 0;
+
+		/** Sets the texture coordinate transformation matrix for a texture unit.
+            @param unit Texture unit to affect
+            @param xform The 4x4 matrix
+        */
+        virtual void _setTextureMatrix(size_t unit, const Matrix4& xform) = 0;
+
+        /** Sets the global blending factors for combining subsequent renders with the existing frame contents.
+            The result of the blending operation is:</p>
+            <p align="center">final = (texture * sourceFactor) + (pixel * destFactor)</p>
+            Each of the factors is specified as one of a number of options, as specified in the SceneBlendFactor
+            enumerated type.
+            @param sourceFactor The source factor in the above calculation, i.e. multiplied by the texture colour components.
+            @param destFactor The destination factor in the above calculation, i.e. multiplied by the pixel colour components.
+        */
+        virtual void _setSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor) = 0;
+
+        /** Sets the global alpha rejection approach for future renders.
+            By default images are rendered regardless of texture alpha. This method lets you change that.
+            @param func The comparison function which must pass for a pixel to be written.
+            @param val The value to compare each pixels alpha value to (0-255)
+        */
+        virtual void _setAlphaRejectSettings(CompareFunction func, unsigned char value) = 0;
+        /**
+         * Signifies the beginning of a frame, ie the start of rendering on a single viewport. Will occur
+         * several times per complete frame if multiple viewports exist.
+         */
+        virtual void _beginFrame(void) = 0;
+
+
+        /**
+         * Ends rendering of a frame to the current viewport.
+         */
+        virtual void _endFrame(void) = 0;
+        /**
+          Sets the provided viewport as the active one for future
+          rendering operations. This viewport is aware of it's own
+          camera and render target. Must be implemented by subclass.
+
+          @param target Pointer to the appropriate viewport.
+         */
+        virtual void _setViewport(Viewport *vp) = 0;
+        /** Get the current active viewport for rendering. */
+        virtual Viewport* _getViewport(void);
+
+        /** Sets the culling mode for the render system based on the 'vertex winding'.
+            A typical way for the rendering engine to cull triangles is based on the
+            'vertex winding' of triangles. Vertex winding refers to the direction in
+            which the vertices are passed or indexed to in the rendering operation as viewed
+            from the camera, and will wither be clockwise or anticlockwise (that's 'counterclockwise' for
+            you Americans out there ;) The default is CULL_CLOCKWISE i.e. that only triangles whose vertices
+            are passed/indexed in anticlockwise order are rendered - this is a common approach and is used in 3D studio models
+            for example. You can alter this culling mode if you wish but it is not advised unless you know what you are doing.
+            You may wish to use the CULL_NONE option for mesh data that you cull yourself where the vertex
+            winding is uncertain.
+        */
+        virtual void _setCullingMode(CullingMode mode) = 0;
+
+        virtual CullingMode _getCullingMode(void) const;
+
+        /** Sets the mode of operation for depth buffer tests from this point onwards.
+            Sometimes you may wish to alter the behaviour of the depth buffer to achieve
+            special effects. Because it's unlikely that you'll set these options for an entire frame,
+            but rather use them to tweak settings between rendering objects, this is an internal
+            method (indicated by the '_' prefix) which will be used by a SceneManager implementation
+            rather than directly from the client application.
+            If this method is never called the settings are automatically the same as the default parameters.
+            @param depthTest If true, the depth buffer is tested for each pixel and the frame buffer is only updated
+                if the depth function test succeeds. If false, no test is performed and pixels are always written.
+            @param depthWrite If true, the depth buffer is updated with the depth of the new pixel if the depth test succeeds.
+                If false, the depth buffer is left unchanged even if a new pixel is written.
+            @param depthFunction Sets the function required for the depth test.
+        */
+        virtual void _setDepthBufferParams(bool depthTest = true, bool depthWrite = true, CompareFunction depthFunction = CMPF_LESS_EQUAL) = 0;
+
+        /** Sets whether or not the depth buffer check is performed before a pixel write.
+            @param enabled If true, the depth buffer is tested for each pixel and the frame buffer is only updated
+                if the depth function test succeeds. If false, no test is performed and pixels are always written.
+        */
+        virtual void _setDepthBufferCheckEnabled(bool enabled = true) = 0;
+        /** Sets whether or not the depth buffer is updated after a pixel write.
+            @param enabled If true, the depth buffer is updated with the depth of the new pixel if the depth test succeeds.
+                If false, the depth buffer is left unchanged even if a new pixel is written.
+        */
+        virtual void _setDepthBufferWriteEnabled(bool enabled = true) = 0;
+        /** Sets the comparison function for the depth buffer check.
+            Advanced use only - allows you to choose the function applied to compare the depth values of
+            new and existing pixels in the depth buffer. Only an issue if the deoth buffer check is enabled
+            (see _setDepthBufferCheckEnabled)
+            @param  func The comparison between the new depth and the existing depth which must return true
+             for the new pixel to be written.
+        */
+        virtual void _setDepthBufferFunction(CompareFunction func = CMPF_LESS_EQUAL) = 0;
+		/** Sets whether or not colour buffer writing is enabled, and for which channels. 
+		@remarks
+			For some advanced effects, you may wish to turn off the writing of certain colour
+			channels, or even all of the colour channels so that only the depth buffer is updated
+			in a rendering pass. However, the chances are that you really want to use this option
+			through the Material class.
+		@param red, green, blue, alpha Whether writing is enabled for each of the 4 colour channels. */
+		virtual void _setColourBufferWriteEnabled(bool red, bool green, bool blue, bool alpha) = 0;
+        /** Sets the depth bias, NB you should use the Material version of this. 
+        @remarks
+            When polygons are coplanar, you can get problems with 'depth fighting' where
+            the pixels from the two polys compete for the same screen pixel. This is particularly
+            a problem for decals (polys attached to another surface to represent details such as
+            bulletholes etc.).
+        @par
+            A way to combat this problem is to use a depth bias to adjust the depth buffer value
+            used for the decal such that it is slightly higher than the true value, ensuring that
+            the decal appears on top.
+		@note
+			The final bias value is a combination of a constant bias and a bias proportional
+			to the maximum depth slope of the polygon being rendered. The final bias
+			is constantBias + slopeScaleBias * maxslope. Slope scale biasing is
+			generally preferable but is not available on older hardware.
+        @param constantBias The constant bias value, expressed as a value in 
+			homogenous depth coordinates.
+		@param slopeScaleBias The bias value which is factored by the maximum slope
+			of the polygon, see the description above. This is not supported by all
+			cards.
+
+        */
+        virtual void _setDepthBias(float constantBias, float slopeScaleBias = 0.0f) = 0;
+        /** Sets the fogging mode for future geometry.
+            @param mode Set up the mode of fog as described in the FogMode enum, or set to FOG_NONE to turn off.
+            @param colour The colour of the fog. Either set this to the same as your viewport background colour,
+                or to blend in with a skydome or skybox.
+            @param expDensity The density of the fog in FOG_EXP or FOG_EXP2 mode, as a value between 0 and 1. The default is 1. i.e. completely opaque, lower values can mean
+                that fog never completely obscures the scene.
+            @param linearStart Distance at which linear fog starts to encroach. The distance must be passed
+                as a parametric value between 0 and 1, with 0 being the near clipping plane, and 1 being the far clipping plane. Only applicable if mode is FOG_LINEAR.
+            @param linearEnd Distance at which linear fog becomes completely opaque.The distance must be passed
+                as a parametric value between 0 and 1, with 0 being the near clipping plane, and 1 being the far clipping plane. Only applicable if mode is FOG_LINEAR.
+        */
+        virtual void _setFog(FogMode mode = FOG_NONE, const ColourValue& colour = ColourValue::White, Real expDensity = 1.0, Real linearStart = 0.0, Real linearEnd = 1.0) = 0;
+
+
+        /** The RenderSystem will keep a count of tris rendered, this resets the count. */
+        virtual void _beginGeometryCount(void);
+        /** Reports the number of tris rendered since the last _beginGeometryCount call. */
+        virtual unsigned int _getFaceCount(void) const;
+		/** Reports the number of batches rendered since the last _beginGeometryCount call. */
+		virtual unsigned int _getBatchCount(void) const;
+        /** Reports the number of vertices passed to the renderer since the last _beginGeometryCount call. */
+        virtual unsigned int _getVertexCount(void) const;
+
+        /** Generates a packed data version of the passed in ColourValue suitable for
+            use as with this RenderSystem.
+        @remarks
+            Since different render systems have different colour data formats (eg
+            RGBA for GL, ARGB for D3D) this method allows you to use 1 method for all.
+        @param colour The colour to convert
+        @param pDest Pointer to location to put the result.
+        */
+        virtual void convertColourValue(const ColourValue& colour, uint32* pDest);
+		/** Get the native VertexElementType for a compact 32-bit colour value
+			for this rendersystem.
+		*/
+		virtual VertexElementType getColourVertexElementType(void) const = 0;
+
+        /** Converts a uniform projection matrix to suitable for this render system.
+        @remarks
+            Because different APIs have different requirements (some incompatible) for the
+            projection matrix, this method allows each to implement their own correctly and pass
+            back a generic OGRE matrix for storage in the engine.
+        */
+        virtual void _convertProjectionMatrix(const Matrix4& matrix,
+            Matrix4& dest, bool forGpuProgram = false) = 0;
+
+        /** Builds a perspective projection matrix suitable for this render system.
+        @remarks
+            Because different APIs have different requirements (some incompatible) for the
+            projection matrix, this method allows each to implement their own correctly and pass
+            back a generic OGRE matrix for storage in the engine.
+        */
+        virtual void _makeProjectionMatrix(const Radian& fovy, Real aspect, Real nearPlane, Real farPlane, 
+            Matrix4& dest, bool forGpuProgram = false) = 0;
+
+        /** Builds a perspective projection matrix for the case when frustum is
+            not centered around camera.
+        @remarks
+            Viewport coordinates are in camera coordinate frame, i.e. camera is 
+            at the origin.
+        */
+        virtual void _makeProjectionMatrix(Real left, Real right, Real bottom, Real top, 
+            Real nearPlane, Real farPlane, Matrix4& dest, bool forGpuProgram = false) = 0;
+        /** Builds an orthographic projection matrix suitable for this render system.
+        @remarks
+            Because different APIs have different requirements (some incompatible) for the
+            projection matrix, this method allows each to implement their own correctly and pass
+            back a generic OGRE matrix for storage in the engine.
+        */
+        virtual void _makeOrthoMatrix(const Radian& fovy, Real aspect, Real nearPlane, Real farPlane, 
+            Matrix4& dest, bool forGpuProgram = false) = 0;
+
+		/** Update a perspective projection matrix to use 'oblique depth projection'.
+		@remarks
+			This method can be used to change the nature of a perspective 
+			transform in order to make the near plane not perpendicular to the 
+			camera view direction, but to be at some different orientation. 
+			This can be useful for performing arbitrary clipping (e.g. to a 
+			reflection plane) which could otherwise only be done using user
+			clip planes, which are more expensive, and not necessarily supported
+			on all cards.
+		@param matrix The existing projection matrix. Note that this must be a
+			perspective transform (not orthographic), and must not have already
+			been altered by this method. The matrix will be altered in-place.
+		@param plane The plane which is to be used as the clipping plane. This
+			plane must be in CAMERA (view) space.
+        @param forGpuProgram Is this for use with a Gpu program or fixed-function
+		*/
+		virtual void _applyObliqueDepthProjection(Matrix4& matrix, const Plane& plane, 
+            bool forGpuProgram) = 0;
+		
+        /** Sets how to rasterise triangles, as points, wireframe or solid polys. */
+        virtual void _setPolygonMode(PolygonMode level) = 0;
+
+        /** Turns stencil buffer checking on or off. 
+        @remarks
+            Stencilling (masking off areas of the rendering target based on the stencil 
+            buffer) canbe turned on or off using this method. By default, stencilling is
+            disabled.
+        */
+        virtual void setStencilCheckEnabled(bool enabled) = 0;
+        /** Determines if this system supports hardware accelerated stencil buffer. 
+        @remarks
+            Note that the lack of this function doesn't mean you can't do stencilling, but
+            the stencilling operations will be provided in software, which will NOT be
+            fast.
+        @par
+            Generally hardware stencils are only supported in 32-bit colour modes, because
+            the stencil buffer shares the memory of the z-buffer, and in most cards the 
+            z-buffer has to be the same depth as the colour buffer. This means that in 32-bit
+            mode, 24 bits of the z-buffer are depth and 8 bits are stencil. In 16-bit mode there
+            is no room for a stencil (although some cards support a 15:1 depth:stencil option,
+            this isn't useful for very much) so 8 bits of stencil are provided in software.
+            This can mean that if you use stencilling, your applications may be faster in 
+            32-but colour than in 16-bit, which may seem odd to some people.
+        */
+        /*virtual bool hasHardwareStencil(void) = 0;*/
+
+        /** This method allows you to set all the stencil buffer parameters in one call.
+        @remarks
+            The stencil buffer is used to mask out pixels in the render target, allowing
+            you to do effects like mirrors, cut-outs, stencil shadows and more. Each of
+            your batches of rendering is likely to ignore the stencil buffer, 
+            update it with new values, or apply it to mask the output of the render.
+            The stencil test is:<PRE>
+            (Reference Value & Mask) CompareFunction (Stencil Buffer Value & Mask)</PRE>
+            The result of this will cause one of 3 actions depending on whether the test fails,
+            succeeds but with the depth buffer check still failing, or succeeds with the
+            depth buffer check passing too.
+        @par
+            Unlike other render states, stencilling is left for the application to turn
+            on and off when it requires. This is because you are likely to want to change
+            parameters between batches of arbitrary objects and control the ordering yourself.
+            In order to batch things this way, you'll want to use OGRE's separate render queue
+            groups (see RenderQueue) and register a RenderQueueListener to get notifications
+            between batches.
+        @par
+            There are individual state change methods for each of the parameters set using 
+            this method. 
+            Note that the default values in this method represent the defaults at system 
+            start up too.
+        @param func The comparison function applied.
+        @param refValue The reference value used in the comparison
+        @param mask The bitmask applied to both the stencil value and the reference value 
+            before comparison
+        @param stencilFailOp The action to perform when the stencil check fails
+        @param depthFailOp The action to perform when the stencil check passes, but the
+            depth buffer check still fails
+        @param passOp The action to take when both the stencil and depth check pass.
+        @param twoSidedOperation If set to true, then if you render both back and front faces 
+            (you'll have to turn off culling) then these parameters will apply for front faces, 
+            and the inverse of them will happen for back faces (keep remains the same).
+        */
+        virtual void setStencilBufferParams(CompareFunction func = CMPF_ALWAYS_PASS, 
+            uint32 refValue = 0, uint32 mask = 0xFFFFFFFF, 
+            StencilOperation stencilFailOp = SOP_KEEP, 
+            StencilOperation depthFailOp = SOP_KEEP,
+            StencilOperation passOp = SOP_KEEP, 
+            bool twoSidedOperation = false) = 0;
+
+
+
+		/** Sets the current vertex declaration, ie the source of vertex data. */
+		virtual void setVertexDeclaration(VertexDeclaration* decl) = 0;
+		/** Sets the current vertex buffer binding state. */
+		virtual void setVertexBufferBinding(VertexBufferBinding* binding) = 0;
+
+        /** Sets whether or not normals are to be automatically normalised.
+        @remarks
+            This is useful when, for example, you are scaling SceneNodes such that
+            normals may not be unit-length anymore. Note though that this has an
+            overhead so should not be turn on unless you really need it.
+        @par
+            You should not normally call this direct unless you are rendering
+            world geometry; set it on the Renderable because otherwise it will be
+            overridden by material settings. 
+        */
+        virtual void setNormaliseNormals(bool normalise) = 0;
+
+        /**
+          Render something to the active viewport.
+
+          Low-level rendering interface to perform rendering
+          operations. Unlikely to be used directly by client
+          applications, since the SceneManager and various support
+          classes will be responsible for calling this method.
+          Can only be called between _beginScene and _endScene
+
+          @param op A rendering operation instance, which contains
+            details of the operation to be performed.
+         */
+        virtual void _render(const RenderOperation& op);
+
+		/** Gets the capabilities of the render system. */
+		const RenderSystemCapabilities* getCapabilities(void) const { return mCapabilities; }
+
+        /** Binds a given GpuProgram (but not the parameters). 
+        @remarks Only one GpuProgram of each type can be bound at once, binding another
+        one will simply replace the exsiting one.
+        */
+        virtual void bindGpuProgram(GpuProgram* prg);
+
+        /** Bind Gpu program parameters.
+        */
+        virtual void bindGpuProgramParameters(GpuProgramType gptype, GpuProgramParametersSharedPtr params) = 0;
+   		/** Only binds Gpu program parameters used for passes that have more than one iteration rendering
+        */
+        virtual void bindGpuProgramPassIterationParameters(GpuProgramType gptype) = 0;
+        /** Unbinds GpuPrograms of a given GpuProgramType.
+        @remarks
+            This returns the pipeline to fixed-function processing for this type.
+        */
+        virtual void unbindGpuProgram(GpuProgramType gptype);
+        
+        /** Returns whether or not a Gpu program of the given type is currently bound. */
+        virtual bool isGpuProgramBound(GpuProgramType gptype);
+
+        /** sets the clipping region.
+        */
+        virtual void setClipPlanes(const PlaneList& clipPlanes) = 0;
+
+        /** Utility method for initialising all render targets attached to this rendering system. */
+        virtual void _initRenderTargets(void);
+
+        /** Utility method to notify all render targets that a camera has been removed, 
+            incase they were referring to it as their viewer. 
+        */
+        virtual void _notifyCameraRemoved(const Camera* cam);
+
+        /** Internal method for updating all render targets attached to this rendering system. */
+        virtual void _updateAllRenderTargets(void);
+
+        /** Set a clipping plane. */
+        virtual void setClipPlane (ushort index, const Plane &p);
+        /** Set a clipping plane. */
+        virtual void setClipPlane (ushort index, Real A, Real B, Real C, Real D) = 0;
+        /** Enable the clipping plane. */
+        virtual void enableClipPlane (ushort index, bool enable) = 0;
+
+        /** Sets whether or not vertex windings set should be inverted; this can be important
+            for rendering reflections. */
+        virtual void setInvertVertexWinding(bool invert);
+        /** Sets the 'scissor region' ie the region of the target in which rendering can take place.
+        @remarks
+            This method allows you to 'mask off' rendering in all but a given rectangular area
+            as identified by the parameters to this method.
+        @note
+            Not all systems support this method. Check the RenderSystemCapabilities for the
+            RSC_SCISSOR_TEST capability to see if it is supported.
+        @param enabled True to enable the scissor test, false to disable it.
+        @param left, top, right, bottom The location of the corners of the rectangle, expressed in
+            <i>pixels</i>.
+        */
+        virtual void setScissorTest(bool enabled, size_t left = 0, size_t top = 0, 
+            size_t right = 800, size_t bottom = 600) = 0;
+
+        /** Clears one or more frame buffers on the active render target. 
+        @param buffers Combination of one or more elements of FrameBufferType
+            denoting which buffers are to be cleared
+        @param colour The colour to clear the colour buffer with, if enabled
+        @param depth The value to initialise the depth buffer with, if enabled
+        @param stencil The value to initialise the stencil buffer with, if enabled.
+        */
+        virtual void clearFrameBuffer(unsigned int buffers, 
+            const ColourValue& colour = ColourValue::Black, 
+            Real depth = 1.0f, unsigned short stencil = 0) = 0;
+        /** Returns the horizontal texel offset value required for mapping 
+            texel origins to pixel origins in this rendersystem.
+        @remarks
+            Since rendersystems sometimes disagree on the origin of a texel, 
+            mapping from texels to pixels can sometimes be problematic to 
+            implement generically. This method allows you to retrieve the offset
+            required to map the origin of a texel to the origin of a pixel in
+            the horizontal direction.
+        */
+        virtual Real getHorizontalTexelOffset(void) = 0;
+        /** Returns the vertical texel offset value required for mapping 
+        texel origins to pixel origins in this rendersystem.
+        @remarks
+        Since rendersystems sometimes disagree on the origin of a texel, 
+        mapping from texels to pixels can sometimes be problematic to 
+        implement generically. This method allows you to retrieve the offset
+        required to map the origin of a texel to the origin of a pixel in
+        the vertical direction.
+        */
+        virtual Real getVerticalTexelOffset(void) = 0;
+
+        /** Gets the minimum (closest) depth value to be used when rendering
+            using identity transforms.
+        @remarks
+            When using identity transforms you can manually set the depth
+            of a vertex; however the input values required differ per
+            rendersystem. This method lets you retrieve the correct value.
+        @see Renderable::getUseIdentityView, Renderable::getUseIdentityProjection
+        */
+        virtual Real getMinimumDepthInputValue(void) = 0;
+        /** Gets the maximum (farthest) depth value to be used when rendering
+            using identity transforms.
+        @remarks
+            When using identity transforms you can manually set the depth
+            of a vertex; however the input values required differ per
+            rendersystem. This method lets you retrieve the correct value.
+        @see Renderable::getUseIdentityView, Renderable::getUseIdentityProjection
+        */
+        virtual Real getMaximumDepthInputValue(void) = 0;
+        /** set the current multi pass count value.  This must be set prior to 
+            calling _render() if multiple renderings of the same pass state are 
+            required.
+        @param count Number of times to render the current state.
+        */
+        void setCurrentPassIterationCount(const size_t count) { mCurrentPassIterationCount = count; }
+
+		/** Defines a listener on the custom events that this render system 
+			can raise.
+		@see RenderSystem::addListener
+		*/
+		class _OgreExport Listener
+		{
+		public:
+			Listener() {}
+			virtual ~Listener() {}
+
+			/** A rendersystem-specific event occurred.
+			@param eventName The name of the event which has occurred
+			@param parameters A list of parameters that may belong to this event,
+				may be null if there are no parameters
+			*/
+			virtual void eventOccurred(const String& eventName, 
+				const NameValuePairList* parameters = 0) = 0;
+		};
+		/** Adds a listener to the custom events that this render system can raise.
+		@remarks
+			Some render systems have quite specific, internally generated events 
+			that the application may wish to be notified of. Many applications
+			don't have to worry about these events, and can just trust OGRE to 
+			handle them, but if you want to know, you can add a listener here.
+		@par
+			Events are raised very generically by string name. Perhaps the most 
+			common example of a render system specific event is the loss and 
+			restoration of a device in DirectX; which OGRE deals with, but you 
+			may wish to know when it happens. 
+		@see RenderSystem::getRenderSystemEvents
+		*/
+		virtual void addListener(Listener* l);
+		/** Remove a listener to the custom events that this render system can raise.
+		*/
+		virtual void removeListener(Listener* l);
+
+		/** Gets a list of the rendersystem specific events that this rendersystem
+			can raise.
+		@see RenderSystem::addListener
+		*/
+		virtual const StringVector& getRenderSystemEvents(void) const { return mEventNames; }
+
+		/** Tell the rendersystem to perform any prep tasks it needs to directly
+			before other threads which might access the rendering API are registered.
+		@remarks
+			Call this from your main thread before starting your other threads
+			(which themselves should call registerThread()). Note that if you
+			start your own threads, there is a specific startup sequence which 
+			must be respected and requires synchronisation between the threads:
+			<ol>
+			<li>[Main thread]Call preExtraThreadsStarted</li>
+			<li>[Main thread]Start other thread, wait</li>
+			<li>[Other thread]Call registerThread, notify main thread & continue</li>
+			<li>[Main thread]Wake up & call postExtraThreadsStarted</li>
+			</ol>
+			Once this init sequence is completed the threads are independent but
+			this startup sequence must be respected.
+		*/
+		virtual void preExtraThreadsStarted() = 0;
+
+		/* Tell the rendersystem to perform any tasks it needs to directly
+			after other threads which might access the rendering API are registered.
+		@see RenderSystem::preExtraThreadsStarted
+		*/
+		virtual void postExtraThreadsStarted() = 0;
+		
+		/** Register the an additional thread which may make calls to rendersystem-related 
+			objects.
+		@remarks
+			This method should only be called by additional threads during their
+			initialisation. If they intend to use hardware rendering system resources 
+			they should call this method before doing anything related to the render system.
+			Some rendering APIs require a per-thread setup and this method will sort that
+			out. It is also necessary to call unregisterThread before the thread shuts down.
+		@note
+			This method takes no parameters - it must be called from the thread being
+			registered and that context is enough.
+		*/
+		virtual void registerThread() = 0;
+			
+		/** Unregister an additional thread which may make calls to rendersystem-related objects.
+		@see RenderSystem::registerThread
+		*/
+		virtual void unregisterThread() = 0;
+    protected:
+
+		
+        /** The render targets. */
+        RenderTargetMap mRenderTargets;
+		/** The render targets, ordered by priority. */
+		RenderTargetPriorityMap mPrioritisedRenderTargets;
+		/** The Active render target. */
+		RenderTarget * mActiveRenderTarget;
+        /** The Active GPU programs and gpu program parameters*/
+        GpuProgramParametersSharedPtr mActiveVertexGpuProgramParameters;
+        GpuProgramParametersSharedPtr mActiveFragmentGpuProgramParameters;
+
+        // Texture manager
+        // A concrete class of this will be created and
+        // made available under the TextureManager singleton,
+        // managed by the RenderSystem
+        TextureManager* mTextureManager;
+
+        /// Used to store the capabilities of the graphics card
+        RenderSystemCapabilities* mCapabilities;
+
+        // Active viewport (dest for future rendering operations)
+        Viewport* mActiveViewport;
+
+        CullingMode mCullingMode;
+
+        bool mVSync;
+		bool mWBuffer;
+
+        size_t mBatchCount;
+        size_t mFaceCount;
+        size_t mVertexCount;
+
+		/// Saved manual colour blends
+		ColourValue mManualBlendColours[OGRE_MAX_TEXTURE_LAYERS][2];
+
+        bool mInvertVertexWinding;
+
+        /// Texture units from this upwards are disabled
+        size_t mDisabledTexUnitsFrom;
+
+        /// number of times to render the current state
+        size_t mCurrentPassIterationCount;
+
+        /** updates pass iteration rendering state including bound gpu program parameter
+            pass iteration auto constant entry
+        @returns True if more iterations are required
+        */
+        bool updatePassIterationRenderState(void);
+
+		/// List of names of events this rendersystem may raise
+		StringVector mEventNames;
+
+		/// Internal method for firing a rendersystem event
+		virtual void fireEvent(const String& name, const NameValuePairList* params = 0);
+
+		typedef std::list<Listener*> ListenerList;
+		ListenerList mEventListeners;
+
+		typedef std::list<HardwareOcclusionQuery*> HardwareOcclusionQueryList;
+		HardwareOcclusionQueryList mHwOcclusionQueries;
+		
+		bool mVertexProgramBound;
+		bool mFragmentProgramBound;
+		
+
+
+    };
+}
+
+#endif
Index: /OgreMain/include/OgreRenderSystemCapabilities.h
===================================================================
--- /OgreMain/include/OgreRenderSystemCapabilities.h	(revision 5)
+++ /OgreMain/include/OgreRenderSystemCapabilities.h	(revision 5)
@@ -0,0 +1,382 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderSystemCapabilities__
+#define __RenderSystemCapabilities__ 1
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+
+namespace Ogre {
+
+    /// Enum describing the different hardware capabilities we want to check for
+    enum Capabilities
+    {
+        //RSC_MULTITEXTURE          = 0x00000001,
+        /// Supporta generating mipmaps in hardware
+        RSC_AUTOMIPMAP              = 0x00000002,
+        RSC_BLENDING                = 0x00000004,
+        /// Supports anisotropic texture filtering
+        RSC_ANISOTROPY              = 0x00000008,
+        /// Supports fixed-function DOT3 texture blend
+        RSC_DOT3                    = 0x00000010,
+        /// Supports cube mapping
+        RSC_CUBEMAPPING             = 0x00000020,
+        /// Supports hardware stencil buffer
+        RSC_HWSTENCIL               = 0x00000040,
+        /// Supports hardware vertex and index buffers
+        RSC_VBO                     = 0x00000080,
+        /// Supports vertex programs (vertex shaders)
+		RSC_VERTEX_PROGRAM          = 0x00000200,
+        /// Supports fragment programs (pixel shaders)
+		RSC_FRAGMENT_PROGRAM        = 0x00000400,
+        /// Supports compressed textures
+		RSC_TEXTURE_COMPRESSION     = 0x00000800,
+        /// Supports compressed textures in the DXT/ST3C formats
+		RSC_TEXTURE_COMPRESSION_DXT = 0x00001000,
+        /// Supports compressed textures in the VTC format
+		RSC_TEXTURE_COMPRESSION_VTC = 0x00002000,
+        /// Supports performing a scissor test to exclude areas of the screen
+        RSC_SCISSOR_TEST            = 0x00004000,
+        /// Supports separate stencil updates for both front and back faces
+        RSC_TWO_SIDED_STENCIL       = 0x00008000,
+        /// Supports wrapping the stencil value at the range extremeties
+        RSC_STENCIL_WRAP            = 0x00010000,
+        /// Supports hardware occlusion queries
+        RSC_HWOCCLUSION				= 0x00020000,
+        /// Supports user clipping planes
+        RSC_USER_CLIP_PLANES		= 0x00040000,
+		/// Supports the VET_UBYTE4 vertex element type
+		RSC_VERTEX_FORMAT_UBYTE4	= 0x00080000,
+		/// Supports infinite far plane projection
+		RSC_INFINITE_FAR_PLANE      = 0x00100000,
+        /// Supports hardware render-to-texture (bigger than framebuffer)
+        RSC_HWRENDER_TO_TEXTURE     = 0x00200000,
+        /// Supports float textures and render targets
+        RSC_TEXTURE_FLOAT           = 0x00400000,
+        /// Supports non-power of two textures
+        RSC_NON_POWER_OF_2_TEXTURES = 0x00800000,
+		/// Supports 3d (volume) textures
+		RSC_TEXTURE_3D				= 0x01000000,
+		/// Supports basic point sprite rendering
+		RSC_POINT_SPRITES		    = 0x02000000,
+		/// Supports extra point parameters (minsize, maxsize, attenuation)
+		RSC_POINT_EXTENDED_PARAMETERS = 0x04000000,
+		/// Supports vertex texture fetch
+		RSC_VERTEX_TEXTURE_FETCH = 0x08000000, 
+		/// Supports mipmap LOD biasing
+		RSC_MIPMAP_LOD_BIAS = 0x10000000 
+
+    };
+
+    /** singleton class for storing the capabilities of the graphics card. 
+        @remarks
+            This class stores the capabilities of the graphics card.  This
+            information is set by the individual render systems.
+    */
+    class _OgreExport RenderSystemCapabilities 
+    {
+        private:
+            /// The number of world matricies available
+            ushort mNumWorldMatrices;
+            /// The number of texture units available
+            ushort mNumTextureUnits;
+            /// The stencil buffer bit depth
+            ushort mStencilBufferBitDepth;
+            /// The number of matrices available for hardware blending
+            ushort mNumVertexBlendMatrices;
+            /// Stores the capabilities flags.
+            int mCapabilities;
+            /// The best vertex program that this card / rendersystem supports
+            String mMaxVertexProgramVersion;
+            /// The best fragment program that this card / rendersystem supports
+            String mMaxFragmentProgramVersion;
+            /// The number of floating-point constants vertex programs support
+            ushort mVertexProgramConstantFloatCount;           
+            /// The number of integer constants vertex programs support
+            ushort mVertexProgramConstantIntCount;           
+            /// The number of boolean constants vertex programs support
+            ushort mVertexProgramConstantBoolCount;           
+            /// The number of floating-point constants fragment programs support
+            ushort mFragmentProgramConstantFloatCount;           
+            /// The number of integer constants fragment programs support
+            ushort mFragmentProgramConstantIntCount;           
+            /// The number of boolean constants fragment programs support
+            ushort mFragmentProgramConstantBoolCount;
+			/// The number of simultaneous render targets supported
+			ushort mNumMultiRenderTargets;
+			/// The maximum point size
+			Real mMaxPointSize;
+			/// Are non-POW2 textures feature-limited?
+			bool mNonPOW2TexturesLimited;
+			/// The number of vertex texture units supported
+			ushort mNumVertexTextureUnits;
+			/// Are vertex texture units shared with fragment processor?
+			bool mVertexTextureUnitsShared;
+
+    	public:	
+            RenderSystemCapabilities ();
+            ~RenderSystemCapabilities ();
+
+            void setNumWorldMatricies(ushort num)
+            {
+                mNumWorldMatrices = num;
+            }
+
+            void setNumTextureUnits(ushort num)
+            {
+                mNumTextureUnits = num;
+            }
+
+            void setStencilBufferBitDepth(ushort num)
+            {
+                mStencilBufferBitDepth = num;
+            }
+
+            void setNumVertexBlendMatrices(ushort num)
+            {
+                mNumVertexBlendMatrices = num;
+            }
+
+			/// The number of simultaneous render targets supported
+			void setNumMultiRenderTargets(ushort num)
+			{
+				mNumMultiRenderTargets = num;
+			}
+
+            ushort getNumWorldMatricies(void) const
+            { 
+                return mNumWorldMatrices;
+            }
+
+            /** Returns the number of texture units the current output hardware
+                supports.
+
+                For use in rendering, this determines how many texture units the
+                are available for multitexturing (i.e. rendering multiple 
+                textures in a single pass). Where a Material has multiple 
+                texture layers, it will try to use multitexturing where 
+                available, and where it is not available, will perform multipass
+                rendering to achieve the same effect. This property only applies
+				to the fixed-function pipeline, the number available to the 
+				programmable pipeline depends on the shader model in use.
+            */
+            ushort getNumTextureUnits(void) const
+            {
+                return mNumTextureUnits;
+            }
+
+            /** Determines the bit depth of the hardware accelerated stencil 
+                buffer, if supported.
+                @remarks
+                    If hardware stencilling is not supported, the software will
+                    provide an 8-bit software stencil.
+            */
+            ushort getStencilBufferBitDepth(void) const
+            {
+                return mStencilBufferBitDepth;
+            }
+
+            /** Returns the number of matrices available to hardware vertex 
+                blending for this rendering system. */
+            ushort numVertexBlendMatrices(void) const
+            {
+                return mNumVertexBlendMatrices;
+            }
+
+			/// The number of simultaneous render targets supported
+			ushort numMultiRenderTargets(void) const
+			{
+				return mNumMultiRenderTargets;
+			}
+
+            /** Adds a capability flag to mCapabilities
+            */
+            void setCapability(const Capabilities c) 
+            { 
+                mCapabilities |= c;
+            }
+
+            /** Checks for a capability
+            */
+            bool hasCapability(const Capabilities c) const
+            {
+                if(mCapabilities & c)
+                {
+                    return true;
+                }
+                else
+                {
+                    return false;
+                }
+            }
+            /// Gets the best low-level vertex program version supported
+            const String& getMaxVertexProgramVersion(void) const
+            {
+                return mMaxVertexProgramVersion;
+            }
+            /// Gets the best fragment program that this card / rendersystem supports
+            const String& getMaxFragmentProgramVersion(void) const
+            {
+                return mMaxFragmentProgramVersion;
+            }
+            /// The number of floating-point constants vertex programs support
+            ushort getVertexProgramConstantFloatCount(void) const
+            {
+                return mVertexProgramConstantFloatCount;           
+            }
+            /// The number of integer constants vertex programs support
+            ushort getVertexProgramConstantIntCount(void) const
+            {
+                return mVertexProgramConstantIntCount;           
+            }
+            /// The number of boolean constants vertex programs support
+            ushort getVertexProgramConstantBoolCount(void) const
+            {
+                return mVertexProgramConstantBoolCount;           
+            }
+            /// The number of floating-point constants fragment programs support
+            ushort getFragmentProgramConstantFloatCount(void) const
+            {
+                return mFragmentProgramConstantFloatCount;           
+            }
+            /// The number of integer constants fragment programs support
+            ushort getFragmentProgramConstantIntCount(void) const
+            {
+                return mFragmentProgramConstantIntCount;           
+            }
+            /// The number of boolean constants fragment programs support
+            ushort getFragmentProgramConstantBoolCount(void) const
+            {
+                return mFragmentProgramConstantBoolCount;           
+            }
+
+
+
+            /// sets the best low-level vertex program version supported
+            void setMaxVertexProgramVersion(const String& ver)
+            {
+                mMaxVertexProgramVersion = ver;
+            }
+            /// sets the best fragment program that this card / rendersystem supports
+            void setMaxFragmentProgramVersion(const String& ver)
+            {
+                mMaxFragmentProgramVersion = ver;
+            }
+            /// The number of floating-point constants vertex programs support
+            void setVertexProgramConstantFloatCount(ushort c)
+            {
+                mVertexProgramConstantFloatCount = c;           
+            }
+            /// The number of integer constants vertex programs support
+            void setVertexProgramConstantIntCount(ushort c)
+            {
+                mVertexProgramConstantIntCount = c;           
+            }
+            /// The number of boolean constants vertex programs support
+            void setVertexProgramConstantBoolCount(ushort c)
+            {
+                mVertexProgramConstantBoolCount = c;           
+            }
+            /// The number of floating-point constants fragment programs support
+            void setFragmentProgramConstantFloatCount(ushort c)
+            {
+                mFragmentProgramConstantFloatCount = c;           
+            }
+            /// The number of integer constants fragment programs support
+            void setFragmentProgramConstantIntCount(ushort c)
+            {
+                mFragmentProgramConstantIntCount = c;           
+            }
+            /// The number of boolean constants fragment programs support
+            void setFragmentProgramConstantBoolCount(ushort c)
+            {
+                mFragmentProgramConstantBoolCount = c;           
+            }
+			/// Maximum point screen size in pixels
+			void setMaxPointSize(Real s)
+			{
+				mMaxPointSize = s;
+			}
+			/// Maximum point screen size in pixels
+			Real getMaxPointSize(void) const
+			{
+				return mMaxPointSize;
+			}
+			/// Non-POW2 textures limited
+			void setNonPOW2TexturesLimited(bool l)
+			{
+				mNonPOW2TexturesLimited = l;
+			}
+			/** Are non-power of two textures limited in features?
+			@remarks
+				If the RSC_NON_POWER_OF_2_TEXTURES capability is set, but this
+				method returns true, you can use non power of 2 textures only if:
+				<ul><li>You load them explicitly with no mip maps</li>
+				<li>You don't use DXT texture compression</li>
+				<li>You use clamp texture addressing</li></ul>
+			*/
+			bool getNonPOW2TexturesLimited(void) const
+			{
+				return mNonPOW2TexturesLimited;
+			}
+
+			/// Set the number of vertex texture units supported
+			void setNumVertexTextureUnits(ushort n)
+			{
+				mNumVertexTextureUnits = n;
+			}
+			/// Get the number of vertex texture units supported
+			ushort getNumVertexTextureUnits(void) const
+			{
+				return mNumVertexTextureUnits;
+			}
+			/// Set whether the vertex texture units are shared with the fragment processor
+			void setVertexTextureUnitsShared(bool shared)
+			{
+				mVertexTextureUnitsShared = shared;
+			}
+			/// Get whether the vertex texture units are shared with the fragment processor
+			bool getVertexTextureUnitsShared(void) const
+			{
+				return mVertexTextureUnitsShared;
+			}
+
+
+            /** Write the capabilities to the pass in Log */
+            void log(Log* pLog);
+
+
+
+
+    };
+}
+
+#endif // __RenderSystemCapabilities__
+
Index: /OgreMain/include/OgreRenderTarget.h
===================================================================
--- /OgreMain/include/OgreRenderTarget.h	(revision 5)
+++ /OgreMain/include/OgreRenderTarget.h	(revision 5)
@@ -0,0 +1,359 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderTarget_H__
+#define __RenderTarget_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreString.h"
+#include "OgreTextureManager.h"
+#include "OgreViewport.h"
+#include "OgreTimer.h"
+
+/* Define the number of priority groups for the render system's render targets. */
+#ifndef OGRE_NUM_RENDERTARGET_GROUPS
+	#define OGRE_NUM_RENDERTARGET_GROUPS 10
+	#define OGRE_DEFAULT_RT_GROUP 4
+	#define OGRE_REND_TO_TEX_RT_GROUP 2
+#endif
+
+namespace Ogre {
+
+    /** A 'canvas' which can receive the results of a rendering
+        operation.
+        @remarks
+            This abstract class defines a common root to all targets of rendering operations. A
+            render target could be a window on a screen, or another
+            offscreen surface like a texture or bump map etc.
+        @author
+            Steven Streeting
+        @version
+            1.0
+     */
+    class _OgreExport RenderTarget
+    {
+    public:
+        enum StatFlags
+        {
+            SF_NONE           = 0,
+            SF_FPS            = 1,
+            SF_AVG_FPS        = 2,
+            SF_BEST_FPS       = 4,
+            SF_WORST_FPS      = 8,
+            SF_TRIANGLE_COUNT = 16,
+            SF_ALL            = 0xFFFF
+        };
+
+        struct FrameStats
+        {
+            float lastFPS;
+            float avgFPS;
+            float bestFPS;
+            float worstFPS;
+            unsigned long bestFrameTime;
+            unsigned long worstFrameTime;
+            size_t triangleCount;
+            size_t batchCount;
+        };
+
+        RenderTarget();
+        virtual ~RenderTarget();
+
+        /// Retrieve target's name.
+        virtual const String& getName(void) const;
+
+        /// Retrieve information about the render target.
+        virtual void getMetrics(unsigned int& width, unsigned int& height, unsigned int& colourDepth);
+
+        virtual unsigned int getWidth(void) const;
+        virtual unsigned int getHeight(void) const;
+        virtual unsigned int getColourDepth(void) const;
+
+        /** Tells the target to update it's contents.
+            @remarks
+                If OGRE is not running in an automatic rendering loop
+                (started using Root::startRendering),
+                the user of the library is responsible for asking each render
+                target to refresh. This is the method used to do this. It automatically
+                re-renders the contents of the target using whatever cameras have been
+                pointed at it (using Camera::setRenderTarget).
+            @par
+                This allows OGRE to be used in multi-windowed utilities
+                and for contents to be refreshed only when required, rather than
+                constantly as with the automatic rendering loop.
+        */
+        virtual void update(void);
+
+        /** Adds a viewport to the rendering target.
+            @remarks
+                A viewport is the rectangle into which redering output is sent. This method adds
+                a viewport to the render target, rendering from the supplied camera. The
+                rest of the parameters are only required if you wish to add more than one viewport
+                to a single rendering target. Note that size information passed to this method is
+                passed as a parametric, i.e. it is relative rather than absolute. This is to allow
+                viewports to automatically resize along with the target.
+            @param
+                cam The camera from which the viewport contents will be rendered (mandatory)
+            @param
+                ZOrder The relative order of the viewport with others on the target (allows overlapping
+                viewports i.e. picture-in-picture). Higher ZOrders are on top of lower ones. The actual number
+                is irrelevant, only the relative ZOrder matters (you can leave gaps in the numbering)
+            @param
+                left The relative position of the left of the viewport on the target, as a value between 0 and 1.
+            @param
+                top The relative position of the top of the viewport on the target, as a value between 0 and 1.
+            @param
+                width The relative width of the viewport on the target, as a value between 0 and 1.
+            @param
+                height The relative height of the viewport on the target, as a value between 0 and 1.
+        */
+        virtual Viewport* addViewport(Camera* cam, int ZOrder = 0, float left = 0.0f, float top = 0.0f ,
+            float width = 1.0f, float height = 1.0f);
+
+        /** Returns the number of viewports attached to this target.*/
+        virtual unsigned short getNumViewports(void) const;
+
+        /** Retrieves a pointer to the viewport with the given index. */
+        virtual Viewport* getViewport(unsigned short index);
+
+        /** Removes a viewport at a given ZOrder.
+        */
+        virtual void removeViewport(int ZOrder);
+
+        /** Removes all viewports on this target.
+        */
+        virtual void removeAllViewports(void);
+
+        /** Retieves details of current rendering performance.
+            @remarks
+                If the user application wishes to do it's own performance
+                display, or use performance for some other means, this
+                method allows it to retrieve the statistics.
+                @param
+                    lastFPS Pointer to a float to receive the number of frames per second (FPS)
+                    based on the last frame rendered.
+                @param
+                    avgFPS Pointer to a float to receive the FPS rating based on an average of all
+                    the frames rendered since rendering began (the call to
+                    Root::startRendering).
+                @param
+                    bestFPS Pointer to a float to receive the best FPS rating that has been achieved
+                    since rendering began.
+                @param
+                    worstFPS Pointer to a float to receive the worst FPS rating seen so far.
+        */
+        virtual void getStatistics(float& lastFPS, float& avgFPS,
+            float& bestFPS, float& worstFPS) const;  // Access to stats
+
+        virtual const FrameStats& getStatistics(void) const;
+
+        /** Individual stats access - gets the number of frames per second (FPS) based on the last frame rendered.
+        */
+        virtual float getLastFPS() const;
+
+        /** Individual stats access - gets the average frames per second (FPS) since call to Root::startRendering.
+        */
+        virtual float getAverageFPS() const;
+
+        /** Individual stats access - gets the best frames per second (FPS) since call to Root::startRendering.
+        */
+        virtual float getBestFPS() const;
+
+        /** Individual stats access - gets the worst frames per second (FPS) since call to Root::startRendering.
+        */
+        virtual float getWorstFPS() const;
+
+        /** Individual stats access - gets the best frame time
+        */
+        virtual float getBestFrameTime() const;
+
+        /** Individual stats access - gets the worst frame time
+        */
+        virtual float getWorstFrameTime() const;
+
+        /** Resets saved frame-rate statistices.
+        */
+        virtual void resetStatistics(void);
+
+        /** Gets a custom (maybe platform-specific) attribute.
+            @remarks
+                This is a nasty way of satisfying any API's need to see platform-specific details.
+                It horrid, but D3D needs this kind of info. At least it's abstracted.
+            @param
+                name The name of the attribute.
+            @param
+                pData Pointer to memory of the right kind of structure to receive the info.
+        */
+        virtual void getCustomAttribute(const String& name, void* pData);
+
+        /** Add a listener to this RenderTarget which will be called back before & after rendering.
+        @remarks
+            If you want notifications before and after a target is updated by the system, use
+            this method to register your own custom RenderTargetListener class. This is useful
+            for potentially adding your own manual rendering commands before and after the
+            'normal' system rendering.
+        @par NB this should not be used for frame-based scene updates, use Root::addFrameListener for that.
+        */
+        virtual void addListener(RenderTargetListener* listener);
+        /** Removes a RenderTargetListener previously registered using addListener. */
+        virtual void removeListener(RenderTargetListener* listener);
+        /** Removes all listeners from this instance. */
+        virtual void removeAllListeners(void);
+
+		/** Sets the priority of this render target in relation to the others. 
+        @remarks
+            This can be used in order to schedule render target updates. Lower
+            priorities will be rendered first. Note that the priority must be set
+            at the time the render target is attached to the render system, changes
+            afterwards will not affect the ordering.
+        */
+        virtual void setPriority( uchar priority ) { mPriority = priority; }
+        /** Gets the priority of a render target. */
+		virtual uchar getPriority() const { return mPriority; }
+
+        /** Used to retrieve or set the active state of the render target.
+        */
+        virtual bool isActive() const;
+
+        /** Used to set the active state of the render target.
+        */
+        virtual void setActive( bool state );
+
+        /** Sets whether this target should be automatically updated if Ogre's rendering
+            loop or Root::_updateAllRenderTargets is being used.
+        @remarks
+            By default, if you use Ogre's own rendering loop (Root::startRendering)
+            or call Root::_updateAllRenderTargets, all render targets are updated 
+            automatically. This method allows you to control that behaviour, if 
+            for example you have a render target which you only want to update periodically.
+        @param autoupdate If true, the render target is updated during the automatic render
+            loop or when Root::_updateAllRenderTargets is called. If false, the 
+            target is only updated when its update() method is called explicitly.
+        */
+        virtual void setAutoUpdated(bool autoupdate);
+        /** Gets whether this target is automatically updated if Ogre's rendering
+            loop or Root::_updateAllRenderTargets is being used.
+        */
+        virtual bool isAutoUpdated(void) const;
+
+        /** Writes the current contents of the render target to the named file. */
+        virtual void writeContentsToFile(const String& filename) = 0;
+
+	/** Writes the current contents of the render target to the (PREFIX)(time-stamp)(SUFFIX) file.
+		@returns the name of the file used.*/
+	virtual String writeContentsToTimestampedFile(const String& filenamePrefix, const String& filenameSuffix);
+
+		virtual bool requiresTextureFlipping() const = 0;
+
+		/** Gets the number of triangles rendered in the last update() call. */
+		virtual size_t getTriangleCount(void) const;
+        /** Gets the number of batches rendered in the last update() call. */
+		virtual size_t getBatchCount(void) const;
+        /** Utility method to notify a render target that a camera has been removed,
+        incase it was referring to it as a viewer.
+        */
+        virtual void _notifyCameraRemoved(const Camera* cam);
+
+        /** Indicates whether this target is the primary window. The
+            primary window is special in that it is destroyed when
+            ogre is shut down, and cannot be destroyed directly.
+            This is the case because it holds the context for vertex,
+            index buffers and textures.
+        */
+        virtual bool isPrimary(void) const;
+
+
+        /** RenderSystem specific interface for a RenderTarget;
+            this should be subclassed by RenderSystems.
+        */
+        class Impl
+        {
+        protected:
+            /** Declared protected as interface is never used for destruction.
+                gcc will issue a warning here: `class Impl' has virtual functions 
+                but non-virtual destructor. This is no problem because this interface 
+                is never used to delete an object.
+            */
+            ~Impl() { };
+        };
+        /** Get rendersystem specific interface for this RenderTarget.
+            This is used by the RenderSystem to (un)bind this target, 
+            and to get specific information like surfaces
+            and framebuffer objects.
+        */
+        virtual Impl *_getImpl();
+    protected:
+        /// The name of this target.
+        String mName;
+		/// The priority of the render target.
+		uchar mPriority;
+
+        unsigned int mWidth;
+        unsigned int mHeight;
+        unsigned int mColourDepth;
+        bool mIsDepthBuffered;
+
+        // Stats
+		FrameStats mStats;
+        
+        Timer* mTimer ;
+        unsigned long mLastSecond;
+        unsigned long mLastTime;
+        size_t mFrameCount;
+
+        bool mActive;
+        bool mAutoUpdate;
+
+        void updateStats(void);
+
+        typedef std::map<int, Viewport*, std::less<int> > ViewportList;
+        /// List of viewports, map on Z-order
+        ViewportList mViewportList;
+
+        typedef std::vector<RenderTargetListener*> RenderTargetListenerList;
+        RenderTargetListenerList mListeners;
+	
+
+        /// internal method for firing events
+        virtual void firePreUpdate(void);
+        /// internal method for firing events
+        virtual void firePostUpdate(void);
+        /// internal method for firing events
+        virtual void fireViewportPreUpdate(Viewport* vp);
+        /// internal method for firing events
+        virtual void fireViewportPostUpdate(Viewport* vp);
+		/// internal method for firing events
+		virtual void fireViewportAdded(Viewport* vp);
+		/// internal method for firing events
+		virtual void fireViewportRemoved(Viewport* vp);
+    };
+
+} // Namespace
+
+#endif
Index: /OgreMain/include/OgreRenderTargetListener.h
===================================================================
--- /OgreMain/include/OgreRenderTargetListener.h	(revision 5)
+++ /OgreMain/include/OgreRenderTargetListener.h	(revision 5)
@@ -0,0 +1,132 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderTargetListener_H__
+#define __RenderTargetListener_H__
+
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+    /** Struct containing information about a RenderTarget event.
+    */
+    struct RenderTargetEvent
+    {
+        /// The source of the event being raised
+        RenderTarget* source;
+    };
+
+    /** Struct containing information about a RenderTarget Viewport-specific event.
+    */
+    struct RenderTargetViewportEvent
+    {
+        /// The source of the event being raised
+        Viewport* source;
+    };
+
+    /** A interface class defining a listener which can be used to receive
+        notifications of RenderTarget events.
+        @remarks
+            A 'listener' is an interface designed to be called back when
+            particular events are called. This class defines the
+            interface relating to RenderTarget events. In order to receive
+            notifications of RenderTarget events, you should create a subclass of
+            RenderTargetListener and override the methods for which you would like
+            to customise the resulting processing. You should then call
+            RenderTarget::addListener passing an instance of this class.
+            There is no limit to the number of RenderTarget listeners you can register,
+            allowing you to register multiple listeners for different purposes.
+            </p>
+            RenderTarget events occur before and after the target is updated as a whole,
+            and before and after each viewport on that target is updated. Each RenderTarget
+            holds it's own set of listeners, but you can register the same listener on
+            multiple render targets if you like since the event contains details of the
+            originating RenderTarget.
+    */
+    class _OgreExport RenderTargetListener
+    {
+        /*
+        Note that this could have been an abstract class, but I made
+        the explicit choice not to do this, because I wanted to give
+        people the option of only implementing the methods they wanted,
+        rather than having to create 'do nothing' implementations for
+        those they weren't interested in. As such this class follows
+        the 'Adapter' classes in Java rather than pure interfaces.
+        */
+    public:
+		virtual ~RenderTargetListener() {}
+        /** Called just before a RenderTarget is about to be rendered into.
+        @remarks
+            This event is raised just before any of the viewports on the target
+            are rendered to. You can perform manual rendering operations here if
+            you want, but please note that if the Viewport objects attached to this
+            target are set up to clear the background, you will lose whatever you 
+            render. If you want some kind of backdrop in this event
+            you should turn off background clearing off on the viewports, and either
+            clear the viewports yourself in this event handler before doing your rendering
+            or just render over the top if you don't need to.
+        */
+        virtual void preRenderTargetUpdate(const RenderTargetEvent& evt) { }
+        /** Called just after a RenderTarget has been rendered to.
+        @remarks
+            This event is called just after all the viewports attached to the target
+            in question have been rendered to. You can perform your own manual rendering
+            commands in this event handler if you like, these will be composited with
+            the contents of the target already there (depending on the material settings 
+            you use etc).
+        */
+        virtual void postRenderTargetUpdate(const RenderTargetEvent& evt) { }
+
+        /* Called just before a Viewport on a RenderTarget is to be updated.
+        @remarks
+            This method is called before each viewport on the RenderTarget is
+            rendered to. You can use this to perform per-viewport settings changes,
+            such as showing / hiding particular overlays.
+        */
+        virtual void preViewportUpdate(const RenderTargetViewportEvent& evt) { }
+
+        /* Called just after a Viewport on a RenderTarget is to be updated.
+        @remarks
+            This method is called after each viewport on the RenderTarget is
+            rendered to. 
+        */
+        virtual void postViewportUpdate(const RenderTargetViewportEvent& evt) { }
+
+		/** Called to notify listener that a Viewport has been added to the 
+			target in question.
+		*/
+		virtual void viewportAdded(const RenderTargetViewportEvent& evt) {}
+		/** Called to notify listener that a Viewport has been removed from the 
+			target in question.
+		*/
+		virtual void viewportRemoved(const RenderTargetViewportEvent& evt) {}
+    };
+}
+
+#endif
Index: /OgreMain/include/OgreRenderTexture.h
===================================================================
--- /OgreMain/include/OgreRenderTexture.h	(revision 5)
+++ /OgreMain/include/OgreRenderTexture.h	(revision 5)
@@ -0,0 +1,100 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderTexture_H__
+#define __RenderTexture_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreRenderTarget.h"
+
+namespace Ogre
+{    
+    /** This class represents a RenderTarget that renders to a Texture. There is no 1 on 1
+        relation between Textures and RenderTextures, as there can be multiple 
+        RenderTargets rendering to different mipmaps, faces (for cubemaps) or slices (for 3D textures)
+        of the same Texture.
+    */
+    class _OgreExport RenderTexture: public RenderTarget
+    {
+    public:
+        RenderTexture(HardwarePixelBuffer *buffer, size_t zoffset);
+        virtual ~RenderTexture();
+
+		void writeContentsToFile( const String & filename );
+	protected:
+		HardwarePixelBuffer *mBuffer;
+		size_t mZOffset;
+    };
+
+	/** This class represents a render target that renders to multiple RenderTextures
+		at once. Surfaces can be bound and unbound at will, as long as the following constraints
+		are met:
+		- All bound surfaces have the same size
+		- All bound surfaces have the same bit depth
+		- Target 0 is bound
+	*/
+	class _OgreExport MultiRenderTarget: public RenderTarget
+	{
+	public:
+		MultiRenderTarget(const String &name);
+
+		/** Bind a surface to a certain attachment point.
+
+            @param attachment	0 .. mCapabilities->numMultiRenderTargets()-1
+
+			@param target		RenderTexture to bind.
+
+
+
+			It does not bind the surface and fails with an exception (ERR_INVALIDPARAMS) if:
+
+			- Not all bound surfaces have the same size
+
+			- Not all bound surfaces have the same internal format 
+
+		*/
+
+		virtual void bindSurface(size_t attachment, RenderTexture *target)=0;
+
+
+
+		/** Unbind attachment.
+
+		*/
+
+		virtual void unbindSurface(size_t attachment)=0; 
+
+		/** Error throwing implementation, it's not possible to write a MultiRenderTarget
+			to disk. 
+		*/
+		virtual void writeContentsToFile( const String & filename );
+	};
+}
+
+#endif
Index: /OgreMain/include/OgreRenderWindow.h
===================================================================
--- /OgreMain/include/OgreRenderWindow.h	(revision 5)
+++ /OgreMain/include/OgreRenderWindow.h	(revision 5)
@@ -0,0 +1,213 @@
+/*-------------------------------------------------------------------------
+This source file is a part of OGRE
+(Object-oriented Graphics Rendering Engine)
+
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License (LGPL) as 
+published by the Free Software Foundation; either version 2.1 of the 
+License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful, but 
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
+or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License 
+along with this library; if not, write to the Free Software Foundation, 
+Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA or go to
+http://www.gnu.org/copyleft/lesser.txt
+-------------------------------------------------------------------------*/
+#ifndef __RenderWindow_H__
+#define __RenderWindow_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreRenderTarget.h"
+
+namespace Ogre
+{
+    /** Manages the target rendering window.
+        @remarks
+            This class handles a window into which the contents
+            of a scene are rendered. There is a many-to-1 relationship
+            between instances of this class an instance of RenderSystem
+            which controls the rendering of the scene. There may be
+            more than one window in the case of level editor tools etc.
+            This class is abstract since there may be
+            different implementations for different windowing systems.
+        @remarks
+            Instances are created and communicated with by the render system
+            although client programs can get a reference to it from
+            the render system if required for resizing or moving.
+            Note that you can have multiple viewpoints
+            in the window for effects like rear-view mirrors and
+            picture-in-picture views (see Viewport and Camera).
+        @author
+            Steven Streeting
+        @version
+            1.0
+    */
+    class _OgreExport RenderWindow : public RenderTarget
+    {
+
+    public:
+        /** Default constructor.
+        */
+        RenderWindow();
+
+        /** Creates & displays the new window.
+            @param
+                width The width of the window in pixels.
+            @param
+                height The height of the window in pixels.
+            @param
+                colourDepth The colour depth in bits. Ignored if
+                fullScreen is false since the desktop depth is used.
+            @param
+                fullScreen If true, the window fills the screen,
+                with no title bar or border.
+            @param
+                left The x-position of the window. Ignored if
+                fullScreen = true.
+            @param
+                top The y-position of the window. Ignored if
+                fullScreen = true.
+            @param
+                depthBuffer Specify true to include a depth-buffer.
+            @param
+                miscParam A variable number of pointers to platform-specific arguments. The
+                actual requirements must be defined by the implementing subclasses.
+        */
+		virtual void create(const String& name, unsigned int width, unsigned int height,
+	            bool fullScreen, const NameValuePairList *miscParams) = 0;
+
+		/** Alter fullscreen mode options. 
+		@note Nothing will happen unless the settings here are different from the
+			current settings.
+		@param fullScreen Whether to use fullscreen mode or not. 
+		@param width The new width to use
+		@param height The new height to use
+		*/
+		virtual void setFullscreen(bool fullScreen, unsigned int width, unsigned int height) {}
+        
+        /** Destroys the window.
+        */
+        virtual void destroy(void) = 0;
+
+        /** Alter the size of the window.
+        */
+        virtual void resize(unsigned int width, unsigned int height) = 0;
+
+	/** Notify that the window has been resized
+	@remarks
+		You don't need to call this unless you created the window externally.
+	*/
+	virtual void windowMovedOrResized() {}
+
+        /** Reposition the window.
+        */
+        virtual void reposition(int left, int top) = 0;
+
+        /** Indicates whether the window is visible (not minimized or obscured)
+        */
+        virtual bool isVisible(void) const { return true; }
+
+        /** Set the visibility state
+        */
+        virtual void setVisible(bool visible) {}
+
+        /** Overridden from RenderTarget, flags invisible windows as inactive
+        */
+        virtual bool isActive(void) const { return mActive && isVisible(); }
+
+        /** Indicates whether the window has been closed by the user.
+        */
+        virtual bool isClosed(void) const = 0;
+        
+        /** Indicates wether the window is the primary window. The
+        	primary window is special in that it is destroyed when 
+        	ogre is shut down, and cannot be destroyed directly.
+        	This is the case because it holds the context for vertex,
+        	index buffers and textures.
+        */
+        virtual bool isPrimary(void) const;
+
+        /** Swaps the frame buffers to display the next frame.
+            @remarks
+                All render windows are double-buffered so that no
+                'in-progress' versions of the scene are displayed
+                during rendering. Once rendering has completed (to
+                an off-screen version of the window) the buffers
+                are swapped to display the new frame.
+
+            @param
+                waitForVSync If true, the system waits for the
+                next vertical blank period (when the CRT beam turns off
+                as it travels from bottom-right to top-left at the
+                end of the pass) before flipping. If false, flipping
+                occurs no matter what the beam position. Waiting for
+                a vertical blank can be slower (and limits the
+                framerate to the monitor refresh rate) but results
+                in a steadier image with no 'tearing' (a flicker
+                resulting from flipping buffers when the beam is
+                in the progress of drawing the last frame).
+        */
+        virtual void swapBuffers(bool waitForVSync = true) = 0;
+
+		/// @copydoc RenderTarget::update
+        virtual void update(void);
+        /** Updates the window contents.
+            @remarks
+                The window is updated by telling each camera which is supposed
+                to render into this window to render it's view, and then
+                the window buffers are swapped via swapBuffers() if requested
+			@param swapBuffers If set to true, the window will immediately
+				swap it's buffers after update. Otherwise, the buffers are
+				not swapped, and you have to call swapBuffers yourself sometime
+				later. You might want to do this on some rendersystems which 
+				pause for queued rendering commands to complete before accepting
+				swap buffers calls - so you could do other CPU tasks whilst the 
+				queued commands complete. Or, you might do this if you want custom
+				control over your windows, such as for externally created windows.
+        */
+        virtual void update(bool swapBuffers);
+
+        /** Returns true if window is running in fullscreen mode.
+        */
+        virtual bool isFullScreen(void) const;
+
+        /** Overloaded version of getMetrics from RenderTarget, including extra details
+            specific to windowing systems.
+        */
+        virtual void getMetrics(unsigned int& width, unsigned int& height, unsigned int& colourDepth, 
+			int& left, int& top);
+
+    protected:
+        bool mIsFullScreen;
+        bool mIsPrimary;
+        int mLeft;
+        int mTop;
+        
+        /** Indicates that this is the primary window. Only to be called by
+            Ogre::Root
+        */
+        void _setPrimary() { mIsPrimary = true; }
+        
+        friend class Root;
+    };
+
+    /** Defines the interface a DLL implemeting a platform-specific version must implement.
+        @remarks
+            Any library (.dll, .so) wishing to implement a platform-specific version of this
+            dialog must export the symbol 'createRenderWindow' with the signature
+            void createPlatformRenderWindow(RenderWindow** ppDlg)
+    */
+    typedef void (*DLL_CREATERENDERWINDOW)(RenderWindow** ppWindow);
+
+} // Namespace
+#endif
Index: /OgreMain/include/OgreRenderable.h
===================================================================
--- /OgreMain/include/OgreRenderable.h	(revision 5)
+++ /OgreMain/include/OgreRenderable.h	(revision 5)
@@ -0,0 +1,296 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Renderable_H__
+#define __Renderable_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreCommon.h"
+
+#include "OgreRenderOperation.h"
+#include "OgreMatrix4.h"
+#include "OgreMaterial.h"
+#include "OgrePlane.h"
+#include "OgreGpuProgram.h"
+#include "OgreVector4.h"
+#include "OgreException.h"
+
+namespace Ogre {
+
+    /** Abstract class defining the interface all renderable objects must implement.
+        @remarks
+            This interface abstracts renderable discrete objects which will be queued in the render pipeline,
+            grouped by material. Classes implementing this interface must be based on a single material, a single
+            world matrix (or a collection of world matrices which are blended by weights), and must be 
+            renderable via a single render operation.
+        @par
+            Note that deciding whether to put these objects in the rendering pipeline is done from the more specific
+            classes e.g. entities. Only once it is decided that the specific class is to be rendered is the abstract version
+            created (could be more than one per visible object) and pushed onto the rendering queue.
+    */
+    class _OgreExport Renderable
+    {
+    public:
+		Renderable() : mPolygonModeOverrideable(true), mUseIdentityProjection(false), mUseIdentityView(false) {}
+        /** Virtual destructor needed as class has virtual methods. */
+        virtual ~Renderable() { }
+        /** Retrieves a weak reference to the material this renderable object uses.
+        @remarks
+            Note that the Renderable also has the option to override the getTechnique method
+            to specify a particular Technique to use instead of the best one available.
+        */
+        virtual const MaterialPtr& getMaterial(void) const = 0;
+        /** Retrieves a pointer to the Material Technique this renderable object uses.
+        @remarks
+            This is to allow Renderables to use a chosen Technique if they wish, otherwise
+            they will use the best Technique available for the Material they are using.
+        */
+        virtual Technique* getTechnique(void) const { return getMaterial()->getBestTechnique(); }
+        /** Gets the render operation required to send this object to the frame buffer.
+        */
+        virtual void getRenderOperation(RenderOperation& op) = 0;
+        /** Gets the world transform matrix / matrices for this renderable object.
+            @remarks
+                If the object has any derived transforms, these are expected to be up to date as long as
+                all the SceneNode structures have been updated before this is called.
+            @par
+                This method will populate xform with 1 matrix if it does not use vertex blending. If it
+                does use vertex blending it will fill the passed in pointer with an array of matrices,
+                the length being the value returned from getNumWorldTransforms.
+            @note
+                Internal Ogre never supports non-affine matrix for world transform matrix/matrices,
+                the behavior is undefined if returns non-affine matrix here. @see Matrix4::isAffine.
+        */
+        virtual void getWorldTransforms(Matrix4* xform) const = 0;
+        /** Gets the worldspace orientation of this renderable; this is used in order to
+            more efficiently update parameters to vertex & fragment programs, since inverting Quaterion
+            and Vector in order to derive object-space positions / directions for cameras and
+            lights is much more efficient than inverting a complete 4x4 matrix, and also 
+            eliminates problems introduced by scaling. */
+        virtual const Quaternion& getWorldOrientation(void) const = 0;
+        /** Gets the worldspace position of this renderable; this is used in order to
+            more efficiently update parameters to vertex & fragment programs, since inverting Quaterion
+            and Vector in order to derive object-space positions / directions for cameras and
+            lights is much more efficient than inverting a complete 4x4 matrix, and also 
+            eliminates problems introduced by scaling. */
+        virtual const Vector3& getWorldPosition(void) const = 0;
+
+        /** Returns the number of world transform matrices this renderable requires.
+        @remarks
+            When a renderable uses vertex blending, it uses multiple world matrices instead of a single
+            one. Each vertex sent to the pipeline can reference one or more matrices in this list
+            with given weights.
+            If a renderable does not use vertex blending this method returns 1, which is the default for 
+            simplicity.
+        */
+        virtual unsigned short getNumWorldTransforms(void) const { return 1; }
+
+        /** Sets whether or not to use an 'identity' projection.
+        @remarks
+            Usually Renderable objects will use a projection matrix as determined
+            by the active camera. However, if they want they can cancel this out
+            and use an identity projection, which effectively projects in 2D using
+            a {-1, 1} view space. Useful for overlay rendering. Normal renderables
+            need not change this. The default is false.
+        @see Renderable::getUseIdentityProjection
+        */
+        void setUseIdentityProjection(bool useIdentityProjection)
+        {
+            mUseIdentityProjection = useIdentityProjection;
+        }
+
+        /** Returns whether or not to use an 'identity' projection.
+        @remarks
+            Usually Renderable objects will use a projection matrix as determined
+            by the active camera. However, if they want they can cancel this out
+            and use an identity projection, which effectively projects in 2D using
+            a {-1, 1} view space. Useful for overlay rendering. Normal renderables
+            need not change this.
+        @see Renderable::setUseIdentityProjection
+        */
+        bool getUseIdentityProjection(void) const { return mUseIdentityProjection; }
+
+        /** Sets whether or not to use an 'identity' view.
+        @remarks
+            Usually Renderable objects will use a view matrix as determined
+            by the active camera. However, if they want they can cancel this out
+            and use an identity matrix, which means all geometry is assumed
+            to be relative to camera space already. Useful for overlay rendering. 
+            Normal renderables need not change this. The default is false.
+        @see Renderable::getUseIdentityView
+        */
+        void setUseIdentityView(bool useIdentityView)
+        {
+            mUseIdentityView = useIdentityView;
+        }
+
+        /** Returns whether or not to use an 'identity' view.
+        @remarks
+            Usually Renderable objects will use a view matrix as determined
+            by the active camera. However, if they want they can cancel this out
+            and use an identity matrix, which means all geometry is assumed
+            to be relative to camera space already. Useful for overlay rendering. 
+            Normal renderables need not change this.
+        @see Renderable::setUseIdentityView
+        */
+        bool getUseIdentityView(void) const { return mUseIdentityView; }
+
+		/** Returns the camera-relative squared depth of this renderable.
+		@remarks
+			Used to sort transparent objects. Squared depth is used rather than
+			actual depth to avoid having to perform a square root on the result.
+		*/
+		virtual Real getSquaredViewDepth(const Camera* cam) const = 0;
+
+        /** Returns whether or not this Renderable wishes the hardware to normalise normals. */
+        virtual bool getNormaliseNormals(void) const { return false; }
+
+        /** Gets a list of lights, ordered relative to how close they are to this renderable.
+        @remarks
+            Directional lights, which have no position, will always be first on this list.
+        */
+        virtual const LightList& getLights(void) const = 0;
+
+        virtual const PlaneList& getClipPlanes() const { return msDummyPlaneList; };
+
+        /** Method which reports whether this renderable would normally cast a
+            shadow. 
+        @remarks
+            Subclasses should override this if they could have been used to 
+            generate a shadow.
+        */
+        virtual bool getCastsShadows(void) const { return false; }
+
+        /** Sets a custom parameter for this Renderable, which may be used to 
+            drive calculations for this specific Renderable, like GPU program parameters.
+        @remarks
+            Calling this method simply associates a numeric index with a 4-dimensional
+            value for this specific Renderable. This is most useful if the material
+            which this Renderable uses a vertex or fragment program, and has an 
+            ACT_CUSTOM parameter entry. This parameter entry can refer to the
+            index you specify as part of this call, thereby mapping a custom
+            parameter for this renderable to a program parameter.
+        @param index The index with which to associate the value. Note that this
+            does not have to start at 0, and can include gaps. It also has no direct
+            correlation with a GPU program parameter index - the mapping between the
+            two is performed by the ACT_CUSTOM entry, if that is used.
+        @param value The value to associate.
+        */
+        void setCustomParameter(size_t index, const Vector4& value) 
+        {
+            mCustomParameters[index] = value;
+        }
+
+        /** Gets the custom value associated with this Renderable at the given index.
+        @param
+            @see setCustomParaemter for full details.
+        */
+        const Vector4& getCustomParameter(size_t index) const
+        {
+            CustomParameterMap::const_iterator i = mCustomParameters.find(index);
+            if (i != mCustomParameters.end())
+            {
+                return i->second;
+            }
+            else
+            {
+                OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                    "Parameter at the given index was not found.",
+                    "Renderable::getCustomParameter");
+            }
+        }
+
+        /** Update a custom GpuProgramParameters constant which is derived from 
+            information only this Renderable knows.
+        @remarks
+            This method allows a Renderable to map in a custom GPU program parameter
+            based on it's own data. This is represented by a GPU auto parameter
+            of ACT_CUSTOM, and to allow there to be more than one of these per
+            Renderable, the 'data' field on the auto parameter will identify
+            which parameter is being updated. The implementation of this method
+            must identify the parameter being updated, and call a 'setConstant' 
+            method on the passed in GpuProgramParameters object, using the details
+            provided in the incoming auto constant setting to identify the index
+            at which to set the parameter.
+        @par
+            You do not need to override this method if you're using the standard
+            sets of data associated with the Renderable as provided by setCustomParameter
+            and getCustomParameter. By default, the implementation will map from the
+            value indexed by the 'constantEntry.data' parameter to a value previously
+            set by setCustomParameter. But custom Renderables are free to override
+            this if they want, in any case.
+        @param constantEntry The auto constant entry referring to the parameter
+            being updated
+        @param params The parameters object which this method should call to 
+            set the updated parameters.
+        */
+        virtual void _updateCustomGpuParameter(
+            const GpuProgramParameters::AutoConstantEntry& constantEntry,
+            GpuProgramParameters* params) const
+        {
+            CustomParameterMap::const_iterator i = mCustomParameters.find(constantEntry.data);
+            if (i != mCustomParameters.end())
+            {
+                params->_writeRawConstant(constantEntry.physicalIndex, i->second, 
+					constantEntry.elementCount);
+            }
+        }
+
+		/** Sets whether this renderable's chosen detail level can be
+			overridden (downgraded) by the camera setting. 
+		@param override true means that a lower camera detail will override this
+			renderables detail level, false means it won't.
+		*/
+		virtual void setPolygonModeOverrideable(bool override)
+		{
+			mPolygonModeOverrideable = override;
+		}
+
+		/** Gets whether this renderable's chosen detail level can be
+			overridden (downgraded) by the camera setting. 
+		*/
+		virtual bool getPolygonModeOverrideable(void) const
+		{
+			return mPolygonModeOverrideable;
+		}
+
+
+    protected:
+        static const PlaneList msDummyPlaneList;
+        typedef std::map<size_t, Vector4> CustomParameterMap;
+        CustomParameterMap mCustomParameters;
+		bool mPolygonModeOverrideable;
+        bool mUseIdentityProjection;
+        bool mUseIdentityView;
+    };
+
+
+
+}
+
+#endif //__Renderable_H__
Index: /OgreMain/include/OgreResource.h
===================================================================
--- /OgreMain/include/OgreResource.h	(revision 5)
+++ /OgreMain/include/OgreResource.h	(revision 5)
@@ -0,0 +1,415 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _Resource_H__
+#define _Resource_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include "OgreSharedPtr.h"
+#include "OgreStringInterface.h"
+
+namespace Ogre {
+
+    typedef unsigned long ResourceHandle;
+
+
+	// Forward declaration
+	class ManualResourceLoader;
+
+	/** Abstract class reprensenting a loadable resource (e.g. textures, sounds etc)
+        @remarks
+            Resources are data objects that must be loaded and managed throughout
+			an application. A resource might be a mesh, a texture, or any other
+			piece of data - the key thing is that they must be identified by 
+			a name which is unique, must be loaded only once,
+			must be managed efficiently in terms of retrieval, and they may
+			also be unloadable to free memory up when they have not been used for
+			a while and the memory budget is under stress.
+		@par
+			All Resource instances must be a member of a resource group; see
+			ResourceGroupManager for full details.
+        @par
+            Subclasses must implement:
+			<ol>
+			<li>A constructor, overriding the same parameters as the constructor
+			    defined by this class. Subclasses are not allowed to define
+				constructors with other parameters; other settings must be
+				settable through accessor methods before loading.</li>
+            <li>The loadImpl() and unloadImpl() methods - mSize must be set 
+				after loadImpl()</li>
+			<li>StringInterface ParamCommand and ParamDictionary setups
+			    in order to allow setting of core parameters (prior to load)
+				through a generic interface.</li>
+			</ol>
+    */
+	class _OgreExport Resource : public StringInterface
+    {
+	public:
+		OGRE_AUTO_MUTEX // public to allow external locking
+		class Listener
+		{
+		public:
+		   	Listener() {}
+			virtual ~Listener() {}
+
+			/** Callback to indicate that background loading has completed.
+			@remarks
+				This callback is only relevant when a Resource has been
+				marked as background loaded (@see Resource::setBackgroundLoaded)
+				, and occurs when that loading has completed. The call itself
+				does not itself occur in the thread which is doing the loading;
+				when loading is complete a response indicator is placed with the
+				ResourceGroupManager, which will then be sent back to the 
+				listener as part of the application's primary frame loop thread.
+			*/
+			virtual void backgroundLoadingComplete(Resource*) {}
+			
+		};
+		
+		/// Enum identifying the loading state of the resource
+		enum LoadingState
+		{
+			/// Not loaded
+			LOADSTATE_UNLOADED,
+			/// Loading is in progress
+			LOADSTATE_LOADING,
+			/// Fully loaded
+			LOADSTATE_LOADED,
+			/// Currently unloading
+			LOADSTATE_UNLOADING
+		};
+    protected:
+		/// Creator
+		ResourceManager* mCreator;
+		/// Unique name of the resource
+        String mName;
+		/// The name of the resource group
+		String mGroup;
+		/// Numeric handle for more efficient look up than name
+        ResourceHandle mHandle;
+		/// Is the resource currently loaded?
+        volatile LoadingState mLoadingState;
+		/// Is this resource going to be background loaded? Only applicable for multithreaded
+		volatile bool mIsBackgroundLoaded;
+		/// Mutex to cover the status of loading
+		OGRE_MUTEX(mLoadingStatusMutex)
+		/// The size of the resource in bytes
+        size_t mSize;
+		/// Is this file manually loaded?
+		bool mIsManual;
+		/// Origin of this resource (e.g. script name) - optional
+		String mOrigin;
+		/// Optional manual loader; if provided, data is loaded from here instead of a file
+		ManualResourceLoader* mLoader;
+
+		typedef std::list<Listener*> ListenerList;
+		ListenerList mListenerList;
+
+		/** Protected unnamed constructor to prevent default construction. 
+		*/
+		Resource() 
+			: mCreator(0), mHandle(0), mLoadingState(LOADSTATE_UNLOADED), 
+			mIsBackgroundLoaded(false),	mSize(0), mIsManual(0), mLoader(0)
+		{ 
+		}
+
+		/** Internal hook to perform actions before the load process, but
+			after the resource has been marked as 'loading'.
+		@note Mutex will have already been acquired by the loading thread.
+			Also, this call will occur even when using a ManualResourceLoader 
+			(when loadImpl is not actually called)
+		*/
+		virtual void preLoadImpl(void) {}
+		/** Internal hook to perform actions after the load process, but
+			before the resource has been marked as fully loaded.
+		@note Mutex will have already been acquired by the loading thread.
+			Also, this call will occur even when using a ManualResourceLoader 
+			(when loadImpl is not actually called)
+		*/
+		virtual void postLoadImpl(void) {}
+
+		/** Internal hook to perform actions before the unload process.
+		@note Mutex will have already been acquired by the unloading thread.
+		*/
+		virtual void preUnloadImpl(void) {}
+		/** Internal hook to perform actions after the unload process, but
+		before the resource has been marked as fully unloaded.
+		@note Mutex will have already been acquired by the unloading thread.
+		*/
+		virtual void postUnloadImpl(void) {}
+
+		/** Internal implementation of the meat of the 'load' action, only called if this 
+			resource is not being loaded from a ManualResourceLoader. 
+		*/
+		virtual void loadImpl(void) = 0;
+		/** Internal implementation of the 'unload' action; called regardless of
+			whether this resource is being loaded from a ManualResourceLoader. 
+		*/
+		virtual void unloadImpl(void) = 0;
+		/** Calculate the size of a resource; this will only be called after 'load' */
+		virtual size_t calculateSize(void) const = 0;
+
+		/// Queue the firing of background loading complete event
+		virtual void queueFireBackgroundLoadingComplete(void);
+
+    public:
+		/** Standard constructor.
+		@param creator Pointer to the ResourceManager that is creating this resource
+		@param name The unique name of the resource
+		@param group The name of the resource group to which this resource belongs
+		@param isManual Is this resource manually loaded? If so, you should really
+			populate the loader parameter in order that the load process
+			can call the loader back when loading is required. 
+		@param loader Pointer to a ManualResourceLoader implementation which will be called
+			when the Resource wishes to load (should be supplied if you set
+			isManual to true). You can in fact leave this parameter null 
+			if you wish, but the Resource will never be able to reload if 
+			anything ever causes it to unload. Therefore provision of a proper
+			ManualResourceLoader instance is strongly recommended.
+		*/
+		Resource(ResourceManager* creator, const String& name, ResourceHandle handle,
+			const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
+
+        /** Virtual destructor. Shouldn't need to be overloaded, as the resource
+            deallocation code should reside in unload()
+            @see
+                Resource::unload()
+        */
+        virtual ~Resource();
+
+        /** Loads the resource, if it is not already.
+		@remarks
+			If the resource is loaded from a file, loading is automatic. If not,
+			if for example this resource gained it's data from procedural calls
+			rather than loading from a file, then this resource will not reload 
+			on it's own.
+		@param backgroundThread Indicates whether the caller of this method is
+			the background resource loading thread. 
+			
+        */
+        virtual void load(bool backgroundThread = false);
+
+		/** Reloads the resource, if it is already loaded.
+		@remarks
+			Calls unload() and then load() again, if the resource is already
+			loaded. If it is not loaded already, then nothing happens.
+		*/
+		virtual void reload(void);
+
+        /** Returns true if the Resource is reloadable, false otherwise.
+        */
+        bool isReloadable(void) const
+        {
+            return !mIsManual || mLoader;
+        }
+
+        /** Is this resource manually loaded?
+		*/
+		bool isManuallyLoaded(void) const
+		{
+			return mIsManual;
+		}
+
+		/** Unloads the resource; this is not permanent, the resource can be
+			reloaded later if required.
+        */
+		virtual void unload(void);
+
+        /** Retrieves info about the size of the resource.
+        */
+        size_t getSize(void) const
+        { 
+            return mSize; 
+        }
+
+        /** 'Touches' the resource to indicate it has been used.
+        */
+        virtual void touch(void);
+
+        /** Gets resource name.
+        */
+        const String& getName(void) const 
+        { 
+            return mName; 
+        }
+
+        ResourceHandle getHandle(void) const
+        {
+            return mHandle;
+        }
+
+        /** Returns true if the Resource has been loaded, false otherwise.
+        */
+        bool isLoaded(void) const 
+        { 
+			// No lock required to read this state since no modify
+            return (mLoadingState == LOADSTATE_LOADED); 
+        }
+
+		/** Returns whether the resource is currently in the process of
+			background loading.
+		*/
+		LoadingState isLoading() const
+		{
+			return mLoadingState;
+		}
+
+		/** Returns the current loading state.
+		*/
+		LoadingState getLoadingState() const
+		{
+			return mLoadingState;
+		}
+
+
+
+		/** Returns whether this Resource has been earmarked for background loading.
+		@remarks
+			This option only makes sense when you have built Ogre with 
+			thread support (OGRE_THREAD_SUPPORT). If a resource has been marked
+			for background loading, then it won't load on demand like normal
+			when load() is called. Instead, it will ignore request to load()
+			except if the caller indicates it is the background loader. Any
+			other users of this resource should check isLoaded(), and if that
+			returns false, don't use the resource and come back later.
+		*/
+		bool isBackgroundLoaded(void) const { return mIsBackgroundLoaded; }
+
+		/** Tells the resource whether it is background loaded or not.
+		@remarks
+			@see Resource::isBackgroundLoaded . Note that calling this only
+			defers the normal on-demand loading behaviour of a resource, it
+			does not actually set up a thread to make sure the resource gets
+			loaded in the background. You should use ResourceBackgroundLoadingQueue
+			to manage the actual loading (which will call this method itself).
+		*/
+		void setBackgroundLoaded(bool bl) { mIsBackgroundLoaded = bl; }
+
+		/** Escalates the loading of a background loaded resource. 
+		@remarks
+			If a resource is set to load in the background, but something needs
+			it before it's been loaded, there could be a problem. If the user
+			of this resource really can't wait, they can escalate the loading
+			which basically pulls the loading into the current thread immediately.
+			If the resource is already being loaded but just hasn't quite finished
+			then this method will simply wait until the background load is complete.
+		*/
+		void escalateLoading();
+
+		/** Register a listener on this resource.
+			@see Resource::Listener
+		*/
+		void addListener(Listener* lis);
+
+		/** Remove a listener on this resource.
+			@see Resource::Listener
+		*/
+		void removeListener(Listener* lis);
+
+		/// Gets the group which this resource is a member of
+		const String& getGroup(void) { return mGroup; }
+
+		/** Change the resource group ownership of a Resource.
+		@remarks
+			This method is generally reserved for internal use, although
+			if you really know what you're doing you can use it to move
+			this resource from one group to another.
+		@param newGroup Name of the new group
+		*/
+		void changeGroupOwnership(const String& newGroup);
+
+		/// Gets the manager which created this resource
+		ResourceManager* getCreator(void) { return mCreator; }
+		/** Get the origin of this resource, e.g. a script file name.
+		@remarks
+			This property will only contain something if the creator of
+			this resource chose to populate it. Script loaders are advised
+			to populate it.
+		*/
+		const String& getOrigin(void) const { return mOrigin; }
+		/// Notify this resource of it's origin
+		void _notifyOrigin(const String& origin) { mOrigin = origin; }
+
+    };
+
+	/** Shared pointer to a Resource.
+	@remarks
+		This shared pointer allows many references to a resource to be held, and
+		when the final reference is removed, the resource will be destroyed. 
+		Note that the ResourceManager which created this Resource will be holding
+		at least one reference, so this resource will not get destroyed until 
+		someone removes the resource from the manager - this at least gives you
+		strong control over when resources are freed. But the nature of the 
+		shared pointer means that if anyone refers to the removed resource in the
+		meantime, the resource will remain valid.
+	@par
+		You may well see references to ResourcePtr (i.e. ResourcePtr&) being passed 
+		around internally within Ogre. These are 'weak references' ie they do 
+		not increment the reference count on the Resource. This is done for 
+		efficiency in temporary operations that shouldn't need to incur the 
+		overhead of maintaining the reference count; however we don't recommend 
+		you do it yourself since these references are not guaranteed to remain valid.
+	*/
+	typedef SharedPtr<Resource> ResourcePtr;
+
+	/** Interface describing a manual resource loader.
+	@remarks
+		Resources are usually loaded from files; however in some cases you
+		want to be able to set the data up manually instead. This provides
+		some problems, such as how to reload a Resource if it becomes
+		unloaded for some reason, either because of memory constraints, or
+		because a device fails and some or all of the data is lost.
+	@par
+		This interface should be implemented by all classes which wish to
+		provide manual data to a resource. They provide a pointer to themselves
+		when defining the resource (via the appropriate ResourceManager), 
+		and will be called when the Resource tries to load. 
+		They should implement the loadResource method such that the Resource 
+		is in the end set up exactly as if it had loaded from a file, 
+		although the implementations will likely differ	between subclasses 
+		of Resource, which is why no generic algorithm can be stated here. 
+	@note
+		The loader must remain valid for the entire life of the resource,
+		so that if need be it can be called upon to re-load the resource
+		at any time.
+	*/
+	class _OgreExport ManualResourceLoader
+	{
+	public:
+		ManualResourceLoader() {}
+		virtual ~ManualResourceLoader() {}
+
+		/** Called when a resource wishes to load.
+		@param resource The resource which wishes to load
+		*/
+		virtual void loadResource(Resource* resource) = 0;
+	};
+}
+
+#endif
Index: /OgreMain/include/OgreResourceBackgroundQueue.h
===================================================================
--- /OgreMain/include/OgreResourceBackgroundQueue.h	(revision 5)
+++ /OgreMain/include/OgreResourceBackgroundQueue.h	(revision 5)
@@ -0,0 +1,456 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ResourceBackgroundQueue_H__
+#define __ResourceBackgroundQueue_H__
+
+
+#include "OgrePrerequisites.h"
+#include "OgreCommon.h"
+#include "OgreSingleton.h"
+#include "OgreResource.h"
+
+#if OGRE_THREAD_SUPPORT
+#	include <boost/thread/thread.hpp>
+#	include <boost/thread/condition.hpp>
+#endif
+
+namespace Ogre {
+
+	/// Identifier of a background process
+	typedef unsigned long BackgroundProcessTicket;
+	
+	/** This class is used to perform Resource operations in a
+		background thread. 
+	@remarks
+		If threading is enabled, Ogre will create a single background thread
+		which can be used to load / unload resources in parallel. Only one
+		resource will be processed at once in this background thread, but it
+		will be in parallel with the main thread. 
+	@par
+		The general approach here is that on requesting a background resource
+		process, your request is placed on a queue ready for the background
+		thread to be picked up, and you will get a 'ticket' back, identifying
+		the request. Your call will then return and your thread can
+		proceed, knowing that at some point in the background the operation wil 
+		be performed. In it's own thread, the resource operation will be 
+		performed, and once finished the ticket will be marked as complete. 
+		You can check the status of tickets by calling isProcessComplete() 
+		from your queueing thread. It is also possible to get immediate 
+		callbacks on completion, but these callbacks happen in the background 
+		loading thread (not your calling thread), so should only be used if you
+		really understand multithreading. 
+	@par
+		By default, when threading is enabled this class will start its own 
+		separate thread to perform the actual loading. However, if you would 
+		prefer to use your own existing thread to perform the background load,
+		then be sure to call setStartBackgroundThread(false) before initialise() is
+		called by Root::initialise. Your own thread should call _initThread
+		immediately on startup, before any resources are loaded at all, and
+		_doNextQueuedBackgroundProcess to process background requests.
+	@note
+		This class will only perform tasks in a background thread if 
+		OGRE_THREAD_SUPPORT is defined to be 1. Otherwise, all methods will
+		call their exact equivalents in ResourceGroupManager synchronously. 
+	*/
+	class _OgreExport ResourceBackgroundQueue : public Singleton<ResourceBackgroundQueue>
+	{
+	public:
+		/** This abstract listener interface lets you get notifications of
+		completed background processes instead of having to poll ticket 
+		statuses.
+		@note
+		For simplicity, these callbacks are not issued direct from the background
+		loading thread, they are queued themselves to be sent from the main thread
+		so that you don't have to be concerned about thread safety. 
+		*/
+		class _OgreExport Listener
+		{
+		public:
+			/** Called when a requested operation completes, queued into main thread. 
+			@note
+				For simplicity, this callback is not issued direct from the background
+				loading thread, it is queued to be sent from the main thread
+				so that you don't have to be concerned about thread safety. 
+			*/
+			virtual void operationCompleted(BackgroundProcessTicket ticket) = 0;
+			/** Called when a requested operation completes, immediate in background thread. 
+			@note
+				This is the advanced version of the background operation notification,
+				it happens immediately when the background operation is completed, and
+				your callback is executed in the <b>background thread</b>. Therefore if 
+				you use this version, you have to be aware of thread safety issues
+				and what you can and cannot do in your callback implementation.
+			*/
+			virtual void operationCompletedInThread(BackgroundProcessTicket ticket) {}
+			/// Need virtual destructor in case subclasses use it
+			virtual ~Listener() {}
+
+		};
+		/// Init notification mutex (must lock before waiting on initCondition)
+		OGRE_MUTEX(initMutex)
+		/// Synchroniser token to wait / notify on thread init (public incase external thread)
+		OGRE_THREAD_SYNCHRONISER(initSync);
+
+	protected:
+		/** Enumerates the type of requests */
+		enum RequestType
+		{
+			RT_INITIALISE_GROUP,
+			RT_INITIALISE_ALL_GROUPS,
+			RT_LOAD_GROUP,
+			RT_LOAD_RESOURCE,
+			RT_UNLOAD_GROUP,
+			RT_UNLOAD_RESOURCE,
+			RT_SHUTDOWN
+		};
+		/** Encapsulates a queued request for the background queue */
+		struct Request
+		{
+			BackgroundProcessTicket ticketID;
+			RequestType type;
+			String resourceName;
+			ResourceHandle resourceHandle;
+			String resourceType;
+			String groupName;
+			bool isManual; 
+			ManualResourceLoader* loader;
+			const NameValuePairList* loadParams;
+			Listener* listener;
+		};
+		typedef std::list<Request> RequestQueue;
+		typedef std::map<BackgroundProcessTicket, Request*> RequestTicketMap;
+		
+		/// Queue of requests, used to store and order requests
+		RequestQueue mRequestQueue;
+		
+		/// Request lookup by ticket
+		RequestTicketMap mRequestTicketMap;
+
+		/// Next ticket ID
+		unsigned long mNextTicketID;
+
+		/// Struct that holds details of queued notifications
+		struct QueuedNotification
+		{
+			QueuedNotification(Resource::Listener* l, Resource* r)
+				: resourceListener(l), resource(r), opListener(0), ticket(0)
+			{}
+
+			QueuedNotification(Listener* l, BackgroundProcessTicket t)
+				: resourceListener(0), resource(0), opListener(l), ticket(t)  
+			{}
+
+			// Type 1 - Resource::Listener kind
+			Resource::Listener* resourceListener;
+			Resource* resource;
+			// Type 2 - ResourceBackgroundQueue::Listener kind
+			Listener* opListener;
+			BackgroundProcessTicket ticket;
+		};
+		typedef std::list<QueuedNotification> NotificationQueue;
+		/// Queued notifications of background loading being finished
+		NotificationQueue mNotificationQueue;
+		/// Mutex to protect the background event queue]
+		OGRE_MUTEX(mNotificationQueueMutex)
+
+		/// Whether this class should start it's own thread or not
+		bool mStartThread;
+
+#if OGRE_THREAD_SUPPORT
+		/// The single background thread which will process loading requests
+		boost::thread* mThread;
+		/// Synchroniser token to wait / notify on queue
+		boost::condition mCondition;
+		/// Thread function
+		static void threadFunc(void);
+		/// Internal method for adding a request; also assigns a ticketID
+		BackgroundProcessTicket addRequest(Request& req);
+		/// Thread shutdown?
+		bool mShuttingDown;
+#else
+		/// Dummy
+		void* mThread;
+#endif
+
+		/// Private mutex, not allowed to lock from outside
+		OGRE_AUTO_MUTEX
+
+		/** Queue the firing of the 'background loading complete' event to
+			a Resource::Listener event.
+		@remarks
+			The purpose of this is to allow the background loading thread to 
+			call this method to queue the notification to listeners waiting on
+			the background loading of a resource. Rather than allow the resource
+			background loading thread to directly call these listeners, which 
+			would require all the listeners to be thread-safe, this method
+			implements a thread-safe queue which can be processed in the main
+			frame loop thread each frame to clear the events in a simpler 
+			manner.
+		@param listener The listener to be notified
+		@param ticket The ticket for the operation that has completed
+		*/
+		virtual void queueFireBackgroundOperationComplete(Listener* listener,
+			BackgroundProcessTicket ticket);
+
+	public:
+		ResourceBackgroundQueue();
+		virtual ~ResourceBackgroundQueue();
+
+		/** Sets whether or not a thread should be created and started to handle
+			the background loading, or whether a user thread will call the 
+			appropriate hooks.
+		@remarks
+			By default, a new thread will be started to handle the background 
+			load requests. However, the application may well have some threads
+			of its own which is wishes to use to perform the background loading
+			as well as other tasks (for example on most platforms there will be
+			a fixed number of hardware threads which the application will wish
+			to work within). Use this method to turn off the creation of a separate
+			thread if you wish, and call the _doNextQueuedBackgroundProcess
+			method from your own thread to process background requests.
+		@note
+			You <b>must</b> call this method prior to initialisation. Initialisation
+			of this class is automatically done when Root::initialise is called.
+		*/
+		void setStartBackgroundThread(bool startThread) { mStartThread = startThread; }
+
+		/** Gets whether or not a thread should be created and started to handle
+			the background loading, or whether a user thread will call the 
+			appropriate hooks.
+		*/
+		bool getStartBackgroundThread(void) { return mStartThread; }
+		/** Initialise the background queue system. 
+		@note Called automatically by Root::initialise.
+		*/
+		virtual void initialise(void);
+		
+		/** Shut down the background queue system. 
+		@note Called automatically by Root::shutdown.
+		*/
+		virtual void shutdown(void);
+
+		/** Initialise a resource group in the background.
+		@see ResourceGroupManager::initialiseResourceGroup
+		@param name The name of the resource group to initialise
+		@param listener Optional callback interface, take note of warnings in 
+			the header and only use if you understand them.
+		@returns Ticket identifying the request, use isProcessComplete() to 
+			determine if completed if not using listener
+		*/
+		virtual BackgroundProcessTicket initialiseResourceGroup(
+			const String& name, Listener* listener = 0);
+
+		/** Initialise all resource groups which are yet to be initialised in 
+			the background.
+		@see ResourceGroupManager::intialiseResourceGroup
+		@param listener Optional callback interface, take note of warnings in 
+			the header and only use if you understand them.
+		@returns Ticket identifying the request, use isProcessComplete() to 
+			determine if completed if not using listener
+		*/
+		virtual BackgroundProcessTicket initialiseAllResourceGroups( 
+			Listener* listener = 0);
+		/** Loads a resource group in the background.
+		@see ResourceGroupManager::loadResourceGroup
+		@param name The name of the resource group to load
+		@param listener Optional callback interface, take note of warnings in 
+			the header and only use if you understand them.
+		@returns Ticket identifying the request, use isProcessComplete() to 
+			determine if completed if not using listener
+		*/
+		virtual BackgroundProcessTicket loadResourceGroup(const String& name, 
+			Listener* listener = 0);
+
+
+		/** Unload a single resource in the background. 
+		@see ResourceManager::unload
+		@param resType The type of the resource 
+			(from ResourceManager::getResourceType())
+		@param name The name of the Resource
+		*/
+		virtual BackgroundProcessTicket unload(
+			const String& resType, const String& name, 
+			Listener* listener = 0);
+
+		/** Unload a single resource in the background. 
+		@see ResourceManager::unload
+		@param resType The type of the resource 
+			(from ResourceManager::getResourceType())
+		@param handle Handle to the resource 
+		*/
+		virtual BackgroundProcessTicket unload(
+			const String& resType, ResourceHandle handle, 
+			Listener* listener = 0);
+
+		/** Unloads a resource group in the background.
+		@see ResourceGroupManager::unloadResourceGroup
+		@param name The name of the resource group to load
+		@returns Ticket identifying the request, use isProcessComplete() to 
+			determine if completed if not using listener
+		*/
+		virtual BackgroundProcessTicket unloadResourceGroup(const String& name, 
+			Listener* listener = 0);
+
+
+		/** Load a single resource in the background. 
+		@see ResourceManager::load
+		@param resType The type of the resource 
+			(from ResourceManager::getResourceType())
+		@param name The name of the Resource
+		@param group The resource group to which this resource will belong
+		@param isManual Is the resource to be manually loaded? If so, you should
+			provide a value for the loader parameter
+		@param loader The manual loader which is to perform the required actions
+			when this resource is loaded; only applicable when you specify true
+			for the previous parameter. NOTE: must be thread safe!!
+        @param loadParams Optional pointer to a list of name/value pairs 
+            containing loading parameters for this type of resource. Remember 
+			that this must have a lifespan longer than the return of this call!
+		*/
+		virtual BackgroundProcessTicket load(
+			const String& resType, const String& name, 
+            const String& group, bool isManual = false, 
+			ManualResourceLoader* loader = 0, 
+			const NameValuePairList* loadParams = 0, 
+			Listener* listener = 0);
+		/** Returns whether a previously queued process has completed or not. 
+		@remarks
+			This method of checking that a background process has completed is
+			the 'polling' approach. Each queued method takes an optional listener
+			parameter to allow you to register a callback instead, which is
+			arguably more efficient.
+		@param ticket The ticket which was returned when the process was queued
+		@returns true if process has completed (or if the ticket is 
+			unrecognised), false otherwise
+		@note Tickets are not stored onced complete so do not accumulate over 
+			time.
+		This is why a non-existent ticket will return 'true'.
+		*/
+		virtual bool isProcessComplete(BackgroundProcessTicket ticket);
+
+		/** Process a single queued background operation. 
+		@remarks
+			If you are using your own thread to perform background loading, calling
+			this method from that thread triggers the processing of a single
+			background loading request from the queue. This method will not 
+			return until the request has been fully processed. It also returns
+			whether it did in fact process anything - if it returned false, there
+			was nothing more in the queue.
+		@note
+			<b>Do not</b> call this method unless you are using your own thread
+			to perform the background loading and called setStartBackgroundThread(false).
+			You must only have one background loading thread.
+		@returns true if a request was processed, false if the queue was empty.
+		*/
+		bool _doNextQueuedBackgroundProcess();
+
+		/** Initialise processing for a background thread.
+		@remarks
+			You must call this method if you use your own thread rather than 
+			letting this class create its own. Moreover, you must call it after
+			initialise() and after you've started your own thread, but before 
+			any resources have been loaded. There are some
+			per-thread tasks which have to be performed on some rendering APIs
+			and it's important that they are done before rendering resources are
+			created.
+		@par
+			You must call this method in your own background thread, not the main
+			thread. It's important to block the main thread whilst this initialisation
+			is happening, use an OGRE_THREAD_WAIT on the public initSync token
+			after locking the initMutex.
+		*/
+		void _initThread();
+
+		/** Queue the firing of the 'background loading complete' event to
+			a Resource::Listener event.
+		@remarks
+			The purpose of this is to allow the background loading thread to 
+			call this method to queue the notification to listeners waiting on
+			the background loading of a resource. Rather than allow the resource
+			background loading thread to directly call these listeners, which 
+			would require all the listeners to be thread-safe, this method
+			implements a thread-safe queue which can be processed in the main
+			frame loop thread each frame to clear the events in a simpler 
+			manner.
+		@param listener The listener to be notified
+		@param res The resource listened on
+		*/
+		virtual void _queueFireBackgroundLoadingComplete(Resource::Listener* listener, 
+			Resource* res);
+
+		/** Fires all the queued events for background loaded resources.
+		@remarks
+			You should call this from the thread that runs the main frame loop 
+			to avoid having to make the receivers of this event thread-safe.
+			If you use Ogre's built in frame loop you don't need to call this
+			yourself.
+		*/
+		virtual void _fireBackgroundLoadingComplete(void);
+
+		/** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static ResourceBackgroundQueue& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static ResourceBackgroundQueue* getSingletonPtr(void);
+		
+
+	};
+
+
+}
+
+#endif
+
Index: /OgreMain/include/OgreResourceGroupManager.h
===================================================================
--- /OgreMain/include/OgreResourceGroupManager.h	(revision 5)
+++ /OgreMain/include/OgreResourceGroupManager.h	(revision 5)
@@ -0,0 +1,858 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _ResourceGroupManager_H__
+#define _ResourceGroupManager_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreSingleton.h"
+#include "OgreCommon.h"
+#include "OgreDataStream.h"
+#include "OgreResource.h"
+#include "OgreArchive.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre {
+
+    /** This abstract class defines an interface which is called back during
+        resource group loading to indicate the progress of the load. 
+	@remarks
+		Resource group loading is in 2 phases - creating resources from 
+		declarations (which includes parsing scripts), and loading
+		resources. Note that you don't necessarily have to have both; it
+		is quite possible to just parse all the scripts for a group (see
+		ResourceGroupManager::initialiseResourceGroup, but not to 
+		load the resource group. 
+		The sequence of events is (* signifies a repeating item):
+		<ul>
+		<li>resourceGroupScriptingStarted</li>
+		<li>scriptParseStarted (*)</li>
+        <li>scriptParseEnded (*)</li>
+		<li>resourceGroupScriptingEnded</li>
+		<li>resourceGroupLoadStarted</li>
+		<li>resourceLoadStarted (*)</li>
+        <li>resourceLoadEnded (*)</li>
+        <li>worldGeometryStageStarted (*)</li>
+        <li>worldGeometryStageEnded (*)</li>
+		<li>resourceGroupLoadEnded</li>
+		</ul>
+    @note
+        If OGRE_THREAD_SUPPORT is 1, this class is thread-safe.
+
+    */
+    class _OgreExport ResourceGroupListener
+    {
+    public:
+        virtual ~ResourceGroupListener() {}
+
+		/** This event is fired when a resource group begins parsing scripts.
+		@note
+			Remember that if you are loading resources through ResourceBackgroundQueue,
+			these callbacks will occur in the background thread, so you should
+			not perform any thread-unsafe actions in this callback if that's the
+			case (check the group name / script name).
+		@param groupName The name of the group 
+		@param scriptCount The number of scripts which will be parsed
+		*/
+		virtual void resourceGroupScriptingStarted(const String& groupName, size_t scriptCount) = 0;
+		/** This event is fired when a script is about to be parsed.
+		@param scriptName Name of the to be parsed
+		*/
+		virtual void scriptParseStarted(const String& scriptName) = 0;
+		/** This event is fired when the script has been fully parsed.
+		*/
+		virtual void scriptParseEnded(const String& scriptName) = 0;
+		/** This event is fired when a resource group finished parsing scripts. */
+		virtual void resourceGroupScriptingEnded(const String& groupName) = 0;
+
+		/** This event is fired  when a resource group begins loading.
+		@param groupName The name of the group being loaded
+		@param resourceCount The number of resources which will be loaded, including
+            a number of stages required to load any linked world geometry
+		*/
+		virtual void resourceGroupLoadStarted(const String& groupName, size_t resourceCount) = 0;
+		/** This event is fired when a declared resource is about to be loaded. 
+		@param resource Weak reference to the resource loaded.
+		*/
+		virtual void resourceLoadStarted(const ResourcePtr& resource) = 0;
+        /** This event is fired when the resource has been loaded. 
+        */
+        virtual void resourceLoadEnded(void) = 0;
+        /** This event is fired when a stage of loading linked world geometry 
+            is about to start. The number of stages required will have been 
+            included in the resourceCount passed in resourceGroupLoadStarted.
+        @param description Text description of what was just loaded
+        */
+        virtual void worldGeometryStageStarted(const String& description) = 0;
+        /** This event is fired when a stage of loading linked world geometry 
+            has been completed. The number of stages required will have been 
+            included in the resourceCount passed in resourceGroupLoadStarted.
+        @param description Text description of what was just loaded
+        */
+        virtual void worldGeometryStageEnded(void) = 0;
+
+		/** This event is fired when a resource group finished loading. */
+		virtual void resourceGroupLoadEnded(const String& groupName) = 0;
+
+    };
+    /** This singleton class manages the list of resource groups, and notifying
+        the various resource managers of their obligations to load / unload
+        resources in a group. It also provides facilities to monitor resource
+        loading per group (to do progress bars etc), provided the resources 
+        that are required are pre-registered.
+    @par
+        Defining new resource groups,  and declaring the resources you intend to
+        use in advance is optional, however it is a very useful feature. In addition, 
+		if a ResourceManager supports the definition of resources through scripts, 
+		then this is the class which drives the locating of the scripts and telling
+		the ResourceManager to parse them. 
+	@par
+		There are several states that a resource can be in (the concept, not the
+		object instance in this case):
+		<ol>
+		<li><b>Undefined</b>. Nobody knows about this resource yet. It might be
+		in the filesystem, but Ogre is oblivious to it at the moment - there 
+		is no Resource instance. This might be because it's never been declared
+		(either in a script, or using ResourceGroupManager::declareResource), or
+		it may have previously been a valid Resource instance but has been 
+		removed, either individually through ResourceManager::remove or as a group
+		through ResourceGroupManager::clearResourceGroup.</li>
+		<li><b>Declared</b>. Ogre has some forewarning of this resource, either
+		through calling ResourceGroupManager::declareResource, or by declaring
+		the resource in a script file which is on one of the resource locations
+		which has been defined for a group. There is still no instance of Resource,
+		but Ogre will know to create this resource when 
+		ResourceGroupManager::initialiseResourceGroup is called (which is automatic
+		if you declare the resource group before Root::initialise).</li>
+		<li><b>Unloaded</b>. There is now a Resource instance for this resource, 
+		although it is not loaded. This means that code which looks for this
+		named resource will find it, but the Resource is not using a lot of memory
+		because it is in an unloaded state. A Resource can get into this state
+		by having just been created by ResourceGroupManager::initialiseResourceGroup 
+		(either from a script, or from a call to declareResource), by 
+		being created directly from code (ResourceManager::create), or it may 
+		have previously been loaded and has been unloaded, either individually
+		through Resource::unload, or as a group through ResourceGroupManager::unloadResourceGroup.</li>
+		<li><b>Loaded</b>The Resource instance is fully loaded. This may have
+		happened implicitly because something used it, or it may have been 
+		loaded as part of a group.</li>
+		</ol>
+		@see ResourceGroupManager::declareResource
+		@see ResourceGroupManager::initialiseResourceGroup
+		@see ResourceGroupManager::loadResourceGroup
+		@see ResourceGroupManager::unloadResourceGroup
+		@see ResourceGroupManager::clearResourceGroup
+    */
+    class _OgreExport ResourceGroupManager : public Singleton<ResourceGroupManager>
+    {
+    public:
+		OGRE_AUTO_MUTEX // public to allow external locking
+		/// Default resource group name
+		static String DEFAULT_RESOURCE_GROUP_NAME;
+        /// Internal resource group name (should be used by OGRE internal only)
+        static String INTERNAL_RESOURCE_GROUP_NAME;
+		/// Bootstrap resource group name (min OGRE resources)
+		static String BOOTSTRAP_RESOURCE_GROUP_NAME;
+		/// Special resource group name which causes resource group to be automatically determined based on searching for the resource in all groups.
+		static String AUTODETECT_RESOURCE_GROUP_NAME;
+		/// The number of reference counts held per resource by the resource system
+		static size_t RESOURCE_SYSTEM_NUM_REFERENCE_COUNTS;
+        /// Nested struct defining a resource declaration
+        struct ResourceDeclaration
+        {
+            String resourceName;
+            String resourceType;
+            ManualResourceLoader* loader;
+			NameValuePairList parameters;
+        };
+        /// List of resource declarations
+        typedef std::list<ResourceDeclaration> ResourceDeclarationList;
+		typedef std::map<String, ResourceManager*> ResourceManagerMap;
+		typedef MapIterator<ResourceManagerMap> ResourceManagerIterator;
+    protected:
+		/// Map of resource types (strings) to ResourceManagers, used to notify them to load / unload group contents
+        ResourceManagerMap mResourceManagerMap;
+
+		/// Map of loading order (Real) to ScriptLoader, used to order script parsing
+		typedef std::multimap<Real, ScriptLoader*> ScriptLoaderOrderMap;
+		ScriptLoaderOrderMap mScriptLoaderOrderMap;
+
+		typedef std::vector<ResourceGroupListener*> ResourceGroupListenerList;
+        ResourceGroupListenerList mResourceGroupListenerList;
+
+        /// Resource index entry, resourcename->location 
+        typedef std::map<String, Archive*> ResourceLocationIndex;
+
+		/// Resource location entry
+		struct ResourceLocation
+		{
+			/// Pointer to the archive which is the destination
+			Archive* archive;
+			/// Whether this location was added recursively
+			bool recursive;
+		};
+		/// List of possible file locations
+		typedef std::list<ResourceLocation*> LocationList;
+		/// List of resources which can be loaded / unloaded
+		typedef std::list<ResourcePtr> LoadUnloadResourceList;
+		/// Resource group entry
+		struct ResourceGroup
+		{
+			enum Status
+			{
+				UNINITIALSED = 0,
+				INITIALISING = 1,
+				INITIALISED = 2,
+				LOADING = 3,
+				LOADED = 4
+			};
+			/// General mutex for dealing with group content
+			OGRE_AUTO_MUTEX
+			/// Status-specific mutex, separate from content-changing mutex
+			OGRE_MUTEX(statusMutex)
+			/// Group name
+			String name;
+			/// Group status
+			bool initialised;
+			/// List of possible locations to search
+			LocationList locationList;
+			/// Index of resource names to locations, built for speedy access (case sensitive archives)
+			ResourceLocationIndex resourceIndexCaseSensitive;
+            /// Index of resource names to locations, built for speedy access (case insensitive archives)
+            ResourceLocationIndex resourceIndexCaseInsensitive;
+			/// Pre-declared resources, ready to be created
+			ResourceDeclarationList resourceDeclarations;
+			/// Created resources which are ready to be loaded / unloaded
+			// Group by loading order of the type (defined by ResourceManager)
+			// (e.g. skeletons and materials before meshes)
+			typedef std::map<Real, LoadUnloadResourceList*> LoadResourceOrderMap;
+			LoadResourceOrderMap loadResourceOrderMap;
+            /// Linked world geometry, as passed to setWorldGeometry
+            String worldGeometry;
+            /// Scene manager to use with linked world geometry
+            SceneManager* worldGeometrySceneManager;
+		};
+        /// Map from resource group names to groups
+        typedef std::map<String, ResourceGroup*> ResourceGroupMap;
+        ResourceGroupMap mResourceGroupMap;
+
+        /// Group name for world resources
+        String mWorldGroupName;
+
+		/** Parses all the available scripts found in the resource locations
+		for the given group, for all ResourceManagers.
+		@remarks
+			Called as part of initialiseResourceGroup
+		*/
+		void parseResourceGroupScripts(ResourceGroup* grp);
+		/** Create all the pre-declared resources.
+		@remarks
+			Called as part of initialiseResourceGroup
+		*/
+		void createDeclaredResources(ResourceGroup* grp);
+		/** Adds a created resource to a group. */
+		void addCreatedResource(ResourcePtr& res, ResourceGroup& group);
+		/** Get resource group */
+		ResourceGroup* getResourceGroup(const String& name);
+		/** Drops contents of a group, leave group there, notify ResourceManagers. */
+		void dropGroupContents(ResourceGroup* grp);
+		/** Delete a group for shutdown - don't notify ResourceManagers. */
+		void deleteGroup(ResourceGroup* grp);
+		/// Internal find method for auto groups
+		ResourceGroup* findGroupContainingResourceImpl(const String& filename);
+		/// Internal event firing method
+		void fireResourceGroupScriptingStarted(const String& groupName, size_t scriptCount);
+		/// Internal event firing method
+		void fireScriptStarted(const String& scriptName);
+        /// Internal event firing method
+        void fireScriptEnded(const String& scriptName);
+		/// Internal event firing method
+		void fireResourceGroupScriptingEnded(const String& groupName);
+		/// Internal event firing method
+		void fireResourceGroupLoadStarted(const String& groupName, size_t resourceCount);
+        /// Internal event firing method
+        void fireResourceStarted(const ResourcePtr& resource);
+		/// Internal event firing method
+		void fireResourceEnded(void);
+		/// Internal event firing method
+		void fireResourceGroupLoadEnded(const String& groupName);
+
+
+
+		/// Stored current group - optimisation for when bulk loading a group
+		ResourceGroup* mCurrentGroup;
+    public:
+        ResourceGroupManager();
+        virtual ~ResourceGroupManager();
+
+        /** Create a resource group.
+        @remarks
+            A resource group allows you to define a set of resources that can 
+            be loaded / unloaded as a unit. For example, it might be all the 
+            resources used for the level of a game. There is always one predefined
+            resource group called ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+			which is typically used to hold all resources which do not need to 
+			be unloaded until shutdown. There is another predefined resource
+            group called ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME too,
+            which should be used by OGRE internal only, the resources created
+            in this group aren't supposed to modify, unload or remove by user.
+            You can create additional ones so that you can control the life of
+            your resources in whichever way you wish.
+			There is one other predefined value, 
+			ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME; using this 
+			causes the group name to be derived at load time by searching for 
+			the resource in the resource locations of each group in turn.
+        @par
+            Once you have defined a resource group, resources which will be loaded
+			as part of it are defined in one of 3 ways:
+			<ol>
+			<li>Manually through declareResource(); this is useful for scripted
+				declarations since it is entirely generalised, and does not 
+				create Resource instances right away</li>
+			<li>Through the use of scripts; some ResourceManager subtypes have
+				script formats (e.g. .material, .overlay) which can be used
+				to declare resources</li>
+			<li>By calling ResourceManager::create to create a resource manually.
+			This resource will go on the list for it's group and will be loaded
+			and unloaded with that group</li>
+			</ol>
+			You must remember to call initialiseResourceGroup if you intend to use
+			the first 2 types.
+        @param name The name to give the resource group.
+        */
+        void createResourceGroup(const String& name);
+
+
+        /** Initialises a resource group.
+		@remarks
+			After creating a resource group, adding some resource locations, and
+			perhaps pre-declaring some resources using declareResource(), but 
+			before you need to use the resources in the group, you 
+			should call this method to initialise the group. By calling this,
+			you are triggering the following processes:
+			<ol>
+			<li>Scripts for all resource types which support scripting are
+				parsed from the resource locations, and resources within them are
+				created (but not loaded yet).</li>
+			<li>Creates all the resources which have just pre-declared using
+			declareResource (again, these are not loaded yet)</li>
+			</ol>
+			So what this essentially does is create a bunch of unloaded Resource entries
+			in the respective ResourceManagers based on scripts, and resources
+			you've pre-declared. That means that code looking for these resources
+			will find them, but they won't be taking up much memory yet, until
+			they are either used, or they are loaded in bulk using loadResourceGroup.
+			Loading the resource group in bulk is entirely optional, but has the 
+			advantage of coming with progress reporting as resources are loaded.
+		@par
+			Failure to call this method means that loadResourceGroup will do 
+			nothing, and any resources you define in scripts will not be found.
+			Similarly, once you have called this method you won't be able to
+			pick up any new scripts or pre-declared resources, unless you
+			call clearResourceGroup, set up declared resources, and call this
+			method again.
+		@note 
+			When you call Root::initialise, all resource groups that have already been
+			created are automatically initialised too. Therefore you do not need to 
+			call this method for groups you define and set up before you call 
+			Root::initialise. However, since one of the most useful features of 
+			resource groups is to set them up after the main system initialisation
+			has occurred (e.g. a group per game level), you must remember to call this
+			method for the groups you create after this.
+
+		@param name The name of the resource group to initialise
+		*/
+		void initialiseResourceGroup(const String& name);
+
+		/** Initialise all resource groups which are yet to be initialised.
+		@see ResourceGroupManager::intialiseResourceGroup
+		*/
+		void initialiseAllResourceGroups(void);
+
+		/** Loads a resource group.
+        @remarks
+			Loads any created resources which are part of the named group.
+			Note that resources must have already been created by calling
+			ResourceManager::create, or declared using declareResource() or
+			in a script (such as .material and .overlay). The latter requires
+			that initialiseResourceGroup has been called. 
+		
+			When this method is called, this class will callback any ResourceGroupListeners
+			which have been registered to update them on progress. 
+        @param name The name to of the resource group to load.
+		@param loadMainResources If true, loads normal resources associated 
+			with the group (you might want to set this to false if you wanted
+			to just load world geometry in bulk)
+		@param loadWorldGeom If true, loads any linked world geometry
+			@see ResourceGroupManager::linkWorldGeometryToResourceGroup
+        */
+        void loadResourceGroup(const String& name, bool loadMainResources = true, 
+			bool loadWorldGeom = true);
+
+        /** Unloads a resource group.
+        @remarks
+            This method unloads all the resources that have been declared as
+            being part of the named resource group. Note that these resources
+            will still exist in their respective ResourceManager classes, but
+            will be in an unloaded state. If you want to remove them entirely,
+            you should use clearResourceGroup or destroyResourceGroup.
+        @param name The name to of the resource group to unload.
+        @param reloadableOnly If set to true, only unload the resource that is
+            reloadable. Because some resources isn't reloadable, they will be
+            unloaded but can't load them later. Thus, you might not want to them
+            unloaded. Or, you might unload all of them, and then populate them
+            manually later.
+            @see Resource::isReloadable for resource is reloadable.
+        */
+        void unloadResourceGroup(const String& name, bool reloadableOnly = true);
+
+		/** Unload all resources which are not referenced by any other object.
+		@remarks
+			This method behaves like unloadResourceGroup, except that it only
+			unloads resources in the group which are not in use, ie not referenced
+			by other objects. This allows you to free up some memory selectively
+			whilst still keeping the group around (and the resources present,
+			just not using much memory).
+		@param name The name of the group to check for unreferenced resources
+		@param reloadableOnly If true (the default), only unloads resources
+			which can be subsequently automatically reloaded
+		*/
+		void unloadUnreferencedResourcesInGroup(const String& name, 
+			bool reloadableOnly = true);
+
+		/** Clears a resource group. 
+		@remarks
+			This method unloads all resources in the group, but in addition it
+			removes all those resources from their ResourceManagers, and then 
+			clears all the members from the list. That means after calling this
+			method, there are no resources declared as part of the named group
+			any more. Resource locations still persist though.
+        @param name The name to of the resource group to clear.
+		*/
+		void clearResourceGroup(const String& name);
+        
+        /** Destroys a resource group, clearing it first, destroying the resources
+            which are part of it, and then removing it from
+            the list of resource groups. 
+        @param name The name of the resource group to destroy.
+        */
+        void destroyResourceGroup(const String& name);
+
+        /** Method to add a resource location to for a given resource group. 
+        @remarks
+            Resource locations are places which are searched to load resource files.
+            When you choose to load a file, or to search for valid files to load, 
+            the resource locations are used.
+        @param name The name of the resource location; probably a directory, zip file, URL etc.
+        @param locType The codename for the resource type, which must correspond to the 
+            Archive factory which is providing the implementation.
+        @param resGroup The name of the resource group for which this location is
+            to apply. ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME is the 
+			default group which always exists, and can
+            be used for resources which are unlikely to be unloaded until application
+            shutdown. Otherwise it must be the name of a group; if it
+            has not already been created with createResourceGroup then it is created
+            automatically.
+        @param recursive Whether subdirectories will be searched for files when using 
+			a pattern match (such as *.material), and whether subdirectories will be
+			indexed. This can slow down initial loading of the archive and searches.
+			When opening a resource you still need to use the fully qualified name, 
+			this allows duplicate names in alternate paths.
+        */
+        void addResourceLocation(const String& name, const String& locType, 
+            const String& resGroup = DEFAULT_RESOURCE_GROUP_NAME, bool recursive = false);
+        /** Removes a resource location from the search path. */ 
+        void removeResourceLocation(const String& name, 
+			const String& resGroup = DEFAULT_RESOURCE_GROUP_NAME);
+
+        /** Declares a resource to be a part of a resource group, allowing you 
+            to load and unload it as part of the group.
+        @remarks
+            By declaring resources before you attempt to use them, you can 
+            more easily control the loading and unloading of those resources
+            by their group. Declaring them also allows them to be enumerated, 
+            which means events can be raised to indicate the loading progress
+            (@see ResourceGroupListener). Note that another way of declaring
+			resources is to use a script specific to the resource type, if
+			available (e.g. .material).
+		@par
+			Declared resources are not created as Resource instances (and thus
+			are not available through their ResourceManager) until initialiseResourceGroup
+			is called, at which point all declared resources will become created 
+			(but unloaded) Resource instances, along with any resources declared
+			in scripts in resource locations associated with the group.
+        @param name The resource name. 
+        @param resourceType The type of the resource. Ogre comes preconfigured with 
+            a number of resource types: 
+            <ul>
+            <li>Font</li>
+            <li>GpuProgram</li>
+            <li>HighLevelGpuProgram</li>
+            <li>Material</li>
+            <li>Mesh</li>
+            <li>Skeleton</li>
+            <li>Texture</li>
+            </ul>
+            .. but more can be added by plugin ResourceManager classes.
+        @param groupName The name of the group to which it will belong.
+		@param loadParameters A list of name / value pairs which supply custom
+			parameters to the resource which will be required before it can 
+			be loaded. These are specific to the resource type.
+        */
+        void declareResource(const String& name, const String& resourceType,
+            const String& groupName = DEFAULT_RESOURCE_GROUP_NAME,
+			const NameValuePairList& loadParameters = NameValuePairList());
+        /** Declares a resource to be a part of a resource group, allowing you
+            to load and unload it as part of the group.
+        @remarks
+            By declaring resources before you attempt to use them, you can
+            more easily control the loading and unloading of those resources
+            by their group. Declaring them also allows them to be enumerated,
+            which means events can be raised to indicate the loading progress
+            (@see ResourceGroupListener). Note that another way of declaring
+            resources is to use a script specific to the resource type, if
+            available (e.g. .material).
+        @par
+            Declared resources are not created as Resource instances (and thus
+            are not available through their ResourceManager) until initialiseResourceGroup
+            is called, at which point all declared resources will become created
+            (but unloaded) Resource instances, along with any resources declared
+            in scripts in resource locations associated with the group.
+        @param name The resource name.
+        @param resourceType The type of the resource. Ogre comes preconfigured with
+            a number of resource types:
+            <ul>
+            <li>Font</li>
+            <li>GpuProgram</li>
+            <li>HighLevelGpuProgram</li>
+            <li>Material</li>
+            <li>Mesh</li>
+            <li>Skeleton</li>
+            <li>Texture</li>
+            </ul>
+            .. but more can be added by plugin ResourceManager classes.
+        @param groupName The name of the group to which it will belong.
+        @param loader Pointer to a ManualResourceLoader implementation which will
+            be called when the Resource wishes to load. If supplied, the resource
+            is manually loaded, otherwise it'll loading from file automatic.
+            @note We don't support declare manually loaded resource without loader
+                here, since it's meaningless.
+        @param loadParameters A list of name / value pairs which supply custom
+            parameters to the resource which will be required before it can
+            be loaded. These are specific to the resource type.
+        */
+        void declareResource(const String& name, const String& resourceType,
+            const String& groupName, ManualResourceLoader* loader,
+            const NameValuePairList& loadParameters = NameValuePairList());
+        /** Undeclare a resource.
+		@remarks
+			Note that this will not cause it to be unloaded
+            if it is already loaded, nor will it destroy a resource which has 
+			already been created if initialiseResourceGroup has been called already.
+			Only unloadResourceGroup / clearResourceGroup / destroyResourceGroup 
+			will do that. 
+        @param name The name of the resource. 
+		@param groupName The name of the group this resource was declared in. 
+        */
+        void undeclareResource(const String& name, const String& groupName);
+
+		/** Open a single resource by name and return a DataStream
+		 	pointing at the source of the data.
+		@param resourceName The name of the resource to locate.
+			Even if resource locations are added recursively, you
+			must provide a fully qualified name to this method. You 
+			can find out the matching fully qualified names by using the
+			find() method if you need to.
+		@param groupName The name of the resource group; this determines which 
+			locations are searched. 
+		@param searchGroupsIfNotFound If true, if the resource is not found in 
+			the group specified, other groups will be searched. If you're
+			loading a real Resource using this option, you <strong>must</strong>
+			also provide the resourceBeingLoaded parameter to enable the 
+			group membership to be changed
+		@param resourceBeingLoaded Optional pointer to the resource being 
+			loaded, which you should supply if you want
+		@returns Shared pointer to data stream containing the data, will be
+			destroyed automatically when no longer referenced
+		*/
+		DataStreamPtr openResource(const String& resourceName, 
+			const String& groupName = DEFAULT_RESOURCE_GROUP_NAME,
+			bool searchGroupsIfNotFound = true, Resource* resourceBeingLoaded = 0);
+
+		/** Open all resources matching a given pattern (which can contain
+			the character '*' as a wildcard), and return a collection of 
+			DataStream objects on them.
+		@param pattern The pattern to look for. If resource locations have been
+			added recursively, subdirectories will be searched too so this
+			does not need to be fully qualified.
+		@param groupName The resource group; this determines which locations
+			are searched.
+		@returns Shared pointer to a data stream list , will be
+			destroyed automatically when no longer referenced
+		*/
+		DataStreamListPtr openResources(const String& pattern, 
+			const String& groupName = DEFAULT_RESOURCE_GROUP_NAME);
+		
+        /** List all file or directory names in a resource group.
+        @note
+        This method only returns filenames, you can also retrieve other
+        information using listFileInfo.
+        @param groupName The name of the group
+        @param dirs If true, directory names will be returned instead of file names
+        @returns A list of filenames matching the criteria, all are fully qualified
+        */
+        StringVectorPtr listResourceNames(const String& groupName, bool dirs = false);
+
+        /** List all files in a resource group with accompanying information.
+        @param groupName The name of the group
+        @param dirs If true, directory names will be returned instead of file names
+        @returns A list of structures detailing quite a lot of information about
+        all the files in the archive.
+        */
+        FileInfoListPtr listResourceFileInfo(const String& groupName, bool dirs = false);
+
+        /** Find all file or directory names matching a given pattern in a
+            resource group.
+        @note
+        This method only returns filenames, you can also retrieve other
+        information using findFileInfo.
+        @param groupName The name of the group
+        @param pattern The pattern to search for; wildcards (*) are allowed
+        @param dirs Set to true if you want the directories to be listed
+            instead of files
+        @returns A list of filenames matching the criteria, all are fully qualified
+        */
+        StringVectorPtr findResourceNames(const String& groupName, const String& pattern,
+            bool dirs = false);
+
+        /** Find out if the named file exists in a group. 
+        @param group The name of the resource group
+        @param filename Fully qualified name of the file to test for
+        */
+        bool resourceExists(const String& group, const String& filename);
+
+        /** Find out if the named file exists in a group. 
+        @param group Pointer to the resource group
+        @param filename Fully qualified name of the file to test for
+        */
+        bool resourceExists(ResourceGroup* group, const String& filename);
+		/** Find the group in which a resource exists.
+		@param filename Fully qualified name of the file the resource should be
+			found as
+		@returns Name of the resource group the resource was found in. An
+			exception is thrown if the group could not be determined.
+		*/
+		const String& findGroupContainingResource(const String& filename);
+
+        /** Find all files or directories matching a given pattern in a group
+            and get some detailed information about them.
+        @param group The name of the resource group
+        @param pattern The pattern to search for; wildcards (*) are allowed
+        @param dirs Set to true if you want the directories to be listed
+            instead of files
+        @returns A list of file information structures for all files matching 
+        the criteria.
+        */
+        FileInfoListPtr findResourceFileInfo(const String& group, const String& pattern,
+            bool dirs = false);
+
+        
+        /** Adds a ResourceGroupListener which will be called back during 
+            resource loading events. 
+        */
+        void addResourceGroupListener(ResourceGroupListener* l);
+        /** Removes a ResourceGroupListener */
+        void removeResourceGroupListener(ResourceGroupListener* l);
+
+        /** Sets the resource group that 'world' resources will use.
+        @remarks
+            This is the group which should be used by SceneManagers implementing
+            world geometry when looking for their resources. Defaults to the 
+            DEFAULT_RESOURCE_GROUP_NAME but this can be altered.
+        */
+        void setWorldResourceGroupName(const String& groupName) {mWorldGroupName = groupName;}
+
+        /// Sets the resource group that 'world' resources will use.
+        const String& getWorldResourceGroupName(void) const { return mWorldGroupName; }
+
+        /** Associates some world geometry with a resource group, causing it to 
+            be loaded / unloaded with the resource group.
+        @remarks
+            You would use this method to essentially defer a call to 
+            SceneManager::setWorldGeometry to the time when the resource group
+            is loaded. The advantage of this is that compatible scene managers 
+            will include the estimate of the number of loading stages for that
+            world geometry when the resource group begins loading, allowing you
+            to include that in a loading progress report. 
+        @param group The name of the resource group
+        @param worldGeometry The parameter which should be passed to setWorldGeometry
+        @param sceneManager The SceneManager which should be called
+        */
+        void linkWorldGeometryToResourceGroup(const String& group, 
+            const String& worldGeometry, SceneManager* sceneManager);
+
+        /** Clear any link to world geometry from a resource group.
+        @remarks
+            Basically undoes a previous call to linkWorldGeometryToResourceGroup.
+        */
+        void unlinkWorldGeometryFromResourceGroup(const String& group);
+
+        /** Shutdown all ResourceManagers, performed as part of clean-up. */
+        void shutdownAll(void);
+
+
+        /** Internal method for registering a ResourceManager (which should be
+            a singleton). Creators of plugins can register new ResourceManagers
+            this way if they wish.
+		@remarks
+			ResourceManagers that wish to parse scripts must also call 
+			_registerScriptLoader.
+        @param resourceType String identifying the resource type, must be unique.
+        @param rm Pointer to the ResourceManager instance.
+        */
+        void _registerResourceManager(const String& resourceType, ResourceManager* rm);
+
+        /** Internal method for unregistering a ResourceManager.
+		@remarks
+			ResourceManagers that wish to parse scripts must also call 
+			_unregisterScriptLoader.
+        @param resourceType String identifying the resource type.
+        */
+        void _unregisterResourceManager(const String& resourceType);
+
+		/** Get an iterator over the registered resource managers.
+		*/
+		ResourceManagerIterator getResourceManagerIterator()
+		{ return ResourceManagerIterator(
+			mResourceManagerMap.begin(), mResourceManagerMap.end()); }
+
+        /** Internal method for registering a ScriptLoader.
+		@remarks ScriptLoaders parse scripts when resource groups are initialised.
+        @param su Pointer to the ScriptLoader instance.
+        */
+        void _registerScriptLoader(ScriptLoader* su);
+
+        /** Internal method for unregistering a ScriptLoader.
+        @param su Pointer to the ScriptLoader instance.
+        */
+        void _unregisterScriptLoader(ScriptLoader* su);
+
+		/** Internal method for getting a registered ResourceManager.
+		@param resourceType String identifying the resource type.
+		*/
+		ResourceManager* _getResourceManager(const String& resourceType);
+
+		/** Internal method called by ResourceManager when a resource is created.
+		@param res Weak reference to resource
+		*/
+		void _notifyResourceCreated(ResourcePtr& res);
+
+		/** Internal method called by ResourceManager when a resource is removed.
+		@param res Weak reference to resource
+		*/
+		void _notifyResourceRemoved(ResourcePtr& res);
+
+		/** Internale method to notify the group manager that a resource has
+			changed group (only applicable for autodetect group) */
+		void _notifyResourceGroupChanged(const String& oldGroup, Resource* res);
+
+		/** Internal method called by ResourceManager when all resources 
+			for that manager are removed.
+		@param manager Pointer to the manager for which all resources are being removed
+		*/
+		void _notifyAllResourcesRemoved(ResourceManager* manager);
+
+        /** Notify this manager that one stage of world geometry loading has been 
+            started.
+        @remarks
+            Custom SceneManagers which load custom world geometry should call this 
+            method the number of times equal to the value they return from 
+            SceneManager::estimateWorldGeometry while loading their geometry.
+        */
+        void _notifyWorldGeometryStageStarted(const String& description);
+        /** Notify this manager that one stage of world geometry loading has been 
+            completed.
+        @remarks
+            Custom SceneManagers which load custom world geometry should call this 
+            method the number of times equal to the value they return from 
+            SceneManager::estimateWorldGeometry while loading their geometry.
+        */
+        void _notifyWorldGeometryStageEnded(void);
+
+		/** Get a list of the currently defined resource groups. 
+		@note This method intentionally returns a copy rather than a reference in
+			order to avoid any contention issues in multithreaded applications.
+		@returns A copy of list of currently defined groups.
+		*/
+		StringVector getResourceGroups(void);
+		/** Get the list of resource declarations for the specified group name. 
+		@note This method intentionally returns a copy rather than a reference in
+			order to avoid any contention issues in multithreaded applications.
+		@param groupName The name of the group
+		@returns A copy of list of currently defined resources.
+		*/
+		ResourceDeclarationList getResourceDeclarationList(const String& groupName);
+
+
+		/** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static ResourceGroupManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static ResourceGroupManager* getSingletonPtr(void);
+
+    };
+}
+
+#endif
Index: /OgreMain/include/OgreResourceManager.h
===================================================================
--- /OgreMain/include/OgreResourceManager.h	(revision 5)
+++ /OgreMain/include/OgreResourceManager.h	(revision 5)
@@ -0,0 +1,446 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _ResourceManager_H__
+#define _ResourceManager_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreResource.h"
+#include "OgreResourceGroupManager.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreCommon.h"
+#include "OgreDataStream.h"
+#include "OgreStringVector.h"
+#include "OgreScriptLoader.h"
+
+namespace Ogre {
+
+    /** Defines a generic resource handler.
+    @remarks
+        A resource manager is responsible for managing a pool of
+        resources of a particular type. It must index them, look
+        them up, load and destroy them. It may also need to stay within
+        a defined memory budget, and temporaily unload some resources
+        if it needs to to stay within this budget.
+    @par
+        Resource managers use a priority system to determine what can
+        be unloaded, and a Least Recently Used (LRU) policy within
+        resources of the same priority.
+	@par
+		Resources can be loaded using the generalised load interface,
+		and they can be unloaded and removed. In addition, each 
+		subclass of ResourceManager will likely define custom 'load' methods
+		which take explicit parameters depending on the kind of resource
+		being created.
+	@note
+		Resources can be loaded and unloaded through the Resource class, 
+		but they can only be removed (and thus eventually destroyed) using
+		their parent ResourceManager.
+    @note
+        If OGRE_THREAD_SUPPORT is 1, this class is thread-safe.
+    */
+	class _OgreExport ResourceManager : public ScriptLoader
+    {
+    public:
+		OGRE_AUTO_MUTEX // public to allow external locking
+        ResourceManager();
+        virtual ~ResourceManager();
+
+        /** Creates a new blank resource, but does not immediately load it.
+        @remarks
+            Resource managers handle disparate types of resources, so if you want
+			to get at the detailed interface of this resource, you'll have to 
+			cast the result to the subclass you know you're creating. 
+		@param name The unique name of the resource
+		@param group The name of the resource group to attach this new resource to
+		@param isManual Is this resource manually loaded? If so, you should really
+			populate the loader parameter in order that the load process
+			can call the loader back when loading is required. 
+		@param loader Pointer to a ManualLoader implementation which will be called
+			when the Resource wishes to load (should be supplied if you set
+			isManual to true). You can in fact leave this parameter null 
+			if you wish, but the Resource will never be able to reload if 
+			anything ever causes it to unload. Therefore provision of a proper
+			ManualLoader instance is strongly recommended.
+        @param createParams If any parameters are required to create an instance,
+            they should be supplied here as name / value pairs
+        */
+        virtual ResourcePtr create(const String& name, const String& group, 
+            bool isManual = false, ManualResourceLoader* loader = 0, 
+            const NameValuePairList* createParams = 0);
+
+		typedef std::pair<ResourcePtr, bool> ResourceCreateOrRetrieveResult;
+		/** Create a new resource, or retrieve an existing one with the same
+			name if it already exists.
+		@remarks
+			This method performs the same task as calling getByName() followed
+			by create() if that returns null. The advantage is that it does it
+			in one call so there are no race conditions if using multiple
+			threads that could cause getByName() to return null, but create() to
+			fail because another thread created a resource in between.
+		@see ResourceManager::create
+		@see ResourceManager::getByName
+		@returns A pair, the first element being the pointer, and the second being 
+			an indicator specifying whether the resource was newly created.
+		*/
+		virtual ResourceCreateOrRetrieveResult createOrRetrieve(const String& name, 
+			const String& group, bool isManual = false, 
+			ManualResourceLoader* loader = 0, 
+			const NameValuePairList* createParams = 0);
+		
+        /** Set a limit on the amount of memory this resource handler may use.
+            @remarks
+                If, when asked to load a new resource, the manager believes it will exceed this memory
+                budget, it will temporarily unload a resource to make room for the new one. This unloading
+                is not permanent and the Resource is not destroyed; it simply needs to be reloaded when
+                next used.
+        */
+        virtual void setMemoryBudget( size_t bytes);
+
+        /** Get the limit on the amount of memory this resource handler may use.
+        */
+        virtual size_t getMemoryBudget(void) const;
+
+		/** Gets the current memory usage, in bytes. */
+		virtual size_t getMemoryUsage(void) const { return mMemoryUsage; }
+
+		/** Unloads a single resource by name.
+		@remarks
+			Unloaded resources are not removed, they simply free up their memory
+			as much as they can and wait to be reloaded.
+			@see ResourceGroupManager for unloading of resource groups.
+		*/
+		virtual void unload(const String& name);
+		
+		/** Unloads a single resource by handle.
+		@remarks
+			Unloaded resources are not removed, they simply free up their memory
+			as much as they can and wait to be reloaded.
+			@see ResourceGroupManager for unloading of resource groups.
+		*/
+		virtual void unload(ResourceHandle handle);
+
+		/** Unloads all resources.
+		@remarks
+			Unloaded resources are not removed, they simply free up their memory
+			as much as they can and wait to be reloaded.
+			@see ResourceGroupManager for unloading of resource groups.
+		@param reloadableOnly If true (the default), only unload the resource that
+            is reloadable. Because some resources isn't reloadable, they will be
+			unloaded but can't load them later. Thus, you might not want to them
+			unloaded. Or, you might unload all of them, and then populate them
+			manually later.
+			@see Resource::isReloadable for resource is reloadable.
+		*/
+		virtual void unloadAll(bool reloadableOnly = true);
+
+		/** Caused all currently loaded resources to be reloaded.
+		@remarks
+			All resources currently being held in this manager which are also
+			marked as currently loaded will be unloaded, then loaded again.
+		@param reloadableOnly If true (the default), only reload the resource that
+            is reloadable. Because some resources isn't reloadable, they will be
+			unloaded but can't loaded again. Thus, you might not want to them
+			unloaded. Or, you might unload all of them, and then populate them
+			manually later.
+			@see Resource::isReloadable for resource is reloadable.
+		*/
+		virtual void reloadAll(bool reloadableOnly = true);
+
+		/** Unload all resources which are not referenced by any other object.
+		@remarks
+			This method behaves like unloadAll, except that it only unloads resources
+            which are not in use, ie not referenced by other objects. This allows you
+            to free up some memory selectively whilst still keeping the group around
+            (and the resources present, just not using much memory).
+        @par
+            Some referenced resource may exists 'weak' pointer to their sub-components
+            (e.g. Entity held pointer to SubMesh), in this case, unload or reload that
+            resource will cause dangerous pointer access. Use this function instead of
+            unloadAll allows you avoid fail in those situations.
+		@param reloadableOnly If true (the default), only unloads resources
+			which can be subsequently automatically reloaded.
+		*/
+		virtual void unloadUnreferencedResources(bool reloadableOnly = true);
+
+		/** Caused all currently loaded but not referenced by any other object
+            resources to be reloaded.
+		@remarks
+			This method behaves like reloadAll, except that it only reloads resources
+            which are not in use, ie not referenced by other objects.
+        @par
+            Some referenced resource may exists 'weak' pointer to their sub-components
+            (e.g. Entity held pointer to SubMesh), in this case, unload or reload that
+            resource will cause dangerous pointer access. Use this function instead of
+            reloadAll allows you avoid fail in those situations.
+		@param reloadableOnly If true (the default), only reloads resources
+			which can be subsequently automatically reloaded.
+		*/
+		virtual void reloadUnreferencedResources(bool reloadableOnly = true);
+
+		/** Remove a single resource.
+		@remarks
+			Removes a single resource, meaning it will be removed from the list
+			of valid resources in this manager, also causing it to be unloaded. 
+		@note
+			The word 'Destroy' is not used here, since
+			if any other pointers are referring to this resource, it will persist
+			until they have finished with it; however to all intents and purposes
+			it no longer exists and will likely get destroyed imminently.
+        @note
+            If you do have shared pointers to resources hanging around after the 
+            ResourceManager is destroyed, you may get problems on destruction of
+            these resources if they were relying on the manager (especially if
+            it is a plugin). If you find you get problems on shutdown in the
+            destruction of resources, try making sure you release all your
+            shared pointers before you shutdown OGRE.
+		*/
+		virtual void remove(ResourcePtr& r);
+
+        /** Remove a single resource by name.
+		@remarks
+			Removes a single resource, meaning it will be removed from the list
+			of valid resources in this manager, also causing it to be unloaded. 
+		@note
+			The word 'Destroy' is not used here, since
+			if any other pointers are referring to this resource, it will persist
+			until they have finished with it; however to all intents and purposes
+			it no longer exists and will likely get destroyed imminently.
+        @note
+            If you do have shared pointers to resources hanging around after the 
+            ResourceManager is destroyed, you may get problems on destruction of
+            these resources if they were relying on the manager (especially if
+            it is a plugin). If you find you get problems on shutdown in the
+            destruction of resources, try making sure you release all your
+            shared pointers before you shutdown OGRE.
+		*/
+		virtual void remove(const String& name);
+		
+		/** Remove a single resource by handle.
+		@remarks
+			Removes a single resource, meaning it will be removed from the list
+			of valid resources in this manager, also causing it to be unloaded. 
+		@note
+			The word 'Destroy' is not used here, since
+			if any other pointers are referring to this resource, it will persist
+			until they have finished with it; however to all intents and purposes
+			it no longer exists and will likely get destroyed imminently.
+        @note
+            If you do have shared pointers to resources hanging around after the 
+            ResourceManager is destroyed, you may get problems on destruction of
+            these resources if they were relying on the manager (especially if
+            it is a plugin). If you find you get problems on shutdown in the
+            destruction of resources, try making sure you release all your
+            shared pointers before you shutdown OGRE.
+		*/
+		virtual void remove(ResourceHandle handle);
+		/** Removes all resources.
+		@note
+			The word 'Destroy' is not used here, since
+			if any other pointers are referring to these resources, they will persist
+			until they have been finished with; however to all intents and purposes
+			the resources no longer exist and will get destroyed imminently.
+        @note
+            If you do have shared pointers to resources hanging around after the 
+            ResourceManager is destroyed, you may get problems on destruction of
+            these resources if they were relying on the manager (especially if
+            it is a plugin). If you find you get problems on shutdown in the
+            destruction of resources, try making sure you release all your
+            shared pointers before you shutdown OGRE.
+        */
+        virtual void removeAll(void);
+
+        /** Retrieves a pointer to a resource by name, or null if the resource does not exist.
+        */
+        virtual ResourcePtr getByName(const String& name);
+        /** Retrieves a pointer to a resource by handle, or null if the resource does not exist.
+        */
+        virtual ResourcePtr getByHandle(ResourceHandle handle);
+		
+		/// Returns whether the named resource exists in this manager
+		virtual bool resourceExists(const String& name)
+		{
+			return !getByName(name).isNull();
+		}
+		/// Returns whether a resource with the given handle exists in this manager
+		virtual bool resourceExists(ResourceHandle handle)
+		{
+			return !getByHandle(handle).isNull();
+		}
+
+		/** Notify this manager that a resource which it manages has been 
+			'touched', ie used. 
+		*/
+		virtual void _notifyResourceTouched(Resource* res);
+
+		/** Notify this manager that a resource which it manages has been 
+			loaded. 
+		*/
+		virtual void _notifyResourceLoaded(Resource* res);
+
+		/** Notify this manager that a resource which it manages has been 
+			unloaded.
+		*/
+		virtual void _notifyResourceUnloaded(Resource* res);
+
+		/** Generic load method, used to create a Resource specific to this 
+			ResourceManager without using one of the specialised 'load' methods
+			(containing per-Resource-type parameters).
+		@param name The name of the Resource
+		@param group The resource group to which this resource will belong
+		@param isManual Is the resource to be manually loaded? If so, you should
+			provide a value for the loader parameter
+		@param loader The manual loader which is to perform the required actions
+			when this resource is loaded; only applicable when you specify true
+			for the previous parameter
+        @param loadParams Optional pointer to a list of name/value pairs 
+            containing loading parameters for this type of resource.
+		*/
+		virtual ResourcePtr load(const String& name, 
+            const String& group, bool isManual = false, 
+			ManualResourceLoader* loader = 0, const NameValuePairList* loadParams = 0);
+
+		/** Gets the file patterns which should be used to find scripts for this
+			ResourceManager.
+		@remarks
+			Some resource managers can read script files in order to define
+			resources ahead of time. These resources are added to the available
+			list inside the manager, but none are loaded initially. This allows
+			you to load the items that are used on demand, or to load them all 
+			as a group if you wish (through ResourceGroupManager).
+		@par
+			This method lets you determine the file pattern which will be used
+			to identify scripts intended for this manager.
+		@returns
+			A list of file patterns, in the order they should be searched in.
+		@see isScriptingSupported, parseScript
+		*/
+		virtual const StringVector& getScriptPatterns(void) const { return mScriptPatterns; }
+
+		/** Parse the definition of a set of resources from a script file.
+		@remarks
+			Some resource managers can read script files in order to define
+			resources ahead of time. These resources are added to the available
+			list inside the manager, but none are loaded initially. This allows
+			you to load the items that are used on demand, or to load them all 
+			as a group if you wish (through ResourceGroupManager).
+		@param stream Weak reference to a data stream which is the source of the script
+		@param groupName The name of the resource group that resources which are
+			parsed are to become a member of. If this group is loaded or unloaded, 
+			then the resources discovered in this script will be loaded / unloaded
+			with it.
+		*/
+		virtual void parseScript(DataStreamPtr& stream, const String& groupName) {}
+
+		/** Gets the relative loading order of resources of this type.
+		@remarks
+			There are dependencies between some kinds of resource in terms of loading
+			order, and this value enumerates that. Higher values load later during
+			bulk loading tasks.
+		*/
+		virtual Real getLoadingOrder(void) const { return mLoadOrder; }
+
+		/** Gets a string identifying the type of resource this manager handles. */
+		const String& getResourceType(void) const { return mResourceType; }
+
+    protected:
+
+        /** Allocates the next handle. */
+        ResourceHandle getNextHandle(void);
+
+		/** Create a new resource instance compatible with this manager (no custom 
+			parameters are populated at this point). 
+		@remarks
+			Subclasses must override this method and create a subclass of Resource.
+		@param name The unique name of the resource
+		@param group The name of the resource group to attach this new resource to
+		@param isManual Is this resource manually loaded? If so, you should really
+			populate the loader parameter in order that the load process
+			can call the loader back when loading is required. 
+		@param loader Pointer to a ManualLoader implementation which will be called
+			when the Resource wishes to load (should be supplied if you set
+			isManual to true). You can in fact leave this parameter null 
+			if you wish, but the Resource will never be able to reload if 
+			anything ever causes it to unload. Therefore provision of a proper
+			ManualLoader instance is strongly recommended.
+        @param createParams If any parameters are required to create an instance,
+            they should be supplied here as name / value pairs. These do not need 
+            to be set on the instance (handled elsewhere), just used if required
+            to differentiate which concrete class is created.
+
+		*/
+		virtual Resource* createImpl(const String& name, ResourceHandle handle, 
+			const String& group, bool isManual, ManualResourceLoader* loader, 
+            const NameValuePairList* createParams) = 0;
+		/** Add a newly created resource to the manager (note weak reference) */
+		virtual void addImpl( ResourcePtr& res );
+		/** Remove a resource from this manager; remove it from the lists. */
+		virtual void removeImpl( ResourcePtr& res );
+		/** Checks memory usage and pages out if required.
+		*/
+		virtual void checkUsage(void);
+
+
+    public:
+		typedef HashMap< String, ResourcePtr > ResourceMap;
+		typedef std::map<ResourceHandle, ResourcePtr> ResourceHandleMap;
+    protected:
+        ResourceHandleMap mResourcesByHandle;
+        ResourceMap mResources;
+        ResourceHandle mNextHandle;
+        size_t mMemoryBudget; // In bytes
+        size_t mMemoryUsage; // In bytes
+
+		// IMPORTANT - all subclasses must populate the fields below
+
+		/// Patterns to use to look for scripts if supported (e.g. *.overlay)
+		StringVector mScriptPatterns; 
+		/// Loading order relative to other managers, higher is later
+		Real mLoadOrder; 
+		/// String identifying the resource type this manager handles
+		String mResourceType; 
+
+    public:
+        typedef MapIterator<ResourceHandleMap> ResourceMapIterator;
+        /** Returns an iterator over all resources in this manager. 
+        @note
+            Use of this iterator is NOT thread safe!
+        */
+        ResourceMapIterator getResourceIterator(void) 
+        {
+            return ResourceMapIterator(mResourcesByHandle.begin(), mResourcesByHandle.end());
+        }
+
+    
+
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgreRibbonTrail.h
===================================================================
--- /OgreMain/include/OgreRibbonTrail.h	(revision 5)
+++ /OgreMain/include/OgreRibbonTrail.h	(revision 5)
@@ -0,0 +1,224 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __RibbonTrail_H__
+#define __RibbonTrail_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreBillboardChain.h"
+#include "OgreNode.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreFrameListener.h"
+#include "OgreControllerManager.h"
+
+namespace Ogre {
+
+	/** Subclass of BillboardChain which automatically leaves a trail behind
+		one or more Node instances.
+	@remarks
+		An instance of this class will watch one or more Node instances, and
+		automatically generate a trail behind them as they move. Because this
+		class can monitor multiple modes, it generates its own geometry in 
+		world space and thus, even though it has to be attached to a SceneNode
+		to be visible, changing the position of the scene node it is attached to
+		makes no difference to the geometry rendered.
+	@par
+		The 'head' element grows smoothly in size until it reaches the required size,
+		then a new element is added. If the segment is full, the tail element
+		shrinks by the same proportion as the head grows before disappearing.
+	@par
+		Elements can be faded out on a time basis, either by altering their colour
+		or altering their alpha. The width can also alter over time.
+	@par
+		'v' texture coordinates are fixed at 0.0 if used, meaning that you can
+		use a 1D texture to 'smear' a colour pattern along the ribbon if you wish.
+		The 'u' coordinates are by default (0.0, 1.0), but you can alter this 
+		using setOtherTexCoordRange if you wish.
+	*/
+	class _OgreExport RibbonTrail : public BillboardChain, public Node::Listener
+	{
+	public:
+		/** Constructor (don't use directly, use factory) 
+		@param name The name to give this object
+		@param maxElements The maximum number of elements per chain
+		@param numberOfChains The number of separate chain segments contained in this object,
+			ie the maximum number of nodes that can have trails attached
+		@param useTextureCoords If true, use texture coordinates from the chain elements
+		@param useVertexColours If true, use vertex colours from the chain elements (must
+			be true if you intend to use fading)
+		*/
+		RibbonTrail(const String& name, size_t maxElements = 20, size_t numberOfChains = 1, 
+			bool useTextureCoords = true, bool useColours = true);
+		/// destructor
+		virtual ~RibbonTrail();
+
+		typedef std::vector<Node*> NodeList;
+		typedef ConstVectorIterator<NodeList> NodeIterator;
+
+		/** Add a node to be tracked.
+		@param n The node that will be tracked.
+		*/
+		virtual void addNode(Node* n);
+		/** Remove tracking on a given node. */
+		virtual void removeNode(Node* n);
+		/** Get an iterator over the nodes which are being tracked. */
+		virtual NodeIterator getNodeIterator(void) const;
+
+		/** Set the length of the trail. 
+		@remarks
+			This sets the length of the trail, in world units. It also sets how
+			far apart each segment will be, ie length / max_elements. 
+		@param len The length of the trail in world units
+		*/
+		virtual void setTrailLength(Real len);
+		/** Get the length of the trail. */
+		virtual Real getTrailLength(void) const { return mTrailLength; }
+
+		/** @copydoc BillboardChain::setMaxChainElements */
+		void setMaxChainElements(size_t maxElements);
+		/** @copydoc BillboardChain::setNumberOfChains */
+		void setNumberOfChains(size_t numChains);
+		/** @copydoc BillboardChain::clearChain */
+		void clearChain(size_t chainIndex);
+
+		/** Set the starting ribbon colour for a given segment. 
+		@param chainIndex The index of the chain
+		@param col The initial colour
+		@note
+			Only used if this instance is using vertex colours.
+		*/
+		virtual void setInitialColour(size_t chainIndex, const ColourValue& col);
+		/** Set the starting ribbon colour. 
+		@param chainIndex The index of the chain
+		@param r,b,g,a The initial colour
+		@note
+			Only used if this instance is using vertex colours.
+		*/
+		virtual void setInitialColour(size_t chainIndex, Real r, Real g, Real b, Real a = 1.0);
+		/** Get the starting ribbon colour. */
+		virtual const ColourValue& getInitialColour(size_t chainIndex) const;
+
+		/** Enables / disables fading the trail using colour. 
+		@param chainIndex The index of the chain
+		@param valuePerSecond The amount to subtract from colour each second
+		*/
+		virtual void setColourChange(size_t chainIndex, const ColourValue& valuePerSecond);
+
+		/** Set the starting ribbon width in world units. 
+		@param chainIndex The index of the chain
+		@param width The initial width of the ribbon
+		*/
+		virtual void setInitialWidth(size_t chainIndex, Real width);
+		/** Get the starting ribbon width in world units. */
+		virtual Real getInitialWidth(size_t chainIndex) const;
+		
+		/** Set the change in ribbon width per second. 
+		@param chainIndex The index of the chain
+		@param widthDeltaPerSecond The amount the width will reduce by per second
+		*/
+		virtual void setWidthChange(size_t chainIndex, Real widthDeltaPerSecond);
+		/** Get the change in ribbon width per second. */
+		virtual Real getWidthChange(size_t chainIndex) const;
+
+		/** Enables / disables fading the trail using colour. 
+		@param chainIndex The index of the chain
+		@param r,g,b,a The amount to subtract from each colour channel per second
+		*/
+		virtual void setColourChange(size_t chainIndex, Real r, Real g, Real b, Real a);
+
+		/** Get the per-second fading amount */
+		virtual const ColourValue& getColourChange(size_t chainIndex) const;
+
+		/// @see Node::Listener::nodeUpdated
+		void nodeUpdated(const Node* node);
+		/// @see Node::Listener::nodeDestroyed
+		void nodeDestroyed(const Node* node);
+
+		/// Perform any fading / width delta required; internal method
+		virtual void _timeUpdate(Real time);
+
+        /** Overridden from MovableObject */
+        const String& getMovableType(void) const;
+
+	protected:
+		/// List of nodes being trailed
+		NodeList mNodeList;
+		/// Total length of trail in world units
+		Real mTrailLength;
+		/// length of each element
+		Real mElemLength;
+		/// Squared length of each element
+		Real mSquaredElemLength;
+		typedef std::vector<ColourValue> ColourValueList;
+		typedef std::vector<Real> RealList;
+		/// Initial colour of the ribbon
+		ColourValueList mInitialColour;
+		/// fade amount per second
+		ColourValueList mDeltaColour;
+		/// Initial width of the ribbon
+		RealList mInitialWidth;
+		/// Delta width of the ribbon
+		RealList mDeltaWidth;
+		/// controller used to hook up frame time to fader
+		Controller<Real>* mFadeController;
+		/// controller value for hooking up frame time to fader
+		ControllerValueRealPtr mTimeControllerValue;
+
+		/// Manage updates to the time controller
+		virtual void manageController(void);
+		/// Node has changed position, update
+		virtual void updateTrail(size_t index, const Node* node);
+        /// Reset the tracked chain to initial state
+        virtual void resetTrail(size_t index, const Node* node);
+        /// Reset all tracked chains to initial state
+        virtual void resetAllTrails(void);
+
+	};
+
+
+	/** Factory object for creating RibbonTrail instances */
+	class _OgreExport RibbonTrailFactory : public MovableObjectFactory
+	{
+	protected:
+		MovableObject* createInstanceImpl( const String& name, const NameValuePairList* params);
+	public:
+		RibbonTrailFactory() {}
+		~RibbonTrailFactory() {}
+
+		static String FACTORY_TYPE_NAME;
+
+		const String& getType(void) const;
+		void destroyInstance( MovableObject* obj);  
+
+	};
+
+}
+
+#endif
Index: /OgreMain/include/OgreRoot.h
===================================================================
--- /OgreMain/include/OgreRoot.h	(revision 5)
+++ /OgreMain/include/OgreRoot.h	(revision 5)
@@ -0,0 +1,844 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ROOT__
+#define __ROOT__
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+
+#include "OgreSingleton.h"
+#include "OgreString.h"
+#include "OgreSceneManagerEnumerator.h"
+#include "OgreResourceGroupManager.h"
+
+#include <exception>
+
+namespace Ogre
+{
+    typedef std::vector<RenderSystem*> RenderSystemList;
+	
+    /** The root class of the Ogre system.
+        @remarks
+            The Ogre::Root class represents a starting point for the client
+            application. From here, the application can gain access to the
+            fundamentals of the system, namely the rendering systems
+            available, management of saved configurations, logging, and
+            access to other classes in the system. Acts as a hub from which
+            all other objects may be reached. An instance of Root must be
+            created before any other Ogre operations are called. Once an
+            instance has been created, the same instance is accessible
+            throughout the life of that object by using Root::getSingleton
+            (as a reference) or Root::getSingletonPtr (as a pointer).
+    */
+    class _OgreExport Root : public Singleton<Root>
+    {
+        // To allow update of active renderer if
+        // RenderSystem::initialise is used directly
+        friend class RenderSystem;
+    private:
+        RenderSystemList mRenderers;
+        RenderSystem* mActiveRenderer;
+        String mVersion;
+		String mConfigFileName;
+	    bool mQueuedEnd;
+        // In case multiple render windows are created, only once are the resources loaded.
+        bool mFirstTimePostWindowInit;
+
+        // Singletons
+        LogManager* mLogManager;
+        ControllerManager* mControllerManager;
+        SceneManagerEnumerator* mSceneManagerEnum;
+        SceneManager* mCurrentSceneManager;
+        DynLibManager* mDynLibManager;
+        ArchiveManager* mArchiveManager;
+        MaterialManager* mMaterialManager;
+        MeshManager* mMeshManager;
+        ParticleSystemManager* mParticleManager;
+        SkeletonManager* mSkeletonManager;
+        OverlayElementFactory* mPanelFactory;
+        OverlayElementFactory* mBorderPanelFactory;
+        OverlayElementFactory* mTextAreaFactory;
+        OverlayManager* mOverlayManager;
+        FontManager* mFontManager;
+        ArchiveFactory *mZipArchiveFactory;
+        ArchiveFactory *mFileSystemArchiveFactory;
+		ResourceGroupManager* mResourceGroupManager;
+		ResourceBackgroundQueue* mResourceBackgroundQueue;
+		ShadowTextureManager* mShadowTextureManager;
+
+        Timer* mTimer;
+        RenderWindow* mAutoWindow;
+        Profiler* mProfiler;
+        HighLevelGpuProgramManager* mHighLevelGpuProgramManager;
+		ExternalTextureSourceManager* mExternalTextureSourceManager;
+        CompositorManager* mCompositorManager;      
+        unsigned long mCurrentFrame;
+		Real mFrameSmoothingTime;
+
+	public:
+		typedef std::vector<DynLib*> PluginLibList;
+		typedef std::vector<Plugin*> PluginInstanceList;
+	protected:
+		/// List of plugin DLLs loaded
+        PluginLibList mPluginLibs;
+		/// List of Plugin instances registered
+		PluginInstanceList mPlugins;
+
+		typedef std::map<String, MovableObjectFactory*> MovableObjectFactoryMap;
+		MovableObjectFactoryMap mMovableObjectFactoryMap;
+		uint32 mNextMovableObjectTypeFlag;
+		// stock movable factories
+		MovableObjectFactory* mEntityFactory;
+		MovableObjectFactory* mLightFactory;
+		MovableObjectFactory* mBillboardSetFactory;
+		MovableObjectFactory* mManualObjectFactory;
+		MovableObjectFactory* mBillboardChainFactory;
+		MovableObjectFactory* mRibbonTrailFactory;
+
+		typedef std::map<String, RenderQueueInvocationSequence*> RenderQueueInvocationSequenceMap;
+		RenderQueueInvocationSequenceMap mRQSequenceMap;
+
+		/// Are we initialised yet?
+		bool mIsInitialised;
+
+        /** Method reads a plugins configuration file and instantiates all
+            plugins.
+            @param
+                pluginsfile The file that contains plugins information.
+                Defaults to "plugins.cfg".
+        */
+        void loadPlugins( const String& pluginsfile = "plugins.cfg" );
+		/** Initialise all loaded plugins - allows plugins to perform actions
+			once the renderer is initialised.
+		*/
+		void initialisePlugins();
+		/** Shuts down all loaded plugins - allows things to be tidied up whilst
+			all plugins are still loaded.
+		*/
+		void shutdownPlugins();
+
+		/** Unloads all loaded plugins.
+        */
+        void unloadPlugins();
+
+        // Internal method for one-time tasks after first window creation
+        void oneTimePostWindowInit(void);
+
+        /** Set of registered frame listeners */
+        std::set<FrameListener*> mFrameListeners;
+
+        /** Set of frame listeners marked for removal*/
+        std::set<FrameListener*> mRemovedFrameListeners;
+
+        /** Indicates the type of event to be considered by calculateEventTime(). */
+        enum FrameEventTimeType {
+            FETT_ANY, FETT_STARTED, FETT_ENDED
+        };
+
+        /// Contains the times of recently fired events
+        std::deque<unsigned long> mEventTimes[3];
+
+        /** Internal method for calculating the average time between recently fired events.
+        @param now The current time in ms.
+        @param type The type of event to be considered.
+        */
+        Real calculateEventTime(unsigned long now, FrameEventTimeType type);
+    public:
+
+        /** Constructor
+        @param pluginFileName The file that contains plugins information.
+            Defaults to "plugins.cfg", may be left blank to ignore.
+		@param configFileName The file that contains the configuration to be loaded.
+			Defaults to "ogre.cfg", may be left blank to load nothing.
+		@param logFileName The logfile to create, defaults to Ogre.log, may be 
+			left blank if you've already set up LogManager & Log yourself
+		*/
+        Root(const String& pluginFileName = "plugins.cfg", 
+			const String& configFileName = "ogre.cfg", 
+			const String& logFileName = "Ogre.log");
+        ~Root();
+
+        /** Saves the details of the current configuration
+            @remarks
+                Stores details of the current configuration so it may be
+                restored later on.
+        */
+        void saveConfig(void);
+
+        /** Checks for saved video/sound/etc settings
+            @remarks
+                This method checks to see if there is a valid saved configuration
+                from a previous run. If there is, the state of the system will
+                be restored to that configuration.
+
+            @returns
+                If a valid configuration was found, <b>true</b> is returned.
+            @par
+                If there is no saved configuration, or if the system failed
+                with the last config settings, <b>false</b> is returned.
+        */
+        bool restoreConfig(void);
+
+        /** Displays a dialog asking the user to choose system settings.
+            @remarks
+                This method displays the default dialog allowing the user to
+                choose the renderering system, video mode etc. If there is are
+                any settings saved already, they will be restored automatically
+                before displaying the dialogue. When the user accepts a group of
+                settings, this will automatically call Root::setRenderSystem,
+                RenderSystem::setConfigOption and Root::saveConfig with the
+                user's choices. This is the easiest way to get the system
+                configured.
+            @returns
+                If the user clicked 'Ok', <b>true</b> is returned.
+            @par
+                If they clicked 'Cancel' (in which case the app should
+                strongly consider terminating), <b>false</b> is returned.
+         */
+        bool showConfigDialog(void);
+
+        /** Adds a new rendering subsystem to the list of available renderers.
+            @remarks
+                Intended for use by advanced users and plugin writers only!
+                Calling this method with a pointer to a valid RenderSystem
+                (sublcass) adds a rendering API implementation to the list of
+                available ones. Typical examples would be an OpenGL
+                implementation and a Direct3D implementation.
+            @note
+                <br>This should usually be called from the dllStartPlugin()
+                function of an extension plug-in.
+        */
+        void addRenderSystem(RenderSystem* newRend);
+
+        /** Retrieve a list of the available render systems.
+            @remarks
+                Retrieves a pointer to the list of available renderers as a
+                list of RenderSystem subclasses. Can be used to build a
+                custom settings dialog.
+        */
+        RenderSystemList* getAvailableRenderers(void);
+
+        /** Retrieve a pointer to the render system by the given name
+            @param
+                name Name of the render system intend to retrieve.
+            @returns
+                A pointer to the render system, <b>NULL</b> if no found.
+        */
+        RenderSystem* getRenderSystemByName(const String& name);
+
+        /** Sets the rendering subsystem to be used.
+            @remarks
+                This method indicates to OGRE which rendering system is to be
+                used (e.g. Direct3D, OpenGL etc). This is called
+                automatically by the default config dialog, and when settings
+                are restored from a previous configuraion. If used manually
+                it could be used to set the renderer from a custom settings
+                dialog. Once this has been done, the renderer can be
+                initialised using Root::initialise.
+            @par
+                This method is also called by render systems if they are
+                initialised directly.
+            @param
+                system Pointer to the render system to use.
+            @see
+                RenderSystem
+        */
+        void setRenderSystem(RenderSystem* system);
+
+        /** Retrieve a pointer to the currently selected render system.
+        */
+        RenderSystem* getRenderSystem(void);
+
+        /** Initialises the renderer.
+            @remarks
+                This method can only be called after a renderer has been
+                selected with Root::setRenderSystem, and it will initialise
+                the selected rendering system ready for use.
+            @param
+                autoCreateWindow If true, a rendering window will
+                automatically be created (saving a call to
+                RenderSystem::createRenderWindow). The window will be
+                created based on the options currently set on the render
+                system.
+            @returns
+                A pointer to the automatically created window, if
+                requested, otherwise <b>NULL</b>.
+        */
+	    RenderWindow* initialise(bool autoCreateWindow, const String& windowTitle = "OGRE Render Window");
+
+		/** Returns whether the system is initialised or not. */
+		bool isInitialised(void) const { return mIsInitialised; }
+
+		/** Register a new SceneManagerFactory, a factory object for creating instances
+			of specific SceneManagers. 
+		@remarks
+			Plugins should call this to register as new SceneManager providers.
+		*/
+		void addSceneManagerFactory(SceneManagerFactory* fact);
+
+		/** Unregister a SceneManagerFactory.
+		*/
+		void removeSceneManagerFactory(SceneManagerFactory* fact);
+
+		/** Get more information about a given type of SceneManager.
+		@remarks
+			The metadata returned tells you a few things about a given type 
+			of SceneManager, which can be created using a factory that has been
+			registered already. 
+		@param typeName The type name of the SceneManager you want to enquire on.
+			If you don't know the typeName already, you can iterate over the 
+			metadata for all types using getMetaDataIterator.
+		*/
+		const SceneManagerMetaData* getSceneManagerMetaData(const String& typeName) const;
+
+		/** Iterate over all types of SceneManager available for construction, 
+			providing some information about each one.
+		*/
+		SceneManagerEnumerator::MetaDataIterator getSceneManagerMetaDataIterator(void) const;
+
+		/** Create a SceneManager instance of a given type.
+		@remarks
+			You can use this method to create a SceneManager instance of a 
+			given specific type. You may know this type already, or you may
+			have discovered it by looking at the results from getMetaDataIterator.
+		@note
+			This method throws an exception if the named type is not found.
+		@param typeName String identifying a unique SceneManager type
+		@param instanceName Optional name to given the new instance that is
+			created. If you leave this blank, an auto name will be assigned.
+		*/
+		SceneManager* createSceneManager(const String& typeName, 
+			const String& instanceName = StringUtil::BLANK);
+
+		/** Create a SceneManager instance based on scene type support.
+		@remarks
+			Creates an instance of a SceneManager which supports the scene types
+			identified in the parameter. If more than one type of SceneManager 
+			has been registered as handling that combination of scene types, 
+			in instance of the last one registered is returned.
+		@note This method always succeeds, if a specific scene manager is not
+			found, the default implementation is always returned.
+		@param typeMask A mask containing one or more SceneType flags
+		@param instanceName Optional name to given the new instance that is
+			created. If you leave this blank, an auto name will be assigned.
+		*/
+		SceneManager* createSceneManager(SceneTypeMask typeMask, 
+			const String& instanceName = StringUtil::BLANK);
+
+		/** Destroy an instance of a SceneManager. */
+		void destroySceneManager(SceneManager* sm);
+
+		/** Get an existing SceneManager instance that has already been created,
+			identified by the instance name.
+		@param instanceName The name of the instance to retrieve.
+		*/
+		SceneManager* getSceneManager(const String& instanceName) const;
+
+		/** Get an iterator over all the existing SceneManager instances. */
+		SceneManagerEnumerator::SceneManagerIterator getSceneManagerIterator(void);
+
+        /** Retrieves a reference to the current TextureManager.
+            @remarks
+                This performs the same function as
+                TextureManager::getSingleton, but is provided for convenience
+                particularly to scripting engines.
+            @par
+                Note that a TextureManager will NOT be available until the
+                Ogre system has been initialised by selecting a RenderSystem,
+                calling Root::initialise and a window having been created
+                (this may have been done by initialise if required). This is
+                because the exact runtime subclass which will be implementing
+                the calls will differ depending on the rendering engine
+                selected, and these typically require a window upon which to
+                base texture format decisions.
+        */
+        TextureManager* getTextureManager(void);
+
+        /** Retrieves a reference to the current MeshManager.
+            @remarks
+                This performs the same function as MeshManager::getSingleton
+                and is provided for convenience to scripting engines.
+        */
+        MeshManager* getMeshManager(void);
+
+        /** Utility function for getting a better description of an error
+            code.
+        */
+        String getErrorDescription(long errorNumber);
+
+        /** Registers a FrameListener which will be called back every frame.
+            @remarks
+                A FrameListener is a class which implements methods which
+                will be called every frame.
+            @par
+                See the FrameListener class for more details on the specifics
+                It is imperitive that the instance passed to this method is
+                not destroyed before either the rendering loop ends, or the
+                class is removed from the listening list using
+                removeFrameListener.
+            @note
+                <br>This method can only be called after Root::initialise has
+                been called.
+            @see
+                FrameListener, Root::removeFrameListener
+        */
+        void addFrameListener(FrameListener* newListener);
+
+        /** Removes a FrameListener from the list of listening classes.
+            @see
+                FrameListener, Root::addFrameListener
+        */
+        void removeFrameListener(FrameListener* oldListener);
+
+        /** Queues the end of rendering.
+            @remarks
+                This method will do nothing unless startRendering() has
+                been called, in which case before the next frame is rendered
+                the rendering loop will bail out.
+            @see
+                Root, Root::startRendering
+        */
+        void queueEndRendering(void);
+
+        /** Starts / restarts the automatic rendering cycle.
+            @remarks
+                This method begins the automatic rendering of the scene. It
+                will <b>NOT</b> return until the rendering cycle is halted.
+            @par
+                During rendering, any FrameListener classes registered using
+                addFrameListener will be called back for each frame that is
+                to be rendered, These classes can tell OGRE to halt the
+                rendering if required, which will cause this method to
+                return.
+            @note
+                <br>Users of the OGRE library do not have to use this
+                automatic rendering loop. It is there as a convenience and is
+                most useful for high frame rate applications e.g. games. For
+                applications that don't need to constantly refresh the
+                rendering targets (e.g. an editor utility), it is better to
+                manually refresh each render target only when required by
+                calling RenderTarget::update, or if you want to run your own
+				render loop you can update all targets on demand using
+				Root::renderOneFrame.
+            @note
+                This frees up the CPU to do other things in between
+                refreshes, since in this case frame rate is less important.
+            @note
+                This method can only be called after Root::initialise has
+                been called.
+        */
+        void startRendering(void);
+
+        /** Render one frame. 
+        @remarks
+            Updates all the render targets automatically and then returns,
+            raising frame events before and after.
+        */
+        bool renderOneFrame(void);
+        /** Shuts down the system manually.
+            @remarks
+                This is normally done by Ogre automatically so don't think
+                you have to call this yourself. However this is here for
+                convenience, especially for dealing with unexpected errors or
+                for systems which need to shut down Ogre on demand.
+        */
+        void shutdown(void);
+
+        /** Adds a location to the list of searchable locations for a
+            Resource type.
+            @remarks
+                Resource files (textures, models etc) need to be loaded from
+                specific locations. By calling this method, you add another 
+				search location to the list. Locations added first are preferred
+				over locations added later.
+            @par
+                Locations can be folders, compressed archives, even perhaps
+                remote locations. Facilities for loading from different
+                locations are provided by plugins which provide
+                implementations of the Archive class.
+                All the application user has to do is specify a 'loctype'
+                string in order to indicate the type of location, which
+                should map onto one of the provided plugins. Ogre comes
+                configured with the 'FileSystem' (folders) and 'Zip' (archive
+                compressed with the pkzip / WinZip etc utilities) types.
+            @par
+				You can also supply the name of a resource group which should
+				have this location applied to it. The 
+				ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME group is the
+				default, and one resource group which will always exist. You
+				should consider defining resource groups for your more specific
+				resources (e.g. per level) so that you can control loading /
+				unloading better.
+            @param
+                name The name of the location, e.g. './data' or
+                '/compressed/gamedata.zip'
+            @param
+                locType A string identifying the location type, e.g.
+                'FileSystem' (for folders), 'Zip' etc. Must map to a
+                registered plugin which deals with this type (FileSystem and
+                Zip should always be available)
+            @param
+                groupName Type of name of the resource group which this location
+				should apply to; defaults to the General group which applies to
+				all non-specific resources.
+			@param
+				recursive If the resource location has a concept of recursive
+				directory traversal, enabling this option will mean you can load
+				resources in subdirectories using only their unqualified name.
+				The default is to disable this so that resources in subdirectories
+				with the same name are still unique.
+            @see
+                Archive
+        */
+        void addResourceLocation(const String& name, const String& locType, 
+			const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+			bool recursive = false);
+
+		/** Removes a resource location from the list.
+		@see addResourceLocation
+		@param name The name of the resource location as specified in addResourceLocation
+		@param groupName The name of the resource group to which this location 
+			was assigned.
+		*/
+		void removeResourceLocation(const String& name, 
+			const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+
+        /** Generates a packed data version of the passed in ColourValue suitable for
+            use with the current RenderSystem.
+        @remarks
+            Since different render systems have different colour data formats (eg
+            RGBA for GL, ARGB for D3D) this method allows you to use 1 method for all.
+        @param colour The colour to convert
+        @param pDest Pointer to location to put the result.
+        */
+        void convertColourValue(const ColourValue& colour, uint32* pDest);
+
+        /** Retrieves a pointer to the window that was created automatically
+            @remarks
+                When Root is initialised an optional window is created. This
+                method retreives a pointer to that window.
+            @note
+                returns a null pointer when Root has not been initialised with
+                the option of creating a window.
+        */
+        RenderWindow* getAutoCreatedWindow(void);
+
+        /** @copydoc RenderSystem::createRenderWindow
+        */
+		RenderWindow* createRenderWindow(const String &name, unsigned int width, unsigned int height, 
+			bool fullScreen, const NameValuePairList *miscParams = 0) ;
+
+        /** Destroys a rendering window.
+        */
+        void detachRenderTarget( RenderTarget* pWin );
+
+        /** Destroys a named rendering window.
+        */
+        void detachRenderTarget( const String & name );
+
+        /** Retrieves a pointer to the a named render window.
+        */
+        RenderTarget * getRenderTarget(const String &name);
+
+		/** Manually load a Plugin contained in a DLL / DSO.
+		 @remarks
+		 	Plugins embedded in DLLs can be loaded at startup using the plugin 
+			configuration file specified when you create Root (default: plugins.cfg).
+			This method allows you to load plugin DLLs directly in code.
+			The DLL in question is expected to implement a dllStartPlugin 
+			method which instantiates a Plugin subclass and calls Root::installPlugin.
+			It should also implement dllStopPlugin (see Root::unloadPlugin)
+		@param pluginName Name of the plugin library to load
+		*/
+		void loadPlugin(const String& pluginName);
+
+		/** Manually unloads a Plugin contained in a DLL / DSO.
+		 @remarks
+		 	Plugin DLLs are unloaded at shutdown automatically. This method 
+			allows you to unload plugins in code, but make sure their 
+			dependencies are decoupled first. This method will call the 
+			dllStopPlugin method defined in the DLL, which in turn should call
+			Root::uninstallPlugin.
+		@param pluginName Name of the plugin library to unload
+		*/
+		void unloadPlugin(const String& pluginName);
+
+		/** Install a new plugin.
+		@remarks
+			This installs a new extension to OGRE. The plugin itself may be loaded
+			from a DLL / DSO, or it might be statically linked into your own 
+			application. Either way, something has to call this method to get
+			it registered and functioning. You should only call this method directly
+			if your plugin is not in a DLL that could otherwise be loaded with 
+			loadPlugin, since the DLL function dllStartPlugin should call this
+			method when the DLL is loaded. 
+		*/
+		void installPlugin(Plugin* plugin);
+
+		/** Uninstall an existing plugin.
+		@remarks
+			This uninstalls an extension to OGRE. Plugins are automatically 
+			uninstalled at shutdown but this lets you remove them early. 
+			If the plugin was loaded from a DLL / DSO you should call unloadPlugin
+			which should result in this method getting called anyway (if the DLL
+			is well behaved).
+		*/
+		void uninstallPlugin(Plugin* plugin);
+
+		/** Gets a read-only list of the currently installed plugins. */
+		const PluginInstanceList& getInstalledPlugins() const { return mPlugins; }
+
+        /** Gets a pointer to the central timer used for all OGRE timings */
+        Timer* getTimer(void);
+
+        /** Method for raising frame started events. 
+        @remarks
+            This method is only for internal use when you use OGRE's inbuilt rendering
+            loop (Root::startRendering). However, if you run your own rendering loop then
+            you should call this method to ensure that FrameListener objects are notified
+            of frame events; processes like texture animation and particle systems rely on 
+            this.
+        @par
+            Calling this method also increments the frame number, which is
+            important for keeping some elements of the engine up to date.
+        @note
+            This method takes an event object as a parameter, so you can specify the times
+            yourself. If you are happy for OGRE to automatically calculate the frame time
+            for you, then call the other version of this method with no parameters.
+        @param evt Event object which includes all the timing information which you have 
+            calculated for yourself
+        @returns False if one or more frame listeners elected that the rendering loop should
+            be terminated, true otherwise.
+        */
+        bool _fireFrameStarted(FrameEvent& evt);
+        /** Method for raising frame ended events. 
+        @remarks
+            This method is only for internal use when you use OGRE's inbuilt rendering
+            loop (Root::startRendering). However, if you run your own rendering loop then
+            you should call this method to ensure that FrameListener objects are notified
+            of frame events; processes like texture animation and particle systems rely on 
+            this.
+        @note
+            This method takes an event object as a parameter, so you can specify the times
+            yourself. If you are happy for OGRE to automatically calculate the frame time
+            for you, then call the other version of this method with no parameters.
+        @param evt Event object which includes all the timing information which you have 
+            calculated for yourself
+        @returns False if one or more frame listeners elected that the rendering loop should
+            be terminated, true otherwise.
+        */
+        bool _fireFrameEnded(FrameEvent& evt);
+        /** Method for raising frame started events. 
+        @remarks
+            This method is only for internal use when you use OGRE's inbuilt rendering
+            loop (Root::startRendering). However, if you run your own rendering loop then
+            you should call this method to ensure that FrameListener objects are notified
+            of frame events; processes like texture animation and particle systems rely on 
+            this.
+        @par
+            Calling this method also increments the frame number, which is
+            important for keeping some elements of the engine up to date.
+        @note
+            This method calculates the frame timing information for you based on the elapsed
+            time. If you want to specify elapsed times yourself you should call the other 
+            version of this method which takes event details as a parameter.
+        @returns False if one or more frame listeners elected that the rendering loop should
+            be terminated, true otherwise.
+        */
+        bool _fireFrameStarted();
+        /** Method for raising frame ended events. 
+        @remarks
+            This method is only for internal use when you use OGRE's inbuilt rendering
+            loop (Root::startRendering). However, if you run your own rendering loop then
+            you should call this method to ensure that FrameListener objects are notified
+            of frame events; processes like texture animation and particle systems rely on 
+            this.
+        @note
+            This method calculates the frame timing information for you based on the elapsed
+            time. If you want to specify elapsed times yourself you should call the other 
+            version of this method which takes event details as a parameter.
+        @returns False if one or more frame listeners elected that the rendering loop should
+            be terminated, true otherwise.
+        */
+        bool _fireFrameEnded();
+
+        /** Gets the number of the current frame. */
+        unsigned long getCurrentFrameNumber(void) const { return mCurrentFrame; }
+
+        /** Returns the scene manager currently being used to render a frame.
+        @remarks
+            This is only intended for internal use; it is only valid during the
+            rendering of a frame.
+        */
+        SceneManager* _getCurrentSceneManager(void) const { return mCurrentSceneManager; }
+        /** Sets the scene manager currently being used to render a frame.
+        @remarks
+            This is only intended for internal use.
+        */
+        void _setCurrentSceneManager(SceneManager* sm);
+
+        /** Internal method used for updating all RenderTarget objects (windows, 
+            renderable textures etc) which are set to auto-update.
+        @remarks
+            You don't need to use this method if you're using Ogre's own internal
+            rendering loop (Root::startRendering). If you're running your own loop
+            you may wish to call it to update all the render targets which are
+            set to auto update (RenderTarget::setAutoUpdated). You can also update
+            individual RenderTarget instances using their own update() method.
+        */
+        void _updateAllRenderTargets(void);
+
+		/** Create a new RenderQueueInvocationSequence, useful for linking to
+			Viewport instances to perform custom rendering.
+		@param name The name to give the new sequence
+		*/
+		RenderQueueInvocationSequence* createRenderQueueInvocationSequence(
+			const String& name);
+
+		/** Get a RenderQueueInvocationSequence. 
+		@param name The name to identify the sequence
+		*/
+		RenderQueueInvocationSequence* getRenderQueueInvocationSequence(
+			const String& name);
+
+		/** Destroy a RenderQueueInvocationSequence. 
+		@remarks
+			You must ensure that no Viewports are using this sequence.
+		@param name The name to identify the sequence
+		*/
+		void destroyRenderQueueInvocationSequence(
+			const String& name);
+
+		/** Destroy all RenderQueueInvocationSequences. 
+		@remarks
+			You must ensure that no Viewports are using custom sequences.
+		@param name The name to identify the sequence
+		*/
+		void destroyAllRenderQueueInvocationSequences(void);
+
+        /** Override standard Singleton retrieval.
+            @remarks
+                Why do we do this? Well, it's because the Singleton
+                implementation is in a .h file, which means it gets compiled
+                into anybody who includes it. This is needed for the
+                Singleton template to work, but we actually only want it
+                compiled into the implementation of the class based on the
+                Singleton, not all of them. If we don't change this, we get
+                link errors when trying to use the Singleton-based class from
+                an outside dll.
+            @par
+                This method just delegates to the template version anyway,
+                but the implementation stays in this single compilation unit,
+                preventing link errors.
+        */
+        static Root& getSingleton(void);
+        /** Override standard Singleton retrieval.
+            @remarks
+                Why do we do this? Well, it's because the Singleton
+                implementation is in a .h file, which means it gets compiled
+                into anybody who includes it. This is needed for the
+                Singleton template to work, but we actually only want it
+                compiled into the implementation of the class based on the
+                Singleton, not all of them. If we don't change this, we get
+                link errors when trying to use the Singleton-based class from
+                an outside dll.
+            @par
+                This method just delegates to the template version anyway,
+                but the implementation stays in this single compilation unit,
+                preventing link errors.
+        */
+        static Root* getSingletonPtr(void);
+
+		/** Clears the history of all event times. 
+		@remarks
+			OGRE stores a history of the last few event times in order to smooth
+			out any inaccuracies and temporary fluctuations. However, if you 
+			pause or don't render for a little while this can cause a lurch, so
+			if you're resuming rendering after a break, call this method to reset
+			the stored times
+		*/
+		void clearEventTimes(void);
+
+		/** Sets the period over which OGRE smooths out fluctuations in frame times.
+		@remarks
+			OGRE by default gives you the raw frame time, but can optionally
+			smooths it out over several frames, in order to reduce the 
+			noticeable effect of occasional hiccups in framerate.
+			These smoothed values are passed back as parameters to FrameListener
+			calls.
+		@par
+			This method allow you to tweak the smoothing period, and is expressed
+			in seconds. Setting it to 0 will result in completely unsmoothed
+			frame times (the default).
+		*/
+		void setFrameSmoothingPeriod(Real period) { mFrameSmoothingTime = period; }
+		/** Gets the period over which OGRE smooths out fluctuations in frame times. */
+		Real getFrameSmoothingPeriod(void) const { return mFrameSmoothingTime; }
+
+		/** Register a new MovableObjectFactory which will create new MovableObject
+			instances of a particular type, as identified by the getType() method.
+		@remarks
+			Plugin creators can create subclasses of MovableObjectFactory which 
+			construct custom subclasses of MovableObject for insertion in the 
+			scene. This is the primary way that plugins can make custom objects
+			available.
+		@param fact Pointer to the factory instance
+		@param overrideExisting Set this to true to override any existing 
+			factories which are registered for the same type. You should only
+			change this if you are very sure you know what you're doing. 
+		*/
+		void addMovableObjectFactory(MovableObjectFactory* fact, 
+			bool overrideExisting = false);
+		/** Removes a previously registered MovableObjectFactory.
+		@remarks
+			All instances of objects created by this factory will be destroyed
+			before removing the factory (by calling back the factories 
+			'destroyInstance' method). The plugin writer is responsible for actually
+			destroying the factory.
+		*/
+		void removeMovableObjectFactory(MovableObjectFactory* fact);
+		/// Checks whether a factory is registered for a given MovableObject type
+		bool hasMovableObjectFactory(const String& typeName) const;
+		/// Get a MovableObjectFactory for the given type
+		MovableObjectFactory* getMovableObjectFactory(const String& typeName);
+		/** Allocate the next MovableObject type flag.
+		@remarks
+			This is done automatically if MovableObjectFactory::requestTypeFlags
+			returns true; don't call this manually unless you're sure you need to.
+		*/
+		uint32 _allocateNextMovableObjectTypeFlag(void);
+
+		typedef ConstMapIterator<MovableObjectFactoryMap> MovableObjectFactoryIterator;
+		/** Return an iterator over all the MovableObjectFactory instances currently
+			registered.
+		*/
+		MovableObjectFactoryIterator getMovableObjectFactoryIterator(void) const;
+    };
+} // Namespace Ogre
+#endif
Index: /OgreMain/include/OgreRotationalSpline.h
===================================================================
--- /OgreMain/include/OgreRotationalSpline.h	(revision 5)
+++ /OgreMain/include/OgreRotationalSpline.h	(revision 5)
@@ -0,0 +1,129 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RotationalSpline_H__
+#define __RotationalSpline_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreQuaternion.h"
+
+namespace Ogre {
+
+    /** This class interpolates orientations (rotations) along a spline using 
+        derivatives of quaternions.
+    @remarks
+        Like the SimpleSpline class, this class is about interpolating values 
+        smoothly over a spline. Whilst SimpleSpline deals with positions (the normal
+        sense we think about splines), this class interpolates orientations. The
+        theory is identical, except we're now in 4-dimensional space instead of 3.
+    @par
+        In positional splines, we use the points and tangents on those points to generate
+        control points for the spline. In this case, we use quaternions and derivatives
+        of the quaternions (i.e. the rate and direction of change at each point). This is the
+        same as SimpleSpline since a tangent is a derivative of a position. We effectively 
+        generate an extra quaternion in between each actual quaternion which when take with 
+        the original quaternion forms the 'tangent' of that quaternion.
+    */
+    class _OgreExport RotationalSpline
+    {
+    public:
+        RotationalSpline();
+        ~RotationalSpline();
+
+        /** Adds a control point to the end of the spline. */
+        void addPoint(const Quaternion& p);
+
+        /** Gets the detail of one of the control points of the spline. */
+        const Quaternion& getPoint(unsigned short index) const;
+
+        /** Gets the number of control points in the spline. */
+        unsigned short getNumPoints(void) const;
+
+        /** Clears all the points in the spline. */
+        void clear(void);
+
+        /** Updates a single point in the spline. 
+        @remarks
+            This point must already exist in the spline.
+        */
+        void updatePoint(unsigned short index, const Quaternion& value);
+
+        /** Returns an interpolated point based on a parametric value over the whole series.
+        @remarks
+            Given a t value between 0 and 1 representing the parametric distance along the
+            whole length of the spline, this method returns an interpolated point.
+        @param t Parametric value.
+		@param useShortestPath Defines if rotation should take the shortest possible path
+        */
+        Quaternion interpolate(Real t, bool useShortestPath=true);
+
+        /** Interpolates a single segment of the spline given a parametric value.
+        @param fromIndex The point index to treat as t=0. fromIndex + 1 is deemed to be t=1
+        @param t Parametric value
+		@param useShortestPath Defines if rotation should take the shortest possible path
+        */
+        Quaternion interpolate(unsigned int fromIndex, Real t, bool useShortestPath=true);
+
+        /** Tells the spline whether it should automatically calculate tangents on demand
+            as points are added.
+        @remarks
+            The spline calculates tangents at each point automatically based on the input points.
+            Normally it does this every time a point changes. However, if you have a lot of points
+            to add in one go, you probably don't want to incur this overhead and would prefer to 
+            defer the calculation until you are finished setting all the points. You can do this
+            by calling this method with a parameter of 'false'. Just remember to manually call 
+            the recalcTangents method when you are done.
+        @param autoCalc If true, tangents are calculated for you whenever a point changes. If false, 
+            you must call reclacTangents to recalculate them when it best suits.
+        */
+        void setAutoCalculate(bool autoCalc);
+
+        /** Recalculates the tangents associated with this spline. 
+        @remarks
+            If you tell the spline not to update on demand by calling setAutoCalculate(false)
+            then you must call this after completing your updates to the spline points.
+        */
+        void recalcTangents(void);
+
+    protected:
+
+        bool mAutoCalc;
+
+
+
+        std::vector<Quaternion> mPoints;
+        std::vector<Quaternion> mTangents;
+
+    };
+
+
+}
+
+
+#endif
+
Index: /OgreMain/include/OgreSceneManager.h
===================================================================
--- /OgreMain/include/OgreSceneManager.h	(revision 5)
+++ /OgreMain/include/OgreSceneManager.h	(revision 5)
@@ -0,0 +1,2871 @@
+/*-------------------------------------------------------------------------
+This source file is a part of OGRE
+(Object-oriented Graphics Rendering Engine)
+
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License (LGPL) as 
+published by the Free Software Foundation; either version 2.1 of the 
+License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful, but 
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
+or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License 
+along with this library; if not, write to the Free Software Foundation, 
+Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA or go to
+http://www.gnu.org/copyleft/lesser.txt
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-------------------------------------------------------------------------*/
+#ifndef __SceneManager_H__
+#define __SceneManager_H__
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+
+#include "OgreString.h"
+#include "OgreSceneNode.h"
+#include "OgrePlane.h"
+#include "OgreQuaternion.h"
+#include "OgreColourValue.h"
+#include "OgreCommon.h"
+#include "OgreSceneQuery.h"
+#include "OgreAutoParamDataSource.h"
+#include "OgreAnimationState.h"
+#include "OgreRenderQueue.h"
+#include "OgreRenderQueueSortingGrouping.h"
+#include "OgreRectangle2D.h"
+#include "OgrePixelFormat.h"
+#include "OgreResourceGroupManager.h"
+#include "OgreTexture.h"
+#include "OgreShadowCameraSetup.h"
+#include "OgreShadowTextureManager.h"
+#include "OgreCamera.h"
+#include "OgreInstancedGeometry.h"
+
+namespace Ogre {
+
+    /** Structure for holding a position & orientation pair. */
+    struct ViewPoint
+    {
+        Vector3 position;
+        Quaternion orientation;
+    };
+
+	// Forward declarations
+	class DefaultIntersectionSceneQuery;
+	class DefaultRaySceneQuery;
+	class DefaultSphereSceneQuery;
+	class DefaultAxisAlignedBoxSceneQuery;
+
+	/** Structure collecting together information about the visible objects
+	that have been discovered in a scene.
+	*/
+	struct VisibleObjectsBoundsInfo
+	{
+		/// The axis-aligned bounds of the visible objects
+		AxisAlignedBox aabb;
+		/// The closest a visible object is to the camera
+		Real minDistance;
+		/// The farthest a visible objects is from the camera
+		Real maxDistance;
+
+		VisibleObjectsBoundsInfo()
+		{
+			reset();
+		}
+
+		void reset()
+		{
+			aabb.setNull();
+			minDistance = std::numeric_limits<Real>::infinity();
+			maxDistance = 0;
+		}
+
+		void merge(const AxisAlignedBox& boxBounds, const Sphere& sphereBounds, 
+			const Camera* cam)
+		{
+			aabb.merge(boxBounds);
+			Real camDistToCenter = 
+				(cam->getDerivedPosition() - sphereBounds.getCenter()).length();
+			minDistance = (std::min)(minDistance, (std::max)((Real)0, camDistToCenter - sphereBounds.getRadius()));
+			maxDistance = (std::max)(maxDistance, camDistToCenter + sphereBounds.getRadius());
+		}
+
+
+	};
+
+	/** Interface definition for classes which can listen in on the process
+		of rendering shadows, in order to implement custom behaviour.
+	*/
+	class _OgreExport ShadowListener
+	{
+	public:
+		ShadowListener() {}
+		virtual ~ShadowListener() {}
+
+		/** Event raised after all shadow textures have been rendered into for 
+			all queues / targets but before any other geometry has been rendered
+		    (including main scene geometry and any additional shadow receiver 
+			passes). 
+		@remarks
+			This callback is useful for those that wish to perform some 
+			additional processing on shadow textures before they are used to 
+			render shadows. For example you could perform some filtering by 
+			rendering the existing shadow textures into another alternative 
+			shadow texture with a shader.]
+		@note
+			This event will only be fired when texture shadows are in use.
+		@param numberOfShadowTextures The number of shadow textures in use
+		*/
+		virtual void shadowTexturesUpdated(size_t numberOfShadowTextures) = 0;
+
+		/** This event occurs just before the view & projection matrices are
+		 	set for rendering into a shadow texture.
+		@remarks
+			You can use this event hook to perform some custom processing,
+			such as altering the camera being used for rendering the light's
+			view, including setting custom view & projection matrices if you
+			want to perform an advanced shadow technique.
+		@note
+			This event will only be fired when texture shadows are in use.
+		@param light Pointer to the light for which shadows are being rendered
+		@param camera Pointer to the camera being used to render
+		*/
+		virtual void shadowTextureCasterPreViewProj(Light* light, 
+			Camera* camera) = 0;
+		/** This event occurs just before the view & projection matrices are
+		 	set for re-rendering a shadow receiver.
+		@remarks
+			You can use this event hook to perform some custom processing,
+			such as altering the projection frustum being used for rendering 
+			the shadow onto the receiver to perform an advanced shadow 
+			technique.
+		@note
+			This event will only be fired when texture shadows are in use.
+		@param light Pointer to the light for which shadows are being rendered
+		@param frustum Pointer to the projection frustum being used to project
+			the shadow texture
+		*/
+		virtual void shadowTextureReceiverPreViewProj(Light* light, 
+			Frustum* frustum) = 0;
+
+		/** Hook to allow the listener to override the ordering of lights for
+			the entire frustum.
+		@remarks
+			Whilst ordinarily lights are sorted per rendered object 
+			(@see MovableObject::queryLights), texture shadows adds another issue
+			in that, given there is a finite number of shadow textures, we must
+			choose which lights to render texture shadows from based on the entire
+			frustum. These lights should always be listed first in every objects
+			own list, followed by any other lights which will not cast texture 
+			shadows (either because they have shadow casting off, or there aren't
+			enough shadow textures to service them).
+		@par
+			This hook allows you to override the detailed ordering of the lights
+			per frustum. The default ordering is shadow casters first (which you 
+			must also respect if you override this method), and ordered
+			by distance from the camera within those 2 groups. Obviously the closest
+			lights with shadow casting enabled will be listed first. Only lights 
+			within the range of the frustum will be in the list.
+		@param lightList The list of lights within range of the frustum which you
+			may sort.
+		@returns true if you sorted the list, false otherwise.
+		*/
+		virtual bool sortLightsAffectingFrustum(LightList& lightList) { return false; }
+
+		
+	};
+
+    /** Manages the organisation and rendering of a 'scene' i.e. a collection 
+		of objects and potentially world geometry.
+    @remarks
+		This class defines the interface and the basic behaviour of a 
+		'Scene Manager'. A SceneManager organises the culling and rendering of
+		the scene, in conjunction with the RenderQueue. This class is designed 
+		to be extended through subclassing in order to provide more specialised
+		scene organisation structures for particular needs. The default 
+		SceneManager culls based on a hierarchy of node bounding boxes, other
+		implementations can use an octree (@see OctreeSceneManager), a BSP
+		tree (@see BspSceneManager), and many other options. New SceneManager
+		implementations can be added at runtime by plugins, see 
+		SceneManagerEnumerator for the interfaces for adding new SceneManager
+		types.
+	@par
+		There is a distinction between 'objects' (which subclass MovableObject, 
+		and are movable, discrete objects in the world), and 'world geometry',
+		which is large, generally static geometry. World geometry tends to 
+		influence the SceneManager organisational structure (e.g. lots of indoor
+		static geometry might result in a spatial tree structure) and as such
+		world geometry is generally tied to a given SceneManager implementation,
+		whilst MovableObject instances can be used with any SceneManager.
+		Subclasses are free to define world geometry however they please.
+	@par
+		Multiple SceneManager instances can exist at one time, each one with 
+		a distinct scene. Which SceneManager is used to render a scene is
+		dependent on the Camera, which will always call back the SceneManager
+		which created it to render the scene. 
+     */
+    class _OgreExport SceneManager
+    {
+    public:
+        /// Query type mask which will be used for world geometry @see SceneQuery
+        static uint32 WORLD_GEOMETRY_TYPE_MASK;
+		/// Query type mask which will be used for entities @see SceneQuery
+		static uint32 ENTITY_TYPE_MASK;
+		/// Query type mask which will be used for effects like billboardsets / particle systems @see SceneQuery
+		static uint32 FX_TYPE_MASK;
+		/// Query type mask which will be used for StaticGeometry  @see SceneQuery
+		static uint32 STATICGEOMETRY_TYPE_MASK;
+		/// Query type mask which will be used for lights  @see SceneQuery
+		static uint32 LIGHT_TYPE_MASK;
+		/// User type mask limit
+		static uint32 USER_TYPE_MASK_LIMIT;
+        /** Comparator for material map, for sorting materials into render order (e.g. transparent last).
+        */
+        struct materialLess
+        {
+            _OgreExport bool operator()(const Material* x, const Material* y) const;
+        };
+        /// Comparator for sorting lights relative to a point
+        struct lightLess
+        {
+            _OgreExport bool operator()(const Light* a, const Light* b) const;
+        };
+
+        /// Describes the stage of rendering when performing complex illumination
+        enum IlluminationRenderStage
+        {
+            /// No special illumination stage
+            IRS_NONE,
+            /// Render to texture stage, used for texture based shadows
+            IRS_RENDER_TO_TEXTURE,
+            /// Render from shadow texture to receivers stage
+            IRS_RENDER_RECEIVER_PASS
+        };
+
+		/** Enumeration of the possible modes allowed for processing the special case
+		render queue list.
+		@see SceneManager::setSpecialCaseRenderQueueMode
+		*/
+		enum SpecialCaseRenderQueueMode
+		{
+			/// Render only the queues in the special case list
+			SCRQM_INCLUDE,
+			/// Render all except the queues in the special case list
+			SCRQM_EXCLUDE
+		};
+
+		struct SkyDomeGenParameters
+		{
+			Real skyDomeCurvature;
+			Real skyDomeTiling;
+			Real skyDomeDistance;
+			int skyDomeXSegments; 
+			int skyDomeYSegments;
+			int skyDomeYSegments_keep;
+		};
+
+		struct SkyPlaneGenParameters
+		{
+			Real skyPlaneScale;
+			Real skyPlaneTiling; 
+			Real skyPlaneBow; 
+			int skyPlaneXSegments; 
+			int skyPlaneYSegments; 
+		};
+
+		struct SkyBoxGenParameters
+		{
+			Real skyBoxDistance;
+		};
+
+    protected:
+		/// Instance name
+		String mName;
+
+        /// Queue of objects for rendering
+        RenderQueue* mRenderQueue;
+
+        /// Current ambient light, cached for RenderSystem
+        ColourValue mAmbientLight;
+
+        /// The rendering system to send the scene to
+        RenderSystem *mDestRenderSystem;
+
+        typedef std::map<String, Camera* > CameraList;
+
+        /** Central list of cameras - for easy memory management and lookup.
+        */
+        CameraList mCameras;
+
+		typedef std::map<String, StaticGeometry* > StaticGeometryList;
+		StaticGeometryList mStaticGeometryList;
+		typedef std::map<String, InstancedGeometry* > InstancedGeometryList;
+		InstancedGeometryList mInstancedGeometryList;
+
+        typedef std::map<String, SceneNode*> SceneNodeList;
+
+        /** Central list of SceneNodes - for easy memory management.
+            @note
+                Note that this list is used only for memory management; the structure of the scene
+                is held using the hierarchy of SceneNodes starting with the root node. However you
+                can look up nodes this way.
+        */
+        SceneNodeList mSceneNodes;
+
+        /// Camera in progress
+        Camera* mCameraInProgress;
+        /// Current Viewport
+        Viewport* mCurrentViewport;
+
+        /// Root scene node
+        SceneNode* mSceneRoot;
+
+        /// Autotracking scene nodes
+        typedef std::set<SceneNode*> AutoTrackingSceneNodes;
+        AutoTrackingSceneNodes mAutoTrackingSceneNodes;
+
+        // Sky params
+        // Sky plane
+        Entity* mSkyPlaneEntity;
+        Entity* mSkyDomeEntity[5];
+        Entity* mSkyBoxEntity[6];
+
+        SceneNode* mSkyPlaneNode;
+        SceneNode* mSkyDomeNode;
+        SceneNode* mSkyBoxNode;
+
+        // Sky plane
+        bool mSkyPlaneEnabled;
+        bool mSkyPlaneDrawFirst;
+        Plane mSkyPlane;
+        SkyPlaneGenParameters mSkyPlaneGenParameters;
+        // Sky box
+        bool mSkyBoxEnabled;
+        bool mSkyBoxDrawFirst;
+        Quaternion mSkyBoxOrientation;
+        SkyBoxGenParameters mSkyBoxGenParameters;
+        // Sky dome
+        bool mSkyDomeEnabled;
+        bool mSkyDomeDrawFirst;
+        Quaternion mSkyDomeOrientation;
+        SkyDomeGenParameters mSkyDomeGenParameters;
+
+        // Fog
+        FogMode mFogMode;
+        ColourValue mFogColour;
+        Real mFogStart;
+        Real mFogEnd;
+        Real mFogDensity;
+
+		typedef std::set<uint8> SpecialCaseRenderQueueList;
+		SpecialCaseRenderQueueList mSpecialCaseQueueList;
+		SpecialCaseRenderQueueMode mSpecialCaseQueueMode;
+		uint8 mWorldGeometryRenderQueue;
+		
+		unsigned long mLastFrameNumber;
+		Matrix4 mTempXform[256];
+		bool mResetIdentityView;
+		bool mResetIdentityProj;
+
+	protected:
+
+		/** Visible objects bounding box list.
+			@remarks
+				Holds an ABB for each camera that contains the physical extends of the visible
+				scene elements by each camera. The map is crutial for shadow algorithms which
+				have a focus step to limit the shadow sample distribution to only valid visible
+				scene elements.
+		*/
+		typedef std::map< const Camera*, VisibleObjectsBoundsInfo> CamVisibleObjectsMap;
+		CamVisibleObjectsMap mCamVisibleObjectsMap; 
+
+		/** ShadowCamera to light mapping */
+		typedef std::map< const Camera*, const Light* > ShadowCamLightMapping;
+		ShadowCamLightMapping mShadowCamLightMapping;
+
+        /// Cached light information, used to tracking light's changes
+        struct _OgreExport LightInfo
+        {
+            Light* light;       // Just a pointer for comparison, the light might destroyed for some reason
+            int type;           // Use int instead of Light::LightTypes to avoid header file dependence
+            Real range;         // Sets to zero if directional light
+            Vector3 position;   // Sets to zero if directional light
+
+            bool operator== (const LightInfo& rhs) const
+            {
+                return light == rhs.light && type == rhs.type &&
+                    range == rhs.range && position == rhs.position;
+            }
+
+            bool operator!= (const LightInfo& rhs) const
+            {
+                return !(*this == rhs);
+            }
+        };
+
+        typedef std::vector<LightInfo> LightInfoList;
+
+        LightList mLightsAffectingFrustum;
+        LightInfoList mCachedLightInfos;
+		LightInfoList mTestLightInfos; // potentially new list
+        ulong mLightsDirtyCounter;
+
+		typedef std::map<String, MovableObject*> MovableObjectMap;
+		/// Simple structure to hold MovableObject map and a mutex to go with it.
+		struct MovableObjectCollection
+		{
+			MovableObjectMap map;
+			OGRE_MUTEX(mutex)
+		};
+		typedef std::map<String, MovableObjectCollection*> MovableObjectCollectionMap;
+		MovableObjectCollectionMap mMovableObjectCollectionMap;
+		/** Gets the movable object collection for the given type name.
+		@remarks
+			This method create new collection if the collection does not exist.
+		*/
+		MovableObjectCollection* getMovableObjectCollection(const String& typeName);
+		/** Gets the movable object collection for the given type name.
+		@remarks
+			This method throw exception if the collection does not exist.
+		*/
+		const MovableObjectCollection* getMovableObjectCollection(const String& typeName) const;
+		/// Mutex over the collection of MovableObject types
+		OGRE_MUTEX(mMovableObjectCollectionMapMutex)
+
+        /** Internal method for initialising the render queue.
+        @remarks
+            Subclasses can use this to install their own RenderQueue implementation.
+        */
+        virtual void initRenderQueue(void);
+        /// A pass designed to let us render shadow colour on white for texture shadows
+        Pass* mShadowCasterPlainBlackPass;
+        /// A pass designed to let us render shadow receivers for texture shadows
+        Pass* mShadowReceiverPass;
+        /** Internal method for turning a regular pass into a shadow caster pass.
+        @remarks
+            This is only used for texture shadows, basically we're trying to
+            ensure that objects are rendered solid black.
+            This method will usually return the standard solid black pass for
+            all fixed function passes, but will merge in a vertex program
+            and fudge the AutpoParamDataSource to set black lighting for
+            passes with vertex programs. 
+        */
+        const Pass* deriveShadowCasterPass(const Pass* pass);
+        /** Internal method for turning a regular pass into a shadow receiver pass.
+        @remarks
+        This is only used for texture shadows, basically we're trying to
+        ensure that objects are rendered with a projective texture.
+        This method will usually return a standard single-texture pass for
+        all fixed function passes, but will merge in a vertex program
+        for passes with vertex programs. 
+        */
+        const Pass* deriveShadowReceiverPass(const Pass* pass);
+    
+        /** Internal method to validate whether a Pass should be allowed to render.
+        @remarks
+            Called just before a pass is about to be used for rendering a group to
+            allow the SceneManager to omit it if required. A return value of false
+            skips this pass. 
+        */
+        bool validatePassForRendering(const Pass* pass);
+
+        /** Internal method to validate whether a Renderable should be allowed to render.
+        @remarks
+        Called just before a pass is about to be used for rendering a Renderable to
+        allow the SceneManager to omit it if required. A return value of false
+        skips it. 
+        */
+        bool validateRenderableForRendering(const Pass* pass, const Renderable* rend);
+
+        enum BoxPlane
+        {
+            BP_FRONT = 0,
+            BP_BACK = 1,
+            BP_LEFT = 2,
+            BP_RIGHT = 3,
+            BP_UP = 4,
+            BP_DOWN = 5
+        };
+
+        /* Internal utility method for creating the planes of a skybox.
+        */
+        MeshPtr createSkyboxPlane(
+            BoxPlane bp,
+            Real distance,
+            const Quaternion& orientation,
+            const String& groupName);
+
+        /* Internal utility method for creating the planes of a skydome.
+        */
+        MeshPtr createSkydomePlane(
+            BoxPlane bp,
+            Real curvature, Real tiling, Real distance,
+            const Quaternion& orientation,
+            int xsegments, int ysegments, int ySegmentsToKeep, 
+            const String& groupName);
+
+        // Flag indicating whether SceneNodes will be rendered as a set of 3 axes
+        bool mDisplayNodes;
+
+        /// Storage of animations, lookup by name
+        typedef std::map<String, Animation*> AnimationList;
+        AnimationList mAnimationsList;
+		OGRE_MUTEX(mAnimationsListMutex)
+        AnimationStateSet mAnimationStates;
+
+
+        /** Internal method used by _renderSingleObject to deal with renderables
+            which override the camera's own view / projection materices. */
+        void useRenderableViewProjMode(const Renderable* pRend);
+        
+        /** Internal method used by _renderSingleObject to deal with renderables
+            which override the camera's own view / projection matrices. */
+        void resetViewProjMode(void);
+
+        typedef std::vector<RenderQueueListener*> RenderQueueListenerList;
+        RenderQueueListenerList mRenderQueueListeners;
+
+        typedef std::vector<ShadowListener*> ShadowListenerList;
+        ShadowListenerList mShadowListeners;
+        /// Internal method for firing the queue start event, returns true if queue is to be skipped
+        bool fireRenderQueueStarted(uint8 id, const String& invocation);
+        /// Internal method for firing the queue end event, returns true if queue is to be repeated
+        bool fireRenderQueueEnded(uint8 id, const String& invocation);
+
+		/// Internal method for firing the texture shadows updated event
+        void fireShadowTexturesUpdated(size_t numberOfShadowTextures);
+		/// Internal method for firing the pre caster texture shadows event
+        void fireShadowTexturesPreCaster(Light* light, Camera* camera);
+		/// Internal method for firing the pre receiver texture shadows event
+        void fireShadowTexturesPreReceiver(Light* light, Frustum* f);
+        /** Internal method for setting the destination viewport for the next render. */
+        virtual void setViewport(Viewport *vp);
+
+		/** Flag that indicates if all of the scene node's bounding boxes should be shown as a wireframe. */
+		bool mShowBoundingBoxes;      
+
+		/** Internal method for rendering all objects using the default queue sequence. */
+		virtual void renderVisibleObjectsDefaultSequence(void);
+		/** Internal method for rendering all objects using a custom queue sequence. */
+		virtual void renderVisibleObjectsCustomSequence(RenderQueueInvocationSequence* s);
+		/** Internal method for preparing the render queue for use with each render. */
+		virtual void prepareRenderQueue(void);
+
+
+        /** Internal utility method for rendering a single object. 
+        @remarks
+            Assumes that the pass has already been set up.
+        @param rend The renderable to issue to the pipeline
+        @param pass The pass which is being used
+        @param doLightIteration If true, this method will issue the renderable to
+            the pipeline possibly multiple times, if the pass indicates it should be
+            done once per light
+        @param manualLightList Only applicable if doLightIteration is false, this
+            method allows you to pass in a previously determined set of lights
+            which will be used for a single render of this object.
+        */
+        virtual void renderSingleObject(const Renderable* rend, const Pass* pass, 
+			bool doLightIteration, const LightList* manualLightList = 0);
+
+        /// Utility class for calculating automatic parameters for gpu programs
+        AutoParamDataSource mAutoParamDataSource;
+
+        ShadowTechnique mShadowTechnique;
+        bool mDebugShadows;
+        ColourValue mShadowColour;
+        Pass* mShadowDebugPass;
+        Pass* mShadowStencilPass;
+        Pass* mShadowModulativePass;
+		bool mShadowMaterialInitDone;
+        HardwareIndexBufferSharedPtr mShadowIndexBuffer;
+		size_t mShadowIndexBufferSize;
+        Rectangle2D* mFullScreenQuad;
+        Real mShadowDirLightExtrudeDist;
+        IlluminationRenderStage mIlluminationStage;
+		ShadowTextureConfigList mShadowTextureConfigList;
+		bool mShadowTextureConfigDirty;
+        ShadowTextureList mShadowTextures;
+		TexturePtr mNullShadowTexture;
+		typedef std::vector<Camera*> ShadowTextureCameraList;
+		ShadowTextureCameraList mShadowTextureCameras;
+        Texture* mCurrentShadowTexture;
+		bool mShadowUseInfiniteFarPlane;
+		bool mShadowCasterRenderBackFaces;
+
+		/// default shadow camera setup
+		ShadowCameraSetupPtr mDefaultShadowCameraSetup;
+
+		/** Default sorting routine which sorts lights which cast shadows
+			to the front of a list, sub-sorting by distance.
+		@remarks
+			Since shadow textures are generated from lights based on the
+			frustum rather than individual objects, a shadow and camera-wise sort is
+			required to pick the best lights near the start of the list. Up to 
+			the number of shadow textures will be generated from this.
+		*/
+		struct lightsForShadowTextureLess
+		{
+			_OgreExport bool operator()(const Light* l1, const Light* l2) const;
+		};
+
+
+        /** Internal method for locating a list of lights which could be affecting the frustum. 
+        @remarks
+            Custom scene managers are encouraged to override this method to make use of their
+            scene partitioning scheme to more efficiently locate lights, and to eliminate lights
+            which may be occluded by word geometry.
+        */
+        virtual void findLightsAffectingFrustum(const Camera* camera);
+        /// Internal method for setting up materials for shadows
+        virtual void initShadowVolumeMaterials(void);
+        /// Internal method for creating shadow textures (texture-based shadows)
+        virtual void ensureShadowTexturesCreated();
+        /// Internal method for destroying shadow textures (texture-based shadows)
+        virtual void destroyShadowTextures(void);
+        /// Internal method for preparing shadow textures ready for use in a regular render
+        virtual void prepareShadowTextures(Camera* cam, Viewport* vp);
+
+        /** Internal method for rendering all the objects for a given light into the 
+            stencil buffer.
+        @param light The light source
+        @param cam The camera being viewed from
+        */
+        virtual void renderShadowVolumesToStencil(const Light* light, const Camera* cam);
+        /** Internal utility method for setting stencil state for rendering shadow volumes. 
+        @param secondpass Is this the second pass?
+        @param zfail Should we be using the zfail method?
+        @param twosided Should we use a 2-sided stencil?
+        */
+        virtual void setShadowVolumeStencilState(bool secondpass, bool zfail, bool twosided);
+        /** Render a set of shadow renderables. */
+        void renderShadowVolumeObjects(ShadowCaster::ShadowRenderableListIterator iShadowRenderables,
+            Pass* pass, const LightList *manualLightList, unsigned long flags,
+            bool secondpass, bool zfail, bool twosided);
+        typedef std::vector<ShadowCaster*> ShadowCasterList;
+        ShadowCasterList mShadowCasterList;
+        SphereSceneQuery* mShadowCasterSphereQuery;
+        AxisAlignedBoxSceneQuery* mShadowCasterAABBQuery;
+        Real mShadowFarDist;
+        Real mShadowFarDistSquared;
+        Real mShadowTextureOffset; // proportion of texture offset in view direction e.g. 0.4
+        Real mShadowTextureFadeStart; // as a proportion e.g. 0.6
+        Real mShadowTextureFadeEnd; // as a proportion e.g. 0.9
+		bool mShadowTextureSelfShadow;
+		Pass* mShadowTextureCustomCasterPass;
+		Pass* mShadowTextureCustomReceiverPass;
+		String mShadowTextureCustomCasterVertexProgram;
+		String mShadowTextureCustomReceiverVertexProgram;
+		String mShadowTextureCustomReceiverFragmentProgram;
+		GpuProgramParametersSharedPtr mShadowTextureCustomCasterVPParams;
+		GpuProgramParametersSharedPtr mShadowTextureCustomReceiverVPParams;
+		GpuProgramParametersSharedPtr mShadowTextureCustomReceiverFPParams;
+
+		/// Visibility mask used to show / hide objects
+		uint32 mVisibilityMask;
+		bool mFindVisibleObjects;
+
+		/// Suppress render state changes?
+		bool mSuppressRenderStateChanges;
+		/// Suppress shadows?
+		bool mSuppressShadows;
+
+
+        GpuProgramParametersSharedPtr mInfiniteExtrusionParams;
+        GpuProgramParametersSharedPtr mFiniteExtrusionParams;
+
+        /// Inner class to use as callback for shadow caster scene query
+        class _OgreExport ShadowCasterSceneQueryListener : public SceneQueryListener
+        {
+        protected:
+			SceneManager* mSceneMgr;
+            ShadowCasterList* mCasterList;
+            bool mIsLightInFrustum;
+            const PlaneBoundedVolumeList* mLightClipVolumeList;
+            const Camera* mCamera;
+            const Light* mLight;
+            Real mFarDistSquared;
+        public:
+            ShadowCasterSceneQueryListener(SceneManager* sm) : mSceneMgr(sm),
+				mCasterList(0), mIsLightInFrustum(false), mLightClipVolumeList(0), 
+                mCamera(0) {}
+            // Prepare the listener for use with a set of parameters  
+            void prepare(bool lightInFrustum, 
+                const PlaneBoundedVolumeList* lightClipVolumes, 
+                const Light* light, const Camera* cam, ShadowCasterList* casterList, 
+                Real farDistSquared) 
+            {
+                mCasterList = casterList;
+                mIsLightInFrustum = lightInFrustum;
+                mLightClipVolumeList = lightClipVolumes;
+                mCamera = cam;
+                mLight = light;
+                mFarDistSquared = farDistSquared;
+            }
+            bool queryResult(MovableObject* object);
+            bool queryResult(SceneQuery::WorldFragment* fragment);
+        };
+
+        ShadowCasterSceneQueryListener* mShadowCasterQueryListener;
+
+        /** Internal method for locating a list of shadow casters which 
+            could be affecting the frustum for a given light. 
+        @remarks
+            Custom scene managers are encouraged to override this method to add optimisations, 
+            and to add their own custom shadow casters (perhaps for world geometry)
+        */
+        virtual const ShadowCasterList& findShadowCastersForLight(const Light* light, 
+            const Camera* camera);
+        /** Render a group in the ordinary way */
+		virtual void renderBasicQueueGroupObjects(RenderQueueGroup* pGroup, 
+			QueuedRenderableCollection::OrganisationMode om);
+		/** Render a group with the added complexity of additive stencil shadows. */
+		virtual void renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* group, 
+			QueuedRenderableCollection::OrganisationMode om);
+		/** Render a group with the added complexity of modulative stencil shadows. */
+		virtual void renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* group, 
+			QueuedRenderableCollection::OrganisationMode om);
+        /** Render a group rendering only shadow casters. */
+		virtual void renderTextureShadowCasterQueueGroupObjects(RenderQueueGroup* group, 
+			QueuedRenderableCollection::OrganisationMode om);
+        /** Render a group rendering only shadow receivers. */
+		virtual void renderTextureShadowReceiverQueueGroupObjects(RenderQueueGroup* group, 
+			QueuedRenderableCollection::OrganisationMode om);
+        /** Render a group with the added complexity of modulative texture shadows. */
+		virtual void renderModulativeTextureShadowedQueueGroupObjects(RenderQueueGroup* group, 
+			QueuedRenderableCollection::OrganisationMode om);
+
+		/** Render a group with additive texture shadows. */
+		virtual void renderAdditiveTextureShadowedQueueGroupObjects(RenderQueueGroup* group, 
+			QueuedRenderableCollection::OrganisationMode om);
+		/** Render a set of objects, see renderSingleObject for param definitions */
+		virtual void renderObjects(const QueuedRenderableCollection& objs, 
+			QueuedRenderableCollection::OrganisationMode om, 
+            bool doLightIteration, const LightList* manualLightList = 0);
+		/** Render those objects in the transparent pass list which have shadow casting forced on
+		@remarks
+			This function is intended to be used to render the shadows of transparent objects which have
+			transparency_casts_shadows set to 'on' in their material
+		*/
+		virtual void renderTransparentShadowCasterObjects(const QueuedRenderableCollection& objs, 
+			QueuedRenderableCollection::OrganisationMode om, 
+			bool doLightIteration, const LightList* manualLightList = 0);
+
+		/** Update the state of the global render queue splitting based on a shadow
+		option change. */
+		virtual void updateRenderQueueSplitOptions(void);
+		/** Update the state of the render queue group splitting based on a shadow
+		option change. */
+		virtual void updateRenderQueueGroupSplitOptions(RenderQueueGroup* group, 
+			bool suppressShadows, bool suppressRenderState);
+
+		/** Inner helper class to implement the visitor pattern for rendering objects
+			in a queue. 
+		*/
+		class _OgreExport SceneMgrQueuedRenderableVisitor : public QueuedRenderableVisitor
+		{
+		protected:
+			/// Pass that was actually used at the grouping level
+			const Pass* mUsedPass;
+		public:
+			SceneMgrQueuedRenderableVisitor() 
+				:transparentShadowCastersMode(false) {}
+			~SceneMgrQueuedRenderableVisitor() {}
+			void visit(const Renderable* r);
+			bool visit(const Pass* p);
+			void visit(const RenderablePass* rp);
+
+			/// Target SM to send renderables to
+			SceneManager* targetSceneMgr;
+			/// Are we in transparent shadow caster mode?
+			bool transparentShadowCastersMode;
+			/// Automatic light handling?
+			bool autoLights;
+			/// Manual light list
+			const LightList* manualLightList;
+
+		};
+		/// Allow visitor helper to access protected methods
+		friend class SceneMgrQueuedRenderableVisitor;
+		/// The active renderable visitor class - subclasses could override this
+		SceneMgrQueuedRenderableVisitor* mActiveQueuedRenderableVisitor;
+		/// Storage for default renderable visitor
+		SceneMgrQueuedRenderableVisitor mDefaultQueuedRenderableVisitor;
+
+    public:
+        /** Constructor.
+        */
+        SceneManager(const String& instanceName);
+
+        /** Default destructor.
+        */
+        virtual ~SceneManager();
+
+
+		/** Mutex to protect the scene graph from simultaneous access from
+			multiple threads.
+		@remarks
+			If you are updating the scene in a separate thread from the rendering
+			thread, then you should lock this mutex before making any changes to 
+			the scene graph - that means creating, modifying or deleting a
+			scene node, or attaching / detaching objects. It is <b>your</b> 
+			responsibility to take out this lock, the detail methods on the nodes
+			will not do it for you (for the reasons discussed below).
+		@par
+			Note that locking this mutex will prevent the scene being rendered until 
+			it is unlocked again. Therefore you should do this sparingly. Try
+			to create any objects you need separately and fully prepare them
+			before doing all your scene graph work in one go, thus keeping this
+			lock for the shortest time possible.
+		@note
+			A single global lock is used rather than a per-node lock since 
+			it keeps the number of locks required during rendering down to a 
+			minimum. Obtaining a lock, even if there is no contention, is not free
+			so for performance it is good to do it as little as possible. 
+			Since modifying the scene in a separate thread is a fairly
+			rare occurrence (relative to rendering), it is better to keep the 
+			locking required during rendering lower than to make update locks
+			more granular.
+		*/
+		OGRE_MUTEX(sceneGraphMutex)
+
+		/** Return the instance name of this SceneManager. */
+		const String& getName(void) const { return mName; }
+
+		/** Retrieve the type name of this scene manager.
+		@remarks
+			This method has to be implemented by subclasses. It should
+			return the type name of this SceneManager which agrees with 
+			the type name of the SceneManagerFactory which created it.
+		*/
+		virtual const String& getTypeName(void) const = 0;
+
+        /** Creates a camera to be managed by this scene manager.
+            @remarks
+                This camera must be added to the scene at a later time using
+                the attachObject method of the SceneNode class.
+            @param
+                name Name to give the new camera.
+        */
+        virtual Camera* createCamera(const String& name);
+
+        /** Retrieves a pointer to the named camera.
+		@note Throws an exception if the named instance does not exist
+        */
+        virtual Camera* getCamera(const String& name) const;
+
+		/** Returns whether a camera with the given name exists.
+		*/
+		virtual bool hasCamera(const String& name) const;
+
+        /** Removes a camera from the scene.
+            @remarks
+                This method removes a previously added camera from the scene.
+                The camera is deleted so the caller must ensure no references
+                to it's previous instance (e.g. in a SceneNode) are used.
+            @param
+                cam Pointer to the camera to remove
+        */
+        virtual void destroyCamera(Camera *cam);
+
+        /** Removes a camera from the scene.
+            @remarks
+                This method removes an camera from the scene based on the
+                camera's name rather than a pointer.
+        */
+        virtual void destroyCamera(const String& name);
+
+        /** Removes (and destroys) all cameras from the scene.
+            @remarks
+                Some cameras are internal created to dealing with texture shadow,
+                their aren't supposed to destroy outside. So, while you are using
+                texture shadow, don't call this method, or you can set the shadow
+                technique other than texture-based, which will destroy all internal
+                created shadow cameras and textures.
+        */
+        virtual void destroyAllCameras(void);
+
+        /** Creates a light for use in the scene.
+            @remarks
+                Lights can either be in a fixed position and independent of the
+                scene graph, or they can be attached to SceneNodes so they derive
+                their position from the parent node. Either way, they are created
+                using this method so that the SceneManager manages their
+                existence.
+            @param
+                name The name of the new light, to identify it later.
+        */
+        virtual Light* createLight(const String& name);
+
+        /** Returns a pointer to the named Light which has previously been added to the scene.
+		@note Throws an exception if the named instance does not exist
+        */
+        virtual Light* getLight(const String& name) const;
+
+		/** Returns whether a light with the given name exists.
+		*/
+		virtual bool hasLight(const String& name) const;
+
+		/** Removes the named light from the scene and destroys it.
+            @remarks
+                Any pointers held to this light after calling this method will be invalid.
+        */
+        virtual void destroyLight(const String& name);
+
+        /** Removes the light from the scene and destroys it based on a pointer.
+            @remarks
+                Any pointers held to this light after calling this method will be invalid.
+        */
+        virtual void destroyLight(Light* light);
+        /** Removes and destroys all lights in the scene.
+        */
+        virtual void destroyAllLights(void);
+
+        /** Advance method to increase the lights dirty counter due lights changed.
+        @remarks
+            Scene manager tracking lights that affecting the frustum, if changes
+            detected (the changes includes light list itself and the light's position
+            and attenuation range), then increase the lights dirty counter.
+        @par
+            For some reason, you can call this method to force whole scene objects
+            re-populate their light list. But near in mind, call to this method
+            will harm performance, so should avoid if possible.
+        */
+        virtual void _notifyLightsDirty(void);
+
+        /** Advance method to gets the lights dirty counter.
+        @remarks
+            Scene manager tracking lights that affecting the frustum, if changes
+            detected (the changes includes light list itself and the light's position
+            and attenuation range), then increase the lights dirty counter.
+        @par
+            When implementing customise lights finding algorithm relied on either
+            SceneManager::_getLightsAffectingFrustum or SceneManager::_populateLightList,
+            might check this value for sure that the light list are really need to
+            re-populate, otherwise, returns cached light list (if exists) for better
+            performance.
+        */
+        ulong _getLightsDirtyCounter(void) const { return mLightsDirtyCounter; }
+
+        /** Get the list of lights which could be affecting the frustum.
+        @remarks
+            Note that default implementation of this method returns a cached light list,
+            which is populated when rendering the scene. So by default the list of lights 
+			is only available during scene rendering.
+        */
+        virtual const LightList& _getLightsAffectingFrustum(void) const;
+
+        /** Populate a light list with an ordered set of the lights which are closest
+        to the position specified.
+        @remarks
+            Note that since directional lights have no position, they are always considered
+            closer than any point lights and as such will always take precedence. 
+        @par
+            Subclasses of the default SceneManager may wish to take into account other issues
+            such as possible visibility of the light if that information is included in their
+            data structures. This basic scenemanager simply orders by distance, eliminating 
+            those lights which are out of range or could not be affecting the frustum (i.e.
+            only the lights returned by SceneManager::_getLightsAffectingFrustum are take into
+            account).
+        @par
+            The number of items in the list max exceed the maximum number of lights supported
+            by the renderer, but the extraneous ones will never be used. In fact the limit will
+            be imposed by Pass::getMaxSimultaneousLights.
+        @param position The position at which to evaluate the list of lights
+        @param radius The bounding radius to test
+        @param destList List to be populated with ordered set of lights; will be cleared by 
+            this method before population.
+        */
+        virtual void _populateLightList(const Vector3& position, Real radius, LightList& destList);
+
+
+        /** Creates an instance of a SceneNode.
+            @remarks
+                Note that this does not add the SceneNode to the scene hierarchy.
+                This method is for convenience, since it allows an instance to
+                be created for which the SceneManager is responsible for
+                allocating and releasing memory, which is convenient in complex
+                scenes.
+            @par
+                To include the returned SceneNode in the scene, use the addChild
+                method of the SceneNode which is to be it's parent.
+            @par
+                Note that this method takes no parameters, and the node created is unnamed (it is
+                actually given a generated name, which you can retrieve if you want).
+                If you wish to create a node with a specific name, call the alternative method
+                which takes a name parameter.
+        */
+        virtual SceneNode* createSceneNode(void);
+
+        /** Creates an instance of a SceneNode with a given name.
+            @remarks
+                Note that this does not add the SceneNode to the scene hierarchy.
+                This method is for convenience, since it allows an instance to
+                be created for which the SceneManager is responsible for
+                allocating and releasing memory, which is convenient in complex
+                scenes.
+            @par
+                To include the returned SceneNode in the scene, use the addChild
+                method of the SceneNode which is to be it's parent.
+            @par
+                Note that this method takes a name parameter, which makes the node easier to
+                retrieve directly again later.
+        */
+        virtual SceneNode* createSceneNode(const String& name);
+
+        /** Destroys a SceneNode with a given name.
+        @remarks
+            This allows you to physically delete an individual SceneNode if you want to.
+            Note that this is not normally recommended, it's better to allow SceneManager
+            to delete the nodes when the scene is cleared.
+        */
+        virtual void destroySceneNode(const String& name);
+
+        /** Gets the SceneNode at the root of the scene hierarchy.
+            @remarks
+                The entire scene is held as a hierarchy of nodes, which
+                allows things like relative transforms, general changes in
+                rendering state etc (See the SceneNode class for more info).
+                In this basic SceneManager class, the application using
+                Ogre is free to structure this hierarchy however it likes,
+                since it has no real significance apart from making transforms
+                relative to each node (more specialised subclasses will
+                provide utility methods for building specific node structures
+                e.g. loading a BSP tree).
+            @par
+                However, in all cases there is only ever one root node of
+                the hierarchy, and this method returns a pointer to it.
+        */
+        virtual SceneNode* getRootSceneNode(void) const;
+
+        /** Retrieves a named SceneNode from the scene graph.
+        @remarks
+            If you chose to name a SceneNode as you created it, or if you
+            happened to make a note of the generated name, you can look it
+            up wherever it is in the scene graph using this method.
+			@note Throws an exception if the named instance does not exist
+        */
+        virtual SceneNode* getSceneNode(const String& name) const;
+
+		/** Returns whether a scene node with the given name exists.
+		*/
+		virtual bool hasSceneNode(const String& name) const;
+
+
+        /** Create an Entity (instance of a discrete mesh).
+            @param
+                entityName The name to be given to the entity (must be unique).
+            @param
+                meshName The name of the Mesh it is to be based on (e.g. 'knot.oof'). The
+                mesh will be loaded if it is not already.
+        */
+        virtual Entity* createEntity(const String& entityName, const String& meshName);
+
+        /** Prefab shapes available without loading a model.
+            @note
+                Minimal implementation at present.
+            @todo
+                Add more prefabs (teapots, teapots!!!)
+        */
+        enum PrefabType {
+            PT_PLANE,
+			PT_CUBE,
+			PT_SPHERE
+        };
+
+        /** Create an Entity (instance of a discrete mesh) from a range of prefab shapes.
+            @param
+                entityName The name to be given to the entity (must be unique).
+            @param
+                ptype The prefab type.
+        */
+        virtual Entity* createEntity(const String& entityName, PrefabType ptype);
+        /** Retrieves a pointer to the named Entity. 
+		@note Throws an exception if the named instance does not exist
+		*/
+        virtual Entity* getEntity(const String& name) const;
+		/** Returns whether an entity with the given name exists.
+		*/
+		virtual bool hasEntity(const String& name) const;
+
+        /** Removes & destroys an Entity from the SceneManager.
+            @warning
+                Must only be done if the Entity is not attached
+                to a SceneNode. It may be safer to wait to clear the whole
+                scene if you are unsure use clearScene.
+            @see
+                SceneManager::clearScene
+        */
+        virtual void destroyEntity(Entity* ent);
+
+        /** Removes & destroys an Entity from the SceneManager by name.
+            @warning
+                Must only be done if the Entity is not attached
+                to a SceneNode. It may be safer to wait to clear the whole
+                scene if you are unsure use clearScene.
+            @see
+                SceneManager::clearScene
+        */
+        virtual void destroyEntity(const String& name);
+
+        /** Removes & destroys all Entities.
+            @warning
+                Again, use caution since no Entity must be referred to
+                elsewhere e.g. attached to a SceneNode otherwise a crash
+                is likely. Use clearScene if you are unsure (it clears SceneNode
+                entries too.)
+            @see
+                SceneManager::clearScene
+        */
+        virtual void destroyAllEntities(void);
+
+        /** Create a ManualObject, an object which you populate with geometry
+			manually through a GL immediate-mode style interface.
+        @param
+            name The name to be given to the object (must be unique).
+        */
+        virtual ManualObject* createManualObject(const String& name);
+        /** Retrieves a pointer to the named ManualObject. 
+		@note Throws an exception if the named instance does not exist
+		*/
+        virtual ManualObject* getManualObject(const String& name) const;
+		/** Returns whether a manual object with the given name exists.
+		*/
+		virtual bool hasManualObject(const String& name) const;
+
+        /** Removes & destroys a ManualObject from the SceneManager.
+        */
+        virtual void destroyManualObject(ManualObject* obj);
+		/** Removes & destroys a ManualObject from the SceneManager.
+		*/
+		virtual void destroyManualObject(const String& name);
+		/** Removes & destroys all ManualObjects from the SceneManager.
+		*/
+		virtual void destroyAllManualObjects(void);
+        /** Create a BillboardChain, an object which you can use to render
+            a linked chain of billboards.
+        @param
+            name The name to be given to the object (must be unique).
+        */
+        virtual BillboardChain* createBillboardChain(const String& name);
+        /** Retrieves a pointer to the named BillboardChain. 
+		@note Throws an exception if the named instance does not exist
+		*/
+        virtual BillboardChain* getBillboardChain(const String& name) const;
+		/** Returns whether a billboard chain with the given name exists.
+		*/
+		virtual bool hasBillboardChain(const String& name) const;
+
+        /** Removes & destroys a BillboardChain from the SceneManager.
+        */
+        virtual void destroyBillboardChain(BillboardChain* obj);
+		/** Removes & destroys a BillboardChain from the SceneManager.
+		*/
+		virtual void destroyBillboardChain(const String& name);
+		/** Removes & destroys all BillboardChains from the SceneManager.
+		*/
+		virtual void destroyAllBillboardChains(void);		
+        /** Create a RibbonTrail, an object which you can use to render
+            a linked chain of billboards which follows one or more nodes.
+        @param
+            name The name to be given to the object (must be unique).
+        */
+        virtual RibbonTrail* createRibbonTrail(const String& name);
+        /** Retrieves a pointer to the named RibbonTrail. 
+		@note Throws an exception if the named instance does not exist
+		*/
+        virtual RibbonTrail* getRibbonTrail(const String& name) const;
+		/** Returns whether a ribbon trail with the given name exists.
+		*/
+		virtual bool hasRibbonTrail(const String& name) const;
+
+        /** Removes & destroys a RibbonTrail from the SceneManager.
+        */
+        virtual void destroyRibbonTrail(RibbonTrail* obj);
+		/** Removes & destroys a RibbonTrail from the SceneManager.
+		*/
+		virtual void destroyRibbonTrail(const String& name);
+		/** Removes & destroys all RibbonTrails from the SceneManager.
+		*/
+		virtual void destroyAllRibbonTrails(void);		
+
+        /** Creates a particle system based on a template.
+        @remarks
+            This method creates a new ParticleSystem instance based on the named template
+			(defined through ParticleSystemManager::createTemplate) and returns a 
+            pointer to the caller. The caller should not delete this object, it will be freed at system shutdown, 
+            or can be released earlier using the destroyParticleSystem method.
+        @par
+            Each system created from a template takes the template's settings at the time of creation, 
+            but is completely separate from the template from there on. 
+        @par
+            Creating a particle system does not make it a part of the scene. As with other MovableObject
+            subclasses, a ParticleSystem is not rendered until it is attached to a SceneNode. 
+        @par
+            This is probably the more useful particle system creation method since it does not require manual
+            setup of the system. Note that the initial quota is based on the template but may be changed later.
+        @param 
+            name The name to give the new particle system instance.
+        @param 
+            templateName The name of the template to base the new instance on.
+        */
+        virtual ParticleSystem* createParticleSystem(const String& name,
+			const String& templateName);
+        /** Create a blank particle system.
+        @remarks
+            This method creates a new, blank ParticleSystem instance and returns a pointer to it.
+            The caller should not delete this object, it will be freed at system shutdown, or can
+            be released earlier using the destroyParticleSystem method.
+        @par
+            The instance returned from this method won't actually do anything because on creation a
+            particle system has no emitters. The caller should manipulate the instance through it's 
+            ParticleSystem methods to actually create a real particle effect. 
+        @par
+            Creating a particle system does not make it a part of the scene. As with other MovableObject
+            subclasses, a ParticleSystem is not rendered until it is attached to a SceneNode. 
+        @param
+            name The name to give the ParticleSystem.
+        @param 
+            quota The maximum number of particles to allow in this system. 
+        @param
+            resourceGroup The resource group which will be used to load dependent resources
+        */
+        virtual ParticleSystem* createParticleSystem(const String& name,
+			size_t quota = 500, 
+            const String& resourceGroup = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+        /** Retrieves a pointer to the named ParticleSystem. 
+		@note Throws an exception if the named instance does not exist
+		*/
+        virtual ParticleSystem* getParticleSystem(const String& name) const;
+		/** Returns whether a particle system with the given name exists.
+		*/
+		virtual bool hasParticleSystem(const String& name) const;
+
+        /** Removes & destroys a ParticleSystem from the SceneManager.
+        */
+        virtual void destroyParticleSystem(ParticleSystem* obj);
+		/** Removes & destroys a ParticleSystem from the SceneManager.
+		*/
+		virtual void destroyParticleSystem(const String& name);
+		/** Removes & destroys all ParticleSystems from the SceneManager.
+		*/
+		virtual void destroyAllParticleSystems(void);		
+
+		/** Empties the entire scene, inluding all SceneNodes, Entities, Lights, 
+            BillboardSets etc. Cameras are not deleted at this stage since
+            they are still referenced by viewports, which are not destroyed during
+            this process.
+        */
+        virtual void clearScene(void);
+
+        /** Sets the ambient light level to be used for the scene.
+            @remarks
+                This sets the colour and intensity of the ambient light in the scene, i.e. the
+                light which is 'sourceless' and illuminates all objects equally.
+                The colour of an object is affected by a combination of the light in the scene,
+                and the amount of light that object reflects (in this case based on the Material::ambient
+                property).
+            @remarks
+                By default the ambient light in the scene is ColourValue::Black, i.e. no ambient light. This
+                means that any objects rendered with a Material which has lighting enabled (see Material::setLightingEnabled)
+                will not be visible unless you have some dynamic lights in your scene.
+        */
+        void setAmbientLight(const ColourValue& colour);
+
+        /** Returns the ambient light level to be used for the scene.
+        */
+        const ColourValue& getAmbientLight(void) const;
+
+        /** Sets the source of the 'world' geometry, i.e. the large, mainly static geometry
+            making up the world e.g. rooms, landscape etc.
+            @remarks
+                Depending on the type of SceneManager (subclasses will be specialised
+                for particular world geometry types) you have requested via the Root or
+                SceneManagerEnumerator classes, you can pass a filename to this method and it
+                will attempt to load the world-level geometry for use. If you try to load
+                an inappropriate type of world data an exception will be thrown. The default
+                SceneManager cannot handle any sort of world geometry and so will always
+                throw an exception. However subclasses like BspSceneManager can load
+                particular types of world geometry e.g. "q3dm1.bsp".
+        */
+        virtual void setWorldGeometry(const String& filename);
+
+        /** Sets the source of the 'world' geometry, i.e. the large, mainly 
+			static geometry making up the world e.g. rooms, landscape etc.
+            @remarks
+                Depending on the type of SceneManager (subclasses will be 
+				specialised for particular world geometry types) you have 
+				requested via the Root or SceneManagerEnumerator classes, you 
+				can pass a stream to this method and it will attempt to load 
+				the world-level geometry for use. If the manager can only 
+				handle one input format the typeName parameter is not required.
+				The stream passed will be read (and it's state updated). 
+			@param stream Data stream containing data to load
+			@param typeName String identifying the type of world geometry
+				contained in the stream - not required if this manager only 
+				supports one type of world geometry.
+        */
+		virtual void setWorldGeometry(DataStreamPtr& stream, 
+			const String& typeName = StringUtil::BLANK);
+
+        /** Estimate the number of loading stages required to load the named
+            world geometry. 
+        @remarks
+            This method should be overridden by SceneManagers that provide
+            custom world geometry that can take some time to load. They should
+            return from this method a count of the number of stages of progress
+            they can report on whilst loading. During real loading (setWorldGeomtry),
+            they should call ResourceGroupManager::_notifyWorldGeometryProgress exactly
+            that number of times when loading the geometry for real.
+        @note 
+            The default is to return 0, ie to not report progress. 
+        */
+        virtual size_t estimateWorldGeometry(const String& filename) { return 0; }
+
+        /** Estimate the number of loading stages required to load the named
+            world geometry. 
+        @remarks
+			Operates just like the version of this method which takes a
+			filename, but operates on a stream instead. Note that since the
+			stream is updated, you'll need to reset the stream or reopen it
+			when it comes to loading it for real.
+		@param stream Data stream containing data to load
+		@param typeName String identifying the type of world geometry
+			contained in the stream - not required if this manager only 
+			supports one type of world geometry.
+		*/		
+        virtual size_t estimateWorldGeometry(DataStreamPtr& stream, 
+			const String& typeName = StringUtil::BLANK) { return 0; }
+        /** Asks the SceneManager to provide a suggested viewpoint from which the scene should be viewed.
+            @remarks
+                Typically this method returns the origin unless a) world geometry has been loaded using
+                SceneManager::setWorldGeometry and b) that world geometry has suggested 'start' points.
+                If there is more than one viewpoint which the scene manager can suggest, it will always suggest
+                the first one unless the random parameter is true.
+            @param
+                random If true, and there is more than one possible suggestion, a random one will be used. If false
+                the same one will always be suggested.
+            @return
+                On success, true is returned.
+            @par
+                On failiure, false is returned.
+        */
+        virtual ViewPoint getSuggestedViewpoint(bool random = false);
+
+        /** Method for setting a specific option of the Scene Manager. These options are usually
+            specific for a certain implemntation of the Scene Manager class, and may (and probably
+            will) not exist across different implementations.
+            @param
+                strKey The name of the option to set
+            @param
+                pValue A pointer to the value - the size should be calculated by the scene manager
+                based on the key
+            @return
+                On success, true is returned.
+            @par
+                On failiure, false is returned.
+        */
+        virtual bool setOption( const String& strKey, const void* pValue ) { return false; }
+
+        /** Method for getting the value of an implementation-specific Scene Manager option.
+            @param
+                strKey The name of the option
+            @param
+                pDestValue A pointer to a memory location where the value will
+                be copied. Currently, the memory will be allocated by the
+                scene manager, but this may change
+            @return
+                On success, true is returned and pDestValue points to the value of the given
+                option.
+            @par
+                On failiure, false is returned and pDestValue is set to NULL.
+        */
+        virtual bool getOption( const String& strKey, void* pDestValue ) { return false; }
+
+        /** Method for verifying wether the scene manager has an implementation-specific
+            option.
+            @param
+                strKey The name of the option to check for.
+            @return
+                If the scene manager contains the given option, true is returned.
+            @remarks
+                If it does not, false is returned.
+        */
+        virtual bool hasOption( const String& strKey ) const { return false; }
+        /** Method for getting all possible values for a specific option. When this list is too large
+            (i.e. the option expects, for example, a float), the return value will be true, but the
+            list will contain just one element whose size will be set to 0.
+            Otherwise, the list will be filled with all the possible values the option can
+            accept.
+            @param
+                strKey The name of the option to get the values for.
+            @param
+                refValueList A reference to a list that will be filled with the available values.
+            @return
+                On success (the option exists), true is returned.
+            @par
+                On failure, false is returned.
+        */
+        virtual bool getOptionValues( const String& strKey, StringVector& refValueList ) { return false; }
+
+        /** Method for getting all the implementation-specific options of the scene manager.
+            @param
+                refKeys A reference to a list that will be filled with all the available options.
+            @return
+                On success, true is returned. On failiure, false is returned.
+        */
+        virtual bool getOptionKeys( StringVector& refKeys ) { return false; }
+
+        /** Internal method for updating the scene graph ie the tree of SceneNode instances managed by this class.
+            @remarks
+                This must be done before issuing objects to the rendering pipeline, since derived transformations from
+                parent nodes are not updated until required. This SceneManager is a basic implementation which simply
+                updates all nodes from the root. This ensures the scene is up to date but requires all the nodes
+                to be updated even if they are not visible. Subclasses could trim this such that only potentially visible
+                nodes are updated.
+        */
+        virtual void _updateSceneGraph(Camera* cam);
+
+        /** Internal method which parses the scene to find visible objects to render.
+            @remarks
+                If you're implementing a custom scene manager, this is the most important method to
+                override since it's here you can apply your custom world partitioning scheme. Once you
+                have added the appropriate objects to the render queue, you can let the default
+                SceneManager objects _renderVisibleObjects handle the actual rendering of the objects
+                you pick.
+            @par
+                Any visible objects will be added to a rendering queue, which is indexed by material in order
+                to ensure objects with the same material are rendered together to minimise render state changes.
+        */
+        virtual void _findVisibleObjects(Camera* cam, VisibleObjectsBoundsInfo* visibleBounds, bool onlyShadowCasters);
+
+        /** Internal method for applying animations to scene nodes.
+        @remarks
+            Uses the internally stored AnimationState objects to apply animation to SceneNodes.
+        */
+        virtual void _applySceneAnimations(void);
+
+        /** Sends visible objects found in _findVisibleObjects to the rendering engine.
+        */
+        virtual void _renderVisibleObjects(void);
+
+        /** Prompts the class to send its contents to the renderer.
+            @remarks
+                This method prompts the scene manager to send the
+                contents of the scene it manages to the rendering
+                pipeline, possibly preceded by some sorting, culling
+                or other scene management tasks. Note that this method is not normally called
+                directly by the user application; it is called automatically
+                by the Ogre rendering loop.
+            @param camera Pointer to a camera from whose viewpoint the scene is to
+                be rendered.
+            @param vp The target viewport
+            @param includeOverlays Whether or not overlay objects should be rendered
+        */
+        virtual void _renderScene(Camera* camera, Viewport* vp, bool includeOverlays);
+
+        /** Internal method for queueing the sky objects with the params as 
+            previously set through setSkyBox, setSkyPlane and setSkyDome.
+        */
+        virtual void _queueSkiesForRendering(Camera* cam);
+
+
+
+        /** Notifies the scene manager of its destination render system
+            @remarks
+                Called automatically by RenderSystem::addSceneManager
+                this method simply notifies the manager of the render
+                system to which its output must be directed.
+            @param
+                sys Pointer to the RenderSystem subclass to be used as a render target.
+        */
+        virtual void _setDestinationRenderSystem(RenderSystem* sys);
+
+        /** Enables / disables a 'sky plane' i.e. a plane at constant
+            distance from the camera representing the sky.
+            @remarks
+                You can create sky planes yourself using the standard mesh and
+                entity methods, but this creates a plane which the camera can
+                never get closer or further away from - it moves with the camera.
+                (NB you could create this effect by creating a world plane which
+                was attached to the same SceneNode as the Camera too, but this
+                would only apply to a single camera whereas this plane applies to
+                any camera using this scene manager).
+            @note
+                To apply scaling, scrolls etc to the sky texture(s) you
+                should use the TextureUnitState class methods.
+            @param
+                enable True to enable the plane, false to disable it
+            @param
+                plane Details of the plane, i.e. it's normal and it's
+                distance from the camera.
+            @param
+                materialName The name of the material the plane will use
+            @param
+                scale The scaling applied to the sky plane - higher values
+                mean a bigger sky plane - you may want to tweak this
+                depending on the size of plane.d and the other
+                characteristics of your scene
+            @param
+                tiling How many times to tile the texture across the sky.
+                Applies to all texture layers. If you need finer control use
+                the TextureUnitState texture coordinate transformation methods.
+            @param
+                drawFirst If true, the plane is drawn before all other
+                geometry in the scene, without updating the depth buffer.
+                This is the safest rendering method since all other objects
+                will always appear in front of the sky. However this is not
+                the most efficient way if most of the sky is often occluded
+                by other objects. If this is the case, you can set this
+                parameter to false meaning it draws <em>after</em> all other
+                geometry which can be an optimisation - however you must
+                ensure that the plane.d value is large enough that no objects
+                will 'poke through' the sky plane when it is rendered.
+			@param
+				bow If zero, the plane will be completely flat (like previous
+				versions.  If above zero, the plane will be curved, allowing
+				the sky to appear below camera level.  Curved sky planes are 
+				simular to skydomes, but are more compatable with fog.
+            @param xsegments, ysegments
+                Determines the number of segments the plane will have to it. This
+                is most important when you are bowing the plane, but may also be useful
+                if you need tesselation on the plane to perform per-vertex effects.
+            @param groupName
+                The name of the resource group to which to assign the plane mesh.
+        */
+        virtual void setSkyPlane(
+            bool enable,
+            const Plane& plane, const String& materialName, Real scale = 1000,
+            Real tiling = 10, bool drawFirst = true, Real bow = 0, 
+            int xsegments = 1, int ysegments = 1, 
+            const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+
+		/** Return whether a key plane is enabled */
+		virtual bool isSkyPlaneEnabled(void) const { return mSkyPlaneEnabled; }
+
+		/** Get the sky plane node, if enabled. */
+		virtual SceneNode* getSkyPlaneNode(void) const { return mSkyPlaneNode; }
+
+		/** Get the parameters used to construct the SkyPlane, if any **/
+		virtual const SkyPlaneGenParameters& getSkyPlaneGenParameters(void) const { return mSkyPlaneGenParameters; }
+
+        /** Enables / disables a 'sky box' i.e. a 6-sided box at constant
+            distance from the camera representing the sky.
+            @remarks
+                You could create a sky box yourself using the standard mesh and
+                entity methods, but this creates a plane which the camera can
+                never get closer or further away from - it moves with the camera.
+                (NB you could create this effect by creating a world box which
+                was attached to the same SceneNode as the Camera too, but this
+                would only apply to a single camera whereas this skybox applies
+                to any camera using this scene manager).
+            @par
+                The material you use for the skybox can either contain layers
+                which are single textures, or they can be cubic textures, i.e.
+                made up of 6 images, one for each plane of the cube. See the
+                TextureUnitState class for more information.
+            @param
+                enable True to enable the skybox, false to disable it
+            @param
+                materialName The name of the material the box will use
+            @param
+                distance Distance in world coorinates from the camera to
+                each plane of the box. The default is normally OK.
+            @param
+                drawFirst If true, the box is drawn before all other
+                geometry in the scene, without updating the depth buffer.
+                This is the safest rendering method since all other objects
+                will always appear in front of the sky. However this is not
+                the most efficient way if most of the sky is often occluded
+                by other objects. If this is the case, you can set this
+                parameter to false meaning it draws <em>after</em> all other
+                geometry which can be an optimisation - however you must
+                ensure that the distance value is large enough that no
+                objects will 'poke through' the sky box when it is rendered.
+            @param
+                orientation Optional parameter to specify the orientation
+                of the box. By default the 'top' of the box is deemed to be
+                in the +y direction, and the 'front' at the -z direction.
+                You can use this parameter to rotate the sky if you want.
+            @param groupName
+                The name of the resource group to which to assign the plane mesh.
+        */
+        virtual void setSkyBox(
+            bool enable, const String& materialName, Real distance = 5000,
+            bool drawFirst = true, const Quaternion& orientation = Quaternion::IDENTITY,
+            const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+
+		/** Return whether a skybox is enabled */
+		virtual bool isSkyBoxEnabled(void) const { return mSkyBoxEnabled; }
+
+		/** Get the skybox node, if enabled. */
+		virtual SceneNode* getSkyBoxNode(void) const { return mSkyBoxNode; }
+
+		/** Get the parameters used to generate the current SkyBox, if any */
+		virtual const SkyBoxGenParameters& getSkyBoxGenParameters(void) const { return mSkyBoxGenParameters; }
+
+		/** Enables / disables a 'sky dome' i.e. an illusion of a curved sky.
+            @remarks
+                A sky dome is actually formed by 5 sides of a cube, but with
+                texture coordinates generated such that the surface appears
+                curved like a dome. Sky domes are appropriate where you need a
+                realistic looking sky where the scene is not going to be
+                'fogged', and there is always a 'floor' of some sort to prevent
+                the viewer looking below the horizon (the distortion effect below
+                the horizon can be pretty horrible, and there is never anyhting
+                directly below the viewer). If you need a complete wrap-around
+                background, use the setSkyBox method instead. You can actually
+                combine a sky box and a sky dome if you want, to give a positional
+                backdrop with an overlayed curved cloud layer.
+            @par
+                Sky domes work well with 2D repeating textures like clouds. You
+                can change the apparant 'curvature' of the sky depending on how
+                your scene is viewed - lower curvatures are better for 'open'
+                scenes like landscapes, whilst higher curvatures are better for
+                say FPS levels where you don't see a lot of the sky at once and
+                the exaggerated curve looks good.
+            @param
+                enable True to enable the skydome, false to disable it
+            @param
+                materialName The name of the material the dome will use
+            @param
+                curvature The curvature of the dome. Good values are
+                between 2 and 65. Higher values are more curved leading to
+                a smoother effect, lower values are less curved meaning
+                more distortion at the horizons but a better distance effect.
+            @param
+                tiling How many times to tile the texture(s) across the
+                dome.
+            @param
+                distance Distance in world coorinates from the camera to
+                each plane of the box the dome is rendered on. The default
+                is normally OK.
+            @param
+                drawFirst If true, the dome is drawn before all other
+                geometry in the scene, without updating the depth buffer.
+                This is the safest rendering method since all other objects
+                will always appear in front of the sky. However this is not
+                the most efficient way if most of the sky is often occluded
+                by other objects. If this is the case, you can set this
+                parameter to false meaning it draws <em>after</em> all other
+                geometry which can be an optimisation - however you must
+                ensure that the distance value is large enough that no
+                objects will 'poke through' the sky when it is rendered.
+            @param
+                orientation Optional parameter to specify the orientation
+                of the dome. By default the 'top' of the dome is deemed to
+                be in the +y direction, and the 'front' at the -z direction.
+                You can use this parameter to rotate the sky if you want.
+            @param groupName
+                The name of the resource group to which to assign the plane mesh.
+        */
+        virtual void setSkyDome(
+            bool enable, const String& materialName, Real curvature = 10,
+            Real tiling = 8, Real distance = 4000, bool drawFirst = true,
+            const Quaternion& orientation = Quaternion::IDENTITY,
+            int xsegments = 16, int ysegments = 16, int ysegments_keep = -1,
+            const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+
+		/** Return whether a skydome is enabled */
+		virtual bool isSkyDomeEnabled(void) const { return mSkyDomeEnabled; }
+
+		/** Get the sky dome node, if enabled. */
+		virtual SceneNode* getSkyDomeNode(void) const { return mSkyDomeNode; }
+
+		/** Get the parameters used to generate the current SkyDome, if any */
+		virtual const SkyDomeGenParameters& getSkyDomeGenParameters(void) const { return mSkyDomeGenParameters; }
+
+		/** Sets the fogging mode applied to the scene.
+            @remarks
+                This method sets up the scene-wide fogging effect. These settings
+                apply to all geometry rendered, UNLESS the material with which it
+                is rendered has it's own fog settings (see Material::setFog).
+            @param
+                mode Set up the mode of fog as described in the FogMode
+                enum, or set to FOG_NONE to turn off.
+            @param
+                colour The colour of the fog. Either set this to the same
+                as your viewport background colour, or to blend in with a
+                skydome or skybox.
+            @param
+                expDensity The density of the fog in FOG_EXP or FOG_EXP2
+                mode, as a value between 0 and 1. The default is 0.001. 
+            @param
+                linearStart Distance in world units at which linear fog starts to
+                encroach. Only applicable if mode is
+                FOG_LINEAR.
+            @param
+                linearEnd Distance in world units at which linear fog becomes completely
+                opaque. Only applicable if mode is
+                FOG_LINEAR.
+        */
+        void setFog(
+            FogMode mode = FOG_NONE, const ColourValue& colour = ColourValue::White,
+            Real expDensity = 0.001, Real linearStart = 0.0, Real linearEnd = 1.0);
+
+        /** Returns the fog mode for the scene.
+        */
+        virtual FogMode getFogMode(void) const;
+
+        /** Returns the fog colour for the scene.
+        */
+        virtual const ColourValue& getFogColour(void) const;
+
+        /** Returns the fog start distance for the scene.
+        */
+        virtual Real getFogStart(void) const;
+
+        /** Returns the fog end distance for the scene.
+        */
+        virtual Real getFogEnd(void) const;
+
+        /** Returns the fog density for the scene.
+        */
+        virtual Real getFogDensity(void) const;
+
+
+        /** Creates a new BillboardSet for use with this scene manager.
+            @remarks
+                This method creates a new BillboardSet which is registered with
+                the SceneManager. The SceneManager will destroy this object when
+                it shuts down or when the SceneManager::clearScene method is
+                called, so the caller does not have to worry about destroying
+                this object (in fact, it definitely should not do this).
+            @par
+                See the BillboardSet documentations for full details of the
+                returned class.
+            @param
+                name The name to give to this billboard set. Must be unique.
+            @param
+                poolSize The initial size of the pool of billboards (see BillboardSet for more information)
+            @see
+                BillboardSet
+        */
+        virtual BillboardSet* createBillboardSet(const String& name, unsigned int poolSize = 20);
+
+        /** Retrieves a pointer to the named BillboardSet.
+		@note Throws an exception if the named instance does not exist
+        */
+        virtual BillboardSet* getBillboardSet(const String& name) const;
+		/** Returns whether a billboardset with the given name exists.
+		*/
+		virtual bool hasBillboardSet(const String& name) const;
+
+        /** Removes & destroys an BillboardSet from the SceneManager.
+            @warning
+                Must only be done if the BillboardSet is not attached
+                to a SceneNode. It may be safer to wait to clear the whole
+                scene. If you are unsure, use clearScene.
+        */
+        virtual void destroyBillboardSet(BillboardSet* set);
+
+        /** Removes & destroys an BillboardSet from the SceneManager by name.
+            @warning
+                Must only be done if the BillboardSet is not attached
+                to a SceneNode. It may be safer to wait to clear the whole
+                scene. If you are unsure, use clearScene.
+        */
+        virtual void destroyBillboardSet(const String& name);
+
+        /** Removes & destroys all BillboardSets.
+        @warning
+        Again, use caution since no BillboardSet must be referred to
+        elsewhere e.g. attached to a SceneNode otherwise a crash
+        is likely. Use clearScene if you are unsure (it clears SceneNode
+        entries too.)
+        @see
+        SceneManager::clearScene
+        */
+        virtual void destroyAllBillboardSets(void);
+
+        /** Tells the SceneManager whether it should render the SceneNodes which 
+            make up the scene as well as the objects in the scene.
+        @remarks
+            This method is mainly for debugging purposes. If you set this to 'true',
+            each node will be rendered as a set of 3 axes to allow you to easily see
+            the orientation of the nodes.
+        */
+        virtual void setDisplaySceneNodes(bool display);
+        /** Returns true if all scene nodes axis are to be displayed */
+        virtual bool getDisplaySceneNodes(void) const {return mDisplayNodes;}
+
+        /** Creates an animation which can be used to animate scene nodes.
+        @remarks
+            An animation is a collection of 'tracks' which over time change the position / orientation
+            of Node objects. In this case, the animation will likely have tracks to modify the position
+            / orientation of SceneNode objects, e.g. to make objects move along a path.
+        @par
+            You don't need to use an Animation object to move objects around - you can do it yourself
+            using the methods of the Node in your FrameListener class. However, when you need relatively
+            complex scripted animation, this is the class to use since it will interpolate between
+            keyframes for you and generally make the whole process easier to manage.
+        @par
+            A single animation can affect multiple Node objects (each AnimationTrack affects a single Node).
+            In addition, through animation blending a single Node can be affected by multiple animations,
+            athough this is more useful when performing skeletal animation (see Skeleton::createAnimation).
+        @par
+            Note that whilst it uses the same classes, the animations created here are kept separate from the
+            skeletal animations of meshes (each Skeleton owns those animations).
+        @param name The name of the animation, must be unique within this SceneManager.
+        @param length The total length of the animation.
+        */
+        virtual Animation* createAnimation(const String& name, Real length);
+
+        /** Looks up an Animation object previously created with createAnimation. 
+		@note Throws an exception if the named instance does not exist
+		*/
+        virtual Animation* getAnimation(const String& name) const;
+		/** Returns whether an animation with the given name exists.
+		*/
+		virtual bool hasAnimation(const String& name) const;
+
+        /** Destroys an Animation. 
+        @remarks
+            You should ensure that none of your code is referencing this animation objects since the 
+            memory will be freed.
+        */
+        virtual void destroyAnimation(const String& name);
+
+        /** Removes all animations created using this SceneManager. */
+        virtual void destroyAllAnimations(void);
+
+        /** Create an AnimationState object for managing application of animations.
+        @remarks
+            You can create Animation objects for animating SceneNode obejcts using the
+            createAnimation method. However, in order to actually apply those animations
+            you have to call methods on Node and Animation in a particular order (namely
+            Node::resetToInitialState and Animation::apply). To make this easier and to
+            help track the current time position of animations, the AnimationState object
+            is provided. </p>
+            So if you don't want to control animation application manually, call this method,
+            update the returned object as you like every frame and let SceneManager apply 
+            the animation state for you.
+        @par
+            Remember, AnimationState objects are disabled by default at creation time. 
+            Turn them on when you want them using their setEnabled method.
+        @par
+            Note that any SceneNode affected by this automatic animation will have it's state
+            reset to it's initial position before application of the animation. Unless specifically
+            modified using Node::setInitialState the Node assumes it's initial state is at the
+            origin. If you want the base state of the SceneNode to be elsewhere, make your changes
+            to the node using the standard transform methods, then call setInitialState to 
+            'bake' this reference position into the node.
+		@par
+			If the target of your animation is to be a generic AnimableValue, you
+			should ensure that it has a base value set (unlike nodes this has no
+			default). @see AnimableValue::setAsBaseValue.
+        @param animName The name of an animation created already with createAnimation.
+        */
+        virtual AnimationState* createAnimationState(const String& animName);
+
+        /** Retrieves animation state as previously created using createAnimationState. 
+		@note Throws an exception if the named instance does not exist
+		*/
+        virtual AnimationState* getAnimationState(const String& animName) const;
+		/** Returns whether an animation state with the given name exists.
+		*/
+		virtual bool hasAnimationState(const String& name) const;
+
+        /** Destroys an AnimationState. 
+        @remarks
+            You should ensure that none of your code is referencing this animation 
+            state object since the memory will be freed.
+        */
+        virtual void destroyAnimationState(const String& name);
+
+        /** Removes all animation states created using this SceneManager. */
+        virtual void destroyAllAnimationStates(void);
+
+        /** Manual rendering method, for advanced users only.
+        @remarks
+            This method allows you to send rendering commands through the pipeline on
+            demand, bypassing OGRE's normal world processing. You should only use this if you
+            really know what you're doing; OGRE does lots of things for you that you really should
+            let it do. However, there are times where it may be useful to have this manual interface,
+            for example overlaying something on top of the scene rendered by OGRE.
+        @par
+            Because this is an instant rendering method, timing is important. The best 
+            time to call it is from a RenderTargetListener event handler.
+        @par
+            Don't call this method a lot, it's designed for rare (1 or 2 times per frame) use. 
+            Calling it regularly per frame will cause frame rate drops!
+        @param rend A RenderOperation object describing the rendering op
+        @param pass The Pass to use for this render
+        @param vp Pointer to the viewport to render to
+        @param worldMatrix The transform to apply from object to world space
+        @param viewMatrix The transform to apply from world to view space
+        @param projMatrix The transform to apply from view to screen space
+        @param doBeginEndFrame If true, beginFrame() and endFrame() are called, 
+            otherwise not. You should leave this as false if you are calling
+            this within the main render loop.
+        */
+        virtual void manualRender(RenderOperation* rend, Pass* pass, Viewport* vp, 
+            const Matrix4& worldMatrix, const Matrix4& viewMatrix, const Matrix4& projMatrix, 
+            bool doBeginEndFrame = false) ;
+
+        /** Retrieves the internal render queue, for advanced users only.
+        @remarks
+            The render queue is mainly used internally to manage the scene object 
+			rendering queue, it also exports some methods to allow advanced users 
+			to configure the behavior of rendering process.
+            Most methods provided by RenderQueue are supposed to be used 
+			internally only, you should reference to the RenderQueue API for 
+			more information. Do not access this directly unless you know what 
+			you are doing.
+        */
+        virtual RenderQueue* getRenderQueue(void);
+
+        /** Registers a new RenderQueueListener which will be notified when render queues
+            are processed.
+        */
+        virtual void addRenderQueueListener(RenderQueueListener* newListener);
+
+        /** Removes a listener previously added with addRenderQueueListener. */
+        virtual void removeRenderQueueListener(RenderQueueListener* delListener);
+
+		/** Adds an item to the 'special case' render queue list.
+		@remarks
+			Normally all render queues are rendered, in their usual sequence, 
+			only varying if a RenderQueueListener nominates for the queue to be 
+			repeated or skipped. This method allows you to add a render queue to 
+			a 'special case' list, which varies the behaviour. The effect of this
+			list depends on the 'mode' in which this list is in, which might be
+			to exclude these render queues, or to include them alone (excluding
+			all other queues). This allows you to perform broad selective
+			rendering without requiring a RenderQueueListener.
+		@param qid The identifier of the queue which should be added to the
+			special case list. Nothing happens if the queue is already in the list.
+		*/
+		virtual void addSpecialCaseRenderQueue(uint8 qid);
+		/** Removes an item to the 'special case' render queue list.
+		@see SceneManager::addSpecialCaseRenderQueue
+		@param qid The identifier of the queue which should be removed from the
+			special case list. Nothing happens if the queue is not in the list.
+		*/
+		virtual void removeSpecialCaseRenderQueue(uint8 qid);
+		/** Clears the 'special case' render queue list.
+		@see SceneManager::addSpecialCaseRenderQueue
+		*/
+		virtual void clearSpecialCaseRenderQueues(void);
+		/** Sets the way the special case render queue list is processed.
+		@see SceneManager::addSpecialCaseRenderQueue
+		@param mode The mode of processing
+		*/
+		virtual void setSpecialCaseRenderQueueMode(SpecialCaseRenderQueueMode mode);
+		/** Gets the way the special case render queue list is processed. */
+		virtual SpecialCaseRenderQueueMode getSpecialCaseRenderQueueMode(void);
+		/** Returns whether or not the named queue will be rendered based on the
+			current 'special case' render queue list and mode.
+		@see SceneManager::addSpecialCaseRenderQueue
+		@param qid The identifier of the queue which should be tested
+		@returns true if the queue will be rendered, false otherwise
+		*/
+		virtual bool isRenderQueueToBeProcessed(uint8 qid);
+
+		/** Sets the render queue that the world geometry (if any) this SceneManager
+			renders will be associated with.
+		@remarks
+			SceneManagers which provide 'world geometry' should place it in a 
+			specialised render queue in order to make it possible to enable / 
+			disable it easily using the addSpecialCaseRenderQueue method. Even 
+			if the SceneManager does not use the render queues to render the 
+			world geometry, it should still pick a queue to represent it's manual
+			rendering, and check isRenderQueueToBeProcessed before rendering.
+		@note
+			Setting this may not affect the actual ordering of rendering the
+			world geometry, if the world geometry is being rendered manually
+			by the SceneManager. If the SceneManager feeds world geometry into
+			the queues, however, the ordering will be affected. 
+		*/
+		virtual void setWorldGeometryRenderQueue(uint8 qid);
+		/** Gets the render queue that the world geometry (if any) this SceneManager
+			renders will be associated with.
+		@remarks
+			SceneManagers which provide 'world geometry' should place it in a 
+			specialised render queue in order to make it possible to enable / 
+			disable it easily using the addSpecialCaseRenderQueue method. Even 
+			if the SceneManager does not use the render queues to render the 
+			world geometry, it should still pick a queue to represent it's manual
+			rendering, and check isRenderQueueToBeProcessed before rendering.
+		*/
+		virtual uint8 getWorldGeometryRenderQueue(void);
+
+		/** Allows all bounding boxes of scene nodes to be displayed. */
+		virtual void showBoundingBoxes(bool bShow);
+
+		/** Returns if all bounding boxes of scene nodes are to be displayed */
+		virtual bool getShowBoundingBoxes() const;
+
+        /** Internal method for notifying the manager that a SceneNode is autotracking. */
+        virtual void _notifyAutotrackingSceneNode(SceneNode* node, bool autoTrack);
+
+        
+        /** Creates an AxisAlignedBoxSceneQuery for this scene manager. 
+        @remarks
+            This method creates a new instance of a query object for this scene manager, 
+            for an axis aligned box region. See SceneQuery and AxisAlignedBoxSceneQuery 
+            for full details.
+        @par
+            The instance returned from this method must be destroyed by calling
+            SceneManager::destroyQuery when it is no longer required.
+        @param box Details of the box which describes the region for this query.
+        @param mask The query mask to apply to this query; can be used to filter out
+            certain objects; see SceneQuery for details.
+        */
+        virtual AxisAlignedBoxSceneQuery* 
+            createAABBQuery(const AxisAlignedBox& box, unsigned long mask = 0xFFFFFFFF);
+        /** Creates a SphereSceneQuery for this scene manager. 
+        @remarks
+            This method creates a new instance of a query object for this scene manager, 
+            for a spherical region. See SceneQuery and SphereSceneQuery 
+            for full details.
+        @par
+            The instance returned from this method must be destroyed by calling
+            SceneManager::destroyQuery when it is no longer required.
+        @param sphere Details of the sphere which describes the region for this query.
+        @param mask The query mask to apply to this query; can be used to filter out
+            certain objects; see SceneQuery for details.
+        */
+        virtual SphereSceneQuery* 
+            createSphereQuery(const Sphere& sphere, unsigned long mask = 0xFFFFFFFF);
+        /** Creates a PlaneBoundedVolumeListSceneQuery for this scene manager. 
+        @remarks
+        This method creates a new instance of a query object for this scene manager, 
+        for a region enclosed by a set of planes (normals pointing inwards). 
+        See SceneQuery and PlaneBoundedVolumeListSceneQuery for full details.
+        @par
+        The instance returned from this method must be destroyed by calling
+        SceneManager::destroyQuery when it is no longer required.
+        @param volumes Details of the volumes which describe the region for this query.
+        @param mask The query mask to apply to this query; can be used to filter out
+        certain objects; see SceneQuery for details.
+        */
+        virtual PlaneBoundedVolumeListSceneQuery* 
+            createPlaneBoundedVolumeQuery(const PlaneBoundedVolumeList& volumes, unsigned long mask = 0xFFFFFFFF);
+
+
+        /** Creates a RaySceneQuery for this scene manager. 
+        @remarks
+            This method creates a new instance of a query object for this scene manager, 
+            looking for objects which fall along a ray. See SceneQuery and RaySceneQuery 
+            for full details.
+        @par
+            The instance returned from this method must be destroyed by calling
+            SceneManager::destroyQuery when it is no longer required.
+        @param ray Details of the ray which describes the region for this query.
+        @param mask The query mask to apply to this query; can be used to filter out
+            certain objects; see SceneQuery for details.
+        */
+        virtual RaySceneQuery* 
+            createRayQuery(const Ray& ray, unsigned long mask = 0xFFFFFFFF);
+        //PyramidSceneQuery* createPyramidQuery(const Pyramid& p, unsigned long mask = 0xFFFFFFFF);
+        /** Creates an IntersectionSceneQuery for this scene manager. 
+        @remarks
+            This method creates a new instance of a query object for locating
+            intersecting objects. See SceneQuery and IntersectionSceneQuery
+            for full details.
+        @par
+            The instance returned from this method must be destroyed by calling
+            SceneManager::destroyQuery when it is no longer required.
+        @param mask The query mask to apply to this query; can be used to filter out
+            certain objects; see SceneQuery for details.
+        */
+        virtual IntersectionSceneQuery* 
+            createIntersectionQuery(unsigned long mask = 0xFFFFFFFF);
+
+        /** Destroys a scene query of any type. */
+        virtual void destroyQuery(SceneQuery* query);
+
+        typedef MapIterator<CameraList> CameraIterator;
+        typedef MapIterator<AnimationList> AnimationIterator;
+
+        /** Returns a specialised MapIterator over all cameras in the scene. 
+		*/
+        CameraIterator getCameraIterator(void) {
+            return CameraIterator(mCameras.begin(), mCameras.end());
+        }
+        /** Returns a specialised MapIterator over all animations in the scene. */
+        AnimationIterator getAnimationIterator(void) {
+            return AnimationIterator(mAnimationsList.begin(), mAnimationsList.end());
+        }
+        /** Returns a specialised MapIterator over all animation states in the scene. */
+        AnimationStateIterator getAnimationStateIterator(void) {
+            return mAnimationStates.getAnimationStateIterator();
+        }
+
+        /** Sets the general shadow technique to be used in this scene.
+        @remarks   
+            There are multiple ways to generate shadows in a scene, and each has 
+            strengths and weaknesses. 
+            <ul><li>Stencil-based approaches can be used to 
+            draw very long, extreme shadows without loss of precision and the 'additive'
+            version can correctly show the shadowing of complex effects like bump mapping
+            because they physically exclude the light from those areas. However, the edges
+            are very sharp and stencils cannot handle transparency, and they involve a 
+            fair amount of CPU work in order to calculate the shadow volumes, especially
+            when animated objects are involved.</li>
+            <li>Texture-based approaches are good for handling transparency (they can, for
+            example, correctly shadow a mesh which uses alpha to represent holes), and they
+            require little CPU overhead, and can happily shadow geometry which is deformed
+            by a vertex program, unlike stencil shadows. However, they have a fixed precision 
+            which can introduce 'jaggies' at long range and have fillrate issues of their own.</li>
+            </ul>
+        @par
+            We support 2 kinds of stencil shadows, and 2 kinds of texture-based shadows, and one
+            simple decal approach. The 2 stencil approaches differ in the amount of multipass work 
+            that is required - the modulative approach simply 'darkens' areas in shadow after the 
+            main render, which is the least expensive, whilst the additive approach has to perform 
+            a render per light and adds the cumulative effect, whcih is more expensive but more 
+            accurate. The texture based shadows both work in roughly the same way, the only difference is
+            that the shadowmap approach is slightly more accurate, but requires a more recent
+            graphics card.
+        @par
+            Note that because mixing many shadow techniques can cause problems, only one technique
+            is supported at once. Also, you should call this method at the start of the 
+            scene setup. 
+        @param technique The shadowing technique to use for the scene.
+        */
+        virtual void setShadowTechnique(ShadowTechnique technique);
+        
+        /** Gets the current shadow technique. */
+        virtual ShadowTechnique getShadowTechnique(void) const { return mShadowTechnique; }
+
+        /** Enables / disables the rendering of debug information for shadows. */
+        virtual void setShowDebugShadows(bool debug) { mDebugShadows = debug; }
+        /** Are debug shadows shown? */
+        virtual bool getShowDebugShadows(void ) const { return mDebugShadows; }
+
+        /** Set the colour used to modulate areas in shadow. 
+        @remarks This is only applicable for shadow techniques which involve 
+            darkening the area in shadow, as opposed to masking out the light. 
+            This colour provided is used as a modulative value to darken the
+            areas.
+        */
+        virtual void setShadowColour(const ColourValue& colour);
+        /** Get the colour used to modulate areas in shadow. 
+        @remarks This is only applicable for shadow techniques which involve 
+        darkening the area in shadow, as opposed to masking out the light. 
+        This colour provided is used as a modulative value to darken the
+        areas.
+        */
+        virtual const ColourValue& getShadowColour(void) const;
+        /** Sets the distance a shadow volume is extruded for a directional light.
+        @remarks
+            Although directional lights are essentially infinite, there are many
+            reasons to limit the shadow extrusion distance to a finite number, 
+            not least of which is compatibility with older cards (which do not
+            support infinite positions), and shadow caster elimination.
+        @par
+            The default value is 10,000 world units. This does not apply to
+            point lights or spotlights, since they extrude up to their 
+            attenuation range.
+        */
+        virtual void setShadowDirectionalLightExtrusionDistance(Real dist); 
+        /** Gets the distance a shadow volume is extruded for a directional light.
+        */
+        virtual Real getShadowDirectionalLightExtrusionDistance(void) const;
+        /** Sets the maximum distance away from the camera that shadows
+        will be visible.
+        @remarks
+        Shadow techniques can be expensive, therefore it is a good idea
+        to limit them to being rendered close to the camera if possible,
+        and to skip the expense of rendering shadows for distance objects.
+        This method allows you to set the distance at which shadows will no
+        longer be rendered.
+        @note
+        Each shadow technique can interpret this subtely differently.
+        For example, one technique may use this to eliminate casters,
+        another might use it to attenuate the shadows themselves.
+        You should tweak this value to suit your chosen shadow technique
+        and scene setup.
+        */
+        virtual void setShadowFarDistance(Real distance);
+        /** Gets the maximum distance away from the camera that shadows
+        will be visible.
+        */
+        virtual Real getShadowFarDistance(void) const
+        { return mShadowFarDist; }
+
+		/** Sets the maximum size of the index buffer used to render shadow
+		 	primitives.
+		@remarks
+			This method allows you to tweak the size of the index buffer used
+			to render shadow primitives (including stencil shadow volumes). The
+			default size is 51,200 entries, which is 100k of GPU memory, or
+			enough to render approximately 17,000 triangles. You can reduce this
+			as long as you do not have any models / world geometry chunks which 
+			could require more than the amount you set.
+		@par
+			The maximum number of triangles required to render a single shadow 
+			volume (including light and dark caps when needed) will be 3x the 
+			number of edges on the light silhouette, plus the number of 
+			light-facing triangles.	On average, half the 
+			triangles will be facing toward the light, but the number of 
+			triangles in the silhouette entirely depends on the mesh - 
+			angular meshes will have a higher silhouette tris/mesh tris
+			ratio than a smooth mesh. You can estimate the requirements for
+			your particular mesh by rendering it alone in a scene with shadows
+			enabled and a single light - rotate it or the light and make a note
+			of how high the triangle count goes (remembering to subtract the 
+			mesh triangle count)
+		@param size The number of indexes; divide this by 3 to determine the
+			number of triangles.
+		*/
+		virtual void setShadowIndexBufferSize(size_t size);
+        /// Get the size of the shadow index buffer
+		virtual size_t getShadowIndexBufferSize(void) const
+		{ return mShadowIndexBufferSize; }
+        /** Set the size of the texture used for all texture-based shadows.
+        @remarks
+            The larger the shadow texture, the better the detail on 
+            texture based shadows, but obviously this takes more memory.
+            The default size is 512. Sizes must be a power of 2.
+		@note This is the simple form, see setShadowTextureConfig for the more 
+			complex form.
+        */
+        virtual void setShadowTextureSize(unsigned short size);
+
+		/** Set the detailed configuration for a shadow texture.
+		@param shadowIndex The index of the texture to configure, must be < the
+			number of shadow textures setting
+		@param width, height The dimensions of the texture
+		@param format The pixel format of the texture
+		*/
+		virtual void setShadowTextureConfig(size_t shadowIndex, unsigned short width, 
+			unsigned short height, PixelFormat format);
+		/** Set the detailed configuration for a shadow texture.
+		@param shadowIndex The index of the texture to configure, must be < the
+			number of shadow textures setting
+		@param config Configuration structure
+		*/
+		virtual void setShadowTextureConfig(size_t shadowIndex, 
+			const ShadowTextureConfig& config);
+
+		/** Get an iterator over the current shadow texture settings. */
+		ConstShadowTextureConfigIterator getShadowTextureConfigIterator() const;
+
+        /** Set the pixel format of the textures used for texture-based shadows.
+        @remarks
+			By default, a colour texture is used (PF_X8R8G8B8) for texture shadows,
+			but if you want to use more advanced texture shadow types you can 
+			alter this. If you do, you will have to also call
+			setShadowTextureCasterMaterial and setShadowTextureReceiverMaterial
+			to provide shader-based materials to use these customised shadow
+			texture formats.
+		@note This is the simple form, see setShadowTextureConfig for the more 
+			complex form.
+        */
+        virtual void setShadowTexturePixelFormat(PixelFormat fmt);
+        /** Set the number of textures allocated for texture-based shadows.
+        @remarks
+            The default number of textures assigned to deal with texture based
+            shadows is 1; however this means you can only have one light casting
+            shadows at the same time. You can increase this number in order to 
+            make this more flexible, but be aware of the texture memory it will use.
+        */
+        virtual void setShadowTextureCount(size_t count);
+        /// Get the number of the textures allocated for texture based shadows
+        size_t getShadowTextureCount(void) const {return mShadowTextureConfigList.size(); }
+        /** Sets the size and count of textures used in texture-based shadows. 
+        @remarks
+            @see setShadowTextureSize and setShadowTextureCount for details, this
+            method just allows you to change both at once, which can save on 
+            reallocation if the textures have already been created.
+		@note This is the simple form, see setShadowTextureConfig for the more 
+			complex form.
+        */
+        virtual void setShadowTextureSettings(unsigned short size, unsigned short count, 
+			PixelFormat fmt = PF_X8R8G8B8);
+
+		/** Get a reference to the shadow texture currently in use at the given index.
+		@note
+			If you change shadow settings, this reference may no longer
+			be correct, so be sure not to hold the returned reference over 
+			texture shadow configuration changes.
+		*/
+		virtual const TexturePtr& getShadowTexture(size_t shadowIndex);
+
+        /** Sets the proportional distance which a texture shadow which is generated from a
+            directional light will be offset into the camera view to make best use of texture space.
+        @remarks
+            When generating a shadow texture from a directional light, an approximation is used
+            since it is not possible to render the entire scene to one texture. 
+            The texture is projected onto an area centred on the camera, and is
+            the shadow far distance * 2 in length (it is square). This wastes
+            a lot of texture space outside the frustum though, so this offset allows
+            you to move the texture in front of the camera more. However, be aware
+            that this can cause a little shadow 'jittering' during rotation, and
+            that if you move it too far then you'll start to get artefacts close 
+            to the camera. The value is represented as a proportion of the shadow
+            far distance, and the default is 0.6.
+        */
+        virtual void setShadowDirLightTextureOffset(Real offset) { mShadowTextureOffset = offset;}
+		/** Gets the proportional distance which a texture shadow which is generated from a
+		directional light will be offset into the camera view to make best use of texture space.
+		*/
+		virtual Real getShadowDirLightTextureOffset(void)  const { return mShadowTextureOffset; }
+        /** Sets the proportional distance at which texture shadows begin to fade out.
+        @remarks
+            To hide the edges where texture shadows end (in directional lights)
+            Ogre will fade out the shadow in the distance. This value is a proportional
+            distance of the entire shadow visibility distance at which the shadow
+            begins to fade out. The default is 0.7
+        */
+        virtual void setShadowTextureFadeStart(Real fadeStart) 
+        { mShadowTextureFadeStart = fadeStart; }
+        /** Sets the proportional distance at which texture shadows finish to fading out.
+        @remarks
+        To hide the edges where texture shadows end (in directional lights)
+        Ogre will fade out the shadow in the distance. This value is a proportional
+        distance of the entire shadow visibility distance at which the shadow
+        is completely invisible. The default is 0.9.
+        */
+        virtual void setShadowTextureFadeEnd(Real fadeEnd) 
+        { mShadowTextureFadeEnd = fadeEnd; }
+
+		/** Sets whether or not texture shadows should attempt to self-shadow.
+		@remarks
+			The default implementation of texture shadows uses a fixed-function 
+			colour texture projection approach for maximum compatibility, and 
+			as such cannot support self-shadowing. However, if you decide to 
+			implement a more complex shadowing technique using the 
+			setShadowTextureCasterMaterial and setShadowTextureReceiverMaterial 
+			there is a possibility you may be able to support 
+			self-shadowing (e.g by implementing a shader-based shadow map). In 
+			this case you might want to enable this option.
+		@param selfShadow Whether to attempt self-shadowing with texture shadows
+		*/
+		virtual void setShadowTextureSelfShadow(bool selfShadow); 
+
+		/// Gets whether or not texture shadows attempt to self-shadow.
+		virtual bool getShadowTextureSelfShadow(void) const 
+		{ return mShadowTextureSelfShadow; }
+		/** Sets the default material to use for rendering shadow casters.
+		@remarks
+			By default shadow casters are rendered into the shadow texture using
+			an automatically generated fixed-function pass. This allows basic
+			projective texture shadows, but it's possible to use more advanced
+			shadow techniques by overriding the caster and receiver materials, for
+			example providing vertex and fragment programs to implement shadow
+			maps.
+		@par
+			You can rely on the ambient light in the scene being set to the 
+			requested texture shadow colour, if that's useful. 
+		@note
+			Individual objects may also override the vertex program in
+			your default material if their materials include 
+			shadow_caster_vertex_program_ref shadow_receiver_vertex_program_ref
+			entries, so if you use both make sure they are compatible.
+		@note
+			Only a single pass is allowed in your material, although multiple
+			techniques may be used for hardware fallback.
+		*/
+		virtual void setShadowTextureCasterMaterial(const String& name);
+		/** Sets the default material to use for rendering shadow receivers.
+		@remarks
+			By default shadow receivers are rendered as a post-pass using basic
+			modulation. This allows basic projective texture shadows, but it's 
+			possible to use more advanced shadow techniques by overriding the 
+			caster and receiver materials, for example providing vertex and 
+			fragment programs to implement shadow maps.
+		@par
+			You can rely on texture unit 0 containing the shadow texture, and 
+			for the unit to be set to use projective texturing from the light 
+			(only useful if you're using fixed-function, which is unlikely; 
+			otherwise you should rely on the texture_viewproj_matrix auto binding)
+		@note
+			Individual objects may also override the vertex program in
+			your default material if their materials include 
+			shadow_caster_vertex_program_ref shadow_receiver_vertex_program_ref
+			entries, so if you use both make sure they are compatible.
+		@note
+			Only a single pass is allowed in your material, although multiple
+			techniques may be used for hardware fallback.
+		*/
+		virtual void setShadowTextureReceiverMaterial(const String& name);
+
+		/** Sets whether or not shadow casters should be rendered into shadow
+			textures using their back faces rather than their front faces. 
+		@remarks
+			Rendering back faces rather than front faces into a shadow texture
+			can help minimise depth comparison issues, if you're using depth
+			shadowmapping. You will probably still need some biasing but you
+			won't need as much. For solid objects the result is the same anyway,
+			if you have objects with holes you may want to turn this option off.
+			The default is to enable this option.
+		*/
+		virtual void setShadowCasterRenderBackFaces(bool bf) { mShadowCasterRenderBackFaces = bf; }
+
+		/** Gets whether or not shadow casters should be rendered into shadow
+			textures using their back faces rather than their front faces. 
+		*/
+		virtual bool getShadowCasterRenderBackFaces() const { return mShadowCasterRenderBackFaces; }
+
+		/** Set the shadow camera setup to use for all lights which don't have
+			their own shadow camera setup.
+		@see ShadowCameraSetup
+		*/
+		virtual void setShadowCameraSetup(const ShadowCameraSetupPtr& shadowSetup);
+
+		/** Get the shadow camera setup in use for all lights which don't have
+			their own shadow camera setup.
+		@see ShadowCameraSetup
+		*/
+		virtual const ShadowCameraSetupPtr& getShadowCameraSetup() const;
+
+		/** Sets whether we should use an inifinite camera far plane
+			when rendering stencil shadows.
+		@remarks
+			Stencil shadow coherency is very reliant on the shadow volume
+			not being clipped by the far plane. If this clipping happens, you
+			get a kind of 'negative' shadow effect. The best way to achieve
+			coherency is to move the far plane of the camera out to infinity,
+			thus preventing the far plane from clipping the shadow volumes.
+			When combined with vertex program extrusion of the volume to 
+			infinity, which	Ogre does when available, this results in very
+			robust shadow volumes. For this reason, when you enable stencil 
+			shadows, Ogre automatically changes your camera settings to 
+			project to infinity if the card supports it. You can disable this
+			behaviour if you like by calling this method; although you can 
+			never enable infinite projection if the card does not support it.
+		@par	
+			If you disable infinite projection, or it is not available, 
+			you need to be far more careful with your light attenuation /
+			directional light extrusion distances to avoid clipping artefacts
+			at the far plane.
+		@note
+			Recent cards will generally support infinite far plane projection.
+			However, we have found some cases where they do not, especially
+			on Direct3D. There is no standard capability we can check to 
+			validate this, so we use some heuristics based on experience:
+			<UL>
+			<LI>OpenGL always seems to support it no matter what the card</LI>
+			<LI>Direct3D on non-vertex program capable systems (including 
+			vertex program capable cards on Direct3D7) does not
+			support it</LI>
+			<LI>Direct3D on GeForce3 and GeForce4 Ti does not seem to support
+			infinite projection<LI>
+			</UL>
+			Therefore in the RenderSystem implementation, we may veto the use
+			of an infinite far plane based on these heuristics. 
+		*/
+        virtual void setShadowUseInfiniteFarPlane(bool enable) {
+            mShadowUseInfiniteFarPlane = enable; }
+
+		/** Is there a stencil shadow based shadowing technique in use? */
+		virtual bool isShadowTechniqueStencilBased(void) const 
+		{ return (mShadowTechnique & SHADOWDETAILTYPE_STENCIL) != 0; }
+		/** Is there a texture shadow based shadowing technique in use? */
+		virtual bool isShadowTechniqueTextureBased(void) const 
+		{ return (mShadowTechnique & SHADOWDETAILTYPE_TEXTURE) != 0; }
+		/** Is there a modulative shadowing technique in use? */
+		virtual bool isShadowTechniqueModulative(void) const 
+		{ return (mShadowTechnique & SHADOWDETAILTYPE_MODULATIVE) != 0; }
+		/** Is there an additive shadowing technique in use? */
+		virtual bool isShadowTechniqueAdditive(void) const 
+		{ return (mShadowTechnique & SHADOWDETAILTYPE_ADDITIVE) != 0; }
+		/** Is the shadow technique integrated into primary materials? */
+		virtual bool isShadowTechniqueIntegrated(void) const 
+		{ return (mShadowTechnique & SHADOWDETAILTYPE_INTEGRATED) != 0; }
+		/** Is there any shadowing technique in use? */
+		virtual bool isShadowTechniqueInUse(void) const 
+		{ return mShadowTechnique != SHADOWTYPE_NONE; }
+
+		/** Add a shadow listener which will get called back on shadow
+			events.
+		*/
+		virtual void addShadowListener(ShadowListener* s);
+		/** Remove a shadow listener
+		*/
+		virtual void removeShadowListener(ShadowListener* s);
+
+		/** Creates a StaticGeometry instance suitable for use with this
+			SceneManager.
+		@remarks
+			StaticGeometry is a way of batching up geometry into a more 
+			efficient form at the expense of being able to move it. Please 
+			read the StaticGeometry class documentation for full information.
+		@param name The name to give the new object
+		@returns The new StaticGeometry instance
+		*/
+		virtual StaticGeometry* createStaticGeometry(const String& name);
+		/** Retrieve a previously created StaticGeometry instance. 
+		@note Throws an exception if the named instance does not exist
+		*/
+		virtual StaticGeometry* getStaticGeometry(const String& name) const;
+		/** Returns whether a static geometry instance with the given name exists. */
+		virtual bool hasStaticGeometry(const String& name) const;
+		/** Remove & destroy a StaticGeometry instance. */
+		virtual void destroyStaticGeometry(StaticGeometry* geom);
+		/** Remove & destroy a StaticGeometry instance. */
+		virtual void destroyStaticGeometry(const String& name);
+		/** Remove & destroy all StaticGeometry instances. */
+		virtual void destroyAllStaticGeometry(void);
+
+		/** Creates a InstancedGeometry instance suitable for use with this
+			SceneManager.
+		@remarks
+			InstancedGeometry is a way of batching up geometry into a more 
+			efficient form, and still be able to move it. Please 
+			read the InstancedGeometry class documentation for full information.
+		@param name The name to give the new object
+		@returns The new InstancedGeometry instance
+		*/
+		virtual InstancedGeometry* createInstancedGeometry(const String& name);
+		/** Retrieve a previously created InstancedGeometry instance. */
+		virtual InstancedGeometry* getInstancedGeometry(const String& name) const;
+		/** Remove & destroy a InstancedGeometry instance. */
+		virtual void destroyInstancedGeometry(InstancedGeometry* geom);
+		/** Remove & destroy a InstancedGeometry instance. */
+		virtual void destroyInstancedGeometry(const String& name);
+		/** Remove & destroy all InstancedGeometry instances. */
+		virtual void destroyAllInstancedGeometry(void);
+
+
+		/** Create a movable object of the type specified.
+		@remarks
+			This is the generalised form of MovableObject creation where you can
+			create a MovableObject of any specialised type generically, including
+			any new types registered using plugins.
+		@param name The name to give the object. Must be unique within type.
+		@param typeName The type of object to create
+		@param params Optional name/value pair list to give extra parameters to
+			the created object.
+		*/
+		virtual MovableObject* createMovableObject(const String& name, 
+			const String& typeName, const NameValuePairList* params = 0);
+		/** Destroys a MovableObject with the name specified, of the type specified.
+		@remarks
+			The MovableObject will automatically detach itself from any nodes
+			on destruction.
+		*/
+		virtual void destroyMovableObject(const String& name, const String& typeName);
+		/** Destroys a MovableObject.
+		@remarks
+			The MovableObject will automatically detach itself from any nodes
+			on destruction.
+		*/
+		virtual void destroyMovableObject(MovableObject* m);
+		/** Destroy all MovableObjects of a given type. */
+		virtual void destroyAllMovableObjectsByType(const String& typeName);
+		/** Destroy all MovableObjects. */
+		virtual void destroyAllMovableObjects(void);
+		/** Get a reference to a previously created MovableObject. 
+		@note Throws an exception if the named instance does not exist
+		*/
+		virtual MovableObject* getMovableObject(const String& name, const String& typeName) const;
+		/** Returns whether a movable object instance with the given name exists. */
+		virtual bool hasMovableObject(const String& name, const String& typeName) const;
+		typedef MapIterator<MovableObjectMap> MovableObjectIterator;
+		/** Get an iterator over all MovableObect instances of a given type. 
+		@note
+			The iterator returned from this method is not thread safe, do not use this
+			if you are creating or deleting objects of this type in another thread.
+		*/
+		virtual MovableObjectIterator getMovableObjectIterator(const String& typeName);
+		/** Inject a MovableObject instance created externally.
+		@remarks
+			This method 'injects' a MovableObject instance created externally into
+			the MovableObject instance registry held in the SceneManager. You
+			might want to use this if you have a MovableObject which you don't
+			want to register a factory for; for example a MovableObject which 
+			cannot be generally constructed by clients. 
+		@note
+			It is important that the MovableObject has a unique name for the type,
+			and that its getMovableType() method returns a proper type name.
+		*/
+		virtual void injectMovableObject(MovableObject* m);
+		/** Extract a previously injected MovableObject.
+		@remarks
+			Essentially this does the same as destroyMovableObject, but only
+			removes the instance from the internal lists, it does not attempt
+			to destroy it.
+		*/
+		virtual void extractMovableObject(const String& name, const String& typeName);
+		/** Extract a previously injected MovableObject.
+		@remarks
+			Essentially this does the same as destroyMovableObject, but only
+			removes the instance from the internal lists, it does not attempt
+			to destroy it.
+		*/
+		virtual void extractMovableObject(MovableObject* m);
+		/** Extract all injected MovableObjects of a given type.
+		@remarks
+			Essentially this does the same as destroyAllMovableObjectsByType, 
+			but only removes the instances from the internal lists, it does not 
+			attempt to destroy them.
+		*/
+		virtual void extractAllMovableObjectsByType(const String& typeName);
+
+		/** Sets a mask which is bitwise 'and'ed with objects own visibility masks
+			to determine if the object is visible.
+		@remarks
+			Note that this is combined with any per-viewport visibility mask
+			through an 'and' operation. @see Viewport::setVisibilityMask
+		*/
+		virtual void setVisibilityMask(uint32 vmask) { mVisibilityMask = vmask; }
+
+		/** Gets a mask which is bitwise 'and'ed with objects own visibility masks
+			to determine if the object is visible.
+		*/
+		virtual uint32 getVisibilityMask(void) { return mVisibilityMask; }
+
+		/** Internal method for getting the combination between the global visibility
+			mask and the per-viewport visibility mask.
+		*/
+		uint32 _getCombinedVisibilityMask(void) const;
+
+		/** Sets whether the SceneManager should search for visible objects, or
+            whether they are being manually handled.
+        @remarks
+            This is an advanced function, you should not use this unless you know
+            what you are doing.
+		*/
+		virtual void setFindVisibleObjects(bool find) { mFindVisibleObjects = find; }
+
+		/** Gets whether the SceneManager should search for visible objects, or
+            whether they are being manually handled.
+ 		*/
+		virtual bool getFindVisibleObjects(void) { return mFindVisibleObjects; }
+
+		/** Render something as if it came from the current queue.
+			@param pass		Material pass to use for setting up this quad.
+			@param rend		Renderable to render
+			@param shadowDerivation Whether passes should be replaced with shadow caster / receiver passes
+		 */
+		virtual void _injectRenderWithPass(Pass *pass, Renderable *rend, bool shadowDerivation = true);
+
+		/** Indicates to the SceneManager whether it should suppress changing
+			the RenderSystem states when rendering objects.
+		@remarks
+			This method allows you to tell the SceneManager not to change any
+			RenderSystem state until you tell it to. This method is only 
+			intended for advanced use, don't use it if you're unsure of the 
+			effect. The only RenderSystems calls made are to set the world 
+			matrix for each object (note - view an projection matrices are NOT
+			SET - they are under your control) and to render the object; it is up to 
+			the caller to do everything else, including enabling any vertex / 
+			fragment programs and updating their parameter state, and binding
+			parameters to the RenderSystem.
+		@note
+			Calling this implicitly disables shadow processing since no shadows
+			can be rendered without changing state.
+		@param suppress If true, no RenderSystem state changes will be issued
+			until this method is called again with a parameter of false.
+		*/
+		virtual void _suppressRenderStateChanges(bool suppress);
+		
+		/** Are render state changes suppressed? 
+		@see _suppressRenderStateChanges
+		*/
+		virtual bool _areRenderStateChangesSuppressed(void) const
+		{ return mSuppressRenderStateChanges; }
+
+        /** Internal method for setting up the renderstate for a rendering pass.
+            @param pass The Pass details to set.
+			@param evenIfSuppressed Sets the pass details even if render state
+				changes are suppressed; if you are using this to manually set state
+				when render state changes are suppressed, you should set this to 
+				true.
+			@param shadowDerivation If false, disables the derivation of shadow
+				passes from original passes
+            @returns
+                A Pass object that was used instead of the one passed in, can
+                happen when rendering shadow passes
+        */
+        virtual const Pass* _setPass(const Pass* pass, 
+			bool evenIfSuppressed = false, bool shadowDerivation = true);
+
+
+		/** Indicates to the SceneManager whether it should suppress the 
+			active shadow rendering technique until told otherwise.
+		@remarks
+			This is a temporary alternative to setShadowTechnique to suppress
+			the rendering of shadows and forcing all processing down the 
+			standard rendering path. This is intended for internal use only.
+		@param suppress If true, no shadow rendering will occur until this
+			method is called again with a parameter of false.
+		*/
+		virtual void _suppressShadows(bool suppress); 
+
+		/** Are shadows suppressed? 
+		@see _suppressShadows
+		*/
+		virtual bool _areShadowsSuppressed(void) const
+		{ return mSuppressShadows; }
+
+		/** Render the objects in a given queue group 
+		@remarks You should only call this from a RenderQueueInvocation implementation
+		*/
+		virtual void _renderQueueGroupObjects(RenderQueueGroup* group, 
+			QueuedRenderableCollection::OrganisationMode om);
+
+		/** Advanced method for supplying an alternative visitor, used for parsing the
+			render queues and sending the results to the renderer.
+		@remarks
+			You can use this method to insert your own implementation of the 
+			QueuedRenderableVisitor interface, which receives calls as the queued
+			renderables are parsed in a given order (determined by RenderQueueInvocationSequence)
+			and are sent to the renderer. If you provide your own implementation of
+			this visitor, you are responsible for either calling the rendersystem, 
+			or passing the calls on to the base class implementation.
+		@note
+			Ownership is not taken of this pointer, you are still required to 
+			delete it yourself once you're finished.
+		@param visitor Your implementation of SceneMgrQueuedRenderableVisitor. 
+			If you pass 0, the default implementation will be used.
+		*/
+		void setQueuedRenderableVisitor(SceneMgrQueuedRenderableVisitor* visitor);
+
+		/** Gets the current visitor object which processes queued renderables. */
+		SceneMgrQueuedRenderableVisitor* getQueuedRenderableVisitor(void) const;
+
+
+		/** Get the rendersystem subclass to which the output of this Scene Manager
+			gets sent
+		*/
+		RenderSystem *getDestinationRenderSystem();
+
+		/** Gets the current viewport being rendered (advanced use only, only 
+			valid during viewport update. */
+		Viewport* getCurrentViewport(void) const { return mCurrentViewport; }
+
+		/** Returns a visibility boundary box for a specific camera. */
+		const VisibleObjectsBoundsInfo& getVisibleObjectsBoundsInfo(const Camera* cam) const;
+
+		/**  Returns the shadow caster AAB for a specific light-camera combination */
+		const VisibleObjectsBoundsInfo& getShadowCasterBoundsInfo(const Light* light) const;
+    };
+
+    /** Default implementation of IntersectionSceneQuery. */
+    class _OgreExport DefaultIntersectionSceneQuery : 
+        public IntersectionSceneQuery
+    {
+    public:
+        DefaultIntersectionSceneQuery(SceneManager* creator);
+        ~DefaultIntersectionSceneQuery();
+
+        /** See IntersectionSceneQuery. */
+        void execute(IntersectionSceneQueryListener* listener);
+    };
+
+    /** Default implementation of RaySceneQuery. */
+	class _OgreExport DefaultRaySceneQuery : public RaySceneQuery
+    {
+    public:
+        DefaultRaySceneQuery(SceneManager* creator);
+        ~DefaultRaySceneQuery();
+
+        /** See RayScenQuery. */
+        void execute(RaySceneQueryListener* listener);
+    };
+    /** Default implementation of SphereSceneQuery. */
+	class _OgreExport DefaultSphereSceneQuery : public SphereSceneQuery
+    {
+    public:
+        DefaultSphereSceneQuery(SceneManager* creator);
+        ~DefaultSphereSceneQuery();
+
+        /** See SceneQuery. */
+        void execute(SceneQueryListener* listener);
+    };
+    /** Default implementation of PlaneBoundedVolumeListSceneQuery. */
+    class _OgreExport DefaultPlaneBoundedVolumeListSceneQuery : public PlaneBoundedVolumeListSceneQuery
+    {
+    public:
+        DefaultPlaneBoundedVolumeListSceneQuery(SceneManager* creator);
+        ~DefaultPlaneBoundedVolumeListSceneQuery();
+
+        /** See SceneQuery. */
+        void execute(SceneQueryListener* listener);
+    };
+    /** Default implementation of AxisAlignedBoxSceneQuery. */
+	class _OgreExport DefaultAxisAlignedBoxSceneQuery : public AxisAlignedBoxSceneQuery
+    {
+    public:
+        DefaultAxisAlignedBoxSceneQuery(SceneManager* creator);
+        ~DefaultAxisAlignedBoxSceneQuery();
+
+        /** See RayScenQuery. */
+        void execute(SceneQueryListener* listener);
+    };
+    
+
+	/// Bitmask containing scene types
+	typedef uint16 SceneTypeMask;
+
+	/** Classification of a scene to allow a decision of what type of
+	SceenManager to provide back to the application.
+	*/
+	enum SceneType
+	{
+		ST_GENERIC = 1,
+		ST_EXTERIOR_CLOSE = 2,
+		ST_EXTERIOR_FAR = 4,
+		ST_EXTERIOR_REAL_FAR = 8,
+		ST_INTERIOR = 16
+	};
+
+	/** Structure containing information about a scene manager. */
+	struct SceneManagerMetaData
+	{
+		/// A globally unique string identifying the scene manager type
+		String typeName;
+		/// A text description of the scene manager
+		String description;
+		/// A mask describing which sorts of scenes this manager can handle
+		SceneTypeMask sceneTypeMask;
+		/// Flag indicating whether world geometry is supported
+		bool worldGeometrySupported;
+	};
+
+
+
+	/** Class which will create instances of a given SceneManager. */
+	class _OgreExport SceneManagerFactory
+	{
+	protected:
+		mutable SceneManagerMetaData mMetaData;
+		mutable bool mMetaDataInit;
+		/// Internal method to initialise the metadata, must be implemented
+		virtual void initMetaData(void) const = 0;
+	public:
+		SceneManagerFactory() : mMetaDataInit(true) {}
+		virtual ~SceneManagerFactory() {}
+		/** Get information about the SceneManager type created by this factory. */
+		virtual const SceneManagerMetaData& getMetaData(void) const 
+		{
+			if (mMetaDataInit)
+			{
+				initMetaData();
+				mMetaDataInit = false;
+			}
+			return mMetaData; 
+		}
+		/** Create a new instance of a SceneManager.
+		@remarks
+		Don't call directly, use SceneManagerEnumerator::createSceneManager.
+		*/
+		virtual SceneManager* createInstance(const String& instanceName) = 0;
+		/** Destroy an instance of a SceneManager. */
+		virtual void destroyInstance(SceneManager* instance) = 0;
+
+	};
+
+
+
+} // Namespace
+
+
+
+#endif
Index: /OgreMain/include/OgreSceneManagerEnumerator.h
===================================================================
--- /OgreMain/include/OgreSceneManagerEnumerator.h	(revision 5)
+++ /OgreMain/include/OgreSceneManagerEnumerator.h	(revision 5)
@@ -0,0 +1,221 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __SceneManagerEnumerator_H__
+#define __SceneManagerEnumerator_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreSceneManager.h"
+#include "OgreSingleton.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre {
+    
+	/// Factory for default scene manager
+	class _OgreExport DefaultSceneManagerFactory : public SceneManagerFactory
+	{
+	protected:
+		void initMetaData(void) const;
+	public:
+		DefaultSceneManagerFactory() {}
+		~DefaultSceneManagerFactory() {}
+		/// Factory type name
+		static const String FACTORY_TYPE_NAME;
+		SceneManager* createInstance(const String& instanceName);
+		void destroyInstance(SceneManager* instance);
+	};
+	/// Default scene manager
+	class _OgreExport DefaultSceneManager : public SceneManager
+	{
+	public:
+		DefaultSceneManager(const String& name);
+		~DefaultSceneManager();
+		const String& getTypeName(void) const;
+	};
+
+    /** Enumerates the SceneManager classes available to applications.
+        @remarks
+            As described in the SceneManager class, SceneManagers are responsible
+            for organising the scene and issuing rendering commands to the
+            RenderSystem. Certain scene types can benefit from different
+            rendering approaches, and it is intended that subclasses will
+            be created to special case this.
+        @par
+            In order to give applications easy access to these implementations,
+            this class has a number of methods to create or retrieve a SceneManager
+            which is appropriate to the scene type. 
+		@par
+			SceneManagers are created by SceneManagerFactory instances. New factories
+			for new types of SceneManager can be registered with this class to make
+			them available to clients.
+		@par
+			Note that you can still plug in your own custom SceneManager without
+			using a factory, should you choose, it's just not as flexible that way.
+			Just instantiate your own SceneManager manually and use it directly.
+    */
+    class _OgreExport SceneManagerEnumerator : public Singleton<SceneManagerEnumerator>
+    {
+	public:
+		/// Scene manager instances, indexed by instance name
+		typedef std::map<String, SceneManager*> Instances;
+		/// List of available scene manager types as meta data
+		typedef std::vector<const SceneManagerMetaData*> MetaDataList;
+    private:
+		/// Scene manager factories
+		typedef std::list<SceneManagerFactory*> Factories;
+		Factories mFactories;
+		Instances mInstances;
+		/// Stored separately to allow iteration
+		MetaDataList mMetaDataList;
+		/// Factory for default scene manager
+		DefaultSceneManagerFactory mDefaultFactory;
+		/// Count of creations for auto-naming
+		unsigned long mInstanceCreateCount;
+		/// Currently assigned render system
+		RenderSystem* mCurrentRenderSystem;
+
+
+    public:
+        SceneManagerEnumerator();
+        ~SceneManagerEnumerator();
+
+		/** Register a new SceneManagerFactory. 
+		@remarks
+			Plugins should call this to register as new SceneManager providers.
+		*/
+		void addFactory(SceneManagerFactory* fact);
+
+		/** Remove a SceneManagerFactory. 
+		*/
+		void removeFactory(SceneManagerFactory* fact);
+
+		/** Get more information about a given type of SceneManager.
+		@remarks
+			The metadata returned tells you a few things about a given type 
+			of SceneManager, which can be created using a factory that has been
+			registered already. 
+		@param typeName The type name of the SceneManager you want to enquire on.
+			If you don't know the typeName already, you can iterate over the 
+			metadata for all types using getMetaDataIterator.
+		*/
+		const SceneManagerMetaData* getMetaData(const String& typeName) const;
+
+		typedef ConstVectorIterator<MetaDataList> MetaDataIterator;
+		/** Iterate over all types of SceneManager available for construction, 
+			providing some information about each one.
+		*/
+		MetaDataIterator getMetaDataIterator(void) const;
+
+		/** Create a SceneManager instance of a given type.
+		@remarks
+			You can use this method to create a SceneManager instance of a 
+			given specific type. You may know this type already, or you may
+			have discovered it by looking at the results from getMetaDataIterator.
+		@note
+			This method throws an exception if the named type is not found.
+		@param typeName String identifying a unique SceneManager type
+		@param instanceName Optional name to given the new instance that is
+			created. If you leave this blank, an auto name will be assigned.
+		*/
+		SceneManager* createSceneManager(const String& typeName, 
+			const String& instanceName = StringUtil::BLANK);
+
+		/** Create a SceneManager instance based on scene type support.
+		@remarks
+			Creates an instance of a SceneManager which supports the scene types
+			identified in the parameter. If more than one type of SceneManager 
+			has been registered as handling that combination of scene types, 
+			in instance of the last one registered is returned.
+		@note This method always succeeds, if a specific scene manager is not
+			found, the default implementation is always returned.
+		@param typeMask A mask containing one or more SceneType flags
+		@param instanceName Optional name to given the new instance that is
+			created. If you leave this blank, an auto name will be assigned.
+		*/
+		SceneManager* createSceneManager(SceneTypeMask typeMask, 
+			const String& instanceName = StringUtil::BLANK);
+
+		/** Destroy an instance of a SceneManager. */
+		void destroySceneManager(SceneManager* sm);
+
+		/** Get an existing SceneManager instance that has already been created,
+			identified by the instance name.
+		@param instanceName The name of the instance to retrieve.
+		*/
+		SceneManager* getSceneManager(const String& instanceName) const;
+
+		typedef MapIterator<Instances> SceneManagerIterator;
+		/** Get an iterator over all the existing SceneManager instances. */
+		SceneManagerIterator getSceneManagerIterator(void);
+
+        /** Notifies all SceneManagers of the destination rendering system.
+        */
+        void setRenderSystem(RenderSystem* rs);
+
+        /// Utility method to control shutdown of the managers
+        void shutdownAll(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static SceneManagerEnumerator& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static SceneManagerEnumerator* getSingletonPtr(void);
+
+    };
+
+
+}
+
+#endif
Index: /OgreMain/include/OgreSceneNode.h
===================================================================
--- /OgreMain/include/OgreSceneNode.h	(revision 5)
+++ /OgreMain/include/OgreSceneNode.h	(revision 5)
@@ -0,0 +1,448 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _SceneNode_H__
+#define _SceneNode_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreNode.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreAxisAlignedBox.h"
+
+namespace Ogre {
+
+	// forward decl
+	struct VisibleObjectsBoundsInfo;
+
+    /** Class representing a node in the scene graph.
+        @remarks
+            A SceneNode is a type of Node which is used to organise objects in a scene.
+            It has the same hierarchical transformation properties of the generic Node class,
+            but also adds the ability to attach world objects to the node, and stores hierarchical
+            bounding volumes of the nodes in the tree.
+            Child nodes are contained within the bounds of the parent, and so on down the
+            tree, allowing for fast culling.
+    */
+    class _OgreExport SceneNode : public Node
+    {
+    public:
+        typedef HashMap<String, MovableObject*> ObjectMap;
+        typedef MapIterator<ObjectMap> ObjectIterator;
+		typedef ConstMapIterator<ObjectMap> ConstObjectIterator;
+
+    protected:
+        ObjectMap mObjectsByName;
+
+		/// Pointer to a Wire Bounding Box for this Node
+		WireBoundingBox *mWireBoundingBox;
+		/// Flag that determines if the bounding box of the node should be displayed
+		bool mShowBoundingBox;
+
+        /// SceneManager which created this node
+        SceneManager* mCreator;
+
+        /// World-Axis aligned bounding box, updated only through _update
+        AxisAlignedBox mWorldAABB;
+
+        /** @copydoc Node::updateFromParentImpl. */
+        void updateFromParentImpl(void) const;
+
+        /** See Node. */
+        Node* createChildImpl(void);
+
+        /** See Node. */
+        Node* createChildImpl(const String& name);
+
+		/** See Node */
+		void setParent(Node* parent);
+
+		/** Internal method for setting whether the node is in the scene 
+			graph.
+		*/
+		virtual void setInSceneGraph(bool inGraph);
+
+        /// Whether to yaw around a fixed axis.
+        bool mYawFixed;
+        /// Fixed axis to yaw around
+        Vector3 mYawFixedAxis;
+
+        /// Auto tracking target
+        SceneNode* mAutoTrackTarget;
+        /// Tracking offset for fine tuning
+        Vector3 mAutoTrackOffset;
+        /// Local 'normal' direction vector
+        Vector3 mAutoTrackLocalDirection;
+		/// Is this node a current part of the scene graph?
+		bool mIsInSceneGraph;
+    public:
+        /** Constructor, only to be called by the creator SceneManager.
+        @remarks
+            Creates a node with a generated name.
+        */
+        SceneNode(SceneManager* creator);
+        /** Constructor, only to be called by the creator SceneManager.
+        @remarks
+            Creates a node with a specified name.
+        */
+        SceneNode(SceneManager* creator, const String& name);
+        ~SceneNode();
+
+        /** Adds an instance of a scene object to this node.
+        @remarks
+            Scene objects can include Entity objects, Camera objects, Light objects, 
+            ParticleSystem objects etc. Anything that subclasses from MovableObject.
+        */
+        virtual void attachObject(MovableObject* obj);
+
+        /** Reports the number of objects attached to this node.
+        */
+        virtual unsigned short numAttachedObjects(void) const;
+
+        /** Retrieves a pointer to an attached object.
+        @remarks Retrieves by index, see alternate version to retrieve by name. The index
+        of an object may change as other objects are added / removed.
+        */
+        virtual MovableObject* getAttachedObject(unsigned short index);
+
+        /** Retrieves a pointer to an attached object.
+        @remarks Retrieves by object name, see alternate version to retrieve by index.
+        */
+        virtual MovableObject* getAttachedObject(const String& name);
+
+        /** Detaches the indexed object from this scene node.
+        @remarks
+            Detaches by index, see the alternate version to detach by name. Object indexes
+            may change as other objects are added / removed.
+        */
+        virtual MovableObject* detachObject(unsigned short index);
+        /** Detaches an object by pointer. */
+        virtual void detachObject(MovableObject* obj);
+
+        /** Detaches the named object from this node and returns a pointer to it. */
+        virtual MovableObject* detachObject(const String& name);
+
+        /** Detaches all objects attached to this node.
+        */
+        virtual void detachAllObjects(void);
+
+		/** Determines whether this node is in the scene graph, ie
+			whether it's ulitimate ancestor is the root scene node.
+		*/
+		virtual bool isInSceneGraph(void) const { return mIsInSceneGraph; }
+
+		/** Notifies this SceneNode that it is the root scene node. 
+		@remarks
+			Only SceneManager should call this!
+		*/
+		virtual void _notifyRootNode(void) { mIsInSceneGraph = true; }
+			
+
+        /** Internal method to update the Node.
+            @note
+                Updates this scene node and any relevant children to incorporate transforms etc.
+                Don't call this yourself unless you are writing a SceneManager implementation.
+            @param
+                updateChildren If true, the update cascades down to all children. Specify false if you wish to
+                update children separately, e.g. because of a more selective SceneManager implementation.
+            @param
+                parentHasChanged This flag indicates that the parent xform has changed,
+                    so the child should retrieve the parent's xform and combine it with its own
+                    even if it hasn't changed itself.
+        */
+        virtual void _update(bool updateChildren, bool parentHasChanged);
+
+		/** Tells the SceneNode to update the world bound info it stores.
+		*/
+		virtual void _updateBounds(void);
+
+        /** Internal method which locates any visible objects attached to this node and adds them to the passed in queue.
+            @remarks
+                Should only be called by a SceneManager implementation, and only after the _updat method has been called to
+                ensure transforms and world bounds are up to date.
+                SceneManager implementations can choose to let the search cascade automatically, or choose to prevent this
+                and select nodes themselves based on some other criteria.
+            @param
+                cam The active camera
+            @param
+                queue The SceneManager's rendering queue
+			@param
+				visibleBounds bounding information created on the fly containing all visible objects by the camera
+            @param
+                includeChildren If true, the call is cascaded down to all child nodes automatically.
+            @param
+                displayNodes If true, the nodes themselves are rendered as a set of 3 axes as well
+                    as the objects being rendered. For debugging purposes.
+        */
+		virtual void _findVisibleObjects(Camera* cam, RenderQueue* queue, 
+			VisibleObjectsBoundsInfo* visibleBounds, 
+            bool includeChildren = true, bool displayNodes = false, bool onlyShadowCasters = false);
+
+        /** Gets the axis-aligned bounding box of this node (and hence all subnodes).
+        @remarks
+            Recommended only if you are extending a SceneManager, because the bounding box returned
+            from this method is only up to date after the SceneManager has called _update.
+        */
+        virtual const AxisAlignedBox& _getWorldAABB(void) const;
+
+        /** Retrieves an iterator which can be used to efficiently step through the objects 
+            attached to this node.
+        @remarks
+            This is a much faster way to go through <B>all</B> the objects attached to the node
+            than using getAttachedObject. But the iterator returned is only valid until a change
+            is made to the collection (ie an addition or removal) so treat the returned iterator
+            as transient, and don't add / remove items as you go through the iterator, save changes
+            until the end, or retrieve a new iterator after making the change. Making changes to
+            the object returned through the iterator is OK though.
+        */
+        virtual ObjectIterator getAttachedObjectIterator(void);
+        /** Retrieves an iterator which can be used to efficiently step through the objects 
+            attached to this node.
+        @remarks
+            This is a much faster way to go through <B>all</B> the objects attached to the node
+            than using getAttachedObject. But the iterator returned is only valid until a change
+            is made to the collection (ie an addition or removal) so treat the returned iterator
+            as transient, and don't add / remove items as you go through the iterator, save changes
+            until the end, or retrieve a new iterator after making the change. Making changes to
+            the object returned through the iterator is OK though.
+        */
+		virtual ConstObjectIterator getAttachedObjectIterator(void) const;
+
+        /** Gets the creator of this scene node. 
+        @remarks
+            This method returns the SceneManager which created this node.
+            This can be useful for destroying this node.
+        */
+        SceneManager* getCreator(void) const { return mCreator; }
+
+        /** This method removes and destroys the named child and all of its children.
+        @remarks
+            Unlike removeChild, which removes a single named child from this
+            node but does not destroy it, this method destroys the child
+            and all of it's children. 
+        @par
+            Use this if you wish to recursively destroy a node as well as 
+            detaching it from it's parent. Note that any objects attached to
+            the nodes will be detached but will not themselves be destroyed.
+        */
+        virtual void removeAndDestroyChild(const String& name);
+
+        /** This method removes and destroys the child and all of its children.
+        @remarks
+            Unlike removeChild, which removes a single named child from this
+            node but does not destroy it, this method destroys the child
+            and all of it's children. 
+        @par
+            Use this if you wish to recursively destroy a node as well as 
+            detaching it from it's parent. Note that any objects attached to
+            the nodes will be detached but will not themselves be destroyed.
+        */
+        virtual void removeAndDestroyChild(unsigned short index);
+
+        /** Removes and destroys all children of this node.
+        @remarks
+            Use this to destroy all child nodes of this node and remove
+            them from the scene graph. Note that all objects attached to this
+            node will be detached but will not be destroyed.
+        */
+        virtual void removeAndDestroyAllChildren(void);
+
+        /** Allows the showing of the node's bounding box.
+        @remarks
+            Use this to show or hide the bounding box of the node.
+        */
+		virtual void showBoundingBox(bool bShow);
+
+        /** Add the bounding box to the rendering queue.
+        */
+		virtual void _addBoundingBoxToQueue(RenderQueue* queue);
+
+        /** This allows scene managers to determine if the node's bounding box
+			should be added to the rendering queue.
+        @remarks
+            Scene Managers that implement their own _findVisibleObjects will have to 
+			check this flag and then use _addBoundingBoxToQueue to add the bounding box
+			wireframe.
+        */
+		virtual bool getShowBoundingBox() const;
+
+        /** Creates an unnamed new SceneNode as a child of this node.
+        @param
+            translate Initial translation offset of child relative to parent
+        @param
+            rotate Initial rotation relative to parent
+        */
+        virtual SceneNode* createChildSceneNode(
+            const Vector3& translate = Vector3::ZERO, 
+            const Quaternion& rotate = Quaternion::IDENTITY );
+
+        /** Creates a new named SceneNode as a child of this node.
+        @remarks
+            This creates a child node with a given name, which allows you to look the node up from 
+            the parent which holds this collection of nodes.
+            @param
+                translate Initial translation offset of child relative to parent
+            @param
+                rotate Initial rotation relative to parent
+        */
+        virtual SceneNode* createChildSceneNode(const String& name, const Vector3& translate = Vector3::ZERO, const Quaternion& rotate = Quaternion::IDENTITY);
+
+        /** Allows retrieval of the nearest lights to the centre of this SceneNode.
+        @remarks
+            This method allows a list of lights, ordered by proximity to the centre
+            of this SceneNode, to be retrieved. Can be useful when implementing
+            MovableObject::queryLights and Renderable::getLights.
+        @par
+            Note that only lights could be affecting the frustum will take into
+            account, which cached in scene manager.
+        @see SceneManager::_getLightsAffectingFrustum
+        @see SceneManager::_populateLightList
+        @param destList List to be populated with ordered set of lights; will be
+            cleared by this method before population.
+        @param radius Parameter to specify lights intersecting a given radius of
+            this SceneNode's centre.
+        */
+        virtual void findLights(LightList& destList, Real radius) const;
+
+        /** Tells the node whether to yaw around it's own local Y axis or a fixed axis of choice.
+        @remarks
+        This method allows you to change the yaw behaviour of the node - by default, it
+        yaws around it's own local Y axis when told to yaw with TS_LOCAL, this makes it
+        yaw around a fixed axis. 
+        You only really need this when you're using auto tracking (see setAutoTracking,
+        because when you're manually rotating a node you can specify the TransformSpace
+        in which you wish to work anyway.
+        @param
+        useFixed If true, the axis passed in the second parameter will always be the yaw axis no
+        matter what the node orientation. If false, the node returns to it's default behaviour.
+        @param
+        fixedAxis The axis to use if the first parameter is true.
+        */
+        virtual void setFixedYawAxis( bool useFixed, const Vector3& fixedAxis = Vector3::UNIT_Y );
+
+		/** Rotate the node around the Y-axis.
+		*/
+		virtual void yaw(const Radian& angle, TransformSpace relativeTo = TS_LOCAL);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+		inline void yaw(Real degrees, TransformSpace relativeTo = TS_LOCAL) {
+			yaw ( Angle(degrees), relativeTo );
+		}
+#endif//OGRE_FORCE_ANGLE_TYPES
+        /** Sets the node's direction vector ie it's local -z.
+        @remarks
+        Note that the 'up' vector for the orientation will automatically be 
+        recalculated based on the current 'up' vector (i.e. the roll will 
+        remain the same). If you need more control, use setOrientation.
+        @param x,y,z The components of the direction vector
+        @param relativeTo The space in which this direction vector is expressed
+        @param localDirectionVector The vector which normally describes the natural
+        direction of the node, usually -Z
+        */
+        virtual void setDirection(Real x, Real y, Real z, 
+            TransformSpace relativeTo = TS_LOCAL, 
+            const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
+
+        /** Sets the node's direction vector ie it's local -z.
+        @remarks
+        Note that the 'up' vector for the orientation will automatically be 
+        recalculated based on the current 'up' vector (i.e. the roll will 
+        remain the same). If you need more control, use setOrientation.
+        @param vec The direction vector
+        @param relativeTo The space in which this direction vector is expressed
+        @param localDirectionVector The vector which normally describes the natural
+        direction of the node, usually -Z
+        */
+        virtual void setDirection(const Vector3& vec, TransformSpace relativeTo = TS_LOCAL, 
+            const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
+        /** Points the local -Z direction of this node at a point in space.
+        @param targetPoint A vector specifying the look at point.
+        @param relativeTo The space in which the point resides
+        @param localDirectionVector The vector which normally describes the natural
+        direction of the node, usually -Z
+        */
+        virtual void lookAt( const Vector3& targetPoint, TransformSpace relativeTo,
+            const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
+        /** Enables / disables automatic tracking of another SceneNode.
+        @remarks
+        If you enable auto-tracking, this SceneNode will automatically rotate to
+        point it's -Z at the target SceneNode every frame, no matter how 
+        it or the other SceneNode move. Note that by default the -Z points at the 
+        origin of the target SceneNode, if you want to tweak this, provide a 
+        vector in the 'offset' parameter and the target point will be adjusted.
+        @param enabled If true, tracking will be enabled and the next 
+        parameter cannot be null. If false tracking will be disabled and the 
+        current orientation will be maintained.
+        @param target Pointer to the SceneNode to track. Make sure you don't
+        delete this SceneNode before turning off tracking (e.g. SceneManager::clearScene will
+        delete it so be careful of this). Can be null if and only if the enabled param is false.
+        @param localDirectionVector The local vector considered to be the usual 'direction'
+        of the node; normally the local -Z but can be another direction.
+        @param offset If supplied, this is the target point in local space of the target node
+        instead of the origin of the target node. Good for fine tuning the look at point.
+        */
+        virtual void setAutoTracking(bool enabled, SceneNode* target = 0, 
+            const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z,
+            const Vector3& offset = Vector3::ZERO);
+		/** Get the auto tracking target for this node, if any. */
+        virtual SceneNode* getAutoTrackTarget(void) { return mAutoTrackTarget; }
+		/** Get the auto tracking offset for this node, if the node is auto tracking. */
+		virtual const Vector3& getAutoTrackOffset(void) { return mAutoTrackOffset; }
+		/** Get the auto tracking local direction for this node, if it is auto tracking. */
+		virtual const Vector3& getAutoTrackLocalDirection(void) { return mAutoTrackLocalDirection; }
+		/** Internal method used by OGRE to update auto-tracking cameras. */
+        void _autoTrack(void);
+        /** Gets the parent of this SceneNode. */
+        SceneNode* getParentSceneNode(void) const;
+        /** Makes all objects attached to this node become visible / invisble.
+        @remarks    
+            This is a shortcut to calling setVisible() on the objects attached
+            to this node, and optionally to all objects attached to child
+            nodes. 
+        @param visible Whether the objects are to be made visible or invisible
+        @param cascade If true, this setting cascades into child nodes too.
+        */
+        virtual void setVisible(bool visible, bool cascade = true);
+        /** Inverts the visibility of all objects attached to this node.
+        @remarks    
+        This is a shortcut to calling setVisible(!isVisible()) on the objects attached
+        to this node, and optionally to all objects attached to child
+        nodes. 
+        @param cascade If true, this setting cascades into child nodes too.
+        */
+        virtual void flipVisibility(bool cascade = true);
+
+
+
+
+
+    };
+
+
+}// namespace
+
+#endif
Index: /OgreMain/include/OgreSceneQuery.h
===================================================================
--- /OgreMain/include/OgreSceneQuery.h	(revision 5)
+++ /OgreMain/include/OgreSceneQuery.h	(revision 5)
@@ -0,0 +1,557 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __SceneQuery_H__
+#define __SceneQuery_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreAxisAlignedBox.h"
+#include "OgreSphere.h"
+#include "OgreRay.h"
+#include "OgreRenderOperation.h"
+#include "OgrePlaneBoundedVolume.h"
+
+namespace Ogre {
+
+    // forward declaration
+    class SceneQueryListener;
+    /** A class for performing queries on a scene.
+    @remarks
+        This is an abstract class for performing a query on a scene, i.e. to retrieve
+        a list of objects and/or world geometry sections which are potentially intersecting a
+        given region. Note the use of the word 'potentially': the results of a scene query
+        are generated based on bounding volumes, and as such are not correct at a triangle
+        level; the user of the SceneQuery is expected to filter the results further if
+        greater accuracy is required.
+    @par
+        Different SceneManagers will implement these queries in different ways to
+        exploit their particular scene organisation, and thus will provide their own
+        concrete subclasses. In fact, these subclasses will be derived from subclasses
+        of this class rather than directly because there will be region-type classes
+        in between.
+    @par
+        These queries could have just been implemented as methods on the SceneManager,
+        however, they are wrapped up as objects to allow 'compilation' of queries
+        if deemed appropriate by the implementation; i.e. each concrete subclass may
+        precalculate information (such as fixed scene partitions involved in the query)
+        to speed up the repeated use of the query.
+    @par
+        You should never try to create a SceneQuery object yourself, they should be created
+        using the SceneManager interfaces for the type of query required, e.g.
+        SceneManager::createSphereSceneQuery.
+    */
+    class _OgreExport SceneQuery
+    {
+    public:
+        /** This type can be used by collaborating applications & SceneManagers to 
+            agree on the type of world geometry to be returned from queries. Not all
+            these types will be supported by all SceneManagers; once the application
+            has decided which SceneManager specialisation to use, it is expected that 
+            it will know which type of world geometry abstraction is available to it.
+        */
+        enum WorldFragmentType {
+            /// Return no world geometry hits at all
+            WFT_NONE,
+            /// Return pointers to convex plane-bounded regions
+            WFT_PLANE_BOUNDED_REGION,
+            /// Return a single intersection point (typically RaySceneQuery only)
+            WFT_SINGLE_INTERSECTION,
+            /// Custom geometry as defined by the SceneManager
+            WFT_CUSTOM_GEOMETRY,
+            /// General RenderOperation structure
+            WFT_RENDER_OPERATION
+        };
+
+        /** Represents part of the world geometry that is a result of a SceneQuery. 
+        @remarks
+            Since world geometry is normally vast and sprawling, we need a way of
+            retrieving parts of it based on a query. That is what this struct is for;
+            note there are potentially as many data structures for world geometry as there
+            are SceneManagers, however this structure includes a few common abstractions as 
+            well as a more general format.
+        @par
+            The type of world fragment that is returned from a query depends on the
+            SceneManager, and the option set using SceneQuery::setWorldFragmentType. 
+            You can see what fragment types are supported on the query in question by
+            calling SceneQuery::getSupportedWorldFragmentTypes().
+        */
+        struct WorldFragment {
+            /// The type of this world fragment
+            WorldFragmentType fragmentType;
+            /// Single intersection point, only applicable for WFT_SINGLE_INTERSECTION
+            Vector3 singleIntersection;
+            /// Planes bounding a convex region, only applicable for WFT_PLANE_BOUNDED_REGION
+            std::list<Plane>* planes;
+            /// Custom geometry block, only applicable for WFT_CUSTOM_GEOMETRY
+            void* geometry;
+            /// General render operation structure, fallback if nothing else is available
+            RenderOperation* renderOp;
+            
+        };
+    protected:
+        SceneManager* mParentSceneMgr;
+        uint32 mQueryMask;
+		uint32 mQueryTypeMask;
+        std::set<WorldFragmentType> mSupportedWorldFragments;
+        WorldFragmentType mWorldFragmentType;
+    
+    public:
+        /** Standard constructor, should be called by SceneManager. */
+        SceneQuery(SceneManager* mgr);
+        virtual ~SceneQuery();
+
+        /** Sets the mask for results of this query.
+        @remarks
+            This method allows you to set a 'mask' to limit the results of this
+            query to certain types of result. The actual meaning of this value is
+            up to the application; basically MovableObject instances will only be returned
+            from this query if a bitwise AND operation between this mask value and the
+            MovableObject::getQueryFlags value is non-zero. The application will
+            have to decide what each of the bits means.
+        */
+        virtual void setQueryMask(uint32 mask);
+        /** Returns the current mask for this query. */
+        virtual uint32 getQueryMask(void) const;
+
+        /** Sets the type mask for results of this query.
+        @remarks
+            This method allows you to set a 'type mask' to limit the results of this
+            query to certain types of objects. Whilst setQueryMask deals with flags
+			set per instance of object, this method deals with setting a mask on 
+			flags set per type of object. Both may exclude an object from query
+			results.
+        */
+        virtual void setQueryTypeMask(uint32 mask);
+        /** Returns the current mask for this query. */
+        virtual uint32 getQueryTypeMask(void) const;
+
+		/** Tells the query what kind of world geometry to return from queries;
+            often the full renderable geometry is not what is needed. 
+        @remarks
+            The application receiving the world geometry is expected to know 
+            what to do with it; inevitably this means that the application must 
+            have knowledge of at least some of the structures
+            used by the custom SceneManager.
+        @par
+            The default setting is WFT_NONE.
+        */
+        virtual void setWorldFragmentType(enum WorldFragmentType wft);
+
+        /** Gets the current world fragment types to be returned from the query. */
+        virtual WorldFragmentType getWorldFragmentType(void) const;
+
+        /** Returns the types of world fragments this query supports. */
+        virtual const std::set<WorldFragmentType>* getSupportedWorldFragmentTypes(void) const
+            {return &mSupportedWorldFragments;}
+
+        
+    };
+
+    /** This optional class allows you to receive per-result callbacks from
+        SceneQuery executions instead of a single set of consolidated results.
+    @remarks
+        You should override this with your own subclass. Note that certain query
+        classes may refine this listener interface.
+    */
+    class _OgreExport SceneQueryListener
+    {
+    public:
+        virtual ~SceneQueryListener() { }
+        /** Called when a MovableObject is returned by a query.
+        @remarks
+            The implementor should return 'true' to continue returning objects,
+            or 'false' to abandon any further results from this query.
+        */
+        virtual bool queryResult(MovableObject* object) = 0;
+        /** Called when a WorldFragment is returned by a query.
+        @remarks
+            The implementor should return 'true' to continue returning objects,
+            or 'false' to abandon any further results from this query.
+        */
+        virtual bool queryResult(SceneQuery::WorldFragment* fragment) = 0;
+
+    };
+
+    typedef std::list<MovableObject*> SceneQueryResultMovableList;
+    typedef std::list<SceneQuery::WorldFragment*> SceneQueryResultWorldFragmentList;
+    /** Holds the results of a scene query. */
+    struct _OgreExport SceneQueryResult
+    {
+        /// List of movable objects in the query (entities, particle systems etc)
+        SceneQueryResultMovableList movables;
+        /// List of world fragments
+		SceneQueryResultWorldFragmentList worldFragments;
+    };
+
+    /** Abstract class defining a query which returns single results from a region. 
+    @remarks
+        This class is simply a generalisation of the subtypes of query that return 
+        a set of individual results in a region. See the SceneQuery class for abstract
+        information, and subclasses for the detail of each query type.
+    */
+    class _OgreExport RegionSceneQuery
+        : public SceneQuery, public SceneQueryListener
+    {
+    protected:
+        SceneQueryResult* mLastResult;
+    public:
+        /** Standard constructor, should be called by SceneManager. */
+        RegionSceneQuery(SceneManager* mgr);
+        virtual ~RegionSceneQuery();
+        /** Executes the query, returning the results back in one list.
+        @remarks
+            This method executes the scene query as configured, gathers the results
+            into one structure and returns a reference to that structure. These
+            results will also persist in this query object until the next query is
+            executed, or clearResults() is called. An more lightweight version of
+            this method that returns results through a listener is also available.
+        */
+        virtual SceneQueryResult& execute(void);
+
+        /** Executes the query and returns each match through a listener interface. 
+        @remarks
+            Note that this method does not store the results of the query internally 
+            so does not update the 'last result' value. This means that this version of
+            execute is more lightweight and therefore more efficient than the version 
+            which returns the results as a collection.
+        */
+        virtual void execute(SceneQueryListener* listener) = 0;
+        
+        /** Gets the results of the last query that was run using this object, provided
+            the query was executed using the collection-returning version of execute. 
+        */
+        virtual SceneQueryResult& getLastResults(void) const;
+        /** Clears the results of the last query execution.
+        @remarks
+            You only need to call this if you specifically want to free up the memory
+            used by this object to hold the last query results. This object clears the
+            results itself when executing and when destroying itself.
+        */
+        virtual void clearResults(void);
+
+        /** Self-callback in order to deal with execute which returns collection. */
+        bool queryResult(MovableObject* first);
+        /** Self-callback in order to deal with execute which returns collection. */
+        bool queryResult(SceneQuery::WorldFragment* fragment);
+    };
+
+    /** Specialises the SceneQuery class for querying within an axis aligned box. */
+    class _OgreExport AxisAlignedBoxSceneQuery : public RegionSceneQuery
+    {
+    protected:
+        AxisAlignedBox mAABB;
+    public:
+        AxisAlignedBoxSceneQuery(SceneManager* mgr);
+        virtual ~AxisAlignedBoxSceneQuery();
+
+        /** Sets the size of the box you wish to query. */
+        void setBox(const AxisAlignedBox& box);
+
+        /** Gets the box which is being used for this query. */
+        const AxisAlignedBox& getBox(void) const;
+
+    };
+
+    /** Specialises the SceneQuery class for querying within a sphere. */
+    class _OgreExport SphereSceneQuery : public RegionSceneQuery
+    {
+    protected:
+        Sphere mSphere;
+    public:
+        SphereSceneQuery(SceneManager* mgr);
+        virtual ~SphereSceneQuery();
+        /** Sets the sphere which is to be used for this query. */
+        void setSphere(const Sphere& sphere);
+
+        /** Gets the sphere which is being used for this query. */
+        const Sphere& getSphere() const;
+
+    };
+
+    /** Specialises the SceneQuery class for querying within a plane-bounded volume. 
+    */
+    class _OgreExport PlaneBoundedVolumeListSceneQuery : public RegionSceneQuery
+    {
+    protected:
+        PlaneBoundedVolumeList mVolumes;
+    public:
+        PlaneBoundedVolumeListSceneQuery(SceneManager* mgr);
+        virtual ~PlaneBoundedVolumeListSceneQuery();
+        /** Sets the volume which is to be used for this query. */
+        void setVolumes(const PlaneBoundedVolumeList& volumes);
+
+        /** Gets the volume which is being used for this query. */
+        const PlaneBoundedVolumeList& getVolumes() const;
+
+    };
+
+
+    /*
+    /// Specialises the SceneQuery class for querying within a pyramid. 
+    class _OgreExport PyramidSceneQuery : public RegionSceneQuery
+    {
+    public:
+        PyramidSceneQuery(SceneManager* mgr);
+        virtual ~PyramidSceneQuery();
+    };
+    */
+
+    /** Alternative listener class for dealing with RaySceneQuery.
+    @remarks
+        Because the RaySceneQuery returns results in an extra bit of information, namely
+        distance, the listener interface must be customised from the standard SceneQueryListener.
+    */
+    class _OgreExport RaySceneQueryListener 
+    {
+    public:
+        virtual ~RaySceneQueryListener() { }
+        /** Called when a movable objects intersects the ray.
+        @remarks
+            As with SceneQueryListener, the implementor of this method should return 'true'
+            if further results are required, or 'false' to abandon any further results from
+            the current query.
+        */
+        virtual bool queryResult(MovableObject* obj, Real distance) = 0;
+
+        /** Called when a world fragment is intersected by the ray. 
+        @remarks
+            As with SceneQueryListener, the implementor of this method should return 'true'
+            if further results are required, or 'false' to abandon any further results from
+            the current query.
+        */
+        virtual bool queryResult(SceneQuery::WorldFragment* fragment, Real distance) = 0;
+
+    };
+      
+    /** This struct allows a single comparison of result data no matter what the type */
+    struct _OgreExport RaySceneQueryResultEntry
+    {
+        /// Distance along the ray
+        Real distance;
+        /// The movable, or NULL if this is not a movable result
+        MovableObject* movable;
+        /// The world fragment, or NULL if this is not a fragment result
+        SceneQuery::WorldFragment* worldFragment;
+        /// Comparison operator for sorting
+        bool operator < (const RaySceneQueryResultEntry& rhs) const
+        {
+            return this->distance < rhs.distance;
+        }
+
+    };
+    typedef std::vector<RaySceneQueryResultEntry> RaySceneQueryResult;
+
+    /** Specialises the SceneQuery class for querying along a ray. */
+    class _OgreExport RaySceneQuery : public SceneQuery, public RaySceneQueryListener
+    {
+    protected:
+        Ray mRay;
+        bool mSortByDistance;
+        ushort mMaxResults;
+        RaySceneQueryResult mResult;
+
+    public:
+        RaySceneQuery(SceneManager* mgr);
+        virtual ~RaySceneQuery();
+        /** Sets the ray which is to be used for this query. */
+        virtual void setRay(const Ray& ray);
+        /** Gets the ray which is to be used for this query. */
+        virtual const Ray& getRay(void) const;
+        /** Sets whether the results of this query will be sorted by distance along the ray.
+        @remarks
+            Often you want to know what was the first object a ray intersected with, and this 
+            method allows you to ask the query to sort the results so that the nearest results
+            are listed first.
+        @par
+            Note that because the query returns results based on bounding volumes, the ray may not
+            actually intersect the detail of the objects returned from the query, just their 
+            bounding volumes. For this reason the caller is advised to use more detailed 
+            intersection tests on the results if a more accurate result is required; OGRE uses 
+            bounds checking in order to give the most speedy results since not all applications 
+            need extreme accuracy.
+        @param sort If true, results will be sorted.
+        @param maxresults If sorting is enabled, this value can be used to constrain the maximum number
+            of results that are returned. Please note (as above) that the use of bounding volumes mean that
+            accuracy is not guaranteed; if in doubt, allow more results and filter them in more detail.
+            0 means unlimited results.
+        */
+        virtual void setSortByDistance(bool sort, ushort maxresults = 0);
+        /** Gets whether the results are sorted by distance. */
+        virtual bool getSortByDistance(void) const;
+        /** Gets the maximum number of results returned from the query (only relevant if 
+        results are being sorted) */
+        virtual ushort getMaxResults(void) const;
+        /** Executes the query, returning the results back in one list.
+        @remarks
+            This method executes the scene query as configured, gathers the results
+            into one structure and returns a reference to that structure. These
+            results will also persist in this query object until the next query is
+            executed, or clearResults() is called. An more lightweight version of
+            this method that returns results through a listener is also available.
+        */
+        virtual RaySceneQueryResult& execute(void);
+
+        /** Executes the query and returns each match through a listener interface. 
+        @remarks
+            Note that this method does not store the results of the query internally 
+            so does not update the 'last result' value. This means that this version of
+            execute is more lightweight and therefore more efficient than the version 
+            which returns the results as a collection.
+        */
+        virtual void execute(RaySceneQueryListener* listener) = 0;
+
+        /** Gets the results of the last query that was run using this object, provided
+            the query was executed using the collection-returning version of execute. 
+        */
+        virtual RaySceneQueryResult& getLastResults(void);
+        /** Clears the results of the last query execution.
+        @remarks
+            You only need to call this if you specifically want to free up the memory
+            used by this object to hold the last query results. This object clears the
+            results itself when executing and when destroying itself.
+        */
+        virtual void clearResults(void);
+
+        /** Self-callback in order to deal with execute which returns collection. */
+        bool queryResult(MovableObject* obj, Real distance);
+        /** Self-callback in order to deal with execute which returns collection. */
+        bool queryResult(SceneQuery::WorldFragment* fragment, Real distance);
+
+
+
+
+    };
+
+    /** Alternative listener class for dealing with IntersectionSceneQuery.
+    @remarks
+        Because the IntersectionSceneQuery returns results in pairs, rather than singularly,
+        the listener interface must be customised from the standard SceneQueryListener.
+    */
+    class _OgreExport IntersectionSceneQueryListener 
+    {
+    public:
+        virtual ~IntersectionSceneQueryListener() { }
+        /** Called when 2 movable objects intersect one another.
+        @remarks
+            As with SceneQueryListener, the implementor of this method should return 'true'
+            if further results are required, or 'false' to abandon any further results from
+            the current query.
+        */
+        virtual bool queryResult(MovableObject* first, MovableObject* second) = 0;
+
+        /** Called when a movable intersects a world fragment. 
+        @remarks
+            As with SceneQueryListener, the implementor of this method should return 'true'
+            if further results are required, or 'false' to abandon any further results from
+            the current query.
+        */
+        virtual bool queryResult(MovableObject* movable, SceneQuery::WorldFragment* fragment) = 0;
+
+        /* NB there are no results for world fragments intersecting other world fragments;
+           it is assumed that world geometry is either static or at least that self-intersections
+           are irrelevant or dealt with elsewhere (such as the custom scene manager) */
+        
+    
+    };
+        
+    typedef std::pair<MovableObject*, MovableObject*> SceneQueryMovableObjectPair;
+    typedef std::pair<MovableObject*, SceneQuery::WorldFragment*> SceneQueryMovableObjectWorldFragmentPair;
+    typedef std::list<SceneQueryMovableObjectPair> SceneQueryMovableIntersectionList;
+    typedef std::list<SceneQueryMovableObjectWorldFragmentPair> SceneQueryMovableWorldFragmentIntersectionList;
+    /** Holds the results of an intersection scene query (pair values). */
+    struct _OgreExport IntersectionSceneQueryResult
+    {
+        /// List of movable / movable intersections (entities, particle systems etc)
+        SceneQueryMovableIntersectionList movables2movables;
+        /// List of movable / world intersections
+        SceneQueryMovableWorldFragmentIntersectionList movables2world;
+        
+        
+
+    };
+
+    /** Separate SceneQuery class to query for pairs of objects which are
+        possibly intersecting one another.
+    @remarks
+        This SceneQuery subclass considers the whole world and returns pairs of objects
+        which are close enough to each other that they may be intersecting. Because of
+        this slightly different focus, the return types and listener interface are
+        different for this class.
+    */
+    class _OgreExport IntersectionSceneQuery
+        : public SceneQuery, public IntersectionSceneQueryListener 
+    {
+    protected:
+        IntersectionSceneQueryResult* mLastResult;
+    public:
+        IntersectionSceneQuery(SceneManager* mgr);
+        virtual ~IntersectionSceneQuery();
+
+        /** Executes the query, returning the results back in one list.
+        @remarks
+            This method executes the scene query as configured, gathers the results
+            into one structure and returns a reference to that structure. These
+            results will also persist in this query object until the next query is
+            executed, or clearResults() is called. An more lightweight version of
+            this method that returns results through a listener is also available.
+        */
+        virtual IntersectionSceneQueryResult& execute(void);
+
+        /** Executes the query and returns each match through a listener interface. 
+        @remarks
+            Note that this method does not store the results of the query internally 
+            so does not update the 'last result' value. This means that this version of
+            execute is more lightweight and therefore more efficient than the version 
+            which returns the results as a collection.
+        */
+        virtual void execute(IntersectionSceneQueryListener* listener) = 0;
+
+        /** Gets the results of the last query that was run using this object, provided
+            the query was executed using the collection-returning version of execute. 
+        */
+        virtual IntersectionSceneQueryResult& getLastResults(void) const;
+        /** Clears the results of the last query execution.
+        @remarks
+            You only need to call this if you specifically want to free up the memory
+            used by this object to hold the last query results. This object clears the
+            results itself when executing and when destroying itself.
+        */
+        virtual void clearResults(void);
+
+        /** Self-callback in order to deal with execute which returns collection. */
+        bool queryResult(MovableObject* first, MovableObject* second);
+        /** Self-callback in order to deal with execute which returns collection. */
+        bool queryResult(MovableObject* movable, SceneQuery::WorldFragment* fragment);
+    };
+    
+
+}
+    
+
+
+#endif
Index: /OgreMain/include/OgreScriptLoader.h
===================================================================
--- /OgreMain/include/OgreScriptLoader.h	(revision 5)
+++ /OgreMain/include/OgreScriptLoader.h	(revision 5)
@@ -0,0 +1,89 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ScriptLoader_H__
+#define __ScriptLoader_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreDataStream.h"
+#include "OgreStringVector.h"
+
+namespace Ogre {
+
+	/** Abstract class defining the interface used by classes which wish 
+		to perform script loading to define instances of whatever they manage.
+	@remarks
+		Typically classes of this type wish to either parse individual script files
+		on demand, or be called with a group of files matching a certain pattern
+		at the appropriate time. Normally this will coincide with resource loading,
+		although the script use does not necessarily have to be a ResourceManager
+		(which subclasses from this class), it may be simply a script loader which 
+		manages non-resources but needs to be synchronised at the same loading points.
+	@par
+		Subclasses should add themselves to the ResourceGroupManager as a script loader
+		if they wish to be called at the point a resource group is loaded, at which 
+		point the parseScript method will be called with each file which matches a 
+		the pattern returned from getScriptPatterns.
+	*/
+	class _OgreExport ScriptLoader
+	{
+	public:
+		virtual ~ScriptLoader();
+		/** Gets the file patterns which should be used to find scripts for this
+			class.
+		@remarks
+			This method is called when a resource group is loaded if you use 
+			ResourceGroupManager::_registerScriptLoader.
+		@returns
+			A list of file patterns, in the order they should be searched in.
+		*/
+		virtual const StringVector& getScriptPatterns(void) const = 0;
+
+		/** Parse a script file.
+		@param stream Weak reference to a data stream which is the source of the script
+		@param groupName The name of a resource group which should be used if any resources
+			are created during the parse of this script.
+		*/
+		virtual void parseScript(DataStreamPtr& stream, const String& groupName) = 0;
+
+		/** Gets the relative loading order of scripts of this type.
+		@remarks
+			There are dependencies between some kinds of scripts, and to enforce
+			this all implementors of this interface must define a loading order. 
+		@returns A value representing the relative loading order of these scripts
+			compared to other script users, where higher values load later.
+		*/
+		virtual Real getLoadingOrder(void) const  = 0;
+
+	};
+
+
+}
+
+
+#endif
Index: /OgreMain/include/OgreSearchOps.h
===================================================================
--- /OgreMain/include/OgreSearchOps.h	(revision 5)
+++ /OgreMain/include/OgreSearchOps.h	(revision 5)
@@ -0,0 +1,65 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+// Emulate _findfirst, _findnext on non-Windows platforms
+
+
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+
+#include "OgrePlatform.h"
+
+#if OGRE_PLATFORM != OGRE_PLATFORM_WIN32
+
+#include <dirent.h>
+#include <unistd.h>
+#include <fnmatch.h>
+
+/* Our simplified data entry structure */
+struct _finddata_t
+{
+    char *name;
+    int attrib;
+    unsigned long size;
+};
+
+#define _A_NORMAL 0x00  /* Normalfile-Noread/writerestrictions */
+#define _A_RDONLY 0x01  /* Read only file */
+#define _A_HIDDEN 0x02  /* Hidden file */
+#define _A_SYSTEM 0x04  /* System file */
+#define _A_SUBDIR 0x10  /* Subdirectory */
+#define _A_ARCH   0x20  /* Archive file */
+
+long _findfirst(const char *pattern, struct _finddata_t *data);
+int _findnext(long id, struct _finddata_t *data);
+int _findclose(long id);
+
+#endif
Index: /OgreMain/include/OgreSerializer.h
===================================================================
--- /OgreMain/include/OgreSerializer.h	(revision 5)
+++ /OgreMain/include/OgreSerializer.h	(revision 5)
@@ -0,0 +1,113 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __Serializer_H__
+#define __Serializer_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include "OgreDataStream.h"
+
+namespace Ogre {
+
+    /** Generic class for serialising data to / from binary stream-based files.
+    @remarks
+        This class provides a number of useful methods for exporting / importing data
+        from stream-oriented binary files (e.g. .mesh and .skeleton).
+    */
+    class _OgreExport Serializer
+    {
+    public:
+        Serializer();
+        virtual ~Serializer();
+
+		/// The endianness of written files
+		enum Endian
+		{
+			/// Use the platform native endian
+			ENDIAN_NATIVE,
+			/// Use big endian (0x1000 is serialised as 0x10 0x00)
+			ENDIAN_BIG,
+			/// Use little endian (0x1000 is serialised as 0x00 0x10)
+			ENDIAN_LITTLE
+		};
+
+
+    protected:
+
+        uint32 mCurrentstreamLen;
+        FILE* mpfFile;
+        String mVersion;
+		bool mFlipEndian; // default to native endian, derive from header
+
+        // Internal methods
+        virtual void writeFileHeader(void);
+        virtual void writeChunkHeader(uint16 id, size_t size);
+        
+        void writeFloats(const float* const pfloat, size_t count);
+        void writeFloats(const double* const pfloat, size_t count);
+        void writeShorts(const uint16* const pShort, size_t count);
+        void writeInts(const uint32* const pInt, size_t count); 
+        void writeBools(const bool* const pLong, size_t count);
+        void writeObject(const Vector3& vec);
+        void writeObject(const Quaternion& q);
+        
+        void writeString(const String& string);
+        void writeData(const void* const buf, size_t size, size_t count);
+        
+        virtual void readFileHeader(DataStreamPtr& stream);
+        virtual unsigned short readChunk(DataStreamPtr& stream);
+        
+        void readBools(DataStreamPtr& stream, bool* pDest, size_t count);
+        void readFloats(DataStreamPtr& stream, float* pDest, size_t count);
+        void readFloats(DataStreamPtr& stream, double* pDest, size_t count);
+        void readShorts(DataStreamPtr& stream, uint16* pDest, size_t count);
+        void readInts(DataStreamPtr& stream, uint32* pDest, size_t count);
+        void readObject(DataStreamPtr& stream, Vector3& pDest);
+        void readObject(DataStreamPtr& stream, Quaternion& pDest);
+
+        String readString(DataStreamPtr& stream);
+        String readString(DataStreamPtr& stream, size_t numChars);
+        
+        virtual void flipToLittleEndian(void* pData, size_t size, size_t count = 1);
+        virtual void flipFromLittleEndian(void* pData, size_t size, size_t count = 1);
+        
+        virtual void flipEndian(void * pData, size_t size, size_t count);
+        virtual void flipEndian(void * pData, size_t size);
+
+		/// Determine the endianness of the incoming stream compared to native
+		virtual void determineEndianness(DataStreamPtr& stream);
+		/// Determine the endianness to write with based on option
+		virtual void determineEndianness(Endian requestedEndian);
+    };
+
+}
+
+
+#endif
Index: /OgreMain/include/OgreShadowCameraSetup.h
===================================================================
--- /OgreMain/include/OgreShadowCameraSetup.h	(revision 5)
+++ /OgreMain/include/OgreShadowCameraSetup.h	(revision 5)
@@ -0,0 +1,100 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ShadowCameraSetup_H__
+#define __ShadowCameraSetup_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMovablePlane.h"
+#include "OgreSharedPtr.h"
+
+
+namespace Ogre {
+
+    /** This class allows you to plug in new ways to define the camera setup when
+		rendering and projecting shadow textures.
+	@remarks
+		The default projection used when rendering shadow textures is a uniform
+		frustum. This is pretty straight forward but doesn't make the best use of 
+		the space in the shadow map since texels closer to the camera will be larger, 
+		resulting in 'jaggies'. There are several ways to distribute the texels
+		in the shadow texture differently, and this class allows you to override
+		that. 
+	@par
+		Ogre is provided with several alternative shadow camera setups, including
+		LiSPSM (LiSPSMShadowCameraSetup) and Plane Optimal (PlaneOptimalShadowCameraSetup).
+		Others can of course be written to incorporate other algorithms. All you 
+		have to do is instantiate one of these classes and enable it using 
+		SceneManager::setShadowCameraSetup (global) or Light::setCustomShadowCameraSetup
+		(per light). In both cases the instance is wrapped in a SharedPtr which means
+		it will  be deleted automatically when no more references to it exist.
+	@note
+        Shadow map matrices, being projective matrices, have 15 degrees of freedom.
+		3 of these degrees of freedom are fixed by the light's position.  4 are used to
+		affinely affect z values.  6 affinely affect u,v sampling.  2 are projective
+		degrees of freedom.  This class is meant to allow custom methods for 
+		handling optimization.
+    */
+	class _OgreExport ShadowCameraSetup
+	{
+	public:
+		/// Function to implement -- must set the shadow camera properties
+		virtual void getShadowCamera (const SceneManager *sm, const Camera *cam, 
+									  const Viewport *vp, const Light *light, Camera *texCam) const = 0;
+		/// Need virtual destructor in case subclasses use it
+		virtual ~ShadowCameraSetup() {}
+
+	};
+
+
+
+	/** Implements default shadow camera setup
+        @remarks
+            This implements the default shadow camera setup algorithm.  This is what might
+			be referred to as "normal" shadow mapping.  
+    */
+	class _OgreExport DefaultShadowCameraSetup : public ShadowCameraSetup
+	{
+	public:
+		/// Default constructor
+		DefaultShadowCameraSetup();
+		/// Destructor
+		virtual ~DefaultShadowCameraSetup();
+
+		/// Default shadow camera setup
+		virtual void getShadowCamera (const SceneManager *sm, const Camera *cam, 
+									  const Viewport *vp, const Light *light, Camera *texCam) const;
+	};
+
+
+
+	typedef SharedPtr<ShadowCameraSetup> ShadowCameraSetupPtr;
+
+}
+
+#endif
Index: /OgreMain/include/OgreShadowCameraSetupFocused.h
===================================================================
--- /OgreMain/include/OgreShadowCameraSetupFocused.h	(revision 5)
+++ /OgreMain/include/OgreShadowCameraSetupFocused.h	(revision 5)
@@ -0,0 +1,281 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2006 Torus Knot Software Ltd
+Copyright (c) 2006 Matthias Fink, netAllied GmbH <matthias.fink@web.de>								
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ShadowCameraSetupFocused_H__
+#define __ShadowCameraSetupFocused_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreShadowCameraSetup.h"
+#include "OgrePolygon.h"
+#include "OgreConvexBody.h"
+
+
+namespace Ogre {
+
+	class ConvexBody;
+
+	/** Implements the uniform shadow mapping algorithm in focused mode.
+	@remarks
+		Differs from the default shadow mapping projection in that it focuses the
+		shadow map on the visible areas of the scene. This results in better
+		shadow map texel usage, at the expense of some 'swimming' of the shadow
+		texture on receivers as the basis is constantly being reevaluated.
+	@note
+		Original implementation by Matthias Fink <matthias.fink@web.de>, 2006.
+	*/
+	class _OgreExport FocusedShadowCameraSetup : public ShadowCameraSetup
+	{
+	protected:
+		/** Transform to or from light space as defined by Wimmer et al.
+		@remarks
+		Point and spot lights need to be converted to directional lights to enable a 1:1 
+		light mapping. Otherwise a directional light may become a point light or a point 
+		sink (opposite of a light source) or point/spot lights may become directional lights
+		or light sinks. The light direction is always -y.
+		*/
+		static const Matrix4 msNormalToLightSpace;
+		static const Matrix4 msLightSpaceToNormal;
+
+		/** Temporary preallocated frustum to set up a projection matrix in 
+		::calculateShadowMappingMatrix()
+		*/
+		Frustum* mTempFrustum;
+
+		/** Temporary preallocated camera to set up a light frustum for clipping in ::calculateB.
+		*/
+		Camera* mLightFrustumCamera;
+		mutable bool mLightFrustumCameraCalculated;
+
+		/// Use tighter focus region?
+		bool mUseAggressiveRegion;
+
+		/** Internal class holding a point list representation of a convex body.
+		*/
+		class _OgreExport PointListBody
+		{
+			Polygon::VertexList mBodyPoints;
+			AxisAlignedBox		mAAB;
+
+		public:
+			PointListBody();
+			PointListBody(const ConvexBody& body);
+			~PointListBody();
+
+			/** Merges a second PointListBody into this one.
+			*/
+			void merge(const PointListBody& plb);
+
+			/** Builds a point list body from a 'real' body.
+			@remarks
+			Inserts all vertices from a body into the point list with or without adding duplicate vertices.
+			*/
+			void build(const ConvexBody& body, bool filterDuplicates = true);
+
+			/** Builds a PointListBody from a Body and includes all the space in a given direction.
+			@remarks
+			Intersects the bounding box with a ray from each available point of the body with the given
+			direction. Base and intersection points are stored in a PointListBody structure.
+			@note
+			Duplicate vertices are not filtered.
+			@note
+			Body is not checked for correctness.
+			*/
+			void buildAndIncludeDirection(const ConvexBody& body, 
+				const AxisAlignedBox& aabMax, const Vector3& dir);
+
+			/** Returns the bounding box representation.
+			*/
+			const AxisAlignedBox& getAAB(void) const;	
+
+			/** Adds a specific point to the body list.
+			*/
+			void addPoint(const Vector3& point);
+
+			/** Adds all points of an AAB.
+			*/
+			void addAAB(const AxisAlignedBox& aab);
+
+			/** Returns a point.
+			*/
+			const Vector3& getPoint(size_t cnt) const;
+
+			/** Returns the point count.
+			*/
+			size_t getPointCount(void) const;
+
+			/** Resets the body.
+			*/
+			void reset(void);
+
+		};
+
+		// Persistent calculations to prevent reallocation
+		mutable ConvexBody mBodyB;
+		mutable PointListBody mPointListBodyB;
+		mutable PointListBody mPointListBodyLVS;
+
+	protected:
+		/** Calculates the standard shadow mapping matrix.
+		@remarks
+		Provides the view and projection matrix for standard shadow mapping.
+		@note
+		You can choose which things you want to have: view matrix and/or projection 
+		matrix and/or shadow camera. Passing a NULL value as parameter ignores the
+		generation of this specific value.
+		@param sm: scene manager
+		@param cam: currently active camera
+		@param light: currently active light
+		@param out_view: calculated uniform view shadow mapping matrix (may be NULL)
+		@param out_proj: calculated uniform projection shadow mapping matrix (may be NULL)
+		@param out_cam: calculated uniform shadow camera (may be NULL)
+		*/
+		void calculateShadowMappingMatrix(const SceneManager& sm, const Camera& cam, 
+			const Light& light, Matrix4 *out_view, 
+			Matrix4 *out_proj, Camera *out_cam) const;
+
+		/** Calculates the intersection bodyB.
+		@remarks
+		The intersection bodyB consists of the concatenation the cam frustum clipped 
+		by the scene bounding box followed by a convex hullification with the light's 
+		position and the clipping with the scene bounding box and the light frustum:
+		((V \cap S) + l) \cap S \cap L (\cap: convex intersection, +: convex hull 
+		operation).
+		For directional lights the bodyB is assembled out of the camera frustum 
+		clipped by the scene bounding box followed by the extrusion of all available 
+		bodyB points towards the negative light direction. The rays are intersected 
+		by a maximum bounding box and added to the bodyB points to form the final 
+		intersection bodyB point list.
+		@param sm: scene manager
+		@param cam: currently active camera
+		@param light: currently active light
+		@param sceneBB: scene bounding box for clipping operations
+		@param out_bodyB: final intersection bodyB point list
+		*/
+		void calculateB(const SceneManager& sm, const Camera& cam, const Light& light, 
+			const AxisAlignedBox& sceneBB, PointListBody *out_bodyB) const;
+
+		/** Calculates the bodyLVS.
+		@remarks
+		Calculates the bodyLVS which consists of the convex intersection operation 
+		affecting the light frustum, the view frustum, and the current scene bounding
+		box is used to find suitable positions in the viewer's frustum to build the 
+		rotation matrix L_r. This matrix is applied after the projection matrix L_p to 
+		avoid an accidental flip of the frustum orientation for views tilted with 
+		respect to the shadow map.
+		@param scene: holds all potential occluders / receivers as one single bounding box
+		of the currently active scene node
+		@param cam: current viewer camera
+		@param light: current light
+		@param out_LVS: intersection body LVS (world coordinates)
+		*/
+		void calculateLVS(const SceneManager& sm, const Camera& cam, const Light& light,
+			const AxisAlignedBox& sceneBB, PointListBody *out_LVS) const;
+
+		/**	Returns the projection view direction.
+		@remarks
+		After the matrix L_p is applied the orientation of the light space may tilt for
+		non-identity projections. To prevent a false shadow cast the real view direction
+		is evaluated and applied to the light matrix L.
+		@param lightSpace: matrix of the light space transformation
+		@param cam: current viewer camera
+		@param bodyLVS: intersection body LVS (relevant space in front of the camera)
+		*/
+		Vector3 getLSProjViewDir(const Matrix4& lightSpace, const Camera& cam, 
+			const PointListBody& bodyLVS) const;
+
+		/** Returns a valid near-point seen by the camera.
+		@remarks
+		Returns a point that is situated near the camera by analyzing the bodyLVS that
+		contains all the relevant scene space in front of the light and the camera in
+		a point list array. The view matrix is relevant because the nearest point in
+		front of the camera should be determined.
+		@param viewMatrix: view matrix of the current camera
+		@param bodyLVS: intersection body LVS (relevant space in front of the camera) 
+		*/
+		Vector3 getNearCameraPoint_ws(const Matrix4& viewMatrix, 
+			const PointListBody& bodyLVS) const;
+
+		/** Transforms a given body to the unit cube (-1,-1,-1) / (+1,+1,+1) with a specific 
+		shadow matrix enabled.
+		@remarks
+		Transforms a given point list body object with the matrix m and then maps its
+		extends to a (-1,-1,-1) / (+1,+1,+1) unit cube
+		@param m: transformation matrix applied on the point list body
+		@param body: contains the points of the extends of all valid scene elements which 
+		are mapped to the unit cube
+		*/
+		Matrix4 transformToUnitCube(const Matrix4& m, const PointListBody& body) const;
+
+		/** Builds a view matrix.
+		@remarks
+		Builds a standard view matrix out of a given position, direction and up vector.
+		*/
+		Matrix4 buildViewMatrix(const Vector3& pos, const Vector3& dir, const Vector3& up) const;
+
+	public:
+		/** Default constructor.
+		@remarks
+		Temporary frustum and camera set up here.
+		*/
+		FocusedShadowCameraSetup(void);
+
+		/** Default destructor.
+		@remarks
+		Temporary frustum and camera destroyed here.
+		*/
+		virtual ~FocusedShadowCameraSetup(void);
+
+		/** Returns a uniform shadow camera with a focused view.
+		*/
+		virtual void getShadowCamera(const SceneManager *sm, const Camera *cam, 
+			const Viewport *vp, const Light *light, Camera *texCam) const;
+
+		/** Sets whether or not to use the more agressive approach to deciding on
+			the focus region or not.
+		@note
+			There are 2 approaches that can  be used to define the focus region,
+			the more aggressive way introduced by Wimmer et al, or the original
+			way as described in Stamminger et al. Wimmer et al's way tends to 
+			come up with a tighter focus region but in rare cases (mostly highly
+			glancing angles) can cause some shadow casters to be clipped 
+			incorrectly. By default the more aggressive approach is used since it
+			leads to significantly better results in most cases, but if you experience
+			clipping issues, you can use the less agressive version.
+		@param aggressive True to use the more agressive approach, false otherwise.
+		*/
+		void setUseAggressiveFocusRegion(bool aggressive) { mUseAggressiveRegion = aggressive; }
+
+		bool getUseAggressiveFocusRegion() const { return mUseAggressiveRegion; }
+
+	};
+
+
+}
+
+#endif
Index: /OgreMain/include/OgreShadowCameraSetupLiSPSM.h
===================================================================
--- /OgreMain/include/OgreShadowCameraSetupLiSPSM.h	(revision 5)
+++ /OgreMain/include/OgreShadowCameraSetupLiSPSM.h	(revision 5)
@@ -0,0 +1,226 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2006 Torus Knot Software Ltd
+Copyright (c) 2006 Matthias Fink, netAllied GmbH <matthias.fink@web.de>								
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ShadowCameraSetupLiSPSM_H__
+#define __ShadowCameraSetupLiSPSM_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreShadowCameraSetupFocused.h"
+
+
+namespace Ogre 
+{
+
+	/** Implements the Light Space Perspective Shadow Mapping Algorithm.
+	@remarks
+	Implements the LiSPSM algorithm for an advanced shadow map generation. LiSPSM was
+	developed by Michael Wimmer, Daniel Scherzer and Werner Purgathofer of the TU Wien.
+	The algorithm was presented on the Eurographics Symposium on Rendering 2004.
+	@note
+	Shadow mapping was introduced by Williams in 1978. First a depth image is rendered
+	from the light's view and compared in a second pass with depth values of the normal 
+	camera view. In case the depth camera's depth value is greater than the depth seen
+	by the light the fragment lies in the shadow.
+	The concept has a major draw back named perspective aliasing. The shadow map distri-
+	butes the samples uniformly meaning the position of the viewer is ignored. For the 
+	viewer however the perspective projection affects near objects to be displayed 
+	bigger than further away objects. The same thing happens with the shadow map texels:
+	Near shadows appear very coarse and far away shadows are perfectly sampled.
+	In 2002 Stamminger et al. presented an algorithm called Perspective Shadow Maps 
+	(PSM). PSM battles the perspective aliasing by distributing 50% of the shadow map 
+	texels for objects in the range of <near clipping plane> to <near clipping plane * 2>
+	which inverts the problem: The shadows near the viewer are perfectly sampled, 
+	however far away shadow may contain aliasing artefacts. A near clipping plane may be
+	a problem. But this is not the only one. In the post-perspective space the light 
+	sources are non-intuitively mapped: Directional lights may become point light and 
+	point lights may become directional lights. Also light sinks (opposite of a light 
+	source) may appear.	Another problem are shadow casters located behind the viewer. 
+	In post-projective space objects behind the viewer are mapped in front of him with 
+	a flipped up-vector.
+	LiSPSM battles the light source problem of the post-projective space by rearranging
+	the light space before transformation in such a way that no special cases appear. 
+	This is done by converting point/spot lights into directional lights. The light 
+	space is arranged in such a way that the light direction equals the inverse UNIT_Y.
+	In this combination	the directional light will neither change its type nor its 
+	direction. Furthermore all visible objects and shadow casters affecting the user's 
+	visible area lie in front of the shadow camera: After building the intersection body
+	that contains all these objects (body intersection building was introduced with PSM; 
+	have a look at the description for the method "calculateB" for further info) a 
+	frustum around the body's light space bounding box is created. A parameter (called 
+	'n') automatically adjusts the shadow map sample distribution by specifying the 
+	frustum's view point - near plane which affects the perspective warp. In case the 
+	distance is small the perspecive warp will be strong. As a consequence near objects 
+	will gain quality.
+	However there are still problems. PSM as well as LiSPSM only devote to minimize
+	perspective aliasing. Projection aliasing is still a problem, also 'swimming 
+	artefacts' still occur. The LiSPSM quality distribution is very good but not the 
+	best available: Some sources say logarithmic shadow mapping is the non plus ultra, 
+	however others reject this thought. There is a research project on logarithmic shadow 
+	maps. The web page url is http://gamma.cs.unc.edu/logsm/. However there is no techical 
+	report available yet (Oct 23rd, 2006).
+	@note
+	More information can be found on the webpage of the TU Wien: 
+	http://www.cg.tuwien.ac.at/research/vr/lispsm/
+	@note
+	Original implementation by Matthias Fink <matthias.fink@web.de>, 2006.
+	*/
+	class _OgreExport LiSPSMShadowCameraSetup : public FocusedShadowCameraSetup
+	{
+	protected:
+		/// Warp factor adjustment
+		Real mOptAdjustFactor;
+		/// Use simple nopt derivation?
+		bool mUseSimpleNOpt;
+
+		/** Calculates the LiSPSM projection matrix P.
+		@remarks
+		The LiSPSM projection matrix will be built around the axis aligned bounding box 
+		of the intersection body B in light space. The distance between the near plane 
+		and the projection center is chosen in such a way (distance is set by the para-
+		meter n) that the perspective error is the same on the near and far	plane. In 
+		case P equals the identity matrix the algorithm falls back to a uniform shadow
+		mapping matrix.
+		@param lightSpace: matrix of the light space transformation
+		@param bodyB: intersection body B
+		@param bodyLVS: intersection body LVS (relevant space in front of the camera)
+		@param sm: scene manager
+		@param cam: currently active camera
+		@param light: currently active light
+		*/
+		Matrix4 calculateLiSPSM(const Matrix4& lightSpace, const PointListBody& bodyB, 
+			const PointListBody& bodyLVS, const SceneManager& sm, 
+			const Camera& cam, const Light& light) const;
+
+		/** Calculates the distance between camera position and near clipping plane.
+		@remarks
+		n_opt determines the distance between light space origin (shadow camera position)
+		and	the near clipping plane to achieve an optimal perspective forshortening effect.
+		In this	way the texel distibution over the shadow map is controlled.
+
+		Formula:
+		               d
+		n_opt = ---------------
+		        sqrt(z1/z0) - 1
+
+		Parameters:
+		d: distance between the near and the far clipping plane
+		z0: located on the near clipping plane of the intersection body b
+		z1: located on the far clipping plane with the same x/y values as z0		
+		@note
+		A positive value is applied as the distance between viewer and near clipping plane.
+		In case null is returned uniform shadow mapping will be applied.
+		@param lightSpace: matrix of the light space transformation
+		@param bodyBABB_ls: bounding box of the tranformed (light space) bodyB
+		@param bodyLVS: point list of the bodyLVS which describes the scene space which is in 
+		front of the light and the camera
+		@param cam: currently active camera
+		*/
+		Real calculateNOpt(const Matrix4& lightSpace, const AxisAlignedBox& bodyBABB_ls, 
+			const PointListBody& bodyLVS, const Camera& cam) const;
+
+		/** Calculates a simpler version than the one above.
+		*/
+		Real calculateNOptSimple(const PointListBody& bodyLVS, 
+			const Camera& cam) const;
+
+		/** Calculates the visible point on the near plane for the n_opt calculation
+		@remarks
+		z0 lies on the parallel plane to the near plane through e and on the near plane of 
+		the frustum C (plane z = bodyB_zMax_ls) and on the line x = e.x.
+		@param lightSpace: matrix of the light space transformation
+		@param e: the LiSPSM parameter e is located near or on the near clipping plane of the 
+		LiSPSM frustum C
+		@param bodyB_zMax_ls: maximum z-value of the light space bodyB bounding box
+		@param cam: currently active camera
+		*/
+		Vector3 calculateZ0_ls(const Matrix4& lightSpace, const Vector3& e, Real bodyB_zMax_ls, 
+			const Camera& cam) const;
+
+		/** Builds a frustum matrix.
+		@remarks
+		Builds a standard frustum matrix out of the distance infos of the six frustum 
+		clipping planes.
+		*/
+		Matrix4 buildFrustumProjection(Real left, Real right, Real bottom, 
+			Real top, Real near, Real far) const;
+
+	public:
+		/** Default constructor.
+		@remarks
+		Nothing done here.
+		*/
+		LiSPSMShadowCameraSetup(void);
+
+		/** Default destructor.
+		@remarks
+		Nothing done here.
+		*/
+		virtual ~LiSPSMShadowCameraSetup(void);
+
+		/** Returns a LiSPSM shadow camera.
+		@remarks
+		Builds and returns a LiSPSM shadow camera. 
+		More information can be found on the webpage of the TU Wien: 
+		http://www.cg.tuwien.ac.at/research/vr/lispsm/
+		*/
+		virtual void getShadowCamera(const SceneManager *sm, const Camera *cam, 
+			const Viewport *vp, const Light *light, Camera *texCam) const;
+
+		/** Adjusts the parameter n to produce optimal shadows.
+		@remarks
+		The smaller the parameter n, the stronger the perspective warping effect.
+		The consequence of a stronger warping is that the near shadows will gain 
+		quality while the far ones will lose it. Depending on your scene and light
+		types you may want to tweak this value - for example directional lights
+		tend to benefit from higher values of n than other types of light, 
+		especially if you expect to see more distant shadows (say if the viewpoint is
+		higher above the ground plane). Remember that you can supply separate
+		ShadowCameraSetup instances configured differently per light if you wish.
+		@param n The adjustment factor - default is 0.1f. 
+		*/
+		virtual void setOptimalAdjustFactor(Real n) { mOptAdjustFactor = n; }
+		/** Get the parameter n used to produce optimal shadows. 
+		@see setOptimalAdjustFactor
+		*/
+		virtual Real getOptimalAdjustFactor() const { return mOptAdjustFactor; }
+		/** Sets whether or not to use a slightly simpler version of the 
+			camera near point derivation (default is true)
+		*/
+		virtual void setUseSimpleOptimalAdjust(bool s) { mUseSimpleNOpt = s; }
+		/** Gets whether or not to use a slightly simpler version of the 
+		camera near point derivation (default is true)
+		*/
+		virtual bool getUseSimpleOptimalAdjust() const { return mUseSimpleNOpt; }
+
+	};
+
+}
+
+#endif
+
Index: /OgreMain/include/OgreShadowCameraSetupPlaneOptimal.h
===================================================================
--- /OgreMain/include/OgreShadowCameraSetupPlaneOptimal.h	(revision 5)
+++ /OgreMain/include/OgreShadowCameraSetupPlaneOptimal.h	(revision 5)
@@ -0,0 +1,81 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ShadowCameraSetupPlaneOptimal_H__
+#define __ShadowCameraSetupPlaneOptimal_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreShadowCameraSetup.h"
+
+namespace Ogre {
+
+
+	/** Implements the plane optimal shadow camera algorithm.
+        @remarks
+            Given a plane of interest, it is possible to set up the shadow camera
+			matrix such that the mapping between screen and shadow map is the identity
+			(when restricted to pixels that view the plane of interest).  Therefore,
+			if the shadow map resolution matches the screen space resolution (of the 
+			seen planar receiver), we can get pixel perfect shadowing on the plane. 
+			Off the plane, the shadowing is not guaranteed to be perfect and will 
+			likely exhibit the usual sampling artifacts associated with shadow mapping.
+		@note Important: this routine requires double-precision calculations. When you
+			are running under Direct3D, you must ensure that you set the floating
+			point mode to 'Consistent' rather than 'Fastest' to ensure this precision.
+			This does allegedly come with some performance cost but when measuring 
+			it appears to be negligible in modern systems for normal usage.
+		@note Second important note: this projection also only works for lights with
+			a finite position. Therefore you cannot use it for directional lights
+			at this time.
+    */
+	class _OgreExport PlaneOptimalShadowCameraSetup : public ShadowCameraSetup
+	{
+	private:
+		MovablePlane* m_plane;	///< pointer to plane of interest
+	private:
+		PlaneOptimalShadowCameraSetup() {}	///< Default constructor is private
+
+		/// helper function computing projection matrix given constraints
+		Matrix4 computeConstrainedProjection( const Vector4& pinhole, 
+											  const std::vector<Vector4>& fpoint, 
+											  const std::vector<Vector2>& constraint) const;
+
+	public:
+		/// Constructor -- requires a plane of interest
+		PlaneOptimalShadowCameraSetup(MovablePlane *plane);
+		/// Destructor
+		virtual ~PlaneOptimalShadowCameraSetup();
+
+		/// Returns shadow camera configured to get 1-1 homography between screen and shadow map when restricted to plane
+		virtual void getShadowCamera (const SceneManager *sm, const Camera *cam, 
+									  const Viewport *vp, const Light *light, Camera *texCam) const;
+	};
+
+}
+
+#endif
Index: /OgreMain/include/OgreShadowCaster.h
===================================================================
--- /OgreMain/include/OgreShadowCaster.h	(revision 5)
+++ /OgreMain/include/OgreShadowCaster.h	(revision 5)
@@ -0,0 +1,215 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ShadowCaster_H__
+#define __ShadowCaster_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreRenderable.h"
+
+
+namespace Ogre {
+
+
+    /** Class which represents the renderable aspects of a set of shadow volume faces. 
+    @remarks
+        Note that for casters comprised of more than one set of vertex buffers (e.g. SubMeshes each
+        using their own geometry), it will take more than one ShadowRenderable to render the 
+        shadow volume. Therefore for shadow caster geometry, it is best to stick to one set of
+        vertex buffers (not necessarily one buffer, but the positions for the entire geometry 
+        should come from one buffer if possible)
+    */
+    class _OgreExport ShadowRenderable : public Renderable
+    {
+    protected:
+        MaterialPtr mMaterial;
+        RenderOperation mRenderOp;
+        ShadowRenderable* mLightCap; // used only if isLightCapSeparate == true
+    public:
+        ShadowRenderable() : mMaterial(), mLightCap(0) {}
+        virtual ~ShadowRenderable() { delete mLightCap; }
+        /** Set the material to be used by the shadow, should be set by the caller 
+          before adding to a render queue
+        */
+        void setMaterial(const MaterialPtr& mat) { mMaterial = mat; }
+        /// Overridden from Renderable
+        const MaterialPtr& getMaterial(void) const { return mMaterial; }
+        /// Overridden from Renderable
+        void getRenderOperation(RenderOperation& op) { op = mRenderOp; }
+        /// Get the internal render operation for set up
+        RenderOperation* getRenderOperationForUpdate(void) {return &mRenderOp;}
+        /// Overridden from Renderable
+        void getWorldTransforms(Matrix4* xform) const = 0;
+        /// Overridden from Renderable
+        const Quaternion& getWorldOrientation(void) const = 0;
+        /// Overridden from Renderable
+        const Vector3& getWorldPosition(void) const = 0;
+        /// Overridden from Renderable
+        Real getSquaredViewDepth(const Camera*) const{ return 0; /* not used */}
+        /// Overridden from Renderable
+        const LightList& getLights(void) const;
+        /** Does this renderable require a separate light cap?
+        @remarks
+            If possible, the light cap (when required) should be contained in the
+            usual geometry of the shadow renderable. However, if for some reason
+            the normal depth function (less than) could cause artefacts, then a
+            separate light cap with a depth function of 'always fail' can be used 
+            instead. The primary example of this is when there are floating point
+            inaccuracies caused by calculating the shadow geometry separately from
+            the real geometry. 
+        */
+        bool isLightCapSeparate(void) const { return mLightCap != 0; }
+
+        /// Get the light cap version of this renderable
+        ShadowRenderable* getLightCapRenderable(void) { return mLightCap; }
+        /// Should this ShadowRenderable be treated as visible?
+        virtual bool isVisible(void) const { return true; }
+
+    };
+
+    /** A set of flags that can be used to influence ShadowRenderable creation. */
+    enum ShadowRenderableFlags
+    {
+        /// For shadow volume techniques only, generate a light cap on the volume
+        SRF_INCLUDE_LIGHT_CAP = 0x00000001,
+        /// For shadow volume techniques only, generate a dark cap on the volume
+        SRF_INCLUDE_DARK_CAP  = 0x00000002,
+        /// For shadow volume techniques only, indicates volume is extruded to infinity
+        SRF_EXTRUDE_TO_INFINITY  = 0x00000004
+    };
+
+    /** This class defines the interface that must be implemented by shadow casters.
+    */
+    class _OgreExport ShadowCaster
+    {
+    public:
+        virtual ~ShadowCaster() { }
+        /** Returns whether or not this object currently casts a shadow. */
+        virtual bool getCastShadows(void) const = 0;
+
+        /** Returns details of the edges which might be used to determine a silhouette. */
+        virtual EdgeData* getEdgeList(void) = 0;
+		/** Returns whether the object has a valid edge list. */
+		virtual bool hasEdgeList(void) = 0;
+
+        /** Get the world bounding box of the caster. */
+        virtual const AxisAlignedBox& getWorldBoundingBox(bool derive = false) const = 0;
+        /** Gets the world space bounding box of the light cap */
+        virtual const AxisAlignedBox& getLightCapBounds(void) const = 0;
+        /** Gets the world space bounding box of the dark cap, as extruded using the light provided */
+        virtual const AxisAlignedBox& getDarkCapBounds(const Light& light, Real dirLightExtrusionDist) const = 0;
+
+        typedef std::vector<ShadowRenderable*> ShadowRenderableList;
+        typedef VectorIterator<ShadowRenderableList> ShadowRenderableListIterator;
+
+        /** Gets an iterator over the renderables required to render the shadow volume. 
+        @remarks
+            Shadowable geometry should ideally be designed such that there is only one
+            ShadowRenderable required to render the the shadow; however this is not a necessary
+            limitation and it can be exceeded if required.
+        @param shadowTechnique The technique being used to generate the shadow
+        @param light The light to generate the shadow from
+        @param indexBuffer The index buffer to build the renderables into, 
+            the current contents are assumed to be disposable.
+        @param extrudeVertices If true, this means this class should extrude
+            the vertices of the back of the volume in software. If false, it
+            will not be done (a vertex program is assumed).
+        @param extrusionDistance The distance to extrude the shadow volume
+        @param flags Technique-specific flags, see ShadowRenderableFlags
+        */
+        virtual ShadowRenderableListIterator getShadowVolumeRenderableIterator(
+            ShadowTechnique shadowTechnique, const Light* light, 
+            HardwareIndexBufferSharedPtr* indexBuffer, 
+            bool extrudeVertices, Real extrusionDistance, unsigned long flags = 0 ) = 0;
+
+        /** Utility method for extruding vertices based on a light. 
+        @remarks
+            Unfortunately, because D3D cannot handle homogenous (4D) position
+            coordinates in the fixed-function pipeline (GL can, but we have to
+            be cross-API), when we extrude in software we cannot extrude to 
+            infinity the way we do in the vertex program (by setting w to
+            0.0f). Therefore we extrude by a fixed distance, which may cause 
+            some problems with larger scenes. Luckily better hardware (ie
+            vertex programs) can fix this.
+        @param vertexBuffer The vertex buffer containing ONLY xyz position
+        values, which must be originalVertexCount * 2 * 3 floats long.
+        @param originalVertexCount The count of the original number of
+        vertices, ie the number in the mesh, not counting the doubling
+        which has already been done (by VertexData::prepareForShadowVolume)
+        to provide the extruded area of the buffer.
+        @param lightPos 4D light position in object space, when w=0.0f this
+        represents a directional light
+        @param extrudeDist The distance to extrude
+        */
+        static void extrudeVertices(const HardwareVertexBufferSharedPtr& vertexBuffer, 
+            size_t originalVertexCount, const Vector4& lightPos, Real extrudeDist);
+        /** Get the distance to extrude for a point/spot light */
+        virtual Real getPointExtrusionDistance(const Light* l) const = 0;
+    protected:
+        /// Helper moethod for calculating extrusion distance
+        Real getExtrusionDistance(const Vector3& objectPos, const Light* light) const;
+        /** Tells the caster to perform the tasks necessary to update the 
+            edge data's light listing. Can be overridden if the subclass needs 
+            to do additional things. 
+        @param edgeData The edge information to update
+        @param lightPos 4D vector representing the light, a directional light
+            has w=0.0
+       */
+        virtual void updateEdgeListLightFacing(EdgeData* edgeData, 
+            const Vector4& lightPos);
+
+        /** Generates the indexes required to render a shadow volume into the 
+            index buffer which is passed in, and updates shadow renderables
+            to use it.
+        @param edgeData The edge information to use
+        @param indexBuffer The buffer into which to write data into; current 
+            contents are assumed to be discardable.
+        @param light The light, mainly for type info as silhouette calculations
+            should already have been done in updateEdgeListLightFacing
+        @param shadowRenderables A list of shadow renderables which has 
+            already been constructed but will need populating with details of
+            the index ranges to be used.
+        @param flags Additional controller flags, see ShadowRenderableFlags
+        */
+        virtual void generateShadowVolume(EdgeData* edgeData, 
+            const HardwareIndexBufferSharedPtr& indexBuffer, const Light* light,
+            ShadowRenderableList& shadowRenderables, unsigned long flags);
+        /** Utility method for extruding a bounding box. 
+        @param box Original bounding box, will be updated in-place
+        @param lightPos 4D light position in object space, when w=0.0f this
+        represents a directional light
+        @param extrudeDist The distance to extrude
+        */
+        virtual void extrudeBounds(AxisAlignedBox& box, const Vector4& lightPos, 
+            Real extrudeDist) const;
+
+
+    };
+}
+
+#endif
Index: /OgreMain/include/OgreShadowTextureManager.h
===================================================================
--- /OgreMain/include/OgreShadowTextureManager.h	(revision 5)
+++ /OgreMain/include/OgreShadowTextureManager.h	(revision 5)
@@ -0,0 +1,145 @@
+/*-------------------------------------------------------------------------
+This source file is a part of OGRE
+(Object-oriented Graphics Rendering Engine)
+
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License (LGPL) as 
+published by the Free Software Foundation; either version 2.1 of the 
+License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful, but 
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
+or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License 
+along with this library; if not, write to the Free Software Foundation, 
+Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA or go to
+http://www.gnu.org/copyleft/lesser.txt
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-------------------------------------------------------------------------*/
+#ifndef __ShadowTextureManager_H__
+#define __ShadowTextureManager_H__
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+#include "OgreSingleton.h"
+#include "OgrePixelFormat.h"
+#include "OgreTexture.h"
+#include "OgreIteratorWrappers.h"
+
+
+namespace Ogre
+{
+	typedef std::vector<TexturePtr> ShadowTextureList;
+
+	/** Structure containing the configuration for one shadow texture. */
+	struct ShadowTextureConfig
+	{
+		unsigned int width;
+		unsigned int height;
+		PixelFormat format;
+
+		ShadowTextureConfig()
+			: width(512), height(512), format(PF_X8R8G8B8) {}
+	};
+
+	typedef std::vector<ShadowTextureConfig> ShadowTextureConfigList;
+	typedef ConstVectorIterator<ShadowTextureConfigList> ConstShadowTextureConfigIterator;
+
+	inline _OgreExport bool operator== ( const ShadowTextureConfig& lhs, const ShadowTextureConfig& rhs );
+	inline _OgreExport bool operator!= ( const ShadowTextureConfig& lhs, const ShadowTextureConfig& rhs );
+
+
+	/** Class to manage the available shadow textures which may be shared between
+		many SceneManager instances if formats agree.
+	@remarks
+		The management of the list of shadow textures has been separated out into
+		a dedicated class to enable the clean management of shadow textures
+		across many scene manager instances. Where multiple scene managers are
+		used with shadow textures, the configuration of those shadows may or may
+		not be consistent - if it is, it is good to centrally manage the textures
+		so that creation and destruction responsibility is clear.
+	*/
+	class _OgreExport ShadowTextureManager : public Singleton<ShadowTextureManager>
+	{
+	protected:
+		ShadowTextureList mTextureList;
+		ShadowTextureList mNullTextureList;
+		size_t mCount;
+
+	public:
+		ShadowTextureManager();
+		virtual ~ShadowTextureManager();
+
+		/** Populate an incoming list with shadow texture references as requested
+			in the configuration list.
+		*/
+		virtual void getShadowTextures(const ShadowTextureConfigList& config, 
+			ShadowTextureList& listToPopulate);
+
+		/** Get an appropriately defined 'null' texture, ie one which will always
+			result in no shadows.
+		*/
+		virtual TexturePtr getNullShadowTexture(PixelFormat format);
+
+		/** Remove any shadow textures that are no longer being referenced.
+		@remarks
+			This should be called fairly regularly since references may take a 
+			little while to disappear in some cases (if referenced by materials)
+		*/
+		virtual void clearUnused();
+		/** Dereference all the shadow textures kept in this class and remove them
+			from TextureManager; note that it is up to the SceneManagers to clear 
+			their local references.
+		*/
+		virtual void clear();
+
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static ShadowTextureManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static ShadowTextureManager* getSingletonPtr(void);
+
+	};
+
+}
+
+
+#endif
+
Index: /OgreMain/include/OgreShadowVolumeExtrudeProgram.h
===================================================================
--- /OgreMain/include/OgreShadowVolumeExtrudeProgram.h	(revision 5)
+++ /OgreMain/include/OgreShadowVolumeExtrudeProgram.h	(revision 5)
@@ -0,0 +1,233 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __SHADOWVOLUMEEXTRUDEPROGRAM_H__
+#define __SHADOWVOLUMEEXTRUDEPROGRAM_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreLight.h"
+
+namespace Ogre {
+    /** Static class containing source for vertex programs for extruding shadow volumes
+    @remarks
+        This exists so we don't have to be dependent on an external media files.
+        Assembler is used so we don't have to rely on particular plugins.
+        The assembler contents of this file were generated from the following Cg:
+    @code
+        // Point light shadow volume extrude
+        void shadowVolumeExtrudePointLight_vp (
+            float4 position			: POSITION,
+            float  wcoord			: TEXCOORD0,
+
+            out float4 oPosition	: POSITION,
+
+            uniform float4x4 worldViewProjMatrix,
+            uniform float4   lightPos // homogenous, object space
+            )
+        {
+            // extrusion in object space
+            // vertex unmodified if w==1, extruded if w==0
+            float4 newpos = 
+                (wcoord.xxxx * lightPos) + 
+                float4(position.xyz - lightPos.xyz, 0);
+
+            oPosition = mul(worldViewProjMatrix, newpos);
+
+        }
+
+        // Directional light extrude
+        void shadowVolumeExtrudeDirLight_vp (
+            float4 position			: POSITION,
+            float  wcoord			: TEXCOORD0,
+
+            out float4 oPosition	: POSITION,
+
+            uniform float4x4 worldViewProjMatrix,
+            uniform float4   lightPos // homogenous, object space
+            )
+        {
+            // extrusion in object space
+            // vertex unmodified if w==1, extruded if w==0
+            float4 newpos = 
+                (wcoord.xxxx * (position + lightPos)) - lightPos;
+
+            oPosition = mul(worldViewProjMatrix, newpos);
+
+        }
+        // Point light shadow volume extrude - FINITE
+        void shadowVolumeExtrudePointLightFinite_vp (
+            float4 position			: POSITION,
+            float  wcoord			: TEXCOORD0,
+
+            out float4 oPosition	: POSITION,
+
+            uniform float4x4 worldViewProjMatrix,
+            uniform float4   lightPos, // homogenous, object space
+			uniform float    extrusionDistance // how far to extrude
+            )
+        {
+            // extrusion in object space
+            // vertex unmodified if w==1, extruded if w==0
+			float3 extrusionDir = position.xyz - lightPos.xyz;
+			extrusionDir = normalize(extrusionDir);
+			
+            float4 newpos = float4(position.xyz +  
+                ((1 - wcoord.x) * extrusionDistance * extrusionDir), 1);
+
+            oPosition = mul(worldViewProjMatrix, newpos);
+
+        }
+
+        // Directional light extrude - FINITE
+        void shadowVolumeExtrudeDirLightFinite_vp (
+            float4 position			: POSITION,
+            float  wcoord			: TEXCOORD0,
+
+            out float4 oPosition	: POSITION,
+
+            uniform float4x4 worldViewProjMatrix,
+            uniform float4   lightPos, // homogenous, object space
+			uniform float    extrusionDistance // how far to extrude
+            )
+        {
+            // extrusion in object space
+            // vertex unmodified if w==1, extruded if w==0
+			// -ve lightPos is direction
+            float4 newpos = float4(position.xyz - 
+                (wcoord.x * extrusionDistance * lightPos.xyz), 1);
+
+            oPosition = mul(worldViewProjMatrix, newpos);
+
+        }		
+    @endcode
+    */
+    class _OgreExport ShadowVolumeExtrudeProgram
+    {
+    private:
+        static String mPointArbvp1;
+        static String mPointVs_1_1;
+        static String mDirArbvp1;
+        static String mDirVs_1_1;
+        // same as above, except the color is set to 1 to enable debug volumes to be seen
+        static String mPointArbvp1Debug;
+        static String mPointVs_1_1Debug;
+        static String mDirArbvp1Debug;
+        static String mDirVs_1_1Debug;
+		
+        static String mPointArbvp1Finite;
+        static String mPointVs_1_1Finite;
+        static String mDirArbvp1Finite;
+        static String mDirVs_1_1Finite;
+        // same as above, except the color is set to 1 to enable debug volumes to be seen
+        static String mPointArbvp1FiniteDebug;
+        static String mPointVs_1_1FiniteDebug;
+        static String mDirArbvp1FiniteDebug;
+        static String mDirVs_1_1FiniteDebug;
+
+		static bool mInitialised;
+
+	public:
+#define OGRE_NUM_SHADOW_EXTRUDER_PROGRAMS 8
+        enum Programs
+        {
+            // Point light extruder, infinite distance
+            POINT_LIGHT = 0,
+            // Point light extruder, infinite distance, debug mode
+            POINT_LIGHT_DEBUG = 1,
+            // Directional light extruder, infinite distance
+            DIRECTIONAL_LIGHT = 2,
+            // Directional light extruder, infinite distance, debug mode
+            DIRECTIONAL_LIGHT_DEBUG = 3,
+            // Point light extruder, finite distance
+            POINT_LIGHT_FINITE = 4,
+            // Point light extruder, finite distance, debug mode
+            POINT_LIGHT_FINITE_DEBUG = 5,
+            // Directional light extruder, finite distance
+            DIRECTIONAL_LIGHT_FINITE = 6,
+            // Directional light extruder, finite distance, debug mode
+            DIRECTIONAL_LIGHT_FINITE_DEBUG = 7
+
+        };
+        static const String programNames[OGRE_NUM_SHADOW_EXTRUDER_PROGRAMS];
+
+        /// Initialise the creation of these vertex programs
+        static void initialise(void);
+        /// Shutdown & destroy the vertex programs
+        static void shutdown(void);
+        /// Get extruder program source for point lights, compatible with arbvp1
+        static const String& getPointLightExtruderArbvp1(void) { return mPointArbvp1; }
+        /// Get extruder program source for point lights, compatible with vs_1_1
+        static const String& getPointLightExtruderVs_1_1(void) { return mPointVs_1_1; }
+        /// Get extruder program source for directional lights, compatible with arbvp1
+        static const String& getDirectionalLightExtruderArbvp1(void) { return mDirArbvp1; }
+        /// Get extruder program source for directional lights, compatible with vs_1_1
+        static const String& getDirectionalLightExtruderVs_1_1(void) { return mDirVs_1_1; }
+
+        /// Get extruder program source for debug point lights, compatible with arbvp1
+        static const String& getPointLightExtruderArbvp1Debug(void) { return mPointArbvp1Debug; }
+        /// Get extruder program source for debug point lights, compatible with vs_1_1
+        static const String& getPointLightExtruderVs_1_1Debug(void) { return mPointVs_1_1Debug; }
+        /// Get extruder program source for debug directional lights, compatible with arbvp1
+        static const String& getDirectionalLightExtruderArbvp1Debug(void) { return mDirArbvp1Debug; }
+        /// Get extruder program source for debug directional lights, compatible with vs_1_1
+        static const String& getDirectionalLightExtruderVs_1_1Debug(void) { return mDirVs_1_1Debug; }
+        /// General purpose method to get any of the program sources
+        static const String& getProgramSource(Light::LightTypes lightType, const String syntax, 
+            bool finite, bool debug);
+
+        static const String& getProgramName(Light::LightTypes lightType, bool finite, bool debug);
+
+
+
+
+
+        /// Get FINITE extruder program source for point lights, compatible with arbvp1
+        static const String& getPointLightExtruderArbvp1Finite(void) { return mPointArbvp1Finite; }
+        /// Get FINITE extruder program source for point lights, compatible with vs_1_1
+        static const String& getPointLightExtruderVs_1_1Finite(void) { return mPointVs_1_1Finite; }
+        /// Get FINITE extruder program source for directional lights, compatible with arbvp1
+        static const String& getDirectionalLightExtruderArbvp1Finite(void) { return mDirArbvp1Finite; }
+        /// Get FINITE extruder program source for directional lights, compatible with vs_1_1
+        static const String& getDirectionalLightExtruderVs_1_1Finite(void) { return mDirVs_1_1Finite; }
+
+        /// Get FINITE extruder program source for debug point lights, compatible with arbvp1
+        static const String& getPointLightExtruderArbvp1FiniteDebug(void) { return mPointArbvp1FiniteDebug; }
+        /// Get extruder program source for debug point lights, compatible with vs_1_1
+        static const String& getPointLightExtruderVs_1_1FiniteDebug(void) { return mPointVs_1_1FiniteDebug; }
+        /// Get FINITE extruder program source for debug directional lights, compatible with arbvp1
+        static const String& getDirectionalLightExtruderArbvp1FiniteDebug(void) { return mDirArbvp1FiniteDebug; }
+        /// Get FINITE extruder program source for debug directional lights, compatible with vs_1_1
+        static const String& getDirectionalLightExtruderVs_1_1FiniteDebug(void) { return mDirVs_1_1FiniteDebug; }
+
+
+
+		
+    };
+}
+#endif
Index: /OgreMain/include/OgreSharedPtr.h
===================================================================
--- /OgreMain/include/OgreSharedPtr.h	(revision 5)
+++ /OgreMain/include/OgreSharedPtr.h	(revision 5)
@@ -0,0 +1,229 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __SharedPtr_H__
+#define __SharedPtr_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+	/** Reference-counted shared pointer, used for objects where implicit destruction is 
+        required. 
+    @remarks
+        This is a standard shared pointer implementation which uses a reference 
+        count to work out when to delete the object. OGRE does not use this class
+        very often, because it is usually more efficient to make the destruction
+        of objects more intentional (in blocks, say). However in some cases you
+        really cannot tell how many people are using an object, and this approach is
+        worthwhile (e.g. ControllerValue)
+	@par
+		If OGRE_THREAD_SUPPORT is defined to be 1, use of this class is thread-safe.
+    */
+    template<class T> class SharedPtr {
+	protected:
+		T* pRep;
+		unsigned int* pUseCount;
+	public:
+		OGRE_AUTO_SHARED_MUTEX // public to allow external locking
+		/** Constructor, does not initialise the SharedPtr.
+			@remarks
+				<b>Dangerous!</b> You have to call bind() before using the SharedPtr.
+		*/
+		SharedPtr() : pRep(0), pUseCount(0)
+        {
+            OGRE_SET_AUTO_SHARED_MUTEX_NULL
+        }
+
+        template< class Y>
+		explicit SharedPtr(Y* rep) : pRep(rep), pUseCount(new unsigned int(1))
+		{
+            OGRE_SET_AUTO_SHARED_MUTEX_NULL
+			OGRE_NEW_AUTO_SHARED_MUTEX
+		}
+		SharedPtr(const SharedPtr& r)
+            : pRep(0), pUseCount(0)
+		{
+			// lock & copy other mutex pointer
+            
+            OGRE_SET_AUTO_SHARED_MUTEX_NULL
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+			    pRep = r.pRep;
+			    pUseCount = r.pUseCount; 
+			    // Handle zero pointer gracefully to manage STL containers
+			    if(pUseCount)
+			    {
+				    ++(*pUseCount); 
+			    }
+            }
+		}
+		SharedPtr& operator=(const SharedPtr& r) {
+			if (pRep == r.pRep)
+				return *this;
+			// Swap current data into a local copy
+			// this ensures we deal with rhs and this being dependent
+			SharedPtr<T> tmp(r);
+			swap(tmp);
+			return *this;
+		}
+		
+		template< class Y>
+		SharedPtr(const SharedPtr<Y>& r)
+            : pRep(0), pUseCount(0)
+		{
+			// lock & copy other mutex pointer
+
+            OGRE_SET_AUTO_SHARED_MUTEX_NULL
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+			    pRep = r.getPointer();
+			    pUseCount = r.useCountPointer();
+			    // Handle zero pointer gracefully to manage STL containers
+			    if(pUseCount)
+			    {
+				    ++(*pUseCount);
+			    }
+            }
+		}
+		template< class Y>
+		SharedPtr& operator=(const SharedPtr<Y>& r) {
+			if (pRep == r.pRep)
+				return *this;
+			// Swap current data into a local copy
+			// this ensures we deal with rhs and this being dependent
+			SharedPtr<T> tmp(r);
+			swap(tmp);
+			return *this;
+		}
+		virtual ~SharedPtr() {
+            release();
+		}
+
+
+		inline T& operator*() const { assert(pRep); return *pRep; }
+		inline T* operator->() const { assert(pRep); return pRep; }
+		inline T* get() const { return pRep; }
+
+		/** Binds rep to the SharedPtr.
+			@remarks
+				Assumes that the SharedPtr is uninitialised!
+		*/
+		void bind(T* rep) {
+			assert(!pRep && !pUseCount);
+            OGRE_NEW_AUTO_SHARED_MUTEX
+			OGRE_LOCK_AUTO_SHARED_MUTEX
+			pUseCount = new unsigned int(1);
+			pRep = rep;
+		}
+
+		inline bool unique() const { OGRE_LOCK_AUTO_SHARED_MUTEX assert(pUseCount); return *pUseCount == 1; }
+		inline unsigned int useCount() const { OGRE_LOCK_AUTO_SHARED_MUTEX assert(pUseCount); return *pUseCount; }
+		inline unsigned int* useCountPointer() const { return pUseCount; }
+
+		inline T* getPointer() const { return pRep; }
+
+		inline bool isNull(void) const { return pRep == 0; }
+
+        inline void setNull(void) { 
+			if (pRep)
+			{
+				// can't scope lock mutex before release incase deleted
+				release();
+				pRep = 0;
+				pUseCount = 0;
+			}
+        }
+
+    protected:
+
+        inline void release(void)
+        {
+			bool destroyThis = false;
+
+            /* If the mutex is not initialized to a non-zero value, then
+               neither is pUseCount nor pRep.
+             */
+
+            OGRE_MUTEX_CONDITIONAL(OGRE_AUTO_MUTEX_NAME)
+			{
+				// lock own mutex in limited scope (must unlock before destroy)
+				OGRE_LOCK_AUTO_SHARED_MUTEX
+				if (pUseCount)
+				{
+					if (--(*pUseCount) == 0) 
+					{
+						destroyThis = true;
+	                }
+				}
+            }
+			if (destroyThis)
+				destroy();
+
+            OGRE_SET_AUTO_SHARED_MUTEX_NULL
+        }
+
+        virtual void destroy(void)
+        {
+            // IF YOU GET A CRASH HERE, YOU FORGOT TO FREE UP POINTERS
+            // BEFORE SHUTTING OGRE DOWN
+            // Use setNull() before shutdown or make sure your pointer goes
+            // out of scope before OGRE shuts down to avoid this.
+            delete pRep;
+            delete pUseCount;
+			OGRE_DELETE_AUTO_SHARED_MUTEX
+        }
+
+		virtual void swap(SharedPtr<T> &other) 
+		{
+			std::swap(pRep, other.pRep);
+			std::swap(pUseCount, other.pUseCount);
+#if OGRE_THREAD_SUPPORT
+			std::swap(OGRE_AUTO_MUTEX_NAME, other.OGRE_AUTO_MUTEX_NAME);
+#endif
+		}
+	};
+
+	template<class T, class U> inline bool operator==(SharedPtr<T> const& a, SharedPtr<U> const& b)
+	{
+		return a.get() == b.get();
+	}
+
+	template<class T, class U> inline bool operator!=(SharedPtr<T> const& a, SharedPtr<U> const& b)
+	{
+		return a.get() != b.get();
+	}
+}
+
+
+
+#endif
Index: /OgreMain/include/OgreSimpleRenderable.h
===================================================================
--- /OgreMain/include/OgreSimpleRenderable.h	(revision 5)
+++ /OgreMain/include/OgreSimpleRenderable.h	(revision 5)
@@ -0,0 +1,98 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __SimpleRenderable_H__
+#define __SimpleRenderable_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreMovableObject.h"
+#include "OgreRenderable.h"
+#include "OgreAxisAlignedBox.h"
+#include "OgreMaterial.h"
+
+namespace Ogre {
+
+    class _OgreExport SimpleRenderable : public MovableObject, public Renderable
+    {
+    protected:
+        RenderOperation mRenderOp;
+
+        Matrix4 m_matWorldTransform;
+        AxisAlignedBox mBox;
+
+        String m_strMatName;
+        MaterialPtr m_pMaterial;
+
+        /// The scene manager for the current frame.
+        SceneManager *m_pParentSceneManager;
+
+        /// The camera for the current frame.
+        Camera *m_pCamera;
+
+        /// Static member used to automatically generate names for SimpleRendaerable objects.
+        static uint ms_uGenNameCount;
+
+    public:
+        SimpleRenderable();
+
+        void setMaterial( const String& matName );
+        virtual const MaterialPtr& getMaterial(void) const;
+
+        virtual void setRenderOperation( const RenderOperation& rend );
+        virtual void getRenderOperation(RenderOperation& op);
+
+        void setWorldTransform( const Matrix4& xform );
+        virtual void getWorldTransforms( Matrix4* xform ) const;
+        /** @copydoc Renderable::getWorldOrientation */
+        const Quaternion& getWorldOrientation(void) const;
+        /** @copydoc Renderable::getWorldPosition */
+        const Vector3& getWorldPosition(void) const;
+
+
+        virtual void _notifyCurrentCamera(Camera* cam);
+
+        void setBoundingBox( const AxisAlignedBox& box );
+        virtual const AxisAlignedBox& getBoundingBox(void) const;
+
+        virtual void _updateRenderQueue(RenderQueue* queue);
+
+        virtual ~SimpleRenderable();
+
+
+        /** Overridden from MovableObject */
+        virtual const String& getMovableType(void) const;
+
+        /** @copydoc Renderable::getLights */
+        const LightList& getLights(void) const;
+
+    };
+}
+
+#endif
+
Index: /OgreMain/include/OgreSimpleSpline.h
===================================================================
--- /OgreMain/include/OgreSimpleSpline.h	(revision 5)
+++ /OgreMain/include/OgreSimpleSpline.h	(revision 5)
@@ -0,0 +1,130 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __SimpleSpline_H__
+#define __SimpleSpline_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreVector3.h"
+#include "OgreMatrix4.h"
+
+namespace Ogre {
+
+
+    /** A very simple spline class which implements the Catmull-Rom class of splines.
+    @remarks
+        Splines are bendy lines. You define a series of points, and the spline forms
+        a smoother line between the points to eliminate the sharp angles.
+    @par
+        Catmull-Rom splines are a specialisation of the general Hermite spline. With
+        a Hermite spline, you define the start and end point of the line, and 2 tangents,
+        one at the start of the line and one at the end. The Catmull-Rom spline simplifies
+        this by just asking you to define a series of points, and the tangents are 
+        created for you. 
+    */
+    class _OgreExport SimpleSpline
+    {
+    public:
+        SimpleSpline();
+        ~SimpleSpline();
+
+        /** Adds a control point to the end of the spline. */
+        void addPoint(const Vector3& p);
+
+        /** Gets the detail of one of the control points of the spline. */
+        const Vector3& getPoint(unsigned short index) const;
+
+        /** Gets the number of control points in the spline. */
+        unsigned short getNumPoints(void) const;
+
+        /** Clears all the points in the spline. */
+        void clear(void);
+
+        /** Updates a single point in the spline. 
+        @remarks
+            This point must already exist in the spline.
+        */
+        void updatePoint(unsigned short index, const Vector3& value);
+
+        /** Returns an interpolated point based on a parametric value over the whole series.
+        @remarks
+            Given a t value between 0 and 1 representing the parametric distance along the
+            whole length of the spline, this method returns an interpolated point.
+        @param t Parametric value.
+        */
+        Vector3 interpolate(Real t);
+
+        /** Interpolates a single segment of the spline given a parametric value.
+        @param fromIndex The point index to treat as t=0. fromIndex + 1 is deemed to be t=1
+        @param t Parametric value
+        */
+        Vector3 interpolate(unsigned int fromIndex, Real t);
+
+
+        /** Tells the spline whether it should automatically calculate tangents on demand
+            as points are added.
+        @remarks
+            The spline calculates tangents at each point automatically based on the input points.
+            Normally it does this every time a point changes. However, if you have a lot of points
+            to add in one go, you probably don't want to incur this overhead and would prefer to 
+            defer the calculation until you are finished setting all the points. You can do this
+            by calling this method with a parameter of 'false'. Just remember to manually call 
+            the recalcTangents method when you are done.
+        @param autoCalc If true, tangents are calculated for you whenever a point changes. If false, 
+            you must call reclacTangents to recalculate them when it best suits.
+        */
+        void setAutoCalculate(bool autoCalc);
+
+        /** Recalculates the tangents associated with this spline. 
+        @remarks
+            If you tell the spline not to update on demand by calling setAutoCalculate(false)
+            then you must call this after completing your updates to the spline points.
+        */
+        void recalcTangents(void);
+
+    protected:
+
+        bool mAutoCalc;
+
+        std::vector<Vector3> mPoints;
+        std::vector<Vector3> mTangents;
+
+        /// Matrix of coefficients 
+        Matrix4 mCoeffs;
+
+
+
+    };
+
+
+}
+
+
+#endif
+
Index: /OgreMain/include/OgreSingleton.h
===================================================================
--- /OgreMain/include/OgreSingleton.h	(revision 5)
+++ /OgreMain/include/OgreSingleton.h	(revision 5)
@@ -0,0 +1,85 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/* Original version Copyright (C) Scott Bilas, 2000.
+ * All rights reserved worldwide.
+ *
+ * This software is provided "as is" without express or implied
+ * warranties. You may freely copy and compile this source into
+ * applications you distribute provided that the copyright text
+ * below is included in the resulting source code, for example:
+ * "Portions Copyright (C) Scott Bilas, 2000"
+ */
+#ifndef _SINGLETON_H__
+#define _SINGLETON_H__
+
+// Added by Steve Streeting for Ogre
+#include "OgrePrerequisites.h"
+
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+// Turn off warnings generated by this singleton implementation
+#   pragma warning (disable : 4311)
+#   pragma warning (disable : 4312)
+#endif
+
+#if defined ( OGRE_GCC_VISIBILITY )
+#   pragma GCC visibility push(default)
+#endif
+namespace Ogre {
+// End SJS additions
+    /** Template class for creating single-instance global classes.
+    */
+    template <typename T> class Singleton
+    {
+    protected:
+
+        static T* ms_Singleton;
+
+    public:
+        Singleton( void )
+        {
+            assert( !ms_Singleton );
+#if defined( _MSC_VER ) && _MSC_VER < 1200	 
+            int offset = (int)(T*)1 - (int)(Singleton <T>*)(T*)1;
+            ms_Singleton = (T*)((int)this + offset);
+#else
+	    ms_Singleton = static_cast< T* >( this );
+#endif
+        }
+        ~Singleton( void )
+            {  assert( ms_Singleton );  ms_Singleton = 0;  }
+        static T& getSingleton( void )
+		{	assert( ms_Singleton );  return ( *ms_Singleton ); }
+        static T* getSingletonPtr( void )
+		{ return ms_Singleton; }
+    };
+}
+#if defined ( OGRE_GCC_VISIBILITY )
+#   pragma GCC visibility pop
+#endif
+#endif
Index: /OgreMain/include/OgreSkeleton.h
===================================================================
--- /OgreMain/include/OgreSkeleton.h	(revision 5)
+++ /OgreMain/include/OgreSkeleton.h	(revision 5)
@@ -0,0 +1,519 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __Skeleton_H__
+#define __Skeleton_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreResource.h"
+#include "OgreQuaternion.h"
+#include "OgreVector3.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreStringVector.h"
+
+namespace Ogre {
+
+    /**  */
+    enum SkeletonAnimationBlendMode {
+        /// Animations are applied by calculating a weighted average of all animations
+	    ANIMBLEND_AVERAGE,
+        /// Animations are applied by calculating a weighted cumulative total
+	    ANIMBLEND_CUMULATIVE
+    };
+
+#define OGRE_MAX_NUM_BONES 256
+
+	
+	struct LinkedSkeletonAnimationSource;
+
+    /** A collection of Bone objects used to animate a skinned mesh.
+    @remarks
+        Skeletal animation works by having a collection of 'bones' which are 
+        actually just joints with a position and orientation, arranged in a tree structure.
+        For example, the wrist joint is a child of the elbow joint, which in turn is a
+        child of the shoulder joint. Rotating the shoulder automatically moves the elbow
+        and wrist as well due to this hierarchy.
+    @par
+        So how does this animate a mesh? Well every vertex in a mesh is assigned to one or more
+        bones which affects it's position when the bone is moved. If a vertex is assigned to 
+        more than one bone, then weights must be assigned to determine how much each bone affects
+        the vertex (actually a weight of 1.0 is used for single bone assignments). 
+        Weighted vertex assignments are especially useful around the joints themselves
+        to avoid 'pinching' of the mesh in this region. 
+    @par
+        Therefore by moving the skeleton using preset animations, we can animate the mesh. The
+        advantage of using skeletal animation is that you store less animation data, especially
+        as vertex counts increase. In addition, you are able to blend multiple animations together
+        (e.g. walking and looking around, running and shooting) and provide smooth transitions
+        between animations without incurring as much of an overhead as would be involved if you
+        did this on the core vertex data.
+    @par
+        Skeleton definitions are loaded from datafiles, namely the .skeleton file format. They
+        are loaded on demand, especially when referenced by a Mesh.
+    */
+    class _OgreExport Skeleton : public Resource
+    {
+		friend class SkeletonInstance;
+	protected:
+		/// Internal constructor for use by SkeletonInstance only
+		Skeleton();
+
+    public:
+        /** Constructor, don't call directly, use SkeletonManager.
+        @remarks
+            On creation, a Skeleton has a no bones, you should create them and link
+            them together appropriately. 
+        */
+        Skeleton(ResourceManager* creator, const String& name, ResourceHandle handle,
+            const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
+        virtual ~Skeleton();
+
+
+        /** Creates a brand new Bone owned by this Skeleton. 
+        @remarks
+            This method creates an unattached new Bone for this skeleton.
+			Unless this is to be a root bone (there may be more than one of 
+			these), you must attach it to another Bone in the skeleton using addChild for it to be any use.
+            For this reason you will likely be better off creating child bones using the
+            Bone::createChild method instead, once you have created the root bone. 
+        @par
+            Note that this method automatically generates a handle for the bone, which you
+            can retrieve using Bone::getHandle. If you wish the new Bone to have a specific
+            handle, use the alternate form of this method which takes a handle as a parameter,
+            although you should note the restrictions.
+        */
+        virtual Bone* createBone(void);
+
+        /** Creates a brand new Bone owned by this Skeleton. 
+        @remarks
+            This method creates an unattached new Bone for this skeleton and assigns it a 
+            specific handle. Unless this is to be a root bone (there may be more than one of 
+			these), you must attach it to another Bone in the skeleton using addChild for it to be any use. 
+            For this reason you will likely be better off creating child bones using the
+            Bone::createChild method instead, once you have created a root bone. 
+        @param handle The handle to give to this new bone - must be unique within this skeleton. 
+            You should also ensure that all bone handles are eventually contiguous (this is to simplify
+            their compilation into an indexed array of transformation matrices). For this reason
+            it is advised that you use the simpler createBone method which automatically assigns a
+            sequential handle starting from 0.
+        */
+        virtual Bone* createBone(unsigned short handle);
+
+        /** Creates a brand new Bone owned by this Skeleton. 
+        @remarks
+            This method creates an unattached new Bone for this skeleton and assigns it a 
+            specific name.Unless this is to be a root bone (there may be more than one of 
+			these), you must attach it to another Bone in the skeleton using addChild for it to be any use.
+            For this reason you will likely be better off creating child bones using the
+            Bone::createChild method instead, once you have created the root bone. 
+        @param name The name to give to this new bone - must be unique within this skeleton. 
+            Note that the way OGRE looks up bones is via a numeric handle, so if you name a
+            Bone this way it will be given an automatic sequential handle. The name is just
+            for your convenience, although it is recommended that you only use the handle to 
+            retrieve the bone in performance-critical code.
+        */
+        virtual Bone* createBone(const String& name);
+
+        /** Creates a brand new Bone owned by this Skeleton. 
+        @remarks
+            This method creates an unattached new Bone for this skeleton and assigns it a 
+            specific name and handle. Unless this is to be a root bone (there may be more than one of 
+			these), you must attach it to another Bone in the skeleton using addChild for it to be any use.
+            For this reason you will likely be better off creating child bones using the
+            Bone::createChild method instead, once you have created the root bone. 
+        @param name The name to give to this new bone - must be unique within this skeleton. 
+        @param handle The handle to give to this new bone - must be unique within this skeleton. 
+        */
+        virtual Bone* createBone(const String& name, unsigned short handle);
+
+        /** Returns the number of bones in this skeleton. */
+        virtual unsigned short getNumBones(void) const;
+
+        /** Gets the root bone of the skeleton: deprecated in favour of getRootBoneIterator. 
+        @remarks
+            The system derives the root bone the first time you ask for it. The root bone is the
+            only bone in the skeleton which has no parent. The system locates it by taking the
+            first bone in the list and going up the bone tree until there are no more parents,
+            and saves this top bone as the root. If you are building the skeleton manually using
+            createBone then you must ensure there is only one bone which is not a child of 
+            another bone, otherwise your skeleton will not work properly. If you use createBone
+            only once, and then use Bone::createChild from then on, then inherently the first
+            bone you create will by default be the root.
+        */
+        virtual Bone* getRootBone(void) const;
+
+        typedef std::vector<Bone*> BoneList;
+        typedef VectorIterator<BoneList> BoneIterator;
+        /// Get an iterator over the root bones in the skeleton, ie those with no parents
+        virtual BoneIterator getRootBoneIterator(void);
+        /// Get an iterator over all the bones in the skeleton
+        virtual BoneIterator getBoneIterator(void);
+
+        /** Gets a bone by it's handle. */
+        virtual Bone* getBone(unsigned short handle) const;
+
+        /** Gets a bone by it's name. */
+        virtual Bone* getBone(const String& name) const;
+
+        /** Sets the current position / orientation to be the 'binding pose' ie the layout in which 
+            bones were originally bound to a mesh.
+        */
+        virtual void setBindingPose(void);
+
+        /** Resets the position and orientation of all bones in this skeleton to their original binding position.
+        @remarks
+            A skeleton is bound to a mesh in a binding pose. Bone positions are then modified from this
+            position during animation. This method returns all the bones to their original position and
+            orientation.
+        @param resetManualBones If set to true, causes the state of manual bones to be reset
+            too, which is normally not done to allow the manual state to persist even 
+            when keyframe animation is applied.
+        */
+        virtual void reset(bool resetManualBones = false);
+
+        /** Creates a new Animation object for animating this skeleton. 
+        @param name The name of this animation
+        @param length The length of the animation in seconds
+        */
+        virtual Animation* createAnimation(const String& name, Real length);
+
+        /** Returns the named Animation object. 
+		@remarks
+			Will pick up animations in linked skeletons 
+			(@see addLinkedSkeletonAnimationSource). 
+		@param name The name of the animation
+		@param linker Optional pointer to a pointer to the linked skeleton animation
+			where this is coming from.
+		*/
+        virtual Animation* getAnimation(const String& name, 
+			const LinkedSkeletonAnimationSource** linker = 0) const;
+
+		/// Internal accessor for animations (returns null if animation does not exist)
+		virtual Animation* _getAnimationImpl(const String& name, 
+			const LinkedSkeletonAnimationSource** linker = 0) const;
+
+
+		/** Returns whether this skeleton contains the named animation. */
+		virtual bool hasAnimation(const String& name);
+
+        /** Removes an Animation from this skeleton. */
+        virtual void removeAnimation(const String& name);
+
+        /** Changes the state of the skeleton to reflect the application of the passed in collection of animations.
+        @remarks
+            Animating a skeleton involves both interpolating between keyframes of a specific animation,
+            and blending between the animations themselves. Calling this method sets the state of
+            the skeleton so that it reflects the combination of all the passed in animations, at the
+            time index specified for each, using the weights specified. Note that the weights between 
+            animations do not have to sum to 1.0, because some animations may affect only subsets
+            of the skeleton. If the weights exceed 1.0 for the same area of the skeleton, the 
+            movement will just be exaggerated.
+            @param 
+        */
+        virtual void setAnimationState(const AnimationStateSet& animSet);
+
+
+        /** Initialise an animation set suitable for use with this skeleton. 
+        @remarks
+            Only recommended for use inside the engine, not by applications.
+        */
+        virtual void _initAnimationState(AnimationStateSet* animSet);
+
+		/** Refresh an animation set suitable for use with this skeleton. 
+		@remarks
+			Only recommended for use inside the engine, not by applications.
+		*/
+		virtual void _refreshAnimationState(AnimationStateSet* animSet);
+
+		/** Populates the passed in array with the bone matrices based on the current position.
+        @remarks
+            Internal use only. The array pointed to by the passed in pointer must
+            be at least as large as the number of bones.
+            Assumes animation has already been updated.
+        */
+        virtual void _getBoneMatrices(Matrix4* pMatrices);
+
+        /** Gets the number of animations on this skeleton. */
+        virtual unsigned short getNumAnimations(void) const;
+
+        /** Gets a single animation by index. 
+		@remarks
+			Will NOT pick up animations in linked skeletons 
+			(@see addLinkedSkeletonAnimationSource).
+		*/
+        virtual Animation* getAnimation(unsigned short index) const;
+
+
+		/** Gets the animation blending mode which this skeleton will use. */
+        virtual SkeletonAnimationBlendMode getBlendMode() const;
+        /** Sets the animation blending mode this skeleton will use. */
+		virtual void setBlendMode(SkeletonAnimationBlendMode state);
+
+        /// Updates all the derived transforms in the skeleton
+        virtual void _updateTransforms(void);
+
+		/** Optimise all of this skeleton's animations.
+		@see Animation::optimise
+        @param
+            preservingIdentityNodeTracks If true, don't destroy identity node tracks.
+		*/
+		virtual void optimiseAllAnimations(bool preservingIdentityNodeTracks = false);
+
+		/** Allows you to use the animations from another Skeleton object to animate
+			this skeleton.
+		@remarks
+			If you have skeletons of identical structure (that means identically
+			named bones with identical handles, and with the same hierarchy), but
+			slightly different proportions or binding poses, you can re-use animations
+			from one in the other. Because animations are actually stored as
+			changes to bones from their bind positions, it's possible to use the
+			same animation data for different skeletons, provided the skeletal
+			structure matches and the 'deltas' stored in the keyframes apply
+			equally well to the other skeletons bind position (so they must be
+			roughly similar, but don't have to be identical). You can use the 
+			'scale' option to adjust the translation and scale keyframes where
+			there are large differences in size between the skeletons.
+		@note
+			This method takes a skeleton name, rather than a more specific 
+			animation name, for two reasons; firstly it allows some validation 
+			of compatibility of skeletal structure, and secondly skeletons are
+			the unit of loading. Linking a skeleton to another in this way means
+			that the linkee will be prevented from being destroyed until the 
+			linker is destroyed.
+
+			You cannot set up cyclic relationships, e.g. SkeletonA uses SkeletonB's
+			animations, and SkeletonB uses SkeletonA's animations. This is because
+			it would set up a circular dependency which would prevent proper 
+			unloading - make one of the skeletons the 'master' in this case.
+		@param skelName Name of the skeleton to link animations from. This 
+			skeleton will be loaded immediately if this skeleton is already 
+			loaded, otherwise it will be loaded when this skeleton is.
+		@param scale A scale factor to apply to translation and scaling elements
+			of the keyframes in the other skeleton when applying the animations
+			to this one. Compensates for skeleton size differences.
+		*/
+		virtual void addLinkedSkeletonAnimationSource(const String& skelName, 
+			Real scale = 1.0f);
+		/// Remove all links to other skeletons for the purposes of sharing animation
+		virtual void removeAllLinkedSkeletonAnimationSources(void);
+		
+		typedef std::vector<LinkedSkeletonAnimationSource> 
+			LinkedSkeletonAnimSourceList;
+		typedef ConstVectorIterator<LinkedSkeletonAnimSourceList> 
+			LinkedSkeletonAnimSourceIterator;
+		/// Get an iterator over the linked skeletons used as animation sources
+		virtual LinkedSkeletonAnimSourceIterator 
+			getLinkedSkeletonAnimationSourceIterator(void) const;
+
+		/// Internal method for marking the manual bones as dirty
+		virtual void _notifyManualBonesDirty(void);
+		/// Internal method for notifying that a bone is manual
+		virtual void _notifyManualBoneStateChange(Bone* bone);
+
+		/// Have manual bones been modified since the skeleton was last updated?
+		virtual bool getManualBonesDirty(void) const { return mManualBonesDirty; }
+		/// Are there any manually controlled bones?
+		virtual bool hasManualBones(void) const { return !mManualBones.empty(); }
+
+        /// Map to translate bone handle from one skeleton to another skeleton.
+        typedef std::vector<ushort> BoneHandleMap;
+
+        /** Merge animations from another Skeleton object into this skeleton.
+        @remarks
+            This function allow merge two structures compatible skeletons. The
+            'compatible' here means identically bones will have same hierarchy,
+            but skeletons are not necessary to have same number of bones (if
+            number bones of source skeleton's more than this skeleton, they will
+            copied as is, except that duplicate names are unallowed; and in the
+            case of bones missing in source skeleton, nothing happen for those
+            bones).
+        @par
+            There are also unnecessary to have same binding poses, this function
+            will adjust keyframes of the source skeleton to match this skeleton
+            automatically.
+        @par
+            It's useful for export skeleton animations seperately. i.e. export
+            mesh and 'master' skeleton at the same time, and then other animations
+            will export seperately (even if used completely difference binding
+            pose), finally, merge seperately exported animations into 'master'
+            skeleton.
+        @param
+            source Pointer to source skeleton. It'll keep unmodified.
+        @param
+            boneHandleMap A map to translate identically bone's handle from source
+            skeleton to this skeleton. If mapped bone handle doesn't exists in this
+            skeleton, it'll created. You can populate bone handle map manually, or
+            use predefined functions build bone handle map for you. (@see 
+            _buildMapBoneByHandle, _buildMapBoneByName)
+        @param
+            animations A list name of animations to merge, if empty, all animations
+            of source skeleton are used to merge. Note that the animation names
+            must not presented in this skeleton, and will NOT pick up animations
+            in linked skeletons (@see addLinkedSkeletonAnimationSource).
+        */
+        virtual void _mergeSkeletonAnimations(const Skeleton* source,
+            const BoneHandleMap& boneHandleMap,
+            const StringVector& animations = StringVector());
+
+        /** Build the bone handle map to use with Skeleton::_mergeSkeletonAnimations.
+        @remarks
+            Identically bones are determine by handle.
+        */
+        virtual void _buildMapBoneByHandle(const Skeleton* source,
+            BoneHandleMap& boneHandleMap) const;
+
+        /** Build the bone handle map to use with Skeleton::_mergeSkeletonAnimations.
+        @remarks
+            Identically bones are determine by name.
+        */
+        virtual void _buildMapBoneByName(const Skeleton* source,
+            BoneHandleMap& boneHandleMap) const;
+
+	protected:
+		SkeletonAnimationBlendMode mBlendState;
+        /// Storage of bones, indexed by bone handle
+        BoneList mBoneList;
+        /// Lookup by bone name
+        typedef std::map<String, Bone*> BoneListByName;
+        BoneListByName mBoneListByName;
+
+
+        /// Pointer to root bones (can now have multiple roots)
+        mutable BoneList mRootBones;
+        /// Bone automatic handles
+        unsigned short mNextAutoHandle;
+		typedef std::set<Bone*> BoneSet;
+		/// Manual bones
+		BoneSet mManualBones;
+		/// Manual bones dirty?
+		bool mManualBonesDirty;
+
+
+        /// Storage of animations, lookup by name
+        typedef std::map<String, Animation*> AnimationList;
+        AnimationList mAnimationsList;
+
+		/// List of references to other skeletons to use animations from 
+		mutable LinkedSkeletonAnimSourceList mLinkedSkeletonAnimSourceList;
+
+        /** Internal method which parses the bones to derive the root bone. 
+        @remarks
+            Must be const because called in getRootBone but mRootBone is mutable
+            since lazy-updated.
+        */
+        void deriveRootBone(void) const;
+
+        /// Debugging method
+        void _dumpContents(const String& filename);
+
+        /** @copydoc Resource::loadImpl
+        */
+        void loadImpl(void);
+
+        /** @copydoc Resource::unloadImpl
+        */
+        void unloadImpl(void);
+		/// @copydoc Resource::calculateSize
+		size_t calculateSize(void) const { return 0; } // TODO 
+
+    };
+
+    /** Specialisation of SharedPtr to allow SharedPtr to be assigned to SkeletonPtr 
+    @note Has to be a subclass since we need operator=.
+    We could templatise this instead of repeating per Resource subclass, 
+    except to do so requires a form VC6 does not support i.e.
+    ResourceSubclassPtr<T> : public SharedPtr<T>
+    */
+    class _OgreExport SkeletonPtr : public SharedPtr<Skeleton> 
+    {
+    public:
+        SkeletonPtr() : SharedPtr<Skeleton>() {}
+        explicit SkeletonPtr(Skeleton* rep) : SharedPtr<Skeleton>(rep) {}
+        SkeletonPtr(const SkeletonPtr& r) : SharedPtr<Skeleton>(r) {} 
+        SkeletonPtr(const ResourcePtr& r) : SharedPtr<Skeleton>()
+        {
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+                pRep = static_cast<Skeleton*>(r.getPointer());
+                pUseCount = r.useCountPointer();
+                if (pUseCount)
+                {
+                    ++(*pUseCount);
+                }
+            }
+        }
+
+        /// Operator used to convert a ResourcePtr to a SkeletonPtr
+        SkeletonPtr& operator=(const ResourcePtr& r)
+        {
+            if (pRep == static_cast<Skeleton*>(r.getPointer()))
+                return *this;
+            release();
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+                pRep = static_cast<Skeleton*>(r.getPointer());
+                pUseCount = r.useCountPointer();
+                if (pUseCount)
+                {
+                    ++(*pUseCount);
+                }
+            }
+			else
+			{
+				// RHS must be a null pointer
+				assert(r.isNull() && "RHS must be null if it has no mutex!");
+				setNull();
+			}
+            return *this;
+        }
+    };
+
+	/// Link to another skeleton to share animations
+	struct LinkedSkeletonAnimationSource
+	{
+		String skeletonName;
+		SkeletonPtr pSkeleton;
+		Real scale;
+		LinkedSkeletonAnimationSource(const String& skelName, Real scl)
+			: skeletonName(skelName), scale(scl) {}
+			LinkedSkeletonAnimationSource(const String& skelName, Real scl, 
+				SkeletonPtr skelPtr)
+				: skeletonName(skelName), pSkeleton(skelPtr), scale(scl) {}
+	};
+}
+
+
+#endif
+
Index: /OgreMain/include/OgreSkeletonFileFormat.h
===================================================================
--- /OgreMain/include/OgreSkeletonFileFormat.h	(revision 5)
+++ /OgreMain/include/OgreSkeletonFileFormat.h	(revision 5)
@@ -0,0 +1,102 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __SkeletonFileFormat_H__
+#define __SkeletonFileFormat_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+/** Definition of the OGRE .skeleton file format 
+
+    .skeleton files are binary files (for read efficiency at runtime) and are arranged into chunks 
+    of data, very like 3D Studio's format.
+    A chunk always consists of:
+        unsigned short CHUNK_ID        : one of the following chunk ids identifying the chunk
+        unsigned long  LENGTH          : length of the chunk in bytes, including this header
+        void*          DATA            : the data, which may contain other sub-chunks (various data types)
+    
+    A .skeleton file contains both the definition of the Skeleton object and the animations it contains. It
+    contains only a single skeleton but can contain multiple animations.
+
+
+*/
+    enum SkeletonChunkID {
+        SKELETON_HEADER            = 0x1000,
+            // char* version           : Version number check
+        SKELETON_BONE              = 0x2000,
+        // Repeating section defining each bone in the system. 
+        // Bones are assigned indexes automatically based on their order of declaration
+        // starting with 0.
+
+            // char* name                       : name of the bone
+            // unsigned short handle            : handle of the bone, should be contiguous & start at 0
+            // Vector3 position                 : position of this bone relative to parent 
+            // Quaternion orientation           : orientation of this bone relative to parent 
+            // Vector3 scale                    : scale of this bone relative to parent 
+
+        SKELETON_BONE_PARENT       = 0x3000,
+        // Record of the parent of a single bone, used to build the node tree
+        // Repeating section, listed in Bone Index order, one per Bone
+
+            // unsigned short handle             : child bone
+            // unsigned short parentHandle   : parent bone
+
+        SKELETON_ANIMATION         = 0x4000,
+        // A single animation for this skeleton
+
+            // char* name                       : Name of the animation
+            // float length                      : Length of the animation in seconds
+
+            SKELETON_ANIMATION_TRACK = 0x4100,
+            // A single animation track (relates to a single bone)
+            // Repeating section (within SKELETON_ANIMATION)
+                
+                // unsigned short boneIndex     : Index of bone to apply to
+
+                SKELETON_ANIMATION_TRACK_KEYFRAME = 0x4110,
+                // A single keyframe within the track
+                // Repeating section
+
+                    // float time                    : The time position (seconds)
+                    // Quaternion rotate            : Rotation to apply at this keyframe
+                    // Vector3 translate            : Translation to apply at this keyframe
+                    // Vector3 scale                : Scale to apply at this keyframe
+		SKELETON_ANIMATION_LINK         = 0x5000
+		// Link to another skeleton, to re-use its animations
+
+			// char* skeletonName					: name of skeleton to get animations from
+			// float scale							: scale to apply to trans/scale keys
+
+    };
+
+} // namespace
+
+
+#endif
Index: /OgreMain/include/OgreSkeletonInstance.h
===================================================================
--- /OgreMain/include/OgreSkeletonInstance.h	(revision 5)
+++ /OgreMain/include/OgreSkeletonInstance.h	(revision 5)
@@ -0,0 +1,156 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __SkeletonInstance_H__
+#define __SkeletonInstance_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreSkeleton.h"
+
+namespace Ogre {
+
+    /** A SkeletonInstance is a single instance of a Skeleton used by a world object.
+    @remarks
+        The difference between a Skeleton and a SkeletonInstance is that the
+        Skeleton is the 'master' version much like Mesh is a 'master' version of
+        Entity. Many SkeletonInstance objects can be based on a single Skeleton, 
+        and are copies of it when created. Any changes made to this are not
+        reflected in the master copy. The exception is animations; these are
+        shared on the Skeleton itself and may not be modified here.
+    */
+    class _OgreExport SkeletonInstance : public Skeleton
+    {
+    public:
+        /** Constructor, don't call directly, this will be created automatically
+        when you create an Entity based on a skeletally animated Mesh.
+        */
+        SkeletonInstance(const SkeletonPtr& masterCopy);
+        ~SkeletonInstance();
+
+        /** Gets the number of animations on this skeleton. */
+        unsigned short getNumAnimations(void) const;
+
+        /** Gets a single animation by index. */
+        Animation* getAnimation(unsigned short index) const;
+		/// Internal accessor for animations (returns null if animation does not exist)
+		Animation* _getAnimationImpl(const String& name, 
+			const LinkedSkeletonAnimationSource** linker = 0) const;
+
+        /** Creates a new Animation object for animating this skeleton. 
+        @remarks
+            This method updates the reference skeleton, not just this instance!
+        @param name The name of this animation
+        @param length The length of the animation in seconds
+        */
+        Animation* createAnimation(const String& name, Real length);
+
+        /** Returns the named Animation object. */
+        Animation* getAnimation(const String& name, 
+			const LinkedSkeletonAnimationSource** linker = 0) const;
+
+        /** Removes an Animation from this skeleton. 
+        @remarks
+            This method updates the reference skeleton, not just this instance!
+        */
+        void removeAnimation(const String& name);
+
+
+        /** Creates a TagPoint ready to be attached to a bone */
+        TagPoint* createTagPointOnBone(Bone* bone, 
+            const Quaternion &offsetOrientation = Quaternion::IDENTITY, 
+            const Vector3 &offsetPosition = Vector3::ZERO);
+
+        /** Frees a TagPoint that already attached to a bone */
+        void freeTagPoint(TagPoint* tagPoint);
+
+		/// @copydoc Skeleton::addLinkedSkeletonAnimationSource
+		void addLinkedSkeletonAnimationSource(const String& skelName, 
+			Real scale = 1.0f);
+		/// @copydoc Skeleton::removeAllLinkedSkeletonAnimationSources
+		void removeAllLinkedSkeletonAnimationSources(void);
+		/// @copydoc Skeleton::getLinkedSkeletonAnimationSourceIterator
+		LinkedSkeletonAnimSourceIterator 
+			getLinkedSkeletonAnimationSourceIterator(void) const;
+
+		/// @copydoc Skeleton::_initAnimationState
+		void _initAnimationState(AnimationStateSet* animSet);
+
+		/// @copydoc Skeleton::_refreshAnimationState
+		void _refreshAnimationState(AnimationStateSet* animSet);
+
+		/// @copydoc Resource::getName
+		const String& getName(void) const;
+		/// @copydoc Resource::getHandle
+		ResourceHandle getHandle(void) const;
+		/// @copydoc Resource::getGroup
+		const String& getGroup(void);
+
+    protected:
+        /// Pointer back to master Skeleton
+        SkeletonPtr mSkeleton;
+
+        typedef std::list<TagPoint*> TagPointList;
+
+        /** Active tag point list.
+        @remarks
+            This is a linked list of pointers to actived tag point
+        @par
+            This allows very fast instertions and deletions from anywhere in the list to activate / deactivate
+            tag points (required for weapon / equip systems etc)    as well as resuse of TagPoint instances
+            without construction & destruction which avoids memory thrashing.
+        */
+        TagPointList mActiveTagPoints;
+
+        /** Free tag point list.
+        @remarks
+            This contains a list of the tag points free for use as new instances
+            as required by the set. When a TagPoint instances are deactived, there will are referenced on this
+            list. As they get used this list reduces, as they get released back to to the set they get added
+            back to the list.
+        */
+        TagPointList mFreeTagPoints;
+
+        /// TagPoint automatic handles
+        unsigned short mNextTagPointAutoHandle;
+
+        void cloneBoneAndChildren(Bone* source, Bone* parent);
+        /** Overridden from Skeleton
+        */
+        void loadImpl(void);
+        /** Overridden from Skeleton
+        */
+        void unloadImpl(void);
+
+    };
+
+}
+
+
+#endif
+
Index: /OgreMain/include/OgreSkeletonManager.h
===================================================================
--- /OgreMain/include/OgreSkeletonManager.h	(revision 5)
+++ /OgreMain/include/OgreSkeletonManager.h	(revision 5)
@@ -0,0 +1,98 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __SkeletonManager_H__
+#define __SkeletonManager_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreResourceManager.h"
+#include "OgreSingleton.h"
+
+namespace Ogre {
+
+    /** Handles the management of skeleton resources.
+        @remarks
+            This class deals with the runtime management of
+            skeleton data; like other resource managers it handles
+            the creation of resources (in this case skeleton data),
+            working within a fixed memory budget.
+    */
+    class _OgreExport SkeletonManager: public ResourceManager, public Singleton<SkeletonManager>
+    {
+    public:
+        /// Constructor
+        SkeletonManager();
+        ~SkeletonManager();
+
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static SkeletonManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static SkeletonManager* getSingletonPtr(void);
+    protected:
+
+        /// @copydoc ResourceManager::createImpl
+        Resource* createImpl(const String& name, ResourceHandle handle, 
+            const String& group, bool isManual, ManualResourceLoader* loader, 
+            const NameValuePairList* createParams);
+
+    };
+
+
+}
+
+
+#endif
Index: /OgreMain/include/OgreSkeletonSerializer.h
===================================================================
--- /OgreMain/include/OgreSkeletonSerializer.h	(revision 5)
+++ /OgreMain/include/OgreSkeletonSerializer.h	(revision 5)
@@ -0,0 +1,117 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __SkeletonSerializer_H__
+#define __SkeletonSerializer_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreSkeleton.h"
+#include "OgreSerializer.h"
+
+namespace Ogre {
+
+    /** Class for serialising skeleton data to/from an OGRE .skeleton file.
+    @remarks
+        This class allows exporters to write OGRE .skeleton files easily, and allows the
+        OGRE engine to import .skeleton files into instatiated OGRE Skeleton objects.
+        Note that a .skeleton file includes not only the Skeleton, but also definitions of
+        any Animations it uses.
+    @par
+        To export a Skeleton:<OL>
+        <LI>Create a Skeleton object and populate it using it's methods.</LI>
+        <LI>Call the exportSkeleton method</LI>
+        </OL>
+    */
+    class _OgreExport SkeletonSerializer : public Serializer
+    {
+    public:
+        SkeletonSerializer();
+        virtual ~SkeletonSerializer();
+
+
+        /** Exports a skeleton to the file specified. 
+        @remarks
+            This method takes an externally created Skeleton object, and exports both it
+            and animations it uses to a .skeleton file.
+        @param pSkeleton Weak reference to the Skeleton to export
+        @param filename The destination filename
+		@param endianMode The endian mode to write in
+        */
+        void exportSkeleton(const Skeleton* pSkeleton, const String& filename,
+			Endian endianMode = ENDIAN_NATIVE);
+
+        /** Imports Skeleton and animation data from a .skeleton file DataStream.
+        @remarks
+            This method imports data from a DataStream opened from a .skeleton file and places it's
+            contents into the Skeleton object which is passed in. 
+        @param stream The DataStream holding the .skeleton data. Must be initialised (pos at the start of the buffer).
+        @param pDest Weak reference to the Skeleton object which will receive the data. Should be blank already.
+        */
+        void importSkeleton(DataStreamPtr& stream, Skeleton* pDest);
+
+        // TODO: provide Cal3D importer?
+
+    protected:
+        // Internal export methods
+        void writeSkeleton(const Skeleton* pSkel);
+        void writeBone(const Skeleton* pSkel, const Bone* pBone);
+        void writeBoneParent(const Skeleton* pSkel, unsigned short boneId, unsigned short parentId);
+        void writeAnimation(const Skeleton* pSkel, const Animation* anim);
+        void writeAnimationTrack(const Skeleton* pSkel, const NodeAnimationTrack* track);
+        void writeKeyFrame(const Skeleton* pSkel, const TransformKeyFrame* key);
+		void writeSkeletonAnimationLink(const Skeleton* pSkel, 
+			const LinkedSkeletonAnimationSource& link);
+
+        // Internal import methods
+        void readBone(DataStreamPtr& stream, Skeleton* pSkel);
+        void readBoneParent(DataStreamPtr& stream, Skeleton* pSkel);
+        void readAnimation(DataStreamPtr& stream, Skeleton* pSkel);
+        void readAnimationTrack(DataStreamPtr& stream, Animation* anim, Skeleton* pSkel);
+        void readKeyFrame(DataStreamPtr& stream, NodeAnimationTrack* track, Skeleton* pSkel);
+		void readSkeletonAnimationLink(DataStreamPtr& stream, Skeleton* pSkel);
+
+        size_t calcBoneSize(const Skeleton* pSkel, const Bone* pBone);
+        size_t calcBoneSizeWithoutScale(const Skeleton* pSkel, const Bone* pBone);
+        size_t calcBoneParentSize(const Skeleton* pSkel);
+        size_t calcAnimationSize(const Skeleton* pSkel, const Animation* pAnim);
+        size_t calcAnimationTrackSize(const Skeleton* pSkel, const NodeAnimationTrack* pTrack);
+        size_t calcKeyFrameSize(const Skeleton* pSkel, const TransformKeyFrame* pKey);
+        size_t calcKeyFrameSizeWithoutScale(const Skeleton* pSkel, const TransformKeyFrame* pKey);
+		size_t calcSkeletonAnimationLinkSize(const Skeleton* pSkel, 
+			const LinkedSkeletonAnimationSource& link);
+
+
+
+
+    };
+
+}
+
+
+#endif
Index: /OgreMain/include/OgreSphere.h
===================================================================
--- /OgreMain/include/OgreSphere.h	(revision 5)
+++ /OgreMain/include/OgreSphere.h	(revision 5)
@@ -0,0 +1,101 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Sphere_H_
+#define __Sphere_H_
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+
+#include "OgreVector3.h"
+
+namespace Ogre {
+
+
+    /** A sphere primitive, mostly used for bounds checking. 
+    @remarks
+        A sphere in math texts is normally represented by the function
+        x^2 + y^2 + z^2 = r^2 (for sphere's centered on the origin). Ogre stores spheres
+        simply as a center point and a radius.
+    */
+    class _OgreExport Sphere
+    {
+    protected:
+        Real mRadius;
+        Vector3 mCenter;
+    public:
+        /** Standard constructor - creates a unit sphere around the origin.*/
+        Sphere() : mRadius(1.0), mCenter(Vector3::ZERO) {}
+        /** Constructor allowing arbitrary spheres. 
+            @param center The center point of the sphere.
+            @param radius The radius of the sphere.
+        */
+        Sphere(const Vector3& center, Real radius)
+            : mRadius(radius), mCenter(center) {}
+
+        /** Returns the radius of the sphere. */
+        Real getRadius(void) const { return mRadius; }
+
+        /** Sets the radius of the sphere. */
+        void setRadius(Real radius) { mRadius = radius; }
+
+        /** Returns the center point of the sphere. */
+        const Vector3& getCenter(void) const { return mCenter; }
+
+        /** Sets the center point of the sphere. */
+        void setCenter(const Vector3& center) { mCenter = center; }
+
+		/** Returns whether or not this sphere interects another sphere. */
+		bool intersects(const Sphere& s) const
+		{
+            return (s.mCenter - mCenter).squaredLength() <=
+                Math::Sqr(s.mRadius + mRadius);
+		}
+		/** Returns whether or not this sphere interects a box. */
+		bool intersects(const AxisAlignedBox& box) const
+		{
+			return Math::intersects(*this, box);
+		}
+		/** Returns whether or not this sphere interects a plane. */
+		bool intersects(const Plane& plane) const
+		{
+			return Math::intersects(*this, plane);
+		}
+		/** Returns whether or not this sphere interects a point. */
+		bool intersects(const Vector3& v) const
+		{
+            return ((v - mCenter).squaredLength() <= Math::Sqr(mRadius));
+		}
+        
+
+    };
+
+}
+
+#endif
+
Index: /OgreMain/include/OgreSpotShadowFadePng.h
===================================================================
--- /OgreMain/include/OgreSpotShadowFadePng.h	(revision 5)
+++ /OgreMain/include/OgreSpotShadowFadePng.h	(revision 5)
@@ -0,0 +1,648 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __SPOT_SHADOW_FADE_PNG_H__
+#define __SPOT_SHADOW_FADE_PNG_H__
+
+namespace Ogre {
+
+    // This exists so we don't have to be dependent on an external .png file
+    // for this core feature (PNG used to fade out the edges of spotlight shadows)
+    #define SPOT_SHADOW_FADE_PNG_SIZE 9728
+    unsigned char SPOT_SHADOW_FADE_PNG[SPOT_SHADOW_FADE_PNG_SIZE] = {
+         0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52  
+       , 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x08, 0x02, 0x00, 0x00, 0x00, 0x4c, 0x5c, 0xf6  
+       , 0x9c, 0x00, 0x00, 0x00, 0x04, 0x67, 0x41, 0x4d, 0x41, 0x00, 0x00, 0xb1, 0x8e, 0x7c, 0xfb, 0x51  
+       , 0x93, 0x00, 0x00, 0x00, 0x20, 0x63, 0x48, 0x52, 0x4d, 0x00, 0x00, 0x7a, 0x25, 0x00, 0x00, 0x80  
+       , 0x83, 0x00, 0x00, 0xf9, 0xff, 0x00, 0x00, 0x80, 0xe8, 0x00, 0x00, 0x75, 0x30, 0x00, 0x00, 0xea  
+       , 0x60, 0x00, 0x00, 0x3a, 0x97, 0x00, 0x00, 0x17, 0x6f, 0x97, 0xa9, 0x99, 0xd4, 0x00, 0x00, 0x25  
+       , 0x8a, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c, 0x62, 0xfc, 0xff, 0xff, 0x3f, 0xc3, 0x28, 0x18, 0x38                                                               
+       , 0x00, 0x10, 0x80, 0x58, 0x2a, 0xc8, 0x01, 0x00, 0x04, 0x41, 0x40, 0xfd, 0xff, 0xc7, 0x61, 0x66  
+       , 0xeb, 0x5a, 0xc7, 0x60, 0x32, 0x98, 0x17, 0xdc, 0xec, 0xbf, 0x0b, 0x3c, 0x90, 0xff, 0x11, 0x8e  
+       , 0x61, 0x87, 0xd7, 0x54, 0x32, 0xca, 0xed, 0x6d, 0x2a, 0x89, 0x48, 0x21, 0x04, 0x82, 0x92, 0x28  
+       , 0x1e, 0xa3, 0x96, 0xe4, 0xef, 0x2b, 0x2e, 0x98, 0x02, 0x30, 0x47, 0xe6, 0x48, 0x00, 0x02, 0x20  
+       , 0x10, 0x93, 0xe3, 0xff, 0x2f, 0x46, 0x34, 0x69, 0xac, 0xec, 0x75, 0x19, 0x42, 0x4d, 0xf6, 0x8f  
+       , 0x05, 0xa0, 0x7a, 0xce, 0x61, 0xc9, 0xac, 0xbb, 0x70, 0x69, 0x61, 0x85, 0x25, 0x88, 0xeb, 0x70  
+       , 0x9e, 0xd0, 0x40, 0xa8, 0x1e, 0xed, 0x11, 0xa5, 0xfc, 0x2a, 0xed, 0x77, 0xb6, 0xb7, 0x1b, 0x14  
+       , 0xc8, 0xfc, 0xee, 0xb3, 0x97, 0xdc, 0x02, 0x30, 0x4f, 0x06, 0x37, 0x00, 0x80, 0x20, 0x0c, 0x94  
+       , 0x08, 0xfb, 0x0f, 0x0c, 0x1a, 0xaf, 0xe8, 0x10, 0x92, 0x58, 0x1a, 0x9e, 0xed, 0xf9, 0x4b, 0x01  
+       , 0xc2, 0x7c, 0x55, 0x12, 0x7c, 0xa5, 0x5e, 0x56, 0xdb, 0x52, 0x0f, 0x34, 0xd1, 0xc2, 0xec, 0x5b  
+       , 0xc3, 0xfd, 0x09, 0xc2, 0x1f, 0x31, 0x01, 0x6e, 0xa3, 0xa1, 0x87, 0x76, 0x91, 0xff, 0x82, 0x57  
+       , 0xe2, 0xa4, 0x8f, 0xb0, 0x7c, 0x86, 0x07, 0x26, 0xe4, 0xfb, 0x32, 0xed, 0x83, 0x32, 0x8e, 0x00  
+       , 0xc4, 0x94, 0x5b, 0x0a, 0x00, 0x20, 0x08, 0x04, 0x31, 0xb2, 0xfb, 0x9f, 0xb7, 0xe8, 0xb1, 0x63  
+       , 0x41, 0x47, 0x70, 0xa3, 0x10, 0x03, 0x3f, 0x46, 0xd7, 0xe4, 0x06, 0x88, 0x9f, 0x60, 0x0f, 0x88  
+       , 0xc7, 0xdb, 0x91, 0xb8, 0x77, 0x12, 0x04, 0x64, 0xe9, 0x83, 0x34, 0x31, 0xc6, 0x0c, 0x33, 0xec  
+       , 0xf5, 0x3d, 0x60, 0x54, 0x61, 0xea, 0xd9, 0x41, 0x06, 0xfa, 0xc2, 0xec, 0x5f, 0xd5, 0x20, 0xfe  
+       , 0xc8, 0x7b, 0xe3, 0x28, 0x68, 0xee, 0x71, 0xaf, 0xf4, 0x65, 0x96, 0xb6, 0xa5, 0x8e, 0x00, 0xc4  
+       , 0x94, 0x41, 0x12, 0xc0, 0x20, 0x08, 0x03, 0x0f, 0x15, 0xf8, 0xff, 0x73, 0x01, 0x47, 0x9b, 0x00  
+       , 0x6f, 0x68, 0x99, 0x51, 0x31, 0x07, 0x0f, 0x1b, 0xc9, 0x6f, 0x06, 0x14, 0xd7, 0x4c, 0x8f, 0x00
+       , 0xe9, 0x70, 0xf7, 0xc4, 0x42, 0x13, 0x14, 0x12, 0x02, 0x8f, 0xe4, 0x65, 0x8f, 0x07, 0x35, 0x02
+       , 0x7b, 0xb2, 0x88, 0x31, 0x74, 0xf0, 0x4c, 0x65, 0xd0, 0xed, 0x09, 0xe0, 0xdf, 0x6f, 0xfa, 0xd8
+       , 0xd7, 0xd4, 0x53, 0xac, 0x17, 0x49, 0xab, 0x69, 0x97, 0x08, 0x3b, 0x33, 0x83, 0x62, 0x52, 0x82
+       , 0xb6, 0x13, 0xdf, 0x73, 0x78, 0x05, 0xe0, 0xa5, 0x4c, 0x52, 0x00, 0x08, 0x61, 0x20, 0xa8, 0xe0
+       , 0xf6, 0xff, 0xd7, 0x46, 0x2f, 0xda, 0xd5, 0xc8, 0x30, 0x2f, 0xd0, 0x98, 0xe5, 0x10, 0x14, 0xaa
+       , 0x8d, 0xcf, 0xaf, 0xdc, 0x1b, 0xae, 0x26, 0x0f, 0xf6, 0x19, 0x11, 0x0a, 0x98, 0xf2, 0x52, 0x5a
+       , 0x81, 0x0a, 0x08, 0xc0, 0x34, 0xa8, 0xd5, 0x83, 0xe0, 0x11, 0xc0, 0xe1, 0x0f, 0x7d, 0x1f, 0x95
+       , 0xd2, 0x1d, 0x82, 0x8c, 0xff, 0x35, 0x28, 0xf7, 0xa3, 0xa9, 0xc5, 0x68, 0x5b, 0xed, 0xbc, 0xfe
+       , 0xfe, 0x2d, 0x95, 0x83, 0x8d, 0xb9, 0x54, 0x68, 0x74, 0x20, 0xc6, 0x4b, 0x1e, 0x47, 0x00, 0xde
+       , 0xca, 0x25, 0x07, 0x60, 0x10, 0x84, 0x82, 0xa9, 0x6d, 0x2c, 0xdc, 0xff, 0xb0, 0x60, 0x62, 0x62
+       , 0x65, 0xa8, 0x1e, 0x41, 0x16, 0x7c, 0x5c, 0xb8, 0x98, 0x87, 0xcf, 0x73, 0x02, 0x8c, 0x44, 0x1f
+       , 0xb4, 0x03, 0xb6, 0xbb, 0x79, 0x84, 0x19, 0xd5, 0x18, 0x1b, 0x1d, 0xfc, 0x5b, 0x3e, 0x82, 0xfe
+       , 0x6f, 0x3e, 0xd6, 0xc3, 0xea, 0xe7, 0xfa, 0x0f, 0x62, 0x5f, 0x8e, 0x85, 0x14, 0x4c, 0xa8, 0xf0
+       , 0x03, 0x5f, 0xf7, 0xb2, 0xa2, 0x87, 0x54, 0x17, 0xfe, 0x24, 0xaf, 0x22, 0xa2, 0xfa, 0xce, 0x14
+       , 0x35, 0x26, 0xe1, 0x48, 0xb6, 0x40, 0x53, 0x86, 0x23, 0xb6, 0xf4, 0x09, 0xc0, 0x6b, 0x15, 0xe4
+       , 0x00, 0x08, 0x83, 0xb0, 0x10, 0xb2, 0x0c, 0xf8, 0xff, 0x5b, 0xd5, 0x2d, 0x31, 0x0a, 0xed, 0xf4
+       , 0x07, 0x5a, 0xb2, 0x25, 0xdb, 0xb1, 0x05, 0xda, 0x9f, 0x04, 0xc0, 0x6e, 0x1f, 0xa4, 0x79, 0x07
+       , 0xb6, 0x3a, 0x85, 0xf5, 0x38, 0x56, 0xa5, 0x06, 0xb3, 0x9a, 0x1d, 0x9e, 0xf0, 0xb0, 0x7f, 0xc2
+       , 0x01, 0x88, 0x8b, 0xf5, 0x0a, 0x80, 0x28, 0x24, 0x68, 0x7f, 0x06, 0x21, 0x11, 0xf8, 0x40, 0xd1
+       , 0xcf, 0xdc, 0xa3, 0xda, 0xb4, 0x61, 0x1c, 0x72, 0x28, 0xd2, 0x03, 0xba, 0x81, 0xf0, 0x82, 0x85
+       , 0x87, 0x79, 0x04, 0x2f, 0x0f, 0xe7, 0x2f, 0x14, 0xe9, 0x58, 0x59, 0x5f, 0x33, 0x73, 0x0b, 0x40
+       , 0x6b, 0xb9, 0xe3, 0x00, 0x0c, 0xc3, 0x20, 0x74, 0x89, 0xf2, 0x31, 0xf7, 0x3f, 0xaa, 0xe7, 0x16
+       , 0xb0, 0xdb, 0x1b, 0x44, 0x8a, 0x62, 0x65, 0x05, 0xe7, 0xc1, 0x75, 0x03, 0xa8, 0xa3, 0x95, 0x97
+       , 0xf0, 0x29, 0xad, 0x93, 0xa2, 0x67, 0xea, 0x70, 0xea, 0x25, 0x1f, 0xe4, 0x8b, 0x89, 0x43, 0xda
+       , 0xf8, 0xea, 0xdd, 0x37, 0x78, 0xb8, 0xf9, 0x8d, 0xfe, 0xe7, 0xeb, 0xa1, 0x6e, 0x41, 0x5d, 0x43
+       , 0x9d, 0x00, 0xb5, 0xff, 0xc5, 0xa0, 0x2e, 0x42, 0x4e, 0x64, 0x39, 0x30, 0x8a, 0x48, 0x7f, 0x18
+       , 0x4f, 0x07, 0x30, 0x77, 0x7c, 0x87, 0x6c, 0x40, 0x80, 0xe2, 0x23, 0x7a, 0x02, 0x87, 0x66, 0xe0
+       , 0x44, 0x7d, 0x8d, 0xb9, 0x36, 0x11, 0x76, 0x4f, 0x9f, 0x57, 0x00, 0xda, 0xcb, 0x1e, 0x0b, 0x60
+       , 0x10, 0x84, 0xc1, 0x0b, 0xaf, 0x43, 0xcb, 0xfd, 0x4f, 0xaa, 0xfd, 0xa1, 0x4b, 0xc3, 0x27, 0xf5
+       , 0x06, 0xf2, 0x14, 0x9d, 0x1c, 0x82, 0x49, 0x60, 0xe1, 0xd3, 0x82, 0x4c, 0x6a, 0x7e, 0xe7, 0xff
+       , 0x16, 0xce, 0xda, 0xbd, 0x01, 0xbc, 0x72, 0x6f, 0x6d, 0xdc, 0x15, 0xc8, 0x4d, 0x44, 0x99, 0x6f
+       , 0x60, 0x10, 0x74, 0x3d, 0x6f, 0xa9, 0xbe, 0x40, 0xcf, 0xb1, 0x60, 0x52, 0x60, 0x16, 0xa0, 0x24
+       , 0x08, 0x07, 0x80, 0x05, 0x63, 0x0e, 0xa8, 0x69, 0x00, 0x0e, 0x98, 0x91, 0xe8, 0x87, 0x20, 0x81
+       , 0xfd, 0xbd, 0x4f, 0x5a, 0xef, 0x76, 0xa6, 0x25, 0x4b, 0x92, 0x40, 0xff, 0x70, 0x56, 0x86, 0xfb
+       , 0xc5, 0xf9, 0x88, 0x13, 0x7b, 0xa8, 0x12, 0xaa, 0x83, 0x4a, 0xba, 0x02, 0xa5, 0x4f, 0x00, 0xda
+       , 0xab, 0x20, 0x07, 0x40, 0x10, 0x86, 0x69, 0x48, 0xd4, 0xb8, 0xf1, 0xff, 0x7f, 0x3a, 0x34, 0xc0
+       , 0xc9, 0xb2, 0x95, 0x27, 0x00, 0x64, 0x1c, 0xe0, 0x40, 0xba, 0xd1, 0xb5, 0xab, 0x12, 0xe0, 0x1c
+       , 0x5e, 0xa3, 0xd8, 0x11, 0x0a, 0x87, 0x19, 0x90, 0xb7, 0x82, 0x88, 0x83, 0x1a, 0x97, 0x00, 0x7a
+       , 0xeb, 0x8d, 0xd0, 0x77, 0x6a, 0xd2, 0x90, 0x3d, 0x93, 0x83, 0x9c, 0xff, 0x69, 0x87, 0x69, 0x02
+       , 0xb6, 0x70, 0xc9, 0x6c, 0x03, 0x6c, 0xc1, 0x7b, 0xd8, 0x30, 0x67, 0xa1, 0x44, 0x27, 0x36, 0xf5
+       , 0x68, 0x18, 0x01, 0xac, 0x34, 0x3f, 0xc0, 0x98, 0xae, 0x85, 0x0e, 0x14, 0xc8, 0xf9, 0x18, 0xe0
+       , 0x57, 0x95, 0x2c, 0x59, 0xdf, 0x4f, 0x91, 0x03, 0x64, 0x01, 0x5b, 0x93, 0x1b, 0x6f, 0x1b, 0xec
+       , 0x74, 0xad, 0x60, 0xa4, 0x5f, 0x00, 0x56, 0xac, 0x2d, 0x07, 0x40, 0x10, 0x86, 0x61, 0x8c, 0x18
+       , 0x15, 0xb8, 0xff, 0x39, 0x1d, 0x7e, 0x18, 0x9f, 0x5d, 0xd9, 0x12, 0x0f, 0xe0, 0x08, 0x7c, 0xf0
+       , 0x45, 0xba, 0xad, 0x6b, 0xf9, 0x3f, 0x01, 0x00, 0x4a, 0x89, 0x5c, 0xc9, 0x66, 0x13, 0x16, 0xbb
+       , 0x00, 0x76, 0x91, 0x55, 0xb8, 0xab, 0xe0, 0x86, 0x8a, 0xc7, 0x74, 0x0f, 0x55, 0xcf, 0x4e, 0xb9
+       , 0x73, 0x78, 0x34, 0xec, 0x79, 0x2a, 0xff, 0xdc, 0x97, 0xd7, 0x3f, 0x5d, 0x70, 0xfb, 0x88, 0x78
+       , 0xc2, 0x67, 0x0a, 0x77, 0x96, 0x82, 0xc0, 0x14, 0x98, 0x21, 0x56, 0x4f, 0xa0, 0xb3, 0xd8, 0x69
+       , 0xa8, 0xb7, 0x16, 0x88, 0x03, 0x1b, 0x41, 0xe1, 0x8f, 0xa3, 0x2f, 0x84, 0x92, 0x24, 0x8a, 0x64
+       , 0xa9, 0x39, 0xa5, 0x5c, 0x0a, 0x9a, 0x36, 0x63, 0x26, 0x41, 0x34, 0xe0, 0x89, 0xd0, 0x62, 0xe7
+       , 0x4c, 0x4e, 0x9a, 0xfe, 0xf5, 0xd2, 0xaf, 0x00, 0xac, 0x58, 0x5b, 0x0a, 0xc0, 0x20, 0x0c, 0x2b
+       , 0x7b, 0xc0, 0xee, 0x7f, 0xd4, 0x22, 0x63, 0xdd, 0x70, 0x5b, 0xd2, 0x07, 0x5e, 0xc0, 0x8a, 0xe2
+       , 0x8f, 0x20, 0x89, 0x6d, 0x52, 0x27, 0x13, 0x00, 0xf0, 0x42, 0x5c, 0x51, 0x61, 0x08, 0x3c, 0x43
+       , 0x55, 0x39, 0xb1, 0x34, 0x6d, 0x90, 0x59, 0x57, 0x5a, 0xb7, 0x9e, 0x44, 0xdf, 0xb2, 0x13, 0x88
+       , 0x0e, 0x8c, 0xe0, 0xdf, 0x04, 0xff, 0xa9, 0xe6, 0x97, 0x5f, 0x11, 0xd5, 0xfd, 0xbe, 0xfd, 0x1b
+       , 0x06, 0x08, 0x3b, 0x91, 0x14, 0x60, 0x19, 0x3e, 0x34, 0x85, 0x58, 0x96, 0x8a, 0xad, 0xd2, 0xa0
+       , 0x08, 0x58, 0xa3, 0x0e, 0x31, 0x0f, 0xe8, 0x76, 0xf6, 0x60, 0x00, 0xaa, 0x7b, 0x61, 0xd8, 0x01
+       , 0xb5, 0x3a, 0x5d, 0xa8, 0xc2, 0x20, 0xb8, 0x55, 0xf3, 0x5b, 0x5a, 0xbc, 0x8c, 0x0e, 0x0e, 0x70
+       , 0x74, 0x16, 0x62, 0xbf, 0x00, 0xac, 0x58, 0x5b, 0x0a, 0xc0, 0x20, 0x0c, 0x1b, 0x8c, 0x09, 0xc2
+       , 0xee, 0x7f, 0xcf, 0x0e, 0x86, 0x2b, 0xb8, 0x47, 0x9a, 0xa8, 0xbb, 0x80, 0x08, 0xfd, 0xd6, 0xa4
+       , 0xa6, 0x69, 0x66, 0x12, 0x80, 0x96, 0x3e, 0xa3, 0x89, 0xa2, 0xe9, 0x71, 0xec, 0x30, 0xc0, 0x6e
+       , 0xd6, 0xaa, 0xcc, 0x0f, 0x1e, 0xe4, 0x45, 0x66, 0xd3, 0x9b, 0xf8, 0xd3, 0x6e, 0x82, 0x85, 0xca
+       , 0x52, 0x99, 0x47, 0x08, 0x7c, 0x94, 0x57, 0xe6, 0xf3, 0x8f, 0x1f, 0x98, 0xc5, 0x2d, 0xdc, 0x00
+       , 0x9e, 0x11, 0x05, 0x29, 0x92, 0xd3, 0x3e, 0xdb, 0x45, 0x68, 0x1d, 0x93, 0x80, 0xf8, 0xf7, 0x59
+       , 0xb0, 0x29, 0x8b, 0x10, 0x01, 0x89, 0x22, 0xc4, 0x8f, 0x80, 0x8e, 0x48, 0x17, 0x58, 0xf0, 0x1c
+       , 0x70, 0x67, 0xdc, 0x2d, 0xfc, 0x41, 0x69, 0x1c, 0xe8, 0xaa, 0xf2, 0x06, 0x7b, 0xbd, 0x21, 0x48
+       , 0x58, 0x20, 0xa6, 0x80, 0xf6, 0x09, 0xc0, 0x8a, 0x99, 0x23, 0x01, 0x08, 0xc3, 0x30, 0x70, 0x86
+       , 0x9b, 0xff, 0x7f, 0x34, 0x98, 0x02, 0x12, 0x12, 0x40, 0xb6, 0x1c, 0x4a, 0x1a, 0xf8, 0x82, 0x0f
+       , 0x49, 0xab, 0x7f, 0x16, 0x80, 0xb1, 0xe0, 0xaa, 0x55, 0x73, 0x54, 0xe4, 0x57, 0xb1, 0xd9, 0x07
+       , 0x4c, 0x7d, 0x09, 0x12, 0x04, 0xdb, 0xf0, 0xdc, 0xa9, 0xd7, 0xbf, 0x91, 0xbe, 0x68, 0x00, 0x86
+       , 0xc0, 0x14, 0x9f, 0x5c, 0x93, 0xe7, 0x61, 0xb2, 0x93, 0x6b, 0xe9, 0x80, 0x25, 0x9c, 0x57, 0x79
+       , 0x1a, 0x38, 0xea, 0xce, 0x5b, 0x85, 0x5e, 0xbf, 0xc0, 0x4a, 0x51, 0x03, 0x02, 0xe6, 0xd2, 0xae
+       , 0x75, 0x42, 0x63, 0x35, 0xe4, 0x5e, 0xdc, 0x0f, 0x51, 0x61, 0x78, 0x8c, 0x2a, 0x43, 0x10, 0x9b
+       , 0x3d, 0xcd, 0x13, 0xef, 0x22, 0x19, 0x0a, 0x12, 0x4e, 0xd4, 0xaa, 0xa2, 0x53, 0x7a, 0xb1, 0x74
+       , 0x00, 0x51, 0x84, 0x39, 0x37, 0x9f, 0x3b, 0x8c, 0x5b, 0x00, 0x56, 0xac, 0x20, 0x05, 0x60, 0x18
+       , 0x84, 0xc1, 0xf6, 0xff, 0xb7, 0xb6, 0x3b, 0x2a, 0xb4, 0x34, 0x89, 0x8a, 0xe7, 0xb1, 0x09, 0x3d
+       , 0xf4, 0x56, 0x8c, 0x49, 0x13, 0x7f, 0x00, 0x00, 0x2a, 0x81, 0xee, 0x4a, 0x73, 0x28, 0xf5, 0x68
+       , 0xfa, 0xe4, 0x41, 0x3d, 0x73, 0x0c, 0x09, 0x52, 0xf7, 0xbf, 0x18, 0xad, 0x3c, 0xe6, 0x56, 0xce
+       , 0x27, 0x56, 0x3e, 0x1d, 0xbb, 0x7a, 0xee, 0x95, 0x79, 0x5f, 0x55, 0x9a, 0x24, 0x10, 0x64, 0xe9
+       , 0x2e, 0x49, 0x8a, 0x58, 0x70, 0xf5, 0x9f, 0x9c, 0xeb, 0x21, 0x62, 0xe0, 0x20, 0x83, 0x29, 0xa0
+       , 0xb9, 0x11, 0x04, 0xe7, 0x50, 0x04, 0x04, 0x8a, 0xe2, 0x78, 0x70, 0x11, 0x35, 0x13, 0xf9, 0xda
+       , 0xe9, 0x09, 0x10, 0x24, 0xee, 0x6f, 0xee, 0xe8, 0x08, 0xc0, 0x9a, 0x19, 0xec, 0x00, 0x08, 0x83
+       , 0x30, 0xd4, 0x93, 0xff, 0xff, 0xa7, 0xc3, 0x78, 0xd0, 0x19, 0x62, 0x7c, 0x14, 0x66, 0xbc, 0x4f
+       , 0x0e, 0x9c, 0x96, 0x65, 0xa1, 0xa1, 0x94, 0x6e, 0x16, 0x00, 0x1e, 0xc3, 0xb0, 0x92, 0xbe, 0xd9
+       , 0x37, 0x85, 0x51, 0xf5, 0x66, 0xcd, 0x0c, 0x28, 0x8e, 0x60, 0x53, 0x41, 0x70, 0x72, 0xea, 0x2d
+       , 0x7f, 0x51, 0x7f, 0x11, 0xbf, 0xfb, 0x67, 0xeb, 0xca, 0x81, 0xeb, 0x7f, 0xfe, 0x12, 0x25, 0x73
+       , 0xdd, 0x34, 0xd5, 0x92, 0x46, 0xb5, 0xc6, 0xc2, 0xf0, 0x2a, 0xb4, 0x17, 0xac, 0xa4, 0x10, 0x63
+       , 0xbd, 0x03, 0x42, 0x5a, 0x20, 0xf2, 0x4a, 0xae, 0x12, 0x64, 0x91, 0xca, 0x9d, 0x1a, 0xd6, 0x20
+       , 0x41, 0x8b, 0x72, 0x2f, 0x5b, 0xc3, 0x8c, 0x89, 0xf4, 0x08, 0x40, 0x8b, 0x15, 0xe4, 0x00, 0x08
+       , 0xc2, 0x30, 0x09, 0x99, 0xfc, 0xff, 0xa3, 0xec, 0xa4, 0x07, 0x96, 0x19, 0xd7, 0x55, 0x78, 0x80
+       , 0x46, 0xc2, 0x03, 0x9a, 0x6e, 0xb4, 0xa5, 0x9f, 0x06, 0x10, 0x20, 0x10, 0x31, 0x21, 0xf7, 0xc1
+       , 0x76, 0x68, 0x8e, 0x6a, 0x4f, 0xf2, 0xbb, 0x22, 0x6e, 0x1e, 0xd3, 0xca, 0x4e, 0x4a, 0xe9, 0x53
+       , 0x36, 0x70, 0xf7, 0xd3, 0x78, 0x6d, 0x06, 0x4e, 0x76, 0x6d, 0x17, 0x8d, 0xf5, 0xbf, 0x83, 0xf2
+       , 0xd5, 0x7d, 0x73, 0x2f, 0xc5, 0xf8, 0x10, 0xa4, 0x56, 0x80, 0x10, 0x09, 0xf3, 0x1f, 0xb6, 0x37
+       , 0x84, 0x00, 0xb3, 0x96, 0x59, 0x6c, 0x2c, 0xbe, 0x8d, 0x7b, 0x9f, 0x83, 0xc0, 0xf5, 0x05, 0x37
+       , 0x13, 0x71, 0xfc, 0xa1, 0xc3, 0x5a, 0xde, 0x41, 0xba, 0x05, 0x10, 0xf9, 0x11, 0x00, 0x74, 0x1d
+       , 0xa8, 0xb5, 0x03, 0xae, 0x6c, 0x3f, 0x02, 0xc3, 0xfe, 0xc3, 0xfb, 0x77, 0xef, 0xde, 0xbd, 0x07
+       , 0xc1, 0xb7, 0x5f, 0xbf, 0x80, 0xfb, 0x58, 0xdf, 0xa1, 0x1d, 0x5d, 0x48, 0xf1, 0x03, 0x2b, 0x7b
+       , 0x7e, 0x40, 0x06, 0xda, 0xa0, 0x8d, 0x4e, 0xa8, 0xcf, 0xfe, 0xe1, 0x2f, 0xd6, 0xa9, 0x0e, 0x40
+       , 0x31, 0x01, 0x19, 0xe3, 0x06, 0x66, 0x04, 0xe8, 0xc0, 0xec, 0x6f, 0x56, 0x50, 0xd0, 0xff, 0x81
+       , 0xb5, 0x84, 0x61, 0xce, 0x83, 0xa7, 0x78, 0x70, 0xc3, 0x00, 0x34, 0x52, 0x0e, 0x2e, 0x82, 0xe0
+       , 0x23, 0x53, 0x0c, 0xe0, 0x16, 0x19, 0xb0, 0x1f, 0xc7, 0x4a, 0x56, 0x3e, 0x00, 0x08, 0x20, 0x32
+       , 0x23, 0x00, 0xe8, 0x3e, 0x50, 0x95, 0xfb, 0xe5, 0x0b, 0xb8, 0xcc, 0x01, 0x15, 0x3a, 0xc0, 0xd0
+       , 0x7f, 0x0b, 0x8c, 0x80, 0xf7, 0xef, 0x21, 0x3d, 0x5d, 0x50, 0xf2, 0x87, 0x0e, 0x33, 0x7c, 0xfb
+       , 0x81, 0x14, 0xfc, 0x90, 0x7e, 0x2f, 0xc4, 0x87, 0x90, 0x74, 0x4f, 0x9e, 0x03, 0xa8, 0x05, 0x60
+       , 0x61, 0xfb, 0x87, 0x05, 0x08, 0xff, 0xc0, 0x66, 0x81, 0xfe, 0x40, 0x3b, 0xe3, 0x7f, 0xff, 0xc0
+       , 0xc6, 0xa3, 0x20, 0x49, 0x1e, 0x14, 0xf0, 0xa0, 0x60, 0x87, 0x54, 0x52, 0xf0, 0xf6, 0x30, 0x24
+       , 0xed, 0x70, 0x73, 0x03, 0xcb, 0x22, 0x92, 0xf3, 0x01, 0x40, 0x00, 0x91, 0x13, 0x01, 0xa0, 0x92
+       , 0xe7, 0xeb, 0x37, 0x50, 0xe8, 0x7f, 0xfa, 0x08, 0x2e, 0x6f, 0x40, 0x81, 0xff, 0xf6, 0x2d, 0x28
+       , 0xf4, 0xc1, 0x43, 0x0c, 0xa0, 0x51, 0x06, 0xd0, 0x90, 0x03, 0x38, 0xfc, 0xc1, 0x81, 0x0f, 0x22
+       , 0x20, 0x2d, 0x39, 0x20, 0xfe, 0x03, 0x69, 0x6d, 0xfe, 0xfd, 0x43, 0xdf, 0x44, 0x8f, 0x0f, 0xfc
+       , 0x01, 0x57, 0x3e, 0x2c, 0x90, 0x99, 0x37, 0x10, 0x87, 0xed, 0x0f, 0x6c, 0x22, 0xee, 0x0f, 0xb4
+       , 0x23, 0x8e, 0xd4, 0x2a, 0x00, 0x4d, 0x51, 0xff, 0xfb, 0x0b, 0x1b, 0x93, 0x85, 0x0c, 0x8b, 0x03
+       , 0xfb, 0x21, 0xc0, 0x06, 0x11, 0x30, 0x1f, 0x00, 0x6b, 0x16, 0x92, 0xac, 0x06, 0x08, 0x20, 0x92
+       , 0x23, 0x00, 0xe8, 0x10, 0x60, 0xa8, 0x02, 0xc3, 0x19, 0xd8, 0xba, 0x07, 0x85, 0x3e, 0x30, 0xe8
+       , 0xc1, 0xc1, 0x0f, 0x64, 0x83, 0x87, 0x18, 0xa0, 0xc9, 0x1f, 0x54, 0x02, 0x41, 0x4a, 0x1f, 0x68
+       , 0xb7, 0x0b, 0xdc, 0xf2, 0x81, 0x8e, 0xb5, 0xfd, 0xa5, 0x75, 0x59, 0x4f, 0x0e, 0xf8, 0x0f, 0x4a
+       , 0x58, 0xff, 0x20, 0x03, 0x7f, 0x7f, 0xa0, 0x81, 0xfe, 0x0f, 0x36, 0x35, 0xfd, 0xef, 0xcf, 0x3f
+       , 0x44, 0x7f, 0xe4, 0x1f, 0x68, 0x55, 0x00, 0x6c, 0x4d, 0x00, 0x74, 0x3c, 0x0a, 0xb2, 0x26, 0x80
+       , 0x81, 0x91, 0x89, 0x87, 0x9b, 0x0b, 0xd8, 0xd6, 0x22, 0xde, 0x5a, 0x80, 0x00, 0x22, 0x2d, 0x02
+       , 0x80, 0x36, 0x82, 0x87, 0x18, 0x80, 0x6d, 0x1e, 0x68, 0xc9, 0x03, 0x4c, 0xf7, 0xc0, 0xd0, 0x87
+       , 0xa4, 0x7d, 0xf0, 0x30, 0x03, 0x08, 0x02, 0xfb, 0xc1, 0xe0, 0xd4, 0xff, 0xf5, 0x3b, 0x78, 0xdc
+       , 0xff, 0x27, 0x64, 0x84, 0x1f, 0xd2, 0x88, 0x1e, 0xe8, 0x32, 0x07, 0x3f, 0x00, 0x06, 0x2c, 0x28
+       , 0x81, 0x80, 0x12, 0x39, 0x6c, 0x0c, 0xea, 0x2f, 0xa8, 0xad, 0x03, 0x0a, 0xfd, 0xff, 0x7f, 0xe1
+       , 0xc3, 0xe0, 0xf0, 0xc2, 0x07, 0xa4, 0x87, 0x91, 0x91, 0x11, 0xa9, 0xeb, 0x01, 0x6c, 0xf2, 0x72
+       , 0x73, 0x71, 0x11, 0x3f, 0xdb, 0x0c, 0x10, 0x40, 0xa4, 0x45, 0x00, 0xb0, 0x24, 0x01, 0x26, 0xed
+       , 0x4f, 0x9f, 0x3f, 0x81, 0xda, 0xf8, 0xa0, 0x5a, 0x17, 0x98, 0xfa, 0xdf, 0x7c, 0x00, 0x87, 0x3e
+       , 0x78, 0x9c, 0xed, 0x0b, 0x74, 0xc0, 0x13, 0x5a, 0xf7, 0x7e, 0x83, 0xb5, 0xf9, 0x41, 0x6d, 0x1e
+       , 0x60, 0xed, 0xf5, 0x6f, 0x10, 0x26, 0x7c, 0x6c, 0x00, 0xbc, 0x10, 0x03, 0x29, 0xc1, 0x83, 0x02
+       , 0xff, 0x3f, 0x78, 0xb5, 0xc6, 0x7f, 0x06, 0x94, 0xde, 0x20, 0x23, 0x6c, 0x31, 0x06, 0xac, 0xa3
+       , 0x01, 0xeb, 0x7d, 0x73, 0x71, 0x71, 0x11, 0x69, 0x17, 0x40, 0x00, 0x91, 0x10, 0x01, 0xc0, 0x84
+       , 0x0c, 0x4c, 0xd4, 0xa0, 0xc1, 0x1d, 0x60, 0x8b, 0xf3, 0x03, 0xb0, 0xe8, 0xff, 0x00, 0xaa, 0x74
+       , 0x3f, 0x00, 0x4b, 0x1e, 0xc8, 0xf8, 0xe6, 0x17, 0x70, 0x05, 0xf0, 0x15, 0xd2, 0xfa, 0x84, 0x8e
+       , 0x3a, 0xfc, 0x00, 0x25, 0x7e, 0x60, 0x13, 0x1a, 0x58, 0xe8, 0x93, 0x13, 0x12, 0x03, 0x07, 0x80
+       , 0x41, 0x0c, 0xac, 0xb1, 0xa0, 0x7d, 0xba, 0x7f, 0x90, 0xe1, 0x6f, 0xd8, 0x48, 0x38, 0x03, 0x6c
+       , 0x14, 0x16, 0xba, 0x14, 0x83, 0x01, 0xdc, 0xd1, 0x03, 0x8f, 0x76, 0x30, 0x32, 0xb1, 0x40, 0xd6
+       , 0xbe, 0x30, 0x33, 0x11, 0x39, 0x56, 0x01, 0x10, 0x40, 0xc4, 0x46, 0x00, 0xb0, 0xf4, 0x00, 0x16
+       , 0xea, 0xa0, 0xc1, 0xcc, 0x4f, 0xe0, 0xd2, 0x07, 0x98, 0xec, 0xdf, 0xbd, 0x05, 0xb7, 0x79, 0xc0
+       , 0x65, 0xcf, 0x17, 0x58, 0xdb, 0x07, 0x3c, 0xfc, 0xfc, 0xe3, 0xdb, 0x37, 0x78, 0xb3, 0x07, 0xd2
+       , 0x96, 0x23, 0x3b, 0x20, 0x06, 0x16, 0x00, 0x1d, 0x0f, 0xce, 0x02, 0x90, 0xb1, 0x3f, 0xa4, 0x19
+       , 0x08, 0x06, 0x06, 0xa4, 0x81, 0x3f, 0xf0, 0x42, 0x24, 0x70, 0xb8, 0x83, 0x46, 0x9b, 0x58, 0xa1
+       , 0x7d, 0x6d, 0x66, 0x26, 0x66, 0x62, 0xc6, 0xec, 0x00, 0x02, 0x88, 0xa8, 0x08, 0x00, 0xe6, 0x46
+       , 0x60, 0x82, 0x86, 0x8c, 0x6f, 0x7e, 0x00, 0xa5, 0x7e, 0x50, 0xda, 0x07, 0x86, 0x3f, 0x52, 0xaa
+       , 0x07, 0xb6, 0xfc, 0xbf, 0x7c, 0x05, 0xcf, 0x70, 0x41, 0x26, 0x18, 0x41, 0x33, 0x5c, 0xe0, 0x62
+       , 0x1f, 0x58, 0x84, 0x52, 0x12, 0x04, 0x03, 0x0e, 0x80, 0xc5, 0x11, 0x34, 0x27, 0xfc, 0x43, 0x6e
+       , 0xb5, 0xfd, 0x87, 0x0c, 0xfd, 0x31, 0xc2, 0x26, 0x21, 0xc0, 0xb3, 0x9f, 0xe0, 0xf9, 0x06, 0x66
+       , 0x56, 0x56, 0xd8, 0x78, 0x13, 0x64, 0x81, 0x06, 0x7e, 0xf3, 0x01, 0x02, 0x88, 0xa8, 0x08, 0xf8
+       , 0x09, 0x1a, 0xa1, 0x05, 0xf6, 0xb9, 0xbe, 0x7e, 0x82, 0xf4, 0xb9, 0xde, 0x83, 0xaa, 0x5f, 0xe8
+       , 0x84, 0x16, 0xa4, 0xc8, 0x07, 0x91, 0x90, 0xa9, 0x45, 0x50, 0xab, 0x1f, 0xd2, 0xe6, 0x01, 0xf6
+       , 0xb5, 0xc8, 0x18, 0xc9, 0x19, 0x84, 0x00, 0x58, 0x11, 0x03, 0x0b, 0x24, 0x06, 0xc8, 0x10, 0x2c
+       , 0x08, 0x80, 0xc7, 0xbf, 0x61, 0xcb, 0x1f, 0x21, 0xa5, 0x3e, 0x64, 0x70, 0x83, 0x15, 0x3a, 0xc0
+       , 0x04, 0x1a, 0xdf, 0x00, 0xd2, 0xc0, 0x38, 0x21, 0x58, 0x19, 0x00, 0x04, 0x10, 0xe1, 0x08, 0x00
+       , 0x36, 0xdd, 0x41, 0xed, 0x4e, 0x50, 0xf2, 0xff, 0x04, 0x2a, 0xfd, 0x41, 0x4d, 0x7f, 0xe8, 0x48
+       , 0x03, 0xb8, 0xb9, 0x0f, 0x29, 0x75, 0xbe, 0x7e, 0x83, 0x0f, 0x77, 0xc2, 0x06, 0x6f, 0x87, 0x47
+       , 0xe8, 0x43, 0x00, 0xb0, 0x4e, 0x06, 0xe6, 0x03, 0x10, 0x0b, 0x3a, 0xed, 0x00, 0x1d, 0xe2, 0x83
+       , 0x54, 0xba, 0xcc, 0x90, 0xa9, 0x1f, 0x66, 0x16, 0xe8, 0x1a, 0x23, 0xc8, 0xc2, 0x23, 0xf0, 0x92
+       , 0x30, 0x66, 0x16, 0x16, 0x76, 0xbc, 0xf3, 0x68, 0x00, 0x01, 0x44, 0x20, 0x02, 0xc0, 0xd3, 0x5b
+       , 0xdf, 0x21, 0x43, 0x0e, 0xa0, 0x61, 0x7d, 0xf0, 0x58, 0x27, 0xb0, 0x1a, 0x80, 0x84, 0xfc, 0xb7
+       , 0x2f, 0x5f, 0xbe, 0x41, 0xc2, 0x1e, 0x3c, 0xe2, 0x86, 0x98, 0xbb, 0x18, 0x5e, 0xa1, 0x0f, 0x01
+       , 0x40, 0x1f, 0x01, 0xfd, 0xc5, 0x00, 0xa9, 0x7a, 0x99, 0x18, 0x20, 0x4d, 0x4e, 0xf0, 0xfa, 0x17
+       , 0x66, 0xe8, 0xd4, 0x27, 0xb8, 0xfe, 0x05, 0x47, 0x00, 0x3b, 0x08, 0xb1, 0xb2, 0xb1, 0xb2, 0xb3
+       , 0x83, 0xe7, 0x40, 0x59, 0xf0, 0xcc, 0x27, 0x03, 0x04, 0x10, 0x81, 0x08, 0x00, 0x06, 0x27, 0x30
+       , 0x65, 0x83, 0xc7, 0xf9, 0x41, 0xb3, 0x5a, 0xe0, 0xd6, 0xe7, 0x07, 0x48, 0x59, 0xff, 0x0d, 0x5e
+       , 0xde, 0x43, 0x06, 0x1a, 0xc0, 0x83, 0xfc, 0xe0, 0x72, 0xff, 0xe7, 0xf0, 0x0b, 0x7d, 0x08, 0x00
+       , 0xc5, 0xc1, 0xef, 0xdf, 0xf0, 0x66, 0x3f, 0xac, 0xf0, 0x81, 0xa5, 0x7f, 0xf0, 0x18, 0xf7, 0x47
+       , 0x96, 0x8f, 0xec, 0xd0, 0xa5, 0x5e, 0xe0, 0xf9, 0x66, 0xf0, 0xaa, 0x30, 0x2e, 0x4e, 0x9c, 0x05
+       , 0x11, 0x40, 0x00, 0xe1, 0x8b, 0x00, 0x60, 0xfb, 0x05, 0x58, 0x97, 0x02, 0x43, 0xfa, 0x33, 0x64
+       , 0xb4, 0x19, 0x34, 0xaf, 0xf5, 0xf1, 0x1b, 0x0c, 0x7c, 0x87, 0x91, 0xdf, 0x7f, 0x40, 0xdb, 0x9c
+       , 0x90, 0xb9, 0xdd, 0xe1, 0x1a, 0xfa, 0x10, 0x00, 0xec, 0x92, 0x01, 0x9b, 0x46, 0xf0, 0xf9, 0x4e
+       , 0x26, 0xd8, 0xac, 0x3f, 0x64, 0x82, 0x01, 0x32, 0xeb, 0x0f, 0x0c, 0x27, 0xc8, 0xaa, 0x2f, 0x0e
+       , 0x0e, 0xf0, 0xea, 0x47, 0x36, 0x76, 0xf0, 0xfa, 0x3c, 0xec, 0x41, 0x0d, 0x10, 0x40, 0xf8, 0x22
+       , 0xe0, 0xd7, 0x2f, 0xd0, 0x28, 0x3e, 0xa8, 0x6b, 0x0b, 0x2c, 0x7f, 0x40, 0x81, 0xff, 0x09, 0xd8
+       , 0x08, 0x85, 0x34, 0xf1, 0xe1, 0xe1, 0x0e, 0xce, 0x00, 0xa0, 0x0e, 0x2f, 0x64, 0x6e, 0x0b, 0xd8
+       , 0x66, 0xa0, 0x8d, 0xc7, 0x07, 0x11, 0x00, 0xb6, 0xaa, 0xe1, 0xeb, 0xc0, 0x20, 0xcb, 0x20, 0x61
+       , 0xab, 0x5e, 0x58, 0x41, 0x2d, 0x20, 0x70, 0x24, 0x70, 0x7c, 0xe4, 0x04, 0x86, 0x3e, 0x08, 0x73
+       , 0x70, 0xb2, 0x71, 0xb0, 0x83, 0x57, 0x22, 0xf1, 0x60, 0x35, 0x0d, 0x20, 0x80, 0x70, 0x46, 0x00
+       , 0xb0, 0xbc, 0x03, 0x06, 0x2c, 0x78, 0xd8, 0xe7, 0x0b, 0x64, 0x3d, 0x03, 0xb0, 0x08, 0x02, 0x86
+       , 0x36, 0x64, 0x76, 0xeb, 0x1b, 0xa8, 0x5d, 0x04, 0x99, 0x2d, 0xfd, 0x01, 0x5d, 0x53, 0x0b, 0x1e
+       , 0xc1, 0xa5, 0x99, 0xaf, 0x07, 0x17, 0x00, 0xfa, 0x95, 0x89, 0xf1, 0x17, 0xa4, 0xfc, 0x81, 0xac
+       , 0x74, 0x87, 0x2e, 0x04, 0x06, 0xaf, 0xbc, 0x06, 0xd6, 0xc4, 0xc0, 0xf4, 0x0a, 0x5a, 0xf2, 0x05
+       , 0x5e, 0xcc, 0xc2, 0x09, 0xc9, 0x09, 0x60, 0x80, 0x69, 0x14, 0x40, 0x00, 0xe1, 0x88, 0x80, 0xff
+       , 0xff, 0x81, 0x09, 0xfa, 0x3b, 0x64, 0xdc, 0x07, 0x12, 0x01, 0x9f, 0x3e, 0x7f, 0x87, 0x04, 0x39
+       , 0x2c, 0xd9, 0xc3, 0x66, 0x57, 0xc0, 0xbd, 0x2d, 0xf0, 0x38, 0x0f, 0x6d, 0x3d, 0x3d, 0xc8, 0x00
+       , 0xb0, 0x7b, 0xc9, 0xf4, 0xfb, 0x17, 0x13, 0x33, 0x3c, 0x07, 0x80, 0x92, 0x3e, 0x64, 0xed, 0x35
+       , 0x24, 0xac, 0x81, 0xe9, 0x15, 0xbc, 0xda, 0x11, 0x18, 0x07, 0x5c, 0xe0, 0x28, 0xc0, 0xbe, 0xde
+       , 0x14, 0x20, 0x80, 0xb0, 0x47, 0x00, 0x68, 0x46, 0xee, 0x27, 0xb8, 0xfc, 0xf9, 0x0a, 0x2e, 0x81
+       , 0xc0, 0x2b, 0x7b, 0xbe, 0xc3, 0xc1, 0x0f, 0xe8, 0x38, 0xc3, 0xcf, 0x1f, 0x3f, 0xa1, 0x73, 0xd7
+       , 0x7f, 0x7e, 0xff, 0x1f, 0xd6, 0x45, 0x3f, 0x26, 0x00, 0x56, 0x75, 0xbf, 0x7f, 0xfd, 0x61, 0x64
+       , 0xfa, 0xcd, 0xc2, 0xf4, 0x93, 0x05, 0x69, 0xc9, 0x11, 0x3c, 0x06, 0x80, 0x41, 0xc6, 0xcd, 0xfd
+       , 0x99, 0x1b, 0xb4, 0xdc, 0x91, 0x0b, 0xb2, 0xe0, 0x14, 0xb2, 0x08, 0x0c, 0xcd, 0x1c, 0x80, 0x00
+       , 0xc2, 0x16, 0x01, 0xff, 0x19, 0xc0, 0xc9, 0x1f, 0x54, 0xff, 0x42, 0xd3, 0xff, 0xe7, 0xcf, 0x3f
+       , 0x7e, 0x40, 0x92, 0x3d, 0x7c, 0x9d, 0x0c, 0x74, 0x66, 0x11, 0x32, 0x6f, 0xfa, 0xf7, 0xcf, 0xd0
+       , 0xee, 0xee, 0x92, 0x07, 0xfe, 0xfc, 0xfd, 0xc3, 0xf8, 0x9b, 0xf1, 0x17, 0x30, 0x13, 0xfc, 0x04
+       , 0xe7, 0x00, 0x36, 0xd6, 0x1f, 0x3f, 0x20, 0x11, 0xc0, 0xfa, 0x1d, 0xb4, 0xe4, 0x8e, 0x03, 0x18
+       , 0x6e, 0xa0, 0x05, 0x8e, 0x5c, 0x20, 0xf4, 0x9d, 0xf3, 0x3b, 0x3b, 0x27, 0xb0, 0x59, 0x8a, 0x9e
+       , 0x09, 0x00, 0x02, 0x08, 0x4b, 0xfb, 0x14, 0xb4, 0x86, 0xfc, 0xd7, 0x4f, 0x60, 0x58, 0x03, 0x5b
+       , 0xfa, 0xe0, 0xe9, 0x15, 0xd0, 0x70, 0x03, 0xb0, 0x87, 0x0b, 0x5e, 0x3b, 0x0e, 0x2f, 0x75, 0xa0
+       , 0xcb, 0xc7, 0x21, 0xbb, 0x58, 0xe8, 0xe4, 0xe3, 0xc1, 0x07, 0xfe, 0x80, 0xa7, 0x92, 0x21, 0x0b
+       , 0xcb, 0xa0, 0xbb, 0x1c, 0x40, 0x0b, 0x9f, 0x20, 0x8c, 0xef, 0xe0, 0x11, 0x32, 0x50, 0x5f, 0xe9
+       , 0x2b, 0x78, 0x70, 0x0c, 0x54, 0x60, 0x60, 0x84, 0x15, 0x40, 0x00, 0x61, 0x89, 0x00, 0xa0, 0x22
+       , 0x90, 0x21, 0x90, 0x76, 0x26, 0x78, 0xde, 0x11, 0xba, 0xa0, 0xff, 0x07, 0x64, 0x31, 0x09, 0x64
+       , 0x80, 0x19, 0xbc, 0x48, 0x06, 0x9c, 0xfc, 0xff, 0x8d, 0xe0, 0x8d, 0xae, 0xe0, 0xb9, 0xe5, 0xbf
+       , 0xe0, 0xd5, 0xad, 0xe0, 0xe9, 0x3e, 0x48, 0x48, 0xfd, 0xfc, 0x0e, 0x0d, 0xaf, 0x1f, 0x3f, 0xc1
+       , 0xe3, 0x94, 0xa0, 0x28, 0x00, 0xd6, 0xa7, 0x3f, 0xc0, 0xc3, 0xf2, 0x68, 0x26, 0x00, 0x04, 0x10
+       , 0x7a, 0x04, 0x00, 0x8d, 0x03, 0x2f, 0x9c, 0xfa, 0x0e, 0x5e, 0x51, 0x02, 0x9d, 0xdc, 0x02, 0xa7
+       , 0x79, 0xd8, 0xd0, 0x3e, 0xac, 0xd1, 0xf3, 0x0b, 0xb6, 0x64, 0x80, 0x5e, 0x9e, 0x1d, 0xa4, 0x00
+       , 0x1c, 0x08, 0xa0, 0x49, 0x6e, 0xe8, 0xac, 0xd3, 0x2f, 0x70, 0xd9, 0x0c, 0x49, 0xad, 0x3f, 0x7e
+       , 0x7c, 0x85, 0x4e, 0xd1, 0x82, 0xf2, 0x00, 0x30, 0x5e, 0x80, 0xb2, 0x7f, 0x51, 0x43, 0x0c, 0x20
+       , 0x80, 0xd0, 0x23, 0x00, 0x5c, 0xfe, 0xfc, 0x02, 0x16, 0xf5, 0xdf, 0xc0, 0x4b, 0xf9, 0xc1, 0xa1
+       , 0x0f, 0x2e, 0x6f, 0x7e, 0x80, 0xe7, 0xd3, 0x61, 0x4b, 0xc9, 0x41, 0x6b, 0x36, 0x40, 0xb6, 0x8e
+       , 0xc4, 0xa2, 0x1f, 0x13, 0x80, 0x16, 0x53, 0x82, 0x83, 0x04, 0x92, 0x0b, 0xc0, 0x39, 0xe1, 0x27
+       , 0xac, 0x67, 0xfa, 0x0b, 0x31, 0x48, 0x0c, 0xd9, 0xfd, 0x83, 0x5a, 0x0a, 0x01, 0x04, 0x10, 0x4a
+       , 0x04, 0x40, 0x66, 0x21, 0x7e, 0x41, 0x1a, 0xa0, 0x60, 0x00, 0x8c, 0x38, 0x70, 0xc4, 0x82, 0x0c
+       , 0x83, 0xec, 0xdd, 0x82, 0xad, 0xe4, 0xff, 0x0d, 0x5e, 0x42, 0x38, 0xd2, 0x93, 0x3f, 0x04, 0xfc
+       , 0x85, 0xae, 0x6b, 0xf9, 0x0d, 0x59, 0xe4, 0x0a, 0xdb, 0xf1, 0x00, 0x59, 0x7f, 0xfc, 0x13, 0xba
+       , 0xd4, 0x17, 0x1c, 0x01, 0x40, 0x2e, 0x50, 0x19, 0xf2, 0xe6, 0x2a, 0x80, 0x00, 0x42, 0x89, 0x00
+       , 0x70, 0x5f, 0xea, 0x17, 0xa4, 0xa5, 0x03, 0x89, 0x03, 0xd0, 0x5a, 0xc9, 0x9f, 0xd0, 0x65, 0x9c
+       , 0xbf, 0x21, 0x4b, 0x09, 0xe1, 0x8b, 0x4a, 0x46, 0x64, 0xcb, 0x07, 0x17, 0x80, 0x2c, 0x2e, 0xfb
+       , 0xfd, 0x0b, 0xba, 0xae, 0x0e, 0x52, 0x5c, 0x80, 0x96, 0x96, 0x82, 0x56, 0xe1, 0xff, 0x02, 0xd5
+       , 0x01, 0xdf, 0x20, 0x03, 0xc5, 0x3f, 0x20, 0x8b, 0x01, 0xe1, 0x1a, 0x01, 0x02, 0x88, 0x09, 0xd5
+       , 0x14, 0x90, 0x09, 0x60, 0x3d, 0xd0, 0xe1, 0x86, 0x9f, 0x30, 0xe3, 0xc0, 0x85, 0x3e, 0xb4, 0xc3
+       , 0x05, 0x5b, 0x3c, 0x3e, 0x9a, 0xfc, 0x11, 0x00, 0xb4, 0x92, 0xe2, 0x37, 0x74, 0x95, 0x25, 0xb8
+       , 0x59, 0xf4, 0x1b, 0xba, 0xe8, 0x1e, 0x5c, 0x2b, 0x40, 0x36, 0xc2, 0x41, 0xd6, 0x27, 0xfc, 0x44
+       , 0x2d, 0x85, 0x00, 0x02, 0x08, 0x11, 0x01, 0xff, 0xc0, 0xbb, 0x18, 0x7f, 0x42, 0xab, 0x60, 0xc8
+       , 0x00, 0xdb, 0x77, 0x48, 0x44, 0xfe, 0x86, 0x6d, 0xd9, 0x85, 0xac, 0x61, 0x1e, 0xad, 0x7b, 0xb1
+       , 0x02, 0xd0, 0xd2, 0x45, 0xe8, 0xee, 0x9e, 0x5f, 0xb0, 0xac, 0x00, 0x2e, 0x37, 0x80, 0x09, 0xfa
+       , 0x1b, 0xa4, 0x0f, 0x05, 0xde, 0x12, 0xf1, 0xeb, 0x27, 0x50, 0x01, 0xbc, 0xe9, 0x08, 0x10, 0x40
+       , 0x88, 0x08, 0x00, 0x45, 0xe1, 0x6f, 0x68, 0xde, 0x81, 0xf4, 0xb6, 0x60, 0xab, 0x37, 0x21, 0xc5
+       , 0xfe, 0xaf, 0x3f, 0xa0, 0xf5, 0x54, 0xbf, 0x20, 0x6b, 0xb3, 0x87, 0xf7, 0x90, 0x27, 0x79, 0xe0
+       , 0x1f, 0x78, 0x41, 0xfd, 0x1f, 0x70, 0x18, 0x41, 0x0a, 0xf3, 0x5f, 0xf0, 0xb8, 0x80, 0x14, 0xec
+       , 0x90, 0xf1, 0x1b, 0xd0, 0xba, 0xd8, 0x3f, 0xff, 0x60, 0x29, 0x18, 0x20, 0x80, 0x10, 0x11, 0x00
+       , 0x0e, 0xff, 0xdf, 0xd0, 0xba, 0xe3, 0x07, 0xa8, 0x27, 0x0c, 0x5d, 0xbe, 0x09, 0x69, 0xef, 0x40
+       , 0xb7, 0xaf, 0x40, 0x57, 0xec, 0x8d, 0x46, 0x00, 0x26, 0xf8, 0xf7, 0xff, 0x1f, 0x6c, 0x37, 0x39
+       , 0x28, 0xb4, 0xa0, 0x1b, 0x7f, 0x60, 0xcb, 0x7c, 0xbf, 0xc3, 0x67, 0xab, 0x7e, 0x42, 0xc2, 0x14
+       , 0x1a, 0x01, 0x00, 0x01, 0x84, 0x94, 0x03, 0x20, 0x91, 0x06, 0xae, 0x37, 0xc0, 0xbd, 0xad, 0xef
+       , 0xbf, 0x7f, 0x23, 0x0a, 0x1f, 0xe8, 0x6a, 0xc9, 0xdf, 0xd0, 0xc5, 0xfb, 0x03, 0xe4, 0xc7, 0xc1
+       , 0x0e, 0x40, 0x4b, 0xe9, 0x20, 0x5b, 0x0b, 0xa1, 0x1b, 0x1e, 0xa0, 0x6b, 0x7c, 0xc1, 0x87, 0x31
+       , 0x20, 0x76, 0xda, 0x40, 0xd6, 0x66, 0x42, 0xb4, 0x00, 0x04, 0x10, 0x34, 0x02, 0x40, 0xf3, 0x0c
+       , 0x7f, 0xc0, 0x6d, 0xd9, 0x9f, 0xbf, 0x7f, 0xfd, 0x84, 0xad, 0x22, 0x04, 0x17, 0xf8, 0xb0, 0x3d
+       , 0xa3, 0x90, 0xdd, 0x13, 0xbf, 0x21, 0x8b, 0x24, 0x07, 0xce, 0x8f, 0x83, 0x1a, 0xfc, 0x83, 0xc4
+       , 0xc0, 0x6f, 0x68, 0x7d, 0x0c, 0x5b, 0x69, 0x0d, 0xdd, 0x62, 0x00, 0x69, 0xe2, 0x83, 0x82, 0x18
+       , 0x1a, 0x98, 0xa0, 0x60, 0x04, 0x08, 0x20, 0x68, 0x04, 0x80, 0x34, 0x82, 0xc3, 0x1b, 0xd2, 0x9f
+       , 0x06, 0x45, 0x00, 0xec, 0x00, 0x13, 0xc4, 0x02, 0x6d, 0xd8, 0x8e, 0xd1, 0xd1, 0x43, 0xb6, 0x70
+       , 0x01, 0xc8, 0xfa, 0x2d, 0xf0, 0xda, 0xd2, 0xbf, 0xe0, 0x63, 0x77, 0xfe, 0xc2, 0xb7, 0x3c, 0x03
+       , 0xc3, 0x12, 0x36, 0x82, 0xf6, 0xeb, 0xf7, 0x2f, 0xe8, 0x36, 0x74, 0xa0, 0x16, 0x80, 0x00, 0x82
+       , 0x45, 0x00, 0xf8, 0x5c, 0x1e, 0x48, 0x91, 0x03, 0xe9, 0x52, 0xff, 0x85, 0xec, 0x15, 0xfd, 0x0d
+       , 0xdd, 0x2f, 0x8d, 0x7c, 0x54, 0xc9, 0x80, 0xfa, 0x71, 0xb0, 0x03, 0xf8, 0xb9, 0x16, 0xe0, 0x50
+       , 0x03, 0x57, 0xac, 0xd0, 0x9a, 0x01, 0x7c, 0x04, 0x0c, 0x64, 0x9f, 0x13, 0x58, 0xec, 0x1f, 0xb8
+       , 0x24, 0x07, 0x08, 0x20, 0x68, 0x04, 0xfc, 0x81, 0x86, 0xf5, 0x6f, 0xc8, 0xd6, 0x09, 0xd8, 0xce
+       , 0x21, 0xc8, 0xee, 0x09, 0xd8, 0x69, 0x49, 0x90, 0x55, 0xd9, 0xa3, 0x11, 0x80, 0x17, 0x40, 0x8e
+       , 0xf5, 0x82, 0xef, 0xf2, 0x04, 0xe7, 0x05, 0xe8, 0x16, 0x9b, 0x9f, 0xb0, 0x5d, 0x29, 0xd0, 0xc0
+       , 0x05, 0x2f, 0x59, 0x03, 0x08, 0x20, 0x50, 0x04, 0x80, 0x32, 0xce, 0x5f, 0x70, 0x0e, 0x00, 0x8d
+       , 0x69, 0x80, 0xca, 0x21, 0xc8, 0x86, 0x04, 0x78, 0xd8, 0xff, 0x81, 0x2e, 0x90, 0x07, 0x1f, 0x15
+       , 0x33, 0x1a, 0x01, 0x78, 0x01, 0x28, 0xfc, 0xff, 0x43, 0xf2, 0x00, 0x24, 0x0a, 0x60, 0x61, 0x09
+       , 0xa9, 0x9e, 0xc1, 0x6d, 0x23, 0x48, 0xd2, 0xfe, 0xf7, 0x07, 0xb4, 0xdf, 0x1f, 0x20, 0x80, 0x20
+       , 0x11, 0x00, 0x8d, 0x33, 0x68, 0x2f, 0x02, 0xdc, 0xd1, 0xfd, 0x0b, 0xdd, 0x99, 0xf0, 0xef, 0x2f
+       , 0x52, 0xea, 0x07, 0x2d, 0xd2, 0x1e, 0x68, 0x1f, 0x0e, 0x7e, 0x00, 0x89, 0x01, 0x10, 0xf8, 0xf3
+       , 0xef, 0x2f, 0x3c, 0x13, 0x80, 0xe3, 0x01, 0xd2, 0x45, 0x80, 0x6c, 0x85, 0x86, 0x24, 0x68, 0x80
+       , 0x00, 0x02, 0x45, 0xc0, 0x3f, 0x78, 0x7c, 0xfd, 0x81, 0x56, 0x19, 0xe0, 0x9d, 0x09, 0x7f, 0x61
+       , 0x25, 0xcf, 0xdf, 0x7f, 0x14, 0x6c, 0x1a, 0x1d, 0x81, 0xe0, 0x3f, 0xe4, 0x48, 0x8b, 0x7f, 0x88
+       , 0xad, 0x35, 0xd0, 0xd3, 0x8e, 0xfe, 0xfe, 0x45, 0x6a, 0xd0, 0x80, 0x02, 0x17, 0xa8, 0x10, 0x20
+       , 0x80, 0x40, 0x11, 0x00, 0x39, 0x83, 0x0d, 0xda, 0x82, 0x85, 0xed, 0x46, 0xfb, 0x0f, 0x2b, 0x73
+       , 0xfe, 0x41, 0x4b, 0xb5, 0xbf, 0xd0, 0x0d, 0x69, 0xa3, 0x80, 0x10, 0x80, 0x1c, 0x66, 0x81, 0x48
+       , 0xb3, 0x90, 0x28, 0x00, 0x85, 0xe8, 0xbf, 0x3f, 0xc8, 0xc1, 0x0f, 0x0e, 0x53, 0x80, 0x00, 0x02
+       , 0x17, 0x41, 0xd0, 0xd3, 0xa8, 0xfe, 0x82, 0x8f, 0xc5, 0x03, 0xe5, 0x15, 0xa8, 0x2e, 0xf0, 0xee
+       , 0x5a, 0xf8, 0x09, 0x31, 0xff, 0x50, 0x0f, 0xa9, 0x1a, 0x05, 0xb8, 0x00, 0x74, 0x2f, 0xc1, 0xdf
+       , 0xff, 0xd0, 0xa4, 0x0b, 0x0d, 0xdd, 0x3f, 0xc0, 0x92, 0xfe, 0xcf, 0x1f, 0x78, 0xc9, 0xfe, 0x0f
+       , 0x52, 0xa1, 0x02, 0x04, 0x10, 0xb8, 0x08, 0x02, 0xe7, 0x19, 0x58, 0x69, 0x03, 0x3e, 0x25, 0xe0
+       , 0x3f, 0x54, 0x33, 0xf4, 0x74, 0x3c, 0xc8, 0x1a, 0x79, 0xd8, 0x71, 0xa9, 0xa3, 0x00, 0x3f, 0x80
+       , 0x6d, 0x61, 0x42, 0x3a, 0xe0, 0x0b, 0xb6, 0xb7, 0xef, 0x2f, 0xfc, 0x04, 0x4e, 0x48, 0xe0, 0xfe
+       , 0xfb, 0x0f, 0x10, 0x40, 0xe0, 0x66, 0x28, 0xf4, 0x10, 0x0c, 0x68, 0x2c, 0x80, 0x25, 0x80, 0xbd
+       , 0x34, 0x48, 0xe0, 0x43, 0xf6, 0x25, 0x80, 0x63, 0x93, 0x61, 0x34, 0xfc, 0x89, 0x02, 0x28, 0xdb
+       , 0x69, 0xe0, 0x87, 0x4b, 0xfd, 0x87, 0x6e, 0x77, 0xfa, 0x0f, 0xa9, 0x13, 0xa0, 0x27, 0xaf, 0xfd
+       , 0x03, 0x08, 0x20, 0x48, 0x25, 0x0c, 0x29, 0xb3, 0xfe, 0x83, 0xcb, 0x79, 0xd8, 0xc9, 0xb4, 0xff
+       , 0xa0, 0x14, 0xf8, 0xa0, 0x60, 0xc8, 0xe9, 0x84, 0xff, 0xe9, 0xbc, 0x9d, 0x7a, 0xe8, 0x02, 0xe8
+       , 0x26, 0x4a, 0xe8, 0x29, 0x3b, 0x88, 0x6d, 0x4e, 0xb0, 0x62, 0x05, 0x7a, 0xd4, 0x04, 0x50, 0x08
+       , 0x20, 0x80, 0xa0, 0xfd, 0x80, 0xff, 0xb0, 0xc3, 0x60, 0xa0, 0xb1, 0xc4, 0x00, 0xdf, 0x0b, 0xf5
+       , 0x1f, 0x1a, 0xf6, 0xa3, 0xe5, 0x3f, 0x49, 0x00, 0x11, 0x60, 0xff, 0xa0, 0x47, 0x5d, 0xc3, 0xc2
+       , 0xf3, 0x1f, 0xd2, 0xb9, 0x2f, 0x40, 0x00, 0x10, 0x40, 0x4c, 0x30, 0xd5, 0xf0, 0xd0, 0x06, 0x1f
+       , 0x83, 0xf4, 0x0f, 0x23, 0xec, 0xff, 0x8f, 0xb6, 0x80, 0x48, 0x05, 0xe0, 0x8d, 0x65, 0xff, 0x91
+       , 0xea, 0x04, 0xa8, 0x30, 0x4a, 0x80, 0x02, 0x04, 0x10, 0x38, 0x07, 0x80, 0x16, 0x6b, 0x41, 0xf3
+       , 0x0c, 0xa8, 0xb4, 0x81, 0x6d, 0xc2, 0x84, 0x9d, 0x0b, 0x06, 0x3b, 0x9a, 0x90, 0x71, 0x34, 0x06
+       , 0x88, 0x05, 0xe0, 0x30, 0x86, 0x84, 0x17, 0x34, 0x23, 0x80, 0xcb, 0x6f, 0x44, 0xca, 0x87, 0xd4
+       , 0xa7, 0xc0, 0xe0, 0x05, 0x08, 0x20, 0xc8, 0x58, 0x10, 0x2c, 0xfd, 0x83, 0x16, 0x5d, 0xff, 0x87
+       , 0x10, 0xd8, 0xcc, 0xa4, 0xa3, 0x0f, 0x86, 0x3c, 0x80, 0xa6, 0x69, 0x44, 0x48, 0x32, 0xfe, 0x87
+       , 0x09, 0x83, 0x12, 0xfc, 0x7f, 0x46, 0x70, 0x9a, 0xfe, 0xcf, 0x00, 0x10, 0x40, 0x4c, 0x08, 0xf5
+       , 0xe0, 0xf3, 0x1f, 0xc1, 0x2a, 0xc1, 0xd9, 0x86, 0x11, 0xd9, 0x2c, 0xc8, 0xde, 0xa8, 0x51, 0x40
+       , 0x2c, 0x00, 0x27, 0x61, 0xd4, 0x00, 0x03, 0x05, 0x28, 0x38, 0xe0, 0x61, 0x61, 0x09, 0x8e, 0x02
+       , 0x06, 0x80, 0x00, 0x02, 0x47, 0x00, 0x23, 0xe4, 0x58, 0x29, 0x88, 0x04, 0x13, 0x64, 0xf7, 0x31
+       , 0x23, 0x2c, 0x52, 0x60, 0xb1, 0x82, 0x6e, 0xe0, 0x28, 0xc0, 0x0b, 0x18, 0x61, 0x49, 0x1e, 0xbc
+       , 0x9f, 0x95, 0x11, 0x7a, 0xb4, 0x20, 0x78, 0x6b, 0x2b, 0x13, 0x94, 0x05, 0x62, 0x30, 0x02, 0x04
+       , 0x10, 0x94, 0x83, 0x38, 0x77, 0x13, 0x92, 0xdc, 0x99, 0xa0, 0xa7, 0xc1, 0x33, 0x42, 0x99, 0x20
+       , 0xf6, 0x68, 0x0c, 0x90, 0x04, 0xc0, 0xc1, 0xc7, 0x08, 0x0b, 0x5c, 0xc8, 0x69, 0x06, 0xb0, 0xcd
+       , 0xf5, 0xa0, 0x42, 0x1e, 0x7a, 0xed, 0x01, 0x40, 0x00, 0x81, 0x22, 0x80, 0x09, 0x16, 0xf6, 0xf0
+       , 0xa3, 0x0e, 0x18, 0x61, 0xb1, 0xc2, 0xc8, 0x04, 0xdb, 0x8d, 0xc3, 0xc0, 0x38, 0x80, 0x87, 0xec
+       , 0x0f, 0x3d, 0x80, 0x48, 0xf7, 0xa0, 0x42, 0x85, 0x89, 0x89, 0x81, 0x11, 0x76, 0xbe, 0x38, 0x64
+       , 0x6b, 0x31, 0xfc, 0x84, 0x59, 0x80, 0x00, 0x02, 0xe7, 0x00, 0xf8, 0x59, 0xa7, 0xcc, 0x90, 0xa3
+       , 0x97, 0x19, 0xa1, 0x18, 0xa2, 0x11, 0xa6, 0x14, 0x62, 0xee, 0xc0, 0xfa, 0x6b, 0xa8, 0x00, 0x26
+       , 0xc4, 0x95, 0x2a, 0x48, 0xa7, 0xa9, 0x00, 0xc3, 0x17, 0x92, 0xc0, 0x99, 0x19, 0x21, 0x27, 0x5c
+       , 0x03, 0x05, 0x01, 0x02, 0x08, 0x52, 0x07, 0x20, 0x0e, 0x5b, 0x66, 0x86, 0xc9, 0x43, 0xe3, 0x08
+       , 0xb2, 0x17, 0x16, 0x16, 0x2b, 0x03, 0x7f, 0xe3, 0xc7, 0x50, 0x00, 0x8c, 0x8c, 0xb0, 0xd4, 0xcd
+       , 0x08, 0xbe, 0xc9, 0x06, 0x12, 0x78, 0x90, 0x53, 0xc5, 0xc1, 0x5b, 0x5a, 0x99, 0xa0, 0xc7, 0xbb
+       , 0x83, 0xc2, 0x15, 0x20, 0x80, 0xc0, 0x45, 0x10, 0x23, 0xe4, 0x94, 0x5f, 0xd8, 0x79, 0xef, 0xcc
+       , 0x4c, 0x30, 0x15, 0x70, 0x65, 0xd0, 0x18, 0x61, 0x18, 0x8d, 0x02, 0x22, 0x00, 0xa4, 0xe6, 0x44
+       , 0x94, 0x34, 0x4c, 0x88, 0x62, 0x87, 0x99, 0x89, 0x05, 0xbc, 0x6d, 0x1b, 0x72, 0xb4, 0x0a, 0x28
+       , 0x43, 0x00, 0x04, 0x10, 0x38, 0x02, 0x60, 0xb7, 0x4e, 0x80, 0xa5, 0xc1, 0x47, 0xbd, 0x33, 0x31
+       , 0xc2, 0x22, 0x01, 0x1a, 0x13, 0xb0, 0x93, 0x41, 0x46, 0x8b, 0x20, 0xc2, 0x00, 0x72, 0x70, 0x2f
+       , 0x13, 0xec, 0x3a, 0x0f, 0xf8, 0x66, 0x62, 0xd0, 0xe1, 0xbd, 0xa0, 0xb3, 0x54, 0x58, 0x20, 0x29
+       , 0x1d, 0x92, 0xa6, 0x01, 0x02, 0x08, 0x9a, 0x03, 0x20, 0x19, 0x03, 0xb1, 0xdf, 0x12, 0x1c, 0x4d
+       , 0x90, 0x33, 0x10, 0xe0, 0x65, 0x13, 0x33, 0xe4, 0x7e, 0xae, 0x51, 0x40, 0x08, 0xc0, 0xca, 0x0d
+       , 0xa4, 0x32, 0x9d, 0x09, 0x1a, 0x9c, 0xe0, 0x04, 0x0e, 0x39, 0xca, 0x1d, 0x12, 0xb6, 0x8c, 0x00
+       , 0x01, 0x04, 0x8e, 0x00, 0x70, 0xf4, 0x40, 0x64, 0x20, 0x47, 0xad, 0x30, 0xc1, 0xee, 0xdc, 0x62
+       , 0x86, 0xdd, 0x89, 0x03, 0x2b, 0xb1, 0x46, 0x8b, 0x20, 0xc2, 0x00, 0x71, 0x80, 0x0a, 0xa8, 0xfc
+       , 0x07, 0x97, 0x28, 0x48, 0xc7, 0x19, 0x40, 0x6e, 0x91, 0x80, 0x5e, 0xad, 0xc2, 0xc8, 0x04, 0x10
+       , 0x40, 0x90, 0x56, 0x10, 0x23, 0xe2, 0x74, 0x71, 0xf0, 0x79, 0xca, 0xf0, 0xfb, 0xb7, 0xa0, 0xea
+       , 0x20, 0x87, 0xc0, 0x43, 0x1a, 0xa8, 0xa3, 0x79, 0x80, 0x10, 0x60, 0x42, 0xbe, 0x43, 0x05, 0x92
+       , 0x8c, 0x61, 0xfb, 0xb9, 0xe1, 0xd7, 0x35, 0x41, 0xaa, 0x5a, 0x60, 0xb8, 0x03, 0x04, 0x10, 0x38
+       , 0x02, 0x40, 0x0d, 0x51, 0x58, 0xe8, 0x83, 0xf7, 0xba, 0xc2, 0xee, 0xbe, 0x81, 0xc4, 0x03, 0x14
+       , 0x30, 0xc2, 0xca, 0xad, 0x81, 0xf6, 0xe0, 0xa0, 0x06, 0x4c, 0xe0, 0xd3, 0x9b, 0x18, 0x11, 0xc1
+       , 0x06, 0x0a, 0x43, 0x56, 0x48, 0xb9, 0xc3, 0xcc, 0x0c, 0x3a, 0x24, 0x19, 0x7a, 0x79, 0x19, 0x48
+       , 0x02, 0x98, 0x98, 0x01, 0x02, 0x08, 0x1a, 0x9a, 0x90, 0xf4, 0xcf, 0x06, 0x3e, 0x54, 0x02, 0x84
+       , 0xd8, 0x59, 0x99, 0x21, 0x07, 0x0f, 0xc1, 0xaf, 0xe3, 0x82, 0x34, 0x8f, 0x98, 0x07, 0xdd, 0x55
+       , 0x80, 0x83, 0x0d, 0x30, 0x22, 0x1f, 0xe0, 0x01, 0x4d, 0xf7, 0x90, 0xd0, 0x65, 0x06, 0x5f, 0x92
+       , 0xc5, 0x0e, 0xbd, 0xc6, 0x83, 0x99, 0x15, 0xa8, 0x0a, 0xa8, 0x1e, 0x20, 0x80, 0xa0, 0xa1, 0x09
+       , 0xcc, 0x28, 0xe0, 0x20, 0x07, 0xef, 0x32, 0x06, 0xdf, 0x68, 0x00, 0x3d, 0x6c, 0x1f, 0x7a, 0x0b
+       , 0x20, 0xbc, 0xd4, 0x62, 0xa2, 0xd1, 0x55, 0x2a, 0xc3, 0x06, 0xb0, 0x80, 0x23, 0x80, 0x05, 0x1e
+       , 0xfc, 0xa0, 0x23, 0xcc, 0x58, 0x21, 0xe5, 0x3e, 0xf8, 0xc0, 0x08, 0x50, 0xe2, 0x86, 0x1c, 0xe8
+       , 0xc1, 0x02, 0x3e, 0x5e, 0x14, 0x20, 0x80, 0x10, 0x39, 0x00, 0x52, 0xff, 0x02, 0x63, 0x08, 0x08
+       , 0x81, 0x80, 0x05, 0xae, 0x0f, 0x9a, 0x5f, 0x58, 0xc1, 0x87, 0xa0, 0x81, 0xf0, 0x68, 0x63, 0x14
+       , 0x17, 0x60, 0x84, 0x1e, 0xdf, 0x07, 0xbb, 0xa7, 0x00, 0x76, 0x4c, 0x3e, 0xf8, 0xec, 0x2c, 0x56
+       , 0xc8, 0x11, 0x42, 0xa0, 0x04, 0xce, 0x06, 0xa9, 0x87, 0x41, 0x11, 0x00, 0x10, 0x40, 0xd0, 0x08
+       , 0x00, 0xf5, 0x10, 0xa0, 0x47, 0x1d, 0x40, 0xef, 0x54, 0x81, 0x9c, 0x7c, 0x06, 0x12, 0x04, 0xdf
+       , 0x7d, 0xc3, 0x0a, 0xa9, 0x42, 0xa0, 0xb9, 0x60, 0x34, 0x13, 0x60, 0x07, 0x90, 0xa3, 0xf1, 0x21
+       , 0xa7, 0xb2, 0x43, 0xc3, 0x1d, 0x56, 0xe4, 0x83, 0x0e, 0x6e, 0x02, 0x5f, 0x11, 0xc7, 0x0a, 0x3a
+       , 0x45, 0x0b, 0x58, 0x15, 0x40, 0x8f, 0xd1, 0x02, 0x08, 0x20, 0x44, 0x50, 0x82, 0x4f, 0x5b, 0x01
+       , 0x1f, 0x77, 0x06, 0xba, 0x60, 0x0e, 0x74, 0xe4, 0x13, 0xec, 0xa6, 0x15, 0x48, 0x5e, 0x60, 0x05
+       , 0x1f, 0x42, 0x07, 0xad, 0x0d, 0x06, 0xce, 0x8f, 0x83, 0x1a, 0xc0, 0xcf, 0x0e, 0x42, 0xbd, 0x32
+       , 0x0b, 0x7c, 0x95, 0x22, 0x27, 0xe4, 0xc4, 0x14, 0x76, 0xc8, 0xad, 0x8a, 0xf0, 0x23, 0xa6, 0x01
+       , 0x02, 0x08, 0x39, 0x02, 0xa0, 0xf7, 0xfd, 0x41, 0x2e, 0x56, 0xe4, 0x00, 0xdd, 0xda, 0x04, 0xbd
+       , 0x71, 0x0b, 0x7a, 0xe7, 0x28, 0x88, 0x64, 0x86, 0x5c, 0xcc, 0xcb, 0x34, 0xa8, 0x2f, 0x49, 0x1e
+       , 0x18, 0x00, 0x2d, 0x7e, 0x60, 0x07, 0x07, 0x41, 0x5a, 0x33, 0xf0, 0x1b, 0xb3, 0xc0, 0xc7, 0x37
+       , 0x71, 0xb0, 0x71, 0x80, 0x0f, 0x94, 0x43, 0xba, 0x38, 0x14, 0x20, 0x80, 0x10, 0x11, 0x00, 0xaa
+       , 0x73, 0xc1, 0xa7, 0xfd, 0x01, 0x63, 0x00, 0x7c, 0xcc, 0x10, 0x27, 0xec, 0xf8, 0x1b, 0x70, 0xbe
+       , 0x80, 0x34, 0x60, 0x61, 0xf5, 0x02, 0x33, 0x89, 0x67, 0x84, 0x8f, 0x04, 0x00, 0x6f, 0xf7, 0xb0
+       , 0xb2, 0x42, 0x1b, 0x9b, 0xb0, 0x23, 0x14, 0x41, 0x81, 0x08, 0xbe, 0x01, 0x0b, 0x7c, 0x76, 0x13
+       , 0x1b, 0x1b, 0xa4, 0x42, 0x85, 0xe8, 0x02, 0x08, 0x20, 0x44, 0x04, 0x00, 0xcb, 0x2f, 0xc8, 0x05
+       , 0x73, 0xe0, 0x5b, 0x46, 0x39, 0x39, 0x20, 0x47, 0xdc, 0x80, 0x0e, 0x3c, 0x83, 0xd6, 0x1b, 0xb0
+       , 0x38, 0x00, 0xd9, 0x01, 0x1e, 0xa8, 0x1e, 0x20, 0x8f, 0x0e, 0x52, 0xc0, 0xc8, 0x82, 0x28, 0x76
+       , 0x58, 0xc0, 0x37, 0xc4, 0x41, 0xd3, 0x2f, 0x90, 0xe6, 0xe0, 0x84, 0x5d, 0x19, 0xca, 0x06, 0x2e
+       , 0x87, 0xd8, 0x58, 0xe1, 0x23, 0xcb, 0x00, 0x01, 0x84, 0x52, 0x9d, 0xb2, 0x82, 0x0e, 0xb9, 0x84
+       , 0x96, 0x3f, 0xa0, 0x83, 0x9e, 0xb8, 0x38, 0x21, 0x47, 0xce, 0x41, 0x2e, 0xdd, 0x85, 0x46, 0x27
+       , 0xf8, 0x1e, 0x34, 0xf0, 0x11, 0xb1, 0xa3, 0x99, 0x00, 0x01, 0x90, 0x92, 0x3f, 0xa4, 0xe8, 0x81
+       , 0x26, 0x7c, 0x76, 0xf0, 0xf1, 0x4d, 0x90, 0x23, 0x9b, 0xc0, 0x47, 0xc8, 0x81, 0x02, 0x12, 0xf9
+       , 0xce, 0x19, 0x80, 0x00, 0x42, 0x89, 0x00, 0x70, 0x19, 0xc4, 0x0a, 0x8e, 0x2e, 0x48, 0x04, 0x70
+       , 0x71, 0x80, 0x63, 0x80, 0x1d, 0x12, 0x9d, 0xa0, 0xe3, 0x86, 0xd8, 0xa1, 0xb7, 0x1f, 0xc3, 0x5a
+       , 0x51, 0xa3, 0x00, 0x02, 0xc0, 0xa1, 0x0f, 0xbf, 0x9e, 0x0f, 0x72, 0x37, 0x1f, 0xa8, 0x42, 0x05
+       , 0xa6, 0x78, 0x60, 0xb0, 0x83, 0x2f, 0x07, 0x85, 0x64, 0x01, 0x0e, 0x48, 0x2a, 0x86, 0x6b, 0x04
+       , 0x08, 0x20, 0x94, 0x08, 0x60, 0x62, 0x64, 0x04, 0xdf, 0xa9, 0x05, 0xaa, 0x31, 0x40, 0xc1, 0x0f
+       , 0xbe, 0x5c, 0x14, 0xda, 0x7a, 0x05, 0x9a, 0xc3, 0x06, 0x0f, 0x7e, 0x36, 0x78, 0x5d, 0x40, 0x77
+       , 0x9f, 0x0e, 0x46, 0x00, 0x6d, 0xf9, 0x80, 0xd3, 0x3c, 0xa4, 0xe0, 0xe1, 0x80, 0x84, 0x22, 0x38
+       , 0x22, 0xc0, 0x37, 0xb4, 0x72, 0x81, 0xef, 0xcd, 0xe5, 0x04, 0x0a, 0x02, 0xa3, 0x08, 0xb9, 0x23
+       , 0x05, 0x10, 0x40, 0xe8, 0x2d, 0x7a, 0x16, 0xf0, 0x59, 0x5b, 0xa0, 0x4b, 0x44, 0xa1, 0x37, 0xbc
+       , 0x72, 0x83, 0x8b, 0x24, 0x76, 0xf0, 0xf5, 0xba, 0x1c, 0x88, 0x92, 0x0d, 0x54, 0x10, 0xb1, 0x01
+       , 0xab, 0x6d, 0xfa, 0xfa, 0x74, 0x90, 0x02, 0x48, 0x03, 0x91, 0x15, 0x7a, 0x5a, 0x1f, 0xa4, 0x2f
+       , 0x05, 0xbe, 0xae, 0x1b, 0xd4, 0xf2, 0xe4, 0x00, 0x5f, 0x90, 0xcb, 0x0d, 0x39, 0x39, 0x8e, 0x1d
+       , 0x7c, 0x96, 0x2e, 0xb2, 0x5e, 0x80, 0x00, 0xc2, 0x88, 0x00, 0x66, 0x66, 0x50, 0xa5, 0x01, 0xae
+       , 0xb1, 0x81, 0xe1, 0xcf, 0x0b, 0xba, 0xda, 0x95, 0x1b, 0x1c, 0x05, 0x10, 0x13, 0xc1, 0x14, 0xe4
+       , 0xfa, 0x3f, 0x36, 0x68, 0x73, 0x97, 0x8e, 0x3e, 0x1d, 0x8c, 0x00, 0x16, 0xfa, 0xac, 0x90, 0x12
+       , 0x9a, 0x1d, 0x1c, 0xec, 0x90, 0x9b, 0xd2, 0x81, 0x80, 0x07, 0x72, 0x4f, 0x2e, 0x17, 0x27, 0xb8
+       , 0x6f, 0xc5, 0x01, 0x1a, 0x0a, 0x42, 0x0d, 0x31, 0x80, 0x00, 0xc2, 0xd2, 0xa7, 0x05, 0x9f, 0x79
+       , 0x0c, 0x29, 0x83, 0xb8, 0x21, 0x97, 0xec, 0x42, 0x62, 0x92, 0x13, 0x1a, 0x09, 0xe0, 0xac, 0xc0
+       , 0x0e, 0x1e, 0xd4, 0x60, 0x03, 0xd9, 0x3c, 0x92, 0x27, 0x09, 0x80, 0x8d, 0x19, 0xf0, 0x81, 0xf5
+       , 0x6c, 0x90, 0x31, 0x06, 0x68, 0xb8, 0x73, 0xb0, 0x43, 0x2e, 0xed, 0x06, 0x06, 0x1b, 0x0f, 0x30
+       , 0xfd, 0x72, 0x83, 0x02, 0x92, 0x0b, 0x74, 0xfd, 0x24, 0xf8, 0xe4, 0x4a, 0x54, 0x00, 0x10, 0x40
+       , 0x58, 0xd2, 0x2f, 0x2b, 0xf8, 0xf6, 0x75, 0xf0, 0x55, 0xd3, 0x5c, 0xc0, 0xf0, 0xe7, 0xe5, 0xe1
+       , 0xf9, 0x02, 0xba, 0x80, 0xf6, 0xc7, 0x8f, 0x9f, 0x1c, 0xe0, 0x6b, 0x16, 0x39, 0xa0, 0x27, 0x66
+       , 0x21, 0x5d, 0x69, 0xf6, 0xfb, 0x17, 0xfa, 0x51, 0x68, 0x23, 0x04, 0x40, 0x5b, 0x9c, 0xa0, 0x24
+       , 0xcb, 0x06, 0x09, 0x7e, 0xd0, 0x81, 0xb9, 0xec, 0x90, 0xea, 0x96, 0x83, 0x1b, 0x7c, 0x43, 0x31
+       , 0x0f, 0x38, 0x17, 0x70, 0x82, 0xd3, 0x2f, 0x2b, 0xc6, 0xb1, 0x95, 0x00, 0x01, 0x84, 0x25, 0x02
+       , 0x80, 0x15, 0x04, 0xc8, 0x34, 0x60, 0x16, 0x00, 0x6a, 0xfc, 0xc6, 0xcd, 0xc3, 0xcb, 0xcb, 0x0b
+       , 0x3e, 0xa4, 0x9e, 0xf3, 0x27, 0x07, 0xe4, 0x00, 0x16, 0xd8, 0x11, 0x14, 0x88, 0x5b, 0x67, 0xff
+       , 0x8d, 0xc8, 0x03, 0x24, 0xc0, 0x57, 0x82, 0x42, 0x86, 0x0f, 0xd8, 0x40, 0x57, 0x9f, 0xb3, 0x43
+       , 0x12, 0x3e, 0x27, 0xa4, 0x19, 0x09, 0x4c, 0xc1, 0xbc, 0x20, 0xc0, 0x03, 0x29, 0x82, 0x80, 0xc1
+       , 0x09, 0x94, 0xc7, 0xec, 0x3b, 0x01, 0x04, 0x10, 0xf6, 0x12, 0x1c, 0x58, 0xb6, 0x00, 0x8d, 0xe3
+       , 0x04, 0x97, 0x41, 0xc0, 0x38, 0x84, 0x44, 0xc1, 0x2f, 0xf8, 0xf5, 0x8f, 0xe0, 0x03, 0x3f, 0x90
+       , 0x4f, 0x6e, 0x02, 0xed, 0x2a, 0xf8, 0xf9, 0xe3, 0xff, 0x48, 0xda, 0xc3, 0x0a, 0xea, 0xb7, 0x82
+       , 0xc6, 0x8e, 0xc1, 0x77, 0x72, 0x43, 0x2a, 0x5c, 0xc8, 0xf8, 0x01, 0xa4, 0xc5, 0xcf, 0xc9, 0xc9
+       , 0x03, 0x0e, 0x37, 0x20, 0x01, 0xb9, 0xa5, 0x1e, 0x9c, 0xfc, 0xb1, 0xb4, 0x59, 0x00, 0x02, 0x08
+       , 0x7b, 0x04, 0x00, 0xdb, 0x49, 0xa0, 0x52, 0x08, 0x94, 0x89, 0xb8, 0x78, 0xbf, 0xf3, 0xc0, 0xaf
+       , 0x26, 0x87, 0x9e, 0x1c, 0xf4, 0x0b, 0x7a, 0x4e, 0xe0, 0x1f, 0xd8, 0xf6, 0x57, 0xc8, 0xee, 0xa6
+       , 0x5f, 0x23, 0xa9, 0x20, 0x82, 0xdc, 0x02, 0x0a, 0x0a, 0x7b, 0x36, 0x58, 0x81, 0xcf, 0x01, 0xef
+       , 0xf0, 0x82, 0x1a, 0xfd, 0x7c, 0xbc, 0x7c, 0xc0, 0x08, 0x00, 0xb5, 0x61, 0x40, 0x11, 0xc0, 0x09
+       , 0x4e, 0xfe, 0x58, 0x06, 0x0f, 0x00, 0x02, 0x08, 0x67, 0x1b, 0x06, 0xd8, 0xca, 0x01, 0x6a, 0xfb
+       , 0xf9, 0x13, 0x74, 0xb5, 0xfd, 0x77, 0xde, 0xef, 0xbc, 0x90, 0xa3, 0x47, 0x51, 0x8e, 0x4c, 0x84
+       , 0x1e, 0x64, 0xf0, 0xef, 0x0f, 0xec, 0x86, 0x3f, 0xf0, 0x99, 0x5b, 0xb4, 0xf4, 0xf5, 0x60, 0x01
+       , 0xe0, 0x92, 0x87, 0x0d, 0x92, 0xf8, 0xd9, 0xc1, 0x41, 0xce, 0x05, 0xed, 0x37, 0x81, 0x8a, 0x1a
+       , 0x20, 0xe6, 0xe3, 0xe7, 0xe7, 0xe3, 0xe7, 0xe3, 0x01, 0xe5, 0x00, 0x48, 0x03, 0x14, 0xe7, 0x7d
+       , 0xf4, 0x00, 0x01, 0x84, 0xaf, 0x11, 0x09, 0x89, 0x03, 0x60, 0x09, 0xf6, 0xf3, 0x07, 0xf4, 0x8a
+       , 0x86, 0xef, 0xdf, 0xbf, 0xff, 0xf9, 0x0d, 0x3b, 0x6d, 0x02, 0x71, 0x13, 0x27, 0x78, 0x17, 0x26
+       , 0x64, 0x67, 0xda, 0xff, 0xff, 0x7f, 0x87, 0xfb, 0x69, 0x66, 0xa0, 0xb9, 0x5b, 0x70, 0xab, 0x07
+       , 0xd2, 0x36, 0x04, 0x0f, 0xb2, 0x41, 0x82, 0x9d, 0x13, 0x3c, 0x7c, 0xc3, 0xc5, 0xcb, 0xc7, 0xc3
+       , 0xcf, 0x07, 0x4c, 0xfe, 0x40, 0x0c, 0x0c, 0x7f, 0x1e, 0xa0, 0x14, 0xb0, 0x61, 0x8f, 0xcb, 0x34
+       , 0x80, 0x00, 0xc2, 0x17, 0x01, 0xc0, 0xb6, 0x2d, 0x30, 0x53, 0x71, 0xff, 0xe2, 0xfa, 0xc5, 0xc3
+       , 0x0b, 0x3d, 0xb9, 0x15, 0x7c, 0x62, 0x34, 0xfc, 0x18, 0x1b, 0xc4, 0x09, 0x12, 0xd0, 0x6d, 0x7f
+       , 0x20, 0xe2, 0x17, 0x78, 0x0b, 0x1a, 0x0d, 0x3c, 0x3e, 0x28, 0x00, 0x33, 0x13, 0x33, 0x78, 0x6c
+       , 0x12, 0x56, 0xe1, 0x72, 0x42, 0xd2, 0x3e, 0x24, 0xec, 0x41, 0x7d, 0x57, 0x2e, 0x6e, 0x4e, 0x7e
+       , 0x7e, 0x01, 0x7e, 0x7e, 0x50, 0x14, 0x70, 0x73, 0xf3, 0x82, 0xe4, 0x80, 0xcd, 0x7f, 0x1c, 0xb7
+       , 0x37, 0x00, 0x01, 0x40, 0x00, 0x11, 0xe8, 0x46, 0x81, 0xa3, 0xf8, 0xf7, 0x2f, 0x1e, 0xd8, 0x29
+       , 0x42, 0xe0, 0xf3, 0x48, 0xff, 0xc2, 0xaf, 0x34, 0x06, 0x6f, 0x7b, 0x05, 0x1f, 0x6b, 0x00, 0xdf
+       , 0x4c, 0x0c, 0xde, 0x69, 0xf3, 0xeb, 0xff, 0xb0, 0x3c, 0xd5, 0x86, 0x89, 0x99, 0x09, 0x52, 0xf2
+       , 0x70, 0x40, 0x2b, 0x5d, 0x48, 0xd8, 0x73, 0x40, 0xfa, 0x4c, 0xe0, 0x12, 0x88, 0x8b, 0x5f, 0x40
+       , 0x10, 0x14, 0xf8, 0xa0, 0x1c, 0x00, 0x6a, 0x01, 0x81, 0xab, 0x5f, 0x7c, 0x37, 0xba, 0x01, 0x04
+       , 0x10, 0x81, 0x08, 0x60, 0x66, 0x62, 0x02, 0x9a, 0x0f, 0x3e, 0xa2, 0xfa, 0x17, 0xe4, 0x34, 0x27
+       , 0xc8, 0x6d, 0xc0, 0xd0, 0xba, 0x17, 0x76, 0x8c, 0xc4, 0xdf, 0xff, 0xb0, 0x7d, 0xb1, 0xb0, 0x8b
+       , 0x81, 0xff, 0x0f, 0xbb, 0x7b, 0x7c, 0x80, 0xcd, 0x1e, 0xc8, 0x48, 0x0f, 0xb8, 0xb1, 0x8f, 0x28
+       , 0x75, 0xb8, 0x78, 0x20, 0xdd, 0x55, 0x4e, 0x60, 0x83, 0x85, 0x8f, 0x0f, 0x98, 0xf8, 0x05, 0x04
+       , 0xf8, 0x80, 0x39, 0x80, 0x0f, 0xd8, 0xfe, 0x01, 0x5f, 0x1e, 0xc0, 0x8e, 0x7f, 0x06, 0x17, 0x20
+       , 0x80, 0x08, 0x0f, 0x24, 0x80, 0x1a, 0xb9, 0x7f, 0x39, 0x79, 0xc0, 0xa7, 0x6e, 0x41, 0x4f, 0xec
+       , 0x06, 0x9f, 0x29, 0x04, 0x4c, 0xfc, 0xff, 0x61, 0x97, 0xbc, 0xfe, 0x05, 0xef, 0xe4, 0xfe, 0x0f
+       , 0xdd, 0x48, 0x0c, 0x46, 0x8c, 0x8c, 0xbf, 0x7f, 0xfd, 0x84, 0x9c, 0xca, 0x35, 0x0c, 0x00, 0x74
+       , 0xb6, 0x8a, 0x9d, 0x0d, 0xda, 0xc4, 0xe1, 0x84, 0x24, 0x77, 0x70, 0x33, 0x9d, 0x93, 0x1b, 0x02
+       , 0x80, 0x21, 0x2e, 0x28, 0x28, 0x20, 0x08, 0x2e, 0x7e, 0x78, 0x80, 0xf5, 0x00, 0xb8, 0xfa, 0x05
+       , 0x66, 0x17, 0xfc, 0x26, 0x03, 0x04, 0x10, 0x51, 0x23, 0x39, 0xc0, 0x52, 0xec, 0xdf, 0x9f, 0x3f
+       , 0xc8, 0xc7, 0x9f, 0x81, 0xcf, 0xe3, 0xfa, 0x0d, 0xbe, 0xe6, 0x15, 0x7a, 0xe5, 0x25, 0xf4, 0xa2
+       , 0x39, 0xe8, 0xde, 0x4a, 0xf0, 0x5e, 0x28, 0x10, 0xff, 0xd7, 0x30, 0xe8, 0xa0, 0x81, 0x43, 0x1f
+       , 0x52, 0xea, 0xb3, 0x43, 0x1a, 0xf9, 0xc0, 0xc0, 0x07, 0x5f, 0x0b, 0x00, 0x09, 0x78, 0xc8, 0x15
+       , 0x01, 0x3c, 0x82, 0x20, 0x00, 0x0c, 0x7e, 0x01, 0x60, 0x3e, 0x00, 0x8f, 0x3f, 0x70, 0x01, 0x35
+       , 0x10, 0x34, 0x1c, 0x20, 0x80, 0x88, 0x8a, 0x00, 0x60, 0x26, 0x02, 0xe6, 0x39, 0xee, 0xbf, 0x90
+       , 0x03, 0xe9, 0x20, 0x17, 0x61, 0xff, 0xfe, 0xf3, 0xf7, 0x37, 0xfc, 0xc0, 0x03, 0xc8, 0x4e, 0x64
+       , 0x86, 0xff, 0x88, 0xcd, 0xc4, 0xe0, 0x1d, 0x50, 0xa0, 0xed, 0x09, 0xc0, 0x4c, 0x33, 0xa4, 0xe3
+       , 0x00, 0x34, 0x55, 0x0e, 0x1e, 0xd8, 0x07, 0xcf, 0xea, 0x42, 0xd2, 0x3d, 0x38, 0xe8, 0x81, 0x45
+       , 0x0f, 0x0f, 0x24, 0xe1, 0x83, 0x68, 0x21, 0x41, 0x10, 0x14, 0xe0, 0x17, 0x04, 0x96, 0x41, 0xbc
+       , 0xe0, 0xd6, 0x0f, 0x30, 0xa6, 0x08, 0xde, 0x63, 0x08, 0x04, 0x00, 0x01, 0x44, 0xec, 0x58, 0x26
+       , 0x30, 0x03, 0x02, 0xed, 0x86, 0x1e, 0x81, 0x03, 0x6a, 0xfb, 0x43, 0x9a, 0x9f, 0x7f, 0x61, 0xc9
+       , 0x1e, 0x96, 0xfe, 0x21, 0x3b, 0xc9, 0x60, 0xdb, 0x42, 0x20, 0x4b, 0xe5, 0x81, 0x45, 0x17, 0x30
+       , 0xd3, 0x50, 0x12, 0x0a, 0x03, 0x05, 0x20, 0x63, 0xfc, 0xec, 0x90, 0x72, 0x9f, 0x13, 0x5a, 0xf6
+       , 0xc0, 0x13, 0x3e, 0x0f, 0x37, 0x64, 0xa4, 0x81, 0x57, 0x40, 0x50, 0x48, 0x48, 0x58, 0x48, 0x48
+       , 0x00, 0x1a, 0xfa, 0xc0, 0x38, 0x01, 0xe6, 0x10, 0x62, 0x6e, 0xf2, 0x04, 0x02, 0x80, 0x00, 0x22
+       , 0x61, 0x30, 0x19, 0x58, 0xf3, 0x83, 0x8f, 0x5e, 0x41, 0xb4, 0x3e, 0x11, 0xcd, 0x4f, 0xf8, 0x31
+       , 0x1e, 0x90, 0x6d, 0x80, 0xc8, 0x7b, 0x44, 0x20, 0xbb, 0x0b, 0x98, 0x40, 0xc3, 0x47, 0x43, 0x68
+       , 0xac, 0x02, 0xe8, 0x64, 0x16, 0x36, 0xc8, 0x22, 0x1d, 0x76, 0xc8, 0xa0, 0x00, 0x27, 0x64, 0x78
+       , 0x92, 0x13, 0x14, 0xbc, 0xdc, 0xe0, 0x31, 0x36, 0xf0, 0x48, 0x27, 0xb0, 0xe4, 0x11, 0x10, 0x16
+       , 0x16, 0x02, 0x15, 0x3e, 0x02, 0xe0, 0xc2, 0x87, 0x87, 0x97, 0x07, 0x54, 0xf8, 0x10, 0x28, 0xfa
+       , 0xe1, 0x00, 0x20, 0x80, 0x48, 0x1b, 0xcd, 0x07, 0x16, 0x7f, 0xff, 0xa1, 0x67, 0x10, 0x81, 0xae
+       , 0x99, 0x06, 0x9d, 0xe0, 0x04, 0xa9, 0x7b, 0xa1, 0x75, 0x2d, 0x23, 0x24, 0x03, 0x80, 0x17, 0x51
+       , 0x23, 0xf6, 0x78, 0x40, 0x77, 0x2a, 0x30, 0x32, 0x83, 0x4f, 0xa3, 0x1b, 0x02, 0xc5, 0x11, 0xe8
+       , 0x46, 0x42, 0xc8, 0xfc, 0x0a, 0x64, 0x4a, 0x11, 0x3c, 0xc6, 0x00, 0x2a, 0x7d, 0x80, 0xe5, 0x0e
+       , 0x78, 0x84, 0x98, 0x1b, 0x34, 0x46, 0x0c, 0xec, 0xe7, 0x72, 0x03, 0x4b, 0x7d, 0x70, 0xe2, 0x17
+       , 0x12, 0x00, 0xb5, 0x3e, 0x41, 0x6d, 0x7f, 0x1e, 0xf0, 0xe8, 0x3d, 0xf1, 0x76, 0x01, 0x04, 0x10
+       , 0x69, 0x11, 0x00, 0x0c, 0x55, 0xa0, 0x4b, 0xfe, 0xa2, 0x9e, 0xc2, 0xf2, 0x1f, 0xba, 0xb3, 0x95
+       , 0x01, 0xb2, 0xb7, 0x95, 0x11, 0xb6, 0x99, 0x00, 0xb1, 0xd3, 0x89, 0x19, 0xb6, 0x4f, 0x81, 0x99
+       , 0x11, 0x7c, 0x62, 0xe6, 0xe0, 0xcd, 0x0a, 0xe0, 0xf1, 0x7d, 0xf0, 0xdc, 0x2e, 0x68, 0x76, 0x85
+       , 0x03, 0xda, 0xec, 0xe1, 0x00, 0x97, 0x3d, 0xdc, 0xa0, 0xf0, 0x87, 0xd4, 0xbd, 0xbc, 0xe0, 0xf0
+       , 0x17, 0x10, 0x00, 0xa6, 0x7d, 0x60, 0xea, 0x17, 0x12, 0x04, 0xb7, 0x7e, 0x80, 0x6d, 0x7f, 0xa0
+       , 0x28, 0xb0, 0x8e, 0x26, 0x69, 0x82, 0x04, 0x20, 0x80, 0x48, 0x9e, 0xcf, 0x02, 0x06, 0x25, 0x30
+       , 0x29, 0x30, 0xfc, 0x83, 0x16, 0x3b, 0xe0, 0x43, 0x0e, 0x18, 0x60, 0x9b, 0x58, 0x11, 0xbb, 0x72
+       , 0x90, 0x02, 0x9f, 0x89, 0x85, 0x09, 0xb4, 0x5a, 0x92, 0x85, 0x99, 0xf9, 0xc7, 0x2f, 0x16, 0x66
+       , 0xa6, 0x5f, 0xbf, 0x98, 0x98, 0x20, 0xdd, 0x38, 0x52, 0xad, 0xa6, 0x35, 0x80, 0xae, 0x2b, 0x81
+       , 0x4d, 0xea, 0x42, 0x26, 0xb7, 0x20, 0x6d, 0x1e, 0x0e, 0x2e, 0x4e, 0xe8, 0x7d, 0x48, 0xdc, 0x90
+       , 0xe1, 0x35, 0x50, 0x9b, 0x07, 0x1c, 0xf8, 0xc0, 0xe0, 0x07, 0x25, 0x7f, 0x48, 0xcf, 0x0b, 0x18
+       , 0x51, 0xa4, 0xae, 0x55, 0x00, 0x08, 0x20, 0x72, 0x26, 0x14, 0x59, 0x98, 0x59, 0x80, 0x2e, 0x81
+       , 0xa6, 0xe1, 0xff, 0x90, 0xed, 0x05, 0xd0, 0x7b, 0xfd, 0x18, 0x11, 0x25, 0x0e, 0x74, 0x6f, 0x0d
+       , 0x78, 0xa9, 0x24, 0x2b, 0x64, 0xcd, 0x06, 0x90, 0xf5, 0x13, 0xc8, 0xfd, 0xc5, 0x0c, 0x1b, 0xcd
+       , 0xfe, 0x33, 0x48, 0x4a, 0x24, 0xe8, 0xde, 0x15, 0xe8, 0x6a, 0x2a, 0xc8, 0x32, 0x10, 0xd8, 0x00
+       , 0x27, 0x6c, 0x79, 0x02, 0x17, 0xa4, 0xf0, 0xe1, 0x02, 0x95, 0xfc, 0x90, 0xb4, 0x2f, 0x04, 0x49
+       , 0xfb, 0xe0, 0xae, 0x2f, 0x2f, 0xb0, 0xdb, 0x05, 0x0c, 0x7d, 0xd2, 0x27, 0x68, 0x01, 0x02, 0x88
+       , 0xcc, 0x19, 0x5d, 0xa0, 0x73, 0xb9, 0xa1, 0x57, 0x15, 0x43, 0xb7, 0xd4, 0x33, 0xc2, 0x36, 0xa3
+       , 0xbd, 0x83, 0x06, 0x3d, 0x33, 0x33, 0xfc, 0x8e, 0x39, 0xf0, 0x42, 0x30, 0xe8, 0x75, 0x97, 0x3f
+       , 0x59, 0x7e, 0xb2, 0xb2, 0xfc, 0xfc, 0xf9, 0x9b, 0x85, 0x05, 0x74, 0x9a, 0x32, 0xf8, 0x00, 0x47
+       , 0xd0, 0x19, 0x69, 0x03, 0x73, 0x14, 0x14, 0xb0, 0xa6, 0x85, 0xee, 0xcd, 0x82, 0x2e, 0xe5, 0x61
+       , 0x45, 0x8c, 0xf3, 0x40, 0x46, 0x39, 0x39, 0x39, 0x11, 0xeb, 0x43, 0x20, 0xed, 0x1f, 0x1e, 0x70
+       , 0xb8, 0x83, 0x8a, 0x7d, 0x60, 0xe8, 0x43, 0x5a, 0xfd, 0xe0, 0xb6, 0x10, 0x37, 0x79, 0xd3, 0xe3
+       , 0x00, 0x01, 0x44, 0xfe, 0x94, 0x3a, 0xd0, 0xcd, 0x40, 0x5b, 0x19, 0x20, 0x7b, 0xfc, 0x40, 0x11
+       , 0x00, 0x49, 0xef, 0xd0, 0x30, 0x47, 0xec, 0x79, 0x82, 0xae, 0xd0, 0x66, 0x86, 0x6c, 0x4c, 0x00
+       , 0x11, 0x3f, 0x81, 0x1e, 0x85, 0xdc, 0x36, 0xcf, 0xf2, 0x9b, 0x15, 0x94, 0x13, 0x58, 0x20, 0x47
+       , 0x59, 0x03, 0x5b, 0xb7, 0xf4, 0x3a, 0x91, 0x05, 0xb4, 0x8e, 0x13, 0xbc, 0x17, 0x0e, 0xb4, 0x20
+       , 0x19, 0xb6, 0x9c, 0x0a, 0xdc, 0xde, 0x67, 0x87, 0xad, 0x02, 0x01, 0x35, 0x7c, 0x10, 0xa3, 0x6c
+       , 0xa0, 0xf0, 0xe7, 0x04, 0x56, 0xbb, 0xc0, 0x90, 0x17, 0x14, 0x80, 0xa4, 0x7b, 0xd0, 0x90, 0x03
+       , 0x30, 0xf0, 0x81, 0x51, 0xc2, 0x45, 0x6e, 0xe8, 0x03, 0x01, 0x40, 0x00, 0x51, 0xb4, 0xa6, 0x01
+       , 0x68, 0x2b, 0x30, 0xea, 0xa1, 0x7b, 0x60, 0x21, 0xd7, 0x1a, 0xb3, 0x30, 0x43, 0x97, 0xf1, 0xb2
+       , 0x81, 0xf7, 0x39, 0xb1, 0x42, 0x20, 0x2b, 0x2b, 0x7c, 0x7d, 0xe9, 0x77, 0x50, 0x1e, 0xff, 0xf9
+       , 0x03, 0xc8, 0x02, 0x76, 0xd1, 0x58, 0x21, 0x97, 0xa0, 0x41, 0x0f, 0x2b, 0x65, 0xf9, 0x03, 0x9b
+       , 0xdd, 0xfc, 0xf7, 0x9f, 0x36, 0x19, 0x02, 0xbc, 0x7d, 0x14, 0x9c, 0x4c, 0x58, 0xc0, 0x77, 0x90
+       , 0x83, 0x17, 0x37, 0x41, 0x52, 0x3e, 0x64, 0x74, 0x9f, 0x0d, 0xbc, 0x8c, 0x10, 0xd2, 0xf2, 0xe1
+       , 0x82, 0x0c, 0xf6, 0x40, 0x46, 0xfa, 0xb9, 0xb9, 0xf9, 0x78, 0xf9, 0x40, 0xc1, 0x0e, 0xc4, 0xe0
+       , 0xf6, 0x3e, 0x3f, 0x1f, 0xbc, 0xc9, 0xcf, 0x49, 0xc9, 0xd2, 0x10, 0x80, 0x00, 0xa2, 0x74, 0x51
+       , 0x09, 0xd0, 0x2b, 0x5c, 0xdc, 0x5c, 0xf0, 0xba, 0x17, 0x9a, 0xdc, 0x59, 0x59, 0xd8, 0xc1, 0x49
+       , 0xea, 0xc3, 0x87, 0x0f, 0x90, 0x28, 0x80, 0x2e, 0x6b, 0xfc, 0x0e, 0x9a, 0x40, 0xfd, 0xf1, 0xf3
+       , 0x27, 0x1b, 0xdb, 0x0f, 0x20, 0x84, 0x5c, 0x4d, 0xf3, 0x9b, 0xed, 0x17, 0xbc, 0x4a, 0x80, 0x0d
+       , 0x71, 0x43, 0x46, 0xf8, 0x20, 0xe3, 0x4c, 0x54, 0x38, 0xa8, 0x0e, 0xb1, 0x5d, 0x17, 0x71, 0xfb
+       , 0x2f, 0xa2, 0xd0, 0x67, 0x85, 0xb7, 0xf7, 0xc1, 0xeb, 0x71, 0xd8, 0xe1, 0x73, 0x5b, 0xb0, 0xe4
+       , 0x0f, 0x24, 0x40, 0xe9, 0x9d, 0x1f, 0x1c, 0xf2, 0x7c, 0xe0, 0x74, 0x0f, 0x6a, 0xef, 0x83, 0xa7
+       , 0xba, 0xb8, 0xb8, 0x88, 0xe9, 0xee, 0xe2, 0x01, 0x00, 0x01, 0x58, 0xbb, 0x62, 0x2d, 0x00, 0x41
+       , 0x10, 0x38, 0x50, 0x5a, 0x53, 0xff, 0xff, 0x99, 0x4c, 0xe5, 0x23, 0xdf, 0x0b, 0x0e, 0xc2, 0x96
+       , 0xa6, 0x9a, 0x5c, 0x01, 0x15, 0x79, 0x78, 0x77, 0xfc, 0x80, 0xea, 0x51, 0xaf, 0xd4, 0x48, 0x02
+       , 0xdd, 0xfe, 0x26, 0x34, 0x05, 0x4e, 0x49, 0x7d, 0x62, 0xe6, 0xe4, 0x19, 0xf8, 0xfb, 0x56, 0xf6
+       , 0xa3, 0xcd, 0xa5, 0x55, 0xdd, 0x88, 0x0a, 0xb5, 0x7c, 0x09, 0x51, 0xeb, 0xd3, 0x67, 0x33, 0x49
+       , 0x97, 0x87, 0x5e, 0x6f, 0x47, 0xa7, 0xb5, 0xa3, 0xdb, 0x61, 0x82, 0x6a, 0x10, 0xfe, 0x7a, 0xcf
+       , 0x54, 0x21, 0x0a, 0x93, 0x02, 0x17, 0x04, 0x0a, 0x68, 0x5e, 0xd0, 0x31, 0xfb, 0x97, 0xc2, 0xaa
+       , 0x09, 0x18, 0xc2, 0xa0, 0xa5, 0x20, 0xfe, 0xe3, 0x67, 0xd7, 0x56, 0x2d, 0x38, 0x37, 0x6f, 0xf0
+       , 0xdb, 0xa9, 0xb7, 0xd8, 0x7b, 0x0d, 0x6a, 0xb8, 0xcd, 0x75, 0xf9, 0x4e, 0x59, 0xbc, 0x04, 0x10
+       , 0x75, 0x96, 0x55, 0x01, 0xdd, 0x01, 0x4c, 0x0b, 0xd0, 0x04, 0x06, 0xbb, 0xd8, 0x15, 0x36, 0x57
+       , 0x0d, 0x9a, 0xb5, 0xf8, 0xf8, 0xf1, 0x33, 0x28, 0xe4, 0xbf, 0x43, 0x72, 0x39, 0xfb, 0x4f, 0x8e
+       , 0x9f, 0x3f, 0x7e, 0x70, 0x40, 0x2e, 0xe5, 0x83, 0xc5, 0xc0, 0xaf, 0xdf, 0x90, 0x73, 0xc3, 0x21
+       , 0xd7, 0x74, 0x40, 0xe7, 0xda, 0xc0, 0xd3, 0xfd, 0x90, 0x33, 0x64, 0x41, 0x03, 0xae, 0x90, 0x51
+       , 0x6f, 0xa0, 0x85, 0xff, 0xe0, 0x27, 0xaa, 0x31, 0x40, 0x4f, 0xe1, 0x61, 0x80, 0x32, 0x20, 0x07
+       , 0x1f, 0x31, 0x42, 0x77, 0xf7, 0x23, 0x6d, 0x55, 0x87, 0xee, 0x72, 0x83, 0xec, 0xb8, 0x42, 0x5a
+       , 0x42, 0x0e, 0xd9, 0x35, 0x01, 0x1e, 0xe4, 0xe7, 0x80, 0xe6, 0x00, 0x4e, 0xd8, 0x68, 0x33, 0x1f
+       , 0x78, 0x68, 0x9f, 0x1f, 0x32, 0xc0, 0xcf, 0xc7, 0x07, 0x1e, 0xe4, 0x01, 0xa5, 0x7c, 0x60, 0x9f
+       , 0x98, 0x83, 0xe8, 0xbe, 0x2e, 0x7e, 0x00, 0x10, 0x40, 0xd4, 0x5c, 0xd7, 0x06, 0x0c, 0x70, 0x48
+       , 0x35, 0x0c, 0xee, 0xcb, 0x40, 0x4b, 0x55, 0x78, 0x72, 0xfa, 0xf4, 0x09, 0x74, 0x27, 0x2e, 0xfb
+       , 0x77, 0x60, 0xef, 0x06, 0x74, 0x25, 0xe8, 0x0f, 0x0e, 0xd8, 0xa5, 0xa0, 0xe0, 0xd5, 0x16, 0xbf
+       , 0xe1, 0x17, 0xae, 0x80, 0xe7, 0xf9, 0x7f, 0xff, 0xfe, 0x83, 0x74, 0x74, 0x35, 0x38, 0x12, 0xfe
+       , 0xc2, 0x4e, 0xf0, 0x05, 0x1f, 0x1f, 0x0b, 0x3b, 0x94, 0x10, 0x3e, 0x02, 0x02, 0x3d, 0xcc, 0x85
+       , 0x09, 0x7e, 0x34, 0x09, 0x68, 0x63, 0x2d, 0xf8, 0x84, 0x12, 0xc4, 0x76, 0x51, 0xd8, 0xbe, 0x2d
+       , 0x56, 0x16, 0x78, 0xc9, 0xc3, 0x06, 0x5d, 0x47, 0x08, 0x9e, 0x5c, 0x87, 0xcf, 0xae, 0x73, 0x72
+       , 0x00, 0x9b, 0x95, 0xa0, 0x00, 0xe7, 0x03, 0xcf, 0x2d, 0x82, 0xa7, 0xd7, 0x41, 0x3d, 0x5f, 0x1e
+       , 0x6e, 0x48, 0xbd, 0x4c, 0xe4, 0x38, 0x0f, 0x31, 0x00, 0x20, 0x00, 0x6b, 0x67, 0x94, 0x02, 0x30
+       , 0x0c, 0xc2, 0xd0, 0xbf, 0xb5, 0x65, 0xbb, 0xff, 0x45, 0x45, 0xe6, 0xba, 0x51, 0x46, 0x13, 0x1d
+       , 0xc2, 0x7e, 0x7b, 0x85, 0x22, 0x55, 0x7c, 0x31, 0x59, 0x2c, 0x2c, 0xc4, 0x1d, 0x93, 0x4f, 0x9e
+       , 0x8e, 0xee, 0x2a, 0x1b, 0x1a, 0xb6, 0x58, 0xb2, 0x8b, 0x88, 0xaa, 0x9a, 0x9d, 0xd5, 0xfa, 0xd5
+       , 0x90, 0x6a, 0x03, 0xd4, 0x3f, 0x83, 0x0d, 0x9e, 0x19, 0xd4, 0xd4, 0xef, 0x8f, 0xb7, 0xb1, 0x25
+       , 0x8c, 0xb0, 0xbf, 0x1e, 0x79, 0xf3, 0xfa, 0xf3, 0xd1, 0x0c, 0x4b, 0xa3, 0x48, 0x1a, 0x4f, 0x4e
+       , 0x01, 0x3e, 0x96, 0xf1, 0xf1, 0xb7, 0xf4, 0xf5, 0xa3, 0xfe, 0x29, 0x27, 0x2c, 0xc5, 0x41, 0x57
+       , 0xa1, 0x96, 0xca, 0x91, 0x16, 0xb1, 0xd6, 0xe1, 0x6c, 0x1d, 0x02, 0xe7, 0xb6, 0xf6, 0x44, 0xee
+       , 0x15, 0x40, 0xd4, 0x5f, 0xd9, 0x09, 0x74, 0x1f, 0xd0, 0xa9, 0xe0, 0x28, 0x00, 0xaf, 0x53, 0x05
+       , 0xe5, 0x6b, 0x76, 0x0e, 0xe8, 0x38, 0x22, 0xa8, 0x29, 0x0d, 0x8c, 0x00, 0x48, 0x34, 0xfc, 0xfc
+       , 0xc9, 0x09, 0x2c, 0x86, 0x7e, 0x71, 0xc2, 0x4a, 0x21, 0xd8, 0xa5, 0x59, 0xa0, 0xb9, 0x86, 0x5f
+       , 0x88, 0x63, 0xc4, 0x41, 0xb3, 0x9e, 0x48, 0xe7, 0xb7, 0x83, 0x4f, 0x76, 0x84, 0x54, 0x05, 0xb0
+       , 0x56, 0x2b, 0xb8, 0xe0, 0x87, 0x9c, 0x7a, 0xc1, 0xc4, 0x08, 0x3b, 0x1c, 0x06, 0x3a, 0xf8, 0x81
+       , 0x52, 0xeb, 0x42, 0x9b, 0x08, 0xf0, 0xd5, 0xfb, 0x6c, 0x6c, 0xd0, 0x4d, 0xb9, 0xe0, 0x9d, 0x2b
+       , 0x5c, 0x5c, 0xa0, 0x55, 0x3c, 0xbc, 0xd0, 0x51, 0x4e, 0xc8, 0x50, 0x1b, 0x2f, 0x64, 0x64, 0x1f
+       , 0x92, 0x89, 0x71, 0xad, 0x6c, 0xa0, 0x04, 0x00, 0x04, 0x10, 0xad, 0x96, 0xd6, 0x82, 0xb7, 0x21
+       , 0x30, 0xc3, 0xca, 0x58, 0x70, 0x87, 0x1e, 0x3a, 0x73, 0xca, 0xfd, 0xe5, 0xeb, 0x37, 0x1e, 0xf0
+       , 0x72, 0x47, 0xf0, 0x6a, 0xa3, 0xaf, 0xb0, 0x8b, 0x85, 0x60, 0x77, 0x54, 0x22, 0xb7, 0x88, 0xa0
+       , 0xcb, 0x2e, 0x10, 0x07, 0xb9, 0xff, 0x07, 0x1f, 0x79, 0xcd, 0x80, 0x38, 0xc7, 0x1a, 0x71, 0x28
+       , 0x21, 0xe4, 0x68, 0x24, 0x06, 0xf8, 0xa9, 0x5f, 0x90, 0x1c, 0xc0, 0x02, 0xdb, 0x33, 0x0a, 0xdf
+       , 0x87, 0xcb, 0x8a, 0x68, 0xfb, 0x40, 0x00, 0x30, 0xf5, 0xc3, 0x86, 0x98, 0xa1, 0x23, 0xfc, 0x90
+       , 0xa1, 0x7e, 0x48, 0xdb, 0x1f, 0x34, 0xaf, 0x02, 0x5a, 0x56, 0xce, 0xce, 0x4c, 0x9b, 0x0d, 0xd2
+       , 0x00, 0x01, 0xc4, 0x48, 0xeb, 0xd3, 0x28, 0xc1, 0xb7, 0xf3, 0xfd, 0x82, 0xde, 0x8d, 0x08, 0xb9
+       , 0xa5, 0xfe, 0x2b, 0xe4, 0x86, 0x63, 0x08, 0x0b, 0xbc, 0xe4, 0x0b, 0xb4, 0xea, 0xe5, 0x3b, 0x2c
+       , 0x0a, 0x7e, 0x41, 0xee, 0x7f, 0x82, 0x1f, 0xf4, 0x0e, 0xbd, 0xb9, 0x06, 0x36, 0xfd, 0x09, 0x3f
+       , 0x0a, 0x98, 0x01, 0x56, 0x09, 0xff, 0x87, 0x1e, 0x3b, 0x08, 0x3b, 0x51, 0x07, 0x51, 0xfe, 0xc0
+       , 0xce, 0x88, 0x61, 0x81, 0x77, 0xc8, 0x61, 0x3b, 0x47, 0xd9, 0x40, 0x7b, 0x81, 0xc0, 0x83, 0xcc
+       , 0xd0, 0xe9, 0x74, 0x2e, 0xd8, 0x3c, 0x0b, 0x78, 0xd4, 0x07, 0x3a, 0xe3, 0x0b, 0x5e, 0x5f, 0x0b
+       , 0xda, 0x32, 0x4d, 0xbb, 0xf0, 0x01, 0x08, 0x20, 0x9a, 0x47, 0x00, 0x04, 0x80, 0x2f, 0x70, 0x02
+       , 0xdf, 0x10, 0xf7, 0x1d, 0x72, 0x4d, 0x28, 0xe8, 0x5e, 0x39, 0xf0, 0x1d, 0xa3, 0x60, 0x0e, 0xf4
+       , 0xa6, 0x7a, 0xf0, 0x1d, 0xa2, 0x3f, 0x7f, 0x42, 0x57, 0xdd, 0x41, 0x66, 0xde, 0x20, 0xf8, 0xcf
+       , 0x3f, 0xa4, 0x6a, 0x00, 0xf9, 0xe4, 0x5f, 0xd8, 0xd1, 0x8e, 0x90, 0xb3, 0x20, 0xa1, 0xc7, 0x7b
+       , 0x81, 0x4b, 0x20, 0xc8, 0x71, 0x30, 0xb0, 0xd3, 0x2e, 0x20, 0x5b, 0xa5, 0x59, 0xa0, 0xeb, 0xc8
+       , 0xd9, 0x21, 0x2b, 0xd8, 0x38, 0x61, 0x00, 0xb6, 0xa8, 0x0a, 0xd6, 0xf8, 0xe7, 0xe4, 0x80, 0x6c
+       , 0x16, 0xa5, 0x45, 0x99, 0x83, 0x06, 0x00, 0x02, 0xf0, 0x76, 0x06, 0x29, 0x00, 0x80, 0x20, 0x10
+       , 0x94, 0xa0, 0xff, 0x3f, 0x57, 0x8d, 0xc2, 0x50, 0x57, 0xfb, 0x41, 0x9d, 0xba, 0x27, 0x62, 0xab
+       , 0xee, 0x7c, 0x7a, 0x00, 0x3f, 0x66, 0xc1, 0x29, 0x53, 0x01, 0x2a, 0x11, 0xc8, 0xd0, 0x40, 0xb7
+       , 0x0a, 0x2b, 0x03, 0x99, 0x0e, 0x7e, 0x71, 0xf0, 0xbf, 0x97, 0xfa, 0xd0, 0xcb, 0x86, 0xff, 0xfe
+       , 0xa9, 0x14, 0x64, 0xd5, 0x01, 0xb5, 0x0e, 0x7f, 0xca, 0x3e, 0x10, 0x8d, 0xe7, 0x7f, 0xd7, 0x52
+       , 0xa0, 0x1b, 0x96, 0x60, 0xc7, 0x0a, 0xf5, 0xa6, 0x7f, 0x76, 0x53, 0xe9, 0xa9, 0x61, 0x5a, 0x5c
+       , 0x53, 0x06, 0x8a, 0xfa, 0x68, 0xfe, 0x31, 0x04, 0xb8, 0x02, 0x88, 0x8e, 0x11, 0x00, 0x06, 0xc0
+       , 0x60, 0x83, 0xb6, 0xfa, 0xc1, 0x57, 0x6a, 0x41, 0x82, 0xfb, 0x27, 0x74, 0xc5, 0xd7, 0x0f, 0xf0
+       , 0x9d, 0xc5, 0x3f, 0x7f, 0xc0, 0x2e, 0xed, 0xfe, 0x0d, 0xbe, 0x4f, 0xee, 0x17, 0xe4, 0xd6, 0x21
+       , 0x58, 0x7d, 0x00, 0x5f, 0x80, 0xf4, 0x0f, 0x6a, 0x1e, 0x68, 0xfa, 0x1f, 0xd6, 0xfc, 0x81, 0xf6
+       , 0x00, 0x60, 0x07, 0x5d, 0x30, 0x43, 0x0e, 0x5c, 0x00, 0x36, 0xf9, 0x61, 0x5b, 0x7b, 0xa0, 0x85
+       , 0x3e, 0x78, 0x23, 0x28, 0x74, 0x55, 0x2d, 0xa4, 0x06, 0x86, 0x1d, 0x22, 0x00, 0xaa, 0xa0, 0xe9
+       , 0xb9, 0xff, 0x13, 0x20, 0x80, 0xe8, 0x1d, 0x01, 0x70, 0xf0, 0x17, 0x7c, 0x71, 0x1f, 0xa4, 0xe9
+       , 0xf3, 0x13, 0x52, 0x42, 0x41, 0xaf, 0x66, 0x87, 0x62, 0xe8, 0x95, 0xb0, 0xd0, 0x65, 0xc0, 0xd0
+       , 0x7b, 0x85, 0xfe, 0xc0, 0xd6, 0xc1, 0xfc, 0x83, 0x1d, 0x73, 0xcd, 0x08, 0x5e, 0x02, 0x03, 0xad
+       , 0x84, 0x11, 0x65, 0x3f, 0xe2, 0xfc, 0x29, 0xc8, 0x26, 0x73, 0x48, 0xa2, 0x06, 0x9f, 0xc1, 0x00
+       , 0x86, 0x6c, 0x88, 0x1c, 0x01, 0xdb, 0x0c, 0xcd, 0x32, 0x20, 0xfb, 0x3e, 0x01, 0x02, 0x68, 0xc0
+       , 0x22, 0x00, 0x02, 0x80, 0xc1, 0x08, 0xb9, 0xeb, 0x0c, 0xda, 0xfa, 0xf9, 0x85, 0xc0, 0x7f, 0xa0
+       , 0x0b, 0x61, 0x20, 0x37, 0x58, 0x42, 0xae, 0x16, 0x82, 0x5e, 0xf3, 0x81, 0x58, 0x87, 0x01, 0x39
+       , 0x88, 0x19, 0x94, 0x0b, 0xd0, 0x9a, 0xff, 0xa8, 0x9d, 0x2f, 0x50, 0xa5, 0x0b, 0xed, 0x1c, 0xb2
+       , 0xa2, 0x01, 0x70, 0x5b, 0x6d, 0x00, 0x8f, 0x62, 0x03, 0x08, 0xa0, 0x01, 0x8e, 0x00, 0x38, 0x00
+       , 0x3a, 0xe3, 0x0f, 0xa2, 0xa0, 0x81, 0xdd, 0x60, 0x09, 0x5f, 0xff, 0xf8, 0x07, 0x7c, 0xbd, 0x0d
+       , 0xec, 0x7e, 0x8f, 0xff, 0x90, 0x8a, 0x00, 0x7a, 0x3a, 0x3c, 0xbc, 0x17, 0x8c, 0xd4, 0x04, 0x02
+       , 0x9d, 0x58, 0x02, 0x1e, 0x1a, 0x44, 0x8e, 0x06, 0x0c, 0x30, 0x18, 0x8e, 0x7d, 0x01, 0x08, 0xa0
+       , 0xc1, 0x12, 0x01, 0xc8, 0x00, 0x76, 0x75, 0x19, 0xb8, 0x13, 0x06, 0xbd, 0xdf, 0x09, 0x72, 0x0d
+       , 0x11, 0xb4, 0x06, 0x86, 0xb4, 0x83, 0x90, 0x2b, 0x61, 0x06, 0x58, 0x04, 0x30, 0xc0, 0x8e, 0x9f
+       , 0x85, 0x8f, 0x7e, 0xb2, 0xc0, 0xe6, 0x87, 0x20, 0x1b, 0xfc, 0x07, 0xdb, 0xf6, 0x66, 0x80, 0x00
+       , 0x1a, 0x8c, 0x11, 0x80, 0x0c, 0x40, 0xc1, 0x0c, 0xbb, 0x17, 0x0d, 0x72, 0xa5, 0x0d, 0x7c, 0x35
+       , 0x00, 0xe4, 0x18, 0x78, 0xd0, 0x19, 0xcc, 0xd0, 0x59, 0x69, 0xd8, 0x89, 0xcb, 0x88, 0x13, 0x98
+       , 0xa1, 0x43, 0x42, 0x83, 0xf9, 0xd4, 0x6b, 0x80, 0x00, 0x03, 0x00, 0x36, 0x48, 0x61, 0x8b, 0x2d
+       , 0x54, 0xbb, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, 0x0a };
+
+}
+#endif
Index: /OgreMain/include/OgreStableHeaders.h
===================================================================
--- /OgreMain/include/OgreStableHeaders.h	(revision 5)
+++ /OgreMain/include/OgreStableHeaders.h	(revision 5)
@@ -0,0 +1,80 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+/* Stable headers which will be used for precompilation if the compiler
+   supports it. Add entries here when headers are unlikely to change.
+   NB: a change to any of these headers will result in a full rebuild,
+   so don't add things to this lightly.
+*/
+
+#ifndef __OgreStableHeaders__
+#define __OgreStableHeaders__
+
+#include "OgrePlatform.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#include "OgreArchive.h"
+#include "OgreAxisAlignedBox.h"
+#include "OgreBitwise.h"
+#include "OgreCamera.h"
+#include "OgreColourValue.h"
+#include "OgreCommon.h"
+#include "OgreDataStream.h"
+#include "OgreException.h"
+#include "OgreFileSystem.h"
+#include "OgreLog.h"
+#include "OgreMath.h"
+#include "OgreMatrix3.h"
+#include "OgreMatrix4.h"
+#include "OgreMovableObject.h"
+#include "OgreNode.h"
+#include "OgrePlane.h"
+#include "OgrePrerequisites.h"
+#include "OgreQuaternion.h"
+#include "OgreResource.h"
+#include "OgreSerializer.h"
+#include "OgreSharedPtr.h"
+#include "OgreSimpleRenderable.h"
+#include "OgreSimpleSpline.h"
+#include "OgreSingleton.h"
+#include "OgreSphere.h"
+#include "OgreStdHeaders.h"
+#include "OgreString.h"
+#include "OgreStringConverter.h"
+#include "OgreStringInterface.h"
+#include "OgreStringVector.h"
+#include "OgreUserDefinedObject.h"
+#include "OgreVector2.h"
+#include "OgreVector3.h"
+#include "OgreVector4.h"
+#include "OgreWireBoundingBox.h"
+#include "OgreZip.h"
+#endif
+
+#endif 
Index: /OgreMain/include/OgreStaticFaceGroup.h
===================================================================
--- /OgreMain/include/OgreStaticFaceGroup.h	(revision 5)
+++ /OgreMain/include/OgreStaticFaceGroup.h	(revision 5)
@@ -0,0 +1,134 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __StaticFaceGroup_H__
+#define __StaticFaceGroup_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgrePlane.h"
+#include "OgrePatchSurface.h"
+
+namespace Ogre {
+
+    /** A type of face group, ie face list of procedural etc */
+    enum FaceGroupType {
+        FGT_FACE_LIST,
+        FGT_PATCH,
+        FGT_UNKNOWN
+    };
+
+    /** Collectes a group of static ie immovable faces together which have common
+        properties like the material they use, the plane they lie on.
+        @remarks
+            Whilst for discrete geometry (i.e. movable objects) groups of faces are
+            held in the SubMesh class, for immovable objects like scenery there
+            needs to ba little more flexibility in the grouping since the group is
+            likely to be a small part of a huge set of geometry. In addition, because
+            the faces are unmoving certain optimisations can be performed, e.g.
+            precalculating a world-coordinate bounding box and normal.
+        @par
+            Exactly how this class is used depends on the format of the large
+            static geometry used in the level. An example would be the use of this
+            class in the BspNode class for indoor levels.
+            For flexibility and efficiency, it is not assumed that this class holds
+            details of the vertices itself, or in fact that it holds the vertex indices
+            itself. Everything is manipulated via pointers so if you want this
+            class to point into a block of geometry data it can.
+    */
+    struct StaticFaceGroup {
+        // Type of face group.
+        FaceGroupType fType;
+
+        /// Is this a sky surface?
+        bool isSky;
+
+        /** Index into a buffer containing vertex definitions. Because we're
+            dealing with subsets of large levels this is likely to be part-way
+            through a huge vertex buffer. */
+        int vertexStart;
+
+        /** The range of vertices in the buffer this facegroup references.
+            This is really for copying purposes only, so that we know which
+            subset of vertices to copy from our large-level buffer into the rendering buffer.
+        */
+        int numVertices;
+
+        /** Index into a buffer containing vertex indices. This buffer
+            may be individual to this group or shared for memory allocation
+            efficiency.The vertex indexes are relative the the mVertexStart pointer,
+            not to the start of the large-level buffer, allowing simple reindexing
+            when copying data into rendering buffers.
+            This is only applicable to FGT_FACE_LIST face group types.
+        */
+        int elementStart;
+
+        /** The number of vertex indices.
+            This is only applicable to FGT_FACE_LIST face group types.
+        */
+        int numElements;
+
+        /** Handle to material used by this group.
+            Note the use of the material handle rather than the material
+            name - this is for efficiency since there will be many of these.
+        */
+        int materialHandle;
+
+        Plane plane;
+
+        /// Patch surface (only applicable when fType = FGT_PATCH)
+        PatchSurface* patchSurf;
+
+
+        _OgreExport friend std::ostream& operator<<(std::ostream& o, const StaticFaceGroup& s)
+        {
+            o << "StaticFaceGroup(";
+            if (s.fType == FGT_FACE_LIST)
+            {
+                o << "faceList, numVertices=" << s.numVertices << ", vertexStart=" << s.vertexStart;
+                o << ", numElements=" << s.numElements << ", elementStart=" << s.elementStart;
+                o << ", normal=" << s.plane.normal;
+            }
+            else if (s.fType == FGT_PATCH)
+            {
+                o << "bezierPatch, numVertices=" << s.numVertices << ", vertexStart=" << s.vertexStart;
+                // TODO
+            }
+
+            o << ", materialHandle=" << s.materialHandle;
+            o << ")";
+
+            return o;
+        }
+
+
+    };
+
+} // namespace
+
+#endif
Index: /OgreMain/include/OgreStaticGeometry.h
===================================================================
--- /OgreMain/include/OgreStaticGeometry.h	(revision 5)
+++ /OgreMain/include/OgreStaticGeometry.h	(revision 5)
@@ -0,0 +1,748 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __StaticGeometry_H__
+#define __StaticGeometry_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMovableObject.h"
+#include "OgreRenderable.h"
+
+namespace Ogre {
+
+	/** Pre-transforms and batches up meshes for efficient use as static
+		geometry in a scene.
+	@remarks
+		Modern graphics cards (GPUs) prefer to receive geometry in large
+		batches. It is orders of magnitude faster to render 10 batches
+		of 10,000 triangles than it is to render 10,000 batches of 10 
+		triangles, even though both result in the same number of on-screen
+		triangles.
+	@par
+		Therefore it is important when you are rendering a lot of geometry to 
+		batch things up into as few rendering calls as possible. This
+		class allows you to build a batched object from a series of entities 
+		in order to benefit from this behaviour.
+		Batching has implications of it's own though:
+		@li Batched geometry cannot be subdivided; that means that the whole
+			group will be displayed, or none of it will. This obivously has
+			culling issues.
+		@li A single world transform must apply to the entire batch. Therefore
+			once you have batched things, you can't move them around relative to
+			each other. That's why this class is most useful when dealing with 
+			static geometry (hence the name). In addition, geometry is 
+			effectively duplicated, so if you add 3 entities based on the same 
+			mesh in different positions, they will use 3 times the geometry 
+			space than the movable version (which re-uses the same geometry). 
+			So you trade memory	and flexibility of movement for pure speed when
+			using this class.
+		@li A single material must apply for each batch. In fact this class 
+			allows you to use multiple materials, but you should be aware that 
+			internally this means that there is one batch per material. 
+			Therefore you won't gain as much benefit from the batching if you 
+			use many different materials; try to keep the number down.
+	@par
+		In order to retain some sort of culling, this class will batch up 
+		meshes in localised regions. The size and shape of these blocks is
+		controlled by the SceneManager which contructs this object, since it
+		makes sense to batch things up in the most appropriate way given the 
+		existing partitioning of the scene. 
+	@par
+		The LOD settings of both the Mesh and the Materials used in 
+		constructing this static geometry will be respected. This means that 
+		if you use meshes/materials which have LOD, batches in the distance 
+		will have a lower polygon count or material detail to those in the 
+		foreground. Since each mesh might have different LOD distances, during 
+		build the furthest distance at each LOD level from all meshes  
+		in that region is used. This means all the LOD levels change at the 
+		same time, but at the furthest distance of any of them (so quality is 
+		not degraded). Be aware that using Mesh LOD in this class will 
+		further increase the memory required. Only generated LOD
+		is supported for meshes.
+	@par
+		There are 2 ways you can add geometry to this class; you can add
+		Entity objects directly with predetermined positions, scales and 
+		orientations, or you can add an entire SceneNode and it's subtree, 
+		including all the objects attached to it. Once you've added everthing
+		you need to, you have to call build() the fix the geometry in place. 
+	@note
+		This class is not a replacement for world geometry (@see 
+		SceneManager::setWorldGeometry). The single most efficient way to 
+		render large amounts of static geometry is to use a SceneManager which 
+		is specialised for dealing with that particular world structure. 
+		However, this class does provide you with a good 'halfway house'
+		between generalised movable geometry (Entity) which works with all 
+		SceneManagers but isn't efficient when using very large numbers, and 
+		highly specialised world geometry which is extremely fast but not 
+		generic and typically requires custom world editors.
+	@par
+		You should not construct instances of this class directly; instead, cal 
+		SceneManager::createStaticGeometry, which gives the SceneManager the 
+		option of providing you with a specialised version of this class if it
+		wishes, and also handles the memory management for you like other 
+		classes.
+	@note
+		Warning: this class only works with triangle lists at the moment,
+		do not pass it triangle strips, fans or lines / points.
+	*/
+	class _OgreExport StaticGeometry
+	{
+	public:
+		/** Struct holding geometry optimised per SubMesh / lod level, ready
+			for copying to instances. 
+		@remarks
+			Since we're going to be duplicating geometry lots of times, it's
+			far more important that we don't have redundant vertex data. If a 
+			SubMesh uses shared geometry, or we're looking at a lower LOD, not
+			all the vertices are being referenced by faces on that submesh.
+			Therefore to duplicate them, potentially hundreds or even thousands
+			of times, would be extremely wasteful. Therefore, if a SubMesh at
+			a given LOD has wastage, we create an optimised version of it's
+			geometry which is ready for copying with no wastage.
+		*/
+		class _OgrePrivate OptimisedSubMeshGeometry
+		{
+		public:
+			OptimisedSubMeshGeometry() :vertexData(0), indexData(0) {}
+			~OptimisedSubMeshGeometry() 
+			{
+				delete vertexData;
+				delete indexData;
+			}
+			VertexData *vertexData;
+			IndexData *indexData;
+		};
+		typedef std::list<OptimisedSubMeshGeometry*> OptimisedSubMeshGeometryList;
+		/// Saved link between SubMesh at a LOD and vertex/index data
+		/// May point to original or optimised geometry
+		struct SubMeshLodGeometryLink
+		{
+			VertexData* vertexData;
+			IndexData* indexData;
+		};
+		typedef std::vector<SubMeshLodGeometryLink> SubMeshLodGeometryLinkList;
+		typedef std::map<SubMesh*, SubMeshLodGeometryLinkList*> SubMeshGeometryLookup;
+		/// Structure recording a queued submesh for the build
+		struct QueuedSubMesh
+		{
+			SubMesh* submesh;
+			/// Link to LOD list of geometry, potentially optimised
+			SubMeshLodGeometryLinkList* geometryLodList;
+			String materialName;
+			Vector3 position;
+			Quaternion orientation;
+			Vector3 scale;
+			/// Pre-transformed world AABB 
+			AxisAlignedBox worldBounds;
+		};
+		typedef std::vector<QueuedSubMesh*> QueuedSubMeshList;
+		/// Structure recording a queued geometry for low level builds
+		struct QueuedGeometry
+		{
+			SubMeshLodGeometryLink* geometry;
+			Vector3 position;
+			Quaternion orientation;
+			Vector3 scale;
+		};
+		typedef std::vector<QueuedGeometry*> QueuedGeometryList;
+		
+		// forward declarations
+		class LODBucket;
+		class MaterialBucket;
+		class Region;
+
+		/** A GeometryBucket is a the lowest level bucket where geometry with 
+			the same vertex & index format is stored. It also acts as the 
+			renderable.
+		*/
+		class _OgreExport GeometryBucket :	public Renderable
+		{
+		protected:
+			/// Geometry which has been queued up pre-build (not for deallocation)
+			QueuedGeometryList mQueuedGeometry;
+			/// Pointer to parent bucket
+			MaterialBucket* mParent;
+			/// String identifying the vertex / index format
+			String mFormatString;
+			/// Vertex information, includes current number of vertices
+			/// committed to be a part of this bucket
+			VertexData* mVertexData;
+			/// Index information, includes index type which limits the max
+			/// number of vertices which are allowed in one bucket
+			IndexData* mIndexData;
+			/// Size of indexes
+			HardwareIndexBuffer::IndexType mIndexType;
+			/// Maximum vertex indexable
+			size_t mMaxVertexIndex;
+
+			template<typename T>
+			void copyIndexes(const T* src, T* dst, size_t count, size_t indexOffset)
+			{
+				if (indexOffset == 0)
+				{
+					memcpy(dst, src, sizeof(T) * count);
+				}
+				else
+				{
+					while(count--)
+					{
+						*dst++ = static_cast<T>(*src++ + indexOffset);
+					}
+				}
+			}
+		public:
+			GeometryBucket(MaterialBucket* parent, const String& formatString, 
+				const VertexData* vData, const IndexData* iData);
+			virtual ~GeometryBucket();
+			MaterialBucket* getParent(void) { return mParent; }
+			/// Get the vertex data for this geometry 
+			const VertexData* getVertexData(void) const { return mVertexData; }
+			/// Get the index data for this geometry 
+			const IndexData* getIndexData(void) const { return mIndexData; }
+			/// @copydoc Renderable::getMaterial
+			const MaterialPtr& getMaterial(void) const;
+			Technique* getTechnique(void) const;
+			void getRenderOperation(RenderOperation& op);
+	        void getWorldTransforms(Matrix4* xform) const;
+	        const Quaternion& getWorldOrientation(void) const;
+	        const Vector3& getWorldPosition(void) const;
+			Real getSquaredViewDepth(const Camera* cam) const;
+	        const LightList& getLights(void) const;
+			bool getCastsShadows(void) const;
+			
+			/** Try to assign geometry to this bucket.
+			@returns false if there is no room left in this bucket
+			*/
+			bool assign(QueuedGeometry* qsm);
+			/// Build
+			void build(bool stencilShadows);
+			/// Dump contents for diagnostics
+			void dump(std::ofstream& of) const;
+		};
+		/** A MaterialBucket is a collection of smaller buckets with the same 
+			Material (and implicitly the same LOD). */
+		class _OgreExport MaterialBucket
+		{
+		public:
+			/// list of Geometry Buckets in this region
+			typedef std::vector<GeometryBucket*> GeometryBucketList;
+		protected:
+			/// Pointer to parent LODBucket
+			LODBucket* mParent;
+			/// Material being used
+			String mMaterialName;
+			/// Pointer to material being used
+			MaterialPtr mMaterial;
+			/// Active technique
+			Technique* mTechnique;
+
+			/// list of Geometry Buckets in this region
+			GeometryBucketList mGeometryBucketList;
+			// index to current Geometry Buckets for a given geometry format
+			typedef std::map<String, GeometryBucket*> CurrentGeometryMap;
+			CurrentGeometryMap mCurrentGeometryMap;
+			/// Get a packed string identifying the geometry format
+			String getGeometryFormatString(SubMeshLodGeometryLink* geom);
+			
+		public:
+			MaterialBucket(LODBucket* parent, const String& materialName);
+			virtual ~MaterialBucket();
+			LODBucket* getParent(void) { return mParent; }
+			/// Get the material name
+			const String& getMaterialName(void) const { return mMaterialName; }
+			/// Assign geometry to this bucket
+			void assign(QueuedGeometry* qsm);
+			/// Build
+			void build(bool stencilShadows);
+			/// Add children to the render queue
+			void addRenderables(RenderQueue* queue, uint8 group, 
+				Real camSquaredDist);
+			/// Get the material for this bucket
+			const MaterialPtr& getMaterial(void) const { return mMaterial; }
+			/// Iterator over geometry
+			typedef VectorIterator<GeometryBucketList> GeometryIterator;
+			/// Get an iterator over the contained geometry
+			GeometryIterator getGeometryIterator(void);
+			/// Get the current Technique
+			Technique* getCurrentTechnique(void) const { return mTechnique; }
+			/// Dump contents for diagnostics
+			void dump(std::ofstream& of) const;
+		};
+		/** A LODBucket is a collection of smaller buckets with the same LOD. 
+		@remarks
+			LOD refers to Mesh LOD here. Material LOD can change separately
+			at the next bucket down from this.
+		*/
+		class _OgreExport LODBucket
+		{
+		public:
+			/// Lookup of Material Buckets in this region
+			typedef std::map<String, MaterialBucket*> MaterialBucketMap;
+		protected:
+			/// Pointer to parent region
+			Region* mParent;
+			/// LOD level (0 == full LOD)
+			unsigned short mLod;
+			/// distance at which this LOD starts to apply (squared)
+			Real mSquaredDistance;
+			/// Lookup of Material Buckets in this region
+			MaterialBucketMap mMaterialBucketMap;
+			/// Geometry queued for a single LOD (deallocated here)
+			QueuedGeometryList mQueuedGeometryList;
+		public:
+			LODBucket(Region* parent, unsigned short lod, Real lodDist);
+			virtual ~LODBucket();
+			Region* getParent(void) { return mParent; }
+			/// Get the lod index
+			ushort getLod(void) const { return mLod; }
+			/// Get the lod squared distance
+			Real getSquaredDistance(void) const { return mSquaredDistance; }
+			/// Assign a queued submesh to this bucket, using specified mesh LOD
+			void assign(QueuedSubMesh* qsm, ushort atLod);
+			/// Build
+			void build(bool stencilShadows);
+			/// Add children to the render queue
+			void addRenderables(RenderQueue* queue, uint8 group, 
+				Real camSquaredDistance);
+			/// Iterator over the materials in this LOD
+			typedef MapIterator<MaterialBucketMap> MaterialIterator;
+			/// Get an iterator over the materials in this LOD
+			MaterialIterator getMaterialIterator(void);
+			/// Dump contents for diagnostics
+			void dump(std::ofstream& of) const;
+			
+		};
+		/** The details of a topological region which is the highest level of
+			partitioning for this class.
+		@remarks
+			The size & shape of regions entirely depends on the SceneManager
+			specific implementation. It is a MovableObject since it will be
+			attached to a node based on the local centre - in practice it
+			won't actually move (although in theory it could).
+		*/
+		class _OgreExport Region : public MovableObject
+		{
+		public:
+			/// list of LOD Buckets in this region
+			typedef std::vector<LODBucket*> LODBucketList;
+		protected:
+			/** Nested class to allow region shadows. */
+			class _OgreExport RegionShadowRenderable : public ShadowRenderable
+			{
+			protected:
+				Region* mParent;
+				// Shared link to position buffer
+				HardwareVertexBufferSharedPtr mPositionBuffer;
+				// Shared link to w-coord buffer (optional)
+				HardwareVertexBufferSharedPtr mWBuffer;
+
+			public:
+				RegionShadowRenderable(Region* parent, 
+					HardwareIndexBufferSharedPtr* indexBuffer, const VertexData* vertexData, 
+					bool createSeparateLightCap, bool isLightCap = false);
+				~RegionShadowRenderable();
+				/// Overridden from ShadowRenderable
+				void getWorldTransforms(Matrix4* xform) const;
+				/// Overridden from ShadowRenderable
+				const Quaternion& getWorldOrientation(void) const;
+				/// Overridden from ShadowRenderable
+				const Vector3& getWorldPosition(void) const;
+				HardwareVertexBufferSharedPtr getPositionBuffer(void) { return mPositionBuffer; }
+				HardwareVertexBufferSharedPtr getWBuffer(void) { return mWBuffer; }
+
+			};
+			/// Parent static geometry
+			StaticGeometry* mParent;
+			/// Scene manager link
+			SceneManager* mSceneMgr;
+			/// Scene node
+			SceneNode* mNode;
+			/// Local list of queued meshes (not used for deallocation)
+			QueuedSubMeshList mQueuedSubMeshes;
+			/// Unique identifier for the region
+			uint32 mRegionID;
+			/// Center of the region
+			Vector3 mCentre;
+			/// LOD distances (squared) as built up - use the max at each level
+			std::vector<Real> mLodSquaredDistances;
+			/// Local AABB relative to region centre
+			AxisAlignedBox mAABB;
+			/// Local bounding radius
+			Real mBoundingRadius;
+			/// The current lod level, as determined from the last camera
+			ushort mCurrentLod;
+			/// Current camera distance, passed on to do material lod later
+			Real mCamDistanceSquared;
+			/// List of LOD buckets			
+			LODBucketList mLodBucketList;
+			/// List of lights for this region
+			mutable LightList mLightList;
+			/// The last frame that this light list was updated in
+			mutable ulong mLightListUpdated;
+			/// Edge list, used if stencil shadow casting is enabled 
+			EdgeData* mEdgeList;
+			/// List of shadow renderables
+			ShadowRenderableList mShadowRenderables;
+			/// Is a vertex program in use somewhere in this region?
+			bool mVertexProgramInUse;
+
+
+
+		public:
+			Region(StaticGeometry* parent, const String& name, SceneManager* mgr, 
+				uint32 regionID, const Vector3& centre);
+			virtual ~Region();
+			// more fields can be added in subclasses
+			StaticGeometry* getParent(void) const { return mParent;}
+			/// Assign a queued mesh to this region, read for final build
+			void assign(QueuedSubMesh* qmesh);
+			/// Build this region
+			void build(bool stencilShadows);
+			/// Get the region ID of this region
+			uint32 getID(void) const { return mRegionID; }
+			/// Get the centre point of the region
+			const Vector3& getCentre(void) const { return mCentre; }
+			const String& getMovableType(void) const;
+			void _notifyCurrentCamera(Camera* cam);
+			const AxisAlignedBox& getBoundingBox(void) const;
+			Real getBoundingRadius(void) const;
+			void _updateRenderQueue(RenderQueue* queue);
+			bool isVisible(void) const;
+			uint32 getTypeFlags(void) const;
+
+			typedef VectorIterator<LODBucketList> LODIterator;
+			/// Get an iterator over the LODs in this region
+			LODIterator getLODIterator(void);
+			/// @copydoc ShadowCaster::getShadowVolumeRenderableIterator
+			ShadowRenderableListIterator getShadowVolumeRenderableIterator(
+				ShadowTechnique shadowTechnique, const Light* light, 
+				HardwareIndexBufferSharedPtr* indexBuffer, 
+				bool extrudeVertices, Real extrusionDistance, unsigned long flags = 0 );
+			/// Overridden from MovableObject
+			EdgeData* getEdgeList(void);
+			/** Overridden member from ShadowCaster. */
+			bool hasEdgeList(void);
+
+			/// Dump contents for diagnostics
+			void dump(std::ofstream& of) const;
+			
+		};
+		/** Indexed region map based on packed x/y/z region index, 10 bits for
+			each axis.
+		@remarks
+			Regions are indexed 0-1023 in all axes, where for example region 
+			0 in the x axis begins at mOrigin.x + (mRegionDimensions.x * -512), 
+			and region 1023 ends at mOrigin + (mRegionDimensions.x * 512).
+		*/
+		typedef std::map<uint32, Region*> RegionMap;
+	protected:
+		// General state & settings
+		SceneManager* mOwner;
+		String mName;
+		bool mBuilt;
+		Real mUpperDistance;
+		Real mSquaredUpperDistance;
+		bool mCastShadows;
+		Vector3 mRegionDimensions;
+		Vector3 mHalfRegionDimensions;
+		Vector3 mOrigin;
+		bool mVisible;
+        /// The render queue to use when rendering this object
+        uint8 mRenderQueueID;
+		/// Flags whether the RenderQueue's default should be used.
+		bool mRenderQueueIDSet;
+
+		QueuedSubMeshList mQueuedSubMeshes;
+
+		/// List of geometry which has been optimised for SubMesh use
+		/// This is the primary storage used for cleaning up later
+		OptimisedSubMeshGeometryList mOptimisedSubMeshGeometryList;
+
+		/** Cached links from SubMeshes to (potentially optimised) geometry
+			This is not used for deletion since the lookup may reference
+			original vertex data
+		*/
+		SubMeshGeometryLookup mSubMeshGeometryLookup;
+			
+		/// Map of regions
+		RegionMap mRegionMap;
+
+		/** Virtual method for getting a region most suitable for the
+			passed in bounds. Can be overridden by subclasses.
+		*/
+		virtual Region* getRegion(const AxisAlignedBox& bounds, bool autoCreate);
+		/** Get the region within which a point lies */
+		virtual Region* getRegion(const Vector3& point, bool autoCreate);
+		/** Get the region using indexes */
+		virtual Region* getRegion(ushort x, ushort y, ushort z, bool autoCreate);
+		/** Get the region using a packed index, returns null if it doesn't exist. */
+		virtual Region* getRegion(uint32 index);
+		/** Get the region indexes for a point.
+		*/
+		virtual void getRegionIndexes(const Vector3& point, 
+			ushort& x, ushort& y, ushort& z);
+		/** Pack 3 indexes into a single index value
+		*/
+		virtual uint32 packIndex(ushort x, ushort y, ushort z);
+		/** Get the volume intersection for an indexed region with some bounds.
+		*/
+		virtual Real getVolumeIntersection(const AxisAlignedBox& box,  
+			ushort x, ushort y, ushort z);
+		/** Get the bounds of an indexed region.
+		*/
+		virtual AxisAlignedBox getRegionBounds(ushort x, ushort y, ushort z);
+		/** Get the centre of an indexed region.
+		*/
+		virtual Vector3 getRegionCentre(ushort x, ushort y, ushort z);
+		/** Calculate world bounds from a set of vertex data. */
+		virtual AxisAlignedBox calculateBounds(VertexData* vertexData, 
+			const Vector3& position, const Quaternion& orientation, 
+			const Vector3& scale);
+		/** Look up or calculate the geometry data to use for this SubMesh */
+		SubMeshLodGeometryLinkList* determineGeometry(SubMesh* sm);
+		/** Split some shared geometry into dedicated geometry. */
+		void splitGeometry(VertexData* vd, IndexData* id, 
+			SubMeshLodGeometryLink* targetGeomLink);
+
+		typedef std::map<size_t, size_t> IndexRemap;
+		/** Method for figuring out which vertices are used by an index buffer
+			and calculating a remap lookup for a vertex buffer just containing
+			those vertices. 
+		*/
+		template <typename T>
+		void buildIndexRemap(T* pBuffer, size_t numIndexes, IndexRemap& remap)
+		{
+			remap.clear();
+			for (size_t i = 0; i < numIndexes; ++i)
+			{
+				// use insert since duplicates are silently discarded
+				remap.insert(IndexRemap::value_type(*pBuffer++, remap.size()));
+				// this will have mapped oldindex -> new index IF oldindex
+				// wasn't already there
+			}
+		}
+		/** Method for altering indexes based on a remap. */
+		template <typename T>
+		void remapIndexes(T* src, T* dst, const IndexRemap& remap, 
+				size_t numIndexes)
+		{
+			for (size_t i = 0; i < numIndexes; ++i)
+			{
+				// look up original and map to target
+				IndexRemap::const_iterator ix = remap.find(*src++);
+				assert(ix != remap.end());
+				*dst++ = static_cast<T>(ix->second);
+			}
+		}
+		
+	public:
+		/// Constructor; do not use directly (@see SceneManager::createStaticGeometry)
+		StaticGeometry(SceneManager* owner, const String& name);
+		/// Destructor
+		virtual ~StaticGeometry();
+
+		/// Get the name of this object
+		const String& getName(void) const { return mName; }
+		/** Adds an Entity to the static geometry.
+		@remarks
+			This method takes an existing Entity and adds its details to the 
+			list of	elements to include when building. Note that the Entity
+			itself is not copied or referenced in this method; an Entity is 
+			passed simply so that you can change the materials of attached 
+			SubEntity objects if you want. You can add the same Entity 
+			instance multiple times with different material settings 
+			completely safely, and destroy the Entity before destroying 
+			this StaticGeometry if you like. The Entity passed in is simply 
+			used as a definition.
+		@note Must be called before 'build'.
+		@param ent The Entity to use as a definition (the Mesh and Materials 
+			referenced will be recorded for the build call).
+		@param position The world position at which to add this Entity
+		@param orientation The world orientation at which to add this Entity
+		@param scale The scale at which to add this entity
+		*/
+		virtual void addEntity(Entity* ent, const Vector3& position,
+			const Quaternion& orientation = Quaternion::IDENTITY, 
+			const Vector3& scale = Vector3::UNIT_SCALE);
+
+		/** Adds all the Entity objects attached to a SceneNode and all it's
+			children to the static geometry.
+		@remarks
+			This method performs just like addEntity, except it adds all the 
+			entities attached to an entire sub-tree to the geometry. 
+			The position / orientation / scale parameters are taken from the
+			node structure instead of being specified manually. 
+		@note
+			The SceneNode you pass in will not be automatically detached from 
+			it's parent, so if you have this node already attached to the scene
+			graph, you will need to remove it if you wish to avoid the overhead
+			of rendering <i>both</i> the original objects and their new static
+			versions! We don't do this for you incase you are preparing this 
+			in advance and so don't want the originals detached yet. 
+		@note Must be called before 'build'.
+		@param node Pointer to the node to use to provide a set of Entity 
+			templates
+		*/
+		virtual void addSceneNode(const SceneNode* node);
+
+		/** Build the geometry. 
+		@remarks
+			Based on all the entities which have been added, and the batching 
+			options which have been set, this method constructs	the batched 
+			geometry structures required. The batches are added to the scene 
+			and will be rendered unless you specifically hide them.
+		@note
+			Once you have called this method, you can no longer add any more 
+			entities.
+		*/
+		virtual void build(void);
+
+		/** Destroys all the built geometry state (reverse of build). 
+		@remarks
+			You can call build() again after this and it will pick up all the
+			same entities / nodes you queued last time.
+		*/
+		virtual void destroy(void);
+
+		/** Clears any of the entities / nodes added to this geometry and 
+			destroys anything which has already been built.
+		*/
+		virtual void reset(void);
+
+		/** Sets the distance at which batches are no longer rendered.
+		@remarks
+			This lets you turn off batches at a given distance. This can be 
+			useful for things like detail meshes (grass, foliage etc) and could
+			be combined with a shader which fades the geometry out beforehand 
+			to lessen the effect.
+		@param dist Distance beyond which the batches will not be rendered 
+			(the default is 0, which means batches are always rendered).
+		*/
+		virtual void setRenderingDistance(Real dist) { 
+			mUpperDistance = dist; 
+			mSquaredUpperDistance = mUpperDistance * mUpperDistance;
+		}
+
+		/** Gets the distance at which batches are no longer rendered. */
+		virtual Real getRenderingDistance(void) const { return mUpperDistance; }
+
+		/** Gets the squared distance at which batches are no longer rendered. */
+		virtual Real getSquaredRenderingDistance(void) const 
+		{ return mSquaredUpperDistance; }
+
+		/** Hides or shows all the batches. */
+		virtual void setVisible(bool visible);
+
+		/** Are the batches visible? */
+		virtual bool isVisible(void) const { return mVisible; }
+
+		/** Sets whether this geometry should cast shadows.
+		@remarks
+			No matter what the settings on the original entities,
+			the StaticGeometry class defaults to not casting shadows. 
+			This is because, being static, unless you have moving lights
+			you'd be better to use precalculated shadows of some sort.
+			However, if you need them, you can enable them using this
+			method. If the SceneManager is set up to use stencil shadows,
+			edge lists will be copied from the underlying meshes on build.
+			It is essential that all meshes support stencil shadows in this
+			case.
+		@note If you intend to use stencil shadows, you must set this to 
+			true before calling 'build' as well as making sure you set the
+			scene's shadow type (that should always be the first thing you do
+			anyway). You can turn shadows off temporarily but they can never 
+			be turned on if they were not at the time of the build. 
+		*/
+		virtual void setCastShadows(bool castShadows);
+		/// Will the geometry from this object cast shadows?
+		virtual bool getCastShadows(void) { return mCastShadows; }
+
+		/** Sets the size of a single region of geometry.
+		@remarks
+			This method allows you to configure the physical world size of 
+			each region, so you can balance culling against batch size. Entities
+			will be fitted within the batch they most closely fit, and the 
+			eventual bounds of each batch may well be slightly larger than this
+			if they overlap a little. The default is Vector3(1000, 1000, 1000).
+		@note Must be called before 'build'.
+		@param size Vector3 expressing the 3D size of each region.
+		*/
+		virtual void setRegionDimensions(const Vector3& size) { 
+			mRegionDimensions = size; 
+			mHalfRegionDimensions = size * 0.5;
+		}
+		/** Gets the size of a single batch of geometry. */
+		virtual const Vector3& getRegionDimensions(void) const { return mRegionDimensions; }
+		/** Sets the origin of the geometry.
+		@remarks
+			This method allows you to configure the world centre of the geometry,
+			thus the place which all regions surround. You probably don't need 
+			to mess with this unless you have a seriously large world, since the
+			default set up can handle an area 1024 * mRegionDimensions, and 
+			the sparseness of population is no issue when it comes to rendering.
+			The default is Vector3(0,0,0).
+		@note Must be called before 'build'.
+		@param size Vector3 expressing the 3D origin of the geometry.
+		*/
+		virtual void setOrigin(const Vector3& origin) { mOrigin = origin; }
+		/** Gets the origin of this geometry. */
+		virtual const Vector3& getOrigin(void) const { return mOrigin; }
+
+        /** Sets the render queue group this object will be rendered through.
+        @remarks
+            Render queues are grouped to allow you to more tightly control the ordering
+            of rendered objects. If you do not call this method, all  objects default
+            to the default queue (RenderQueue::getDefaultQueueGroup), which is fine for 
+			most objects. You may want to alter this if you want to perform more complex
+			rendering.
+        @par
+            See RenderQueue for more details.
+        @param queueID Enumerated value of the queue group to use.
+        */
+        virtual void setRenderQueueGroup(uint8 queueID);
+
+        /** Gets the queue group for this entity, see setRenderQueueGroup for full details. */
+        virtual uint8 getRenderQueueGroup(void) const;
+		
+		/// Iterator for iterating over contained regions
+		typedef MapIterator<RegionMap> RegionIterator;
+		/// Get an iterator over the regions in this geometry
+		RegionIterator getRegionIterator(void);
+
+		/** Dump the contents of this StaticGeometry to a file for diagnostic
+		 	purposes.
+		*/
+		virtual void dump(const String& filename) const;
+
+
+	};
+
+}
+
+#endif
+
Index: /OgreMain/include/OgreStdHeaders.h
===================================================================
--- /OgreMain/include/OgreStdHeaders.h	(revision 5)
+++ /OgreMain/include/OgreStdHeaders.h	(revision 5)
@@ -0,0 +1,102 @@
+#ifndef __StdHeaders_H__
+#define __StdHeaders_H__
+
+#ifdef __BORLANDC__
+    #define __STD_ALGORITHM
+#endif
+
+#if defined ( OGRE_GCC_VISIBILITY )
+/* Until libstdc++ for gcc 4.2 is released, we have to declare all
+ * symbols in libstdc++.so externally visible, otherwise we end up
+ * with them marked as hidden by -fvisible=hidden.
+ *
+ * See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20218
+ */
+#   pragma GCC visibility push(default)
+#endif
+
+#include <cassert>
+#include <cstdio>
+#include <cstdlib>
+#include <ctime>
+#include <cstring>
+#include <cstdarg>
+#include <cmath>
+
+// STL containers
+#include <vector>
+#include <map>
+#include <string>
+#include <set>
+#include <list>
+#include <deque>
+#include <queue>
+#include <bitset>
+
+// Note - not in the original STL, but exists in SGI STL and STLport
+#if (OGRE_COMPILER == OGRE_COMPILER_GNUC) && !defined(STLPORT)
+#   include <ext/hash_map>
+#   include <ext/hash_set>
+#else
+#   include <hash_set>
+#   include <hash_map>
+#endif
+
+// STL algorithms & functions
+#include <algorithm>
+#include <functional>
+#include <limits>
+
+// C++ Stream stuff
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+
+#ifdef __BORLANDC__
+namespace Ogre
+{
+    using namespace std;
+}
+#endif
+
+extern "C" {
+
+#   include <sys/types.h>
+#   include <sys/stat.h>
+
+}
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#  undef min
+#  undef max
+#  if defined( __MINGW32__ )
+#    include <unistd.h>
+#  endif
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
+extern "C" {
+
+#   include <unistd.h>
+#   include <dlfcn.h>
+
+}
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+extern "C" {
+#   include <unistd.h>
+#   include <sys/param.h>
+#   include <CoreFoundation/CoreFoundation.h>
+}
+#endif
+
+#if OGRE_THREAD_SUPPORT
+#	include <boost/thread/recursive_mutex.hpp>
+#endif
+
+#if defined ( OGRE_GCC_VISIBILITY )
+#   pragma GCC visibility pop
+#endif
+#endif
Index: /OgreMain/include/OgreString.h
===================================================================
--- /OgreMain/include/OgreString.h	(revision 5)
+++ /OgreMain/include/OgreString.h	(revision 5)
@@ -0,0 +1,165 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _String_H__
+#define _String_H__
+
+#include "OgrePrerequisites.h"
+
+// If we're using the GCC 3.1 C++ Std lib
+#if OGRE_COMPILER == OGRE_COMPILER_GNUC && OGRE_COMP_VER >= 310 && !defined(STLPORT)
+
+#include <ext/hash_map>
+namespace __gnu_cxx
+{
+    template <> struct hash< Ogre::_StringBase >
+    {
+        size_t operator()( const Ogre::_StringBase _stringBase ) const
+        {
+            /* This is the PRO-STL way, but it seems to cause problems with VC7.1
+               and in some other cases (although I can't recreate it)
+            hash<const char*> H;
+            return H(_stringBase.c_str());
+            */
+            /** This is our custom way */
+            register size_t ret = 0;
+            for( Ogre::_StringBase::const_iterator it = _stringBase.begin(); it != _stringBase.end(); ++it )
+                ret = 5 * ret + *it;
+
+            return ret;
+        }
+    };
+}
+
+#endif
+
+namespace Ogre {
+
+    /** Utility class for manipulating Strings.  */
+    class _OgreExport StringUtil
+    {
+	public:
+        typedef std::ostringstream StrStreamType;
+
+        /** Removes any whitespace characters, be it standard space or
+            TABs and so on.
+            @remarks
+                The user may specify wether they want to trim only the
+                beginning or the end of the String ( the default action is
+                to trim both).
+        */
+        static void trim( String& str, bool left = true, bool right = true );
+
+        /** Returns a StringVector that contains all the substrings delimited
+            by the characters in the passed <code>delims</code> argument.
+            @param
+                delims A list of delimiter characters to split by
+            @param
+                maxSplits The maximum number of splits to perform (0 for unlimited splits). If this
+                parameters is > 0, the splitting process will stop after this many splits, left to right.
+        */
+		static std::vector< String > split( const String& str, const String& delims = "\t\n ", unsigned int maxSplits = 0);
+
+        /** Upper-cases all the characters in the string.
+        */
+        static void toLowerCase( String& str );
+
+        /** Lower-cases all the characters in the string.
+        */
+        static void toUpperCase( String& str );
+
+
+        /** Returns whether the string begins with the pattern passed in.
+        @param pattern The pattern to compare with.
+        @param lowerCase If true, the end of the string will be lower cased before
+            comparison, pattern should also be in lower case.
+        */
+        static bool startsWith(const String& str, const String& pattern, bool lowerCase = true);
+
+        /** Returns whether the string ends with the pattern passed in.
+        @param pattern The pattern to compare with.
+        @param lowerCase If true, the end of the string will be lower cased before
+            comparison, pattern should also be in lower case.
+        */
+        static bool endsWith(const String& str, const String& pattern, bool lowerCase = true);
+
+        /** Method for standardising paths - use forward slashes only, end with slash.
+        */
+        static String standardisePath( const String &init);
+
+        /** Method for splitting a fully qualified filename into the base name
+            and path.
+        @remarks
+            Path is standardised as in standardisePath
+        */
+        static void splitFilename(const String& qualifiedName,
+            String& outBasename, String& outPath);
+
+		/** Method for splitting a fully qualified filename into the base name,
+		extension and path.
+		@remarks
+		Path is standardised as in standardisePath
+		*/
+		static void splitFullFilename(const Ogre::String& qualifiedName, 
+			Ogre::String& outBasename, Ogre::String& outExtention, 
+			Ogre::String& outPath);
+
+		/** Method for splitting a filename into the base name
+		and extension.
+		*/
+		static void splitBaseFilename(const Ogre::String& fullName, 
+			Ogre::String& outBasename, Ogre::String& outExtention);
+
+
+        /** Simple pattern-matching routine allowing a wildcard pattern.
+        @param str String to test
+        @param pattern Pattern to match against; can include simple '*' wildcards
+        @param caseSensitive Whether the match is case sensitive or not
+        */
+        static bool match(const String& str, const String& pattern, bool caseSensitive = true);
+
+
+
+
+
+        /// Constant blank string, useful for returning by ref where local does not exist
+        static const String BLANK;
+    };
+
+
+#if OGRE_COMPILER == OGRE_COMPILER_GNUC && OGRE_COMP_VER >= 310 && !defined(STLPORT)
+    typedef ::__gnu_cxx::hash< _StringBase > _StringHash;
+#elif !defined( _STLP_HASH_FUN_H )
+	typedef stdext::hash_compare< _StringBase, std::less< _StringBase > > _StringHash;
+#else
+    typedef std::hash< _StringBase > _StringHash;
+#endif
+
+} // namespace Ogre
+
+#endif // _String_H__
Index: /OgreMain/include/OgreStringConverter.h
===================================================================
--- /OgreMain/include/OgreStringConverter.h	(revision 5)
+++ /OgreMain/include/OgreStringConverter.h	(revision 5)
@@ -0,0 +1,246 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __StringConverter_H__
+#define __StringConverter_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMath.h"
+#include "OgreString.h"
+#include "OgreStringVector.h"
+
+namespace Ogre {
+
+    /** Class for converting the core Ogre data types to/from Strings.
+    @remarks
+        The code for converting values to and from strings is here as a separate
+        class to avoid coupling String to other datatypes (and vice-versa) which reduces
+        compilation dependency: important given how often the core types are used.
+    @par
+        This class is mainly used for parsing settings in text files. External applications
+        can also use it to interface with classes which use the StringInterface template
+        class.
+    @par
+        The String formats of each of the major types is listed with the methods. The basic types
+        like int and Real just use the underlying C runtime library atof and atoi family methods,
+        however custom types like Vector3, ColourValue and Matrix4 are also supported by this class
+        using custom formats.
+    @author
+        Steve Streeting
+    */
+    class _OgreExport StringConverter
+    {
+    public:
+
+        /** Converts a Real to a String. */
+        static String toString(Real val, unsigned short precision = 6, 
+            unsigned short width = 0, char fill = ' ', 
+            std::ios::fmtflags flags = std::ios::fmtflags(0) );
+        /** Converts a Radian to a String. */
+        static String toString(Radian val, unsigned short precision = 6, 
+            unsigned short width = 0, char fill = ' ', 
+            std::ios::fmtflags flags = std::ios::fmtflags(0) )
+        {
+            return toString(val.valueAngleUnits(), precision, width, fill, flags);
+        }
+        /** Converts a Degree to a String. */
+        static String toString(Degree val, unsigned short precision = 6, 
+            unsigned short width = 0, char fill = ' ', 
+            std::ios::fmtflags flags = std::ios::fmtflags(0) )
+        {
+            return toString(val.valueAngleUnits(), precision, width, fill, flags);
+        }
+        /** Converts an int to a String. */
+        static String toString(int val, unsigned short width = 0, 
+            char fill = ' ', 
+            std::ios::fmtflags flags = std::ios::fmtflags(0) );
+#if OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_64 || OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+        /** Converts an unsigned int to a String. */
+        static String toString(unsigned int val, 
+            unsigned short width = 0, char fill = ' ', 
+            std::ios::fmtflags flags = std::ios::fmtflags(0) );
+        /** Converts a size_t to a String. */
+        static String toString(size_t val, 
+            unsigned short width = 0, char fill = ' ', 
+            std::ios::fmtflags flags = std::ios::fmtflags(0) );
+        #if OGRE_COMPILER == OGRE_COMPILER_MSVC
+                /** Converts an unsigned long to a String. */
+                static String toString(unsigned long val, 
+                    unsigned short width = 0, char fill = ' ', 
+                    std::ios::fmtflags flags = std::ios::fmtflags(0) );
+
+        #endif
+#else
+        /** Converts a size_t to a String. */
+        static String toString(size_t val, 
+            unsigned short width = 0, char fill = ' ', 
+            std::ios::fmtflags flags = std::ios::fmtflags(0) );
+        /** Converts an unsigned long to a String. */
+        static String toString(unsigned long val, 
+            unsigned short width = 0, char fill = ' ', 
+            std::ios::fmtflags flags = std::ios::fmtflags(0) );
+#endif
+        /** Converts a long to a String. */
+        static String toString(long val, 
+            unsigned short width = 0, char fill = ' ', 
+            std::ios::fmtflags flags = std::ios::fmtflags(0) );
+        /** Converts a boolean to a String. 
+        @param yesNo If set to true, result is 'yes' or 'no' instead of 'true' or 'false'
+        */
+        static String toString(bool val, bool yesNo = false);
+		/** Converts a Vector2 to a String. 
+        @remarks
+            Format is "x y" (i.e. 2x Real values, space delimited)
+        */
+        static String toString(const Vector2& val);
+        /** Converts a Vector3 to a String. 
+        @remarks
+            Format is "x y z" (i.e. 3x Real values, space delimited)
+        */
+        static String toString(const Vector3& val);
+		/** Converts a Vector4 to a String. 
+        @remarks
+            Format is "x y z w" (i.e. 4x Real values, space delimited)
+        */
+        static String toString(const Vector4& val);
+        /** Converts a Matrix3 to a String. 
+        @remarks
+            Format is "00 01 02 10 11 12 20 21 22" where '01' means row 0 column 1 etc.
+        */
+        static String toString(const Matrix3& val);
+        /** Converts a Matrix4 to a String. 
+        @remarks
+            Format is "00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33" where 
+            '01' means row 0 column 1 etc.
+        */
+        static String toString(const Matrix4& val);
+        /** Converts a Quaternion to a String. 
+        @remarks
+            Format is "w x y z" (i.e. 4x Real values, space delimited)
+        */
+        static String toString(const Quaternion& val);
+        /** Converts a ColourValue to a String. 
+        @remarks
+            Format is "r g b a" (i.e. 4x Real values, space delimited). 
+        */
+        static String toString(const ColourValue& val);
+        /** Converts a StringVector to a string.
+        @remarks
+            Strings must not contain spaces since space is used as a delimeter in
+            the output.
+        */
+        static String toString(const StringVector& val);
+
+        /** Converts a String to a Real. 
+        @returns
+            0.0 if the value could not be parsed, otherwise the Real version of the String.
+        */
+        static Real parseReal(const String& val);
+        /** Converts a String to a Angle. 
+        @returns
+            0.0 if the value could not be parsed, otherwise the Angle version of the String.
+        */
+        static inline Radian parseAngle(const String& val) {
+			return Angle(parseReal(val));
+		}
+        /** Converts a String to a whole number. 
+        @returns
+            0.0 if the value could not be parsed, otherwise the numeric version of the String.
+        */
+        static int parseInt(const String& val);
+        /** Converts a String to a whole number. 
+        @returns
+            0.0 if the value could not be parsed, otherwise the numeric version of the String.
+        */
+        static unsigned int parseUnsignedInt(const String& val);
+        /** Converts a String to a whole number. 
+        @returns
+            0.0 if the value could not be parsed, otherwise the numeric version of the String.
+        */
+        static long parseLong(const String& val);
+        /** Converts a String to a whole number. 
+        @returns
+            0.0 if the value could not be parsed, otherwise the numeric version of the String.
+        */
+        static unsigned long parseUnsignedLong(const String& val);
+        /** Converts a String to a boolean. 
+        @remarks
+            Returns true if case-insensitive match of the start of the string
+			matches "true", "yes" or "1", false otherwise.
+        */
+        static bool parseBool(const String& val);
+        /** Parses a Vector3 out of a String.
+        @remarks
+            Format is "x y z" ie. 3 Real components, space delimited. Failure to parse returns
+            Vector3::ZERO.
+        */
+        static Vector3 parseVector3(const String& val);
+        /** Parses a Matrix3 out of a String.
+        @remarks
+            Format is "00 01 02 10 11 12 20 21 22" where '01' means row 0 column 1 etc.
+            Failure to parse returns Matrix3::IDENTITY.
+        */
+        static Matrix3 parseMatrix3(const String& val);
+        /** Parses a Matrix4 out of a String.
+        @remarks
+            Format is "00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33" where 
+            '01' means row 0 column 1 etc. Failure to parse returns Matrix4::IDENTITY.
+        */
+        static Matrix4 parseMatrix4(const String& val);
+        /** Parses a Quaternion out of a String. 
+        @remarks
+            Format is "w x y z" (i.e. 4x Real values, space delimited). 
+            Failure to parse returns Quaternion::IDENTITY.
+
+        */
+        static Quaternion parseQuaternion(const String& val);
+        /** Parses a ColourValue out of a String. 
+        @remarks
+            Format is "r g b a" (i.e. 4x Real values, space delimited), or "r g b" which implies
+            an alpha value of 1.0 (opaque). Failure to parse returns ColourValue::Black.
+        */
+        static ColourValue parseColourValue(const String& val);
+
+        /** Pareses a StringVector from a string.
+        @remarks
+            Strings must not contain spaces since space is used as a delimeter in
+            the output.
+        */
+        static StringVector parseStringVector(const String& val);
+        /** Checks the String is a valid number value. */
+        static bool isNumber(const String& val);
+    };
+
+
+}
+
+
+
+#endif
+
Index: /OgreMain/include/OgreStringInterface.h
===================================================================
--- /OgreMain/include/OgreStringInterface.h	(revision 5)
+++ /OgreMain/include/OgreStringInterface.h	(revision 5)
@@ -0,0 +1,332 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __StringInterface_H__
+#define __StringInterface_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include "OgreCommon.h"
+
+namespace Ogre {
+
+
+    /// List of parameter types available
+    enum ParameterType
+    {
+        PT_BOOL,
+        PT_REAL,
+        PT_INT,
+        PT_UNSIGNED_INT,
+        PT_SHORT,
+        PT_UNSIGNED_SHORT,
+        PT_LONG,
+        PT_UNSIGNED_LONG,
+        PT_STRING,
+        PT_VECTOR3,
+        PT_MATRIX3,
+        PT_MATRIX4,
+        PT_QUATERNION,
+        PT_COLOURVALUE
+    };
+
+    /// Definition of a parameter supported by a StringInterface class, for introspection
+    class _OgreExport ParameterDef
+    {
+    public:
+        String name;
+        String description;
+        ParameterType paramType;
+        ParameterDef(const String& newName, const String& newDescription, ParameterType newType)
+            : name(newName), description(newDescription), paramType(newType) {}
+    };
+    typedef std::vector<ParameterDef> ParameterList;
+
+    /** Abstract class which is command object which gets/sets parameters.*/
+    class _OgreExport ParamCommand
+    {
+    public:
+        virtual String doGet(const void* target) const = 0;
+        virtual void doSet(void* target, const String& val) = 0;
+
+        virtual ~ParamCommand() { }
+    };
+    typedef std::map<String, ParamCommand* > ParamCommandMap;
+
+    /** Class to hold a dictionary of parameters for a single class. */
+    class _OgreExport ParamDictionary
+    {
+        friend class StringInterface;
+    protected:
+        /// Definitions of parameters
+        ParameterList mParamDefs;
+
+        /// Command objects to get/set
+        ParamCommandMap mParamCommands;
+
+        /** Retrieves the parameter command object for a named parameter. */
+        ParamCommand* getParamCommand(const String& name)
+        {
+            ParamCommandMap::iterator i = mParamCommands.find(name);
+            if (i != mParamCommands.end())
+            {
+                return i->second;
+            }
+            else
+            {
+                return 0;
+            }
+        }
+
+		const ParamCommand* getParamCommand(const String& name) const
+        {
+            ParamCommandMap::const_iterator i = mParamCommands.find(name);
+            if (i != mParamCommands.end())
+            {
+                return i->second;
+            }
+            else
+            {
+                return 0;
+            }
+        }
+    public:
+        ParamDictionary()  {}
+        /** Method for adding a parameter definition for this class. 
+        @param paramDef A ParameterDef object defining the parameter
+        @param paramCmd Pointer to a ParamCommand subclass to handle the getting / setting of this parameter.
+            NB this class will not destroy this on shutdown, please ensure you do
+
+        */
+        void addParameter(const ParameterDef& paramDef, ParamCommand* paramCmd)
+        {
+            mParamDefs.push_back(paramDef);
+            mParamCommands[paramDef.name] = paramCmd;
+        }
+        /** Retrieves a list of parameters valid for this object. 
+        @returns
+            A reference to a static list of ParameterDef objects.
+
+        */
+        const ParameterList& getParameters(void) const
+        {
+            return mParamDefs;
+        }
+
+
+
+    };
+    typedef std::map<String, ParamDictionary> ParamDictionaryMap;
+    
+    /** Class defining the common interface which classes can use to 
+        present a reflection-style, self-defining parameter set to callers.
+    @remarks
+        This class also holds a static map of class name to parameter dictionaries
+        for each subclass to use. See ParamDictionary for details. 
+    @remarks
+        In order to use this class, each subclass must call createParamDictionary in their constructors
+        which will create a parameter dictionary for the class if it does not exist yet.
+    */
+    class _OgreExport StringInterface 
+    {
+    protected:
+
+        /// Dictionary of parameters
+        static ParamDictionaryMap msDictionary;
+
+        /// Class name for this instance to be used as a lookup (must be initialised by subclasses)
+        String mParamDictName;
+
+        /** Internal method for creating a parameter dictionary for the class, if it does not already exist.
+        @remarks
+            This method will check to see if a parameter dictionary exist for this class yet,
+            and if not will create one. NB you must supply the name of the class (RTTI is not 
+            used or performance).
+        @param
+            className the name of the class using the dictionary
+        @returns
+            true if a new dictionary was created, false if it was already there
+        */
+        bool createParamDictionary(const String& className)
+        {
+            mParamDictName = className;
+            if (msDictionary.find(className) == msDictionary.end())
+            {
+                msDictionary[className] = ParamDictionary();
+                return true;
+            }
+            return false;
+
+        }
+
+    public:
+
+        /** Virtual desctructor, see Effective C++ */
+        virtual ~StringInterface() {}
+
+        /** Retrieves the parameter dictionary for this class. 
+        @remarks
+            Only valid to call this after createParamDictionary.
+        @returns
+            Pointer to ParamDictionary shared by all instances of this class
+            which you can add parameters to, retrieve parameters etc.
+        */
+        ParamDictionary* getParamDictionary(void)
+        {
+            ParamDictionaryMap::iterator i = msDictionary.find(mParamDictName);
+            if (i != msDictionary.end())
+            {
+                return &(i->second);
+            }
+            else
+            {
+                return 0;
+            }
+        }
+
+		const ParamDictionary* getParamDictionary(void) const
+        {
+            ParamDictionaryMap::const_iterator i = msDictionary.find(mParamDictName);
+            if (i != msDictionary.end())
+            {
+                return &(i->second);
+            }
+            else
+            {
+                return 0;
+            }
+        }
+
+        /** Retrieves a list of parameters valid for this object. 
+        @returns
+            A reference to a static list of ParameterDef objects.
+
+        */
+        const ParameterList& getParameters(void) const;
+
+        /** Generic parameter setting method.
+        @remarks
+            Call this method with the name of a parameter and a string version of the value
+            to set. The implementor will convert the string to a native type internally.
+            If in doubt, check the parameter definition in the list returned from 
+            StringInterface::getParameters.
+        @param
+            name The name of the parameter to set
+        @param
+            value String value. Must be in the right format for the type specified in the parameter definition.
+            See the StringConverter class for more information.
+        @returns
+            true if set was successful, false otherwise (NB no exceptions thrown - tolerant method)
+        */
+        virtual bool setParameter(const String& name, const String& value);
+        /** Generic multiple parameter setting method.
+        @remarks
+            Call this method with a list of name / value pairs
+            to set. The implementor will convert the string to a native type internally.
+            If in doubt, check the parameter definition in the list returned from 
+            StringInterface::getParameters.
+        @param
+            paramList Name/value pair list
+        */
+        virtual void setParameterList(const NameValuePairList& paramList);
+        /** Generic parameter retrieval method.
+        @remarks
+            Call this method with the name of a parameter to retrieve a string-format value of
+            the parameter in question. If in doubt, check the parameter definition in the
+            list returned from getParameters for the type of this parameter. If you
+            like you can use StringConverter to convert this string back into a native type.
+        @param
+            name The name of the parameter to get
+        @returns
+            String value of parameter, blank if not found
+        */
+        virtual String getParameter(const String& name) const
+        {
+            // Get dictionary
+            const ParamDictionary* dict = getParamDictionary();
+
+            if (dict)
+            {
+                // Look up command object
+                const ParamCommand* cmd = dict->getParamCommand(name);
+
+                if (cmd)
+                {
+                    return cmd->doGet(this);
+                }
+            }
+
+            // Fallback
+            return "";
+        }
+        /** Method for copying this object's parameters to another object.
+        @remarks
+            This method takes the values of all the object's parameters and tries to set the
+            same values on the destination object. This provides a completely type independent
+            way to copy parameters to other objects. Note that because of the String manipulation 
+            involved, this should not be regarded as an efficient process and should be saved for
+            times outside of the rendering loop.
+        @par
+            Any unrecognised parameters will be ignored as with setParameter method.
+        @param dest Pointer to object to have it's parameters set the same as this object.
+
+        */
+        virtual void copyParametersTo(StringInterface* dest) const
+        {
+            // Get dictionary
+            const ParamDictionary* dict = getParamDictionary();
+
+            if (dict)
+            {
+                // Iterate through own parameters
+                ParameterList::const_iterator i;
+            
+                for (i = dict->mParamDefs.begin(); 
+                i != dict->mParamDefs.end(); ++i)
+                {
+                    dest->setParameter(i->name, getParameter(i->name));
+                }
+            }
+
+
+        }
+
+        /** Cleans up the static 'msDictionary' required to reset Ogre,
+        otherwise the containers are left with invalid pointers, which will lead to a crash
+        as soon as one of the ResourceManager implementers (e.g. MaterialManager) initializes.*/
+        static void cleanupDictionary () ;
+
+    };
+
+
+
+}
+
+#endif
+
Index: /OgreMain/include/OgreStringVector.h
===================================================================
--- /OgreMain/include/OgreStringVector.h	(revision 5)
+++ /OgreMain/include/OgreStringVector.h	(revision 5)
@@ -0,0 +1,45 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _StringVector_H__
+#define _StringVector_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreString.h"
+#include "OgreSharedPtr.h"
+
+
+namespace Ogre {
+
+    typedef std::vector<String> StringVector;
+    typedef SharedPtr<StringVector> StringVectorPtr;
+
+}
+
+#endif
Index: /OgreMain/include/OgreSubEntity.h
===================================================================
--- /OgreMain/include/OgreSubEntity.h	(revision 5)
+++ /OgreMain/include/OgreSubEntity.h	(revision 5)
@@ -0,0 +1,230 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __SubEntity_H__
+#define __SubEntity_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreString.h"
+#include "OgreRenderable.h"
+#include "OgreHardwareBufferManager.h"
+
+namespace Ogre {
+
+    /** Utility class which defines the sub-parts of an Entity.
+        @remarks
+            Just as meshes are split into submeshes, an Entity is made up of
+            potentially multiple SubMeshes. These are mainly here to provide the
+            link between the Material which the SubEntity uses (which may be the
+            default Material for the SubMesh or may have been changed for this
+            object) and the SubMesh data.
+        @par
+            The SubEntity also allows the application some flexibility in the
+            material properties for this section of a particular instance of this
+            Mesh, e.g. tinting the windows on a car model.
+        @par
+            SubEntity instances are never created manually. They are created at
+            the same time as their parent Entity by the SceneManager method
+            createEntity.
+    */
+    class _OgreExport SubEntity: public Renderable
+    {
+        // Note no virtual functions for efficiency
+        friend class Entity;
+        friend class SceneManager;
+    protected:
+        /** Private constructor - don't allow creation by anybody else.
+        */
+        SubEntity(Entity* parent, SubMesh* subMeshBasis);
+
+        /** Private destructor.
+        */
+        virtual ~SubEntity();
+
+        /// Pointer to parent.
+        Entity* mParentEntity;
+
+        /// Name of Material in use by this SubEntity.
+        String mMaterialName;
+
+        /// Cached pointer to material.
+        MaterialPtr mpMaterial;
+
+        // Pointer to the SubMesh defining geometry.
+        SubMesh* mSubMesh;
+
+        /// Is this SubEntity visible?
+        bool mVisible;
+
+		/// The LOD number of the material to use, calculated by Entity::_notifyCurrentCamera
+		unsigned short mMaterialLodIndex;
+
+        /// blend buffer details for dedicated geometry
+        VertexData* mSkelAnimVertexData;
+        /// Quick lookup of buffers
+        TempBlendedBufferInfo mTempSkelAnimInfo;
+		/// Temp buffer details for software Vertex anim geometry
+		TempBlendedBufferInfo mTempVertexAnimInfo;
+		/// Vertex data details for software Vertex anim of shared geometry
+		VertexData* mSoftwareVertexAnimVertexData;
+		/// Vertex data details for hardware Vertex anim of shared geometry
+		/// - separate since we need to s/w anim for shadows whilst still altering
+		///   the vertex data for hardware morphing (pos2 binding)
+		VertexData* mHardwareVertexAnimVertexData;
+		/// Have we applied any vertex animation to geometry?
+		bool mVertexAnimationAppliedThisFrame;
+		/// Number of hardware blended poses supported by material
+		ushort mHardwarePoseCount;
+		/// Cached distance to last camera for getSquaredViewDepth
+		mutable Real mCachedCameraDist;
+		/// The camera for which the cached distance is valid
+		mutable const Camera *mCachedCamera;
+
+        /** Internal method for preparing this Entity for use in animation. */
+        void prepareTempBlendBuffers(void);
+
+    public:
+        /** Gets the name of the Material in use by this instance.
+        */
+        const String& getMaterialName() const;
+
+        /** Sets the name of the Material to be used.
+            @remarks
+                By default a SubEntity uses the default Material that the SubMesh
+                uses. This call can alter that so that the Material is different
+                for this instance.
+        */
+        void setMaterialName( const String& name );
+
+        /** Tells this SubEntity whether to be visible or not. */
+        virtual void setVisible(bool visible);
+
+        /** Returns whether or not this SubEntity is supposed to be visible. */
+        virtual bool isVisible(void) const;
+
+        /** Accessor method to read mesh data.
+        */
+        SubMesh* getSubMesh(void);
+
+		/** Accessor to get parent Entity */
+		Entity* getParent(void) const { return mParentEntity; }
+
+        /** Overridden - see Renderable.
+        */
+        const MaterialPtr& getMaterial(void) const;
+
+        /** Overridden - see Renderable.
+        */
+        Technique* getTechnique(void) const;
+
+        /** Overridden - see Renderable.
+        */
+        void getRenderOperation(RenderOperation& op);
+
+        /** Overridden - see Renderable.
+        */
+        void getWorldTransforms(Matrix4* xform) const;
+        /** @copydoc Renderable::getWorldOrientation */
+        const Quaternion& getWorldOrientation(void) const;
+        /** @copydoc Renderable::getWorldPosition */
+        const Vector3& getWorldPosition(void) const;
+        /** Overridden - see Renderable.
+        */
+        bool getNormaliseNormals(void) const;      
+        /** Overridden - see Renderable.
+        */
+        unsigned short getNumWorldTransforms(void) const;
+        /** Overridden, see Renderable */
+        Real getSquaredViewDepth(const Camera* cam) const;
+        /** @copydoc Renderable::getLights */
+        const LightList& getLights(void) const;
+        /** @copydoc Renderable::getCastsShadows */
+        bool getCastsShadows(void) const;
+		/** Advanced method to get the temporarily blended vertex information
+		for entities which are software skinned. 
+        @remarks
+            Internal engine will eliminate software animation if possible, this
+            information is unreliable unless added request for software animation
+            via Entity::addSoftwareAnimationRequest.
+        @note
+            The positions/normals of the returned vertex data is in object space.
+		*/
+		VertexData* _getSkelAnimVertexData(void);
+		/** Advanced method to get the temporarily blended software morph vertex information
+        @remarks
+            Internal engine will eliminate software animation if possible, this
+            information is unreliable unless added request for software animation
+            via Entity::addSoftwareAnimationRequest.
+        @note
+            The positions/normals of the returned vertex data is in object space.
+		*/
+		VertexData* _getSoftwareVertexAnimVertexData(void);
+		/** Advanced method to get the hardware morph vertex information
+        @note
+            The positions/normals of the returned vertex data is in object space.
+		*/
+		VertexData* _getHardwareVertexAnimVertexData(void);
+		/** Advanced method to get the temp buffer information for software 
+		skeletal animation.
+		*/
+		TempBlendedBufferInfo* _getSkelAnimTempBufferInfo(void);
+		/** Advanced method to get the temp buffer information for software 
+		morph animation.
+		*/
+		TempBlendedBufferInfo* _getVertexAnimTempBufferInfo(void);
+		/// Retrieve the VertexData which should be used for GPU binding
+		VertexData* getVertexDataForBinding(void);
+
+		/** Mark all vertex data as so far unanimated. 
+		*/
+		void _markBuffersUnusedForAnimation(void);
+		/** Mark all vertex data as animated. 
+		*/
+		void _markBuffersUsedForAnimation(void);
+		/** Are buffers already marked as vertex animated? */
+		bool _getBuffersMarkedForAnimation(void) const { return mVertexAnimationAppliedThisFrame; }
+		/** Internal method to copy original vertex data to the morph structures
+		should there be no active animation in use.
+		*/
+		void _restoreBuffersForUnusedAnimation(bool hardwareAnimation);
+
+		/** Overridden from Renderble to provide some custom behaviour. */
+		void _updateCustomGpuParameter(
+			const GpuProgramParameters::AutoConstantEntry& constantEntry,
+			GpuProgramParameters* params) const;
+
+		/** Invalidate the camera distance cache */
+		void _invalidateCameraCache ()
+		{ mCachedCamera = 0; }
+    };
+
+}
+
+
+#endif
Index: /OgreMain/include/OgreSubMesh.h
===================================================================
--- /OgreMain/include/OgreSubMesh.h	(revision 5)
+++ /OgreMain/include/OgreSubMesh.h	(revision 5)
@@ -0,0 +1,267 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __SubMesh_H_
+#define __SubMesh_H_
+
+#include "OgrePrerequisites.h"
+
+#include "OgreVertexIndexData.h"
+#include "OgreMaterial.h"
+#include "OgreRenderOperation.h"
+#include "OgreVertexBoneAssignment.h"
+#include "OgreProgressiveMesh.h"
+#include "OgreAnimationTrack.h"
+
+namespace Ogre {
+
+    /** Defines a part of a complete mesh.
+        @remarks
+            Meshes which make up the definition of a discrete 3D object
+            are made up of potentially multiple parts. This is because
+            different parts of the mesh may use different materials or
+            use different vertex formats, such that a rendering state
+            change is required between them.
+        @par
+            Like the Mesh class, instatiations of 3D objects in the scene
+            share the SubMesh instances, and have the option of overriding
+            their material differences on a per-object basis if required.
+            See the SubEntity class for more information.
+    */
+    class _OgreExport SubMesh
+    {
+        friend class Mesh;
+        friend class MeshSerializerImpl;
+        friend class MeshSerializerImpl_v1_2;
+        friend class MeshSerializerImpl_v1_1;
+    public:
+        SubMesh();
+        ~SubMesh();
+
+
+        /// Indicates if this submesh shares vertex data with other meshes or whether it has it's own vertices.
+        bool useSharedVertices;
+
+        /// The render operation type used to render this submesh
+        RenderOperation::OperationType operationType;
+
+        /** Dedicated vertex data (only valid if useSharedVertices = false).
+            @remarks
+                This data is completely owned by this submesh.
+            @par
+                The use of shared or non-shared buffers is determined when
+                model data is converted to the OGRE .mesh format.
+        */
+        VertexData *vertexData;
+
+        /// Face index data
+        IndexData *indexData;
+
+        /** Dedicated index map for translate blend index to bone index (only valid if useSharedVertices = false).
+            @remarks
+                This data is completely owned by this submesh.
+            @par
+                We collect actually used bones of all bone assignments, and build the
+                blend index in 'packed' form, then the range of the blend index in vertex
+                data VES_BLEND_INDICES element is continuous, with no gaps. Thus, by
+                minimising the world matrix array constants passing to GPU, we can support
+                more bones for a mesh when hardware skinning is used. The hardware skinning
+                support limit is applied to each set of vertex data in the mesh, in other words, the
+                hardware skinning support limit is applied only to the actually used bones of each
+                SubMeshes, not all bones across the entire Mesh.
+            @par
+                Because the blend index is different to the bone index, therefore, we use
+                the index map to translate the blend index to bone index.
+            @par
+                The use of shared or non-shared index map is determined when
+                model data is converted to the OGRE .mesh format.
+        */
+        typedef std::vector<unsigned short> IndexMap;
+        IndexMap blendIndexToBoneIndexMap;
+
+        ProgressiveMesh::LODFaceList mLodFaceList;
+
+        /** A list of extreme points on the submesh (optional).
+            @remarks
+                These points are some arbitrary points on the mesh that are used
+                by engine to better sort submeshes by depth. This doesn't matter
+                much for non-transparent submeshes, as Z-buffer takes care of invisible
+                surface culling anyway, but is pretty useful for semi-transparent
+                submeshes because the order in which transparent submeshes must be
+                rendered cannot be always correctly deduced from entity position.
+            @par
+                These points are intelligently chosen from the points that make up
+                the submesh, the criteria for choosing them should be that these points
+                somewhat characterize the submesh outline, e.g. they should not be
+                close to each other, and they should be on the outer hull of the submesh.
+                They can be stored in the .mesh file, or generated at runtime
+                (see generateExtremes ()).
+            @par
+                If this array is empty, submesh sorting is done like in older versions -
+                by comparing the positions of the owning entity.
+         */
+        std::vector<Vector3> extremityPoints;
+
+        /// Reference to parent Mesh (not a smart pointer so child does not keep parent alive).
+        Mesh* parent;
+
+        /// Sets the name of the Material which this SubMesh will use
+        void setMaterialName(const String& matName);
+        const String& getMaterialName(void) const;
+
+        /** Returns true if a material has been assigned to the submesh, otherwise returns false.
+        */
+        bool isMatInitialised(void) const;
+
+        /** Returns a RenderOperation structure required to render this mesh.
+            @param 
+                rend Reference to a RenderOperation structure to populate.
+            @param
+                lodIndex The index of the LOD to use. 
+        */
+        void _getRenderOperation(RenderOperation& rend, ushort lodIndex = 0);
+
+        /** Assigns a vertex to a bone with a given weight, for skeletal animation. 
+        @remarks    
+            This method is only valid after calling setSkeletonName.
+            Since this is a one-off process there exists only 'addBoneAssignment' and
+            'clearBoneAssignments' methods, no 'editBoneAssignment'. You should not need
+            to modify bone assignments during rendering (only the positions of bones) and OGRE
+            reserves the right to do some internal data reformatting of this information, depending
+            on render system requirements.
+        @par
+            This method is for assigning weights to the dedicated geometry of the SubMesh. To assign
+            weights to the shared Mesh geometry, see the equivalent methods on Mesh.
+        */
+        void addBoneAssignment(const VertexBoneAssignment& vertBoneAssign);
+
+        /** Removes all bone assignments for this mesh. 
+        @par
+            This method is for assigning weights to the dedicated geometry of the SubMesh. To assign
+            weights to the shared Mesh geometry, see the equivalent methods on Mesh.
+        */
+        void clearBoneAssignments(void);
+
+        /// Multimap of verex bone assignments (orders by vertex index)
+        typedef std::multimap<size_t, VertexBoneAssignment> VertexBoneAssignmentList;
+        typedef MapIterator<VertexBoneAssignmentList> BoneAssignmentIterator;
+
+        /** Gets an iterator for access all bone assignments. 
+        @remarks
+            Only valid if this SubMesh has dedicated geometry.
+        */
+        BoneAssignmentIterator getBoneAssignmentIterator(void);
+
+        /** Must be called once to compile bone assignments into geometry buffer. */
+        void _compileBoneAssignments(void);
+
+        typedef ConstMapIterator<AliasTextureNamePairList> AliasTextureIterator;
+        /** Gets an constant iterator to access all texture alias names assigned to this submesh. 
+
+        */
+        AliasTextureIterator getAliasTextureIterator(void) const;
+        /** Adds the alias or replaces an existing one and associates the texture name to it.
+        @remarks
+          The submesh uses the texture alias to replace textures used in the material applied
+          to the submesh.
+        @param
+            aliasName is the name of the alias.
+        @param
+            textureName is the name of the texture to be associated with the alias
+
+        */
+        void addTextureAlias(const String& aliasName, const String& textureName);
+        /** Remove a specific texture alias name from the sub mesh
+        @param
+            aliasName is the name of the alias to be removed.  If it is not found 
+            then it is ignored.
+        */
+        void removeTextureAlias(const String& aliasName);
+        /** removes all texture aliases from the sub mesh
+        */
+        void removeAllTextureAliases(void);
+        /** returns true if the sub mesh has texture aliases
+        */
+        bool hasTextureAliases(void) const { return !mTextureAliases.empty(); }
+        /** Gets the number of texture aliases assigned to the sub mesh.
+        */
+        size_t getTextureAliasCount(void) const { return mTextureAliases.size(); }
+
+        /**  The current material used by the submesh is copied into a new material
+            and the submesh's texture aliases are applied if the current texture alias
+            names match those found in the original material.
+        @remarks
+            The submesh's texture aliases must be setup prior to calling this method.
+            If a new material has to be created, the subMesh autogenerates the new name.
+            The new name is the old name + "_" + number.
+        @return 
+            True if texture aliases were applied and a new material was created.
+        */
+        bool updateMaterialUsingTextureAliases(void);
+
+		/** Get the type of any vertex animation used by dedicated geometry.
+		*/
+		VertexAnimationType getVertexAnimationType(void) const;
+
+        /** Generate the submesh extremes (@see extremityPoints).
+        @param count
+            Number of extreme points to compute for the submesh.
+        */
+        void generateExtremes(size_t count);
+
+    protected:
+
+        /// Name of the material this SubMesh uses.
+        String mMaterialName;
+
+        /// Is there a material yet?
+        bool mMatInitialised;
+
+        /// paired list of texture aliases and texture names
+        AliasTextureNamePairList mTextureAliases;
+
+        VertexBoneAssignmentList mBoneAssignments;
+
+        /// Flag indicating that bone assignments need to be recompiled
+        bool mBoneAssignmentsOutOfDate;
+
+		/// Type of vertex animation for dedicated vertex data (populated by Mesh)
+		mutable VertexAnimationType mVertexAnimationType;
+
+
+        /// Internal method for removing LOD data
+        void removeLodLevels(void);
+
+
+
+    };
+
+} // namespace
+
+#endif
+
Index: /OgreMain/include/OgreTagPoint.h
===================================================================
--- /OgreMain/include/OgreTagPoint.h	(revision 5)
+++ /OgreMain/include/OgreTagPoint.h	(revision 5)
@@ -0,0 +1,116 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __TagPoint_H_
+#define __TagPoint_H_
+
+#include "OgrePrerequisites.h"
+
+#include "OgreBone.h"
+#include "OgreMatrix4.h"
+
+namespace Ogre	{
+
+
+	
+    /** A tagged point on a skeleton, which can be used to attach entities to on specific
+        other entities.
+    @remarks
+        A Skeleton, like a Mesh, is shared between Entity objects and simply updated as required
+        when it comes to rendering. However there are times when you want to attach another object
+        to an animated entity, and make sure that attachment follows the parent entity's animation
+        (for example, a character holding a gun in his / her hand). This class simply identifies
+        attachment points on a skeleton which can be used to attach child objects. 
+    @par
+        The child objects themselves are not physically attached to this class; as it's name suggests
+        this class just 'tags' the area. The actual child objects are attached to the Entity using the
+        skeleton which has this tag point. Use the Entity::attachMovableObjectToBone method to attach
+        the objects, which creates a new TagPoint on demand.
+    */
+    class _OgreExport TagPoint : public Bone
+	{
+
+	public:
+		TagPoint(unsigned short handle, Skeleton* creator);
+		virtual ~TagPoint();
+
+		Entity *getParentEntity(void) const;
+        MovableObject* getChildObject(void) const;
+		
+		void setParentEntity(Entity *pEntity);
+		void setChildObject(MovableObject *pObject);
+
+        /** Tells the TagPoint whether it should inherit orientation from it's parent entity.
+        @param inherit If true, this TagPoint's orientation will be affected by
+            its parent entity's orientation. If false, it will not be affected.
+        */
+        void setInheritParentEntityOrientation(bool inherit);
+
+        /** Returns true if this TagPoint is affected by orientation applied to the parent entity. 
+        */
+        bool getInheritParentEntityOrientation(void) const;
+
+        /** Tells the TagPoint whether it should inherit scaling factors from it's parent entity.
+        @param inherit If true, this TagPoint's scaling factors will be affected by
+            its parent entity's scaling factors. If false, it will not be affected.
+        */
+        void setInheritParentEntityScale(bool inherit);
+
+        /** Returns true if this TagPoint is affected by scaling factors applied to the parent entity. 
+        */
+        bool getInheritParentEntityScale(void) const;
+
+		/** Gets the transform of parent entity. */
+		const Matrix4& getParentEntityTransform(void) const;
+
+        /** Gets the transform of this node just for the skeleton (not entity) */
+		const Matrix4& _getFullLocalTransform(void) const;
+
+        /** @copydoc Node::needUpdate */
+        void needUpdate(bool forceParentUpdate = false);
+
+        /** Overridden from Node in order to include parent Entity transform. */
+        void updateFromParentImpl(void) const;
+        /** @copydoc Renderable::getLights */
+        const LightList& getLights(void) const;
+
+
+
+	private:
+		Entity *mParentEntity;
+		MovableObject *mChildObject;
+        mutable Matrix4 mFullLocalTransform;
+        bool mInheritParentEntityOrientation;
+        bool mInheritParentEntityScale;
+	};
+
+
+} //namespace
+
+
+#endif//__TagPoint_H_
Index: /OgreMain/include/OgreTechnique.h
===================================================================
--- /OgreMain/include/OgreTechnique.h	(revision 5)
+++ /OgreMain/include/OgreTechnique.h	(revision 5)
@@ -0,0 +1,488 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Technique_H__
+#define __Technique_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreBlendMode.h"
+#include "OgreCommon.h"
+#include "OgrePass.h"
+
+namespace Ogre {
+    /** Class representing an approach to rendering this particular Material. 
+    @remarks
+        Ogre will attempt to use the best technique supported by the active hardware, 
+        unless you specifically request a lower detail technique (say for distant
+        rendering).
+    */
+    class _OgreExport Technique
+    {
+    protected:
+        // illumination pass state type
+        enum IlluminationPassesState
+        {
+            IPS_COMPILE_DISABLED = -1,
+            IPS_NOT_COMPILED = 0,
+            IPS_COMPILED = 1
+        };
+
+        typedef std::vector<Pass*> Passes;
+        /// List of primary passes
+        Passes mPasses;
+        /// List of derived passes, categorised into IlluminationStage (ordered)
+        IlluminationPassList mIlluminationPasses;
+        Material* mParent; // raw pointer since we don't want child to stop parent's destruction
+        bool mIsSupported;
+        IlluminationPassesState mIlluminationPassesCompilationPhase;
+		/// LOD level
+        unsigned short mLodIndex;
+		/** Scheme index, derived from scheme name but the names are held on
+			MaterialManager, for speed an index is used here.
+		*/
+		unsigned short mSchemeIndex;
+        String mName; // optional name for the technique
+
+        /// Internal method for clearing illumination pass list
+        void clearIlluminationPasses(void);
+    public:
+        /// Constructor
+        Technique(Material* parent);
+        /// Copy constructor
+        Technique(Material* parent, const Technique& oth);
+        ~Technique();
+        /** Indicates if this technique is supported by the current graphics card.
+        @remarks
+            This will only be correct after the Technique has been compiled, which is
+            usually done from Material::compile.
+        */
+        bool isSupported(void) const;
+        /** Internal compilation method; see Material::compile. 
+		@returns Any information explaining problems with the compile.
+		*/
+        String _compile(bool autoManageTextureUnits);
+        /** Internal method for splitting the passes into illumination passes. */        
+        void _compileIlluminationPasses(void);
+
+
+        /** Creates a new Pass for this Technique.
+        @remarks
+            A Pass is a single rendering pass, ie a single draw of the given material.
+            Note that if you create a pass without a fragment program, during compilation of the
+            material the pass may be split into multiple passes if the graphics card cannot
+            handle the number of texture units requested. For passes with fragment programs, however, 
+            the number of passes you create will never be altered, so you have to make sure 
+            that you create an alternative fallback Technique for if a card does not have 
+            enough facilities for what you're asking for.
+        */
+        Pass* createPass(void);
+        /** Retrieves the Pass with the given index. */
+        Pass* getPass(unsigned short index);
+        /** Retrieves the Pass matching name.
+            Returns 0 if name match is not found.
+        */
+        Pass* getPass(const String& name);
+        /** Retrieves the number of passes. */
+        unsigned short getNumPasses(void) const;
+        /** Removes the Pass with the given index. */
+        void removePass(unsigned short index);
+        /** Removes all Passes from this Technique. */
+        void removeAllPasses(void);
+        /** Move a pass from source index to destination index.
+            If successful then returns true.
+        */
+        bool movePass(const unsigned short sourceIndex, const unsigned short destinationIndex);
+        typedef VectorIterator<Passes> PassIterator;
+        /** Gets an iterator over the passes in this Technique. */
+        const PassIterator getPassIterator(void);
+        typedef VectorIterator<IlluminationPassList> IlluminationPassIterator;
+        /** Gets an iterator over the illumination-stage categorised passes. */
+        const IlluminationPassIterator getIlluminationPassIterator(void);
+        /// Gets the parent Material
+        Material* getParent(void) const { return mParent; }
+
+        /** Overloaded operator to copy on Technique to another. */
+        Technique& operator=(const Technique& rhs);
+
+		/// Gets the resource group of the ultimate parent Material
+		const String& getResourceGroup(void) const;
+
+		/** Returns true if this Technique involves transparency. 
+		@remarks
+			This basically boils down to whether the first pass
+			has a scene blending factor. Even if the other passes 
+			do not, the base colour, including parts of the original 
+			scene, may be used for blending, therefore we have to treat
+			the whole Technique as transparent.
+		*/
+		bool isTransparent(void) const;
+
+        /** Internal load method, derived from call to Material::load. */
+        void _load(void);
+        /** Internal unload method, derived from call to Material::unload. */
+        void _unload(void);
+
+        // Is this loaded?
+        bool isLoaded(void) const;
+
+        /** Tells the technique that it needs recompilation. */
+        void _notifyNeedsRecompile(void);
+
+
+        // -------------------------------------------------------------------------------
+        // The following methods are to make migration from previous versions simpler
+        // and to make code easier to write when dealing with simple materials
+        // They set the properties which have been moved to Pass for all Techniques and all Passes
+
+        /** Sets the point size properties for every Pass in this Technique.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setPointSize
+        */
+        void setPointSize(Real ps);
+
+        /** Sets the ambient colour reflectance properties for every Pass in every Technique.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setAmbient
+        */
+        void setAmbient(Real red, Real green, Real blue);
+
+        /** Sets the ambient colour reflectance properties for every Pass in every Technique.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setAmbient
+        */
+        void setAmbient(const ColourValue& ambient);
+
+        /** Sets the diffuse colour reflectance properties of every Pass in every Technique.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setDiffuse
+        */
+        void setDiffuse(Real red, Real green, Real blue, Real alpha);
+
+        /** Sets the diffuse colour reflectance properties of every Pass in every Technique.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setDiffuse
+        */
+        void setDiffuse(const ColourValue& diffuse);
+
+        /** Sets the specular colour reflectance properties of every Pass in every Technique.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setSpecular
+        */
+        void setSpecular(Real red, Real green, Real blue, Real alpha);
+
+        /** Sets the specular colour reflectance properties of every Pass in every Technique.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setSpecular
+        */
+        void setSpecular(const ColourValue& specular);
+
+        /** Sets the shininess properties of every Pass in every Technique.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setShininess
+        */
+        void setShininess(Real val);
+
+        /** Sets the amount of self-illumination of every Pass in every Technique.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setSelfIllumination
+        */
+        void setSelfIllumination(Real red, Real green, Real blue);
+
+        /** Sets the amount of self-illumination of every Pass in every Technique.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setSelfIllumination
+        */
+        void setSelfIllumination(const ColourValue& selfIllum);
+
+		/** Sets whether or not each Pass renders with depth-buffer checking on or not.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setDepthCheckEnabled
+        */
+        void setDepthCheckEnabled(bool enabled);
+
+        /** Sets whether or not each Pass renders with depth-buffer writing on or not.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setDepthWriteEnabled
+        */
+        void setDepthWriteEnabled(bool enabled);
+
+        /** Sets the function used to compare depth values when depth checking is on.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setDepthFunction
+        */
+        void setDepthFunction( CompareFunction func );
+
+		/** Sets whether or not colour buffer writing is enabled for each Pass.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setColourWriteEnabled
+		*/
+		void setColourWriteEnabled(bool enabled);
+
+        /** Sets the culling mode for each pass  based on the 'vertex winding'.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setCullingMode
+        */
+        void setCullingMode( CullingMode mode );
+
+        /** Sets the manual culling mode, performed by CPU rather than hardware.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setManualCullingMode
+        */
+        void setManualCullingMode( ManualCullingMode mode );
+
+        /** Sets whether or not dynamic lighting is enabled for every Pass.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setLightingEnabled
+        */
+        void setLightingEnabled(bool enabled);
+
+        /** Sets the type of light shading required
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setShadingMode
+        */
+        void setShadingMode( ShadeOptions mode );
+
+        /** Sets the fogging mode applied to each pass.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setFog
+        */
+        void setFog(
+            bool overrideScene,
+            FogMode mode = FOG_NONE,
+            const ColourValue& colour = ColourValue::White,
+            Real expDensity = 0.001, Real linearStart = 0.0, Real linearEnd = 1.0 );
+
+        /** Sets the depth bias to be used for each Pass.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setDepthBias
+        */
+        void setDepthBias(float constantBias, float slopeScaleBias);
+
+        /** Set texture filtering for every texture unit in every Pass
+        @note
+            This property actually exists on the TextureUnitState class
+            For simplicity, this method allows you to set these properties for 
+            every current TeextureUnitState, If you need more precision, retrieve the  
+            Pass and TextureUnitState instances and set the property there.
+        @see TextureUnitState::setTextureFiltering
+        */
+        void setTextureFiltering(TextureFilterOptions filterType);
+        /** Sets the anisotropy level to be used for all textures.
+        @note
+            This property has been moved to the TextureUnitState class, which is accessible via the 
+            Technique and Pass. For simplicity, this method allows you to set these properties for 
+            every current TeextureUnitState, If you need more precision, retrieve the Technique, 
+            Pass and TextureUnitState instances and set the property there.
+        @see TextureUnitState::setTextureAnisotropy
+        */
+        void setTextureAnisotropy(unsigned int maxAniso);
+
+        /** Sets the kind of blending every pass has with the existing contents of the scene.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setSceneBlending
+        */
+        void setSceneBlending( const SceneBlendType sbt );
+
+        /** Allows very fine control of blending every Pass with the existing contents of the scene.
+        @note
+            This property actually exists on the Pass class. For simplicity, this method allows 
+            you to set these properties for every current Pass within this Technique. If 
+            you need more precision, retrieve the Pass instance and set the
+            property there.
+        @see Pass::setSceneBlending
+        */
+        void setSceneBlending( const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor);
+
+        /** Assigns a level-of-detail (LOD) index to this Technique.
+        @remarks
+            As noted previously, as well as providing fallback support for various
+            graphics cards, multiple Technique objects can also be used to implement
+            material LOD, where the detail of the material diminishes with distance to 
+            save rendering power.
+        @par
+            By default, all Techniques have a LOD index of 0, which means they are the highest
+            level of detail. Increasing LOD indexes are lower levels of detail. You can 
+            assign more than one Technique to the same LOD index, meaning that the best 
+            Technique that is supported at that LOD index is used. 
+        @par
+            You should not leave gaps in the LOD sequence; Ogre will allow you to do this
+            and will continue to function as if the LODs were sequential, but it will 
+            confuse matters.
+        */
+        void setLodIndex(unsigned short index);
+        /** Gets the level-of-detail index assigned to this Technique. */
+        unsigned short getLodIndex(void) const { return mLodIndex; }
+
+		/** Set the 'scheme name' for this technique. 
+		@remarks
+			Material schemes are used to control top-level switching from one
+			set of techniques to another. For example, you might use this to 
+			define 'high', 'medium' and 'low' complexity levels on materials
+		    to allow a user to pick a performance / quality ratio. Another
+			possibility is that you have a fully HDR-enabled pipeline for top
+			machines, rendering all objects using unclamped shaders, and a 
+			simpler pipeline for others; this can be implemented using 
+			schemes.
+		@par
+			Every technique belongs to a scheme - if you don't specify one, the
+			Technique belongs to the scheme called 'Default', which is also the
+			scheme used to render by default. The active scheme is set one of
+			two ways - either by calling Viewport::setMaterialScheme, or
+			by manually calling MaterialManager::setActiveScheme.
+		*/
+		void setSchemeName(const String& schemeName);
+		/** Returns the scheme to which this technique is assigned.
+			@see Technique::setSchemeName
+		*/
+		const String& getSchemeName(void) const;
+		
+		/// Internal method for getting the scheme index
+		unsigned short _getSchemeIndex(void) const;
+		   	
+        /** Is depth writing going to occur on this technique? */
+        bool isDepthWriteEnabled(void) const;
+
+        /** Is depth checking going to occur on this technique? */
+        bool isDepthCheckEnabled(void) const;
+
+        /** Exists colour writing disabled pass on this technique? */
+        bool hasColourWriteDisabled(void) const;
+
+        /** Set the name of the technique.
+        @remarks
+        The use of technique name is optional.  Its usefull in material scripts where a material could inherit
+        from another material and only want to modify a particalar technique.
+        */
+        void setName(const String& name);
+        /// Gets the name of the technique
+        const String& getName(void) const { return mName; }
+
+        /** Applies texture names to Texture Unit State with matching texture name aliases.
+            All passes, and Texture Unit States within the technique are checked.
+            If matching texture aliases are found then true is returned.
+
+        @param
+            aliasList is a map container of texture alias, texture name pairs
+        @param
+            apply set true to apply the texture aliases else just test to see if texture alias matches are found.
+        @return
+            True if matching texture aliases were found in the Technique.
+        */
+        bool applyTextureAliases(const AliasTextureNamePairList& aliasList, const bool apply = true) const;
+
+
+    };
+
+
+}
+#endif
Index: /OgreMain/include/OgreTextAreaOverlayElement.h
===================================================================
--- /OgreMain/include/OgreTextAreaOverlayElement.h	(revision 5)
+++ /OgreMain/include/OgreTextAreaOverlayElement.h	(revision 5)
@@ -0,0 +1,247 @@
+/*-------------------------------------------------------------------------
+This source file is a part of OGRE
+(Object-oriented Graphics Rendering Engine)
+
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License (LGPL) as 
+published by the Free Software Foundation; either version 2.1 of the 
+License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful, but 
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
+or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License 
+along with this library; if not, write to the Free Software Foundation, 
+Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA or go to
+http://www.gnu.org/copyleft/lesser.txt
+-------------------------------------------------------------------------*/
+
+#ifndef _TextAreaOverlayElement_H__
+#define _TextAreaOverlayElement_H__
+
+#include "OgreOverlayElement.h"
+#include "OgreFont.h"
+
+namespace Ogre
+{
+    /** This class implements an overlay element which contains simple unformatted text.
+    */
+    class _OgreExport TextAreaOverlayElement : public OverlayElement
+    {
+    public:
+        enum Alignment
+        {
+            Left,
+            Right,
+            Center
+        };
+
+    public:
+        /** Constructor. */
+        TextAreaOverlayElement(const String& name);
+        virtual ~TextAreaOverlayElement();
+
+        virtual void initialise(void);
+		virtual void setCaption(const DisplayString& text);
+
+        void setCharHeight( Real height );
+        Real getCharHeight() const;
+
+        void setSpaceWidth( Real width );
+        Real getSpaceWidth() const;
+
+        void setFontName( const String& font );
+        const String& getFontName() const;
+
+        /** See OverlayElement. */
+        virtual const String& getTypeName(void) const;
+        /** See Renderable. */
+        void getRenderOperation(RenderOperation& op);
+        /** Overridden from OverlayElement */
+        void setMaterialName(const String& matName);
+
+        /** Sets the colour of the text. 
+        @remarks
+            This method establishes a constant colour for 
+            the entire text. Also see setColourBottom and 
+            setColourTop which allow you to set a colour gradient.
+        */
+        void setColour(const ColourValue& col);
+
+        /** Gets the colour of the text. */
+        const ColourValue& getColour(void) const;
+        /** Sets the colour of the bottom of the letters.
+        @remarks
+            By setting a separate top and bottom colour, you
+            can create a text area which has a graduated colour
+            effect to it.
+        */
+        void setColourBottom(const ColourValue& col);
+        /** Gets the colour of the bottom of the letters. */
+        const ColourValue& getColourBottom(void) const;
+        /** Sets the colour of the top of the letters.
+        @remarks
+            By setting a separate top and bottom colour, you
+            can create a text area which has a graduated colour
+            effect to it.
+        */
+        void setColourTop(const ColourValue& col);
+        /** Gets the colour of the top of the letters. */
+        const ColourValue& getColourTop(void) const;
+
+        inline void setAlignment( Alignment a )
+        {
+            mAlignment = a;
+			mGeomPositionsOutOfDate = true;
+        }
+        inline Alignment getAlignment() const
+        {
+            return mAlignment;
+        }
+
+        /** Overridden from OverlayElement */
+        void setMetricsMode(GuiMetricsMode gmm);
+
+        /** Overridden from OverlayElement */
+        void _update(void);
+
+        //-----------------------------------------------------------------------------------------
+        /** Command object for setting the caption.
+                @see ParamCommand
+        */
+        class _OgrePrivate CmdCaption : public ParamCommand
+        {
+        public:
+            String doGet( const void* target ) const;
+            void doSet( void* target, const String& val );
+        };
+        //-----------------------------------------------------------------------------------------
+        /** Command object for setting the char height.
+                @see ParamCommand
+        */
+        class _OgrePrivate CmdCharHeight : public ParamCommand
+        {
+        public:
+            String doGet( const void* target ) const;
+            void doSet( void* target, const String& val );
+        };
+        //-----------------------------------------------------------------------------------------
+        /** Command object for setting the width of a space.
+                @see ParamCommand
+        */
+        class _OgrePrivate CmdSpaceWidth : public ParamCommand
+        {
+        public:
+            String doGet( const void* target ) const;
+            void doSet( void* target, const String& val );
+        };
+        //-----------------------------------------------------------------------------------------
+        /** Command object for setting the caption.
+                @see ParamCommand
+        */
+        class _OgrePrivate CmdFontName : public ParamCommand
+        {
+        public:
+            String doGet( const void* target ) const;
+            void doSet( void* target, const String& val );
+        };
+        //-----------------------------------------------------------------------------------------
+        /** Command object for setting the top colour.
+                @see ParamCommand
+        */
+        class _OgrePrivate CmdColourTop : public ParamCommand
+        {
+        public:
+            String doGet( const void* target ) const;
+            void doSet( void* target, const String& val );
+        };
+        //-----------------------------------------------------------------------------------------
+        /** Command object for setting the bottom colour.
+                @see ParamCommand
+        */
+        class _OgrePrivate CmdColourBottom : public ParamCommand
+        {
+        public:
+            String doGet( const void* target ) const;
+            void doSet( void* target, const String& val );
+        };
+        //-----------------------------------------------------------------------------------------
+        /** Command object for setting the constant colour.
+                @see ParamCommand
+        */
+        class _OgrePrivate CmdColour : public ParamCommand
+        {
+        public:
+            String doGet( const void* target ) const;
+            void doSet( void* target, const String& val );
+        };
+        //-----------------------------------------------------------------------------------------
+        /** Command object for setting the alignment.
+                @see ParamCommand
+        */
+        class _OgrePrivate CmdAlignment : public ParamCommand
+        {
+        public:
+            String doGet( const void* target ) const;
+            void doSet( void* target, const String& val );
+        };
+
+    protected:
+        /// The text alignment
+        Alignment mAlignment;
+
+        /// Flag indicating if this panel should be visual or just group things
+        bool mTransparent;
+
+        /// Render operation
+        RenderOperation mRenderOp;
+
+        /// Method for setting up base parameters for this class
+        void addBaseParameters(void);
+
+        static String msTypeName;
+
+        // Command objects
+        static CmdCharHeight msCmdCharHeight;
+        static CmdSpaceWidth msCmdSpaceWidth;
+        static CmdFontName msCmdFontName;
+        static CmdColour msCmdColour;
+        static CmdColourTop msCmdColourTop;
+        static CmdColourBottom msCmdColourBottom;
+        static CmdAlignment msCmdAlignment;
+
+
+        FontPtr mpFont;
+        Real mCharHeight;
+        ushort mPixelCharHeight;
+        Real mSpaceWidth;
+        ushort mPixelSpaceWidth;
+        size_t mAllocSize;
+		Real mViewportAspectCoef;
+
+        /// Colours to use for the vertices
+        ColourValue mColourBottom;
+        ColourValue mColourTop;
+        bool mColoursChanged;
+
+
+        /// Internal method to allocate memory, only reallocates when necessary
+        void checkMemoryAllocation( size_t numChars );
+        /// Inherited function
+        virtual void updatePositionGeometry();
+		/// Inherited function
+		virtual void updateTextureGeometry();
+        /// Updates vertex colours
+        virtual void updateColours(void);
+    };
+}
+
+#endif
+
Index: /OgreMain/include/OgreTexture.h
===================================================================
--- /OgreMain/include/OgreTexture.h	(revision 5)
+++ /OgreMain/include/OgreTexture.h	(revision 5)
@@ -0,0 +1,416 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _Texture_H__
+#define _Texture_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreHardwareBuffer.h"
+#include "OgreResource.h"
+#include "OgreImage.h"
+
+namespace Ogre {
+
+    /** Enum identifying the texture usage
+    */
+    enum TextureUsage
+    {
+		/// @copydoc HardwareBuffer::Usage
+		TU_STATIC = HardwareBuffer::HBU_STATIC,
+		TU_DYNAMIC = HardwareBuffer::HBU_DYNAMIC,
+		TU_WRITE_ONLY = HardwareBuffer::HBU_WRITE_ONLY,
+		TU_STATIC_WRITE_ONLY = HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
+		TU_DYNAMIC_WRITE_ONLY = HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY,
+		TU_DYNAMIC_WRITE_ONLY_DISCARDABLE = HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE,
+		/// mipmaps will be automatically generated for this texture
+		TU_AUTOMIPMAP = 0x100,
+		/// this texture will be a render target, ie. used as a target for render to texture
+		/// setting this flag will ignore all other texture usages except TU_AUTOMIPMAP
+		TU_RENDERTARGET = 0x200,
+		/// default to automatic mipmap generation static textures
+		TU_DEFAULT = TU_AUTOMIPMAP | TU_STATIC_WRITE_ONLY
+        
+    };
+
+    /** Enum identifying the texture type
+    */
+    enum TextureType
+    {
+        /// 1D texture, used in combination with 1D texture coordinates
+        TEX_TYPE_1D = 1,
+        /// 2D texture, used in combination with 2D texture coordinates (default)
+        TEX_TYPE_2D = 2,
+        /// 3D volume texture, used in combination with 3D texture coordinates
+        TEX_TYPE_3D = 3,
+        /// 3D cube map, used in combination with 3D texture coordinates
+        TEX_TYPE_CUBE_MAP = 4
+    };
+
+	/** Enum identifying special mipmap numbers
+    */
+	enum TextureMipmap
+	{
+		/// Generate mipmaps up to 1x1
+		MIP_UNLIMITED = 0x7FFFFFFF,
+		/// Use TextureManager default
+		MIP_DEFAULT = -1
+	};
+
+    // Forward declaration
+    class TexturePtr;
+
+    /** Abstract class representing a Texture resource.
+        @remarks
+            The actual concrete subclass which will exist for a texture
+            is dependent on the rendering system in use (Direct3D, OpenGL etc).
+            This class represents the commonalities, and is the one 'used'
+            by programmers even though the real implementation could be
+            different in reality. Texture objects are created through
+            the 'create' method of the TextureManager concrete subclass.
+     */
+    class _OgreExport Texture : public Resource
+    {
+    public:
+        Texture(ResourceManager* creator, const String& name, ResourceHandle handle,
+            const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
+
+        /** Sets the type of texture; can only be changed before load() 
+        */
+        virtual void setTextureType(TextureType ttype ) { mTextureType = ttype; }
+
+        /** Gets the type of texture 
+        */
+        virtual TextureType getTextureType(void) const { return mTextureType; }
+
+        /** Gets the number of mipmaps to be used for this texture.
+        */
+        virtual size_t getNumMipmaps(void) const {return mNumMipmaps;}
+
+		/** Sets the number of mipmaps to be used for this texture.
+            @note
+                Must be set before calling any 'load' method.
+        */
+        virtual void setNumMipmaps(size_t num) {mNumRequestedMipmaps = mNumMipmaps = num;}
+
+		/** Are mipmaps hardware generated?
+		@remarks
+			Will only be accurate after texture load, or createInternalResources
+		*/
+		virtual bool getMipmapsHardwareGenerated(void) const { return mMipmapsHardwareGenerated; }
+
+        /** Returns the gamma adjustment factor applied to this texture.
+        */
+        virtual float getGamma(void) const { return mGamma; }
+
+        /** Sets the gamma adjustment factor applied to this texture.
+            @note
+                Must be called before any 'load' method.
+        */
+        virtual void setGamma(float g) { mGamma = g; }
+
+        /** Returns the height of the texture.
+        */
+        virtual size_t getHeight(void) const { return mHeight; }
+
+        /** Returns the width of the texture.
+        */
+        virtual size_t getWidth(void) const { return mWidth; }
+
+        /** Returns the depth of the texture (only applicable for 3D textures).
+        */
+        virtual size_t getDepth(void) const { return mDepth; }
+
+        /** Returns the height of the original input texture (may differ due to hardware requirements).
+        */
+        virtual size_t getSrcHeight(void) const { return mSrcHeight; }
+
+        /** Returns the width of the original input texture (may differ due to hardware requirements).
+        */
+        virtual size_t getSrcWidth(void) const { return mSrcWidth; }
+
+        /** Returns the original depth of the input texture (only applicable for 3D textures).
+        */
+        virtual size_t getSrcDepth(void) const { return mSrcDepth; }
+
+        /** Set the height of the texture; can only do this before load();
+        */
+        virtual void setHeight(size_t h) { mHeight = mSrcHeight = h; }
+
+        /** Set the width of the texture; can only do this before load();
+        */
+        virtual void setWidth(size_t w) { mWidth = mSrcWidth = w; }
+
+        /** Set the depth of the texture (only applicable for 3D textures);
+            ; can only do this before load();
+        */
+        virtual void setDepth(size_t d)  { mDepth = mSrcDepth = d; }
+
+        /** Returns the TextureUsage indentifier for this Texture
+        */
+        virtual int getUsage() const
+        {
+            return mUsage;
+        }
+
+        /** Sets the TextureUsage indentifier for this Texture; only useful before load()
+			
+			@param u is a combination of TU_STATIC, TU_DYNAMIC, TU_WRITE_ONLY 
+				TU_AUTOMIPMAP and TU_RENDERTARGET (see TextureUsage enum). You are
+            	strongly advised to use HBU_STATIC_WRITE_ONLY wherever possible, if you need to 
+            	update regularly, consider HBU_DYNAMIC_WRITE_ONLY.
+        */
+        virtual void setUsage(int u) { mUsage = u; }
+
+        /** Creates the internal texture resources for this texture. 
+        @remarks
+            This method creates the internal texture resources (pixel buffers, 
+            texture surfaces etc) required to begin using this texture. You do
+            not need to call this method directly unless you are manually creating
+            a texture, in which case something must call it, after having set the
+            size and format of the texture (e.g. the ManualResourceLoader might
+            be the best one to call it). If you are not defining a manual texture,
+            or if you use one of the self-contained load...() methods, then it will be
+            called for you.
+        */
+        virtual void createInternalResources(void);
+
+        /** Frees internal texture resources for this texture. 
+        */
+        virtual void freeInternalResources(void);
+        
+		/** Copies (and maybe scales to fit) the contents of this texture to
+			another texture. */
+		virtual void copyToTexture( TexturePtr& target );
+
+        /** Loads the data from an image.
+		@note Important: only call this from outside the load() routine of a 
+			Resource. Don't call it within (including ManualResourceLoader) - use
+			_loadImages() instead. This method is designed to be external, 
+			performs locking and checks the load status before loading.
+        */
+        virtual void loadImage( const Image &img );
+			
+		/** Loads the data from a raw stream.
+		@note Important: only call this from outside the load() routine of a 
+			Resource. Don't call it within (including ManualResourceLoader) - use
+			_loadImages() instead. This method is designed to be external, 
+			performs locking and checks the load status before loading.
+		@param stream Data stream containing the raw pixel data
+		@param uWidth Width of the image
+		@param uHeight Height of the image
+		@param eFormat The format of the pixel data
+		*/
+		virtual void loadRawData( DataStreamPtr& stream, 
+			ushort uWidth, ushort uHeight, PixelFormat eFormat);
+
+		/** Internal method to load the texture from a set of images. 
+		@note Do NOT call this method unless you are inside the load() routine
+			already, e.g. a ManualResourceLoader. It is not threadsafe and does
+			not check or update resource loading status.
+		*/
+        virtual void _loadImages( const ConstImagePtrList& images );
+
+		/** Returns the pixel format for the texture surface. */
+		virtual PixelFormat getFormat() const
+		{
+			return mFormat;
+		}
+
+        /** Returns the desired pixel format for the texture surface. */
+        virtual PixelFormat getDesiredFormat(void) const
+        {
+            return mDesiredFormat;
+        }
+
+        /** Returns the pixel format of the original input texture (may differ due to
+            hardware requirements and pixel format convertion).
+        */
+        virtual PixelFormat getSrcFormat(void) const
+        {
+            return mSrcFormat;
+        }
+
+        /** Sets the pixel format for the texture surface; can only be set before load(). */
+        virtual void setFormat(PixelFormat pf);
+
+        /** Returns true if the texture has an alpha layer. */
+        virtual bool hasAlpha(void) const;
+
+        /** Sets desired bit depth for integer pixel format textures.
+        @note
+            Available values: 0, 16 and 32, where 0 (the default) means keep original format
+            as it is. This value is number of bits for the pixel.
+        */
+        virtual void setDesiredIntegerBitDepth(ushort bits);
+
+        /** gets desired bit depth for integer pixel format textures.
+        */
+        virtual ushort getDesiredIntegerBitDepth(void) const;
+
+        /** Sets desired bit depth for float pixel format textures.
+        @note
+            Available values: 0, 16 and 32, where 0 (the default) means keep original format
+            as it is. This value is number of bits for a channel of the pixel.
+        */
+        virtual void setDesiredFloatBitDepth(ushort bits);
+
+        /** gets desired bit depth for float pixel format textures.
+        */
+        virtual ushort getDesiredFloatBitDepth(void) const;
+
+        /** Sets desired bit depth for integer and float pixel format.
+        */
+        virtual void setDesiredBitDepths(ushort integerBits, ushort floatBits);
+
+        /** Sets whether luminace pixel format will treated as alpha format when load this texture.
+        */
+        virtual void setTreatLuminanceAsAlpha(bool asAlpha);
+
+        /** Gets whether luminace pixel format will treated as alpha format when load this texture.
+        */
+        virtual bool getTreatLuminanceAsAlpha(void) const;
+
+        /** Return the number of faces this texture has. This will be 6 for a cubemap
+        	texture and 1 for a 1D, 2D or 3D one.
+        */
+        virtual size_t getNumFaces() const;
+
+		/** Return hardware pixel buffer for a surface. This buffer can then
+			be used to copy data from and to a particular level of the texture.
+			@param face 	Face number, in case of a cubemap texture. Must be 0
+							for other types of textures.
+                            For cubemaps, this is one of 
+                            +X (0), -X (1), +Y (2), -Y (3), +Z (4), -Z (5)
+			@param mipmap	Mipmap level. This goes from 0 for the first, largest
+							mipmap level to getNumMipmaps()-1 for the smallest.
+			@returns	A shared pointer to a hardware pixel buffer
+			@remarks	The buffer is invalidated when the resource is unloaded or destroyed.
+						Do not use it after the lifetime of the containing texture.
+		*/
+		virtual HardwarePixelBufferSharedPtr getBuffer(size_t face=0, size_t mipmap=0) = 0;
+
+    protected:
+        size_t mHeight;
+        size_t mWidth;
+        size_t mDepth;
+
+        size_t mNumRequestedMipmaps;
+		size_t mNumMipmaps;
+		bool mMipmapsHardwareGenerated;
+        float mGamma;
+
+        TextureType mTextureType;
+		PixelFormat mFormat;
+        int mUsage; // Bit field, so this can't be TextureUsage
+
+        PixelFormat mSrcFormat;
+        size_t mSrcWidth, mSrcHeight, mSrcDepth;
+
+        PixelFormat mDesiredFormat;
+        unsigned short mDesiredIntegerBitDepth;
+        unsigned short mDesiredFloatBitDepth;
+        bool mTreatLuminanceAsAlpha;
+
+		bool mInternalResourcesCreated;
+
+		/// @copydoc Resource::calculateSize
+		size_t calculateSize(void) const;
+		
+
+		/** Implementation of creating internal texture resources 
+		*/
+		virtual void createInternalResourcesImpl(void) = 0;
+
+		/** Implementation of freeing internal texture resources 
+		*/
+		virtual void freeInternalResourcesImpl(void) = 0;
+
+		/** Default implementation of unload which calls freeInternalResources */
+		void unloadImpl(void);
+
+    };
+
+    /** Specialisation of SharedPtr to allow SharedPtr to be assigned to TexturePtr 
+    @note Has to be a subclass since we need operator=.
+    We could templatise this instead of repeating per Resource subclass, 
+    except to do so requires a form VC6 does not support i.e.
+    ResourceSubclassPtr<T> : public SharedPtr<T>
+    */
+    class _OgreExport TexturePtr : public SharedPtr<Texture> 
+    {
+    public:
+        TexturePtr() : SharedPtr<Texture>() {}
+        explicit TexturePtr(Texture* rep) : SharedPtr<Texture>(rep) {}
+        TexturePtr(const TexturePtr& r) : SharedPtr<Texture>(r) {} 
+        TexturePtr(const ResourcePtr& r) : SharedPtr<Texture>()
+        {
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+                pRep = static_cast<Texture*>(r.getPointer());
+                pUseCount = r.useCountPointer();
+                if (pUseCount)
+                {
+                    ++(*pUseCount);
+                }
+            }
+        }
+
+        /// Operator used to convert a ResourcePtr to a TexturePtr
+        TexturePtr& operator=(const ResourcePtr& r)
+        {
+            if (pRep == static_cast<Texture*>(r.getPointer()))
+                return *this;
+            release();
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+                pRep = static_cast<Texture*>(r.getPointer());
+                pUseCount = r.useCountPointer();
+                if (pUseCount)
+                {
+                    ++(*pUseCount);
+                }
+            }
+			else
+			{
+				// RHS must be a null pointer
+				assert(r.isNull() && "RHS must be null if it has no mutex!");
+				setNull();
+			}
+            return *this;
+        }
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgreTextureManager.h
===================================================================
--- /OgreMain/include/OgreTextureManager.h	(revision 5)
+++ /OgreMain/include/OgreTextureManager.h	(revision 5)
@@ -0,0 +1,398 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _TextureManager_H__
+#define _TextureManager_H__
+
+
+#include "OgrePrerequisites.h"
+
+#include "OgreResourceManager.h"
+#include "OgreTexture.h"
+#include "OgreSingleton.h"
+
+
+namespace Ogre {
+
+    /** Class for loading & managing textures.
+        @remarks
+            Note that this class is abstract - the particular
+            RenderSystem that is in use at the time will create
+            a concrete subclass of this. Note that the concrete
+            class will be available via the abstract singleton
+            obtained from TextureManager::getSingleton(), but
+            you should not assume that it is available until you
+            have a) initialised Ogre (after selecting a RenderSystem
+            and calling initialise from the Root object), and b)
+            created at least one window - this may be done at the
+            same time as part a if you allow Ogre to autocreate one.
+     */
+    class _OgreExport TextureManager : public ResourceManager, public Singleton<TextureManager>
+    {
+    public:
+
+        TextureManager(void);
+        virtual ~TextureManager();
+
+        /** Loads a texture from a file.
+            @param
+                name The file to load, or a String identifier in some cases
+            @param
+                group The name of the resource group to assign the texture to
+            @param
+                texType The type of texture to load/create, defaults to normal 2D textures
+            @param
+                numMipmaps The number of pre-filtered mipmaps to generate. If left to MIP_DEFAULT then
+                the TextureManager's default number of mipmaps will be used (see setDefaultNumMipmaps())
+				If set to MIP_UNLIMITED mipmaps will be generated until the lowest possible
+				level, 1x1x1.
+            @param
+                gamma The gamma adjustment factor to apply to this texture (brightening/darkening)
+			@param 
+				isAlpha Only applicable to greyscale images. If true, specifies that
+				the image should be loaded into an alpha texture rather than a
+				single channel colour texture - useful for fixed-function systems.
+			@param 
+				desiredFormat The format you would like to have used instead of
+				the format being based on the contents of the texture
+        */
+        virtual TexturePtr load( 
+            const String& name, const String& group, 
+            TextureType texType = TEX_TYPE_2D, int numMipmaps = MIP_DEFAULT, 
+            Real gamma = 1.0f, bool isAlpha = false,
+            PixelFormat desiredFormat = PF_UNKNOWN);
+
+        /** Loads a texture from an Image object.
+            @note
+                The texture will create as manual texture without loader.
+            @param
+                name The name to give the resulting texture
+            @param
+                group The name of the resource group to assign the texture to
+            @param
+                img The Image object which contains the data to load
+            @param
+                texType The type of texture to load/create, defaults to normal 2D textures
+            @param
+                numMipmaps The number of pre-filtered mipmaps to generate. If left to MIP_DEFAULT then
+                the TextureManager's default number of mipmaps will be used (see setDefaultNumMipmaps())
+				If set to MIP_UNLIMITED mipmaps will be generated until the lowest possible
+				level, 1x1x1.
+            @param
+                gamma The gamma adjustment factor to apply to this texture (brightening/darkening)
+			@param 
+				isAlpha Only applicable to greyscale images. If true, specifies that
+				the image should be loaded into an alpha texture rather than a
+				single channel colour texture - useful for fixed-function systems.
+			@param 
+				desiredFormat The format you would like to have used instead of
+				the format being based on the contents of the texture
+        */
+        virtual TexturePtr loadImage( 
+            const String &name, const String& group, const Image &img, 
+            TextureType texType = TEX_TYPE_2D,
+            int iNumMipmaps = MIP_DEFAULT, Real gamma = 1.0f, bool isAlpha = false,
+            PixelFormat desiredFormat = PF_UNKNOWN);
+			
+        /** Loads a texture from a raw data stream.
+            @note
+                The texture will create as manual texture without loader.
+            @param
+                name The name to give the resulting texture
+            @param
+                group The name of the resource group to assign the texture to
+            @param
+                stream Incoming data stream
+            @param
+                width, height The dimensions of the texture
+            @param
+                format The format of the data being passed in; the manager reserves
+                the right to create a different format for the texture if the 
+                original format is not available in this context.
+            @param
+                texType The type of texture to load/create, defaults to normal 2D textures
+            @param
+                numMipmaps The number of pre-filtered mipmaps to generate. If left to MIP_DEFAULT then
+                the TextureManager's default number of mipmaps will be used (see setDefaultNumMipmaps())
+				If set to MIP_UNLIMITED mipmaps will be generated until the lowest possible
+				level, 1x1x1.
+            @param
+                gamma The gamma adjustment factor to apply to this texture (brightening/darkening)
+        */
+        virtual TexturePtr loadRawData(const String &name, const String& group,
+            DataStreamPtr& stream, ushort uWidth, ushort uHeight, 
+            PixelFormat format, TextureType texType = TEX_TYPE_2D, 
+            int iNumMipmaps = MIP_DEFAULT, Real gamma = 1.0f);
+
+		/** Create a manual texture with specified width, height and depth (not loaded from a file).
+            @param
+                name The name to give the resulting texture
+            @param
+                group The name of the resource group to assign the texture to
+            @param
+                texType The type of texture to load/create, defaults to normal 2D textures
+            @param
+                width, height, depth The dimensions of the texture
+            @param
+                numMipmaps The number of pre-filtered mipmaps to generate. If left to MIP_DEFAULT then
+                the TextureManager's default number of mipmaps will be used (see setDefaultNumMipmaps())
+				If set to MIP_UNLIMITED mipmaps will be generated until the lowest possible
+				level, 1x1x1.
+            @param
+                format The internal format you wish to request; the manager reserves
+                the right to create a different format if the one you select is
+                not available in this context.
+			@param 
+				usage The kind of usage this texture is intended for. It 
+				is a combination of TU_STATIC, TU_DYNAMIC, TU_WRITE_ONLY, 
+				TU_AUTOMIPMAP and TU_RENDERTARGET (see TextureUsage enum). You are
+            	strongly advised to use HBU_STATIC_WRITE_ONLY wherever possible, if you need to 
+            	update regularly, consider HBU_DYNAMIC_WRITE_ONLY.
+            @param
+                loader If you intend the contents of the manual texture to be 
+                regularly updated, to the extent that you don't need to recover 
+                the contents if the texture content is lost somehow, you can leave
+                this parameter as 0. However, if you intend to populate the
+                texture only once, then you should implement ManualResourceLoader
+                and pass a pointer to it in this parameter; this means that if the
+                manual texture ever needs to be reloaded, the ManualResourceLoader
+                will be called to do it.
+        */
+        virtual TexturePtr createManual(const String & name, const String& group,
+            TextureType texType, uint width, uint height, uint depth, 
+			int num_mips, PixelFormat format, int usage = TU_DEFAULT, ManualResourceLoader* loader = 0 );
+			
+        /** Create a manual texture with a depth of 1 (not loaded from a file).
+            @param
+                name The name to give the resulting texture
+            @param
+                group The name of the resource group to assign the texture to
+            @param
+                texType The type of texture to load/create, defaults to normal 2D textures
+            @param
+                width, height The dimensions of the texture
+            @param
+                numMipmaps The number of pre-filtered mipmaps to generate. If left to MIP_DEFAULT then
+                the TextureManager's default number of mipmaps will be used (see setDefaultNumMipmaps()).
+				If set to MIP_UNLIMITED mipmaps will be generated until the lowest possible
+				level, 1x1x1.
+            @param
+                format The internal format you wish to request; the manager reserves
+                the right to create a different format if the one you select is
+                not available in this context.
+			@param 
+				usage The kind of usage this texture is intended for. It 
+				is a combination of TU_STATIC, TU_DYNAMIC, TU_WRITE_ONLY, 
+				TU_AUTOMIPMAP and TU_RENDERTARGET (see TextureUsage enum). You are
+            	strongly advised to use HBU_STATIC_WRITE_ONLY wherever possible, if you need to 
+            	update regularly, consider HBU_DYNAMIC_WRITE_ONLY.
+            @param
+                loader If you intend the contents of the manual texture to be 
+                regularly updated, to the extent that you don't need to recover 
+                the contents if the texture content is lost somehow, you can leave
+                this parameter as 0. However, if you intend to populate the
+                texture only once, then you should implement ManualResourceLoader
+                and pass a pointer to it in this parameter; this means that if the
+                manual texture ever needs to be reloaded, the ManualResourceLoader
+                will be called to do it.
+        */
+        TexturePtr createManual(const String & name, const String& group,
+            TextureType texType, uint width, uint height, int num_mips,
+            PixelFormat format, int usage = TU_DEFAULT, ManualResourceLoader* loader = 0 )
+		{
+			return createManual(name, group, texType, width, height, 1, 
+				num_mips, format, usage, loader);
+		}
+
+        /** Sets preferred bit depth for integer pixel format textures.
+        @param
+            bits Number of bits. Available values: 0, 16 and 32, where 0 (the default) means keep
+            original format as it is. This value is number of bits for the pixel.
+        @param
+            reloadTextures If true (the default), will reloading all reloadable textures.
+        */
+        virtual void setPreferredIntegerBitDepth(ushort bits, bool reloadTextures = true);
+
+        /** gets preferred bit depth for integer pixel format textures.
+        */
+        virtual ushort getPreferredIntegerBitDepth(void) const;
+
+        /** Sets preferred bit depth for float pixel format textures.
+        @param
+            bits Number of bits. Available values: 0, 16 and 32, where 0 (the default) means keep
+            original format as it is. This value is number of bits for a channel of the pixel.
+        @param
+            reloadTextures If true (the default), will reloading all reloadable textures.
+        */
+        virtual void setPreferredFloatBitDepth(ushort bits, bool reloadTextures = true);
+
+        /** gets preferred bit depth for float pixel format textures.
+        */
+        virtual ushort getPreferredFloatBitDepth(void) const;
+
+        /** Sets preferred bit depth for integer and float pixel format.
+        @param
+            integerBits Number of bits. Available values: 0, 16 and 32, where 0 (the default) means keep
+            original format as it is. This value is number of bits for the pixel.
+        @param
+            floatBits Number of bits. Available values: 0, 16 and 32, where 0 (the default) means keep
+            original format as it is. This value is number of bits for a channel of the pixel.
+        @param
+            reloadTextures If true (the default), will reloading all reloadable textures.
+        */
+        virtual void setPreferredBitDepths(ushort integerBits, ushort floatBits, bool reloadTextures = true);
+
+		/** Returns whether this render system can natively support the precise texture 
+			format requested with the given usage options.
+		@remarks
+			You can still create textures with this format even if this method returns
+			false; the texture format will just be altered to one which the device does
+			support.
+		@note
+			Sometimes the device may just slightly change the format, such as reordering the 
+			channels or packing the channels differently, without it making and qualitative 
+			differences to the texture. If you want to just detect whether the quality of a
+			given texture will be reduced, use isEquivalentFormatSupport instead.
+		@param format The pixel format requested
+		@param usage The kind of usage this texture is intended for, a combination of 
+			the TextureUsage flags.
+		@returns true if the format is natively supported, false if a fallback would be used.
+		*/
+		virtual bool isFormatSupported(TextureType ttype, PixelFormat format, int usage);
+
+		/** Returns whether this render system can support the texture format requested
+			with the given usage options, or another format with no quality reduction.
+		*/
+		virtual bool isEquivalentFormatSupported(TextureType ttype, PixelFormat format, int usage);
+
+		/** Gets the format which will be natively used for a requested format given the
+			contraints of the current device.
+		*/
+		virtual PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage) = 0;
+
+        /** Returns whether this render system has hardware filtering supported for the
+            texture format requested with the given usage options.
+        @remarks
+            Not all texture format are supports filtering by the hardware, i.e. some
+            cards support floating point format, but it doesn't supports filtering on
+            the floating point texture at all, or only a subset floating point formats
+            have flitering supported.
+        @par
+            In the case you want to write shader to work with floating point texture, and
+            you want to produce better visual quality, it's necessary to flitering the
+            texture manually in shader (potential requires four or more texture fetch
+            instructions, plus several arithmetic instructions) if filtering doesn't
+            supported by hardware. But in case on the hardware that supports floating
+            point filtering natively, it had better to adopt this capability for
+            performance (because only one texture fetch instruction are required) and
+            doesn't loss visual quality.
+        @par
+            This method allow you queries hardware texture filtering capability to deciding
+            which verion of the shader to be used. Note it's up to you to write multi-version
+            shaders for support various hardware, internal engine can't do that for you
+            automatically.
+        @note
+            Under GL, texture filtering are always supported by driver, but if it's not
+            supported by hardware natively, software simulation will be used, and you
+            will end up with very slow speed (less than 0.1 fps for example). To slove
+            this performance problem, you must disable filtering manually (by use
+            <b>filtering none</b> in the material script's texture_unit section, or
+            call TextureUnitState::setTextureFiltering with TFO_NONE if populate
+            material in code).
+		@param ttype The texture type requested
+		@param format The pixel format requested
+		@param usage The kind of usage this texture is intended for, a combination of 
+			the TextureUsage flags.
+        @param preciseFormatOnly Whether precise or fallback format mode is used to detecting.
+            In case the pixel format doesn't supported by device, false will be returned
+            if in precise mode, and natively used pixel format will be actually use to
+            check if in fallback mode.
+		@returns true if the texture filtering is supported.
+        */
+        virtual bool isHardwareFilteringSupported(TextureType ttype, PixelFormat format, int usage,
+            bool preciseFormatOnly = false) = 0;
+
+        /** Sets the default number of mipmaps to be used for loaded textures, for when textures are
+            loaded automatically (e.g. by Material class) or when 'load' is called with the default
+            parameters by the application.
+			If set to MIP_UNLIMITED mipmaps will be generated until the lowest possible
+				level, 1x1x1.
+            @note
+                The default value is 0.
+        */
+        virtual void setDefaultNumMipmaps(size_t num);
+
+        /** Gets the default number of mipmaps to be used for loaded textures.
+        */
+        virtual size_t getDefaultNumMipmaps()
+        {
+            return mDefaultNumMipmaps;
+        }
+
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static TextureManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static TextureManager* getSingletonPtr(void);
+
+    protected:
+
+        ushort mPreferredIntegerBitDepth;
+        ushort mPreferredFloatBitDepth;
+        size_t mDefaultNumMipmaps;
+    };
+}// Namespace
+
+#endif
Index: /OgreMain/include/OgreTextureUnitState.h
===================================================================
--- /OgreMain/include/OgreTextureUnitState.h	(revision 5)
+++ /OgreMain/include/OgreTextureUnitState.h	(revision 5)
@@ -0,0 +1,1177 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __TextureUnitState_H__
+#define __TextureUnitState_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreCommon.h"
+#include "OgreBlendMode.h"
+#include "OgreMatrix4.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreString.h"
+#include "OgreTexture.h"
+
+namespace Ogre {
+    /** Class representing the state of a single texture unit during a Pass of a
+        Technique, of a Material.
+    @remarks
+        Texture units are pipelines for retrieving texture data for rendering onto
+        your objects in the world. Using them is common to both the fixed-function and 
+        the programmable (vertex and fragment program) pipeline, but some of the 
+        settings will only have an effect in the fixed-function pipeline (for example, 
+        setting a texture rotation will have no effect if you use the programmable
+        pipeline, because this is overridden by the fragment program). The effect
+        of each setting as regards the 2 pipelines is commented in each setting.
+    @par
+        When I use the term 'fixed-function pipeline' I mean traditional rendering
+        where you do not use vertex or fragment programs (shaders). Programmable 
+        pipeline means that for this pass you are using vertex or fragment programs.
+    */
+    class _OgreExport TextureUnitState
+    {
+        friend class RenderSystem;
+    public:
+        /** Definition of the broad types of texture effect you can apply to a texture unit.
+        @note
+            Note that these have no effect when using the programmable pipeline, since their
+            effect is overridden by the vertex / fragment programs.
+        */
+        enum TextureEffectType
+        {
+            /// Generate all texture coords based on angle between camera and vertex
+            ET_ENVIRONMENT_MAP,
+            /// Generate texture coords based on a frustum
+            ET_PROJECTIVE_TEXTURE,
+            /// Constant u/v scrolling effect
+            ET_UVSCROLL,
+			/// Constant u scrolling effect
+            ET_USCROLL,
+			/// Constant u/v scrolling effect
+            ET_VSCROLL,
+            /// Constant rotation
+            ET_ROTATE,
+            /// More complex transform
+            ET_TRANSFORM
+
+        };
+
+        /** Enumeration to specify type of envmap.
+        @note
+            Note that these have no effect when using the programmable pipeline, since their
+            effect is overridden by the vertex / fragment programs.
+        */
+        enum EnvMapType
+        {
+            /// Envmap based on vector from camera to vertex position, good for planar geometry
+            ENV_PLANAR,
+            /// Envmap based on dot of vector from camera to vertex and vertex normal, good for curves
+            ENV_CURVED,
+            /// Envmap entended to supply reflection vectors for cube mapping
+            ENV_REFLECTION,
+            /// Envmap entended to supply normal vectors for cube mapping
+            ENV_NORMAL
+        };
+
+        /** Useful enumeration when dealing with procedural transforms.
+        @note
+            Note that these have no effect when using the programmable pipeline, since their
+            effect is overridden by the vertex / fragment programs.
+        */
+        enum TextureTransformType
+        {
+            TT_TRANSLATE_U,
+            TT_TRANSLATE_V,
+            TT_SCALE_U,
+            TT_SCALE_V,
+            TT_ROTATE
+        };
+
+        /** Texture addressing modes - default is TAM_WRAP.
+        @note
+            These settings are relevant in both the fixed-function and the
+            programmable pipeline.
+        */
+        enum TextureAddressingMode
+        {
+            /// Texture wraps at values over 1.0
+            TAM_WRAP,
+            /// Texture mirrors (flips) at joins over 1.0
+            TAM_MIRROR,
+            /// Texture clamps at 1.0
+            TAM_CLAMP,
+            /// Texture coordinates outside the range [0.0, 1.0] are set to the border colour
+            TAM_BORDER
+        };
+
+		/** Texture addressing mode for each texture coordinate. */
+		struct UVWAddressingMode
+		{
+			TextureAddressingMode u, v, w;
+		};
+
+        /** Enum identifying the frame indexes for faces of a cube map (not the composite 3D type.
+        */
+        enum TextureCubeFace
+        {
+            CUBE_FRONT = 0,
+            CUBE_BACK = 1,
+            CUBE_LEFT = 2,
+            CUBE_RIGHT = 3,
+            CUBE_UP = 4,
+            CUBE_DOWN = 5
+        };
+
+        /** Internal structure defining a texture effect.
+        */
+        struct TextureEffect {
+            TextureEffectType type;
+            int subtype;
+            Real arg1, arg2;
+            WaveformType waveType;
+            Real base;
+            Real frequency;
+            Real phase;
+            Real amplitude;
+            Controller<Real>* controller;
+            const Frustum* frustum;
+        };
+
+        /** Texture effects in a multimap paired array
+        */
+        typedef std::multimap<TextureEffectType, TextureEffect> EffectMap;
+
+        /** Default constructor.
+        */
+        TextureUnitState(Pass* parent);
+
+        TextureUnitState(Pass* parent, const TextureUnitState& oth );
+
+        TextureUnitState & operator = ( const TextureUnitState& oth );
+
+        /** Default destructor.
+        */
+        ~TextureUnitState();
+
+        /** Name-based constructor.
+        @param
+        name The basic name of the texture e.g. brickwall.jpg, stonefloor.png
+        @param
+        texCoordSet The index of the texture coordinate set to use.
+        */
+		TextureUnitState( Pass* parent, const String& texName, unsigned int texCoordSet = 0);
+
+        /** Get the name of current texture image for this layer.
+        @remarks
+        This will either always be a single name for this layer,
+        or will be the name of the current frame for an animated
+        or otherwise multi-frame texture.
+        @note
+        Applies to both fixed-function and programmable pipeline.
+        */
+        const String& getTextureName(void) const;
+
+        /** Sets this texture layer to use a single texture, given the
+        name of the texture to use on this layer.
+        @note
+        Applies to both fixed-function and programmable pipeline.
+        */
+        void setTextureName( const String& name, TextureType ttype = TEX_TYPE_2D);
+
+		/** Sets this texture layer to use a combination of 6 texture maps, each one relating to a face of a cube.
+        @remarks
+        Cubic textures are made up of 6 separate texture images. Each one of these is an orthoganal view of the
+        world with a FOV of 90 degrees and an aspect ratio of 1:1. You can generate these from 3D Studio by
+        rendering a scene to a reflection map of a transparent cube and saving the output files.
+        @par
+        Cubic maps can be used either for skyboxes (complete wrap-around skies, like space) or as environment
+        maps to simulate reflections. The system deals with these 2 scenarios in different ways:
+        <ol>
+        <li>
+        <p>
+        for cubic environment maps, the 6 textures are combined into a single 'cubic' texture map which
+        is then addressed using 3D texture coordinates. This is required because you don't know what
+        face of the box you're going to need to address when you render an object, and typically you
+        need to reflect more than one face on the one object, so all 6 textures are needed to be
+        'active' at once. Cubic environment maps are enabled by calling this method with the forUVW
+        parameter set to true, and then calling setEnvironmentMap(true).
+        </p>
+        <p>
+        Note that not all cards support cubic environment mapping.
+        </p>
+        </li>
+        <li>
+        <p>
+        for skyboxes, the 6 textures are kept separate and used independently for each face of the skybox.
+        This is done because not all cards support 3D cubic maps and skyboxes do not need to use 3D
+        texture coordinates so it is simpler to render each face of the box with 2D coordinates, changing
+        texture between faces.
+        </p>
+        <p>
+        Skyboxes are created by calling SceneManager::setSkyBox.
+        </p>
+        </li>
+        </ul>
+        @note
+        Applies to both fixed-function and programmable pipeline.
+        @param
+        name The basic name of the texture e.g. brickwall.jpg, stonefloor.png. There must be 6 versions
+        of this texture with the suffixes _fr, _bk, _up, _dn, _lf, and _rt (before the extension) which
+        make up the 6 sides of the box. The textures must all be the same size and be powers of 2 in width & height.
+        If you can't make your texture names conform to this, use the alternative method of the same name which takes
+        an array of texture names instead.
+        @param
+        forUVW Set to true if you want a single 3D texture addressable with 3D texture coordinates rather than
+        6 separate textures. Useful for cubic environment mapping.
+        */
+        void setCubicTextureName( const String& name, bool forUVW = false );
+
+        /** Sets this texture layer to use a combination of 6 texture maps, each one relating to a face of a cube.
+        @remarks
+        Cubic textures are made up of 6 separate texture images. Each one of these is an orthoganal view of the
+        world with a FOV of 90 degrees and an aspect ratio of 1:1. You can generate these from 3D Studio by
+        rendering a scene to a reflection map of a transparent cube and saving the output files.
+        @par
+        Cubic maps can be used either for skyboxes (complete wrap-around skies, like space) or as environment
+        maps to simulate reflections. The system deals with these 2 scenarios in different ways:
+        <ol>
+        <li>
+        <p>
+        for cubic environment maps, the 6 textures are combined into a single 'cubic' texture map which
+        is then addressed using 3D texture coordinates. This is required because you don't know what
+        face of the box you're going to need to address when you render an object, and typically you
+        need to reflect more than one face on the one object, so all 6 textures are needed to be
+        'active' at once. Cubic environment maps are enabled by calling this method with the forUVW
+        parameter set to true, and then calling setEnvironmentMap(true).
+        </p>
+        <p>
+        Note that not all cards support cubic environment mapping.
+        </p>
+        </li>
+        <li>
+        <p>
+        for skyboxes, the 6 textures are kept separate and used independently for each face of the skybox.
+        This is done because not all cards support 3D cubic maps and skyboxes do not need to use 3D
+        texture coordinates so it is simpler to render each face of the box with 2D coordinates, changing
+        texture between faces.
+        </p>
+        <p>
+        Skyboxes are created by calling SceneManager::setSkyBox.
+        </p>
+        </li>
+        </ul>
+        @note
+        Applies to both fixed-function and programmable pipeline.
+        @param
+        name The basic name of the texture e.g. brickwall.jpg, stonefloor.png. There must be 6 versions
+        of this texture with the suffixes _fr, _bk, _up, _dn, _lf, and _rt (before the extension) which
+        make up the 6 sides of the box. The textures must all be the same size and be powers of 2 in width & height.
+        If you can't make your texture names conform to this, use the alternative method of the same name which takes
+        an array of texture names instead.
+        @param
+        forUVW Set to true if you want a single 3D texture addressable with 3D texture coordinates rather than
+        6 separate textures. Useful for cubic environment mapping.
+        */
+        void setCubicTextureName( const String* const names, bool forUVW = false );
+
+        /** Sets the names of the texture images for an animated texture.
+        @remarks
+        Animated textures are just a series of images making up the frames of the animation. All the images
+        must be the same size, and their names must have a frame number appended before the extension, e.g.
+        if you specify a name of "wall.jpg" with 3 frames, the image names must be "wall_0.jpg", "wall_1.jpg"
+        and "wall_2.jpg".
+        @par
+        You can change the active frame on a texture layer by calling the setCurrentFrame method.
+        @note
+        If you can't make your texture images conform to the naming standard layed out here, you
+        can call the alternative setAnimatedTextureName method which takes an array of names instead.
+        @note
+        Applies to both fixed-function and programmable pipeline.
+        @param
+        name The base name of the textures to use e.g. wall.jpg for frames wall_0.jpg, wall_1.jpg etc.
+        @param
+        numFrames The number of frames in the sequence.
+        @param
+        duration The length of time it takes to display the whole animation sequence, in seconds.
+        If 0, no automatic transition occurs.
+        */
+        void setAnimatedTextureName( const String& name, unsigned int numFrames, Real duration = 0 );
+
+        /** Sets the names of the texture images for an animated texture.
+        @remarks
+        This an alternative method to the one where you specify a single name and let the system derive
+        the names of each frame, incase your images can't conform to this naming standard.
+        @par
+        Animated textures are just a series of images making up the frames of the animation. All the images
+        must be the same size, and you must provide their names as an array in the first parameter.
+        You can change the active frame on a texture layer by calling the setCurrentFrame method.
+        @note
+        If you can make your texture images conform to a naming standard of basicName_frame.ext, you
+        can call the alternative setAnimatedTextureName method which just takes a base name instead.
+        @note
+        Applies to both fixed-function and programmable pipeline.
+        @param
+        names Pointer to array of names of the textures to use, in frame order.
+        @param
+        numFrames The number of frames in the sequence.
+        @param
+        duration The length of time it takes to display the whole animation sequence, in seconds.
+        If 0, no automatic transition occurs.
+        */
+        void setAnimatedTextureName( const String* const names, unsigned int numFrames, Real duration = 0 );
+
+        /** Returns the width and height of the texture in the given frame.
+        */
+        std::pair< size_t, size_t > getTextureDimensions( unsigned int frame = 0 ) const;
+
+        /** Changes the active frame in an animated or multi-image texture.
+        @remarks
+        An animated texture (or a cubic texture where the images are not combined for 3D use) is made up of
+        a number of frames. This method sets the active frame.
+        @note
+        Applies to both fixed-function and programmable pipeline.
+        */
+        void setCurrentFrame( unsigned int frameNumber );
+
+        /** Gets the active frame in an animated or multi-image texture layer.
+        @note
+        Applies to both fixed-function and programmable pipeline.
+        */
+        unsigned int getCurrentFrame(void) const;
+
+        /** Gets the name of the texture associated with a frame number.
+            Throws an exception if frameNumber exceeds the number of stored frames.
+        @note
+        Applies to both fixed-function and programmable pipeline.
+        */
+        const String& getFrameTextureName(unsigned int frameNumber) const;
+
+        /** Sets the name of the texture associated with a frame.
+        @param name The name of the texture
+        @param frameNumber The frame the texture name is to be placed in
+        @note
+        Throws an exception if frameNumber exceeds the number of stored frames.
+        Applies to both fixed-function and programmable pipeline.
+        */
+        void setFrameTextureName(const String& name, unsigned int frameNumber);
+
+        /** Add a Texture name to the end of the frame container.
+        @param name The name of the texture
+        @note
+        Applies to both fixed-function and programmable pipeline.
+        */
+        void addFrameTextureName(const String& name);
+        /** deletes a specific texture frame.  The texture used is not deleted but the
+            texture will no longer be used by the Texture Unit.  An exception is raised
+            if the frame number exceeds the number of actual frames.
+        @param frameNumber The frame number of the texture to be deleted.
+        @note
+        Applies to both fixed-function and programmable pipeline.
+        */
+        void deleteFrameTextureName(const size_t frameNumber);
+        /** Gets the number of frames for a texture.
+        @note
+        Applies to both fixed-function and programmable pipeline.
+        */
+        unsigned int getNumFrames(void) const;
+
+
+		/** The type of unit to bind the texture settings to. */
+		enum BindingType
+		{
+			/** Regular fragment processing unit - the default. */
+			BT_FRAGMENT = 0,
+			/** Vertex processing unit - indicates this unit will be used for 
+				a vertex texture fetch.
+			*/
+			BT_VERTEX = 1
+		};
+		/** Enum identifying the type of content this texture unit contains.
+		*/
+		enum ContentType
+		{
+			/// Normal texture identified by name
+			CONTENT_NAMED = 0,
+			/// A shadow texture, automatically bound by engine
+			CONTENT_SHADOW = 1
+		};
+
+		/** Sets the type of unit these texture settings should be bound to. 
+		@remarks
+			Some render systems, when implementing vertex texture fetch, separate
+			the binding of textures for use in the vertex program versus those
+			used in fragment programs. This setting allows you to target the
+			vertex processing unit with a texture binding, in those cases. For
+			rendersystems which have a unified binding for the vertex and fragment
+			units, this setting makes no difference.
+		*/
+		void setBindingType(BindingType bt);
+
+		/** Gets the type of unit these texture settings should be bound to.  
+		*/
+		BindingType getBindingType(void) const;
+
+		/** Set the type of content this TextureUnitState references.
+		@remarks
+			The default is to reference a standard named texture, but this unit
+			can also reference automated content like a shadow texture.
+		*/
+		void setContentType(ContentType ct);
+		/** Get the type of content this TextureUnitState references. */
+		ContentType getContentType(void) const;
+
+        /** Returns true if this texture unit is either a series of 6 2D textures, each
+            in it's own frame, or is a full 3D cube map. You can tell which by checking
+            getTextureType.
+        @note
+        Applies to both fixed-function and programmable pipeline.
+        */
+        bool isCubic(void) const;
+
+        /** Returns true if this texture layer uses a composite 3D cubic texture.
+        @note
+        Applies to both fixed-function and programmable pipeline.
+        */
+        bool is3D(void) const;
+
+        /** Returns the type of this texture.
+        @note
+        Applies to both fixed-function and programmable pipeline.
+        */
+        TextureType getTextureType(void) const;
+
+        /** Sets the desired pixel format when load the texture.
+        */
+        void setDesiredFormat(PixelFormat desiredFormat);
+
+        /** Gets the desired pixel format when load the texture.
+        */
+        PixelFormat getDesiredFormat(void) const;
+
+        /** Sets how many mipmaps have been requested for the texture.
+		*/
+        void setNumMipmaps(int numMipmaps);
+
+        /** Gets how many mipmaps have been requested for the texture.
+		*/
+        int getNumMipmaps(void) const;
+
+		/** Sets whether this texture is requested to be loaded as alpha if single channel
+		*/
+        void setIsAlpha(bool isAlpha);
+
+		/** Gets whether this texture is requested to be loaded as alpha if single channel
+		*/
+        bool getIsAlpha(void) const;
+
+        /** Gets the index of the set of texture co-ords this layer uses.
+        @note
+        Applies to both fixed-function and programmable pipeline.
+        */
+        unsigned int getTextureCoordSet(void) const;
+
+        /** Sets the index of the set of texture co-ords this layer uses.
+        @note
+        Default is 0 for all layers. Only change this if you have provided multiple texture co-ords per
+        vertex.
+        @note
+        Applies to both fixed-function and programmable pipeline.
+        */
+        void setTextureCoordSet(unsigned int set);
+
+        /** Sets a matrix used to transform any texture coordinates on this layer.
+        @remarks
+        Texture coordinates can be modified on a texture layer to create effects like scrolling
+        textures. A texture transform can either be applied to a layer which takes the source coordinates
+        from a fixed set in the geometry, or to one which generates them dynamically (e.g. environment mapping).
+        @par
+        It's obviously a bit impractical to create scrolling effects by calling this method manually since you
+        would have to call it every framw with a slight alteration each time, which is tedious. Instead
+        you can use the ControllerManager class to create a Controller object which will manage the
+        effect over time for you. See the ControllerManager::createTextureScroller and it's sibling methods for details.<BR>
+        In addition, if you want to set the individual texture transformations rather than concatenating them
+        yourself, use setTextureScroll, setTextureScale and setTextureRotate.
+        @note
+        Has no effect in the programmable pipeline.
+        */
+        void setTextureTransform(const Matrix4& xform);
+
+        /** Gets the current texture transformation matrix.
+        @remarks
+        Causes a reclaculation of the matrix if any parameters have been changed via
+        setTextureScroll, setTextureScale and setTextureRotate.
+        @note
+        Has no effect in the programmable pipeline.
+        */
+        const Matrix4& getTextureTransform(void) const;
+
+        /** Sets the translation offset of the texture, ie scrolls the texture.
+        @remarks
+        This method sets the translation element of the texture transformation, and is easier to use than setTextureTransform if
+        you are combining translation, scaling and rotation in your texture transformation. Again if you want
+        to animate these values you need to use a Controller
+        @note
+        Has no effect in the programmable pipeline.
+        @param u The amount the texture should be moved horizontally (u direction).
+        @param v The amount the texture should be moved vertically (v direction).
+        @see
+        ControllerManager, Controller
+        */
+        void setTextureScroll(Real u, Real v);
+
+        /** As setTextureScroll, but sets only U value.
+        @note
+        Has no effect in the programmable pipeline.
+        */
+        void setTextureUScroll(Real value);
+        // get texture uscroll value
+        Real getTextureUScroll(void) const;
+
+        /** As setTextureScroll, but sets only V value.
+        @note
+        Has no effect in the programmable pipeline.
+        */
+        void setTextureVScroll(Real value);
+        // get texture vscroll value
+        Real getTextureVScroll(void) const;
+
+        /** As setTextureScale, but sets only U value.
+        @note
+        Has no effect in the programmable pipeline.
+        */
+        void setTextureUScale(Real value);
+        // get texture uscale value
+        Real getTextureUScale(void) const;
+
+        /** As setTextureScale, but sets only V value.
+        @note
+        Has no effect in the programmable pipeline.
+        */
+        void setTextureVScale(Real value);
+        // get texture vscale value
+        Real getTextureVScale(void) const;
+
+        /** Sets the scaling factor applied to texture coordinates.
+        @remarks
+        This method sets the scale element of the texture transformation, and is easier to use than
+        setTextureTransform if you are combining translation, scaling and rotation in your texture transformation. Again if you want
+        to animate these values you need to use a Controller (see ControllerManager and it's methods for
+        more information).
+        @note
+        Has no effect in the programmable pipeline.
+        @param
+        uScale The value by which the texture is to be scaled horizontally.
+        @param
+        vScale The value by which the texture is to be scaled vertically.
+        */
+        void setTextureScale(Real uScale, Real vScale);
+
+        /** Sets the anticlockwise rotation factor applied to texture coordinates.
+        @remarks
+        This sets a fixed rotation angle - if you wish to animate this, see the
+        ControllerManager::createTextureRotater method.
+        @note
+        Has no effect in the programmable pipeline.
+        @param
+        angle The angle of rotation (anticlockwise).
+        */
+        void setTextureRotate(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void setTextureRotate(Real angle) {
+            setTextureRotate ( Degree(angle) );
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+        // get texture rotation effects angle value
+        const Radian& getTextureRotate(void) const;
+
+        /** Gets the texture addressing mode for a given coordinate, 
+		 	i.e. what happens at uv values above 1.0.
+        @note
+        	The default is TAM_WRAP i.e. the texture repeats over values of 1.0.
+        */
+        const UVWAddressingMode& getTextureAddressingMode(void) const;
+
+        /** Sets the texture addressing mode, i.e. what happens at uv values above 1.0.
+        @note
+        The default is TAM_WRAP i.e. the texture repeats over values of 1.0.
+		@note This is a shortcut method which sets the addressing mode for all
+			coordinates at once; you can also call the more specific method
+			to set the addressing mode per coordinate.
+        @note
+        This applies for both the fixed-function and programmable pipelines.
+        */
+        void setTextureAddressingMode( TextureAddressingMode tam);
+
+        /** Sets the texture addressing mode, i.e. what happens at uv values above 1.0.
+        @note
+        The default is TAM_WRAP i.e. the texture repeats over values of 1.0.
+        @note
+        This applies for both the fixed-function and programmable pipelines.
+		*/
+        void setTextureAddressingMode( TextureAddressingMode u, 
+			TextureAddressingMode v, TextureAddressingMode w);
+
+        /** Sets the texture addressing mode, i.e. what happens at uv values above 1.0.
+        @note
+        The default is TAM_WRAP i.e. the texture repeats over values of 1.0.
+        @note
+        This applies for both the fixed-function and programmable pipelines.
+		*/
+        void setTextureAddressingMode( const UVWAddressingMode& uvw);
+
+        /** Sets the texture border colour.
+        @note
+            The default is ColourValue::Black, and this value only used when addressing mode
+            is TAM_BORDER.
+        @note
+            This applies for both the fixed-function and programmable pipelines.
+		*/
+        void setTextureBorderColour(const ColourValue& colour);
+
+        /** Sets the texture border colour.
+        @note
+            The default is ColourValue::Black, and this value only used when addressing mode
+            is TAM_BORDER.
+		*/
+        const ColourValue& getTextureBorderColour(void) const;
+
+		/** Setting advanced blending options.
+        @remarks
+        This is an extended version of the TextureUnitState::setColourOperation method which allows
+        extremely detailed control over the blending applied between this and earlier layers.
+        See the IMPORTANT note below about the issues between mulitpass and multitexturing that
+        using this method can create.
+        @par
+        Texture colour operations determine how the final colour of the surface appears when
+        rendered. Texture units are used to combine colour values from various sources (ie. the
+        diffuse colour of the surface from lighting calculations, combined with the colour of
+        the texture). This method allows you to specify the 'operation' to be used, ie. the
+        calculation such as adds or multiplies, and which values to use as arguments, such as
+        a fixed value or a value from a previous calculation.
+        @par
+        The defaults for each layer are:
+        <ul>
+        <li>op = LBX_MODULATE</li>
+        <li>source1 = LBS_TEXTURE</li>
+        <li>source2 = LBS_CURRENT</li>
+        </ul>
+        ie. each layer takes the colour results of the previous layer, and multiplies them
+        with the new texture being applied. Bear in mind that colours are RGB values from
+        0.0 - 1.0 so multiplying them together will result in values in the same range,
+        'tinted' by the multiply. Note however that a straight multiply normally has the
+        effect of darkening the textures - for this reason there are brightening operations
+        like LBO_MODULATE_X2. See the LayerBlendOperation and LayerBlendSource enumerated
+        types for full details.
+        @note
+        Because of the limitations on some underlying APIs (Direct3D included)
+        the LBS_TEXTURE argument can only be used as the first argument, not the second.
+        @par
+        The final 3 parameters are only required if you decide to pass values manually
+        into the operation, i.e. you want one or more of the inputs to the colour calculation
+        to come from a fixed value that you supply. Hence you only need to fill these in if
+        you supply LBS_MANUAL to the corresponding source, or use the LBX_BLEND_MANUAL
+        operation.
+        @warning
+        Ogre tries to use multitexturing hardware to blend texture layers
+        together. However, if it runs out of texturing units (e.g. 2 of a GeForce2, 4 on a
+        GeForce3) it has to fall back on multipass rendering, i.e. rendering the same object
+        multiple times with different textures. This is both less efficient and there is a smaller
+        range of blending operations which can be performed. For this reason, if you use this method
+        you MUST also call TextureUnitState::setColourOpMultipassFallback to specify which effect you
+        want to fall back on if sufficient hardware is not available.
+        @note
+        This has no effect in the programmable pipeline.
+        @param
+        If you wish to avoid having to do this, use the simpler TextureUnitState::setColourOperation method
+        which allows less flexible blending options but sets up the multipass fallback automatically,
+        since it only allows operations which have direct multipass equivalents.
+        @param
+        op The operation to be used, e.g. modulate (multiply), add, subtract
+        @param
+        source1 The source of the first colour to the operation e.g. texture colour
+        @param
+        source2 The source of the second colour to the operation e.g. current surface colour
+        @param
+        arg1 Manually supplied colour value (only required if source1 = LBS_MANUAL)
+        @param
+        arg2 Manually supplied colour value (only required if source2 = LBS_MANUAL)
+        @param
+        manualBlend Manually supplied 'blend' value - only required for operations
+        which require manual blend e.g. LBX_BLEND_MANUAL
+        */
+        void setColourOperationEx(
+            LayerBlendOperationEx op,
+            LayerBlendSource source1 = LBS_TEXTURE,
+            LayerBlendSource source2 = LBS_CURRENT,
+
+            const ColourValue& arg1 = ColourValue::White,
+            const ColourValue& arg2 = ColourValue::White,
+
+            Real manualBlend = 0.0);
+
+        /** Determines how this texture layer is combined with the one below it (or the diffuse colour of
+        the geometry if this is layer 0).
+        @remarks
+        This method is the simplest way to blend tetxure layers, because it requires only one parameter,
+        gives you the most common blending types, and automatically sets up 2 blending methods: one for
+        if single-pass multitexturing hardware is available, and another for if it is not and the blending must
+        be achieved through multiple rendering passes. It is, however, quite limited and does not expose
+        the more flexible multitexturing operations, simply because these can't be automatically supported in
+        multipass fallback mode. If want to use the fancier options, use TextureUnitState::setColourOperationEx,
+        but you'll either have to be sure that enough multitexturing units will be available, or you should
+        explicitly set a fallback using TextureUnitState::setColourOpMultipassFallback.
+        @note
+        The default method is LBO_MODULATE for all layers.
+        @note
+        This option has no effect in the programmable pipeline.
+        @param
+        op One of the LayerBlendOperation enumerated blending types.
+        */
+        void setColourOperation( const LayerBlendOperation op);
+
+        /** Sets the multipass fallback operation for this layer, if you used TextureUnitState::setColourOperationEx
+        and not enough multitexturing hardware is available.
+        @remarks
+        Because some effects exposed using TextureUnitState::setColourOperationEx are only supported under
+        multitexturing hardware, if the hardware is lacking the system must fallback on multipass rendering,
+        which unfortunately doesn't support as many effects. This method is for you to specify the fallback
+        operation which most suits you.
+        @par
+        You'll notice that the interface is the same as the Material::setSceneBlending method; this is
+        because multipass rendering IS effectively scene blending, since each layer is rendered on top
+        of the last using the same mechanism as making an object transparent, it's just being rendered
+        in the same place repeatedly to get the multitexture effect.
+        @par
+        If you use the simpler (and hence less flexible) TextureUnitState::setColourOperation method you
+        don't need to call this as the system sets up the fallback for you.
+        @note
+        This option has no effect in the programmable pipeline, because there is no multipass fallback
+        and multitexture blending is handled by the fragment shader.
+        */
+        void setColourOpMultipassFallback( const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor);
+
+        /** Get multitexturing colour blending mode.
+        */
+        const LayerBlendModeEx& getColourBlendMode(void) const;
+
+        /** Get multitexturing alpha blending mode.
+        */
+        const LayerBlendModeEx& getAlphaBlendMode(void) const;
+
+        /** Get the multipass fallback for colour blending operation source factor.
+        */
+        SceneBlendFactor getColourBlendFallbackSrc(void) const;
+
+        /** Get the multipass fallback for colour blending operation destination factor.
+        */
+        SceneBlendFactor getColourBlendFallbackDest(void) const;
+
+        /** Sets the alpha operation to be applied to this texture.
+        @remarks
+        This works in exactly the same way as setColourOperation, except
+        that the effect is applied to the level of alpha (i.e. transparency)
+        of the texture rather than its colour. When the alpha of a texel (a pixel
+        on a texture) is 1.0, it is opaque, wheras it is fully transparent if the
+        alpha is 0.0. Please refer to the setColourOperation method for more info.
+        @param
+        op The operation to be used, e.g. modulate (multiply), add, subtract
+        @param
+        source1 The source of the first alpha value to the operation e.g. texture alpha
+        @param
+        source2 The source of the second alpha value to the operation e.g. current surface alpha
+        @param
+        arg1 Manually supplied alpha value (only required if source1 = LBS_MANUAL)
+        @param
+        arg2 Manually supplied alpha value (only required if source2 = LBS_MANUAL)
+        @param
+        manualBlend Manually supplied 'blend' value - only required for operations
+        which require manual blend e.g. LBX_BLEND_MANUAL
+        @see
+        setColourOperation
+        @note
+        This option has no effect in the programmable pipeline.
+        */
+        void setAlphaOperation(LayerBlendOperationEx op,
+            LayerBlendSource source1 = LBS_TEXTURE,
+            LayerBlendSource source2 = LBS_CURRENT,
+            Real arg1 = 1.0,
+            Real arg2 = 1.0,
+            Real manualBlend = 0.0);
+
+        /** Generic method for setting up texture effects.
+        @remarks
+        Allows you to specify effects directly by using the TextureEffectType enumeration. The
+        arguments that go with it depend on the effect type. Only one effect of
+        each type can be applied to a texture layer.
+        @par
+        This method is used internally by Ogre but it is better generally for applications to use the
+        more intuitive specialised methods such as setEnvironmentMap and setScroll.
+        @note
+        This option has no effect in the programmable pipeline.
+        */
+        void addEffect(TextureEffect& effect);
+
+        /** Turns on/off texture coordinate effect that makes this layer an environment map.
+        @remarks
+        Environment maps make an object look reflective by using the object's vertex normals relative
+        to the camera view to generate texture coordinates.
+        @par
+        The vectors generated can either be used to address a single 2D texture which
+        is a 'fish-eye' lens view of a scene, or a 3D cubic environment map which requires 6 textures
+        for each side of the inside of a cube. The type depends on what texture you set up - if you use the
+        setTextureName method then a 2D fisheye lens texture is required, whereas if you used setCubicTextureName
+        then a cubic environemnt map will be used.
+        @par
+        This effect works best if the object has lots of gradually changing normals. The texture also
+        has to be designed for this effect - see the example spheremap.png included with the sample
+        application for a 2D environment map; a cubic map can be generated by rendering 6 views of a
+        scene to each of the cube faces with orthoganal views.
+        @note
+        Enabling this disables any other texture coordinate generation effects.
+        However it can be combined with texture coordinate modification functions, which then operate on the
+        generated coordinates rather than static model texture coordinates.
+        @param
+        enable True to enable, false to disable
+        @param
+        planar If set to true, instead of being based on normals the environment effect is based on
+        vertex positions. This is good for planar surfaces.
+        @note
+        This option has no effect in the programmable pipeline.
+        */
+        void setEnvironmentMap(bool enable, EnvMapType envMapType = ENV_CURVED);
+
+        /** Sets up an animated scroll for the texture layer.
+        @note
+        Useful for creating constant scrolling effects on a texture layer (for varying scrolls, see setTransformAnimation).
+        @param
+        uSpeed The number of horizontal loops per second (+ve=moving right, -ve = moving left)
+        @param
+        vSpeed The number of vertical loops per second (+ve=moving up, -ve= moving down)
+        @note
+        This option has no effect in the programmable pipeline.
+        */
+        void setScrollAnimation(Real uSpeed, Real vSpeed);
+
+        /** Sets up an animated texture rotation for this layer.
+        @note
+        Useful for constant rotations (for varying rotations, see setTransformAnimation).
+        @param
+        speed The number of complete anticlockwise revolutions per second (use -ve for clockwise)
+        @note
+        This option has no effect in the programmable pipeline.
+        */
+        void setRotateAnimation(Real speed);
+
+        /** Sets up a general time-relative texture modification effect.
+        @note
+        This can be called multiple times for different values of ttype, but only the latest effect
+        applies if called multiple time for the same ttype.
+        @param
+        ttype The type of transform, either translate (scroll), scale (stretch) or rotate (spin)
+        @param
+        waveType The shape of the wave, see WaveformType enum for details
+        @param
+        base The base value for the function (range of output = {base, base + amplitude})
+        @param
+        frequency The speed of the wave in cycles per second
+        @param
+        phase The offset of the start of the wave, e.g. 0.5 to start half-way through the wave
+        @param
+        amplitude Scales the output so that instead of lying within 0..1 it lies within 0..1*amplitude for exaggerated effects
+        @note
+        This option has no effect in the programmable pipeline.
+        */
+        void setTransformAnimation( const TextureTransformType ttype,
+            const WaveformType waveType, Real base = 0, Real frequency = 1, Real phase = 0, Real amplitude = 1 );
+
+
+        /** Enables or disables projective texturing on this texture unit.
+        @remarks
+            Projective texturing allows you to generate texture coordinates 
+            based on a Frustum, which gives the impression that a texture is
+            being projected onto the surface. Note that once you have called
+            this method, the texture unit continues to monitor the Frustum you 
+            passed in and the projection will change if you can alter it. It also
+            means that you must ensure that the Frustum object you pass a pointer
+            to remains in existence for as long as this TextureUnitState does.
+        @par
+            This effect cannot be combined with other texture generation effects, 
+            such as environment mapping. It also has no effect on passes which 
+            have a vertex program enabled - projective texturing has to be done
+            in the vertex program instead.
+        @param enabled Whether to enable / disable
+        @param projectionSettings The Frustum which will be used to derive the 
+            projection parameters.
+        */
+        void setProjectiveTexturing(bool enabled, const Frustum* projectionSettings = 0);
+
+        /** Removes all effects applied to this texture layer.
+        */
+        void removeAllEffects(void);
+
+        /** Removes a single effect applied to this texture layer.
+        @note
+        Because you can only have 1 effect of each type (e.g. 1 texture coordinate generation) applied
+        to a layer, only the effect type is required.
+        */
+        void removeEffect( const TextureEffectType type );
+
+        /** Determines if this texture layer is currently blank.
+        @note
+        This can happen if a texture fails to load or some other non-fatal error. Worth checking after
+        setting texture name.
+        */
+        bool isBlank(void) const;
+
+        /** Sets this texture layer to be blank.
+        */
+        void setBlank(void);
+
+		/** Tests if the texture associated with this unit has failed to load.
+		*/
+		bool isTextureLoadFailing() const { return mTextureLoadFailed; }
+
+		/** Tells the unit to retry loading the texture if it had failed to load.
+		*/
+		void retryTextureLoad() { mTextureLoadFailed = false; }
+
+        // get texture effects in a multimap paired array
+        const EffectMap& getEffects(void) const;
+        // get the animated-texture animation duration
+        Real getAnimationDuration(void) const;
+
+        /** Set the texture filtering for this unit, using the simplified interface.
+        @remarks
+            You also have the option of specifying the minification, magnification
+            and mip filter individually if you want more control over filtering
+            options. See the alternative setTextureFiltering methods for details.
+        @note
+        This option applies in both the fixed function and the programmable pipeline.
+        @param filterType The high-level filter type to use.
+        */
+        void setTextureFiltering(TextureFilterOptions filterType);
+        /** Set a single filtering option on this texture unit. 
+        @params ftype The filtering type to set
+        @params opts The filtering option to set
+        */
+        void setTextureFiltering(FilterType ftype, FilterOptions opts);
+        /** Set a the detailed filtering options on this texture unit. 
+        @params minFilter The filtering to use when reducing the size of the texture. 
+            Can be FO_POINT, FO_LINEAR or FO_ANISOTROPIC
+        @params magFilter The filtering to use when increasing the size of the texture
+            Can be FO_POINT, FO_LINEAR or FO_ANISOTROPIC
+        @params mipFilter The filtering to use between mip levels
+            Can be FO_NONE (turns off mipmapping), FO_POINT or FO_LINEAR (trilinear filtering)
+        */
+        void setTextureFiltering(FilterOptions minFilter, FilterOptions magFilter, FilterOptions mipFilter);
+        // get the texture filtering for the given type
+        FilterOptions getTextureFiltering(FilterType ftpye) const;
+
+        /** Sets the anisotropy level to be used for this texture level.
+        @par maxAniso The maximal anisotropy level, should be between 2 and the maximum supported by hardware (1 is the default, ie. no anisotrophy).
+        @note
+        This option applies in both the fixed function and the programmable pipeline.
+        */
+        void setTextureAnisotropy(unsigned int maxAniso);
+        // get this layer texture anisotropy level
+        unsigned int getTextureAnisotropy() const;
+
+		/** Sets the bias value applied to the mipmap calculation.
+		@remarks
+			You can alter the mipmap calculation by biasing the result with a 
+			single floating point value. After the mip level has been calculated,
+			this bias value is added to the result to give the final mip level.
+			Lower mip levels are larger (higher detail), so a negative bias will
+			force the larger mip levels to be used, and a positive bias
+			will cause smaller mip levels to be used. The bias values are in 
+			mip levels, so a -1 bias will force mip levels one larger than by the
+			default calculation.
+		@param bias The bias value as described above, can be positive or negative.
+		*/
+		void setTextureMipmapBias(float bias) { mMipmapBias = bias; }
+		/** Gets the bias value applied to the mipmap calculation.
+		@see TextureUnitState::setTextureMipmapBias
+		*/
+		float getTextureMipmapBias(void) const { return mMipmapBias; }
+
+        /// Gets the parent Pass object
+        Pass* getParent(void) const { return mParent; }
+
+		/** Internal method for loading this object as part of Material::load */
+		void _load(void);
+		/** Internal method for unloading this object as part of Material::unload */
+		void _unload(void);
+        /// Returns whether this unit has texture coordinate generation that depends on the camera
+        bool hasViewRelativeTextureCoordinateGeneration(void) const;
+
+        // Is this loaded?
+        bool isLoaded(void) const;
+        /** Tells the class that it needs recompilation. */
+        void _notifyNeedsRecompile(void);
+
+        /** Set the name of the Texture Unit State
+        @remarks
+            The name of the Texture Unit State is optional.  Its usefull in material scripts where a material could inherit
+            from another material and only want to modify a particalar Texture Unit State.
+        */
+        void setName(const String& name);
+        /// get the name of the Texture Unit State
+        const String& getName(void) const { return mName; }
+
+        /** Set the alias name used for texture frame names
+        @param name can be any sequence of characters and does not have to be unique           
+        */
+        void setTextureNameAlias(const String& name);
+        /** gets the Texture Name Alias of the Texture Unit.
+        */
+        const String& getTextureNameAlias(void) const { return mTextureNameAlias;}
+
+        /** Applies texture names to Texture Unit State with matching texture name aliases.
+            If no matching aliases are found then the TUS state does not change.
+        @remarks
+            Cubic, 1d, 2d, and 3d textures are determined from current state of the Texture Unit.
+            Assumes animated frames are sequentially numbered in the name.
+            If matching texture aliases are found then true is returned.
+
+        @param
+            aliasList is a map container of texture alias, texture name pairs
+        @param
+            apply set true to apply the texture aliases else just test to see if texture alias matches are found.
+        @return
+            True if matching texture aliases were found in the Texture Unit State.
+        */
+        bool applyTextureAliases(const AliasTextureNamePairList& aliasList, const bool apply = true);
+
+		/** Notify this object that its parent has changed */
+		void _notifyParent(Pass* parent);
+
+		/** Get the texture pointer for the current frame. */
+		const TexturePtr& _getTexturePtr(void) const;
+		/** Get the texture pointer for a given frame. */
+		const TexturePtr& _getTexturePtr(size_t frame) const;
+	
+		/** Set the texture pointer for the current frame (internal use only!). */
+		void _setTexturePtr(const TexturePtr& texptr);
+		/** Set the texture pointer for a given frame (internal use only!). */
+		void _setTexturePtr(const TexturePtr& texptr, size_t frame);
+
+		/** Gets the animation controller (as created because of setAnimatedTexture)
+			if it exists.
+		*/
+		Controller<Real>* _getAnimController() const { return mAnimController; }
+protected:
+        // State
+        /// The current animation frame.
+        unsigned int mCurrentFrame;
+
+        /// Duration of animation in seconds
+        Real mAnimDuration;            
+        bool mCubic; // is this a series of 6 2D textures to make up a cube?
+		
+        TextureType mTextureType; 
+        PixelFormat mDesiredFormat;
+		int mTextureSrcMipmaps; // Request number of mipmaps
+
+        unsigned int mTextureCoordSetIndex;
+        UVWAddressingMode mAddressMode;
+        ColourValue mBorderColour;
+
+        LayerBlendModeEx mColourBlendMode;
+        SceneBlendFactor mColourBlendFallbackSrc;
+        SceneBlendFactor mColourBlendFallbackDest;
+
+        LayerBlendModeEx mAlphaBlendMode;
+        mutable bool mTextureLoadFailed;
+        bool mIsAlpha;
+
+        mutable bool mRecalcTexMatrix;
+        Real mUMod, mVMod;
+        Real mUScale, mVScale;
+        Radian mRotate;
+        mutable Matrix4 mTexModMatrix;
+
+        /// Texture filtering - minification
+        FilterOptions mMinFilter;
+        /// Texture filtering - magnification
+        FilterOptions mMagFilter;
+        /// Texture filtering - mipmapping
+        FilterOptions mMipFilter;
+        ///Texture anisotropy
+        unsigned int mMaxAniso;
+		/// Mipmap bias (always float, not Real)
+		float mMipmapBias;
+
+        bool mIsDefaultAniso;
+        bool mIsDefaultFiltering;
+		/// Binding type (fragment or vertex pipeline)
+		BindingType mBindingType;
+		/// Content type of texture (normal loaded texture, auto-texture)
+		ContentType mContentType;
+
+        //-----------------------------------------------------------------------------
+        // Complex members (those that can't be copied using memcpy) are at the end to 
+        // allow for fast copying of the basic members.
+        //
+        std::vector<String> mFrames;
+		mutable std::vector<TexturePtr> mFramePtrs;
+        String mName;               // optional name for the TUS
+        String mTextureNameAlias;       // optional alias for texture frames
+        EffectMap mEffects;
+        //-----------------------------------------------------------------------------
+
+        //-----------------------------------------------------------------------------
+        // Pointer members (those that can't be copied using memcpy), and MUST
+        // preserving even if assign from others
+        //
+        Pass* mParent;
+        Controller<Real>* mAnimController;
+        //-----------------------------------------------------------------------------
+
+
+        /** Internal method for calculating texture matrix.
+        */
+        void recalcTextureMatrix(void) const;
+
+        /** Internal method for creating animation controller.
+        */
+        void createAnimController(void);
+
+        /** Internal method for creating texture effect controller.
+        */
+        void createEffectController(TextureEffect& effect);
+
+		/** Internal method for ensuring the texture for a given frame is loaded. */
+		void ensureLoaded(size_t frame) const;
+
+
+    };
+
+
+}
+
+#endif
Index: /OgreMain/include/OgreTimer.h
===================================================================
--- /OgreMain/include/OgreTimer.h	(revision 5)
+++ /OgreMain/include/OgreTimer.h	(revision 5)
@@ -0,0 +1,44 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OgreCommonTimer_H__
+#define __OgreCommonTimer_H__
+
+#include "OgrePrerequisites.h"
+#include "OgrePlatform.h"
+
+//Bring in the specific platform's header file
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+# include "WIN32/OgreTimerImp.h"
+#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
+# include "GLX/OgreTimerImp.h"
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+# include "OSX/OgreTimerImp.h"
+#endif
+
+#endif
Index: /OgreMain/include/OgreUTFString.h
===================================================================
--- /OgreMain/include/OgreUTFString.h	(revision 5)
+++ /OgreMain/include/OgreUTFString.h	(revision 5)
@@ -0,0 +1,2406 @@
+// Modified from OpenGUI under lenient license
+// Original copyright details and licensing below:
+// OpenGUI (http://opengui.sourceforge.net)
+// This source code is released under the BSD License
+
+// Permission is given to the Ogre project to use the contents of file within its
+// source and binary applications, as well as any derivative works, in accordance
+// with the terms of any license under which Ogre is or will be distributed.
+//
+// Ogre may relicense its copy of this file, as well as any OpenGUI released updates
+// to this file, under any terms that it deems fit, and is not required to maintain
+// the original BSD licensing terms of this file, however OpenGUI retains the right
+// to present its copy of this file under the terms of any license under which
+// OpenGUI is distributed.
+//
+// Ogre is not required to release to OpenGUI any future changes that it makes to
+// this file, and understands and agrees that any such changes that are released
+// back to OpenGUI will become available under the terms of any license under which
+// OpenGUI is distributed.
+//
+// For brevity, this permission text may be removed from this file if desired.
+// The original record kept within the SourceForge (http://sourceforge.net/) tracker
+// is sufficient.
+//
+// - Eric Shorkey (zero/zeroskill) <opengui@rightbracket.com> [January 20th, 2007]
+
+#ifndef __OGRE_UTFSTRING_H__
+#define __OGRE_UTFSTRING_H__
+
+
+#include "OgrePrerequisites.h"
+
+#if OGRE_UNICODE_SUPPORT 
+
+// these are explained later
+#include <iterator>
+#include <string>
+#include <stdexcept>
+
+// Workaround for VC7:
+//      when build with /MD or /MDd, VC7 have both std::basic_string<unsigned short> and
+// basic_string<__wchar_t> instantiated in msvcprt[d].lib/MSVCP71[D].dll, but the header
+// files tells compiler that only one of them is over there (based on /Zc:wchar_t compile
+// option). And since this file used both of them, causing compiler instantiating another
+// one in user object code, which lead to duplicate symbols with msvcprt.lib/MSVCP71[D].dll.
+//
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC && (1300 <= OGRE_COMP_VER && OGRE_COMP_VER <= 1310)
+
+# if defined(_DLL_CPPLIB)
+
+namespace std
+{
+    template class _CRTIMP2 basic_string<unsigned short, char_traits<unsigned short>,
+	    allocator<unsigned short> >;
+
+    template class _CRTIMP2 basic_string<__wchar_t, char_traits<__wchar_t>,
+	    allocator<__wchar_t> >;
+}
+
+# endif // defined(_DLL_CPPLIB)
+
+#endif  // OGRE_COMPILER == OGRE_COMPILER_MSVC && OGRE_COMP_VER == 1300
+
+
+namespace Ogre {
+
+	/* READ THIS NOTICE BEFORE USING IN YOUR OWN APPLICATIONS
+	=NOTICE=
+	This class is not a complete Unicode solution. It purposefully does not
+	provide certain functionality, such as proper lexical sorting for
+	Unicode values. It does provide comparison operators for the sole purpose
+	of using UTFString as an index with std::map and other operator< sorted
+	containers, but it should NOT be relied upon for meaningful lexical
+	operations, such as alphabetical sorts. If you need this type of
+	functionality, look into using ICU instead (http://icu.sourceforge.net/).
+
+	=REQUIREMENTS=
+	There are a few requirements for proper operation. They are fairly small,
+	and shouldn't restrict usage on any reasonable target.
+	* Compiler must support unsigned 16-bit integer types
+	* Compiler must support signed 32-bit integer types
+	* wchar_t must be either UTF-16 or UTF-32 encoding, and specified as such
+	    using the WCHAR_UTF16 macro as outlined below.
+	* You must include <iterator>, <string>, and <wchar>. Probably more, but
+	    these are the most obvious.
+
+	=REQUIRED PREPROCESSOR MACROS=
+	This class requires two preprocessor macros to be defined in order to
+	work as advertised.
+	INT32 - must be mapped to a signed 32 bit integer (ex. #define INT32 int)
+	UINT16 - must be mapped to an unsigned 16 bit integer (ex. #define UINT32 unsigned short)
+
+	Additionally, a third macro should be defined to control the evaluation of wchar_t:
+	WCHAR_UTF16 - should be defined when wchar_t represents UTF-16 code points,
+	    such as in Windows. Otherwise it is assumed that wchar_t is a 32-bit
+		integer representing UTF-32 code points.
+	*/
+
+	// THIS IS A VERY BRIEF AUTO DETECTION. YOU MAY NEED TO TWEAK THIS
+#ifdef __STDC_ISO_10646__
+// for any compiler that provides this, wchar_t is guaranteed to hold any Unicode value with a single code point (32-bit or larger)
+// so we can safely skip the rest of the testing
+#else // #ifdef __STDC_ISO_10646__
+#if defined( __WIN32__ ) || defined( _WIN32 )
+#define WCHAR_UTF16 // All currently known Windows platforms utilize UTF-16 encoding in wchar_t
+#else // #if defined( __WIN32__ ) || defined( _WIN32 )
+#if WCHAR_MAX <= 0xFFFF // this is a last resort fall back test; WCHAR_MAX is defined in <wchar.h>
+#define WCHAR_UTF16 // best we can tell, wchar_t is not larger than 16-bit
+#endif // #if WCHAR_MAX <= 0xFFFF
+#endif // #if defined( __WIN32__ ) || defined( _WIN32 )
+#endif // #ifdef __STDC_ISO_10646__
+
+
+// OGRE_IS_NATIVE_WCHAR_T means that wchar_t isn't a typedef of
+// uint16 or uint32.
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+
+// Don't define wchar_t related functions since it'll duplicate
+// with UTFString::code_point related functions when compile
+// without /Zc:wchar_t, because in this case both of them are
+// a typedef of uint16.
+# if defined(_NATIVE_WCHAR_T_DEFINED)
+#   define OGRE_IS_NATIVE_WCHAR_T      1
+# else
+#   define OGRE_IS_NATIVE_WCHAR_T      0
+# endif
+
+#else   // OGRE_COMPILER != OGRE_COMPILER_MSVC
+
+// Assumed wchar_t is natively for other compilers
+#   define OGRE_IS_NATIVE_WCHAR_T     1
+
+#endif  // OGRE_COMPILER == OGRE_COMPILER_MSVC
+
+	//! A UTF-16 string with implicit conversion to/from std::string and std::wstring
+	/*! This class provides a complete 1 to 1 map of most std::string functions (at least to my
+	knowledge). Implicit conversions allow this string class to work with all common C++ string
+	formats, with specialty functions defined where implicit conversion would cause potential
+	problems or is otherwise unavailable.
+
+	Some additional functionality is present to assist in working with characters using the
+	32-bit UTF-32 encoding. (Which is guaranteed to fit any Unicode character into a single
+	code point.) \b Note: Reverse iterators do not have this functionality due to the
+	ambiguity that surrounds working with UTF-16 in reverse. (Such as, where should an
+	iterator point to represent the beginning of a surrogate pair?)
+
+
+	\par Supported Input Types
+	The supported string types for input, and their assumed encoding schemes, are:
+	- std::string (UTF-8)
+	- char* (UTF-8)
+	- std::wstring (autodetected UTF-16 / UTF-32 based on compiler)
+	- wchar_t* (autodetected UTF-16 / UTF-32 based on compiler)
+
+
+	\see
+	- For additional information on UTF-16 encoding: http://en.wikipedia.org/wiki/UTF-16
+	- For additional information on UTF-8 encoding: http://en.wikipedia.org/wiki/UTF-8
+	- For additional information on UTF-32 encoding: http://en.wikipedia.org/wiki/UTF-32
+	*/
+	class UTFString {
+		// constants used in UTF-8 conversions
+		static const unsigned char _lead1 = 0xC0;      //110xxxxx
+		static const unsigned char _lead1_mask = 0x1F; //00011111
+		static const unsigned char _lead2 = 0xE0;      //1110xxxx
+		static const unsigned char _lead2_mask = 0x0F; //00001111
+		static const unsigned char _lead3 = 0xF0;      //11110xxx
+		static const unsigned char _lead3_mask = 0x07; //00000111
+		static const unsigned char _lead4 = 0xF8;      //111110xx
+		static const unsigned char _lead4_mask = 0x03; //00000011
+		static const unsigned char _lead5 = 0xFC;      //1111110x
+		static const unsigned char _lead5_mask = 0x01; //00000001
+		static const unsigned char _cont = 0x80;       //10xxxxxx
+		static const unsigned char _cont_mask = 0x3F;  //00111111
+
+	public:
+		//! size type used to indicate string size and character positions within the string
+		typedef size_t size_type;
+		//! the usual constant representing: not found, no limit, etc
+		static const size_type npos = ~0;
+
+		//! a single 32-bit Unicode character
+		typedef uint32 unicode_char;
+
+		//! a single UTF-16 code point
+		typedef uint16 code_point;
+
+		//! value type typedef for use in iterators
+		typedef code_point value_type;
+
+		typedef std::basic_string<code_point> dstring; // data string
+
+		//! string type used for returning UTF-32 formatted data
+		typedef std::basic_string<unicode_char> utf32string;
+
+		//! This exception is used when invalid data streams are encountered
+	class invalid_data: public std::runtime_error { /* i don't know why the beautifier is freaking out on this line */
+		public:
+			//! constructor takes a string message that can be later retrieved by the what() function
+			explicit invalid_data( const std::string& _Message ): std::runtime_error( _Message ) {
+				/* The thing is, Bob, it's not that I'm lazy, it's that I just don't care. */
+			}
+		};
+
+		//#########################################################################
+		//! base iterator class for UTFString
+	class _base_iterator: public std::iterator<std::random_access_iterator_tag, value_type> { /* i don't know why the beautifier is freaking out on this line */
+			friend class UTFString;
+		protected:
+			_base_iterator() {
+				mString = 0;
+			}
+
+			void _seekFwd( size_type c ) {
+				mIter += c;
+			}
+			void _seekRev( size_type c ) {
+				mIter -= c;
+			}
+			void _become( const _base_iterator& i ) {
+				mIter = i.mIter;
+				mString = i.mString;
+			}
+			bool _test_begin() const {
+				return mIter == mString->mData.begin();
+			}
+			bool _test_end() const {
+				return mIter == mString->mData.end();
+			}
+			size_type _get_index() const {
+				return mIter - mString->mData.begin();
+			}
+			void _jump_to( size_type index ) {
+				mIter = mString->mData.begin() + index;
+			}
+
+			unicode_char _getCharacter() const {
+				size_type current_index = _get_index();
+				return mString->getChar( current_index );
+			}
+			int _setCharacter( unicode_char uc ) {
+				size_type current_index = _get_index();
+				int change = mString->setChar( current_index, uc );
+				_jump_to( current_index );
+				return change;
+			}
+
+			void _moveNext() {
+				_seekFwd( 1 ); // move 1 code point forward
+				if ( _test_end() ) return; // exit if we hit the end
+				if ( _utf16_surrogate_follow( mIter[0] ) ) {
+					// landing on a follow code point means we might be part of a bigger character
+					// so we test for that
+					code_point lead_half = 0;
+					//NB: we can't possibly be at the beginning here, so no need to test
+					lead_half = mIter[-1]; // check the previous code point to see if we're part of a surrogate pair
+					if ( _utf16_surrogate_lead( lead_half ) ) {
+						_seekFwd( 1 ); // if so, then advance 1 more code point
+					}
+				}
+			}
+			void _movePrev() {
+				_seekRev( 1 ); // move 1 code point backwards
+				if ( _test_begin() ) return; // exit if we hit the beginning
+				if ( _utf16_surrogate_follow( mIter[0] ) ) {
+					// landing on a follow code point means we might be part of a bigger character
+					// so we test for that
+					code_point lead_half = 0;
+					lead_half = mIter[-1]; // check the previous character to see if we're part of a surrogate pair
+					if ( _utf16_surrogate_lead( lead_half ) ) {
+						_seekRev( 1 ); // if so, then rewind 1 more code point
+					}
+				}
+			}
+
+			dstring::iterator mIter;
+			UTFString* mString;
+		};
+
+		//#########################################################################
+		// FORWARD ITERATORS
+		//#########################################################################
+		class _const_fwd_iterator; // forward declaration
+
+		//! forward iterator for UTFString
+	class _fwd_iterator: public _base_iterator { /* i don't know why the beautifier is freaking out on this line */
+			friend class _const_fwd_iterator;
+		public:
+			_fwd_iterator() {}
+			_fwd_iterator( const _fwd_iterator& i ) {
+				_become( i );
+			}
+
+			//! pre-increment
+			_fwd_iterator& operator++() {
+				_seekFwd( 1 );
+				return *this;
+			}
+			//! post-increment
+			_fwd_iterator operator++( int ) {
+				_fwd_iterator tmp( *this );
+				_seekFwd( 1 );
+				return tmp;
+			}
+
+			//! pre-decrement
+			_fwd_iterator& operator--() {
+				_seekRev( 1 );
+				return *this;
+			}
+			//! post-decrement
+			_fwd_iterator operator--( int ) {
+				_fwd_iterator tmp( *this );
+				_seekRev( 1 );
+				return tmp;
+			}
+
+			//! addition operator
+			_fwd_iterator operator+( size_type n ) {
+				_fwd_iterator tmp( *this );
+				tmp._seekFwd( n );
+				return tmp;
+			}
+			//! addition operator
+			_fwd_iterator operator+( difference_type n ) {
+				_fwd_iterator tmp( *this );
+				if ( n < 0 )
+					tmp._seekRev( -n );
+				else
+					tmp._seekFwd( n );
+				return tmp;
+			}
+			//! subtraction operator
+			_fwd_iterator operator-( size_type n ) {
+				_fwd_iterator tmp( *this );
+				tmp._seekRev( n );
+				return tmp;
+			}
+			//! subtraction operator
+			_fwd_iterator operator-( difference_type n ) {
+				_fwd_iterator tmp( *this );
+				if ( n < 0 )
+					tmp._seekFwd( -n );
+				else
+					tmp._seekRev( n );
+				return tmp;
+			}
+
+			//! addition assignment operator
+			_fwd_iterator& operator+=( size_type n ) {
+				_seekFwd( n );
+				return *this;
+			}
+			//! addition assignment operator
+			_fwd_iterator& operator+=( difference_type n ) {
+				if ( n < 0 )
+					_seekRev( -n );
+				else
+					_seekFwd( n );
+				return *this;
+			}
+			//! subtraction assignment operator
+			_fwd_iterator& operator-=( size_type n ) {
+				_seekRev( n );
+				return *this;
+			}
+			//! subtraction assignment operator
+			_fwd_iterator& operator-=( difference_type n ) {
+				if ( n < 0 )
+					_seekFwd( -n );
+				else
+					_seekRev( n );
+				return *this;
+			}
+
+			//! dereference operator
+			value_type& operator*() const {
+				return *mIter;
+			}
+
+			//! dereference at offset operator
+			value_type& operator[]( size_type n ) const {
+				_fwd_iterator tmp( *this );
+				tmp += n;
+				return *tmp;
+			}
+			//! dereference at offset operator
+			value_type& operator[]( difference_type n ) const {
+				_fwd_iterator tmp( *this );
+				tmp += n;
+				return *tmp;
+			}
+
+			//! advances to the next Unicode character, honoring surrogate pairs in the UTF-16 stream
+			_fwd_iterator& moveNext() {
+				_moveNext();
+				return *this;
+			}
+			//! rewinds to the previous Unicode character, honoring surrogate pairs in the UTF-16 stream
+			_fwd_iterator& movePrev() {
+				_movePrev();
+				return *this;
+			}
+			//! Returns the Unicode value of the character at the current position (decodes surrogate pairs if needed)
+			unicode_char getCharacter() const {
+				return _getCharacter();
+			}
+			//! Sets the Unicode value of the character at the current position (adding a surrogate pair if needed); returns the amount of string length change caused by the operation
+			int setCharacter( unicode_char uc ) {
+				return _setCharacter( uc );
+			}
+		};
+
+
+
+		//#########################################################################
+		//! const forward iterator for UTFString
+	class _const_fwd_iterator: public _base_iterator { /* i don't know why the beautifier is freaking out on this line */
+		public:
+			_const_fwd_iterator() {}
+			_const_fwd_iterator( const _const_fwd_iterator& i ) {
+				_become( i );
+			}
+			_const_fwd_iterator( const _fwd_iterator& i ) {
+				_become( i );
+			}
+
+			//! pre-increment
+			_const_fwd_iterator& operator++() {
+				_seekFwd( 1 );
+				return *this;
+			}
+			//! post-increment
+			_const_fwd_iterator operator++( int ) {
+				_const_fwd_iterator tmp( *this );
+				_seekFwd( 1 );
+				return tmp;
+			}
+
+			//! pre-decrement
+			_const_fwd_iterator& operator--() {
+				_seekRev( 1 );
+				return *this;
+			}
+			//! post-decrement
+			_const_fwd_iterator operator--( int ) {
+				_const_fwd_iterator tmp( *this );
+				_seekRev( 1 );
+				return tmp;
+			}
+
+			//! addition operator
+			_const_fwd_iterator operator+( size_type n ) {
+				_const_fwd_iterator tmp( *this );
+				tmp._seekFwd( n );
+				return tmp;
+			}
+			//! addition operator
+			_const_fwd_iterator operator+( difference_type n ) {
+				_const_fwd_iterator tmp( *this );
+				if ( n < 0 )
+					tmp._seekRev( -n );
+				else
+					tmp._seekFwd( n );
+				return tmp;
+			}
+			//! subtraction operator
+			_const_fwd_iterator operator-( size_type n ) {
+				_const_fwd_iterator tmp( *this );
+				tmp._seekRev( n );
+				return tmp;
+			}
+			//! subtraction operator
+			_const_fwd_iterator operator-( difference_type n ) {
+				_const_fwd_iterator tmp( *this );
+				if ( n < 0 )
+					tmp._seekFwd( -n );
+				else
+					tmp._seekRev( n );
+				return tmp;
+			}
+
+			//! addition assignment operator
+			_const_fwd_iterator& operator+=( size_type n ) {
+				_seekFwd( n );
+				return *this;
+			}
+			//! addition assignment operator
+			_const_fwd_iterator& operator+=( difference_type n ) {
+				if ( n < 0 )
+					_seekRev( -n );
+				else
+					_seekFwd( n );
+				return *this;
+			}
+			//! subtraction assignment operator
+			_const_fwd_iterator& operator-=( size_type n ) {
+				_seekRev( n );
+				return *this;
+			}
+			//! subtraction assignment operator
+			_const_fwd_iterator& operator-=( difference_type n ) {
+				if ( n < 0 )
+					_seekFwd( -n );
+				else
+					_seekRev( n );
+				return *this;
+			}
+
+			//! dereference operator
+			const value_type& operator*() const {
+				return *mIter;
+			}
+
+			//! dereference at offset operator
+			const value_type& operator[]( size_type n ) const {
+				_const_fwd_iterator tmp( *this );
+				tmp += n;
+				return *tmp;
+			}
+			//! dereference at offset operator
+			const value_type& operator[]( difference_type n ) const {
+				_const_fwd_iterator tmp( *this );
+				tmp += n;
+				return *tmp;
+			}
+
+			//! advances to the next Unicode character, honoring surrogate pairs in the UTF-16 stream
+			_const_fwd_iterator& moveNext() {
+				_moveNext();
+				return *this;
+			}
+			//! rewinds to the previous Unicode character, honoring surrogate pairs in the UTF-16 stream
+			_const_fwd_iterator& movePrev() {
+				_movePrev();
+				return *this;
+			}
+			//! Returns the Unicode value of the character at the current position (decodes surrogate pairs if needed)
+			unicode_char getCharacter() const {
+				return _getCharacter();
+			}
+
+			//! difference operator
+			friend size_type operator-( const _const_fwd_iterator& left, const _const_fwd_iterator& right );
+			//! equality operator
+			friend bool operator==( const _const_fwd_iterator& left, const _const_fwd_iterator& right );
+			//! inequality operator
+			friend bool operator!=( const _const_fwd_iterator& left, const _const_fwd_iterator& right );
+			//! less than
+			friend bool operator<( const _const_fwd_iterator& left, const _const_fwd_iterator& right );
+			//! less than or equal
+			friend bool operator<=( const _const_fwd_iterator& left, const _const_fwd_iterator& right );
+			//! greater than
+			friend bool operator>( const _const_fwd_iterator& left, const _const_fwd_iterator& right );
+			//! greater than or equal
+			friend bool operator>=( const _const_fwd_iterator& left, const _const_fwd_iterator& right );
+
+		};
+
+		//#########################################################################
+		// REVERSE ITERATORS
+		//#########################################################################
+		class _const_rev_iterator; // forward declaration
+		//! forward iterator for UTFString
+	class _rev_iterator: public _base_iterator { /* i don't know why the beautifier is freaking out on this line */
+			friend class _const_rev_iterator;
+		public:
+			_rev_iterator() {}
+			_rev_iterator( const _rev_iterator& i ) {
+				_become( i );
+			}
+
+			//! pre-increment
+			_rev_iterator& operator++() {
+				_seekRev( 1 );
+				return *this;
+			}
+			//! post-increment
+			_rev_iterator operator++( int ) {
+				_rev_iterator tmp( *this );
+				_seekRev( 1 );
+				return tmp;
+			}
+
+			//! pre-decrement
+			_rev_iterator& operator--() {
+				_seekFwd( 1 );
+				return *this;
+			}
+			//! post-decrement
+			_rev_iterator operator--( int ) {
+				_rev_iterator tmp( *this );
+				_seekFwd( 1 );
+				return tmp;
+			}
+
+			//! addition operator
+			_rev_iterator operator+( size_type n ) {
+				_rev_iterator tmp( *this );
+				tmp._seekRev( n );
+				return tmp;
+			}
+			//! addition operator
+			_rev_iterator operator+( difference_type n ) {
+				_rev_iterator tmp( *this );
+				if ( n < 0 )
+					tmp._seekFwd( -n );
+				else
+					tmp._seekRev( n );
+				return tmp;
+			}
+			//! subtraction operator
+			_rev_iterator operator-( size_type n ) {
+				_rev_iterator tmp( *this );
+				tmp._seekFwd( n );
+				return tmp;
+			}
+			//! subtraction operator
+			_rev_iterator operator-( difference_type n ) {
+				_rev_iterator tmp( *this );
+				if ( n < 0 )
+					tmp._seekRev( -n );
+				else
+					tmp._seekFwd( n );
+				return tmp;
+			}
+
+			//! addition assignment operator
+			_rev_iterator& operator+=( size_type n ) {
+				_seekRev( n );
+				return *this;
+			}
+			//! addition assignment operator
+			_rev_iterator& operator+=( difference_type n ) {
+				if ( n < 0 )
+					_seekFwd( -n );
+				else
+					_seekRev( n );
+				return *this;
+			}
+			//! subtraction assignment operator
+			_rev_iterator& operator-=( size_type n ) {
+				_seekFwd( n );
+				return *this;
+			}
+			//! subtraction assignment operator
+			_rev_iterator& operator-=( difference_type n ) {
+				if ( n < 0 )
+					_seekRev( -n );
+				else
+					_seekFwd( n );
+				return *this;
+			}
+
+			//! dereference operator
+			value_type& operator*() const {
+				return mIter[-1];
+			}
+
+			//! dereference at offset operator
+			value_type& operator[]( size_type n ) const {
+				_rev_iterator tmp( *this );
+				tmp -= n;
+				return *tmp;
+			}
+			//! dereference at offset operator
+			value_type& operator[]( difference_type n ) const {
+				_rev_iterator tmp( *this );
+				tmp -= n;
+				return *tmp;
+			}
+		};
+		//#########################################################################
+		//! const reverse iterator for UTFString
+	class _const_rev_iterator: public _base_iterator { /* i don't know why the beautifier is freaking out on this line */
+		public:
+			_const_rev_iterator() {}
+			_const_rev_iterator( const _const_rev_iterator& i ) {
+				_become( i );
+			}
+			_const_rev_iterator( const _rev_iterator& i ) {
+				_become( i );
+			}
+			//! pre-increment
+			_const_rev_iterator& operator++() {
+				_seekRev( 1 );
+				return *this;
+			}
+			//! post-increment
+			_const_rev_iterator operator++( int ) {
+				_const_rev_iterator tmp( *this );
+				_seekRev( 1 );
+				return tmp;
+			}
+
+			//! pre-decrement
+			_const_rev_iterator& operator--() {
+				_seekFwd( 1 );
+				return *this;
+			}
+			//! post-decrement
+			_const_rev_iterator operator--( int ) {
+				_const_rev_iterator tmp( *this );
+				_seekFwd( 1 );
+				return tmp;
+			}
+
+			//! addition operator
+			_const_rev_iterator operator+( size_type n ) {
+				_const_rev_iterator tmp( *this );
+				tmp._seekRev( n );
+				return tmp;
+			}
+			//! addition operator
+			_const_rev_iterator operator+( difference_type n ) {
+				_const_rev_iterator tmp( *this );
+				if ( n < 0 )
+					tmp._seekFwd( -n );
+				else
+					tmp._seekRev( n );
+				return tmp;
+			}
+			//! subtraction operator
+			_const_rev_iterator operator-( size_type n ) {
+				_const_rev_iterator tmp( *this );
+				tmp._seekFwd( n );
+				return tmp;
+			}
+			//! subtraction operator
+			_const_rev_iterator operator-( difference_type n ) {
+				_const_rev_iterator tmp( *this );
+				if ( n < 0 )
+					tmp._seekRev( -n );
+				else
+					tmp._seekFwd( n );
+				return tmp;
+			}
+
+			//! addition assignment operator
+			_const_rev_iterator& operator+=( size_type n ) {
+				_seekRev( n );
+				return *this;
+			}
+			//! addition assignment operator
+			_const_rev_iterator& operator+=( difference_type n ) {
+				if ( n < 0 )
+					_seekFwd( -n );
+				else
+					_seekRev( n );
+				return *this;
+			}
+			//! subtraction assignment operator
+			_const_rev_iterator& operator-=( size_type n ) {
+				_seekFwd( n );
+				return *this;
+			}
+			//! subtraction assignment operator
+			_const_rev_iterator& operator-=( difference_type n ) {
+				if ( n < 0 )
+					_seekRev( -n );
+				else
+					_seekFwd( n );
+				return *this;
+			}
+
+			//! dereference operator
+			const value_type& operator*() const {
+				return mIter[-1];
+			}
+
+			//! dereference at offset operator
+			const value_type& operator[]( size_type n ) const {
+				_const_rev_iterator tmp( *this );
+				tmp -= n;
+				return *tmp;
+			}
+			//! dereference at offset operator
+			const value_type& operator[]( difference_type n ) const {
+				_const_rev_iterator tmp( *this );
+				tmp -= n;
+				return *tmp;
+			}
+
+			//! difference operator
+			friend size_type operator-( const _const_rev_iterator& left, const _const_rev_iterator& right );
+			//! equality operator
+			friend bool operator==( const _const_rev_iterator& left, const _const_rev_iterator& right );
+			//! inequality operator
+			friend bool operator!=( const _const_rev_iterator& left, const _const_rev_iterator& right );
+			//! less than
+			friend bool operator<( const _const_rev_iterator& left, const _const_rev_iterator& right );
+			//! less than or equal
+			friend bool operator<=( const _const_rev_iterator& left, const _const_rev_iterator& right );
+			//! greater than
+			friend bool operator>( const _const_rev_iterator& left, const _const_rev_iterator& right );
+			//! greater than or equal
+			friend bool operator>=( const _const_rev_iterator& left, const _const_rev_iterator& right );
+		};
+		//#########################################################################
+
+		typedef _fwd_iterator iterator;                     //!< iterator
+		typedef _rev_iterator reverse_iterator;             //!< reverse iterator
+		typedef _const_fwd_iterator const_iterator;         //!< const iterator
+		typedef _const_rev_iterator const_reverse_iterator; //!< const reverse iterator
+
+
+		//!\name Constructors/Destructor
+		//@{
+		//! default constructor, creates an empty string
+		UTFString() {
+			_init();
+		}
+		//! copy constructor
+		UTFString( const UTFString& copy ) {
+			_init();
+			mData = copy.mData;
+		}
+		//! \a length copies of \a ch
+		UTFString( size_type length, const code_point& ch ) {
+			_init();
+			assign( length, ch );
+		}
+		//! duplicate of nul-terminated sequence \a str
+		UTFString( const code_point* str ) {
+			_init();
+			assign( str );
+		}
+		//! duplicate of \a str, \a length code points long
+		UTFString( const code_point* str, size_type length ) {
+			_init();
+			assign( str, length );
+		}
+		//! substring of \a str starting at \a index and \a length code points long
+		UTFString( const UTFString& str, size_type index, size_type length ) {
+			_init();
+			assign( str, index, length );
+		}
+#if OGRE_IS_NATIVE_WCHAR_T
+		//! duplicate of nul-terminated \c wchar_t array
+		UTFString( const wchar_t* w_str ) {
+			_init();
+			assign( w_str );
+		}
+		//! duplicate of \a w_str, \a length characters long
+		UTFString( const wchar_t* w_str, size_type length ) {
+			_init();
+			assign( w_str, length );
+		}
+#endif
+		//! duplicate of \a wstr
+		UTFString( const std::wstring& wstr ) {
+			_init();
+			assign( wstr );
+		}
+		//! duplicate of nul-terminated C-string \a c_str (UTF-8 encoding)
+		UTFString( const char* c_str ) {
+			_init();
+			assign( c_str );
+		}
+		//! duplicate of \a c_str, \a length characters long (UTF-8 encoding)
+		UTFString( const char* c_str, size_type length ) {
+			_init();
+			assign( c_str, length );
+		}
+		//! duplicate of \a str (UTF-8 encoding)
+		UTFString( const std::string& str ) {
+			_init();
+			assign( str );
+		}
+		//! destructor
+		~UTFString() {
+			_cleanBuffer();
+		}
+		//@}
+
+		//////////////////////////////////////////////////////////////////////////
+
+		//!\name Utility functions
+		//@{
+		//! Returns the number of code points in the current string
+		size_type size() const {
+			return mData.size();
+		}
+		//! Returns the number of code points in the current string
+		size_type length() const {
+			return size();
+		}
+		//! Returns the number of Unicode characters in the string
+		/*! Executes in linear time. */
+		size_type length_Characters() const {
+			const_iterator i = begin(), ie = end();
+			size_type c = 0;
+			while ( i != ie ) {
+				i.moveNext();
+				++c;
+			}
+			return c;
+		}
+		//! returns the maximum number of UTF-16 code points that the string can hold
+		size_type max_size() const {
+			return mData.max_size();
+		}
+		//! sets the capacity of the string to at least \a size code points
+		void reserve( size_type size ) {
+			mData.reserve( size );
+		}
+		//! changes the size of the string to \a size, filling in any new area with \a val
+		void resize( size_type num, const code_point& val = 0 ) {
+			mData.resize( num, val );
+		}
+		//! exchanges the elements of the current string with those of \a from
+		void swap( UTFString& from ) {
+			mData.swap( from.mData );
+		}
+		//! returns \c true if the string has no elements, \c false otherwise
+		bool empty() const {
+			return mData.empty();
+		}
+		//! returns a pointer to the first character in the current string
+		const code_point* c_str() const {
+			return mData.c_str();
+		}
+		//! returns a pointer to the first character in the current string
+		const code_point* data() const {
+			return c_str();
+		}
+		//! returns the number of elements that the string can hold before it will need to allocate more space
+		size_type capacity() const {
+			return mData.capacity();
+		}
+		//! deletes all of the elements in the string
+		void clear() {
+			mData.clear();
+		}
+		//! returns a substring of the current string, starting at \a index, and \a num characters long.
+		/*! If \a num is omitted, it will default to \c UTFString::npos, and the substr() function will simply return the remainder of the string starting at \a index. */
+		UTFString substr( size_type index, size_type num = npos ) const {
+			// this could avoid the extra copy if we used a private specialty constructor
+			dstring data = mData.substr( index, num );
+			UTFString tmp;
+			tmp.mData.swap( data );
+			return tmp;
+		}
+		//! appends \a val to the end of the string
+		void push_back( unicode_char val ) {
+			code_point cp[2];
+			size_t c = _utf32_to_utf16( val, cp );
+			if ( c > 0 ) push_back( cp[0] );
+			if ( c > 1 ) push_back( cp[1] );
+		}
+#if OGRE_IS_NATIVE_WCHAR_T
+		//! appends \a val to the end of the string
+		void push_back( wchar_t val ) {
+			// we do this because the Unicode method still preserves UTF-16 code points
+			mData.push_back( static_cast<unicode_char>( val ) );
+		}
+#endif
+		//! appends \a val to the end of the string
+		/*! This can be used to push surrogate pair code points, you'll just need to push them
+		one after the other. */
+		void push_back( code_point val ) {
+			mData.push_back( val );
+		}
+		//! appends \a val to the end of the string
+		/*! Limited to characters under the 127 value barrier. */
+		void push_back( char val ) {
+			mData.push_back( static_cast<code_point>( val ) );
+		}
+		//! returns \c true if the given Unicode character \a ch is in this string
+		bool inString( unicode_char ch ) const {
+			const_iterator i, ie = end();
+			for ( i = begin(); i != ie; i.moveNext() ) {
+				if ( i.getCharacter() == ch )
+					return true;
+			}
+			return false;
+		}
+		//@}
+
+		//////////////////////////////////////////////////////////////////////////
+
+		//!\name Stream variations
+		//@{
+		//! returns the current string in UTF-8 form within a std::string
+		const std::string& asUTF8() const {
+			_load_buffer_UTF8();
+			return *m_buffer.mStrBuffer;
+		}
+		//! returns the current string in UTF-8 form as a nul-terminated char array
+		const char* asUTF8_c_str() const {
+			_load_buffer_UTF8();
+			return m_buffer.mStrBuffer->c_str();
+		}
+		//! returns the current string in UTF-32 form within a utf32string
+		const utf32string& asUTF32() const {
+			_load_buffer_UTF32();
+			return *m_buffer.mUTF32StrBuffer;
+		}
+		//! returns the current string in UTF-32 form as a nul-terminated unicode_char array
+		const unicode_char* asUTF32_c_str() const {
+			_load_buffer_UTF32();
+			return m_buffer.mUTF32StrBuffer->c_str();
+		}
+		//! returns the current string in the native form of std::wstring
+		const std::wstring& asWStr() const {
+			_load_buffer_WStr();
+			return *m_buffer.mWStrBuffer;
+		}
+		//! returns the current string in the native form of a nul-terminated wchar_t array
+		const wchar_t* asWStr_c_str() const {
+			_load_buffer_WStr();
+			return m_buffer.mWStrBuffer->c_str();
+		}
+		//@}
+
+		//////////////////////////////////////////////////////////////////////////
+
+		//!\name Single Character Access
+		//@{
+		//! returns a reference to the element in the string at index \c loc
+		code_point& at( size_type loc ) {
+			return mData.at( loc );
+		}
+		//! returns a reference to the element in the string at index \c loc
+		const code_point& at( size_type loc ) const {
+			return mData.at( loc );
+		}
+		//! returns the data point \a loc evaluated as a UTF-32 value
+		/*! This function will will only properly decode surrogate pairs when \a loc points to the index
+		of a lead code point that is followed by a trailing code point. Evaluating the trailing code point
+		itself, or pointing to a code point that is a sentinel value (part of a broken pair) will return
+		the value of just that code point (not a valid Unicode value, but useful as a sentinel value). */
+		unicode_char getChar( size_type loc ) const {
+			const code_point* ptr = c_str();
+			unicode_char uc;
+			size_t l = _utf16_char_length( ptr[loc] );
+			code_point cp[2] = { /* blame the code beautifier */
+								   0, 0
+							   };
+			cp[0] = ptr[loc];
+
+			if ( l == 2 && ( loc + 1 ) < mData.length() ) {
+				cp[1] = ptr[loc+1];
+			}
+			_utf16_to_utf32( cp, uc );
+			return uc;
+		}
+		//! sets the value of the character at \a loc to the Unicode value \a ch (UTF-32)
+		/*! Providing sentinel values (values between U+D800-U+DFFF) are accepted, but you should be aware
+		that you can also unwittingly create a valid surrogate pair if you don't pay attention to what you
+		are doing. \note This operation may also lengthen the string if a surrogate pair is needed to
+		represent the value given, but one is not available to replace; or alternatively shorten the string
+		if an existing surrogate pair is replaced with a character that is representable without a surrogate
+		pair. The return value will signify any lengthening or shortening performed, returning 0 if no change
+		was made, -1 if the string was shortened, or 1 if the string was lengthened. Any single call can
+		only change the string length by + or - 1. */
+		int setChar( size_type loc, unicode_char ch ) {
+			code_point cp[2] = { /* blame the code beautifier */
+								   0, 0
+							   };
+			size_t l = _utf32_to_utf16( ch, cp );
+			unicode_char existingChar = getChar( loc );
+			size_t existingSize = _utf16_char_length( existingChar );
+			size_t newSize = _utf16_char_length( ch );
+
+			if ( newSize > existingSize ) {
+				at( loc ) = cp[0];
+				insert( loc + 1, 1, cp[1] );
+				return 1;
+			}
+			if ( newSize < existingSize ) {
+				erase( loc, 1 );
+				at( loc ) = cp[0];
+				return -1;
+			}
+
+			// newSize == existingSize
+			at( loc ) = cp[0];
+			if ( l == 2 ) at( loc + 1 ) = cp[1];
+			return 0;
+		}
+		//@}
+
+		//////////////////////////////////////////////////////////////////////////
+
+		//!\name iterator acquisition
+		//@{
+		//! returns an iterator to the first element of the string
+		iterator begin() {
+			iterator i;
+			i.mIter = mData.begin();
+			i.mString = this;
+			return i;
+		}
+		//! returns an iterator to the first element of the string
+		const_iterator begin() const {
+			const_iterator i;
+			i.mIter = const_cast<UTFString*>( this )->mData.begin();
+			i.mString = const_cast<UTFString*>( this );
+			return i;
+		}
+		//! returns an iterator just past the end of the string
+		iterator end() {
+			iterator i;
+			i.mIter = mData.end();
+			i.mString = this;
+			return i;
+		}
+		//! returns an iterator just past the end of the string
+		const_iterator end() const {
+			const_iterator i;
+			i.mIter = const_cast<UTFString*>( this )->mData.end();
+			i.mString = const_cast<UTFString*>( this );
+			return i;
+		}
+		//! returns a reverse iterator to the last element of the string
+		reverse_iterator rbegin() {
+			reverse_iterator i;
+			i.mIter = mData.end();
+			i.mString = this;
+			return i;
+		}
+		//! returns a reverse iterator to the last element of the string
+		const_reverse_iterator rbegin() const {
+			const_reverse_iterator i;
+			i.mIter = const_cast<UTFString*>( this )->mData.end();
+			i.mString = const_cast<UTFString*>( this );
+			return i;
+		}
+		//! returns a reverse iterator just past the beginning of the string
+		reverse_iterator rend() {
+			reverse_iterator i;
+			i.mIter = mData.begin();
+			i.mString = this;
+			return i;
+		}
+		//! returns a reverse iterator just past the beginning of the string
+		const_reverse_iterator rend() const {
+			const_reverse_iterator i;
+			i.mIter = const_cast<UTFString*>( this )->mData.begin();
+			i.mString = const_cast<UTFString*>( this );
+			return i;
+		}
+		//@}
+
+		//////////////////////////////////////////////////////////////////////////
+
+		//!\name assign
+		//@{
+		//! gives the current string the values from \a start to \a end
+		UTFString& assign( iterator start, iterator end ) {
+			mData.assign( start.mIter, end.mIter );
+			return *this;
+		}
+		//! assign \a str to the current string
+		UTFString& assign( const UTFString& str ) {
+			mData.assign( str.mData );
+			return *this;
+		}
+		//! assign the nul-terminated \a str to the current string
+		UTFString& assign( const code_point* str ) {
+			mData.assign( str );
+			return *this;
+		}
+		//! assign the first \a num characters of \a str to the current string
+		UTFString& assign( const code_point* str, size_type num ) {
+			mData.assign( str, num );
+			return *this;
+		}
+		//! assign \a len entries from \a str to the current string, starting at \a index
+		UTFString& assign( const UTFString& str, size_type index, size_type len ) {
+			mData.assign( str.mData, index, len );
+			return *this;
+		}
+		//! assign \a num copies of \a ch to the current string
+		UTFString& assign( size_type num, const code_point& ch ) {
+			mData.assign( num, ch );
+			return *this;
+		}
+		//! assign \a wstr to the current string (\a wstr is treated as a UTF-16 stream)
+		UTFString& assign( const std::wstring& wstr ) {
+			mData.clear();
+			mData.reserve( wstr.length() ); // best guess bulk allocate
+#ifdef WCHAR_UTF16 // if we're already working in UTF-16, this is easy
+			code_point tmp;
+			std::wstring::const_iterator i, ie = wstr.end();
+			for ( i = wstr.begin(); i != ie; i++ ) {
+				tmp = static_cast<code_point>( *i );
+				mData.push_back( tmp );
+			}
+#else // otherwise we do it the safe way (which is still 100% safe to pass UTF-16 through, just slower)
+			code_point cp[3] = {0, 0, 0};
+			unicode_char tmp;
+			std::wstring::const_iterator i, ie = wstr.end();
+			for ( i = wstr.begin(); i != ie; i++ ) {
+				tmp = static_cast<unicode_char>( *i );
+				size_t l = _utf32_to_utf16( tmp, cp );
+				if ( l > 0 ) mData.push_back( cp[0] );
+				if ( l > 1 ) mData.push_back( cp[1] );
+			}
+#endif
+			return *this;
+		}
+#if OGRE_IS_NATIVE_WCHAR_T
+		//! assign \a w_str to the current string
+		UTFString& assign( const wchar_t* w_str ) {
+			std::wstring tmp;
+			tmp.assign( w_str );
+			return assign( tmp );
+		}
+		//! assign the first \a num characters of \a w_str to the current string
+		UTFString& assign( const wchar_t* w_str, size_type num ) {
+			std::wstring tmp;
+			tmp.assign( w_str, num );
+			return assign( tmp );
+		}
+#endif
+		//! assign \a str to the current string (\a str is treated as a UTF-8 stream)
+		UTFString& assign( const std::string& str ) {
+			size_type len = _verifyUTF8( str );
+			clear(); // empty our contents, if there are any
+			reserve( len ); // best guess bulk capacity growth
+
+			// This is a 3 step process, converting each byte in the UTF-8 stream to UTF-32,
+			// then converting it to UTF-16, then finally appending the data buffer
+
+			unicode_char uc;          // temporary Unicode character buffer
+			unsigned char utf8buf[7]; // temporary UTF-8 buffer
+			utf8buf[6] = 0;
+			size_t utf8len;           // UTF-8 length
+			code_point utf16buff[3];  // temporary UTF-16 buffer
+			utf16buff[2] = 0;
+			size_t utf16len;          // UTF-16 length
+
+			std::string::const_iterator i, ie = str.end();
+			for ( i = str.begin(); i != ie; i++ ) {
+				utf8len = _utf8_char_length( static_cast<unsigned char>( *i ) ); // estimate bytes to load
+				for ( size_t j = 0; j < utf8len; j++ ) { // load the needed UTF-8 bytes
+					utf8buf[j] = ( static_cast<unsigned char>( *( i + j ) ) ); // we don't increment 'i' here just in case the estimate is wrong (shouldn't happen, but we're being careful)
+				}
+				utf8buf[utf8len] = 0; // nul terminate so we throw an exception before running off the end of the buffer
+				utf8len = _utf8_to_utf32( utf8buf, uc ); // do the UTF-8 -> UTF-32 conversion
+				i += utf8len - 1; // we subtract 1 for the increment of the 'for' loop
+
+				utf16len = _utf32_to_utf16( uc, utf16buff ); // UTF-32 -> UTF-16 conversion
+				append( utf16buff, utf16len ); // append the characters to the string
+			}
+			return *this;
+		}
+		//! assign \a c_str to the current string (\a c_str is treated as a UTF-8 stream)
+		UTFString& assign( const char* c_str ) {
+			std::string tmp( c_str );
+			return assign( tmp );
+		}
+		//! assign the first \a num characters of \a c_str to the current string (\a c_str is treated as a UTF-8 stream)
+		UTFString& assign( const char* c_str, size_type num ) {
+			std::string tmp;
+			tmp.assign( c_str, num );
+			return assign( tmp );
+		}
+		//@}
+
+		//////////////////////////////////////////////////////////////////////////
+
+		//!\name append
+		//@{
+		//! appends \a str on to the end of the current string
+		UTFString& append( const UTFString& str ) {
+			mData.append( str.mData );
+			return *this;
+		}
+		//! appends \a str on to the end of the current string
+		UTFString& append( const code_point* str ) {
+			mData.append( str );
+			return *this;
+		}
+		//! appends a substring of \a str starting at \a index that is \a len characters long on to the end of the current string
+		UTFString& append( const UTFString& str, size_type index, size_type len ) {
+			mData.append( str.mData, index, len );
+			return *this;
+		}
+		//! appends \a num characters of \a str on to the end of the current string
+		UTFString& append( const code_point* str, size_type num ) {
+			mData.append( str, num );
+			return *this;
+		}
+		//! appends \a num repetitions of \a ch on to the end of the current string
+		UTFString& append( size_type num, code_point ch ) {
+			mData.append( num, ch );
+			return *this;
+		}
+		//! appends the sequence denoted by \a start and \a end on to the end of the current string
+		UTFString& append( iterator start, iterator end ) {
+			mData.append( start.mIter, end.mIter );
+			return *this;
+		}
+#if OGRE_IS_NATIVE_WCHAR_T
+		//! appends \a num characters of \a str on to the end of the current string
+		UTFString& append( const wchar_t* w_str, size_type num ) {
+			std::wstring tmp( w_str, num );
+			return append( tmp );
+		}
+		//! appends \a num repetitions of \a ch on to the end of the current string
+		UTFString& append( size_type num, wchar_t ch ) {
+			return append( num, static_cast<unicode_char>( ch ) );
+		}
+#endif
+		//! appends \a num characters of \a str on to the end of the current string  (UTF-8 encoding)
+		UTFString& append( const char* c_str, size_type num ) {
+			UTFString tmp( c_str, num );
+			append( tmp );
+			return *this;
+		}
+		//! appends \a num repetitions of \a ch on to the end of the current string (Unicode values less than 128)
+		UTFString& append( size_type num, char ch ) {
+			append( num, static_cast<code_point>( ch ) );
+			return *this;
+		}
+		//! appends \a num repetitions of \a ch on to the end of the current string (Full Unicode spectrum)
+		UTFString& append( size_type num, unicode_char ch ) {
+			code_point cp[2] = {0, 0};
+			if ( _utf32_to_utf16( ch, cp ) == 2 ) {
+				for ( size_type i = 0; i < num; i++ ) {
+					append( 1, cp[0] );
+					append( 1, cp[1] );
+				}
+			} else {
+				for ( size_type i = 0; i < num; i++ ) {
+					append( 1, cp[0] );
+				}
+			}
+			return *this;
+		}
+		//@}
+
+		//////////////////////////////////////////////////////////////////////////
+
+		//!\name insert
+		//@{
+		//! inserts \a ch before the code point denoted by \a i
+		iterator insert( iterator i, const code_point& ch ) {
+			iterator ret;
+			ret.mIter = mData.insert( i.mIter, ch );
+			ret.mString = this;
+			return ret;
+		}
+		//! inserts \a str into the current string, at location \a index
+		UTFString& insert( size_type index, const UTFString& str ) {
+			mData.insert( index, str.mData );
+			return *this;
+		}
+		//! inserts \a str into the current string, at location \a index
+		UTFString& insert( size_type index, const code_point* str ) {
+			mData.insert( index, str );
+			return *this;
+		}
+		//! inserts a substring of \a str (starting at \a index2 and \a num code points long) into the current string, at location \a index1
+		UTFString& insert( size_type index1, const UTFString& str, size_type index2, size_type num ) {
+			mData.insert( index1, str.mData, index2, num );
+			return *this;
+		}
+		//! inserts the code points denoted by \a start and \a end into the current string, before the code point specified by \a i
+		void insert( iterator i, iterator start, iterator end ) {
+			mData.insert( i.mIter, start.mIter, end.mIter );
+		}
+		//! inserts \a num code points of \a str into the current string, at location \a index
+		UTFString& insert( size_type index, const code_point* str, size_type num ) {
+			mData.insert( index, str, num );
+			return *this;
+		}
+#if OGRE_IS_NATIVE_WCHAR_T
+		//! inserts \a num code points of \a str into the current string, at location \a index
+		UTFString& insert( size_type index, const wchar_t* w_str, size_type num ) {
+			UTFString tmp( w_str, num );
+			insert( index, tmp );
+			return *this;
+		}
+#endif
+		//! inserts \a num code points of \a str into the current string, at location \a index
+		UTFString& insert( size_type index, const char* c_str, size_type num ) {
+			UTFString tmp( c_str, num );
+			insert( index, tmp );
+			return *this;
+		}
+		//! inserts \a num copies of \a ch into the current string, at location \a index
+		UTFString& insert( size_type index, size_type num, code_point ch ) {
+			mData.insert( index, num, ch );
+			return *this;
+		}
+#if OGRE_IS_NATIVE_WCHAR_T
+		//! inserts \a num copies of \a ch into the current string, at location \a index
+		UTFString& insert( size_type index, size_type num, wchar_t ch ) {
+			insert( index, num, static_cast<unicode_char>( ch ) );
+			return *this;
+		}
+#endif
+		//! inserts \a num copies of \a ch into the current string, at location \a index
+		UTFString& insert( size_type index, size_type num, char ch ) {
+			insert( index, num, static_cast<code_point>( ch ) );
+			return *this;
+		}
+		//! inserts \a num copies of \a ch into the current string, at location \a index
+		UTFString& insert( size_type index, size_type num, unicode_char ch ) {
+			code_point cp[3] = {0, 0, 0};
+			size_t l = _utf32_to_utf16( ch, cp );
+			if ( l == 1 ) {
+				return insert( index, num, cp[0] );
+			}
+			for ( size_type c = 0; c < num; c++ ) {
+				// insert in reverse order to preserve ordering after insert
+				insert( index, 1, cp[1] );
+				insert( index, 1, cp[0] );
+			}
+			return *this;
+		}
+		//! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i
+		void insert( iterator i, size_type num, const code_point& ch ) {
+			mData.insert( i.mIter, num, ch );
+		}
+#if OGRE_IS_NATIVE_WCHAR_T
+		//! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i
+		void insert( iterator i, size_type num, const wchar_t& ch ) {
+			insert( i, num, static_cast<unicode_char>( ch ) );
+		}
+#endif
+		//! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i
+		void insert( iterator i, size_type num, const char& ch ) {
+			insert( i, num, static_cast<code_point>( ch ) );
+		}
+		//! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i
+		void insert( iterator i, size_type num, const unicode_char& ch ) {
+			code_point cp[3] = {0, 0, 0};
+			size_t l = _utf32_to_utf16( ch, cp );
+			if ( l == 1 ) {
+				insert( i, num, cp[0] );
+			} else {
+				for ( size_type c = 0; c < num; c++ ) {
+					// insert in reverse order to preserve ordering after insert
+					insert( i, 1, cp[1] );
+					insert( i, 1, cp[0] );
+				}
+			}
+		}
+		//@}
+
+		//////////////////////////////////////////////////////////////////////////
+
+		//!\name erase
+		//@{
+		//! removes the code point pointed to by \a loc, returning an iterator to the next character
+		iterator erase( iterator loc ) {
+			iterator ret;
+			ret.mIter = mData.erase( loc.mIter );
+			ret.mString = this;
+			return ret;
+		}
+		//! removes the code points between \a start and \a end (including the one at \a start but not the one at \a end), returning an iterator to the code point after the last code point removed
+		iterator erase( iterator start, iterator end ) {
+			iterator ret;
+			ret.mIter = mData.erase( start.mIter, end.mIter );
+			ret.mString = this;
+			return ret;
+		}
+		//! removes \a num code points from the current string, starting at \a index
+		UTFString& erase( size_type index = 0, size_type num = npos ) {
+			if ( num == npos )
+				mData.erase( index );
+			else
+				mData.erase( index, num );
+			return *this;
+		}
+		//@}
+
+		//////////////////////////////////////////////////////////////////////////
+
+		//!\name replace
+		//@{
+		//! replaces up to \a num1 code points of the current string (starting at \a index1) with \a str
+		UTFString& replace( size_type index1, size_type num1, const UTFString& str ) {
+			mData.replace( index1, num1, str.mData, 0, npos );
+			return *this;
+		}
+		//! replaces up to \a num1 code points of the current string (starting at \a index1) with up to \a num2 code points from \a str
+		UTFString& replace( size_type index1, size_type num1, const UTFString& str, size_type num2 ) {
+			mData.replace( index1, num1, str.mData, 0, num2 );
+			return *this;
+		}
+		//! replaces up to \a num1 code points of the current string (starting at \a index1) with up to \a num2 code points from \a str beginning at \a index2
+		UTFString& replace( size_type index1, size_type num1, const UTFString& str, size_type index2, size_type num2 ) {
+			mData.replace( index1, num1, str.mData, index2, num2 );
+			return *this;
+		}
+		//! replaces code points in the current string from \a start to \a end with \a num code points from \a str
+		UTFString& replace( iterator start, iterator end, const UTFString& str, size_type num = npos ) {
+			_const_fwd_iterator st(start); //Work around for gcc, allow it to find correct overload
+
+			size_type index1 = begin() - st;
+			size_type num1 = end - st;
+			return replace( index1, num1, str, 0, num );
+		}
+		//! replaces up to \a num1 code points in the current string (beginning at \a index) with \c num2 copies of \c ch
+		UTFString& replace( size_type index, size_type num1, size_type num2, code_point ch ) {
+			mData.replace( index, num1, num2, ch );
+			return *this;
+		}
+		//! replaces the code points in the current string from \a start to \a end with \a num copies of \a ch
+		UTFString& replace( iterator start, iterator end, size_type num, code_point ch ) {
+			_const_fwd_iterator st(start); //Work around for gcc, allow it to find correct overload
+
+			size_type index1 = begin() - st;
+			size_type num1 = end - st;
+			return replace( index1, num1, num, ch );
+		}
+		//@}
+
+		//////////////////////////////////////////////////////////////////////////
+
+		//!\name compare
+		//@{
+		//! compare \a str to the current string
+		int compare( const UTFString& str ) const {
+			return mData.compare( str.mData );
+		}
+		//! compare \a str to the current string
+		int compare( const code_point* str ) const {
+			return mData.compare( str );
+		}
+		//! compare \a str to a substring of the current string, starting at \a index for \a length characters
+		int compare( size_type index, size_type length, const UTFString& str ) const {
+			return mData.compare( index, length, str.mData );
+		}
+		//! compare a substring of \a str to a substring of the current string, where \a index2 and \a length2 refer to \a str and \a index and \a length refer to the current string
+		int compare( size_type index, size_type length, const UTFString& str, size_type index2, size_type length2 ) const {
+			return mData.compare( index, length, str.mData, index2, length2 );
+		}
+		//! compare a substring of \a str to a substring of the current string, where the substring of \a str begins at zero and is \a length2 characters long, and the substring of the current string begins at \a index and is \a length  characters long
+		int compare( size_type index, size_type length, const code_point* str, size_type length2 ) const {
+			return mData.compare( index, length, str, length2 );
+		}
+#if OGRE_IS_NATIVE_WCHAR_T
+		//! compare a substring of \a str to a substring of the current string, where the substring of \a str begins at zero and is \a length2 elements long, and the substring of the current string begins at \a index and is \a length characters long
+		int compare( size_type index, size_type length, const wchar_t* w_str, size_type length2 ) const {
+			UTFString tmp( w_str, length2 );
+			return compare( index, length, tmp );
+		}
+#endif
+		//! compare a substring of \a str to a substring of the current string, where the substring of \a str begins at zero and is \a length2 <b>UTF-8 code points</b> long, and the substring of the current string begins at \a index and is \a length characters long
+		int compare( size_type index, size_type length, const char* c_str, size_type length2 ) const {
+			UTFString tmp( c_str, length2 );
+			return compare( index, length, tmp );
+		}
+		//@}
+
+		//////////////////////////////////////////////////////////////////////////
+
+		//!\name find & rfind
+		//@{
+		//! returns the index of the first occurrence of \a str within the current string, starting at \a index; returns \c UTFString::npos if nothing is found
+		/*! \a str is a UTF-16 encoded string, but through implicit casting can also be a UTF-8 encoded string (const char* or std::string) */
+		size_type find( const UTFString& str, size_type index = 0 ) const {
+			return mData.find( str.c_str(), index );
+		}
+		//! returns the index of the first occurrence of \a str within the current string and within \a length code points, starting at \a index; returns \c UTFString::npos if nothing is found
+		/*! \a cp_str is a UTF-16 encoded string */
+		size_type find( const code_point* cp_str, size_type index, size_type length ) const {
+			UTFString tmp( cp_str );
+			return mData.find( tmp.c_str(), index, length );
+		}
+		//! returns the index of the first occurrence of \a str within the current string and within \a length code points, starting at \a index; returns \c UTFString::npos if nothing is found
+		/*! \a cp_str is a UTF-8 encoded string */
+		size_type find( const char* c_str, size_type index, size_type length ) const {
+			UTFString tmp( c_str );
+			return mData.find( tmp.c_str(), index, length );
+		}
+#if OGRE_IS_NATIVE_WCHAR_T
+		//! returns the index of the first occurrence of \a str within the current string and within \a length code points, starting at \a index; returns \c UTFString::npos if nothing is found
+		/*! \a cp_str is a UTF-16 encoded string */
+		size_type find( const wchar_t* w_str, size_type index, size_type length ) const {
+			UTFString tmp( w_str );
+			return mData.find( tmp.c_str(), index, length );
+		}
+#endif
+		//! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UTFString::npos if nothing is found
+		/*! \a ch is only capable of representing Unicode values up to U+007F (127) */
+		size_type find( char ch, size_type index = 0 ) const {
+			return find( static_cast<code_point>( ch ), index );
+		}
+		//! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UTFString::npos if nothing is found
+		/*! \a ch is only capable of representing Unicode values up to U+FFFF (65535) */
+		size_type find( code_point ch, size_type index = 0 ) const {
+			return mData.find( ch, index );
+		}
+#if OGRE_IS_NATIVE_WCHAR_T
+		//! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UTFString::npos if nothing is found
+		/*! \a ch is only capable of representing Unicode values up to U+FFFF (65535) */
+		size_type find( wchar_t ch, size_type index = 0 ) const {
+			return find( static_cast<unicode_char>( ch ), index );
+		}
+#endif
+		//! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UTFString::npos if nothing is found
+		/*! \a ch can fully represent any Unicode character */
+		size_type find( unicode_char ch, size_type index = 0 ) const {
+			code_point cp[3] = {0, 0, 0};
+			size_t l = _utf32_to_utf16( ch, cp );
+			return find( UTFString( cp, l ), index );
+		}
+
+		//! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found
+		size_type rfind( const UTFString& str, size_type index = 0 ) const {
+			return mData.rfind( str.c_str(), index );
+		}
+		//! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index, searching at most \a num characters; returns \c UTFString::npos if nothing is found
+		size_type rfind( const code_point* cp_str, size_type index, size_type num ) const {
+			UTFString tmp( cp_str );
+			return mData.rfind( tmp.c_str(), index, num );
+		}
+		//! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index, searching at most \a num characters; returns \c UTFString::npos if nothing is found
+		size_type rfind( const char* c_str, size_type index, size_type num ) const {
+			UTFString tmp( c_str );
+			return mData.rfind( tmp.c_str(), index, num );
+		}
+#if OGRE_IS_NATIVE_WCHAR_T
+		//! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index, searching at most \a num characters; returns \c UTFString::npos if nothing is found
+		size_type rfind( const wchar_t* w_str, size_type index, size_type num ) const {
+			UTFString tmp( w_str );
+			return mData.rfind( tmp.c_str(), index, num );
+		}
+#endif
+		//! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found
+		size_type rfind( char ch, size_type index = 0 ) const {
+			return rfind( static_cast<code_point>( ch ), index );
+		}
+		//! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found
+		size_type rfind( code_point ch, size_type index ) const {
+			return mData.rfind( ch, index );
+		}
+#if OGRE_IS_NATIVE_WCHAR_T
+		//! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found
+		size_type rfind( wchar_t ch, size_type index = 0 ) const {
+			return rfind( static_cast<unicode_char>( ch ), index );
+		}
+#endif
+		//! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found
+		size_type rfind( unicode_char ch, size_type index = 0 ) const {
+			code_point cp[3] = {0, 0, 0};
+			size_t l = _utf32_to_utf16( ch, cp );
+			return rfind( UTFString( cp, l ), index );
+		}
+		//@}
+
+		//////////////////////////////////////////////////////////////////////////
+
+		//!\name find_first/last_(not)_of
+		//@{
+		//! Returns the index of the first character within the current string that matches \b any character in \a str, beginning the search at \a index and searching at most \a num characters; returns \c UTFString::npos if nothing is found
+		size_type find_first_of( const UTFString &str, size_type index = 0, size_type num = npos ) const {
+			size_type i = 0;
+			const size_type len = length();
+			while ( i < num && ( index + i ) < len ) {
+				unicode_char ch = getChar( index + i );
+				if ( str.inString( ch ) )
+					return index + i;
+				i += _utf16_char_length( ch ); // increment by the Unicode character length
+			}
+			return npos;
+		}
+		//! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UTFString::npos if nothing is found
+		size_type find_first_of( code_point ch, size_type index = 0 ) const {
+			UTFString tmp;
+			tmp.assign( 1, ch );
+			return find_first_of( tmp, index );
+		}
+		//! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UTFString::npos if nothing is found
+		size_type find_first_of( char ch, size_type index = 0 ) const {
+			return find_first_of( static_cast<code_point>( ch ), index );
+		}
+#if OGRE_IS_NATIVE_WCHAR_T
+		//! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UTFString::npos if nothing is found
+		size_type find_first_of( wchar_t ch, size_type index = 0 ) const {
+			return find_first_of( static_cast<unicode_char>( ch ), index );
+		}
+#endif
+		//! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UTFString::npos if nothing is found
+		size_type find_first_of( unicode_char ch, size_type index = 0 ) const {
+			code_point cp[3] = {0, 0, 0};
+			size_t l = _utf32_to_utf16( ch, cp );
+			return find_first_of( UTFString( cp, l ), index );
+		}
+
+		//! returns the index of the first character within the current string that does not match any character in \a str, beginning the search at \a index and searching at most \a num characters; returns \c UTFString::npos if nothing is found
+		size_type find_first_not_of( const UTFString& str, size_type index = 0, size_type num = npos ) const {
+			size_type i = 0;
+			const size_type len = length();
+			while ( i < num && ( index + i ) < len ) {
+				unicode_char ch = getChar( index + i );
+				if ( !str.inString( ch ) )
+					return index + i;
+				i += _utf16_char_length( ch ); // increment by the Unicode character length
+			}
+			return npos;
+		}
+		//! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UTFString::npos if nothing is found
+		size_type find_first_not_of( code_point ch, size_type index = 0 ) const {
+			UTFString tmp;
+			tmp.assign( 1, ch );
+			return find_first_not_of( tmp, index );
+		}
+		//! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UTFString::npos if nothing is found
+		size_type find_first_not_of( char ch, size_type index = 0 ) const {
+			return find_first_not_of( static_cast<code_point>( ch ), index );
+		}
+#if OGRE_IS_NATIVE_WCHAR_T
+		//! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UTFString::npos if nothing is found
+		size_type find_first_not_of( wchar_t ch, size_type index = 0 ) const {
+			return find_first_not_of( static_cast<unicode_char>( ch ), index );
+		}
+#endif
+		//! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UTFString::npos if nothing is found
+		size_type find_first_not_of( unicode_char ch, size_type index = 0 ) const {
+			code_point cp[3] = {0, 0, 0};
+			size_t l = _utf32_to_utf16( ch, cp );
+			return find_first_not_of( UTFString( cp, l ), index );
+		}
+
+		//! returns the index of the first character within the current string that matches any character in \a str, doing a reverse search from \a index and searching at most \a num characters; returns \c UTFString::npos if nothing is found
+		size_type find_last_of( const UTFString& str, size_type index = npos, size_type num = npos ) const {
+			size_type i = 0;
+			const size_type len = length();
+			if ( index > len ) index = len - 1;
+
+			while ( i < num && ( index - i ) != npos ) {
+				size_type j = index - i;
+				// careful to step full Unicode characters
+				if ( j != 0 && _utf16_surrogate_follow( at( j ) ) && _utf16_surrogate_lead( at( j - 1 ) ) ) {
+					j = index - ++i;
+				}
+				// and back to the usual dull test
+				unicode_char ch = getChar( j );
+				if ( str.inString( ch ) )
+					return j;
+				i++;
+			}
+			return npos;
+		}
+		//! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found
+		size_type find_last_of( code_point ch, size_type index = npos ) const {
+			UTFString tmp;
+			tmp.assign( 1, ch );
+			return find_last_of( tmp, index );
+		}
+		//! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found
+		size_type find_last_of( char ch, size_type index = npos ) const {
+			return find_last_of( static_cast<code_point>( ch ), index );
+		}
+#if OGRE_IS_NATIVE_WCHAR_T
+		//! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found
+		size_type find_last_of( wchar_t ch, size_type index = npos ) const {
+			return find_last_of( static_cast<unicode_char>( ch ), index );
+		}
+#endif
+		//! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found
+		size_type find_last_of( unicode_char ch, size_type index = npos ) const {
+			code_point cp[3] = {0, 0, 0};
+			size_t l = _utf32_to_utf16( ch, cp );
+			return find_last_of( UTFString( cp, l ), index );
+		}
+
+		//! returns the index of the last character within the current string that does not match any character in \a str, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found
+		size_type find_last_not_of( const UTFString& str, size_type index = npos, size_type num = npos ) const {
+			size_type i = 0;
+			const size_type len = length();
+			if ( index > len ) index = len - 1;
+
+			while ( i < num && ( index - i ) != npos ) {
+				size_type j = index - i;
+				// careful to step full Unicode characters
+				if ( j != 0 && _utf16_surrogate_follow( at( j ) ) && _utf16_surrogate_lead( at( j - 1 ) ) ) {
+					j = index - ++i;
+				}
+				// and back to the usual dull test
+				unicode_char ch = getChar( j );
+				if ( !str.inString( ch ) )
+					return j;
+				i++;
+			}
+			return npos;
+		}
+		//! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found
+		size_type find_last_not_of( code_point ch, size_type index = npos ) const {
+			UTFString tmp;
+			tmp.assign( 1, ch );
+			return find_last_not_of( tmp, index );
+		}
+		//! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found
+		size_type find_last_not_of( char ch, size_type index = npos ) const {
+			return find_last_not_of( static_cast<code_point>( ch ), index );
+		}
+#if OGRE_IS_NATIVE_WCHAR_T
+		//! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found
+		size_type find_last_not_of( wchar_t ch, size_type index = npos ) const {
+			return find_last_not_of( static_cast<unicode_char>( ch ), index );
+		}
+#endif
+		//! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found
+		size_type find_last_not_of( unicode_char ch, size_type index = npos ) const {
+			code_point cp[3] = {0, 0, 0};
+			size_t l = _utf32_to_utf16( ch, cp );
+			return find_last_not_of( UTFString( cp, l ), index );
+		}
+		//@}
+
+		//////////////////////////////////////////////////////////////////////////
+
+		//!\name Operators
+		//@{
+		//! less than operator
+		bool operator<( const UTFString& right ) const {
+			return compare( right ) < 0;
+		}
+		//! less than or equal operator
+		bool operator<=( const UTFString& right ) const {
+			return compare( right ) <= 0;
+		}
+		//! greater than operator
+		bool operator>( const UTFString& right ) const {
+			return compare( right ) > 0;
+		}
+		//! greater than or equal operator
+		bool operator>=( const UTFString& right ) const {
+			return compare( right ) >= 0;
+		}
+		//! equality operator
+		bool operator==( const UTFString& right ) const {
+			return compare( right ) == 0;
+		}
+		//! inequality operator
+		bool operator!=( const UTFString& right ) const {
+			return !operator==( right );
+		}
+		//! assignment operator, implicitly casts all compatible types
+		UTFString& operator=( const UTFString& s ) {
+			return assign( s );
+		}
+		//! assignment operator
+		UTFString& operator=( code_point ch ) {
+			clear();
+			return append( 1, ch );
+		}
+		//! assignment operator
+		UTFString& operator=( char ch ) {
+			clear();
+			return append( 1, ch );
+		}
+#if OGRE_IS_NATIVE_WCHAR_T
+		//! assignment operator
+		UTFString& operator=( wchar_t ch ) {
+			clear();
+			return append( 1, ch );
+		}
+#endif
+		//! assignment operator
+		UTFString& operator=( unicode_char ch ) {
+			clear();
+			return append( 1, ch );
+		}
+		//! code point dereference operator
+		code_point& operator[]( size_type index ) {
+			return at( index );
+		}
+		//! code point dereference operator
+		const code_point& operator[]( size_type index ) const {
+			return at( index );
+		}
+		//@}
+
+		//////////////////////////////////////////////////////////////////////////
+
+		//!\name Implicit Cast Operators
+		//@{
+		//! implicit cast to std::string
+		operator std::string() const {
+			return std::string( asUTF8() );
+		}
+		//! implicit cast to std::wstring
+		operator std::wstring() const {
+			return std::wstring( asWStr() );
+		}
+		//@}
+
+		//////////////////////////////////////////////////////////////////////////
+
+		//!\name UTF-16 character encoding/decoding
+		//@{
+		//! returns \c true if \a cp does not match the signature for the lead of follow code point of a surrogate pair in a UTF-16 sequence
+		static bool _utf16_independent_char( code_point cp ) {
+			if ( 0xD800 <= cp && cp <= 0xDFFF ) // tests if the cp is within the surrogate pair range
+				return false; // it matches a surrogate pair signature
+			return true; // everything else is a standalone code point
+		}
+		//! returns \c true if \a cp matches the signature of a surrogate pair lead character
+		static bool _utf16_surrogate_lead( code_point cp ) {
+			if ( 0xD800 <= cp && cp <= 0xDBFF ) // tests if the cp is within the 2nd word of a surrogate pair
+				return true; // it is a 1st word
+			return false; // it isn't
+		}
+		//! returns \c true if \a cp matches the signature of a surrogate pair following character
+		static bool _utf16_surrogate_follow( code_point cp ) {
+			if ( 0xDC00 <= cp && cp <= 0xDFFF ) // tests if the cp is within the 2nd word of a surrogate pair
+				return true; // it is a 2nd word
+			return false; // everything else isn't
+		}
+		//! estimates the number of UTF-16 code points in the sequence starting with \a cp
+		static size_t _utf16_char_length( code_point cp ) {
+			if ( 0xD800 <= cp && cp <= 0xDBFF ) // test if cp is the beginning of a surrogate pair
+				return 2; // if it is, then we are 2 words long
+			return 1; // otherwise we are only 1 word long
+		}
+		//! returns the number of UTF-16 code points needed to represent the given UTF-32 character \a cp
+		static size_t _utf16_char_length( unicode_char uc ) {
+			if ( uc > 0xFFFF ) // test if uc is greater than the single word maximum
+				return 2; // if so, we need a surrogate pair
+			return 1; // otherwise we can stuff it into a single word
+		}
+		//! converts the given UTF-16 character buffer \a in_cp to a single UTF-32 Unicode character \a out_uc, returns the number of code points used to create the output character (2 for surrogate pairs, otherwise 1)
+		/*! This function does it's best to prevent error conditions, verifying complete
+		surrogate pairs before applying the algorithm. In the event that half of a pair
+		is found it will happily generate a value in the 0xD800 - 0xDFFF range, which is
+		normally an invalid Unicode value but we preserve them for use as sentinel values. */
+		static size_t _utf16_to_utf32( const code_point in_cp[2], unicode_char& out_uc ) {
+			const code_point& cp1 = in_cp[0];
+			const code_point& cp2 = in_cp[1];
+			bool wordPair = false;
+
+			// does it look like a surrogate pair?
+			if ( 0xD800 <= cp1 && cp1 <= 0xDBFF ) {
+				// looks like one, but does the other half match the algorithm as well?
+				if ( 0xDC00 <= cp2 && cp2 <= 0xDFFF )
+					wordPair = true; // yep!
+			}
+
+			if ( !wordPair ) { // if we aren't a 100% authentic surrogate pair, then just copy the value
+				out_uc = cp1;
+				return 1;
+			}
+
+			unsigned short cU = cp1, cL = cp2; // copy upper and lower words of surrogate pair to writable buffers
+			cU -= 0xD800; // remove the encoding markers
+			cL -= 0xDC00;
+
+			out_uc = ( cU & 0x03FF ) << 10; // grab the 10 upper bits and set them in their proper location
+			out_uc |= ( cL & 0x03FF ); // combine in the lower 10 bits
+			out_uc += 0x10000; // add back in the value offset
+
+			return 2; // this whole operation takes to words, so that's what we'll return
+		}
+		//! writes the given UTF-32 \a uc_in to the buffer location \a out_cp using UTF-16 encoding, returns the number of code points used to encode the input (always 1 or 2)
+		/*! This function, like its counterpart, will happily create invalid UTF-16 surrogate pairs. These
+		invalid entries will be created for any value of \c in_uc that falls in the range U+D800 - U+DFFF.
+		These are generally useful as sentinel values to represent various program specific conditions.
+		\note This function will also pass through any single UTF-16 code point without modification,
+		making it a safe method of ensuring a stream that is unknown UTF-32 or UTF-16 is truly UTF-16.*/
+		static size_t _utf32_to_utf16( const unicode_char& in_uc, code_point out_cp[2] ) {
+			if ( in_uc <= 0xFFFF ) { // we blindly preserve sentinel values because our decoder understands them
+				out_cp[0] = in_uc;
+				return 1;
+			}
+			unicode_char uc = in_uc; // copy to writable buffer
+			unsigned short tmp; // single code point buffer
+			uc -= 0x10000; // subtract value offset
+
+			//process upper word
+			tmp = ( uc >> 10 ) & 0x03FF; // grab the upper 10 bits
+			tmp += 0xD800; // add encoding offset
+			out_cp[0] = tmp; // write
+
+			// process lower word
+			tmp = uc & 0x03FF; // grab the lower 10 bits
+			tmp += 0xDC00; // add encoding offset
+			out_cp[1] = tmp; // write
+
+			return 2; // return used word count (2 for surrogate pairs)
+		}
+		//@}
+
+		//////////////////////////////////////////////////////////////////////////
+
+		//!\name UTF-8 character encoding/decoding
+		//@{
+		//! returns \c true if \a cp is the beginning of a UTF-8 sequence
+		static bool _utf8_start_char( unsigned char cp ) {
+			return ( cp & ~_cont_mask ) != _cont;
+		}
+		//! estimates the number of UTF-8 code points in the sequence starting with \a cp
+		static size_t _utf8_char_length( unsigned char cp ) {
+			if ( !( cp & 0x80 ) ) return 1;
+			if (( cp & ~_lead1_mask ) == _lead1 ) return 2;
+			if (( cp & ~_lead2_mask ) == _lead2 ) return 3;
+			if (( cp & ~_lead3_mask ) == _lead3 ) return 4;
+			if (( cp & ~_lead4_mask ) == _lead4 ) return 5;
+			if (( cp & ~_lead5_mask ) == _lead5 ) return 6;
+			throw invalid_data( "invalid UTF-8 sequence header value" );
+		}
+		//! returns the number of UTF-8 code points needed to represent the given UTF-32 character \a cp
+		static size_t _utf8_char_length( unicode_char uc ) {
+			/*
+			7 bit:  U-00000000 - U-0000007F: 0xxxxxxx
+			11 bit: U-00000080 - U-000007FF: 110xxxxx 10xxxxxx
+			16 bit: U-00000800 - U-0000FFFF: 1110xxxx 10xxxxxx 10xxxxxx
+			21 bit: U-00010000 - U-001FFFFF: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+			26 bit: U-00200000 - U-03FFFFFF: 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+			31 bit: U-04000000 - U-7FFFFFFF: 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+			*/
+			if ( !( uc & ~0x0000007F ) ) return 1;
+			if ( !( uc & ~0x000007FF ) ) return 2;
+			if ( !( uc & ~0x0000FFFF ) ) return 3;
+			if ( !( uc & ~0x001FFFFF ) ) return 4;
+			if ( !( uc & ~0x03FFFFFF ) ) return 5;
+			if ( !( uc & ~0x7FFFFFFF ) ) return 6;
+			throw invalid_data( "invalid UTF-32 value" );
+		}
+
+		//! converts the given UTF-8 character buffer to a single UTF-32 Unicode character, returns the number of bytes used to create the output character (maximum of 6)
+		static size_t _utf8_to_utf32( const unsigned char in_cp[6], unicode_char& out_uc ) {
+			size_t len = _utf8_char_length( in_cp[0] );
+			if ( len == 1 ) { // if we are only 1 byte long, then just grab it and exit
+				out_uc = in_cp[0];
+				return 1;
+			}
+
+			unicode_char c = 0; // temporary buffer
+			size_t i = 0;
+			switch ( len ) { // load header byte
+			case 6:
+				c = in_cp[i] & _lead5_mask;
+				break;
+			case 5:
+				c = in_cp[i] & _lead4_mask;
+				break;
+			case 4:
+				c = in_cp[i] & _lead3_mask;
+				break;
+			case 3:
+				c = in_cp[i] & _lead2_mask;
+				break;
+			case 2:
+				c = in_cp[i] & _lead1_mask;
+				break;
+			}
+
+			for ( ++i; i < len; i++ ) { // load each continuation byte
+				if (( in_cp[i] & ~_cont_mask ) != _cont )
+					throw invalid_data( "bad UTF-8 continuation byte" );
+				c <<= 6;
+				c |= ( in_cp[i] & _cont_mask );
+			}
+
+			out_uc = c; // write the final value and return the used byte length
+			return len;
+		}
+		//! writes the given UTF-32 \a uc_in to the buffer location \a out_cp using UTF-8 encoding, returns the number of bytes used to encode the input
+		static size_t _utf32_to_utf8( const unicode_char& in_uc, unsigned char out_cp[6] ) {
+			size_t len = _utf8_char_length( in_uc ); // predict byte length of sequence
+			unicode_char c = in_uc; // copy to temp buffer
+
+			//stuff all of the lower bits
+			for ( size_t i = len - 1; i > 0; i-- ) {
+				out_cp[i] = (( c ) & _cont_mask ) | _cont;
+				c >>= 6;
+			}
+
+			//now write the header byte
+			switch ( len ) {
+			case 6:
+				out_cp[0] = (( c ) & _lead5_mask ) | _lead5;
+				break;
+			case 5:
+				out_cp[0] = (( c ) & _lead4_mask ) | _lead4;
+				break;
+			case 4:
+				out_cp[0] = (( c ) & _lead3_mask ) | _lead3;
+				break;
+			case 3:
+				out_cp[0] = (( c ) & _lead2_mask ) | _lead2;
+				break;
+			case 2:
+				out_cp[0] = (( c ) & _lead1_mask ) | _lead1;
+				break;
+			case 1:
+			default:
+				out_cp[0] = ( c ) & 0x7F;
+				break;
+			}
+
+			// return the byte length of the sequence
+			return len;
+		}
+
+		//! verifies a UTF-8 stream, returning the total number of Unicode characters found
+		static size_type _verifyUTF8( const unsigned char* c_str ) {
+			std::string tmp( reinterpret_cast<const char*>( c_str ) );
+			return _verifyUTF8( tmp );
+		}
+		//! verifies a UTF-8 stream, returning the total number of Unicode characters found
+		static size_type _verifyUTF8( const std::string& str ) {
+			std::string::const_iterator i, ie = str.end();
+			i = str.begin();
+			size_type length = 0;
+
+			while ( i != ie ) {
+				// characters pass until we find an extended sequence
+				if (( *i ) & 0x80 ) {
+					unsigned char c = ( *i );
+					size_t contBytes = 0;
+
+					// get continuation byte count and test for overlong sequences
+					if (( c & ~_lead1_mask ) == _lead1 ) { // 1 additional byte
+						if ( c == _lead1 ) throw invalid_data( "overlong UTF-8 sequence" );
+						contBytes = 1;
+
+					} else if (( c & ~_lead2_mask ) == _lead2 ) { // 2 additional bytes
+						contBytes = 2;
+						if ( c == _lead2 ) { // possible overlong UTF-8 sequence
+							c = ( *( i + 1 ) ); // look ahead to next byte in sequence
+							if (( c & _lead2 ) == _cont ) throw invalid_data( "overlong UTF-8 sequence" );
+						}
+
+					} else if (( c & ~_lead3_mask ) == _lead3 ) { // 3 additional bytes
+						contBytes = 3;
+						if ( c == _lead3 ) { // possible overlong UTF-8 sequence
+							c = ( *( i + 1 ) ); // look ahead to next byte in sequence
+							if (( c & _lead3 ) == _cont ) throw invalid_data( "overlong UTF-8 sequence" );
+						}
+
+					} else if (( c & ~_lead4_mask ) == _lead4 ) { // 4 additional bytes
+						contBytes = 4;
+						if ( c == _lead4 ) { // possible overlong UTF-8 sequence
+							c = ( *( i + 1 ) ); // look ahead to next byte in sequence
+							if (( c & _lead4 ) == _cont ) throw invalid_data( "overlong UTF-8 sequence" );
+						}
+
+					} else if (( c & ~_lead5_mask ) == _lead5 ) { // 5 additional bytes
+						contBytes = 5;
+						if ( c == _lead5 ) { // possible overlong UTF-8 sequence
+							c = ( *( i + 1 ) ); // look ahead to next byte in sequence
+							if (( c & _lead5 ) == _cont ) throw invalid_data( "overlong UTF-8 sequence" );
+						}
+					}
+
+					// check remaining continuation bytes for
+					while ( contBytes-- ) {
+						c = ( *( ++i ) ); // get next byte in sequence
+						if (( c & ~_cont_mask ) != _cont )
+							throw invalid_data( "bad UTF-8 continuation byte" );
+					}
+				}
+				length++;
+				i++;
+			}
+			return length;
+		}
+		//@}
+
+	private:
+		//template<class ITER_TYPE> friend class _iterator;
+		dstring mData;
+
+		//! buffer data type identifier
+		enum BufferType {
+			bt_none,
+			bt_string,
+			bt_wstring,
+			bt_utf32string
+		};
+
+		//! common constructor operations
+		void _init() {
+			m_buffer.mVoidBuffer = 0;
+			m_bufferType = bt_none;
+			m_bufferSize = 0;
+		}
+
+		///////////////////////////////////////////////////////////////////////
+		// Scratch buffer
+		//! auto cleans the scratch buffer using the proper delete for the stored type
+		void _cleanBuffer() const {
+			if ( m_buffer.mVoidBuffer != 0 ) {
+				switch ( m_bufferType ) {
+				case bt_string:
+					delete m_buffer.mStrBuffer;
+					break;
+				case bt_wstring:
+					delete m_buffer.mWStrBuffer;
+					break;
+				case bt_utf32string:
+					delete m_buffer.mUTF32StrBuffer;
+					break;
+				case bt_none: // under the worse of circumstances, this is all we can do, and hope it works out
+				default:
+					//delete m_buffer.mVoidBuffer;
+					// delete void* is undefined, don't do that
+					assert("This should never happen - mVoidBuffer should never contain something if we "
+						"don't know the type");
+					break;
+				}
+				m_buffer.mVoidBuffer = 0;
+				m_bufferSize = 0;
+			}
+		}
+
+		//! create a std::string in the scratch buffer area
+		void _getBufferStr() const {
+			if ( m_bufferType != bt_string ) {
+				_cleanBuffer();
+				m_buffer.mStrBuffer = new std::string();
+				m_bufferType = bt_string;
+			}
+			m_buffer.mStrBuffer->clear();
+		}
+		//! create a std::wstring in the scratch buffer area
+		void _getBufferWStr() const {
+			if ( m_bufferType != bt_wstring ) {
+				_cleanBuffer();
+				m_buffer.mWStrBuffer = new std::wstring();
+				m_bufferType = bt_wstring;
+			}
+			m_buffer.mWStrBuffer->clear();
+		}
+		//! create a utf32string in the scratch buffer area
+		void _getBufferUTF32Str() const {
+			if ( m_bufferType != bt_utf32string ) {
+				_cleanBuffer();
+				m_buffer.mUTF32StrBuffer = new utf32string();
+				m_bufferType = bt_utf32string;
+			}
+			m_buffer.mUTF32StrBuffer->clear();
+		}
+
+		void _load_buffer_UTF8() const {
+			_getBufferStr();
+			std::string& buffer = ( *m_buffer.mStrBuffer );
+			buffer.reserve( length() );
+
+			unsigned char utf8buf[6];
+			char* charbuf = ( char* )utf8buf;
+			unicode_char c;
+			size_t len;
+
+			const_iterator i, ie = end();
+			for ( i = begin(); i != ie; i.moveNext() ) {
+				c = i.getCharacter();
+				len = _utf32_to_utf8( c, utf8buf );
+				size_t j = 0;
+				while ( j < len )
+					buffer.push_back( charbuf[j++] );
+			}
+		}
+		void _load_buffer_WStr() const {
+			_getBufferWStr();
+			std::wstring& buffer = ( *m_buffer.mWStrBuffer );
+			buffer.reserve( length() ); // may over reserve, but should be close enough
+#ifdef WCHAR_UTF16 // wchar_t matches UTF-16
+			const_iterator i, ie = end();
+			for ( i = begin(); i != ie; ++i ) {
+				buffer.push_back(( wchar_t )( *i ) );
+			}
+#else // wchar_t fits UTF-32
+			unicode_char c;
+			const_iterator i, ie = end();
+			for ( i = begin(); i != ie; i.moveNext() ) {
+				c = i.getCharacter();
+				buffer.push_back(( wchar_t )c );
+			}
+#endif
+		}
+		void _load_buffer_UTF32() const {
+			_getBufferUTF32Str();
+			utf32string& buffer = ( *m_buffer.mUTF32StrBuffer );
+			buffer.reserve( length() ); // may over reserve, but should be close enough
+
+			unicode_char c;
+
+			const_iterator i, ie = end();
+			for ( i = begin(); i != ie; i.moveNext() ) {
+				c = i.getCharacter();
+				buffer.push_back( c );
+			}
+		}
+
+		mutable BufferType m_bufferType; // identifies the data type held in m_buffer
+		mutable size_t m_bufferSize; // size of the CString buffer
+
+		// multi-purpose buffer used everywhere we need a throw-away buffer
+		union {
+			mutable void* mVoidBuffer;
+			mutable std::string* mStrBuffer;
+			mutable std::wstring* mWStrBuffer;
+			mutable utf32string* mUTF32StrBuffer;
+		}
+		m_buffer;
+	};
+
+	//! string addition operator \relates UTFString
+	inline UTFString operator+( const UTFString& s1, const UTFString& s2 ) {
+		return UTFString( s1 ).append( s2 );
+	}
+	//! string addition operator \relates UTFString
+	inline UTFString operator+( const UTFString& s1, UTFString::code_point c ) {
+		return UTFString( s1 ).append( 1, c );
+	}
+	//! string addition operator \relates UTFString
+	inline UTFString operator+( const UTFString& s1, UTFString::unicode_char c ) {
+		return UTFString( s1 ).append( 1, c );
+	}
+	//! string addition operator \relates UTFString
+	inline UTFString operator+( const UTFString& s1, char c ) {
+		return UTFString( s1 ).append( 1, c );
+	}
+#if OGRE_IS_NATIVE_WCHAR_T
+	//! string addition operator \relates UTFString
+	inline UTFString operator+( const UTFString& s1, wchar_t c ) {
+		return UTFString( s1 ).append( 1, c );
+	}
+#endif
+	//! string addition operator \relates UTFString
+	inline UTFString operator+( UTFString::code_point c, const UTFString& s2 ) {
+		return UTFString().append( 1, c ).append( s2 );
+	}
+	//! string addition operator \relates UTFString
+	inline UTFString operator+( UTFString::unicode_char c, const UTFString& s2 ) {
+		return UTFString().append( 1, c ).append( s2 );
+	}
+	//! string addition operator \relates UTFString
+	inline UTFString operator+( char c, const UTFString& s2 ) {
+		return UTFString().append( 1, c ).append( s2 );
+	}
+#if OGRE_IS_NATIVE_WCHAR_T
+	//! string addition operator \relates UTFString
+	inline UTFString operator+( wchar_t c, const UTFString& s2 ) {
+		return UTFString().append( 1, c ).append( s2 );
+	}
+#endif
+
+	// (const) forward iterator common operators
+	inline UTFString::size_type operator-( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) {
+		return ( left.mIter - right.mIter );
+	}
+	inline bool operator==( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) {
+		return left.mIter == right.mIter;
+	}
+	inline bool operator!=( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) {
+		return left.mIter != right.mIter;
+	}
+	inline bool operator<( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) {
+		return left.mIter < right.mIter;
+	}
+	inline bool operator<=( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) {
+		return left.mIter <= right.mIter;
+	}
+	inline bool operator>( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) {
+		return left.mIter > right.mIter;
+	}
+	inline bool operator>=( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) {
+		return left.mIter >= right.mIter;
+	}
+
+	// (const) reverse iterator common operators
+	// NB: many of these operations are evaluated in reverse because this is a reverse iterator wrapping a forward iterator
+	inline UTFString::size_type operator-( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) {
+		return ( right.mIter - left.mIter );
+	}
+	inline bool operator==( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) {
+		return left.mIter == right.mIter;
+	}
+	inline bool operator!=( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) {
+		return left.mIter != right.mIter;
+	}
+	inline bool operator<( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) {
+		return right.mIter < left.mIter;
+	}
+	inline bool operator<=( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) {
+		return right.mIter <= left.mIter;
+	}
+	inline bool operator>( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) {
+		return right.mIter > left.mIter;
+	}
+	inline bool operator>=( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) {
+		return right.mIter >= left.mIter;
+	}
+
+	//! std::ostream write operator \relates UTFString
+	inline std::ostream& operator << ( std::ostream& os, const UTFString& s ) {
+		return os << s.asUTF8();
+	}
+
+	//! std::wostream write operator \relates UTFString
+	inline std::wostream& operator << ( std::wostream& os, const UTFString& s ) {
+		return os << s.asWStr();
+	}
+
+
+
+} // namespace Ogre{
+
+#endif // OGRE_UNICODE_SUPPORT
+
+#endif 
Index: /OgreMain/include/OgreUnifiedHighLevelGpuProgram.h
===================================================================
--- /OgreMain/include/OgreUnifiedHighLevelGpuProgram.h	(revision 5)
+++ /OgreMain/include/OgreUnifiedHighLevelGpuProgram.h	(revision 5)
@@ -0,0 +1,168 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __UnifiedHighLevelGpuProgram_H__
+#define __UnifiedHighLevelGpuProgram_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreHighLevelGpuProgram.h"
+#include "OgreHighLevelGpuProgramManager.h"
+
+namespace Ogre {
+
+	/** Specialisation of HighLevelGpuProgram which just delegates its implementation
+		to one other high level program, allowing a single program definition
+		to represent one supported program from a number of options
+	@remarks
+		Whilst you can use Technique to implement several ways to render an object
+		depending on hardware support, if the only reason to need multiple paths is
+		because of the high-level shader language supported, this can be 
+		cumbersome. For example you might want to implement the same shader 
+		in HLSL and	GLSL for portability but apart from the implementation detail,
+		the shaders do the same thing and take the same parameters. If the materials
+		in question are complex, duplicating the techniques just to switch language
+		is not optimal, so instead you can define high-level programs with a 
+		syntax of 'unified', and list the actual implementations in order of
+		preference via repeated use of the 'delegate' parameter, which just points
+		at another program name. The first one which has a supported syntax 
+		will be used.
+	*/
+	class _OgreExport UnifiedHighLevelGpuProgram : public HighLevelGpuProgram
+	{
+	public:
+		/// Command object for setting delegate (can set more than once)
+		class CmdDelegate : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+
+	protected:
+		static CmdDelegate msCmdDelegate;
+
+		/// Ordered list of potential delegates
+		StringVector mDelegateNames;
+		/// The chosen delegate
+		mutable HighLevelGpuProgramPtr mChosenDelegate;
+
+		/// Choose the delegate to use
+		void chooseDelegate() const;
+
+		void createLowLevelImpl(void);
+		void unloadHighLevelImpl(void);
+		void buildConstantDefinitions() const;
+		void loadFromSource(void);
+
+	public:
+		/** Constructor, should be used only by factory classes. */
+		UnifiedHighLevelGpuProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
+			const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
+		~UnifiedHighLevelGpuProgram();
+
+
+		/** Adds a new delegate program to the list.
+		@remarks
+			Delegates are tested in order so earlier ones are preferred.
+		*/
+		void addDelegateProgram(const String& name);
+
+		/// Remove all delegate programs
+		void clearDelegatePrograms();
+
+		/// Get the chosen delegate
+		const HighLevelGpuProgramPtr& _getDelegate() const;
+
+		/** @copydoc GpuProgram::getLanguage */
+        const String& getLanguage(void) const;
+
+		/** Creates a new parameters object compatible with this program definition. 
+		@remarks
+		Unlike low-level assembly programs, parameters objects are specific to the
+		program and therefore must be created from it rather than by the 
+		HighLevelGpuProgramManager. This method creates a new instance of a parameters
+		object containing the definition of the parameters this program understands.
+		*/
+		GpuProgramParametersSharedPtr createParameters(void);
+		/** @copydoc GpuProgram::getBindingDelegate */
+		GpuProgram* _getBindingDelegate(void);
+
+		// All the following methods must delegate to the implementation
+
+		/** @copydoc GpuProgram::isSupported */
+		bool isSupported(void) const;
+		
+		/** @copydoc GpuProgram::isSkeletalAnimationIncluded */
+		bool isSkeletalAnimationIncluded(void) const;
+
+		bool isMorphAnimationIncluded(void) const;
+
+		bool isPoseAnimationIncluded(void) const;
+
+		bool isVertexTextureFetchRequired(void) const;
+		GpuProgramParametersSharedPtr getDefaultParameters(void);
+		bool hasDefaultParameters(void) const;
+		bool getPassSurfaceAndLightStates(void) const;
+		bool hasCompileError(void) const;
+		void resetCompileError(void);
+
+		void load(bool backgroundThread = false);
+		void reload(void);
+		bool isReloadable(void) const;
+		bool isLoaded(void) const;
+		LoadingState isLoading() const;
+		LoadingState getLoadingState() const;
+		void unload(void);
+		size_t getSize(void) const;
+		void touch(void);
+		bool isBackgroundLoaded(void) const;
+		void setBackgroundLoaded(bool bl);
+		void escalateLoading();
+		void addListener(Listener* lis);
+		void removeListener(Listener* lis);
+
+	};
+
+	/** Factory class for Unified programs. */
+	class UnifiedHighLevelGpuProgramFactory : public HighLevelGpuProgramFactory
+	{
+	public:
+		UnifiedHighLevelGpuProgramFactory();
+		~UnifiedHighLevelGpuProgramFactory();
+		/// Get the name of the language this factory creates programs for
+		const String& getLanguage(void) const;
+		HighLevelGpuProgram* create(ResourceManager* creator, 
+			const String& name, ResourceHandle handle,
+			const String& group, bool isManual, ManualResourceLoader* loader);
+		void destroy(HighLevelGpuProgram* prog);
+
+	};
+
+
+}
+#endif
Index: /OgreMain/include/OgreUserDefinedObject.h
===================================================================
--- /OgreMain/include/OgreUserDefinedObject.h	(revision 5)
+++ /OgreMain/include/OgreUserDefinedObject.h	(revision 5)
@@ -0,0 +1,93 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __UserDefinedObject_H__
+#define __UserDefinedObject_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+
+    /** This class is designed to be subclassed by OGRE users, to allow them to
+        associate their own application objects with MovableObject instances
+        in the engine.
+    @remarks
+        It's always been suggested that an OGRE application would likley comprise
+        a number of game objects which would keep pointers to OGRE objects in order
+        to maintain the link. However, in some cases it would be very useful to be able to
+        navigate directly from an OGRE instance back to a custom application object.
+        This abstract class exists for this purpose; MovableObjects hold a pointer to
+        a UserDefinedObject instance, which application writers subclass in order to
+        include their own attributes. Your game objects themselves may be subclasses of this
+        class, or your subclasses may merely be a link between them.
+    @par
+        Because OGRE never uses instances of this object itself, there is very little
+        definition to this class; the application is expected to add all the detail it wants.
+        However, as a hint, and for debugging purposes, this class does define a 'type id',
+        which it is recommended you use to differentiate between your subclasses,
+        if you have more than one type.
+    */
+    class _OgreExport UserDefinedObject
+    {
+    public:
+        /** Standard constructor. */
+        UserDefinedObject();
+        virtual ~UserDefinedObject() {}
+
+        /** Return a number identifying the type of user defined object.
+        @remarks
+            Can be used to differentiate between different types of object which you attach to
+            OGRE MovableObject instances. Recommend you override this in your classes if you
+            use more than one type of object.
+        @par
+            Alternatively, you can override the getTypeName method and use that instead; 
+            that version is a litle more friendly and easier to scope, but obviously 
+            slightly less efficient. You choose which you prefer.
+        */
+        virtual long getTypeID(void) const;
+
+        /** Return a string identifying the type of user defined object.
+        @remarks
+            Can be used to differentiate between different types of object which you attach to
+            OGRE MovableObject instances. Recommend you override this in your classes if you
+            use more than one type of object.
+        @par
+            Alternatively, you can override the getTypeID method and use that instead; 
+            that version is a litle more efficient, but obviously 
+            slightly less easy to read. You choose which you prefer.
+        */
+        virtual const String& getTypeName(void) const;
+        
+    };
+    
+        
+
+}
+
+#endif
Index: /OgreMain/include/OgreVector2.h
===================================================================
--- /OgreMain/include/OgreVector2.h	(revision 5)
+++ /OgreMain/include/OgreVector2.h	(revision 5)
@@ -0,0 +1,532 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Vector2_H__
+#define __Vector2_H__
+
+
+#include "OgrePrerequisites.h"
+#include "OgreMath.h"
+
+namespace Ogre
+{
+
+    /** Standard 2-dimensional vector.
+        @remarks
+            A direction in 2D space represented as distances along the 2
+            orthoganal axes (x, y). Note that positions, directions and
+            scaling factors can be represented by a vector, depending on how
+            you interpret the values.
+    */
+    class _OgreExport Vector2
+    {
+    public:
+        Real x, y;
+
+    public:
+        inline Vector2()
+        {
+        }
+
+        inline Vector2(const Real fX, const Real fY )
+            : x( fX ), y( fY )
+        {
+        }
+
+        inline explicit Vector2( const Real scaler )
+            : x( scaler), y( scaler )
+        {
+        }
+
+        inline explicit Vector2( const Real afCoordinate[2] )
+            : x( afCoordinate[0] ),
+              y( afCoordinate[1] )
+        {
+        }
+
+        inline explicit Vector2( const int afCoordinate[2] )
+        {
+            x = (Real)afCoordinate[0];
+            y = (Real)afCoordinate[1];
+        }
+
+        inline explicit Vector2( Real* const r )
+            : x( r[0] ), y( r[1] )
+        {
+        }
+
+        inline Vector2( const Vector2& rkVector )
+            : x( rkVector.x ), y( rkVector.y )
+        {
+        }
+
+		inline Real operator [] ( const size_t i ) const
+        {
+            assert( i < 2 );
+
+            return *(&x+i);
+        }
+
+		inline Real& operator [] ( const size_t i )
+        {
+            assert( i < 2 );
+
+            return *(&x+i);
+        }
+
+		/// Pointer accessor for direct copying
+		inline Real* ptr()
+		{
+			return &x;
+		}
+		/// Pointer accessor for direct copying
+		inline const Real* ptr() const
+		{
+			return &x;
+		}
+
+        /** Assigns the value of the other vector.
+            @param
+                rkVector The other vector
+        */
+        inline Vector2& operator = ( const Vector2& rkVector )
+        {
+            x = rkVector.x;
+            y = rkVector.y;
+
+            return *this;
+        }
+
+		inline Vector2& operator = ( const Real fScalar)
+		{
+			x = fScalar;
+			y = fScalar;
+
+			return *this;
+		}
+
+        inline bool operator == ( const Vector2& rkVector ) const
+        {
+            return ( x == rkVector.x && y == rkVector.y );
+        }
+
+        inline bool operator != ( const Vector2& rkVector ) const
+        {
+            return ( x != rkVector.x || y != rkVector.y  );
+        }
+
+        // arithmetic operations
+        inline Vector2 operator + ( const Vector2& rkVector ) const
+        {
+            return Vector2(
+                x + rkVector.x,
+                y + rkVector.y);
+        }
+
+        inline Vector2 operator - ( const Vector2& rkVector ) const
+        {
+            return Vector2(
+                x - rkVector.x,
+                y - rkVector.y);
+        }
+
+        inline Vector2 operator * ( const Real fScalar ) const
+        {
+            return Vector2(
+                x * fScalar,
+                y * fScalar);
+        }
+
+        inline Vector2 operator * ( const Vector2& rhs) const
+        {
+            return Vector2(
+                x * rhs.x,
+                y * rhs.y);
+        }
+
+        inline Vector2 operator / ( const Real fScalar ) const
+        {
+            assert( fScalar != 0.0 );
+
+            Real fInv = 1.0 / fScalar;
+
+            return Vector2(
+                x * fInv,
+                y * fInv);
+        }
+
+        inline Vector2 operator / ( const Vector2& rhs) const
+        {
+            return Vector2(
+                x / rhs.x,
+                y / rhs.y);
+        }
+
+        inline const Vector2& operator + () const
+        {
+            return *this;
+        }
+
+        inline Vector2 operator - () const
+        {
+            return Vector2(-x, -y);
+        }
+
+        // overloaded operators to help Vector2
+        inline friend Vector2 operator * ( const Real fScalar, const Vector2& rkVector )
+        {
+            return Vector2(
+                fScalar * rkVector.x,
+                fScalar * rkVector.y);
+        }
+
+        inline friend Vector2 operator / ( const Real fScalar, const Vector2& rkVector )
+        {
+            return Vector2(
+                fScalar / rkVector.x,
+                fScalar / rkVector.y);
+        }
+
+        inline friend Vector2 operator + (const Vector2& lhs, const Real rhs)
+        {
+            return Vector2(
+                lhs.x + rhs,
+                lhs.y + rhs);
+        }
+
+        inline friend Vector2 operator + (const Real lhs, const Vector2& rhs)
+        {
+            return Vector2(
+                lhs + rhs.x,
+                lhs + rhs.y);
+        }
+
+        inline friend Vector2 operator - (const Vector2& lhs, const Real rhs)
+        {
+            return Vector2(
+                lhs.x - rhs,
+                lhs.y - rhs);
+        }
+
+        inline friend Vector2 operator - (const Real lhs, const Vector2& rhs)
+        {
+            return Vector2(
+                lhs - rhs.x,
+                lhs - rhs.y);
+        }
+        // arithmetic updates
+        inline Vector2& operator += ( const Vector2& rkVector )
+        {
+            x += rkVector.x;
+            y += rkVector.y;
+
+            return *this;
+        }
+
+        inline Vector2& operator += ( const Real fScaler )
+        {
+            x += fScaler;
+            y += fScaler;
+
+            return *this;
+        }
+
+        inline Vector2& operator -= ( const Vector2& rkVector )
+        {
+            x -= rkVector.x;
+            y -= rkVector.y;
+
+            return *this;
+        }
+
+        inline Vector2& operator -= ( const Real fScaler )
+        {
+            x -= fScaler;
+            y -= fScaler;
+
+            return *this;
+        }
+
+        inline Vector2& operator *= ( const Real fScalar )
+        {
+            x *= fScalar;
+            y *= fScalar;
+
+            return *this;
+        }
+
+        inline Vector2& operator *= ( const Vector2& rkVector )
+        {
+            x *= rkVector.x;
+            y *= rkVector.y;
+
+            return *this;
+        }
+
+        inline Vector2& operator /= ( const Real fScalar )
+        {
+            assert( fScalar != 0.0 );
+
+            Real fInv = 1.0 / fScalar;
+
+            x *= fInv;
+            y *= fInv;
+
+            return *this;
+        }
+
+        inline Vector2& operator /= ( const Vector2& rkVector )
+        {
+            x /= rkVector.x;
+            y /= rkVector.y;
+
+            return *this;
+        }
+
+        /** Returns the length (magnitude) of the vector.
+            @warning
+                This operation requires a square root and is expensive in
+                terms of CPU operations. If you don't need to know the exact
+                length (e.g. for just comparing lengths) use squaredLength()
+                instead.
+        */
+        inline Real length () const
+        {
+            return Math::Sqrt( x * x + y * y );
+        }
+
+        /** Returns the square of the length(magnitude) of the vector.
+            @remarks
+                This  method is for efficiency - calculating the actual
+                length of a vector requires a square root, which is expensive
+                in terms of the operations required. This method returns the
+                square of the length of the vector, i.e. the same as the
+                length but before the square root is taken. Use this if you
+                want to find the longest / shortest vector without incurring
+                the square root.
+        */
+        inline Real squaredLength () const
+        {
+            return x * x + y * y;
+        }
+
+        /** Calculates the dot (scalar) product of this vector with another.
+            @remarks
+                The dot product can be used to calculate the angle between 2
+                vectors. If both are unit vectors, the dot product is the
+                cosine of the angle; otherwise the dot product must be
+                divided by the product of the lengths of both vectors to get
+                the cosine of the angle. This result can further be used to
+                calculate the distance of a point from a plane.
+            @param
+                vec Vector with which to calculate the dot product (together
+                with this one).
+            @returns
+                A float representing the dot product value.
+        */
+        inline Real dotProduct(const Vector2& vec) const
+        {
+            return x * vec.x + y * vec.y;
+        }
+
+        /** Normalises the vector.
+            @remarks
+                This method normalises the vector such that it's
+                length / magnitude is 1. The result is called a unit vector.
+            @note
+                This function will not crash for zero-sized vectors, but there
+                will be no changes made to their components.
+            @returns The previous length of the vector.
+        */
+        inline Real normalise()
+        {
+            Real fLength = Math::Sqrt( x * x + y * y);
+
+            // Will also work for zero-sized vectors, but will change nothing
+            if ( fLength > 1e-08 )
+            {
+                Real fInvLength = 1.0 / fLength;
+                x *= fInvLength;
+                y *= fInvLength;
+            }
+
+            return fLength;
+        }
+
+
+
+        /** Returns a vector at a point half way between this and the passed
+            in vector.
+        */
+        inline Vector2 midPoint( const Vector2& vec ) const
+        {
+            return Vector2(
+                ( x + vec.x ) * 0.5,
+                ( y + vec.y ) * 0.5 );
+        }
+
+        /** Returns true if the vector's scalar components are all greater
+            that the ones of the vector it is compared against.
+        */
+        inline bool operator < ( const Vector2& rhs ) const
+        {
+            if( x < rhs.x && y < rhs.y )
+                return true;
+            return false;
+        }
+
+        /** Returns true if the vector's scalar components are all smaller
+            that the ones of the vector it is compared against.
+        */
+        inline bool operator > ( const Vector2& rhs ) const
+        {
+            if( x > rhs.x && y > rhs.y )
+                return true;
+            return false;
+        }
+
+        /** Sets this vector's components to the minimum of its own and the
+            ones of the passed in vector.
+            @remarks
+                'Minimum' in this case means the combination of the lowest
+                value of x, y and z from both vectors. Lowest is taken just
+                numerically, not magnitude, so -1 < 0.
+        */
+        inline void makeFloor( const Vector2& cmp )
+        {
+            if( cmp.x < x ) x = cmp.x;
+            if( cmp.y < y ) y = cmp.y;
+        }
+
+        /** Sets this vector's components to the maximum of its own and the
+            ones of the passed in vector.
+            @remarks
+                'Maximum' in this case means the combination of the highest
+                value of x, y and z from both vectors. Highest is taken just
+                numerically, not magnitude, so 1 > -3.
+        */
+        inline void makeCeil( const Vector2& cmp )
+        {
+            if( cmp.x > x ) x = cmp.x;
+            if( cmp.y > y ) y = cmp.y;
+        }
+
+        /** Generates a vector perpendicular to this vector (eg an 'up' vector).
+            @remarks
+                This method will return a vector which is perpendicular to this
+                vector. There are an infinite number of possibilities but this
+                method will guarantee to generate one of them. If you need more
+                control you should use the Quaternion class.
+        */
+        inline Vector2 perpendicular(void) const
+        {
+            return Vector2 (-y, x);
+        }
+        /** Calculates the 2 dimensional cross-product of 2 vectors, which results
+			in a single floating point value which is 2 times the area of the triangle.
+        */
+        inline Real crossProduct( const Vector2& rkVector ) const
+        {
+            return x * rkVector.y - y * rkVector.x;
+        }
+        /** Generates a new random vector which deviates from this vector by a
+            given angle in a random direction.
+            @remarks
+                This method assumes that the random number generator has already
+                been seeded appropriately.
+            @param
+                angle The angle at which to deviate in radians
+            @param
+                up Any vector perpendicular to this one (which could generated
+                by cross-product of this vector and any other non-colinear
+                vector). If you choose not to provide this the function will
+                derive one on it's own, however if you provide one yourself the
+                function will be faster (this allows you to reuse up vectors if
+                you call this method more than once)
+            @returns
+                A random vector which deviates from this vector by angle. This
+                vector will not be normalised, normalise it if you wish
+                afterwards.
+        */
+        inline Vector2 randomDeviant(
+            Real angle) const
+        {
+
+            angle *=  Math::UnitRandom() * Math::TWO_PI;
+            Real cosa = cos(angle);
+            Real sina = sin(angle);
+            return  Vector2(cosa * x - sina * y,
+                            sina * x + cosa * y);
+        }
+
+        /** Returns true if this vector is zero length. */
+        inline bool isZeroLength(void) const
+        {
+            Real sqlen = (x * x) + (y * y);
+            return (sqlen < (1e-06 * 1e-06));
+
+        }
+
+        /** As normalise, except that this vector is unaffected and the
+            normalised vector is returned as a copy. */
+        inline Vector2 normalisedCopy(void) const
+        {
+            Vector2 ret = *this;
+            ret.normalise();
+            return ret;
+        }
+
+        /** Calculates a reflection vector to the plane with the given normal .
+        @remarks NB assumes 'this' is pointing AWAY FROM the plane, invert if it is not.
+        */
+        inline Vector2 reflect(const Vector2& normal) const
+        {
+            return Vector2( *this - ( 2 * this->dotProduct(normal) * normal ) );
+        }
+
+        // special points
+        static const Vector2 ZERO;
+        static const Vector2 UNIT_X;
+        static const Vector2 UNIT_Y;
+        static const Vector2 NEGATIVE_UNIT_X;
+        static const Vector2 NEGATIVE_UNIT_Y;
+        static const Vector2 UNIT_SCALE;
+
+        /** Function for writing to a stream.
+        */
+        inline _OgreExport friend std::ostream& operator <<
+            ( std::ostream& o, const Vector2& v )
+        {
+            o << "Vector2(" << v.x << ", " << v.y <<  ")";
+            return o;
+        }
+
+    };
+
+}
+#endif
Index: /OgreMain/include/OgreVector3.h
===================================================================
--- /OgreMain/include/OgreVector3.h	(revision 5)
+++ /OgreMain/include/OgreVector3.h	(revision 5)
@@ -0,0 +1,769 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Vector3_H__
+#define __Vector3_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMath.h"
+#include "OgreQuaternion.h"
+
+namespace Ogre
+{
+
+    /** Standard 3-dimensional vector.
+        @remarks
+            A direction in 3D space represented as distances along the 3
+            orthoganal axes (x, y, z). Note that positions, directions and
+            scaling factors can be represented by a vector, depending on how
+            you interpret the values.
+    */
+    class _OgreExport Vector3
+    {
+    public:
+		Real x, y, z;
+
+    public:
+        inline Vector3()
+        {
+        }
+
+        inline Vector3( const Real fX, const Real fY, const Real fZ )
+            : x( fX ), y( fY ), z( fZ )
+        {
+        }
+
+        inline explicit Vector3( const Real afCoordinate[3] )
+            : x( afCoordinate[0] ),
+              y( afCoordinate[1] ),
+              z( afCoordinate[2] )
+        {
+        }
+
+        inline explicit Vector3( const int afCoordinate[3] )
+        {
+            x = (Real)afCoordinate[0];
+            y = (Real)afCoordinate[1];
+            z = (Real)afCoordinate[2];
+        }
+
+        inline explicit Vector3( Real* const r )
+            : x( r[0] ), y( r[1] ), z( r[2] )
+        {
+        }
+
+        inline explicit Vector3( const Real scaler )
+            : x( scaler )
+            , y( scaler )
+            , z( scaler )
+        {
+        }
+
+
+        inline Vector3( const Vector3& rkVector )
+            : x( rkVector.x ), y( rkVector.y ), z( rkVector.z )
+        {
+        }
+
+		inline Real operator [] ( const size_t i ) const
+        {
+            assert( i < 3 );
+
+            return *(&x+i);
+        }
+
+		inline Real& operator [] ( const size_t i )
+        {
+            assert( i < 3 );
+
+            return *(&x+i);
+        }
+		/// Pointer accessor for direct copying
+		inline Real* ptr()
+		{
+			return &x;
+		}
+		/// Pointer accessor for direct copying
+		inline const Real* ptr() const
+		{
+			return &x;
+		}
+
+        /** Assigns the value of the other vector.
+            @param
+                rkVector The other vector
+        */
+        inline Vector3& operator = ( const Vector3& rkVector )
+        {
+            x = rkVector.x;
+            y = rkVector.y;
+            z = rkVector.z;
+
+            return *this;
+        }
+
+        inline Vector3& operator = ( const Real fScaler )
+        {
+            x = fScaler;
+            y = fScaler;
+            z = fScaler;
+
+            return *this;
+        }
+
+        inline bool operator == ( const Vector3& rkVector ) const
+        {
+            return ( x == rkVector.x && y == rkVector.y && z == rkVector.z );
+        }
+
+        inline bool operator != ( const Vector3& rkVector ) const
+        {
+            return ( x != rkVector.x || y != rkVector.y || z != rkVector.z );
+        }
+
+        // arithmetic operations
+        inline Vector3 operator + ( const Vector3& rkVector ) const
+        {
+            return Vector3(
+                x + rkVector.x,
+                y + rkVector.y,
+                z + rkVector.z);
+        }
+
+        inline Vector3 operator - ( const Vector3& rkVector ) const
+        {
+            return Vector3(
+                x - rkVector.x,
+                y - rkVector.y,
+                z - rkVector.z);
+        }
+
+        inline Vector3 operator * ( const Real fScalar ) const
+        {
+            return Vector3(
+                x * fScalar,
+                y * fScalar,
+                z * fScalar);
+        }
+
+        inline Vector3 operator * ( const Vector3& rhs) const
+        {
+            return Vector3(
+                x * rhs.x,
+                y * rhs.y,
+                z * rhs.z);
+        }
+
+        inline Vector3 operator / ( const Real fScalar ) const
+        {
+            assert( fScalar != 0.0 );
+
+            Real fInv = 1.0 / fScalar;
+
+            return Vector3(
+                x * fInv,
+                y * fInv,
+                z * fInv);
+        }
+
+        inline Vector3 operator / ( const Vector3& rhs) const
+        {
+            return Vector3(
+                x / rhs.x,
+                y / rhs.y,
+                z / rhs.z);
+        }
+
+        inline const Vector3& operator + () const
+        {
+            return *this;
+        }
+
+        inline Vector3 operator - () const
+        {
+            return Vector3(-x, -y, -z);
+        }
+
+        // overloaded operators to help Vector3
+        inline friend Vector3 operator * ( const Real fScalar, const Vector3& rkVector )
+        {
+            return Vector3(
+                fScalar * rkVector.x,
+                fScalar * rkVector.y,
+                fScalar * rkVector.z);
+        }
+
+        inline friend Vector3 operator / ( const Real fScalar, const Vector3& rkVector )
+        {
+            return Vector3(
+                fScalar / rkVector.x,
+                fScalar / rkVector.y,
+                fScalar / rkVector.z);
+        }
+
+        inline friend Vector3 operator + (const Vector3& lhs, const Real rhs)
+        {
+            return Vector3(
+                lhs.x + rhs,
+                lhs.y + rhs,
+                lhs.z + rhs);
+        }
+
+        inline friend Vector3 operator + (const Real lhs, const Vector3& rhs)
+        {
+            return Vector3(
+                lhs + rhs.x,
+                lhs + rhs.y,
+                lhs + rhs.z);
+        }
+
+        inline friend Vector3 operator - (const Vector3& lhs, const Real rhs)
+        {
+            return Vector3(
+                lhs.x - rhs,
+                lhs.y - rhs,
+                lhs.z - rhs);
+        }
+
+        inline friend Vector3 operator - (const Real lhs, const Vector3& rhs)
+        {
+            return Vector3(
+                lhs - rhs.x,
+                lhs - rhs.y,
+                lhs - rhs.z);
+        }
+
+        // arithmetic updates
+        inline Vector3& operator += ( const Vector3& rkVector )
+        {
+            x += rkVector.x;
+            y += rkVector.y;
+            z += rkVector.z;
+
+            return *this;
+        }
+
+        inline Vector3& operator += ( const Real fScalar )
+        {
+            x += fScalar;
+            y += fScalar;
+            z += fScalar;
+            return *this;
+        }
+
+        inline Vector3& operator -= ( const Vector3& rkVector )
+        {
+            x -= rkVector.x;
+            y -= rkVector.y;
+            z -= rkVector.z;
+
+            return *this;
+        }
+
+        inline Vector3& operator -= ( const Real fScalar )
+        {
+            x -= fScalar;
+            y -= fScalar;
+            z -= fScalar;
+            return *this;
+        }
+
+        inline Vector3& operator *= ( const Real fScalar )
+        {
+            x *= fScalar;
+            y *= fScalar;
+            z *= fScalar;
+            return *this;
+        }
+
+        inline Vector3& operator *= ( const Vector3& rkVector )
+        {
+            x *= rkVector.x;
+            y *= rkVector.y;
+            z *= rkVector.z;
+
+            return *this;
+        }
+
+        inline Vector3& operator /= ( const Real fScalar )
+        {
+            assert( fScalar != 0.0 );
+
+            Real fInv = 1.0 / fScalar;
+
+            x *= fInv;
+            y *= fInv;
+            z *= fInv;
+
+            return *this;
+        }
+
+        inline Vector3& operator /= ( const Vector3& rkVector )
+        {
+            x /= rkVector.x;
+            y /= rkVector.y;
+            z /= rkVector.z;
+
+            return *this;
+        }
+
+
+        /** Returns the length (magnitude) of the vector.
+            @warning
+                This operation requires a square root and is expensive in
+                terms of CPU operations. If you don't need to know the exact
+                length (e.g. for just comparing lengths) use squaredLength()
+                instead.
+        */
+        inline Real length () const
+        {
+            return Math::Sqrt( x * x + y * y + z * z );
+        }
+
+        /** Returns the square of the length(magnitude) of the vector.
+            @remarks
+                This  method is for efficiency - calculating the actual
+                length of a vector requires a square root, which is expensive
+                in terms of the operations required. This method returns the
+                square of the length of the vector, i.e. the same as the
+                length but before the square root is taken. Use this if you
+                want to find the longest / shortest vector without incurring
+                the square root.
+        */
+        inline Real squaredLength () const
+        {
+            return x * x + y * y + z * z;
+        }
+
+        /** Returns the distance to another vector.
+            @warning
+                This operation requires a square root and is expensive in
+                terms of CPU operations. If you don't need to know the exact
+                distance (e.g. for just comparing distances) use squaredDistance()
+                instead.
+        */
+        inline Real distance(const Vector3& rhs) const
+        {
+            return (*this - rhs).length();
+        }
+
+        /** Returns the square of the distance to another vector.
+            @remarks
+                This method is for efficiency - calculating the actual
+                distance to another vector requires a square root, which is
+                expensive in terms of the operations required. This method
+                returns the square of the distance to another vector, i.e.
+                the same as the distance but before the square root is taken.
+                Use this if you want to find the longest / shortest distance
+                without incurring the square root.
+        */
+        inline Real squaredDistance(const Vector3& rhs) const
+        {
+            return (*this - rhs).squaredLength();
+        }
+
+        /** Calculates the dot (scalar) product of this vector with another.
+            @remarks
+                The dot product can be used to calculate the angle between 2
+                vectors. If both are unit vectors, the dot product is the
+                cosine of the angle; otherwise the dot product must be
+                divided by the product of the lengths of both vectors to get
+                the cosine of the angle. This result can further be used to
+                calculate the distance of a point from a plane.
+            @param
+                vec Vector with which to calculate the dot product (together
+                with this one).
+            @returns
+                A float representing the dot product value.
+        */
+        inline Real dotProduct(const Vector3& vec) const
+        {
+            return x * vec.x + y * vec.y + z * vec.z;
+        }
+
+        /** Calculates the absolute dot (scalar) product of this vector with another.
+            @remarks
+                This function work similar dotProduct, except it use absolute value
+                of each component of the vector to computing.
+            @param
+                vec Vector with which to calculate the absolute dot product (together
+                with this one).
+            @returns
+                A Real representing the absolute dot product value.
+        */
+        inline Real absDotProduct(const Vector3& vec) const
+        {
+            return Math::Abs(x * vec.x) + Math::Abs(y * vec.y) + Math::Abs(z * vec.z);
+        }
+
+        /** Normalises the vector.
+            @remarks
+                This method normalises the vector such that it's
+                length / magnitude is 1. The result is called a unit vector.
+            @note
+                This function will not crash for zero-sized vectors, but there
+                will be no changes made to their components.
+            @returns The previous length of the vector.
+        */
+        inline Real normalise()
+        {
+            Real fLength = Math::Sqrt( x * x + y * y + z * z );
+
+            // Will also work for zero-sized vectors, but will change nothing
+            if ( fLength > 1e-08 )
+            {
+                Real fInvLength = 1.0 / fLength;
+                x *= fInvLength;
+                y *= fInvLength;
+                z *= fInvLength;
+            }
+
+            return fLength;
+        }
+
+        /** Calculates the cross-product of 2 vectors, i.e. the vector that
+            lies perpendicular to them both.
+            @remarks
+                The cross-product is normally used to calculate the normal
+                vector of a plane, by calculating the cross-product of 2
+                non-equivalent vectors which lie on the plane (e.g. 2 edges
+                of a triangle).
+            @param
+                vec Vector which, together with this one, will be used to
+                calculate the cross-product.
+            @returns
+                A vector which is the result of the cross-product. This
+                vector will <b>NOT</b> be normalised, to maximise efficiency
+                - call Vector3::normalise on the result if you wish this to
+                be done. As for which side the resultant vector will be on, the
+                returned vector will be on the side from which the arc from 'this'
+                to rkVector is anticlockwise, e.g. UNIT_Y.crossProduct(UNIT_Z)
+                = UNIT_X, whilst UNIT_Z.crossProduct(UNIT_Y) = -UNIT_X.
+				This is because OGRE uses a right-handed coordinate system.
+            @par
+                For a clearer explanation, look a the left and the bottom edges
+                of your monitor's screen. Assume that the first vector is the
+                left edge and the second vector is the bottom edge, both of
+                them starting from the lower-left corner of the screen. The
+                resulting vector is going to be perpendicular to both of them
+                and will go <i>inside</i> the screen, towards the cathode tube
+                (assuming you're using a CRT monitor, of course).
+        */
+        inline Vector3 crossProduct( const Vector3& rkVector ) const
+        {
+            return Vector3(
+                y * rkVector.z - z * rkVector.y,
+                z * rkVector.x - x * rkVector.z,
+                x * rkVector.y - y * rkVector.x);
+        }
+
+        /** Returns a vector at a point half way between this and the passed
+            in vector.
+        */
+        inline Vector3 midPoint( const Vector3& vec ) const
+        {
+            return Vector3(
+                ( x + vec.x ) * 0.5,
+                ( y + vec.y ) * 0.5,
+                ( z + vec.z ) * 0.5 );
+        }
+
+        /** Returns true if the vector's scalar components are all greater
+            that the ones of the vector it is compared against.
+        */
+        inline bool operator < ( const Vector3& rhs ) const
+        {
+            if( x < rhs.x && y < rhs.y && z < rhs.z )
+                return true;
+            return false;
+        }
+
+        /** Returns true if the vector's scalar components are all smaller
+            that the ones of the vector it is compared against.
+        */
+        inline bool operator > ( const Vector3& rhs ) const
+        {
+            if( x > rhs.x && y > rhs.y && z > rhs.z )
+                return true;
+            return false;
+        }
+
+        /** Sets this vector's components to the minimum of its own and the
+            ones of the passed in vector.
+            @remarks
+                'Minimum' in this case means the combination of the lowest
+                value of x, y and z from both vectors. Lowest is taken just
+                numerically, not magnitude, so -1 < 0.
+        */
+        inline void makeFloor( const Vector3& cmp )
+        {
+            if( cmp.x < x ) x = cmp.x;
+            if( cmp.y < y ) y = cmp.y;
+            if( cmp.z < z ) z = cmp.z;
+        }
+
+        /** Sets this vector's components to the maximum of its own and the
+            ones of the passed in vector.
+            @remarks
+                'Maximum' in this case means the combination of the highest
+                value of x, y and z from both vectors. Highest is taken just
+                numerically, not magnitude, so 1 > -3.
+        */
+        inline void makeCeil( const Vector3& cmp )
+        {
+            if( cmp.x > x ) x = cmp.x;
+            if( cmp.y > y ) y = cmp.y;
+            if( cmp.z > z ) z = cmp.z;
+        }
+
+        /** Generates a vector perpendicular to this vector (eg an 'up' vector).
+            @remarks
+                This method will return a vector which is perpendicular to this
+                vector. There are an infinite number of possibilities but this
+                method will guarantee to generate one of them. If you need more
+                control you should use the Quaternion class.
+        */
+        inline Vector3 perpendicular(void) const
+        {
+            static const Real fSquareZero = 1e-06 * 1e-06;
+
+            Vector3 perp = this->crossProduct( Vector3::UNIT_X );
+
+            // Check length
+            if( perp.squaredLength() < fSquareZero )
+            {
+                /* This vector is the Y axis multiplied by a scalar, so we have
+                   to use another axis.
+                */
+                perp = this->crossProduct( Vector3::UNIT_Y );
+            }
+			perp.normalise();
+
+            return perp;
+        }
+        /** Generates a new random vector which deviates from this vector by a
+            given angle in a random direction.
+            @remarks
+                This method assumes that the random number generator has already
+                been seeded appropriately.
+            @param
+                angle The angle at which to deviate
+            @param
+                up Any vector perpendicular to this one (which could generated
+                by cross-product of this vector and any other non-colinear
+                vector). If you choose not to provide this the function will
+                derive one on it's own, however if you provide one yourself the
+                function will be faster (this allows you to reuse up vectors if
+                you call this method more than once)
+            @returns
+                A random vector which deviates from this vector by angle. This
+                vector will not be normalised, normalise it if you wish
+                afterwards.
+        */
+        inline Vector3 randomDeviant(
+            const Radian& angle,
+            const Vector3& up = Vector3::ZERO ) const
+        {
+            Vector3 newUp;
+
+            if (up == Vector3::ZERO)
+            {
+                // Generate an up vector
+                newUp = this->perpendicular();
+            }
+            else
+            {
+                newUp = up;
+            }
+
+            // Rotate up vector by random amount around this
+            Quaternion q;
+            q.FromAngleAxis( Radian(Math::UnitRandom() * Math::TWO_PI), *this );
+            newUp = q * newUp;
+
+            // Finally rotate this by given angle around randomised up
+            q.FromAngleAxis( angle, newUp );
+            return q * (*this);
+        }
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline Vector3 randomDeviant(
+            Real angle,
+            const Vector3& up = Vector3::ZERO ) const
+        {
+            return randomDeviant ( Radian(angle), up );
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Gets the shortest arc quaternion to rotate this vector to the destination
+            vector.
+        @remarks
+            If you call this with a dest vector that is close to the inverse
+            of this vector, we will rotate 180 degrees around the 'fallbackAxis'
+			(if specified, or a generated axis if not) since in this case
+			ANY axis of rotation is valid.
+        */
+        Quaternion getRotationTo(const Vector3& dest,
+			const Vector3& fallbackAxis = Vector3::ZERO) const
+        {
+            // Based on Stan Melax's article in Game Programming Gems
+            Quaternion q;
+            // Copy, since cannot modify local
+            Vector3 v0 = *this;
+            Vector3 v1 = dest;
+            v0.normalise();
+            v1.normalise();
+
+            Real d = v0.dotProduct(v1);
+            // If dot == 1, vectors are the same
+            if (d >= 1.0f)
+            {
+                return Quaternion::IDENTITY;
+            }
+			if (d < (1e-6f - 1.0f))
+			{
+				if (fallbackAxis != Vector3::ZERO)
+				{
+					// rotate 180 degrees about the fallback axis
+					q.FromAngleAxis(Radian(Math::PI), fallbackAxis);
+				}
+				else
+				{
+					// Generate an axis
+					Vector3 axis = Vector3::UNIT_X.crossProduct(*this);
+					if (axis.isZeroLength()) // pick another if colinear
+						axis = Vector3::UNIT_Y.crossProduct(*this);
+					axis.normalise();
+					q.FromAngleAxis(Radian(Math::PI), axis);
+				}
+			}
+			else
+			{
+                Real s = Math::Sqrt( (1+d)*2 );
+	            Real invs = 1 / s;
+
+				Vector3 c = v0.crossProduct(v1);
+
+    	        q.x = c.x * invs;
+        	    q.y = c.y * invs;
+            	q.z = c.z * invs;
+            	q.w = s * 0.5;
+				q.normalise();
+			}
+            return q;
+        }
+
+        /** Returns true if this vector is zero length. */
+        inline bool isZeroLength(void) const
+        {
+            Real sqlen = (x * x) + (y * y) + (z * z);
+            return (sqlen < (1e-06 * 1e-06));
+
+        }
+
+        /** As normalise, except that this vector is unaffected and the
+            normalised vector is returned as a copy. */
+        inline Vector3 normalisedCopy(void) const
+        {
+            Vector3 ret = *this;
+            ret.normalise();
+            return ret;
+        }
+
+        /** Calculates a reflection vector to the plane with the given normal .
+        @remarks NB assumes 'this' is pointing AWAY FROM the plane, invert if it is not.
+        */
+        inline Vector3 reflect(const Vector3& normal) const
+        {
+            return Vector3( *this - ( 2 * this->dotProduct(normal) * normal ) );
+        }
+
+		/** Returns whether this vector is within a positional tolerance
+			of another vector.
+		@param rhs The vector to compare with
+		@param tolerance The amount that each element of the vector may vary by
+			and still be considered equal
+		*/
+		inline bool positionEquals(const Vector3& rhs, Real tolerance = 1e-03) const
+		{
+			return Math::RealEqual(x, rhs.x, tolerance) &&
+				Math::RealEqual(y, rhs.y, tolerance) &&
+				Math::RealEqual(z, rhs.z, tolerance);
+
+		}
+
+		/** Returns whether this vector is within a positional tolerance
+			of another vector, also take scale of the vectors into account.
+		@param rhs The vector to compare with
+		@param tolerance The amount (related to the scale of vectors) that distance
+            of the vector may vary by and still be considered close
+		*/
+		inline bool positionCloses(const Vector3& rhs, Real tolerance = 1e-03f) const
+		{
+			return squaredDistance(rhs) <=
+                (squaredLength() + rhs.squaredLength()) * tolerance;
+		}
+
+		/** Returns whether this vector is within a directional tolerance
+			of another vector.
+		@param rhs The vector to compare with
+		@param tolerance The maximum angle by which the vectors may vary and
+			still be considered equal
+		@note Both vectors should be normalised.
+		*/
+		inline bool directionEquals(const Vector3& rhs,
+			const Radian& tolerance) const
+		{
+			Real dot = dotProduct(rhs);
+			Radian angle = Math::ACos(dot);
+
+			return Math::Abs(angle.valueRadians()) <= tolerance.valueRadians();
+
+		}
+
+        // special points
+        static const Vector3 ZERO;
+        static const Vector3 UNIT_X;
+        static const Vector3 UNIT_Y;
+        static const Vector3 UNIT_Z;
+        static const Vector3 NEGATIVE_UNIT_X;
+        static const Vector3 NEGATIVE_UNIT_Y;
+        static const Vector3 NEGATIVE_UNIT_Z;
+        static const Vector3 UNIT_SCALE;
+
+        /** Function for writing to a stream.
+        */
+        inline _OgreExport friend std::ostream& operator <<
+            ( std::ostream& o, const Vector3& v )
+        {
+            o << "Vector3(" << v.x << ", " << v.y << ", " << v.z << ")";
+            return o;
+        }
+    };
+
+}
+#endif
Index: /OgreMain/include/OgreVector4.h
===================================================================
--- /OgreMain/include/OgreVector4.h	(revision 5)
+++ /OgreMain/include/OgreVector4.h	(revision 5)
@@ -0,0 +1,396 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Vector4_H__
+#define __Vector4_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreVector3.h"
+
+namespace Ogre
+{
+
+    /** 4-dimensional homogenous vector.
+    */
+    class _OgreExport Vector4
+    {
+    public:
+        Real x, y, z, w;
+
+    public:
+        inline Vector4()
+        {
+        }
+
+        inline Vector4( const Real fX, const Real fY, const Real fZ, const Real fW )
+            : x( fX ), y( fY ), z( fZ ), w( fW)
+        {
+        }
+
+        inline explicit Vector4( const Real afCoordinate[4] )
+            : x( afCoordinate[0] ),
+              y( afCoordinate[1] ),
+              z( afCoordinate[2] ),
+              w( afCoordinate[3] )
+        {
+        }
+
+        inline explicit Vector4( const int afCoordinate[4] )
+        {
+            x = (Real)afCoordinate[0];
+            y = (Real)afCoordinate[1];
+            z = (Real)afCoordinate[2];
+            w = (Real)afCoordinate[3];
+        }
+
+        inline explicit Vector4( Real* const r )
+            : x( r[0] ), y( r[1] ), z( r[2] ), w( r[3] )
+        {
+        }
+
+        inline explicit Vector4( const Real scaler )
+            : x( scaler )
+            , y( scaler )
+            , z( scaler )
+            , w( scaler )
+        {
+        }
+
+        inline explicit Vector4(const Vector3& rhs)
+            : x(rhs.x), y(rhs.y), z(rhs.z), w(1.0f)
+        {
+        }
+
+        inline Vector4( const Vector4& rkVector )
+            : x( rkVector.x ), y( rkVector.y ), z( rkVector.z ), w (rkVector.w)
+        {
+        }
+
+		inline Real operator [] ( const size_t i ) const
+        {
+            assert( i < 4 );
+
+            return *(&x+i);
+        }
+
+		inline Real& operator [] ( const size_t i )
+        {
+            assert( i < 4 );
+
+            return *(&x+i);
+        }
+
+		/// Pointer accessor for direct copying
+		inline Real* ptr()
+		{
+			return &x;
+		}
+		/// Pointer accessor for direct copying
+		inline const Real* ptr() const
+		{
+			return &x;
+		}
+
+        /** Assigns the value of the other vector.
+            @param
+                rkVector The other vector
+        */
+        inline Vector4& operator = ( const Vector4& rkVector )
+        {
+            x = rkVector.x;
+            y = rkVector.y;
+            z = rkVector.z;
+            w = rkVector.w;
+
+            return *this;
+        }
+
+		inline Vector4& operator = ( const Real fScalar)
+		{
+			x = fScalar;
+			y = fScalar;
+			z = fScalar;
+			w = fScalar;
+			return *this;
+		}
+
+        inline bool operator == ( const Vector4& rkVector ) const
+        {
+            return ( x == rkVector.x &&
+                y == rkVector.y &&
+                z == rkVector.z &&
+                w == rkVector.w );
+        }
+
+        inline bool operator != ( const Vector4& rkVector ) const
+        {
+            return ( x != rkVector.x ||
+                y != rkVector.y ||
+                z != rkVector.z ||
+                w != rkVector.w );
+        }
+
+        inline Vector4& operator = (const Vector3& rhs)
+        {
+            x = rhs.x;
+            y = rhs.y;
+            z = rhs.z;
+            w = 1.0f;
+            return *this;
+        }
+
+        // arithmetic operations
+        inline Vector4 operator + ( const Vector4& rkVector ) const
+        {
+            return Vector4(
+                x + rkVector.x,
+                y + rkVector.y,
+                z + rkVector.z,
+                w + rkVector.w);
+        }
+
+        inline Vector4 operator - ( const Vector4& rkVector ) const
+        {
+            return Vector4(
+                x - rkVector.x,
+                y - rkVector.y,
+                z - rkVector.z,
+                w - rkVector.w);
+        }
+
+        inline Vector4 operator * ( const Real fScalar ) const
+        {
+            return Vector4(
+                x * fScalar,
+                y * fScalar,
+                z * fScalar,
+                w * fScalar);
+        }
+
+        inline Vector4 operator * ( const Vector4& rhs) const
+        {
+            return Vector4(
+                rhs.x * x,
+                rhs.y * y,
+                rhs.z * z,
+                rhs.w * w);
+        }
+
+        inline Vector4 operator / ( const Real fScalar ) const
+        {
+            assert( fScalar != 0.0 );
+
+            Real fInv = 1.0 / fScalar;
+
+            return Vector4(
+                x * fInv,
+                y * fInv,
+                z * fInv,
+                w * fInv);
+        }
+
+        inline Vector4 operator / ( const Vector4& rhs) const
+        {
+            return Vector4(
+                x / rhs.x,
+                y / rhs.y,
+                z / rhs.z,
+                w / rhs.w);
+        }
+
+        inline const Vector4& operator + () const
+        {
+            return *this;
+        }
+
+        inline Vector4 operator - () const
+        {
+            return Vector4(-x, -y, -z, -w);
+        }
+
+        inline friend Vector4 operator * ( const Real fScalar, const Vector4& rkVector )
+        {
+            return Vector4(
+                fScalar * rkVector.x,
+                fScalar * rkVector.y,
+                fScalar * rkVector.z,
+                fScalar * rkVector.w);
+        }
+
+        inline friend Vector4 operator / ( const Real fScalar, const Vector4& rkVector )
+        {
+            return Vector4(
+                fScalar / rkVector.x,
+                fScalar / rkVector.y,
+                fScalar / rkVector.z,
+                fScalar / rkVector.w);
+        }
+
+        inline friend Vector4 operator + (const Vector4& lhs, const Real rhs)
+        {
+            return Vector4(
+                lhs.x + rhs,
+                lhs.y + rhs,
+                lhs.z + rhs,
+                lhs.w + rhs);
+        }
+
+        inline friend Vector4 operator + (const Real lhs, const Vector4& rhs)
+        {
+            return Vector4(
+                lhs + rhs.x,
+                lhs + rhs.y,
+                lhs + rhs.z,
+                lhs + rhs.w);
+        }
+
+        inline friend Vector4 operator - (const Vector4& lhs, Real rhs)
+        {
+            return Vector4(
+                lhs.x - rhs,
+                lhs.y - rhs,
+                lhs.z - rhs,
+                lhs.w - rhs);
+        }
+
+        inline friend Vector4 operator - (const Real lhs, const Vector4& rhs)
+        {
+            return Vector4(
+                lhs - rhs.x,
+                lhs - rhs.y,
+                lhs - rhs.z,
+                lhs - rhs.w);
+        }
+
+        // arithmetic updates
+        inline Vector4& operator += ( const Vector4& rkVector )
+        {
+            x += rkVector.x;
+            y += rkVector.y;
+            z += rkVector.z;
+            w += rkVector.w;
+
+            return *this;
+        }
+
+        inline Vector4& operator -= ( const Vector4& rkVector )
+        {
+            x -= rkVector.x;
+            y -= rkVector.y;
+            z -= rkVector.z;
+            w -= rkVector.w;
+
+            return *this;
+        }
+
+        inline Vector4& operator *= ( const Real fScalar )
+        {
+            x *= fScalar;
+            y *= fScalar;
+            z *= fScalar;
+            w *= fScalar;
+            return *this;
+        }
+
+        inline Vector4& operator += ( const Real fScalar )
+        {
+            x += fScalar;
+            y += fScalar;
+            z += fScalar;
+            w += fScalar;
+            return *this;
+        }
+
+        inline Vector4& operator -= ( const Real fScalar )
+        {
+            x -= fScalar;
+            y -= fScalar;
+            z -= fScalar;
+            w -= fScalar;
+            return *this;
+        }
+
+        inline Vector4& operator *= ( const Vector4& rkVector )
+        {
+            x *= rkVector.x;
+            y *= rkVector.y;
+            z *= rkVector.z;
+            w *= rkVector.w;
+
+            return *this;
+        }
+
+        inline Vector4& operator /= ( const Real fScalar )
+        {
+            assert( fScalar != 0.0 );
+
+            Real fInv = 1.0 / fScalar;
+
+            x *= fInv;
+            y *= fInv;
+            z *= fInv;
+            w *= fInv;
+
+            return *this;
+        }
+
+        inline Vector4& operator /= ( const Vector4& rkVector )
+        {
+            x /= rkVector.x;
+            y /= rkVector.y;
+            z /= rkVector.z;
+            w /= rkVector.w;
+
+            return *this;
+        }
+
+        /** Calculates the dot (scalar) product of this vector with another.
+            @param
+                vec Vector with which to calculate the dot product (together
+                with this one).
+            @returns
+                A float representing the dot product value.
+        */
+        inline Real dotProduct(const Vector4& vec) const
+        {
+            return x * vec.x + y * vec.y + z * vec.z + w * vec.w;
+        }
+        /** Function for writing to a stream.
+        */
+        inline _OgreExport friend std::ostream& operator <<
+            ( std::ostream& o, const Vector4& v )
+        {
+            o << "Vector4(" << v.x << ", " << v.y << ", " << v.z << ", " << v.w << ")";
+            return o;
+        }
+        // special
+        static const Vector4 ZERO;
+    };
+
+}
+#endif
Index: /OgreMain/include/OgreVertexBoneAssignment.h
===================================================================
--- /OgreMain/include/OgreVertexBoneAssignment.h	(revision 5)
+++ /OgreMain/include/OgreVertexBoneAssignment.h	(revision 5)
@@ -0,0 +1,56 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __VertexBoneAssignment_H__
+#define __VertexBoneAssignment_H__
+
+#include "OgrePrerequisites.h"
+
+
+namespace Ogre 
+{
+    
+    /** Records the assignment of a single vertex to a single bone with the corresponding weight.
+    @remarks
+        This simple struct simply holds a vertex index, bone index and weight representing the
+        assignment of a vertex to a bone for skeletal animation. There may be many of these
+        per vertex if blended vertex assignments are allowed.
+    */
+    typedef struct VertexBoneAssignment_s
+    {
+        unsigned int vertexIndex;
+        unsigned short boneIndex;
+        Real weight;
+
+    } VertexBoneAssignment;
+
+
+}
+
+#endif
Index: /OgreMain/include/OgreVertexIndexData.h
===================================================================
--- /OgreMain/include/OgreVertexIndexData.h	(revision 5)
+++ /OgreMain/include/OgreVertexIndexData.h	(revision 5)
@@ -0,0 +1,286 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __VertexIndexData_H__
+#define __VertexIndexData_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreHardwareIndexBuffer.h"
+
+namespace Ogre {
+	
+	/// Define a list of usage flags
+	typedef std::vector<HardwareBuffer::Usage> BufferUsageList;
+
+
+	/** Summary class collecting together vertex source information. */
+	class _OgreExport VertexData
+	{
+    private:
+        /// Protected copy constructor, to prevent misuse
+        VertexData(const VertexData& rhs); /* do nothing, should not use */
+        /// Protected operator=, to prevent misuse
+        VertexData& operator=(const VertexData& rhs); /* do not use */
+    public:
+        VertexData();
+        ~VertexData();
+
+		/** Declaration of the vertex to be used in this operation. 
+		@remarks Note that this is created for you on construction.
+		*/
+		VertexDeclaration* vertexDeclaration;
+		/** The vertex buffer bindings to be used. 
+		@remarks Note that this is created for you on construction.
+		*/
+		VertexBufferBinding* vertexBufferBinding;
+		/// The base vertex index to start from
+		size_t vertexStart;
+		/// The number of vertices used in this operation
+		size_t vertexCount;
+
+
+		/// Struct used to hold hardware morph / pose vertex data information
+		struct HardwareAnimationData
+		{
+			const VertexElement* targetVertexElement;
+			Real parametric;
+		};
+		typedef std::vector<HardwareAnimationData> HardwareAnimationDataList;
+		/// VertexElements used for hardware morph / pose animation
+		HardwareAnimationDataList hwAnimationDataList;
+		/// Number of hardware animation data items used
+		size_t hwAnimDataItemsUsed;
+		
+		/** Clones this vertex data, potentially including replicating any vertex buffers.
+		@remarks The caller is expected to delete the returned pointer when ready
+		*/
+		VertexData* clone(bool copyData = true) const;
+
+        /** Modifies the vertex data to be suitable for use for rendering shadow geometry.
+        @remarks
+            Preparing vertex data to generate a shadow volume involves firstly ensuring that the 
+            vertex buffer containing the positions is a standalone vertex buffer,
+            with no other components in it. This method will therefore break apart any existing
+            vertex buffers if position is sharing a vertex buffer. 
+            Secondly, it will double the size of this vertex buffer so that there are 2 copies of 
+            the position data for the mesh. The first half is used for the original, and the second 
+            half is used for the 'extruded' version. The vertex count used to render will remain 
+            the same though, so as not to add any overhead to regular rendering of the object.
+            Both copies of the position are required in one buffer because shadow volumes stretch 
+            from the original mesh to the extruded version. 
+        @par
+            It's important to appreciate that this method can fundamentally change the structure of your
+            vertex buffers, although in reality they will be new buffers. As it happens, if other 
+            objects are using the original buffers then they will be unaffected because the reference
+            counting will keep them intact. However, if you have made any assumptions about the 
+            structure of the vertex data in the buffers of this object, you may have to rethink them.
+        */
+        void prepareForShadowVolume(void);
+
+        /** Additional shadow volume vertex buffer storage. 
+        @remarks
+            This additional buffer is only used where we have prepared this VertexData for
+            use in shadow volume contruction, and where the current render system supports
+            vertex programs. This buffer contains the 'w' vertex position component which will
+            be used by that program to differentiate between extruded and non-extruded vertices.
+            This 'w' component cannot be included in the original position buffer because
+            DirectX does not allow 4-component positions in the fixed-function pipeline, and the original
+            position buffer must still be usable for fixed-function rendering.
+        @par    
+            Note that we don't store any vertex declaration or vertex buffer binding here becuase this
+            can be reused in the shadow algorithm.
+        */
+        HardwareVertexBufferSharedPtr hardwareShadowVolWBuffer;
+
+
+		/** Reorganises the data in the vertex buffers according to the 
+			new vertex declaration passed in. Note that new vertex buffers
+			are created and written to, so if the buffers being referenced 
+			by this vertex data object are also used by others, then the 
+			original buffers will not be damaged by this operation.
+			Once this operation has completed, the new declaration 
+			passed in will overwrite the current one.
+		@param newDeclaration The vertex declaration which will be used
+			for the reorganised buffer state. Note that the new delcaration
+			must not include any elements which do not already exist in the 
+			current declaration; you can drop elements by 
+			excluding them from the declaration if you wish, however.
+		@param bufferUsages Vector of usage flags which indicate the usage options
+			for each new vertex buffer created. The indexes of the entries must correspond
+			to the buffer binding values referenced in the declaration.
+		*/
+		void reorganiseBuffers(VertexDeclaration* newDeclaration, const BufferUsageList& bufferUsage);
+
+		/** Reorganises the data in the vertex buffers according to the 
+			new vertex declaration passed in. Note that new vertex buffers
+			are created and written to, so if the buffers being referenced 
+			by this vertex data object are also used by others, then the 
+			original buffers will not be damaged by this operation.
+			Once this operation has completed, the new declaration 
+			passed in will overwrite the current one.
+            This version of the method derives the buffer usages from the existing
+            buffers, by using the 'most flexible' usage from the equivalent sources.
+		@param newDeclaration The vertex declaration which will be used
+			for the reorganised buffer state. Note that the new delcaration
+			must not include any elements which do not already exist in the 
+			current declaration; you can drop elements by 
+			excluding them from the declaration if you wish, however.
+		*/
+		void reorganiseBuffers(VertexDeclaration* newDeclaration);
+
+        /** Remove any gaps in the vertex buffer bindings.
+        @remarks
+            This is useful if you've removed elements and buffers from this vertex
+            data and want to remove any gaps in the vertex buffer bindings. This
+            method is mainly useful when reorganising vertex data manually.
+        @note
+            This will cause binding index of the elements in the vertex declaration
+            to be altered to new binding index.
+        */
+        void closeGapsInBindings(void);
+
+        /** Remove all vertex buffers that never used by the vertex declaration.
+        @remarks
+            This is useful if you've removed elements from the vertex declaration
+            and want to unreference buffers that never used any more. This method
+            is mainly useful when reorganising vertex data manually.
+        @note
+            This also remove any gaps in the vertex buffer bindings.
+        */
+        void removeUnusedBuffers(void);
+
+		/** Convert all packed colour values (VET_COLOUR_*) in buffers used to
+			another type.
+		@param srcType The source colour type to assume if the ambiguous VET_COLOUR
+			is encountered.
+		@param destType The destination colour type, must be VET_COLOUR_ABGR or
+			VET_COLOUR_ARGB.
+		*/
+		void convertPackedColour(VertexElementType srcType, VertexElementType destType);
+
+
+		/** Allocate elements to serve a holder of morph / pose target data 
+			for hardware morphing / pose blending.
+		@remarks
+			This method will allocate the given number of 3D texture coordinate 
+			sets for use as a morph target or target pose offset (3D position).
+			These elements will be saved in hwAnimationDataList.
+			It will also assume that the source of these new elements will be new
+			buffers which are not bound at this time, so will start the sources to 
+			1 higher than the current highest binding source. The caller is
+			expected to bind these new buffers when appropriate. For morph animation
+			the original position buffer will be the 'from' keyframe data, whilst
+			for pose animation it will be the original vertex data.
+		*/
+		void allocateHardwareAnimationElements(ushort count);
+
+
+
+	};
+
+	/** Summary class collecting together index data source information. */
+	class _OgreExport IndexData 
+	{
+    protected:
+        /// Protected copy constructor, to prevent misuse
+        IndexData(const IndexData& rhs); /* do nothing, should not use */
+        /// Protected operator=, to prevent misuse
+        IndexData& operator=(const IndexData& rhs); /* do not use */
+    public:
+        IndexData();
+        ~IndexData();
+		/// pointer to the HardwareIndexBuffer to use, must be specified if useIndexes = true
+		HardwareIndexBufferSharedPtr indexBuffer;
+
+		/// index in the buffer to start from for this operation
+		size_t indexStart;
+
+		/// The number of indexes to use from the buffer
+		size_t indexCount;
+
+		/** Clones this index data, potentially including replicating the index buffer.
+		@remarks The caller is expected to delete the returned pointer when finished
+		*/
+		IndexData* clone(bool copyData = true) const;
+
+		/** Re-order the indexes in this index data structure to be more
+			vertex cache friendly; that is to re-use the same vertices as close
+			together as possible. 
+		@remarks
+			Can only be used for index data which consists of triangle lists.
+			It would in fact be pointless to use it on triangle strips or fans
+			in any case.
+		*/
+		void optimiseVertexCacheTriList(void);
+	
+	};
+
+	/** Vertex cache profiler.
+	@remarks
+		Utility class for evaluating the effectiveness of the use of the vertex
+		cache by a given index buffer.
+	*/
+	class _OgreExport VertexCacheProfiler
+    {
+		public:
+			enum CacheType {
+				FIFO, LRU
+			};
+
+			VertexCacheProfiler(unsigned int cachesize = 16, CacheType cachetype = FIFO )
+				: size ( cachesize ), type ( cachetype ), tail (0), buffersize (0), hit (0), miss (0)
+			{
+				cache = new uint32[size];
+			};
+
+			~VertexCacheProfiler()
+			{
+				delete[] cache;
+			}
+
+			void profile(const HardwareIndexBufferSharedPtr& indexBuffer);
+			void reset() { hit = 0; miss = 0; tail = 0; buffersize = 0; };
+			void flush() { tail = 0; buffersize = 0; };
+
+			unsigned int getHits() { return hit; };
+			unsigned int getMisses() { return miss; };
+			unsigned int getSize() { return size; };
+		private:
+			unsigned int size;
+			uint32 *cache;
+			CacheType type;
+
+			unsigned int tail, buffersize;
+			unsigned int hit, miss;
+
+			bool inCache(unsigned int index);
+	};
+}
+#endif
+
Index: /OgreMain/include/OgreViewport.h
===================================================================
--- /OgreMain/include/OgreViewport.h	(revision 5)
+++ /OgreMain/include/OgreViewport.h	(revision 5)
@@ -0,0 +1,331 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Viewport_H__
+#define __Viewport_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreCommon.h"
+#include "OgreColourValue.h"
+
+namespace Ogre {
+    /** An abstraction of a viewport, i.e. a rendering region on a render
+        target.
+        @remarks
+            A viewport is the meeting of a camera and a rendering surface -
+            the camera renders the scene from a viewpoint, and places its
+            results into some subset of a rendering target, which may be the
+            whole surface or just a part of the surface. Each viewport has a
+            single camera as source and a single target as destination. A
+            camera only has 1 viewport, but a render target may have several.
+            A viewport also has a Z-order, i.e. if there is more than one
+            viewport on a single render target and they overlap, one must
+            obscure the other in some predetermined way.
+    */
+    class _OgreExport Viewport
+    {
+    public:
+        /** The usual constructor.
+            @param
+                cam Pointer to a camera to be the source for the image.
+            @param
+                target Pointer to the render target to be the destination
+                for the rendering.
+            @param
+                left
+            @param
+                top
+            @param
+                width
+            @param
+                height
+                Dimensions of the viewport, expressed as a value between
+                0 and 1. This allows the dimensions to apply irrespective of
+                changes in the target's size: e.g. to fill the whole area,
+                values of 0,0,1,1 are appropriate.
+            @param
+                ZOrder Relative Z-order on the target. Lower = further to
+                the front.
+        */
+        Viewport(
+            Camera* camera,
+            RenderTarget* target,
+            Real left, Real top,
+            Real width, Real height,
+            int ZOrder);
+
+        /** Default destructor.
+        */
+        virtual ~Viewport();
+
+        /** Notifies the viewport of a possible change in dimensions.
+            @remarks
+                Used by the target to update the viewport's dimensions
+                (usually the result of a change in target size).
+            @note
+                Internal use by Ogre only.
+        */
+        void _updateDimensions(void);
+
+        /** Instructs the viewport to updates its contents.
+        */
+        void update(void);
+
+        /** Retrieves a pointer to the render target for this viewport.
+        */
+        RenderTarget* getTarget(void) const;
+
+        /** Retrieves a pointer to the camera for this viewport.
+        */
+        Camera* getCamera(void) const;
+
+        /** Sets the camera to use for rendering to this viewport. */
+        void setCamera(Camera* cam);
+
+        /** Gets the Z-Order of this viewport. */
+		int getZOrder(void) const;
+		/** Gets one of the relative dimensions of the viewport,
+            a value between 0.0 and 1.0.
+        */
+        Real getLeft(void) const;
+
+        /** Gets one of the relative dimensions of the viewport, a value
+            between 0.0 and 1.0.
+        */
+        Real getTop(void) const;
+
+        /** Gets one of the relative dimensions of the viewport, a value
+            between 0.0 and 1.0.
+        */
+
+        Real getWidth(void) const;
+        /** Gets one of the relative dimensions of the viewport, a value
+            between 0.0 and 1.0.
+        */
+
+        Real getHeight(void) const;
+        /** Gets one of the actual dimensions of the viewport, a value in
+            pixels.
+        */
+
+        int getActualLeft(void) const;
+        /** Gets one of the actual dimensions of the viewport, a value in
+            pixels.
+        */
+
+        int getActualTop(void) const;
+        /** Gets one of the actual dimensions of the viewport, a value in
+            pixels.
+        */
+        int getActualWidth(void) const;
+        /** Gets one of the actual dimensions of the viewport, a value in
+            pixels.
+        */
+
+        int getActualHeight(void) const;
+
+        /** Sets the dimensions (after creation).
+            @param
+                left
+            @param
+                top
+            @param
+                width
+            @param
+                height Dimensions relative to the size of the target,
+                represented as real values between 0 and 1. i.e. the full
+                target area is 0, 0, 1, 1.
+        */
+        void setDimensions(Real left, Real top, Real width, Real height);
+
+        /** Sets the initial background colour of the viewport (before
+            rendering).
+        */
+        void setBackgroundColour(const ColourValue& colour);
+
+        /** Gets the background colour.
+        */
+        const ColourValue& getBackgroundColour(void) const;
+
+        /** Determines whether to clear the viewport before rendering.
+		@remarks
+			You can use this method to set which buffers are cleared
+			(if any) before rendering every frame.
+        @param clear Whether or not to clear any buffers
+		@param buffers One or more values from FrameBufferType denoting
+			which buffers to clear, if clear is set to true. Note you should
+			not clear the stencil buffer here unless you know what you're doing.
+         */
+        void setClearEveryFrame(bool clear, unsigned int buffers = FBT_COLOUR | FBT_DEPTH);
+
+        /** Determines if the viewport is cleared before every frame.
+        */
+        bool getClearEveryFrame(void) const;
+
+		/** Gets which buffers are to be cleared each frame. */
+        unsigned int getClearBuffers(void) const;
+
+		/** Set the material scheme which the viewport should use.
+		@remarks
+			This allows you to tell the system to use a particular
+			material scheme when rendering this viewport, which can 
+			involve using different techniques to render your materials.
+		@see Technique::setSchemeName
+		*/
+		void setMaterialScheme(const String& schemeName)
+		{ mMaterialSchemeName = schemeName; }
+		
+		/** Get the material scheme which the viewport should use.
+		*/
+		const String& getMaterialScheme(void) const
+		{ return mMaterialSchemeName; }
+
+		/** Access to actual dimensions (based on target size).
+        */
+        void getActualDimensions(
+            int &left, int &top, int &width, int &height ) const;
+
+        bool _isUpdated(void) const;
+        void _clearUpdatedFlag(void);
+
+        /** Gets the number of rendered faces in the last update.
+        */
+        unsigned int _getNumRenderedFaces(void) const;
+
+        /** Gets the number of rendered batches in the last update.
+        */
+        unsigned int _getNumRenderedBatches(void) const;
+
+        /** Tells this viewport whether it should display Overlay objects.
+        @remarks
+            Overlay objects are layers which appear on top of the scene. They are created via
+            SceneManager::createOverlay and every viewport displays these by default.
+            However, you probably don't want this if you're using multiple viewports,
+            because one of them is probably a picture-in-picture which is not supposed to
+            have overlays of it's own. In this case you can turn off overlays on this viewport
+            by calling this method.
+        @param enabled If true, any overlays are displayed, if false they are not.
+        */
+        void setOverlaysEnabled(bool enabled);
+
+        /** Returns whether or not Overlay objects (created in the SceneManager) are displayed in this
+            viewport. */
+        bool getOverlaysEnabled(void) const;
+
+        /** Tells this viewport whether it should display skies.
+        @remarks
+            Skies are layers which appear on background of the scene. They are created via
+            SceneManager::setSkyBox, SceneManager::setSkyPlane and SceneManager::setSkyDome and
+            every viewport displays these by default. However, you probably don't want this if
+            you're using multiple viewports, because one of them is probably a picture-in-picture
+            which is not supposed to have skies of it's own. In this case you can turn off skies
+            on this viewport by calling this method.
+        @param enabled If true, any skies are displayed, if false they are not.
+        */
+        void setSkiesEnabled(bool enabled);
+
+        /** Returns whether or not skies (created in the SceneManager) are displayed in this
+            viewport. */
+        bool getSkiesEnabled(void) const;
+
+        /** Tells this viewport whether it should display shadows.
+        @remarks
+            This setting enables you to disable shadow rendering for a given viewport. The global
+			shadow technique set on SceneManager still controls the type and nature of shadows,
+			but this flag can override the setting so that no shadows are rendered for a given
+			viewport to save processing time where they are not required.
+        @param enabled If true, any shadows are displayed, if false they are not.
+        */
+        void setShadowsEnabled(bool enabled);
+
+        /** Returns whether or not shadows (defined in the SceneManager) are displayed in this
+            viewport. */
+        bool getShadowsEnabled(void) const;
+
+
+		/** Sets a per-viewport visibility mask.
+		@remarks
+			The visibility mask is a way to exclude objects from rendering for
+			a given viewport. For each object in the frustum, a check is made
+			between this mask and the objects visibility flags 
+			(@see MovableObject::setVisibilityFlags), and if a binary 'and'
+			returns zero, the object will not be rendered.
+		*/
+		void setVisibilityMask(uint32 mask) { mVisibilityMask = mask; }
+
+		/** Gets a per-viewport visibility mask.
+		@see Viewport::setVisibilityMask
+		*/
+		uint getVisibilityMask(void) const { return mVisibilityMask; }
+
+		/** Sets the use of a custom RenderQueueInvocationSequence for
+			rendering this target.
+		@remarks
+			RenderQueueInvocationSequence instances are managed through Root. By
+			setting this, you are indicating that you wish this RenderTarget to
+			be updated using a custom sequence of render queue invocations, with
+			potentially customised ordering and render state options. You should
+			create the named sequence through Root first, then set the name here.
+		@param The name of the RenderQueueInvocationSequence to use. If you
+			specify a blank string, behaviour will return to the defaul render
+			queue management.
+		*/
+		virtual void setRenderQueueInvocationSequenceName(const String& sequenceName);
+		/** Gets the name of the render queue invocation sequence for this target. */
+		virtual const String& getRenderQueueInvocationSequenceName(void) const;
+		/// Get the invocation sequence - will return null if using standard
+		RenderQueueInvocationSequence* _getRenderQueueInvocationSequence(void);
+
+    protected:
+        Camera* mCamera;
+        RenderTarget* mTarget;
+        // Relative dimensions, irrespective of target dimensions (0..1)
+        float mRelLeft, mRelTop, mRelWidth, mRelHeight;
+        // Actual dimensions, based on target dimensions
+        int mActLeft, mActTop, mActWidth, mActHeight;
+        /// ZOrder
+        int mZOrder;
+        /// Background options
+        ColourValue mBackColour;
+        bool mClearEveryFrame;
+		unsigned int mClearBuffers;
+        bool mUpdated;
+        bool mShowOverlays;
+        bool mShowSkies;
+		bool mShowShadows;
+		uint32 mVisibilityMask;
+		// Render queue invocation sequence name
+		String mRQSequenceName;
+		RenderQueueInvocationSequence* mRQSequence;
+		/// Material scheme
+		String mMaterialSchemeName;
+    };
+
+}
+
+#endif
Index: /OgreMain/include/OgreWindowEventUtilities.h
===================================================================
--- /OgreMain/include/OgreWindowEventUtilities.h	(revision 5)
+++ /OgreMain/include/OgreWindowEventUtilities.h	(revision 5)
@@ -0,0 +1,151 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OgreWindowEventUtils_H__
+#define __OgreWindowEventUtils_H__
+
+#include "OgrePrerequisites.h"
+#include "OgrePlatform.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#  define WIN32_LEAN_AND_MEAN
+#  include <windows.h>
+#endif
+
+namespace Ogre
+{
+	/**
+	@Remarks
+		Callback class used to send out window events to client app
+	*/
+	class _OgreExport WindowEventListener
+	{
+	public:
+		virtual ~WindowEventListener() {};
+
+		/**
+		@Remarks
+			Window has moved position
+		@param rw
+			The RenderWindow which created this events
+		*/
+		virtual void windowMoved(RenderWindow* rw)   {}
+
+		/**
+		@Remarks
+			Window has resized
+		@param rw
+			The RenderWindow which created this events
+		*/
+		virtual void windowResized(RenderWindow* rw) {}
+
+		/**
+		@Remarks
+			Window has been closed
+		@param rw
+			The RenderWindow which created this events
+		*/
+		virtual void windowClosed(RenderWindow* rw)  {}
+
+		/**
+		@Remarks
+			Window has lost/gained focuw
+		@param rw
+			The RenderWindow which created this events
+		*/
+		virtual void windowFocusChange(RenderWindow* rw) {}
+	};
+
+	/**
+	@Remarks
+		Utility class to handle Window Events/Pumping/Messages
+	*/
+	class _OgreExport WindowEventUtilities
+	{
+	public:
+		/**
+		@Remarks
+			Call this once per frame if not using Root:startRendering(). This will update all registered
+			RenderWindows (If using external Windows, you can optionally register those yourself)
+		*/
+		static void messagePump();
+
+		/**
+		@Remarks
+			Add a listener to listen to renderwindow events (multiple listener's per renderwindow is fine)
+			The same listener can listen to multiple windows, as the Window Pointer is sent along with
+			any messages.
+		@param window
+			The RenderWindow you are interested in monitoring
+		@param listner
+			Your callback listener
+		*/
+		static void addWindowEventListener( RenderWindow* window, WindowEventListener* listener );
+
+		/**
+		@Remarks
+			Remove previously added listener
+		@param window
+			The RenderWindow you registered with
+		@param listner
+			The listener registered
+		*/
+		static void removeWindowEventListener( RenderWindow* window, WindowEventListener* listener );
+
+		/**
+		@Remarks
+			Called by RenderWindows upon creation for Ogre generated windows. You are free to add your
+			external windows here too if needed.
+		@param window
+			The RenderWindow to monitor
+		*/
+		static void _addRenderWindow(RenderWindow* window);
+
+		/**
+		@Remarks
+			Called by RenderWindows upon creation for Ogre generated windows. You are free to add your
+			external windows here too if needed.
+		@param window
+			The RenderWindow to remove from list
+		*/
+		static void _removeRenderWindow(RenderWindow* window);
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+		//! Internal winProc (RenderWindow's use this when creating the Win32 Window)
+		static LRESULT CALLBACK _WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+#endif
+
+		//These are public only so GLXProc can access them without adding Xlib headers header
+		typedef std::multimap<RenderWindow*, WindowEventListener*> WindowEventListeners;
+		static WindowEventListeners _msListeners;
+
+		typedef std::vector<RenderWindow*> Windows;
+		static Windows _msWindows;
+	};
+}
+#endif
Index: /OgreMain/include/OgreWireBoundingBox.h
===================================================================
--- /OgreMain/include/OgreWireBoundingBox.h	(revision 5)
+++ /OgreMain/include/OgreWireBoundingBox.h	(revision 5)
@@ -0,0 +1,81 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _WireBoundingBox_H__
+#define _WireBoundingBox_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreSimpleRenderable.h"
+
+namespace Ogre {
+
+    /** Allows the rendering of a wireframe bounding box.
+        @remarks
+            This class builds a wireframe renderable from a given aabb. A pointer to this class can be
+			added to a render queue to display the bounding box of an object.
+    */
+	class _OgreExport WireBoundingBox : public SimpleRenderable
+	{
+    protected:
+        /** Override this method to prevent parent transforms (rotation,translation,scale)
+        */
+		void getWorldTransforms( Matrix4* xform ) const;
+        /** @copydoc Renderable::getWorldOrientation */
+        const Quaternion& getWorldOrientation(void) const;
+        /** @copydoc Renderable::getWorldPosition */
+        const Vector3& getWorldPosition(void) const;
+		
+        /** Builds the wireframe line list.
+        */
+		void setupBoundingBoxVertices(const AxisAlignedBox& aab);
+
+        Real mRadius;
+
+	public:
+			
+		WireBoundingBox();
+		~WireBoundingBox();
+
+        /** Builds the wireframe line list.
+            @param
+                aabb bounding box to build a wireframe from.
+        */
+		void setupBoundingBox(const AxisAlignedBox& aabb);
+
+		Real getSquaredViewDepth(const Camera* cam) const;
+
+        Real getBoundingRadius(void) const { return mRadius; }
+
+	};
+
+}// namespace
+
+#endif
+
+
Index: /OgreMain/include/OgreZip.h
===================================================================
--- /OgreMain/include/OgreZip.h	(revision 5)
+++ /OgreMain/include/OgreZip.h	(revision 5)
@@ -0,0 +1,136 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Zip_H__
+#define __Zip_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreArchive.h"
+#include "OgreArchiveFactory.h"
+
+// Forward declaration for zziplib to avoid header file dependency.
+typedef struct zzip_dir		ZZIP_DIR;
+typedef struct zzip_file	ZZIP_FILE;
+
+namespace Ogre {
+
+    /** Specialisation of the Archive class to allow reading of files from a zip
+        format source archive.
+    @remarks
+        This archive format supports all archives compressed in the standard
+        zip format, including iD pk3 files.
+    */
+    class _OgreExport ZipArchive : public Archive 
+    {
+    protected:
+        /// Handle to root zip file
+        ZZIP_DIR* mZzipDir;
+        /// Handle any errors from zzip
+        void checkZzipError(int zzipError, const String& operation) const;
+        /// File list (since zziplib seems to only allow scanning of dir tree once)
+        FileInfoList mFileList;
+    public:
+        ZipArchive(const String& name, const String& archType );
+        ~ZipArchive();
+        /// @copydoc Archive::isCaseSensitive
+        bool isCaseSensitive(void) const { return false; }
+
+        /// @copydoc Archive::load
+        void load();
+        /// @copydoc Archive::unload
+        void unload();
+
+        /// @copydoc Archive::open
+        DataStreamPtr open(const String& filename) const;
+
+        /// @copydoc Archive::list
+        StringVectorPtr list(bool recursive = true, bool dirs = false);
+
+        /// @copydoc Archive::listFileInfo
+        FileInfoListPtr listFileInfo(bool recursive = true, bool dirs = false);
+
+        /// @copydoc Archive::find
+        StringVectorPtr find(const String& pattern, bool recursive = true,
+            bool dirs = false);
+
+        /// @copydoc Archive::findFileInfo
+        FileInfoListPtr findFileInfo(const String& pattern, bool recursive = true,
+            bool dirs = false);
+
+        /// @copydoc Archive::exists
+        bool exists(const String& filename);
+    };
+
+    /** Specialisation of ArchiveFactory for Zip files. */
+    class _OgrePrivate ZipArchiveFactory : public ArchiveFactory
+    {
+    public:
+        virtual ~ZipArchiveFactory() {}
+        /// @copydoc FactoryObj::getType
+        const String& getType(void) const;
+        /// @copydoc FactoryObj::createInstance
+        Archive *createInstance( const String& name ) 
+        {
+            return new ZipArchive(name, "Zip");
+        }
+        /// @copydoc FactoryObj::destroyInstance
+        void destroyInstance( Archive* arch) { delete arch; }
+    };
+
+    /** Specialisation of DataStream to handle streaming data from zip archives. */
+    class _OgrePrivate ZipDataStream : public DataStream
+    {
+    protected:
+        ZZIP_FILE* mZzipFile;
+    public:
+        /// Unnamed constructor
+        ZipDataStream(ZZIP_FILE* zzipFile, size_t uncompressedSize);
+        /// Constructor for creating named streams
+        ZipDataStream(const String& name, ZZIP_FILE* zzipFile, size_t uncompressedSize);
+		~ZipDataStream();
+        /// @copydoc DataStream::read
+        size_t read(void* buf, size_t count);
+        /// @copydoc DataStream::skip
+        void skip(long count);
+        /// @copydoc DataStream::seek
+        void seek( size_t pos );
+        /// @copydoc DataStream::seek
+        size_t tell(void) const;
+        /// @copydoc DataStream::eof
+        bool eof(void) const;
+        /// @copydoc DataStream::close
+        void close(void);
+
+
+    };
+
+
+}
+
+#endif
Index: /OgreMain/include/WIN32/Makefile.am
===================================================================
--- /OgreMain/include/WIN32/Makefile.am	(revision 5)
+++ /OgreMain/include/WIN32/Makefile.am	(revision 5)
@@ -0,0 +1,4 @@
+pkgincludedir=$(prefix)/include/OGRE/WIN32
+pkginclude_HEADERS = OgreConfigDialogImp.h \
+                     OgreErrorDialogImp.h \
+                     OgreTimerImp.h
Index: /OgreMain/include/WIN32/OgreConfigDialogImp.h
===================================================================
--- /OgreMain/include/WIN32/OgreConfigDialogImp.h	(revision 5)
+++ /OgreMain/include/WIN32/OgreConfigDialogImp.h	(revision 5)
@@ -0,0 +1,92 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Win32ConfigDialog_H__
+#define __Win32ConfigDialog_H__
+
+#include "OgrePrerequisites.h"
+
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+
+//Get around Windows hackery
+#ifdef max
+#  undef max
+#endif
+#ifdef min
+#  undef min
+#endif
+
+namespace Ogre
+{
+	/** Defines the behaviour of an automatic renderer configuration dialog.
+	@remarks
+		OGRE comes with it's own renderer configuration dialog, which
+		applications can use to easily allow the user to configure the
+		settings appropriate to their machine. This class defines the
+		interface to this standard dialog. Because dialogs are inherently
+		tied to a particular platform's windowing system, there will be a
+		different subclass for each platform.
+	@author
+		Steven J. Streeting
+	*/
+    class _OgreExport ConfigDialog
+    {
+    public:
+        ConfigDialog();
+		~ConfigDialog();
+        
+		/** Displays the dialog.
+		@remarks
+			This method displays the dialog and from then on the dialog
+			interacts with the user independently. The dialog will be
+			calling the relevant OGRE rendering systems to query them for
+			options and to set the options the user selects. The method
+			returns when the user closes the dialog.
+		@returns
+			If the user accepted the dialog, <b>true</b> is returned.
+		@par
+			If the user cancelled the dialog (indicating the application
+			should probably terminate), <b>false</b> is returned.
+		@see
+			RenderSystem
+		*/
+        bool display();
+
+    protected:
+        /** Callback to process window events */
+#if OGRE_ARCHITECTURE_64 == OGRE_ARCH_TYPE
+        static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam);
+#else
+        static BOOL CALLBACK DlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam);
+#endif
+		RenderSystem* mSelectedRenderSystem;
+        HINSTANCE mHInstance; // HInstance of application, for dialog
+    };
+}
+#endif
Index: /OgreMain/include/WIN32/OgreErrorDialogImp.h
===================================================================
--- /OgreMain/include/WIN32/OgreErrorDialogImp.h	(revision 5)
+++ /OgreMain/include/WIN32/OgreErrorDialogImp.h	(revision 5)
@@ -0,0 +1,75 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __WIN32ERRORDIALOG_H__
+#define __WIN32ERRORDIALOG_H__
+
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+
+//Get around Windows hackery
+#ifdef max
+#  undef max
+#endif
+#ifdef min
+#  undef min
+#endif
+
+namespace Ogre
+{
+    /** Class for displaying the error dialog if Ogre fails badly. */
+    class _OgreExport ErrorDialog
+    {
+    public:
+        ErrorDialog();
+		~ErrorDialog() {}
+
+		/**
+		@remarks
+			Displays the error dialog.
+		@param
+			errorMessage The error message which has caused the failure.
+		@param
+			logName Optional name of the log to display in the detail pane.
+		*/
+        void display(const String& errorMessage, String logName = "");
+
+    protected:
+        String mErrorMsg;
+        /** Callback to process window events */
+#if OGRE_ARCHITECTURE_64 == OGRE_ARCH_TYPE
+        static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam);
+#else
+        static BOOL CALLBACK DlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam);
+#endif
+
+        HINSTANCE mHInstance; // HInstance of application, for dialog
+
+    };
+}
+#endif
Index: /OgreMain/include/WIN32/OgreTimerImp.h
===================================================================
--- /OgreMain/include/WIN32/OgreTimerImp.h	(revision 5)
+++ /OgreMain/include/WIN32/OgreTimerImp.h	(revision 5)
@@ -0,0 +1,85 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Win32Timer_H__
+#define __Win32Timer_H__
+
+#ifndef WIN32_LEAN_AND_MEAN
+#  define WIN32_LEAN_AND_MEAN
+#endif
+#include "windows.h"
+
+//Get around Windows hackery
+#ifdef max
+#  undef max
+#endif
+#ifdef min
+#  undef min
+#endif
+
+#define FREQUENCY_RESAMPLE_RATE 200
+
+namespace Ogre
+{
+    class _OgreExport Timer
+    {
+    private:
+		clock_t zeroClock;
+
+        DWORD mStartTick;
+		LONGLONG mLastTime;
+        LARGE_INTEGER mStartTime;
+        LARGE_INTEGER mFrequency;
+
+        DWORD mProcMask;
+        DWORD mSysMask;
+
+        HANDLE mThread;
+
+        DWORD mQueryCount;
+    public:
+		Timer();
+		~Timer();
+
+		/** Resets timer */
+		void reset();
+
+		/** Returns milliseconds since initialisation or last reset */
+		unsigned long getMilliseconds();
+
+		/** Returns microseconds since initialisation or last reset */
+		unsigned long getMicroseconds();
+
+		/** Returns milliseconds since initialisation or last reset, only CPU time measured */	
+		unsigned long getMillisecondsCPU();
+
+		/** Returns microseconds since initialisation or last reset, only CPU time measured */	
+		unsigned long getMicrosecondsCPU();
+    };
+} 
+#endif
Index: /OgreMain/include/asm_math.h
===================================================================
--- /OgreMain/include/asm_math.h	(revision 5)
+++ /OgreMain/include/asm_math.h	(revision 5)
@@ -0,0 +1,367 @@
+#ifndef __asm_math_H__
+#define __asm_math_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre
+{
+
+/*=============================================================================
+ ASM math routines posted by davepermen et al on flipcode forums
+=============================================================================*/
+const float pi = 4.0 * atan( 1.0 );
+const float half_pi = 0.5 * pi;
+
+/*=============================================================================
+	NO EXPLICIT RETURN REQUIRED FROM THESE METHODS!! 
+=============================================================================*/
+#if  OGRE_COMPILER == OGRE_COMPILER_MSVC && OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_32
+#	pragma warning( push )
+#	pragma warning( disable: 4035 ) 
+#endif
+
+float asm_arccos( float r ) {
+    // return half_pi + arctan( r / -sqr( 1.f - r * r ) );
+	
+#if  OGRE_COMPILER == OGRE_COMPILER_MSVC &&  OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_32
+
+    float asm_one = 1.f;
+    float asm_half_pi = half_pi;
+    __asm {
+        fld r // r0 = r
+        fld r // r1 = r0, r0 = r
+        fmul r // r0 = r0 * r
+        fsubr asm_one // r0 = r0 - 1.f
+        fsqrt // r0 = sqrtf( r0 )
+        fchs // r0 = - r0
+        fdiv // r0 = r1 / r0
+        fld1 // {{ r0 = atan( r0 )
+        fpatan // }}
+        fadd asm_half_pi // r0 = r0 + pi / 2
+    } // returns r0
+
+#else
+
+	return float( acos( r ) );
+
+#endif
+}
+
+float asm_arcsin( float r ) {
+    // return arctan( r / sqr( 1.f - r * r ) );
+
+#if  OGRE_COMPILER == OGRE_COMPILER_MSVC &&  OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_32
+
+    const float asm_one = 1.f;
+    __asm {
+        fld r // r0 = r
+        fld r // r1 = r0, r0 = r
+        fmul r // r0 = r0 * r
+        fsubr asm_one // r0 = r0 - 1.f
+        fsqrt // r0 = sqrtf( r0 )
+        fdiv // r0 = r1 / r0
+        fld1 // {{ r0 = atan( r0 )
+        fpatan // }}
+    } // returns r0
+
+#else
+
+	return float( asin( r ) );
+
+#endif
+
+}
+
+float asm_arctan( float r ) {
+
+#if  OGRE_COMPILER == OGRE_COMPILER_MSVC &&  OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_32
+
+    __asm {
+        fld r // r0 = r
+        fld1 // {{ r0 = atan( r0 )
+        fpatan // }}
+    } // returns r0
+
+#else
+
+	return float( atan( r ) );
+
+#endif
+
+}
+
+float asm_sin( float r ) {
+
+#if  OGRE_COMPILER == OGRE_COMPILER_MSVC &&  OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_32
+
+    __asm {
+        fld r // r0 = r
+        fsin // r0 = sinf( r0 )
+    } // returns r0
+
+#else
+
+	return sin( r );
+
+#endif
+
+}
+
+float asm_cos( float r ) {
+
+#if  OGRE_COMPILER == OGRE_COMPILER_MSVC &&  OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_32
+
+    __asm {
+        fld r // r0 = r
+        fcos // r0 = cosf( r0 )
+    } // returns r0
+
+#else
+	
+	return cos( r );
+
+#endif
+}
+
+float asm_tan( float r ) {
+
+#if  OGRE_COMPILER == OGRE_COMPILER_MSVC &&  OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_32
+
+    // return sin( r ) / cos( r );
+    __asm {
+        fld r // r0 = r
+        fsin // r0 = sinf( r0 )
+        fld r // r1 = r0, r0 = r
+        fcos // r0 = cosf( r0 )
+        fdiv // r0 = r1 / r0
+    } // returns r0
+
+#else
+	
+	return tan( r );
+
+#endif
+}
+
+// returns a for a * a = r
+float asm_sqrt( float r )
+{
+#if  OGRE_COMPILER == OGRE_COMPILER_MSVC &&  OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_32
+
+    __asm {
+        fld r // r0 = r
+        fsqrt // r0 = sqrtf( r0 )
+    } // returns r0
+
+#else
+
+	return sqrt( r );
+
+#endif
+}
+
+// returns 1 / a for a * a = r
+// -- Use this for Vector normalisation!!!
+float asm_rsq( float r )
+{
+#if  OGRE_COMPILER == OGRE_COMPILER_MSVC &&  OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_32
+
+    __asm {
+        fld1 // r0 = 1.f
+        fld r // r1 = r0, r0 = r
+        fsqrt // r0 = sqrtf( r0 )
+        fdiv // r0 = r1 / r0
+    } // returns r0
+
+#else
+
+	return 1. / sqrt( r );
+
+#endif
+}
+
+// returns 1 / a for a * a = r
+// Another version
+float apx_rsq( float r ) {
+
+#if  OGRE_COMPILER == OGRE_COMPILER_MSVC &&  OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_32
+
+    const float asm_dot5 = 0.5f;
+    const float asm_1dot5 = 1.5f;
+
+    __asm {
+        fld r // r0 = r
+        fmul asm_dot5 // r0 = r0 * .5f
+        mov eax, r // eax = r
+        shr eax, 0x1 // eax = eax >> 1
+        neg eax // eax = -eax
+        add eax, 0x5F400000 // eax = eax & MAGICAL NUMBER
+        mov r, eax // r = eax
+        fmul r // r0 = r0 * r
+        fmul r // r0 = r0 * r
+        fsubr asm_1dot5 // r0 = 1.5f - r0
+        fmul r // r0 = r0 * r
+    } // returns r0
+
+#else
+
+	return 1. / sqrt( r );
+
+#endif
+}
+
+/* very MS-specific, commented out for now
+   Finally the best InvSqrt implementation?
+   Use for vector normalisation instead of 1/length() * x,y,z
+*/
+#if  OGRE_COMPILER == OGRE_COMPILER_MSVC &&  OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_32
+
+__declspec(naked) float __fastcall InvSqrt(float fValue)
+{
+    __asm
+    {
+        mov        eax, 0be6eb508h
+        mov        dword ptr[esp-12],03fc00000h
+        sub        eax, dword ptr[esp + 4]
+        sub        dword ptr[esp+4], 800000h
+        shr        eax, 1
+        mov        dword ptr[esp -  8], eax
+
+        fld        dword ptr[esp -  8]
+        fmul    st, st
+        fld        dword ptr[esp -  8]
+        fxch    st(1)
+        fmul    dword ptr[esp +  4]
+        fld        dword ptr[esp - 12]
+        fld        st(0)
+        fsub    st,st(2)
+
+        fld        st(1)
+        fxch    st(1)
+        fmul    st(3),st
+        fmul    st(3),st
+        fmulp    st(4),st
+        fsub    st,st(2)
+
+        fmul    st(2),st
+        fmul    st(3),st
+        fmulp    st(2),st
+        fxch    st(1)
+        fsubp    st(1),st
+
+        fmulp    st(1), st
+        ret 4
+    }
+}
+
+#endif
+
+// returns a random number
+FORCEINLINE float asm_rand()
+{
+
+#if  OGRE_COMPILER == OGRE_COMPILER_MSVC &&  OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_32
+  #if 0
+    #if OGRE_COMP_VER >= 1300
+
+	static unsigned __int64 q = time( NULL );
+
+	_asm {
+		movq mm0, q
+
+		// do the magic MMX thing
+		pshufw mm1, mm0, 0x1E
+		paddd mm0, mm1
+
+		// move to integer memory location and free MMX
+		movq q, mm0
+		emms
+	}
+
+	return float( q );
+    #endif
+  #else
+    // VC6 does not support pshufw
+    return float( rand() );
+  #endif
+#else
+    // GCC etc
+
+	return float( rand() );
+
+#endif
+}
+
+// returns the maximum random number
+FORCEINLINE float asm_rand_max()
+{
+
+#if  OGRE_COMPILER == OGRE_COMPILER_MSVC &&  OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_32
+  #if 0
+    #if OGRE_COMP_VER >= 1300
+
+	return (std::numeric_limits< unsigned __int64 >::max)();
+	return 9223372036854775807.0f;
+    #endif
+  #else
+    // VC6 does not support unsigned __int64
+    return float( RAND_MAX );
+  #endif
+
+#else
+    // GCC etc
+	return float( RAND_MAX );
+
+#endif
+}
+
+// returns log2( r ) / log2( e )
+float asm_ln( float r ) {    
+
+#if  OGRE_COMPILER == OGRE_COMPILER_MSVC &&  OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_32
+
+    const float asm_e = 2.71828182846f;
+    const float asm_1_div_log2_e = .693147180559f;
+    const float asm_neg1_div_3 = -.33333333333333333333333333333f;
+    const float asm_neg2_div_3 = -.66666666666666666666666666667f;
+    const float asm_2 = 2.f;
+
+    int log_2 = 0;
+
+    __asm {
+        // log_2 = ( ( r >> 0x17 ) & 0xFF ) - 0x80;
+        mov eax, r
+        sar eax, 0x17
+        and eax, 0xFF
+        sub eax, 0x80
+        mov log_2, eax
+
+        // r = ( r & 0x807fffff ) + 0x3f800000;
+        mov ebx, r
+        and ebx, 0x807FFFFF
+        add ebx, 0x3F800000
+        mov r, ebx
+
+        // r = ( asm_neg1_div_3 * r + asm_2 ) * r + asm_neg2_div_3;   // (1)
+        fld r
+        fmul asm_neg1_div_3
+        fadd asm_2
+        fmul r
+        fadd asm_neg2_div_3
+        fild log_2
+        fadd
+        fmul asm_1_div_log2_e
+    }
+
+#else
+
+	return log( r );
+
+#endif
+}
+
+#if  OGRE_COMPILER == OGRE_COMPILER_MSVC &&  OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_32
+#	pragma warning( pop )
+#endif
+} // namespace
+#endif
Index: /OgreMain/include/config.h.in
===================================================================
--- /OgreMain/include/config.h.in	(revision 5)
+++ /OgreMain/include/config.h.in	(revision 5)
@@ -0,0 +1,122 @@
+/* OgreMain/include/config.h.in.  Generated from configure.in by autoheader.  */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `Cg' library (-lCg). */
+#undef HAVE_LIBCG
+
+/* Define to 1 if you have the `dl' library (-ldl). */
+#undef HAVE_LIBDL
+
+/* Define to 1 if you have the `freeimage' library (-lfreeimage). */
+#undef HAVE_LIBFREEIMAGE
+
+/* Define to 1 if you have the `IL' library (-lIL). */
+#undef HAVE_LIBIL
+
+/* Define to 1 if you have the `ILU' library (-lILU). */
+#undef HAVE_LIBILU
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define to 1 if you have the `pthread' library (-lpthread). */
+#undef HAVE_LIBPTHREAD
+
+/* Define to 1 if you have the `z' library (-lz). */
+#undef HAVE_LIBZ
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* snprintf */
+#undef HAVE_SNPRINTF
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* vsnprintf */
+#undef HAVE_VSNPRINTF
+
+/* Define to 1 if you have the <X11/extensions/xf86vmode.h> header file. */
+#undef HAVE_X11_EXTENSIONS_XF86VMODE_H
+
+/* Define to 1 if you have the <X11/extensions/Xrandr.h> header file. */
+#undef HAVE_X11_EXTENSIONS_XRANDR_H
+
+/* Define to 1 if you have the <X11/Intrinsic.h> header file. */
+#undef HAVE_X11_INTRINSIC_H
+
+/* Define to 1 if you have the <X11/Xaw/Command.h> header file. */
+#undef HAVE_X11_XAW_COMMAND_H
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* Big endian machine */
+#undef OGRE_CONFIG_BIG_ENDIAN
+
+/* Little endian machine */
+#undef OGRE_CONFIG_LITTLE_ENDIAN
+
+/* Build with single precision */
+#undef OGRE_DOUBLE_PRECISION
+
+/* Build devil */
+#undef OGRE_NO_DEVIL
+
+/* Load images using the freeimage library */
+#undef OGRE_NO_FREEIMAGE
+
+/* Build with thread support */
+#undef OGRE_THREAD_SUPPORT
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
+   `char[]'. */
+#undef YYTEXT_POINTER
Index: /OgreMain/include/gtk/Makefile.am
===================================================================
--- /OgreMain/include/gtk/Makefile.am	(revision 5)
+++ /OgreMain/include/gtk/Makefile.am	(revision 5)
@@ -0,0 +1,3 @@
+pkgincludedir=$(prefix)/include/OGRE/gtk
+pkginclude_HEADERS = OgreConfigDialogImp.h \
+                     OgreErrorDialogImp.h
Index: /OgreMain/include/gtk/Makefile.in
===================================================================
--- /OgreMain/include/gtk/Makefile.in	(revision 5)
+++ /OgreMain/include/gtk/Makefile.in	(revision 5)
@@ -0,0 +1,467 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = OgreMain/include/gtk
+DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkgincludedir)"
+pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(pkginclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+pkgincludedir = $(prefix)/include/OGRE/gtk
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+pkginclude_HEADERS = OgreConfigDialogImp.h \
+                     OgreErrorDialogImp.h
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  OgreMain/include/gtk/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  OgreMain/include/gtk/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+install-pkgincludeHEADERS: $(pkginclude_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkgincludedir)" || $(mkdir_p) "$(DESTDIR)$(pkgincludedir)"
+	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
+	  $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
+	done
+
+uninstall-pkgincludeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(pkgincludedir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-pkgincludeHEADERS
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkgincludeHEADERS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-pkgincludeHEADERS \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-pkgincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /OgreMain/include/gtk/OgreConfigDialogImp.h
===================================================================
--- /OgreMain/include/gtk/OgreConfigDialogImp.h	(revision 5)
+++ /OgreMain/include/gtk/OgreConfigDialogImp.h	(revision 5)
@@ -0,0 +1,94 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __GLXCONFIGDIALOG_H__
+#define __GLXCONFIGDIALOG_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+
+#include <gtk/gtk.h>
+
+namespace Ogre
+{
+    /**
+    Defines the behaviour of an automatic renderer configuration dialog.
+    @remarks
+        OGRE comes with it's own renderer configuration dialog, which
+        applications can use to easily allow the user to configure the
+        settings appropriate to their machine. This class defines the
+        interface to this standard dialog. Because dialogs are inherently
+        tied to a particular platform's windowing system, there will be a
+        different subclass for each platform.
+    @author
+        Andrew Zabolotny <zap@homelink.ru>
+    */
+    class _OgreExport ConfigDialog
+    {
+    public:
+        ConfigDialog();
+
+        /**
+        Displays the dialog.
+        @remarks
+            This method displays the dialog and from then on the dialog
+            interacts with the user independently. The dialog will be
+            calling the relevant OGRE rendering systems to query them for
+            options and to set the options the user selects. The method
+            returns when the user closes the dialog.
+        @returns
+            If the user accepted the dialog, <b>true</b> is returned.
+        @par
+            If the user cancelled the dialog (indicating the application
+            should probably terminate), <b>false</b> is returned.
+        @see
+            RenderSystem
+        */
+        bool display ();
+
+    protected:
+        /// The rendersystem selected by user
+        RenderSystem *mSelectedRenderSystem;
+        /// The dialog window
+        GtkWidget *mDialog;
+        /// The table with renderer parameters
+        GtkWidget *mParamTable;
+
+        /// Create the gtk+ dialog window
+        bool createWindow ();
+        /// Get parameters from selected renderer and fill the dialog
+        void setupRendererParams ();
+        /// Callback function for renderer select combobox
+        static void rendererChanged (GtkComboBox *widget, gpointer data);
+        /// Callback function to change a renderer option
+        static void optionChanged (GtkComboBox *widget, gpointer data);
+    };
+}
+#endif
Index: /OgreMain/include/gtk/OgreErrorDialogImp.h
===================================================================
--- /OgreMain/include/gtk/OgreErrorDialogImp.h	(revision 5)
+++ /OgreMain/include/gtk/OgreErrorDialogImp.h	(revision 5)
@@ -0,0 +1,53 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+ 
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+ 
+This program 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 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 Lesser General Public License for more details.
+ 
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OGRE_GLX_ERROR_DIALOG_H__
+#define __OGRE_GLX_ERROR_DIALOG_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre
+{
+	/** Class for displaying the error dialog if Ogre fails badly. */
+	class _OgreExport ErrorDialog
+	{
+	public:
+		ErrorDialog();
+
+		/**
+		@remarks
+			Displays the error dialog.
+		@param
+			errorMessage The error message which has caused the failure.
+		@param
+			logName Optional name of the log to display in the detail pane.
+		*/
+        void display(const String& errorMessage, String logName = "");
+	};
+}
+#endif
Index: /OgreMain/include/stl_user_config.h
===================================================================
--- /OgreMain/include/stl_user_config.h	(revision 5)
+++ /OgreMain/include/stl_user_config.h	(revision 5)
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 1999 
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted 
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+/*
+ * Purpose of this file :
+ *
+ * To hold user-definable portion of STLport settings which may be overridden
+ * on per-project basis.
+ * Please note that if you use STLport iostreams (compiled library) then you have
+ * to use consistent settings when you compile STLport library and your project. 
+ * Those settings are defined in _site_config.h and have to be the same for a given
+ * STLport installation.
+ *
+ */
+
+
+//==========================================================
+// User-settable macros that control compilation:
+//              Features selection
+//==========================================================
+
+/* _STLP_NO_OWN_IOSTREAMS: 
+ * __STL_NO_SGI_IOSTREAMS (in older versions)
+ *  This is major configuration switch.
+ *  Turn it on to disable use of SGI iostreams and use wrappers 
+ *  around your compiler's iostreams, like before.
+ *  Keep it off if you want to use  SGI iostreams 
+ *  (Note that in this case you have to compile library in ../src
+ *  and supply resulting library at link time).
+ *
+ */
+
+// # define   _STLP_NO_OWN_IOSTREAMS	1
+
+
+/* 
+ * This macro only works in non-SGI iostreams mode.
+ *
+ * Uncomment to suppress using new-style streams even if they are
+ * available.
+ * Beware - _STLP_USE_OWN_NAMESPACE depends on this macro, too.
+ * Do that only if you are absolutely sure backwards-compatible 
+ * <iostream.h> is not actually a wrapper with <iostream>
+ * Hint : In VC++ 6.x, they are not.
+ */
+
+// #define   _STLP_NO_NEW_IOSTREAMS	1
+
+/*
+ * Use this switch for embedded systems where no iostreams are available
+ * at all. STLport own iostreams will also get disabled automatically then.
+ */
+// # define _STLP_NO_IOSTREAMS 1
+
+/* 
+ * Set _STLP_DEBUG to turn the "Debug Mode" on.
+ * That gets you checked iterators/ranges in the manner
+ * of "Safe STL". Very useful for debugging. Thread-safe.
+ * Please do not forget to link proper STLport library flavor
+ * (e.g libstlport_gcc_stldebug.a) when you set this flag in STLport iostreams mode.
+ */
+#ifdef _DEBUG
+	#define _STLP_DEBUG 1
+#endif
+
+
+/* 
+ *
+ *  _STLP_NO_CUSTOM_IO : define this if you do not instantiate basic_xxx iostream classes  with custom types (which is most likely the case).
+ *  Custom means types other than char, wchar and char_traits<>,
+ *  like basic_ostream<my_char_type, my_traits<my_char_type> >
+ *  When this option is on, most non-inline template functions definitions for iostreams are not seen by the client.
+ *  Default is off, just not to break compilation for those who do use those types.
+ *  which saves a lot of compile time for most compilers, also object and executable size for some.
+ *  That also guarantees that you still use optimized standard i/o when you compile your program without optimization. 
+ *  Option does not affect STLport library build; you may use the same binary library with and without this option, 
+ *  on per-project basis.
+ *
+ */
+//#define _STLP_NO_CUSTOM_IO
+
+
+/* 
+ * _STLP_NO_RELOPS_NAMESPACE: if defined, don't put the relational
+ * operator templates (>, <=. >=, !=) in namespace std::rel_ops, even
+ * if the compiler supports namespaces.
+ * Note : if the compiler do not support namespaces, those operators are not be provided by default,
+ * to simulate hiding them into rel_ops. This was proved to resolve many compiler bugs with ambiguity.
+ */
+
+// #define _STLP_NO_RELOPS_NAMESPACE 1
+
+
+/*
+ * If _STLP_USE_OWN_NAMESPACE is in effect, STLport by default will not try
+ * to rename std:: for the user
+ * to _STL::. If you do want this feature, please define the following switch :
+ */
+// # define _STLP_REDEFINE_STD 1
+
+
+/*
+ * _STLP_WHOLE_NATIVE_STD : only meaningful in _STLP_USE_OWN_NAMESPACE mode.
+ * Normally, STLport only imports necessary components from native std:: namespace -
+ * those not yet provided by STLport (<iostream>, <complex>, etc.) 
+ * and their dependencies (<string>, <stdexcept>). 
+ * You might want everything from std:: being available in std:: namespace when you
+ * include corresponding STLport header (like STLport <map> provides std::map as well, etc.),
+ * if you are going to use both stlport:: and std:: components in your code.
+ * Otherwise this option is not recommended as it increases the size of your object files
+ * and slows down compilation.
+ */
+// # define _STLP_WHOLE_NATIVE_STD
+
+
+/*
+ * Use this option to catch uninitialized members in your classes.
+ * When it is set, construct() and destroy() fill the class storage
+ * with _STLP_SHRED_BYTE (see below). 
+ * Note : _STLP_DEBUG and _STLP_DEBUG_ALLOC don't set this option automatically.
+ */
+
+// # define _STLP_DEBUG_UNINITIALIZED 1
+
+/*
+ * Uncomment and provide a definition for the byte with which raw memory
+ * will be filled if _STLP_DEBUG_ALLOC or _STLP_DEBUG_UNINITIALIZED is defined. 
+ * Choose a value which is likely to cause a noticeable problem if dereferenced 
+ * or otherwise abused. A good value may already be defined for your platform; see
+ * stl_config.h
+ */
+// #define _STLP_SHRED_BYTE 0xA3
+
+/*
+ *  This option is for gcc users only and only affects systems where native linker
+ *  does not let gcc to implement automatic instantiation of static template data members/
+ *  It is being put in this file as there is no way to check if we are using GNU ld automatically,
+ *  so it becomes user's responsibility.
+ * 
+ */
+
+// #define _STLP_GCC_USES_GNU_LD
+
+
+//==========================================================
+// Compatibility section
+//==========================================================
+
+/*
+ *  Define this macro to disable anachronistic constructs (like the ones used in HP STL and
+ *  not included in final standard, etc. 
+ */
+// define _STLP_NO_ANACHRONISMS 1
+
+/*
+ *  Define this macro to disable STLport extensions (for example, to make sure your code will 
+ *  compile with some other implementation )
+ */
+// define _STLP_NO_EXTENSIONS   1
+
+
+/* 
+ * You should define this macro if compiling with MFC - STLport <stl/_config.h>
+ * then include <afx.h> instead of <windows.h> to get synchronisation primitives 
+ *
+ */
+
+// # define _STLP_USE_MFC 1
+
+
+// boris : this setting is here as we cannot detect precense of new Platform SDK automatically 
+// If you are using new PSDK with VC++ 6.0 or lower, please define this to get correct prototypes for InterlockedXXX functions
+//# define _STLP_NEW_PLATFORM_SDK 1
+
+/*
+ * Use minimum set of default arguments on template classes that have more
+ * than one - for example map<>, set<>.
+ * This has effect only if _STLP_LIMITED_DEFAULT_TEMPLATES is on.
+ * If _STLP_MINIMUM_DEFAULT_TEMPLATE_PARAMS is set, you'll be able to compile
+ * set<T> with those compilers, but you'll have to use __set__<T, less<T>>
+ *
+ * Affects : map<>, multimap<>, set<>, multiset<>, hash_*<>, 
+ * queue<>, priority_queue<>, stack<>, istream_iterator<>
+ */
+
+// # define _STLP_MINIMUM_DEFAULT_TEMPLATE_PARAMS 1
+
+//==========================================================
+
+// Local Variables:
+// mode:C++
+// End:
Index: /OgreMain/obj/Debug/.keepme
===================================================================
--- /OgreMain/obj/Debug/.keepme	(revision 5)
+++ /OgreMain/obj/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /OgreMain/obj/Release/.keepme
===================================================================
--- /OgreMain/obj/Release/.keepme	(revision 5)
+++ /OgreMain/obj/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /OgreMain/scripts/OgreMain.cbp
===================================================================
--- /OgreMain/scripts/OgreMain.cbp	(revision 5)
+++ /OgreMain/scripts/OgreMain.cbp	(revision 5)
@@ -0,0 +1,500 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="OgreMain" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\lib\OgreMain_d.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\obj\Debug" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectIncludeDirsRelation="2" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Option projectLibDirsRelation="2" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="kernel32" />
+					<Add library="user32" />
+					<Add library="zziplib_d" />
+					<Add library="freetype230_d" />
+					<Add library="freeimage_d" />
+					<Add library="LibPNG_d" />
+					<Add library="LibMNG_d" />
+					<Add library="LibJPEG_d" />
+					<Add library="LibTIFF_d" />
+					<Add library="zlib_d" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\Samples\Common\bin\$(TARGET_NAME)" />
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\Tools\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\lib\OgreMain.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\obj\Release" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="kernel32" />
+					<Add library="user32" />
+					<Add library="zziplib" />
+					<Add library="freeimage" />
+					<Add library="freetype230" />
+					<Add library="LibPNG" />
+					<Add library="LibMNG" />
+					<Add library="LibJPEG" />
+					<Add library="LibTIFF" />
+					<Add library="zlib" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\Samples\Common\bin\$(TARGET_NAME)" />
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\Tools\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-Winvalid-pch" />
+			<Add option="-DOGRE_NONCLIENT_BUILD" />
+			<Add option="-DWIN32" />
+			<Add option="-D_USRDLL" />
+			<Add option="-D_MT" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Dependencies\include" />
+			<Add directory="..\src" />
+			<Add directory="..\src\WIN32" />
+		</Compiler>
+		<ResourceCompiler>
+			<Add directory="..\include\WIN32" />
+			<Add directory="..\src\WIN32" />
+		</ResourceCompiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Samples\Common\bin\$(TARGET_NAME)" />
+			<Add directory="..\..\Dependencies\lib\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\Ogre.h" />
+		<Unit filename="..\include\OgreAlignedAllocator.h" />
+		<Unit filename="..\include\OgreAnimable.h" />
+		<Unit filename="..\include\OgreAnimation.h" />
+		<Unit filename="..\include\OgreAnimationState.h" />
+		<Unit filename="..\include\OgreAnimationTrack.h" />
+		<Unit filename="..\include\OgreAny.h" />
+		<Unit filename="..\include\OgreArchive.h" />
+		<Unit filename="..\include\OgreArchiveFactory.h" />
+		<Unit filename="..\include\OgreArchiveManager.h" />
+		<Unit filename="..\include\OgreAutoParamDataSource.h" />
+		<Unit filename="..\include\OgreAxisAlignedBox.h" />
+		<Unit filename="..\include\OgreBillboard.h" />
+		<Unit filename="..\include\OgreBillboardChain.h" />
+		<Unit filename="..\include\OgreBillboardParticleRenderer.h" />
+		<Unit filename="..\include\OgreBillboardSet.h" />
+		<Unit filename="..\include\OgreBitwise.h" />
+		<Unit filename="..\include\OgreBlendMode.h" />
+		<Unit filename="..\include\OgreBone.h" />
+		<Unit filename="..\include\OgreBorderPanelOverlayElement.h" />
+		<Unit filename="..\include\OgreCamera.h" />
+		<Unit filename="..\include\OgreCodec.h" />
+		<Unit filename="..\include\OgreColourValue.h" />
+		<Unit filename="..\include\OgreCommon.h" />
+		<Unit filename="..\include\OgreCompiler2Pass.h" />
+		<Unit filename="..\include\OgreCompositionPass.h" />
+		<Unit filename="..\include\OgreCompositionTargetPass.h" />
+		<Unit filename="..\include\OgreCompositionTechnique.h" />
+		<Unit filename="..\include\OgreCompositor.h" />
+		<Unit filename="..\include\OgreCompositorChain.h" />
+		<Unit filename="..\include\OgreCompositorInstance.h" />
+		<Unit filename="..\include\OgreCompositorManager.h" />
+		<Unit filename="..\include\OgreCompositorScriptCompiler.h" />
+		<Unit filename="..\include\OgreCompositorSerializer.h" />
+		<Unit filename="..\include\OgreConfig.h" />
+		<Unit filename="..\include\OgreConfigDialog.h" />
+		<Unit filename="..\include\OgreConfigFile.h" />
+		<Unit filename="..\include\OgreConfigOptionMap.h" />
+		<Unit filename="..\include\OgreController.h" />
+		<Unit filename="..\include\OgreControllerManager.h" />
+		<Unit filename="..\include\OgreConvexBody.h" />
+		<Unit filename="..\include\OgreDDSCodec.h" />
+		<Unit filename="..\include\OgreDataStream.h" />
+		<Unit filename="..\include\OgreDefaultHardwareBufferManager.h" />
+		<Unit filename="..\include\OgreDynLib.h" />
+		<Unit filename="..\include\OgreDynLibManager.h" />
+		<Unit filename="..\include\OgreEdgeListBuilder.h" />
+		<Unit filename="..\include\OgreEntity.h" />
+		<Unit filename="..\include\OgreErrorDialog.h" />
+		<Unit filename="..\include\OgreException.h" />
+		<Unit filename="..\include\OgreExternalTextureSource.h" />
+		<Unit filename="..\include\OgreExternalTextureSourceManager.h" />
+		<Unit filename="..\include\OgreFactoryObj.h" />
+		<Unit filename="..\include\OgreFileSystem.h" />
+		<Unit filename="..\include\OgreFont.h" />
+		<Unit filename="..\include\OgreFontManager.h" />
+		<Unit filename="..\include\OgreFrameListener.h" />
+		<Unit filename="..\include\OgreFreeImageCodec.h" />
+		<Unit filename="..\include\OgreFrustum.h" />
+		<Unit filename="..\include\OgreGpuProgram.h" />
+		<Unit filename="..\include\OgreGpuProgramManager.h" />
+		<Unit filename="..\include\OgreGpuProgramUsage.h" />
+		<Unit filename="..\include\OgreHardwareBuffer.h" />
+		<Unit filename="..\include\OgreHardwareBufferManager.h" />
+		<Unit filename="..\include\OgreHardwareIndexBuffer.h" />
+		<Unit filename="..\include\OgreHardwareOcclusionQuery.h" />
+		<Unit filename="..\include\OgreHardwarePixelBuffer.h" />
+		<Unit filename="..\include\OgreHardwareVertexBuffer.h" />
+		<Unit filename="..\include\OgreHighLevelGpuProgram.h" />
+		<Unit filename="..\include\OgreHighLevelGpuProgramManager.h" />
+		<Unit filename="..\include\OgreImage.h" />
+		<Unit filename="..\include\OgreImageCodec.h" />
+		<Unit filename="..\include\OgreInstancedGeometry.h" />
+		<Unit filename="..\include\OgreIteratorWrappers.h" />
+		<Unit filename="..\include\OgreKeyFrame.h" />
+		<Unit filename="..\include\OgreLight.h" />
+		<Unit filename="..\include\OgreLog.h" />
+		<Unit filename="..\include\OgreLogManager.h" />
+		<Unit filename="..\include\OgreManualObject.h" />
+		<Unit filename="..\include\OgreMaterial.h" />
+		<Unit filename="..\include\OgreMaterialManager.h" />
+		<Unit filename="..\include\OgreMaterialScriptCompiler.h" />
+		<Unit filename="..\include\OgreMaterialSerializer.h" />
+		<Unit filename="..\include\OgreMath.h" />
+		<Unit filename="..\include\OgreMatrix3.h" />
+		<Unit filename="..\include\OgreMatrix4.h" />
+		<Unit filename="..\include\OgreMemoryMacros.h" />
+		<Unit filename="..\include\OgreMemoryManager.h" />
+		<Unit filename="..\include\OgreMesh.h" />
+		<Unit filename="..\include\OgreMeshFileFormat.h" />
+		<Unit filename="..\include\OgreMeshManager.h" />
+		<Unit filename="..\include\OgreMeshSerializer.h" />
+		<Unit filename="..\include\OgreMeshSerializerImpl.h" />
+		<Unit filename="..\include\OgreMovableObject.h" />
+		<Unit filename="..\include\OgreMovablePlane.h" />
+		<Unit filename="..\include\OgreNoMemoryMacros.h" />
+		<Unit filename="..\include\OgreNode.h" />
+		<Unit filename="..\include\OgreNumerics.h" />
+		<Unit filename="..\include\OgreOptimisedUtil.h" />
+		<Unit filename="..\include\OgreOverlay.h" />
+		<Unit filename="..\include\OgreOverlayContainer.h" />
+		<Unit filename="..\include\OgreOverlayElement.h" />
+		<Unit filename="..\include\OgreOverlayElementCommands.h" />
+		<Unit filename="..\include\OgreOverlayElementFactory.h" />
+		<Unit filename="..\include\OgreOverlayManager.h" />
+		<Unit filename="..\include\OgrePanelOverlayElement.h" />
+		<Unit filename="..\include\OgreParticle.h" />
+		<Unit filename="..\include\OgreParticleAffector.h" />
+		<Unit filename="..\include\OgreParticleAffectorFactory.h" />
+		<Unit filename="..\include\OgreParticleEmitter.h" />
+		<Unit filename="..\include\OgreParticleEmitterCommands.h" />
+		<Unit filename="..\include\OgreParticleEmitterFactory.h" />
+		<Unit filename="..\include\OgreParticleIterator.h" />
+		<Unit filename="..\include\OgreParticleSystem.h" />
+		<Unit filename="..\include\OgreParticleSystemManager.h" />
+		<Unit filename="..\include\OgreParticleSystemRenderer.h" />
+		<Unit filename="..\include\OgrePass.h" />
+		<Unit filename="..\include\OgrePatchMesh.h" />
+		<Unit filename="..\include\OgrePatchSurface.h" />
+		<Unit filename="..\include\OgrePixelFormat.h" />
+		<Unit filename="..\include\OgrePlane.h" />
+		<Unit filename="..\include\OgrePlaneBoundedVolume.h" />
+		<Unit filename="..\include\OgrePlatform.h" />
+		<Unit filename="..\include\OgrePlatformInformation.h" />
+		<Unit filename="..\include\OgrePlugin.h" />
+		<Unit filename="..\include\OgrePolygon.h" />
+		<Unit filename="..\include\OgrePose.h" />
+		<Unit filename="..\include\OgrePredefinedControllers.h" />
+		<Unit filename="..\include\OgrePrefabFactory.h" />
+		<Unit filename="..\include\OgrePrerequisites.h" />
+		<Unit filename="..\include\OgreProfiler.h" />
+		<Unit filename="..\include\OgreProgressiveMesh.h" />
+		<Unit filename="..\include\OgreQuaternion.h" />
+		<Unit filename="..\include\OgreRadixSort.h" />
+		<Unit filename="..\include\OgreRay.h" />
+		<Unit filename="..\include\OgreRectangle.h" />
+		<Unit filename="..\include\OgreRectangle2D.h" />
+		<Unit filename="..\include\OgreRenderOperation.h" />
+		<Unit filename="..\include\OgreRenderQueue.h" />
+		<Unit filename="..\include\OgreRenderQueueInvocation.h" />
+		<Unit filename="..\include\OgreRenderQueueListener.h" />
+		<Unit filename="..\include\OgreRenderQueueSortingGrouping.h" />
+		<Unit filename="..\include\OgreRenderSystem.h" />
+		<Unit filename="..\include\OgreRenderSystemCapabilities.h" />
+		<Unit filename="..\include\OgreRenderTarget.h" />
+		<Unit filename="..\include\OgreRenderTargetListener.h" />
+		<Unit filename="..\include\OgreRenderTexture.h" />
+		<Unit filename="..\include\OgreRenderWindow.h" />
+		<Unit filename="..\include\OgreRenderable.h" />
+		<Unit filename="..\include\OgreResource.h" />
+		<Unit filename="..\include\OgreResourceBackgroundQueue.h" />
+		<Unit filename="..\include\OgreResourceGroupManager.h" />
+		<Unit filename="..\include\OgreResourceManager.h" />
+		<Unit filename="..\include\OgreRibbonTrail.h" />
+		<Unit filename="..\include\OgreRoot.h" />
+		<Unit filename="..\include\OgreRotationalSpline.h" />
+		<Unit filename="..\include\OgreSceneManager.h" />
+		<Unit filename="..\include\OgreSceneManagerEnumerator.h" />
+		<Unit filename="..\include\OgreSceneNode.h" />
+		<Unit filename="..\include\OgreSceneQuery.h" />
+		<Unit filename="..\include\OgreScriptLoader.h" />
+		<Unit filename="..\include\OgreSearchOps.h" />
+		<Unit filename="..\include\OgreSerializer.h" />
+		<Unit filename="..\include\OgreShadowCameraSetup.h" />
+		<Unit filename="..\include\OgreShadowCameraSetupFocused.h" />
+		<Unit filename="..\include\OgreShadowCameraSetupLiSPSM.h" />
+		<Unit filename="..\include\OgreShadowCameraSetupPlaneOptimal.h" />
+		<Unit filename="..\include\OgreShadowCaster.h" />
+		<Unit filename="..\include\OgreShadowTextureManager.h" />
+		<Unit filename="..\include\OgreShadowVolumeExtrudeProgram.h" />
+		<Unit filename="..\include\OgreSharedPtr.h" />
+		<Unit filename="..\include\OgreSimpleRenderable.h" />
+		<Unit filename="..\include\OgreSimpleSpline.h" />
+		<Unit filename="..\include\OgreSingleton.h" />
+		<Unit filename="..\include\OgreSkeleton.h" />
+		<Unit filename="..\include\OgreSkeletonFileFormat.h" />
+		<Unit filename="..\include\OgreSkeletonInstance.h" />
+		<Unit filename="..\include\OgreSkeletonManager.h" />
+		<Unit filename="..\include\OgreSkeletonSerializer.h" />
+		<Unit filename="..\include\OgreSphere.h" />
+		<Unit filename="..\include\OgreSpotShadowFadePng.h" />
+		<Unit filename="..\include\OgreStableHeaders.h">
+			<Option compile="1" />
+			<Option weight="0" />
+		</Unit>
+		<Unit filename="..\include\OgreStaticFaceGroup.h" />
+		<Unit filename="..\include\OgreStaticGeometry.h" />
+		<Unit filename="..\include\OgreStdHeaders.h" />
+		<Unit filename="..\include\OgreString.h" />
+		<Unit filename="..\include\OgreStringConverter.h" />
+		<Unit filename="..\include\OgreStringInterface.h" />
+		<Unit filename="..\include\OgreStringVector.h" />
+		<Unit filename="..\include\OgreSubEntity.h" />
+		<Unit filename="..\include\OgreSubMesh.h" />
+		<Unit filename="..\include\OgreTagPoint.h" />
+		<Unit filename="..\include\OgreTechnique.h" />
+		<Unit filename="..\include\OgreTextAreaOverlayElement.h" />
+		<Unit filename="..\include\OgreTexture.h" />
+		<Unit filename="..\include\OgreTextureManager.h" />
+		<Unit filename="..\include\OgreTextureUnitState.h" />
+		<Unit filename="..\include\OgreTimer.h" />
+		<Unit filename="..\include\OgreUTFString.h" />
+		<Unit filename="..\include\OgreUnifiedHighLevelGpuProgram.h" />
+		<Unit filename="..\include\OgreUserDefinedObject.h" />
+		<Unit filename="..\include\OgreVector2.h" />
+		<Unit filename="..\include\OgreVector3.h" />
+		<Unit filename="..\include\OgreVector4.h" />
+		<Unit filename="..\include\OgreVertexBoneAssignment.h" />
+		<Unit filename="..\include\OgreVertexIndexData.h" />
+		<Unit filename="..\include\OgreViewport.h" />
+		<Unit filename="..\include\OgreWindowEventUtilities.h" />
+		<Unit filename="..\include\OgreWireBoundingBox.h" />
+		<Unit filename="..\include\OgreZip.h" />
+		<Unit filename="..\include\WIN32\OgreConfigDialogImp.h" />
+		<Unit filename="..\include\WIN32\OgreErrorDialogImp.h" />
+		<Unit filename="..\include\WIN32\OgreTimerImp.h" />
+		<Unit filename="..\include\asm_math.h" />
+		<Unit filename="..\include\stl_user_config.h" />
+		<Unit filename="..\src\OgreAlignedAllocator.cpp" />
+		<Unit filename="..\src\OgreAnimable.cpp" />
+		<Unit filename="..\src\OgreAnimation.cpp" />
+		<Unit filename="..\src\OgreAnimationState.cpp" />
+		<Unit filename="..\src\OgreAnimationTrack.cpp" />
+		<Unit filename="..\src\OgreArchiveManager.cpp" />
+		<Unit filename="..\src\OgreAutoParamDataSource.cpp" />
+		<Unit filename="..\src\OgreBillboard.cpp" />
+		<Unit filename="..\src\OgreBillboardChain.cpp" />
+		<Unit filename="..\src\OgreBillboardParticleRenderer.cpp" />
+		<Unit filename="..\src\OgreBillboardSet.cpp" />
+		<Unit filename="..\src\OgreBone.cpp" />
+		<Unit filename="..\src\OgreBorderPanelOverlayElement.cpp" />
+		<Unit filename="..\src\OgreCamera.cpp" />
+		<Unit filename="..\src\OgreCodec.cpp" />
+		<Unit filename="..\src\OgreColourValue.cpp" />
+		<Unit filename="..\src\OgreCommon.cpp" />
+		<Unit filename="..\src\OgreCompiler2Pass.cpp" />
+		<Unit filename="..\src\OgreCompositionPass.cpp" />
+		<Unit filename="..\src\OgreCompositionTargetPass.cpp" />
+		<Unit filename="..\src\OgreCompositionTechnique.cpp" />
+		<Unit filename="..\src\OgreCompositor.cpp" />
+		<Unit filename="..\src\OgreCompositorChain.cpp" />
+		<Unit filename="..\src\OgreCompositorInstance.cpp" />
+		<Unit filename="..\src\OgreCompositorManager.cpp" />
+		<Unit filename="..\src\OgreCompositorScriptCompiler.cpp" />
+		<Unit filename="..\src\OgreCompositorSerializer.cpp" />
+		<Unit filename="..\src\OgreConfigFile.cpp" />
+		<Unit filename="..\src\OgreControllerManager.cpp" />
+		<Unit filename="..\src\OgreConvexBody.cpp" />
+		<Unit filename="..\src\OgreDDSCodec.cpp" />
+		<Unit filename="..\src\OgreDataStream.cpp" />
+		<Unit filename="..\src\OgreDefaultHardwareBufferManager.cpp" />
+		<Unit filename="..\src\OgreDefaultSceneQueries.cpp" />
+		<Unit filename="..\src\OgreDynLib.cpp" />
+		<Unit filename="..\src\OgreDynLibManager.cpp" />
+		<Unit filename="..\src\OgreEdgeListBuilder.cpp" />
+		<Unit filename="..\src\OgreEntity.cpp" />
+		<Unit filename="..\src\OgreException.cpp" />
+		<Unit filename="..\src\OgreExternalTextureSource.cpp" />
+		<Unit filename="..\src\OgreExternalTextureSourceManager.cpp" />
+		<Unit filename="..\src\OgreFileSystem.cpp" />
+		<Unit filename="..\src\OgreFont.cpp" />
+		<Unit filename="..\src\OgreFontManager.cpp" />
+		<Unit filename="..\src\OgreFreeImageCodec.cpp" />
+		<Unit filename="..\src\OgreFrustum.cpp" />
+		<Unit filename="..\src\OgreGpuProgram.cpp" />
+		<Unit filename="..\src\OgreGpuProgramManager.cpp" />
+		<Unit filename="..\src\OgreGpuProgramUsage.cpp" />
+		<Unit filename="..\src\OgreHardwareBufferManager.cpp" />
+		<Unit filename="..\src\OgreHardwareIndexBuffer.cpp" />
+		<Unit filename="..\src\OgreHardwareOcclusionQuery.cpp" />
+		<Unit filename="..\src\OgreHardwarePixelBuffer.cpp" />
+		<Unit filename="..\src\OgreHardwareVertexBuffer.cpp" />
+		<Unit filename="..\src\OgreHighLevelGpuProgram.cpp" />
+		<Unit filename="..\src\OgreHighLevelGpuProgramManager.cpp" />
+		<Unit filename="..\src\OgreImage.cpp" />
+		<Unit filename="..\src\OgreImageResampler.h" />
+		<Unit filename="..\src\OgreInstancedGeometry.cpp" />
+		<Unit filename="..\src\OgreKeyFrame.cpp" />
+		<Unit filename="..\src\OgreLight.cpp" />
+		<Unit filename="..\src\OgreLog.cpp" />
+		<Unit filename="..\src\OgreLogManager.cpp" />
+		<Unit filename="..\src\OgreManualObject.cpp" />
+		<Unit filename="..\src\OgreMaterial.cpp" />
+		<Unit filename="..\src\OgreMaterialManager.cpp" />
+		<Unit filename="..\src\OgreMaterialScriptCompiler.cpp" />
+		<Unit filename="..\src\OgreMaterialSerializer.cpp" />
+		<Unit filename="..\src\OgreMath.cpp" />
+		<Unit filename="..\src\OgreMatrix3.cpp" />
+		<Unit filename="..\src\OgreMatrix4.cpp" />
+		<Unit filename="..\src\OgreMemoryManager.cpp" />
+		<Unit filename="..\src\OgreMesh.cpp" />
+		<Unit filename="..\src\OgreMeshManager.cpp" />
+		<Unit filename="..\src\OgreMeshSerializer.cpp" />
+		<Unit filename="..\src\OgreMeshSerializerImpl.cpp" />
+		<Unit filename="..\src\OgreMovableObject.cpp" />
+		<Unit filename="..\src\OgreMovablePlane.cpp" />
+		<Unit filename="..\src\OgreNode.cpp" />
+		<Unit filename="..\src\OgreNumerics.cpp" />
+		<Unit filename="..\src\OgreOptimisedUtil.cpp" />
+		<Unit filename="..\src\OgreOptimisedUtilGeneral.cpp" />
+		<Unit filename="..\src\OgreOptimisedUtilSSE.cpp">
+			<Option compiler="gcc" use="1" buildCommand="$compiler $options -msse $includes -c $file -o $object" />
+		</Unit>
+		<Unit filename="..\src\OgreOverlay.cpp" />
+		<Unit filename="..\src\OgreOverlayContainer.cpp" />
+		<Unit filename="..\src\OgreOverlayElement.cpp" />
+		<Unit filename="..\src\OgreOverlayElementCommands.cpp" />
+		<Unit filename="..\src\OgreOverlayManager.cpp" />
+		<Unit filename="..\src\OgrePanelOverlayElement.cpp" />
+		<Unit filename="..\src\OgreParticle.cpp" />
+		<Unit filename="..\src\OgreParticleEmitter.cpp" />
+		<Unit filename="..\src\OgreParticleEmitterCommands.cpp" />
+		<Unit filename="..\src\OgreParticleIterator.cpp" />
+		<Unit filename="..\src\OgreParticleSystem.cpp" />
+		<Unit filename="..\src\OgreParticleSystemManager.cpp" />
+		<Unit filename="..\src\OgrePass.cpp" />
+		<Unit filename="..\src\OgrePatchMesh.cpp" />
+		<Unit filename="..\src\OgrePatchSurface.cpp" />
+		<Unit filename="..\src\OgrePixelConversions.h" />
+		<Unit filename="..\src\OgrePixelFormat.cpp" />
+		<Unit filename="..\src\OgrePlane.cpp" />
+		<Unit filename="..\src\OgrePlatformInformation.cpp" />
+		<Unit filename="..\src\OgrePolygon.cpp" />
+		<Unit filename="..\src\OgrePose.cpp" />
+		<Unit filename="..\src\OgrePrecompiledHeaders.cpp">
+			<Option compile="0" />
+			<Option link="0" />
+		</Unit>
+		<Unit filename="..\src\OgrePredefinedControllers.cpp" />
+		<Unit filename="..\src\OgrePrefabFactory.cpp" />
+		<Unit filename="..\src\OgreProfiler.cpp" />
+		<Unit filename="..\src\OgreProgressiveMesh.cpp" />
+		<Unit filename="..\src\OgreQuaternion.cpp" />
+		<Unit filename="..\src\OgreRectangle2D.cpp" />
+		<Unit filename="..\src\OgreRenderQueue.cpp" />
+		<Unit filename="..\src\OgreRenderQueueInvocation.cpp" />
+		<Unit filename="..\src\OgreRenderQueueSortingGrouping.cpp" />
+		<Unit filename="..\src\OgreRenderSystem.cpp" />
+		<Unit filename="..\src\OgreRenderSystemCapabilities.cpp" />
+		<Unit filename="..\src\OgreRenderTarget.cpp" />
+		<Unit filename="..\src\OgreRenderTexture.cpp" />
+		<Unit filename="..\src\OgreRenderWindow.cpp" />
+		<Unit filename="..\src\OgreResource.cpp" />
+		<Unit filename="..\src\OgreResourceBackgroundQueue.cpp" />
+		<Unit filename="..\src\OgreResourceGroupManager.cpp" />
+		<Unit filename="..\src\OgreResourceManager.cpp" />
+		<Unit filename="..\src\OgreRibbonTrail.cpp" />
+		<Unit filename="..\src\OgreRoot.cpp" />
+		<Unit filename="..\src\OgreRotationSpline.cpp" />
+		<Unit filename="..\src\OgreSIMDHelper.h" />
+		<Unit filename="..\src\OgreSceneManager.cpp" />
+		<Unit filename="..\src\OgreSceneManagerEnumerator.cpp" />
+		<Unit filename="..\src\OgreSceneNode.cpp" />
+		<Unit filename="..\src\OgreSceneQuery.cpp" />
+		<Unit filename="..\src\OgreSearchOps.cpp" />
+		<Unit filename="..\src\OgreSerializer.cpp" />
+		<Unit filename="..\src\OgreShadowCameraSetup.cpp" />
+		<Unit filename="..\src\OgreShadowCameraSetupFocused.cpp" />
+		<Unit filename="..\src\OgreShadowCameraSetupLiSPSM.cpp" />
+		<Unit filename="..\src\OgreShadowCameraSetupPlaneOptimal.cpp" />
+		<Unit filename="..\src\OgreShadowCaster.cpp" />
+		<Unit filename="..\src\OgreShadowTextureManager.cpp" />
+		<Unit filename="..\src\OgreShadowVolumeExtrudeProgram.cpp" />
+		<Unit filename="..\src\OgreSimpleRenderable.cpp" />
+		<Unit filename="..\src\OgreSimpleSpline.cpp" />
+		<Unit filename="..\src\OgreSkeleton.cpp" />
+		<Unit filename="..\src\OgreSkeletonInstance.cpp" />
+		<Unit filename="..\src\OgreSkeletonManager.cpp" />
+		<Unit filename="..\src\OgreSkeletonSerializer.cpp" />
+		<Unit filename="..\src\OgreStaticGeometry.cpp" />
+		<Unit filename="..\src\OgreString.cpp" />
+		<Unit filename="..\src\OgreStringConverter.cpp" />
+		<Unit filename="..\src\OgreStringInterface.cpp" />
+		<Unit filename="..\src\OgreSubEntity.cpp" />
+		<Unit filename="..\src\OgreSubMesh.cpp" />
+		<Unit filename="..\src\OgreTagPoint.cpp" />
+		<Unit filename="..\src\OgreTechnique.cpp" />
+		<Unit filename="..\src\OgreTextAreaOverlayElement.cpp" />
+		<Unit filename="..\src\OgreTexture.cpp" />
+		<Unit filename="..\src\OgreTextureManager.cpp" />
+		<Unit filename="..\src\OgreTextureUnitState.cpp" />
+		<Unit filename="..\src\OgreUnifiedHighLevelGpuProgram.cpp" />
+		<Unit filename="..\src\OgreUserDefinedObject.cpp" />
+		<Unit filename="..\src\OgreVector2.cpp" />
+		<Unit filename="..\src\OgreVector3.cpp" />
+		<Unit filename="..\src\OgreVector4.cpp" />
+		<Unit filename="..\src\OgreVertexIndexData.cpp" />
+		<Unit filename="..\src\OgreViewport.cpp" />
+		<Unit filename="..\src\OgreWindowEventUtilities.cpp" />
+		<Unit filename="..\src\OgreWireBoundingBox.cpp" />
+		<Unit filename="..\src\OgreZip.cpp" />
+		<Unit filename="..\src\WIN32\OgreConfigDialog.cpp" />
+		<Unit filename="..\src\WIN32\OgreErrorDialog.cpp" />
+		<Unit filename="..\src\WIN32\OgreTimer.cpp" />
+		<Unit filename="..\src\WIN32\OgreWin32Resources.rc">
+			<Option compilerVar="WINDRES" />
+		</Unit>
+		<Unit filename="..\src\WIN32\ogre.ico" />
+		<Unit filename="..\src\WIN32\ogrelogo.bmp" />
+		<Unit filename="..\src\WIN32\resource.h" />
+		<Unit filename="..\src\WIN32\winres.h" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /OgreMain/scripts/OgreMain.vcproj
===================================================================
--- /OgreMain/scripts/OgreMain.vcproj	(revision 5)
+++ /OgreMain/scripts/OgreMain.vcproj	(revision 5)
@@ -0,0 +1,1508 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="OgreMain"
+	ProjectGUID="{35AFBABB-DF05-43DE-91A7-BB828A874015}"
+	RootNamespace="OgreMain"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="FALSE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="..\include;..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_USRDLL;_MT;OGRE_NONCLIENT_BUILD"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				SmallerTypeCheck="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="TRUE"
+				EnableFunctionLevelLinking="TRUE"
+				DisableLanguageExtensions="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="3"
+				PrecompiledHeaderThrough="OgreStableHeaders.h"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib user32.lib zziplibd.lib zlibd.lib freetype230_D.lib FreeImaged.lib"
+				OutputFile="$(OutDir)/$(ProjectName)_d.dll"
+				Version="0.99"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="..\..\Dependencies\lib\$(ConfigurationName)"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames="LIBCD;LIBCMTD"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName)_d.pdb"
+				SubSystem="1"
+				OptimizeForWindows98="1"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Samples\Common\bin\$(ConfigurationName)
+copy $(OutDir)\$(TargetFileName) ..\..\Tools\Common\bin\$(ConfigurationName)
+"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			WholeProgramOptimization="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="FALSE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="..\include;..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_USRDLL;_MT;OGRE_NONCLIENT_BUILD"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				DisableLanguageExtensions="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="3"
+				PrecompiledHeaderThrough="OgreStableHeaders.h"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib user32.lib zziplib.lib zlib.lib freetype230.lib FreeImage.lib"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="..\..\Dependencies\lib\$(ConfigurationName)"
+				IgnoreAllDefaultLibraries="FALSE"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Samples\Common\bin\$(ConfigurationName)
+copy $(OutDir)\$(TargetFileName) ..\..\Tools\Common\bin\$(ConfigurationName)
+"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="FALSE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="..\include;..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_USRDLL;_MT;OGRE_NONCLIENT_BUILD;OGRE_STATIC_LIB"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				SmallerTypeCheck="TRUE"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="TRUE"
+				EnableFunctionLevelLinking="TRUE"
+				DisableLanguageExtensions="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="3"
+				PrecompiledHeaderThrough="OgreStableHeaders.h"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)/$(ProjectName)Static_d.lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(IntDir)\OgreWin32Resources.res ..\..\lib\OgreWin32Resources_d.res"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			WholeProgramOptimization="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="FALSE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="..\include;..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_USRDLL;_MT;OGRE_NONCLIENT_BUILD;OGRE_STATIC_LIB"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				DisableLanguageExtensions="FALSE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="3"
+				PrecompiledHeaderThrough="OgreStableHeaders.h"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)/$(ProjectName)Static.lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(IntDir)\OgreWin32Resources.res ..\..\lib\OgreWin32Resources.res"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\OgreAlignedAllocator.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreAnimable.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreAnimation.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreAnimationState.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreAnimationTrack.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreArchiveManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreAutoParamDataSource.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreBillboard.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreBillboardChain.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreBillboardParticleRenderer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreBillboardSet.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreBone.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreBorderPanelOverlayElement.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCamera.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCodec.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreColourValue.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCommon.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCompiler2Pass.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositionPass.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositionTargetPass.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositionTechnique.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositor.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositorChain.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositorInstance.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositorManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositorScriptCompiler.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositorSerializer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\Win32\OgreConfigDialog.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreConfigFile.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreControllerManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreConvexBody.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreDataStream.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreDDSCodec.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreDefaultHardwareBufferManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreDefaultSceneQueries.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreDynLib.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreDynLibManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreEdgeListBuilder.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreEntity.cpp">
+			</File>
+			<File
+				RelativePath="..\src\Win32\OgreErrorDialog.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreException.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreExternalTextureSource.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreExternalTextureSourceManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreFileSystem.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreFont.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreFontManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreFreeImageCodec.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions="FREEIMAGE_LIB"
+						UsePrecompiledHeader="0"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions="FREEIMAGE_LIB"
+						UsePrecompiledHeader="0"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="DebugStaticLib|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions="FREEIMAGE_LIB"
+						UsePrecompiledHeader="0"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="ReleaseStaticLib|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions="FREEIMAGE_LIB"
+						UsePrecompiledHeader="0"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\OgreFrustum.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGpuProgram.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGpuProgramManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGpuProgramUsage.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreHardwareBufferManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreHardwareIndexBuffer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreHardwareOcclusionQuery.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreHardwarePixelBuffer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreHardwareVertexBuffer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreHighLevelGpuProgram.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreHighLevelGpuProgramManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreImage.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreImageResampler.h">
+			</File>
+			<File
+				RelativePath="..\src\OgreInstancedGeometry.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreKeyFrame.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreLight.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreLog.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreLogManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreManualObject.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreMaterial.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreMaterialManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreMaterialScriptCompiler.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreMaterialSerializer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreMath.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreMatrix3.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreMatrix4.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreMemoryManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreMesh.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreMeshManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreMeshSerializer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreMeshSerializerImpl.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreMovableObject.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreMovablePlane.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreNode.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreNumerics.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreOptimisedUtil.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreOptimisedUtilGeneral.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreOptimisedUtilSSE.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreOverlay.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreOverlayContainer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreOverlayElement.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreOverlayElementCommands.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreOverlayManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgrePanelOverlayElement.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreParticle.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreParticleEmitter.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreParticleEmitterCommands.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreParticleIterator.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreParticleSystem.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreParticleSystemManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgrePass.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgrePatchMesh.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgrePatchSurface.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgrePixelConversions.h">
+			</File>
+			<File
+				RelativePath="..\src\OgrePixelFormat.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgrePlane.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgrePlatformInformation.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgrePolygon.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgrePose.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgrePrecompiledHeaders.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="DebugStaticLib|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="ReleaseStaticLib|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\OgrePredefinedControllers.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgrePrefabFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreProfiler.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreProgressiveMesh.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreQuaternion.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRectangle2D.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRenderQueue.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRenderQueueInvocation.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRenderQueueSortingGrouping.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRenderSystem.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRenderSystemCapabilities.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRenderTarget.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRenderTexture.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRenderWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreResource.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreResourceBackgroundQueue.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreResourceGroupManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreResourceManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRibbonTrail.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRoot.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRotationSpline.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreSceneManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreSceneManagerEnumerator.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreSceneNode.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreSceneQuery.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreSerializer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreShadowCameraSetup.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreShadowCameraSetupFocused.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreShadowCameraSetupLiSPSM.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreShadowCameraSetupPlaneOptimal.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreShadowCaster.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreShadowTextureManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreShadowVolumeExtrudeProgram.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreSIMDHelper.h">
+			</File>
+			<File
+				RelativePath="..\src\OgreSimpleRenderable.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreSimpleSpline.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreSkeleton.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreSkeletonInstance.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreSkeletonManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreSkeletonSerializer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreStaticGeometry.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreString.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreStringConverter.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreStringInterface.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreSubEntity.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreSubMesh.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreTagPoint.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreTechnique.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreTextAreaOverlayElement.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreTexture.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreTextureManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreTextureUnitState.cpp">
+			</File>
+			<File
+				RelativePath="..\src\Win32\OgreTimer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreUnifiedHighLevelGpuProgram.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreUserDefinedObject.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreVector2.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreVector3.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreVector4.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreVertexIndexData.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreViewport.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreWindowEventUtilities.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreWireBoundingBox.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreZip.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\asm_math.h">
+			</File>
+			<File
+				RelativePath="..\include\Ogre.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreAlignedAllocator.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreAnimable.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreAnimation.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreAnimationState.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreAnimationTrack.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreAny.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreArchive.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreArchiveFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreArchiveManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreAutoParamDataSource.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreAxisAlignedBox.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreBillboard.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreBillboardChain.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreBillboardParticleRenderer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreBillboardSet.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreBitwise.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreBlendMode.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreBone.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreBorderPanelOverlayElement.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCamera.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCodec.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCodecFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreColourValue.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCommon.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCompiler2Pass.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositionPass.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositionTargetPass.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositionTechnique.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositor.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositorChain.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositorInstance.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositorManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositorScriptCompiler.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositorSerializer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreConfig.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreConfigDialog.h">
+			</File>
+			<File
+				RelativePath="..\include\Win32\OgreConfigDialogImp.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreConfigFile.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreConfigOptionMap.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreController.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreControllerManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreConvexBody.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreDataStream.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreDDSCodec.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreDefaultHardwareBufferManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreDllInteface.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreDynLib.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreDynLibManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreEdgeListBuilder.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreEntity.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreErrorDialog.h">
+			</File>
+			<File
+				RelativePath="..\include\Win32\OgreErrorDialogImp.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreException.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreExternalTextureSource.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreExternalTextureSourceManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreFactoryObj.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreFileSystem.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreFont.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreFontManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreFrameListener.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreFreeImageCodec.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreFrustum.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGpuProgram.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGpuProgramManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGpuProgramUsage.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreHardwareBuffer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreHardwareBufferManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreHardwareIndexBuffer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreHardwareOcclusionQuery.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreHardwarePixelBuffer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreHardwareVertexBuffer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreHighLevelGpuProgram.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreHighLevelGpuProgramManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreImage.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreImageCodec.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreInstancedGeometry.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreIteratorWrappers.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreKeyFrame.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreLight.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreLog.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreLogManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreManualObject.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreMaterial.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreMaterialManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreMaterialScriptCompiler.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreMaterialSerializer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreMath.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreMatrix3.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreMatrix4.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreMemoryMacros.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreMemoryManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreMesh.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreMeshFileFormat.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreMeshManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreMeshSerializer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreMeshSerializerImpl.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreMovableObject.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreMovablePlane.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreNode.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreNoMemoryMacros.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreNumerics.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreOptimisedUtil.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreOverlay.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreOverlayContainer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreOverlayElement.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreOverlayElementCommands.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreOverlayElementFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreOverlayManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgrePanelOverlayElement.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreParticle.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleAffector.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleAffectorFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleEmitter.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleEmitterCommands.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleEmitterFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleIterator.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleSystem.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleSystemManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleSystemRenderer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgrePass.h">
+			</File>
+			<File
+				RelativePath="..\include\OgrePatchMesh.h">
+			</File>
+			<File
+				RelativePath="..\include\OgrePatchSurface.h">
+			</File>
+			<File
+				RelativePath="..\include\OgrePixelFormat.h">
+			</File>
+			<File
+				RelativePath="..\include\OgrePlane.h">
+			</File>
+			<File
+				RelativePath="..\include\OgrePlaneBoundedVolume.h">
+			</File>
+			<File
+				RelativePath="..\include\OgrePlatform.h">
+			</File>
+			<File
+				RelativePath="..\include\OgrePlatformInformation.h">
+			</File>
+			<File
+				RelativePath="..\include\OgrePlugin.h">
+			</File>
+			<File
+				RelativePath="..\include\OgrePolygon.h">
+			</File>
+			<File
+				RelativePath="..\include\OgrePose.h">
+			</File>
+			<File
+				RelativePath="..\include\OgrePredefinedControllers.h">
+			</File>
+			<File
+				RelativePath="..\include\OgrePrefabFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgrePrerequisites.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreProfiler.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreProgressiveMesh.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreQuaternion.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRadixSort.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRay.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRectangle.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRectangle2D.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderable.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderOperation.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderQueue.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderQueueInvocation.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderQueueListener.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderQueueSortingGrouping.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderSystem.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderSystemCapabilities.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderTarget.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderTargetListener.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderTexture.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderWindow.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreResource.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreResourceBackgroundQueue.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreResourceGroupManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreResourceManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRibbonTrail.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRoot.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRotationalSpline.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSceneManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSceneManagerEnumerator.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSceneNode.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSceneQuery.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreScriptLoader.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSerializer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreShadowCameraSetup.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreShadowCameraSetupFocused.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreShadowCameraSetupLiSPSM.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreShadowCameraSetupPlaneOptimal.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreShadowCaster.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreShadowTextureManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreShadowVolumeExtrudeProgram.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSharedPtr.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSimpleRenderable.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSimpleSpline.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSingleton.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSkeleton.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSkeletonFileFormat.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSkeletonInstance.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSkeletonManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSkeletonSerializer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSphere.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSpotShadowFadePng.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreStableHeaders.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreStaticFaceGroup.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreStaticGeometry.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreStdHeaders.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreString.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreStringConverter.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreStringInterface.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreStringResource.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreStringVector.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSubEntity.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSubMesh.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreTagPoint.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreTechnique.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreTextAreaOverlayElement.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreTexture.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreTextureManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreTextureUnitState.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreTimer.h">
+			</File>
+			<File
+				RelativePath="..\include\Win32\OgreTimerImp.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreUnifiedHighLevelGpuProgram.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreUserDefinedObject.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreUTFString.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreVector2.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreVector3.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreVector4.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreVertexBoneAssignment.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreVertexIndexData.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreViewport.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreWindowEventUtilities.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreWireBoundingBox.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreZip.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+			<File
+				RelativePath="..\src\Win32\ogre.ico">
+			</File>
+			<File
+				RelativePath="..\src\Win32\ogrelogo.bmp">
+			</File>
+			<File
+				RelativePath="..\src\Win32\OgreWin32Resources.rc">
+			</File>
+			<File
+				RelativePath="..\src\Win32\resource.h">
+			</File>
+			<File
+				RelativePath="..\src\Win32\winres.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /OgreMain/scripts/OgreMain_linux.cbp
===================================================================
--- /OgreMain/scripts/OgreMain_linux.cbp	(revision 5)
+++ /OgreMain/scripts/OgreMain_linux.cbp	(revision 5)
@@ -0,0 +1,471 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="OgreMain" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../lib/libOgreMain_d.so" prefix_auto="1" extension_auto="1" />
+				<Option object_output="../obj/Debug/" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<ExtraCommands>
+					<Add after="cp $($(TARGET_NAME)_OUTPUT_FILE) ../../Samples/Common/bin/$(TARGET_NAME)" />
+					<Add after="cp $($(TARGET_NAME)_OUTPUT_FILE) ../../Tools/Common/bin/$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../lib/libOgreMain.so" prefix_auto="1" extension_auto="1" />
+				<Option object_output="../obj/Release/" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Compiler>
+					<Add option="-O2" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cp $($(TARGET_NAME)_OUTPUT_FILE) ../../Samples/Common/bin/$(TARGET_NAME)" />
+					<Add after="cp $($(TARGET_NAME)_OUTPUT_FILE) ../../Tools/Common/bin/$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-Winvalid-pch" />
+			<Add option="-fvisibility=hidden" />
+			<Add option="-fvisibility-inlines-hidden" />
+			<Add option="-fPIC" />
+			<Add option="-DOGRE_NONCLIENT_BUILD" />
+			<Add option="-DOGRE_GCC_VISIBILITY" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add option="-DPIC" />
+			<Add directory="../include" />
+			<Add directory="/usr/include/gtk-2.0" />
+			<Add directory="/usr/lib/gtk-2.0/include" />
+			<Add directory="/usr/include/atk-1.0" />
+			<Add directory="/usr/include/cairo" />
+			<Add directory="/usr/include/pango-1.0" />
+			<Add directory="/usr/include/glib-2.0" />
+			<Add directory="/usr/lib/glib-2.0/include" />
+			<Add directory="/usr/include/freetype2" />
+		</Compiler>
+		<Linker>
+			<Add library="freetype" />
+			<Add library="freeimage" />
+			<Add library="zzip" />
+		</Linker>
+		<Unit filename="../include/GLX/OgreConfigDialogImp.h" />
+		<Unit filename="../include/GLX/OgreErrorDialogImp.h" />
+		<Unit filename="../include/GLX/OgreTimerImp.h" />
+		<Unit filename="../include/Ogre.h" />
+		<Unit filename="../include/OgreAlignedAllocator.h" />
+		<Unit filename="../include/OgreAnimable.h" />
+		<Unit filename="../include/OgreAnimation.h" />
+		<Unit filename="../include/OgreAnimationState.h" />
+		<Unit filename="../include/OgreAnimationTrack.h" />
+		<Unit filename="../include/OgreAny.h" />
+		<Unit filename="../include/OgreArchive.h" />
+		<Unit filename="../include/OgreArchiveFactory.h" />
+		<Unit filename="../include/OgreArchiveManager.h" />
+		<Unit filename="../include/OgreAutoParamDataSource.h" />
+		<Unit filename="../include/OgreAxisAlignedBox.h" />
+		<Unit filename="../include/OgreBillboard.h" />
+		<Unit filename="../include/OgreBillboardChain.h" />
+		<Unit filename="../include/OgreBillboardParticleRenderer.h" />
+		<Unit filename="../include/OgreBillboardSet.h" />
+		<Unit filename="../include/OgreBitwise.h" />
+		<Unit filename="../include/OgreBlendMode.h" />
+		<Unit filename="../include/OgreBone.h" />
+		<Unit filename="../include/OgreBorderPanelOverlayElement.h" />
+		<Unit filename="../include/OgreCamera.h" />
+		<Unit filename="../include/OgreCodec.h" />
+		<Unit filename="../include/OgreColourValue.h" />
+		<Unit filename="../include/OgreCommon.h" />
+		<Unit filename="../include/OgreCompiler2Pass.h" />
+		<Unit filename="../include/OgreCompositionPass.h" />
+		<Unit filename="../include/OgreCompositionTargetPass.h" />
+		<Unit filename="../include/OgreCompositionTechnique.h" />
+		<Unit filename="../include/OgreCompositor.h" />
+		<Unit filename="../include/OgreCompositorChain.h" />
+		<Unit filename="../include/OgreCompositorInstance.h" />
+		<Unit filename="../include/OgreCompositorManager.h" />
+		<Unit filename="../include/OgreCompositorScriptCompiler.h" />
+		<Unit filename="../include/OgreCompositorSerializer.h" />
+		<Unit filename="../include/OgreConfig.h" />
+		<Unit filename="../include/OgreConfigDialog.h" />
+		<Unit filename="../include/OgreConfigFile.h" />
+		<Unit filename="../include/OgreConfigOptionMap.h" />
+		<Unit filename="../include/OgreController.h" />
+		<Unit filename="../include/OgreControllerManager.h" />
+		<Unit filename="../include/OgreConvexBody.h" />
+		<Unit filename="../include/OgreDDSCodec.h" />
+		<Unit filename="../include/OgreDataStream.h" />
+		<Unit filename="../include/OgreDefaultHardwareBufferManager.h" />
+		<Unit filename="../include/OgreDynLib.h" />
+		<Unit filename="../include/OgreDynLibManager.h" />
+		<Unit filename="../include/OgreEdgeListBuilder.h" />
+		<Unit filename="../include/OgreEntity.h" />
+		<Unit filename="../include/OgreErrorDialog.h" />
+		<Unit filename="../include/OgreException.h" />
+		<Unit filename="../include/OgreExternalTextureSource.h" />
+		<Unit filename="../include/OgreExternalTextureSourceManager.h" />
+		<Unit filename="../include/OgreFactoryObj.h" />
+		<Unit filename="../include/OgreFileSystem.h" />
+		<Unit filename="../include/OgreFont.h" />
+		<Unit filename="../include/OgreFontManager.h" />
+		<Unit filename="../include/OgreFrameListener.h" />
+		<Unit filename="../include/OgreFreeImageCodec.h" />
+		<Unit filename="../include/OgreFrustum.h" />
+		<Unit filename="../include/OgreGpuProgram.h" />
+		<Unit filename="../include/OgreGpuProgramManager.h" />
+		<Unit filename="../include/OgreGpuProgramUsage.h" />
+		<Unit filename="../include/OgreHardwareBuffer.h" />
+		<Unit filename="../include/OgreHardwareBufferManager.h" />
+		<Unit filename="../include/OgreHardwareIndexBuffer.h" />
+		<Unit filename="../include/OgreHardwareOcclusionQuery.h" />
+		<Unit filename="../include/OgreHardwarePixelBuffer.h" />
+		<Unit filename="../include/OgreHardwareVertexBuffer.h" />
+		<Unit filename="../include/OgreHighLevelGpuProgram.h" />
+		<Unit filename="../include/OgreHighLevelGpuProgramManager.h" />
+		<Unit filename="../include/OgreImage.h" />
+		<Unit filename="../include/OgreImageCodec.h" />
+		<Unit filename="../include/OgreInstancedGeometry.h" />
+		<Unit filename="../include/OgreIteratorWrappers.h" />
+		<Unit filename="../include/OgreKeyFrame.h" />
+		<Unit filename="../include/OgreLight.h" />
+		<Unit filename="../include/OgreLog.h" />
+		<Unit filename="../include/OgreLogManager.h" />
+		<Unit filename="../include/OgreManualObject.h" />
+		<Unit filename="../include/OgreMaterial.h" />
+		<Unit filename="../include/OgreMaterialManager.h" />
+		<Unit filename="../include/OgreMaterialScriptCompiler.h" />
+		<Unit filename="../include/OgreMaterialSerializer.h" />
+		<Unit filename="../include/OgreMath.h" />
+		<Unit filename="../include/OgreMatrix3.h" />
+		<Unit filename="../include/OgreMatrix4.h" />
+		<Unit filename="../include/OgreMemoryMacros.h" />
+		<Unit filename="../include/OgreMemoryManager.h" />
+		<Unit filename="../include/OgreMesh.h" />
+		<Unit filename="../include/OgreMeshFileFormat.h" />
+		<Unit filename="../include/OgreMeshManager.h" />
+		<Unit filename="../include/OgreMeshSerializer.h" />
+		<Unit filename="../include/OgreMeshSerializerImpl.h" />
+		<Unit filename="../include/OgreMovableObject.h" />
+		<Unit filename="../include/OgreMovablePlane.h" />
+		<Unit filename="../include/OgreNoMemoryMacros.h" />
+		<Unit filename="../include/OgreNode.h" />
+		<Unit filename="../include/OgreNumerics.h" />
+		<Unit filename="../include/OgreOptimisedUtil.h" />
+		<Unit filename="../include/OgreOverlay.h" />
+		<Unit filename="../include/OgreOverlayContainer.h" />
+		<Unit filename="../include/OgreOverlayElement.h" />
+		<Unit filename="../include/OgreOverlayElementCommands.h" />
+		<Unit filename="../include/OgreOverlayElementFactory.h" />
+		<Unit filename="../include/OgreOverlayManager.h" />
+		<Unit filename="../include/OgrePanelOverlayElement.h" />
+		<Unit filename="../include/OgreParticle.h" />
+		<Unit filename="../include/OgreParticleAffector.h" />
+		<Unit filename="../include/OgreParticleAffectorFactory.h" />
+		<Unit filename="../include/OgreParticleEmitter.h" />
+		<Unit filename="../include/OgreParticleEmitterCommands.h" />
+		<Unit filename="../include/OgreParticleEmitterFactory.h" />
+		<Unit filename="../include/OgreParticleIterator.h" />
+		<Unit filename="../include/OgreParticleSystem.h" />
+		<Unit filename="../include/OgreParticleSystemManager.h" />
+		<Unit filename="../include/OgreParticleSystemRenderer.h" />
+		<Unit filename="../include/OgrePass.h" />
+		<Unit filename="../include/OgrePatchMesh.h" />
+		<Unit filename="../include/OgrePatchSurface.h" />
+		<Unit filename="../include/OgrePixelFormat.h" />
+		<Unit filename="../include/OgrePlane.h" />
+		<Unit filename="../include/OgrePlaneBoundedVolume.h" />
+		<Unit filename="../include/OgrePlatform.h" />
+		<Unit filename="../include/OgrePlatformInformation.h" />
+		<Unit filename="../include/OgrePlugin.h" />
+		<Unit filename="../include/OgrePolygon.h" />
+		<Unit filename="../include/OgrePose.h" />
+		<Unit filename="../include/OgrePredefinedControllers.h" />
+		<Unit filename="../include/OgrePrefabFactory.h" />
+		<Unit filename="../include/OgrePrerequisites.h" />
+		<Unit filename="../include/OgreProfiler.h" />
+		<Unit filename="../include/OgreProgressiveMesh.h" />
+		<Unit filename="../include/OgreQuaternion.h" />
+		<Unit filename="../include/OgreRadixSort.h" />
+		<Unit filename="../include/OgreRay.h" />
+		<Unit filename="../include/OgreRectangle.h" />
+		<Unit filename="../include/OgreRectangle2D.h" />
+		<Unit filename="../include/OgreRenderOperation.h" />
+		<Unit filename="../include/OgreRenderQueue.h" />
+		<Unit filename="../include/OgreRenderQueueInvocation.h" />
+		<Unit filename="../include/OgreRenderQueueListener.h" />
+		<Unit filename="../include/OgreRenderQueueSortingGrouping.h" />
+		<Unit filename="../include/OgreRenderSystem.h" />
+		<Unit filename="../include/OgreRenderSystemCapabilities.h" />
+		<Unit filename="../include/OgreRenderTarget.h" />
+		<Unit filename="../include/OgreRenderTargetListener.h" />
+		<Unit filename="../include/OgreRenderTexture.h" />
+		<Unit filename="../include/OgreRenderWindow.h" />
+		<Unit filename="../include/OgreRenderable.h" />
+		<Unit filename="../include/OgreResource.h" />
+		<Unit filename="../include/OgreResourceBackgroundQueue.h" />
+		<Unit filename="../include/OgreResourceGroupManager.h" />
+		<Unit filename="../include/OgreResourceManager.h" />
+		<Unit filename="../include/OgreRibbonTrail.h" />
+		<Unit filename="../include/OgreRoot.h" />
+		<Unit filename="../include/OgreRotationalSpline.h" />
+		<Unit filename="../include/OgreSceneManager.h" />
+		<Unit filename="../include/OgreSceneManagerEnumerator.h" />
+		<Unit filename="../include/OgreSceneNode.h" />
+		<Unit filename="../include/OgreSceneQuery.h" />
+		<Unit filename="../include/OgreScriptLoader.h" />
+		<Unit filename="../include/OgreSearchOps.h" />
+		<Unit filename="../include/OgreSerializer.h" />
+		<Unit filename="../include/OgreShadowCameraSetup.h" />
+		<Unit filename="../include/OgreShadowCameraSetupFocused.h" />
+		<Unit filename="../include/OgreShadowCameraSetupLiSPSM.h" />
+		<Unit filename="../include/OgreShadowCameraSetupPlaneOptimal.h" />
+		<Unit filename="../include/OgreShadowCaster.h" />
+		<Unit filename="../include/OgreShadowTextureManager.h" />
+		<Unit filename="../include/OgreShadowVolumeExtrudeProgram.h" />
+		<Unit filename="../include/OgreSharedPtr.h" />
+		<Unit filename="../include/OgreSimpleRenderable.h" />
+		<Unit filename="../include/OgreSimpleSpline.h" />
+		<Unit filename="../include/OgreSingleton.h" />
+		<Unit filename="../include/OgreSkeleton.h" />
+		<Unit filename="../include/OgreSkeletonFileFormat.h" />
+		<Unit filename="../include/OgreSkeletonInstance.h" />
+		<Unit filename="../include/OgreSkeletonManager.h" />
+		<Unit filename="../include/OgreSkeletonSerializer.h" />
+		<Unit filename="../include/OgreSphere.h" />
+		<Unit filename="../include/OgreSpotShadowFadePng.h" />
+		<Unit filename="../include/OgreStableHeaders.h">
+			<Option compile="1" />
+		</Unit>
+		<Unit filename="../include/OgreStaticFaceGroup.h" />
+		<Unit filename="../include/OgreStaticGeometry.h" />
+		<Unit filename="../include/OgreStdHeaders.h" />
+		<Unit filename="../include/OgreString.h" />
+		<Unit filename="../include/OgreStringConverter.h" />
+		<Unit filename="../include/OgreStringInterface.h" />
+		<Unit filename="../include/OgreStringVector.h" />
+		<Unit filename="../include/OgreSubEntity.h" />
+		<Unit filename="../include/OgreSubMesh.h" />
+		<Unit filename="../include/OgreTagPoint.h" />
+		<Unit filename="../include/OgreTechnique.h" />
+		<Unit filename="../include/OgreTextAreaOverlayElement.h" />
+		<Unit filename="../include/OgreTexture.h" />
+		<Unit filename="../include/OgreTextureManager.h" />
+		<Unit filename="../include/OgreTextureUnitState.h" />
+		<Unit filename="../include/OgreTimer.h" />
+		<Unit filename="../include/OgreUTFString.h" />
+		<Unit filename="../include/OgreUnifiedHighLevelGpuProgram.h" />
+		<Unit filename="../include/OgreUserDefinedObject.h" />
+		<Unit filename="../include/OgreVector2.h" />
+		<Unit filename="../include/OgreVector3.h" />
+		<Unit filename="../include/OgreVector4.h" />
+		<Unit filename="../include/OgreVertexBoneAssignment.h" />
+		<Unit filename="../include/OgreVertexIndexData.h" />
+		<Unit filename="../include/OgreViewport.h" />
+		<Unit filename="../include/OgreWindowEventUtilities.h" />
+		<Unit filename="../include/OgreWireBoundingBox.h" />
+		<Unit filename="../include/OgreZip.h" />
+		<Unit filename="../include/asm_math.h" />
+		<Unit filename="../include/config.h" />
+		<Unit filename="../include/stl_user_config.h" />
+		<Unit filename="../src/GLX/GLX_backdrop.h" />
+		<Unit filename="../src/GLX/OgreConfigDialog.cpp" />
+		<Unit filename="../src/GLX/OgreErrorDialog.cpp" />
+		<Unit filename="../src/GLX/OgreTimer.cpp" />
+		<Unit filename="../src/OgreAlignedAllocator.cpp" />
+		<Unit filename="../src/OgreAnimable.cpp" />
+		<Unit filename="../src/OgreAnimation.cpp" />
+		<Unit filename="../src/OgreAnimationState.cpp" />
+		<Unit filename="../src/OgreAnimationTrack.cpp" />
+		<Unit filename="../src/OgreArchiveManager.cpp" />
+		<Unit filename="../src/OgreAutoParamDataSource.cpp" />
+		<Unit filename="../src/OgreBillboard.cpp" />
+		<Unit filename="../src/OgreBillboardChain.cpp" />
+		<Unit filename="../src/OgreBillboardParticleRenderer.cpp" />
+		<Unit filename="../src/OgreBillboardSet.cpp" />
+		<Unit filename="../src/OgreBone.cpp" />
+		<Unit filename="../src/OgreBorderPanelOverlayElement.cpp" />
+		<Unit filename="../src/OgreCamera.cpp" />
+		<Unit filename="../src/OgreCodec.cpp" />
+		<Unit filename="../src/OgreColourValue.cpp" />
+		<Unit filename="../src/OgreCommon.cpp" />
+		<Unit filename="../src/OgreCompiler2Pass.cpp" />
+		<Unit filename="../src/OgreCompositionPass.cpp" />
+		<Unit filename="../src/OgreCompositionTargetPass.cpp" />
+		<Unit filename="../src/OgreCompositionTechnique.cpp" />
+		<Unit filename="../src/OgreCompositor.cpp" />
+		<Unit filename="../src/OgreCompositorChain.cpp" />
+		<Unit filename="../src/OgreCompositorInstance.cpp" />
+		<Unit filename="../src/OgreCompositorManager.cpp" />
+		<Unit filename="../src/OgreCompositorScriptCompiler.cpp" />
+		<Unit filename="../src/OgreCompositorSerializer.cpp" />
+		<Unit filename="../src/OgreConfigFile.cpp" />
+		<Unit filename="../src/OgreControllerManager.cpp" />
+		<Unit filename="../src/OgreConvexBody.cpp" />
+		<Unit filename="../src/OgreDDSCodec.cpp" />
+		<Unit filename="../src/OgreDataStream.cpp" />
+		<Unit filename="../src/OgreDefaultHardwareBufferManager.cpp" />
+		<Unit filename="../src/OgreDefaultSceneQueries.cpp" />
+		<Unit filename="../src/OgreDynLib.cpp" />
+		<Unit filename="../src/OgreDynLibManager.cpp" />
+		<Unit filename="../src/OgreEdgeListBuilder.cpp" />
+		<Unit filename="../src/OgreEntity.cpp" />
+		<Unit filename="../src/OgreException.cpp" />
+		<Unit filename="../src/OgreExternalTextureSource.cpp" />
+		<Unit filename="../src/OgreExternalTextureSourceManager.cpp" />
+		<Unit filename="../src/OgreFileSystem.cpp" />
+		<Unit filename="../src/OgreFont.cpp" />
+		<Unit filename="../src/OgreFontManager.cpp" />
+		<Unit filename="../src/OgreFreeImageCodec.cpp" />
+		<Unit filename="../src/OgreFrustum.cpp" />
+		<Unit filename="../src/OgreGpuProgram.cpp" />
+		<Unit filename="../src/OgreGpuProgramManager.cpp" />
+		<Unit filename="../src/OgreGpuProgramUsage.cpp" />
+		<Unit filename="../src/OgreHardwareBufferManager.cpp" />
+		<Unit filename="../src/OgreHardwareIndexBuffer.cpp" />
+		<Unit filename="../src/OgreHardwareOcclusionQuery.cpp" />
+		<Unit filename="../src/OgreHardwarePixelBuffer.cpp" />
+		<Unit filename="../src/OgreHardwareVertexBuffer.cpp" />
+		<Unit filename="../src/OgreHighLevelGpuProgram.cpp" />
+		<Unit filename="../src/OgreHighLevelGpuProgramManager.cpp" />
+		<Unit filename="../src/OgreImage.cpp" />
+		<Unit filename="../src/OgreImageResampler.h" />
+		<Unit filename="../src/OgreInstancedGeometry.cpp" />
+		<Unit filename="../src/OgreKeyFrame.cpp" />
+		<Unit filename="../src/OgreLight.cpp" />
+		<Unit filename="../src/OgreLog.cpp" />
+		<Unit filename="../src/OgreLogManager.cpp" />
+		<Unit filename="../src/OgreManualObject.cpp" />
+		<Unit filename="../src/OgreMaterial.cpp" />
+		<Unit filename="../src/OgreMaterialManager.cpp" />
+		<Unit filename="../src/OgreMaterialScriptCompiler.cpp" />
+		<Unit filename="../src/OgreMaterialSerializer.cpp" />
+		<Unit filename="../src/OgreMath.cpp" />
+		<Unit filename="../src/OgreMatrix3.cpp" />
+		<Unit filename="../src/OgreMatrix4.cpp" />
+		<Unit filename="../src/OgreMemoryManager.cpp" />
+		<Unit filename="../src/OgreMesh.cpp" />
+		<Unit filename="../src/OgreMeshManager.cpp" />
+		<Unit filename="../src/OgreMeshSerializer.cpp" />
+		<Unit filename="../src/OgreMeshSerializerImpl.cpp" />
+		<Unit filename="../src/OgreMovableObject.cpp" />
+		<Unit filename="../src/OgreMovablePlane.cpp" />
+		<Unit filename="../src/OgreNode.cpp" />
+		<Unit filename="../src/OgreNumerics.cpp" />
+		<Unit filename="../src/OgreOptimisedUtil.cpp" />
+		<Unit filename="../src/OgreOptimisedUtilGeneral.cpp" />
+		<Unit filename="../src/OgreOptimisedUtilSSE.cpp">
+			<Option compiler="gcc" use="1" buildCommand="$compiler $options -msse $includes -c $file -o $object" />
+		</Unit>
+		<Unit filename="../src/OgreOverlay.cpp" />
+		<Unit filename="../src/OgreOverlayContainer.cpp" />
+		<Unit filename="../src/OgreOverlayElement.cpp" />
+		<Unit filename="../src/OgreOverlayElementCommands.cpp" />
+		<Unit filename="../src/OgreOverlayManager.cpp" />
+		<Unit filename="../src/OgrePanelOverlayElement.cpp" />
+		<Unit filename="../src/OgreParticle.cpp" />
+		<Unit filename="../src/OgreParticleEmitter.cpp" />
+		<Unit filename="../src/OgreParticleEmitterCommands.cpp" />
+		<Unit filename="../src/OgreParticleIterator.cpp" />
+		<Unit filename="../src/OgreParticleSystem.cpp" />
+		<Unit filename="../src/OgreParticleSystemManager.cpp" />
+		<Unit filename="../src/OgrePass.cpp" />
+		<Unit filename="../src/OgrePatchMesh.cpp" />
+		<Unit filename="../src/OgrePatchSurface.cpp" />
+		<Unit filename="../src/OgrePixelConversions.h" />
+		<Unit filename="../src/OgrePixelFormat.cpp" />
+		<Unit filename="../src/OgrePlane.cpp" />
+		<Unit filename="../src/OgrePlatformInformation.cpp" />
+		<Unit filename="../src/OgrePolygon.cpp" />
+		<Unit filename="../src/OgrePose.cpp" />
+		<Unit filename="../src/OgrePrecompiledHeaders.cpp" />
+		<Unit filename="../src/OgrePredefinedControllers.cpp" />
+		<Unit filename="../src/OgrePrefabFactory.cpp" />
+		<Unit filename="../src/OgreProfiler.cpp" />
+		<Unit filename="../src/OgreProgressiveMesh.cpp" />
+		<Unit filename="../src/OgreQuaternion.cpp" />
+		<Unit filename="../src/OgreRectangle2D.cpp" />
+		<Unit filename="../src/OgreRenderQueue.cpp" />
+		<Unit filename="../src/OgreRenderQueueInvocation.cpp" />
+		<Unit filename="../src/OgreRenderQueueSortingGrouping.cpp" />
+		<Unit filename="../src/OgreRenderSystem.cpp" />
+		<Unit filename="../src/OgreRenderSystemCapabilities.cpp" />
+		<Unit filename="../src/OgreRenderTarget.cpp" />
+		<Unit filename="../src/OgreRenderTexture.cpp" />
+		<Unit filename="../src/OgreRenderWindow.cpp" />
+		<Unit filename="../src/OgreResource.cpp" />
+		<Unit filename="../src/OgreResourceBackgroundQueue.cpp" />
+		<Unit filename="../src/OgreResourceGroupManager.cpp" />
+		<Unit filename="../src/OgreResourceManager.cpp" />
+		<Unit filename="../src/OgreRibbonTrail.cpp" />
+		<Unit filename="../src/OgreRoot.cpp" />
+		<Unit filename="../src/OgreRotationSpline.cpp" />
+		<Unit filename="../src/OgreSIMDHelper.h" />
+		<Unit filename="../src/OgreSceneManager.cpp" />
+		<Unit filename="../src/OgreSceneManagerEnumerator.cpp" />
+		<Unit filename="../src/OgreSceneNode.cpp" />
+		<Unit filename="../src/OgreSceneQuery.cpp" />
+		<Unit filename="../src/OgreSearchOps.cpp" />
+		<Unit filename="../src/OgreSerializer.cpp" />
+		<Unit filename="../src/OgreShadowCameraSetup.cpp" />
+		<Unit filename="../src/OgreShadowCameraSetupFocused.cpp" />
+		<Unit filename="../src/OgreShadowCameraSetupLiSPSM.cpp" />
+		<Unit filename="../src/OgreShadowCameraSetupPlaneOptimal.cpp" />
+		<Unit filename="../src/OgreShadowCaster.cpp" />
+		<Unit filename="../src/OgreShadowTextureManager.cpp" />
+		<Unit filename="../src/OgreShadowVolumeExtrudeProgram.cpp" />
+		<Unit filename="../src/OgreSimpleRenderable.cpp" />
+		<Unit filename="../src/OgreSimpleSpline.cpp" />
+		<Unit filename="../src/OgreSkeleton.cpp" />
+		<Unit filename="../src/OgreSkeletonInstance.cpp" />
+		<Unit filename="../src/OgreSkeletonManager.cpp" />
+		<Unit filename="../src/OgreSkeletonSerializer.cpp" />
+		<Unit filename="../src/OgreStaticGeometry.cpp" />
+		<Unit filename="../src/OgreString.cpp" />
+		<Unit filename="../src/OgreStringConverter.cpp" />
+		<Unit filename="../src/OgreStringInterface.cpp" />
+		<Unit filename="../src/OgreSubEntity.cpp" />
+		<Unit filename="../src/OgreSubMesh.cpp" />
+		<Unit filename="../src/OgreTagPoint.cpp" />
+		<Unit filename="../src/OgreTechnique.cpp" />
+		<Unit filename="../src/OgreTextAreaOverlayElement.cpp" />
+		<Unit filename="../src/OgreTexture.cpp" />
+		<Unit filename="../src/OgreTextureManager.cpp" />
+		<Unit filename="../src/OgreTextureUnitState.cpp" />
+		<Unit filename="../src/OgreUnifiedHighLevelGpuProgram.cpp" />
+		<Unit filename="../src/OgreUserDefinedObject.cpp" />
+		<Unit filename="../src/OgreVector2.cpp" />
+		<Unit filename="../src/OgreVector3.cpp" />
+		<Unit filename="../src/OgreVector4.cpp" />
+		<Unit filename="../src/OgreVertexIndexData.cpp" />
+		<Unit filename="../src/OgreViewport.cpp" />
+		<Unit filename="../src/OgreWindowEventUtilities.cpp" />
+		<Unit filename="../src/OgreWireBoundingBox.cpp" />
+		<Unit filename="../src/OgreZip.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /OgreMain/scripts/OgreMain_stlp.cbp
===================================================================
--- /OgreMain/scripts/OgreMain_stlp.cbp	(revision 5)
+++ /OgreMain/scripts/OgreMain_stlp.cbp	(revision 5)
@@ -0,0 +1,2438 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="OgreMain" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\lib\OgreMain_d.dll" />
+				<Option object_output="..\obj\Debug" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectIncludeDirsRelation="2" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Option projectLibDirsRelation="2" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="kernel32" />
+					<Add library="user32" />
+					<Add library="zziplibd" />
+					<Add library="zlib1" />
+					<Add library="freetype221_D" />
+					<Add library="freeimaged" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\Samples\Common\bin\$(TARGET_NAME)" />
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\Tools\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\lib\OgreMain.dll" />
+				<Option object_output="..\obj\Release" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="kernel32" />
+					<Add library="user32" />
+					<Add library="zziplib" />
+					<Add library="zlib1" />
+					<Add library="freetype221" />
+					<Add library="freeimage" />
+					<Add library="stlport.5.1" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\Samples\Common\bin\$(TARGET_NAME)" />
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\Tools\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-Winvalid-pch" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DOGRE_NONCLIENT_BUILD" />
+			<Add option="-DWIN32" />
+			<Add option="-D_USRDLL" />
+			<Add option="-D_MT" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Dependencies\include" />
+			<Add directory="..\src" />
+			<Add directory="..\src\WIN32" />
+		</Compiler>
+		<ResourceCompiler>
+			<Add directory="..\include\WIN32" />
+			<Add directory="..\src\WIN32" />
+		</ResourceCompiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Samples\Common\bin\$(TARGET_NAME)" />
+			<Add directory="..\..\Dependencies\lib\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\Ogre.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreAlignedAllocator.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreAnimable.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreAnimation.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreAnimationState.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreAnimationTrack.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreAny.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreArchive.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreArchiveFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreArchiveManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreAutoParamDataSource.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreAxisAlignedBox.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreBillboard.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreBillboardChain.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreBillboardParticleRenderer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreBillboardSet.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreBitwise.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreBlendMode.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreBone.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreBorderPanelOverlayElement.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCamera.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCodec.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreColourValue.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCommon.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCompiler2Pass.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCompositionPass.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCompositionTargetPass.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCompositionTechnique.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCompositor.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCompositorChain.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCompositorInstance.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCompositorManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCompositorScriptCompiler.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCompositorSerializer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreConfig.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreConfigDialog.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreConfigFile.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreConfigOptionMap.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreController.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreControllerManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreDDSCodec.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreDataStream.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreDefaultHardwareBufferManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreDynLib.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreDynLibManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreEdgeListBuilder.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreEntity.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreErrorDialog.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreException.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreExternalTextureSource.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreExternalTextureSourceManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreFactoryObj.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreFileSystem.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreFont.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreFontManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreFrameListener.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreFreeImageCodec.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreFrustum.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGpuProgram.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGpuProgramManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGpuProgramUsage.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreHardwareBuffer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreHardwareBufferManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreHardwareIndexBuffer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreHardwareOcclusionQuery.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreHardwarePixelBuffer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreHardwareVertexBuffer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreHighLevelGpuProgram.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreHighLevelGpuProgramManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreImage.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreImageCodec.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreInstancedGeometry.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreIteratorWrappers.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreKeyFrame.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreLight.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreLog.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreLogManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreManualObject.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreMaterial.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreMaterialManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreMaterialScriptCompiler.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreMaterialSerializer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreMath.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreMatrix3.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreMatrix4.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreMemoryMacros.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreMemoryManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreMesh.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreMeshFileFormat.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreMeshManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreMeshSerializer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreMeshSerializerImpl.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreMovableObject.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreMovablePlane.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreNoMemoryMacros.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreNode.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreNumerics.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreOptimisedUtil.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreOverlay.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreOverlayContainer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreOverlayElement.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreOverlayElementCommands.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreOverlayElementFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreOverlayManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgrePanelOverlayElement.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreParticle.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreParticleAffector.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreParticleAffectorFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreParticleEmitter.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreParticleEmitterCommands.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreParticleEmitterFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreParticleIterator.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreParticleSystem.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreParticleSystemManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreParticleSystemRenderer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgrePass.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgrePatchMesh.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgrePatchSurface.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgrePixelFormat.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgrePlane.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgrePlaneBoundedVolume.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgrePlatform.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgrePlatformInformation.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgrePlugin.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgrePose.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgrePredefinedControllers.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgrePrefabFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgrePrerequisites.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreProfiler.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreProgressiveMesh.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreQuaternion.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRadixSort.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRay.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRectangle.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRectangle2D.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRenderOperation.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRenderQueue.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRenderQueueInvocation.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRenderQueueListener.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRenderQueueSortingGrouping.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRenderSystem.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRenderSystemCapabilities.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRenderTarget.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRenderTargetListener.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRenderTexture.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRenderWindow.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRenderable.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreResource.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreResourceBackgroundQueue.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreResourceGroupManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreResourceManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRibbonTrail.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRoot.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRotationalSpline.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSceneManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSceneManagerEnumerator.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSceneNode.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSceneQuery.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreScriptLoader.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSearchOps.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSerializer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreShadowCameraSetup.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreShadowCaster.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreShadowTextureManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreShadowVolumeExtrudeProgram.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSharedPtr.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSimpleRenderable.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSimpleSpline.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSingleton.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSkeleton.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSkeletonFileFormat.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSkeletonInstance.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSkeletonManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSkeletonSerializer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSphere.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSpotShadowFadePng.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreStableHeaders.h">
+			<Option compilerVar="CPP" />
+			<Option link="0" />
+			<Option weight="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreStaticFaceGroup.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreStaticGeometry.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreStdHeaders.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreString.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreStringConverter.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreStringInterface.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreStringVector.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSubEntity.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSubMesh.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreTagPoint.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreTechnique.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreTextAreaOverlayElement.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreTexture.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreTextureManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreTextureUnitState.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreTimer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreUnifiedHighLevelGpuProgram.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreUserDefinedObject.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreUTFString.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreVector2.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreVector3.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreVector4.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreVertexBoneAssignment.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreVertexIndexData.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreViewport.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreWindowEventUtilities.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreWireBoundingBox.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreZip.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\WIN32\OgreConfigDialogImp.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\WIN32\OgreErrorDialogImp.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\WIN32\OgreTimerImp.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\asm_math.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\stl_user_config.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreAlignedAllocator.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreAnimable.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreAnimation.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreAnimationState.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreAnimationTrack.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreArchiveManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreAutoParamDataSource.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreBillboard.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreBillboardChain.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreBillboardParticleRenderer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreBillboardSet.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreBone.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreBorderPanelOverlayElement.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCamera.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCodec.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreColourValue.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCommon.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCompiler2Pass.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCompositionPass.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCompositionTargetPass.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCompositionTechnique.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCompositor.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCompositorChain.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCompositorInstance.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCompositorManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCompositorScriptCompiler.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCompositorSerializer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreConfigFile.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreControllerManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreDDSCodec.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreDataStream.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreDefaultHardwareBufferManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreDefaultSceneQueries.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreDynLib.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreDynLibManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreEdgeListBuilder.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreEntity.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreException.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreExternalTextureSource.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreExternalTextureSourceManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreFileSystem.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreFont.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreFontManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreFreeImageCodec.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreFrustum.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGpuProgram.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGpuProgramManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGpuProgramUsage.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreHardwareBufferManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreHardwareIndexBuffer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreHardwareOcclusionQuery.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreHardwarePixelBuffer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreHardwareVertexBuffer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreHighLevelGpuProgram.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreHighLevelGpuProgramManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreImage.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreImageResampler.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreInstancedGeometry.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreKeyFrame.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreLight.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreLog.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreLogManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreManualObject.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreMaterial.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreMaterialManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreMaterialScriptCompiler.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreMaterialSerializer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreMath.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreMatrix3.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreMatrix4.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreMemoryManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreMesh.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreMeshManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreMeshSerializer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreMeshSerializerImpl.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreMovableObject.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreMovablePlane.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreNode.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreNumerics.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreOptimisedUtil.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreOptimisedUtilGeneral.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreOptimisedUtilSSE.cpp">
+			<Option compilerVar="CPP" />
+			<Option compiler="gcc" use="1" buildCommand="$compiler $options -msse $includes -c $file -o $object" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreOverlay.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreOverlayContainer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreOverlayElement.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreOverlayElementCommands.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreOverlayManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgrePanelOverlayElement.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreParticle.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreParticleEmitter.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreParticleEmitterCommands.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreParticleIterator.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreParticleSystem.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreParticleSystemManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgrePass.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgrePatchMesh.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgrePatchSurface.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgrePixelConversions.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgrePixelFormat.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgrePlane.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgrePlatformInformation.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgrePose.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgrePrecompiledHeaders.cpp">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgrePredefinedControllers.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgrePrefabFactory.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreProfiler.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreProgressiveMesh.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreQuaternion.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRectangle2D.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRenderQueue.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRenderQueueInvocation.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRenderQueueSortingGrouping.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRenderSystem.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRenderSystemCapabilities.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRenderTarget.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRenderTexture.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRenderWindow.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreResource.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreResourceBackgroundQueue.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreResourceGroupManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreResourceManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRibbonTrail.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRoot.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRotationSpline.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreSIMDHelper.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreSceneManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreSceneManagerEnumerator.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreSceneNode.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreSceneQuery.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreSearchOps.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreSerializer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreShadowCameraSetup.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreShadowCaster.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreShadowTextureManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreShadowVolumeExtrudeProgram.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreSimpleRenderable.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreSimpleSpline.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreSkeleton.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreSkeletonInstance.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreSkeletonManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreSkeletonSerializer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreStaticGeometry.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreString.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreStringConverter.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreStringInterface.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreSubEntity.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreSubMesh.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreTagPoint.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreTechnique.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreTextAreaOverlayElement.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreTexture.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreTextureManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreTextureUnitState.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreUnifiedHighLevelGpuProgram.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreUserDefinedObject.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreVector2.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreVector3.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreVector4.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreVertexIndexData.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreViewport.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreWindowEventUtilities.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreWireBoundingBox.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreZip.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\WIN32\OgreConfigDialog.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\WIN32\OgreErrorDialog.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\WIN32\OgreTimer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\WIN32\OgreWin32Resources.rc">
+			<Option compilerVar="WINDRES" />
+			<Option objectName="src\WIN32\OgreWin32Resources.res" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\WIN32\ogre.ico">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\WIN32\ogrelogo.bmp">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\WIN32\resource.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\WIN32\winres.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /OgreMain/scripts/OgreMain_vc8.vcproj
===================================================================
--- /OgreMain/scripts/OgreMain_vc8.vcproj	(revision 5)
+++ /OgreMain/scripts/OgreMain_vc8.vcproj	(revision 5)
@@ -0,0 +1,1983 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="OgreMain"
+	ProjectGUID="{35AFBABB-DF05-43DE-91A7-BB828A874015}"
+	RootNamespace="OgreMain"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_USRDLL;_MT;OGRE_NONCLIENT_BUILD;FREEIMAGE_LIB"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				SmallerTypeCheck="true"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="true"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				DisableLanguageExtensions="false"
+				UsePrecompiledHeader="2"
+				PrecompiledHeaderThrough="OgreStableHeaders.h"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib user32.lib zziplibd.lib zlibd.lib freetype230_D.lib freeimaged.lib LibJPEG.lib LibMNG.lib LibPNG.lib LibTIFF.lib"
+				OutputFile="$(OutDir)/OgreMain_d.dll"
+				Version="0.99"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="..\..\Dependencies\lib\$(ConfigurationName)"
+				IgnoreAllDefaultLibraries="false"
+				IgnoreDefaultLibraryNames="LIBCD;LIBCMTD"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/OgreMain_d.pdb"
+				SubSystem="1"
+				OptimizeForWindows98="1"
+				ImportLibrary="$(OutDir)/OgreMain_d.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Samples\Common\bin\$(ConfigurationName)&#x0D;&#x0A;copy $(OutDir)\$(TargetFileName) ..\..\Tools\Common\bin\$(ConfigurationName)&#x0D;&#x0A;"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				EnableFiberSafeOptimizations="true"
+				AdditionalIncludeDirectories="..\include;..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_USRDLL;_MT;OGRE_NONCLIENT_BUILD;FREEIMAGE_LIB"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				DisableLanguageExtensions="false"
+				UsePrecompiledHeader="2"
+				PrecompiledHeaderThrough="OgreStableHeaders.h"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib user32.lib zziplib.lib zlib.lib freetype230.lib freeimage.lib LibJPEG.lib LibMNG.lib LibPNG.lib LibTIFF.lib"
+				OutputFile="$(OutDir)/OgreMain.dll"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="..\..\Dependencies\lib\$(ConfigurationName)"
+				IgnoreAllDefaultLibraries="false"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				ImportLibrary="$(OutDir)/OgreMain.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Samples\Common\bin\$(ConfigurationName)&#x0D;&#x0A;copy $(OutDir)\$(TargetFileName) ..\..\Tools\Common\bin\$(ConfigurationName)&#x0D;&#x0A;"
+			/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_USRDLL;_MT;OGRE_NONCLIENT_BUILD;FREEIMAGE_LIB;OGRE_STATIC_LIB"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				SmallerTypeCheck="true"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="true"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				DisableLanguageExtensions="false"
+				UsePrecompiledHeader="2"
+				PrecompiledHeaderThrough="OgreStableHeaders.h"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				AdditionalDependencies="zziplibd.lib freetype230_D.lib freeimaged.lib LibJPEG.lib LibMNG.lib LibPNG.lib LibTIFF.lib"
+				OutputFile="$(OutDir)\$(ProjectName)Static_d.lib"
+				AdditionalLibraryDirectories="..\..\lib;..\..\Dependencies\lib\Debug"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy ..\obj\DebugStaticLib\OgreWin32Resources.res ..\..\lib\OgreWin32Resources_d.res"
+			/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				EnableFiberSafeOptimizations="true"
+				AdditionalIncludeDirectories="..\include;..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_USRDLL;_MT;OGRE_NONCLIENT_BUILD;FREEIMAGE_LIB;OGRE_STATIC_LIB"
+				StringPooling="true"
+				MinimalRebuild="false"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				DisableLanguageExtensions="false"
+				UsePrecompiledHeader="2"
+				PrecompiledHeaderThrough="OgreStableHeaders.h"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				AdditionalDependencies="zziplib.lib freetype230.lib freeimage.lib LibJPEG.lib LibMNG.lib LibPNG.lib LibTIFF.lib"
+				OutputFile="$(OutDir)\$(ProjectName)Static.lib"
+				AdditionalLibraryDirectories="..\..\lib;..\..\Dependencies\lib\Release"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy ..\obj\ReleaseStaticLib\OgreWin32Resources.res ..\..\lib\OgreWin32Resources.res"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\OgreAlignedAllocator.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreAnimable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreAnimation.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreAnimationState.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreAnimationTrack.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreArchiveManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreAutoParamDataSource.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreBillboard.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreBillboardChain.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreBillboardParticleRenderer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreBillboardSet.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreBone.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreBorderPanelOverlayElement.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCamera.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCodec.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreColourValue.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCommon.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCompiler2Pass.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositionPass.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositionTargetPass.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositionTechnique.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositor.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositorChain.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositorInstance.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositorManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositorScriptCompiler.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCompositorSerializer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\WIN32\OgreConfigDialog.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreConfigFile.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreControllerManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreConvexBody.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreDataStream.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreDDSCodec.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreDefaultHardwareBufferManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreDefaultSceneQueries.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreDynLib.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreDynLibManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreEdgeListBuilder.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreEntity.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\WIN32\OgreErrorDialog.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreException.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreExternalTextureSource.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreExternalTextureSourceManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreFileSystem.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreFont.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreFontManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreFreeImageCodec.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreFrustum.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGpuProgram.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGpuProgramManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGpuProgramUsage.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreHardwareBufferManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreHardwareIndexBuffer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreHardwareOcclusionQuery.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreHardwarePixelBuffer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreHardwareVertexBuffer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreHighLevelGpuProgram.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreHighLevelGpuProgramManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreImage.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreImageResampler.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreInstancedGeometry.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreKeyFrame.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreLight.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreLog.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreLogManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreManualObject.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreMaterial.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreMaterialManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreMaterialScriptCompiler.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreMaterialSerializer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreMath.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreMatrix3.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreMatrix4.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreMemoryManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreMesh.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreMeshManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreMeshSerializer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreMeshSerializerImpl.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreMovableObject.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreMovablePlane.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreNode.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreNumerics.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreOptimisedUtil.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreOptimisedUtilGeneral.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreOptimisedUtilSSE.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreOverlay.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreOverlayContainer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreOverlayElement.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreOverlayElementCommands.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreOverlayManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgrePanelOverlayElement.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreParticle.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreParticleEmitter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreParticleEmitterCommands.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreParticleIterator.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreParticleSystem.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreParticleSystemManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgrePass.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgrePatchMesh.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgrePatchSurface.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgrePixelConversions.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgrePixelFormat.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgrePlane.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgrePlatformInformation.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgrePolygon.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgrePose.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgrePrecompiledHeaders.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+						PrecompiledHeaderThrough="OgreStableHeaders.h"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+						PrecompiledHeaderThrough="OgreStableHeaders.h"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="DebugStaticLib|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+						PrecompiledHeaderThrough="OgreStableHeaders.h"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="ReleaseStaticLib|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+						PrecompiledHeaderThrough="OgreStableHeaders.h"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\OgrePredefinedControllers.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgrePrefabFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreProfiler.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreProgressiveMesh.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreQuaternion.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRectangle2D.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRenderQueue.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRenderQueueInvocation.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRenderQueueSortingGrouping.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRenderSystem.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRenderSystemCapabilities.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRenderTarget.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRenderTexture.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRenderWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreResource.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreResourceBackgroundQueue.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreResourceGroupManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreResourceManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRibbonTrail.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRoot.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRotationSpline.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreSceneManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreSceneManagerEnumerator.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreSceneNode.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreSceneQuery.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreSerializer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreShadowCameraSetup.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreShadowCameraSetupFocused.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreShadowCameraSetupLiSPSM.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreShadowCameraSetupPlaneOptimal.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreShadowCaster.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreShadowTextureManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreShadowVolumeExtrudeProgram.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreSIMDHelper.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreSimpleRenderable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreSimpleSpline.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreSkeleton.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreSkeletonInstance.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreSkeletonManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreSkeletonSerializer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreStaticGeometry.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreString.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreStringConverter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreStringInterface.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreSubEntity.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreSubMesh.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreTagPoint.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreTechnique.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreTextAreaOverlayElement.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreTexture.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreTextureManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreTextureUnitState.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\WIN32\OgreTimer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreUnifiedHighLevelGpuProgram.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreUserDefinedObject.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreVector2.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreVector3.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreVector4.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreVertexIndexData.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreViewport.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreWindowEventUtilities.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreWireBoundingBox.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreZip.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\asm_math.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\Ogre.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreAlignedAllocator.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreAnimable.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreAnimation.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreAnimationState.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreAnimationTrack.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreAny.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreArchive.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreArchiveFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreArchiveManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreAutoParamDataSource.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreAxisAlignedBox.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreBillboard.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreBillboardChain.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreBillboardParticleRenderer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreBillboardSet.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreBitwise.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreBlendMode.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreBone.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreBorderPanelOverlayElement.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCamera.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCodec.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCodecFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreColourValue.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCommon.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCompiler2Pass.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositionPass.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositionTargetPass.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositionTechnique.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositor.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositorChain.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositorInstance.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositorManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositorScriptCompiler.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCompositorSerializer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreConfig.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreConfigDialog.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\WIN32\OgreConfigDialogImp.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreConfigFile.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreConfigOptionMap.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreController.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreControllerManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreConvexBody.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreDataStream.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreDDSCodec.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreDefaultHardwareBufferManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreDllInteface.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreDynLib.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreDynLibManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreEdgeListBuilder.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreEntity.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreErrorDialog.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\WIN32\OgreErrorDialogImp.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreException.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreExternalTextureSource.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreExternalTextureSourceManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreFactoryObj.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreFileSystem.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreFont.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreFontManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreFrameListener.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreFreeImageCodec.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreFrustum.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGpuProgram.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGpuProgramManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGpuProgramUsage.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreHardwareBuffer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreHardwareBufferManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreHardwareIndexBuffer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreHardwareOcclusionQuery.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreHardwarePixelBuffer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreHardwareVertexBuffer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreHighLevelGpuProgram.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreHighLevelGpuProgramManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreImage.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreImageCodec.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreInstancedGeometry.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreIteratorWrappers.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreKeyFrame.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreLight.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreLog.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreLogManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreManualObject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreMaterial.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreMaterialManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreMaterialScriptCompiler.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreMaterialSerializer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreMath.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreMatrix3.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreMatrix4.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreMemoryMacros.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreMemoryManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreMesh.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreMeshFileFormat.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreMeshManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreMeshSerializer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreMeshSerializerImpl.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreMovableObject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreMovablePlane.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreNode.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreNoMemoryMacros.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreNumerics.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreOptimisedUtil.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreOverlay.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreOverlayContainer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreOverlayElement.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreOverlayElementCommands.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreOverlayElementFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreOverlayManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgrePanelOverlayElement.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreParticle.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleAffector.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleAffectorFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleEmitter.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleEmitterCommands.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleEmitterFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleIterator.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleSystem.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleSystemManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleSystemRenderer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgrePass.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgrePatchMesh.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgrePatchSurface.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgrePixelFormat.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgrePlane.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgrePlaneBoundedVolume.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgrePlatform.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgrePlatformInformation.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgrePlugin.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgrePolygon.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgrePose.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgrePredefinedControllers.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgrePrefabFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgrePrerequisites.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreProfiler.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreProgressiveMesh.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreQuaternion.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRadixSort.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRay.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRectangle2D.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderable.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderOperation.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderQueue.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderQueueInvocation.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderQueueListener.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderQueueSortingGrouping.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderSystem.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderSystemCapabilities.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderTarget.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderTargetListener.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderTexture.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRenderWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreResource.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreResourceBackgroundQueue.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreResourceGroupManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreResourceManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRibbonTrail.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRoot.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRotationalSpline.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSceneManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSceneManagerEnumerator.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSceneNode.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSceneQuery.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreScriptLoader.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSerializer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreShadowCameraSetup.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreShadowCameraSetupFocused.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreShadowCameraSetupLiSPSM.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreShadowCameraSetupPlaneOptimal.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreShadowCaster.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreShadowTextureManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreShadowVolumeExtrudeProgram.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSharedPtr.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSimpleRenderable.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSimpleSpline.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSingleton.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSkeleton.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSkeletonFileFormat.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSkeletonInstance.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSkeletonManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSkeletonSerializer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSphere.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSpotShadowFadePng.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreStableHeaders.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreStaticFaceGroup.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreStaticGeometry.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreStdHeaders.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreString.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreStringConverter.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreStringInterface.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreStringResource.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreStringVector.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSubEntity.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreSubMesh.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreTagPoint.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreTechnique.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreTextAreaOverlayElement.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreTexture.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreTextureManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreTextureUnitState.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreTimer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\WIN32\OgreTimerImp.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreUnifiedHighLevelGpuProgram.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreUserDefinedObject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreUTFString.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreVector2.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreVector3.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreVector4.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreVertexBoneAssignment.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreVertexIndexData.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreViewport.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreWindowEventUtilities.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreWireBoundingBox.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreZip.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\WIN32\resource.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+			<File
+				RelativePath="..\src\WIN32\ogre.ico"
+				>
+			</File>
+			<File
+				RelativePath="..\src\WIN32\ogrelogo.bmp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\WIN32\OgreWin32Resources.rc"
+				>
+			</File>
+			<File
+				RelativePath="..\src\WIN32\winres.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /OgreMain/src/GLX/GLX_backdrop.h
===================================================================
--- /OgreMain/src/GLX/GLX_backdrop.h	(revision 5)
+++ /OgreMain/src/GLX/GLX_backdrop.h	(revision 5)
@@ -0,0 +1,1 @@
+char GLX_backdrop_data[49348]={137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,1,144,0,0,1,44,8,3,0,0,0,218,105,21,240,0,0,3,0,80,76,84,69,0,1,0,7,9,5,15,16,12,28,20,5,24,26,24,47,35,15,35,40,32,38,44,35,60,42,8,44,50,41,76,50,5,52,57,49,54,57,54,54,60,51,74,59,24,60,62,59,54,66,56,60,65,57,76,63,38,60,71,61,95,64,4,67,68,63,64,70,61,64,76,66,67,76,61,74,74,68,71,76,68,69,78,63,67,83,50,70,80,65,69,84,51,98,74,31,76,80,66,70,86,52,92,77,46,74,84,68,70,88,60,73,88,54,75,87,60,75,87,76,77,87,71,80,86,76,83,86,72,76,92,59,80,91,64,120,81,10,80,90,74,84,88,74,78,94,60,78,91,80,82,92,76,80,94,72,80,96,62,85,90,81,84,95,68,79,98,69,87,94,73,85,95,79,83,99,65,107,91,57,83,101,72,88,97,82,86,100,78,89,99,83,89,101,73,87,103,69,92,100,79,91,101,85,89,106,71,121,95,48,91,105,82,94,104,88,94,106,78,90,109,80,97,105,84,143,97,4,128,98,42,97,106,90,98,110,82,101,108,87,99,109,93,102,108,97,96,113,95,103,111,89,101,113,85,102,112,96,106,111,102,104,114,97,108,112,97,104,116,88,105,115,99,108,114,104,102,119,101,107,117,100,143,100,93,107,119,91,107,118,101,151,109,30,108,119,102,106,121,98,111,117,108,114,117,102,110,120,104,144,114,55,111,124,95,107,124,106,110,124,101,136,116,75,113,123,107,116,122,112,116,127,110,114,129,105,120,126,116,118,130,101,176,118,13,121,127,117,121,129,107,117,132,109,120,130,114,125,128,113,117,131,119,123,129,119,124,130,120,122,134,105,161,123,59,144,122,113,121,136,112,119,136,118,126,132,122,124,135,118,122,135,124,127,135,112,127,133,123,129,135,125,125,140,116,130,138,116,158,131,82,126,139,127,128,139,122,131,137,127,132,138,128,128,143,119,134,140,130,159,129,122,129,143,131,132,143,126,135,141,131,135,143,121,136,142,132,130,147,129,201,136,2,133,146,134,135,146,129,138,144,134,143,144,123,141,144,129,179,138,65,139,146,135,136,149,137,138,149,132,141,147,137,135,152,134,141,151,128,142,149,139,138,152,140,141,152,134,144,150,140,140,154,142,143,154,137,146,152,142,142,155,143,192,146,55,147,154,144,145,156,139,143,156,145,149,155,145,175,151,101,147,158,140,145,159,147,143,161,142,176,145,138,150,157,147,149,159,142,150,160,143,155,158,142,147,161,149,153,159,149,151,162,144,149,162,151,226,151,7,154,161,151,153,163,146,158,161,146,200,155,71,154,165,148,160,165,137,153,166,154,156,167,149,161,165,149,159,165,155,152,170,151,157,168,150,158,169,151,187,163,111,154,172,153,159,170,153,205,160,82,158,171,159,166,169,153,163,170,159,161,172,154,157,176,156,160,174,162,163,174,156,240,162,12,212,165,74,168,172,157,202,167,99,165,176,158,167,178,160,196,171,119,168,179,162,165,184,164,219,173,88,202,178,131,213,177,112,241,175,50,178,184,174,193,178,173,219,181,106,243,184,70,218,190,131,245,187,83,243,192,85,244,193,94,200,199,190,222,198,150,246,196,103,247,199,112,244,202,113,249,201,120,246,205,122,247,207,130,213,212,203,249,210,140,249,212,147,239,214,166,246,216,149,251,215,157,247,218,158,248,221,167,249,224,175,251,228,185,253,231,195,253,234,203,252,237,211,83,92,13,170,0,0,0,9,112,72,89,115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,7,116,73,77,69,7,215,4,17,16,55,57,13,238,155,65,0,0,32,0,73,68,65,84,120,218,236,189,125,76,92,215,153,63,142,19,50,132,18,34,187,68,134,130,172,90,65,209,48,147,4,123,144,49,26,215,8,91,184,59,182,178,227,142,193,163,137,21,88,179,38,114,13,75,32,137,176,255,73,203,200,178,100,87,72,214,202,66,142,208,122,37,106,203,19,3,43,152,10,87,112,65,54,16,117,204,24,106,45,30,191,180,89,123,235,109,203,183,205,75,155,110,19,39,105,211,38,237,247,121,59,47,119,192,221,252,190,187,251,199,79,234,185,119,206,61,247,220,243,118,159,207,121,158,231,156,115,207,57,147,83,104,76,65,97,150,41,120,208,147,2,229,83,176,98,236,53,107,215,150,172,5,179,230,65,233,173,236,87,176,220,99,133,24,171,41,109,43,68,193,131,139,188,82,134,95,192,80,22,37,107,254,82,89,93,101,252,47,222,171,48,47,215,83,26,8,4,170,3,190,210,181,107,242,243,60,121,30,79,94,94,222,99,121,89,166,96,77,145,175,58,71,162,214,70,91,90,14,28,128,243,0,218,124,229,251,22,117,115,224,128,246,71,71,75,139,21,144,61,91,36,72,251,201,94,58,218,45,127,243,180,133,99,183,232,132,56,21,59,41,87,194,174,194,28,104,233,236,139,247,245,29,147,84,240,104,57,176,82,116,43,85,46,172,42,134,245,70,47,216,89,183,168,162,180,28,56,216,211,7,230,168,100,232,38,10,216,47,232,20,153,8,46,26,181,232,252,229,229,14,28,40,205,43,60,125,239,222,205,123,215,226,117,229,229,235,188,229,94,111,69,133,183,194,203,39,57,193,85,148,151,95,88,88,28,240,17,32,5,193,102,149,128,16,90,21,68,92,45,234,213,149,163,197,4,63,96,17,90,133,56,70,120,104,170,233,64,138,128,45,45,86,161,91,14,216,132,210,84,104,177,232,97,138,114,160,229,112,95,95,60,126,220,84,31,55,204,54,33,36,149,236,252,109,204,91,172,67,225,11,191,14,0,61,30,55,120,219,239,223,162,171,147,65,92,227,162,211,106,49,111,17,203,71,60,238,93,237,15,149,151,19,245,43,24,9,57,180,187,36,47,255,177,252,199,114,128,63,10,34,45,86,209,173,82,26,108,228,101,91,90,90,178,136,111,191,145,41,79,39,113,72,39,61,127,129,163,105,44,36,53,21,254,5,73,88,39,222,178,60,127,29,4,29,199,128,65,78,198,173,252,201,241,66,86,76,157,155,77,200,149,242,55,105,152,250,126,160,229,72,239,201,190,62,87,254,174,52,31,240,254,166,28,118,254,133,121,109,75,87,79,199,163,21,196,26,128,70,121,57,114,73,25,99,33,39,254,202,64,144,121,144,67,246,100,21,172,69,81,80,57,95,192,179,197,69,216,150,23,108,206,209,70,194,160,204,58,217,219,97,60,220,105,187,238,14,88,118,75,139,27,216,22,183,33,159,99,189,125,189,189,39,69,236,153,232,7,172,244,220,113,117,165,85,97,109,151,208,208,149,19,188,235,193,227,125,189,39,173,138,162,211,58,96,170,129,157,175,251,125,52,230,228,204,47,236,63,221,17,171,3,60,128,232,32,179,42,130,145,23,190,253,237,151,58,171,202,43,52,151,176,12,43,3,69,2,128,4,173,55,62,224,46,113,139,201,124,57,113,150,249,89,20,142,159,4,162,241,219,29,160,55,204,34,184,77,72,59,25,4,58,59,240,1,119,5,137,67,229,61,217,235,206,246,128,169,58,66,81,246,127,193,93,178,172,34,31,88,94,41,244,251,31,233,59,217,183,210,107,47,79,197,13,153,102,52,243,60,175,176,225,96,12,180,135,183,162,188,188,188,106,207,183,255,241,251,223,255,254,63,254,221,181,155,161,114,175,160,65,44,130,160,20,1,135,20,20,54,183,252,207,155,56,170,144,150,255,13,115,240,36,74,195,190,150,150,7,144,235,192,138,68,123,32,89,31,24,234,168,11,244,255,239,70,213,133,150,88,254,234,166,182,32,106,143,178,138,8,161,241,253,239,127,251,239,254,233,94,127,185,225,15,22,101,222,242,117,249,5,57,160,208,91,224,104,110,228,232,6,157,230,102,185,111,214,158,205,202,55,43,16,92,36,180,10,129,50,171,29,194,55,54,115,146,205,203,18,150,172,154,77,158,114,143,73,53,171,156,237,172,248,190,253,248,241,83,189,199,143,183,103,23,100,153,227,47,27,147,111,243,202,241,186,122,143,183,187,82,109,182,105,209,188,66,82,246,123,218,133,207,91,29,107,40,71,129,20,122,233,251,223,255,63,255,135,248,227,219,247,46,86,150,43,157,46,151,242,170,131,241,206,64,78,97,212,208,180,217,164,217,44,180,101,180,144,180,58,243,70,77,255,22,245,188,185,217,42,19,6,63,8,58,164,93,149,170,153,147,224,96,141,130,154,36,209,168,32,228,103,22,196,86,250,6,195,230,150,206,222,227,189,96,218,237,178,74,73,85,81,44,210,73,182,205,54,129,154,179,30,233,242,112,100,161,233,129,227,168,3,37,61,29,129,11,223,98,94,184,89,83,74,21,192,130,131,110,75,242,10,154,106,215,149,151,121,17,142,251,247,239,3,32,127,247,237,155,215,234,202,132,65,140,94,15,158,189,119,19,0,137,185,10,212,236,42,104,115,115,214,157,133,149,203,88,111,206,151,248,201,184,229,99,194,183,52,175,156,213,50,211,210,188,82,62,205,205,109,128,198,241,222,227,29,118,134,45,42,173,150,101,57,44,187,177,131,172,240,216,152,110,200,227,65,129,90,92,47,160,96,177,10,161,237,250,252,252,252,96,103,184,170,34,244,79,223,255,62,192,113,31,56,228,31,71,239,93,11,149,105,237,161,128,41,247,30,189,121,19,250,33,205,255,43,230,112,239,177,255,157,132,143,29,63,126,156,69,214,127,109,154,254,59,25,117,244,118,252,247,75,187,58,47,223,219,16,143,159,62,13,149,127,234,251,191,186,255,43,192,227,7,55,111,222,108,42,227,166,149,198,132,68,87,219,77,228,144,166,47,250,38,177,74,95,240,139,21,3,162,183,159,236,84,119,190,202,232,255,32,32,113,228,143,227,189,237,205,255,235,166,231,191,15,72,113,126,105,188,179,169,41,212,116,17,58,234,55,175,101,210,215,174,94,187,9,174,206,114,145,85,166,229,11,71,121,248,222,189,47,204,33,245,69,185,57,104,30,202,91,91,247,197,234,151,0,178,134,98,229,22,249,98,205,255,35,149,154,224,232,61,222,249,191,15,200,145,255,126,30,249,165,87,151,46,30,12,7,170,218,250,47,222,68,76,112,4,229,230,233,48,180,127,203,203,176,127,72,157,69,117,150,87,156,190,231,253,98,128,148,60,148,99,25,207,250,7,18,178,177,57,184,182,48,55,119,21,7,204,205,205,45,52,209,30,202,91,83,245,197,223,165,105,101,143,3,168,211,65,106,117,171,252,254,223,165,213,127,21,164,163,203,117,219,248,255,2,72,184,179,173,63,18,4,19,110,138,159,190,8,38,17,239,172,5,5,95,230,13,118,132,235,234,26,162,117,21,60,156,69,45,223,242,202,209,234,156,2,137,219,250,224,100,215,10,28,95,123,242,203,66,219,220,245,43,179,209,90,207,170,156,101,230,107,79,62,108,110,114,243,215,214,187,35,173,152,113,235,114,186,177,215,65,68,227,120,22,135,124,97,93,209,106,93,27,57,226,131,227,182,116,62,176,128,173,255,5,62,18,37,154,95,27,172,10,32,30,129,96,3,152,112,85,121,89,81,73,73,89,121,176,33,126,243,94,188,169,169,233,96,83,192,203,134,244,73,89,85,41,114,72,43,38,208,100,18,107,109,180,223,114,61,193,241,208,63,252,250,207,104,62,255,233,63,16,97,243,150,151,162,204,147,179,162,249,222,159,255,252,217,175,191,243,164,197,42,158,210,136,155,204,173,203,239,90,45,66,88,47,223,137,104,192,209,253,32,66,161,221,148,229,211,244,32,170,181,174,16,95,50,110,109,106,109,95,49,82,147,59,114,235,202,249,179,43,175,170,46,24,172,3,56,42,235,78,95,140,119,118,182,53,197,162,77,109,253,103,175,222,187,119,47,209,25,107,106,138,29,12,41,53,66,103,89,62,139,172,214,88,171,78,46,102,101,210,218,92,77,84,126,228,167,159,255,249,79,4,8,216,159,255,16,107,124,174,79,151,61,134,215,82,97,163,47,255,211,247,126,253,107,14,251,231,79,62,249,245,247,190,243,228,247,56,218,159,63,249,233,247,190,108,196,94,153,155,214,156,191,232,153,214,152,203,215,162,82,115,231,81,86,234,157,84,206,152,34,138,212,169,38,240,109,93,6,176,38,95,43,190,221,114,116,98,177,236,252,69,102,105,242,171,28,108,12,154,220,239,175,89,85,229,9,105,197,86,151,132,130,225,88,48,80,215,118,17,32,184,121,237,218,77,104,98,221,67,231,213,163,0,13,32,210,20,149,166,150,12,104,229,98,63,68,21,164,81,242,140,25,18,148,48,28,127,250,243,159,224,4,139,236,63,127,254,61,244,174,140,153,226,85,178,202,255,39,2,14,15,177,254,244,231,63,139,7,197,253,211,159,62,249,225,63,8,42,171,242,235,21,53,44,218,180,182,90,236,80,95,81,81,82,88,144,151,235,121,40,39,183,132,223,177,231,120,47,66,114,244,112,115,204,93,47,99,140,99,43,57,27,213,11,88,190,64,173,198,230,108,78,108,82,196,139,217,132,148,247,63,64,207,37,58,96,13,41,225,175,137,130,88,149,86,115,100,76,170,24,87,168,70,160,107,65,85,231,248,197,254,211,87,65,149,223,84,90,253,26,106,146,166,6,128,3,143,166,0,180,184,202,25,14,184,228,1,32,173,82,34,78,40,166,110,128,82,177,2,18,57,159,253,233,243,63,25,67,238,159,34,147,212,198,98,148,117,140,155,82,143,252,208,14,166,194,126,174,227,168,167,159,127,246,195,175,49,38,121,149,66,177,86,206,18,173,122,159,111,45,128,224,201,125,40,75,242,149,80,144,248,113,54,61,138,114,92,100,249,197,98,177,230,152,229,167,95,198,248,242,171,169,96,148,49,147,175,73,147,129,1,141,53,31,140,113,125,105,106,141,153,103,226,110,142,233,192,20,158,131,210,17,107,214,161,155,3,5,23,9,132,155,192,18,241,120,255,233,196,217,248,145,182,38,80,39,8,5,35,18,0,28,160,249,139,131,143,208,230,202,3,165,30,83,213,52,198,249,196,180,133,120,124,249,19,160,228,231,159,255,233,115,185,136,235,19,64,36,87,149,44,31,21,195,247,62,87,0,124,254,57,93,149,197,23,251,0,159,31,50,159,120,42,57,183,88,204,87,152,151,187,12,4,219,228,82,169,142,30,63,126,20,143,30,77,142,70,77,9,77,243,88,76,163,33,239,229,62,132,96,198,95,189,127,204,253,254,66,222,88,204,208,186,161,217,149,142,69,177,101,249,99,208,210,32,162,129,125,143,211,97,80,234,225,112,67,56,138,130,138,153,3,172,131,13,4,70,57,142,46,162,237,193,86,150,170,93,246,171,96,69,64,58,127,237,243,207,128,190,108,177,97,231,103,159,192,195,194,86,44,107,12,197,213,147,159,232,64,18,225,51,101,189,253,153,186,87,79,201,249,54,183,14,242,67,152,157,119,69,40,190,252,228,147,255,240,189,239,252,251,175,127,253,217,103,112,135,252,216,210,219,211,3,42,228,216,241,195,170,176,36,109,216,217,208,106,211,210,34,45,209,187,129,9,139,149,191,1,146,210,228,143,41,26,114,197,104,229,8,74,141,241,189,27,99,73,150,228,162,197,146,4,23,99,214,28,107,228,100,10,70,239,1,26,104,174,94,28,63,155,56,221,31,111,35,52,20,36,7,81,98,149,51,24,200,40,229,40,178,98,92,3,116,145,154,165,78,32,127,252,195,103,64,73,52,159,211,15,108,162,45,154,159,194,227,245,24,39,15,28,95,255,92,2,125,46,17,76,120,0,132,92,150,143,164,248,9,65,178,106,45,100,102,240,120,228,201,175,33,8,111,191,253,137,73,241,51,2,36,10,101,106,237,1,105,213,123,172,167,247,48,230,220,40,101,110,108,54,47,209,32,165,111,142,197,12,241,144,62,49,10,71,148,212,129,85,212,70,253,254,141,230,253,27,109,178,180,90,113,196,54,48,138,196,226,4,237,244,10,27,238,221,52,134,116,200,205,139,157,13,128,69,44,198,176,212,122,177,147,88,206,236,193,28,162,43,81,204,188,85,172,57,26,91,207,120,216,244,213,134,156,160,8,30,2,34,161,254,248,119,69,108,235,177,54,79,90,152,102,25,134,196,19,10,3,16,223,3,78,248,196,157,194,231,198,98,64,98,109,61,39,122,128,71,142,197,143,197,148,105,112,17,74,85,170,152,109,154,87,240,105,94,249,137,29,191,165,217,117,111,161,177,82,98,205,38,144,122,92,94,116,21,25,68,120,68,174,247,174,117,178,212,194,110,72,29,11,43,134,3,13,232,16,136,24,133,36,162,177,168,85,254,104,44,4,93,188,175,125,246,199,207,62,251,227,31,193,254,35,58,240,20,139,46,160,70,74,8,183,239,112,48,87,8,60,57,232,151,63,51,41,88,22,39,243,83,212,37,171,188,32,243,116,132,207,62,251,204,10,194,246,175,1,252,8,20,176,51,30,63,218,115,12,15,139,32,13,177,7,155,101,207,12,45,155,27,84,144,134,236,71,108,14,54,44,79,161,97,133,36,27,86,72,156,76,126,39,224,113,205,176,8,221,92,187,119,181,131,120,4,0,9,162,164,42,23,238,32,201,69,128,0,22,81,68,3,237,40,223,198,162,32,176,30,249,4,168,129,116,97,139,28,108,216,9,141,223,85,81,80,32,79,170,48,26,188,63,218,193,115,116,252,207,180,231,103,218,231,143,223,97,81,245,164,241,209,33,62,211,217,190,141,128,68,98,177,35,113,96,142,56,158,82,129,26,44,162,52,72,157,106,160,58,102,232,36,247,244,156,222,79,63,137,106,59,106,219,13,28,228,128,10,193,196,49,53,86,5,54,181,56,218,96,165,215,192,247,13,171,11,46,106,28,174,9,135,16,34,23,137,59,98,225,202,117,56,154,197,90,221,203,186,29,1,137,154,92,57,11,60,160,206,230,188,253,199,63,0,45,254,32,135,237,228,243,143,143,0,139,228,228,60,252,137,60,86,65,254,168,227,161,253,118,142,253,68,121,91,233,189,205,35,43,127,176,67,177,211,228,15,128,228,134,128,38,71,0,143,158,99,96,29,141,10,141,162,82,143,162,66,109,54,46,18,139,43,26,141,153,144,170,234,169,59,247,251,115,58,7,162,58,147,168,29,58,166,206,104,44,251,144,144,156,94,110,201,77,139,67,196,69,151,35,13,77,77,225,32,205,62,161,163,28,103,63,128,229,69,14,145,12,213,155,200,21,52,245,215,255,192,230,247,43,93,200,129,44,146,147,243,67,243,64,63,20,215,239,225,120,59,231,19,215,189,113,43,243,54,53,129,229,97,118,66,236,254,33,0,18,142,68,163,71,227,196,34,200,33,186,172,207,131,227,121,251,29,20,233,209,236,137,169,183,178,2,60,175,60,158,143,26,58,62,191,140,6,45,232,124,62,102,188,98,238,16,66,184,231,117,189,16,52,196,187,192,19,50,92,113,205,6,229,106,91,83,52,136,26,195,91,81,86,84,76,136,148,139,5,74,61,251,69,200,132,128,66,31,255,225,15,159,126,10,63,57,236,203,31,248,247,41,54,142,30,209,254,250,233,167,68,72,182,1,181,183,63,229,208,236,163,211,211,191,63,252,250,17,4,132,35,137,167,132,80,217,126,7,219,199,64,34,133,199,177,120,115,52,219,60,175,139,31,163,79,181,237,29,29,7,241,3,167,126,169,88,116,185,217,19,93,209,16,58,237,177,232,23,50,43,165,31,139,214,123,242,207,222,19,93,126,205,197,34,55,79,199,246,120,203,8,3,111,109,255,30,225,16,156,171,229,45,201,203,2,68,153,66,208,232,159,126,250,123,60,201,250,84,92,218,38,199,239,191,9,132,252,161,121,76,14,14,96,66,255,109,206,207,148,239,167,58,12,7,161,96,20,17,144,213,41,168,12,237,252,17,16,224,144,22,96,141,238,163,199,240,215,98,10,219,168,172,70,185,237,56,218,221,13,160,225,47,126,180,59,126,164,187,227,64,204,10,234,54,141,15,240,143,70,59,90,30,240,224,11,153,60,79,213,61,141,130,130,133,111,219,170,136,33,224,44,26,189,159,124,49,84,174,140,183,104,253,3,0,1,2,253,27,18,75,232,193,84,51,87,113,124,250,51,208,32,191,251,84,249,161,55,69,49,33,225,247,100,206,207,126,111,61,99,111,116,74,12,242,250,183,156,156,223,235,124,204,161,243,7,64,80,182,118,160,176,2,46,57,118,172,187,101,197,114,51,253,14,30,67,197,223,205,136,32,134,224,58,114,176,225,11,209,209,66,160,179,121,153,215,202,206,149,140,223,147,23,191,199,250,252,218,53,145,90,36,184,174,221,139,51,241,17,144,146,204,253,209,151,94,142,85,172,227,219,178,136,31,222,83,10,10,18,26,156,17,37,177,30,254,221,239,62,254,29,254,208,38,3,206,143,229,158,252,224,238,119,15,231,124,157,253,127,103,158,124,204,143,56,12,6,249,153,10,98,61,144,240,146,224,199,159,126,29,66,233,220,62,254,157,206,69,124,158,204,201,41,111,143,199,15,247,28,233,57,2,212,62,210,131,34,171,129,74,172,11,109,76,51,4,56,22,239,57,114,36,126,228,200,49,8,139,177,192,221,254,124,180,193,38,104,35,90,13,202,175,81,83,193,6,196,21,65,229,40,166,193,120,186,252,201,93,224,41,186,170,197,21,99,65,168,92,187,121,53,88,166,212,198,186,226,169,251,153,23,95,126,249,133,202,50,70,168,143,57,36,18,141,68,200,166,34,129,13,109,167,175,125,244,241,199,31,243,143,15,190,67,203,242,249,122,206,119,62,254,88,7,92,118,65,11,120,237,99,9,99,37,240,209,199,150,129,251,183,31,254,153,122,254,145,9,172,243,7,64,252,157,93,32,124,226,112,0,109,227,221,205,17,38,95,36,18,53,14,185,52,130,152,58,66,39,96,17,231,3,188,122,186,14,72,80,142,165,126,120,223,224,122,127,190,233,142,69,196,21,137,54,70,84,76,12,16,145,192,217,249,55,232,98,132,114,61,81,45,164,84,171,151,165,87,162,178,204,43,12,82,94,146,184,191,244,210,203,128,8,53,179,214,85,252,19,0,18,137,232,114,232,172,242,115,144,208,31,49,229,62,210,142,143,140,143,144,245,223,114,196,99,57,22,18,14,164,218,119,172,68,62,50,225,249,150,188,192,124,253,223,52,208,238,32,116,1,64,42,58,59,15,31,6,52,136,206,135,15,119,80,97,169,200,17,141,135,34,211,145,195,234,56,12,97,143,116,195,201,183,29,86,120,116,177,209,9,169,247,103,175,195,205,17,5,159,190,24,80,162,114,67,169,8,186,26,170,200,106,79,65,252,158,98,140,107,10,149,107,200,33,71,85,155,10,117,200,233,251,191,122,9,17,121,17,215,41,148,175,59,142,128,68,85,161,34,81,85,72,232,237,253,236,67,36,149,182,62,84,39,90,31,138,245,209,71,191,120,68,123,127,244,209,71,38,140,138,131,144,33,32,150,177,159,127,168,188,62,252,232,23,63,195,203,135,38,39,87,254,208,12,171,111,63,114,228,112,55,146,23,142,35,221,7,35,10,12,85,103,229,53,240,215,217,125,56,206,204,4,63,12,125,132,92,192,39,29,154,176,54,249,179,223,159,220,177,248,65,185,55,24,216,193,254,66,254,145,72,158,167,44,97,216,67,193,129,60,114,181,179,76,241,135,183,188,168,255,254,253,126,64,228,165,151,67,40,199,202,218,252,4,72,163,74,175,81,18,5,64,126,129,212,33,18,125,104,153,143,178,28,31,125,85,66,177,223,71,234,242,17,7,1,7,52,196,190,99,110,221,145,149,69,244,255,133,186,113,69,151,80,208,154,107,238,236,66,60,186,129,192,135,129,222,7,177,164,223,48,196,37,199,243,236,120,190,227,8,226,208,221,29,239,138,31,142,35,107,116,29,198,43,162,121,32,18,49,140,33,214,243,22,183,24,132,14,118,181,91,16,101,25,149,101,71,123,179,139,213,164,24,33,143,167,54,46,220,161,88,67,248,228,98,172,204,171,155,85,69,47,221,191,63,250,2,112,200,203,47,5,0,167,178,16,139,172,101,6,222,255,131,15,241,96,243,129,88,31,24,215,7,31,242,237,191,125,192,15,204,207,10,141,231,87,17,16,21,90,39,240,193,135,250,142,126,96,253,187,242,54,15,77,254,8,72,123,55,85,250,56,82,182,251,48,0,242,13,194,196,93,114,134,228,224,97,228,12,56,187,187,201,133,77,223,174,120,23,64,212,213,29,53,225,158,215,145,77,42,223,208,118,123,119,171,164,249,141,168,5,66,212,134,50,210,217,117,164,171,163,5,42,114,244,27,54,80,171,61,133,209,134,254,123,2,131,249,129,61,30,45,41,87,29,143,242,162,131,247,239,79,189,240,50,74,45,20,90,101,21,4,72,216,188,79,152,79,120,127,34,210,7,68,22,182,196,22,7,59,63,252,240,23,236,33,1,84,112,254,209,29,244,194,191,201,65,77,10,146,142,142,249,161,149,205,135,150,183,246,251,69,78,206,170,88,103,103,119,39,208,182,179,51,222,121,164,51,126,32,162,11,254,13,69,70,42,61,90,205,24,16,67,199,59,145,85,186,32,210,145,238,78,184,196,187,187,14,114,52,137,27,14,219,24,40,42,52,160,221,13,220,20,118,227,68,25,168,224,148,85,7,228,211,21,239,110,63,0,72,212,22,21,20,228,229,231,229,195,233,241,148,181,69,27,78,95,187,199,45,171,107,215,164,221,123,243,218,197,179,117,197,134,67,74,26,126,117,63,67,28,242,242,75,117,224,93,92,152,83,16,166,82,169,131,47,0,200,111,63,248,237,111,127,251,1,90,191,69,231,7,116,79,23,229,231,246,18,183,21,152,109,28,55,228,116,62,112,61,83,14,229,251,91,149,140,29,89,229,255,175,57,57,185,173,237,132,7,17,26,28,29,134,254,104,227,25,14,43,90,71,187,219,224,64,211,214,173,28,228,131,160,202,251,114,44,78,37,251,253,241,136,117,182,29,192,71,226,171,176,22,24,21,158,29,92,36,72,187,189,192,3,166,160,110,79,176,184,180,164,164,160,200,91,23,106,104,59,13,77,223,31,24,145,117,243,106,34,17,23,157,206,253,16,0,100,233,69,224,15,98,145,178,64,48,31,56,68,191,71,88,191,24,80,241,55,255,249,155,255,252,207,223,192,15,174,191,161,147,60,236,131,158,154,39,226,41,79,85,60,252,240,247,155,172,216,242,140,98,171,147,159,186,243,208,249,3,32,15,53,35,49,197,116,117,118,182,107,90,73,153,193,110,224,23,128,11,4,237,194,128,4,158,68,65,62,193,75,35,198,105,208,145,201,213,160,168,28,214,73,29,236,236,234,96,196,36,7,43,51,9,6,215,142,174,182,54,206,1,241,40,236,184,72,115,19,111,254,224,226,233,206,88,93,192,27,12,31,57,123,213,140,188,3,30,137,40,49,136,119,221,58,226,144,16,0,242,210,75,212,208,122,169,174,56,216,233,193,17,137,112,88,167,31,214,28,242,27,54,239,255,198,50,239,47,247,124,223,220,194,229,63,190,249,248,35,52,116,251,232,227,223,250,214,191,162,39,144,50,231,113,126,72,193,254,21,204,127,188,47,225,223,183,82,122,127,153,109,57,161,169,150,91,27,137,198,186,187,144,162,93,72,215,14,139,122,92,108,115,23,14,67,136,54,134,164,147,66,119,209,13,219,49,245,150,97,171,10,186,223,31,45,8,222,174,194,68,12,232,22,71,161,87,59,21,7,210,45,244,228,230,55,92,189,119,83,148,55,162,114,245,116,103,168,98,93,69,168,243,244,197,107,215,224,201,213,139,137,209,196,217,170,178,242,117,229,136,198,58,192,164,168,78,0,121,9,216,36,226,245,198,21,135,152,130,132,133,67,222,7,106,189,255,190,80,237,125,114,202,249,190,122,164,238,213,229,95,31,201,250,38,254,200,147,223,196,79,130,143,171,48,191,121,255,155,252,224,209,175,163,23,97,162,206,223,124,75,133,81,89,90,249,127,43,39,39,175,46,20,222,35,117,30,233,122,48,162,169,25,49,160,168,107,7,227,209,69,149,87,49,86,91,87,27,198,109,142,216,244,15,175,244,254,224,110,192,8,58,69,59,116,216,206,181,131,211,239,42,243,120,242,227,191,6,162,3,30,87,201,70,88,238,93,77,116,134,202,75,214,213,29,132,180,66,96,194,225,16,193,193,144,8,135,188,8,104,144,241,150,37,10,129,67,246,184,234,22,149,6,154,189,111,190,207,230,61,115,125,79,223,174,228,122,255,159,31,52,95,228,81,21,230,61,19,102,213,63,171,104,234,242,117,112,189,231,202,210,220,0,142,158,58,40,26,213,249,174,118,36,117,71,216,101,26,194,246,91,236,57,208,14,66,13,66,138,132,107,231,90,204,12,19,131,55,142,24,210,235,247,199,36,34,33,149,70,7,68,63,8,215,80,4,3,216,114,138,140,138,4,130,173,19,115,1,53,30,228,70,21,155,171,70,149,159,237,172,43,43,42,42,41,46,41,35,83,78,194,106,157,112,8,235,16,226,144,151,94,10,22,247,23,231,60,198,233,135,92,25,17,32,239,189,247,30,209,136,174,250,124,159,125,222,67,135,241,127,143,104,253,200,55,31,127,252,225,21,16,81,233,188,255,222,155,160,12,30,226,25,13,111,178,231,251,28,251,189,247,31,55,105,189,247,222,143,191,250,207,118,254,0,72,94,109,40,28,234,232,36,66,119,226,21,137,21,86,150,185,134,208,17,106,230,96,109,157,24,150,130,119,114,212,246,14,20,89,225,176,29,56,164,211,32,191,16,193,128,209,14,202,3,149,15,135,12,169,24,24,242,32,39,91,236,241,228,157,190,105,33,97,25,144,93,253,109,117,235,188,235,202,64,113,176,234,32,56,240,90,212,118,255,126,250,5,225,144,151,67,69,157,62,224,16,85,50,201,13,175,158,156,156,127,126,135,73,243,158,186,46,187,125,199,237,9,242,234,97,246,251,241,155,111,126,19,160,121,212,0,162,67,191,143,31,208,125,129,53,128,201,87,221,233,254,243,227,20,230,29,14,11,74,35,231,171,223,250,15,21,241,111,115,114,242,65,100,133,129,180,29,157,109,221,36,39,66,33,67,36,77,32,69,186,8,16,9,155,85,16,190,187,189,187,173,29,227,117,163,87,119,71,123,68,81,148,163,134,220,239,31,226,4,64,198,116,182,117,40,111,141,153,100,164,128,11,133,219,59,186,177,64,192,32,37,163,74,86,93,189,38,146,235,154,146,95,32,202,226,7,67,193,10,108,88,33,38,235,72,100,193,89,116,20,250,33,194,33,47,190,252,66,73,83,0,154,189,92,40,204,51,164,222,46,63,39,231,111,223,123,23,15,48,239,189,39,39,186,229,176,28,242,251,49,81,94,130,188,251,14,199,248,143,55,233,99,160,9,253,46,78,120,12,213,215,251,8,38,149,52,70,250,234,227,38,221,247,222,125,83,38,102,61,251,38,165,254,120,78,206,154,186,250,80,168,189,83,14,56,21,165,228,167,40,199,118,68,24,162,67,34,180,73,52,64,230,160,170,117,97,83,1,117,100,5,75,164,157,226,42,185,159,69,30,203,201,61,65,232,152,231,213,197,111,26,6,177,192,208,108,114,54,222,16,170,162,143,181,4,6,90,101,69,137,251,247,79,191,40,42,228,165,151,138,234,2,57,249,42,241,144,228,137,166,20,52,241,187,239,188,243,238,59,64,194,119,200,224,221,187,104,191,249,173,31,211,131,119,222,21,111,48,191,4,243,247,72,192,191,255,249,207,127,254,163,159,255,8,79,49,207,162,55,221,194,3,48,192,54,165,209,88,16,231,224,81,100,78,229,221,119,254,3,239,41,81,242,253,23,205,93,15,127,245,91,239,188,131,128,212,66,185,186,59,200,180,163,181,71,21,54,172,139,109,189,65,135,101,218,245,5,227,51,104,42,100,216,142,166,99,135,59,56,108,104,143,241,179,34,185,3,131,11,154,188,37,13,157,87,149,74,71,22,161,139,125,0,92,23,143,70,195,193,117,197,101,44,176,0,147,226,226,204,253,95,189,204,252,129,50,171,180,188,20,0,129,154,87,79,136,212,227,21,111,67,213,64,136,119,180,17,226,163,33,178,63,78,24,252,252,151,72,253,191,7,98,95,214,148,127,85,225,112,153,61,47,179,183,184,209,124,41,39,167,32,151,102,102,63,251,35,66,8,146,249,229,47,223,121,247,171,192,71,239,188,107,144,254,151,55,255,229,205,55,255,69,154,109,216,150,94,79,28,130,100,109,103,18,11,81,246,96,137,9,156,122,250,213,11,32,24,174,93,133,239,16,7,92,162,154,142,245,22,77,247,40,47,54,81,129,210,242,178,158,91,209,234,217,15,186,32,117,209,166,171,55,175,94,37,20,52,22,10,149,171,44,197,110,94,59,26,110,10,87,130,46,33,56,214,149,23,87,45,221,95,122,225,37,209,33,47,190,28,88,189,6,57,196,122,19,177,234,65,198,191,9,68,167,234,143,199,47,249,242,85,105,54,105,22,184,252,168,139,21,158,53,148,23,135,224,116,217,21,12,205,19,151,117,80,176,95,69,62,2,100,84,86,191,100,231,223,26,70,169,2,64,234,91,52,141,219,64,21,104,106,81,225,45,55,56,91,8,133,246,54,198,161,91,224,105,111,13,115,208,122,155,198,245,38,9,182,34,16,22,67,183,219,36,9,101,103,97,60,74,60,158,213,77,13,13,113,144,75,26,136,44,135,48,206,181,35,225,88,180,174,172,140,53,72,121,81,236,254,253,36,73,44,98,145,151,235,10,11,132,67,200,210,25,213,215,231,129,248,209,116,97,10,65,101,126,14,39,85,99,27,233,178,170,243,207,229,40,146,18,165,191,100,40,47,46,195,56,151,37,2,53,122,159,120,213,21,234,85,92,120,165,229,218,47,53,50,0,136,39,15,249,105,85,97,16,84,79,168,25,232,218,74,148,69,209,131,5,174,151,82,215,215,107,66,209,37,6,20,109,237,208,124,209,142,241,58,218,155,173,247,212,52,54,72,168,107,11,177,7,52,5,40,15,3,148,201,75,238,37,173,130,92,79,101,83,52,26,62,122,205,2,65,11,176,107,70,130,1,15,117,134,27,98,117,216,250,45,243,150,149,149,156,190,127,255,168,180,121,177,107,24,90,157,159,147,175,222,73,50,36,19,90,3,10,245,231,132,7,137,38,225,8,104,210,122,74,113,69,149,22,77,143,230,188,46,174,215,153,117,108,50,47,151,100,16,236,209,47,61,251,170,117,79,161,95,167,182,178,200,185,203,130,11,194,242,247,148,97,105,225,218,64,85,45,146,166,185,149,41,219,113,176,3,21,46,83,171,94,19,185,222,144,185,1,224,104,111,109,197,138,14,161,15,82,140,152,34,161,121,225,16,191,112,200,229,31,131,176,29,7,219,91,15,182,54,24,32,36,47,131,93,189,201,63,223,147,23,106,106,0,68,58,117,3,75,0,80,63,81,240,160,73,174,182,53,0,34,69,133,248,81,164,108,221,18,246,211,149,78,127,241,229,48,0,242,152,188,142,74,156,47,117,64,160,31,35,87,216,116,3,185,242,208,250,170,32,212,216,87,133,226,151,115,114,158,83,196,103,162,186,225,48,128,88,126,217,76,244,163,215,121,97,226,171,217,254,63,255,57,0,146,91,81,89,89,93,21,172,173,11,215,35,169,128,182,240,107,135,95,88,215,31,109,91,184,132,41,12,254,144,178,16,169,57,98,234,156,251,212,21,81,222,63,162,98,182,31,12,27,188,228,97,189,206,203,138,230,241,20,52,196,162,13,13,128,200,53,165,71,20,107,184,101,22,242,72,91,56,10,136,20,20,65,47,100,15,14,190,191,164,250,133,47,189,188,167,48,15,57,4,147,15,115,78,84,237,192,174,7,170,63,103,200,35,130,5,200,83,93,191,198,210,210,95,66,41,101,11,35,23,177,47,51,136,42,165,203,89,88,92,182,213,204,67,46,62,114,229,24,8,6,171,107,107,107,145,4,205,64,164,118,38,243,193,72,189,38,142,150,65,86,109,110,149,96,120,137,69,195,33,23,10,124,9,91,41,104,119,40,124,80,197,108,5,208,37,221,172,156,20,18,181,228,31,4,64,104,178,68,67,67,195,17,197,26,202,160,251,7,246,45,34,210,16,13,148,20,22,120,75,166,160,141,245,34,163,241,34,141,102,173,206,99,145,37,104,88,246,90,144,219,151,221,146,5,201,243,80,201,26,214,221,151,181,152,82,204,130,232,16,47,92,126,245,217,47,61,103,197,17,93,191,156,65,200,60,71,156,149,159,171,0,113,61,134,12,30,14,214,213,214,213,213,113,185,98,173,68,168,3,173,7,15,28,136,82,57,235,84,225,107,149,205,142,122,8,119,224,96,75,115,44,18,14,213,214,213,91,166,182,214,190,171,83,145,84,152,208,1,130,130,173,80,189,59,19,147,85,173,117,231,247,120,10,155,120,246,74,67,184,227,226,77,27,143,229,230,7,215,80,143,68,189,37,5,249,161,251,247,19,220,198,146,174,250,158,34,15,244,128,57,199,58,147,49,188,126,93,45,84,217,103,93,13,33,144,240,178,230,249,17,133,193,19,57,22,58,116,251,236,115,79,60,108,171,113,3,200,229,31,45,107,129,129,253,44,133,206,45,44,203,181,218,98,216,68,64,243,250,171,0,200,67,65,40,13,21,9,10,21,193,77,245,90,225,7,128,68,16,40,160,110,45,88,8,89,29,58,234,200,179,14,232,139,188,78,78,126,196,129,235,36,36,36,133,105,170,8,18,9,47,161,22,202,160,149,247,1,140,212,202,99,202,71,130,83,18,58,73,240,47,134,94,72,83,148,56,4,244,72,244,244,53,65,228,7,15,128,228,230,181,126,64,174,188,172,192,251,171,37,221,39,36,199,158,213,0,72,61,21,144,222,153,223,187,150,48,89,179,50,139,32,30,46,61,158,243,112,118,109,39,64,46,187,56,36,59,33,186,127,245,57,30,92,89,149,183,118,125,69,174,91,100,153,113,176,188,42,42,29,149,169,46,106,109,139,169,137,69,69,183,232,132,119,245,26,35,34,90,157,49,10,32,21,165,182,206,16,185,174,54,236,218,210,178,37,194,40,215,186,99,215,215,90,208,192,175,200,227,241,198,26,8,15,212,35,225,248,213,108,38,201,130,230,218,205,139,109,13,222,50,111,97,81,72,119,10,121,0,158,0,161,10,88,43,111,86,43,37,173,13,2,139,124,201,93,173,47,255,232,245,39,30,253,210,171,151,149,7,208,19,247,108,120,206,10,242,234,19,204,69,63,90,89,100,89,61,196,231,132,221,86,121,214,148,120,253,213,249,86,39,230,178,13,72,105,144,104,11,181,4,74,21,177,182,109,139,104,2,41,178,214,91,53,93,85,225,58,141,75,157,212,188,58,170,236,200,34,10,197,90,205,74,17,123,179,63,112,69,4,222,108,62,50,0,225,163,213,30,79,128,69,86,3,105,146,112,91,226,230,205,191,32,180,174,93,29,191,216,89,12,205,222,117,171,243,138,246,188,252,242,75,186,31,178,167,48,23,68,86,173,206,70,179,60,186,215,88,205,163,236,26,174,123,30,133,64,200,135,47,187,196,208,235,175,62,247,236,179,90,250,16,32,79,88,42,93,179,215,42,217,110,163,164,212,231,171,174,126,12,1,49,217,228,172,130,230,241,115,175,66,15,125,77,80,203,27,16,89,122,123,165,150,230,8,87,93,11,0,85,217,229,192,135,213,74,74,137,188,146,7,181,42,128,29,1,240,176,182,133,162,77,175,34,22,184,90,28,42,91,231,95,232,241,132,112,81,73,67,40,88,233,173,10,6,65,240,197,47,222,188,41,234,92,203,144,162,233,0,0,32,0,73,68,65,84,184,227,162,184,224,122,49,113,54,94,85,4,125,17,111,121,217,234,130,210,23,94,214,114,43,226,241,228,60,166,10,39,151,106,201,167,182,26,58,135,171,94,255,209,3,13,118,30,242,214,151,175,98,122,91,200,185,244,196,101,234,158,88,128,62,161,66,60,129,77,132,245,165,101,235,253,240,14,181,138,67,220,237,99,192,60,15,91,88,172,38,128,67,154,120,193,57,46,240,139,26,52,106,221,212,146,159,161,120,22,253,77,165,99,35,158,245,81,222,133,161,201,236,216,17,182,85,147,129,193,196,161,187,2,79,126,40,26,170,173,242,150,149,20,151,149,148,21,23,151,149,21,87,132,142,94,52,114,235,162,205,30,23,19,241,134,114,8,227,45,67,11,90,91,190,23,104,214,9,88,193,252,199,114,242,21,0,156,141,202,174,182,54,224,127,216,82,35,151,213,240,148,174,251,80,123,31,42,43,15,20,232,102,109,86,7,227,178,209,6,143,218,124,165,91,211,184,246,188,218,87,81,133,157,12,3,136,11,91,108,246,86,5,21,225,170,107,195,102,97,127,115,164,154,232,129,21,168,218,20,223,188,131,54,117,230,73,181,198,150,146,99,156,170,217,35,18,179,22,234,51,40,177,136,73,86,165,97,1,172,146,46,205,245,20,84,0,24,197,72,97,50,224,42,42,170,234,95,169,189,69,112,148,32,20,197,28,176,188,120,117,161,175,46,18,121,49,18,10,150,134,10,16,144,149,77,176,106,13,183,168,46,47,111,179,94,38,60,114,214,120,125,85,85,160,142,87,189,186,188,183,103,171,231,71,45,255,231,30,86,161,158,192,85,81,193,106,96,15,48,89,34,203,2,173,186,218,148,41,164,151,241,33,135,124,97,83,253,0,183,101,160,179,102,173,15,87,123,13,68,178,131,87,175,152,8,206,54,41,43,87,80,148,17,46,222,178,162,226,54,26,110,188,200,12,194,92,50,26,223,227,45,41,230,112,2,160,119,93,73,81,81,73,25,238,64,83,87,231,201,201,171,125,48,34,88,251,87,189,186,162,10,193,22,111,193,250,10,144,54,21,171,140,104,115,247,199,141,200,114,117,45,158,83,202,6,158,132,67,242,110,107,13,108,151,45,38,1,216,215,6,77,145,234,173,101,232,17,93,78,227,8,46,127,137,149,222,44,144,21,36,88,23,49,72,199,172,101,201,209,7,39,130,245,40,40,79,113,194,73,126,145,151,145,40,43,214,184,148,132,206,94,21,237,142,227,41,87,199,207,198,67,200,29,58,132,66,197,75,114,14,152,166,24,148,122,208,206,51,88,91,173,114,15,6,170,171,9,145,231,220,189,17,60,95,71,254,200,247,251,2,193,64,176,122,141,10,180,34,147,168,150,241,101,173,84,52,139,64,43,109,77,72,178,43,113,195,166,53,14,100,3,175,14,93,117,200,169,54,88,111,173,116,141,218,16,4,93,0,4,197,63,200,65,232,46,40,129,131,181,234,78,199,170,11,175,176,224,153,80,137,4,77,250,230,52,192,139,171,42,31,167,100,173,70,2,51,36,194,39,197,37,229,209,211,216,202,133,118,213,217,211,241,206,166,186,50,230,14,13,135,101,177,23,52,123,113,100,2,55,116,162,109,157,170,233,82,45,191,170,74,218,127,236,209,87,179,251,35,216,223,240,248,215,87,96,160,0,137,54,104,34,95,94,65,100,93,254,145,187,21,12,15,87,233,30,224,115,160,178,195,8,41,36,179,214,6,228,178,107,112,160,58,200,69,4,66,212,217,139,142,153,216,65,178,44,130,7,130,6,144,160,162,31,91,240,80,5,150,240,120,19,201,94,230,252,130,94,165,27,169,213,16,40,48,172,188,130,38,255,82,128,36,55,191,184,28,193,176,201,92,92,226,13,117,30,5,36,202,189,235,224,166,164,88,203,52,237,42,230,86,0,7,47,246,96,5,12,50,30,140,137,56,217,174,170,88,67,51,18,104,180,92,145,233,245,47,209,96,135,119,189,143,55,231,170,170,44,194,64,171,158,189,188,108,168,106,165,49,199,71,153,69,94,127,130,180,80,132,232,28,138,120,53,32,151,237,102,1,74,60,41,23,22,169,78,22,109,211,154,78,34,174,121,134,118,173,208,7,93,129,160,137,88,29,204,54,18,33,8,220,17,229,133,210,188,208,214,94,154,27,141,69,178,162,4,130,181,246,77,80,186,36,232,46,244,228,231,19,147,8,131,40,21,15,144,172,43,46,42,1,83,92,34,74,191,216,37,215,180,234,33,23,1,18,176,114,173,182,243,175,14,86,227,134,65,212,97,120,226,57,234,125,191,250,28,193,177,170,192,239,175,8,48,103,5,170,124,94,15,127,229,120,125,153,186,185,252,40,3,98,90,107,32,133,158,123,142,135,76,64,169,71,66,97,90,35,89,238,86,253,218,133,43,175,145,160,92,198,58,179,208,53,22,163,178,6,76,241,171,221,229,231,187,128,11,128,160,5,19,60,171,13,69,212,154,220,88,84,175,175,214,110,176,40,116,181,137,95,29,176,168,84,29,140,68,117,208,18,79,113,217,106,79,97,145,75,22,33,149,1,136,98,45,196,4,4,3,71,113,153,155,105,114,69,100,85,179,85,173,94,66,222,171,186,170,218,187,126,205,242,157,226,60,107,189,21,222,64,149,34,66,117,197,250,2,238,120,175,122,252,217,87,193,80,231,240,217,103,159,120,244,209,71,87,217,34,235,178,253,205,16,184,172,22,151,58,243,122,76,26,166,180,26,214,151,33,137,39,30,69,220,124,134,190,181,246,194,53,139,254,213,234,180,111,141,165,111,12,57,161,237,86,111,175,65,179,87,60,55,186,242,168,206,170,173,213,234,165,193,178,22,192,21,230,55,4,202,11,60,37,12,64,153,27,128,101,124,161,48,41,179,3,225,1,173,172,42,160,58,146,182,10,179,170,174,194,155,42,34,53,186,131,85,213,126,111,105,81,174,107,43,197,220,194,245,21,62,127,96,67,85,53,240,72,160,42,0,225,188,190,178,252,85,15,152,39,135,35,235,175,50,66,8,145,124,39,95,149,155,191,214,95,31,86,139,143,162,10,182,215,95,127,246,217,47,61,106,165,149,15,192,87,97,201,130,85,181,1,89,118,70,235,249,130,148,127,85,85,96,3,182,68,130,1,12,87,93,5,77,17,32,85,85,245,134,224,134,42,16,244,40,187,224,53,224,22,238,249,25,53,179,66,106,21,148,181,180,77,47,113,139,170,39,81,164,77,245,134,218,13,27,32,163,90,56,224,93,225,82,11,233,212,194,131,96,56,170,215,182,21,172,110,104,8,21,174,110,8,64,143,132,116,5,193,82,130,122,163,88,58,139,197,200,46,10,142,98,244,47,49,80,32,142,128,38,136,44,204,179,138,145,168,82,142,106,62,249,240,251,214,151,149,20,202,142,98,171,114,61,107,215,251,188,62,175,159,227,65,56,138,226,247,175,47,45,204,93,9,147,135,150,51,88,110,174,39,127,205,154,181,101,235,125,245,106,233,30,174,251,125,246,209,71,151,5,125,56,223,231,199,82,113,249,170,245,154,63,160,102,173,157,127,149,122,13,253,58,65,118,108,160,250,166,194,224,89,91,31,50,116,212,249,219,208,152,245,132,28,201,228,95,173,201,66,86,88,214,203,66,208,252,162,104,56,86,180,58,22,13,239,169,11,96,51,182,68,72,78,7,193,66,22,250,138,55,223,170,112,252,72,56,68,222,197,149,89,149,70,36,224,3,72,74,75,214,150,150,150,21,175,95,239,43,6,117,94,161,112,83,229,5,68,202,215,151,174,93,91,144,155,251,16,154,92,104,7,230,230,21,20,20,150,172,95,159,61,153,49,191,180,164,180,180,164,108,189,215,239,171,170,174,15,243,58,189,181,89,129,86,61,132,176,65,116,111,165,162,113,96,67,117,196,90,198,87,91,69,252,193,152,0,201,55,4,185,68,27,224,54,176,1,24,3,248,28,170,246,6,124,173,224,6,166,105,109,125,56,170,23,3,70,172,117,131,214,154,78,251,41,164,132,185,4,152,62,27,130,85,144,96,149,74,172,42,208,16,81,11,16,35,121,222,134,112,180,160,48,26,14,227,24,60,116,55,74,44,146,51,42,12,68,137,60,209,190,18,130,61,115,115,30,171,210,28,178,65,33,64,47,17,216,192,238,234,170,13,129,74,159,119,253,250,245,165,72,200,210,245,94,111,5,200,171,128,138,87,29,224,88,1,191,23,42,115,101,37,134,36,227,133,144,254,170,10,136,154,7,32,229,146,241,228,63,86,0,80,192,51,159,183,34,224,167,42,16,172,11,133,121,25,157,0,225,201,243,20,174,89,83,180,166,104,109,73,201,122,159,223,95,37,121,65,129,34,214,226,204,106,44,48,151,80,85,38,46,145,42,27,197,0,107,3,82,149,216,191,170,58,172,151,65,17,209,159,87,107,4,93,11,13,245,115,224,194,106,149,88,85,128,115,192,212,85,141,13,233,24,209,130,178,134,80,40,127,117,20,247,141,131,95,121,177,34,181,205,39,194,32,197,197,194,48,37,89,28,82,130,28,82,189,129,213,0,191,199,6,168,96,120,27,0,60,54,96,33,224,62,176,193,31,240,251,125,126,47,209,209,239,5,66,66,176,0,248,99,28,136,15,210,25,240,171,12,4,234,235,235,81,128,7,177,224,220,100,175,11,87,249,189,222,245,101,107,75,214,22,209,127,159,149,150,122,189,62,72,165,210,23,128,170,143,21,24,162,130,76,169,171,95,251,216,154,66,132,28,25,109,173,128,239,3,54,10,80,48,168,2,96,9,217,246,224,133,213,23,209,137,146,193,2,67,177,209,13,14,122,43,126,130,176,80,253,130,135,245,214,154,196,108,179,39,194,9,91,6,88,12,42,231,134,13,2,6,226,141,111,76,165,6,87,216,172,164,43,41,88,87,82,150,183,58,138,179,76,163,161,178,18,205,20,174,67,144,48,224,148,216,204,3,54,139,44,197,35,74,98,25,105,85,37,170,5,221,149,190,202,74,250,85,89,66,91,68,22,151,87,230,101,234,207,211,245,52,37,178,218,71,144,148,194,81,134,140,83,225,197,52,170,44,249,72,103,37,226,13,6,160,42,37,246,90,239,7,238,194,25,14,86,70,97,189,242,46,18,169,93,150,191,93,116,37,76,171,44,95,60,35,127,193,68,117,226,138,210,65,171,132,85,218,161,223,63,164,23,193,133,107,61,160,161,11,242,194,81,224,143,186,178,18,173,44,92,128,24,49,150,5,133,22,91,200,33,1,243,90,1,11,3,170,3,44,143,68,149,84,227,157,42,142,136,85,121,105,50,181,106,33,150,76,224,151,197,97,245,149,64,108,192,164,220,15,182,175,194,71,104,4,170,52,214,44,2,64,216,249,16,5,218,137,197,235,175,0,208,32,158,146,86,1,5,121,20,23,59,97,219,12,72,80,45,202,165,90,211,170,218,210,128,181,6,23,41,40,61,161,66,2,217,48,9,180,193,130,51,138,197,37,151,94,43,21,197,107,173,75,157,86,91,34,146,94,60,20,197,15,197,65,74,58,175,192,91,92,228,41,9,133,27,234,140,186,40,54,98,201,6,192,214,30,70,207,40,14,169,36,238,11,84,86,249,145,44,130,68,0,219,136,64,13,127,128,154,80,200,32,85,149,254,42,127,101,128,130,64,156,0,88,224,174,70,15,8,13,225,194,102,245,151,189,210,40,28,12,32,117,43,33,2,177,23,202,18,136,84,73,18,7,211,175,242,147,116,1,238,3,196,192,198,112,213,152,98,32,0,89,86,33,46,164,164,32,104,40,172,151,253,69,234,252,76,99,122,138,86,101,53,134,6,129,10,86,101,101,125,53,188,82,53,200,81,122,8,137,96,195,3,222,74,149,42,172,150,23,90,171,13,195,106,245,160,60,140,4,169,184,82,86,72,175,138,74,139,201,210,75,131,19,127,216,20,173,90,13,61,195,226,252,188,178,10,47,118,204,89,79,24,49,37,68,23,178,171,231,42,136,113,122,114,30,19,50,97,125,172,38,89,2,196,194,10,73,53,20,153,2,169,195,244,196,131,46,120,15,101,224,23,69,170,97,180,144,198,65,175,249,226,87,11,1,169,232,125,128,192,152,26,198,71,250,5,144,45,40,227,0,6,128,180,24,128,74,41,75,160,218,175,242,247,99,52,63,9,69,189,24,173,22,60,48,193,106,78,181,178,146,110,42,171,196,167,174,158,95,168,90,202,13,175,22,192,96,245,238,165,162,145,136,89,234,99,150,25,170,149,83,216,219,128,20,170,36,29,33,19,190,110,37,63,169,228,2,66,174,165,56,112,178,218,83,100,53,160,74,76,19,23,59,235,90,135,232,166,151,86,242,218,13,61,245,16,23,184,218,175,42,49,189,95,37,91,126,118,248,229,221,252,80,4,159,188,162,31,14,140,0,116,174,244,129,111,221,178,149,95,218,170,21,116,41,166,223,71,252,226,247,35,121,124,82,17,56,253,74,36,37,185,253,88,12,49,88,50,201,191,50,100,173,40,172,99,16,232,87,237,147,18,115,129,241,61,130,97,121,13,74,203,143,5,102,162,90,139,115,34,150,100,181,215,170,233,210,215,86,98,45,170,164,151,228,202,19,168,100,188,85,198,92,78,124,146,231,41,130,142,93,190,33,174,33,120,73,49,126,241,80,18,74,233,151,101,202,4,158,3,135,132,67,162,171,241,226,103,183,186,197,60,125,116,239,51,15,124,74,185,87,250,217,159,30,7,237,133,94,217,11,191,130,18,200,103,165,236,202,201,207,228,247,249,178,243,175,116,231,95,111,37,93,171,252,249,226,51,105,6,208,174,2,196,76,134,146,191,223,7,77,193,101,197,116,21,214,126,184,167,150,104,18,224,100,252,217,239,15,62,62,182,40,255,124,79,73,249,234,220,162,50,155,13,52,179,172,46,40,98,46,177,117,138,173,73,74,164,99,88,16,10,215,249,193,4,40,159,128,223,167,75,238,247,35,161,252,88,69,252,216,238,13,80,193,192,195,79,245,144,26,174,62,244,194,251,234,80,216,44,63,10,219,171,204,240,5,247,108,128,52,165,78,65,62,144,137,31,43,45,166,142,41,98,166,148,127,128,18,11,64,97,192,246,249,3,92,37,40,36,147,164,206,202,161,30,136,11,161,2,88,84,102,13,108,155,7,84,157,170,14,239,161,120,152,22,22,22,173,0,196,240,111,216,99,202,25,50,139,167,66,166,204,161,61,202,85,91,169,13,214,25,31,21,78,101,230,15,48,49,124,228,7,167,199,83,84,158,239,41,91,169,189,11,60,82,88,80,98,41,15,119,223,196,226,144,124,200,184,62,128,4,199,204,48,109,196,128,137,5,239,135,116,33,77,139,33,8,30,112,250,43,253,82,156,0,131,19,240,243,202,176,61,102,145,152,245,178,120,165,55,65,202,123,25,91,236,206,80,74,62,22,41,152,63,66,19,160,180,129,204,94,206,26,50,247,121,241,129,23,243,175,172,181,86,249,213,83,112,44,140,23,66,123,185,68,96,121,189,1,34,27,214,52,200,214,11,9,66,183,199,139,181,0,154,111,144,91,189,94,118,21,118,225,97,22,15,106,187,22,35,122,165,76,64,29,196,92,178,133,220,188,149,244,74,152,39,122,248,171,61,158,213,197,158,188,226,178,226,101,125,113,28,189,90,93,176,90,183,132,181,210,207,106,112,1,32,184,88,165,22,91,164,94,63,189,21,94,125,228,226,91,114,4,252,244,212,75,13,161,0,251,67,199,28,2,250,40,8,190,219,30,89,203,18,86,107,141,246,88,43,192,234,49,18,18,149,50,178,82,199,158,166,202,215,231,13,84,74,57,188,76,71,52,149,222,74,46,26,4,168,181,48,174,87,169,224,115,31,59,57,131,0,122,121,65,188,85,115,226,62,44,50,161,11,164,11,120,171,4,10,215,114,182,112,40,100,22,29,106,239,122,70,67,168,83,233,245,42,240,43,185,186,162,27,61,42,249,101,42,60,158,130,34,79,126,73,153,213,126,210,228,71,95,211,204,53,237,44,87,167,17,69,22,230,94,203,239,204,25,11,33,188,94,69,61,175,95,61,85,7,19,85,61,172,172,207,90,18,167,95,79,221,65,125,174,244,114,12,191,206,72,178,114,231,240,151,243,175,213,75,152,194,161,58,243,208,203,69,178,74,8,166,14,89,196,242,49,249,215,187,87,179,153,149,108,33,189,222,77,22,249,213,125,161,247,55,249,87,230,121,242,10,242,160,189,165,186,222,210,132,210,99,138,166,217,101,55,139,75,116,168,92,20,89,196,255,32,219,177,46,161,141,67,27,80,245,145,1,240,130,247,62,170,200,62,9,163,126,24,0,92,149,178,10,41,108,86,38,241,154,22,243,170,56,93,220,207,49,188,148,158,151,147,244,249,249,160,156,144,49,49,65,159,191,194,75,25,209,3,102,29,31,221,250,130,154,84,144,166,4,166,146,32,187,250,249,158,202,12,22,130,71,60,76,97,188,252,102,20,39,32,75,216,246,40,107,79,104,5,3,170,4,64,167,36,57,182,95,149,214,203,57,120,253,146,63,190,149,143,115,247,173,246,120,240,47,236,139,202,132,198,37,210,61,44,66,32,138,136,246,69,133,171,121,124,190,164,200,176,11,125,81,44,43,2,64,100,245,67,93,165,159,223,218,171,95,209,71,148,240,49,241,229,226,151,119,242,18,86,68,40,111,189,89,13,103,173,22,171,55,203,193,216,212,249,124,10,9,13,48,97,239,229,42,224,243,154,84,253,42,115,175,192,193,185,250,130,106,73,96,61,208,144,115,247,75,122,82,95,164,254,64,164,106,200,186,214,167,146,19,122,241,43,98,13,218,83,47,41,185,33,216,227,130,167,78,210,245,250,124,38,190,79,193,225,229,138,66,53,75,61,246,21,231,121,104,202,131,250,198,65,40,16,42,170,139,82,82,0,160,97,163,171,172,204,234,52,2,26,171,243,60,15,161,200,18,2,86,81,13,210,50,28,239,24,21,93,155,189,146,179,87,232,72,213,209,91,191,12,12,235,162,193,66,30,169,36,202,16,137,189,186,138,81,50,194,136,94,191,201,223,231,213,110,126,115,116,4,237,12,136,223,176,130,138,30,98,124,164,34,129,176,199,80,94,170,215,162,170,152,205,32,233,90,123,201,32,46,221,212,171,219,164,122,242,106,206,61,160,92,125,154,197,20,9,132,61,124,236,36,222,228,58,224,101,250,249,75,8,145,252,130,66,234,14,150,16,103,16,51,20,227,5,120,165,172,164,48,159,2,172,46,42,34,40,16,153,213,4,228,95,250,7,149,191,154,191,154,191,154,156,156,234,191,146,224,175,128,252,213,252,21,144,255,31,1,114,151,204,210,93,151,89,210,191,165,101,254,202,90,114,199,187,115,103,233,206,157,187,119,200,117,231,78,230,173,76,230,246,237,219,119,192,202,224,113,227,70,230,86,230,6,94,110,136,65,55,252,174,167,193,157,190,145,89,32,147,89,72,145,43,147,78,227,37,141,199,60,29,115,233,84,106,238,202,252,149,84,250,74,26,204,21,56,230,82,233,212,92,106,38,61,147,130,3,46,105,184,159,193,155,217,116,122,134,205,37,250,93,74,93,154,157,133,203,204,212,204,212,20,132,152,154,117,156,233,137,233,233,137,137,105,60,46,77,77,76,78,58,206,228,196,148,3,215,75,19,19,83,227,83,227,227,224,158,152,152,116,166,224,110,194,153,132,167,224,15,33,156,41,60,208,127,26,44,120,0,126,248,4,31,79,77,77,142,143,129,61,238,76,141,77,142,141,143,143,143,225,49,230,140,141,39,199,241,116,146,206,40,222,13,143,143,38,147,35,163,206,232,168,147,76,14,15,39,135,71,28,103,112,48,153,72,14,39,75,25,144,37,77,239,37,155,200,75,198,119,201,32,176,148,5,219,45,246,191,163,77,6,142,219,183,223,186,125,251,22,32,114,27,113,185,253,86,134,128,184,133,118,102,17,145,80,7,193,1,63,192,226,6,252,0,142,52,254,8,13,0,99,126,97,126,158,241,128,11,66,130,120,0,233,1,24,70,96,46,77,136,48,40,104,17,22,179,104,195,15,96,64,255,25,128,2,79,186,56,147,51,83,19,179,19,51,132,6,96,49,1,68,158,96,218,95,154,184,132,8,224,1,152,0,34,83,19,227,83,83,206,248,20,35,227,140,35,249,167,32,2,210,127,2,241,24,159,132,112,136,7,131,5,241,156,113,136,58,229,140,97,10,83,100,129,211,73,142,57,132,8,2,68,232,140,2,34,35,201,81,56,134,7,135,29,128,34,9,136,56,195,0,200,45,27,139,101,220,178,2,131,72,216,37,219,155,224,64,239,59,196,31,119,16,132,204,157,91,204,29,183,23,51,192,48,8,135,96,144,225,31,31,105,224,145,244,2,64,146,185,193,60,178,32,96,192,193,204,129,88,128,69,12,2,92,65,252,145,158,153,3,238,64,48,210,132,8,195,146,98,28,8,2,197,36,204,24,12,7,59,102,157,201,89,225,142,75,98,59,83,64,203,73,160,35,65,0,32,77,64,29,31,159,80,204,2,190,72,253,9,116,0,7,92,66,46,64,216,128,63,0,145,49,244,132,144,232,141,158,136,197,24,198,3,22,1,27,120,2,48,0,20,198,1,21,192,197,65,206,113,0,138,81,7,48,113,134,157,193,228,32,225,1,44,146,252,10,114,136,166,238,146,75,92,177,255,210,221,229,156,225,130,130,252,53,111,240,229,54,139,171,59,196,29,36,175,222,2,4,50,44,169,228,98,73,47,48,64,125,97,16,5,201,60,74,43,228,15,226,144,20,216,87,174,0,103,160,204,154,193,19,185,3,109,146,85,36,177,136,71,82,204,35,132,201,236,244,44,224,144,102,238,152,154,162,235,212,204,228,204,100,106,114,114,26,36,214,52,240,196,228,37,32,63,84,115,166,253,212,228,228,20,179,11,224,1,156,1,4,30,155,0,54,64,202,98,213,159,160,167,206,4,60,26,39,174,32,246,24,155,64,20,193,103,28,225,26,131,135,240,27,27,103,76,198,167,146,227,200,29,99,192,29,227,73,7,161,1,201,5,22,48,135,51,226,140,36,137,63,6,7,135,146,128,200,112,169,210,33,104,110,101,115,196,82,22,63,44,185,220,130,197,45,194,131,173,59,111,33,38,40,169,132,75,16,13,86,28,153,91,55,8,147,204,13,37,173,136,61,110,164,211,104,9,22,136,70,58,77,2,107,97,14,5,86,154,241,0,115,5,185,228,202,28,9,44,176,83,105,228,144,57,228,143,25,205,29,120,153,157,5,44,102,103,132,71,102,217,165,4,214,212,212,236,212,236,36,156,179,32,179,136,57,144,9,68,109,160,12,66,58,67,133,159,4,174,192,3,228,63,66,0,250,5,68,16,18,31,252,132,29,166,198,198,16,139,73,228,40,22,115,4,40,49,5,50,21,221,58,130,201,24,169,16,100,145,49,208,39,136,200,240,56,232,16,16,89,35,35,196,35,131,195,200,38,160,77,0,144,165,108,221,97,147,125,37,57,182,148,45,200,80,157,223,37,141,78,44,130,130,234,86,70,105,243,219,25,150,80,138,67,92,138,157,13,49,199,13,98,13,209,237,44,180,22,144,65,210,138,71,128,63,230,81,151,95,33,137,53,199,34,75,137,171,89,230,140,244,52,0,227,16,20,211,70,90,17,24,204,33,200,32,179,211,147,169,137,89,96,145,169,73,96,144,73,37,136,80,19,19,73,145,186,206,196,152,131,212,116,144,238,64,208,49,18,66,68,107,240,159,96,46,64,89,69,250,2,144,67,78,97,8,38,65,46,77,141,49,111,144,82,23,48,80,187,163,83,52,200,40,114,200,8,112,133,51,60,136,152,128,200,114,64,153,144,200,146,42,127,203,197,42,217,92,114,215,214,236,164,200,21,108,220,186,186,35,218,67,196,212,109,100,144,91,168,205,129,252,183,149,164,202,40,254,200,16,76,200,28,112,46,220,88,4,234,3,34,41,81,30,132,199,60,240,202,124,154,49,73,207,51,14,87,80,101,144,228,154,67,145,69,10,36,197,50,139,36,85,154,101,21,223,161,107,86,177,199,148,72,173,217,233,169,89,104,31,129,200,66,14,193,22,19,168,134,73,16,58,99,172,222,145,17,144,57,240,28,67,13,0,55,14,235,4,68,96,18,107,62,4,29,3,63,208,7,227,19,172,198,1,131,9,226,11,230,43,64,43,137,96,2,10,168,52,198,89,78,161,208,130,71,228,30,6,105,133,74,125,100,4,197,149,51,60,156,0,56,64,120,13,34,32,186,137,117,75,161,225,210,37,63,89,169,73,252,19,58,233,71,45,93,190,176,196,2,97,197,74,157,229,21,92,64,157,223,82,186,67,174,228,184,206,112,32,26,138,59,210,230,96,198,96,30,73,165,224,76,163,254,64,100,82,115,36,178,210,164,45,16,147,52,161,130,32,76,43,157,62,147,186,4,237,91,106,247,42,149,142,248,76,77,206,130,230,70,5,50,53,141,2,31,219,176,212,98,5,237,12,50,11,88,129,84,242,20,66,50,69,237,37,230,12,4,104,124,140,105,140,254,19,99,196,33,168,247,137,75,198,28,150,80,99,83,83,172,200,145,107,224,68,174,64,44,198,149,208,66,229,129,76,50,12,173,94,224,16,84,33,195,208,228,77,162,204,74,142,14,126,69,116,200,146,221,210,66,106,255,68,157,238,190,135,251,74,220,177,4,173,41,193,225,150,224,64,54,80,252,45,171,109,155,81,39,233,12,18,80,172,193,193,94,212,45,43,18,79,216,184,2,157,113,133,225,144,223,21,244,160,46,8,128,145,38,97,149,86,77,44,87,163,106,198,210,26,40,160,38,136,246,72,125,80,213,206,212,37,106,184,78,114,195,105,124,130,170,244,148,136,122,144,237,88,217,145,57,0,7,82,194,80,173,169,177,74,148,68,47,135,41,139,237,218,36,210,156,164,28,212,125,210,226,212,164,34,166,32,85,193,130,74,162,66,188,209,17,104,77,141,224,13,226,129,252,49,146,28,28,69,45,34,109,172,68,146,117,136,187,141,165,170,253,29,58,72,16,113,39,67,188,248,188,171,154,85,212,164,130,238,198,29,210,23,120,3,34,138,80,88,100,52,22,129,19,72,56,45,42,70,200,32,237,181,238,54,154,59,141,253,190,116,90,137,39,34,118,10,127,169,217,212,220,28,136,169,25,208,226,51,32,183,82,115,142,133,192,52,67,2,130,106,114,102,134,206,73,86,32,216,175,128,86,20,181,98,229,160,27,58,145,90,19,19,12,4,139,122,22,239,92,157,153,186,220,88,165,38,146,60,29,67,231,24,63,31,27,99,151,132,213,250,130,176,196,208,216,5,132,99,120,156,175,227,195,192,19,32,168,128,23,70,161,89,149,36,24,0,33,224,145,4,194,129,61,195,175,72,63,196,234,119,255,228,174,234,74,176,236,185,69,199,237,91,183,88,47,80,11,10,110,238,168,91,164,255,173,27,183,111,81,253,95,100,141,157,190,113,253,6,105,133,133,133,235,104,45,66,7,111,129,219,74,64,117,160,237,149,43,164,159,103,240,64,153,51,63,51,63,3,39,209,27,14,109,82,114,200,9,202,60,157,22,150,32,97,52,3,253,187,9,178,184,243,128,2,100,82,81,89,81,116,124,20,5,16,52,251,177,111,204,52,22,123,104,28,218,157,36,201,7,233,154,28,228,3,168,53,130,114,100,112,116,144,127,120,142,14,146,51,41,1,200,193,231,136,242,197,211,36,66,17,70,71,209,26,76,192,9,4,79,144,5,23,185,194,49,136,125,117,12,79,144,88,28,162,52,5,214,125,32,62,138,153,235,112,160,89,188,177,178,1,146,179,197,180,39,154,51,221,201,204,144,53,3,4,158,7,130,207,205,27,98,79,139,53,167,136,10,135,34,47,223,9,133,153,222,88,183,73,42,17,211,204,64,83,10,60,29,33,250,200,248,69,32,43,88,224,26,31,132,131,44,112,163,173,12,210,28,222,218,129,99,16,235,232,232,136,208,99,4,14,56,71,19,68,37,49,201,196,80,2,78,62,18,78,130,111,19,250,58,132,254,76,87,242,30,150,200,66,111,142,70,129,148,121,131,78,114,208,245,13,188,82,42,8,61,245,67,146,84,160,82,75,169,163,180,2,13,126,7,193,64,218,94,89,102,126,144,117,191,176,48,179,48,115,21,41,14,103,202,212,235,9,117,76,16,73,127,192,132,37,131,36,60,167,107,176,118,142,208,111,144,137,138,52,29,25,31,25,28,25,97,138,18,141,161,243,197,61,14,224,13,72,5,253,129,146,35,68,80,71,185,6,19,76,95,114,129,97,155,233,114,6,14,38,205,128,156,112,156,73,12,128,45,230,13,248,157,161,147,126,253,3,3,231,216,133,118,191,252,248,14,31,178,209,14,121,198,174,51,228,223,175,66,192,121,230,12,39,122,166,31,238,250,251,249,110,0,202,70,204,53,76,2,107,80,122,234,134,59,64,92,33,115,44,92,249,193,12,81,240,226,196,15,176,251,57,78,22,146,19,142,139,232,98,63,160,231,69,56,206,17,101,7,201,6,247,57,34,226,224,57,224,107,176,206,13,242,201,116,2,178,161,251,28,146,10,158,37,248,0,55,82,107,32,65,46,112,160,39,222,145,207,0,93,0,22,66,4,112,6,56,32,220,57,36,215,57,67,21,164,95,31,189,61,189,50,190,250,153,126,57,197,156,233,235,239,63,5,7,158,253,253,125,112,233,131,227,228,41,240,59,133,190,167,216,117,230,20,153,51,120,35,110,190,239,59,229,242,232,231,224,42,218,114,3,97,251,148,173,172,94,113,128,13,5,29,120,35,65,242,45,145,164,193,69,91,100,45,177,58,191,115,231,198,141,43,51,19,227,35,23,207,157,59,123,22,78,166,24,89,103,21,1,207,241,121,246,28,158,244,27,56,119,238,244,185,211,253,224,234,199,163,127,0,110,251,225,215,119,238,236,201,254,179,125,125,167,251,78,131,233,39,2,244,247,245,201,245,116,95,31,186,79,227,245,52,222,157,60,205,87,62,217,58,133,97,160,232,0,56,202,53,168,12,35,80,167,49,114,111,95,95,188,143,13,92,123,251,78,244,157,62,113,250,196,9,249,245,246,246,158,128,163,23,110,78,196,225,56,193,14,182,143,159,128,103,199,249,161,120,199,37,92,252,196,81,52,96,31,59,138,127,24,10,22,253,61,53,220,202,223,240,158,192,243,232,177,99,20,232,232,137,248,49,136,72,113,142,30,235,193,232,228,11,207,49,22,253,231,40,69,35,131,62,24,14,174,80,0,0,18,120,228,66,82,52,58,254,236,102,239,45,2,228,54,224,49,14,228,61,9,228,193,243,36,93,78,146,213,167,60,201,77,39,61,58,126,252,228,137,147,199,193,117,252,56,188,42,88,39,240,141,209,117,188,231,196,177,19,199,143,157,56,118,252,248,177,99,112,211,115,226,132,178,122,240,135,142,99,61,61,199,240,39,14,219,9,39,188,228,49,36,211,233,129,196,136,51,49,3,141,213,145,196,185,211,241,227,39,192,191,27,18,233,238,233,234,233,238,134,11,253,99,24,91,232,102,207,158,238,195,108,225,191,187,193,179,195,135,15,227,191,183,29,166,191,41,58,220,213,213,205,71,119,119,23,95,240,95,195,218,186,142,192,193,127,151,132,142,174,110,250,3,165,35,109,236,139,158,221,252,152,108,140,9,145,142,72,74,120,119,132,47,221,93,42,117,243,159,75,58,35,112,31,59,218,123,166,31,89,100,152,186,33,164,130,140,14,145,6,214,173,27,11,136,199,201,147,175,245,192,129,231,107,175,29,62,12,63,115,240,41,86,55,62,70,231,43,175,117,245,188,114,24,75,244,202,43,175,116,241,1,185,139,245,138,184,168,148,84,204,87,208,255,149,118,244,63,4,7,154,67,242,235,62,4,1,14,113,80,190,116,67,213,235,3,68,198,152,63,250,78,28,163,87,62,212,222,78,39,88,100,31,226,219,246,110,244,32,23,93,26,213,131,67,38,216,254,118,60,233,215,222,42,78,244,99,27,143,214,253,124,183,255,208,254,214,214,246,86,10,181,191,181,177,29,252,241,17,250,96,208,86,12,169,226,180,91,14,10,143,169,180,114,76,184,146,217,143,63,120,218,222,213,29,63,214,11,172,63,132,141,2,128,132,120,196,165,67,150,126,2,12,178,112,5,132,213,201,158,195,175,0,153,208,180,31,58,164,223,66,238,244,79,206,246,118,10,121,168,21,127,96,237,223,15,47,1,7,188,203,33,124,33,40,0,22,90,155,118,227,108,221,223,42,214,254,253,46,91,61,1,179,15,202,127,168,27,16,73,36,72,255,35,30,93,240,122,251,247,237,223,199,39,132,217,215,186,207,54,173,89,63,50,141,116,194,79,29,123,247,238,131,3,76,235,94,99,163,71,163,252,200,52,90,182,219,181,143,194,81,50,38,242,62,43,208,62,76,127,223,190,189,174,184,141,116,236,69,56,187,79,244,158,25,120,99,104,40,201,141,94,30,237,93,178,199,172,0,16,96,16,192,227,16,190,36,39,167,109,114,240,197,216,82,128,125,123,229,237,246,169,187,189,123,119,41,27,29,187,193,222,13,23,252,145,255,110,190,210,99,12,176,107,247,110,56,201,104,39,68,65,179,111,239,254,246,238,158,190,115,9,7,27,95,3,241,99,93,135,90,247,81,12,9,187,139,29,59,225,216,173,126,116,195,79,41,192,78,242,64,123,231,46,125,236,220,245,55,96,161,217,197,214,46,109,195,149,67,236,20,79,21,101,103,182,175,138,110,130,171,20,148,217,149,29,120,23,20,165,117,31,48,73,239,169,129,239,38,184,11,146,64,177,101,55,123,151,72,165,47,204,92,60,119,18,240,216,183,119,215,14,126,97,122,159,93,248,106,187,132,84,248,254,59,208,222,1,94,156,201,14,249,237,162,235,14,190,81,182,113,236,144,19,14,184,110,131,119,222,198,5,220,38,101,221,14,7,152,173,232,4,247,174,93,24,22,32,217,127,8,89,4,27,194,192,32,221,237,173,123,41,248,182,173,219,118,108,219,177,99,199,54,117,200,237,54,244,218,185,99,27,164,3,41,109,3,179,117,199,54,50,244,112,235,14,240,223,134,185,64,136,109,219,183,111,199,39,96,163,3,108,186,195,56,114,69,215,86,185,39,155,29,232,222,74,1,224,183,117,59,197,220,170,239,36,204,118,29,214,138,76,201,237,220,189,119,127,247,17,0,228,141,33,165,210,135,135,134,140,82,95,226,129,244,27,243,51,231,206,189,214,117,104,31,84,15,77,61,48,98,237,36,23,145,109,187,156,108,145,131,222,13,95,74,189,156,121,71,125,209,193,200,108,165,231,248,94,219,183,108,223,178,109,11,22,154,47,91,212,11,96,18,59,119,183,238,239,142,159,2,153,133,26,36,222,221,10,197,219,177,77,194,217,199,182,45,91,240,220,102,156,91,233,66,78,114,176,107,139,88,155,225,220,140,39,58,241,16,199,22,118,90,54,250,214,108,230,24,18,81,63,117,199,216,108,162,108,177,34,108,174,145,11,222,214,212,32,34,141,237,93,39,160,161,53,132,189,194,36,244,166,160,67,234,250,64,133,136,100,174,76,156,235,235,233,218,183,119,247,78,34,215,118,121,85,101,233,247,197,139,242,223,10,199,150,173,91,183,200,177,85,191,54,189,244,150,154,45,218,212,168,19,45,126,147,26,119,152,26,114,214,40,23,189,206,54,144,93,173,93,199,250,6,176,135,51,208,119,172,171,181,113,23,101,190,121,83,205,230,77,120,212,108,218,84,83,179,73,14,184,17,143,205,155,55,225,143,46,116,110,170,49,63,188,160,189,153,30,224,79,57,232,220,188,201,196,218,108,158,211,137,217,88,1,217,177,217,138,228,142,171,227,91,62,155,107,118,237,108,109,239,62,122,170,31,56,100,8,57,4,46,67,70,169,47,41,145,133,128,188,118,104,255,174,29,219,145,208,91,182,213,108,201,38,42,223,108,86,85,194,162,52,7,218,196,214,38,139,74,155,152,78,53,228,91,179,137,159,111,225,23,96,50,213,104,203,162,89,138,236,132,155,0,0,32,0,73,68,65,84,13,211,112,11,136,151,221,251,187,123,78,159,195,142,229,185,211,32,80,247,130,28,18,146,106,210,10,125,13,185,107,54,109,132,19,14,180,54,110,170,217,136,199,70,252,225,133,92,182,3,172,103,192,253,12,157,234,98,221,26,99,63,183,111,159,49,65,159,49,167,229,52,6,222,123,219,223,236,109,69,64,160,191,238,208,72,47,14,182,148,202,55,117,197,32,183,175,3,32,39,95,107,223,183,123,39,86,65,226,191,77,76,227,26,38,34,144,116,139,246,219,196,142,77,76,107,192,99,19,135,216,180,69,87,56,85,111,21,189,54,233,154,178,217,114,91,119,198,179,70,93,183,108,5,64,128,67,0,144,115,131,253,189,61,93,173,80,60,65,114,147,77,219,26,253,194,53,54,1,55,195,225,166,167,38,51,28,66,64,38,215,51,252,228,41,58,55,62,245,204,83,198,253,244,83,27,233,160,27,241,99,7,93,216,176,83,165,96,61,176,124,32,143,103,106,106,54,111,223,9,74,4,1,73,32,135,32,38,195,67,56,218,187,36,223,166,150,104,42,143,112,200,222,221,59,182,43,22,216,100,217,91,148,123,19,19,191,134,236,77,82,227,55,25,57,176,201,197,178,155,92,76,108,96,49,252,99,106,58,89,27,233,183,81,18,218,178,125,7,0,210,211,55,48,56,50,50,8,18,245,208,190,221,219,183,98,118,66,110,23,237,151,213,199,103,12,185,117,133,102,2,61,77,215,167,159,122,122,227,211,79,227,111,163,178,248,0,55,221,179,225,48,236,47,158,27,173,211,10,245,180,14,179,241,105,43,254,70,59,139,141,155,55,111,221,217,8,28,210,123,230,187,103,104,168,210,25,190,224,36,146,165,246,68,185,159,80,63,125,226,236,73,120,227,29,208,130,169,97,182,48,104,104,166,16,198,16,44,54,41,198,216,130,244,219,34,149,187,198,174,245,155,237,170,191,217,205,44,68,254,154,77,203,61,55,42,63,225,16,236,172,131,82,143,247,48,3,111,222,164,16,216,172,28,46,190,120,230,153,141,207,104,57,98,221,106,200,136,222,88,133,53,185,45,202,218,72,184,80,208,228,222,104,225,164,0,124,90,147,220,120,50,0,86,178,248,4,234,218,182,157,123,91,59,143,66,215,16,36,21,206,111,24,130,238,250,16,127,194,213,13,223,59,183,0,144,139,125,40,178,144,67,20,12,6,136,154,45,150,160,18,190,168,225,211,240,201,22,209,109,53,46,137,85,83,195,234,48,75,185,25,132,24,142,205,202,171,70,52,46,198,220,190,3,184,187,27,68,214,32,182,178,186,17,16,20,138,46,250,187,100,210,51,46,1,239,22,223,89,42,225,169,141,89,196,221,104,48,216,168,121,100,163,134,203,77,232,167,45,54,216,152,133,150,225,41,195,109,2,204,51,160,68,182,237,218,187,191,11,149,250,25,26,203,199,239,234,67,9,163,67,150,176,163,126,23,69,214,217,190,215,186,246,41,165,190,114,219,199,52,237,180,190,223,100,51,143,214,205,53,46,93,75,181,157,181,57,10,34,86,232,90,82,213,108,178,133,150,242,217,140,42,4,1,233,234,209,28,2,109,142,157,144,239,38,226,136,205,110,185,181,57,91,157,62,99,180,133,45,186,72,132,128,98,88,78,67,195,16,182,96,82,213,251,169,108,209,100,5,218,104,225,230,18,87,110,174,195,140,159,97,14,105,67,14,129,174,58,42,245,33,224,145,33,213,83,87,223,210,111,223,152,7,14,233,233,218,79,205,222,237,212,236,221,166,250,7,91,178,90,253,170,201,171,218,187,91,196,214,173,252,45,43,55,209,106,20,180,220,232,53,183,53,58,100,141,142,133,54,168,16,232,213,246,224,104,214,40,112,8,41,245,45,91,88,176,173,160,208,93,202,124,179,145,106,155,53,251,216,13,35,247,237,51,90,1,139,62,126,74,57,152,93,232,120,106,163,86,8,79,225,69,180,17,114,129,214,227,79,153,152,110,221,254,52,11,207,205,32,135,247,54,130,82,63,51,64,95,181,0,147,161,193,161,132,154,6,116,75,77,64,164,142,33,188,49,119,12,85,87,80,247,13,165,67,136,221,105,213,33,220,41,189,60,233,7,114,7,81,250,132,219,165,35,43,55,202,151,250,180,219,85,215,112,219,22,58,183,153,110,161,56,212,111,251,142,157,187,0,16,28,94,28,31,73,14,156,130,126,200,174,93,219,183,72,35,110,179,187,205,91,99,181,131,55,82,123,23,27,153,27,55,185,218,183,43,32,104,154,185,194,82,207,216,210,205,110,39,60,147,245,51,42,75,221,106,181,101,51,229,51,42,196,51,148,247,38,104,203,67,199,16,56,228,252,64,18,101,214,208,208,160,51,236,238,24,254,228,39,119,112,44,107,228,244,201,215,104,232,68,13,144,168,33,19,28,43,33,31,248,161,81,163,35,212,157,135,199,203,70,77,118,152,17,19,183,31,14,155,64,116,30,48,145,97,159,173,128,241,86,4,122,39,15,155,16,236,219,118,208,237,238,189,208,135,162,161,19,16,89,8,8,244,67,68,100,42,197,84,83,83,99,245,103,106,84,159,15,196,226,102,213,147,179,90,128,242,204,221,255,51,125,67,75,195,169,240,53,155,92,157,59,106,137,40,149,88,179,113,147,213,180,183,154,48,53,156,145,171,154,112,59,179,102,243,182,109,187,145,67,206,64,199,16,192,72,162,53,156,24,50,131,139,138,67,112,112,177,175,231,112,215,126,28,76,197,65,69,51,182,72,191,29,251,246,238,208,67,142,122,124,211,26,77,220,165,135,21,121,24,145,71,22,121,44,113,55,15,36,202,128,162,4,199,65,71,192,30,199,29,209,218,181,87,141,49,170,161,70,72,126,255,33,236,168,159,31,28,79,38,18,167,142,118,239,223,183,123,23,114,28,201,70,61,78,98,70,20,64,114,130,48,173,209,99,5,122,180,132,159,202,184,7,14,154,212,192,177,121,179,186,85,227,32,155,205,224,7,143,121,96,32,184,74,239,159,110,8,106,2,28,159,224,152,1,93,105,36,6,147,165,129,22,32,252,102,210,185,53,155,41,33,56,54,225,93,77,205,182,173,187,118,239,5,14,1,145,117,30,191,174,15,15,13,2,36,67,74,100,81,103,228,39,210,238,77,224,112,47,126,139,176,6,221,233,167,198,226,197,110,167,241,246,67,173,173,173,56,218,206,67,238,251,233,3,194,33,250,158,160,198,210,219,173,49,119,252,148,144,61,28,47,227,239,173,174,113,248,125,173,52,172,142,22,38,217,77,31,68,156,241,164,147,232,239,197,193,197,221,52,18,9,76,102,143,43,210,216,34,223,109,133,190,252,206,173,122,40,207,4,65,86,220,202,195,138,252,104,171,26,103,219,46,3,139,102,12,144,2,200,104,162,53,46,184,45,219,169,220,91,173,113,71,29,68,167,177,213,30,163,196,193,197,214,214,35,216,49,28,162,149,33,216,240,229,158,186,189,36,228,206,237,204,194,85,250,64,117,188,231,181,30,254,60,101,62,73,201,183,170,195,175,117,119,163,253,202,97,252,36,245,90,215,225,195,248,9,234,21,182,240,171,210,43,93,93,242,137,10,63,47,189,210,165,63,159,169,167,112,182,171,239,79,242,105,234,144,58,196,11,29,248,253,138,204,97,198,3,167,66,32,32,56,252,142,124,39,163,209,102,220,126,247,110,30,118,167,241,105,51,252,110,6,222,119,219,163,224,127,67,39,185,118,153,129,114,53,128,190,115,167,107,12,125,151,117,221,101,130,238,50,35,247,217,97,229,225,223,216,89,90,6,4,86,123,119,119,239,41,154,122,65,120,128,196,74,216,58,132,150,119,208,39,220,115,137,196,105,250,120,203,39,31,234,171,173,124,182,197,143,182,125,39,208,58,126,252,56,125,173,165,31,126,159,61,113,236,56,126,179,197,175,182,112,123,188,231,248,9,245,181,150,190,222,242,119,90,249,66,107,14,52,61,199,244,67,249,142,203,215,19,39,250,16,143,228,248,20,200,172,129,211,39,122,186,218,15,17,251,236,219,103,44,249,24,213,186,111,95,246,231,42,254,52,197,199,190,198,70,245,109,71,62,42,41,211,170,63,34,53,238,229,179,81,62,52,53,90,159,151,118,237,205,10,166,190,56,201,119,39,29,217,118,54,154,64,123,27,249,30,63,187,117,99,71,125,224,141,4,116,9,135,29,56,146,67,67,174,217,239,52,103,241,246,237,133,249,171,19,52,175,3,39,49,92,60,103,102,54,200,132,6,180,7,232,122,174,31,206,126,158,216,64,179,26,206,245,245,157,165,3,79,53,143,1,175,244,195,187,126,61,139,161,95,102,49,192,253,41,56,148,27,61,245,52,7,21,22,98,39,18,78,210,185,52,53,5,37,235,235,59,1,34,181,187,171,155,190,201,154,143,179,244,233,146,191,231,138,112,109,63,164,125,218,229,51,175,124,184,221,111,174,248,133,181,145,62,189,242,167,219,214,118,252,234,202,31,91,213,7,77,57,90,141,116,149,103,244,227,160,124,103,190,130,90,241,249,195,45,197,110,228,27,200,16,100,196,209,51,208,47,60,239,36,16,15,96,16,225,16,215,66,3,100,145,133,133,43,51,23,101,34,213,69,158,251,67,243,127,198,113,54,26,253,206,169,115,92,102,78,141,12,158,27,161,121,63,131,56,1,8,124,104,46,80,98,48,49,72,231,57,156,252,195,19,126,18,131,122,230,143,154,231,195,102,32,33,147,91,206,157,27,72,208,28,31,154,51,165,194,128,184,162,185,117,83,99,216,89,63,121,34,126,172,231,72,15,153,238,110,182,14,211,188,6,156,198,112,152,230,58,28,198,169,12,135,121,126,3,93,14,179,151,76,60,104,235,54,86,151,117,116,119,181,193,165,77,79,82,32,207,118,58,240,132,31,121,192,61,75,221,238,118,61,73,2,67,116,169,80,150,213,222,222,174,82,224,84,58,49,70,60,126,162,23,135,22,29,28,57,1,147,188,144,76,92,144,21,84,214,124,106,156,68,154,209,19,229,92,83,227,102,102,22,102,240,55,111,38,123,234,41,113,230,206,24,158,210,165,102,24,94,84,246,200,184,53,59,142,231,26,170,25,135,120,29,36,144,209,210,19,15,41,36,77,94,132,60,28,64,123,96,160,175,15,153,42,30,239,227,3,68,218,137,19,167,78,156,236,197,41,64,52,251,167,23,46,189,71,123,227,39,78,196,101,58,80,175,76,243,81,115,126,78,28,197,95,156,46,113,158,248,67,83,127,112,126,15,187,142,30,139,31,141,243,220,31,58,241,254,40,79,229,225,105,61,112,215,125,148,253,112,162,16,219,52,121,232,152,220,114,204,99,50,21,136,2,30,229,169,64,144,237,41,104,98,13,36,206,3,235,15,39,19,56,201,193,210,33,102,201,14,77,235,189,113,219,158,48,202,22,158,25,153,177,43,83,117,105,146,250,188,198,139,230,231,206,207,205,240,156,93,247,44,93,219,92,84,115,114,193,92,186,68,211,71,213,44,82,133,168,195,211,28,113,54,41,79,218,197,181,80,180,56,103,22,177,2,62,82,211,227,112,26,24,154,115,253,202,229,54,52,159,141,102,199,157,226,105,114,60,193,173,223,158,190,198,19,216,100,254,90,47,220,244,246,245,162,131,14,62,79,129,141,222,15,52,103,232,52,55,24,152,99,42,39,254,206,192,209,199,247,88,30,232,166,67,159,16,217,99,152,187,235,165,57,95,89,182,56,231,206,221,12,77,167,230,149,5,183,110,203,148,234,27,4,211,245,219,184,170,99,17,167,82,227,228,95,89,238,180,200,211,216,231,231,240,184,194,43,107,82,52,187,151,150,109,204,227,137,19,124,103,102,136,189,230,104,86,175,153,230,59,45,179,125,213,12,235,41,156,15,135,107,9,166,103,120,34,251,12,47,252,144,115,6,56,6,68,223,224,160,154,215,56,160,68,30,221,12,88,23,182,212,76,207,51,122,198,103,191,154,224,137,243,28,217,238,215,115,28,105,182,227,169,51,167,206,244,159,57,165,39,61,170,137,138,230,100,172,213,79,157,98,105,55,37,170,170,3,5,197,196,232,196,10,5,120,64,127,208,25,198,239,33,23,28,81,234,238,165,208,75,119,245,226,77,90,42,120,231,22,253,4,26,156,241,142,203,5,1,12,90,4,181,200,156,67,43,54,113,170,123,74,173,186,89,152,79,47,204,209,42,3,66,105,142,120,41,77,139,60,100,22,246,149,180,158,63,157,86,136,205,227,10,169,153,20,224,37,83,133,103,113,213,249,12,175,67,160,133,10,112,63,65,171,57,6,71,146,168,187,80,129,209,188,222,36,205,245,229,233,170,9,153,94,14,47,74,198,17,61,53,36,238,55,18,217,230,124,66,205,237,125,99,192,54,253,174,185,190,140,172,154,159,42,147,86,9,203,1,182,57,80,191,196,233,151,106,0,71,255,128,118,227,52,95,153,75,12,5,25,166,78,8,180,88,160,163,14,44,98,207,203,90,50,130,75,150,126,220,186,195,235,57,239,16,211,144,118,161,21,107,184,50,77,196,218,45,181,156,118,145,86,132,44,194,35,4,39,131,75,255,23,83,128,80,218,44,26,180,86,70,241,110,0,41,92,200,73,43,56,105,237,32,158,115,106,137,26,173,78,75,167,112,13,66,10,23,137,72,144,52,242,213,148,94,224,225,232,105,219,178,120,111,156,21,142,220,38,121,101,6,184,6,113,125,76,146,26,32,73,90,106,48,232,240,226,2,224,51,4,115,52,193,19,221,135,18,102,162,251,27,116,156,79,200,9,204,246,198,119,223,248,238,119,19,111,12,124,23,169,9,199,27,111,48,140,111,12,156,7,251,60,213,248,196,119,19,3,111,156,31,24,130,167,82,9,128,73,135,212,196,119,112,191,65,15,206,227,236,119,232,121,92,24,28,166,169,214,195,216,45,28,178,151,35,100,173,60,231,133,84,180,164,237,39,234,57,175,218,65,108,222,162,69,182,180,86,71,47,237,4,108,22,175,203,10,66,92,175,6,214,117,94,83,184,8,112,165,45,77,196,203,59,23,231,230,64,214,165,174,95,151,229,59,178,130,135,23,178,17,90,188,164,45,53,135,156,149,150,37,84,128,205,149,84,106,26,128,154,154,198,133,130,184,94,237,18,237,193,112,201,153,158,80,135,115,9,14,92,243,63,197,171,26,112,113,3,174,116,162,53,105,73,193,145,22,231,240,26,155,228,240,120,114,136,16,75,142,12,143,36,5,43,58,146,184,252,15,135,199,145,231,134,46,36,156,11,67,67,73,179,88,225,130,56,146,231,147,252,225,111,200,1,191,243,200,159,23,240,35,57,175,90,184,32,203,66,28,148,75,137,33,72,195,25,132,240,180,66,125,120,208,193,185,139,44,181,178,148,186,165,221,221,232,44,233,101,211,119,120,1,27,96,240,86,70,233,151,219,106,161,51,232,151,69,181,240,25,32,185,158,1,132,104,113,137,108,160,129,43,110,245,66,244,204,92,6,224,72,45,166,13,23,17,42,243,106,117,33,130,146,154,75,207,207,225,230,1,196,65,87,230,88,192,209,34,159,57,37,201,104,9,85,202,129,131,204,140,44,62,156,153,189,116,73,47,178,154,114,102,39,156,105,90,209,3,252,229,76,83,91,1,87,58,211,58,205,241,41,89,186,169,22,104,58,180,31,6,26,218,5,3,207,81,128,106,112,152,86,159,37,240,251,55,207,165,194,233,59,248,49,156,87,119,36,169,170,15,243,202,130,65,220,163,97,152,22,73,193,205,176,131,188,137,107,159,105,121,206,8,117,5,101,189,14,64,142,75,13,135,0,238,175,88,147,28,86,92,10,109,220,119,104,152,94,244,11,115,197,91,104,223,226,213,157,215,111,8,131,136,106,1,44,224,160,181,182,128,83,70,22,63,47,100,22,105,89,33,30,139,106,245,51,235,28,56,231,230,23,73,251,204,171,29,28,210,204,34,4,9,45,114,163,198,28,175,48,228,117,208,178,250,118,122,6,15,39,53,45,235,112,117,235,224,210,212,236,212,20,110,21,128,203,161,39,112,1,46,173,108,155,196,85,134,180,6,125,156,23,51,203,202,103,71,45,208,68,68,128,76,132,199,232,248,40,65,50,226,36,65,113,1,183,12,58,73,105,22,17,69,19,195,14,205,81,96,15,89,121,51,60,76,252,165,46,0,20,47,173,162,121,213,216,51,31,164,166,46,162,6,78,212,117,56,211,193,172,49,116,241,7,51,137,90,250,172,49,145,5,135,119,112,149,39,72,172,204,91,186,13,150,185,173,150,215,102,212,190,25,178,161,201,117,86,47,105,226,14,106,52,223,80,139,61,231,192,13,80,128,196,202,164,149,150,89,92,48,26,6,151,175,201,182,51,87,212,26,184,43,122,37,116,42,173,182,113,152,33,30,161,150,26,200,50,193,131,214,189,205,226,178,104,94,135,59,9,162,141,118,110,128,99,146,88,133,247,51,65,30,25,167,229,182,184,2,23,183,189,72,142,209,10,193,81,100,21,188,224,6,49,163,163,76,76,36,30,206,48,68,138,59,60,225,16,113,113,134,105,89,90,34,41,23,234,82,56,180,124,144,22,189,57,52,52,130,140,198,240,12,130,120,26,36,85,206,82,17,7,77,134,135,48,85,71,122,234,75,217,107,210,213,114,116,241,127,235,174,165,69,100,151,6,148,89,106,171,31,123,131,6,212,30,34,191,0,150,52,239,215,176,72,18,107,65,239,249,51,183,56,7,13,178,197,212,117,144,81,215,149,172,90,96,113,181,32,139,161,211,122,81,180,236,254,67,28,50,67,139,213,103,80,50,241,38,64,200,20,211,105,194,131,182,13,72,205,242,230,26,151,104,231,25,89,164,158,154,158,34,254,152,158,192,125,125,80,112,141,137,98,1,198,152,196,109,25,146,184,9,9,47,249,28,227,229,156,99,188,7,6,239,217,131,107,7,129,188,64,74,20,247,72,95,208,4,9,97,10,28,21,116,136,23,134,9,173,97,181,120,16,248,101,16,55,106,160,129,170,97,220,70,3,215,213,177,14,199,68,24,99,132,48,193,58,93,79,37,189,187,228,218,227,196,133,140,5,144,107,229,237,173,140,172,129,190,65,74,132,228,210,13,197,23,106,9,40,193,193,59,104,208,74,68,197,31,139,139,0,196,141,57,110,38,47,164,21,139,44,208,54,51,188,16,122,94,51,139,240,7,9,172,116,154,59,55,169,244,236,108,10,122,139,41,106,22,207,206,232,221,78,224,70,116,72,90,173,81,199,141,26,28,84,246,142,115,137,150,165,131,205,27,156,160,212,26,103,14,33,13,66,187,95,224,174,61,163,200,45,164,67,70,156,81,92,160,8,228,68,41,51,136,43,102,169,15,71,90,56,129,200,208,72,20,226,227,12,179,40,35,69,67,60,192,141,90,234,134,67,59,207,17,41,134,79,28,89,234,233,96,191,48,193,31,168,224,82,170,119,114,176,127,43,237,5,116,199,108,49,131,139,115,223,202,40,125,126,155,17,96,101,158,225,253,26,50,168,205,65,135,168,69,234,106,137,104,134,150,165,163,30,73,47,164,112,79,172,116,70,250,149,184,56,157,55,111,144,165,233,136,12,163,114,101,142,219,87,184,131,3,45,77,79,241,66,105,254,201,182,13,132,1,111,108,146,154,229,245,187,196,29,179,210,153,153,158,76,65,155,108,10,229,149,51,121,9,229,21,110,153,1,141,179,49,222,71,105,204,193,29,148,104,61,179,195,139,206,113,235,11,92,187,155,196,21,229,131,35,180,46,147,148,7,233,113,28,128,114,120,101,32,194,49,56,132,83,20,80,63,163,138,7,62,66,190,1,186,163,102,113,120,245,7,53,223,72,153,36,101,65,33,241,18,226,73,73,34,34,252,77,125,41,123,239,165,44,46,89,82,31,220,239,10,123,220,33,85,174,26,188,183,111,139,230,88,124,235,186,108,189,36,59,148,113,163,23,120,35,147,70,253,113,67,182,10,0,107,46,147,186,1,10,3,58,42,105,218,111,70,54,211,32,72,212,110,1,178,120,61,69,77,172,52,65,2,109,44,90,214,75,40,164,176,207,72,77,42,110,85,129,236,98,141,78,74,5,128,152,74,177,188,130,30,255,228,180,51,51,49,203,45,226,75,151,88,88,77,208,118,13,178,63,204,152,217,32,6,69,215,152,244,106,128,154,67,168,54,70,145,140,4,0,86,107,84,227,32,98,160,231,48,76,195,130,73,181,244,150,212,59,9,47,166,121,130,22,160,83,219,22,1,114,8,58,68,12,165,30,45,187,30,28,36,62,163,97,44,228,144,161,82,251,139,97,118,135,68,33,245,150,108,245,163,246,95,194,238,58,67,33,253,16,217,164,193,236,100,114,61,163,246,197,186,46,251,203,220,144,173,101,16,142,69,84,238,41,238,214,103,140,66,159,231,13,178,84,255,35,109,54,114,192,225,50,234,165,243,254,88,170,123,79,74,61,69,253,122,238,71,78,167,64,133,200,26,118,100,141,89,26,143,156,156,132,206,253,236,12,242,135,131,63,20,87,184,125,204,36,239,52,70,219,54,56,188,239,197,56,239,157,68,80,160,70,31,79,210,214,111,84,179,129,204,35,14,181,109,29,84,227,67,195,212,151,67,94,128,246,42,116,77,160,131,49,76,234,121,40,65,109,44,176,168,251,194,32,98,44,106,81,201,122,116,244,31,164,165,83,168,75,176,71,138,115,173,135,134,190,226,90,210,182,226,214,125,214,38,101,75,25,181,187,12,163,1,237,172,140,238,132,48,14,178,237,18,73,44,100,15,165,66,176,67,136,45,45,86,233,11,139,180,101,28,239,110,146,97,237,145,226,62,8,111,202,52,167,91,190,41,26,112,145,173,153,102,104,127,7,53,220,2,142,185,148,244,76,210,12,137,51,43,219,53,205,92,2,46,129,38,47,180,120,103,167,64,121,204,78,96,243,106,154,250,33,242,155,28,67,109,110,105,16,222,1,3,25,4,218,191,120,7,242,138,90,188,131,35,188,228,204,33,133,60,56,172,53,3,80,208,129,14,229,32,125,19,135,126,32,138,46,172,233,14,205,157,102,13,66,109,219,17,222,56,3,121,98,88,54,209,160,17,69,236,18,210,58,120,20,87,9,75,169,187,53,200,18,239,64,179,228,146,102,183,120,255,165,219,12,201,29,195,33,210,180,82,176,44,186,185,36,205,125,116,171,185,155,206,164,177,59,120,131,241,16,129,69,219,255,44,164,230,175,227,78,101,139,164,218,165,145,197,26,132,55,46,67,165,206,91,100,9,143,112,83,75,225,49,173,68,214,20,54,176,100,87,38,232,157,204,56,211,188,161,31,244,224,39,46,73,71,132,246,97,114,80,110,57,184,217,12,109,192,199,221,119,130,131,182,197,0,21,50,202,125,135,97,89,76,78,173,92,64,194,97,56,112,170,136,67,212,100,122,74,91,137,212,123,34,193,26,131,201,159,36,165,98,150,219,210,61,241,93,2,65,37,72,134,134,134,220,75,218,150,238,102,245,13,151,204,82,30,75,167,163,196,186,197,120,220,184,117,91,128,184,110,182,37,91,148,17,20,238,160,211,168,9,239,50,147,81,16,44,210,128,9,97,65,59,44,98,15,100,30,185,36,69,56,92,79,203,230,39,208,5,153,151,77,103,104,208,36,125,69,164,150,217,215,33,165,185,131,52,10,183,173,210,162,223,17,19,208,230,160,64,160,71,56,61,61,141,123,149,161,196,154,66,254,64,105,53,201,219,190,97,175,208,65,61,66,77,221,36,237,90,137,13,45,236,22,202,0,74,146,119,136,225,166,19,82,123,136,97,0,68,134,17,8,96,16,80,204,200,29,12,20,245,188,25,12,228,17,211,87,28,150,142,35,201,44,106,127,49,150,56,162,34,28,226,230,4,217,39,206,189,165,31,15,49,146,10,201,200,14,126,220,29,188,145,213,7,193,61,46,175,235,13,227,50,188,49,135,25,51,33,80,174,179,160,202,44,232,237,177,230,9,20,64,34,53,79,220,163,4,150,26,51,73,95,129,190,225,220,149,185,84,138,247,201,162,141,23,211,170,207,206,141,42,104,250,114,15,100,26,25,4,212,7,156,147,192,31,244,225,108,26,55,5,2,182,184,228,92,162,45,104,104,159,196,49,238,163,227,176,137,222,124,102,156,155,89,32,176,134,199,145,61,104,76,114,212,161,13,148,18,212,201,70,165,13,202,98,72,85,106,156,225,134,112,128,193,233,235,67,23,18,67,23,46,224,71,64,156,136,152,32,241,37,32,12,51,139,144,230,32,81,149,116,72,237,227,240,151,236,197,49,228,154,253,190,116,247,238,178,13,49,101,236,87,246,41,99,72,184,79,72,237,172,27,52,132,136,109,94,214,31,220,200,82,163,39,170,7,130,26,4,30,47,44,74,207,240,250,117,4,231,186,32,194,3,88,160,210,175,95,159,155,39,45,178,160,229,213,188,218,69,142,219,189,115,36,173,230,100,207,19,238,25,202,54,177,196,20,142,112,200,44,127,84,129,211,193,29,178,38,145,67,166,39,161,19,50,233,208,254,86,184,95,232,216,4,109,83,134,27,146,141,211,38,99,122,47,32,218,201,149,186,32,227,56,254,132,237,34,110,100,81,187,40,73,66,134,122,34,204,33,36,167,224,224,97,70,210,240,128,207,48,41,5,106,215,14,49,146,164,84,6,89,159,211,168,187,168,126,30,129,76,90,29,67,215,126,101,75,119,93,219,152,233,249,65,130,198,109,238,21,102,100,31,160,219,180,69,13,42,112,238,4,210,232,226,162,233,129,100,244,38,53,50,168,8,45,172,76,10,191,111,97,231,35,165,56,4,199,122,175,95,79,165,23,101,35,82,233,160,207,205,203,70,77,169,57,194,100,6,55,45,155,163,17,69,30,197,66,102,97,21,2,157,245,84,218,97,105,54,13,12,98,109,90,230,76,59,184,241,168,104,115,181,213,174,108,64,70,59,241,129,168,26,147,209,122,28,65,25,163,65,147,113,103,132,26,89,60,20,133,67,178,212,218,165,105,234,195,74,129,48,139,128,66,79,34,127,32,155,128,5,44,50,116,129,177,26,194,113,19,213,65,228,38,50,34,67,186,131,48,70,77,99,241,218,5,61,116,178,228,238,130,40,88,232,25,110,169,120,71,127,182,186,117,251,45,228,14,26,87,228,93,225,136,27,100,219,190,69,238,178,3,115,80,99,235,198,34,111,227,39,237,93,110,251,222,0,36,50,44,192,22,65,195,83,19,235,58,208,115,97,113,14,180,6,182,192,164,123,120,133,126,194,31,184,51,108,90,13,95,165,181,230,224,54,47,245,10,157,52,43,242,20,113,8,109,95,70,189,144,105,222,191,204,153,164,93,252,80,153,227,118,136,99,180,117,31,13,98,57,216,246,77,210,78,101,96,28,220,58,148,250,133,35,184,75,165,147,196,173,67,145,73,18,210,165,27,198,186,110,182,252,1,50,94,64,145,117,1,59,119,23,240,188,128,62,67,60,74,143,227,42,36,165,112,54,53,141,239,210,120,252,48,119,9,29,108,18,32,36,148,150,147,48,195,239,203,134,221,93,50,236,142,250,176,171,7,122,73,94,221,214,253,15,230,16,176,174,171,254,122,86,31,125,81,56,4,81,0,137,197,227,189,186,11,2,8,129,26,153,195,65,221,69,150,88,180,207,34,162,161,84,250,21,238,120,164,168,253,123,69,237,232,55,147,146,79,89,178,173,150,116,212,129,67,168,19,50,197,143,120,203,228,169,73,220,160,218,161,111,36,180,85,226,216,56,239,225,135,76,225,240,176,34,136,43,222,132,111,20,122,35,35,206,40,181,88,135,105,164,118,120,144,85,179,67,106,120,72,113,199,80,66,91,92,199,73,189,139,133,23,7,63,5,226,204,171,36,169,122,30,165,199,137,213,14,202,173,97,145,119,34,232,178,22,236,44,219,125,148,85,200,146,61,168,168,54,185,188,125,251,214,91,184,129,156,236,29,183,168,183,70,70,84,168,111,46,219,92,46,240,190,138,12,129,106,110,45,100,212,166,201,40,180,0,33,208,35,41,106,104,233,157,254,176,47,66,27,251,93,145,177,69,53,188,168,247,234,69,93,50,139,136,168,141,173,101,48,126,102,118,118,138,246,35,197,173,229,38,39,29,245,217,10,218,87,147,138,45,166,104,43,62,106,98,97,163,215,225,190,249,24,239,11,78,221,17,220,19,113,148,181,6,142,75,37,72,120,33,21,157,97,214,32,10,130,33,65,225,2,125,112,196,118,22,126,153,186,64,22,141,136,144,158,193,85,132,14,182,200,134,105,176,107,136,134,89,144,99,12,178,242,77,61,187,125,101,201,175,91,50,100,34,43,166,81,94,101,116,39,93,243,136,214,230,130,205,245,197,197,180,218,43,57,205,99,41,230,35,8,64,37,51,35,50,122,3,210,52,245,9,211,115,139,105,253,57,158,186,132,208,41,76,243,144,34,127,157,18,189,126,133,63,134,224,56,214,140,222,54,57,165,198,176,144,53,46,77,205,170,173,23,161,177,53,75,219,46,114,239,3,55,119,167,111,32,180,95,168,163,54,59,30,227,145,197,36,239,153,200,253,116,234,131,160,224,194,81,172,97,39,169,54,127,27,30,118,148,2,73,40,74,226,119,68,69,89,68,38,65,34,200,97,6,193,158,124,226,2,74,168,196,144,12,76,82,87,5,218,95,188,25,154,108,137,70,202,231,43,102,248,125,105,165,1,45,221,202,130,94,58,66,98,58,132,4,11,239,45,122,125,81,141,157,144,50,65,14,225,97,20,30,116,95,92,208,28,146,190,62,151,186,190,96,88,68,155,185,185,69,222,36,118,126,65,137,43,26,51,209,188,161,62,187,227,96,239,21,253,125,74,246,224,159,78,77,59,252,25,30,250,231,233,169,153,20,41,117,217,89,28,216,98,118,114,82,109,186,136,58,125,146,250,132,212,61,231,86,239,20,105,20,86,235,73,209,234,168,208,157,81,218,177,207,161,33,17,106,27,17,26,248,245,98,56,161,225,64,77,62,164,73,42,45,96,188,35,193,117,225,2,241,200,133,36,247,27,73,17,13,17,162,36,197,146,90,159,115,200,82,123,87,210,7,140,158,220,177,246,217,151,189,46,165,147,46,131,236,106,220,10,91,192,216,0,94,92,228,46,58,179,8,143,187,35,63,96,31,61,195,250,3,219,87,25,153,248,128,234,92,88,131,198,78,100,251,100,252,48,69,59,98,74,35,139,241,72,93,145,239,33,105,153,142,130,95,11,105,136,145,155,188,184,49,236,165,75,220,204,210,59,196,2,34,184,77,175,65,4,119,178,38,245,49,38,159,215,73,130,73,63,221,209,67,89,52,170,72,67,239,220,73,151,97,247,164,180,109,181,232,191,128,95,201,47,104,141,146,160,62,34,42,105,132,129,123,40,12,31,13,210,131,254,32,215,144,218,127,81,160,69,81,39,173,172,165,172,65,222,91,54,68,75,188,27,41,253,231,1,111,123,73,187,86,203,152,162,146,85,106,3,82,181,91,50,116,15,211,50,122,37,210,42,35,124,145,49,91,238,43,20,204,21,119,78,78,243,184,73,74,26,89,188,75,41,195,49,67,155,40,207,168,239,183,105,25,231,149,41,42,136,7,10,176,169,244,37,48,106,167,216,41,64,3,17,193,193,94,156,242,48,41,155,148,18,99,176,30,97,77,34,163,89,227,138,67,176,135,136,136,112,179,151,186,217,244,33,41,57,100,88,3,37,143,180,170,18,210,187,195,201,43,67,67,231,121,2,196,5,234,45,34,135,92,208,18,14,1,165,126,37,106,17,30,84,20,76,46,100,109,173,97,127,191,117,77,247,197,223,91,119,88,94,201,76,147,27,52,138,69,173,43,53,80,66,45,45,106,97,145,14,225,134,23,237,147,169,68,212,13,110,249,170,73,14,22,18,244,69,4,108,238,24,178,192,194,93,147,129,55,82,242,237,150,47,56,194,136,44,50,39,223,12,185,15,2,189,144,217,148,26,43,33,123,118,230,210,236,148,250,62,149,154,196,221,222,105,55,235,41,218,205,122,202,49,155,181,243,223,74,224,136,34,181,180,146,212,210,226,9,14,163,44,181,6,105,68,86,190,3,130,212,113,20,28,9,17,81,72,73,234,165,15,13,13,156,63,47,173,45,172,242,212,5,167,38,48,193,50,44,14,30,242,146,173,52,85,203,128,37,157,213,202,114,77,117,184,101,237,61,126,135,120,132,254,19,132,26,89,183,248,115,136,12,156,92,207,88,227,38,192,23,34,170,168,21,76,157,116,80,227,8,193,28,192,114,35,149,209,250,220,218,84,124,78,125,194,197,225,147,121,61,7,8,104,63,135,155,239,167,231,72,149,75,111,93,141,237,202,76,7,160,60,181,126,167,229,15,67,248,196,169,65,136,8,111,49,142,151,9,28,202,34,237,62,201,27,202,58,74,135,8,135,96,39,17,209,224,105,14,188,251,52,126,81,79,242,64,22,202,45,249,106,142,51,13,77,183,80,137,45,135,117,133,115,126,192,81,188,130,204,195,109,90,39,129,188,194,179,135,46,12,209,183,17,2,53,153,84,126,220,38,75,184,91,89,118,147,247,150,53,213,151,58,134,122,16,75,58,33,183,213,30,238,230,207,14,104,252,68,6,121,213,76,44,150,88,233,12,255,81,139,254,135,16,5,137,218,76,89,125,192,229,47,184,244,29,228,74,10,187,225,128,4,116,207,175,168,254,33,118,67,176,195,174,71,120,73,175,211,12,32,53,108,34,19,30,73,147,80,111,132,218,191,51,252,111,8,83,106,168,151,254,40,4,255,135,194,225,241,119,234,183,51,103,140,143,141,202,36,32,26,128,87,125,117,153,100,226,168,209,221,33,211,129,184,192,164,199,219,243,67,192,34,228,121,254,13,210,220,200,5,23,88,32,37,185,11,159,84,241,112,208,56,33,45,51,68,244,130,94,210,150,221,27,116,49,203,29,61,202,155,185,205,223,10,177,167,126,131,17,49,155,137,243,168,251,117,254,134,158,225,239,32,210,3,193,103,212,85,95,180,122,33,139,105,123,126,28,243,7,111,190,159,78,209,39,41,252,239,131,185,249,244,156,52,119,209,154,83,227,187,170,43,8,88,16,253,9,15,130,133,231,58,18,143,204,202,111,198,153,153,152,129,206,8,141,47,202,191,232,96,43,107,140,88,132,118,220,231,102,176,82,29,164,217,25,15,252,144,158,100,153,165,55,159,86,92,33,189,63,174,225,116,1,44,64,74,13,128,208,186,0,192,12,241,226,193,196,249,243,73,238,204,179,160,163,1,150,97,26,220,5,223,164,26,233,149,164,244,220,222,108,5,98,109,72,131,50,43,35,227,38,25,252,43,163,140,250,91,16,249,70,168,63,22,98,7,113,81,127,197,77,243,119,66,26,193,162,191,163,160,17,19,53,202,171,217,67,207,202,82,211,78,204,28,57,196,4,123,135,140,199,156,153,38,167,191,130,240,164,185,105,154,43,55,205,115,29,8,36,158,118,66,31,69,166,105,94,214,52,142,47,78,76,92,154,228,253,198,241,127,13,128,75,100,191,125,28,227,37,5,159,164,63,92,225,174,8,74,44,208,33,201,81,217,179,218,73,202,119,12,26,200,210,173,222,11,162,69,144,39,80,80,157,71,133,126,30,89,101,128,65,146,47,79,168,85,46,112,215,36,161,88,4,247,35,29,98,180,84,67,193,254,132,123,119,121,159,125,73,184,227,174,252,111,142,61,106,114,155,229,213,245,235,106,42,22,202,171,235,184,207,59,125,71,231,143,132,136,197,162,236,123,157,73,101,212,159,182,184,254,215,72,195,49,47,51,127,161,123,158,66,40,174,204,205,241,255,78,93,161,97,120,172,253,96,243,44,7,84,232,51,242,119,46,226,160,79,184,252,119,21,242,231,33,210,246,157,6,60,38,39,233,223,16,232,255,166,166,200,240,223,28,240,63,225,140,209,87,66,28,76,193,73,39,163,234,79,37,198,157,209,33,238,30,202,116,146,132,232,117,211,121,72,80,171,151,102,141,58,111,16,40,112,58,192,26,200,46,36,145,144,87,18,44,149,146,28,209,145,30,100,98,232,130,25,37,134,65,182,0,0,32,0,73,68,65,84,54,161,175,41,52,218,155,245,1,221,13,205,157,187,75,230,111,190,168,95,120,75,193,114,195,252,159,20,13,42,226,158,251,56,170,149,17,161,197,144,168,241,43,158,231,96,56,196,165,67,210,11,41,230,142,69,61,3,8,39,200,145,115,78,230,100,209,223,78,93,145,38,238,108,74,125,252,144,175,135,252,81,29,120,195,76,91,148,118,22,74,44,26,96,196,222,250,244,244,37,236,169,243,31,77,225,20,160,169,241,201,169,41,250,26,226,240,38,251,56,202,232,240,71,17,28,114,26,29,167,41,14,50,7,87,198,22,105,64,80,26,170,40,249,147,180,151,187,52,189,6,6,184,169,53,160,71,185,80,114,73,87,145,133,28,182,145,185,233,69,83,187,134,204,206,228,203,38,57,220,93,54,45,235,150,249,175,22,94,138,32,163,238,246,95,80,240,7,67,236,158,95,151,255,4,145,166,214,13,17,87,244,245,35,109,122,31,25,213,43,76,147,18,17,201,53,191,96,230,245,202,87,117,254,30,34,147,128,248,155,122,74,58,31,186,11,162,56,4,120,202,153,161,17,120,64,133,21,8,246,66,38,73,169,203,132,19,92,8,196,31,12,65,92,141,169,63,192,161,255,200,113,146,122,155,126,250,138,75,125,146,17,217,162,31,59,232,131,52,160,69,235,101,7,117,191,16,240,64,149,13,160,144,204,2,28,160,158,35,22,206,249,243,3,200,28,9,145,100,23,244,236,108,192,131,212,8,245,229,145,187,80,153,64,58,166,217,235,234,134,44,185,254,220,69,52,250,91,119,239,224,188,81,249,55,4,252,179,132,27,60,249,135,62,15,102,20,36,74,118,45,170,137,213,230,67,136,238,20,102,68,94,165,23,85,39,68,62,135,204,203,32,47,113,134,128,194,141,45,25,91,68,170,95,145,97,247,20,116,59,102,241,239,10,103,83,106,234,79,122,154,228,20,14,52,162,160,154,158,197,79,84,242,73,4,58,134,212,1,193,137,139,147,244,111,108,248,79,106,19,216,41,228,127,207,145,86,47,78,251,193,33,120,25,93,68,29,194,179,72,113,116,113,100,208,161,169,138,14,1,98,6,104,47,208,240,7,32,128,106,3,53,198,192,121,226,14,98,18,196,228,13,9,237,208,232,150,171,147,120,193,249,191,117,189,207,107,28,103,214,54,236,253,100,8,89,56,144,193,4,2,142,96,24,47,94,48,143,39,179,120,252,12,14,196,47,6,99,123,130,127,128,9,132,188,178,225,3,203,8,4,82,75,43,73,72,139,110,11,163,22,2,181,40,212,173,69,183,236,22,216,2,45,164,86,35,36,45,218,106,236,141,44,227,128,201,240,172,242,143,124,231,186,174,115,238,170,182,51,85,221,85,213,213,45,103,230,62,117,126,95,231,28,69,182,158,61,115,171,173,158,128,114,191,255,241,120,201,223,125,90,72,192,77,62,112,80,11,72,65,176,226,201,91,39,198,9,19,183,39,97,3,59,73,250,239,10,177,221,72,169,231,81,222,55,110,99,121,136,209,57,226,56,212,186,116,59,204,44,133,23,225,163,131,26,71,68,200,113,237,145,69,239,165,28,123,204,102,51,82,244,136,124,103,66,4,59,210,183,93,204,117,193,52,17,206,41,218,197,140,162,109,33,129,48,169,168,43,47,125,199,199,226,104,46,209,78,155,245,9,47,54,95,8,21,77,96,117,139,184,147,228,131,60,163,53,107,15,58,204,221,14,116,136,17,162,65,197,206,11,219,93,194,181,154,29,25,102,12,7,83,100,61,123,166,186,162,192,156,180,155,133,42,220,129,4,238,123,115,68,222,203,9,249,183,42,66,114,23,228,87,69,78,96,242,158,228,62,200,219,83,215,238,242,63,48,187,243,93,2,154,164,113,120,167,62,207,165,95,12,152,184,74,121,29,64,172,72,169,191,234,107,224,72,4,24,61,79,149,112,39,61,230,166,142,133,26,133,176,162,151,136,50,132,163,52,97,231,200,252,243,238,209,238,209,129,68,86,119,87,99,242,182,49,23,207,13,222,174,207,98,217,218,74,241,69,82,231,165,10,9,24,206,218,236,116,132,118,3,216,1,185,240,228,168,251,72,11,46,118,179,209,236,128,49,168,217,33,189,26,109,185,37,16,100,246,155,54,106,72,58,210,231,162,146,233,249,103,158,157,194,63,181,209,14,244,251,239,31,207,199,75,113,94,134,22,89,56,69,30,121,31,245,57,96,145,147,112,63,148,188,125,235,147,240,60,162,24,49,44,152,89,253,254,187,211,55,197,24,111,191,159,147,2,231,99,159,179,147,200,1,209,117,220,235,165,40,22,167,22,6,102,215,81,89,135,199,253,130,249,123,208,243,98,68,51,171,246,29,104,205,180,58,203,66,48,244,113,223,71,236,208,198,210,240,46,12,137,210,148,163,128,42,18,225,64,148,92,167,195,209,118,155,238,136,0,69,197,136,47,68,150,50,134,207,10,49,69,51,174,26,182,244,237,76,156,209,162,46,105,135,244,146,217,101,30,73,75,145,45,143,182,111,225,159,104,109,37,143,191,49,216,201,193,179,32,185,248,146,143,254,158,161,172,200,130,72,44,161,26,225,180,48,66,245,164,0,51,25,208,31,111,148,180,237,199,84,188,211,162,255,17,222,7,149,200,235,55,137,55,52,152,173,247,234,117,128,128,76,114,41,103,152,16,89,66,159,4,40,235,136,9,145,78,63,226,89,125,106,245,222,161,146,84,64,145,146,16,28,127,212,221,6,8,136,96,172,109,34,23,17,124,167,135,174,113,70,52,176,140,30,109,179,177,182,158,83,135,64,147,67,167,111,138,69,148,198,237,180,35,251,164,208,98,168,13,25,89,40,106,195,53,53,138,137,50,20,177,201,30,110,171,118,78,245,87,91,197,40,113,187,85,224,144,223,255,40,93,232,86,47,56,228,52,225,70,223,135,205,123,154,207,81,5,82,81,148,209,204,175,254,169,166,119,158,66,114,245,251,185,10,33,80,46,17,195,125,17,100,166,114,84,111,63,102,123,122,149,14,3,88,189,195,126,94,32,154,192,213,253,158,220,145,131,163,128,61,56,56,110,255,200,211,83,136,245,130,26,128,89,171,78,167,75,136,181,17,130,35,240,148,168,242,169,143,91,28,173,22,254,122,12,26,124,1,11,75,117,56,207,55,55,189,220,64,14,58,105,162,135,31,214,46,196,80,6,90,52,73,24,163,198,6,121,164,105,182,112,167,157,92,146,148,45,129,179,40,16,138,91,109,157,246,87,31,119,114,248,189,232,37,82,133,156,166,225,182,44,209,81,222,246,253,59,143,44,14,6,179,242,60,58,231,176,121,168,228,141,9,179,92,131,124,20,117,23,69,222,244,11,37,33,129,0,66,197,206,43,164,13,15,97,244,246,114,76,239,97,138,47,186,197,203,207,132,245,30,245,186,204,169,239,203,39,220,67,75,3,115,63,168,209,53,34,15,163,238,246,204,41,116,164,53,202,116,32,182,196,33,219,30,117,87,102,29,24,135,45,7,2,41,132,162,130,89,1,70,33,175,104,172,98,37,27,114,6,41,164,154,205,230,70,3,22,87,115,99,163,153,181,155,33,186,154,36,25,136,210,105,121,204,189,9,115,153,78,76,107,163,221,236,180,55,254,82,24,44,249,233,164,91,225,177,232,22,122,45,200,233,64,208,36,208,238,39,0,243,158,56,107,156,184,143,254,46,153,185,118,241,86,190,200,155,152,5,93,176,120,1,32,237,71,173,103,16,165,95,96,143,190,231,64,14,49,171,27,227,186,123,199,62,187,208,19,184,253,24,72,220,119,157,222,75,169,144,206,209,1,234,168,233,163,251,152,54,142,87,221,221,53,49,213,101,204,4,45,159,182,57,15,18,174,249,182,178,235,47,9,116,0,174,23,57,92,83,232,44,214,65,195,124,212,13,110,42,209,135,28,56,75,56,109,173,105,214,118,104,84,217,117,38,142,129,228,218,104,184,50,145,161,213,146,67,222,204,49,68,145,161,130,238,111,183,139,21,84,169,176,243,223,197,170,91,133,222,127,85,50,228,131,231,9,189,10,228,173,194,138,39,121,20,190,79,212,156,82,83,94,127,192,250,232,162,165,149,226,86,253,20,54,41,210,193,41,195,156,136,96,239,240,69,200,32,192,45,74,181,147,57,144,20,57,84,102,253,40,149,231,240,24,86,214,222,1,34,38,112,209,67,161,35,250,206,201,169,132,254,192,202,218,234,18,247,179,13,42,104,120,161,71,122,49,120,240,229,75,86,63,105,190,182,79,249,104,19,169,43,23,143,217,65,4,221,237,225,111,182,165,54,54,108,221,157,12,245,13,20,76,75,185,180,104,10,55,221,164,202,213,6,163,89,168,153,198,175,58,31,15,150,28,228,19,164,210,223,255,22,244,96,17,2,22,255,215,19,10,168,15,39,5,101,126,34,34,189,61,21,14,203,211,81,111,36,176,18,76,14,170,227,180,16,52,9,251,183,239,99,211,99,88,183,198,117,71,93,33,230,222,50,47,229,49,70,57,231,189,188,26,132,134,149,104,178,223,205,71,167,27,49,58,71,123,140,152,168,202,19,128,44,196,74,24,225,221,137,66,29,31,68,104,42,132,220,225,182,46,103,107,51,242,78,228,186,113,73,155,74,189,195,170,143,103,138,22,18,105,130,136,187,109,45,137,43,20,168,219,141,13,103,17,148,163,187,107,210,104,234,0,154,120,140,190,169,92,111,43,114,43,178,178,126,255,120,180,189,121,32,191,255,111,184,33,225,19,166,73,245,239,212,53,224,67,12,69,23,112,209,77,44,247,65,32,181,78,18,242,231,52,135,153,164,60,122,158,159,234,107,182,228,0,122,20,22,112,143,163,62,143,99,196,100,160,73,229,29,10,217,123,124,116,152,15,139,214,232,91,148,122,118,143,242,9,234,172,44,68,41,52,115,132,152,205,189,189,203,153,207,172,146,234,114,250,227,78,142,33,245,120,47,36,88,219,243,134,170,246,220,242,202,167,54,11,67,32,171,136,52,105,193,74,210,226,186,165,107,164,49,138,100,27,84,237,118,217,66,91,94,41,17,106,250,38,196,91,11,254,74,91,145,71,23,87,248,71,234,237,246,71,101,209,69,36,105,161,196,19,200,134,136,246,178,160,176,88,19,226,102,214,137,84,138,75,43,51,175,250,36,201,59,0,27,194,37,233,23,38,65,59,69,250,97,113,229,69,58,81,213,22,4,32,79,8,8,36,244,201,97,154,1,218,63,204,81,64,196,155,32,226,142,176,187,209,100,239,240,160,171,230,2,80,29,251,208,232,232,41,4,172,28,139,117,152,82,239,68,33,244,150,39,10,113,234,176,74,103,135,115,15,233,127,108,58,194,129,72,67,201,26,228,55,58,180,149,154,173,6,248,195,46,58,118,1,165,161,38,15,166,71,90,186,130,115,66,43,184,33,153,38,74,180,168,230,155,91,205,72,197,135,217,251,7,37,83,184,248,224,161,247,127,3,174,104,12,114,250,254,195,7,205,170,127,31,21,208,111,165,207,29,112,173,225,207,82,32,167,234,26,36,120,245,187,2,184,161,144,172,141,120,137,49,193,235,66,176,68,166,175,234,10,229,152,59,38,75,78,186,79,84,63,76,32,32,159,15,221,139,106,104,88,188,221,35,77,137,62,56,56,216,59,12,80,86,183,195,58,79,19,91,219,26,212,77,76,47,139,161,69,143,151,219,238,163,179,226,19,163,63,59,47,58,29,213,250,19,152,176,197,74,205,205,182,231,92,101,99,65,167,51,143,222,20,123,180,209,87,99,3,27,227,88,160,72,214,204,240,57,147,236,106,182,232,166,240,175,90,245,142,132,157,226,38,246,109,112,200,239,131,49,222,24,239,226,99,135,79,195,234,117,79,228,87,162,122,169,208,209,173,225,84,62,73,159,72,172,190,130,188,57,21,78,66,155,191,85,156,183,160,57,212,232,169,255,186,144,151,122,237,9,117,159,217,253,202,133,85,63,96,64,201,222,37,8,40,130,189,189,163,142,27,90,251,238,129,104,223,59,16,108,17,96,147,142,207,161,223,133,127,190,183,227,99,160,233,168,43,206,171,82,54,196,120,183,2,228,128,134,11,4,172,111,10,119,194,242,26,7,36,16,147,139,16,136,200,209,144,195,177,193,181,87,43,20,83,231,162,8,40,211,148,171,72,50,81,141,136,47,20,101,105,185,145,149,55,193,28,216,194,85,207,225,88,239,79,127,75,70,239,187,124,76,61,171,115,222,190,141,232,73,202,19,246,223,37,155,202,8,115,156,62,156,58,25,10,70,239,235,126,63,39,71,255,36,106,213,123,189,87,249,144,226,188,30,161,255,202,189,16,48,199,209,113,100,167,14,82,54,125,255,72,181,33,174,214,187,123,10,98,145,36,29,121,33,59,180,118,61,85,200,226,66,10,171,237,151,157,45,20,164,195,218,234,180,57,126,254,249,243,173,142,64,64,156,250,168,38,99,30,165,37,123,176,69,77,83,26,0,244,216,104,66,159,83,76,177,49,77,91,39,35,18,201,130,160,10,25,69,70,23,244,137,217,102,77,143,60,74,142,21,7,75,166,96,86,234,13,244,219,233,191,139,51,235,163,73,192,175,9,168,248,22,192,209,183,167,105,48,183,87,75,5,136,247,68,153,169,55,5,152,34,205,221,147,112,69,156,61,242,185,233,111,210,228,232,215,170,190,125,149,83,228,248,149,215,125,250,65,42,93,241,146,126,8,172,110,111,127,63,106,217,232,25,66,167,31,208,244,221,219,115,240,143,153,188,66,155,40,151,206,134,1,114,215,73,31,132,221,119,58,91,174,208,21,194,34,32,247,57,123,45,144,47,90,196,142,60,235,80,23,208,86,130,210,222,144,227,33,9,69,185,213,20,69,224,42,182,236,3,232,210,86,206,4,132,48,185,213,96,84,146,174,125,163,93,4,57,124,84,127,251,191,74,78,69,182,144,184,31,160,27,78,222,21,6,212,191,75,254,8,123,203,68,169,20,68,214,59,97,176,222,244,78,5,81,20,6,235,116,64,153,51,164,248,38,138,160,251,189,40,44,36,180,228,117,223,209,188,185,121,117,124,124,156,106,17,24,232,149,159,222,59,114,239,208,9,3,52,175,27,89,18,91,68,45,82,145,144,34,34,201,118,66,155,168,101,67,194,53,208,33,100,38,228,133,160,239,155,44,6,36,2,84,29,243,129,140,139,40,173,2,34,29,38,66,20,197,162,204,18,83,176,189,19,233,146,217,125,144,7,47,121,34,13,1,80,161,66,154,13,135,114,193,40,254,104,56,241,224,49,151,89,167,94,9,77,254,120,127,162,164,200,9,243,182,39,238,173,247,83,34,253,77,63,33,227,136,254,121,27,192,31,52,53,233,15,20,233,4,212,61,244,135,159,88,121,219,127,149,244,121,95,254,199,33,92,18,97,172,131,28,168,88,235,165,180,173,199,130,187,135,121,205,39,157,195,35,199,191,163,15,144,59,235,9,109,226,145,94,217,186,140,160,188,68,38,189,195,76,250,115,114,133,74,255,129,1,37,90,122,43,32,59,207,82,22,131,144,134,6,21,54,228,20,87,95,164,0,9,234,32,9,149,74,179,145,81,102,41,44,47,163,171,65,152,163,231,121,27,105,92,69,49,186,248,62,84,122,128,27,72,11,246,153,57,201,115,183,164,201,91,100,10,79,34,206,75,228,168,187,32,70,130,227,55,199,70,131,183,199,201,65,207,1,239,162,74,239,13,97,63,131,173,27,96,98,121,119,147,164,57,94,209,252,245,42,17,229,107,15,163,58,186,119,32,16,80,234,166,161,240,137,23,36,116,67,106,177,198,144,224,247,0,90,11,65,186,211,81,145,58,64,214,44,161,218,98,111,147,23,106,164,180,201,6,149,228,145,182,90,235,10,93,181,149,166,120,211,253,235,72,165,131,57,90,178,122,177,242,230,132,52,168,78,188,215,25,77,97,200,47,185,244,238,157,52,41,180,204,47,105,225,110,234,219,59,16,59,249,223,127,255,239,111,69,254,224,48,123,122,134,39,76,133,20,10,61,223,18,219,240,238,196,203,159,185,232,210,32,80,33,198,66,64,193,157,202,61,63,245,12,136,235,244,94,192,171,251,18,88,202,135,0,237,147,100,213,43,198,173,60,47,245,138,237,228,2,2,52,32,167,250,106,218,216,11,46,137,238,1,136,46,154,225,219,219,99,223,153,131,131,142,218,153,1,227,144,96,189,8,190,59,22,75,49,19,104,119,180,98,122,201,222,48,29,245,86,34,89,144,5,241,36,108,203,225,88,29,218,88,158,27,132,121,213,132,216,114,185,69,254,128,217,187,225,122,190,193,171,12,206,124,67,166,0,206,161,63,240,247,5,79,61,233,146,255,77,198,86,17,97,77,70,9,99,234,52,189,24,84,164,62,121,155,42,210,3,206,128,130,15,244,152,57,141,78,153,5,23,157,231,19,150,222,166,160,73,120,232,185,239,113,252,234,117,63,241,8,33,64,81,48,21,195,238,35,105,69,168,239,81,167,167,15,200,85,17,111,205,248,251,225,46,19,34,168,136,238,24,143,128,69,192,37,59,17,64,113,83,107,107,219,65,189,47,95,118,188,58,61,154,50,109,181,4,87,111,109,210,255,96,212,253,89,184,118,182,162,80,209,77,87,230,80,228,182,240,205,76,68,144,11,34,114,216,39,124,228,143,55,148,45,145,138,23,58,197,131,139,191,15,150,235,68,211,134,127,255,158,247,194,124,239,70,150,59,134,239,82,155,178,40,93,59,201,145,163,244,210,93,100,157,28,159,30,191,13,14,41,2,222,193,26,68,57,228,9,169,240,71,204,79,60,142,74,182,87,128,202,133,83,232,38,86,79,221,52,18,4,200,3,41,71,135,254,149,128,14,40,161,58,164,208,50,106,236,245,208,121,102,111,119,255,96,175,235,40,160,206,110,135,5,8,93,149,180,237,8,202,187,237,128,44,105,16,153,88,108,88,198,50,117,111,11,240,44,186,4,48,2,18,81,91,164,60,76,133,59,39,52,97,80,201,190,218,72,253,25,51,42,117,209,9,46,100,230,41,197,166,178,41,210,66,133,240,251,191,99,178,139,119,201,74,113,44,136,172,247,191,14,196,222,223,229,149,233,39,30,229,61,205,3,188,201,235,56,126,251,246,237,241,219,60,71,200,110,101,57,226,253,56,160,37,108,21,64,164,181,42,211,95,203,3,33,176,55,117,46,59,254,36,65,149,12,171,212,178,172,19,40,82,160,178,164,214,247,14,204,232,66,215,0,47,217,65,138,138,21,184,102,252,122,21,238,78,84,77,237,40,246,14,30,9,22,113,184,162,55,193,106,63,99,107,172,103,157,192,182,41,144,75,84,67,91,110,135,27,88,20,79,56,175,187,209,101,170,189,225,95,192,246,5,109,90,16,114,158,102,108,145,91,54,26,95,157,249,234,227,206,51,121,170,48,10,211,9,145,19,180,225,93,248,134,14,254,57,137,164,122,255,45,21,136,106,165,78,132,160,166,173,251,214,241,163,16,86,61,54,141,235,71,248,36,149,75,17,211,203,94,89,1,198,34,198,68,248,94,233,146,99,104,117,213,75,29,29,67,58,161,89,86,47,242,235,240,220,77,76,153,98,239,68,78,4,113,95,166,68,118,247,14,15,148,85,71,99,13,161,71,97,104,237,81,137,48,5,178,69,83,11,54,22,72,194,114,182,14,123,5,160,108,89,125,20,219,106,49,182,37,216,161,124,66,60,218,78,14,91,86,186,25,190,232,180,169,168,48,112,150,42,49,237,146,49,216,40,5,143,248,150,199,82,60,108,223,222,200,26,27,197,42,220,127,15,228,212,29,220,16,233,91,218,189,40,243,60,121,95,112,204,79,130,97,34,3,210,207,193,37,167,166,142,79,223,158,22,114,32,111,216,53,246,56,239,223,208,119,29,146,3,77,94,147,4,236,89,198,78,191,30,237,61,38,58,203,219,104,132,129,213,43,48,137,218,251,10,177,184,79,220,201,209,17,52,8,122,1,29,177,236,83,24,7,69,181,32,175,20,107,164,204,74,125,128,118,2,0,132,2,67,181,23,99,129,39,154,55,176,176,144,250,252,217,179,188,146,77,97,44,42,101,15,38,26,79,120,52,171,65,146,108,168,143,172,41,118,124,104,182,196,35,109,185,39,188,138,4,112,160,78,138,161,247,223,7,154,149,253,158,183,54,209,254,62,207,210,22,1,14,110,242,194,224,61,61,245,62,215,182,240,167,170,231,76,234,163,207,134,63,111,114,12,208,235,55,69,13,162,8,10,122,5,188,22,208,29,241,222,94,216,190,189,227,87,135,169,55,147,128,14,169,133,67,196,24,59,202,141,168,21,41,130,90,8,249,118,77,159,119,233,132,116,160,58,118,187,222,251,18,104,247,174,90,101,117,183,58,130,101,109,41,212,72,36,144,40,178,165,82,127,148,205,114,120,65,135,120,17,130,122,200,35,13,196,120,221,228,109,101,88,110,46,188,136,64,158,201,36,188,24,80,201,100,101,185,158,9,44,4,117,137,140,227,246,160,149,245,251,31,120,133,239,127,253,237,125,161,234,246,148,237,46,5,78,164,254,120,155,87,18,14,54,198,34,56,17,78,124,14,135,235,247,10,109,72,95,15,54,132,149,165,245,10,41,65,82,228,216,139,12,137,56,121,165,32,111,52,136,21,118,20,30,98,223,189,244,131,94,39,213,169,119,189,76,93,186,68,35,2,188,10,129,88,32,236,59,29,134,21,195,13,145,35,130,200,111,167,35,124,22,138,162,73,145,205,142,87,150,111,118,218,157,84,22,242,140,89,194,78,83,177,65,74,45,209,65,194,42,107,134,174,240,51,46,235,96,27,234,149,136,208,51,115,2,11,160,41,140,35,60,200,1,63,36,220,144,212,176,76,173,52,28,35,199,236,237,187,247,167,94,31,149,119,43,59,141,180,20,220,244,147,28,237,115,66,236,66,64,227,60,220,94,80,234,209,239,210,59,92,147,34,189,190,87,31,72,110,165,162,104,32,119,15,35,47,149,58,207,228,252,209,235,119,58,132,202,245,246,251,81,166,131,182,241,221,206,193,46,113,39,70,138,206,254,222,14,251,107,176,195,242,142,26,246,50,33,34,141,190,181,141,82,29,128,173,95,110,169,115,217,243,212,134,151,125,49,80,14,216,105,61,115,133,142,76,136,243,71,102,178,134,139,78,163,214,217,64,156,144,57,71,216,205,117,124,71,3,56,75,140,98,14,58,98,95,52,128,235,16,100,95,21,160,164,10,44,190,31,236,8,123,250,171,187,234,121,43,216,211,212,133,148,58,132,0,107,239,113,169,142,213,158,32,60,118,165,49,80,120,112,220,143,58,144,55,253,55,121,122,144,87,175,0,117,143,230,138,114,72,208,38,203,152,230,216,113,189,3,152,19,181,82,238,21,147,84,61,70,178,60,143,139,178,194,195,35,163,7,220,244,253,206,30,176,214,96,14,2,73,189,150,173,139,118,26,76,82,69,240,132,61,98,17,94,68,83,13,84,168,11,30,183,197,34,127,97,227,212,102,134,101,7,29,247,232,26,174,35,36,168,208,220,157,75,78,119,196,215,190,153,145,69,248,133,34,194,27,45,249,45,77,183,208,32,185,242,25,84,191,23,51,233,209,209,143,157,27,130,67,84,234,153,155,188,81,127,251,150,77,121,223,8,249,227,17,44,169,146,99,147,82,167,209,34,160,135,168,150,8,97,167,147,55,121,240,42,119,15,225,128,64,115,28,247,28,212,235,76,146,227,178,94,81,141,176,64,68,78,34,201,209,57,244,148,58,204,221,253,35,15,189,155,200,218,221,237,161,80,199,164,21,90,51,17,122,178,189,179,199,250,206,110,142,33,229,123,71,169,194,40,192,149,39,66,89,181,233,37,234,94,3,237,133,106,10,100,17,40,10,158,240,236,160,152,192,253,17,104,13,207,141,120,64,69,186,196,147,38,27,45,42,151,102,150,81,22,210,20,43,140,205,43,20,166,127,0,163,120,59,254,164,65,0,144,59,45,116,74,118,176,251,59,175,64,240,38,201,39,162,9,59,147,29,159,68,46,221,217,228,173,23,120,170,59,86,209,184,234,43,104,194,164,20,120,225,181,103,67,94,69,81,180,52,8,251,56,168,100,71,173,46,237,238,1,40,211,137,202,232,35,117,24,223,35,200,225,0,28,114,208,85,163,147,174,250,206,160,222,22,25,67,96,27,186,234,131,201,94,114,108,159,76,244,15,34,39,59,47,205,23,1,226,157,165,8,81,237,25,104,44,213,216,54,29,223,3,144,67,214,218,80,50,170,105,76,177,222,200,69,22,14,230,129,172,215,227,99,19,174,73,211,147,138,45,119,72,104,14,83,241,252,165,208,235,228,247,212,82,252,183,4,234,245,188,148,183,20,247,54,176,81,179,70,117,126,26,189,1,82,219,209,220,15,84,215,209,66,159,228,55,30,236,69,139,153,190,71,222,233,20,38,161,5,10,40,167,155,227,171,95,9,81,205,134,114,121,139,191,62,27,1,29,210,218,237,185,71,2,0,233,126,52,191,220,53,47,93,244,232,118,9,33,101,228,125,119,27,33,247,61,77,86,64,133,200,118,87,6,47,132,151,16,14,59,68,200,181,217,120,236,185,250,34,170,255,88,219,203,59,132,18,17,206,132,150,18,36,82,59,228,82,179,17,10,34,44,170,117,132,76,50,220,168,235,199,97,109,53,91,158,47,129,114,231,85,158,15,41,90,189,191,195,49,4,232,29,53,83,128,55,124,248,53,149,21,70,219,56,39,141,215,63,71,107,247,66,249,129,252,141,68,18,91,126,206,65,8,109,158,218,37,23,253,16,86,29,244,123,4,189,123,227,25,53,210,80,110,253,176,127,92,232,181,24,181,34,61,29,212,28,235,72,17,19,240,71,239,104,239,232,96,143,185,144,189,46,250,5,176,87,0,195,188,221,189,168,134,166,14,113,152,195,118,148,235,236,192,49,68,101,200,139,231,236,90,70,231,208,203,111,219,158,73,71,216,164,41,151,144,49,147,76,218,28,177,146,141,44,55,110,105,254,214,235,12,160,136,70,36,140,66,43,17,94,105,153,106,111,139,124,127,249,168,27,16,123,255,20,10,11,61,202,107,156,225,28,18,177,171,119,121,211,234,83,31,139,164,250,181,55,74,158,187,187,241,182,127,26,28,242,26,236,241,182,167,52,186,42,160,63,146,90,232,127,201,144,226,107,32,71,123,234,32,167,110,164,194,155,28,59,184,90,173,78,14,143,250,133,169,60,238,124,152,107,222,245,134,239,240,210,149,45,60,208,76,4,40,116,54,2,218,83,240,29,188,18,64,147,173,212,118,166,195,244,237,86,219,17,165,234,2,215,82,109,97,94,114,27,33,94,179,176,36,108,154,185,133,219,12,133,225,100,201,234,70,150,186,104,211,160,163,66,210,173,51,168,197,123,45,234,119,208,231,171,143,209,239,206,32,191,253,22,83,93,78,127,117,136,67,94,199,150,122,105,192,0,126,203,6,1,108,99,242,166,152,171,125,51,48,134,194,72,162,246,0,39,68,173,191,46,98,20,243,151,103,209,89,20,66,23,253,216,123,49,57,196,1,57,145,99,38,211,163,161,6,210,233,61,184,132,14,124,239,123,155,147,61,52,46,59,220,85,239,50,227,143,125,100,212,247,188,193,137,202,210,65,157,109,132,179,232,9,250,234,111,163,85,239,206,11,0,29,188,81,254,139,173,232,91,214,222,218,76,165,130,94,111,27,54,86,139,11,13,115,214,249,32,169,114,145,102,221,67,140,235,235,235,154,173,3,1,214,76,202,189,41,129,183,49,200,33,191,231,3,113,213,64,142,34,235,125,42,212,201,219,3,228,233,16,245,106,72,197,32,167,142,132,131,34,63,121,147,7,73,188,35,111,239,13,26,198,113,102,203,107,47,99,27,112,11,29,138,101,98,233,184,231,237,203,188,116,202,155,106,188,114,37,130,202,144,148,19,65,69,116,120,35,7,7,166,209,85,233,105,94,122,231,64,221,2,246,153,154,234,176,213,251,54,211,83,219,59,126,216,246,78,189,91,219,169,64,100,171,211,126,249,242,197,75,182,1,122,30,125,193,149,54,220,76,45,73,162,92,7,89,194,166,59,133,13,6,172,214,83,68,203,233,98,226,10,90,126,93,244,49,233,213,84,234,74,52,107,185,117,108,50,171,85,208,33,57,238,231,183,83,232,244,247,129,120,255,45,162,188,239,189,31,239,219,211,228,153,159,188,37,136,154,26,163,127,202,116,7,87,187,23,163,63,142,33,132,228,253,169,120,144,77,176,216,249,53,245,101,96,209,179,32,38,199,40,76,135,199,193,41,72,61,199,84,219,243,127,68,72,111,47,144,188,142,197,162,55,14,82,28,245,186,170,73,223,59,128,173,203,49,33,187,61,54,53,17,200,122,187,27,129,43,96,122,183,183,153,248,144,194,96,45,2,51,133,230,121,108,226,234,57,80,64,106,185,239,243,89,16,101,100,129,51,144,113,91,142,12,21,50,97,131,234,195,81,37,28,137,100,188,80,111,144,2,70,2,59,217,97,189,86,95,175,131,51,214,215,121,47,227,149,189,235,228,10,243,23,215,161,128,234,84,61,131,205,103,104,89,165,30,1,234,230,71,163,215,156,191,15,161,207,83,234,35,25,85,206,24,202,8,246,7,178,227,125,175,60,167,213,132,162,115,47,2,233,57,134,225,48,247,198,95,165,70,38,61,178,133,0,112,110,66,113,76,152,32,213,125,54,232,165,27,162,158,201,221,163,104,195,212,217,61,194,123,143,217,115,53,76,54,166,64,7,107,212,29,104,136,206,14,129,214,44,238,4,150,151,45,128,96,237,118,118,94,118,158,191,220,2,206,157,57,16,226,75,208,94,23,243,186,90,238,127,56,32,203,227,179,110,42,101,33,159,234,182,176,235,25,22,125,93,107,207,117,199,41,179,189,198,51,182,250,58,9,100,39,119,228,27,45,19,106,18,109,198,33,239,63,252,246,158,181,157,239,141,47,236,195,111,191,125,248,245,131,44,171,247,31,8,120,127,251,235,41,85,5,90,149,153,230,38,118,250,45,59,88,158,188,41,180,145,137,78,187,175,123,199,234,139,241,138,21,105,108,234,163,0,33,125,57,150,223,120,223,246,62,227,85,199,40,77,3,122,4,252,161,12,109,15,53,81,125,105,239,163,163,227,222,81,106,207,219,59,114,39,144,152,159,158,153,84,251,123,38,158,20,73,220,219,219,83,47,19,86,19,162,155,9,59,154,236,108,65,66,117,25,173,234,118,2,6,199,74,16,193,119,169,218,159,115,10,142,122,42,146,19,80,66,78,104,250,150,58,53,180,158,9,25,221,106,111,176,104,205,189,240,102,146,81,27,124,240,197,7,235,206,6,78,25,209,200,72,102,124,129,179,177,81,198,143,32,69,189,217,8,17,7,199,48,76,170,223,35,220,206,122,244,223,242,217,82,239,242,98,53,179,92,79,11,73,168,32,197,235,55,175,19,158,138,125,23,194,88,117,16,232,177,154,93,217,130,51,225,132,6,75,62,103,34,186,82,171,170,246,48,138,111,122,222,94,223,219,100,120,164,189,151,215,219,6,206,231,176,123,208,59,144,238,62,224,228,3,38,62,112,80,119,69,33,75,224,5,70,211,106,22,118,118,20,208,125,206,73,70,196,49,64,48,113,246,132,64,63,108,176,212,81,168,189,197,18,155,14,138,56,85,199,25,177,168,166,35,226,50,95,118,50,64,13,175,154,46,112,181,182,182,86,183,247,202,90,102,23,43,235,25,126,84,91,171,129,79,76,152,25,97,140,85,40,225,72,50,227,16,246,239,147,145,251,33,92,193,20,190,210,140,60,181,69,166,215,113,114,250,46,149,66,245,11,65,170,20,183,141,144,57,164,81,234,27,147,247,108,23,135,244,99,209,163,141,251,145,147,131,4,233,21,218,186,39,210,228,219,254,190,90,97,165,74,91,65,74,248,58,8,114,104,80,168,156,13,14,4,113,136,162,234,108,95,194,19,223,105,163,17,236,11,105,239,124,166,20,67,37,234,252,205,134,25,94,101,219,110,122,222,2,104,118,55,143,154,156,152,215,200,18,63,212,234,65,14,29,106,235,107,216,50,28,106,107,32,78,29,23,107,235,70,16,163,67,141,236,34,1,166,19,9,146,84,198,111,105,236,1,35,37,169,177,76,248,230,116,253,82,151,152,55,97,26,177,50,83,54,17,57,193,52,115,175,119,204,29,202,248,216,123,184,250,24,22,63,82,52,29,28,184,130,96,147,18,78,89,67,231,252,195,14,175,24,81,87,143,159,195,14,26,190,194,164,69,31,172,30,134,228,161,39,217,222,17,14,100,15,111,97,194,190,75,59,142,19,213,184,175,110,55,159,106,168,215,142,90,201,188,240,96,85,43,242,180,105,206,77,161,223,168,250,53,16,49,170,182,76,25,241,108,205,8,238,82,86,133,64,194,67,191,182,190,158,184,3,92,64,14,169,173,173,172,130,16,245,204,56,197,8,177,150,213,235,164,88,157,138,5,127,72,149,191,46,14,57,13,81,149,6,81,120,223,184,20,173,162,184,66,157,218,219,66,163,152,215,133,94,224,175,131,25,232,52,228,160,144,212,85,151,143,255,81,191,159,71,102,85,115,147,103,97,61,49,222,73,56,146,168,188,113,171,106,63,33,118,15,123,157,128,236,30,28,68,207,165,110,72,171,157,221,112,195,187,201,150,141,214,75,4,248,112,86,33,198,224,144,34,207,53,125,66,109,245,137,217,101,184,170,201,102,75,109,148,63,193,249,131,55,158,242,74,114,239,160,131,93,86,213,93,80,173,96,245,107,53,44,125,141,76,177,106,235,111,199,216,87,86,113,90,177,219,235,171,252,193,218,138,113,204,250,10,56,107,13,255,194,26,58,57,200,186,253,96,170,220,116,248,233,135,15,170,63,7,60,17,5,7,111,17,37,49,221,129,25,158,111,56,195,171,231,54,236,235,152,206,217,59,86,91,202,67,54,202,103,154,2,93,47,14,156,8,108,123,209,99,31,62,108,9,149,0,5,209,101,94,252,200,231,18,117,149,116,101,44,234,232,208,219,133,239,119,99,78,14,65,61,123,189,46,99,82,241,18,73,212,115,137,60,178,19,51,165,152,47,23,71,176,192,86,138,252,197,86,176,134,202,156,217,157,1,173,245,91,28,197,130,100,160,119,9,87,253,25,163,85,109,229,2,25,172,162,179,65,6,105,212,235,89,88,84,146,79,235,212,21,36,194,154,100,149,173,243,234,42,200,176,106,212,168,173,172,232,42,3,169,214,26,248,225,42,37,26,181,143,253,81,86,51,130,156,106,158,170,220,241,15,194,83,135,54,79,85,181,97,218,70,3,165,215,175,66,97,203,88,37,100,42,236,32,127,216,143,250,9,185,150,218,28,31,6,110,138,121,214,125,59,245,196,11,7,65,140,125,245,209,39,194,237,176,179,23,173,120,125,0,200,190,184,161,211,245,70,238,97,218,194,186,237,202,215,80,240,214,131,82,169,155,76,231,37,230,16,162,255,213,243,205,206,243,168,48,240,38,100,108,14,211,244,2,64,59,215,59,45,214,14,52,3,14,138,205,28,60,123,107,55,50,108,72,111,128,20,13,105,10,80,98,117,213,150,120,85,52,176,221,62,44,107,207,150,113,178,59,203,184,240,235,213,248,61,41,136,203,181,179,103,254,74,136,143,49,199,135,15,26,152,243,254,61,170,57,57,211,139,61,176,250,168,234,244,158,124,39,234,169,11,183,194,103,5,211,156,77,229,51,253,92,222,244,15,15,98,156,96,234,134,24,99,187,120,234,246,186,164,202,209,193,145,79,240,218,75,120,92,53,85,58,210,96,85,245,111,247,162,130,238,126,103,159,169,166,93,14,147,218,79,149,181,187,8,167,119,213,250,74,69,131,59,40,193,137,128,225,203,24,133,187,185,229,185,114,206,126,98,248,150,14,135,183,90,16,200,170,41,91,10,195,131,55,50,78,185,109,210,91,96,186,207,116,111,189,65,247,47,171,187,170,168,175,24,49,176,166,36,131,228,19,94,43,89,173,182,172,93,7,219,106,188,94,94,94,193,15,237,87,166,94,86,240,67,168,151,85,253,14,73,26,0,0,32,0,73,68,65,84,227,144,191,134,22,255,245,228,221,175,121,151,184,4,110,143,160,186,146,76,116,50,250,137,14,161,173,15,229,82,163,84,156,206,70,207,86,187,155,48,83,61,58,210,20,65,71,212,203,185,145,212,101,147,246,35,214,158,237,98,64,209,161,132,211,225,222,110,23,129,115,86,67,129,17,246,200,14,108,63,182,27,83,189,152,224,64,87,215,46,35,184,93,167,67,39,98,32,9,67,194,14,0,170,51,215,224,84,116,169,218,124,206,138,100,244,87,122,182,33,199,131,244,16,182,7,3,134,21,51,20,110,189,201,120,85,163,65,51,21,62,221,58,204,164,122,38,229,65,195,118,13,107,235,27,201,178,186,108,250,34,168,177,92,205,236,138,244,89,225,197,10,126,0,25,150,217,207,179,21,200,46,251,96,34,139,10,252,196,227,35,145,125,10,88,137,55,217,85,206,239,245,27,21,42,51,47,241,134,54,235,235,96,142,158,135,92,15,242,224,107,62,228,166,183,231,125,21,210,24,34,4,254,40,132,246,14,9,43,164,126,230,112,225,221,67,104,105,206,228,228,200,193,206,174,56,195,187,148,236,106,210,240,246,182,18,177,123,59,154,58,65,244,161,170,55,153,247,83,112,170,19,164,80,231,68,31,139,214,225,220,136,150,106,210,84,120,41,222,0,68,10,46,134,106,7,54,214,161,46,50,143,220,110,184,123,151,173,203,32,130,131,177,78,179,201,237,90,41,10,151,72,164,65,45,49,197,10,143,75,126,161,123,58,215,150,141,42,38,191,236,151,171,148,111,38,178,62,156,124,248,213,3,234,167,118,205,145,69,222,53,195,172,42,111,169,132,66,192,192,61,67,44,177,132,255,168,223,47,132,190,125,181,247,169,143,145,213,70,80,35,154,176,3,97,219,133,241,106,172,179,187,215,219,85,59,246,131,93,104,137,221,3,182,123,3,9,28,165,174,69,199,184,40,126,181,235,178,137,245,54,219,14,173,218,221,219,222,85,190,15,248,195,237,173,168,165,229,188,34,198,110,219,232,120,213,121,233,149,55,47,132,10,197,156,33,151,80,207,124,128,179,145,164,227,197,129,204,168,54,35,88,75,92,194,70,93,194,137,206,119,29,20,105,192,217,112,98,224,185,94,201,86,68,13,59,44,23,36,212,50,88,193,137,81,93,174,46,45,45,87,171,118,185,88,245,155,25,126,232,60,148,45,27,255,172,45,175,46,127,117,230,175,249,216,187,119,49,228,46,90,200,8,175,192,3,218,131,190,142,54,223,189,0,60,187,93,203,35,83,217,61,12,13,52,71,193,108,163,174,105,236,61,220,219,219,7,220,192,104,179,7,217,100,223,162,213,52,75,48,213,235,2,120,116,158,119,80,46,128,55,235,151,183,145,216,3,8,119,143,136,42,150,103,50,32,69,25,181,165,105,44,219,157,109,79,139,111,229,169,240,240,55,94,208,166,122,254,188,157,135,108,57,138,40,117,122,113,148,110,3,40,78,79,17,5,58,119,195,5,84,6,99,202,77,91,4,60,234,244,253,204,223,54,67,213,228,212,106,3,124,226,42,195,246,204,159,123,42,138,42,41,99,84,168,46,47,45,45,85,151,22,131,48,75,56,27,185,86,236,231,43,226,152,108,121,149,148,249,242,204,127,189,123,247,33,213,12,158,160,186,153,77,151,188,76,19,173,243,79,76,151,35,87,193,150,135,17,83,98,219,195,195,87,62,0,216,231,56,30,116,48,37,251,0,209,189,142,60,104,211,5,7,7,251,225,65,123,155,189,221,253,238,174,244,178,124,234,46,186,244,192,127,136,207,204,30,237,33,60,190,219,37,75,32,30,149,172,89,87,22,240,50,188,166,185,227,41,38,14,42,146,179,33,140,27,66,181,29,71,231,110,170,203,55,204,42,13,71,111,179,224,191,211,246,194,127,66,161,189,106,179,129,104,8,242,124,245,136,65,53,32,165,108,245,215,215,220,164,114,11,137,180,88,117,83,106,57,4,84,109,185,42,194,24,37,32,172,72,143,167,75,164,133,93,45,215,150,120,191,202,151,253,193,74,18,100,95,26,135,188,27,24,30,229,141,99,212,99,55,111,220,218,239,189,122,195,153,29,61,47,89,146,9,187,207,110,97,56,3,227,97,12,1,49,179,135,22,60,200,7,117,59,251,7,251,234,193,131,116,132,9,124,92,163,101,174,241,7,146,67,124,224,59,187,59,187,202,223,169,88,195,39,22,168,105,40,187,144,160,223,49,139,249,85,235,207,190,174,30,35,220,246,14,137,234,79,178,19,51,213,52,160,206,15,237,231,109,164,198,217,68,250,153,198,222,176,227,139,119,114,221,104,102,104,203,39,137,101,58,164,149,129,73,76,50,129,12,12,2,66,72,81,110,213,205,165,171,213,168,126,237,109,38,20,37,213,242,234,138,228,15,25,163,170,117,94,92,94,92,204,200,14,79,141,4,32,71,117,177,26,87,96,25,126,200,32,193,236,163,253,148,148,49,14,249,171,70,222,189,139,126,37,132,231,114,132,51,123,44,156,168,73,40,133,213,155,195,98,121,248,97,62,125,0,6,43,20,243,161,20,192,254,190,30,118,181,23,17,13,118,189,237,122,55,230,58,178,145,113,116,94,119,191,26,65,89,233,230,52,11,181,187,165,150,136,222,127,79,223,110,135,182,64,31,228,151,91,47,241,70,121,205,139,23,157,173,205,151,47,124,132,185,166,212,110,106,66,151,0,160,198,15,207,4,78,240,116,95,134,30,24,172,201,140,220,158,231,45,214,253,176,238,225,40,198,163,232,244,37,63,195,36,254,218,106,168,103,103,136,76,202,187,42,158,88,202,170,79,171,188,88,90,124,186,88,125,10,90,216,1,172,82,173,102,56,241,210,136,182,100,42,164,10,246,249,11,9,194,168,33,74,111,78,208,146,250,84,201,38,26,185,68,16,250,24,90,111,21,118,144,170,147,220,149,99,109,210,1,51,16,232,151,160,129,41,88,123,174,117,151,186,119,207,165,13,27,229,118,85,77,182,19,49,167,29,201,30,216,168,221,100,183,166,96,224,182,123,120,59,234,203,238,99,212,58,47,137,83,223,4,180,237,37,75,105,195,156,242,138,14,205,116,68,221,19,218,182,49,189,65,236,14,234,143,217,113,186,193,116,56,83,118,205,245,22,114,74,128,183,193,229,171,103,117,102,48,214,107,245,20,170,181,247,202,250,26,130,31,17,4,89,117,97,179,178,82,11,75,202,158,244,37,145,130,2,138,107,255,244,233,66,21,36,88,176,215,83,187,178,207,70,21,210,101,145,244,88,170,234,15,36,208,206,66,100,189,21,114,36,42,253,123,125,230,190,19,18,132,249,163,195,67,159,43,212,233,245,246,123,114,216,76,89,28,237,163,116,143,124,129,57,229,123,187,208,4,29,118,175,224,244,160,14,187,121,119,136,161,205,135,17,136,33,188,149,241,118,87,0,91,185,12,93,245,4,117,42,108,117,242,89,5,174,182,57,207,121,155,48,42,243,252,0,216,193,252,130,231,144,74,17,35,100,79,146,98,156,48,141,195,65,105,165,185,224,166,192,29,127,30,69,178,235,173,150,249,222,166,179,201,31,56,214,104,228,154,163,145,209,231,91,129,215,102,6,21,220,135,90,182,154,193,132,146,97,187,178,98,102,214,18,5,213,242,210,162,51,132,93,44,26,75,128,2,213,165,133,197,167,213,5,238,184,107,215,246,141,62,25,209,236,6,121,73,34,236,41,68,22,52,121,191,95,28,239,17,99,210,142,57,228,70,160,243,227,221,132,236,48,91,105,183,39,5,12,150,240,36,4,155,123,130,21,58,59,14,211,68,172,181,195,213,102,167,226,45,84,185,118,98,102,224,214,78,180,24,217,210,168,205,29,175,208,216,222,113,159,194,7,20,236,108,165,98,129,20,180,221,1,204,243,229,115,198,206,95,116,212,64,9,137,12,24,84,152,224,204,50,114,245,112,133,140,82,103,145,166,195,118,76,60,213,179,166,0,9,235,1,69,8,33,69,115,170,33,221,93,147,89,187,70,245,189,10,143,193,220,189,181,36,158,10,91,205,196,20,214,179,234,236,1,129,84,213,110,203,255,212,88,99,129,20,49,82,44,44,46,44,100,79,197,34,164,88,21,151,213,16,114,70,144,52,196,185,80,220,239,165,77,74,124,167,246,221,40,65,222,63,116,229,109,18,106,191,179,223,217,247,65,191,59,219,80,11,209,75,93,97,37,240,7,167,208,109,231,165,23,246,120,147,96,62,64,94,246,234,246,203,14,1,206,91,222,57,55,208,207,133,164,222,139,78,123,39,74,55,118,188,136,156,121,239,23,202,98,128,0,157,173,173,194,16,137,168,146,109,186,137,139,182,22,16,81,129,217,49,110,105,153,54,55,143,175,189,145,213,153,3,175,103,140,136,172,25,103,72,74,153,140,82,100,67,42,99,117,101,5,178,105,117,153,39,42,12,99,10,201,41,174,232,210,146,150,26,178,106,97,1,111,108,75,32,69,86,49,114,44,224,174,157,140,67,158,46,224,104,146,236,41,55,74,55,219,77,100,189,245,98,51,85,97,122,91,30,54,221,57,86,111,145,30,103,149,67,155,239,115,12,221,97,103,119,55,156,183,67,31,87,179,171,94,84,26,96,138,254,233,29,135,48,239,132,146,166,31,193,239,183,217,226,197,108,84,239,111,232,89,35,185,113,158,202,195,149,31,94,2,182,246,130,249,139,151,252,130,109,197,232,108,119,84,28,219,209,108,168,205,150,154,194,176,93,180,168,210,244,206,98,109,214,189,54,5,182,201,75,149,3,56,181,158,210,17,136,216,102,107,138,214,122,148,214,152,100,25,65,16,216,81,139,180,132,228,224,33,24,178,104,234,219,76,169,50,200,177,104,124,1,205,109,143,61,52,184,45,119,182,80,5,91,44,130,41,108,43,235,93,230,133,145,168,108,50,203,174,76,102,145,64,248,139,165,167,95,129,67,82,179,214,222,107,7,33,176,209,97,15,225,169,87,161,59,20,131,69,208,201,212,245,129,138,189,183,119,119,52,169,145,86,235,54,31,250,8,177,110,37,24,32,176,28,10,131,111,69,167,182,72,101,51,200,177,211,6,186,96,235,197,14,195,127,156,197,133,51,167,94,43,36,8,55,251,57,147,173,82,220,47,125,124,60,39,159,61,231,132,89,14,116,50,221,253,204,199,214,0,55,213,108,181,212,209,37,67,203,29,225,211,116,96,5,121,189,94,167,142,64,164,176,134,80,58,146,73,25,252,239,149,117,83,25,212,220,43,112,49,114,215,187,32,168,150,150,171,225,93,60,229,225,41,37,207,2,180,3,215,59,3,17,42,220,159,60,121,130,55,79,118,129,219,105,91,228,239,65,186,12,12,117,150,4,121,205,182,235,132,39,160,253,125,79,144,65,228,251,142,29,237,79,211,170,187,123,100,214,109,103,143,72,14,224,201,183,189,52,143,15,185,247,201,35,3,196,48,64,214,91,236,108,146,77,94,114,220,150,79,143,199,186,111,121,167,226,118,231,133,60,57,207,224,117,56,190,252,249,166,79,134,207,189,138,77,143,130,168,67,104,171,237,51,50,11,195,85,10,141,167,216,123,36,32,205,84,23,1,168,5,214,182,161,0,186,43,14,15,218,54,214,137,49,84,2,92,137,139,85,200,165,108,133,142,219,138,108,41,227,14,202,168,69,248,222,16,82,139,148,57,85,240,5,158,119,123,151,125,149,23,125,225,159,60,41,63,121,82,169,36,154,148,159,240,118,165,188,24,2,77,60,100,124,98,4,233,71,255,98,66,65,28,49,149,79,76,241,96,149,41,242,94,151,29,212,81,169,215,145,141,68,8,185,247,232,6,26,214,107,89,115,84,7,236,209,173,54,147,116,90,112,95,95,205,172,233,176,231,17,166,210,169,52,159,125,169,208,85,4,93,39,59,209,245,5,13,20,140,58,230,209,145,19,58,248,2,8,41,149,41,111,61,67,111,251,78,148,253,161,89,18,251,135,48,124,206,70,34,1,14,172,27,115,212,235,12,19,110,48,11,206,232,84,67,167,117,207,242,173,68,126,207,195,82,242,50,156,49,16,247,168,46,39,51,213,232,65,181,109,162,6,194,103,145,151,33,146,200,29,182,238,79,42,182,251,139,68,225,101,217,190,170,84,76,173,216,231,10,127,90,46,139,111,76,169,155,238,238,189,230,144,167,227,195,87,49,24,219,129,7,169,39,2,60,63,20,127,171,232,165,139,62,221,74,59,36,235,39,105,229,208,199,70,9,169,99,200,28,116,70,120,254,124,43,113,129,46,183,216,255,104,235,249,11,183,86,159,183,212,132,135,215,68,224,48,200,129,8,136,46,92,54,21,44,217,152,110,211,244,238,45,236,89,213,130,68,42,168,9,42,13,123,248,25,10,169,215,21,16,169,215,25,158,90,91,87,84,202,196,23,101,21,34,133,20,86,146,82,43,185,140,242,32,200,211,144,82,100,11,24,79,75,208,213,25,229,84,197,73,81,113,41,53,143,229,159,159,175,44,204,219,113,30,194,139,87,79,98,3,247,216,143,23,158,132,4,3,135,28,3,71,235,72,194,87,189,227,0,220,48,64,117,160,132,106,7,40,2,51,112,119,246,182,3,89,227,202,154,18,203,221,183,77,83,203,246,60,83,55,191,244,81,153,47,209,172,91,131,145,201,2,48,80,209,98,167,13,88,57,75,91,85,156,143,111,158,109,66,7,136,83,204,187,70,77,184,6,57,114,24,51,72,33,0,58,211,222,208,223,36,77,71,44,161,102,46,237,168,188,72,78,70,42,211,112,220,26,13,91,32,12,106,141,117,79,180,186,231,23,33,194,60,135,164,80,147,226,32,203,89,86,197,78,97,245,84,70,107,117,97,201,52,54,164,84,181,76,139,170,42,182,128,148,90,112,249,100,20,88,176,215,124,133,36,209,245,2,40,98,55,196,53,36,139,254,132,4,129,190,0,25,122,156,2,193,242,226,222,1,202,40,251,158,230,96,246,194,195,131,93,179,176,246,224,107,132,11,45,103,65,46,26,53,238,230,150,6,109,216,27,62,2,51,17,234,133,208,42,58,110,132,146,135,153,250,220,167,137,111,113,246,159,172,84,211,217,222,201,251,25,134,200,198,244,89,246,157,100,40,170,201,230,85,222,82,193,123,228,101,176,106,51,47,211,200,162,184,178,30,240,193,224,11,176,72,182,6,77,110,60,145,173,155,175,183,110,30,31,49,8,72,76,68,12,189,198,184,148,12,90,217,165,139,48,83,165,200,109,241,151,92,244,135,132,194,227,142,167,29,76,241,196,152,194,72,176,48,95,158,95,40,7,53,42,229,121,220,180,207,79,236,170,60,95,22,121,22,38,236,111,192,54,246,15,156,61,243,85,234,155,39,252,160,195,150,15,143,60,117,7,179,138,217,107,7,41,119,53,122,156,118,44,212,245,206,206,230,214,203,205,152,234,176,9,34,108,170,87,11,84,50,45,32,104,14,150,133,181,169,142,81,0,211,226,242,110,165,97,203,91,222,83,184,237,125,168,124,100,169,122,177,38,93,189,85,24,209,156,207,72,107,120,252,220,75,192,179,86,84,135,11,24,232,184,65,42,109,100,149,192,24,171,129,69,160,243,109,26,220,14,228,15,163,198,202,10,24,196,252,111,26,183,25,92,182,69,168,111,42,12,40,237,167,228,11,122,120,48,142,22,101,208,46,72,252,184,32,170,216,66,99,253,159,56,37,248,158,155,7,21,124,123,162,171,39,118,31,92,53,143,191,54,74,154,14,233,121,7,42,199,38,40,43,219,35,73,246,14,209,222,136,67,75,133,242,208,252,172,14,189,51,216,74,59,47,94,228,122,122,235,185,202,35,219,80,191,148,49,207,133,59,75,109,35,185,174,157,103,62,119,163,237,146,71,85,98,28,99,214,124,214,234,212,225,72,116,56,209,73,19,82,82,94,181,217,124,182,229,112,181,14,116,119,67,45,67,168,189,209,35,172,165,170,25,176,135,195,207,29,193,6,238,168,193,194,149,251,237,121,190,85,15,219,42,9,190,188,90,75,81,66,201,170,8,49,193,159,46,83,66,61,69,216,67,198,148,107,140,178,31,64,148,140,26,91,79,189,45,119,165,2,34,148,231,203,78,5,187,158,171,136,24,133,91,241,161,98,90,221,24,202,56,228,175,135,209,19,225,200,251,135,168,249,23,166,50,30,121,189,189,242,115,140,152,119,162,233,48,75,185,9,169,97,107,169,173,45,31,47,7,12,218,102,140,28,87,246,90,85,246,201,137,166,151,128,114,139,212,124,48,31,25,208,18,26,13,1,217,134,180,116,167,153,128,255,13,159,122,102,31,212,190,176,237,133,172,94,230,26,148,96,208,150,233,189,186,192,107,64,209,38,117,177,86,7,24,106,37,91,91,95,93,149,23,142,212,208,106,77,57,215,44,249,26,85,183,166,158,122,136,3,94,117,53,55,81,41,162,50,57,25,160,132,17,1,148,128,154,192,67,63,79,114,196,185,82,54,238,152,19,21,230,72,6,125,195,55,14,229,248,49,68,214,97,154,247,208,247,81,90,61,53,110,233,237,58,38,176,147,79,62,113,181,241,34,146,162,76,3,177,31,225,243,151,38,156,128,24,0,220,108,83,131,197,57,67,230,217,51,123,178,91,91,44,180,199,8,198,103,50,77,59,156,130,130,187,232,4,217,226,204,160,172,169,54,57,205,14,3,30,124,248,73,176,204,155,71,183,156,35,54,112,50,233,100,246,20,244,134,218,31,173,123,247,176,70,238,97,212,76,125,3,136,16,192,181,28,39,197,140,82,17,16,162,112,45,77,41,56,26,139,74,242,45,45,82,80,61,93,34,79,84,151,10,42,3,180,112,122,204,203,158,90,16,45,252,241,119,118,152,155,175,204,205,129,26,118,168,216,155,27,228,215,220,252,140,51,137,196,218,10,206,224,16,200,39,22,32,33,3,158,207,65,57,220,67,70,99,79,73,86,97,249,233,251,237,228,158,182,32,53,207,189,10,143,46,178,226,121,106,138,206,38,170,49,189,76,53,196,201,90,245,158,45,104,16,210,102,171,97,22,135,53,163,135,142,154,129,181,162,190,200,43,48,188,168,88,139,207,104,84,179,185,222,140,45,179,127,52,83,60,202,60,14,115,185,235,13,8,39,59,227,40,156,14,179,25,80,22,43,74,128,195,239,171,213,2,135,176,164,36,158,60,112,241,197,83,198,5,171,114,244,22,146,9,37,117,1,106,148,159,64,107,147,45,32,158,42,229,130,158,16,61,72,132,50,200,48,207,55,169,194,47,168,86,230,202,160,92,89,90,126,254,139,51,95,41,167,65,33,133,220,31,34,136,64,126,160,242,104,95,137,110,20,117,179,201,23,131,225,155,166,197,119,94,176,17,30,2,171,128,41,59,108,64,29,159,217,65,181,19,114,200,147,165,45,244,34,98,47,10,119,168,155,62,80,142,61,60,81,83,220,106,135,248,217,80,255,200,148,223,110,69,142,123,195,43,241,26,194,57,111,180,214,179,166,249,219,173,245,86,18,84,27,141,245,192,175,193,176,37,150,150,136,192,140,113,41,218,181,138,136,68,142,79,254,55,44,219,101,38,88,23,233,130,195,180,205,20,63,87,100,163,104,77,73,117,79,192,50,202,42,254,124,135,190,230,74,59,37,68,14,190,166,231,230,166,65,146,242,188,46,202,115,78,166,249,124,39,71,125,121,230,171,163,35,181,251,66,147,41,12,163,241,212,159,29,59,170,2,99,249,17,251,167,110,201,239,134,167,135,240,6,159,254,103,29,205,16,21,164,6,189,3,219,196,112,48,150,228,130,166,169,174,180,118,87,77,187,178,14,18,69,27,158,167,219,80,39,79,151,74,117,20,16,187,150,54,177,148,177,207,39,205,88,59,216,159,101,172,228,171,55,50,251,37,236,171,122,59,219,104,215,129,68,168,103,162,8,157,112,230,51,214,234,171,10,20,122,230,59,57,24,145,110,77,158,198,82,132,166,170,213,106,182,72,189,1,111,111,81,177,166,106,181,140,96,173,34,131,12,131,216,171,108,90,163,66,83,170,18,210,105,62,164,148,24,192,36,147,4,212,220,204,220,4,78,211,118,145,159,157,105,156,54,21,209,209,68,22,27,166,247,186,29,36,97,213,89,106,15,93,15,216,47,82,213,245,170,54,234,248,208,172,206,214,115,65,100,91,42,108,225,4,140,80,226,182,162,157,24,96,194,138,200,140,236,176,1,174,240,226,248,134,56,65,184,51,83,3,235,133,34,73,211,2,245,141,134,90,125,181,196,31,245,141,70,161,200,88,175,117,150,81,66,40,1,17,82,23,142,176,174,138,202,172,94,35,44,164,206,111,215,233,123,175,32,50,133,204,146,73,170,213,197,68,139,101,64,17,106,85,250,224,200,21,45,149,21,10,103,52,228,169,228,148,132,21,20,198,66,69,94,6,172,168,10,197,20,200,241,36,140,38,42,3,42,11,156,42,160,197,172,239,36,193,220,244,244,236,244,236,140,157,236,69,134,153,158,155,157,173,216,247,246,131,74,217,41,55,247,37,172,172,238,193,222,222,225,254,238,225,238,254,62,225,203,142,152,221,101,51,238,142,119,147,82,85,5,58,173,193,177,238,104,72,111,155,101,244,205,176,140,212,20,184,173,14,32,13,239,146,198,254,219,80,187,45,85,171,230,238,115,11,31,65,144,86,186,103,191,133,211,230,253,141,4,135,218,96,189,215,122,10,132,160,168,2,48,103,117,7,3,61,83,217,82,189,86,87,37,0,203,48,106,240,51,28,70,152,66,182,89,181,198,204,107,102,188,145,81,76,185,140,50,191,47,163,230,48,87,3,105,189,167,162,135,220,111,105,112,170,111,18,98,33,89,173,248,68,34,84,66,61,84,244,236,207,128,13,64,0,146,96,106,122,102,122,110,106,26,84,193,103,48,201,116,208,74,194,108,142,108,243,197,153,191,238,29,1,160,182,219,217,235,236,5,8,167,179,163,254,119,106,141,174,54,32,91,28,234,215,121,193,94,44,30,241,214,56,19,204,110,104,121,207,211,182,166,103,32,241,176,158,26,126,52,93,42,249,199,122,68,92,55,160,128,221,113,171,215,83,202,206,83,19,133,11,143,119,212,243,202,48,250,221,70,22,2,109,19,32,193,88,98,173,134,132,6,224,253,69,97,5,115,54,171,41,163,68,247,91,154,162,172,144,20,82,167,10,216,34,93,228,234,162,26,230,45,35,129,16,85,220,202,101,170,110,183,90,147,105,11,25,21,106,91,82,169,76,154,204,129,14,51,70,131,153,169,185,169,169,57,50,7,174,72,147,32,77,8,49,252,241,217,51,127,33,94,179,187,223,13,228,50,234,43,212,217,171,211,245,128,173,87,185,48,68,171,89,176,104,63,184,213,82,151,84,216,172,8,36,53,137,27,104,122,47,212,188,93,84,11,165,169,173,22,75,82,243,236,80,93,65,13,138,155,70,170,143,228,50,123,169,11,87,221,49,81,10,119,36,71,15,180,169,33,244,65,122,214,104,215,154,19,190,226,136,41,230,250,72,10,79,235,213,92,115,152,246,94,170,185,121,75,144,142,59,26,38,159,140,38,20,80,213,252,24,81,66,58,124,79,230,19,17,194,151,115,247,123,206,31,112,123,155,4,42,243,185,183,229,157,32,103,96,217,167,38,72,14,146,100,194,214,223,46,102,166,64,153,89,29,38,102,248,39,51,16,98,32,8,90,73,25,25,0,70,232,48,207,180,195,228,30,115,28,204,105,27,107,236,32,150,43,167,92,152,166,64,154,57,95,192,45,107,82,77,55,137,190,220,96,59,103,207,200,153,56,71,228,187,206,140,144,164,187,201,162,12,122,88,111,123,250,107,235,18,250,248,202,43,144,128,14,164,185,132,228,17,106,141,32,169,248,171,26,137,214,32,120,77,104,4,166,249,178,53,183,109,1,151,90,9,89,85,192,216,46,11,167,198,180,210,162,24,162,250,212,188,61,83,231,204,70,48,129,183,48,224,106,136,38,32,137,60,111,29,131,55,194,124,181,229,164,200,153,158,225,3,15,58,76,205,114,229,109,215,105,118,214,72,50,61,53,55,75,194,76,225,148,190,15,110,177,215,231,103,254,178,203,50,176,142,119,88,35,42,16,253,208,217,236,14,229,220,204,119,35,75,135,1,151,91,26,205,222,38,42,54,58,76,176,245,169,82,113,132,254,177,111,132,202,229,161,160,85,215,210,144,239,188,158,100,208,58,150,190,230,200,39,162,199,215,88,209,13,55,154,110,195,250,90,60,243,128,28,0,187,185,38,168,121,84,238,33,201,231,177,90,192,108,87,82,93,198,234,106,102,30,56,208,32,203,73,123,0,209,153,41,245,93,69,2,195,125,140,164,43,60,151,161,100,235,147,5,79,237,41,52,197,24,97,69,142,194,124,162,136,155,180,131,155,175,43,87,24,43,63,3,249,36,2,204,76,113,155,246,19,8,100,140,130,223,24,51,77,205,64,184,77,76,155,82,7,54,97,199,7,94,202,231,19,30,77,141,63,236,101,102,238,75,101,152,54,219,207,90,234,102,0,255,186,205,196,168,154,68,53,189,43,23,203,40,4,112,130,186,85,2,91,77,163,24,115,205,234,235,169,126,94,190,194,250,90,195,246,117,132,51,80,23,185,182,210,136,156,118,214,64,74,53,3,6,7,197,94,181,181,70,173,129,136,109,230,98,169,209,96,161,11,35,231,130,18,70,237,216,74,192,207,87,136,154,141,28,31,57,227,169,187,123,192,26,44,50,203,87,141,164,107,53,177,5,18,71,70,150,10,242,24,79,24,13,201,229,21,244,69,121,128,24,212,3,110,56,77,81,125,147,11,140,39,166,167,68,135,153,68,14,63,129,64,198,68,206,59,33,207,236,207,141,67,52,103,166,179,189,237,110,56,56,4,29,63,136,206,124,105,170,163,211,234,40,82,197,94,119,207,216,246,188,25,213,45,209,46,56,26,118,109,184,248,175,71,110,148,74,128,146,134,170,33,69,148,34,184,84,119,152,172,215,87,212,215,188,156,200,75,138,16,252,91,245,132,69,108,171,53,15,10,10,161,67,148,78,141,76,1,200,148,142,158,95,202,106,142,236,92,22,96,170,250,180,12,254,0,86,202,185,34,185,124,210,221,60,151,159,68,146,207,252,240,39,229,66,100,202,164,84,37,156,11,25,73,148,254,50,100,167,165,161,177,178,100,4,114,198,228,148,237,147,83,246,198,81,155,93,148,112,27,116,153,158,38,215,144,134,118,50,29,2,136,136,42,35,9,206,217,218,241,17,189,47,236,212,126,193,236,18,97,252,64,43,35,14,37,131,138,238,154,207,41,105,122,96,67,74,162,17,121,32,22,26,53,156,46,181,122,86,91,15,33,175,199,154,114,137,183,178,213,172,150,73,226,32,55,177,178,154,213,86,220,179,94,89,87,221,197,170,224,56,196,31,120,74,111,117,53,2,83,53,68,166,86,21,55,23,91,44,175,84,93,117,11,157,179,36,75,170,90,117,240,160,39,248,200,16,149,44,249,223,21,102,190,237,154,139,255,4,198,45,3,27,16,86,115,161,191,161,183,103,230,92,119,207,154,156,177,183,89,179,51,83,51,148,63,100,130,233,224,4,124,154,36,53,38,73,152,73,255,52,85,216,200,45,51,252,155,57,227,144,29,130,118,144,112,130,227,7,204,7,59,159,191,100,72,189,227,49,170,231,120,111,69,153,81,75,46,160,122,212,169,44,152,229,143,74,138,166,122,96,72,120,251,106,133,173,37,76,38,213,85,176,29,40,217,26,202,184,214,106,89,166,128,198,90,173,22,85,22,70,144,213,229,26,107,244,66,10,101,43,14,225,92,195,183,170,27,67,164,112,205,72,135,156,82,24,82,10,17,174,84,149,116,93,82,16,29,58,124,145,156,65,9,229,92,81,14,222,8,93,17,233,165,5,101,41,168,185,159,228,190,198,156,251,123,69,93,1,237,77,229,172,117,117,225,52,35,30,16,47,204,224,90,228,152,156,154,10,126,177,219,147,184,237,63,34,187,224,143,141,67,32,169,182,233,141,171,129,48,203,241,94,62,215,132,228,77,97,14,82,175,15,68,197,91,109,181,119,106,110,176,6,79,105,135,186,204,209,232,96,176,158,194,221,44,202,6,124,160,182,130,55,159,111,175,192,99,70,136,105,58,150,172,212,106,14,229,231,83,190,178,146,215,31,213,0,140,98,37,152,138,98,86,169,172,245,23,30,13,177,127,121,185,74,252,90,6,72,57,243,25,85,57,27,80,226,226,15,176,6,164,84,153,65,16,40,11,226,65,22,60,211,250,132,202,226,73,68,7,203,121,60,100,14,94,56,100,85,138,133,76,195,195,128,182,8,229,77,82,204,78,37,202,76,77,57,13,38,39,199,176,218,99,99,99,120,227,56,105,135,41,190,236,251,210,0,183,204,126,126,230,175,155,128,2,82,115,63,239,104,100,31,187,12,110,38,100,63,146,27,64,118,96,248,119,195,156,112,202,168,112,245,178,136,115,179,24,117,61,79,83,211,14,205,188,139,193,250,74,182,150,225,16,5,21,202,206,213,86,50,82,35,35,9,106,203,5,135,58,30,120,71,67,173,248,109,176,67,196,204,87,106,44,4,160,242,94,9,188,243,162,91,182,124,19,95,94,37,226,92,33,91,42,141,138,124,111,10,44,64,12,50,250,26,185,77,235,230,84,165,16,175,69,8,189,156,212,6,98,32,83,185,65,11,114,208,209,152,77,58,130,114,74,122,99,124,10,43,63,54,54,94,154,28,139,107,81,100,114,106,108,220,232,53,30,130,12,127,57,1,145,181,211,241,230,243,47,95,190,232,108,58,150,255,57,57,99,83,137,211,103,237,52,138,172,205,216,44,234,41,40,173,234,245,186,7,88,101,142,214,5,52,163,25,20,133,242,107,33,121,150,9,33,64,233,22,17,178,41,166,148,121,109,106,32,209,10,145,166,2,72,109,240,251,90,66,255,251,31,86,51,186,224,128,234,72,129,131,45,96,83,149,21,157,90,92,200,163,182,144,76,68,128,44,208,130,42,43,123,81,86,20,188,92,8,159,207,185,151,81,9,237,45,83,74,254,182,27,180,211,133,7,60,105,11,46,183,24,97,12,4,192,62,166,171,73,29,120,129,175,167,200,51,144,95,56,125,121,230,47,140,221,110,49,126,251,92,234,91,69,220,204,131,35,135,7,143,131,109,206,73,14,2,255,216,129,147,5,119,25,195,71,117,161,247,33,168,84,30,76,185,148,57,20,211,169,145,164,11,31,245,16,78,89,230,169,33,24,167,40,95,89,242,24,108,182,196,203,197,12,75,28,129,217,234,74,117,69,90,187,170,168,185,140,168,165,197,101,135,214,6,64,7,248,89,128,116,80,29,83,205,1,130,110,215,138,41,8,201,169,208,164,125,82,148,81,162,68,57,69,66,102,147,218,160,242,214,46,57,229,34,106,118,170,160,11,160,48,108,109,73,19,172,61,63,149,140,26,37,82,68,164,153,156,116,249,85,42,141,5,85,32,195,62,63,243,213,11,149,82,160,79,176,18,224,30,184,37,236,172,29,8,131,134,138,240,152,27,106,169,235,22,34,24,53,194,156,104,195,162,176,119,117,221,118,8,121,99,10,61,200,172,104,49,5,177,154,87,166,250,81,79,56,137,145,41,85,87,149,184,193,67,190,40,36,57,148,242,226,34,190,146,86,160,236,170,138,28,181,165,101,135,216,34,64,184,180,88,173,58,61,22,1,38,132,39,238,168,192,133,0,232,84,158,120,200,22,94,247,19,26,177,3,1,41,30,102,200,18,115,149,185,60,175,228,58,156,1,91,201,41,35,193,52,69,148,212,180,104,65,214,112,2,76,140,143,143,77,141,143,97,231,54,170,195,120,201,111,140,231,244,209,143,140,50,80,43,147,95,156,249,75,180,78,123,78,237,129,216,33,135,93,161,131,51,155,224,116,124,212,85,180,135,242,58,163,245,200,91,131,26,217,64,44,79,86,104,72,27,149,102,203,28,173,6,126,64,217,32,190,22,141,23,2,62,174,69,229,5,147,18,138,53,85,189,14,9,135,229,69,79,91,44,9,35,229,144,206,106,117,41,33,252,5,64,167,7,158,226,231,110,82,61,113,36,97,153,25,62,153,179,238,125,151,25,6,65,166,213,51,123,243,10,191,146,14,12,52,129,49,160,203,221,178,13,47,111,50,108,218,169,177,208,16,20,80,163,99,177,141,142,143,142,141,150,70,71,75,184,55,106,215,249,119,165,177,194,6,234,124,113,230,171,14,91,210,110,2,238,212,105,163,251,63,123,112,22,160,129,205,72,117,108,40,91,212,32,60,153,234,220,212,118,163,70,95,14,106,2,126,88,45,75,149,193,181,69,26,79,139,73,248,175,120,5,222,226,162,228,125,56,8,81,123,135,0,56,164,13,40,193,167,220,22,22,169,59,60,244,137,94,169,222,136,148,169,18,95,139,204,183,192,206,11,74,44,17,94,235,88,230,138,12,219,74,192,210,204,146,69,70,41,37,191,43,243,17,60,71,116,16,236,48,65,33,53,29,212,96,196,60,162,180,179,242,248,32,165,204,158,157,128,214,38,37,166,236,225,167,228,41,249,147,95,26,211,213,232,40,15,220,198,252,61,234,100,25,45,18,163,68,82,154,82,39,87,160,34,178,131,17,237,207,124,62,6,203,83,91,29,78,107,39,111,108,176,37,115,61,146,164,116,61,212,194,32,19,124,160,134,178,121,183,144,86,114,197,188,28,154,118,17,56,14,183,127,158,10,124,86,245,218,8,136,123,85,184,192,95,3,71,208,137,179,213,45,103,229,72,109,59,16,135,64,53,224,114,64,168,106,10,132,100,79,195,239,86,5,0,140,91,247,49,28,127,254,132,145,144,133,178,140,169,114,82,218,180,103,43,5,39,131,89,189,105,134,206,103,164,194,17,254,83,20,48,183,105,193,26,165,201,164,181,75,137,51,38,227,51,153,132,175,32,198,227,209,216,30,147,87,70,31,139,129,198,165,98,38,141,132,70,16,130,209,182,82,237,118,64,1,57,60,12,217,62,224,16,154,13,130,1,235,27,106,231,136,182,104,102,198,42,11,164,158,30,133,60,144,27,62,85,86,7,11,45,174,112,82,230,15,57,100,204,211,69,47,164,240,21,165,239,166,82,10,226,59,150,20,95,90,90,88,66,17,5,126,186,160,26,61,56,19,10,13,102,252,251,133,37,34,66,128,92,171,6,60,103,177,226,48,157,5,119,50,192,29,128,6,150,43,243,121,116,176,146,18,223,161,185,103,231,220,221,51,187,118,122,170,96,214,78,79,37,57,53,171,120,136,135,67,196,21,147,161,165,39,93,24,73,44,141,230,219,200,232,196,72,241,83,241,52,192,62,208,33,207,0,33,135,100,242,129,24,108,208,165,222,216,9,102,176,145,90,3,55,216,125,22,113,66,134,88,51,70,59,0,26,112,198,168,10,189,129,188,232,18,45,80,100,230,170,89,85,98,137,169,185,167,230,54,187,227,28,15,248,18,209,4,217,34,221,133,8,245,201,167,230,211,46,58,144,50,79,171,0,15,34,94,235,96,169,37,39,93,149,216,126,87,24,132,132,148,129,206,1,101,242,44,171,113,199,4,136,49,23,81,169,202,204,96,180,118,110,46,2,83,8,132,208,187,152,163,140,154,146,243,61,233,182,148,248,97,156,138,99,156,170,185,148,212,183,171,138,193,229,31,29,161,34,193,121,108,4,26,101,100,172,148,190,198,87,252,115,179,178,196,23,192,209,38,32,26,145,79,242,194,1,117,202,56,105,129,193,115,134,170,16,179,104,172,213,61,202,138,216,71,230,238,90,109,69,208,228,165,197,98,121,169,17,35,123,234,101,20,52,71,243,172,67,138,124,67,86,33,251,128,67,181,90,89,136,204,68,85,247,11,226,40,140,88,221,192,59,74,148,164,48,168,51,42,32,70,25,196,32,100,106,97,33,97,67,38,42,174,194,195,124,146,211,77,183,155,42,27,110,222,4,156,238,25,248,123,83,165,137,89,6,65,20,10,49,177,50,57,62,110,166,234,36,140,163,210,4,104,49,78,117,161,69,159,24,45,61,134,100,122,60,54,170,243,232,200,236,143,252,190,0,0,29,27,73,68,65,84,99,80,160,52,82,26,27,193,165,125,24,9,82,24,201,74,163,34,146,29,39,198,156,67,154,121,133,139,230,32,33,215,221,242,172,183,39,98,225,117,168,229,71,157,61,137,96,79,169,108,222,104,227,230,148,17,101,73,190,26,204,168,114,22,117,119,85,84,154,154,218,205,84,75,177,0,154,0,51,190,16,97,165,16,78,124,180,25,206,176,85,101,20,220,86,180,92,173,122,204,105,9,241,142,160,200,210,66,202,38,69,166,21,127,44,128,14,78,243,184,87,144,79,244,250,148,109,77,72,16,38,188,103,160,179,221,149,152,129,170,158,214,210,203,171,72,174,158,66,131,114,47,138,150,171,51,67,137,79,254,8,158,119,123,254,237,238,8,238,143,140,242,206,136,109,163,124,143,26,49,120,210,125,59,151,92,229,143,136,42,163,224,16,159,19,134,33,185,132,202,114,8,9,103,230,166,158,180,89,84,168,34,129,161,150,142,200,2,129,61,152,117,88,169,194,158,66,61,139,10,131,23,61,49,10,229,27,74,90,165,193,118,44,87,203,254,184,251,90,218,143,176,232,89,197,189,104,15,108,148,51,94,149,171,32,206,82,5,90,218,171,243,42,140,125,208,227,203,200,83,9,122,14,33,5,168,115,121,33,140,218,249,65,228,218,236,28,156,186,153,137,210,132,61,251,165,201,217,201,241,137,241,201,137,201,9,59,226,52,89,154,152,40,225,217,183,219,56,98,217,237,119,88,126,51,94,39,108,197,30,151,176,187,126,126,60,146,239,165,199,60,218,194,63,30,73,91,233,209,200,227,135,118,126,52,50,242,255,241,244,136,215,124,243,123,28,92,184,145,85,200,33,141,132,23,228,96,164,186,43,139,141,134,192,177,132,125,100,27,76,180,214,235,171,245,134,26,67,121,143,21,248,118,53,53,147,160,119,199,138,235,165,204,188,3,233,109,161,56,178,167,85,9,24,20,183,100,158,173,102,237,93,14,178,145,105,186,128,194,9,149,86,168,6,76,197,47,21,124,140,16,212,19,207,173,166,74,12,197,204,249,123,136,40,186,125,149,200,242,205,59,115,64,125,207,206,77,204,206,206,218,186,219,98,143,27,49,108,245,75,112,214,38,75,143,39,33,104,38,38,198,38,30,67,222,140,153,1,52,33,69,48,33,217,99,82,199,228,207,99,188,30,96,249,71,184,244,143,30,63,122,60,162,101,126,192,85,126,192,215,200,195,7,246,251,7,165,7,15,236,211,3,221,211,9,251,240,163,71,15,74,15,141,58,248,19,251,247,200,72,98,20,227,16,101,152,0,148,205,208,44,27,1,42,228,147,26,74,188,170,178,2,209,220,154,217,87,136,140,172,32,116,158,65,143,100,238,105,43,122,81,150,120,170,42,233,64,166,88,82,37,176,67,6,150,178,50,42,183,202,133,116,53,151,86,171,157,85,202,204,92,151,41,249,205,30,130,73,36,88,154,93,209,197,126,82,166,40,123,146,136,65,197,189,224,202,162,82,41,130,150,115,166,168,68,240,188,82,129,140,154,29,183,237,241,227,137,120,97,227,58,219,163,204,11,91,107,123,172,31,61,226,227,140,229,179,243,35,190,31,113,9,177,61,240,243,163,97,238,15,71,30,242,101,75,62,252,112,120,248,225,3,219,135,127,193,254,203,3,59,60,120,96,175,251,247,237,253,224,254,240,240,253,97,187,250,197,14,195,15,30,62,28,30,25,6,17,33,187,32,241,70,76,100,253,69,141,29,83,181,240,122,222,230,67,117,170,117,118,41,71,220,208,110,32,151,20,120,142,40,247,170,214,4,192,92,170,186,37,202,20,144,25,82,89,66,111,104,253,236,48,203,179,151,63,2,141,153,18,17,82,189,102,15,149,85,99,180,64,219,72,152,114,193,162,230,163,148,21,85,23,226,138,121,38,147,160,44,132,60,47,87,114,225,100,86,20,53,70,196,165,16,51,159,53,227,200,136,240,200,183,7,254,122,136,211,195,135,120,243,240,136,123,108,191,240,141,253,161,45,240,207,191,252,242,243,47,63,227,245,243,131,159,127,182,101,190,255,147,109,247,226,192,79,119,236,242,46,223,63,221,189,123,255,238,221,187,247,238,106,187,103,251,253,187,119,112,207,46,127,186,243,243,240,240,35,202,50,234,152,49,99,19,35,72,203,204,167,13,115,188,1,0,241,230,43,74,123,19,148,99,38,85,125,61,82,168,44,137,172,177,189,102,196,195,17,252,139,176,94,117,105,193,123,72,44,202,123,160,42,54,141,145,65,74,149,179,74,102,15,60,17,4,44,126,100,128,79,181,94,11,44,135,156,159,95,241,34,150,133,20,95,114,165,204,162,48,84,193,40,165,71,217,166,58,48,85,136,169,132,47,7,115,186,139,225,80,41,69,165,202,166,60,204,89,120,240,216,214,250,231,159,127,124,108,251,79,63,253,63,44,224,143,120,223,125,104,43,246,211,221,31,109,231,246,163,93,249,66,250,157,116,117,251,54,15,105,187,201,247,205,219,122,225,211,237,27,182,227,104,47,191,201,253,102,156,245,187,187,247,30,220,55,46,49,246,160,212,26,161,200,2,220,128,177,41,111,210,181,206,218,237,140,181,145,128,223,212,87,224,140,55,212,129,118,37,32,178,8,124,175,40,170,231,205,36,92,105,103,139,69,116,178,100,125,197,43,82,41,127,84,31,44,36,32,86,158,24,254,114,57,101,173,157,14,149,48,140,228,89,35,157,90,102,189,100,121,222,35,82,21,186,23,81,189,231,224,243,36,159,96,217,154,163,81,158,47,152,84,83,166,151,31,60,250,229,238,47,63,221,254,17,251,143,120,223,254,241,95,63,254,248,175,127,217,233,246,141,31,111,220,184,121,243,198,141,127,217,126,35,222,122,221,184,113,29,167,235,55,184,253,235,7,222,250,225,95,87,175,222,248,120,191,118,253,234,181,171,215,174,219,126,237,186,93,94,187,122,253,218,213,171,184,101,151,248,200,35,238,222,184,126,253,134,145,100,24,20,33,139,128,40,198,33,244,45,54,18,110,80,157,79,189,105,249,154,162,184,204,107,172,177,193,4,146,223,102,87,101,48,112,21,102,173,122,108,99,97,41,249,21,140,91,148,165,37,202,34,4,220,130,202,147,244,20,87,10,54,144,115,69,185,112,119,32,41,49,95,120,248,139,97,218,74,34,67,30,6,209,69,121,158,97,144,112,54,202,115,132,75,153,61,107,38,233,195,159,127,185,253,227,15,55,126,248,225,135,107,63,220,184,246,131,246,31,174,233,200,187,126,188,108,231,203,118,113,229,7,127,217,59,46,236,112,249,218,181,203,151,47,95,227,126,153,111,251,245,21,108,151,241,210,225,50,222,87,240,142,227,229,248,140,243,53,163,200,237,159,126,25,121,8,30,161,65,60,2,130,212,137,24,172,177,159,1,52,133,176,10,128,101,194,219,88,89,241,146,138,85,198,212,87,217,216,32,79,6,153,202,200,92,141,47,120,62,46,116,46,157,229,121,138,122,20,209,249,99,159,249,211,95,25,92,237,64,1,50,91,90,192,245,151,115,114,20,52,117,57,156,138,114,20,32,149,93,87,20,210,172,242,187,103,29,13,2,103,99,124,242,241,163,95,126,188,253,195,255,253,225,255,254,243,159,151,243,23,247,75,255,252,231,119,246,193,110,252,147,247,112,243,159,151,46,95,194,229,229,139,248,124,233,242,101,188,236,141,11,223,47,93,226,77,94,94,196,71,187,184,104,251,165,248,222,127,18,71,93,216,251,34,254,153,107,215,111,223,189,47,22,25,153,8,145,165,28,248,58,90,94,175,168,131,157,26,175,172,172,5,164,3,160,179,21,5,12,225,14,138,20,121,66,200,3,82,213,66,57,42,138,226,189,109,65,201,75,181,67,33,148,93,229,14,8,123,71,241,19,168,236,128,2,145,102,174,248,228,59,49,230,10,104,181,68,162,143,160,57,229,153,66,32,100,102,90,232,15,179,159,30,222,189,109,15,63,22,250,239,105,247,23,54,251,120,225,210,5,59,164,111,176,95,184,112,129,223,226,108,87,56,224,234,194,5,251,221,5,158,6,182,191,231,223,92,184,120,225,227,237,162,31,47,94,48,2,130,34,247,96,166,249,6,199,176,1,139,182,158,213,234,171,166,40,132,196,20,57,24,55,204,212,126,165,8,199,164,207,65,111,195,28,240,156,53,82,141,17,90,71,84,124,183,71,151,8,14,79,141,86,42,243,5,200,217,92,132,91,141,14,51,115,129,120,146,184,169,204,45,206,5,152,220,190,40,214,180,20,178,221,169,74,172,18,100,156,43,162,215,132,9,129,59,62,71,188,212,196,132,41,144,27,160,199,37,174,202,255,241,53,58,127,225,111,127,251,219,133,191,93,184,192,3,142,184,248,219,121,251,226,66,250,9,223,223,250,126,1,151,184,113,222,247,111,139,151,120,127,251,237,121,236,67,223,14,13,13,157,31,26,226,81,103,110,223,226,31,188,120,201,8,114,211,76,97,35,133,184,100,228,207,103,190,130,202,94,97,214,117,173,150,173,166,134,167,222,16,216,100,86,182,18,37,46,85,102,255,170,209,108,139,170,99,105,73,85,243,2,114,192,169,128,81,42,24,135,27,163,69,135,160,50,95,164,9,22,180,18,89,235,202,236,140,196,77,133,4,154,13,88,193,108,220,99,120,150,9,164,25,37,244,202,185,17,133,95,205,164,220,158,224,254,51,142,117,158,243,88,148,153,149,15,127,254,241,134,209,227,239,182,220,105,109,109,221,240,250,86,11,199,139,33,30,116,254,86,183,120,49,228,159,240,7,252,238,219,111,253,39,56,125,205,213,215,209,255,226,155,161,111,190,225,155,39,252,8,159,190,30,250,26,212,49,138,92,190,124,227,246,29,147,89,195,193,34,159,159,57,91,91,95,49,231,130,248,15,16,96,109,85,23,222,49,59,181,250,64,175,198,108,81,102,174,249,28,25,19,24,8,155,87,243,178,84,239,75,80,84,195,73,218,203,252,169,228,140,49,231,62,194,92,152,165,179,158,183,158,243,194,138,217,28,173,57,31,167,50,171,39,231,146,142,41,255,135,64,237,116,4,206,103,129,63,83,198,117,210,252,193,145,159,126,252,225,159,255,52,105,146,47,37,214,200,222,246,242,213,195,133,86,18,103,222,208,34,218,107,136,47,92,104,31,210,249,107,190,185,13,125,116,254,122,224,235,226,143,237,1,184,120,233,202,213,235,119,193,34,15,70,130,67,254,178,234,117,218,53,1,208,160,178,217,156,171,134,22,81,184,206,120,163,26,221,78,3,206,145,26,11,21,43,140,22,212,76,101,65,161,164,185,114,0,246,231,101,245,84,34,77,93,201,67,124,4,115,16,206,65,99,104,90,85,21,9,230,97,151,51,179,122,252,43,98,150,153,137,164,47,102,82,141,152,39,189,161,187,69,85,134,204,129,246,143,156,82,105,170,244,248,241,195,159,254,117,237,159,151,46,224,241,197,122,127,186,132,177,192,231,109,247,23,111,126,227,247,255,195,54,84,160,192,249,129,127,114,232,99,26,157,207,255,91,166,136,46,95,187,121,231,167,95,30,12,43,214,69,43,43,64,155,133,246,216,181,128,219,120,182,169,202,102,93,139,130,31,100,182,171,207,71,53,167,200,19,0,98,43,229,39,94,99,148,32,28,228,12,138,37,135,13,204,207,207,13,86,182,144,2,94,184,50,61,27,162,63,199,231,251,15,166,69,36,175,111,153,203,11,93,18,214,156,17,244,153,41,135,17,38,84,115,66,232,152,79,56,241,200,8,242,195,229,75,23,200,22,182,40,223,124,109,143,126,236,249,210,13,156,134,254,19,9,134,254,224,187,65,190,56,199,139,115,231,236,173,107,255,1,105,114,126,232,155,243,23,46,94,161,86,71,4,101,56,56,100,37,239,96,80,163,41,69,56,38,125,63,192,249,151,23,115,56,200,146,114,168,200,206,45,121,239,155,74,68,10,65,137,133,36,166,242,162,212,143,89,194,211,213,211,133,98,200,88,206,105,133,195,245,217,126,49,225,87,115,19,76,168,58,63,76,207,164,127,97,58,201,169,41,202,168,89,38,247,166,3,41,133,68,134,67,208,8,206,25,29,53,35,235,134,17,196,20,192,55,95,7,17,62,90,213,243,255,65,242,12,37,129,51,248,39,67,95,159,27,194,98,159,27,74,194,137,63,59,199,203,115,182,125,141,151,31,190,230,231,248,219,111,207,95,250,238,218,245,59,119,127,26,134,18,33,89,62,59,243,85,130,110,22,146,224,2,227,164,186,109,227,9,30,28,209,225,232,253,197,133,69,53,178,145,65,5,144,89,165,16,241,32,59,204,39,101,33,133,59,27,82,42,48,252,122,174,153,189,198,122,50,125,138,236,144,10,38,102,84,155,39,200,166,124,138,25,176,209,180,9,49,66,164,166,137,81,6,142,127,198,179,171,78,139,9,179,169,114,212,44,178,172,37,211,233,50,178,76,100,153,6,254,230,15,200,48,200,20,67,127,160,16,6,248,98,232,220,31,145,170,240,227,68,133,32,138,127,6,17,237,79,206,155,200,186,122,253,54,116,200,163,225,80,234,95,174,68,255,89,199,35,160,96,187,234,213,70,130,1,86,133,75,16,45,170,11,158,41,173,230,53,219,12,193,202,217,206,45,82,21,65,166,173,236,135,233,84,80,17,88,101,45,33,97,252,83,42,247,154,81,249,17,165,207,28,151,123,142,180,210,207,29,7,50,203,66,61,253,106,218,147,75,118,89,98,206,111,18,120,255,201,2,86,10,137,165,209,199,35,70,144,31,160,67,190,253,84,11,23,200,50,40,122,62,229,10,231,0,30,176,200,185,250,73,100,200,25,162,72,143,2,199,80,104,25,135,92,185,117,27,90,61,56,228,207,103,190,140,150,80,236,141,13,252,190,183,77,67,13,30,220,13,36,52,28,30,82,125,26,64,130,188,255,13,156,141,50,66,81,177,43,170,87,134,53,20,225,139,137,233,130,65,170,7,27,251,196,52,19,116,179,179,92,77,189,176,79,7,28,112,150,133,96,115,188,99,52,152,152,155,152,37,94,112,110,34,106,196,244,199,9,208,201,108,171,232,96,4,1,32,4,32,132,210,24,80,104,165,177,137,146,137,44,211,33,127,255,219,183,67,31,83,224,19,53,80,212,225,231,62,121,212,227,126,252,238,92,190,7,57,6,228,84,8,47,146,208,41,98,127,105,118,239,21,227,16,35,200,35,190,70,134,205,49,92,118,120,142,35,98,61,167,33,120,206,210,211,212,97,182,202,6,192,5,44,191,162,35,244,193,23,10,97,13,214,92,87,92,50,33,138,52,19,62,243,28,147,165,81,118,39,4,193,52,107,190,166,6,196,141,115,76,212,87,104,221,65,6,169,7,213,179,18,30,53,155,176,7,73,133,151,148,111,29,35,112,77,64,90,161,115,16,199,122,60,60,124,251,198,21,136,172,111,254,72,87,127,202,52,67,231,206,125,253,241,186,22,46,134,10,82,137,43,126,174,72,142,115,241,199,57,25,253,87,56,66,182,125,123,225,210,119,87,175,147,67,30,137,73,140,67,206,58,232,172,154,1,9,104,108,17,129,144,104,45,225,228,201,43,191,164,194,141,47,28,150,153,162,124,162,138,199,244,102,203,174,186,103,136,221,23,216,108,154,56,113,168,3,214,215,77,165,250,187,130,244,47,214,177,76,177,6,111,160,54,143,213,70,211,127,96,69,69,250,155,121,239,41,192,214,198,199,199,8,70,16,174,118,116,116,108,228,209,207,119,69,144,161,79,237,167,161,63,178,147,156,13,68,131,161,115,159,252,124,128,47,18,3,36,54,58,247,41,231,4,61,233,197,24,135,124,15,130,152,157,53,252,136,50,235,139,51,95,85,151,2,135,67,148,242,66,53,139,64,72,245,105,1,134,144,5,28,115,86,113,195,232,153,22,24,167,242,252,132,9,169,137,162,127,17,6,233,76,32,255,102,83,37,133,175,103,201,113,153,131,5,120,19,51,137,44,51,131,124,51,27,37,123,37,199,212,250,95,140,3,63,88,26,151,174,24,11,200,255,88,28,29,149,243,120,228,193,131,219,215,175,93,250,251,183,223,126,243,77,200,172,161,143,204,221,115,174,32,10,194,63,95,209,33,113,69,88,180,5,86,72,43,126,174,168,46,18,127,20,152,43,8,67,43,235,226,119,223,95,187,125,199,172,44,115,214,65,143,97,211,33,108,150,182,168,14,192,79,171,169,192,168,154,215,224,161,69,23,145,6,74,108,84,148,86,170,204,175,48,14,62,33,19,87,214,84,37,217,182,179,104,36,1,90,204,206,8,134,57,55,45,173,59,35,5,60,53,57,19,21,69,94,91,20,144,167,100,169,122,205,68,156,85,123,52,53,112,179,196,138,23,49,198,164,208,181,227,68,73,77,22,65,179,142,145,26,121,244,232,254,237,171,215,46,145,67,134,62,101,144,115,95,39,69,93,84,10,57,67,156,43,138,177,193,213,47,168,152,92,133,248,95,23,169,147,126,110,143,194,185,243,212,33,55,239,223,53,45,50,50,76,146,124,118,230,44,251,48,87,163,27,20,251,66,149,179,28,166,204,120,122,181,208,249,55,37,250,192,22,149,162,85,197,88,109,37,161,197,103,3,231,68,13,96,123,9,15,123,169,228,16,39,18,96,70,182,16,111,165,226,149,169,201,180,248,165,64,51,7,165,102,188,92,210,141,168,169,0,215,130,20,68,211,78,142,57,168,54,135,113,62,6,119,0,34,85,122,248,147,17,196,252,144,161,111,190,253,79,62,31,215,219,229,138,243,203,80,238,96,124,93,136,155,208,255,136,135,255,220,128,226,31,228,134,1,242,22,168,124,110,104,232,146,17,228,222,61,104,245,225,7,164,200,159,207,124,197,58,175,84,25,236,85,193,98,134,0,216,84,202,209,115,118,222,171,232,149,223,152,144,251,55,55,87,136,180,50,218,29,208,63,182,147,152,201,241,226,51,20,51,92,199,146,61,221,196,157,77,2,254,193,101,213,105,156,107,60,134,139,18,47,237,93,154,244,10,177,113,39,1,127,98,150,19,175,81,99,81,26,203,177,255,216,38,84,0,16,240,26,192,158,70,70,204,81,191,125,227,159,151,47,208,47,252,250,63,120,229,185,21,251,169,158,31,160,224,185,175,195,102,26,88,253,130,88,42,50,202,32,23,81,171,15,153,18,249,238,251,171,55,105,102,13,67,108,61,24,54,14,161,186,40,231,169,140,133,74,101,176,213,166,114,126,11,196,33,48,177,189,80,108,71,196,82,97,230,76,231,202,41,242,49,5,199,111,42,20,183,131,208,102,166,146,192,153,76,40,126,23,91,99,144,55,73,254,123,97,209,100,84,24,137,126,83,94,124,65,28,167,48,107,227,100,135,73,71,246,143,123,177,197,120,105,0,87,11,212,166,112,108,35,15,192,33,151,46,92,248,118,104,48,240,55,224,176,159,59,55,224,4,22,66,92,161,168,139,100,40,216,93,95,23,21,251,199,132,26,116,75,244,175,72,100,221,50,29,114,63,231,144,47,189,165,114,42,152,15,20,72,240,66,133,224,143,212,242,44,79,120,87,8,236,144,10,159,45,167,106,72,26,84,83,172,167,152,203,97,177,46,97,32,243,177,194,165,169,49,95,83,173,63,1,178,227,227,88,206,169,113,83,210,88,89,255,198,137,52,158,46,248,213,164,170,97,198,5,101,139,66,139,146,106,47,70,89,139,81,10,114,64,102,17,145,246,240,225,157,219,55,46,95,190,112,129,28,242,73,180,240,15,252,242,228,146,156,43,196,175,10,17,146,161,143,125,202,92,103,127,44,166,92,118,37,3,193,132,35,56,228,202,213,155,247,238,8,29,100,244,184,111,4,25,104,95,32,60,78,2,133,8,140,48,31,137,165,193,164,107,138,226,86,102,132,34,152,241,56,235,212,76,110,191,206,20,76,216,34,95,120,25,94,148,216,133,61,52,149,236,34,50,0,62,144,118,83,147,178,96,197,26,99,147,121,181,75,34,198,168,23,99,20,49,230,35,35,186,32,164,118,244,145,113,200,77,40,245,243,67,67,159,152,183,231,255,200,67,31,224,156,243,57,11,13,21,195,195,31,197,77,134,138,17,196,184,96,0,25,241,18,209,197,105,60,52,116,209,8,114,239,214,221,59,20,90,160,137,137,172,39,11,101,97,3,25,177,181,133,206,236,241,207,152,233,171,120,239,89,130,15,158,184,175,161,110,68,96,143,20,46,156,246,150,43,84,29,244,249,102,102,100,158,206,76,38,57,85,114,39,65,54,17,150,118,42,252,232,160,193,212,100,148,122,149,188,134,88,223,78,233,130,156,1,189,61,153,23,31,1,230,44,236,127,169,0,247,31,33,176,22,213,23,35,177,131,69,30,253,252,211,237,235,63,92,66,180,247,155,1,89,196,36,135,66,238,95,127,154,222,56,55,52,168,107,134,254,3,31,125,18,27,43,38,75,10,1,128,8,19,24,131,92,248,199,255,144,67,200,34,216,254,116,230,75,151,75,243,84,217,44,46,242,101,175,56,10,36,178,75,149,84,81,145,18,175,238,145,51,254,55,197,166,80,179,30,90,202,179,16,82,26,37,55,149,74,94,176,205,245,213,162,142,23,11,187,74,197,34,47,251,197,104,41,33,155,199,198,74,133,146,163,129,98,48,55,167,2,72,14,12,224,72,58,140,10,134,6,236,231,131,159,126,188,113,237,242,197,191,159,87,78,15,106,149,43,244,45,242,85,74,235,13,13,121,74,10,23,202,71,57,193,112,113,254,235,1,139,107,104,40,226,132,124,246,245,195,161,143,66,91,110,83,147,57,196,33,67,120,225,127,195,197,75,166,212,111,221,52,179,247,62,216,195,14,16,89,204,234,85,10,141,77,11,96,156,249,66,135,217,168,16,38,29,102,66,99,68,200,118,90,245,70,121,79,137,169,40,191,166,50,152,10,141,48,197,167,127,50,150,120,96,125,169,151,125,209,75,81,244,229,159,39,114,3,106,108,144,37,30,231,186,34,85,98,144,53,70,211,46,4,250,200,240,195,123,183,111,252,112,229,226,37,229,199,149,244,30,178,195,249,66,174,27,9,221,148,0,63,31,201,240,243,113,82,166,23,63,193,71,37,126,253,107,156,121,73,66,27,191,233,159,101,194,118,200,191,210,143,191,214,63,124,225,194,119,255,248,254,250,205,59,119,68,14,112,201,159,206,156,205,241,105,254,158,43,100,96,189,209,108,217,181,5,219,104,70,7,187,217,57,215,29,224,140,98,129,81,4,166,72,13,200,168,146,42,231,199,88,187,85,74,178,223,29,104,247,23,198,162,26,50,175,140,244,47,242,31,140,37,165,93,44,80,122,172,195,227,68,136,192,254,123,41,64,42,8,120,52,124,255,222,13,211,234,23,47,1,244,81,68,132,156,15,20,3,143,23,47,252,1,98,36,126,226,63,196,133,173,232,144,35,27,226,179,189,113,119,8,39,30,135,226,152,95,234,227,249,33,251,31,241,221,149,239,175,223,187,121,231,254,157,251,247,197,37,198,33,209,213,195,77,167,25,197,107,117,119,134,249,190,96,140,185,66,6,59,117,234,114,56,1,72,146,244,248,100,129,67,198,36,163,166,38,115,49,52,150,106,33,243,181,142,39,254,35,141,144,87,95,140,22,139,146,18,79,240,171,146,142,168,76,50,114,0,47,157,51,69,156,75,192,167,155,140,190,123,251,58,64,109,4,78,249,70,20,213,69,94,240,186,176,95,140,155,254,73,231,11,23,47,130,160,56,94,184,200,115,92,36,58,94,44,2,126,120,188,56,116,225,162,201,40,254,198,72,97,159,46,126,119,241,31,87,32,177,160,67,36,177,238,27,65,206,138,24,97,207,206,40,231,26,61,153,203,97,74,85,10,133,120,210,227,209,92,83,145,170,153,185,20,162,154,20,73,38,83,201,75,170,140,28,255,72,234,39,121,228,198,81,169,80,160,58,26,188,32,186,140,13,210,163,52,250,201,246,120,236,241,8,25,100,196,11,98,130,24,37,167,204,227,145,71,143,126,185,127,251,230,245,235,63,92,3,192,80,176,194,203,151,3,87,120,249,187,203,151,236,205,11,158,245,78,119,236,242,187,127,224,243,119,184,188,108,235,249,221,149,43,23,47,94,1,65,252,194,78,223,125,135,23,79,126,253,29,175,227,11,222,254,142,247,190,251,254,127,174,92,191,126,239,150,51,136,91,89,95,122,215,217,74,177,109,93,148,68,206,17,68,30,60,66,14,153,29,204,124,167,156,246,220,84,33,70,56,57,85,32,201,164,121,22,78,21,228,41,6,212,50,73,52,206,226,174,49,49,68,44,124,41,68,211,104,206,30,165,2,91,140,22,252,12,17,228,177,56,36,216,67,175,82,177,50,102,248,209,195,225,159,110,131,36,87,129,192,253,254,218,53,188,113,241,131,157,129,10,189,118,197,104,117,245,234,21,236,220,236,250,251,43,120,95,249,254,123,190,108,55,2,234,2,119,175,240,252,63,255,131,151,78,186,252,111,188,28,85,122,249,202,63,236,187,127,224,120,197,14,255,176,215,119,255,243,223,87,254,231,251,171,160,199,189,59,226,16,30,62,19,135,216,86,78,40,180,242,92,168,145,74,110,75,149,231,216,99,182,136,48,72,141,212,156,48,51,84,37,12,27,122,192,48,90,119,149,216,53,130,25,138,49,246,92,41,26,74,163,81,201,93,80,36,163,65,156,177,36,198,198,62,17,88,31,19,101,76,229,148,143,83,29,89,41,23,87,210,233,144,89,247,127,186,119,251,222,237,155,63,222,188,121,227,166,81,230,186,189,111,114,187,126,131,251,245,235,255,226,241,186,31,7,182,171,182,243,112,213,207,196,84,95,189,138,27,64,81,95,189,250,189,222,223,95,255,254,123,123,227,104,228,182,227,247,87,253,141,3,95,248,217,245,235,255,125,235,206,157,164,64,238,147,67,114,66,232,106,70,16,65,225,69,164,211,197,35,225,141,207,70,59,187,32,6,83,219,51,226,146,188,53,81,50,179,38,83,56,214,91,224,76,165,66,238,156,38,163,234,120,48,154,116,250,120,94,93,159,10,238,199,66,103,196,169,72,146,177,199,163,224,144,199,73,123,148,6,85,200,136,243,200,207,63,221,71,149,129,61,153,183,64,26,219,239,221,186,125,219,175,241,74,85,5,118,125,243,222,61,214,26,220,186,233,219,45,147,249,246,225,246,245,219,215,239,93,191,125,251,250,245,91,215,111,222,2,173,238,217,251,214,213,235,183,110,93,189,106,191,193,29,30,174,223,250,94,87,124,223,194,89,159,110,125,127,235,250,189,255,190,101,244,184,151,116,200,48,116,200,151,44,6,152,47,84,3,8,159,201,228,223,140,100,216,71,8,205,66,151,3,87,34,240,7,25,90,159,73,189,88,138,13,212,204,249,152,156,128,192,98,36,100,32,12,56,26,141,64,194,138,26,45,88,88,33,170,198,6,20,202,199,28,34,157,110,86,214,24,213,122,193,186,74,138,61,180,200,163,17,70,185,31,252,140,234,26,227,149,135,247,238,63,188,127,255,222,253,159,238,223,103,101,13,94,40,176,209,251,14,246,59,119,239,221,179,23,86,205,40,116,199,118,190,238,220,190,5,130,217,37,239,221,186,117,235,54,119,94,220,195,233,38,14,186,188,238,251,61,146,228,191,255,251,22,206,252,250,38,248,195,57,36,68,214,164,168,81,150,85,149,194,33,82,227,249,53,84,72,177,111,246,0,40,106,74,237,113,102,166,242,228,83,82,36,9,106,32,31,132,18,107,60,69,60,82,228,3,101,149,137,59,10,89,140,60,42,50,168,203,63,82,235,144,87,35,99,35,201,251,40,216,89,165,2,135,0,253,244,232,193,240,195,225,135,15,113,0,117,126,177,247,207,63,227,96,235,241,203,47,247,141,58,191,24,177,64,36,108,233,194,150,237,238,253,59,247,238,160,64,234,39,163,147,29,238,223,185,75,154,25,73,210,251,182,118,91,105,189,110,225,101,251,45,190,157,112,183,140,45,140,86,252,155,59,254,143,83,137,220,50,43,235,206,71,80,127,71,81,121,43,53,39,76,121,54,172,172,104,199,172,179,183,1,17,162,109,182,144,222,155,153,42,96,162,76,173,35,74,62,62,229,1,145,201,162,98,231,107,220,27,178,140,198,185,232,143,36,43,120,236,63,154,88,140,149,140,65,96,149,162,4,121,64,84,21,182,7,35,15,31,121,104,117,248,1,211,166,246,9,59,195,223,70,23,190,124,115,255,249,254,131,251,31,111,119,245,54,26,221,191,99,244,249,137,143,250,29,16,201,136,166,237,246,189,59,247,252,195,45,30,238,129,40,119,242,27,252,147,196,28,248,111,253,151,233,144,179,133,136,97,140,29,153,11,80,185,228,85,129,38,179,115,115,185,200,242,4,173,122,71,77,120,140,125,22,128,168,217,188,87,142,199,78,38,199,17,198,141,150,94,37,207,97,20,147,172,19,88,125,163,204,216,68,210,236,99,5,233,245,7,106,188,148,223,48,121,133,226,240,145,199,94,138,84,36,198,39,84,33,224,70,58,94,31,184,161,126,115,56,49,142,142,15,68,21,69,98,115,73,63,112,85,220,226,113,191,47,81,116,167,176,221,42,208,33,81,227,78,225,111,241,239,125,102,58,228,203,91,1,135,70,175,168,176,171,42,115,210,30,174,207,83,98,150,254,121,206,35,34,10,17,33,115,51,129,68,152,157,154,41,121,50,202,121,100,50,175,194,31,87,176,93,249,189,241,96,146,146,56,162,52,86,108,21,50,38,2,133,37,92,202,89,163,52,72,159,18,137,161,104,73,148,231,127,204,35,118,46,169,12,227,145,12,46,221,126,56,226,180,25,1,238,227,193,131,160,204,163,148,195,227,241,193,253,159,135,85,66,123,143,196,185,135,51,89,199,100,220,71,252,115,39,189,193,44,65,22,59,131,89,32,226,64,174,96,141,116,36,113,255,235,207,166,67,206,126,57,18,197,1,229,249,25,243,12,203,94,29,144,116,71,56,32,115,1,77,143,38,242,194,48,204,146,36,51,142,220,153,14,111,100,50,199,130,164,208,251,120,106,107,23,88,144,82,30,68,17,109,16,77,12,15,62,233,149,220,208,42,146,165,72,147,199,163,242,65,74,37,87,34,127,32,172,156,0,81,139,49,236,59,95,195,194,215,218,235,81,194,72,141,36,201,245,32,4,88,226,23,15,61,217,34,62,28,118,147,245,206,32,85,238,196,73,188,114,63,49,197,157,184,225,123,190,221,250,204,56,228,236,151,103,191,40,41,219,164,94,69,115,243,41,90,18,42,100,86,47,234,10,5,20,231,98,4,198,156,155,189,200,220,122,86,48,239,5,57,153,43,118,125,48,130,148,34,9,50,142,96,251,100,30,78,41,125,28,188,29,11,141,158,247,55,250,52,110,226,2,203,91,90,140,60,30,25,73,54,86,233,19,141,94,16,90,201,51,113,1,246,8,96,78,209,35,164,87,146,91,137,22,195,247,243,76,82,34,74,129,26,195,133,245,117,62,184,159,83,193,47,18,117,10,28,34,137,5,122,64,135,124,249,229,217,59,212,225,98,133,212,61,202,53,72,25,78,97,57,199,73,79,39,66,228,152,208,232,66,152,35,122,34,162,85,176,126,3,41,50,70,6,25,159,26,212,234,137,34,165,177,98,55,182,65,99,183,52,16,195,42,6,23,149,244,8,235,234,63,171,116,105,144,224,10,231,143,17,103,14,158,30,137,26,143,66,183,60,24,46,18,37,18,73,78,146,135,247,11,42,229,35,185,21,175,156,33,114,10,13,223,137,143,57,73,140,30,36,200,151,103,109,251,242,214,164,187,30,201,227,200,53,72,216,188,8,154,204,6,224,124,186,216,76,88,48,117,98,109,243,6,120,121,7,151,4,246,25,159,156,128,6,137,28,225,120,10,54,70,215,206,212,248,43,133,118,115,119,221,207,165,79,9,36,123,183,160,67,10,205,70,254,72,100,21,24,165,32,174,156,69,138,219,72,145,61,134,101,8,57,91,220,215,71,127,229,207,250,157,252,226,254,157,156,34,119,226,116,39,191,145,255,248,206,253,91,255,69,114,80,100,97,59,235,187,94,103,117,75,180,58,251,229,23,103,207,126,193,221,206,95,126,110,231,207,241,253,231,118,212,203,15,254,233,11,219,252,247,246,107,251,213,231,60,254,249,139,47,62,231,23,159,227,236,135,47,252,192,207,113,239,243,179,249,23,103,253,171,207,227,55,218,248,51,126,226,233,236,231,233,75,220,255,51,94,216,227,172,43,158,252,150,189,190,176,255,247,118,241,217,103,249,239,63,251,252,243,207,252,247,246,225,207,246,37,223,92,168,207,62,251,211,103,105,251,51,238,227,158,190,242,139,63,249,111,120,254,19,175,117,254,211,159,10,95,218,134,27,133,31,243,95,212,254,231,207,254,127,228,35,173,26,11,214,216,34,0,0,0,0,73,69,78,68,174,66,96,130};
Index: /OgreMain/src/GLX/OgreConfigDialog.cpp
===================================================================
--- /OgreMain/src/GLX/OgreConfigDialog.cpp	(revision 5)
+++ /OgreMain/src/GLX/OgreConfigDialog.cpp	(revision 5)
@@ -0,0 +1,511 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreConfigDialog.h"
+#include "OgreException.h"
+#include "OgreImage.h"
+#include "OgreLogManager.h"
+#include "OgreNoMemoryMacros.h"
+
+#include <cstdlib>
+#include <iostream>
+
+#include <string>
+
+#include <X11/X.h>
+#include <X11/Xutil.h>
+#include <X11/Xlib.h>
+#include <X11/keysym.h>
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Box.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/Toggle.h>
+#include <X11/Xaw/MenuButton.h>
+#include <X11/Xaw/SimpleMenu.h>
+#include <X11/Xaw/SmeBSB.h>
+
+#include <list>
+
+namespace {
+/**
+Backdrop image. This must be sized mWidth by mHeight, and produce a
+RGB pixel format when loaded with Image::load .
+
+You can easily generate your own backdrop with the following python script:
+
+#!/usr/bin/python
+import sys
+pngstring=open(sys.argv[2], "rb").read()
+print "char %s[%i]={%s};" % (sys.argv[1],len(pngstring), ",".join([str(ord(x)) for x in pngstring]))
+
+Call this with
+$ bintoheader.py GLX_backdrop GLX_backdrop.png > GLX_backdrop.h
+
+*/
+#include "GLX_backdrop.h"
+
+};
+
+namespace Ogre {
+
+/**
+ * Single X window with image backdrop, making it possible to configure
+ * OGRE in a graphical way.
+ * XaW uses a not-very-smart widget positioning system, so I override it to use
+ * fixed positions. This works great, but it means you need to define the various
+ * positions manually.
+ * Furthermore, it has no OptionMenu by default, so I simulate this with dropdown
+ * buttons.
+ */
+class GLXConfigurator {
+	/* GUI constants */
+	static const int wWidth = 400;		// Width of window
+	static const int wHeight = 300;		// Height of window
+	static const int col1x = 20;		// Starting x of column 1 (labels)
+	static const int col2x = 180;		// Starting x of column 2 (options)
+	static const int col1w = 150;		// Width of column 1 (labels)
+	static const int col2w = 200;		// Width of column 2 (options)
+	static const int ystart = 105;		// Starting y of option table rows
+	static const int rowh = 20;		// Height of one row in the option table
+
+public:
+	GLXConfigurator();
+	virtual ~GLXConfigurator();
+
+	bool CreateWindow();
+	void Main();
+	/**
+	 * Exit from main loop.
+	 */
+	void Exit();
+protected:
+	Display *mDisplay;
+	Window mWindow;
+	Pixmap mBackDrop;
+
+	int mWidth, mHeight;
+	// Xt
+	XtAppContext appContext;
+	Widget toplevel;
+
+	/**
+	 * Create backdrop image, and return it as a Pixmap.
+	 */
+	virtual Pixmap CreateBackdrop(Window rootWindow, int depth);
+	/**
+	 * Called after window initialisation.
+	 */
+	virtual bool Init();
+	/**
+	 * Called initially, and on expose.
+	 */
+	virtual void Draw();
+public:
+	/* Local */
+	bool accept;
+	/* Class that binds a callback to a RenderSystem */
+	class RendererCallbackData {
+	public:
+		RendererCallbackData(GLXConfigurator *parent, RenderSystem *renderer, Widget optionmenu):
+			parent(parent),
+			renderer(renderer),
+			optionmenu(optionmenu) {
+		}
+		GLXConfigurator *parent;
+		RenderSystem *renderer;
+		Widget optionmenu;
+	};
+	std::list<RendererCallbackData> mRendererCallbackData;
+
+	RenderSystem *mRenderer;
+	Widget box; 				// Box'o control widgets
+	std::list<Widget> mRenderOptionWidgets; // List of RenderSystem specific
+						// widgets for visibility management (cleared when another rendersystem is selected)
+	/* Class that binds a callback to a certain configuration option/value */
+	class ConfigCallbackData {
+	public:
+		ConfigCallbackData(GLXConfigurator *parent, const std::string &optionName, const std::string &valueName, Widget optionmenu):
+			parent(parent),
+			optionName(optionName),
+			valueName(valueName),
+			optionmenu(optionmenu) {
+		}
+		GLXConfigurator *parent;
+		std::string optionName, valueName;
+		Widget optionmenu;
+	};
+	std::list<ConfigCallbackData> mConfigCallbackData;
+
+	void SetRenderSystem(RenderSystem *sys) {
+		mRenderer = sys;
+	}
+private:
+	/* Callbacks that terminate modal dialog loop */
+	static void acceptHandler(Widget w, GLXConfigurator *obj, XtPointer callData) {
+		// Check if a renderer was selected, if not, don't accept
+		if(!obj->mRenderer)
+			return;
+		obj->accept = true;
+		obj->Exit();
+	}
+	static void cancelHandler(Widget w, GLXConfigurator *obj, XtPointer callData) {
+		obj->Exit();
+	}
+	/* Callbacks that set a setting */
+	static void renderSystemHandler(Widget w, RendererCallbackData *cdata, XtPointer callData) {
+		// Set selected renderer its name
+		XtVaSetValues(cdata->optionmenu, XtNlabel, cdata->renderer->getName().c_str(), 0, NULL);
+		// Notify Configurator (and Ogre)
+		cdata->parent->SetRenderer(cdata->renderer);
+	}
+	static void configOptionHandler(Widget w, ConfigCallbackData *cdata, XtPointer callData) {
+		// Set selected renderer its name
+		XtVaSetValues(cdata->optionmenu, XtNlabel, cdata->valueName.c_str(), 0, NULL);
+		// Notify Configurator (and Ogre)
+		cdata->parent->SetConfigOption(cdata->optionName, cdata->valueName);
+	}
+
+	/* Functions reacting to GUI */
+	void SetRenderer(RenderSystem *);
+	void SetConfigOption(const std::string &optionName, const std::string &valueName);
+};
+
+GLXConfigurator::GLXConfigurator():
+	mDisplay(0), mWindow(0), mBackDrop(0),
+	mWidth(wWidth), mHeight(wHeight),
+	appContext(0), toplevel(0),
+
+	accept(false),
+	mRenderer(0) {
+}
+GLXConfigurator::~GLXConfigurator() {
+	if(mBackDrop)
+		XFreePixmap(mDisplay, mBackDrop);
+	if(toplevel) {
+		XtUnrealizeWidget(toplevel);
+		XtDestroyWidget(toplevel);
+	}
+	if(mDisplay) {
+		XCloseDisplay(mDisplay);
+	}
+}
+
+bool GLXConfigurator::CreateWindow() {
+
+
+	char *bla[] = {"Rendering Settings", "-bg", "honeydew3", "-fg", "black","-bd","darkseagreen4"};
+	int argc = sizeof(bla)/sizeof(*bla);
+
+	toplevel = XtVaOpenApplication(&appContext, "OGRE", NULL, 0, &argc, bla, NULL,sessionShellWidgetClass,
+		XtNwidth, mWidth,
+		XtNheight, mHeight,
+		XtNminWidth, mWidth,
+		XtNmaxWidth, mWidth,
+		XtNminHeight, mHeight,
+		XtNmaxHeight, mHeight,
+		XtNallowShellResize, False,
+		XtNborderWidth, 0,
+		XtNoverrideRedirect, True,
+		NULL, NULL);
+
+	/* Find out display and screen used */
+	mDisplay = XtDisplay(toplevel);
+	int screen = DefaultScreen(mDisplay);
+	Window rootWindow = RootWindow(mDisplay,screen);
+
+	/* Move to center of display */
+	int w = DisplayWidth(mDisplay, screen);
+	int h = DisplayHeight(mDisplay, screen);
+	XtVaSetValues(toplevel,
+			XtNx, w/2-mWidth/2,
+			XtNy, h/2-mHeight/2, 0, NULL);
+
+	/* Backdrop stuff */
+	mBackDrop = CreateBackdrop(rootWindow, DefaultDepth(mDisplay,screen));
+
+	/* Create toplevel */
+	box = XtVaCreateManagedWidget("box",formWidgetClass,toplevel,
+		XtNbackgroundPixmap, mBackDrop,
+		0,NULL);
+
+	/* Create renderer selection */
+	int cury = ystart + 0*rowh;
+
+	Widget lb1 = XtVaCreateManagedWidget("topLabel", labelWidgetClass, box, XtNlabel, "Select Renderer", XtNborderWidth, 0,
+		XtNwidth, col1w, 	// Fixed width
+		XtNheight, 18,
+		XtNleft, XawChainLeft,
+		XtNtop, XawChainTop,
+		XtNright, XawChainLeft,
+		XtNbottom, XawChainTop,
+		XtNhorizDistance, col1x,
+		XtNvertDistance, cury,
+		XtNjustify, XtJustifyLeft,
+		NULL);
+	const char *curRenderName = " Select One "; // Name of current renderer, or hint to select one
+	if(mRenderer)
+		curRenderName = mRenderer->getName().c_str();
+	Widget mb1 = XtVaCreateManagedWidget("Menu", menuButtonWidgetClass, box, XtNlabel,curRenderName,
+		XtNresize, false,
+		XtNresizable, false,
+		XtNwidth, col2w, 	// Fixed width
+		XtNheight, 18,
+		XtNleft, XawChainLeft,
+		XtNtop, XawChainTop,
+		XtNright, XawChainLeft,
+		XtNbottom, XawChainTop,
+		XtNhorizDistance, col2x,
+		XtNvertDistance, cury,
+		NULL);
+
+	Widget menu = XtVaCreatePopupShell("menu", simpleMenuWidgetClass, mb1,
+		0, NULL);
+
+	RenderSystemList* renderers = Root::getSingleton().getAvailableRenderers();
+	for (RenderSystemList::iterator pRend = renderers->begin();
+	                pRend != renderers->end(); pRend++) {
+		// Create callback data
+		mRendererCallbackData.push_back(RendererCallbackData(this, *pRend, mb1));
+
+		Widget entry = XtVaCreateManagedWidget("menuentry", smeBSBObjectClass, menu,
+			XtNlabel, (*pRend)->getName().c_str(),
+			0, NULL);
+		XtAddCallback(entry, XtNcallback, (XtCallbackProc)&GLXConfigurator::renderSystemHandler, &mRendererCallbackData.back());
+	}
+
+	Widget bottomPanel = XtVaCreateManagedWidget("bottomPanel", formWidgetClass, box,
+		XtNsensitive, True,
+		XtNborderWidth, 0,
+		XtNwidth, 150, 	// Fixed width
+		XtNleft, XawChainLeft,
+		XtNtop, XawChainTop,
+		XtNright, XawChainLeft,
+		XtNbottom, XawChainTop,
+		XtNhorizDistance, mWidth - 160,
+		XtNvertDistance, mHeight - 40,
+		NULL);
+
+	Widget helloButton = XtVaCreateManagedWidget("cancelButton", commandWidgetClass, bottomPanel, XtNlabel," Cancel ", NULL);
+	XtAddCallback(helloButton, XtNcallback, (XtCallbackProc)&GLXConfigurator::cancelHandler, this);
+
+	Widget exitButton = XtVaCreateManagedWidget("acceptButton", commandWidgetClass, bottomPanel, XtNlabel," Accept ", XtNfromHoriz,helloButton, NULL);
+ 	XtAddCallback(exitButton, XtNcallback, (XtCallbackProc)&GLXConfigurator::acceptHandler, this);
+
+	XtRealizeWidget(toplevel);
+
+	if(mRenderer)
+		/* There was already a renderer selected; display its options */
+		SetRenderer(mRenderer);
+
+	return true;
+}
+
+Pixmap GLXConfigurator::CreateBackdrop(Window rootWindow, int depth) {
+	int bpl;
+	/* Find out number of bytes per pixel */
+	switch(depth) {
+	default:
+		LogManager::getSingleton().logMessage("GLX backdrop: Undsupported bit depth");
+		/* Unsupported bit depth */
+		return 0;
+	case 15:
+	case 16:
+		bpl = 2; break;
+	case 24:
+	case 32:
+		bpl = 4; break;
+	}
+	/* Create background pixmap */
+	unsigned char *data = 0; // Must be allocated with malloc
+
+	try {
+        String imgType = "png";
+        Image img;
+        MemoryDataStream *imgStream;
+        DataStreamPtr imgStreamPtr;
+
+        // Load backdrop image using OGRE
+        imgStream = new MemoryDataStream((void*)GLX_backdrop_data, sizeof(GLX_backdrop_data), false);
+        imgStreamPtr = DataStreamPtr(imgStream);
+		img.load(imgStreamPtr, imgType);
+
+        PixelBox src = img.getPixelBox(0, 0);
+
+		// Convert and copy image
+		data = (unsigned char*)malloc(mWidth * mHeight * bpl); // Must be allocated with malloc
+
+        PixelBox dst(src, bpl == 2 ? PF_B5G6R5 : PF_A8R8G8B8, data );
+
+        PixelUtil::bulkPixelConversion(src, dst);
+	} catch(Exception &e) {
+		// Could not find image; never mind
+		LogManager::getSingleton().logMessage("GLX backdrop image not found: Warning");
+		return 0;
+	}
+
+	GC context = XCreateGC (mDisplay, rootWindow, 0, NULL);
+
+	/* put my pixmap data into the client side X image data structure */
+	XImage *image = XCreateImage (mDisplay, NULL, depth, ZPixmap, 0,
+		(char*)data,
+		mWidth, mHeight, 8,
+		mWidth*bpl);
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+	image->byte_order = MSBFirst;
+#else
+    image->byte_order = LSBFirst;
+#endif
+
+	/* tell server to start managing my pixmap */
+	Pixmap rv = XCreatePixmap(mDisplay, rootWindow, mWidth,
+		mHeight, depth);
+
+	/* copy from client to server */
+	XPutImage(mDisplay, rv, context, image, 0, 0, 0, 0,
+	 	mWidth, mHeight);
+
+	/* free up the client side pixmap data area */
+	XDestroyImage(image); // also cleans data
+	XFreeGC(mDisplay, context);
+
+	return rv;
+}
+bool GLXConfigurator::Init() {
+	// Init misc resources
+	return true;
+}
+void GLXConfigurator::Draw() {
+}
+void GLXConfigurator::Main() {
+	XtAppMainLoop(appContext);
+}
+void GLXConfigurator::Exit() {
+	XtAppSetExitFlag(appContext);
+}
+
+void GLXConfigurator::SetRenderer(RenderSystem *r) {
+	mRenderer = r;
+
+	// Destroy each widget of GUI of previously selected renderer
+	for(std::list<Widget>::iterator i=mRenderOptionWidgets.begin(); i!=mRenderOptionWidgets.end(); i++)
+		XtDestroyWidget(*i);
+	mRenderOptionWidgets.clear();
+	mConfigCallbackData.back();
+
+	// Create option GUI
+	int cury = ystart + 1*rowh + 10;
+
+	ConfigOptionMap options = mRenderer->getConfigOptions();
+	// Process each option and create an optionmenu widget for it
+	for (ConfigOptionMap::iterator it = options.begin();
+					it != options.end(); it++) {
+		Widget lb1 = XtVaCreateManagedWidget("topLabel", labelWidgetClass, box, XtNlabel, it->second.name.c_str(), XtNborderWidth, 0,
+			XtNwidth, col1w, 	// Fixed width
+			XtNheight, 18,
+			XtNleft, XawChainLeft,
+			XtNtop, XawChainTop,
+			XtNright, XawChainLeft,
+			XtNbottom, XawChainTop,
+			XtNhorizDistance, col1x,
+			XtNvertDistance, cury,
+			XtNjustify, XtJustifyLeft,
+			NULL);
+		mRenderOptionWidgets.push_back(lb1);
+		Widget mb1 = XtVaCreateManagedWidget("Menu", menuButtonWidgetClass, box, XtNlabel, it->second.currentValue.c_str(),
+			XtNresize, false,
+			XtNresizable, false,
+			XtNwidth, col2w, 	// Fixed width
+			XtNheight, 18,
+			XtNleft, XawChainLeft,
+			XtNtop, XawChainTop,
+			XtNright, XawChainLeft,
+			XtNbottom, XawChainTop,
+			XtNhorizDistance, col2x,
+			XtNvertDistance, cury,
+			NULL);
+		mRenderOptionWidgets.push_back(mb1);
+
+		Widget menu = XtVaCreatePopupShell("menu", simpleMenuWidgetClass, mb1,
+			0, NULL);
+
+		// Process each choice
+		StringVector::iterator opt_it;
+		for (opt_it = it->second.possibleValues.begin();
+		                opt_it != it->second.possibleValues.end(); opt_it++) {
+			// Create callback data
+			mConfigCallbackData.push_back(ConfigCallbackData(this, it->second.name, *opt_it, mb1));
+
+			Widget entry = XtVaCreateManagedWidget("menuentry", smeBSBObjectClass, menu,
+				XtNlabel, (*opt_it).c_str(),
+				0, NULL);
+			XtAddCallback(entry, XtNcallback, (XtCallbackProc)&GLXConfigurator::configOptionHandler, &mConfigCallbackData.back());
+		}
+		cury += rowh;
+	}
+}
+
+void GLXConfigurator::SetConfigOption(const std::string &optionName, const std::string &valueName) {
+	if(!mRenderer)
+		// No renderer set -- how can this be called?
+		return;
+	mRenderer->setConfigOption(optionName, valueName);
+}
+
+//------------------------------------------------------------------------------------//
+ConfigDialog::ConfigDialog() : mSelectedRenderSystem(0)
+{
+}
+
+//------------------------------------------------------------------------------------//
+bool ConfigDialog::display()
+{
+	GLXConfigurator test;
+	/* Select previously selected rendersystem */
+	if(Root::getSingleton().getRenderSystem())
+		test.SetRenderSystem(Root::getSingleton().getRenderSystem());
+	/* Attempt to create the window */
+	if(!test.CreateWindow())
+		OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Could not create configuration dialog",
+		       "GLXConfig::display");
+
+	// Modal loop
+	test.Main();
+	if(!test.accept) // User did not accept
+		return false;
+
+	/* All done */
+	Root::getSingleton().setRenderSystem(test.mRenderer);
+
+	return true;
+}
+};
+
Index: /OgreMain/src/GLX/OgreErrorDialog.cpp
===================================================================
--- /OgreMain/src/GLX/OgreErrorDialog.cpp	(revision 5)
+++ /OgreMain/src/GLX/OgreErrorDialog.cpp	(revision 5)
@@ -0,0 +1,43 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+ 
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+ 
+This program 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 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 Lesser General Public License for more details.
+ 
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreErrorDialog.h"
+#include <iostream>
+
+using namespace Ogre;
+
+//---------------------------------------------------------------------------//
+ErrorDialog::ErrorDialog()
+{
+}
+
+//---------------------------------------------------------------------------//
+void ErrorDialog::display(const String& errorMessage, String logName)
+{
+	std::cout << "*** ERROR: " << errorMessage << std::endl;
+}
Index: /OgreMain/src/GLX/OgreTimer.cpp
===================================================================
--- /OgreMain/src/GLX/OgreTimer.cpp	(revision 5)
+++ /OgreMain/src/GLX/OgreTimer.cpp	(revision 5)
@@ -0,0 +1,80 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+ 
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+ 
+This program 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 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 Lesser General Public License for more details.
+ 
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreTimer.h"
+#include <sys/time.h>
+
+using namespace Ogre;
+
+//--------------------------------------------------------------------------------//
+Timer::Timer()
+{
+	reset();
+}
+
+//--------------------------------------------------------------------------------//
+Timer::~Timer()
+{
+}
+
+//--------------------------------------------------------------------------------//
+void Timer::reset()
+{
+	zeroClock = clock();
+	gettimeofday(&start, NULL);
+}
+
+//--------------------------------------------------------------------------------//
+unsigned long Timer::getMilliseconds()
+{
+	struct timeval now;
+	gettimeofday(&now, NULL);
+	return (now.tv_sec-start.tv_sec)*1000+(now.tv_usec-start.tv_usec)/1000;
+}
+
+//--------------------------------------------------------------------------------//
+unsigned long Timer::getMicroseconds()
+{
+	struct timeval now;
+	gettimeofday(&now, NULL);
+	return (now.tv_sec-start.tv_sec)*1000000+(now.tv_usec-start.tv_usec);
+}
+
+//-- Common Across All Timers ----------------------------------------------------//
+unsigned long Timer::getMillisecondsCPU()
+{
+	clock_t newClock = clock();
+	return (unsigned long)((float)(newClock-zeroClock) / ((float)CLOCKS_PER_SEC/1000.0)) ;
+}
+
+//-- Common Across All Timers ----------------------------------------------------//
+unsigned long Timer::getMicrosecondsCPU()
+{
+	clock_t newClock = clock();
+	return (unsigned long)((float)(newClock-zeroClock) / ((float)CLOCKS_PER_SEC/1000000.0)) ;
+}
Index: /OgreMain/src/Makefile.am
===================================================================
--- /OgreMain/src/Makefile.am	(revision 5)
+++ /OgreMain/src/Makefile.am	(revision 5)
@@ -0,0 +1,194 @@
+INCLUDES = $(STLPORT_CFLAGS) $(FT2_CFLAGS) -I$(top_srcdir)/OgreMain/include -DOGRE_NONCLIENT_BUILD $(PLATFORM_CFLAGS) $(ZZIPLIB_CFLAGS) $(DEVIL_CFLAGS) $(FREEIMAGE_CFLAGS) $(GTK_CFLAGS) $(CFLAGS_VISIBILITY)
+
+EXTRA_LTLIBRARIES = libSSEsupport.la
+libSSEsupport_la_SOURCES = OgreOptimisedUtilSSE.cpp
+libSSEsupport_la_CPPFLAGS = -msse
+
+lib_LTLIBRARIES=libOgreMain.la
+
+libOgreMain_la_SOURCES = OgreAlignedAllocator.cpp \
+                         OgreAnimation.cpp \
+			 OgreAnimable.cpp \
+                         OgreAnimationState.cpp \
+                         OgreAnimationTrack.cpp \
+                         OgreArchiveManager.cpp \
+			 OgreAutoParamDataSource.cpp \
+                         OgreBillboard.cpp \
+			 OgreBillboardChain.cpp \
+                         OgreBillboardParticleRenderer.cpp \
+                         OgreBillboardSet.cpp \
+                         OgreBone.cpp \
+                         OgreBorderPanelOverlayElement.cpp \
+                         OgreCamera.cpp \
+                         OgreCodec.cpp \
+                         OgreColourValue.cpp \
+                         OgreCommon.cpp \
+                         OgreConfigFile.cpp \
+                         OgreControllerManager.cpp \
+						 OgreConvexBody.cpp \
+                         OgreDataStream.cpp \
+                         OgreDDSCodec.cpp \
+                         OgreDefaultHardwareBufferManager.cpp \
+			 OgreDefaultSceneQueries.cpp \
+                         OgreDynLib.cpp \
+                         OgreDynLibManager.cpp \
+                         OgreEdgeListBuilder.cpp \
+                         OgreEntity.cpp \
+                         OgreException.cpp \
+			 OgreExternalTextureSource.cpp \
+			 OgreExternalTextureSourceManager.cpp \
+                         OgreFileSystem.cpp \
+                         OgreFont.cpp \
+                         OgreFontManager.cpp \
+			 OgreFrustum.cpp \
+                         OgreGpuProgram.cpp \
+                         OgreGpuProgramManager.cpp \
+                         OgreGpuProgramUsage.cpp \
+			 OgreHardwareBufferManager.cpp \
+			 OgreHardwareIndexBuffer.cpp \
+			 OgreHardwareOcclusionQuery.cpp \
+			 OgreHardwareVertexBuffer.cpp \
+			 OgreHardwarePixelBuffer.cpp \
+			 OgreHighLevelGpuProgram.cpp \
+			 OgreHighLevelGpuProgramManager.cpp \
+                         OgreImage.cpp \
+						 OgreInstancedGeometry.cpp \
+                         OgreKeyFrame.cpp \
+                         OgreLight.cpp \
+                         OgreLog.cpp \
+                         OgreLogManager.cpp \
+			 OgreManualObject.cpp \
+                         OgreMaterial.cpp \
+                         OgreMaterialManager.cpp \
+                         OgreMaterialSerializer.cpp \
+                         OgreMaterialScriptCompiler.cpp \
+                         OgreMath.cpp \
+                         OgreMatrix3.cpp \
+                         OgreMatrix4.cpp \
+                         OgreMemoryManager.cpp \
+                         OgreMesh.cpp \
+                         OgreMeshManager.cpp \
+                         OgreMeshSerializer.cpp \
+			 OgreMeshSerializerImpl.cpp \
+                         OgreMovableObject.cpp \
+			 OgreMovablePlane.cpp \
+                         OgreNode.cpp \
+						 OgreNumerics.cpp \
+                         OgreOptimisedUtil.cpp \
+                         OgreOptimisedUtilGeneral.cpp \
+                         OgreOverlay.cpp \
+                         OgreOverlayContainer.cpp \
+			 OgreOverlayElement.cpp \
+                         OgreOverlayElementCommands.cpp \
+                         OgreOverlayManager.cpp \
+                         OgrePixelFormat.cpp \
+                         OgrePanelOverlayElement.cpp \
+                         OgreParticle.cpp \
+                         OgreParticleEmitter.cpp \
+                         OgreParticleEmitterCommands.cpp \
+                         OgreParticleIterator.cpp \
+                         OgreParticleSystem.cpp \
+                         OgreParticleSystemManager.cpp \
+                         OgrePass.cpp \
+			 OgrePatchMesh.cpp \
+                         OgrePatchSurface.cpp \
+                         OgrePlane.cpp \
+                         OgrePlatformInformation.cpp \
+						 OgrePolygon.cpp \
+			 OgrePose.cpp \
+                         OgrePredefinedControllers.cpp \
+						 OgrePrefabFactory.cpp \
+			 OgreProfiler.cpp \
+                         OgreProgressiveMesh.cpp \
+                         OgreQuaternion.cpp \
+			 OgreRectangle2D.cpp \
+                         OgreRenderQueue.cpp \
+			 OgreRenderQueueInvocation.cpp \
+			 OgreRenderQueueSortingGrouping.cpp \
+                         OgreRenderSystem.cpp \
+                         OgreRenderSystemCapabilities.cpp \
+                         OgreRenderTarget.cpp \
+                         OgreRenderTexture.cpp \
+                         OgreRenderWindow.cpp \
+                         OgreResource.cpp \
+                         OgreResourceBackgroundQueue.cpp \
+                         OgreResourceGroupManager.cpp \
+                         OgreResourceManager.cpp \
+			 OgreRibbonTrail.cpp \
+                         OgreRoot.cpp \
+                         OgreRotationSpline.cpp \
+                         OgreSceneManager.cpp \
+                         OgreSceneManagerEnumerator.cpp \
+                         OgreSceneNode.cpp \
+                         OgreSceneQuery.cpp \
+                         OgreSearchOps.cpp \
+                         OgreSerializer.cpp \
+						 OgreShadowCameraSetup.cpp \
+						 OgreShadowCameraSetupFocused.cpp \
+						 OgreShadowCameraSetupLiSPSM.cpp \
+						 OgreShadowCameraSetupPlaneOptimal.cpp \
+			 OgreShadowCaster.cpp \
+			 OgreShadowTextureManager.cpp \
+			 OgreShadowVolumeExtrudeProgram.cpp \
+                         OgreSimpleRenderable.cpp \
+                         OgreSimpleSpline.cpp \
+                         OgreSkeleton.cpp \
+                         OgreSkeletonInstance.cpp \
+                         OgreSkeletonManager.cpp \
+                         OgreSkeletonSerializer.cpp \
+			 OgreStaticGeometry.cpp \
+                         OgreString.cpp \
+                         OgreStringConverter.cpp \
+                         OgreStringInterface.cpp \
+                         OgreSubEntity.cpp \
+                         OgreSubMesh.cpp \
+                         OgreTagPoint.cpp \
+                         OgreTechnique.cpp \
+                         OgreTextAreaOverlayElement.cpp \
+                         OgreTexture.cpp \
+                         OgreTextureManager.cpp \
+                         OgreTextureUnitState.cpp \
+						 OgreUnifiedHighLevelGpuProgram.cpp \
+                         OgreUserDefinedObject.cpp \
+                         OgreVector2.cpp \
+                         OgreVector3.cpp \
+                         OgreVector4.cpp \
+                         OgreVertexIndexData.cpp \
+                         OgreViewport.cpp \
+                         OgreWireBoundingBox.cpp \
+                         OgreZip.cpp \
+                         OgreCompositionPass.cpp \
+                         OgreCompositionTargetPass.cpp \
+                         OgreCompositionTechnique.cpp \
+                         OgreCompositor.cpp \
+                         OgreCompositorChain.cpp \
+                         OgreCompositorInstance.cpp \
+                         OgreCompositorManager.cpp \
+                         OgreCompositorSerializer.cpp \
+                         OgreCompositorScriptCompiler.cpp \
+                         OgreCompiler2Pass.cpp \
+                         $(OGRE_PLATFORM)/OgreTimer.cpp \
+                         $(OGRE_GUI)/OgreConfigDialog.cpp \
+                         $(OGRE_GUI)/OgreErrorDialog.cpp \
+                         OgreWindowEventUtilities.cpp
+
+if USE_FREEIMAGE
+libOgreMain_la_SOURCES += OgreFreeImageCodec.cpp
+
+endif
+
+if USE_DEVIL
+libOgreMain_la_SOURCES +=OgreILImageCodec.cpp \
+                         OgreILCodecs.cpp \
+                         OgreILUtil.cpp
+endif
+
+platformdir = $(libdir)
+libOgreMain_la_LIBADD= $(STLPORT_LIBS) $(FT2_LIBS) $(ZZIPLIB_LIBS) $(GTK_LIBS) $(OGRE_THREAD_LIBS) $(PLATFORM_LIBS)
+libOgreMain_la_LDFLAGS = $(SHARED_FLAGS) -release @PACKAGE_VERSION@ -Wl,-rpath,$(platformdir)
+#-version-info @OGREMAIN_VERSION_INFO@ -Wl,-rpath,$(platformdir)
+#-Wl,--version-script=$(top_srcdir)/OgreMain/src/ogremain.map
+
+if OGRE_BUILD_SSE
+libOgreMain_la_LIBADD += libSSEsupport.la
+endif
Index: /OgreMain/src/Makefile.in
===================================================================
--- /OgreMain/src/Makefile.in	(revision 5)
+++ /OgreMain/src/Makefile.in	(revision 5)
@@ -0,0 +1,970 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+@USE_FREEIMAGE_TRUE@am__append_1 = OgreFreeImageCodec.cpp
+@USE_DEVIL_TRUE@am__append_2 = OgreILImageCodec.cpp \
+@USE_DEVIL_TRUE@                         OgreILCodecs.cpp \
+@USE_DEVIL_TRUE@                         OgreILUtil.cpp
+
+#-version-info @OGREMAIN_VERSION_INFO@ -Wl,-rpath,$(platformdir)
+#-Wl,--version-script=$(top_srcdir)/OgreMain/src/ogremain.map
+@OGRE_BUILD_SSE_TRUE@am__append_3 = libSSEsupport.la
+subdir = OgreMain/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libdir)"
+libLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(lib_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+@OGRE_BUILD_SSE_TRUE@am__DEPENDENCIES_2 = libSSEsupport.la
+libOgreMain_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
+am__libOgreMain_la_SOURCES_DIST = OgreAlignedAllocator.cpp \
+	OgreAnimation.cpp OgreAnimable.cpp OgreAnimationState.cpp \
+	OgreAnimationTrack.cpp OgreArchiveManager.cpp \
+	OgreAutoParamDataSource.cpp OgreBillboard.cpp \
+	OgreBillboardChain.cpp OgreBillboardParticleRenderer.cpp \
+	OgreBillboardSet.cpp OgreBone.cpp \
+	OgreBorderPanelOverlayElement.cpp OgreCamera.cpp OgreCodec.cpp \
+	OgreColourValue.cpp OgreCommon.cpp OgreConfigFile.cpp \
+	OgreControllerManager.cpp OgreConvexBody.cpp \
+	OgreDataStream.cpp OgreDDSCodec.cpp \
+	OgreDefaultHardwareBufferManager.cpp \
+	OgreDefaultSceneQueries.cpp OgreDynLib.cpp \
+	OgreDynLibManager.cpp OgreEdgeListBuilder.cpp OgreEntity.cpp \
+	OgreException.cpp OgreExternalTextureSource.cpp \
+	OgreExternalTextureSourceManager.cpp OgreFileSystem.cpp \
+	OgreFont.cpp OgreFontManager.cpp OgreFrustum.cpp \
+	OgreGpuProgram.cpp OgreGpuProgramManager.cpp \
+	OgreGpuProgramUsage.cpp OgreHardwareBufferManager.cpp \
+	OgreHardwareIndexBuffer.cpp OgreHardwareOcclusionQuery.cpp \
+	OgreHardwareVertexBuffer.cpp OgreHardwarePixelBuffer.cpp \
+	OgreHighLevelGpuProgram.cpp OgreHighLevelGpuProgramManager.cpp \
+	OgreImage.cpp OgreInstancedGeometry.cpp OgreKeyFrame.cpp \
+	OgreLight.cpp OgreLog.cpp OgreLogManager.cpp \
+	OgreManualObject.cpp OgreMaterial.cpp OgreMaterialManager.cpp \
+	OgreMaterialSerializer.cpp OgreMaterialScriptCompiler.cpp \
+	OgreMath.cpp OgreMatrix3.cpp OgreMatrix4.cpp \
+	OgreMemoryManager.cpp OgreMesh.cpp OgreMeshManager.cpp \
+	OgreMeshSerializer.cpp OgreMeshSerializerImpl.cpp \
+	OgreMovableObject.cpp OgreMovablePlane.cpp OgreNode.cpp \
+	OgreNumerics.cpp OgreOptimisedUtil.cpp \
+	OgreOptimisedUtilGeneral.cpp OgreOverlay.cpp \
+	OgreOverlayContainer.cpp OgreOverlayElement.cpp \
+	OgreOverlayElementCommands.cpp OgreOverlayManager.cpp \
+	OgrePixelFormat.cpp OgrePanelOverlayElement.cpp \
+	OgreParticle.cpp OgreParticleEmitter.cpp \
+	OgreParticleEmitterCommands.cpp OgreParticleIterator.cpp \
+	OgreParticleSystem.cpp OgreParticleSystemManager.cpp \
+	OgrePass.cpp OgrePatchMesh.cpp OgrePatchSurface.cpp \
+	OgrePlane.cpp OgrePlatformInformation.cpp OgrePolygon.cpp \
+	OgrePose.cpp OgrePredefinedControllers.cpp \
+	OgrePrefabFactory.cpp OgreProfiler.cpp OgreProgressiveMesh.cpp \
+	OgreQuaternion.cpp OgreRectangle2D.cpp OgreRenderQueue.cpp \
+	OgreRenderQueueInvocation.cpp \
+	OgreRenderQueueSortingGrouping.cpp OgreRenderSystem.cpp \
+	OgreRenderSystemCapabilities.cpp OgreRenderTarget.cpp \
+	OgreRenderTexture.cpp OgreRenderWindow.cpp OgreResource.cpp \
+	OgreResourceBackgroundQueue.cpp OgreResourceGroupManager.cpp \
+	OgreResourceManager.cpp OgreRibbonTrail.cpp OgreRoot.cpp \
+	OgreRotationSpline.cpp OgreSceneManager.cpp \
+	OgreSceneManagerEnumerator.cpp OgreSceneNode.cpp \
+	OgreSceneQuery.cpp OgreSearchOps.cpp OgreSerializer.cpp \
+	OgreShadowCameraSetup.cpp OgreShadowCameraSetupFocused.cpp \
+	OgreShadowCameraSetupLiSPSM.cpp \
+	OgreShadowCameraSetupPlaneOptimal.cpp OgreShadowCaster.cpp \
+	OgreShadowTextureManager.cpp \
+	OgreShadowVolumeExtrudeProgram.cpp OgreSimpleRenderable.cpp \
+	OgreSimpleSpline.cpp OgreSkeleton.cpp OgreSkeletonInstance.cpp \
+	OgreSkeletonManager.cpp OgreSkeletonSerializer.cpp \
+	OgreStaticGeometry.cpp OgreString.cpp OgreStringConverter.cpp \
+	OgreStringInterface.cpp OgreSubEntity.cpp OgreSubMesh.cpp \
+	OgreTagPoint.cpp OgreTechnique.cpp \
+	OgreTextAreaOverlayElement.cpp OgreTexture.cpp \
+	OgreTextureManager.cpp OgreTextureUnitState.cpp \
+	OgreUnifiedHighLevelGpuProgram.cpp OgreUserDefinedObject.cpp \
+	OgreVector2.cpp OgreVector3.cpp OgreVector4.cpp \
+	OgreVertexIndexData.cpp OgreViewport.cpp \
+	OgreWireBoundingBox.cpp OgreZip.cpp OgreCompositionPass.cpp \
+	OgreCompositionTargetPass.cpp OgreCompositionTechnique.cpp \
+	OgreCompositor.cpp OgreCompositorChain.cpp \
+	OgreCompositorInstance.cpp OgreCompositorManager.cpp \
+	OgreCompositorSerializer.cpp OgreCompositorScriptCompiler.cpp \
+	OgreCompiler2Pass.cpp $(OGRE_PLATFORM)/OgreTimer.cpp \
+	$(OGRE_GUI)/OgreConfigDialog.cpp \
+	$(OGRE_GUI)/OgreErrorDialog.cpp OgreWindowEventUtilities.cpp \
+	OgreFreeImageCodec.cpp OgreILImageCodec.cpp OgreILCodecs.cpp \
+	OgreILUtil.cpp
+@USE_FREEIMAGE_TRUE@am__objects_1 = OgreFreeImageCodec.lo
+@USE_DEVIL_TRUE@am__objects_2 = OgreILImageCodec.lo OgreILCodecs.lo \
+@USE_DEVIL_TRUE@	OgreILUtil.lo
+am_libOgreMain_la_OBJECTS = OgreAlignedAllocator.lo OgreAnimation.lo \
+	OgreAnimable.lo OgreAnimationState.lo OgreAnimationTrack.lo \
+	OgreArchiveManager.lo OgreAutoParamDataSource.lo \
+	OgreBillboard.lo OgreBillboardChain.lo \
+	OgreBillboardParticleRenderer.lo OgreBillboardSet.lo \
+	OgreBone.lo OgreBorderPanelOverlayElement.lo OgreCamera.lo \
+	OgreCodec.lo OgreColourValue.lo OgreCommon.lo \
+	OgreConfigFile.lo OgreControllerManager.lo OgreConvexBody.lo \
+	OgreDataStream.lo OgreDDSCodec.lo \
+	OgreDefaultHardwareBufferManager.lo OgreDefaultSceneQueries.lo \
+	OgreDynLib.lo OgreDynLibManager.lo OgreEdgeListBuilder.lo \
+	OgreEntity.lo OgreException.lo OgreExternalTextureSource.lo \
+	OgreExternalTextureSourceManager.lo OgreFileSystem.lo \
+	OgreFont.lo OgreFontManager.lo OgreFrustum.lo \
+	OgreGpuProgram.lo OgreGpuProgramManager.lo \
+	OgreGpuProgramUsage.lo OgreHardwareBufferManager.lo \
+	OgreHardwareIndexBuffer.lo OgreHardwareOcclusionQuery.lo \
+	OgreHardwareVertexBuffer.lo OgreHardwarePixelBuffer.lo \
+	OgreHighLevelGpuProgram.lo OgreHighLevelGpuProgramManager.lo \
+	OgreImage.lo OgreInstancedGeometry.lo OgreKeyFrame.lo \
+	OgreLight.lo OgreLog.lo OgreLogManager.lo OgreManualObject.lo \
+	OgreMaterial.lo OgreMaterialManager.lo \
+	OgreMaterialSerializer.lo OgreMaterialScriptCompiler.lo \
+	OgreMath.lo OgreMatrix3.lo OgreMatrix4.lo OgreMemoryManager.lo \
+	OgreMesh.lo OgreMeshManager.lo OgreMeshSerializer.lo \
+	OgreMeshSerializerImpl.lo OgreMovableObject.lo \
+	OgreMovablePlane.lo OgreNode.lo OgreNumerics.lo \
+	OgreOptimisedUtil.lo OgreOptimisedUtilGeneral.lo \
+	OgreOverlay.lo OgreOverlayContainer.lo OgreOverlayElement.lo \
+	OgreOverlayElementCommands.lo OgreOverlayManager.lo \
+	OgrePixelFormat.lo OgrePanelOverlayElement.lo OgreParticle.lo \
+	OgreParticleEmitter.lo OgreParticleEmitterCommands.lo \
+	OgreParticleIterator.lo OgreParticleSystem.lo \
+	OgreParticleSystemManager.lo OgrePass.lo OgrePatchMesh.lo \
+	OgrePatchSurface.lo OgrePlane.lo OgrePlatformInformation.lo \
+	OgrePolygon.lo OgrePose.lo OgrePredefinedControllers.lo \
+	OgrePrefabFactory.lo OgreProfiler.lo OgreProgressiveMesh.lo \
+	OgreQuaternion.lo OgreRectangle2D.lo OgreRenderQueue.lo \
+	OgreRenderQueueInvocation.lo OgreRenderQueueSortingGrouping.lo \
+	OgreRenderSystem.lo OgreRenderSystemCapabilities.lo \
+	OgreRenderTarget.lo OgreRenderTexture.lo OgreRenderWindow.lo \
+	OgreResource.lo OgreResourceBackgroundQueue.lo \
+	OgreResourceGroupManager.lo OgreResourceManager.lo \
+	OgreRibbonTrail.lo OgreRoot.lo OgreRotationSpline.lo \
+	OgreSceneManager.lo OgreSceneManagerEnumerator.lo \
+	OgreSceneNode.lo OgreSceneQuery.lo OgreSearchOps.lo \
+	OgreSerializer.lo OgreShadowCameraSetup.lo \
+	OgreShadowCameraSetupFocused.lo OgreShadowCameraSetupLiSPSM.lo \
+	OgreShadowCameraSetupPlaneOptimal.lo OgreShadowCaster.lo \
+	OgreShadowTextureManager.lo OgreShadowVolumeExtrudeProgram.lo \
+	OgreSimpleRenderable.lo OgreSimpleSpline.lo OgreSkeleton.lo \
+	OgreSkeletonInstance.lo OgreSkeletonManager.lo \
+	OgreSkeletonSerializer.lo OgreStaticGeometry.lo OgreString.lo \
+	OgreStringConverter.lo OgreStringInterface.lo OgreSubEntity.lo \
+	OgreSubMesh.lo OgreTagPoint.lo OgreTechnique.lo \
+	OgreTextAreaOverlayElement.lo OgreTexture.lo \
+	OgreTextureManager.lo OgreTextureUnitState.lo \
+	OgreUnifiedHighLevelGpuProgram.lo OgreUserDefinedObject.lo \
+	OgreVector2.lo OgreVector3.lo OgreVector4.lo \
+	OgreVertexIndexData.lo OgreViewport.lo OgreWireBoundingBox.lo \
+	OgreZip.lo OgreCompositionPass.lo OgreCompositionTargetPass.lo \
+	OgreCompositionTechnique.lo OgreCompositor.lo \
+	OgreCompositorChain.lo OgreCompositorInstance.lo \
+	OgreCompositorManager.lo OgreCompositorSerializer.lo \
+	OgreCompositorScriptCompiler.lo OgreCompiler2Pass.lo \
+	OgreTimer.lo OgreConfigDialog.lo OgreErrorDialog.lo \
+	OgreWindowEventUtilities.lo $(am__objects_1) $(am__objects_2)
+libOgreMain_la_OBJECTS = $(am_libOgreMain_la_OBJECTS)
+libSSEsupport_la_LIBADD =
+am_libSSEsupport_la_OBJECTS =  \
+	libSSEsupport_la-OgreOptimisedUtilSSE.lo
+libSSEsupport_la_OBJECTS = $(am_libSSEsupport_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libOgreMain_la_SOURCES) $(libSSEsupport_la_SOURCES)
+DIST_SOURCES = $(am__libOgreMain_la_SOURCES_DIST) \
+	$(libSSEsupport_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) $(FT2_CFLAGS) -I$(top_srcdir)/OgreMain/include -DOGRE_NONCLIENT_BUILD $(PLATFORM_CFLAGS) $(ZZIPLIB_CFLAGS) $(DEVIL_CFLAGS) $(FREEIMAGE_CFLAGS) $(GTK_CFLAGS) $(CFLAGS_VISIBILITY)
+EXTRA_LTLIBRARIES = libSSEsupport.la
+libSSEsupport_la_SOURCES = OgreOptimisedUtilSSE.cpp
+libSSEsupport_la_CPPFLAGS = -msse
+lib_LTLIBRARIES = libOgreMain.la
+libOgreMain_la_SOURCES = OgreAlignedAllocator.cpp OgreAnimation.cpp \
+	OgreAnimable.cpp OgreAnimationState.cpp OgreAnimationTrack.cpp \
+	OgreArchiveManager.cpp OgreAutoParamDataSource.cpp \
+	OgreBillboard.cpp OgreBillboardChain.cpp \
+	OgreBillboardParticleRenderer.cpp OgreBillboardSet.cpp \
+	OgreBone.cpp OgreBorderPanelOverlayElement.cpp OgreCamera.cpp \
+	OgreCodec.cpp OgreColourValue.cpp OgreCommon.cpp \
+	OgreConfigFile.cpp OgreControllerManager.cpp \
+	OgreConvexBody.cpp OgreDataStream.cpp OgreDDSCodec.cpp \
+	OgreDefaultHardwareBufferManager.cpp \
+	OgreDefaultSceneQueries.cpp OgreDynLib.cpp \
+	OgreDynLibManager.cpp OgreEdgeListBuilder.cpp OgreEntity.cpp \
+	OgreException.cpp OgreExternalTextureSource.cpp \
+	OgreExternalTextureSourceManager.cpp OgreFileSystem.cpp \
+	OgreFont.cpp OgreFontManager.cpp OgreFrustum.cpp \
+	OgreGpuProgram.cpp OgreGpuProgramManager.cpp \
+	OgreGpuProgramUsage.cpp OgreHardwareBufferManager.cpp \
+	OgreHardwareIndexBuffer.cpp OgreHardwareOcclusionQuery.cpp \
+	OgreHardwareVertexBuffer.cpp OgreHardwarePixelBuffer.cpp \
+	OgreHighLevelGpuProgram.cpp OgreHighLevelGpuProgramManager.cpp \
+	OgreImage.cpp OgreInstancedGeometry.cpp OgreKeyFrame.cpp \
+	OgreLight.cpp OgreLog.cpp OgreLogManager.cpp \
+	OgreManualObject.cpp OgreMaterial.cpp OgreMaterialManager.cpp \
+	OgreMaterialSerializer.cpp OgreMaterialScriptCompiler.cpp \
+	OgreMath.cpp OgreMatrix3.cpp OgreMatrix4.cpp \
+	OgreMemoryManager.cpp OgreMesh.cpp OgreMeshManager.cpp \
+	OgreMeshSerializer.cpp OgreMeshSerializerImpl.cpp \
+	OgreMovableObject.cpp OgreMovablePlane.cpp OgreNode.cpp \
+	OgreNumerics.cpp OgreOptimisedUtil.cpp \
+	OgreOptimisedUtilGeneral.cpp OgreOverlay.cpp \
+	OgreOverlayContainer.cpp OgreOverlayElement.cpp \
+	OgreOverlayElementCommands.cpp OgreOverlayManager.cpp \
+	OgrePixelFormat.cpp OgrePanelOverlayElement.cpp \
+	OgreParticle.cpp OgreParticleEmitter.cpp \
+	OgreParticleEmitterCommands.cpp OgreParticleIterator.cpp \
+	OgreParticleSystem.cpp OgreParticleSystemManager.cpp \
+	OgrePass.cpp OgrePatchMesh.cpp OgrePatchSurface.cpp \
+	OgrePlane.cpp OgrePlatformInformation.cpp OgrePolygon.cpp \
+	OgrePose.cpp OgrePredefinedControllers.cpp \
+	OgrePrefabFactory.cpp OgreProfiler.cpp OgreProgressiveMesh.cpp \
+	OgreQuaternion.cpp OgreRectangle2D.cpp OgreRenderQueue.cpp \
+	OgreRenderQueueInvocation.cpp \
+	OgreRenderQueueSortingGrouping.cpp OgreRenderSystem.cpp \
+	OgreRenderSystemCapabilities.cpp OgreRenderTarget.cpp \
+	OgreRenderTexture.cpp OgreRenderWindow.cpp OgreResource.cpp \
+	OgreResourceBackgroundQueue.cpp OgreResourceGroupManager.cpp \
+	OgreResourceManager.cpp OgreRibbonTrail.cpp OgreRoot.cpp \
+	OgreRotationSpline.cpp OgreSceneManager.cpp \
+	OgreSceneManagerEnumerator.cpp OgreSceneNode.cpp \
+	OgreSceneQuery.cpp OgreSearchOps.cpp OgreSerializer.cpp \
+	OgreShadowCameraSetup.cpp OgreShadowCameraSetupFocused.cpp \
+	OgreShadowCameraSetupLiSPSM.cpp \
+	OgreShadowCameraSetupPlaneOptimal.cpp OgreShadowCaster.cpp \
+	OgreShadowTextureManager.cpp \
+	OgreShadowVolumeExtrudeProgram.cpp OgreSimpleRenderable.cpp \
+	OgreSimpleSpline.cpp OgreSkeleton.cpp OgreSkeletonInstance.cpp \
+	OgreSkeletonManager.cpp OgreSkeletonSerializer.cpp \
+	OgreStaticGeometry.cpp OgreString.cpp OgreStringConverter.cpp \
+	OgreStringInterface.cpp OgreSubEntity.cpp OgreSubMesh.cpp \
+	OgreTagPoint.cpp OgreTechnique.cpp \
+	OgreTextAreaOverlayElement.cpp OgreTexture.cpp \
+	OgreTextureManager.cpp OgreTextureUnitState.cpp \
+	OgreUnifiedHighLevelGpuProgram.cpp OgreUserDefinedObject.cpp \
+	OgreVector2.cpp OgreVector3.cpp OgreVector4.cpp \
+	OgreVertexIndexData.cpp OgreViewport.cpp \
+	OgreWireBoundingBox.cpp OgreZip.cpp OgreCompositionPass.cpp \
+	OgreCompositionTargetPass.cpp OgreCompositionTechnique.cpp \
+	OgreCompositor.cpp OgreCompositorChain.cpp \
+	OgreCompositorInstance.cpp OgreCompositorManager.cpp \
+	OgreCompositorSerializer.cpp OgreCompositorScriptCompiler.cpp \
+	OgreCompiler2Pass.cpp $(OGRE_PLATFORM)/OgreTimer.cpp \
+	$(OGRE_GUI)/OgreConfigDialog.cpp \
+	$(OGRE_GUI)/OgreErrorDialog.cpp OgreWindowEventUtilities.cpp \
+	$(am__append_1) $(am__append_2)
+platformdir = $(libdir)
+libOgreMain_la_LIBADD = $(STLPORT_LIBS) $(FT2_LIBS) $(ZZIPLIB_LIBS) \
+	$(GTK_LIBS) $(OGRE_THREAD_LIBS) $(PLATFORM_LIBS) \
+	$(am__append_3)
+libOgreMain_la_LDFLAGS = $(SHARED_FLAGS) -release @PACKAGE_VERSION@ -Wl,-rpath,$(platformdir)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  OgreMain/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  OgreMain/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    f=$(am__strip_dir) \
+	    echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+	    $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  p=$(am__strip_dir) \
+	  echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+	  $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+	done
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libOgreMain.la: $(libOgreMain_la_OBJECTS) $(libOgreMain_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(libdir) $(libOgreMain_la_LDFLAGS) $(libOgreMain_la_OBJECTS) $(libOgreMain_la_LIBADD) $(LIBS)
+libSSEsupport.la: $(libSSEsupport_la_OBJECTS) $(libSSEsupport_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libSSEsupport_la_LDFLAGS) $(libSSEsupport_la_OBJECTS) $(libSSEsupport_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreAlignedAllocator.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreAnimable.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreAnimation.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreAnimationState.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreAnimationTrack.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreArchiveManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreAutoParamDataSource.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreBillboard.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreBillboardChain.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreBillboardParticleRenderer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreBillboardSet.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreBone.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreBorderPanelOverlayElement.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCamera.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCodec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreColourValue.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCommon.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCompiler2Pass.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCompositionPass.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCompositionTargetPass.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCompositionTechnique.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCompositor.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCompositorChain.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCompositorInstance.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCompositorManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCompositorScriptCompiler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCompositorSerializer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreConfigDialog.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreConfigFile.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreControllerManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreConvexBody.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreDDSCodec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreDataStream.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreDefaultHardwareBufferManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreDefaultSceneQueries.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreDynLib.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreDynLibManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreEdgeListBuilder.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreEntity.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreErrorDialog.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreException.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreExternalTextureSource.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreExternalTextureSourceManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreFileSystem.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreFont.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreFontManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreFreeImageCodec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreFrustum.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGpuProgram.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGpuProgramManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGpuProgramUsage.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreHardwareBufferManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreHardwareIndexBuffer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreHardwareOcclusionQuery.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreHardwarePixelBuffer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreHardwareVertexBuffer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreHighLevelGpuProgram.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreHighLevelGpuProgramManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreILCodecs.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreILImageCodec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreILUtil.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreImage.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreInstancedGeometry.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreKeyFrame.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreLight.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreLog.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreLogManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreManualObject.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreMaterial.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreMaterialManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreMaterialScriptCompiler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreMaterialSerializer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreMath.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreMatrix3.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreMatrix4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreMemoryManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreMesh.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreMeshManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreMeshSerializer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreMeshSerializerImpl.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreMovableObject.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreMovablePlane.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreNode.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreNumerics.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreOptimisedUtil.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreOptimisedUtilGeneral.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreOverlay.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreOverlayContainer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreOverlayElement.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreOverlayElementCommands.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreOverlayManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgrePanelOverlayElement.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreParticle.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreParticleEmitter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreParticleEmitterCommands.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreParticleIterator.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreParticleSystem.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreParticleSystemManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgrePass.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgrePatchMesh.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgrePatchSurface.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgrePixelFormat.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgrePlane.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgrePlatformInformation.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgrePolygon.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgrePose.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgrePredefinedControllers.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgrePrefabFactory.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreProfiler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreProgressiveMesh.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreQuaternion.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRectangle2D.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRenderQueue.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRenderQueueInvocation.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRenderQueueSortingGrouping.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRenderSystem.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRenderSystemCapabilities.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRenderTarget.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRenderTexture.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRenderWindow.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreResource.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreResourceBackgroundQueue.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreResourceGroupManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreResourceManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRibbonTrail.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRoot.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRotationSpline.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreSceneManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreSceneManagerEnumerator.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreSceneNode.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreSceneQuery.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreSearchOps.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreSerializer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreShadowCameraSetup.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreShadowCameraSetupFocused.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreShadowCameraSetupLiSPSM.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreShadowCameraSetupPlaneOptimal.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreShadowCaster.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreShadowTextureManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreShadowVolumeExtrudeProgram.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreSimpleRenderable.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreSimpleSpline.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreSkeleton.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreSkeletonInstance.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreSkeletonManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreSkeletonSerializer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreStaticGeometry.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreString.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreStringConverter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreStringInterface.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreSubEntity.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreSubMesh.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreTagPoint.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreTechnique.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreTextAreaOverlayElement.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreTexture.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreTextureManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreTextureUnitState.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreTimer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreUnifiedHighLevelGpuProgram.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreUserDefinedObject.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreVector2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreVector3.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreVector4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreVertexIndexData.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreViewport.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreWindowEventUtilities.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreWireBoundingBox.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreZip.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSSEsupport_la-OgreOptimisedUtilSSE.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+OgreTimer.lo: $(OGRE_PLATFORM)/OgreTimer.cpp
+@am__fastdepCXX_TRUE@	if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OgreTimer.lo -MD -MP -MF "$(DEPDIR)/OgreTimer.Tpo" -c -o OgreTimer.lo `test -f '$(OGRE_PLATFORM)/OgreTimer.cpp' || echo '$(srcdir)/'`$(OGRE_PLATFORM)/OgreTimer.cpp; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/OgreTimer.Tpo" "$(DEPDIR)/OgreTimer.Plo"; else rm -f "$(DEPDIR)/OgreTimer.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(OGRE_PLATFORM)/OgreTimer.cpp' object='OgreTimer.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OgreTimer.lo `test -f '$(OGRE_PLATFORM)/OgreTimer.cpp' || echo '$(srcdir)/'`$(OGRE_PLATFORM)/OgreTimer.cpp
+
+OgreConfigDialog.lo: $(OGRE_GUI)/OgreConfigDialog.cpp
+@am__fastdepCXX_TRUE@	if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OgreConfigDialog.lo -MD -MP -MF "$(DEPDIR)/OgreConfigDialog.Tpo" -c -o OgreConfigDialog.lo `test -f '$(OGRE_GUI)/OgreConfigDialog.cpp' || echo '$(srcdir)/'`$(OGRE_GUI)/OgreConfigDialog.cpp; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/OgreConfigDialog.Tpo" "$(DEPDIR)/OgreConfigDialog.Plo"; else rm -f "$(DEPDIR)/OgreConfigDialog.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(OGRE_GUI)/OgreConfigDialog.cpp' object='OgreConfigDialog.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OgreConfigDialog.lo `test -f '$(OGRE_GUI)/OgreConfigDialog.cpp' || echo '$(srcdir)/'`$(OGRE_GUI)/OgreConfigDialog.cpp
+
+OgreErrorDialog.lo: $(OGRE_GUI)/OgreErrorDialog.cpp
+@am__fastdepCXX_TRUE@	if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OgreErrorDialog.lo -MD -MP -MF "$(DEPDIR)/OgreErrorDialog.Tpo" -c -o OgreErrorDialog.lo `test -f '$(OGRE_GUI)/OgreErrorDialog.cpp' || echo '$(srcdir)/'`$(OGRE_GUI)/OgreErrorDialog.cpp; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/OgreErrorDialog.Tpo" "$(DEPDIR)/OgreErrorDialog.Plo"; else rm -f "$(DEPDIR)/OgreErrorDialog.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(OGRE_GUI)/OgreErrorDialog.cpp' object='OgreErrorDialog.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OgreErrorDialog.lo `test -f '$(OGRE_GUI)/OgreErrorDialog.cpp' || echo '$(srcdir)/'`$(OGRE_GUI)/OgreErrorDialog.cpp
+
+libSSEsupport_la-OgreOptimisedUtilSSE.lo: OgreOptimisedUtilSSE.cpp
+@am__fastdepCXX_TRUE@	if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libSSEsupport_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libSSEsupport_la-OgreOptimisedUtilSSE.lo -MD -MP -MF "$(DEPDIR)/libSSEsupport_la-OgreOptimisedUtilSSE.Tpo" -c -o libSSEsupport_la-OgreOptimisedUtilSSE.lo `test -f 'OgreOptimisedUtilSSE.cpp' || echo '$(srcdir)/'`OgreOptimisedUtilSSE.cpp; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/libSSEsupport_la-OgreOptimisedUtilSSE.Tpo" "$(DEPDIR)/libSSEsupport_la-OgreOptimisedUtilSSE.Plo"; else rm -f "$(DEPDIR)/libSSEsupport_la-OgreOptimisedUtilSSE.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='OgreOptimisedUtilSSE.cpp' object='libSSEsupport_la-OgreOptimisedUtilSSE.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libSSEsupport_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libSSEsupport_la-OgreOptimisedUtilSSE.lo `test -f 'OgreOptimisedUtilSSE.cpp' || echo '$(srcdir)/'`OgreOptimisedUtilSSE.cpp
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(libdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-libLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libLTLIBRARIES clean-libtool ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am \
+	install-libLTLIBRARIES install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-libLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /OgreMain/src/OSX/OgreConfigDialog.cpp
===================================================================
--- /OgreMain/src/OSX/OgreConfigDialog.cpp	(revision 5)
+++ /OgreMain/src/OSX/OgreConfigDialog.cpp	(revision 5)
@@ -0,0 +1,363 @@
+#include <Quicktime/Quicktime.h>
+#include "OgreLogManager.h"
+#include "OgreConfigDialog.h"
+
+namespace Ogre {
+
+	ConfigDialog* dlg = NULL;
+	static EventHandlerUPP WindowEventHandlerUPP;
+
+	ConfigDialog::ConfigDialog() : iSelectedRenderSystem( NULL ), iVideoModeRef( NULL ), iLogoViewRef( NULL ), iWindowRef( NULL ), iNibRef( NULL ), iMenuRef( NULL )
+	{
+		dlg = this;
+	}
+	
+	ConfigDialog::~ConfigDialog()
+	{
+	}
+	
+	void ConfigDialog::initialise()
+	{
+		RenderSystemList* renderers = Root::getSingleton().getAvailableRenderers();
+		RenderSystem* renderer = renderers->front();
+		ConfigOptionMap config = renderer->getConfigOptions();
+
+		ConfigOptionMap::iterator cfi;
+		
+		cfi = config.find( "Full Screen" );
+		if( cfi != config.end() )
+		{
+			if( cfi->second.currentValue == "Yes" )
+			{
+				SetControlValue( iFullScreenRef, 1 );
+			}
+			else
+			{
+				SetControlValue( iFullScreenRef, 2 );
+			}
+		}
+
+		cfi = config.find( "FSAA" );
+		if( cfi != config.end() )
+		{
+			if( cfi->second.currentValue == "0" )
+			{
+				SetControlValue( iFSAARef, 1 );
+			}
+			else if( cfi->second.currentValue == "2" )
+			{
+				SetControlValue( iFSAARef, 2 );
+			}
+			else if( cfi->second.currentValue == "4" )
+			{
+				SetControlValue( iFSAARef, 3 );
+			}
+			else if( cfi->second.currentValue == "6" )
+			{
+				SetControlValue( iFSAARef, 4 );
+			}
+		}
+
+		cfi = config.find( "Colour Depth" );
+		if( cfi != config.end() )
+		{
+			if( cfi->second.currentValue == "32" )
+			{
+				SetControlValue( iColorDepthRef, 1 );
+			}
+			else
+			{
+				SetControlValue( iColorDepthRef, 2 );
+			}
+		}
+		
+		cfi = config.find( "RTT Preferred Mode" );
+		if( cfi != config.end() )
+		{
+			if( cfi->second.currentValue == "FBO" )
+			{
+				SetControlValue( iRTTPrefModeRef, 1 );
+			}
+			else if( cfi->second.currentValue == "PBuffer" )
+			{
+				SetControlValue( iRTTPrefModeRef, 2 );
+			}
+			else if( cfi->second.currentValue == "Copy" )
+			{
+				SetControlValue( iRTTPrefModeRef, 3 );
+			}
+		}
+	}
+	
+	void ConfigDialog::run()
+	{
+		RenderSystemList* renderers = Root::getSingleton().getAvailableRenderers();
+		RenderSystem* renderer = renderers->front();
+
+		SInt16 value = 0;
+
+		// temp
+		value = GetControlValue( iVideoModeRef );
+		renderer->setConfigOption( "Video Mode", "800 x 600" );
+
+		// full screen
+		value = GetControlValue( iFullScreenRef );
+		if( value == 1 ) // Yes
+		{
+			LogManager::getSingleton().logMessage( "CONFIG => FullScreen [ Yes ]" );
+			renderer->setConfigOption( "Full Screen", "Yes" );
+		}
+		else
+		{
+			LogManager::getSingleton().logMessage( "CONFIG => FullScreen [ No ]" );
+			renderer->setConfigOption( "Full Screen", "No" );
+		}
+		
+		// fsaa
+		value = GetControlValue( iFSAARef );
+		switch( value )
+		{
+			case 1:
+				renderer->setConfigOption( "FSAA", "0" );
+				break;
+			case 2:
+				renderer->setConfigOption( "FSAA", "2" );
+				break;
+			case 3:
+				renderer->setConfigOption( "FSAA", "4" );
+				break;
+			case 4:
+				LogManager::getSingleton().logMessage( "CONFIG => FSAA [ 6 ]" );
+				renderer->setConfigOption( "FSAA", "6" );
+				break;
+			default:
+				renderer->setConfigOption( "FSAA", "0" );
+				break;
+		}
+
+		// fsaa
+		value = GetControlValue( iColorDepthRef );
+		if( value == 1 )
+		{
+			renderer->setConfigOption( "Colour Depth", "32" );
+		}
+		else
+		{
+			renderer->setConfigOption( "Colour Depth", "16" );
+		}
+
+		// rtt pref mode
+		value = GetControlValue( iRTTPrefModeRef );
+		switch( value )
+		{
+			case 1:
+				renderer->setConfigOption( "RTT Preferred Mode", "FBO" );
+				break;
+			case 2:
+				renderer->setConfigOption( "RTT Preferred Mode", "PBuffer" );
+				break;
+			case 3:
+				renderer->setConfigOption( "RTT Preferred Mode", "Copy" );
+				break;
+		}
+
+		Root::getSingleton().setRenderSystem( renderer );
+
+		iDisplayStatus = true;
+
+		QuitAppModalLoopForWindow( iWindowRef );
+	}
+	
+	void ConfigDialog::cancel()
+	{
+		iDisplayStatus = false;
+		QuitAppModalLoopForWindow( iWindowRef );
+	}
+	
+	pascal OSStatus ConfigDialog::windowEventHandler( EventHandlerCallRef aNextHandler, EventRef aEvent, void* aUserData )
+	{
+		#pragma unused ( inCallRef )
+		OSStatus status	= eventNotHandledErr;
+		UInt32 eventKind = GetEventKind( aEvent );
+		UInt32 eventClass = GetEventClass( aEvent );
+		WindowRef window = ( WindowRef ) aUserData;
+		HICommand command;
+		if( eventClass == kEventClassWindow && eventKind == kEventWindowClose )
+		{
+			QuitAppModalLoopForWindow( window );
+		}
+		else if( eventClass == kEventClassCommand && eventKind == kEventCommandProcess )
+		{
+			GetEventParameter( aEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof( HICommand ), NULL, &command );
+			switch( command.commandID )
+			{
+				case 'run!':
+					{
+					dlg->run();
+					break;
+					}
+				case 'not!':
+					{
+					dlg->cancel();
+					break;
+					}
+				default:
+					break;
+			}
+		}
+		return ( status );
+	}
+
+	bool ConfigDialog::display()
+	{
+		// TODO: Fix OS X Config dialog
+		RenderSystemList* renderers = Root::getSingleton().getAvailableRenderers();
+		RenderSystem* renderer = renderers->front();
+
+		// WARNING: restoreConfig() should not be invoked here as Root calls
+		// it before this method anyway, and invoking restoreConfig() here
+		// forces the client application to use Ogre.cfg, while it may have
+		// different plans.
+		if(!Root::getSingleton().restoreConfig())
+		{
+			// Set some defaults
+			renderer->setConfigOption("Video Mode", "800 x 600");
+			renderer->setConfigOption("Colour Depth", "32");
+			renderer->setConfigOption("FSAA", "0");
+			renderer->setConfigOption("Full Screen", "No");
+			renderer->setConfigOption("RTT Preferred Mode", "PBuffer");
+			// Set the rendersystem and save the config.
+			Root::getSingleton().setRenderSystem(renderer);
+		}
+		return true;
+	/*
+		iDisplayStatus = false;
+		OSStatus status;
+		CFStringRef logoRef = NULL;
+		CFURLRef logoUrlRef = NULL;
+		OSType dataRefType;
+		GraphicsImportComponent	ci = NULL;
+		CGImageRef cgImageRef = NULL;
+		Handle dataRef = NULL;
+
+		HIViewID logoViewID = { 'CONF', 100 };
+		HIViewID videoModeViewID = { 'CONF', 104 };
+		HIViewID colorDepthViewID = { 'CONF', 105 };
+		HIViewID fsaaViewID = { 'CONF', 106 };
+		HIViewID rttPrefModeViewID = { 'CONF', 107 };
+		HIViewID fullScreenViewID = { 'CONF', 108 };
+
+		const EventTypeSpec windowEvents[] =
+		{
+			{ kEventClassCommand, kEventCommandProcess },
+			{ kEventClassWindow, kEventWindowClose }
+		};
+
+		// We need to get the Ogre Bundle
+		CFBundleRef baseBundle = CFBundleGetBundleWithIdentifier(CFSTR("org.ogre3d.Ogre"));
+		status	= CreateNibReferenceWithCFBundle(baseBundle, CFSTR("main"), &iNibRef );
+		require_noerr( status, CantGetNibRef );
+
+		status	= CreateWindowFromNib( iNibRef, CFSTR( "ConfigWindow" ), &iWindowRef );
+		require_noerr( status, CantCreateWindow );
+
+		if( WindowEventHandlerUPP == NULL )
+			WindowEventHandlerUPP = NewEventHandlerUPP( windowEventHandler );
+
+		status = InstallWindowEventHandler( iWindowRef, WindowEventHandlerUPP, GetEventTypeCount( windowEvents ), windowEvents, iWindowRef, NULL );
+		//status = InstallStandardEventHandler(GetWindowEventTarget(iWindowRef));
+		require_noerr( status, CantInstallWindowEventHandler );
+
+		//logoRef = CFStringCreateWithCString( kCFAllocatorDefault, "file:///Users/aljen/Code/OSXConfig/logo.bmp", NULL );
+		//logoUrlRef = CFURLCreateWithString( kCFAllocatorDefault, logoRef, NULL );
+
+		//status = QTNewDataReferenceFromCFURL( logoUrlRef, 0, &dataRef, &dataRefType );
+		//status	= GetGraphicsImporterForDataRef( dataRef, dataRefType, &ci );
+		//require( ci != NULL, ImporterError );
+		//status	= GraphicsImportCreateCGImage( ci, &cgImageRef, kGraphicsImportCreateCGImageUsingCurrentSettings );
+		
+		// logo view
+		status	= HIViewFindByID( HIViewGetRoot( iWindowRef ), logoViewID, &iLogoViewRef );
+		require_noerr( status, LogoViewNotFound );
+		status	= HIImageViewSetImage( iLogoViewRef, cgImageRef );
+		require_noerr( status, SetImageFailed );
+		status	= HIImageViewSetScaleToFit( iLogoViewRef, false );
+		require_noerr( status, ScaleFailed );
+		status	= HIViewSetVisible( iLogoViewRef, true );
+		require_noerr( status, SetVisibleFailed );
+		
+		// video mode view
+		status	= HIViewFindByID( HIViewGetRoot( iWindowRef ), videoModeViewID, &iVideoModeRef );
+
+		CreateNewMenu( iMenuID, 0, &iMenuRef );
+
+		if( iMenuRef != NULL )
+		{
+			CFStringRef itemNames[] =
+			{
+				CFSTR( "640 x 480" ),
+				CFSTR( "800 x 600" ),
+				CFSTR( "1024 x 768" )
+			};
+
+			MenuItemIndex numItems = ( sizeof( itemNames ) / sizeof( CFStringRef ) );
+			for( int i = 0; i < numItems; i++ )
+			{
+				MenuItemIndex newItem;
+				AppendMenuItemTextWithCFString( iMenuRef, itemNames[ i ], 0, 0, &newItem );
+			}
+			
+			SetControlData( iVideoModeRef, kControlEntireControl, kControlPopupButtonMenuRefTag, sizeof( MenuRef ), &iMenuRef );
+		}
+
+		// color depth view
+		status = HIViewFindByID( HIViewGetRoot( iWindowRef ), colorDepthViewID, &iColorDepthRef );
+
+		// fsaa view
+		status = HIViewFindByID( HIViewGetRoot( iWindowRef ), fsaaViewID, &iFSAARef );
+
+		// rtt pref mode view
+		status = HIViewFindByID( HIViewGetRoot( iWindowRef ), rttPrefModeViewID, &iRTTPrefModeRef );
+
+		// full screen view
+		status = HIViewFindByID( HIViewGetRoot( iWindowRef ), fullScreenViewID, &iFullScreenRef );
+
+		DisposeNibReference( iNibRef );
+
+		initialise();
+		
+		RepositionWindow( iWindowRef, NULL, kWindowCenterOnMainScreen );
+		TransitionWindow( iWindowRef, kWindowFadeTransitionEffect, kWindowShowTransitionAction, NULL );
+		SelectWindow( iWindowRef );
+		ActivateWindow( iWindowRef, true );
+		RunAppModalLoopForWindow( iWindowRef );
+		
+		TransitionWindow( iWindowRef, kWindowFadeTransitionEffect, kWindowHideTransitionAction, NULL );
+		DisposeWindow( iWindowRef );
+
+		return iDisplayStatus;
+
+	CantGetNibRef:
+		LogManager::getSingleton().logMessage( "ConfigDialog::display() => err:CantGetNibRef" );
+	CantCreateWindow:
+		LogManager::getSingleton().logMessage( "ConfigDialog::display() => err:CantCreateWindow" );
+	CantInstallWindowEventHandler:
+		LogManager::getSingleton().logMessage( "ConfigDialog::display() => err:CantInstallWindowEventHandler" );
+	ImporterError:
+		LogManager::getSingleton().logMessage( "ConfigDialog::display() => err:ImporterError" );
+	LogoViewNotFound:
+		LogManager::getSingleton().logMessage( "ConfigDialog::display() => err:LogoViewNotFound" );
+	SetImageFailed:
+		LogManager::getSingleton().logMessage( "ConfigDialog::display() => err:SetImageFailed" );
+	ScaleFailed:
+		LogManager::getSingleton().logMessage( "ConfigDialog::display() => err:SetScaleFailed" );
+	SetVisibleFailed:
+		LogManager::getSingleton().logMessage( "ConfigDialog::display() => err:SetVisibleFailed" );
+		return( iDisplayStatus );
+
+
+		return true;
+	*/
+	}
+
+};
Index: /OgreMain/src/OSX/OgreErrorDialog.cpp
===================================================================
--- /OgreMain/src/OSX/OgreErrorDialog.cpp	(revision 5)
+++ /OgreMain/src/OSX/OgreErrorDialog.cpp	(revision 5)
@@ -0,0 +1,18 @@
+#include "OgreErrorDialog.h"
+
+using namespace Ogre;
+
+ErrorDialog::ErrorDialog()
+{
+}
+
+void ErrorDialog::display(const String& errorMessage, String logName)
+{
+	CFMutableStringRef errorStr = NULL;
+	errorStr = CFStringCreateMutable( kCFAllocatorDefault, 0 );
+	CFStringAppendCString( errorStr, "ERROR: ", kCFStringEncodingASCII );
+	CFStringAppendCString( errorStr, errorMessage.c_str(), kCFStringEncodingASCII );
+	DialogRef alertDialod;
+	CreateStandardAlert( kAlertStopAlert, errorStr, NULL, NULL, &alertDialod );
+	RunStandardAlert( alertDialod, NULL, NULL );
+}
Index: /OgreMain/src/OSX/OgreTimer.cpp
===================================================================
--- /OgreMain/src/OSX/OgreTimer.cpp	(revision 5)
+++ /OgreMain/src/OSX/OgreTimer.cpp	(revision 5)
@@ -0,0 +1,80 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+ 
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+ 
+This program 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 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 Lesser General Public License for more details.
+ 
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreTimer.h"
+#include <sys/time.h>
+
+using namespace Ogre;
+
+//--------------------------------------------------------------------------------//
+Timer::Timer()
+{
+	reset();
+}
+
+//--------------------------------------------------------------------------------//
+Timer::~Timer()
+{
+}
+
+//--------------------------------------------------------------------------------//
+void Timer::reset()
+{
+	zeroClock = clock();
+	gettimeofday(&start, NULL);
+}
+
+//--------------------------------------------------------------------------------//
+unsigned long Timer::getMilliseconds()
+{
+	struct timeval now;
+	gettimeofday(&now, NULL);
+	return (now.tv_sec-start.tv_sec)*1000+(now.tv_usec-start.tv_usec)/1000;
+}
+
+//--------------------------------------------------------------------------------//
+unsigned long Timer::getMicroseconds()
+{
+	struct timeval now;
+	gettimeofday(&now, NULL);
+	return (now.tv_sec-start.tv_sec)*1000000+(now.tv_usec-start.tv_usec);
+}
+
+//-- Common Across All Timers ----------------------------------------------------//
+unsigned long Timer::getMillisecondsCPU()
+{
+	clock_t newClock = clock();
+	return (unsigned long)((float)(newClock-zeroClock) / ((float)CLOCKS_PER_SEC/1000.0)) ;
+}
+
+//-- Common Across All Timers ----------------------------------------------------//
+unsigned long Timer::getMicrosecondsCPU()
+{
+	clock_t newClock = clock();
+	return (unsigned long)((float)(newClock-zeroClock) / ((float)CLOCKS_PER_SEC/1000000.0)) ;
+}
Index: /OgreMain/src/OgreAlignedAllocator.cpp
===================================================================
--- /OgreMain/src/OgreAlignedAllocator.cpp	(revision 5)
+++ /OgreMain/src/OgreAlignedAllocator.cpp	(revision 5)
@@ -0,0 +1,81 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreAlignedAllocator.h"
+
+#include "OgrePlatformInformation.h"
+#include "OgreBitwise.h"
+
+/**
+*
+* |___2___|3|_________5__________|__6__|
+* ^         ^
+* 1         4
+*
+* 1 -> Pointer to start of the block allocated by new.
+* 2 -> Gap used to get 4 aligned on given alignment
+* 3 -> Byte offset between 1 and 4
+* 4 -> Pointer to the start of data block.
+* 5 -> Data block.
+* 6 -> Wasted memory at rear of data block.
+*/
+
+namespace Ogre {
+
+    //---------------------------------------------------------------------
+    void* AlignedMemory::allocate(size_t size, size_t alignment)
+    {
+        assert(0 < alignment && alignment <= 128 && Bitwise::isPO2(alignment));
+
+        unsigned char* p = new unsigned char[size + alignment];
+        size_t offset = alignment - (size_t(p) & (alignment-1));
+
+        unsigned char* result = p + offset;
+        result[-1] = (unsigned char)offset;
+
+        return result;
+    }
+    //---------------------------------------------------------------------
+    void* AlignedMemory::allocate(size_t size)
+    {
+        return allocate(size, OGRE_SIMD_ALIGNMENT);
+    }
+    //---------------------------------------------------------------------
+    void AlignedMemory::deallocate(void* p)
+    {
+        if (p)
+        {
+            unsigned char* mem = (unsigned char*)p;
+            mem = mem - mem[-1];
+            delete [] mem;
+        }
+    }
+
+}
Index: /OgreMain/src/OgreAnimable.cpp
===================================================================
--- /OgreMain/src/OgreAnimable.cpp	(revision 5)
+++ /OgreMain/src/OgreAnimable.cpp	(revision 5)
@@ -0,0 +1,151 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreAnimable.h"
+
+namespace Ogre {
+	//--------------------------------------------------------------------------
+	AnimableObject::AnimableDictionaryMap AnimableObject::msAnimableDictionary;
+	//--------------------------------------------------------------------------
+	void AnimableValue::resetToBaseValue(void)
+	{
+		switch(mType)
+		{
+		case INT:
+			setValue(mBaseValueInt);
+			break;
+		case REAL:
+			setValue(mBaseValueReal[0]);
+			break;
+		case VECTOR2:
+			setValue(Vector2(mBaseValueReal));
+			break;
+		case VECTOR3:
+			setValue(Vector3(mBaseValueReal));
+			break;
+		case VECTOR4:
+			setValue(Vector4(mBaseValueReal));
+			break;
+		case QUATERNION:
+			setValue(Quaternion(mBaseValueReal));
+			break;
+		case COLOUR:
+			setValue(ColourValue(mBaseValueReal[0], mBaseValueReal[1], 
+				mBaseValueReal[2], mBaseValueReal[3]));
+			break;
+		}
+	}
+	//--------------------------------------------------------------------------
+	void AnimableValue::setAsBaseValue(const Any& val)
+	{
+		switch(mType)
+		{
+		case INT:
+			setAsBaseValue(any_cast<int>(val));
+			break;
+		case REAL:
+			setAsBaseValue(any_cast<Real>(val));
+			break;
+		case VECTOR2:
+			setAsBaseValue(any_cast<Vector2>(val));
+			break;
+		case VECTOR3:
+			setAsBaseValue(any_cast<Vector3>(val));
+			break;
+		case VECTOR4:
+			setAsBaseValue(any_cast<Vector4>(val));
+			break;
+		case QUATERNION:
+			setAsBaseValue(any_cast<Quaternion>(val));
+			break;
+		case COLOUR:
+			setAsBaseValue(any_cast<ColourValue>(val));
+			break;
+		}
+	}
+	//--------------------------------------------------------------------------
+	void AnimableValue::setValue(const Any& val)
+	{
+		switch(mType)
+		{
+		case INT:
+			setValue(any_cast<int>(val));
+			break;
+		case REAL:
+			setValue(any_cast<Real>(val));
+			break;
+		case VECTOR2:
+			setValue(any_cast<Vector2>(val));
+			break;
+		case VECTOR3:
+			setValue(any_cast<Vector3>(val));
+			break;
+		case VECTOR4:
+			setValue(any_cast<Vector4>(val));
+			break;
+		case QUATERNION:
+			setValue(any_cast<Quaternion>(val));
+			break;
+		case COLOUR:
+			setValue(any_cast<ColourValue>(val));
+			break;
+		}
+	}
+	//--------------------------------------------------------------------------
+	void AnimableValue::applyDeltaValue(const Any& val)
+	{
+		switch(mType)
+		{
+		case INT:
+			applyDeltaValue(any_cast<int>(val));
+			break;
+		case REAL:
+			applyDeltaValue(any_cast<Real>(val));
+			break;
+		case VECTOR2:
+			applyDeltaValue(any_cast<Vector2>(val));
+			break;
+		case VECTOR3:
+			applyDeltaValue(any_cast<Vector3>(val));
+			break;
+		case VECTOR4:
+			applyDeltaValue(any_cast<Vector4>(val));
+			break;
+		case QUATERNION:
+			applyDeltaValue(any_cast<Quaternion>(val));
+			break;
+		case COLOUR:
+			applyDeltaValue(any_cast<ColourValue>(val));
+			break;
+		}
+	}
+
+
+
+}
Index: /OgreMain/src/OgreAnimation.cpp
===================================================================
--- /OgreMain/src/OgreAnimation.cpp	(revision 5)
+++ /OgreMain/src/OgreAnimation.cpp	(revision 5)
@@ -0,0 +1,654 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreAnimation.h"
+#include "OgreKeyFrame.h"
+#include "OgreException.h"
+#include "OgreSkeleton.h"
+#include "OgreBone.h"
+#include "OgreEntity.h"
+#include "OgreSubEntity.h"
+#include "OgreMesh.h"
+#include "OgreSubMesh.h"
+#include "OgreStringConverter.h"
+
+namespace Ogre {
+
+    Animation::InterpolationMode Animation::msDefaultInterpolationMode = Animation::IM_LINEAR;
+    Animation::RotationInterpolationMode 
+        Animation::msDefaultRotationInterpolationMode = Animation::RIM_LINEAR;
+    //---------------------------------------------------------------------
+    Animation::Animation(const String& name, Real length)
+        : mName(name)
+        , mLength(length)
+        , mInterpolationMode(msDefaultInterpolationMode)
+        , mRotationInterpolationMode(msDefaultRotationInterpolationMode)
+        , mKeyFrameTimesDirty(false)
+    {
+    }
+    //---------------------------------------------------------------------
+    Animation::~Animation()
+    {
+        destroyAllTracks();
+    }
+    //---------------------------------------------------------------------
+    Real Animation::getLength(void) const
+    {
+        return mLength;
+    }
+    //---------------------------------------------------------------------
+    NodeAnimationTrack* Animation::createNodeTrack(unsigned short handle)
+    {
+        if (hasNodeTrack(handle))
+        {
+            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, 
+                "Node track with the specified handle " +
+                StringConverter::toString(handle) + " already exists",
+                "Animation::createNodeTrack");
+        }
+
+        NodeAnimationTrack* ret = new NodeAnimationTrack(this, handle);
+
+        mNodeTrackList[handle] = ret;
+        return ret;
+    }
+    //---------------------------------------------------------------------
+    NodeAnimationTrack* Animation::createNodeTrack(unsigned short handle, Node* node)
+    {
+        NodeAnimationTrack* ret = createNodeTrack(handle);
+
+        ret->setAssociatedNode(node);
+
+        return ret;
+    }
+    //---------------------------------------------------------------------
+    unsigned short Animation::getNumNodeTracks(void) const
+    {
+        return (unsigned short)mNodeTrackList.size();
+    }
+	//---------------------------------------------------------------------
+	bool Animation::hasNodeTrack(unsigned short handle) const
+	{
+		return (mNodeTrackList.find(handle) != mNodeTrackList.end());
+	}
+    //---------------------------------------------------------------------
+    NodeAnimationTrack* Animation::getNodeTrack(unsigned short handle) const
+    {
+        NodeTrackList::const_iterator i = mNodeTrackList.find(handle);
+
+        if (i == mNodeTrackList.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Cannot find node track with the specified handle " +
+                StringConverter::toString(handle),
+                "Animation::getNodeTrack");
+        }
+
+        return i->second;
+
+    }
+    //---------------------------------------------------------------------
+    void Animation::destroyNodeTrack(unsigned short handle)
+    {
+        NodeTrackList::iterator i = mNodeTrackList.find(handle);
+
+		if (i != mNodeTrackList.end())
+		{
+			delete i->second;
+			mNodeTrackList.erase(i);
+            _keyFrameListChanged();
+		}
+    }
+    //---------------------------------------------------------------------
+    void Animation::destroyAllNodeTracks(void)
+    {
+        NodeTrackList::iterator i;
+        for (i = mNodeTrackList.begin(); i != mNodeTrackList.end(); ++i)
+        {
+            delete i->second;
+        }
+        mNodeTrackList.clear();
+        _keyFrameListChanged();
+    }
+	//---------------------------------------------------------------------
+	NumericAnimationTrack* Animation::createNumericTrack(unsigned short handle)
+	{
+        if (hasNumericTrack(handle))
+        {
+            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, 
+                "Numeric track with the specified handle " +
+                StringConverter::toString(handle) + " already exists",
+                "Animation::createNumericTrack");
+        }
+
+		NumericAnimationTrack* ret = new NumericAnimationTrack(this, handle);
+
+		mNumericTrackList[handle] = ret;
+		return ret;
+	}
+	//---------------------------------------------------------------------
+	NumericAnimationTrack* Animation::createNumericTrack(unsigned short handle, 
+		const AnimableValuePtr& anim)
+	{
+		NumericAnimationTrack* ret = createNumericTrack(handle);
+
+		ret->setAssociatedAnimable(anim);
+
+		return ret;
+	}
+	//---------------------------------------------------------------------
+	unsigned short Animation::getNumNumericTracks(void) const
+	{
+		return (unsigned short)mNumericTrackList.size();
+	}
+	//---------------------------------------------------------------------
+	bool Animation::hasNumericTrack(unsigned short handle) const
+	{
+		return (mNumericTrackList.find(handle) != mNumericTrackList.end());
+	}
+	//---------------------------------------------------------------------
+	NumericAnimationTrack* Animation::getNumericTrack(unsigned short handle) const
+	{
+		NumericTrackList::const_iterator i = mNumericTrackList.find(handle);
+
+		if (i == mNumericTrackList.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Cannot find numeric track with the specified handle " +
+                StringConverter::toString(handle),
+				"Animation::getNumericTrack");
+		}
+
+		return i->second;
+
+	}
+	//---------------------------------------------------------------------
+	void Animation::destroyNumericTrack(unsigned short handle)
+	{
+		NumericTrackList::iterator i = mNumericTrackList.find(handle);
+
+		if (i != mNumericTrackList.end())
+		{
+			delete i->second;
+			mNumericTrackList.erase(i);
+            _keyFrameListChanged();
+		}
+	}
+	//---------------------------------------------------------------------
+	void Animation::destroyAllNumericTracks(void)
+	{
+		NumericTrackList::iterator i;
+		for (i = mNumericTrackList.begin(); i != mNumericTrackList.end(); ++i)
+		{
+			delete i->second;
+		}
+		mNumericTrackList.clear();
+        _keyFrameListChanged();
+	}
+	//---------------------------------------------------------------------
+	VertexAnimationTrack* Animation::createVertexTrack(unsigned short handle, 
+		VertexAnimationType animType)
+	{
+        if (hasVertexTrack(handle))
+        {
+            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, 
+                "Vertex track with the specified handle " +
+                StringConverter::toString(handle) + " already exists",
+                "Animation::createVertexTrack");
+        }
+
+		VertexAnimationTrack* ret = new VertexAnimationTrack(this, handle, animType);
+
+		mVertexTrackList[handle] = ret;
+		return ret;
+
+	}
+	//---------------------------------------------------------------------
+	VertexAnimationTrack* Animation::createVertexTrack(unsigned short handle, 
+		VertexData* data, VertexAnimationType animType)
+	{
+		VertexAnimationTrack* ret = createVertexTrack(handle, animType);
+
+		ret->setAssociatedVertexData(data);
+
+		return ret;
+	}
+	//---------------------------------------------------------------------
+	unsigned short Animation::getNumVertexTracks(void) const
+	{
+		return (unsigned short)mVertexTrackList.size();
+	}
+	//---------------------------------------------------------------------
+	bool Animation::hasVertexTrack(unsigned short handle) const
+	{
+		return (mVertexTrackList.find(handle) != mVertexTrackList.end());
+	}
+	//---------------------------------------------------------------------
+	VertexAnimationTrack* Animation::getVertexTrack(unsigned short handle) const
+	{
+		VertexTrackList::const_iterator i = mVertexTrackList.find(handle);
+
+		if (i == mVertexTrackList.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Cannot find vertex track with the specified handle " +
+                StringConverter::toString(handle),
+				"Animation::getVertexTrack");
+		}
+
+		return i->second;
+
+	}
+	//---------------------------------------------------------------------
+	void Animation::destroyVertexTrack(unsigned short handle)
+	{
+		VertexTrackList::iterator i = mVertexTrackList.find(handle);
+
+		if (i != mVertexTrackList.end())
+		{
+			delete i->second;
+			mVertexTrackList.erase(i);
+            _keyFrameListChanged();
+		}
+	}
+	//---------------------------------------------------------------------
+	void Animation::destroyAllVertexTracks(void)
+	{
+		VertexTrackList::iterator i;
+		for (i = mVertexTrackList.begin(); i != mVertexTrackList.end(); ++i)
+		{
+			delete i->second;
+		}
+		mVertexTrackList.clear();
+        _keyFrameListChanged();
+	}
+	//---------------------------------------------------------------------
+	void Animation::destroyAllTracks(void)
+	{
+		destroyAllNodeTracks();
+		destroyAllNumericTracks();
+		destroyAllVertexTracks();
+	}
+    //---------------------------------------------------------------------
+    const String& Animation::getName(void) const
+    {
+        return mName;
+    }
+    //---------------------------------------------------------------------
+	void Animation::apply(Real timePos, Real weight, Real scale)
+    {
+        // Calculate time index for fast keyframe search
+        TimeIndex timeIndex = _getTimeIndex(timePos);
+
+        NodeTrackList::iterator i;
+        for (i = mNodeTrackList.begin(); i != mNodeTrackList.end(); ++i)
+        {
+            i->second->apply(timeIndex, weight, scale);
+        }
+		NumericTrackList::iterator j;
+		for (j = mNumericTrackList.begin(); j != mNumericTrackList.end(); ++j)
+		{
+			j->second->apply(timeIndex, weight, scale);
+		}
+		VertexTrackList::iterator k;
+		for (k = mVertexTrackList.begin(); k != mVertexTrackList.end(); ++k)
+		{
+			k->second->apply(timeIndex, weight, scale);
+		}
+
+    }
+    //---------------------------------------------------------------------
+    void Animation::apply(Skeleton* skel, Real timePos, Real weight, 
+		Real scale)
+    {
+        // Calculate time index for fast keyframe search
+        TimeIndex timeIndex = _getTimeIndex(timePos);
+
+        NodeTrackList::iterator i;
+        for (i = mNodeTrackList.begin(); i != mNodeTrackList.end(); ++i)
+        {
+            // get bone to apply to 
+            Bone* b = skel->getBone(i->first);
+            i->second->applyToNode(b, timeIndex, weight, scale);
+        }
+
+
+    }
+	//---------------------------------------------------------------------
+	void Animation::apply(Entity* entity, Real timePos, Real weight, 
+		bool software, bool hardware)
+	{
+        // Calculate time index for fast keyframe search
+        TimeIndex timeIndex = _getTimeIndex(timePos);
+
+		VertexTrackList::iterator i;
+		for (i = mVertexTrackList.begin(); i != mVertexTrackList.end(); ++i)
+		{
+			unsigned short handle = i->first;
+			VertexAnimationTrack* track = i->second;
+
+			VertexData* swVertexData;
+			VertexData* hwVertexData;
+			VertexData* origVertexData;
+			bool firstAnim = false;
+			if (handle == 0)
+			{
+				// shared vertex data
+				firstAnim = !entity->_getBuffersMarkedForAnimation();
+				swVertexData = entity->_getSoftwareVertexAnimVertexData();
+				hwVertexData = entity->_getHardwareVertexAnimVertexData();
+				origVertexData = entity->getMesh()->sharedVertexData;
+				entity->_markBuffersUsedForAnimation();
+			}
+			else
+			{
+				// sub entity vertex data (-1)
+				SubEntity* s = entity->getSubEntity(handle - 1);
+				// Skip this track if subentity is not visible
+				if (!s->isVisible())
+					continue;
+				firstAnim = !s->_getBuffersMarkedForAnimation();
+				swVertexData = s->_getSoftwareVertexAnimVertexData();
+				hwVertexData = s->_getHardwareVertexAnimVertexData();
+				origVertexData = s->getSubMesh()->vertexData;
+				s->_markBuffersUsedForAnimation();
+			}
+			// Apply to both hardware and software, if requested
+			if (software)
+			{
+				if (firstAnim && track->getAnimationType() == VAT_POSE)
+				{
+					// First time through for a piece of pose animated vertex data
+					// We need to copy the original position values to the temp accumulator
+					const VertexElement* origelem = 
+						origVertexData->vertexDeclaration->findElementBySemantic(VES_POSITION);
+					const VertexElement* destelem = 
+						swVertexData->vertexDeclaration->findElementBySemantic(VES_POSITION);
+					HardwareVertexBufferSharedPtr origBuffer = 
+						origVertexData->vertexBufferBinding->getBuffer(origelem->getSource());
+					HardwareVertexBufferSharedPtr destBuffer = 
+						swVertexData->vertexBufferBinding->getBuffer(destelem->getSource());
+					destBuffer->copyData(*origBuffer.get(), 0, 0, destBuffer->getSizeInBytes(), true);
+				}
+				track->setTargetMode(VertexAnimationTrack::TM_SOFTWARE);
+				track->applyToVertexData(swVertexData, timeIndex, weight, 
+					&(entity->getMesh()->getPoseList()));
+			}
+			if (hardware)
+			{
+				track->setTargetMode(VertexAnimationTrack::TM_HARDWARE);
+				track->applyToVertexData(hwVertexData, timeIndex, weight, 
+					&(entity->getMesh()->getPoseList()));
+			}
+		}
+
+	}
+    //---------------------------------------------------------------------
+    void Animation::setInterpolationMode(InterpolationMode im)
+    {
+        mInterpolationMode = im;
+    }
+    //---------------------------------------------------------------------
+    Animation::InterpolationMode Animation::getInterpolationMode(void) const
+    {
+        return mInterpolationMode;
+    }
+    //---------------------------------------------------------------------
+    void Animation::setDefaultInterpolationMode(InterpolationMode im)
+    {
+        msDefaultInterpolationMode = im;
+    }
+    //---------------------------------------------------------------------
+    Animation::InterpolationMode Animation::getDefaultInterpolationMode(void)
+    {
+        return msDefaultInterpolationMode;
+    }
+    //---------------------------------------------------------------------
+    const Animation::NodeTrackList& Animation::_getNodeTrackList(void) const
+    {
+        return mNodeTrackList;
+
+    }
+	//---------------------------------------------------------------------
+	const Animation::NumericTrackList& Animation::_getNumericTrackList(void) const
+	{
+		return mNumericTrackList;
+	}
+    //---------------------------------------------------------------------
+    const Animation::VertexTrackList& Animation::_getVertexTrackList(void) const
+    {
+        return mVertexTrackList;
+    }
+    //---------------------------------------------------------------------
+    void Animation::setRotationInterpolationMode(RotationInterpolationMode im)
+    {
+        mRotationInterpolationMode = im;
+    }
+    //---------------------------------------------------------------------
+    Animation::RotationInterpolationMode Animation::getRotationInterpolationMode(void) const
+    {
+        return mRotationInterpolationMode;
+    }
+    //---------------------------------------------------------------------
+    void Animation::setDefaultRotationInterpolationMode(RotationInterpolationMode im)
+    {
+        msDefaultRotationInterpolationMode = im;
+    }
+    //---------------------------------------------------------------------
+    Animation::RotationInterpolationMode Animation::getDefaultRotationInterpolationMode(void)
+    {
+        return msDefaultRotationInterpolationMode;
+    }
+    //---------------------------------------------------------------------
+	void Animation::optimise(bool discardIdentityNodeTracks)
+	{
+		optimiseNodeTracks(discardIdentityNodeTracks);
+		optimiseVertexTracks();
+		
+	}
+	//-----------------------------------------------------------------------
+    void Animation::_collectIdentityNodeTracks(TrackHandleList& tracks) const
+    {
+		NodeTrackList::const_iterator i, iend;
+        iend = mNodeTrackList.end();
+		for (i = mNodeTrackList.begin(); i != iend; ++i)
+		{
+			const NodeAnimationTrack* track = i->second;
+			if (track->hasNonZeroKeyFrames())
+			{
+                tracks.erase(i->first);
+            }
+		}
+    }
+	//-----------------------------------------------------------------------
+    void Animation::_destroyNodeTracks(const TrackHandleList& tracks)
+    {
+        TrackHandleList::const_iterator t, tend;
+        tend = tracks.end();
+		for (t = tracks.begin(); t != tend; ++t)
+		{
+			destroyNodeTrack(*t);
+		}
+    }
+	//-----------------------------------------------------------------------
+	void Animation::optimiseNodeTracks(bool discardIdentityTracks)
+	{
+		// Iterate over the node tracks and identify those with no useful keyframes
+		std::list<unsigned short> tracksToDestroy;
+		NodeTrackList::iterator i;
+		for (i = mNodeTrackList.begin(); i != mNodeTrackList.end(); ++i)
+		{
+			NodeAnimationTrack* track = i->second;
+			if (discardIdentityTracks && !track->hasNonZeroKeyFrames())
+			{
+				// mark the entire track for destruction
+				tracksToDestroy.push_back(i->first);
+			}
+			else
+			{
+				track->optimise();
+			}
+
+		}
+
+		// Now destroy the tracks we marked for death
+		for(std::list<unsigned short>::iterator h = tracksToDestroy.begin();
+			h != tracksToDestroy.end(); ++h)
+		{
+			destroyNodeTrack(*h);
+		}
+	}
+	//-----------------------------------------------------------------------
+	void Animation::optimiseVertexTracks(void)
+	{
+		// Iterate over the node tracks and identify those with no useful keyframes
+		std::list<unsigned short> tracksToDestroy;
+		VertexTrackList::iterator i;
+		for (i = mVertexTrackList.begin(); i != mVertexTrackList.end(); ++i)
+		{
+			VertexAnimationTrack* track = i->second;
+			if (!track->hasNonZeroKeyFrames())
+			{
+				// mark the entire track for destruction
+				tracksToDestroy.push_back(i->first);
+			}
+			else
+			{
+				track->optimise();
+			}
+
+		}
+
+		// Now destroy the tracks we marked for death
+		for(std::list<unsigned short>::iterator h = tracksToDestroy.begin();
+			h != tracksToDestroy.end(); ++h)
+		{
+			destroyVertexTrack(*h);
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	Animation* Animation::clone(const String& newName) const
+	{
+		Animation* newAnim = new Animation(newName, mLength);
+        newAnim->mInterpolationMode = mInterpolationMode;
+        newAnim->mRotationInterpolationMode = mRotationInterpolationMode;
+		
+		// Clone all tracks
+		for (NodeTrackList::const_iterator i = mNodeTrackList.begin();
+			i != mNodeTrackList.end(); ++i)
+		{
+			newAnim->mNodeTrackList[i->second->getHandle()] = i->second->_clone(newAnim);
+		}
+		for (NumericTrackList::const_iterator i = mNumericTrackList.begin();
+			i != mNumericTrackList.end(); ++i)
+		{
+			newAnim->mNumericTrackList[i->second->getHandle()] = i->second->_clone(newAnim);
+		}
+		for (VertexTrackList::const_iterator i = mVertexTrackList.begin();
+			i != mVertexTrackList.end(); ++i)
+		{
+			newAnim->mVertexTrackList[i->second->getHandle()] = i->second->_clone(newAnim);
+		}
+
+        newAnim->_keyFrameListChanged();
+		return newAnim;
+
+	}
+    //-----------------------------------------------------------------------
+    TimeIndex Animation::_getTimeIndex(Real timePos) const
+    {
+        // Uncomment following statement for work as previous
+        //return timePos;
+
+        // Build keyframe time list on demand
+        if (mKeyFrameTimesDirty)
+        {
+            buildKeyFrameTimeList();
+        }
+
+        // Wrap time
+        Real totalAnimationLength = mLength;
+
+        while (timePos > totalAnimationLength && totalAnimationLength > 0.0f)
+        {
+            timePos -= totalAnimationLength;
+        }
+
+        // Search for global index
+        KeyFrameTimeList::iterator it =
+            std::lower_bound(mKeyFrameTimes.begin(), mKeyFrameTimes.end(), timePos);
+
+        return TimeIndex(timePos, std::distance(mKeyFrameTimes.begin(), it));
+    }
+    //-----------------------------------------------------------------------
+    void Animation::buildKeyFrameTimeList(void) const
+    {
+        NodeTrackList::const_iterator i;
+		NumericTrackList::const_iterator j;
+		VertexTrackList::const_iterator k;
+
+        // Clear old keyframe times
+        mKeyFrameTimes.clear();
+
+        // Collect all keyframe times from each track
+        for (i = mNodeTrackList.begin(); i != mNodeTrackList.end(); ++i)
+        {
+            i->second->_collectKeyFrameTimes(mKeyFrameTimes);
+        }
+		for (j = mNumericTrackList.begin(); j != mNumericTrackList.end(); ++j)
+		{
+            j->second->_collectKeyFrameTimes(mKeyFrameTimes);
+		}
+		for (k = mVertexTrackList.begin(); k != mVertexTrackList.end(); ++k)
+		{
+            k->second->_collectKeyFrameTimes(mKeyFrameTimes);
+		}
+
+        // Build global index to local index map for each track
+        for (i = mNodeTrackList.begin(); i != mNodeTrackList.end(); ++i)
+        {
+            i->second->_buildKeyFrameIndexMap(mKeyFrameTimes);
+        }
+		for (j = mNumericTrackList.begin(); j != mNumericTrackList.end(); ++j)
+		{
+            j->second->_buildKeyFrameIndexMap(mKeyFrameTimes);
+		}
+		for (k = mVertexTrackList.begin(); k != mVertexTrackList.end(); ++k)
+		{
+            k->second->_buildKeyFrameIndexMap(mKeyFrameTimes);
+		}
+
+        // Reset dirty flag
+        mKeyFrameTimesDirty = false;
+    }
+
+}
+
+
Index: /OgreMain/src/OgreAnimationState.cpp
===================================================================
--- /OgreMain/src/OgreAnimationState.cpp	(revision 5)
+++ /OgreMain/src/OgreAnimationState.cpp	(revision 5)
@@ -0,0 +1,383 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreAnimationState.h"
+#include "OgreException.h"
+
+namespace Ogre 
+{
+
+	//---------------------------------------------------------------------
+	AnimationState::AnimationState(AnimationStateSet* parent, const AnimationState &rhs)
+        : mAnimationName(rhs.mAnimationName)
+        , mParent(parent)
+        , mTimePos(rhs.mTimePos)
+        , mLength(rhs.mLength)
+        , mWeight(rhs.mWeight)
+        , mEnabled(rhs.mEnabled)
+        , mLoop(rhs.mLoop)
+	{
+		mParent->_notifyDirty();
+	}
+	//---------------------------------------------------------------------
+	AnimationState::~AnimationState()
+	{
+	}
+    //---------------------------------------------------------------------
+    AnimationState::AnimationState(const String& animName, 
+		AnimationStateSet *parent, Real timePos, Real length, Real weight, 
+		bool enabled)
+        : mAnimationName(animName)
+        , mParent(parent)
+        , mTimePos(timePos)
+        , mLength(length)
+        , mWeight(weight)
+        , mEnabled(enabled)
+        , mLoop(true)
+    {
+		mParent->_notifyDirty();
+    }
+    //---------------------------------------------------------------------
+    const String& AnimationState::getAnimationName() const
+    {
+        return mAnimationName;
+    }
+    //---------------------------------------------------------------------
+    Real AnimationState::getTimePosition(void) const
+    {
+        return mTimePos;
+    }
+    //---------------------------------------------------------------------
+    void AnimationState::setTimePosition(Real timePos)
+    {
+		if (timePos != mTimePos)
+		{
+			mTimePos = timePos;
+			if (mLoop)
+			{
+				// Wrap
+				mTimePos = fmod(mTimePos, mLength);
+				if(mTimePos < 0)
+					mTimePos += mLength;     
+			}
+			else
+			{
+				// Clamp
+				if(mTimePos < 0)
+					mTimePos = 0;
+				else if (mTimePos > mLength)
+					mTimePos = mLength;
+			}
+
+            if (mEnabled)
+                mParent->_notifyDirty();
+        }
+
+    }
+    //---------------------------------------------------------------------
+    Real AnimationState::getLength() const
+    {
+        return mLength;
+    }
+    //---------------------------------------------------------------------
+    void AnimationState::setLength(Real len)
+    {
+        mLength = len;
+    }
+    //---------------------------------------------------------------------
+    Real AnimationState::getWeight(void) const
+    {
+        return mWeight;
+    }
+    //---------------------------------------------------------------------
+    void AnimationState::setWeight(Real weight)
+    {
+        mWeight = weight;
+
+        if (mEnabled)
+            mParent->_notifyDirty();
+    }
+    //---------------------------------------------------------------------
+    void AnimationState::addTime(Real offset)
+    {
+        setTimePosition(mTimePos + offset);
+    }
+    //---------------------------------------------------------------------
+	bool AnimationState::hasEnded(void) const
+	{
+		return (mTimePos == mLength && !mLoop);
+	}
+    //---------------------------------------------------------------------
+    bool AnimationState::getEnabled(void) const
+    {
+        return mEnabled;
+    }
+    //---------------------------------------------------------------------
+    void AnimationState::setEnabled(bool enabled)
+    {
+        mEnabled = enabled;
+        mParent->_notifyAnimationStateEnabled(this, enabled);
+    }
+    //---------------------------------------------------------------------
+    bool AnimationState::operator==(const AnimationState& rhs) const
+    {
+        if (mAnimationName == rhs.mAnimationName &&
+            mEnabled == rhs.mEnabled &&
+            mTimePos == rhs.mTimePos &&
+            mWeight == rhs.mWeight &&
+            mLength == rhs.mLength && 
+            mLoop == rhs.mLoop)
+        {
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+    //---------------------------------------------------------------------
+    bool AnimationState::operator!=(const AnimationState& rhs) const
+    {
+        return !(*this == rhs);
+    }
+    //---------------------------------------------------------------------
+    void AnimationState::copyStateFrom(const AnimationState& animState)
+    {
+        mTimePos = animState.mTimePos;
+        mLength = animState.mLength;
+        mWeight = animState.mWeight;
+        mEnabled = animState.mEnabled;
+        mLoop = animState.mLoop;
+		mParent->_notifyDirty();
+
+    }
+	//---------------------------------------------------------------------
+	//---------------------------------------------------------------------
+	AnimationStateSet::AnimationStateSet()
+		: mDirtyFrameNumber(std::numeric_limits<unsigned long>::max())
+	{
+	}
+	//---------------------------------------------------------------------
+	AnimationStateSet::AnimationStateSet(const AnimationStateSet& rhs)
+		: mDirtyFrameNumber(std::numeric_limits<unsigned long>::max())
+	{
+		// lock rhs
+		OGRE_LOCK_MUTEX(rhs.OGRE_AUTO_MUTEX_NAME)
+
+		for (AnimationStateMap::const_iterator i = rhs.mAnimationStates.begin();
+			i != rhs.mAnimationStates.end(); ++i)
+		{
+			AnimationState* src = i->second;
+			mAnimationStates[src->getAnimationName()] = 
+				new AnimationState(this, *src);
+		}
+
+        // Clone enabled animation state list
+        for (EnabledAnimationStateList::const_iterator it = rhs.mEnabledAnimationStates.begin();
+            it != rhs.mEnabledAnimationStates.end(); ++it)
+        {
+            const AnimationState* src = *it;
+            mEnabledAnimationStates.push_back(getAnimationState(src->getAnimationName()));
+        }
+	}
+	//---------------------------------------------------------------------
+	AnimationStateSet::~AnimationStateSet()
+	{
+		// Destroy
+		removeAllAnimationStates();
+	}
+	//---------------------------------------------------------------------
+	void AnimationStateSet::removeAnimationState(const String& name)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		AnimationStateMap::iterator i = mAnimationStates.find(name);
+		if (i != mAnimationStates.end())
+		{
+            mEnabledAnimationStates.remove(i->second);
+
+			delete i->second;
+			mAnimationStates.erase(i);
+		}
+	}
+	//---------------------------------------------------------------------
+	void AnimationStateSet::removeAllAnimationStates(void)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		for (AnimationStateMap::iterator i = mAnimationStates.begin();
+			i != mAnimationStates.end(); ++i)
+		{
+			delete i->second;
+		}
+		mAnimationStates.clear();
+        mEnabledAnimationStates.clear();
+
+	}
+	//---------------------------------------------------------------------
+	AnimationState* AnimationStateSet::createAnimationState(const String& name,  
+		Real timePos, Real length, Real weight, bool enabled)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		AnimationStateMap::iterator i = mAnimationStates.find(name);
+		if (i != mAnimationStates.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, 
+				"State for animation named '" + name + "' already exists.", 
+				"AnimationStateSet::createAnimationState");
+		}
+
+		AnimationState* newState = new AnimationState(name, this, timePos, 
+			length, weight, enabled);
+		mAnimationStates[name] = newState;
+
+		return newState;
+
+	}
+	//---------------------------------------------------------------------
+	AnimationState* AnimationStateSet::getAnimationState(const String& name) const
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		AnimationStateMap::const_iterator i = mAnimationStates.find(name);
+		if (i == mAnimationStates.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"No state found for animation named '" + name + "'", 
+				"AnimationStateSet::getAnimationState");
+		}
+		return i->second;
+	}
+	//---------------------------------------------------------------------
+	bool AnimationStateSet::hasAnimationState(const String& name) const
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		return mAnimationStates.find(name) != mAnimationStates.end();
+	}
+	//---------------------------------------------------------------------
+	AnimationStateIterator AnimationStateSet::getAnimationStateIterator(void)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+		// returned iterator not threadsafe, noted in header
+		return AnimationStateIterator(
+			mAnimationStates.begin(), mAnimationStates.end());
+	}
+	//---------------------------------------------------------------------
+	ConstAnimationStateIterator AnimationStateSet::getAnimationStateIterator(void) const
+	{
+		OGRE_LOCK_AUTO_MUTEX
+		// returned iterator not threadsafe, noted in header
+		return ConstAnimationStateIterator(
+			mAnimationStates.begin(), mAnimationStates.end());
+	}
+	//---------------------------------------------------------------------
+	void AnimationStateSet::copyMatchingState(AnimationStateSet* target) const
+	{
+		// lock target
+		OGRE_LOCK_MUTEX(target->OGRE_AUTO_MUTEX_NAME)
+		// lock source
+		OGRE_LOCK_AUTO_MUTEX
+
+		AnimationStateMap::iterator i, iend;
+        iend = target->mAnimationStates.end();
+        for (i = target->mAnimationStates.begin(); i != iend; ++i) {
+            AnimationStateMap::const_iterator iother = mAnimationStates.find(i->first);
+            if (iother == mAnimationStates.end()) {
+                OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "No animation entry found named " + i->first, 
+                    "AnimationStateSet::copyMatchingState");
+            } else {
+                i->second->copyStateFrom(*(iother->second));
+            }
+        }
+
+        // Copy matching enabled animation state list
+        target->mEnabledAnimationStates.clear();
+
+        EnabledAnimationStateList::const_iterator it, itend;
+        itend = mEnabledAnimationStates.end();
+        for (it = mEnabledAnimationStates.begin(); it != itend; ++it)
+        {
+            const AnimationState* src = *it;
+            AnimationStateMap::const_iterator itarget = target->mAnimationStates.find(src->getAnimationName());
+            if (itarget != target->mAnimationStates.end())
+            {
+                target->mEnabledAnimationStates.push_back(itarget->second);
+            }
+        }
+
+        target->mDirtyFrameNumber = mDirtyFrameNumber;
+    }
+    //---------------------------------------------------------------------
+    void AnimationStateSet::_notifyDirty(void)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        ++mDirtyFrameNumber;
+    }
+    //---------------------------------------------------------------------
+    void AnimationStateSet::_notifyAnimationStateEnabled(AnimationState* target, bool enabled)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+		// Remove from enabled animation state list first
+        mEnabledAnimationStates.remove(target);
+
+        // Add to enabled animation state list if need
+        if (enabled)
+        {
+            mEnabledAnimationStates.push_back(target);
+        }
+
+        // Set the dirty frame number
+        _notifyDirty();
+    }
+    //---------------------------------------------------------------------
+    ConstEnabledAnimationStateIterator AnimationStateSet::getEnabledAnimationStateIterator(void) const
+    {
+		OGRE_LOCK_AUTO_MUTEX
+		// returned iterator not threadsafe, noted in header
+        return ConstEnabledAnimationStateIterator(
+            mEnabledAnimationStates.begin(), mEnabledAnimationStates.end());
+    }
+	//---------------------------------------------------------------------
+	//---------------------------------------------------------------------
+	Real AnimationStateControllerValue::getValue(void) const
+	{
+		return mTargetAnimationState->getTimePosition() / mTargetAnimationState->getLength();
+	}
+	//---------------------------------------------------------------------
+	void AnimationStateControllerValue::setValue(Real value)
+	{
+		mTargetAnimationState->setTimePosition(value * mTargetAnimationState->getLength());
+	}
+
+
+}
+
Index: /OgreMain/src/OgreAnimationTrack.cpp
===================================================================
--- /OgreMain/src/OgreAnimationTrack.cpp	(revision 5)
+++ /OgreMain/src/OgreAnimationTrack.cpp	(revision 5)
@@ -0,0 +1,940 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreAnimationTrack.h"
+#include "OgreAnimation.h"
+#include "OgreKeyFrame.h"
+#include "OgreNode.h"
+#include "OgreLogManager.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreMesh.h"
+#include "OgreException.h"
+
+namespace Ogre {
+
+    namespace {
+        // Locally key frame search helper
+        struct KeyFrameTimeLess
+        {
+            bool operator() (const KeyFrame* kf, const KeyFrame* kf2) const
+            {
+                return kf->getTime() < kf2->getTime();
+            }
+        };
+    }
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    AnimationTrack::AnimationTrack(Animation* parent, unsigned short handle) :
+		mParent(parent), mHandle(handle)
+    {
+    }
+    //---------------------------------------------------------------------
+    AnimationTrack::~AnimationTrack()
+    {
+        removeAllKeyFrames();
+    }
+    //---------------------------------------------------------------------
+    unsigned short AnimationTrack::getNumKeyFrames(void) const
+    {
+        return (unsigned short)mKeyFrames.size();
+    }
+    //---------------------------------------------------------------------
+    KeyFrame* AnimationTrack::getKeyFrame(unsigned short index) const
+    {
+		// If you hit this assert, then the keyframe index is out of bounds
+        assert( index < (ushort)mKeyFrames.size() );
+
+        return mKeyFrames[index];
+    }
+    //---------------------------------------------------------------------
+    Real AnimationTrack::getKeyFramesAtTime(const TimeIndex& timeIndex, KeyFrame** keyFrame1, KeyFrame** keyFrame2,
+        unsigned short* firstKeyIndex) const
+    {
+        // Parametric time
+        // t1 = time of previous keyframe
+        // t2 = time of next keyframe
+        Real t1, t2;
+
+        Real timePos = timeIndex.getTimePos();
+
+        // Find first keyframe after or on current time
+        KeyFrameList::const_iterator i;
+        if (timeIndex.hasKeyIndex())
+        {
+            // Global keyframe index available, map to local keyframe index directly.
+            assert(timeIndex.getKeyIndex() < mKeyFrameIndexMap.size());
+            i = mKeyFrames.begin() + mKeyFrameIndexMap[timeIndex.getKeyIndex()];
+#ifdef _DEBUG
+            KeyFrame timeKey(0, timePos);
+            if (i != std::lower_bound(mKeyFrames.begin(), mKeyFrames.end(), &timeKey, KeyFrameTimeLess()))
+            {
+                OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR,
+                    "Optimised key frame search failed",
+                    "AnimationTrack::getKeyFramesAtTime");
+            }
+#endif
+        }
+        else
+        {
+            // Wrap time
+            Real totalAnimationLength = mParent->getLength();
+            assert(totalAnimationLength > 0.0f && "Invalid animation length!");
+
+            while (timePos > totalAnimationLength && totalAnimationLength > 0.0f)
+            {
+                timePos -= totalAnimationLength;
+            }
+
+            // No global keyframe index, need to search with local keyframes.
+            KeyFrame timeKey(0, timePos);
+            i = std::lower_bound(mKeyFrames.begin(), mKeyFrames.end(), &timeKey, KeyFrameTimeLess());
+        }
+
+        if (i == mKeyFrames.end())
+        {
+            // There is no keyframe after this time, wrap back to first
+            *keyFrame2 = mKeyFrames.front();
+            t2 = mParent->getLength() + (*keyFrame2)->getTime();
+
+            // Use last keyframe as previous keyframe
+            --i;
+        }
+        else
+        {
+            *keyFrame2 = *i;
+            t2 = (*keyFrame2)->getTime();
+
+            // Find last keyframe before or on current time
+            if (i != mKeyFrames.begin() && timePos < (*i)->getTime())
+            {
+                --i;
+            }
+        }
+
+        // Fill index of the first key
+        if (firstKeyIndex)
+        {
+            *firstKeyIndex = std::distance(mKeyFrames.begin(), i);
+        }
+
+        *keyFrame1 = *i;
+
+        t1 = (*keyFrame1)->getTime();
+
+        if (t1 == t2)
+        {
+            // Same KeyFrame (only one)
+            return 0.0;
+        }
+        else
+        {
+            return (timePos - t1) / (t2 - t1);
+        }
+    }
+    //---------------------------------------------------------------------
+    KeyFrame* AnimationTrack::createKeyFrame(Real timePos)
+    {
+        KeyFrame* kf = createKeyFrameImpl(timePos);
+
+        // Insert just before upper bound
+        KeyFrameList::iterator i =
+            std::upper_bound(mKeyFrames.begin(), mKeyFrames.end(), kf, KeyFrameTimeLess());
+        mKeyFrames.insert(i, kf);
+
+        _keyFrameDataChanged();
+        mParent->_keyFrameListChanged();
+
+        return kf;
+
+    }
+    //---------------------------------------------------------------------
+    void AnimationTrack::removeKeyFrame(unsigned short index)
+    {
+		// If you hit this assert, then the keyframe index is out of bounds
+        assert( index < (ushort)mKeyFrames.size() );
+
+        KeyFrameList::iterator i = mKeyFrames.begin();
+
+        i += index;
+
+        delete *i;
+
+        mKeyFrames.erase(i);
+
+        _keyFrameDataChanged();
+        mParent->_keyFrameListChanged();
+
+
+    }
+    //---------------------------------------------------------------------
+    void AnimationTrack::removeAllKeyFrames(void)
+    {
+        KeyFrameList::iterator i = mKeyFrames.begin();
+
+        for (; i != mKeyFrames.end(); ++i)
+        {
+            delete *i;
+        }
+
+        _keyFrameDataChanged();
+        mParent->_keyFrameListChanged();
+
+        mKeyFrames.clear();
+
+    }
+    //---------------------------------------------------------------------
+    void AnimationTrack::_collectKeyFrameTimes(std::vector<Real>& keyFrameTimes)
+    {
+        for (KeyFrameList::const_iterator i = mKeyFrames.begin(); i != mKeyFrames.end(); ++i)
+        {
+            Real timePos = (*i)->getTime();
+
+            std::vector<Real>::iterator it =
+                std::lower_bound(keyFrameTimes.begin(), keyFrameTimes.end(), timePos);
+            if (it == keyFrameTimes.end() || *it != timePos)
+            {
+                keyFrameTimes.insert(it, timePos);
+            }
+        }
+    }
+    //---------------------------------------------------------------------
+    void AnimationTrack::_buildKeyFrameIndexMap(const std::vector<Real>& keyFrameTimes)
+    {
+        // Pre-allocate memory
+        mKeyFrameIndexMap.resize(keyFrameTimes.size() + 1);
+
+        size_t i = 0, j = 0;
+        while (j <= keyFrameTimes.size())
+        {
+            mKeyFrameIndexMap[j] = static_cast<ushort>(i);
+            while (i < mKeyFrames.size() && mKeyFrames[i]->getTime() <= keyFrameTimes[j])
+                ++i;
+            ++j;
+        }
+    }
+	//---------------------------------------------------------------------
+	void AnimationTrack::populateClone(AnimationTrack* clone) const
+	{
+		for (KeyFrameList::const_iterator i = mKeyFrames.begin();
+			i != mKeyFrames.end(); ++i)
+		{
+			KeyFrame* clonekf = (*i)->_clone(clone);
+			clone->mKeyFrames.push_back(clonekf);
+		}
+	}
+	//---------------------------------------------------------------------
+	//---------------------------------------------------------------------
+	// Numeric specialisations
+	//---------------------------------------------------------------------
+	NumericAnimationTrack::NumericAnimationTrack(Animation* parent,
+		unsigned short handle)
+		: AnimationTrack(parent, handle)
+	{
+	}
+	//---------------------------------------------------------------------
+	NumericAnimationTrack::NumericAnimationTrack(Animation* parent,
+		unsigned short handle, AnimableValuePtr& target)
+		:AnimationTrack(parent, handle), mTargetAnim(target)
+	{
+	}
+	//---------------------------------------------------------------------
+	const AnimableValuePtr& NumericAnimationTrack::getAssociatedAnimable(void) const
+	{
+		return mTargetAnim;
+	}
+	//---------------------------------------------------------------------
+	void NumericAnimationTrack::setAssociatedAnimable(const AnimableValuePtr& val)
+	{
+		mTargetAnim = val;
+	}
+	//---------------------------------------------------------------------
+	KeyFrame* NumericAnimationTrack::createKeyFrameImpl(Real time)
+	{
+		return new NumericKeyFrame(this, time);
+	}
+	//---------------------------------------------------------------------
+	void NumericAnimationTrack::getInterpolatedKeyFrame(const TimeIndex& timeIndex,
+		KeyFrame* kf) const
+	{
+		NumericKeyFrame* kret = static_cast<NumericKeyFrame*>(kf);
+
+        // Keyframe pointers
+		KeyFrame *kBase1, *kBase2;
+        NumericKeyFrame *k1, *k2;
+        unsigned short firstKeyIndex;
+
+        Real t = this->getKeyFramesAtTime(timeIndex, &kBase1, &kBase2, &firstKeyIndex);
+		k1 = static_cast<NumericKeyFrame*>(kBase1);
+		k2 = static_cast<NumericKeyFrame*>(kBase2);
+
+        if (t == 0.0)
+        {
+            // Just use k1
+            kret->setValue(k1->getValue());
+        }
+        else
+        {
+            // Interpolate by t
+			AnyNumeric diff = k2->getValue() - k1->getValue();
+			kret->setValue(k1->getValue() + diff * t);
+        }
+	}
+	//---------------------------------------------------------------------
+	void NumericAnimationTrack::apply(const TimeIndex& timeIndex, Real weight, Real scale)
+	{
+		applyToAnimable(mTargetAnim, timeIndex, weight, scale);
+	}
+	//---------------------------------------------------------------------
+	void NumericAnimationTrack::applyToAnimable(const AnimableValuePtr& anim, const TimeIndex& timeIndex,
+		Real weight, Real scale)
+	{
+		// Nothing to do if no keyframes or zero weight, scale
+		if (mKeyFrames.empty() || !weight || !scale)
+			return;
+
+		NumericKeyFrame kf(0, timeIndex.getTimePos());
+		getInterpolatedKeyFrame(timeIndex, &kf);
+		// add to existing. Weights are not relative, but treated as
+		// absolute multipliers for the animation
+		AnyNumeric val = kf.getValue() * (weight * scale);
+
+		anim->applyDeltaValue(val);
+
+	}
+	//--------------------------------------------------------------------------
+	NumericKeyFrame* NumericAnimationTrack::createNumericKeyFrame(Real timePos)
+	{
+		return static_cast<NumericKeyFrame*>(createKeyFrame(timePos));
+	}
+	//--------------------------------------------------------------------------
+	NumericKeyFrame* NumericAnimationTrack::getNumericKeyFrame(unsigned short index) const
+	{
+		return static_cast<NumericKeyFrame*>(getKeyFrame(index));
+	}
+    //---------------------------------------------------------------------
+	NumericAnimationTrack* NumericAnimationTrack::_clone(Animation* newParent) const
+	{
+		NumericAnimationTrack* newTrack = 
+			newParent->createNumericTrack(mHandle);
+		newTrack->mTargetAnim = mTargetAnim;
+		populateClone(newTrack);
+		return newTrack;
+	}
+    //---------------------------------------------------------------------
+	//---------------------------------------------------------------------
+	// Node specialisations
+	//---------------------------------------------------------------------
+	NodeAnimationTrack::NodeAnimationTrack(Animation* parent, unsigned short handle)
+		: AnimationTrack(parent, handle), mTargetNode(0)
+        , mSplines(0), mSplineBuildNeeded(false)
+        , mUseShortestRotationPath(true)
+	{
+	}
+	//---------------------------------------------------------------------
+	NodeAnimationTrack::NodeAnimationTrack(Animation* parent, unsigned short handle,
+		Node* targetNode)
+		: AnimationTrack(parent, handle), mTargetNode(targetNode)
+        , mSplines(0), mSplineBuildNeeded(false)
+        , mUseShortestRotationPath(true)
+	{
+	}
+    //---------------------------------------------------------------------
+    NodeAnimationTrack::~NodeAnimationTrack()
+    {
+        delete mSplines;
+    }
+	//---------------------------------------------------------------------
+    void NodeAnimationTrack::getInterpolatedKeyFrame(const TimeIndex& timeIndex, KeyFrame* kf) const
+    {
+		TransformKeyFrame* kret = static_cast<TransformKeyFrame*>(kf);
+
+        // Keyframe pointers
+		KeyFrame *kBase1, *kBase2;
+        TransformKeyFrame *k1, *k2;
+        unsigned short firstKeyIndex;
+
+        Real t = this->getKeyFramesAtTime(timeIndex, &kBase1, &kBase2, &firstKeyIndex);
+		k1 = static_cast<TransformKeyFrame*>(kBase1);
+		k2 = static_cast<TransformKeyFrame*>(kBase2);
+
+        if (t == 0.0)
+        {
+            // Just use k1
+            kret->setRotation(k1->getRotation());
+            kret->setTranslate(k1->getTranslate());
+            kret->setScale(k1->getScale());
+        }
+        else
+        {
+            // Interpolate by t
+            Animation::InterpolationMode im = mParent->getInterpolationMode();
+            Animation::RotationInterpolationMode rim =
+                mParent->getRotationInterpolationMode();
+            Vector3 base;
+            switch(im)
+            {
+            case Animation::IM_LINEAR:
+                // Interpolate linearly
+                // Rotation
+                // Interpolate to nearest rotation if mUseShortestRotationPath set
+                if (rim == Animation::RIM_LINEAR)
+                {
+                    kret->setRotation( Quaternion::nlerp(t, k1->getRotation(),
+                        k2->getRotation(), mUseShortestRotationPath) );
+                }
+                else //if (rim == Animation::RIM_SPHERICAL)
+                {
+                    kret->setRotation( Quaternion::Slerp(t, k1->getRotation(),
+					    k2->getRotation(), mUseShortestRotationPath) );
+                }
+
+                // Translation
+                base = k1->getTranslate();
+                kret->setTranslate( base + ((k2->getTranslate() - base) * t) );
+
+                // Scale
+                base = k1->getScale();
+                kret->setScale( base + ((k2->getScale() - base) * t) );
+                break;
+
+            case Animation::IM_SPLINE:
+                // Spline interpolation
+
+                // Build splines if required
+                if (mSplineBuildNeeded)
+                {
+                    buildInterpolationSplines();
+                }
+
+                // Rotation, take mUseShortestRotationPath into account
+                kret->setRotation( mSplines->rotationSpline.interpolate(firstKeyIndex, t,
+					mUseShortestRotationPath) );
+
+                // Translation
+                kret->setTranslate( mSplines->positionSpline.interpolate(firstKeyIndex, t) );
+
+                // Scale
+                kret->setScale( mSplines->scaleSpline.interpolate(firstKeyIndex, t) );
+
+                break;
+            }
+
+        }
+    }
+    //---------------------------------------------------------------------
+    void NodeAnimationTrack::apply(const TimeIndex& timeIndex, Real weight, Real scale)
+    {
+        applyToNode(mTargetNode, timeIndex, weight, scale);
+
+    }
+    //---------------------------------------------------------------------
+    Node* NodeAnimationTrack::getAssociatedNode(void) const
+    {
+        return mTargetNode;
+    }
+    //---------------------------------------------------------------------
+    void NodeAnimationTrack::setAssociatedNode(Node* node)
+    {
+        mTargetNode = node;
+    }
+    //---------------------------------------------------------------------
+    void NodeAnimationTrack::applyToNode(Node* node, const TimeIndex& timeIndex, Real weight,
+		Real scl)
+    {
+		// Nothing to do if no keyframes or zero weight or no node
+		if (mKeyFrames.empty() || !weight || !node)
+			return;
+
+        TransformKeyFrame kf(0, timeIndex.getTimePos());
+		getInterpolatedKeyFrame(timeIndex, &kf);
+
+		// add to existing. Weights are not relative, but treated as absolute multipliers for the animation
+        Vector3 translate = kf.getTranslate() * weight * scl;
+		node->translate(translate);
+
+		// interpolate between no-rotation and full rotation, to point 'weight', so 0 = no rotate, 1 = full
+        Quaternion rotate;
+        Animation::RotationInterpolationMode rim =
+            mParent->getRotationInterpolationMode();
+        if (rim == Animation::RIM_LINEAR)
+        {
+            rotate = Quaternion::nlerp(weight, Quaternion::IDENTITY, kf.getRotation(), mUseShortestRotationPath);
+        }
+        else //if (rim == Animation::RIM_SPHERICAL)
+        {
+            rotate = Quaternion::Slerp(weight, Quaternion::IDENTITY, kf.getRotation(), mUseShortestRotationPath);
+        }
+		node->rotate(rotate);
+
+		Vector3 scale = kf.getScale();
+		// Not sure how to modify scale for cumulative anims... leave it alone
+		//scale = ((Vector3::UNIT_SCALE - kf.getScale()) * weight) + Vector3::UNIT_SCALE;
+		if (scl != 1.0f && scale != Vector3::UNIT_SCALE)
+		{
+			scale = Vector3::UNIT_SCALE + (scale - Vector3::UNIT_SCALE) * scl;
+		}
+		node->scale(scale);
+
+    }
+    //---------------------------------------------------------------------
+    void NodeAnimationTrack::buildInterpolationSplines(void) const
+    {
+        // Allocate splines if not exists
+        if (!mSplines)
+        {
+            mSplines = new Splines;
+        }
+
+        // Cache to register for optimisation
+        Splines* splines = mSplines;
+
+        // Don't calc automatically, do it on request at the end
+        splines->positionSpline.setAutoCalculate(false);
+        splines->rotationSpline.setAutoCalculate(false);
+        splines->scaleSpline.setAutoCalculate(false);
+
+        splines->positionSpline.clear();
+        splines->rotationSpline.clear();
+        splines->scaleSpline.clear();
+
+        KeyFrameList::const_iterator i, iend;
+        iend = mKeyFrames.end(); // precall to avoid overhead
+        for (i = mKeyFrames.begin(); i != iend; ++i)
+        {
+			TransformKeyFrame* kf = static_cast<TransformKeyFrame*>(*i);
+            splines->positionSpline.addPoint(kf->getTranslate());
+            splines->rotationSpline.addPoint(kf->getRotation());
+            splines->scaleSpline.addPoint(kf->getScale());
+        }
+
+        splines->positionSpline.recalcTangents();
+        splines->rotationSpline.recalcTangents();
+        splines->scaleSpline.recalcTangents();
+
+
+        mSplineBuildNeeded = false;
+    }
+
+    //---------------------------------------------------------------------
+	void NodeAnimationTrack::setUseShortestRotationPath(bool useShortestPath)
+	{
+		mUseShortestRotationPath = useShortestPath ;
+	}
+
+    //---------------------------------------------------------------------
+	bool NodeAnimationTrack::getUseShortestRotationPath() const
+	{
+		return mUseShortestRotationPath ;
+	}
+    //---------------------------------------------------------------------
+    void NodeAnimationTrack::_keyFrameDataChanged(void) const
+    {
+        mSplineBuildNeeded = true;
+    }
+    //---------------------------------------------------------------------
+	bool NodeAnimationTrack::hasNonZeroKeyFrames(void) const
+	{
+        KeyFrameList::const_iterator i = mKeyFrames.begin();
+        for (; i != mKeyFrames.end(); ++i)
+        {
+			// look for keyframes which have any component which is non-zero
+			// Since exporters can be a little inaccurate sometimes we use a
+			// tolerance value rather than looking for nothing
+			TransformKeyFrame* kf = static_cast<TransformKeyFrame*>(*i);
+			Vector3 trans = kf->getTranslate();
+			Vector3 scale = kf->getScale();
+			Vector3 axis;
+			Radian angle;
+			kf->getRotation().ToAngleAxis(angle, axis);
+			Real tolerance = 1e-3f;
+			if (!trans.positionEquals(Vector3::ZERO, tolerance) ||
+				!scale.positionEquals(Vector3::UNIT_SCALE, tolerance) ||
+				!Math::RealEqual(angle.valueRadians(), 0.0f, tolerance))
+			{
+				return true;
+			}
+
+		}
+
+		return false;
+	}
+    //---------------------------------------------------------------------
+	void NodeAnimationTrack::optimise(void)
+	{
+		// Eliminate duplicate keyframes from 2nd to penultimate keyframe
+		// NB only eliminate middle keys from sequences of 5+ identical keyframes
+		// since we need to preserve the boundary keys in place, and we need
+		// 2 at each end to preserve tangents for spline interpolation
+		Vector3 lasttrans;
+		Vector3 lastscale;
+		Quaternion lastorientation;
+        KeyFrameList::iterator i = mKeyFrames.begin();
+		Radian quatTolerance(1e-3f);
+		std::list<unsigned short> removeList;
+		unsigned short k = 0;
+		ushort dupKfCount = 0;
+        for (; i != mKeyFrames.end(); ++i, ++k)
+        {
+			TransformKeyFrame* kf = static_cast<TransformKeyFrame*>(*i);
+			Vector3 newtrans = kf->getTranslate();
+			Vector3 newscale = kf->getScale();
+			Quaternion neworientation = kf->getRotation();
+			// Ignore first keyframe; now include the last keyframe as we eliminate
+			// only k-2 in a group of 5 to ensure we only eliminate middle keys
+			if (i != mKeyFrames.begin() &&
+				newtrans.positionEquals(lasttrans) &&
+				newscale.positionEquals(lastscale) &&
+				neworientation.equals(lastorientation, quatTolerance))
+			{
+				++dupKfCount;
+
+				// 4 indicates this is the 5th duplicate keyframe
+				if (dupKfCount == 4)
+				{
+					// remove the 'middle' keyframe
+					removeList.push_back(k-2);
+					--dupKfCount;
+				}
+			}
+			else
+			{
+				// reset
+				dupKfCount = 0;
+				lasttrans = newtrans;
+				lastscale = newscale;
+				lastorientation = neworientation;
+			}
+		}
+
+		// Now remove keyframes, in reverse order to avoid index revocation
+		std::list<unsigned short>::reverse_iterator r = removeList.rbegin();
+		for (; r!= removeList.rend(); ++r)
+		{
+			removeKeyFrame(*r);
+		}
+
+
+	}
+	//--------------------------------------------------------------------------
+	KeyFrame* NodeAnimationTrack::createKeyFrameImpl(Real time)
+	{
+		return new TransformKeyFrame(this, time);
+	}
+	//--------------------------------------------------------------------------
+	TransformKeyFrame* NodeAnimationTrack::createNodeKeyFrame(Real timePos)
+	{
+		return static_cast<TransformKeyFrame*>(createKeyFrame(timePos));
+	}
+	//--------------------------------------------------------------------------
+	TransformKeyFrame* NodeAnimationTrack::getNodeKeyFrame(unsigned short index) const
+	{
+		return static_cast<TransformKeyFrame*>(getKeyFrame(index));
+	}
+    //---------------------------------------------------------------------
+	NodeAnimationTrack* NodeAnimationTrack::_clone(Animation* newParent) const
+	{
+		NodeAnimationTrack* newTrack = 
+			newParent->createNodeTrack(mHandle, mTargetNode);
+		newTrack->mUseShortestRotationPath = mUseShortestRotationPath;
+		populateClone(newTrack);
+		return newTrack;
+	}	
+	//--------------------------------------------------------------------------
+	VertexAnimationTrack::VertexAnimationTrack(Animation* parent,
+		unsigned short handle, VertexAnimationType animType)
+		: AnimationTrack(parent, handle), mAnimationType(animType)
+	{
+	}
+	//--------------------------------------------------------------------------
+	VertexAnimationTrack::VertexAnimationTrack(Animation* parent, unsigned short handle,
+		VertexAnimationType animType, VertexData* targetData, TargetMode target)
+		: AnimationTrack(parent, handle), mAnimationType(animType),
+		mTargetVertexData(targetData), mTargetMode(target)
+	{
+	}
+	//--------------------------------------------------------------------------
+	VertexMorphKeyFrame* VertexAnimationTrack::createVertexMorphKeyFrame(Real timePos)
+	{
+		if (mAnimationType != VAT_MORPH)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Morph keyframes can only be created on vertex tracks of type morph.",
+				"VertexAnimationTrack::createVertexMorphKeyFrame");
+		}
+		return static_cast<VertexMorphKeyFrame*>(createKeyFrame(timePos));
+	}
+	//--------------------------------------------------------------------------
+	VertexPoseKeyFrame* VertexAnimationTrack::createVertexPoseKeyFrame(Real timePos)
+	{
+		if (mAnimationType != VAT_POSE)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Pose keyframes can only be created on vertex tracks of type pose.",
+				"VertexAnimationTrack::createVertexPoseKeyFrame");
+		}
+		return static_cast<VertexPoseKeyFrame*>(createKeyFrame(timePos));
+	}
+	//--------------------------------------------------------------------------
+	void VertexAnimationTrack::apply(const TimeIndex& timeIndex, Real weight, Real scale)
+	{
+		applyToVertexData(mTargetVertexData, timeIndex, weight);
+	}
+	//--------------------------------------------------------------------------
+	void VertexAnimationTrack::applyToVertexData(VertexData* data,
+		const TimeIndex& timeIndex, Real weight, const PoseList* poseList)
+	{
+		// Nothing to do if no keyframes or no vertex data
+		if (mKeyFrames.empty() || !data)
+			return;
+
+		// Get keyframes
+		KeyFrame *kf1, *kf2;
+		Real t = getKeyFramesAtTime(timeIndex, &kf1, &kf2);
+
+		if (mAnimationType == VAT_MORPH)
+		{
+			VertexMorphKeyFrame* vkf1 = static_cast<VertexMorphKeyFrame*>(kf1);
+			VertexMorphKeyFrame* vkf2 = static_cast<VertexMorphKeyFrame*>(kf2);
+
+			if (mTargetMode == TM_HARDWARE)
+			{
+				// If target mode is hardware, need to bind our 2 keyframe buffers,
+				// one to main pos, one to morph target texcoord
+				assert(!data->hwAnimationDataList.empty() &&
+					"Haven't set up hardware vertex animation elements!");
+
+				// no use for TempBlendedBufferInfo here btw
+				// NB we assume that position buffer is unshared
+				// VertexDeclaration::getAutoOrganisedDeclaration should see to that
+				const VertexElement* posElem =
+					data->vertexDeclaration->findElementBySemantic(VES_POSITION);
+				// Set keyframe1 data as original position
+				data->vertexBufferBinding->setBinding(
+					posElem->getSource(), vkf1->getVertexBuffer());
+				// Set keyframe2 data as derived
+				data->vertexBufferBinding->setBinding(
+					data->hwAnimationDataList[0].targetVertexElement->getSource(),
+					vkf2->getVertexBuffer());
+				// save T for use later
+				data->hwAnimationDataList[0].parametric = t;
+
+			}
+			else
+			{
+				// If target mode is software, need to software interpolate each vertex
+
+				Mesh::softwareVertexMorph(
+					t, vkf1->getVertexBuffer(), vkf2->getVertexBuffer(), data);
+			}
+		}
+		else
+		{
+			// Pose
+
+			VertexPoseKeyFrame* vkf1 = static_cast<VertexPoseKeyFrame*>(kf1);
+			VertexPoseKeyFrame* vkf2 = static_cast<VertexPoseKeyFrame*>(kf2);
+
+			// For each pose reference in key 1, we need to locate the entry in
+			// key 2 and interpolate the influence
+			const VertexPoseKeyFrame::PoseRefList& poseList1 = vkf1->getPoseReferences();
+			const VertexPoseKeyFrame::PoseRefList& poseList2 = vkf2->getPoseReferences();
+			for (VertexPoseKeyFrame::PoseRefList::const_iterator p1 = poseList1.begin();
+				p1 != poseList1.end(); ++p1)
+			{
+				Real startInfluence = p1->influence;
+				Real endInfluence = 0;
+				// Search for entry in keyframe 2 list (if not there, will be 0)
+				for (VertexPoseKeyFrame::PoseRefList::const_iterator p2 = poseList2.begin();
+					p2 != poseList2.end(); ++p2)
+				{
+					if (p1->poseIndex == p2->poseIndex)
+					{
+						endInfluence = p2->influence;
+						break;
+					}
+				}
+				// Interpolate influence
+				Real influence = startInfluence + t*(endInfluence - startInfluence);
+				// Scale by animation weight
+				influence = weight * influence;
+				// Get pose
+				assert (p1->poseIndex <= poseList->size());
+				Pose* pose = (*poseList)[p1->poseIndex];
+				// apply
+				applyPoseToVertexData(pose, data, influence);
+			}
+			// Now deal with any poses in key 2 which are not in key 1
+			for (VertexPoseKeyFrame::PoseRefList::const_iterator p2 = poseList2.begin();
+				p2 != poseList2.end(); ++p2)
+			{
+				bool found = false;
+				for (VertexPoseKeyFrame::PoseRefList::const_iterator p1 = poseList1.begin();
+					p1 != poseList1.end(); ++p1)
+				{
+					if (p1->poseIndex == p2->poseIndex)
+					{
+						found = true;
+						break;
+					}
+				}
+				if (!found)
+				{
+					// Need to apply this pose too, scaled from 0 start
+					Real influence = t * p2->influence;
+					// Scale by animation weight
+					influence = weight * influence;
+					// Get pose
+					assert (p2->poseIndex <= poseList->size());
+					const Pose* pose = (*poseList)[p2->poseIndex];
+					// apply
+					applyPoseToVertexData(pose, data, influence);
+				}
+			} // key 2 iteration
+		} // morph or pose animation
+	}
+	//-----------------------------------------------------------------------------
+	void VertexAnimationTrack::applyPoseToVertexData(const Pose* pose,
+		VertexData* data, Real influence)
+	{
+		if (mTargetMode == TM_HARDWARE)
+		{
+			// Hardware
+			// If target mode is hardware, need to bind our pose buffer
+			// to a target texcoord
+			assert(!data->hwAnimationDataList.empty() &&
+				"Haven't set up hardware vertex animation elements!");
+			// no use for TempBlendedBufferInfo here btw
+			// Set pose target as required
+			size_t hwIndex = data->hwAnimDataItemsUsed++;
+			// If we try to use too many poses, ignore extras
+			if (hwIndex < data->hwAnimationDataList.size())
+			{
+				VertexData::HardwareAnimationData& animData = data->hwAnimationDataList[hwIndex];
+				data->vertexBufferBinding->setBinding(
+					animData.targetVertexElement->getSource(),
+					pose->_getHardwareVertexBuffer(data->vertexCount));
+				// save final influence in parametric
+				animData.parametric = influence;
+
+			}
+
+		}
+		else
+		{
+			// Software
+			Mesh::softwareVertexPoseBlend(influence, pose->getVertexOffsets(), data);
+		}
+
+	}
+	//--------------------------------------------------------------------------
+	VertexMorphKeyFrame* VertexAnimationTrack::getVertexMorphKeyFrame(unsigned short index) const
+	{
+		if (mAnimationType != VAT_MORPH)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Morph keyframes can only be created on vertex tracks of type morph.",
+				"VertexAnimationTrack::getVertexMorphKeyFrame");
+		}
+
+		return static_cast<VertexMorphKeyFrame*>(getKeyFrame(index));
+	}
+	//--------------------------------------------------------------------------
+	VertexPoseKeyFrame* VertexAnimationTrack::getVertexPoseKeyFrame(unsigned short index) const
+	{
+		if (mAnimationType != VAT_POSE)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Pose keyframes can only be created on vertex tracks of type pose.",
+				"VertexAnimationTrack::getVertexPoseKeyFrame");
+		}
+
+		return static_cast<VertexPoseKeyFrame*>(getKeyFrame(index));
+	}
+	//--------------------------------------------------------------------------
+	KeyFrame* VertexAnimationTrack::createKeyFrameImpl(Real time)
+	{
+		switch(mAnimationType)
+		{
+		default:
+		case VAT_MORPH:
+            return new VertexMorphKeyFrame(this, time);
+		case VAT_POSE:
+			return new VertexPoseKeyFrame(this, time);
+		};
+
+	}
+	//---------------------------------------------------------------------
+	bool VertexAnimationTrack::hasNonZeroKeyFrames(void) const
+	{
+		if (mAnimationType == VAT_MORPH)
+		{
+			return !mKeyFrames.empty();
+		}
+		else
+		{
+
+			KeyFrameList::const_iterator i = mKeyFrames.begin();
+			for (; i != mKeyFrames.end(); ++i)
+			{
+				// look for keyframes which have a pose influence which is non-zero
+				const VertexPoseKeyFrame* kf = static_cast<const VertexPoseKeyFrame*>(*i);
+				VertexPoseKeyFrame::ConstPoseRefIterator poseIt
+					= kf->getPoseReferenceIterator();
+				while (poseIt.hasMoreElements())
+				{
+					const VertexPoseKeyFrame::PoseRef& poseRef = poseIt.getNext();
+					if (poseRef.influence > 0.0f)
+						return true;
+				}
+
+			}
+
+			return false;
+		}
+	}
+	//---------------------------------------------------------------------
+	void VertexAnimationTrack::optimise(void)
+	{
+		// TODO - remove sequences of duplicate pose references?
+
+
+	}
+    //---------------------------------------------------------------------
+	VertexAnimationTrack* VertexAnimationTrack::_clone(Animation* newParent) const
+	{
+		VertexAnimationTrack* newTrack = 
+			newParent->createVertexTrack(mHandle, mAnimationType);
+		newTrack->mTargetMode = mTargetMode;
+		populateClone(newTrack);
+		return newTrack;
+	}	
+
+
+}
+
Index: /OgreMain/src/OgreArchiveManager.cpp
===================================================================
--- /OgreMain/src/OgreArchiveManager.cpp	(revision 5)
+++ /OgreMain/src/OgreArchiveManager.cpp	(revision 5)
@@ -0,0 +1,135 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreArchiveManager.h"
+
+#include "OgreArchiveFactory.h"
+#include "OgreArchive.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+
+namespace Ogre {
+    typedef void (*createFunc)( Archive**, const String& );
+
+    //-----------------------------------------------------------------------
+    template<> ArchiveManager* Singleton<ArchiveManager>::ms_Singleton = 0;
+    ArchiveManager* ArchiveManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    ArchiveManager& ArchiveManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+    //-----------------------------------------------------------------------
+
+    //-----------------------------------------------------------------------
+    Archive* ArchiveManager::load( const String& filename, const String& archiveType)
+    {
+        ArchiveMap::iterator i = mArchives.find(filename);
+        Archive* pArch = 0;
+
+        if (i == mArchives.end())
+        {
+            // Search factories
+            ArchiveFactoryMap::iterator it = mArchFactories.find(archiveType);
+            if (it == mArchFactories.end())
+                // Factory not found
+                OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Cannot find an archive factory "
+                    "to deal with archive of type " + archiveType, "ArchiveManager::load");
+
+            pArch = it->second->createInstance(filename);
+            pArch->load();
+            mArchives[filename] = pArch;
+
+        }
+        else
+        {
+            pArch = i->second;
+        }
+        return pArch;
+    }
+	//-----------------------------------------------------------------------
+	void ArchiveManager::unload(Archive* arch)
+	{
+		unload(arch->getName());
+	}
+	//-----------------------------------------------------------------------
+	void ArchiveManager::unload(const String& filename)
+	{
+		ArchiveMap::iterator i = mArchives.find(filename);
+
+		if (i != mArchives.end())
+		{
+			i->second->unload();
+			// Find factory to destroy
+			ArchiveFactoryMap::iterator fit = mArchFactories.find(i->second->getType());
+			if (fit == mArchFactories.end())
+			{
+				// Factory not found
+				OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Cannot find an archive factory "
+					"to deal with archive of type " + i->second->getType(), "ArchiveManager::~ArchiveManager");
+			}
+			fit->second->destroyInstance(i->second);
+			mArchives.erase(i);
+		}
+	}
+    //-----------------------------------------------------------------------
+    ArchiveManager::~ArchiveManager()
+    {
+        // Unload & delete resources in turn
+        for( ArchiveMap::iterator it = mArchives.begin(); it != mArchives.end(); ++it )
+        {
+            Archive* arch = it->second;
+            // Unload
+            arch->unload();
+            // Find factory to destroy
+            ArchiveFactoryMap::iterator fit = mArchFactories.find(arch->getType());
+            if (fit == mArchFactories.end())
+            {
+                // Factory not found
+                OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Cannot find an archive factory "
+                "to deal with archive of type " + arch->getType(), "ArchiveManager::~ArchiveManager");
+            }
+            fit->second->destroyInstance(arch);
+            
+        }
+        // Empty the list
+        mArchives.clear();
+    }
+    //-----------------------------------------------------------------------
+    void ArchiveManager::addArchiveFactory(ArchiveFactory* factory)
+    {        
+        mArchFactories.insert( ArchiveFactoryMap::value_type( factory->getType(), factory ) );
+        LogManager::getSingleton().logMessage("ArchiveFactory for archive type " +     factory->getType() + " registered.");
+    }
+
+}
+
Index: /OgreMain/src/OgreAutoParamDataSource.cpp
===================================================================
--- /OgreMain/src/OgreAutoParamDataSource.cpp	(revision 5)
+++ /OgreMain/src/OgreAutoParamDataSource.cpp	(revision 5)
@@ -0,0 +1,793 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreAutoParamDataSource.h"
+#include "OgreRenderable.h"
+#include "OgreCamera.h"
+#include "OgreRenderTarget.h"
+#include "OgreControllerManager.h"
+#include "OgreMath.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+
+namespace Ogre {
+    const Matrix4 PROJECTIONCLIPSPACE2DTOIMAGESPACE_PERSPECTIVE(
+        0.5,    0,    0,  0.5, 
+        0,   -0.5,    0,  0.5, 
+        0,      0,    1,    0,
+        0,      0,    0,    1);
+
+    //-----------------------------------------------------------------------------
+    AutoParamDataSource::AutoParamDataSource()
+        : mWorldMatrixDirty(true),
+         mViewMatrixDirty(true),
+         mProjMatrixDirty(true),
+         mWorldViewMatrixDirty(true),
+         mViewProjMatrixDirty(true),
+         mWorldViewProjMatrixDirty(true),
+         mInverseWorldMatrixDirty(true),
+         mInverseWorldViewMatrixDirty(true),
+         mInverseViewMatrixDirty(true),
+         mInverseTransposeWorldMatrixDirty(true),
+         mInverseTransposeWorldViewMatrixDirty(true),
+         mCameraPositionObjectSpaceDirty(true),
+         mCameraPositionDirty(true),
+		 mSceneDepthRangeDirty(true),
+		 mShadowCamDepthRangesDirty(true),
+         mCurrentRenderable(0),
+         mCurrentCamera(0), 
+         mCurrentRenderTarget(0),
+         mCurrentViewport(0), 
+		 mCurrentSceneManager(0),
+		 mMainCamBoundsInfo(0),
+         mCurrentPass(0)
+    {
+        mBlankLight.setDiffuseColour(ColourValue::Black);
+        mBlankLight.setSpecularColour(ColourValue::Black);
+        mBlankLight.setAttenuation(0,1,0,0);
+		for(size_t i = 0; i < OGRE_MAX_SIMULTANEOUS_LIGHTS; ++i)
+		{
+			mTextureViewProjMatrixDirty[i] = true;
+			mCurrentTextureProjector[i] = 0;
+		}
+
+    }
+    //-----------------------------------------------------------------------------
+    AutoParamDataSource::~AutoParamDataSource()
+    {
+    }
+    //-----------------------------------------------------------------------------
+    void AutoParamDataSource::setCurrentRenderable(const Renderable* rend)
+    {
+		mCurrentRenderable = rend;
+		mWorldMatrixDirty = true;
+        mViewMatrixDirty = true;
+        mProjMatrixDirty = true;
+		mWorldViewMatrixDirty = true;
+        mViewProjMatrixDirty = true;
+		mWorldViewProjMatrixDirty = true;
+		mInverseWorldMatrixDirty = true;
+        mInverseViewMatrixDirty = true;
+		mInverseWorldViewMatrixDirty = true;
+		mInverseTransposeWorldMatrixDirty = true;
+		mInverseTransposeWorldViewMatrixDirty = true;
+		mCameraPositionObjectSpaceDirty = true;
+    }
+    //-----------------------------------------------------------------------------
+    void AutoParamDataSource::setCurrentCamera(const Camera* cam)
+    {
+        mCurrentCamera = cam;
+        mViewMatrixDirty = true;
+        mProjMatrixDirty = true;
+        mWorldViewMatrixDirty = true;
+        mViewProjMatrixDirty = true;
+        mWorldViewProjMatrixDirty = true;
+        mInverseViewMatrixDirty = true;
+        mInverseWorldViewMatrixDirty = true;
+        mInverseTransposeWorldViewMatrixDirty = true;
+        mCameraPositionObjectSpaceDirty = true;
+        mCameraPositionDirty = true;
+    }
+    //-----------------------------------------------------------------------------
+    void AutoParamDataSource::setCurrentLightList(const LightList* ll)
+    {
+        mCurrentLightList = ll;
+		mShadowCamDepthRangesDirty = true;
+    }
+	//-----------------------------------------------------------------------------
+	void AutoParamDataSource::setMainCamBoundsInfo(VisibleObjectsBoundsInfo* info)
+	{
+		mMainCamBoundsInfo = info;
+		mSceneDepthRangeDirty = true;
+	}
+	//-----------------------------------------------------------------------------
+	void AutoParamDataSource::setCurrentSceneManager(const SceneManager* sm)
+	{
+		mCurrentSceneManager = sm;
+	}
+    //-----------------------------------------------------------------------------
+    void AutoParamDataSource::setWorldMatrices(const Matrix4* m, size_t count)
+    {
+        mWorldMatrixArray = m;
+        mWorldMatrixCount = count;
+        mWorldMatrixDirty = false;
+    }
+    //-----------------------------------------------------------------------------
+    const Matrix4& AutoParamDataSource::getWorldMatrix(void) const
+    {
+        if (mWorldMatrixDirty)
+        {
+            mWorldMatrixArray = mWorldMatrix;
+            mCurrentRenderable->getWorldTransforms(mWorldMatrix);
+            mWorldMatrixCount = mCurrentRenderable->getNumWorldTransforms();
+            mWorldMatrixDirty = false;
+        }
+        return mWorldMatrixArray[0];
+    }
+    //-----------------------------------------------------------------------------
+    size_t AutoParamDataSource::getWorldMatrixCount(void) const
+    {
+        if (mWorldMatrixDirty)
+        {
+            mWorldMatrixArray = mWorldMatrix;
+            mCurrentRenderable->getWorldTransforms(mWorldMatrix);
+            mWorldMatrixCount = mCurrentRenderable->getNumWorldTransforms();
+            mWorldMatrixDirty = false;
+        }
+        return mWorldMatrixCount;
+    }
+    //-----------------------------------------------------------------------------
+    const Matrix4* AutoParamDataSource::getWorldMatrixArray(void) const
+    {
+        if (mWorldMatrixDirty)
+        {
+            mWorldMatrixArray = mWorldMatrix;
+            mCurrentRenderable->getWorldTransforms(mWorldMatrix);
+            mWorldMatrixCount = mCurrentRenderable->getNumWorldTransforms();
+            mWorldMatrixDirty = false;
+        }
+        return mWorldMatrixArray;
+    }
+    //-----------------------------------------------------------------------------
+    const Matrix4& AutoParamDataSource::getViewMatrix(void) const
+    {
+        if (mViewMatrixDirty)
+        {
+            if (mCurrentRenderable && mCurrentRenderable->getUseIdentityView())
+                mViewMatrix = Matrix4::IDENTITY;
+            else
+                mViewMatrix = mCurrentCamera->getViewMatrix(true);
+            mViewMatrixDirty = false;
+        }
+        return mViewMatrix;
+    }
+    //-----------------------------------------------------------------------------
+    const Matrix4& AutoParamDataSource::getViewProjectionMatrix(void) const
+    {
+        if (mViewProjMatrixDirty)
+        {
+            mViewProjMatrix = getProjectionMatrix() * getViewMatrix();
+            mViewProjMatrixDirty = false;
+        }
+        return mViewProjMatrix;
+    }
+    //-----------------------------------------------------------------------------
+    const Matrix4& AutoParamDataSource::getProjectionMatrix(void) const
+    {
+        if (mProjMatrixDirty)
+        {
+            // NB use API-independent projection matrix since GPU programs
+            // bypass the API-specific handedness and use right-handed coords
+            if (mCurrentRenderable && mCurrentRenderable->getUseIdentityProjection())
+            {
+                // Use identity projection matrix, still need to take RS depth into account.
+                RenderSystem* rs = Root::getSingleton().getRenderSystem();
+                rs->_convertProjectionMatrix(Matrix4::IDENTITY, mProjectionMatrix, true);
+            }
+            else
+            {
+                mProjectionMatrix = mCurrentCamera->getProjectionMatrixWithRSDepth();
+            }
+            if (mCurrentRenderTarget && mCurrentRenderTarget->requiresTextureFlipping())
+            {
+                // Because we're not using setProjectionMatrix, this needs to be done here
+                // Invert transformed y
+                mProjectionMatrix[1][0] = -mProjectionMatrix[1][0];
+                mProjectionMatrix[1][1] = -mProjectionMatrix[1][1];
+                mProjectionMatrix[1][2] = -mProjectionMatrix[1][2];
+                mProjectionMatrix[1][3] = -mProjectionMatrix[1][3];
+            }
+            mProjMatrixDirty = false;
+        }
+        return mProjectionMatrix;
+    }
+    //-----------------------------------------------------------------------------
+    const Matrix4& AutoParamDataSource::getWorldViewMatrix(void) const
+    {
+        if (mWorldViewMatrixDirty)
+        {
+            mWorldViewMatrix = getViewMatrix().concatenateAffine(getWorldMatrix());
+            mWorldViewMatrixDirty = false;
+        }
+        return mWorldViewMatrix;
+    }
+    //-----------------------------------------------------------------------------
+    const Matrix4& AutoParamDataSource::getWorldViewProjMatrix(void) const
+    {
+        if (mWorldViewProjMatrixDirty)
+        {
+            mWorldViewProjMatrix = getProjectionMatrix() * getWorldViewMatrix();
+            mWorldViewProjMatrixDirty = false;
+        }
+        return mWorldViewProjMatrix;
+    }
+    //-----------------------------------------------------------------------------
+    const Matrix4& AutoParamDataSource::getInverseWorldMatrix(void) const
+    {
+        if (mInverseWorldMatrixDirty)
+        {
+            mInverseWorldMatrix = getWorldMatrix().inverseAffine();
+            mInverseWorldMatrixDirty = false;
+        }
+        return mInverseWorldMatrix;
+    }
+    //-----------------------------------------------------------------------------
+    const Matrix4& AutoParamDataSource::getInverseWorldViewMatrix(void) const
+    {
+        if (mInverseWorldViewMatrixDirty)
+        {
+            mInverseWorldViewMatrix = getWorldViewMatrix().inverseAffine();
+            mInverseWorldViewMatrixDirty = false;
+        }
+        return mInverseWorldViewMatrix;
+    }
+    //-----------------------------------------------------------------------------
+    const Matrix4& AutoParamDataSource::getInverseViewMatrix(void) const
+    {
+        if (mInverseViewMatrixDirty)
+        {
+            mInverseViewMatrix = getViewMatrix().inverseAffine();
+            mInverseViewMatrixDirty = false;
+        }
+        return mInverseViewMatrix;
+    }
+    //-----------------------------------------------------------------------------
+    const Matrix4& AutoParamDataSource::getInverseTransposeWorldMatrix(void) const
+    {
+        if (mInverseTransposeWorldMatrixDirty)
+        {
+            mInverseTransposeWorldMatrix = getInverseWorldMatrix().transpose();
+            mInverseTransposeWorldMatrixDirty = false;
+        }
+        return mInverseTransposeWorldMatrix;
+    }
+    //-----------------------------------------------------------------------------
+    const Matrix4& AutoParamDataSource::getInverseTransposeWorldViewMatrix(void) const
+    {
+        if (mInverseTransposeWorldViewMatrixDirty)
+        {
+            mInverseTransposeWorldViewMatrix = getInverseWorldViewMatrix().transpose();
+            mInverseTransposeWorldViewMatrixDirty = false;
+        }
+        return mInverseTransposeWorldViewMatrix;
+    }
+    //-----------------------------------------------------------------------------
+    const Vector4& AutoParamDataSource::getCameraPosition(void) const
+    {
+        if(mCameraPositionDirty)
+        {
+            Vector3 vec3 = mCurrentCamera->getDerivedPosition();
+            mCameraPosition[0] = vec3[0];
+            mCameraPosition[1] = vec3[1];
+            mCameraPosition[2] = vec3[2];
+            mCameraPosition[3] = 1.0;
+            mCameraPositionDirty = false;
+        }
+        return mCameraPosition;
+    }    
+    //-----------------------------------------------------------------------------
+    const Vector4& AutoParamDataSource::getCameraPositionObjectSpace(void) const
+    {
+        if (mCameraPositionObjectSpaceDirty)
+        {
+            mCameraPositionObjectSpace = 
+                getInverseWorldMatrix().transformAffine(mCurrentCamera->getDerivedPosition());
+            mCameraPositionObjectSpaceDirty = false;
+        }
+        return mCameraPositionObjectSpace;
+    }
+    //-----------------------------------------------------------------------------
+    const Light& AutoParamDataSource::getLight(size_t index) const
+    {
+        // If outside light range, return a blank light to ensure zeroised for program
+        if (mCurrentLightList->size() <= index)
+        {
+            return mBlankLight;
+        }
+        else
+        {
+            return *((*mCurrentLightList)[index]);
+        }
+    }
+    //-----------------------------------------------------------------------------
+	void AutoParamDataSource::setAmbientLightColour(const ColourValue& ambient)
+	{
+		mAmbientLight = ambient;
+	}
+    //-----------------------------------------------------------------------------
+	const ColourValue& AutoParamDataSource::getAmbientLightColour(void) const
+	{
+		return mAmbientLight;
+		
+	}
+    //-----------------------------------------------------------------------------
+    void AutoParamDataSource::setCurrentPass(const Pass* pass)
+    {
+        mCurrentPass = pass;
+    }
+    //-----------------------------------------------------------------------------
+    const Pass* AutoParamDataSource::getCurrentPass(void) const
+    {
+        return mCurrentPass;
+    }
+    //-----------------------------------------------------------------------------
+    Vector4 AutoParamDataSource::getTextureSize(size_t index) const
+    {
+        Vector4 size = Vector4(1,1,1,1);
+
+        if (index < mCurrentPass->getNumTextureUnitStates())
+        {
+            const TexturePtr& tex = mCurrentPass->getTextureUnitState(
+				static_cast<unsigned short>(index))->_getTexturePtr();
+            if (!tex.isNull())
+            {
+                size.x = tex->getWidth();
+                size.y = tex->getHeight();
+                size.z = tex->getDepth();
+            }
+        }
+
+        return size;
+    }
+    //-----------------------------------------------------------------------------
+    Vector4 AutoParamDataSource::getInverseTextureSize(size_t index) const
+    {
+        Vector4 size = getTextureSize(index);
+        return 1 / size;
+    }
+    //-----------------------------------------------------------------------------
+    Vector4 AutoParamDataSource::getPackedTextureSize(size_t index) const
+    {
+        Vector4 size = getTextureSize(index);
+        return Vector4(size.x, size.y, 1 / size.x, 1 / size.y);
+    }
+    //-----------------------------------------------------------------------------
+    const ColourValue& AutoParamDataSource::getSurfaceAmbientColour(void) const
+    {
+        return mCurrentPass->getAmbient();
+    }
+    //-----------------------------------------------------------------------------
+    const ColourValue& AutoParamDataSource::getSurfaceDiffuseColour(void) const
+    {
+        return mCurrentPass->getDiffuse();
+    }
+    //-----------------------------------------------------------------------------
+    const ColourValue& AutoParamDataSource::getSurfaceSpecularColour(void) const
+    {
+        return mCurrentPass->getSpecular();
+    }
+    //-----------------------------------------------------------------------------
+    const ColourValue& AutoParamDataSource::getSurfaceEmissiveColour(void) const
+    {
+        return mCurrentPass->getSelfIllumination();
+    }
+    //-----------------------------------------------------------------------------
+    Real AutoParamDataSource::getSurfaceShininess(void) const
+    {
+        return mCurrentPass->getShininess();
+    }
+    //-----------------------------------------------------------------------------
+    ColourValue AutoParamDataSource::getDerivedAmbientLightColour(void) const
+    {
+        return getAmbientLightColour() * getSurfaceAmbientColour();
+    }
+    //-----------------------------------------------------------------------------
+    ColourValue AutoParamDataSource::getDerivedSceneColour(void) const
+    {
+        ColourValue result = getDerivedAmbientLightColour() + getSurfaceEmissiveColour();
+        result.a = getSurfaceDiffuseColour().a;
+        return result;
+    }
+    //-----------------------------------------------------------------------------
+    void AutoParamDataSource::setFog(FogMode mode, const ColourValue& colour,
+        Real expDensity, Real linearStart, Real linearEnd)
+    {
+        (void)mode; // ignored
+        mFogColour = colour;
+        mFogParams.x = expDensity;
+        mFogParams.y = linearStart;
+        mFogParams.z = linearEnd;
+        mFogParams.w = linearEnd != linearStart ? 1 / (linearEnd - linearStart) : 0;
+    }
+    //-----------------------------------------------------------------------------
+    const ColourValue& AutoParamDataSource::getFogColour(void) const
+    {
+        return mFogColour;
+    }
+    //-----------------------------------------------------------------------------
+    const Vector4& AutoParamDataSource::getFogParams(void) const
+    {
+        return mFogParams;
+    }
+    //-----------------------------------------------------------------------------
+    void AutoParamDataSource::setTextureProjector(const Frustum* frust, size_t index = 0)
+    {
+        mCurrentTextureProjector[index] = frust;
+        mTextureViewProjMatrixDirty[index] = true;
+
+    }
+    //-----------------------------------------------------------------------------
+    const Matrix4& AutoParamDataSource::getTextureViewProjMatrix(size_t index) const
+    {
+        if (mTextureViewProjMatrixDirty[index] && mCurrentTextureProjector[index])
+        {
+            mTextureViewProjMatrix[index] = 
+                PROJECTIONCLIPSPACE2DTOIMAGESPACE_PERSPECTIVE * 
+                mCurrentTextureProjector[index]->getProjectionMatrixWithRSDepth() * 
+				mCurrentTextureProjector[index]->getViewMatrix();
+            mTextureViewProjMatrixDirty[index] = false;
+        }
+        return mTextureViewProjMatrix[index];
+    }
+    //-----------------------------------------------------------------------------
+    void AutoParamDataSource::setCurrentRenderTarget(const RenderTarget* target)
+    {
+        mCurrentRenderTarget = target;
+    }
+    //-----------------------------------------------------------------------------
+    const RenderTarget* AutoParamDataSource::getCurrentRenderTarget(void) const
+    {
+        return mCurrentRenderTarget;
+    }
+    //-----------------------------------------------------------------------------
+    void AutoParamDataSource::setCurrentViewport(const Viewport* viewport)
+    {
+        mCurrentViewport = viewport;
+    }
+    //-----------------------------------------------------------------------------
+	void AutoParamDataSource::setShadowDirLightExtrusionDistance(Real dist)
+	{
+		mDirLightExtrusionDistance = dist;
+	}
+    //-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getShadowExtrusionDistance(void) const
+	{
+		const Light& l = getLight(0); // only ever applies to one light at once
+		if (l.getType() == Light::LT_DIRECTIONAL)
+		{
+			// use constant
+			return mDirLightExtrusionDistance;
+		}
+		else
+		{
+			// Calculate based on object space light distance
+			// compared to light attenuation range
+			Vector3 objPos = getInverseWorldMatrix().transformAffine(l.getDerivedPosition());
+			return l.getAttenuationRange() - objPos.length();
+		}
+	}
+    //-----------------------------------------------------------------------------
+    const Renderable* AutoParamDataSource::getCurrentRenderable(void) const
+    {
+        return mCurrentRenderable;
+    }
+	//-----------------------------------------------------------------------------
+	Matrix4 AutoParamDataSource::getInverseViewProjMatrix(void) const
+	{
+		return this->getViewProjectionMatrix().inverse();
+	}
+	//-----------------------------------------------------------------------------
+	Matrix4 AutoParamDataSource::getInverseTransposeViewProjMatrix(void) const
+	{
+		return this->getInverseViewProjMatrix().transpose();
+	}
+	//-----------------------------------------------------------------------------
+	Matrix4 AutoParamDataSource::getTransposeViewProjMatrix(void) const
+	{
+		return this->getViewProjectionMatrix().transpose();
+	}
+	//-----------------------------------------------------------------------------
+	Matrix4 AutoParamDataSource::getTransposeViewMatrix(void) const
+	{
+		return this->getViewMatrix().transpose();
+	}
+	//-----------------------------------------------------------------------------
+	Matrix4 AutoParamDataSource::getInverseTransposeViewMatrix(void) const
+	{
+		return this->getInverseViewMatrix().transpose();
+	}
+	//-----------------------------------------------------------------------------
+	Matrix4 AutoParamDataSource::getTransposeProjectionMatrix(void) const
+	{
+		return this->getProjectionMatrix().transpose();
+	}
+	//-----------------------------------------------------------------------------
+	Matrix4 AutoParamDataSource::getInverseProjectionMatrix(void) const 
+	{
+		return this->getProjectionMatrix().inverse();
+	}
+	//-----------------------------------------------------------------------------
+	Matrix4 AutoParamDataSource::getInverseTransposeProjectionMatrix(void) const
+	{
+		return this->getInverseProjectionMatrix().transpose();
+	}
+	//-----------------------------------------------------------------------------
+	Matrix4 AutoParamDataSource::getTransposeWorldViewProjMatrix(void) const
+	{
+		return this->getWorldViewProjMatrix().transpose();
+	}
+	//-----------------------------------------------------------------------------
+	Matrix4 AutoParamDataSource::getInverseWorldViewProjMatrix(void) const
+	{
+		return this->getWorldViewProjMatrix().inverse();
+	}
+	//-----------------------------------------------------------------------------
+	Matrix4 AutoParamDataSource::getInverseTransposeWorldViewProjMatrix(void) const
+	{
+		return this->getInverseWorldViewProjMatrix().transpose();
+	}
+	//-----------------------------------------------------------------------------
+	Matrix4 AutoParamDataSource::getTransposeWorldViewMatrix(void) const
+	{
+		return this->getWorldViewMatrix().transpose();
+	}
+	//-----------------------------------------------------------------------------
+	Matrix4 AutoParamDataSource::getTransposeWorldMatrix(void) const
+	{
+		return this->getWorldMatrix().transpose();
+	}
+    //-----------------------------------------------------------------------------
+    Real AutoParamDataSource::getTime(void) const
+    {
+        return ControllerManager::getSingleton().getElapsedTime();
+    }
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getTime_0_X(Real x) const
+	{
+		return fmod(this->getTime(), x);
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getCosTime_0_X(Real x) const
+	{ 
+		return cos(this->getTime_0_X(x)); 
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getSinTime_0_X(Real x) const
+	{ 
+		return sin(this->getTime_0_X(x)); 
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getTanTime_0_X(Real x) const
+	{ 
+		return tan(this->getTime_0_X(x)); 
+	}
+	//-----------------------------------------------------------------------------
+	Vector4 AutoParamDataSource::getTime_0_X_packed(Real x) const
+	{
+		Real t = this->getTime_0_X(x);
+		return Vector4(t, sin(t), cos(t), tan(t));
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getTime_0_1(Real x) const
+	{ 
+		return this->getTime_0_X(x)/x; 
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getCosTime_0_1(Real x) const
+	{ 
+		return cos(this->getTime_0_1(x)); 
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getSinTime_0_1(Real x) const
+	{ 
+		return sin(this->getTime_0_1(x)); 
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getTanTime_0_1(Real x) const
+	{ 
+		return tan(this->getTime_0_1(x)); 
+	}
+	//-----------------------------------------------------------------------------
+	Vector4 AutoParamDataSource::getTime_0_1_packed(Real x) const
+	{
+		Real t = this->getTime_0_1(x);
+		return Vector4(t, sin(t), cos(t), tan(t));
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getTime_0_2Pi(Real x) const
+	{ 
+		return this->getTime_0_X(x)/x*2*Math::PI; 
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getCosTime_0_2Pi(Real x) const
+	{ 
+		return cos(this->getTime_0_2Pi(x)); 
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getSinTime_0_2Pi(Real x) const
+	{ 
+		return sin(this->getTime_0_2Pi(x)); 
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getTanTime_0_2Pi(Real x) const
+	{ 
+		return tan(this->getTime_0_2Pi(x)); 
+	}
+	//-----------------------------------------------------------------------------
+	Vector4 AutoParamDataSource::getTime_0_2Pi_packed(Real x) const
+	{
+		Real t = this->getTime_0_2Pi(x);
+		return Vector4(t, sin(t), cos(t), tan(t));
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getFrameTime(void) const
+	{
+		return ControllerManager::getSingleton().getFrameTimeSource()->getValue();
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getFPS() const
+	{
+		return mCurrentRenderTarget->getLastFPS();
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getViewportWidth() const
+	{ 
+		return mCurrentViewport->getActualWidth(); 
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getViewportHeight() const
+	{ 
+		return mCurrentViewport->getActualHeight(); 
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getInverseViewportWidth() const
+	{ 
+		return 1.0f/mCurrentViewport->getActualWidth(); 
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getInverseViewportHeight() const
+	{ 
+		return 1.0f/mCurrentViewport->getActualHeight(); 
+	}
+	//-----------------------------------------------------------------------------
+	Vector3 AutoParamDataSource::getViewDirection() const
+	{
+		return mCurrentCamera->getDerivedDirection();
+	}
+	//-----------------------------------------------------------------------------
+	Vector3 AutoParamDataSource::getViewSideVector() const
+	{ 
+		return mCurrentCamera->getDerivedRight();
+	}
+	//-----------------------------------------------------------------------------
+	Vector3 AutoParamDataSource::getViewUpVector() const
+	{ 
+		return mCurrentCamera->getDerivedUp();
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getFOV() const
+	{ 
+		return mCurrentCamera->getFOVy().valueRadians(); 
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getNearClipDistance() const
+	{ 
+		return mCurrentCamera->getNearClipDistance(); 
+	}
+	//-----------------------------------------------------------------------------
+	Real AutoParamDataSource::getFarClipDistance() const
+	{ 
+		return mCurrentCamera->getFarClipDistance(); 
+	}
+	//-----------------------------------------------------------------------------
+    int AutoParamDataSource::getPassNumber(void) const
+    {
+        return mPassNumber;
+    }
+	//-----------------------------------------------------------------------------
+    void AutoParamDataSource::setPassNumber(const int passNumber)
+    {
+        mPassNumber = passNumber;
+    }
+	//-----------------------------------------------------------------------------
+    void AutoParamDataSource::incPassNumber(void)
+    {
+        ++mPassNumber;
+    }
+	//-----------------------------------------------------------------------------
+	const Vector4& AutoParamDataSource::getSceneDepthRange() const
+	{
+		if (mSceneDepthRangeDirty)
+		{
+			// calculate depth information
+			mSceneDepthRange.x = mMainCamBoundsInfo->minDistance;
+			mSceneDepthRange.y = mMainCamBoundsInfo->maxDistance;
+			mSceneDepthRange.z = mMainCamBoundsInfo->maxDistance - mMainCamBoundsInfo->minDistance;
+			mSceneDepthRange.w = 1.0f / mSceneDepthRange.z;
+			mSceneDepthRangeDirty = false;
+		}
+
+		return mSceneDepthRange;
+
+	}
+	//-----------------------------------------------------------------------------
+	const Vector4& AutoParamDataSource::getShadowSceneDepthRange(size_t lightIndex) const
+	{
+		static Vector4 dummy(0, 100000, 100000, 1/100000);
+
+		if (!mCurrentSceneManager->isShadowTechniqueTextureBased())
+			return dummy;
+
+		if (mShadowCamDepthRangesDirty)
+		{
+			mShadowCamDepthRanges.clear();
+			for (LightList::const_iterator i = mCurrentLightList->begin();
+				i != mCurrentLightList->end(); ++i)
+			{
+				// Skip non shadow casting lights
+				if (!(*i)->getCastShadows())
+					continue;
+
+				const VisibleObjectsBoundsInfo& info = 
+					mCurrentSceneManager->getShadowCasterBoundsInfo(*i);
+
+				mShadowCamDepthRanges.push_back(Vector4(
+					info.minDistance, 
+					info.maxDistance, 
+					info.maxDistance - info.minDistance,
+					1.0f / (info.maxDistance - info.minDistance)));
+			}
+
+			mShadowCamDepthRangesDirty = false;
+		}
+
+		if (lightIndex >= mShadowCamDepthRanges.size())
+		{
+			return dummy;
+		}
+		else
+		{
+			return mShadowCamDepthRanges[lightIndex];
+		}
+
+	}
+
+}
+
Index: /OgreMain/src/OgreBillboard.cpp
===================================================================
--- /OgreMain/src/OgreBillboard.cpp	(revision 5)
+++ /OgreMain/src/OgreBillboard.cpp	(revision 5)
@@ -0,0 +1,147 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreBillboard.h"
+
+#include "OgreBillboardSet.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    Billboard::Billboard():
+        mOwnDimensions(false),
+        mUseTexcoordRect(false),
+        mTexcoordIndex(0),
+		mPosition(Vector3::ZERO),
+        mDirection(Vector3::ZERO),        
+        mParentSet(0),
+        mColour(ColourValue::White),
+		mRotation(0)
+    {
+    }
+    //-----------------------------------------------------------------------
+    Billboard::~Billboard()
+    {
+    }
+    //-----------------------------------------------------------------------
+    Billboard::Billboard(const Vector3& position, BillboardSet* owner, const ColourValue& colour)
+        : mOwnDimensions(false)
+        , mUseTexcoordRect(false)
+        , mTexcoordIndex(0)
+        , mPosition(position)
+        , mDirection(Vector3::ZERO)
+        , mParentSet(owner)
+        , mColour(colour)
+        , mRotation(0)
+    {
+    }
+    //-----------------------------------------------------------------------
+    void Billboard::setRotation(const Radian& rotation)
+    {
+        mRotation = rotation;
+        if (mRotation != Radian(0))
+            mParentSet->_notifyBillboardRotated();
+    }
+    //-----------------------------------------------------------------------
+    void Billboard::setPosition(const Vector3& position)
+    {
+        mPosition = position;
+    }
+    //-----------------------------------------------------------------------
+    void Billboard::setPosition(Real x, Real y, Real z)
+    {
+        mPosition.x = x;
+        mPosition.y = y;
+        mPosition.z = z;
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& Billboard::getPosition(void) const
+    {
+        return mPosition;
+    }
+    //-----------------------------------------------------------------------
+    void Billboard::setDimensions(Real width, Real height)
+    {
+        mOwnDimensions = true;
+        mWidth = width;
+        mHeight = height;
+        mParentSet->_notifyBillboardResized();
+    }
+    //-----------------------------------------------------------------------
+    bool Billboard::hasOwnDimensions(void) const
+    {
+        return mOwnDimensions;
+    }
+    //-----------------------------------------------------------------------
+    void Billboard::_notifyOwner(BillboardSet* owner)
+    {
+        mParentSet = owner;
+    }
+    //-----------------------------------------------------------------------
+    void Billboard::setColour(const ColourValue& colour)
+    {
+        mColour = colour;
+    }
+    //-----------------------------------------------------------------------
+    const ColourValue& Billboard::getColour(void) const
+    {
+        return mColour;
+    }
+    //-----------------------------------------------------------------------
+    Real Billboard::getOwnWidth(void) const
+    {
+        return mWidth;
+    }
+    //-----------------------------------------------------------------------
+    Real Billboard::getOwnHeight(void) const
+    {
+        return mHeight;
+    }
+    //-----------------------------------------------------------------------
+    void Billboard::setTexcoordIndex(uint16 texcoordIndex)
+    {
+        mTexcoordIndex = texcoordIndex;
+        mUseTexcoordRect = false;
+    }
+    //-----------------------------------------------------------------------
+    void Billboard::setTexcoordRect(const FloatRect& texcoordRect)
+    {
+        mTexcoordRect = texcoordRect;
+        mUseTexcoordRect = true;
+    }
+    //-----------------------------------------------------------------------
+    void Billboard::setTexcoordRect(Real u0, Real v0, Real u1, Real v1)
+    {
+        setTexcoordRect(FloatRect(u0, v0, u1, v1));
+    }
+
+
+}
+
Index: /OgreMain/src/OgreBillboardChain.cpp
===================================================================
--- /OgreMain/src/OgreBillboardChain.cpp	(revision 5)
+++ /OgreMain/src/OgreBillboardChain.cpp	(revision 5)
@@ -0,0 +1,812 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+// Thanks to Vincent Cantin (karmaGfa) for the original implementation of this
+// class, although it has now been mostly rewritten
+
+#include "OgreStableHeaders.h"
+#include "OgreBillboardChain.h"
+
+#include "OgreSimpleRenderable.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreNode.h"
+#include "OgreCamera.h"
+#include "OgreRoot.h"
+#include "OgreMaterialManager.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+
+namespace Ogre {
+	const size_t BillboardChain::SEGMENT_EMPTY = 0xffffffff;
+	//-----------------------------------------------------------------------
+	BillboardChain::Element::Element()
+	{
+	}
+	//-----------------------------------------------------------------------
+	BillboardChain::Element::Element(Vector3 _position,
+		Real _width,
+		Real _texCoord,
+		ColourValue _colour) :
+	position(_position),
+		width(_width),
+		texCoord(_texCoord),
+		colour(_colour)
+	{
+	}
+	//-----------------------------------------------------------------------
+	BillboardChain::BillboardChain(const String& name, size_t maxElements,
+		size_t numberOfChains, bool useTextureCoords, bool useColours, bool dynamic)
+		:MovableObject(name),
+		mMaxElementsPerChain(maxElements),
+		mChainCount(numberOfChains),
+		mUseTexCoords(useTextureCoords),
+		mUseVertexColour(useColours),
+		mDynamic(dynamic),
+		mVertexDeclDirty(true),
+		mBuffersNeedRecreating(true),
+		mBoundsDirty(true),
+		mIndexContentDirty(true),
+		mRadius(0.0f),
+		mTexCoordDir(TCD_U)
+	{
+		mVertexData = new VertexData();
+		mIndexData = new IndexData();
+
+		mOtherTexCoordRange[0] = 0.0f;
+		mOtherTexCoordRange[1] = 1.0f;
+
+		setupChainContainers();
+
+		mVertexData->vertexStart = 0;
+		// index data set up later
+		// set basic white material
+		this->setMaterialName("BaseWhiteNoLighting");
+
+	}
+	//-----------------------------------------------------------------------
+	BillboardChain::~BillboardChain()
+	{
+		delete mVertexData;
+		delete mIndexData;
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::setupChainContainers(void)
+	{
+		// Allocate enough space for everything
+		mChainElementList.resize(mChainCount * mMaxElementsPerChain);
+		mVertexData->vertexCount = mChainElementList.size() * 2;
+
+		// Configure chains
+		mChainSegmentList.resize(mChainCount);
+		for (size_t i = 0; i < mChainCount; ++i)
+		{
+			ChainSegment& seg = mChainSegmentList[i];
+			seg.start = i * mMaxElementsPerChain;
+			seg.tail = seg.head = SEGMENT_EMPTY;
+
+		}
+
+
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::setupVertexDeclaration(void)
+	{
+		if (mVertexDeclDirty)
+		{
+			VertexDeclaration* decl = mVertexData->vertexDeclaration;
+			decl->removeAllElements();
+
+			size_t offset = 0;
+			// Add a description for the buffer of the positions of the vertices
+			decl->addElement(0, offset, VET_FLOAT3, VES_POSITION);
+			offset += VertexElement::getTypeSize(VET_FLOAT3);
+
+			if (mUseVertexColour)
+			{
+				decl->addElement(0, offset, VET_COLOUR, VES_DIFFUSE);
+				offset += VertexElement::getTypeSize(VET_COLOUR);
+			}
+
+			if (mUseTexCoords)
+			{
+				decl->addElement(0, offset, VET_FLOAT2, VES_TEXTURE_COORDINATES);
+				offset += VertexElement::getTypeSize(VET_FLOAT2);
+			}
+
+			if (!mUseTexCoords && !mUseVertexColour)
+			{
+				LogManager::getSingleton().logMessage(
+					"Error - BillboardChain '" + mName + "' is using neither "
+					"texture coordinates or vertex colours; it will not be "
+					"visible on some rendering APIs so you should change this "
+					"so you use one or the other.");
+			}
+			mVertexDeclDirty = false;
+		}
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::setupBuffers(void)
+	{
+		setupVertexDeclaration();
+		if (mBuffersNeedRecreating)
+		{
+			// Create the vertex buffer (always dynamic due to the camera adjust)
+			HardwareVertexBufferSharedPtr pBuffer =
+				HardwareBufferManager::getSingleton().createVertexBuffer(
+				mVertexData->vertexDeclaration->getVertexSize(0),
+				mVertexData->vertexCount,
+				HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE);
+
+			// (re)Bind the buffer
+			// Any existing buffer will lose its reference count and be destroyed
+			mVertexData->vertexBufferBinding->setBinding(0, pBuffer);
+
+			mIndexData->indexBuffer =
+				HardwareBufferManager::getSingleton().createIndexBuffer(
+					HardwareIndexBuffer::IT_16BIT,
+					mChainCount * mMaxElementsPerChain * 6, // max we can use
+					mDynamic? HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY : HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+			// NB we don't set the indexCount on IndexData here since we will
+			// probably use less than the maximum number of indices
+
+			mBuffersNeedRecreating = false;
+		}
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::setMaxChainElements(size_t maxElements)
+	{
+		mMaxElementsPerChain = maxElements;
+		setupChainContainers();
+        mBuffersNeedRecreating = mIndexContentDirty = true;
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::setNumberOfChains(size_t numChains)
+	{
+		mChainCount = numChains;
+		setupChainContainers();
+        mBuffersNeedRecreating = mIndexContentDirty = true;
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::setUseTextureCoords(bool use)
+	{
+		mUseTexCoords = use;
+		mVertexDeclDirty = mBuffersNeedRecreating = true;
+        mIndexContentDirty = true;
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::setTextureCoordDirection(BillboardChain::TexCoordDirection dir)
+	{
+		mTexCoordDir = dir;
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::setOtherTextureCoordRange(Real start, Real end)
+	{
+		mOtherTexCoordRange[0] = start;
+		mOtherTexCoordRange[1] = end;
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::setUseVertexColours(bool use)
+	{
+		mUseVertexColour = use;
+		mVertexDeclDirty = mBuffersNeedRecreating = true;
+        mIndexContentDirty = true;
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::setDynamic(bool dyn)
+	{
+		mDynamic = dyn;
+		mBuffersNeedRecreating = mIndexContentDirty = true;
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::addChainElement(size_t chainIndex,
+		const BillboardChain::Element& dtls)
+	{
+
+		if (chainIndex >= mChainCount)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+				"chainIndex out of bounds",
+				"BillboardChain::addChainElement");
+		}
+		ChainSegment& seg = mChainSegmentList[chainIndex];
+		if (seg.head == SEGMENT_EMPTY)
+		{
+			// Tail starts at end, head grows backwards
+			seg.tail = mMaxElementsPerChain - 1;
+			seg.head = seg.tail;
+			mIndexContentDirty = true;
+		}
+		else
+		{
+			if (seg.head == 0)
+			{
+				// Wrap backwards
+				seg.head = mMaxElementsPerChain - 1;
+			}
+			else
+			{
+				// Just step backward
+				--seg.head;
+			}
+			// Run out of elements?
+			if (seg.head == seg.tail)
+			{
+				// Move tail backwards too, losing the end of the segment and re-using
+				// it in the head
+				if (seg.tail == 0)
+					seg.tail = mMaxElementsPerChain - 1;
+				else
+					--seg.tail;
+			}
+		}
+
+		// Set the details
+		mChainElementList[seg.start + seg.head] = dtls;
+
+		mIndexContentDirty = true;
+		mBoundsDirty = true;
+		// tell parent node to update bounds
+		if (mParentNode)
+			mParentNode->needUpdate();
+
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::removeChainElement(size_t chainIndex)
+	{
+		if (chainIndex >= mChainCount)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+				"chainIndex out of bounds",
+				"BillboardChain::removeChainElement");
+		}
+		ChainSegment& seg = mChainSegmentList[chainIndex];
+		if (seg.head == SEGMENT_EMPTY)
+			return; // do nothing, nothing to remove
+
+
+		if (seg.tail == seg.head)
+		{
+			// last item
+			seg.head = seg.tail = SEGMENT_EMPTY;
+		}
+		else if (seg.tail == 0)
+		{
+			seg.tail = mMaxElementsPerChain - 1;
+		}
+		else
+		{
+			--seg.tail;
+		}
+
+		// we removed an entry so indexes need updating
+		mIndexContentDirty = true;
+		mBoundsDirty = true;
+		// tell parent node to update bounds
+		if (mParentNode)
+			mParentNode->needUpdate();
+
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::clearChain(size_t chainIndex)
+	{
+		if (chainIndex >= mChainCount)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+				"chainIndex out of bounds",
+				"BillboardChain::removeChainElement");
+		}
+		ChainSegment& seg = mChainSegmentList[chainIndex];
+
+		// Just reset head & tail
+		seg.tail = seg.head = SEGMENT_EMPTY;
+
+		// we removed an entry so indexes need updating
+		mIndexContentDirty = true;
+		mBoundsDirty = true;
+		// tell parent node to update bounds
+		if (mParentNode)
+			mParentNode->needUpdate();
+
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::clearAllChains(void)
+	{
+		for (size_t i = 0; i < mChainCount; ++i)
+		{
+			clearChain(i);
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::updateChainElement(size_t chainIndex, size_t elementIndex,
+		const BillboardChain::Element& dtls)
+	{
+		if (chainIndex >= mChainCount)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+				"chainIndex out of bounds",
+				"BillboardChain::updateChainElement");
+		}
+		ChainSegment& seg = mChainSegmentList[chainIndex];
+		if (seg.head == SEGMENT_EMPTY)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+				"Chain segment is empty",
+				"BillboardChain::updateChainElement");
+		}
+
+		size_t idx = seg.head + elementIndex;
+		// adjust for the edge and start
+		idx = (idx % mMaxElementsPerChain) + seg.start;
+
+		mChainElementList[idx] = dtls;
+
+		mBoundsDirty = true;
+		// tell parent node to update bounds
+		if (mParentNode)
+			mParentNode->needUpdate();
+
+
+	}
+	//-----------------------------------------------------------------------
+	const BillboardChain::Element&
+	BillboardChain::getChainElement(size_t chainIndex, size_t elementIndex) const
+	{
+
+		if (chainIndex >= mChainCount)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+				"chainIndex out of bounds",
+				"BillboardChain::updateChainElement");
+		}
+		const ChainSegment& seg = mChainSegmentList[chainIndex];
+
+		size_t idx = seg.head + elementIndex;
+		// adjust for the edge and start
+		idx = (idx % mMaxElementsPerChain) + seg.start;
+
+		return mChainElementList[idx];
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::updateBoundingBox(void) const
+	{
+		if (mBoundsDirty)
+		{
+			mAABB.setNull();
+			Vector3 widthVector;
+			for (ChainSegmentList::const_iterator segi = mChainSegmentList.begin();
+				segi != mChainSegmentList.end(); ++segi)
+			{
+				const ChainSegment& seg = *segi;
+
+				if (seg.head != SEGMENT_EMPTY)
+				{
+
+					for(size_t e = seg.head; ; ++e) // until break
+					{
+						// Wrap forwards
+						if (e == mMaxElementsPerChain)
+							e = 0;
+
+						const Element& elem = mChainElementList[seg.start + e];
+
+						widthVector.x = widthVector.y = widthVector.z = elem.width;
+						mAABB.merge(elem.position - widthVector);
+						mAABB.merge(elem.position + widthVector);
+
+						if (e == seg.tail)
+							break;
+
+					}
+				}
+
+			}
+
+			// Set the current radius
+			if (mAABB.isNull())
+			{
+				mRadius = 0.0f;
+			}
+			else
+			{
+				mRadius = Math::Sqrt(
+					std::max(mAABB.getMinimum().squaredLength(),
+					mAABB.getMaximum().squaredLength()));
+			}
+
+			mBoundsDirty = false;
+		}
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::updateVertexBuffer(Camera* cam)
+	{
+		setupBuffers();
+		HardwareVertexBufferSharedPtr pBuffer =
+			mVertexData->vertexBufferBinding->getBuffer(0);
+		void* pBufferStart = pBuffer->lock(HardwareBuffer::HBL_DISCARD);
+
+		const Vector3& camPos = cam->getDerivedPosition();
+		Vector3 eyePos = mParentNode->_getDerivedOrientation().Inverse() *
+			(camPos - mParentNode->_getDerivedPosition()) / mParentNode->_getDerivedScale();
+
+		Vector3 chainTangent;
+		for (ChainSegmentList::iterator segi = mChainSegmentList.begin();
+			segi != mChainSegmentList.end(); ++segi)
+		{
+			ChainSegment& seg = *segi;
+
+			// Skip 0 or 1 element segment counts
+			if (seg.head != SEGMENT_EMPTY && seg.head != seg.tail)
+			{
+				size_t laste = seg.head;
+				for (size_t e = seg.head; ; ++e) // until break
+				{
+					// Wrap forwards
+					if (e == mMaxElementsPerChain)
+						e = 0;
+
+					Element& elem = mChainElementList[e + seg.start];
+					assert (((e + seg.start) * 2) < 65536 && "Too many elements!");
+					uint16 baseIdx = static_cast<uint16>((e + seg.start) * 2);
+
+					// Determine base pointer to vertex #1
+					void* pBase = static_cast<void*>(
+						static_cast<char*>(pBufferStart) +
+							pBuffer->getVertexSize() * baseIdx);
+
+					// Get index of next item
+					size_t nexte = e + 1;
+					if (nexte == mMaxElementsPerChain)
+						nexte = 0;
+
+					if (e == seg.head)
+					{
+						// No laste, use next item
+						chainTangent = mChainElementList[nexte + seg.start].position - elem.position;
+					}
+					else if (e == seg.tail)
+					{
+						// No nexte, use only last item
+						chainTangent = elem.position - mChainElementList[laste + seg.start].position;
+					}
+					else
+					{
+						// A mid position, use tangent across both prev and next
+						chainTangent = mChainElementList[nexte + seg.start].position - mChainElementList[laste + seg.start].position;
+
+					}
+
+					Vector3 vP1ToEye = eyePos - elem.position;
+					Vector3 vPerpendicular = chainTangent.crossProduct(vP1ToEye);
+					vPerpendicular.normalise();
+					vPerpendicular *= (elem.width * 0.5);
+
+					Vector3 pos0 = elem.position - vPerpendicular;
+					Vector3 pos1 = elem.position + vPerpendicular;
+
+					float* pFloat = static_cast<float*>(pBase);
+					// pos1
+					*pFloat++ = pos0.x;
+					*pFloat++ = pos0.y;
+					*pFloat++ = pos0.z;
+
+					pBase = static_cast<void*>(pFloat);
+
+					if (mUseVertexColour)
+					{
+						RGBA* pCol = static_cast<RGBA*>(pBase);
+						Root::getSingleton().convertColourValue(elem.colour, pCol);
+						pCol++;
+						pBase = static_cast<void*>(pCol);
+					}
+
+					if (mUseTexCoords)
+					{
+						pFloat = static_cast<float*>(pBase);
+						if (mTexCoordDir == TCD_U)
+						{
+							*pFloat++ = elem.texCoord;
+							*pFloat++ = mOtherTexCoordRange[0];
+						}
+						else
+						{
+							*pFloat++ = mOtherTexCoordRange[0];
+							*pFloat++ = elem.texCoord;
+						}
+						pBase = static_cast<void*>(pFloat);
+					}
+
+					// pos2
+					pFloat = static_cast<float*>(pBase);
+					*pFloat++ = pos1.x;
+					*pFloat++ = pos1.y;
+					*pFloat++ = pos1.z;
+					pBase = static_cast<void*>(pFloat);
+
+					if (mUseVertexColour)
+					{
+						RGBA* pCol = static_cast<RGBA*>(pBase);
+						Root::getSingleton().convertColourValue(elem.colour, pCol);
+						pCol++;
+						pBase = static_cast<void*>(pCol);
+					}
+
+					if (mUseTexCoords)
+					{
+						pFloat = static_cast<float*>(pBase);
+						if (mTexCoordDir == TCD_U)
+						{
+							*pFloat++ = elem.texCoord;
+							*pFloat++ = mOtherTexCoordRange[1];
+						}
+						else
+						{
+							*pFloat++ = mOtherTexCoordRange[1];
+							*pFloat++ = elem.texCoord;
+						}
+						pBase = static_cast<void*>(pFloat);
+					}
+
+					if (e == seg.tail)
+						break; // last one
+
+					laste = e;
+
+				} // element
+			} // segment valid?
+
+		} // each segment
+
+
+
+		pBuffer->unlock();
+
+
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::updateIndexBuffer(void)
+	{
+
+		setupBuffers();
+		if (mIndexContentDirty)
+		{
+
+			uint16* pShort = static_cast<uint16*>(
+				mIndexData->indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+			mIndexData->indexCount = 0;
+			// indexes
+			for (ChainSegmentList::iterator segi = mChainSegmentList.begin();
+				segi != mChainSegmentList.end(); ++segi)
+			{
+				ChainSegment& seg = *segi;
+
+				// Skip 0 or 1 element segment counts
+				if (seg.head != SEGMENT_EMPTY && seg.head != seg.tail)
+				{
+					// Start from head + 1 since it's only useful in pairs
+					size_t laste = seg.head;
+					while(1) // until break
+					{
+						size_t e = laste + 1;
+						// Wrap forwards
+						if (e == mMaxElementsPerChain)
+							e = 0;
+						// indexes of this element are (e * 2) and (e * 2) + 1
+						// indexes of the last element are the same, -2
+						assert (((e + seg.start) * 2) < 65536 && "Too many elements!");
+						uint16 baseIdx = static_cast<uint16>((e + seg.start) * 2);
+						uint16 lastBaseIdx = static_cast<uint16>((laste + seg.start) * 2);
+						*pShort++ = lastBaseIdx;
+						*pShort++ = lastBaseIdx + 1;
+						*pShort++ = baseIdx;
+						*pShort++ = lastBaseIdx + 1;
+						*pShort++ = baseIdx + 1;
+						*pShort++ = baseIdx;
+
+						mIndexData->indexCount += 6;
+
+
+						if (e == seg.tail)
+							break; // last one
+
+						laste = e;
+
+					}
+				}
+
+			}
+			mIndexData->indexBuffer->unlock();
+
+			mIndexContentDirty = false;
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::_notifyCurrentCamera(Camera* cam)
+	{
+		updateVertexBuffer(cam);
+	}
+	//-----------------------------------------------------------------------
+	Real BillboardChain::getSquaredViewDepth(const Camera* cam) const
+	{
+		Vector3 min, max, mid, dist;
+		min = mAABB.getMinimum();
+		max = mAABB.getMaximum();
+		mid = ((max - min) * 0.5) + min;
+		dist = cam->getDerivedPosition() - mid;
+
+		return dist.squaredLength();
+	}
+	//-----------------------------------------------------------------------
+	Real BillboardChain::getBoundingRadius(void) const
+	{
+		return mRadius;
+	}
+	//-----------------------------------------------------------------------
+	const AxisAlignedBox& BillboardChain::getBoundingBox(void) const
+	{
+		updateBoundingBox();
+		return mAABB;
+	}
+	//-----------------------------------------------------------------------
+	const MaterialPtr& BillboardChain::getMaterial(void) const
+	{
+		return mMaterial;
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::setMaterialName(const String& name)
+	{
+		mMaterialName = name;
+		mMaterial = MaterialManager::getSingleton().getByName(mMaterialName);
+
+		if (mMaterial.isNull())
+		{
+			LogManager::getSingleton().logMessage("Can't assign material " + name +
+				" to BillboardChain " + mName + " because this "
+				"Material does not exist. Have you forgotten to define it in a "
+				".material script?");
+			mMaterial = MaterialManager::getSingleton().getByName("BaseWhiteNoLighting");
+			if (mMaterial.isNull())
+			{
+				OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Can't assign default material "
+					"to BillboardChain of " + mName + ". Did "
+					"you forget to call MaterialManager::initialise()?",
+					"BillboardChain.setMaterialName");
+			}
+		}
+		// Ensure new material loaded (will not load again if already loaded)
+		mMaterial->load();
+	}
+	//-----------------------------------------------------------------------
+	const String& BillboardChain::getMovableType(void) const
+	{
+		return BillboardChainFactory::FACTORY_TYPE_NAME;
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::_updateRenderQueue(RenderQueue* queue)
+	{
+		updateIndexBuffer();
+
+		if (mIndexData->indexCount > 0)
+		{
+            if (mRenderQueueIDSet)
+                queue->addRenderable(this, mRenderQueueID);
+            else
+                queue->addRenderable(this);
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::getRenderOperation(RenderOperation& op)
+	{
+		op.indexData = mIndexData;
+		op.operationType = RenderOperation::OT_TRIANGLE_LIST;
+		op.srcRenderable = this;
+		op.useIndexes = true;
+		op.vertexData = mVertexData;
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChain::getWorldTransforms(Matrix4* xform) const
+	{
+		*xform = _getParentNodeFullTransform();
+	}
+	//-----------------------------------------------------------------------
+	const Quaternion& BillboardChain::getWorldOrientation(void) const
+	{
+		return getParentNode()->_getDerivedOrientation();
+	}
+	//-----------------------------------------------------------------------
+	const Vector3& BillboardChain::getWorldPosition(void) const
+	{
+		return getParentNode()->_getDerivedPosition();
+	}
+	//-----------------------------------------------------------------------
+	const LightList& BillboardChain::getLights(void) const
+	{
+		return queryLights();
+	}
+	//-----------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	String BillboardChainFactory::FACTORY_TYPE_NAME = "BillboardChain";
+	//-----------------------------------------------------------------------
+	const String& BillboardChainFactory::getType(void) const
+	{
+		return FACTORY_TYPE_NAME;
+	}
+	//-----------------------------------------------------------------------
+	MovableObject* BillboardChainFactory::createInstanceImpl( const String& name,
+		const NameValuePairList* params)
+	{
+		size_t maxElements = 20;
+		size_t numberOfChains = 1;
+		bool useTex = true;
+		bool useCol = true;
+		bool dynamic = true;
+		// optional params
+		if (params != 0)
+		{
+			NameValuePairList::const_iterator ni = params->find("maxElements");
+			if (ni != params->end())
+			{
+				maxElements = StringConverter::parseUnsignedLong(ni->second);
+			}
+			ni = params->find("numberOfChains");
+			if (ni != params->end())
+			{
+				numberOfChains = StringConverter::parseUnsignedLong(ni->second);
+			}
+			ni = params->find("useTextureCoords");
+			if (ni != params->end())
+			{
+				useTex = StringConverter::parseBool(ni->second);
+			}
+			ni = params->find("useVertexColours");
+			if (ni != params->end())
+			{
+				useCol = StringConverter::parseBool(ni->second);
+			}
+			ni = params->find("dynamic");
+			if (ni != params->end())
+			{
+				dynamic = StringConverter::parseBool(ni->second);
+			}
+
+		}
+
+		return new BillboardChain(name, maxElements, numberOfChains, useTex, useCol, dynamic);
+
+	}
+	//-----------------------------------------------------------------------
+	void BillboardChainFactory::destroyInstance( MovableObject* obj)
+	{
+		delete obj;
+	}
+
+}
+
Index: /OgreMain/src/OgreBillboardParticleRenderer.cpp
===================================================================
--- /OgreMain/src/OgreBillboardParticleRenderer.cpp	(revision 5)
+++ /OgreMain/src/OgreBillboardParticleRenderer.cpp	(revision 5)
@@ -0,0 +1,480 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreBillboardParticleRenderer.h"
+#include "OgreParticle.h"
+#include "OgreStringConverter.h"
+
+namespace Ogre {
+    String rendererTypeName = "billboard";
+
+    //-----------------------------------------------------------------------
+    BillboardParticleRenderer::CmdBillboardType BillboardParticleRenderer::msBillboardTypeCmd;
+    BillboardParticleRenderer::CmdBillboardOrigin BillboardParticleRenderer::msBillboardOriginCmd;
+    BillboardParticleRenderer::CmdBillboardRotationType BillboardParticleRenderer::msBillboardRotationTypeCmd;
+    BillboardParticleRenderer::CmdCommonDirection BillboardParticleRenderer::msCommonDirectionCmd;
+    BillboardParticleRenderer::CmdCommonUpVector BillboardParticleRenderer::msCommonUpVectorCmd;
+    BillboardParticleRenderer::CmdPointRendering BillboardParticleRenderer::msPointRenderingCmd;
+	BillboardParticleRenderer::CmdAccurateFacing BillboardParticleRenderer::msAccurateFacingCmd;
+    //-----------------------------------------------------------------------
+    BillboardParticleRenderer::BillboardParticleRenderer()
+    {
+        if (createParamDictionary("BillboardParticleRenderer"))
+        {
+            ParamDictionary* dict = getParamDictionary();
+            dict->addParameter(ParameterDef("billboard_type", 
+                "The type of billboard to use. 'point' means a simulated spherical particle, " 
+                "'oriented_common' means all particles in the set are oriented around common_direction, "
+                "'oriented_self' means particles are oriented around their own direction, "
+                "'perpendicular_common' means all particles are perpendicular to common_direction, "
+                "and 'perpendicular_self' means particles are perpendicular to their own direction.",
+                PT_STRING),
+                &msBillboardTypeCmd);
+
+            dict->addParameter(ParameterDef("billboard_origin", 
+                "This setting controls the fine tuning of where a billboard appears in relation to it's position. "
+                "Possible value are: 'top_left', 'top_center', 'top_right', 'center_left', 'center', 'center_right', "
+                "'bottom_left', 'bottom_center' and 'bottom_right'. Default value is 'center'.",
+                PT_STRING),
+                &msBillboardOriginCmd);
+
+            dict->addParameter(ParameterDef("billboard_rotation_type", 
+                "This setting controls the billboard rotation type. "
+				"'vertex' means rotate the billboard's vertices around their facing direction."
+                "'texcoord' means rotate the billboard's texture coordinates. Default value is 'texcoord'.",
+                PT_STRING),
+                &msBillboardRotationTypeCmd);
+
+            dict->addParameter(ParameterDef("common_direction", 
+                "Only useful when billboard_type is oriented_common or perpendicular_common. "
+				"When billboard_type is oriented_common, this parameter sets the common orientation for "
+				"all particles in the set (e.g. raindrops may all be oriented downwards). "
+				"When billboard_type is perpendicular_common, this parameter sets the perpendicular vector for "
+				"all particles in the set (e.g. an aureola around the player and parallel to the ground).",
+                PT_VECTOR3),
+                &msCommonDirectionCmd);
+
+            dict->addParameter(ParameterDef("common_up_vector",
+                "Only useful when billboard_type is perpendicular_self or perpendicular_common. This "
+				"parameter sets the common up-vector for all particles in the set (e.g. an aureola around "
+				"the player and parallel to the ground).",
+                PT_VECTOR3),
+                &msCommonUpVectorCmd);
+            dict->addParameter(ParameterDef("point_rendering",
+                "Set whether or not particles will use point rendering "
+				"rather than manually generated quads. This allows for faster "
+				"rendering of point-oriented particles although introduces some "
+				"limitations too such as requiring a common particle size."
+				"Possible values are 'true' or 'false'.",
+                PT_BOOL),
+                &msPointRenderingCmd);
+			dict->addParameter(ParameterDef("accurate_facing",
+				"Set whether or not particles will be oriented to the camera "
+				"based on the relative position to the camera rather than just "
+				"the camera direction. This is more accurate but less optimal. "
+				"Cannot be combined with point rendering.",
+				PT_BOOL),
+				&msAccurateFacingCmd);
+        }
+
+        // Create billboard set
+        mBillboardSet = new BillboardSet("", 0, true);
+        // World-relative axes
+        mBillboardSet->setBillboardsInWorldSpace(true);
+    }
+    //-----------------------------------------------------------------------
+    BillboardParticleRenderer::~BillboardParticleRenderer()
+    {
+        delete mBillboardSet;
+    }
+    //-----------------------------------------------------------------------
+    const String& BillboardParticleRenderer::getType(void) const
+    {
+        return rendererTypeName;
+    }
+    //-----------------------------------------------------------------------
+    void BillboardParticleRenderer::_updateRenderQueue(RenderQueue* queue, 
+        std::list<Particle*>& currentParticles, bool cullIndividually)
+    {
+        mBillboardSet->setCullIndividually(cullIndividually);
+
+        // Update billboard set geometry
+        mBillboardSet->beginBillboards(currentParticles.size());
+        Billboard bb;
+        for (std::list<Particle*>::iterator i = currentParticles.begin();
+            i != currentParticles.end(); ++i)
+        {
+            Particle* p = *i;
+            bb.mPosition = p->position;
+			if (mBillboardSet->getBillboardType() == BBT_ORIENTED_SELF ||
+				mBillboardSet->getBillboardType() == BBT_PERPENDICULAR_SELF)
+			{
+				// Normalise direction vector
+				bb.mDirection = p->direction;
+				bb.mDirection.normalise();
+			}
+            bb.mColour = p->colour;
+            bb.mRotation = p->rotation;
+            // Assign and compare at the same time
+            if (bb.mOwnDimensions = p->mOwnDimensions)
+            {
+                bb.mWidth = p->mWidth;
+                bb.mHeight = p->mHeight;
+            }
+            mBillboardSet->injectBillboard(bb);
+
+        }
+        
+        mBillboardSet->endBillboards();
+
+        // Update the queue
+        mBillboardSet->_updateRenderQueue(queue);
+    }
+    //-----------------------------------------------------------------------
+    void BillboardParticleRenderer::_setMaterial(MaterialPtr& mat)
+    {
+        mBillboardSet->setMaterialName(mat->getName());
+    }
+    //-----------------------------------------------------------------------
+    void BillboardParticleRenderer::setBillboardType(BillboardType bbt)
+    {
+        mBillboardSet->setBillboardType(bbt);
+    }
+	//-----------------------------------------------------------------------
+	void BillboardParticleRenderer::setUseAccurateFacing(bool acc)
+	{
+		mBillboardSet->setUseAccurateFacing(acc);
+	}
+	//-----------------------------------------------------------------------
+	bool BillboardParticleRenderer::getUseAccurateFacing(void) const
+	{
+		return mBillboardSet->getUseAccurateFacing();
+	}
+    //-----------------------------------------------------------------------
+    BillboardType BillboardParticleRenderer::getBillboardType(void) const
+    {
+        return mBillboardSet->getBillboardType();
+    }
+    //-----------------------------------------------------------------------
+    void BillboardParticleRenderer::setBillboardRotationType(BillboardRotationType rotationType)
+    {
+        mBillboardSet->setBillboardRotationType(rotationType);
+    }
+    //-----------------------------------------------------------------------
+    BillboardRotationType BillboardParticleRenderer::getBillboardRotationType(void) const
+    {
+        return mBillboardSet->getBillboardRotationType();
+    }
+    //-----------------------------------------------------------------------
+    void BillboardParticleRenderer::setCommonDirection(const Vector3& vec)
+    {
+        mBillboardSet->setCommonDirection(vec);
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& BillboardParticleRenderer::getCommonDirection(void) const
+    {
+        return mBillboardSet->getCommonDirection();
+    }
+    //-----------------------------------------------------------------------
+    void BillboardParticleRenderer::setCommonUpVector(const Vector3& vec)
+    {
+        mBillboardSet->setCommonUpVector(vec);
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& BillboardParticleRenderer::getCommonUpVector(void) const
+    {
+        return mBillboardSet->getCommonUpVector();
+    }
+    //-----------------------------------------------------------------------
+    void BillboardParticleRenderer::_notifyCurrentCamera(Camera* cam)
+    {
+        mBillboardSet->_notifyCurrentCamera(cam);
+    }
+    //-----------------------------------------------------------------------
+    void BillboardParticleRenderer::_notifyParticleRotated(void)
+    {
+        mBillboardSet->_notifyBillboardRotated();
+    }
+    //-----------------------------------------------------------------------
+    void BillboardParticleRenderer::_notifyDefaultDimensions(Real width, Real height)
+    {
+        mBillboardSet->setDefaultDimensions(width, height);
+    }
+    //-----------------------------------------------------------------------
+    void BillboardParticleRenderer::_notifyParticleResized(void)
+    {
+        mBillboardSet->_notifyBillboardResized();
+    }
+    //-----------------------------------------------------------------------
+    void BillboardParticleRenderer::_notifyParticleQuota(size_t quota)
+    {
+        mBillboardSet->setPoolSize(quota);
+    }
+    //-----------------------------------------------------------------------
+    void BillboardParticleRenderer::_notifyAttached(Node* parent, bool isTagPoint)
+    {
+        mBillboardSet->_notifyAttached(parent, isTagPoint);
+    }
+	//-----------------------------------------------------------------------
+	void BillboardParticleRenderer::setRenderQueueGroup(uint8 queueID)
+	{
+		assert(queueID <= RENDER_QUEUE_MAX && "Render queue out of range!");
+		mBillboardSet->setRenderQueueGroup(queueID);
+	}
+	//-----------------------------------------------------------------------
+	void BillboardParticleRenderer::setKeepParticlesInLocalSpace(bool keepLocal)
+	{
+		mBillboardSet->setBillboardsInWorldSpace(!keepLocal);
+	}
+    //-----------------------------------------------------------------------
+    SortMode BillboardParticleRenderer::_getSortMode(void) const
+    {
+        return mBillboardSet->_getSortMode();
+    }
+	//-----------------------------------------------------------------------
+	void BillboardParticleRenderer::setPointRenderingEnabled(bool enabled)
+	{
+		mBillboardSet->setPointRenderingEnabled(enabled);
+	}
+	//-----------------------------------------------------------------------
+	bool BillboardParticleRenderer::isPointRenderingEnabled(void) const
+	{
+		return mBillboardSet->isPointRenderingEnabled();
+	}
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    const String& BillboardParticleRendererFactory::getType() const
+    {
+        return rendererTypeName;
+    }
+    //-----------------------------------------------------------------------
+    ParticleSystemRenderer* BillboardParticleRendererFactory::createInstance( 
+        const String& name )
+    {
+        return new BillboardParticleRenderer();
+    }
+    //-----------------------------------------------------------------------
+    void BillboardParticleRendererFactory::destroyInstance( 
+        ParticleSystemRenderer* inst)
+    {
+        delete inst;
+    }
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String BillboardParticleRenderer::CmdBillboardType::doGet(const void* target) const
+    {
+        BillboardType t = static_cast<const BillboardParticleRenderer*>(target)->getBillboardType();
+        switch(t)
+        {
+        case BBT_POINT:
+            return "point";
+            break;
+        case BBT_ORIENTED_COMMON:
+            return "oriented_common";
+            break;
+        case BBT_ORIENTED_SELF:
+            return "oriented_self";
+            break;
+        case BBT_PERPENDICULAR_COMMON:
+            return "perpendicular_common";
+        case BBT_PERPENDICULAR_SELF:
+            return "perpendicular_self";
+        }
+        // Compiler nicety
+        return "";
+    }
+    void BillboardParticleRenderer::CmdBillboardType::doSet(void* target, const String& val)
+    {
+        BillboardType t;
+        if (val == "point")
+        {
+            t = BBT_POINT;
+        }
+        else if (val == "oriented_common")
+        {
+            t = BBT_ORIENTED_COMMON;
+        }
+        else if (val == "oriented_self")
+        {
+            t = BBT_ORIENTED_SELF;
+        }
+        else if (val == "perpendicular_common")
+        {
+            t = BBT_PERPENDICULAR_COMMON;
+        }
+        else if (val == "perpendicular_self")
+        {
+            t = BBT_PERPENDICULAR_SELF;
+        }
+        else
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+                "Invalid billboard_type '" + val + "'", 
+                "ParticleSystem::CmdBillboardType::doSet");
+        }
+
+        static_cast<BillboardParticleRenderer*>(target)->setBillboardType(t);
+    }
+    //-----------------------------------------------------------------------
+    String BillboardParticleRenderer::CmdBillboardOrigin::doGet(const void* target) const
+    {
+        BillboardOrigin o = static_cast<const BillboardParticleRenderer*>(target)->getBillboardOrigin();
+        switch (o)
+        {
+        case BBO_TOP_LEFT:
+            return "top_left";
+        case BBO_TOP_CENTER:
+            return "top_center";
+        case BBO_TOP_RIGHT:
+            return "top_right";
+        case BBO_CENTER_LEFT:
+            return "center_left";
+        case BBO_CENTER:
+            return "center";
+        case BBO_CENTER_RIGHT:
+            return "center_right";
+        case BBO_BOTTOM_LEFT:
+            return "bottom_left";
+        case BBO_BOTTOM_CENTER:
+            return "bottom_center";
+        case BBO_BOTTOM_RIGHT:
+            return "bottom_right";
+        }
+        // Compiler nicety
+        return StringUtil::BLANK;
+    }
+    void BillboardParticleRenderer::CmdBillboardOrigin::doSet(void* target, const String& val)
+    {
+        BillboardOrigin o;
+        if (val == "top_left")
+            o = BBO_TOP_LEFT;
+        else if (val =="top_center")
+            o = BBO_TOP_CENTER;
+        else if (val =="top_right")
+            o = BBO_TOP_RIGHT;
+        else if (val =="center_left")
+            o = BBO_CENTER_LEFT;
+        else if (val =="center")
+            o = BBO_CENTER;
+        else if (val =="center_right")
+            o = BBO_CENTER_RIGHT;
+        else if (val =="bottom_left")
+            o = BBO_BOTTOM_LEFT;
+        else if (val =="bottom_center")
+            o = BBO_BOTTOM_CENTER;
+        else if (val =="bottom_right")
+            o = BBO_BOTTOM_RIGHT;
+        else
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+                "Invalid billboard_origin '" + val + "'", 
+                "ParticleSystem::CmdBillboardOrigin::doSet");
+        }
+
+        static_cast<BillboardParticleRenderer*>(target)->setBillboardOrigin(o);
+    }
+    //-----------------------------------------------------------------------
+    String BillboardParticleRenderer::CmdBillboardRotationType::doGet(const void* target) const
+    {
+        BillboardRotationType r = static_cast<const BillboardParticleRenderer*>(target)->getBillboardRotationType();
+        switch(r)
+        {
+        case BBR_VERTEX:
+            return "vertex";
+        case BBR_TEXCOORD:
+            return "texcoord";
+        }
+        // Compiler nicety
+        return StringUtil::BLANK;
+    }
+    void BillboardParticleRenderer::CmdBillboardRotationType::doSet(void* target, const String& val)
+    {
+        BillboardRotationType r;
+        if (val == "vertex")
+            r = BBR_VERTEX;
+        else if (val == "texcoord")
+            r = BBR_TEXCOORD;
+        else
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+                "Invalid billboard_rotation_type '" + val + "'", 
+                "ParticleSystem::CmdBillboardRotationType::doSet");
+        }
+
+        static_cast<BillboardParticleRenderer*>(target)->setBillboardRotationType(r);
+    }
+    //-----------------------------------------------------------------------
+    String BillboardParticleRenderer::CmdCommonDirection::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const BillboardParticleRenderer*>(target)->getCommonDirection() );
+    }
+    void BillboardParticleRenderer::CmdCommonDirection::doSet(void* target, const String& val)
+    {
+        static_cast<BillboardParticleRenderer*>(target)->setCommonDirection(
+            StringConverter::parseVector3(val));
+    }
+    //-----------------------------------------------------------------------
+    String BillboardParticleRenderer::CmdCommonUpVector::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const BillboardParticleRenderer*>(target)->getCommonUpVector() );
+    }
+    void BillboardParticleRenderer::CmdCommonUpVector::doSet(void* target, const String& val)
+    {
+        static_cast<BillboardParticleRenderer*>(target)->setCommonUpVector(
+            StringConverter::parseVector3(val));
+    }
+    //-----------------------------------------------------------------------
+    String BillboardParticleRenderer::CmdPointRendering::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const BillboardParticleRenderer*>(target)->isPointRenderingEnabled() );
+    }
+    void BillboardParticleRenderer::CmdPointRendering::doSet(void* target, const String& val)
+    {
+        static_cast<BillboardParticleRenderer*>(target)->setPointRenderingEnabled(
+            StringConverter::parseBool(val));
+    }
+	//-----------------------------------------------------------------------
+	String BillboardParticleRenderer::CmdAccurateFacing::doGet(const void* target) const
+	{
+		return StringConverter::toString(
+			static_cast<const BillboardParticleRenderer*>(target)->getUseAccurateFacing() );
+	}
+	void BillboardParticleRenderer::CmdAccurateFacing::doSet(void* target, const String& val)
+	{
+		static_cast<BillboardParticleRenderer*>(target)->setUseAccurateFacing(
+			StringConverter::parseBool(val));
+	}
+
+}
+
Index: /OgreMain/src/OgreBillboardSet.cpp
===================================================================
--- /OgreMain/src/OgreBillboardSet.cpp	(revision 5)
+++ /OgreMain/src/OgreBillboardSet.cpp	(revision 5)
@@ -0,0 +1,1493 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreBillboardSet.h"
+
+#include "OgreBillboard.h"
+#include "OgreMaterialManager.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreCamera.h"
+#include "OgreMath.h"
+#include "OgreSphere.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreRenderSystemCapabilities.h"
+#include "OgreException.h"
+#include "OgreStringConverter.h"
+#include "OgreLogManager.h"
+#include <algorithm>
+
+namespace Ogre {
+    // Init statics
+    RadixSort<BillboardSet::ActiveBillboardList, Billboard*, float> BillboardSet::mRadixSorter;
+
+    //-----------------------------------------------------------------------
+    BillboardSet::BillboardSet() :
+		mBoundingRadius(0.0f), 
+        mOriginType( BBO_CENTER ),
+        mRotationType( BBR_TEXCOORD ),
+        mAllDefaultSize( true ),
+        mAutoExtendPool( true ),
+        mSortingEnabled(false),
+        mAccurateFacing(false),
+        mAllDefaultRotation(true),
+        mWorldSpace(false),
+        mVertexData(0),
+        mIndexData(0),
+        mCullIndividual( false ),
+        mBillboardType(BBT_POINT),
+        mCommonDirection(Ogre::Vector3::UNIT_Z),
+        mCommonUpVector(Vector3::UNIT_Y),
+        mPointRendering(false),
+        mBuffersCreated(false),
+        mPoolSize(0),
+		mExternalData(false)
+    {
+        setDefaultDimensions( 100, 100 );
+        setMaterialName( "BaseWhite" );
+        mCastShadows = false;
+        setTextureStacksAndSlices( 1, 1 );
+    }
+
+    //-----------------------------------------------------------------------
+    BillboardSet::BillboardSet(
+        const String& name,
+        unsigned int poolSize,
+        bool externalData) :
+        MovableObject(name),
+		mBoundingRadius(0.0f), 
+        mOriginType( BBO_CENTER ),
+        mRotationType( BBR_TEXCOORD ),
+        mAllDefaultSize( true ),
+        mAutoExtendPool( true ),
+        mSortingEnabled(false),
+        mAccurateFacing(false),
+        mAllDefaultRotation(true),
+        mWorldSpace(false),
+        mVertexData(0),
+        mIndexData(0),
+        mCullIndividual( false ),
+        mBillboardType(BBT_POINT),
+        mCommonDirection(Ogre::Vector3::UNIT_Z),
+        mCommonUpVector(Vector3::UNIT_Y),
+		mPointRendering(false),
+        mBuffersCreated(false),
+        mPoolSize(poolSize),
+        mExternalData(externalData)
+    {
+        setDefaultDimensions( 100, 100 );
+        setMaterialName( "BaseWhite" );
+        setPoolSize( poolSize );
+        mCastShadows = false;
+        setTextureStacksAndSlices( 1, 1 );
+    }
+    //-----------------------------------------------------------------------
+    BillboardSet::~BillboardSet()
+    {
+        // Free pool items
+        BillboardPool::iterator i;
+        for (i = mBillboardPool.begin(); i != mBillboardPool.end(); ++i)
+        {
+            delete *i;
+        }
+
+        // Delete shared buffers
+		_destroyBuffers();
+    }
+    //-----------------------------------------------------------------------
+    Billboard* BillboardSet::createBillboard(
+        const Vector3& position,
+        const ColourValue& colour )
+    {
+        if( mFreeBillboards.empty() )
+        {
+            if( mAutoExtendPool )
+            {
+                setPoolSize( getPoolSize() * 2 );
+            }
+            else
+            {
+                return 0;
+            }
+        }
+
+        // Get a new billboard
+        Billboard* newBill = mFreeBillboards.front();
+		mActiveBillboards.splice(
+			mActiveBillboards.end(), mFreeBillboards, mFreeBillboards.begin());
+        newBill->setPosition(position);
+        newBill->setColour(colour);
+        newBill->mDirection = Vector3::ZERO;
+        newBill->setRotation(Radian(0));
+        newBill->setTexcoordIndex(0);
+        newBill->resetDimensions();
+        newBill->_notifyOwner(this);
+
+		// Merge into bounds
+		Real adjust = std::max(mDefaultWidth, mDefaultHeight);
+        Vector3 vecAdjust(adjust, adjust, adjust);
+		Vector3 newMin = position - vecAdjust;
+		Vector3 newMax = position + vecAdjust;
+
+        mAABB.merge(newMin);
+        mAABB.merge(newMax);
+
+		Real sqlen = std::max(newMin.squaredLength(), newMax.squaredLength());
+		mBoundingRadius = std::max(mBoundingRadius, Math::Sqrt(sqlen));
+
+        return newBill;
+    }
+
+    //-----------------------------------------------------------------------
+    Billboard* BillboardSet::createBillboard(
+        Real x, Real y, Real z,
+        const ColourValue& colour )
+    {
+        return createBillboard( Vector3( x, y, z ), colour );
+    }
+
+    //-----------------------------------------------------------------------
+    int BillboardSet::getNumBillboards(void) const
+    {
+        return static_cast< int >( mActiveBillboards.size() );
+    }
+
+    //-----------------------------------------------------------------------
+    void BillboardSet::clear()
+    {
+		// Move actives to free list
+		mFreeBillboards.splice(mFreeBillboards.end(), mActiveBillboards);
+    }
+
+    //-----------------------------------------------------------------------
+    Billboard* BillboardSet::getBillboard( unsigned int index ) const
+    {
+        assert(
+            index < mActiveBillboards.size() &&
+            "Billboard index out of bounds." );
+
+        /* We can't access it directly, so we check wether it's in the first
+           or the second half, then we start either from the beginning or the
+           end of the list
+        */
+        ActiveBillboardList::const_iterator it;
+        if( index >= ( mActiveBillboards.size() >> 1 ) )
+        {
+			index = static_cast<unsigned int>(mActiveBillboards.size()) - index;
+            for( it = mActiveBillboards.end(); index; --index, --it );
+        }
+        else
+        {
+            for( it = mActiveBillboards.begin(); index; --index, ++it );
+        }
+
+        return *it;
+    }
+
+    //-----------------------------------------------------------------------
+    void BillboardSet::removeBillboard(unsigned int index)
+    {
+        assert(
+            index < mActiveBillboards.size() &&
+            "Billboard index out of bounds." );
+
+        /* We can't access it directly, so we check wether it's in the first
+           or the second half, then we start either from the beginning or the
+           end of the list.
+           We then remove the billboard form the 'used' list and add it to
+           the 'free' list.
+        */
+        ActiveBillboardList::iterator it;
+        if( index >= ( mActiveBillboards.size() >> 1 ) )
+        {
+			index = static_cast<unsigned int>(mActiveBillboards.size()) - index;
+            for( it = mActiveBillboards.end(); index; --index, --it );
+        }
+        else
+        {
+            for( it = mActiveBillboards.begin(); index; --index, ++it );
+        }
+
+        mFreeBillboards.splice(mFreeBillboards.end(), mActiveBillboards, it);
+    }
+
+    //-----------------------------------------------------------------------
+    void BillboardSet::removeBillboard( Billboard* pBill )
+    {
+        ActiveBillboardList::iterator it =
+            std::find(mActiveBillboards.begin(), mActiveBillboards.end(), pBill);
+        assert(
+            it != mActiveBillboards.end() &&
+            "Billboard isn't in the active list." );
+
+        mFreeBillboards.splice(mFreeBillboards.end(), mActiveBillboards, it);
+    }
+
+    //-----------------------------------------------------------------------
+    void BillboardSet::setBillboardOrigin( BillboardOrigin origin )
+    {
+        mOriginType = origin;
+    }
+
+    //-----------------------------------------------------------------------
+    BillboardOrigin BillboardSet::getBillboardOrigin(void) const
+    {
+        return mOriginType;
+    }
+
+    //-----------------------------------------------------------------------
+    void BillboardSet::setBillboardRotationType(BillboardRotationType rotationType)
+    {
+        mRotationType = rotationType;
+    }
+    //-----------------------------------------------------------------------
+    BillboardRotationType BillboardSet::getBillboardRotationType(void) const
+    {
+        return mRotationType;
+    }
+    //-----------------------------------------------------------------------
+    void BillboardSet::setDefaultDimensions( Real width, Real height )
+    {
+        mDefaultWidth = width;
+        mDefaultHeight = height;
+    }
+    //-----------------------------------------------------------------------
+    void BillboardSet::setDefaultWidth(Real width)
+    {
+        mDefaultWidth = width;
+    }
+    //-----------------------------------------------------------------------
+    Real BillboardSet::getDefaultWidth(void) const
+    {
+        return mDefaultWidth;
+    }
+    //-----------------------------------------------------------------------
+    void BillboardSet::setDefaultHeight(Real height)
+    {
+        mDefaultHeight = height;
+    }
+    //-----------------------------------------------------------------------
+    Real BillboardSet::getDefaultHeight(void) const
+    {
+        return mDefaultHeight;
+    }
+    //-----------------------------------------------------------------------
+    void BillboardSet::setMaterialName( const String& name )
+    {
+        mMaterialName = name;
+
+        mpMaterial = MaterialManager::getSingleton().getByName(name);
+
+		if (mpMaterial.isNull())
+			OGRE_EXCEPT( Exception::ERR_ITEM_NOT_FOUND, "Could not find material " + name,
+				"BillboardSet::setMaterialName" );
+
+        /* Ensure that the new material was loaded (will not load again if
+           already loaded anyway)
+        */
+        mpMaterial->load();
+    }
+
+    //-----------------------------------------------------------------------
+    const String& BillboardSet::getMaterialName(void) const
+    {
+        return mMaterialName;
+    }
+
+    //-----------------------------------------------------------------------
+    void BillboardSet::_sortBillboards( Camera* cam)
+    {
+        switch (_getSortMode())
+        {
+        case SM_DIRECTION:
+            mRadixSorter.sort(mActiveBillboards, SortByDirectionFunctor(-mCamDir));
+            break;
+        case SM_DISTANCE:
+            mRadixSorter.sort(mActiveBillboards, SortByDistanceFunctor(mCamPos));
+            break;
+        }
+    }
+    BillboardSet::SortByDirectionFunctor::SortByDirectionFunctor(const Vector3& dir)
+        : sortDir(dir)
+    {
+    }
+    float BillboardSet::SortByDirectionFunctor::operator()(Billboard* bill) const
+    {
+        return sortDir.dotProduct(bill->getPosition());
+    }
+    BillboardSet::SortByDistanceFunctor::SortByDistanceFunctor(const Vector3& pos)
+        : sortPos(pos)
+    {
+    }
+    float BillboardSet::SortByDistanceFunctor::operator()(Billboard* bill) const
+    {
+        // Sort descending by squared distance
+        return - (sortPos - bill->getPosition()).squaredLength();
+    }
+    //-----------------------------------------------------------------------
+    SortMode BillboardSet::_getSortMode(void) const
+    {
+        // Need to sort by distance if we're using accurate facing, or perpendicular billboard type.
+        if (mAccurateFacing ||
+            mBillboardType == BBT_PERPENDICULAR_SELF ||
+            mBillboardType == BBT_PERPENDICULAR_COMMON)
+        {
+            return SM_DISTANCE;
+        }
+        else
+        {
+            return SM_DIRECTION;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void BillboardSet::_notifyCurrentCamera( Camera* cam )
+    {
+		MovableObject::_notifyCurrentCamera(cam);
+
+        mCurrentCamera = cam;
+
+        // Calculate camera orientation and position
+        mCamQ = mCurrentCamera->getDerivedOrientation();
+        mCamPos = mCurrentCamera->getDerivedPosition();
+        if (!mWorldSpace)
+        {
+            // Default behaviour is that billboards are in local node space
+            // so orientation of camera (in world space) must be reverse-transformed
+            // into node space
+            mCamQ = mParentNode->_getDerivedOrientation().UnitInverse() * mCamQ;
+            mCamPos = mParentNode->_getDerivedOrientation().UnitInverse() *
+                (mCamPos - mParentNode->_getDerivedPosition()) / mParentNode->_getDerivedScale();
+        }
+
+        // Camera direction points down -Z
+        mCamDir = mCamQ * Vector3::NEGATIVE_UNIT_Z;
+    }
+    //-----------------------------------------------------------------------
+    void BillboardSet::beginBillboards(size_t numBillboards)
+    {
+        /* Generate the vertices for all the billboards relative to the camera
+           Also take the opportunity to update the vertex colours
+           May as well do it here to save on loops elsewhere
+        */
+
+        /* NOTE: most engines generate world coordinates for the billboards
+           directly, taking the world axes of the camera as offsets to the
+           center points. I take a different approach, reverse-transforming
+           the camera world axes into local billboard space.
+           Why?
+           Well, it's actually more efficient this way, because I only have to
+           reverse-transform using the billboardset world matrix (inverse)
+           once, from then on it's simple additions (assuming identically
+           sized billboards). If I transformed every billboard center by it's
+           world transform, that's a matrix multiplication per billboard
+           instead.
+           I leave the final transform to the render pipeline since that can
+           use hardware TnL if it is available.
+        */
+
+        // create vertex and index buffers if they haven't already been
+        if(!mBuffersCreated)
+            _createBuffers();
+
+		// Only calculate vertex offets et al if we're not point rendering
+		if (!mPointRendering)
+		{
+
+			// Get offsets for origin type
+			getParametricOffsets(mLeftOff, mRightOff, mTopOff, mBottomOff);
+
+			// Generate axes etc up-front if not oriented per-billboard
+			if (mBillboardType != BBT_ORIENTED_SELF &&
+				mBillboardType != BBT_PERPENDICULAR_SELF && 
+				!(mAccurateFacing && mBillboardType != BBT_PERPENDICULAR_COMMON))
+			{
+				genBillboardAxes(&mCamX, &mCamY);
+
+				/* If all billboards are the same size we can precalculate the
+				   offsets and just use '+' instead of '*' for each billboard,
+				   and it should be faster.
+				*/
+				genVertOffsets(mLeftOff, mRightOff, mTopOff, mBottomOff,
+					mDefaultWidth, mDefaultHeight, mCamX, mCamY, mVOffset);
+
+			}
+		}
+
+        // Init num visible
+        mNumVisibleBillboards = 0;
+
+        // Lock the buffer
+		if (numBillboards) // optimal lock
+		{
+			// clamp to max
+			numBillboards = std::min(mPoolSize, numBillboards);
+
+			size_t billboardSize;
+			if (mPointRendering)
+			{
+				// just one vertex per billboard (this also excludes texcoords)
+				billboardSize = mMainBuf->getVertexSize();
+			}
+			else
+			{
+				// 4 corners
+				billboardSize = mMainBuf->getVertexSize() * 4;
+			}
+			assert (numBillboards * billboardSize <= mMainBuf->getSizeInBytes());
+
+			mLockPtr = static_cast<float*>(
+				mMainBuf->lock(0, numBillboards * billboardSize, 
+				HardwareBuffer::HBL_DISCARD) );
+		}
+		else // lock the entire thing
+			mLockPtr = static_cast<float*>(
+				mMainBuf->lock(HardwareBuffer::HBL_DISCARD) );
+
+    }
+    //-----------------------------------------------------------------------
+    void BillboardSet::injectBillboard(const Billboard& bb)
+    {
+		// Don't accept injections beyond pool size
+		if (mNumVisibleBillboards == mPoolSize) return;
+
+		// Skip if not visible (NB always true if not bounds checking individual billboards)
+        if (!billboardVisible(mCurrentCamera, bb)) return;
+
+        if (!mPointRendering &&
+			(mBillboardType == BBT_ORIENTED_SELF ||
+            mBillboardType == BBT_PERPENDICULAR_SELF ||
+            (mAccurateFacing && mBillboardType != BBT_PERPENDICULAR_COMMON)))
+        {
+            // Have to generate axes & offsets per billboard
+            genBillboardAxes(&mCamX, &mCamY, &bb);
+        }
+
+		// If they're all the same size or we're point rendering
+        if( mAllDefaultSize || mPointRendering)
+        {
+            /* No per-billboard checking, just blast through.
+            Saves us an if clause every billboard which may
+            make a difference.
+            */
+
+            if (!mPointRendering &&
+				(mBillboardType == BBT_ORIENTED_SELF ||
+           		mBillboardType == BBT_PERPENDICULAR_SELF ||
+           		(mAccurateFacing && mBillboardType != BBT_PERPENDICULAR_COMMON)))
+            {
+                genVertOffsets(mLeftOff, mRightOff, mTopOff, mBottomOff,
+                    mDefaultWidth, mDefaultHeight, mCamX, mCamY, mVOffset);
+            }
+            genVertices(mVOffset, bb);
+        }
+        else // not all default size and not point rendering
+        {
+            Vector3 vOwnOffset[4];
+            // If it has own dimensions, or self-oriented, gen offsets
+            if (mBillboardType == BBT_ORIENTED_SELF ||
+                mBillboardType == BBT_PERPENDICULAR_SELF ||
+                bb.mOwnDimensions ||
+                (mAccurateFacing && mBillboardType != BBT_PERPENDICULAR_COMMON))
+            {
+                // Generate using own dimensions
+                genVertOffsets(mLeftOff, mRightOff, mTopOff, mBottomOff,
+                    bb.mWidth, bb.mHeight, mCamX, mCamY, vOwnOffset);
+                // Create vertex data
+                genVertices(vOwnOffset, bb);
+            }
+            else // Use default dimension, already computed before the loop, for faster creation
+            {
+                genVertices(mVOffset, bb);
+            }
+        }
+        // Increment visibles
+        mNumVisibleBillboards++;
+    }
+    //-----------------------------------------------------------------------
+    void BillboardSet::endBillboards(void)
+    {
+        mMainBuf->unlock();
+    }
+	//-----------------------------------------------------------------------
+	void BillboardSet::setBounds(const AxisAlignedBox& box, Real radius)
+	{
+		mAABB = box;
+		mBoundingRadius = radius;
+	}
+    //-----------------------------------------------------------------------
+    void BillboardSet::_updateBounds(void)
+    {
+        if (mActiveBillboards.empty())
+        {
+            // No billboards, null bbox
+            mAABB.setNull();
+			mBoundingRadius = 0.0f;
+        }
+        else
+        {
+			Real maxSqLen = -1.0f;
+
+            Vector3 min(Math::POS_INFINITY, Math::POS_INFINITY, Math::POS_INFINITY);
+            Vector3 max(Math::NEG_INFINITY, Math::NEG_INFINITY, Math::NEG_INFINITY);
+            ActiveBillboardList::iterator i, iend;
+
+            iend = mActiveBillboards.end();
+            for (i = mActiveBillboards.begin(); i != iend; ++i)
+            {
+                const Vector3& pos = (*i)->getPosition();
+                min.makeFloor(pos);
+                max.makeCeil(pos);
+
+				maxSqLen = std::max(maxSqLen, pos.squaredLength());
+            }
+            // Adjust for billboard size
+            Real adjust = std::max(mDefaultWidth, mDefaultHeight);
+            Vector3 vecAdjust(adjust, adjust, adjust);
+            min -= vecAdjust;
+            max += vecAdjust;
+
+            mAABB.setExtents(min, max);
+			mBoundingRadius = Math::Sqrt(maxSqLen);
+
+        }
+
+        if (mParentNode)
+            mParentNode->needUpdate();
+
+    }
+    //-----------------------------------------------------------------------
+    const AxisAlignedBox& BillboardSet::getBoundingBox(void) const
+    {
+        return mAABB;
+    }
+
+    //-----------------------------------------------------------------------
+    void BillboardSet::_updateRenderQueue(RenderQueue* queue)
+    {
+        // If we're driving this from our own data, update geometry now
+        if (!mExternalData)
+        {
+            if (mSortingEnabled)
+            {
+                _sortBillboards(mCurrentCamera);
+            }
+
+            beginBillboards(mActiveBillboards.size());
+            ActiveBillboardList::iterator it;
+            for(it = mActiveBillboards.begin();
+                it != mActiveBillboards.end();
+                ++it )
+            {
+                injectBillboard(*(*it));
+            }
+            endBillboards();
+        }
+
+        //only set the render queue group if it has been explicitly set.
+        if( mRenderQueueIDSet )
+        {
+           queue->addRenderable(this, mRenderQueueID);
+        } else {
+           queue->addRenderable(this);
+        }
+
+    }
+
+    //-----------------------------------------------------------------------
+    const MaterialPtr& BillboardSet::getMaterial(void) const
+    {
+        return mpMaterial;
+    }
+
+    //-----------------------------------------------------------------------
+    void BillboardSet::getRenderOperation(RenderOperation& op)
+    {
+        op.vertexData = mVertexData;
+       	op.vertexData->vertexStart = 0;
+
+		if (mPointRendering)
+		{
+			op.operationType = RenderOperation::OT_POINT_LIST;
+    	    op.useIndexes = false;
+			op.indexData = 0;
+			op.vertexData->vertexCount = mNumVisibleBillboards;
+		}
+		else
+		{
+			op.operationType = RenderOperation::OT_TRIANGLE_LIST;
+    	    op.useIndexes = true;
+
+    	    op.vertexData->vertexCount = mNumVisibleBillboards * 4;
+
+	        op.indexData = mIndexData;
+    	    op.indexData->indexCount = mNumVisibleBillboards * 6;
+        	op.indexData->indexStart = 0;
+		}
+    }
+
+    //-----------------------------------------------------------------------
+    void BillboardSet::getWorldTransforms( Matrix4* xform ) const
+    {
+        if (mWorldSpace)
+        {
+            *xform = Matrix4::IDENTITY;
+        }
+        else
+        {
+            *xform = _getParentNodeFullTransform();
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    const Quaternion& BillboardSet::getWorldOrientation(void) const
+    {
+        return mParentNode->_getDerivedOrientation();
+    }
+
+    //-----------------------------------------------------------------------
+    const Vector3& BillboardSet::getWorldPosition(void) const
+    {
+        return mParentNode->_getDerivedPosition();
+    }
+
+    //-----------------------------------------------------------------------
+    void BillboardSet::setAutoextend( bool autoextend )
+    {
+        mAutoExtendPool = autoextend;
+    }
+
+    //-----------------------------------------------------------------------
+    bool BillboardSet::getAutoextend(void) const
+    {
+        return mAutoExtendPool;
+    }
+
+    //-----------------------------------------------------------------------
+    void BillboardSet::setSortingEnabled( bool sortenable )
+    {
+        mSortingEnabled = sortenable;
+    }
+
+    //-----------------------------------------------------------------------
+    bool BillboardSet::getSortingEnabled(void) const
+    {
+        return mSortingEnabled;
+    }
+
+    //-----------------------------------------------------------------------
+    void BillboardSet::setPoolSize( size_t size )
+    {
+        // If we're driving this from our own data, allocate billboards
+        if (!mExternalData)
+        {
+            // Never shrink below size()
+            size_t currSize = mBillboardPool.size();
+            if (currSize >= size)
+                return;
+
+            this->increasePool(size);
+
+            for( size_t i = currSize; i < size; ++i )
+            {
+                // Add new items to the queue
+                mFreeBillboards.push_back( mBillboardPool[i] );
+            }
+        }
+
+        mPoolSize = size;
+
+		_destroyBuffers();
+    }
+
+    //-----------------------------------------------------------------------
+    void BillboardSet::_createBuffers(void)
+    {
+        /* Allocate / reallocate vertex data
+           Note that we allocate enough space for ALL the billboards in the pool, but only issue
+           rendering operations for the sections relating to the active billboards
+        */
+
+        /* Alloc positions   ( 1 or 4 verts per billboard, 3 components )
+                 colours     ( 1 x RGBA per vertex )
+                 indices     ( 6 per billboard ( 2 tris ) if not point rendering )
+                 tex. coords ( 2D coords, 1 or 4 per billboard )
+        */
+
+		// Warn if user requested an invalid setup
+		// Do it here so it only appears once
+		if (mPointRendering && mBillboardType != BBT_POINT)
+		{
+
+			LogManager::getSingleton().logMessage("Warning: BillboardSet " +
+				mName + " has point rendering enabled but is using a type "
+				"other than BBT_POINT, this may not give you the results you "
+				"expect.");
+		}
+
+        mVertexData = new VertexData();
+		if (mPointRendering)
+			mVertexData->vertexCount = mPoolSize;
+		else
+			mVertexData->vertexCount = mPoolSize * 4;
+
+        mVertexData->vertexStart = 0;
+
+        // Vertex declaration
+        VertexDeclaration* decl = mVertexData->vertexDeclaration;
+        VertexBufferBinding* binding = mVertexData->vertexBufferBinding;
+
+        size_t offset = 0;
+        decl->addElement(0, offset, VET_FLOAT3, VES_POSITION);
+        offset += VertexElement::getTypeSize(VET_FLOAT3);
+        decl->addElement(0, offset, VET_COLOUR, VES_DIFFUSE);
+        offset += VertexElement::getTypeSize(VET_COLOUR);
+        // Texture coords irrelevant when enabled point rendering (generated
+        // in point sprite mode, and unused in standard point mode)
+        if (!mPointRendering)
+        {
+            decl->addElement(0, offset, VET_FLOAT2, VES_TEXTURE_COORDINATES, 0);
+        }
+
+        mMainBuf =
+            HardwareBufferManager::getSingleton().createVertexBuffer(
+                decl->getVertexSize(0),
+                mVertexData->vertexCount,
+                HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE);
+        // bind position and diffuses
+        binding->setBinding(0, mMainBuf);
+
+		if (!mPointRendering)
+		{
+			mIndexData  = new IndexData();
+			mIndexData->indexStart = 0;
+			mIndexData->indexCount = mPoolSize * 6;
+
+			mIndexData->indexBuffer = HardwareBufferManager::getSingleton().
+				createIndexBuffer(HardwareIndexBuffer::IT_16BIT,
+					mIndexData->indexCount,
+					HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+
+			/* Create indexes (will be the same every frame)
+			   Using indexes because it means 1/3 less vertex transforms (4 instead of 6)
+
+			   Billboard layout relative to camera:
+
+				0-----1
+				|    /|
+				|  /  |
+				|/    |
+				2-----3
+			*/
+
+			ushort* pIdx = static_cast<ushort*>(
+				mIndexData->indexBuffer->lock(0,
+				  mIndexData->indexBuffer->getSizeInBytes(),
+				  HardwareBuffer::HBL_DISCARD) );
+
+			for(
+				size_t idx, idxOff, bboard = 0;
+				bboard < mPoolSize;
+				++bboard )
+			{
+				// Do indexes
+				idx    = bboard * 6;
+				idxOff = bboard * 4;
+
+				pIdx[idx] = static_cast<unsigned short>(idxOff); // + 0;, for clarity
+				pIdx[idx+1] = static_cast<unsigned short>(idxOff + 2);
+				pIdx[idx+2] = static_cast<unsigned short>(idxOff + 1);
+				pIdx[idx+3] = static_cast<unsigned short>(idxOff + 1);
+				pIdx[idx+4] = static_cast<unsigned short>(idxOff + 2);
+				pIdx[idx+5] = static_cast<unsigned short>(idxOff + 3);
+
+			}
+
+			mIndexData->indexBuffer->unlock();
+		}
+        mBuffersCreated = true;
+    }
+    //-----------------------------------------------------------------------
+	void BillboardSet::_destroyBuffers(void)
+	{
+        if (mVertexData)
+        {
+            delete mVertexData;
+            mVertexData = 0;
+        }
+        if (mIndexData)
+        {
+            delete mIndexData;
+            mIndexData = 0;
+        }
+
+        mMainBuf.setNull();
+
+		mBuffersCreated = false;
+
+	}
+    //-----------------------------------------------------------------------
+    unsigned int BillboardSet::getPoolSize(void) const
+    {
+        return static_cast< unsigned int >( mBillboardPool.size() );
+    }
+
+    //-----------------------------------------------------------------------
+    void BillboardSet::_notifyBillboardResized(void)
+    {
+        mAllDefaultSize = false;
+    }
+
+    //-----------------------------------------------------------------------
+    void BillboardSet::_notifyBillboardRotated(void)
+    {
+        mAllDefaultRotation = false;
+    }
+
+    //-----------------------------------------------------------------------
+    void BillboardSet::getParametricOffsets(
+        Real& left, Real& right, Real& top, Real& bottom )
+    {
+        switch( mOriginType )
+        {
+        case BBO_TOP_LEFT:
+            left = 0.0f;
+            right = 1.0f;
+            top = 0.0f;
+            bottom = -1.0f;
+            break;
+
+        case BBO_TOP_CENTER:
+            left = -0.5f;
+            right = 0.5f;
+            top = 0.0f;
+            bottom = -1.0f;
+            break;
+
+        case BBO_TOP_RIGHT:
+            left = -1.0f;
+            right = 0.0f;
+            top = 0.0f;
+            bottom = -1.0f;
+            break;
+
+        case BBO_CENTER_LEFT:
+            left = 0.0f;
+            right = 1.0f;
+            top = 0.5f;
+            bottom = -0.5f;
+            break;
+
+        case BBO_CENTER:
+            left = -0.5f;
+            right = 0.5f;
+            top = 0.5f;
+            bottom = -0.5f;
+            break;
+
+        case BBO_CENTER_RIGHT:
+            left = -1.0f;
+            right = 0.0f;
+            top = 0.5f;
+            bottom = -0.5f;
+            break;
+
+        case BBO_BOTTOM_LEFT:
+            left = 0.0f;
+            right = 1.0f;
+            top = 1.0f;
+            bottom = 0.0f;
+            break;
+
+        case BBO_BOTTOM_CENTER:
+            left = -0.5f;
+            right = 0.5f;
+            top = 1.0f;
+            bottom = 0.0f;
+            break;
+
+        case BBO_BOTTOM_RIGHT:
+            left = -1.0f;
+            right = 0.0f;
+            top = 1.0f;
+            bottom = 0.0f;
+            break;
+        }
+    }
+    //-----------------------------------------------------------------------
+    bool BillboardSet::getCullIndividually(void) const
+    {
+        return mCullIndividual;
+    }
+    //-----------------------------------------------------------------------
+    void BillboardSet::setCullIndividually(bool cullIndividual)
+    {
+        mCullIndividual = cullIndividual;
+    }
+    //-----------------------------------------------------------------------
+    bool BillboardSet::billboardVisible(Camera* cam, const Billboard& bill)
+    {
+        // Return always visible if not culling individually
+        if (!mCullIndividual) return true;
+
+        // Cull based on sphere (have to transform less)
+        Sphere sph;
+        Matrix4 xworld;
+
+        getWorldTransforms(&xworld);
+
+        sph.setCenter(xworld.transformAffine(bill.mPosition));
+
+        if (bill.mOwnDimensions)
+        {
+            sph.setRadius(std::max(bill.mWidth, bill.mHeight));
+        }
+        else
+        {
+            sph.setRadius(std::max(mDefaultWidth, mDefaultHeight));
+        }
+
+        return cam->isVisible(sph);
+
+    }
+    //-----------------------------------------------------------------------
+    void BillboardSet::increasePool(size_t size)
+    {
+        size_t oldSize = mBillboardPool.size();
+
+        // Increase size
+        mBillboardPool.reserve(size);
+        mBillboardPool.resize(size);
+
+        // Create new billboards
+        for( size_t i = oldSize; i < size; ++i )
+            mBillboardPool[i] = new Billboard();
+
+    }
+    //-----------------------------------------------------------------------
+    void BillboardSet::genBillboardAxes(Vector3* pX, Vector3 *pY, const Billboard* bb)
+    {
+        // If we're using accurate facing, recalculate camera direction per BB
+        if (mAccurateFacing && 
+            (mBillboardType == BBT_POINT || 
+            mBillboardType == BBT_ORIENTED_COMMON ||
+            mBillboardType == BBT_ORIENTED_SELF))
+        {
+            // cam -> bb direction
+            mCamDir = bb->mPosition - mCamPos;
+            mCamDir.normalise();
+        }
+
+
+        switch (mBillboardType)
+        {
+        case BBT_POINT:
+            if (mAccurateFacing)
+            {
+                // Point billboards will have 'up' based on but not equal to cameras
+                // Use pY temporarily to avoid allocation
+                *pY = mCamQ * Vector3::UNIT_Y;
+                *pX = mCamDir.crossProduct(*pY);
+                pX->normalise();
+                *pY = pX->crossProduct(mCamDir); // both normalised already
+            }
+            else
+            {
+                // Get camera axes for X and Y (depth is irrelevant)
+                *pX = mCamQ * Vector3::UNIT_X;
+                *pY = mCamQ * Vector3::UNIT_Y;
+            }
+            break;
+
+        case BBT_ORIENTED_COMMON:
+            // Y-axis is common direction
+            // X-axis is cross with camera direction
+            *pY = mCommonDirection;
+            *pX = mCamDir.crossProduct(*pY);
+            pX->normalise();
+            break;
+
+        case BBT_ORIENTED_SELF:
+            // Y-axis is direction
+            // X-axis is cross with camera direction
+            // Scale direction first
+            *pY = bb->mDirection;
+            *pX = mCamDir.crossProduct(*pY);
+            pX->normalise();
+            break;
+
+        case BBT_PERPENDICULAR_COMMON:
+            // X-axis is up-vector cross common direction
+            // Y-axis is common direction cross X-axis
+            *pX = mCommonUpVector.crossProduct(mCommonDirection);
+            *pY = mCommonDirection.crossProduct(*pX);
+            break;
+
+        case BBT_PERPENDICULAR_SELF:
+            // X-axis is up-vector cross own direction
+            // Y-axis is own direction cross X-axis
+            *pX = mCommonUpVector.crossProduct(bb->mDirection);
+            pX->normalise();
+            *pY = bb->mDirection.crossProduct(*pX); // both should be normalised
+            break;
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void BillboardSet::setBillboardType(BillboardType bbt)
+    {
+        mBillboardType = bbt;
+    }
+    //-----------------------------------------------------------------------
+    BillboardType BillboardSet::getBillboardType(void) const
+    {
+        return mBillboardType;
+    }
+    //-----------------------------------------------------------------------
+    void BillboardSet::setCommonDirection(const Vector3& vec)
+    {
+        mCommonDirection = vec;
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& BillboardSet::getCommonDirection(void) const
+    {
+        return mCommonDirection;
+    }
+    //-----------------------------------------------------------------------
+    void BillboardSet::setCommonUpVector(const Vector3& vec)
+    {
+        mCommonUpVector = vec;
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& BillboardSet::getCommonUpVector(void) const
+    {
+        return mCommonUpVector;
+    }
+	//-----------------------------------------------------------------------
+	uint32 BillboardSet::getTypeFlags(void) const
+	{
+		return SceneManager::FX_TYPE_MASK;
+	}
+    //-----------------------------------------------------------------------
+    void BillboardSet::genVertices(
+        const Vector3* const offsets, const Billboard& bb)
+    {
+        RGBA colour;
+        Root::getSingleton().convertColourValue(bb.mColour, &colour);
+		RGBA* pCol;
+
+        // Texcoords
+        assert( bb.mUseTexcoordRect || bb.mTexcoordIndex < mTextureCoords.size() );
+        const Ogre::FloatRect & r =
+            bb.mUseTexcoordRect ? bb.mTexcoordRect : mTextureCoords[bb.mTexcoordIndex];
+
+		if (mPointRendering)
+		{
+			// Single vertex per billboard, ignore offsets
+			// position
+            *mLockPtr++ = bb.mPosition.x;
+            *mLockPtr++ = bb.mPosition.y;
+            *mLockPtr++ = bb.mPosition.z;
+            // Colour
+            // Convert float* to RGBA*
+            pCol = static_cast<RGBA*>(static_cast<void*>(mLockPtr));
+            *pCol++ = colour;
+			// Update lock pointer
+			mLockPtr = static_cast<float*>(static_cast<void*>(pCol));
+            // No texture coords in point rendering
+		}
+		else if (mAllDefaultRotation || bb.mRotation == Radian(0))
+        {
+            // Left-top
+            // Positions
+            *mLockPtr++ = offsets[0].x + bb.mPosition.x;
+            *mLockPtr++ = offsets[0].y + bb.mPosition.y;
+            *mLockPtr++ = offsets[0].z + bb.mPosition.z;
+            // Colour
+            // Convert float* to RGBA*
+            pCol = static_cast<RGBA*>(static_cast<void*>(mLockPtr));
+            *pCol++ = colour;
+            // Update lock pointer
+            mLockPtr = static_cast<float*>(static_cast<void*>(pCol));
+            // Texture coords
+            *mLockPtr++ = r.left;
+            *mLockPtr++ = r.top;
+
+            // Right-top
+            // Positions
+            *mLockPtr++ = offsets[1].x + bb.mPosition.x;
+            *mLockPtr++ = offsets[1].y + bb.mPosition.y;
+            *mLockPtr++ = offsets[1].z + bb.mPosition.z;
+            // Colour
+            // Convert float* to RGBA*
+            pCol = static_cast<RGBA*>(static_cast<void*>(mLockPtr));
+            *pCol++ = colour;
+            // Update lock pointer
+            mLockPtr = static_cast<float*>(static_cast<void*>(pCol));
+            // Texture coords
+            *mLockPtr++ = r.right;
+            *mLockPtr++ = r.top;
+
+            // Left-bottom
+            // Positions
+            *mLockPtr++ = offsets[2].x + bb.mPosition.x;
+            *mLockPtr++ = offsets[2].y + bb.mPosition.y;
+            *mLockPtr++ = offsets[2].z + bb.mPosition.z;
+            // Colour
+            // Convert float* to RGBA*
+            pCol = static_cast<RGBA*>(static_cast<void*>(mLockPtr));
+            *pCol++ = colour;
+            // Update lock pointer
+            mLockPtr = static_cast<float*>(static_cast<void*>(pCol));
+            // Texture coords
+            *mLockPtr++ = r.left;
+            *mLockPtr++ = r.bottom;
+
+            // Right-bottom
+            // Positions
+            *mLockPtr++ = offsets[3].x + bb.mPosition.x;
+            *mLockPtr++ = offsets[3].y + bb.mPosition.y;
+            *mLockPtr++ = offsets[3].z + bb.mPosition.z;
+            // Colour
+            // Convert float* to RGBA*
+            pCol = static_cast<RGBA*>(static_cast<void*>(mLockPtr));
+            *pCol++ = colour;
+            // Update lock pointer
+            mLockPtr = static_cast<float*>(static_cast<void*>(pCol));
+            // Texture coords
+            *mLockPtr++ = r.right;
+            *mLockPtr++ = r.bottom;
+        }
+        else if (mRotationType == BBR_VERTEX)
+        {
+            // TODO: Cache axis when billboard type is BBT_POINT or BBT_PERPENDICULAR_COMMON
+            Vector3 axis = (offsets[3] - offsets[0]).crossProduct(offsets[2] - offsets[1]).normalisedCopy();
+
+            Quaternion rotation(bb.mRotation, axis);
+            Vector3 pt;
+
+            // Left-top
+            // Positions
+            pt = rotation * offsets[0];
+            *mLockPtr++ = pt.x + bb.mPosition.x;
+            *mLockPtr++ = pt.y + bb.mPosition.y;
+            *mLockPtr++ = pt.z + bb.mPosition.z;
+            // Colour
+            // Convert float* to RGBA*
+            pCol = static_cast<RGBA*>(static_cast<void*>(mLockPtr));
+            *pCol++ = colour;
+            // Update lock pointer
+            mLockPtr = static_cast<float*>(static_cast<void*>(pCol));
+            // Texture coords
+            *mLockPtr++ = r.left;
+            *mLockPtr++ = r.top;
+
+            // Right-top
+            // Positions
+            pt = rotation * offsets[1];
+            *mLockPtr++ = pt.x + bb.mPosition.x;
+            *mLockPtr++ = pt.y + bb.mPosition.y;
+            *mLockPtr++ = pt.z + bb.mPosition.z;
+            // Colour
+            // Convert float* to RGBA*
+            pCol = static_cast<RGBA*>(static_cast<void*>(mLockPtr));
+            *pCol++ = colour;
+            // Update lock pointer
+            mLockPtr = static_cast<float*>(static_cast<void*>(pCol));
+            // Texture coords
+            *mLockPtr++ = r.right;
+            *mLockPtr++ = r.top;
+
+            // Left-bottom
+            // Positions
+            pt = rotation * offsets[2];
+            *mLockPtr++ = pt.x + bb.mPosition.x;
+            *mLockPtr++ = pt.y + bb.mPosition.y;
+            *mLockPtr++ = pt.z + bb.mPosition.z;
+            // Colour
+            // Convert float* to RGBA*
+            pCol = static_cast<RGBA*>(static_cast<void*>(mLockPtr));
+            *pCol++ = colour;
+            // Update lock pointer
+            mLockPtr = static_cast<float*>(static_cast<void*>(pCol));
+            // Texture coords
+            *mLockPtr++ = r.left;
+            *mLockPtr++ = r.bottom;
+
+            // Right-bottom
+            // Positions
+            pt = rotation * offsets[3];
+            *mLockPtr++ = pt.x + bb.mPosition.x;
+            *mLockPtr++ = pt.y + bb.mPosition.y;
+            *mLockPtr++ = pt.z + bb.mPosition.z;
+            // Colour
+            // Convert float* to RGBA*
+            pCol = static_cast<RGBA*>(static_cast<void*>(mLockPtr));
+            *pCol++ = colour;
+            // Update lock pointer
+            mLockPtr = static_cast<float*>(static_cast<void*>(pCol));
+            // Texture coords
+            *mLockPtr++ = r.right;
+            *mLockPtr++ = r.bottom;
+        }
+        else
+        {
+            const Real      cos_rot  ( Math::Cos(bb.mRotation)   );
+            const Real      sin_rot  ( Math::Sin(bb.mRotation)   );
+
+            float width = (r.right-r.left)/2;
+            float height = (r.bottom-r.top)/2;
+            float mid_u = r.left+width;
+            float mid_v = r.top+height;
+
+            float cos_rot_w = cos_rot * width;
+            float cos_rot_h = cos_rot * height;
+            float sin_rot_w = sin_rot * width;
+            float sin_rot_h = sin_rot * height;
+
+            // Left-top
+            // Positions
+            *mLockPtr++ = offsets[0].x + bb.mPosition.x;
+            *mLockPtr++ = offsets[0].y + bb.mPosition.y;
+            *mLockPtr++ = offsets[0].z + bb.mPosition.z;
+            // Colour
+            // Convert float* to RGBA*
+            pCol = static_cast<RGBA*>(static_cast<void*>(mLockPtr));
+            *pCol++ = colour;
+            // Update lock pointer
+            mLockPtr = static_cast<float*>(static_cast<void*>(pCol));
+            // Texture coords
+            *mLockPtr++ = mid_u - cos_rot_w + sin_rot_h;
+            *mLockPtr++ = mid_v - sin_rot_w - cos_rot_h;
+
+            // Right-top
+            // Positions
+            *mLockPtr++ = offsets[1].x + bb.mPosition.x;
+            *mLockPtr++ = offsets[1].y + bb.mPosition.y;
+            *mLockPtr++ = offsets[1].z + bb.mPosition.z;
+            // Colour
+            // Convert float* to RGBA*
+            pCol = static_cast<RGBA*>(static_cast<void*>(mLockPtr));
+            *pCol++ = colour;
+            // Update lock pointer
+            mLockPtr = static_cast<float*>(static_cast<void*>(pCol));
+            // Texture coords
+            *mLockPtr++ = mid_u + cos_rot_w + sin_rot_h;
+            *mLockPtr++ = mid_v + sin_rot_w - cos_rot_h;
+
+            // Left-bottom
+            // Positions
+            *mLockPtr++ = offsets[2].x + bb.mPosition.x;
+            *mLockPtr++ = offsets[2].y + bb.mPosition.y;
+            *mLockPtr++ = offsets[2].z + bb.mPosition.z;
+            // Colour
+            // Convert float* to RGBA*
+            pCol = static_cast<RGBA*>(static_cast<void*>(mLockPtr));
+            *pCol++ = colour;
+            // Update lock pointer
+            mLockPtr = static_cast<float*>(static_cast<void*>(pCol));
+            // Texture coords
+            *mLockPtr++ = mid_u - cos_rot_w - sin_rot_h;
+            *mLockPtr++ = mid_v - sin_rot_w + cos_rot_h;
+
+            // Right-bottom
+            // Positions
+            *mLockPtr++ = offsets[3].x + bb.mPosition.x;
+            *mLockPtr++ = offsets[3].y + bb.mPosition.y;
+            *mLockPtr++ = offsets[3].z + bb.mPosition.z;
+            // Colour
+            // Convert float* to RGBA*
+            pCol = static_cast<RGBA*>(static_cast<void*>(mLockPtr));
+            *pCol++ = colour;
+            // Update lock pointer
+            mLockPtr = static_cast<float*>(static_cast<void*>(pCol));
+            // Texture coords
+            *mLockPtr++ = mid_u + cos_rot_w - sin_rot_h;
+            *mLockPtr++ = mid_v + sin_rot_w + cos_rot_h;
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void BillboardSet::genVertOffsets(Real inleft, Real inright, Real intop, Real inbottom,
+        Real width, Real height, const Vector3& x, const Vector3& y, Vector3* pDestVec)
+    {
+        Vector3 vLeftOff, vRightOff, vTopOff, vBottomOff;
+        /* Calculate default offsets. Scale the axes by
+           parametric offset and dimensions, ready to be added to
+           positions.
+        */
+
+        vLeftOff   = x * ( inleft   * width );
+        vRightOff  = x * ( inright  * width );
+        vTopOff    = y * ( intop   * height );
+        vBottomOff = y * ( inbottom * height );
+
+        // Make final offsets to vertex positions
+        pDestVec[0] = vLeftOff  + vTopOff;
+        pDestVec[1] = vRightOff + vTopOff;
+        pDestVec[2] = vLeftOff  + vBottomOff;
+        pDestVec[3] = vRightOff + vBottomOff;
+
+    }
+    //-----------------------------------------------------------------------
+    const String& BillboardSet::getMovableType(void) const
+    {
+		return BillboardSetFactory::FACTORY_TYPE_NAME;
+    }
+    //-----------------------------------------------------------------------
+    Real BillboardSet::getSquaredViewDepth(const Camera* const cam) const
+    {
+        assert(mParentNode);
+        return mParentNode->getSquaredViewDepth(cam);
+    }
+    //-----------------------------------------------------------------------
+	Real BillboardSet::getBoundingRadius(void) const
+	{
+		return mBoundingRadius;
+	}
+    //-----------------------------------------------------------------------
+    const LightList& BillboardSet::getLights(void) const
+    {
+        // It's actually quite unlikely that this will be called,
+        // because most billboards are unlit, but here we go anyway
+        return queryLights();
+    }
+
+    void BillboardSet::setTextureCoords( Ogre::FloatRect const * coords, uint16 numCoords )
+    {
+      if( !numCoords || !coords ) {
+        setTextureStacksAndSlices( 1, 1 );
+		return;
+      }
+      //  clear out any previous allocation (as vectors may not shrink)
+      TextureCoordSets().swap( mTextureCoords );
+      //  make room
+      mTextureCoords.resize( numCoords );
+      //  copy in data
+      std::copy( coords, coords+numCoords, &mTextureCoords.front() );
+    }
+
+    void BillboardSet::setTextureStacksAndSlices( uchar stacks, uchar slices )
+    {
+      if( stacks == 0 ) stacks = 1;
+      if( slices == 0 ) slices = 1;
+      //  clear out any previous allocation (as vectors may not shrink)
+      TextureCoordSets().swap( mTextureCoords );
+      //  make room
+      mTextureCoords.resize( (size_t)stacks * slices );
+      unsigned int coordIndex = 0;
+      //  spread the U and V coordinates across the rects
+      for( uint v = 0; v < stacks; ++v ) {
+        //  (float)X / X is guaranteed to be == 1.0f for X up to 8 million, so
+        //  our range of 1..256 is quite enough to guarantee perfect coverage.
+        float top = (float)v / (float)stacks;
+        float bottom = ((float)v + 1) / (float)stacks;
+        for( uint u = 0; u < slices; ++u ) {
+          Ogre::FloatRect & r = mTextureCoords[coordIndex];
+          r.left = (float)u / (float)slices;
+          r.bottom = bottom;
+          r.right = ((float)u + 1) / (float)slices;
+          r.top = top;
+          ++coordIndex;
+        }
+      }
+      assert( coordIndex == (size_t)stacks * slices );
+    }
+	//-----------------------------------------------------------------------
+    Ogre::FloatRect const * BillboardSet::getTextureCoords( uint16 * oNumCoords )
+    {
+      *oNumCoords = (uint16)mTextureCoords.size();
+      //  std::vector<> is guaranteed to be contiguous
+      return &mTextureCoords.front();
+    }
+	//-----------------------------------------------------------------------
+	void BillboardSet::setPointRenderingEnabled(bool enabled)
+	{
+		// Override point rendering if not supported
+		if (enabled && !Root::getSingleton().getRenderSystem()->getCapabilities()->hasCapability(RSC_POINT_SPRITES))
+		{
+			enabled = false;
+		}
+
+		if (enabled != mPointRendering)
+		{
+			mPointRendering = enabled;
+			// Different buffer structure (1 or 4 verts per billboard)
+			_destroyBuffers();
+		}
+	}
+	//-----------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	String BillboardSetFactory::FACTORY_TYPE_NAME = "BillboardSet";
+	//-----------------------------------------------------------------------
+	const String& BillboardSetFactory::getType(void) const
+	{
+		return FACTORY_TYPE_NAME;
+	}
+	//-----------------------------------------------------------------------
+	MovableObject* BillboardSetFactory::createInstanceImpl( const String& name,
+		const NameValuePairList* params)
+	{
+		// may have parameters
+		bool externalData = false;
+		unsigned int poolSize = 0;
+
+		if (params != 0)
+		{
+			NameValuePairList::const_iterator ni = params->find("poolSize");
+			if (ni != params->end())
+			{
+				poolSize = StringConverter::parseUnsignedInt(ni->second);
+			}
+			ni = params->find("externalData");
+			if (ni != params->end())
+			{
+				externalData = StringConverter::parseBool(ni->second);
+			}
+
+		}
+
+		if (poolSize > 0)
+		{
+			return new BillboardSet(name, poolSize, externalData);
+		}
+		else
+		{
+			return new BillboardSet(name);
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	void BillboardSetFactory::destroyInstance( MovableObject* obj)
+	{
+		delete obj;
+	}
+
+
+}
Index: /OgreMain/src/OgreBone.cpp
===================================================================
--- /OgreMain/src/OgreBone.cpp	(revision 5)
+++ /OgreMain/src/OgreBone.cpp	(revision 5)
@@ -0,0 +1,137 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreBone.h"
+#include "OgreSkeleton.h"
+
+namespace Ogre {
+
+    //---------------------------------------------------------------------
+    Bone::Bone(unsigned short handle, Skeleton* creator) 
+        : Node(), mHandle(handle), mManuallyControlled(false), mCreator(creator)
+    {
+    }
+    //---------------------------------------------------------------------
+    Bone::Bone(const String& name, unsigned short handle, Skeleton* creator) 
+        : Node(name), mHandle(handle), mManuallyControlled(false), mCreator(creator)
+    {
+    }
+    //---------------------------------------------------------------------
+    Bone::~Bone()
+    {
+    }
+    //---------------------------------------------------------------------
+    Bone* Bone::createChild(unsigned short handle, const Vector3& translate, 
+        const Quaternion& rotate)
+    {
+        Bone* retBone = mCreator->createBone(handle);
+        retBone->translate(translate);
+        retBone->rotate(rotate);
+        this->addChild(retBone);
+        return retBone;
+    }
+    //---------------------------------------------------------------------
+    Node* Bone::createChildImpl(void)
+    {
+        return mCreator->createBone();
+    }
+    //---------------------------------------------------------------------
+    Node* Bone::createChildImpl(const String& name)
+    {
+        return mCreator->createBone(name);
+    }
+    //---------------------------------------------------------------------
+    void Bone::setBindingPose(void)
+    {
+        setInitialState();
+
+        // Save inverse derived position/scale/orientation, used for calculate offset transform later
+        mBindDerivedInversePosition = - _getDerivedPosition();
+        mBindDerivedInverseScale = Vector3::UNIT_SCALE / _getDerivedScale();
+        mBindDerivedInverseOrientation = _getDerivedOrientation().Inverse();
+    }
+    //---------------------------------------------------------------------
+    void Bone::reset(void)
+    {
+        resetToInitialState();
+    }
+    //---------------------------------------------------------------------
+    void Bone::setManuallyControlled(bool manuallyControlled) 
+	{
+        mManuallyControlled = manuallyControlled;
+		mCreator->_notifyManualBoneStateChange(this);
+    }
+    //---------------------------------------------------------------------
+    bool Bone::isManuallyControlled() const {
+        return mManuallyControlled;
+    }
+    //---------------------------------------------------------------------
+    void Bone::_getOffsetTransform(Matrix4& m) const
+    {
+        // Combine scale with binding pose inverse scale,
+        // NB just combine as equivalent axes, no shearing
+        Vector3 scale = _getDerivedScale() * mBindDerivedInverseScale;
+
+        // Combine orientation with binding pose inverse orientation
+        Quaternion rotate = _getDerivedOrientation() * mBindDerivedInverseOrientation;
+
+        // Combine position with binding pose inverse position,
+        // Note that translation is relative to scale & rotation,
+        // so first reverse transform original derived position to
+        // binding pose bone space, and then transform to current
+        // derived bone space.
+        Vector3 translate = _getDerivedPosition() + rotate * (scale * mBindDerivedInversePosition);
+
+        m.makeTransform(translate, scale, rotate);
+    }
+    //---------------------------------------------------------------------
+    unsigned short Bone::getHandle(void) const
+    {
+        return mHandle;
+    }
+	//---------------------------------------------------------------------
+	void Bone::needUpdate(bool forceParentUpdate)
+	{
+		Node::needUpdate(forceParentUpdate);
+
+		if (isManuallyControlled())
+		{
+			// Dirty the skeleton if manually controlled so animation can be updated
+			mCreator->_notifyManualBonesDirty();
+		}
+
+	}
+
+
+
+
+
+}
+
Index: /OgreMain/src/OgreBorderPanelOverlayElement.cpp
===================================================================
--- /OgreMain/src/OgreBorderPanelOverlayElement.cpp	(revision 5)
+++ /OgreMain/src/OgreBorderPanelOverlayElement.cpp	(revision 5)
@@ -0,0 +1,821 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright  2000-2005 The OGRE Team
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreBorderPanelOverlayElement.h"
+#include "OgreMaterialManager.h"
+#include "OgreMaterial.h"
+#include "OgreStringConverter.h"
+#include "OgreOverlayManager.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreHardwareIndexBuffer.h"
+#include "OgreException.h"
+#include "OgreRenderQueue.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+
+namespace Ogre {
+    //---------------------------------------------------------------------
+    String BorderPanelOverlayElement::msTypeName = "BorderPanel";
+    BorderPanelOverlayElement::CmdBorderSize BorderPanelOverlayElement::msCmdBorderSize;
+    BorderPanelOverlayElement::CmdBorderMaterial BorderPanelOverlayElement::msCmdBorderMaterial;
+    BorderPanelOverlayElement::CmdBorderLeftUV BorderPanelOverlayElement::msCmdBorderLeftUV;
+    BorderPanelOverlayElement::CmdBorderTopUV BorderPanelOverlayElement::msCmdBorderTopUV;
+    BorderPanelOverlayElement::CmdBorderBottomUV BorderPanelOverlayElement::msCmdBorderBottomUV;
+    BorderPanelOverlayElement::CmdBorderRightUV BorderPanelOverlayElement::msCmdBorderRightUV;
+    BorderPanelOverlayElement::CmdBorderTopLeftUV BorderPanelOverlayElement::msCmdBorderTopLeftUV;
+    BorderPanelOverlayElement::CmdBorderBottomLeftUV BorderPanelOverlayElement::msCmdBorderBottomLeftUV;
+    BorderPanelOverlayElement::CmdBorderTopRightUV BorderPanelOverlayElement::msCmdBorderTopRightUV;
+    BorderPanelOverlayElement::CmdBorderBottomRightUV BorderPanelOverlayElement::msCmdBorderBottomRightUV;
+
+    #define BCELL_UV(x) (x * 4 * 2)
+    #define POSITION_BINDING 0
+    #define TEXCOORD_BINDING 1
+    //---------------------------------------------------------------------
+    BorderPanelOverlayElement::BorderPanelOverlayElement(const String& name)
+      : PanelOverlayElement(name), 
+        mLeftBorderSize(0),
+        mRightBorderSize(0),
+        mTopBorderSize(0),
+        mBottomBorderSize(0),
+        mPixelLeftBorderSize(0),
+        mPixelRightBorderSize(0),
+        mPixelTopBorderSize(0),
+        mPixelBottomBorderSize(0),
+        mpBorderMaterial(0),
+        mBorderRenderable(0)
+    {
+        if (createParamDictionary("BorderPanelOverlayElement"))
+        {
+            addBaseParameters();
+        }
+    }
+    //---------------------------------------------------------------------
+    BorderPanelOverlayElement::~BorderPanelOverlayElement()
+    {
+        delete mRenderOp2.vertexData;
+        delete mRenderOp2.indexData;
+        delete mBorderRenderable;
+    }
+    //---------------------------------------------------------------------
+    void BorderPanelOverlayElement::initialise(void)
+    {
+		bool init = !mInitialised;
+
+        PanelOverlayElement::initialise();
+
+        // superclass will handle the interior panel area 
+
+        if (init)
+		{
+			// Setup render op in advance
+			mRenderOp2.vertexData = new VertexData();
+			mRenderOp2.vertexData->vertexCount = 4 * 8; // 8 cells, can't necessarily share vertices cos
+														// texcoords may differ
+			mRenderOp2.vertexData->vertexStart = 0;
+
+			// Vertex declaration
+			VertexDeclaration* decl = mRenderOp2.vertexData->vertexDeclaration;
+			// Position and texture coords each have their own buffers to allow
+			// each to be edited separately with the discard flag
+			decl->addElement(POSITION_BINDING, 0, VET_FLOAT3, VES_POSITION);
+			decl->addElement(TEXCOORD_BINDING, 0, VET_FLOAT2, VES_TEXTURE_COORDINATES, 0);
+
+			// Vertex buffer #1, position
+			HardwareVertexBufferSharedPtr vbuf = HardwareBufferManager::getSingleton()
+				.createVertexBuffer(
+					decl->getVertexSize(POSITION_BINDING), 
+					mRenderOp2.vertexData->vertexCount,
+					HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+			// bind position
+			VertexBufferBinding* binding = mRenderOp2.vertexData->vertexBufferBinding;
+			binding->setBinding(POSITION_BINDING, vbuf);
+
+			// Vertex buffer #2, texcoords
+			vbuf = HardwareBufferManager::getSingleton()
+				.createVertexBuffer(
+					decl->getVertexSize(TEXCOORD_BINDING), 
+					mRenderOp2.vertexData->vertexCount,
+					HardwareBuffer::HBU_STATIC_WRITE_ONLY, true);
+			// bind texcoord
+			binding->setBinding(TEXCOORD_BINDING, vbuf);
+
+			mRenderOp2.operationType = RenderOperation::OT_TRIANGLE_LIST;
+			mRenderOp2.useIndexes = true;
+			// Index data
+			mRenderOp2.indexData = new IndexData();
+			mRenderOp2.indexData->indexCount = 8 * 6;
+			mRenderOp2.indexData->indexStart = 0;
+
+			/* Each cell is
+				0-----2
+				|    /|
+				|  /  |
+				|/    |
+				1-----3
+			*/
+			mRenderOp2.indexData->indexBuffer = HardwareBufferManager::getSingleton().
+				createIndexBuffer(
+					HardwareIndexBuffer::IT_16BIT, 
+					mRenderOp2.indexData->indexCount, 
+					HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+
+			ushort* pIdx = static_cast<ushort*>(
+				mRenderOp2.indexData->indexBuffer->lock(
+					0, 
+					mRenderOp2.indexData->indexBuffer->getSizeInBytes(), 
+					HardwareBuffer::HBL_DISCARD) );
+
+			for (int cell = 0; cell < 8; ++cell)
+			{
+				ushort base = cell * 4;
+				*pIdx++ = base;
+				*pIdx++ = base + 1;
+				*pIdx++ = base + 2;
+
+				*pIdx++ = base + 2;
+				*pIdx++ = base + 1;
+				*pIdx++ = base + 3;
+			}
+
+			mRenderOp2.indexData->indexBuffer->unlock();
+
+			// Create sub-object for rendering border
+			mBorderRenderable = new BorderRenderable(this);
+
+			mInitialised = true;
+		}
+    }
+    //---------------------------------------------------------------------
+    void BorderPanelOverlayElement::addBaseParameters(void)
+    {
+        PanelOverlayElement::addBaseParameters();
+        ParamDictionary* dict = getParamDictionary();
+
+        dict->addParameter(ParameterDef("border_size", 
+            "The sizes of the borders relative to the screen size, in the order "
+            "left, right, top, bottom."
+            , PT_STRING),
+            &msCmdBorderSize);
+        dict->addParameter(ParameterDef("border_material", 
+            "The material to use for the border."
+            , PT_STRING),
+            &msCmdBorderMaterial);
+        dict->addParameter(ParameterDef("border_topleft_uv", 
+            "The texture coordinates for the top-left corner border texture. 2 sets of uv values, "
+            "one for the top-left corner, the other for the bottom-right corner."
+            , PT_STRING),
+            &msCmdBorderTopLeftUV);
+        dict->addParameter(ParameterDef("border_topright_uv", 
+            "The texture coordinates for the top-right corner border texture. 2 sets of uv values, "
+            "one for the top-left corner, the other for the bottom-right corner."
+            , PT_STRING),
+            &msCmdBorderTopRightUV);
+        dict->addParameter(ParameterDef("border_bottomright_uv", 
+            "The texture coordinates for the bottom-right corner border texture. 2 sets of uv values, "
+            "one for the top-left corner, the other for the bottom-right corner."
+            , PT_STRING),
+            &msCmdBorderBottomRightUV);
+        dict->addParameter(ParameterDef("border_bottomleft_uv", 
+            "The texture coordinates for the bottom-left corner border texture. 2 sets of uv values, "
+            "one for the top-left corner, the other for the bottom-right corner."
+            , PT_STRING),
+            &msCmdBorderBottomLeftUV);
+        dict->addParameter(ParameterDef("border_left_uv", 
+            "The texture coordinates for the left edge border texture. 2 sets of uv values, "
+            "one for the top-left corner, the other for the bottom-right corner."
+            , PT_STRING),
+            &msCmdBorderLeftUV);
+        dict->addParameter(ParameterDef("border_top_uv", 
+            "The texture coordinates for the top edge border texture. 2 sets of uv values, "
+            "one for the top-left corner, the other for the bottom-right corner."
+            , PT_STRING),
+            &msCmdBorderTopUV);
+        dict->addParameter(ParameterDef("border_right_uv", 
+            "The texture coordinates for the right edge border texture. 2 sets of uv values, "
+            "one for the top-left corner, the other for the bottom-right corner."
+            , PT_STRING),
+            &msCmdBorderRightUV);
+        dict->addParameter(ParameterDef("border_bottom_uv", 
+            "The texture coordinates for the bottom edge border texture. 2 sets of uv values, "
+            "one for the top-left corner, the other for the bottom-right corner."
+            , PT_STRING),
+            &msCmdBorderBottomUV);
+
+    }
+    //---------------------------------------------------------------------
+    void BorderPanelOverlayElement::setBorderSize(Real size)
+    {
+        if (mMetricsMode != GMM_RELATIVE)
+        {
+            mPixelLeftBorderSize = mPixelRightBorderSize = 
+                mPixelTopBorderSize = mPixelBottomBorderSize = static_cast<unsigned>(size);
+        }
+        else
+        {
+            mLeftBorderSize = mRightBorderSize = 
+                mTopBorderSize = mBottomBorderSize = size;
+        }
+        mGeomPositionsOutOfDate = true;
+    }
+    //---------------------------------------------------------------------
+    void BorderPanelOverlayElement::setBorderSize(Real sides, Real topAndBottom)
+    {
+        if (mMetricsMode != GMM_RELATIVE)
+        {
+            mPixelLeftBorderSize = mPixelRightBorderSize = static_cast<unsigned>(sides);
+            mPixelTopBorderSize = mPixelBottomBorderSize = static_cast<unsigned>(topAndBottom);
+        }
+        else
+        {
+            mLeftBorderSize = mRightBorderSize = sides;
+            mTopBorderSize = mBottomBorderSize = topAndBottom;
+        }
+        mGeomPositionsOutOfDate = true;
+
+
+    }
+    //---------------------------------------------------------------------
+    void BorderPanelOverlayElement::setBorderSize(Real left, Real right, Real top, Real bottom)
+    {
+        if (mMetricsMode != GMM_RELATIVE)
+        {
+            mPixelLeftBorderSize = static_cast<unsigned>(left);
+            mPixelRightBorderSize = static_cast<unsigned>(right);
+            mPixelTopBorderSize = static_cast<unsigned>(top);
+            mPixelBottomBorderSize = static_cast<unsigned>(bottom);
+        }
+        else
+        {
+            mLeftBorderSize = left;
+            mRightBorderSize = right;
+            mTopBorderSize = top;
+            mBottomBorderSize = bottom;
+        }
+        mGeomPositionsOutOfDate = true;
+    }
+    //---------------------------------------------------------------------
+    Real BorderPanelOverlayElement::getLeftBorderSize(void) const
+    {
+        if (mMetricsMode == GMM_PIXELS)
+        {
+			return mPixelLeftBorderSize;
+		}
+		else
+		{
+			return mLeftBorderSize;
+		}
+    }
+    //---------------------------------------------------------------------
+    Real BorderPanelOverlayElement::getRightBorderSize(void) const
+    {
+        if (mMetricsMode == GMM_PIXELS)
+        {
+			return mPixelRightBorderSize;
+		}
+		else
+		{
+			return mRightBorderSize;
+		}
+    }
+    //---------------------------------------------------------------------
+    Real BorderPanelOverlayElement::getTopBorderSize(void) const
+    {
+        if (mMetricsMode == GMM_PIXELS)
+        {
+			return mPixelTopBorderSize;
+		}
+		else
+		{
+			return mTopBorderSize;
+		}
+    }
+    //---------------------------------------------------------------------
+    Real BorderPanelOverlayElement::getBottomBorderSize(void) const
+    {
+        if (mMetricsMode == GMM_PIXELS)
+        {
+			return mPixelBottomBorderSize;
+		}
+		else
+		{
+			return mBottomBorderSize;
+		}
+    }
+    //---------------------------------------------------------------------
+    void BorderPanelOverlayElement::updateTextureGeometry()
+    {
+		PanelOverlayElement::updateTextureGeometry();
+		/* Each cell is
+			0-----2
+			|    /|
+			|  /  |
+			|/    |
+			1-----3
+		*/
+		// No choice but to lock / unlock each time here, but lock only small sections
+	    
+		HardwareVertexBufferSharedPtr vbuf = 
+			mRenderOp2.vertexData->vertexBufferBinding->getBuffer(TEXCOORD_BINDING);
+		// Can't use discard since this discards whole buffer
+		float* pUV = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD));
+		
+		for (uint i = 0; i < 8; ++i)
+		{
+			*pUV++ = mBorderUV[i].u1; *pUV++ = mBorderUV[i].v1;
+			*pUV++ = mBorderUV[i].u1; *pUV++ = mBorderUV[i].v2;
+			*pUV++ = mBorderUV[i].u2; *pUV++ = mBorderUV[i].v1;
+			*pUV++ = mBorderUV[i].u2; *pUV++ = mBorderUV[i].v2;
+		}
+
+		vbuf->unlock();
+    }
+    //---------------------------------------------------------------------
+    String BorderPanelOverlayElement::getCellUVString(BorderCellIndex idx) const
+    {
+        String ret = StringConverter::toString(mBorderUV[idx].u1) + " " +
+		            StringConverter::toString(mBorderUV[idx].v1) + " " +
+		            StringConverter::toString(mBorderUV[idx].u2) + " " +
+		            StringConverter::toString(mBorderUV[idx].v2);
+        return ret;
+    }
+    //---------------------------------------------------------------------
+    void BorderPanelOverlayElement::setLeftBorderUV(Real u1, Real v1, Real u2, Real v2)
+    {
+		mBorderUV[BCELL_LEFT].u1 = u1; 
+		mBorderUV[BCELL_LEFT].u2 = u2; 
+		mBorderUV[BCELL_LEFT].v1 = v1; 
+		mBorderUV[BCELL_LEFT].v2 = v2; 
+		mGeomUVsOutOfDate = true;
+    }
+    //---------------------------------------------------------------------
+    void BorderPanelOverlayElement::setRightBorderUV(Real u1, Real v1, Real u2, Real v2)
+    {
+		mBorderUV[BCELL_RIGHT].u1 = u1; 
+		mBorderUV[BCELL_RIGHT].u2 = u2; 
+		mBorderUV[BCELL_RIGHT].v1 = v1; 
+		mBorderUV[BCELL_RIGHT].v2 = v2; 
+		mGeomUVsOutOfDate = true;
+    }
+    //---------------------------------------------------------------------
+    void BorderPanelOverlayElement::setTopBorderUV(Real u1, Real v1, Real u2, Real v2)
+    {
+		mBorderUV[BCELL_TOP].u1 = u1; 
+		mBorderUV[BCELL_TOP].u2 = u2; 
+		mBorderUV[BCELL_TOP].v1 = v1; 
+		mBorderUV[BCELL_TOP].v2 = v2; 
+		mGeomUVsOutOfDate = true;
+    }
+    //---------------------------------------------------------------------
+    void BorderPanelOverlayElement::setBottomBorderUV(Real u1, Real v1, Real u2, Real v2)
+    {
+		mBorderUV[BCELL_BOTTOM].u1 = u1; 
+		mBorderUV[BCELL_BOTTOM].u2 = u2; 
+		mBorderUV[BCELL_BOTTOM].v1 = v1; 
+		mBorderUV[BCELL_BOTTOM].v2 = v2; 
+		mGeomUVsOutOfDate = true;
+    }
+    //---------------------------------------------------------------------
+    void BorderPanelOverlayElement::setTopLeftBorderUV(Real u1, Real v1, Real u2, Real v2)
+    {
+		mBorderUV[BCELL_TOP_LEFT].u1 = u1; 
+		mBorderUV[BCELL_TOP_LEFT].u2 = u2; 
+		mBorderUV[BCELL_TOP_LEFT].v1 = v1; 
+		mBorderUV[BCELL_TOP_LEFT].v2 = v2; 
+		mGeomUVsOutOfDate = true;
+    }
+    //---------------------------------------------------------------------
+    void BorderPanelOverlayElement::setTopRightBorderUV(Real u1, Real v1, Real u2, Real v2)
+    {
+		mBorderUV[BCELL_TOP_RIGHT].u1 = u1; 
+		mBorderUV[BCELL_TOP_RIGHT].u2 = u2; 
+		mBorderUV[BCELL_TOP_RIGHT].v1 = v1; 
+		mBorderUV[BCELL_TOP_RIGHT].v2 = v2; 
+		mGeomUVsOutOfDate = true;
+    }
+    //---------------------------------------------------------------------
+    void BorderPanelOverlayElement::setBottomLeftBorderUV(Real u1, Real v1, Real u2, Real v2)
+    {
+		mBorderUV[BCELL_BOTTOM_LEFT].u1 = u1; 
+		mBorderUV[BCELL_BOTTOM_LEFT].u2 = u2; 
+		mBorderUV[BCELL_BOTTOM_LEFT].v1 = v1; 
+		mBorderUV[BCELL_BOTTOM_LEFT].v2 = v2; 
+		mGeomUVsOutOfDate = true;
+    }
+    //---------------------------------------------------------------------
+    void BorderPanelOverlayElement::setBottomRightBorderUV(Real u1, Real v1, Real u2, Real v2)
+    {
+		mBorderUV[BCELL_BOTTOM_RIGHT].u1 = u1; 
+		mBorderUV[BCELL_BOTTOM_RIGHT].u2 = u2; 
+		mBorderUV[BCELL_BOTTOM_RIGHT].v1 = v1; 
+		mBorderUV[BCELL_BOTTOM_RIGHT].v2 = v2; 
+		mGeomUVsOutOfDate = true;
+    }
+
+    //---------------------------------------------------------------------
+    String BorderPanelOverlayElement::getLeftBorderUVString() const
+    {
+        return getCellUVString(BCELL_LEFT);
+    }
+    //---------------------------------------------------------------------
+    String BorderPanelOverlayElement::getRightBorderUVString() const
+    {
+        return getCellUVString(BCELL_RIGHT);
+    }
+    //---------------------------------------------------------------------
+    String BorderPanelOverlayElement::getTopBorderUVString() const
+    {
+        return getCellUVString(BCELL_TOP);
+    }
+    //---------------------------------------------------------------------
+    String BorderPanelOverlayElement::getBottomBorderUVString() const
+    {
+        return getCellUVString(BCELL_BOTTOM);
+    }
+    //---------------------------------------------------------------------
+    String BorderPanelOverlayElement::getTopLeftBorderUVString() const
+    {
+        return getCellUVString(BCELL_TOP_LEFT);
+    }
+    //---------------------------------------------------------------------
+    String BorderPanelOverlayElement::getTopRightBorderUVString() const
+    {
+        return getCellUVString(BCELL_TOP_RIGHT);
+    }
+    //---------------------------------------------------------------------
+    String BorderPanelOverlayElement::getBottomLeftBorderUVString() const
+    {
+        return getCellUVString(BCELL_BOTTOM_LEFT);
+    }
+    //---------------------------------------------------------------------
+    String BorderPanelOverlayElement::getBottomRightBorderUVString() const
+    {
+        return getCellUVString(BCELL_BOTTOM_RIGHT);
+    }
+
+
+
+
+
+    //---------------------------------------------------------------------
+    void BorderPanelOverlayElement::setBorderMaterialName(const String& name)
+    {
+        mBorderMaterialName = name;
+        mpBorderMaterial = MaterialManager::getSingleton().getByName(name);
+        if (mpBorderMaterial.isNull())
+			OGRE_EXCEPT( Exception::ERR_ITEM_NOT_FOUND, "Could not find material " + name,
+				"BorderPanelOverlayElement::setBorderMaterialName" );
+        mpBorderMaterial->load();
+        // Set some prerequisites to be sure
+        mpBorderMaterial->setLightingEnabled(false);
+        mpBorderMaterial->setDepthCheckEnabled(false);
+
+    }
+    //---------------------------------------------------------------------
+    const String& BorderPanelOverlayElement::getBorderMaterialName(void) const
+    {
+        return mBorderMaterialName;
+    }
+    //---------------------------------------------------------------------
+    void BorderPanelOverlayElement::updatePositionGeometry(void)
+    {
+		/*
+		Grid is like this:
+		+--+---------------+--+
+		|0 |       1       |2 |
+		+--+---------------+--+
+		|  |               |  |
+		|  |               |  |
+		|3 |    center     |4 |
+		|  |               |  |
+		+--+---------------+--+
+		|5 |       6       |7 |
+		+--+---------------+--+
+		*/
+		// Convert positions into -1, 1 coordinate space (homogenous clip space)
+		// Top / bottom also need inverting since y is upside down
+		Real left[8], right[8], top[8], bottom[8];
+		// Horizontal
+		left[0] = left[3] = left[5] = _getDerivedLeft() * 2 - 1;
+		left[1] = left[6] = right[0] = right[3] = right[5] = left[0] + (mLeftBorderSize * 2);
+		right[2] = right[4] = right[7] = left[0] + (mWidth * 2);
+		left[2] = left[4] = left[7] = right[1] = right[6] = right[2] - (mRightBorderSize * 2);
+		// Vertical
+		top[0] = top[1] = top[2] = -((_getDerivedTop() * 2) - 1);
+		top[3] = top[4] = bottom[0] = bottom[1] = bottom[2] = top[0] - (mTopBorderSize * 2);
+		bottom[5] = bottom[6] = bottom[7] = top[0] -  (mHeight * 2);
+		top[5] = top[6] = top[7] = bottom[3] = bottom[4] = bottom[5] + (mBottomBorderSize * 2);
+
+		// Lock the whole position buffer in discard mode
+		HardwareVertexBufferSharedPtr vbuf = 
+			mRenderOp2.vertexData->vertexBufferBinding->getBuffer(POSITION_BINDING);
+		float* pPos = static_cast<float*>(
+			vbuf->lock(HardwareBuffer::HBL_DISCARD) );
+		// Use the furthest away depth value, since materials should have depth-check off
+		// This initialised the depth buffer for any 3D objects in front
+		Real zValue = Root::getSingleton().getRenderSystem()->getMaximumDepthInputValue();
+		for (ushort cell = 0; cell < 8; ++cell)
+		{
+			/*
+				0-----2
+				|    /|
+				|  /  |
+				|/    |
+				1-----3
+			*/
+			*pPos++ = left[cell];
+			*pPos++ = top[cell];
+			*pPos++ = zValue;
+
+			*pPos++ = left[cell];
+			*pPos++ = bottom[cell];
+			*pPos++ = zValue;
+
+			*pPos++ = right[cell];
+			*pPos++ = top[cell];
+			*pPos++ = zValue;
+
+			*pPos++ = right[cell];
+			*pPos++ = bottom[cell];
+			*pPos++ = zValue;
+
+		}
+		vbuf->unlock();
+
+		// Also update center geometry
+		// NB don't use superclass because we need to make it smaller because of border
+		vbuf = mRenderOp.vertexData->vertexBufferBinding->getBuffer(POSITION_BINDING);
+		pPos = static_cast<float*>(
+			vbuf->lock(HardwareBuffer::HBL_DISCARD) );
+		// Use cell 1 and 3 to determine positions
+		*pPos++ = left[1];
+		*pPos++ = top[3];
+		*pPos++ = zValue;
+
+		*pPos++ = left[1];
+		*pPos++ = bottom[3];
+		*pPos++ = zValue;
+
+		*pPos++ = right[1];
+		*pPos++ = top[3];
+		*pPos++ = zValue;
+
+		*pPos++ = right[1];
+		*pPos++ = bottom[3];
+		*pPos++ = zValue;
+
+		vbuf->unlock();
+    }
+    //---------------------------------------------------------------------
+    void BorderPanelOverlayElement::_updateRenderQueue(RenderQueue* queue)
+    {
+        // Add self twice to the queue
+        // Have to do this to allow 2 materials
+        if (mVisible)
+        {
+
+            // Add outer
+            queue->addRenderable(mBorderRenderable, RENDER_QUEUE_OVERLAY, mZOrder);
+
+			// do inner last so the border artifacts don't overwrite the children
+            // Add inner
+            PanelOverlayElement::_updateRenderQueue(queue);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void BorderPanelOverlayElement::setMetricsMode(GuiMetricsMode gmm)
+    {
+        PanelOverlayElement::setMetricsMode(gmm);
+        if (gmm != GMM_RELATIVE)
+        {
+            mPixelBottomBorderSize = static_cast<unsigned>(mBottomBorderSize);
+            mPixelLeftBorderSize = static_cast<unsigned>(mLeftBorderSize);
+            mPixelRightBorderSize = static_cast<unsigned>(mRightBorderSize);
+            mPixelTopBorderSize = static_cast<unsigned>(mTopBorderSize);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void BorderPanelOverlayElement::_update(void)
+    {
+        if (mMetricsMode != GMM_RELATIVE && 
+            (OverlayManager::getSingleton().hasViewportChanged() || mGeomPositionsOutOfDate))
+        {
+            mLeftBorderSize = mPixelLeftBorderSize * mPixelScaleX;
+            mRightBorderSize = mPixelRightBorderSize * mPixelScaleX;
+            mTopBorderSize = mPixelTopBorderSize * mPixelScaleY;
+            mBottomBorderSize = mPixelBottomBorderSize * mPixelScaleY;
+            mGeomPositionsOutOfDate = true;
+        }
+		PanelOverlayElement::_update();
+    }
+    //-----------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    // Command objects
+    //---------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String BorderPanelOverlayElement::CmdBorderSize::doGet(const void* target) const
+    {
+		const BorderPanelOverlayElement* t = static_cast<const BorderPanelOverlayElement*>(target);
+        return String(
+			StringConverter::toString(t->getLeftBorderSize()) + " " +
+			StringConverter::toString(t->getRightBorderSize()) + " " +
+			StringConverter::toString(t->getTopBorderSize()) + " " +
+			StringConverter::toString(t->getBottomBorderSize())	);
+    }
+    void BorderPanelOverlayElement::CmdBorderSize::doSet(void* target, const String& val)
+    {
+        std::vector<String> vec = StringUtil::split(val);
+
+        static_cast<BorderPanelOverlayElement*>(target)->setBorderSize(
+            StringConverter::parseReal(vec[0]),
+            StringConverter::parseReal(vec[1]),
+            StringConverter::parseReal(vec[2]),
+            StringConverter::parseReal(vec[3])
+            );
+    }
+    //-----------------------------------------------------------------------
+    String BorderPanelOverlayElement::CmdBorderMaterial::doGet(const void* target) const
+    {
+        // No need right now..
+        return static_cast<const BorderPanelOverlayElement*>(target)->getBorderMaterialName();
+    }
+    void BorderPanelOverlayElement::CmdBorderMaterial::doSet(void* target, const String& val)
+    {
+        std::vector<String> vec = StringUtil::split(val);
+
+        static_cast<BorderPanelOverlayElement*>(target)->setBorderMaterialName(val);
+    }
+    //-----------------------------------------------------------------------
+    String BorderPanelOverlayElement::CmdBorderBottomLeftUV::doGet(const void* target) const
+    {
+        // No need right now..
+		return  static_cast<const BorderPanelOverlayElement*>(target)->getBottomLeftBorderUVString();
+    }
+    void BorderPanelOverlayElement::CmdBorderBottomLeftUV::doSet(void* target, const String& val)
+    {
+        std::vector<String> vec = StringUtil::split(val);
+
+        static_cast<BorderPanelOverlayElement*>(target)->setBottomLeftBorderUV(
+            StringConverter::parseReal(vec[0]),
+            StringConverter::parseReal(vec[1]),
+            StringConverter::parseReal(vec[2]),
+            StringConverter::parseReal(vec[3])
+            );
+    }
+    //-----------------------------------------------------------------------
+    String BorderPanelOverlayElement::CmdBorderBottomRightUV::doGet(const void* target) const
+    {
+        // No need right now..
+		return  static_cast<const BorderPanelOverlayElement*>(target)->getBottomRightBorderUVString();
+    }
+    void BorderPanelOverlayElement::CmdBorderBottomRightUV::doSet(void* target, const String& val)
+    {
+        std::vector<String> vec = StringUtil::split(val);
+
+        static_cast<BorderPanelOverlayElement*>(target)->setBottomRightBorderUV(
+            StringConverter::parseReal(vec[0]),
+            StringConverter::parseReal(vec[1]),
+            StringConverter::parseReal(vec[2]),
+            StringConverter::parseReal(vec[3])
+            );
+    }
+    //-----------------------------------------------------------------------
+    String BorderPanelOverlayElement::CmdBorderTopLeftUV::doGet(const void* target) const
+    {
+        // No need right now..
+		return  static_cast<const BorderPanelOverlayElement*>(target)->getTopLeftBorderUVString();
+    }
+    void BorderPanelOverlayElement::CmdBorderTopLeftUV::doSet(void* target, const String& val)
+    {
+        std::vector<String> vec = StringUtil::split(val);
+
+        static_cast<BorderPanelOverlayElement*>(target)->setTopLeftBorderUV(
+            StringConverter::parseReal(vec[0]),
+            StringConverter::parseReal(vec[1]),
+            StringConverter::parseReal(vec[2]),
+            StringConverter::parseReal(vec[3])
+            );
+    }
+    //-----------------------------------------------------------------------
+    String BorderPanelOverlayElement::CmdBorderTopRightUV::doGet(const void* target) const
+    {
+        // No need right now..
+		return  static_cast<const BorderPanelOverlayElement*>(target)->getTopRightBorderUVString();
+    }
+    void BorderPanelOverlayElement::CmdBorderTopRightUV::doSet(void* target, const String& val)
+    {
+        std::vector<String> vec = StringUtil::split(val);
+
+        static_cast<BorderPanelOverlayElement*>(target)->setTopRightBorderUV(
+            StringConverter::parseReal(vec[0]),
+            StringConverter::parseReal(vec[1]),
+            StringConverter::parseReal(vec[2]),
+            StringConverter::parseReal(vec[3])
+            );
+    }
+    //-----------------------------------------------------------------------
+    String BorderPanelOverlayElement::CmdBorderLeftUV::doGet(const void* target) const
+    {
+        // No need right now..
+		return  static_cast<const BorderPanelOverlayElement*>(target)->getLeftBorderUVString();
+    }
+    void BorderPanelOverlayElement::CmdBorderLeftUV::doSet(void* target, const String& val)
+    {
+        std::vector<String> vec = StringUtil::split(val);
+
+        static_cast<BorderPanelOverlayElement*>(target)->setLeftBorderUV(
+            StringConverter::parseReal(vec[0]),
+            StringConverter::parseReal(vec[1]),
+            StringConverter::parseReal(vec[2]),
+            StringConverter::parseReal(vec[3])
+            );
+    }
+    //-----------------------------------------------------------------------
+    String BorderPanelOverlayElement::CmdBorderRightUV::doGet(const void* target) const
+    {
+        // No need right now..
+		return  static_cast<const BorderPanelOverlayElement*>(target)->getRightBorderUVString();
+    }
+    void BorderPanelOverlayElement::CmdBorderRightUV::doSet(void* target, const String& val)
+    {
+        std::vector<String> vec = StringUtil::split(val);
+
+        static_cast<BorderPanelOverlayElement*>(target)->setRightBorderUV(
+            StringConverter::parseReal(vec[0]),
+            StringConverter::parseReal(vec[1]),
+            StringConverter::parseReal(vec[2]),
+            StringConverter::parseReal(vec[3])
+            );
+    }
+    //-----------------------------------------------------------------------
+    String BorderPanelOverlayElement::CmdBorderTopUV::doGet(const void* target) const
+    {
+        // No need right now..
+		return  static_cast<const BorderPanelOverlayElement*>(target)->getTopBorderUVString();
+    }
+    void BorderPanelOverlayElement::CmdBorderTopUV::doSet(void* target, const String& val)
+    {
+        std::vector<String> vec = StringUtil::split(val);
+
+        static_cast<BorderPanelOverlayElement*>(target)->setTopBorderUV(
+            StringConverter::parseReal(vec[0]),
+            StringConverter::parseReal(vec[1]),
+            StringConverter::parseReal(vec[2]),
+            StringConverter::parseReal(vec[3])
+            );
+    }
+    //-----------------------------------------------------------------------
+    String BorderPanelOverlayElement::CmdBorderBottomUV::doGet(const void* target) const
+    {
+        // No need right now..
+		return  static_cast<const BorderPanelOverlayElement*>(target)->getBottomBorderUVString();
+    }
+    void BorderPanelOverlayElement::CmdBorderBottomUV::doSet(void* target, const String& val)
+    {
+        std::vector<String> vec = StringUtil::split(val);
+
+        static_cast<BorderPanelOverlayElement*>(target)->setBottomBorderUV(
+            StringConverter::parseReal(vec[0]),
+            StringConverter::parseReal(vec[1]),
+            StringConverter::parseReal(vec[2]),
+            StringConverter::parseReal(vec[3])
+            );
+    }
+    //---------------------------------------------------------------------
+    const String& BorderPanelOverlayElement::getTypeName(void) const
+    {
+        return msTypeName;
+    }
+
+
+
+}
+
Index: /OgreMain/src/OgreCamera.cpp
===================================================================
--- /OgreMain/src/OgreCamera.cpp	(revision 5)
+++ /OgreMain/src/OgreCamera.cpp	(revision 5)
@@ -0,0 +1,961 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreCamera.h"
+
+#include "OgreMath.h"
+#include "OgreMatrix3.h"
+#include "OgreSceneManager.h"
+#include "OgreSceneNode.h"
+#include "OgreAxisAlignedBox.h"
+#include "OgreSphere.h"
+#include "OgreLogManager.h"
+#include "OgreException.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+
+namespace Ogre {
+
+    String Camera::msMovableType = "Camera";
+    //-----------------------------------------------------------------------
+    Camera::Camera( const String& name, SceneManager* sm)
+        : mName( name ),
+		mSceneMgr(sm),
+		mOrientation(Quaternion::IDENTITY),
+		mPosition(Vector3::ZERO),
+		mSceneDetail(PM_SOLID),
+		mAutoTrackTarget(0),
+		mAutoTrackOffset(Vector3::ZERO),
+		mSceneLodFactor(1.0f),
+		mSceneLodFactorInv(1.0f),
+		mWindowSet(false),
+		mLastViewport(0),
+		mAutoAspectRatio(false),
+		mCullFrustum(0),
+		mUseRenderingDistance(true)
+
+    {
+
+        // Reasonable defaults to camera params
+        mFOVy = Radian(Math::PI/4.0);
+        mNearDist = 100.0f;
+        mFarDist = 100000.0f;
+        mAspect = 1.33333333333333f;
+        mProjType = PT_PERSPECTIVE;
+        setFixedYawAxis(true);    // Default to fixed yaw, like freelook since most people expect this
+
+        invalidateFrustum();
+        invalidateView();
+
+        // Init matrices
+        mViewMatrix = Matrix4::ZERO;
+        mProjMatrixRS = Matrix4::ZERO;
+
+        mParentNode = 0;
+
+        // no reflection
+        mReflect = false;
+
+        mVisible = false;
+
+    }
+
+    //-----------------------------------------------------------------------
+    Camera::~Camera()
+    {
+        // Do nothing
+    }
+
+    //-----------------------------------------------------------------------
+    SceneManager* Camera::getSceneManager(void) const
+    {
+        return mSceneMgr;
+    }
+    //-----------------------------------------------------------------------
+    const String& Camera::getName(void) const
+    {
+        return mName;
+    }
+
+
+    //-----------------------------------------------------------------------
+    void Camera::setPolygonMode(PolygonMode sd)
+    {
+        mSceneDetail = sd;
+    }
+
+    //-----------------------------------------------------------------------
+    PolygonMode Camera::getPolygonMode(void) const
+    {
+        return mSceneDetail;
+    }
+
+    //-----------------------------------------------------------------------
+    void Camera::setPosition(Real x, Real y, Real z)
+    {
+        mPosition.x = x;
+        mPosition.y = y;
+        mPosition.z = z;
+        invalidateView();
+    }
+
+    //-----------------------------------------------------------------------
+    void Camera::setPosition(const Vector3& vec)
+    {
+        mPosition = vec;
+        invalidateView();
+    }
+
+    //-----------------------------------------------------------------------
+    const Vector3& Camera::getPosition(void) const
+    {
+        return mPosition;
+    }
+
+    //-----------------------------------------------------------------------
+    void Camera::move(const Vector3& vec)
+    {
+        mPosition = mPosition + vec;
+        invalidateView();
+    }
+
+    //-----------------------------------------------------------------------
+    void Camera::moveRelative(const Vector3& vec)
+    {
+        // Transform the axes of the relative vector by camera's local axes
+        Vector3 trans = mOrientation * vec;
+
+        mPosition = mPosition + trans;
+        invalidateView();
+    }
+
+    //-----------------------------------------------------------------------
+    void Camera::setDirection(Real x, Real y, Real z)
+    {
+        setDirection(Vector3(x,y,z));
+    }
+
+    //-----------------------------------------------------------------------
+    void Camera::setDirection(const Vector3& vec)
+    {
+        // Do nothing if given a zero vector
+        // (Replaced assert since this could happen with auto tracking camera and
+        //  camera passes through the lookAt point)
+        if (vec == Vector3::ZERO) return;
+
+        // Remember, camera points down -Z of local axes!
+        // Therefore reverse direction of direction vector before determining local Z
+        Vector3 zAdjustVec = -vec;
+        zAdjustVec.normalise();
+
+
+        if( mYawFixed )
+        {
+            Vector3 xVec = mYawFixedAxis.crossProduct( zAdjustVec );
+            xVec.normalise();
+
+            Vector3 yVec = zAdjustVec.crossProduct( xVec );
+            yVec.normalise();
+
+            mOrientation.FromAxes( xVec, yVec, zAdjustVec );
+        }
+        else
+        {
+
+            // Get axes from current quaternion
+            Vector3 axes[3];
+            updateView();
+            mRealOrientation.ToAxes(axes);
+            Quaternion rotQuat;
+            if ( (axes[2]+zAdjustVec).squaredLength() <  0.00005f) 
+            {
+                // Oops, a 180 degree turn (infinite possible rotation axes)
+                // Default to yaw i.e. use current UP
+                rotQuat.FromAngleAxis(Radian(Math::PI), axes[1]);
+            }
+            else
+            {
+                // Derive shortest arc to new direction
+                rotQuat = axes[2].getRotationTo(zAdjustVec);
+
+            }
+            mOrientation = rotQuat * mOrientation;
+        }
+
+        // transform to parent space
+        if (mParentNode)
+        {
+            mOrientation =
+                mParentNode->_getDerivedOrientation().Inverse() * mOrientation;
+        }
+
+        // TODO If we have a fixed yaw axis, we mustn't break it by using the
+        // shortest arc because this will sometimes cause a relative yaw
+        // which will tip the camera
+
+        invalidateView();
+
+    }
+
+    //-----------------------------------------------------------------------
+    Vector3 Camera::getDirection(void) const
+    {
+        // Direction points down -Z by default
+        return mOrientation * -Vector3::UNIT_Z;
+    }
+
+    //-----------------------------------------------------------------------
+    Vector3 Camera::getUp(void) const
+    {
+        return mOrientation * Vector3::UNIT_Y;
+    }
+
+    //-----------------------------------------------------------------------
+    Vector3 Camera::getRight(void) const
+    {
+        return mOrientation * Vector3::UNIT_X;
+    }
+
+    //-----------------------------------------------------------------------
+    void Camera::lookAt(const Vector3& targetPoint)
+    {
+        updateView();
+        this->setDirection(targetPoint - mRealPosition);
+    }
+
+    //-----------------------------------------------------------------------
+    void Camera::lookAt( Real x, Real y, Real z )
+    {
+        Vector3 vTemp( x, y, z );
+        this->lookAt(vTemp);
+    }
+
+    //-----------------------------------------------------------------------
+    void Camera::roll(const Radian& angle)
+    {
+        // Rotate around local Z axis
+        Vector3 zAxis = mOrientation * Vector3::UNIT_Z;
+        rotate(zAxis, angle);
+
+        invalidateView();
+    }
+
+    //-----------------------------------------------------------------------
+    void Camera::yaw(const Radian& angle)
+    {
+        Vector3 yAxis;
+
+        if (mYawFixed)
+        {
+            // Rotate around fixed yaw axis
+            yAxis = mYawFixedAxis;
+        }
+        else
+        {
+            // Rotate around local Y axis
+            yAxis = mOrientation * Vector3::UNIT_Y;
+        }
+
+        rotate(yAxis, angle);
+
+        invalidateView();
+    }
+
+    //-----------------------------------------------------------------------
+    void Camera::pitch(const Radian& angle)
+    {
+        // Rotate around local X axis
+        Vector3 xAxis = mOrientation * Vector3::UNIT_X;
+        rotate(xAxis, angle);
+
+        invalidateView();
+
+    }
+
+    //-----------------------------------------------------------------------
+    void Camera::rotate(const Vector3& axis, const Radian& angle)
+    {
+        Quaternion q;
+        q.FromAngleAxis(angle,axis);
+        rotate(q);
+    }
+
+    //-----------------------------------------------------------------------
+    void Camera::rotate(const Quaternion& q)
+    {
+        // Note the order of the mult, i.e. q comes after
+        mOrientation = q * mOrientation;
+        invalidateView();
+
+    }
+
+    //-----------------------------------------------------------------------
+    bool Camera::isViewOutOfDate(void) const
+    {
+        // Overridden from Frustum to use local orientation / position offsets
+        // Attached to node?
+        if (mParentNode != 0)
+        {
+            if (mRecalcView ||
+                mParentNode->_getDerivedOrientation() != mLastParentOrientation ||
+                mParentNode->_getDerivedPosition() != mLastParentPosition)
+            {
+                // Ok, we're out of date with SceneNode we're attached to
+                mLastParentOrientation = mParentNode->_getDerivedOrientation();
+                mLastParentPosition = mParentNode->_getDerivedPosition();
+                mRealOrientation = mLastParentOrientation * mOrientation;
+                mRealPosition = (mLastParentOrientation * mPosition) + mLastParentPosition;
+                mRecalcView = true;
+                mRecalcWindow = true;
+            }
+        }
+        else
+        {
+            // Rely on own updates
+            mRealOrientation = mOrientation;
+            mRealPosition = mPosition;
+        }
+
+        // Deriving reflection from linked plane?
+        if (mReflect && mLinkedReflectPlane && 
+            !(mLastLinkedReflectionPlane == mLinkedReflectPlane->_getDerivedPlane()))
+        {
+            mReflectPlane = mLinkedReflectPlane->_getDerivedPlane();
+            mReflectMatrix = Math::buildReflectionMatrix(mReflectPlane);
+            mLastLinkedReflectionPlane = mLinkedReflectPlane->_getDerivedPlane();
+            mRecalcView = true;
+            mRecalcWindow = true;
+        }
+
+        // Deriving reflected orientation / position
+        if (mRecalcView)
+        {
+            if (mReflect)
+            {
+                // Calculate reflected orientation, use up-vector as fallback axis.
+				Vector3 dir = mRealOrientation * Vector3::NEGATIVE_UNIT_Z;
+				Vector3 rdir = dir.reflect(mReflectPlane.normal);
+                Vector3 up = mRealOrientation * Vector3::UNIT_Y;
+				mDerivedOrientation = dir.getRotationTo(rdir, up) * mRealOrientation;
+
+                // Calculate reflected position.
+                mDerivedPosition = mReflectMatrix.transformAffine(mRealPosition);
+            }
+            else
+            {
+                mDerivedOrientation = mRealOrientation;
+                mDerivedPosition = mRealPosition;
+            }
+        }
+
+        return mRecalcView;
+
+    }
+
+    // -------------------------------------------------------------------
+    void Camera::invalidateView() const
+    {
+        mRecalcWindow = true;
+        Frustum::invalidateView();
+    }
+    // -------------------------------------------------------------------
+    void Camera::invalidateFrustum(void) const
+    {
+        mRecalcWindow = true;
+        Frustum::invalidateFrustum();
+    }
+    //-----------------------------------------------------------------------
+    void Camera::_renderScene(Viewport *vp, bool includeOverlays)
+    {
+
+        mSceneMgr->_renderScene(this, vp, includeOverlays);
+    }
+
+
+    //-----------------------------------------------------------------------
+    std::ostream& operator<<( std::ostream& o, const Camera& c )
+    {
+        o << "Camera(Name='" << c.mName << "', pos=" << c.mPosition;
+        Vector3 dir(c.mOrientation*Vector3(0,0,-1));
+        o << ", direction=" << dir << ",near=" << c.mNearDist;
+        o << ", far=" << c.mFarDist << ", FOVy=" << c.mFOVy.valueDegrees();
+        o << ", aspect=" << c.mAspect << ", ";
+        o << ", xoffset=" << c.mFrustumOffset.x << ", yoffset=" << c.mFrustumOffset.y;
+        o << ", focalLength=" << c.mFocalLength << ", ";
+        o << "NearFrustumPlane=" << c.mFrustumPlanes[FRUSTUM_PLANE_NEAR] << ", ";
+        o << "FarFrustumPlane=" << c.mFrustumPlanes[FRUSTUM_PLANE_FAR] << ", ";
+        o << "LeftFrustumPlane=" << c.mFrustumPlanes[FRUSTUM_PLANE_LEFT] << ", ";
+        o << "RightFrustumPlane=" << c.mFrustumPlanes[FRUSTUM_PLANE_RIGHT] << ", ";
+        o << "TopFrustumPlane=" << c.mFrustumPlanes[FRUSTUM_PLANE_TOP] << ", ";
+        o << "BottomFrustumPlane=" << c.mFrustumPlanes[FRUSTUM_PLANE_BOTTOM];
+        o << ")";
+
+        return o;
+    }
+
+    //-----------------------------------------------------------------------
+    void Camera::setFixedYawAxis(bool useFixed, const Vector3& fixedAxis)
+    {
+        mYawFixed = useFixed;
+        mYawFixedAxis = fixedAxis;
+    }
+
+    //-----------------------------------------------------------------------
+    void Camera::_notifyRenderedFaces(unsigned int numfaces)
+    {
+        mVisFacesLastRender = numfaces;
+    }
+
+    //-----------------------------------------------------------------------
+    void Camera::_notifyRenderedBatches(unsigned int numbatches)
+    {
+        mVisBatchesLastRender = numbatches;
+    }
+
+    //-----------------------------------------------------------------------
+    unsigned int Camera::_getNumRenderedFaces(void) const
+    {
+        return mVisFacesLastRender;
+    }
+    //-----------------------------------------------------------------------
+    unsigned int Camera::_getNumRenderedBatches(void) const
+    {
+        return mVisBatchesLastRender;
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& Camera::getOrientation(void) const
+    {
+        return mOrientation;
+    }
+
+    //-----------------------------------------------------------------------
+    void Camera::setOrientation(const Quaternion& q)
+    {
+        mOrientation = q;
+        invalidateView();
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& Camera::getDerivedOrientation(void) const
+    {
+        updateView();
+        return mDerivedOrientation;
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& Camera::getDerivedPosition(void) const
+    {
+        updateView();
+        return mDerivedPosition;
+    }
+    //-----------------------------------------------------------------------
+    Vector3 Camera::getDerivedDirection(void) const
+    {
+        // Direction points down -Z
+        updateView();
+        return mDerivedOrientation * Vector3::NEGATIVE_UNIT_Z;
+    }
+    //-----------------------------------------------------------------------
+    Vector3 Camera::getDerivedUp(void) const
+    {
+        updateView();
+        return mDerivedOrientation * Vector3::UNIT_Y;
+    }
+    //-----------------------------------------------------------------------
+    Vector3 Camera::getDerivedRight(void) const
+    {
+        updateView();
+        return mDerivedOrientation * Vector3::UNIT_X;
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& Camera::getRealOrientation(void) const
+    {
+        updateView();
+        return mRealOrientation;
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& Camera::getRealPosition(void) const
+    {
+        updateView();
+        return mRealPosition;
+    }
+    //-----------------------------------------------------------------------
+    Vector3 Camera::getRealDirection(void) const
+    {
+        // Direction points down -Z
+        updateView();
+        return mRealOrientation * Vector3::NEGATIVE_UNIT_Z;
+    }
+    //-----------------------------------------------------------------------
+    Vector3 Camera::getRealUp(void) const
+    {
+        updateView();
+        return mRealOrientation * Vector3::UNIT_Y;
+    }
+    //-----------------------------------------------------------------------
+    Vector3 Camera::getRealRight(void) const
+    {
+        updateView();
+        return mRealOrientation * Vector3::UNIT_X;
+    }
+    //-----------------------------------------------------------------------
+    const String& Camera::getMovableType(void) const
+    {
+        return msMovableType;
+    }
+    //-----------------------------------------------------------------------
+    void Camera::setAutoTracking(bool enabled, SceneNode* target, 
+        const Vector3& offset)
+    {
+        if (enabled)
+        {
+            assert (target != 0 && "target cannot be a null pointer if tracking is enabled");
+            mAutoTrackTarget = target;
+            mAutoTrackOffset = offset;
+        }
+        else
+        {
+            mAutoTrackTarget = 0;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Camera::_autoTrack(void)
+    {
+        // NB assumes that all scene nodes have been updated
+        if (mAutoTrackTarget)
+        {
+            lookAt(mAutoTrackTarget->_getDerivedPosition() + mAutoTrackOffset);
+        }
+    }
+    //-----------------------------------------------------------------------
+	void Camera::setLodBias(Real factor)
+	{
+		assert(factor > 0.0f && "Bias factor must be > 0!");
+		mSceneLodFactor = factor;
+		mSceneLodFactorInv = 1.0f / factor;
+	}
+    //-----------------------------------------------------------------------
+	Real Camera::getLodBias(void) const
+	{
+		return mSceneLodFactor;
+	}
+    //-----------------------------------------------------------------------
+	Real Camera::_getLodBiasInverse(void) const
+	{
+		return mSceneLodFactorInv;
+	}
+    //-----------------------------------------------------------------------
+    Ray Camera::getCameraToViewportRay(Real screenX, Real screenY) const
+    {
+		Matrix4 inverseVP = (getProjectionMatrix() * getViewMatrix(true)).inverse();
+
+		Real nx = (2.0f * screenX) - 1.0f;
+		Real ny = 1.0f - (2.0f * screenY);
+		Vector3 nearPoint(nx, ny, -1.f);
+		// Use midPoint rather than far point to avoid issues with infinite projection
+		Vector3 midPoint (nx, ny,  0.0f);
+
+		// Get ray origin and ray target on near plane in world space
+		Vector3 rayOrigin, rayTarget;
+		
+		rayOrigin = inverseVP * nearPoint;
+		rayTarget = inverseVP * midPoint;
+
+		Vector3 rayDirection = rayTarget - rayOrigin;
+		rayDirection.normalise();
+
+		return Ray(rayOrigin, rayDirection);
+    } 
+
+    // -------------------------------------------------------------------
+    void Camera::setWindow (Real Left, Real Top, Real Right, Real Bottom)
+    {
+        mWLeft = Left;
+        mWTop = Top;
+        mWRight = Right;
+        mWBottom = Bottom;
+
+        mWindowSet = true;
+        mRecalcWindow = true;
+    }
+    // -------------------------------------------------------------------
+    void Camera::resetWindow ()
+    {
+        mWindowSet = false;
+    }
+    // -------------------------------------------------------------------
+    void Camera::setWindowImpl() const
+    {
+        if (!mWindowSet || !mRecalcWindow)
+            return;
+
+        // Calculate general projection parameters
+        Real vpLeft, vpRight, vpBottom, vpTop;
+        calcProjectionParameters(vpLeft, vpRight, vpBottom, vpTop);
+
+        Real vpWidth = vpRight - vpLeft;
+        Real vpHeight = vpTop - vpBottom;
+
+        Real wvpLeft   = vpLeft + mWLeft * vpWidth;
+        Real wvpRight  = vpLeft + mWRight * vpWidth;
+        Real wvpTop    = vpTop - mWTop * vpHeight;
+        Real wvpBottom = vpTop - mWBottom * vpHeight;
+
+        Vector3 vp_ul (wvpLeft, wvpTop, -mNearDist);
+        Vector3 vp_ur (wvpRight, wvpTop, -mNearDist);
+        Vector3 vp_bl (wvpLeft, wvpBottom, -mNearDist);
+        Vector3 vp_br (wvpRight, wvpBottom, -mNearDist);
+
+        Matrix4 inv = mViewMatrix.inverseAffine();
+
+        Vector3 vw_ul = inv.transformAffine(vp_ul);
+        Vector3 vw_ur = inv.transformAffine(vp_ur);
+        Vector3 vw_bl = inv.transformAffine(vp_bl);
+        Vector3 vw_br = inv.transformAffine(vp_br);
+
+        if (mProjType == PT_PERSPECTIVE)
+        {
+            Vector3 position = getPosition();
+            mWindowClipPlanes.push_back(Plane(position, vw_bl, vw_ul));
+            mWindowClipPlanes.push_back(Plane(position, vw_ul, vw_ur));
+            mWindowClipPlanes.push_back(Plane(position, vw_ur, vw_br));
+            mWindowClipPlanes.push_back(Plane(position, vw_br, vw_bl));
+        }
+        else
+        {
+            Vector3 x_axis(inv[0][0], inv[0][1], inv[0][2]);
+            Vector3 y_axis(inv[1][0], inv[1][1], inv[1][2]);
+            x_axis.normalise();
+            y_axis.normalise();
+            mWindowClipPlanes.push_back(Plane( x_axis, vw_bl));
+            mWindowClipPlanes.push_back(Plane(-x_axis, vw_ur));
+            mWindowClipPlanes.push_back(Plane( y_axis, vw_bl));
+            mWindowClipPlanes.push_back(Plane(-y_axis, vw_ur));
+        }
+
+        mRecalcWindow = false;
+
+    }
+    // -------------------------------------------------------------------
+    const std::vector<Plane>& Camera::getWindowPlanes(void) const
+    {
+        updateView();
+        setWindowImpl();
+        return mWindowClipPlanes;
+    }
+    // -------------------------------------------------------------------
+    Real Camera::getBoundingRadius(void) const
+    {
+        // return a little bigger than the near distance
+        // just to keep things just outside
+        return mNearDist * 1.5;
+
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& Camera::getPositionForViewUpdate(void) const
+    {
+        // Note no update, because we're calling this from the update!
+        return mRealPosition;
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& Camera::getOrientationForViewUpdate(void) const
+    {
+        return mRealOrientation;
+    }
+    //-----------------------------------------------------------------------
+    bool Camera::getAutoAspectRatio(void) const
+    {
+        return mAutoAspectRatio;
+    }
+    //-----------------------------------------------------------------------
+    void Camera::setAutoAspectRatio(bool autoratio)
+    {
+        mAutoAspectRatio = autoratio;
+    }
+	//-----------------------------------------------------------------------
+	bool Camera::isVisible(const AxisAlignedBox& bound, FrustumPlane* culledBy) const
+	{
+		if (mCullFrustum)
+		{
+			return mCullFrustum->isVisible(bound, culledBy);
+		}
+		else
+		{
+			return Frustum::isVisible(bound, culledBy);
+		}
+	}
+	//-----------------------------------------------------------------------
+	bool Camera::isVisible(const Sphere& bound, FrustumPlane* culledBy) const
+	{
+		if (mCullFrustum)
+		{
+			return mCullFrustum->isVisible(bound, culledBy);
+		}
+		else
+		{
+			return Frustum::isVisible(bound, culledBy);
+		}
+	}
+	//-----------------------------------------------------------------------
+	bool Camera::isVisible(const Vector3& vert, FrustumPlane* culledBy) const
+	{
+		if (mCullFrustum)
+		{
+			return mCullFrustum->isVisible(vert, culledBy);
+		}
+		else
+		{
+			return Frustum::isVisible(vert, culledBy);
+		}
+	}
+	//-----------------------------------------------------------------------
+	const Vector3* Camera::getWorldSpaceCorners(void) const
+	{
+		if (mCullFrustum)
+		{
+			return mCullFrustum->getWorldSpaceCorners();
+		}
+		else
+		{
+			return Frustum::getWorldSpaceCorners();
+		}
+	}
+	//-----------------------------------------------------------------------
+	const Plane& Camera::getFrustumPlane( unsigned short plane ) const
+	{
+		if (mCullFrustum)
+		{
+			return mCullFrustum->getFrustumPlane(plane);
+		}
+		else
+		{
+			return Frustum::getFrustumPlane(plane);
+		}
+	}
+	//-----------------------------------------------------------------------
+	bool Camera::projectSphere(const Sphere& sphere, 
+		Real* left, Real* top, Real* right, Real* bottom) const
+	{
+		if (mCullFrustum)
+		{
+			return mCullFrustum->projectSphere(sphere, left, top, right, bottom);
+		}
+		else
+		{
+			return Frustum::projectSphere(sphere, left, top, right, bottom);
+		}
+	}
+	//-----------------------------------------------------------------------
+	Real Camera::getNearClipDistance(void) const
+	{
+		if (mCullFrustum)
+		{
+			return mCullFrustum->getNearClipDistance();
+		}
+		else
+		{
+			return Frustum::getNearClipDistance();
+		}
+	}
+	//-----------------------------------------------------------------------
+	Real Camera::getFarClipDistance(void) const
+	{
+		if (mCullFrustum)
+		{
+			return mCullFrustum->getFarClipDistance();
+		}
+		else
+		{
+			return Frustum::getFarClipDistance();
+		}
+	}
+	//-----------------------------------------------------------------------
+	const Matrix4& Camera::getViewMatrix(void) const
+	{
+		if (mCullFrustum)
+		{
+			return mCullFrustum->getViewMatrix();
+		}
+		else
+		{
+			return Frustum::getViewMatrix();
+		}
+	}
+	//-----------------------------------------------------------------------
+	const Matrix4& Camera::getViewMatrix(bool ownFrustumOnly) const
+	{
+		if (ownFrustumOnly)
+		{
+			return Frustum::getViewMatrix();
+		}
+		else
+		{
+			return getViewMatrix();
+		}
+	}
+	//-----------------------------------------------------------------------
+	//_______________________________________________________
+	//|														|
+	//|	getRayForwardIntersect								|
+	//|	-----------------------------						|
+	//|	get the intersections of frustum rays with a plane	|
+	//| of interest.  The plane is assumed to have constant	|
+	//| z.  If this is not the case, rays					|
+	//| should be rotated beforehand to work in a			|
+	//| coordinate system in which this is true.			|
+	//|_____________________________________________________|
+	//
+	std::vector<Vector4> Camera::getRayForwardIntersect(const Vector3& anchor, const Vector3 *dir, Real planeOffset) const
+	{
+		std::vector<Vector4> res;
+
+		if(!dir)
+			return res;
+
+		int infpt[4] = {0, 0, 0, 0}; // 0=finite, 1=infinite, 2=straddles infinity
+		Vector3 vec[4];
+
+		// find how much the anchor point must be displaced in the plane's
+		// constant variable
+		Real delta = planeOffset - anchor.z;
+
+		// now set the intersection point and note whether it is a 
+		// point at infinity or straddles infinity
+		unsigned int i;
+		for (i=0; i<4; i++)
+		{
+			Real test = dir[i].z * delta;
+			if (test == 0.0) {
+				vec[i] = dir[i];
+				infpt[i] = 1;
+			}
+			else {
+				Real lambda = delta / dir[i].z;
+				vec[i] = anchor + (lambda * dir[i]);
+				if(test < 0.0)
+					infpt[i] = 2;
+			}
+		}
+
+		for (i=0; i<4; i++)
+		{
+			// store the finite intersection points
+			if (infpt[i] == 0)
+				res.push_back(Vector4(vec[i].x, vec[i].y, vec[i].z, 1.0));
+			else
+			{
+				// handle the infinite points of intersection;
+				// cases split up into the possible frustum planes 
+				// pieces which may contain a finite intersection point
+				int nextind = (i+1) % 4;
+				int prevind = (i+3) % 4;
+				if ((infpt[prevind] == 0) || (infpt[nextind] == 0))
+				{
+					if (infpt[i] == 1)
+						res.push_back(Vector4(vec[i].x, vec[i].y, vec[i].z, 0.0));
+					else
+					{
+						// handle the intersection points that straddle infinity (back-project)
+						if(infpt[prevind] == 0) 
+						{
+							Vector3 temp = vec[prevind] - vec[i];
+							res.push_back(Vector4(temp.x, temp.y, temp.z, 0.0));
+						}
+						if(infpt[nextind] == 0)
+						{
+							Vector3 temp = vec[nextind] - vec[i];
+							res.push_back(Vector4(temp.x, temp.y, temp.z, 0.0));
+						}
+					}
+				} // end if we need to add an intersection point to the list
+			} // end if infinite point needs to be considered
+		} // end loop over frustun corners
+
+		// we end up with either 0, 3, 4, or 5 intersection points
+
+		return res;
+	}
+
+	//_______________________________________________________
+	//|														|
+	//|	forwardIntersect									|
+	//|	-----------------------------						|
+	//|	Forward intersect the camera's frustum rays with	|
+	//| a specified plane of interest.						|
+	//| Note that if the frustum rays shoot out and would	|
+	//| back project onto the plane, this means the forward	|
+	//| intersection of the frustum would occur at the		|
+	//| line at infinity.									|
+	//|_____________________________________________________|
+	//
+	void Camera::forwardIntersect(const Plane& worldPlane, std::vector<Vector4>* intersect3d) const
+	{
+		if(!intersect3d)
+			return;
+
+		Vector3 trCorner = getWorldSpaceCorners()[0];
+		Vector3 tlCorner = getWorldSpaceCorners()[1];
+		Vector3 blCorner = getWorldSpaceCorners()[2];
+		Vector3 brCorner = getWorldSpaceCorners()[3];
+
+		// need some sort of rotation that will bring the plane normal to the z axis
+		Plane pval = worldPlane;
+		if(pval.normal.z < 0.0)
+		{
+			pval.normal *= -1.0;
+			pval.d *= -1.0;
+		}
+		Quaternion invPlaneRot = pval.normal.getRotationTo(Vector3::UNIT_Z);
+
+		// get rotated light
+		Vector3 lPos = invPlaneRot * getDerivedPosition();
+		Vector3 vec[4];
+		vec[0] = invPlaneRot * trCorner - lPos;
+		vec[1] = invPlaneRot * tlCorner - lPos; 
+		vec[2] = invPlaneRot * blCorner - lPos; 
+		vec[3] = invPlaneRot * brCorner - lPos; 
+
+		// compute intersection points on plane
+		std::vector<Vector4> iPnt = getRayForwardIntersect(lPos, vec, -pval.d);
+
+
+		// return wanted data
+		if(intersect3d) 
+		{
+			Quaternion planeRot = invPlaneRot.Inverse();
+			(*intersect3d).clear();
+			for(unsigned int i=0; i<iPnt.size(); i++)
+			{
+				Vector3 intersection = planeRot * Vector3(iPnt[i].x, iPnt[i].y, iPnt[i].z);
+				(*intersect3d).push_back(Vector4(intersection.x, intersection.y, intersection.z, iPnt[i].w));
+			}
+		}
+	}
+	//-----------------------------------------------------------------------
+
+
+} // namespace Ogre
Index: /OgreMain/src/OgreCodec.cpp
===================================================================
--- /OgreMain/src/OgreCodec.cpp	(revision 5)
+++ /OgreMain/src/OgreCodec.cpp	(revision 5)
@@ -0,0 +1,69 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreCodec.h"
+#include "OgreException.h"
+
+
+namespace Ogre {
+
+    std::map< String, Codec * > Codec::ms_mapCodecs;
+
+    Codec::~Codec() {
+    }
+
+    StringVector Codec::getExtensions(void)
+    {
+        StringVector result;
+        result.reserve(ms_mapCodecs.size());
+        CodecList::const_iterator i;
+        for (i = ms_mapCodecs.begin(); i != ms_mapCodecs.end(); ++i)
+        {
+            result.push_back(i->first);
+        }
+        return result;
+    }
+
+    Codec* Codec::getCodec(const String& extension)
+    {
+        String lwrcase = extension;
+		StringUtil::toLowerCase(lwrcase);
+        CodecList::const_iterator i = ms_mapCodecs.find(lwrcase);
+        if (i == ms_mapCodecs.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Cannot find codec for extension " + extension,
+                "Codec::getCodec");
+        }
+
+        return i->second;
+
+    }
+
+}
Index: /OgreMain/src/OgreColourValue.cpp
===================================================================
--- /OgreMain/src/OgreColourValue.cpp	(revision 5)
+++ /OgreMain/src/OgreColourValue.cpp	(revision 5)
@@ -0,0 +1,366 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreColourValue.h"
+
+namespace Ogre {
+
+    const ColourValue ColourValue::ZERO = ColourValue(0.0,0.0,0.0,0.0);
+    const ColourValue ColourValue::Black = ColourValue(0.0,0.0,0.0);
+    const ColourValue ColourValue::White = ColourValue(1.0,1.0,1.0);
+    const ColourValue ColourValue::Red = ColourValue(1.0,0.0,0.0);
+    const ColourValue ColourValue::Green = ColourValue(0.0,1.0,0.0);
+    const ColourValue ColourValue::Blue = ColourValue(0.0,0.0,1.0);
+
+    //---------------------------------------------------------------------
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+    ABGR ColourValue::getAsABGR(void) const
+#else
+    RGBA ColourValue::getAsRGBA(void) const
+#endif
+    {
+        uint8 val8;
+        uint32 val32 = 0;
+
+        // Convert to 32bit pattern
+        // (RGBA = 8888)
+
+        // Red
+        val8 = static_cast<uint8>(r * 255);
+        val32 = val8 << 24;
+
+        // Green
+        val8 = static_cast<uint8>(g * 255);
+        val32 += val8 << 16;
+
+        // Blue
+        val8 = static_cast<uint8>(b * 255);
+        val32 += val8 << 8;
+
+        // Alpha
+        val8 = static_cast<uint8>(a * 255);
+        val32 += val8;
+
+        return val32;
+    }
+    //---------------------------------------------------------------------
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+    BGRA ColourValue::getAsBGRA(void) const
+#else
+    ARGB ColourValue::getAsARGB(void) const
+#endif
+    {
+        uint8 val8;
+        uint32 val32 = 0;
+
+        // Convert to 32bit pattern
+        // (ARGB = 8888)
+
+        // Alpha
+        val8 = static_cast<uint8>(a * 255);
+        val32 = val8 << 24;
+
+        // Red
+        val8 = static_cast<uint8>(r * 255);
+        val32 += val8 << 16;
+
+        // Green
+        val8 = static_cast<uint8>(g * 255);
+        val32 += val8 << 8;
+
+        // Blue
+        val8 = static_cast<uint8>(b * 255);
+        val32 += val8;
+
+
+        return val32;
+    }
+	//---------------------------------------------------------------------
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+	ARGB ColourValue::getAsARGB(void) const
+#else
+	BGRA ColourValue::getAsBGRA(void) const
+#endif
+	{
+		uint8 val8;
+		uint32 val32 = 0;
+
+		// Convert to 32bit pattern
+		// (ARGB = 8888)
+
+		// Blue
+		val8 = static_cast<uint8>(b * 255);
+		val32 = val8 << 24;
+
+		// Green
+		val8 = static_cast<uint8>(g * 255);
+		val32 += val8 << 16;
+
+		// Red
+		val8 = static_cast<uint8>(r * 255);
+		val32 += val8 << 8;
+
+		// Alpha
+		val8 = static_cast<uint8>(a * 255);
+		val32 += val8;
+
+
+		return val32;
+	}
+    //---------------------------------------------------------------------
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+    RGBA ColourValue::getAsRGBA(void) const
+#else
+    ABGR ColourValue::getAsABGR(void) const
+#endif
+    {
+        uint8 val8;
+        uint32 val32 = 0;
+
+        // Convert to 32bit pattern
+        // (ABRG = 8888)
+
+        // Alpha
+        val8 = static_cast<uint8>(a * 255);
+        val32 = val8 << 24;
+
+        // Blue
+        val8 = static_cast<uint8>(b * 255);
+        val32 += val8 << 16;
+
+        // Green
+        val8 = static_cast<uint8>(g * 255);
+        val32 += val8 << 8;
+
+        // Red
+        val8 = static_cast<uint8>(r * 255);
+        val32 += val8;
+
+
+        return val32;
+    }
+    //---------------------------------------------------------------------
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+    void ColourValue::setAsABGR(const ABGR val)
+#else
+    void ColourValue::setAsRGBA(const RGBA val)
+#endif
+    {
+        uint32 val32 = val;
+
+        // Convert from 32bit pattern
+        // (RGBA = 8888)
+
+        // Red
+        r = ((val32 >> 24) & 0xFF) / 255.0f;
+
+        // Green
+        g = ((val32 >> 16) & 0xFF) / 255.0f;
+
+        // Blue
+        b = ((val32 >> 8) & 0xFF) / 255.0f;
+
+        // Alpha
+        a = (val32 & 0xFF) / 255.0f;
+    }
+    //---------------------------------------------------------------------
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+    void ColourValue::setAsBGRA(const BGRA val)
+#else
+    void ColourValue::setAsARGB(const ARGB val)
+#endif
+    {
+        uint32 val32 = val;
+
+        // Convert from 32bit pattern
+        // (ARGB = 8888)
+
+        // Alpha
+        a = ((val32 >> 24) & 0xFF) / 255.0f;
+
+        // Red
+        r = ((val32 >> 16) & 0xFF) / 255.0f;
+
+        // Green
+        g = ((val32 >> 8) & 0xFF) / 255.0f;
+
+        // Blue
+        b = (val32 & 0xFF) / 255.0f;
+    }
+	//---------------------------------------------------------------------
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+	void ColourValue::setAsARGB(const ARGB val)
+#else
+	void ColourValue::setAsBGRA(const BGRA val)
+#endif
+	{
+		uint32 val32 = val;
+
+		// Convert from 32bit pattern
+		// (ARGB = 8888)
+
+		// Blue
+		b = ((val32 >> 24) & 0xFF) / 255.0f;
+
+		// Green
+		g = ((val32 >> 16) & 0xFF) / 255.0f;
+
+		// Red
+		r = ((val32 >> 8) & 0xFF) / 255.0f;
+
+		// Alpha
+		a = (val32 & 0xFF) / 255.0f;
+	}
+    //---------------------------------------------------------------------
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+    void ColourValue::setAsRGBA(const RGBA val)
+#else
+    void ColourValue::setAsABGR(const ABGR val)
+#endif
+    {
+        uint32 val32 = val;
+
+        // Convert from 32bit pattern
+        // (ABGR = 8888)
+
+        // Alpha
+        a = ((val32 >> 24) & 0xFF) / 255.0f;
+
+        // Blue
+        b = ((val32 >> 16) & 0xFF) / 255.0f;
+
+        // Green
+        g = ((val32 >> 8) & 0xFF) / 255.0f;
+
+        // Red
+        r = (val32 & 0xFF) / 255.0f;
+    }
+    //---------------------------------------------------------------------
+    bool ColourValue::operator==(const ColourValue& rhs) const
+    {
+        return (r == rhs.r &&
+            g == rhs.g &&
+            b == rhs.b &&
+            a == rhs.a);
+    }
+    //---------------------------------------------------------------------
+    bool ColourValue::operator!=(const ColourValue& rhs) const
+    {
+        return !(*this == rhs);
+    }
+	//---------------------------------------------------------------------
+	void ColourValue::setHSB(Real hue, Real saturation, Real brightness)
+	{
+		// wrap hue
+		if (hue > 1.0f)
+		{
+			hue -= (int)hue;
+		}
+		else if (hue < 0.0f)
+		{
+			hue += (int)hue + 1;
+		}
+		// clamp saturation / brightness
+		saturation = std::min(saturation, (Real)1.0);
+		saturation = std::max(saturation, (Real)0.0);
+		brightness = std::min(brightness, (Real)1.0);
+		brightness = std::max(brightness, (Real)0.0);
+
+		if (brightness == 0.0f)
+		{   
+			// early exit, this has to be black
+			r = g = b = 0.0f;
+			return;
+		}
+
+		if (saturation == 0.0f)
+		{   
+			// early exit, this has to be grey
+
+			r = g = b = brightness;
+			return;
+		}
+
+
+		Real hueDomain  = hue * 6.0f;
+		if (hueDomain >= 6.0f)
+		{
+			// wrap around, and allow mathematical errors
+			hueDomain = 0.0f;
+		}
+		unsigned short domain = (unsigned short)hueDomain;
+		Real f1 = brightness * (1 - saturation);
+		Real f2 = brightness * (1 - saturation * (hueDomain - domain));
+		Real f3 = brightness * (1 - saturation * (1 - (hueDomain - domain)));
+
+		switch (domain)
+		{
+		case 0:
+			// red domain; green ascends
+			r = brightness;
+			g = f3;
+			b = f1;
+			break;
+		case 1:
+			// yellow domain; red descends
+			r = f2;
+			g = brightness;
+			b = f1;
+			break;
+		case 2:
+			// green domain; blue ascends
+			r = f1;
+			g = brightness;
+			b = f3;
+			break;
+		case 3:
+			// cyan domain; green descends
+			r = f1;
+			g = f2;
+			b = brightness;
+			break;
+		case 4:
+			// blue domain; red ascends
+			r = f3;
+			g = f1;
+			b = brightness;
+			break;
+		case 5:
+			// magenta domain; blue descends
+			r = brightness;
+			g = f1;
+			b = f2;
+			break;
+		}
+
+
+	}
+
+}
+
Index: /OgreMain/src/OgreCommon.cpp
===================================================================
--- /OgreMain/src/OgreCommon.cpp	(revision 5)
+++ /OgreMain/src/OgreCommon.cpp	(revision 5)
@@ -0,0 +1,70 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgrePrerequisites.h"
+#include "OgreCommon.h"
+#include "OgreString.h"
+#include "OgreLogManager.h"
+
+namespace Ogre 
+{
+    int findCommandLineOpts(int numargs, char** argv, UnaryOptionList& unaryOptList, 
+        BinaryOptionList& binOptList)
+    {
+        int startIndex = 1;
+        for (int i = 1; i < numargs; ++i)
+        {
+            String tmp(argv[i]);
+            if (StringUtil::startsWith(tmp, "-"))
+            {
+                UnaryOptionList::iterator ui = unaryOptList.find(argv[i]);
+                if(ui != unaryOptList.end())
+                {
+                    ui->second = true;
+                    ++startIndex;
+                    continue;
+                }
+                BinaryOptionList::iterator bi = binOptList.find(argv[i]);
+                if(bi != binOptList.end())
+                {
+                    bi->second = argv[i+1];
+                    startIndex += 2;
+                    ++i;
+                    continue;
+                }
+
+                // Invalid option
+                LogManager::getSingleton().logMessage("Invalid option " + tmp);
+
+            }
+        }
+        return startIndex;
+    }
+
+}
Index: /OgreMain/src/OgreCompiler2Pass.cpp
===================================================================
--- /OgreMain/src/OgreCompiler2Pass.cpp	(revision 5)
+++ /OgreMain/src/OgreCompiler2Pass.cpp	(revision 5)
@@ -0,0 +1,1688 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreCompiler2Pass.h"
+#include "OgreLogManager.h"
+#include "OgreException.h"
+#include "OgreStringConverter.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    // instantiate static members
+    Compiler2Pass::TokenState Compiler2Pass::mBNFTokenState;
+    Compiler2Pass::TokenStateContainer Compiler2Pass::mClientTokenStates;
+    //-----------------------------------------------------------------------
+    Compiler2Pass::Compiler2Pass()
+        : mActiveTokenState(&mBNFTokenState)
+        , mSource(0)
+        , mSourceName("system")
+    {
+	    // reserve some memory space in the containers being used
+	    mBNFTokenState.tokenQue.reserve(100);
+        mBNFTokenState.lexemeTokenDefinitions.reserve(50);
+
+        initBNFCompiler();
+    }
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::initBNFCompiler(void)
+    {
+        if (mBNFTokenState.lexemeTokenDefinitions.empty())
+        {
+            /* Every Token ID must be manually generated during the compiler bootstrap phase
+               since the rule base is manually defined.
+           */
+
+            addLexemeToken("UNKNOWN", BNF_UNKOWN);
+            addLexemeToken("syntax", BNF_SYNTAX);
+            addLexemeToken("rule", BNF_RULE);
+            addLexemeToken("identifier", BNF_IDENTIFIER);
+            addLexemeToken("identifier_right", BNF_IDENTIFIER_RIGHT);
+            addLexemeToken("identifier_characters", BNF_IDENTIFIER_CHARACTERS);
+            addLexemeToken("<", BNF_ID_BEGIN, false, true);
+            addLexemeToken(">", BNF_ID_END, false, true);
+            addLexemeToken("<#", BNF_CONSTANT_BEGIN, false, true);
+            addLexemeToken("::=", BNF_SET_RULE, false, true);
+            addLexemeToken("expression", BNF_EXPRESSION);
+            addLexemeToken("and_term", BNF_AND_TERM);
+            addLexemeToken("or_term", BNF_OR_TERM);
+            addLexemeToken("term", BNF_TERM);
+            addLexemeToken("term_id", BNF_TERM_ID);
+            addLexemeToken("constant", BNF_CONSTANT);
+            addLexemeToken("|", BNF_OR, false, true);
+            addLexemeToken("terminal_symbol", BNF_TERMINAL_SYMBOL);
+            addLexemeToken("terminal_start", BNF_TERMINAL_START);
+            addLexemeToken("repeat_expression", BNF_REPEAT_EXPRESSION);
+            addLexemeToken("not_expression", BNF_NOT_EXPRESSION);
+            addLexemeToken("{", BNF_REPEAT_BEGIN, false, true);
+            addLexemeToken("}", BNF_REPEAT_END, false, true);
+            addLexemeToken("set", BNF_SET);
+            addLexemeToken("(", BNF_SET_BEGIN, false, true);
+            addLexemeToken(")", BNF_SET_END, false, true);
+            addLexemeToken("set_end_exc", BNF_SET_END_EXC);
+            addLexemeToken("optional_expression", BNF_OPTIONAL_EXPRESSION);
+            addLexemeToken("[", BNF_OPTIONAL_BEGIN, false, true);
+            addLexemeToken("]", BNF_OPTIONAL_END, false, true);
+            addLexemeToken("not_test", BNF_NOT_TEST);
+            addLexemeToken("not_chk", BNF_NOT_CHK);
+            addLexemeToken("(?!", BNF_NOT_TEST_BEGIN, false, true);
+            addLexemeToken("'", BNF_SINGLEQUOTE, false, true);
+            addLexemeToken(":", BNF_CONDITIONAL_TOKEN_INSERT, false, true);
+            addLexemeToken("-'", BNF_NO_TOKEN_START, false, true);
+            addLexemeToken("any_character", BNF_ANY_CHARACTER);
+            addLexemeToken("single_quote_exc", BNF_SINGLE_QUOTE_EXC);
+            addLexemeToken("white_space_chk", BNF_WHITE_SPACE_CHK);
+            addLexemeToken("special_characters1", BNF_SPECIAL_CHARACTERS1);
+            addLexemeToken("special_characters2", BNF_SPECIAL_CHARACTERS2);
+
+            addLexemeToken("letter", BNF_LETTER);
+            addLexemeToken("letter_digit", BNF_LETTER_DIGIT);
+            addLexemeToken("digit", BNF_DIGIT);
+            addLexemeToken("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", BNF_ALPHA_SET, false, true);
+            addLexemeToken("0123456789", BNF_NUMBER_SET, false, true);
+            addLexemeToken("`~!@#$%^&*(-_=+\\|[]{}:;\"<>,.?/\n\r\t", BNF_SPECIAL_CHARACTER_SET2, false, true);
+            addLexemeToken("$_", BNF_SPECIAL_CHARACTER_SET1, false, true);
+            addLexemeToken(" ", BNF_WHITE_SPACE, false, true);
+            addLexemeToken("?!", BNF_NOT_CHARS, false, true);
+        }
+
+        if (mBNFTokenState.rootRulePath.empty())
+        {
+            // first entry is set to unknown in order to trap rule id's not set for non-terminal tokens
+            mBNFTokenState.rootRulePath.resize(1);
+            //  used by bootstrap BNF text parser
+            //  <>	- non-terminal token
+            //  ()  - set of
+            // ::=	- rule definition
+            #define _rule_(id)	    mBNFTokenState.rootRulePath.push_back(TokenRule(otRULE, id));
+            #define _is_(id)	    mBNFTokenState.rootRulePath.push_back(TokenRule(otAND, id));
+            //     - blank space is an implied "AND" meaning the token is required
+            #define _and_(id)		mBNFTokenState.rootRulePath.push_back(TokenRule(otAND, id));
+            // |	- or
+            #define _or_(id)		mBNFTokenState.rootRulePath.push_back(TokenRule(otOR,	id));
+            // []	- optional
+            #define _optional_(id)	mBNFTokenState.rootRulePath.push_back(TokenRule(otOPTIONAL, id));
+            // {}	- repeat 0 or more times until fail or rule does not progress
+            #define _repeat_(id)	mBNFTokenState.rootRulePath.push_back(TokenRule(otREPEAT,	id));
+            #define _data_(id)      mBNFTokenState.rootRulePath.push_back(TokenRule(otDATA, id));
+            // (?! ) - lookahead negative (not test)
+            #define _not_(id)       mBNFTokenState.rootRulePath.push_back(TokenRule(otNOT_TEST, id));
+            #define _end_   		mBNFTokenState.rootRulePath.push_back(TokenRule(otEND,0));
+
+            // <syntax>     ::=  { rule }
+            _rule_(BNF_SYNTAX) _repeat_(BNF_RULE) _end_
+
+            // <rule>       ::=  <identifier>  "::="  <expression>
+            _rule_(BNF_RULE)
+                _is_(BNF_IDENTIFIER)
+                _and_(BNF_SET_RULE)
+                _and_(BNF_EXPRESSION)
+            _end_
+
+            // <expression> ::=  <and_term> { <or_term> }
+            _rule_(BNF_EXPRESSION)
+                _is_(BNF_AND_TERM)
+                _repeat_(BNF_OR_TERM)
+            _end_
+            // <or_term>    ::=  "|" <and_term>
+            _rule_(BNF_OR_TERM)
+                _is_(BNF_OR)
+                _and_(BNF_AND_TERM)
+            _end_
+            // <and_term>   ::=  <term> { <term> }
+            _rule_(BNF_AND_TERM)
+                _is_(BNF_TERM)
+                _repeat_(BNF_TERM)
+            _end_
+            // <term>       ::=  <term_id> | <repeat_expression> | <optional_expression> | <not_expression>
+            _rule_(BNF_TERM)
+                _is_(BNF_TERM_ID)
+                _or_(BNF_REPEAT_EXPRESSION)
+                _or_(BNF_OPTIONAL_EXPRESSION)
+                _or_(BNF_NOT_EXPRESSION)
+            _end_
+
+            // <term_id>    ::= <constant> | <identifier_right> | <terminal_symbol> | <set>
+            _rule_(BNF_TERM_ID)
+                _is_(BNF_CONSTANT)
+                _or_(BNF_IDENTIFIER_RIGHT)
+                _or_(BNF_TERMINAL_SYMBOL)
+                _or_(BNF_SET)
+            _end_
+
+            // <repeat_expression> ::=  "{"  <term_id>  "}"
+            _rule_(BNF_REPEAT_EXPRESSION)
+                _is_(BNF_REPEAT_BEGIN)
+                _and_(BNF_TERM_ID)
+                _and_(BNF_REPEAT_END)
+            _end_
+
+            // <optional_expression> ::= "["  <term_id>  "]"
+            _rule_(BNF_OPTIONAL_EXPRESSION)
+                _is_(BNF_OPTIONAL_BEGIN)
+                _and_(BNF_TERM_ID)
+                _and_(BNF_OPTIONAL_END)
+            _end_
+
+            // <not_expression> ::= "(?!" <term_id> ")"
+            _rule_(BNF_NOT_EXPRESSION)
+                _is_(BNF_NOT_TEST_BEGIN)
+                _and_(BNF_TERM_ID)
+                _and_(BNF_SET_END)
+            _end_
+
+            // <identifier_right> ::= <indentifier> (?!"::=")
+            _rule_(BNF_IDENTIFIER_RIGHT)
+                _is_(BNF_IDENTIFIER)
+                _not_(BNF_SET_RULE)
+            _end_
+
+            // <identifier> ::=  "<" <letter> {<identifier_characters>} ">"
+            _rule_(BNF_IDENTIFIER)
+                _is_(BNF_ID_BEGIN)
+                _and_(BNF_LETTER)
+                _repeat_(BNF_IDENTIFIER_CHARACTERS)
+                _and_(BNF_ID_END)
+            _end_
+
+            // <identifier_characters> ::= <letter_digit> | <special_characters1>
+            _rule_(BNF_IDENTIFIER_CHARACTERS)
+                _is_(BNF_LETTER_DIGIT)
+                _or_(BNF_SPECIAL_CHARACTERS1)
+            _end_
+
+            // <terminal_symbol> ::= <terminal_start> @{ <any_character> } "'" [":"]
+            _rule_(BNF_TERMINAL_SYMBOL)
+                _is_(BNF_TERMINAL_START)
+                _and_(_no_space_skip_)
+                _repeat_(BNF_ANY_CHARACTER)
+                _and_(BNF_SINGLEQUOTE)
+                _optional_(BNF_CONDITIONAL_TOKEN_INSERT)
+            _end_
+
+            // <terminal_start> ::= "-'" | "'"
+            _rule_(BNF_TERMINAL_START)
+                _is_(BNF_NO_TOKEN_START)
+                _or_(BNF_SINGLEQUOTE)
+            _end_
+
+
+            // <constant> ::= "<#" <letter> {<identifier_characters>} ">"
+            _rule_(BNF_CONSTANT)
+                _is_(BNF_CONSTANT_BEGIN)
+                _and_(BNF_LETTER)
+                _repeat_(BNF_IDENTIFIER_CHARACTERS)
+                _and_(BNF_ID_END)
+            _end_
+
+            // <set> ::= "(" (?!<not_chk>) @{<any_character>} ")"
+            _rule_(BNF_SET)
+                _is_(BNF_SET_BEGIN)
+                _not_(BNF_NOT_CHK)
+                _and_(_no_space_skip_)
+                _repeat_(BNF_ANY_CHARACTER)
+                _and_(BNF_SET_END)
+            _end_
+
+            // <any_character> ::= <letter_digit> | <special_characters2>
+            _rule_(BNF_ANY_CHARACTER)
+                _is_(BNF_LETTER_DIGIT)
+                _or_(BNF_SPECIAL_CHARACTERS2)
+            _end_
+
+			// <letter_digit> ::= <letter> | <digit>
+            _rule_(BNF_LETTER_DIGIT)
+                _is_(BNF_LETTER)
+                _or_(BNF_DIGIT)
+            _end_
+
+            // <letter> ::= (abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ)
+            _rule_(BNF_LETTER)
+                _is_(_character_)
+                _data_(BNF_ALPHA_SET)// "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_"
+            _end_
+
+            // <digit> ::= (0123456789)
+            _rule_(BNF_DIGIT)
+                _is_(_character_)
+                _data_(BNF_NUMBER_SET)
+            _end_
+
+            // <special_characters1> ::= ($_)
+            _rule_(BNF_SPECIAL_CHARACTERS1)
+                _is_(_character_)
+                _data_(BNF_SPECIAL_CHARACTER_SET1)
+            _end_
+
+            // <special_characters2> ::= (`~!@#$%^&*(-_=+\|[]{}:;"<>,.?/) | <single_quote_exc>
+            //                           | <white_space_chk> | <set_end_exc>
+            _rule_(BNF_SPECIAL_CHARACTERS2)
+                _is_(_character_)
+                _data_(BNF_SPECIAL_CHARACTER_SET2)
+                _or_(BNF_WHITE_SPACE_CHK)
+                _or_(BNF_SINGLE_QUOTE_EXC)
+                _or_(BNF_SET_END_EXC)
+            _end_
+
+            // <single_quote_exc> ::= "'" (?!" ")
+            _rule_(BNF_SINGLE_QUOTE_EXC)
+                _is_(_character_)
+                _data_(BNF_SINGLEQUOTE)
+                _not_(BNF_WHITE_SPACE_CHK)
+            _end_
+
+            // <set_end_exc> ::= ")" (?!" ")
+            _rule_(BNF_SET_END_EXC)
+                _is_(_character_)
+                _data_(BNF_SET_END)
+                _not_(BNF_WHITE_SPACE_CHK)
+            _end_
+
+            // <white_space_chk> ::= ( )
+            _rule_(BNF_WHITE_SPACE_CHK)
+                _is_(_character_)
+                _data_(BNF_WHITE_SPACE)
+            _end_
+            // <not_chk> ::= (?!)
+            _rule_(BNF_NOT_CHK)
+                _is_(BNF_NOT_CHARS)
+                //_data_(BNF_NOT_CHARS)
+            _end_
+
+            // now that all the rules are added, update token definitions with rule links
+            verifyTokenRuleLinks("system");
+        }
+        // switch to client state
+        mActiveTokenState = mClientTokenState;
+    }
+
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::verifyTokenRuleLinks(const String& grammerName)
+    {
+	    size_t token_ID;
+
+	    // scan through all the rules and initialize index to rules for non-terminal tokens
+        const size_t ruleCount = mActiveTokenState->rootRulePath.size();
+        for (size_t i = 0; i < ruleCount; ++i)
+        {
+		   // make sure token definition holds valid token
+		   if (mActiveTokenState->rootRulePath[i].operation == otRULE)
+		   {
+    		   token_ID = mActiveTokenState->rootRulePath[i].tokenID;
+    		   // system token id's can never have a rule assigned to them so no need to check if token is system token
+    		   // but do make sure the id is within defined bounds
+               if (token_ID >= mActiveTokenState->lexemeTokenDefinitions.size())
+                    OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "For grammer: " + grammerName +
+                        ", a token ID was out of token definition range.",
+                        "Compiler2Pass::verifyTokenRuleLinks");
+
+               LexemeTokenDef& tokenDef = mActiveTokenState->lexemeTokenDefinitions[token_ID];
+        	   if (tokenDef.ID != token_ID)
+                    OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "For grammer: " + grammerName +
+                        ", lexeme non-terminal token definition: " +
+                        tokenDef.lexeme + " is corrupted and does not match its assigned rule.",
+                        "Compiler2Pass::verifyTokenRuleLinks");
+			   // if operation is a rule then update token definition
+               tokenDef.ruleID = i;
+               tokenDef.isNonTerminal = true;
+		   }
+	    } // end for
+
+	    // test all non terminals for valid rule ID
+        const size_t definitionCount = mActiveTokenState->lexemeTokenDefinitions.size();
+        bool errorsFound = false;
+        // report all non-terminals that don't have a rule then throw an exception
+        for (token_ID = 0; token_ID < definitionCount; ++token_ID)
+        {
+            const LexemeTokenDef& tokenDef = mActiveTokenState->lexemeTokenDefinitions[token_ID];
+            if (tokenDef.isNonTerminal && (tokenDef.ruleID == 0))
+            {
+                errorsFound = true;
+                LogManager::getSingleton().logMessage(
+                "For grammer: " + grammerName +
+                ", lexeme non-terminal token definition: " + tokenDef.lexeme +
+                " found with no rule definition or corrupted."
+                );
+            }
+        }
+        if (errorsFound)
+        {
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR,  "For grammer: " + grammerName +
+                ", lexeme non-terminal token definition(s) found with no rule definition or corrupted.",
+                "Compiler2Pass::verifyTokenRuleLinks");
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    bool Compiler2Pass::compile(const String& source, const String& sourceName)
+    {
+        // make sure BNF compiler is setup to compile BNF grammer if required
+        initBNFCompiler();
+        // compile the client's BNF grammer
+        setClientBNFGrammer();
+
+	    bool Passed = false;
+
+	    mSource = &source;
+	    mSourceName = sourceName;
+        mActiveTokenState = mClientTokenState;
+	    // start compiling if there is a rule base to work with
+        if (mActiveTokenState->rootRulePath.size() > 1)
+	    {
+		    Passed = doPass1();
+
+		    if (Passed)
+		    {
+			    Passed = doPass2();
+		    }
+	    }
+
+	    return Passed;
+    }
+
+    //-----------------------------------------------------------------------
+    bool Compiler2Pass::doPass1()
+    {
+	    // scan through Source string and build a token list using TokenInstructions
+	    // this is a simple brute force lexical scanner/analyzer that also parses the formed
+	    // token for proper semantics and context in one pass
+
+	    mCurrentLine = 1;
+	    mCharPos = 0;
+	    // reset position in Constants container
+	    mConstants.clear();
+        mLabels.clear();
+        // there is no active label when first starting pass 1
+        mLabelIsActive = false;
+        mActiveLabelKey = 0;
+        mEndOfSource = mSource->length();
+
+	    // start with a clean slate
+	    mActiveTokenState->tokenQue.clear();
+	    mPass2TokenQuePosition = 0;
+	    mPreviousActionQuePosition = 0;
+	    mNextActionQuePosition = 0;
+	    mNoTerminalToken = false;
+	    mNoSpaceSkip = false;
+	    mErrorCharPos = 0;
+	    mInsertTokenID = 0;
+	    // tokenize and check semantics untill an error occurs or end of source is reached
+	    // assume RootRulePath has pointer to rules so start at index + 1 for first rule path
+	    // first rule token would be a rule definition so skip over it
+	    bool passed = false;
+
+	    try
+	    {
+            passed = processRulePath(1);
+            // if a lexeme in source still exists then the end of source was not reached and there was a problem some where
+            if (positionToNextLexeme()) passed = false;
+            if (passed)
+            {
+                // special condition at end of script.  The last action needs to be triggered if
+                // parsing reached the end of the source.
+                activatePreviousTokenAction();
+            }
+            else if (mCharPos != mEndOfSource && mErrorCharPos == 0)
+            {
+                LogManager::getSingleton().logMessage(
+                    "*** ERROR *** : in " + getClientGrammerName() +
+                    " Source: " + mSourceName +
+                    "\nUnknown token found on line " + StringConverter::toString(mCurrentLine) +
+                    "\nFound: >>>" + mSource->substr(mCharPos, 20) +
+                    "<<<\n"
+                );
+
+            }
+
+	    }
+	    catch (Exception& e)
+	    {
+            LogManager::getSingleton().logMessage( "Exception caught "
+                " while trying to parse "
+                + getClientGrammerName()
+                + ": "
+                + mSourceName
+                + ". Exception was '"
+				+ e.getFullDescription()
+				+ "'. Pass 1 terminated"
+            );
+	    }
+	    catch (...)
+	    {
+            LogManager::getSingleton().logMessage( "Unkown exception while trying to parse: "
+            + getClientGrammerName()
+            + ": "
+            + mSourceName
+            );
+	    }
+
+	    return passed;
+
+    }
+
+    //-----------------------------------------------------------------------
+    bool Compiler2Pass::doPass2()
+    {
+        bool passed = true;
+        // step through tokens container and execute until end found or error occurs
+
+        return passed;
+    }
+    //-----------------------------------------------------------------------
+    const Compiler2Pass::TokenInst& Compiler2Pass::getCurrentToken(const size_t expectedTokenID) const
+    {
+        if (mPass2TokenQuePosition <= mActiveTokenState->tokenQue.size() - 1)
+        {
+            const TokenInst& tokenInst = mActiveTokenState->tokenQue[mPass2TokenQuePosition];
+
+            if (expectedTokenID > 0 && (tokenInst.tokenID != expectedTokenID))
+            {
+                OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, getClientGrammerName() + ":" + mSourceName
+                    + ", expected token ID not found" ,
+                    "Compiler2Pass::getCurrentToken");
+            }
+
+            return tokenInst;
+        }
+        else
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, getClientGrammerName() + ":" + mSourceName +
+                ", Line " + StringConverter::toString(mActiveTokenState->tokenQue.back().line) +
+                "\n no token available, all pass 2 tokens processed" ,
+                "Compiler2Pass::getCurrentToken");
+        }
+    }
+    //-----------------------------------------------------------------------
+    bool Compiler2Pass::testNextTokenID(const size_t expectedTokenID) const
+    {
+        const size_t nextTokenIndex = mPass2TokenQuePosition + 1;
+
+        if (nextTokenIndex < mActiveTokenState->tokenQue.size())
+            return mActiveTokenState->tokenQue[nextTokenIndex].tokenID == expectedTokenID;
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::skipToken(void) const
+    {
+        if (mPass2TokenQuePosition < mActiveTokenState->tokenQue.size() - 1)
+        {
+            ++mPass2TokenQuePosition;
+        }
+        else
+        {
+            // no more tokens left for pass 2 processing
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, getClientGrammerName() + ":" + mSourceName
+                + ", no more tokens available for pass 2 processing" ,
+                "Compiler2Pass::skipToken");
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::replaceToken(void)
+    {
+        // move instruction que index back one position
+        if (mPass2TokenQuePosition > 0)
+            --mPass2TokenQuePosition;
+    }
+    //-----------------------------------------------------------------------
+    float Compiler2Pass::getCurrentTokenValue(void) const
+    {
+        // get float value from current token instruction
+        const TokenInst& token = getCurrentToken();
+        if ( token.tokenID == _value_)
+        {
+            std::map<size_t, float>::const_iterator i = mConstants.find(mPass2TokenQuePosition);
+            if (i != mConstants.end())
+            {
+                return i->second;
+            }
+            else
+            {
+                OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "In " + mSourceName +
+                    ", on line " + StringConverter::toString(token.line) +
+                    ", no value was found in : >>>" + mSource->substr(token.pos, 20) +
+                            "<<<",
+                    "Compiler2Pass::getCurrentTokenValue");
+            }
+        }
+        else
+        {
+            // if token is not for a value then throw an exception
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "In " + mSourceName +
+                ", on line " + StringConverter::toString(token.line) +
+                ", token is not for a value.  Found: >>>" + mSource->substr(token.pos, 20) +
+                        "<<<",
+                "Compiler2Pass::getCurrentTokenValue");
+        }
+    }
+    //-----------------------------------------------------------------------
+    const String& Compiler2Pass::getCurrentTokenLabel(void) const
+    {
+        // get label from current token instruction
+        const TokenInst& token = getCurrentToken();
+        if (token.tokenID == _character_)
+        {
+            std::map<size_t, String>::const_iterator i = mLabels.find(mPass2TokenQuePosition);
+            if (i != mLabels.end())
+            {
+                return i->second;
+            }
+            else
+            {
+                OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "In " + mSourceName +
+                    ", on line " + StringConverter::toString(token.line) +
+                    ", no Label was found in : >>>" + mSource->substr(token.pos, 20) +
+                            "<<<",
+                    "Compiler2Pass::getCurrentTokenLabel");
+            }
+        }
+        else
+        {
+            // if token is not for a label then throw an exception
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "In " + mSourceName +
+                ", on line " + StringConverter::toString(token.line) +
+                ", token is not for a label.  Found: >>>" + mSource->substr(token.pos, 20) +
+                        "<<<",
+                "Compiler2Pass::getCurrentTokenLabel");
+        }
+    }
+    //-----------------------------------------------------------------------
+    const String& Compiler2Pass::getCurrentTokenLexeme(void) const
+    {
+        // get label from current token instruction
+        const TokenInst& token = getCurrentToken();
+        if (token.tokenID < SystemTokenBase)
+            return mActiveTokenState->lexemeTokenDefinitions[token.tokenID].lexeme;
+        else
+        {
+            // if token is for system use then throw an exception
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "In " + mSourceName +
+                ", on line " + StringConverter::toString(token.line) +
+                ", token is for system use only.  Found: >>>" + mSource->substr(token.pos, 20) +
+                        "<<<",
+                "Compiler2Pass::getCurrentTokenLexeme");
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    size_t Compiler2Pass::getPass2TokenQueCount(void) const
+    {
+        // calculate number of tokens between current token instruction and next token with action
+        if(mActiveTokenState->tokenQue.size() > mPass2TokenQuePosition)
+            return mActiveTokenState->tokenQue.size() - 1 - mPass2TokenQuePosition;
+        else
+            return 0;
+    }
+    //-----------------------------------------------------------------------
+    size_t Compiler2Pass::getRemainingTokensForAction(void) const
+    {
+        size_t remaingingTokens = 0;
+        if (mNextActionQuePosition > mPass2TokenQuePosition)
+        {
+            // don't count next action nor the current position
+            remaingingTokens = mNextActionQuePosition - mPass2TokenQuePosition - 1;
+        }
+
+        return remaingingTokens;
+    }
+    //-----------------------------------------------------------------------
+    bool Compiler2Pass::setNextActionQuePosition(size_t pos, const bool search)
+    {
+        const size_t lastPos = mActiveTokenState->tokenQue.size();
+
+        if (pos >= lastPos)
+            return false;
+
+        bool nextActionFound = false;
+
+        // if searching then assume no next action will be found so set position to end of que
+        if (search)
+            mNextActionQuePosition = lastPos;
+
+        while (!nextActionFound && (pos < lastPos))
+        {
+            const size_t tokenID = mActiveTokenState->tokenQue[pos].tokenID;
+
+            if ((tokenID < SystemTokenBase) &&
+                mActiveTokenState->lexemeTokenDefinitions.at(tokenID).hasAction)
+            {
+                mNextActionQuePosition = pos;
+                nextActionFound = true;
+            }
+
+            if (search)
+                ++pos;
+            else
+                pos = lastPos;
+        }
+
+        return nextActionFound;
+    }
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::setPass2TokenQuePosition(size_t pos, const bool activateAction)
+    {
+        if (pos < mActiveTokenState->tokenQue.size())
+        {
+            mPass2TokenQuePosition = pos;
+            ++pos;
+            // find the next token with an action
+            setNextActionQuePosition(pos, true);
+
+            // activate action if token has one and it was requested
+            if (activateAction)
+            {
+                const size_t tokenID = mActiveTokenState->tokenQue.at(mPass2TokenQuePosition).tokenID;
+                if ((tokenID < SystemTokenBase) &&
+                    mActiveTokenState->lexemeTokenDefinitions.at(tokenID).hasAction)
+                {
+                    // assume that pass 2 processing will use tokens downstream
+                    executeTokenAction(tokenID);
+                }
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::setClientBNFGrammer(void)
+    {
+        // switch to internal BNF Containers
+        // clear client containers
+        mClientTokenState = &mClientTokenStates[getClientGrammerName()];
+        // attempt to compile the grammer into a rule base if no rules exist
+        if (mClientTokenState->rootRulePath.size() == 0)
+        {
+            mClientTokenState->tokenQue.reserve(100);
+            mClientTokenState->lexemeTokenDefinitions.reserve(100);
+            // first entry in rule path is set as a bad entry and no token should reference it
+            mClientTokenState->rootRulePath.resize(1);
+            // allow the client to setup token definitions prior to
+            // compiling the BNF grammer
+            // ensure token definitions are added to the client state
+            mActiveTokenState = mClientTokenState;
+            // get client to setup token definitions and actions it wants to know about
+            setupTokenDefinitions();
+            // make sure active token state is for BNF compiling
+            mActiveTokenState = &mBNFTokenState;
+            mSource = &getClientBNFGrammer();
+
+            if (doPass1())
+            {
+                buildClientBNFRulePaths();
+            }
+            else
+            {
+                OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "BNF Grammar compilation failed for " +
+                    getClientGrammerName(), "Compiler2Pass::setClientBNFGrammer");
+            }
+            // change token state to client data after compiling grammer
+            mActiveTokenState = mClientTokenState;
+            // verify the client rule paths and associated terminal and non-terminal lexemes
+            verifyTokenRuleLinks(getClientGrammerName());
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    bool Compiler2Pass::processRulePath( size_t rulepathIDX)
+    {
+	    // rule path determines what tokens and therefore what lexemes are acceptable from the source
+	    // it is assumed that the tokens with the longest similar lexemes are arranged first so
+	    // if a match is found it is accepted and no further searching is done
+
+        if (rulepathIDX >= mActiveTokenState->rootRulePath.size())
+        {
+            // This is very bad and no way to recover so raise exception
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "rule ID exceeds rule base bounds.", "Compiler2Pass::processRulePath");
+        }
+	    // record position of last token in container
+	    // to be used as the rollback position if a valid token is not found
+        const size_t TokenContainerOldSize = mActiveTokenState->tokenQue.size();
+	    const size_t OldCharPos = mCharPos;
+	    const size_t OldLinePos = mCurrentLine;
+        const bool OldLabelIsActive = mLabelIsActive;
+        const size_t OldActiveLabelKey = mActiveLabelKey;
+        const String OldLabel = mLabels[OldActiveLabelKey];
+
+	    // keep track of what non-terminal token activated the rule
+	    size_t ActiveNTTRule = mActiveTokenState->rootRulePath[rulepathIDX].tokenID;
+	    // start rule path at next position for definition
+	    ++rulepathIDX;
+
+	    // assume the rule will pass
+	    bool passed = true;
+        bool tokenFound = false;
+	    bool endFound = false;
+	    bool clearInsertTokenID = false;
+
+	    // keep following rulepath until the end of the rule or the end of the source is reached
+        while (!(endFound || isEndOfSource()))
+	    {
+		    switch (mActiveTokenState->rootRulePath[rulepathIDX].operation)
+		    {
+
+		    case otAND:
+			    // only validate if the previous rule passed
+			    if (passed)
+				    passed = ValidateToken(rulepathIDX, ActiveNTTRule);
+                // log error message if a previouse token was found in this rule path and current token failed
+                if (tokenFound && (mCharPos != mErrorCharPos) && !passed)
+                {
+                    mErrorCharPos = mCharPos;
+                    LogManager::getSingleton().logMessage(
+                    "*** ERROR *** : in " + getClientGrammerName() +
+                    " Source: " + mSourceName +
+                    "\nUnknown token found on line " + StringConverter::toString(mCurrentLine) +
+                    "\nFound: >>>" + mSource->substr(mCharPos, 20) +
+                    "<<<\nbut was expecting form: " + getBNFGrammerTextFromRulePath(rulepathIDX, 2) +
+                    "\nwhile in rule path: <" + mActiveTokenState->lexemeTokenDefinitions[ActiveNTTRule].lexeme +
+                    ">"
+                    );
+                    // log last valid token found
+                    const TokenInst& tokenInst = mActiveTokenState->tokenQue.back();
+                    LogManager::getSingleton().logMessage(
+                        "Last valid token found was on line " + StringConverter::toString(tokenInst.line));
+                    LogManager::getSingleton().logMessage(
+                        "source hint: >>>" + mSource->substr(tokenInst.pos, 20) + "<<<");
+                }
+
+			    break;
+
+		    case otOR:
+			    // only validate if the previous rule failed
+			    if ( passed == false )
+			    {
+				    // clear previous tokens from entry and try again
+				    mActiveTokenState->tokenQue.resize(TokenContainerOldSize);
+				    passed = ValidateToken(rulepathIDX, ActiveNTTRule);
+			    }
+			    else
+			    {
+				    // path passed up to this point therefore finished so pretend end marker found
+				    endFound = true;
+			    }
+			    break;
+
+		    case otOPTIONAL:
+			    // if previous passed then try this rule but it does not effect succes of rule since its optional
+			    if(passed) ValidateToken(rulepathIDX, ActiveNTTRule);
+			    break;
+
+		    case otREPEAT:
+			    // repeat until called rule fails or cursor does not advance
+			    // repeat is 0 or more times
+			    if (passed)
+			    {
+				    // keep calling until failure or no change in cursor position
+            	    size_t prevPos = mCharPos;
+				    while ( ValidateToken(rulepathIDX, ActiveNTTRule))
+				    {
+                        if (mCharPos > prevPos)
+                        {
+                            prevPos = mCharPos;
+                        }
+                        else
+                        {
+                            // repeat failed to advance the cursor position so time to quit since the repeating rule
+                            // path isn't finding anything
+                            // this can happen if the rule being called only has _optional_ rules
+                            // this checking of the cursor positions prevents infinite loop from occuring
+                            break;
+                        }
+				    }
+			    }
+			    break;
+
+            case otDATA:
+                // skip it, should have been handled by previous operation.
+                break;
+
+            case otNOT_TEST:
+			    // only validate if the previous rule passed
+			    if (passed)
+                {
+
+                    // perform look ahead and test if rule production fails
+                    const size_t la_TokenContainerOldSize = mActiveTokenState->tokenQue.size();
+	                const size_t la_OldCharPos = mCharPos;
+	                const size_t la_OldLinePos = mCurrentLine;
+	                const bool la_OldLabelIsActive = mLabelIsActive;
+	                const size_t la_OldActiveLabelKey = mActiveLabelKey;
+	                const String la_OldLabel = mLabels[la_OldActiveLabelKey];
+
+                    passed = !ValidateToken(rulepathIDX, ActiveNTTRule);
+
+                    // only wanted to take a peek as to what was ahead so now restore back to current position
+			        mActiveTokenState->tokenQue.resize(la_TokenContainerOldSize);
+			        mCharPos = la_OldCharPos;
+			        mCurrentLine = la_OldLinePos;
+			        // restor label state if it was active before not test
+			        if (la_OldLabelIsActive)
+			        {
+                        mActiveLabelKey = la_OldActiveLabelKey;
+                        mLabelIsActive = la_OldLabelIsActive;
+                        mActiveLabel = &mLabels[mActiveLabelKey];
+                        *mActiveLabel = la_OldLabel;
+			        }
+                    // only perform full rollback if tokens found
+			        if (!passed)
+			        {
+				        // the rule did not validate so get rid of tokens decoded
+				        // roll back the token container end position to what it was when rule started
+				        // this will get rid of all tokens that had been pushed on the container while
+				        // trying to validating this rule
+				        mActiveTokenState->tokenQue.resize(TokenContainerOldSize);
+				        //mConstants.resize(OldConstantsSize);
+				        mCharPos = OldCharPos;
+				        mCurrentLine = OldLinePos;
+                        // restor label state if it was active before not test
+                        if (OldLabelIsActive)
+                        {
+                            mActiveLabelKey = OldActiveLabelKey;
+                            mLabelIsActive = OldLabelIsActive;
+                            mActiveLabel = &mLabels[mActiveLabelKey];
+                            *mActiveLabel = OldLabel;
+                        }
+
+                        // terminate rule production processing
+        			    endFound = true;
+			        }
+                }
+                break;
+
+            case otINSERT_TOKEN:
+                mInsertTokenID = mActiveTokenState->rootRulePath[rulepathIDX].tokenID;
+                clearInsertTokenID = true;
+                break;
+
+		    case otEND:
+			    // end of rule found so time to return
+			    endFound = true;
+                // only rollback if no tokens found
+			    if (!passed && !tokenFound)
+			    {
+				    // the rule did not validate so get rid of tokens decoded
+				    // roll back the token container end position to what it was when rule started
+				    // this will get rid of all tokens that had been pushed on the container while
+				    // trying to validating this rule
+				    mActiveTokenState->tokenQue.resize(TokenContainerOldSize);
+				    //mConstants.resize(OldConstantsSize);
+				    mCharPos = OldCharPos;
+				    mCurrentLine = OldLinePos;
+			    }
+			    else
+			    {
+			        // if the rule path was partially completed, one or more tokens found then mark it as passed
+                    if (!passed && tokenFound && !mLabelIsActive)
+                    {
+                        passed = true;
+                    }
+			    }
+			    break;
+
+		    default:
+			    // an exception should be raised since the code should never get here
+			    passed = false;
+			    endFound = true;
+			    break;
+
+		    } // end switch
+            // prevent rollback from occuring if a token was found but later part of rule fails
+            // this allows pass2 to either fix the problem or report the error and continue on.
+            // Don't do this for _no_token_ since its a special system token and has nothing todo with
+            // a successfull parse of the source.  Can check this by looking at mNoTerminalToken state.
+            // if _no_token had just been validated then mNoTerminalToken will be true.
+            if (passed && !mNoTerminalToken && !mInsertTokenID)
+                tokenFound = true;
+		    // move on to the next rule in the path
+		    ++rulepathIDX;
+	    } // end while
+	    
+        // if this rule production requested a token insert, make sure its reset so it does not affect
+        // the parent rule
+        if (clearInsertTokenID)
+            mInsertTokenID = 0;
+
+	    return passed;
+    }
+
+    //-----------------------------------------------------------------------
+    bool Compiler2Pass::isCharacterLabel(const size_t rulepathIDX)
+    {
+        if (isEndOfSource())
+            return false;
+            
+	    // assume the test is going to fail
+	    bool Passed = false;
+
+        // get token from next rule operation.
+        // token string is list of valid or invalid single characters.
+        // If the token string starts with a ! then the set is for invalid characters.
+        // compare character at current cursor position in script to characters in list for a match
+        // if match found then add character to active label
+        // _character_ will not have  a token definition but the next rule operation should be
+        // DATA and have the token ID required to get the character set.
+        const TokenRule& rule = mActiveTokenState->rootRulePath[rulepathIDX + 1];
+        if (rule.operation == otDATA)
+        {
+            const size_t TokenID = rule.tokenID;
+            // check for ! as first character in character set indicating that an input character is
+            // accepted if its not in the character set.
+            // Otherwise a pass occurs if the input character is found in the character set.
+            const String& characterSet = mActiveTokenState->lexemeTokenDefinitions[TokenID].lexeme;
+            if ((characterSet.size() > 1) && characterSet[0] == '!')
+                Passed = characterSet.find((*mSource)[mCharPos], 1) == String::npos;
+            else
+                Passed = characterSet.find((*mSource)[mCharPos]) != String::npos;
+
+            if (Passed)
+            {
+                // is a new label starting?
+                // if mLabelIsActive is false then starting a new label so need a new mActiveLabelKey
+                if (!mLabelIsActive)
+                {
+                    // mActiveLabelKey will be the end of the instruction container ie the size of mTokenInstructions
+                    mActiveLabelKey = mActiveTokenState->tokenQue.size();
+                    // if a token insert is pending then use next key
+                    if (mInsertTokenID)
+                        ++mActiveLabelKey;
+                    mLabelIsActive = true;
+                    mNoSpaceSkip = true;
+                    // reset the contents of the label since it might have been used prior to a rollback
+                    // and cach string location so don't have to look it up for the rest of the label processing
+                    mActiveLabel = &mLabels[mActiveLabelKey];
+                    mActiveLabel->clear();
+                }
+                // add the single character to the end of the active label
+                *mActiveLabel += (*mSource)[mCharPos];
+            }
+        }
+
+        return Passed;
+    }
+    //-----------------------------------------------------------------------
+    bool Compiler2Pass::ValidateToken(const size_t rulepathIDX, const size_t activeRuleID)
+    {
+	    size_t tokenlength = 0;
+	    // assume the test is going to fail
+	    bool Passed = false;
+	    size_t tokenID = mActiveTokenState->rootRulePath[rulepathIDX].tokenID;
+	    // if terminal token then compare text of lexeme with what is in source
+	    if ( (tokenID >= SystemTokenBase) ||
+            !mActiveTokenState->lexemeTokenDefinitions[tokenID].isNonTerminal )
+	    {
+            if (tokenID != _character_)
+            {
+                mLabelIsActive = false;
+                // allow spaces to be skipped for next lexeme processing
+                mNoSpaceSkip = false;
+            }
+
+	        if (tokenID == _no_space_skip_)
+	        {
+                // don't skip spaces to get to next lexeme
+                mNoSpaceSkip = true;
+                // move on to next rule
+                Passed = true;
+	        }
+	        else if (tokenID == _no_token_)
+	        {
+	            // turn on no terminal token processing for next rule
+                mNoTerminalToken = true;
+                // move on to next rule
+                Passed = true;
+	        }
+            // if label processing is active ie previous token was _character_
+            // and current token is supposed to be a _character_ then don't
+            // position to next lexeme in source
+		    else if (mNoSpaceSkip || positionToNextLexeme())
+		    {
+			    // if Token is supposed to be a number then check if its a numerical constant
+			    if (tokenID == _value_)
+			    {
+    			    float constantvalue = 0.0f;
+				    if (Passed = isFloatValue(constantvalue, tokenlength))
+				    {
+                        // key is the next instruction index
+                        size_t key = mActiveTokenState->tokenQue.size();
+                        // if a token insert is pending then use next key
+                        if (mInsertTokenID)
+                            ++key;
+                        mConstants[key] = constantvalue;
+				    }
+			    }
+                else // check if user label or valid keyword token
+                {
+                    if (tokenID == _character_)
+                    {
+                        if (Passed = isCharacterLabel(rulepathIDX))
+                            // only one character was processed
+                            tokenlength = 1;
+                    }
+                    else
+                    {
+			            // compare token lexeme text with source text
+                        if (Passed = isLexemeMatch(mActiveTokenState->lexemeTokenDefinitions[tokenID].lexeme, mActiveTokenState->lexemeTokenDefinitions[tokenID].isCaseSensitive))
+                        {
+                            tokenlength = mActiveTokenState->lexemeTokenDefinitions[tokenID].lexeme.length();
+                            // check if terminal token should be ignored ie not put in instruction que
+                            if (mNoTerminalToken)
+                                tokenID = _no_token_;
+                        }
+                        // always clear no terminal token flag.  it only works for one pending terminal token.
+                        mNoTerminalToken = false;
+                    }
+                }
+
+                // turn off label processing if token ID was not for _character_
+                if (tokenID == _character_)
+                {
+                    // _character_ token being processed
+                    // turn off generation of a new token instruction if this is not
+                    // the first _character_ in a sequence of _character_ terminal tokens.
+                    // Only want one _character_ token which Identifies a label
+
+                    if (mActiveTokenState->tokenQue.size() > mActiveLabelKey)
+                    {
+                        // this token is not the first _character_ in the label sequence
+                        // so turn off the token by turning TokenID into _no_token_
+                        tokenID = _no_token_;
+                    }
+                }
+
+                // if valid terminal token was found then add it to the instruction container for pass 2 processing
+			    if (Passed)
+			    {
+                    if (tokenID != _no_token_)
+                    {
+				        TokenInst newtoken;
+				        // push token onto end of container
+				        newtoken.NTTRuleID = activeRuleID;
+				        newtoken.line = mCurrentLine;
+				        newtoken.pos = mCharPos;
+                        newtoken.found = true;
+
+                        // check to see if a terminal token is waiting to be inserted based on the next
+                        // token being found
+                        if (mInsertTokenID)
+                        {
+                            newtoken.tokenID = mInsertTokenID;
+                            mActiveTokenState->tokenQue.push_back(newtoken);
+                            // token action processing
+                            // if the token has an action then fire previous token action
+                            checkTokenActionTrigger();
+                            // reset the token ID that was inserted so that it will not get inserted until set again
+                            mInsertTokenID = 0;
+                        }
+
+                        newtoken.tokenID = tokenID;
+				        mActiveTokenState->tokenQue.push_back(newtoken);
+				        // token action processing
+				        // if the token has an action then fire previous token action
+				        checkTokenActionTrigger();
+                    }
+
+                    // update source position
+				    mCharPos += tokenlength;
+			    } // end if
+		    } // end else if
+
+	    }
+	    // else a non terminal token was found
+	    else
+	    {
+		    // execute rule for non-terminal
+		    // get rule_ID for index into  rulepath to be called
+		    Passed = processRulePath(mActiveTokenState->lexemeTokenDefinitions[tokenID].ruleID);
+	    }
+
+	    return Passed;
+    }
+
+    //-----------------------------------------------------------------------
+    bool Compiler2Pass::isFloatValue(float& fvalue, size_t& charsize) const
+    {
+        if (isEndOfSource())
+            return false;
+            
+	    // check to see if it is a numeric float value
+	    bool valuefound = false;
+
+        const char* startptr = mSource->c_str() + mCharPos;
+	    char* endptr = NULL;
+
+	    fvalue = static_cast<float>(strtod(startptr, &endptr));
+	    // if a valid float was found then endptr will have the pointer to the first invalid character
+	    if (endptr)
+	    {
+		    if (endptr > startptr)
+		    {
+			    // a valid value was found so process it
+			    charsize = endptr - startptr;
+			    valuefound = true;
+		    }
+	    }
+
+	    return valuefound;
+    }
+
+    //-----------------------------------------------------------------------
+    bool Compiler2Pass::isLexemeMatch(const String& lexeme, const bool caseSensitive) const
+    {
+	    // compare text at source+charpos with the lexeme : limit testing to lexeme size
+	    if (!caseSensitive)
+	    {
+	        String testItem = mSource->substr(mCharPos, lexeme.length());
+	        StringUtil::toLowerCase(testItem);
+            return (testItem.compare(lexeme) == 0);
+	    }
+	    else
+	    {
+            return (mSource->compare(mCharPos, lexeme.length(), lexeme) == 0);
+	    }
+    }
+
+    //-----------------------------------------------------------------------
+    bool Compiler2Pass::positionToNextLexeme()
+    {
+        bool validlexemefound = false;
+        size_t oldCharPos = mCharPos;
+        
+	    while (!validlexemefound && !isEndOfSource())
+	    {
+		    skipWhiteSpace();
+		    skipEOL();
+		    skipComments();
+		    // have we reached the end of the source?
+            if (!isEndOfSource())
+		    {
+			    // if ASCII > space then assume valid character is found
+			    if (static_cast<uchar>((*mSource)[mCharPos]) > static_cast<uchar>(' '))
+			    {
+			        validlexemefound = true;
+			    }
+			    else // maybe a control character has been encountered?
+			    {
+                    // check if the char pos advanced in this iteration.
+                    // If it didn't then we have found a char that
+                    // is not relevent to the parse so skip it so that we don't
+                    // end up in an infinite loop.
+                    if (oldCharPos == mCharPos)
+                        ++mCharPos;
+
+			        // endofsource will get checked on next iteration of this loop so no need to check it here
+			        // need to update oldCharPos so that position advancement can be varified on the next iteration
+                    oldCharPos = mCharPos;
+			    }
+		    }
+	    }// end of while
+
+	    return validlexemefound;
+    }
+
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::skipComments()
+    {
+        if (isEndOfSource())
+            return;
+        // if current char and next are // then search for EOL
+        if (mSource->compare(mCharPos, 2, "//") == 0)
+			 findEOL();
+    }
+
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::findEOL()
+    {
+        if (isEndOfSource())
+            return;
+	    // find eol charter and move to this position
+        mCharPos = mSource->find('\n', mCharPos);
+    }
+
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::skipEOL()
+    {
+        if (isEndOfSource())
+            return;
+
+	    if (((*mSource)[mCharPos] == '\n') || ((*mSource)[mCharPos] == '\r'))
+	    {
+		    mCurrentLine++;
+		    mCharPos++;
+            if (mCharPos >= mEndOfSource)
+                return;
+		    if (((*mSource)[mCharPos] == '\n') || ((*mSource)[mCharPos] == '\r'))
+		    {
+			    mCharPos++;
+		    }
+	    }
+    }
+
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::skipWhiteSpace()
+    {
+        if (isEndOfSource())
+            return;
+
+        mCharPos = mSource->find_first_not_of(" \t", mCharPos);
+    }
+
+    //-----------------------------------------------------------------------
+    size_t Compiler2Pass::addLexemeToken(const String& lexeme, const size_t token, const bool hasAction, const bool caseSensitive)
+    {
+        size_t newTokenID = token;
+        // if token ID is zero then auto-generate a new token ID
+        if (newTokenID == 0)
+        {
+            // assume BNF system bootstrap is current state
+            size_t autoTokenIDStart = BNF_AUTOTOKENSTART;
+            // if in client state then get auto token start position from the client
+            if (mActiveTokenState != &mBNFTokenState)
+                autoTokenIDStart = getAutoTokenIDStart();
+            // make sure new auto gen id starts at autoTokenIDStart or greater
+            newTokenID = (mActiveTokenState->lexemeTokenDefinitions.size() <= autoTokenIDStart ) ? autoTokenIDStart : newTokenID = mActiveTokenState->lexemeTokenDefinitions.size();
+        }
+
+        if (newTokenID >= mActiveTokenState->lexemeTokenDefinitions.size())
+        {
+            mActiveTokenState->lexemeTokenDefinitions.resize(newTokenID + 1);
+        }
+        // since resizing guarentees the token definition will exist, just assign values to members
+        LexemeTokenDef& tokenDef = mActiveTokenState->lexemeTokenDefinitions[newTokenID];
+        if (tokenDef.ID != 0)
+        {
+            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, "In " + getClientGrammerName() +
+                ", lexeme >>>" +
+                lexeme + "<<< already exists in lexeme token definitions",
+                "Compiler2Pass::addLexemeToken");
+        }
+        tokenDef.ID = newTokenID;
+        tokenDef.lexeme = lexeme;
+        if (!caseSensitive)
+            StringUtil::toLowerCase(tokenDef.lexeme);
+        tokenDef.hasAction = hasAction;
+        tokenDef.isCaseSensitive = caseSensitive;
+
+        mActiveTokenState->lexemeTokenMap[lexeme] = newTokenID;
+
+        return newTokenID;
+    }
+
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::checkTokenActionTrigger(void)
+    {
+        size_t lastTokenQuePos = mActiveTokenState->tokenQue.size();
+        // if there are no token instructions in the que then there is nothing todo
+        if (lastTokenQuePos == 0)
+            return;
+
+        --lastTokenQuePos;
+
+        if (lastTokenQuePos == mPreviousActionQuePosition)
+            return;
+
+        // check action trigger if last token has an action
+        if (setNextActionQuePosition(lastTokenQuePos))
+        {
+            // only activate the action belonging to the token found previously
+            activatePreviousTokenAction();
+            // current token action now becomes the previous one
+            mPreviousActionQuePosition = lastTokenQuePos;
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    String Compiler2Pass::getBNFGrammerTextFromRulePath(size_t ruleID, const size_t level)
+    {
+
+        String grammerText;
+
+        // default to using Client rule path
+        // check if index is inbounds
+        if (ruleID >= mActiveTokenState->rootRulePath.size())
+        {
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "rule ID exceeds client rule path bounds.", "Compiler2Pass::getBNFGrammerRulePathText");
+        }
+        // iterate through rule path and get terminal and non-terminal strings
+        const TokenRuleContainer& rulePath = mActiveTokenState->rootRulePath;
+
+        while (rulePath[ruleID].operation != otEND)
+        {
+            // rule text processing - the op instructions, system tokens
+            switch (rulePath[ruleID].operation)
+            {
+            // rule lexeme ::=
+            case otRULE:
+                grammerText += "\n" + getLexemeText(ruleID, level) + " ::=";
+                break;
+            // no special processing for AND op
+            case otAND:
+                grammerText += " " + getLexemeText(ruleID, level);
+                break;
+            // or | lexeme
+            case otOR:
+                grammerText += " | " + getLexemeText(ruleID, level);
+                break;
+            // optional [lexeme]
+            case otOPTIONAL:
+                grammerText += " [" + getLexemeText(ruleID, level) + "]";
+                break;
+            // repeat {lexeme}
+            case otREPEAT:
+                grammerText += " {" + getLexemeText(ruleID, level) + "}";
+                break;
+            // not test (?!lexeme)
+            case otNOT_TEST:
+                grammerText += " (?!" + getLexemeText(ruleID, level) + ")";
+                break;
+            default:
+                grammerText += "*** Unknown Operation ***";
+            }
+            // lexeme/token text procesing
+            ++ruleID;
+        }
+
+        return grammerText;
+    }
+
+    //-----------------------------------------------------------------------
+
+    //-----------------------------------------------------------------------
+    //              Private Methods
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String Compiler2Pass::getLexemeText(size_t& ruleID, const size_t level)
+    {
+        if (ruleID >= mActiveTokenState->rootRulePath.size())
+        {
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR,
+             "rule ID exceeds client rule path bounds.", "Compiler2Pass::getLexemeText"
+            );
+        }
+
+        String lexeme;
+
+        const TokenRuleContainer& rulePath = mActiveTokenState->rootRulePath;
+        const size_t tokenID = rulePath[ruleID].tokenID;
+
+        if ( tokenID < SystemTokenBase)
+        {
+            // non-terminal tokens
+            if (mActiveTokenState->lexemeTokenDefinitions[tokenID].isNonTerminal)
+            {
+                // allow expansion of non-terminals into terminals
+                if (level > 0)
+                {
+                    size_t subRuleID = mActiveTokenState->lexemeTokenDefinitions[tokenID].ruleID + 1;
+                    lexeme = getBNFGrammerTextFromRulePath(subRuleID, level - 1);
+                }
+                else
+                {
+                    lexeme = "<" + mActiveTokenState->lexemeTokenDefinitions[tokenID].lexeme + ">";
+                }
+            }
+            else // terminal tokens
+            {
+                lexeme = "'" + mActiveTokenState->lexemeTokenDefinitions[tokenID].lexeme + "'";
+            }
+        }
+        else // system token processing
+        {
+            switch (rulePath[ruleID].tokenID)
+            {
+            case _character_:
+                // need to get next rule instruction for data
+                ++ruleID;
+                // data for _character_ is always a set so put () around text string
+                lexeme = "(" + mActiveTokenState->lexemeTokenDefinitions[rulePath[ruleID].tokenID].lexeme + ")";
+                break;
+            case _value_:
+                // <#> - need name of label?
+                lexeme = "<#Number>";
+                break;
+            }
+        }
+
+        return lexeme;
+    }
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::activatePreviousTokenAction(void)
+    {
+        const size_t previousTokenID = mActiveTokenState->tokenQue.at(mPreviousActionQuePosition).tokenID;
+        const LexemeTokenDef& tokenDef = mActiveTokenState->lexemeTokenDefinitions.at(previousTokenID);
+        if (tokenDef.hasAction)
+        {
+            // set the current pass 2 token que position to previous action que position
+            // assume that pass 2 processing will use tokens downstream
+            mPass2TokenQuePosition = mPreviousActionQuePosition;
+            executeTokenAction(previousTokenID);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::buildClientBNFRulePaths(void)
+    {
+        bool isFirstToken = true;
+        OperationType pendingRuleOp = otAND;
+
+        // convert tokens in BNF token que to rule paths
+        while (getPass2TokenQueCount() > 0)
+        {
+            // get a pass 2 token
+            // if this is the first time getting a token then get the current token
+            const TokenInst& currentToken  = isFirstToken ? getCurrentToken() : getNextToken();
+            isFirstToken = false;
+            // only process the token if its valid
+            if (currentToken.found)
+            {
+                // a valid token has been found, convert to a rule
+                switch (currentToken.tokenID)
+                {
+                case BNF_ID_BEGIN: // <
+                    extractNonTerminal(pendingRuleOp);
+                    pendingRuleOp = otAND;
+                    break;
+
+
+                case BNF_CONSTANT_BEGIN: // <#
+                    extractNumericConstant(pendingRuleOp);
+                    pendingRuleOp = otAND;
+                    break;
+
+                case BNF_OR: // |
+                    pendingRuleOp = otOR;
+                    break;
+
+                case BNF_REPEAT_BEGIN: // {
+                    pendingRuleOp = otREPEAT;
+                    break;
+
+                case BNF_NO_TOKEN_START: // -'
+                    extractTerminal(pendingRuleOp, true);
+                    pendingRuleOp = otAND;
+                    break;
+
+                case BNF_SINGLEQUOTE: // '
+                    extractTerminal(pendingRuleOp);
+                    pendingRuleOp = otAND;
+                    break;
+
+                case BNF_OPTIONAL_BEGIN: // [
+                    pendingRuleOp = otOPTIONAL;
+                    break;
+
+                case BNF_NOT_TEST_BEGIN: // (?!
+                    pendingRuleOp = otNOT_TEST;
+                    break;
+
+                case BNF_SET_BEGIN: // (
+                    extractSet(pendingRuleOp);
+                    pendingRuleOp = otAND;
+                    break;
+
+                case BNF_CONDITIONAL_TOKEN_INSERT:
+                    setConditionalTokenInsert();
+                    break;
+
+                default:
+                    // trap closings ie ] } )
+                    break;
+                } // end switch
+            } // end if
+        } // end while
+    }
+
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::modifyLastRule(const OperationType pendingRuleOp, const size_t tokenID)
+    {
+        // add operation using this token ID to the current rule expression
+        size_t lastIndex = mClientTokenState->rootRulePath.size();
+        if (lastIndex == 0)
+        {
+            // throw exception since there should have been at least one rule existing
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "BNF Grammar build rules failed: no previous rule op defined", "Compiler2Pass::modifyLastRule");
+        }
+        --lastIndex;
+        mClientTokenState->rootRulePath[lastIndex].operation = pendingRuleOp;
+        mClientTokenState->rootRulePath[lastIndex].tokenID = tokenID;
+        // add new end op token rule
+        mClientTokenState->rootRulePath.push_back(TokenRule(otEND, 0));
+    }
+
+    //-----------------------------------------------------------------------
+    size_t Compiler2Pass::getClientLexemeTokenID(const String& lexeme, const bool isCaseSensitive)
+    {
+        size_t tokenID = mClientTokenState->lexemeTokenMap[lexeme];
+
+        if (tokenID == 0)
+        {
+            // lexeme not found so a new entry is made by the system
+            // note that all lexemes added by the system will not/can not have an action
+            tokenID = mClientTokenState->lexemeTokenDefinitions.size();
+            // add identifier to client lexeme tokens
+            mActiveTokenState = mClientTokenState;
+            addLexemeToken(lexeme, tokenID, false, isCaseSensitive);
+            mActiveTokenState = &mBNFTokenState;
+        }
+
+        return tokenID;
+    }
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::extractNonTerminal(const OperationType pendingRuleOp)
+    {
+        // begining of identifier
+        // next token should be for a label
+        const String& identifierLabel = getNextTokenLabel();
+        // next token should be id end
+        getNextToken(BNF_ID_END);
+        // add identifier to lexeme token definitions but keep case sensitivity
+        const size_t tokenID = getClientLexemeTokenID(identifierLabel, true);
+        LexemeTokenDef& tokenDef = mClientTokenState->lexemeTokenDefinitions[tokenID];
+
+        // peek at the next token isntruction to see if this
+        // identifier is for a new rule or is part of the current rule
+        if (testNextTokenID(BNF_SET_RULE))
+        {
+            // consume set rule
+            getNextToken(BNF_SET_RULE);
+            // check to make sure this is the first time this rule is being setup by
+            // verifying rule id is 0
+            if (tokenDef.ruleID != 0)
+            {
+                // this is not the first time for this identifier to be set up as a rule
+                // since duplicate rules can not exist, throw an exception
+                OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, "while parsing BNF grammer for: " +
+                    getClientGrammerName() +
+                    ", an attempt was made to assign a rule to identifier: " +
+                    tokenDef.lexeme + ", that already had a rule assigned",
+                    "Compiler2Pass::extractNonTerminal");
+            }
+            // add new rule to end of rule path
+            mClientTokenState->rootRulePath.push_back(TokenRule(otRULE, tokenID));
+            tokenDef.ruleID = mClientTokenState->rootRulePath.size() - 1;
+            // add new end op token rule
+            mClientTokenState->rootRulePath.push_back(TokenRule(otEND, 0));
+        }
+        else // just a reference to a non-terminal
+        {
+            modifyLastRule(pendingRuleOp, tokenID);
+        }
+
+        tokenDef.isNonTerminal = true;
+    }
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::extractTerminal(const OperationType pendingRuleOp, const bool notoken)
+    {
+        // begining of label
+        // next token should be for a label
+        const String& terminalLabel = getNextTokenLabel();
+        // next token should be single quote end
+        getNextToken(BNF_SINGLEQUOTE);
+        // add terminal to lexeme token definitions
+        // note that if label not in the map it is automatically added
+        const size_t tokenID = getClientLexemeTokenID(terminalLabel);
+        if (notoken)
+            modifyLastRule(otAND, _no_token_);
+        modifyLastRule(pendingRuleOp, tokenID);
+    }
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::setConditionalTokenInsert(void)
+    {
+        // get position of rule just before end rule
+        size_t lastIndex = mClientTokenState->rootRulePath.size();
+        if (lastIndex <= 1)
+        {
+            // throw exception since there should have been at least one rule existing
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "BNF Grammar build rules failed: no previous terminal token rule defined",
+                        "Compiler2Pass::setConditionalTokenInsert");
+        }
+        lastIndex -= 2;
+        mClientTokenState->rootRulePath[lastIndex].operation = otINSERT_TOKEN;
+    }
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::extractSet(const OperationType pendingRuleOp)
+    {
+        const String& setLabel = getNextTokenLabel();
+        // next token should be )
+        getNextToken(BNF_SET_END);
+        // add set to lexeme token definitions but keep case sensitivity
+        const size_t tokenID = getClientLexemeTokenID(setLabel, true);
+        // add operation using this token ID to the current rule expression
+        modifyLastRule(pendingRuleOp, _character_);
+        // add the data required by the character lookup operation
+        modifyLastRule(otDATA, tokenID);
+    }
+    //-----------------------------------------------------------------------
+    void Compiler2Pass::extractNumericConstant(const OperationType pendingRuleOp)
+    {
+        // consume label for constant, don't need it for anything
+        getNextTokenLabel();
+
+        getNextToken(BNF_ID_END); // >
+        // add operation using this token ID to the current rule expression
+        modifyLastRule(pendingRuleOp, _value_);
+    }
+
+
+}
Index: /OgreMain/src/OgreCompositionPass.cpp
===================================================================
--- /OgreMain/src/OgreCompositionPass.cpp	(revision 5)
+++ /OgreMain/src/OgreCompositionPass.cpp	(revision 5)
@@ -0,0 +1,275 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreCompositionPass.h"
+#include "OgreMaterialManager.h"
+
+namespace Ogre {
+
+CompositionPass::CompositionPass(CompositionTargetPass *parent):
+    mParent(parent),
+    mType(PT_RENDERQUAD),
+	mIdentifier(0),
+	mFirstRenderQueue(RENDER_QUEUE_SKIES_EARLY),
+	mLastRenderQueue(RENDER_QUEUE_SKIES_LATE),
+    mClearBuffers(FBT_COLOUR|FBT_DEPTH),
+    mClearColour(0.0,0.0,0.0,0.0),
+	mClearDepth(1.0f),
+	mClearStencil(0),
+    mStencilCheck(false),
+    mStencilFunc(CMPF_ALWAYS_PASS),
+    mStencilRefValue(0),
+    mStencilMask(0xFFFFFFFF),
+    mStencilFailOp(SOP_KEEP),
+    mStencilDepthFailOp(SOP_KEEP),
+    mStencilPassOp(SOP_KEEP),
+    mStencilTwoSidedOperation(false)
+{
+}
+//-----------------------------------------------------------------------
+CompositionPass::~CompositionPass()
+{
+}
+//-----------------------------------------------------------------------
+void CompositionPass::setType(CompositionPass::PassType type)
+{
+    mType = type;
+}
+//-----------------------------------------------------------------------
+CompositionPass::PassType CompositionPass::getType() const
+{
+    return mType;
+}
+//-----------------------------------------------------------------------
+void CompositionPass::setIdentifier(uint32 id)
+{
+    mIdentifier = id;
+}
+//-----------------------------------------------------------------------
+uint32 CompositionPass::getIdentifier() const
+{
+    return mIdentifier;
+}
+//-----------------------------------------------------------------------
+void CompositionPass::setMaterial(const MaterialPtr& mat)
+{
+    mMaterial = mat;
+}
+//-----------------------------------------------------------------------
+void CompositionPass::setMaterialName(const String &name)
+{
+    mMaterial = MaterialManager::getSingleton().getByName(name);
+}
+//-----------------------------------------------------------------------
+const MaterialPtr& CompositionPass::getMaterial() const
+{
+    return mMaterial;
+}
+//-----------------------------------------------------------------------
+void CompositionPass::setClearBuffers(uint32 val)
+{
+    mClearBuffers = val;
+}
+//-----------------------------------------------------------------------
+uint32 CompositionPass::getClearBuffers()
+{
+    return mClearBuffers;
+}
+//-----------------------------------------------------------------------
+void CompositionPass::setClearColour(ColourValue val)
+{
+    mClearColour = val;
+}
+//-----------------------------------------------------------------------
+const ColourValue &CompositionPass::getClearColour()
+{
+    return mClearColour;
+}
+//-----------------------------------------------------------------------
+void CompositionPass::setInput(size_t id, const String &input)
+{
+    assert(id<OGRE_MAX_TEXTURE_LAYERS);
+    mInputs[id] = input;
+}
+//-----------------------------------------------------------------------
+const String &CompositionPass::getInput(size_t id)
+{
+    assert(id<OGRE_MAX_TEXTURE_LAYERS);
+    return mInputs[id];
+}
+//-----------------------------------------------------------------------
+size_t CompositionPass::getNumInputs()
+{
+    size_t count = 0;
+    for(size_t x=0; x<OGRE_MAX_TEXTURE_LAYERS; ++x)
+    {
+        if(!mInputs[x].empty())
+            count = x+1;
+    }
+    return count;
+}
+//-----------------------------------------------------------------------
+void CompositionPass::clearAllInputs()
+{
+    for(size_t x=0; x<OGRE_MAX_TEXTURE_LAYERS; ++x)
+    {
+        mInputs[x].clear();
+    }
+}
+//-----------------------------------------------------------------------
+CompositionTargetPass *CompositionPass::getParent()
+{
+    return mParent;
+}
+//-----------------------------------------------------------------------
+void CompositionPass::setFirstRenderQueue(uint8 id)
+{
+	mFirstRenderQueue = id;
+}
+//-----------------------------------------------------------------------
+uint8 CompositionPass::getFirstRenderQueue()
+{
+	return mFirstRenderQueue;
+}
+//-----------------------------------------------------------------------
+void CompositionPass::setLastRenderQueue(uint8 id)
+{
+	mLastRenderQueue = id;
+}
+//-----------------------------------------------------------------------
+uint8 CompositionPass::getLastRenderQueue()
+{
+	return mLastRenderQueue;
+}
+//-----------------------------------------------------------------------
+void CompositionPass::setClearDepth(Real depth)
+{
+	mClearDepth = depth;
+}
+Real CompositionPass::getClearDepth()
+{
+	return mClearDepth;
+}
+void CompositionPass::setClearStencil(uint32 value)
+{
+	mClearStencil = value;
+}
+uint32 CompositionPass::getClearStencil()
+{
+	return mClearStencil;
+}
+
+void CompositionPass::setStencilCheck(bool value)
+{
+	mStencilCheck = value;
+}
+bool CompositionPass::getStencilCheck()
+{
+	return mStencilCheck;
+}
+void CompositionPass::setStencilFunc(CompareFunction value)
+{
+	mStencilFunc = value;
+}
+CompareFunction CompositionPass::getStencilFunc()
+{
+	return mStencilFunc;
+} 
+void CompositionPass::setStencilRefValue(uint32 value)
+{
+	mStencilRefValue = value;
+}
+uint32 CompositionPass::getStencilRefValue()
+{
+	return mStencilRefValue;
+}
+void CompositionPass::setStencilMask(uint32 value)
+{
+	mStencilMask = value;
+}
+uint32 CompositionPass::getStencilMask()
+{
+	return mStencilMask;
+}
+void CompositionPass::setStencilFailOp(StencilOperation value)
+{
+	mStencilFailOp = value;
+}
+StencilOperation CompositionPass::getStencilFailOp()
+{
+	return mStencilFailOp;
+}
+void CompositionPass::setStencilDepthFailOp(StencilOperation value)
+{
+	mStencilDepthFailOp = value;
+}
+StencilOperation CompositionPass::getStencilDepthFailOp()
+{
+	return mStencilDepthFailOp;
+}
+void CompositionPass::setStencilPassOp(StencilOperation value)
+{
+	mStencilPassOp = value;
+}
+StencilOperation CompositionPass::getStencilPassOp()
+{
+	return mStencilPassOp;
+}
+void CompositionPass::setStencilTwoSidedOperation(bool value)
+{
+	mStencilTwoSidedOperation = value;
+}
+bool CompositionPass::getStencilTwoSidedOperation()
+{
+	return mStencilTwoSidedOperation;
+}
+
+//-----------------------------------------------------------------------
+bool CompositionPass::_isSupported(void)
+{
+    // A pass is supported if material referenced have a supported technique
+
+    if (mType == PT_RENDERQUAD)
+    {
+        if (mMaterial.isNull())
+        {
+            return false;
+        }
+
+        mMaterial->compile();
+        if (mMaterial->getNumSupportedTechniques() == 0)
+        {
+            return false;
+        }
+    }
+
+    return true;
+}
+
+}
Index: /OgreMain/src/OgreCompositionTargetPass.cpp
===================================================================
--- /OgreMain/src/OgreCompositionTargetPass.cpp	(revision 5)
+++ /OgreMain/src/OgreCompositionTargetPass.cpp	(revision 5)
@@ -0,0 +1,191 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreCompositionTargetPass.h"
+#include "OgreCompositionPass.h"
+#include "OgreMaterialManager.h"
+
+namespace Ogre {
+
+CompositionTargetPass::CompositionTargetPass(CompositionTechnique *parent):
+    mParent(parent),
+    mInputMode(IM_NONE),
+    mOnlyInitial(false),
+    mVisibilityMask(0xFFFFFFFF),
+    mLodBias(1.0f),
+	mMaterialScheme(MaterialManager::DEFAULT_SCHEME_NAME), 
+	mShadowsEnabled(true)
+{
+}
+//-----------------------------------------------------------------------
+CompositionTargetPass::~CompositionTargetPass()
+{
+    removeAllPasses();
+}
+//-----------------------------------------------------------------------
+void CompositionTargetPass::setInputMode(InputMode mode)
+{
+    mInputMode = mode;
+}
+//-----------------------------------------------------------------------
+CompositionTargetPass::InputMode CompositionTargetPass::getInputMode() const
+{
+    return mInputMode;
+}
+//-----------------------------------------------------------------------
+void CompositionTargetPass::setOutputName(const String &out)
+{
+    mOutputName = out;
+}
+//-----------------------------------------------------------------------
+const String &CompositionTargetPass::getOutputName() const
+{
+    return mOutputName;
+}
+//-----------------------------------------------------------------------
+void CompositionTargetPass::setOnlyInitial(bool value)
+{
+    mOnlyInitial = value;
+}
+//-----------------------------------------------------------------------
+bool CompositionTargetPass::getOnlyInitial()
+{
+    return mOnlyInitial;
+}
+//-----------------------------------------------------------------------
+void CompositionTargetPass::setVisibilityMask(uint32 mask)
+{
+    mVisibilityMask = mask;
+}
+//-----------------------------------------------------------------------
+uint32 CompositionTargetPass::getVisibilityMask()
+{
+    return mVisibilityMask;
+}
+//-----------------------------------------------------------------------
+void CompositionTargetPass::setLodBias(float bias)
+{
+    mLodBias = bias;
+}
+//-----------------------------------------------------------------------
+float CompositionTargetPass::getLodBias()
+{
+    return mLodBias;
+}
+//-----------------------------------------------------------------------
+void CompositionTargetPass::setMaterialScheme(const String& schemeName)
+{
+	mMaterialScheme = schemeName;
+}
+//-----------------------------------------------------------------------
+const String& CompositionTargetPass::getMaterialScheme(void) const
+{
+	return mMaterialScheme;
+}
+//-----------------------------------------------------------------------
+void CompositionTargetPass::setShadowsEnabled(bool enabled)
+{
+	mShadowsEnabled = enabled;
+}
+//-----------------------------------------------------------------------
+bool CompositionTargetPass::getShadowsEnabled(void) const
+{
+	return mShadowsEnabled;
+}
+//-----------------------------------------------------------------------
+CompositionPass *CompositionTargetPass::createPass()
+{
+    CompositionPass *t = new CompositionPass(this);
+    mPasses.push_back(t);
+    return t;
+}
+//-----------------------------------------------------------------------
+
+void CompositionTargetPass::removePass(size_t index)
+{
+    assert (index < mPasses.size() && "Index out of bounds.");
+    Passes::iterator i = mPasses.begin() + index;
+    delete(*i);
+    mPasses.erase(i);
+}
+//-----------------------------------------------------------------------
+
+CompositionPass *CompositionTargetPass::getPass(size_t index)
+{
+    assert (index < mPasses.size() && "Index out of bounds.");
+    return mPasses[index];
+}
+//-----------------------------------------------------------------------
+
+size_t CompositionTargetPass::getNumPasses()
+{
+    return mPasses.size();
+}
+//-----------------------------------------------------------------------
+void CompositionTargetPass::removeAllPasses()
+{
+    Passes::iterator i, iend;
+    iend = mPasses.end();
+    for (i = mPasses.begin(); i != iend; ++i)
+    {
+        delete(*i);
+    }
+    mPasses.clear();
+}
+//-----------------------------------------------------------------------
+CompositionTargetPass::PassIterator CompositionTargetPass::getPassIterator(void)
+{
+    return PassIterator(mPasses.begin(), mPasses.end());
+}
+
+//-----------------------------------------------------------------------
+CompositionTechnique *CompositionTargetPass::getParent()
+{
+    return mParent;
+}
+
+//-----------------------------------------------------------------------
+bool CompositionTargetPass::_isSupported(void)
+{
+    // A target pass is supported if all passes are supported
+
+    PassIterator passi = getPassIterator();
+    while (passi.hasMoreElements())
+    {
+        CompositionPass* pass = passi.getNext();
+        if (!pass->_isSupported())
+        {
+            return false;
+        }
+    }
+
+    return true;
+}
+
+}
Index: /OgreMain/src/OgreCompositionTechnique.cpp
===================================================================
--- /OgreMain/src/OgreCompositionTechnique.cpp	(revision 5)
+++ /OgreMain/src/OgreCompositionTechnique.cpp	(revision 5)
@@ -0,0 +1,232 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreCompositionTechnique.h"
+#include "OgreCompositionTargetPass.h"
+#include "OgreCompositorInstance.h"
+#include "OgreCompositorChain.h"
+#include "OgreCompositionPass.h"
+#include "OgreTextureManager.h"
+
+namespace Ogre {
+
+CompositionTechnique::CompositionTechnique(Compositor *parent):
+    mParent(parent)
+{
+    mOutputTarget = new CompositionTargetPass(this);
+}
+//-----------------------------------------------------------------------
+CompositionTechnique::~CompositionTechnique()
+{
+	/// Destroy all instances by removing them from their chain
+	/// CompositorChain::removeInstance also calls destroyInstance
+	Instances copy = mInstances;
+	for(Instances::iterator i=copy.begin(); i!=copy.end(); ++i)
+		(*i)->getChain()->_removeInstance(*i);
+
+    removeAllTextureDefinitions();
+    removeAllTargetPasses();
+    delete mOutputTarget;
+}
+//-----------------------------------------------------------------------
+CompositionTechnique::TextureDefinition *CompositionTechnique::createTextureDefinition(const String &name)
+{
+    TextureDefinition *t = new TextureDefinition();
+    t->name = name;
+    mTextureDefinitions.push_back(t);
+    return t;
+}
+//-----------------------------------------------------------------------
+
+void CompositionTechnique::removeTextureDefinition(size_t index)
+{
+    assert (index < mTextureDefinitions.size() && "Index out of bounds.");
+    TextureDefinitions::iterator i = mTextureDefinitions.begin() + index;
+    delete(*i);
+    mTextureDefinitions.erase(i);
+}
+//-----------------------------------------------------------------------
+
+CompositionTechnique::TextureDefinition *CompositionTechnique::getTextureDefinition(size_t index)
+{
+    assert (index < mTextureDefinitions.size() && "Index out of bounds.");
+    return mTextureDefinitions[index];
+}
+//-----------------------------------------------------------------------
+
+size_t CompositionTechnique::getNumTextureDefinitions()
+{
+    return mTextureDefinitions.size();
+}
+//-----------------------------------------------------------------------
+void CompositionTechnique::removeAllTextureDefinitions()
+{
+    TextureDefinitions::iterator i, iend;
+    iend = mTextureDefinitions.end();
+    for (i = mTextureDefinitions.begin(); i != iend; ++i)
+    {
+        delete(*i);
+    }
+    mTextureDefinitions.clear();
+}
+//-----------------------------------------------------------------------
+CompositionTechnique::TextureDefinitionIterator CompositionTechnique::getTextureDefinitionIterator(void)
+{
+    return TextureDefinitionIterator(mTextureDefinitions.begin(), mTextureDefinitions.end());
+}
+
+//-----------------------------------------------------------------------
+CompositionTargetPass *CompositionTechnique::createTargetPass()
+{
+    CompositionTargetPass *t = new CompositionTargetPass(this);
+    mTargetPasses.push_back(t);
+    return t;
+}
+//-----------------------------------------------------------------------
+
+void CompositionTechnique::removeTargetPass(size_t index)
+{
+    assert (index < mTargetPasses.size() && "Index out of bounds.");
+    TargetPasses::iterator i = mTargetPasses.begin() + index;
+    delete(*i);
+    mTargetPasses.erase(i);
+}
+//-----------------------------------------------------------------------
+
+CompositionTargetPass *CompositionTechnique::getTargetPass(size_t index)
+{
+    assert (index < mTargetPasses.size() && "Index out of bounds.");
+    return mTargetPasses[index];
+}
+//-----------------------------------------------------------------------
+
+size_t CompositionTechnique::getNumTargetPasses()
+{
+    return mTargetPasses.size();
+}
+//-----------------------------------------------------------------------
+void CompositionTechnique::removeAllTargetPasses()
+{
+    TargetPasses::iterator i, iend;
+    iend = mTargetPasses.end();
+    for (i = mTargetPasses.begin(); i != iend; ++i)
+    {
+        delete(*i);
+    }
+    mTargetPasses.clear();
+}
+//-----------------------------------------------------------------------
+CompositionTechnique::TargetPassIterator CompositionTechnique::getTargetPassIterator(void)
+{
+    return TargetPassIterator(mTargetPasses.begin(), mTargetPasses.end());
+}
+//-----------------------------------------------------------------------
+CompositionTargetPass *CompositionTechnique::getOutputTargetPass()
+{
+    return mOutputTarget;
+}
+//-----------------------------------------------------------------------
+bool CompositionTechnique::isSupported(bool acceptTextureDegradation)
+{
+	// A technique is supported if all materials referenced have a supported
+	// technique, and the intermediate texture formats requested are supported
+	// Material support is a cast-iron requirement, but if no texture formats 
+	// are directly supported we can let the rendersystem create the closest 
+	// match for the least demanding technique
+	
+
+    // Check output target pass is supported
+    if (!mOutputTarget->_isSupported())
+    {
+        return false;
+    }
+
+    // Check all target passes is supported
+    TargetPasses::iterator pi, piend;
+    piend = mTargetPasses.end();
+    for (pi = mTargetPasses.begin(); pi != piend; ++pi)
+    {
+        CompositionTargetPass* targetPass = *pi;
+        if (!targetPass->_isSupported())
+        {
+            return false;
+        }
+    }
+
+    TextureDefinitions::iterator i, iend;
+    iend = mTextureDefinitions.end();
+	TextureManager& texMgr = TextureManager::getSingleton();
+    for (i = mTextureDefinitions.begin(); i != iend; ++i)
+    {
+		TextureDefinition* td = *i;
+
+		// Check whether equivalent supported
+		if(acceptTextureDegradation)
+		{
+			// Don't care about exact format so long as something is supported
+			if(texMgr.getNativeFormat(TEX_TYPE_2D, td->format, TU_RENDERTARGET) == PF_UNKNOWN)
+			{
+				return false;
+			}
+		}
+		else
+		{
+			// Need a format which is the same number of bits to pass
+			if (!texMgr.isEquivalentFormatSupported(TEX_TYPE_2D, td->format, TU_RENDERTARGET))
+			{
+				return false;
+			}	
+		}
+	}
+	
+	// Must be ok
+	return true;
+}
+//-----------------------------------------------------------------------
+CompositorInstance *CompositionTechnique::createInstance(CompositorChain *chain)
+{
+	CompositorInstance *mew = new CompositorInstance(mParent, this, chain);
+	mInstances.push_back(mew);
+    return mew;
+}
+//-----------------------------------------------------------------------
+void CompositionTechnique::destroyInstance(CompositorInstance *instance)
+{
+    assert(instance->getTechnique() == this);
+	/// Erase from list of instances
+	mInstances.erase(std::find(mInstances.begin(), mInstances.end(), instance));
+    delete instance;
+}
+//-----------------------------------------------------------------------
+Compositor *CompositionTechnique::getParent()
+{
+    return mParent;
+}
+
+}
Index: /OgreMain/src/OgreCompositor.cpp
===================================================================
--- /OgreMain/src/OgreCompositor.cpp	(revision 5)
+++ /OgreMain/src/OgreCompositor.cpp	(revision 5)
@@ -0,0 +1,170 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreCompositor.h"
+#include "OgreCompositionTechnique.h"
+
+namespace Ogre {
+
+//-----------------------------------------------------------------------
+Compositor::Compositor(ResourceManager* creator, const String& name, ResourceHandle handle,
+            const String& group, bool isManual, ManualResourceLoader* loader):
+    Resource(creator, name, handle, group, isManual, loader),
+    mCompilationRequired(true)
+{
+}
+//-----------------------------------------------------------------------
+
+Compositor::~Compositor()
+{
+    removeAllTechniques();
+    // have to call this here reather than in Resource destructor
+    // since calling virtual methods in base destructors causes crash
+    unload(); 
+}
+//-----------------------------------------------------------------------
+CompositionTechnique *Compositor::createTechnique()
+{
+    CompositionTechnique *t = new CompositionTechnique(this);
+    mTechniques.push_back(t);
+    mCompilationRequired = true;
+    return t;
+}
+//-----------------------------------------------------------------------
+
+void Compositor::removeTechnique(size_t index)
+{
+    assert (index < mTechniques.size() && "Index out of bounds.");
+    Techniques::iterator i = mTechniques.begin() + index;
+    delete(*i);
+    mTechniques.erase(i);
+    mSupportedTechniques.clear();
+    mCompilationRequired = true;
+}
+//-----------------------------------------------------------------------
+
+CompositionTechnique *Compositor::getTechnique(size_t index)
+{
+    assert (index < mTechniques.size() && "Index out of bounds.");
+    return mTechniques[index];
+}
+//-----------------------------------------------------------------------
+
+size_t Compositor::getNumTechniques()
+{
+    return mTechniques.size();
+}
+//-----------------------------------------------------------------------
+void Compositor::removeAllTechniques()
+{
+    Techniques::iterator i, iend;
+    iend = mTechniques.end();
+    for (i = mTechniques.begin(); i != iend; ++i)
+    {
+        delete(*i);
+    }
+    mTechniques.clear();
+    mSupportedTechniques.clear();
+    mCompilationRequired = true;
+}
+//-----------------------------------------------------------------------
+Compositor::TechniqueIterator Compositor::getTechniqueIterator(void)
+{
+    return TechniqueIterator(mTechniques.begin(), mTechniques.end());
+}
+//-----------------------------------------------------------------------
+
+CompositionTechnique *Compositor::getSupportedTechnique(size_t index)
+{
+    assert (index < mSupportedTechniques.size() && "Index out of bounds.");
+    return mSupportedTechniques[index];
+}
+//-----------------------------------------------------------------------
+
+size_t Compositor::getNumSupportedTechniques()
+{
+    return mSupportedTechniques.size();
+}
+//-----------------------------------------------------------------------
+
+Compositor::TechniqueIterator Compositor::getSupportedTechniqueIterator(void)
+{
+    return TechniqueIterator(mSupportedTechniques.begin(), mSupportedTechniques.end());
+}
+//-----------------------------------------------------------------------
+void Compositor::loadImpl(void)
+{
+    // compile if required
+    if (mCompilationRequired)
+        compile();
+}
+//-----------------------------------------------------------------------
+void Compositor::unloadImpl(void)
+{
+}
+//-----------------------------------------------------------------------
+size_t Compositor::calculateSize(void) const
+{
+    return 0;
+}
+
+//-----------------------------------------------------------------------
+void Compositor::compile()
+{
+    /// Sift out supported techniques
+    mSupportedTechniques.clear();
+    Techniques::iterator i, iend;
+    iend = mTechniques.end();
+
+	// Try looking for exact technique support with no texture fallback
+    for (i = mTechniques.begin(); i != iend; ++i)
+    {
+        // Look for exact texture support first
+        if((*i)->isSupported(false))
+        {
+            mSupportedTechniques.push_back(*i);
+        }
+    }
+
+	if (mSupportedTechniques.empty())
+	{
+		// Check again, being more lenient with textures
+		for (i = mTechniques.begin(); i != iend; ++i)
+		{
+			// Allow texture support with degraded pixel format
+			if((*i)->isSupported(true))
+			{
+				mSupportedTechniques.push_back(*i);
+			}
+		}
+	}
+    mCompilationRequired = false;
+}
+
+}
Index: /OgreMain/src/OgreCompositorChain.cpp
===================================================================
--- /OgreMain/src/OgreCompositorChain.cpp	(revision 5)
+++ /OgreMain/src/OgreCompositorChain.cpp	(revision 5)
@@ -0,0 +1,414 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreCompositorChain.h"
+#include "OgreCompositionTechnique.h"
+#include "OgreCompositorInstance.h"
+#include "OgreCompositionTargetPass.h"
+#include "OgreCompositionPass.h"
+#include "OgreViewport.h"
+#include "OgreCamera.h"
+#include "OgreRenderTarget.h"
+#include "OgreLogManager.h"
+#include "OgreCompositorManager.h"
+#include "OgreSceneManager.h"
+#include "OgreRenderQueueInvocation.h"
+namespace Ogre {
+CompositorChain::CompositorChain(Viewport *vp):
+    mViewport(vp),
+	mOriginalScene(0),
+    mDirty(true),
+	mAnyCompositorsEnabled(false)
+{
+	mOldClearEveryFrameBuffers = mViewport->getClearBuffers();
+    assert(mViewport);
+}
+//-----------------------------------------------------------------------
+CompositorChain::~CompositorChain()
+{
+	destroyResources();
+}
+//-----------------------------------------------------------------------
+void CompositorChain::destroyResources(void)
+{
+	clearCompiledState();
+
+	if (mViewport)
+	{
+		removeAllCompositors();
+		mViewport->getTarget()->removeListener(this);
+		/// Destroy "original scene" compositor instance
+		if (mOriginalScene)
+		{
+			mOriginalScene->getTechnique()->destroyInstance(mOriginalScene);
+			mOriginalScene = 0;
+		}
+		mViewport = 0;
+	}
+}
+//-----------------------------------------------------------------------
+CompositorInstance* CompositorChain::addCompositor(CompositorPtr filter, size_t addPosition, size_t technique)
+{
+	// Init on demand
+	if (!mOriginalScene)
+	{
+		mViewport->getTarget()->addListener(this);
+		
+		/// Create base "original scene" compositor
+		CompositorPtr base = CompositorManager::getSingleton().load("Ogre/Scene",
+			ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME);
+		mOriginalScene = base->getSupportedTechnique(0)->createInstance(this);
+	}
+
+
+	filter->touch();
+    if(technique >= filter->getNumSupportedTechniques())
+    {
+        /// Warn user
+        LogManager::getSingleton().logMessage(
+            "CompositorChain: Compositor " + filter->getName() + " has no supported techniques.", LML_CRITICAL
+        );
+        return 0;
+    }
+    CompositionTechnique *tech = filter->getSupportedTechnique(technique);
+    CompositorInstance *t = tech->createInstance(this);
+    
+    if(addPosition == LAST)
+        addPosition = mInstances.size();
+    else
+        assert(addPosition <= mInstances.size() && "Index out of bounds.");
+    mInstances.insert(mInstances.begin()+addPosition, t);
+    
+    mDirty = true;
+	mAnyCompositorsEnabled = true;
+    return t;
+}
+//-----------------------------------------------------------------------
+void CompositorChain::removeCompositor(size_t index)
+{
+    assert (index < mInstances.size() && "Index out of bounds.");
+    Instances::iterator i = mInstances.begin() + index;
+    (*i)->getTechnique()->destroyInstance(*i);
+    mInstances.erase(i);
+    
+    mDirty = true;
+}
+//-----------------------------------------------------------------------
+size_t CompositorChain::getNumCompositors()
+{
+    return mInstances.size();
+}
+//-----------------------------------------------------------------------
+void CompositorChain::removeAllCompositors()
+{
+    Instances::iterator i, iend;
+    iend = mInstances.end();
+    for (i = mInstances.begin(); i != iend; ++i)
+    {
+        (*i)->getTechnique()->destroyInstance(*i);
+    }
+    mInstances.clear();
+    
+    mDirty = true;
+}
+//-----------------------------------------------------------------------
+void CompositorChain::_removeInstance(CompositorInstance *i)
+{
+	mInstances.erase(std::find(mInstances.begin(), mInstances.end(), i));
+	i->getTechnique()->destroyInstance(i);
+}
+//-----------------------------------------------------------------------
+void CompositorChain::_queuedOperation(CompositorInstance::RenderSystemOperation* op)
+{
+	mRenderSystemOperations.push_back(op);
+
+}
+//-----------------------------------------------------------------------
+CompositorInstance *CompositorChain::getCompositor(size_t index)
+{
+    assert (index < mInstances.size() && "Index out of bounds.");
+    return mInstances[index];
+}
+
+//-----------------------------------------------------------------------
+CompositorChain::InstanceIterator CompositorChain::getCompositors()
+{
+    return InstanceIterator(mInstances.begin(), mInstances.end());
+}
+//-----------------------------------------------------------------------
+void CompositorChain::setCompositorEnabled(size_t position, bool state)
+{
+    getCompositor(position)->setEnabled(state);
+}
+//-----------------------------------------------------------------------
+void CompositorChain::preRenderTargetUpdate(const RenderTargetEvent& evt)
+{
+	/// Compile if state is dirty
+	if(mDirty)
+		_compile();
+
+	// Do nothing if no compositors enabled
+	if (!mAnyCompositorsEnabled)
+	{
+		return;
+	}
+
+
+	/// Update dependent render targets; this is done in the preRenderTarget 
+	/// and not the preViewportUpdate for a reason: at this time, the
+	/// target Rendertarget will not yet have been set as current. 
+	/// ( RenderSystem::setViewport(...) ) if it would have been, the rendering
+	/// order would be screwed up and problems would arise with copying rendertextures.
+    Camera *cam = mViewport->getCamera();
+    /// Iterate over compiled state
+    CompositorInstance::CompiledState::iterator i;
+    for(i=mCompiledState.begin(); i!=mCompiledState.end(); ++i)
+    {
+		/// Skip if this is a target that should only be initialised initially
+		if(i->onlyInitial && i->hasBeenRendered)
+			continue;
+		i->hasBeenRendered = true;
+		/// Setup and render
+        preTargetOperation(*i, i->target->getViewport(0), cam);
+        i->target->update();
+        postTargetOperation(*i, i->target->getViewport(0), cam);
+    }
+}
+//-----------------------------------------------------------------------
+void CompositorChain::preViewportUpdate(const RenderTargetViewportEvent& evt)
+{
+	// Only set up if there is at least one compositor enabled, and it's this viewport
+    if(evt.source != mViewport || !mAnyCompositorsEnabled)
+        return;
+
+	// set original scene details from viewport
+	CompositionPass* pass = mOriginalScene->getTechnique()->getOutputTargetPass()->getPass(0);
+	CompositionTargetPass* passParent = pass->getParent();
+	if (pass->getClearBuffers() != mViewport->getClearBuffers() ||
+		pass->getClearColour() != mViewport->getBackgroundColour() ||
+		passParent->getVisibilityMask() != mViewport->getVisibilityMask() ||
+		passParent->getMaterialScheme() != mViewport->getMaterialScheme() ||
+		passParent->getShadowsEnabled() != mViewport->getShadowsEnabled())
+	{
+		// recompile if viewport settings are different
+		pass->setClearBuffers(mViewport->getClearBuffers());
+		pass->setClearColour(mViewport->getBackgroundColour());
+		passParent->setVisibilityMask(mViewport->getVisibilityMask());
+		passParent->setMaterialScheme(mViewport->getMaterialScheme());
+		passParent->setShadowsEnabled(mViewport->getShadowsEnabled());
+		_compile();
+	}
+
+	Camera *cam = mViewport->getCamera();
+	/// Prepare for output operation
+	preTargetOperation(mOutputOperation, mViewport, cam);
+}
+//-----------------------------------------------------------------------
+void CompositorChain::preTargetOperation(CompositorInstance::TargetOperation &op, Viewport *vp, Camera *cam)
+{
+    SceneManager *sm = cam->getSceneManager();
+	/// Set up render target listener
+	mOurListener.setOperation(&op, sm, sm->getDestinationRenderSystem());
+	mOurListener.notifyViewport(vp);
+	/// Register it
+	sm->addRenderQueueListener(&mOurListener);
+	/// Set visiblity mask
+	mOldVisibilityMask = sm->getVisibilityMask();
+	sm->setVisibilityMask(op.visibilityMask);
+	/// Set whether we find visibles
+	mOldFindVisibleObjects = sm->getFindVisibleObjects();
+	sm->setFindVisibleObjects(op.findVisibleObjects);
+    /// Set LOD bias level
+    mOldLodBias = cam->getLodBias();
+    cam->setLodBias(cam->getLodBias() * op.lodBias);
+	/// Set material scheme 
+	mOldMaterialScheme = vp->getMaterialScheme();
+	vp->setMaterialScheme(op.materialScheme);
+	/// Set shadows enabled
+	mOldShadowsEnabled = vp->getShadowsEnabled();
+	vp->setShadowsEnabled(op.shadowsEnabled);
+    /// XXX TODO
+    //vp->setClearEveryFrame( true );
+    //vp->setOverlaysEnabled( false );
+    //vp->setBackgroundColour( op.clearColour );
+}
+//-----------------------------------------------------------------------
+void CompositorChain::postTargetOperation(CompositorInstance::TargetOperation &op, Viewport *vp, Camera *cam)
+{
+    SceneManager *sm = cam->getSceneManager();
+	/// Unregister our listener
+	sm->removeRenderQueueListener(&mOurListener);
+	/// Flush remaing operations
+	mOurListener.flushUpTo((uint8)RENDER_QUEUE_COUNT);
+	/// Restore default scene and camera settings
+	sm->setVisibilityMask(mOldVisibilityMask);
+	sm->setFindVisibleObjects(mOldFindVisibleObjects);
+    cam->setLodBias(mOldLodBias);
+	vp->setMaterialScheme(mOldMaterialScheme);
+	vp->setShadowsEnabled(mOldShadowsEnabled);
+}
+//-----------------------------------------------------------------------
+void CompositorChain::postViewportUpdate(const RenderTargetViewportEvent& evt)
+{
+	// Only tidy up if there is at least one compositor enabled, and it's this viewport
+    if(evt.source != mViewport || !mAnyCompositorsEnabled)
+        return;
+
+	postTargetOperation(mOutputOperation, mViewport, mViewport->getCamera());
+}
+//-----------------------------------------------------------------------
+void CompositorChain::viewportRemoved(const RenderTargetViewportEvent& evt)
+{
+	// this chain is now orphaned
+	// can't delete it since held from outside, but release all resources being used
+	destroyResources();
+
+}
+//-----------------------------------------------------------------------
+void CompositorChain::clearCompiledState()
+{
+	for (RenderSystemOperations::iterator i = mRenderSystemOperations.begin();
+		i != mRenderSystemOperations.end(); ++i)
+	{
+		delete *i;
+	}
+	mRenderSystemOperations.clear();
+
+	/// Clear compiled state
+	mCompiledState.clear();
+	mOutputOperation = CompositorInstance::TargetOperation(0);
+
+}
+//-----------------------------------------------------------------------
+void CompositorChain::_compile()
+{
+	clearCompiledState();
+
+	bool compositorsEnabled = false;
+
+    /// Set previous CompositorInstance for each compositor in the list
+    CompositorInstance *lastComposition = mOriginalScene;
+	mOriginalScene->mPreviousInstance = 0;
+	CompositionPass* pass = mOriginalScene->getTechnique()->getOutputTargetPass()->getPass(0);
+	pass->setClearBuffers(mViewport->getClearBuffers());
+	pass->setClearColour(mViewport->getBackgroundColour());
+    for(Instances::iterator i=mInstances.begin(); i!=mInstances.end(); ++i)
+    {
+        if((*i)->getEnabled())
+        {
+			compositorsEnabled = true;
+            (*i)->mPreviousInstance = lastComposition;
+            lastComposition = (*i);
+        }
+    }
+    
+
+    /// Compile misc targets
+    lastComposition->_compileTargetOperations(mCompiledState);
+    
+    /// Final target viewport (0)
+	mOutputOperation.renderSystemOperations.clear();
+    lastComposition->_compileOutputOperation(mOutputOperation);
+
+	// Deal with viewport settings
+	if (compositorsEnabled != mAnyCompositorsEnabled)
+	{
+		mAnyCompositorsEnabled = compositorsEnabled;
+		if (mAnyCompositorsEnabled)
+		{
+			// Save old viewport clearing options
+			mOldClearEveryFrameBuffers = mViewport->getClearBuffers();
+			// Don't clear anything every frame since we have our own clear ops
+			mViewport->setClearEveryFrame(false);
+		}
+		else
+		{
+			// Reset clearing options
+			mViewport->setClearEveryFrame(mOldClearEveryFrameBuffers > 0, 
+				mOldClearEveryFrameBuffers);
+		}
+	}
+    
+    mDirty = false;
+}
+//-----------------------------------------------------------------------
+void CompositorChain::_markDirty()
+{
+    mDirty = true;
+}
+//-----------------------------------------------------------------------
+Viewport *CompositorChain::getViewport()
+{
+    return mViewport;
+}
+//-----------------------------------------------------------------------
+void CompositorChain::RQListener::renderQueueStarted(uint8 id, 
+	const String& invocation, bool& skipThisQueue)
+{
+	// Skip when not matching viewport
+	// shadows update is nested within main viewport update
+	if (mSceneManager->getCurrentViewport() != mViewport)
+		return;
+
+	flushUpTo(id);
+	/// If noone wants to render this queue, skip it
+	/// Don't skip the OVERLAY queue because that's handled seperately
+	if(!mOperation->renderQueues.test(id) && id!=RENDER_QUEUE_OVERLAY)
+	{
+		skipThisQueue = true;
+	}
+}
+//-----------------------------------------------------------------------
+void CompositorChain::RQListener::renderQueueEnded(uint8 id, 
+	const String& invocation, bool& repeatThisQueue)
+{
+}
+//-----------------------------------------------------------------------
+void CompositorChain::RQListener::setOperation(CompositorInstance::TargetOperation *op,SceneManager *sm,RenderSystem *rs)
+{
+	mOperation = op;
+	mSceneManager = sm;
+	mRenderSystem = rs;
+	currentOp = op->renderSystemOperations.begin();
+	lastOp = op->renderSystemOperations.end();
+}
+//-----------------------------------------------------------------------
+void CompositorChain::RQListener::flushUpTo(uint8 id)
+{
+	/// Process all RenderSystemOperations up to and including render queue id.
+    /// Including, because the operations for RenderQueueGroup x should be executed
+	/// at the beginning of the RenderQueueGroup render for x.
+	while(currentOp != lastOp && currentOp->first <= id)
+	{
+		currentOp->second->execute(mSceneManager, mRenderSystem);
+		++currentOp;
+	}
+}
+//-----------------------------------------------------------------------
+}
Index: /OgreMain/src/OgreCompositorInstance.cpp
===================================================================
--- /OgreMain/src/OgreCompositorInstance.cpp	(revision 5)
+++ /OgreMain/src/OgreCompositorInstance.cpp	(revision 5)
@@ -0,0 +1,498 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreCompositorInstance.h"
+#include "OgreCompositorChain.h"
+#include "OgreCompositorManager.h"
+#include "OgreCompositionTargetPass.h"
+#include "OgreCompositionPass.h"
+#include "OgreCompositionTechnique.h"
+#include "OgreTechnique.h"
+#include "OgrePass.h"
+#include "OgreTexture.h"
+#include "OgreLogManager.h"
+#include "OgreMaterialManager.h"
+#include "OgreTextureManager.h"
+#include "OgreSceneManager.h"
+#include "OgreStringConverter.h"
+#include "OgreException.h"
+#include "OgreHardwarePixelBuffer.h"
+#include "OgreCamera.h"
+
+namespace Ogre {
+CompositorInstance::CompositorInstance(Compositor *filter, CompositionTechnique *technique,
+    CompositorChain *chain):
+    mCompositor(filter), mTechnique(technique), mChain(chain),
+		mEnabled(false)
+{
+}
+//-----------------------------------------------------------------------
+CompositorInstance::~CompositorInstance()
+{
+    freeResources();
+}
+//-----------------------------------------------------------------------
+void CompositorInstance::setEnabled(bool value)
+{
+    if (mEnabled != value)
+    {
+        mEnabled = value;
+
+        // Create of free resource.
+        if (value)
+        {
+            createResources();
+        }
+        else
+        {
+            freeResources();
+        }
+
+        /// Notify chain state needs recompile.
+        mChain->_markDirty();
+    }
+}
+//-----------------------------------------------------------------------
+bool CompositorInstance::getEnabled()
+{
+    return mEnabled;
+}
+//-----------------------------------------------------------------------
+
+/** Clear framebuffer RenderSystem operation
+ */
+class RSClearOperation: public CompositorInstance::RenderSystemOperation
+{
+public:
+	RSClearOperation(uint32 buffers, ColourValue colour, Real depth, unsigned short stencil):
+		buffers(buffers), colour(colour), depth(depth), stencil(stencil)
+	{}
+	/// Which buffers to clear (FrameBufferType)
+	uint32 buffers;
+	/// Colour to clear in case FBT_COLOUR is set
+	ColourValue colour;
+	/// Depth to set in case FBT_DEPTH is set
+	Real depth;
+	/// Stencil value to set in case FBT_STENCIL is set
+	unsigned short stencil;
+
+	virtual void execute(SceneManager *sm, RenderSystem *rs)
+	{
+		rs->clearFrameBuffer(buffers, colour, depth, stencil);
+	}
+};
+
+/** "Set stencil state" RenderSystem operation
+ */
+class RSStencilOperation: public CompositorInstance::RenderSystemOperation
+{
+public:
+	RSStencilOperation(bool stencilCheck,CompareFunction func,uint32 refValue,uint32 mask,
+		StencilOperation stencilFailOp,StencilOperation depthFailOp,StencilOperation passOp,
+		bool twoSidedOperation):
+		stencilCheck(stencilCheck),func(func),refValue(refValue),mask(mask),
+		stencilFailOp(stencilFailOp),depthFailOp(depthFailOp),passOp(passOp),
+		twoSidedOperation(twoSidedOperation)
+	{}
+	bool stencilCheck;
+	CompareFunction func; 
+    uint32 refValue;
+	uint32 mask;
+    StencilOperation stencilFailOp;
+    StencilOperation depthFailOp;
+    StencilOperation passOp;
+    bool twoSidedOperation;
+
+	virtual void execute(SceneManager *sm, RenderSystem *rs)
+	{
+		rs->setStencilCheckEnabled(stencilCheck);
+		rs->setStencilBufferParams(func, refValue, mask, stencilFailOp, depthFailOp, passOp, twoSidedOperation);
+	}
+};
+
+/** "Render quad" RenderSystem operation
+ */
+class RSQuadOperation: public CompositorInstance::RenderSystemOperation
+{
+public:
+	RSQuadOperation(CompositorInstance *instance, uint32 pass_id, MaterialPtr mat):
+	  mat(mat),instance(instance), pass_id(pass_id)
+	{
+		mat->load();
+		instance->_fireNotifyMaterialSetup(pass_id, mat);
+		technique = mat->getTechnique(0);
+		assert(technique);
+	}
+	MaterialPtr mat;
+	Technique *technique;
+	CompositorInstance *instance;
+	uint32 pass_id;
+
+	virtual void execute(SceneManager *sm, RenderSystem *rs)
+	{
+		// Fire listener
+		instance->_fireNotifyMaterialRender(pass_id, mat);
+		// Queue passes from mat
+		Technique::PassIterator i = technique->getPassIterator();
+		while(i.hasMoreElements())
+		{
+			sm->_injectRenderWithPass(
+				i.getNext(), 
+				CompositorManager::getSingleton()._getTexturedRectangle2D(),
+				false // don't allow replacement of shadow passes
+				);
+		}
+	}
+};
+
+void CompositorInstance::collectPasses(TargetOperation &finalState, CompositionTargetPass *target)
+{
+	/// Here, passes are converted into render target operations
+    Pass *targetpass;
+    Technique *srctech;
+	MaterialPtr mat, srcmat;
+	
+    CompositionTargetPass::PassIterator it = target->getPassIterator();
+    while(it.hasMoreElements())
+    {
+        CompositionPass *pass = it.getNext();
+        switch(pass->getType())
+        {
+        case CompositionPass::PT_CLEAR:
+			queueRenderSystemOp(finalState, new RSClearOperation(
+				pass->getClearBuffers(),
+				pass->getClearColour(),
+				pass->getClearDepth(),
+				pass->getClearStencil()
+				));
+            break;
+		case CompositionPass::PT_STENCIL:
+			queueRenderSystemOp(finalState, new RSStencilOperation(
+				pass->getStencilCheck(),pass->getStencilFunc(), pass->getStencilRefValue(),
+				pass->getStencilMask(), pass->getStencilFailOp(), pass->getStencilDepthFailOp(),
+				pass->getStencilPassOp(), pass->getStencilTwoSidedOperation()
+				));
+            break;
+        case CompositionPass::PT_RENDERSCENE:
+			if(pass->getFirstRenderQueue() < finalState.currentQueueGroupID)
+			{
+				/// Mismatch -- warn user
+				/// XXX We could support repeating the last queue, with some effort
+				LogManager::getSingleton().logMessage("Warning in compilation of Compositor "
+					+mCompositor->getName()+": Attempt to render queue "+
+					StringConverter::toString(pass->getFirstRenderQueue())+" before "+
+					StringConverter::toString(finalState.currentQueueGroupID));
+			}
+			/// Add render queues
+			for(int x=pass->getFirstRenderQueue(); x<=pass->getLastRenderQueue(); ++x)
+			{
+				assert(x>=0);
+				finalState.renderQueues.set(x);
+			}
+			finalState.currentQueueGroupID = pass->getLastRenderQueue()+1;
+			finalState.findVisibleObjects = true;
+			finalState.materialScheme = target->getMaterialScheme();
+			finalState.shadowsEnabled = target->getShadowsEnabled();
+
+            break;
+        case CompositionPass::PT_RENDERQUAD:
+            srcmat = pass->getMaterial();
+			if(srcmat.isNull())
+            {
+                /// No material -- warn user
+				LogManager::getSingleton().logMessage("Warning in compilation of Compositor "
+					+mCompositor->getName()+": No material defined for composition pass");
+                break;
+            }
+			srcmat->load();
+			if(srcmat->getNumSupportedTechniques()==0)  
+			{
+				/// No supported techniques -- warn user
+				LogManager::getSingleton().logMessage("Warning in compilation of Compositor "
+					+mCompositor->getName()+": material "+srcmat->getName()+" has no supported techniques");
+                break;
+			}
+			srctech = srcmat->getBestTechnique(0);
+			/// Create local material
+			MaterialPtr mat = createLocalMaterial();
+			/// Copy and adapt passes from source material
+			Technique::PassIterator i = srctech->getPassIterator();
+			while(i.hasMoreElements())
+			{
+				Pass *srcpass = i.getNext();
+				/// Create new target pass
+				targetpass = mat->getTechnique(0)->createPass();
+				(*targetpass) = (*srcpass);
+				/// Set up inputs
+				for(size_t x=0; x<pass->getNumInputs(); ++x)
+				{
+					String inp = pass->getInput(x);
+					if(!inp.empty())
+					{
+						if(x < targetpass->getNumTextureUnitStates())
+						{
+							targetpass->getTextureUnitState((ushort)x)->setTextureName(getSourceForTex(inp));
+						} 
+						else
+						{
+							/// Texture unit not there
+							LogManager::getSingleton().logMessage("Warning in compilation of Compositor "
+								+mCompositor->getName()+": material "+srcmat->getName()+" texture unit "
+								+StringConverter::toString(x)+" out of bounds");
+						}
+					}
+				}
+			}
+			queueRenderSystemOp(finalState, new RSQuadOperation(this,pass->getIdentifier(),mat));
+            break;
+        }
+    }
+}
+//-----------------------------------------------------------------------
+void CompositorInstance::_compileTargetOperations(CompiledState &compiledState)
+{
+    /// Collect targets of previous state
+	if(mPreviousInstance)
+	    mPreviousInstance->_compileTargetOperations(compiledState);
+    /// Texture targets
+    CompositionTechnique::TargetPassIterator it = mTechnique->getTargetPassIterator();
+    while(it.hasMoreElements())
+    {
+        CompositionTargetPass *target = it.getNext();
+        
+        TargetOperation ts(getTargetForTex(target->getOutputName()));
+        /// Set "only initial" flag, visibilityMask and lodBias according to CompositionTargetPass.
+        ts.onlyInitial = target->getOnlyInitial();
+        ts.visibilityMask = target->getVisibilityMask();
+        ts.lodBias = target->getLodBias();
+		ts.shadowsEnabled = target->getShadowsEnabled();
+        /// Check for input mode previous
+        if(target->getInputMode() == CompositionTargetPass::IM_PREVIOUS)
+        {
+            /// Collect target state for previous compositor
+            /// The TargetOperation for the final target is collected seperately as it is merged
+            /// with later operations
+            mPreviousInstance->_compileOutputOperation(ts);
+        }
+        /// Collect passes of our own target
+        collectPasses(ts, target);
+        compiledState.push_back(ts);
+    }
+}
+//-----------------------------------------------------------------------
+void CompositorInstance::_compileOutputOperation(TargetOperation &finalState)
+{
+    /// Final target
+    CompositionTargetPass *tpass = mTechnique->getOutputTargetPass();
+    
+    /// Logical-and together the visibilityMask, and multiply the lodBias
+    finalState.visibilityMask &= tpass->getVisibilityMask();
+    finalState.lodBias *= tpass->getLodBias();
+    
+    if(tpass->getInputMode() == CompositionTargetPass::IM_PREVIOUS)
+    {
+        /// Collect target state for previous compositor
+        /// The TargetOperation for the final target is collected seperately as it is merged
+        /// with later operations
+        mPreviousInstance->_compileOutputOperation(finalState);
+    }
+    /// Collect passes
+    collectPasses(finalState, tpass);
+}
+//-----------------------------------------------------------------------
+Compositor *CompositorInstance::getCompositor()
+{
+    return mCompositor;
+}
+//-----------------------------------------------------------------------
+CompositionTechnique *CompositorInstance::getTechnique()
+{
+    return mTechnique;
+}
+//-----------------------------------------------------------------------
+CompositorChain *CompositorInstance::getChain()
+{
+	return mChain;
+}
+//-----------------------------------------------------------------------
+const String& CompositorInstance::getTextureInstanceName(const String& name)
+{
+	return getSourceForTex(name);
+}
+//-----------------------------------------------------------------------
+MaterialPtr CompositorInstance::createLocalMaterial()
+{
+static size_t dummyCounter = 0;
+    MaterialPtr mat = 
+        MaterialManager::getSingleton().create(
+            "CompositorInstanceMaterial"+StringConverter::toString(dummyCounter),
+            ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME
+        );
+    ++dummyCounter;
+    /// This is safe, as we hold a private reference
+    /// XXX does not compile due to ResourcePtr conversion :
+    ///     MaterialManager::getSingleton().remove(mat);
+    MaterialManager::getSingleton().remove(mat->getName());
+    /// Remove all passes from first technique
+    mat->getTechnique(0)->removeAllPasses();
+    return mat;
+}
+//-----------------------------------------------------------------------
+void CompositorInstance::createResources()
+{
+static size_t dummyCounter = 0;
+    freeResources();
+    /// Create temporary textures
+    /// In principle, temporary textures could be shared between multiple viewports
+    /// (CompositorChains). This will save a lot of memory in case more viewports
+    /// are composited.
+    CompositionTechnique::TextureDefinitionIterator it = mTechnique->getTextureDefinitionIterator();
+    while(it.hasMoreElements())
+    {
+        CompositionTechnique::TextureDefinition *def = it.getNext();
+        /// Determine width and height
+        size_t width = def->width;
+        size_t height = def->height;
+        if(width == 0)
+            width = mChain->getViewport()->getActualWidth();
+        if(height == 0)
+            height = mChain->getViewport()->getActualHeight();
+        /// Make the tetxure
+        TexturePtr tex = TextureManager::getSingleton().createManual(
+            "CompositorInstanceTexture"+StringConverter::toString(dummyCounter), 
+            ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME, TEX_TYPE_2D, 
+            (uint)width, (uint)height, 0, def->format, TU_RENDERTARGET );    
+        ++dummyCounter;
+        mLocalTextures[def->name] = tex;
+        
+        /// Set up viewport over entire texture
+        RenderTexture *rtt = tex->getBuffer()->getRenderTarget();
+        rtt->setAutoUpdated( false );
+
+        Camera* camera = mChain->getViewport()->getCamera();
+
+        // Save last viewport and current aspect ratio
+        Viewport* oldViewport = camera->getViewport();
+        Real aspectRatio = camera->getAspectRatio();
+
+        Viewport* v = rtt->addViewport( camera );
+        v->setClearEveryFrame( false );
+        v->setOverlaysEnabled( false );
+        v->setBackgroundColour( ColourValue( 0, 0, 0, 0 ) );
+
+        // Should restore aspect ratio, in case of auto aspect ratio
+        // enabled, it'll changed when add new viewport.
+        camera->setAspectRatio(aspectRatio);
+        // Should restore last viewport, i.e. never disturb user code
+        // which might based on that.
+        camera->_notifyViewport(oldViewport);
+    }
+    
+}
+//-----------------------------------------------------------------------
+void CompositorInstance::freeResources()
+{
+    /// Remove temporary textures
+    /// LocalTextureMap mLocalTextures;
+    LocalTextureMap::iterator i, iend=mLocalTextures.end();
+    for(i=mLocalTextures.begin(); i!=iend; ++i)
+    {
+        TextureManager::getSingleton().remove(i->second->getName());
+    }
+    mLocalTextures.clear();
+}
+//-----------------------------------------------------------------------
+RenderTarget *CompositorInstance::getTargetForTex(const String &name)
+{
+    LocalTextureMap::iterator i = mLocalTextures.find(name);
+    if(i == mLocalTextures.end())
+    {
+        OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Non-existent local texture name", "CompositorInstance::getTargetForTex");
+    }
+    return i->second->getBuffer()->getRenderTarget();
+}
+//-----------------------------------------------------------------------
+const String &CompositorInstance::getSourceForTex(const String &name)
+{
+    LocalTextureMap::iterator i = mLocalTextures.find(name);
+    if(i == mLocalTextures.end())
+    {
+        OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Non-existent local texture name", "CompositorInstance::getSourceForTex");
+    }
+    return i->second->getName();
+}
+//-----------------------------------------------------------------------
+void CompositorInstance::queueRenderSystemOp(TargetOperation &finalState, RenderSystemOperation *op)
+{
+	/// Store operation for current QueueGroup ID
+	finalState.renderSystemOperations.push_back(RenderSystemOpPair(finalState.currentQueueGroupID, op));
+	/// Tell parent for deletion
+	mChain->_queuedOperation(op);
+}
+//-----------------------------------------------------------------------
+void CompositorInstance::addListener(Listener *l)
+{
+	mListeners.push_back(l);
+}
+//-----------------------------------------------------------------------
+void CompositorInstance::removeListener(Listener *l)
+{
+	mListeners.erase(std::find(mListeners.begin(), mListeners.end(), l));
+}
+//-----------------------------------------------------------------------
+void CompositorInstance::_fireNotifyMaterialSetup(uint32 pass_id, MaterialPtr &mat)
+{
+	Listeners::iterator i, iend=mListeners.end();
+	for(i=mListeners.begin(); i!=iend; ++i)
+		(*i)->notifyMaterialSetup(pass_id, mat);
+}
+//-----------------------------------------------------------------------
+void CompositorInstance::_fireNotifyMaterialRender(uint32 pass_id, MaterialPtr &mat)
+{
+	Listeners::iterator i, iend=mListeners.end();
+	for(i=mListeners.begin(); i!=iend; ++i)
+		(*i)->notifyMaterialRender(pass_id, mat);
+}
+//-----------------------------------------------------------------------
+CompositorInstance::RenderSystemOperation::~RenderSystemOperation()
+{
+}
+//-----------------------------------------------------------------------
+CompositorInstance::Listener::~Listener()
+{
+}
+void CompositorInstance::Listener::notifyMaterialSetup(uint32 pass_id, MaterialPtr &mat)
+{
+}
+void CompositorInstance::Listener::notifyMaterialRender(uint32 pass_id, MaterialPtr &mat)
+{
+}
+//-----------------------------------------------------------------------
+
+}
Index: /OgreMain/src/OgreCompositorManager.cpp
===================================================================
--- /OgreMain/src/OgreCompositorManager.cpp	(revision 5)
+++ /OgreMain/src/OgreCompositorManager.cpp	(revision 5)
@@ -0,0 +1,247 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreCompositorManager.h"
+#include "OgreCompositor.h"
+#include "OgreCompositorChain.h"
+#include "OgreCompositionPass.h"
+#include "OgreCompositionTargetPass.h"
+#include "OgreCompositionTechnique.h"
+#include "OgreRoot.h"
+
+namespace Ogre {
+
+template<> CompositorManager* Singleton<CompositorManager>::ms_Singleton = 0;
+CompositorManager* CompositorManager::getSingletonPtr(void)
+{
+	return ms_Singleton;
+}
+CompositorManager& CompositorManager::getSingleton(void)
+{  
+	assert( ms_Singleton );  return ( *ms_Singleton );  
+}//-----------------------------------------------------------------------
+CompositorManager::CompositorManager():
+	mRectangle(0)
+{
+	initialise();
+
+	// Loading order (just after materials)
+	mLoadOrder = 110.0f;
+	// Scripting is supported by this manager
+	mScriptPatterns.push_back("*.compositor");
+	ResourceGroupManager::getSingleton()._registerScriptLoader(this);
+
+	// Resource type
+	mResourceType = "Compositor";
+
+	// Create default thread serializer instance (also non-threaded)
+	OGRE_THREAD_POINTER_SET(mSerializer, new CompositorSerializer());
+
+	// Register with resource group manager
+	ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
+
+}
+//-----------------------------------------------------------------------
+CompositorManager::~CompositorManager()
+{
+    freeChains();
+	delete mRectangle;
+
+	OGRE_THREAD_POINTER_DELETE(mSerializer);
+
+	// Resources cleared by superclass
+	// Unregister with resource group manager
+	ResourceGroupManager::getSingleton()._unregisterResourceManager(mResourceType);
+	ResourceGroupManager::getSingleton()._unregisterScriptLoader(this);
+}
+//-----------------------------------------------------------------------
+Resource* CompositorManager::createImpl(const String& name, ResourceHandle handle,
+    const String& group, bool isManual, ManualResourceLoader* loader,
+    const NameValuePairList* params)
+{
+    return new Compositor(this, name, handle, group, isManual, loader);
+}
+//-----------------------------------------------------------------------
+void CompositorManager::initialise(void)
+{
+    /// Create "default" compositor
+    /** Compositor that is used to implicitly represent the original
+        render in the chain. This is an identity compositor with only an output pass:
+    compositor Ogre/Scene
+    {
+        technique
+        {
+            target_output
+            {
+				pass clear
+				{
+					/// Clear frame
+				}
+                pass render_scene
+                {
+					visibility_mask FFFFFFFF
+					render_queues SKIES_EARLY SKIES_LATE
+                }
+            }
+        }
+    };
+    */
+    CompositorPtr scene = create("Ogre/Scene", ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME);
+    CompositionTechnique *t = scene->createTechnique();
+    CompositionTargetPass *tp = t->getOutputTargetPass();
+    tp->setVisibilityMask(0xFFFFFFFF);
+	{
+		CompositionPass *pass = tp->createPass();
+		pass->setType(CompositionPass::PT_CLEAR);
+	}
+	{
+		CompositionPass *pass = tp->createPass();
+		pass->setType(CompositionPass::PT_RENDERSCENE);
+		/// Render everything, including skies
+		pass->setFirstRenderQueue(RENDER_QUEUE_SKIES_EARLY);
+		pass->setLastRenderQueue(RENDER_QUEUE_SKIES_LATE);
+	}
+
+}
+//-----------------------------------------------------------------------
+void CompositorManager::parseScript(DataStreamPtr& stream, const String& groupName)
+{
+#if OGRE_THREAD_SUPPORT
+	// check we have an instance for this thread 
+	if (!mSerializer.get())
+	{
+		// create a new instance for this thread - will get deleted when
+		// the thread dies
+		mSerializer.reset(new CompositorSerializer());
+	}
+#endif
+    mSerializer->parseScript(stream, groupName);
+}
+//-----------------------------------------------------------------------
+CompositorChain *CompositorManager::getCompositorChain(Viewport *vp)
+{
+    Chains::iterator i=mChains.find(vp);
+    if(i != mChains.end())
+    {
+        return i->second;
+    }
+    else
+    {
+        CompositorChain *chain = new CompositorChain(vp);
+        mChains[vp] = chain;
+        return chain;
+    }
+}
+//-----------------------------------------------------------------------
+bool CompositorManager::hasCompositorChain(Viewport *vp) const
+{
+    return mChains.find(vp) != mChains.end();
+}
+//-----------------------------------------------------------------------
+void CompositorManager::removeCompositorChain(Viewport *vp)
+{
+    Chains::iterator i = mChains.find(vp);
+    if (i != mChains.end())
+    {
+        delete i->second;
+        mChains.erase(i);
+    }
+}
+//-----------------------------------------------------------------------
+void CompositorManager::removeAll(void)
+{
+	freeChains();
+	ResourceManager::removeAll();
+}
+//-----------------------------------------------------------------------
+void CompositorManager::freeChains()
+{
+    Chains::iterator i, iend=mChains.end();
+    for(i=mChains.begin(); i!=iend;++i)
+    {
+        delete i->second;
+    }
+    mChains.clear();
+}
+//-----------------------------------------------------------------------
+Renderable *CompositorManager::_getTexturedRectangle2D()
+{
+	if(!mRectangle)
+	{
+		/// 2D rectangle, to use for render_quad passes
+		mRectangle = new Rectangle2D(true);
+	}
+	RenderSystem* rs = Root::getSingleton().getRenderSystem();
+	Viewport* vp = rs->_getViewport();
+	Real hOffset = rs->getHorizontalTexelOffset() / (0.5 * vp->getActualWidth());
+	Real vOffset = rs->getVerticalTexelOffset() / (0.5 * vp->getActualHeight());
+	mRectangle->setCorners(-1 + hOffset, 1 - vOffset, 1 + hOffset, -1 - vOffset);
+	return mRectangle;
+}
+//-----------------------------------------------------------------------
+CompositorInstance *CompositorManager::addCompositor(Viewport *vp, const String &compositor, int addPosition)
+{
+	CompositorPtr comp = getByName(compositor);
+	if(comp.isNull())
+		return 0;
+	CompositorChain *chain = getCompositorChain(vp);
+	return chain->addCompositor(comp, addPosition==-1 ? CompositorChain::LAST : (size_t)addPosition);
+}
+//-----------------------------------------------------------------------
+void CompositorManager::removeCompositor(Viewport *vp, const String &compositor)
+{
+	CompositorChain *chain = getCompositorChain(vp);
+	CompositorChain::InstanceIterator it = chain->getCompositors();
+	for(size_t pos=0; pos < chain->getNumCompositors(); ++pos)
+	{
+		CompositorInstance *instance = chain->getCompositor(pos);
+		if(instance->getCompositor()->getName() == compositor)
+		{
+			chain->removeCompositor(pos);
+			break;
+		}
+	}
+}
+//-----------------------------------------------------------------------
+void CompositorManager::setCompositorEnabled(Viewport *vp, const String &compositor, bool value)
+{
+	CompositorChain *chain = getCompositorChain(vp);
+	CompositorChain::InstanceIterator it = chain->getCompositors();
+	for(size_t pos=0; pos < chain->getNumCompositors(); ++pos)
+	{
+		CompositorInstance *instance = chain->getCompositor(pos);
+		if(instance->getCompositor()->getName() == compositor)
+		{
+			chain->setCompositorEnabled(pos, value);
+			break;
+		}
+	}
+}
+
+}
Index: /OgreMain/src/OgreCompositorScriptCompiler.cpp
===================================================================
--- /OgreMain/src/OgreCompositorScriptCompiler.cpp	(revision 5)
+++ /OgreMain/src/OgreCompositorScriptCompiler.cpp	(revision 5)
@@ -0,0 +1,727 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreCompositorScriptCompiler.h"
+#include "OgreCommon.h"
+#include "OgreStringConverter.h"
+#include "OgreLogManager.h"
+#include "OgreException.h"
+#include "OgreCompositorManager.h"
+#include "OgreCompositionTechnique.h"
+#include "OgreCompositionTargetPass.h"
+#include "OgreCompositionPass.h"
+
+namespace Ogre {
+
+	//-----------------------------------------------------------------------
+    // Static definitions
+    //-----------------------------------------------------------------------
+    CompositorScriptCompiler::TokenActionMap CompositorScriptCompiler::mTokenActionMap;
+
+    const String& CompositorScriptCompiler::getClientBNFGrammer(void) const
+    {
+		// simplified Backus - Naur Form (BNF) grammer for compositor scripts
+	    static const String compositorScript_BNF =
+		// Top level rule
+		"<Script> ::= {<Compositor>} \n"
+		"<Compositor> ::= 'compositor' <Flex_Label> '{' {<Technique>} '}' \n"
+		// Technique
+		"<Technique> ::= 'technique' '{' {<Texture>} {<Target>} <TargetOutput> '}' \n"
+		"<Texture> ::= 'texture' <Label> <WidthOption> <HeightOption> <PixelFormat> \n"
+		"<WidthOption> ::= 'target_width' | <#width> \n"
+		"<HeightOption> ::= 'target_height' | <#height> \n"
+		"<PixelFormat> ::= 'PF_A8R8G8B8' | 'PF_R8G8B8A8' | 'PF_R8G8B8' | 'PF_FLOAT16_RGBA' | \n"
+        "   'PF_FLOAT16_RGB' | 'PF_FLOAT16_R' | 'PF_FLOAT32_RGBA' | 'PF_FLOAT32_RGB' | 'PF_FLOAT32_R' | \n"
+		"   'PF_FLOAT16_GR' | 'PF_FLOAT32_GR' \n"
+		// Target
+		"<Target> ::= 'target ' <Label> '{' {<TargetOptions>} {<Pass>} '}' \n"
+	    "<TargetOptions> ::=	<TargetInput> | <OnlyInitial> | <VisibilityMask> | \n"
+	    "   <LodBias> | <MaterialScheme> \n"
+		"<TargetInput> ::= 'input' <TargetInputOptions> \n"
+		"<TargetInputOptions> ::= 'none' | 'previous' \n"
+		"<OnlyInitial> ::= 'only_initial' <On_Off> \n"
+		"<VisibilityMask> ::= 'visibility_mask' <#mask> \n"
+		"<LodBias> ::= 'lod_bias' <#lodbias> \n"
+		"<MaterialScheme> ::= 'material_scheme' <Label> \n"
+		"<TargetOutput> ::= 'target_output' '{' [<TargetInput>] {<Pass>} '}' \n"
+		// Pass
+		"<Pass> ::= 'pass' <PassTypes> '{' {<PassOptions>} '}' \n"
+		"<PassTypes> ::= 'render_quad' | 'clear' | 'stencil' | 'render_scene' \n"
+		"<PassOptions> ::= <PassFirstRenderQueue> | <PassLastRenderQueue> | \n"
+		"    <PassIdentifier> | <PassMaterial> | <PassInput> | <ClearSection> | <StencilSection> \n"
+		"<PassMaterial> ::= 'material' <Label> \n"
+		"<PassInput> ::= 'input' <#id> <Label> \n"
+		"<PassFirstRenderQueue> ::= 'first_render_queue' <#queue> \n"
+		"<PassLastRenderQueue> ::= 'last_render_queue' <#queue> \n"
+		"<PassIdentifier> ::= 'identifier' <#id> \n"
+		// clear
+		"<ClearSection> ::= -'clear' -'{' {<ClearOptions>} -'}' \n"
+		"<ClearOptions> ::= <Buffers> | <ColourValue> | <DepthValue> | <StencilValue> \n"
+		"<Buffers> ::= 'buffers' {<BufferTypes>} \n"
+		"<BufferTypes> ::= <Colour> | <Depth> | <Stencil> \n"
+		"<Colour> ::= 'colour' (?!<ValueChk>) \n"
+		"<Depth> ::= 'depth' (?!<ValueChk>) \n"
+		"<Stencil> ::= 'stencil' (?!<ValueChk>) \n"
+		"<ValueChk> ::= '_value' \n"
+		"<ColourValue> ::= 'colour_value' <#red> <#green> <#blue> <#alpha> \n"
+		"<DepthValue> ::= 'depth_value' <#depth> \n"
+		"<StencilValue> ::= 'stencil_value' <#val> \n"
+		// stencil
+		"<StencilSection> ::= -'stencil' -'{' {<StencilOptions>} -'}' \n"
+		"<StencilOptions> ::=  <Check> | <CompareFunction> | <RefVal> | <Mask> | <FailOp> | <DepthFailOp> | \n"
+		"   <PassOp> | <TwoSided> \n"
+		"<Check> ::= 'check' <On_Off> \n"
+		"<CompareFunction> ::= 'comp_func' <CompFunc> \n"
+		"<CompFunc> ::= 'always_fail' | 'always_pass' | 'less_equal' | 'less' | 'equal' | \n"
+		"   'not_equal' | 'equal' | 'greater_equal' | 'greater' \n"
+        "<RefVal> ::= 'ref_value' <#val> \n"
+        "<Mask> ::= 'mask' <#mask> \n"
+        "<FailOp> ::= 'fail_op' <StencilOperation> \n"
+        "<DepthFailOp> ::= 'depth_fail_op' <StencilOperation> \n"
+        "<PassOp> ::= 'pass_op' <StencilOperation> \n"
+        "<TwoSided> ::= 'two_sided' <On_Off> \n"
+		"<StencilOperation> ::= 'keep' | 'zero' | 'replace' | 'increment_wrap' | 'increment' | \n"
+		"   'decrement_wrap' | 'decrement' | 'invert' \n"
+
+		// common rules
+		"<On_Off> ::= 'on' | 'off' \n"
+		"<Label> ::= <Quoted_Label> | <Unquoted_Label> \n"
+		"<Flex_Label> ::= <Quoted_Label> | <Spaced_Label> \n"
+		"<Quoted_Label> ::= -'\"' <Spaced_Label> -'\"' \n"
+		"<Spaced_Label> ::= <Spaced_Label_Illegals> {<Spaced_Label_Illegals>} \n"
+        "<Unquoted_Label> ::= <Unquoted_Label_Illegals> {<Unquoted_Label_Illegals>} \n"
+		"<Spaced_Label_Illegals> ::= (!,\n\r\t{}\") \n"
+		"<Unquoted_Label_Illegals> ::= (! \n\r\t{}\") \n"
+
+		;
+
+        return compositorScript_BNF;
+    }
+	//-----------------------------------------------------------------------
+    const String& CompositorScriptCompiler::getClientGrammerName(void) const
+    {
+        static const String grammerName = "Compositor Script";
+        return grammerName;
+    }
+	//-----------------------------------------------------------------------
+	CompositorScriptCompiler::CompositorScriptCompiler(void)
+	{
+        // set default group resource name
+        mScriptContext.groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME;
+	}
+	//-----------------------------------------------------------------------
+	CompositorScriptCompiler::~CompositorScriptCompiler(void)
+	{
+
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::setupTokenDefinitions(void)
+	{
+		addLexemeAction("{", &CompositorScriptCompiler::parseOpenBrace);
+		addLexemeAction("}", &CompositorScriptCompiler::parseCloseBrace);
+		addLexemeAction("compositor", &CompositorScriptCompiler::parseCompositor);
+
+		// Technique section
+		addLexemeAction("technique", &CompositorScriptCompiler::parseTechnique);
+		addLexemeAction("texture", &CompositorScriptCompiler::parseTexture);
+		addLexemeToken("target_width", ID_TARGET_WIDTH);
+		addLexemeToken("target_height", ID_TARGET_HEIGHT);
+		addLexemeToken("PF_A8R8G8B8", ID_PF_A8R8G8B8);
+		addLexemeToken("PF_R8G8B8A8", ID_PF_R8G8B8A8);
+		addLexemeToken("PF_R8G8B8", ID_PF_R8G8B8);
+		addLexemeToken("PF_FLOAT16_R", ID_PF_FLOAT16_R);
+		addLexemeToken("PF_FLOAT16_GR", ID_PF_FLOAT16_GR);
+		addLexemeToken("PF_FLOAT16_RGB", ID_PF_FLOAT16_RGB);
+		addLexemeToken("PF_FLOAT16_RGBA", ID_PF_FLOAT16_RGBA);
+		addLexemeToken("PF_FLOAT32_R", ID_PF_FLOAT32_R);
+		addLexemeToken("PF_FLOAT32_GR", ID_PF_FLOAT32_GR);
+		addLexemeToken("PF_FLOAT32_RGB", ID_PF_FLOAT32_RGB);
+		addLexemeToken("PF_FLOAT32_RGBA", ID_PF_FLOAT32_RGBA);
+
+		// Target section
+		addLexemeAction("target ", &CompositorScriptCompiler::parseTarget);
+		addLexemeAction("input", &CompositorScriptCompiler::parseInput);
+		addLexemeToken("none", ID_NONE);
+		addLexemeToken("previous", ID_PREVIOUS);
+		addLexemeAction("target_output", &CompositorScriptCompiler::parseTargetOutput);
+		addLexemeAction("only_initial", &CompositorScriptCompiler::parseOnlyInitial);
+		addLexemeAction("visibility_mask", &CompositorScriptCompiler::parseVisibilityMask);
+		addLexemeAction("lod_bias", &CompositorScriptCompiler::parseLodBias);
+		addLexemeAction("material_scheme", &CompositorScriptCompiler::parseMaterialScheme);
+
+		// pass section
+		addLexemeAction("pass", &CompositorScriptCompiler::parsePass);
+		// input defined above
+		addLexemeToken("render_quad", ID_RENDER_QUAD);
+		addLexemeToken("clear", ID_CLEAR);
+		addLexemeToken("stencil", ID_STENCIL);
+		addLexemeToken("render_scene", ID_RENDER_SCENE);
+		// pass attributes
+		addLexemeAction("material", &CompositorScriptCompiler::parseMaterial);
+		addLexemeAction("first_render_queue", &CompositorScriptCompiler::parseFirstRenderQueue);
+		addLexemeAction("last_render_queue", &CompositorScriptCompiler::parseLastRenderQueue);
+		addLexemeAction("identifier", &CompositorScriptCompiler::parseIdentifier);
+		// clear
+		addLexemeAction("buffers", &CompositorScriptCompiler::parseClearBuffers);
+		addLexemeToken("colour", ID_CLR_COLOUR);
+		addLexemeToken("depth", ID_CLR_DEPTH);
+		addLexemeAction("colour_value", &CompositorScriptCompiler::parseClearColourValue);
+		addLexemeAction("depth_value", &CompositorScriptCompiler::parseClearDepthValue);
+		addLexemeAction("stencil_value", &CompositorScriptCompiler::parseClearStencilValue);
+		// stencil
+		addLexemeAction("check", &CompositorScriptCompiler::parseStencilCheck);
+		addLexemeAction("comp_func", &CompositorScriptCompiler::parseStencilFunc);
+		addLexemeAction("ref_value", &CompositorScriptCompiler::parseStencilRefVal);
+		addLexemeAction("mask", &CompositorScriptCompiler::parseStencilMask);
+		addLexemeAction("fail_op", &CompositorScriptCompiler::parseStencilFailOp);
+		addLexemeAction("depth_fail_op", &CompositorScriptCompiler::parseStencilDepthFailOp);
+		addLexemeAction("pass_op", &CompositorScriptCompiler::parseStencilPassOp);
+		addLexemeAction("two_sided", &CompositorScriptCompiler::parseStencilTwoSided);
+		// compare functions
+		addLexemeToken("always_fail", ID_ST_ALWAYS_FAIL);
+		addLexemeToken("always_pass", ID_ST_ALWAYS_PASS);
+		addLexemeToken("less", ID_ST_LESS);
+		addLexemeToken("less_equal", ID_ST_LESS_EQUAL);
+		addLexemeToken("equal", ID_ST_EQUAL);
+		addLexemeToken("not_equal", ID_ST_NOT_EQUAL);
+		addLexemeToken("greater_equal", ID_ST_GREATER_EQUAL);
+		addLexemeToken("greater", ID_ST_GREATER);
+		// stencil operations
+		addLexemeToken("keep", ID_ST_KEEP);
+		addLexemeToken("zero", ID_ST_ZERO);
+		addLexemeToken("replace", ID_ST_REPLACE);
+		addLexemeToken("increment", ID_ST_INCREMENT);
+		addLexemeToken("decrement", ID_ST_DECREMENT);
+		addLexemeToken("increment_wrap", ID_ST_INCREMENT_WRAP);
+		addLexemeToken("decrement_wrap", ID_ST_DECREMENT_WRAP);
+		addLexemeToken("invert", ID_ST_INVERT);
+
+		// common section
+		addLexemeToken("on", ID_ON);
+		addLexemeToken("off", ID_OFF);
+
+	}
+
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::addLexemeTokenAction(const String& lexeme,
+		const size_t token, const CSC_Action action)
+	{
+		size_t newtokenID = addLexemeToken(lexeme, token, action != 0);
+        // only add actions to the map if they exist
+        if (action)
+		    mTokenActionMap[newtokenID] = action;
+	}
+
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::executeTokenAction(const size_t tokenID)
+	{
+		TokenActionIterator action = mTokenActionMap.find(tokenID);
+
+		if (action == mTokenActionMap.end())
+		{
+			// BAD command. BAD!
+			logParseError("Unrecognised compositor script command action");
+			return;
+		}
+		else
+		{
+			try
+			{
+				(this->*action->second)();
+			}
+			catch (Exception& ogreException)
+			{
+				// an unknown token found or BNF Grammer rule was not successful
+				// in finding a valid terminal token to complete the rule expression.
+				logParseError(ogreException.getDescription());
+			}
+		}
+	}
+
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::logParseError(const String& error)
+	{
+		// log material name only if filename not specified
+		if (mSourceName.empty() && !mScriptContext.compositor.isNull())
+		{
+			LogManager::getSingleton().logMessage(
+				"Error in compositor " + mScriptContext.compositor->getName() +
+				" : " + error);
+		}
+		else
+		{
+			if (!mScriptContext.compositor.isNull())
+			{
+				LogManager::getSingleton().logMessage(
+					"Error in compositor " + mScriptContext.compositor->getName() +
+					" at line " + StringConverter::toString(mCurrentLine) +
+					" of " + mSourceName + ": " + error);
+			}
+			else
+			{
+				LogManager::getSingleton().logMessage(
+					"Error at line " + StringConverter::toString(mCurrentLine) +
+					" of " + mSourceName + ": " + error);
+			}
+		}
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::parseOpenBrace(void)
+	{
+
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::parseCloseBrace(void)
+	{
+		switch(mScriptContext.section)
+		{
+		case CSS_NONE:
+			logParseError("Unexpected terminating brace.");
+			break;
+		case CSS_COMPOSITOR:
+			// End of compositor
+			mScriptContext.section = CSS_NONE;
+			mScriptContext.compositor.setNull();
+			break;
+		case CSS_TECHNIQUE:
+			// End of technique
+			mScriptContext.section = CSS_COMPOSITOR;
+			mScriptContext.technique = NULL;
+			break;
+		case CSS_TARGET:
+			// End of target
+			mScriptContext.section = CSS_TECHNIQUE;
+			mScriptContext.target = NULL;
+			break;
+		case CSS_PASS:
+			// End of pass
+			mScriptContext.section = CSS_TARGET;
+			mScriptContext.pass = NULL;
+			break;
+		};
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::parseCompositor(void)
+	{
+		const String compositorName = getNextTokenLabel();
+		mScriptContext.compositor = CompositorManager::getSingleton().create(
+            compositorName, mScriptContext.groupName
+			);
+		mScriptContext.section = CSS_COMPOSITOR;
+
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::parseTechnique(void)
+	{
+		mScriptContext.technique = mScriptContext.compositor->createTechnique();
+		mScriptContext.section = CSS_TECHNIQUE;
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::parseTexture(void)
+	{
+	    assert(mScriptContext.technique);
+		const String textureName = getNextTokenLabel();
+        CompositionTechnique::TextureDefinition* textureDef = mScriptContext.technique->createTextureDefinition(textureName);
+        // if peek next token is target_width then get token and use 0 for width
+        // determine width parameter
+        if (testNextTokenID(ID_TARGET_WIDTH))
+        {
+            getNextToken();
+            // a value of zero causes texture to be size of render target
+            textureDef->width = 0;
+        }
+        else
+        {
+            textureDef->width = static_cast<size_t>(getNextTokenValue());
+        }
+        // determine height parameter
+        if (testNextTokenID(ID_TARGET_HEIGHT))
+        {
+            getNextToken();
+            // a value of zero causes texture to be size of render target
+            textureDef->height = 0;
+        }
+        else
+        {
+            textureDef->height = static_cast<size_t>(getNextTokenValue());
+        }
+        // get pixel factor
+        switch (getNextTokenID())
+        {
+        case ID_PF_A8R8G8B8:
+            textureDef->format = PF_A8R8G8B8;
+            break;
+
+        case ID_PF_R8G8B8A8:
+            textureDef->format = PF_R8G8B8A8;
+            break;
+        case ID_PF_R8G8B8:
+            textureDef->format = PF_R8G8B8;
+            break;
+		case ID_PF_FLOAT16_R:
+            textureDef->format = PF_FLOAT16_R;
+            break;
+		case ID_PF_FLOAT16_GR:
+			textureDef->format = PF_FLOAT16_GR;
+			break;
+		case ID_PF_FLOAT16_RGB:
+            textureDef->format = PF_FLOAT16_RGB;
+            break;
+		case ID_PF_FLOAT16_RGBA:
+            textureDef->format = PF_FLOAT16_RGBA;
+            break;
+		case ID_PF_FLOAT32_R:
+            textureDef->format = PF_FLOAT32_R;
+            break;
+		case ID_PF_FLOAT32_GR:
+			textureDef->format = PF_FLOAT32_GR;
+			break;
+		case ID_PF_FLOAT32_RGB:
+            textureDef->format = PF_FLOAT32_RGB;
+            break;
+		case ID_PF_FLOAT32_RGBA:
+            textureDef->format = PF_FLOAT32_RGBA;
+            break;
+
+        default:
+            // should never get here?
+            break;
+        }
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::parseTarget(void)
+	{
+        assert(mScriptContext.technique);
+
+		mScriptContext.section = CSS_TARGET;
+        mScriptContext.target = mScriptContext.technique->createTargetPass();
+        mScriptContext.target->setOutputName(getNextTokenLabel());
+
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::parseInput(void)
+	{
+		// input parameters depends on context either target or pass
+		if (mScriptContext.section == CSS_TARGET)
+		{
+		    // for input in target, there is only one parameter
+		    assert(mScriptContext.target);
+		    if (testNextTokenID(ID_PREVIOUS))
+                mScriptContext.target->setInputMode(CompositionTargetPass::IM_PREVIOUS);
+            else
+                mScriptContext.target->setInputMode(CompositionTargetPass::IM_NONE);
+		}
+		else // assume for pass section context
+		{
+		    // for input in pass, there are two parameters
+		    assert(mScriptContext.pass);
+		    uint32 id = static_cast<uint32>(getNextTokenValue());
+		    const String& textureName = getNextTokenLabel();
+		    mScriptContext.pass->setInput(id, textureName);
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::parseTargetOutput(void)
+	{
+		assert(mScriptContext.technique);
+		mScriptContext.target = mScriptContext.technique->getOutputTargetPass();
+		mScriptContext.section = CSS_TARGET;
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::parseOnlyInitial(void)
+	{
+        assert(mScriptContext.target);
+        mScriptContext.target->setOnlyInitial(testNextTokenID(ID_ON));
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::parseVisibilityMask(void)
+	{
+        assert(mScriptContext.target);
+        mScriptContext.target->setVisibilityMask(static_cast<uint32>(getNextTokenValue()));
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::parseLodBias(void)
+	{
+        assert(mScriptContext.target);
+        mScriptContext.target->setLodBias(getNextTokenValue());
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::parseMaterialScheme(void)
+	{
+		assert(mScriptContext.target);
+		mScriptContext.target->setMaterialScheme(getNextTokenLabel());
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::parsePass(void)
+	{
+		assert(mScriptContext.target);
+        mScriptContext.pass = mScriptContext.target->createPass();
+        CompositionPass::PassType passType = CompositionPass::PT_RENDERQUAD;
+        switch (getNextTokenID())
+        {
+        case ID_RENDER_QUAD:
+            passType = CompositionPass::PT_RENDERQUAD;
+            break;
+
+        case ID_CLEAR:
+            passType = CompositionPass::PT_CLEAR;
+            break;
+
+        case ID_STENCIL:
+            passType = CompositionPass::PT_STENCIL;
+            break;
+
+        case ID_RENDER_SCENE:
+            passType = CompositionPass::PT_RENDERSCENE;
+            break;
+
+        default:
+            break;
+        }
+
+        mScriptContext.pass->setType(passType);
+
+		mScriptContext.section = CSS_PASS;
+
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::parseMaterial(void)
+	{
+		assert(mScriptContext.pass);
+        mScriptContext.pass->setMaterialName(getNextTokenLabel());
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::parseFirstRenderQueue(void)
+	{
+		assert(mScriptContext.pass);
+		mScriptContext.pass->setFirstRenderQueue(static_cast<uint8>(getNextTokenValue()));
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::parseLastRenderQueue(void)
+	{
+		assert(mScriptContext.pass);
+		mScriptContext.pass->setLastRenderQueue(static_cast<uint8>(getNextTokenValue()));
+	}
+	//-----------------------------------------------------------------------
+	void CompositorScriptCompiler::parseIdentifier(void)
+	{
+		assert(mScriptContext.pass);
+		mScriptContext.pass->setIdentifier(static_cast<uint32>(getNextTokenValue()));
+	}
+	//-----------------------------------------------------------------------
+    void CompositorScriptCompiler::parseClearBuffers(void)
+    {
+		assert(mScriptContext.pass);
+		// while there are tokens for the action, get next token and set buffer flag
+		uint32 bufferFlags = 0;
+
+		while (getRemainingTokensForAction() > 0)
+		{
+		    switch (getNextTokenID())
+		    {
+            case ID_CLR_COLOUR:
+                bufferFlags |= FBT_COLOUR;
+                break;
+
+            case ID_CLR_DEPTH:
+                bufferFlags |= FBT_DEPTH;
+                break;
+
+            case ID_STENCIL:
+                bufferFlags |= FBT_STENCIL;
+                break;
+
+            default:
+                break;
+		    }
+		}
+		mScriptContext.pass->setClearBuffers(bufferFlags);
+    }
+	//-----------------------------------------------------------------------
+    void CompositorScriptCompiler::parseClearColourValue(void)
+    {
+		assert(mScriptContext.pass);
+		Real red = getNextTokenValue();
+		Real green = getNextTokenValue();
+		Real blue = getNextTokenValue();
+		Real alpha = getNextTokenValue();
+		mScriptContext.pass->setClearColour(ColourValue(red, green, blue, alpha));
+    }
+	//-----------------------------------------------------------------------
+    void CompositorScriptCompiler::parseClearDepthValue(void)
+    {
+		assert(mScriptContext.pass);
+		mScriptContext.pass->setClearDepth(getNextTokenValue());
+    }
+	//-----------------------------------------------------------------------
+    void CompositorScriptCompiler::parseClearStencilValue(void)
+    {
+		assert(mScriptContext.pass);
+		mScriptContext.pass->setClearStencil(static_cast<uint32>(getNextTokenValue()));
+    }
+	//-----------------------------------------------------------------------
+    void CompositorScriptCompiler::parseStencilCheck(void)
+    {
+		assert(mScriptContext.pass);
+		mScriptContext.pass->setStencilCheck(testNextTokenID(ID_ON));
+    }
+	//-----------------------------------------------------------------------
+    void CompositorScriptCompiler::parseStencilFunc(void)
+    {
+		assert(mScriptContext.pass);
+		mScriptContext.pass->setStencilFunc(extractCompareFunc());
+    }
+	//-----------------------------------------------------------------------
+    void CompositorScriptCompiler::parseStencilRefVal(void)
+    {
+		assert(mScriptContext.pass);
+		mScriptContext.pass->setStencilRefValue(static_cast<uint32>(getNextTokenValue()));
+    }
+	//-----------------------------------------------------------------------
+    void CompositorScriptCompiler::parseStencilMask(void)
+    {
+		assert(mScriptContext.pass);
+		mScriptContext.pass->setStencilMask(static_cast<uint32>(getNextTokenValue()));
+    }
+	//-----------------------------------------------------------------------
+    void CompositorScriptCompiler::parseStencilFailOp(void)
+    {
+		assert(mScriptContext.pass);
+		mScriptContext.pass->setStencilFailOp(extractStencilOp());
+    }
+	//-----------------------------------------------------------------------
+    void CompositorScriptCompiler::parseStencilDepthFailOp(void)
+    {
+		assert(mScriptContext.pass);
+		mScriptContext.pass->setStencilDepthFailOp(extractStencilOp());
+    }
+	//-----------------------------------------------------------------------
+    void CompositorScriptCompiler::parseStencilPassOp(void)
+    {
+		assert(mScriptContext.pass);
+		mScriptContext.pass->setStencilPassOp(extractStencilOp());
+    }
+	//-----------------------------------------------------------------------
+    void CompositorScriptCompiler::parseStencilTwoSided(void)
+    {
+		assert(mScriptContext.pass);
+		mScriptContext.pass->setStencilTwoSidedOperation(testNextTokenID(ID_ON));
+    }
+	//-----------------------------------------------------------------------
+	StencilOperation CompositorScriptCompiler::extractStencilOp(void)
+	{
+	    StencilOperation sop = SOP_KEEP;
+
+        switch (getNextTokenID())
+        {
+        case ID_ST_KEEP:
+            sop = SOP_KEEP;
+            break;
+
+        case ID_ST_ZERO:
+            sop = SOP_ZERO;
+            break;
+
+        case ID_ST_REPLACE:
+            sop = SOP_REPLACE;
+            break;
+
+        case ID_ST_INCREMENT:
+            sop = SOP_INCREMENT;
+            break;
+
+        case ID_ST_DECREMENT:
+            sop = SOP_DECREMENT;
+            break;
+
+        case ID_ST_INCREMENT_WRAP:
+            sop = SOP_INCREMENT_WRAP;
+            break;
+
+        case ID_ST_DECREMENT_WRAP:
+            sop = SOP_DECREMENT_WRAP;
+            break;
+
+        case ID_ST_INVERT:
+            sop = SOP_INVERT;
+            break;
+
+        default:
+            break;
+        }
+
+        return sop;
+	}
+    CompareFunction CompositorScriptCompiler::extractCompareFunc(void)
+	{
+	    CompareFunction compFunc = CMPF_ALWAYS_PASS;
+
+        switch (getNextTokenID())
+        {
+        case ID_ST_ALWAYS_FAIL:
+            compFunc = CMPF_ALWAYS_FAIL;
+            break;
+
+        case ID_ST_ALWAYS_PASS:
+            compFunc = CMPF_ALWAYS_PASS;
+            break;
+
+        case ID_ST_LESS:
+            compFunc = CMPF_LESS;
+            break;
+
+        case ID_ST_LESS_EQUAL:
+            compFunc = CMPF_LESS_EQUAL;
+            break;
+
+        case ID_ST_EQUAL:
+            compFunc = CMPF_EQUAL;
+            break;
+
+        case ID_ST_NOT_EQUAL:
+            compFunc = CMPF_NOT_EQUAL;
+            break;
+
+        case ID_ST_GREATER_EQUAL:
+            compFunc = CMPF_GREATER_EQUAL;
+            break;
+
+        case ID_ST_GREATER:
+            compFunc = CMPF_GREATER;
+            break;
+
+        default:
+            break;
+        }
+
+        return compFunc;
+	}
+
+}
Index: /OgreMain/src/OgreCompositorSerializer.cpp
===================================================================
--- /OgreMain/src/OgreCompositorSerializer.cpp	(revision 5)
+++ /OgreMain/src/OgreCompositorSerializer.cpp	(revision 5)
@@ -0,0 +1,49 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreCompositorSerializer.h"
+#include "OgreCompositorScriptCompiler.h"
+
+namespace Ogre {
+//-----------------------------------------------------------------------
+	CompositorSerializer::CompositorSerializer()
+	{
+        mScriptCompiler = new CompositorScriptCompiler();
+	}
+//-----------------------------------------------------------------------
+	CompositorSerializer::~CompositorSerializer()
+	{
+	    delete mScriptCompiler;
+	}
+//-----------------------------------------------------------------------
+    void CompositorSerializer::parseScript(DataStreamPtr& stream, const String& groupName)
+    {
+        mScriptCompiler->parseScript(stream,  groupName);
+    }
+}
Index: /OgreMain/src/OgreConfigFile.cpp
===================================================================
--- /OgreMain/src/OgreConfigFile.cpp	(revision 5)
+++ /OgreMain/src/OgreConfigFile.cpp	(revision 5)
@@ -0,0 +1,223 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreConfigFile.h"
+#include "OgreResourceGroupManager.h"
+
+#include "OgreException.h"
+
+#include <iostream>
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    ConfigFile::ConfigFile()
+    {
+    }
+    //-----------------------------------------------------------------------
+    ConfigFile::~ConfigFile()
+    {
+        SettingsBySection::iterator seci, secend;
+        secend = mSettings.end();
+        for (seci = mSettings.begin(); seci != secend; ++seci)
+        {
+            delete seci->second;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ConfigFile::clear(void)
+    {
+        for (SettingsBySection::iterator seci = mSettings.begin(); 
+            seci != mSettings.end(); ++seci)
+        {
+            delete seci->second;
+        }
+        mSettings.clear();
+    }
+    //-----------------------------------------------------------------------
+    void ConfigFile::load(const String& filename, const String& separators, bool trimWhitespace)
+    {
+        loadDirect(filename, separators, trimWhitespace);
+    }
+    //-----------------------------------------------------------------------
+    void ConfigFile::load(const String& filename, const String& resourceGroup, 
+        const String& separators, bool trimWhitespace)
+    {
+		loadFromResourceSystem(filename, resourceGroup, separators, trimWhitespace);
+    }
+	//-----------------------------------------------------------------------
+	void ConfigFile::loadDirect(const String& filename, const String& separators, 
+		bool trimWhitespace)
+	{
+		/* Open the configuration file */
+		std::ifstream fp;
+        // Always open in binary mode
+		fp.open(filename.c_str(), std::ios::in | std::ios::binary);
+		if(!fp)
+			OGRE_EXCEPT(
+			Exception::ERR_FILE_NOT_FOUND, "'" + filename + "' file not found!", "ConfigFile::load" );
+
+		// Wrap as a stream
+		DataStreamPtr stream(new FileStreamDataStream(filename, &fp, false));
+		load(stream, separators, trimWhitespace);
+
+	}
+	//-----------------------------------------------------------------------
+	void ConfigFile::loadFromResourceSystem(const String& filename, 
+		const String& resourceGroup, const String& separators, bool trimWhitespace)
+	{
+		DataStreamPtr stream = 
+			ResourceGroupManager::getSingleton().openResource(filename, resourceGroup);
+		load(stream, separators, trimWhitespace);
+	}
+    //-----------------------------------------------------------------------
+    void ConfigFile::load(const DataStreamPtr& stream, const String& separators, 
+        bool trimWhitespace)
+    {
+        /* Clear current settings map */
+        clear();
+
+        String currentSection = StringUtil::BLANK;
+        SettingsMultiMap* currentSettings = new SettingsMultiMap();
+        mSettings[currentSection] = currentSettings;
+
+
+        /* Process the file line for line */
+        String line, optName, optVal;
+        while (!stream->eof())
+        {
+            line = stream->getLine();
+            /* Ignore comments & blanks */
+            if (line.length() > 0 && line.at(0) != '#' && line.at(0) != '@')
+            {
+                if (line.at(0) == '[' && line.at(line.length()-1) == ']')
+                {
+                    // Section
+                    currentSection = line.substr(1, line.length() - 2);
+					SettingsBySection::const_iterator seci = mSettings.find(currentSection);
+					if (seci == mSettings.end())
+					{
+						currentSettings = new SettingsMultiMap();
+						mSettings[currentSection] = currentSettings;
+					}
+					else
+					{
+						currentSettings = seci->second;
+					} 
+                }
+                else
+                {
+                    /* Find the first seperator character and split the string there */
+                    std::string::size_type separator_pos = line.find_first_of(separators, 0);
+                    if (separator_pos != std::string::npos)
+                    {
+                        optName = line.substr(0, separator_pos);
+                        /* Find the first non-seperator character following the name */
+                        std::string::size_type nonseparator_pos = line.find_first_not_of(separators, separator_pos);
+                        /* ... and extract the value */
+                        /* Make sure we don't crash on an empty setting (it might be a valid value) */
+                        optVal = (nonseparator_pos == std::string::npos) ? "" : line.substr(nonseparator_pos);
+                        if (trimWhitespace)
+                        {
+                            StringUtil::trim(optVal);
+                            StringUtil::trim(optName);
+                        }
+                        currentSettings->insert(std::multimap<String, String>::value_type(optName, optVal));
+                    }
+                }
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    String ConfigFile::getSetting(const String& key, const String& section) const
+    {
+        
+        SettingsBySection::const_iterator seci = mSettings.find(section);
+        if (seci == mSettings.end())
+        {
+            return StringUtil::BLANK;
+        }
+        else
+        {
+            SettingsMultiMap::const_iterator i = seci->second->find(key);
+            if (i == seci->second->end())
+            {
+                return StringUtil::BLANK;
+            }
+            else
+            {
+                return i->second;
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    StringVector ConfigFile::getMultiSetting(const String& key, const String& section) const
+    {
+        StringVector ret;
+
+
+        SettingsBySection::const_iterator seci = mSettings.find(section);
+        if (seci != mSettings.end())
+        {
+            SettingsMultiMap::const_iterator i;
+
+            i = seci->second->find(key);
+            // Iterate over matches
+            while (i != seci->second->end() && i->first == key)
+            {
+                ret.push_back(i->second);
+                ++i;
+            }
+        }
+        return ret;
+
+
+    }
+    //-----------------------------------------------------------------------
+    ConfigFile::SettingsIterator ConfigFile::getSettingsIterator(const String& section)
+    {
+        SettingsBySection::const_iterator seci = mSettings.find(section);
+        if (seci == mSettings.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Cannot find section " + section, 
+                "ConfigFile::getSettingsIterator");
+        }
+        else
+        {
+            return SettingsIterator(seci->second->begin(), seci->second->end());
+        }
+    }
+    //-----------------------------------------------------------------------
+    ConfigFile::SectionIterator ConfigFile::getSectionIterator(void)
+    {
+        return SectionIterator(mSettings.begin(), mSettings.end());
+    }
+
+}
Index: /OgreMain/src/OgreControllerManager.cpp
===================================================================
--- /OgreMain/src/OgreControllerManager.cpp	(revision 5)
+++ /OgreMain/src/OgreControllerManager.cpp	(revision 5)
@@ -0,0 +1,274 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreControllerManager.h"
+
+#include "OgreLogManager.h"
+#include "OgreTextureUnitState.h"
+#include "OgreRoot.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    template<> ControllerManager* Singleton<ControllerManager>::ms_Singleton = 0;
+    ControllerManager* ControllerManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    ControllerManager& ControllerManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+    //-----------------------------------------------------------------------
+    ControllerManager::ControllerManager()
+		: mFrameTimeController(new FrameTimeControllerValue())
+		, mPassthroughFunction(new PassthroughControllerFunction())
+		, mLastFrameNumber(0)
+    {
+
+    }
+    //-----------------------------------------------------------------------
+    ControllerManager::~ControllerManager()
+    {
+        clearControllers();
+    }
+    //-----------------------------------------------------------------------
+    Controller<Real>* ControllerManager::createController(
+        const ControllerValueRealPtr& src, const ControllerValueRealPtr& dest,
+        const ControllerFunctionRealPtr& func)
+    {
+        Controller<Real>* c = new Controller<Real>(src, dest, func);
+
+        mControllers.insert(c);
+        return c;
+    }
+    //-----------------------------------------------------------------------
+    Controller<Real>* ControllerManager::createFrameTimePassthroughController(
+        const ControllerValueRealPtr& dest)
+    {
+        return createController(getFrameTimeSource(), dest, getPassthroughControllerFunction());
+    }
+    //-----------------------------------------------------------------------
+    void ControllerManager::updateAllControllers(void)
+    {
+        // Only update once per frame
+        unsigned long thisFrameNumber = Root::getSingleton().getCurrentFrameNumber();
+        if (thisFrameNumber != mLastFrameNumber)
+        {
+            ControllerList::const_iterator ci;
+            for (ci = mControllers.begin(); ci != mControllers.end(); ++ci)
+            {
+                (*ci)->update();
+            }
+            mLastFrameNumber = thisFrameNumber;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ControllerManager::clearControllers(void)
+    {
+        ControllerList::iterator ci;
+        for (ci = mControllers.begin(); ci != mControllers.end(); ++ci)
+        {
+            delete *ci;
+        }
+        mControllers.clear();
+    }
+    //-----------------------------------------------------------------------
+    const ControllerValueRealPtr& ControllerManager::getFrameTimeSource(void) const
+    {
+        return mFrameTimeController;
+    }
+	//-----------------------------------------------------------------------
+	const ControllerFunctionRealPtr& ControllerManager::getPassthroughControllerFunction(void) const
+	{
+		return mPassthroughFunction;
+	}
+    //-----------------------------------------------------------------------
+    Controller<Real>* ControllerManager::createTextureAnimator(TextureUnitState* layer, Real sequenceTime)
+    {
+        SharedPtr< ControllerValue<Real> > texVal(new TextureFrameControllerValue(layer));
+        SharedPtr< ControllerFunction<Real> > animFunc(new AnimationControllerFunction(sequenceTime));
+
+        return createController(mFrameTimeController, texVal, animFunc);
+    }
+    //-----------------------------------------------------------------------
+    Controller<Real>* ControllerManager::createTextureUVScroller(TextureUnitState* layer, Real speed)
+    {
+		Controller<Real>* ret = 0;
+
+		if (speed != 0)
+        {
+			SharedPtr< ControllerValue<Real> > val;
+			SharedPtr< ControllerFunction<Real> > func;
+
+			// We do both scrolls with a single controller
+			val.bind(new TexCoordModifierControllerValue(layer, true, true));
+			// Create function: use -speed since we're altering texture coords so they have reverse effect
+            func.bind(new ScaleControllerFunction(-speed, true));
+            ret = createController(mFrameTimeController, val, func);
+		}
+
+		return ret;
+	}
+    //-----------------------------------------------------------------------
+    Controller<Real>* ControllerManager::createTextureUScroller(TextureUnitState* layer, Real uSpeed)
+    {
+        Controller<Real>* ret = 0;
+
+        if (uSpeed != 0)
+        {
+			SharedPtr< ControllerValue<Real> > uVal;
+			SharedPtr< ControllerFunction<Real> > uFunc;
+
+                uVal.bind(new TexCoordModifierControllerValue(layer, true));
+            // Create function: use -speed since we're altering texture coords so they have reverse effect
+            uFunc.bind(new ScaleControllerFunction(-uSpeed, true));
+            ret = createController(mFrameTimeController, uVal, uFunc);
+        }
+
+        return ret;
+    }
+	//-----------------------------------------------------------------------
+    Controller<Real>* ControllerManager::createTextureVScroller(TextureUnitState* layer, Real vSpeed)
+    {
+		Controller<Real>* ret = 0;
+
+		if (vSpeed != 0)
+        {
+			SharedPtr< ControllerValue<Real> > vVal;
+			SharedPtr< ControllerFunction<Real> > vFunc;
+
+            // Set up a second controller for v scroll
+            vVal.bind(new TexCoordModifierControllerValue(layer, false, true));
+            // Create function: use -speed since we're altering texture coords so they have reverse effect
+            vFunc.bind(new ScaleControllerFunction(-vSpeed, true));
+            ret = createController(mFrameTimeController, vVal, vFunc);
+        }
+
+        return ret;
+    }
+    //-----------------------------------------------------------------------
+    Controller<Real>* ControllerManager::createTextureRotater(TextureUnitState* layer, Real speed)
+    {
+        SharedPtr< ControllerValue<Real> > val;
+        SharedPtr< ControllerFunction<Real> > func;
+
+        // Target value is texture coord rotation
+        val.bind(new TexCoordModifierControllerValue(layer, false, false, false, false, true));
+        // Function is simple scale (seconds * speed)
+        // Use -speed since altering texture coords has the reverse visible effect
+        func.bind(new ScaleControllerFunction(-speed, true));
+
+        return createController(mFrameTimeController, val, func);
+
+    }
+    //-----------------------------------------------------------------------
+    Controller<Real>* ControllerManager::createTextureWaveTransformer(TextureUnitState* layer,
+        TextureUnitState::TextureTransformType ttype, WaveformType waveType, Real base, Real frequency, Real phase, Real amplitude)
+    {
+        SharedPtr< ControllerValue<Real> > val;
+        SharedPtr< ControllerFunction<Real> > func;
+
+        switch (ttype)
+        {
+        case TextureUnitState::TT_TRANSLATE_U:
+            // Target value is a u scroll
+            val.bind(new TexCoordModifierControllerValue(layer, true));
+            break;
+        case TextureUnitState::TT_TRANSLATE_V:
+            // Target value is a v scroll
+            val.bind(new TexCoordModifierControllerValue(layer, false, true));
+            break;
+        case TextureUnitState::TT_SCALE_U:
+            // Target value is a u scale
+            val.bind(new TexCoordModifierControllerValue(layer, false, false, true));
+            break;
+        case TextureUnitState::TT_SCALE_V:
+            // Target value is a v scale
+            val.bind(new TexCoordModifierControllerValue(layer, false, false, false, true));
+            break;
+        case TextureUnitState::TT_ROTATE:
+            // Target value is texture coord rotation
+            val.bind(new TexCoordModifierControllerValue(layer, false, false, false, false, true));
+            break;
+        }
+        // Create new wave function for alterations
+        func.bind(new WaveformControllerFunction(waveType, base, frequency, phase, amplitude, true));
+
+        return createController(mFrameTimeController, val, func);
+    }
+    //-----------------------------------------------------------------------
+    Controller<Real>* ControllerManager::createGpuProgramTimerParam(
+        GpuProgramParameters* params, size_t paramIndex, Real timeFactor)
+    {
+        SharedPtr< ControllerValue<Real> > val;
+        SharedPtr< ControllerFunction<Real> > func;
+
+        val.bind(new FloatGpuParameterControllerValue(params, paramIndex));
+        func.bind(new ScaleControllerFunction(timeFactor, true));
+
+        return createController(mFrameTimeController, val, func);
+
+    }
+    //-----------------------------------------------------------------------
+    void ControllerManager::destroyController(Controller<Real>* controller)
+    {
+        ControllerList::iterator i = mControllers.find(controller);
+        if (i != mControllers.end())
+        {
+            mControllers.erase(i);
+            delete controller;
+        }
+    }
+	//-----------------------------------------------------------------------
+	Real ControllerManager::getTimeFactor(void) const {
+		return static_cast<const FrameTimeControllerValue*>(mFrameTimeController.get())->getTimeFactor();
+	}
+	//-----------------------------------------------------------------------
+	void ControllerManager::setTimeFactor(Real tf) {
+		static_cast<FrameTimeControllerValue*>(mFrameTimeController.getPointer())->setTimeFactor(tf);
+	}
+	//-----------------------------------------------------------------------
+	Real ControllerManager::getFrameDelay(void) const {
+		return static_cast<const FrameTimeControllerValue*>(mFrameTimeController.get())->getFrameDelay();
+	}
+	//-----------------------------------------------------------------------
+	void ControllerManager::setFrameDelay(Real fd) {
+		static_cast<FrameTimeControllerValue*>(mFrameTimeController.getPointer())->setFrameDelay(fd);
+	}
+	//-----------------------------------------------------------------------
+	Real ControllerManager::getElapsedTime(void) const
+	{
+		return static_cast<const FrameTimeControllerValue*>(mFrameTimeController.get())->getElapsedTime();
+	}
+	//-----------------------------------------------------------------------
+	void ControllerManager::setElapsedTime(Real elapsedTime)
+	{
+		static_cast<FrameTimeControllerValue*>(mFrameTimeController.get())->setElapsedTime(elapsedTime);
+	}
+}
Index: /OgreMain/src/OgreConvexBody.cpp
===================================================================
--- /OgreMain/src/OgreConvexBody.cpp	(revision 5)
+++ /OgreMain/src/OgreConvexBody.cpp	(revision 5)
@@ -0,0 +1,1220 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Copyright (c) 2006 Matthias Fink, netAllied GmbH <matthias.fink@web.de>								
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreConvexBody.h"
+#include "OgreException.h"
+#include "OgreVector3.h"
+#include <OgreLogManager.h>
+#include <OgreRay.h>
+#include <OgreFrustum.h>
+#include <OgreAxisAlignedBox.h>
+
+
+namespace Ogre
+{
+
+
+	//-----------------------------------------------------------------------
+	// Statics
+	//-----------------------------------------------------------------------
+	ConvexBody::PolygonList ConvexBody::msFreePolygons;
+#if OGRE_THREAD_SUPPORT
+	boost::recursive_mutex ConvexBody::msFreePolygonsMutex;
+#endif
+	//-----------------------------------------------------------------------
+	void ConvexBody::_initialisePool()
+	{
+		OGRE_LOCK_MUTEX(msFreePolygonsMutex)
+
+		if (msFreePolygons.empty())
+		{
+			const size_t initialSize = 30;
+
+			// Initialise polygon pool with 30 polys
+			msFreePolygons.resize(initialSize);
+			for (size_t i = 0; i < initialSize; ++i)
+			{
+				msFreePolygons[i] = new Polygon();
+			}
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::_destroyPool()
+	{
+		OGRE_LOCK_MUTEX(msFreePolygonsMutex)
+		
+		for (PolygonList::iterator i = msFreePolygons.begin(); 
+			i != msFreePolygons.end(); ++i)
+		{
+			delete *i;
+		}
+		msFreePolygons.clear();
+	}
+	//-----------------------------------------------------------------------
+	Polygon* ConvexBody::allocatePolygon()
+	{
+		OGRE_LOCK_MUTEX(msFreePolygonsMutex)
+
+		if (msFreePolygons.empty())
+		{
+			// if we ran out of polys to use, create a new one
+			// hopefully this one will return to the pool in due course
+			return new Polygon();
+		}
+		else
+		{
+			Polygon* ret = msFreePolygons.back();
+			ret->reset();
+
+			msFreePolygons.pop_back();
+
+			return ret;
+
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::freePolygon(Polygon* poly)
+	{
+		OGRE_LOCK_MUTEX(msFreePolygonsMutex)
+		msFreePolygons.push_back(poly);
+	}
+	//-----------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	ConvexBody::ConvexBody()
+	{
+		// Reserve space for 8 polys, normally 6 faces plus a couple of clips
+		mPolygons.reserve(8);
+
+	}
+	//-----------------------------------------------------------------------
+	ConvexBody::~ConvexBody()
+	{
+		reset();
+	}
+	//-----------------------------------------------------------------------
+	ConvexBody::ConvexBody( const ConvexBody& cpy )
+	{
+		for ( size_t i = 0; i < cpy.getPolygonCount(); ++i )
+		{
+			Polygon *p = allocatePolygon();
+			*p = cpy.getPolygon( i );
+			mPolygons.push_back( p );
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::define(const Frustum& frustum)
+	{
+		// ordering of the points:
+		// near (0-3), far (4-7); each (top-right, top-left, bottom-left, bottom-right)
+		//	   5-----4
+		//	  /|    /|
+		//	 / |   / |
+		//	1-----0  |
+		//	|  6--|--7
+		//	| /   | /
+		//	|/    |/
+		//	2-----3
+		
+		const Vector3 *pts = frustum.getWorldSpaceCorners();
+
+		/// reset ConvexBody
+		reset();
+
+		/// update vertices: near, far, left, right, bottom, top; fill in ccw
+		Polygon *poly;
+
+		// near
+		poly = allocatePolygon();
+		poly->insertVertex( pts[0] );
+		poly->insertVertex( pts[1] );
+		poly->insertVertex( pts[2] );
+		poly->insertVertex( pts[3] );
+		mPolygons.push_back( poly );
+
+		// far
+		poly = allocatePolygon();
+		poly->insertVertex( pts[5] );
+		poly->insertVertex( pts[4] );
+		poly->insertVertex( pts[7] );
+		poly->insertVertex( pts[6] );
+		mPolygons.push_back( poly );
+
+		// left
+		poly = allocatePolygon();
+		poly->insertVertex( pts[5] );
+		poly->insertVertex( pts[6] );
+		poly->insertVertex( pts[2] );
+		poly->insertVertex( pts[1] );
+		mPolygons.push_back( poly ); 
+
+		// right
+		poly = allocatePolygon();
+		poly->insertVertex( pts[4] );
+		poly->insertVertex( pts[0] );
+		poly->insertVertex( pts[3] );
+		poly->insertVertex( pts[7] );
+		mPolygons.push_back( poly ); 
+
+		// bottom
+		poly = allocatePolygon();
+		poly->insertVertex( pts[6] );
+		poly->insertVertex( pts[7] );
+		poly->insertVertex( pts[3] );
+		poly->insertVertex( pts[2] );
+		mPolygons.push_back( poly ); 
+
+		// top
+		poly = allocatePolygon();
+		poly->insertVertex( pts[4] );
+		poly->insertVertex( pts[5] );
+		poly->insertVertex( pts[1] );
+		poly->insertVertex( pts[0] );
+		mPolygons.push_back( poly ); 
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::define(const AxisAlignedBox& aab)
+	{
+		// ordering of the AAB points:
+		//		1-----2
+		//	   /|    /|
+		//	  / |   / |
+		//   5-----4  |
+		//   |  0--|--3
+		//   | /   | /
+		//   |/    |/
+		//   6-----7
+		
+		const Vector3& min = aab.getMinimum();
+		const Vector3& max = aab.getMaximum();
+
+		Vector3 currentVertex = min;
+
+		Polygon *poly;
+
+		// reset body
+		reset();
+
+		// far
+		poly = allocatePolygon();
+		poly->insertVertex( currentVertex ); // 0 
+		currentVertex.y = max.y;
+		poly->insertVertex( currentVertex ); // 1
+		currentVertex.x = max.x;
+		poly->insertVertex( currentVertex ); // 2
+		currentVertex.y = min.y;
+		poly->insertVertex( currentVertex ); // 3
+		insertPolygon( poly );
+
+		// right
+		poly = allocatePolygon();
+		poly->insertVertex( currentVertex ); // 3
+		currentVertex.y = max.y;
+		poly->insertVertex( currentVertex ); // 2
+		currentVertex.z = max.z;
+		poly->insertVertex( currentVertex ); // 4
+		currentVertex.y = min.y;
+		poly->insertVertex( currentVertex ); // 7
+		insertPolygon( poly ); 
+
+		// near
+		poly = allocatePolygon();
+		poly->insertVertex( currentVertex ); // 7
+		currentVertex.y = max.y;
+		poly->insertVertex( currentVertex ); // 4
+		currentVertex.x = min.x;
+		poly->insertVertex( currentVertex ); // 5
+		currentVertex.y = min.y;
+		poly->insertVertex( currentVertex ); // 6
+		insertPolygon( poly );
+
+		// left
+		poly = allocatePolygon();
+		poly->insertVertex( currentVertex ); // 6
+		currentVertex.y = max.y;
+		poly->insertVertex( currentVertex ); // 5
+		currentVertex.z = min.z;
+		poly->insertVertex( currentVertex ); // 1
+		currentVertex.y = min.y;
+		poly->insertVertex( currentVertex ); // 0
+		insertPolygon( poly ); 
+
+		// bottom
+		poly = allocatePolygon();
+		poly->insertVertex( currentVertex ); // 0 
+		currentVertex.x = max.x;
+		poly->insertVertex( currentVertex ); // 3
+		currentVertex.z = max.z;
+		poly->insertVertex( currentVertex ); // 7 
+		currentVertex.x = min.x;
+		poly->insertVertex( currentVertex ); // 6
+		insertPolygon( poly );
+
+		// top
+		poly = allocatePolygon();
+		currentVertex = max;
+		poly->insertVertex( currentVertex ); // 4
+		currentVertex.z = min.z;
+		poly->insertVertex( currentVertex ); // 2
+		currentVertex.x = min.x;
+		poly->insertVertex( currentVertex ); // 1
+		currentVertex.z = max.z;
+		poly->insertVertex( currentVertex ); // 5
+		insertPolygon( poly );
+		
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::clip(const AxisAlignedBox& aab)
+	{
+		// ordering of the AAB points:
+		//		1-----2
+		//	   /|    /|
+		//	  / |   / |
+		//   5-----4  |
+		//   |  0--|--3
+		//   | /   | /
+		//   |/    |/
+		//   6-----7
+
+		const Vector3& min = aab.getMinimum();
+		const Vector3& max = aab.getMaximum();
+
+		// clip object for each plane of the AAB
+		Plane p;
+
+
+		// front
+		p.redefine(Vector3::UNIT_Z, max);
+		clip(p);
+
+		// back
+		p.redefine(Vector3::NEGATIVE_UNIT_Z, min);
+		clip(p);
+		
+		// left
+		p.redefine(Vector3::NEGATIVE_UNIT_X, min);
+		clip(p);
+		
+		// right
+		p.redefine(Vector3::UNIT_X, max);
+		clip(p);
+		
+		// bottom
+		p.redefine(Vector3::NEGATIVE_UNIT_Y, min);
+		clip(p);
+		
+		// top
+		p.redefine(Vector3::UNIT_Y, max);
+		clip(p);
+
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::clip(const Frustum& fr)
+	{
+		// clip the body with each plane
+		for ( unsigned short i = 0; i < 6; ++i )
+		{
+			// clip, but keep positive space this time since frustum planes are 
+			// the opposite to other cases (facing inwards rather than outwards)
+			clip(fr.getFrustumPlane(i), false);
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::clip(const ConvexBody& body)
+	{
+		if ( this == &body )
+			return;
+
+		// for each polygon; clip 'this' with each plane of 'body'
+		// front vertex representation is ccw
+
+		Plane pl;
+
+		for ( size_t iPoly = 0; iPoly < body.getPolygonCount(); ++iPoly )
+		{
+			const Polygon& p = body.getPolygon( iPoly );
+
+			OgreAssert( p.getVertexCount() >= 3, "A valid polygon must contain at least three vertices." );
+
+			// set up plane with first three vertices of the polygon (a polygon is always planar)
+			pl.redefine( p.getVertex( 0 ), p.getVertex( 1 ), p.getVertex( 2 ) );
+
+			clip(pl);
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::extend(const Vector3& pt)
+	{
+		// Erase all polygons facing towards the point. For all edges that
+		// are not removed twice (once in AB and once BA direction) build a
+		// convex polygon (triangle) with the point.
+		Polygon::EdgeMap edgeMap;
+
+		for ( size_t i = 0; i < getPolygonCount(); ++i )
+		{
+			const Vector3& normal = getNormal( i );
+			// direction of the point in regard to the polygon
+			// the polygon is planar so we can take an arbitrary vertex
+			Vector3 ptDir  = pt - getVertex( i, 0 );
+			ptDir.normalise();
+
+			// remove polygon if dot product is greater or equals null.
+			if ( normal.dotProduct( ptDir ) >= 0 )
+			{
+				// store edges (copy them because if the polygon is deleted
+				// its vertices are also deleted)
+				storeEdgesOfPolygon( i, &edgeMap );
+
+				// remove polygon
+				deletePolygon( i );
+
+				// decrement iterator because of deleted polygon
+				--i; 
+			}
+		}
+
+		// point is already a part of the hull (point lies inside)
+		if ( edgeMap.empty() )
+			return;
+
+		// remove the edges that are twice in the list (once from each side: AB,BA)
+
+		Polygon::EdgeMap::iterator it;
+		// iterate from first to the element before the last one
+		for (Polygon::EdgeMap::iterator itStart = edgeMap.begin(); 
+			itStart != edgeMap.end(); )
+		{
+			// compare with iterator + 1 to end
+			// don't need to skip last entry in itStart since omitted in inner loop
+			it = itStart;
+			++it;
+
+			bool erased = false;
+			// iterate from itStart+1 to the element before the last one
+			for ( ; it != edgeMap.end(); ++it )
+			{	
+				if (itStart->first.positionEquals(it->second) &&
+					 itStart->second.positionEquals(it->first))
+				{
+					edgeMap.erase(it);
+					// increment itStart before deletion (iterator invalidation)
+					Polygon::EdgeMap::iterator delistart = itStart++;
+					edgeMap.erase(delistart);
+					erased = true;
+
+					break; // found and erased
+				}
+			}
+			// increment itStart if we didn't do it when erasing
+			if (!erased)
+				++itStart;
+
+		}
+
+		// use the remaining edges to build triangles with the point
+		// the vertices of the edges are in ccw order (edgePtA-edgePtB-point
+		// to form a ccw polygon)
+		while ( !edgeMap.empty() )
+		{
+			Polygon::EdgeMap::iterator it = edgeMap.begin();
+
+			// build polygon it.first, it.second, point
+			Polygon *p = allocatePolygon();
+
+			p->insertVertex(it->first);
+			p->insertVertex(it->second);
+
+			p->insertVertex( pt );
+			// attach polygon to body
+			insertPolygon( p );
+
+			// erase the vertices from the list
+			// pointers are now held by the polygon
+			edgeMap.erase( it );
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::reset( void )
+	{
+		for (PolygonList::iterator it = mPolygons.begin(); 
+			it != mPolygons.end(); ++it)
+		{
+			freePolygon(*it);
+		}
+		mPolygons.clear();
+	}
+	//-----------------------------------------------------------------------
+	size_t ConvexBody::getPolygonCount( void ) const
+	{
+		return mPolygons.size();
+	}
+	//-----------------------------------------------------------------------
+	size_t ConvexBody::getVertexCount( size_t poly ) const
+	{
+		OgreAssert(poly < getPolygonCount(), "Search position out of range" );
+		
+		return mPolygons[ poly ]->getVertexCount();
+	}
+	//-----------------------------------------------------------------------
+	bool ConvexBody::hasClosedHull( void ) const
+	{
+		// if this map is returned empty, the body is closed
+		Polygon::EdgeMap edgeMap = getSingleEdges();
+
+		return edgeMap.empty();
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::mergePolygons( void )
+	{
+		// Merge all polygons that lay in the same plane as one big polygon.
+		// A convex body does not have two seperate regions (seperated by polygons
+		// with different normals) where the same normal occurs, so we can simply
+		// search all similar normals of a polygon. Two different options are 
+		// possible when the normals fit:
+		// - the two polygons are neighbors
+		// - the two polygons aren't neighbors (but a third, fourth,.. polygon lays
+		//   in between)
+
+		// Signals if the body holds polygons which aren't neighbors but have the same
+		// normal. That means another step has to be processed.
+		bool bDirty = false;
+
+		for ( size_t iPolyA = 0; iPolyA < getPolygonCount(); ++iPolyA )
+		{
+			// ??
+			OgreAssert( iPolyA >= 0, "strange..." );
+
+			for ( size_t iPolyB = iPolyA+1; iPolyB < getPolygonCount(); ++iPolyB )
+			{
+				const Vector3& n1 = getNormal( iPolyA );
+				const Vector3& n2 = getNormal( iPolyB );
+
+				// if the normals point into the same direction
+				if ( n1.directionEquals( n2, Radian( Degree( 0.00001 ) ) )  )
+				{
+					// indicates if a neighbor has been found and joined
+					bool bFound = false;
+
+					// search the two fitting vertices (if there are any) for the common edge
+					const size_t numVerticesA = getVertexCount( iPolyA );
+					for ( size_t iVertexA = 0; iVertexA < numVerticesA; ++iVertexA )
+					{
+						const size_t numVerticesB = getVertexCount( iPolyB );
+						for ( size_t iVertexB = 0; iVertexB < numVerticesB; ++iVertexB )
+						{
+							const Vector3& aCurrent	= getVertex( iPolyA, iVertexA );
+							const Vector3& aNext		= getVertex( iPolyA, (iVertexA + 1) % getVertexCount( iPolyA ) );
+							const Vector3& bCurrent	= getVertex( iPolyB, iVertexB );
+							const Vector3& bNext		= getVertex( iPolyB, (iVertexB + 1) % getVertexCount( iPolyB ) );
+
+							// if the edge is the same the current vertex of A has to be equal to the next of B and the other
+							// way round
+							if ( aCurrent.positionEquals(bNext) &&
+								 bCurrent.positionEquals(aNext))
+							{
+								// polygons are neighbors, assemble new one
+								Polygon *pNew = allocatePolygon();
+
+								// insert all vertices of A up to the join (including the common vertex, ignoring
+								// whether the first vertex of A may be a shared vertex)
+								for ( size_t i = 0; i <= iVertexA; ++i )
+								{
+									pNew->insertVertex( getVertex( iPolyA, i%numVerticesA ) );
+								}
+
+								// insert all vertices of B _after_ the join to the end
+								for ( size_t i = iVertexB + 2; i < numVerticesB; ++i )
+								{
+									pNew->insertVertex( getVertex( iPolyB, i ) );
+								}
+
+								// insert all vertices of B from the beginning up to the join (including the common vertex
+								// and excluding the first vertex if the first is part of the shared edge)
+								for ( size_t i = 0; i <= iVertexB; ++i )
+								{
+									pNew->insertVertex( getVertex( iPolyB, i%numVerticesB ) );
+								}
+
+								// insert all vertices of A _after_ the join to the end
+								for ( size_t i = iVertexA + 2; i < numVerticesA; ++i )
+								{
+									pNew->insertVertex( getVertex( iPolyA, i ) );
+								}
+
+								// in case there are double vertices (in special cases), remove them
+								for ( size_t i = 0; i < pNew->getVertexCount(); ++i )
+								{
+									const Vector3& a = pNew->getVertex( i );
+									const Vector3& b = pNew->getVertex( (i + 1) % pNew->getVertexCount() );
+
+									// if the two vertices are the same...
+									if (a.positionEquals(b))
+									{
+										// remove a
+										pNew->deleteVertex( i );
+
+										// decrement counter
+										--i;
+									}
+								}
+
+								// delete the two old ones
+								OgreAssert( iPolyA != iPolyB, "PolyA and polyB are the same!" );
+								
+								// polyB is always higher than polyA, so delete polyB first
+								deletePolygon( iPolyB );
+								deletePolygon( iPolyA );
+
+								// continue with next (current is deleted, so don't jump to the next after the next)
+								--iPolyA;
+								--iPolyB;
+
+								// insert new polygon
+								insertPolygon( pNew );
+
+								bFound = true;
+								break;
+							}
+						}
+						
+						if ( bFound )
+						{
+							break;
+						}
+					}
+
+					if ( bFound == false )
+					{
+						// there are two polygons available with the same normal direction, but they
+						// could not be merged into one single because of no shared edge
+						bDirty = true;
+						break;
+					}
+				}
+			}
+		}
+
+		// recursion to merge the previous non-neighbors
+		if ( bDirty )
+		{
+			mergePolygons();
+		}
+	}
+	//-----------------------------------------------------------------------
+	const Vector3& ConvexBody::getNormal( size_t poly )
+	{
+		OgreAssert( poly >= 0 && poly < getPolygonCount(), "Search position out of range" );
+		
+		return mPolygons[ poly ]->getNormal();
+	}
+	//-----------------------------------------------------------------------
+	AxisAlignedBox ConvexBody::getAABB( void ) const
+	{
+		AxisAlignedBox aab;
+
+		for ( size_t i = 0; i < getPolygonCount(); ++i )
+		{
+			for ( size_t j = 0; j < getVertexCount( i ); ++j )
+			{
+				aab.merge( getVertex( i, j ) );
+			}
+		}
+
+		return aab;
+	}
+	//-----------------------------------------------------------------------
+	bool ConvexBody::operator == ( const ConvexBody& rhs ) const
+	{
+		if ( getPolygonCount() != rhs.getPolygonCount() )
+			return false;
+
+		// Compare the polygons. They may not be in correct order.
+		// A correct convex body does not have identical polygons in its body.
+		bool *bChecked = new bool[ getPolygonCount() ];
+		for ( size_t i=0; i<getPolygonCount(); ++i )
+		{
+			bChecked[ i ] = false;
+		}
+
+		for ( size_t i=0; i<getPolygonCount(); ++i )
+		{
+			bool bFound = false;
+
+			for ( size_t j=0; j<getPolygonCount(); ++j )
+			{
+				const Polygon& pA = getPolygon( i );
+				const Polygon& pB = rhs.getPolygon( j );
+
+				if ( pA == pB )
+				{
+					bFound = true;
+					bChecked[ i ] = true;
+					break;
+				}
+			}
+
+			if ( bFound == false )
+			{
+				OGRE_DELETE_ARRAY( bChecked );
+				return false;
+			}
+		}
+
+		for ( size_t i=0; i<getPolygonCount(); ++i )
+		{
+			if ( bChecked[ i ] != true )
+			{
+				OGRE_DELETE_ARRAY( bChecked );
+				return false;
+			}
+		}
+
+		OGRE_DELETE_ARRAY( bChecked );
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	std::ostream& operator<< ( std::ostream& strm, const ConvexBody& body )
+	{
+		strm << "POLYGON INFO (" << body.getPolygonCount() << ")" << std::endl;
+
+		for ( size_t i = 0; i < body.getPolygonCount(); ++i )
+		{
+			strm << "POLYGON " << i << ", ";
+			strm << body.getPolygon( i );
+		}
+
+		return strm;
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::insertPolygon(Polygon* pdata, size_t poly )
+	{
+		OgreAssert(poly <= getPolygonCount(), "Insert position out of range" );
+		OgreAssert( pdata != NULL, "Polygon is NULL" );
+
+		PolygonList::iterator it = mPolygons.begin();
+		std::advance(it, poly);
+
+		mPolygons.insert( it, pdata );
+
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::insertPolygon(Polygon* pdata)
+	{
+		OgreAssert( pdata != NULL, "Polygon is NULL" );
+
+		mPolygons.push_back( pdata );
+
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::insertVertex(size_t poly, const Vector3& vdata, size_t vertex )
+	{
+		OgreAssert(poly < getPolygonCount(), "Search position (polygon) out of range" );
+		
+		mPolygons[poly]->insertVertex(vdata, vertex);
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::insertVertex(size_t poly, const Vector3& vdata)
+	{
+		OgreAssert(poly < getPolygonCount(), "Search position (polygon) out of range" );
+
+		mPolygons[poly]->insertVertex(vdata);
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::deletePolygon(size_t poly)
+	{
+		OgreAssert(poly < getPolygonCount(), "Search position out of range" );
+
+		PolygonList::iterator it = mPolygons.begin();
+		std::advance(it, poly);
+		
+		freePolygon(*it);
+		mPolygons.erase(it);
+	}
+	//-----------------------------------------------------------------------
+	Polygon* ConvexBody::unlinkPolygon(size_t poly)
+	{
+		OgreAssert( poly >= 0 && poly < getPolygonCount(), "Search position out of range" );
+
+		PolygonList::iterator it = mPolygons.begin();
+		std::advance(it, poly);
+
+		// safe address
+		Polygon *pRet = *it;
+		
+		// delete entry
+		mPolygons.erase(it);	
+
+		// return polygon pointer
+
+		return pRet;
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::moveDataFromBody(ConvexBody& body)
+	{
+		body.mPolygons.swap(this->mPolygons);
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::deleteVertex(size_t poly, size_t vertex)
+	{
+		OgreAssert(poly < getPolygonCount(), "Search position out of range" );
+
+		mPolygons[poly]->deleteVertex(vertex);
+	}
+	//-----------------------------------------------------------------------
+	const Polygon& ConvexBody::getPolygon(size_t poly) const
+	{
+		OgreAssert(poly < getPolygonCount(), "Search position out of range");
+
+		return *mPolygons[poly];
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::setPolygon(Polygon* pdata, size_t poly)
+	{
+		OgreAssert(poly < getPolygonCount(), "Search position out of range" );
+		OgreAssert(pdata != NULL, "Polygon is NULL" );
+
+		if (pdata != mPolygons[poly])
+		{
+			// delete old polygon
+			freePolygon(mPolygons[ poly ]);
+
+			// set new polygon
+			mPolygons[poly] = pdata;
+		}
+	}
+	//-----------------------------------------------------------------------
+	const Vector3& ConvexBody::getVertex(size_t poly, size_t vertex) const
+	{
+		OgreAssert( poly >= 0 && poly < getPolygonCount(), "Search position out of range" );
+		
+		return mPolygons[poly]->getVertex(vertex);
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::setVertex(size_t poly, const Vector3& vdata, size_t vertex)
+	{
+		OgreAssert(poly < getPolygonCount(), "Search position out of range");
+		
+		mPolygons[poly]->setVertex(vdata, vertex);
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::storeEdgesOfPolygon(size_t poly, Polygon::EdgeMap *edgeMap ) const
+	{
+		OgreAssert(poly <= getPolygonCount(), "Search position out of range" );
+		OgreAssert( edgeMap != NULL, "TEdgeMap ptr is NULL" );
+
+		mPolygons[poly]->storeEdges(edgeMap);
+	}
+	//-----------------------------------------------------------------------
+	Polygon::EdgeMap ConvexBody::getSingleEdges() const
+	{
+		Polygon::EdgeMap edgeMap;
+
+		// put all edges of all polygons into a list every edge has to be
+		// walked in each direction once	
+		for ( size_t i = 0; i < getPolygonCount(); ++i )
+		{
+			const Polygon& p = getPolygon( i );
+
+			for ( size_t j = 0; j < p.getVertexCount(); ++j )
+			{
+				const Vector3& a = p.getVertex( j );
+				const Vector3& b = p.getVertex( ( j + 1 ) % p.getVertexCount() );
+
+				edgeMap.insert( Polygon::Edge( a, b ) );
+			}
+		}
+
+		// search corresponding parts
+		Polygon::EdgeMap::iterator it;
+		Polygon::EdgeMap::iterator itStart;
+		Polygon::EdgeMap::const_iterator itEnd;
+		while( !edgeMap.empty() )
+		{
+			it = edgeMap.begin(); ++it;	// start one element after itStart
+			itStart = edgeMap.begin();	// the element to be compared with the others
+			itEnd = edgeMap.end();		// beyond the last element
+			
+			bool bFound = false;
+
+			for ( ; it != itEnd; ++it )
+			{
+				if (itStart->first.positionEquals(it->second) &&
+					 itStart->second.positionEquals(it->first))
+				{
+					// erase itStart and it
+					edgeMap.erase( it );
+					edgeMap.erase( itStart );
+
+					bFound = true;
+
+					break; // found
+				}
+			}
+
+			if ( bFound == false )
+			{
+				break;	// not all edges could be matched
+						// body is not closed
+			}
+		}
+
+		return edgeMap;
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::allocateSpace( size_t numPolygons, size_t numVertices )
+	{
+		reset();
+
+		// allocate numPolygons polygons with each numVertices vertices
+		for ( size_t iPoly = 0; iPoly < numPolygons; ++iPoly )
+		{
+			Polygon *poly = allocatePolygon();
+
+			for ( size_t iVertex = 0; iVertex < numVertices; ++iVertex )
+			{
+				poly->insertVertex( Vector3::ZERO );
+			}
+
+			mPolygons.push_back( poly );
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::clip( const Plane& pl, bool keepNegative )
+	{
+		if ( getPolygonCount() == 0 )
+			return;
+
+		// current will be used as the reference body
+		ConvexBody current;
+		current.moveDataFromBody(*this);
+		
+		OgreAssert( this->getPolygonCount() == 0, "Body not empty!" );
+		OgreAssert( current.getPolygonCount() != 0, "Body empty!" );
+
+		// holds all intersection edges for the different polygons
+		Polygon::EdgeMap intersectionEdges;
+
+		// clip all polygons by the intersection plane
+		// add only valid or intersected polygons to *this
+		for ( size_t iPoly = 0; iPoly < current.getPolygonCount(); ++iPoly )
+		{
+
+			// fetch vertex count and ignore polygons with less than three vertices
+			// the polygon is not valid and won't be added
+			const size_t vertexCount = current.getVertexCount( iPoly );
+			if ( vertexCount < 3 )
+				continue;
+
+			// current polygon
+			const Polygon& p = current.getPolygon( iPoly );
+
+			// the polygon to assemble
+			Polygon *pNew = allocatePolygon();
+
+			// the intersection polygon (indeed it's an edge or it's empty)
+			Polygon *pIntersect = allocatePolygon();
+			
+			// check if polygons lie inside or outside (or on the plane)
+			// for each vertex check where it is situated in regard to the plane
+			// three possibilities appear:
+			Plane::Side clipSide = keepNegative ? Plane::POSITIVE_SIDE : Plane::NEGATIVE_SIDE;
+			// - side is clipSide: vertex will be clipped
+			// - side is !clipSide: vertex will be untouched
+			// - side is NOSIDE:   vertex will be untouched
+			Plane::Side *side = new Plane::Side[ vertexCount ];
+			for ( size_t iVertex = 0; iVertex < vertexCount; ++iVertex )
+			{
+				side[ iVertex ] = pl.getSide( p.getVertex( iVertex ) );
+			}
+
+			// now we check the side combinations for the current and the next vertex
+			// four different combinations exist:
+			// - both points inside (or on the plane): keep the second (add it to the body)
+			// - both points outside: discard both (don't add them to the body)
+			// - first vertex is inside, second is outside: add the intersection point
+			// - first vertex is outside, second is inside: add the intersection point, then the second
+			for ( size_t iVertex = 0; iVertex < vertexCount; ++iVertex )
+			{
+				// determine the next vertex
+				size_t iNextVertex = ( iVertex + 1 ) % vertexCount;
+
+				const Vector3& vCurrent = p.getVertex( iVertex );
+				const Vector3& vNext    = p.getVertex( iNextVertex );
+
+				// case 1: both points inside (store next)
+				if ( side[ iVertex ]     != clipSide &&		// NEGATIVE or NONE
+					 side[ iNextVertex ] != clipSide )		// NEGATIVE or NONE
+				{
+					// keep the second
+					pNew->insertVertex( vNext );
+				}
+
+				// case 3: inside -> outside (store intersection)
+				else if ( side[ iVertex ]		!= clipSide &&
+						  side[ iNextVertex ]	== clipSide )
+				{
+					// Do an intersection with the plane. We use a ray with a start point and a direction.
+					// The ray is forced to hit the plane with any option available (eigher current or next
+					// is the starting point)
+
+					// intersect from the outside vertex towards the inside one
+					Vector3 vDirection = vCurrent - vNext;
+					vDirection.normalise();
+					Ray ray( vNext, vDirection );
+					std::pair< bool, Real > intersect = ray.intersects( pl );
+
+					// store intersection
+					if ( intersect.first )
+					{
+						// convert distance to vector
+						Vector3 vIntersect = ray.getPoint( intersect.second );	
+
+						// store intersection
+						pNew->insertVertex( vIntersect );
+						pIntersect->insertVertex( vIntersect );
+					}
+				}
+
+				// case 4: outside -> inside (store intersection, store next)
+				else if ( side[ iVertex ]		== clipSide &&
+					side[ iNextVertex ]			!= clipSide )
+				{
+					// Do an intersection with the plane. We use a ray with a start point and a direction.
+					// The ray is forced to hit the plane with any option available (eigher current or next
+					// is the starting point)
+
+					// intersect from the outside vertex towards the inside one
+					Vector3 vDirection = vNext - vCurrent;
+					vDirection.normalise();
+					Ray ray( vCurrent, vDirection );
+					std::pair< bool, Real > intersect = ray.intersects( pl );
+
+					// store intersection
+					if ( intersect.first )
+					{
+						// convert distance to vector
+						Vector3 vIntersect = ray.getPoint( intersect.second );
+
+						// store intersection
+						pNew->insertVertex( vIntersect );
+						pIntersect->insertVertex( vIntersect );
+					}
+
+					pNew->insertVertex( vNext );
+
+				}
+				// else:
+				// case 2: both outside (do nothing)
+					
+			}
+
+			// insert the polygon only, if at least three vertices are present
+			if ( pNew->getVertexCount() >= 3 )
+			{
+				// in case there are double vertices, remove them
+				pNew->removeDuplicates();
+
+				// in case there are still at least three vertices, insert the polygon
+				if ( pNew->getVertexCount() >= 3 )
+				{
+					this->insertPolygon( pNew );
+				}
+				else
+				{
+					// delete pNew because it's empty or invalid
+					freePolygon(pNew);
+					pNew = 0;
+				}
+			}
+			else
+			{
+				// delete pNew because it's empty or invalid
+				freePolygon(pNew);
+				pNew = 0;
+			}
+
+			// insert intersection polygon only, if there are two vertices present
+			if ( pIntersect->getVertexCount() == 2 )
+			{
+				intersectionEdges.insert( Polygon::Edge( pIntersect->getVertex( 0 ),
+														  pIntersect->getVertex( 1 ) ) );
+			}
+
+			// delete intersection polygon
+			// vertices were copied (if there were any)
+			freePolygon(pIntersect);
+			pIntersect = 0;
+
+			// delete side info
+			OGRE_DELETE_ARRAY( side );
+		}
+
+		// if the polygon was partially clipped, close it
+		// at least three edges are needed for a polygon
+		if ( intersectionEdges.size() >= 3 )
+		{
+			Polygon *pClosing = allocatePolygon();
+
+			// Analyze the intersection list and insert the intersection points in ccw order
+			// Each point is twice in the list because of the fact that we have a convex body
+			// with convex polygons. All we have to do is order the edges (an even-odd pair)
+			// in a ccw order. The plane normal shows us the direction.
+			Polygon::EdgeMap::iterator it = intersectionEdges.begin();
+
+			// check the cross product of the first two edges
+			const Vector3& vFirst  = it->first;
+			const Vector3& vSecond = it->second;
+
+			// remove inserted edge
+			intersectionEdges.erase( it );
+
+			Vector3 vNext;
+
+			// find mating edge
+			if (findAndEraseEdgePair(vSecond, intersectionEdges, vNext))
+			{
+				// detect the orientation
+				// the polygon must have the same normal direction as the plane and then n
+				Vector3 vCross = ( vFirst - vSecond ).crossProduct( vNext - vSecond );
+				bool frontside = ( pl.normal ).directionEquals( vCross, Degree( 1 ) );
+
+				// first inserted vertex
+				Vector3 firstVertex;
+				// currently inserted vertex
+				Vector3 currentVertex;
+				// direction equals -> front side (walk ccw)
+				if ( frontside )
+				{
+					// start with next as first vertex, then second, then first and continue with first to walk ccw
+					pClosing->insertVertex( vNext );
+					pClosing->insertVertex( vSecond );
+					pClosing->insertVertex( vFirst );
+					firstVertex		= vNext;
+					currentVertex	= vFirst;
+
+				#ifdef _DEBUG_INTERSECTION_LIST
+					std::cout << "Plane: n=" << pl.normal << ", d=" << pl.d << std::endl;
+					std::cout << "First inserted vertex: " << *next << std::endl;
+					std::cout << "Second inserted vertex: " << *vSecond << std::endl;
+					std::cout << "Third inserted vertex: " << *vFirst << std::endl;
+				#endif
+				}
+				// direction does not equal -> back side (walk cw)
+				else
+				{
+					// start with first as first vertex, then second, then next and continue with next to walk ccw
+					pClosing->insertVertex( vFirst );
+					pClosing->insertVertex( vSecond );
+					pClosing->insertVertex( vNext );
+					firstVertex		= vFirst;
+					currentVertex	= vNext;
+
+					#ifdef _DEBUG_INTERSECTION_LIST
+						std::cout << "Plane: n=" << pl.normal << ", d=" << pl.d << std::endl;
+						std::cout << "First inserted vertex: " << *vFirst << std::endl;
+						std::cout << "Second inserted vertex: " << *vSecond << std::endl;
+						std::cout << "Third inserted vertex: " << *next << std::endl;
+					#endif
+				}
+
+				// search mating edges that have a point in common
+				// continue this operation as long as edges are present
+				while ( !intersectionEdges.empty() )
+				{
+
+					if (findAndEraseEdgePair(currentVertex, intersectionEdges, vNext))
+					{
+						// insert only if it's not the last (which equals the first) vertex
+						if ( !intersectionEdges.empty() )
+						{
+							currentVertex = vNext;
+							pClosing->insertVertex( vNext );
+						}
+					}
+					else
+					{
+						// degenerated...
+						break;
+					}
+
+				} // while intersectionEdges not empty
+
+				// insert polygon (may be degenerated!)
+				this->insertPolygon( pClosing );
+
+			}
+			// mating intersection edge NOT found!
+			else
+			{
+				freePolygon(pClosing);
+			}
+
+		} // if intersectionEdges contains more than three elements
+	}
+	//-----------------------------------------------------------------------
+	bool ConvexBody::findAndEraseEdgePair(const Vector3& vec, 
+		Polygon::EdgeMap& intersectionEdges, Vector3& vNext ) const
+	{
+		Polygon::EdgeMap::iterator it = intersectionEdges.begin();
+
+		for (Polygon::EdgeMap::iterator it = intersectionEdges.begin(); 
+			it != intersectionEdges.end(); ++it)
+		{
+			if (it->first.positionEquals(vec))
+			{
+				vNext = it->second;
+
+				// erase found edge
+				intersectionEdges.erase( it );
+
+				return true; // found!
+			}
+			else if (it->second.positionEquals(vec))
+			{
+				vNext = it->first;
+
+				// erase found edge
+				intersectionEdges.erase( it );
+
+				return true; // found!
+			}
+		}
+
+		return false; // not found!
+	}
+	//-----------------------------------------------------------------------
+	void ConvexBody::logInfo( void ) const
+	{
+		std::stringstream ssOut( std::stringstream::out );
+		ssOut << *this;
+		
+		Ogre::LogManager::getSingleton().logMessage( Ogre::LML_NORMAL, ssOut.str()  );
+	}
+}
+
Index: /OgreMain/src/OgreDDSCodec.cpp
===================================================================
--- /OgreMain/src/OgreDDSCodec.cpp	(revision 5)
+++ /OgreMain/src/OgreDDSCodec.cpp	(revision 5)
@@ -0,0 +1,741 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreStableHeaders.h"
+
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreDDSCodec.h"
+#include "OgreImage.h"
+#include "OgreException.h"
+
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+
+
+namespace Ogre {
+	// Internal DDS structure definitions
+#define FOURCC(c0, c1, c2, c3) (c0 | (c1 << 8) | (c2 << 16) | (c3 << 24))
+	
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+#pragma pack (push, 1)
+#else
+#pragma pack (1)
+#endif
+
+	// Nested structure
+	struct DDSPixelFormat
+	{
+		uint32 size;
+		uint32 flags;
+		uint32 fourCC;
+		uint32 rgbBits;
+		uint32 redMask;
+		uint32 greenMask;
+		uint32 blueMask;
+		uint32 alphaMask;
+	};
+	
+	// Nested structure
+	struct DDSCaps
+	{
+		uint32 caps1;
+		uint32 caps2;
+		uint32 reserved[2];
+	};
+	// Main header, note preceded by 'DDS '
+	struct DDSHeader
+	{
+		uint32 size;		
+		uint32 flags;
+		uint32 height;
+		uint32 width;
+		uint32 sizeOrPitch;
+		uint32 depth;
+		uint32 mipMapCount;
+		uint32 reserved1[11];
+		DDSPixelFormat pixelFormat;
+		DDSCaps caps;
+		uint32 reserved2;
+	};
+
+	// An 8-byte DXT colour block, represents a 4x4 texel area. Used by all DXT formats
+	struct DXTColourBlock
+	{
+		// 2 colour ranges
+		uint16 colour_0;
+		uint16 colour_1;
+		// 16 2-bit indexes, each byte here is one row
+		uint8 indexRow[4];
+	};
+	// An 8-byte DXT explicit alpha block, represents a 4x4 texel area. Used by DXT2/3
+	struct DXTExplicitAlphaBlock
+	{
+		// 16 4-bit values, each 16-bit value is one row
+		uint16 alphaRow[4];
+	};
+	// An 8-byte DXT interpolated alpha block, represents a 4x4 texel area. Used by DXT4/5
+	struct DXTInterpolatedAlphaBlock
+	{
+		// 2 alpha ranges
+		uint8 alpha_0;
+		uint8 alpha_1;
+		// 16 3-bit indexes. Unfortunately 3 bits doesn't map too well to row bytes
+		// so just stored raw
+		uint8 indexes[6];
+	};
+	
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+#pragma pack (pop)
+#else
+#pragma pack ()
+#endif
+
+	const uint32 DDS_PIXELFORMAT_SIZE = 8 * sizeof(uint32);
+	const uint32 DDS_CAPS_SIZE = 4 * sizeof(uint32);
+	const uint32 DDS_HEADER_SIZE = 19 * sizeof(uint32) + DDS_PIXELFORMAT_SIZE + DDS_CAPS_SIZE;
+
+	const uint32 DDSD_CAPS = 0x00000001;
+	const uint32 DDSD_HEIGHT = 0x00000002;
+	const uint32 DDSD_WIDTH = 0x00000004;
+	const uint32 DDSD_PITCH = 0x00000008;
+	const uint32 DDSD_PIXELFORMAT = 0x00001000;
+	const uint32 DDSD_MIPMAPCOUNT = 0x00020000;
+	const uint32 DDSD_LINEARSIZE = 0x00080000;
+	const uint32 DDSD_DEPTH = 0x00800000;
+	const uint32 DDPF_ALPHAPIXELS = 0x00000001;
+	const uint32 DDPF_FOURCC = 0x00000004;
+	const uint32 DDPF_RGB = 0x00000040;
+	const uint32 DDSCAPS_COMPLEX = 0x00000008;
+	const uint32 DDSCAPS_TEXTURE = 0x00001000;
+	const uint32 DDSCAPS_MIPMAP = 0x00400000;
+	const uint32 DDSCAPS2_CUBEMAP = 0x00000200;
+	const uint32 DDSCAPS2_CUBEMAP_POSITIVEX = 0x00000400;
+	const uint32 DDSCAPS2_CUBEMAP_NEGATIVEX = 0x00000800;
+	const uint32 DDSCAPS2_CUBEMAP_POSITIVEY = 0x00001000;
+	const uint32 DDSCAPS2_CUBEMAP_NEGATIVEY = 0x00002000;
+	const uint32 DDSCAPS2_CUBEMAP_POSITIVEZ = 0x00004000;
+	const uint32 DDSCAPS2_CUBEMAP_NEGATIVEZ = 0x00008000;
+	const uint32 DDSCAPS2_VOLUME = 0x00200000;
+
+	// Special FourCC codes
+	const uint32 D3DFMT_R16F			= 111;
+	const uint32 D3DFMT_G16R16F			= 112;
+	const uint32 D3DFMT_A16B16G16R16F	= 113;
+	const uint32 D3DFMT_R32F            = 114;
+	const uint32 D3DFMT_G32R32F         = 115;
+	const uint32 D3DFMT_A32B32G32R32F   = 116;
+
+
+	//---------------------------------------------------------------------
+	DDSCodec* DDSCodec::msInstance = 0;
+	//---------------------------------------------------------------------
+	void DDSCodec::startup(void)
+	{
+		if (!msInstance)
+		{
+
+			LogManager::getSingleton().logMessage(
+				LML_NORMAL,
+				"DDS codec registering");
+
+			msInstance = new DDSCodec();
+			Codec::registerCodec(msInstance);
+		}
+
+	}
+	//---------------------------------------------------------------------
+	void DDSCodec::shutdown(void)
+	{
+		if(msInstance)
+		{
+			Codec::unRegisterCodec(msInstance);
+			delete msInstance;
+			msInstance = 0;
+		}
+
+	}
+	//---------------------------------------------------------------------
+    DDSCodec::DDSCodec():
+        mType("dds")
+    { 
+    }
+    //---------------------------------------------------------------------
+    DataStreamPtr DDSCodec::code(MemoryDataStreamPtr& input, Codec::CodecDataPtr& pData) const
+    {        
+		OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED,
+			"DDS encoding not supported",
+			"DDSCodec::code" ) ;
+    }
+    //---------------------------------------------------------------------
+    void DDSCodec::codeToFile(MemoryDataStreamPtr& input, 
+        const String& outFileName, Codec::CodecDataPtr& pData) const
+    {
+		OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED,
+			"DDS encoding not supported",
+			"DDSCodec::codeToFile" ) ;
+    }
+	//---------------------------------------------------------------------
+	PixelFormat DDSCodec::convertFourCCFormat(uint32 fourcc) const
+	{
+		// convert dxt pixel format
+		switch(fourcc)
+		{
+		case FOURCC('D','X','T','1'):
+			return PF_DXT1;
+		case FOURCC('D','X','T','2'):
+			return PF_DXT2;
+		case FOURCC('D','X','T','3'):
+			return PF_DXT3;
+		case FOURCC('D','X','T','4'):
+			return PF_DXT4;
+		case FOURCC('D','X','T','5'):
+			return PF_DXT5;
+		case D3DFMT_R16F:
+			return PF_FLOAT16_R;
+		case D3DFMT_G16R16F:
+			return PF_FLOAT16_GR;
+		case D3DFMT_A16B16G16R16F:
+			return PF_FLOAT16_RGBA;
+		case D3DFMT_R32F:
+			return PF_FLOAT32_R;
+		case D3DFMT_G32R32F:
+			return PF_FLOAT32_GR;
+		case D3DFMT_A32B32G32R32F:
+			return PF_FLOAT32_RGBA;
+		// We could support 3Dc here, but only ATI cards support it, not nVidia
+		default:
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Unsupported FourCC format found in DDS file", 
+				"DDSCodec::decode");
+		};
+
+	}
+	//---------------------------------------------------------------------
+	PixelFormat DDSCodec::convertPixelFormat(uint32 rgbBits, uint32 rMask, 
+		uint32 gMask, uint32 bMask, uint32 aMask) const
+	{
+		// General search through pixel formats
+		for (int i = PF_UNKNOWN + 1; i < PF_COUNT; ++i)
+		{
+			PixelFormat pf = static_cast<PixelFormat>(i);
+			if (PixelUtil::getNumElemBits(pf) == rgbBits)
+			{
+				uint32 testMasks[4];
+				PixelUtil::getBitMasks(pf, testMasks);
+				int testBits[4];
+				PixelUtil::getBitDepths(pf, testBits);
+				if (testMasks[0] == rMask && testMasks[1] == gMask &&
+					testMasks[2] == bMask && 
+					// for alpha, deal with 'X8' formats by checking bit counts
+					(testMasks[3] == aMask || (aMask == 0 && testBits[3] == 0)))
+				{
+					return pf;
+				}
+			}
+
+		}
+
+		OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Cannot determine pixel format",
+			"DDSCodec::convertPixelFormat");
+
+	}
+	//---------------------------------------------------------------------
+	void DDSCodec::unpackDXTColour(PixelFormat pf, const DXTColourBlock& block, 
+		ColourValue* pCol) const
+	{
+		// Note - we assume all values have already been endian swapped
+
+		// Colour lookup table
+		ColourValue derivedColours[4];
+
+		if (pf == PF_DXT1 && block.colour_0 <= block.colour_1)
+		{
+			// 1-bit alpha
+			PixelUtil::unpackColour(&(derivedColours[0]), PF_R5G6B5, &(block.colour_0));
+			PixelUtil::unpackColour(&(derivedColours[1]), PF_R5G6B5, &(block.colour_1));
+			// one intermediate colour, half way between the other two
+			derivedColours[2] = (derivedColours[0] + derivedColours[1]) / 2;
+			// transparent colour
+			derivedColours[3] = ColourValue::ZERO;
+		}
+		else
+		{
+			PixelUtil::unpackColour(&(derivedColours[0]), PF_R5G6B5, &(block.colour_0));
+			PixelUtil::unpackColour(&(derivedColours[1]), PF_R5G6B5, &(block.colour_1));
+			// first interpolated colour, 1/3 of the way along
+			derivedColours[2] = (2 * derivedColours[0] + derivedColours[1]) / 3;
+			// second interpolated colour, 2/3 of the way along
+			derivedColours[3] = (derivedColours[0] + 2 * derivedColours[1]) / 3;
+		}
+
+		// Process 4x4 block of texels
+		for (size_t row = 0; row < 4; ++row)
+		{
+			for (size_t x = 0; x < 4; ++x)
+			{
+				// LSB come first
+				uint8 colIdx = static_cast<uint8>(block.indexRow[row] >> (x * 2) & 0x3);
+				if (pf == PF_DXT1)
+				{
+					// Overwrite entire colour
+					pCol[(row * 4) + x] = derivedColours[colIdx];
+				}
+				else
+				{
+					// alpha has already been read (alpha precedes colour)
+					ColourValue& col = pCol[(row * 4) + x];
+					col.r = derivedColours[colIdx].r;
+					col.g = derivedColours[colIdx].g;
+					col.b = derivedColours[colIdx].b;
+				}
+			}
+
+		}
+
+
+	}
+	//---------------------------------------------------------------------
+	void DDSCodec::unpackDXTAlpha(
+		const DXTExplicitAlphaBlock& block, ColourValue* pCol) const
+	{
+		// Note - we assume all values have already been endian swapped
+		
+		// This is an explicit alpha block, 4 bits per pixel, LSB first
+		for (size_t row = 0; row < 4; ++row)
+		{
+			for (size_t x = 0; x < 4; ++x)
+			{
+				// Shift and mask off to 4 bits
+				uint8 val = static_cast<uint8>(block.alphaRow[row] >> (x * 4) & 0xF);
+				// Convert to [0,1]
+				pCol->a = (Real)val / (Real)0xF;
+				pCol++;
+				
+			}
+			
+		}
+
+	}
+	//---------------------------------------------------------------------
+	void DDSCodec::unpackDXTAlpha(
+		const DXTInterpolatedAlphaBlock& block, ColourValue* pCol) const
+	{
+		// 8 derived alpha values to be indexed
+		Real derivedAlphas[8];
+
+		// Explicit extremes
+		derivedAlphas[0] = block.alpha_0 / (Real)0xFF;
+		derivedAlphas[1] = block.alpha_1 / (Real)0xFF;
+		
+		
+		if (block.alpha_0 <= block.alpha_1)
+		{
+			// 4 interpolated alphas, plus zero and one			
+			// full range including extremes at [0] and [5]
+			// we want to fill in [1] through [4] at weights ranging
+			// from 1/5 to 4/5
+			Real denom = 1.0f / 5.0f;
+			for (size_t i = 0; i < 4; ++i) 
+			{
+				Real factor0 = (4 - i) * denom;
+				Real factor1 = (i + 1) * denom;
+				derivedAlphas[i + 2] = 
+					(factor0 * block.alpha_0) + (factor1 * block.alpha_1);
+			}
+			derivedAlphas[6] = 0.0f;
+			derivedAlphas[7] = 1.0f;
+
+		}
+		else
+		{
+			// 6 interpolated alphas
+			// full range including extremes at [0] and [7]
+			// we want to fill in [1] through [6] at weights ranging
+			// from 1/7 to 6/7
+			Real denom = 1.0f / 7.0f;
+			for (size_t i = 0; i < 6; ++i) 
+			{
+				Real factor0 = (6 - i) * denom;
+				Real factor1 = (i + 1) * denom;
+				derivedAlphas[i + 2] = 
+					(factor0 * block.alpha_0) + (factor1 * block.alpha_1);
+			}
+			
+		}
+
+		// Ok, now we've built the reference values, process the indexes
+		for (size_t i = 0; i < 16; ++i)
+		{
+			size_t baseByte = (i * 3) / 8;
+			size_t baseBit = (i * 3) % 8;
+			uint8 bits = static_cast<uint8>(block.indexes[baseByte] >> baseBit & 0x7);
+			// do we need to stitch in next byte too?
+			if (baseBit > 5)
+			{
+				uint8 extraBits = static_cast<uint8>(
+					(block.indexes[baseByte+1] << (8 - baseBit)) & 0xFF);
+				bits |= extraBits & 0x7;
+			}
+			pCol[i].a = derivedAlphas[bits];
+
+		}
+
+	}
+    //---------------------------------------------------------------------
+    Codec::DecodeResult DDSCodec::decode(DataStreamPtr& stream) const
+    {
+		// Read 4 character code
+		uint32 fileType;
+		stream->read(&fileType, sizeof(uint32));
+		flipEndian(&fileType, sizeof(uint32), 1);
+		
+		if (FOURCC('D', 'D', 'S', ' ') != fileType)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"This is not a DDS file!", "DDSCodec::decode");
+		}
+		
+		// Read header in full
+		DDSHeader header;
+		stream->read(&header, sizeof(DDSHeader));
+
+		// Endian flip if required, all 32-bit values
+		flipEndian(&header, 4, sizeof(DDSHeader) / 4);
+
+		// Check some sizes
+		if (header.size != DDS_HEADER_SIZE)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"DDS header size mismatch!", "DDSCodec::decode");
+		}
+		if (header.pixelFormat.size != DDS_PIXELFORMAT_SIZE)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"DDS header size mismatch!", "DDSCodec::decode");
+		}
+
+		ImageData* imgData = new ImageData();
+		MemoryDataStreamPtr output;
+
+		imgData->depth = 1; // (deal with volume later)
+		imgData->width = header.width;
+		imgData->height = header.height;
+		size_t numFaces = 1; // assume one face until we know otherwise
+
+		if (header.caps.caps1 & DDSCAPS_MIPMAP)
+		{
+	        imgData->num_mipmaps = header.mipMapCount - 1;
+		}
+		else
+		{
+			imgData->num_mipmaps = 0;
+		}
+		imgData->flags = 0;
+
+		bool decompressDXT = false;
+		// Figure out basic image type
+		if (header.caps.caps2 & DDSCAPS2_CUBEMAP)
+		{
+			imgData->flags |= IF_CUBEMAP;
+			numFaces = 6;
+		}
+		else if (header.caps.caps2 & DDSCAPS2_VOLUME)
+		{
+			imgData->flags |= IF_3D_TEXTURE;
+			imgData->depth = header.depth;
+		}
+		// Pixel format
+		PixelFormat sourceFormat = PF_UNKNOWN;
+
+		if (header.pixelFormat.flags & DDPF_FOURCC)
+		{
+			sourceFormat = convertFourCCFormat(header.pixelFormat.fourCC);
+		}
+		else
+		{
+			sourceFormat = convertPixelFormat(header.pixelFormat.rgbBits, 
+				header.pixelFormat.redMask, header.pixelFormat.greenMask, 
+				header.pixelFormat.blueMask, 
+				header.pixelFormat.flags & DDPF_ALPHAPIXELS ? 
+				header.pixelFormat.alphaMask : 0);
+		}
+
+		if (PixelUtil::isCompressed(sourceFormat))
+		{
+			if (!Root::getSingleton().getRenderSystem()->getCapabilities()
+				->hasCapability(RSC_TEXTURE_COMPRESSION_DXT))
+			{
+				// We'll need to decompress
+				decompressDXT = true;
+				// Convert format
+				switch (sourceFormat)
+				{
+				case PF_DXT1:
+					// source can be either 565 or 5551 depending on whether alpha present
+					// unfortunately you have to read a block to figure out which
+					// Note that we upgrade to 32-bit pixel formats here, even 
+					// though the source is 16-bit; this is because the interpolated
+					// values will benefit from the 32-bit results, and the source
+					// from which the 16-bit samples are calculated may have been
+					// 32-bit so can benefit from this.
+					DXTColourBlock block;
+					stream->read(&block, sizeof(DXTColourBlock));
+					flipEndian(&(block.colour_0), sizeof(uint16), 1);
+					flipEndian(&(block.colour_1), sizeof(uint16), 1);
+					// skip back since we'll need to read this again
+					stream->skip(0 - sizeof(DXTColourBlock));
+					// colour_0 <= colour_1 means transparency in DXT1
+					if (block.colour_0 <= block.colour_1)
+					{
+						imgData->format = PF_BYTE_RGBA;
+					}
+					else
+					{
+						imgData->format = PF_BYTE_RGB;
+					}
+					break;
+				case PF_DXT2:
+				case PF_DXT3:
+				case PF_DXT4:
+				case PF_DXT5:
+					// full alpha present, formats vary only in encoding 
+					imgData->format = PF_BYTE_RGBA;
+					break;
+                default:
+                    // all other cases need no special format handling
+                    break;
+				}
+			}
+			else
+			{
+				// Use original format
+				imgData->format = sourceFormat;
+				// Keep DXT data compressed
+				imgData->flags |= IF_COMPRESSED;
+			}
+		}
+		else // not compressed
+		{
+			// Don't test against DDPF_RGB since greyscale DDS doesn't set this
+			// just derive any other kind of format
+			imgData->format = sourceFormat;
+		}
+
+		// Calculate total size from number of mipmaps, faces and size
+		imgData->size = Image::calculateSize(imgData->num_mipmaps, numFaces, 
+			imgData->width, imgData->height, imgData->depth, imgData->format);
+
+		// Bind output buffer
+		output.bind(new MemoryDataStream(imgData->size));
+
+		
+		// Now deal with the data
+		void* destPtr = output->getPtr();
+
+		// all mips for a face, then each face
+		for(size_t i = 0; i < numFaces; ++i)
+		{   
+			size_t width = imgData->width;
+			size_t height = imgData->height;
+			size_t depth = imgData->depth;
+
+			for(size_t mip = 0; mip <= imgData->num_mipmaps; ++mip)
+			{
+				size_t dstPitch = width * PixelUtil::getNumElemBytes(imgData->format);
+
+				if (PixelUtil::isCompressed(sourceFormat))
+				{
+					// Compressed data
+					if (decompressDXT)
+					{
+						DXTColourBlock col;
+						DXTInterpolatedAlphaBlock iAlpha;
+						DXTExplicitAlphaBlock eAlpha;
+						// 4x4 block of decompressed colour
+						ColourValue tempColours[16];
+						size_t destBpp = PixelUtil::getNumElemBytes(imgData->format);
+						size_t destPitchMinus4 = dstPitch - destBpp * 4;
+						// slices are done individually
+						for(size_t z = 0; z < depth; ++z)
+						{
+							// 4x4 blocks in x/y
+							for (size_t y = 0; y < height; y += 4)
+							{
+								for (size_t x = 0; x < width; x += 4)
+								{
+									if (sourceFormat == PF_DXT2 || 
+										sourceFormat == PF_DXT3)
+									{
+										// explicit alpha
+										stream->read(&eAlpha, sizeof(DXTExplicitAlphaBlock));
+										flipEndian(eAlpha.alphaRow, sizeof(uint16), 4);
+										unpackDXTAlpha(eAlpha, tempColours) ;
+									}
+									else if (sourceFormat == PF_DXT4 || 
+										sourceFormat == PF_DXT5)
+									{
+										// interpolated alpha
+										stream->read(&iAlpha, sizeof(DXTInterpolatedAlphaBlock));
+										flipEndian(&(iAlpha.alpha_0), sizeof(uint16), 1);
+										flipEndian(&(iAlpha.alpha_1), sizeof(uint16), 1);
+										unpackDXTAlpha(iAlpha, tempColours) ;
+									}
+									// always read colour
+									stream->read(&col, sizeof(DXTColourBlock));
+									flipEndian(&(col.colour_0), sizeof(uint16), 1);
+									flipEndian(&(col.colour_1), sizeof(uint16), 1);
+									unpackDXTColour(sourceFormat, col, tempColours);
+
+									// write 4x4 block to uncompressed version
+									for (size_t by = 0; by < 4; ++by)
+									{
+										for (size_t bx = 0; bx < 4; ++bx)
+										{
+											PixelUtil::packColour(tempColours[by*4+bx],
+												imgData->format, destPtr);
+											destPtr = static_cast<void*>(
+												static_cast<uchar*>(destPtr) + destBpp);
+										}
+										// advance to next row
+										destPtr = static_cast<void*>(
+											static_cast<uchar*>(destPtr) + destPitchMinus4);
+									}
+									// next block. Our dest pointer is 4 lines down
+									// from where it started
+									if (x + 4 == width)
+									{
+										// Jump back to the start of the line
+										destPtr = static_cast<void*>(
+											static_cast<uchar*>(destPtr) - destPitchMinus4);
+									}
+									else
+									{
+										// Jump back up 4 rows and 4 pixels to the
+										// right to be at the next block to the right
+										destPtr = static_cast<void*>(
+											static_cast<uchar*>(destPtr) - dstPitch * 4 + destBpp * 4);
+
+									}
+
+								}
+
+							}
+						}
+
+					}
+					else
+					{
+						// load directly
+						// DDS format lies! sizeOrPitch is not always set for DXT!!
+						size_t dxtSize = PixelUtil::getMemorySize(width, height, depth, imgData->format);
+						stream->read(destPtr, dxtSize);
+						destPtr = static_cast<void*>(static_cast<uchar*>(destPtr) + dxtSize);
+					}
+
+				}
+				else
+				{
+					// Final data - trim incoming pitch
+					size_t srcPitch;
+					if (header.flags & DDSD_PITCH)
+					{
+						srcPitch = header.sizeOrPitch / 
+							std::max((size_t)1, mip * 2);
+					}
+					else
+					{
+						// assume same as final pitch
+						srcPitch = dstPitch;
+					}
+					assert (dstPitch <= srcPitch);
+					long srcAdvance = static_cast<long>(srcPitch) - static_cast<long>(dstPitch);
+
+					for (size_t z = 0; z < imgData->depth; ++z)
+					{
+						for (size_t y = 0; y < imgData->height; ++y)
+						{
+							stream->read(destPtr, dstPitch);
+							if (srcAdvance > 0)
+								stream->skip(srcAdvance);
+
+							destPtr = static_cast<void*>(static_cast<uchar*>(destPtr) + dstPitch);
+						}
+					}
+
+				}
+
+				
+				/// Next mip
+				if(width!=1) width /= 2;
+				if(height!=1) height /= 2;
+				if(depth!=1) depth /= 2;
+			}
+
+		}
+
+		DecodeResult ret;
+		ret.first = output;
+		ret.second = CodecDataPtr(imgData);
+		return ret;
+		
+
+
+    }
+    //---------------------------------------------------------------------    
+    String DDSCodec::getType() const 
+    {
+        return mType;
+    }
+    //---------------------------------------------------------------------    
+    void DDSCodec::flipEndian(void * pData, size_t size, size_t count) const
+    {
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+		for(unsigned int index = 0; index < count; index++)
+        {
+            flipEndian((void *)((long)pData + (index * size)), size);
+        }
+#endif
+    }
+    //---------------------------------------------------------------------    
+    void DDSCodec::flipEndian(void * pData, size_t size) const
+    {
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+        char swapByte;
+        for(unsigned int byteIndex = 0; byteIndex < size/2; byteIndex++)
+        {
+            swapByte = *(char *)((long)pData + byteIndex);
+            *(char *)((long)pData + byteIndex) = *(char *)((long)pData + size - byteIndex - 1);
+            *(char *)((long)pData + size - byteIndex - 1) = swapByte;
+        }
+#endif
+    }
+	
+}
+
Index: /OgreMain/src/OgreDataStream.cpp
===================================================================
--- /OgreMain/src/OgreDataStream.cpp	(revision 5)
+++ /OgreMain/src/OgreDataStream.cpp	(revision 5)
@@ -0,0 +1,604 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreDataStream.h"
+#include "OgreLogManager.h"
+#include "OgreException.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    template <typename T> DataStream& DataStream::operator >>(T& val)
+    {
+        read(static_cast<void*>(&val), sizeof(T));
+        return *this;
+    }
+    //-----------------------------------------------------------------------
+    String DataStream::getLine(bool trimAfter)
+    {
+        char tmpBuf[OGRE_STREAM_TEMP_SIZE];
+        String retString;
+        size_t readCount;
+        // Keep looping while not hitting delimiter
+        while ((readCount = read(tmpBuf, OGRE_STREAM_TEMP_SIZE-1)) != 0)
+        {
+            // Terminate string
+            tmpBuf[readCount] = '\0';
+
+            char* p = strchr(tmpBuf, '\n');
+            if (p != 0)
+            {
+                // Reposition backwards
+                skip((long)(p + 1 - tmpBuf - readCount));
+                *p = '\0';
+            }
+
+            retString += tmpBuf;
+
+            if (p != 0)
+            {
+                // Trim off trailing CR if this was a CR/LF entry
+                if (retString.length() && retString[retString.length()-1] == '\r')
+                {
+                    retString.erase(retString.length()-1, 1);
+                }
+
+                // Found terminator, break out
+                break;
+            }
+        }
+
+        if (trimAfter)
+        {
+            StringUtil::trim(retString);
+        }
+
+        return retString;
+    }
+    //-----------------------------------------------------------------------
+    size_t DataStream::readLine(char* buf, size_t maxCount, const String& delim)
+    {
+		// Deal with both Unix & Windows LFs
+		bool trimCR = false;
+		if (delim.find_first_of('\n') != String::npos)
+		{
+			trimCR = true;
+		}
+
+        char tmpBuf[OGRE_STREAM_TEMP_SIZE];
+        size_t chunkSize = std::min(maxCount, (size_t)OGRE_STREAM_TEMP_SIZE-1);
+        size_t totalCount = 0;
+        size_t readCount; 
+        while (chunkSize && (readCount = read(tmpBuf, chunkSize)))
+        {
+            // Terminate
+            tmpBuf[readCount] = '\0';
+
+            // Find first delimiter
+            size_t pos = strcspn(tmpBuf, delim.c_str());
+
+            if (pos < readCount)
+            {
+                // Found terminator, reposition backwards
+                skip((long)(pos + 1 - readCount));
+            }
+
+            // Are we genuinely copying?
+            if (buf)
+            {
+                memcpy(buf+totalCount, tmpBuf, pos);
+            }
+            totalCount += pos;
+
+            if (pos < readCount)
+            {
+                // Trim off trailing CR if this was a CR/LF entry
+                if (trimCR && totalCount && buf[totalCount-1] == '\r')
+                {
+                    --totalCount;
+                }
+
+                // Found terminator, break out
+                break;
+            }
+
+            // Adjust chunkSize for next time
+            chunkSize = std::min(maxCount-totalCount, (size_t)OGRE_STREAM_TEMP_SIZE-1);
+        }
+
+        // Terminate
+        buf[totalCount] = '\0';
+
+        return totalCount;
+    }
+    //-----------------------------------------------------------------------
+    size_t DataStream::skipLine(const String& delim)
+    {
+        char tmpBuf[OGRE_STREAM_TEMP_SIZE];
+        size_t total = 0;
+        size_t readCount;
+        // Keep looping while not hitting delimiter
+        while ((readCount = read(tmpBuf, OGRE_STREAM_TEMP_SIZE-1)) != 0)
+        {
+            // Terminate string
+            tmpBuf[readCount] = '\0';
+
+            // Find first delimiter
+            size_t pos = strcspn(tmpBuf, delim.c_str());
+
+            if (pos < readCount)
+            {
+                // Found terminator, reposition backwards
+                skip((long)(pos + 1 - readCount));
+
+                total += pos + 1;
+
+                // break out
+                break;
+            }
+
+            total += readCount;
+        }
+
+        return total;
+    }
+    //-----------------------------------------------------------------------
+    String DataStream::getAsString(void)
+    {
+        // Read the entire buffer
+        char* pBuf = new char[mSize+1];
+        // Ensure read from begin of stream
+        seek(0);
+        read(pBuf, mSize);
+        pBuf[mSize] = '\0';
+        String str;
+        str.insert(0, pBuf, mSize);
+        delete [] pBuf;
+        return str;
+    }
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    MemoryDataStream::MemoryDataStream(void* pMem, size_t size, bool freeOnClose)
+        : DataStream()
+    {
+        mData = mPos = static_cast<uchar*>(pMem);
+        mSize = size;
+        mEnd = mData + mSize;
+        mFreeOnClose = freeOnClose;
+    }
+    //-----------------------------------------------------------------------
+    MemoryDataStream::MemoryDataStream(const String& name, void* pMem, size_t size, 
+        bool freeOnClose)
+        : DataStream(name)
+    {
+        mData = mPos = static_cast<uchar*>(pMem);
+        mSize = size;
+        mEnd = mData + mSize;
+        mFreeOnClose = freeOnClose;
+    }
+    //-----------------------------------------------------------------------
+    MemoryDataStream::MemoryDataStream(DataStream& sourceStream, 
+        bool freeOnClose)
+        : DataStream()
+    {
+        // Copy data from incoming stream
+        mSize = sourceStream.size();
+        mData = new uchar[mSize];
+        sourceStream.read(mData, mSize);
+        mPos = mData;
+        mEnd = mData + mSize;
+        mFreeOnClose = freeOnClose;
+    }
+    //-----------------------------------------------------------------------
+    MemoryDataStream::MemoryDataStream(DataStreamPtr& sourceStream, 
+        bool freeOnClose)
+        : DataStream()
+    {
+        // Copy data from incoming stream
+        mSize = sourceStream->size();
+        mData = new uchar[mSize];
+        sourceStream->read(mData, mSize);
+        mPos = mData;
+        mEnd = mData + mSize;
+        mFreeOnClose = freeOnClose;
+    }
+    //-----------------------------------------------------------------------
+    MemoryDataStream::MemoryDataStream(const String& name, DataStream& sourceStream, 
+        bool freeOnClose)
+        : DataStream(name)
+    {
+        // Copy data from incoming stream
+        mSize = sourceStream.size();
+        mData = new uchar[mSize];
+        sourceStream.read(mData, mSize);
+        mPos = mData;
+        mEnd = mData + mSize;
+        mFreeOnClose = freeOnClose;
+    }
+    //-----------------------------------------------------------------------
+    MemoryDataStream::MemoryDataStream(const String& name, const DataStreamPtr& sourceStream, 
+        bool freeOnClose)
+        : DataStream(name)
+    {
+        // Copy data from incoming stream
+        mSize = sourceStream->size();
+        mData = new uchar[mSize];
+        sourceStream->read(mData, mSize);
+        mPos = mData;
+        mEnd = mData + mSize;
+        mFreeOnClose = freeOnClose;
+    }
+    //-----------------------------------------------------------------------
+    MemoryDataStream::MemoryDataStream(size_t size, bool freeOnClose)
+        : DataStream()
+    {
+        mSize = size;
+        mFreeOnClose = freeOnClose;
+        mData = new uchar[size];
+        mPos = mData;
+        mEnd = mData + mSize;
+    }
+    //-----------------------------------------------------------------------
+    MemoryDataStream::MemoryDataStream(const String& name, size_t size, 
+        bool freeOnClose)
+        : DataStream(name)
+    {
+        mSize = size;
+        mFreeOnClose = freeOnClose;
+        mData = new uchar[size];
+        mPos = mData;
+        mEnd = mData + mSize;
+    }
+    //-----------------------------------------------------------------------
+    MemoryDataStream::~MemoryDataStream()
+    {
+        close();
+    }
+    //-----------------------------------------------------------------------
+    size_t MemoryDataStream::read(void* buf, size_t count)
+    {
+        size_t cnt = count;
+        // Read over end of memory?
+        if (mPos + cnt > mEnd)
+            cnt = mEnd - mPos;
+        if (cnt == 0)
+            return 0;
+
+        memcpy(buf, mPos, cnt);
+        mPos += cnt;
+        return cnt;
+    }
+    //-----------------------------------------------------------------------
+    size_t MemoryDataStream::readLine(char* buf, size_t maxCount, 
+        const String& delim)
+    {
+        // Deal with both Unix & Windows LFs
+		bool trimCR = false;
+		if (delim.find_first_of('\n') != String::npos)
+		{
+			trimCR = true;
+		}
+
+        size_t pos = 0;
+
+        // Make sure pos can never go past the end of the data 
+        while (pos < maxCount && mPos < mEnd)
+        {
+            if (delim.find(*mPos) != String::npos)
+            {
+                // Trim off trailing CR if this was a CR/LF entry
+                if (trimCR && pos && buf[pos-1] == '\r')
+                {
+                    // terminate 1 character early
+                    --pos;
+                }
+
+                // Found terminator, skip and break out
+                ++mPos;
+                break;
+            }
+
+            buf[pos++] = *mPos++;
+        }
+
+        // terminate
+        buf[pos] = '\0';
+
+        return pos;
+    }
+    //-----------------------------------------------------------------------
+    size_t MemoryDataStream::skipLine(const String& delim)
+    {
+        size_t pos = 0;
+
+        // Make sure pos can never go past the end of the data 
+        while (mPos < mEnd)
+        {
+            ++pos;
+            if (delim.find(*mPos++) != String::npos)
+            {
+                // Found terminator, break out
+                break;
+            }
+        }
+
+        return pos;
+
+    }
+    //-----------------------------------------------------------------------
+    void MemoryDataStream::skip(long count)
+    {
+        size_t newpos = (size_t)( ( mPos - mData ) + count );
+        assert( mData + newpos <= mEnd );        
+
+        mPos = mData + newpos;
+    }
+    //-----------------------------------------------------------------------
+    void MemoryDataStream::seek( size_t pos )
+    {
+        assert( mData + pos <= mEnd );
+        mPos = mData + pos;
+    }
+    //-----------------------------------------------------------------------
+    size_t MemoryDataStream::tell(void) const
+	{
+		//mData is start, mPos is current location
+		return mPos - mData;
+	}
+	//-----------------------------------------------------------------------
+    bool MemoryDataStream::eof(void) const
+    {
+        return mPos >= mEnd;
+    }
+    //-----------------------------------------------------------------------
+    void MemoryDataStream::close(void)    
+    {
+        if (mFreeOnClose && mData)
+        {
+            delete [] mData;
+            mData = 0;
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    FileStreamDataStream::FileStreamDataStream(std::ifstream* s, bool freeOnClose)
+        : DataStream(), mpStream(s), mFreeOnClose(freeOnClose)
+    {
+        // calculate the size
+        mpStream->seekg(0, std::ios_base::end);
+        mSize = mpStream->tellg();
+        mpStream->seekg(0, std::ios_base::beg);
+
+    }
+    //-----------------------------------------------------------------------
+    FileStreamDataStream::FileStreamDataStream(const String& name, 
+        std::ifstream* s, bool freeOnClose)
+        : DataStream(name), mpStream(s), mFreeOnClose(freeOnClose)
+    {
+        // calculate the size
+        mpStream->seekg(0, std::ios_base::end);
+        mSize = mpStream->tellg();
+        mpStream->seekg(0, std::ios_base::beg);
+    }
+    //-----------------------------------------------------------------------
+    FileStreamDataStream::FileStreamDataStream(const String& name, 
+        std::ifstream* s, size_t size, bool freeOnClose)
+        : DataStream(name), mpStream(s), mFreeOnClose(freeOnClose)
+    {
+        // Size is passed in
+        mSize = size;
+    }
+    //-----------------------------------------------------------------------
+    FileStreamDataStream::~FileStreamDataStream()
+    {
+        close();
+    }
+    //-----------------------------------------------------------------------
+    size_t FileStreamDataStream::read(void* buf, size_t count)
+    {
+		mpStream->read(static_cast<char*>(buf), static_cast<std::streamsize>(count));
+        return mpStream->gcount();
+    }
+    //-----------------------------------------------------------------------
+    size_t FileStreamDataStream::readLine(char* buf, size_t maxCount, 
+        const String& delim)
+    {
+		if (delim.empty())
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "No delimiter provided",
+				"FileStreamDataStream::readLine");
+		}
+		if (delim.size() > 1)
+		{
+			LogManager::getSingleton().logMessage(
+				"WARNING: FileStreamDataStream::readLine - using only first delimeter");
+		}
+		// Deal with both Unix & Windows LFs
+		bool trimCR = false;
+		if (delim.at(0) == '\n') 
+		{
+			trimCR = true;
+		}
+		// maxCount + 1 since count excludes terminator in getline
+		mpStream->getline(buf, static_cast<std::streamsize>(maxCount+1), delim.at(0));
+		size_t ret = mpStream->gcount();
+		// three options
+		// 1) we had an eof before we read a whole line
+		// 2) we ran out of buffer space
+		// 3) we read a whole line - in this case the delim character is taken from the stream but not written in the buffer so the read data is of length ret-1 and thus ends at index ret-2
+		// in all cases the buffer will be null terminated for us
+
+		if (mpStream->eof()) 
+		{
+			// no problem
+		}
+		else if (mpStream->fail())
+		{
+			// Did we fail because of maxCount hit? No - no terminating character
+			// in included in the count in this case
+			if (ret == maxCount)
+			{
+				// clear failbit for next time 
+				mpStream->clear();
+			}
+			else
+			{
+				OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+					"Streaming error occurred", 
+					"FileStreamDataStream::readLine");
+			}
+		}
+		else 
+		{
+			// we need to adjust ret because we want to use it as a
+			// pointer to the terminating null character and it is
+			// currently the length of the data read from the stream
+			// i.e. 1 more than the length of the data in the buffer and
+			// hence 1 more than the _index_ of the NULL character
+			--ret;
+		}
+
+		// trim off CR if we found CR/LF
+		if (trimCR && buf[ret-1] == '\r')
+		{
+			--ret;
+			buf[ret] = '\0';
+		}
+		return ret;
+	}
+    //-----------------------------------------------------------------------
+    void FileStreamDataStream::skip(long count)
+    {
+#if defined(STLPORT)
+		// Workaround for STLport issues: After reached eof of file stream,
+		// it's seems the stream was putted in intermediate state, and will be
+		// fail if try to repositioning relative to current position.
+		// Note: tellg() fail in this case too.
+		if (mpStream->eof())
+		{
+			mpStream->clear();
+			// Use seek relative to either begin or end to bring the stream
+			// back to normal state.
+			mpStream->seekg(0, std::ios::end);
+		}
+#endif 		
+		mpStream->clear(); //Clear fail status in case eof was set
+		mpStream->seekg(static_cast<std::ifstream::pos_type>(count), std::ios::cur);
+    }
+    //-----------------------------------------------------------------------
+    void FileStreamDataStream::seek( size_t pos )
+    {
+		mpStream->clear(); //Clear fail status in case eof was set
+        mpStream->seekg(static_cast<std::streamoff>(pos), std::ios::beg);
+    }
+	//-----------------------------------------------------------------------
+    size_t FileStreamDataStream::tell(void) const
+	{
+		mpStream->clear(); //Clear fail status in case eof was set
+		return mpStream->tellg();
+	}
+	//-----------------------------------------------------------------------
+    bool FileStreamDataStream::eof(void) const
+    {
+        return mpStream->eof();
+    }
+    //-----------------------------------------------------------------------
+    void FileStreamDataStream::close(void)
+    {
+        if (mpStream)
+        {
+            mpStream->close();
+            if (mFreeOnClose)
+            {
+                // delete the stream too
+                delete mpStream;
+                mpStream = 0;
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    FileHandleDataStream::FileHandleDataStream(FILE* handle)
+        : DataStream(), mFileHandle(handle)
+    {
+		// Determine size
+		fseek(mFileHandle, 0, SEEK_END);
+		mSize = ftell(mFileHandle);
+		fseek(mFileHandle, 0, SEEK_SET);
+    }
+    //-----------------------------------------------------------------------
+    FileHandleDataStream::FileHandleDataStream(const String& name, FILE* handle)
+        : DataStream(name), mFileHandle(handle)
+    {
+		// Determine size
+		fseek(mFileHandle, 0, SEEK_END);
+		mSize = ftell(mFileHandle);
+		fseek(mFileHandle, 0, SEEK_SET);
+    }
+    //-----------------------------------------------------------------------
+    FileHandleDataStream::~FileHandleDataStream()
+    {
+        close();
+    }
+    //-----------------------------------------------------------------------
+    size_t FileHandleDataStream::read(void* buf, size_t count)
+    {
+        return fread(buf, 1, count, mFileHandle);
+    }
+    //-----------------------------------------------------------------------
+    void FileHandleDataStream::skip(long count)
+    {
+        fseek(mFileHandle, count, SEEK_CUR);
+    }
+    //-----------------------------------------------------------------------
+    void FileHandleDataStream::seek( size_t pos )
+    {
+        fseek(mFileHandle, static_cast<long>(pos), SEEK_SET);
+    }
+    //-----------------------------------------------------------------------
+    size_t FileHandleDataStream::tell(void) const
+	{
+		return ftell( mFileHandle );
+	}
+	//-----------------------------------------------------------------------
+    bool FileHandleDataStream::eof(void) const
+    {
+        return feof(mFileHandle) != 0;
+    }
+    //-----------------------------------------------------------------------
+    void FileHandleDataStream::close(void)
+    {
+        fclose(mFileHandle);
+        mFileHandle = 0;
+    }
+    //-----------------------------------------------------------------------
+
+}
Index: /OgreMain/src/OgreDefaultHardwareBufferManager.cpp
===================================================================
--- /OgreMain/src/OgreDefaultHardwareBufferManager.cpp	(revision 5)
+++ /OgreMain/src/OgreDefaultHardwareBufferManager.cpp	(revision 5)
@@ -0,0 +1,163 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreDefaultHardwareBufferManager.h"
+#include "OgreAlignedAllocator.h"
+
+namespace Ogre {
+
+	DefaultHardwareVertexBuffer::DefaultHardwareVertexBuffer(size_t vertexSize, size_t numVertices, 
+		HardwareBuffer::Usage usage)
+        : HardwareVertexBuffer(vertexSize, numVertices, usage, true, false) // always software, never shadowed
+	{
+        // Allocate aligned memory for better SIMD processing friendly.
+        mpData = static_cast<unsigned char*>(AlignedMemory::allocate(mSizeInBytes));
+	}
+	//-----------------------------------------------------------------------
+    DefaultHardwareVertexBuffer::~DefaultHardwareVertexBuffer()
+	{
+		AlignedMemory::deallocate(mpData);
+	}
+	//-----------------------------------------------------------------------
+    void* DefaultHardwareVertexBuffer::lockImpl(size_t offset, size_t length, LockOptions options)
+	{
+        // Only for use internally, no 'locking' as such
+		return mpData + offset;
+	}
+	//-----------------------------------------------------------------------
+	void DefaultHardwareVertexBuffer::unlockImpl(void)
+	{
+        // Nothing to do
+	}
+	//-----------------------------------------------------------------------
+    void* DefaultHardwareVertexBuffer::lock(size_t offset, size_t length, LockOptions options)
+	{
+        mIsLocked = true;
+		return mpData + offset;
+	}
+	//-----------------------------------------------------------------------
+	void DefaultHardwareVertexBuffer::unlock(void)
+	{
+        mIsLocked = false;
+        // Nothing to do
+	}
+	//-----------------------------------------------------------------------
+    void DefaultHardwareVertexBuffer::readData(size_t offset, size_t length, void* pDest)
+	{
+		assert((offset + length) <= mSizeInBytes);
+		memcpy(pDest, mpData + offset, length);
+	}
+	//-----------------------------------------------------------------------
+    void DefaultHardwareVertexBuffer::writeData(size_t offset, size_t length, const void* pSource,
+			bool discardWholeBuffer)
+	{
+		assert((offset + length) <= mSizeInBytes);
+		// ignore discard, memory is not guaranteed to be zeroised
+		memcpy(mpData + offset, pSource, length);
+
+	}
+	//-----------------------------------------------------------------------
+
+	DefaultHardwareIndexBuffer::DefaultHardwareIndexBuffer(IndexType idxType, 
+		size_t numIndexes, HardwareBuffer::Usage usage) 
+		: HardwareIndexBuffer(idxType, numIndexes, usage, true, false) // always software, never shadowed
+	{
+		mpData = new unsigned char[mSizeInBytes];
+	}
+	//-----------------------------------------------------------------------
+    DefaultHardwareIndexBuffer::~DefaultHardwareIndexBuffer()
+	{
+		delete [] mpData;
+	}
+	//-----------------------------------------------------------------------
+    void* DefaultHardwareIndexBuffer::lockImpl(size_t offset, size_t length, LockOptions options)
+	{
+        // Only for use internally, no 'locking' as such
+		return mpData + offset;
+	}
+	//-----------------------------------------------------------------------
+	void DefaultHardwareIndexBuffer::unlockImpl(void)
+	{
+        // Nothing to do
+	}
+	//-----------------------------------------------------------------------
+    void* DefaultHardwareIndexBuffer::lock(size_t offset, size_t length, LockOptions options)
+	{
+        mIsLocked = true;
+		return mpData + offset;
+	}
+	//-----------------------------------------------------------------------
+	void DefaultHardwareIndexBuffer::unlock(void)
+	{
+        mIsLocked = false;
+        // Nothing to do
+	}
+	//-----------------------------------------------------------------------
+    void DefaultHardwareIndexBuffer::readData(size_t offset, size_t length, void* pDest)
+	{
+		assert((offset + length) <= mSizeInBytes);
+		memcpy(pDest, mpData + offset, length);
+	}
+	//-----------------------------------------------------------------------
+    void DefaultHardwareIndexBuffer::writeData(size_t offset, size_t length, const void* pSource,
+			bool discardWholeBuffer)
+	{
+		assert((offset + length) <= mSizeInBytes);
+		// ignore discard, memory is not guaranteed to be zeroised
+		memcpy(mpData + offset, pSource, length);
+
+	}
+	//-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    DefaultHardwareBufferManager::DefaultHardwareBufferManager()
+	{
+	}
+    //-----------------------------------------------------------------------
+    DefaultHardwareBufferManager::~DefaultHardwareBufferManager()
+	{
+        destroyAllDeclarations();
+        destroyAllBindings(); 
+	}
+    //-----------------------------------------------------------------------
+	HardwareVertexBufferSharedPtr 
+        DefaultHardwareBufferManager::createVertexBuffer(size_t vertexSize, 
+		size_t numVerts, HardwareBuffer::Usage usage, bool useShadowBuffer)
+	{
+        DefaultHardwareVertexBuffer* vb = new DefaultHardwareVertexBuffer(vertexSize, numVerts, usage);
+        return HardwareVertexBufferSharedPtr(vb);
+	}
+    //-----------------------------------------------------------------------
+	HardwareIndexBufferSharedPtr 
+        DefaultHardwareBufferManager::createIndexBuffer(HardwareIndexBuffer::IndexType itype, 
+		size_t numIndexes, HardwareBuffer::Usage usage, bool useShadowBuffer)
+	{
+        DefaultHardwareIndexBuffer* ib = new DefaultHardwareIndexBuffer(itype, numIndexes, usage);
+		return HardwareIndexBufferSharedPtr(ib);
+	}
+}
Index: /OgreMain/src/OgreDefaultSceneQueries.cpp
===================================================================
--- /OgreMain/src/OgreDefaultSceneQueries.cpp	(revision 5)
+++ /OgreMain/src/OgreDefaultSceneQueries.cpp	(revision 5)
@@ -0,0 +1,306 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreSceneManager.h"
+#include "OgreEntity.h"
+#include "OgreRoot.h"
+
+namespace Ogre {
+	//---------------------------------------------------------------------
+	DefaultIntersectionSceneQuery::DefaultIntersectionSceneQuery(SceneManager* creator)
+	: IntersectionSceneQuery(creator)
+	{
+		// No world geometry results supported
+		mSupportedWorldFragments.insert(SceneQuery::WFT_NONE);
+	}
+	//---------------------------------------------------------------------
+	DefaultIntersectionSceneQuery::~DefaultIntersectionSceneQuery()
+	{
+	}
+	//---------------------------------------------------------------------
+	void DefaultIntersectionSceneQuery::execute(IntersectionSceneQueryListener* listener)
+	{
+		// Iterate over all movable types
+		Root::MovableObjectFactoryIterator factIt = 
+			Root::getSingleton().getMovableObjectFactoryIterator();
+		while(factIt.hasMoreElements())
+		{
+			SceneManager::MovableObjectIterator objItA = 
+				mParentSceneMgr->getMovableObjectIterator(
+					factIt.getNext()->getType());
+			while (objItA.hasMoreElements())
+			{
+				MovableObject* a = objItA.getNext();
+				// skip entire section if type doesn't match
+				if (!(a->getTypeFlags() & mQueryTypeMask))
+					break;
+
+				// Skip if a does not pass the mask
+				if (!(a->getQueryFlags() & mQueryMask) ||
+					!a->isInScene())
+					continue;
+
+				// Check against later objects in the same group
+				SceneManager::MovableObjectIterator objItB = objItA;
+				while (objItB.hasMoreElements())
+				{
+					MovableObject* b = objItB.getNext();
+
+					// Apply mask to b (both must pass)
+					if ((b->getQueryFlags() & mQueryMask) && 
+						b->isInScene())
+					{
+						const AxisAlignedBox& box1 = a->getWorldBoundingBox();
+						const AxisAlignedBox& box2 = b->getWorldBoundingBox();
+
+						if (box1.intersects(box2))
+						{
+							if (!listener->queryResult(a, b)) return;
+						}
+					}
+				}
+				// Check  against later groups
+				Root::MovableObjectFactoryIterator factItLater = factIt;
+				while (factItLater.hasMoreElements())
+				{
+					SceneManager::MovableObjectIterator objItC = 
+						mParentSceneMgr->getMovableObjectIterator(
+							factItLater.getNext()->getType());
+					while (objItC.hasMoreElements())
+					{
+						MovableObject* c = objItC.getNext();
+						// skip entire section if type doesn't match
+						if (!(c->getTypeFlags() & mQueryTypeMask))
+							break;
+
+						// Apply mask to c (both must pass)
+						if ((c->getQueryFlags() & mQueryMask) &&
+							c->isInScene())
+						{
+							const AxisAlignedBox& box1 = a->getWorldBoundingBox();
+							const AxisAlignedBox& box2 = c->getWorldBoundingBox();
+
+							if (box1.intersects(box2))
+							{
+								if (!listener->queryResult(a, c)) return;
+							}
+						}
+					}
+
+				}
+
+			}
+
+
+		}
+
+	}
+	//---------------------------------------------------------------------
+	DefaultAxisAlignedBoxSceneQuery::
+	DefaultAxisAlignedBoxSceneQuery(SceneManager* creator)
+	: AxisAlignedBoxSceneQuery(creator)
+	{
+		// No world geometry results supported
+		mSupportedWorldFragments.insert(SceneQuery::WFT_NONE);
+	}
+	//---------------------------------------------------------------------
+	DefaultAxisAlignedBoxSceneQuery::~DefaultAxisAlignedBoxSceneQuery()
+	{
+	}
+	//---------------------------------------------------------------------
+	void DefaultAxisAlignedBoxSceneQuery::execute(SceneQueryListener* listener)
+	{
+		// Iterate over all movable types
+		Root::MovableObjectFactoryIterator factIt = 
+			Root::getSingleton().getMovableObjectFactoryIterator();
+		while(factIt.hasMoreElements())
+		{
+			SceneManager::MovableObjectIterator objItA = 
+				mParentSceneMgr->getMovableObjectIterator(
+				factIt.getNext()->getType());
+			while (objItA.hasMoreElements())
+			{
+				MovableObject* a = objItA.getNext();
+				// skip whole group if type doesn't match
+				if (!(a->getTypeFlags() & mQueryTypeMask))
+					break;
+
+				if ((a->getQueryFlags() & mQueryMask) && 
+					a->isInScene() &&
+					mAABB.intersects(a->getWorldBoundingBox()))
+				{
+					if (!listener->queryResult(a)) return;
+				}
+			}
+		}
+	}
+	//---------------------------------------------------------------------
+	DefaultRaySceneQuery::
+	DefaultRaySceneQuery(SceneManager* creator) : RaySceneQuery(creator)
+	{
+		// No world geometry results supported
+		mSupportedWorldFragments.insert(SceneQuery::WFT_NONE);
+	}
+	//---------------------------------------------------------------------
+	DefaultRaySceneQuery::~DefaultRaySceneQuery()
+	{
+	}
+	//---------------------------------------------------------------------
+	void DefaultRaySceneQuery::execute(RaySceneQueryListener* listener)
+	{
+		// Note that becuase we have no scene partitioning, we actually
+		// perform a complete scene search even if restricted results are
+		// requested; smarter scene manager queries can utilise the paritioning 
+		// of the scene in order to reduce the number of intersection tests 
+		// required to fulfil the query
+
+		// Iterate over all movable types
+		Root::MovableObjectFactoryIterator factIt = 
+			Root::getSingleton().getMovableObjectFactoryIterator();
+		while(factIt.hasMoreElements())
+		{
+			SceneManager::MovableObjectIterator objItA = 
+				mParentSceneMgr->getMovableObjectIterator(
+				factIt.getNext()->getType());
+			while (objItA.hasMoreElements())
+			{
+				MovableObject* a = objItA.getNext();
+				// skip whole group if type doesn't match
+				if (!(a->getTypeFlags() & mQueryTypeMask))
+					break;
+
+				if( (a->getQueryFlags() & mQueryMask) &&
+					a->isInScene())
+				{
+					// Do ray / box test
+					std::pair<bool, Real> result =
+						mRay.intersects(a->getWorldBoundingBox());
+
+					if (result.first)
+					{
+						if (!listener->queryResult(a, result.second)) return;
+					}
+				}
+			}
+		}
+
+	}
+	//---------------------------------------------------------------------
+	DefaultSphereSceneQuery::
+	DefaultSphereSceneQuery(SceneManager* creator) : SphereSceneQuery(creator)
+	{
+		// No world geometry results supported
+		mSupportedWorldFragments.insert(SceneQuery::WFT_NONE);
+	}
+	//---------------------------------------------------------------------
+	DefaultSphereSceneQuery::~DefaultSphereSceneQuery()
+	{
+	}
+	//---------------------------------------------------------------------
+	void DefaultSphereSceneQuery::execute(SceneQueryListener* listener)
+	{
+		Sphere testSphere;
+
+		// Iterate over all movable types
+		Root::MovableObjectFactoryIterator factIt = 
+			Root::getSingleton().getMovableObjectFactoryIterator();
+		while(factIt.hasMoreElements())
+		{
+			SceneManager::MovableObjectIterator objItA = 
+				mParentSceneMgr->getMovableObjectIterator(
+				factIt.getNext()->getType());
+			while (objItA.hasMoreElements())
+			{
+				MovableObject* a = objItA.getNext();
+				// skip whole group if type doesn't match
+				if (!(a->getTypeFlags() & mQueryTypeMask))
+					break;
+				// Skip unattached
+				if (!a->isInScene() || 
+					!(a->getQueryFlags() & mQueryMask))
+					continue;
+
+				// Do sphere / sphere test
+				testSphere.setCenter(a->getParentNode()->_getDerivedPosition());
+				testSphere.setRadius(a->getBoundingRadius());
+				if (mSphere.intersects(testSphere))
+				{
+					if (!listener->queryResult(a)) return;
+				}
+			}
+		}
+	}
+	//---------------------------------------------------------------------
+	DefaultPlaneBoundedVolumeListSceneQuery::
+	DefaultPlaneBoundedVolumeListSceneQuery(SceneManager* creator) 
+	: PlaneBoundedVolumeListSceneQuery(creator)
+	{
+		// No world geometry results supported
+		mSupportedWorldFragments.insert(SceneQuery::WFT_NONE);
+	}
+	//---------------------------------------------------------------------
+	DefaultPlaneBoundedVolumeListSceneQuery::~DefaultPlaneBoundedVolumeListSceneQuery()
+	{
+	}
+	//---------------------------------------------------------------------
+	void DefaultPlaneBoundedVolumeListSceneQuery::execute(SceneQueryListener* listener)
+	{
+		// Iterate over all movable types
+		Root::MovableObjectFactoryIterator factIt = 
+			Root::getSingleton().getMovableObjectFactoryIterator();
+		while(factIt.hasMoreElements())
+		{
+			SceneManager::MovableObjectIterator objItA = 
+				mParentSceneMgr->getMovableObjectIterator(
+				factIt.getNext()->getType());
+			while (objItA.hasMoreElements())
+			{
+				MovableObject* a = objItA.getNext();
+				// skip whole group if type doesn't match
+				if (!(a->getTypeFlags() & mQueryTypeMask))
+					break;
+
+				PlaneBoundedVolumeList::iterator pi, piend;
+				piend = mVolumes.end();
+				for (pi = mVolumes.begin(); pi != piend; ++pi)
+				{
+					PlaneBoundedVolume& vol = *pi;
+					// Do AABB / plane volume test
+					if ((a->getQueryFlags() & mQueryMask) && 
+						a->isInScene() && 
+						vol.intersects(a->getWorldBoundingBox()))
+					{
+						if (!listener->queryResult(a)) return;
+						break;
+					}
+				}
+			}
+		}
+	}
+}
Index: /OgreMain/src/OgreDynLib.cpp
===================================================================
--- /OgreMain/src/OgreDynLib.cpp	(revision 5)
+++ /OgreMain/src/OgreDynLib.cpp	(revision 5)
@@ -0,0 +1,134 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreDynLib.h"
+
+#include "OgreException.h"
+#include "OgreLogManager.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#   define WIN32_LEAN_AND_MEAN
+#   include <windows.h>
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#   include "macPlugins.h"
+#endif
+
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    DynLib::DynLib( const String& name )
+    {
+        mName = name;
+        m_hInst = NULL;
+    }
+
+    //-----------------------------------------------------------------------
+    DynLib::~DynLib()
+    {
+    }
+
+    //-----------------------------------------------------------------------
+    void DynLib::load()
+    {
+        // Log library load
+        LogManager::getSingleton().logMessage("Loading library " + mName);
+
+		std::string name = mName;
+#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
+        // dlopen() does not add .so to the filename, like windows does for .dll
+        if (name.substr(name.length() - 3, 3) != ".so")
+           name += ".so";
+#endif
+
+        m_hInst = (DYNLIB_HANDLE)DYNLIB_LOAD( name.c_str() );
+
+        if( !m_hInst )
+            OGRE_EXCEPT(
+                Exception::ERR_INTERNAL_ERROR, 
+                "Could not load dynamic library " + mName + 
+                ".  System Error: " + dynlibError(),
+                "DynLib::load" );
+    }
+
+    //-----------------------------------------------------------------------
+    void DynLib::unload()
+    {
+        // Log library unload
+        LogManager::getSingleton().logMessage("Unloading library " + mName);
+
+        if( DYNLIB_UNLOAD( m_hInst ) )
+		{
+            OGRE_EXCEPT(
+                Exception::ERR_INTERNAL_ERROR, 
+                "Could not unload dynamic library " + mName +
+                ".  System Error: " + dynlibError(),
+                "DynLib::unload");
+		}
+
+    }
+
+    //-----------------------------------------------------------------------
+    void* DynLib::getSymbol( const String& strName ) const throw()
+    {
+        return (void*)DYNLIB_GETSYM( m_hInst, strName.c_str() );
+    }
+    //-----------------------------------------------------------------------
+    String DynLib::dynlibError( void ) 
+    {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        LPVOID lpMsgBuf; 
+        FormatMessage( 
+            FORMAT_MESSAGE_ALLOCATE_BUFFER | 
+            FORMAT_MESSAGE_FROM_SYSTEM | 
+            FORMAT_MESSAGE_IGNORE_INSERTS, 
+            NULL, 
+            GetLastError(), 
+            MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 
+            (LPTSTR) &lpMsgBuf, 
+            0, 
+            NULL 
+            ); 
+        String ret = (char*)lpMsgBuf;
+        // Free the buffer.
+        LocalFree( lpMsgBuf );
+        return ret;
+#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
+        return String(dlerror());
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+        return String(mac_errorBundle());
+#else
+        return String("");
+#endif
+    }
+
+}
Index: /OgreMain/src/OgreDynLibManager.cpp
===================================================================
--- /OgreMain/src/OgreDynLibManager.cpp	(revision 5)
+++ /OgreMain/src/OgreDynLibManager.cpp	(revision 5)
@@ -0,0 +1,92 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreDynLibManager.h"
+
+#include "OgreDynLib.h"
+
+namespace Ogre
+{
+    //-----------------------------------------------------------------------
+    template<> DynLibManager* Singleton<DynLibManager>::ms_Singleton = 0;
+    DynLibManager* DynLibManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+	//-----------------------------------------------------------------------
+    DynLibManager& DynLibManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+    //-----------------------------------------------------------------------
+	DynLibManager::DynLibManager()
+	{
+	}
+	//-----------------------------------------------------------------------
+    DynLib* DynLibManager::load( const String& filename)
+    {
+		DynLibList::iterator i = mLibList.find(filename);
+		if (i != mLibList.end())
+		{
+			return i->second;
+		}
+		else
+		{
+	        DynLib* pLib = new DynLib(filename);
+			pLib->load();        
+        	mLibList[filename] = pLib;
+	        return pLib;
+		}
+    }
+	//-----------------------------------------------------------------------
+	void DynLibManager::unload(DynLib* lib)
+	{
+		DynLibList::iterator i = mLibList.find(lib->getName());
+		if (i != mLibList.end())
+		{
+			mLibList.erase(i);
+		}
+		lib->unload();
+		delete lib;
+	}
+	//-----------------------------------------------------------------------
+    DynLibManager::~DynLibManager()
+    {
+        // Unload & delete resources in turn
+        for( DynLibList::iterator it = mLibList.begin(); it != mLibList.end(); ++it )
+        {
+            it->second->unload();
+            delete it->second;
+        }
+
+        // Empty the list
+        mLibList.clear();
+    }
+}
Index: /OgreMain/src/OgreEdgeListBuilder.cpp
===================================================================
--- /OgreMain/src/OgreEdgeListBuilder.cpp	(revision 5)
+++ /OgreMain/src/OgreEdgeListBuilder.cpp	(revision 5)
@@ -0,0 +1,597 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreEdgeListBuilder.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreVertexIndexData.h"
+#include "OgreException.h"
+#include "OgreOptimisedUtil.h"
+
+namespace Ogre {
+
+    void EdgeData::log(Log* l)
+    {
+        EdgeGroupList::iterator i, iend;
+        EdgeList::iterator ei, eiend;
+        TriangleList::iterator ti, tiend;
+        tiend = triangles.end();
+        l->logMessage("Edge Data");
+        l->logMessage("---------");
+        size_t num = 0;
+        for (ti = triangles.begin(); ti != tiend; ++ti, ++num)
+        {
+            Triangle& t = *ti;
+            l->logMessage("Triangle " + StringConverter::toString(num) + " = {" +
+                "indexSet=" + StringConverter::toString(t.indexSet) + ", " + 
+                "vertexSet=" + StringConverter::toString(t.vertexSet) + ", " + 
+                "v0=" + StringConverter::toString(t.vertIndex[0]) + ", " + 
+                "v1=" + StringConverter::toString(t.vertIndex[1]) + ", " + 
+                "v2=" + StringConverter::toString(t.vertIndex[2]) + "}"); 
+        }
+        iend = edgeGroups.end();
+        for (i = edgeGroups.begin(); i != iend; ++i)
+        {
+            num = 0;
+            eiend = i->edges.end();
+            l->logMessage("Edge Group vertexSet=" + StringConverter::toString(i->vertexSet));
+            for (ei = i->edges.begin(); ei != eiend; ++ei, ++num)
+            {
+                Edge& e = *ei;
+                l->logMessage(
+                    "Edge " + StringConverter::toString(num) + " = {\n" + 
+                    "  tri0=" + StringConverter::toString(e.triIndex[0]) + ", \n" + 
+                    "  tri1=" + StringConverter::toString(e.triIndex[1]) + ", \n" + 
+                    "  v0=" + StringConverter::toString(e.vertIndex[0]) + ", \n" + 
+                    "  v1=" + StringConverter::toString(e.vertIndex[1]) + ", \n"
+                    "  degenerate=" + StringConverter::toString(e.degenerate) + " \n"
+                    "}"); 
+            }
+        }
+    }
+    //---------------------------------------------------------------------
+    EdgeListBuilder::EdgeListBuilder()
+        : mEdgeData(0)
+    {
+    }
+    //---------------------------------------------------------------------
+    EdgeListBuilder::~EdgeListBuilder()
+    {
+    }
+    //---------------------------------------------------------------------
+    void EdgeListBuilder::addVertexData(const VertexData* vertexData)
+    {
+        if (vertexData->vertexStart != 0)
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "The base vertex index of the vertex data must be zero for build edge list.",
+                "EdgeListBuilder::addVertexData");
+        }
+
+        mVertexDataList.push_back(vertexData);
+    }
+    //---------------------------------------------------------------------
+    void EdgeListBuilder::addIndexData(const IndexData* indexData, 
+        size_t vertexSet, RenderOperation::OperationType opType)
+    {
+        if (opType != RenderOperation::OT_TRIANGLE_LIST &&
+            opType != RenderOperation::OT_TRIANGLE_FAN &&
+            opType != RenderOperation::OT_TRIANGLE_STRIP)
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "Only triangle list, fan and strip are supported to build edge list.",
+                "EdgeListBuilder::addIndexData");
+        }
+
+        Geometry geometry;
+        geometry.indexData = indexData;
+        geometry.vertexSet = vertexSet;
+        geometry.opType = opType;
+        geometry.indexSet = mGeometryList.size();
+        mGeometryList.push_back(geometry);
+    }
+    //---------------------------------------------------------------------
+    EdgeData* EdgeListBuilder::build(void)
+    {
+        /* Ok, here's the algorithm:
+        For each set of indices in turn
+          For each set of 3 indexes
+            Create a new Triangle entry in the list
+            For each vertex referenced by the tri indexes
+              Get the position of the vertex as a Vector3 from the correct vertex buffer
+              Attempt to locate this position in the existing common vertex set
+              If not found
+                Create a new common vertex entry in the list
+              End If
+              Populate the original vertex index and common vertex index 
+            Next vertex
+            Connect to existing edge(v1, v0) or create a new edge(v0, v1)
+            Connect to existing edge(v2, v1) or create a new edge(v1, v2)
+            Connect to existing edge(v0, v2) or create a new edge(v2, v0)
+          Next set of 3 indexes
+        Next index set
+
+        Note that all edges 'belong' to the index set which originally caused them
+        to be created, which also means that the 2 vertices on the edge are both referencing the 
+        vertex buffer which this index set uses.
+        */
+
+
+        /* 
+        There is a major consideration: 'What is a common vertex'? This is a
+        crucial decision, since to form a completely close hull, you need to treat
+        vertices which are not physically the same as equivalent. This is because
+        there will be 'seams' in the model, where discrepancies in vertex components
+        other than position (such as normals or texture coordinates) will mean
+        that there are 2 vertices in the same place, and we MUST 'weld' them
+        into a single common vertex in order to have a closed hull. Just looking
+        at the unique vertex indices is not enough, since these seams would render
+        the hull invalid.
+
+        So, we look for positions which are the same across vertices, and treat 
+        those as as single vertex for our edge calculation. However, this has
+        it's own problems. There are OTHER vertices which may have a common 
+        position that should not be welded. Imagine 2 cubes touching along one
+        single edge. The common vertices on that edge, if welded, will cause 
+        an ambiguous hull, since the edge will have 4 triangles attached to it,
+        whilst a manifold mesh should only have 2 triangles attached to each edge.
+        This is a problem.
+
+        We deal with this with allow welded multiple pairs of edges. Using this
+        techniques, we can build a individual hull even if the model which has a
+        potentially ambiguous hull. This is feasible, because in the case of
+        multiple hulls existing, each hull can cast same shadow in any situation.
+        Notice: For stencil shadow, we intent to build a valid shadow volume for
+        the mesh, not the valid hull for the mesh.
+        */
+
+        // Sort the geometries in the order of vertex set, so we can grouping
+        // triangles by vertex set easy.
+        std::sort(mGeometryList.begin(), mGeometryList.end(), geometryLess());
+        // Initialize edge data
+        mEdgeData = new EdgeData();
+        // resize the edge group list to equal the number of vertex sets
+        mEdgeData->edgeGroups.resize(mVertexDataList.size());
+        // Initialise edge group data
+        for (unsigned short vSet = 0; vSet < mVertexDataList.size(); ++vSet)
+        {
+            mEdgeData->edgeGroups[vSet].vertexSet = vSet;
+            mEdgeData->edgeGroups[vSet].vertexData = mVertexDataList[vSet];
+            mEdgeData->edgeGroups[vSet].triStart = 0;
+            mEdgeData->edgeGroups[vSet].triCount = 0;
+        }
+
+        // Build triangles and edge list
+        GeometryList::const_iterator i, iend;
+        iend = mGeometryList.end();
+        for (i = mGeometryList.begin(); i != iend; ++i)
+        {
+            buildTrianglesEdges(*i);
+        }
+
+        // Allocate memory for light facing calculate
+        mEdgeData->triangleLightFacings.resize(mEdgeData->triangles.size());
+
+        // Record closed, ie the mesh is manifold
+        mEdgeData->isClosed = mEdgeMap.empty();
+
+        return mEdgeData;
+    }
+    //---------------------------------------------------------------------
+    void EdgeListBuilder::buildTrianglesEdges(const Geometry &geometry)
+    {
+        size_t indexSet = geometry.indexSet;
+        size_t vertexSet = geometry.vertexSet;
+        const IndexData* indexData = geometry.indexData;
+        RenderOperation::OperationType opType = geometry.opType;
+
+        size_t iterations;
+        
+        switch (opType)
+        {
+        case RenderOperation::OT_TRIANGLE_LIST:
+            iterations = indexData->indexCount / 3;
+            break;
+        case RenderOperation::OT_TRIANGLE_FAN:
+        case RenderOperation::OT_TRIANGLE_STRIP:
+            iterations = indexData->indexCount - 2;
+            break;
+        default:
+            return; // Just in case
+        };
+
+        // The edge group now we are dealing with.
+        EdgeData::EdgeGroup& eg = mEdgeData->edgeGroups[vertexSet];
+
+		// locate position element & the buffer to go with it
+        const VertexData* vertexData = mVertexDataList[vertexSet];
+		const VertexElement* posElem = vertexData->vertexDeclaration->findElementBySemantic(VES_POSITION);
+		HardwareVertexBufferSharedPtr vbuf = 
+			vertexData->vertexBufferBinding->getBuffer(posElem->getSource());
+		// lock the buffer for reading
+		unsigned char* pBaseVertex = static_cast<unsigned char*>(
+			vbuf->lock(HardwareBuffer::HBL_READ_ONLY));
+
+        // Get the indexes ready for reading
+		bool idx32bit = (indexData->indexBuffer->getType() == HardwareIndexBuffer::IT_32BIT);
+		size_t indexSize = idx32bit ? sizeof(uint32) : sizeof(uint16);
+#if defined(_MSC_VER) && _MSC_VER <= 1300
+        // NB: Can't use un-named union with VS.NET 2002 when /RTC1 compile flag enabled.
+        void* pIndex = indexData->indexBuffer->lock(HardwareBuffer::HBL_READ_ONLY);
+		pIndex = static_cast<void*>(
+			static_cast<char*>(pIndex) + indexData->indexStart * indexSize);
+        unsigned short* p16Idx = static_cast<unsigned short*>(pIndex);
+        unsigned int* p32Idx = static_cast<unsigned int*>(pIndex);
+#else
+        union {
+            void* pIndex;
+            unsigned short* p16Idx;
+            unsigned int* p32Idx;
+        };
+        pIndex = indexData->indexBuffer->lock(HardwareBuffer::HBL_READ_ONLY);
+		pIndex = static_cast<void*>(
+			static_cast<char*>(pIndex) + indexData->indexStart * indexSize);
+#endif
+
+        // Iterate over all the groups of 3 indexes
+        unsigned int index[3];
+        // Get the triangle start, if we have more than one index set then this
+        // will not be zero
+        size_t triangleIndex = mEdgeData->triangles.size();
+        // If it's first time dealing with the edge group, setup triStart for it.
+        // Note that we are assume geometries sorted by vertex set.
+        if (!eg.triCount)
+        {
+            eg.triStart = triangleIndex;
+        }
+        // Pre-reserve memory for less thrashing
+        mEdgeData->triangles.reserve(triangleIndex + iterations);
+        mEdgeData->triangleFaceNormals.reserve(triangleIndex + iterations);
+        for (size_t t = 0; t < iterations; ++t)
+        {
+            EdgeData::Triangle tri;
+            tri.indexSet = indexSet;
+            tri.vertexSet = vertexSet;
+
+            if (opType == RenderOperation::OT_TRIANGLE_LIST || t == 0)
+            {
+                // Standard 3-index read for tri list or first tri in strip / fan
+                if (idx32bit)
+                {
+                    index[0] = p32Idx[0];
+                    index[1] = p32Idx[1];
+                    index[2] = p32Idx[2];
+                    p32Idx += 3;
+                }
+                else
+                {
+                    index[0] = p16Idx[0];
+                    index[1] = p16Idx[1];
+                    index[2] = p16Idx[2];
+                    p16Idx += 3;
+                }
+            }
+            else
+            {
+                // Strips are formed from last 2 indexes plus the current one for
+                // triangles after the first.
+                // For fans, all the triangles share the first vertex, plus last
+                // one index and the current one for triangles after the first.
+                // We also make sure that all the triangles are process in the
+                // _anti_ clockwise orientation
+                index[(opType == RenderOperation::OT_TRIANGLE_STRIP) && (t & 1) ? 0 : 1] = index[2];
+                // Read for the last tri index
+                if (idx32bit)
+                    index[2] = *p32Idx++;
+                else
+                    index[2] = *p16Idx++;
+            }
+
+            Vector3 v[3];
+            for (size_t i = 0; i < 3; ++i)
+            {
+                // Populate tri original vertex index
+                tri.vertIndex[i] = index[i];
+
+                // Retrieve the vertex position
+                unsigned char* pVertex = pBaseVertex + (index[i] * vbuf->getVertexSize());
+                float* pFloat;
+                posElem->baseVertexPointerToElement(pVertex, &pFloat);
+                v[i].x = *pFloat++;
+                v[i].y = *pFloat++;
+                v[i].z = *pFloat++;
+                // find this vertex in the existing vertex map, or create it
+                tri.sharedVertIndex[i] = 
+                    findOrCreateCommonVertex(v[i], vertexSet, indexSet, index[i]);
+            }
+
+            // Ignore degenerate triangle
+            if (tri.sharedVertIndex[0] != tri.sharedVertIndex[1] &&
+                tri.sharedVertIndex[1] != tri.sharedVertIndex[2] &&
+                tri.sharedVertIndex[2] != tri.sharedVertIndex[0])
+            {
+                // Calculate triangle normal (NB will require recalculation for 
+                // skeletally animated meshes)
+                mEdgeData->triangleFaceNormals.push_back(
+                    Math::calculateFaceNormalWithoutNormalize(v[0], v[1], v[2]));
+                // Add triangle to list
+                mEdgeData->triangles.push_back(tri);
+                // Connect or create edges from common list
+                connectOrCreateEdge(vertexSet, triangleIndex, 
+                    tri.vertIndex[0], tri.vertIndex[1], 
+                    tri.sharedVertIndex[0], tri.sharedVertIndex[1]);
+                connectOrCreateEdge(vertexSet, triangleIndex, 
+                    tri.vertIndex[1], tri.vertIndex[2], 
+                    tri.sharedVertIndex[1], tri.sharedVertIndex[2]);
+                connectOrCreateEdge(vertexSet, triangleIndex, 
+                    tri.vertIndex[2], tri.vertIndex[0], 
+                    tri.sharedVertIndex[2], tri.sharedVertIndex[0]);
+                ++triangleIndex;
+            }
+        }
+
+        // Update triCount for the edge group. Note that we are assume
+        // geometries sorted by vertex set.
+        eg.triCount = triangleIndex - eg.triStart;
+
+        indexData->indexBuffer->unlock();
+        vbuf->unlock();
+    }
+    //---------------------------------------------------------------------
+    void EdgeListBuilder::connectOrCreateEdge(size_t vertexSet, size_t triangleIndex, 
+        size_t vertIndex0, size_t vertIndex1, size_t sharedVertIndex0, 
+        size_t sharedVertIndex1)
+    {
+        // Find the existing edge (should be reversed order) on shared vertices
+        EdgeMap::iterator emi = mEdgeMap.find(std::pair<size_t, size_t>(sharedVertIndex1, sharedVertIndex0));
+        if (emi != mEdgeMap.end())
+        {
+            // The edge already exist, connect it
+            EdgeData::Edge& e = mEdgeData->edgeGroups[emi->second.first].edges[emi->second.second];
+            // update with second side
+            e.triIndex[1] = triangleIndex;
+            e.degenerate = false;
+
+            // Remove from the edge map, so we never supplied to connect edge again
+            mEdgeMap.erase(emi);
+        }
+        else
+        {
+            // Not found, create new edge
+            mEdgeMap.insert(EdgeMap::value_type(
+                std::pair<size_t, size_t>(sharedVertIndex0, sharedVertIndex1),
+                std::pair<size_t, size_t>(vertexSet, mEdgeData->edgeGroups[vertexSet].edges.size())));
+            EdgeData::Edge e;
+            e.degenerate = true; // initialise as degenerate
+
+            // Set only first tri, the other will be completed in connect existing edge
+            e.triIndex[0] = triangleIndex;
+            e.triIndex[1] = static_cast<size_t>(~0);
+            e.sharedVertIndex[0] = sharedVertIndex0;
+            e.sharedVertIndex[1] = sharedVertIndex1;
+            e.vertIndex[0] = vertIndex0;
+            e.vertIndex[1] = vertIndex1;
+            mEdgeData->edgeGroups[vertexSet].edges.push_back(e);
+        }
+    }
+    //---------------------------------------------------------------------
+    size_t EdgeListBuilder::findOrCreateCommonVertex(const Vector3& vec, 
+        size_t vertexSet, size_t indexSet, size_t originalIndex)
+    {
+        // Because the algorithm doesn't care about manifold or not, we just identifying
+        // the common vertex by EXACT same position.
+        // Hint: We can use quantize method for welding almost same position vertex fastest.
+        std::pair<CommonVertexMap::iterator, bool> inserted =
+            mCommonVertexMap.insert(CommonVertexMap::value_type(vec, mVertices.size()));
+        if (!inserted.second)
+        {
+            // Already existing, return old one
+            return inserted.first->second;
+        }
+        // Not found, insert
+        CommonVertex newCommon;
+        newCommon.index = mVertices.size();
+        newCommon.position = vec;
+        newCommon.vertexSet = vertexSet;
+        newCommon.indexSet = indexSet;
+        newCommon.originalIndex = originalIndex;
+        mVertices.push_back(newCommon);
+        return newCommon.index;
+    }
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    void EdgeData::updateTriangleLightFacing(const Vector4& lightPos)
+    {
+        // Triangle face normals should be 1:1 with light facing flags
+        assert(triangleFaceNormals.size() == triangleLightFacings.size());
+
+        // Use optimised util to determine if triangle's face normal are light facing
+        OptimisedUtil::getImplementation()->calculateLightFacing(
+            lightPos,
+            &triangleFaceNormals.front(),
+            &triangleLightFacings.front(),
+            triangleLightFacings.size());
+    }
+    //---------------------------------------------------------------------
+    void EdgeData::updateFaceNormals(size_t vertexSet, 
+        const HardwareVertexBufferSharedPtr& positionBuffer)
+    {
+        assert (positionBuffer->getVertexSize() == sizeof(float) * 3
+            && "Position buffer should contain only positions!");
+
+        // Triangle face normals should be 1:1 with triangles
+        assert(triangleFaceNormals.size() == triangles.size());
+
+        // Lock buffer for reading
+        float* pVert = static_cast<float*>(
+            positionBuffer->lock(HardwareBuffer::HBL_READ_ONLY));
+
+        // Calculate triangles which are using this vertex set
+        const EdgeData::EdgeGroup& eg = edgeGroups[vertexSet];
+        OptimisedUtil::getImplementation()->calculateFaceNormals(
+            pVert,
+            &triangles[eg.triStart],
+            &triangleFaceNormals[eg.triStart],
+            eg.triCount);
+
+        // unlock the buffer
+        positionBuffer->unlock();
+    }
+    //---------------------------------------------------------------------
+    void EdgeListBuilder::log(Log* l)
+    {
+        l->logMessage("EdgeListBuilder Log");
+        l->logMessage("-------------------");
+        l->logMessage("Number of vertex sets: " + StringConverter::toString(mVertexDataList.size()));
+        l->logMessage("Number of index sets: " + StringConverter::toString(mGeometryList.size()));
+        
+        size_t i, j;
+        // Log original vertex data
+        for(i = 0; i < mVertexDataList.size(); ++i)
+        {
+            const VertexData* vData = mVertexDataList[i];
+            l->logMessage(".");
+            l->logMessage("Original vertex set " + 
+                StringConverter::toString(i) + " - vertex count " + 
+                StringConverter::toString(vData->vertexCount));
+            const VertexElement* posElem = vData->vertexDeclaration->findElementBySemantic(VES_POSITION);
+            HardwareVertexBufferSharedPtr vbuf = 
+                vData->vertexBufferBinding->getBuffer(posElem->getSource());
+            // lock the buffer for reading
+            unsigned char* pBaseVertex = static_cast<unsigned char*>(
+                vbuf->lock(HardwareBuffer::HBL_READ_ONLY));
+            float* pFloat;
+            for (j = 0; j < vData->vertexCount; ++j)
+            {
+                posElem->baseVertexPointerToElement(pBaseVertex, &pFloat);
+                l->logMessage("Vertex " + StringConverter::toString(j) + 
+                    ": (" + StringConverter::toString(pFloat[0]) + 
+                    ", " + StringConverter::toString(pFloat[1]) + 
+                    ", " + StringConverter::toString(pFloat[2]) + ")");
+                pBaseVertex += vbuf->getVertexSize();
+            }
+            vbuf->unlock();
+        }
+
+        // Log original index data
+        for(i = 0; i < mGeometryList.size(); i++)
+        {
+            const IndexData* iData = mGeometryList[i].indexData;
+            l->logMessage(".");
+            l->logMessage("Original triangle set " + 
+                StringConverter::toString(mGeometryList[i].indexSet) + " - index count " + 
+                StringConverter::toString(iData->indexCount) + " - " + 
+            "vertex set " + StringConverter::toString(mGeometryList[i].vertexSet) + " - " + 
+            "operationType " + StringConverter::toString(mGeometryList[i].opType));
+            // Get the indexes ready for reading
+            unsigned short* p16Idx;
+            unsigned int* p32Idx;
+
+            if (iData->indexBuffer->getType() == HardwareIndexBuffer::IT_32BIT)
+            {
+                p32Idx = static_cast<unsigned int*>(
+                    iData->indexBuffer->lock(HardwareBuffer::HBL_READ_ONLY));
+            }
+            else
+            {
+                p16Idx = static_cast<unsigned short*>(
+                    iData->indexBuffer->lock(HardwareBuffer::HBL_READ_ONLY));
+            }
+
+            for (j = 0; j < iData->indexCount;  )
+            {
+                if (iData->indexBuffer->getType() == HardwareIndexBuffer::IT_32BIT)
+                {
+                    if (mGeometryList[i].opType == RenderOperation::OT_TRIANGLE_LIST
+                        || j == 0)
+                    {
+		    	unsigned int n1 = *p32Idx++;
+		    	unsigned int n2 = *p32Idx++;
+		    	unsigned int n3 = *p32Idx++;
+                        l->logMessage("Triangle " + StringConverter::toString(j) + 
+                            ": (" + StringConverter::toString(n1) + 
+                            ", " + StringConverter::toString(n2) + 
+                            ", " + StringConverter::toString(n3) + ")");
+                        j += 3;
+                    }
+                    else
+                    {
+                        l->logMessage("Triangle " + StringConverter::toString(j) + 
+                            ": (" + StringConverter::toString(*p32Idx++) + ")");
+                        j++;
+                    }
+                }
+                else
+                {
+                    if (mGeometryList[i].opType == RenderOperation::OT_TRIANGLE_LIST
+                        || j == 0)
+                    {
+		    	unsigned short n1 = *p16Idx++;
+		    	unsigned short n2 = *p16Idx++;
+		    	unsigned short n3 = *p16Idx++;
+                        l->logMessage("Index " + StringConverter::toString(j) + 
+                            ": (" + StringConverter::toString(n1) + 
+                            ", " + StringConverter::toString(n2) + 
+                            ", " + StringConverter::toString(n3) + ")");
+                        j += 3;
+                    }
+                    else
+                    {
+                        l->logMessage("Triangle " + StringConverter::toString(j) + 
+                            ": (" + StringConverter::toString(*p16Idx++) + ")");
+                        j++;
+                    }
+                }
+
+
+            }
+
+            iData->indexBuffer->unlock();
+
+
+            // Log common vertex list
+            l->logMessage(".");
+            l->logMessage("Common vertex list - vertex count " + 
+                StringConverter::toString(mVertices.size()));
+            for (i = 0; i < mVertices.size(); ++i)
+            {
+                CommonVertex& c = mVertices[i];
+                l->logMessage("Common vertex " + StringConverter::toString(i) + 
+                    ": (vertexSet=" + StringConverter::toString(c.vertexSet) + 
+                    ", originalIndex=" + StringConverter::toString(c.originalIndex) + 
+                    ", position=" + StringConverter::toString(c.position));
+            }
+        }
+
+    }
+
+
+
+}
+
Index: /OgreMain/src/OgreEntity.cpp
===================================================================
--- /OgreMain/src/OgreEntity.cpp	(revision 5)
+++ /OgreMain/src/OgreEntity.cpp	(revision 5)
@@ -0,0 +1,2045 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreEntity.h"
+
+#include "OgreMeshManager.h"
+#include "OgreSubMesh.h"
+#include "OgreSubEntity.h"
+#include "OgreException.h"
+#include "OgreSceneManager.h"
+#include "OgreLogManager.h"
+#include "OgreSkeleton.h"
+#include "OgreBone.h"
+#include "OgreCamera.h"
+#include "OgreTagPoint.h"
+#include "OgreAxisAlignedBox.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreVector4.h"
+#include "OgreRoot.h"
+#include "OgreTechnique.h"
+#include "OgrePass.h"
+#include "OgreSkeletonInstance.h"
+#include "OgreEdgeListBuilder.h"
+#include "OgreStringConverter.h"
+#include "OgreAnimation.h"
+#include "OgreAlignedAllocator.h"
+#include "OgreOptimisedUtil.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    Entity::Entity ()
+		: mAnimationState(NULL),
+          mSkelAnimVertexData(0),
+		  mSoftwareVertexAnimVertexData(0),
+		  mHardwareVertexAnimVertexData(0),
+          mPreparedForShadowVolumes(false),
+          mBoneWorldMatrices(NULL),
+          mBoneMatrices(NULL),
+          mNumBoneMatrices(0),
+		  mFrameAnimationLastUpdated(std::numeric_limits<unsigned long>::max()),
+          mFrameBonesLastUpdated(NULL),
+		  mSharedSkeletonEntities(NULL),
+		  mDisplaySkeleton(false),
+	      mHardwareAnimation(false),
+		  mVertexProgramInUse(false),
+		  mSoftwareAnimationRequests(0),
+		  mSoftwareAnimationNormalsRequests(0),
+		  mMeshLodIndex(0),
+		  mMeshLodFactorInv(1.0f),
+		  mMinMeshLodIndex(99),
+		  mMaxMeshLodIndex(0),		// Backwards, remember low value = high detail
+		  mMaterialLodFactorInv(1.0f),
+		  mMinMaterialLodIndex(99),
+		  mMaxMaterialLodIndex(0), 		// Backwards, remember low value = high detail
+          mSkeletonInstance(0),
+		  mInitialised(false),
+		  mLastParentXform(Matrix4::ZERO),
+          mFullBoundingBox(),
+		  mNormaliseNormals(false)
+    {
+    }
+    //-----------------------------------------------------------------------
+    Entity::Entity( const String& name, MeshPtr& mesh) :
+		MovableObject(name),
+        mMesh(mesh),
+        mAnimationState(NULL),
+		mSkelAnimVertexData(0),
+		mSoftwareVertexAnimVertexData(0),
+		mHardwareVertexAnimVertexData(0),
+        mPreparedForShadowVolumes(false),
+        mBoneWorldMatrices(NULL),
+        mBoneMatrices(NULL),
+        mNumBoneMatrices(0),
+		mFrameAnimationLastUpdated(std::numeric_limits<unsigned long>::max()),
+        mFrameBonesLastUpdated(NULL),
+        mSharedSkeletonEntities(NULL),
+		mDisplaySkeleton(false),
+		mHardwareAnimation(false),
+		mVertexProgramInUse(false),
+		mSoftwareAnimationRequests(0),
+		mSoftwareAnimationNormalsRequests(0),
+		mMeshLodIndex(0),
+		mMeshLodFactorInv(1.0f),
+		mMinMeshLodIndex(99),
+		mMaxMeshLodIndex(0),		// Backwards, remember low value = high detail
+		mMaterialLodFactorInv(1.0f),
+		mMinMaterialLodIndex(99),
+		mMaxMaterialLodIndex(0), 		// Backwards, remember low value = high detail
+		mSkeletonInstance(0),
+		mInitialised(false),
+		mLastParentXform(Matrix4::ZERO),
+        mFullBoundingBox(),
+		mNormaliseNormals(false)
+	{
+		_initialise();
+    }
+	//-----------------------------------------------------------------------
+	void Entity::backgroundLoadingComplete(Resource* res)
+	{
+		if (res == mMesh.get())
+		{
+			// mesh loading has finished, we can construct ourselves now
+			_initialise();
+		}
+	}
+	//-----------------------------------------------------------------------
+	void Entity::_initialise(bool forceReinitialise)
+	{
+		if (forceReinitialise)
+			_deinitialise();
+
+		if (mInitialised)
+			return;
+
+		if (mMesh->isBackgroundLoaded() && !mMesh->isLoaded())
+		{
+			// register for a callback when mesh is finished loading
+			// do this before asking for load to happen to avoid race
+			mMesh->addListener(this);
+		}
+		
+		// On-demand load
+		mMesh->load();
+		// If loading failed, or deferred loading isn't done yet, defer
+		// Will get a callback in the case of deferred loading
+		// Skeletons are cascade-loaded so no issues there
+		if (!mMesh->isLoaded())
+			return;
+
+		// Is mesh skeletally animated?
+		if (mMesh->hasSkeleton() && !mMesh->getSkeleton().isNull())
+		{
+			mSkeletonInstance = new SkeletonInstance(mMesh->getSkeleton());
+			mSkeletonInstance->load();
+		}
+
+		// Build main subentity list
+		buildSubEntityList(mMesh, &mSubEntityList);
+
+		// Check if mesh is using manual LOD
+		if (mMesh->isLodManual())
+		{
+			ushort i, numLod;
+			numLod = mMesh->getNumLodLevels();
+			// NB skip LOD 0 which is the original
+			for (i = 1; i < numLod; ++i)
+			{
+				const MeshLodUsage& usage = mMesh->getLodLevel(i);
+				// Manually create entity
+				Entity* lodEnt = new Entity(mName + "Lod" + StringConverter::toString(i),
+					usage.manualMesh);
+				mLodEntityList.push_back(lodEnt);
+			}
+		}
+
+
+		// Initialise the AnimationState, if Mesh has animation
+		if (hasSkeleton())
+		{
+			mFrameBonesLastUpdated = new unsigned long(std::numeric_limits<unsigned long>::max());
+			mNumBoneMatrices = mSkeletonInstance->getNumBones();
+			mBoneMatrices = static_cast<Matrix4*>(AlignedMemory::allocate(sizeof(Matrix4) * mNumBoneMatrices));
+		}
+		if (hasSkeleton() || hasVertexAnimation())
+		{
+			mAnimationState = new AnimationStateSet();
+			mMesh->_initAnimationState(mAnimationState);
+			prepareTempBlendBuffers();
+		}
+
+		reevaluateVertexProcessing();
+
+
+		mInitialised = true;
+
+	}
+	//-----------------------------------------------------------------------
+	void Entity::_deinitialise(void)
+	{
+		if (!mInitialised)
+			return;
+
+		// Delete submeshes
+		SubEntityList::iterator i, iend;
+		iend = mSubEntityList.end();
+		for (i = mSubEntityList.begin(); i != iend; ++i)
+		{
+			// Delete SubEntity
+			delete *i;
+		}
+		mSubEntityList.clear();
+		
+		// Delete LOD entities
+		LODEntityList::iterator li, liend;
+		liend = mLodEntityList.end();
+		for (li = mLodEntityList.begin(); li != liend; ++li)
+		{
+			// Delete
+			delete (*li);
+		}
+        mLodEntityList.clear();
+        
+		// Delete shadow renderables
+		ShadowRenderableList::iterator si, siend;
+		siend = mShadowRenderables.end();
+		for (si = mShadowRenderables.begin(); si != siend; ++si)
+		{
+			delete *si;
+		}
+        mShadowRenderables.clear();
+        
+		// Detach all child objects, do this manually to avoid needUpdate() call
+		// which can fail because of deleted items
+		detachAllObjectsImpl();
+
+		if (mSkeletonInstance) {
+			AlignedMemory::deallocate(mBoneWorldMatrices);
+
+            if (mSharedSkeletonEntities) {
+                mSharedSkeletonEntities->erase(this);
+                if (mSharedSkeletonEntities->size() == 1)
+                {
+                    (*mSharedSkeletonEntities->begin())->stopSharingSkeletonInstance();
+                }
+                // Should never occuring, just in case
+                else if (mSharedSkeletonEntities->empty())
+                {
+                    delete mSharedSkeletonEntities;
+                    delete mFrameBonesLastUpdated;
+                    delete mSkeletonInstance;
+                    AlignedMemory::deallocate(mBoneMatrices);
+                    delete mAnimationState;
+                }
+            } else {
+                delete mFrameBonesLastUpdated;
+                delete mSkeletonInstance;
+                AlignedMemory::deallocate(mBoneMatrices);
+                delete mAnimationState;
+            }
+        }
+		else if (hasVertexAnimation())
+		{
+			delete mAnimationState;
+		}
+
+		delete mSkelAnimVertexData;
+		delete mSoftwareVertexAnimVertexData;
+		delete mHardwareVertexAnimVertexData;
+
+		mInitialised = false;
+	}
+    //-----------------------------------------------------------------------
+    Entity::~Entity()
+    {
+		_deinitialise();
+    }
+	//-----------------------------------------------------------------------
+	bool Entity::hasVertexAnimation(void) const
+	{
+		return mMesh->hasVertexAnimation();
+	}
+    //-----------------------------------------------------------------------
+    const MeshPtr& Entity::getMesh(void) const
+    {
+        return mMesh;
+    }
+    //-----------------------------------------------------------------------
+    SubEntity* Entity::getSubEntity(unsigned int index) const
+    {
+        if (index >= mSubEntityList.size())
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+            "Index out of bounds.",
+            "Entity::getSubEntity");
+        return mSubEntityList[index];
+    }
+    //-----------------------------------------------------------------------
+    SubEntity* Entity::getSubEntity(const String& name) const
+    {
+        ushort index = mMesh->_getSubMeshIndex(name);
+        return getSubEntity(index);
+    }
+    //-----------------------------------------------------------------------
+    unsigned int Entity::getNumSubEntities(void) const
+    {
+        return static_cast< unsigned int >( mSubEntityList.size() );
+    }
+    //-----------------------------------------------------------------------
+    Entity* Entity::clone( const String& newName) const
+    {
+   		if (!mManager)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Cannot clone an Entity that wasn't created through a "
+				"SceneManager", "Entity::clone");
+		}
+	    Entity* newEnt = mManager->createEntity(newName, getMesh()->getName() );
+
+		if (mInitialised)
+		{
+			// Copy material settings
+			SubEntityList::const_iterator i;
+			unsigned int n = 0;
+			for (i = mSubEntityList.begin(); i != mSubEntityList.end(); ++i, ++n)
+			{
+				newEnt->getSubEntity(n)->setMaterialName((*i)->getMaterialName());
+			}
+			if (mAnimationState)
+			{
+				delete newEnt->mAnimationState;
+				newEnt->mAnimationState = new AnimationStateSet(*mAnimationState);
+			}
+		}
+
+        return newEnt;
+    }
+    //-----------------------------------------------------------------------
+    void Entity::setMaterialName(const String& name)
+    {
+        // Set for all subentities
+        SubEntityList::iterator i;
+        for (i = mSubEntityList.begin(); i != mSubEntityList.end(); ++i)
+        {
+            (*i)->setMaterialName(name);
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void Entity::_notifyCurrentCamera(Camera* cam)
+    {
+		MovableObject::_notifyCurrentCamera(cam);
+
+        // Calculate the LOD
+        if (mParentNode)
+        {
+            Real squaredDepth = mParentNode->getSquaredViewDepth(cam);
+
+            // Do Mesh LOD
+            // Adjust this depth by the entity bias factor
+            Real tmp = squaredDepth * mMeshLodFactorInv;
+            // Now adjust it by the camera bias
+            tmp = tmp * cam->_getLodBiasInverse();
+            // Get the index at this biased depth
+            mMeshLodIndex = mMesh->getLodIndexSquaredDepth(tmp);
+            // Apply maximum detail restriction (remember lower = higher detail)
+            mMeshLodIndex = std::max(mMaxMeshLodIndex, mMeshLodIndex);
+            // Apply minimum detail restriction (remember higher = lower detail)
+            mMeshLodIndex = std::min(mMinMeshLodIndex, mMeshLodIndex);
+
+            // Now do material LOD
+            // Adjust this depth by the entity bias factor
+            tmp = squaredDepth * mMaterialLodFactorInv;
+            // Now adjust it by the camera bias
+            tmp = tmp * cam->_getLodBiasInverse();
+            SubEntityList::iterator i, iend;
+            iend = mSubEntityList.end();
+            for (i = mSubEntityList.begin(); i != iend; ++i)
+            {
+                // Get the index at this biased depth
+                unsigned short idx = (*i)->mpMaterial->getLodIndexSquaredDepth(tmp);
+                // Apply maximum detail restriction (remember lower = higher detail)
+                idx = std::max(mMaxMaterialLodIndex, idx);
+                // Apply minimum detail restriction (remember higher = lower detail)
+                (*i)->mMaterialLodIndex = std::min(mMinMaterialLodIndex, idx);
+
+				// Also invalidate any camera distance cache
+				(*i)->_invalidateCameraCache ();
+            }
+
+
+        }
+        // Notify any child objects
+        ChildObjectList::iterator child_itr = mChildObjectList.begin();
+        ChildObjectList::iterator child_itr_end = mChildObjectList.end();
+        for( ; child_itr != child_itr_end; child_itr++)
+        {
+            (*child_itr).second->_notifyCurrentCamera(cam);
+        }
+    }
+    //-----------------------------------------------------------------------
+    const AxisAlignedBox& Entity::getBoundingBox(void) const
+    {
+		// Get from Mesh
+        mFullBoundingBox = mMesh->getBounds();
+        mFullBoundingBox.merge(getChildObjectsBoundingBox());
+
+        // Don't scale here, this is taken into account when world BBox calculation is done
+
+        return mFullBoundingBox;
+    }
+    //-----------------------------------------------------------------------
+    AxisAlignedBox Entity::getChildObjectsBoundingBox(void) const
+    {
+        AxisAlignedBox aa_box;
+        AxisAlignedBox full_aa_box;
+        full_aa_box.setNull();
+
+        ChildObjectList::const_iterator child_itr = mChildObjectList.begin();
+        ChildObjectList::const_iterator child_itr_end = mChildObjectList.end();
+        for( ; child_itr != child_itr_end; child_itr++)
+        {
+            aa_box = child_itr->second->getBoundingBox();
+            TagPoint* tp = (TagPoint*)child_itr->second->getParentNode();
+            // Use transform local to skeleton since world xform comes later
+            aa_box.transformAffine(tp->_getFullLocalTransform());
+
+            full_aa_box.merge(aa_box);
+        }
+
+        return full_aa_box;
+    }
+	//-----------------------------------------------------------------------
+	const AxisAlignedBox& Entity::getWorldBoundingBox(bool derive) const
+	{
+		if (derive)
+		{
+			// derive child bounding boxes
+			ChildObjectList::const_iterator child_itr = mChildObjectList.begin();
+			ChildObjectList::const_iterator child_itr_end = mChildObjectList.end();
+			for( ; child_itr != child_itr_end; child_itr++)
+			{
+				child_itr->second->getWorldBoundingBox(true);
+			}
+		}
+		return MovableObject::getWorldBoundingBox(derive);
+	}
+	//-----------------------------------------------------------------------
+	const Sphere& Entity::getWorldBoundingSphere(bool derive) const
+	{
+		if (derive)
+		{
+			// derive child bounding boxes
+			ChildObjectList::const_iterator child_itr = mChildObjectList.begin();
+			ChildObjectList::const_iterator child_itr_end = mChildObjectList.end();
+			for( ; child_itr != child_itr_end; child_itr++)
+			{
+				child_itr->second->getWorldBoundingSphere(true);
+			}
+		}
+		return MovableObject::getWorldBoundingSphere(derive);
+
+	}
+    //-----------------------------------------------------------------------
+    void Entity::_updateRenderQueue(RenderQueue* queue)
+    {
+		// Do nothing if not initialised yet
+		if (!mInitialised)
+			return;
+
+        // Check we're not using a manual LOD
+        if (mMeshLodIndex > 0 && mMesh->isLodManual())
+        {
+            // Use alternate entity
+            assert( static_cast< size_t >( mMeshLodIndex - 1 ) < mLodEntityList.size() &&
+                "No LOD EntityList - did you build the manual LODs after creating the entity?");
+            // index - 1 as we skip index 0 (original lod)
+            if (hasSkeleton() && mLodEntityList[mMeshLodIndex - 1]->hasSkeleton())
+            {
+                // Copy the animation state set to lod entity, we assume the lod
+                // entity only has a subset animation states
+                mAnimationState->copyMatchingState(
+					mLodEntityList[mMeshLodIndex - 1]->mAnimationState);
+            }
+            mLodEntityList[mMeshLodIndex - 1]->_updateRenderQueue(queue);
+            return;
+        }
+
+        // Add each visible SubEntity to the queue
+        SubEntityList::iterator i, iend;
+        iend = mSubEntityList.end();
+        for (i = mSubEntityList.begin(); i != iend; ++i)
+        {
+            if((*i)->isVisible())
+            {
+                if(mRenderQueueIDSet)
+                {
+                    queue->addRenderable(*i, mRenderQueueID);
+                }
+                else
+                {
+                    queue->addRenderable(*i);
+                }
+            }
+        }
+
+        // Since we know we're going to be rendered, take this opportunity to
+        // update the animation
+        if (hasSkeleton() || hasVertexAnimation())
+        {
+            updateAnimation();
+
+            //--- pass this point,  we are sure that the transformation matrix of each bone and tagPoint have been updated
+            ChildObjectList::iterator child_itr = mChildObjectList.begin();
+            ChildObjectList::iterator child_itr_end = mChildObjectList.end();
+            for( ; child_itr != child_itr_end; child_itr++)
+            {
+                if ((*child_itr).second->isVisible())
+                    (*child_itr).second->_updateRenderQueue(queue);
+            }
+        }
+
+        // HACK to display bones
+        // This won't work if the entity is not centered at the origin
+        // TODO work out a way to allow bones to be rendered when Entity not centered
+        if (mDisplaySkeleton && hasSkeleton())
+        {
+            int numBones = mSkeletonInstance->getNumBones();
+            for (int b = 0; b < numBones; ++b)
+            {
+                Bone* bone = mSkeletonInstance->getBone(b);
+                if(mRenderQueueIDSet)
+                {
+                     queue->addRenderable(bone, mRenderQueueID);
+                } else {
+                     queue->addRenderable(bone);
+                }
+            }
+        }
+
+
+
+
+    }
+    //-----------------------------------------------------------------------
+    AnimationState* Entity::getAnimationState(const String& name) const
+    {
+        if (!mAnimationState)
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Entity is not animated",
+                "Entity::getAnimationState");
+        }
+
+		return mAnimationState->getAnimationState(name);
+    }
+    //-----------------------------------------------------------------------
+    AnimationStateSet* Entity::getAllAnimationStates(void) const
+    {
+        return mAnimationState;
+    }
+    //-----------------------------------------------------------------------
+    const String& Entity::getMovableType(void) const
+    {
+		return EntityFactory::FACTORY_TYPE_NAME;
+    }
+	//-----------------------------------------------------------------------
+	bool Entity::tempVertexAnimBuffersBound(void) const
+	{
+		// Do we still have temp buffers for software vertex animation bound?
+		bool ret = true;
+		if (mMesh->sharedVertexData && mMesh->getSharedVertexDataAnimationType() != VAT_NONE)
+		{
+			ret = ret && mTempVertexAnimInfo.buffersCheckedOut(true, false);
+		}
+		for (SubEntityList::const_iterator i = mSubEntityList.begin();
+			i != mSubEntityList.end(); ++i)
+		{
+			SubEntity* sub = *i;
+			if (!sub->getSubMesh()->useSharedVertices
+				&& sub->getSubMesh()->getVertexAnimationType() != VAT_NONE)
+			{
+				ret = ret && sub->_getVertexAnimTempBufferInfo()->buffersCheckedOut(true, false);
+			}
+		}
+		return ret;
+	}
+    //-----------------------------------------------------------------------
+    bool Entity::tempSkelAnimBuffersBound(bool requestNormals) const
+    {
+        // Do we still have temp buffers for software skeleton animation bound?
+        if (mSkelAnimVertexData)
+        {
+            if (!mTempSkelAnimInfo.buffersCheckedOut(true, requestNormals))
+                return false;
+        }
+        for (SubEntityList::const_iterator i = mSubEntityList.begin();
+            i != mSubEntityList.end(); ++i)
+        {
+            SubEntity* sub = *i;
+            if (sub->isVisible() && sub->mSkelAnimVertexData)
+            {
+                if (!sub->mTempSkelAnimInfo.buffersCheckedOut(true, requestNormals))
+                    return false;
+            }
+        }
+        return true;
+    }
+    //-----------------------------------------------------------------------
+    void Entity::updateAnimation(void)
+    {
+		// Do nothing if not initialised yet
+		if (!mInitialised)
+			return;
+
+		Root& root = Root::getSingleton();
+		bool hwAnimation = isHardwareAnimationEnabled();
+		bool forcedSwAnimation = getSoftwareAnimationRequests()>0;
+		bool forcedNormals = getSoftwareAnimationNormalsRequests()>0;
+		bool stencilShadows = false;
+		if (getCastShadows() && hasEdgeList() && root._getCurrentSceneManager())
+			stencilShadows =  root._getCurrentSceneManager()->isShadowTechniqueStencilBased();
+		bool softwareAnimation = !hwAnimation || stencilShadows || forcedSwAnimation;
+		// Blend normals in s/w only if we're not using h/w animation,
+		// since shadows only require positions
+		bool blendNormals = !hwAnimation || forcedNormals;
+        // Animation dirty if animation state modified or manual bones modified
+        bool animationDirty =
+            (mFrameAnimationLastUpdated != mAnimationState->getDirtyFrameNumber()) ||
+            (hasSkeleton() && getSkeleton()->getManualBonesDirty());
+
+		// We only do these tasks if animation is dirty
+		// Or, if we're using a skeleton and manual bones have been moved
+		// Or, if we're using software animation and temp buffers are unbound
+        if (animationDirty ||
+			(softwareAnimation && hasVertexAnimation() && !tempVertexAnimBuffersBound()) ||
+			(softwareAnimation && hasSkeleton() && !tempSkelAnimBuffersBound(blendNormals)))
+        {
+			if (hasVertexAnimation())
+			{
+				if (softwareAnimation)
+				{
+					// grab & bind temporary buffer for positions
+					if (mSoftwareVertexAnimVertexData
+						&& mMesh->getSharedVertexDataAnimationType() != VAT_NONE)
+					{
+						mTempVertexAnimInfo.checkoutTempCopies(true, false);
+						// NB we suppress hardware upload while doing blend if we're
+						// hardware animation, because the only reason for doing this
+						// is for shadow, which need only be uploaded then
+						mTempVertexAnimInfo.bindTempCopies(mSoftwareVertexAnimVertexData,
+							hwAnimation);
+					}
+					SubEntityList::iterator i, iend;
+					iend = mSubEntityList.end();
+					for (i = mSubEntityList.begin(); i != iend; ++i)
+					{
+						// Blend dedicated geometry
+						SubEntity* se = *i;
+						if (se->isVisible() && se->mSoftwareVertexAnimVertexData
+							&& se->getSubMesh()->getVertexAnimationType() != VAT_NONE)
+						{
+							se->mTempVertexAnimInfo.checkoutTempCopies(true, false);
+							se->mTempVertexAnimInfo.bindTempCopies(se->mSoftwareVertexAnimVertexData,
+								hwAnimation);
+						}
+
+					}
+				}
+				applyVertexAnimation(hwAnimation, stencilShadows);
+			}
+
+			if (hasSkeleton())
+			{
+				cacheBoneMatrices();
+
+				// Software blend?
+				if (softwareAnimation)
+				{
+                    const Matrix4* blendMatrices[256];
+
+					// Ok, we need to do a software blend
+					// Firstly, check out working vertex buffers
+					if (mSkelAnimVertexData)
+					{
+						// Blend shared geometry
+						// NB we suppress hardware upload while doing blend if we're
+						// hardware animation, because the only reason for doing this
+						// is for shadow, which need only be uploaded then
+						mTempSkelAnimInfo.checkoutTempCopies(true, blendNormals);
+						mTempSkelAnimInfo.bindTempCopies(mSkelAnimVertexData,
+							hwAnimation);
+                        // Prepare blend matrices, TODO: Move out of here
+                        Mesh::prepareMatricesForVertexBlend(blendMatrices,
+                            mBoneMatrices, mMesh->sharedBlendIndexToBoneIndexMap);
+						// Blend, taking source from either mesh data or morph data
+						Mesh::softwareVertexBlend(
+							(mMesh->getSharedVertexDataAnimationType() != VAT_NONE) ?
+								mSoftwareVertexAnimVertexData :	mMesh->sharedVertexData,
+							mSkelAnimVertexData,
+							blendMatrices, mMesh->sharedBlendIndexToBoneIndexMap.size(),
+							blendNormals);
+					}
+					SubEntityList::iterator i, iend;
+					iend = mSubEntityList.end();
+					for (i = mSubEntityList.begin(); i != iend; ++i)
+					{
+						// Blend dedicated geometry
+						SubEntity* se = *i;
+						if (se->isVisible() && se->mSkelAnimVertexData)
+						{
+							se->mTempSkelAnimInfo.checkoutTempCopies(true, blendNormals);
+							se->mTempSkelAnimInfo.bindTempCopies(se->mSkelAnimVertexData,
+								hwAnimation);
+                            // Prepare blend matrices, TODO: Move out of here
+                            Mesh::prepareMatricesForVertexBlend(blendMatrices,
+                                mBoneMatrices, se->mSubMesh->blendIndexToBoneIndexMap);
+							// Blend, taking source from either mesh data or morph data
+							Mesh::softwareVertexBlend(
+								(se->getSubMesh()->getVertexAnimationType() != VAT_NONE)?
+									se->mSoftwareVertexAnimVertexData : se->mSubMesh->vertexData,
+								se->mSkelAnimVertexData,
+								blendMatrices, se->mSubMesh->blendIndexToBoneIndexMap.size(),
+								blendNormals);
+						}
+
+					}
+
+				}
+			}
+
+            // Trigger update of bounding box if necessary
+            if (!mChildObjectList.empty())
+                mParentNode->needUpdate();
+
+			mFrameAnimationLastUpdated = mAnimationState->getDirtyFrameNumber();
+        }
+
+        // Need to update the child object's transforms when animation dirty
+        // or parent node transform has altered.
+        if (hasSkeleton() &&
+            (animationDirty || mLastParentXform != _getParentNodeFullTransform()))
+        {
+            // Cache last parent transform for next frame use too.
+            mLastParentXform = _getParentNodeFullTransform();
+
+            //--- Update the child object's transforms
+            ChildObjectList::iterator child_itr = mChildObjectList.begin();
+            ChildObjectList::iterator child_itr_end = mChildObjectList.end();
+            for( ; child_itr != child_itr_end; child_itr++)
+            {
+                (*child_itr).second->getParentNode()->_update(true, true);
+            }
+
+            // Also calculate bone world matrices, since are used as replacement world matrices,
+            // but only if it's used (when using hardware animation and skeleton animated).
+            if (hwAnimation && _isSkeletonAnimated())
+            {
+                // Allocate bone world matrices on demand, for better memory footprint
+                // when using software animation.
+                if (!mBoneWorldMatrices)
+                {
+                    mBoneWorldMatrices =
+                        static_cast<Matrix4*>(AlignedMemory::allocate(sizeof(Matrix4) * mNumBoneMatrices));
+                }
+
+                OptimisedUtil::getImplementation()->concatenateAffineMatrices(
+                    mLastParentXform,
+                    mBoneMatrices,
+                    mBoneWorldMatrices,
+                    mNumBoneMatrices);
+            }
+        }
+    }
+	//-----------------------------------------------------------------------
+	void Entity::initHardwareAnimationElements(VertexData* vdata,
+		ushort numberOfElements)
+	{
+		if (vdata->hwAnimationDataList.size() < numberOfElements)
+		{
+			vdata->allocateHardwareAnimationElements(numberOfElements);
+		}
+		// Initialise parametrics incase we don't use all of them
+		for (size_t i = 0; i < vdata->hwAnimationDataList.size(); ++i)
+		{
+			vdata->hwAnimationDataList[i].parametric = 0.0f;
+		}
+		// reset used count
+		vdata->hwAnimDataItemsUsed = 0;
+
+	}
+	//-----------------------------------------------------------------------
+	void Entity::applyVertexAnimation(bool hardwareAnimation, bool stencilShadows)
+	{
+		const MeshPtr& msh = getMesh();
+		bool swAnim = !hardwareAnimation || stencilShadows || (mSoftwareAnimationRequests>0);
+
+		// make sure we have enough hardware animation elements to play with
+		if (hardwareAnimation)
+		{
+			if (mHardwareVertexAnimVertexData
+				&& msh->getSharedVertexDataAnimationType() != VAT_NONE)
+			{
+				initHardwareAnimationElements(mHardwareVertexAnimVertexData,
+					(msh->getSharedVertexDataAnimationType() == VAT_POSE)
+					? mHardwarePoseCount : 1);
+			}
+			for (SubEntityList::iterator si = mSubEntityList.begin();
+				si != mSubEntityList.end(); ++si)
+			{
+				SubEntity* sub = *si;
+				if (sub->getSubMesh()->getVertexAnimationType() != VAT_NONE &&
+					!sub->getSubMesh()->useSharedVertices)
+				{
+					initHardwareAnimationElements(
+						sub->_getHardwareVertexAnimVertexData(),
+						(sub->getSubMesh()->getVertexAnimationType() == VAT_POSE)
+						? sub->mHardwarePoseCount : 1);
+				}
+			}
+
+		}
+		else
+		{
+			// May be blending multiple poses in software
+			// Suppress hardware upload of buffers
+			if (mSoftwareVertexAnimVertexData &&
+				mMesh->getSharedVertexDataAnimationType() == VAT_POSE)
+			{
+				const VertexElement* elem = mSoftwareVertexAnimVertexData
+					->vertexDeclaration->findElementBySemantic(VES_POSITION);
+				HardwareVertexBufferSharedPtr buf = mSoftwareVertexAnimVertexData
+					->vertexBufferBinding->getBuffer(elem->getSource());
+				buf->suppressHardwareUpdate(true);
+			}
+			for (SubEntityList::iterator si = mSubEntityList.begin();
+				si != mSubEntityList.end(); ++si)
+			{
+				SubEntity* sub = *si;
+				if (!sub->getSubMesh()->useSharedVertices &&
+					sub->getSubMesh()->getVertexAnimationType() == VAT_POSE)
+				{
+					VertexData* data = sub->_getSoftwareVertexAnimVertexData();
+					const VertexElement* elem = data->vertexDeclaration
+						->findElementBySemantic(VES_POSITION);
+					HardwareVertexBufferSharedPtr buf = data
+						->vertexBufferBinding->getBuffer(elem->getSource());
+					buf->suppressHardwareUpdate(true);
+				}
+			}
+		}
+
+
+		// Now apply the animation(s)
+		// Note - you should only apply one morph animation to each set of vertex data
+		// at once; if you do more, only the last one will actually apply
+		markBuffersUnusedForAnimation();
+		ConstEnabledAnimationStateIterator animIt = mAnimationState->getEnabledAnimationStateIterator();
+		while(animIt.hasMoreElements())
+		{
+            const AnimationState* state = animIt.getNext();
+            Animation* anim = msh->_getAnimationImpl(state->getAnimationName());
+            if (anim)
+            {
+                anim->apply(this, state->getTimePosition(), state->getWeight(),
+                    swAnim, hardwareAnimation);
+            }
+		}
+		// Deal with cases where no animation applied
+		restoreBuffersForUnusedAnimation(hardwareAnimation);
+
+		// Unsuppress hardware upload if we suppressed it
+		if (!hardwareAnimation)
+		{
+			if (mSoftwareVertexAnimVertexData &&
+				msh->getSharedVertexDataAnimationType() == VAT_POSE)
+			{
+				const VertexElement* elem = mSoftwareVertexAnimVertexData
+					->vertexDeclaration->findElementBySemantic(VES_POSITION);
+				HardwareVertexBufferSharedPtr buf = mSoftwareVertexAnimVertexData
+					->vertexBufferBinding->getBuffer(elem->getSource());
+				buf->suppressHardwareUpdate(false);
+			}
+			for (SubEntityList::iterator si = mSubEntityList.begin();
+				si != mSubEntityList.end(); ++si)
+			{
+				SubEntity* sub = *si;
+				if (!sub->getSubMesh()->useSharedVertices &&
+					sub->getSubMesh()->getVertexAnimationType() == VAT_POSE)
+				{
+					VertexData* data = sub->_getSoftwareVertexAnimVertexData();
+					const VertexElement* elem = data->vertexDeclaration
+						->findElementBySemantic(VES_POSITION);
+					HardwareVertexBufferSharedPtr buf = data
+						->vertexBufferBinding->getBuffer(elem->getSource());
+					buf->suppressHardwareUpdate(false);
+				}
+			}
+		}
+
+	}
+	//-----------------------------------------------------------------------------
+	void Entity::markBuffersUnusedForAnimation(void)
+	{
+		mVertexAnimationAppliedThisFrame = false;
+		for (SubEntityList::iterator i = mSubEntityList.begin();
+			i != mSubEntityList.end(); ++i)
+		{
+			(*i)->_markBuffersUnusedForAnimation();
+		}
+	}
+	//-----------------------------------------------------------------------------
+	void Entity::_markBuffersUsedForAnimation(void)
+	{
+		mVertexAnimationAppliedThisFrame = true;
+		// no cascade
+	}
+	//-----------------------------------------------------------------------------
+	void Entity::restoreBuffersForUnusedAnimation(bool hardwareAnimation)
+	{
+		// Rebind original positions if:
+		//  We didn't apply any animation and
+		//    We're morph animated (hardware binds keyframe, software is missing)
+		//    or we're pose animated and software (hardware is fine, still bound)
+		if (mMesh->sharedVertexData &&
+			!mVertexAnimationAppliedThisFrame &&
+			(!hardwareAnimation || mMesh->getSharedVertexDataAnimationType() == VAT_MORPH))
+		{
+			const VertexElement* srcPosElem =
+				mMesh->sharedVertexData->vertexDeclaration->findElementBySemantic(VES_POSITION);
+			HardwareVertexBufferSharedPtr srcBuf =
+				mMesh->sharedVertexData->vertexBufferBinding->getBuffer(
+					srcPosElem->getSource());
+
+			// Bind to software
+			const VertexElement* destPosElem =
+				mSoftwareVertexAnimVertexData->vertexDeclaration->findElementBySemantic(VES_POSITION);
+			mSoftwareVertexAnimVertexData->vertexBufferBinding->setBinding(
+				destPosElem->getSource(), srcBuf);
+
+		}
+
+		// rebind any missing hardware pose buffers
+		// Caused by not having any animations enabled, or keyframes which reference
+		// no poses
+		if (mMesh->sharedVertexData && hardwareAnimation 
+			&& mMesh->getSharedVertexDataAnimationType() == VAT_POSE)
+		{
+			bindMissingHardwarePoseBuffers(mMesh->sharedVertexData, mHardwareVertexAnimVertexData);
+		}
+
+
+		for (SubEntityList::iterator i = mSubEntityList.begin();
+			i != mSubEntityList.end(); ++i)
+		{
+			(*i)->_restoreBuffersForUnusedAnimation(hardwareAnimation);
+		}
+
+	}
+	//---------------------------------------------------------------------
+	void Entity::bindMissingHardwarePoseBuffers(const VertexData* srcData, 
+		VertexData* destData)
+	{
+		// For hardware pose animation, also make sure we've bound buffers to all the elements
+		// required - if there are missing bindings for elements in use,
+		// some rendersystems can complain because elements refer
+		// to an unbound source.
+		// Get the original position source, we'll use this to fill gaps
+		const VertexElement* srcPosElem =
+			srcData->vertexDeclaration->findElementBySemantic(VES_POSITION);
+		HardwareVertexBufferSharedPtr srcBuf =
+			srcData->vertexBufferBinding->getBuffer(
+				srcPosElem->getSource());
+
+		for (VertexData::HardwareAnimationDataList::const_iterator i = destData->hwAnimationDataList.begin();
+			i != destData->hwAnimationDataList.end(); ++i)
+		{
+			const VertexData::HardwareAnimationData& animData = *i;
+			if (!destData->vertexBufferBinding->isBufferBound(
+				animData.targetVertexElement->getSource()))
+			{
+				// Bind to a safe default
+				destData->vertexBufferBinding->setBinding(
+					animData.targetVertexElement->getSource(), srcBuf);
+			}
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	void Entity::_updateAnimation(void)
+	{
+		// Externally visible method
+		if (hasSkeleton() || hasVertexAnimation())
+		{
+			updateAnimation();
+		}
+	}
+	//-----------------------------------------------------------------------
+    bool Entity::_isAnimated(void) const
+    {
+        return (mAnimationState && mAnimationState->hasEnabledAnimationState()) ||
+               (getSkeleton() && getSkeleton()->hasManualBones());
+    }
+	//-----------------------------------------------------------------------
+    bool Entity::_isSkeletonAnimated(void) const
+    {
+        return getSkeleton() &&
+            (mAnimationState->hasEnabledAnimationState() || getSkeleton()->hasManualBones());
+    }
+	//-----------------------------------------------------------------------
+	VertexData* Entity::_getSkelAnimVertexData(void) const
+	{
+		assert (mSkelAnimVertexData && "Not software skinned or has no shared vertex data!");
+        return mSkelAnimVertexData;
+	}
+	//-----------------------------------------------------------------------
+	VertexData* Entity::_getSoftwareVertexAnimVertexData(void) const
+	{
+		assert (mSoftwareVertexAnimVertexData && "Not vertex animated or has no shared vertex data!");
+		return mSoftwareVertexAnimVertexData;
+	}
+	//-----------------------------------------------------------------------
+	VertexData* Entity::_getHardwareVertexAnimVertexData(void) const
+	{
+		assert (mHardwareVertexAnimVertexData && "Not vertex animated or has no shared vertex data!");
+		return mHardwareVertexAnimVertexData;
+	}
+	//-----------------------------------------------------------------------
+	TempBlendedBufferInfo* Entity::_getSkelAnimTempBufferInfo(void)
+	{
+		return &mTempSkelAnimInfo;
+	}
+	//-----------------------------------------------------------------------
+	TempBlendedBufferInfo* Entity::_getVertexAnimTempBufferInfo(void)
+	{
+		return &mTempVertexAnimInfo;
+	}
+    //-----------------------------------------------------------------------
+    void Entity::cacheBoneMatrices(void)
+    {
+        Root& root = Root::getSingleton();
+        unsigned long currentFrameNumber = root.getCurrentFrameNumber();
+        if (*mFrameBonesLastUpdated  != currentFrameNumber) {
+
+            mSkeletonInstance->setAnimationState(*mAnimationState);
+            mSkeletonInstance->_getBoneMatrices(mBoneMatrices);
+            *mFrameBonesLastUpdated  = currentFrameNumber;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Entity::setDisplaySkeleton(bool display)
+    {
+        mDisplaySkeleton = display;
+    }
+    //-----------------------------------------------------------------------
+    bool Entity::getDisplaySkeleton(void) const
+    {
+        return mDisplaySkeleton;
+    }
+    //-----------------------------------------------------------------------
+    Entity* Entity::getManualLodLevel(size_t index) const
+    {
+        assert(index < mLodEntityList.size());
+
+        return mLodEntityList[index];
+    }
+    //-----------------------------------------------------------------------
+    size_t Entity::getNumManualLodLevels(void) const
+    {
+        return mLodEntityList.size();
+    }
+    //-----------------------------------------------------------------------
+    void Entity::setMeshLodBias(Real factor, ushort maxDetailIndex, ushort minDetailIndex)
+    {
+        assert(factor > 0.0f && "Bias factor must be > 0!");
+        mMeshLodFactorInv = 1.0f / factor;
+        mMaxMeshLodIndex = maxDetailIndex;
+        mMinMeshLodIndex = minDetailIndex;
+
+    }
+    //-----------------------------------------------------------------------
+    void Entity::setMaterialLodBias(Real factor, ushort maxDetailIndex, ushort minDetailIndex)
+    {
+        assert(factor > 0.0f && "Bias factor must be > 0!");
+        mMaterialLodFactorInv = 1.0f / factor;
+        mMaxMaterialLodIndex = maxDetailIndex;
+        mMinMaterialLodIndex = minDetailIndex;
+
+    }
+    //-----------------------------------------------------------------------
+    void Entity::buildSubEntityList(MeshPtr& mesh, SubEntityList* sublist)
+    {
+        // Create SubEntities
+        unsigned short i, numSubMeshes;
+        SubMesh* subMesh;
+        SubEntity* subEnt;
+
+        numSubMeshes = mesh->getNumSubMeshes();
+        for (i = 0; i < numSubMeshes; ++i)
+        {
+            subMesh = mesh->getSubMesh(i);
+            subEnt = new SubEntity(this, subMesh);
+            if (subMesh->isMatInitialised())
+                subEnt->setMaterialName(subMesh->getMaterialName());
+            sublist->push_back(subEnt);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Entity::setPolygonModeOverrideable(bool overrideable)
+    {
+        SubEntityList::iterator i, iend;
+        iend = mSubEntityList.end();
+
+        for( i = mSubEntityList.begin(); i != iend; ++i )
+        {
+            (*i)->setPolygonModeOverrideable(overrideable);
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    TagPoint* Entity::attachObjectToBone(const String &boneName, MovableObject *pMovable, const Quaternion &offsetOrientation, const Vector3 &offsetPosition)
+    {
+        if (mChildObjectList.find(pMovable->getName()) != mChildObjectList.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM,
+                "An object with the name " + pMovable->getName() + " already attached",
+                "Entity::attachObjectToBone");
+        }
+        if(pMovable->isAttached())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Object already attached to a sceneNode or a Bone",
+                "Entity::attachObjectToBone");
+        }
+        if (!hasSkeleton())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "This entity's mesh has no skeleton to attach object to.",
+                "Entity::attachObjectToBone");
+        }
+        Bone* bone = mSkeletonInstance->getBone(boneName);
+        if (!bone)
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Cannot locate bone named " + boneName,
+                "Entity::attachObjectToBone");
+        }
+
+        TagPoint *tp = mSkeletonInstance->createTagPointOnBone(
+            bone, offsetOrientation, offsetPosition);
+        tp->setParentEntity(this);
+        tp->setChildObject(pMovable);
+
+        attachObjectImpl(pMovable, tp);
+
+        // Trigger update of bounding box if necessary
+        if (mParentNode)
+            mParentNode->needUpdate();
+
+		return tp;
+    }
+
+    //-----------------------------------------------------------------------
+    void Entity::attachObjectImpl(MovableObject *pObject, TagPoint *pAttachingPoint)
+    {
+        assert(mChildObjectList.find(pObject->getName()) == mChildObjectList.end());
+        mChildObjectList[pObject->getName()] = pObject;
+        pObject->_notifyAttached(pAttachingPoint, true);
+    }
+
+    //-----------------------------------------------------------------------
+    MovableObject* Entity::detachObjectFromBone(const String &name)
+    {
+        ChildObjectList::iterator i = mChildObjectList.find(name);
+
+        if (i == mChildObjectList.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "No child object entry found named " + name,
+                "Entity::detachObjectFromBone");
+        }
+        MovableObject *obj = i->second;
+        detachObjectImpl(obj);
+        mChildObjectList.erase(i);
+
+        // Trigger update of bounding box if necessary
+        if (mParentNode)
+            mParentNode->needUpdate();
+
+        return obj;
+    }
+    //-----------------------------------------------------------------------
+    void Entity::detachObjectFromBone(MovableObject* obj)
+    {
+        ChildObjectList::iterator i, iend;
+        iend = mChildObjectList.end();
+        for (i = mChildObjectList.begin(); i != iend; ++i)
+        {
+            if (i->second == obj)
+            {
+                detachObjectImpl(obj);
+                mChildObjectList.erase(i);
+
+                // Trigger update of bounding box if necessary
+                if (mParentNode)
+                    mParentNode->needUpdate();
+                break;
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Entity::detachAllObjectsFromBone(void)
+    {
+        detachAllObjectsImpl();
+
+        // Trigger update of bounding box if necessary
+        if (mParentNode)
+            mParentNode->needUpdate();
+    }
+    //-----------------------------------------------------------------------
+    void Entity::detachObjectImpl(MovableObject* pObject)
+    {
+        TagPoint* tp = static_cast<TagPoint*>(pObject->getParentNode());
+
+        // free the TagPoint so we can reuse it later
+        mSkeletonInstance->freeTagPoint(tp);
+
+        pObject->_notifyAttached((TagPoint*)0);
+    }
+    //-----------------------------------------------------------------------
+    void Entity::detachAllObjectsImpl(void)
+    {
+        ChildObjectList::const_iterator i, iend;
+        iend = mChildObjectList.end();
+        for (i = mChildObjectList.begin(); i != iend; ++i)
+        {
+            detachObjectImpl(i->second);
+        }
+        mChildObjectList.clear();
+    }
+
+    //-----------------------------------------------------------------------
+    Entity::ChildObjectListIterator Entity::getAttachedObjectIterator()
+    {
+        return ChildObjectListIterator(mChildObjectList.begin(), mChildObjectList.end());
+    }
+    //-----------------------------------------------------------------------
+    Real Entity::getBoundingRadius(void) const
+    {
+        Real rad = mMesh->getBoundingSphereRadius();
+        // Scale by largest scale factor
+        if (mParentNode)
+        {
+            const Vector3& s = mParentNode->_getDerivedScale();
+            rad *= std::max(s.x, std::max(s.y, s.z));
+        }
+        return rad;
+    }
+    //-----------------------------------------------------------------------
+    void Entity::prepareTempBlendBuffers(void)
+    {
+        if (mSkelAnimVertexData)
+        {
+            delete mSkelAnimVertexData;
+            mSkelAnimVertexData = 0;
+        }
+		if (mSoftwareVertexAnimVertexData)
+		{
+			delete mSoftwareVertexAnimVertexData;
+			mSoftwareVertexAnimVertexData = 0;
+		}
+		if (mHardwareVertexAnimVertexData)
+		{
+			delete mHardwareVertexAnimVertexData;
+			mHardwareVertexAnimVertexData = 0;
+		}
+
+		if (hasVertexAnimation())
+		{
+			// Shared data
+			if (mMesh->sharedVertexData
+				&& mMesh->getSharedVertexDataAnimationType() != VAT_NONE)
+			{
+				// Create temporary vertex blend info
+				// Prepare temp vertex data if needed
+				// Clone without copying data, don't remove any blending info
+				// (since if we skeletally animate too, we need it)
+				mSoftwareVertexAnimVertexData = mMesh->sharedVertexData->clone(false);
+				extractTempBufferInfo(mSoftwareVertexAnimVertexData, &mTempVertexAnimInfo);
+
+				// Also clone for hardware usage, don't remove blend info since we'll
+				// need it if we also hardware skeletally animate
+				mHardwareVertexAnimVertexData = mMesh->sharedVertexData->clone(false);
+			}
+		}
+
+        if (hasSkeleton())
+        {
+            // Shared data
+            if (mMesh->sharedVertexData)
+            {
+                // Create temporary vertex blend info
+                // Prepare temp vertex data if needed
+                // Clone without copying data, remove blending info
+                // (since blend is performed in software)
+                mSkelAnimVertexData =
+                    cloneVertexDataRemoveBlendInfo(mMesh->sharedVertexData);
+                extractTempBufferInfo(mSkelAnimVertexData, &mTempSkelAnimInfo);
+            }
+
+        }
+
+		// Do SubEntities
+		SubEntityList::iterator i, iend;
+		iend = mSubEntityList.end();
+		for (i = mSubEntityList.begin(); i != iend; ++i)
+		{
+			SubEntity* s = *i;
+			s->prepareTempBlendBuffers();
+		}
+
+        // It's prepared for shadow volumes only if mesh has been prepared for shadow volumes.
+        mPreparedForShadowVolumes = mMesh->isPreparedForShadowVolumes();
+    }
+    //-----------------------------------------------------------------------
+    void Entity::extractTempBufferInfo(VertexData* sourceData, TempBlendedBufferInfo* info)
+    {
+        info->extractFrom(sourceData);
+    }
+    //-----------------------------------------------------------------------
+    VertexData* Entity::cloneVertexDataRemoveBlendInfo(const VertexData* source)
+    {
+        // Clone without copying data
+        VertexData* ret = source->clone(false);
+        const VertexElement* blendIndexElem =
+            source->vertexDeclaration->findElementBySemantic(VES_BLEND_INDICES);
+        const VertexElement* blendWeightElem =
+            source->vertexDeclaration->findElementBySemantic(VES_BLEND_WEIGHTS);
+        // Remove blend index
+        if (blendIndexElem)
+        {
+            // Remove buffer reference
+            ret->vertexBufferBinding->unsetBinding(blendIndexElem->getSource());
+
+        }
+        if (blendWeightElem &&
+            blendWeightElem->getSource() != blendIndexElem->getSource())
+        {
+            // Remove buffer reference
+            ret->vertexBufferBinding->unsetBinding(blendWeightElem->getSource());
+        }
+        // remove elements from declaration
+        ret->vertexDeclaration->removeElement(VES_BLEND_INDICES);
+        ret->vertexDeclaration->removeElement(VES_BLEND_WEIGHTS);
+
+        // Close gaps in bindings for effective and safely
+        ret->closeGapsInBindings();
+
+        return ret;
+    }
+    //-----------------------------------------------------------------------
+    EdgeData* Entity::getEdgeList(void)
+    {
+        // Get from Mesh
+        return mMesh->getEdgeList(mMeshLodIndex);
+    }
+	//-----------------------------------------------------------------------
+    bool Entity::hasEdgeList(void)
+    {
+        // check if mesh has an edge list attached
+        // give mesh a chance to built it if scheduled
+        return (mMesh->getEdgeList(mMeshLodIndex) != NULL);
+    }
+    //-----------------------------------------------------------------------
+    void Entity::reevaluateVertexProcessing(void)
+    {
+        // init
+        mHardwareAnimation = false;
+        mVertexProgramInUse = false; // assume false because we just assign this
+        bool firstPass = true;
+
+        SubEntityList::iterator i, iend;
+        iend = mSubEntityList.end();
+        for (i = mSubEntityList.begin(); i != iend; ++i)
+        {
+			SubEntity* sub = *i;
+            const MaterialPtr& m = sub->getMaterial();
+            // Make sure it's loaded
+            m->load();
+            Technique* t = m->getBestTechnique();
+            if (!t)
+            {
+                // No supported techniques
+                continue;
+            }
+            Pass* p = t->getPass(0);
+            if (!p)
+            {
+                // No passes, invalid
+                continue;
+            }
+            if (p->hasVertexProgram())
+            {
+                // If one material uses a vertex program, set this flag
+                // Causes some special processing like forcing a separate light cap
+                mVertexProgramInUse = true;
+
+                if (hasSkeleton())
+				{
+					// All materials must support skinning for us to consider using
+					// hardware animation - if one fails we use software
+					if (firstPass)
+					{
+						mHardwareAnimation = p->getVertexProgram()->isSkeletalAnimationIncluded();
+						firstPass = false;
+					}
+					else
+					{
+						mHardwareAnimation = mHardwareAnimation &&
+							p->getVertexProgram()->isSkeletalAnimationIncluded();
+					}
+				}
+
+				VertexAnimationType animType = VAT_NONE;
+				if (sub->getSubMesh()->useSharedVertices)
+				{
+					animType = mMesh->getSharedVertexDataAnimationType();
+				}
+				else
+				{
+					animType = sub->getSubMesh()->getVertexAnimationType();
+				}
+				if (animType == VAT_MORPH)
+				{
+					// All materials must support morph animation for us to consider using
+					// hardware animation - if one fails we use software
+					if (firstPass)
+					{
+						mHardwareAnimation = p->getVertexProgram()->isMorphAnimationIncluded();
+						firstPass = false;
+					}
+					else
+					{
+						mHardwareAnimation = mHardwareAnimation &&
+							p->getVertexProgram()->isMorphAnimationIncluded();
+					}
+				}
+				else if (animType == VAT_POSE)
+				{
+					// All materials must support pose animation for us to consider using
+					// hardware animation - if one fails we use software
+					if (firstPass)
+					{
+						mHardwareAnimation = p->getVertexProgram()->isPoseAnimationIncluded();
+						if (sub->getSubMesh()->useSharedVertices)
+							mHardwarePoseCount = p->getVertexProgram()->getNumberOfPosesIncluded();
+						else
+							sub->mHardwarePoseCount = p->getVertexProgram()->getNumberOfPosesIncluded();
+						firstPass = false;
+					}
+					else
+					{
+						mHardwareAnimation = mHardwareAnimation &&
+							p->getVertexProgram()->isPoseAnimationIncluded();
+						if (sub->getSubMesh()->useSharedVertices)
+							mHardwarePoseCount = std::max(mHardwarePoseCount,
+								p->getVertexProgram()->getNumberOfPosesIncluded());
+						else
+							sub->mHardwarePoseCount = std::max(sub->mHardwarePoseCount,
+								p->getVertexProgram()->getNumberOfPosesIncluded());
+					}
+				}
+
+            }
+        }
+
+        // Should be force update of animation if they exists, due reevaluate
+        // vertex processing might switchs between hardware/software animation,
+        // and then we'll end with NULL or incorrect mBoneWorldMatrices, or
+        // incorrect blended software animation buffers.
+        if (mAnimationState)
+        {
+            mFrameAnimationLastUpdated = mAnimationState->getDirtyFrameNumber() - 1;
+        }
+    }
+    //-----------------------------------------------------------------------
+    ShadowCaster::ShadowRenderableListIterator
+        Entity::getShadowVolumeRenderableIterator(
+        ShadowTechnique shadowTechnique, const Light* light,
+        HardwareIndexBufferSharedPtr* indexBuffer,
+        bool extrude, Real extrusionDistance, unsigned long flags)
+    {
+        assert(indexBuffer && "Only external index buffers are supported right now");
+        assert((*indexBuffer)->getType() == HardwareIndexBuffer::IT_16BIT &&
+            "Only 16-bit indexes supported for now");
+
+        // Potentially delegate to LOD entity
+        if (mMesh->isLodManual() && mMeshLodIndex > 0)
+        {
+            // Use alternate entity
+            assert( static_cast< size_t >( mMeshLodIndex - 1 ) < mLodEntityList.size() &&
+                "No LOD EntityList - did you build the manual LODs after creating the entity?");
+            // delegate, we're using manual LOD and not the top lod index
+            if (hasSkeleton() && mLodEntityList[mMeshLodIndex - 1]->hasSkeleton())
+            {
+                // Copy the animation state set to lod entity, we assume the lod
+                // entity only has a subset animation states
+                mAnimationState->copyMatchingState(
+					mLodEntityList[mMeshLodIndex - 1]->mAnimationState);
+            }
+            return mLodEntityList[mMeshLodIndex-1]->getShadowVolumeRenderableIterator(
+                shadowTechnique, light, indexBuffer, extrude,
+                extrusionDistance, flags);
+        }
+
+
+        // Prepare temp buffers if required
+        if (!mPreparedForShadowVolumes)
+        {
+            mMesh->prepareForShadowVolume();
+            // reset frame last updated to force update of animations if they exist
+            if (mAnimationState)
+                mFrameAnimationLastUpdated = mAnimationState->getDirtyFrameNumber() - 1;
+            // re-prepare buffers
+            prepareTempBlendBuffers();
+        }
+
+
+        bool hasAnimation = (hasSkeleton() || hasVertexAnimation());
+
+        // Update any animation
+        if (hasAnimation)
+        {
+            updateAnimation();
+        }
+
+        // Calculate the object space light details
+        Vector4 lightPos = light->getAs4DVector();
+        Matrix4 world2Obj = mParentNode->_getFullTransform().inverseAffine();
+        lightPos = world2Obj.transformAffine(lightPos);
+
+        // We need to search the edge list for silhouette edges
+        EdgeData* edgeList = getEdgeList();
+
+		if (!edgeList)
+		{
+			// we can't get an edge list for some reason, return blank
+			// really we shouldn't be able to get here, but this is a safeguard
+			return ShadowRenderableListIterator(mShadowRenderables.begin(), mShadowRenderables.end());
+		}
+
+        // Init shadow renderable list if required
+        bool init = mShadowRenderables.empty();
+
+        EdgeData::EdgeGroupList::iterator egi;
+        ShadowRenderableList::iterator si, siend;
+        EntityShadowRenderable* esr = 0;
+        if (init)
+            mShadowRenderables.resize(edgeList->edgeGroups.size());
+
+        bool isAnimated = hasAnimation;
+        bool updatedSharedGeomNormals = false;
+        siend = mShadowRenderables.end();
+        egi = edgeList->edgeGroups.begin();
+        for (si = mShadowRenderables.begin(); si != siend; ++si, ++egi)
+        {
+            const VertexData *pVertData;
+            if (isAnimated)
+            {
+                // Use temp buffers
+                pVertData = findBlendedVertexData(egi->vertexData);
+            }
+            else
+            {
+                pVertData = egi->vertexData;
+            }
+            if (init)
+            {
+                // Try to find corresponding SubEntity; this allows the
+                // linkage of visibility between ShadowRenderable and SubEntity
+                SubEntity* subent = findSubEntityForVertexData(egi->vertexData);
+                // Create a new renderable, create a separate light cap if
+                // we're using a vertex program (either for this model, or
+                // for extruding the shadow volume) since otherwise we can
+                // get depth-fighting on the light cap
+
+                *si = new EntityShadowRenderable(this, indexBuffer, pVertData,
+                    mVertexProgramInUse || !extrude, subent);
+            }
+            else
+            {
+                // If we have animation, we have no guarantee that the position
+                // buffer we used last frame is the same one we used last frame
+                // since a temporary buffer is requested each frame
+                // therefore, we need to update the EntityShadowRenderable
+                // with the current position buffer
+                static_cast<EntityShadowRenderable*>(*si)->rebindPositionBuffer(pVertData, hasAnimation);
+
+            }
+            // Get shadow renderable
+            esr = static_cast<EntityShadowRenderable*>(*si);
+            HardwareVertexBufferSharedPtr esrPositionBuffer = esr->getPositionBuffer();
+            // For animated entities we need to recalculate the face normals
+            if (hasAnimation)
+            {
+                if (egi->vertexData != mMesh->sharedVertexData || !updatedSharedGeomNormals)
+                {
+                    // recalculate face normals
+                    edgeList->updateFaceNormals(egi->vertexSet, esrPositionBuffer);
+                    // If we're not extruding in software we still need to update
+                    // the latter part of the buffer (the hardware extruded part)
+                    // with the latest animated positions
+                    if (!extrude)
+                    {
+                        // Lock, we'll be locking the (suppressed hardware update) shadow buffer
+                        float* pSrc = static_cast<float*>(
+                            esrPositionBuffer->lock(HardwareBuffer::HBL_NORMAL));
+                        float* pDest = pSrc + (egi->vertexData->vertexCount * 3);
+                        memcpy(pDest, pSrc, sizeof(float) * 3 * egi->vertexData->vertexCount);
+                        esrPositionBuffer->unlock();
+                    }
+                    if (egi->vertexData == mMesh->sharedVertexData)
+                    {
+                        updatedSharedGeomNormals = true;
+                    }
+                }
+            }
+            // Extrude vertices in software if required
+            if (extrude)
+            {
+                extrudeVertices(esrPositionBuffer,
+                    egi->vertexData->vertexCount,
+                    lightPos, extrusionDistance);
+
+            }
+            // Stop suppressing hardware update now, if we were
+            esrPositionBuffer->suppressHardwareUpdate(false);
+
+        }
+        // Calc triangle light facing
+        updateEdgeListLightFacing(edgeList, lightPos);
+
+        // Generate indexes and update renderables
+        generateShadowVolume(edgeList, *indexBuffer, light,
+            mShadowRenderables, flags);
+
+
+        return ShadowRenderableListIterator(mShadowRenderables.begin(), mShadowRenderables.end());
+    }
+    //-----------------------------------------------------------------------
+    const VertexData* Entity::findBlendedVertexData(const VertexData* orig)
+    {
+		bool skel = hasSkeleton();
+
+        if (orig == mMesh->sharedVertexData)
+        {
+			return skel? mSkelAnimVertexData : mSoftwareVertexAnimVertexData;
+        }
+        SubEntityList::iterator i, iend;
+        iend = mSubEntityList.end();
+        for (i = mSubEntityList.begin(); i != iend; ++i)
+        {
+            SubEntity* se = *i;
+            if (orig == se->getSubMesh()->vertexData)
+            {
+				return skel? se->_getSkelAnimVertexData() : se->_getSoftwareVertexAnimVertexData();
+            }
+        }
+        // None found
+        OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+            "Cannot find blended version of the vertex data specified.",
+            "Entity::findBlendedVertexData");
+    }
+    //-----------------------------------------------------------------------
+    SubEntity* Entity::findSubEntityForVertexData(const VertexData* orig)
+    {
+        if (orig == mMesh->sharedVertexData)
+        {
+            return 0;
+        }
+
+        SubEntityList::iterator i, iend;
+        iend = mSubEntityList.end();
+        for (i = mSubEntityList.begin(); i != iend; ++i)
+        {
+            SubEntity* se = *i;
+            if (orig == se->getSubMesh()->vertexData)
+            {
+                return se;
+            }
+        }
+
+        // None found
+        return 0;
+    }
+    //-----------------------------------------------------------------------
+    void Entity::addSoftwareAnimationRequest(bool normalsAlso)
+    {
+        mSoftwareAnimationRequests++;
+        if (normalsAlso) {
+            mSoftwareAnimationNormalsRequests++;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Entity::removeSoftwareAnimationRequest(bool normalsAlso)
+    {
+        if (mSoftwareAnimationRequests == 0 ||
+            (normalsAlso && mSoftwareAnimationNormalsRequests == 0))
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                        "Attempt to remove nonexistant request.",
+                        "Entity::removeSoftwareAnimationRequest");
+        }
+        mSoftwareAnimationRequests--;
+        if (normalsAlso) {
+            mSoftwareAnimationNormalsRequests--;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Entity::_notifyAttached(Node* parent, bool isTagPoint)
+    {
+        MovableObject::_notifyAttached(parent, isTagPoint);
+        // Also notify LOD entities
+        LODEntityList::iterator i, iend;
+        iend = mLodEntityList.end();
+        for (i = mLodEntityList.begin(); i != iend; ++i)
+        {
+            (*i)->_notifyAttached(parent, isTagPoint);
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    Entity::EntityShadowRenderable::EntityShadowRenderable(Entity* parent,
+        HardwareIndexBufferSharedPtr* indexBuffer, const VertexData* vertexData,
+        bool createSeparateLightCap, SubEntity* subent, bool isLightCap)
+        : mParent(parent), mSubEntity(subent)
+    {
+        // Save link to vertex data
+        mCurrentVertexData = vertexData;
+
+        // Initialise render op
+        mRenderOp.indexData = new IndexData();
+        mRenderOp.indexData->indexBuffer = *indexBuffer;
+        mRenderOp.indexData->indexStart = 0;
+        // index start and count are sorted out later
+
+        // Create vertex data which just references position component (and 2 component)
+        mRenderOp.vertexData = new VertexData();
+        // Map in position data
+        mRenderOp.vertexData->vertexDeclaration->addElement(0,0,VET_FLOAT3, VES_POSITION);
+        mOriginalPosBufferBinding =
+            vertexData->vertexDeclaration->findElementBySemantic(VES_POSITION)->getSource();
+        mPositionBuffer = vertexData->vertexBufferBinding->getBuffer(mOriginalPosBufferBinding);
+        mRenderOp.vertexData->vertexBufferBinding->setBinding(0, mPositionBuffer);
+        // Map in w-coord buffer (if present)
+        if(!vertexData->hardwareShadowVolWBuffer.isNull())
+        {
+            mRenderOp.vertexData->vertexDeclaration->addElement(1,0,VET_FLOAT1, VES_TEXTURE_COORDINATES, 0);
+            mWBuffer = vertexData->hardwareShadowVolWBuffer;
+            mRenderOp.vertexData->vertexBufferBinding->setBinding(1, mWBuffer);
+        }
+        // Use same vertex start as input
+        mRenderOp.vertexData->vertexStart = vertexData->vertexStart;
+
+        if (isLightCap)
+        {
+            // Use original vertex count, no extrusion
+            mRenderOp.vertexData->vertexCount = vertexData->vertexCount;
+        }
+        else
+        {
+            // Vertex count must take into account the doubling of the buffer,
+            // because second half of the buffer is the extruded copy
+            mRenderOp.vertexData->vertexCount =
+                vertexData->vertexCount * 2;
+            if (createSeparateLightCap)
+            {
+                // Create child light cap
+                mLightCap = new EntityShadowRenderable(parent,
+                    indexBuffer, vertexData, false, subent, true);
+            }
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    Entity::EntityShadowRenderable::~EntityShadowRenderable()
+    {
+        delete mRenderOp.indexData;
+        delete mRenderOp.vertexData;
+    }
+    //-----------------------------------------------------------------------
+    void Entity::EntityShadowRenderable::getWorldTransforms(Matrix4* xform) const
+    {
+        *xform = mParent->_getParentNodeFullTransform();
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& Entity::EntityShadowRenderable::getWorldOrientation(void) const
+    {
+        return mParent->getParentNode()->_getDerivedOrientation();
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& Entity::EntityShadowRenderable::getWorldPosition(void) const
+    {
+        return mParent->getParentNode()->_getDerivedPosition();
+    }
+    //-----------------------------------------------------------------------
+    void Entity::EntityShadowRenderable::rebindPositionBuffer(const VertexData* vertexData, bool force)
+    {
+        if (force || mCurrentVertexData != vertexData)
+        {
+            mCurrentVertexData = vertexData;
+            mPositionBuffer = mCurrentVertexData->vertexBufferBinding->getBuffer(
+                mOriginalPosBufferBinding);
+            mRenderOp.vertexData->vertexBufferBinding->setBinding(0, mPositionBuffer);
+            if (mLightCap)
+            {
+                static_cast<EntityShadowRenderable*>(mLightCap)->rebindPositionBuffer(vertexData, force);
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    bool Entity::EntityShadowRenderable::isVisible(void) const
+    {
+        if (mSubEntity)
+        {
+            return mSubEntity->isVisible();
+        }
+        else
+        {
+            return ShadowRenderable::isVisible();
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Entity::setRenderQueueGroup(uint8 queueID)
+    {
+        MovableObject::setRenderQueueGroup(queueID);
+
+        // Set render queue for all manual LOD entities
+        if (mMesh->isLodManual())
+        {
+            LODEntityList::iterator li, liend;
+            liend = mLodEntityList.end();
+            for (li = mLodEntityList.begin(); li != liend; ++li)
+            {
+                (*li)->setRenderQueueGroup(queueID);
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Entity::shareSkeletonInstanceWith(Entity* entity)
+    {
+        if (entity->getMesh()->getSkeleton() != getMesh()->getSkeleton())
+        {
+            OGRE_EXCEPT(Exception::ERR_RT_ASSERTION_FAILED,
+                "The supplied entity has a different skeleton.",
+                "Entity::shareSkeletonWith");
+        }
+        if (!mSkeletonInstance)
+        {
+            OGRE_EXCEPT(Exception::ERR_RT_ASSERTION_FAILED,
+                "This entity has no skeleton.",
+                "Entity::shareSkeletonWith");
+        }
+        if (mSharedSkeletonEntities != NULL && entity->mSharedSkeletonEntities != NULL)
+        {
+            OGRE_EXCEPT(Exception::ERR_RT_ASSERTION_FAILED,
+                "Both entities already shares their SkeletonInstances! At least "
+                "one of the instances must not share it's instance.",
+                "Entity::shareSkeletonWith");
+        }
+
+        //check if we already share our skeletoninstance, we don't want to delete it if so
+        if (mSharedSkeletonEntities != NULL)
+        {
+            entity->shareSkeletonInstanceWith(this);
+        }
+        else
+        {
+            delete mSkeletonInstance;
+            AlignedMemory::deallocate(mBoneMatrices);
+            delete mAnimationState;
+            delete mFrameBonesLastUpdated;
+            mSkeletonInstance = entity->mSkeletonInstance;
+            mNumBoneMatrices = entity->mNumBoneMatrices;
+            mBoneMatrices = entity->mBoneMatrices;
+            mAnimationState = entity->mAnimationState;
+            mFrameBonesLastUpdated = entity->mFrameBonesLastUpdated;
+            if (entity->mSharedSkeletonEntities == NULL)
+            {
+                entity->mSharedSkeletonEntities = new EntitySet();
+                entity->mSharedSkeletonEntities->insert(entity);
+            }
+            mSharedSkeletonEntities = entity->mSharedSkeletonEntities;
+            mSharedSkeletonEntities->insert(this);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Entity::stopSharingSkeletonInstance()
+    {
+        if (mSharedSkeletonEntities == NULL)
+        {
+            OGRE_EXCEPT(Exception::ERR_RT_ASSERTION_FAILED,
+                "This entity is not sharing it's skeletoninstance.",
+                "Entity::shareSkeletonWith");
+        }
+        //check if there's no other than us sharing the skeleton instance
+        if (mSharedSkeletonEntities->size() == 1)
+        {
+            //just reset
+            delete mSharedSkeletonEntities;
+            mSharedSkeletonEntities = 0;
+        }
+        else
+        {
+            mSkeletonInstance = new SkeletonInstance(mMesh->getSkeleton());
+            mSkeletonInstance->load();
+            mAnimationState = new AnimationStateSet();
+            mMesh->_initAnimationState(mAnimationState);
+            mFrameBonesLastUpdated = new unsigned long(std::numeric_limits<unsigned long>::max());
+            mNumBoneMatrices = mSkeletonInstance->getNumBones();
+            mBoneMatrices = static_cast<Matrix4*>(AlignedMemory::allocate(sizeof(Matrix4) * mNumBoneMatrices));
+
+            mSharedSkeletonEntities->erase(this);
+            if (mSharedSkeletonEntities->size() == 1)
+            {
+                (*mSharedSkeletonEntities->begin())->stopSharingSkeletonInstance();
+            }
+            mSharedSkeletonEntities = 0;
+        }
+    }
+    //-----------------------------------------------------------------------
+	void Entity::refreshAvailableAnimationState(void)
+	{
+		mMesh->_refreshAnimationState(mAnimationState);
+	}
+	//-----------------------------------------------------------------------
+	uint32 Entity::getTypeFlags(void) const
+	{
+		return SceneManager::ENTITY_TYPE_MASK;
+	}
+	//-----------------------------------------------------------------------
+	VertexData* Entity::getVertexDataForBinding(void)
+	{
+		Entity::VertexDataBindChoice c =
+			chooseVertexDataForBinding(mMesh->getSharedVertexDataAnimationType() != VAT_NONE);
+		switch(c)
+		{
+		case BIND_ORIGINAL:
+			return mMesh->sharedVertexData;
+		case BIND_HARDWARE_MORPH:
+			return mHardwareVertexAnimVertexData;
+		case BIND_SOFTWARE_MORPH:
+			return mSoftwareVertexAnimVertexData;
+		case BIND_SOFTWARE_SKELETAL:
+			return mSkelAnimVertexData;
+		};
+		// keep compiler happy
+		return mMesh->sharedVertexData;
+	}
+	//-----------------------------------------------------------------------
+	Entity::VertexDataBindChoice Entity::chooseVertexDataForBinding(bool vertexAnim) const
+	{
+		if (hasSkeleton())
+		{
+			if (!mHardwareAnimation)
+			{
+				// all software skeletal binds same vertex data
+				// may be a 2-stage s/w transform including morph earlier though
+				return BIND_SOFTWARE_SKELETAL;
+			}
+			else if (vertexAnim)
+			{
+				// hardware morph animation
+				return BIND_HARDWARE_MORPH;
+			}
+			else
+			{
+				// hardware skeletal, no morphing
+				return BIND_ORIGINAL;
+			}
+		}
+		else if (vertexAnim)
+		{
+			// morph only, no skeletal
+			if (mHardwareAnimation)
+			{
+				return BIND_HARDWARE_MORPH;
+			}
+			else
+			{
+				return BIND_SOFTWARE_MORPH;
+			}
+
+		}
+		else
+		{
+			return BIND_ORIGINAL;
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	String EntityFactory::FACTORY_TYPE_NAME = "Entity";
+	//-----------------------------------------------------------------------
+	const String& EntityFactory::getType(void) const
+	{
+		return FACTORY_TYPE_NAME;
+	}
+	//-----------------------------------------------------------------------
+	MovableObject* EntityFactory::createInstanceImpl( const String& name,
+		const NameValuePairList* params)
+	{
+		// must have mesh parameter
+		MeshPtr pMesh;
+		if (params != 0)
+		{
+			NameValuePairList::const_iterator ni = params->find("mesh");
+			if (ni != params->end())
+			{
+				// Get mesh (load if required)
+				pMesh = MeshManager::getSingleton().load(
+					ni->second,
+					// autodetect group location
+					ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME );
+			}
+
+		}
+		if (pMesh.isNull())
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"'mesh' parameter required when constructing an Entity.",
+				"EntityFactory::createInstance");
+		}
+
+		return new Entity(name, pMesh);
+
+	}
+	//-----------------------------------------------------------------------
+	void EntityFactory::destroyInstance( MovableObject* obj)
+	{
+		delete obj;
+	}
+
+
+}
Index: /OgreMain/src/OgreException.cpp
===================================================================
--- /OgreMain/src/OgreException.cpp	(revision 5)
+++ /OgreMain/src/OgreException.cpp	(revision 5)
@@ -0,0 +1,113 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreException.h"
+
+#include "OgreRoot.h"
+#include "OgreLogManager.h"
+
+#ifdef __BORLANDC__
+    #include <stdio.h>
+#endif
+
+namespace Ogre {
+
+    Exception::Exception(int num, const String& desc, const String& src) :
+        line( 0 ),
+        number( num ),
+        description( desc ),
+        source( src )
+    {
+        // Log this error - not any more, allow catchers to do it
+        //LogManager::getSingleton().logMessage(this->getFullDescription());
+    }
+
+    Exception::Exception(int num, const String& desc, const String& src, 
+		const char* typ, const char* fil, long lin) :
+        line( lin ),
+        number( num ),
+		typeName(typ),
+        description( desc ),
+        source( src ),
+        file( fil )
+    {
+        // Log this error, mask it from debug though since it may be caught and ignored
+        if(LogManager::getSingletonPtr())
+		{
+            LogManager::getSingleton().logMessage(
+				this->getFullDescription(), 
+                LML_CRITICAL, true);
+		}
+
+    }
+
+    Exception::Exception(const Exception& rhs)
+        : line( rhs.line ), number( rhs.number ), description( rhs.description ), source( rhs.source ), file( rhs.file )
+    {
+    }
+
+    void Exception::operator = ( const Exception& rhs )
+    {
+        description = rhs.description;
+        number = rhs.number;
+        source = rhs.source;
+        file = rhs.file;
+        line = rhs.line;
+		typeName = rhs.typeName;
+    }
+
+    const String& Exception::getFullDescription(void) const
+    {
+		if (fullDesc.empty())
+		{
+
+			StringUtil::StrStreamType desc;
+
+			desc <<  "OGRE EXCEPTION(" << number << ":" << typeName << "): "
+				<< description 
+				<< " in " << source;
+
+			if( line > 0 )
+			{
+				desc << " at " << file << " (line " << line << ")";
+			}
+
+			fullDesc = desc.str();
+		}
+
+		return fullDesc;
+    }
+
+    int Exception::getNumber(void) const throw()
+    {
+        return number;
+    }
+
+}
+
Index: /OgreMain/src/OgreExternalTextureSource.cpp
===================================================================
--- /OgreMain/src/OgreExternalTextureSource.cpp	(revision 5)
+++ /OgreMain/src/OgreExternalTextureSource.cpp	(revision 5)
@@ -0,0 +1,192 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+/***************************************************************************
+OgreExternalTextureSource.cpp  -  
+	Implementation of texture controller class
+
+-------------------
+date                 : Jan 1 2004
+email                : pjcast@yahoo.com
+***************************************************************************/
+
+#include "OgreStableHeaders.h"
+#include "OgreExternalTextureSource.h"
+#include "OgreStringConverter.h"
+#include "OgreLogManager.h"
+#include "OgreException.h"
+
+namespace Ogre
+{
+	//String interface commands for setting some basic commands
+	ExternalTextureSource::CmdInputFileName ExternalTextureSource::msCmdInputFile;
+	ExternalTextureSource::CmdFPS			ExternalTextureSource::msCmdFramesPerSecond;
+	ExternalTextureSource::CmdPlayMode		ExternalTextureSource::msCmdPlayMode;
+	ExternalTextureSource::CmdTecPassState	ExternalTextureSource::msCmdTecPassState;
+
+	//---------------------------------------------------------------------------------------//
+
+	ExternalTextureSource::ExternalTextureSource()
+	{
+		mInputFileName = "None";
+		mDictionaryName = "NotAssigned";
+		mUpdateEveryFrame = false;
+		mFramesPerSecond = 24;
+		mMode = TextureEffectPause;
+	}
+
+	//---------------------------------------------------------------------------------------//
+
+	void ExternalTextureSource::addBaseParams()
+	{
+		if( mDictionaryName == "NotAssigned" )
+            OGRE_EXCEPT(Exception::ERR_FILE_NOT_FOUND, 
+                "Plugin " + mPlugInName + 
+				" needs to override default mDictionaryName", 
+                "ExternalTextureSource::addBaseParams");
+
+		//Create Dictionary Here
+        if (createParamDictionary( mDictionaryName ))
+		{
+	        ParamDictionary* dict = getParamDictionary();
+			
+			dict->addParameter(ParameterDef("filename", 
+			    "A source for the texture effect (only certain plugins require this)"
+				, PT_STRING),
+				&ExternalTextureSource::msCmdInputFile);
+			dict->addParameter(ParameterDef("frames_per_second", 
+			    "How fast should playback be (only certain plugins use this)"
+				, PT_INT),
+				&ExternalTextureSource::msCmdFramesPerSecond);
+			dict->addParameter(ParameterDef("play_mode", 
+			    "How the playback starts(only certain plugins use this)"
+				, PT_STRING),
+				&ExternalTextureSource::msCmdPlayMode);
+			dict->addParameter(ParameterDef("set_T_P_S", 
+			    "Set the technique, pass, and state level of this texture_unit (eg. 0 0 0 )"
+				, PT_STRING),
+				&ExternalTextureSource::msCmdTecPassState);
+		}
+	}
+
+	//---------------------------------------------------------------------------------------//
+	//*** String Interface Command Class Definitions *****************************************/
+	String ExternalTextureSource::CmdInputFileName::doGet(const void* target) const
+	{
+		return static_cast<const ExternalTextureSource*>(target)->getInputName();
+	}
+	void ExternalTextureSource::CmdInputFileName::doSet(void* target, const String& val)
+	{
+		static_cast<ExternalTextureSource*>(target)->setInputName( val );
+	}
+	
+	//------------------------------------------------------------------------------//
+	String ExternalTextureSource::CmdFPS::doGet(const void* target) const
+	{
+		return StringConverter::toString(
+			static_cast<const ExternalTextureSource*>(target)->getFPS() );
+	}
+	void ExternalTextureSource::CmdFPS::doSet(void* target, const String& val)
+	{
+		static_cast<ExternalTextureSource*>(target)->setFPS(StringConverter::parseInt(val));
+	}
+	//------------------------------------------------------------------------------//
+	String ExternalTextureSource::CmdPlayMode::doGet(const void* target) const
+	{
+		eTexturePlayMode eMode = static_cast<const ExternalTextureSource*>(target)->getPlayMode();
+		String val;
+
+		switch(eMode)
+		{
+		case TextureEffectPlay_ASAP:
+			val = "play";
+			break;
+		case TextureEffectPlay_Looping: 
+			val = "loop";
+			break;
+		case TextureEffectPause:
+			val = "pause";
+			break;
+		default: 
+			val = "error"; 
+			break;
+		}
+
+		return val;
+	}
+	void ExternalTextureSource::CmdPlayMode::doSet(void* target, const String& val)
+	{
+		eTexturePlayMode eMode = TextureEffectPause;
+
+		if( val == "play" )
+			eMode = TextureEffectPlay_ASAP;
+		if( val == "loop" )
+			eMode = TextureEffectPlay_Looping;
+		if( val == "pause" )
+			eMode = TextureEffectPause;
+
+		static_cast<ExternalTextureSource*>(target)->setPlayMode( eMode );
+	}
+
+	//------------------------------------------------------------------------------//
+	String ExternalTextureSource::CmdTecPassState::doGet(const void* target) const
+	{
+		int t = 0, p = 0, s = 0;
+
+		static_cast<const ExternalTextureSource*>(target)->getTextureTecPassStateLevel(t, p, s);
+
+		String ret = StringConverter::toString( t ) + " " 
+					+ StringConverter::toString( p ) + " " 
+					+ StringConverter::toString( s );
+		
+		return ret;			
+	}
+
+	void ExternalTextureSource::CmdTecPassState::doSet(void* target, const String& val)
+	{
+		int t = 0, p = 0, s = 0;
+
+		StringVector vecparams = StringUtil::split(val, " \t");
+
+		if( vecparams.size() == 3 )
+		{
+			t = StringConverter::parseInt( vecparams[0] );
+			p = StringConverter::parseInt( vecparams[1] );
+			s = StringConverter::parseInt( vecparams[2] );
+		}
+		else
+		{
+			LogManager::getSingleton().logMessage("Texture controller had problems extracting technique, pass, and state level... Default to 0, 0, 0");
+			t = p = s = 0;
+		}
+
+		static_cast<ExternalTextureSource*>(target)->setTextureTecPassStateLevel(t,p,s);
+	}
+}
+
Index: /OgreMain/src/OgreExternalTextureSourceManager.cpp
===================================================================
--- /OgreMain/src/OgreExternalTextureSourceManager.cpp	(revision 5)
+++ /OgreMain/src/OgreExternalTextureSourceManager.cpp	(revision 5)
@@ -0,0 +1,145 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+/***************************************************************************
+OgreExternalTextureSourceManager.cpp  -  
+	Implementation of the manager class
+
+-------------------
+date                 : Jan 1 2004
+email                : pjcast@yahoo.com
+***************************************************************************/
+
+#include "OgreStableHeaders.h"
+#include "OgreExternalTextureSourceManager.h"
+#include "OgreLogManager.h"
+
+
+namespace Ogre 
+{
+	//****************************************************************************************
+    template<> ExternalTextureSourceManager* Singleton<ExternalTextureSourceManager>::ms_Singleton = 0;
+    ExternalTextureSourceManager* ExternalTextureSourceManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    ExternalTextureSourceManager& ExternalTextureSourceManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+	//****************************************************************************************
+
+	//****************************************************************************************
+	ExternalTextureSourceManager::ExternalTextureSourceManager()
+	{
+		mpCurrExternalTextureSource = 0;
+	}
+
+	//****************************************************************************************
+	ExternalTextureSourceManager::~ExternalTextureSourceManager()
+	{
+		mTextureSystems.clear();
+	}
+
+	//****************************************************************************************
+	
+	void ExternalTextureSourceManager::setCurrentPlugIn( const String& sTexturePlugInType )
+	{
+		TextureSystemList::iterator i;
+			
+		for( i = mTextureSystems.begin(); i != mTextureSystems.end(); ++i )
+		{
+			if( i->first == sTexturePlugInType )
+			{
+				mpCurrExternalTextureSource = i->second;
+				mpCurrExternalTextureSource->initialise();	//Now call overridden Init function
+				return;
+			}
+		}
+		mpCurrExternalTextureSource = 0;
+		LogManager::getSingleton().logMessage( "ExternalTextureSourceManager::SetCurrentPlugIn(ENUM) failed setting texture plugin ");
+	}
+
+	//****************************************************************************************
+	void ExternalTextureSourceManager::destroyAdvancedTexture( const String& sTextureName,
+		const String& groupName )
+	{
+		TextureSystemList::iterator i;
+		for( i = mTextureSystems.begin(); i != mTextureSystems.end(); ++i )
+		{
+			//Broadcast to every registered System... Only the true one will destroy texture
+			i->second->destroyAdvancedTexture( sTextureName, groupName );
+		}
+	}
+
+	//****************************************************************************************
+	void ExternalTextureSourceManager::setExternalTextureSource( const String& sTexturePlugInType, ExternalTextureSource* pTextureSystem )
+	{
+		LogManager::getSingleton().logMessage( "Registering Texture Controller: Type = "
+						+ sTexturePlugInType + " Name = " + pTextureSystem->getPlugInStringName());
+
+		TextureSystemList::iterator i;
+			
+		for( i = mTextureSystems.begin(); i != mTextureSystems.end(); ++i )
+		{
+			if( i->first == sTexturePlugInType )
+			{
+				LogManager::getSingleton().logMessage( "Shutting Down Texture Controller: " 
+						+ i->second->getPlugInStringName() 
+						+ " To be replaced by: "
+						+ pTextureSystem->getPlugInStringName());
+
+				i->second->shutDown();				//Only one plugIn of Sent Type can be registered at a time
+													//so shut down old plugin before starting new plugin
+				i->second = pTextureSystem;
+				// **Moved this line b/c Rendersystem needs to be selected before things
+				// such as framelistners can be added
+				// pTextureSystem->Initialise();
+				return;
+			}
+		}
+		mTextureSystems[sTexturePlugInType] = pTextureSystem;	//If we got here then add it to map
+	}
+
+	//****************************************************************************************
+	ExternalTextureSource* ExternalTextureSourceManager::getExternalTextureSource( const String& sTexturePlugInType )
+	{
+		TextureSystemList::iterator i;
+		for( i = mTextureSystems.begin(); i != mTextureSystems.end(); ++i )
+		{
+			if( i->first == sTexturePlugInType )
+				return i->second;
+		}
+		return 0;
+	}
+
+	//****************************************************************************************
+
+}  //End Ogre Namespace
+
Index: /OgreMain/src/OgreFileSystem.cpp
===================================================================
--- /OgreMain/src/OgreFileSystem.cpp	(revision 5)
+++ /OgreMain/src/OgreFileSystem.cpp	(revision 5)
@@ -0,0 +1,276 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreFileSystem.h"
+#include "OgreLogManager.h"
+#include "OgreException.h"
+#include "OgreStringVector.h"
+#include "OgreRoot.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#   include "OgreSearchOps.h"
+#   include <sys/param.h>
+#   define MAX_PATH MAXPATHLEN
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#   include <windows.h>
+#   include <direct.h>
+#   include <io.h>
+#endif
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    FileSystemArchive::FileSystemArchive(const String& name, const String& archType )
+        : Archive(name, archType)
+    {
+    }
+    //-----------------------------------------------------------------------
+    bool FileSystemArchive::isCaseSensitive(void) const
+    {
+        #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+            return false;
+        #else
+            return true;
+        #endif
+
+    }
+    //-----------------------------------------------------------------------
+    static bool is_reserved_dir (const char *fn)
+    {
+        return (fn [0] == '.' && (fn [1] == 0 || (fn [1] == '.' && fn [2] == 0)));
+    }
+    //-----------------------------------------------------------------------
+    static bool is_absolute_path(const char* path)
+    {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        if (isalpha(uchar(path[0])) && path[1] == ':')
+            return true;
+#endif
+        return path[0] == '/' || path[0] == '\\';
+    }
+    //-----------------------------------------------------------------------
+    static String concatenate_path(const String& base, const String& name)
+    {
+        if (base.empty() || is_absolute_path(name.c_str()))
+            return name;
+        else
+            return base + '/' + name;
+    }
+    //-----------------------------------------------------------------------
+    void FileSystemArchive::findFiles(const String& pattern, bool recursive, 
+        bool dirs, StringVector* simpleList, FileInfoList* detailList)
+    {
+        long lHandle, res;
+        struct _finddata_t tagData;
+
+        // pattern can contain a directory name, separate it from mask
+        size_t pos1 = pattern.rfind ('/');
+        size_t pos2 = pattern.rfind ('\\');
+        if (pos1 == pattern.npos || ((pos2 != pattern.npos) && (pos1 < pos2)))
+            pos1 = pos2;
+        String directory;
+        if (pos1 != pattern.npos)
+            directory = pattern.substr (0, pos1 + 1);
+
+        String full_pattern = concatenate_path(mName, pattern);
+
+        lHandle = _findfirst(full_pattern.c_str(), &tagData);
+        res = 0;
+        while (lHandle != -1 && res != -1)
+        {
+            if ((dirs == ((tagData.attrib & _A_SUBDIR) != 0)) &&
+                (!dirs || !is_reserved_dir (tagData.name)))
+            {
+                if (simpleList)
+                {
+                    simpleList->push_back(directory + tagData.name);
+                }
+                else if (detailList)
+                {
+                    FileInfo fi;
+                    fi.archive = this;
+                    fi.filename = directory + tagData.name;
+                    fi.basename = tagData.name;
+                    fi.path = directory;
+                    fi.compressedSize = tagData.size;
+                    fi.uncompressedSize = tagData.size;
+                    detailList->push_back(fi);
+                }
+            }
+            res = _findnext( lHandle, &tagData );
+        }
+        // Close if we found any files
+        if(lHandle != -1)
+            _findclose(lHandle);
+
+        // Now find directories
+        if (recursive)
+        {
+            String base_dir = mName;
+            if (!directory.empty ())
+            {
+                base_dir = concatenate_path(mName, directory);
+                // Remove the last '/'
+                base_dir.erase (base_dir.length () - 1);
+            }
+            base_dir.append ("/*");
+
+            // Remove directory name from pattern
+            String mask ("/");
+            if (pos1 != pattern.npos)
+                mask.append (pattern.substr (pos1 + 1));
+            else
+                mask.append (pattern);
+
+            lHandle = _findfirst(base_dir.c_str (), &tagData);
+            res = 0;
+            while (lHandle != -1 && res != -1)
+            {
+                if ((tagData.attrib & _A_SUBDIR) &&
+                    !is_reserved_dir (tagData.name))
+                {
+                    // recurse
+                    base_dir = directory;
+                    base_dir.append (tagData.name).append (mask);
+                    findFiles(base_dir, recursive, dirs, simpleList, detailList);
+                }
+                res = _findnext( lHandle, &tagData );
+            }
+            // Close if we found any files
+            if(lHandle != -1)
+                _findclose(lHandle);
+        }
+    }
+    //-----------------------------------------------------------------------
+    FileSystemArchive::~FileSystemArchive()
+    {
+        unload();
+    }
+    //-----------------------------------------------------------------------
+    void FileSystemArchive::load()
+    {
+        // do nothing here, what has to be said will be said later
+    }
+    //-----------------------------------------------------------------------
+    void FileSystemArchive::unload()
+    {
+        // nothing to see here, move along
+    }
+    //-----------------------------------------------------------------------
+    DataStreamPtr FileSystemArchive::open(const String& filename) const
+    {
+        String full_path = concatenate_path(mName, filename);
+
+        // Use filesystem to determine size 
+        // (quicker than streaming to the end and back)
+        struct stat tagStat;
+	int ret = stat(full_path.c_str(), &tagStat);
+        assert(ret == 0 && "Problem getting file size" );
+
+        // Always open in binary mode
+        std::ifstream *origStream = new std::ifstream();
+        origStream->open(full_path.c_str(), std::ios::in | std::ios::binary);
+
+        // Should check ensure open succeeded, in case fail for some reason.
+        if (origStream->fail())
+        {
+            delete origStream;
+            OGRE_EXCEPT(Exception::ERR_FILE_NOT_FOUND,
+                "Cannot open file: " + filename,
+                "FileSystemArchive::open");
+        }
+
+        /// Construct return stream, tell it to delete on destroy
+        FileStreamDataStream* stream = new FileStreamDataStream(filename,
+            origStream, tagStat.st_size, true);
+        return DataStreamPtr(stream);
+    }
+    //-----------------------------------------------------------------------
+    StringVectorPtr FileSystemArchive::list(bool recursive, bool dirs)
+    {
+		// directory change requires locking due to saved returns
+        StringVectorPtr ret(new StringVector());
+
+        findFiles("*", recursive, dirs, ret.getPointer(), 0);
+
+        return ret;
+    }
+    //-----------------------------------------------------------------------
+    FileInfoListPtr FileSystemArchive::listFileInfo(bool recursive, bool dirs)
+    {
+        FileInfoListPtr ret(new FileInfoList());
+
+        findFiles("*", recursive, dirs, 0, ret.getPointer());
+
+        return ret;
+    }
+    //-----------------------------------------------------------------------
+    StringVectorPtr FileSystemArchive::find(const String& pattern,
+                                            bool recursive, bool dirs)
+    {
+        StringVectorPtr ret(new StringVector());
+
+        findFiles(pattern, recursive, dirs, ret.getPointer(), 0);
+
+        return ret;
+
+    }
+    //-----------------------------------------------------------------------
+    FileInfoListPtr FileSystemArchive::findFileInfo(const String& pattern, 
+        bool recursive, bool dirs)
+    {
+        FileInfoListPtr ret(new FileInfoList());
+
+        findFiles(pattern, recursive, dirs, 0, ret.getPointer());
+
+        return ret;
+    }
+    //-----------------------------------------------------------------------
+	bool FileSystemArchive::exists(const String& filename)
+	{
+        String full_path = concatenate_path(mName, filename);
+
+        struct stat tagStat;
+        bool ret = (stat(full_path.c_str(), &tagStat) == 0);
+
+		return ret;
+	}
+    //-----------------------------------------------------------------------
+    const String& FileSystemArchiveFactory::getType(void) const
+    {
+        static String name = "FileSystem";
+        return name;
+    }
+
+}
Index: /OgreMain/src/OgreFont.cpp
===================================================================
--- /OgreMain/src/OgreFont.cpp	(revision 5)
+++ /OgreMain/src/OgreFont.cpp	(revision 5)
@@ -0,0 +1,510 @@
+/*-------------------------------------------------------------------------
+This source file is a part of OGRE
+(Object-oriented Graphics Rendering Engine)
+
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License (LGPL) as
+published by the Free Software Foundation; either version 2.1 of the
+License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA or go to
+http://www.gnu.org/copyleft/lesser.txt
+-------------------------------------------------------------------------*/
+#include "OgreStableHeaders.h"
+
+#include "OgreFont.h"
+#include "OgreMaterialManager.h"
+#include "OgreTextureManager.h"
+#include "OgreTexture.h"
+#include "OgreResourceGroupManager.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreRenderWindow.h"
+#include "OgreException.h"
+#include "OgreBlendMode.h"
+#include "OgreTextureUnitState.h"
+#include "OgreTechnique.h"
+#include "OgrePass.h"
+#include "OgreMaterial.h"
+#include "OgreBitwise.h"
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include FT_GLYPH_H
+
+
+
+namespace Ogre
+{
+    //---------------------------------------------------------------------
+	Font::CmdType Font::msTypeCmd;
+	Font::CmdSource Font::msSourceCmd;
+	Font::CmdSize Font::msSizeCmd;
+	Font::CmdResolution Font::msResolutionCmd;
+	Font::CmdCodePoints Font::msCodePointsCmd;
+
+    //---------------------------------------------------------------------
+	Font::Font(ResourceManager* creator, const String& name, ResourceHandle handle,
+		const String& group, bool isManual, ManualResourceLoader* loader)
+		:Resource (creator, name, handle, group, isManual, loader),
+		mType(FT_TRUETYPE), mTtfSize(0), mTtfResolution(0), mAntialiasColour(false)
+    {
+
+		if (createParamDictionary("Font"))
+		{
+			ParamDictionary* dict = getParamDictionary();
+			dict->addParameter(
+				ParameterDef("type", "'truetype' or 'image' based font", PT_STRING),
+				&msTypeCmd);
+			dict->addParameter(
+				ParameterDef("source", "Filename of the source of the font.", PT_STRING),
+				&msSourceCmd);
+			dict->addParameter(
+				ParameterDef("size", "True type size", PT_REAL),
+				&msSizeCmd);
+			dict->addParameter(
+				ParameterDef("resolution", "True type resolution", PT_UNSIGNED_INT),
+				&msResolutionCmd);
+			dict->addParameter(
+				ParameterDef("code_points", "Add a range of code points", PT_STRING),
+				&msCodePointsCmd);
+		}
+
+    }
+    //---------------------------------------------------------------------
+    Font::~Font()
+    {
+        // have to call this here reather than in Resource destructor
+        // since calling virtual methods in base destructors causes crash
+        unload();
+    }
+    //---------------------------------------------------------------------
+    void Font::setType(FontType ftype)
+    {
+        mType = ftype;
+    }
+    //---------------------------------------------------------------------
+    FontType Font::getType(void) const
+    {
+        return mType;
+    }
+    //---------------------------------------------------------------------
+    void Font::setSource(const String& source)
+    {
+        mSource = source;
+    }
+    //---------------------------------------------------------------------
+    void Font::setTrueTypeSize(Real ttfSize)
+    {
+        mTtfSize = ttfSize;
+    }
+    //---------------------------------------------------------------------
+    void Font::setTrueTypeResolution(uint ttfResolution)
+    {
+        mTtfResolution = ttfResolution;
+    }
+    //---------------------------------------------------------------------
+    const String& Font::getSource(void) const
+    {
+        return mSource;
+    }
+    //---------------------------------------------------------------------
+    Real Font::getTrueTypeSize(void) const
+    {
+        return mTtfSize;
+    }
+    //---------------------------------------------------------------------
+    uint Font::getTrueTypeResolution(void) const
+    {
+        return mTtfResolution;
+    }
+	//---------------------------------------------------------------------
+	const Font::GlyphInfo& Font::getGlyphInfo(CodePoint id) const
+	{
+		CodePointMap::const_iterator i = mCodePointMap.find(id);
+		if (i == mCodePointMap.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Code point " + StringConverter::toString(id) + " not found in font "
+				+ mName, "Font::getGlyphInfo");
+		}
+		return i->second;
+	}
+    //---------------------------------------------------------------------
+    void Font::loadImpl()
+    {
+        // Create a new material
+        mpMaterial =  MaterialManager::getSingleton().create(
+			"Fonts/" + mName,  mGroup);
+
+		if (mpMaterial.isNull())
+        {
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR,
+                "Error creating new material!", "Font::load" );
+        }
+
+        TextureUnitState *texLayer;
+        bool blendByAlpha = true;
+        if (mType == FT_TRUETYPE)
+        {
+            createTextureFromFont();
+            texLayer = mpMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0);
+            // Always blend by alpha
+            blendByAlpha = true;
+        }
+        else
+        {
+			// Manually load since we need to load to get alpha
+			mTexture = TextureManager::getSingleton().load(mSource, mGroup, TEX_TYPE_2D, 0);
+            blendByAlpha = mTexture->hasAlpha();
+            texLayer = mpMaterial->getTechnique(0)->getPass(0)->createTextureUnitState(mSource);
+        }
+        // Clamp to avoid fuzzy edges
+        texLayer->setTextureAddressingMode( TextureUnitState::TAM_CLAMP );
+		// Allow min/mag filter, but no mip
+		texLayer->setTextureFiltering(FO_LINEAR, FO_LINEAR, FO_NONE);
+
+
+        // Set up blending
+        if (blendByAlpha)
+        {
+            mpMaterial->setSceneBlending( SBT_TRANSPARENT_ALPHA );
+        }
+        else
+        {
+            // Use add if no alpha (assume black background)
+            mpMaterial->setSceneBlending(SBT_ADD);
+        }
+    }
+    //---------------------------------------------------------------------
+    void Font::unloadImpl()
+    {
+		if (!mpMaterial.isNull())
+		{
+			MaterialManager::getSingleton().remove(mpMaterial->getHandle());
+			mpMaterial.setNull();
+		}
+
+		if (!mTexture.isNull())
+		{
+			TextureManager::getSingleton().remove(mTexture->getHandle());
+			mTexture.setNull();
+		}
+    }
+    //---------------------------------------------------------------------
+    void Font::createTextureFromFont(void)
+    {
+
+		// Just create the texture here, and point it at ourselves for when
+		// it wants to (re)load for real
+		String texName = mName + "Texture";
+		// Create, setting isManual to true and passing self as loader
+		mTexture = TextureManager::getSingleton().create(
+			texName, mGroup, true, this);
+		mTexture->setTextureType(TEX_TYPE_2D);
+		mTexture->setNumMipmaps(0);
+		mTexture->load();
+
+		TextureUnitState* t = mpMaterial->getTechnique(0)->getPass(0)->createTextureUnitState( texName );
+		// Allow min/mag filter, but no mip
+		t->setTextureFiltering(FO_LINEAR, FO_LINEAR, FO_NONE);
+
+	}
+	//---------------------------------------------------------------------
+	void Font::loadResource(Resource* res)
+	{
+		// ManualResourceLoader implementation - load the texture
+		FT_Library ftLibrary;
+		// Init freetype
+        if( FT_Init_FreeType( &ftLibrary ) )
+            OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR, "Could not init FreeType library!",
+            "Font::Font");
+
+        FT_Face face;
+        // Add a gap between letters vert and horz
+        // prevents nasty artefacts when letters are too close together
+        uint char_spacer = 5;
+
+        // Locate ttf file, load it pre-buffered into memory by wrapping the
+		// original DataStream in a MemoryDataStream
+		DataStreamPtr dataStreamPtr =
+			ResourceGroupManager::getSingleton().openResource(
+				mSource, mGroup, true, this);
+		MemoryDataStream ttfchunk(dataStreamPtr);
+
+        // Load font
+        if( FT_New_Memory_Face( ftLibrary, ttfchunk.getPtr(), (FT_Long)ttfchunk.size() , 0, &face ) )
+            OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR,
+            "Could not open font face!", "Font::createTextureFromFont" );
+
+
+        // Convert our point size to freetype 26.6 fixed point format
+        FT_F26Dot6 ftSize = (FT_F26Dot6)(mTtfSize * (1 << 6));
+        if( FT_Set_Char_Size( face, ftSize, 0, mTtfResolution, mTtfResolution ) )
+            OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR,
+            "Could not set char size!", "Font::createTextureFromFont" );
+
+        //FILE *fo_def = stdout;
+
+        int max_height = 0, max_width = 0, max_bear = 0;
+
+		// Backwards compatibility - if codepoints not supplied, assume 33-166
+		if (mCodePointRangeList.empty())
+		{
+			mCodePointRangeList.push_back(CodePointRange(33, 166));
+		}
+
+		// Calculate maximum width, height and bearing
+		size_t glyphCount = 0;
+		for (CodePointRangeList::const_iterator r = mCodePointRangeList.begin();
+			r != mCodePointRangeList.end(); ++r)
+		{
+			const CodePointRange& range = *r;
+			for(CodePoint cp = range.first; cp <= range.second; ++cp, ++glyphCount)
+			{
+				FT_Load_Char( face, cp, FT_LOAD_RENDER );
+
+				if( ( 2 * ( face->glyph->bitmap.rows << 6 ) - face->glyph->metrics.horiBearingY ) > max_height )
+					max_height = ( 2 * ( face->glyph->bitmap.rows << 6 ) - face->glyph->metrics.horiBearingY );
+				if( face->glyph->metrics.horiBearingY > max_bear )
+					max_bear = face->glyph->metrics.horiBearingY;
+
+				if( (face->glyph->advance.x >> 6 ) + ( face->glyph->metrics.horiBearingX >> 6 ) > max_width)
+					max_width = (face->glyph->advance.x >> 6 ) + ( face->glyph->metrics.horiBearingX >> 6 );
+			}
+
+		}
+
+		// Now work out how big our texture needs to be
+		size_t rawSize = (max_width + char_spacer) *
+							((max_height >> 6) + char_spacer) * glyphCount;
+
+		uint32 tex_side = static_cast<uint32>(Math::Sqrt(rawSize));
+		// just in case the size might chop a glyph in half, add another glyph width/height
+		tex_side += std::max(max_width, (max_height>>6));
+		// Now round up to nearest power of two
+		uint32 roundUpSize = Bitwise::firstPO2From(tex_side);
+
+		// Would we benefit from using a non-square texture (2X width(
+		size_t finalWidth, finalHeight;
+		if (roundUpSize*roundUpSize*0.5 >= rawSize)
+		{
+			finalHeight = roundUpSize * 0.5;
+		}
+		else
+		{
+			finalHeight = roundUpSize;
+		}
+		finalWidth = roundUpSize;
+
+		Real textureAspect = finalWidth / finalHeight;
+
+		const size_t pixel_bytes = 2;
+		size_t data_width = finalWidth * pixel_bytes;
+		size_t data_size = finalWidth * finalHeight * pixel_bytes;
+
+		LogManager::getSingleton().logMessage("Font " + mName + "using texture size " +
+			StringConverter::toString(finalWidth) + "x" + StringConverter::toString(finalHeight));
+
+        uchar* imageData = new uchar[data_size];
+		// Reset content (White, transparent)
+        for (size_t i = 0; i < data_size; i += pixel_bytes)
+        {
+            imageData[i + 0] = 0xFF; // luminance
+            imageData[i + 1] = 0x00; // alpha
+        }
+
+        size_t l = 0, m = 0;
+		for (CodePointRangeList::const_iterator r = mCodePointRangeList.begin();
+			r != mCodePointRangeList.end(); ++r)
+		{
+			const CodePointRange& range = *r;
+			for(CodePoint cp = range.first; cp <= range.second; ++cp )
+			{
+				FT_Error ftResult;
+
+				// Load & render glyph
+				ftResult = FT_Load_Char( face, cp, FT_LOAD_RENDER );
+				if (ftResult)
+				{
+					// problem loading this glyph, continue
+					LogManager::getSingleton().logMessage("Info: cannot load character " +
+						StringConverter::toString(cp) + " in font " + mName);
+					continue;
+				}
+
+				FT_Int advance = (face->glyph->advance.x >> 6 ) + ( face->glyph->metrics.horiBearingX >> 6 );
+
+				unsigned char* buffer = face->glyph->bitmap.buffer;
+
+				if (!buffer)
+				{
+					// Yuck, FT didn't detect this but generated a null pointer!
+					LogManager::getSingleton().logMessage("Info: Freetype returned null for character " +
+						StringConverter::toString(cp) + " in font " + mName);
+					continue;
+				}
+
+				int y_bearnig = ( max_bear >> 6 ) - ( face->glyph->metrics.horiBearingY >> 6 );
+
+				for(int j = 0; j < face->glyph->bitmap.rows; j++ )
+				{
+					size_t row = j + m + y_bearnig;
+					uchar* pDest = &imageData[(row * data_width) + l * pixel_bytes];
+					for(int k = 0; k < face->glyph->bitmap.width; k++ )
+					{
+						if (mAntialiasColour)
+						{
+							// Use the same greyscale pixel for all components RGBA
+							*pDest++= *buffer;
+						}
+						else
+						{
+							// Always white whether 'on' or 'off' pixel, since alpha
+							// will turn off
+							*pDest++= 0xFF;
+						}
+						// Always use the greyscale value for alpha
+						*pDest++= *buffer++; 
+					}
+				}
+
+				this->setGlyphTexCoords(cp,
+					(Real)l / (Real)finalWidth,  // u1
+					(Real)m / (Real)finalHeight,  // v1
+					(Real)( l + ( face->glyph->advance.x >> 6 ) ) / (Real)finalWidth, // u2
+					( m + ( max_height >> 6 ) ) / (Real)finalHeight, // v2
+					textureAspect
+					);
+
+				// Advance a column
+				l += (advance + char_spacer);
+
+				// If at end of row
+				if( finalWidth - 1 < l + ( advance ) )
+				{
+					m += ( max_height >> 6 ) + char_spacer;
+					l = 0;
+				}
+			}
+		}
+
+        DataStreamPtr memStream(
+			new MemoryDataStream(imageData, data_size, true));
+
+        Image img;
+		img.loadRawData( memStream, finalWidth, finalHeight, PF_BYTE_LA );
+
+		Texture* tex = static_cast<Texture*>(res);
+		// Call internal _loadImages, not loadImage since that's external and 
+		// will determine load status etc again, and this is a manual loader inside load()
+		ConstImagePtrList imagePtrs;
+		imagePtrs.push_back(&img);
+		tex->_loadImages( imagePtrs );
+
+
+		FT_Done_FreeType(ftLibrary);
+    }
+	//-----------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	String Font::CmdType::doGet(const void* target) const
+	{
+		const Font* f = static_cast<const Font*>(target);
+		if (f->getType() == FT_TRUETYPE)
+		{
+			return "truetype";
+		}
+		else
+		{
+			return "image";
+		}
+	}
+	void Font::CmdType::doSet(void* target, const String& val)
+	{
+		Font* f = static_cast<Font*>(target);
+		if (val == "truetype")
+		{
+			f->setType(FT_TRUETYPE);
+		}
+		else
+		{
+			f->setType(FT_IMAGE);
+		}
+	}
+	//-----------------------------------------------------------------------
+	String Font::CmdSource::doGet(const void* target) const
+	{
+		const Font* f = static_cast<const Font*>(target);
+		return f->getSource();
+	}
+	void Font::CmdSource::doSet(void* target, const String& val)
+	{
+		Font* f = static_cast<Font*>(target);
+		f->setSource(val);
+	}
+	//-----------------------------------------------------------------------
+	String Font::CmdSize::doGet(const void* target) const
+	{
+		const Font* f = static_cast<const Font*>(target);
+		return StringConverter::toString(f->getTrueTypeSize());
+	}
+	void Font::CmdSize::doSet(void* target, const String& val)
+	{
+		Font* f = static_cast<Font*>(target);
+		f->setTrueTypeSize(StringConverter::parseReal(val));
+	}
+	//-----------------------------------------------------------------------
+	String Font::CmdResolution::doGet(const void* target) const
+	{
+		const Font* f = static_cast<const Font*>(target);
+		return StringConverter::toString(f->getTrueTypeResolution());
+	}
+	void Font::CmdResolution::doSet(void* target, const String& val)
+	{
+		Font* f = static_cast<Font*>(target);
+		f->setTrueTypeResolution(StringConverter::parseUnsignedInt(val));
+	}
+	//-----------------------------------------------------------------------
+	String Font::CmdCodePoints::doGet(const void* target) const
+	{
+		const Font* f = static_cast<const Font*>(target);
+		const CodePointRangeList& rangeList = f->getCodePointRangeList();
+		StringUtil::StrStreamType str;
+		for (CodePointRangeList::const_iterator i = rangeList.begin(); i != rangeList.end(); ++i)
+		{
+			str << i->first << "-" << i->second << " ";
+		}
+		return str.str();
+	}
+	void Font::CmdCodePoints::doSet(void* target, const String& val)
+	{
+		// Format is "code_points start1-end1 start2-end2"
+		Font* f = static_cast<Font*>(target);
+
+		StringVector vec = StringUtil::split(val, " \t");
+		for (StringVector::iterator i = vec.begin(); i != vec.end(); ++i)
+		{
+			String& item = *i;
+			StringVector itemVec = StringUtil::split(item, "-");
+			if (itemVec.size() == 2)
+			{
+				f->addCodePointRange(CodePointRange(
+					StringConverter::parseLong(itemVec[0]), 
+					StringConverter::parseLong(itemVec[1])));
+			}
+		}
+	}
+
+
+}
Index: /OgreMain/src/OgreFontManager.cpp
===================================================================
--- /OgreMain/src/OgreFontManager.cpp	(revision 5)
+++ /OgreMain/src/OgreFontManager.cpp	(revision 5)
@@ -0,0 +1,249 @@
+/*-------------------------------------------------------------------------
+This source file is a part of OGRE
+(Object-oriented Graphics Rendering Engine)
+
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License (LGPL) as 
+published by the Free Software Foundation; either version 2.1 of the 
+License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful, but 
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
+or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License 
+along with this library; if not, write to the Free Software Foundation, 
+Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA or go to
+http://www.gnu.org/copyleft/lesser.txt
+-------------------------------------------------------------------------*/
+#include "OgreStableHeaders.h"
+
+#include "OgreFontManager.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreStringVector.h"
+#include "OgreException.h"
+#include "OgreResourceGroupManager.h"
+
+namespace Ogre
+{
+    //---------------------------------------------------------------------
+    template<> FontManager * Singleton< FontManager >::ms_Singleton = 0;
+    FontManager* FontManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    FontManager& FontManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+    //---------------------------------------------------------------------
+	FontManager::FontManager() : ResourceManager()
+	{
+        // Loading order
+        mLoadOrder = 200.0f;
+		// Scripting is supported by this manager
+		mScriptPatterns.push_back("*.fontdef");
+		// Register scripting with resource group manager
+		ResourceGroupManager::getSingleton()._registerScriptLoader(this);
+
+		// Resource type
+		mResourceType = "Font";
+
+		// Register with resource group manager
+		ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
+
+
+	}
+	//---------------------------------------------------------------------
+	FontManager::~FontManager()
+	{
+		// Unregister with resource group manager
+		ResourceGroupManager::getSingleton()._unregisterResourceManager(mResourceType);
+		// Unegister scripting with resource group manager
+		ResourceGroupManager::getSingleton()._unregisterScriptLoader(this);
+
+	}
+	//---------------------------------------------------------------------
+	Resource* FontManager::createImpl(const String& name, ResourceHandle handle, 
+		const String& group, bool isManual, ManualResourceLoader* loader,
+        const NameValuePairList* params)
+	{
+		return new Font(this, name, handle, group, isManual, loader);
+	}
+	//---------------------------------------------------------------------
+    void FontManager::parseScript(DataStreamPtr& stream, const String& groupName)
+    {
+        String line;
+        FontPtr pFont;
+
+        while( !stream->eof() )
+        {
+            line = stream->getLine();
+            // Ignore blanks & comments
+            if( !line.length() || line.substr( 0, 2 ) == "//" )
+            {
+                continue;
+            }
+            else
+            {
+			    if (pFont.isNull())
+			    {
+				    // No current font
+				    // So first valid data should be font name
+				    pFont = create(line, groupName);
+					pFont->_notifyOrigin(stream->getName());
+				    // Skip to and over next {
+                    stream->skipLine("{");
+			    }
+			    else
+			    {
+				    // Already in font
+				    if (line == "}")
+				    {
+					    // Finished 
+					    pFont.setNull();
+                        // NB font isn't loaded until required
+				    }
+                    else
+                    {
+                        parseAttribute(line, pFont);
+                    }
+                }
+            }
+        }
+    }
+    //---------------------------------------------------------------------
+    void FontManager::parseAttribute(const String& line, FontPtr& pFont)
+    {
+        std::vector<String> params = StringUtil::split(line);
+        String& attrib = params[0];
+		StringUtil::toLowerCase(attrib);
+        if (attrib == "type")
+        {
+            // Check params
+            if (params.size() != 2)
+            {
+                logBadAttrib(line, pFont);
+                return;
+            }
+            // Set
+			StringUtil::toLowerCase(params[1]);
+            if (params[1] == "truetype")
+            {
+                pFont->setType(FT_TRUETYPE);
+            }
+            else
+            {
+                pFont->setType(FT_IMAGE);
+            }
+
+        }
+        else if (attrib == "source")
+        {
+            // Check params
+            if (params.size() != 2)
+            {
+                logBadAttrib(line, pFont);
+                return;
+            }
+            // Set
+            pFont->setSource(params[1]);
+        }
+        else if (attrib == "glyph")
+        {
+            // Check params
+            if (params.size() != 6)
+            {
+                logBadAttrib(line, pFont);
+                return;
+            }
+            // Set
+			// Support numeric and character glyph specification
+			Font::CodePoint cp;
+			if (params[1].at(0) == 'u' && params[1].size() > 1)
+			{
+				// Unicode glyph spec
+				String trimmed = params[1].substr(1);
+				cp = StringConverter::parseUnsignedInt(trimmed);
+			}
+			else
+			{
+				// Direct character
+				cp = params[1].at(0);
+			}
+            pFont->setGlyphTexCoords(
+                cp, 
+                StringConverter::parseReal(params[2]),
+                StringConverter::parseReal(params[3]),
+                StringConverter::parseReal(params[4]),
+                StringConverter::parseReal(params[5]), 1.0 ); // assume image is square
+        }
+        else if (attrib == "size")
+        {
+            // Check params
+            if (params.size() != 2)
+            {
+                logBadAttrib(line, pFont);
+                return;
+            }
+            // Set
+            pFont->setTrueTypeSize(
+                StringConverter::parseReal(params[1]) );
+        }
+        else if (attrib == "resolution")
+        {
+            // Check params
+            if (params.size() != 2)
+            {
+                logBadAttrib(line, pFont);
+                return;
+            }
+            // Set
+            pFont->setTrueTypeResolution(
+                (uint)StringConverter::parseReal(params[1]) );
+        }
+        else if (attrib == "antialias_colour")
+        {
+        	// Check params
+        	if (params.size() != 2)
+        	{
+                logBadAttrib(line, pFont);
+                return;
+        	}
+        	// Set
+            pFont->setAntialiasColour(StringConverter::parseBool(params[1]));
+        }
+		else if (attrib == "code_points")
+		{
+			for (size_t c = 1; c < params.size(); ++c)
+			{
+				String& item = params[c];
+				StringVector itemVec = StringUtil::split(item, "-");
+				if (itemVec.size() == 2)
+				{
+					pFont->addCodePointRange(Font::CodePointRange(
+						StringConverter::parseLong(itemVec[0]), 
+						StringConverter::parseLong(itemVec[1])));
+				}
+			}
+		}
+
+
+
+    }
+    //---------------------------------------------------------------------
+    void FontManager::logBadAttrib(const String& line, FontPtr& pFont)
+    {
+        LogManager::getSingleton().logMessage("Bad attribute line: " + line +
+            " in font " + pFont->getName());
+
+    }
+
+}
Index: /OgreMain/src/OgreFreeImageCodec.cpp
===================================================================
--- /OgreMain/src/OgreFreeImageCodec.cpp	(revision 5)
+++ /OgreMain/src/OgreFreeImageCodec.cpp	(revision 5)
@@ -0,0 +1,499 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreStableHeaders.h"
+
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreFreeImageCodec.h"
+#include "OgreImage.h"
+#include "OgreException.h"
+
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+
+#include <FreeImage.h>
+
+namespace Ogre {
+
+	FreeImageCodec::RegisteredCodecList FreeImageCodec::msCodecList;
+	//---------------------------------------------------------------------
+	void FreeImageErrorHandler(FREE_IMAGE_FORMAT fif, const char *message) 
+	{
+		// Callback method as required by FreeImage to report problems
+		StringUtil::StrStreamType str;
+		str << "FreeImage error: '" << message << "'";
+		
+		const char* typeName = FreeImage_GetFormatFromFIF(fif);
+		if (typeName)
+		{
+			str << " when loading format " << typeName;
+		}
+
+		LogManager::getSingleton().logMessage(str.str());
+
+	}
+	//---------------------------------------------------------------------
+	void FreeImageCodec::startup(void)
+	{
+		FreeImage_Initialise(false);
+
+		LogManager::getSingleton().logMessage(
+			LML_NORMAL,
+			"FreeImage version: " + String(FreeImage_GetVersion()));
+		LogManager::getSingleton().logMessage(
+			LML_NORMAL,
+			FreeImage_GetCopyrightMessage());
+
+		// Register codecs
+		StringUtil::StrStreamType strExt;
+		strExt << "Supported formats: ";
+		bool first = true;
+		for (int i = 0; i < FreeImage_GetFIFCount(); ++i)
+		{
+
+			// Skip DDS codec since FreeImage does not have the option 
+			// to keep DXT data compressed, we'll use our own codec
+			if ((FREE_IMAGE_FORMAT)i == FIF_DDS)
+				continue;
+			
+			String exts(FreeImage_GetFIFExtensionList((FREE_IMAGE_FORMAT)i));
+			if (!first)
+			{
+				strExt << ",";
+			}
+			first = false;
+			strExt << exts;
+			
+			// Pull off individual formats (separated by comma by FI)
+			StringVector extsVector = StringUtil::split(exts, ",");
+			for (StringVector::iterator v = extsVector.begin(); v != extsVector.end(); ++v)
+			{
+				ImageCodec* codec = new FreeImageCodec(*v, i);
+				msCodecList.push_back(codec);
+				Codec::registerCodec(codec);
+			}
+		}
+		LogManager::getSingleton().logMessage(
+			LML_NORMAL,
+			strExt.str());
+
+		// Set error handler
+		FreeImage_SetOutputMessage(FreeImageErrorHandler);
+
+
+
+
+	}
+	//---------------------------------------------------------------------
+	void FreeImageCodec::shutdown(void)
+	{
+		FreeImage_DeInitialise();
+
+		for (RegisteredCodecList::iterator i = msCodecList.begin();
+			i != msCodecList.end(); ++i)
+		{
+			Codec::unRegisterCodec(*i);
+			delete *i;
+		}
+		msCodecList.clear();
+
+	}
+	//---------------------------------------------------------------------
+    FreeImageCodec::FreeImageCodec(const String &type, unsigned int fiType):
+        mType(type),
+        mFreeImageType(fiType)
+    { 
+    }
+	//---------------------------------------------------------------------
+	FIBITMAP* FreeImageCodec::encode(MemoryDataStreamPtr& input, CodecDataPtr& pData) const
+	{
+		FIBITMAP* ret = 0;
+
+		ImageData* pImgData = static_cast< ImageData * >( pData.getPointer() );
+		PixelBox src(pImgData->width, pImgData->height, pImgData->depth, pImgData->format, input->getPtr());
+
+		// The required format, which will adjust to the format
+		// actually supported by FreeImage.
+		PixelFormat requiredFormat = pImgData->format;
+
+		// determine the settings
+		FREE_IMAGE_TYPE imageType;
+		switch(pImgData->format)
+		{
+		case PF_R5G6B5:
+		case PF_B5G6R5:
+		case PF_R8G8B8:
+		case PF_B8G8R8:
+		case PF_A8R8G8B8:
+		case PF_X8R8G8B8:
+		case PF_A8B8G8R8:
+		case PF_X8B8G8R8:
+		case PF_B8G8R8A8:
+		case PF_R8G8B8A8:
+		case PF_A4L4:
+		case PF_BYTE_LA:
+		case PF_R3G3B2:
+		case PF_A4R4G4B4:
+		case PF_A1R5G5B5:
+		case PF_A2R10G10B10:
+		case PF_A2B10G10R10:
+			// I'd like to be able to use r/g/b masks to get FreeImage to load the data
+			// in it's existing format, but that doesn't work, FreeImage needs to have
+			// data in RGB[A] (big endian) and BGR[A] (little endian), always.
+			if (PixelUtil::hasAlpha(pImgData->format))
+			{
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+				requiredFormat = PF_BYTE_RGBA;
+#else
+				requiredFormat = PF_BYTE_BGRA;
+#endif
+			}
+			else
+			{
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+				requiredFormat = PF_BYTE_RGB;
+#else
+				requiredFormat = PF_BYTE_BGR;
+#endif
+			}
+			// fall through
+		case PF_L8:
+		case PF_A8:
+			imageType = FIT_BITMAP;
+			break;
+
+		case PF_L16:
+			imageType = FIT_UINT16;
+			break;
+
+		case PF_SHORT_GR:
+			requiredFormat = PF_SHORT_RGB;
+			// fall through
+		case PF_SHORT_RGB:
+			imageType = FIT_RGB16;
+			break;
+
+		case PF_SHORT_RGBA:
+			imageType = FIT_RGBA16;
+			break;
+
+		case PF_FLOAT16_R:
+			requiredFormat = PF_FLOAT32_R;
+			// fall through
+		case PF_FLOAT32_R:
+			imageType = FIT_FLOAT;
+			break;
+
+		case PF_FLOAT16_GR:
+		case PF_FLOAT16_RGB:
+		case PF_FLOAT32_GR:
+			requiredFormat = PF_FLOAT32_RGB;
+			// fall through
+		case PF_FLOAT32_RGB:
+			imageType = FIT_RGBF;
+			break;
+
+		case PF_FLOAT16_RGBA:
+			requiredFormat = PF_FLOAT32_RGBA;
+			// fall through
+		case PF_FLOAT32_RGBA:
+			imageType = FIT_RGBAF;
+			break;
+
+		default:
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Invalid image format", "FreeImageCodec::encode");
+		};
+
+		bool conversionRequired = false;
+
+		unsigned char* srcData = input->getPtr();
+		PixelBox convBox(pImgData->width, pImgData->height, 1, requiredFormat);
+		if (requiredFormat != pImgData->format)
+		{
+			conversionRequired = true;
+			// Allocate memory
+			convBox.data = new uchar[convBox.getConsecutiveSize()];
+			// perform conversion and reassign source
+			PixelBox src(pImgData->width, pImgData->height, 1, pImgData->format, input->getPtr());
+			PixelUtil::bulkPixelConversion(src, convBox);
+			srcData = static_cast<unsigned char*>(convBox.data);
+
+		}
+
+		unsigned bpp = static_cast<unsigned>(PixelUtil::getNumElemBits(requiredFormat));
+
+		ret = FreeImage_AllocateT(
+			imageType, 
+			static_cast<int>(pImgData->width), 
+			static_cast<int>(pImgData->height), 
+			bpp);
+
+		if (requiredFormat == PF_L8 || requiredFormat == PF_A8)
+		{
+			// Must explicitly tell FreeImage that this is greyscale by setting
+			// a "grey" palette (otherwise it will save as a normal RGB
+			// palettized image).
+			FIBITMAP *tmp = FreeImage_ConvertToGreyscale(ret);
+			FreeImage_Unload(ret);
+			ret = tmp;
+		}
+		
+		size_t dstPitch = FreeImage_GetPitch(ret);
+		size_t srcPitch = pImgData->width * PixelUtil::getNumElemBytes(requiredFormat);
+
+
+		// Copy data, invert scanlines and respect FreeImage pitch
+		uchar* pSrc;
+		uchar* pDst = FreeImage_GetBits(ret);
+		for (size_t y = 0; y < pImgData->height; ++y)
+		{
+			pSrc = srcData + (pImgData->height - y - 1) * srcPitch;
+			memcpy(pDst, pSrc, srcPitch);
+			pDst += dstPitch;
+		}
+
+		if (conversionRequired)
+		{
+			// delete temporary conversion area
+			delete [] static_cast<uchar*>(convBox.data);
+		}
+
+		return ret;
+	}
+    //---------------------------------------------------------------------
+    DataStreamPtr FreeImageCodec::code(MemoryDataStreamPtr& input, Codec::CodecDataPtr& pData) const
+    {        
+		FIBITMAP* fiBitmap = encode(input, pData);
+
+		// open memory chunk allocated by FreeImage
+		FIMEMORY* mem = FreeImage_OpenMemory();
+		// write data into memory
+		FreeImage_SaveToMemory((FREE_IMAGE_FORMAT)mFreeImageType, fiBitmap, mem);
+		// Grab data information
+		BYTE* data;
+		DWORD size;
+		FreeImage_AcquireMemory(mem, &data, &size);
+		// Copy data into our own buffer
+		BYTE* ourData = new BYTE[size];
+		memcpy(ourData, data, size);
+		// Wrap data in stream, tell it to free on close 
+		DataStreamPtr outstream(new MemoryDataStream(ourData, size, true));
+		// Now free FreeImage memory buffers
+		FreeImage_CloseMemory(mem);
+		// Unload bitmap
+		FreeImage_Unload(fiBitmap);
+
+		return outstream;
+
+
+    }
+    //---------------------------------------------------------------------
+    void FreeImageCodec::codeToFile(MemoryDataStreamPtr& input, 
+        const String& outFileName, Codec::CodecDataPtr& pData) const
+    {
+		FIBITMAP* fiBitmap = encode(input, pData);
+
+		FreeImage_Save((FREE_IMAGE_FORMAT)mFreeImageType, fiBitmap, outFileName.c_str());
+		FreeImage_Unload(fiBitmap);
+
+
+    }
+    //---------------------------------------------------------------------
+    Codec::DecodeResult FreeImageCodec::decode(DataStreamPtr& input) const
+    {
+		// Buffer stream into memory (TODO: override IO functions instead?)
+		MemoryDataStream memStream(input, true);
+
+		FIMEMORY* fiMem = 
+			FreeImage_OpenMemory(memStream.getPtr(), static_cast<DWORD>(memStream.size()));
+
+		FIBITMAP* fiBitmap = FreeImage_LoadFromMemory(
+			(FREE_IMAGE_FORMAT)mFreeImageType, fiMem);
+		if (!fiBitmap)
+		{
+			OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+				"Error decoding image", 
+				"FreeImageCodec::decode");
+		}
+
+
+		ImageData* imgData = new ImageData();
+		MemoryDataStreamPtr output;
+
+		imgData->depth = 1; // only 2D formats handled by this codec
+		imgData->width = FreeImage_GetWidth(fiBitmap);
+		imgData->height = FreeImage_GetHeight(fiBitmap);
+        imgData->num_mipmaps = 0; // no mipmaps in non-DDS 
+        imgData->flags = 0;
+
+		// Must derive format first, this may perform conversions
+		
+		FREE_IMAGE_TYPE imageType = FreeImage_GetImageType(fiBitmap);
+		FREE_IMAGE_COLOR_TYPE colourType = FreeImage_GetColorType(fiBitmap);
+		unsigned bpp = FreeImage_GetBPP(fiBitmap);
+
+		switch(imageType)
+		{
+		case FIT_UNKNOWN:
+		case FIT_COMPLEX:
+		case FIT_UINT32:
+		case FIT_INT32:
+		case FIT_DOUBLE:
+        default:
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Unknown or unsupported image format", 
+				"FreeImageCodec::decode");
+				
+			break;
+		case FIT_BITMAP:
+			// Standard image type
+			// Perform any colour conversions for greyscale
+			if (colourType == FIC_MINISWHITE || colourType == FIC_MINISBLACK)
+			{
+				FIBITMAP* newBitmap = FreeImage_ConvertToGreyscale(fiBitmap);
+				// free old bitmap and replace
+				FreeImage_Unload(fiBitmap);
+				fiBitmap = newBitmap;
+				// get new formats
+				bpp = FreeImage_GetBPP(fiBitmap);
+				colourType = FreeImage_GetColorType(fiBitmap);
+			}
+			// Perform any colour conversions for RGB
+			else if (bpp < 8 || colourType == FIC_PALETTE || colourType == FIC_CMYK)
+			{
+				FIBITMAP* newBitmap = FreeImage_ConvertTo24Bits(fiBitmap);
+				// free old bitmap and replace
+				FreeImage_Unload(fiBitmap);
+				fiBitmap = newBitmap;
+				// get new formats
+				bpp = FreeImage_GetBPP(fiBitmap);
+				colourType = FreeImage_GetColorType(fiBitmap);
+			}
+
+			// by this stage, 8-bit is greyscale, 16/24/32 bit are RGB[A]
+			switch(bpp)
+			{
+			case 8:
+				imgData->format = PF_L8;
+				break;
+			case 16:
+				// Determine 555 or 565 from green mask
+				// cannot be 16-bit greyscale since that's FIT_UINT16
+				if(FreeImage_GetGreenMask(fiBitmap) == FI16_565_GREEN_MASK)
+				{
+					imgData->format = PF_R5G6B5;
+				}
+				else
+				{
+					// FreeImage doesn't support 4444 format so must be 1555
+					imgData->format = PF_A1R5G5B5;
+				}
+				break;
+			case 24:
+				// FreeImage differs per platform
+				//     PF_BYTE_BGR[A] for little endian (== PF_ARGB native)
+				//     PF_BYTE_RGB[A] for big endian (== PF_RGBA native)
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+				imgData->format = PF_BYTE_RGB;
+#else
+				imgData->format = PF_BYTE_BGR;
+#endif
+				break;
+			case 32:
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+				imgData->format = PF_BYTE_RGBA;
+#else
+				imgData->format = PF_BYTE_BGRA;
+#endif
+				break;
+				
+				
+			};
+			break;
+		case FIT_UINT16:
+		case FIT_INT16:
+			// 16-bit greyscale
+			imgData->format = PF_L16;
+			break;
+		case FIT_FLOAT:
+			// Single-component floating point data
+			imgData->format = PF_FLOAT32_R;
+			break;
+		case FIT_RGB16:
+			imgData->format = PF_SHORT_RGB;
+			break;
+		case FIT_RGBA16:
+			imgData->format = PF_SHORT_RGBA;
+			break;
+		case FIT_RGBF:
+			imgData->format = PF_FLOAT32_RGB;
+			break;
+		case FIT_RGBAF:
+			imgData->format = PF_FLOAT32_RGBA;
+			break;
+			
+			
+		};
+
+		unsigned char* srcData = FreeImage_GetBits(fiBitmap);
+		unsigned srcPitch = FreeImage_GetPitch(fiBitmap);
+
+		// Final data - invert image and trim pitch at the same time
+		size_t dstPitch = imgData->width * PixelUtil::getNumElemBytes(imgData->format);
+		imgData->size = dstPitch * imgData->height;
+        // Bind output buffer
+        output.bind(new MemoryDataStream(imgData->size));
+
+		uchar* pSrc;
+		uchar* pDst = output->getPtr();
+		for (size_t y = 0; y < imgData->height; ++y)
+		{
+			pSrc = srcData + (imgData->height - y - 1) * srcPitch;
+			memcpy(pDst, pSrc, dstPitch);
+			pDst += dstPitch;
+		}
+
+		
+		FreeImage_Unload(fiBitmap);
+		FreeImage_CloseMemory(fiMem);
+
+
+        DecodeResult ret;
+        ret.first = output;
+        ret.second = CodecDataPtr(imgData);
+		return ret;
+
+    }
+    //---------------------------------------------------------------------    
+    String FreeImageCodec::getType() const 
+    {
+        return mType;
+    }
+}
Index: /OgreMain/src/OgreFrustum.cpp
===================================================================
--- /OgreMain/src/OgreFrustum.cpp	(revision 5)
+++ /OgreMain/src/OgreFrustum.cpp	(revision 5)
@@ -0,0 +1,1265 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreFrustum.h"
+
+#include "OgreMath.h"
+#include "OgreMatrix3.h"
+#include "OgreSceneNode.h"
+#include "OgreSphere.h"
+#include "OgreLogManager.h"
+#include "OgreException.h"
+#include "OgreRoot.h"
+#include "OgreCamera.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreHardwareIndexBuffer.h"
+#include "OgreMaterialManager.h"
+#include "OgreRenderSystem.h"
+
+namespace Ogre {
+
+    String Frustum::msMovableType = "Frustum";
+    const Real Frustum::INFINITE_FAR_PLANE_ADJUST = 0.00001;
+    //-----------------------------------------------------------------------
+    Frustum::Frustum() : 
+        mProjType(PT_PERSPECTIVE), 
+        mFOVy(Radian(Math::PI/4.0)), 
+        mFarDist(100000.0f), 
+        mNearDist(100.0f), 
+        mAspect(1.33333333333333f), 
+        mFrustumOffset(Vector2::ZERO),
+        mFocalLength(1.0f),
+        mLastParentOrientation(Quaternion::IDENTITY),
+        mLastParentPosition(Vector3::ZERO),
+        mRecalcFrustum(true), 
+        mRecalcView(true), 
+        mRecalcFrustumPlanes(true),
+        mRecalcWorldSpaceCorners(true),
+        mRecalcVertexData(true),
+		mCustomViewMatrix(false),
+		mCustomProjMatrix(false),
+        mReflect(false), 
+        mLinkedReflectPlane(0),
+        mObliqueDepthProjection(false), 
+        mLinkedObliqueProjPlane(0)
+    {
+        // Initialise material
+        mMaterial = MaterialManager::getSingleton().getByName("BaseWhiteNoLighting");
+        
+        // Alter superclass members
+        mVisible = false;
+        mParentNode = 0;
+
+        mLastLinkedReflectionPlane.normal = Vector3::ZERO;
+        mLastLinkedObliqueProjPlane.normal = Vector3::ZERO;
+
+
+        updateView();
+        updateFrustum();
+    }
+
+    //-----------------------------------------------------------------------
+    Frustum::~Frustum()
+    {
+        // Do nothing
+    }
+
+    //-----------------------------------------------------------------------
+    void Frustum::setFOVy(const Radian& fov)
+    {
+        mFOVy = fov;
+        invalidateFrustum();
+    }
+
+    //-----------------------------------------------------------------------
+    const Radian& Frustum::getFOVy(void) const
+    {
+        return mFOVy;
+    }
+
+
+    //-----------------------------------------------------------------------
+    void Frustum::setFarClipDistance(Real farPlane)
+    {
+        mFarDist = farPlane;
+        invalidateFrustum();
+    }
+
+    //-----------------------------------------------------------------------
+    Real Frustum::getFarClipDistance(void) const
+    {
+        return mFarDist;
+    }
+
+    //-----------------------------------------------------------------------
+    void Frustum::setNearClipDistance(Real nearPlane)
+    {
+        if (nearPlane <= 0)
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Near clip distance must be greater than zero.",
+                "Frustum::setNearClipDistance");
+        mNearDist = nearPlane;
+        invalidateFrustum();
+    }
+
+    //-----------------------------------------------------------------------
+    Real Frustum::getNearClipDistance(void) const
+    {
+        return mNearDist;
+    }
+
+    //---------------------------------------------------------------------
+    void Frustum::setFrustumOffset(const Vector2& offset)
+    {
+        mFrustumOffset = offset;
+        invalidateFrustum();
+    }
+    //---------------------------------------------------------------------
+    void Frustum::setFrustumOffset(Real horizontal, Real vertical)
+    {
+        setFrustumOffset(Vector2(horizontal, vertical));
+    }
+    //---------------------------------------------------------------------
+    const Vector2& Frustum::getFrustumOffset() const
+    {
+        return mFrustumOffset;
+    }
+    //---------------------------------------------------------------------
+    void Frustum::setFocalLength(Real focalLength)
+    {
+        if (focalLength <= 0)
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "Focal length must be greater than zero.",
+                "Frustum::setFocalLength");
+        }
+
+        mFocalLength = focalLength;
+        invalidateFrustum();
+    }
+    //---------------------------------------------------------------------
+    Real Frustum::getFocalLength() const
+    {
+        return mFocalLength;
+    }
+    //-----------------------------------------------------------------------
+    const Matrix4& Frustum::getProjectionMatrix(void) const
+    {
+
+        updateFrustum();
+
+        return mProjMatrix;
+    }
+    //-----------------------------------------------------------------------
+    const Matrix4& Frustum::getProjectionMatrixWithRSDepth(void) const
+    {
+
+        updateFrustum();
+
+        return mProjMatrixRSDepth;
+    }
+    //-----------------------------------------------------------------------
+    const Matrix4& Frustum::getProjectionMatrixRS(void) const
+    {
+
+        updateFrustum();
+
+        return mProjMatrixRS;
+    }
+    //-----------------------------------------------------------------------
+    const Matrix4& Frustum::getViewMatrix(void) const
+    {
+        updateView();
+
+        return mViewMatrix;
+
+    }
+
+    //-----------------------------------------------------------------------
+    const Plane* Frustum::getFrustumPlanes(void) const
+    {
+        // Make any pending updates to the calculated frustum planes
+        updateFrustumPlanes();
+
+        return mFrustumPlanes;
+    }
+
+    //-----------------------------------------------------------------------
+    const Plane& Frustum::getFrustumPlane(unsigned short plane) const
+    {
+        // Make any pending updates to the calculated frustum planes
+        updateFrustumPlanes();
+
+        return mFrustumPlanes[plane];
+
+    }
+
+    //-----------------------------------------------------------------------
+    bool Frustum::isVisible(const AxisAlignedBox& bound, FrustumPlane* culledBy) const
+    {
+        // Null boxes always invisible
+        if (bound.isNull()) return false;
+
+        // Infinite boxes always visible
+        if (bound.isInfinite()) return true;
+
+        // Make any pending updates to the calculated frustum planes
+        updateFrustumPlanes();
+
+        // Get centre of the box
+        Vector3 centre = bound.getCenter();
+        // Get the half-size of the box
+        Vector3 halfSize = bound.getHalfSize();
+
+        // For each plane, see if all points are on the negative side
+        // If so, object is not visible
+        for (int plane = 0; plane < 6; ++plane)
+        {
+            // Skip far plane if infinite view frustum
+            if (plane == FRUSTUM_PLANE_FAR && mFarDist == 0)
+                continue;
+
+            Plane::Side side = mFrustumPlanes[plane].getSide(centre, halfSize);
+            if (side == Plane::NEGATIVE_SIDE)
+            {
+                // ALL corners on negative side therefore out of view
+                if (culledBy)
+                    *culledBy = (FrustumPlane)plane;
+                return false;
+            }
+
+        }
+
+        return true;
+    }
+
+    //-----------------------------------------------------------------------
+    bool Frustum::isVisible(const Vector3& vert, FrustumPlane* culledBy) const
+    {
+        // Make any pending updates to the calculated frustum planes
+        updateFrustumPlanes();
+
+        // For each plane, see if all points are on the negative side
+        // If so, object is not visible
+        for (int plane = 0; plane < 6; ++plane)
+        {
+            // Skip far plane if infinite view frustum
+            if (plane == FRUSTUM_PLANE_FAR && mFarDist == 0)
+                continue;
+
+            if (mFrustumPlanes[plane].getSide(vert) == Plane::NEGATIVE_SIDE)
+            {
+                // ALL corners on negative side therefore out of view
+                if (culledBy)
+                    *culledBy = (FrustumPlane)plane;
+                return false;
+            }
+
+        }
+
+        return true;
+    }
+
+    //-----------------------------------------------------------------------
+    bool Frustum::isVisible(const Sphere& sphere, FrustumPlane* culledBy) const
+    {
+        // Make any pending updates to the calculated frustum planes
+        updateFrustumPlanes();
+
+        // For each plane, see if sphere is on negative side
+        // If so, object is not visible
+        for (int plane = 0; plane < 6; ++plane)
+        {
+            // Skip far plane if infinite view frustum
+            if (plane == FRUSTUM_PLANE_FAR && mFarDist == 0)
+                continue;
+
+            // If the distance from sphere center to plane is negative, and 'more negative' 
+            // than the radius of the sphere, sphere is outside frustum
+            if (mFrustumPlanes[plane].getDistance(sphere.getCenter()) < -sphere.getRadius())
+            {
+                // ALL corners on negative side therefore out of view
+                if (culledBy)
+                    *culledBy = (FrustumPlane)plane;
+                return false;
+            }
+
+        }
+
+        return true;
+    }
+    //-----------------------------------------------------------------------
+    void Frustum::calcProjectionParameters(Real& left, Real& right, Real& bottom, Real& top) const
+    { 
+		if (mCustomProjMatrix)
+		{
+			// Convert clipspace corners to camera space
+			Matrix4 invProj = mProjMatrix.inverse();
+			Vector3 topLeft(-0.5f, 0.5f, 0.0f);
+			Vector3 bottomRight(0.5f, -0.5f, 0.0f);
+
+			topLeft = invProj * topLeft;
+			bottomRight = invProj * bottomRight;
+
+			left = topLeft.x;
+			top = topLeft.y;
+			right = bottomRight.x;
+			bottom = bottomRight.y;
+
+		}
+		else
+		{
+			// Calculate general projection parameters
+
+			Radian thetaY (mFOVy * 0.5f);
+			Real tanThetaY = Math::Tan(thetaY);
+			Real tanThetaX = tanThetaY * mAspect;
+
+			// Unknow how to apply frustum offset to orthographic camera, just ignore here
+			Real nearFocal = (mProjType == PT_PERSPECTIVE) ? mNearDist / mFocalLength : 0;
+			Real nearOffsetX = mFrustumOffset.x * nearFocal;
+			Real nearOffsetY = mFrustumOffset.y * nearFocal;
+			Real half_w = tanThetaX * mNearDist;
+			Real half_h = tanThetaY * mNearDist;
+
+			left   = - half_w + nearOffsetX;
+			right  = + half_w + nearOffsetX;
+			bottom = - half_h + nearOffsetY;
+			top    = + half_h + nearOffsetY;
+		}
+    }
+	//-----------------------------------------------------------------------
+	void Frustum::updateFrustumImpl(void) const
+	{
+		// Common calcs
+		Real left, right, bottom, top;
+		calcProjectionParameters(left, right, bottom, top);
+
+		if (!mCustomProjMatrix)
+		{
+
+			// The code below will dealing with general projection 
+			// parameters, similar glFrustum and glOrtho.
+			// Doesn't optimise manually except division operator, so the 
+			// code more self-explaining.
+
+			Real inv_w = 1 / (right - left);
+			Real inv_h = 1 / (top - bottom);
+			Real inv_d = 1 / (mFarDist - mNearDist);
+
+			// Recalc if frustum params changed
+			if (mProjType == PT_PERSPECTIVE)
+			{
+				// Calc matrix elements
+				Real A = 2 * mNearDist * inv_w;
+				Real B = 2 * mNearDist * inv_h;
+				Real C = (right + left) * inv_w;
+				Real D = (top + bottom) * inv_h;
+				Real q, qn;
+				if (mFarDist == 0)
+				{
+					// Infinite far plane
+					q = Frustum::INFINITE_FAR_PLANE_ADJUST - 1;
+					qn = mNearDist * (Frustum::INFINITE_FAR_PLANE_ADJUST - 2);
+				}
+				else
+				{
+					q = - (mFarDist + mNearDist) * inv_d;
+					qn = -2 * (mFarDist * mNearDist) * inv_d;
+				}
+
+				// NB: This creates 'uniform' perspective projection matrix,
+				// which depth range [-1,1], right-handed rules
+				//
+				// [ A   0   C   0  ]
+				// [ 0   B   D   0  ]
+				// [ 0   0   q   qn ]
+				// [ 0   0   -1  0  ]
+				//
+				// A = 2 * near / (right - left)
+				// B = 2 * near / (top - bottom)
+				// C = (right + left) / (right - left)
+				// D = (top + bottom) / (top - bottom)
+				// q = - (far + near) / (far - near)
+				// qn = - 2 * (far * near) / (far - near)
+
+				mProjMatrix = Matrix4::ZERO;
+				mProjMatrix[0][0] = A;
+				mProjMatrix[0][2] = C;
+				mProjMatrix[1][1] = B;
+				mProjMatrix[1][2] = D;
+				mProjMatrix[2][2] = q;
+				mProjMatrix[2][3] = qn;
+				mProjMatrix[3][2] = -1;
+
+				if (mObliqueDepthProjection)
+				{
+					// Translate the plane into view space
+
+					// Don't use getViewMatrix here, incase overrided by 
+					// camera and return a cull frustum view matrix
+					updateView();
+					Plane plane = mViewMatrix * mObliqueProjPlane;
+
+					// Thanks to Eric Lenyel for posting this calculation 
+					// at www.terathon.com
+
+					// Calculate the clip-space corner point opposite the 
+					// clipping plane
+					// as (sgn(clipPlane.x), sgn(clipPlane.y), 1, 1) and
+					// transform it into camera space by multiplying it
+					// by the inverse of the projection matrix
+
+					/* generalised version
+					Vector4 q = matrix.inverse() * 
+					Vector4(Math::Sign(plane.normal.x), 
+					Math::Sign(plane.normal.y), 1.0f, 1.0f);
+					*/
+					Vector4 q;
+					q.x = (Math::Sign(plane.normal.x) + mProjMatrix[0][2]) / mProjMatrix[0][0];
+					q.y = (Math::Sign(plane.normal.y) + mProjMatrix[1][2]) / mProjMatrix[1][1];
+					q.z = -1;
+					q.w = (1 + mProjMatrix[2][2]) / mProjMatrix[2][3];
+
+					// Calculate the scaled plane vector
+					Vector4 clipPlane4d(plane.normal.x, plane.normal.y, plane.normal.z, plane.d);
+					Vector4 c = clipPlane4d * (2 / (clipPlane4d.dotProduct(q)));
+
+					// Replace the third row of the projection matrix
+					mProjMatrix[2][0] = c.x;
+					mProjMatrix[2][1] = c.y;
+					mProjMatrix[2][2] = c.z + 1;
+					mProjMatrix[2][3] = c.w; 
+				}
+			} // perspective
+			else if (mProjType == PT_ORTHOGRAPHIC)
+			{
+				Real A = 2 * inv_w;
+				Real B = 2 * inv_h;
+				Real C = - (right + left) * inv_w;
+				Real D = - (top + bottom) * inv_h;
+				Real q, qn;
+				if (mFarDist == 0)
+				{
+					// Can not do infinite far plane here, avoid divided zero only
+					q = - Frustum::INFINITE_FAR_PLANE_ADJUST / mNearDist;
+					qn = - Frustum::INFINITE_FAR_PLANE_ADJUST - 1;
+				}
+				else
+				{
+					q = - 2 * inv_d;
+					qn = - (mFarDist + mNearDist)  * inv_d;
+				}
+
+				// NB: This creates 'uniform' orthographic projection matrix,
+				// which depth range [-1,1], right-handed rules
+				//
+				// [ A   0   0   C  ]
+				// [ 0   B   0   D  ]
+				// [ 0   0   q   qn ]
+				// [ 0   0   0   1  ]
+				//
+				// A = 2 * / (right - left)
+				// B = 2 * / (top - bottom)
+				// C = - (right + left) / (right - left)
+				// D = - (top + bottom) / (top - bottom)
+				// q = - 2 / (far - near)
+				// qn = - (far + near) / (far - near)
+
+				mProjMatrix = Matrix4::ZERO;
+				mProjMatrix[0][0] = A;
+				mProjMatrix[0][3] = C;
+				mProjMatrix[1][1] = B;
+				mProjMatrix[1][3] = D;
+				mProjMatrix[2][2] = q;
+				mProjMatrix[2][3] = qn;
+				mProjMatrix[3][3] = 1;
+			} // ortho
+		} // !mCustomProjMatrix
+
+		RenderSystem* renderSystem = Root::getSingleton().getRenderSystem();
+		// API specific
+		renderSystem->_convertProjectionMatrix(mProjMatrix, mProjMatrixRS);
+		// API specific for Gpu Programs
+		renderSystem->_convertProjectionMatrix(mProjMatrix, mProjMatrixRSDepth, true);
+
+
+		// Calculate bounding box (local)
+		// Box is from 0, down -Z, max dimensions as determined from far plane
+		// If infinite view frustum just pick a far value
+		Real farDist = (mFarDist == 0) ? 100000 : mFarDist;
+		// Near plane bounds
+		Vector3 min(left, bottom, -farDist);
+		Vector3 max(right, top, 0);
+
+		if (mCustomProjMatrix)
+		{
+			// Some custom projection matrices can have unusual inverted settings
+			// So make sure the AABB is the right way around to start with
+			Vector3 tmp = min;
+			min.makeFloor(max);
+			max.makeCeil(tmp);
+		}
+
+		if (mProjType == PT_PERSPECTIVE)
+		{
+			// Merge with far plane bounds
+			Real radio = farDist / mNearDist;
+			min.makeFloor(Vector3(left * radio, bottom * radio, -farDist));
+			max.makeCeil(Vector3(right * radio, top * radio, 0));
+		}
+		mBoundingBox.setExtents(min, max);
+
+		mRecalcFrustum = false;
+
+		// Signal to update frustum clipping planes
+		mRecalcFrustumPlanes = true;
+	}
+    //-----------------------------------------------------------------------
+    void Frustum::updateFrustum(void) const
+    {
+        if (isFrustumOutOfDate())
+        {
+			updateFrustumImpl();
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    void Frustum::updateVertexData(void) const
+    {
+        if (mRecalcVertexData)
+        {
+            if (mVertexData.vertexBufferBinding->getBufferCount() <= 0)
+            {
+                // Initialise vertex & index data
+                mVertexData.vertexDeclaration->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+                mVertexData.vertexCount = 32;
+                mVertexData.vertexStart = 0;
+                mVertexData.vertexBufferBinding->setBinding( 0,
+                    HardwareBufferManager::getSingleton().createVertexBuffer(
+                        sizeof(float)*3, 32, HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY) );
+            }
+
+            // Note: Even though we can dealing with general projection matrix here,
+            //       but because it's incompatibly with infinite far plane, thus, we
+            //       still need to working with projection parameters.
+
+            // Calc near plane corners
+            Real vpLeft, vpRight, vpBottom, vpTop;
+            calcProjectionParameters(vpLeft, vpRight, vpBottom, vpTop);
+
+            // Treat infinite fardist as some arbitrary far value
+            Real farDist = (mFarDist == 0) ? 100000 : mFarDist;
+
+            // Calc far palne corners
+            Real radio = mProjType == PT_PERSPECTIVE ? farDist / mNearDist : 1;
+            Real farLeft = vpLeft * radio;
+            Real farRight = vpRight * radio;
+            Real farBottom = vpBottom * radio;
+            Real farTop = vpTop * radio;
+
+            // Calculate vertex positions (local)
+            // 0 is the origin
+            // 1, 2, 3, 4 are the points on the near plane, top left first, clockwise
+            // 5, 6, 7, 8 are the points on the far plane, top left first, clockwise
+            HardwareVertexBufferSharedPtr vbuf = mVertexData.vertexBufferBinding->getBuffer(0);
+            float* pFloat = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD));
+
+            // near plane (remember frustum is going in -Z direction)
+            *pFloat++ = vpLeft;  *pFloat++ = vpTop;    *pFloat++ = -mNearDist;
+            *pFloat++ = vpRight; *pFloat++ = vpTop;    *pFloat++ = -mNearDist;
+
+            *pFloat++ = vpRight; *pFloat++ = vpTop;    *pFloat++ = -mNearDist;
+            *pFloat++ = vpRight; *pFloat++ = vpBottom; *pFloat++ = -mNearDist;
+
+            *pFloat++ = vpRight; *pFloat++ = vpBottom; *pFloat++ = -mNearDist;
+            *pFloat++ = vpLeft;  *pFloat++ = vpBottom; *pFloat++ = -mNearDist;
+
+            *pFloat++ = vpLeft;  *pFloat++ = vpBottom; *pFloat++ = -mNearDist;
+            *pFloat++ = vpLeft;  *pFloat++ = vpTop;    *pFloat++ = -mNearDist;
+
+            // far plane (remember frustum is going in -Z direction)
+            *pFloat++ = farLeft;  *pFloat++ = farTop;    *pFloat++ = -farDist;
+            *pFloat++ = farRight; *pFloat++ = farTop;    *pFloat++ = -farDist;
+
+            *pFloat++ = farRight; *pFloat++ = farTop;    *pFloat++ = -farDist;
+            *pFloat++ = farRight; *pFloat++ = farBottom; *pFloat++ = -farDist;
+
+            *pFloat++ = farRight; *pFloat++ = farBottom; *pFloat++ = -farDist;
+            *pFloat++ = farLeft;  *pFloat++ = farBottom; *pFloat++ = -farDist;
+
+            *pFloat++ = farLeft;  *pFloat++ = farBottom; *pFloat++ = -farDist;
+            *pFloat++ = farLeft;  *pFloat++ = farTop;    *pFloat++ = -farDist;
+
+            // Sides of the pyramid
+            *pFloat++ = 0.0f;    *pFloat++ = 0.0f;   *pFloat++ = 0.0f;
+            *pFloat++ = vpLeft;  *pFloat++ = vpTop;  *pFloat++ = -mNearDist;
+
+            *pFloat++ = 0.0f;    *pFloat++ = 0.0f;   *pFloat++ = 0.0f;
+            *pFloat++ = vpRight; *pFloat++ = vpTop;    *pFloat++ = -mNearDist;
+
+            *pFloat++ = 0.0f;    *pFloat++ = 0.0f;   *pFloat++ = 0.0f;
+            *pFloat++ = vpRight; *pFloat++ = vpBottom; *pFloat++ = -mNearDist;
+
+            *pFloat++ = 0.0f;    *pFloat++ = 0.0f;   *pFloat++ = 0.0f;
+            *pFloat++ = vpLeft;  *pFloat++ = vpBottom; *pFloat++ = -mNearDist;
+
+            // Sides of the box
+
+            *pFloat++ = vpLeft;  *pFloat++ = vpTop;  *pFloat++ = -mNearDist;
+            *pFloat++ = farLeft;  *pFloat++ = farTop;  *pFloat++ = -farDist;
+
+            *pFloat++ = vpRight; *pFloat++ = vpTop;    *pFloat++ = -mNearDist;
+            *pFloat++ = farRight; *pFloat++ = farTop;    *pFloat++ = -farDist;
+
+            *pFloat++ = vpRight; *pFloat++ = vpBottom; *pFloat++ = -mNearDist;
+            *pFloat++ = farRight; *pFloat++ = farBottom; *pFloat++ = -farDist;
+
+            *pFloat++ = vpLeft;  *pFloat++ = vpBottom; *pFloat++ = -mNearDist;
+            *pFloat++ = farLeft;  *pFloat++ = farBottom; *pFloat++ = -farDist;
+
+
+            vbuf->unlock();
+
+            mRecalcVertexData = false;
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    bool Frustum::isViewOutOfDate(void) const
+    {
+        // Attached to node?
+        if (mParentNode)
+        {
+            if (mRecalcView ||
+                mParentNode->_getDerivedOrientation() != mLastParentOrientation ||
+                mParentNode->_getDerivedPosition() != mLastParentPosition)
+            {
+                // Ok, we're out of date with SceneNode we're attached to
+                mLastParentOrientation = mParentNode->_getDerivedOrientation();
+                mLastParentPosition = mParentNode->_getDerivedPosition();
+                mRecalcView = true;
+            }
+        }
+        // Deriving reflection from linked plane?
+        if (mLinkedReflectPlane && 
+            !(mLastLinkedReflectionPlane == mLinkedReflectPlane->_getDerivedPlane()))
+        {
+            mReflectPlane = mLinkedReflectPlane->_getDerivedPlane();
+            mReflectMatrix = Math::buildReflectionMatrix(mReflectPlane);
+            mLastLinkedReflectionPlane = mLinkedReflectPlane->_getDerivedPlane();
+            mRecalcView = true;
+        }
+
+        return mRecalcView;
+    }
+
+    //-----------------------------------------------------------------------
+    bool Frustum::isFrustumOutOfDate(void) const
+    {
+        // Deriving custom near plane from linked plane?
+        if (mObliqueDepthProjection)
+        {
+            // Out of date when view out of data since plane needs to be in view space
+            if (isViewOutOfDate())
+            {
+                mRecalcFrustum = true;
+            }
+            // Update derived plane
+            if (mLinkedObliqueProjPlane && 
+                !(mLastLinkedObliqueProjPlane == mLinkedObliqueProjPlane->_getDerivedPlane()))
+            {
+                mObliqueProjPlane = mLinkedObliqueProjPlane->_getDerivedPlane();
+                mLastLinkedObliqueProjPlane = mObliqueProjPlane;
+                mRecalcFrustum = true;
+            }
+        }
+
+        return mRecalcFrustum;
+    }
+
+    //-----------------------------------------------------------------------
+	void Frustum::updateViewImpl(void) const
+	{
+		// ----------------------
+		// Update the view matrix
+		// ----------------------
+
+		// View matrix is:
+		//
+		//  [ Lx  Uy  Dz  Tx  ]
+		//  [ Lx  Uy  Dz  Ty  ]
+		//  [ Lx  Uy  Dz  Tz  ]
+		//  [ 0   0   0   1   ]
+		//
+		// Where T = -(Transposed(Rot) * Pos)
+
+		// This is most efficiently done using 3x3 Matrices
+
+		// Get orientation from quaternion
+
+		if (!mCustomViewMatrix)
+		{
+			Matrix3 rot;
+			const Quaternion& orientation = getOrientationForViewUpdate();
+			const Vector3& position = getPositionForViewUpdate();
+			orientation.ToRotationMatrix(rot);
+
+			// Make the translation relative to new axes
+			Matrix3 rotT = rot.Transpose();
+			Vector3 trans = -rotT * position;
+
+			// Make final matrix
+			mViewMatrix = Matrix4::IDENTITY;
+			mViewMatrix = rotT; // fills upper 3x3
+			mViewMatrix[0][3] = trans.x;
+			mViewMatrix[1][3] = trans.y;
+			mViewMatrix[2][3] = trans.z;
+
+			// Deal with reflections
+			if (mReflect)
+			{
+				mViewMatrix = mViewMatrix * mReflectMatrix;
+			}
+		}
+
+		mRecalcView = false;
+
+		// Signal to update frustum clipping planes
+		mRecalcFrustumPlanes = true;
+		// Signal to update world space corners
+		mRecalcWorldSpaceCorners = true;
+		// Signal to update frustum if oblique plane enabled,
+		// since plane needs to be in view space
+		if (mObliqueDepthProjection)
+		{
+			mRecalcFrustum = true;
+		}
+	}
+	//-----------------------------------------------------------------------
+    void Frustum::updateView(void) const
+    {
+        if (isViewOutOfDate())
+        {
+			updateViewImpl();
+        }
+    }
+
+	//-----------------------------------------------------------------------
+	void Frustum::updateFrustumPlanesImpl(void) const
+	{
+		// -------------------------
+		// Update the frustum planes
+		// -------------------------
+		Matrix4 combo = mProjMatrix * mViewMatrix;
+
+		mFrustumPlanes[FRUSTUM_PLANE_LEFT].normal.x = combo[3][0] + combo[0][0];
+		mFrustumPlanes[FRUSTUM_PLANE_LEFT].normal.y = combo[3][1] + combo[0][1];
+		mFrustumPlanes[FRUSTUM_PLANE_LEFT].normal.z = combo[3][2] + combo[0][2];
+		mFrustumPlanes[FRUSTUM_PLANE_LEFT].d = combo[3][3] + combo[0][3];
+
+		mFrustumPlanes[FRUSTUM_PLANE_RIGHT].normal.x = combo[3][0] - combo[0][0];
+		mFrustumPlanes[FRUSTUM_PLANE_RIGHT].normal.y = combo[3][1] - combo[0][1];
+		mFrustumPlanes[FRUSTUM_PLANE_RIGHT].normal.z = combo[3][2] - combo[0][2];
+		mFrustumPlanes[FRUSTUM_PLANE_RIGHT].d = combo[3][3] - combo[0][3];
+
+		mFrustumPlanes[FRUSTUM_PLANE_TOP].normal.x = combo[3][0] - combo[1][0];
+		mFrustumPlanes[FRUSTUM_PLANE_TOP].normal.y = combo[3][1] - combo[1][1];
+		mFrustumPlanes[FRUSTUM_PLANE_TOP].normal.z = combo[3][2] - combo[1][2];
+		mFrustumPlanes[FRUSTUM_PLANE_TOP].d = combo[3][3] - combo[1][3];
+
+		mFrustumPlanes[FRUSTUM_PLANE_BOTTOM].normal.x = combo[3][0] + combo[1][0];
+		mFrustumPlanes[FRUSTUM_PLANE_BOTTOM].normal.y = combo[3][1] + combo[1][1];
+		mFrustumPlanes[FRUSTUM_PLANE_BOTTOM].normal.z = combo[3][2] + combo[1][2];
+		mFrustumPlanes[FRUSTUM_PLANE_BOTTOM].d = combo[3][3] + combo[1][3];
+
+		mFrustumPlanes[FRUSTUM_PLANE_NEAR].normal.x = combo[3][0] + combo[2][0];
+		mFrustumPlanes[FRUSTUM_PLANE_NEAR].normal.y = combo[3][1] + combo[2][1];
+		mFrustumPlanes[FRUSTUM_PLANE_NEAR].normal.z = combo[3][2] + combo[2][2];
+		mFrustumPlanes[FRUSTUM_PLANE_NEAR].d = combo[3][3] + combo[2][3];
+
+		mFrustumPlanes[FRUSTUM_PLANE_FAR].normal.x = combo[3][0] - combo[2][0];
+		mFrustumPlanes[FRUSTUM_PLANE_FAR].normal.y = combo[3][1] - combo[2][1];
+		mFrustumPlanes[FRUSTUM_PLANE_FAR].normal.z = combo[3][2] - combo[2][2];
+		mFrustumPlanes[FRUSTUM_PLANE_FAR].d = combo[3][3] - combo[2][3];
+
+		// Renormalise any normals which were not unit length
+		for(int i=0; i<6; i++ ) 
+		{
+			float length = mFrustumPlanes[i].normal.normalise();
+			mFrustumPlanes[i].d /= length;
+		}
+
+		mRecalcFrustumPlanes = false;
+	}
+    //-----------------------------------------------------------------------
+    void Frustum::updateFrustumPlanes(void) const
+    {
+        updateView();
+        updateFrustum();
+
+        if (mRecalcFrustumPlanes)
+        {
+			updateFrustumPlanesImpl();
+        }
+    }
+	//-----------------------------------------------------------------------
+	void Frustum::updateWorldSpaceCornersImpl(void) const
+	{
+		Matrix4 eyeToWorld = mViewMatrix.inverseAffine();
+
+		// Note: Even though we can dealing with general projection matrix here,
+		//       but because it's incompatibly with infinite far plane, thus, we
+		//       still need to working with projection parameters.
+
+		// Calc near plane corners
+		Real nearLeft, nearRight, nearBottom, nearTop;
+		calcProjectionParameters(nearLeft, nearRight, nearBottom, nearTop);
+
+		// Treat infinite fardist as some arbitrary far value
+		Real farDist = (mFarDist == 0) ? 100000 : mFarDist;
+
+		// Calc far palne corners
+		Real radio = mProjType == PT_PERSPECTIVE ? farDist / mNearDist : 1;
+		Real farLeft = nearLeft * radio;
+		Real farRight = nearRight * radio;
+		Real farBottom = nearBottom * radio;
+		Real farTop = nearTop * radio;
+
+		// near
+		mWorldSpaceCorners[0] = eyeToWorld.transformAffine(Vector3(nearRight, nearTop,    -mNearDist));
+		mWorldSpaceCorners[1] = eyeToWorld.transformAffine(Vector3(nearLeft,  nearTop,    -mNearDist));
+		mWorldSpaceCorners[2] = eyeToWorld.transformAffine(Vector3(nearLeft,  nearBottom, -mNearDist));
+		mWorldSpaceCorners[3] = eyeToWorld.transformAffine(Vector3(nearRight, nearBottom, -mNearDist));
+		// far
+		mWorldSpaceCorners[4] = eyeToWorld.transformAffine(Vector3(farRight,  farTop,     -farDist));
+		mWorldSpaceCorners[5] = eyeToWorld.transformAffine(Vector3(farLeft,   farTop,     -farDist));
+		mWorldSpaceCorners[6] = eyeToWorld.transformAffine(Vector3(farLeft,   farBottom,  -farDist));
+		mWorldSpaceCorners[7] = eyeToWorld.transformAffine(Vector3(farRight,  farBottom,  -farDist));
+
+
+		mRecalcWorldSpaceCorners = false;
+	}
+    //-----------------------------------------------------------------------
+    void Frustum::updateWorldSpaceCorners(void) const
+    {
+        updateView();
+
+        if (mRecalcWorldSpaceCorners)
+        {
+			updateWorldSpaceCornersImpl();
+        }
+
+    }
+
+    //-----------------------------------------------------------------------
+    Real Frustum::getAspectRatio(void) const
+    {
+        return mAspect;
+    }
+
+    //-----------------------------------------------------------------------
+    void Frustum::setAspectRatio(Real r)
+    {
+        mAspect = r;
+        invalidateFrustum();
+    }
+
+    //-----------------------------------------------------------------------
+    const AxisAlignedBox& Frustum::getBoundingBox(void) const
+    {
+        return mBoundingBox;
+    }
+    //-----------------------------------------------------------------------
+    void Frustum::_updateRenderQueue(RenderQueue* queue)
+    {
+        // Add self 
+        queue->addRenderable(this);
+    }
+    //-----------------------------------------------------------------------
+    const String& Frustum::getMovableType(void) const
+    {
+        return msMovableType;
+    }
+    //-----------------------------------------------------------------------
+	Real Frustum::getBoundingRadius(void) const
+	{
+        return (mFarDist == 0)? 100000 : mFarDist;
+	}
+    //-----------------------------------------------------------------------
+    const MaterialPtr& Frustum::getMaterial(void) const
+    {
+        return mMaterial;
+    }
+    //-----------------------------------------------------------------------
+    void Frustum::getRenderOperation(RenderOperation& op) 
+    {
+        updateVertexData();
+        op.operationType = RenderOperation::OT_LINE_LIST;
+        op.useIndexes = false;
+        op.vertexData = &mVertexData;
+    }
+    //-----------------------------------------------------------------------
+    void Frustum::getWorldTransforms(Matrix4* xform) const 
+    {
+        if (mParentNode)
+            *xform = mParentNode->_getFullTransform();
+        else
+            *xform = Matrix4::IDENTITY;
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& Frustum::getWorldOrientation(void) const 
+    {
+        if (mParentNode)
+            return mParentNode->_getDerivedOrientation();
+        else
+            return Quaternion::IDENTITY;
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& Frustum::getWorldPosition(void) const 
+    {
+        if (mParentNode)
+            return mParentNode->_getDerivedPosition();
+        else
+            return Vector3::ZERO;
+    }
+    //-----------------------------------------------------------------------
+    Real Frustum::getSquaredViewDepth(const Camera* cam) const 
+    {
+        // Calc from centre
+        if (mParentNode)
+            return (cam->getDerivedPosition() 
+                - mParentNode->_getDerivedPosition()).squaredLength();
+        else
+            return 0;
+    }
+    //-----------------------------------------------------------------------
+    const LightList& Frustum::getLights(void) const 
+    {
+        // N/A
+        static LightList ll;
+        return ll;
+    }
+    //-----------------------------------------------------------------------
+    void Frustum::_notifyCurrentCamera(Camera* cam)
+    {
+        // Make sure bounding box up-to-date
+        updateFrustum();
+
+        MovableObject::_notifyCurrentCamera(cam);
+    }
+
+    // -------------------------------------------------------------------
+    void Frustum::invalidateFrustum() const
+    {
+        mRecalcFrustum = true;
+        mRecalcFrustumPlanes = true;
+        mRecalcWorldSpaceCorners = true;
+        mRecalcVertexData = true;
+    }
+    // -------------------------------------------------------------------
+    void Frustum::invalidateView() const
+    {
+        mRecalcView = true;
+        mRecalcFrustumPlanes = true;
+        mRecalcWorldSpaceCorners = true;
+    }
+    // -------------------------------------------------------------------
+    const Vector3* Frustum::getWorldSpaceCorners(void) const
+    {
+        updateWorldSpaceCorners();
+
+        return mWorldSpaceCorners;
+    }
+    //-----------------------------------------------------------------------
+    void Frustum::setProjectionType(ProjectionType pt)
+    {
+        mProjType = pt;
+        invalidateFrustum();
+    }
+
+    //-----------------------------------------------------------------------
+    ProjectionType Frustum::getProjectionType(void) const
+    {
+        return mProjType;
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& Frustum::getPositionForViewUpdate(void) const
+    {
+        return mLastParentPosition;
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& Frustum::getOrientationForViewUpdate(void) const
+    {
+        return mLastParentOrientation;
+    }
+    //-----------------------------------------------------------------------
+    void Frustum::enableReflection(const Plane& p)
+    {
+        mReflect = true;
+        mReflectPlane = p;
+        mLinkedReflectPlane = 0;
+        mReflectMatrix = Math::buildReflectionMatrix(p);
+        invalidateView();
+
+    }
+    //-----------------------------------------------------------------------
+    void Frustum::enableReflection(const MovablePlane* p)
+    {
+        mReflect = true;
+        mLinkedReflectPlane = p;
+        mReflectPlane = mLinkedReflectPlane->_getDerivedPlane();
+        mReflectMatrix = Math::buildReflectionMatrix(mReflectPlane);
+        mLastLinkedReflectionPlane = mLinkedReflectPlane->_getDerivedPlane();
+        invalidateView();
+    }
+    //-----------------------------------------------------------------------
+    void Frustum::disableReflection(void)
+    {
+        mReflect = false;
+        mLinkedReflectPlane = 0;
+        mLastLinkedReflectionPlane.normal = Vector3::ZERO;
+        invalidateView();
+    }
+    //---------------------------------------------------------------------
+    bool Frustum::projectSphere(const Sphere& sphere, 
+        Real* left, Real* top, Real* right, Real* bottom) const
+    {
+		// See http://www.gamasutra.com/features/20021011/lengyel_06.htm
+        // Transform light position into camera space
+
+        updateView();
+        Vector3 eyeSpacePos = mViewMatrix.transformAffine(sphere.getCenter());
+
+		// initialise
+		*left = *bottom = -1.0f;
+		*right = *top = 1.0f;
+
+        if (eyeSpacePos.z < 0)
+        {
+			updateFrustum();
+			const Matrix4& projMatrix = getProjectionMatrix();
+            Real r = sphere.getRadius();
+			Real rsq = r * r;
+
+            // early-exit
+            if (eyeSpacePos.squaredLength() <= rsq)
+                return false;
+
+			Real Lxz = Math::Sqr(eyeSpacePos.x) + Math::Sqr(eyeSpacePos.z);
+			Real Lyz = Math::Sqr(eyeSpacePos.y) + Math::Sqr(eyeSpacePos.z);
+
+			// Find the tangent planes to the sphere
+			// XZ first
+			// calculate quadratic discriminant: b*b - 4ac
+			// x = Nx
+			// a = Lx^2 + Lz^2
+			// b = -2rLx
+			// c = r^2 - Lz^2
+			Real a = Lxz;
+			Real b = -2.0 * r * eyeSpacePos.x;
+			Real c = rsq - Math::Sqr(eyeSpacePos.z);
+			Real D = b*b - 4*a*c;
+
+			// two roots?
+			if (D > 0)
+			{
+				Real sqrootD = Math::Sqrt(D);
+				// solve the quadratic to get the components of the normal
+				Real Nx0 = (-b + sqrootD) / (2 * a);
+				Real Nx1 = (-b - sqrootD) / (2 * a);
+				
+				// Derive Z from this
+				Real Nz0 = (r - Nx0 * eyeSpacePos.x) / eyeSpacePos.z;
+				Real Nz1 = (r - Nx1 * eyeSpacePos.x) / eyeSpacePos.z;
+
+				// Get the point of tangency
+				// Only consider points of tangency in front of the camera
+				Real Pz0 = (Lxz - rsq) / (eyeSpacePos.z - ((Nz0 / Nx0) * eyeSpacePos.x));
+				if (Pz0 < 0)
+				{
+					// Project point onto near plane in worldspace
+					Real nearx0 = (Nz0 * mNearDist) / Nx0;
+					// now we need to map this to viewport coords
+					// use projection matrix since that will take into account all factors
+					Vector3 relx0 = projMatrix * Vector3(nearx0, 0, -mNearDist);
+
+					// find out whether this is a left side or right side
+					Real Px0 = -(Pz0 * Nz0) / Nx0;
+					if (Px0 > eyeSpacePos.x)
+					{
+						*right = std::min(*right, relx0.x);
+					}
+					else
+					{
+						*left = std::max(*left, relx0.x);
+					}
+				}
+				Real Pz1 = (Lxz - rsq) / (eyeSpacePos.z - ((Nz1 / Nx1) * eyeSpacePos.x));
+				if (Pz1 < 0)
+				{
+					// Project point onto near plane in worldspace
+					Real nearx1 = (Nz1 * mNearDist) / Nx1;
+					// now we need to map this to viewport coords
+					// use projection matrix since that will take into account all factors
+					Vector3 relx1 = projMatrix * Vector3(nearx1, 0, -mNearDist);
+
+					// find out whether this is a left side or right side
+					Real Px1 = -(Pz1 * Nz1) / Nx1;
+					if (Px1 > eyeSpacePos.x)
+					{
+						*right = std::min(*right, relx1.x);
+					}
+					else
+					{
+						*left = std::max(*left, relx1.x);
+					}
+				}
+			}
+
+
+			// Now YZ 
+			// calculate quadratic discriminant: b*b - 4ac
+			// x = Ny
+			// a = Ly^2 + Lz^2
+			// b = -2rLy
+			// c = r^2 - Lz^2
+			a = Lyz;
+			b = -2.0 * r * eyeSpacePos.y;
+			c = rsq - Math::Sqr(eyeSpacePos.z);
+			D = b*b - 4*a*c;
+
+			// two roots?
+			if (D > 0)
+			{
+				Real sqrootD = Math::Sqrt(D);
+				// solve the quadratic to get the components of the normal
+				Real Ny0 = (-b + sqrootD) / (2 * a);
+				Real Ny1 = (-b - sqrootD) / (2 * a);
+
+				// Derive Z from this
+				Real Nz0 = (r - Ny0 * eyeSpacePos.y) / eyeSpacePos.z;
+				Real Nz1 = (r - Ny1 * eyeSpacePos.y) / eyeSpacePos.z;
+
+				// Get the point of tangency
+				// Only consider points of tangency in front of the camera
+				Real Pz0 = (Lyz - rsq) / (eyeSpacePos.z - ((Nz0 / Ny0) * eyeSpacePos.y));
+				if (Pz0 < 0)
+				{
+					// Project point onto near plane in worldspace
+					Real neary0 = (Nz0 * mNearDist) / Ny0;
+					// now we need to map this to viewport coords
+					// use projection matriy since that will take into account all factors
+					Vector3 rely0 = projMatrix * Vector3(0, neary0, -mNearDist);
+
+					// find out whether this is a top side or bottom side
+					Real Py0 = -(Pz0 * Nz0) / Ny0;
+					if (Py0 > eyeSpacePos.y)
+					{
+						*top = std::min(*top, rely0.y);
+					}
+					else
+					{
+						*bottom = std::max(*bottom, rely0.y);
+					}
+				}
+				Real Pz1 = (Lyz - rsq) / (eyeSpacePos.z - ((Nz1 / Ny1) * eyeSpacePos.y));
+				if (Pz1 < 0)
+				{
+					// Project point onto near plane in worldspace
+					Real neary1 = (Nz1 * mNearDist) / Ny1;
+					// now we need to map this to viewport coords
+					// use projection matriy since that will take into account all factors
+					Vector3 rely1 = projMatrix * Vector3(0, neary1, -mNearDist);
+
+					// find out whether this is a top side or bottom side
+					Real Py1 = -(Pz1 * Nz1) / Ny1;
+					if (Py1 > eyeSpacePos.y)
+					{
+						*top = std::min(*top, rely1.y);
+					}
+					else
+					{
+						*bottom = std::max(*bottom, rely1.y);
+					}
+				}
+			}
+        }
+
+        return (*left != -1.0f) || (*top != 1.0f) || (*right != 1.0f) || (*bottom != -1.0f);
+
+    }
+    //---------------------------------------------------------------------
+    void Frustum::enableCustomNearClipPlane(const MovablePlane* plane)
+    {
+        mObliqueDepthProjection = true;
+        mLinkedObliqueProjPlane = plane;
+        mObliqueProjPlane = plane->_getDerivedPlane();
+        invalidateFrustum();
+    }
+    //---------------------------------------------------------------------
+    void Frustum::enableCustomNearClipPlane(const Plane& plane)
+    {
+        mObliqueDepthProjection = true;
+        mLinkedObliqueProjPlane = 0;
+        mObliqueProjPlane = plane;
+        invalidateFrustum();
+    }
+    //---------------------------------------------------------------------
+    void Frustum::disableCustomNearClipPlane(void)
+    {
+        mObliqueDepthProjection = false;
+        mLinkedObliqueProjPlane = 0;
+        invalidateFrustum();
+    }
+    //---------------------------------------------------------------------
+	void Frustum::setCustomViewMatrix(bool enable, const Matrix4& viewMatrix)
+	{
+		mCustomViewMatrix = enable;
+		if (enable)
+		{
+            assert(viewMatrix.isAffine());
+			mViewMatrix = viewMatrix;
+		}
+		invalidateView();
+	}
+    //---------------------------------------------------------------------
+	void Frustum::setCustomProjectionMatrix(bool enable, const Matrix4& projMatrix)
+	{
+		mCustomProjMatrix = enable;
+		if (enable)
+		{
+			mProjMatrix = projMatrix;
+		}
+		invalidateFrustum();
+	}
+
+
+
+} // namespace Ogre
Index: /OgreMain/src/OgreGpuProgram.cpp
===================================================================
--- /OgreMain/src/OgreGpuProgram.cpp	(revision 5)
+++ /OgreMain/src/OgreGpuProgram.cpp	(revision 5)
@@ -0,0 +1,1968 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreGpuProgram.h"
+#include "OgreHighLevelGpuProgram.h"
+#include "OgreGpuProgramManager.h"
+#include "OgreVector3.h"
+#include "OgreVector4.h"
+#include "OgreAutoParamDataSource.h"
+#include "OgreLight.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreRenderSystemCapabilities.h"
+#include "OgreStringConverter.h"
+#include "OgreLogManager.h"
+
+namespace Ogre
+{
+    //-----------------------------------------------------------------------------
+    GpuProgram::CmdType GpuProgram::msTypeCmd;
+    GpuProgram::CmdSyntax GpuProgram::msSyntaxCmd;
+    GpuProgram::CmdSkeletal GpuProgram::msSkeletalCmd;
+	GpuProgram::CmdMorph GpuProgram::msMorphCmd;
+	GpuProgram::CmdPose GpuProgram::msPoseCmd;
+	GpuProgram::CmdVTF GpuProgram::msVTFCmd;
+
+
+    GpuProgramParameters::AutoConstantDefinition GpuProgramParameters::AutoConstantDictionary[] = {
+        AutoConstantDefinition(ACT_WORLD_MATRIX,                  "world_matrix",                16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_INVERSE_WORLD_MATRIX,          "inverse_world_matrix",        16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_TRANSPOSE_WORLD_MATRIX,             "transpose_world_matrix",            16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_INVERSE_TRANSPOSE_WORLD_MATRIX, "inverse_transpose_world_matrix", 16, ET_REAL, ACDT_NONE),
+
+        AutoConstantDefinition(ACT_WORLD_MATRIX_ARRAY_3x4,        "world_matrix_array_3x4",      12, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_WORLD_MATRIX_ARRAY,            "world_matrix_array",          16, ET_REAL, ACDT_NONE),
+
+        AutoConstantDefinition(ACT_VIEW_MATRIX,                   "view_matrix",                 16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_INVERSE_VIEW_MATRIX,           "inverse_view_matrix",         16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_TRANSPOSE_VIEW_MATRIX,              "transpose_view_matrix",             16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_INVERSE_TRANSPOSE_VIEW_MATRIX,       "inverse_transpose_view_matrix",     16, ET_REAL, ACDT_NONE),
+
+        AutoConstantDefinition(ACT_PROJECTION_MATRIX,             "projection_matrix",           16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_INVERSE_PROJECTION_MATRIX,          "inverse_projection_matrix",         16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_TRANSPOSE_PROJECTION_MATRIX,        "transpose_projection_matrix",       16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_INVERSE_TRANSPOSE_PROJECTION_MATRIX, "inverse_transpose_projection_matrix", 16, ET_REAL, ACDT_NONE),
+
+        AutoConstantDefinition(ACT_VIEWPROJ_MATRIX,               "viewproj_matrix",             16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_INVERSE_VIEWPROJ_MATRIX,       "inverse_viewproj_matrix",     16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_TRANSPOSE_VIEWPROJ_MATRIX,          "transpose_viewproj_matrix",         16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_INVERSE_TRANSPOSE_VIEWPROJ_MATRIX,   "inverse_transpose_viewproj_matrix", 16, ET_REAL, ACDT_NONE),
+
+        AutoConstantDefinition(ACT_WORLDVIEW_MATRIX,              "worldview_matrix",            16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_INVERSE_WORLDVIEW_MATRIX,      "inverse_worldview_matrix",    16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_TRANSPOSE_WORLDVIEW_MATRIX,         "transpose_worldview_matrix",        16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_INVERSE_TRANSPOSE_WORLDVIEW_MATRIX, "inverse_transpose_worldview_matrix", 16, ET_REAL, ACDT_NONE),
+
+        AutoConstantDefinition(ACT_WORLDVIEWPROJ_MATRIX,          "worldviewproj_matrix",        16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_INVERSE_WORLDVIEWPROJ_MATRIX,       "inverse_worldviewproj_matrix",      16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_TRANSPOSE_WORLDVIEWPROJ_MATRIX,     "transpose_worldviewproj_matrix",    16, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_INVERSE_TRANSPOSE_WORLDVIEWPROJ_MATRIX, "inverse_transpose_worldviewproj_matrix", 16, ET_REAL, ACDT_NONE),
+
+        AutoConstantDefinition(ACT_RENDER_TARGET_FLIPPING,          "render_target_flipping",         1, ET_REAL, ACDT_NONE),
+
+        AutoConstantDefinition(ACT_FOG_COLOUR,                    "fog_colour",                   4, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_FOG_PARAMS,                    "fog_params",                   4, ET_REAL, ACDT_NONE),
+
+        AutoConstantDefinition(ACT_SURFACE_AMBIENT_COLOUR,          "surface_ambient_colour",           4, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_SURFACE_DIFFUSE_COLOUR,          "surface_diffuse_colour",           4, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_SURFACE_SPECULAR_COLOUR,         "surface_specular_colour",          4, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_SURFACE_EMISSIVE_COLOUR,         "surface_emissive_colour",          4, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_SURFACE_SHININESS,               "surface_shininess",                1, ET_REAL, ACDT_NONE),
+
+        AutoConstantDefinition(ACT_AMBIENT_LIGHT_COLOUR,          "ambient_light_colour",         4, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_LIGHT_DIFFUSE_COLOUR,          "light_diffuse_colour",         4, ET_REAL, ACDT_INT),
+        AutoConstantDefinition(ACT_LIGHT_SPECULAR_COLOUR,         "light_specular_colour",        4, ET_REAL, ACDT_INT),
+        AutoConstantDefinition(ACT_LIGHT_ATTENUATION,             "light_attenuation",            4, ET_REAL, ACDT_INT),
+		AutoConstantDefinition(ACT_SPOTLIGHT_PARAMS,              "spotlight_params",             4, ET_REAL, ACDT_INT),
+        AutoConstantDefinition(ACT_LIGHT_POSITION,                "light_position",               4, ET_REAL, ACDT_INT),
+        AutoConstantDefinition(ACT_LIGHT_POSITION_OBJECT_SPACE,   "light_position_object_space",  4, ET_REAL, ACDT_INT),
+		AutoConstantDefinition(ACT_LIGHT_POSITION_VIEW_SPACE,          "light_position_view_space",    4, ET_REAL, ACDT_INT),
+        AutoConstantDefinition(ACT_LIGHT_DIRECTION,               "light_direction",              4, ET_REAL, ACDT_INT),
+        AutoConstantDefinition(ACT_LIGHT_DIRECTION_OBJECT_SPACE,  "light_direction_object_space", 4, ET_REAL, ACDT_INT),
+		AutoConstantDefinition(ACT_LIGHT_DIRECTION_VIEW_SPACE,         "light_direction_view_space",   4, ET_REAL, ACDT_INT),
+		AutoConstantDefinition(ACT_LIGHT_DISTANCE_OBJECT_SPACE,   "light_distance_object_space",  1, ET_REAL, ACDT_INT),
+        AutoConstantDefinition(ACT_LIGHT_POWER_SCALE,   		  "light_power",  1, ET_REAL, ACDT_INT),
+		AutoConstantDefinition(ACT_LIGHT_DIFFUSE_COLOUR_ARRAY,          "light_diffuse_colour_array",         4, ET_REAL, ACDT_INT),
+		AutoConstantDefinition(ACT_LIGHT_SPECULAR_COLOUR_ARRAY,         "light_specular_colour_array",        4, ET_REAL, ACDT_INT),
+		AutoConstantDefinition(ACT_LIGHT_ATTENUATION_ARRAY,             "light_attenuation_array",            4, ET_REAL, ACDT_INT),
+		AutoConstantDefinition(ACT_LIGHT_POSITION_ARRAY,                "light_position_array",               4, ET_REAL, ACDT_INT),
+		AutoConstantDefinition(ACT_LIGHT_POSITION_OBJECT_SPACE_ARRAY,   "light_position_object_space_array",  4, ET_REAL, ACDT_INT),
+		AutoConstantDefinition(ACT_LIGHT_POSITION_VIEW_SPACE_ARRAY,          "light_position_view_space_array",    4, ET_REAL, ACDT_INT),
+		AutoConstantDefinition(ACT_LIGHT_DIRECTION_ARRAY,               "light_direction_array",              4, ET_REAL, ACDT_INT),
+		AutoConstantDefinition(ACT_LIGHT_DIRECTION_OBJECT_SPACE_ARRAY,  "light_direction_object_space_array", 4, ET_REAL, ACDT_INT),
+		AutoConstantDefinition(ACT_LIGHT_DIRECTION_VIEW_SPACE_ARRAY,         "light_direction_view_space_array",   4, ET_REAL, ACDT_INT),
+		AutoConstantDefinition(ACT_LIGHT_DISTANCE_OBJECT_SPACE_ARRAY,   "light_distance_object_space_array",  1, ET_REAL, ACDT_INT),
+		AutoConstantDefinition(ACT_LIGHT_POWER_SCALE_ARRAY,   		  "light_power_array",  1, ET_REAL, ACDT_INT),
+		AutoConstantDefinition(ACT_SPOTLIGHT_PARAMS_ARRAY,              "spotlight_params_array",             4, ET_REAL, ACDT_INT),
+
+        AutoConstantDefinition(ACT_DERIVED_AMBIENT_LIGHT_COLOUR,    "derived_ambient_light_colour",     4, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_DERIVED_SCENE_COLOUR,            "derived_scene_colour",             4, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_DERIVED_LIGHT_DIFFUSE_COLOUR,    "derived_light_diffuse_colour",     4, ET_REAL, ACDT_INT),
+        AutoConstantDefinition(ACT_DERIVED_LIGHT_SPECULAR_COLOUR,   "derived_light_specular_colour",    4, ET_REAL, ACDT_INT),
+        AutoConstantDefinition(ACT_DERIVED_LIGHT_DIFFUSE_COLOUR_ARRAY,  "derived_light_diffuse_colour_array",   4, ET_REAL, ACDT_INT),
+        AutoConstantDefinition(ACT_DERIVED_LIGHT_SPECULAR_COLOUR_ARRAY, "derived_light_specular_colour_array",  4, ET_REAL, ACDT_INT),
+
+        AutoConstantDefinition(ACT_SHADOW_EXTRUSION_DISTANCE,     "shadow_extrusion_distance",    1, ET_REAL, ACDT_INT),
+        AutoConstantDefinition(ACT_CAMERA_POSITION,               "camera_position",              3, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_CAMERA_POSITION_OBJECT_SPACE,  "camera_position_object_space", 3, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_TEXTURE_VIEWPROJ_MATRIX,       "texture_viewproj_matrix",     16, ET_REAL, ACDT_INT),
+        AutoConstantDefinition(ACT_CUSTOM,                        "custom",                       4, ET_REAL, ACDT_INT),  // *** needs to be tested
+        AutoConstantDefinition(ACT_TIME,                               "time",                               1, ET_REAL, ACDT_REAL),
+        AutoConstantDefinition(ACT_TIME_0_X,                      "time_0_x",                     4, ET_REAL, ACDT_REAL),
+        AutoConstantDefinition(ACT_COSTIME_0_X,                   "costime_0_x",                  4, ET_REAL, ACDT_REAL),
+        AutoConstantDefinition(ACT_SINTIME_0_X,                   "sintime_0_x",                  4, ET_REAL, ACDT_REAL),
+        AutoConstantDefinition(ACT_TANTIME_0_X,                   "tantime_0_x",                  4, ET_REAL, ACDT_REAL),
+        AutoConstantDefinition(ACT_TIME_0_X_PACKED,               "time_0_x_packed",              4, ET_REAL, ACDT_REAL),
+        AutoConstantDefinition(ACT_TIME_0_1,                      "time_0_1",                     4, ET_REAL, ACDT_REAL),
+        AutoConstantDefinition(ACT_COSTIME_0_1,                   "costime_0_1",                  4, ET_REAL, ACDT_REAL),
+        AutoConstantDefinition(ACT_SINTIME_0_1,                   "sintime_0_1",                  4, ET_REAL, ACDT_REAL),
+        AutoConstantDefinition(ACT_TANTIME_0_1,                   "tantime_0_1",                  4, ET_REAL, ACDT_REAL),
+        AutoConstantDefinition(ACT_TIME_0_1_PACKED,               "time_0_1_packed",              4, ET_REAL, ACDT_REAL),
+        AutoConstantDefinition(ACT_TIME_0_2PI,                    "time_0_2pi",                   4, ET_REAL, ACDT_REAL),
+        AutoConstantDefinition(ACT_COSTIME_0_2PI,                 "costime_0_2pi",                4, ET_REAL, ACDT_REAL),
+        AutoConstantDefinition(ACT_SINTIME_0_2PI,                 "sintime_0_2pi",                4, ET_REAL, ACDT_REAL),
+        AutoConstantDefinition(ACT_TANTIME_0_2PI,                 "tantime_0_2pi",                4, ET_REAL, ACDT_REAL),
+        AutoConstantDefinition(ACT_TIME_0_2PI_PACKED,             "time_0_2pi_packed",            4, ET_REAL, ACDT_REAL),
+        AutoConstantDefinition(ACT_FRAME_TIME,                    "frame_time",                   1, ET_REAL, ACDT_REAL),
+        AutoConstantDefinition(ACT_FPS,                           "fps",                          1, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_VIEWPORT_WIDTH,                "viewport_width",               1, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_VIEWPORT_HEIGHT,               "viewport_height",              1, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_INVERSE_VIEWPORT_WIDTH,        "inverse_viewport_width",       1, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_INVERSE_VIEWPORT_HEIGHT,       "inverse_viewport_height",      1, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_VIEWPORT_SIZE,                 "viewport_size",                4, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_VIEW_DIRECTION,                "view_direction",               3, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_VIEW_SIDE_VECTOR,              "view_side_vector",             3, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_VIEW_UP_VECTOR,                "view_up_vector",               3, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_FOV,                           "fov",                          1, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_NEAR_CLIP_DISTANCE,            "near_clip_distance",           1, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_FAR_CLIP_DISTANCE,             "far_clip_distance",            1, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_PASS_NUMBER,                        "pass_number",                        1, ET_REAL, ACDT_NONE),
+        AutoConstantDefinition(ACT_PASS_ITERATION_NUMBER,              "pass_iteration_number",              1, ET_REAL, ACDT_NONE),
+		AutoConstantDefinition(ACT_ANIMATION_PARAMETRIC,               "animation_parametric",               4, ET_REAL, ACDT_INT),
+		AutoConstantDefinition(ACT_TEXEL_OFFSETS,               "texel_offsets",				  4, ET_REAL, ACDT_NONE),
+		AutoConstantDefinition(ACT_SCENE_DEPTH_RANGE,           "scene_depth_range",			  4, ET_REAL, ACDT_NONE),
+		AutoConstantDefinition(ACT_SHADOW_SCENE_DEPTH_RANGE,    "shadow_scene_depth_range",		  4, ET_REAL, ACDT_INT),
+        AutoConstantDefinition(ACT_TEXTURE_SIZE,                "texture_size",                   4, ET_REAL, ACDT_INT),
+        AutoConstantDefinition(ACT_INVERSE_TEXTURE_SIZE,        "inverse_texture_size",           4, ET_REAL, ACDT_INT),
+        AutoConstantDefinition(ACT_PACKED_TEXTURE_SIZE,         "packed_texture_size",            4, ET_REAL, ACDT_INT),
+    };
+
+	//---------------------------------------------------------------------
+	void GpuNamedConstants::generateConstantDefinitionArrayEntries(
+		const String& paramName, const GpuConstantDefinition& baseDef)
+	{
+		// Copy definition for use with arrays
+		GpuConstantDefinition arrayDef = baseDef;
+		arrayDef.arraySize = 1;
+		String arrayName;
+
+		// Add parameters for array accessors
+		// [0] will refer to the same location, [1+] will increment
+		// only populate others individually up to 16 array slots so as not to get out of hand
+
+		// paramName[0] version will always exist 
+		size_t maxArrayIndex = 1;
+		if (baseDef.arraySize <= 16)
+			maxArrayIndex = baseDef.arraySize;
+
+		for (size_t i = 0; i < maxArrayIndex; i++)
+		{
+			arrayName = paramName + "[" + StringConverter::toString(i) + "]";
+			map.insert(GpuConstantDefinitionMap::value_type(arrayName, arrayDef));
+			// increment location
+			arrayDef.physicalIndex += arrayDef.elementSize;
+		}
+		// note no increment of buffer sizes since this is shared with main array def
+
+	}
+    
+
+    //-----------------------------------------------------------------------------
+    GpuProgram::GpuProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
+        const String& group, bool isManual, ManualResourceLoader* loader) 
+        :Resource(creator, name, handle, group, isManual, loader),
+        mType(GPT_VERTEX_PROGRAM), mLoadFromFile(true), mSkeletalAnimation(false),
+        mVertexTextureFetch(false), mPassSurfaceAndLightStates(false), mCompileError(false)
+    {
+    }
+    //-----------------------------------------------------------------------------
+    void GpuProgram::setType(GpuProgramType t)
+    {
+        mType = t;
+    }
+    //-----------------------------------------------------------------------------
+    void GpuProgram::setSyntaxCode(const String& syntax)
+    {
+        mSyntaxCode = syntax;
+    }
+    //-----------------------------------------------------------------------------
+    void GpuProgram::setSourceFile(const String& filename)
+    {
+        mFilename = filename;
+        mSource.clear();
+        mLoadFromFile = true;
+		mCompileError = false;
+    }
+    //-----------------------------------------------------------------------------
+    void GpuProgram::setSource(const String& source)
+    {
+        mSource = source;
+        mFilename.clear();
+        mLoadFromFile = false;
+		mCompileError = false;
+    }
+
+    //-----------------------------------------------------------------------------
+    void GpuProgram::loadImpl(void)
+    {
+        if (mLoadFromFile)
+        {
+            // find & load source code
+            DataStreamPtr stream = 
+                ResourceGroupManager::getSingleton().openResource(
+					mFilename, mGroup, true, this);
+            mSource = stream->getAsString();
+        }
+
+        // Call polymorphic load
+		try 
+		{
+			loadFromSource();
+		}
+		catch (const Exception&)
+		{
+			// will already have been logged
+			StringUtil::StrStreamType str;
+			str << "Gpu program " << mName << " encountered an error "
+				<< "during loading and is thus not supported.";
+			LogManager::getSingleton().logMessage(str.str());
+
+			mCompileError = true;
+		}
+
+    }
+    //-----------------------------------------------------------------------------
+    bool GpuProgram::isRequiredCapabilitiesSupported(void) const
+    {
+		const RenderSystemCapabilities* caps = 
+			Root::getSingleton().getRenderSystem()->getCapabilities();
+
+        // If skeletal animation is being done, we need support for UBYTE4
+        if (isSkeletalAnimationIncluded() && 
+            !caps->hasCapability(RSC_VERTEX_FORMAT_UBYTE4))
+        {
+            return false;
+        }
+
+		// Vertex texture fetch required?
+		if (isVertexTextureFetchRequired() && 
+			!caps->hasCapability(RSC_VERTEX_TEXTURE_FETCH))
+		{
+			return false;
+		}
+
+        return true;
+    }
+    //-----------------------------------------------------------------------------
+    bool GpuProgram::isSupported(void) const
+    {
+        if (mCompileError || !isRequiredCapabilitiesSupported())
+            return false;
+
+        return GpuProgramManager::getSingleton().isSyntaxSupported(mSyntaxCode);
+    }
+    //-----------------------------------------------------------------------------
+    GpuProgramParametersSharedPtr GpuProgram::createParameters(void)
+    {
+        // Default implementation simply returns standard parameters.
+        GpuProgramParametersSharedPtr ret = 
+            GpuProgramManager::getSingleton().createParameters();
+		// link shared logical / physical map for low-level use
+		ret->_setLogicalIndexes(&mFloatLogicalToPhysical, &mIntLogicalToPhysical);
+
+        // Copy in default parameters if present
+        if (!mDefaultParams.isNull())
+            ret->copyConstantsFrom(*(mDefaultParams.get()));
+        
+        return ret;
+    }
+    //-----------------------------------------------------------------------------
+    GpuProgramParametersSharedPtr GpuProgram::getDefaultParameters(void)
+    {
+        if (mDefaultParams.isNull())
+        {
+            mDefaultParams = createParameters();
+        }
+        return mDefaultParams;
+    }
+    //-----------------------------------------------------------------------------
+    void GpuProgram::setupBaseParamDictionary(void)
+    {
+        ParamDictionary* dict = getParamDictionary();
+
+        dict->addParameter(
+            ParameterDef("type", "'vertex_program' or 'fragment_program'",
+                PT_STRING), &msTypeCmd);
+        dict->addParameter(
+            ParameterDef("syntax", "Syntax code, e.g. vs_1_1", PT_STRING), &msSyntaxCmd);
+        dict->addParameter(
+            ParameterDef("includes_skeletal_animation", 
+            "Whether this vertex program includes skeletal animation", PT_BOOL), 
+            &msSkeletalCmd);
+		dict->addParameter(
+			ParameterDef("includes_morph_animation", 
+			"Whether this vertex program includes morph animation", PT_BOOL), 
+			&msMorphCmd);
+		dict->addParameter(
+			ParameterDef("includes_pose_animation", 
+			"The number of poses this vertex program supports for pose animation", PT_INT), 
+			&msPoseCmd);
+		dict->addParameter(
+			ParameterDef("uses_vertex_texture_fetch", 
+			"Whether this vertex program requires vertex texture fetch support.", PT_BOOL), 
+			&msVTFCmd);
+    }
+
+    //-----------------------------------------------------------------------
+    const String& GpuProgram::getLanguage(void) const
+    {
+        static const String language = "asm";
+
+        return language;
+    }
+
+
+
+    //-----------------------------------------------------------------------------
+    //      GpuProgramParameters Methods
+    //-----------------------------------------------------------------------------
+	GpuProgramParameters::GpuProgramParameters() :
+		mFloatLogicalToPhysical(0)
+		, mIntLogicalToPhysical(0)
+		, mNamedConstants(0)
+		, mTransposeMatrices(false)
+		, mIgnoreMissingParams(false)
+		, mActivePassIterationIndex(std::numeric_limits<size_t>::max())	
+    {
+    }
+    //-----------------------------------------------------------------------------
+
+    GpuProgramParameters::GpuProgramParameters(const GpuProgramParameters& oth)
+    {
+        *this = oth;
+    }
+
+    //-----------------------------------------------------------------------------
+    GpuProgramParameters& GpuProgramParameters::operator=(const GpuProgramParameters& oth)
+    {
+        // let compiler perform shallow copies of structures 
+        // AutoConstantEntry, RealConstantEntry, IntConstantEntry
+        mFloatConstants = oth.mFloatConstants;
+        mIntConstants  = oth.mIntConstants;
+        mAutoConstants = oth.mAutoConstants;
+		mFloatLogicalToPhysical = oth.mFloatLogicalToPhysical;
+		mIntLogicalToPhysical = oth.mIntLogicalToPhysical;
+		mNamedConstants = oth.mNamedConstants;
+
+        mTransposeMatrices = oth.mTransposeMatrices;
+        mIgnoreMissingParams  = oth.mIgnoreMissingParams;
+		mActivePassIterationIndex = oth.mActivePassIterationIndex;
+
+		return *this;
+    }
+	//---------------------------------------------------------------------
+	void GpuProgramParameters::_setNamedConstants(
+		const GpuNamedConstants* namedConstants)
+	{
+		mNamedConstants = namedConstants;
+
+		// Determine any extension to local buffers
+
+		// Size and reset buffer (fill with zero to make comparison later ok)
+		if (namedConstants->floatBufferSize > mFloatConstants.size())
+		{
+			mFloatConstants.insert(mFloatConstants.end(), 
+				namedConstants->floatBufferSize - mFloatConstants.size(), 0.0f);
+		}
+		if (namedConstants->intBufferSize > mIntConstants.size())
+		{
+			mIntConstants.insert(mIntConstants.end(), 
+				namedConstants->intBufferSize - mIntConstants.size(), 0);
+		}
+	}
+	//---------------------------------------------------------------------
+	void GpuProgramParameters::_setLogicalIndexes(
+		GpuLogicalBufferStruct* floatIndexMap, 
+		GpuLogicalBufferStruct* intIndexMap)
+	{
+		mFloatLogicalToPhysical = floatIndexMap;
+		mIntLogicalToPhysical = intIndexMap;
+
+		// resize the internal buffers
+		// Note that these will only contain something after the first parameter
+		// set has set some parameters
+
+		// Size and reset buffer (fill with zero to make comparison later ok)
+		if (floatIndexMap->bufferSize > mFloatConstants.size())
+		{
+			mFloatConstants.insert(mFloatConstants.end(), 
+				floatIndexMap->bufferSize - mFloatConstants.size(), 0.0f);
+		}
+		if (intIndexMap->bufferSize > mIntConstants.size())
+		{
+			mIntConstants.insert(mIntConstants.end(), 
+				intIndexMap->bufferSize - mIntConstants.size(), 0);
+		}
+
+	}
+	//---------------------------------------------------------------------()
+    void GpuProgramParameters::setConstant(size_t index, const Vector4& vec)
+    {
+        setConstant(index, vec.ptr(), 1);
+    }
+	//-----------------------------------------------------------------------------
+	void GpuProgramParameters::setConstant(size_t index, Real val)
+	{
+		setConstant(index, Vector4(val, 0.0f, 0.0f, 0.0f));
+	}
+    //-----------------------------------------------------------------------------
+    void GpuProgramParameters::setConstant(size_t index, const Vector3& vec)
+    {
+        setConstant(index, Vector4(vec.x, vec.y, vec.z, 1.0f));
+    }
+    //-----------------------------------------------------------------------------
+    void GpuProgramParameters::setConstant(size_t index, const Matrix4& m)
+    {
+        // set as 4x 4-element floats
+        if (mTransposeMatrices)
+        {
+            Matrix4 t = m.transpose();
+            GpuProgramParameters::setConstant(index, t[0], 4);
+        }
+        else
+        {
+            GpuProgramParameters::setConstant(index, m[0], 4);
+        }
+
+    }
+    //-----------------------------------------------------------------------------
+    void GpuProgramParameters::setConstant(size_t index, const Matrix4* pMatrix, 
+        size_t numEntries)
+    {
+        if (mTransposeMatrices)
+        {
+            for (size_t i = 0; i < numEntries; ++i)
+            {
+                Matrix4 t = pMatrix[i].transpose();
+                GpuProgramParameters::setConstant(index, t[0], 4);
+                index += 4;
+            }
+        }
+        else
+        {
+            GpuProgramParameters::setConstant(index, pMatrix[0][0], 4 * numEntries);
+        }
+
+    }
+    //-----------------------------------------------------------------------------
+    void GpuProgramParameters::setConstant(size_t index, const ColourValue& colour)
+    {
+        setConstant(index, colour.ptr(), 1);
+    }
+    //-----------------------------------------------------------------------------
+    void GpuProgramParameters::setConstant(size_t index, const float *val, size_t count)
+    {
+		// Raw buffer size is 4x count
+		size_t rawCount = count * 4;
+		// get physical index
+		assert(mFloatLogicalToPhysical && "GpuProgram hasn't set up the logical -> physical map!");
+
+		size_t physicalIndex = _getFloatConstantPhysicalIndex(index, rawCount);
+
+        // Copy 
+		_writeRawConstants(physicalIndex, val, rawCount);
+
+    }
+    //-----------------------------------------------------------------------------
+    void GpuProgramParameters::setConstant(size_t index, const double *val, size_t count)
+    {
+		// Raw buffer size is 4x count
+		size_t rawCount = count * 4;
+		// get physical index
+		assert(mFloatLogicalToPhysical && "GpuProgram hasn't set up the logical -> physical map!");
+
+		size_t physicalIndex = _getFloatConstantPhysicalIndex(index, rawCount);
+		assert(physicalIndex + rawCount <= mFloatConstants.size());
+		// Copy manually since cast required
+		for (size_t i = 0; i < rawCount; ++i)
+		{
+			mFloatConstants[physicalIndex + i] = 
+				static_cast<float>(val[i]);
+		}
+
+    }
+    //-----------------------------------------------------------------------------
+    void GpuProgramParameters::setConstant(size_t index, const int *val, size_t count)
+    {
+		// Raw buffer size is 4x count
+		size_t rawCount = count * 4;
+		// get physical index
+		assert(mIntLogicalToPhysical && "GpuProgram hasn't set up the logical -> physical map!");
+
+		size_t physicalIndex = _getIntConstantPhysicalIndex(index, rawCount);
+		// Copy 
+		_writeRawConstants(physicalIndex, val, rawCount);
+    }
+	//-----------------------------------------------------------------------------
+	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, const Vector4& vec,
+		size_t count)
+	{
+		// remember, raw content access uses raw float count rather than float4
+		// write either the number requested (for packed types) or up to 4
+		_writeRawConstants(physicalIndex, vec.ptr(), std::min(count, (size_t)4));
+	}
+	//-----------------------------------------------------------------------------
+	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, Real val)
+	{
+		_writeRawConstants(physicalIndex, &val, 1);
+	}
+	//-----------------------------------------------------------------------------
+	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, int val)
+	{
+		_writeRawConstants(physicalIndex, &val, 1);
+	}
+	//-----------------------------------------------------------------------------
+	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, const Vector3& vec)
+	{
+		_writeRawConstants(physicalIndex, vec.ptr(), 3);		
+	}
+	//-----------------------------------------------------------------------------
+	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, const Matrix4& m)
+	{
+
+		// remember, raw content access uses raw float count rather than float4
+		if (mTransposeMatrices)
+		{
+			Matrix4 t = m.transpose();
+			_writeRawConstants(physicalIndex, t[0], 16);
+		}
+		else
+		{
+			_writeRawConstants(physicalIndex, m[0], 16);
+		}
+
+	}
+	//-----------------------------------------------------------------------------
+	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, const Matrix4* pMatrix, size_t numEntries)
+	{
+		// remember, raw content access uses raw float count rather than float4
+		if (mTransposeMatrices)
+		{
+			for (size_t i = 0; i < numEntries; ++i)
+			{
+				Matrix4 t = pMatrix[i].transpose();
+				_writeRawConstants(physicalIndex, t[0], 16);
+				physicalIndex += 16;
+			}
+		}
+		else
+		{
+			_writeRawConstants(physicalIndex, pMatrix[0][0], 16 * numEntries);
+		}
+
+
+	}
+	//-----------------------------------------------------------------------------
+	void GpuProgramParameters::_writeRawConstant(size_t physicalIndex, 
+		const ColourValue& colour, size_t count)
+	{
+		// write either the number requested (for packed types) or up to 4
+		_writeRawConstants(physicalIndex, colour.ptr(), std::min(count, (size_t)4));
+	}
+	//-----------------------------------------------------------------------------
+	void GpuProgramParameters::_writeRawConstants(size_t physicalIndex, const double* val, size_t count)
+	{
+		assert(physicalIndex + count <= mFloatConstants.size());
+		for (size_t i = 0; i < count; ++i)
+		{
+			mFloatConstants[physicalIndex+i] = static_cast<float>(val[i]);
+		}
+	}
+	//-----------------------------------------------------------------------------
+	void GpuProgramParameters::_writeRawConstants(size_t physicalIndex, const float* val, size_t count)
+	{
+		assert(physicalIndex + count <= mFloatConstants.size());
+		memcpy(&mFloatConstants[physicalIndex], val, sizeof(float) * count);
+	}
+	//-----------------------------------------------------------------------------
+	void GpuProgramParameters::_writeRawConstants(size_t physicalIndex, const int* val, size_t count)
+	{
+		assert(physicalIndex + count <= mIntConstants.size());
+		memcpy(&mIntConstants[physicalIndex], val, sizeof(int) * count);
+	}
+	//-----------------------------------------------------------------------------
+	void GpuProgramParameters::_readRawConstants(size_t physicalIndex, size_t count, float* dest)
+	{
+		assert(physicalIndex + count <= mFloatConstants.size());
+		memcpy(dest, &mFloatConstants[physicalIndex], sizeof(float) * count);
+	}
+	//-----------------------------------------------------------------------------
+	void GpuProgramParameters::_readRawConstants(size_t physicalIndex, size_t count, int* dest)
+	{
+		assert(physicalIndex + count <= mIntConstants.size());
+		memcpy(dest, &mIntConstants[physicalIndex], sizeof(int) * count);
+	}
+	//-----------------------------------------------------------------------------
+	size_t GpuProgramParameters::_getFloatConstantPhysicalIndex(
+		size_t logicalIndex, size_t requestedSize) 
+	{
+		if (!mFloatLogicalToPhysical)
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"This is not a low-level parameter parameter object",
+				"GpuProgramParameters::_getFloatConstantPhysicalIndex");
+
+		size_t physicalIndex;
+		OGRE_LOCK_MUTEX(mFloatLogicalToPhysical->mutex)
+
+		GpuLogicalIndexUseMap::iterator logi = mFloatLogicalToPhysical->map.find(logicalIndex);
+		if (logi == mFloatLogicalToPhysical->map.end())
+		{
+			if (requestedSize)
+			{
+				physicalIndex = mFloatConstants.size();
+
+                // Expand at buffer end
+                mFloatConstants.insert(mFloatConstants.end(), requestedSize, 0.0f);
+
+				// Record extended size for future GPU params re-using this information
+				mFloatLogicalToPhysical->bufferSize = mFloatConstants.size();
+
+				// low-level programs will not know about mapping ahead of time, so 
+				// populate it. Other params objects will be able to just use this
+				// accepted mapping since the constant structure will be the same
+
+				// Set up a mapping for all items in the count
+				size_t currPhys = physicalIndex;
+				size_t count = requestedSize / 4;
+				for (size_t logicalNum = 0; logicalNum < count; ++logicalNum)
+				{
+					mFloatLogicalToPhysical->map.insert(
+						GpuLogicalIndexUseMap::value_type(
+							logicalIndex + logicalNum, 
+							GpuLogicalIndexUse(currPhys, requestedSize)));
+					currPhys += 4;
+				}
+			}
+			else
+			{
+				// no match & ignore
+				return std::numeric_limits<size_t>::max();
+			}
+
+		}
+		else
+		{
+			physicalIndex = logi->second.physicalIndex;
+			// check size
+			if (logi->second.currentSize < requestedSize)
+			{
+				// init buffer entry wasn't big enough; could be a mistake on the part
+				// of the original use, or perhaps a variable length we can't predict
+				// until first actual runtime use e.g. world matrix array
+				size_t insertCount = requestedSize - logi->second.currentSize;
+				FloatConstantList::iterator insertPos = mFloatConstants.begin();
+				std::advance(insertPos, physicalIndex);
+				mFloatConstants.insert(insertPos, insertCount, 0.0f);
+				// shift all physical positions after this one
+				for (GpuLogicalIndexUseMap::iterator i = mFloatLogicalToPhysical->map.begin();
+					i != mFloatLogicalToPhysical->map.end(); ++i)
+				{
+					if (i->second.physicalIndex > physicalIndex)
+						i->second.physicalIndex += insertCount;
+				}
+				for (AutoConstantList::iterator i = mAutoConstants.begin();
+					i != mAutoConstants.end(); ++i)
+				{
+					if (i->physicalIndex > physicalIndex)
+						i->physicalIndex += insertCount;
+				}
+			}
+		}
+
+		return physicalIndex;
+	}
+	//-----------------------------------------------------------------------------
+	size_t GpuProgramParameters::_getIntConstantPhysicalIndex(
+		size_t logicalIndex, size_t requestedSize)
+	{
+		if (!mIntLogicalToPhysical)
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+			"This is not a low-level parameter parameter object",
+			"GpuProgramParameters::_getIntConstantPhysicalIndex");
+
+		size_t physicalIndex;
+		OGRE_LOCK_MUTEX(mIntLogicalToPhysical->mutex)
+
+			GpuLogicalIndexUseMap::iterator logi = mIntLogicalToPhysical->map.find(logicalIndex);
+		if (logi == mIntLogicalToPhysical->map.end())
+		{
+			if (requestedSize)
+			{
+				physicalIndex = mIntConstants.size();
+
+                // Expand at buffer end
+                mIntConstants.insert(mIntConstants.end(), requestedSize, 0);
+
+				// Record extended size for future GPU params re-using this information
+				mIntLogicalToPhysical->bufferSize = mIntConstants.size();
+
+				// low-level programs will not know about mapping ahead of time, so 
+				// populate it. Other params objects will be able to just use this
+				// accepted mapping since the constant structure will be the same
+
+				// Set up a mapping for all items in the count
+				size_t currPhys = physicalIndex;
+				size_t count = requestedSize / 4;
+				for (size_t logicalNum = 0; logicalNum < count; ++logicalNum)
+				{
+					mIntLogicalToPhysical->map.insert(
+						GpuLogicalIndexUseMap::value_type(
+						logicalIndex + logicalNum, 
+						GpuLogicalIndexUse(currPhys, requestedSize)));
+					currPhys += 4;
+				}
+			}
+			else
+			{
+				// no match
+				return std::numeric_limits<size_t>::max();
+			}
+
+		}
+		else
+		{
+			physicalIndex = logi->second.physicalIndex;
+			// check size
+			if (logi->second.currentSize < requestedSize)
+			{
+				// init buffer entry wasn't big enough; could be a mistake on the part
+				// of the original use, or perhaps a variable length we can't predict
+				// until first actual runtime use e.g. world matrix array
+				size_t insertCount = requestedSize - logi->second.currentSize;
+				IntConstantList::iterator insertPos = mIntConstants.begin();
+				std::advance(insertPos, physicalIndex);
+				mIntConstants.insert(insertPos, insertCount, 0);
+				// shift all physical positions after this one
+				for (GpuLogicalIndexUseMap::iterator i = mIntLogicalToPhysical->map.begin();
+					i != mIntLogicalToPhysical->map.end(); ++i)
+				{
+					if (i->second.physicalIndex > physicalIndex)
+						i->second.physicalIndex += insertCount;
+				}
+				for (AutoConstantList::iterator i = mAutoConstants.begin();
+					i != mAutoConstants.end(); ++i)
+				{
+					if (i->physicalIndex > physicalIndex)
+						i->physicalIndex += insertCount;
+				}
+			}
+		}
+
+		return physicalIndex;
+	}
+	//-----------------------------------------------------------------------------
+	size_t GpuProgramParameters::getFloatLogicalIndexForPhysicalIndex(size_t physicalIndex)
+	{
+		// perhaps build a reverse map of this sometime (shared in GpuProgram)
+		for (GpuLogicalIndexUseMap::iterator i = mFloatLogicalToPhysical->map.begin();
+			i != mFloatLogicalToPhysical->map.end(); ++i)
+		{
+			if (i->second.physicalIndex == physicalIndex)
+				return i->first;
+		}
+		return std::numeric_limits<size_t>::max();
+
+	}
+	//-----------------------------------------------------------------------------
+	size_t GpuProgramParameters::getIntLogicalIndexForPhysicalIndex(size_t physicalIndex)
+	{
+		// perhaps build a reverse map of this sometime (shared in GpuProgram)
+		for (GpuLogicalIndexUseMap::iterator i = mIntLogicalToPhysical->map.begin();
+			i != mIntLogicalToPhysical->map.end(); ++i)
+		{
+			if (i->second.physicalIndex == physicalIndex)
+				return i->first;
+		}
+		return std::numeric_limits<size_t>::max();
+
+	}
+	//-----------------------------------------------------------------------------
+	GpuConstantDefinitionIterator GpuProgramParameters::getConstantDefinitionIterator(void) const
+	{
+		if (!mNamedConstants)
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"This params object is not based on a program with named parameters.",
+				"GpuProgramParameters::getConstantDefinitionIterator");
+
+		return GpuConstantDefinitionIterator(mNamedConstants->map.begin(), 
+			mNamedConstants->map.end());
+
+	}
+	//-----------------------------------------------------------------------------
+	const GpuNamedConstants& GpuProgramParameters::getConstantDefinitions() const
+	{
+		if (!mNamedConstants)
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+			"This params object is not based on a program with named parameters.",
+			"GpuProgramParameters::getConstantDefinitionIterator");
+
+		return *mNamedConstants;
+	}
+	//-----------------------------------------------------------------------------
+	const GpuConstantDefinition& GpuProgramParameters::getConstantDefinition(const String& name) const
+	{
+		if (!mNamedConstants)
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+			"This params object is not based on a program with named parameters.",
+			"GpuProgramParameters::getConstantDefinitionIterator");
+
+
+		// locate, and throw exception if not found
+		const GpuConstantDefinition* def = _findNamedConstantDefinition(name, true);
+
+		return *def;
+
+	}
+	//-----------------------------------------------------------------------------
+	const GpuConstantDefinition* 
+	GpuProgramParameters::_findNamedConstantDefinition(const String& name, 
+		bool throwExceptionIfNotFound) const
+	{
+		if (!mNamedConstants)
+		{
+			if (throwExceptionIfNotFound)
+				OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"Named constants have not been initialised, perhaps a compile error.",
+				"GpuProgramParameters::_findNamedConstantDefinition");
+			return 0;
+		}
+
+		GpuConstantDefinitionMap::const_iterator i = mNamedConstants->map.find(name);
+		if (i == mNamedConstants->map.end())
+		{
+			if (throwExceptionIfNotFound)
+				OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"Parameter called " + name + " does not exist. ",
+				"GpuProgramParameters::_findNamedConstantDefinition");
+			return 0;
+		}
+		else
+		{
+			return &(i->second);
+		}
+	}
+    //-----------------------------------------------------------------------------
+    void GpuProgramParameters::setAutoConstant(size_t index, AutoConstantType acType, size_t extraInfo)
+    {
+		// Get auto constant definition for sizing
+		const AutoConstantDefinition* autoDef = getAutoConstantDefinition(acType);
+		// round up to nearest multiple of 4
+		size_t sz = autoDef->elementCount;
+		if (sz % 4 > 0)
+		{
+			sz += 4 - (sz % 4);
+		}
+
+		size_t physicalIndex = _getFloatConstantPhysicalIndex(index, sz);
+
+		_setRawAutoConstant(physicalIndex, acType, extraInfo);
+    }
+	//-----------------------------------------------------------------------------
+	void GpuProgramParameters::_setRawAutoConstant(size_t physicalIndex, 
+		AutoConstantType acType, size_t extraInfo, size_t elementSize)
+	{
+		// update existing index if it exists
+		bool found = false;
+		for (AutoConstantList::iterator i = mAutoConstants.begin(); 
+			i != mAutoConstants.end(); ++i)
+		{
+			if (i->physicalIndex == physicalIndex)
+			{
+				i->paramType = acType;
+				i->data = extraInfo;
+				i->elementCount = elementSize;
+				found = true;
+				break;
+			}
+		}
+		if (!found)
+			mAutoConstants.push_back(AutoConstantEntry(acType, physicalIndex, extraInfo, elementSize));
+
+	}
+	//-----------------------------------------------------------------------------
+	void GpuProgramParameters::_setRawAutoConstantReal(size_t physicalIndex, 
+		AutoConstantType acType, Real rData, size_t elementSize)
+	{
+		// update existing index if it exists
+		bool found = false;
+		for (AutoConstantList::iterator i = mAutoConstants.begin(); 
+			i != mAutoConstants.end(); ++i)
+		{
+			if (i->physicalIndex == physicalIndex)
+			{
+				i->paramType = acType;
+				i->fData = rData;
+				i->elementCount = elementSize;
+				found = true;
+				break;
+			}
+		}
+		if (!found)
+			mAutoConstants.push_back(AutoConstantEntry(acType, physicalIndex, rData, elementSize));
+
+	}
+	//-----------------------------------------------------------------------------
+	void GpuProgramParameters::clearAutoConstant(size_t index)
+	{
+		size_t physicalIndex = _getFloatConstantPhysicalIndex(index, 0);
+		if (physicalIndex != std::numeric_limits<size_t>::max())
+		{
+			// update existing index if it exists
+			for (AutoConstantList::iterator i = mAutoConstants.begin(); 
+				i != mAutoConstants.end(); ++i)
+			{
+				if (i->physicalIndex == physicalIndex)
+				{
+					mAutoConstants.erase(i);
+					break;
+				}
+			}
+		}
+	}
+	//-----------------------------------------------------------------------------
+	void GpuProgramParameters::clearNamedAutoConstant(const String& name)
+	{
+		const GpuConstantDefinition* def = _findNamedConstantDefinition(name);
+		if (def)
+		{
+			// Autos are always floating point
+			if (def->isFloat())
+			{
+				for (AutoConstantList::iterator i = mAutoConstants.begin(); 
+					i != mAutoConstants.end(); ++i)
+				{
+					if (i->physicalIndex == def->physicalIndex)
+					{
+						mAutoConstants.erase(i);
+						break;
+					}
+				}
+			}
+
+		}
+	}
+    //-----------------------------------------------------------------------------
+    void GpuProgramParameters::clearAutoConstants(void)
+    {
+        mAutoConstants.clear();
+    }
+    //-----------------------------------------------------------------------------
+    GpuProgramParameters::AutoConstantIterator GpuProgramParameters::getAutoConstantIterator(void) const
+    {
+        return AutoConstantIterator(mAutoConstants.begin(), mAutoConstants.end());
+    }
+    //-----------------------------------------------------------------------------
+    void GpuProgramParameters::setAutoConstantReal(size_t index, AutoConstantType acType, Real rData)
+    {
+		// Get auto constant definition for sizing
+		const AutoConstantDefinition* autoDef = getAutoConstantDefinition(acType);
+		// round up to nearest multiple of 4
+		size_t sz = autoDef->elementCount;
+		if (sz % 4 > 0)
+		{
+			sz += 4 - (sz % 4);
+		}
+
+		size_t physicalIndex = _getFloatConstantPhysicalIndex(index, sz);
+
+		_setRawAutoConstantReal(physicalIndex, acType, rData);
+    }
+    //-----------------------------------------------------------------------------
+
+    //-----------------------------------------------------------------------------
+    void GpuProgramParameters::_updateAutoParamsNoLights(const AutoParamDataSource& source)
+    {
+        if (!hasAutoConstants()) return; // abort early if no autos
+        Vector3 vec3;
+        Vector4 vec4;
+        size_t index;
+        size_t numMatrices;
+        const Matrix4* pMatrix;
+        size_t m;
+
+		mActivePassIterationIndex = std::numeric_limits<size_t>::max();
+
+		// Autoconstant index is not a physical index
+        AutoConstantList::const_iterator i, iend;
+        iend = mAutoConstants.end();
+        for (i = mAutoConstants.begin(); i != iend; ++i)
+        {
+            switch(i->paramType)
+            {
+            case ACT_WORLD_MATRIX:
+                _writeRawConstant(i->physicalIndex, source.getWorldMatrix());
+                break;
+            case ACT_INVERSE_WORLD_MATRIX:
+                _writeRawConstant(i->physicalIndex, source.getInverseWorldMatrix());
+                break;
+            case ACT_TRANSPOSE_WORLD_MATRIX:
+               _writeRawConstant(i->physicalIndex, source.getTransposeWorldMatrix());
+               break;
+            case ACT_INVERSE_TRANSPOSE_WORLD_MATRIX:
+               _writeRawConstant(i->physicalIndex, source.getInverseTransposeWorldMatrix());
+               break;
+
+            case ACT_WORLD_MATRIX_ARRAY_3x4:
+                // Loop over matrices
+                pMatrix = source.getWorldMatrixArray();
+                numMatrices = source.getWorldMatrixCount();
+                index = i->physicalIndex;
+                for (m = 0; m < numMatrices; ++m)
+                {
+                    _writeRawConstants(index, (*pMatrix)[0], 12);
+                    index += 12;
+                    ++pMatrix;
+                }
+                
+                break;
+            case ACT_WORLD_MATRIX_ARRAY:
+                _writeRawConstant(i->physicalIndex, source.getWorldMatrixArray(), 
+                    source.getWorldMatrixCount());
+                break;
+            case ACT_VIEW_MATRIX:
+                _writeRawConstant(i->physicalIndex, source.getViewMatrix());
+                break;
+            case ACT_INVERSE_VIEW_MATRIX:
+               _writeRawConstant(i->physicalIndex, source.getInverseViewMatrix());
+               break;
+            case ACT_TRANSPOSE_VIEW_MATRIX:
+               _writeRawConstant(i->physicalIndex, source.getTransposeViewMatrix());
+               break;
+            case ACT_INVERSE_TRANSPOSE_VIEW_MATRIX:
+               _writeRawConstant(i->physicalIndex, source.getInverseTransposeViewMatrix());
+               break;
+
+            case ACT_PROJECTION_MATRIX:
+                _writeRawConstant(i->physicalIndex, source.getProjectionMatrix());
+                break;
+            case ACT_INVERSE_PROJECTION_MATRIX:
+               _writeRawConstant(i->physicalIndex, source.getInverseProjectionMatrix());
+               break;
+            case ACT_TRANSPOSE_PROJECTION_MATRIX:
+               _writeRawConstant(i->physicalIndex, source.getTransposeProjectionMatrix());
+               break;
+            case ACT_INVERSE_TRANSPOSE_PROJECTION_MATRIX:
+               _writeRawConstant(i->physicalIndex, source.getInverseTransposeProjectionMatrix());
+               break;
+
+            case ACT_VIEWPROJ_MATRIX:
+                _writeRawConstant(i->physicalIndex, source.getViewProjectionMatrix());
+                break;
+            case ACT_INVERSE_VIEWPROJ_MATRIX:
+               _writeRawConstant(i->physicalIndex, source.getInverseViewProjMatrix());
+               break;
+            case ACT_TRANSPOSE_VIEWPROJ_MATRIX:
+               _writeRawConstant(i->physicalIndex, source.getTransposeViewProjMatrix());
+               break;
+            case ACT_INVERSE_TRANSPOSE_VIEWPROJ_MATRIX:
+               _writeRawConstant(i->physicalIndex, source.getInverseTransposeViewProjMatrix());
+               break;
+
+            case ACT_WORLDVIEW_MATRIX:
+                _writeRawConstant(i->physicalIndex, source.getWorldViewMatrix());
+                break;
+            case ACT_INVERSE_WORLDVIEW_MATRIX:
+                _writeRawConstant(i->physicalIndex, source.getInverseWorldViewMatrix());
+                break;
+            case ACT_TRANSPOSE_WORLDVIEW_MATRIX:
+               _writeRawConstant(i->physicalIndex, source.getTransposeWorldViewMatrix());
+               break;
+            case ACT_INVERSE_TRANSPOSE_WORLDVIEW_MATRIX:
+               _writeRawConstant(i->physicalIndex, source.getInverseTransposeWorldViewMatrix());
+               break;
+
+            case ACT_WORLDVIEWPROJ_MATRIX:
+                _writeRawConstant(i->physicalIndex, source.getWorldViewProjMatrix());
+                break;
+            case ACT_INVERSE_WORLDVIEWPROJ_MATRIX:
+               _writeRawConstant(i->physicalIndex, source.getInverseWorldViewProjMatrix());
+               break;
+            case ACT_TRANSPOSE_WORLDVIEWPROJ_MATRIX:
+               _writeRawConstant(i->physicalIndex, source.getTransposeWorldViewProjMatrix());
+               break;
+            case ACT_INVERSE_TRANSPOSE_WORLDVIEWPROJ_MATRIX:
+               _writeRawConstant(i->physicalIndex, source.getInverseTransposeWorldViewProjMatrix());
+               break;
+
+            case ACT_RENDER_TARGET_FLIPPING:
+               _writeRawConstant(i->physicalIndex, source.getCurrentRenderTarget()->requiresTextureFlipping() ? -1.f : +1.f);
+               break;
+
+            // NB ambient light still here because it's not related to a specific light
+            case ACT_AMBIENT_LIGHT_COLOUR: 
+                _writeRawConstant(i->physicalIndex, source.getAmbientLightColour(), 
+					i->elementCount);
+                break;
+            case ACT_DERIVED_AMBIENT_LIGHT_COLOUR:
+                _writeRawConstant(i->physicalIndex, source.getDerivedAmbientLightColour(),
+                    i->elementCount);
+                break;
+            case ACT_DERIVED_SCENE_COLOUR:
+                _writeRawConstant(i->physicalIndex, source.getDerivedSceneColour(),
+                    i->elementCount);
+                break;
+
+            case ACT_FOG_COLOUR:
+                _writeRawConstant(i->physicalIndex, source.getFogColour());
+                break;
+            case ACT_FOG_PARAMS:
+                _writeRawConstant(i->physicalIndex, source.getFogParams(), i->elementCount);
+                break;
+
+            case ACT_SURFACE_AMBIENT_COLOUR:
+                _writeRawConstant(i->physicalIndex, source.getSurfaceAmbientColour(),
+                    i->elementCount);
+                break;
+            case ACT_SURFACE_DIFFUSE_COLOUR:
+                _writeRawConstant(i->physicalIndex, source.getSurfaceDiffuseColour(),
+                    i->elementCount);
+                break;
+            case ACT_SURFACE_SPECULAR_COLOUR:
+                _writeRawConstant(i->physicalIndex, source.getSurfaceSpecularColour(),
+                    i->elementCount);
+                break;
+            case ACT_SURFACE_EMISSIVE_COLOUR:
+                _writeRawConstant(i->physicalIndex, source.getSurfaceEmissiveColour(),
+                    i->elementCount);
+                break;
+            case ACT_SURFACE_SHININESS:
+                _writeRawConstant(i->physicalIndex, source.getSurfaceShininess());
+                break;
+
+            case ACT_CAMERA_POSITION:
+                _writeRawConstant(i->physicalIndex, source.getCameraPosition(), i->elementCount);
+                break;
+            case ACT_CAMERA_POSITION_OBJECT_SPACE:
+                _writeRawConstant(i->physicalIndex, source.getCameraPositionObjectSpace(), i->elementCount);
+                break;
+
+            case ACT_TIME:
+               _writeRawConstant(i->physicalIndex, source.getTime() * i->fData);
+               break;
+           case ACT_TIME_0_X:
+               _writeRawConstant(i->physicalIndex, source.getTime_0_X(i->fData));
+               break;
+            case ACT_COSTIME_0_X:
+               _writeRawConstant(i->physicalIndex, source.getCosTime_0_X(i->fData));
+               break;
+            case ACT_SINTIME_0_X:
+               _writeRawConstant(i->physicalIndex, source.getSinTime_0_X(i->fData));
+               break;
+            case ACT_TANTIME_0_X:
+               _writeRawConstant(i->physicalIndex, source.getTanTime_0_X(i->fData));
+               break;
+            case ACT_TIME_0_X_PACKED:
+               _writeRawConstant(i->physicalIndex, source.getTime_0_X_packed(i->fData), i->elementCount);
+               break;
+            case ACT_TIME_0_1:
+               _writeRawConstant(i->physicalIndex, source.getTime_0_1(i->fData));
+               break;
+            case ACT_COSTIME_0_1:
+               _writeRawConstant(i->physicalIndex, source.getCosTime_0_1(i->fData));
+               break;
+            case ACT_SINTIME_0_1:
+               _writeRawConstant(i->physicalIndex, source.getSinTime_0_1(i->fData));
+               break;
+            case ACT_TANTIME_0_1:
+               _writeRawConstant(i->physicalIndex, source.getTanTime_0_1(i->fData));
+               break;
+            case ACT_TIME_0_1_PACKED:
+               _writeRawConstant(i->physicalIndex, source.getTime_0_1_packed(i->fData), i->elementCount);
+               break;
+            case ACT_TIME_0_2PI:
+               _writeRawConstant(i->physicalIndex, source.getTime_0_2Pi(i->fData));
+               break;
+            case ACT_COSTIME_0_2PI:
+               _writeRawConstant(i->physicalIndex, source.getCosTime_0_2Pi(i->fData));
+               break;
+            case ACT_SINTIME_0_2PI:
+               _writeRawConstant(i->physicalIndex, source.getSinTime_0_2Pi(i->fData));
+               break;
+            case ACT_TANTIME_0_2PI:
+               _writeRawConstant(i->physicalIndex, source.getTanTime_0_2Pi(i->fData));
+               break;
+            case ACT_TIME_0_2PI_PACKED:
+               _writeRawConstant(i->physicalIndex, source.getTime_0_2Pi_packed(i->fData), i->elementCount);
+               break;
+            case ACT_FRAME_TIME:
+               _writeRawConstant(i->physicalIndex, source.getFrameTime() * i->fData);
+               break;
+            case ACT_FPS:
+               _writeRawConstant(i->physicalIndex, source.getFPS());
+               break;
+            case ACT_VIEWPORT_WIDTH:
+               _writeRawConstant(i->physicalIndex, source.getViewportWidth());
+               break;
+            case ACT_VIEWPORT_HEIGHT:
+               _writeRawConstant(i->physicalIndex, source.getViewportHeight());
+               break;
+            case ACT_INVERSE_VIEWPORT_WIDTH:
+               _writeRawConstant(i->physicalIndex, source.getInverseViewportWidth());
+               break;
+            case ACT_INVERSE_VIEWPORT_HEIGHT:
+               _writeRawConstant(i->physicalIndex, source.getInverseViewportHeight());
+               break;
+            case ACT_VIEWPORT_SIZE:
+               _writeRawConstant(i->physicalIndex, Vector4(
+                   source.getViewportWidth(),
+                   source.getViewportHeight(),
+                   source.getInverseViewportWidth(),
+                   source.getInverseViewportHeight()), i->elementCount);
+               break;
+			case ACT_TEXEL_OFFSETS:
+				{
+					RenderSystem* rsys = Root::getSingleton().getRenderSystem();
+					_writeRawConstant(i->physicalIndex, Vector4(
+						rsys->getHorizontalTexelOffset(), 
+						rsys->getVerticalTexelOffset(), 
+						rsys->getHorizontalTexelOffset() * source.getInverseViewportWidth(),
+						rsys->getVerticalTexelOffset() * source.getInverseViewportHeight()),
+						i->elementCount);
+				}
+				break;
+            case ACT_TEXTURE_SIZE:
+                _writeRawConstant(i->physicalIndex, source.getTextureSize(i->data), i->elementCount);
+                break;
+            case ACT_INVERSE_TEXTURE_SIZE:
+                _writeRawConstant(i->physicalIndex, source.getInverseTextureSize(i->data), i->elementCount);
+                break;
+            case ACT_PACKED_TEXTURE_SIZE:
+                _writeRawConstant(i->physicalIndex, source.getPackedTextureSize(i->data), i->elementCount);
+                break;
+			case ACT_SCENE_DEPTH_RANGE:
+				_writeRawConstant(i->physicalIndex, source.getSceneDepthRange(), i->elementCount);
+				break;
+            case ACT_VIEW_DIRECTION:
+               _writeRawConstant(i->physicalIndex, source.getViewDirection());
+               break;
+            case ACT_VIEW_SIDE_VECTOR:
+               _writeRawConstant(i->physicalIndex, source.getViewSideVector());
+               break;
+            case ACT_VIEW_UP_VECTOR:
+               _writeRawConstant(i->physicalIndex, source.getViewUpVector());
+               break;
+            case ACT_FOV:
+               _writeRawConstant(i->physicalIndex, source.getFOV());
+               break;
+            case ACT_NEAR_CLIP_DISTANCE:
+               _writeRawConstant(i->physicalIndex, source.getNearClipDistance());
+               break;
+            case ACT_FAR_CLIP_DISTANCE:
+               _writeRawConstant(i->physicalIndex, source.getFarClipDistance());
+               break;
+            case ACT_PASS_NUMBER:
+                _writeRawConstant(i->physicalIndex, (float)source.getPassNumber());
+                break;
+            case ACT_PASS_ITERATION_NUMBER:
+                _writeRawConstant(i->physicalIndex, 0.0f);
+                mActivePassIterationIndex = i->physicalIndex;
+                break;
+            case ACT_CUSTOM:
+			case ACT_ANIMATION_PARAMETRIC:
+                source.getCurrentRenderable()->_updateCustomGpuParameter(*i, this);
+                break;
+            default:
+                break;
+            }
+        }
+    }
+    //-----------------------------------------------------------------------------
+    void GpuProgramParameters::_updateAutoParamsLightsOnly(const AutoParamDataSource& source)
+    {
+        if (!hasAutoConstants()) return; // abort early if no autos
+        Vector3 vec3;
+        Vector4 vec4;
+		Matrix3 m3;
+
+        AutoConstantList::const_iterator i, iend;
+        iend = mAutoConstants.end();
+        for (i = mAutoConstants.begin(); i != iend; ++i)
+        {
+            switch(i->paramType)
+            {
+            case ACT_LIGHT_DIFFUSE_COLOUR:
+                _writeRawConstant(i->physicalIndex, source.getLight(i->data).getDiffuseColour(), i->elementCount);
+                break;
+            case ACT_LIGHT_SPECULAR_COLOUR:
+                _writeRawConstant(i->physicalIndex, source.getLight(i->data).getSpecularColour(), i->elementCount);
+                break;
+            case ACT_LIGHT_POSITION:
+                // Get as 4D vector, works for directional lights too
+				// Use element count in case uniform slot is smaller
+                _writeRawConstant(i->physicalIndex, 
+                    source.getLight(i->data).getAs4DVector(), i->elementCount);
+                break;
+            case ACT_LIGHT_DIRECTION:
+                vec3 = source.getLight(i->data).getDerivedDirection();
+                // Set as 4D vector for compatibility
+				// Use element count in case uniform slot is smaller
+                _writeRawConstant(i->physicalIndex, Vector4(vec3.x, vec3.y, vec3.z, 1.0f), i->elementCount);
+                break;
+            case ACT_LIGHT_POSITION_OBJECT_SPACE:
+                _writeRawConstant(i->physicalIndex, 
+                    source.getInverseWorldMatrix().transformAffine(
+						source.getLight(i->data).getAs4DVector()), 
+					i->elementCount);
+                break;
+            case ACT_LIGHT_DIRECTION_OBJECT_SPACE:
+				// We need the inverse of the inverse transpose 
+				source.getInverseTransposeWorldMatrix().inverse().extract3x3Matrix(m3);
+				vec3 = m3 * source.getLight(i->data).getDerivedDirection();
+				vec3.normalise();
+                // Set as 4D vector for compatibility
+                _writeRawConstant(i->physicalIndex, Vector4(vec3.x, vec3.y, vec3.z, 0.0f), i->elementCount);
+                break;
+			case ACT_LIGHT_POSITION_VIEW_SPACE:
+                _writeRawConstant(i->physicalIndex, 
+                    source.getViewMatrix().transformAffine(source.getLight(i->data).getAs4DVector()), i->elementCount);
+                break;
+            case ACT_LIGHT_DIRECTION_VIEW_SPACE:
+				source.getInverseTransposeViewMatrix().extract3x3Matrix(m3);
+				// inverse transpose in case of scaling
+				vec3 = m3 * source.getLight(i->data).getDerivedDirection();
+                vec3.normalise();
+                // Set as 4D vector for compatibility
+                _writeRawConstant(i->physicalIndex, Vector4(vec3.x, vec3.y, vec3.z, 0.0f),i->elementCount);
+                break;
+            case ACT_LIGHT_DISTANCE_OBJECT_SPACE:
+                vec3 = source.getInverseWorldMatrix().transformAffine(source.getLight(i->data).getDerivedPosition());
+                _writeRawConstant(i->physicalIndex, vec3.length());
+                break;
+            case ACT_SHADOW_EXTRUSION_DISTANCE:
+                _writeRawConstant(i->physicalIndex, source.getShadowExtrusionDistance());
+                break;
+			case ACT_SHADOW_SCENE_DEPTH_RANGE:
+				_writeRawConstant(i->physicalIndex, source.getShadowSceneDepthRange(i->data));
+				break;
+            case ACT_LIGHT_POWER_SCALE:
+				_writeRawConstant(i->physicalIndex, source.getLight(i->data).getPowerScale());
+				break;
+            case ACT_LIGHT_ATTENUATION:
+            {
+                // range, const, linear, quad
+                const Light& l = source.getLight(i->data);
+                vec4.x = l.getAttenuationRange();
+                vec4.y = l.getAttenuationConstant();
+                vec4.z = l.getAttenuationLinear();
+                vec4.w = l.getAttenuationQuadric();
+                _writeRawConstant(i->physicalIndex, vec4, i->elementCount);
+                break;
+            }
+			case ACT_SPOTLIGHT_PARAMS:
+			{
+				// inner, outer, fallof, isSpot
+				const Light& l = source.getLight(i->data);
+				if (l.getType() == Light::LT_SPOTLIGHT)
+				{
+					vec4.x = Math::Cos(l.getSpotlightInnerAngle().valueRadians() * 0.5);
+					vec4.y = Math::Cos(l.getSpotlightOuterAngle().valueRadians() * 0.5);
+					vec4.z = l.getSpotlightFalloff();
+					vec4.w = 1.0f;
+				}
+				else
+				{
+					// Use safe values which result in no change to point & dir light calcs
+					// The spot factor applied to the usual lighting calc is 
+					// pow((dot(spotDir, lightDir) - y) / (x - y), z)
+					// Therefore if we set z to 0.0f then the factor will always be 1
+					// since pow(anything, 0) == 1
+					// However we also need to ensure we don't overflow because of the division
+					// therefore set x = 1 and y = 0 so divisor doesn't change scale
+					vec4.x = 1.0f;
+					vec4.y = 0.0f;
+					vec4.z = 0.0f; // since the main op is pow(.., vec4.z), this will result in 1.0
+					vec4.w = 1.0f;
+				}
+				_writeRawConstant(i->physicalIndex, vec4, i->elementCount);
+				break;
+			}
+			case ACT_LIGHT_DIFFUSE_COLOUR_ARRAY:
+				for (size_t l = 0; l < i->data; ++l)
+					_writeRawConstant(i->physicalIndex + l*i->elementCount, 
+						source.getLight(l).getDiffuseColour(), i->elementCount);
+				break;
+
+			case ACT_LIGHT_SPECULAR_COLOUR_ARRAY:
+				for (size_t l = 0; l < i->data; ++l)
+					_writeRawConstant(i->physicalIndex + l*i->elementCount, 
+						source.getLight(l).getSpecularColour(), i->elementCount);
+				break;
+
+			case ACT_LIGHT_POSITION_ARRAY:
+				// Get as 4D vector, works for directional lights too
+				for (size_t l = 0; l < i->data; ++l)
+					_writeRawConstant(i->physicalIndex + l*i->elementCount, 
+						source.getLight(l).getAs4DVector(), i->elementCount);
+				break;
+
+			case ACT_LIGHT_DIRECTION_ARRAY:
+				for (size_t l = 0; l < i->data; ++l)
+				{
+					vec3 = source.getLight(l).getDerivedDirection();
+					// Set as 4D vector for compatibility
+					_writeRawConstant(i->physicalIndex + l*i->elementCount, 
+						Vector4(vec3.x, vec3.y, vec3.z, 0.0f), i->elementCount);
+				}
+				break;
+
+			case ACT_LIGHT_POSITION_OBJECT_SPACE_ARRAY:
+				for (size_t l = 0; l < i->data; ++l)
+					_writeRawConstant(i->physicalIndex + l*i->elementCount, 
+						source.getInverseWorldMatrix().transformAffine(
+							source.getLight(l).getAs4DVector()), 
+						i->elementCount);
+				break;
+
+			case ACT_LIGHT_DIRECTION_OBJECT_SPACE_ARRAY:
+				// We need the inverse of the inverse transpose 
+				source.getInverseTransposeWorldMatrix().inverse().extract3x3Matrix(m3);
+				for (size_t l = 0; l < i->data; ++l)
+				{
+					vec3 = m3 * source.getLight(l).getDerivedDirection();
+					vec3.normalise();
+					_writeRawConstant(i->physicalIndex + l*i->elementCount, 
+						Vector4(vec3.x, vec3.y, vec3.z, 0.0f), i->elementCount); 
+				}
+				break;
+
+			case ACT_LIGHT_POSITION_VIEW_SPACE_ARRAY:
+				for (size_t l = 0; l < i->data; ++l)
+					_writeRawConstant(i->physicalIndex + l*i->elementCount, 
+						source.getViewMatrix().transformAffine(
+							source.getLight(l).getAs4DVector()),
+						i->elementCount);
+				break;
+
+			case ACT_LIGHT_DIRECTION_VIEW_SPACE_ARRAY:
+				source.getInverseTransposeViewMatrix().extract3x3Matrix(m3);
+				for (size_t l = 0; l < i->data; ++l)
+				{
+					vec3 = m3 * source.getLight(l).getDerivedDirection();
+					vec3.normalise();
+					// Set as 4D vector for compatibility
+					_writeRawConstant(i->physicalIndex + l*i->elementCount, 
+						Vector4(vec3.x, vec3.y, vec3.z, 0.0f), i->elementCount);
+				}
+				break;
+
+			case ACT_LIGHT_DISTANCE_OBJECT_SPACE_ARRAY:
+				for (size_t l = 0; l < i->data; ++l)
+				{
+					vec3 = source.getInverseWorldMatrix().transformAffine(source.getLight(l).getDerivedPosition());
+					_writeRawConstant(i->physicalIndex + l*i->elementCount, vec3.length());
+				}
+				break;
+
+			case ACT_LIGHT_POWER_SCALE_ARRAY:
+				for (size_t l = 0; l < i->data; ++l)
+					_writeRawConstant(i->physicalIndex + l*i->elementCount, 
+						source.getLight(l).getPowerScale());
+				break;
+
+			case ACT_LIGHT_ATTENUATION_ARRAY:
+				for (size_t l = 0; l < i->data; ++l)
+				{
+					// range, const, linear, quad
+					const Light& light = source.getLight(l);
+					vec4.x = light.getAttenuationRange();
+					vec4.y = light.getAttenuationConstant();
+					vec4.z = light.getAttenuationLinear();
+					vec4.w = light.getAttenuationQuadric();
+					_writeRawConstant(i->physicalIndex + l*i->elementCount, vec4, 
+						i->elementCount);
+				}
+				break;
+			case ACT_SPOTLIGHT_PARAMS_ARRAY:
+				{
+					for (size_t l = 0 ; l < i->data; ++l)
+					{
+						// inner, outer, fallof, isSpot
+						const Light& light = source.getLight(l);
+						if (light.getType() == Light::LT_SPOTLIGHT)
+						{
+							vec4.x = Math::Cos(light.getSpotlightInnerAngle().valueRadians() * 0.5);
+							vec4.y = Math::Cos(light.getSpotlightOuterAngle().valueRadians() * 0.5);
+							vec4.z = light.getSpotlightFalloff();
+							vec4.w = 1.0f;
+						}
+						else
+						{
+							// Set angles to full circle for generality
+							vec4.x = vec4.y = 1.0f;
+							// reduce outer angle slightly to avoid divide by zero
+							vec4.y -= 1e-5f;
+							vec4.z = vec4.w = 0.0f;
+						}
+						_writeRawConstant(i->physicalIndex + l*i->elementCount, vec4, 
+							i->elementCount);
+
+					}
+					break;
+				}
+            case ACT_DERIVED_LIGHT_DIFFUSE_COLOUR:
+                _writeRawConstant(i->physicalIndex,
+                    source.getLight(i->data).getDiffuseColour() * source.getSurfaceDiffuseColour(),
+                    i->elementCount);
+                break;
+            case ACT_DERIVED_LIGHT_SPECULAR_COLOUR:
+                _writeRawConstant(i->physicalIndex,
+                    source.getLight(i->data).getSpecularColour() * source.getSurfaceSpecularColour(),
+                    i->elementCount);
+                break;
+            case ACT_DERIVED_LIGHT_DIFFUSE_COLOUR_ARRAY:
+				for (size_t l = 0; l < i->data; ++l)
+                {
+					_writeRawConstant(i->physicalIndex + l*i->elementCount, 
+                        source.getLight(l).getDiffuseColour() * source.getSurfaceDiffuseColour(),
+                        i->elementCount);
+                }
+                break;
+            case ACT_DERIVED_LIGHT_SPECULAR_COLOUR_ARRAY:
+				for (size_t l = 0; l < i->data; ++l)
+                {
+					_writeRawConstant(i->physicalIndex + l*i->elementCount, 
+                        source.getLight(l).getSpecularColour() * source.getSurfaceSpecularColour(),
+                        i->elementCount);
+                }
+                break;
+			case ACT_TEXTURE_VIEWPROJ_MATRIX:
+				// can also be updated in lights
+				_writeRawConstant(i->physicalIndex, source.getTextureViewProjMatrix(i->data));
+				break;
+            default:
+                // do nothing
+                break;
+            }
+        }
+    }
+    //---------------------------------------------------------------------------
+    void GpuProgramParameters::setNamedConstant(const String& name, Real val)
+    {
+		// look up, and throw an exception if we're not ignoring missing
+		const GpuConstantDefinition* def = 
+			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
+		if (def)
+			_writeRawConstant(def->physicalIndex, val);
+    }
+    //---------------------------------------------------------------------------
+    void GpuProgramParameters::setNamedConstant(const String& name, int val)
+    {
+		// look up, and throw an exception if we're not ignoring missing
+		const GpuConstantDefinition* def = 
+			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
+		if (def)
+			_writeRawConstant(def->physicalIndex, val);
+    }
+    //---------------------------------------------------------------------------
+    void GpuProgramParameters::setNamedConstant(const String& name, const Vector4& vec)
+    {
+		// look up, and throw an exception if we're not ignoring missing
+		const GpuConstantDefinition* def = 
+			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
+		if (def)
+			_writeRawConstant(def->physicalIndex, vec, def->elementSize);
+    }
+    //---------------------------------------------------------------------------
+    void GpuProgramParameters::setNamedConstant(const String& name, const Vector3& vec)
+    {
+		// look up, and throw an exception if we're not ignoring missing
+		const GpuConstantDefinition* def = 
+			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
+		if (def)
+			_writeRawConstant(def->physicalIndex, vec);
+    }
+    //---------------------------------------------------------------------------
+    void GpuProgramParameters::setNamedConstant(const String& name, const Matrix4& m)
+    {
+		// look up, and throw an exception if we're not ignoring missing
+		const GpuConstantDefinition* def = 
+			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
+		if (def)
+			_writeRawConstant(def->physicalIndex, m);
+    }
+    //---------------------------------------------------------------------------
+    void GpuProgramParameters::setNamedConstant(const String& name, const Matrix4* m, 
+        size_t numEntries)
+    {
+		// look up, and throw an exception if we're not ignoring missing
+		const GpuConstantDefinition* def = 
+			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
+		if (def)
+			_writeRawConstant(def->physicalIndex, m, numEntries);
+    }
+    //---------------------------------------------------------------------------
+    void GpuProgramParameters::setNamedConstant(const String& name, 
+		const float *val, size_t count, size_t multiple)
+    {
+		size_t rawCount = count * multiple;
+		// look up, and throw an exception if we're not ignoring missing
+		const GpuConstantDefinition* def = 
+			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
+		if (def)
+			_writeRawConstants(def->physicalIndex, val, rawCount);
+    }
+    //---------------------------------------------------------------------------
+    void GpuProgramParameters::setNamedConstant(const String& name, 
+		const double *val, size_t count, size_t multiple)
+    {
+		size_t rawCount = count * multiple;
+		// look up, and throw an exception if we're not ignoring missing
+		const GpuConstantDefinition* def = 
+			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
+		if (def)
+			_writeRawConstants(def->physicalIndex, val, rawCount);
+    }
+    //---------------------------------------------------------------------------
+    void GpuProgramParameters::setNamedConstant(const String& name, const ColourValue& colour)
+    {
+		// look up, and throw an exception if we're not ignoring missing
+		const GpuConstantDefinition* def = 
+			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
+		if (def)
+			_writeRawConstant(def->physicalIndex, colour, def->elementSize);
+    }
+    //---------------------------------------------------------------------------
+    void GpuProgramParameters::setNamedConstant(const String& name, 
+		const int *val, size_t count, size_t multiple)
+    {
+		size_t rawCount = count * multiple;
+		// look up, and throw an exception if we're not ignoring missing
+		const GpuConstantDefinition* def = 
+			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
+		if (def)
+			_writeRawConstants(def->physicalIndex, val, rawCount);
+    }
+    //---------------------------------------------------------------------------
+    void GpuProgramParameters::setNamedAutoConstant(const String& name, 
+		AutoConstantType acType, size_t extraInfo)
+    {
+		// look up, and throw an exception if we're not ignoring missing
+		const GpuConstantDefinition* def = 
+			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
+		if (def)
+			_setRawAutoConstant(def->physicalIndex, acType, extraInfo, def->elementSize);
+
+    }
+	//---------------------------------------------------------------------------
+	void GpuProgramParameters::setNamedAutoConstantReal(const String& name, 
+		AutoConstantType acType, Real rData)
+	{
+		// look up, and throw an exception if we're not ignoring missing
+		const GpuConstantDefinition* def = 
+			_findNamedConstantDefinition(name, !mIgnoreMissingParams);
+		if (def)
+			_setRawAutoConstantReal(def->physicalIndex, acType, rData, def->elementSize);
+
+	}
+    //---------------------------------------------------------------------------
+    void GpuProgramParameters::setConstantFromTime(size_t index, Real factor)
+    {
+        setAutoConstantReal(index, ACT_TIME, factor);
+    }
+    //---------------------------------------------------------------------------
+    void GpuProgramParameters::setNamedConstantFromTime(const String& name, Real factor)
+    {
+		setNamedAutoConstantReal(name, ACT_TIME, factor);
+    }
+    //---------------------------------------------------------------------------
+    GpuProgramParameters::AutoConstantEntry* GpuProgramParameters::getAutoConstantEntry(const size_t index)
+    {
+        if (index < mAutoConstants.size())
+        {
+            return &(mAutoConstants[index]);
+        }
+        else
+        {
+            return NULL;
+        }
+    }
+	//---------------------------------------------------------------------------
+	const GpuProgramParameters::AutoConstantEntry* 
+	GpuProgramParameters::findFloatAutoConstantEntry(size_t logicalIndex)
+	{
+		if (!mFloatLogicalToPhysical)
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+			"This is not a low-level parameter parameter object",
+			"GpuProgramParameters::findFloatAutoConstantEntry");
+
+		return _findRawAutoConstantEntryFloat(
+			_getFloatConstantPhysicalIndex(logicalIndex, 0));
+
+	}
+	//---------------------------------------------------------------------------
+	const GpuProgramParameters::AutoConstantEntry* 
+		GpuProgramParameters::findIntAutoConstantEntry(size_t logicalIndex)
+	{
+		if (!mIntLogicalToPhysical)
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+			"This is not a low-level parameter parameter object",
+			"GpuProgramParameters::findIntAutoConstantEntry");
+
+		return _findRawAutoConstantEntryInt(
+			_getIntConstantPhysicalIndex(logicalIndex, 0));
+
+
+	}
+	//---------------------------------------------------------------------------
+	const GpuProgramParameters::AutoConstantEntry* 
+	GpuProgramParameters::findAutoConstantEntry(const String& paramName)
+	{
+		if (!mNamedConstants)
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+			"This params object is not based on a program with named parameters.",
+			"GpuProgramParameters::findAutoConstantEntry");
+
+		const GpuConstantDefinition& def = getConstantDefinition(paramName);
+		if (def.isFloat())
+		{
+			return _findRawAutoConstantEntryFloat(def.physicalIndex);
+		}
+		else
+		{
+			return _findRawAutoConstantEntryInt(def.physicalIndex);
+		}
+	}
+	//---------------------------------------------------------------------------
+	const GpuProgramParameters::AutoConstantEntry* 
+	GpuProgramParameters::_findRawAutoConstantEntryFloat(size_t physicalIndex)
+	{
+		for(AutoConstantList::iterator i = mAutoConstants.begin();
+			i != mAutoConstants.end(); ++i)
+		{
+			AutoConstantEntry& ac = *i;
+			// should check that auto is float and not int so that physicalIndex
+			// doesn't have any ambiguity
+			// However, all autos are float I think so no need
+			if (ac.physicalIndex == physicalIndex)
+				return &ac;
+		}
+
+		return 0;
+
+	}
+	//---------------------------------------------------------------------------
+	const GpuProgramParameters::AutoConstantEntry* 
+	GpuProgramParameters::_findRawAutoConstantEntryInt(size_t physicalIndex)
+	{
+		// No autos are float?
+		return 0;
+	}
+    //---------------------------------------------------------------------------
+    void GpuProgramParameters::copyConstantsFrom(const GpuProgramParameters& source)
+    {
+		// Pull buffers & auto constant list over directly
+		mFloatConstants = source.getFloatConstantList();
+		mIntConstants = source.getIntConstantList();
+		mAutoConstants = source.getAutoConstantList();
+    }
+    //-----------------------------------------------------------------------
+    const GpuProgramParameters::AutoConstantDefinition* 
+	GpuProgramParameters::getAutoConstantDefinition(const String& name)
+    {
+        // find a constant definition that matches name by iterating through the 
+		// constant definition array
+        bool nameFound = false;
+        size_t i = 0;
+        const size_t numDefs = getNumAutoConstantDefinitions();
+        while (!nameFound && (i < numDefs))
+        {
+            if (name == AutoConstantDictionary[i].name) 
+                nameFound = true;
+            else
+                ++i;
+        }
+
+        if (nameFound)
+            return &AutoConstantDictionary[i];
+        else
+            return 0;
+    }
+
+    //-----------------------------------------------------------------------
+    const GpuProgramParameters::AutoConstantDefinition* 
+	GpuProgramParameters::getAutoConstantDefinition(const size_t idx) 
+    {
+
+        if (idx < getNumAutoConstantDefinitions())
+        {
+            // verify index is equal to acType
+            // if they are not equal then the dictionary was not setup properly
+            assert(idx == static_cast<size_t>(AutoConstantDictionary[idx].acType));
+            return &AutoConstantDictionary[idx];
+        }
+        else
+            return 0;
+    }
+    //-----------------------------------------------------------------------
+    size_t GpuProgramParameters::getNumAutoConstantDefinitions(void)
+    {
+        return sizeof(AutoConstantDictionary)/sizeof(AutoConstantDefinition);
+    }
+
+    //-----------------------------------------------------------------------
+    void GpuProgramParameters::incPassIterationNumber(void)
+    {
+		if (mActivePassIterationIndex != std::numeric_limits<size_t>::max())
+        {
+			// This is a physical index
+			++mFloatConstants[mActivePassIterationIndex];
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String GpuProgram::CmdType::doGet(const void* target) const
+    {
+        const GpuProgram* t = static_cast<const GpuProgram*>(target);
+        if (t->getType() == GPT_VERTEX_PROGRAM)
+        {
+            return "vertex_program";
+        }
+        else
+        {
+            return "fragment_program";
+        }
+    }
+    void GpuProgram::CmdType::doSet(void* target, const String& val)
+    {
+        GpuProgram* t = static_cast<GpuProgram*>(target);
+        if (val == "vertex_program")
+        {
+            t->setType(GPT_VERTEX_PROGRAM);
+        }
+        else
+        {
+            t->setType(GPT_FRAGMENT_PROGRAM);
+        }
+    }
+    //-----------------------------------------------------------------------
+    String GpuProgram::CmdSyntax::doGet(const void* target) const
+    {
+        const GpuProgram* t = static_cast<const GpuProgram*>(target);
+        return t->getSyntaxCode();
+    }
+    void GpuProgram::CmdSyntax::doSet(void* target, const String& val)
+    {
+        GpuProgram* t = static_cast<GpuProgram*>(target);
+        t->setSyntaxCode(val);
+    }
+    //-----------------------------------------------------------------------
+    String GpuProgram::CmdSkeletal::doGet(const void* target) const
+    {
+        const GpuProgram* t = static_cast<const GpuProgram*>(target);
+        return StringConverter::toString(t->isSkeletalAnimationIncluded());
+    }
+    void GpuProgram::CmdSkeletal::doSet(void* target, const String& val)
+    {
+        GpuProgram* t = static_cast<GpuProgram*>(target);
+        t->setSkeletalAnimationIncluded(StringConverter::parseBool(val));
+    }
+	//-----------------------------------------------------------------------
+	String GpuProgram::CmdMorph::doGet(const void* target) const
+	{
+		const GpuProgram* t = static_cast<const GpuProgram*>(target);
+		return StringConverter::toString(t->isMorphAnimationIncluded());
+	}
+	void GpuProgram::CmdMorph::doSet(void* target, const String& val)
+	{
+		GpuProgram* t = static_cast<GpuProgram*>(target);
+		t->setMorphAnimationIncluded(StringConverter::parseBool(val));
+	}
+	//-----------------------------------------------------------------------
+	String GpuProgram::CmdPose::doGet(const void* target) const
+	{
+		const GpuProgram* t = static_cast<const GpuProgram*>(target);
+		return StringConverter::toString(t->getNumberOfPosesIncluded());
+	}
+	void GpuProgram::CmdPose::doSet(void* target, const String& val)
+	{
+		GpuProgram* t = static_cast<GpuProgram*>(target);
+		t->setPoseAnimationIncluded(StringConverter::parseUnsignedInt(val));
+	}
+	//-----------------------------------------------------------------------
+	String GpuProgram::CmdVTF::doGet(const void* target) const
+	{
+		const GpuProgram* t = static_cast<const GpuProgram*>(target);
+		return StringConverter::toString(t->isVertexTextureFetchRequired());
+	}
+	void GpuProgram::CmdVTF::doSet(void* target, const String& val)
+	{
+		GpuProgram* t = static_cast<GpuProgram*>(target);
+		t->setVertexTextureFetchRequired(StringConverter::parseBool(val));
+	}
+    //-----------------------------------------------------------------------
+    GpuProgramPtr& GpuProgramPtr::operator=(const HighLevelGpuProgramPtr& r)
+    {
+        // Can assign direct
+        if (pRep == r.getPointer())
+            return *this;
+        release();
+		// lock & copy other mutex pointer
+        OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+        {
+		    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+		    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+            pRep = r.getPointer();
+            pUseCount = r.useCountPointer();
+            if (pUseCount)
+            {
+                ++(*pUseCount);
+            }
+        }
+		else
+		{
+			// RHS must be a null pointer
+			assert(r.isNull() && "RHS must be null if it has no mutex!");
+			setNull();
+		}
+        return *this;
+    }
+
+}
Index: /OgreMain/src/OgreGpuProgramManager.cpp
===================================================================
--- /OgreMain/src/OgreGpuProgramManager.cpp	(revision 5)
+++ /OgreMain/src/OgreGpuProgramManager.cpp	(revision 5)
@@ -0,0 +1,163 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreGpuProgramManager.h"
+#include "OgreHighLevelGpuProgramManager.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    template<> GpuProgramManager* Singleton<GpuProgramManager>::ms_Singleton = 0;
+    GpuProgramManager* GpuProgramManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    GpuProgramManager& GpuProgramManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+	//---------------------------------------------------------------------------
+	GpuProgramManager::GpuProgramManager()
+	{
+		// Loading order
+		mLoadOrder = 50.0f;
+		// Resource type
+		mResourceType = "GpuProgram";
+
+		// subclasses should register with resource group manager
+	}
+	//---------------------------------------------------------------------------
+	GpuProgramManager::~GpuProgramManager()
+	{
+		// subclasses should unregister with resource group manager
+	}
+	//---------------------------------------------------------------------------
+    GpuProgramPtr GpuProgramManager::load(const String& name,
+		const String& groupName, const String& filename, 
+		GpuProgramType gptype, const String& syntaxCode)
+    {
+		GpuProgramPtr prg;
+		{
+			OGRE_LOCK_AUTO_MUTEX
+			prg = getByName(name);
+			if (prg.isNull())
+			{
+				prg = createProgram(name, groupName, filename, gptype, syntaxCode);
+			}
+
+		}
+        prg->load();
+        return prg;
+    }
+    //---------------------------------------------------------------------------
+	GpuProgramPtr GpuProgramManager::loadFromString(const String& name, 
+		const String& groupName, const String& code, 
+        GpuProgramType gptype, const String& syntaxCode)
+    {
+		GpuProgramPtr prg;
+		{
+			OGRE_LOCK_AUTO_MUTEX
+			prg = getByName(name);
+			if (prg.isNull())
+			{
+				prg = createProgramFromString(name, groupName, code, gptype, syntaxCode);
+			}
+
+		}
+        prg->load();
+        return prg;
+    }
+    //---------------------------------------------------------------------------
+    ResourcePtr GpuProgramManager::create(const String& name, const String& group, 
+        GpuProgramType gptype, const String& syntaxCode, bool isManual, 
+        ManualResourceLoader* loader)
+    {
+        // Call creation implementation
+        ResourcePtr ret = ResourcePtr(
+            createImpl(name, getNextHandle(), group, isManual, loader, gptype, syntaxCode));
+
+        addImpl(ret);
+        // Tell resource group manager
+        ResourceGroupManager::getSingleton()._notifyResourceCreated(ret);
+        return ret;
+    }
+    //---------------------------------------------------------------------------
+	GpuProgramPtr GpuProgramManager::createProgram(const String& name, 
+		const String& groupName, const String& filename, 
+		GpuProgramType gptype, const String& syntaxCode)
+    {
+		GpuProgramPtr prg = create(name, groupName, gptype, syntaxCode);
+        // Set all prarmeters (create does not set, just determines factory)
+		prg->setType(gptype);
+		prg->setSyntaxCode(syntaxCode);
+		prg->setSourceFile(filename);
+        return prg;
+    }
+    //---------------------------------------------------------------------------
+	GpuProgramPtr GpuProgramManager::createProgramFromString(const String& name, 
+		const String& groupName, const String& code, GpuProgramType gptype, 
+		const String& syntaxCode)
+    {
+		GpuProgramPtr prg = create(name, groupName, gptype, syntaxCode);
+        // Set all prarmeters (create does not set, just determines factory)
+		prg->setType(gptype);
+		prg->setSyntaxCode(syntaxCode);
+		prg->setSource(code);
+        return prg;
+    }
+    //---------------------------------------------------------------------------
+    bool GpuProgramManager::isSyntaxSupported(const String& syntaxCode) const
+    {
+        if (std::find(mSyntaxCodes.begin(), mSyntaxCodes.end(), syntaxCode) != mSyntaxCodes.end())
+        {
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+    //---------------------------------------------------------------------------
+    ResourcePtr GpuProgramManager::getByName(const String& name, bool preferHighLevelPrograms)
+    {
+        ResourcePtr ret;
+        if (preferHighLevelPrograms)
+        {
+            ret = HighLevelGpuProgramManager::getSingleton().getByName(name);
+            if (!ret.isNull())
+                return ret;
+        }
+        return ResourceManager::getByName(name);
+    }
+	//-----------------------------------------------------------------------------
+	GpuProgramParametersSharedPtr GpuProgramManager::createParameters(void)
+	{
+		return GpuProgramParametersSharedPtr(new GpuProgramParameters());
+	}
+
+}
Index: /OgreMain/src/OgreGpuProgramUsage.cpp
===================================================================
--- /OgreMain/src/OgreGpuProgramUsage.cpp	(revision 5)
+++ /OgreMain/src/OgreGpuProgramUsage.cpp	(revision 5)
@@ -0,0 +1,102 @@
+
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreGpuProgramUsage.h"
+#include "OgreGpuProgramManager.h"
+#include "OgreException.h"
+
+namespace Ogre
+{
+    //-----------------------------------------------------------------------------
+    GpuProgramUsage::GpuProgramUsage(GpuProgramType gptype) :
+        mType(gptype), mProgram()
+    {
+    }
+	//-----------------------------------------------------------------------------
+	GpuProgramUsage::GpuProgramUsage(const GpuProgramUsage& oth)
+        : mType(oth.mType)
+        , mProgram(oth.mProgram)
+        // nfz: parameters should be copied not just use a shared ptr to the original
+		, mParameters(new GpuProgramParameters(*oth.mParameters))
+	{
+	}
+	//-----------------------------------------------------------------------------
+	void GpuProgramUsage::setProgramName(const String& name, bool resetParams)
+	{
+		mProgram = GpuProgramManager::getSingleton().getByName(name);
+
+        if (mProgram.isNull())
+        {
+            String progType = (mType == GPT_VERTEX_PROGRAM ? "vertex" : "fragment");
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Unable to locate " + progType + " program called " + name + ".",
+                "GpuProgramUsage::setProgramName");
+        }
+        // Reset parameters 
+        if (resetParams || mParameters.isNull())
+            mParameters = mProgram->createParameters();
+
+	}
+    //-----------------------------------------------------------------------------
+    void GpuProgramUsage::setParameters(GpuProgramParametersSharedPtr params)
+    {
+        mParameters = params;
+    }
+    //-----------------------------------------------------------------------------
+    GpuProgramParametersSharedPtr GpuProgramUsage::getParameters(void)
+    {
+        if (mParameters.isNull())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "You must specify a program before "
+                "you can retrieve parameters.", "GpuProgramUsage::getParameters");
+        }
+
+        return mParameters;
+    }
+    //-----------------------------------------------------------------------------
+	void GpuProgramUsage::setProgram(GpuProgramPtr& prog) 
+	{
+        mProgram = prog;
+        // Reset parameters 
+        mParameters = mProgram->createParameters();
+    }
+    //-----------------------------------------------------------------------------
+    void GpuProgramUsage::_load(void)
+    {
+        if (!mProgram->isLoaded())
+            mProgram->load();
+    }
+    //-----------------------------------------------------------------------------
+    void GpuProgramUsage::_unload(void)
+    {
+        // TODO?
+    }
+
+}
Index: /OgreMain/src/OgreHardwareBufferManager.cpp
===================================================================
--- /OgreMain/src/OgreHardwareBufferManager.cpp	(revision 5)
+++ /OgreMain/src/OgreHardwareBufferManager.cpp	(revision 5)
@@ -0,0 +1,534 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreVertexIndexData.h"
+#include "OgreLogManager.h"
+
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    template<> HardwareBufferManager* Singleton<HardwareBufferManager>::ms_Singleton = 0;
+    HardwareBufferManager* HardwareBufferManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    HardwareBufferManager& HardwareBufferManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+    // Free temporary vertex buffers every 5 minutes on 100fps
+    const size_t HardwareBufferManager::UNDER_USED_FRAME_THRESHOLD = 30000;
+    const size_t HardwareBufferManager::EXPIRED_DELAY_FRAME_THRESHOLD = 5;
+    //-----------------------------------------------------------------------
+    HardwareBufferManager::HardwareBufferManager()
+        : mUnderUsedFrameCount(0)
+    {
+    }
+    //-----------------------------------------------------------------------
+    HardwareBufferManager::~HardwareBufferManager()
+    {
+        // Clear vertex/index buffer list first, avoid destroyed notify do
+        // unnecessary work, and we'll destroy everything here.
+		mVertexBuffers.clear();
+		mIndexBuffers.clear();
+
+        // Destroy everything
+        destroyAllDeclarations();
+        destroyAllBindings();
+        // No need to destroy main buffers - they will be destroyed by removal of bindings
+
+        // No need to destroy temp buffers - they will be destroyed automatically.
+    }
+    //-----------------------------------------------------------------------
+    VertexDeclaration* HardwareBufferManager::createVertexDeclaration(void)
+    {
+        VertexDeclaration* decl = createVertexDeclarationImpl();
+		OGRE_LOCK_MUTEX(mVertexDeclarationsMutex)
+        mVertexDeclarations.insert(decl);
+        return decl;
+    }
+    //-----------------------------------------------------------------------
+    void HardwareBufferManager::destroyVertexDeclaration(VertexDeclaration* decl)
+    {
+		OGRE_LOCK_MUTEX(mVertexDeclarationsMutex)
+        mVertexDeclarations.erase(decl);
+        destroyVertexDeclarationImpl(decl);
+    }
+    //-----------------------------------------------------------------------
+	VertexBufferBinding* HardwareBufferManager::createVertexBufferBinding(void)
+	{
+		VertexBufferBinding* ret = createVertexBufferBindingImpl();
+		OGRE_LOCK_MUTEX(mVertexBufferBindingsMutex)
+		mVertexBufferBindings.insert(ret);
+		return ret;
+	}
+    //-----------------------------------------------------------------------
+	void HardwareBufferManager::destroyVertexBufferBinding(VertexBufferBinding* binding)
+	{
+		OGRE_LOCK_MUTEX(mVertexBufferBindingsMutex)
+		mVertexBufferBindings.erase(binding);
+		destroyVertexBufferBindingImpl(binding);
+	}
+    //-----------------------------------------------------------------------
+    VertexDeclaration* HardwareBufferManager::createVertexDeclarationImpl(void)
+    {
+        return new VertexDeclaration();
+    }
+    //-----------------------------------------------------------------------
+    void HardwareBufferManager::destroyVertexDeclarationImpl(VertexDeclaration* decl)
+    {
+        delete decl;
+    }
+    //-----------------------------------------------------------------------
+	VertexBufferBinding* HardwareBufferManager::createVertexBufferBindingImpl(void)
+	{
+		return new VertexBufferBinding();
+	}
+    //-----------------------------------------------------------------------
+	void HardwareBufferManager::destroyVertexBufferBindingImpl(VertexBufferBinding* binding)
+	{
+		delete binding;
+	}
+    //-----------------------------------------------------------------------
+    void HardwareBufferManager::destroyAllDeclarations(void)
+    {
+		OGRE_LOCK_MUTEX(mVertexDeclarationsMutex)
+        VertexDeclarationList::iterator decl;
+        for (decl = mVertexDeclarations.begin(); decl != mVertexDeclarations.end(); ++decl)
+        {
+            destroyVertexDeclarationImpl(*decl);
+        }
+        mVertexDeclarations.clear();
+    }
+    //-----------------------------------------------------------------------
+    void HardwareBufferManager::destroyAllBindings(void)
+    {
+		OGRE_LOCK_MUTEX(mVertexBufferBindingsMutex)
+        VertexBufferBindingList::iterator bind;
+        for (bind = mVertexBufferBindings.begin(); bind != mVertexBufferBindings.end(); ++bind)
+        {
+            destroyVertexBufferBindingImpl(*bind);
+        }
+        mVertexBufferBindings.clear();
+    }
+	//-----------------------------------------------------------------------
+    void HardwareBufferManager::registerVertexBufferSourceAndCopy(
+			const HardwareVertexBufferSharedPtr& sourceBuffer,
+			const HardwareVertexBufferSharedPtr& copy)
+	{
+		OGRE_LOCK_MUTEX(mTempBuffersMutex)
+		// Add copy to free temporary vertex buffers
+        mFreeTempVertexBufferMap.insert(
+            FreeTemporaryVertexBufferMap::value_type(sourceBuffer.get(), copy));
+	}
+	//-----------------------------------------------------------------------
+    HardwareVertexBufferSharedPtr 
+    HardwareBufferManager::allocateVertexBufferCopy(
+        const HardwareVertexBufferSharedPtr& sourceBuffer, 
+        BufferLicenseType licenseType, HardwareBufferLicensee* licensee,
+        bool copyData)
+    {
+		OGRE_LOCK_MUTEX(mTempBuffersMutex)
+        HardwareVertexBufferSharedPtr vbuf;
+
+        // Locate existing buffer copy in temporary vertex buffers
+        FreeTemporaryVertexBufferMap::iterator i = 
+            mFreeTempVertexBufferMap.find(sourceBuffer.get());
+        if (i == mFreeTempVertexBufferMap.end())
+        {
+            // copy buffer, use shadow buffer and make dynamic
+            vbuf = makeBufferCopy(
+                sourceBuffer, 
+                HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, 
+                true);
+        }
+        else
+        {
+            // Allocate existing copy
+            vbuf = i->second;
+            mFreeTempVertexBufferMap.erase(i);
+        }
+
+        // Copy data?
+        if (copyData)
+        {
+            vbuf->copyData(*(sourceBuffer.get()), 0, 0, sourceBuffer->getSizeInBytes(), true);
+        }
+
+        // Insert copy into licensee list
+        mTempVertexBufferLicenses.insert(
+            TemporaryVertexBufferLicenseMap::value_type(
+                vbuf.get(),
+                VertexBufferLicense(sourceBuffer.get(), licenseType, EXPIRED_DELAY_FRAME_THRESHOLD, vbuf, licensee)));
+
+        return vbuf;
+    }
+    //-----------------------------------------------------------------------
+    void HardwareBufferManager::releaseVertexBufferCopy(
+        const HardwareVertexBufferSharedPtr& bufferCopy)
+    {
+		OGRE_LOCK_MUTEX(mTempBuffersMutex)
+
+		TemporaryVertexBufferLicenseMap::iterator i =
+            mTempVertexBufferLicenses.find(bufferCopy.get());
+        if (i != mTempVertexBufferLicenses.end())
+        {
+            const VertexBufferLicense& vbl = i->second;
+
+            vbl.licensee->licenseExpired(vbl.buffer.get());
+
+            mFreeTempVertexBufferMap.insert(
+                FreeTemporaryVertexBufferMap::value_type(vbl.originalBufferPtr, vbl.buffer));
+            mTempVertexBufferLicenses.erase(i);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void HardwareBufferManager::touchVertexBufferCopy(
+            const HardwareVertexBufferSharedPtr& bufferCopy)
+    {
+		OGRE_LOCK_MUTEX(mTempBuffersMutex)
+        TemporaryVertexBufferLicenseMap::iterator i =
+            mTempVertexBufferLicenses.find(bufferCopy.get());
+        if (i != mTempVertexBufferLicenses.end())
+        {
+            VertexBufferLicense& vbl = i->second;
+            assert(vbl.licenseType == BLT_AUTOMATIC_RELEASE);
+
+            vbl.expiredDelay = EXPIRED_DELAY_FRAME_THRESHOLD;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void HardwareBufferManager::_freeUnusedBufferCopies(void)
+    {
+		OGRE_LOCK_MUTEX(mTempBuffersMutex)
+        size_t numFreed = 0;
+
+        // Free unused temporary buffers
+        FreeTemporaryVertexBufferMap::iterator i;
+        i = mFreeTempVertexBufferMap.begin();
+        while (i != mFreeTempVertexBufferMap.end())
+        {
+            FreeTemporaryVertexBufferMap::iterator icur = i++;
+            // Free the temporary buffer that referenced by ourself only.
+            // TODO: Some temporary buffers are bound to vertex buffer bindings
+            // but not checked out, need to sort out method to unbind them.
+            if (icur->second.useCount() <= 1)
+            {
+                ++numFreed;
+                mFreeTempVertexBufferMap.erase(icur);
+            }
+        }
+
+        StringUtil::StrStreamType str;
+        if (numFreed)
+        {
+            str << "HardwareBufferManager: Freed " << numFreed << " unused temporary vertex buffers.";
+        }
+        else
+        {
+            str << "HardwareBufferManager: No unused temporary vertex buffers found.";
+        }
+        LogManager::getSingleton().logMessage(str.str(), LML_TRIVIAL);
+    }
+    //-----------------------------------------------------------------------
+    void HardwareBufferManager::_releaseBufferCopies(bool forceFreeUnused)
+    {
+		OGRE_LOCK_MUTEX(mTempBuffersMutex)
+        size_t numUnused = mFreeTempVertexBufferMap.size();
+        size_t numUsed = mTempVertexBufferLicenses.size();
+
+        // Erase the copies which are automatic licensed out
+        TemporaryVertexBufferLicenseMap::iterator i;
+        i = mTempVertexBufferLicenses.begin(); 
+        while (i != mTempVertexBufferLicenses.end()) 
+        {
+            TemporaryVertexBufferLicenseMap::iterator icur = i++;
+            VertexBufferLicense& vbl = icur->second;
+            if (vbl.licenseType == BLT_AUTOMATIC_RELEASE &&
+                (forceFreeUnused || --vbl.expiredDelay <= 0))
+            {
+				vbl.licensee->licenseExpired(vbl.buffer.get());
+
+                mFreeTempVertexBufferMap.insert(
+                    FreeTemporaryVertexBufferMap::value_type(vbl.originalBufferPtr, vbl.buffer));
+                mTempVertexBufferLicenses.erase(icur);
+            }
+        }
+
+        // Check whether or not free unused temporary vertex buffers.
+        if (forceFreeUnused)
+        {
+            _freeUnusedBufferCopies();
+            mUnderUsedFrameCount = 0;
+        }
+        else
+        {
+            if (numUsed < numUnused)
+            {
+                // Free temporary vertex buffers if too many unused for a long time.
+                // Do overall temporary vertex buffers instead of per source buffer
+                // to avoid overhead.
+                ++mUnderUsedFrameCount;
+                if (mUnderUsedFrameCount >= UNDER_USED_FRAME_THRESHOLD)
+                {
+                    _freeUnusedBufferCopies();
+                    mUnderUsedFrameCount = 0;
+                }
+            }
+            else
+            {
+                mUnderUsedFrameCount = 0;
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void HardwareBufferManager::_forceReleaseBufferCopies(
+        const HardwareVertexBufferSharedPtr& sourceBuffer)
+    {
+        _forceReleaseBufferCopies(sourceBuffer.get());
+    }
+    //-----------------------------------------------------------------------
+    void HardwareBufferManager::_forceReleaseBufferCopies(
+        HardwareVertexBuffer* sourceBuffer)
+    {
+		OGRE_LOCK_MUTEX(mTempBuffersMutex)
+        // Erase the copies which are licensed out
+        TemporaryVertexBufferLicenseMap::iterator i;
+        i = mTempVertexBufferLicenses.begin();
+        while (i != mTempVertexBufferLicenses.end()) 
+        {
+            TemporaryVertexBufferLicenseMap::iterator icur = i++;
+            const VertexBufferLicense& vbl = icur->second;
+            if (vbl.originalBufferPtr == sourceBuffer)
+            {
+                // Just tell the owner that this is being released
+                vbl.licensee->licenseExpired(vbl.buffer.get());
+
+                mTempVertexBufferLicenses.erase(icur);
+            }
+        }
+
+        // Erase the free copies
+        //
+        // Why we need this unusual code? It's for resolve reenter problem.
+        //
+        // Using mFreeTempVertexBufferMap.erase(sourceBuffer) directly will
+        // cause reenter into here because vertex buffer destroyed notify.
+        // In most time there are no problem. But when sourceBuffer is the
+        // last item of the mFreeTempVertexBufferMap, some STL multimap
+        // implementation (VC and STLport) will call to clear(), which will
+        // causing intermediate state of mFreeTempVertexBufferMap, in that
+        // time destroyed notify back to here cause illegal accessing in
+        // the end.
+        //
+        // For safely reason, use following code to resolve reenter problem.
+        //
+        typedef FreeTemporaryVertexBufferMap::iterator _Iter;
+        std::pair<_Iter, _Iter> range = mFreeTempVertexBufferMap.equal_range(sourceBuffer);
+        if (range.first != range.second)
+        {
+            std::list<HardwareVertexBufferSharedPtr> holdForDelayDestroy;
+            for (_Iter it = range.first; it != range.second; ++it)
+            {
+                if (it->second.useCount() <= 1)
+                {
+                    holdForDelayDestroy.push_back(it->second);
+                }
+            }
+
+            mFreeTempVertexBufferMap.erase(range.first, range.second);
+
+            // holdForDelayDestroy will destroy auto.
+        }
+    }
+	//-----------------------------------------------------------------------
+	void HardwareBufferManager::_notifyVertexBufferDestroyed(HardwareVertexBuffer* buf)
+	{
+		OGRE_LOCK_MUTEX(mVertexBuffersMutex)
+
+		VertexBufferList::iterator i = mVertexBuffers.find(buf);
+		if (i != mVertexBuffers.end())
+		{
+            // release vertex buffer copies
+			mVertexBuffers.erase(i);
+            _forceReleaseBufferCopies(buf);
+		}
+	}
+	//-----------------------------------------------------------------------
+	void HardwareBufferManager::_notifyIndexBufferDestroyed(HardwareIndexBuffer* buf)
+	{
+		OGRE_LOCK_MUTEX(mIndexBuffersMutex)
+
+		IndexBufferList::iterator i = mIndexBuffers.find(buf);
+		if (i != mIndexBuffers.end())
+		{
+			mIndexBuffers.erase(i);
+		}
+	}
+    //-----------------------------------------------------------------------
+    HardwareVertexBufferSharedPtr 
+    HardwareBufferManager::makeBufferCopy(
+        const HardwareVertexBufferSharedPtr& source,
+        HardwareBuffer::Usage usage, bool useShadowBuffer)
+    {
+        return this->createVertexBuffer(
+            source->getVertexSize(), 
+            source->getNumVertices(),
+            usage, useShadowBuffer);
+    }
+    //-----------------------------------------------------------------------------
+    //-----------------------------------------------------------------------------
+    //-----------------------------------------------------------------------------
+    TempBlendedBufferInfo::~TempBlendedBufferInfo(void)
+    {
+        // check that temp buffers have been released
+        HardwareBufferManager &mgr = HardwareBufferManager::getSingleton();
+        if (!destPositionBuffer.isNull())
+            mgr.releaseVertexBufferCopy(destPositionBuffer);
+        if (!destNormalBuffer.isNull())
+            mgr.releaseVertexBufferCopy(destNormalBuffer);
+
+    }
+    //-----------------------------------------------------------------------------
+    void TempBlendedBufferInfo::extractFrom(const VertexData* sourceData)
+    {
+        // Release old buffer copies first
+        HardwareBufferManager &mgr = HardwareBufferManager::getSingleton();
+        if (!destPositionBuffer.isNull())
+        {
+            mgr.releaseVertexBufferCopy(destPositionBuffer);
+            assert(destPositionBuffer.isNull());
+        }
+        if (!destNormalBuffer.isNull())
+        {
+            mgr.releaseVertexBufferCopy(destNormalBuffer);
+            assert(destNormalBuffer.isNull());
+        }
+
+        VertexDeclaration* decl = sourceData->vertexDeclaration;
+        VertexBufferBinding* bind = sourceData->vertexBufferBinding;
+        const VertexElement *posElem = decl->findElementBySemantic(VES_POSITION);
+        const VertexElement *normElem = decl->findElementBySemantic(VES_NORMAL);
+
+        assert(posElem && "Positions are required");
+
+        posBindIndex = posElem->getSource();
+        srcPositionBuffer = bind->getBuffer(posBindIndex);
+
+        if (!normElem)
+        {
+            posNormalShareBuffer = false;
+            srcNormalBuffer.setNull();
+        }
+        else
+        {
+            normBindIndex = normElem->getSource();
+            if (normBindIndex == posBindIndex)
+            {
+                posNormalShareBuffer = true;
+                srcNormalBuffer.setNull();
+            }
+            else
+            {
+                posNormalShareBuffer = false;
+                srcNormalBuffer = bind->getBuffer(normBindIndex);
+            }
+        }
+    }
+    //-----------------------------------------------------------------------------
+    void TempBlendedBufferInfo::checkoutTempCopies(bool positions, bool normals)
+    {
+        bindPositions = positions;
+        bindNormals = normals;
+
+        HardwareBufferManager &mgr = HardwareBufferManager::getSingleton();
+
+        if (positions && destPositionBuffer.isNull())
+        {
+            destPositionBuffer = mgr.allocateVertexBufferCopy(srcPositionBuffer, 
+                HardwareBufferManager::BLT_AUTOMATIC_RELEASE, this);
+        }
+        if (normals && !posNormalShareBuffer && !srcNormalBuffer.isNull() && destNormalBuffer.isNull())
+        {
+            destNormalBuffer = mgr.allocateVertexBufferCopy(srcNormalBuffer, 
+                HardwareBufferManager::BLT_AUTOMATIC_RELEASE, this);
+        }
+    }
+	//-----------------------------------------------------------------------------
+	bool TempBlendedBufferInfo::buffersCheckedOut(bool positions, bool normals) const
+	{
+        HardwareBufferManager &mgr = HardwareBufferManager::getSingleton();
+
+        if (positions || (normals && posNormalShareBuffer))
+        {
+            if (destPositionBuffer.isNull())
+                return false;
+
+            mgr.touchVertexBufferCopy(destPositionBuffer);
+        }
+
+        if (normals && !posNormalShareBuffer)
+        {
+            if (destNormalBuffer.isNull())
+                return false;
+
+            mgr.touchVertexBufferCopy(destNormalBuffer);
+        }
+
+		return true;
+	}
+    //-----------------------------------------------------------------------------
+    void TempBlendedBufferInfo::bindTempCopies(VertexData* targetData, bool suppressHardwareUpload)
+    {
+        this->destPositionBuffer->suppressHardwareUpdate(suppressHardwareUpload);
+        targetData->vertexBufferBinding->setBinding(
+            this->posBindIndex, this->destPositionBuffer);
+        if (bindNormals && !posNormalShareBuffer && !destNormalBuffer.isNull())
+        {
+            this->destNormalBuffer->suppressHardwareUpdate(suppressHardwareUpload);
+            targetData->vertexBufferBinding->setBinding(
+                this->normBindIndex, this->destNormalBuffer);
+        }
+    }
+    //-----------------------------------------------------------------------------
+    void TempBlendedBufferInfo::licenseExpired(HardwareBuffer* buffer)
+    {
+        assert(buffer == destPositionBuffer.get()
+            || buffer == destNormalBuffer.get());
+
+        if (buffer == destPositionBuffer.get())
+            destPositionBuffer.setNull();
+        if (buffer == destNormalBuffer.get())
+            destNormalBuffer.setNull();
+
+    }
+
+}
Index: /OgreMain/src/OgreHardwareIndexBuffer.cpp
===================================================================
--- /OgreMain/src/OgreHardwareIndexBuffer.cpp	(revision 5)
+++ /OgreMain/src/OgreHardwareIndexBuffer.cpp	(revision 5)
@@ -0,0 +1,86 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreHardwareIndexBuffer.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreDefaultHardwareBufferManager.h"
+
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------------
+    HardwareIndexBuffer::HardwareIndexBuffer(IndexType idxType, 
+        size_t numIndexes, HardwareBuffer::Usage usage, 
+        bool useSystemMemory, bool useShadowBuffer) 
+        : HardwareBuffer(usage, useSystemMemory, useShadowBuffer), mIndexType(idxType), mNumIndexes(numIndexes)
+    {
+        // Calculate the size of the indexes
+        switch (mIndexType)
+        {
+        case IT_16BIT:
+            mIndexSize = sizeof(unsigned short);
+            break;
+        case IT_32BIT:
+            mIndexSize = sizeof(unsigned int);
+            break;
+        }
+        mSizeInBytes = mIndexSize * mNumIndexes;
+
+        // Create a shadow buffer if required
+        if (mUseShadowBuffer)
+        {
+            mpShadowBuffer = new DefaultHardwareIndexBuffer(mIndexType, 
+                mNumIndexes, HardwareBuffer::HBU_DYNAMIC);
+        }
+
+
+    }
+    //-----------------------------------------------------------------------------
+    HardwareIndexBuffer::~HardwareIndexBuffer()
+    {
+		HardwareBufferManager* mgr = HardwareBufferManager::getSingletonPtr();
+		if (mgr)
+		{
+			mgr->_notifyIndexBufferDestroyed(this);
+		}
+
+        if (mpShadowBuffer)
+        {
+            delete mpShadowBuffer;
+        }
+    }
+    //-----------------------------------------------------------------------------
+    HardwareIndexBufferSharedPtr::HardwareIndexBufferSharedPtr(HardwareIndexBuffer* buf)
+        : SharedPtr<HardwareIndexBuffer>(buf)
+    {
+
+    }
+
+}
+
Index: /OgreMain/src/OgreHardwareOcclusionQuery.cpp
===================================================================
--- /OgreMain/src/OgreHardwareOcclusionQuery.cpp	(revision 5)
+++ /OgreMain/src/OgreHardwareOcclusionQuery.cpp	(revision 5)
@@ -0,0 +1,46 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreStableHeaders.h"
+#include "OgreHardwareOcclusionQuery.h"
+
+namespace Ogre {
+
+
+    HardwareOcclusionQuery::HardwareOcclusionQuery() : 
+        mPixelCount(0),
+        mIsQueryResultStillOutstanding(false)
+    {
+    }
+    HardwareOcclusionQuery::~HardwareOcclusionQuery()
+    {
+    }
+
+}
+
Index: /OgreMain/src/OgreHardwarePixelBuffer.cpp
===================================================================
--- /OgreMain/src/OgreHardwarePixelBuffer.cpp	(revision 5)
+++ /OgreMain/src/OgreHardwarePixelBuffer.cpp	(revision 5)
@@ -0,0 +1,197 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreHardwarePixelBuffer.h"
+#include "OgreImage.h"
+#include "OgreException.h"
+
+namespace Ogre 
+{
+  
+    //-----------------------------------------------------------------------------    
+    HardwarePixelBuffer::HardwarePixelBuffer(size_t width, size_t height, size_t depth,
+            PixelFormat format,
+            HardwareBuffer::Usage usage, bool useSystemMemory, bool useShadowBuffer):
+        HardwareBuffer(usage, useSystemMemory, useShadowBuffer),
+        mWidth(width), mHeight(height), mDepth(depth),
+        mFormat(format)
+    {
+        // Default
+        mRowPitch = mWidth;
+        mSlicePitch = mHeight*mWidth;
+		mSizeInBytes = mHeight*mWidth*PixelUtil::getNumElemBytes(mFormat);
+    }
+    
+    //-----------------------------------------------------------------------------    
+    HardwarePixelBuffer::~HardwarePixelBuffer()
+    {
+    }
+    
+    //-----------------------------------------------------------------------------    
+    void* HardwarePixelBuffer::lock(size_t offset, size_t length, LockOptions options)
+    {
+        assert(!isLocked() && "Cannot lock this buffer, it is already locked!");
+        assert(offset == 0 && length == mSizeInBytes && "Cannot lock memory region, most lock box or entire buffer");
+        
+        Image::Box myBox(0, 0, 0, mWidth, mHeight, mDepth);
+        const PixelBox &rv = lock(myBox, options);
+        return rv.data;
+    }
+    
+    //-----------------------------------------------------------------------------    
+    const PixelBox& HardwarePixelBuffer::lock(const Image::Box& lockBox, LockOptions options)
+    {
+        if (mUseShadowBuffer)
+        {
+            if (options != HBL_READ_ONLY)
+            {
+                // we have to assume a read / write lock so we use the shadow buffer
+                // and tag for sync on unlock()
+                mShadowUpdated = true;
+            }
+
+            mCurrentLock = static_cast<HardwarePixelBuffer*>(mpShadowBuffer)->lock(lockBox, options);
+        }
+        else
+        {
+            // Lock the real buffer if there is no shadow buffer 
+            mCurrentLock = lockImpl(lockBox, options);
+            mIsLocked = true;
+        }
+
+        return mCurrentLock;
+    }
+    
+    //-----------------------------------------------------------------------------    
+    const PixelBox& HardwarePixelBuffer::getCurrentLock() 
+	{ 
+        assert(isLocked() && "Cannot get current lock: buffer not locked");
+        
+        return mCurrentLock; 
+    }
+    
+    //-----------------------------------------------------------------------------    
+    /// Internal implementation of lock()
+    void* HardwarePixelBuffer::lockImpl(size_t offset, size_t length, LockOptions options)
+    {
+        OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "lockImpl(offset,length) is not valid for PixelBuffers and should never be called",
+            "HardwarePixelBuffer::lockImpl");
+    }
+
+    //-----------------------------------------------------------------------------    
+
+    void HardwarePixelBuffer::blit(const HardwarePixelBufferSharedPtr &src, const Image::Box &srcBox, const Image::Box &dstBox)
+	{
+		if(isLocked() || src->isLocked())
+		{
+			OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR,
+				"Source and destination buffer may not be locked!",
+				"HardwarePixelBuffer::blit");
+		}
+		if(src.getPointer() == this)
+		{
+			OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS,
+                "Source must not be the same object",
+                "HardwarePixelBuffer::blit" ) ;
+		}
+		const PixelBox &srclock = src->lock(srcBox, HBL_READ_ONLY);
+
+		LockOptions method = HBL_NORMAL;
+		if(dstBox.left == 0 && dstBox.top == 0 && dstBox.front == 0 &&
+		   dstBox.right == mWidth && dstBox.bottom == mHeight &&
+		   dstBox.back == mDepth)
+			// Entire buffer -- we can discard the previous contents
+			method = HBL_DISCARD;
+			
+		const PixelBox &dstlock = lock(dstBox, method);
+		if(dstlock.getWidth() != srclock.getWidth() ||
+        	dstlock.getHeight() != srclock.getHeight() ||
+        	dstlock.getDepth() != srclock.getDepth())
+		{
+			// Scaling desired
+			Image::scale(srclock, dstlock);
+		}
+		else
+		{
+			// No scaling needed
+			PixelUtil::bulkPixelConversion(srclock, dstlock);
+		}
+
+		unlock();
+		src->unlock();
+	}
+    //-----------------------------------------------------------------------------       
+    void HardwarePixelBuffer::blit(const HardwarePixelBufferSharedPtr &src)
+    {
+        blit(src, 
+            Box(0,0,0,src->getWidth(),src->getHeight(),src->getDepth()), 
+            Box(0,0,0,mWidth,mHeight,mDepth)
+        );
+    }
+    //-----------------------------------------------------------------------------    
+	void HardwarePixelBuffer::readData(size_t offset, size_t length, void* pDest)
+	{
+		// TODO
+		OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED,
+				"Reading a byte range is not implemented. Use blitToMemory.",
+				"HardwarePixelBuffer::readData");
+	}
+	//-----------------------------------------------------------------------------    
+
+	void HardwarePixelBuffer::writeData(size_t offset, size_t length, const void* pSource,
+			bool discardWholeBuffer)
+	{
+		// TODO
+		OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED,
+				"Writing a byte range is not implemented. Use blitFromMemory.",
+				"HardwarePixelBuffer::writeData");
+	}
+    //-----------------------------------------------------------------------------    
+    
+    RenderTexture *HardwarePixelBuffer::getRenderTarget(size_t)
+    {
+        OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED,
+				"Not yet implemented for this rendersystem.",
+				"HardwarePixelBuffer::getRenderTarget");
+    }
+
+    //-----------------------------------------------------------------------------    
+    
+    HardwarePixelBufferSharedPtr::HardwarePixelBufferSharedPtr(HardwarePixelBuffer* buf)
+        : SharedPtr<HardwarePixelBuffer>(buf)
+    {
+
+    }   
+	//-----------------------------------------------------------------------------    
+
+	void HardwarePixelBuffer::_clearSliceRTT(size_t zoffset)
+	{
+	}
+
+};
Index: /OgreMain/src/OgreHardwareVertexBuffer.cpp
===================================================================
--- /OgreMain/src/OgreHardwareVertexBuffer.cpp	(revision 5)
+++ /OgreMain/src/OgreHardwareVertexBuffer.cpp	(revision 5)
@@ -0,0 +1,680 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreColourValue.h"
+#include "OgreException.h"
+#include "OgreStringConverter.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreDefaultHardwareBufferManager.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------------
+    HardwareVertexBuffer::HardwareVertexBuffer(size_t vertexSize,  
+        size_t numVertices, HardwareBuffer::Usage usage, 
+        bool useSystemMemory, bool useShadowBuffer) 
+        : HardwareBuffer(usage, useSystemMemory, useShadowBuffer), 
+          mNumVertices(numVertices),
+          mVertexSize(vertexSize)
+    {
+        // Calculate the size of the vertices
+        mSizeInBytes = mVertexSize * numVertices;
+
+        // Create a shadow buffer if required
+        if (mUseShadowBuffer)
+        {
+            mpShadowBuffer = new DefaultHardwareVertexBuffer(mVertexSize, 
+                    mNumVertices, HardwareBuffer::HBU_DYNAMIC);
+        }
+
+    }
+    //-----------------------------------------------------------------------------
+    HardwareVertexBuffer::~HardwareVertexBuffer()
+    {
+		HardwareBufferManager* mgr = HardwareBufferManager::getSingletonPtr();
+		if (mgr)
+		{
+			mgr->_notifyVertexBufferDestroyed(this);
+		}
+        if (mpShadowBuffer)
+        {
+            delete mpShadowBuffer;
+        }
+    }
+    //-----------------------------------------------------------------------------
+    VertexElement::VertexElement(unsigned short source, size_t offset, 
+        VertexElementType theType, VertexElementSemantic semantic, unsigned short index)
+        : mSource(source), mOffset(offset), mType(theType), 
+        mSemantic(semantic), mIndex(index)
+    {
+    }
+    //-----------------------------------------------------------------------------
+	size_t VertexElement::getSize(void) const
+	{
+		return getTypeSize(mType);
+	}
+	//-----------------------------------------------------------------------------
+	size_t VertexElement::getTypeSize(VertexElementType etype)
+	{
+		switch(etype)
+		{
+		case VET_COLOUR:
+		case VET_COLOUR_ABGR:
+		case VET_COLOUR_ARGB:
+			return sizeof(RGBA);
+		case VET_FLOAT1:
+			return sizeof(float);
+		case VET_FLOAT2:
+			return sizeof(float)*2;
+		case VET_FLOAT3:
+			return sizeof(float)*3;
+		case VET_FLOAT4:
+			return sizeof(float)*4;
+		case VET_SHORT1:
+			return sizeof(short);
+		case VET_SHORT2:
+			return sizeof(short)*2;
+		case VET_SHORT3:
+			return sizeof(short)*3;
+		case VET_SHORT4:
+			return sizeof(short)*4;
+        case VET_UBYTE4:
+            return sizeof(unsigned char)*4;
+		}
+		return 0;
+	}
+	//-----------------------------------------------------------------------------
+	unsigned short VertexElement::getTypeCount(VertexElementType etype)
+	{
+		switch (etype)
+		{
+		case VET_COLOUR:
+		case VET_COLOUR_ABGR:
+		case VET_COLOUR_ARGB:
+			return 1;
+		case VET_FLOAT1:
+			return 1;
+		case VET_FLOAT2:
+			return 2;
+		case VET_FLOAT3:
+			return 3;
+		case VET_FLOAT4:
+			return 4;
+		case VET_SHORT1:
+			return 1;
+		case VET_SHORT2:
+			return 2;
+		case VET_SHORT3:
+			return 3;
+		case VET_SHORT4:
+			return 4;
+        case VET_UBYTE4:
+            return 4;
+		}
+		OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Invalid type", 
+			"VertexElement::getTypeCount");
+	}
+	//-----------------------------------------------------------------------------
+	VertexElementType VertexElement::multiplyTypeCount(VertexElementType baseType, 
+		unsigned short count)
+	{
+		switch (baseType)
+		{
+		case VET_FLOAT1:
+			switch(count)
+			{
+			case 1:
+				return VET_FLOAT1;
+			case 2:
+				return VET_FLOAT2;
+			case 3:
+				return VET_FLOAT3;
+			case 4:
+				return VET_FLOAT4;
+            default:
+                break;
+			}
+			break;
+		case VET_SHORT1:
+			switch(count)
+			{
+			case 1:
+				return VET_SHORT1;
+			case 2:
+				return VET_SHORT2;
+			case 3:
+				return VET_SHORT3;
+			case 4:
+				return VET_SHORT4;
+            default:
+                break;
+			}
+			break;
+        default:
+            break;
+		}
+		OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Invalid base type", 
+			"VertexElement::multiplyTypeCount");
+	}
+	//--------------------------------------------------------------------------
+	VertexElementType VertexElement::getBestColourVertexElementType(void)
+	{
+		// Use the current render system to determine if possible
+		if (Root::getSingletonPtr() && Root::getSingletonPtr()->getRenderSystem())
+		{
+			return Root::getSingleton().getRenderSystem()->getColourVertexElementType();
+		}
+		else
+		{
+			// We can't know the specific type right now, so pick a type
+			// based on platform
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+			return VET_COLOUR_ARGB; // prefer D3D format on windows
+#else
+			return VET_COLOUR_ABGR; // prefer GL format on everything else
+#endif
+
+		}
+	}
+	//--------------------------------------------------------------------------
+	void VertexElement::convertColourValue(VertexElementType srcType, 
+		VertexElementType dstType, uint32* ptr)
+	{
+		if (srcType == dstType)
+			return;
+
+		// Conversion between ARGB and ABGR is always a case of flipping R/B
+		*ptr = 
+		   ((*ptr&0x00FF0000)>>16)|((*ptr&0x000000FF)<<16)|(*ptr&0xFF00FF00);				
+	}
+	//--------------------------------------------------------------------------
+	uint32 VertexElement::convertColourValue(const ColourValue& src, 
+		VertexElementType dst)
+	{
+		switch(dst)
+		{
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        default:
+#endif
+		case VET_COLOUR_ARGB:
+			return src.getAsARGB();
+#if OGRE_PLATFORM != OGRE_PLATFORM_WIN32
+        default:
+#endif
+		case VET_COLOUR_ABGR: 
+			return src.getAsABGR();
+		};
+
+	}
+	//-----------------------------------------------------------------------------
+	VertexElementType VertexElement::getBaseType(VertexElementType multiType)
+	{
+		switch (multiType)
+		{
+			case VET_FLOAT1:
+			case VET_FLOAT2:
+			case VET_FLOAT3:
+			case VET_FLOAT4:
+				return VET_FLOAT1;
+			case VET_COLOUR:
+				return VET_COLOUR;
+			case VET_COLOUR_ABGR:
+				return VET_COLOUR_ABGR;
+			case VET_COLOUR_ARGB:
+				return VET_COLOUR_ARGB;
+			case VET_SHORT1:
+			case VET_SHORT2:
+			case VET_SHORT3:
+			case VET_SHORT4:
+				return VET_SHORT1;
+			case VET_UBYTE4:
+				return VET_UBYTE4;
+		};
+        // To keep compiler happy
+        return VET_FLOAT1;
+	}
+	//-----------------------------------------------------------------------------
+    VertexDeclaration::VertexDeclaration()
+    {
+    }
+    //-----------------------------------------------------------------------------
+    VertexDeclaration::~VertexDeclaration()
+    {
+    }
+    //-----------------------------------------------------------------------------
+    const VertexDeclaration::VertexElementList& VertexDeclaration::getElements(void) const
+    {
+        return mElementList;
+    }
+    //-----------------------------------------------------------------------------
+    const VertexElement& VertexDeclaration::addElement(unsigned short source, 
+        size_t offset, VertexElementType theType,
+        VertexElementSemantic semantic, unsigned short index)
+    {
+		// Refine colour type to a specific type
+		if (theType == VET_COLOUR)
+		{
+			theType = VertexElement::getBestColourVertexElementType();
+		}
+        mElementList.push_back(
+            VertexElement(source, offset, theType, semantic, index)
+            );
+		return mElementList.back();
+    }
+    //-----------------------------------------------------------------------------
+    const VertexElement& VertexDeclaration::insertElement(unsigned short atPosition,
+        unsigned short source, size_t offset, VertexElementType theType,
+        VertexElementSemantic semantic, unsigned short index)
+    {
+        if (atPosition >= mElementList.size())
+        {
+            return addElement(source, offset, theType, semantic, index);
+        }
+
+        VertexElementList::iterator i = mElementList.begin();
+        for (unsigned short n = 0; n < atPosition; ++n)
+            ++i;
+
+        i = mElementList.insert(i, 
+            VertexElement(source, offset, theType, semantic, index));
+        return *i;
+
+    }
+    //-----------------------------------------------------------------------------
+    const VertexElement* VertexDeclaration::getElement(unsigned short index)
+    {
+        assert(index < mElementList.size() && "Index out of bounds");
+
+        VertexElementList::iterator i = mElementList.begin();
+        for (unsigned short n = 0; n < index; ++n)
+            ++i;
+
+        return &(*i);
+
+    }
+    //-----------------------------------------------------------------------------
+    void VertexDeclaration::removeElement(unsigned short elem_index)
+    {
+        assert(elem_index < mElementList.size() && "Index out of bounds");
+        VertexElementList::iterator i = mElementList.begin();
+        for (unsigned short n = 0; n < elem_index; ++n)
+            ++i;
+        mElementList.erase(i);
+    }
+    //-----------------------------------------------------------------------------
+    void VertexDeclaration::removeElement(VertexElementSemantic semantic, unsigned short index)
+    {
+		VertexElementList::iterator ei, eiend;
+		eiend = mElementList.end();
+		for (ei = mElementList.begin(); ei != eiend; ++ei)
+		{
+			if (ei->getSemantic() == semantic && ei->getIndex() == index)
+			{
+				mElementList.erase(ei);
+                break;
+			}
+		}
+    }
+	//-----------------------------------------------------------------------------
+	void VertexDeclaration::removeAllElements(void)
+	{
+		mElementList.clear();
+	}
+    //-----------------------------------------------------------------------------
+    void VertexDeclaration::modifyElement(unsigned short elem_index, 
+        unsigned short source, size_t offset, VertexElementType theType,
+        VertexElementSemantic semantic, unsigned short index)
+    {
+        assert(elem_index < mElementList.size() && "Index out of bounds");
+        VertexElementList::iterator i = mElementList.begin();
+        std::advance(i, elem_index);
+        (*i) = VertexElement(source, offset, theType, semantic, index);
+    }
+    //-----------------------------------------------------------------------------
+	const VertexElement* VertexDeclaration::findElementBySemantic(
+		VertexElementSemantic sem, unsigned short index)
+	{
+		VertexElementList::const_iterator ei, eiend;
+		eiend = mElementList.end();
+		for (ei = mElementList.begin(); ei != eiend; ++ei)
+		{
+			if (ei->getSemantic() == sem && ei->getIndex() == index)
+			{
+				return &(*ei);
+			}
+		}
+
+		return NULL;
+
+
+	}
+	//-----------------------------------------------------------------------------
+	VertexDeclaration::VertexElementList VertexDeclaration::findElementsBySource(
+		unsigned short source)
+	{
+		VertexElementList retList;
+		VertexElementList::const_iterator ei, eiend;
+		eiend = mElementList.end();
+		for (ei = mElementList.begin(); ei != eiend; ++ei)
+		{
+			if (ei->getSource() == source)
+			{
+				retList.push_back(*ei);
+			}
+		}
+		return retList;
+
+	}
+
+	//-----------------------------------------------------------------------------
+	size_t VertexDeclaration::getVertexSize(unsigned short source)
+	{
+		VertexElementList::const_iterator i, iend;
+		iend = mElementList.end();
+		size_t sz = 0;
+
+		for (i = mElementList.begin(); i != iend; ++i)
+		{
+			if (i->getSource() == source)
+			{
+				sz += i->getSize();
+
+			}
+		}
+		return sz;
+	}
+    //-----------------------------------------------------------------------------
+    VertexDeclaration* VertexDeclaration::clone(void)
+    {
+        VertexDeclaration* ret = HardwareBufferManager::getSingleton().createVertexDeclaration();
+
+		VertexElementList::const_iterator i, iend;
+		iend = mElementList.end();
+		for (i = mElementList.begin(); i != iend; ++i)
+		{
+            ret->addElement(i->getSource(), i->getOffset(), i->getType(), i->getSemantic(), i->getIndex());
+        }
+        return ret;
+    }
+    //-----------------------------------------------------------------------------
+    // Sort routine for VertexElement
+    bool VertexDeclaration::vertexElementLess(const VertexElement& e1, const VertexElement& e2)
+    {
+        // Sort by source first
+        if (e1.getSource() < e2.getSource())
+        {
+            return true;
+        }
+        else if (e1.getSource() == e2.getSource())
+        {
+            // Use ordering of semantics to sort
+            if (e1.getSemantic() < e2.getSemantic())
+            {
+                return true;
+            }
+            else if (e1.getSemantic() == e2.getSemantic())
+            {
+                // Use index to sort
+                if (e1.getIndex() < e2.getIndex())
+                {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+    void VertexDeclaration::sort(void)
+    {
+        mElementList.sort(VertexDeclaration::vertexElementLess);
+    }
+    //-----------------------------------------------------------------------------
+    void VertexDeclaration::closeGapsInSource(void)
+    {
+        if (mElementList.empty())
+            return;
+
+        // Sort first
+        sort();
+
+        VertexElementList::iterator i, iend;
+        iend = mElementList.end();
+        unsigned short targetIdx = 0;
+        unsigned short lastIdx = getElement(0)->getSource();
+        unsigned short c = 0;
+        for (i = mElementList.begin(); i != iend; ++i, ++c)
+        {
+            VertexElement& elem = *i;
+            if (lastIdx != elem.getSource())
+            {
+                targetIdx++;
+                lastIdx = elem.getSource();
+            }
+            if (targetIdx != elem.getSource())
+            {
+                modifyElement(c, targetIdx, elem.getOffset(), elem.getType(), 
+                    elem.getSemantic(), elem.getIndex());
+            }
+
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    VertexDeclaration* VertexDeclaration::getAutoOrganisedDeclaration(
+		bool skeletalAnimation, bool vertexAnimation)
+    {
+        VertexDeclaration* newDecl = this->clone();
+        // Set all sources to the same buffer (for now)
+        const VertexDeclaration::VertexElementList& elems = newDecl->getElements();
+        VertexDeclaration::VertexElementList::const_iterator i;
+        unsigned short c = 0;
+        for (i = elems.begin(); i != elems.end(); ++i, ++c)
+        {
+            const VertexElement& elem = *i;
+            // Set source & offset to 0 for now, before sort
+            newDecl->modifyElement(c, 0, 0, elem.getType(), elem.getSemantic(), elem.getIndex());
+        }
+        newDecl->sort();
+        // Now sort out proper buffer assignments and offsets
+        size_t offset = 0;
+        c = 0;
+		unsigned short buffer = 0;
+        VertexElementSemantic prevSemantic = VES_POSITION;
+        for (i = elems.begin(); i != elems.end(); ++i, ++c)
+        {
+            const VertexElement& elem = *i;
+
+            bool splitWithPrev = false;
+            bool splitWithNext = false;
+            switch (elem.getSemantic())
+            {
+            case VES_POSITION:
+                // For morph animation, we need positions on their own
+                splitWithPrev = vertexAnimation;
+                splitWithNext = vertexAnimation;
+                break;
+            case VES_NORMAL:
+                // Normals can't sharing with blend weights/indices
+                splitWithPrev = (prevSemantic == VES_BLEND_WEIGHTS || prevSemantic == VES_BLEND_INDICES);
+                // All animated meshes have to split after normal
+                splitWithNext = (skeletalAnimation || vertexAnimation);
+                break;
+            case VES_BLEND_WEIGHTS:
+                // Blend weights/indices can be sharing with their own buffer only
+                splitWithPrev = true;
+                break;
+            case VES_BLEND_INDICES:
+                // Blend weights/indices can be sharing with their own buffer only
+                splitWithNext = true;
+                break;
+            }
+
+            if (splitWithPrev && offset)
+            {
+                ++buffer;
+                offset = 0;
+            }
+
+            prevSemantic = elem.getSemantic();
+            newDecl->modifyElement(c, buffer, offset,
+                elem.getType(), elem.getSemantic(), elem.getIndex());
+
+            if (splitWithNext)
+            {
+                ++buffer;
+                offset = 0;
+            }
+            else
+            {
+                offset += elem.getSize();
+            }
+        }
+
+        return newDecl;
+
+
+    }
+    //-----------------------------------------------------------------------------
+    unsigned short VertexDeclaration::getMaxSource(void) const
+    {
+        VertexElementList::const_iterator i, iend;
+        iend = mElementList.end();
+        unsigned short ret = 0;
+        for (i = mElementList.begin(); i != iend; ++i)
+        {
+            if (i->getSource() > ret)
+            {
+                ret = i->getSource();
+            }
+
+        }
+        return ret;
+    }
+    //-----------------------------------------------------------------------------
+	VertexBufferBinding::VertexBufferBinding() : mHighIndex(0)
+	{
+	}
+    //-----------------------------------------------------------------------------
+	VertexBufferBinding::~VertexBufferBinding()
+	{
+        unsetAllBindings();
+	}
+    //-----------------------------------------------------------------------------
+	void VertexBufferBinding::setBinding(unsigned short index, const HardwareVertexBufferSharedPtr& buffer)
+	{
+        // NB will replace any existing buffer ptr at this index, and will thus cause
+        // reference count to decrement on that buffer (possibly destroying it)
+		mBindingMap[index] = buffer;
+		mHighIndex = std::max(mHighIndex, (unsigned short)(index+1));
+	}
+    //-----------------------------------------------------------------------------
+	void VertexBufferBinding::unsetBinding(unsigned short index)
+	{
+		VertexBufferBindingMap::iterator i = mBindingMap.find(index);
+		if (i == mBindingMap.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+				"Cannot find buffer binding for index " + StringConverter::toString(index),
+				"VertexBufferBinding::unsetBinding");
+		}
+		mBindingMap.erase(i);
+	}
+    //-----------------------------------------------------------------------------
+    void VertexBufferBinding::unsetAllBindings(void)
+    {
+        mBindingMap.clear();
+        mHighIndex = 0;
+    }
+    //-----------------------------------------------------------------------------
+	const VertexBufferBinding::VertexBufferBindingMap& 
+	VertexBufferBinding::getBindings(void) const
+	{
+		return mBindingMap;
+	}
+    //-----------------------------------------------------------------------------
+	const HardwareVertexBufferSharedPtr& VertexBufferBinding::getBuffer(unsigned short index) const
+	{
+		VertexBufferBindingMap::const_iterator i = mBindingMap.find(index);
+		if (i == mBindingMap.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "No buffer is bound to that index.",
+				"VertexBufferBinding::getBuffer");
+		}
+		return i->second;
+	}
+	//-----------------------------------------------------------------------------
+	bool VertexBufferBinding::isBufferBound(unsigned short index) const
+	{
+		return mBindingMap.find(index) != mBindingMap.end();
+	}
+    //-----------------------------------------------------------------------------
+    unsigned short VertexBufferBinding::getLastBoundIndex(void) const
+    {
+        return mBindingMap.empty() ? 0 : mBindingMap.rbegin()->first + 1;
+    }
+    //-----------------------------------------------------------------------------
+    bool VertexBufferBinding::hasGaps(void) const
+    {
+        if (mBindingMap.empty())
+            return false;
+        if (mBindingMap.rbegin()->first + 1 == mBindingMap.size())
+            return false;
+        return true;
+    }
+    //-----------------------------------------------------------------------------
+    void VertexBufferBinding::closeGaps(BindingIndexMap& bindingIndexMap)
+    {
+        bindingIndexMap.clear();
+
+        VertexBufferBindingMap newBindingMap;
+
+        VertexBufferBindingMap::const_iterator it;
+        ushort targetIndex = 0;
+        for (it = mBindingMap.begin(); it != mBindingMap.end(); ++it, ++targetIndex)
+        {
+            bindingIndexMap[it->first] = targetIndex;
+            newBindingMap[targetIndex] = it->second;
+        }
+
+        mBindingMap.swap(newBindingMap);
+        mHighIndex = targetIndex;
+    }
+    //-----------------------------------------------------------------------------
+    HardwareVertexBufferSharedPtr::HardwareVertexBufferSharedPtr(HardwareVertexBuffer* buf)
+        : SharedPtr<HardwareVertexBuffer>(buf)
+    {
+
+    }
+
+
+
+
+}
Index: /OgreMain/src/OgreHighLevelGpuProgram.cpp
===================================================================
--- /OgreMain/src/OgreHighLevelGpuProgram.cpp	(revision 5)
+++ /OgreMain/src/OgreHighLevelGpuProgram.cpp	(revision 5)
@@ -0,0 +1,208 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreHighLevelGpuProgram.h"
+#include "OgreException.h"
+#include "OgreGpuProgramManager.h"
+#include "OgreLogManager.h"
+
+namespace Ogre
+{
+    //---------------------------------------------------------------------------
+    HighLevelGpuProgram::HighLevelGpuProgram(ResourceManager* creator, 
+        const String& name, ResourceHandle handle, const String& group, 
+        bool isManual, ManualResourceLoader* loader)
+        : GpuProgram(creator, name, handle, group, isManual, loader), 
+        mHighLevelLoaded(false), mAssemblerProgram(0), mConstantDefsBuilt(false)
+    {
+    }
+    //---------------------------------------------------------------------------
+    void HighLevelGpuProgram::loadImpl()
+    {
+		if (isSupported())
+		{
+			// load self 
+			loadHighLevel();
+
+			// create low-level implementation
+			createLowLevelImpl();
+			// load constructed assembler program (if it exists)
+			if (!mAssemblerProgram.isNull())
+			{
+				mAssemblerProgram->load();
+			}
+		}
+    }
+    //---------------------------------------------------------------------------
+    void HighLevelGpuProgram::unloadImpl()
+    {   
+        if (!mAssemblerProgram.isNull())
+        {
+            mAssemblerProgram->getCreator()->remove(mAssemblerProgram->getHandle());
+            mAssemblerProgram.setNull();
+        }
+
+        unloadHighLevel();
+    }
+    //---------------------------------------------------------------------------
+    HighLevelGpuProgram::~HighLevelGpuProgram()
+    {
+        // superclasses will trigger unload
+    }
+    //---------------------------------------------------------------------------
+    GpuProgramParametersSharedPtr HighLevelGpuProgram::createParameters(void)
+    {
+		// Lock mutex before allowing this since this is a top-level method
+		// called outside of the load()
+		OGRE_LOCK_AUTO_MUTEX
+
+        // Make sure param defs are loaded
+        GpuProgramParametersSharedPtr params = GpuProgramManager::getSingleton().createParameters();
+		// Only populate named parameters if we can support this program
+		if (this->isSupported())
+		{
+			loadHighLevel();
+			// Errors during load may have prevented compile
+			if (this->isSupported())
+			{
+				populateParameterNames(params);
+			}
+		}
+		// Copy in default parameters if present
+		if (!mDefaultParams.isNull())
+			params->copyConstantsFrom(*(mDefaultParams.get()));
+        return params;
+    }
+    //---------------------------------------------------------------------------
+    void HighLevelGpuProgram::loadHighLevel(void)
+    {
+        if (!mHighLevelLoaded)
+        {
+			try 
+			{
+				loadHighLevelImpl();
+				mHighLevelLoaded = true;
+			}
+			catch (const Exception& e)
+			{
+				// will already have been logged
+				StringUtil::StrStreamType str;
+				str << "High-level program " << mName << " encountered an error "
+					<< "during loading and is thus not supported."
+					<< "\n"
+					<< e.getFullDescription();
+				LogManager::getSingleton().logMessage(str.str());
+
+				mCompileError = true;
+			}
+        }
+    }
+    //---------------------------------------------------------------------------
+    void HighLevelGpuProgram::unloadHighLevel(void)
+    {
+        if (mHighLevelLoaded)
+        {
+            unloadHighLevelImpl();
+			// Clear saved constant defs
+			mConstantDefs.map.clear();
+			mConstantDefs.floatBufferSize = 0;
+			mConstantDefs.intBufferSize = 0;
+			mConstantDefsBuilt = false;
+			mFloatLogicalToPhysical.map.clear();
+			mFloatLogicalToPhysical.bufferSize = 0;
+			mIntLogicalToPhysical.map.clear();
+			mIntLogicalToPhysical.bufferSize = 0;
+
+            mHighLevelLoaded = false;
+        }
+    }
+    //---------------------------------------------------------------------------
+    void HighLevelGpuProgram::loadHighLevelImpl(void)
+    {
+        if (mLoadFromFile)
+        {
+            // find & load source code
+            DataStreamPtr stream = 
+                ResourceGroupManager::getSingleton().openResource(
+                    mFilename, mGroup, true, this);
+
+            mSource = stream->getAsString();
+        }
+
+        loadFromSource();
+    }
+	//---------------------------------------------------------------------
+	const GpuNamedConstants& HighLevelGpuProgram::getConstantDefinitions() const
+	{
+		if (!mConstantDefsBuilt)
+		{
+			buildConstantDefinitions();
+			mConstantDefsBuilt = true;
+		}
+		return mConstantDefs;
+
+	}
+	//---------------------------------------------------------------------
+	void HighLevelGpuProgram::populateParameterNames(GpuProgramParametersSharedPtr params)
+	{
+		params->_setNamedConstants(&getConstantDefinitions());
+		// also set logical / physical maps for programs which use this
+		params->_setLogicalIndexes(&mFloatLogicalToPhysical, &mIntLogicalToPhysical);
+	}
+	//-----------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	HighLevelGpuProgramPtr& HighLevelGpuProgramPtr::operator=(const GpuProgramPtr& r)
+	{
+		// Can assign direct
+		if (pRep == static_cast<HighLevelGpuProgram*>(r.getPointer()))
+			return *this;
+		release();
+		// lock & copy other mutex pointer
+        OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+        {
+		    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+		    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+		    pRep = static_cast<HighLevelGpuProgram*>(r.getPointer());
+		    pUseCount = r.useCountPointer();
+		    if (pUseCount)
+		    {
+			    ++(*pUseCount);
+		    }
+        }
+		else
+		{
+			// RHS must be a null pointer
+			assert(r.isNull() && "RHS must be null if it has no mutex!");
+			setNull();
+		}
+		return *this;
+	}
+
+
+}
Index: /OgreMain/src/OgreHighLevelGpuProgramManager.cpp
===================================================================
--- /OgreMain/src/OgreHighLevelGpuProgramManager.cpp	(revision 5)
+++ /OgreMain/src/OgreHighLevelGpuProgramManager.cpp	(revision 5)
@@ -0,0 +1,202 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreHighLevelGpuProgramManager.h"
+#include "OgreUnifiedHighLevelGpuProgram.h"
+
+namespace Ogre {
+
+	String sNullLang = "null";
+	class NullProgram : public HighLevelGpuProgram
+	{
+	protected:
+		/** Internal load implementation, must be implemented by subclasses.
+		*/
+		void loadFromSource(void) {}
+		/** Internal method for creating an appropriate low-level program from this
+		high-level program, must be implemented by subclasses. */
+		void createLowLevelImpl(void) {}
+		/// Internal unload implementation, must be implemented by subclasses
+		void unloadHighLevelImpl(void) {}
+		/// Populate the passed parameters with name->index map, must be overridden
+		void populateParameterNames(GpuProgramParametersSharedPtr params)
+		{
+			// Skip the normal implementation
+			// Ensure we don't complain about missing parameter names
+			params->setIgnoreMissingParams(true);
+
+		}
+		void buildConstantDefinitions() const
+		{
+			// do nothing
+		}
+	public:
+		NullProgram(ResourceManager* creator, 
+			const String& name, ResourceHandle handle, const String& group, 
+			bool isManual, ManualResourceLoader* loader)
+			: HighLevelGpuProgram(creator, name, handle, group, isManual, loader){}
+		~NullProgram() {}
+		/// Overridden from GpuProgram - never supported
+		bool isSupported(void) const { return false; }
+		/// Overridden from GpuProgram
+		const String& getLanguage(void) const { return sNullLang; }
+
+		/// Overridden from StringInterface
+		bool setParameter(const String& name, const String& value)
+		{
+			// always silently ignore all parameters so as not to report errors on
+			// unsupported platforms
+			return true;
+		}
+
+	};
+	class NullProgramFactory : public HighLevelGpuProgramFactory
+	{
+	public:
+		NullProgramFactory() {}
+		~NullProgramFactory() {}
+		/// Get the name of the language this factory creates programs for
+		const String& getLanguage(void) const 
+		{ 
+			return sNullLang;
+		}
+		HighLevelGpuProgram* create(ResourceManager* creator, 
+			const String& name, ResourceHandle handle,
+			const String& group, bool isManual, ManualResourceLoader* loader)
+		{
+			return new NullProgram(creator, name, handle, group, isManual, loader);
+		}
+		void destroy(HighLevelGpuProgram* prog)
+		{
+			delete prog;
+		}
+
+	};
+	//-----------------------------------------------------------------------
+	template<> HighLevelGpuProgramManager* 
+	Singleton<HighLevelGpuProgramManager>::ms_Singleton = 0;
+    HighLevelGpuProgramManager* HighLevelGpuProgramManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    HighLevelGpuProgramManager& HighLevelGpuProgramManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+	//-----------------------------------------------------------------------
+	HighLevelGpuProgramManager::HighLevelGpuProgramManager()
+	{
+        // Loading order
+        mLoadOrder = 50.0f;
+        // Resource type
+        mResourceType = "HighLevelGpuProgram";
+
+        ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);    
+
+		mNullFactory = new NullProgramFactory();
+		addFactory(mNullFactory);
+		mUnifiedFactory = new UnifiedHighLevelGpuProgramFactory();
+		addFactory(mUnifiedFactory);
+	}
+	//-----------------------------------------------------------------------
+	HighLevelGpuProgramManager::~HighLevelGpuProgramManager()
+	{
+		delete mUnifiedFactory;
+		delete mNullFactory;
+        ResourceGroupManager::getSingleton()._unregisterResourceManager(mResourceType);    
+	}
+    //---------------------------------------------------------------------------
+	void HighLevelGpuProgramManager::addFactory(HighLevelGpuProgramFactory* factory)
+	{
+		// deliberately allow later plugins to override earlier ones
+		mFactories[factory->getLanguage()] = factory;
+	}
+    //---------------------------------------------------------------------------
+    void HighLevelGpuProgramManager::removeFactory(HighLevelGpuProgramFactory* factory)
+    {
+        // Remove only if equal to registered one, since it might overridden
+        // by other plugins
+        FactoryMap::iterator it = mFactories.find(factory->getLanguage());
+        if (it != mFactories.end() && it->second == factory)
+        {
+            mFactories.erase(it);
+        }
+    }
+    //---------------------------------------------------------------------------
+	HighLevelGpuProgramFactory* HighLevelGpuProgramManager::getFactory(const String& language)
+	{
+		FactoryMap::iterator i = mFactories.find(language);
+
+		if (i == mFactories.end())
+		{
+			// use the null factory to create programs that will never be supported
+			i = mFactories.find(sNullLang);
+		}
+		return i->second;
+	}
+    //---------------------------------------------------------------------------
+    Resource* HighLevelGpuProgramManager::createImpl(const String& name, ResourceHandle handle, 
+        const String& group, bool isManual, ManualResourceLoader* loader,
+        const NameValuePairList* params)
+    {
+        NameValuePairList::const_iterator paramIt;
+
+        if (!params || (paramIt = params->find("language")) == params->end())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+                "You must supply a 'language' parameter",
+                "HighLevelGpuProgramManager::createImpl");
+        }
+
+        return getFactory(paramIt->second)->create(this, name, getNextHandle(), 
+            group, isManual, loader);
+    }
+    //---------------------------------------------------------------------------
+    HighLevelGpuProgramPtr HighLevelGpuProgramManager::createProgram(
+			const String& name, const String& groupName, 
+            const String& language, GpuProgramType gptype)
+    {
+        ResourcePtr ret = ResourcePtr(
+            getFactory(language)->create(this, name, getNextHandle(), 
+            groupName, false, 0));
+
+        HighLevelGpuProgramPtr prg = ret;
+        prg->setType(gptype);
+        prg->setSyntaxCode(language);
+
+        addImpl(ret);
+        // Tell resource group manager
+        ResourceGroupManager::getSingleton()._notifyResourceCreated(ret);
+        return prg;
+    }
+    //---------------------------------------------------------------------------
+    HighLevelGpuProgramFactory::~HighLevelGpuProgramFactory() 
+    {
+    }
+}
Index: /OgreMain/src/OgreILCodecs.cpp
===================================================================
--- /OgreMain/src/OgreILCodecs.cpp	(revision 5)
+++ /OgreMain/src/OgreILCodecs.cpp	(revision 5)
@@ -0,0 +1,215 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include <OgreStableHeaders.h>
+
+#include <OgreImage.h>
+#include <OgreCodec.h>
+#include <OgreException.h>
+#include <OgreLogManager.h>
+#include <OgreStringConverter.h>
+#include "OgreILImageCodec.h"
+#include "OgreILCodecs.h"
+
+#include <IL/il.h>
+#include <IL/ilu.h>
+
+namespace Ogre {
+    std::list<ILImageCodec*> ILCodecs::codeclist;
+
+	// Return IL type for a certain extension
+	ILenum ogreIlTypeFromExt(const String &ext)
+	{
+#ifdef IL_TGA
+		if (ext=="tga" || ext=="vda" ||
+			ext=="icb" || ext=="vst")
+			return IL_TGA;
+#endif
+#ifdef IL_JPG
+		if (ext=="jpg" || ext=="jpe" || ext=="jpeg")
+			return IL_JPG;
+#endif
+/*#ifdef IL_DDS
+		if (ext=="dds")
+			return IL_DDS;
+#endif*/
+#ifdef IL_PNG
+		if (ext=="png")
+			return IL_PNG;
+#endif
+#ifdef IL_BMP
+		if (ext=="bmp" || ext=="dib")
+			return IL_BMP;
+#endif
+#ifdef IL_GIF
+		if (ext=="gif")
+			return IL_GIF;
+#endif
+#ifdef IL_CUT
+		if (ext=="cut")
+			return IL_CUT;
+#endif
+#ifdef IL_HDR
+		if (ext=="hdr")
+			return IL_HDR;
+#endif
+#ifdef IL_ICO
+		if (ext=="ico" || ext=="cur")
+			return IL_ICO;
+#endif
+#ifdef IL_JNG
+		if (ext=="jng")
+			return IL_JNG;
+#endif
+#ifdef IL_LIF
+		if (ext=="lif")
+			return IL_LIF;
+#endif
+#ifdef IL_MDL
+		if (ext=="mdl")
+			return IL_MDL;
+#endif
+#ifdef IL_MNG
+		if (ext=="mng" || ext=="jng")
+			return IL_MNG;
+#endif
+#ifdef IL_PCD
+		if (ext=="pcd")
+			return IL_PCD;
+#endif
+#ifdef IL_PCX
+		if (ext=="pcx")
+			return IL_PCX;
+#endif
+#ifdef IL_PIC
+		if (ext=="pic")
+			return IL_PIC;
+#endif
+#ifdef IL_PIX
+		if (ext=="pix")
+			return IL_PIX;
+#endif
+#ifdef IL_PNM
+		if (ext=="pbm" || ext=="pgm" ||
+			ext=="pnm" || ext=="ppm")
+			return IL_PNM;
+#endif
+#ifdef IL_PSD
+		if (ext=="psd" || ext=="pdd")
+			return IL_PSD;
+#endif
+#ifdef IL_PSP
+		if (ext=="psp")
+			return IL_PSP;
+#endif
+#ifdef IL_PXR
+		if (ext=="pxr")
+			return IL_PXR;
+#endif
+#ifdef IL_SGI
+		if (ext=="sgi" || ext=="bw" ||
+			ext=="rgb" || ext=="rgba")
+			return IL_SGI;
+#endif
+#ifdef IL_TIF
+		if (ext=="tif" || ext=="tiff")
+			return IL_TIF;
+#endif
+#ifdef IL_WAL
+		if (ext=="wal")
+			return IL_WAL;
+#endif
+#ifdef IL_XPM
+		if (ext=="xpm")
+			return IL_XPM;
+#endif
+	
+		return IL_TYPE_UNKNOWN;
+	}
+
+	
+    void ILCodecs::registerCodecs(void) {
+		const char *il_version = ilGetString ( IL_VERSION_NUM );
+		if( ilGetError() != IL_NO_ERROR )
+		{
+			// IL defined the version number as IL_VERSION in older versions, so we have to scan for it
+			for(int ver=150; ver<170; ver++)
+			{
+				il_version = ilGetString ( ver ); 
+				if(ilGetError() == IL_NO_ERROR)
+					break;
+				else
+					il_version = "Unknown";
+			}
+		}
+		LogManager::getSingleton().logMessage(
+         LML_NORMAL,
+            "DevIL version: " + String(il_version));
+        const char *il_extensions = ilGetString ( IL_LOAD_EXT );
+		if( ilGetError() != IL_NO_ERROR )
+			il_extensions = "";
+        
+        std::stringstream ext;
+        String str, all;
+        ext << il_extensions;
+        while(ext >> str)
+        {
+#if 0
+			String fileName = "dummy." + str;
+			// DevIL doesn't export this under windows -- how weird
+			int ilType = ilTypeFromext(const_cast<char*>(fileName.c_str()));
+#endif
+			int ilType = ogreIlTypeFromExt(str);
+            ILImageCodec *codec = new ILImageCodec(str, ilType);
+            Codec::registerCodec(codec);
+            codeclist.push_back(codec);
+			//all += str+String("(")+StringConverter::toString(ilType)+String(") ");
+			all += str+String(" ");
+        }
+		// Raw format, missing in image formats string
+		ILImageCodec *cod = new ILImageCodec("raw", IL_RAW);
+		Codec::registerCodec(cod);
+		codeclist.push_back(cod);
+		//all += String("raw")+"("+StringConverter::toString(IL_RAW)+String(") ");
+		all += String("raw ");
+		LogManager::getSingleton().logMessage(
+         LML_NORMAL,
+            "DevIL image formats: " + all);
+    }
+
+    void ILCodecs::deleteCodecs(void) {
+        for(std::list<ILImageCodec*>::const_iterator i = codeclist.begin(); i != codeclist.end(); ++i)
+        {
+            Codec::unRegisterCodec(*i);   
+            delete *i;
+        }
+        codeclist.clear();
+    }
+
+}
+
Index: /OgreMain/src/OgreILImageCodec.cpp
===================================================================
--- /OgreMain/src/OgreILImageCodec.cpp	(revision 5)
+++ /OgreMain/src/OgreILImageCodec.cpp	(revision 5)
@@ -0,0 +1,288 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include <OgreStableHeaders.h>
+
+#include <OgreRoot.h>
+#include <OgreRenderSystem.h>
+#include "OgreILImageCodec.h"
+#include <OgreImage.h>
+#include <OgreException.h>
+#include "OgreILUtil.h"
+
+#include <OgreLogManager.h>
+#include <OgreStringConverter.h>
+
+#include <IL/il.h>
+#include <IL/ilu.h>
+
+namespace Ogre {
+
+    bool ILImageCodec::_is_initialised = false;    
+    //---------------------------------------------------------------------
+
+    ILImageCodec::ILImageCodec(const String &type, unsigned int ilType):
+        mType(type),
+        mIlType(ilType)
+    { 
+        initialiseIL();
+    }
+
+    //---------------------------------------------------------------------
+    DataStreamPtr ILImageCodec::code(MemoryDataStreamPtr& input, Codec::CodecDataPtr& pData) const
+    {        
+
+        OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "code to memory not implemented",
+            "ILCodec::code");
+
+
+    }
+    //---------------------------------------------------------------------
+    void ILImageCodec::codeToFile(MemoryDataStreamPtr& input, 
+        const String& outFileName, Codec::CodecDataPtr& pData) const
+    {
+
+        ILuint ImageName;
+
+        ilGenImages( 1, &ImageName );
+        ilBindImage( ImageName );
+
+		ImageData* pImgData = static_cast< ImageData * >( pData.getPointer() );
+		PixelBox src(pImgData->width, pImgData->height, pImgData->depth, pImgData->format, input->getPtr());
+
+		// Convert image from OGRE to current IL image
+		ILUtil::fromOgre(src);
+
+        iluFlipImage();
+
+        // Implicitly pick DevIL codec
+        ilSaveImage(const_cast< char * >( outFileName.c_str() ) );
+	
+        // Check if everything was ok
+        ILenum PossibleError = ilGetError() ;
+        if( PossibleError != IL_NO_ERROR ) {
+           ilDeleteImages(1, &ImageName);
+           OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED,
+                "IL Error, could not save file: " + outFileName,
+                iluErrorString(PossibleError) ) ;
+        }
+
+        ilDeleteImages(1, &ImageName);
+
+    }
+    //---------------------------------------------------------------------
+    Codec::DecodeResult ILImageCodec::decode(DataStreamPtr& input) const
+    {
+
+        // DevIL variables
+        ILuint ImageName;
+
+        ILint ImageFormat, BytesPerPixel, ImageType;
+        ImageData* imgData = new ImageData();
+        MemoryDataStreamPtr output;
+
+        // Load the image
+        ilGenImages( 1, &ImageName );
+        ilBindImage( ImageName );
+
+        // Put it right side up
+        ilEnable(IL_ORIGIN_SET);
+        ilSetInteger(IL_ORIGIN_MODE, IL_ORIGIN_UPPER_LEFT);
+
+        // Keep DXTC(compressed) data if present
+        ilSetInteger(IL_KEEP_DXTC_DATA, IL_TRUE);
+
+        // Load image from stream, cache into memory
+        MemoryDataStream memInput(input);
+        ilLoadL( 
+            mIlType, 
+            memInput.getPtr(), 
+            static_cast< ILuint >(memInput.size()));
+
+        // Check if everything was ok
+        ILenum PossibleError = ilGetError() ;
+        if( PossibleError != IL_NO_ERROR ) {
+            OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED,
+                "IL Error",
+                iluErrorString(PossibleError) ) ;
+        }
+
+        ImageFormat = ilGetInteger( IL_IMAGE_FORMAT );
+        ImageType = ilGetInteger( IL_IMAGE_TYPE );
+
+        // Convert image if ImageType is incompatible with us (double or long)
+        if(ImageType != IL_BYTE && ImageType != IL_UNSIGNED_BYTE && 
+			ImageType != IL_FLOAT &&
+			ImageType != IL_UNSIGNED_SHORT && ImageType != IL_SHORT) {
+            ilConvertImage(ImageFormat, IL_FLOAT);
+			ImageType = IL_FLOAT;
+        }
+		// Converted paletted images
+		if(ImageFormat == IL_COLOUR_INDEX)
+		{
+			ilConvertImage(IL_BGRA, IL_UNSIGNED_BYTE);
+			ImageFormat = IL_BGRA;
+			ImageType = IL_UNSIGNED_BYTE;
+		}
+
+        // Now sets some variables
+        BytesPerPixel = ilGetInteger( IL_IMAGE_BYTES_PER_PIXEL ); 
+
+        imgData->format = ILUtil::ilFormat2OgreFormat( ImageFormat, ImageType );
+        imgData->width = ilGetInteger( IL_IMAGE_WIDTH );
+        imgData->height = ilGetInteger( IL_IMAGE_HEIGHT );
+        imgData->depth = ilGetInteger( IL_IMAGE_DEPTH );
+        imgData->num_mipmaps = ilGetInteger ( IL_NUM_MIPMAPS );
+        imgData->flags = 0;
+		
+		if(imgData->format == PF_UNKNOWN)
+		{
+			std::stringstream err;
+			err << "Unsupported devil format ImageFormat=" << std::hex << ImageFormat << 
+				" ImageType="<< ImageType << std::dec;
+			ilDeleteImages( 1, &ImageName );
+			
+			OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED,
+                err.str(),
+                "ILImageCodec::decode" ) ;
+		}
+
+        // Check for cubemap
+        //ILuint cubeflags = ilGetInteger ( IL_IMAGE_CUBEFLAGS );
+		size_t numFaces = ilGetInteger ( IL_NUM_IMAGES ) + 1;
+        if(numFaces == 6) 
+			imgData->flags |= IF_CUBEMAP;
+        else
+            numFaces = 1; // Support only 1 or 6 face images for now
+  
+        // Keep DXT data (if present at all and the GPU supports it)
+        ILuint dxtFormat = ilGetInteger( IL_DXTC_DATA_FORMAT );
+        if(dxtFormat != IL_DXT_NO_COMP && Root::getSingleton().getRenderSystem()->getCapabilities()->hasCapability( RSC_TEXTURE_COMPRESSION_DXT ))
+        {
+			imgData->format = ILUtil::ilFormat2OgreFormat( dxtFormat, ImageType );
+            imgData->flags |= IF_COMPRESSED;
+            
+            // Validate that this devil version saves DXT mipmaps
+            if(imgData->num_mipmaps>0)
+            {
+                ilBindImage(ImageName);
+                ilActiveMipmap(1);
+                if((size_t)ilGetInteger( IL_DXTC_DATA_FORMAT ) != dxtFormat)
+                {
+                    imgData->num_mipmaps=0;
+                    LogManager::getSingleton().logMessage(
+                    "Warning: Custom mipmaps for compressed image "+input->getName()+" were ignored because they are not loaded by this DevIL version");
+                }
+            }
+        }
+        
+        // Calculate total size from number of mipmaps, faces and size
+        imgData->size = Image::calculateSize(imgData->num_mipmaps, numFaces, 
+            imgData->width, imgData->height, imgData->depth, imgData->format);
+
+        // Bind output buffer
+        output.bind(new MemoryDataStream(imgData->size));
+        size_t offset = 0;
+        
+        // Dimensions of current mipmap
+        size_t width = imgData->width;
+        size_t height = imgData->height;
+        size_t depth = imgData->depth;
+        
+        // Transfer data
+        for(size_t mip=0; mip<=imgData->num_mipmaps; ++mip)
+        {   
+            for(size_t i = 0; i < numFaces; ++i)
+            {
+                ilBindImage(ImageName);
+                if(numFaces > 1)
+                    ilActiveImage(i);
+                if(imgData->num_mipmaps > 0)
+                    ilActiveMipmap(mip);
+                /// Size of this face
+                size_t imageSize = PixelUtil::getMemorySize(
+                        width, height, depth, imgData->format);
+                if(imgData->flags & IF_COMPRESSED)
+                {
+
+                    // Compare DXT size returned by DevIL with our idea of the compressed size
+                    if(imageSize == ilGetDXTCData(NULL, 0, dxtFormat))
+                    {
+                        // Retrieve data from DevIL
+                        ilGetDXTCData((unsigned char*)output->getPtr()+offset, imageSize, dxtFormat);
+                    } else
+                    {
+                        LogManager::getSingleton().logMessage(
+                            "Warning: compressed image "+input->getName()+" size mismatch, devilsize="+StringConverter::toString(ilGetDXTCData(NULL, 0, dxtFormat))+" oursize="+
+                            StringConverter::toString(imageSize));
+                    }
+                }
+                else
+                {
+                    /// Retrieve data from DevIL
+                    PixelBox dst(width, height, depth, imgData->format, (unsigned char*)output->getPtr()+offset);
+                    ILUtil::toOgre(dst);
+                }
+                offset += imageSize;
+            }
+            /// Next mip
+            if(width!=1) width /= 2;
+            if(height!=1) height /= 2;
+            if(depth!=1) depth /= 2;
+        }
+
+        // Restore IL state
+        ilDisable(IL_ORIGIN_SET);
+        ilDisable(IL_FORMAT_SET);
+
+        ilDeleteImages( 1, &ImageName );
+
+        DecodeResult ret;
+        ret.first = output;
+        ret.second = CodecDataPtr(imgData);
+
+
+        return ret;
+    }
+    //---------------------------------------------------------------------
+    void ILImageCodec::initialiseIL(void)
+    {
+        if( !_is_initialised )
+        {
+            ilInit();
+            ilEnable( IL_FILE_OVERWRITE );
+            _is_initialised = true;
+        }
+    }
+    //---------------------------------------------------------------------    
+    String ILImageCodec::getType() const 
+    {
+        return mType;
+    }
+}
Index: /OgreMain/src/OgreILUtil.cpp
===================================================================
--- /OgreMain/src/OgreILUtil.cpp	(revision 5)
+++ /OgreMain/src/OgreILUtil.cpp	(revision 5)
@@ -0,0 +1,327 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include <OgreStableHeaders.h>
+#include "OgreILUtil.h"
+#include <OgrePixelFormat.h>
+#include <OgreBitwise.h>
+#include <OgreColourValue.h>
+#include <OgreException.h>
+
+#include <IL/il.h>
+#include <IL/ilu.h>
+   
+namespace Ogre {
+	
+	/*************************************************************************
+    * IL specific functions
+    */
+    PixelFormat ILUtil::ilFormat2OgreFormat( int ImageFormat, int ImageType ) 
+	{
+        PixelFormat fmt = PF_UNKNOWN;
+        switch( ImageFormat )
+        {
+		/* Compressed formats -- ignore type */
+		case IL_DXT1:   fmt = PF_DXT1; break;
+		case IL_DXT2:   fmt = PF_DXT2; break;
+		case IL_DXT3:   fmt = PF_DXT3; break;
+		case IL_DXT4:   fmt = PF_DXT4; break;
+		case IL_DXT5:   fmt = PF_DXT5; break;
+		/* Normal formats */
+        case IL_RGB:
+			switch(ImageType)
+            {
+			case IL_FLOAT:  fmt = PF_FLOAT32_RGB; break;
+			case IL_UNSIGNED_SHORT: 
+			case IL_SHORT:  fmt = PF_SHORT_RGBA; break;
+			default:       	fmt = PF_BYTE_RGB; break;
+			}
+            break;
+        case IL_BGR:
+			switch(ImageType)
+            {
+			case IL_FLOAT:  fmt = PF_FLOAT32_RGB; break;
+			case IL_UNSIGNED_SHORT: 
+			case IL_SHORT:  fmt = PF_SHORT_RGBA; break;
+			default:       	fmt = PF_BYTE_BGR; break;
+			}
+            break;            
+        case IL_RGBA:
+			switch(ImageType)
+            {
+			case IL_FLOAT:  fmt = PF_FLOAT32_RGBA; break;
+			case IL_UNSIGNED_SHORT: 
+			case IL_SHORT:  fmt = PF_SHORT_RGBA; break;
+			default:       	fmt = PF_BYTE_RGBA; break;
+			}
+            break;
+        case IL_BGRA:
+			switch(ImageType)
+            {
+			case IL_FLOAT:  fmt = PF_FLOAT32_RGBA; break;
+			case IL_UNSIGNED_SHORT: 
+			case IL_SHORT:  fmt = PF_SHORT_RGBA; break;
+			default:       	fmt = PF_BYTE_BGRA; break;
+			}
+            break;
+        case IL_LUMINANCE:
+            switch(ImageType)
+            {
+            case IL_BYTE:
+            case IL_UNSIGNED_BYTE:
+                fmt = PF_L8;
+                break;
+            default:
+                fmt = PF_L16;
+            }
+            break;            
+        case IL_LUMINANCE_ALPHA:
+			fmt = PF_BYTE_LA;
+            break;
+        }  
+        return fmt;
+    }
+
+    //-----------------------------------------------------------------------
+
+    ILUtil::ILFormat ILUtil::OgreFormat2ilFormat( PixelFormat format )
+    {
+		switch(format) {
+            case PF_BYTE_L: return ILFormat(1, IL_LUMINANCE, IL_UNSIGNED_BYTE);
+			case PF_BYTE_A: return ILFormat(1, IL_LUMINANCE, IL_UNSIGNED_BYTE);
+			case PF_SHORT_L: return ILFormat(1, IL_LUMINANCE, IL_UNSIGNED_SHORT);
+			case PF_BYTE_LA: return ILFormat(2, IL_LUMINANCE_ALPHA, IL_UNSIGNED_BYTE);
+			case PF_BYTE_RGB: return ILFormat(3, IL_RGB, IL_UNSIGNED_BYTE);
+			case PF_BYTE_RGBA: return ILFormat(4, IL_RGBA, IL_UNSIGNED_BYTE);
+            case PF_BYTE_BGR: return ILFormat(3, IL_BGR, IL_UNSIGNED_BYTE);
+            case PF_BYTE_BGRA: return ILFormat(4, IL_BGRA, IL_UNSIGNED_BYTE);
+			case PF_SHORT_RGBA: return ILFormat(4, IL_RGBA, IL_UNSIGNED_SHORT);
+			case PF_FLOAT32_RGB: return ILFormat(3, IL_RGB, IL_FLOAT);
+			case PF_FLOAT32_RGBA: return ILFormat(4, IL_RGBA, IL_FLOAT);
+			case PF_DXT1: return ILFormat(0, IL_DXT1);
+			case PF_DXT2: return ILFormat(0, IL_DXT2);
+			case PF_DXT3: return ILFormat(0, IL_DXT3);
+			case PF_DXT4: return ILFormat(0, IL_DXT4);
+			case PF_DXT5: return ILFormat(0, IL_DXT5);
+			default: return ILFormat();
+		}
+	}
+
+    //-----------------------------------------------------------------------
+	/// Helper functions for DevIL to Ogre conversion
+	inline void packI(uint8 r, uint8 g, uint8 b, uint8 a, PixelFormat pf,  void* dest)
+	{
+		PixelUtil::packColour(r, g, b, a, pf, dest);
+	}
+	inline void packI(uint16 r, uint16 g, uint16 b, uint16 a, PixelFormat pf,  void* dest)
+	{
+		PixelUtil::packColour((float)r/65535.0f, (float)g/65535.0f, 
+			(float)b/65535.0f, (float)a/65535.0f, pf, dest);
+	}
+	inline void packI(float r, float g, float b, float a, PixelFormat pf,  void* dest)
+	{
+		PixelUtil::packColour(r, g, b, a, pf, dest);
+	}
+    template <typename T> void ilToOgreInternal(uint8 *tar, PixelFormat ogrefmt, 
+        T r, T g, T b, T a)
+    {
+        const int ilfmt = ilGetInteger( IL_IMAGE_FORMAT );
+        T *src = (T*)ilGetData();
+        T *srcend = (T*)((uint8*)ilGetData() + ilGetInteger( IL_IMAGE_SIZE_OF_DATA ));
+        const size_t elemSize = PixelUtil::getNumElemBytes(ogrefmt);
+        while(src < srcend) {
+            switch(ilfmt) {
+			case IL_RGB:
+				r = src[0];	g = src[1];	b = src[2];
+				src += 3;
+				break;
+			case IL_BGR:
+				b = src[0];	g = src[1];	r = src[2];
+				src += 3;
+				break;
+			case IL_LUMINANCE:
+				r = src[0];	g = src[0];	b = src[0];
+				src += 1;
+				break;
+			case IL_LUMINANCE_ALPHA:
+				r = src[0];	g = src[0];	b = src[0];	a = src[1];
+				src += 2;
+				break;
+			case IL_RGBA:
+				r = src[0];	g = src[1];	b = src[2];	a = src[3];
+				src += 4;
+				break;
+			case IL_BGRA:
+				b = src[0];	g = src[1];	r = src[2];	a = src[3];
+				src += 4;
+				break;
+			default:
+				return;
+            }
+            packI(r, g, b, a, ogrefmt, tar);
+            tar += elemSize;
+        }
+
+    }   
+    //----------------------------------------------------------------------- 
+	/// Utility function to convert IL data types to UNSIGNED_
+	ILenum ILabs(ILenum in) {
+		switch(in) {
+		case IL_INT: return IL_UNSIGNED_INT;
+		case IL_BYTE: return IL_UNSIGNED_BYTE;
+		case IL_SHORT: return IL_UNSIGNED_SHORT;
+		default: return in;
+		}
+	}
+    //-----------------------------------------------------------------------
+    void ILUtil::toOgre(const PixelBox &dst) 
+    {
+		if(!dst.isConsecutive())
+			OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED,
+                "Destination must currently be consecutive",
+                "ILUtil::ilToOgre" ) ;
+		if(dst.getWidth() != static_cast<size_t>(ilGetInteger( IL_IMAGE_WIDTH )) ||
+        	dst.getHeight() != static_cast<size_t>(ilGetInteger( IL_IMAGE_HEIGHT )) ||
+        	dst.getDepth() != static_cast<size_t>(ilGetInteger( IL_IMAGE_DEPTH )))
+			OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS,
+                "Destination dimensions must equal IL dimension",
+                "ILUtil::ilToOgre" ) ;
+        
+        int ilfmt = ilGetInteger( IL_IMAGE_FORMAT );
+        int iltp = ilGetInteger( IL_IMAGE_TYPE );
+
+		// Check if in-memory format just matches
+		// If yes, we can just copy it and save conversion
+		ILFormat ifmt = OgreFormat2ilFormat( dst.format );
+		if(ifmt.format == ilfmt && ILabs(ifmt.type) == ILabs(iltp)) {
+            memcpy(dst.data, ilGetData(), ilGetInteger( IL_IMAGE_SIZE_OF_DATA )); 
+            return;
+        }
+		// Try if buffer is in a known OGRE format so we can use OGRE its
+		// conversion routines
+		PixelFormat bufFmt = ilFormat2OgreFormat((int)ilfmt, (int)iltp);
+		
+		ifmt = OgreFormat2ilFormat( bufFmt );
+		if(ifmt.format == ilfmt && ILabs(ifmt.type) == ILabs(iltp))
+		{
+			// IL format matches another OGRE format
+			PixelBox src(dst.getWidth(), dst.getHeight(), dst.getDepth(), bufFmt, ilGetData());
+			PixelUtil::bulkPixelConversion(src, dst);
+			return;
+		}
+		
+        // Thee extremely slow method
+        if(iltp == IL_UNSIGNED_BYTE || iltp == IL_BYTE) 
+        {
+            ilToOgreInternal(static_cast<uint8*>(dst.data), dst.format, (uint8)0x00,(uint8)0x00,(uint8)0x00,(uint8)0xFF);
+        } 
+        else if(iltp == IL_FLOAT)
+        {
+            ilToOgreInternal(static_cast<uint8*>(dst.data), dst.format, 0.0f,0.0f,0.0f,1.0f);          
+        }
+		else if(iltp == IL_SHORT || iltp == IL_UNSIGNED_SHORT)
+        {
+			ilToOgreInternal(static_cast<uint8*>(dst.data), dst.format, 
+				(uint16)0x0000,(uint16)0x0000,(uint16)0x0000,(uint16)0xFFFF); 
+        }
+        else 
+        {
+            OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED,
+                "Cannot convert this DevIL type",
+                "ILUtil::ilToOgre" ) ;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ILUtil::fromOgre(const PixelBox &src)
+    {
+		// ilTexImage http://openil.sourceforge.net/docs/il/f00059.htm
+		ILFormat ifmt = OgreFormat2ilFormat( src.format );
+		if(src.isConsecutive() && ifmt.isValid()) 
+		{
+			// The easy case, the buffer is laid out in memory just like 
+			// we want it to be and is in a format DevIL can understand directly
+			// We could even save the copy if DevIL would let us
+			ilTexImage(static_cast<ILuint>(src.getWidth()), 
+				static_cast<ILuint>(src.getHeight()), 
+				static_cast<ILuint>(src.getDepth()), ifmt.numberOfChannels,
+				ifmt.format, ifmt.type, src.data);
+		} 
+		else if(ifmt.isValid()) 
+		{
+			// The format can be understood directly by DevIL. The only 
+			// problem is that ilTexImage expects our image data consecutively 
+			// so we cannot use that directly.
+			
+			// Let DevIL allocate the memory for us, and copy the data consecutively
+			// to its memory
+			ilTexImage(static_cast<ILuint>(src.getWidth()), 
+				static_cast<ILuint>(src.getHeight()), 
+				static_cast<ILuint>(src.getDepth()), ifmt.numberOfChannels,
+				ifmt.format, ifmt.type, 0);
+			PixelBox dst(src.getWidth(), src.getHeight(), src.getDepth(), src.format, ilGetData());
+			PixelUtil::bulkPixelConversion(src, dst);
+		} 
+		else 
+		{
+			// Here it gets ugly. We're stuck with a pixel format that DevIL
+			// can't do anything with. We will do a bulk pixel conversion and
+			// then feed it to DevIL anyway. The problem is finding the best
+			// format to convert to.
+			
+			// most general format supported by OGRE and DevIL
+			PixelFormat fmt = PixelUtil::hasAlpha(src.format)?PF_FLOAT32_RGBA:PF_FLOAT32_RGB; 
+
+			// Make up a pixel format
+			// We don't have to consider luminance formats as they have
+			// straight conversions to DevIL, just weird permutations of RGBA an LA
+			int depths[4];
+			PixelUtil::getBitDepths(src.format, depths);
+			
+			// Native endian format with all bit depths<8 can safely and quickly be 
+			// converted to 24/32 bit
+			if(PixelUtil::isNativeEndian(src.format) && 
+				depths[0]<=8 && depths[1]<=8 && depths[2]<=8 && depths[3]<=8) {
+				if(PixelUtil::hasAlpha(src.format)) {
+					fmt = PF_A8R8G8B8;
+				} else {
+					fmt = PF_R8G8B8;
+				}
+			}
+			
+			// Let DevIL allocate the memory for us, then do the conversion ourselves
+			ifmt = OgreFormat2ilFormat( fmt );
+			ilTexImage(static_cast<ILuint>(src.getWidth()), 
+				static_cast<ILuint>(src.getHeight()), 
+				static_cast<ILuint>(src.getDepth()), ifmt.numberOfChannels,
+				ifmt.format, ifmt.type, 0);
+			PixelBox dst(src.getWidth(), src.getHeight(), src.getDepth(), fmt, ilGetData());
+			PixelUtil::bulkPixelConversion(src, dst);
+		}
+    }
+
+}
Index: /OgreMain/src/OgreImage.cpp
===================================================================
--- /OgreMain/src/OgreImage.cpp	(revision 5)
+++ /OgreMain/src/OgreImage.cpp	(revision 5)
@@ -0,0 +1,753 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreImage.h"
+#include "OgreArchiveManager.h"
+#include "OgreException.h"
+#include "OgreImageCodec.h"
+#include "OgreColourValue.h"
+
+#include "OgreImageResampler.h"
+
+namespace Ogre {
+	ImageCodec::~ImageCodec() {
+	}
+
+	//-----------------------------------------------------------------------------
+	Image::Image()
+		: m_uWidth(0),
+		m_uHeight(0),
+		m_uDepth(0),
+		m_uSize(0),
+		m_uNumMipmaps(0),
+		m_uFlags(0),
+		m_pBuffer( NULL ),
+		m_bAutoDelete( true )
+	{
+	}
+
+	//-----------------------------------------------------------------------------
+	Image::Image( const Image &img )
+		: m_pBuffer( NULL ),
+		m_bAutoDelete( true )
+	{
+		// call assignment operator
+		*this = img;
+	}
+
+	//-----------------------------------------------------------------------------
+	Image::~Image()
+	{
+		//Only delete if this was not a dynamic image (meaning app holds & destroys buffer)
+		if( m_pBuffer && m_bAutoDelete )
+		{
+			delete[] m_pBuffer;
+			m_pBuffer = NULL;
+		}
+	}
+
+	//-----------------------------------------------------------------------------
+	Image & Image::operator = ( const Image &img )
+	{
+		if( m_pBuffer && m_bAutoDelete )
+		{
+			delete[] m_pBuffer;
+			m_pBuffer = NULL;
+		}
+		m_uWidth = img.m_uWidth;
+		m_uHeight = img.m_uHeight;
+		m_uDepth = img.m_uDepth;
+		m_eFormat = img.m_eFormat;
+		m_uSize = img.m_uSize;
+		m_uFlags = img.m_uFlags;
+		m_ucPixelSize = img.m_ucPixelSize;
+		m_uNumMipmaps = img.m_uNumMipmaps;
+		m_bAutoDelete = img.m_bAutoDelete;
+		//Only create/copy when previous data was not dynamic data
+		if( m_bAutoDelete )
+		{
+			m_pBuffer = new uchar[ m_uSize ];
+			memcpy( m_pBuffer, img.m_pBuffer, m_uSize );
+		}
+		else
+		{
+			m_pBuffer = img.m_pBuffer;
+		}
+
+		return *this;
+	}
+
+	//-----------------------------------------------------------------------------
+	Image & Image::flipAroundY()
+	{
+		if( !m_pBuffer )
+		{
+			OGRE_EXCEPT( 
+				Exception::ERR_INTERNAL_ERROR,
+				"Can not flip an unitialized texture",
+				"Image::flipAroundY" );
+		}
+        
+         m_uNumMipmaps = 0; // Image operations lose precomputed mipmaps
+
+		uchar	*pTempBuffer1 = NULL;
+		ushort	*pTempBuffer2 = NULL;
+		uchar	*pTempBuffer3 = NULL;
+		uint	*pTempBuffer4 = NULL;
+
+		uchar	*src1 = m_pBuffer, *dst1 = NULL;
+		ushort	*src2 = (ushort *)m_pBuffer, *dst2 = NULL;
+		uchar	*src3 = m_pBuffer, *dst3 = NULL;
+		uint	*src4 = (uint *)m_pBuffer, *dst4 = NULL;
+
+		ushort y;
+		switch (m_ucPixelSize)
+		{
+		case 1:
+			pTempBuffer1 = new uchar[m_uWidth * m_uHeight];
+			for (y = 0; y < m_uHeight; y++)
+			{
+				dst1 = (pTempBuffer1 + ((y * m_uWidth) + m_uWidth - 1));
+				for (ushort x = 0; x < m_uWidth; x++)
+					memcpy(dst1--, src1++, sizeof(uchar));
+			}
+
+			memcpy(m_pBuffer, pTempBuffer1, m_uWidth * m_uHeight * sizeof(uchar));
+			delete [] pTempBuffer1;
+			break;
+
+		case 2:
+			pTempBuffer2 = new ushort[m_uWidth * m_uHeight];
+			for (y = 0; y < m_uHeight; y++)
+			{
+				dst2 = (pTempBuffer2 + ((y * m_uWidth) + m_uWidth - 1));
+				for (ushort x = 0; x < m_uWidth; x++)
+					memcpy(dst2--, src2++, sizeof(ushort));
+			}
+
+			memcpy(m_pBuffer, pTempBuffer2, m_uWidth * m_uHeight * sizeof(ushort));
+			delete [] pTempBuffer2;
+			break;
+
+		case 3:
+			pTempBuffer3 = new uchar[m_uWidth * m_uHeight * 3];
+			for (y = 0; y < m_uHeight; y++)
+			{
+				size_t offset = ((y * m_uWidth) + (m_uWidth - 1)) * 3;
+				dst3 = pTempBuffer3;
+				dst3 += offset;
+				for (size_t x = 0; x < m_uWidth; x++)
+				{
+					memcpy(dst3, src3, sizeof(uchar) * 3);
+					dst3 -= 3; src3 += 3;
+				}
+			}
+
+			memcpy(m_pBuffer, pTempBuffer3, m_uWidth * m_uHeight * sizeof(uchar) * 3);
+			delete [] pTempBuffer3;
+			break;
+
+		case 4:
+			pTempBuffer4 = new uint[m_uWidth * m_uHeight];
+			for (y = 0; y < m_uHeight; y++)
+			{
+				dst4 = (pTempBuffer4 + ((y * m_uWidth) + m_uWidth - 1));
+				for (ushort x = 0; x < m_uWidth; x++)
+					memcpy(dst4--, src4++, sizeof(uint));
+			}
+
+			memcpy(m_pBuffer, pTempBuffer4, m_uWidth * m_uHeight * sizeof(uint));
+			delete [] pTempBuffer4;
+			break;
+
+		default:
+			OGRE_EXCEPT( 
+				Exception::ERR_INTERNAL_ERROR,
+				"Unknown pixel depth",
+				"Image::flipAroundY" );
+			break;
+		}
+
+		return *this;
+
+	}
+
+	//-----------------------------------------------------------------------------
+	Image & Image::flipAroundX()
+	{
+		if( !m_pBuffer )
+		{
+			OGRE_EXCEPT( 
+				Exception::ERR_INTERNAL_ERROR,
+				"Can not flip an unitialized texture",
+				"Image::flipAroundX" );
+		}
+        
+        m_uNumMipmaps = 0; // Image operations lose precomputed mipmaps
+
+		size_t rowSpan = m_uWidth * m_ucPixelSize;
+
+		uchar *pTempBuffer = new uchar[ rowSpan * m_uHeight ];
+		uchar *ptr1 = m_pBuffer, *ptr2 = pTempBuffer + ( ( m_uHeight - 1 ) * rowSpan );
+
+		for( ushort i = 0; i < m_uHeight; i++ )
+		{
+			memcpy( ptr2, ptr1, rowSpan );
+			ptr1 += rowSpan; ptr2 -= rowSpan;
+		}
+
+		memcpy( m_pBuffer, pTempBuffer, rowSpan * m_uHeight);
+
+		delete [] pTempBuffer;
+
+		return *this;
+	}
+
+	//-----------------------------------------------------------------------------
+	Image& Image::loadDynamicImage( uchar* pData, size_t uWidth, size_t uHeight, 
+		size_t depth,
+		PixelFormat eFormat, bool autoDelete, 
+		size_t numFaces, size_t numMipMaps)
+	{
+
+		if( m_pBuffer && m_bAutoDelete )
+		{
+			delete[] m_pBuffer;
+			m_pBuffer = NULL;
+		}
+		// Set image metadata
+		m_uWidth = uWidth;
+		m_uHeight = uHeight;
+		m_uDepth = depth;
+		m_eFormat = eFormat;
+		m_ucPixelSize = static_cast<uchar>(PixelUtil::getNumElemBytes( m_eFormat ));
+		m_uNumMipmaps = numMipMaps;
+		m_uFlags = 0;
+		// Set flags
+		if (PixelUtil::isCompressed(eFormat))
+			m_uFlags |= IF_COMPRESSED;
+		if (m_uDepth != 1)
+			m_uFlags |= IF_3D_TEXTURE;
+		if(numFaces == 6)
+			m_uFlags |= IF_CUBEMAP;
+		if(numFaces != 6 && numFaces != 1)
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+			"Number of faces currently must be 6 or 1.", 
+			"Image::loadDynamicImage");
+
+		m_uSize = calculateSize(numMipMaps, numFaces, uWidth, uHeight, depth, eFormat);
+		m_pBuffer = pData;
+		m_bAutoDelete = autoDelete;
+
+		return *this;
+
+	}
+
+	//-----------------------------------------------------------------------------
+	Image & Image::loadRawData(
+		DataStreamPtr& stream, 
+		size_t uWidth, size_t uHeight, size_t uDepth,
+		PixelFormat eFormat,
+		size_t numFaces, size_t numMipMaps)
+	{
+
+		size_t size = calculateSize(numMipMaps, numFaces, uWidth, uHeight, uDepth, eFormat);
+		if (size != stream->size())
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"Stream size does not match calculated image size", 
+				"Image::loadRawData");
+		}
+
+		uchar *buffer = new uchar[ size ];
+		stream->read(buffer, size);
+
+		return loadDynamicImage(buffer,
+			uWidth, uHeight, uDepth,
+			eFormat, true, numFaces, numMipMaps);
+
+	}
+
+	//-----------------------------------------------------------------------------
+	Image & Image::load(const String& strFileName, const String& group)
+	{
+
+		if( m_pBuffer && m_bAutoDelete )
+		{
+			delete[] m_pBuffer;
+			m_pBuffer = NULL;
+		}
+
+		String strExt;
+
+		size_t pos = strFileName.find_last_of(".");
+		if( pos == String::npos )
+			OGRE_EXCEPT(
+			Exception::ERR_INVALIDPARAMS, 
+			"Unable to load image file '" + strFileName + "' - invalid extension.",
+			"Image::load" );
+
+		while( pos != strFileName.length() - 1 )
+			strExt += strFileName[++pos];
+
+		Codec * pCodec = Codec::getCodec(strExt);
+		if( !pCodec )
+			OGRE_EXCEPT(
+			Exception::ERR_INVALIDPARAMS, 
+			"Unable to load image file '" + strFileName + "' - invalid extension.",
+			"Image::load" );
+
+		DataStreamPtr encoded = 
+			ResourceGroupManager::getSingleton().openResource(strFileName, group);
+
+		Codec::DecodeResult res = pCodec->decode(encoded);
+
+		ImageCodec::ImageData* pData = 
+			static_cast<ImageCodec::ImageData*>(res.second.getPointer());
+
+		// Get the format and compute the pixel size
+		m_uWidth = pData->width;
+		m_uHeight = pData->height;
+		m_uDepth = pData->depth;
+		m_uSize = pData->size;
+		m_eFormat = pData->format;
+		m_uNumMipmaps = pData->num_mipmaps;
+		m_ucPixelSize = static_cast<uchar>(PixelUtil::getNumElemBytes( m_eFormat ));
+		m_uFlags = pData->flags;
+
+		// re-use the decoded buffer
+		m_pBuffer = res.first->getPtr();
+		// ensure we don't delete when stream is closed
+		res.first->setFreeOnClose(false);
+
+		return *this;
+
+	}
+	//-----------------------------------------------------------------------------
+	void Image::save(const String& filename)
+	{
+		if( !m_pBuffer )
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "No image data loaded", 
+				"Image::save");
+		}
+
+		String strExt;
+		size_t pos = filename.find_last_of(".");
+		if( pos == String::npos )
+			OGRE_EXCEPT(
+			Exception::ERR_INVALIDPARAMS, 
+			"Unable to save image file '" + filename + "' - invalid extension.",
+			"Image::save" );
+
+		while( pos != filename.length() - 1 )
+			strExt += filename[++pos];
+
+		Codec * pCodec = Codec::getCodec(strExt);
+		if( !pCodec )
+			OGRE_EXCEPT(
+			Exception::ERR_INVALIDPARAMS, 
+			"Unable to save image file '" + filename + "' - invalid extension.",
+			"Image::save" );
+
+		ImageCodec::ImageData* imgData = new ImageCodec::ImageData();
+		imgData->format = m_eFormat;
+		imgData->height = m_uHeight;
+		imgData->width = m_uWidth;
+		imgData->depth = m_uDepth;
+		// Wrap in CodecDataPtr, this will delete
+		Codec::CodecDataPtr codeDataPtr(imgData);
+		// Wrap memory, be sure not to delete when stream destroyed
+		MemoryDataStreamPtr wrapper(new MemoryDataStream(m_pBuffer, m_uSize, false));
+
+		pCodec->codeToFile(wrapper, filename, codeDataPtr);
+	}
+	//-----------------------------------------------------------------------------
+	Image & Image::load(DataStreamPtr& stream, const String& type )
+	{
+		if( m_pBuffer && m_bAutoDelete )
+		{
+			delete[] m_pBuffer;
+			m_pBuffer = NULL;
+		}
+
+		String strType = type;
+
+		Codec * pCodec = Codec::getCodec(strType);
+		if( !pCodec )
+			OGRE_EXCEPT(
+			Exception::ERR_INVALIDPARAMS, 
+			"Unable to load image - invalid extension.",
+			"Image::load" );
+
+		Codec::DecodeResult res = pCodec->decode(stream);
+
+		ImageCodec::ImageData* pData = 
+			static_cast<ImageCodec::ImageData*>(res.second.getPointer());
+
+		m_uWidth = pData->width;
+		m_uHeight = pData->height;
+		m_uDepth = pData->depth;
+		m_uSize = pData->size;
+		m_uNumMipmaps = pData->num_mipmaps;
+		m_uFlags = pData->flags;
+
+		// Get the format and compute the pixel size
+		m_eFormat = pData->format;
+		m_ucPixelSize = static_cast<uchar>(PixelUtil::getNumElemBytes( m_eFormat ));
+		// Just use internal buffer of returned memory stream
+		m_pBuffer = res.first->getPtr();
+		// Make sure stream does not delete
+		res.first->setFreeOnClose(false);
+
+		return *this;
+	}
+
+	//-----------------------------------------------------------------------------
+	uchar* Image::getData()
+	{
+		return m_pBuffer;
+	}
+
+	//-----------------------------------------------------------------------------
+	const uchar* Image::getData() const
+	{
+		assert( m_pBuffer );
+		return m_pBuffer;
+	}
+
+	//-----------------------------------------------------------------------------
+	size_t Image::getSize() const
+	{
+		return m_uSize;
+	}
+
+	//-----------------------------------------------------------------------------
+	size_t Image::getNumMipmaps() const
+	{
+		return m_uNumMipmaps;
+	}
+
+	//-----------------------------------------------------------------------------
+	bool Image::hasFlag(const ImageFlags imgFlag) const
+	{
+		if(m_uFlags & imgFlag)
+		{
+			return true;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	//-----------------------------------------------------------------------------
+	size_t Image::getDepth() const
+	{
+		return m_uDepth;
+	}
+	//-----------------------------------------------------------------------------
+	size_t Image::getWidth() const
+	{
+		return m_uWidth;
+	}
+
+	//-----------------------------------------------------------------------------
+	size_t Image::getHeight() const
+	{
+		return m_uHeight;
+	}
+	//-----------------------------------------------------------------------------
+	size_t Image::getNumFaces(void) const
+	{
+		if(hasFlag(IF_CUBEMAP))
+			return 6;
+		return 1;
+	}
+	//-----------------------------------------------------------------------------
+	size_t Image::getRowSpan() const
+	{
+		return m_uWidth * m_ucPixelSize;
+	}
+
+	//-----------------------------------------------------------------------------
+	PixelFormat Image::getFormat() const
+	{
+		return m_eFormat;
+	}
+
+	//-----------------------------------------------------------------------------
+	uchar Image::getBPP() const
+	{
+		return m_ucPixelSize * 8;
+	}
+
+	//-----------------------------------------------------------------------------
+	bool Image::getHasAlpha(void) const
+	{
+		return PixelUtil::getFlags(m_eFormat) & PFF_HASALPHA;
+	}
+	//-----------------------------------------------------------------------------
+	void Image::applyGamma( unsigned char *buffer, Real gamma, size_t size, uchar bpp )
+	{
+		if( gamma == 1.0f )
+			return;
+
+		//NB only 24/32-bit supported
+		if( bpp != 24 && bpp != 32 ) return;
+
+		uint stride = bpp >> 3;
+
+		for( size_t i = 0, j = size / stride; i < j; i++, buffer += stride )
+		{
+			float r, g, b;
+
+			r = (float)buffer[0];
+			g = (float)buffer[1];
+			b = (float)buffer[2];
+
+			r = r * gamma;
+			g = g * gamma;
+			b = b * gamma;
+
+			float scale = 1.0f, tmp;
+
+			if( r > 255.0f && (tmp=(255.0f/r)) < scale )
+				scale = tmp;
+			if( g > 255.0f && (tmp=(255.0f/g)) < scale )
+				scale = tmp;
+			if( b > 255.0f && (tmp=(255.0f/b)) < scale )
+				scale = tmp;
+
+			r *= scale; g *= scale; b *= scale;
+
+			buffer[0] = (uchar)r;
+			buffer[1] = (uchar)g;
+			buffer[2] = (uchar)b;
+		}
+	}
+	//-----------------------------------------------------------------------------
+	void Image::resize(ushort width, ushort height, Filter filter)
+	{
+		// resizing dynamic images is not supported
+		assert(m_bAutoDelete);
+		assert(m_uDepth == 1);
+
+		// reassign buffer to temp image, make sure auto-delete is true
+		Image temp;
+		temp.loadDynamicImage(m_pBuffer, m_uWidth, m_uHeight, 1, m_eFormat, true);
+		// do not delete[] m_pBuffer!  temp will destroy it
+
+		// set new dimensions, allocate new buffer
+		m_uWidth = width;
+		m_uHeight = height;
+		m_uSize = PixelUtil::getMemorySize(m_uWidth, m_uHeight, 1, m_eFormat);
+		m_pBuffer = new uchar[m_uSize];
+        m_uNumMipmaps = 0; // Loses precomputed mipmaps
+
+		// scale the image from temp into our resized buffer
+		Image::scale(temp.getPixelBox(), getPixelBox(), filter);
+	}
+	//-----------------------------------------------------------------------
+	void Image::scale(const PixelBox &src, const PixelBox &scaled, Filter filter) 
+	{
+		assert(PixelUtil::isAccessible(src.format));
+		assert(PixelUtil::isAccessible(scaled.format));
+		MemoryDataStreamPtr buf; // For auto-delete
+		PixelBox temp;
+		switch (filter) 
+		{
+		default:
+		case FILTER_NEAREST:
+			if(src.format == scaled.format) 
+			{
+				// No intermediate buffer needed
+				temp = scaled;
+			}
+			else
+			{
+				// Allocate temporary buffer of destination size in source format 
+				temp = PixelBox(scaled.getWidth(), scaled.getHeight(), scaled.getDepth(), src.format);
+				buf.bind(new MemoryDataStream(temp.getConsecutiveSize()));
+				temp.data = buf->getPtr();
+			}
+			// super-optimized: no conversion
+			switch (PixelUtil::getNumElemBytes(src.format)) 
+			{
+			case 1: NearestResampler<1>::scale(src, temp); break;
+			case 2: NearestResampler<2>::scale(src, temp); break;
+			case 3: NearestResampler<3>::scale(src, temp); break;
+			case 4: NearestResampler<4>::scale(src, temp); break;
+			case 6: NearestResampler<6>::scale(src, temp); break;
+			case 8: NearestResampler<8>::scale(src, temp); break;
+			case 12: NearestResampler<12>::scale(src, temp); break;
+			case 16: NearestResampler<16>::scale(src, temp); break;
+			default:
+				// never reached
+				assert(false);
+			}
+			if(temp.data != scaled.data)
+			{
+				// Blit temp buffer
+				PixelUtil::bulkPixelConversion(temp, scaled);
+			}
+			break;
+
+		case FILTER_LINEAR:
+		case FILTER_BILINEAR:
+			switch (src.format) 
+			{
+			case PF_L8: case PF_A8: case PF_BYTE_LA:
+			case PF_R8G8B8: case PF_B8G8R8:
+			case PF_R8G8B8A8: case PF_B8G8R8A8:
+			case PF_A8B8G8R8: case PF_A8R8G8B8:
+			case PF_X8B8G8R8: case PF_X8R8G8B8:
+				if(src.format == scaled.format) 
+				{
+					// No intermediate buffer needed
+					temp = scaled;
+				}
+				else
+				{
+					// Allocate temp buffer of destination size in source format 
+					temp = PixelBox(scaled.getWidth(), scaled.getHeight(), scaled.getDepth(), src.format);
+					buf.bind(new MemoryDataStream(temp.getConsecutiveSize()));
+					temp.data = buf->getPtr();
+				}
+				// super-optimized: byte-oriented math, no conversion
+				switch (PixelUtil::getNumElemBytes(src.format)) 
+				{
+				case 1: LinearResampler_Byte<1>::scale(src, temp); break;
+				case 2: LinearResampler_Byte<2>::scale(src, temp); break;
+				case 3: LinearResampler_Byte<3>::scale(src, temp); break;
+				case 4: LinearResampler_Byte<4>::scale(src, temp); break;
+				default:
+					// never reached
+					assert(false);
+				}
+				if(temp.data != scaled.data)
+				{
+					// Blit temp buffer
+					PixelUtil::bulkPixelConversion(temp, scaled);
+				}
+				break;
+			case PF_FLOAT32_RGB:
+			case PF_FLOAT32_RGBA:
+				if (scaled.format == PF_FLOAT32_RGB || scaled.format == PF_FLOAT32_RGBA)
+				{
+					// float32 to float32, avoid unpack/repack overhead
+					LinearResampler_Float32::scale(src, scaled);
+					break;
+				}
+				// else, fall through
+			default:
+				// non-optimized: floating-point math, performs conversion but always works
+				LinearResampler::scale(src, scaled);
+			}
+			break;
+		}
+	}
+
+	//-----------------------------------------------------------------------------    
+
+	ColourValue Image::getColourAt(int x, int y, int z) 
+	{
+		ColourValue rval;
+		PixelUtil::unpackColour(&rval, m_eFormat, &m_pBuffer[m_ucPixelSize * (z * m_uWidth * m_uHeight + m_uWidth * y + x)]);
+		return rval;
+	}
+
+	//-----------------------------------------------------------------------------    
+
+	PixelBox Image::getPixelBox(size_t face, size_t mipmap) const
+	{
+		// Image data is arranged as:
+		// face 0, top level (mip 0)
+		// face 0, mip 1
+		// face 0, mip 2
+		// face 1, top level (mip 0)
+		// face 1, mip 1
+		// face 1, mip 2
+		// etc
+		if(mipmap > getNumMipmaps())
+			OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED,
+			"Mipmap index out of range",
+			"Image::getPixelBox" ) ;
+		if(face >= getNumFaces())
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Face index out of range",
+			"Image::getPixelBox");
+        // Calculate mipmap offset and size
+        uint8 *offset = const_cast<uint8*>(getData());
+		// Base offset is number of full faces
+        size_t width = getWidth(), height=getHeight(), depth=getDepth();
+		size_t numMips = getNumMipmaps();
+
+		// Figure out the offsets 
+		size_t fullFaceSize = 0;
+		size_t finalFaceSize = 0;
+		size_t finalWidth, finalHeight, finalDepth;
+		for(size_t mip=0; mip <= numMips; ++mip)
+        {
+			if (mip == mipmap)
+			{
+				finalFaceSize = fullFaceSize;
+				finalWidth = width;
+				finalHeight = height;
+				finalDepth = depth;
+			}
+            fullFaceSize += PixelUtil::getMemorySize(width, height, depth, getFormat());
+
+            /// Half size in each dimension
+            if(width!=1) width /= 2;
+            if(height!=1) height /= 2;
+            if(depth!=1) depth /= 2;
+        }
+		// Advance pointer by number of full faces, plus mip offset into
+		offset += face * fullFaceSize;
+		offset += finalFaceSize;
+		// Return subface as pixelbox
+		PixelBox src(finalWidth, finalHeight, finalDepth, getFormat(), offset);
+		return src;
+	}
+    //-----------------------------------------------------------------------------    
+    size_t Image::calculateSize(size_t mipmaps, size_t faces, size_t width, size_t height, size_t depth, 
+        PixelFormat format)
+    {
+        size_t size = 0;
+        for(size_t mip=0; mip<=mipmaps; ++mip)
+        {
+            size += PixelUtil::getMemorySize(width, height, depth, format)*faces; 
+            if(width!=1) width /= 2;
+            if(height!=1) height /= 2;
+            if(depth!=1) depth /= 2;
+        }
+        return size;
+    }
+    
+}
Index: /OgreMain/src/OgreImageResampler.h
===================================================================
--- /OgreMain/src/OgreImageResampler.h	(revision 5)
+++ /OgreMain/src/OgreImageResampler.h	(revision 5)
@@ -0,0 +1,349 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef OGREIMAGERESAMPLER_H
+#define OGREIMAGERESAMPLER_H
+
+#include <algorithm>
+
+// this file is inlined into OgreImage.cpp!
+// do not include anywhere else.
+namespace Ogre {
+
+// define uint64 type
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+typedef unsigned __int64 uint64;
+#else
+typedef unsigned long long uint64;
+#endif
+
+// variable name hints:
+// sx_48 = 16/48-bit fixed-point x-position in source
+// stepx = difference between adjacent sx_48 values
+// sx1 = lower-bound integer x-position in source
+// sx2 = upper-bound integer x-position in source
+// sxf = fractional weight beween sx1 and sx2
+// x,y,z = location of output pixel in destination
+
+// nearest-neighbor resampler, does not convert formats.
+// templated on bytes-per-pixel to allow compiler optimizations, such
+// as simplifying memcpy() and replacing multiplies with bitshifts
+template<unsigned int elemsize> struct NearestResampler {
+	static void scale(const PixelBox& src, const PixelBox& dst) {
+		// assert(src.format == dst.format);
+
+		// srcdata stays at beginning, pdst is a moving pointer
+		uchar* srcdata = (uchar*)src.data;
+		uchar* pdst = (uchar*)dst.data;
+
+		// sx_48,sy_48,sz_48 represent current position in source
+		// using 16/48-bit fixed precision, incremented by steps
+		uint64 stepx = ((uint64)src.getWidth() << 48) / dst.getWidth();
+		uint64 stepy = ((uint64)src.getHeight() << 48) / dst.getHeight();
+		uint64 stepz = ((uint64)src.getDepth() << 48) / dst.getDepth();
+
+		// note: ((stepz>>1) - 1) is an extra half-step increment to adjust
+		// for the center of the destination pixel, not the top-left corner
+		uint64 sz_48 = (stepz >> 1) - 1;
+		for (size_t z = dst.front; z < dst.back; z++, sz_48 += stepz) {
+			size_t srczoff = (size_t)(sz_48 >> 48) * src.slicePitch;
+			
+			uint64 sy_48 = (stepy >> 1) - 1;
+			for (size_t y = dst.top; y < dst.bottom; y++, sy_48 += stepy) {
+				size_t srcyoff = (size_t)(sy_48 >> 48) * src.rowPitch;
+			
+				uint64 sx_48 = (stepx >> 1) - 1;
+				for (size_t x = dst.left; x < dst.right; x++, sx_48 += stepx) {
+					uchar* psrc = srcdata +
+						elemsize*((size_t)(sx_48 >> 48) + srcyoff + srczoff);
+                    memcpy(pdst, psrc, elemsize);
+					pdst += elemsize;
+				}
+				pdst += elemsize*dst.getRowSkip();
+			}
+			pdst += elemsize*dst.getSliceSkip();
+		}
+	}
+};
+
+
+// default floating-point linear resampler, does format conversion
+struct LinearResampler {
+	static void scale(const PixelBox& src, const PixelBox& dst) {
+		size_t srcelemsize = PixelUtil::getNumElemBytes(src.format);
+		size_t dstelemsize = PixelUtil::getNumElemBytes(dst.format);
+
+		// srcdata stays at beginning, pdst is a moving pointer
+		uchar* srcdata = (uchar*)src.data;
+		uchar* pdst = (uchar*)dst.data;
+		
+		// sx_48,sy_48,sz_48 represent current position in source
+		// using 16/48-bit fixed precision, incremented by steps
+		uint64 stepx = ((uint64)src.getWidth() << 48) / dst.getWidth();
+		uint64 stepy = ((uint64)src.getHeight() << 48) / dst.getHeight();
+		uint64 stepz = ((uint64)src.getDepth() << 48) / dst.getDepth();
+		
+		// temp is 16/16 bit fixed precision, used to adjust a source
+		// coordinate (x, y, or z) backwards by half a pixel so that the
+		// integer bits represent the first sample (eg, sx1) and the
+		// fractional bits are the blend weight of the second sample
+		unsigned int temp;
+
+		// note: ((stepz>>1) - 1) is an extra half-step increment to adjust
+		// for the center of the destination pixel, not the top-left corner
+		uint64 sz_48 = (stepz >> 1) - 1;
+		for (size_t z = dst.front; z < dst.back; z++, sz_48+=stepz) {
+			temp = sz_48 >> 32;
+			temp = (temp > 0x8000)? temp - 0x8000 : 0;
+			size_t sz1 = temp >> 16;				 // src z, sample #1
+			size_t sz2 = std::min(sz1+1,src.getDepth()-1);// src z, sample #2
+			float szf = (temp & 0xFFFF) / 65536.f; // weight of sample #2
+
+			uint64 sy_48 = (stepy >> 1) - 1;
+			for (size_t y = dst.top; y < dst.bottom; y++, sy_48+=stepy) {
+				temp = sy_48 >> 32;
+				temp = (temp > 0x8000)? temp - 0x8000 : 0;
+				size_t sy1 = temp >> 16;					// src y #1
+				size_t sy2 = std::min(sy1+1,src.getHeight()-1);// src y #2
+				float syf = (temp & 0xFFFF) / 65536.f; // weight of #2
+				
+				uint64 sx_48 = (stepx >> 1) - 1;
+				for (size_t x = dst.left; x < dst.right; x++, sx_48+=stepx) {
+					temp = sx_48 >> 32;
+					temp = (temp > 0x8000)? temp - 0x8000 : 0;
+					size_t sx1 = temp >> 16;					// src x #1
+					size_t sx2 = std::min(sx1+1,src.getWidth()-1);// src x #2
+					float sxf = (temp & 0xFFFF) / 65536.f; // weight of #2
+				
+					ColourValue x1y1z1, x2y1z1, x1y2z1, x2y2z1;
+					ColourValue x1y1z2, x2y1z2, x1y2z2, x2y2z2;
+
+#define UNPACK(dst,x,y,z) PixelUtil::unpackColour(&dst, src.format, \
+	srcdata + srcelemsize*((x)+(y)*src.rowPitch+(z)*src.slicePitch))
+
+					UNPACK(x1y1z1,sx1,sy1,sz1); UNPACK(x2y1z1,sx2,sy1,sz1);
+					UNPACK(x1y2z1,sx1,sy2,sz1); UNPACK(x2y2z1,sx2,sy2,sz1);
+					UNPACK(x1y1z2,sx1,sy1,sz2); UNPACK(x2y1z2,sx2,sy1,sz2);
+					UNPACK(x1y2z2,sx1,sy2,sz2); UNPACK(x2y2z2,sx2,sy2,sz2);
+#undef UNPACK
+
+					ColourValue accum =
+						x1y1z1 * ((1.0f - sxf)*(1.0f - syf)*(1.0f - szf)) +
+						x2y1z1 * (        sxf *(1.0f - syf)*(1.0f - szf)) +
+						x1y2z1 * ((1.0f - sxf)*        syf *(1.0f - szf)) +
+						x2y2z1 * (        sxf *        syf *(1.0f - szf)) +
+						x1y1z2 * ((1.0f - sxf)*(1.0f - syf)*        szf ) +
+						x2y1z2 * (        sxf *(1.0f - syf)*        szf ) +
+						x1y2z2 * ((1.0f - sxf)*        syf *        szf ) +
+						x2y2z2 * (        sxf *        syf *        szf );
+
+					PixelUtil::packColour(accum, dst.format, pdst);
+
+					pdst += dstelemsize;
+				}
+				pdst += dstelemsize*dst.getRowSkip();
+			}
+			pdst += dstelemsize*dst.getSliceSkip();
+		}
+	}
+};
+
+
+// float32 linear resampler, converts FLOAT32_RGB/FLOAT32_RGBA only.
+// avoids overhead of pixel unpack/repack function calls
+struct LinearResampler_Float32 {
+	static void scale(const PixelBox& src, const PixelBox& dst) {
+		size_t srcchannels = PixelUtil::getNumElemBytes(src.format) / sizeof(float);
+		size_t dstchannels = PixelUtil::getNumElemBytes(dst.format) / sizeof(float);
+		// assert(srcchannels == 3 || srcchannels == 4);
+		// assert(dstchannels == 3 || dstchannels == 4);
+
+		// srcdata stays at beginning, pdst is a moving pointer
+		float* srcdata = (float*)src.data;
+		float* pdst = (float*)dst.data;
+		
+		// sx_48,sy_48,sz_48 represent current position in source
+		// using 16/48-bit fixed precision, incremented by steps
+		uint64 stepx = ((uint64)src.getWidth() << 48) / dst.getWidth();
+		uint64 stepy = ((uint64)src.getHeight() << 48) / dst.getHeight();
+		uint64 stepz = ((uint64)src.getDepth() << 48) / dst.getDepth();
+		
+		// temp is 16/16 bit fixed precision, used to adjust a source
+		// coordinate (x, y, or z) backwards by half a pixel so that the
+		// integer bits represent the first sample (eg, sx1) and the
+		// fractional bits are the blend weight of the second sample
+		unsigned int temp;
+
+		// note: ((stepz>>1) - 1) is an extra half-step increment to adjust
+		// for the center of the destination pixel, not the top-left corner
+		uint64 sz_48 = (stepz >> 1) - 1;
+		for (size_t z = dst.front; z < dst.back; z++, sz_48+=stepz) {
+			temp = sz_48 >> 32;
+			temp = (temp > 0x8000)? temp - 0x8000 : 0;
+			size_t sz1 = temp >> 16;				 // src z, sample #1
+			size_t sz2 = std::min(sz1+1,src.getDepth()-1);// src z, sample #2
+			float szf = (temp & 0xFFFF) / 65536.f; // weight of sample #2
+
+			uint64 sy_48 = (stepy >> 1) - 1;
+			for (size_t y = dst.top; y < dst.bottom; y++, sy_48+=stepy) {
+				temp = sy_48 >> 32;
+				temp = (temp > 0x8000)? temp - 0x8000 : 0;
+				size_t sy1 = temp >> 16;					// src y #1
+				size_t sy2 = std::min(sy1+1,src.getHeight()-1);// src y #2
+				float syf = (temp & 0xFFFF) / 65536.f; // weight of #2
+				
+				uint64 sx_48 = (stepx >> 1) - 1;
+				for (size_t x = dst.left; x < dst.right; x++, sx_48+=stepx) {
+					temp = sx_48 >> 32;
+					temp = (temp > 0x8000)? temp - 0x8000 : 0;
+					size_t sx1 = temp >> 16;					// src x #1
+					size_t sx2 = std::min(sx1+1,src.getWidth()-1);// src x #2
+					float sxf = (temp & 0xFFFF) / 65536.f; // weight of #2
+					
+					// process R,G,B,A simultaneously for cache coherence?
+					float accum[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
+
+#define ACCUM3(x,y,z,factor) \
+	{ float f = factor; \
+	size_t off = (x+y*src.rowPitch+z*src.slicePitch)*srcchannels; \
+    accum[0]+=srcdata[off+0]*f; accum[1]+=srcdata[off+1]*f; \
+	accum[2]+=srcdata[off+2]*f; }
+
+#define ACCUM4(x,y,z,factor) \
+	{ float f = factor; \
+	size_t off = (x+y*src.rowPitch+z*src.slicePitch)*srcchannels; \
+    accum[0]+=srcdata[off+0]*f; accum[1]+=srcdata[off+1]*f; \
+	accum[2]+=srcdata[off+2]*f; accum[3]+=srcdata[off+3]*f; }
+
+					if (srcchannels == 3 || dstchannels == 3) {
+						// RGB, no alpha
+						ACCUM3(sx1,sy1,sz1,(1.0f-sxf)*(1.0f-syf)*(1.0f-szf));
+						ACCUM3(sx2,sy1,sz1,      sxf *(1.0f-syf)*(1.0f-szf));
+						ACCUM3(sx1,sy2,sz1,(1.0f-sxf)*      syf *(1.0f-szf));
+						ACCUM3(sx2,sy2,sz1,      sxf *      syf *(1.0f-szf));
+						ACCUM3(sx1,sy1,sz2,(1.0f-sxf)*(1.0f-syf)*      szf );
+						ACCUM3(sx2,sy1,sz2,      sxf *(1.0f-syf)*      szf );
+						ACCUM3(sx1,sy2,sz2,(1.0f-sxf)*      syf *      szf );
+						ACCUM3(sx2,sy2,sz2,      sxf *      syf *      szf );
+						accum[3] = 1.0f;
+					} else {
+						// RGBA
+						ACCUM4(sx1,sy1,sz1,(1.0f-sxf)*(1.0f-syf)*(1.0f-szf));
+						ACCUM4(sx2,sy1,sz1,      sxf *(1.0f-syf)*(1.0f-szf));
+						ACCUM4(sx1,sy2,sz1,(1.0f-sxf)*      syf *(1.0f-szf));
+						ACCUM4(sx2,sy2,sz1,      sxf *      syf *(1.0f-szf));
+						ACCUM4(sx1,sy1,sz2,(1.0f-sxf)*(1.0f-syf)*      szf );
+						ACCUM4(sx2,sy1,sz2,      sxf *(1.0f-syf)*      szf );
+						ACCUM4(sx1,sy2,sz2,(1.0f-sxf)*      syf *      szf );
+						ACCUM4(sx2,sy2,sz2,      sxf *      syf *      szf );
+					}
+
+					memcpy(pdst, accum, sizeof(float)*dstchannels);
+
+#undef ACCUM3
+#undef ACCUM4
+
+					pdst += dstchannels;
+				}
+				pdst += dstchannels*dst.getRowSkip();
+			}
+			pdst += dstchannels*dst.getSliceSkip();
+		}
+	}
+};
+
+
+
+// byte linear resampler, does not do any format conversions.
+// only handles pixel formats that use 1 byte per color channel.
+// 2D only; punts 3D pixelboxes to default LinearResampler (slow).
+// templated on bytes-per-pixel to allow compiler optimizations, such
+// as unrolling loops and replacing multiplies with bitshifts
+template<unsigned int channels> struct LinearResampler_Byte {
+	static void scale(const PixelBox& src, const PixelBox& dst) {
+		// assert(src.format == dst.format);
+
+		// only optimized for 2D
+		if (src.getDepth() > 1 || dst.getDepth() > 1) {
+			LinearResampler::scale(src, dst);
+			return;
+		}
+
+		// srcdata stays at beginning of slice, pdst is a moving pointer
+		uchar* srcdata = (uchar*)src.data;
+		uchar* pdst = (uchar*)dst.data;
+
+		// sx_48,sy_48 represent current position in source
+		// using 16/48-bit fixed precision, incremented by steps
+		uint64 stepx = ((uint64)src.getWidth() << 48) / dst.getWidth();
+		uint64 stepy = ((uint64)src.getHeight() << 48) / dst.getHeight();
+		
+		// bottom 28 bits of temp are 16/12 bit fixed precision, used to
+		// adjust a source coordinate backwards by half a pixel so that the
+		// integer bits represent the first sample (eg, sx1) and the
+		// fractional bits are the blend weight of the second sample
+		unsigned int temp;
+		
+		uint64 sy_48 = (stepy >> 1) - 1;
+		for (size_t y = dst.top; y < dst.bottom; y++, sy_48+=stepy) {
+			temp = sy_48 >> 36;
+			temp = (temp > 0x800)? temp - 0x800: 0;
+			unsigned int syf = temp & 0xFFF;
+			size_t sy1 = temp >> 12;
+			size_t sy2 = std::min(sy1+1, src.bottom-src.top-1);
+			size_t syoff1 = sy1 * src.rowPitch;
+			size_t syoff2 = sy2 * src.rowPitch;
+
+			uint64 sx_48 = (stepx >> 1) - 1;
+			for (size_t x = dst.left; x < dst.right; x++, sx_48+=stepx) {
+				temp = sx_48 >> 36;
+				temp = (temp > 0x800)? temp - 0x800 : 0;
+				unsigned int sxf = temp & 0xFFF;
+				size_t sx1 = temp >> 12;
+				size_t sx2 = std::min(sx1+1, src.right-src.left-1);
+
+				unsigned int sxfsyf = sxf*syf;
+				for (unsigned int k = 0; k < channels; k++) {
+					unsigned int accum =
+						srcdata[(sx1 + syoff1)*channels+k]*(0x1000000-(sxf<<12)-(syf<<12)+sxfsyf) +
+						srcdata[(sx2 + syoff1)*channels+k]*((sxf<<12)-sxfsyf) +
+						srcdata[(sx1 + syoff2)*channels+k]*((syf<<12)-sxfsyf) +
+						srcdata[(sx2 + syoff2)*channels+k]*sxfsyf;
+					// accum is computed using 8/24-bit fixed-point math
+					// (maximum is 0xFF000000; rounding will not cause overflow)
+					*pdst++ = (accum + 0x800000) >> 24;
+				}
+			}
+			pdst += channels*dst.getRowSkip();
+		}
+	}
+};
+
+}
+
+#endif
Index: /OgreMain/src/OgreInstancedGeometry.cpp
===================================================================
--- /OgreMain/src/OgreInstancedGeometry.cpp	(revision 5)
+++ /OgreMain/src/OgreInstancedGeometry.cpp	(revision 5)
@@ -0,0 +1,2089 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreInstancedGeometry.h"
+#include "OgreEntity.h"
+#include "OgreSubEntity.h"
+#include "OgreSceneNode.h"
+#include "OgreException.h"
+#include "OgreMesh.h"
+#include "OgreSubMesh.h"
+#include "OgreLogManager.h"
+#include "OgreSceneManager.h"
+#include "OgreCamera.h"
+#include "OgreMaterialManager.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreEdgeListBuilder.h"
+#include "OgreStringConverter.h"
+
+namespace Ogre {
+
+	#define BatchInstance_RANGE 1024
+	#define BatchInstance_HALF_RANGE 512
+	#define BatchInstance_MAX_INDEX 511
+	#define BatchInstance_MIN_INDEX -512
+
+	//--------------------------------------------------------------------------
+	InstancedGeometry::InstancedGeometry(SceneManager* owner, const String& name):
+		mOwner(owner),
+		mName(name),
+		mBuilt(false),
+		mUpperDistance(0.0f),
+		mSquaredUpperDistance(0.0f),
+		mCastShadows(false),
+		mBatchInstanceDimensions(Vector3(1000,1000,1000)),
+		mHalfBatchInstanceDimensions(Vector3(500,500,500)),
+		mOrigin(Vector3(0,0,0)),
+		mVisible(true),
+        mRenderQueueID(RENDER_QUEUE_MAIN),
+        mRenderQueueIDSet(false),
+		mObjectCount(0),
+		mInstancedGeometryInstance(0),
+		mSkeletonInstance(0)
+	{
+		mBaseSkeleton.setNull();
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::~InstancedGeometry()
+	{
+		reset();
+		if(mSkeletonInstance)
+			delete mSkeletonInstance;
+
+			
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::BatchInstance*InstancedGeometry::getInstancedGeometryInstance(void)
+	{
+		if (!mInstancedGeometryInstance)
+		{
+			uint32 index = 0;
+			// Make a name
+			StringUtil::StrStreamType str;
+			str << mName << ":" << index;
+
+			mInstancedGeometryInstance = new BatchInstance(this, str.str(), mOwner, index);
+			mOwner->injectMovableObject(mInstancedGeometryInstance);
+			mInstancedGeometryInstance->setVisible(mVisible);
+			mInstancedGeometryInstance->setCastShadows(mCastShadows);
+			if (mRenderQueueIDSet)
+			{
+				mInstancedGeometryInstance->setRenderQueueGroup(mRenderQueueID);
+			}
+			mBatchInstanceMap[index] = mInstancedGeometryInstance;
+		
+	
+		}
+		return mInstancedGeometryInstance;
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::BatchInstance* InstancedGeometry::getBatchInstance(const AxisAlignedBox& bounds,
+		bool autoCreate)
+	{
+		if (bounds.isNull())
+			return 0;
+
+		// Get the BatchInstance which has the largest overlapping volume
+		const Vector3 min = bounds.getMinimum();
+		const Vector3 max = bounds.getMaximum();
+
+		// Get the min and max BatchInstance indexes
+		ushort minx, miny, minz;
+		ushort maxx, maxy, maxz;
+		getBatchInstanceIndexes(min, minx, miny, minz);
+		getBatchInstanceIndexes(max, maxx, maxy, maxz);
+		Real maxVolume = 0.0f;
+		ushort finalx =0 , finaly = 0, finalz = 0;
+		for (ushort x = minx; x <= maxx; ++x)
+		{
+			for (ushort y = miny; y <= maxy; ++y)
+			{
+				for (ushort z = minz; z <= maxz; ++z)
+				{
+					Real vol = getVolumeIntersection(bounds, x, y, z);
+					if (vol > maxVolume)
+					{
+						maxVolume = vol;
+						finalx = x;
+						finaly = y;
+						finalz = z;
+					}
+
+				}
+			}
+		}
+
+		assert(maxVolume > 0.0f &&
+			"Static geometry: Problem determining closest volume match!");
+
+		return getBatchInstance(finalx, finaly, finalz, autoCreate);
+
+	}
+	//--------------------------------------------------------------------------
+	Real InstancedGeometry::getVolumeIntersection(const AxisAlignedBox& box,
+		ushort x, ushort y, ushort z)
+	{
+		// Get bounds of indexed BatchInstance
+		AxisAlignedBox BatchInstanceBounds = getBatchInstanceBounds(x, y, z);
+		AxisAlignedBox intersectBox = BatchInstanceBounds.intersection(box);
+		// return a 'volume' which ignores zero dimensions
+		// since we only use this for relative comparisons of the same bounds
+		// this will still be internally consistent
+		Vector3 boxdiff = box.getMaximum() - box.getMinimum();
+		Vector3 intersectDiff = intersectBox.getMaximum() - intersectBox.getMinimum();
+
+		return (boxdiff.x == 0 ? 1 : intersectDiff.x) *
+			(boxdiff.y == 0 ? 1 : intersectDiff.y) *
+			(boxdiff.z == 0 ? 1 : intersectDiff.z);
+
+	}
+	//--------------------------------------------------------------------------
+	AxisAlignedBox InstancedGeometry::getBatchInstanceBounds(ushort x, ushort y, ushort z)
+	{
+		Vector3 min(
+			((Real)x - BatchInstance_HALF_RANGE) * mBatchInstanceDimensions.x + mOrigin.x,
+			((Real)y - BatchInstance_HALF_RANGE) * mBatchInstanceDimensions.y + mOrigin.y,
+			((Real)z - BatchInstance_HALF_RANGE) * mBatchInstanceDimensions.z + mOrigin.z
+			);
+		Vector3 max = min + mBatchInstanceDimensions;
+		return AxisAlignedBox(min, max);
+	}
+	//--------------------------------------------------------------------------
+ 	Vector3 InstancedGeometry::getBatchInstanceCentre(ushort x, ushort y, ushort z)
+	{
+		return Vector3(
+			((Real)x - BatchInstance_HALF_RANGE) * mBatchInstanceDimensions.x + mOrigin.x
+				+ mHalfBatchInstanceDimensions.x,
+			((Real)y - BatchInstance_HALF_RANGE) * mBatchInstanceDimensions.y + mOrigin.y
+				+ mHalfBatchInstanceDimensions.y,
+			((Real)z - BatchInstance_HALF_RANGE) * mBatchInstanceDimensions.z + mOrigin.z
+				+ mHalfBatchInstanceDimensions.z
+			);
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::BatchInstance* InstancedGeometry::getBatchInstance(
+			ushort x, ushort y, ushort z, bool autoCreate)
+	{
+		uint32 index = packIndex(x, y, z);
+		BatchInstance* ret = getBatchInstance(index);
+		if (!ret && autoCreate)
+		{
+			// Make a name
+			StringUtil::StrStreamType str;
+			str << mName << ":" << index;
+			// Calculate the BatchInstance centre
+			Vector3 centre(0,0,0);// = getBatchInstanceCentre(x, y, z);
+			ret = new BatchInstance(this, str.str(), mOwner, index/*, centre*/);
+			mOwner->injectMovableObject(ret);
+			ret->setVisible(mVisible);
+			ret->setCastShadows(mCastShadows);
+			if (mRenderQueueIDSet)
+			{
+				ret->setRenderQueueGroup(mRenderQueueID);
+			}
+			mBatchInstanceMap[index] = ret;
+		}
+		return ret;
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::BatchInstance* InstancedGeometry::getBatchInstance(uint32 index)
+	{
+		BatchInstanceMap::iterator i = mBatchInstanceMap.find(index);
+		if (i != mBatchInstanceMap.end())
+		{
+			return i->second;
+		}
+		else
+		{
+			return 0;
+		}
+
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::getBatchInstanceIndexes(const Vector3& point,
+		ushort& x, ushort& y, ushort& z)
+	{
+		// Scale the point into multiples of BatchInstance and adjust for origin
+		Vector3 scaledPoint = (point - mOrigin) / mBatchInstanceDimensions;
+
+		// Round down to 'bottom left' point which represents the cell index
+		int ix = Math::IFloor(scaledPoint.x);
+		int iy = Math::IFloor(scaledPoint.y);
+		int iz = Math::IFloor(scaledPoint.z);
+
+		// Check bounds
+		if (ix < BatchInstance_MIN_INDEX || ix > BatchInstance_MAX_INDEX
+			|| iy < BatchInstance_MIN_INDEX || iy > BatchInstance_MAX_INDEX
+			|| iz < BatchInstance_MIN_INDEX || iz > BatchInstance_MAX_INDEX)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Point out of bounds",
+				"InstancedGeometry::getBatchInstanceIndexes");
+		}
+		// Adjust for the fact that we use unsigned values for simplicity
+		// (requires less faffing about for negatives give 10-bit packing
+		x = static_cast<ushort>(ix + BatchInstance_HALF_RANGE);
+		y = static_cast<ushort>(iy + BatchInstance_HALF_RANGE);
+		z = static_cast<ushort>(iz + BatchInstance_HALF_RANGE);
+
+
+	}
+	//--------------------------------------------------------------------------
+	uint32 InstancedGeometry::packIndex(ushort x, ushort y, ushort z)
+	{
+		return x + (y << 10) + (z << 20);
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::BatchInstance* InstancedGeometry::getBatchInstance(const Vector3& point,
+		bool autoCreate)
+	{
+		ushort x, y, z;
+		getBatchInstanceIndexes(point, x, y, z);
+		return getBatchInstance(x, y, z, autoCreate);
+	}
+	//--------------------------------------------------------------------------
+	AxisAlignedBox InstancedGeometry::calculateBounds(VertexData* vertexData,
+		const Vector3& position, const Quaternion& orientation,
+		const Vector3& scale)
+	{
+		const VertexElement* posElem =
+			vertexData->vertexDeclaration->findElementBySemantic(
+				VES_POSITION);
+		HardwareVertexBufferSharedPtr vbuf =
+			vertexData->vertexBufferBinding->getBuffer(posElem->getSource());
+		unsigned char* vertex =
+			static_cast<unsigned char*>(
+				vbuf->lock(HardwareBuffer::HBL_READ_ONLY));
+		float* pFloat;
+
+		Vector3 min, max;
+		bool first = true;
+
+		for(size_t j = 0; j < vertexData->vertexCount; ++j, vertex += vbuf->getVertexSize())
+		{
+			posElem->baseVertexPointerToElement(vertex, &pFloat);
+
+			Vector3 pt;
+
+			pt.x = (*pFloat++);
+			pt.y = (*pFloat++);
+			pt.z = (*pFloat++);
+			// Transform to world (scale, rotate, translate)
+			pt = (orientation * (pt * scale)) + position;
+			if (first)
+			{
+				min = max = pt;
+				first = false;
+			}
+			else
+			{
+				min.makeFloor(pt);
+				max.makeCeil(pt);
+			}
+
+		}
+		vbuf->unlock();
+		return AxisAlignedBox(min, max);
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::addEntity(Entity* ent, const Vector3& position,
+		const Quaternion& orientation, const Vector3& scale)
+	{
+
+		const MeshPtr& msh = ent->getMesh();
+		// Validate
+		if (msh->isLodManual())
+		{
+			LogManager::getSingleton().logMessage(
+				"WARNING (InstancedGeometry): Manual LOD is not supported. "
+				"Using only highest LOD level for mesh " + msh->getName());
+		}
+
+		//get the skeleton of the entity, if that's not already done
+		if(!ent->getMesh()->getSkeleton().isNull()&&mBaseSkeleton.isNull())
+		{
+			mBaseSkeleton=ent->getMesh()->getSkeleton();
+			mSkeletonInstance=new SkeletonInstance(mBaseSkeleton);
+			mSkeletonInstance->load();
+			mAnimationState=ent->getAllAnimationStates();
+		}
+		AxisAlignedBox sharedWorldBounds;
+		// queue this entities submeshes and choice of material
+		// also build the lists of geometry to be used for the source of lods
+
+
+		for (uint i = 0; i < ent->getNumSubEntities(); ++i)
+		{
+			SubEntity* se = ent->getSubEntity(i);
+			QueuedSubMesh* q = new QueuedSubMesh();
+
+			// Get the geometry for this SubMesh
+			q->submesh = se->getSubMesh();
+			q->geometryLodList = determineGeometry(q->submesh);
+			q->materialName = se->getMaterialName();
+			q->orientation = orientation;
+			q->position = position;
+			q->scale = scale;
+			q->ID = mObjectCount;
+			// Determine the bounds based on the highest LOD
+			q->worldBounds = calculateBounds(
+				(*q->geometryLodList)[0].vertexData,
+					position, orientation, scale);
+
+			mQueuedSubMeshes.push_back(q);
+		}
+		mObjectCount++;
+
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::SubMeshLodGeometryLinkList*
+	InstancedGeometry::determineGeometry(SubMesh* sm)
+	{
+		// First, determine if we've already seen this submesh before
+		SubMeshGeometryLookup::iterator i =
+			mSubMeshGeometryLookup.find(sm);
+		if (i != mSubMeshGeometryLookup.end())
+		{
+			return i->second;
+		}
+		// Otherwise, we have to create a new one
+		SubMeshLodGeometryLinkList* lodList = new SubMeshLodGeometryLinkList();
+		mSubMeshGeometryLookup[sm] = lodList;
+		ushort numLods = sm->parent->isLodManual() ? 1 :
+			sm->parent->getNumLodLevels();
+		lodList->resize(numLods);
+		for (ushort lod = 0; lod < numLods; ++lod)
+		{
+			SubMeshLodGeometryLink& geomLink = (*lodList)[lod];
+			IndexData *lodIndexData;
+			if (lod == 0)
+			{
+				lodIndexData = sm->indexData;
+			}
+			else
+			{
+				lodIndexData = sm->mLodFaceList[lod - 1];
+			}
+			// Can use the original mesh geometry?
+			if (sm->useSharedVertices)
+			{
+				if (sm->parent->getNumSubMeshes() == 1)
+				{
+					// Ok, this is actually our own anyway
+					geomLink.vertexData = sm->parent->sharedVertexData;
+					geomLink.indexData = lodIndexData;
+				}
+				else
+				{
+					// We have to split it
+					splitGeometry(sm->parent->sharedVertexData,
+						lodIndexData, &geomLink);
+				}
+			}
+			else
+			{
+				if (lod == 0)
+				{
+					// Ok, we can use the existing geometry; should be in full
+					// use by just this SubMesh
+					geomLink.vertexData = sm->vertexData;
+					geomLink.indexData = sm->indexData;
+				}
+				else
+				{
+					// We have to split it
+					splitGeometry(sm->vertexData,
+						lodIndexData, &geomLink);
+				}
+			}
+			assert (geomLink.vertexData->vertexStart == 0 &&
+				"Cannot use vertexStart > 0 on indexed geometry due to "
+				"rendersystem incompatibilities - see the docs!");
+		}
+
+
+		return lodList;
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::splitGeometry(VertexData* vd, IndexData* id,
+			InstancedGeometry::SubMeshLodGeometryLink* targetGeomLink)
+	{
+		// Firstly we need to scan to see how many vertices are being used
+		// and while we're at it, build the remap we can use later
+		bool use32bitIndexes =
+			id->indexBuffer->getType() == HardwareIndexBuffer::IT_32BIT;
+		uint16 *p16;
+		uint32 *p32;
+		IndexRemap indexRemap;
+		if (use32bitIndexes)
+		{
+			p32 = static_cast<uint32*>(id->indexBuffer->lock(
+				id->indexStart, 
+				id->indexCount * id->indexBuffer->getIndexSize(), 
+				HardwareBuffer::HBL_READ_ONLY));
+			buildIndexRemap(p32, id->indexCount, indexRemap);
+			id->indexBuffer->unlock();
+		}
+		else
+		{
+			p16 = static_cast<uint16*>(id->indexBuffer->lock(
+				id->indexStart, 
+				id->indexCount * id->indexBuffer->getIndexSize(), 
+				HardwareBuffer::HBL_READ_ONLY));
+			buildIndexRemap(p16, id->indexCount, indexRemap);
+			id->indexBuffer->unlock();
+		}
+		if (indexRemap.size() == vd->vertexCount)
+		{
+			// ha, complete usage after all
+			targetGeomLink->vertexData = vd;
+			targetGeomLink->indexData = id;
+			return;
+		}
+
+
+		// Create the new vertex data records
+		targetGeomLink->vertexData = vd->clone(false);
+		// Convenience
+		VertexData* newvd = targetGeomLink->vertexData;
+		//IndexData* newid = targetGeomLink->indexData;
+		// Update the vertex count
+		newvd->vertexCount = indexRemap.size();
+
+		size_t numvbufs = vd->vertexBufferBinding->getBufferCount();
+		// Copy buffers from old to new
+		for (unsigned short b = 0; b < numvbufs; ++b)
+		{
+			// Lock old buffer
+			HardwareVertexBufferSharedPtr oldBuf =
+				vd->vertexBufferBinding->getBuffer(b);
+			// Create new buffer
+			HardwareVertexBufferSharedPtr newBuf =
+				HardwareBufferManager::getSingleton().createVertexBuffer(
+					oldBuf->getVertexSize(),
+					indexRemap.size(),
+					HardwareBuffer::HBU_STATIC);
+			// rebind
+			newvd->vertexBufferBinding->setBinding(b, newBuf);
+
+			// Copy all the elements of the buffer across, by iterating over
+			// the IndexRemap which describes how to move the old vertices
+			// to the new ones. By nature of the map the remap is in order of
+			// indexes in the old buffer, but note that we're not guaranteed to
+			// address every vertex (which is kinda why we're here)
+			uchar* pSrcBase = static_cast<uchar*>(
+				oldBuf->lock(HardwareBuffer::HBL_READ_ONLY));
+			uchar* pDstBase = static_cast<uchar*>(
+				newBuf->lock(HardwareBuffer::HBL_DISCARD));
+			size_t vertexSize = oldBuf->getVertexSize();
+			// Buffers should be the same size
+			assert (vertexSize == newBuf->getVertexSize());
+
+			for (IndexRemap::iterator r = indexRemap.begin();
+				r != indexRemap.end(); ++r)
+			{
+				assert (r->first < oldBuf->getNumVertices());
+				assert (r->second < newBuf->getNumVertices());
+
+				uchar* pSrc = pSrcBase + r->first * vertexSize;
+				uchar* pDst = pDstBase + r->second * vertexSize;
+				memcpy(pDst, pSrc, vertexSize);
+			}
+			// unlock
+			oldBuf->unlock();
+			newBuf->unlock();
+
+		}
+
+		// Now create a new index buffer
+		HardwareIndexBufferSharedPtr ibuf =
+			HardwareBufferManager::getSingleton().createIndexBuffer(
+				id->indexBuffer->getType(), id->indexCount,
+				HardwareBuffer::HBU_STATIC);
+
+		if (use32bitIndexes)
+		{
+			uint32 *pSrc32, *pDst32;
+			pSrc32 = static_cast<uint32*>(id->indexBuffer->lock(
+				id->indexStart, id->indexCount * id->indexBuffer->getIndexSize(), 
+				HardwareBuffer::HBL_READ_ONLY));
+			pDst32 = static_cast<uint32*>(ibuf->lock(
+				HardwareBuffer::HBL_DISCARD));
+			remapIndexes(pSrc32, pDst32, indexRemap, id->indexCount);
+			id->indexBuffer->unlock();
+			ibuf->unlock();
+		}
+		else
+		{
+			uint16 *pSrc16, *pDst16;
+			pSrc16 = static_cast<uint16*>(id->indexBuffer->lock(
+				id->indexStart, id->indexCount * id->indexBuffer->getIndexSize(), 
+				HardwareBuffer::HBL_READ_ONLY));
+			pDst16 = static_cast<uint16*>(ibuf->lock(
+				HardwareBuffer::HBL_DISCARD));
+			remapIndexes(pSrc16, pDst16, indexRemap, id->indexCount);
+			id->indexBuffer->unlock();
+			ibuf->unlock();
+		}
+
+		targetGeomLink->indexData = new IndexData();
+		targetGeomLink->indexData->indexStart = 0;
+		targetGeomLink->indexData->indexCount = id->indexCount;
+		targetGeomLink->indexData->indexBuffer = ibuf;
+
+		// Store optimised geometry for deallocation later
+		OptimisedSubMeshGeometry *optGeom = new OptimisedSubMeshGeometry();
+		optGeom->indexData = targetGeomLink->indexData;
+		optGeom->vertexData = targetGeomLink->vertexData;
+		mOptimisedSubMeshGeometryList.push_back(optGeom);
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::addSceneNode(const SceneNode* node)
+	{
+		SceneNode::ConstObjectIterator obji = node->getAttachedObjectIterator();
+		while (obji.hasMoreElements())
+		{
+			MovableObject* mobj = obji.getNext();
+			if (mobj->getMovableType() == "Entity")
+			{
+				addEntity(static_cast<Entity*>(mobj),
+					node->_getDerivedPosition(),
+					node->_getDerivedOrientation(),
+					node->_getDerivedScale());
+			}
+		}
+		// Iterate through all the child-nodes
+		SceneNode::ConstChildNodeIterator nodei = node->getChildIterator();
+
+		while (nodei.hasMoreElements())
+		{
+			const SceneNode* newNode = static_cast<const SceneNode*>(nodei.getNext());
+			// Add this subnode and its children...
+			addSceneNode( newNode );
+		}
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::build(void)
+	{
+		// Make sure there's nothing from previous builds
+		destroy();
+
+		// Firstly allocate meshes to BatchInstances
+		for (QueuedSubMeshList::iterator qi = mQueuedSubMeshes.begin();
+			qi != mQueuedSubMeshes.end(); ++qi)
+		{
+			QueuedSubMesh* qsm = *qi;
+			//BatchInstance* BatchInstance = getBatchInstance(qsm->worldBounds, true);
+			BatchInstance* batchInstance = getInstancedGeometryInstance();
+			batchInstance->assign(qsm);
+		}
+
+		// Now tell each BatchInstance to build itself
+		for (BatchInstanceMap::iterator ri = mBatchInstanceMap.begin();
+			ri != mBatchInstanceMap.end(); ++ri)
+		{
+			ri->second->build();
+		}
+
+
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::addBatchInstance(void)
+	{
+		
+
+		BatchInstanceIterator regIt = getBatchInstanceIterator();
+		BatchInstance*lastBatchInstance=0 ;
+		while(regIt.hasMoreElements())
+		{
+			lastBatchInstance= regIt.getNext();
+		}
+		uint32 index=(lastBatchInstance)?lastBatchInstance->getID()+1:0;
+		//create a new BatchInstance
+
+		BatchInstance*ret = new BatchInstance(this, mName+":"+StringConverter::toString(index),
+			mOwner, index);
+
+		ret->attachToScene();
+
+		mOwner->injectMovableObject(ret);
+		ret->setVisible(mVisible);
+		ret->setCastShadows(mCastShadows);
+		mBatchInstanceMap[index] = ret;
+
+		if (mRenderQueueIDSet)
+		{
+				ret->setRenderQueueGroup(mRenderQueueID);
+		}
+	
+		const size_t numLod = lastBatchInstance->mLodSquaredDistances.size();
+		ret->mLodSquaredDistances.resize(numLod);
+		for (ushort lod = 0; lod < numLod; lod++)
+		{
+			ret->mLodSquaredDistances[lod] =
+			lastBatchInstance->mLodSquaredDistances[lod];
+		}
+
+
+	
+		// update bounds
+		AxisAlignedBox box(lastBatchInstance->mAABB.getMinimum(),lastBatchInstance->mAABB.getMaximum());
+		ret->mAABB.merge(box);
+
+		ret->mBoundingRadius = lastBatchInstance->mBoundingRadius ;
+		//now create  news instanced objects
+		BatchInstance::ObjectsMap::iterator objIt;
+		for(objIt=lastBatchInstance->getInstancesMap().begin();objIt!=lastBatchInstance->getInstancesMap().end();objIt++)
+		{
+			InstancedObject* instancedObject = ret->isInstancedObjectPresent(objIt->first);
+			if(instancedObject == NULL)
+			{
+				if(mBaseSkeleton.isNull())
+				{
+					instancedObject=new InstancedObject(objIt->first);
+				}
+				else
+				{
+					instancedObject=new InstancedObject(objIt->first,mSkeletonInstance,mAnimationState);
+				}
+				ret->addInstancedObject(objIt->first,instancedObject);
+			}
+
+		}
+
+
+
+		BatchInstance::LODIterator lodIterator = lastBatchInstance->getLODIterator();
+		//parse all the lod buckets of the BatchInstance
+		while (lodIterator.hasMoreElements())
+		{
+		
+			LODBucket* lod = lodIterator.getNext();
+			//create a new lod bucket for the new BatchInstance
+			LODBucket* lodBucket= new LODBucket(ret,lod->getLod(),lod->getSquaredDistance());
+
+			//add the lod bucket to the BatchInstance list
+			ret->updateContainers(lodBucket);
+			
+			LODBucket::MaterialIterator matIt = lod->getMaterialIterator();
+			//parse all the material buckets of the lod bucket
+			while (matIt.hasMoreElements())
+			{
+				
+				MaterialBucket*mat = matIt.getNext();
+				//create a new material bucket
+				String materialName=mat->getMaterialName();
+				MaterialBucket* matBucket = new MaterialBucket(lodBucket,materialName);
+
+				//add the material bucket to the lod buckets list and map
+				lodBucket->updateContainers(matBucket, materialName);
+
+				MaterialBucket::GeometryIterator geomIt = mat->getGeometryIterator();
+				//parse all the geometry buckets of the material bucket
+				while(geomIt.hasMoreElements())
+				{
+					//get the source geometry bucket
+					GeometryBucket *geom = geomIt.getNext();
+					//create a new geometry bucket 
+					GeometryBucket *geomBucket = new GeometryBucket(matBucket,geom->getFormatString(),geom);
+			
+					//update the material bucket map of the material bucket
+					matBucket->updateContainers(geomBucket, geomBucket->getFormatString() );
+
+					//copy bounding informations
+					geomBucket->getAABB()=geom->getAABB();
+					geomBucket->setBoundingBox(	geom->getBoundingBox());
+					//now setups the news InstancedObjects.
+					for(objIt=ret->getInstancesMap().begin();objIt!=ret->getInstancesMap().end();objIt++)
+					{
+						//get the destination IntanciedObject
+						InstancedObject*obj=objIt->second;
+						InstancedObject::GeometryBucketList::iterator findIt;
+						//check if the bucket is not already in the list
+						findIt=std::find(obj->getGeometryBucketList().begin(),obj->getGeometryBucketList().end(),geomBucket);
+						if(findIt==obj->getGeometryBucketList().end())
+								obj->addBucketToList(geomBucket);
+					}
+			
+
+				}	
+			}
+		}
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::BatchInstance::updateContainers(LODBucket* bucket )
+	{
+		mLodBucketList.push_back(bucket);
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::LODBucket::updateContainers(MaterialBucket* bucket, String& name )
+	{
+		mMaterialBucketMap[name] = bucket;
+	}
+
+	//--------------------------------------------------------------------------
+	String InstancedGeometry::GeometryBucket::getFormatString(void) const
+	{
+		return mFormatString;
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::BatchInstance::attachToScene()
+	{
+
+			mNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(mName/*,mCentre*/);
+			mNode->attachObject(this);
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::MaterialBucket::updateContainers(InstancedGeometry::GeometryBucket* bucket, const String & format)
+	{
+		mCurrentGeometryMap[format]=bucket;
+		mGeometryBucketList.push_back(bucket);
+	}
+	void InstancedGeometry::MaterialBucket:: setMaterial(const String & name)
+	{
+		mMaterial=MaterialManager::getSingleton().getByName(name);
+	};
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::destroy(void)
+	{
+		RenderOperationVector::iterator it;
+		for(it=mRenderOps.begin();it!=mRenderOps.end();++it)
+		{
+			delete (*it)->vertexData;
+			delete (*it)->indexData;
+	
+		}
+		// delete the BatchInstances
+		for (BatchInstanceMap::iterator i = mBatchInstanceMap.begin();
+			i != mBatchInstanceMap.end(); ++i)
+		{
+			mOwner->extractMovableObject(i->second);
+			delete i->second;
+
+		}
+		mBatchInstanceMap.clear();
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::reset(void)
+	{
+		destroy();
+
+		for (QueuedSubMeshList::iterator i = mQueuedSubMeshes.begin();
+			i != mQueuedSubMeshes.end(); ++i)
+		{
+			delete *i;
+			
+		}
+		mQueuedSubMeshes.clear();
+		// Delete precached geoemtry lists
+		for (SubMeshGeometryLookup::iterator l = mSubMeshGeometryLookup.begin();
+			l != mSubMeshGeometryLookup.end(); ++l)
+		{
+			delete l->second;
+		
+		}
+		mSubMeshGeometryLookup.clear();
+		// Delete optimised geometry
+		for (OptimisedSubMeshGeometryList::iterator o = mOptimisedSubMeshGeometryList.begin();
+			o != mOptimisedSubMeshGeometryList.end(); ++o)
+		{
+			delete *o;
+			
+		}
+		mOptimisedSubMeshGeometryList.clear();
+
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::setVisible(bool visible)
+	{
+			
+		mVisible = visible;
+		// tell any existing BatchInstances
+		for (BatchInstanceMap::iterator ri = mBatchInstanceMap.begin();
+			ri != mBatchInstanceMap.end(); ++ri)
+		{
+
+			
+			ri->second->setVisible(visible);
+		}
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::setCastShadows(bool castShadows)
+	{
+		mCastShadows = castShadows;
+		// tell any existing BatchInstances
+		for (BatchInstanceMap::iterator ri = mBatchInstanceMap.begin();
+			ri != mBatchInstanceMap.end(); ++ri)
+		{
+			ri->second->setCastShadows(castShadows);
+		}
+
+	}
+	//--------------------------------------------------------------------------
+    void InstancedGeometry::setRenderQueueGroup(uint8 queueID)
+	{
+		assert(queueID <= RENDER_QUEUE_MAX && "Render queue out of range!");
+		mRenderQueueIDSet = true;
+		mRenderQueueID = queueID;
+		// tell any existing BatchInstances
+		for (BatchInstanceMap::iterator ri = mBatchInstanceMap.begin();
+			ri != mBatchInstanceMap.end(); ++ri)
+		{
+			ri->second->setRenderQueueGroup(queueID);
+		}
+	}
+	//--------------------------------------------------------------------------
+	uint8 InstancedGeometry::getRenderQueueGroup(void) const
+	{
+		return mRenderQueueID;
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::dump(const String& filename) const
+	{
+		std::ofstream of(filename.c_str());
+		of << "Static Geometry Report for " << mName << std::endl;
+		of << "-------------------------------------------------" << std::endl;
+		of << "Number of queued submeshes: " << mQueuedSubMeshes.size() << std::endl;
+		of << "Number of BatchInstances: " << mBatchInstanceMap.size() << std::endl;
+		of << "BatchInstance dimensions: " << mBatchInstanceDimensions << std::endl;
+		of << "Origin: " << mOrigin << std::endl;
+		of << "Max distance: " << mUpperDistance << std::endl;
+		of << "Casts shadows?: " << mCastShadows << std::endl;
+		of << std::endl;
+		for (BatchInstanceMap::const_iterator ri = mBatchInstanceMap.begin();
+			ri != mBatchInstanceMap.end(); ++ri)
+		{
+			ri->second->dump(of);
+		}
+		of << "-------------------------------------------------" << std::endl;
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::InstancedObject::InstancedObject(int index,SkeletonInstance *skeleton, AnimationStateSet*animations):mIndex(index),
+		mTransformation(Matrix4::ZERO),
+		mOrientation(Quaternion::IDENTITY),
+		mScale(Vector3::UNIT_SCALE),
+		mPosition(Vector3::ZERO),
+		mSkeletonInstance(skeleton),
+		mBoneWorldMatrices(NULL),
+        mBoneMatrices(NULL),
+        mNumBoneMatrices(0),
+		mFrameAnimationLastUpdated(std::numeric_limits<unsigned long>::max())
+
+	{
+			
+			mSkeletonInstance->load();
+		
+			mAnimationState = new AnimationStateSet();
+			mNumBoneMatrices = mSkeletonInstance->getNumBones();
+			mBoneMatrices = new Matrix4[mNumBoneMatrices];
+			AnimationStateIterator it=animations->getAnimationStateIterator();
+			while (it.hasMoreElements())
+			{
+				AnimationState*anim= it.getNext();
+				mAnimationState->createAnimationState(anim->getAnimationName(),anim->getTimePosition(),anim->getLength(),
+				anim->getWeight());
+
+			}
+			
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::InstancedObject::InstancedObject(int index):mIndex(index),
+		mTransformation(Matrix4::ZERO),
+		mOrientation(Quaternion::IDENTITY),
+		mScale(Vector3::UNIT_SCALE),
+		mPosition(Vector3::ZERO),
+		mSkeletonInstance(0),
+		mBoneWorldMatrices(0),
+        mBoneMatrices(0),
+		mAnimationState(0),
+        mNumBoneMatrices(0),
+		mFrameAnimationLastUpdated(std::numeric_limits<unsigned long>::max())
+	{
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::InstancedObject::~InstancedObject()
+	{
+		mGeometryBucketList.clear();
+		delete mAnimationState;
+		delete[] mBoneMatrices;
+		delete[] mBoneWorldMatrices;
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::InstancedObject::addBucketToList(GeometryBucket*bucket)
+	{
+		mGeometryBucketList.push_back(bucket);
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::InstancedObject::setPosition( Vector3  position)
+	{
+
+		mPosition=position;
+		needUpdate();
+		BatchInstance*parentBatchInstance=(*(mGeometryBucketList.begin()))->getParent()->getParent()->getParent();
+		parentBatchInstance->updateBoundingBox();
+
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::InstancedObject::translate(const Vector3 &d)
+	{
+		mPosition += d;
+		needUpdate();
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::InstancedObject::translate(const Matrix3 & axes,const Vector3 &move)
+	{
+		Vector3 derived = axes * move;
+        translate(derived);
+	}
+	//--------------------------------------------------------------------------
+	Matrix3 InstancedGeometry::InstancedObject::getLocalAxes() const
+	{
+		Vector3 axisX = Vector3::UNIT_X;
+        Vector3 axisY = Vector3::UNIT_Y;
+        Vector3 axisZ = Vector3::UNIT_Z;
+
+        axisX = mOrientation * axisX;
+        axisY = mOrientation * axisY;
+        axisZ = mOrientation * axisZ;
+
+        return Matrix3(axisX.x, axisY.x, axisZ.x,
+                       axisX.y, axisY.y, axisZ.y,
+                       axisX.z, axisY.z, axisZ.z);
+	}
+	//--------------------------------------------------------------------------
+	Vector3 & InstancedGeometry::InstancedObject::getPosition(void)
+	{
+		return mPosition;
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::InstancedObject::yaw(const Radian&angle)
+	{
+		Quaternion q;
+        q.FromAngleAxis(angle,Vector3::UNIT_Y);
+        rotate(q);
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::InstancedObject::pitch(const Radian&angle)
+	{
+		Quaternion q;
+        q.FromAngleAxis(angle,Vector3::UNIT_X);
+        rotate(q);
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::InstancedObject::roll(const Radian&angle)
+	{
+		Quaternion q;
+        q.FromAngleAxis(angle,Vector3::UNIT_Z);
+        rotate(q);
+
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::InstancedObject::setScale(const Vector3&scale)
+	{
+		mScale=scale;
+		needUpdate();
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::InstancedObject::rotate(const Quaternion& q)
+	{
+	
+            mOrientation = mOrientation * q;
+			 needUpdate();
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::InstancedObject::needUpdate()
+	{
+		 mTransformation.makeTransform(
+                mPosition,
+                mScale,
+                mOrientation);
+		 	
+			
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::InstancedObject::updateAnimation(void)
+	{
+
+		if(mSkeletonInstance)
+		{
+			GeometryBucketList::iterator it;
+		    mSkeletonInstance->setAnimationState(*mAnimationState);
+            mSkeletonInstance->_getBoneMatrices(mBoneMatrices);
+
+			 // Allocate bone world matrices on demand, for better memory footprint
+            // when using software animation.
+            if (!mBoneWorldMatrices)
+            {
+                mBoneWorldMatrices = new Matrix4[mNumBoneMatrices];
+            }
+
+            for (unsigned short i = 0; i < mNumBoneMatrices; ++i)
+            {
+                mBoneWorldMatrices[i] =  mTransformation * mBoneMatrices[i];
+			
+            }
+			
+
+
+		}
+
+	}
+	//--------------------------------------------------------------------------
+	AnimationState* InstancedGeometry::InstancedObject::getAnimationState(const String& name) const
+    {
+        if (!mAnimationState)
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Object is not animated",
+                "InstancedGeometry::InstancedObject::getAnimationState");
+        }
+//		AnimationStateIterator it=mAnimationState->getAnimationStateIterator();
+//		while (it.hasMoreElements())
+//		{
+//			AnimationState*anim= it.getNext();
+//
+//			
+//		}
+		return mAnimationState->getAnimationState(name);
+    }
+	//--------------------------------------------------------------------------
+	InstancedGeometry::BatchInstanceIterator InstancedGeometry::getBatchInstanceIterator(void)
+	{
+		return BatchInstanceIterator(mBatchInstanceMap.begin(), mBatchInstanceMap.end());
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::BatchInstance::BatchInstance(InstancedGeometry* parent, const String& name,
+		SceneManager* mgr, uint32 BatchInstanceID)
+		: MovableObject(name), mParent(parent), mSceneMgr(mgr), mNode(0),
+		mBatchInstanceID(BatchInstanceID), mBoundingRadius(0.0f),
+		mCurrentLod(0)
+	{
+		// First LOD mandatory, and always from 0
+		mLodSquaredDistances.push_back(0.0f);
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::BatchInstance::~BatchInstance()
+	{
+		if (mNode)
+		{
+			mNode->getParentSceneNode()->removeChild(mNode);
+			mSceneMgr->destroySceneNode(mNode->getName());
+			mNode = 0;
+		}
+		// delete
+		for (LODBucketList::iterator i = mLodBucketList.begin();
+			i != mLodBucketList.end(); ++i)
+		{
+			delete *i;
+		}
+		mLodBucketList.clear();
+		ObjectsMap::iterator o;
+
+		for(o=mInstancesMap.begin();o!=mInstancesMap.end();o++)
+		{
+			delete o->second;
+		}
+		mInstancesMap.clear();
+		// no need to delete queued meshes, these are managed in InstancedGeometry
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::BatchInstance::assign(QueuedSubMesh* qmesh)
+	{
+		mQueuedSubMeshes.push_back(qmesh);
+		// update lod distances
+		ushort lodLevels = qmesh->submesh->parent->getNumLodLevels();
+		assert(qmesh->geometryLodList->size() == lodLevels);
+
+		while(mLodSquaredDistances.size() < lodLevels)
+		{
+			mLodSquaredDistances.push_back(0.0f);
+		}
+		// Make sure LOD levels are max of all at the requested level
+		for (ushort lod = 1; lod < lodLevels; ++lod)
+		{
+			const MeshLodUsage& meshLod =
+				qmesh->submesh->parent->getLodLevel(lod);
+			mLodSquaredDistances[lod] = std::max(mLodSquaredDistances[lod],
+				meshLod.fromDepthSquared);
+		}
+
+		// update bounds
+		// Transform world bounds relative to our centre
+		AxisAlignedBox localBounds(
+			qmesh->worldBounds.getMinimum() ,
+			qmesh->worldBounds.getMaximum());
+		mAABB.merge(localBounds);
+		mBoundingRadius = std::max(mBoundingRadius, localBounds.getMinimum().length());
+		mBoundingRadius = std::max(mBoundingRadius, localBounds.getMaximum().length());
+
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::BatchInstance::build()
+	{
+		// Create a node
+		mNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(mName);
+		mNode->attachObject(this);
+		// We need to create enough LOD buckets to deal with the highest LOD
+		// we encountered in all the meshes queued
+		for (ushort lod = 0; lod < mLodSquaredDistances.size(); ++lod)
+		{
+			LODBucket* lodBucket =
+				new LODBucket(this, lod, mLodSquaredDistances[lod]);
+			mLodBucketList.push_back(lodBucket);
+			// Now iterate over the meshes and assign to LODs
+			// LOD bucket will pick the right LOD to use
+			QueuedSubMeshList::iterator qi, qiend;
+			qiend = mQueuedSubMeshes.end();
+			for (qi = mQueuedSubMeshes.begin(); qi != qiend; ++qi)
+			{
+				lodBucket->assign(*qi, lod);
+			}
+			// now build
+			lodBucket->build();
+		}
+
+
+	}
+	
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::BatchInstance::updateBoundingBox()
+	{
+
+			Vector3 *Positions = new Vector3[mInstancesMap.size()];
+
+			ObjectsMap::iterator objIt;
+			size_t k = 0;
+			for(objIt=mInstancesMap.begin();objIt!=mInstancesMap.end();objIt++)
+			{
+				Positions[k++] = objIt->second->getPosition();
+			}
+
+			LODIterator lodIterator = getLODIterator();
+			while (lodIterator.hasMoreElements())
+			{			
+				LODBucket* lod = lodIterator.getNext();
+				LODBucket::MaterialIterator matIt = lod->getMaterialIterator();
+				while (matIt.hasMoreElements())
+				{					
+					MaterialBucket*mat = matIt.getNext();
+					MaterialBucket::GeometryIterator geomIt = mat->getGeometryIterator();
+					while(geomIt.hasMoreElements())
+					{
+						// to generate the boundingBox
+						Real Xmin= Positions[0].x;
+						Real Ymin= Positions[0].y;
+						Real Zmin= Positions[0].z;
+
+						Real Xmax= Positions[0].x;
+						Real Ymax= Positions[0].y;
+						Real Zmax= Positions[0].z;
+
+						GeometryBucket*geom=geomIt.getNext();
+						for (size_t i = 0; i < mInstancesMap.size (); i++)
+						{
+							if(Positions[i].x<Xmin)
+								Xmin = Positions[i].x;
+							if(Positions[i].y<Ymin)
+								Ymin = Positions[i].y;
+							if(Positions[i].z<Zmin)
+								Zmin = Positions[i].z;
+							if(Positions[i].x>Xmax)
+								Xmax = Positions[i].x;
+							if(Positions[i].y>Ymax)
+								Ymax = Positions[i].y;
+							if(Positions[i].z>Zmax)
+								Zmax = Positions[i].z;
+						}
+						geom->setBoundingBox(AxisAlignedBox(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax));						
+						mAABB=AxisAlignedBox(
+							Vector3(Xmin,Ymin,Zmin) + geom->getAABB().getMinimum(),
+							Vector3(Xmax,Ymax,Zmax) + geom->getAABB().getMaximum());
+					
+					}
+				}
+			}
+
+			delete [] Positions;		
+	}
+	
+	
+	
+	
+	
+	
+	
+	
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::BatchInstance::addInstancedObject(int index,InstancedObject* object)
+	{
+		mInstancesMap[index]=object;
+	}
+	//--------------------------------------------------------------------------
+	 InstancedGeometry::InstancedObject* InstancedGeometry::BatchInstance::isInstancedObjectPresent(int index)
+	{
+		if (mInstancesMap.find(index)!=mInstancesMap.end())
+			return mInstancesMap[index];
+		else return NULL;
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::InstancedObject** InstancedGeometry::BatchInstance::getObjectsAsArray(unsigned short & size)
+	{
+		size = static_cast <unsigned short> (mInstancesMap.size());
+		ObjectsMap::iterator it;
+		InstancedObject** array=new InstancedObject*[size];
+		int i=0;
+		for(it=mInstancesMap.begin();it!=mInstancesMap.end();it++)
+		{
+			array[i]=it->second;
+			i++;
+		}
+		return array;
+	}
+	//--------------------------------------------------------------------------
+
+	const String& InstancedGeometry::BatchInstance::getMovableType(void) const
+	{
+		static String sType = "InstancedGeometry";
+		return sType;
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::BatchInstance::_notifyCurrentCamera(Camera* cam)
+	{
+		// Calculate squared view depth
+		Vector3 diff = cam->getDerivedPosition() ;
+		Real squaredDepth = diff.squaredLength();
+
+		// Determine whether to still render
+		Real renderingDist = mParent->getRenderingDistance();
+		if (renderingDist > 0)
+		{
+			// Max distance to still render
+			Real maxDist = renderingDist + mBoundingRadius;
+			if (squaredDepth > Math::Sqr(maxDist))
+			{
+				mBeyondFarDistance = true;
+				return;
+			}
+		}
+
+		mBeyondFarDistance = false;
+
+		// Distance from the edge of the bounding sphere
+		mCamDistanceSquared = squaredDepth - mBoundingRadius * mBoundingRadius;
+		// Clamp to 0
+		mCamDistanceSquared = std::max(static_cast<Real>(0.0), mCamDistanceSquared);
+
+		// Determine active lod
+		mCurrentLod = static_cast<ushort>(mLodSquaredDistances.size() - 1);
+		assert (!mLodSquaredDistances.empty());
+		mCurrentLod = static_cast <unsigned short> (mLodSquaredDistances.size() - 1);
+	
+		for (ushort i = 0; i < mLodSquaredDistances.size(); ++i)
+		{
+			if (mLodSquaredDistances[i] > mCamDistanceSquared)
+			{
+				mCurrentLod = i - 1;
+				break;
+			}
+		}
+
+	}
+	//--------------------------------------------------------------------------
+	const AxisAlignedBox& InstancedGeometry::BatchInstance::getBoundingBox(void) const
+	{
+		return mAABB;
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::BatchInstance::setBoundingBox(AxisAlignedBox & box)
+	{
+		mAABB=box;
+	}
+	//--------------------------------------------------------------------------
+	Real InstancedGeometry::BatchInstance::getBoundingRadius(void) const
+	{
+		return mBoundingRadius;
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::BatchInstance::_updateRenderQueue(RenderQueue* queue)
+	{
+		ObjectsMap::iterator it;
+		//we parse the Instanced Object map to update the animations.
+
+		for (it=mInstancesMap.begin();it!=mInstancesMap.end();++it)
+		{
+			it->second->updateAnimation();
+			
+		}
+	
+		mLodBucketList[mCurrentLod]->addRenderables(queue, mRenderQueueID,
+			mCamDistanceSquared);
+	}
+	//--------------------------------------------------------------------------
+	bool InstancedGeometry::BatchInstance::isVisible(void) const
+	{
+		return mVisible && !mBeyondFarDistance;
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::BatchInstance::LODIterator
+	InstancedGeometry::BatchInstance::getLODIterator(void)
+	{
+		return LODIterator(mLodBucketList.begin(), mLodBucketList.end());
+	}
+	//--------------------------------------------------------------------------
+	const LightList& InstancedGeometry::BatchInstance::getLights(void) const
+	{
+		return queryLights();
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::BatchInstance::dump(std::ofstream& of) const
+	{
+		of << "BatchInstance " << mBatchInstanceID << std::endl;
+		of << "--------------------------" << std::endl;
+		of << "Local AABB: " << mAABB << std::endl;
+		of << "Bounding radius: " << mBoundingRadius << std::endl;
+		of << "Number of LODs: " << mLodBucketList.size() << std::endl;
+
+		for (LODBucketList::const_iterator i = mLodBucketList.begin();
+			i != mLodBucketList.end(); ++i)
+		{
+			(*i)->dump(of);
+		}
+		of << "--------------------------" << std::endl;
+	}
+	//--------------------------------------------------------------------------
+	//--------------------------------------------------------------------------
+	InstancedGeometry::LODBucket::LODBucket(BatchInstance* parent, unsigned short lod,
+		Real lodDist)
+		: mParent(parent), mLod(lod), mSquaredDistance(lodDist)
+	{
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::LODBucket::~LODBucket()
+	{
+		// delete
+		for (MaterialBucketMap::iterator i = mMaterialBucketMap.begin();
+			i != mMaterialBucketMap.end(); ++i)
+		{
+			delete i->second;
+		}
+		mMaterialBucketMap.clear();
+		for(QueuedGeometryList::iterator qi = mQueuedGeometryList.begin();
+			qi != mQueuedGeometryList.end(); ++qi)
+		{
+			delete *qi;
+		}
+		mQueuedGeometryList.clear();
+		// no need to delete queued meshes, these are managed in InstancedGeometry
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::LODBucket::assign(QueuedSubMesh* qmesh, ushort atLod)
+	{
+		QueuedGeometry* q = new QueuedGeometry();
+		mQueuedGeometryList.push_back(q);
+		q->position = qmesh->position;
+		q->orientation = qmesh->orientation;
+		q->scale = qmesh->scale;
+		q->ID = qmesh->ID;
+		if (qmesh->geometryLodList->size() > atLod)
+		{
+			// This submesh has enough lods, use the right one
+			q->geometry = &(*qmesh->geometryLodList)[atLod];
+		}
+		else
+		{
+			// Not enough lods, use the lowest one we have
+			q->geometry =
+				&(*qmesh->geometryLodList)[qmesh->geometryLodList->size() - 1];
+		}
+		// Locate a material bucket
+		MaterialBucket* mbucket = 0;
+		MaterialBucketMap::iterator m =
+			mMaterialBucketMap.find(qmesh->materialName);
+		if (m != mMaterialBucketMap.end())
+		{
+			mbucket = m->second;
+		}
+		else
+		{
+			mbucket = new MaterialBucket(this, qmesh->materialName);
+			mMaterialBucketMap[qmesh->materialName] = mbucket;
+		}
+		mbucket->assign(q);
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::LODBucket::build()
+	{
+		// Just pass this on to child buckets
+		
+		for (MaterialBucketMap::iterator i = mMaterialBucketMap.begin();
+			i != mMaterialBucketMap.end(); ++i)
+		{
+			i->second->build();
+		}
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::LODBucket::addRenderables(RenderQueue* queue,
+		uint8 group, Real camDistanceSquared)
+	{
+		// Just pass this on to child buckets
+		MaterialBucketMap::iterator i, iend;
+		iend =  mMaterialBucketMap.end();
+		int j=0;
+		for (i = mMaterialBucketMap.begin(); i != iend; ++i)
+		{
+			i->second->addRenderables(queue, group, camDistanceSquared);
+			j++;
+		}
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::LODBucket::MaterialIterator
+	InstancedGeometry::LODBucket::getMaterialIterator(void)
+	{
+		return MaterialIterator(
+			mMaterialBucketMap.begin(), mMaterialBucketMap.end());
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::LODBucket::dump(std::ofstream& of) const
+	{
+		of << "LOD Bucket " << mLod << std::endl;
+		of << "------------------" << std::endl;
+		of << "Distance: " << Math::Sqrt(mSquaredDistance) << std::endl;
+		of << "Number of Materials: " << mMaterialBucketMap.size() << std::endl;
+		for (MaterialBucketMap::const_iterator i = mMaterialBucketMap.begin();
+			i != mMaterialBucketMap.end(); ++i)
+		{
+			i->second->dump(of);
+		}
+		of << "------------------" << std::endl;
+
+	}
+	//--------------------------------------------------------------------------
+	//--------------------------------------------------------------------------
+	InstancedGeometry::MaterialBucket::MaterialBucket(LODBucket* parent,
+		const String& materialName)
+		: mParent(parent), mMaterialName(materialName),mLastIndex(0)
+	{
+						mMaterial = MaterialManager::getSingleton().getByName(mMaterialName);
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::MaterialBucket::~MaterialBucket()
+	{
+		// delete
+		for (GeometryBucketList::iterator i = mGeometryBucketList.begin();
+			i != mGeometryBucketList.end(); ++i)
+		{
+			delete *i;
+		}
+		mGeometryBucketList.clear();
+		// no need to delete queued meshes, these are managed in InstancedGeometry
+
+	}
+	//--------------------------------------------------------------------------
+
+	void InstancedGeometry::MaterialBucket::assign(QueuedGeometry* qgeom)
+	{
+		// Look up any current geometry
+		String formatString = getGeometryFormatString(qgeom->geometry);
+		CurrentGeometryMap::iterator gi = mCurrentGeometryMap.find(formatString);
+		bool newBucket = true;
+		if (gi != mCurrentGeometryMap.end())
+		{
+			// Found existing geometry, try to assign
+			newBucket = !gi->second->assign(qgeom);
+			// Note that this bucket will be replaced as the 'current'
+			// for this format string below since it's out of space
+		}
+		// Do we need to create a new one?
+		if (newBucket)
+		{
+			GeometryBucket* gbucket = new GeometryBucket(this, formatString,
+				qgeom->geometry->vertexData, qgeom->geometry->indexData);
+			// Add to main list
+			mGeometryBucketList.push_back(gbucket);
+			// Also index in 'current' list
+			mCurrentGeometryMap[formatString] = gbucket;
+			if (!gbucket->assign(qgeom))
+			{
+				OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR,
+					"Somehow we couldn't fit the requested geometry even in a "
+					"brand new GeometryBucket!! Must be a bug, please report.",
+					"InstancedGeometry::MaterialBucket::assign");
+			}
+		}
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::MaterialBucket::build()
+	{
+		mMaterial = MaterialManager::getSingleton().getByName(mMaterialName);
+		if (mMaterial.isNull())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+				"Material '" + mMaterialName + "' not found.",
+				"InstancedGeometry::MaterialBucket::build");
+		}
+		mMaterial->load();
+		// tell the geometry buckets to build
+		
+		for (GeometryBucketList::iterator i = mGeometryBucketList.begin();
+			i != mGeometryBucketList.end(); ++i)
+		{
+			(*i)->build();
+		}
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::MaterialBucket::addRenderables(RenderQueue* queue,
+		uint8 group, Real camDistanceSquared)
+	{
+
+		// Determine the current material technique
+		mTechnique = mMaterial->getTechnique(
+			mMaterial->getLodIndexSquaredDepth(camDistanceSquared));	
+		GeometryBucketList::iterator i, iend;
+		iend =  mGeometryBucketList.end();
+		int j=0;
+			
+		for (i = mGeometryBucketList.begin(); i != iend; ++i)
+		{
+			queue->addRenderable(*i, group);
+			j++;
+		}
+
+	}
+	//--------------------------------------------------------------------------
+	String InstancedGeometry::MaterialBucket::getGeometryFormatString(
+		SubMeshLodGeometryLink* geom)
+	{
+		// Formulate an identifying string for the geometry format
+		// Must take into account the vertex declaration and the index type
+		// Format is (all lines separated by '|'):
+		// Index type
+		// Vertex element (repeating)
+		//   source
+		//   semantic
+		//   type
+		StringUtil::StrStreamType str;
+
+		str << geom->indexData->indexBuffer->getType() << "|";
+		const VertexDeclaration::VertexElementList& elemList =
+			geom->vertexData->vertexDeclaration->getElements();
+		VertexDeclaration::VertexElementList::const_iterator ei, eiend;
+		eiend = elemList.end();
+		for (ei = elemList.begin(); ei != eiend; ++ei)
+		{
+			const VertexElement& elem = *ei;
+			str << elem.getSource() << "|";
+			str << elem.getSource() << "|";
+			str << elem.getSemantic() << "|";
+			str << elem.getType() << "|";
+		}
+
+		return str.str();
+
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::MaterialBucket::GeometryIterator
+	InstancedGeometry::MaterialBucket::getGeometryIterator(void)
+	{
+		return GeometryIterator(
+			mGeometryBucketList.begin(), mGeometryBucketList.end());
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::MaterialBucket::dump(std::ofstream& of) const
+	{
+		of << "Material Bucket " << mMaterialName << std::endl;
+		of << "--------------------------------------------------" << std::endl;
+		of << "Geometry buckets: " << mGeometryBucketList.size() << std::endl;
+		for (GeometryBucketList::const_iterator i = mGeometryBucketList.begin();
+			i != mGeometryBucketList.end(); ++i)
+		{
+			(*i)->dump(of);
+		}
+		of << "--------------------------------------------------" << std::endl;
+
+	}
+	//--------------------------------------------------------------------------
+	//--------------------------------------------------------------------------
+	InstancedGeometry::GeometryBucket::GeometryBucket(MaterialBucket* parent,
+		const String& formatString, const VertexData* vData,
+		const IndexData* iData)
+		: SimpleRenderable(),
+		 mParent(parent), 
+		 mFormatString(formatString),
+		 mVertexData(0),
+		 mIndexData(0)
+	{
+	   	mBatch=mParent->getParent()->getParent()->getParent();
+		if(!mBatch->getBaseSkeleton().isNull())
+			setCustomParameter(0,Vector4(mBatch->getBaseSkeleton()->getNumBones(),0,0,0));
+		//mRenderOperation=new RenderOperation();
+		// Clone the structure from the example
+		mVertexData = vData->clone(false);
+
+		mRenderOp.useIndexes = true;
+		mRenderOp.indexData = new IndexData();
+
+		mRenderOp.indexData->indexCount = 0;
+		mRenderOp.indexData->indexStart = 0;
+		mRenderOp.vertexData = new VertexData();
+		mRenderOp.vertexData->vertexCount = 0;
+
+		mRenderOp.vertexData->vertexDeclaration = vData->vertexDeclaration->clone();
+		mIndexType = iData->indexBuffer->getType();
+		// Derive the max vertices
+		if (mIndexType == HardwareIndexBuffer::IT_32BIT)
+		{
+			mMaxVertexIndex = 0xFFFFFFFF;
+		}
+		else
+		{
+			mMaxVertexIndex = 0xFFFF;
+		}
+
+
+		size_t offset=0, tcOffset=0;
+		unsigned short texCoordOffset=0;
+		unsigned short texCoordSource=0;
+		for(ushort i=0;i<mRenderOp.vertexData->vertexDeclaration->getElementCount();i++)
+		{
+		
+			if(mRenderOp.vertexData->vertexDeclaration->getElement(i)->getSemantic() == VES_TEXTURE_COORDINATES)
+			{
+				texCoordOffset++;
+				texCoordSource=mRenderOp.vertexData->vertexDeclaration->getElement(i)->getSource();
+				tcOffset=mRenderOp.vertexData->vertexDeclaration->getElement(i)->getOffset()+VertexElement::getTypeSize(
+						mRenderOp.vertexData->vertexDeclaration->getElement(i)->getType());
+			}
+			offset+= VertexElement::getTypeSize(
+			mRenderOp.vertexData->vertexDeclaration->getElement(i)->getType());
+		}
+
+		mRenderOp.vertexData->vertexDeclaration->addElement(texCoordSource,tcOffset, VET_FLOAT1, VES_TEXTURE_COORDINATES,texCoordOffset);
+
+		mTexCoordIndex=texCoordOffset;
+		
+		
+
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::GeometryBucket::GeometryBucket(MaterialBucket* parent,
+		const String& formatString,GeometryBucket* bucket)
+		: SimpleRenderable(),
+		 mParent(parent),
+		  mFormatString(formatString),
+		  mVertexData(0),
+		  mIndexData(0)
+	{
+
+	   	mBatch=mParent->getParent()->getParent()->getParent();
+		if(!mBatch->getBaseSkeleton().isNull())
+			setCustomParameter(0,Vector4(mBatch->getBaseSkeleton()->getNumBones(),0,0,0));
+		bucket->getRenderOperation(mRenderOp);
+		mVertexData=mRenderOp.vertexData;
+		mIndexData=mRenderOp.indexData;
+		setBoundingBox(AxisAlignedBox(-10000,-10000,-10000,
+		10000,10000,10000));
+
+	}
+	//--------------------------------------------------------------------------
+	InstancedGeometry::GeometryBucket::~GeometryBucket()
+	{	
+	}
+
+	//--------------------------------------------------------------------------
+	Real InstancedGeometry::GeometryBucket::getBoundingRadius(void) const
+	{
+		return 1;
+	}
+	//--------------------------------------------------------------------------
+	const MaterialPtr& InstancedGeometry::GeometryBucket::getMaterial(void) const
+	{
+		return mParent->getMaterial();
+	}
+	//--------------------------------------------------------------------------
+	Technique* InstancedGeometry::GeometryBucket::getTechnique(void) const
+	{
+		return mParent->getCurrentTechnique();
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::GeometryBucket::getWorldTransforms(Matrix4* xform) const
+	{
+			// Should be the identity transform, but lets allow transformation of the
+		// nodes the BatchInstances are attached to for kicks
+		if(mBatch->getBaseSkeleton().isNull())
+		{
+			BatchInstance::ObjectsMap::iterator it,itbegin,itend,newit;
+			itbegin=mParent->getParent()->getParent()->getInstancesMap().begin();
+			itend=mParent->getParent()->getParent()->getInstancesMap().end();
+
+			for (it=itbegin;
+				it!=itend;
+				++it,++xform)
+			{
+				
+					*xform = it->second->mTransformation;
+			}
+		}
+		else
+		{
+			BatchInstance::ObjectsMap::iterator it,itbegin,itend,newit;
+			itbegin=mParent->getParent()->getParent()->getInstancesMap().begin();
+			itend=mParent->getParent()->getParent()->getInstancesMap().end();
+
+			for (it=itbegin;
+				it!=itend;
+				++it)
+			{
+				
+				for(int i=0;i<it->second->mNumBoneMatrices;++i,++xform)
+				{
+					*xform = it->second->mBoneWorldMatrices[i];
+				}
+			}
+				
+		}
+
+	}
+	//--------------------------------------------------------------------------
+	unsigned short InstancedGeometry::GeometryBucket::getNumWorldTransforms(void) const 
+	{
+		if(mBatch->getBaseSkeleton().isNull())
+		{
+			BatchInstance* batch=mParent->getParent()->getParent();
+			return static_cast<ushort>(batch->getInstancesMap().size());
+		}
+		else
+		{
+			BatchInstance* batch=mParent->getParent()->getParent();
+			return static_cast<ushort>(
+				mBatch->getBaseSkeleton()->getNumBones()*batch->getInstancesMap().size());
+		}
+	}
+	//--------------------------------------------------------------------------
+	const Quaternion& InstancedGeometry::GeometryBucket::getWorldOrientation(void) const
+	{
+		return Quaternion::IDENTITY;
+	}
+	//--------------------------------------------------------------------------
+	const Vector3& InstancedGeometry::GeometryBucket::getWorldPosition(void) const
+	{
+		return Vector3::ZERO;
+	}
+	//--------------------------------------------------------------------------
+	Real InstancedGeometry::GeometryBucket::getSquaredViewDepth(const Camera* cam) const
+	{
+		return mParent->getParent()->getSquaredDistance();
+	}
+	//--------------------------------------------------------------------------
+	const LightList& InstancedGeometry::GeometryBucket::getLights(void) const
+	{
+		return mParent->getParent()->getParent()->getLights();
+	}
+	//--------------------------------------------------------------------------
+	bool InstancedGeometry::GeometryBucket::getCastsShadows(void) const
+	{
+		return mParent->getParent()->getParent()->getCastShadows();
+	}
+	//--------------------------------------------------------------------------
+	bool InstancedGeometry::GeometryBucket::assign(QueuedGeometry* qgeom)
+	{
+		// Do we have enough space?
+		if (mRenderOp.vertexData->vertexCount + qgeom->geometry->vertexData->vertexCount
+			> mMaxVertexIndex)
+		{
+			return false;
+		}
+
+		mQueuedGeometry.push_back(qgeom);
+		mRenderOp.vertexData->vertexCount += qgeom->geometry->vertexData->vertexCount;
+		mRenderOp.indexData->indexCount += qgeom->geometry->indexData->indexCount;
+
+		return true;
+	}
+
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::GeometryBucket::build()
+	{
+
+
+	
+		// Ok, here's where we transfer the vertices and indexes to the shared
+		// buffers
+		// Shortcuts
+		VertexDeclaration* dcl = mRenderOp.vertexData->vertexDeclaration;
+		VertexBufferBinding* binds =mVertexData->vertexBufferBinding;
+
+		// create index buffer, and lock
+		mRenderOp.indexData->indexBuffer = HardwareBufferManager::getSingleton()
+			.createIndexBuffer(mIndexType, mRenderOp.indexData->indexCount,
+				HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+		uint32* p32Dest = 0;
+		uint16* p16Dest = 0;
+
+		if (mIndexType == HardwareIndexBuffer::IT_32BIT)
+		{
+			p32Dest = static_cast<uint32*>(
+				mRenderOp.indexData->indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+		}
+		else
+		{
+			p16Dest = static_cast<uint16*>(
+				mRenderOp.indexData->indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+		}
+
+		// create all vertex buffers, and lock
+		ushort b;
+		//ushort posBufferIdx = dcl->findElementBySemantic(VES_POSITION)->getSource();
+	
+		std::vector<uchar*> destBufferLocks;
+		std::vector<VertexDeclaration::VertexElementList> bufferElements;
+
+		for (b = 0; b < binds->getBufferCount(); ++b)
+		{
+
+			size_t vertexCount = mRenderOp.vertexData->vertexCount;
+
+			HardwareVertexBufferSharedPtr vbuf =
+				HardwareBufferManager::getSingleton().createVertexBuffer(
+					dcl->getVertexSize(b),
+					vertexCount,
+					HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+			binds->setBinding(b, vbuf);
+			uchar* pLock = static_cast<uchar*>(
+				vbuf->lock(HardwareBuffer::HBL_DISCARD));
+			destBufferLocks.push_back(pLock);
+			// Pre-cache vertex elements per buffer
+			bufferElements.push_back(dcl->findElementsBySource(b));
+			mRenderOp.vertexData->vertexBufferBinding->setBinding(b,vbuf);
+		}
+
+
+		// Iterate over the geometry items
+		size_t indexOffset = 0;
+
+		QueuedGeometryList::iterator gi, giend;
+		giend = mQueuedGeometry.end();
+
+		// to generate the boundingBox
+		Real Xmin,Ymin,Zmin,Xmax,Ymax,Zmax; 
+		Xmin=0;
+		Ymin=0;
+		Zmin=0;
+		Xmax=0;
+		Ymax=0;
+		Zmax=0;
+		QueuedGeometry* precGeom = *(mQueuedGeometry.begin());
+		int index=0;
+		if( mParent->getLastIndex()!=0)
+			index=mParent->getLastIndex()+1;
+
+		for (gi = mQueuedGeometry.begin(); gi != giend; ++gi)
+		{
+
+			QueuedGeometry* geom = *gi;
+			if(precGeom->ID!=geom->ID)
+					index++;
+
+			//create  a new instanced object
+			InstancedObject* instancedObject = mParent->getParent()->getParent()->isInstancedObjectPresent(index);
+			if(instancedObject == NULL)
+			{
+				if(mBatch->getBaseSkeleton().isNull())
+				{
+					instancedObject=new InstancedObject(index);
+				}
+				else
+				{
+					instancedObject=new InstancedObject(index,mBatch->getBaseSkeletonInstance(),
+						mBatch->getBaseAnimationState());
+				}
+				mParent->getParent()->getParent()->addInstancedObject(index,instancedObject);
+
+			}
+			instancedObject->addBucketToList(this);
+
+
+			
+			// Copy indexes across with offset
+			IndexData* srcIdxData = geom->geometry->indexData;
+			if (mIndexType == HardwareIndexBuffer::IT_32BIT)
+			{
+				// Lock source indexes
+				uint32* pSrc = static_cast<uint32*>(
+					srcIdxData->indexBuffer->lock(
+						srcIdxData->indexStart, 
+						srcIdxData->indexCount * srcIdxData->indexBuffer->getIndexSize(),
+						HardwareBuffer::HBL_READ_ONLY));
+
+				copyIndexes(pSrc, p32Dest, srcIdxData->indexCount, indexOffset);
+				p32Dest += srcIdxData->indexCount;
+				srcIdxData->indexBuffer->unlock();
+			}
+			else
+			{
+				
+				// Lock source indexes
+				uint16* pSrc = static_cast<uint16*>(
+					srcIdxData->indexBuffer->lock(
+					srcIdxData->indexStart, 
+					srcIdxData->indexCount * srcIdxData->indexBuffer->getIndexSize(),
+					HardwareBuffer::HBL_READ_ONLY));
+
+				copyIndexes(pSrc, p16Dest, srcIdxData->indexCount, indexOffset);
+				p16Dest += srcIdxData->indexCount;
+				srcIdxData->indexBuffer->unlock();
+			}
+
+			// Now deal with vertex buffers
+			// we can rely on buffer counts / formats being the same
+			VertexData* srcVData = geom->geometry->vertexData;
+			VertexBufferBinding* srcBinds = srcVData->vertexBufferBinding;
+		
+			for (b = 0; b < binds->getBufferCount(); ++b)
+			{
+
+				// lock source
+				HardwareVertexBufferSharedPtr srcBuf =
+					srcBinds->getBuffer(b);
+				uchar* pSrcBase = static_cast<uchar*>(
+					srcBuf->lock(HardwareBuffer::HBL_READ_ONLY));
+				// Get buffer lock pointer, we'll update this later
+				uchar* pDstBase = destBufferLocks[b];
+				size_t bufInc = srcBuf->getVertexSize();
+			
+				// Iterate over vertices
+				float *pSrcReal, *pDstReal;
+				Vector3 tmp;
+
+			
+			
+				for (size_t v = 0; v < srcVData->vertexCount; ++v)
+				{
+					//to know if the current buffer is the one with the buffer or not
+					bool isTheBufferWithIndex=false;
+					// Iterate over vertex elements
+					VertexDeclaration::VertexElementList& elems =
+						bufferElements[b];
+					VertexDeclaration::VertexElementList::iterator ei;
+				
+					for (ei = elems.begin(); ei != elems.end(); ++ei)
+					{
+						VertexElement& elem = *ei;
+						elem.baseVertexPointerToElement(pSrcBase, &pSrcReal);
+						elem.baseVertexPointerToElement(pDstBase, &pDstReal);
+						if(elem.getSemantic()==VES_TEXTURE_COORDINATES && elem.getIndex()==mTexCoordIndex)
+						{
+							isTheBufferWithIndex=true;
+							*pDstReal++=index;
+						}
+						else
+						{
+							switch (elem.getSemantic())
+							{
+								case VES_POSITION:
+									tmp.x = *pSrcReal++;
+									tmp.y = *pSrcReal++;
+									tmp.z = *pSrcReal++;
+									*pDstReal++ = tmp.x;
+									*pDstReal++ = tmp.y;
+									*pDstReal++ = tmp.z;
+									if(tmp.x<Xmin)
+										Xmin = tmp.x;
+									if(tmp.y<Ymin)
+										Ymin = tmp.y;
+									if(tmp.z<Zmin)
+										Zmin = tmp.z;
+									if(tmp.x>Xmax)
+										Xmax = tmp.x;
+									if(tmp.y>Ymax)
+										Ymax = tmp.y;
+									if(tmp.z>Zmax)
+										Zmax = tmp.z;
+								default:
+								// just raw copy
+								memcpy(pDstReal, pSrcReal,
+									VertexElement::getTypeSize(elem.getType()));
+								break;
+							};
+
+						}
+					
+
+					}
+					if (isTheBufferWithIndex)
+					pDstBase += bufInc+4;
+					else
+					pDstBase += bufInc;
+					pSrcBase += bufInc;
+
+				}
+	
+				// Update pointer
+				destBufferLocks[b] = pDstBase;
+				srcBuf->unlock();
+
+			
+			}
+			indexOffset += geom->geometry->vertexData->vertexCount;
+
+
+		precGeom=geom;
+
+		}
+		mParent->setLastIndex(index);
+		// Unlock everything
+		mRenderOp.indexData->indexBuffer->unlock();
+		for (b = 0; b < binds->getBufferCount(); ++b)
+		{
+			binds->getBuffer(b)->unlock();
+		}
+	
+	delete mVertexData;
+	delete mIndexData;
+	
+	mVertexData=mRenderOp.vertexData;
+	mIndexData=mRenderOp.indexData;
+	mBatch->getRenderOperationVector().push_back(&mRenderOp);
+	setBoundingBox(AxisAlignedBox(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax));
+	mAABB=AxisAlignedBox(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
+
+	}
+	//--------------------------------------------------------------------------
+	void InstancedGeometry::GeometryBucket::dump(std::ofstream& of) const
+	{
+		of << "Geometry Bucket" << std::endl;
+		of << "---------------" << std::endl;
+		of << "Format string: " << mFormatString << std::endl;
+		of << "Geometry items: " << mQueuedGeometry.size() << std::endl;
+		of << "---------------" << std::endl;
+
+	}
+	//--------------------------------------------------------------------------
+
+}
+
Index: /OgreMain/src/OgreKeyFrame.cpp
===================================================================
--- /OgreMain/src/OgreKeyFrame.cpp	(revision 5)
+++ /OgreMain/src/OgreKeyFrame.cpp	(revision 5)
@@ -0,0 +1,215 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreKeyFrame.h"
+#include "OgreAnimationTrack.h"
+#include "OgreHardwareBufferManager.h"
+
+namespace Ogre
+{
+    //---------------------------------------------------------------------
+    KeyFrame::KeyFrame(const AnimationTrack* parent, Real time) 
+        : mTime(time), mParentTrack(parent)
+    {
+    }
+	//---------------------------------------------------------------------
+	KeyFrame* KeyFrame::_clone(AnimationTrack* newParent) const
+	{
+		return new KeyFrame(newParent, mTime);
+	}
+	//---------------------------------------------------------------------
+	NumericKeyFrame::NumericKeyFrame(const AnimationTrack* parent, Real time)
+		:KeyFrame(parent, time)
+	{
+	}
+	//---------------------------------------------------------------------
+	const AnyNumeric& NumericKeyFrame::getValue(void) const
+	{
+		return mValue;
+	}
+	//---------------------------------------------------------------------
+	void NumericKeyFrame::setValue(const AnyNumeric& val)
+	{
+		mValue = val;
+	}
+    //---------------------------------------------------------------------
+	KeyFrame* NumericKeyFrame::_clone(AnimationTrack* newParent) const
+	{
+		NumericKeyFrame* newKf = new NumericKeyFrame(newParent, mTime);
+		newKf->mValue = mValue;
+		return newKf;
+	}
+    //---------------------------------------------------------------------
+	TransformKeyFrame::TransformKeyFrame(const AnimationTrack* parent, Real time)
+		:KeyFrame(parent, time), mTranslate(Vector3::ZERO), 
+		mScale(Vector3::UNIT_SCALE), mRotate(Quaternion::IDENTITY) 
+	{
+	}
+	//---------------------------------------------------------------------
+    void TransformKeyFrame::setTranslate(const Vector3& trans)
+    {
+        mTranslate = trans;
+        if (mParentTrack)
+            mParentTrack->_keyFrameDataChanged();
+    }
+    //---------------------------------------------------------------------
+    const Vector3& TransformKeyFrame::getTranslate(void) const
+    {
+        return mTranslate;
+    }
+    //---------------------------------------------------------------------
+    void TransformKeyFrame::setScale(const Vector3& scale)
+    {
+        mScale = scale;
+        if (mParentTrack)
+            mParentTrack->_keyFrameDataChanged();
+    }
+    //---------------------------------------------------------------------
+    const Vector3& TransformKeyFrame::getScale(void) const
+    {
+        return mScale;
+    }
+    //---------------------------------------------------------------------
+    void TransformKeyFrame::setRotation(const Quaternion& rot)
+    {
+        mRotate = rot;
+        if (mParentTrack)
+            mParentTrack->_keyFrameDataChanged();
+    }
+    //---------------------------------------------------------------------
+    const Quaternion& TransformKeyFrame::getRotation(void) const
+    {
+        return mRotate;
+    }
+    //---------------------------------------------------------------------
+	KeyFrame* TransformKeyFrame::_clone(AnimationTrack* newParent) const
+	{
+		TransformKeyFrame* newKf = new TransformKeyFrame(newParent, mTime);
+		newKf->mTranslate = mTranslate;
+		newKf->mScale = mScale;
+		newKf->mRotate = mRotate;
+		return newKf;
+	}
+	//---------------------------------------------------------------------
+	VertexMorphKeyFrame::VertexMorphKeyFrame(const AnimationTrack* parent, Real time)
+		: KeyFrame(parent, time)
+	{
+	}
+	//---------------------------------------------------------------------
+	void VertexMorphKeyFrame::setVertexBuffer(const HardwareVertexBufferSharedPtr& buf)
+	{
+		mBuffer = buf;
+	}
+	//---------------------------------------------------------------------
+	const HardwareVertexBufferSharedPtr& 
+	VertexMorphKeyFrame::getVertexBuffer(void) const
+	{
+		return mBuffer;
+	}
+    //---------------------------------------------------------------------
+	KeyFrame* VertexMorphKeyFrame::_clone(AnimationTrack* newParent) const
+	{
+		VertexMorphKeyFrame* newKf = new VertexMorphKeyFrame(newParent, mTime);
+		newKf->mBuffer = mBuffer;
+		return newKf;
+	}	
+	//---------------------------------------------------------------------
+	VertexPoseKeyFrame::VertexPoseKeyFrame(const AnimationTrack* parent, Real time)
+		:KeyFrame(parent, time)
+	{
+	}
+	//---------------------------------------------------------------------
+	void VertexPoseKeyFrame::addPoseReference(ushort poseIndex, Real influence)
+	{
+		mPoseRefs.push_back(PoseRef(poseIndex, influence));
+	}
+	//---------------------------------------------------------------------
+	void VertexPoseKeyFrame::updatePoseReference(ushort poseIndex, Real influence)
+	{
+		for (PoseRefList::iterator i = mPoseRefs.begin(); i != mPoseRefs.end(); ++i)
+		{
+			if (i->poseIndex == poseIndex)
+			{
+				i->influence = influence;
+				return;
+			}
+		}
+		// if we got here, we didn't find it
+		addPoseReference(poseIndex, influence);
+
+	}
+	//---------------------------------------------------------------------
+	void VertexPoseKeyFrame::removePoseReference(ushort poseIndex)
+	{
+		for (PoseRefList::iterator i = mPoseRefs.begin(); i != mPoseRefs.end(); ++i)
+		{
+			if (i->poseIndex == poseIndex)
+			{
+				mPoseRefs.erase(i);
+				return;
+			}
+		}
+	}
+	//---------------------------------------------------------------------
+	void VertexPoseKeyFrame::removeAllPoseReferences(void)
+	{
+		mPoseRefs.clear();
+	}
+	//---------------------------------------------------------------------
+	const VertexPoseKeyFrame::PoseRefList& 
+	VertexPoseKeyFrame::getPoseReferences(void) const
+	{
+		return mPoseRefs;
+	}
+	//---------------------------------------------------------------------
+	VertexPoseKeyFrame::PoseRefIterator 
+	VertexPoseKeyFrame::getPoseReferenceIterator(void)
+	{
+		return PoseRefIterator(mPoseRefs.begin(), mPoseRefs.end());
+	}
+	//---------------------------------------------------------------------
+	VertexPoseKeyFrame::ConstPoseRefIterator 
+	VertexPoseKeyFrame::getPoseReferenceIterator(void) const
+	{
+		return ConstPoseRefIterator(mPoseRefs.begin(), mPoseRefs.end());
+	}
+    //---------------------------------------------------------------------
+	KeyFrame* VertexPoseKeyFrame::_clone(AnimationTrack* newParent) const
+	{
+		VertexPoseKeyFrame* newKf = new VertexPoseKeyFrame(newParent, mTime);
+		// By-value copy ok
+		newKf->mPoseRefs = mPoseRefs;
+		return newKf;
+	}	
+	//---------------------------------------------------------------------
+
+
+}
+
Index: /OgreMain/src/OgreLight.cpp
===================================================================
--- /OgreMain/src/OgreLight.cpp	(revision 5)
+++ /OgreMain/src/OgreLight.cpp	(revision 5)
@@ -0,0 +1,745 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreLight.h"
+
+#include "OgreException.h"
+#include "OgreSceneNode.h"
+#include "OgreCamera.h"
+#include "OgreSceneManager.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    Light::Light()
+		: mLightType(LT_POINT),
+          mPosition(Vector3::ZERO),
+          mDiffuse(ColourValue::White),
+          mSpecular(ColourValue::Black),
+          mDirection(Vector3::UNIT_Z),
+		  mSpotOuter(Degree(40.0f)),
+          mSpotInner(Degree(30.0f)),
+          mSpotFalloff(1.0f),
+		  mRange(100000),
+		  mAttenuationConst(1.0f),
+		  mAttenuationLinear(0.0f),
+          mAttenuationQuad(0.0f),
+		  mPowerScale(1.0f),
+          mDerivedPosition(Vector3::ZERO),
+          mDerivedDirection(Vector3::UNIT_Z),
+          mDerivedTransformDirty(false),
+		  mCustomShadowCameraSetup()
+    {
+    }
+    //-----------------------------------------------------------------------
+	Light::Light(const String& name) : MovableObject(name),
+        mLightType(LT_POINT),
+        mPosition(Vector3::ZERO),
+        mDiffuse(ColourValue::White),
+        mSpecular(ColourValue::Black),
+        mDirection(Vector3::UNIT_Z),
+		mSpotOuter(Degree(40.0f)),
+        mSpotInner(Degree(30.0f)),
+        mSpotFalloff(1.0f),
+		mRange(100000),
+		mAttenuationConst(1.0f),
+		mAttenuationLinear(0.0f),
+        mAttenuationQuad(0.0f),
+		mPowerScale(1.0f),
+        mDerivedPosition(Vector3::ZERO),
+        mDerivedDirection(Vector3::UNIT_Z),
+        mDerivedTransformDirty(false),
+		mCustomShadowCameraSetup()
+    {
+    }
+    //-----------------------------------------------------------------------
+    Light::~Light()
+    {
+    }
+    //-----------------------------------------------------------------------
+    void Light::setType(LightTypes type)
+    {
+        mLightType = type;
+    }
+    //-----------------------------------------------------------------------
+    Light::LightTypes Light::getType(void) const
+    {
+        return mLightType;
+    }
+    //-----------------------------------------------------------------------
+    void Light::setPosition(Real x, Real y, Real z)
+    {
+        mPosition.x = x;
+        mPosition.y = y;
+        mPosition.z = z;
+        mDerivedTransformDirty = true;
+
+    }
+    //-----------------------------------------------------------------------
+    void Light::setPosition(const Vector3& vec)
+    {
+        mPosition = vec;
+        mDerivedTransformDirty = true;
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& Light::getPosition(void) const
+    {
+        return mPosition;
+    }
+    //-----------------------------------------------------------------------
+    void Light::setDirection(Real x, Real y, Real z)
+    {
+        mDirection.x = x;
+        mDirection.y = y;
+        mDirection.z = z;
+        mDerivedTransformDirty = true;
+    }
+    //-----------------------------------------------------------------------
+    void Light::setDirection(const Vector3& vec)
+    {
+        mDirection = vec;
+        mDerivedTransformDirty = true;
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& Light::getDirection(void) const
+    {
+        return mDirection;
+    }
+    //-----------------------------------------------------------------------
+    void Light::setSpotlightRange(const Radian& innerAngle, const Radian& outerAngle, Real falloff)
+    {
+
+        if (mLightType != LT_SPOTLIGHT)
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "setSpotlightRange is only valid for spotlights.",
+                "Light::setSpotlightRange");
+
+        mSpotInner =innerAngle;
+        mSpotOuter = outerAngle;
+        mSpotFalloff = falloff;
+    }
+	//-----------------------------------------------------------------------
+	void Light::setSpotlightInnerAngle(const Radian& val)
+	{
+		mSpotInner = val;
+	}
+	//-----------------------------------------------------------------------
+	void Light::setSpotlightOuterAngle(const Radian& val)
+	{
+		mSpotOuter = val;
+	}
+	//-----------------------------------------------------------------------
+	void Light::setSpotlightFalloff(Real val)
+	{
+		mSpotFalloff = val;
+	}
+    //-----------------------------------------------------------------------
+    const Radian& Light::getSpotlightInnerAngle(void) const
+    {
+        return mSpotInner;
+    }
+    //-----------------------------------------------------------------------
+    const Radian& Light::getSpotlightOuterAngle(void) const
+    {
+        return mSpotOuter;
+    }
+    //-----------------------------------------------------------------------
+    Real Light::getSpotlightFalloff(void) const
+    {
+        return mSpotFalloff;
+    }
+    //-----------------------------------------------------------------------
+    void Light::setDiffuseColour(Real red, Real green, Real blue)
+    {
+        mDiffuse.r = red;
+        mDiffuse.b = blue;
+        mDiffuse.g = green;
+    }
+    //-----------------------------------------------------------------------
+    void Light::setDiffuseColour(const ColourValue& colour)
+    {
+        mDiffuse = colour;
+    }
+    //-----------------------------------------------------------------------
+    const ColourValue& Light::getDiffuseColour(void) const
+    {
+        return mDiffuse;
+    }
+    //-----------------------------------------------------------------------
+    void Light::setSpecularColour(Real red, Real green, Real blue)
+    {
+        mSpecular.r = red;
+        mSpecular.b = blue;
+        mSpecular.g = green;
+    }
+    //-----------------------------------------------------------------------
+    void Light::setSpecularColour(const ColourValue& colour)
+    {
+        mSpecular = colour;
+    }
+    //-----------------------------------------------------------------------
+    const ColourValue& Light::getSpecularColour(void) const
+    {
+        return mSpecular;
+    }
+    //-----------------------------------------------------------------------
+    void Light::setAttenuation(Real range, Real constant,
+                        Real linear, Real quadratic)
+    {
+        mRange = range;
+        mAttenuationConst = constant;
+        mAttenuationLinear = linear;
+        mAttenuationQuad = quadratic;
+    }
+    //-----------------------------------------------------------------------
+    Real Light::getAttenuationRange(void) const
+    {
+        return mRange;
+    }
+    //-----------------------------------------------------------------------
+    Real Light::getAttenuationConstant(void) const
+    {
+        return mAttenuationConst;
+    }
+    //-----------------------------------------------------------------------
+    Real Light::getAttenuationLinear(void) const
+    {
+        return mAttenuationLinear;
+    }
+    //-----------------------------------------------------------------------
+    Real Light::getAttenuationQuadric(void) const
+    {
+        return mAttenuationQuad;
+    }
+    //-----------------------------------------------------------------------
+	void Light::setPowerScale(Real power)
+	{
+		mPowerScale = power;
+	}
+    //-----------------------------------------------------------------------
+	Real Light::getPowerScale(void) const
+	{
+		return mPowerScale;
+	}
+    //-----------------------------------------------------------------------
+    void Light::update(void) const
+    {
+        if (mDerivedTransformDirty)
+        {
+            if (mParentNode)
+            {
+                // Ok, update with SceneNode we're attached to
+                const Quaternion& parentOrientation = mParentNode->_getDerivedOrientation();
+                const Vector3& parentPosition = mParentNode->_getDerivedPosition();
+                mDerivedDirection = parentOrientation * mDirection;
+                mDerivedPosition = (parentOrientation * mPosition) + parentPosition;
+            }
+            else
+            {
+                mDerivedPosition = mPosition;
+                mDerivedDirection = mDirection;
+            }
+
+            mDerivedTransformDirty = false;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Light::_notifyAttached(Node* parent, bool isTagPoint)
+    {
+        mDerivedTransformDirty = true;
+
+        MovableObject::_notifyAttached(parent, isTagPoint);
+    }
+    //-----------------------------------------------------------------------
+    void Light::_notifyMoved(void)
+    {
+        mDerivedTransformDirty = true;
+
+        MovableObject::_notifyMoved();
+    }
+    //-----------------------------------------------------------------------
+    const AxisAlignedBox& Light::getBoundingBox(void) const
+    {
+        // Null, lights are not visible
+        static AxisAlignedBox box;
+        return box;
+    }
+    //-----------------------------------------------------------------------
+    void Light::_updateRenderQueue(RenderQueue* queue)
+    {
+        // Do nothing
+    }
+    //-----------------------------------------------------------------------
+    const String& Light::getMovableType(void) const
+    {
+		return LightFactory::FACTORY_TYPE_NAME;
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& Light::getDerivedPosition(void) const
+    {
+        update();
+        return mDerivedPosition;
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& Light::getDerivedDirection(void) const
+    {
+        update();
+        return mDerivedDirection;
+    }
+    //-----------------------------------------------------------------------
+    void Light::setVisible(bool visible)
+    {
+        MovableObject::setVisible(visible);
+    }
+    //-----------------------------------------------------------------------
+	Vector4 Light::getAs4DVector(void) const
+	{
+		Vector4 ret;
+        if (mLightType == Light::LT_DIRECTIONAL)
+        {
+            ret = -(getDerivedDirection()); // negate direction as 'position'
+            ret.w = 0.0; // infinite distance
+        }	
+		else
+        {
+            ret = getDerivedPosition();
+            ret.w = 1.0;
+        }
+		return ret;
+	}
+    //-----------------------------------------------------------------------
+    const PlaneBoundedVolume& Light::_getNearClipVolume(const Camera* const cam) const
+    {
+        // First check if the light is close to the near plane, since
+        // in this case we have to build a degenerate clip volume
+        mNearClipVolume.planes.clear();
+        mNearClipVolume.outside = Plane::NEGATIVE_SIDE;
+
+        Real n = cam->getNearClipDistance();
+        // Homogenous position
+        Vector4 lightPos = getAs4DVector();
+        // 3D version (not the same as _getDerivedPosition, is -direction for
+        // directional lights)
+        Vector3 lightPos3 = Vector3(lightPos.x, lightPos.y, lightPos.z);
+
+        // Get eye-space light position
+        // use 4D vector so directional lights still work
+        Vector4 eyeSpaceLight = cam->getViewMatrix() * lightPos;
+        // Find distance to light, project onto -Z axis
+        Real d = eyeSpaceLight.dotProduct(
+            Vector4(0, 0, -1, -n) );
+        #define THRESHOLD 1e-6
+        if (d > THRESHOLD || d < -THRESHOLD)
+        {
+            // light is not too close to the near plane
+            // First find the worldspace positions of the corners of the viewport
+            const Vector3 *corner = cam->getWorldSpaceCorners();
+            int winding = (d < 0) ^ cam->isReflected() ? +1 : -1;
+            // Iterate over world points and form side planes
+            Vector3 normal;
+            Vector3 lightDir;
+            for (unsigned int i = 0; i < 4; ++i)
+            {
+                // Figure out light dir
+                lightDir = lightPos3 - (corner[i] * lightPos.w);
+                // Cross with anticlockwise corner, therefore normal points in
+                normal = (corner[i] - corner[(i+winding)%4])
+                    .crossProduct(lightDir);
+                normal.normalise();
+                mNearClipVolume.planes.push_back(Plane(normal, corner[i]));
+            }
+
+            // Now do the near plane plane
+            normal = cam->getFrustumPlane(FRUSTUM_PLANE_NEAR).normal;
+            if (d < 0)
+            {
+                // Behind near plane
+                normal = -normal;
+            }
+            const Vector3& cameraPos = cam->getDerivedPosition();
+            mNearClipVolume.planes.push_back(Plane(normal, cameraPos));
+
+            // Finally, for a point/spot light we can add a sixth plane
+            // This prevents false positives from behind the light
+            if (mLightType != LT_DIRECTIONAL)
+            {
+                // Direction from light perpendicular to near plane
+                mNearClipVolume.planes.push_back(Plane(-normal, lightPos3));
+            }
+        }
+        else
+        {
+            // light is close to being on the near plane
+            // degenerate volume including the entire scene 
+            // we will always require light / dark caps
+            mNearClipVolume.planes.push_back(Plane(Vector3::UNIT_Z, -n));
+            mNearClipVolume.planes.push_back(Plane(-Vector3::UNIT_Z, n));
+        }
+
+        return mNearClipVolume;
+    }
+    //-----------------------------------------------------------------------
+    const PlaneBoundedVolumeList& Light::_getFrustumClipVolumes(const Camera* const cam) const
+    {
+
+        // Homogenous light position
+        Vector4 lightPos = getAs4DVector();
+        // 3D version (not the same as _getDerivedPosition, is -direction for
+        // directional lights)
+        Vector3 lightPos3 = Vector3(lightPos.x, lightPos.y, lightPos.z);
+
+        const Vector3 *clockwiseVerts[4];
+
+        // Get worldspace frustum corners
+        const Vector3* corners = cam->getWorldSpaceCorners();
+        int winding = cam->isReflected() ? +1 : -1;
+
+        bool infiniteViewDistance = (cam->getFarClipDistance() == 0);
+
+        mFrustumClipVolumes.clear();
+        for (unsigned short n = 0; n < 6; ++n)
+        {
+            // Skip far plane if infinite view frustum
+            if (infiniteViewDistance && n == FRUSTUM_PLANE_FAR)
+                continue;
+
+            const Plane& plane = cam->getFrustumPlane(n);
+            Vector4 planeVec(plane.normal.x, plane.normal.y, plane.normal.z, plane.d);
+            // planes face inwards, we need to know if light is on negative side
+            Real d = planeVec.dotProduct(lightPos);
+            if (d < -1e-06)
+            {
+                // Ok, this is a valid one
+                // clockwise verts mean we can cross-product and always get normals
+                // facing into the volume we create
+
+                mFrustumClipVolumes.push_back(PlaneBoundedVolume());
+                PlaneBoundedVolume& vol = mFrustumClipVolumes.back();
+                switch(n)
+                {
+                case(FRUSTUM_PLANE_NEAR):
+                    clockwiseVerts[0] = corners + 3;
+                    clockwiseVerts[1] = corners + 2;
+                    clockwiseVerts[2] = corners + 1;
+                    clockwiseVerts[3] = corners + 0;
+                    break;
+                case(FRUSTUM_PLANE_FAR):
+                    clockwiseVerts[0] = corners + 7;
+                    clockwiseVerts[1] = corners + 6;
+                    clockwiseVerts[2] = corners + 5;
+                    clockwiseVerts[3] = corners + 4;
+                    break;
+                case(FRUSTUM_PLANE_LEFT):
+                    clockwiseVerts[0] = corners + 2;
+                    clockwiseVerts[1] = corners + 6;
+                    clockwiseVerts[2] = corners + 5;
+                    clockwiseVerts[3] = corners + 1;
+                    break;
+                case(FRUSTUM_PLANE_RIGHT):
+                    clockwiseVerts[0] = corners + 7;
+                    clockwiseVerts[1] = corners + 3;
+                    clockwiseVerts[2] = corners + 0;
+                    clockwiseVerts[3] = corners + 4;
+                    break;
+                case(FRUSTUM_PLANE_TOP):
+                    clockwiseVerts[0] = corners + 0;
+                    clockwiseVerts[1] = corners + 1;
+                    clockwiseVerts[2] = corners + 5;
+                    clockwiseVerts[3] = corners + 4;
+                    break;
+                case(FRUSTUM_PLANE_BOTTOM):
+                    clockwiseVerts[0] = corners + 7;
+                    clockwiseVerts[1] = corners + 6;
+                    clockwiseVerts[2] = corners + 2;
+                    clockwiseVerts[3] = corners + 3;
+                    break;
+                };
+
+                // Build a volume
+                // Iterate over world points and form side planes
+                Vector3 normal;
+                Vector3 lightDir;
+                for (unsigned int i = 0; i < 4; ++i)
+                {
+                    // Figure out light dir
+                    lightDir = lightPos3 - (*(clockwiseVerts[i]) * lightPos.w);
+                    Vector3 edgeDir = *(clockwiseVerts[i]) - *(clockwiseVerts[(i+winding)%4]);
+                    // Cross with anticlockwise corner, therefore normal points in
+                    normal = edgeDir.crossProduct(lightDir);
+                    normal.normalise();
+                    vol.planes.push_back(Plane(normal, *(clockwiseVerts[i])));
+                }
+
+                // Now do the near plane (this is the plane of the side we're 
+                // talking about, with the normal inverted (d is already interpreted as -ve)
+                vol.planes.push_back( Plane(-plane.normal, plane.d) );
+
+                // Finally, for a point/spot light we can add a sixth plane
+                // This prevents false positives from behind the light
+                if (mLightType != LT_DIRECTIONAL)
+                {
+                    // re-use our own plane normal
+                    vol.planes.push_back(Plane(plane.normal, lightPos3));
+                }
+            }
+        }
+
+        return mFrustumClipVolumes;
+    }
+	//-----------------------------------------------------------------------
+	uint32 Light::getTypeFlags(void) const
+	{
+		return SceneManager::LIGHT_TYPE_MASK;
+	}
+	//-----------------------------------------------------------------------
+	const String& Light::getAnimableDictionaryName(void) const
+	{
+		return LightFactory::FACTORY_TYPE_NAME;
+	}
+	//-----------------------------------------------------------------------
+	void Light::initialiseAnimableDictionary(StringVector& vec) const
+	{
+		vec.push_back("diffuseColour");
+		vec.push_back("specularColour");
+		vec.push_back("attenuation");
+		vec.push_back("spotlightInner");
+		vec.push_back("spotlightOuter");
+		vec.push_back("spotlightFalloff");
+
+	}
+	//-----------------------------------------------------------------------
+	class LightDiffuseColourValue : public AnimableValue
+	{
+	protected:
+		Light* mLight;
+	public:
+		LightDiffuseColourValue(Light* l) :AnimableValue(COLOUR) 
+		{ mLight = l; }
+		void setValue(const ColourValue& val)
+		{
+			mLight->setDiffuseColour(val);
+		}
+		void applyDeltaValue(const ColourValue& val)
+		{
+			setValue(mLight->getDiffuseColour() + val);
+		}
+		void setCurrentStateAsBaseValue(void)
+		{
+			setAsBaseValue(mLight->getDiffuseColour());
+		}
+
+	};
+	//-----------------------------------------------------------------------
+	class LightSpecularColourValue : public AnimableValue
+	{
+	protected:
+		Light* mLight;
+	public:
+		LightSpecularColourValue(Light* l) :AnimableValue(COLOUR) 
+		{ mLight = l; }
+		void setValue(const ColourValue& val)
+		{
+			mLight->setSpecularColour(val);
+		}
+		void applyDeltaValue(const ColourValue& val)
+		{
+			setValue(mLight->getSpecularColour() + val);
+		}
+		void setCurrentStateAsBaseValue(void)
+		{
+			setAsBaseValue(mLight->getSpecularColour());
+		}
+
+	};
+	//-----------------------------------------------------------------------
+	class LightAttenuationValue : public AnimableValue
+	{
+	protected:
+		Light* mLight;
+	public:
+		LightAttenuationValue(Light* l) :AnimableValue(VECTOR4) 
+		{ mLight = l; }
+		void setValue(const Vector4& val)
+		{
+			mLight->setAttenuation(val.x, val.y, val.z, val.w);
+		}
+		void applyDeltaValue(const Vector4& val)
+		{
+			setValue(mLight->getAs4DVector() + val);
+		}
+		void setCurrentStateAsBaseValue(void)
+		{
+			setAsBaseValue(mLight->getAs4DVector());
+		}
+
+	};
+	//-----------------------------------------------------------------------
+	class LightSpotlightInnerValue : public AnimableValue
+	{
+	protected:
+		Light* mLight;
+	public:
+		LightSpotlightInnerValue(Light* l) :AnimableValue(REAL) 
+		{ mLight = l; }
+		void setValue(Real val)
+		{
+			mLight->setSpotlightInnerAngle(Radian(val));
+		}
+		void applyDeltaValue(Real val)
+		{
+			setValue(mLight->getSpotlightInnerAngle().valueRadians() + val);
+		}
+		void setCurrentStateAsBaseValue(void)
+		{
+			setAsBaseValue(mLight->getSpotlightInnerAngle().valueRadians());
+		}
+
+	};
+	//-----------------------------------------------------------------------
+	class LightSpotlightOuterValue : public AnimableValue
+	{
+	protected:
+		Light* mLight;
+	public:
+		LightSpotlightOuterValue(Light* l) :AnimableValue(REAL) 
+		{ mLight = l; }
+		void setValue(Real val)
+		{
+			mLight->setSpotlightOuterAngle(Radian(val));
+		}
+		void applyDeltaValue(Real val)
+		{
+			setValue(mLight->getSpotlightOuterAngle().valueRadians() + val);
+		}
+		void setCurrentStateAsBaseValue(void)
+		{
+			setAsBaseValue(mLight->getSpotlightOuterAngle().valueRadians());
+		}
+
+	};
+	//-----------------------------------------------------------------------
+	class LightSpotlightFalloffValue : public AnimableValue
+	{
+	protected:
+		Light* mLight;
+	public:
+		LightSpotlightFalloffValue(Light* l) :AnimableValue(REAL) 
+		{ mLight = l; }
+		void setValue(Real val)
+		{
+			mLight->setSpotlightFalloff(val);
+		}
+		void applyDeltaValue(Real val)
+		{
+			setValue(mLight->getSpotlightFalloff() + val);
+		}
+		void setCurrentStateAsBaseValue(void)
+		{
+			setAsBaseValue(mLight->getSpotlightFalloff());
+		}
+
+	};
+	//-----------------------------------------------------------------------
+	AnimableValuePtr Light::createAnimableValue(const String& valueName)
+	{
+		if (valueName == "diffuseColour")
+		{
+			return AnimableValuePtr(
+				new LightDiffuseColourValue(this));
+		}
+		else if(valueName == "specularColour")
+		{
+			return AnimableValuePtr(
+				new LightSpecularColourValue(this));
+		}
+		else if (valueName == "attenuation")
+		{
+			return AnimableValuePtr(
+				new LightAttenuationValue(this));
+		}
+		else if (valueName == "spotlightInner")
+		{
+			return AnimableValuePtr(
+				new LightSpotlightInnerValue(this));
+		}
+		else if (valueName == "spotlightOuter")
+		{
+			return AnimableValuePtr(
+				new LightSpotlightOuterValue(this));
+		}
+		else if (valueName == "spotlightFalloff")
+		{
+			return AnimableValuePtr(
+				new LightSpotlightFalloffValue(this));
+		}
+		else
+		{
+			return MovableObject::createAnimableValue(valueName);
+		}
+	}
+	//-----------------------------------------------------------------------
+	void Light::setCustomShadowCameraSetup(const ShadowCameraSetupPtr& customShadowSetup)
+	{
+		mCustomShadowCameraSetup = customShadowSetup;
+	}
+	//-----------------------------------------------------------------------
+	void Light::resetCustomShadowCameraSetup()
+	{
+		mCustomShadowCameraSetup.setNull();
+	}
+	//-----------------------------------------------------------------------
+	const ShadowCameraSetupPtr& Light::getCustomShadowCameraSetup() const
+	{
+		return mCustomShadowCameraSetup;
+	}
+	//-----------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	String LightFactory::FACTORY_TYPE_NAME = "Light";
+	//-----------------------------------------------------------------------
+	const String& LightFactory::getType(void) const
+	{
+		return FACTORY_TYPE_NAME;
+	}
+	//-----------------------------------------------------------------------
+	MovableObject* LightFactory::createInstanceImpl( const String& name, 
+		const NameValuePairList* params)
+	{
+
+		return new Light(name);
+
+	}
+	//-----------------------------------------------------------------------
+	void LightFactory::destroyInstance( MovableObject* obj)
+	{
+		delete obj;
+	}
+
+
+
+
+} // Namespace
Index: /OgreMain/src/OgreLog.cpp
===================================================================
--- /OgreMain/src/OgreLog.cpp	(revision 5)
+++ /OgreMain/src/OgreLog.cpp	(revision 5)
@@ -0,0 +1,106 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreLog.h"
+#include "OgreLogManager.h"
+#include "OgreString.h"
+
+namespace Ogre
+{
+
+    //-----------------------------------------------------------------------
+    Log::Log( const String& name, bool debuggerOuput, bool suppressFile ) : 
+        mLogLevel(LL_NORMAL), mDebugOut(debuggerOuput),
+        mSuppressFile(suppressFile), mLogName(name)
+    {
+		if (!mSuppressFile)
+		{
+			mfpLog.open(name.c_str());
+		}
+    }
+    //-----------------------------------------------------------------------
+    Log::~Log()
+    {
+		OGRE_LOCK_AUTO_MUTEX
+		if (!mSuppressFile)
+		{
+	        mfpLog.close();
+		}
+    }
+    //-----------------------------------------------------------------------
+    void Log::logMessage( const String& message, LogMessageLevel lml, bool maskDebug )
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        if ((mLogLevel + lml) >= OGRE_LOG_THRESHOLD)
+        {
+            for( mtLogListener::iterator i = mListeners.begin(); i != mListeners.end(); ++i )
+                (*i)->messageLogged( message, lml, maskDebug, mLogName );
+
+			if (mDebugOut && !maskDebug)
+                std::cerr << message << std::endl;
+
+            // Write time into log
+			if (!mSuppressFile)
+			{
+				struct tm *pTime;
+				time_t ctTime; time(&ctTime);
+				pTime = localtime( &ctTime );
+				mfpLog << std::setw(2) << std::setfill('0') << pTime->tm_hour
+					<< ":" << std::setw(2) << std::setfill('0') << pTime->tm_min
+					<< ":" << std::setw(2) << std::setfill('0') << pTime->tm_sec 
+					<< ": " << message << std::endl;
+
+				// Flush stcmdream to ensure it is written (incase of a crash, we need log to be up to date)
+				mfpLog.flush();
+			}
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    void Log::setLogDetail(LoggingLevel ll)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        mLogLevel = ll;
+    }
+
+    //-----------------------------------------------------------------------
+    void Log::addListener(LogListener* listener)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        mListeners.push_back(listener);
+    }
+
+    //-----------------------------------------------------------------------
+    void Log::removeListener(LogListener* listener)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        mListeners.erase(std::find(mListeners.begin(), mListeners.end(), listener));
+    }
+}
Index: /OgreMain/src/OgreLogManager.cpp
===================================================================
--- /OgreMain/src/OgreLogManager.cpp	(revision 5)
+++ /OgreMain/src/OgreLogManager.cpp	(revision 5)
@@ -0,0 +1,148 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreLogManager.h"
+#include "OgreException.h"
+#include <algorithm>
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    template<> LogManager* Singleton<LogManager>::ms_Singleton = 0;
+    LogManager* LogManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    LogManager& LogManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+    //-----------------------------------------------------------------------
+    LogManager::LogManager()
+    {
+        mDefaultLog = NULL;
+    }
+    //-----------------------------------------------------------------------
+    LogManager::~LogManager()
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        // Destroy all logs
+        LogList::iterator i;
+        for (i = mLogs.begin(); i != mLogs.end(); ++i)
+        {
+            delete i->second;
+        }
+    }
+    //-----------------------------------------------------------------------
+    Log* LogManager::createLog( const String& name, bool defaultLog, bool debuggerOutput, 
+		bool suppressFileOutput)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+
+        Log* newLog = new Log(name, debuggerOutput, suppressFileOutput);
+
+        if( !mDefaultLog || defaultLog )
+        {
+            mDefaultLog = newLog;
+        }
+
+        mLogs.insert( LogList::value_type( name, newLog ) );
+
+        return newLog;
+    }
+    //-----------------------------------------------------------------------
+    Log* LogManager::getDefaultLog()
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        return mDefaultLog;
+    }
+    //-----------------------------------------------------------------------
+    Log* LogManager::setDefaultLog(Log* newLog)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        Log* oldLog = mDefaultLog;
+        mDefaultLog = newLog;
+        return oldLog;
+    }
+    //-----------------------------------------------------------------------
+    Log* LogManager::getLog( const String& name)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        LogList::iterator i = mLogs.find(name);
+        if (i != mLogs.end())
+            return i->second;
+        else
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Log not found. ", "LogManager::getLog");
+
+
+    }
+	//-----------------------------------------------------------------------
+	void LogManager::destroyLog(const String& name)
+	{
+		LogList::iterator i = mLogs.find(name);
+		if (i != mLogs.end())
+		{
+			if (mDefaultLog == i->second)
+			{
+				mDefaultLog = 0;
+			}
+			delete i->second;
+			mLogs.erase(i);
+		}
+
+		// Set another default log if this one removed
+		if (!mDefaultLog && !mLogs.empty())
+		{
+			mDefaultLog = mLogs.begin()->second;
+		}
+	}
+	//-----------------------------------------------------------------------
+	void LogManager::destroyLog(Log* log)
+	{
+		destroyLog(log->getName());
+	}
+    //-----------------------------------------------------------------------
+    void LogManager::logMessage( const String& message, LogMessageLevel lml, bool maskDebug)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+		if (mDefaultLog)
+		{
+			mDefaultLog->logMessage(message, lml, maskDebug);
+		}
+    }
+    //-----------------------------------------------------------------------
+    void LogManager::setLogDetail(LoggingLevel ll)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+		if (mDefaultLog)
+		{
+	        mDefaultLog->setLogDetail(ll);
+		}
+    }
+}
Index: /OgreMain/src/OgreManualObject.cpp
===================================================================
--- /OgreMain/src/OgreManualObject.cpp	(revision 5)
+++ /OgreMain/src/OgreManualObject.cpp	(revision 5)
@@ -0,0 +1,1087 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreManualObject.h"
+#include "OgreException.h"
+#include "OgreMaterialManager.h"
+#include "OgreSceneNode.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreEdgeListBuilder.h"
+#include "OgreMeshManager.h"
+#include "OgreMesh.h"
+#include "OgreSubMesh.h"
+
+namespace Ogre {
+
+#define TEMP_INITIAL_SIZE 50
+#define TEMP_VERTEXSIZE_GUESS sizeof(float) * 12
+#define TEMP_INITIAL_VERTEX_SIZE TEMP_VERTEXSIZE_GUESS * TEMP_INITIAL_SIZE
+#define TEMP_INITIAL_INDEX_SIZE sizeof(uint16) * TEMP_INITIAL_SIZE
+	//-----------------------------------------------------------------------------
+	ManualObject::ManualObject(const String& name)
+		: MovableObject(name),
+		  mDynamic(false), mCurrentSection(0), mFirstVertex(true),
+		  mTempVertexPending(false),
+		  mTempVertexBuffer(0), mTempVertexSize(TEMP_INITIAL_VERTEX_SIZE),
+		  mTempIndexBuffer(0), mTempIndexSize(TEMP_INITIAL_INDEX_SIZE),
+		  mDeclSize(0), mEstVertexCount(0), mEstIndexCount(0), mTexCoordIndex(0), 
+		  mRadius(0), mAnyIndexed(false), mEdgeList(0), 
+		  mUseIdentityProjection(false), mUseIdentityView(false)
+	{
+	}
+	//-----------------------------------------------------------------------------
+	ManualObject::~ManualObject()
+	{
+		clear();
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::clear(void)
+	{
+		resetTempAreas();
+		for (SectionList::iterator i = mSectionList.begin(); i != mSectionList.end(); ++i)
+		{
+			delete *i;
+		}
+		mSectionList.clear();
+		mRadius = 0;
+		mAABB.setNull();
+		delete mEdgeList;
+		mEdgeList = 0;
+		mAnyIndexed = false;
+		for (ShadowRenderableList::iterator s = mShadowRenderables.begin();
+			s != mShadowRenderables.end(); ++s)
+		{
+			delete *s;
+		}
+		mShadowRenderables.clear();
+
+
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::resetTempAreas(void)
+	{
+		delete [] mTempVertexBuffer;
+		delete [] mTempIndexBuffer;
+		mTempVertexBuffer = 0;
+		mTempIndexBuffer = 0;
+		mTempVertexSize = TEMP_INITIAL_VERTEX_SIZE;
+		mTempIndexSize = TEMP_INITIAL_INDEX_SIZE;
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::resizeTempVertexBufferIfNeeded(size_t numVerts)
+	{
+		// Calculate byte size
+		// Use decl if we know it by now, otherwise default size to pos/norm/texcoord*2
+		size_t newSize;
+		if (!mFirstVertex)
+		{
+			newSize = mDeclSize * numVerts;
+		}
+		else
+		{
+			// estimate - size checks will deal for subsequent verts
+			newSize = TEMP_VERTEXSIZE_GUESS * numVerts;
+		}
+		if (newSize > mTempVertexSize || !mTempVertexBuffer)
+		{
+			if (!mTempVertexBuffer)
+			{
+				// init
+				newSize = mTempVertexSize;
+			}
+			else
+			{
+				// increase to at least double current
+				newSize = std::max(newSize, mTempVertexSize*2);
+			}
+			// copy old data
+			char* tmp = mTempVertexBuffer;
+			mTempVertexBuffer = new char[newSize];
+			if (tmp)
+			{
+				memcpy(mTempVertexBuffer, tmp, mTempVertexSize);
+				// delete old buffer
+				delete [] tmp;
+			}
+			mTempVertexSize = newSize;
+		}
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::resizeTempIndexBufferIfNeeded(size_t numInds)
+	{
+		size_t newSize = numInds * sizeof(uint16);
+		if (newSize > mTempIndexSize || !mTempIndexBuffer)
+		{
+			if (!mTempIndexBuffer)
+			{
+				// init
+				newSize = mTempIndexSize;
+			}
+			else
+			{
+				// increase to at least double current
+				newSize = std::max(newSize, mTempIndexSize*2);
+			}
+			numInds = newSize / sizeof(uint16);
+			uint16* tmp = mTempIndexBuffer;
+			mTempIndexBuffer = new uint16[numInds];
+			if (tmp)
+			{
+				memcpy(mTempIndexBuffer, tmp, mTempIndexSize);
+				delete [] tmp;
+			}
+			mTempIndexSize = newSize;
+		}
+
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::estimateVertexCount(size_t vcount)
+	{
+		resizeTempVertexBufferIfNeeded(vcount);
+		mEstVertexCount = vcount;
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::estimateIndexCount(size_t icount)
+	{
+		resizeTempIndexBufferIfNeeded(icount);
+		mEstIndexCount = icount;
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::begin(const String& materialName,
+		RenderOperation::OperationType opType)
+	{
+		if (mCurrentSection)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"You cannot call begin() again until after you call end()",
+				"ManualObject::begin");
+		}
+		mCurrentSection = new ManualObjectSection(this, materialName, opType);
+		mCurrentUpdating = false;
+		mCurrentSection->setUseIdentityProjection(mUseIdentityProjection);
+		mCurrentSection->setUseIdentityView(mUseIdentityView);
+		mSectionList.push_back(mCurrentSection);
+		mFirstVertex = true;
+		mDeclSize = 0;
+		mTexCoordIndex = 0;
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::beginUpdate(size_t sectionIndex)
+	{
+		if (mCurrentSection)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"You cannot call begin() again until after you call end()",
+				"ManualObject::beginUpdate");
+		}
+		if (sectionIndex >= mSectionList.size())
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Invalid section index - out of range.",
+				"ManualObject::beginUpdate");
+		}
+		mCurrentSection = mSectionList[sectionIndex];
+		mCurrentUpdating = true;
+		mFirstVertex = true;
+		mTexCoordIndex = 0;
+		// reset vertex & index count
+		RenderOperation* rop = mCurrentSection->getRenderOperation();
+		rop->vertexData->vertexCount = 0;
+		if (rop->indexData)
+			rop->indexData->indexCount = 0;
+		rop->useIndexes = false;
+		mDeclSize = rop->vertexData->vertexDeclaration->getVertexSize(0);
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::position(const Vector3& pos)
+	{
+		position(pos.x, pos.y, pos.z);
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::position(Real x, Real y, Real z)
+	{
+		if (!mCurrentSection)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"You must call begin() before this method",
+				"ManualObject::position");
+		}
+		if (mTempVertexPending)
+		{
+			// bake current vertex
+			copyTempVertexToBuffer();
+			mFirstVertex = false;
+		}
+
+		if (mFirstVertex && !mCurrentUpdating)
+		{
+			// defining declaration
+			mCurrentSection->getRenderOperation()->vertexData->vertexDeclaration
+				->addElement(0, mDeclSize, VET_FLOAT3, VES_POSITION);
+			mDeclSize += VertexElement::getTypeSize(VET_FLOAT3);
+		}
+
+		mTempVertex.position.x = x;
+		mTempVertex.position.y = y;
+		mTempVertex.position.z = z;
+
+		// update bounds
+		mAABB.merge(mTempVertex.position);
+		mRadius = std::max(mRadius, mTempVertex.position.length());
+
+		// reset current texture coord
+		mTexCoordIndex = 0;
+
+		mTempVertexPending = true;
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::normal(const Vector3& norm)
+	{
+		normal(norm.x, norm.y, norm.z);
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::normal(Real x, Real y, Real z)
+	{
+		if (!mCurrentSection)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"You must call begin() before this method",
+				"ManualObject::normal");
+		}
+		if (mFirstVertex && !mCurrentUpdating)
+		{
+			// defining declaration
+			mCurrentSection->getRenderOperation()->vertexData->vertexDeclaration
+				->addElement(0, mDeclSize, VET_FLOAT3, VES_NORMAL);
+			mDeclSize += VertexElement::getTypeSize(VET_FLOAT3);
+		}
+		mTempVertex.normal.x = x;
+		mTempVertex.normal.y = y;
+		mTempVertex.normal.z = z;
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::textureCoord(Real u)
+	{
+		if (!mCurrentSection)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"You must call begin() before this method",
+				"ManualObject::textureCoord");
+		}
+		if (mFirstVertex && !mCurrentUpdating)
+		{
+			// defining declaration
+			mCurrentSection->getRenderOperation()->vertexData->vertexDeclaration
+				->addElement(0, mDeclSize, VET_FLOAT1, VES_TEXTURE_COORDINATES, mTexCoordIndex);
+			mDeclSize += VertexElement::getTypeSize(VET_FLOAT1);
+		}
+		mTempVertex.texCoordDims[mTexCoordIndex] = 1;
+		mTempVertex.texCoord[mTexCoordIndex].x = u;
+
+		++mTexCoordIndex;
+
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::textureCoord(Real u, Real v)
+	{
+		if (!mCurrentSection)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"You must call begin() before this method",
+				"ManualObject::textureCoord");
+		}
+		if (mFirstVertex && !mCurrentUpdating)
+		{
+			// defining declaration
+			mCurrentSection->getRenderOperation()->vertexData->vertexDeclaration
+				->addElement(0, mDeclSize, VET_FLOAT2, VES_TEXTURE_COORDINATES, mTexCoordIndex);
+			mDeclSize += VertexElement::getTypeSize(VET_FLOAT2);
+		}
+		mTempVertex.texCoordDims[mTexCoordIndex] = 2;
+		mTempVertex.texCoord[mTexCoordIndex].x = u;
+		mTempVertex.texCoord[mTexCoordIndex].y = v;
+
+		++mTexCoordIndex;
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::textureCoord(Real u, Real v, Real w)
+	{
+		if (!mCurrentSection)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"You must call begin() before this method",
+				"ManualObject::textureCoord");
+		}
+		if (mFirstVertex && !mCurrentUpdating)
+		{
+			// defining declaration
+			mCurrentSection->getRenderOperation()->vertexData->vertexDeclaration
+				->addElement(0, mDeclSize, VET_FLOAT3, VES_TEXTURE_COORDINATES, mTexCoordIndex);
+			mDeclSize += VertexElement::getTypeSize(VET_FLOAT3);
+		}
+		mTempVertex.texCoordDims[mTexCoordIndex] = 3;
+		mTempVertex.texCoord[mTexCoordIndex].x = u;
+		mTempVertex.texCoord[mTexCoordIndex].y = v;
+		mTempVertex.texCoord[mTexCoordIndex].z = w;
+
+		++mTexCoordIndex;
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::textureCoord(const Vector2& uv)
+	{
+		textureCoord(uv.x, uv.y);
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::textureCoord(const Vector3& uvw)
+	{
+		textureCoord(uvw.x, uvw.y, uvw.z);
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::colour(const ColourValue& col)
+	{
+		colour(col.r, col.g, col.b, col.a);
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::colour(Real r, Real g, Real b, Real a)
+	{
+		if (!mCurrentSection)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"You must call begin() before this method",
+				"ManualObject::colour");
+		}
+		if (mFirstVertex && !mCurrentUpdating)
+		{
+			// defining declaration
+			mCurrentSection->getRenderOperation()->vertexData->vertexDeclaration
+				->addElement(0, mDeclSize, VET_COLOUR, VES_DIFFUSE);
+			mDeclSize += VertexElement::getTypeSize(VET_COLOUR);
+		}
+		mTempVertex.colour.r = r;
+		mTempVertex.colour.g = g;
+		mTempVertex.colour.b = b;
+		mTempVertex.colour.a = a;
+
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::index(uint16 idx)
+	{
+		if (!mCurrentSection)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"You must call begin() before this method",
+				"ManualObject::index");
+		}
+		mAnyIndexed = true;
+		// make sure we have index data
+		RenderOperation* rop = mCurrentSection->getRenderOperation();
+		if (!rop->indexData)
+		{
+			rop->indexData = new IndexData();
+			rop->indexData->indexCount = 0;
+		}
+		rop->useIndexes = true;
+		resizeTempIndexBufferIfNeeded(++rop->indexData->indexCount);
+
+		mTempIndexBuffer[rop->indexData->indexCount - 1] = idx;
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::triangle(uint16 i1, uint16 i2, uint16 i3)
+	{
+		if (!mCurrentSection)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"You must call begin() before this method",
+				"ManualObject::index");
+		}
+		if (mCurrentSection->getRenderOperation()->operationType !=
+			RenderOperation::OT_TRIANGLE_LIST)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"This method is only valid on triangle lists",
+				"ManualObject::index");
+		}
+
+		index(i1);
+		index(i2);
+		index(i3);
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::quad(uint16 i1, uint16 i2, uint16 i3, uint16 i4)
+	{
+		// first tri
+		triangle(i1, i2, i3);
+		// second tri
+		triangle(i3, i4, i1);
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::copyTempVertexToBuffer(void)
+	{
+		mTempVertexPending = false;
+		RenderOperation* rop = mCurrentSection->getRenderOperation();
+		if (rop->vertexData->vertexCount == 0 && !mCurrentUpdating)
+		{
+			// first vertex, autoorganise decl
+			VertexDeclaration* oldDcl = rop->vertexData->vertexDeclaration;
+			rop->vertexData->vertexDeclaration =
+				oldDcl->getAutoOrganisedDeclaration(false, false);
+			HardwareBufferManager::getSingleton().destroyVertexDeclaration(oldDcl);
+		}
+		resizeTempVertexBufferIfNeeded(++rop->vertexData->vertexCount);
+
+		// get base pointer
+		char* pBase = mTempVertexBuffer + (mDeclSize * (rop->vertexData->vertexCount-1));
+		const VertexDeclaration::VertexElementList& elemList =
+			rop->vertexData->vertexDeclaration->getElements();
+		for (VertexDeclaration::VertexElementList::const_iterator i = elemList.begin();
+			i != elemList.end(); ++i)
+		{
+			float* pFloat = 0;
+			RGBA* pRGBA = 0;
+			const VertexElement& elem = *i;
+			switch(elem.getType())
+			{
+			case VET_FLOAT1:
+			case VET_FLOAT2:
+			case VET_FLOAT3:
+				elem.baseVertexPointerToElement(pBase, &pFloat);
+				break;
+			case VET_COLOUR:
+			case VET_COLOUR_ABGR:
+			case VET_COLOUR_ARGB:
+				elem.baseVertexPointerToElement(pBase, &pRGBA);
+				break;
+			default:
+				// nop ?
+				break;
+			};
+
+
+			RenderSystem* rs;
+			unsigned short dims;
+			switch(elem.getSemantic())
+			{
+			case VES_POSITION:
+				*pFloat++ = mTempVertex.position.x;
+				*pFloat++ = mTempVertex.position.y;
+				*pFloat++ = mTempVertex.position.z;
+				break;
+			case VES_NORMAL:
+				*pFloat++ = mTempVertex.normal.x;
+				*pFloat++ = mTempVertex.normal.y;
+				*pFloat++ = mTempVertex.normal.z;
+				break;
+			case VES_TEXTURE_COORDINATES:
+				dims = VertexElement::getTypeCount(elem.getType());
+				for (ushort t = 0; t < dims; ++t)
+					*pFloat++ = mTempVertex.texCoord[elem.getIndex()][t];
+				break;
+			case VES_DIFFUSE:
+				rs = Root::getSingleton().getRenderSystem();
+				if (rs)
+					rs->convertColourValue(mTempVertex.colour, pRGBA++);
+				else
+					*pRGBA++ = mTempVertex.colour.getAsRGBA(); // pick one!
+				break;
+			default:
+				// nop ?
+				break;
+			};
+
+		}
+
+	}
+	//-----------------------------------------------------------------------------
+	ManualObject::ManualObjectSection* ManualObject::end(void)
+	{
+		if (!mCurrentSection)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"You cannot call end() until after you call begin()",
+				"ManualObject::end");
+		}
+		if (mTempVertexPending)
+		{
+			// bake current vertex
+			copyTempVertexToBuffer();
+		}
+
+		// pointer that will be returned
+		ManualObjectSection* result = NULL;
+
+		RenderOperation* rop = mCurrentSection->getRenderOperation();
+		// Check for empty content
+		if (rop->vertexData->vertexCount == 0 ||
+			(rop->useIndexes && rop->indexData->indexCount == 0))
+		{
+			// You're wasting my time sonny
+			if (mCurrentUpdating)
+			{
+				// Can't just undo / remove since may be in the middle
+				// Just allow counts to be 0, will not be issued to renderer
+
+				// return the finished section (though it has zero vertices)
+				result = mCurrentSection;
+			}
+			else
+			{
+				// First creation, can really undo
+				// Has already been added to section list end, so remove
+				mSectionList.pop_back();
+				delete mCurrentSection;
+
+			}
+		}
+		else // not an empty section
+		{
+
+			// Bake the real buffers
+			HardwareVertexBufferSharedPtr vbuf;
+			// Check buffer sizes
+			bool vbufNeedsCreating = true;
+			bool ibufNeedsCreating = rop->useIndexes;
+			if (mCurrentUpdating)
+			{
+				// May be able to reuse buffers, check sizes
+				vbuf = rop->vertexData->vertexBufferBinding->getBuffer(0);
+				if (vbuf->getNumVertices() >= rop->vertexData->vertexCount)
+					vbufNeedsCreating = false;
+
+				if (rop->useIndexes)
+				{
+					if (rop->indexData->indexBuffer->getNumIndexes() >= 
+						rop->indexData->indexCount)
+						ibufNeedsCreating = false;
+				}
+
+			}
+			if (vbufNeedsCreating)
+			{
+				// Make the vertex buffer larger if estimated vertex count higher
+				// to allow for user-configured growth area
+				size_t vertexCount = std::max(rop->vertexData->vertexCount, 
+					mEstVertexCount);
+				vbuf =
+					HardwareBufferManager::getSingleton().createVertexBuffer(
+						mDeclSize,
+						vertexCount,
+						mDynamic? HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY : 
+							HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+				rop->vertexData->vertexBufferBinding->setBinding(0, vbuf);
+			}
+			if (ibufNeedsCreating)
+			{
+				// Make the index buffer larger if estimated index count higher
+				// to allow for user-configured growth area
+				size_t indexCount = std::max(rop->indexData->indexCount, 
+					mEstIndexCount);
+				rop->indexData->indexBuffer =
+					HardwareBufferManager::getSingleton().createIndexBuffer(
+						HardwareIndexBuffer::IT_16BIT,
+						indexCount,
+						mDynamic? HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY : 
+							HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+			}
+			// Write vertex data
+			vbuf->writeData(
+				0, rop->vertexData->vertexCount * vbuf->getVertexSize(), 
+				mTempVertexBuffer, true);
+			// Write index data
+			if(rop->useIndexes)
+			{
+				rop->indexData->indexBuffer->writeData(
+					0, 
+					rop->indexData->indexCount 
+						* rop->indexData->indexBuffer->getIndexSize(),
+					mTempIndexBuffer, true);
+			}
+
+			// return the finished section
+			result = mCurrentSection;
+
+		} // empty section check
+
+		mCurrentSection = 0;
+		resetTempAreas();
+
+		// Tell parent if present
+		if (mParentNode)
+		{
+			mParentNode->needUpdate();
+		}
+
+		// will return the finished section or NULL if
+		// the section was empty (i.e. zero vertices/indices)
+		return result;
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::setMaterialName(size_t idx, const String& name)
+	{
+		if (idx >= mSectionList.size())
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Index out of bounds!",
+				"ManualObject::setMaterialName");
+		}
+
+		mSectionList[idx]->setMaterialName(name);
+
+	}
+	//-----------------------------------------------------------------------------
+	MeshPtr ManualObject::convertToMesh(const String& meshName, const String& groupName)
+	{
+		if (mCurrentSection)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"You cannot call convertToMesh() whilst you are in the middle of "
+				"defining the object; call end() first.",
+				"ManualObject::convertToMesh");
+		}
+		if (mSectionList.empty())
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"No data defined to convert to a mesh.",
+				"ManualObject::convertToMesh");
+		}
+		for (SectionList::iterator i = mSectionList.begin(); i != mSectionList.end(); ++i)
+		{
+			ManualObjectSection* sec = *i;
+			if (!sec->getRenderOperation()->useIndexes)
+			{
+				OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+					"Only indexed geometry may be converted to a mesh.",
+					"ManualObject::convertToMesh");
+			}
+		}
+		MeshPtr m = MeshManager::getSingleton().createManual(meshName, groupName);
+
+		for (SectionList::iterator i = mSectionList.begin(); i != mSectionList.end(); ++i)
+		{
+			ManualObjectSection* sec = *i;
+			RenderOperation* rop = sec->getRenderOperation();
+			SubMesh* sm = m->createSubMesh();
+			sm->useSharedVertices = false;
+			sm->operationType = rop->operationType;
+			sm->setMaterialName(sec->getMaterialName());
+			// Copy vertex data; replicate buffers too
+			sm->vertexData = rop->vertexData->clone(true);
+			// Copy index data; replicate buffers too; delete the default, old one to avoid memory leaks
+			delete sm->indexData;
+			sm->indexData = rop->indexData->clone(true);
+		}
+        // update bounds
+		m->_setBounds(mAABB);
+		m->_setBoundingSphereRadius(mRadius);
+
+		m->load();
+
+		return m;
+
+
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::setUseIdentityProjection(bool useIdentityProjection)
+	{
+		// Set existing
+		for (SectionList::iterator i = mSectionList.begin(); i != mSectionList.end(); ++i)
+		{
+			(*i)->setUseIdentityProjection(useIdentityProjection);
+		}
+		
+		// Save setting for future sections
+		mUseIdentityProjection = useIdentityProjection;
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::setUseIdentityView(bool useIdentityView)
+	{
+		// Set existing
+		for (SectionList::iterator i = mSectionList.begin(); i != mSectionList.end(); ++i)
+		{
+			(*i)->setUseIdentityView(useIdentityView);
+		}
+
+		// Save setting for future sections
+		mUseIdentityView = useIdentityView;
+	}
+    //-----------------------------------------------------------------------
+	ManualObject::ManualObjectSection* ManualObject::getSection(unsigned int index) const
+    {
+        if (index >= mSectionList.size())
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+            "Index out of bounds.",
+            "ManualObject::getSection");
+        return mSectionList[index];
+    }
+    //-----------------------------------------------------------------------
+	unsigned int ManualObject::getNumSections(void) const
+    {
+        return static_cast< unsigned int >( mSectionList.size() );
+    }
+	//-----------------------------------------------------------------------------
+	const String& ManualObject::getMovableType(void) const
+	{
+		return ManualObjectFactory::FACTORY_TYPE_NAME;
+	}
+	//-----------------------------------------------------------------------------
+	const AxisAlignedBox& ManualObject::getBoundingBox(void) const
+	{
+		return mAABB;
+	}
+	//-----------------------------------------------------------------------------
+	Real ManualObject::getBoundingRadius(void) const
+	{
+		return mRadius;
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::_updateRenderQueue(RenderQueue* queue)
+	{
+		for (SectionList::iterator i = mSectionList.begin(); i != mSectionList.end(); ++i)
+		{
+			// Skip empty sections (only happens if non-empty first, then updated)
+			RenderOperation* rop = (*i)->getRenderOperation();
+			if (rop->vertexData->vertexCount == 0 ||
+				(rop->useIndexes && rop->indexData->indexCount == 0))
+				continue;
+
+			if (mRenderQueueIDSet)
+				queue->addRenderable(*i, mRenderQueueID);
+			else
+				queue->addRenderable(*i);
+		}
+	}
+	//-----------------------------------------------------------------------------
+	EdgeData* ManualObject::getEdgeList(void)
+	{
+		// Build on demand
+		if (!mEdgeList && mAnyIndexed)
+		{
+			EdgeListBuilder eb;
+			size_t vertexSet = 0;
+			bool anyBuilt = false;
+			for (SectionList::iterator i = mSectionList.begin(); i != mSectionList.end(); ++i)
+			{
+				RenderOperation* rop = (*i)->getRenderOperation();
+				// Only indexed triangle geometry supported for stencil shadows
+				if (rop->useIndexes && rop->indexData->indexCount != 0 && 
+					(rop->operationType == RenderOperation::OT_TRIANGLE_FAN ||
+					 rop->operationType == RenderOperation::OT_TRIANGLE_LIST ||
+					 rop->operationType == RenderOperation::OT_TRIANGLE_STRIP))
+				{
+					eb.addVertexData(rop->vertexData);
+					eb.addIndexData(rop->indexData, vertexSet++);
+					anyBuilt = true;
+				}
+			}
+
+			if (anyBuilt)
+				mEdgeList = eb.build();
+
+		}
+		return mEdgeList;
+	}
+	//---------------------------------------------------------------------
+	bool ManualObject::hasEdgeList()
+	{
+		return getEdgeList() != 0;
+	}
+	//-----------------------------------------------------------------------------
+	ShadowCaster::ShadowRenderableListIterator
+	ManualObject::getShadowVolumeRenderableIterator(
+		ShadowTechnique shadowTechnique, const Light* light,
+		HardwareIndexBufferSharedPtr* indexBuffer,
+		bool extrude, Real extrusionDistance, unsigned long flags)
+	{
+		assert(indexBuffer && "Only external index buffers are supported right now");
+		assert((*indexBuffer)->getType() == HardwareIndexBuffer::IT_16BIT &&
+			"Only 16-bit indexes supported for now");
+
+        EdgeData* edgeList = getEdgeList();
+        if (!edgeList)
+        {
+            return ShadowRenderableListIterator(
+                mShadowRenderables.begin(), mShadowRenderables.end());
+        }
+
+		// Calculate the object space light details
+		Vector4 lightPos = light->getAs4DVector();
+		Matrix4 world2Obj = mParentNode->_getFullTransform().inverseAffine();
+		lightPos = world2Obj.transformAffine(lightPos);
+
+
+		// Init shadow renderable list if required (only allow indexed)
+		bool init = mShadowRenderables.empty() && mAnyIndexed;
+
+		EdgeData::EdgeGroupList::iterator egi;
+		ShadowRenderableList::iterator si, siend;
+		ManualObjectSectionShadowRenderable* esr = 0;
+		SectionList::iterator seci;
+		if (init)
+			mShadowRenderables.resize(edgeList->edgeGroups.size());
+
+		siend = mShadowRenderables.end();
+		egi = edgeList->edgeGroups.begin();
+		seci = mSectionList.begin();
+		for (si = mShadowRenderables.begin(); si != siend; ++seci)
+		{
+            // Skip non-indexed geometry
+            if (!(*seci)->getRenderOperation()->useIndexes)
+            {
+                continue;
+            }
+
+			if (init)
+			{
+				// Create a new renderable, create a separate light cap if
+				// we're using a vertex program (either for this model, or
+				// for extruding the shadow volume) since otherwise we can
+				// get depth-fighting on the light cap
+				MaterialPtr mat = (*seci)->getMaterial();
+				mat->load();
+				bool vertexProgram = false;
+				Technique* t = mat->getBestTechnique();
+				for (int p = 0; p < t->getNumPasses(); ++p)
+				{
+					Pass* pass = t->getPass(p);
+					if (pass->hasVertexProgram())
+					{
+						vertexProgram = true;
+						break;
+					}
+				}
+				*si = new ManualObjectSectionShadowRenderable(this, indexBuffer,
+					egi->vertexData, vertexProgram || !extrude);
+			}
+			// Get shadow renderable
+			esr = static_cast<ManualObjectSectionShadowRenderable*>(*si);
+			HardwareVertexBufferSharedPtr esrPositionBuffer = esr->getPositionBuffer();
+			// Extrude vertices in software if required
+			if (extrude)
+			{
+				extrudeVertices(esrPositionBuffer,
+					egi->vertexData->vertexCount,
+					lightPos, extrusionDistance);
+
+			}
+
+            ++si;
+            ++egi;
+		}
+		// Calc triangle light facing
+		updateEdgeListLightFacing(edgeList, lightPos);
+
+		// Generate indexes and update renderables
+		generateShadowVolume(edgeList, *indexBuffer, light,
+			mShadowRenderables, flags);
+
+
+		return ShadowRenderableListIterator(
+			mShadowRenderables.begin(), mShadowRenderables.end());
+
+
+	}
+	//-----------------------------------------------------------------------------
+	//-----------------------------------------------------------------------------
+	//-----------------------------------------------------------------------------
+	ManualObject::ManualObjectSection::ManualObjectSection(ManualObject* parent,
+		const String& materialName,	RenderOperation::OperationType opType)
+		: mParent(parent), mMaterialName(materialName)
+	{
+		mRenderOperation.operationType = opType;
+		// default to no indexes unless we're told
+		mRenderOperation.useIndexes = false;
+		mRenderOperation.vertexData = new VertexData();
+		mRenderOperation.vertexData->vertexCount = 0;
+
+	}
+	//-----------------------------------------------------------------------------
+	ManualObject::ManualObjectSection::~ManualObjectSection()
+	{
+		delete mRenderOperation.vertexData;
+		delete mRenderOperation.indexData; // ok to delete 0
+	}
+	//-----------------------------------------------------------------------------
+	RenderOperation* ManualObject::ManualObjectSection::getRenderOperation(void)
+	{
+		return &mRenderOperation;
+	}
+	//-----------------------------------------------------------------------------
+	const MaterialPtr& ManualObject::ManualObjectSection::getMaterial(void) const
+	{
+		if (mMaterial.isNull())
+		{
+			// Load from default group. If user wants to use alternate groups,
+			// they can define it and preload
+			mMaterial = MaterialManager::getSingleton().load(mMaterialName,
+				ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		}
+		return mMaterial;
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::ManualObjectSection::setMaterialName(const String& name)
+	{
+		if (mMaterialName != name)
+		{
+			mMaterialName = name;
+			mMaterial.setNull();
+		}
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::ManualObjectSection::getRenderOperation(RenderOperation& op)
+	{
+		// direct copy
+		op = mRenderOperation;
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObject::ManualObjectSection::getWorldTransforms(Matrix4* xform) const
+	{
+		xform[0] = mParent->_getParentNodeFullTransform();
+	}
+	//-----------------------------------------------------------------------------
+	const Quaternion& ManualObject::ManualObjectSection::getWorldOrientation(void) const
+	{
+		return mParent->getParentNode()->_getDerivedOrientation();
+	}
+	//-----------------------------------------------------------------------------
+	const Vector3& ManualObject::ManualObjectSection::getWorldPosition(void) const
+	{
+		return mParent->getParentNode()->_getDerivedPosition();
+	}
+	//-----------------------------------------------------------------------------
+	Real ManualObject::ManualObjectSection::getSquaredViewDepth(const Ogre::Camera *cam) const
+	{
+		Node* n = mParent->getParentNode();
+		assert(n);
+		return n->getSquaredViewDepth(cam);
+	}
+	//-----------------------------------------------------------------------------
+	const LightList& ManualObject::ManualObjectSection::getLights(void) const
+	{
+		return mParent->queryLights();
+	}
+	//-----------------------------------------------------------------------------
+	//--------------------------------------------------------------------------
+	ManualObject::ManualObjectSectionShadowRenderable::ManualObjectSectionShadowRenderable(
+		ManualObject* parent, HardwareIndexBufferSharedPtr* indexBuffer,
+		const VertexData* vertexData, bool createSeparateLightCap,
+		bool isLightCap)
+		: mParent(parent)
+	{
+		// Initialise render op
+		mRenderOp.indexData = new IndexData();
+		mRenderOp.indexData->indexBuffer = *indexBuffer;
+		mRenderOp.indexData->indexStart = 0;
+		// index start and count are sorted out later
+
+		// Create vertex data which just references position component (and 2 component)
+		mRenderOp.vertexData = new VertexData();
+		// Map in position data
+		mRenderOp.vertexData->vertexDeclaration->addElement(0,0,VET_FLOAT3, VES_POSITION);
+		ushort origPosBind =
+			vertexData->vertexDeclaration->findElementBySemantic(VES_POSITION)->getSource();
+		mPositionBuffer = vertexData->vertexBufferBinding->getBuffer(origPosBind);
+		mRenderOp.vertexData->vertexBufferBinding->setBinding(0, mPositionBuffer);
+		// Map in w-coord buffer (if present)
+		if(!vertexData->hardwareShadowVolWBuffer.isNull())
+		{
+			mRenderOp.vertexData->vertexDeclaration->addElement(1,0,VET_FLOAT1, VES_TEXTURE_COORDINATES, 0);
+			mWBuffer = vertexData->hardwareShadowVolWBuffer;
+			mRenderOp.vertexData->vertexBufferBinding->setBinding(1, mWBuffer);
+		}
+		// Use same vertex start as input
+		mRenderOp.vertexData->vertexStart = vertexData->vertexStart;
+
+		if (isLightCap)
+		{
+			// Use original vertex count, no extrusion
+			mRenderOp.vertexData->vertexCount = vertexData->vertexCount;
+		}
+		else
+		{
+			// Vertex count must take into account the doubling of the buffer,
+			// because second half of the buffer is the extruded copy
+			mRenderOp.vertexData->vertexCount =
+				vertexData->vertexCount * 2;
+			if (createSeparateLightCap)
+			{
+				// Create child light cap
+				mLightCap = new ManualObjectSectionShadowRenderable(parent,
+					indexBuffer, vertexData, false, true);
+			}
+		}
+	}
+	//--------------------------------------------------------------------------
+	ManualObject::ManualObjectSectionShadowRenderable::~ManualObjectSectionShadowRenderable()
+	{
+		delete mRenderOp.indexData;
+		delete mRenderOp.vertexData;
+	}
+	//--------------------------------------------------------------------------
+	void ManualObject::ManualObjectSectionShadowRenderable::getWorldTransforms(
+		Matrix4* xform) const
+	{
+		// pretransformed
+		*xform = mParent->_getParentNodeFullTransform();
+	}
+	//--------------------------------------------------------------------------
+	const Quaternion&
+		ManualObject::ManualObjectSectionShadowRenderable::getWorldOrientation(void) const
+	{
+		return mParent->getParentNode()->_getDerivedOrientation();
+	}
+	//--------------------------------------------------------------------------
+	const Vector3&
+		ManualObject::ManualObjectSectionShadowRenderable::getWorldPosition(void) const
+	{
+		return mParent->getParentNode()->_getDerivedPosition();
+	}
+	//-----------------------------------------------------------------------------
+	//-----------------------------------------------------------------------------
+	String ManualObjectFactory::FACTORY_TYPE_NAME = "ManualObject";
+	//-----------------------------------------------------------------------------
+	const String& ManualObjectFactory::getType(void) const
+	{
+		return FACTORY_TYPE_NAME;
+	}
+	//-----------------------------------------------------------------------------
+	MovableObject* ManualObjectFactory::createInstanceImpl(
+		const String& name, const NameValuePairList* params)
+	{
+		return new ManualObject(name);
+	}
+	//-----------------------------------------------------------------------------
+	void ManualObjectFactory::destroyInstance( MovableObject* obj)
+	{
+		delete obj;
+	}
+
+
+
+}
Index: /OgreMain/src/OgreMaterial.cpp
===================================================================
--- /OgreMain/src/OgreMaterial.cpp	(revision 5)
+++ /OgreMain/src/OgreMaterial.cpp	(revision 5)
@@ -0,0 +1,770 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreMaterial.h"
+
+#include "OgreSceneManagerEnumerator.h"
+#include "OgreMaterialManager.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreTechnique.h"
+#include "OgreLogManager.h"
+#include "OgreException.h"
+#include "OgreStringConverter.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+	Material::Material(ResourceManager* creator, const String& name, ResourceHandle handle,
+		const String& group, bool isManual, ManualResourceLoader* loader)
+		:Resource(creator, name, handle, group, isManual, loader),
+         mReceiveShadows(true),
+         mTransparencyCastsShadows(false),
+         mCompilationRequired(true)
+    {
+		// Override isManual, not applicable for Material (we always want to call loadImpl)
+		if(isManual)
+		{
+			mIsManual = false;
+			LogManager::getSingleton().logMessage("Material " + name + 
+				" was requested with isManual=true, but this is not applicable " 
+				"for materials; the flag has been reset to false");
+		}
+
+		mLodDistances.push_back(0.0f);
+
+		applyDefaults();
+
+		/* For consistency with StringInterface, but we don't add any parameters here
+		That's because the Resource implementation of StringInterface is to
+		list all the options that need to be set before loading, of which 
+		we have none as such. Full details can be set through scripts.
+		*/ 
+		createParamDictionary("Material");
+    }
+    //-----------------------------------------------------------------------
+    Material::~Material()
+    {
+        removeAllTechniques();
+        // have to call this here reather than in Resource destructor
+        // since calling virtual methods in base destructors causes crash
+        unload(); 
+    }
+    //-----------------------------------------------------------------------
+    Material& Material::operator=(const Material& rhs)
+    {
+	    mName = rhs.mName;
+		mGroup = rhs.mGroup;
+		mCreator = rhs.mCreator;
+		mIsManual = rhs.mIsManual;
+		mLoader = rhs.mLoader;
+	    mHandle = rhs.mHandle;
+        mSize = rhs.mSize;
+        mReceiveShadows = rhs.mReceiveShadows;
+        mTransparencyCastsShadows = rhs.mTransparencyCastsShadows;
+
+        mLoadingState = rhs.mLoadingState;
+		mIsBackgroundLoaded = rhs.mIsBackgroundLoaded;
+
+        // Copy Techniques
+        this->removeAllTechniques();
+        Techniques::const_iterator i, iend;
+        iend = rhs.mTechniques.end();
+        for(i = rhs.mTechniques.begin(); i != iend; ++i)
+        {
+            Technique* t = this->createTechnique();
+            *t = *(*i);
+            if ((*i)->isSupported())
+            {
+				insertSupportedTechnique(t);
+            }
+        }
+
+		// Also copy LOD information
+		mLodDistances = rhs.mLodDistances;
+        mCompilationRequired = rhs.mCompilationRequired;
+        // illumination passes are not compiled right away so
+        // mIsLoaded state should still be the same as the original material
+        assert(isLoaded() == rhs.isLoaded());
+
+	    return *this;
+    }
+
+
+    //-----------------------------------------------------------------------
+    void Material::loadImpl(void)
+    {
+		// compile if required
+        if (mCompilationRequired)
+            compile();
+
+        // Load all supported techniques
+        Techniques::iterator i, iend;
+        iend = mSupportedTechniques.end();
+        for (i = mSupportedTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->_load();
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void Material::unloadImpl(void)
+    {
+        // Unload all supported techniques
+        Techniques::iterator i, iend;
+        iend = mSupportedTechniques.end();
+        for (i = mSupportedTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->_unload();
+        }
+    }
+    //-----------------------------------------------------------------------
+    MaterialPtr Material::clone(const String& newName, bool changeGroup, 
+		const String& newGroup) const
+    {
+		MaterialPtr newMat;
+		if (changeGroup)
+		{
+			newMat = MaterialManager::getSingleton().create(newName, newGroup);
+		}
+		else
+		{
+			newMat = MaterialManager::getSingleton().create(newName, mGroup);
+		}
+        
+
+        // Keep handle (see below, copy overrides everything)
+        ResourceHandle newHandle = newMat->getHandle();
+        // Assign values from this
+        *newMat = *this;
+		// Restore new group if required, will have been overridden by operator
+		if (changeGroup)
+		{
+			newMat->mGroup = newGroup;
+		}
+		
+        // Correct the name & handle, they get copied too
+        newMat->mName = newName;
+        newMat->mHandle = newHandle;
+
+        return newMat;
+
+
+
+    }
+    //-----------------------------------------------------------------------
+    void Material::copyDetailsTo(MaterialPtr& mat) const
+    {
+        // Keep handle (see below, copy overrides everything)
+        ResourceHandle savedHandle = mat->mHandle;
+        String savedName = mat->mName;
+        String savedGroup = mat->mGroup;
+		ManualResourceLoader* savedLoader = mat->mLoader;
+		bool savedManual = mat->mIsManual;
+        // Assign values from this
+        *mat = *this;
+        // Correct the name & handle, they get copied too
+        mat->mName = savedName;
+        mat->mHandle = savedHandle;
+        mat->mGroup = savedGroup;
+		mat->mIsManual = savedManual;
+		mat->mLoader = savedLoader;
+
+    }
+    //-----------------------------------------------------------------------
+    void Material::applyDefaults(void)
+    {
+		MaterialPtr defaults = MaterialManager::getSingleton().getDefaultSettings();
+
+		if (!defaults.isNull())
+		{
+            // save name & handle
+            String savedName = mName;
+            String savedGroup = mGroup;
+            ResourceHandle savedHandle = mHandle;
+			ManualResourceLoader *savedLoader = mLoader;
+			bool savedManual = mIsManual;
+			*this = *defaults;
+            // restore name & handle
+            mName = savedName;
+            mHandle = savedHandle;
+            mGroup = savedGroup;
+			mLoader = savedLoader;
+			mIsManual = savedManual;
+		}
+        mCompilationRequired = true;
+
+    }
+    //-----------------------------------------------------------------------
+    Technique* Material::createTechnique(void)
+    {
+        Technique *t = new Technique(this);
+        mTechniques.push_back(t);
+        mCompilationRequired = true;
+        return t;
+    }
+    //-----------------------------------------------------------------------
+    Technique* Material::getTechnique(unsigned short index)
+    {
+        assert (index < mTechniques.size() && "Index out of bounds.");
+        return mTechniques[index];
+    }
+    //-----------------------------------------------------------------------
+    Technique* Material::getTechnique(const String& name)
+    {
+        Techniques::iterator i    = mTechniques.begin();
+        Techniques::iterator iend = mTechniques.end();
+        Technique* foundTechnique = 0;
+
+        // iterate through techniques to find a match
+        while (i != iend)
+        {
+            if ( (*i)->getName() == name )
+            {
+                foundTechnique = (*i);
+                break;
+            }
+            ++i;
+        }
+
+        return foundTechnique;
+    }
+    //-----------------------------------------------------------------------	
+    unsigned short Material::getNumTechniques(void) const
+    {
+		return static_cast<unsigned short>(mTechniques.size());
+    }
+	//-----------------------------------------------------------------------
+    Technique* Material::getSupportedTechnique(unsigned short index)
+    {
+        assert (index < mSupportedTechniques.size() && "Index out of bounds.");
+        return mSupportedTechniques[index];
+    }
+    //-----------------------------------------------------------------------	
+    unsigned short Material::getNumSupportedTechniques(void) const
+    {
+		return static_cast<unsigned short>(mSupportedTechniques.size());
+    }
+	//-----------------------------------------------------------------------
+	unsigned short Material::getNumLodLevels(unsigned short schemeIndex) const
+	{
+		// Safety check - empty list?
+		if (mBestTechniquesBySchemeList.empty())
+			return 0;
+
+		BestTechniquesBySchemeList::const_iterator i = 
+			mBestTechniquesBySchemeList.find(schemeIndex);
+		if (i == mBestTechniquesBySchemeList.end())
+		{
+			// get the first item, will be 0 (the default) if default
+			// scheme techniques exist, otherwise the earliest defined
+			i = mBestTechniquesBySchemeList.begin();
+		}
+
+		return static_cast<unsigned short>(i->second->size());
+	}
+	//-----------------------------------------------------------------------
+	unsigned short Material::getNumLodLevels(const String& schemeName) const
+	{
+		return getNumLodLevels(
+			MaterialManager::getSingleton()._getSchemeIndex(schemeName));
+	}
+	//-----------------------------------------------------------------------
+	void Material::insertSupportedTechnique(Technique* t)
+	{
+		mSupportedTechniques.push_back(t);
+		// get scheme
+		unsigned short schemeIndex = t->_getSchemeIndex();
+		BestTechniquesBySchemeList::iterator i =
+			mBestTechniquesBySchemeList.find(schemeIndex);
+		LodTechniques* lodtechs = 0;
+		if (i == mBestTechniquesBySchemeList.end())
+		{
+			lodtechs = new LodTechniques();
+			mBestTechniquesBySchemeList[schemeIndex] = lodtechs;
+		}
+		else
+		{
+			lodtechs = i->second;
+		}
+
+		// Insert won't replace if supported technique for this scheme/lod is
+		// already there, which is what we want
+		lodtechs->insert(LodTechniques::value_type(t->getLodIndex(), t));
+
+	}
+	//-----------------------------------------------------------------------------
+    Technique* Material::getBestTechnique(unsigned short lodIndex)
+    {
+        if (mSupportedTechniques.empty())
+        {
+            return NULL;
+        }
+        else
+        {
+			Technique* ret = 0;
+			// get scheme
+			BestTechniquesBySchemeList::iterator si = 
+				mBestTechniquesBySchemeList.find(
+				MaterialManager::getSingleton()._getActiveSchemeIndex());
+			// scheme not found?
+			if (si == mBestTechniquesBySchemeList.end())
+			{
+				// get the first item, will be 0 (the default) if default
+				// scheme techniques exist, otherwise the earliest defined
+				si = mBestTechniquesBySchemeList.begin();
+			}
+
+			// get LOD
+			LodTechniques::iterator li = si->second->find(lodIndex);
+			// LOD not found? 
+			if (li == si->second->end())
+			{
+				// Use the next LOD level up
+				for (LodTechniques::reverse_iterator rli = si->second->rbegin(); 
+					rli != si->second->rend(); ++rli)
+				{
+					if (rli->second->getLodIndex() < lodIndex)
+					{
+						ret = rli->second;
+						break;
+					}
+
+				}
+				if (!ret)
+				{
+					// shouldn't ever hit this really, unless user defines no LOD 0
+					// pick the first LOD we have (must be at least one to have a scheme entry)
+					ret = si->second->begin()->second;
+				}
+
+			}
+			else
+			{
+				// LOD found
+				ret = li->second;
+			}
+
+			return ret;
+
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Material::removeTechnique(unsigned short index)
+    {
+        assert (index < mTechniques.size() && "Index out of bounds.");
+        Techniques::iterator i = mTechniques.begin() + index;
+        delete(*i);
+        mTechniques.erase(i);
+        mSupportedTechniques.clear();
+		clearBestTechniqueList();
+        mCompilationRequired = true;
+    }
+    //-----------------------------------------------------------------------
+    void Material::removeAllTechniques(void)
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            delete(*i);
+        }
+        mTechniques.clear();
+        mSupportedTechniques.clear();
+        clearBestTechniqueList();
+        mCompilationRequired = true;
+    }
+    //-----------------------------------------------------------------------
+    Material::TechniqueIterator Material::getTechniqueIterator(void) 
+    {
+        return TechniqueIterator(mTechniques.begin(), mTechniques.end());
+    }
+    //-----------------------------------------------------------------------
+    Material::TechniqueIterator Material::getSupportedTechniqueIterator(void)
+    {
+        return TechniqueIterator(mSupportedTechniques.begin(), mSupportedTechniques.end());
+    }
+    //-----------------------------------------------------------------------
+    bool Material::isTransparent(void) const
+	{
+		// Check each technique
+		Techniques::const_iterator i, iend;
+		iend = mTechniques.end();
+		for (i = mTechniques.begin(); i != iend; ++i)
+		{
+			if ( (*i)->isTransparent() )
+				return true;
+		}
+		return false;
+	}
+    //-----------------------------------------------------------------------
+    void Material::compile(bool autoManageTextureUnits)
+    {
+        // Compile each technique, then add it to the list of supported techniques
+        mSupportedTechniques.clear();
+		clearBestTechniqueList();
+		mUnsupportedReasons.clear();
+
+
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+		size_t techNo = 0;
+        for (i = mTechniques.begin(); i != iend; ++i, ++techNo)
+        {
+            String compileMessages = (*i)->_compile(autoManageTextureUnits);
+            if ( (*i)->isSupported() )
+            {
+				insertSupportedTechnique(*i);
+            }
+			else
+			{
+				// Log informational
+				StringUtil::StrStreamType str;
+				str << "Material " << mName << " Technique " << techNo;
+				if (!(*i)->getName().empty())
+					str << "(" << (*i)->getName() << ")";
+				str << " is not supported. " << compileMessages;
+				LogManager::getSingleton().logMessage(str.str(), LML_TRIVIAL);
+				mUnsupportedReasons += compileMessages;
+			}
+        }
+
+        mCompilationRequired = false;
+
+        // Did we find any?
+        if (mSupportedTechniques.empty())
+        {
+			StringUtil::StrStreamType str;
+			str << "WARNING: material " << mName << " has no supportable "
+				"Techniques and will be blank. Explanation: " << std::endl << mUnsupportedReasons;
+            LogManager::getSingleton().logMessage(str.str());               
+        }
+    }
+	//-----------------------------------------------------------------------
+	void Material::clearBestTechniqueList(void)
+	{
+		for (BestTechniquesBySchemeList::iterator i = mBestTechniquesBySchemeList.begin();
+			i != mBestTechniquesBySchemeList.end(); ++i)
+		{
+			delete i->second;
+		}
+		mBestTechniquesBySchemeList.clear();
+	}
+    //-----------------------------------------------------------------------
+    void Material::setPointSize(Real ps)
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setPointSize(ps);
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void Material::setAmbient(Real red, Real green, Real blue)
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setAmbient(red, green, blue);
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void Material::setAmbient(const ColourValue& ambient)
+    {
+        setAmbient(ambient.r, ambient.g, ambient.b);
+    }
+    //-----------------------------------------------------------------------
+    void Material::setDiffuse(Real red, Real green, Real blue, Real alpha)
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setDiffuse(red, green, blue, alpha);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Material::setDiffuse(const ColourValue& diffuse)
+    {
+        setDiffuse(diffuse.r, diffuse.g, diffuse.b, diffuse.a);
+    }
+    //-----------------------------------------------------------------------
+    void Material::setSpecular(Real red, Real green, Real blue, Real alpha)
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setSpecular(red, green, blue, alpha);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Material::setSpecular(const ColourValue& specular)
+    {
+        setSpecular(specular.r, specular.g, specular.b, specular.a);
+    }
+    //-----------------------------------------------------------------------
+    void Material::setShininess(Real val)
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setShininess(val);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Material::setSelfIllumination(Real red, Real green, Real blue)
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setSelfIllumination(red, green, blue);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Material::setSelfIllumination(const ColourValue& selfIllum)
+    {
+        setSelfIllumination(selfIllum.r, selfIllum.g, selfIllum.b);
+    }
+    //-----------------------------------------------------------------------
+    void Material::setDepthCheckEnabled(bool enabled)
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setDepthCheckEnabled(enabled);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Material::setDepthWriteEnabled(bool enabled)
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setDepthWriteEnabled(enabled);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Material::setDepthFunction( CompareFunction func )
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setDepthFunction(func);
+        }
+    }
+    //-----------------------------------------------------------------------
+	void Material::setColourWriteEnabled(bool enabled)
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setColourWriteEnabled(enabled);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Material::setCullingMode( CullingMode mode )
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setCullingMode(mode);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Material::setManualCullingMode( ManualCullingMode mode )
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setManualCullingMode(mode);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Material::setLightingEnabled(bool enabled)
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setLightingEnabled(enabled);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Material::setShadingMode( ShadeOptions mode )
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setShadingMode(mode);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Material::setFog(bool overrideScene, FogMode mode, const ColourValue& colour,
+        Real expDensity, Real linearStart, Real linearEnd)
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setFog(overrideScene, mode, colour, expDensity, linearStart, linearEnd);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Material::setDepthBias(float constantBias, float slopeScaleBias)
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setDepthBias(constantBias, slopeScaleBias);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Material::setTextureFiltering(TextureFilterOptions filterType)
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setTextureFiltering(filterType);
+        }
+    }
+    // --------------------------------------------------------------------
+    void Material::setTextureAnisotropy(int maxAniso)
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setTextureAnisotropy(maxAniso);
+        }
+    }
+    // --------------------------------------------------------------------
+    void Material::setSceneBlending( const SceneBlendType sbt )
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setSceneBlending(sbt);
+        }
+    }
+    // --------------------------------------------------------------------
+    void Material::setSceneBlending( const SceneBlendFactor sourceFactor, 
+        const SceneBlendFactor destFactor)
+    {
+        Techniques::iterator i, iend;
+        iend = mTechniques.end();
+        for (i = mTechniques.begin(); i != iend; ++i)
+        {
+            (*i)->setSceneBlending(sourceFactor, destFactor);
+        }
+    }
+    // --------------------------------------------------------------------
+    void Material::_notifyNeedsRecompile(void)
+    {
+        mCompilationRequired = true;
+        // Also need to unload to ensure we loaded any new items
+		if (isLoaded()) // needed to stop this being called in 'loading' state
+			unload();
+    }
+    // --------------------------------------------------------------------
+    void Material::setLodLevels(const LodDistanceList& lodDistances)
+    {
+        // Square the distances for the internal list
+		LodDistanceList::const_iterator i, iend;
+		iend = lodDistances.end();
+		// First, clear and add single zero entry
+		mLodDistances.clear();
+		mLodDistances.push_back(0.0f);
+		for (i = lodDistances.begin(); i != iend; ++i)
+		{
+			mLodDistances.push_back((*i) * (*i));
+		}
+		
+    }
+    // --------------------------------------------------------------------
+    unsigned short Material::getLodIndex(Real d) const
+    {
+        return getLodIndexSquaredDepth(d * d);
+    }
+    // --------------------------------------------------------------------
+    unsigned short Material::getLodIndexSquaredDepth(Real squaredDistance) const
+    {
+		LodDistanceList::const_iterator i, iend;
+		iend = mLodDistances.end();
+		unsigned short index = 0;
+		for (i = mLodDistances.begin(); i != iend; ++i, ++index)
+		{
+			if (*i > squaredDistance)
+			{
+				return index - 1;
+			}
+		}
+
+		// If we fall all the way through, use the highest value
+		return static_cast<ushort>(mLodDistances.size() - 1);
+    }
+    // --------------------------------------------------------------------
+    Material::LodDistanceIterator Material::getLodDistanceIterator(void) const
+    {
+        return LodDistanceIterator(mLodDistances.begin(), mLodDistances.end());
+    }
+
+    //-----------------------------------------------------------------------
+    bool Material::applyTextureAliases(const AliasTextureNamePairList& aliasList, const bool apply) const
+    {
+        // iterate through all techniques and apply texture aliases
+		Techniques::const_iterator i, iend;
+		iend = mTechniques.end();
+        bool testResult = false;
+
+		for (i = mTechniques.begin(); i != iend; ++i)
+		{
+            if ((*i)->applyTextureAliases(aliasList, apply))
+                testResult = true;
+		}
+
+        return testResult;
+    }
+}
Index: /OgreMain/src/OgreMaterialManager.cpp
===================================================================
--- /OgreMain/src/OgreMaterialManager.cpp	(revision 5)
+++ /OgreMain/src/OgreMaterialManager.cpp	(revision 5)
@@ -0,0 +1,289 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreMaterialManager.h"
+
+#include "OgreMaterial.h"
+#include "OgreStringVector.h"
+#include "OgreLogManager.h"
+#include "OgreArchive.h"
+#include "OgreStringConverter.h"
+#include "OgreBlendMode.h"
+#include "OgreTechnique.h"
+#include "OgrePass.h"
+#include "OgreTextureUnitState.h"
+#include "OgreException.h"
+#include "OgreMaterialScriptCompiler.h"
+
+/** Set this to 0 if having problems with the new Material Script Compiler and want to use the original one.
+*/
+#ifndef OGRE_MATERIAL_SCRIPT_COMPILER
+#define OGRE_MATERIAL_SCRIPT_COMPILER 0
+#endif
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    template<> MaterialManager* Singleton<MaterialManager>::ms_Singleton = 0;
+    MaterialManager* MaterialManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    MaterialManager& MaterialManager::getSingleton(void)
+    {
+        assert( ms_Singleton );  return ( *ms_Singleton );
+    }
+	String MaterialManager::DEFAULT_SCHEME_NAME = "Default";
+    //-----------------------------------------------------------------------
+    MaterialManager::MaterialManager()
+    {
+	    mDefaultMinFilter = FO_LINEAR;
+	    mDefaultMagFilter = FO_LINEAR;
+	    mDefaultMipFilter = FO_POINT;
+		mDefaultMaxAniso = 1;
+
+		// Create primary thread copies of script compiler / serializer
+		// other copies for other threads may also be instantiated
+#if OGRE_MATERIAL_SCRIPT_COMPILER
+        OGRE_THREAD_POINTER_SET(mScriptCompiler, new MaterialScriptCompiler());
+#endif
+		OGRE_THREAD_POINTER_SET(mSerializer, new MaterialSerializer());
+
+        // Loading order
+        mLoadOrder = 100.0f;
+		// Scripting is supported by this manager
+		mScriptPatterns.push_back("*.program");
+		mScriptPatterns.push_back("*.material");
+		ResourceGroupManager::getSingleton()._registerScriptLoader(this);
+
+		// Resource type
+		mResourceType = "Material";
+
+		// Register with resource group manager
+		ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
+
+		// Default scheme
+		mActiveSchemeIndex = 0;
+		mActiveSchemeName = DEFAULT_SCHEME_NAME;
+		mSchemes[mActiveSchemeName] = 0;
+
+    }
+    //-----------------------------------------------------------------------
+    MaterialManager::~MaterialManager()
+    {
+        mDefaultSettings.setNull();
+	    // Resources cleared by superclass
+		// Unregister with resource group manager
+		ResourceGroupManager::getSingleton()._unregisterResourceManager(mResourceType);
+		ResourceGroupManager::getSingleton()._unregisterScriptLoader(this);
+
+		// delete primary thread instances directly, other threads will delete
+		// theirs automatically when the threads end (part of boost::thread_specific_ptr)
+#if OGRE_MATERIAL_SCRIPT_COMPILER
+        OGRE_THREAD_POINTER_DELETE(mScriptCompiler);
+#endif
+		OGRE_THREAD_POINTER_DELETE(mSerializer);
+
+    }
+	//-----------------------------------------------------------------------
+	Resource* MaterialManager::createImpl(const String& name, ResourceHandle handle,
+		const String& group, bool isManual, ManualResourceLoader* loader,
+        const NameValuePairList* params)
+	{
+		return new Material(this, name, handle, group, isManual, loader);
+	}
+    //-----------------------------------------------------------------------
+	void MaterialManager::initialise(void)
+	{
+		// Set up default material - don't use name contructor as we want to avoid applying defaults
+		mDefaultSettings = create("DefaultSettings", ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME);
+        // Add a single technique and pass, non-programmable
+        mDefaultSettings->createTechnique()->createPass();
+
+	    // Set up a lit base white material
+	    create("BaseWhite", ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME);
+	    // Set up an unlit base white material
+        MaterialPtr baseWhiteNoLighting = create("BaseWhiteNoLighting",
+			ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME);
+        baseWhiteNoLighting->setLightingEnabled(false);
+
+	}
+    //-----------------------------------------------------------------------
+    void MaterialManager::parseScript(DataStreamPtr& stream, const String& groupName)
+    {
+        // Delegate to serializer
+#if OGRE_MATERIAL_SCRIPT_COMPILER
+#if OGRE_THREAD_SUPPORT
+		// check we have an instance for this thread (should always have one for main thread)
+		if (!mScriptCompiler.get())
+		{
+			// create a new instance for this thread - will get deleted when
+			// the thread dies
+			mScriptCompiler.reset(new MaterialScriptCompiler());
+		}
+#endif
+        mScriptCompiler->parseScript(stream, groupName);
+#else
+#if OGRE_THREAD_SUPPORT
+		// check we have an instance for this thread (should always have one for main thread)
+		if (!mSerializer.get())
+		{
+			// create a new instance for this thread - will get deleted when
+			// the thread dies
+			mSerializer.reset(new MaterialSerializer());
+		}
+#endif
+        mSerializer->parseScript(stream, groupName);
+#endif
+    }
+    //-----------------------------------------------------------------------
+	void MaterialManager::setDefaultTextureFiltering(TextureFilterOptions fo)
+	{
+        switch (fo)
+        {
+        case TFO_NONE:
+            setDefaultTextureFiltering(FO_POINT, FO_POINT, FO_NONE);
+            break;
+        case TFO_BILINEAR:
+            setDefaultTextureFiltering(FO_LINEAR, FO_LINEAR, FO_POINT);
+            break;
+        case TFO_TRILINEAR:
+            setDefaultTextureFiltering(FO_LINEAR, FO_LINEAR, FO_LINEAR);
+            break;
+        case TFO_ANISOTROPIC:
+            setDefaultTextureFiltering(FO_ANISOTROPIC, FO_ANISOTROPIC, FO_LINEAR);
+            break;
+        }
+	}
+    //-----------------------------------------------------------------------
+	void MaterialManager::setDefaultAnisotropy(unsigned int maxAniso)
+	{
+		mDefaultMaxAniso = maxAniso;
+	}
+    //-----------------------------------------------------------------------
+	unsigned int MaterialManager::getDefaultAnisotropy() const
+	{
+		return mDefaultMaxAniso;
+	}
+    //-----------------------------------------------------------------------
+    void MaterialManager::setDefaultTextureFiltering(FilterType ftype, FilterOptions opts)
+    {
+        switch (ftype)
+        {
+        case FT_MIN:
+            mDefaultMinFilter = opts;
+            break;
+        case FT_MAG:
+            mDefaultMagFilter = opts;
+            break;
+        case FT_MIP:
+            mDefaultMipFilter = opts;
+            break;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialManager::setDefaultTextureFiltering(FilterOptions minFilter,
+        FilterOptions magFilter, FilterOptions mipFilter)
+    {
+        mDefaultMinFilter = minFilter;
+        mDefaultMagFilter = magFilter;
+        mDefaultMipFilter = mipFilter;
+    }
+    //-----------------------------------------------------------------------
+    FilterOptions MaterialManager::getDefaultTextureFiltering(FilterType ftype) const
+    {
+        switch (ftype)
+        {
+        case FT_MIN:
+            return mDefaultMinFilter;
+        case FT_MAG:
+            return mDefaultMagFilter;
+        case FT_MIP:
+            return mDefaultMipFilter;
+        }
+        // to keep compiler happy
+        return mDefaultMinFilter;
+    }
+    //-----------------------------------------------------------------------
+	unsigned short MaterialManager::_getSchemeIndex(const String& schemeName)
+	{
+		unsigned short ret = 0;
+		SchemeMap::iterator i = mSchemes.find(schemeName);
+		if (i != mSchemes.end())
+		{
+			ret = i->second;
+		}
+		else
+		{
+			// Create new
+			ret = static_cast<unsigned short>(mSchemes.size());
+			mSchemes[schemeName] = ret;
+		}
+		return ret;
+
+	}
+	//-----------------------------------------------------------------------
+	const String& MaterialManager::_getSchemeName(unsigned short index)
+	{
+		for (SchemeMap::iterator i = mSchemes.begin(); i != mSchemes.end(); ++i)
+		{
+			if (i->second == index)
+				return i->first;
+		}
+		return DEFAULT_SCHEME_NAME;
+	}
+    //-----------------------------------------------------------------------
+	unsigned short MaterialManager::_getActiveSchemeIndex(void) const
+	{
+		return mActiveSchemeIndex;
+	}
+    //-----------------------------------------------------------------------
+	const String& MaterialManager::getActiveScheme(void) const
+	{
+		return mActiveSchemeName;
+	}
+    //-----------------------------------------------------------------------
+	void MaterialManager::setActiveScheme(const String& schemeName)
+	{
+		SchemeMap::iterator i = mSchemes.find(schemeName);
+		if (i == mSchemes.end())
+		{
+			// Invalid scheme, use default
+			mActiveSchemeName = DEFAULT_SCHEME_NAME;
+			mActiveSchemeIndex = 0;
+		}
+		else
+		{
+			mActiveSchemeName = schemeName;
+			mActiveSchemeIndex = i->second;
+		}
+
+	}
+    //-----------------------------------------------------------------------
+}
Index: /OgreMain/src/OgreMaterialScriptCompiler.cpp
===================================================================
--- /OgreMain/src/OgreMaterialScriptCompiler.cpp	(revision 5)
+++ /OgreMain/src/OgreMaterialScriptCompiler.cpp	(revision 5)
@@ -0,0 +1,3011 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreMaterialScriptCompiler.h"
+#include "OgreStringConverter.h"
+#include "OgreLogManager.h"
+#include "OgreException.h"
+#include "OgreBlendMode.h"
+#include "OgreGpuProgram.h"
+#include "OgreTechnique.h"
+#include "OgrePass.h"
+#include "OgreMaterialManager.h"
+#include "OgreGpuProgramManager.h"
+#include "OgreHighLevelGpuProgramManager.h"
+#include "OgreExternalTextureSourceManager.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    // Static definitions
+    //-----------------------------------------------------------------------
+    MaterialScriptCompiler::TokenActionMap MaterialScriptCompiler::mTokenActionMap;
+
+    //-----------------------------------------------------------------------
+    const String& MaterialScriptCompiler::getClientBNFGrammer(void) const
+    {
+        // simplified Backus - Naur Form (BNF) grammer for material scripts
+        static const String materialScript_BNF =
+        "<Script> ::= {<Script_Properties>} \n"
+
+        "<Script_Properties> ::= <Material> | <Vertex_Program> | <Fragment_Program> \n"
+
+        "<Material> ::= 'material' <Flex_Label> [<Material_Clone>] '{' {<Material_Properties>} '}' \n"
+
+        "<Material_Properties> ::= <Technique> | <Set_Texture_Alias> | "
+        "                          <Lod_Distances> | <Receive_Shadows> | "
+        "                          <Transparency_Casts_Shadows> \n"
+
+        "    <Material_Clone> ::= ':' <Flex_Label> \n"
+        "    <Set_Texture_Alias> ::= 'set_texture_alias' <Label> [<Seperator>] <Label> \n"
+        "    <Lod_Distances> ::= 'lod_distances' <#distance> {<#distance>} \n"
+        "    <Receive_Shadows> ::= 'receive_shadows' <On_Off> \n"
+        "    <Transparency_Casts_Shadows> ::= 'transparency_casts_shadows' <On_Off> \n"
+
+        // Technique section rules
+        "<Technique> ::= 'technique' [<Label>] '{' {<Technique_Properties>} '}' \n"
+        "    <Technique_Properties> ::= <Pass> | <Lod_Index> | <Scheme> \n"
+        "    <Lod_Index> ::= 'lod_index' <#value> \n"
+        "    <Scheme> ::= 'scheme' <Label> \n"
+
+        // Pass section rules
+        "    <Pass> ::= 'pass' [<Label>] '{' {<Pass_Properties>} '}' \n"
+        "        <Pass_Properties> ::= <Ambient> | <Diffuse> | <Specular> | <Emissive> | \n"
+        "                              <Scene_Blend> | <Depth_Check> | <Depth_Write> | \n"
+        "                              <Texture_Unit> | \n"
+        "                              <Depth_Func> | <Depth_Bias> | <Alpha_Rejection> | \n"
+        "                              <Cull_Hardware> | <Cull_Software> | <Lighting> | \n"
+        "                              <GPU_Program_Ref> | \n"
+        "                              <Shading> | <PolygonMode> | <Fog_Override> | <Colour_Write> | \n"
+		"                              <Max_Lights> | <Start_Light> | <Iteration> | \n"
+		"                              <Point_Sprites> | <Point_Size_Attenuation> | \n"
+		"                              <Point_Size_Min> | <Point_Size_Max> | <Point_Size> \n"
+
+        "        <Ambient> ::= 'ambient' <ColourOptions> \n"
+        "        <Diffuse> ::= 'diffuse' <ColourOptions> \n"
+        "        <Specular> ::= 'specular' <SpecularOptions> \n"
+        "           <SpecularOptions> ::= <Specular_Colour_Params> | <Specular_Vertex> \n"
+        "           <Specular_Colour_Params> ::= <#red> <#green> <#blue> <#val> [<#val>] \n"
+        "           <Specular_Vertex> ::= 'vertexcolour' <#shininess> \n"
+        "        <Emissive> ::= 'emissive' <ColourOptions> \n"
+
+        "        <ColourOptions> ::= <Colour_Params> | 'vertexcolour' \n"
+
+        "        <Scene_Blend> ::= 'scene_blend' <SceneBlend_Options> \n"
+        "          <SceneBlend_Options> ::= <Simple_Blend> | <User_Blend> \n"
+        "            <Simple_Blend> ::= <Base_Blend> | 'colour_blend' \n"
+        "            <Base_Blend> ::= 'alpha_blend' | 'modulate' | 'add' \n"
+        "            <User_Blend> ::= <Blend_Factor> <Blend_Factor> \n"
+        "            <Blend_Factor> ::= 'dest_colour' | 'src_colour' | \n"
+        "                               'one_minus_dest_colour' | 'one_minus_src_colour' | \n"
+        "                               'dest_alpha' | 'src_alpha' | 'one_minus_dest_alpha' | \n"
+        "                               'one_minus_src_alpha' | 'one' | 'zero' \n"
+
+        "        <Depth_Check> ::= 'depth_check' <On_Off> \n"
+        "        <Depth_Write> ::= 'depth_write' <On_Off> \n"
+        "        <Depth_Func> ::= 'depth_func' <Compare_Func> \n"
+		"        <Depth_Bias> ::= 'depth_bias' <#constant> [<#slopescale>] \n"
+        "        <Alpha_Rejection> ::= 'alpha_rejection' <Compare_Func> <#value> \n"
+        "        <Compare_Func> ::= 'always_fail' | 'always_pass' | 'less_equal' | 'less' | \n"
+        "                           'equal' | 'not_equal' | 'greater_equal' | 'greater' \n"
+        "        <Cull_Hardware> ::= 'cull_hardware' <Cull_Hardware_Otions> \n"
+        "           <Cull_Hardware_Otions> ::= 'clockwise' | 'anticlockwise' | 'none' \n"
+        "        <Cull_Software> ::= 'cull_software' <Cull_Software_Otions> \n"
+        "           <Cull_Software_Otions> ::= 'back' | 'front' | 'none' \n"
+        "        <Lighting> ::= 'lighting' <On_Off> \n"
+        "        <Shading> ::= 'shading' <Shading_Options> \n"
+        "           <Shading_Options> ::= 'flat' | 'gouraud' | 'phong' \n"
+        "        <PolygonMode> ::= 'polygon_mode' <PolygonMode_Options> \n"
+        "           <PolygonMode_Options> ::= 'solid' | 'wireframe' | 'points' \n"
+        "        <Colour_Write> ::= 'colour_write' <On_Off> \n"
+		"        <Point_Size> ::= 'point_size' <#size> \n"
+		"        <Point_Sprites> ::= 'point_sprites' <On_Off> \n"
+		"        <Point_Size_Min> ::= 'point_size_min' <#size> \n"
+		"        <Point_Size_Max> ::= 'point_size_max' <#size> \n"
+		"        <Point_Size_Attenuation> ::= 'point_size_attenuation' <On_Off> [<Point_Size_Att_Params>] \n"
+		"            <Point_Size_Att_Params> ::= <#constant> <#linear> <#quadric> \n"
+        "        <Fog_Override> ::= 'fog_override' <Fog_Override_Options> \n"
+        "           <Fog_Override_Options> ::= 'false' | <fog_true> \n"
+        "             <fog_true> ::= 'true' [<Fog_True_Params>] \n"
+        "               <Fog_True_Params> ::= 'none' | <fog_True_Param_Option> \n"
+        "                   <fog_True_Param_Option> ::= <fog_type> <#red> <#green> <#blue> <#fog_density> <#start> <#end> \n"
+        "                       <fog_type> ::= 'linear' | 'exp2' | 'exp' \n"
+        "        <Max_Lights> ::= 'max_lights' <#number> \n"
+		"        <Start_Light> ::= 'start_light' <#number> \n"
+        "        <Iteration> ::= 'iteration' <Iteration_Options> \n"
+        "           <Iteration_Options> ::= <Iteration_Once_Params> | 'once' | <Iteration_Counted> \n"
+        "             <Iteration_Once_Params> ::= 'once_per_light' [<light_type>] \n"
+        "             <Iteration_Counted> ::= <#number> [<Per_Light_Options>] \n"
+		"               <Per_Light_Options> ::= <Per_Light> | <Per_N_Lights> \n"
+		"                 <Per_Light> ::= 'per_light' [<light_type>] \n"
+		"                 <Per_N_Lights> ::= 'per_n_lights' <#num_lights> [<light_type>] \n"
+        "             <light_type> ::= 'point' | 'directional' | 'spot' \n"
+        // Texture Unit section rules
+        "        <Texture_Unit> ::= 'texture_unit' [<Label>] '{' {<TUS_Properties>} '}' \n"
+        "        <TUS_Properties> ::= <Texture_Alias> | <Texture> | <Anim_Texture> | <Cubic_Texture> | \n"
+        "                             <Tex_Coord_Set> | <Tex_Address_Mode> | <Tex_Border_Colour> | <Filtering> | \n"
+        "                             <Max_Anisotropy> | <MipMap_Bias> | <Colour_Op_Ex> | <Colour_Op_Multipass_Fallback> | <Colour_Op> | \n"
+        "                             <Alpha_Op_Ex> | <Env_Map> | <Scroll_Anim> | <Scroll> | <Rotate_Anim> | <Rotate> | \n"
+		"                             <Scale> | <Wave_Xform> | <Transform> | <Binding_Type> | <Content_Type> \n"
+        "           <Texture_Alias> ::= 'texture_alias' <Label> \n"
+        "           <Texture> ::= 'texture' <Label> {<Texture_Properties>} \n"
+        "           <Texture_Properties> ::= '1d' | '2d' | '3d' | 'cubic' | 'unlimited' | 'alpha' | <#mipmap> \n"
+        "                                    | " + PixelUtil::getBNFExpressionOfPixelFormats(true) + " \n"
+        "           <Anim_Texture> ::= 'anim_texture' <Label> <Anim_Texture_Properties> \n"
+        "               <Anim_Texture_Properties> ::= <Numbered_Anim_Texture> | <Seperate_Anim_Textures> \n"
+        "               <Numbered_Anim_Texture> ::= <#frames> <#duration> \n"
+        "               <Seperate_Anim_Textures> ::= <anim_frame> {<anim_frame>} \n"
+        "                   <anim_frame> ::= (?!<TUS_Terminators>) <Label> [<Seperator>] \n"
+        "           <TUS_Terminators> ::= '}' | 'texture_alias' | 'texture' | 'anim_texture' | 'cubic_texture' | \n"
+        "                                 'tex_coord_set' | 'tex_address_mode' | 'tex_border_colour' | \n"
+        "                                 'filtering' | 'max_anisotropy' | 'mipmap_bias' | 'colour_op' | 'colour_op_ex' | \n"
+        "                                 'colour_op_multipass_fallback' | 'alpha_op_ex' | 'env_map' | \n"
+        "                                 'scroll' | 'rotate' | 'scale' | 'wave_xform' | 'transform' | 'binding_type' \n"
+        "           <Cubic_Texture> ::= 'cubic_texture' <Label> <Cubic_Texture_Options> \n"
+        "               <Cubic_Texture_Options> ::= 'combineduvw' | 'separateuv' | <Cubic_Seperate> \n"
+        "               <Cubic_Seperate> ::= <Label> [<Seperator>] <Label> [<Seperator>] <Label> \n"
+        "                                    [<Seperator>] <Label> [<Seperator>] <Label> 'separateuv' \n"
+        "           <Tex_Coord_Set> ::= 'tex_coord_set' <#set_num> \n"
+        "           <Tex_Address_Mode> ::= 'tex_address_mode' <UVW_Mode> [<UVW_Mode>] [<UVW_Mode>] \n"
+        "               <UVW_Mode> ::= 'wrap' | 'clamp' | 'mirror' | 'border' \n"
+        "           <Tex_Border_Colour> ::= 'tex_border_colour' <Colour_Params> \n"
+        "           <Filtering> ::= 'filtering' <Filtering_Options>"
+        "               <Filtering_Options> ::= <Simple_Filter> | <Complex_Filter> \n"
+        "                 <Simple_Filter> ::= 'bilinear' | 'trilinear' | 'anisotropic' | 'none' \n"
+        "                 <Complex_Filter> ::= <MinMagFilter> <MinMagFilter> <MipFilter> \n"
+        "                   <MinMagFilter> ::= 'linear' | 'point' | 'anisotropic' \n"
+        "                   <MipFilter> ::= 'linear' | 'point' | 'none' \n"
+        "           <Max_Anisotropy> ::= 'max_anisotropy' <#val> \n"
+        "           <MipMap_Bias> ::= 'mipmap_bias' <#val> \n"
+        "           <Colour_Op> ::= 'colour_op' <Colour_Op_Options> \n"
+        "               <Colour_Op_Options> ::= <Base_Blend> | 'replace' \n"
+        "           <Colour_Op_Ex> ::= 'colour_op_ex' <Combine_Operation> <Source_Option> <Source_Option> {<#val>} \n"
+        "               <Combine_Operation> ::= 'source1' | 'source2' | 'modulate_x2' | 'modulate_x4' | \n"
+        "                                       'modulate' | 'add_signed' | 'add_smooth' | 'add' | \n"
+        "                                       'subtract' | 'blend_diffuse_alpha' | 'blend_texture_alpha' | \n"
+        "                                       'blend_current_alpha' | 'blend_manual' | 'dotproduct' | \n"
+        "                                       'blend_diffuse_colour' \n"
+        "               <Source_Option> ::= 'src_current' | 'src_texture' | 'src_diffuse' | \n"
+        "                                   'src_specular' | 'src_manual' \n"
+        "           <Colour_Op_Multipass_Fallback> ::= 'colour_op_multipass_fallback' <Blend_Factor> <Blend_Factor> \n"
+        "           <Alpha_Op_Ex> ::= 'alpha_op_ex' <Combine_Operation> <Source_Option> <Source_Option> {<#val>} \n"
+        "           <Env_Map> ::= 'env_map' <Env_Map_Option> \n"
+        "               <Env_Map_Option> ::= 'spherical' | 'planar' | 'cubic_reflection' | 'cubic_normal' | 'off' \n"
+        "           <Scroll> ::= 'scroll' <#x> <#y> \n"
+        "           <Scroll_Anim> ::= 'scroll_anim' <#xspeed> <#yspeed> \n"
+        "           <Rotate> ::= 'rotate' <#angle> \n"
+        "           <Rotate_Anim> ::= 'rotate_anim' <#revs_per_second> \n"
+        "           <Scale> ::= 'scale' <#x> <#y> \n"
+        "           <Wave_Xform> ::= 'wave_xform' <Xform_Type> <Wave_Type> <#base> <#frequency> <#phase> <#amplitude> \n"
+        "               <Xform_Type> ::= 'scroll_x' | 'scroll_y' | 'rotate' | 'scale_x' | 'scale_y' \n"
+        "               <Wave_Type> ::= 'sine' | 'triangle' | 'square' | 'sawtooth' | 'inverse_sawtooth' \n"
+        "           <Transform> ::= 'transform' <#m00> <#m01> <#m02> <#m03> <#m10> <#m11> <#m12> <#m13> <#m20> <#m21> <#m22> <#m23> \n"
+        "                           <#m30> <#m31> <#m32> <#m33> \n"
+        "           <Binding_Type> ::= 'binding_type' <Program_Type_Options> \n"
+        "           <Program_Type_Options> ::= 'vertex' | 'fragment' \n"
+		"			<Content_Type> ::= 'content_type' <Content_Type_Options> \n"
+		"           <Content_Type_Options> ::= 'named' | 'shadow' \n"
+        // GPU Programs
+        " \n"
+        "<Vertex_Program> ::= 'vertex_program' <Label> [<Seperator>] <Label> '{' {<Vertex_Program_Option>} '}' \n"
+        "   <Vertex_Program_Option> ::= <Vertex_Program_Animation> | <Vertex_Texture_Fetch> | <GPU_Program_Options> \n"
+        "   <Vertex_Program_Animation> ::= <Skeletal_Animation> | <Morph_Animation> | <Pose_Animation> \n"
+        "       <Skeletal_Animation> ::= 'includes_skeletal_animation' <True_False> \n"
+        "       <Morph_Animation> ::= 'includes_morph_animation' <True_False> \n"
+        "       <Pose_Animation> ::= 'includes_pose_animation' <#val> \n"
+        "       <Vertex_Texture_Fetch> ::= 'uses_vertex_texture_fetch' <True_False> \n"
+        "<Fragment_Program> ::= 'fragment_program' <Label> [<Seperator>] <Label> '{' {<GPU_Program_Options>}'}' \n"
+        // do custom parameters last since it will consume everything on the line in the source
+        "   <GPU_Program_Options> ::= <Program_Source> | <Syntax> | <Default_Params> | <Custom_Parameter> \n"
+        "       <Program_Source> ::= 'source' <Label> \n"
+        "       <Syntax> ::= 'syntax' <Label> \n"
+        "       <Default_Params> ::= 'default_params' '{' {<GPUParams_Option>} '}' \n"
+        "       <Custom_Parameter> ::= 'custom_parameter' : <Unquoted_Label> [<Seperator>] <Spaced_Label> \n"
+
+        "   <GPU_Program_Ref> ::= <GPU_Program_Ref_Type> [<Flex_Label>] '{' {<GPUParams_Option>} '}' \n"
+        "       <GPU_Program_Ref_Type> ::= 'vertex_program_ref' | 'fragment_program_ref' | \n"
+        "                                  'shadow_caster_vertex_program_ref' | \n"
+        "                                  'shadow_receiver_vertex_program_ref' | \n"
+        "                                  'shadow_receiver_fragment_program_ref' \n"
+
+        "   <GPUParams_Option> ::= <Param_Named_Auto> | <Param_Named> | <Param_Indexed_Auto> | <Param_Indexed> \n"
+        "       <Param_Named_Auto> ::= 'param_named_auto' <Unquoted_Label> [<Seperator>] <Unquoted_Label> [<#val>] \n"
+        "       <Param_Named> ::= 'param_named' <Unquoted_Label> [<Seperator>] <Param_Value_Option> \n"
+        "       <Param_Indexed_Auto> ::= 'param_indexed_auto' <#index> <Unquoted_Label> [<#val>] \n"
+        "       <Param_Indexed> ::= 'param_indexed' <#index> <Param_Value_Option> \n"
+        "       <Param_Value_Option> ::= <Unquoted_Label> {<#val>} \n"
+
+        // common rules
+        "<On_Off> ::= 'on' | 'off' \n"
+        "<True_False> ::= 'true' | 'false' \n"
+        "<Colour_Params> ::= <#red> <#green> <#blue> [<#alpha>] \n"
+        "<Seperator> ::= -' ' \n"
+
+        "<Labels_1_N> ::= <Label> [<Seperator>] {<More_Labels>} \n"
+        "<More_Labels> ::=  <Label> [<Seperator>] \n"
+		"<Label> ::= <Quoted_Label> | <Unquoted_Label> \n"
+		"<Flex_Label> ::= <Quoted_Label> | <Spaced_Label> \n"
+		"<Quoted_Label> ::= -'\"' <Spaced_Label> -'\"' \n"
+		"<Spaced_Label> ::= <Spaced_Label_Illegals> {<Spaced_Label_Illegals>} \n"
+        "<Unquoted_Label> ::= <Unquoted_Label_Illegals> {<Unquoted_Label_Illegals>} \n"
+		"<Spaced_Label_Illegals> ::= (!,:\n\r\t{}\") \n"
+		"<Unquoted_Label_Illegals> ::= (! :\n\r\t{}\") \n"
+
+        ;
+
+        return materialScript_BNF;
+    }
+    //-----------------------------------------------------------------------
+    const String& MaterialScriptCompiler::getClientGrammerName(void) const
+    {
+        static const String grammerName = "Material Script";
+        return grammerName;
+    }
+    //-----------------------------------------------------------------------
+    MaterialScriptCompiler::MaterialScriptCompiler(void)
+    {
+        // set default group resource name
+        mScriptContext.groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME;
+    }
+    //-----------------------------------------------------------------------
+    MaterialScriptCompiler::~MaterialScriptCompiler(void)
+    {
+
+    }
+
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseScript(DataStreamPtr& stream, const String& groupName, const bool allowOverride)
+    {
+        mScriptContext.groupName = groupName;
+        mScriptContext.allowOverride = allowOverride;
+        Compiler2Pass::compile(stream->getAsString(),  stream->getName());
+    }
+
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::setupTokenDefinitions(void)
+    {
+        addLexemeAction("{", &MaterialScriptCompiler::parseOpenBrace);
+        addLexemeAction("}", &MaterialScriptCompiler::parseCloseBrace);
+        addLexemeTokenAction("vertex_program", ID_VERTEX_PROGRAM, &MaterialScriptCompiler::parseGPUProgram);
+            addLexemeAction("includes_skeletal_animation", &MaterialScriptCompiler::parseProgramSkeletalAnimation);
+            addLexemeAction("includes_morph_animation", &MaterialScriptCompiler::parseProgramMorphAnimation);
+            addLexemeAction("includes_pose_animation", &MaterialScriptCompiler::parseProgramPoseAnimation);
+            addLexemeAction("uses_vertex_texture_fetch", &MaterialScriptCompiler::parseProgramVertexTextureFetch);
+
+        addLexemeTokenAction("fragment_program", ID_FRAGMENT_PROGRAM, &MaterialScriptCompiler::parseGPUProgram);
+
+            addLexemeAction("source", &MaterialScriptCompiler::parseProgramSource);
+            addLexemeAction("syntax", &MaterialScriptCompiler::parseProgramSyntax);
+            addLexemeAction("default_params", &MaterialScriptCompiler::parseDefaultParams);
+            addLexemeAction("param_indexed", &MaterialScriptCompiler::parseParamIndexed);
+            addLexemeAction("param_indexed_auto", &MaterialScriptCompiler::parseParamIndexedAuto);
+            addLexemeAction("param_named", &MaterialScriptCompiler::parseParamNamed);
+            addLexemeAction("param_named_auto", &MaterialScriptCompiler::parseParamNamedAuto);
+            addLexemeAction("custom_parameter", &MaterialScriptCompiler::parseProgramCustomParameter);
+
+        addLexemeAction("material", &MaterialScriptCompiler::parseMaterial);
+            addLexemeToken(":", ID_CLONE);
+            addLexemeAction("lod_distances", &MaterialScriptCompiler::parseLodDistances);
+            addLexemeAction("receive_shadows", &MaterialScriptCompiler::parseReceiveShadows);
+            addLexemeAction("transparency_casts_shadows", &MaterialScriptCompiler::parseTransparencyCastsShadows);
+            addLexemeAction("set_texture_alias", &MaterialScriptCompiler::parseSetTextureAlias);
+
+        // Technique section
+        addLexemeAction("technique", &MaterialScriptCompiler::parseTechnique);
+            addLexemeAction("scheme", &MaterialScriptCompiler::parseScheme);
+            addLexemeAction("lod_index", &MaterialScriptCompiler::parseLodIndex);
+
+
+        // Pass section
+        addLexemeAction("pass", &MaterialScriptCompiler::parsePass);
+            addLexemeAction("ambient", &MaterialScriptCompiler::parseAmbient);
+            addLexemeAction("diffuse", &MaterialScriptCompiler::parseDiffuse);
+            addLexemeAction("specular", &MaterialScriptCompiler::parseSpecular);
+            addLexemeAction("emissive", &MaterialScriptCompiler::parseEmissive);
+            addLexemeToken("vertexcolour", ID_VERTEXCOLOUR);
+
+            addLexemeAction("scene_blend", &MaterialScriptCompiler::parseSceneBlend);
+                addLexemeToken("colour_blend", ID_COLOUR_BLEND);
+                addLexemeToken("dest_colour", ID_DEST_COLOUR);
+                addLexemeToken("src_colour", ID_SRC_COLOUR);
+                addLexemeToken("one_minus_dest_colour", ID_ONE_MINUS_DEST_COLOUR);
+                addLexemeToken("one_minus_src_colour", ID_ONE_MINUS_SRC_COLOUR);
+                addLexemeToken("dest_alpha", ID_DEST_ALPHA);
+                addLexemeToken("src_alpha", ID_SRC_ALPHA);
+                addLexemeToken("one_minus_dest_alpha", ID_ONE_MINUS_DEST_ALPHA);
+                addLexemeToken("one_minus_src_alpha", ID_ONE_MINUS_SRC_ALPHA);
+
+            addLexemeAction("depth_check", &MaterialScriptCompiler::parseDepthCheck);
+            addLexemeAction("depth_write", &MaterialScriptCompiler::parseDepthWrite);
+            addLexemeAction("depth_func", &MaterialScriptCompiler::parseDepthFunc);
+            addLexemeAction("depth_bias", &MaterialScriptCompiler::parseDepthBias);
+                addLexemeToken("always_fail", ID_ALWAYS_FAIL);
+                addLexemeToken("always_pass", ID_ALWAYS_PASS);
+                addLexemeToken("less_equal", ID_LESS_EQUAL);
+                addLexemeToken("less", ID_LESS);
+                addLexemeToken("equal", ID_EQUAL);
+                addLexemeToken("not_equal", ID_NOT_EQUAL);
+                addLexemeToken("greater_equal", ID_GREATER_EQUAL);
+                addLexemeToken("greater", ID_GREATER);
+            addLexemeAction("alpha_rejection", &MaterialScriptCompiler::parseAlphaRejection);
+            addLexemeAction("cull_hardware", &MaterialScriptCompiler::parseCullHardware);
+                addLexemeToken("clockwise", ID_CLOCKWISE);
+                addLexemeToken("anticlockwise", ID_ANTICLOCKWISE);
+            addLexemeAction("cull_software", &MaterialScriptCompiler::parseCullSoftware);
+                addLexemeToken("back", ID_CULL_BACK);
+                addLexemeToken("front", ID_CULL_FRONT);
+            addLexemeAction("lighting", &MaterialScriptCompiler::parseLighting);
+            addLexemeAction("shading", &MaterialScriptCompiler::parseShading);
+                addLexemeTokenAction("flat", ID_FLAT);
+                addLexemeToken("gouraud", ID_GOURAUD);
+                addLexemeToken("phong", ID_PHONG);
+            addLexemeAction("polygon_mode", &MaterialScriptCompiler::parsePolygonMode);
+                addLexemeTokenAction("solid", ID_SOLID);
+                addLexemeToken("wireframe", ID_WIREFRAME);
+                addLexemeToken("points", ID_POINTS);
+            addLexemeAction("fog_override", &MaterialScriptCompiler::parseFogOverride);
+                addLexemeToken("exp", ID_EXP);
+                addLexemeToken("exp2", ID_EXP2);
+            addLexemeAction("colour_write", &MaterialScriptCompiler::parseColourWrite);
+            addLexemeAction("max_lights", &MaterialScriptCompiler::parseMaxLights);
+			addLexemeAction("start_light", &MaterialScriptCompiler::parseStartLight);
+            addLexemeAction("iteration", &MaterialScriptCompiler::parseIteration);
+                addLexemeToken("once", ID_ONCE);
+                addLexemeToken("once_per_light", ID_ONCE_PER_LIGHT);
+                addLexemeToken("per_light", ID_PER_LIGHT);
+				addLexemeToken("per_n_lights", ID_PER_N_LIGHTS);
+                addLexemeToken("directional", ID_DIRECTIONAL);
+                addLexemeToken("spot", ID_SPOT);
+            addLexemeAction("point_size", &MaterialScriptCompiler::parsePointSize);
+            addLexemeAction("point_sprites", &MaterialScriptCompiler::parsePointSprites);
+            addLexemeAction("point_size_attenuation",  &MaterialScriptCompiler::parsePointSizeAttenuation);
+            addLexemeAction("point_size_min", &MaterialScriptCompiler::parsePointSizeMin);
+            addLexemeAction("point_size_max", &MaterialScriptCompiler::parsePointSizeMax);
+
+        // Texture Unit section
+        addLexemeAction("texture_unit", &MaterialScriptCompiler::parseTextureUnit);
+        addLexemeAction("texture_alias", &MaterialScriptCompiler::parseTextureAlias);
+        addLexemeAction("texture", &MaterialScriptCompiler::parseTexture);
+            addLexemeToken("1d", ID_1D);
+            addLexemeToken("2d", ID_2D);
+            addLexemeToken("3d", ID_3D);
+            addLexemeToken("cubic", ID_CUBIC);
+            addLexemeToken("unlimited", ID_UNLIMITED);
+            addLexemeToken("alpha", ID_ALPHA);
+        addLexemeAction("anim_texture", &MaterialScriptCompiler::parseAnimTexture);
+        addLexemeAction("cubic_texture", &MaterialScriptCompiler::parseCubicTexture);
+            addLexemeToken("separateuv", ID_SEPARATE_UV);
+            addLexemeToken("combineduvw", ID_COMBINED_UVW);
+        addLexemeAction("tex_coord_set", &MaterialScriptCompiler::parseTexCoord);
+        addLexemeAction("tex_address_mode", &MaterialScriptCompiler::parseTexAddressMode);
+            addLexemeToken("wrap", ID_WRAP);
+            addLexemeToken("clamp", ID_CLAMP);
+            addLexemeToken("mirror", ID_MIRROR);
+            addLexemeToken("border", ID_BORDER);
+        addLexemeAction("tex_border_colour", &MaterialScriptCompiler::parseTexBorderColour);
+        addLexemeAction("filtering", &MaterialScriptCompiler::parseFiltering);
+            addLexemeToken("bilinear", ID_BILINEAR);
+            addLexemeToken("trilinear", ID_TRILINEAR);
+            addLexemeToken("anisotropic", ID_ANISOTROPIC);
+        addLexemeAction("max_anisotropy", &MaterialScriptCompiler::parseMaxAnisotropy);
+        addLexemeAction("mipmap_bias", &MaterialScriptCompiler::parseMipMapBias);
+        addLexemeAction("colour_op", &MaterialScriptCompiler::parseColourOp);
+            addLexemeToken("replace", ID_REPLACE);
+        addLexemeAction("colour_op_ex", &MaterialScriptCompiler::parseColourOpEx);
+            addLexemeToken("source1", ID_SOURCE1);
+            addLexemeToken("source2", ID_SOURCE2);
+            addLexemeToken("modulate_x2", ID_MODULATE_X2);
+            addLexemeToken("modulate_x4", ID_MODULATE_X4);
+            addLexemeToken("add_signed", ID_ADD_SIGNED);
+            addLexemeToken("add_smooth", ID_ADD_SMOOTH);
+            addLexemeToken("subtract", ID_SUBTRACT);
+            addLexemeToken("blend_diffuse_colour", ID_BLEND_DIFFUSE_COLOUR);
+            addLexemeToken("blend_diffuse_alpha", ID_BLEND_DIFFUSE_ALPHA);
+            addLexemeToken("blend_texture_alpha", ID_BLEND_TEXTURE_ALPHA);
+            addLexemeToken("blend_current_alpha", ID_BLEND_CURRENT_ALPHA);
+            addLexemeToken("blend_manual", ID_BLEND_MANUAL);
+            addLexemeToken("dotproduct", ID_DOTPRODUCT);
+            addLexemeToken("src_current", ID_SRC_CURRENT);
+            addLexemeToken("src_texture", ID_SRC_TEXTURE);
+            addLexemeToken("src_diffuse", ID_SRC_DIFFUSE);
+            addLexemeToken("src_specular", ID_SRC_SPECULAR);
+            addLexemeToken("src_manual", ID_SRC_MANUAL);
+        addLexemeAction("colour_op_multipass_fallback", &MaterialScriptCompiler::parseColourOpMultipassFallback);
+        addLexemeAction("alpha_op_ex", &MaterialScriptCompiler::parseAlphaOpEx);
+        addLexemeAction("env_map", &MaterialScriptCompiler::parseEnvMap);
+            addLexemeToken("spherical", ID_SPHERICAL);
+            addLexemeToken("planar", ID_PLANAR);
+            addLexemeToken("cubic_reflection", ID_CUBIC_REFLECTION);
+            addLexemeToken("cubic_normal", ID_CUBIC_NORMAL);
+        addLexemeAction("scroll", &MaterialScriptCompiler::parseScroll);
+        addLexemeAction("scroll_anim", &MaterialScriptCompiler::parseScrollAnim);
+        addLexemeTokenAction("rotate", ID_ROTATE, &MaterialScriptCompiler::parseRotate);
+        addLexemeAction("rotate_anim", &MaterialScriptCompiler::parseRotateAnim);
+        addLexemeAction("scale", &MaterialScriptCompiler::parseScale);
+        addLexemeAction("wave_xform", &MaterialScriptCompiler::parseWaveXform);
+            addLexemeToken("scroll_x", ID_SCROLL_X);
+            addLexemeToken("scroll_y", ID_SCROLL_Y);
+            addLexemeToken("scale_x", ID_SCALE_X);
+            addLexemeToken("scale_y", ID_SCALE_Y);
+            addLexemeToken("sine", ID_SINE);
+            addLexemeToken("triangle", ID_TRIANGLE);
+            addLexemeToken("square", ID_SQUARE);
+            addLexemeToken("sawtooth", ID_SAWTOOTH);
+            addLexemeToken("inverse_sawtooth", ID_INVERSE_SAWTOOTH);
+        addLexemeAction("transform", &MaterialScriptCompiler::parseTransform);
+        addLexemeAction("binding_type", &MaterialScriptCompiler::parseBindingType);
+		addLexemeAction("content_type", &MaterialScriptCompiler::parseContentType);
+			addLexemeToken("named", ID_NAMED);
+			addLexemeToken("shadow", ID_SHADOW);
+        // GPU program reference
+        addLexemeAction("vertex_program_ref", &MaterialScriptCompiler::parseVertexProgramRef);
+        addLexemeAction("fragment_program_ref", &MaterialScriptCompiler::parseFragmentProgramRef);
+        addLexemeAction("shadow_caster_vertex_program_ref", &MaterialScriptCompiler::parseShadowCasterVertexProgramRef);
+        addLexemeAction("shadow_receiver_vertex_program_ref", &MaterialScriptCompiler::parseShadowReceiverVertexProgramRef);
+        addLexemeAction("shadow_receiver_fragment_program_ref", &MaterialScriptCompiler::parseShadowReceiverFragmentProgramRef);
+
+        // common section
+        addLexemeToken("on", ID_ON);
+        addLexemeToken("off", ID_OFF);
+        addLexemeToken("true", ID_TRUE);
+        addLexemeToken("false", ID_FALSE);
+        addLexemeToken("none", ID_NONE);
+        addLexemeToken("point", ID_POINT);
+        addLexemeToken("linear", ID_LINEAR);
+        addLexemeToken("add", ID_ADD);
+        addLexemeToken("modulate", ID_MODULATE);
+        addLexemeToken("alpha_blend", ID_ALPHA_BLEND);
+        addLexemeToken("one", ID_ONE);
+        addLexemeToken("zero", ID_ZERO);
+        addLexemeToken("vertex", ID_VERTEX);
+        addLexemeToken("fragment", ID_FRAGMENT);
+
+
+    }
+
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::addLexemeTokenAction(const String& lexeme, const size_t token, const MSC_Action action)
+    {
+        size_t newTokenID = addLexemeToken(lexeme, token, action != 0);
+        if (action)
+            mTokenActionMap[newTokenID] = action;
+    }
+
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::executeTokenAction(const size_t tokenID)
+    {
+        TokenActionIterator action = mTokenActionMap.find(tokenID);
+
+        if (action == mTokenActionMap.end())
+        {
+            // BAD command. BAD!
+            logParseError("Unrecognised Material Script command action");
+            return;
+        }
+        else
+        {
+            try
+            {
+                (this->*action->second)();
+            }
+            catch (Exception& ogreException)
+            {
+                if (ogreException.getNumber() == Exception::ERR_DUPLICATE_ITEM)
+                {
+                    // an exception for duplicate item was thrown.
+                    // this means that either a material name or gpu program name conflict exists.
+                    // Since it wasn't trapped at a lower level then re-throw in order to terminate parsing
+                    logParseError("Duplicate Item Exception trapped. Parsing terminated for this material script.");
+                    throw;
+                }
+                else
+                {
+                    // an unknown token found or BNF Grammer rule was not successful
+                    // in finding a valid terminal token to complete the rule expression.
+                    // don't relog the exception but do log the material script being parsed and the line number
+                    logParseError("Exception trapped, attempting to continue parsing");
+                }
+            }
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::logParseError(const String& error)
+    {
+        // log material name only if filename not specified
+        if (mSourceName.empty() && !mScriptContext.material.isNull())
+        {
+            LogManager::getSingleton().logMessage(
+                "Error in material " + mScriptContext.material->getName() +
+                " : " + error);
+        }
+        else
+        {
+            if (!mScriptContext.material.isNull())
+            {
+                LogManager::getSingleton().logMessage(
+                    "Error in material " + mScriptContext.material->getName() +
+                    " at line " + StringConverter::toString(mCurrentLine) +
+                    " of " + mSourceName + ": " + error);
+            }
+            else
+            {
+                LogManager::getSingleton().logMessage(
+                    "Error at line " + StringConverter::toString(mCurrentLine) +
+                    " of " + mSourceName + ": " + error);
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseOpenBrace(void)
+    {
+
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseCloseBrace(void)
+    {
+        switch(mScriptContext.section)
+        {
+        case MSS_NONE:
+            logParseError("Unexpected terminating brace.");
+            break;
+        case MSS_MATERIAL:
+            // End of material
+            // if texture aliases were found, pass them to the material
+            // to update texture names used in Texture unit states
+            if (!mScriptContext.textureAliases.empty())
+            {
+                // request material to update all texture names in TUS's
+                // that use texture aliases in the list
+                mScriptContext.material->applyTextureAliases(mScriptContext.textureAliases);
+            }
+
+            mScriptContext.section = MSS_NONE;
+            mScriptContext.material.setNull();
+            mScriptContext.textureAliases.clear();
+            break;
+        case MSS_TECHNIQUE:
+            // End of technique
+            mScriptContext.section = MSS_MATERIAL;
+            mScriptContext.technique = NULL;
+			mScriptContext.passLev = -1;	//Reset pass level (yes, the pass level)
+            break;
+        case MSS_PASS:
+            // End of pass
+            mScriptContext.section = MSS_TECHNIQUE;
+            mScriptContext.pass = NULL;
+			mScriptContext.stateLev = -1;	//Reset state level (yes, the state level)
+            break;
+        case MSS_TEXTUREUNIT:
+            // End of texture unit
+            mScriptContext.section = MSS_PASS;
+            mScriptContext.textureUnit = NULL;
+            break;
+		case MSS_TEXTURESOURCE:
+			//End texture source section
+			//Finish creating texture here
+
+			if(	ExternalTextureSourceManager::getSingleton().getCurrentPlugIn() != 0)
+            {
+                const String sMaterialName = mScriptContext.material->getName();
+				ExternalTextureSourceManager::getSingleton().getCurrentPlugIn()->
+				createDefinedTexture( sMaterialName, mScriptContext.groupName );
+            }
+			//Revert back to texture unit
+			mScriptContext.section = MSS_TEXTUREUNIT;
+			break;
+        case MSS_PROGRAM_REF:
+            // End of program
+            mScriptContext.section = MSS_PASS;
+            mScriptContext.program.setNull();
+            break;
+        case MSS_PROGRAM:
+			// Program definitions are slightly different, they are deferred
+			// until all the information required is known
+            // End of program
+			finishProgramDefinition();
+            mScriptContext.section = MSS_NONE;
+            delete mScriptContext.programDef;
+            mScriptContext.pendingDefaultParams.clear();
+            mScriptContext.programDef = NULL;
+            break;
+        case MSS_DEFAULT_PARAMETERS:
+            // End of default parameters
+            mScriptContext.section = MSS_PROGRAM;
+            break;
+        };
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseGPUProgram(void)
+    {
+        // update section
+        mScriptContext.section = MSS_PROGRAM;
+
+		// Create new program definition-in-progress
+		mScriptContext.programDef = new MaterialScriptProgramDefinition();
+		mScriptContext.programDef->progType =
+            (getCurrentTokenID() == ID_VERTEX_PROGRAM) ? GPT_VERTEX_PROGRAM : GPT_FRAGMENT_PROGRAM;
+        mScriptContext.programDef->supportsSkeletalAnimation = false;
+		mScriptContext.programDef->supportsMorphAnimation = false;
+		mScriptContext.programDef->supportsPoseAnimation = 0;
+        mScriptContext.programDef->usesVertexTextureFetch = false;
+
+		// Get name and language code
+		// Name, preserve case
+		mScriptContext.programDef->name = getNextTokenLabel();
+		// trim trailing white space only
+		StringUtil::trim(mScriptContext.programDef->name);
+		// language code
+		mScriptContext.programDef->language = getNextTokenLabel();
+		// make sure language is lower case
+		StringUtil::toLowerCase(mScriptContext.programDef->language);
+	}
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseProgramSource(void)
+    {
+        assert(mScriptContext.programDef);
+		mScriptContext.programDef->source = getNextTokenLabel();
+	}
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseProgramSyntax(void)
+    {
+        assert(mScriptContext.programDef);
+		mScriptContext.programDef->syntax = getNextTokenLabel();
+		// make sure language is lower case
+		StringUtil::toLowerCase(mScriptContext.programDef->syntax);
+	}
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseProgramSkeletalAnimation(void)
+    {
+        assert(mScriptContext.programDef);
+        mScriptContext.programDef->supportsSkeletalAnimation = testNextTokenID(ID_TRUE);
+    }
+	//-----------------------------------------------------------------------
+	void MaterialScriptCompiler::parseProgramMorphAnimation(void)
+	{
+        assert(mScriptContext.programDef);
+		mScriptContext.programDef->supportsMorphAnimation = testNextTokenID(ID_TRUE);
+	}
+	//-----------------------------------------------------------------------
+	void MaterialScriptCompiler::parseProgramPoseAnimation(void)
+	{
+        assert(mScriptContext.programDef);
+		mScriptContext.programDef->supportsPoseAnimation = static_cast<ushort>(getNextTokenValue());
+	}
+	//-----------------------------------------------------------------------
+	void MaterialScriptCompiler::parseProgramVertexTextureFetch(void)
+	{
+        assert(mScriptContext.programDef);
+		mScriptContext.programDef->usesVertexTextureFetch = testNextTokenID(ID_TRUE);
+	}
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseProgramCustomParameter(void)
+    {
+        assert(mScriptContext.programDef);
+
+        String command = getNextTokenLabel();
+		StringUtil::toLowerCase(command);
+        String params = getNextTokenLabel();
+        StringUtil::trim(params);
+		mScriptContext.programDef->customParameters.push_back(
+			std::pair<String, String>(command, params));
+	}
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseDefaultParams(void)
+    {
+        mScriptContext.section = MSS_DEFAULT_PARAMETERS;
+    }
+	//-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseMaterial(void)
+    {
+        // check params for reference to parent material to copy from
+        // syntax: material name : parentMaterialName
+        MaterialPtr basematerial;
+
+        String materialName = getNextTokenLabel();
+        StringUtil::trim(materialName);
+        // Create a brand new material
+        const size_t paramCount = getRemainingTokensForAction();
+        if (paramCount == 2)
+        {
+            // this gets the ':' token which we need to consume to get to the label
+            getNextToken();
+            // if a second parameter exists then assume its the name of the base material
+            // that this new material should clone from
+            String parentName = getNextTokenLabel();
+            StringUtil::trim(parentName);
+            // make sure base material exists
+            basematerial = MaterialManager::getSingleton().getByName(parentName);
+            // if it doesn't exist then report error in log and just create a new material
+            if (basematerial.isNull())
+            {
+                logParseError("parent material: " + parentName + " not found for new material:"
+                    + materialName);
+            }
+        }
+
+        /* attempt to create the material.  If the material name is already in use
+           then MaterialManager throws an exception.
+        */
+        try
+        {
+            mScriptContext.material =
+                MaterialManager::getSingleton().create(materialName, mScriptContext.groupName);
+        }
+        catch (Exception& e)
+        {
+            bool exceptionHandled = false;
+
+            if (mScriptContext.allowOverride && (e.getNumber() == Exception::ERR_DUPLICATE_ITEM))
+            {
+                /* the material already exists log a warning message about it being modified by
+                 another material script
+                */
+                mScriptContext.material = MaterialManager::getSingleton().getByName(materialName);
+                if ( !mScriptContext.material.isNull())
+                {
+                    logParseError("material " + materialName +
+                        ", defined in " + mScriptContext.material->getOrigin() +
+                        ", was overwritten by current material being parsed with same name");
+                    // update group ownership since the original material might have been in a different resource group
+                    mScriptContext.material->changeGroupOwnership(mScriptContext.groupName);
+                    exceptionHandled = true;
+                }
+            }
+            if (!exceptionHandled)
+            {
+                logParseError("material " + materialName +
+                        " was previously defined and can not override.\n"
+                        "Material Manager script override was not enabled." );
+
+                throw;
+            }
+        }
+
+        if (!basematerial.isNull())
+        {
+            // copy parent material details to new or pre-existing material
+            basematerial->copyDetailsTo(mScriptContext.material);
+        }
+        else
+        {
+            // Remove pre-created technique from defaults or original material
+            mScriptContext.material->removeAllTechniques();
+        }
+
+		mScriptContext.material->_notifyOrigin(mSourceName);
+
+        // update section
+        mScriptContext.section = MSS_MATERIAL;
+        //Reset all levels since this is the start of the material definition
+        mScriptContext.passLev = -1;
+        mScriptContext.stateLev= -1;
+        mScriptContext.techLev = -1;
+
+    }
+    //-----------------------------------------------------------------------
+    // material Section Actions
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseLodDistances(void)
+    {
+        // iterate over the parameters and parse distances out of them
+        Material::LodDistanceList lodList;
+		while (getRemainingTokensForAction() > 0)
+		{
+            lodList.push_back(getNextTokenValue());
+        }
+
+        mScriptContext.material->setLodLevels(lodList);
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseReceiveShadows(void)
+    {
+        mScriptContext.material->setReceiveShadows(testNextTokenID(ID_ON));
+    }
+	//-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseTransparencyCastsShadows(void)
+	{
+		mScriptContext.material->setTransparencyCastsShadows(testNextTokenID(ID_ON));
+	}
+	//-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseSetTextureAlias(void)
+	{
+	    const String& aliasName = getNextTokenLabel();
+	    const String& textureName = getNextTokenLabel();
+		mScriptContext.textureAliases[aliasName] = textureName;
+	}
+	//-----------------------------------------------------------------------
+	// Technique section Actions
+	//-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseTechnique(void)
+    {
+        String techniqueName;
+        if (getRemainingTokensForAction() > 0)
+            techniqueName = getNextTokenLabel();
+        // if params is not empty then see if the technique name already exists
+        if (!techniqueName.empty() && (mScriptContext.material->getNumTechniques() > 0))
+        {
+            Technique* foundTechnique = mScriptContext.material->getTechnique(techniqueName);
+            if (foundTechnique)
+            {
+                // figure out technique index by iterating through technique container
+                // would be nice if each technique remembered its index
+                int count = 0;
+                Material::TechniqueIterator i = mScriptContext.material->getTechniqueIterator();
+                while(i.hasMoreElements())
+                {
+                    if (foundTechnique == i.peekNext())
+                        break;
+                    i.moveNext();
+                    ++count;
+                }
+
+                mScriptContext.techLev = count;
+            }
+            else
+            {
+                // name was not found so a new technique is needed
+                // position technique level to the end index
+                // a new technique will be created later on
+                mScriptContext.techLev = mScriptContext.material->getNumTechniques();
+            }
+
+        }
+        else
+        {
+            // no name was given in the script so a new technique will be created
+		    // Increase technique level depth
+		    ++mScriptContext.techLev;
+        }
+
+        // Create a new technique if it doesn't already exist
+        if (mScriptContext.material->getNumTechniques() > mScriptContext.techLev)
+        {
+            mScriptContext.technique = mScriptContext.material->getTechnique(mScriptContext.techLev);
+        }
+        else
+        {
+            mScriptContext.technique = mScriptContext.material->createTechnique();
+            if (!techniqueName.empty())
+                mScriptContext.technique->setName(techniqueName);
+        }
+
+        // update section
+        mScriptContext.section = MSS_TECHNIQUE;
+
+    }
+	//-----------------------------------------------------------------------
+	void MaterialScriptCompiler::parseScheme(void)
+	{
+	    assert(mScriptContext.technique);
+		mScriptContext.technique->setSchemeName(getNextTokenLabel());
+	}
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseLodIndex(void)
+    {
+	    assert(mScriptContext.technique);
+        mScriptContext.technique->setLodIndex(static_cast<uint>(getNextTokenValue()));
+    }
+	//-----------------------------------------------------------------------
+	// Pass Section Actions
+	//-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parsePass(void)
+    {
+        String passName;
+        if (getRemainingTokensForAction() > 0)
+            passName = getNextTokenLabel();
+        // if params is not empty then see if the pass name already exists
+        if (!passName.empty() && (mScriptContext.technique->getNumPasses() > 0))
+        {
+            Pass* foundPass = mScriptContext.technique->getPass(passName);
+            if (foundPass)
+            {
+                mScriptContext.passLev = foundPass->getIndex();
+            }
+            else
+            {
+                // name was not found so a new pass is needed
+                // position pass level to the end index
+                // a new pass will be created later on
+                mScriptContext.passLev = mScriptContext.technique->getNumPasses();
+            }
+
+        }
+        else
+        {
+		    //Increase pass level depth
+		    ++mScriptContext.passLev;
+        }
+
+        if (mScriptContext.technique->getNumPasses() > mScriptContext.passLev)
+        {
+            mScriptContext.pass = mScriptContext.technique->getPass(mScriptContext.passLev);
+        }
+        else
+        {
+            // Create a new pass
+            mScriptContext.pass = mScriptContext.technique->createPass();
+            if (!passName.empty())
+                mScriptContext.pass->setName(passName);
+        }
+
+        // update section
+        mScriptContext.section = MSS_PASS;
+    }
+    //-----------------------------------------------------------------------
+    ColourValue MaterialScriptCompiler::_parseColourValue(void)
+    {
+        Real r = getNextTokenValue();
+        Real g = getNextTokenValue();
+        Real b = getNextTokenValue();
+        Real a = getRemainingTokensForAction() == 1 ? getNextTokenValue() : 1.0f;
+        return ColourValue(r, g, b, a);
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseAmbient(void)
+    {
+        // Must be 1, 3 or 4 parameters
+        assert(mScriptContext.pass);
+        const size_t paramCount = getRemainingTokensForAction();
+        if (paramCount == 1) {
+            if(testNextTokenID(ID_VERTEXCOLOUR))
+            {
+                mScriptContext.pass->setVertexColourTracking(mScriptContext.pass->getVertexColourTracking() | TVC_AMBIENT);
+            }
+            else
+            {
+                logParseError("Bad ambient attribute, single parameter flag must be 'vertexcolour'");
+            }
+        }
+        else if (paramCount == 3 || paramCount == 4)
+        {
+            mScriptContext.pass->setAmbient( _parseColourValue() );
+            mScriptContext.pass->setVertexColourTracking(mScriptContext.pass->getVertexColourTracking() & ~TVC_AMBIENT);
+        }
+        else
+        {
+            logParseError("Bad ambient attribute, wrong number of parameters (expected 1, 3 or 4)");
+        }
+    }
+   //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseDiffuse(void)
+    {
+        // Must be 1, 3 or 4 parameters
+        assert(mScriptContext.pass);
+        const size_t paramCount = getRemainingTokensForAction();
+        if (paramCount == 1) {
+            if(testNextTokenID(ID_VERTEXCOLOUR))
+            {
+               mScriptContext.pass->setVertexColourTracking(mScriptContext.pass->getVertexColourTracking() | TVC_DIFFUSE);
+            }
+            else
+            {
+                logParseError("Bad diffuse attribute, single parameter flag must be 'vertexcolour'");
+            }
+        }
+        else if (paramCount == 3 || paramCount == 4)
+        {
+            mScriptContext.pass->setDiffuse( _parseColourValue() );
+            mScriptContext.pass->setVertexColourTracking(mScriptContext.pass->getVertexColourTracking() & ~TVC_DIFFUSE);
+        }
+        else
+        {
+            logParseError("Bad diffuse attribute, wrong number of parameters (expected 1, 3 or 4)");
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseSpecular(void)
+    {
+        // Must be 2, 4 or 5 parameters
+        assert(mScriptContext.pass);
+        const size_t paramCount = getRemainingTokensForAction();
+        if(paramCount == 2)
+        {
+            if(getNextTokenID() == ID_VERTEXCOLOUR)
+            {
+                mScriptContext.pass->setVertexColourTracking(mScriptContext.pass->getVertexColourTracking() | TVC_SPECULAR);
+                mScriptContext.pass->setShininess(getNextTokenValue());
+            }
+            else
+            {
+                logParseError("Bad specular attribute, double parameter statement must be 'vertexcolour <shininess>'");
+            }
+        }
+        else if(paramCount == 4 || paramCount == 5)
+        {
+            Real r = getNextTokenValue();
+            Real g = getNextTokenValue();
+            Real b = getNextTokenValue();
+            Real a = paramCount == 5 ? getNextTokenValue() : 1.0f;
+            mScriptContext.pass->setSpecular(r, g, b, a);
+            mScriptContext.pass->setVertexColourTracking(mScriptContext.pass->getVertexColourTracking() & ~TVC_SPECULAR);
+            mScriptContext.pass->setShininess( getNextTokenValue() );
+        }
+        else
+        {
+            logParseError("Bad specular attribute, wrong number of parameters (expected 2, 4 or 5)");
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseEmissive(void)
+    {
+        // Must be 1, 3 or 4 parameters
+        assert(mScriptContext.pass);
+        const size_t paramCount = getRemainingTokensForAction();
+        if (paramCount == 1) {
+            if(testNextTokenID(ID_VERTEXCOLOUR))
+            {
+               mScriptContext.pass->setVertexColourTracking(mScriptContext.pass->getVertexColourTracking() | TVC_EMISSIVE);
+            }
+            else
+            {
+                logParseError("Bad emissive attribute, single parameter flag must be 'vertexcolour'");
+            }
+        }
+        else if (paramCount == 3 || paramCount == 4)
+        {
+            mScriptContext.pass->setSelfIllumination( _parseColourValue() );
+            mScriptContext.pass->setVertexColourTracking(mScriptContext.pass->getVertexColourTracking() & ~TVC_EMISSIVE);
+        }
+        else
+        {
+            logParseError("Bad emissive attribute, wrong number of parameters (expected 1, 3 or 4)");
+        }
+    }
+    //-----------------------------------------------------------------------
+    SceneBlendFactor MaterialScriptCompiler::convertBlendFactor(void)
+    {
+        switch(getNextTokenID())
+        {
+        case ID_ONE:
+            return SBF_ONE;
+        case ID_ZERO:
+            return SBF_ZERO;
+        case ID_DEST_COLOUR:
+            return SBF_DEST_COLOUR;
+        case ID_SRC_COLOUR:
+            return SBF_SOURCE_COLOUR;
+        case ID_ONE_MINUS_DEST_COLOUR:
+            return SBF_ONE_MINUS_DEST_COLOUR;
+        case ID_ONE_MINUS_SRC_COLOUR:
+            return SBF_ONE_MINUS_SOURCE_COLOUR;
+        case ID_DEST_ALPHA:
+            return SBF_DEST_ALPHA;
+        case ID_SRC_ALPHA:
+            return SBF_SOURCE_ALPHA;
+        case ID_ONE_MINUS_DEST_ALPHA:
+            return SBF_ONE_MINUS_DEST_ALPHA;
+        case ID_ONE_MINUS_SRC_ALPHA:
+            return SBF_ONE_MINUS_SOURCE_ALPHA;
+        default:
+            return SBF_ONE;
+            break;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseSceneBlend(void)
+    {
+        assert(mScriptContext.pass);
+        const size_t paramCount = getRemainingTokensForAction();
+        // Should be 1 or 2 params
+        if (paramCount == 1)
+        {
+            //simple blend types
+            SceneBlendType sbtype = SBT_REPLACE;
+            switch(getNextTokenID())
+            {
+            case ID_ADD:
+                sbtype = SBT_ADD;
+                break;
+            case ID_MODULATE:
+                sbtype = SBT_MODULATE;
+                break;
+			case ID_COLOUR_BLEND:
+				sbtype = SBT_TRANSPARENT_COLOUR;
+				break;
+            case ID_ALPHA_BLEND:
+                sbtype = SBT_TRANSPARENT_ALPHA;
+                break;
+            default:
+                break;
+            }
+            mScriptContext.pass->setSceneBlending(sbtype);
+
+        }
+        else if (paramCount == 2)
+        {
+            const SceneBlendFactor src = convertBlendFactor();
+            const SceneBlendFactor dest = convertBlendFactor();
+            mScriptContext.pass->setSceneBlending(src,dest);
+        }
+        else
+        {
+            logParseError(
+                "Bad scene_blend attribute, wrong number of parameters (expected 1 or 2)");
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseDepthCheck(void)
+    {
+        assert(mScriptContext.pass);
+        mScriptContext.pass->setDepthCheckEnabled(testNextTokenID(ID_ON));
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseDepthWrite(void)
+    {
+        assert(mScriptContext.pass);
+        mScriptContext.pass->setDepthWriteEnabled(testNextTokenID(ID_ON));
+    }
+    //-----------------------------------------------------------------------
+    CompareFunction MaterialScriptCompiler::convertCompareFunction(void)
+    {
+        switch (getNextTokenID())
+        {
+        case ID_ALWAYS_FAIL:
+            return CMPF_ALWAYS_FAIL;
+        case ID_ALWAYS_PASS:
+            return CMPF_ALWAYS_PASS;
+        case ID_LESS:
+            return CMPF_LESS;
+        case ID_LESS_EQUAL:
+            return CMPF_LESS_EQUAL;
+        case ID_EQUAL:
+            return CMPF_EQUAL;
+        case ID_NOT_EQUAL:
+            return CMPF_NOT_EQUAL;
+        case ID_GREATER_EQUAL:
+            return CMPF_GREATER_EQUAL;
+        case ID_GREATER:
+            return CMPF_GREATER;
+        default:
+            return CMPF_LESS_EQUAL;
+            break;
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseDepthFunc(void)
+    {
+        assert(mScriptContext.pass);
+        mScriptContext.pass->setDepthFunction(convertCompareFunction());
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseDepthBias(void)
+    {
+        assert(mScriptContext.pass);
+		float constantBias = static_cast<float>(getNextTokenValue());
+		float slopeScaleBias = 0.0f;
+		if (getRemainingTokensForAction() == 1)
+		{
+			slopeScaleBias = static_cast<float>(getNextTokenValue());
+		}
+
+        mScriptContext.pass->setDepthBias(constantBias, slopeScaleBias);
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseAlphaRejection(void)
+    {
+        assert(mScriptContext.pass);
+        const CompareFunction cmp = convertCompareFunction();
+        mScriptContext.pass->setAlphaRejectSettings(cmp, static_cast<unsigned char>(getNextTokenValue()));
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseCullHardware(void)
+    {
+        assert(mScriptContext.pass);
+        switch (getNextTokenID())
+        {
+        case ID_NONE:
+            mScriptContext.pass->setCullingMode(CULL_NONE);
+            break;
+        case ID_ANTICLOCKWISE:
+            mScriptContext.pass->setCullingMode(CULL_ANTICLOCKWISE);
+            break;
+        case ID_CLOCKWISE:
+            mScriptContext.pass->setCullingMode(CULL_CLOCKWISE);
+            break;
+        default:
+            break;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseCullSoftware(void)
+    {
+        assert(mScriptContext.pass);
+        switch (getNextTokenID())
+        {
+        case ID_NONE:
+            mScriptContext.pass->setManualCullingMode(MANUAL_CULL_NONE);
+            break;
+        case ID_CULL_BACK:
+            mScriptContext.pass->setManualCullingMode(MANUAL_CULL_BACK);
+            break;
+        case ID_CULL_FRONT:
+            mScriptContext.pass->setManualCullingMode(MANUAL_CULL_FRONT);
+            break;
+        default:
+            break;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseLighting(void)
+    {
+        assert(mScriptContext.pass);
+        mScriptContext.pass->setLightingEnabled(testNextTokenID(ID_ON));
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseShading(void)
+    {
+        assert(mScriptContext.pass);
+        switch (getNextTokenID())
+        {
+        case ID_FLAT:
+            mScriptContext.pass->setShadingMode(SO_FLAT);
+            break;
+        case ID_GOURAUD:
+            mScriptContext.pass->setShadingMode(SO_GOURAUD);
+            break;
+        case ID_PHONG:
+            mScriptContext.pass->setShadingMode(SO_PHONG);
+            break;
+        default:
+            break;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parsePolygonMode(void)
+    {
+        assert(mScriptContext.pass);
+        switch (getNextTokenID())
+        {
+        case ID_SOLID:
+            mScriptContext.pass->setPolygonMode(PM_SOLID);
+            break;
+        case ID_WIREFRAME:
+            mScriptContext.pass->setPolygonMode(PM_WIREFRAME);
+            break;
+        case ID_POINTS:
+            mScriptContext.pass->setPolygonMode(PM_POINTS);
+            break;
+        default:
+            break;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseFogOverride(void)
+    {
+        assert(mScriptContext.pass);
+        if (getNextTokenID() == ID_TRUE)
+        {
+            // if true, we need to see if they supplied all arguments, or just the 1... if just the one,
+            // Assume they want to disable the default fog from effecting this material.
+            const size_t paramCount = getRemainingTokensForAction();
+            if( paramCount == 7 )
+            {
+                FogMode fogtype;
+                switch (getNextTokenID())
+                {
+                case ID_LINEAR:
+                    fogtype = FOG_LINEAR;
+                case ID_EXP:
+                    fogtype = FOG_EXP;
+                case ID_EXP2:
+                    fogtype = FOG_EXP2;
+                case ID_NONE:
+                default:
+                    fogtype = FOG_NONE;
+                    break;
+                }
+
+                const Real red = getNextTokenValue();
+                const Real green = getNextTokenValue();
+                const Real blue = getNextTokenValue();
+                const Real density = getNextTokenValue();
+                const Real start = getNextTokenValue();
+                const Real end = getNextTokenValue();
+
+                mScriptContext.pass->setFog(
+                    true,
+                    fogtype,
+                    ColourValue(red, green, blue),
+                    density, start, end
+                    );
+            }
+            else
+            {
+                mScriptContext.pass->setFog(true);
+            }
+        }
+        else
+            mScriptContext.pass->setFog(false);
+
+    }
+   //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseColourWrite(void)
+    {
+        assert(mScriptContext.pass);
+        mScriptContext.pass->setColourWriteEnabled(testNextTokenID(ID_ON));
+    }
+     //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseMaxLights(void)
+    {
+        assert(mScriptContext.pass);
+		mScriptContext.pass->setMaxSimultaneousLights(static_cast<int>(getNextTokenValue()));
+    }
+	void MaterialScriptCompiler::parseStartLight(void)
+	{
+		assert(mScriptContext.pass);
+		mScriptContext.pass->setStartLight(static_cast<int>(getNextTokenValue()));
+	}
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseIterationLightTypes(void)
+    {
+        assert(mScriptContext.pass);
+        // Parse light type
+        switch(getNextTokenID())
+        {
+        case ID_DIRECTIONAL:
+            mScriptContext.pass->setIteratePerLight(true, true, Light::LT_DIRECTIONAL);
+            break;
+        case ID_POINT:
+            mScriptContext.pass->setIteratePerLight(true, true, Light::LT_POINT);
+            break;
+        case ID_SPOT:
+            mScriptContext.pass->setIteratePerLight(true, true, Light::LT_SPOTLIGHT);
+            break;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseIteration(void)
+    {
+        assert(mScriptContext.pass);
+        // we could have more than one parameter
+        /** combinations could be:
+            iteration once
+            iteration once_per_light [light type]
+            iteration <number>
+            iteration <number> [per_light] [light type]
+			iteration <number> [per_n_lights] <number> [light type]
+        */
+        if (testNextTokenID(ID_ONCE))
+            mScriptContext.pass->setIteratePerLight(false, false);
+        else if (testNextTokenID(ID_ONCE_PER_LIGHT))
+        {
+            getNextToken();
+            if (getRemainingTokensForAction() == 1)
+            {
+                parseIterationLightTypes();
+            }
+            else
+            {
+                mScriptContext.pass->setIteratePerLight(true, false);
+            }
+
+        }
+        else // could be using form: <number> [per_light] [light type]
+        {
+            uint passIterationCount = static_cast<uint>(getNextTokenValue());
+            if (passIterationCount > 0)
+            {
+                mScriptContext.pass->setPassIterationCount(passIterationCount);
+                if (getRemainingTokensForAction() > 1)
+                {
+                    const size_t tokenID = getNextTokenID();
+                    if (tokenID == ID_PER_LIGHT)
+                    {
+                        if (getRemainingTokensForAction() == 1)
+                        {
+                            parseIterationLightTypes();
+                        }
+                        else
+                        {
+                            mScriptContext.pass->setIteratePerLight(true, false);
+                        }
+                    }
+					else if (tokenID == ID_PER_N_LIGHTS)
+					{
+						// Number of lights per iteration
+						mScriptContext.pass->setLightCountPerIteration(static_cast<short unsigned int>(getNextTokenValue()));
+						if (getRemainingTokensForAction() == 1)
+						{
+							parseIterationLightTypes();
+						}
+						else
+						{
+							mScriptContext.pass->setIteratePerLight(true, false);
+						}
+					}
+                    else
+                        logParseError(
+                            "Bad iteration attribute, valid parameters are <number> [per_light|per_n_lights <num_lights>] [light type].");
+                }
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parsePointSize(void)
+    {
+        mScriptContext.pass->setPointSize(getNextTokenValue());
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parsePointSprites(void)
+	{
+        assert(mScriptContext.pass);
+        mScriptContext.pass->setPointSpritesEnabled(testNextTokenID(ID_ON));
+	}
+    //-----------------------------------------------------------------------
+	void MaterialScriptCompiler::parsePointSizeMin(void)
+	{
+        assert(mScriptContext.pass);
+        mScriptContext.pass->setPointMinSize(getNextTokenValue());
+	}
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parsePointSizeMax(void)
+	{
+        assert(mScriptContext.pass);
+        mScriptContext.pass->setPointMaxSize(getNextTokenValue());
+	}
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parsePointSizeAttenuation(void)
+	{
+        assert(mScriptContext.pass);
+        const size_t paramCount = getRemainingTokensForAction();
+        if (paramCount != 1 && paramCount != 4)
+        {
+            logParseError("Bad point_size_attenuation attribute, wrong number of parameters (expected 1 or 4)");
+            return;
+        }
+        switch (getNextTokenID())
+        {
+        case ID_ON:
+			if (paramCount == 4)
+			{
+				Real constant = getNextTokenValue();
+				Real linear = getNextTokenValue();
+				Real quadric = getNextTokenValue();
+	            mScriptContext.pass->setPointAttenuation(true, constant, linear, quadric);
+			}
+			else
+			{
+				mScriptContext.pass->setPointAttenuation(true);
+			}
+
+            break;
+        case ID_OFF:
+            mScriptContext.pass->setPointAttenuation(false);
+            break;
+        default:
+            logParseError("Bad point_size_attenuation attribute, valid values are 'on' or 'off'.");
+        }
+	}
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseTextureCustomParameter(void)
+    {
+		// This params object does not have the command stripped
+		// Split only up to first delimiter, program deals with the rest
+
+		if (getRemainingTokensForAction() != 2)
+		{
+            logParseError("Invalid texture parameter entry; "
+				"there must be a parameter name and at least one value.");
+		}
+
+		else if( ExternalTextureSourceManager::getSingleton().getCurrentPlugIn() != 0 )
+        {
+			////First is command, next could be a string with one or more values
+            const String& param1 = getNextTokenLabel();
+            const String& param2 = getNextTokenLabel();
+			ExternalTextureSourceManager::getSingleton().getCurrentPlugIn()->setParameter( param1, param2 );
+        }
+	}
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseTextureUnit(void)
+    {
+        String tusName;
+        if (getRemainingTokensForAction() > 0)
+            tusName = getNextTokenLabel();
+        // if params is a name then see if that texture unit exists
+        // if not then log the warning and just move on to the next TU from current
+        if (!tusName.empty() && (mScriptContext.pass->getNumTextureUnitStates() > 0))
+        {
+            // specifying a TUS name in the script for a TU means that a specific TU is being requested
+            // try to get the specific TU
+            // if the index requested is not valid, just creat a new TU
+            // find the TUS with name
+            TextureUnitState * foundTUS = mScriptContext.pass->getTextureUnitState(tusName);
+            if (foundTUS)
+            {
+                mScriptContext.stateLev = mScriptContext.pass->getTextureUnitStateIndex(foundTUS);
+            }
+            else
+            {
+                // name was not found so a new TUS is needed
+                // position TUS level to the end index
+                // a new TUS will be created later on
+                mScriptContext.stateLev = static_cast<uint>(mScriptContext.pass->getNumTextureUnitStates());
+            }
+        }
+        else
+        {
+		    //Increase Texture Unit State level depth
+		    ++mScriptContext.stateLev;
+        }
+
+        if (mScriptContext.pass->getNumTextureUnitStates() > static_cast<size_t>(mScriptContext.stateLev))
+        {
+            mScriptContext.textureUnit = mScriptContext.pass->getTextureUnitState(mScriptContext.stateLev);
+        }
+        else
+        {
+            // Create a new texture unit
+            mScriptContext.textureUnit = mScriptContext.pass->createTextureUnitState();
+            if (!tusName.empty())
+                mScriptContext.textureUnit->setName(tusName);
+        }
+        // update section
+        mScriptContext.section = MSS_TEXTUREUNIT;
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseTextureAlias(void)
+    {
+        assert(mScriptContext.textureUnit);
+        mScriptContext.textureUnit->setTextureNameAlias(getNextTokenLabel());
+    }
+    //-----------------------------------------------------------------------
+    // Texture layer attributes
+    void MaterialScriptCompiler::parseTexture(void)
+    {
+        assert(mScriptContext.textureUnit);
+        TextureType tt = TEX_TYPE_2D;
+		int mipmaps = MIP_DEFAULT; // When passed to TextureManager::load, this means default to default number of mipmaps
+        bool isAlpha = false;
+        PixelFormat desiredFormat = PF_UNKNOWN;
+        const String& textureName = getNextTokenLabel();
+
+		while (getRemainingTokensForAction() > 0)
+		{
+            switch(getNextTokenID())
+            {
+            case ID_1D:
+                tt = TEX_TYPE_1D;
+                break;
+            case ID_2D:
+                tt = TEX_TYPE_2D;
+                break;
+            case ID_3D:
+                tt = TEX_TYPE_3D;
+                break;
+            case ID_CUBIC:
+                tt = TEX_TYPE_CUBE_MAP;
+                break;
+            case ID_UNLIMITED:
+				mipmaps = MIP_UNLIMITED;
+                break;
+            case ID_ALPHA:
+                isAlpha = true;
+                break;
+            case _value_:
+                replaceToken();
+                mipmaps = static_cast<int>(getNextTokenValue());
+                break;
+            default:
+                desiredFormat = PixelUtil::getFormatFromName(getCurrentTokenLexeme(), true);
+                break;
+            }
+		}
+        mScriptContext.textureUnit->setTextureName(textureName, tt);
+        mScriptContext.textureUnit->setNumMipmaps(mipmaps);
+        mScriptContext.textureUnit->setIsAlpha(isAlpha);
+        mScriptContext.textureUnit->setDesiredFormat(desiredFormat);
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseAnimTexture(void)
+    {
+        assert(mScriptContext.textureUnit);
+        StringVector vecparams;
+        // first token will be a label
+        vecparams.push_back(getNextTokenLabel());
+        // Determine which form it is
+        // if next token is a value then no more labels to be processed
+        if (testNextTokenID(_value_))
+        {
+            // First form using base name & number of frames
+            unsigned int frameCount = static_cast<unsigned int>(getNextTokenValue());
+            mScriptContext.textureUnit->setAnimatedTextureName(
+                vecparams[0],
+                frameCount,
+                getNextTokenValue());
+        }
+        else
+        {
+            unsigned int numParams = 1;
+            while (getRemainingTokensForAction() > 1)
+            {
+                vecparams.push_back(getNextTokenLabel());
+                ++numParams;
+            }
+            // the last label should be a number so convert string label to number
+            // Second form using individual names
+            mScriptContext.textureUnit->setAnimatedTextureName(
+                (String*)&vecparams[0],
+                numParams,
+                StringConverter::parseReal(getNextTokenLabel()));
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseCubicTexture(void)
+    {
+        assert(mScriptContext.textureUnit);
+        StringVector vecparams;
+
+        // first token will be a label
+        vecparams.push_back(getNextTokenLabel());
+        // Determine which form it is
+        // if next token is a label then 5 more labels to be processed
+        if (testNextTokenID(_character_))
+        {
+            // get next five texture names
+            for (int i = 0; i < 5; ++i)
+                vecparams.push_back(getNextTokenLabel());
+        }
+
+        bool useUVW = testNextTokenID(ID_COMBINED_UVW);
+
+        if (vecparams.size() == 1)
+        {
+            mScriptContext.textureUnit->setCubicTextureName(vecparams[0], useUVW);
+        }
+        else
+        {
+            // Second form using individual names
+            // Can use vecparams[0] as array start point
+            mScriptContext.textureUnit->setCubicTextureName((String*)&vecparams[0], useUVW);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseTexCoord(void)
+    {
+        assert(mScriptContext.textureUnit);
+        mScriptContext.textureUnit->setTextureCoordSet(
+            static_cast<unsigned int>(getNextTokenValue()));
+    }
+    //-----------------------------------------------------------------------
+	TextureUnitState::TextureAddressingMode MaterialScriptCompiler::convTexAddressMode(void)
+	{
+	    switch (getNextTokenID())
+	    {
+		case ID_WRAP:
+			return TextureUnitState::TAM_WRAP;
+		case ID_CLAMP:
+			return TextureUnitState::TAM_CLAMP;
+		case ID_MIRROR:
+			return TextureUnitState::TAM_MIRROR;
+		case ID_BORDER:
+			return TextureUnitState::TAM_BORDER;
+		default:
+            return TextureUnitState::TAM_WRAP;
+	    }
+	}
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseTexAddressMode(void)
+    {
+        assert(mScriptContext.textureUnit);
+        const size_t paramCount = getRemainingTokensForAction();
+
+		if (paramCount == 1)
+		{
+			// Single-parameter option
+			mScriptContext.textureUnit->setTextureAddressingMode(
+				convTexAddressMode());
+		}
+		else
+		{
+			// 2-3 parameter option
+			TextureUnitState::UVWAddressingMode uvw;
+			uvw.u = convTexAddressMode();
+			uvw.v = convTexAddressMode();
+
+			if (paramCount == 3)
+			{
+				// w
+				uvw.w = convTexAddressMode();
+			}
+			else
+			{
+				uvw.w = TextureUnitState::TAM_WRAP;
+			}
+			mScriptContext.textureUnit->setTextureAddressingMode(uvw);
+		}
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseTexBorderColour(void)
+    {
+        assert(mScriptContext.textureUnit);
+        mScriptContext.textureUnit->setTextureBorderColour( _parseColourValue() );
+    }
+    //-----------------------------------------------------------------------
+    FilterOptions MaterialScriptCompiler::convertFiltering()
+    {
+        switch (getNextTokenID())
+        {
+        case ID_NONE:
+            return FO_NONE;
+        case ID_POINT:
+            return FO_POINT;
+        case ID_LINEAR:
+            return FO_LINEAR;
+        case ID_ANISOTROPIC:
+            return FO_ANISOTROPIC;
+        default:
+            return FO_POINT;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseFiltering(void)
+    {
+        assert(mScriptContext.textureUnit);
+        // Must be 1 or 3 parameters
+        const size_t paramCount = getRemainingTokensForAction();
+        if (paramCount == 1)
+        {
+            // Simple format
+            switch (getNextTokenID())
+            {
+            case ID_BILINEAR:
+                mScriptContext.textureUnit->setTextureFiltering(TFO_BILINEAR);
+                break;
+            case ID_TRILINEAR:
+                mScriptContext.textureUnit->setTextureFiltering(TFO_TRILINEAR);
+                break;
+            case ID_ANISOTROPIC:
+                mScriptContext.textureUnit->setTextureFiltering(TFO_ANISOTROPIC);
+                break;
+            case ID_NONE:
+                mScriptContext.textureUnit->setTextureFiltering(TFO_NONE);
+                break;
+            }
+        }
+        else
+        {
+            // Complex format
+            const FilterOptions minFO = convertFiltering();
+            const FilterOptions magFO = convertFiltering();
+            const FilterOptions mipFO = convertFiltering();
+            mScriptContext.textureUnit->setTextureFiltering(minFO, magFO, mipFO);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseMaxAnisotropy(void)
+    {
+        assert(mScriptContext.textureUnit);
+        mScriptContext.textureUnit->setTextureAnisotropy(
+            static_cast<unsigned int>(getNextTokenValue()));
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseMipMapBias(void)
+    {
+        assert(mScriptContext.textureUnit);
+        mScriptContext.textureUnit->setTextureMipmapBias(getNextTokenValue());
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseColourOp(void)
+    {
+        assert(mScriptContext.textureUnit);
+        switch (getNextTokenID())
+        {
+        case ID_REPLACE:
+            mScriptContext.textureUnit->setColourOperation(LBO_REPLACE);
+            break;
+        case ID_ADD:
+            mScriptContext.textureUnit->setColourOperation(LBO_ADD);
+            break;
+        case ID_MODULATE:
+            mScriptContext.textureUnit->setColourOperation(LBO_MODULATE);
+            break;
+        case ID_ALPHA_BLEND:
+            mScriptContext.textureUnit->setColourOperation(LBO_ALPHA_BLEND);
+            break;
+        }
+    }
+    //-----------------------------------------------------------------------
+    LayerBlendOperationEx MaterialScriptCompiler::convertBlendOpEx(void)
+    {
+        switch(getNextTokenID())
+        {
+        case ID_SOURCE1:
+            return LBX_SOURCE1;
+        case ID_SOURCE2:
+            return LBX_SOURCE2;
+        case ID_MODULATE:
+            return LBX_MODULATE;
+        case ID_MODULATE_X2:
+            return LBX_MODULATE_X2;
+        case ID_MODULATE_X4:
+            return LBX_MODULATE_X4;
+        case ID_ADD:
+            return LBX_ADD;
+        case ID_ADD_SIGNED:
+            return LBX_ADD_SIGNED;
+        case ID_ADD_SMOOTH:
+            return LBX_ADD_SMOOTH;
+        case ID_SUBTRACT:
+            return LBX_SUBTRACT;
+        case ID_BLEND_DIFFUSE_COLOUR:
+            return LBX_BLEND_DIFFUSE_COLOUR;
+        case ID_BLEND_DIFFUSE_ALPHA:
+            return LBX_BLEND_DIFFUSE_ALPHA;
+        case ID_BLEND_TEXTURE_ALPHA:
+            return LBX_BLEND_TEXTURE_ALPHA;
+        case ID_BLEND_CURRENT_ALPHA:
+            return LBX_BLEND_CURRENT_ALPHA;
+        case ID_BLEND_MANUAL:
+            return LBX_BLEND_MANUAL;
+        case ID_DOTPRODUCT:
+            return LBX_DOTPRODUCT;
+        default:
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Invalid blend function", "convertBlendOpEx");
+        }
+    }
+    //-----------------------------------------------------------------------
+    LayerBlendSource MaterialScriptCompiler::convertBlendSource(void)
+    {
+        switch(getNextTokenID())
+        {
+        case ID_SRC_CURRENT:
+            return LBS_CURRENT;
+        case ID_SRC_TEXTURE:
+            return LBS_TEXTURE;
+        case ID_SRC_DIFFUSE:
+            return LBS_DIFFUSE;
+        case ID_SRC_SPECULAR:
+            return LBS_SPECULAR;
+        case ID_SRC_MANUAL:
+            return LBS_MANUAL;
+        default:
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Invalid blend source", "convertBlendSource");
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseColourOpEx(void)
+    {
+
+        assert(mScriptContext.textureUnit);
+
+        LayerBlendOperationEx op;
+        LayerBlendSource src1, src2;
+        Real manual = 0.0;
+        ColourValue colSrc1 = ColourValue::White;
+        ColourValue colSrc2 = ColourValue::White;
+
+        try {
+            op = convertBlendOpEx();
+            src1 = convertBlendSource();
+            src2 = convertBlendSource();
+
+            if (op == LBX_BLEND_MANUAL)
+                manual = getNextTokenValue();
+
+            if (src1 == LBS_MANUAL)
+                colSrc1 = _parseColourValue();
+
+            if (src2 == LBS_MANUAL)
+                colSrc2 = _parseColourValue();
+        }
+        catch (Exception& e)
+        {
+            logParseError("Bad colour_op_ex attribute, " + e.getDescription());
+            return;
+        }
+
+        mScriptContext.textureUnit->setColourOperationEx(op, src1, src2, colSrc1, colSrc2, manual);
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseColourOpMultipassFallback(void)
+    {
+        assert(mScriptContext.textureUnit);
+
+        SceneBlendFactor src = convertBlendFactor();
+        SceneBlendFactor dest = convertBlendFactor();
+        mScriptContext.textureUnit->setColourOpMultipassFallback(src,dest);
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseAlphaOpEx(void)
+    {
+        assert(mScriptContext.textureUnit);
+
+        LayerBlendOperationEx op;
+        LayerBlendSource src1, src2;
+        Real manual = 0.0;
+        Real arg1 = 1.0, arg2 = 1.0;
+
+        try {
+            op = convertBlendOpEx();
+            src1 = convertBlendSource();
+            src2 = convertBlendSource();
+
+            if (op == LBX_BLEND_MANUAL)
+                manual = getNextTokenValue();
+
+            if (src1 == LBS_MANUAL)
+                arg1 = getNextTokenValue();
+
+            if (src2 == LBS_MANUAL)
+                arg2 = getNextTokenValue();
+        }
+        catch (Exception& e)
+        {
+            logParseError("Bad alpha_op_ex attribute, " + e.getDescription());
+            return;
+        }
+
+        mScriptContext.textureUnit->setAlphaOperation(op, src1, src2, arg1, arg2, manual);
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseEnvMap(void)
+    {
+        assert(mScriptContext.textureUnit);
+
+        switch (getNextTokenID())
+        {
+        case ID_OFF:
+            mScriptContext.textureUnit->setEnvironmentMap(false);
+            break;
+        case ID_SPHERICAL:
+            mScriptContext.textureUnit->setEnvironmentMap(true, TextureUnitState::ENV_CURVED);
+            break;
+        case ID_PLANAR:
+            mScriptContext.textureUnit->setEnvironmentMap(true, TextureUnitState::ENV_PLANAR);
+            break;
+        case ID_CUBIC_REFLECTION:
+            mScriptContext.textureUnit->setEnvironmentMap(true, TextureUnitState::ENV_REFLECTION);
+            break;
+        case ID_CUBIC_NORMAL:
+            mScriptContext.textureUnit->setEnvironmentMap(true, TextureUnitState::ENV_NORMAL);
+            break;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseScroll(void)
+    {
+        assert(mScriptContext.textureUnit);
+
+        const Real x = getNextTokenValue();
+        const Real y = getNextTokenValue();
+
+        mScriptContext.textureUnit->setTextureScroll(x, y);
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseScrollAnim(void)
+    {
+        assert(mScriptContext.textureUnit);
+
+        const Real xspeed = getNextTokenValue();
+        const Real yspeed = getNextTokenValue();
+
+        mScriptContext.textureUnit->setScrollAnimation(xspeed, yspeed);
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseRotate(void)
+    {
+        assert(mScriptContext.textureUnit);
+        mScriptContext.textureUnit->setTextureRotate(Angle(getNextTokenValue()));
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseRotateAnim(void)
+    {
+        assert(mScriptContext.textureUnit);
+        mScriptContext.textureUnit->setRotateAnimation(getNextTokenValue());
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseScale(void)
+    {
+        assert(mScriptContext.textureUnit);
+        const Real xscale = getNextTokenValue();
+        const Real yscale = getNextTokenValue();
+        mScriptContext.textureUnit->setTextureScale(xscale, yscale);
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseWaveXform(void)
+    {
+
+        assert(mScriptContext.textureUnit);
+
+        TextureUnitState::TextureTransformType ttype;
+        WaveformType waveType;
+        // Check transform type
+        switch (getNextTokenID())
+        {
+		default:
+        case ID_SCROLL_X:
+            ttype = TextureUnitState::TT_TRANSLATE_U;
+            break;
+        case ID_SCROLL_Y:
+            ttype = TextureUnitState::TT_TRANSLATE_V;
+            break;
+        case ID_ROTATE:
+            ttype = TextureUnitState::TT_ROTATE;
+            break;
+        case ID_SCALE_X:
+            ttype = TextureUnitState::TT_SCALE_U;
+            break;
+        case ID_SCALE_Y:
+            ttype = TextureUnitState::TT_SCALE_V;
+            break;
+        }
+        // Check wave type
+        switch (getNextTokenID())
+        {
+		default:
+        case ID_SINE:
+            waveType = WFT_SINE;
+            break;
+        case ID_TRIANGLE:
+            waveType = WFT_TRIANGLE;
+            break;
+        case ID_SQUARE:
+            waveType = WFT_SQUARE;
+            break;
+        case ID_SAWTOOTH:
+            waveType = WFT_SAWTOOTH;
+            break;
+        case ID_INVERSE_SAWTOOTH:
+            waveType = WFT_INVERSE_SAWTOOTH;
+            break;
+        }
+
+        const Real base = getNextTokenValue();
+        const Real frequency = getNextTokenValue();
+        const Real phase = getNextTokenValue();
+        const Real amplitude = getNextTokenValue();
+
+        mScriptContext.textureUnit->setTransformAnimation(
+            ttype,
+            waveType,
+            base,
+            frequency,
+            phase,
+            amplitude );
+    }
+	//-----------------------------------------------------------------------
+	void MaterialScriptCompiler::parseTransform(void)
+	{
+        assert(mScriptContext.textureUnit);
+
+        Real matrixArray[16];
+
+        for (size_t i = 0; i < 16; ++i)
+        {
+            matrixArray[i] = getNextTokenValue();
+        }
+
+		Matrix4 xform(
+			matrixArray[0],
+			matrixArray[1],
+			matrixArray[2],
+			matrixArray[3],
+			matrixArray[4],
+			matrixArray[5],
+			matrixArray[6],
+			matrixArray[7],
+			matrixArray[8],
+			matrixArray[9],
+			matrixArray[10],
+			matrixArray[11],
+			matrixArray[12],
+			matrixArray[13],
+			matrixArray[14],
+			matrixArray[15]);
+
+		mScriptContext.textureUnit->setTextureTransform(xform);
+	}
+	//-----------------------------------------------------------------------
+	void MaterialScriptCompiler::parseBindingType(void)
+	{
+        assert(mScriptContext.textureUnit);
+        switch (getNextTokenID())
+        {
+        case ID_VERTEX:
+            mScriptContext.textureUnit->setBindingType(TextureUnitState::BT_VERTEX);
+            break;
+        case ID_FRAGMENT:
+            mScriptContext.textureUnit->setBindingType(TextureUnitState::BT_FRAGMENT);
+            break;
+        }
+    }
+	//-----------------------------------------------------------------------
+	void MaterialScriptCompiler::parseContentType(void)
+	{
+		assert(mScriptContext.textureUnit);
+		switch (getNextTokenID())
+		{
+		case ID_NAMED:
+			mScriptContext.textureUnit->setContentType(TextureUnitState::CONTENT_NAMED);
+			break;
+		case ID_SHADOW:
+			mScriptContext.textureUnit->setContentType(TextureUnitState::CONTENT_SHADOW);
+			break;
+		}
+	}
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseVertexProgramRef(void)
+    {
+        assert(mScriptContext.pass);
+        // update section
+        mScriptContext.section = MSS_PROGRAM_REF;
+        String name;
+
+        // get the name of the program definition if it was set
+        if (getRemainingTokensForAction() == 1)
+        {
+            name = getNextTokenLabel();
+            StringUtil::trim(name);
+        }
+
+        // check if pass has a vertex program already
+        if (mScriptContext.pass->hasVertexProgram())
+        {
+            // if existing pass vertex program has same name as params
+            // or params is empty then use current vertex program
+            if (name.empty() || (mScriptContext.pass->getVertexProgramName() == name))
+            {
+                mScriptContext.program = mScriptContext.pass->getVertexProgram();
+            }
+        }
+
+        // if context.program was not set then try to get the vertex program using the name
+        // passed in params
+        if (mScriptContext.program.isNull())
+        {
+            mScriptContext.program = GpuProgramManager::getSingleton().getByName(name);
+            if (mScriptContext.program.isNull())
+            {
+                // Unknown program
+                logParseError("Invalid vertex_program_ref entry - vertex program "
+                    + name + " has not been defined.");
+                return;
+            }
+
+            // Set the vertex program for this pass
+            mScriptContext.pass->setVertexProgram(name);
+        }
+
+        mScriptContext.isProgramShadowCaster = false;
+        mScriptContext.isVertexProgramShadowReceiver = false;
+        mScriptContext.isFragmentProgramShadowReceiver = false;
+
+        // Create params? Skip this if program is not supported
+        if (mScriptContext.program->isSupported())
+        {
+            mScriptContext.programParams = mScriptContext.pass->getVertexProgramParameters();
+			mScriptContext.numAnimationParametrics = 0;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseShadowCasterVertexProgramRef(void)
+    {
+        assert(mScriptContext.pass);
+        // update section
+        mScriptContext.section = MSS_PROGRAM_REF;
+        String name;
+
+        // get the name of the program definition if it was set
+        if (getRemainingTokensForAction() == 1)
+        {
+            name = getNextTokenLabel();
+            StringUtil::trim(name);
+        }
+
+        // check if pass has a shadow caster vertex program already
+        if (mScriptContext.pass->hasShadowCasterVertexProgram())
+        {
+            // if existing pass vertex program has same name as params
+            // or params is empty then use current vertex program
+            if (name.empty() || (mScriptContext.pass->getShadowCasterVertexProgramName() == name))
+            {
+                mScriptContext.program = mScriptContext.pass->getShadowCasterVertexProgram();
+            }
+        }
+
+        // if context.program was not set then try to get the vertex program using the name
+        // passed in params
+        if (mScriptContext.program.isNull())
+        {
+            mScriptContext.program = GpuProgramManager::getSingleton().getByName(name);
+            if (mScriptContext.program.isNull())
+            {
+                // Unknown program
+                logParseError("Invalid shadow_caster_vertex_program_ref entry - vertex program "
+                    + name + " has not been defined.");
+                return;
+            }
+
+            // Set the vertex program for this pass
+            mScriptContext.pass->setShadowCasterVertexProgram(name);
+        }
+
+        mScriptContext.isProgramShadowCaster = true;
+        mScriptContext.isVertexProgramShadowReceiver = false;
+		mScriptContext.isFragmentProgramShadowReceiver = false;
+
+        // Create params? Skip this if program is not supported
+        if (mScriptContext.program->isSupported())
+        {
+            mScriptContext.programParams = mScriptContext.pass->getShadowCasterVertexProgramParameters();
+			mScriptContext.numAnimationParametrics = 0;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseShadowReceiverVertexProgramRef(void)
+    {
+        assert(mScriptContext.pass);
+        // update section
+        mScriptContext.section = MSS_PROGRAM_REF;
+
+        String name;
+
+        // get the name of the program definition if it was set
+        if (getRemainingTokensForAction() == 1)
+        {
+            name = getNextTokenLabel();
+            StringUtil::trim(name);
+        }
+
+        // check if pass has a shadow caster vertex program already
+        if (mScriptContext.pass->hasShadowReceiverVertexProgram())
+        {
+            // if existing pass vertex program has same name as params
+            // or params is empty then use current vertex program
+            if (name.empty() || (mScriptContext.pass->getShadowReceiverVertexProgramName() == name))
+            {
+                mScriptContext.program = mScriptContext.pass->getShadowReceiverVertexProgram();
+            }
+        }
+
+        // if context.program was not set then try to get the vertex program using the name
+        // passed in params
+        if (mScriptContext.program.isNull())
+        {
+            mScriptContext.program = GpuProgramManager::getSingleton().getByName(name);
+            if (mScriptContext.program.isNull())
+            {
+                // Unknown program
+                logParseError("Invalid shadow_receiver_vertex_program_ref entry - vertex program "
+                    + name + " has not been defined.");
+                return;
+            }
+
+            // Set the vertex program for this pass
+            mScriptContext.pass->setShadowReceiverVertexProgram(name);
+        }
+
+        mScriptContext.isProgramShadowCaster = false;
+        mScriptContext.isVertexProgramShadowReceiver = true;
+		mScriptContext.isFragmentProgramShadowReceiver = false;
+
+        // Create params? Skip this if program is not supported
+        if (mScriptContext.program->isSupported())
+        {
+            mScriptContext.programParams = mScriptContext.pass->getShadowReceiverVertexProgramParameters();
+			mScriptContext.numAnimationParametrics = 0;
+        }
+    }
+	//-----------------------------------------------------------------------
+	void MaterialScriptCompiler::parseShadowReceiverFragmentProgramRef(void)
+	{
+        assert(mScriptContext.pass);
+		// update section
+		mScriptContext.section = MSS_PROGRAM_REF;
+
+        String name;
+
+        // get the name of the program definition if it was set
+        if (getRemainingTokensForAction() == 1)
+        {
+            name = getNextTokenLabel();
+            StringUtil::trim(name);
+        }
+        // check if pass has a fragment program already
+        if (mScriptContext.pass->hasShadowReceiverFragmentProgram())
+        {
+            // if existing pass fragment program has same name as params
+            // or params is empty then use current fragment program
+            if (name.empty() || (mScriptContext.pass->getShadowReceiverFragmentProgramName() == name))
+            {
+                mScriptContext.program = mScriptContext.pass->getShadowReceiverFragmentProgram();
+            }
+        }
+
+        // if context.program was not set then try to get the fragment program using the name
+        // passed in
+        if (mScriptContext.program.isNull())
+        {
+            mScriptContext.program = GpuProgramManager::getSingleton().getByName(name);
+            if (mScriptContext.program.isNull())
+            {
+                // Unknown program
+                logParseError("Invalid shadow_receiver_fragment_program_ref entry - fragment program "
+                    + name + " has not been defined.");
+                return;
+            }
+
+            // Set the vertex program for this pass
+            mScriptContext.pass->setShadowReceiverFragmentProgram(name);
+        }
+
+        mScriptContext.isProgramShadowCaster = false;
+        mScriptContext.isVertexProgramShadowReceiver = false;
+        mScriptContext.isFragmentProgramShadowReceiver = true;
+
+		// Create params? Skip this if program is not supported
+		if (mScriptContext.program->isSupported())
+		{
+			mScriptContext.programParams = mScriptContext.pass->getShadowReceiverFragmentProgramParameters();
+			mScriptContext.numAnimationParametrics = 0;
+		}
+	}
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseFragmentProgramRef(void)
+    {
+        assert(mScriptContext.pass);
+        // update section
+        mScriptContext.section = MSS_PROGRAM_REF;
+
+        String name;
+
+        // get the name of the program definition if it was set
+        if (getRemainingTokensForAction() == 1)
+        {
+            name = getNextTokenLabel();
+            StringUtil::trim(name);
+        }
+        // check if pass has a fragment program already
+        if (mScriptContext.pass->hasFragmentProgram())
+        {
+            // if existing pass fragment program has same name as params
+            // or params is empty then use current fragment program
+            if (name.empty() || (mScriptContext.pass->getFragmentProgramName() == name))
+            {
+                mScriptContext.program = mScriptContext.pass->getFragmentProgram();
+            }
+        }
+
+        // if context.program was not set then try to get the fragment program using the name
+        // passed in params
+        if (mScriptContext.program.isNull())
+        {
+            mScriptContext.program = GpuProgramManager::getSingleton().getByName(name);
+            if (mScriptContext.program.isNull())
+            {
+                // Unknown program
+                logParseError("Invalid fragment_program_ref entry - fragment program "
+                    + name + " has not been defined.");
+                return;
+            }
+
+            // Set the vertex program for this pass
+            mScriptContext.pass->setFragmentProgram(name);
+        }
+
+        // Create params? Skip this if program is not supported
+        if (mScriptContext.program->isSupported())
+        {
+            mScriptContext.programParams = mScriptContext.pass->getFragmentProgramParameters();
+			mScriptContext.numAnimationParametrics = 0;
+        }
+    }
+    //-----------------------------------------------------------------------
+	void MaterialScriptCompiler::processManualProgramParam(bool isNamed, 
+		const String commandname, size_t index, const String& paramName)
+    {
+        // NB we assume that the first element of vecparams is taken up with either
+        // the index or the parameter name, which we ignore
+
+        // Determine type
+        size_t start, dims, roundedDims, i;
+        bool isReal;
+        bool isMatrix4x4 = false;
+        String param(getNextTokenLabel());
+
+        StringUtil::toLowerCase(param);
+
+        if (param == "matrix4x4")
+        {
+            dims = 16;
+            isReal = true;
+            isMatrix4x4 = true;
+        }
+        else if ((start = param.find("float")) != String::npos)
+        {
+            // find the dimensionality
+            start = param.find_first_not_of("float");
+            // Assume 1 if not specified
+            if (start == String::npos)
+            {
+                dims = 1;
+            }
+            else
+            {
+                dims = StringConverter::parseInt(param.substr(start));
+            }
+            isReal = true;
+        }
+        else if ((start = param.find("int")) != String::npos)
+        {
+            // find the dimensionality
+            start = param.find_first_not_of("int");
+            // Assume 1 if not specified
+            if (start == String::npos)
+            {
+                dims = 1;
+            }
+            else
+            {
+                dims = StringConverter::parseInt(param.substr(start));
+            }
+            isReal = false;
+        }
+        else
+        {
+            logParseError("Invalid " + commandname + " attribute - unrecognised "
+                "parameter type " + param);
+            return;
+        }
+
+        if (getRemainingTokensForAction() != dims)
+        {
+            logParseError("Invalid " + commandname + " attribute - you need " +
+                StringConverter::toString(2 + dims) + " parameters for a parameter of "
+                "type " + param);
+        }
+
+		// clear any auto parameter bound to this constant, it would override this setting
+		// can cause problems overriding materials or changing default params
+		if (isNamed)
+			mScriptContext.programParams->clearNamedAutoConstant(paramName);
+		else
+			mScriptContext.programParams->clearAutoConstant(index);
+
+		// Round dims to multiple of 4
+		if (dims %4 != 0)
+		{
+			roundedDims = dims + 4 - (dims % 4);
+		}
+		else
+		{
+			roundedDims = dims;
+		}
+
+		// Now parse all the values
+        if (isReal)
+        {
+            Real* realBuffer = new Real[roundedDims];
+            // Do specified values
+            for (i = 0; i < dims; ++i)
+            {
+                realBuffer[i] = getNextTokenValue();
+            }
+			// Fill up to multiple of 4 with zero
+			for (; i < roundedDims; ++i)
+			{
+				realBuffer[i] = 0.0f;
+
+			}
+
+            if (isMatrix4x4)
+            {
+                // its a Matrix4x4 so pass as a Matrix4
+                // use specialized setConstant that takes a matrix so matrix is transposed if required
+                Matrix4 m4x4(
+                    realBuffer[0],  realBuffer[1],  realBuffer[2],  realBuffer[3],
+                    realBuffer[4],  realBuffer[5],  realBuffer[6],  realBuffer[7],
+                    realBuffer[8],  realBuffer[9],  realBuffer[10], realBuffer[11],
+                    realBuffer[12], realBuffer[13], realBuffer[14], realBuffer[15]
+                    );
+				if (isNamed)
+					mScriptContext.programParams->setNamedConstant(paramName, m4x4);
+				else
+					mScriptContext.programParams->setConstant(index, m4x4);
+            }
+            else
+            {
+                // Set
+				if (isNamed)
+				{
+					// For named, only set up to the precise number of elements
+					// (no rounding to 4 elements)
+					// GLSL can support sub-float4 elements and we support that
+					// in the buffer now. Note how we set the 'multiple' param to 1
+					mScriptContext.programParams->setNamedConstant(paramName, 
+						realBuffer, dims, 1);
+				}
+				else
+				{
+	                mScriptContext.programParams->setConstant(index, 
+						realBuffer, static_cast<size_t>(roundedDims * 0.25));
+				}
+
+            }
+
+
+            delete [] realBuffer;
+        }
+        else
+        {
+            int* intBuffer = new int[roundedDims];
+            // Do specified values
+            for (i = 0; i < dims; ++i)
+            {
+                intBuffer[i] = static_cast<int>(getNextTokenValue());
+            }
+			// Fill to multiple of 4 with 0
+			for (; i < roundedDims; ++i)
+			{
+				intBuffer[i] = 0;
+			}
+            // Set
+			if (isNamed)
+			{
+				// For named, only set up to the precise number of elements
+				// (no rounding to 4 elements)
+				// GLSL can support sub-float4 elements and we support that
+				// in the buffer now. Note how we set the 'multiple' param to 1
+				mScriptContext.programParams->setNamedConstant(paramName, intBuffer, 
+					dims, 1);
+			}
+			else
+			{
+				mScriptContext.programParams->setConstant(index, intBuffer, 
+					static_cast<size_t>(roundedDims * 0.25));
+			}
+            delete [] intBuffer;
+        }
+    }
+    //-----------------------------------------------------------------------
+	void MaterialScriptCompiler::processAutoProgramParam(bool isNamed, const String commandname, 
+		size_t index, const String& paramName)
+    {
+
+        String autoConstantName(getNextTokenLabel());
+        // make sure param is in lower case
+        StringUtil::toLowerCase(autoConstantName);
+
+        // lookup the param to see if its a valid auto constant
+        const GpuProgramParameters::AutoConstantDefinition* autoConstantDef =
+            mScriptContext.programParams->getAutoConstantDefinition(autoConstantName);
+
+        // exit with error msg if the auto constant definition wasn't found
+        if (!autoConstantDef)
+		{
+			logParseError("Invalid " + commandname + " attribute - "
+				+ autoConstantName);
+			return;
+		}
+
+        // add AutoConstant based on the type of data it uses
+        switch (autoConstantDef->dataType)
+        {
+        case GpuProgramParameters::ACDT_NONE:
+			if (isNamed)
+				mScriptContext.programParams->setNamedAutoConstant(paramName, autoConstantDef->acType, 0);
+			else
+				mScriptContext.programParams->setAutoConstant(index, autoConstantDef->acType, 0);
+            break;
+
+        case GpuProgramParameters::ACDT_INT:
+            {
+				// Special case animation_parametric, we need to keep track of number of times used
+				if (autoConstantDef->acType == GpuProgramParameters::ACT_ANIMATION_PARAMETRIC)
+				{
+					if (isNamed)
+						mScriptContext.programParams->setNamedAutoConstant(
+							paramName, autoConstantDef->acType, mScriptContext.numAnimationParametrics++);
+					else
+						mScriptContext.programParams->setAutoConstant(
+							index, autoConstantDef->acType, mScriptContext.numAnimationParametrics++);
+				}
+				// Special case texture projector - assume 0 if data not specified
+				else if (autoConstantDef->acType == GpuProgramParameters::ACT_TEXTURE_VIEWPROJ_MATRIX
+					&& getRemainingTokensForAction() == 0)
+				{
+					if (isNamed)
+						mScriptContext.programParams->setNamedAutoConstant(
+							paramName, autoConstantDef->acType, 0);
+					else
+						mScriptContext.programParams->setAutoConstant(
+							index, autoConstantDef->acType, 0);
+
+				}
+				else
+				{
+
+					if (getRemainingTokensForAction() != 1)
+					{
+						logParseError("Invalid " + commandname + " attribute - "
+							"expected 3 parameters.");
+						return;
+					}
+
+					size_t extraParam = static_cast<size_t>(getNextTokenValue());
+					if (isNamed)
+						mScriptContext.programParams->setNamedAutoConstant(
+							paramName, autoConstantDef->acType, extraParam);
+					else
+						mScriptContext.programParams->setAutoConstant(
+							index, autoConstantDef->acType, extraParam);
+				}
+            }
+            break;
+
+        case GpuProgramParameters::ACDT_REAL:
+            {
+                // special handling for time
+                if (autoConstantDef->acType == GpuProgramParameters::ACT_TIME ||
+                    autoConstantDef->acType == GpuProgramParameters::ACT_FRAME_TIME)
+                {
+                    Real factor = 1.0f;
+                    if (getRemainingTokensForAction() == 1)
+                    {
+                        factor = getNextTokenValue();
+                    }
+
+					if (isNamed)
+						mScriptContext.programParams->setNamedAutoConstantReal(
+							paramName, autoConstantDef->acType, factor);
+					else
+						mScriptContext.programParams->setAutoConstantReal(
+							index, autoConstantDef->acType, factor);
+                }
+                else // normal processing for auto constants that take an extra real value
+                {
+                    if (getRemainingTokensForAction() != 1)
+                    {
+                        logParseError("Invalid " + commandname + " attribute - "
+                            "expected 3 parameters.");
+                        return;
+                    }
+
+			        const Real rData = getNextTokenValue();
+					if (isNamed)
+						mScriptContext.programParams->setNamedAutoConstantReal(
+							paramName, autoConstantDef->acType, rData);
+					else
+						mScriptContext.programParams->setAutoConstantReal(
+							index, autoConstantDef->acType, rData);
+                }
+            }
+            break;
+
+        } // end switch
+
+
+    }
+
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseParamIndexed(void)
+    {
+        if (mScriptContext.section == MSS_DEFAULT_PARAMETERS)
+        {
+            // save the pass2 token que position for later processing
+            mScriptContext.pendingDefaultParams.push_back(getPass2TokenQuePosition());
+            return;
+        }
+
+        // NB skip this if the program is not supported or could not be found
+        if (mScriptContext.program.isNull() || !mScriptContext.program->isSupported())
+        {
+            return;
+        }
+
+        // Get start index
+        const size_t index = static_cast<size_t>(getNextTokenValue());
+
+        processManualProgramParam(false, "param_indexed", index);
+
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseParamIndexedAuto(void)
+    {
+        if (mScriptContext.section == MSS_DEFAULT_PARAMETERS)
+        {
+            // save the pass2 token que position for later processing
+            mScriptContext.pendingDefaultParams.push_back(getPass2TokenQuePosition());
+            return;
+        }
+        // NB skip this if the program is not supported or could not be found
+        if (mScriptContext.program.isNull() || !mScriptContext.program->isSupported())
+        {
+            return;
+        }
+        // Get start index
+        const size_t index = static_cast<size_t>(getNextTokenValue());
+
+        processAutoProgramParam(false, "param_indexed_auto", index);
+
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseParamNamed(void)
+    {
+        if (mScriptContext.section == MSS_DEFAULT_PARAMETERS)
+        {
+            // save the pass2 token que position for later processing
+            mScriptContext.pendingDefaultParams.push_back(getPass2TokenQuePosition());
+            return;
+        }
+        // NB skip this if the program is not supported or could not be found
+        if (mScriptContext.program.isNull() || !mScriptContext.program->isSupported())
+        {
+            return;
+        }
+
+        // Get start index from name
+        const String& paramName = getNextTokenLabel();
+        try {
+            const GpuConstantDefinition& def =
+				mScriptContext.programParams->getConstantDefinition(paramName);
+        }
+        catch (Exception& e)
+        {
+            logParseError("Invalid param_named attribute - " + e.getDescription());
+            return;
+        }
+
+        processManualProgramParam(true, "param_named", 0, paramName);
+
+    }
+    //-----------------------------------------------------------------------
+    void MaterialScriptCompiler::parseParamNamedAuto(void)
+    {
+        if (mScriptContext.section == MSS_DEFAULT_PARAMETERS)
+        {
+            // save the pass2 token que position for later processing
+            mScriptContext.pendingDefaultParams.push_back(getPass2TokenQuePosition());
+            return;
+        }
+        // NB skip this if the program is not supported or could not be found
+        if (mScriptContext.program.isNull() || !mScriptContext.program->isSupported())
+        {
+            return;
+        }
+
+        // Get start index from name
+        const String& paramName = getNextTokenLabel();
+        try {
+			const GpuConstantDefinition& def =
+				mScriptContext.programParams->getConstantDefinition(paramName);
+        }
+        catch (Exception& e)
+        {
+            logParseError("Invalid param_named_auto attribute - " + e.getDescription());
+            return;
+        }
+
+        processAutoProgramParam(true, "param_named_auto", 0, paramName);
+    }
+    //-----------------------------------------------------------------------
+	void MaterialScriptCompiler::finishProgramDefinition(void)
+	{
+		// Now it is time to create the program and propagate the parameters
+		MaterialScriptProgramDefinition* def = mScriptContext.programDef;
+        GpuProgramPtr gp;
+
+		if (def->language == "asm")
+		{
+			// Native assembler
+			// Validate
+			if (def->source.empty())
+			{
+				logParseError("Invalid program definition for " + def->name +
+					", you must specify a source file.");
+			}
+			if (def->syntax.empty())
+			{
+				logParseError("Invalid program definition for " + def->name +
+					", you must specify a syntax code.");
+			}
+
+			/*  attempt to create the gpu program.  This could fail if the gpu program name is
+                already being used so must catch the exception and see if its possible to override
+                the existing gpu program.
+            */
+			try
+			{
+                gp = GpuProgramManager::getSingleton().
+                    createProgram(def->name, mScriptContext.groupName, def->source,
+                        def->progType, def->syntax);
+			}
+			catch (Exception& e)
+			{
+			    bool exceptionHandled = false;
+
+			    // attempt recovery if exception was caused by duplicate program name found
+                if (mScriptContext.allowOverride && (e.getNumber() == Exception::ERR_DUPLICATE_ITEM))
+                {
+                    // the gpu program already exists so unload it and then change source and syntax
+                    // the syntax code is not checked here
+                    gp = GpuProgramManager::getSingleton().getByName(def->name);
+                    if (!gp.isNull())
+                    {
+                        if (gp->getType() == def->progType)
+                        {
+                            logParseError("gpu asm program: " + def->name +
+                                ", defined in " + gp->getOrigin() +
+                                ", was overwritten by current gpu program definition being parsed with same name");
+                            gp->unload();
+                            /* updat group ownership since the original gpu program
+                               might have been in a different resource group
+                            */
+                            gp->changeGroupOwnership(mScriptContext.groupName);
+                            gp->setSyntaxCode(def->syntax);
+                            gp->setSource(def->source);
+                            // Need to do something about the existing default parameters
+                            gp->load();
+                            exceptionHandled = true;
+                        }
+                        else
+                        {
+                            // Don't create or override the gpu program due to incompitble program type so ignore the new definition
+                            logParseError("gpu asm program: " + def->name + " program type conflict with current gpu program definition being parsed with same name");
+                        }
+                    }
+                }
+
+                if (!exceptionHandled)
+                {
+                    // exception message already logged so no sense logging them in here and making two entries in the log
+                    logParseError("gpu asm program: " + def->name +
+                        " was previously defined and can not be overridden.\n"
+                        "Material Manager script override was not enabled." );
+                    mScriptContext.program.setNull();
+                    mScriptContext.programParams.setNull();
+                }
+			}
+		}
+		else
+		{
+			// High-level program
+			// Validate
+			if (def->source.empty() && def->language != "unified")
+			{
+				logParseError("Invalid program definition for " + def->name +
+					", you must specify a source file.");
+			}
+			/*  attempt to create the high level gpu program.  This could fail if the gpu program name is
+                already being used so must catch the exception and see if its possible to override
+                the existing gpu program.
+            */
+            HighLevelGpuProgramPtr hgp;
+            try
+            {
+                hgp = HighLevelGpuProgramManager::getSingleton().
+                    createProgram(def->name, mScriptContext.groupName,
+                        def->language, def->progType);
+            }
+            catch (Exception& e)
+            {
+			    bool exceptionHandled = false;
+			    // attempt recovery if exception was caused by duplicate gpu program name found
+                if (mScriptContext.allowOverride && (e.getNumber() == Exception::ERR_DUPLICATE_ITEM))
+                {
+                    hgp = HighLevelGpuProgramManager::getSingleton().getByName(def->name);
+                    if (!hgp.isNull())
+                    {
+                        // the language and program type must still be the same otherwise reuse is not possible
+                        if ((hgp->getLanguage() != def->language) || (hgp->getType() != def->progType))
+                        {
+                            logParseError("gpu high level program: " + def->name +
+                                " already exists and can not be redefined with the language or program type defined in the material script");
+                        }
+                        else
+                        {
+                            logParseError("gpu high level program: " + def->name +
+                                ", defined in " + hgp->getOrigin() +
+                                ", was overwritten by current gpu program definition being parsed with same name");
+                            // unload the previous source that was compiled
+                            hgp->unload();
+                            /* update group ownership since the original gpu program
+                               might have been in a different resource group
+                            */
+                            hgp->changeGroupOwnership(mScriptContext.groupName);
+                            exceptionHandled = true;
+                        }
+                    }
+                }
+
+                if (!exceptionHandled)
+                {
+                    // exception message already logged so no sense logging them in here and making two entries in the log
+                    logParseError("gpu high level program: " + def->name +
+                        " was previously defined and can not be overridden.\n"
+                        "Material Manager script override was not enabled." );
+                    mScriptContext.program.setNull();
+                    mScriptContext.programParams.setNull();
+                }
+            }
+            // if the high level gpu program dosn't exist then don't continue
+            if (hgp.isNull())
+                return;
+
+            // Assign to generalised version
+            gp = hgp;
+
+            // Set source file
+            hgp->setSourceFile(def->source);
+
+            // Set custom parameters
+			std::vector<std::pair<String, String> >::const_iterator i, iend;
+            iend = def->customParameters.end();
+            for (i = def->customParameters.begin(); i != iend; ++i)
+            {
+                if (!hgp->setParameter(i->first, i->second))
+                {
+                    logParseError("Error in program " + def->name +
+                        " parameter " + i->first + " is not valid.");
+                }
+            }
+        }
+
+        // don't continue processing gpu program if it doesn't exist
+        if (gp.isNull())
+            return;
+
+        // Set skeletal animation option
+        gp->setSkeletalAnimationIncluded(def->supportsSkeletalAnimation);
+		// Set morph animation option
+		gp->setMorphAnimationIncluded(def->supportsMorphAnimation);
+		// Set pose animation option
+		gp->setPoseAnimationIncluded(def->supportsPoseAnimation);
+        // Set vertex texture usage
+        gp->setVertexTextureFetchRequired(def->usesVertexTextureFetch);
+
+		// set origin
+		gp->_notifyOrigin(mSourceName);
+
+        // Set up to receive default parameters
+        if (gp->isSupported()
+            && !mScriptContext.pendingDefaultParams.empty())
+        {
+            mScriptContext.programParams = gp->getDefaultParameters();
+			mScriptContext.numAnimationParametrics = 0;
+            mScriptContext.program = gp;
+            size_t i, iend;
+            iend = mScriptContext.pendingDefaultParams.size();
+            for (i = 0; i < iend; ++i)
+            {
+                // invoke the action for the pending default param in the token que
+                setPass2TokenQuePosition(mScriptContext.pendingDefaultParams[i], true);
+            }
+            // Reset
+            mScriptContext.program.setNull();
+            mScriptContext.programParams.setNull();
+        }
+
+	}
+
+
+}
Index: /OgreMain/src/OgreMaterialSerializer.cpp
===================================================================
--- /OgreMain/src/OgreMaterialSerializer.cpp	(revision 5)
+++ /OgreMain/src/OgreMaterialSerializer.cpp	(revision 5)
@@ -0,0 +1,4622 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreMaterialSerializer.h"
+#include "OgreStringConverter.h"
+#include "OgreLogManager.h"
+#include "OgreException.h"
+#include "OgreTechnique.h"
+#include "OgrePass.h"
+#include "OgreTextureUnitState.h"
+#include "OgreMaterialManager.h"
+#include "OgreGpuProgramManager.h"
+#include "OgreHighLevelGpuProgramManager.h"
+#include "OgreExternalTextureSourceManager.h"
+
+namespace Ogre
+{
+
+    //-----------------------------------------------------------------------
+    // Internal parser methods
+    //-----------------------------------------------------------------------
+    void logParseError(const String& error, const MaterialScriptContext& context)
+    {
+        // log material name only if filename not specified
+        if (context.filename.empty() && !context.material.isNull())
+        {
+            LogManager::getSingleton().logMessage(
+                "Error in material " + context.material->getName() +
+                " : " + error);
+        }
+        else
+        {
+            if (!context.material.isNull())
+            {
+                LogManager::getSingleton().logMessage(
+                    "Error in material " + context.material->getName() +
+                    " at line " + StringConverter::toString(context.lineNo) +
+                    " of " + context.filename + ": " + error);
+            }
+            else
+            {
+                LogManager::getSingleton().logMessage(
+                    "Error at line " + StringConverter::toString(context.lineNo) +
+                    " of " + context.filename + ": " + error);
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    ColourValue _parseColourValue(StringVector& vecparams)
+    {
+        return ColourValue(
+            StringConverter::parseReal(vecparams[0]) ,
+            StringConverter::parseReal(vecparams[1]) ,
+            StringConverter::parseReal(vecparams[2]) ,
+            (vecparams.size()==4) ? StringConverter::parseReal(vecparams[3]) : 1.0f ) ;
+    }
+    //-----------------------------------------------------------------------
+    FilterOptions convertFiltering(const String& s)
+    {
+        if (s == "none")
+        {
+            return FO_NONE;
+        }
+        else if (s == "point")
+        {
+            return FO_POINT;
+        }
+        else if (s == "linear")
+        {
+            return FO_LINEAR;
+        }
+        else if (s == "anisotropic")
+        {
+            return FO_ANISOTROPIC;
+        }
+
+        return FO_POINT;
+    }
+    //-----------------------------------------------------------------------
+    bool parseAmbient(String& params, MaterialScriptContext& context)
+    {
+        StringVector vecparams = StringUtil::split(params, " \t");
+        // Must be 1, 3 or 4 parameters
+        if (vecparams.size() == 1) {
+            if(vecparams[0] == "vertexcolour") {
+               context.pass->setVertexColourTracking(context.pass->getVertexColourTracking() | TVC_AMBIENT);
+            } else {
+                logParseError(
+                    "Bad ambient attribute, single parameter flag must be 'vertexcolour'",
+                    context);
+            }
+        }
+        else if (vecparams.size() == 3 || vecparams.size() == 4)
+        {
+            context.pass->setAmbient( _parseColourValue(vecparams) );
+            context.pass->setVertexColourTracking(context.pass->getVertexColourTracking() & ~TVC_AMBIENT);
+        }
+        else
+        {
+            logParseError(
+                "Bad ambient attribute, wrong number of parameters (expected 1, 3 or 4)",
+                context);
+        }
+        return false;
+    }
+   //-----------------------------------------------------------------------
+    bool parseDiffuse(String& params, MaterialScriptContext& context)
+    {
+        StringVector vecparams = StringUtil::split(params, " \t");
+        // Must be 1, 3 or 4 parameters
+        if (vecparams.size() == 1) {
+            if(vecparams[0] == "vertexcolour") {
+               context.pass->setVertexColourTracking(context.pass->getVertexColourTracking() | TVC_DIFFUSE);
+            } else {
+                logParseError(
+                    "Bad diffuse attribute, single parameter flag must be 'vertexcolour'",
+                    context);
+            }
+        }
+        else if (vecparams.size() == 3 || vecparams.size() == 4)
+        {
+            context.pass->setDiffuse( _parseColourValue(vecparams) );
+            context.pass->setVertexColourTracking(context.pass->getVertexColourTracking() & ~TVC_DIFFUSE);
+        }
+        else
+        {
+            logParseError(
+                "Bad diffuse attribute, wrong number of parameters (expected 1, 3 or 4)",
+                context);
+        }        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseSpecular(String& params, MaterialScriptContext& context)
+    {
+        StringVector vecparams = StringUtil::split(params, " \t");
+        // Must be 2, 4 or 5 parameters
+        if(vecparams.size() == 2)
+        {
+            if(vecparams[0] == "vertexcolour") {
+                context.pass->setVertexColourTracking(context.pass->getVertexColourTracking() | TVC_SPECULAR);
+                context.pass->setShininess(StringConverter::parseReal(vecparams[1]) );
+            }
+            else
+            {
+                logParseError(
+                    "Bad specular attribute, double parameter statement must be 'vertexcolour <shininess>'",
+                    context);
+            }
+        }
+        else if(vecparams.size() == 4 || vecparams.size() == 5)
+        {
+            context.pass->setSpecular(
+                StringConverter::parseReal(vecparams[0]),
+                StringConverter::parseReal(vecparams[1]),
+                StringConverter::parseReal(vecparams[2]),
+                vecparams.size() == 5?
+                    StringConverter::parseReal(vecparams[3]) : 1.0f);
+            context.pass->setVertexColourTracking(context.pass->getVertexColourTracking() & ~TVC_SPECULAR);
+            context.pass->setShininess(
+                StringConverter::parseReal(vecparams[vecparams.size() - 1]) );
+        }
+        else
+        {
+            logParseError(
+                "Bad specular attribute, wrong number of parameters (expected 2, 4 or 5)",
+                context);
+        }
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseEmissive(String& params, MaterialScriptContext& context)
+    {
+        StringVector vecparams = StringUtil::split(params, " \t");
+        // Must be 1, 3 or 4 parameters
+        if (vecparams.size() == 1) {
+            if(vecparams[0] == "vertexcolour") {
+               context.pass->setVertexColourTracking(context.pass->getVertexColourTracking() | TVC_EMISSIVE);
+            } else {
+                logParseError(
+                    "Bad emissive attribute, single parameter flag must be 'vertexcolour'",
+                    context);
+            }
+        }
+        else if (vecparams.size() == 3 || vecparams.size() == 4)
+        {
+            context.pass->setSelfIllumination( _parseColourValue(vecparams) );
+            context.pass->setVertexColourTracking(context.pass->getVertexColourTracking() & ~TVC_EMISSIVE);
+        }
+        else
+        {
+            logParseError(
+                "Bad emissive attribute, wrong number of parameters (expected 1, 3 or 4)",
+                context);
+        }
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    SceneBlendFactor convertBlendFactor(const String& param)
+    {
+        if (param == "one")
+            return SBF_ONE;
+        else if (param == "zero")
+            return SBF_ZERO;
+        else if (param == "dest_colour")
+            return SBF_DEST_COLOUR;
+        else if (param == "src_colour")
+            return SBF_SOURCE_COLOUR;
+        else if (param == "one_minus_dest_colour")
+            return SBF_ONE_MINUS_DEST_COLOUR;
+        else if (param == "one_minus_src_colour")
+            return SBF_ONE_MINUS_SOURCE_COLOUR;
+        else if (param == "dest_alpha")
+            return SBF_DEST_ALPHA;
+        else if (param == "src_alpha")
+            return SBF_SOURCE_ALPHA;
+        else if (param == "one_minus_dest_alpha")
+            return SBF_ONE_MINUS_DEST_ALPHA;
+        else if (param == "one_minus_src_alpha")
+            return SBF_ONE_MINUS_SOURCE_ALPHA;
+        else
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Invalid blend factor.", "convertBlendFactor");
+        }
+
+
+    }
+    //-----------------------------------------------------------------------
+    bool parseSceneBlend(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        StringVector vecparams = StringUtil::split(params, " \t");
+        // Should be 1 or 2 params
+        if (vecparams.size() == 1)
+        {
+            //simple
+            SceneBlendType stype;
+            if (vecparams[0] == "add")
+                stype = SBT_ADD;
+            else if (vecparams[0] == "modulate")
+                stype = SBT_MODULATE;
+			else if (vecparams[0] == "colour_blend")
+				stype = SBT_TRANSPARENT_COLOUR;
+            else if (vecparams[0] == "alpha_blend")
+                stype = SBT_TRANSPARENT_ALPHA;
+            else
+            {
+                logParseError(
+                    "Bad scene_blend attribute, unrecognised parameter '" + vecparams[0] + "'",
+                    context);
+                return false;
+            }
+            context.pass->setSceneBlending(stype);
+
+        }
+        else if (vecparams.size() == 2)
+        {
+            //src/dest
+            SceneBlendFactor src, dest;
+
+            try {
+                src = convertBlendFactor(vecparams[0]);
+                dest = convertBlendFactor(vecparams[1]);
+                context.pass->setSceneBlending(src,dest);
+            }
+            catch (Exception& e)
+            {
+                logParseError("Bad scene_blend attribute, " + e.getDescription(), context);
+            }
+
+        }
+        else
+        {
+            logParseError(
+                "Bad scene_blend attribute, wrong number of parameters (expected 1 or 2)",
+                context);
+        }
+
+        return false;
+
+    }
+    //-----------------------------------------------------------------------
+    CompareFunction convertCompareFunction(const String& param)
+    {
+        if (param == "always_fail")
+            return CMPF_ALWAYS_FAIL;
+        else if (param == "always_pass")
+            return CMPF_ALWAYS_PASS;
+        else if (param == "less")
+            return CMPF_LESS;
+        else if (param == "less_equal")
+            return CMPF_LESS_EQUAL;
+        else if (param == "equal")
+            return CMPF_EQUAL;
+        else if (param == "not_equal")
+            return CMPF_NOT_EQUAL;
+        else if (param == "greater_equal")
+            return CMPF_GREATER_EQUAL;
+        else if (param == "greater")
+            return CMPF_GREATER;
+        else
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Invalid compare function", "convertCompareFunction");
+
+    }
+    //-----------------------------------------------------------------------
+    bool parseDepthCheck(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        if (params == "on")
+            context.pass->setDepthCheckEnabled(true);
+        else if (params == "off")
+            context.pass->setDepthCheckEnabled(false);
+        else
+            logParseError(
+            "Bad depth_check attribute, valid parameters are 'on' or 'off'.",
+            context);
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseDepthWrite(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        if (params == "on")
+            context.pass->setDepthWriteEnabled(true);
+        else if (params == "off")
+            context.pass->setDepthWriteEnabled(false);
+        else
+            logParseError(
+                "Bad depth_write attribute, valid parameters are 'on' or 'off'.",
+                context);
+        return false;
+    }
+
+    //-----------------------------------------------------------------------
+    bool parseDepthFunc(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        try {
+            CompareFunction func = convertCompareFunction(params);
+            context.pass->setDepthFunction(func);
+        }
+        catch (...)
+        {
+            logParseError("Bad depth_func attribute, invalid function parameter.", context);
+        }
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseColourWrite(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        if (params == "on")
+            context.pass->setColourWriteEnabled(true);
+        else if (params == "off")
+            context.pass->setColourWriteEnabled(false);
+        else
+            logParseError(
+                "Bad colour_write attribute, valid parameters are 'on' or 'off'.",
+                context);
+        return false;
+    }
+
+    //-----------------------------------------------------------------------
+    bool parseCullHardware(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        if (params=="none")
+            context.pass->setCullingMode(CULL_NONE);
+        else if (params=="anticlockwise")
+            context.pass->setCullingMode(CULL_ANTICLOCKWISE);
+        else if (params=="clockwise")
+            context.pass->setCullingMode(CULL_CLOCKWISE);
+        else
+            logParseError(
+                "Bad cull_hardware attribute, valid parameters are "
+                "'none', 'clockwise' or 'anticlockwise'.", context);
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseCullSoftware(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        if (params=="none")
+            context.pass->setManualCullingMode(MANUAL_CULL_NONE);
+        else if (params=="back")
+            context.pass->setManualCullingMode(MANUAL_CULL_BACK);
+        else if (params=="front")
+            context.pass->setManualCullingMode(MANUAL_CULL_FRONT);
+        else
+            logParseError(
+                "Bad cull_software attribute, valid parameters are 'none', "
+                "'front' or 'back'.", context);
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseLighting(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        if (params=="on")
+            context.pass->setLightingEnabled(true);
+        else if (params=="off")
+            context.pass->setLightingEnabled(false);
+        else
+            logParseError(
+                "Bad lighting attribute, valid parameters are 'on' or 'off'.", context);
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseMaxLights(String& params, MaterialScriptContext& context)
+    {
+		context.pass->setMaxSimultaneousLights(StringConverter::parseInt(params));
+        return false;
+    }
+	//-----------------------------------------------------------------------
+	bool parseStartLight(String& params, MaterialScriptContext& context)
+	{
+		context.pass->setStartLight(StringConverter::parseInt(params));
+		return false;
+	}
+    //-----------------------------------------------------------------------
+    void parseIterationLightTypes(String& params, MaterialScriptContext& context)
+    {
+        // Parse light type
+        if (params == "directional")
+        {
+            context.pass->setIteratePerLight(true, true, Light::LT_DIRECTIONAL);
+        }
+        else if (params == "point")
+        {
+            context.pass->setIteratePerLight(true, true, Light::LT_POINT);
+        }
+        else if (params == "spot")
+        {
+            context.pass->setIteratePerLight(true, true, Light::LT_SPOTLIGHT);
+        }
+        else
+        {
+            logParseError("Bad iteration attribute, valid values for light type parameter "
+                "are 'point' or 'directional' or 'spot'.", context);
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    bool parseIteration(String& params, MaterialScriptContext& context)
+    {
+        // we could have more than one parameter
+        /** combinations could be:
+            iteration once
+            iteration once_per_light [light type]
+            iteration <number>
+            iteration <number> [per_light] [light type]
+			iteration <number> [per_n_lights] <num_lights> [light type]
+        */
+        StringUtil::toLowerCase(params);
+        StringVector vecparams = StringUtil::split(params, " \t");
+        if (vecparams.size() < 1 || vecparams.size() > 4)
+        {
+            logParseError("Bad iteration attribute, expected 1 to 3 parameters.", context);
+            return false;
+        }
+
+        if (vecparams[0]=="once")
+            context.pass->setIteratePerLight(false, false);
+        else if (vecparams[0]=="once_per_light")
+        {
+            if (vecparams.size() == 2)
+            {
+                parseIterationLightTypes(vecparams[1], context);
+            }
+            else
+            {
+                context.pass->setIteratePerLight(true, false);
+            }
+
+        }
+        else // could be using form: <number> [per_light] [light type]
+        {
+            int passIterationCount = StringConverter::parseInt(vecparams[0]);
+            if (passIterationCount > 0)
+            {
+                context.pass->setPassIterationCount(passIterationCount);
+                if (vecparams.size() > 1)
+                {
+                    if (vecparams[1] == "per_light")
+                    {
+                        if (vecparams.size() == 3)
+                        {
+                            parseIterationLightTypes(vecparams[2], context);
+                        }
+                        else
+                        {
+                            context.pass->setIteratePerLight(true, false);
+                        }
+                    }
+					else if (vecparams[1] == "per_n_lights")
+					{
+						if (vecparams.size() < 3)
+						{
+							logParseError(
+								"Bad iteration attribute, expected number of lights.", 
+								context);
+						}
+						else
+						{
+							// Parse num lights
+							context.pass->setLightCountPerIteration(
+								StringConverter::parseInt(vecparams[2]));
+							// Light type
+							if (vecparams.size() == 4)
+							{
+								parseIterationLightTypes(vecparams[3], context);
+							}
+							else
+							{
+								context.pass->setIteratePerLight(true, false);
+							}
+						}
+					}
+                    else
+                        logParseError(
+                            "Bad iteration attribute, valid parameters are <number> [per_light|per_n_lights <num_lights>] [light type].", context);
+                }
+            }
+            else
+                logParseError(
+                    "Bad iteration attribute, valid parameters are 'once' or 'once_per_light' or <number> [per_light|per_n_lights <num_lights>] [light type].", context);
+        }
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parsePointSize(String& params, MaterialScriptContext& context)
+    {
+        context.pass->setPointSize(StringConverter::parseReal(params));
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parsePointSprites(String& params, MaterialScriptContext& context)
+    {
+        if (params=="on")
+	        context.pass->setPointSpritesEnabled(true);
+		else if (params=="off")
+	        context.pass->setPointSpritesEnabled(false);
+		else
+            logParseError(
+                "Bad point_sprites attribute, valid parameters are 'on' or 'off'.", context);
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+	bool parsePointAttenuation(String& params, MaterialScriptContext& context)
+	{
+        StringVector vecparams = StringUtil::split(params, " \t");
+        if (vecparams.size() != 1 && vecparams.size() != 4)
+		{
+			logParseError("Bad point_size_attenuation attribute, 1 or 4 parameters expected", context);
+			return false;
+		}
+		if (vecparams[0] == "off")
+		{
+			context.pass->setPointAttenuation(false);
+		}
+		else if (vecparams[0] == "on")
+		{
+			if (vecparams.size() == 4)
+			{
+				context.pass->setPointAttenuation(true,
+					StringConverter::parseReal(vecparams[1]),
+					StringConverter::parseReal(vecparams[2]),
+					StringConverter::parseReal(vecparams[3]));
+			}
+			else
+			{
+				context.pass->setPointAttenuation(true);
+			}
+		}
+
+		return false;
+	}
+    //-----------------------------------------------------------------------
+	bool parsePointSizeMin(String& params, MaterialScriptContext& context)
+	{
+		context.pass->setPointMinSize(
+			StringConverter::parseReal(params));
+		return false;
+	}
+    //-----------------------------------------------------------------------
+	bool parsePointSizeMax(String& params, MaterialScriptContext& context)
+	{
+		context.pass->setPointMaxSize(
+			StringConverter::parseReal(params));
+		return false;
+	}
+    //-----------------------------------------------------------------------
+    bool parseFogging(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        StringVector vecparams = StringUtil::split(params, " \t");
+        if (vecparams[0]=="true")
+        {
+            // if true, we need to see if they supplied all arguments, or just the 1... if just the one,
+            // Assume they want to disable the default fog from effecting this material.
+            if( vecparams.size() == 8 )
+            {
+                FogMode mFogtype;
+                if( vecparams[1] == "none" )
+                    mFogtype = FOG_NONE;
+                else if( vecparams[1] == "linear" )
+                    mFogtype = FOG_LINEAR;
+                else if( vecparams[1] == "exp" )
+                    mFogtype = FOG_EXP;
+                else if( vecparams[1] == "exp2" )
+                    mFogtype = FOG_EXP2;
+                else
+                {
+                    logParseError(
+                        "Bad fogging attribute, valid parameters are "
+                        "'none', 'linear', 'exp', or 'exp2'.", context);
+                    return false;
+                }
+
+                context.pass->setFog(
+                    true,
+                    mFogtype,
+                    ColourValue(
+                    StringConverter::parseReal(vecparams[2]),
+                    StringConverter::parseReal(vecparams[3]),
+                    StringConverter::parseReal(vecparams[4])),
+                    StringConverter::parseReal(vecparams[5]),
+                    StringConverter::parseReal(vecparams[6]),
+                    StringConverter::parseReal(vecparams[7])
+                    );
+            }
+            else
+            {
+                context.pass->setFog(true);
+            }
+        }
+        else if (vecparams[0]=="false")
+            context.pass->setFog(false);
+        else
+            logParseError(
+                "Bad fog_override attribute, valid parameters are 'true' or 'false'.",
+                context);
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseShading(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        if (params=="flat")
+            context.pass->setShadingMode(SO_FLAT);
+        else if (params=="gouraud")
+            context.pass->setShadingMode(SO_GOURAUD);
+        else if (params=="phong")
+            context.pass->setShadingMode(SO_PHONG);
+        else
+            logParseError("Bad shading attribute, valid parameters are 'flat', "
+                "'gouraud' or 'phong'.", context);
+
+        return false;
+    }
+	//-----------------------------------------------------------------------
+	bool parsePolygonMode(String& params, MaterialScriptContext& context)
+	{
+		StringUtil::toLowerCase(params);
+		if (params=="solid")
+			context.pass->setPolygonMode(PM_SOLID);
+		else if (params=="wireframe")
+			context.pass->setPolygonMode(PM_WIREFRAME);
+		else if (params=="points")
+			context.pass->setPolygonMode(PM_POINTS);
+		else
+			logParseError("Bad polygon_mode attribute, valid parameters are 'solid', "
+			"'wireframe' or 'points'.", context);
+
+		return false;
+	}
+    //-----------------------------------------------------------------------
+    bool parseFiltering(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        StringVector vecparams = StringUtil::split(params, " \t");
+        // Must be 1 or 3 parameters
+        if (vecparams.size() == 1)
+        {
+            // Simple format
+            if (vecparams[0]=="none")
+                context.textureUnit->setTextureFiltering(TFO_NONE);
+            else if (vecparams[0]=="bilinear")
+                context.textureUnit->setTextureFiltering(TFO_BILINEAR);
+            else if (vecparams[0]=="trilinear")
+                context.textureUnit->setTextureFiltering(TFO_TRILINEAR);
+            else if (vecparams[0]=="anisotropic")
+                context.textureUnit->setTextureFiltering(TFO_ANISOTROPIC);
+            else
+            {
+                logParseError("Bad filtering attribute, valid parameters for simple format are "
+                    "'none', 'bilinear', 'trilinear' or 'anisotropic'.", context);
+                return false;
+            }
+        }
+        else if (vecparams.size() == 3)
+        {
+            // Complex format
+            context.textureUnit->setTextureFiltering(
+                convertFiltering(vecparams[0]),
+                convertFiltering(vecparams[1]),
+                convertFiltering(vecparams[2]));
+
+
+        }
+        else
+        {
+            logParseError(
+                "Bad filtering attribute, wrong number of parameters (expected 1 or 3)",
+                context);
+        }
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    // Texture layer attributes
+    bool parseTexture(String& params, MaterialScriptContext& context)
+    {
+        StringVector vecparams = StringUtil::split(params, " \t");
+        const size_t numParams = vecparams.size();
+        if (numParams > 5)
+        {
+            logParseError("Invalid texture attribute - expected only up to 5 parameters.",
+                context);
+        }
+        TextureType tt = TEX_TYPE_2D;
+		int mipmaps = MIP_DEFAULT; // When passed to TextureManager::load, this means default to default number of mipmaps
+        bool isAlpha = false;
+        PixelFormat desiredFormat = PF_UNKNOWN;
+		for (size_t p = 1; p < numParams; ++p)
+		{
+            StringUtil::toLowerCase(vecparams[p]);
+            if (vecparams[p] == "1d")
+            {
+                tt = TEX_TYPE_1D;
+            }
+            else if (vecparams[p] == "2d")
+            {
+                tt = TEX_TYPE_2D;
+            }
+            else if (vecparams[p] == "3d")
+            {
+                tt = TEX_TYPE_3D;
+            }
+            else if (vecparams[p] == "cubic")
+            {
+                tt = TEX_TYPE_CUBE_MAP;
+            }
+			else if (vecparams[p] == "unlimited")
+			{
+				mipmaps = MIP_UNLIMITED;
+			}
+			else if (StringConverter::isNumber(vecparams[p]))
+			{
+				mipmaps = StringConverter::parseInt(vecparams[p]);
+			}
+			else if (vecparams[p] == "alpha")
+			{
+				isAlpha = true;
+			}
+            else if ((desiredFormat = PixelUtil::getFormatFromName(vecparams[p], true)) != PF_UNKNOWN)
+            {
+                // nothing to do here
+            }
+			else
+			{
+				logParseError("Invalid texture option - "+vecparams[p]+".",
+                context);
+			}
+        }
+
+		context.textureUnit->setTextureName(vecparams[0], tt);
+        context.textureUnit->setNumMipmaps(mipmaps);
+        context.textureUnit->setIsAlpha(isAlpha);
+        context.textureUnit->setDesiredFormat(desiredFormat);
+        return false;
+    }
+	//---------------------------------------------------------------------
+	bool parseBindingType(String& params, MaterialScriptContext& context)
+	{
+		if (params == "fragment")
+		{
+			context.textureUnit->setBindingType(TextureUnitState::BT_FRAGMENT);
+		}
+		else if (params == "vertex")
+		{
+			context.textureUnit->setBindingType(TextureUnitState::BT_VERTEX);
+		}
+		else
+		{
+			logParseError("Invalid binding_type option - "+params+".",
+				context);
+		}
+		return false;
+	}
+    //-----------------------------------------------------------------------
+    bool parseAnimTexture(String& params, MaterialScriptContext& context)
+    {
+        StringVector vecparams = StringUtil::split(params, " \t");
+        size_t numParams = vecparams.size();
+        // Determine which form it is
+        // Must have at least 3 params though
+        if (numParams < 3)
+        {
+            logParseError("Bad anim_texture attribute, wrong number of parameters "
+                "(expected at least 3)", context);
+            return false;
+        }
+        if (numParams == 3 && StringConverter::parseInt(vecparams[1]) != 0 )
+        {
+            // First form using base name & number of frames
+            context.textureUnit->setAnimatedTextureName(
+                vecparams[0],
+                StringConverter::parseInt(vecparams[1]),
+                StringConverter::parseReal(vecparams[2]));
+        }
+        else
+        {
+            // Second form using individual names
+            context.textureUnit->setAnimatedTextureName(
+                (String*)&vecparams[0],
+                static_cast<unsigned int>(numParams-1),
+                StringConverter::parseReal(vecparams[numParams-1]));
+        }
+        return false;
+
+    }
+    //-----------------------------------------------------------------------
+    bool parseCubicTexture(String& params, MaterialScriptContext& context)
+    {
+
+        StringVector vecparams = StringUtil::split(params, " \t");
+        size_t numParams = vecparams.size();
+
+        // Get final param
+        bool useUVW;
+        String& uvOpt = vecparams[numParams-1];
+		StringUtil::toLowerCase(uvOpt);
+        if (uvOpt == "combineduvw")
+            useUVW = true;
+        else if (uvOpt == "separateuv")
+            useUVW = false;
+        else
+        {
+            logParseError("Bad cubic_texture attribute, final parameter must be "
+                "'combinedUVW' or 'separateUV'.", context);
+            return false;
+        }
+        // Determine which form it is
+        if (numParams == 2)
+        {
+            // First form using base name
+            context.textureUnit->setCubicTextureName(vecparams[0], useUVW);
+        }
+        else if (numParams == 7)
+        {
+            // Second form using individual names
+            // Can use vecparams[0] as array start point
+            context.textureUnit->setCubicTextureName((String*)&vecparams[0], useUVW);
+        }
+        else
+        {
+            logParseError(
+                "Bad cubic_texture attribute, wrong number of parameters (expected 2 or 7)",
+                context);
+            return false;
+        }
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseTexCoord(String& params, MaterialScriptContext& context)
+    {
+        context.textureUnit->setTextureCoordSet(
+            StringConverter::parseInt(params));
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+	TextureUnitState::TextureAddressingMode convTexAddressMode(const String& params, MaterialScriptContext& context)
+	{
+		if (params=="wrap")
+			return TextureUnitState::TAM_WRAP;
+		else if (params=="mirror")
+			return TextureUnitState::TAM_MIRROR;
+		else if (params=="clamp")
+			return TextureUnitState::TAM_CLAMP;
+		else if (params=="border")
+			return TextureUnitState::TAM_BORDER;
+		else
+			logParseError("Bad tex_address_mode attribute, valid parameters are "
+				"'wrap', 'mirror', 'clamp' or 'border'.", context);
+		// default
+		return TextureUnitState::TAM_WRAP;
+	}
+    //-----------------------------------------------------------------------
+    bool parseTexAddressMode(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+
+        StringVector vecparams = StringUtil::split(params, " \t");
+        size_t numParams = vecparams.size();
+
+		if (numParams > 3 || numParams < 1)
+		{
+			logParseError("Invalid number of parameters to tex_address_mode"
+					" - must be between 1 and 3", context);
+		}
+		if (numParams == 1)
+		{
+			// Single-parameter option
+			context.textureUnit->setTextureAddressingMode(
+				convTexAddressMode(vecparams[0], context));
+		}
+		else
+		{
+			// 2-3 parameter option
+			TextureUnitState::UVWAddressingMode uvw;
+			uvw.u = convTexAddressMode(vecparams[0], context);
+			uvw.v = convTexAddressMode(vecparams[1], context);
+			if (numParams == 3)
+			{
+				// w
+				uvw.w = convTexAddressMode(vecparams[2], context);
+			}
+			else
+			{
+				uvw.w = TextureUnitState::TAM_WRAP;
+			}
+			context.textureUnit->setTextureAddressingMode(uvw);
+		}
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseTexBorderColour(String& params, MaterialScriptContext& context)
+    {
+        StringVector vecparams = StringUtil::split(params, " \t");
+        // Must be 3 or 4 parameters
+        if (vecparams.size() == 3 || vecparams.size() == 4)
+        {
+            context.textureUnit->setTextureBorderColour( _parseColourValue(vecparams) );
+        }
+        else
+        {
+            logParseError(
+                "Bad tex_border_colour attribute, wrong number of parameters (expected 3 or 4)",
+                context);
+        }
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseColourOp(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        if (params=="replace")
+            context.textureUnit->setColourOperation(LBO_REPLACE);
+        else if (params=="add")
+            context.textureUnit->setColourOperation(LBO_ADD);
+        else if (params=="modulate")
+            context.textureUnit->setColourOperation(LBO_MODULATE);
+        else if (params=="alpha_blend")
+            context.textureUnit->setColourOperation(LBO_ALPHA_BLEND);
+        else
+            logParseError("Bad colour_op attribute, valid parameters are "
+                "'replace', 'add', 'modulate' or 'alpha_blend'.", context);
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseAlphaRejection(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        StringVector vecparams = StringUtil::split(params, " \t");
+        if (vecparams.size() != 2)
+        {
+            logParseError(
+                "Bad alpha_rejection attribute, wrong number of parameters (expected 2)",
+                context);
+            return false;
+        }
+
+        CompareFunction cmp;
+        try {
+            cmp = convertCompareFunction(vecparams[0]);
+        }
+        catch (...)
+        {
+            logParseError("Bad alpha_rejection attribute, invalid compare function.", context);
+            return false;
+        }
+
+        context.pass->setAlphaRejectSettings(cmp, StringConverter::parseInt(vecparams[1]));
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    LayerBlendOperationEx convertBlendOpEx(const String& param)
+    {
+        if (param == "source1")
+            return LBX_SOURCE1;
+        else if (param == "source2")
+            return LBX_SOURCE2;
+        else if (param == "modulate")
+            return LBX_MODULATE;
+        else if (param == "modulate_x2")
+            return LBX_MODULATE_X2;
+        else if (param == "modulate_x4")
+            return LBX_MODULATE_X4;
+        else if (param == "add")
+            return LBX_ADD;
+        else if (param == "add_signed")
+            return LBX_ADD_SIGNED;
+        else if (param == "add_smooth")
+            return LBX_ADD_SMOOTH;
+        else if (param == "subtract")
+            return LBX_SUBTRACT;
+        else if (param == "blend_diffuse_colour")
+            return LBX_BLEND_DIFFUSE_COLOUR;
+        else if (param == "blend_diffuse_alpha")
+            return LBX_BLEND_DIFFUSE_ALPHA;
+        else if (param == "blend_texture_alpha")
+            return LBX_BLEND_TEXTURE_ALPHA;
+        else if (param == "blend_current_alpha")
+            return LBX_BLEND_CURRENT_ALPHA;
+        else if (param == "blend_manual")
+            return LBX_BLEND_MANUAL;
+        else if (param == "dotproduct")
+            return LBX_DOTPRODUCT;
+        else
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Invalid blend function", "convertBlendOpEx");
+    }
+    //-----------------------------------------------------------------------
+    LayerBlendSource convertBlendSource(const String& param)
+    {
+        if (param == "src_current")
+            return LBS_CURRENT;
+        else if (param == "src_texture")
+            return LBS_TEXTURE;
+        else if (param == "src_diffuse")
+            return LBS_DIFFUSE;
+        else if (param == "src_specular")
+            return LBS_SPECULAR;
+        else if (param == "src_manual")
+            return LBS_MANUAL;
+        else
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Invalid blend source", "convertBlendSource");
+    }
+    //-----------------------------------------------------------------------
+    bool parseColourOpEx(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        StringVector vecparams = StringUtil::split(params, " \t");
+        size_t numParams = vecparams.size();
+
+        if (numParams < 3 || numParams > 10)
+        {
+            logParseError(
+                "Bad colour_op_ex attribute, wrong number of parameters (expected 3 to 10)",
+                context);
+            return false;
+        }
+        LayerBlendOperationEx op;
+        LayerBlendSource src1, src2;
+        Real manual = 0.0;
+        ColourValue colSrc1 = ColourValue::White;
+        ColourValue colSrc2 = ColourValue::White;
+
+        try {
+            op = convertBlendOpEx(vecparams[0]);
+            src1 = convertBlendSource(vecparams[1]);
+            src2 = convertBlendSource(vecparams[2]);
+
+            if (op == LBX_BLEND_MANUAL)
+            {
+                if (numParams < 4)
+                {
+                    logParseError("Bad colour_op_ex attribute, wrong number of parameters "
+                        "(expected 4 for manual blend)", context);
+                    return false;
+                }
+                manual = StringConverter::parseReal(vecparams[3]);
+            }
+
+            if (src1 == LBS_MANUAL)
+            {
+                unsigned int parIndex = 3;
+                if (op == LBX_BLEND_MANUAL)
+                    parIndex++;
+
+                if (numParams < parIndex + 3)
+                {
+                    logParseError("Bad colour_op_ex attribute, wrong number of parameters "
+                        "(expected " + StringConverter::toString(parIndex + 3) + ")", context);
+                    return false;
+                }
+
+                colSrc1.r = StringConverter::parseReal(vecparams[parIndex++]);
+                colSrc1.g = StringConverter::parseReal(vecparams[parIndex++]);
+                colSrc1.b = StringConverter::parseReal(vecparams[parIndex++]);
+                if (numParams > parIndex)
+                {
+                    colSrc1.a = StringConverter::parseReal(vecparams[parIndex]);
+                }
+                else
+                {
+                    colSrc1.a = 1.0f;
+                }
+            }
+
+            if (src2 == LBS_MANUAL)
+            {
+                unsigned int parIndex = 3;
+                if (op == LBX_BLEND_MANUAL)
+                    parIndex++;
+                if (src1 == LBS_MANUAL)
+                    parIndex += 3;
+
+                if (numParams < parIndex + 3)
+                {
+                    logParseError("Bad colour_op_ex attribute, wrong number of parameters "
+                        "(expected " + StringConverter::toString(parIndex + 3) + ")", context);
+                    return false;
+                }
+
+                colSrc2.r = StringConverter::parseReal(vecparams[parIndex++]);
+                colSrc2.g = StringConverter::parseReal(vecparams[parIndex++]);
+                colSrc2.b = StringConverter::parseReal(vecparams[parIndex++]);
+                if (numParams > parIndex)
+                {
+                    colSrc2.a = StringConverter::parseReal(vecparams[parIndex]);
+                }
+                else
+                {
+                    colSrc2.a = 1.0f;
+                }
+            }
+        }
+        catch (Exception& e)
+        {
+            logParseError("Bad colour_op_ex attribute, " + e.getDescription(), context);
+            return false;
+        }
+
+        context.textureUnit->setColourOperationEx(op, src1, src2, colSrc1, colSrc2, manual);
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseColourOpFallback(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        StringVector vecparams = StringUtil::split(params, " \t");
+        if (vecparams.size() != 2)
+        {
+            logParseError("Bad colour_op_multipass_fallback attribute, wrong number "
+                "of parameters (expected 2)", context);
+            return false;
+        }
+
+        //src/dest
+        SceneBlendFactor src, dest;
+
+        try {
+            src = convertBlendFactor(vecparams[0]);
+            dest = convertBlendFactor(vecparams[1]);
+            context.textureUnit->setColourOpMultipassFallback(src,dest);
+        }
+        catch (Exception& e)
+        {
+            logParseError("Bad colour_op_multipass_fallback attribute, "
+                + e.getDescription(), context);
+        }
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseAlphaOpEx(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        StringVector vecparams = StringUtil::split(params, " \t");
+        size_t numParams = vecparams.size();
+        if (numParams < 3 || numParams > 6)
+        {
+            logParseError("Bad alpha_op_ex attribute, wrong number of parameters "
+                "(expected 3 to 6)", context);
+            return false;
+        }
+        LayerBlendOperationEx op;
+        LayerBlendSource src1, src2;
+        Real manual = 0.0;
+        Real arg1 = 1.0, arg2 = 1.0;
+
+        try {
+            op = convertBlendOpEx(vecparams[0]);
+            src1 = convertBlendSource(vecparams[1]);
+            src2 = convertBlendSource(vecparams[2]);
+            if (op == LBX_BLEND_MANUAL)
+            {
+                if (numParams != 4)
+                {
+                    logParseError("Bad alpha_op_ex attribute, wrong number of parameters "
+                        "(expected 4 for manual blend)", context);
+                    return false;
+                }
+                manual = StringConverter::parseReal(vecparams[3]);
+            }
+            if (src1 == LBS_MANUAL)
+            {
+                unsigned int parIndex = 3;
+                if (op == LBX_BLEND_MANUAL)
+                    parIndex++;
+
+                if (numParams < parIndex)
+                {
+                    logParseError(
+                        "Bad alpha_op_ex attribute, wrong number of parameters (expected " +
+                        StringConverter::toString(parIndex - 1) + ")", context);
+                    return false;
+                }
+
+                arg1 = StringConverter::parseReal(vecparams[parIndex]);
+            }
+
+            if (src2 == LBS_MANUAL)
+            {
+                unsigned int parIndex = 3;
+                if (op == LBX_BLEND_MANUAL)
+                    parIndex++;
+                if (src1 == LBS_MANUAL)
+                    parIndex++;
+
+                if (numParams < parIndex)
+                {
+                    logParseError(
+                        "Bad alpha_op_ex attribute, wrong number of parameters "
+                        "(expected " + StringConverter::toString(parIndex - 1) + ")", context);
+                    return false;
+                }
+
+                arg2 = StringConverter::parseReal(vecparams[parIndex]);
+            }
+        }
+        catch (Exception& e)
+        {
+            logParseError("Bad alpha_op_ex attribute, " + e.getDescription(), context);
+            return false;
+        }
+
+        context.textureUnit->setAlphaOperation(op, src1, src2, arg1, arg2, manual);
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseEnvMap(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        if (params=="off")
+            context.textureUnit->setEnvironmentMap(false);
+        else if (params=="spherical")
+            context.textureUnit->setEnvironmentMap(true, TextureUnitState::ENV_CURVED);
+        else if (params=="planar")
+            context.textureUnit->setEnvironmentMap(true, TextureUnitState::ENV_PLANAR);
+        else if (params=="cubic_reflection")
+            context.textureUnit->setEnvironmentMap(true, TextureUnitState::ENV_REFLECTION);
+        else if (params=="cubic_normal")
+            context.textureUnit->setEnvironmentMap(true, TextureUnitState::ENV_NORMAL);
+        else
+            logParseError("Bad env_map attribute, valid parameters are 'off', "
+                "'spherical', 'planar', 'cubic_reflection' and 'cubic_normal'.", context);
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseScroll(String& params, MaterialScriptContext& context)
+    {
+        StringVector vecparams = StringUtil::split(params, " \t");
+        if (vecparams.size() != 2)
+        {
+            logParseError("Bad scroll attribute, wrong number of parameters (expected 2)", context);
+            return false;
+        }
+        context.textureUnit->setTextureScroll(
+            StringConverter::parseReal(vecparams[0]),
+            StringConverter::parseReal(vecparams[1]));
+
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseScrollAnim(String& params, MaterialScriptContext& context)
+    {
+        StringVector vecparams = StringUtil::split(params, " \t");
+        if (vecparams.size() != 2)
+        {
+            logParseError("Bad scroll_anim attribute, wrong number of "
+                "parameters (expected 2)", context);
+            return false;
+        }
+        context.textureUnit->setScrollAnimation(
+            StringConverter::parseReal(vecparams[0]),
+            StringConverter::parseReal(vecparams[1]));
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseRotate(String& params, MaterialScriptContext& context)
+    {
+        context.textureUnit->setTextureRotate(
+            StringConverter::parseAngle(params));
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseRotateAnim(String& params, MaterialScriptContext& context)
+    {
+        context.textureUnit->setRotateAnimation(
+            StringConverter::parseReal(params));
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseScale(String& params, MaterialScriptContext& context)
+    {
+        StringVector vecparams = StringUtil::split(params, " \t");
+        if (vecparams.size() != 2)
+        {
+            logParseError("Bad scale attribute, wrong number of parameters (expected 2)", context);
+            return false;
+        }
+        context.textureUnit->setTextureScale(
+            StringConverter::parseReal(vecparams[0]),
+            StringConverter::parseReal(vecparams[1]));
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseWaveXform(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        StringVector vecparams = StringUtil::split(params, " \t");
+
+        if (vecparams.size() != 6)
+        {
+            logParseError("Bad wave_xform attribute, wrong number of parameters "
+                "(expected 6)", context);
+            return false;
+        }
+        TextureUnitState::TextureTransformType ttype;
+        WaveformType waveType;
+        // Check transform type
+        if (vecparams[0]=="scroll_x")
+            ttype = TextureUnitState::TT_TRANSLATE_U;
+        else if (vecparams[0]=="scroll_y")
+            ttype = TextureUnitState::TT_TRANSLATE_V;
+        else if (vecparams[0]=="rotate")
+            ttype = TextureUnitState::TT_ROTATE;
+        else if (vecparams[0]=="scale_x")
+            ttype = TextureUnitState::TT_SCALE_U;
+        else if (vecparams[0]=="scale_y")
+            ttype = TextureUnitState::TT_SCALE_V;
+        else
+        {
+            logParseError("Bad wave_xform attribute, parameter 1 must be 'scroll_x', "
+                "'scroll_y', 'rotate', 'scale_x' or 'scale_y'", context);
+            return false;
+        }
+        // Check wave type
+        if (vecparams[1]=="sine")
+            waveType = WFT_SINE;
+        else if (vecparams[1]=="triangle")
+            waveType = WFT_TRIANGLE;
+        else if (vecparams[1]=="square")
+            waveType = WFT_SQUARE;
+        else if (vecparams[1]=="sawtooth")
+            waveType = WFT_SAWTOOTH;
+        else if (vecparams[1]=="inverse_sawtooth")
+            waveType = WFT_INVERSE_SAWTOOTH;
+        else
+        {
+            logParseError("Bad wave_xform attribute, parameter 2 must be 'sine', "
+                "'triangle', 'square', 'sawtooth' or 'inverse_sawtooth'", context);
+            return false;
+        }
+
+        context.textureUnit->setTransformAnimation(
+            ttype,
+            waveType,
+            StringConverter::parseReal(vecparams[2]),
+            StringConverter::parseReal(vecparams[3]),
+            StringConverter::parseReal(vecparams[4]),
+            StringConverter::parseReal(vecparams[5]) );
+
+        return false;
+    }
+	//-----------------------------------------------------------------------
+	bool parseTransform(String& params, MaterialScriptContext& context)
+	{
+		StringVector vecparams = StringUtil::split(params, " \t");
+		if (vecparams.size() != 16)
+		{
+			logParseError("Bad transform attribute, wrong number of parameters (expected 16)", context);
+			return false;
+		}
+		Matrix4 xform(
+			StringConverter::parseReal(vecparams[0]),
+			StringConverter::parseReal(vecparams[1]),
+			StringConverter::parseReal(vecparams[2]),
+			StringConverter::parseReal(vecparams[3]),
+			StringConverter::parseReal(vecparams[4]),
+			StringConverter::parseReal(vecparams[5]),
+			StringConverter::parseReal(vecparams[6]),
+			StringConverter::parseReal(vecparams[7]),
+			StringConverter::parseReal(vecparams[8]),
+			StringConverter::parseReal(vecparams[9]),
+			StringConverter::parseReal(vecparams[10]),
+			StringConverter::parseReal(vecparams[11]),
+			StringConverter::parseReal(vecparams[12]),
+			StringConverter::parseReal(vecparams[13]),
+			StringConverter::parseReal(vecparams[14]),
+			StringConverter::parseReal(vecparams[15]) );
+		context.textureUnit->setTextureTransform(xform);
+
+
+		return false;
+	}
+    //-----------------------------------------------------------------------
+    bool parseDepthBias(String& params, MaterialScriptContext& context)
+    {
+		StringVector vecparams = StringUtil::split(params, " \t");
+
+		float constantBias = static_cast<float>(StringConverter::parseReal(vecparams[0]));
+		float slopeScaleBias = 0.0f;
+		if (vecparams.size() > 1)
+		{
+			slopeScaleBias = static_cast<float>(StringConverter::parseReal(vecparams[1]));
+		}
+        context.pass->setDepthBias(constantBias, slopeScaleBias);
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseAnisotropy(String& params, MaterialScriptContext& context)
+    {
+        context.textureUnit->setTextureAnisotropy(
+            StringConverter::parseInt(params));
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseTextureAlias(String& params, MaterialScriptContext& context)
+    {
+        context.textureUnit->setTextureNameAlias(params);
+
+        return false;
+    }
+	//-----------------------------------------------------------------------
+	bool parseMipmapBias(String& params, MaterialScriptContext& context)
+	{
+		context.textureUnit->setTextureMipmapBias(
+			(float)StringConverter::parseReal(params));
+
+		return false;
+	}
+	//-----------------------------------------------------------------------
+	bool parseContentType(String& params, MaterialScriptContext& context)
+	{
+		if (params == "named")
+		{
+			context.textureUnit->setContentType(TextureUnitState::CONTENT_NAMED);
+		}
+		else if (params == "shadow")
+		{
+			context.textureUnit->setContentType(TextureUnitState::CONTENT_SHADOW);
+		}
+		else
+		{
+			logParseError("Invalid content_type specified.", context);
+		}
+		return false;
+	}
+    //-----------------------------------------------------------------------
+    bool parseLodDistances(String& params, MaterialScriptContext& context)
+    {
+        StringVector vecparams = StringUtil::split(params, " \t");
+
+        // iterate over the parameters and parse distances out of them
+        Material::LodDistanceList lodList;
+        StringVector::iterator i, iend;
+        iend = vecparams.end();
+        for (i = vecparams.begin(); i != iend; ++i)
+        {
+            lodList.push_back(StringConverter::parseReal(*i));
+        }
+
+        context.material->setLodLevels(lodList);
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseLodIndex(String& params, MaterialScriptContext& context)
+    {
+        context.technique->setLodIndex(StringConverter::parseInt(params));
+        return false;
+    }
+	//-----------------------------------------------------------------------
+	bool parseScheme(String& params, MaterialScriptContext& context)
+	{
+		context.technique->setSchemeName(params);
+		return false;
+	}
+    //-----------------------------------------------------------------------
+    bool parseSetTextureAlias(String& params, MaterialScriptContext& context)
+    {
+        StringVector vecparams = StringUtil::split(params, " \t");
+        if (vecparams.size() != 2)
+        {
+            logParseError("Wrong number of parameters for texture_alias, expected 2", context);
+            return false;
+        }
+        // first parameter is alias name and second paramater is texture name
+        context.textureAliases[vecparams[0]] = vecparams[1];
+
+        return false;
+    }
+
+    //-----------------------------------------------------------------------
+	void processManualProgramParam(bool isNamed, const String commandname,
+		StringVector& vecparams, MaterialScriptContext& context,
+		size_t index = 0, const String& paramName = StringUtil::BLANK)
+    {
+        // NB we assume that the first element of vecparams is taken up with either
+        // the index or the parameter name, which we ignore
+
+        // Determine type
+        size_t start, dims, roundedDims, i;
+        bool isReal;
+        bool isMatrix4x4 = false;
+
+        StringUtil::toLowerCase(vecparams[1]);
+
+        if (vecparams[1] == "matrix4x4")
+        {
+            dims = 16;
+            isReal = true;
+            isMatrix4x4 = true;
+        }
+        else if ((start = vecparams[1].find("float")) != String::npos)
+        {
+            // find the dimensionality
+            start = vecparams[1].find_first_not_of("float");
+            // Assume 1 if not specified
+            if (start == String::npos)
+            {
+                dims = 1;
+            }
+            else
+            {
+                dims = StringConverter::parseInt(vecparams[1].substr(start));
+            }
+            isReal = true;
+        }
+        else if ((start = vecparams[1].find("int")) != String::npos)
+        {
+            // find the dimensionality
+            start = vecparams[1].find_first_not_of("int");
+            // Assume 1 if not specified
+            if (start == String::npos)
+            {
+                dims = 1;
+            }
+            else
+            {
+                dims = StringConverter::parseInt(vecparams[1].substr(start));
+            }
+            isReal = false;
+        }
+        else
+        {
+            logParseError("Invalid " + commandname + " attribute - unrecognised "
+                "parameter type " + vecparams[1], context);
+            return;
+        }
+
+        if (vecparams.size() != 2 + dims)
+        {
+            logParseError("Invalid " + commandname + " attribute - you need " +
+                StringConverter::toString(2 + dims) + " parameters for a parameter of "
+                "type " + vecparams[1], context);
+        }
+
+		// clear any auto parameter bound to this constant, it would override this setting
+		// can cause problems overriding materials or changing default params
+		if (isNamed)
+			context.programParams->clearNamedAutoConstant(paramName);
+		else
+			context.programParams->clearAutoConstant(index);
+
+
+		// Round dims to multiple of 4
+		if (dims %4 != 0)
+		{
+			roundedDims = dims + 4 - (dims % 4);
+		}
+		else
+		{
+			roundedDims = dims;
+		}
+
+		// Now parse all the values
+        if (isReal)
+        {
+            Real* realBuffer = new Real[roundedDims];
+            // Do specified values
+            for (i = 0; i < dims; ++i)
+            {
+                realBuffer[i] = StringConverter::parseReal(vecparams[i+2]);
+            }
+			// Fill up to multiple of 4 with zero
+			for (; i < roundedDims; ++i)
+			{
+				realBuffer[i] = 0.0f;
+
+			}
+
+            if (isMatrix4x4)
+            {
+                // its a Matrix4x4 so pass as a Matrix4
+                // use specialized setConstant that takes a matrix so matrix is transposed if required
+                Matrix4 m4x4(
+                    realBuffer[0],  realBuffer[1],  realBuffer[2],  realBuffer[3],
+                    realBuffer[4],  realBuffer[5],  realBuffer[6],  realBuffer[7],
+                    realBuffer[8],  realBuffer[9],  realBuffer[10], realBuffer[11],
+                    realBuffer[12], realBuffer[13], realBuffer[14], realBuffer[15]
+                    );
+				if (isNamed)
+					context.programParams->setNamedConstant(paramName, m4x4);
+				else
+					context.programParams->setConstant(index, m4x4);
+            }
+            else
+            {
+                // Set
+				if (isNamed)
+				{
+					// For named, only set up to the precise number of elements
+					// (no rounding to 4 elements)
+					// GLSL can support sub-float4 elements and we support that
+					// in the buffer now. Note how we set the 'multiple' param to 1
+					context.programParams->setNamedConstant(paramName, realBuffer,
+						dims, 1);
+				}
+				else
+				{
+					context.programParams->setConstant(index, realBuffer,
+						static_cast<size_t>(roundedDims * 0.25));
+				}
+
+            }
+
+
+            delete [] realBuffer;
+        }
+        else
+        {
+            int* intBuffer = new int[roundedDims];
+            // Do specified values
+            for (i = 0; i < dims; ++i)
+            {
+                intBuffer[i] = StringConverter::parseInt(vecparams[i+2]);
+            }
+			// Fill to multiple of 4 with 0
+			for (; i < roundedDims; ++i)
+			{
+				intBuffer[i] = 0;
+			}
+            // Set
+			if (isNamed)
+			{
+				// For named, only set up to the precise number of elements
+				// (no rounding to 4 elements)
+				// GLSL can support sub-float4 elements and we support that
+				// in the buffer now. Note how we set the 'multiple' param to 1
+				context.programParams->setNamedConstant(paramName, intBuffer,
+					dims, 1);
+			}
+			else
+			{
+				context.programParams->setConstant(index, intBuffer,
+					static_cast<size_t>(roundedDims * 0.25));
+			}
+            delete [] intBuffer;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void processAutoProgramParam(bool isNamed, const String& commandname,
+        StringVector& vecparams, MaterialScriptContext& context,
+		size_t index = 0, const String& paramName = StringUtil::BLANK)
+    {
+        // NB we assume that the first element of vecparams is taken up with either
+        // the index or the parameter name, which we ignore
+
+        // make sure param is in lower case
+        StringUtil::toLowerCase(vecparams[1]);
+
+        // lookup the param to see if its a valid auto constant
+        const GpuProgramParameters::AutoConstantDefinition* autoConstantDef =
+            context.programParams->getAutoConstantDefinition(vecparams[1]);
+
+        // exit with error msg if the auto constant definition wasn't found
+        if (!autoConstantDef)
+		{
+			logParseError("Invalid " + commandname + " attribute - "
+				+ vecparams[1], context);
+			return;
+		}
+
+        // add AutoConstant based on the type of data it uses
+        switch (autoConstantDef->dataType)
+        {
+        case GpuProgramParameters::ACDT_NONE:
+			if (isNamed)
+				context.programParams->setNamedAutoConstant(paramName, autoConstantDef->acType, 0);
+			else
+	            context.programParams->setAutoConstant(index, autoConstantDef->acType, 0);
+            break;
+
+        case GpuProgramParameters::ACDT_INT:
+            {
+				// Special case animation_parametric, we need to keep track of number of times used
+				if (autoConstantDef->acType == GpuProgramParameters::ACT_ANIMATION_PARAMETRIC)
+				{
+					if (isNamed)
+						context.programParams->setNamedAutoConstant(
+							paramName, autoConstantDef->acType, context.numAnimationParametrics++);
+					else
+						context.programParams->setAutoConstant(
+							index, autoConstantDef->acType, context.numAnimationParametrics++);
+				}
+				// Special case texture projector - assume 0 if data not specified
+				else if (autoConstantDef->acType == GpuProgramParameters::ACT_TEXTURE_VIEWPROJ_MATRIX
+					&& vecparams.size() == 2)
+				{
+					if (isNamed)
+						context.programParams->setNamedAutoConstant(
+							paramName, autoConstantDef->acType, 0);
+					else
+						context.programParams->setAutoConstant(
+							index, autoConstantDef->acType, 0);
+
+				}
+				else
+				{
+
+					if (vecparams.size() != 3)
+					{
+						logParseError("Invalid " + commandname + " attribute - "
+							"expected 3 parameters.", context);
+						return;
+					}
+
+					size_t extraParam = StringConverter::parseInt(vecparams[2]);
+					if (isNamed)
+						context.programParams->setNamedAutoConstant(
+							paramName, autoConstantDef->acType, extraParam);
+					else
+						context.programParams->setAutoConstant(
+							index, autoConstantDef->acType, extraParam);
+				}
+            }
+            break;
+
+        case GpuProgramParameters::ACDT_REAL:
+            {
+                // special handling for time
+                if (autoConstantDef->acType == GpuProgramParameters::ACT_TIME ||
+                    autoConstantDef->acType == GpuProgramParameters::ACT_FRAME_TIME)
+                {
+                    Real factor = 1.0f;
+                    if (vecparams.size() == 3)
+                    {
+                        factor = StringConverter::parseReal(vecparams[2]);
+                    }
+
+					if (isNamed)
+						context.programParams->setNamedAutoConstantReal(paramName, 
+							autoConstantDef->acType, factor);
+					else
+	                    context.programParams->setAutoConstantReal(index, 
+							autoConstantDef->acType, factor);
+                }
+                else // normal processing for auto constants that take an extra real value
+                {
+                    if (vecparams.size() != 3)
+                    {
+                        logParseError("Invalid " + commandname + " attribute - "
+                            "expected 3 parameters.", context);
+                        return;
+                    }
+
+			        Real rData = StringConverter::parseReal(vecparams[2]);
+					if (isNamed)
+						context.programParams->setNamedAutoConstantReal(paramName, 
+							autoConstantDef->acType, rData);
+					else
+						context.programParams->setAutoConstantReal(index, 
+							autoConstantDef->acType, rData);
+                }
+            }
+            break;
+
+        } // end switch
+
+
+    }
+
+    //-----------------------------------------------------------------------
+    bool parseParamIndexed(String& params, MaterialScriptContext& context)
+    {
+        // NB skip this if the program is not supported or could not be found
+        if (context.program.isNull() || !context.program->isSupported())
+        {
+            return false;
+        }
+
+        StringUtil::toLowerCase(params);
+        StringVector vecparams = StringUtil::split(params, " \t");
+        if (vecparams.size() < 3)
+        {
+            logParseError("Invalid param_indexed attribute - expected at least 3 parameters.",
+                context);
+            return false;
+        }
+
+        // Get start index
+        size_t index = StringConverter::parseInt(vecparams[0]);
+
+        processManualProgramParam(false, "param_indexed", vecparams, context, index);
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseParamIndexedAuto(String& params, MaterialScriptContext& context)
+    {
+        // NB skip this if the program is not supported or could not be found
+        if (context.program.isNull() || !context.program->isSupported())
+        {
+            return false;
+        }
+
+        StringUtil::toLowerCase(params);
+        StringVector vecparams = StringUtil::split(params, " \t");
+        if (vecparams.size() != 2 && vecparams.size() != 3)
+        {
+            logParseError("Invalid param_indexed_auto attribute - expected 2 or 3 parameters.",
+                context);
+            return false;
+        }
+
+        // Get start index
+        size_t index = StringConverter::parseInt(vecparams[0]);
+
+        processAutoProgramParam(false, "param_indexed_auto", vecparams, context, index);
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseParamNamed(String& params, MaterialScriptContext& context)
+    {
+        // NB skip this if the program is not supported or could not be found
+        if (context.program.isNull() || !context.program->isSupported())
+        {
+            return false;
+        }
+
+        StringVector vecparams = StringUtil::split(params, " \t");
+        if (vecparams.size() < 3)
+        {
+            logParseError("Invalid param_named attribute - expected at least 3 parameters.",
+                context);
+            return false;
+        }
+
+        try {
+			const GpuConstantDefinition& def = 
+				context.programParams->getConstantDefinition(vecparams[0]);
+        }
+        catch (Exception& e)
+        {
+            logParseError("Invalid param_named attribute - " + e.getDescription(), context);
+            return false;
+        }
+
+        processManualProgramParam(true, "param_named", vecparams, context, 0, vecparams[0]);
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseParamNamedAuto(String& params, MaterialScriptContext& context)
+    {
+        // NB skip this if the program is not supported or could not be found
+        if (context.program.isNull() || !context.program->isSupported())
+        {
+            return false;
+        }
+
+        StringVector vecparams = StringUtil::split(params, " \t");
+        if (vecparams.size() != 2 && vecparams.size() != 3)
+        {
+            logParseError("Invalid param_indexed_auto attribute - expected 2 or 3 parameters.",
+                context);
+            return false;
+        }
+
+        // Get start index from name
+        try {
+			const GpuConstantDefinition& def = 
+				context.programParams->getConstantDefinition(vecparams[0]);
+        }
+        catch (Exception& e)
+        {
+            logParseError("Invalid param_named_auto attribute - " + e.getDescription(), context);
+            return false;
+        }
+
+        processAutoProgramParam(true, "param_named_auto", vecparams, context, 0, vecparams[0]);
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    bool parseMaterial(String& params, MaterialScriptContext& context)
+    {
+        // nfz:
+        // check params for reference to parent material to copy from
+        // syntax: material name : parentMaterialName
+        // check params for a colon after the first name and extract the parent name
+        StringVector vecparams = StringUtil::split(params, ":", 1);
+        MaterialPtr basematerial;
+
+        // Create a brand new material
+        if (vecparams.size() >= 2)
+        {
+            // if a second parameter exists then assume its the name of the base material
+            // that this new material should clone from
+            StringUtil::trim(vecparams[1]);
+            // make sure base material exists
+            basematerial = MaterialManager::getSingleton().getByName(vecparams[1]);
+            // if it doesn't exist then report error in log and just create a new material
+            if (basematerial.isNull())
+            {
+                logParseError("parent material: " + vecparams[1] + " not found for new material:"
+                    + vecparams[0], context);
+            }
+        }
+
+        // get rid of leading and trailing white space from material name
+        StringUtil::trim(vecparams[0]);
+
+        context.material =
+			MaterialManager::getSingleton().create(vecparams[0], context.groupName);
+
+        if (!basematerial.isNull())
+        {
+            // copy parent material details to new material
+            basematerial->copyDetailsTo(context.material);
+        }
+        else
+        {
+            // Remove pre-created technique from defaults
+            context.material->removeAllTechniques();
+        }
+
+		context.material->_notifyOrigin(context.filename);
+
+        // update section
+        context.section = MSS_MATERIAL;
+
+        // Return TRUE because this must be followed by a {
+        return true;
+    }
+    //-----------------------------------------------------------------------
+    bool parseTechnique(String& params, MaterialScriptContext& context)
+    {
+
+        // if params is not empty then see if the technique name already exists
+        if (!params.empty() && (context.material->getNumTechniques() > 0))
+        {
+            // find the technique with name = params
+            Technique * foundTechnique = context.material->getTechnique(params);
+            if (foundTechnique)
+            {
+                // figure out technique index by iterating through technique container
+                // would be nice if each technique remembered its index
+                int count = 0;
+                Material::TechniqueIterator i = context.material->getTechniqueIterator();
+                while(i.hasMoreElements())
+                {
+                    if (foundTechnique == i.peekNext())
+                        break;
+                    i.moveNext();
+                    ++count;
+                }
+
+                context.techLev = count;
+            }
+            else
+            {
+                // name was not found so a new technique is needed
+                // position technique level to the end index
+                // a new technique will be created later on
+                context.techLev = context.material->getNumTechniques();
+            }
+
+        }
+        else
+        {
+            // no name was given in the script so a new technique will be created
+		    // Increase technique level depth
+		    ++context.techLev;
+        }
+
+        // Create a new technique if it doesn't already exist
+        if (context.material->getNumTechniques() > context.techLev)
+        {
+            context.technique = context.material->getTechnique(context.techLev);
+        }
+        else
+        {
+            context.technique = context.material->createTechnique();
+            if (!params.empty())
+                context.technique->setName(params);
+        }
+
+        // update section
+        context.section = MSS_TECHNIQUE;
+
+        // Return TRUE because this must be followed by a {
+        return true;
+    }
+    //-----------------------------------------------------------------------
+    bool parsePass(String& params, MaterialScriptContext& context)
+    {
+        // if params is not empty then see if the pass name already exists
+        if (!params.empty() && (context.technique->getNumPasses() > 0))
+        {
+            // find the pass with name = params
+            Pass * foundPass = context.technique->getPass(params);
+            if (foundPass)
+            {
+                context.passLev = foundPass->getIndex();
+            }
+            else
+            {
+                // name was not found so a new pass is needed
+                // position pass level to the end index
+                // a new pass will be created later on
+                context.passLev = context.technique->getNumPasses();
+            }
+
+        }
+        else
+        {
+		    //Increase pass level depth
+		    ++context.passLev;
+        }
+
+        if (context.technique->getNumPasses() > context.passLev)
+        {
+            context.pass = context.technique->getPass(context.passLev);
+        }
+        else
+        {
+            // Create a new pass
+            context.pass = context.technique->createPass();
+            if (!params.empty())
+                context.pass->setName(params);
+        }
+
+        // update section
+        context.section = MSS_PASS;
+
+        // Return TRUE because this must be followed by a {
+        return true;
+    }
+    //-----------------------------------------------------------------------
+    bool parseTextureUnit(String& params, MaterialScriptContext& context)
+    {
+        // if params is a name then see if that texture unit exists
+        // if not then log the warning and just move on to the next TU from current
+        if (!params.empty() && (context.pass->getNumTextureUnitStates() > 0))
+        {
+            // specifying a TUS name in the script for a TU means that a specific TU is being requested
+            // try to get the specific TU
+            // if the index requested is not valid, just creat a new TU
+            // find the TUS with name = params
+            TextureUnitState * foundTUS = context.pass->getTextureUnitState(params);
+            if (foundTUS)
+            {
+                context.stateLev = context.pass->getTextureUnitStateIndex(foundTUS);
+            }
+            else
+            {
+                // name was not found so a new TUS is needed
+                // position TUS level to the end index
+                // a new TUS will be created later on
+                context.stateLev = static_cast<int>(context.pass->getNumTextureUnitStates());
+            }
+        }
+        else
+        {
+		    //Increase Texture Unit State level depth
+		    ++context.stateLev;
+        }
+
+        if (context.pass->getNumTextureUnitStates() > static_cast<size_t>(context.stateLev))
+        {
+            context.textureUnit = context.pass->getTextureUnitState(context.stateLev);
+        }
+        else
+        {
+            // Create a new texture unit
+            context.textureUnit = context.pass->createTextureUnitState();
+            if (!params.empty())
+                context.textureUnit->setName(params);
+        }
+        // update section
+        context.section = MSS_TEXTUREUNIT;
+
+        // Return TRUE because this must be followed by a {
+        return true;
+    }
+
+    //-----------------------------------------------------------------------
+    bool parseVertexProgramRef(String& params, MaterialScriptContext& context)
+    {
+        // update section
+        context.section = MSS_PROGRAM_REF;
+
+        // check if pass has a vertex program already
+        if (context.pass->hasVertexProgram())
+        {
+            // if existing pass vertex program has same name as params
+            // or params is empty then use current vertex program
+            if (params.empty() || (context.pass->getVertexProgramName() == params))
+            {
+                context.program = context.pass->getVertexProgram();
+            }
+        }
+
+        // if context.program was not set then try to get the vertex program using the name
+        // passed in params
+        if (context.program.isNull())
+        {
+            context.program = GpuProgramManager::getSingleton().getByName(params);
+            if (context.program.isNull())
+            {
+                // Unknown program
+                logParseError("Invalid vertex_program_ref entry - vertex program "
+                    + params + " has not been defined.", context);
+                return true;
+            }
+
+            // Set the vertex program for this pass
+            context.pass->setVertexProgram(params);
+        }
+
+        context.isProgramShadowCaster = false;
+        context.isVertexProgramShadowReceiver = false;
+        context.isFragmentProgramShadowReceiver = false;
+
+        // Create params? Skip this if program is not supported
+        if (context.program->isSupported())
+        {
+            context.programParams = context.pass->getVertexProgramParameters();
+			context.numAnimationParametrics = 0;
+        }
+
+        // Return TRUE because this must be followed by a {
+        return true;
+    }
+    //-----------------------------------------------------------------------
+    bool parseShadowCasterVertexProgramRef(String& params, MaterialScriptContext& context)
+    {
+        // update section
+        context.section = MSS_PROGRAM_REF;
+
+        context.program = GpuProgramManager::getSingleton().getByName(params);
+        if (context.program.isNull())
+        {
+            // Unknown program
+            logParseError("Invalid shadow_caster_vertex_program_ref entry - vertex program "
+                + params + " has not been defined.", context);
+            return true;
+        }
+
+        context.isProgramShadowCaster = true;
+        context.isVertexProgramShadowReceiver = false;
+		context.isFragmentProgramShadowReceiver = false;
+
+        // Set the vertex program for this pass
+        context.pass->setShadowCasterVertexProgram(params);
+
+        // Create params? Skip this if program is not supported
+        if (context.program->isSupported())
+        {
+            context.programParams = context.pass->getShadowCasterVertexProgramParameters();
+			context.numAnimationParametrics = 0;
+        }
+
+        // Return TRUE because this must be followed by a {
+        return true;
+    }
+    //-----------------------------------------------------------------------
+    bool parseShadowReceiverVertexProgramRef(String& params, MaterialScriptContext& context)
+    {
+        // update section
+        context.section = MSS_PROGRAM_REF;
+
+        context.program = GpuProgramManager::getSingleton().getByName(params);
+        if (context.program.isNull())
+        {
+            // Unknown program
+            logParseError("Invalid shadow_receiver_vertex_program_ref entry - vertex program "
+                + params + " has not been defined.", context);
+            return true;
+        }
+
+
+        context.isProgramShadowCaster = false;
+        context.isVertexProgramShadowReceiver = true;
+		context.isFragmentProgramShadowReceiver = false;
+
+        // Set the vertex program for this pass
+        context.pass->setShadowReceiverVertexProgram(params);
+
+        // Create params? Skip this if program is not supported
+        if (context.program->isSupported())
+        {
+            context.programParams = context.pass->getShadowReceiverVertexProgramParameters();
+			context.numAnimationParametrics = 0;
+        }
+
+        // Return TRUE because this must be followed by a {
+        return true;
+    }
+	//-----------------------------------------------------------------------
+	bool parseShadowReceiverFragmentProgramRef(String& params, MaterialScriptContext& context)
+	{
+		// update section
+		context.section = MSS_PROGRAM_REF;
+
+		context.program = GpuProgramManager::getSingleton().getByName(params);
+		if (context.program.isNull())
+		{
+			// Unknown program
+			logParseError("Invalid shadow_receiver_fragment_program_ref entry - fragment program "
+				+ params + " has not been defined.", context);
+			return true;
+		}
+
+
+		context.isProgramShadowCaster = false;
+		context.isVertexProgramShadowReceiver = false;
+		context.isFragmentProgramShadowReceiver = true;
+
+		// Set the vertex program for this pass
+		context.pass->setShadowReceiverFragmentProgram(params);
+
+		// Create params? Skip this if program is not supported
+		if (context.program->isSupported())
+		{
+			context.programParams = context.pass->getShadowReceiverFragmentProgramParameters();
+			context.numAnimationParametrics = 0;
+		}
+
+		// Return TRUE because this must be followed by a {
+		return true;
+	}
+    //-----------------------------------------------------------------------
+    bool parseFragmentProgramRef(String& params, MaterialScriptContext& context)
+    {
+        // update section
+        context.section = MSS_PROGRAM_REF;
+
+        // check if pass has a fragment program already
+        if (context.pass->hasFragmentProgram())
+        {
+            // if existing pass fragment program has same name as params
+            // or params is empty then use current fragment program
+            if (params.empty() || (context.pass->getFragmentProgramName() == params))
+            {
+                context.program = context.pass->getFragmentProgram();
+            }
+        }
+
+        // if context.program was not set then try to get the fragment program using the name
+        // passed in params
+        if (context.program.isNull())
+        {
+            context.program = GpuProgramManager::getSingleton().getByName(params);
+            if (context.program.isNull())
+            {
+                // Unknown program
+                logParseError("Invalid fragment_program_ref entry - fragment program "
+                    + params + " has not been defined.", context);
+                return true;
+            }
+
+            // Set the vertex program for this pass
+            context.pass->setFragmentProgram(params);
+        }
+
+        // Create params? Skip this if program is not supported
+        if (context.program->isSupported())
+        {
+            context.programParams = context.pass->getFragmentProgramParameters();
+			context.numAnimationParametrics = 0;
+        }
+
+        // Return TRUE because this must be followed by a {
+        return true;
+    }
+    //-----------------------------------------------------------------------
+    bool parseVertexProgram(String& params, MaterialScriptContext& context)
+    {
+        // update section
+        context.section = MSS_PROGRAM;
+
+		// Create new program definition-in-progress
+		context.programDef = new MaterialScriptProgramDefinition();
+		context.programDef->progType = GPT_VERTEX_PROGRAM;
+        context.programDef->supportsSkeletalAnimation = false;
+		context.programDef->supportsMorphAnimation = false;
+		context.programDef->supportsPoseAnimation = 0;
+		context.programDef->usesVertexTextureFetch = false;
+
+		// Get name and language code
+		StringVector vecparams = StringUtil::split(params, " \t");
+		if (vecparams.size() != 2)
+		{
+            logParseError("Invalid vertex_program entry - expected "
+				"2 parameters.", context);
+            return true;
+		}
+		// Name, preserve case
+		context.programDef->name = vecparams[0];
+		// language code, make lower case
+		context.programDef->language = vecparams[1];
+		StringUtil::toLowerCase(context.programDef->language);
+
+        // Return TRUE because this must be followed by a {
+        return true;
+	}
+    //-----------------------------------------------------------------------
+    bool parseFragmentProgram(String& params, MaterialScriptContext& context)
+    {
+        // update section
+        context.section = MSS_PROGRAM;
+
+		// Create new program definition-in-progress
+		context.programDef = new MaterialScriptProgramDefinition();
+		context.programDef->progType = GPT_FRAGMENT_PROGRAM;
+		context.programDef->supportsSkeletalAnimation = false;
+		context.programDef->supportsMorphAnimation = false;
+		context.programDef->supportsPoseAnimation = 0;
+		context.programDef->usesVertexTextureFetch = false;
+
+		// Get name and language code
+		StringVector vecparams = StringUtil::split(params, " \t");
+		if (vecparams.size() != 2)
+		{
+            logParseError("Invalid fragment_program entry - expected "
+				"2 parameters.", context);
+            return true;
+		}
+		// Name, preserve case
+		context.programDef->name = vecparams[0];
+		// language code, make lower case
+		context.programDef->language = vecparams[1];
+		StringUtil::toLowerCase(context.programDef->language);
+
+		// Return TRUE because this must be followed by a {
+        return true;
+
+	}
+    //-----------------------------------------------------------------------
+    bool parseProgramSource(String& params, MaterialScriptContext& context)
+    {
+		// Source filename, preserve case
+		context.programDef->source = params;
+
+		return false;
+	}
+    //-----------------------------------------------------------------------
+    bool parseProgramSkeletalAnimation(String& params, MaterialScriptContext& context)
+    {
+        // Source filename, preserve case
+        context.programDef->supportsSkeletalAnimation
+            = StringConverter::parseBool(params);
+
+        return false;
+    }
+	//-----------------------------------------------------------------------
+	bool parseProgramMorphAnimation(String& params, MaterialScriptContext& context)
+	{
+		// Source filename, preserve case
+		context.programDef->supportsMorphAnimation
+			= StringConverter::parseBool(params);
+
+		return false;
+	}
+	//-----------------------------------------------------------------------
+	bool parseProgramPoseAnimation(String& params, MaterialScriptContext& context)
+	{
+		// Source filename, preserve case
+		context.programDef->supportsPoseAnimation
+			= StringConverter::parseInt(params);
+
+		return false;
+	}
+	//-----------------------------------------------------------------------
+	bool parseProgramVertexTextureFetch(String& params, MaterialScriptContext& context)
+	{
+		// Source filename, preserve case
+		context.programDef->usesVertexTextureFetch
+			= StringConverter::parseBool(params);
+
+		return false;
+	}
+    //-----------------------------------------------------------------------
+    bool parseProgramSyntax(String& params, MaterialScriptContext& context)
+    {
+		// Syntax code, make lower case
+        StringUtil::toLowerCase(params);
+		context.programDef->syntax = params;
+
+		return false;
+	}
+    //-----------------------------------------------------------------------
+    bool parseProgramCustomParameter(String& params, MaterialScriptContext& context)
+    {
+		// This params object does not have the command stripped
+		// Lower case the command, but not the value incase it's relevant
+		// Split only up to first delimiter, program deals with the rest
+		StringVector vecparams = StringUtil::split(params, " \t", 1);
+		if (vecparams.size() != 2)
+		{
+            logParseError("Invalid custom program parameter entry; "
+				"there must be a parameter name and at least one value.",
+				context);
+            return false;
+		}
+
+		context.programDef->customParameters.push_back(
+			std::pair<String, String>(vecparams[0], vecparams[1]));
+
+		return false;
+	}
+
+	//-----------------------------------------------------------------------
+    bool parseTextureSource(String& params, MaterialScriptContext& context)
+    {
+		StringUtil::toLowerCase(params);
+        StringVector vecparams = StringUtil::split(params, " \t");
+        if (vecparams.size() != 1)
+			logParseError("Invalid texture source attribute - expected 1 parameter.",                 context);
+        //The only param should identify which ExternalTextureSource is needed
+		ExternalTextureSourceManager::getSingleton().setCurrentPlugIn( vecparams[0] );
+
+		if(	ExternalTextureSourceManager::getSingleton().getCurrentPlugIn() != 0 )
+		{
+			String tps;
+			tps = StringConverter::toString( context.techLev ) + " "
+				+ StringConverter::toString( context.passLev ) + " "
+				+ StringConverter::toString( context.stateLev);
+
+			ExternalTextureSourceManager::getSingleton().getCurrentPlugIn()->setParameter( "set_T_P_S", tps );
+		}
+
+        // update section
+        context.section = MSS_TEXTURESOURCE;
+        // Return TRUE because this must be followed by a {
+        return true;
+    }
+
+    //-----------------------------------------------------------------------
+    bool parseTextureCustomParameter(String& params, MaterialScriptContext& context)
+    {
+		// This params object does not have the command stripped
+		// Split only up to first delimiter, program deals with the rest
+		StringVector vecparams = StringUtil::split(params, " \t", 1);
+		if (vecparams.size() != 2)
+		{
+            logParseError("Invalid texture parameter entry; "
+				"there must be a parameter name and at least one value.",
+				context);
+            return false;
+		}
+
+		if(	ExternalTextureSourceManager::getSingleton().getCurrentPlugIn() != 0 )
+			////First is command, next could be a string with one or more values
+			ExternalTextureSourceManager::getSingleton().getCurrentPlugIn()->setParameter( vecparams[0], vecparams[1] );
+
+		return false;
+	}
+    //-----------------------------------------------------------------------
+    bool parseReceiveShadows(String& params, MaterialScriptContext& context)
+    {
+        StringUtil::toLowerCase(params);
+        if (params == "on")
+            context.material->setReceiveShadows(true);
+        else if (params == "off")
+            context.material->setReceiveShadows(false);
+        else
+            logParseError(
+            "Bad receive_shadows attribute, valid parameters are 'on' or 'off'.",
+            context);
+
+        return false;
+
+    }
+    //-----------------------------------------------------------------------
+    bool parseDefaultParams(String& params, MaterialScriptContext& context)
+    {
+        context.section = MSS_DEFAULT_PARAMETERS;
+        // Should be a brace next
+        return true;
+    }
+
+	//-----------------------------------------------------------------------
+	bool parseTransparencyCastsShadows(String& params, MaterialScriptContext& context)
+	{
+        StringUtil::toLowerCase(params);
+		if (params == "on")
+			context.material->setTransparencyCastsShadows(true);
+		else if (params == "off")
+			context.material->setTransparencyCastsShadows(false);
+		else
+			logParseError(
+			"Bad transparency_casts_shadows attribute, valid parameters are 'on' or 'off'.",
+			context);
+
+		return false;
+
+	}
+	//-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    MaterialSerializer::MaterialSerializer()
+    {
+        // Set up root attribute parsers
+        mRootAttribParsers.insert(AttribParserList::value_type("material", (ATTRIBUTE_PARSER)parseMaterial));
+        mRootAttribParsers.insert(AttribParserList::value_type("vertex_program", (ATTRIBUTE_PARSER)parseVertexProgram));
+        mRootAttribParsers.insert(AttribParserList::value_type("fragment_program", (ATTRIBUTE_PARSER)parseFragmentProgram));
+
+        // Set up material attribute parsers
+        mMaterialAttribParsers.insert(AttribParserList::value_type("lod_distances", (ATTRIBUTE_PARSER)parseLodDistances));
+        mMaterialAttribParsers.insert(AttribParserList::value_type("receive_shadows", (ATTRIBUTE_PARSER)parseReceiveShadows));
+		mMaterialAttribParsers.insert(AttribParserList::value_type("transparency_casts_shadows", (ATTRIBUTE_PARSER)parseTransparencyCastsShadows));
+        mMaterialAttribParsers.insert(AttribParserList::value_type("technique", (ATTRIBUTE_PARSER)parseTechnique));
+        mMaterialAttribParsers.insert(AttribParserList::value_type("set_texture_alias", (ATTRIBUTE_PARSER)parseSetTextureAlias));
+
+        // Set up technique attribute parsers
+        mTechniqueAttribParsers.insert(AttribParserList::value_type("lod_index", (ATTRIBUTE_PARSER)parseLodIndex));
+		mTechniqueAttribParsers.insert(AttribParserList::value_type("scheme", (ATTRIBUTE_PARSER)parseScheme));
+        mTechniqueAttribParsers.insert(AttribParserList::value_type("pass", (ATTRIBUTE_PARSER)parsePass));
+
+        // Set up pass attribute parsers
+        mPassAttribParsers.insert(AttribParserList::value_type("ambient", (ATTRIBUTE_PARSER)parseAmbient));
+        mPassAttribParsers.insert(AttribParserList::value_type("diffuse", (ATTRIBUTE_PARSER)parseDiffuse));
+        mPassAttribParsers.insert(AttribParserList::value_type("specular", (ATTRIBUTE_PARSER)parseSpecular));
+        mPassAttribParsers.insert(AttribParserList::value_type("emissive", (ATTRIBUTE_PARSER)parseEmissive));
+        mPassAttribParsers.insert(AttribParserList::value_type("scene_blend", (ATTRIBUTE_PARSER)parseSceneBlend));
+        mPassAttribParsers.insert(AttribParserList::value_type("depth_check", (ATTRIBUTE_PARSER)parseDepthCheck));
+        mPassAttribParsers.insert(AttribParserList::value_type("depth_write", (ATTRIBUTE_PARSER)parseDepthWrite));
+        mPassAttribParsers.insert(AttribParserList::value_type("depth_func", (ATTRIBUTE_PARSER)parseDepthFunc));
+		mPassAttribParsers.insert(AttribParserList::value_type("alpha_rejection", (ATTRIBUTE_PARSER)parseAlphaRejection));
+        mPassAttribParsers.insert(AttribParserList::value_type("colour_write", (ATTRIBUTE_PARSER)parseColourWrite));
+        mPassAttribParsers.insert(AttribParserList::value_type("cull_hardware", (ATTRIBUTE_PARSER)parseCullHardware));
+        mPassAttribParsers.insert(AttribParserList::value_type("cull_software", (ATTRIBUTE_PARSER)parseCullSoftware));
+        mPassAttribParsers.insert(AttribParserList::value_type("lighting", (ATTRIBUTE_PARSER)parseLighting));
+        mPassAttribParsers.insert(AttribParserList::value_type("fog_override", (ATTRIBUTE_PARSER)parseFogging));
+        mPassAttribParsers.insert(AttribParserList::value_type("shading", (ATTRIBUTE_PARSER)parseShading));
+		mPassAttribParsers.insert(AttribParserList::value_type("polygon_mode", (ATTRIBUTE_PARSER)parsePolygonMode));
+        mPassAttribParsers.insert(AttribParserList::value_type("depth_bias", (ATTRIBUTE_PARSER)parseDepthBias));
+        mPassAttribParsers.insert(AttribParserList::value_type("texture_unit", (ATTRIBUTE_PARSER)parseTextureUnit));
+        mPassAttribParsers.insert(AttribParserList::value_type("vertex_program_ref", (ATTRIBUTE_PARSER)parseVertexProgramRef));
+        mPassAttribParsers.insert(AttribParserList::value_type("shadow_caster_vertex_program_ref", (ATTRIBUTE_PARSER)parseShadowCasterVertexProgramRef));
+        mPassAttribParsers.insert(AttribParserList::value_type("shadow_receiver_vertex_program_ref", (ATTRIBUTE_PARSER)parseShadowReceiverVertexProgramRef));
+		mPassAttribParsers.insert(AttribParserList::value_type("shadow_receiver_fragment_program_ref", (ATTRIBUTE_PARSER)parseShadowReceiverFragmentProgramRef));
+        mPassAttribParsers.insert(AttribParserList::value_type("fragment_program_ref", (ATTRIBUTE_PARSER)parseFragmentProgramRef));
+        mPassAttribParsers.insert(AttribParserList::value_type("max_lights", (ATTRIBUTE_PARSER)parseMaxLights));
+		mPassAttribParsers.insert(AttribParserList::value_type("start_light", (ATTRIBUTE_PARSER)parseStartLight));
+        mPassAttribParsers.insert(AttribParserList::value_type("iteration", (ATTRIBUTE_PARSER)parseIteration));
+		mPassAttribParsers.insert(AttribParserList::value_type("point_size", (ATTRIBUTE_PARSER)parsePointSize));
+		mPassAttribParsers.insert(AttribParserList::value_type("point_sprites", (ATTRIBUTE_PARSER)parsePointSprites));
+		mPassAttribParsers.insert(AttribParserList::value_type("point_size_attenuation", (ATTRIBUTE_PARSER)parsePointAttenuation));
+		mPassAttribParsers.insert(AttribParserList::value_type("point_size_min", (ATTRIBUTE_PARSER)parsePointSizeMin));
+		mPassAttribParsers.insert(AttribParserList::value_type("point_size_max", (ATTRIBUTE_PARSER)parsePointSizeMax));
+
+        // Set up texture unit attribute parsers
+		mTextureUnitAttribParsers.insert(AttribParserList::value_type("texture_source", (ATTRIBUTE_PARSER)parseTextureSource));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("texture", (ATTRIBUTE_PARSER)parseTexture));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("anim_texture", (ATTRIBUTE_PARSER)parseAnimTexture));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("cubic_texture", (ATTRIBUTE_PARSER)parseCubicTexture));
+		mTextureUnitAttribParsers.insert(AttribParserList::value_type("binding_type", (ATTRIBUTE_PARSER)parseBindingType));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("tex_coord_set", (ATTRIBUTE_PARSER)parseTexCoord));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("tex_address_mode", (ATTRIBUTE_PARSER)parseTexAddressMode));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("tex_border_colour", (ATTRIBUTE_PARSER)parseTexBorderColour));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("colour_op", (ATTRIBUTE_PARSER)parseColourOp));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("colour_op_ex", (ATTRIBUTE_PARSER)parseColourOpEx));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("colour_op_multipass_fallback", (ATTRIBUTE_PARSER)parseColourOpFallback));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("alpha_op_ex", (ATTRIBUTE_PARSER)parseAlphaOpEx));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("env_map", (ATTRIBUTE_PARSER)parseEnvMap));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("scroll", (ATTRIBUTE_PARSER)parseScroll));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("scroll_anim", (ATTRIBUTE_PARSER)parseScrollAnim));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("rotate", (ATTRIBUTE_PARSER)parseRotate));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("rotate_anim", (ATTRIBUTE_PARSER)parseRotateAnim));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("scale", (ATTRIBUTE_PARSER)parseScale));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("wave_xform", (ATTRIBUTE_PARSER)parseWaveXform));
+		mTextureUnitAttribParsers.insert(AttribParserList::value_type("transform", (ATTRIBUTE_PARSER)parseTransform));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("filtering", (ATTRIBUTE_PARSER)parseFiltering));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("max_anisotropy", (ATTRIBUTE_PARSER)parseAnisotropy));
+        mTextureUnitAttribParsers.insert(AttribParserList::value_type("texture_alias", (ATTRIBUTE_PARSER)parseTextureAlias));
+		mTextureUnitAttribParsers.insert(AttribParserList::value_type("mipmap_bias", (ATTRIBUTE_PARSER)parseMipmapBias));
+		mTextureUnitAttribParsers.insert(AttribParserList::value_type("content_type", (ATTRIBUTE_PARSER)parseContentType));
+
+        // Set up program reference attribute parsers
+        mProgramRefAttribParsers.insert(AttribParserList::value_type("param_indexed", (ATTRIBUTE_PARSER)parseParamIndexed));
+        mProgramRefAttribParsers.insert(AttribParserList::value_type("param_indexed_auto", (ATTRIBUTE_PARSER)parseParamIndexedAuto));
+        mProgramRefAttribParsers.insert(AttribParserList::value_type("param_named", (ATTRIBUTE_PARSER)parseParamNamed));
+        mProgramRefAttribParsers.insert(AttribParserList::value_type("param_named_auto", (ATTRIBUTE_PARSER)parseParamNamedAuto));
+
+        // Set up program definition attribute parsers
+        mProgramAttribParsers.insert(AttribParserList::value_type("source", (ATTRIBUTE_PARSER)parseProgramSource));
+        mProgramAttribParsers.insert(AttribParserList::value_type("syntax", (ATTRIBUTE_PARSER)parseProgramSyntax));
+        mProgramAttribParsers.insert(AttribParserList::value_type("includes_skeletal_animation", (ATTRIBUTE_PARSER)parseProgramSkeletalAnimation));
+		mProgramAttribParsers.insert(AttribParserList::value_type("includes_morph_animation", (ATTRIBUTE_PARSER)parseProgramMorphAnimation));
+		mProgramAttribParsers.insert(AttribParserList::value_type("includes_pose_animation", (ATTRIBUTE_PARSER)parseProgramPoseAnimation));
+		mProgramAttribParsers.insert(AttribParserList::value_type("uses_vertex_texture_fetch", (ATTRIBUTE_PARSER)parseProgramVertexTextureFetch));
+        mProgramAttribParsers.insert(AttribParserList::value_type("default_params", (ATTRIBUTE_PARSER)parseDefaultParams));
+
+        // Set up program default param attribute parsers
+        mProgramDefaultParamAttribParsers.insert(AttribParserList::value_type("param_indexed", (ATTRIBUTE_PARSER)parseParamIndexed));
+        mProgramDefaultParamAttribParsers.insert(AttribParserList::value_type("param_indexed_auto", (ATTRIBUTE_PARSER)parseParamIndexedAuto));
+        mProgramDefaultParamAttribParsers.insert(AttribParserList::value_type("param_named", (ATTRIBUTE_PARSER)parseParamNamed));
+        mProgramDefaultParamAttribParsers.insert(AttribParserList::value_type("param_named_auto", (ATTRIBUTE_PARSER)parseParamNamedAuto));
+
+        mScriptContext.section = MSS_NONE;
+        mScriptContext.material.setNull();
+        mScriptContext.technique = 0;
+        mScriptContext.pass = 0;
+        mScriptContext.textureUnit = 0;
+        mScriptContext.program.setNull();
+        mScriptContext.lineNo = 0;
+        mScriptContext.filename.clear();
+		mScriptContext.techLev = -1;
+		mScriptContext.passLev = -1;
+		mScriptContext.stateLev = -1;
+
+        mBuffer.clear();
+    }
+
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::parseScript(DataStreamPtr& stream, const String& groupName)
+    {
+        String line;
+        bool nextIsOpenBrace = false;
+
+        mScriptContext.section = MSS_NONE;
+        mScriptContext.material.setNull();
+        mScriptContext.technique = 0;
+        mScriptContext.pass = 0;
+        mScriptContext.textureUnit = 0;
+        mScriptContext.program.setNull();
+        mScriptContext.lineNo = 0;
+		mScriptContext.techLev = -1;
+		mScriptContext.passLev = -1;
+		mScriptContext.stateLev = -1;
+        mScriptContext.filename = stream->getName();
+		mScriptContext.groupName = groupName;
+        while(!stream->eof())
+        {
+            line = stream->getLine();
+            mScriptContext.lineNo++;
+
+            // DEBUG LINE
+            // LogManager::getSingleton().logMessage("About to attempt line(#" +
+            //    StringConverter::toString(mScriptContext.lineNo) + "): " + line);
+
+            // Ignore comments & blanks
+            if (!(line.length() == 0 || line.substr(0,2) == "//"))
+            {
+                if (nextIsOpenBrace)
+                {
+                    // NB, parser will have changed context already
+                    if (line != "{")
+                    {
+                        logParseError("Expecting '{' but got " +
+                            line + " instead.", mScriptContext);
+                    }
+                    nextIsOpenBrace = false;
+                }
+                else
+                {
+                    nextIsOpenBrace = parseScriptLine(line);
+                }
+
+            }
+        }
+
+        // Check all braces were closed
+        if (mScriptContext.section != MSS_NONE)
+        {
+            logParseError("Unexpected end of file.", mScriptContext);
+        }
+
+		// Make sure we invalidate our context shared pointer (don't wanna hold on)
+		mScriptContext.material.setNull();
+
+    }
+    //-----------------------------------------------------------------------
+    bool MaterialSerializer::parseScriptLine(String& line)
+    {
+        switch(mScriptContext.section)
+        {
+        case MSS_NONE:
+            if (line == "}")
+            {
+                logParseError("Unexpected terminating brace.", mScriptContext);
+                return false;
+            }
+            else
+            {
+                // find & invoke a parser
+                return invokeParser(line, mRootAttribParsers);
+            }
+            break;
+        case MSS_MATERIAL:
+            if (line == "}")
+            {
+                // End of material
+                // if texture aliases were found, pass them to the material
+                // to update texture names used in Texture unit states
+                if (!mScriptContext.textureAliases.empty())
+                {
+                    // request material to update all texture names in TUS's
+                    // that use texture aliases in the list
+                    mScriptContext.material->applyTextureAliases(mScriptContext.textureAliases);
+                }
+
+                mScriptContext.section = MSS_NONE;
+                mScriptContext.material.setNull();
+				//Reset all levels for next material
+				mScriptContext.passLev = -1;
+				mScriptContext.stateLev= -1;
+				mScriptContext.techLev = -1;
+                mScriptContext.textureAliases.clear();
+            }
+            else
+            {
+                // find & invoke a parser
+                return invokeParser(line, mMaterialAttribParsers);
+            }
+            break;
+        case MSS_TECHNIQUE:
+            if (line == "}")
+            {
+                // End of technique
+                mScriptContext.section = MSS_MATERIAL;
+                mScriptContext.technique = NULL;
+				mScriptContext.passLev = -1;	//Reset pass level (yes, the pass level)
+            }
+            else
+            {
+                // find & invoke a parser
+                return invokeParser(line, mTechniqueAttribParsers);
+            }
+            break;
+        case MSS_PASS:
+            if (line == "}")
+            {
+                // End of pass
+                mScriptContext.section = MSS_TECHNIQUE;
+                mScriptContext.pass = NULL;
+				mScriptContext.stateLev = -1;	//Reset state level (yes, the state level)
+            }
+            else
+            {
+                // find & invoke a parser
+                return invokeParser(line, mPassAttribParsers);
+            }
+            break;
+        case MSS_TEXTUREUNIT:
+            if (line == "}")
+            {
+                // End of texture unit
+                mScriptContext.section = MSS_PASS;
+                mScriptContext.textureUnit = NULL;
+            }
+            else
+            {
+                // find & invoke a parser
+                return invokeParser(line, mTextureUnitAttribParsers);
+            }
+            break;
+		case MSS_TEXTURESOURCE:
+			if( line == "}" )
+			{
+				//End texture source section
+				//Finish creating texture here
+				String sMaterialName = mScriptContext.material->getName();
+				if(	ExternalTextureSourceManager::getSingleton().getCurrentPlugIn() != 0)
+					ExternalTextureSourceManager::getSingleton().getCurrentPlugIn()->
+					createDefinedTexture( sMaterialName, mScriptContext.groupName );
+				//Revert back to texture unit
+				mScriptContext.section = MSS_TEXTUREUNIT;
+			}
+			else
+			{
+				// custom texture parameter, use original line
+				parseTextureCustomParameter(line, mScriptContext);
+			}
+			break;
+        case MSS_PROGRAM_REF:
+            if (line == "}")
+            {
+                // End of program
+                mScriptContext.section = MSS_PASS;
+                mScriptContext.program.setNull();
+            }
+            else
+            {
+                // find & invoke a parser
+                return invokeParser(line, mProgramRefAttribParsers);
+            }
+            break;
+        case MSS_PROGRAM:
+			// Program definitions are slightly different, they are deferred
+			// until all the information required is known
+            if (line == "}")
+            {
+                // End of program
+				finishProgramDefinition();
+                mScriptContext.section = MSS_NONE;
+                delete mScriptContext.programDef;
+                mScriptContext.defaultParamLines.clear();
+                mScriptContext.programDef = NULL;
+            }
+            else
+            {
+                // find & invoke a parser
+				// do this manually because we want to call a custom
+				// routine when the parser is not found
+				// First, split line on first divisor only
+				StringVector splitCmd = StringUtil::split(line, " \t", 1);
+				// Find attribute parser
+				AttribParserList::iterator iparser = mProgramAttribParsers.find(splitCmd[0]);
+				if (iparser == mProgramAttribParsers.end())
+				{
+					// custom parameter, use original line
+					parseProgramCustomParameter(line, mScriptContext);
+				}
+				else
+				{
+                    String cmd = splitCmd.size() >= 2? splitCmd[1]:StringUtil::BLANK;
+					// Use parser with remainder
+                    return iparser->second(cmd, mScriptContext );
+				}
+
+            }
+            break;
+        case MSS_DEFAULT_PARAMETERS:
+            if (line == "}")
+            {
+                // End of default parameters
+                mScriptContext.section = MSS_PROGRAM;
+            }
+            else
+            {
+                // Save default parameter lines up until we finalise the program
+                mScriptContext.defaultParamLines.push_back(line);
+            }
+
+
+            break;
+        };
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+	void MaterialSerializer::finishProgramDefinition(void)
+	{
+		// Now it is time to create the program and propagate the parameters
+		MaterialScriptProgramDefinition* def = mScriptContext.programDef;
+        GpuProgramPtr gp;
+		if (def->language == "asm")
+		{
+			// Native assembler
+			// Validate
+			if (def->source.empty())
+			{
+				logParseError("Invalid program definition for " + def->name +
+					", you must specify a source file.", mScriptContext);
+			}
+			if (def->syntax.empty())
+			{
+				logParseError("Invalid program definition for " + def->name +
+					", you must specify a syntax code.", mScriptContext);
+			}
+			// Create
+			gp = GpuProgramManager::getSingleton().
+				createProgram(def->name, mScriptContext.groupName, def->source,
+                    def->progType, def->syntax);
+
+		}
+		else
+		{
+			// High-level program
+			// Validate
+			if (def->source.empty() && def->language != "unified")
+			{
+				logParseError("Invalid program definition for " + def->name +
+					", you must specify a source file.", mScriptContext);
+			}
+			// Create
+            try
+            {
+			    HighLevelGpuProgramPtr hgp = HighLevelGpuProgramManager::getSingleton().
+				    createProgram(def->name, mScriptContext.groupName,
+                        def->language, def->progType);
+                // Assign to generalised version
+                gp = hgp;
+                // Set source file
+                hgp->setSourceFile(def->source);
+
+			    // Set custom parameters
+				std::vector<std::pair<String, String> >::const_iterator i, iend;
+			    iend = def->customParameters.end();
+			    for (i = def->customParameters.begin(); i != iend; ++i)
+			    {
+				    if (!hgp->setParameter(i->first, i->second))
+				    {
+					    logParseError("Error in program " + def->name +
+						    " parameter " + i->first + " is not valid.", mScriptContext);
+				    }
+			    }
+            }
+            catch (Exception& e)
+            {
+                logParseError("Could not create GPU program '"
+                    + def->name + "', error reported was: " + e.getDescription(), mScriptContext);
+				mScriptContext.program.setNull();
+            	mScriptContext.programParams.setNull();
+				return;
+            }
+        }
+        // Set skeletal animation option
+        gp->setSkeletalAnimationIncluded(def->supportsSkeletalAnimation);
+		// Set morph animation option
+		gp->setMorphAnimationIncluded(def->supportsMorphAnimation);
+		// Set pose animation option
+		gp->setPoseAnimationIncluded(def->supportsPoseAnimation);
+		// Set vertex texture usage
+		gp->setVertexTextureFetchRequired(def->usesVertexTextureFetch);
+		// set origin
+		gp->_notifyOrigin(mScriptContext.filename);
+
+        // Set up to receive default parameters
+        if (gp->isSupported()
+            && !mScriptContext.defaultParamLines.empty())
+        {
+            mScriptContext.programParams = gp->getDefaultParameters();
+			mScriptContext.numAnimationParametrics = 0;
+            mScriptContext.program = gp;
+            StringVector::iterator i, iend;
+            iend = mScriptContext.defaultParamLines.end();
+            for (i = mScriptContext.defaultParamLines.begin();
+                i != iend; ++i)
+            {
+                // find & invoke a parser
+                // do this manually because we want to call a custom
+                // routine when the parser is not found
+                // First, split line on first divisor only
+                StringVector splitCmd = StringUtil::split(*i, " \t", 1);
+                // Find attribute parser
+                AttribParserList::iterator iparser
+                    = mProgramDefaultParamAttribParsers.find(splitCmd[0]);
+                if (iparser != mProgramDefaultParamAttribParsers.end())
+                {
+                    String cmd = splitCmd.size() >= 2? splitCmd[1]:StringUtil::BLANK;
+                    // Use parser with remainder
+                    iparser->second(cmd, mScriptContext );
+                }
+
+            }
+            // Reset
+            mScriptContext.program.setNull();
+            mScriptContext.programParams.setNull();
+        }
+
+	}
+    //-----------------------------------------------------------------------
+	bool MaterialSerializer::invokeParser(String& line, AttribParserList& parsers)
+    {
+        // First, split line on first divisor only
+        StringVector splitCmd(StringUtil::split(line, " \t", 1));
+
+        // Find attribute parser
+        AttribParserList::iterator iparser = parsers.find(splitCmd[0]);
+        if (iparser == parsers.end())
+        {
+            // BAD command. BAD!
+            logParseError("Unrecognised command: " + splitCmd[0], mScriptContext);
+            return false;
+        }
+        else
+        {
+            String cmd;
+            if(splitCmd.size() >= 2)
+                cmd = splitCmd[1];
+            // Use parser, make sure we have 2 params before using splitCmd[1]
+            return iparser->second( cmd, mScriptContext );
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::exportMaterial(const MaterialPtr& pMat, const String &fileName, bool exportDefaults,
+        const bool includeProgDef, const String& programFilename)
+    {
+        clearQueue();
+        mDefaults = exportDefaults;
+        writeMaterial(pMat);
+        exportQueued(fileName, includeProgDef, programFilename);
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::exportQueued(const String &fileName, const bool includeProgDef, const String& programFilename)
+    {
+        // write out gpu program definitions to the buffer
+        writeGpuPrograms();
+
+        if (mBuffer.empty())
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Queue is empty !", "MaterialSerializer::exportQueued");
+
+        LogManager::getSingleton().logMessage("MaterialSerializer : writing material(s) to material script : " + fileName, LML_CRITICAL);
+        FILE *fp;
+        fp = fopen(fileName.c_str(), "w");
+        if (!fp)
+            OGRE_EXCEPT(Exception::ERR_CANNOT_WRITE_TO_FILE, "Cannot create material file.",
+            "MaterialSerializer::export");
+
+        // output gpu program definitions to material script file if includeProgDef is true
+        if (includeProgDef && !mGpuProgramBuffer.empty())
+        {
+            fputs(mGpuProgramBuffer.c_str(), fp);
+        }
+
+        // output main buffer holding material script
+        fputs(mBuffer.c_str(), fp);
+        fclose(fp);
+
+        // write program script if program filename and program definitions
+        // were not included in material script
+        if (!includeProgDef && !mGpuProgramBuffer.empty() && !programFilename.empty())
+        {
+            FILE *fp;
+            fp = fopen(programFilename.c_str(), "w");
+            if (!fp)
+                OGRE_EXCEPT(Exception::ERR_CANNOT_WRITE_TO_FILE, "Cannot create program material file.",
+                "MaterialSerializer::export");
+            fputs(mGpuProgramBuffer.c_str(), fp);
+            fclose(fp);
+        }
+
+        LogManager::getSingleton().logMessage("MaterialSerializer : done.", LML_CRITICAL);
+        clearQueue();
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::queueForExport(const MaterialPtr& pMat,
+		bool clearQueued, bool exportDefaults)
+    {
+        if (clearQueued)
+            clearQueue();
+
+        mDefaults = exportDefaults;
+        writeMaterial(pMat);
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::clearQueue()
+    {
+        mBuffer.clear();
+        mGpuProgramBuffer.clear();
+        mGpuProgramDefinitionContainer.clear();
+    }
+    //-----------------------------------------------------------------------
+    const String &MaterialSerializer::getQueuedAsString() const
+    {
+        return mBuffer;
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeMaterial(const MaterialPtr& pMat)
+    {
+        LogManager::getSingleton().logMessage("MaterialSerializer : writing material " + pMat->getName() + " to queue.", LML_CRITICAL);
+        // Material name
+        writeAttribute(0, "material " + pMat->getName());
+        beginSection(0);
+        {
+            // Write LOD information
+            Material::LodDistanceIterator distIt = pMat->getLodDistanceIterator();
+            // Skip zero value
+            if (distIt.hasMoreElements())
+                distIt.getNext();
+            String attributeVal;
+            while (distIt.hasMoreElements())
+            {
+                Real sqdist = distIt.getNext();
+                attributeVal.append(StringConverter::toString(Math::Sqrt(sqdist)));
+                if (distIt.hasMoreElements())
+                    attributeVal.append(" ");
+            }
+            if (!attributeVal.empty())
+            {
+                writeAttribute(1, "lod_distances");
+                writeValue(attributeVal);
+            }
+
+
+            // Shadow receive
+            if (mDefaults ||
+                pMat->getReceiveShadows() != true)
+            {
+                writeAttribute(1, "receive_shadows");
+                writeValue(pMat->getReceiveShadows() ? "on" : "off");
+            }
+
+			// When rendering shadows, treat transparent things as opaque?
+			if (mDefaults ||
+				pMat->getTransparencyCastsShadows() == true)
+			{
+				writeAttribute(1, "transparency_casts_shadows");
+				writeValue(pMat->getTransparencyCastsShadows() ? "on" : "off");
+			}
+
+            // Iterate over techniques
+            Material::TechniqueIterator it = pMat->getTechniqueIterator();
+            while (it.hasMoreElements())
+            {
+                writeTechnique(it.getNext());
+                mBuffer += "\n";
+            }
+        }
+        endSection(0);
+        mBuffer += "\n";
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeTechnique(const Technique* pTech)
+    {
+        // Technique header
+        writeAttribute(1, "technique");
+        // only output technique name if it exists.
+        if (!pTech->getName().empty())
+            writeValue(pTech->getName());
+
+        beginSection(1);
+        {
+			// Lod index
+			if (mDefaults ||
+				pTech->getLodIndex() != 0)
+			{
+				writeAttribute(2, "lod_index");
+				writeValue(StringConverter::toString(pTech->getLodIndex()));
+			}
+
+			// Scheme name
+			if (mDefaults ||
+				pTech->getSchemeName() != MaterialManager::DEFAULT_SCHEME_NAME)
+			{
+				writeAttribute(2, "scheme");
+				writeValue(pTech->getSchemeName());
+			}
+
+            // Iterate over passes
+            Technique::PassIterator it = const_cast<Technique*>(pTech)->getPassIterator();
+            while (it.hasMoreElements())
+            {
+                writePass(it.getNext());
+                mBuffer += "\n";
+            }
+        }
+        endSection(1);
+
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writePass(const Pass* pPass)
+    {
+        writeAttribute(2, "pass");
+        // only output pass name if its not the default name
+        if (pPass->getName() != StringConverter::toString(pPass->getIndex()))
+            writeValue(pPass->getName());
+
+        beginSection(2);
+        {
+            //lighting
+            if (mDefaults ||
+                pPass->getLightingEnabled() != true)
+            {
+                writeAttribute(3, "lighting");
+                writeValue(pPass->getLightingEnabled() ? "on" : "off");
+            }
+			// max_lights
+            if (mDefaults ||
+                pPass->getMaxSimultaneousLights() != OGRE_MAX_SIMULTANEOUS_LIGHTS)
+            {
+                writeAttribute(3, "max_lights");
+                writeValue(StringConverter::toString(pPass->getMaxSimultaneousLights()));
+            }
+			// start_light
+			if (mDefaults ||
+				pPass->getStartLight() != 0)
+			{
+				writeAttribute(3, "start_light");
+				writeValue(StringConverter::toString(pPass->getStartLight()));
+			}
+			// iteration
+            if (mDefaults ||
+                pPass->getIteratePerLight() || (pPass->getPassIterationCount() > 1))
+            {
+                writeAttribute(3, "iteration");
+                // pass iteration count
+                if (pPass->getPassIterationCount() > 1 || pPass->getLightCountPerIteration() > 1)
+                {
+                    writeValue(StringConverter::toString(pPass->getPassIterationCount()));
+                    if (pPass->getIteratePerLight())
+					{
+						if (pPass->getLightCountPerIteration() > 1)
+						{
+							writeValue("per_n_lights");
+							writeValue(StringConverter::toString(
+								pPass->getLightCountPerIteration()));
+						}
+						else
+						{
+							writeValue("per_light");
+						}
+					}
+                }
+                else
+                {
+                    writeValue(pPass->getIteratePerLight() ? "once_per_light" : "once");
+                }
+
+                if (pPass->getIteratePerLight() && pPass->getRunOnlyForOneLightType())
+                {
+                    switch (pPass->getOnlyLightType())
+                    {
+                    case Light::LT_DIRECTIONAL:
+                        writeValue("directional");
+                        break;
+                    case Light::LT_POINT:
+                        writeValue("point");
+                        break;
+                    case Light::LT_SPOTLIGHT:
+                        writeValue("spot");
+                        break;
+                    };
+                }
+            }
+
+
+            if (pPass->getLightingEnabled())
+            {
+                // Ambient
+                if (mDefaults ||
+                    pPass->getAmbient().r != 1 ||
+                    pPass->getAmbient().g != 1 ||
+                    pPass->getAmbient().b != 1 ||
+                    pPass->getAmbient().a != 1 ||
+                    (pPass->getVertexColourTracking() & TVC_AMBIENT))
+                {
+                    writeAttribute(3, "ambient");
+                    if (pPass->getVertexColourTracking() & TVC_AMBIENT)
+                        writeValue("vertexcolour");
+                    else
+                        writeColourValue(pPass->getAmbient(), true);
+                }
+
+                // Diffuse
+                if (mDefaults ||
+                    pPass->getDiffuse().r != 1 ||
+                    pPass->getDiffuse().g != 1 ||
+                    pPass->getDiffuse().b != 1 ||
+                    pPass->getDiffuse().a != 1 ||
+                    (pPass->getVertexColourTracking() & TVC_DIFFUSE))
+                {
+                    writeAttribute(3, "diffuse");
+                    if (pPass->getVertexColourTracking() & TVC_DIFFUSE)
+                        writeValue("vertexcolour");
+                    else
+                        writeColourValue(pPass->getDiffuse(), true);
+                }
+
+                // Specular
+                if (mDefaults ||
+                    pPass->getSpecular().r != 0 ||
+                    pPass->getSpecular().g != 0 ||
+                    pPass->getSpecular().b != 0 ||
+                    pPass->getSpecular().a != 1 ||
+                    pPass->getShininess() != 0 ||
+                    (pPass->getVertexColourTracking() & TVC_SPECULAR))
+                {
+                    writeAttribute(3, "specular");
+                    if (pPass->getVertexColourTracking() & TVC_SPECULAR)
+                    {
+                        writeValue("vertexcolour");
+                    }
+                    else
+                    {
+                        writeColourValue(pPass->getSpecular(), true);
+                    }
+                    writeValue(StringConverter::toString(pPass->getShininess()));
+
+                }
+
+                // Emissive
+                if (mDefaults ||
+                    pPass->getSelfIllumination().r != 0 ||
+                    pPass->getSelfIllumination().g != 0 ||
+                    pPass->getSelfIllumination().b != 0 ||
+                    pPass->getSelfIllumination().a != 1 ||
+                    (pPass->getVertexColourTracking() & TVC_EMISSIVE))
+                {
+                    writeAttribute(3, "emissive");
+                    if (pPass->getVertexColourTracking() & TVC_EMISSIVE)
+                        writeValue("vertexcolour");
+                    else
+                        writeColourValue(pPass->getSelfIllumination(), true);
+                }
+            }
+
+            // Point size
+            if (mDefaults ||
+                pPass->getPointSize() != 1.0)
+            {
+                writeAttribute(3, "point_size");
+                writeValue(StringConverter::toString(pPass->getPointSize()));
+            }
+
+            // Point sprites
+            if (mDefaults ||
+                pPass->getPointSpritesEnabled())
+            {
+                writeAttribute(3, "point_sprites");
+                writeValue(pPass->getPointSpritesEnabled() ? "on" : "off");
+            }
+
+            // Point attenuation
+            if (mDefaults ||
+                pPass->isPointAttenuationEnabled())
+            {
+                writeAttribute(3, "point_size_attenuation");
+                writeValue(pPass->isPointAttenuationEnabled() ? "on" : "off");
+                if (pPass->isPointAttenuationEnabled() &&
+                    (pPass->getPointAttenuationConstant() != 0.0 ||
+                     pPass->getPointAttenuationLinear() != 1.0 ||
+                     pPass->getPointAttenuationQuadratic() != 0.0))
+                {
+                    writeValue(StringConverter::toString(pPass->getPointAttenuationConstant()));
+                    writeValue(StringConverter::toString(pPass->getPointAttenuationLinear()));
+                    writeValue(StringConverter::toString(pPass->getPointAttenuationQuadratic()));
+                }
+            }
+
+            // Point min size
+            if (mDefaults ||
+                pPass->getPointMinSize() != 0.0)
+            {
+                writeAttribute(3, "point_size_min");
+                writeValue(StringConverter::toString(pPass->getPointMinSize()));
+            }
+
+            // Point max size
+            if (mDefaults ||
+                pPass->getPointMaxSize() != 0.0)
+            {
+                writeAttribute(3, "point_size_max");
+                writeValue(StringConverter::toString(pPass->getPointMaxSize()));
+            }
+
+            // scene blend factor
+            if (mDefaults ||
+                pPass->getSourceBlendFactor() != SBF_ONE ||
+                pPass->getDestBlendFactor() != SBF_ZERO)
+            {
+                writeAttribute(3, "scene_blend");
+                writeSceneBlendFactor(pPass->getSourceBlendFactor(), pPass->getDestBlendFactor());
+            }
+
+
+            //depth check
+            if (mDefaults ||
+                pPass->getDepthCheckEnabled() != true)
+            {
+                writeAttribute(3, "depth_check");
+                writeValue(pPass->getDepthCheckEnabled() ? "on" : "off");
+            }
+			// alpha_rejection
+			if (mDefaults ||
+				pPass->getAlphaRejectFunction() != CMPF_ALWAYS_PASS ||
+				pPass->getAlphaRejectValue() != 0)
+			{
+				writeAttribute(3, "alpha_rejection");
+				writeCompareFunction(pPass->getAlphaRejectFunction());
+				writeValue(StringConverter::toString(pPass->getAlphaRejectValue()));
+			}
+
+
+            //depth write
+            if (mDefaults ||
+                pPass->getDepthWriteEnabled() != true)
+            {
+                writeAttribute(3, "depth_write");
+                writeValue(pPass->getDepthWriteEnabled() ? "on" : "off");
+            }
+
+            //depth function
+            if (mDefaults ||
+                pPass->getDepthFunction() != CMPF_LESS_EQUAL)
+            {
+                writeAttribute(3, "depth_func");
+                writeCompareFunction(pPass->getDepthFunction());
+            }
+
+            //depth bias
+            if (mDefaults ||
+                pPass->getDepthBiasConstant() != 0 ||
+				pPass->getDepthBiasSlopeScale() != 0)
+            {
+                writeAttribute(3, "depth_bias");
+                writeValue(StringConverter::toString(pPass->getDepthBiasConstant()));
+				writeValue(StringConverter::toString(pPass->getDepthBiasSlopeScale()));
+            }
+
+            // hardware culling mode
+            if (mDefaults ||
+                pPass->getCullingMode() != CULL_CLOCKWISE)
+            {
+                CullingMode hcm = pPass->getCullingMode();
+                writeAttribute(3, "cull_hardware");
+                switch (hcm)
+                {
+                case CULL_NONE :
+                    writeValue("none");
+                    break;
+                case CULL_CLOCKWISE :
+                    writeValue("clockwise");
+                    break;
+                case CULL_ANTICLOCKWISE :
+                    writeValue("anticlockwise");
+                    break;
+                }
+            }
+
+            // software culling mode
+            if (mDefaults ||
+                pPass->getManualCullingMode() != MANUAL_CULL_BACK)
+            {
+                ManualCullingMode scm = pPass->getManualCullingMode();
+                writeAttribute(3, "cull_software");
+                switch (scm)
+                {
+                case MANUAL_CULL_NONE :
+                    writeValue("none");
+                    break;
+                case MANUAL_CULL_BACK :
+                    writeValue("back");
+                    break;
+                case MANUAL_CULL_FRONT :
+                    writeValue("front");
+                    break;
+                }
+            }
+
+            //shading
+            if (mDefaults ||
+                pPass->getShadingMode() != SO_GOURAUD)
+            {
+                writeAttribute(3, "shading");
+                switch (pPass->getShadingMode())
+                {
+                case SO_FLAT:
+                    writeValue("flat");
+                    break;
+                case SO_GOURAUD:
+                    writeValue("gouraud");
+                    break;
+                case SO_PHONG:
+                    writeValue("phong");
+                    break;
+                }
+            }
+
+
+			if (mDefaults ||
+				pPass->getPolygonMode() != PM_SOLID)
+			{
+				writeAttribute(3, "polygon_mode");
+				switch (pPass->getPolygonMode())
+				{
+				case PM_POINTS:
+					writeValue("points");
+					break;
+				case PM_WIREFRAME:
+					writeValue("wireframe");
+					break;
+				case PM_SOLID:
+					writeValue("solid");
+					break;
+				}
+			}
+
+            //fog override
+            if (mDefaults ||
+                pPass->getFogOverride() != false)
+            {
+                writeAttribute(3, "fog_override");
+                writeValue(pPass->getFogOverride() ? "true" : "false");
+                if (pPass->getFogOverride())
+                {
+                    switch (pPass->getFogMode())
+                    {
+                    case FOG_NONE:
+                        writeValue("none");
+                        break;
+                    case FOG_LINEAR:
+                        writeValue("linear");
+                        break;
+                    case FOG_EXP2:
+                        writeValue("exp2");
+                        break;
+                    case FOG_EXP:
+                        writeValue("exp");
+                        break;
+                    }
+
+                    if (pPass->getFogMode() != FOG_NONE)
+                    {
+                        writeColourValue(pPass->getFogColour());
+                        writeValue(StringConverter::toString(pPass->getFogDensity()));
+                        writeValue(StringConverter::toString(pPass->getFogStart()));
+                        writeValue(StringConverter::toString(pPass->getFogEnd()));
+                    }
+                }
+            }
+
+            // nfz
+
+            //  GPU Vertex and Fragment program references and parameters
+            if (pPass->hasVertexProgram())
+            {
+                writeVertexProgramRef(pPass);
+            }
+
+            if (pPass->hasFragmentProgram())
+            {
+                writeFragmentProgramRef(pPass);
+            }
+
+            if (pPass->hasShadowCasterVertexProgram())
+            {
+                writeShadowCasterVertexProgramRef(pPass);
+            }
+
+            if (pPass->hasShadowReceiverVertexProgram())
+            {
+                writeShadowReceiverVertexProgramRef(pPass);
+            }
+
+            if (pPass->hasShadowReceiverFragmentProgram())
+            {
+                writeShadowReceiverFragmentProgramRef(pPass);
+            }
+
+            // Nested texture layers
+            Pass::TextureUnitStateIterator it = const_cast<Pass*>(pPass)->getTextureUnitStateIterator();
+            while(it.hasMoreElements())
+            {
+                writeTextureUnit(it.getNext());
+            }
+        }
+        endSection(2);
+        LogManager::getSingleton().logMessage("MaterialSerializer : done.", LML_CRITICAL);
+    }
+    //-----------------------------------------------------------------------
+    String MaterialSerializer::convertFiltering(FilterOptions fo)
+    {
+        switch (fo)
+        {
+        case FO_NONE:
+            return "none";
+        case FO_POINT:
+            return "point";
+        case FO_LINEAR:
+            return "linear";
+        case FO_ANISOTROPIC:
+            return "anisotropic";
+        }
+
+        return "point";
+    }
+    //-----------------------------------------------------------------------
+    String convertTexAddressMode(TextureUnitState::TextureAddressingMode tam)
+	{
+        switch (tam)
+        {
+        case TextureUnitState::TAM_BORDER:
+            return "border";
+        case TextureUnitState::TAM_CLAMP:
+            return "clamp";
+        case TextureUnitState::TAM_MIRROR:
+            return "mirror";
+        case TextureUnitState::TAM_WRAP:
+            return "wrap";
+        }
+
+        return "wrap";
+	}
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeTextureUnit(const TextureUnitState *pTex)
+    {
+        LogManager::getSingleton().logMessage("MaterialSerializer : parsing texture layer.", LML_CRITICAL);
+        mBuffer += "\n";
+        writeAttribute(3, "texture_unit");
+        // only write out name if its not equal to the default name
+        if (pTex->getName() != StringConverter::toString(pTex->getParent()->getTextureUnitStateIndex(pTex)))
+            writeValue(pTex->getName());
+
+        beginSection(3);
+        {
+            // texture_alias
+            if (!pTex->getTextureNameAlias().empty())
+            {
+                writeAttribute(4, "texture_alias");
+                writeValue(pTex->getTextureNameAlias());
+            }
+
+            //texture name
+            if (pTex->getNumFrames() == 1 && !pTex->getTextureName().empty() && !pTex->isCubic())
+            {
+                writeAttribute(4, "texture");
+                writeValue(pTex->getTextureName());
+
+                switch (pTex->getTextureType())
+                {
+                case TEX_TYPE_1D:
+                    writeValue("1d");
+                    break;
+                case TEX_TYPE_2D:
+                    // nothing, this is the default
+                    break;
+                case TEX_TYPE_3D:
+                    writeValue("3d");
+                    break;
+                case TEX_TYPE_CUBE_MAP:
+                    // nothing, deal with this as cubic_texture since it copes with all variants
+                    break;
+                default:
+                    break;
+                };
+
+                if (pTex->getNumMipmaps() != MIP_DEFAULT)
+                {
+                    writeValue(StringConverter::toString(pTex->getNumMipmaps()));
+                }
+
+                if (pTex->getIsAlpha())
+                {
+                    writeValue("alpha");
+                }
+
+                if (pTex->getDesiredFormat() != PF_UNKNOWN)
+                {
+                    writeValue(PixelUtil::getFormatName(pTex->getDesiredFormat()));
+                }
+            }
+
+            //anim. texture
+            if (pTex->getNumFrames() > 1 && !pTex->isCubic())
+            {
+                writeAttribute(4, "anim_texture");
+                for (unsigned int n = 0; n < pTex->getNumFrames(); n++)
+                    writeValue(pTex->getFrameTextureName(n));
+                writeValue(StringConverter::toString(pTex->getAnimationDuration()));
+            }
+
+            //cubic texture
+            if (pTex->isCubic())
+            {
+                writeAttribute(4, "cubic_texture");
+                for (unsigned int n = 0; n < pTex->getNumFrames(); n++)
+                    writeValue(pTex->getFrameTextureName(n));
+
+                //combinedUVW/separateUW
+                if (pTex->getTextureType() == TEX_TYPE_CUBE_MAP)
+                    writeValue("combinedUVW");
+                else
+                    writeValue("separateUV");
+            }
+
+            //anisotropy level
+            if (mDefaults ||
+                pTex->getTextureAnisotropy() != 1)
+            {
+                writeAttribute(4, "max_anisotropy");
+                writeValue(StringConverter::toString(pTex->getTextureAnisotropy()));
+            }
+
+            //texture coordinate set
+            if (mDefaults ||
+                pTex->getTextureCoordSet() != 0)
+            {
+                writeAttribute(4, "tex_coord_set");
+                writeValue(StringConverter::toString(pTex->getTextureCoordSet()));
+            }
+
+            //addressing mode
+			const TextureUnitState::UVWAddressingMode& uvw =
+				pTex->getTextureAddressingMode();
+            if (mDefaults ||
+                uvw.u != Ogre::TextureUnitState::TAM_WRAP ||
+				uvw.v != Ogre::TextureUnitState::TAM_WRAP ||
+				uvw.w != Ogre::TextureUnitState::TAM_WRAP )
+            {
+                writeAttribute(4, "tex_address_mode");
+                if (uvw.u == uvw.v && uvw.u == uvw.w)
+                {
+                    writeValue(convertTexAddressMode(uvw.u));
+                }
+                else
+                {
+                    writeValue(convertTexAddressMode(uvw.u));
+                    writeValue(convertTexAddressMode(uvw.v));
+                    if (uvw.w != TextureUnitState::TAM_WRAP)
+                    {
+                        writeValue(convertTexAddressMode(uvw.w));
+                    }
+                }
+            }
+
+            //border colour
+            const ColourValue& borderColour =
+                pTex->getTextureBorderColour();
+            if (mDefaults ||
+                borderColour != ColourValue::Black)
+            {
+                writeAttribute(4, "tex_border_colour");
+                writeColourValue(borderColour, true);
+            }
+
+            //filtering
+            if (mDefaults ||
+                pTex->getTextureFiltering(FT_MIN) != FO_LINEAR ||
+                pTex->getTextureFiltering(FT_MAG) != FO_LINEAR ||
+                pTex->getTextureFiltering(FT_MIP) != FO_POINT)
+            {
+                writeAttribute(4, "filtering");
+                writeValue(
+                    convertFiltering(pTex->getTextureFiltering(FT_MIN))
+                    + " "
+                    + convertFiltering(pTex->getTextureFiltering(FT_MAG))
+                    + " "
+                    + convertFiltering(pTex->getTextureFiltering(FT_MIP)));
+            }
+
+			// Mip biasing
+			if (mDefaults ||
+				pTex->getTextureMipmapBias() != 0.0f)
+			{
+				writeAttribute(4, "mipmap_bias");
+				writeValue(
+					StringConverter::toString(pTex->getTextureMipmapBias()));
+			}
+
+            // colour_op_ex
+            if (mDefaults ||
+                pTex->getColourBlendMode().operation != LBX_MODULATE ||
+                pTex->getColourBlendMode().source1 != LBS_TEXTURE ||
+                pTex->getColourBlendMode().source2 != LBS_CURRENT)
+            {
+                writeAttribute(4, "colour_op_ex");
+                writeLayerBlendOperationEx(pTex->getColourBlendMode().operation);
+                writeLayerBlendSource(pTex->getColourBlendMode().source1);
+                writeLayerBlendSource(pTex->getColourBlendMode().source2);
+                if (pTex->getColourBlendMode().operation == LBX_BLEND_MANUAL)
+                    writeValue(StringConverter::toString(pTex->getColourBlendMode().factor));
+                if (pTex->getColourBlendMode().source1 == LBS_MANUAL)
+                    writeColourValue(pTex->getColourBlendMode().colourArg1, false);
+                if (pTex->getColourBlendMode().source2 == LBS_MANUAL)
+                    writeColourValue(pTex->getColourBlendMode().colourArg2, false);
+
+                //colour_op_multipass_fallback
+                writeAttribute(4, "colour_op_multipass_fallback");
+                writeSceneBlendFactor(pTex->getColourBlendFallbackSrc());
+                writeSceneBlendFactor(pTex->getColourBlendFallbackDest());
+            }
+
+            // alpha_op_ex
+            if (mDefaults ||
+                pTex->getAlphaBlendMode().operation != LBX_MODULATE ||
+                pTex->getAlphaBlendMode().source1 != LBS_TEXTURE ||
+                pTex->getAlphaBlendMode().source2 != LBS_CURRENT)
+            {
+                writeAttribute(4, "alpha_op_ex");
+                writeLayerBlendOperationEx(pTex->getAlphaBlendMode().operation);
+                writeLayerBlendSource(pTex->getAlphaBlendMode().source1);
+                writeLayerBlendSource(pTex->getAlphaBlendMode().source2);
+                if (pTex->getAlphaBlendMode().operation == LBX_BLEND_MANUAL)
+                    writeValue(StringConverter::toString(pTex->getAlphaBlendMode().factor));
+                else if (pTex->getAlphaBlendMode().source1 == LBS_MANUAL)
+                    writeValue(StringConverter::toString(pTex->getAlphaBlendMode().alphaArg1));
+                else if (pTex->getAlphaBlendMode().source2 == LBS_MANUAL)
+                    writeValue(StringConverter::toString(pTex->getAlphaBlendMode().alphaArg2));
+            }
+
+			bool individualTransformElems = false;
+            // rotate
+            if (mDefaults ||
+                pTex->getTextureRotate() != Radian(0))
+            {
+                writeAttribute(4, "rotate");
+                writeValue(StringConverter::toString(pTex->getTextureRotate().valueDegrees()));
+				individualTransformElems = true;
+            }
+
+            // scroll
+            if (mDefaults ||
+                pTex->getTextureUScroll() != 0 ||
+                pTex->getTextureVScroll() != 0 )
+            {
+                writeAttribute(4, "scroll");
+                writeValue(StringConverter::toString(pTex->getTextureUScroll()));
+                writeValue(StringConverter::toString(pTex->getTextureVScroll()));
+				individualTransformElems = true;
+            }
+            // scale
+            if (mDefaults ||
+                pTex->getTextureUScale() != 1.0 ||
+                pTex->getTextureVScale() != 1.0 )
+            {
+                writeAttribute(4, "scale");
+                writeValue(StringConverter::toString(pTex->getTextureUScale()));
+                writeValue(StringConverter::toString(pTex->getTextureVScale()));
+				individualTransformElems = true;
+            }
+
+			// free transform
+			if (!individualTransformElems &&
+				(mDefaults ||
+				pTex->getTextureTransform() != Matrix4::IDENTITY))
+			{
+				writeAttribute(4, "transform");
+				const Matrix4& xform = pTex->getTextureTransform();
+				for (int row = 0; row < 4; ++row)
+				{
+					for (int col = 0; col < 4; ++col)
+					{
+						writeValue(StringConverter::toString(xform[row][col]));
+					}
+				}
+			}
+
+			// Used to store the u and v speeds of scroll animation effects
+			float scrollAnimU = 0;
+			float scrollAnimV = 0;
+
+            EffectMap m_ef = pTex->getEffects();
+            if (!m_ef.empty())
+            {
+                EffectMap::const_iterator it;
+                for (it = m_ef.begin(); it != m_ef.end(); ++it)
+                {
+                    const TextureUnitState::TextureEffect& ef = it->second;
+                    switch (ef.type)
+                    {
+                    case TextureUnitState::ET_ENVIRONMENT_MAP :
+                        writeEnvironmentMapEffect(ef, pTex);
+                        break;
+                    case TextureUnitState::ET_ROTATE :
+                        writeRotationEffect(ef, pTex);
+                        break;
+					case TextureUnitState::ET_UVSCROLL :
+						scrollAnimU = scrollAnimV = ef.arg1;
+						break;
+                    case TextureUnitState::ET_USCROLL :
+						scrollAnimU = ef.arg1;
+						break;
+					case TextureUnitState::ET_VSCROLL :
+						scrollAnimV = ef.arg1;
+                        break;
+                    case TextureUnitState::ET_TRANSFORM :
+                        writeTransformEffect(ef, pTex);
+                        break;
+                    default:
+                        break;
+                    }
+                }
+            }
+
+			// u and v scroll animation speeds merged, if present serialize scroll_anim
+			if(scrollAnimU || scrollAnimV) {
+				TextureUnitState::TextureEffect texEffect;
+				texEffect.arg1 = scrollAnimU;
+				texEffect.arg2 = scrollAnimV;
+				writeScrollEffect(texEffect, pTex);
+			}
+
+			// Binding type
+			TextureUnitState::BindingType bt = pTex->getBindingType();
+			if (mDefaults ||
+				bt != TextureUnitState::BT_FRAGMENT)
+			{
+				writeAttribute(4, "binding_type");
+				switch(bt)
+				{
+				case TextureUnitState::BT_FRAGMENT:
+					writeValue("fragment");
+					break;
+				case TextureUnitState::BT_VERTEX:
+					writeValue("vertex");
+					break;
+				};
+		
+			}
+			// Content type
+			if (mDefaults ||
+				pTex->getContentType() != TextureUnitState::CONTENT_NAMED)
+			{
+				writeAttribute(4, "content_type");
+				switch(pTex->getContentType())
+				{
+				case TextureUnitState::CONTENT_NAMED:
+					writeValue("named");
+					break;
+				case TextureUnitState::CONTENT_SHADOW:
+					writeValue("shadow");
+					break;
+				};
+			}
+
+        }
+        endSection(3);
+
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeEnvironmentMapEffect(const TextureUnitState::TextureEffect& effect, const TextureUnitState *pTex)
+    {
+        writeAttribute(4, "env_map");
+        switch (effect.subtype)
+        {
+        case TextureUnitState::ENV_PLANAR:
+            writeValue("planar");
+            break;
+        case TextureUnitState::ENV_CURVED:
+            writeValue("spherical");
+            break;
+        case TextureUnitState::ENV_NORMAL:
+            writeValue("cubic_normal");
+            break;
+        case TextureUnitState::ENV_REFLECTION:
+            writeValue("cubic_reflection");
+            break;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeRotationEffect(const TextureUnitState::TextureEffect& effect, const TextureUnitState *pTex)
+    {
+        if (effect.arg1)
+        {
+            writeAttribute(4, "rotate_anim");
+            writeValue(StringConverter::toString(effect.arg1));
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeTransformEffect(const TextureUnitState::TextureEffect& effect, const TextureUnitState *pTex)
+    {
+        writeAttribute(4, "wave_xform");
+
+        switch (effect.subtype)
+        {
+        case TextureUnitState::TT_ROTATE:
+            writeValue("rotate");
+            break;
+        case TextureUnitState::TT_SCALE_U:
+            writeValue("scale_x");
+            break;
+        case TextureUnitState::TT_SCALE_V:
+            writeValue("scale_y");
+            break;
+        case TextureUnitState::TT_TRANSLATE_U:
+            writeValue("scroll_x");
+            break;
+        case TextureUnitState::TT_TRANSLATE_V:
+            writeValue("scroll_y");
+            break;
+        }
+
+        switch (effect.waveType)
+        {
+        case WFT_INVERSE_SAWTOOTH:
+            writeValue("inverse_sawtooth");
+            break;
+        case WFT_SAWTOOTH:
+            writeValue("sawtooth");
+            break;
+        case WFT_SINE:
+            writeValue("sine");
+            break;
+        case WFT_SQUARE:
+            writeValue("square");
+            break;
+        case WFT_TRIANGLE:
+            writeValue("triangle");
+            break;
+        case WFT_PWM:
+            writeValue("pwm");
+            break;
+        }
+
+        writeValue(StringConverter::toString(effect.base));
+        writeValue(StringConverter::toString(effect.frequency));
+        writeValue(StringConverter::toString(effect.phase));
+        writeValue(StringConverter::toString(effect.amplitude));
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeScrollEffect(
+		const TextureUnitState::TextureEffect& effect, const TextureUnitState *pTex)
+    {
+        if (effect.arg1 || effect.arg2)
+        {
+            writeAttribute(4, "scroll_anim");
+            writeValue(StringConverter::toString(effect.arg1));
+            writeValue(StringConverter::toString(effect.arg2));
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeSceneBlendFactor(const SceneBlendFactor sbf)
+    {
+        switch (sbf)
+        {
+        case SBF_DEST_ALPHA:
+            writeValue("dest_alpha");
+            break;
+        case SBF_DEST_COLOUR:
+            writeValue("dest_colour");
+            break;
+        case SBF_ONE:
+            writeValue("one");
+            break;
+        case SBF_ONE_MINUS_DEST_ALPHA:
+            writeValue("one_minus_dest_alpha");
+            break;
+        case SBF_ONE_MINUS_DEST_COLOUR:
+            writeValue("one_minus_dest_colour");
+            break;
+        case SBF_ONE_MINUS_SOURCE_ALPHA:
+            writeValue("one_minus_src_alpha");
+            break;
+        case SBF_ONE_MINUS_SOURCE_COLOUR:
+            writeValue("one_minus_src_colour");
+            break;
+        case SBF_SOURCE_ALPHA:
+            writeValue("src_alpha");
+            break;
+        case SBF_SOURCE_COLOUR:
+            writeValue("src_colour");
+            break;
+        case SBF_ZERO:
+            writeValue("zero");
+            break;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeSceneBlendFactor(const SceneBlendFactor sbf_src, const SceneBlendFactor sbf_dst)
+    {
+        if (sbf_src == SBF_ONE && sbf_dst == SBF_ONE )
+            writeValue("add");
+        else if (sbf_src == SBF_DEST_COLOUR && sbf_dst == SBF_ZERO)
+            writeValue("modulate");
+        else if (sbf_src == SBF_SOURCE_COLOUR && sbf_dst == SBF_ONE_MINUS_SOURCE_COLOUR)
+            writeValue("colour_blend");
+        else if (sbf_src == SBF_SOURCE_ALPHA && sbf_dst == SBF_ONE_MINUS_SOURCE_ALPHA)
+            writeValue("alpha_blend");
+        else
+        {
+            writeSceneBlendFactor(sbf_src);
+            writeSceneBlendFactor(sbf_dst);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeCompareFunction(const CompareFunction cf)
+    {
+        switch (cf)
+        {
+        case CMPF_ALWAYS_FAIL:
+            writeValue("always_fail");
+            break;
+        case CMPF_ALWAYS_PASS:
+            writeValue("always_pass");
+            break;
+        case CMPF_EQUAL:
+            writeValue("equal");
+            break;
+        case CMPF_GREATER:
+            writeValue("greater");
+            break;
+        case CMPF_GREATER_EQUAL:
+            writeValue("greater_equal");
+            break;
+        case CMPF_LESS:
+            writeValue("less");
+            break;
+        case CMPF_LESS_EQUAL:
+            writeValue("less_equal");
+            break;
+        case CMPF_NOT_EQUAL:
+            writeValue("not_equal");
+            break;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeColourValue(const ColourValue &colour, bool writeAlpha)
+    {
+        writeValue(StringConverter::toString(colour.r));
+        writeValue(StringConverter::toString(colour.g));
+        writeValue(StringConverter::toString(colour.b));
+        if (writeAlpha)
+            writeValue(StringConverter::toString(colour.a));
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeLayerBlendOperationEx(const LayerBlendOperationEx op)
+    {
+        switch (op)
+        {
+        case LBX_ADD:
+            writeValue("add");
+            break;
+        case LBX_ADD_SIGNED:
+            writeValue("add_signed");
+            break;
+        case LBX_ADD_SMOOTH:
+            writeValue("add_smooth");
+            break;
+        case LBX_BLEND_CURRENT_ALPHA:
+            writeValue("blend_current_alpha");
+            break;
+        case LBX_BLEND_DIFFUSE_COLOUR:
+            writeValue("blend_diffuse_colour");
+            break;
+        case LBX_BLEND_DIFFUSE_ALPHA:
+            writeValue("blend_diffuse_alpha");
+            break;
+        case LBX_BLEND_MANUAL:
+            writeValue("blend_manual");
+            break;
+        case LBX_BLEND_TEXTURE_ALPHA:
+            writeValue("blend_texture_alpha");
+            break;
+        case LBX_MODULATE:
+            writeValue("modulate");
+            break;
+        case LBX_MODULATE_X2:
+            writeValue("modulate_x2");
+            break;
+        case LBX_MODULATE_X4:
+            writeValue("modulate_x4");
+            break;
+        case LBX_SOURCE1:
+            writeValue("source1");
+            break;
+        case LBX_SOURCE2:
+            writeValue("source2");
+            break;
+        case LBX_SUBTRACT:
+            writeValue("subtract");
+            break;
+        case LBX_DOTPRODUCT:
+            writeValue("dotproduct");
+            break;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeLayerBlendSource(const LayerBlendSource lbs)
+    {
+        switch (lbs)
+        {
+        case LBS_CURRENT:
+            writeValue("src_current");
+            break;
+        case LBS_DIFFUSE:
+            writeValue("src_diffuse");
+            break;
+        case LBS_MANUAL:
+            writeValue("src_manual");
+            break;
+        case LBS_SPECULAR:
+            writeValue("src_specular");
+            break;
+        case LBS_TEXTURE:
+            writeValue("src_texture");
+            break;
+        }
+    }
+
+    // nfz
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeVertexProgramRef(const Pass* pPass)
+    {
+        writeGpuProgramRef("vertex_program_ref",
+            pPass->getVertexProgram(), pPass->getVertexProgramParameters());
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeShadowCasterVertexProgramRef(const Pass* pPass)
+    {
+        writeGpuProgramRef("shadow_caster_vertex_program_ref",
+            pPass->getShadowCasterVertexProgram(), pPass->getShadowCasterVertexProgramParameters());
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeShadowReceiverVertexProgramRef(const Pass* pPass)
+    {
+        writeGpuProgramRef("shadow_receiver_vertex_program_ref",
+            pPass->getShadowReceiverVertexProgram(), pPass->getShadowReceiverVertexProgramParameters());
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeShadowReceiverFragmentProgramRef(const Pass* pPass)
+    {
+        writeGpuProgramRef("shadow_receiver_fragment_program_ref",
+            pPass->getShadowReceiverFragmentProgram(), pPass->getShadowReceiverFragmentProgramParameters());
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeFragmentProgramRef(const Pass* pPass)
+    {
+        writeGpuProgramRef("fragment_program_ref",
+            pPass->getFragmentProgram(), pPass->getFragmentProgramParameters());
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeGpuProgramRef(const String& attrib,
+        const GpuProgramPtr& program, const GpuProgramParametersSharedPtr& params)
+    {
+        mBuffer += "\n";
+        writeAttribute(3, attrib);
+        writeValue(program->getName());
+        beginSection(3);
+        {
+            // write out paramters
+            GpuProgramParameters* defaultParams= 0;
+            // does the GPU program have default parameters?
+            if (program->hasDefaultParameters())
+                defaultParams = program->getDefaultParameters().getPointer();
+
+            writeGPUProgramParameters(params, defaultParams);
+        }
+        endSection(3);
+
+        // add to GpuProgram contatiner
+        mGpuProgramDefinitionContainer.insert(program->getName());
+    }
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeGPUProgramParameters(
+		const GpuProgramParametersSharedPtr& params,
+		GpuProgramParameters* defaultParams, const int level,
+		const bool useMainBuffer)
+    {
+        // iterate through the constant definitions
+		if (params->hasNamedParameters())
+		{
+			writeNamedGpuProgramParameters(params, defaultParams, level, useMainBuffer);
+		}
+		else
+		{
+			writeLowLevelGpuProgramParameters(params, defaultParams, level, useMainBuffer);
+		}
+	}
+	//-----------------------------------------------------------------------
+	void MaterialSerializer::writeNamedGpuProgramParameters(
+		const GpuProgramParametersSharedPtr& params,
+		GpuProgramParameters* defaultParams, const int level,
+		const bool useMainBuffer)
+	{
+		GpuConstantDefinitionIterator constIt = params->getConstantDefinitionIterator();
+		while(constIt.hasMoreElements())
+		{
+            // get the constant definition
+			const String& paramName = constIt.peekNextKey();
+			const GpuConstantDefinition& def =
+				constIt.getNext();
+
+			// get any auto-link
+			const GpuProgramParameters::AutoConstantEntry* autoEntry = 
+				params->findAutoConstantEntry(paramName);
+			const GpuProgramParameters::AutoConstantEntry* defaultAutoEntry = 0;
+			if (defaultParams)
+			{
+				defaultAutoEntry = 
+					defaultParams->findAutoConstantEntry(paramName);
+			}
+
+			writeGpuProgramParameter("param_named", 
+				paramName, autoEntry, defaultAutoEntry, def.isFloat(), 
+				def.physicalIndex, def.elementSize * def.arraySize,
+				params, defaultParams, level, useMainBuffer);
+		}
+
+    }
+	//-----------------------------------------------------------------------
+	void MaterialSerializer::writeLowLevelGpuProgramParameters(
+		const GpuProgramParametersSharedPtr& params,
+		GpuProgramParameters* defaultParams, const int level,
+		const bool useMainBuffer)
+	{
+		// Iterate over the logical->physical mappings
+		// This will represent the values which have been set
+
+		// float params
+		const GpuLogicalBufferStruct* floatLogical = params->getFloatLogicalBufferStruct();
+		{
+			OGRE_LOCK_MUTEX(floatLogical->mutex)
+
+			for(GpuLogicalIndexUseMap::const_iterator i = floatLogical->map.begin();
+				i != floatLogical->map.end(); ++i)
+			{
+				size_t logicalIndex = i->first;
+				const GpuLogicalIndexUse& logicalUse = i->second;
+
+				const GpuProgramParameters::AutoConstantEntry* autoEntry = 
+					params->findFloatAutoConstantEntry(logicalIndex);
+				const GpuProgramParameters::AutoConstantEntry* defaultAutoEntry = 0;
+				if (defaultParams)
+				{
+					defaultAutoEntry = defaultParams->findFloatAutoConstantEntry(logicalIndex);
+				}
+
+				writeGpuProgramParameter("param_indexed", 
+					StringConverter::toString(logicalIndex), autoEntry, 
+					defaultAutoEntry, true, logicalUse.physicalIndex, 
+					logicalUse.currentSize,
+					params, defaultParams, level, useMainBuffer);
+			}
+		}
+
+		// int params
+		const GpuLogicalBufferStruct* intLogical = params->getIntLogicalBufferStruct();
+		{
+			OGRE_LOCK_MUTEX(intLogical->mutex)
+
+			for(GpuLogicalIndexUseMap::const_iterator i = intLogical->map.begin();
+				i != intLogical->map.end(); ++i)
+			{
+				size_t logicalIndex = i->first;
+				const GpuLogicalIndexUse& logicalUse = i->second;
+
+				const GpuProgramParameters::AutoConstantEntry* autoEntry = 
+					params->findIntAutoConstantEntry(logicalIndex);
+				const GpuProgramParameters::AutoConstantEntry* defaultAutoEntry = 0;
+				if (defaultParams)
+				{
+					defaultAutoEntry = defaultParams->findIntAutoConstantEntry(logicalIndex);
+				}
+
+				writeGpuProgramParameter("param_indexed", 
+					StringConverter::toString(logicalIndex), autoEntry, 
+					defaultAutoEntry, false, logicalUse.physicalIndex, 
+					logicalUse.currentSize,
+					params, defaultParams, level, useMainBuffer);
+			}
+
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	void MaterialSerializer::writeGpuProgramParameter(
+		const String& commandName, const String& identifier, 
+		const GpuProgramParameters::AutoConstantEntry* autoEntry, 
+		const GpuProgramParameters::AutoConstantEntry* defaultAutoEntry, 
+		bool isFloat, size_t physicalIndex, size_t physicalSize,
+		const GpuProgramParametersSharedPtr& params, GpuProgramParameters* defaultParams,
+		const int level, const bool useMainBuffer)
+	{
+		// Skip any params with array qualifiers
+		// These are only for convenience of setters, the full array will be
+		// written using the base, non-array identifier
+		if (identifier.find("[") != String::npos)
+		{
+			return;
+		}
+
+		// get any auto-link
+		// don't duplicate constants that are defined as a default parameter
+		bool different = false;
+		if (defaultParams)
+		{
+			// if default is auto but we're not or vice versa
+			if ((autoEntry == 0) != (defaultAutoEntry == 0))
+			{
+				different = true;
+			}
+			else if (autoEntry)
+			{
+				// both must be auto
+				// compare the auto values
+				different = (autoEntry->paramType != defaultAutoEntry->paramType
+					|| autoEntry->data != defaultAutoEntry->data);
+			}
+			else
+			{
+				// compare the non-auto (raw buffer) values
+				// param buffers are always initialised with all zeros
+				// so unset == unset
+				if (isFloat)
+				{
+					different = memcmp(
+						params->getFloatPointer(physicalIndex), 
+						defaultParams->getFloatPointer(physicalIndex),
+						sizeof(float) * physicalSize) != 0;
+				}
+				else
+				{
+					different = memcmp(
+						params->getIntPointer(physicalIndex), 
+						defaultParams->getIntPointer(physicalIndex),
+						sizeof(int) * physicalSize) != 0;
+				}
+			}
+		}
+
+		if (!defaultParams || different)
+		{
+			String label = commandName;
+
+			// is it auto
+			if (autoEntry)
+				label += "_auto";
+
+			writeAttribute(level, label, useMainBuffer);
+			// output param index / name
+			writeValue(identifier, useMainBuffer);
+
+			// if auto output auto type name and data if needed
+			if (autoEntry)
+			{
+				const GpuProgramParameters::AutoConstantDefinition* autoConstDef =
+					GpuProgramParameters::getAutoConstantDefinition(autoEntry->paramType);
+
+				assert(autoConstDef && "Bad auto constant Definition Table");
+				// output auto constant name
+				writeValue(autoConstDef->name, useMainBuffer);
+				// output data if it uses it
+				switch(autoConstDef->dataType)
+				{
+				case GpuProgramParameters::ACDT_REAL:
+					writeValue(StringConverter::toString(autoEntry->fData), useMainBuffer);
+					break;
+
+				case GpuProgramParameters::ACDT_INT:
+					writeValue(StringConverter::toString(autoEntry->data), useMainBuffer);
+					break;
+
+				default:
+					break;
+				}
+			}
+			else // not auto so output all the values used
+			{
+				String countLabel;
+
+				// only write a number if > 1
+				if (physicalSize > 1)
+					countLabel = StringConverter::toString(physicalSize);
+
+				if (isFloat)
+				{
+					// Get pointer to start of values
+					const float* pFloat = params->getFloatPointer(physicalIndex);
+
+					writeValue("float" + countLabel, useMainBuffer);
+					// iterate through real constants
+					for (size_t f = 0 ; f < physicalSize; ++f)
+					{
+						writeValue(StringConverter::toString(*pFloat++), useMainBuffer);
+					}
+				}
+				else
+				{
+					// Get pointer to start of values
+					const int* pInt = params->getIntPointer(physicalIndex);
+
+					writeValue("int" + countLabel, useMainBuffer);
+					// iterate through real constants
+					for (size_t f = 0 ; f < physicalSize; ++f)
+					{
+						writeValue(StringConverter::toString(*pInt++), useMainBuffer);
+					}
+
+				} // end if (float/int)
+
+			}
+
+		}
+
+	}
+    //-----------------------------------------------------------------------
+    void MaterialSerializer::writeGpuPrograms(void)
+    {
+        // iterate through gpu program names in container
+        GpuProgramDefIterator currentDef = mGpuProgramDefinitionContainer.begin();
+        GpuProgramDefIterator endDef = mGpuProgramDefinitionContainer.end();
+
+        while (currentDef != endDef)
+        {
+            // get gpu program from gpu program manager
+            GpuProgramPtr program = GpuProgramManager::getSingleton().getByName((*currentDef));
+            // write gpu program definition type to buffer
+            // check program type for vertex program
+            // write program type
+            mGpuProgramBuffer += "\n";
+            writeAttribute(0, program->getParameter("type"), false);
+
+            // write program name
+            writeValue( program->getName(), false);
+            // write program language
+            const String language = program->getLanguage();
+            writeValue( language, false );
+            // write opening braces
+            beginSection(0, false);
+            {
+                // write program source + filenmae
+                writeAttribute(1, "source", false);
+                writeValue(program->getSourceFile(), false);
+                // write special parameters based on language
+                const ParameterList& params = program->getParameters();
+                ParameterList::const_iterator currentParam = params.begin();
+                ParameterList::const_iterator endParam = params.end();
+
+                while (currentParam != endParam)
+                {
+                    if (currentParam->name != "type")
+                    {
+                        String paramstr = program->getParameter(currentParam->name);
+                        if ((currentParam->name == "includes_skeletal_animation")
+                            && (paramstr == "false"))
+                            paramstr.clear();
+						if ((currentParam->name == "includes_morph_animation")
+							&& (paramstr == "false"))
+							paramstr.clear();
+						if ((currentParam->name == "includes_pose_animation")
+							&& (paramstr == "0"))
+							paramstr.clear();
+						if ((currentParam->name == "uses_vertex_texture_fetch")
+							&& (paramstr == "false"))
+							paramstr.clear();
+
+                        if ((language != "asm") && (currentParam->name == "syntax"))
+                            paramstr.clear();
+
+                        if (!paramstr.empty())
+                        {
+                            writeAttribute(1, currentParam->name, false);
+                            writeValue(paramstr, false);
+                        }
+                    }
+                    ++currentParam;
+                }
+
+                // write default parameters
+                if (program->hasDefaultParameters())
+                {
+                    mGpuProgramBuffer += "\n";
+                    GpuProgramParametersSharedPtr gpuDefaultParams = program->getDefaultParameters();
+                    writeAttribute(1, "default_params", false);
+                    beginSection(1, false);
+                    writeGPUProgramParameters(gpuDefaultParams, 0, 2, false);
+                    endSection(1, false);
+                }
+            }
+            // write closing braces
+            endSection(0, false);
+
+            ++currentDef;
+
+        }
+
+        mGpuProgramBuffer += "\n";
+    }
+
+}
Index: /OgreMain/src/OgreMath.cpp
===================================================================
--- /OgreMain/src/OgreMath.cpp	(revision 5)
+++ /OgreMain/src/OgreMath.cpp	(revision 5)
@@ -0,0 +1,932 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreMath.h"
+#include "asm_math.h"
+#include "OgreVector2.h"
+#include "OgreVector3.h"
+#include "OgreVector4.h"
+#include "OgreRay.h"
+#include "OgreSphere.h"
+#include "OgreAxisAlignedBox.h"
+#include "OgrePlane.h"
+
+
+namespace Ogre
+{
+
+    const Real Math::POS_INFINITY = std::numeric_limits<Real>::infinity();
+    const Real Math::NEG_INFINITY = -std::numeric_limits<Real>::infinity();
+    const Real Math::PI = Real( 4.0 * atan( 1.0 ) );
+    const Real Math::TWO_PI = Real( 2.0 * PI );
+    const Real Math::HALF_PI = Real( 0.5 * PI );
+	const Real Math::fDeg2Rad = PI / Real(180.0);
+	const Real Math::fRad2Deg = Real(180.0) / PI;
+
+    int Math::mTrigTableSize;
+   Math::AngleUnit Math::msAngleUnit;
+
+    Real  Math::mTrigTableFactor;
+    Real *Math::mSinTable = NULL;
+    Real *Math::mTanTable = NULL;
+
+    //-----------------------------------------------------------------------
+    Math::Math( unsigned int trigTableSize )
+    {
+        msAngleUnit = AU_DEGREE;
+
+        mTrigTableSize = trigTableSize;
+        mTrigTableFactor = mTrigTableSize / Math::TWO_PI;
+
+        mSinTable = new Real[mTrigTableSize];
+        mTanTable = new Real[mTrigTableSize];
+
+        buildTrigTables();
+    }
+
+    //-----------------------------------------------------------------------
+    Math::~Math()
+    {
+        delete [] mSinTable;
+        delete [] mTanTable;
+    }
+
+    //-----------------------------------------------------------------------
+    void Math::buildTrigTables(void)
+    {
+        // Build trig lookup tables
+        // Could get away with building only PI sized Sin table but simpler this 
+        // way. Who cares, it'll ony use an extra 8k of memory anyway and I like 
+        // simplicity.
+        Real angle;
+        for (int i = 0; i < mTrigTableSize; ++i)
+        {
+            angle = Math::TWO_PI * i / mTrigTableSize;
+            mSinTable[i] = sin(angle);
+            mTanTable[i] = tan(angle);
+        }
+    }
+	//-----------------------------------------------------------------------	
+	Real Math::SinTable (Real fValue)
+    {
+        // Convert range to index values, wrap if required
+        int idx;
+        if (fValue >= 0)
+        {
+            idx = int(fValue * mTrigTableFactor) % mTrigTableSize;
+        }
+        else
+        {
+            idx = mTrigTableSize - (int(-fValue * mTrigTableFactor) % mTrigTableSize) - 1;
+        }
+
+        return mSinTable[idx];
+    }
+	//-----------------------------------------------------------------------
+	Real Math::TanTable (Real fValue)
+    {
+        // Convert range to index values, wrap if required
+		int idx = int(fValue *= mTrigTableFactor) % mTrigTableSize;
+		return mTanTable[idx];
+    }
+    //-----------------------------------------------------------------------
+    int Math::ISign (int iValue)
+    {
+        return ( iValue > 0 ? +1 : ( iValue < 0 ? -1 : 0 ) );
+    }
+    //-----------------------------------------------------------------------
+    Radian Math::ACos (Real fValue)
+    {
+        if ( -1.0 < fValue )
+        {
+            if ( fValue < 1.0 )
+                return Radian(acos(fValue));
+            else
+                return Radian(0.0);
+        }
+        else
+        {
+            return Radian(PI);
+        }
+    }
+    //-----------------------------------------------------------------------
+    Radian Math::ASin (Real fValue)
+    {
+        if ( -1.0 < fValue )
+        {
+            if ( fValue < 1.0 )
+                return Radian(asin(fValue));
+            else
+                return Radian(HALF_PI);
+        }
+        else
+        {
+            return Radian(-HALF_PI);
+        }
+    }
+    //-----------------------------------------------------------------------
+    Real Math::Sign (Real fValue)
+    {
+        if ( fValue > 0.0 )
+            return 1.0;
+
+        if ( fValue < 0.0 )
+            return -1.0;
+
+        return 0.0;
+    }
+	//-----------------------------------------------------------------------
+	Real Math::InvSqrt(Real fValue)
+	{
+		return Real(asm_rsq(fValue));
+	}
+    //-----------------------------------------------------------------------
+    Real Math::UnitRandom ()
+    {
+        return asm_rand() / asm_rand_max();
+    }
+    
+    //-----------------------------------------------------------------------
+    Real Math::RangeRandom (Real fLow, Real fHigh)
+    {
+        return (fHigh-fLow)*UnitRandom() + fLow;
+    }
+
+    //-----------------------------------------------------------------------
+    Real Math::SymmetricRandom ()
+    {
+		return 2.0f * UnitRandom() - 1.0f;
+    }
+
+   //-----------------------------------------------------------------------
+    void Math::setAngleUnit(Math::AngleUnit unit)
+   {
+       msAngleUnit = unit;
+   }
+   //-----------------------------------------------------------------------
+   Math::AngleUnit Math::getAngleUnit(void)
+   {
+       return msAngleUnit;
+   }
+    //-----------------------------------------------------------------------
+    Real Math::AngleUnitsToRadians(Real angleunits)
+    {
+       if (msAngleUnit == AU_DEGREE)
+           return angleunits * fDeg2Rad;
+       else
+           return angleunits;
+    }
+
+    //-----------------------------------------------------------------------
+    Real Math::RadiansToAngleUnits(Real radians)
+    {
+       if (msAngleUnit == AU_DEGREE)
+           return radians * fRad2Deg;
+       else
+           return radians;
+    }
+
+    //-----------------------------------------------------------------------
+    Real Math::AngleUnitsToDegrees(Real angleunits)
+    {
+       if (msAngleUnit == AU_RADIAN)
+           return angleunits * fRad2Deg;
+       else
+           return angleunits;
+    }
+
+    //-----------------------------------------------------------------------
+    Real Math::DegreesToAngleUnits(Real degrees)
+    {
+       if (msAngleUnit == AU_RADIAN)
+           return degrees * fDeg2Rad;
+       else
+           return degrees;
+    }
+
+    //-----------------------------------------------------------------------
+	bool Math::pointInTri2D(const Vector2& p, const Vector2& a, 
+		const Vector2& b, const Vector2& c)
+    {
+		// Winding must be consistent from all edges for point to be inside
+		Vector2 v1, v2;
+		Real dot[3];
+		bool zeroDot[3];
+
+		v1 = b - a;
+		v2 = p - a;
+
+		// Note we don't care about normalisation here since sign is all we need
+		// It means we don't have to worry about magnitude of cross products either
+		dot[0] = v1.crossProduct(v2);
+		zeroDot[0] = Math::RealEqual(dot[0], 0.0f, 1e-3);
+
+
+		v1 = c - b;
+		v2 = p - b;
+
+		dot[1] = v1.crossProduct(v2);
+		zeroDot[1] = Math::RealEqual(dot[1], 0.0f, 1e-3);
+
+		// Compare signs (ignore colinear / coincident points)
+		if(!zeroDot[0] && !zeroDot[1] 
+		&& Math::Sign(dot[0]) != Math::Sign(dot[1]))
+		{
+			return false;
+		}
+
+		v1 = a - c;
+		v2 = p - c;
+
+		dot[2] = v1.crossProduct(v2);
+		zeroDot[2] = Math::RealEqual(dot[2], 0.0f, 1e-3);
+		// Compare signs (ignore colinear / coincident points)
+		if((!zeroDot[0] && !zeroDot[2] 
+			&& Math::Sign(dot[0]) != Math::Sign(dot[2])) ||
+			(!zeroDot[1] && !zeroDot[2] 
+			&& Math::Sign(dot[1]) != Math::Sign(dot[2])))
+		{
+			return false;
+		}
+
+
+		return true;
+    }
+	//-----------------------------------------------------------------------
+	bool Math::pointInTri3D(const Vector3& p, const Vector3& a, 
+		const Vector3& b, const Vector3& c, const Vector3& normal)
+	{
+        // Winding must be consistent from all edges for point to be inside
+		Vector3 v1, v2;
+		Real dot[3];
+		bool zeroDot[3];
+
+        v1 = b - a;
+        v2 = p - a;
+
+		// Note we don't care about normalisation here since sign is all we need
+		// It means we don't have to worry about magnitude of cross products either
+        dot[0] = v1.crossProduct(v2).dotProduct(normal);
+		zeroDot[0] = Math::RealEqual(dot[0], 0.0f, 1e-3);
+
+
+        v1 = c - b;
+        v2 = p - b;
+
+		dot[1] = v1.crossProduct(v2).dotProduct(normal);
+		zeroDot[1] = Math::RealEqual(dot[1], 0.0f, 1e-3);
+
+		// Compare signs (ignore colinear / coincident points)
+		if(!zeroDot[0] && !zeroDot[1] 
+			&& Math::Sign(dot[0]) != Math::Sign(dot[1]))
+		{
+            return false;
+		}
+
+        v1 = a - c;
+        v2 = p - c;
+
+		dot[2] = v1.crossProduct(v2).dotProduct(normal);
+		zeroDot[2] = Math::RealEqual(dot[2], 0.0f, 1e-3);
+		// Compare signs (ignore colinear / coincident points)
+		if((!zeroDot[0] && !zeroDot[2] 
+			&& Math::Sign(dot[0]) != Math::Sign(dot[2])) ||
+			(!zeroDot[1] && !zeroDot[2] 
+			&& Math::Sign(dot[1]) != Math::Sign(dot[2])))
+		{
+			return false;
+		}
+
+
+        return true;
+	}
+    //-----------------------------------------------------------------------
+    bool Math::RealEqual( Real a, Real b, Real tolerance )
+    {
+        if (fabs(b-a) <= tolerance)
+            return true;
+        else
+            return false;
+    }
+
+    //-----------------------------------------------------------------------
+    std::pair<bool, Real> Math::intersects(const Ray& ray, const Plane& plane)
+    {
+
+        Real denom = plane.normal.dotProduct(ray.getDirection());
+        if (Math::Abs(denom) < std::numeric_limits<Real>::epsilon())
+        {
+            // Parallel
+            return std::pair<bool, Real>(false, 0);
+        }
+        else
+        {
+            Real nom = plane.normal.dotProduct(ray.getOrigin()) + plane.d;
+            Real t = -(nom/denom);
+            return std::pair<bool, Real>(t >= 0, t);
+        }
+        
+    }
+    //-----------------------------------------------------------------------
+    std::pair<bool, Real> Math::intersects(const Ray& ray, 
+        const std::vector<Plane>& planes, bool normalIsOutside)
+    {
+        std::vector<Plane>::const_iterator planeit, planeitend;
+        planeitend = planes.end();
+        bool allInside = true;
+        std::pair<bool, Real> ret;
+        ret.first = false;
+        ret.second = 0.0f;
+
+        // derive side
+        // NB we don't pass directly since that would require Plane::Side in 
+        // interface, which results in recursive includes since Math is so fundamental
+        Plane::Side outside = normalIsOutside ? Plane::POSITIVE_SIDE : Plane::NEGATIVE_SIDE;
+
+        for (planeit = planes.begin(); planeit != planeitend; ++planeit)
+        {
+            const Plane& plane = *planeit;
+            // is origin outside?
+            if (plane.getSide(ray.getOrigin()) == outside)
+            {
+                allInside = false;
+                // Test single plane
+                std::pair<bool, Real> planeRes = 
+                    ray.intersects(plane);
+                if (planeRes.first)
+                {
+                    // Ok, we intersected
+                    ret.first = true;
+                    // Use the most distant result since convex volume
+                    ret.second = std::max(ret.second, planeRes.second);
+                }
+            }
+        }
+
+        if (allInside)
+        {
+            // Intersecting at 0 distance since inside the volume!
+            ret.first = true;
+            ret.second = 0.0f;
+        }
+
+        return ret;
+    }
+    //-----------------------------------------------------------------------
+    std::pair<bool, Real> Math::intersects(const Ray& ray, 
+        const std::list<Plane>& planes, bool normalIsOutside)
+    {
+        std::list<Plane>::const_iterator planeit, planeitend;
+        planeitend = planes.end();
+        bool allInside = true;
+        std::pair<bool, Real> ret;
+        ret.first = false;
+        ret.second = 0.0f;
+
+        // derive side
+        // NB we don't pass directly since that would require Plane::Side in 
+        // interface, which results in recursive includes since Math is so fundamental
+        Plane::Side outside = normalIsOutside ? Plane::POSITIVE_SIDE : Plane::NEGATIVE_SIDE;
+
+        for (planeit = planes.begin(); planeit != planeitend; ++planeit)
+        {
+            const Plane& plane = *planeit;
+            // is origin outside?
+            if (plane.getSide(ray.getOrigin()) == outside)
+            {
+                allInside = false;
+                // Test single plane
+                std::pair<bool, Real> planeRes = 
+                    ray.intersects(plane);
+                if (planeRes.first)
+                {
+                    // Ok, we intersected
+                    ret.first = true;
+                    // Use the most distant result since convex volume
+                    ret.second = std::max(ret.second, planeRes.second);
+                }
+            }
+        }
+
+        if (allInside)
+        {
+            // Intersecting at 0 distance since inside the volume!
+            ret.first = true;
+            ret.second = 0.0f;
+        }
+
+        return ret;
+    }
+    //-----------------------------------------------------------------------
+    std::pair<bool, Real> Math::intersects(const Ray& ray, const Sphere& sphere, 
+        bool discardInside)
+    {
+        const Vector3& raydir = ray.getDirection();
+        // Adjust ray origin relative to sphere center
+        const Vector3& rayorig = ray.getOrigin() - sphere.getCenter();
+        Real radius = sphere.getRadius();
+
+        // Check origin inside first
+        if (rayorig.squaredLength() <= radius*radius && discardInside)
+        {
+            return std::pair<bool, Real>(true, 0);
+        }
+
+        // Mmm, quadratics
+        // Build coeffs which can be used with std quadratic solver
+        // ie t = (-b +/- sqrt(b*b + 4ac)) / 2a
+        Real a = raydir.dotProduct(raydir);
+        Real b = 2 * rayorig.dotProduct(raydir);
+        Real c = rayorig.dotProduct(rayorig) - radius*radius;
+
+        // Calc determinant
+        Real d = (b*b) - (4 * a * c);
+        if (d < 0)
+        {
+            // No intersection
+            return std::pair<bool, Real>(false, 0);
+        }
+        else
+        {
+            // BTW, if d=0 there is one intersection, if d > 0 there are 2
+            // But we only want the closest one, so that's ok, just use the 
+            // '-' version of the solver
+            Real t = ( -b - Math::Sqrt(d) ) / (2 * a);
+            if (t < 0)
+                t = ( -b + Math::Sqrt(d) ) / (2 * a);
+            return std::pair<bool, Real>(true, t);
+        }
+
+
+    }
+    //-----------------------------------------------------------------------
+	std::pair<bool, Real> Math::intersects(const Ray& ray, const AxisAlignedBox& box)
+	{
+		if (box.isNull()) return std::pair<bool, Real>(false, 0);
+		if (box.isInfinite()) return std::pair<bool, Real>(true, 0);
+
+		Real lowt = 0.0f;
+		Real t;
+		bool hit = false;
+		Vector3 hitpoint;
+		const Vector3& min = box.getMinimum();
+		const Vector3& max = box.getMaximum();
+		const Vector3& rayorig = ray.getOrigin();
+		const Vector3& raydir = ray.getDirection();
+
+		// Check origin inside first
+		if ( rayorig > min && rayorig < max )
+		{
+			return std::pair<bool, Real>(true, 0);
+		}
+
+		// Check each face in turn, only check closest 3
+		// Min x
+		if (rayorig.x <= min.x && raydir.x > 0)
+		{
+			t = (min.x - rayorig.x) / raydir.x;
+			if (t >= 0)
+			{
+				// Substitute t back into ray and check bounds and dist
+				hitpoint = rayorig + raydir * t;
+				if (hitpoint.y >= min.y && hitpoint.y <= max.y &&
+					hitpoint.z >= min.z && hitpoint.z <= max.z &&
+					(!hit || t < lowt))
+				{
+					hit = true;
+					lowt = t;
+				}
+			}
+		}
+		// Max x
+		if (rayorig.x >= max.x && raydir.x < 0)
+		{
+			t = (max.x - rayorig.x) / raydir.x;
+			if (t >= 0)
+			{
+				// Substitute t back into ray and check bounds and dist
+				hitpoint = rayorig + raydir * t;
+				if (hitpoint.y >= min.y && hitpoint.y <= max.y &&
+					hitpoint.z >= min.z && hitpoint.z <= max.z &&
+					(!hit || t < lowt))
+				{
+					hit = true;
+					lowt = t;
+				}
+			}
+		}
+		// Min y
+		if (rayorig.y <= min.y && raydir.y > 0)
+		{
+			t = (min.y - rayorig.y) / raydir.y;
+			if (t >= 0)
+			{
+				// Substitute t back into ray and check bounds and dist
+				hitpoint = rayorig + raydir * t;
+				if (hitpoint.x >= min.x && hitpoint.x <= max.x &&
+					hitpoint.z >= min.z && hitpoint.z <= max.z &&
+					(!hit || t < lowt))
+				{
+					hit = true;
+					lowt = t;
+				}
+			}
+		}
+		// Max y
+		if (rayorig.y >= max.y && raydir.y < 0)
+		{
+			t = (max.y - rayorig.y) / raydir.y;
+			if (t >= 0)
+			{
+				// Substitute t back into ray and check bounds and dist
+				hitpoint = rayorig + raydir * t;
+				if (hitpoint.x >= min.x && hitpoint.x <= max.x &&
+					hitpoint.z >= min.z && hitpoint.z <= max.z &&
+					(!hit || t < lowt))
+				{
+					hit = true;
+					lowt = t;
+				}
+			}
+		}
+		// Min z
+		if (rayorig.z <= min.z && raydir.z > 0)
+		{
+			t = (min.z - rayorig.z) / raydir.z;
+			if (t >= 0)
+			{
+				// Substitute t back into ray and check bounds and dist
+				hitpoint = rayorig + raydir * t;
+				if (hitpoint.x >= min.x && hitpoint.x <= max.x &&
+					hitpoint.y >= min.y && hitpoint.y <= max.y &&
+					(!hit || t < lowt))
+				{
+					hit = true;
+					lowt = t;
+				}
+			}
+		}
+		// Max z
+		if (rayorig.z >= max.z && raydir.z < 0)
+		{
+			t = (max.z - rayorig.z) / raydir.z;
+			if (t >= 0)
+			{
+				// Substitute t back into ray and check bounds and dist
+				hitpoint = rayorig + raydir * t;
+				if (hitpoint.x >= min.x && hitpoint.x <= max.x &&
+					hitpoint.y >= min.y && hitpoint.y <= max.y &&
+					(!hit || t < lowt))
+				{
+					hit = true;
+					lowt = t;
+				}
+			}
+		}
+
+		return std::pair<bool, Real>(hit, lowt);
+
+	} 
+    //-----------------------------------------------------------------------
+    bool Math::intersects(const Ray& ray, const AxisAlignedBox& box,
+        Real* d1, Real* d2)
+    {
+        if (box.isNull())
+            return false;
+
+        if (box.isInfinite())
+        {
+            if (d1) *d1 = 0;
+            if (d2) *d2 = Math::POS_INFINITY;
+            return true;
+        }
+
+        const Vector3& min = box.getMinimum();
+        const Vector3& max = box.getMaximum();
+        const Vector3& rayorig = ray.getOrigin();
+        const Vector3& raydir = ray.getDirection();
+
+        Vector3 absDir;
+        absDir[0] = Math::Abs(raydir[0]);
+        absDir[1] = Math::Abs(raydir[1]);
+        absDir[2] = Math::Abs(raydir[2]);
+
+        // Sort the axis, ensure check minimise floating error axis first
+        int imax = 0, imid = 1, imin = 2;
+        if (absDir[0] < absDir[2])
+        {
+            imax = 2;
+            imin = 0;
+        }
+        if (absDir[1] < absDir[imin])
+        {
+            imid = imin;
+            imin = 1;
+        }
+        else if (absDir[1] > absDir[imax])
+        {
+            imid = imax;
+            imax = 1;
+        }
+
+        Real start = 0, end = Math::POS_INFINITY;
+
+#define _CALC_AXIS(i)                                       \
+    do {                                                    \
+        Real denom = 1 / raydir[i];                         \
+        Real newstart = (min[i] - rayorig[i]) * denom;      \
+        Real newend = (max[i] - rayorig[i]) * denom;        \
+        if (newstart > newend) std::swap(newstart, newend); \
+        if (newstart > end || newend < start) return false; \
+        if (newstart > start) start = newstart;             \
+        if (newend < end) end = newend;                     \
+    } while(0)
+
+        // Check each axis in turn
+
+        _CALC_AXIS(imax);
+
+        if (absDir[imid] < std::numeric_limits<Real>::epsilon())
+        {
+            // Parallel with middle and minimise axis, check bounds only
+            if (rayorig[imid] < min[imid] || rayorig[imid] > max[imid] ||
+                rayorig[imin] < min[imin] || rayorig[imin] > max[imin])
+                return false;
+        }
+        else
+        {
+            _CALC_AXIS(imid);
+
+            if (absDir[imin] < std::numeric_limits<Real>::epsilon())
+            {
+                // Parallel with minimise axis, check bounds only
+                if (rayorig[imin] < min[imin] || rayorig[imin] > max[imin])
+                    return false;
+            }
+            else
+            {
+                _CALC_AXIS(imin);
+            }
+        }
+#undef _CALC_AXIS
+
+        if (d1) *d1 = start;
+        if (d2) *d2 = end;
+
+        return true;
+    }
+    //-----------------------------------------------------------------------
+    std::pair<bool, Real> Math::intersects(const Ray& ray, const Vector3& a,
+        const Vector3& b, const Vector3& c, const Vector3& normal,
+        bool positiveSide, bool negativeSide)
+    {
+        //
+        // Calculate intersection with plane.
+        //
+        Real t;
+        {
+            Real denom = normal.dotProduct(ray.getDirection());
+
+            // Check intersect side
+            if (denom > + std::numeric_limits<Real>::epsilon())
+            {
+                if (!negativeSide)
+                    return std::pair<bool, Real>(false, 0);
+            }
+            else if (denom < - std::numeric_limits<Real>::epsilon())
+            {
+                if (!positiveSide)
+                    return std::pair<bool, Real>(false, 0);
+            }
+            else
+            {
+                // Parallel or triangle area is close to zero when
+                // the plane normal not normalised.
+                return std::pair<bool, Real>(false, 0);
+            }
+
+            t = normal.dotProduct(a - ray.getOrigin()) / denom;
+
+            if (t < 0)
+            {
+                // Intersection is behind origin
+                return std::pair<bool, Real>(false, 0);
+            }
+        }
+
+        //
+        // Calculate the largest area projection plane in X, Y or Z.
+        //
+        size_t i0, i1;
+        {
+            Real n0 = Math::Abs(normal[0]);
+            Real n1 = Math::Abs(normal[1]);
+            Real n2 = Math::Abs(normal[2]);
+
+            i0 = 1; i1 = 2;
+            if (n1 > n2)
+            {
+                if (n1 > n0) i0 = 0;
+            }
+            else
+            {
+                if (n2 > n0) i1 = 0;
+            }
+        }
+
+        //
+        // Check the intersection point is inside the triangle.
+        //
+        {
+            Real u1 = b[i0] - a[i0];
+            Real v1 = b[i1] - a[i1];
+            Real u2 = c[i0] - a[i0];
+            Real v2 = c[i1] - a[i1];
+            Real u0 = t * ray.getDirection()[i0] + ray.getOrigin()[i0] - a[i0];
+            Real v0 = t * ray.getDirection()[i1] + ray.getOrigin()[i1] - a[i1];
+
+            Real alpha = u0 * v2 - u2 * v0;
+            Real beta  = u1 * v0 - u0 * v1;
+            Real area  = u1 * v2 - u2 * v1;
+
+            // epsilon to avoid float precision error
+            const Real EPSILON = 1e-3f;
+
+            Real tolerance = - EPSILON * area;
+
+            if (area > 0)
+            {
+                if (alpha < tolerance || beta < tolerance || alpha+beta > area-tolerance)
+                    return std::pair<bool, Real>(false, 0);
+            }
+            else
+            {
+                if (alpha > tolerance || beta > tolerance || alpha+beta < area-tolerance)
+                    return std::pair<bool, Real>(false, 0);
+            }
+        }
+
+        return std::pair<bool, Real>(true, t);
+    }
+    //-----------------------------------------------------------------------
+    std::pair<bool, Real> Math::intersects(const Ray& ray, const Vector3& a,
+        const Vector3& b, const Vector3& c,
+        bool positiveSide, bool negativeSide)
+    {
+        Vector3 normal = calculateBasicFaceNormalWithoutNormalize(a, b, c);
+        return intersects(ray, a, b, c, normal, positiveSide, negativeSide);
+    }
+    //-----------------------------------------------------------------------
+    bool Math::intersects(const Sphere& sphere, const AxisAlignedBox& box)
+    {
+        if (box.isNull()) return false;
+        if (box.isInfinite()) return true;
+
+        // Use splitting planes
+        const Vector3& center = sphere.getCenter();
+        Real radius = sphere.getRadius();
+        const Vector3& min = box.getMinimum();
+        const Vector3& max = box.getMaximum();
+
+		// Arvo's algorithm
+		Real s, d = 0;
+		for (int i = 0; i < 3; ++i)
+		{
+			if (center.ptr()[i] < min.ptr()[i])
+			{
+				s = center.ptr()[i] - min.ptr()[i];
+				d += s * s; 
+			}
+			else if(center.ptr()[i] > max.ptr()[i])
+			{
+				s = center.ptr()[i] - max.ptr()[i];
+				d += s * s; 
+			}
+		}
+		return d <= radius * radius;
+
+    }
+    //-----------------------------------------------------------------------
+    bool Math::intersects(const Plane& plane, const AxisAlignedBox& box)
+    {
+        return (plane.getSide(box) == Plane::BOTH_SIDE);
+    }
+    //-----------------------------------------------------------------------
+    bool Math::intersects(const Sphere& sphere, const Plane& plane)
+    {
+        return (
+            Math::Abs(plane.getDistance(sphere.getCenter()))
+            <= sphere.getRadius() );
+    }
+    //-----------------------------------------------------------------------
+    Vector3 Math::calculateTangentSpaceVector(
+        const Vector3& position1, const Vector3& position2, const Vector3& position3,
+        Real u1, Real v1, Real u2, Real v2, Real u3, Real v3)
+    {
+	    //side0 is the vector along one side of the triangle of vertices passed in, 
+	    //and side1 is the vector along another side. Taking the cross product of these returns the normal.
+	    Vector3 side0 = position1 - position2;
+	    Vector3 side1 = position3 - position1;
+	    //Calculate face normal
+	    Vector3 normal = side1.crossProduct(side0);
+	    normal.normalise();
+	    //Now we use a formula to calculate the tangent. 
+	    Real deltaV0 = v1 - v2;
+	    Real deltaV1 = v3 - v1;
+	    Vector3 tangent = deltaV1 * side0 - deltaV0 * side1;
+	    tangent.normalise();
+	    //Calculate binormal
+	    Real deltaU0 = u1 - u2;
+	    Real deltaU1 = u3 - u1;
+	    Vector3 binormal = deltaU1 * side0 - deltaU0 * side1;
+	    binormal.normalise();
+	    //Now, we take the cross product of the tangents to get a vector which 
+	    //should point in the same direction as our normal calculated above. 
+	    //If it points in the opposite direction (the dot product between the normals is less than zero), 
+	    //then we need to reverse the s and t tangents. 
+	    //This is because the triangle has been mirrored when going from tangent space to object space.
+	    //reverse tangents if necessary
+	    Vector3 tangentCross = tangent.crossProduct(binormal);
+	    if (tangentCross.dotProduct(normal) < 0.0f)
+	    {
+		    tangent = -tangent;
+		    binormal = -binormal;
+	    }
+
+        return tangent;
+
+    }
+    //-----------------------------------------------------------------------
+    Matrix4 Math::buildReflectionMatrix(const Plane& p)
+    {
+        return Matrix4(
+            -2 * p.normal.x * p.normal.x + 1,   -2 * p.normal.x * p.normal.y,       -2 * p.normal.x * p.normal.z,       -2 * p.normal.x * p.d, 
+            -2 * p.normal.y * p.normal.x,       -2 * p.normal.y * p.normal.y + 1,   -2 * p.normal.y * p.normal.z,       -2 * p.normal.y * p.d, 
+            -2 * p.normal.z * p.normal.x,       -2 * p.normal.z * p.normal.y,       -2 * p.normal.z * p.normal.z + 1,   -2 * p.normal.z * p.d, 
+            0,                                  0,                                  0,                                  1);
+    }
+    //-----------------------------------------------------------------------
+    Vector4 Math::calculateFaceNormal(const Vector3& v1, const Vector3& v2, const Vector3& v3)
+    {
+        Vector3 normal = calculateBasicFaceNormal(v1, v2, v3);
+        // Now set up the w (distance of tri from origin
+        return Vector4(normal.x, normal.y, normal.z, -(normal.dotProduct(v1)));
+    }
+    //-----------------------------------------------------------------------
+    Vector3 Math::calculateBasicFaceNormal(const Vector3& v1, const Vector3& v2, const Vector3& v3)
+    {
+        Vector3 normal = (v2 - v1).crossProduct(v3 - v1);
+        normal.normalise();
+        return normal;
+    }
+    //-----------------------------------------------------------------------
+    Vector4 Math::calculateFaceNormalWithoutNormalize(const Vector3& v1, const Vector3& v2, const Vector3& v3)
+    {
+        Vector3 normal = calculateBasicFaceNormalWithoutNormalize(v1, v2, v3);
+        // Now set up the w (distance of tri from origin)
+        return Vector4(normal.x, normal.y, normal.z, -(normal.dotProduct(v1)));
+    }
+    //-----------------------------------------------------------------------
+    Vector3 Math::calculateBasicFaceNormalWithoutNormalize(const Vector3& v1, const Vector3& v2, const Vector3& v3)
+    {
+        Vector3 normal = (v2 - v1).crossProduct(v3 - v1);
+        return normal;
+    }
+	//-----------------------------------------------------------------------
+	Real Math::gaussianDistribution(Real x, Real offset, Real scale)
+	{
+		Real nom = Math::Exp(
+			-Math::Sqr(x - offset) / (2 * Math::Sqr(scale)));
+		Real denom = scale * Math::Sqrt(2 * Math::PI);
+
+		return nom / denom;
+
+	}
+}
Index: /OgreMain/src/OgreMatrix3.cpp
===================================================================
--- /OgreMain/src/OgreMatrix3.cpp	(revision 5)
+++ /OgreMain/src/OgreMatrix3.cpp	(revision 5)
@@ -0,0 +1,1512 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreMatrix3.h"
+
+#include "OgreMath.h"
+
+// Adapted from Matrix math by Wild Magic http://www.geometrictools.com/
+
+namespace Ogre
+{
+    const Real Matrix3::EPSILON = 1e-06;
+    const Matrix3 Matrix3::ZERO(0,0,0,0,0,0,0,0,0);
+    const Matrix3 Matrix3::IDENTITY(1,0,0,0,1,0,0,0,1);
+    const Real Matrix3::ms_fSvdEpsilon = 1e-04;
+    const unsigned int Matrix3::ms_iSvdMaxIterations = 32;
+
+    //-----------------------------------------------------------------------
+    Vector3 Matrix3::GetColumn (size_t iCol) const
+    {
+        assert( 0 <= iCol && iCol < 3 );
+        return Vector3(m[0][iCol],m[1][iCol],
+            m[2][iCol]);
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::SetColumn(size_t iCol, const Vector3& vec)
+    {
+        assert( 0 <= iCol && iCol < 3 );
+        m[0][iCol] = vec.x;
+        m[1][iCol] = vec.y;
+        m[2][iCol] = vec.z;
+
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::FromAxes(const Vector3& xAxis, const Vector3& yAxis, const Vector3& zAxis)
+    {
+        SetColumn(0,xAxis);
+        SetColumn(1,yAxis);
+        SetColumn(2,zAxis);
+
+    }
+
+    //-----------------------------------------------------------------------
+    bool Matrix3::operator== (const Matrix3& rkMatrix) const
+    {
+        for (size_t iRow = 0; iRow < 3; iRow++)
+        {
+            for (size_t iCol = 0; iCol < 3; iCol++)
+            {
+                if ( m[iRow][iCol] != rkMatrix.m[iRow][iCol] )
+                    return false;
+            }
+        }
+
+        return true;
+    }
+    //-----------------------------------------------------------------------
+    Matrix3 Matrix3::operator+ (const Matrix3& rkMatrix) const
+    {
+        Matrix3 kSum;
+        for (size_t iRow = 0; iRow < 3; iRow++)
+        {
+            for (size_t iCol = 0; iCol < 3; iCol++)
+            {
+                kSum.m[iRow][iCol] = m[iRow][iCol] +
+                    rkMatrix.m[iRow][iCol];
+            }
+        }
+        return kSum;
+    }
+    //-----------------------------------------------------------------------
+    Matrix3 Matrix3::operator- (const Matrix3& rkMatrix) const
+    {
+        Matrix3 kDiff;
+        for (size_t iRow = 0; iRow < 3; iRow++)
+        {
+            for (size_t iCol = 0; iCol < 3; iCol++)
+            {
+                kDiff.m[iRow][iCol] = m[iRow][iCol] -
+                    rkMatrix.m[iRow][iCol];
+            }
+        }
+        return kDiff;
+    }
+    //-----------------------------------------------------------------------
+    Matrix3 Matrix3::operator* (const Matrix3& rkMatrix) const
+    {
+        Matrix3 kProd;
+        for (size_t iRow = 0; iRow < 3; iRow++)
+        {
+            for (size_t iCol = 0; iCol < 3; iCol++)
+            {
+                kProd.m[iRow][iCol] =
+                    m[iRow][0]*rkMatrix.m[0][iCol] +
+                    m[iRow][1]*rkMatrix.m[1][iCol] +
+                    m[iRow][2]*rkMatrix.m[2][iCol];
+            }
+        }
+        return kProd;
+    }
+    //-----------------------------------------------------------------------
+    Vector3 Matrix3::operator* (const Vector3& rkPoint) const
+    {
+        Vector3 kProd;
+        for (size_t iRow = 0; iRow < 3; iRow++)
+        {
+            kProd[iRow] =
+                m[iRow][0]*rkPoint[0] +
+                m[iRow][1]*rkPoint[1] +
+                m[iRow][2]*rkPoint[2];
+        }
+        return kProd;
+    }
+    //-----------------------------------------------------------------------
+    Vector3 operator* (const Vector3& rkPoint, const Matrix3& rkMatrix)
+    {
+        Vector3 kProd;
+        for (size_t iRow = 0; iRow < 3; iRow++)
+        {
+            kProd[iRow] =
+                rkPoint[0]*rkMatrix.m[0][iRow] +
+                rkPoint[1]*rkMatrix.m[1][iRow] +
+                rkPoint[2]*rkMatrix.m[2][iRow];
+        }
+        return kProd;
+    }
+    //-----------------------------------------------------------------------
+    Matrix3 Matrix3::operator- () const
+    {
+        Matrix3 kNeg;
+        for (size_t iRow = 0; iRow < 3; iRow++)
+        {
+            for (size_t iCol = 0; iCol < 3; iCol++)
+                kNeg[iRow][iCol] = -m[iRow][iCol];
+        }
+        return kNeg;
+    }
+    //-----------------------------------------------------------------------
+    Matrix3 Matrix3::operator* (Real fScalar) const
+    {
+        Matrix3 kProd;
+        for (size_t iRow = 0; iRow < 3; iRow++)
+        {
+            for (size_t iCol = 0; iCol < 3; iCol++)
+                kProd[iRow][iCol] = fScalar*m[iRow][iCol];
+        }
+        return kProd;
+    }
+    //-----------------------------------------------------------------------
+    Matrix3 operator* (Real fScalar, const Matrix3& rkMatrix)
+    {
+        Matrix3 kProd;
+        for (size_t iRow = 0; iRow < 3; iRow++)
+        {
+            for (size_t iCol = 0; iCol < 3; iCol++)
+                kProd[iRow][iCol] = fScalar*rkMatrix.m[iRow][iCol];
+        }
+        return kProd;
+    }
+    //-----------------------------------------------------------------------
+    Matrix3 Matrix3::Transpose () const
+    {
+        Matrix3 kTranspose;
+        for (size_t iRow = 0; iRow < 3; iRow++)
+        {
+            for (size_t iCol = 0; iCol < 3; iCol++)
+                kTranspose[iRow][iCol] = m[iCol][iRow];
+        }
+        return kTranspose;
+    }
+    //-----------------------------------------------------------------------
+    bool Matrix3::Inverse (Matrix3& rkInverse, Real fTolerance) const
+    {
+        // Invert a 3x3 using cofactors.  This is about 8 times faster than
+        // the Numerical Recipes code which uses Gaussian elimination.
+
+        rkInverse[0][0] = m[1][1]*m[2][2] -
+            m[1][2]*m[2][1];
+        rkInverse[0][1] = m[0][2]*m[2][1] -
+            m[0][1]*m[2][2];
+        rkInverse[0][2] = m[0][1]*m[1][2] -
+            m[0][2]*m[1][1];
+        rkInverse[1][0] = m[1][2]*m[2][0] -
+            m[1][0]*m[2][2];
+        rkInverse[1][1] = m[0][0]*m[2][2] -
+            m[0][2]*m[2][0];
+        rkInverse[1][2] = m[0][2]*m[1][0] -
+            m[0][0]*m[1][2];
+        rkInverse[2][0] = m[1][0]*m[2][1] -
+            m[1][1]*m[2][0];
+        rkInverse[2][1] = m[0][1]*m[2][0] -
+            m[0][0]*m[2][1];
+        rkInverse[2][2] = m[0][0]*m[1][1] -
+            m[0][1]*m[1][0];
+
+        Real fDet =
+            m[0][0]*rkInverse[0][0] +
+            m[0][1]*rkInverse[1][0]+
+            m[0][2]*rkInverse[2][0];
+
+        if ( Math::Abs(fDet) <= fTolerance )
+            return false;
+
+        Real fInvDet = 1.0/fDet;
+        for (size_t iRow = 0; iRow < 3; iRow++)
+        {
+            for (size_t iCol = 0; iCol < 3; iCol++)
+                rkInverse[iRow][iCol] *= fInvDet;
+        }
+
+        return true;
+    }
+    //-----------------------------------------------------------------------
+    Matrix3 Matrix3::Inverse (Real fTolerance) const
+    {
+        Matrix3 kInverse = Matrix3::ZERO;
+        Inverse(kInverse,fTolerance);
+        return kInverse;
+    }
+    //-----------------------------------------------------------------------
+    Real Matrix3::Determinant () const
+    {
+        Real fCofactor00 = m[1][1]*m[2][2] -
+            m[1][2]*m[2][1];
+        Real fCofactor10 = m[1][2]*m[2][0] -
+            m[1][0]*m[2][2];
+        Real fCofactor20 = m[1][0]*m[2][1] -
+            m[1][1]*m[2][0];
+
+        Real fDet =
+            m[0][0]*fCofactor00 +
+            m[0][1]*fCofactor10 +
+            m[0][2]*fCofactor20;
+
+        return fDet;
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::Bidiagonalize (Matrix3& kA, Matrix3& kL,
+        Matrix3& kR)
+    {
+        Real afV[3], afW[3];
+        Real fLength, fSign, fT1, fInvT1, fT2;
+        bool bIdentity;
+
+        // map first column to (*,0,0)
+        fLength = Math::Sqrt(kA[0][0]*kA[0][0] + kA[1][0]*kA[1][0] +
+            kA[2][0]*kA[2][0]);
+        if ( fLength > 0.0 )
+        {
+            fSign = (kA[0][0] > 0.0 ? 1.0 : -1.0);
+            fT1 = kA[0][0] + fSign*fLength;
+            fInvT1 = 1.0/fT1;
+            afV[1] = kA[1][0]*fInvT1;
+            afV[2] = kA[2][0]*fInvT1;
+
+            fT2 = -2.0/(1.0+afV[1]*afV[1]+afV[2]*afV[2]);
+            afW[0] = fT2*(kA[0][0]+kA[1][0]*afV[1]+kA[2][0]*afV[2]);
+            afW[1] = fT2*(kA[0][1]+kA[1][1]*afV[1]+kA[2][1]*afV[2]);
+            afW[2] = fT2*(kA[0][2]+kA[1][2]*afV[1]+kA[2][2]*afV[2]);
+            kA[0][0] += afW[0];
+            kA[0][1] += afW[1];
+            kA[0][2] += afW[2];
+            kA[1][1] += afV[1]*afW[1];
+            kA[1][2] += afV[1]*afW[2];
+            kA[2][1] += afV[2]*afW[1];
+            kA[2][2] += afV[2]*afW[2];
+
+            kL[0][0] = 1.0+fT2;
+            kL[0][1] = kL[1][0] = fT2*afV[1];
+            kL[0][2] = kL[2][0] = fT2*afV[2];
+            kL[1][1] = 1.0+fT2*afV[1]*afV[1];
+            kL[1][2] = kL[2][1] = fT2*afV[1]*afV[2];
+            kL[2][2] = 1.0+fT2*afV[2]*afV[2];
+            bIdentity = false;
+        }
+        else
+        {
+            kL = Matrix3::IDENTITY;
+            bIdentity = true;
+        }
+
+        // map first row to (*,*,0)
+        fLength = Math::Sqrt(kA[0][1]*kA[0][1]+kA[0][2]*kA[0][2]);
+        if ( fLength > 0.0 )
+        {
+            fSign = (kA[0][1] > 0.0 ? 1.0 : -1.0);
+            fT1 = kA[0][1] + fSign*fLength;
+            afV[2] = kA[0][2]/fT1;
+
+            fT2 = -2.0/(1.0+afV[2]*afV[2]);
+            afW[0] = fT2*(kA[0][1]+kA[0][2]*afV[2]);
+            afW[1] = fT2*(kA[1][1]+kA[1][2]*afV[2]);
+            afW[2] = fT2*(kA[2][1]+kA[2][2]*afV[2]);
+            kA[0][1] += afW[0];
+            kA[1][1] += afW[1];
+            kA[1][2] += afW[1]*afV[2];
+            kA[2][1] += afW[2];
+            kA[2][2] += afW[2]*afV[2];
+
+            kR[0][0] = 1.0;
+            kR[0][1] = kR[1][0] = 0.0;
+            kR[0][2] = kR[2][0] = 0.0;
+            kR[1][1] = 1.0+fT2;
+            kR[1][2] = kR[2][1] = fT2*afV[2];
+            kR[2][2] = 1.0+fT2*afV[2]*afV[2];
+        }
+        else
+        {
+            kR = Matrix3::IDENTITY;
+        }
+
+        // map second column to (*,*,0)
+        fLength = Math::Sqrt(kA[1][1]*kA[1][1]+kA[2][1]*kA[2][1]);
+        if ( fLength > 0.0 )
+        {
+            fSign = (kA[1][1] > 0.0 ? 1.0 : -1.0);
+            fT1 = kA[1][1] + fSign*fLength;
+            afV[2] = kA[2][1]/fT1;
+
+            fT2 = -2.0/(1.0+afV[2]*afV[2]);
+            afW[1] = fT2*(kA[1][1]+kA[2][1]*afV[2]);
+            afW[2] = fT2*(kA[1][2]+kA[2][2]*afV[2]);
+            kA[1][1] += afW[1];
+            kA[1][2] += afW[2];
+            kA[2][2] += afV[2]*afW[2];
+
+            Real fA = 1.0+fT2;
+            Real fB = fT2*afV[2];
+            Real fC = 1.0+fB*afV[2];
+
+            if ( bIdentity )
+            {
+                kL[0][0] = 1.0;
+                kL[0][1] = kL[1][0] = 0.0;
+                kL[0][2] = kL[2][0] = 0.0;
+                kL[1][1] = fA;
+                kL[1][2] = kL[2][1] = fB;
+                kL[2][2] = fC;
+            }
+            else
+            {
+                for (int iRow = 0; iRow < 3; iRow++)
+                {
+                    Real fTmp0 = kL[iRow][1];
+                    Real fTmp1 = kL[iRow][2];
+                    kL[iRow][1] = fA*fTmp0+fB*fTmp1;
+                    kL[iRow][2] = fB*fTmp0+fC*fTmp1;
+                }
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::GolubKahanStep (Matrix3& kA, Matrix3& kL,
+        Matrix3& kR)
+    {
+        Real fT11 = kA[0][1]*kA[0][1]+kA[1][1]*kA[1][1];
+        Real fT22 = kA[1][2]*kA[1][2]+kA[2][2]*kA[2][2];
+        Real fT12 = kA[1][1]*kA[1][2];
+        Real fTrace = fT11+fT22;
+        Real fDiff = fT11-fT22;
+        Real fDiscr = Math::Sqrt(fDiff*fDiff+4.0*fT12*fT12);
+        Real fRoot1 = 0.5*(fTrace+fDiscr);
+        Real fRoot2 = 0.5*(fTrace-fDiscr);
+
+        // adjust right
+        Real fY = kA[0][0] - (Math::Abs(fRoot1-fT22) <=
+            Math::Abs(fRoot2-fT22) ? fRoot1 : fRoot2);
+        Real fZ = kA[0][1];
+		Real fInvLength = Math::InvSqrt(fY*fY+fZ*fZ);
+        Real fSin = fZ*fInvLength;
+        Real fCos = -fY*fInvLength;
+
+        Real fTmp0 = kA[0][0];
+        Real fTmp1 = kA[0][1];
+        kA[0][0] = fCos*fTmp0-fSin*fTmp1;
+        kA[0][1] = fSin*fTmp0+fCos*fTmp1;
+        kA[1][0] = -fSin*kA[1][1];
+        kA[1][1] *= fCos;
+
+        size_t iRow;
+        for (iRow = 0; iRow < 3; iRow++)
+        {
+            fTmp0 = kR[0][iRow];
+            fTmp1 = kR[1][iRow];
+            kR[0][iRow] = fCos*fTmp0-fSin*fTmp1;
+            kR[1][iRow] = fSin*fTmp0+fCos*fTmp1;
+        }
+
+        // adjust left
+        fY = kA[0][0];
+        fZ = kA[1][0];
+        fInvLength = Math::InvSqrt(fY*fY+fZ*fZ);
+        fSin = fZ*fInvLength;
+        fCos = -fY*fInvLength;
+
+        kA[0][0] = fCos*kA[0][0]-fSin*kA[1][0];
+        fTmp0 = kA[0][1];
+        fTmp1 = kA[1][1];
+        kA[0][1] = fCos*fTmp0-fSin*fTmp1;
+        kA[1][1] = fSin*fTmp0+fCos*fTmp1;
+        kA[0][2] = -fSin*kA[1][2];
+        kA[1][2] *= fCos;
+
+        size_t iCol;
+        for (iCol = 0; iCol < 3; iCol++)
+        {
+            fTmp0 = kL[iCol][0];
+            fTmp1 = kL[iCol][1];
+            kL[iCol][0] = fCos*fTmp0-fSin*fTmp1;
+            kL[iCol][1] = fSin*fTmp0+fCos*fTmp1;
+        }
+
+        // adjust right
+        fY = kA[0][1];
+        fZ = kA[0][2];
+        fInvLength = Math::InvSqrt(fY*fY+fZ*fZ);
+        fSin = fZ*fInvLength;
+        fCos = -fY*fInvLength;
+
+        kA[0][1] = fCos*kA[0][1]-fSin*kA[0][2];
+        fTmp0 = kA[1][1];
+        fTmp1 = kA[1][2];
+        kA[1][1] = fCos*fTmp0-fSin*fTmp1;
+        kA[1][2] = fSin*fTmp0+fCos*fTmp1;
+        kA[2][1] = -fSin*kA[2][2];
+        kA[2][2] *= fCos;
+
+        for (iRow = 0; iRow < 3; iRow++)
+        {
+            fTmp0 = kR[1][iRow];
+            fTmp1 = kR[2][iRow];
+            kR[1][iRow] = fCos*fTmp0-fSin*fTmp1;
+            kR[2][iRow] = fSin*fTmp0+fCos*fTmp1;
+        }
+
+        // adjust left
+        fY = kA[1][1];
+        fZ = kA[2][1];
+        fInvLength = Math::InvSqrt(fY*fY+fZ*fZ);
+        fSin = fZ*fInvLength;
+        fCos = -fY*fInvLength;
+
+        kA[1][1] = fCos*kA[1][1]-fSin*kA[2][1];
+        fTmp0 = kA[1][2];
+        fTmp1 = kA[2][2];
+        kA[1][2] = fCos*fTmp0-fSin*fTmp1;
+        kA[2][2] = fSin*fTmp0+fCos*fTmp1;
+
+        for (iCol = 0; iCol < 3; iCol++)
+        {
+            fTmp0 = kL[iCol][1];
+            fTmp1 = kL[iCol][2];
+            kL[iCol][1] = fCos*fTmp0-fSin*fTmp1;
+            kL[iCol][2] = fSin*fTmp0+fCos*fTmp1;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::SingularValueDecomposition (Matrix3& kL, Vector3& kS,
+        Matrix3& kR) const
+    {
+        // temas: currently unused
+        //const int iMax = 16;
+		size_t iRow, iCol;
+
+        Matrix3 kA = *this;
+        Bidiagonalize(kA,kL,kR);
+
+        for (unsigned int i = 0; i < ms_iSvdMaxIterations; i++)
+        {
+            Real fTmp, fTmp0, fTmp1;
+            Real fSin0, fCos0, fTan0;
+            Real fSin1, fCos1, fTan1;
+
+            bool bTest1 = (Math::Abs(kA[0][1]) <=
+                ms_fSvdEpsilon*(Math::Abs(kA[0][0])+Math::Abs(kA[1][1])));
+            bool bTest2 = (Math::Abs(kA[1][2]) <=
+                ms_fSvdEpsilon*(Math::Abs(kA[1][1])+Math::Abs(kA[2][2])));
+            if ( bTest1 )
+            {
+                if ( bTest2 )
+                {
+                    kS[0] = kA[0][0];
+                    kS[1] = kA[1][1];
+                    kS[2] = kA[2][2];
+                    break;
+                }
+                else
+                {
+                    // 2x2 closed form factorization
+                    fTmp = (kA[1][1]*kA[1][1] - kA[2][2]*kA[2][2] +
+                        kA[1][2]*kA[1][2])/(kA[1][2]*kA[2][2]);
+                    fTan0 = 0.5*(fTmp+Math::Sqrt(fTmp*fTmp + 4.0));
+                    fCos0 = Math::InvSqrt(1.0+fTan0*fTan0);
+                    fSin0 = fTan0*fCos0;
+
+                    for (iCol = 0; iCol < 3; iCol++)
+                    {
+                        fTmp0 = kL[iCol][1];
+                        fTmp1 = kL[iCol][2];
+                        kL[iCol][1] = fCos0*fTmp0-fSin0*fTmp1;
+                        kL[iCol][2] = fSin0*fTmp0+fCos0*fTmp1;
+                    }
+
+                    fTan1 = (kA[1][2]-kA[2][2]*fTan0)/kA[1][1];
+                    fCos1 = Math::InvSqrt(1.0+fTan1*fTan1);
+                    fSin1 = -fTan1*fCos1;
+
+                    for (iRow = 0; iRow < 3; iRow++)
+                    {
+                        fTmp0 = kR[1][iRow];
+                        fTmp1 = kR[2][iRow];
+                        kR[1][iRow] = fCos1*fTmp0-fSin1*fTmp1;
+                        kR[2][iRow] = fSin1*fTmp0+fCos1*fTmp1;
+                    }
+
+                    kS[0] = kA[0][0];
+                    kS[1] = fCos0*fCos1*kA[1][1] -
+                        fSin1*(fCos0*kA[1][2]-fSin0*kA[2][2]);
+                    kS[2] = fSin0*fSin1*kA[1][1] +
+                        fCos1*(fSin0*kA[1][2]+fCos0*kA[2][2]);
+                    break;
+                }
+            }
+            else
+            {
+                if ( bTest2 )
+                {
+                    // 2x2 closed form factorization
+                    fTmp = (kA[0][0]*kA[0][0] + kA[1][1]*kA[1][1] -
+                        kA[0][1]*kA[0][1])/(kA[0][1]*kA[1][1]);
+                    fTan0 = 0.5*(-fTmp+Math::Sqrt(fTmp*fTmp + 4.0));
+                    fCos0 = Math::InvSqrt(1.0+fTan0*fTan0);
+                    fSin0 = fTan0*fCos0;
+
+                    for (iCol = 0; iCol < 3; iCol++)
+                    {
+                        fTmp0 = kL[iCol][0];
+                        fTmp1 = kL[iCol][1];
+                        kL[iCol][0] = fCos0*fTmp0-fSin0*fTmp1;
+                        kL[iCol][1] = fSin0*fTmp0+fCos0*fTmp1;
+                    }
+
+                    fTan1 = (kA[0][1]-kA[1][1]*fTan0)/kA[0][0];
+                    fCos1 = Math::InvSqrt(1.0+fTan1*fTan1);
+                    fSin1 = -fTan1*fCos1;
+
+                    for (iRow = 0; iRow < 3; iRow++)
+                    {
+                        fTmp0 = kR[0][iRow];
+                        fTmp1 = kR[1][iRow];
+                        kR[0][iRow] = fCos1*fTmp0-fSin1*fTmp1;
+                        kR[1][iRow] = fSin1*fTmp0+fCos1*fTmp1;
+                    }
+
+                    kS[0] = fCos0*fCos1*kA[0][0] -
+                        fSin1*(fCos0*kA[0][1]-fSin0*kA[1][1]);
+                    kS[1] = fSin0*fSin1*kA[0][0] +
+                        fCos1*(fSin0*kA[0][1]+fCos0*kA[1][1]);
+                    kS[2] = kA[2][2];
+                    break;
+                }
+                else
+                {
+                    GolubKahanStep(kA,kL,kR);
+                }
+            }
+        }
+
+        // positize diagonal
+        for (iRow = 0; iRow < 3; iRow++)
+        {
+            if ( kS[iRow] < 0.0 )
+            {
+                kS[iRow] = -kS[iRow];
+                for (iCol = 0; iCol < 3; iCol++)
+                    kR[iRow][iCol] = -kR[iRow][iCol];
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::SingularValueComposition (const Matrix3& kL,
+        const Vector3& kS, const Matrix3& kR)
+    {
+        size_t iRow, iCol;
+        Matrix3 kTmp;
+
+        // product S*R
+        for (iRow = 0; iRow < 3; iRow++)
+        {
+            for (iCol = 0; iCol < 3; iCol++)
+                kTmp[iRow][iCol] = kS[iRow]*kR[iRow][iCol];
+        }
+
+        // product L*S*R
+        for (iRow = 0; iRow < 3; iRow++)
+        {
+            for (iCol = 0; iCol < 3; iCol++)
+            {
+                m[iRow][iCol] = 0.0;
+                for (int iMid = 0; iMid < 3; iMid++)
+                    m[iRow][iCol] += kL[iRow][iMid]*kTmp[iMid][iCol];
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::Orthonormalize ()
+    {
+        // Algorithm uses Gram-Schmidt orthogonalization.  If 'this' matrix is
+        // M = [m0|m1|m2], then orthonormal output matrix is Q = [q0|q1|q2],
+        //
+        //   q0 = m0/|m0|
+        //   q1 = (m1-(q0*m1)q0)/|m1-(q0*m1)q0|
+        //   q2 = (m2-(q0*m2)q0-(q1*m2)q1)/|m2-(q0*m2)q0-(q1*m2)q1|
+        //
+        // where |V| indicates length of vector V and A*B indicates dot
+        // product of vectors A and B.
+
+        // compute q0
+        Real fInvLength = Math::InvSqrt(m[0][0]*m[0][0]
+            + m[1][0]*m[1][0] +
+            m[2][0]*m[2][0]);
+
+        m[0][0] *= fInvLength;
+        m[1][0] *= fInvLength;
+        m[2][0] *= fInvLength;
+
+        // compute q1
+        Real fDot0 =
+            m[0][0]*m[0][1] +
+            m[1][0]*m[1][1] +
+            m[2][0]*m[2][1];
+
+        m[0][1] -= fDot0*m[0][0];
+        m[1][1] -= fDot0*m[1][0];
+        m[2][1] -= fDot0*m[2][0];
+
+        fInvLength = Math::InvSqrt(m[0][1]*m[0][1] +
+            m[1][1]*m[1][1] +
+            m[2][1]*m[2][1]);
+
+        m[0][1] *= fInvLength;
+        m[1][1] *= fInvLength;
+        m[2][1] *= fInvLength;
+
+        // compute q2
+        Real fDot1 =
+            m[0][1]*m[0][2] +
+            m[1][1]*m[1][2] +
+            m[2][1]*m[2][2];
+
+        fDot0 =
+            m[0][0]*m[0][2] +
+            m[1][0]*m[1][2] +
+            m[2][0]*m[2][2];
+
+        m[0][2] -= fDot0*m[0][0] + fDot1*m[0][1];
+        m[1][2] -= fDot0*m[1][0] + fDot1*m[1][1];
+        m[2][2] -= fDot0*m[2][0] + fDot1*m[2][1];
+
+        fInvLength = Math::InvSqrt(m[0][2]*m[0][2] +
+            m[1][2]*m[1][2] +
+            m[2][2]*m[2][2]);
+
+        m[0][2] *= fInvLength;
+        m[1][2] *= fInvLength;
+        m[2][2] *= fInvLength;
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::QDUDecomposition (Matrix3& kQ,
+        Vector3& kD, Vector3& kU) const
+    {
+        // Factor M = QR = QDU where Q is orthogonal, D is diagonal,
+        // and U is upper triangular with ones on its diagonal.  Algorithm uses
+        // Gram-Schmidt orthogonalization (the QR algorithm).
+        //
+        // If M = [ m0 | m1 | m2 ] and Q = [ q0 | q1 | q2 ], then
+        //
+        //   q0 = m0/|m0|
+        //   q1 = (m1-(q0*m1)q0)/|m1-(q0*m1)q0|
+        //   q2 = (m2-(q0*m2)q0-(q1*m2)q1)/|m2-(q0*m2)q0-(q1*m2)q1|
+        //
+        // where |V| indicates length of vector V and A*B indicates dot
+        // product of vectors A and B.  The matrix R has entries
+        //
+        //   r00 = q0*m0  r01 = q0*m1  r02 = q0*m2
+        //   r10 = 0      r11 = q1*m1  r12 = q1*m2
+        //   r20 = 0      r21 = 0      r22 = q2*m2
+        //
+        // so D = diag(r00,r11,r22) and U has entries u01 = r01/r00,
+        // u02 = r02/r00, and u12 = r12/r11.
+
+        // Q = rotation
+        // D = scaling
+        // U = shear
+
+        // D stores the three diagonal entries r00, r11, r22
+        // U stores the entries U[0] = u01, U[1] = u02, U[2] = u12
+
+        // build orthogonal matrix Q
+        Real fInvLength = Math::InvSqrt(m[0][0]*m[0][0]
+            + m[1][0]*m[1][0] +
+            m[2][0]*m[2][0]);
+        kQ[0][0] = m[0][0]*fInvLength;
+        kQ[1][0] = m[1][0]*fInvLength;
+        kQ[2][0] = m[2][0]*fInvLength;
+
+        Real fDot = kQ[0][0]*m[0][1] + kQ[1][0]*m[1][1] +
+            kQ[2][0]*m[2][1];
+        kQ[0][1] = m[0][1]-fDot*kQ[0][0];
+        kQ[1][1] = m[1][1]-fDot*kQ[1][0];
+        kQ[2][1] = m[2][1]-fDot*kQ[2][0];
+        fInvLength = Math::InvSqrt(kQ[0][1]*kQ[0][1] + kQ[1][1]*kQ[1][1] +
+            kQ[2][1]*kQ[2][1]);
+        kQ[0][1] *= fInvLength;
+        kQ[1][1] *= fInvLength;
+        kQ[2][1] *= fInvLength;
+
+        fDot = kQ[0][0]*m[0][2] + kQ[1][0]*m[1][2] +
+            kQ[2][0]*m[2][2];
+        kQ[0][2] = m[0][2]-fDot*kQ[0][0];
+        kQ[1][2] = m[1][2]-fDot*kQ[1][0];
+        kQ[2][2] = m[2][2]-fDot*kQ[2][0];
+        fDot = kQ[0][1]*m[0][2] + kQ[1][1]*m[1][2] +
+            kQ[2][1]*m[2][2];
+        kQ[0][2] -= fDot*kQ[0][1];
+        kQ[1][2] -= fDot*kQ[1][1];
+        kQ[2][2] -= fDot*kQ[2][1];
+        fInvLength = Math::InvSqrt(kQ[0][2]*kQ[0][2] + kQ[1][2]*kQ[1][2] +
+            kQ[2][2]*kQ[2][2]);
+        kQ[0][2] *= fInvLength;
+        kQ[1][2] *= fInvLength;
+        kQ[2][2] *= fInvLength;
+
+        // guarantee that orthogonal matrix has determinant 1 (no reflections)
+        Real fDet = kQ[0][0]*kQ[1][1]*kQ[2][2] + kQ[0][1]*kQ[1][2]*kQ[2][0] +
+            kQ[0][2]*kQ[1][0]*kQ[2][1] - kQ[0][2]*kQ[1][1]*kQ[2][0] -
+            kQ[0][1]*kQ[1][0]*kQ[2][2] - kQ[0][0]*kQ[1][2]*kQ[2][1];
+
+        if ( fDet < 0.0 )
+        {
+            for (size_t iRow = 0; iRow < 3; iRow++)
+                for (size_t iCol = 0; iCol < 3; iCol++)
+                    kQ[iRow][iCol] = -kQ[iRow][iCol];
+        }
+
+        // build "right" matrix R
+        Matrix3 kR;
+        kR[0][0] = kQ[0][0]*m[0][0] + kQ[1][0]*m[1][0] +
+            kQ[2][0]*m[2][0];
+        kR[0][1] = kQ[0][0]*m[0][1] + kQ[1][0]*m[1][1] +
+            kQ[2][0]*m[2][1];
+        kR[1][1] = kQ[0][1]*m[0][1] + kQ[1][1]*m[1][1] +
+            kQ[2][1]*m[2][1];
+        kR[0][2] = kQ[0][0]*m[0][2] + kQ[1][0]*m[1][2] +
+            kQ[2][0]*m[2][2];
+        kR[1][2] = kQ[0][1]*m[0][2] + kQ[1][1]*m[1][2] +
+            kQ[2][1]*m[2][2];
+        kR[2][2] = kQ[0][2]*m[0][2] + kQ[1][2]*m[1][2] +
+            kQ[2][2]*m[2][2];
+
+        // the scaling component
+        kD[0] = kR[0][0];
+        kD[1] = kR[1][1];
+        kD[2] = kR[2][2];
+
+        // the shear component
+        Real fInvD0 = 1.0/kD[0];
+        kU[0] = kR[0][1]*fInvD0;
+        kU[1] = kR[0][2]*fInvD0;
+        kU[2] = kR[1][2]/kD[1];
+    }
+    //-----------------------------------------------------------------------
+    Real Matrix3::MaxCubicRoot (Real afCoeff[3])
+    {
+        // Spectral norm is for A^T*A, so characteristic polynomial
+        // P(x) = c[0]+c[1]*x+c[2]*x^2+x^3 has three positive real roots.
+        // This yields the assertions c[0] < 0 and c[2]*c[2] >= 3*c[1].
+
+        // quick out for uniform scale (triple root)
+        const Real fOneThird = 1.0/3.0;
+        const Real fEpsilon = 1e-06;
+        Real fDiscr = afCoeff[2]*afCoeff[2] - 3.0*afCoeff[1];
+        if ( fDiscr <= fEpsilon )
+            return -fOneThird*afCoeff[2];
+
+        // Compute an upper bound on roots of P(x).  This assumes that A^T*A
+        // has been scaled by its largest entry.
+        Real fX = 1.0;
+        Real fPoly = afCoeff[0]+fX*(afCoeff[1]+fX*(afCoeff[2]+fX));
+        if ( fPoly < 0.0 )
+        {
+            // uses a matrix norm to find an upper bound on maximum root
+            fX = Math::Abs(afCoeff[0]);
+            Real fTmp = 1.0+Math::Abs(afCoeff[1]);
+            if ( fTmp > fX )
+                fX = fTmp;
+            fTmp = 1.0+Math::Abs(afCoeff[2]);
+            if ( fTmp > fX )
+                fX = fTmp;
+        }
+
+        // Newton's method to find root
+        Real fTwoC2 = 2.0*afCoeff[2];
+        for (int i = 0; i < 16; i++)
+        {
+            fPoly = afCoeff[0]+fX*(afCoeff[1]+fX*(afCoeff[2]+fX));
+            if ( Math::Abs(fPoly) <= fEpsilon )
+                return fX;
+
+            Real fDeriv = afCoeff[1]+fX*(fTwoC2+3.0*fX);
+            fX -= fPoly/fDeriv;
+        }
+
+        return fX;
+    }
+    //-----------------------------------------------------------------------
+    Real Matrix3::SpectralNorm () const
+    {
+        Matrix3 kP;
+        size_t iRow, iCol;
+        Real fPmax = 0.0;
+        for (iRow = 0; iRow < 3; iRow++)
+        {
+            for (iCol = 0; iCol < 3; iCol++)
+            {
+                kP[iRow][iCol] = 0.0;
+                for (int iMid = 0; iMid < 3; iMid++)
+                {
+                    kP[iRow][iCol] +=
+                        m[iMid][iRow]*m[iMid][iCol];
+                }
+                if ( kP[iRow][iCol] > fPmax )
+                    fPmax = kP[iRow][iCol];
+            }
+        }
+
+        Real fInvPmax = 1.0/fPmax;
+        for (iRow = 0; iRow < 3; iRow++)
+        {
+            for (iCol = 0; iCol < 3; iCol++)
+                kP[iRow][iCol] *= fInvPmax;
+        }
+
+        Real afCoeff[3];
+        afCoeff[0] = -(kP[0][0]*(kP[1][1]*kP[2][2]-kP[1][2]*kP[2][1]) +
+            kP[0][1]*(kP[2][0]*kP[1][2]-kP[1][0]*kP[2][2]) +
+            kP[0][2]*(kP[1][0]*kP[2][1]-kP[2][0]*kP[1][1]));
+        afCoeff[1] = kP[0][0]*kP[1][1]-kP[0][1]*kP[1][0] +
+            kP[0][0]*kP[2][2]-kP[0][2]*kP[2][0] +
+            kP[1][1]*kP[2][2]-kP[1][2]*kP[2][1];
+        afCoeff[2] = -(kP[0][0]+kP[1][1]+kP[2][2]);
+
+        Real fRoot = MaxCubicRoot(afCoeff);
+        Real fNorm = Math::Sqrt(fPmax*fRoot);
+        return fNorm;
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::ToAxisAngle (Vector3& rkAxis, Radian& rfRadians) const
+    {
+        // Let (x,y,z) be the unit-length axis and let A be an angle of rotation.
+        // The rotation matrix is R = I + sin(A)*P + (1-cos(A))*P^2 where
+        // I is the identity and
+        //
+        //       +-        -+
+        //   P = |  0 -z +y |
+        //       | +z  0 -x |
+        //       | -y +x  0 |
+        //       +-        -+
+        //
+        // If A > 0, R represents a counterclockwise rotation about the axis in
+        // the sense of looking from the tip of the axis vector towards the
+        // origin.  Some algebra will show that
+        //
+        //   cos(A) = (trace(R)-1)/2  and  R - R^t = 2*sin(A)*P
+        //
+        // In the event that A = pi, R-R^t = 0 which prevents us from extracting
+        // the axis through P.  Instead note that R = I+2*P^2 when A = pi, so
+        // P^2 = (R-I)/2.  The diagonal entries of P^2 are x^2-1, y^2-1, and
+        // z^2-1.  We can solve these for axis (x,y,z).  Because the angle is pi,
+        // it does not matter which sign you choose on the square roots.
+
+        Real fTrace = m[0][0] + m[1][1] + m[2][2];
+        Real fCos = 0.5*(fTrace-1.0);
+        rfRadians = Math::ACos(fCos);  // in [0,PI]
+
+        if ( rfRadians > Radian(0.0) )
+        {
+            if ( rfRadians < Radian(Math::PI) )
+            {
+                rkAxis.x = m[2][1]-m[1][2];
+                rkAxis.y = m[0][2]-m[2][0];
+                rkAxis.z = m[1][0]-m[0][1];
+                rkAxis.normalise();
+            }
+            else
+            {
+                // angle is PI
+                float fHalfInverse;
+                if ( m[0][0] >= m[1][1] )
+                {
+                    // r00 >= r11
+                    if ( m[0][0] >= m[2][2] )
+                    {
+                        // r00 is maximum diagonal term
+                        rkAxis.x = 0.5*Math::Sqrt(m[0][0] -
+                            m[1][1] - m[2][2] + 1.0);
+                        fHalfInverse = 0.5/rkAxis.x;
+                        rkAxis.y = fHalfInverse*m[0][1];
+                        rkAxis.z = fHalfInverse*m[0][2];
+                    }
+                    else
+                    {
+                        // r22 is maximum diagonal term
+                        rkAxis.z = 0.5*Math::Sqrt(m[2][2] -
+                            m[0][0] - m[1][1] + 1.0);
+                        fHalfInverse = 0.5/rkAxis.z;
+                        rkAxis.x = fHalfInverse*m[0][2];
+                        rkAxis.y = fHalfInverse*m[1][2];
+                    }
+                }
+                else
+                {
+                    // r11 > r00
+                    if ( m[1][1] >= m[2][2] )
+                    {
+                        // r11 is maximum diagonal term
+                        rkAxis.y = 0.5*Math::Sqrt(m[1][1] -
+                            m[0][0] - m[2][2] + 1.0);
+                        fHalfInverse  = 0.5/rkAxis.y;
+                        rkAxis.x = fHalfInverse*m[0][1];
+                        rkAxis.z = fHalfInverse*m[1][2];
+                    }
+                    else
+                    {
+                        // r22 is maximum diagonal term
+                        rkAxis.z = 0.5*Math::Sqrt(m[2][2] -
+                            m[0][0] - m[1][1] + 1.0);
+                        fHalfInverse = 0.5/rkAxis.z;
+                        rkAxis.x = fHalfInverse*m[0][2];
+                        rkAxis.y = fHalfInverse*m[1][2];
+                    }
+                }
+            }
+        }
+        else
+        {
+            // The angle is 0 and the matrix is the identity.  Any axis will
+            // work, so just use the x-axis.
+            rkAxis.x = 1.0;
+            rkAxis.y = 0.0;
+            rkAxis.z = 0.0;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::FromAxisAngle (const Vector3& rkAxis, const Radian& fRadians)
+    {
+        Real fCos = Math::Cos(fRadians);
+        Real fSin = Math::Sin(fRadians);
+        Real fOneMinusCos = 1.0-fCos;
+        Real fX2 = rkAxis.x*rkAxis.x;
+        Real fY2 = rkAxis.y*rkAxis.y;
+        Real fZ2 = rkAxis.z*rkAxis.z;
+        Real fXYM = rkAxis.x*rkAxis.y*fOneMinusCos;
+        Real fXZM = rkAxis.x*rkAxis.z*fOneMinusCos;
+        Real fYZM = rkAxis.y*rkAxis.z*fOneMinusCos;
+        Real fXSin = rkAxis.x*fSin;
+        Real fYSin = rkAxis.y*fSin;
+        Real fZSin = rkAxis.z*fSin;
+
+        m[0][0] = fX2*fOneMinusCos+fCos;
+        m[0][1] = fXYM-fZSin;
+        m[0][2] = fXZM+fYSin;
+        m[1][0] = fXYM+fZSin;
+        m[1][1] = fY2*fOneMinusCos+fCos;
+        m[1][2] = fYZM-fXSin;
+        m[2][0] = fXZM-fYSin;
+        m[2][1] = fYZM+fXSin;
+        m[2][2] = fZ2*fOneMinusCos+fCos;
+    }
+    //-----------------------------------------------------------------------
+    bool Matrix3::ToEulerAnglesXYZ (Radian& rfYAngle, Radian& rfPAngle,
+        Radian& rfRAngle) const
+    {
+        // rot =  cy*cz          -cy*sz           sy
+        //        cz*sx*sy+cx*sz  cx*cz-sx*sy*sz -cy*sx
+        //       -cx*cz*sy+sx*sz  cz*sx+cx*sy*sz  cx*cy
+
+        rfPAngle = Radian(Math::ASin(m[0][2]));
+        if ( rfPAngle < Radian(Math::HALF_PI) )
+        {
+            if ( rfPAngle > Radian(-Math::HALF_PI) )
+            {
+                rfYAngle = Math::ATan2(-m[1][2],m[2][2]);
+                rfRAngle = Math::ATan2(-m[0][1],m[0][0]);
+                return true;
+            }
+            else
+            {
+                // WARNING.  Not a unique solution.
+                Radian fRmY = Math::ATan2(m[1][0],m[1][1]);
+                rfRAngle = Radian(0.0);  // any angle works
+                rfYAngle = rfRAngle - fRmY;
+                return false;
+            }
+        }
+        else
+        {
+            // WARNING.  Not a unique solution.
+            Radian fRpY = Math::ATan2(m[1][0],m[1][1]);
+            rfRAngle = Radian(0.0);  // any angle works
+            rfYAngle = fRpY - rfRAngle;
+            return false;
+        }
+    }
+    //-----------------------------------------------------------------------
+    bool Matrix3::ToEulerAnglesXZY (Radian& rfYAngle, Radian& rfPAngle,
+        Radian& rfRAngle) const
+    {
+        // rot =  cy*cz          -sz              cz*sy
+        //        sx*sy+cx*cy*sz  cx*cz          -cy*sx+cx*sy*sz
+        //       -cx*sy+cy*sx*sz  cz*sx           cx*cy+sx*sy*sz
+
+        rfPAngle = Math::ASin(-m[0][1]);
+        if ( rfPAngle < Radian(Math::HALF_PI) )
+        {
+            if ( rfPAngle > Radian(-Math::HALF_PI) )
+            {
+                rfYAngle = Math::ATan2(m[2][1],m[1][1]);
+                rfRAngle = Math::ATan2(m[0][2],m[0][0]);
+                return true;
+            }
+            else
+            {
+                // WARNING.  Not a unique solution.
+                Radian fRmY = Math::ATan2(-m[2][0],m[2][2]);
+                rfRAngle = Radian(0.0);  // any angle works
+                rfYAngle = rfRAngle - fRmY;
+                return false;
+            }
+        }
+        else
+        {
+            // WARNING.  Not a unique solution.
+            Radian fRpY = Math::ATan2(-m[2][0],m[2][2]);
+            rfRAngle = Radian(0.0);  // any angle works
+            rfYAngle = fRpY - rfRAngle;
+            return false;
+        }
+    }
+    //-----------------------------------------------------------------------
+    bool Matrix3::ToEulerAnglesYXZ (Radian& rfYAngle, Radian& rfPAngle,
+        Radian& rfRAngle) const
+    {
+        // rot =  cy*cz+sx*sy*sz  cz*sx*sy-cy*sz  cx*sy
+        //        cx*sz           cx*cz          -sx
+        //       -cz*sy+cy*sx*sz  cy*cz*sx+sy*sz  cx*cy
+
+        rfPAngle = Math::ASin(-m[1][2]);
+        if ( rfPAngle < Radian(Math::HALF_PI) )
+        {
+            if ( rfPAngle > Radian(-Math::HALF_PI) )
+            {
+                rfYAngle = Math::ATan2(m[0][2],m[2][2]);
+                rfRAngle = Math::ATan2(m[1][0],m[1][1]);
+                return true;
+            }
+            else
+            {
+                // WARNING.  Not a unique solution.
+                Radian fRmY = Math::ATan2(-m[0][1],m[0][0]);
+                rfRAngle = Radian(0.0);  // any angle works
+                rfYAngle = rfRAngle - fRmY;
+                return false;
+            }
+        }
+        else
+        {
+            // WARNING.  Not a unique solution.
+            Radian fRpY = Math::ATan2(-m[0][1],m[0][0]);
+            rfRAngle = Radian(0.0);  // any angle works
+            rfYAngle = fRpY - rfRAngle;
+            return false;
+        }
+    }
+    //-----------------------------------------------------------------------
+    bool Matrix3::ToEulerAnglesYZX (Radian& rfYAngle, Radian& rfPAngle,
+        Radian& rfRAngle) const
+    {
+        // rot =  cy*cz           sx*sy-cx*cy*sz  cx*sy+cy*sx*sz
+        //        sz              cx*cz          -cz*sx
+        //       -cz*sy           cy*sx+cx*sy*sz  cx*cy-sx*sy*sz
+
+        rfPAngle = Math::ASin(m[1][0]);
+        if ( rfPAngle < Radian(Math::HALF_PI) )
+        {
+            if ( rfPAngle > Radian(-Math::HALF_PI) )
+            {
+                rfYAngle = Math::ATan2(-m[2][0],m[0][0]);
+                rfRAngle = Math::ATan2(-m[1][2],m[1][1]);
+                return true;
+            }
+            else
+            {
+                // WARNING.  Not a unique solution.
+                Radian fRmY = Math::ATan2(m[2][1],m[2][2]);
+                rfRAngle = Radian(0.0);  // any angle works
+                rfYAngle = rfRAngle - fRmY;
+                return false;
+            }
+        }
+        else
+        {
+            // WARNING.  Not a unique solution.
+            Radian fRpY = Math::ATan2(m[2][1],m[2][2]);
+            rfRAngle = Radian(0.0);  // any angle works
+            rfYAngle = fRpY - rfRAngle;
+            return false;
+        }
+    }
+    //-----------------------------------------------------------------------
+    bool Matrix3::ToEulerAnglesZXY (Radian& rfYAngle, Radian& rfPAngle,
+        Radian& rfRAngle) const
+    {
+        // rot =  cy*cz-sx*sy*sz -cx*sz           cz*sy+cy*sx*sz
+        //        cz*sx*sy+cy*sz  cx*cz          -cy*cz*sx+sy*sz
+        //       -cx*sy           sx              cx*cy
+
+        rfPAngle = Math::ASin(m[2][1]);
+        if ( rfPAngle < Radian(Math::HALF_PI) )
+        {
+            if ( rfPAngle > Radian(-Math::HALF_PI) )
+            {
+                rfYAngle = Math::ATan2(-m[0][1],m[1][1]);
+                rfRAngle = Math::ATan2(-m[2][0],m[2][2]);
+                return true;
+            }
+            else
+            {
+                // WARNING.  Not a unique solution.
+                Radian fRmY = Math::ATan2(m[0][2],m[0][0]);
+                rfRAngle = Radian(0.0);  // any angle works
+                rfYAngle = rfRAngle - fRmY;
+                return false;
+            }
+        }
+        else
+        {
+            // WARNING.  Not a unique solution.
+            Radian fRpY = Math::ATan2(m[0][2],m[0][0]);
+            rfRAngle = Radian(0.0);  // any angle works
+            rfYAngle = fRpY - rfRAngle;
+            return false;
+        }
+    }
+    //-----------------------------------------------------------------------
+    bool Matrix3::ToEulerAnglesZYX (Radian& rfYAngle, Radian& rfPAngle,
+        Radian& rfRAngle) const
+    {
+        // rot =  cy*cz           cz*sx*sy-cx*sz  cx*cz*sy+sx*sz
+        //        cy*sz           cx*cz+sx*sy*sz -cz*sx+cx*sy*sz
+        //       -sy              cy*sx           cx*cy
+
+        rfPAngle = Math::ASin(-m[2][0]);
+        if ( rfPAngle < Radian(Math::HALF_PI) )
+        {
+            if ( rfPAngle > Radian(-Math::HALF_PI) )
+            {
+                rfYAngle = Math::ATan2(m[1][0],m[0][0]);
+                rfRAngle = Math::ATan2(m[2][1],m[2][2]);
+                return true;
+            }
+            else
+            {
+                // WARNING.  Not a unique solution.
+                Radian fRmY = Math::ATan2(-m[0][1],m[0][2]);
+                rfRAngle = Radian(0.0);  // any angle works
+                rfYAngle = rfRAngle - fRmY;
+                return false;
+            }
+        }
+        else
+        {
+            // WARNING.  Not a unique solution.
+            Radian fRpY = Math::ATan2(-m[0][1],m[0][2]);
+            rfRAngle = Radian(0.0);  // any angle works
+            rfYAngle = fRpY - rfRAngle;
+            return false;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::FromEulerAnglesXYZ (const Radian& fYAngle, const Radian& fPAngle,
+        const Radian& fRAngle)
+    {
+        Real fCos, fSin;
+
+        fCos = Math::Cos(fYAngle);
+        fSin = Math::Sin(fYAngle);
+        Matrix3 kXMat(1.0,0.0,0.0,0.0,fCos,-fSin,0.0,fSin,fCos);
+
+        fCos = Math::Cos(fPAngle);
+        fSin = Math::Sin(fPAngle);
+        Matrix3 kYMat(fCos,0.0,fSin,0.0,1.0,0.0,-fSin,0.0,fCos);
+
+        fCos = Math::Cos(fRAngle);
+        fSin = Math::Sin(fRAngle);
+        Matrix3 kZMat(fCos,-fSin,0.0,fSin,fCos,0.0,0.0,0.0,1.0);
+
+        *this = kXMat*(kYMat*kZMat);
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::FromEulerAnglesXZY (const Radian& fYAngle, const Radian& fPAngle,
+        const Radian& fRAngle)
+    {
+        Real fCos, fSin;
+
+        fCos = Math::Cos(fYAngle);
+        fSin = Math::Sin(fYAngle);
+        Matrix3 kXMat(1.0,0.0,0.0,0.0,fCos,-fSin,0.0,fSin,fCos);
+
+        fCos = Math::Cos(fPAngle);
+        fSin = Math::Sin(fPAngle);
+        Matrix3 kZMat(fCos,-fSin,0.0,fSin,fCos,0.0,0.0,0.0,1.0);
+
+        fCos = Math::Cos(fRAngle);
+        fSin = Math::Sin(fRAngle);
+        Matrix3 kYMat(fCos,0.0,fSin,0.0,1.0,0.0,-fSin,0.0,fCos);
+
+        *this = kXMat*(kZMat*kYMat);
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::FromEulerAnglesYXZ (const Radian& fYAngle, const Radian& fPAngle,
+        const Radian& fRAngle)
+    {
+        Real fCos, fSin;
+
+        fCos = Math::Cos(fYAngle);
+        fSin = Math::Sin(fYAngle);
+        Matrix3 kYMat(fCos,0.0,fSin,0.0,1.0,0.0,-fSin,0.0,fCos);
+
+        fCos = Math::Cos(fPAngle);
+        fSin = Math::Sin(fPAngle);
+        Matrix3 kXMat(1.0,0.0,0.0,0.0,fCos,-fSin,0.0,fSin,fCos);
+
+        fCos = Math::Cos(fRAngle);
+        fSin = Math::Sin(fRAngle);
+        Matrix3 kZMat(fCos,-fSin,0.0,fSin,fCos,0.0,0.0,0.0,1.0);
+
+        *this = kYMat*(kXMat*kZMat);
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::FromEulerAnglesYZX (const Radian& fYAngle, const Radian& fPAngle,
+        const Radian& fRAngle)
+    {
+        Real fCos, fSin;
+
+        fCos = Math::Cos(fYAngle);
+        fSin = Math::Sin(fYAngle);
+        Matrix3 kYMat(fCos,0.0,fSin,0.0,1.0,0.0,-fSin,0.0,fCos);
+
+        fCos = Math::Cos(fPAngle);
+        fSin = Math::Sin(fPAngle);
+        Matrix3 kZMat(fCos,-fSin,0.0,fSin,fCos,0.0,0.0,0.0,1.0);
+
+        fCos = Math::Cos(fRAngle);
+        fSin = Math::Sin(fRAngle);
+        Matrix3 kXMat(1.0,0.0,0.0,0.0,fCos,-fSin,0.0,fSin,fCos);
+
+        *this = kYMat*(kZMat*kXMat);
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::FromEulerAnglesZXY (const Radian& fYAngle, const Radian& fPAngle,
+        const Radian& fRAngle)
+    {
+        Real fCos, fSin;
+
+        fCos = Math::Cos(fYAngle);
+        fSin = Math::Sin(fYAngle);
+        Matrix3 kZMat(fCos,-fSin,0.0,fSin,fCos,0.0,0.0,0.0,1.0);
+
+        fCos = Math::Cos(fPAngle);
+        fSin = Math::Sin(fPAngle);
+        Matrix3 kXMat(1.0,0.0,0.0,0.0,fCos,-fSin,0.0,fSin,fCos);
+
+        fCos = Math::Cos(fRAngle);
+        fSin = Math::Sin(fRAngle);
+        Matrix3 kYMat(fCos,0.0,fSin,0.0,1.0,0.0,-fSin,0.0,fCos);
+
+        *this = kZMat*(kXMat*kYMat);
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::FromEulerAnglesZYX (const Radian& fYAngle, const Radian& fPAngle,
+        const Radian& fRAngle)
+    {
+        Real fCos, fSin;
+
+        fCos = Math::Cos(fYAngle);
+        fSin = Math::Sin(fYAngle);
+        Matrix3 kZMat(fCos,-fSin,0.0,fSin,fCos,0.0,0.0,0.0,1.0);
+
+        fCos = Math::Cos(fPAngle);
+        fSin = Math::Sin(fPAngle);
+        Matrix3 kYMat(fCos,0.0,fSin,0.0,1.0,0.0,-fSin,0.0,fCos);
+
+        fCos = Math::Cos(fRAngle);
+        fSin = Math::Sin(fRAngle);
+        Matrix3 kXMat(1.0,0.0,0.0,0.0,fCos,-fSin,0.0,fSin,fCos);
+
+        *this = kZMat*(kYMat*kXMat);
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::Tridiagonal (Real afDiag[3], Real afSubDiag[3])
+    {
+        // Householder reduction T = Q^t M Q
+        //   Input:
+        //     mat, symmetric 3x3 matrix M
+        //   Output:
+        //     mat, orthogonal matrix Q
+        //     diag, diagonal entries of T
+        //     subd, subdiagonal entries of T (T is symmetric)
+
+        Real fA = m[0][0];
+        Real fB = m[0][1];
+        Real fC = m[0][2];
+        Real fD = m[1][1];
+        Real fE = m[1][2];
+        Real fF = m[2][2];
+
+        afDiag[0] = fA;
+        afSubDiag[2] = 0.0;
+        if ( Math::Abs(fC) >= EPSILON )
+        {
+            Real fLength = Math::Sqrt(fB*fB+fC*fC);
+            Real fInvLength = 1.0/fLength;
+            fB *= fInvLength;
+            fC *= fInvLength;
+            Real fQ = 2.0*fB*fE+fC*(fF-fD);
+            afDiag[1] = fD+fC*fQ;
+            afDiag[2] = fF-fC*fQ;
+            afSubDiag[0] = fLength;
+            afSubDiag[1] = fE-fB*fQ;
+            m[0][0] = 1.0;
+            m[0][1] = 0.0;
+            m[0][2] = 0.0;
+            m[1][0] = 0.0;
+            m[1][1] = fB;
+            m[1][2] = fC;
+            m[2][0] = 0.0;
+            m[2][1] = fC;
+            m[2][2] = -fB;
+        }
+        else
+        {
+            afDiag[1] = fD;
+            afDiag[2] = fF;
+            afSubDiag[0] = fB;
+            afSubDiag[1] = fE;
+            m[0][0] = 1.0;
+            m[0][1] = 0.0;
+            m[0][2] = 0.0;
+            m[1][0] = 0.0;
+            m[1][1] = 1.0;
+            m[1][2] = 0.0;
+            m[2][0] = 0.0;
+            m[2][1] = 0.0;
+            m[2][2] = 1.0;
+        }
+    }
+    //-----------------------------------------------------------------------
+    bool Matrix3::QLAlgorithm (Real afDiag[3], Real afSubDiag[3])
+    {
+        // QL iteration with implicit shifting to reduce matrix from tridiagonal
+        // to diagonal
+
+        for (int i0 = 0; i0 < 3; i0++)
+        {
+            const unsigned int iMaxIter = 32;
+            unsigned int iIter;
+            for (iIter = 0; iIter < iMaxIter; iIter++)
+            {
+                int i1;
+                for (i1 = i0; i1 <= 1; i1++)
+                {
+                    Real fSum = Math::Abs(afDiag[i1]) +
+                        Math::Abs(afDiag[i1+1]);
+                    if ( Math::Abs(afSubDiag[i1]) + fSum == fSum )
+                        break;
+                }
+                if ( i1 == i0 )
+                    break;
+
+                Real fTmp0 = (afDiag[i0+1]-afDiag[i0])/(2.0*afSubDiag[i0]);
+                Real fTmp1 = Math::Sqrt(fTmp0*fTmp0+1.0);
+                if ( fTmp0 < 0.0 )
+                    fTmp0 = afDiag[i1]-afDiag[i0]+afSubDiag[i0]/(fTmp0-fTmp1);
+                else
+                    fTmp0 = afDiag[i1]-afDiag[i0]+afSubDiag[i0]/(fTmp0+fTmp1);
+                Real fSin = 1.0;
+                Real fCos = 1.0;
+                Real fTmp2 = 0.0;
+                for (int i2 = i1-1; i2 >= i0; i2--)
+                {
+                    Real fTmp3 = fSin*afSubDiag[i2];
+                    Real fTmp4 = fCos*afSubDiag[i2];
+                    if ( Math::Abs(fTmp3) >= Math::Abs(fTmp0) )
+                    {
+                        fCos = fTmp0/fTmp3;
+                        fTmp1 = Math::Sqrt(fCos*fCos+1.0);
+                        afSubDiag[i2+1] = fTmp3*fTmp1;
+                        fSin = 1.0/fTmp1;
+                        fCos *= fSin;
+                    }
+                    else
+                    {
+                        fSin = fTmp3/fTmp0;
+                        fTmp1 = Math::Sqrt(fSin*fSin+1.0);
+                        afSubDiag[i2+1] = fTmp0*fTmp1;
+                        fCos = 1.0/fTmp1;
+                        fSin *= fCos;
+                    }
+                    fTmp0 = afDiag[i2+1]-fTmp2;
+                    fTmp1 = (afDiag[i2]-fTmp0)*fSin+2.0*fTmp4*fCos;
+                    fTmp2 = fSin*fTmp1;
+                    afDiag[i2+1] = fTmp0+fTmp2;
+                    fTmp0 = fCos*fTmp1-fTmp4;
+
+                    for (int iRow = 0; iRow < 3; iRow++)
+                    {
+                        fTmp3 = m[iRow][i2+1];
+                        m[iRow][i2+1] = fSin*m[iRow][i2] +
+                            fCos*fTmp3;
+                        m[iRow][i2] = fCos*m[iRow][i2] -
+                            fSin*fTmp3;
+                    }
+                }
+                afDiag[i0] -= fTmp2;
+                afSubDiag[i0] = fTmp0;
+                afSubDiag[i1] = 0.0;
+            }
+
+            if ( iIter == iMaxIter )
+            {
+                // should not get here under normal circumstances
+                return false;
+            }
+        }
+
+        return true;
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::EigenSolveSymmetric (Real afEigenvalue[3],
+        Vector3 akEigenvector[3]) const
+    {
+        Matrix3 kMatrix = *this;
+        Real afSubDiag[3];
+        kMatrix.Tridiagonal(afEigenvalue,afSubDiag);
+        kMatrix.QLAlgorithm(afEigenvalue,afSubDiag);
+
+        for (size_t i = 0; i < 3; i++)
+        {
+            akEigenvector[i][0] = kMatrix[0][i];
+            akEigenvector[i][1] = kMatrix[1][i];
+            akEigenvector[i][2] = kMatrix[2][i];
+        }
+
+        // make eigenvectors form a right--handed system
+        Vector3 kCross = akEigenvector[1].crossProduct(akEigenvector[2]);
+        Real fDet = akEigenvector[0].dotProduct(kCross);
+        if ( fDet < 0.0 )
+        {
+            akEigenvector[2][0] = - akEigenvector[2][0];
+            akEigenvector[2][1] = - akEigenvector[2][1];
+            akEigenvector[2][2] = - akEigenvector[2][2];
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Matrix3::TensorProduct (const Vector3& rkU, const Vector3& rkV,
+        Matrix3& rkProduct)
+    {
+        for (size_t iRow = 0; iRow < 3; iRow++)
+        {
+            for (size_t iCol = 0; iCol < 3; iCol++)
+                rkProduct[iRow][iCol] = rkU[iRow]*rkV[iCol];
+        }
+    }
+    //-----------------------------------------------------------------------
+}
Index: /OgreMain/src/OgreMatrix4.cpp
===================================================================
--- /OgreMain/src/OgreMatrix4.cpp	(revision 5)
+++ /OgreMain/src/OgreMatrix4.cpp	(revision 5)
@@ -0,0 +1,253 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreMatrix4.h"
+
+#include "OgreVector3.h"
+#include "OgreMatrix3.h"
+
+namespace Ogre
+{
+
+    const Matrix4 Matrix4::ZERO(
+        0, 0, 0, 0,
+        0, 0, 0, 0,
+        0, 0, 0, 0,
+        0, 0, 0, 0 );
+
+    const Matrix4 Matrix4::IDENTITY(
+        1, 0, 0, 0,
+        0, 1, 0, 0,
+        0, 0, 1, 0,
+        0, 0, 0, 1 );
+
+    const Matrix4 Matrix4::CLIPSPACE2DTOIMAGESPACE(
+        0.5,    0,  0, 0.5, 
+          0, -0.5,  0, 0.5, 
+          0,    0,  1,   0,
+          0,    0,  0,   1);
+
+    //-----------------------------------------------------------------------
+    inline static Real
+        MINOR(const Matrix4& m, const size_t r0, const size_t r1, const size_t r2, 
+								const size_t c0, const size_t c1, const size_t c2)
+    {
+        return m[r0][c0] * (m[r1][c1] * m[r2][c2] - m[r2][c1] * m[r1][c2]) -
+            m[r0][c1] * (m[r1][c0] * m[r2][c2] - m[r2][c0] * m[r1][c2]) +
+            m[r0][c2] * (m[r1][c0] * m[r2][c1] - m[r2][c0] * m[r1][c1]);
+    }
+    //-----------------------------------------------------------------------
+    Matrix4 Matrix4::adjoint() const
+    {
+        return Matrix4( MINOR(*this, 1, 2, 3, 1, 2, 3),
+            -MINOR(*this, 0, 2, 3, 1, 2, 3),
+            MINOR(*this, 0, 1, 3, 1, 2, 3),
+            -MINOR(*this, 0, 1, 2, 1, 2, 3),
+
+            -MINOR(*this, 1, 2, 3, 0, 2, 3),
+            MINOR(*this, 0, 2, 3, 0, 2, 3),
+            -MINOR(*this, 0, 1, 3, 0, 2, 3),
+            MINOR(*this, 0, 1, 2, 0, 2, 3),
+
+            MINOR(*this, 1, 2, 3, 0, 1, 3),
+            -MINOR(*this, 0, 2, 3, 0, 1, 3),
+            MINOR(*this, 0, 1, 3, 0, 1, 3),
+            -MINOR(*this, 0, 1, 2, 0, 1, 3),
+
+            -MINOR(*this, 1, 2, 3, 0, 1, 2),
+            MINOR(*this, 0, 2, 3, 0, 1, 2),
+            -MINOR(*this, 0, 1, 3, 0, 1, 2),
+            MINOR(*this, 0, 1, 2, 0, 1, 2));
+    }
+    //-----------------------------------------------------------------------
+    Real Matrix4::determinant() const
+    {
+        return m[0][0] * MINOR(*this, 1, 2, 3, 1, 2, 3) -
+            m[0][1] * MINOR(*this, 1, 2, 3, 0, 2, 3) +
+            m[0][2] * MINOR(*this, 1, 2, 3, 0, 1, 3) -
+            m[0][3] * MINOR(*this, 1, 2, 3, 0, 1, 2);
+    }
+    //-----------------------------------------------------------------------
+    Matrix4 Matrix4::inverse() const
+    {
+        Real m00 = m[0][0], m01 = m[0][1], m02 = m[0][2], m03 = m[0][3];
+        Real m10 = m[1][0], m11 = m[1][1], m12 = m[1][2], m13 = m[1][3];
+        Real m20 = m[2][0], m21 = m[2][1], m22 = m[2][2], m23 = m[2][3];
+        Real m30 = m[3][0], m31 = m[3][1], m32 = m[3][2], m33 = m[3][3];
+
+        Real v0 = m20 * m31 - m21 * m30;
+        Real v1 = m20 * m32 - m22 * m30;
+        Real v2 = m20 * m33 - m23 * m30;
+        Real v3 = m21 * m32 - m22 * m31;
+        Real v4 = m21 * m33 - m23 * m31;
+        Real v5 = m22 * m33 - m23 * m32;
+
+        Real t00 = + (v5 * m11 - v4 * m12 + v3 * m13);
+        Real t10 = - (v5 * m10 - v2 * m12 + v1 * m13);
+        Real t20 = + (v4 * m10 - v2 * m11 + v0 * m13);
+        Real t30 = - (v3 * m10 - v1 * m11 + v0 * m12);
+
+        Real invDet = 1 / (t00 * m00 + t10 * m01 + t20 * m02 + t30 * m03);
+
+        Real d00 = t00 * invDet;
+        Real d10 = t10 * invDet;
+        Real d20 = t20 * invDet;
+        Real d30 = t30 * invDet;
+
+        Real d01 = - (v5 * m01 - v4 * m02 + v3 * m03) * invDet;
+        Real d11 = + (v5 * m00 - v2 * m02 + v1 * m03) * invDet;
+        Real d21 = - (v4 * m00 - v2 * m01 + v0 * m03) * invDet;
+        Real d31 = + (v3 * m00 - v1 * m01 + v0 * m02) * invDet;
+
+        v0 = m10 * m31 - m11 * m30;
+        v1 = m10 * m32 - m12 * m30;
+        v2 = m10 * m33 - m13 * m30;
+        v3 = m11 * m32 - m12 * m31;
+        v4 = m11 * m33 - m13 * m31;
+        v5 = m12 * m33 - m13 * m32;
+
+        Real d02 = + (v5 * m01 - v4 * m02 + v3 * m03) * invDet;
+        Real d12 = - (v5 * m00 - v2 * m02 + v1 * m03) * invDet;
+        Real d22 = + (v4 * m00 - v2 * m01 + v0 * m03) * invDet;
+        Real d32 = - (v3 * m00 - v1 * m01 + v0 * m02) * invDet;
+
+        v0 = m21 * m10 - m20 * m11;
+        v1 = m22 * m10 - m20 * m12;
+        v2 = m23 * m10 - m20 * m13;
+        v3 = m22 * m11 - m21 * m12;
+        v4 = m23 * m11 - m21 * m13;
+        v5 = m23 * m12 - m22 * m13;
+
+        Real d03 = - (v5 * m01 - v4 * m02 + v3 * m03) * invDet;
+        Real d13 = + (v5 * m00 - v2 * m02 + v1 * m03) * invDet;
+        Real d23 = - (v4 * m00 - v2 * m01 + v0 * m03) * invDet;
+        Real d33 = + (v3 * m00 - v1 * m01 + v0 * m02) * invDet;
+
+        return Matrix4(
+            d00, d01, d02, d03,
+            d10, d11, d12, d13,
+            d20, d21, d22, d23,
+            d30, d31, d32, d33);
+    }
+    //-----------------------------------------------------------------------
+    Matrix4 Matrix4::inverseAffine(void) const
+    {
+        assert(isAffine());
+
+        Real m10 = m[1][0], m11 = m[1][1], m12 = m[1][2];
+        Real m20 = m[2][0], m21 = m[2][1], m22 = m[2][2];
+
+        Real t00 = m22 * m11 - m21 * m12;
+        Real t10 = m20 * m12 - m22 * m10;
+        Real t20 = m21 * m10 - m20 * m11;
+
+        Real m00 = m[0][0], m01 = m[0][1], m02 = m[0][2];
+
+        Real invDet = 1 / (m00 * t00 + m01 * t10 + m02 * t20);
+
+        t00 *= invDet; t10 *= invDet; t20 *= invDet;
+
+        m00 *= invDet; m01 *= invDet; m02 *= invDet;
+
+        Real r00 = t00;
+        Real r01 = m02 * m21 - m01 * m22;
+        Real r02 = m01 * m12 - m02 * m11;
+
+        Real r10 = t10;
+        Real r11 = m00 * m22 - m02 * m20;
+        Real r12 = m02 * m10 - m00 * m12;
+
+        Real r20 = t20;
+        Real r21 = m01 * m20 - m00 * m21;
+        Real r22 = m00 * m11 - m01 * m10;
+
+        Real m03 = m[0][3], m13 = m[1][3], m23 = m[2][3];
+
+        Real r03 = - (r00 * m03 + r01 * m13 + r02 * m23);
+        Real r13 = - (r10 * m03 + r11 * m13 + r12 * m23);
+        Real r23 = - (r20 * m03 + r21 * m13 + r22 * m23);
+
+        return Matrix4(
+            r00, r01, r02, r03,
+            r10, r11, r12, r13,
+            r20, r21, r22, r23,
+              0,   0,   0,   1);
+    }
+    //-----------------------------------------------------------------------
+    void Matrix4::makeTransform(const Vector3& position, const Vector3& scale, const Quaternion& orientation)
+    {
+        // Ordering:
+        //    1. Scale
+        //    2. Rotate
+        //    3. Translate
+
+        Matrix3 rot3x3, scale3x3;
+        orientation.ToRotationMatrix(rot3x3);
+        scale3x3 = Matrix3::ZERO;
+        scale3x3[0][0] = scale.x;
+        scale3x3[1][1] = scale.y;
+        scale3x3[2][2] = scale.z;
+
+        // Set up final matrix with scale, rotation and translation
+        *this = rot3x3 * scale3x3;
+        this->setTrans(position);
+
+        // No projection term
+        m[3][0] = 0; m[3][1] = 0; m[3][2] = 0; m[3][3] = 1;
+    }
+    //-----------------------------------------------------------------------
+    void Matrix4::makeInverseTransform(const Vector3& position, const Vector3& scale, const Quaternion& orientation)
+    {
+        // Invert the parameters
+        Vector3 invTranslate = -position;
+        Vector3 invScale(1 / scale.x, 1 / scale.y, 1 / scale.z);
+        Quaternion invRot = orientation.Inverse();
+
+        // Because we're inverting, order is translation, rotation, scale
+        // So make translation relative to scale & rotation
+        invTranslate *= invScale; // scale
+        invTranslate = invRot * invTranslate; // rotate
+
+        // Next, make a 3x3 rotation matrix and apply inverse scale
+        Matrix3 rot3x3, scale3x3;
+        invRot.ToRotationMatrix(rot3x3);
+        scale3x3 = Matrix3::ZERO;
+        scale3x3[0][0] = invScale.x;
+        scale3x3[1][1] = invScale.y;
+        scale3x3[2][2] = invScale.z;
+
+        // Set up final matrix with scale, rotation and translation
+        *this = scale3x3 * rot3x3;
+        this->setTrans(invTranslate);
+
+        // No projection term
+        m[3][0] = 0; m[3][1] = 0; m[3][2] = 0; m[3][3] = 1;
+    }
+
+}
Index: /OgreMain/src/OgreMemoryManager.cpp
===================================================================
--- /OgreMain/src/OgreMemoryManager.cpp	(revision 5)
+++ /OgreMain/src/OgreMemoryManager.cpp	(revision 5)
@@ -0,0 +1,1718 @@
+/*-------------------------------------------------------------------------
+This source file is a part of OGRE
+(Object-oriented Graphics Rendering Engine)
+
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License (LGPL) as 
+published by the Free Software Foundation; either version 2.1 of the 
+License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful, but 
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
+or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License 
+along with this library; if not, write to the Free Software Foundation, 
+Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA or go to
+http://www.gnu.org/copyleft/lesser.txt
+-------------------------------------------------------------------------*/
+#include "OgreStableHeaders.h"
+//---- ORIGINAL COPYRIGHT FOLLOWS -------------------------------------------
+// ---------------------------------------------------------------------------------------------------------------------------------
+// Copyright 2000, Paul Nettle. All rights reserved.
+//
+// You are free to use this source code in any commercial or non-commercial product.
+//
+// mmgr.cpp - Memory manager & tracking software
+//
+// The most recent version of this software can be found at: ftp://ftp.GraphicsPapers.com/pub/ProgrammingTools/MemoryManagers/
+//
+// [NOTE: Best when viewed with 8-character tabs]
+//
+// ---------------------------------------------------------------------------------------------------------------------------------
+
+#include "OgreMemoryManager.h"
+
+//-----------------------------------------------------------------------------
+// Allow the use of the real *alloc/free/new/delete functions
+#include "OgreNoMemoryMacros.h"
+//-----------------------------------------------------------------------------
+
+namespace Ogre
+{
+
+    //-----------------------------------------------------------------------------
+    MemoryManager& MemoryManager::instance(void)
+    {
+        // Ensure MemoryManager construct before any memory allocate,
+        // and then destruct after all memory deallocated.
+        static MemoryManager sMemManager;
+
+        return sMemManager;
+    }
+    //-----------------------------------------------------------------------------
+
+#if OGRE_DEBUG_MEMORY_MANAGER && OGRE_DEBUG_MODE
+
+#define OGRE_MEMMANAGER_STRESS_TEST 0
+
+#if OGRE_MEMORY_STRESS_TEST
+
+    bool randomWipe           = true;
+    bool alwaysValidateAll    = true;
+    bool alwaysLogAll         = true;
+    bool alwaysWipeAll        = false;
+    bool cleanupLogOnFirstRun = true;
+
+    const unsigned int hashBits    = 24;
+    const unsigned int paddingSize = 1024; // An extra 8K per allocation!
+
+#else
+
+    bool randomWipe           = false;
+    bool alwaysValidateAll    = false;
+    bool alwaysLogAll         = false;
+    bool alwaysWipeAll        = true;
+    bool cleanupLogOnFirstRun = true;
+
+    const unsigned int hashBits    = 24;
+    const unsigned int paddingSize = 4;
+
+#endif
+
+    //---------------------------------------------------------------------------------------------
+    // We define our own assert, because we don't want to bring up an assertion dialog, since that 
+    // allocates RAM. Our new assert simply declares a forced breakpoint.
+    //
+    // The BEOS assert added by Arvid Norberg <arvid@iname.com>.    
+    #ifdef    WIN32
+        #ifdef    _DEBUG
+            #if defined(_MSC_VER) 
+                    #define m_assert(x)  if( (x) == false ) __debugbreak();                
+            #elif defined(__GNUC__)
+                #define m_assert(x)  if( (x) == false ) __asm ("int $3");  
+            #endif
+        #else
+            #define    m_assert(x)
+        #endif
+    #elif defined(__BEOS__)
+        #ifdef DEBUG
+    extern void debugger(const char *message);
+            #define m_assert(x) { if( (x) == false ) debugger("mmgr: assert failed") }
+        #else
+            #define m_assert(x)
+        #endif
+    #else    // We can use this safely on *NIX, since it doesn't bring up a dialog window.
+        #define m_assert(cond) assert(cond)
+    #endif
+    //---------------------------------------------------------------------------------------------
+
+    //---------------------------------------------------------------------------------------------
+    // Here, we turn off our macros because any place in this source file where the word 'new' or 
+    // the word 'delete' (etc.) appear will be expanded by the macro. So to avoid problems using 
+    // them within this source file, we'll just #undef them.
+    #include "OgreNoMemoryMacros.h"
+    //---------------------------------------------------------------------------------------------
+
+    //---------------------------------------------------------------------------------------------
+    // Get to know these values. They represent the values that will be used to fill unused and 
+    // deallocated RAM.    
+    unsigned int prefixPattern   = 0xbaadf00d; // Fill pattern for bytes preceeding allocated blocks
+    unsigned int postfixPattern  = 0xdeadc0de; // Fill pattern for bytes following allocated blocks
+    unsigned int unusedPattern   = 0xfeedface; // Fill pattern for freshly allocated blocks 
+    unsigned int releasedPattern = 0xdeadbeef; // Fill pattern for deallocated blocks
+    //---------------------------------------------------------------------------------------------
+
+    //---------------------------------------------------------------------------------------------
+    // Other locals    
+    const unsigned int hashSize = 1 << hashBits;
+    const char *allocationTypes[] = 
+    {
+        "Unknown", 
+        "new",     
+        "new[]",  
+        "malloc",   
+        "calloc", 
+        "realloc", 
+        "delete", 
+        "delete[]", 
+        "free"
+    };
+    //---------------------------------------------------------------------------------------------
+
+    sAllocUnit *hashTable[hashSize];
+    sAllocUnit *reservoir = NULL;
+
+    unsigned int currentAllocationCount = 0;
+    unsigned int breakOnAllocationCount = 0;
+
+    sMStats stats;
+        
+    const char *sourceFile = "??";
+    const char *sourceFunc = "??";
+    unsigned int sourceLine = 0;
+
+    sAllocUnit    **reservoirBuffer      = NULL;
+    unsigned int    reservoirBufferSize    = 0;
+
+    const char *memoryLogFile     = "OgreMemory.log";
+    const char *memoryLeakLogFile = "OgreLeaks.log";
+
+    void doCleanupLogOnFirstRun();
+
+    //---------------------------------------------------------------------------------------------
+    // Local functions only
+    //---------------------------------------------------------------------------------------------
+
+    //---------------------------------------------------------------------------------------------
+    /** Logs a piece of information.
+    */
+    void log( const char *format, ... )
+    {
+        // The buffer
+        char buffer[2048];
+
+        va_list ap;
+        va_start( ap, format );
+        vsprintf( buffer, format, ap );
+        va_end( ap );
+
+        // Cleanup the log?
+
+        if( cleanupLogOnFirstRun )
+            doCleanupLogOnFirstRun();
+
+        // Open the log file
+        FILE *fp = fopen( memoryLogFile, "ab" );
+
+        // If you hit this assert, then the memory logger is unable to log 
+        // information to a file (can't open the file for some reason.) You can 
+        // interrogate the variable 'buffer' to see what was supposed to be logged 
+        // (but won't be.)
+        m_assert(fp);
+
+        if( !fp ) 
+            return;
+
+        // Spit out the data to the log
+        fprintf( fp, "%s\r\n", buffer );
+
+        fclose( fp );
+    }
+
+    //---------------------------------------------------------------------------------------------
+    /** Cleans up the log.
+    */
+    void doCleanupLogOnFirstRun()
+    {
+        if( cleanupLogOnFirstRun )
+        {
+            unlink( memoryLogFile );
+            cleanupLogOnFirstRun = false;
+
+            // Print a header for the log
+            time_t t = time(NULL);
+            log("--------------------------------------------------------------------------------");
+            log("");
+            log("      %s - Memory logging file created on %s", memoryLogFile, asctime(localtime(&t)));
+            log("--------------------------------------------------------------------------------");
+            log("");
+            log("This file contains a log of all memory operations performed during the last run.");
+            log("");
+            log("Interrogate this file to track errors or to help track down memory-related");
+            log("issues. You can do this by tracing the allocations performed by a specific owner");
+            log("or by tracking a specific address through a series of allocations and");
+            log("reallocations.");
+            log("");
+            log("There is a lot of useful information here which, when used creatively, can be");
+            log("extremely helpful.");
+            log("");
+            log("Note that the following guides are used throughout this file:");
+            log("");
+            log("   [!] - Error");
+            log("   [+] - Allocation");
+            log("   [~] - Reallocation");
+            log("   [-] - Deallocation");
+            log("   [I] - Generic information");
+            log("   [F] - Failure induced for the purpose of stress-testing your application");
+            log("   [D] - Information used for debugging this memory manager");
+            log("");
+            log("...so, to find all errors in the file, search for \"[!]\"");
+            log("");
+            log("--------------------------------------------------------------------------------");
+        }
+    }
+
+    //---------------------------------------------------------------------------------------------
+    /** This function strips the path from the beginning of the string that 
+        contains a path and a file name.
+        @returns
+            If possible, only the file name. Otherwise, the full string is 
+            returned.
+    */
+    const char *sourceFileStripper( const char *sourceFile )
+    {
+        const char *ptr = strrchr(sourceFile, '\\');
+        if( ptr ) 
+            return ptr + 1;
+        ptr = strrchr( sourceFile, '/' );
+        if( ptr ) 
+            return ptr + 1;
+        return sourceFile;
+    }
+
+    //---------------------------------------------------------------------------------------------
+    /** This helper function writes file and line information to a string.
+        @note
+            This function is not thread-safe.
+    */
+    const char *ownerString(
+        const char *sourceFile, 
+        const unsigned int sourceLine, 
+        const char *sourceFunc )
+    {
+        static char str[90];
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 && !defined( __MINGW32__ )
+		_snprintf( 
+#else
+        snprintf( 
+#endif
+			str, 89, "%s(%05d)::%s", 
+            sourceFileStripper(sourceFile), 
+            sourceLine, 
+            sourceFunc);
+        return str;
+    }
+
+    //---------------------------------------------------------------------------------------------
+    /** This helper function transforms an integer into a string with decimal 
+        separators.
+        @note
+            This function is not thread-safe.
+    */
+    const char *insertCommas( size_t value )
+    {
+        static char str[30];
+
+        // This pointer is used to add digits moving backwards in the string.
+        char *p = &str[28];
+        // The current digit
+        int c_digit = 1;
+
+        // Set the last character in the string to NULL.
+        str[29] = 0;
+
+        // While we've still got some digits in value, add them.
+        while( value )
+        {
+            *p-- = '0' + (char)( value % 10 ); value /= 10;
+
+            // If the digit which was inserted was at the end of a group, add a comma.
+            if( !( c_digit % 3 ) )
+                *p-- = ',';
+
+            c_digit++;
+        }
+
+        // Now return the offset in the static string above.
+        return ++p;
+    }
+
+    //---------------------------------------------------------------------------------------------
+    /** Converts a decimal memory value into human-readable format.
+        @note
+            This function is not thread-safe.
+    */
+    const char *memorySizeString( size_t size )
+    {       
+        static char str[90];
+
+        if( size > 1048576 )
+            sprintf( str, "%10s (%7.2fM)", insertCommas( size ), (float) size / 1048576.0f );
+        else if( size > 1024 )        
+            sprintf( str, "%10s (%7.2fK)", insertCommas( size ), (float) size / 1024.0f );
+        else
+            sprintf( str, "%10s bytes     ", insertCommas( size ) );
+        return str;
+    }
+
+    //---------------------------------------------------------------------------------------------
+    /** Tries to locate an allocation unit.
+    */
+    sAllocUnit *findAllocUnit(const void *reportedAddress)
+    {
+        // Just in case...
+        m_assert( reportedAddress != NULL );
+
+        // Use the address to locate the hash index. Note that we shift off the 
+        // lower four bits. This is because most allocated addresses will be on 
+        // four-, eight- or even sixteen-byte boundaries. If we didn't do this, 
+        // the hash index would not have very good coverage.
+
+        size_t hashIndex = ( (size_t)reportedAddress >> 4 ) & ( hashSize - 1 );
+        sAllocUnit *ptr = hashTable[ hashIndex ];
+        while( ptr )
+        {
+            if( ptr->reportedAddress == reportedAddress )
+                return ptr;
+            ptr = ptr->next;
+        }
+
+        return NULL;
+    }
+
+    // ---------------------------------------------------------------------------------------------------------------------------------
+    inline static size_t calculateActualSize( const size_t reportedSize )
+    {
+        // We use DWORDS as our padding, and a long is guaranteed to be 4 bytes, 
+        // but an int is not (ANSI defines an int as being the standard word size 
+        // for a processor; on a 32-bit machine, that's 4 bytes, but on a 64-bit 
+        // machine, it's 8 bytes, which means an int can actually be larger than 
+        // a long.)
+
+        return reportedSize + paddingSize * sizeof(long) * 2;
+    }
+
+    // ---------------------------------------------------------------------------------------------------------------------------------
+    inline static size_t calculateReportedSize( const size_t actualSize )
+    {
+        // We use DWORDS as our padding, and a long is guaranteed to be 4 bytes, 
+        // but an int is not (ANSI defines an int as being the standard word size 
+        // for a processor; on a 32-bit machine, that's 4 bytes, but on a 64-bit 
+        // machine, it's 8 bytes, which means an int can actually be larger than a 
+        // long.)
+
+        return actualSize - paddingSize * sizeof(long) * 2;
+    }
+
+    // ---------------------------------------------------------------------------------------------------------------------------------
+    inline void *calculateReportedAddress( const void *actualAddress )
+    {
+        // We allow this...
+        if (!actualAddress)
+            return NULL;
+
+        // Just account for the padding
+        return (void *)((char *) actualAddress + sizeof(long) * paddingSize );
+    }
+
+    // ---------------------------------------------------------------------------------------------------------------------------------
+    void wipeWithPattern(
+        sAllocUnit *allocUnit, 
+        unsigned long pattern, 
+        const size_t originalReportedSize = 0 )
+    {
+        // For a serious test run, we use wipes of random a random value. However, 
+        // if this causes a crash, we don't want it to crash in a different place 
+        // each time, so we specifically DO NOT call srand. If, by chance your 
+        // program calls srand(), you may wish to disable that when running with a 
+        // random wipe test. This will make any crashes more consistent so they
+        // can be tracked down easier.
+        if( randomWipe )
+        {
+            pattern = ((rand() & 0xff) << 24) | ((rand() & 0xff) << 16) | ((rand() & 0xff) << 8) | (rand() & 0xff);
+        }
+
+        // -DOC- We should wipe with 0's if we're not in debug mode, so we can help
+        // hide bugs if possible when we release the product. So uncomment the 
+        // following line for releases.
+        //
+        // Note that the "alwaysWipeAll" should be turned on for this to have 
+        // effect, otherwise it won't do much good. But we will leave it this way (as 
+        // an option) because this does slow things down.
+
+        //    pattern = 0;
+
+        // This part of the operation is optional
+        if( alwaysWipeAll && allocUnit->reportedSize > originalReportedSize )
+        {
+            // Fill the bulk
+            long  *lptr = (long *) ((char *)allocUnit->reportedAddress + originalReportedSize);
+            size_t length = allocUnit->reportedSize - originalReportedSize;
+            size_t i;
+            for( i = 0; i < (length >> 2); i++, lptr++ )
+            {
+                *lptr = pattern;
+            }
+
+            // Fill the remainder
+            unsigned int shiftCount = 0;
+            char *cptr = (char *) lptr;
+            for( i = 0; i < ( length & 0x3 ); i++, cptr++, shiftCount += 8 )
+            {
+                *cptr =  (char)((( pattern & ( 0xff << shiftCount ) ) >> shiftCount) & 0xff);
+            }
+        }
+
+        // Write in the prefix/postfix bytes
+        long        *pre = (long *)allocUnit->actualAddress;
+        long        *post = (long *)((char *)allocUnit->actualAddress + allocUnit->actualSize - paddingSize * sizeof(long));
+        for (unsigned int i = 0; i < paddingSize; i++, pre++, post++)
+        {
+            *pre = prefixPattern;
+            *post = postfixPattern;
+        }
+    }
+
+    // ---------------------------------------------------------------------------------------------------------------------------------
+    void dumpAllocations(FILE *fp)
+    {
+        fprintf(fp, "Alloc.   Addr       Size       Addr       Size                        BreakOn BreakOn              \r\n");
+        fprintf(fp, "Number Reported   Reported    Actual     Actual     Unused    Method  Dealloc Realloc Allocated by \r\n");
+        fprintf(fp, "------ ---------- ---------- ---------- ---------- ---------- -------- ------- ------- --------------------------------------------------- \r\n");
+
+        for( unsigned int i = 0; i < hashSize; i++ )
+        {
+            sAllocUnit *ptr = hashTable[i];
+            while( ptr )
+            {
+                fprintf(fp, "%06d 0x%08X 0x%08X 0x%08X 0x%08X 0x%08X %-8s    %c       %c    %s(%d) %s\r\n",
+                    ptr->allocationNumber,
+                    (size_t) ptr->reportedAddress, ptr->reportedSize,
+                    (size_t) ptr->actualAddress, ptr->actualSize,
+                    MemoryManager::instance().calcUnused(ptr),
+                    allocationTypes[ptr->allocationType],
+                    ptr->breakOnDealloc ? 'Y':'N',
+                    ptr->breakOnRealloc ? 'Y':'N',
+                    ptr->sourceFile, ptr->sourceLine, ptr->sourceFunc
+                    /*ownerString(ptr->sourceFile, ptr->sourceLine, ptr->sourceFunc)*/);
+                ptr = ptr->next;
+            }
+        }
+    }
+
+    // ---------------------------------------------------------------------------------------------------------------------------------
+    void dumpLeakReport()
+    {
+        // Open the report file
+        FILE *fp = fopen(memoryLeakLogFile, "w+b");
+
+        // If you hit this assert, then the memory report generator is unable to 
+        // log information to a file (can't open the file for some reason.)
+        m_assert(fp);
+
+        if( !fp )
+            return;
+
+        // Any leaks?
+
+        // Header
+        char timeString[25];
+        memset( timeString, 0, sizeof(timeString) );
+        time_t t = time(NULL);
+        struct tm *tme = localtime(&t);
+
+        fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");
+        fprintf(fp, "|                                          Memory leak report for:  %02d/%02d/%04d %02d:%02d:%02d                                            |\r\n", tme->tm_mon + 1, tme->tm_mday, tme->tm_year + 1900, tme->tm_hour, tme->tm_min, tme->tm_sec);
+        fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");
+        fprintf(fp, "\r\n");
+        fprintf(fp, "\r\n");
+
+        if( stats.totalAllocUnitCount )
+        {
+            fprintf(fp, "%d memory leak%s found:\r\n", 
+                stats.totalAllocUnitCount, 
+                stats.totalAllocUnitCount == 1 ? "":"s" );
+        }
+        else
+        {
+            fprintf(fp, "Congratulations! No memory leaks found!\r\n");
+
+            // We can finally free up our own memory allocations
+            if (reservoirBuffer)
+            {
+                for (unsigned int i = 0; i < reservoirBufferSize; i++)
+                {
+                    free( reservoirBuffer[i] );
+                }
+                free( reservoirBuffer );
+                reservoirBuffer = NULL;
+                reservoirBufferSize = 0;
+                reservoir = NULL;
+            }
+        }
+        fprintf(fp, "\r\n");
+
+        if( stats.totalAllocUnitCount )
+        {
+            dumpAllocations(fp);
+        }
+
+        fclose(fp);
+    }
+
+    /** When chasing a hard-to-pinpoint bug, use this function to make the memory 
+        manager exectue a breakpoint when the passed memory location is deallocated.
+    */
+    bool& MemoryManager::breakOnDealloc(void *reportedAddress)
+    {
+    #ifdef _DEBUG
+        // Locate the existing allocation unit
+        sAllocUnit *au = findAllocUnit( reportedAddress );
+
+        // If you hit this assert, you tried to set a breakpoint on deallocation 
+        // for an address that doesn't exist. Interrogate the stack frame or the 
+        // variable 'au' to see which allocation this is.
+        m_assert(au != NULL);
+
+        return au->breakOnDealloc;
+    #else
+        static bool b;
+        return b;
+    #endif
+    }
+
+    /** When tracking down a hard-to-pinpoint bug, use this function to make the
+        memory manager execute a breakpoint when a specified number of allocations
+        ave been made
+    */
+    void MemoryManager::breakOnAlloc(unsigned int count)
+    {
+    #ifdef _DEBUG
+        breakOnAllocationCount = count;
+    #endif
+    }
+
+    void MemoryManager::setOwner(const char *file, const unsigned int line, const char *func)
+    {
+        // You're probably wondering about this...
+        //
+        // It's important for this memory manager to primarily work with global 
+        // new/delete in their original forms (i.e. with no extra parameters.) In 
+        // order to do this, we use macros that call this function prior to 
+        // operators new & delete. This is fine... usually. Here's what actually 
+        // happens when you use this macro to delete an object:
+        //
+        // setOwner( __FILE__, __LINE__, __FUNCTION__ ) --> object::~object() --> delete
+        //
+        // Note that the compiler inserts a call to the object's destructor just 
+        // prior to calling our overridden operator delete. 
+        //
+        // But what happens when we delete an object whose destructor deletes 
+        // another object, whose desctuctor deletes another object? Here's a 
+        // diagram (indentation follows stack depth):
+        //
+        // setOwner(...) -> ~obj1()            // original call to delete obj1
+        //     setOwner(...) -> ~obj2()        // obj1's destructor deletes obj2
+        //         setOwner(...) -> ~obj3()    // obj2's destructor deletes obj3
+        //             ...                       // obj3's destructor just does some stuff
+        //         delete                        // back in obj2's destructor, we call delete
+        //     delete                            // back in obj1's destructor, we call delete
+        // delete                                // back to our original call, we call delete
+        //
+        // Because setOwner() just sets up some variables (below) it's important 
+        // that each call to setOwner() and successive calls to new/delete 
+        // alternate. However, in this case, three calls to setOwner() happen in 
+        // succession followed by three calls to delete in succession (with a few 
+        // calls to destructors mixed in for fun.) This means that only the final 
+        // call to delete (in this chain of events) will have the proper reporting, 
+        // and the first two in the chain will not have ANY owner-reporting 
+        // information. The deletes will still work fine, we just won't know who 
+        // called us.
+        //
+        // "Then build a stack, my friend!" you might think... but it's a very 
+        // common thing that people will be working with third-party libraries 
+        // (including MFC under Windows) which is not compiled with this memory 
+        // manager's macros. In those cases, setOwner() is never called, and 
+        // rightfully should not have the proper trace-back information. So if one 
+        // of the destructors in the chain ends up being a call to a delete from 
+        // a non-mmgr-compiled library, the stack will get confused.
+        //
+        // I've been unable to find a solution to this problem, but at least we can 
+        // detect it and report the data before we lose it. That's what this is all
+        // about. It makes it somewhat confusing to read in the logs, but at least
+        // ALL the information is present...
+        //
+        // There's a caveat here... The compiler is not required to call operator 
+        // delete if the value being deleted is NULL. In this case, any call to 
+        // delete with a NULL will sill call setOwner(), which will make 
+        // setOwner() think that there is a destructor chain becuase we setup the 
+        // variables, but nothing gets called to clear them. Because of this we 
+        // report a "Possible destructor chain".
+        //
+        // Thanks to J. Woznack (from Kodiak Interactive Software Studios -- 
+        // www.kodiakgames.com) for pointing this out.
+
+        if( sourceLine && alwaysLogAll )
+        {
+            log( "[I] NOTE! Possible destructor chain: previous owner is %s", 
+                ownerString(sourceFile, sourceLine, sourceFunc) );
+        }
+
+        // Okay... save this stuff off so we can keep track of the caller
+        sourceFile = file;
+        sourceLine = line;
+        sourceFunc = func;
+    }
+
+    void resetGlobals()
+    {
+        sourceFile = "??";
+        sourceLine = 0;
+        sourceFunc = "??";
+    }
+
+    /** Allocates a portion of memory.
+    */
+    void* MemoryManager::allocMem(
+        const char *sourceFile, 
+        const unsigned int sourceLine,  
+        const char *sourceFunc, 
+        const unsigned int allocationType, 
+        const size_t reportedSize, 
+        const unsigned processID )
+    {
+        // If we don't have a process ID yet, get one now
+        if( !gProcessID )
+            gProcessID = _getProcessID();
+
+        try
+        {
+            // Increase our allocation count
+            currentAllocationCount++;
+
+            // Log the request
+            if( alwaysLogAll ) 
+                log("[+] %05d %8s of size 0x%08X(%08d) by %s", 
+                    currentAllocationCount, 
+                    allocationTypes[allocationType], 
+                    reportedSize, 
+                    reportedSize, 
+                    ownerString(sourceFile, sourceLine, sourceFunc) );
+
+            // If you hit this assert, you requested a breakpoint on a specific 
+            // allocation count
+            m_assert( currentAllocationCount != breakOnAllocationCount );
+
+            // If necessary, grow the reservoir of unused allocation units
+            if( !reservoir )
+            {
+                // Allocate 256 reservoir elements
+                reservoir = (sAllocUnit *) malloc( sizeof(sAllocUnit) * 256 );
+
+                // If you hit this assert, then the memory manager failed to 
+                // allocate internal memory for tracking the allocations
+                m_assert( reservoir != NULL );
+
+                // Danger Will Robinson!
+                if( reservoir == NULL ) 
+                    throw "Unable to allocate RAM for internal memory tracking data";
+
+                // Build a linked-list of the elements in our reservoir
+                memset( reservoir, 0, sizeof(sAllocUnit) * 256 );
+                for (unsigned int i = 0; i < 256 - 1; i++)
+                {
+                    reservoir[i].next = &reservoir[i+1];
+                }
+
+                // Add this address to our reservoirBuffer so we can free it later
+                sAllocUnit **temp = (sAllocUnit **)realloc( reservoirBuffer, (reservoirBufferSize + 1) * sizeof(sAllocUnit *) );
+                m_assert( temp );
+                if( temp )
+                {
+                    reservoirBuffer = temp;
+                    reservoirBuffer[reservoirBufferSize++] = reservoir;
+                }
+            }
+
+            // Logical flow says this should never happen...
+            m_assert( reservoir != NULL );
+
+            // Grab a new allocaton unit from the front of the reservoir
+            sAllocUnit    *au = reservoir;
+            reservoir = au->next;
+
+            // Populate it with some real data
+            // HACK the allocator should not need to memset the sAllocUnit
+            // memset( au, 0, sizeof(sAllocUnit) );
+            au->actualSize = calculateActualSize(reportedSize);
+            #ifdef RANDOM_FAILURE
+            double    a = rand();
+            double    b = RAND_MAX / 100.0 * RANDOM_FAILURE;
+            if( a > b )
+            {
+                au->actualAddress = malloc( au->actualSize );
+            }
+            else
+            {
+                log("[F] Random faiure");
+                au->actualAddress = NULL;
+            }
+            #else
+            au->actualAddress     = malloc(au->actualSize);
+            #endif
+            au->reportedSize      = reportedSize;
+            au->reportedAddress   = calculateReportedAddress( au->actualAddress );
+            au->allocationType    = allocationType;
+            au->sourceLine        = sourceLine;
+            au->allocationNumber  = currentAllocationCount;
+            au->processID         = processID;
+
+            if( sourceFile ) 
+                strncpy( au->sourceFile, sourceFileStripper(sourceFile), sizeof(au->sourceFile) - 1 );
+            else
+                strcpy( au->sourceFile, "??" );
+
+            if( sourceFunc ) 
+                strncpy( au->sourceFunc, sourceFunc, sizeof(au->sourceFunc) - 1 );
+            else
+                strcpy( au->sourceFunc, "??" );
+
+            // We don't want to assert with random failures, because we want the application to deal with them.
+
+            #ifndef RANDOM_FAILURE
+            // If you hit this assert, then the requested allocation simply failed 
+            // (you're out of memory.) Interrogate the variable 'au' or the stack 
+            // frame to see what you were trying to do.
+            m_assert( au->actualAddress != NULL );
+            #endif
+
+            if( au->actualAddress == NULL )
+            {
+                throw "Request for allocation failed. Out of memory.";
+            }
+
+            // If you hit this assert, then this allocation was made from a source 
+            // that isn't setup to use this memory tracking software, use the stack
+            // frame to locate the source and include our H file.
+            m_assert( allocationType != m_alloc_unknown );
+
+            if( allocationType == m_alloc_unknown )
+            {
+                log( "[!] Allocation made from outside memory tracker in %s(%d)::%s:", au->sourceFile, au->sourceLine, au->sourceFunc );
+                dumpAllocUnit( au, "  " );
+            }
+
+            // Insert the new allocation into the hash table
+            size_t hashIndex = ((size_t) au->reportedAddress >> 4) & (hashSize - 1);
+            if( hashTable[hashIndex]) 
+            {
+                hashTable[hashIndex]->prev = au;
+            }
+            au->next = hashTable[hashIndex];
+            au->prev = NULL;
+            hashTable[hashIndex] = au;
+
+            // Account for the new allocatin unit in our stats
+            stats.totalReportedMemory += au->reportedSize;
+            stats.totalActualMemory   += au->actualSize;
+            stats.totalAllocUnitCount++;
+
+            if( stats.totalReportedMemory > stats.peakReportedMemory )
+                stats.peakReportedMemory = stats.totalReportedMemory;
+            if( stats.totalActualMemory   > stats.peakActualMemory )
+                stats.peakActualMemory   = stats.totalActualMemory;
+            if( stats.totalAllocUnitCount > stats.peakAllocUnitCount )
+                stats.peakAllocUnitCount = stats.totalAllocUnitCount;
+
+            stats.accumulatedReportedMemory += au->reportedSize;
+            stats.accumulatedActualMemory += au->actualSize;
+            stats.accumulatedAllocUnitCount++;
+
+            // Prepare the allocation unit for use (wipe it with recognizable garbage)
+            wipeWithPattern(au, unusedPattern);
+
+            // calloc() expects the reported memory address range to be filled with 0's
+            memset( au->reportedAddress, 0, au->reportedSize );
+            
+            // Validate every single allocated unit in memory
+            if( alwaysValidateAll )
+                validateAllAllocs();
+
+            // Log the result
+            if( alwaysLogAll )
+                log("[+] ---->             addr 0x%08X", (size_t) au->reportedAddress);
+
+            // Resetting the globals insures that if at some later time, somebody 
+            // calls our memory manager from an unknown source (i.e. they didn't 
+            // include our H file) then we won't think it was the last allocation.
+            resetGlobals();
+            
+            // Return the (reported) address of the new allocation unit
+            return au->reportedAddress;
+        }
+        catch( const char *err )
+        {
+            // Deal with the errors
+
+            log("[!] %s", err);
+            resetGlobals();
+
+            return NULL;
+        }
+    }
+
+    /** Memory reallocator.
+    */
+    void * MemoryManager::rllocMem(
+        const char *sourceFile, 
+        const unsigned int sourceLine, 
+        const char *sourceFunc, 
+        const unsigned int reallocationType, 
+        const size_t reportedSize, 
+        void *reportedAddress, 
+        const unsigned processID )
+    {
+        // If we don't have a process ID yet, get one now
+        if( !gProcessID )
+            gProcessID = _getProcessID();
+
+        try
+        {
+            // ANSI says: Calling realloc with a NULL should force same operations 
+            // as a malloc
+            if( !reportedAddress )
+            {
+                return allocMem(sourceFile, sourceLine, sourceFunc, reallocationType, reportedSize, processID );
+            }
+
+            // Increase our allocation count
+            currentAllocationCount++;
+
+            // If you hit this assert, you requested a breakpoint on a specific 
+            // allocation count
+            m_assert( currentAllocationCount != breakOnAllocationCount );
+
+            // Log the request
+            if( alwaysLogAll ) 
+                log("[~] %05d %8s of size 0x%08X(%08d) by %s", 
+                currentAllocationCount, 
+                allocationTypes[reallocationType], 
+                reportedSize, 
+                reportedSize, 
+                ownerString(sourceFile, sourceLine, sourceFunc) );
+
+            // Locate the existing allocation unit
+            sAllocUnit *au = findAllocUnit( reportedAddress );
+
+            // If you hit this assert, you tried to reallocate RAM that wasn't 
+            // allocated by this memory manager.
+            m_assert(au != NULL);
+            if( au == NULL )
+                throw "Request to reallocate RAM that was never allocated";
+
+            // If you hit this assert, then the allocation unit that is about to be
+            // reallocated is damaged. But you probably already know that from a 
+            // previous assert you should have seen in validateAllocUnit() :)
+            m_assert( validateAlloc( au ) );        
+
+            // If you hit this assert, then this reallocation was made from a source 
+            // that isn't setup to use this memory tracking software, use the stack
+            // frame to locate the source and include our H file.
+            m_assert( reallocationType != m_alloc_unknown );
+            if( reallocationType == m_alloc_unknown )
+            {
+                log( "[!] Allocationfrom outside memory tracker in %s(%d)::%s :", sourceFile, sourceLine, sourceFunc );
+                dumpAllocUnit( au, "  " );
+            }
+
+            // If you hit this assert, you were trying to reallocate RAM that was 
+            // not allocated in a way that is compatible with realloc. In other 
+            // words, you have a allocation/reallocation mismatch.
+            m_assert(
+                au->allocationType == m_alloc_malloc ||
+                au->allocationType == m_alloc_calloc ||
+                au->allocationType == m_alloc_realloc);
+            if( reallocationType == m_alloc_unknown )
+            {
+                log( "[!] Allocation-deallocation mismatch in %s(%d)::%s :", sourceFile, sourceLine, sourceFunc );
+                dumpAllocUnit( au, "  " );
+            }
+
+            // If you hit this assert, then the "break on realloc" flag for this 
+            // allocation unit is set (and will continue to be set until you 
+            // specifically shut it off. Interrogate the 'au' variable to determine
+            // information about this allocation unit.
+            m_assert( au->breakOnRealloc == false );
+
+            // Keep track of the original size
+            size_t originalReportedSize = au->reportedSize;
+
+            if (alwaysLogAll) log("[~] ---->             from 0x%08X(%08d)", 
+                originalReportedSize, 
+                originalReportedSize);
+
+            // Do the reallocation
+            void   *oldReportedAddress = reportedAddress;
+            size_t newActualSize = calculateActualSize(reportedSize);
+            void   *newActualAddress = NULL;
+
+            #ifdef RANDOM_FAILURE
+
+            double    a = rand();
+            double    b = RAND_MAX / 100.0 * RANDOM_FAILURE;
+            if (a > b)
+            {
+                newActualAddress = realloc(au->actualAddress, newActualSize);
+            }
+            else
+            {
+                log("[F] Random faiure");
+            }
+
+            #else
+
+            newActualAddress = realloc(au->actualAddress, newActualSize);
+
+            #endif
+
+            // We don't want to assert with random failures, because we want the 
+            // application to deal with them.
+
+            #ifndef RANDOM_FAILURE
+            // If you hit this assert, then the requested allocation simply failed 
+            // (you're out of memory) Interrogate the variable 'au' to see the 
+            // original allocation. You can also query 'newActualSize' to see the 
+            // amount of memory trying to be allocated. Finally, you can query 
+            // 'reportedSize' to see how much memory was requested by the caller.
+            m_assert(newActualAddress);
+            #endif
+
+            if (!newActualAddress) 
+                throw "Request for reallocation failed. Out of memory.";
+
+            // Remove this allocation from our stats (we'll add the new reallocation again later)
+            stats.totalReportedMemory -= au->reportedSize;
+            stats.totalActualMemory   -= au->actualSize;
+
+            // Update the allocation with the new information
+
+            au->actualSize        = newActualSize;
+            au->actualAddress     = newActualAddress;
+            au->reportedSize      = calculateReportedSize(newActualSize);
+            au->reportedAddress   = calculateReportedAddress(newActualAddress);
+            au->allocationType    = reallocationType;
+            au->sourceLine        = sourceLine;
+            au->allocationNumber  = currentAllocationCount;
+            au->processID         = processID;
+            if( sourceFile )
+                strncpy(au->sourceFile, sourceFileStripper(sourceFile), sizeof(au->sourceFile) - 1);
+            else
+                strcpy( au->sourceFile, "??" );
+            if( sourceFunc )
+                strncpy( au->sourceFunc, sourceFunc, sizeof(au->sourceFunc) - 1 );
+            else
+                strcpy( au->sourceFunc, "??" );
+
+            // The reallocation may cause the address to change, so we should 
+            // relocate our allocation unit within the hash table
+
+            size_t hashIndex = (unsigned int) -1;
+            if( oldReportedAddress != au->reportedAddress )
+            {
+                // Remove this allocation unit from the hash table
+                {
+                    size_t hashIndex = ((size_t) oldReportedAddress >> 4) & (hashSize - 1);
+                    if( hashTable[hashIndex] == au )
+                    {
+                        hashTable[hashIndex] = hashTable[hashIndex]->next;
+                    }
+                    else
+                    {
+                        if (au->prev)
+                            au->prev->next = au->next;
+                        if (au->next)
+                            au->next->prev = au->prev;
+                    }
+                }
+
+                // Re-insert it back into the hash table
+                hashIndex = ((size_t) au->reportedAddress >> 4) & (hashSize - 1);
+                if (hashTable[hashIndex]) 
+                    hashTable[hashIndex]->prev = au;
+                au->next = hashTable[hashIndex];
+                au->prev = NULL;
+                hashTable[hashIndex] = au;
+            }
+
+            // Account for the new allocatin unit in our stats
+            stats.totalReportedMemory += au->reportedSize;
+            stats.totalActualMemory   += au->actualSize;
+            if (stats.totalReportedMemory > stats.peakReportedMemory) 
+                stats.peakReportedMemory = stats.totalReportedMemory;
+            if (stats.totalActualMemory   > stats.peakActualMemory)   
+                stats.peakActualMemory   = stats.totalActualMemory;
+            size_t deltaReportedSize = reportedSize - originalReportedSize;
+            if( deltaReportedSize > 0 )
+            {
+                stats.accumulatedReportedMemory += deltaReportedSize;
+                stats.accumulatedActualMemory += deltaReportedSize;
+            }
+
+            // Prepare the allocation unit for use (wipe it with recognizable 
+            // garbage)
+            wipeWithPattern( au, unusedPattern, originalReportedSize );
+
+            // If you hit this assert, then something went wrong, because the 
+            // allocation unit was properly validated PRIOR to the reallocation. 
+            // This should not happen.
+            m_assert( validateAlloc(au) );
+
+            // Validate every single allocated unit in memory
+            if( alwaysValidateAll ) 
+                validateAllAllocs();
+
+            // Log the result
+            if (alwaysLogAll) log("[~] ---->             addr 0x%08X", 
+                (size_t) au->reportedAddress);
+
+            // Resetting the globals insures that if at some later time, somebody 
+            // calls our memory manager from an unknown source (i.e. they didn't 
+            // include our H file) then we won't think it was the last allocation.
+            resetGlobals();
+
+            // Return the (reported) address of the new allocation unit
+            return au->reportedAddress;
+        }
+        catch(const char *err)
+        {
+            // Deal with the errors
+            log("[!] %s", err);
+            resetGlobals();
+
+            return NULL;
+        }
+    }
+
+    // ---------------------------------------------------------------------------------------------------------------------------------
+    // Deallocate memory and track it
+    // ---------------------------------------------------------------------------------------------------------------------------------
+
+    void MemoryManager::dllocMem(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, const unsigned int deallocationType, const void *reportedAddress, const unsigned processID )
+    {
+		// early-out for NULL
+		if (!reportedAddress)
+			return;
+
+        try
+        {
+            // Log the request
+            if (alwaysLogAll) log("[-] ----- %8s of addr 0x%08X           by %s", 
+                allocationTypes[deallocationType], 
+                (size_t) reportedAddress, 
+                ownerString(sourceFile, sourceLine, sourceFunc) );
+
+            // Go get the allocation unit
+
+            sAllocUnit *au = findAllocUnit( reportedAddress );
+
+            // If you hit this assert, you tried to deallocate RAM that wasn't 
+            // allocated by this memory manager.
+            m_assert(au != NULL);
+            if (au == NULL) 
+                throw "Request to deallocate RAM that was never allocated";
+
+            // If you hit this assert, then the allocation unit that is about to be
+            // deallocated is damaged. But you probably already know that from a 
+            // previous assert you should have seen in validateAllocUnit() :)
+            m_assert(validateAlloc(au));
+
+            // If you hit this assert, then this deallocation was made from a 
+            // source that isn't setup to use this memory tracking software, use 
+            // the stack frame to locate the source and include our H file.
+            m_assert(deallocationType != m_alloc_unknown);
+            if( deallocationType == m_alloc_unknown )
+            {
+                log( "[!] Allocation-deallocation mismatch in %s(%d)::%s :", sourceFile, sourceLine, sourceFunc );
+                dumpAllocUnit( au, "  " );
+            }
+
+            // If you hit this assert, you were trying to deallocate RAM that was 
+            // not allocated in a way that is compatible with the deallocation 
+            // method requested. In other words, you have a allocation/deallocation 
+            // mismatch.
+            m_assert(
+                (deallocationType == m_alloc_delete       && au->allocationType == m_alloc_new      ) ||
+                (deallocationType == m_alloc_delete_array && au->allocationType == m_alloc_new_array) ||
+                (deallocationType == m_alloc_free         && au->allocationType == m_alloc_malloc   ) ||
+                (deallocationType == m_alloc_free         && au->allocationType == m_alloc_calloc   ) ||
+                (deallocationType == m_alloc_free         && au->allocationType == m_alloc_realloc  ) ||
+                (deallocationType == m_alloc_unknown                                                ) );
+            if( 
+                !(
+                (deallocationType == m_alloc_delete       && au->allocationType == m_alloc_new      ) ||
+                (deallocationType == m_alloc_delete_array && au->allocationType == m_alloc_new_array) ||
+                (deallocationType == m_alloc_free         && au->allocationType == m_alloc_malloc   ) ||
+                (deallocationType == m_alloc_free         && au->allocationType == m_alloc_calloc   ) ||
+                (deallocationType == m_alloc_free         && au->allocationType == m_alloc_realloc  ) ||
+                (deallocationType == m_alloc_unknown                                                ) ) )
+            {
+                log( "[!] Allocation-deallocation mismatch in %s(%d)::%s :", sourceFile, sourceLine, sourceFunc );
+                dumpAllocUnit( au, "  " );
+            }
+
+            // If you hit this assert, then this deallocation was made from another
+            // process than the one in which the allocation was made.
+            // m_assert( au->processID == processID );
+
+            // If you hit this assert, then the "break on dealloc" flag for this 
+            // allocation unit is set. Interrogate the 'au'
+            // variable to determine information about this allocation unit.
+            m_assert(au->breakOnDealloc == false);
+
+            // Wipe the deallocated RAM with a new pattern. This doen't actually do 
+            // us much good in debug mode under WIN32, because Microsoft's memory 
+            // debugging & tracking utilities will wipe it right after we do. 
+            // Oh well.
+            wipeWithPattern( au, releasedPattern );
+
+            // Do the deallocation
+            free(au->actualAddress);
+
+            // Remove this allocation unit from the hash table
+            size_t hashIndex = ((size_t) au->reportedAddress >> 4) & (hashSize - 1);
+            if( hashTable[hashIndex] == au )
+            {
+                hashTable[hashIndex] = au->next;
+            }
+            else
+            {
+                if (au->prev)
+                    au->prev->next = au->next;
+                if (au->next)
+                    au->next->prev = au->prev;
+            }
+
+            // Remove this allocation from our stats
+            stats.totalReportedMemory -= au->reportedSize;
+            stats.totalActualMemory   -= au->actualSize;
+            stats.totalAllocUnitCount--;
+
+            // Add this allocation unit to the front of our reservoir of unused allocation units
+            memset( au, 0, sizeof(sAllocUnit) );
+            au->next = reservoir;
+            reservoir = au;
+
+            // Resetting the globals insures that if at some later time, somebody 
+            // calls our memory manager from an unknown source (i.e. they didn't 
+            // include our H file) then we won't think it was the last allocation.
+            resetGlobals();
+
+            // Validate every single allocated unit in memory
+            if( alwaysValidateAll )
+                validateAllAllocs();
+
+            // If we're in the midst of  deinitialization time, track any pending memory leaks
+            if( m_bDeinitTime )
+                dumpLeakReport();
+        }
+        catch(const char *err)
+        {
+            // Deal with errors
+            log("[!] %s", err);
+            resetGlobals();
+        }
+    }
+
+    /** By using this function you can be proactive in tracking bugs by being able
+        to check wether a memory address has been allocated by the memory manager.
+    */
+    bool MemoryManager::validateAddr( const void *reportedAddress )
+    {
+        // Just see if the address exists in our allocation routines
+        return findAllocUnit(reportedAddress) != NULL;
+    }
+
+    bool MemoryManager::validateAlloc( const sAllocUnit *allocUnit )
+    {
+        // Make sure the padding is untouched
+        long *pre = (long *)allocUnit->actualAddress;
+        long *post = (long *)((char *)allocUnit->actualAddress + allocUnit->actualSize - paddingSize * sizeof(long));
+        bool errorFlag = false;
+        for( unsigned int i = 0; i < paddingSize; i++, pre++, post++ )
+        {
+            if( *pre != (long)prefixPattern )
+            {
+                log("[!] A memory allocation unit was corrupt because of an underrun:");
+                dumpAllocUnit( allocUnit, "  " );
+                errorFlag = true;
+            }
+
+            // If you hit this assert, then you should know that this allocation 
+            // unit has been damaged. Something (possibly the owner?) has underrun 
+            // the allocation unit (modified a few bytes prior to the start). You 
+            // can interrogate the variable 'allocUnit' to see statistics and 
+            // information about this damaged allocation unit.
+            m_assert(*pre == (long) prefixPattern);
+
+            if (*post != (long) postfixPattern)
+            {
+                log("[!] A memory allocation unit was corrupt because of an overrun:");
+                dumpAllocUnit(allocUnit, "  ");
+                errorFlag = true;
+            }
+
+            // If you hit this assert, then you should know that this allocation 
+            // unit has been damaged. Something (possibly the owner?) has overrun 
+            // the allocation unit (modified a few bytes after the end). You can 
+            // interrogate the variable 'allocUnit' to see statistics and 
+            // information about this damaged allocation unit.
+            m_assert(*post == (long) postfixPattern);
+        }
+
+        // Return the error status (we invert it, because a return of 'false' means error)
+        return !errorFlag;
+    }
+
+    bool MemoryManager::validateAllAllocs()
+    {
+        // Just go through each allocation unit in the hash table and count the ones that have errors
+        unsigned int errors = 0;
+        unsigned int allocCount = 0;
+
+        for( unsigned int i = 0; i < hashSize; i++ )
+        {
+            sAllocUnit *ptr = hashTable[i];
+            while(ptr)
+            {
+                allocCount++;
+                if (!validateAlloc(ptr)) 
+                    errors++;
+                ptr = ptr->next;
+            }
+        }
+
+        // Test for hash-table correctness
+        if( allocCount != stats.totalAllocUnitCount )
+        {
+            log("[!] Memory tracking hash table corrupt!");
+            errors++;
+        }
+
+        // If you hit this assert, then the internal memory (hash table) used by 
+        // this memory tracking software is damaged! The best way to track this 
+        // down is to use the alwaysLogAll flag in conjunction with STRESS_TEST 
+        // macro to narrow in on the offending code. After running the application 
+        // with these settings (and hitting this assert again), interrogate the 
+        // memory.log file to find the previous successful operation. The 
+        // corruption will have occurred between that point and this assertion.
+        m_assert( allocCount == stats.totalAllocUnitCount );
+
+        // If you hit this assert, then you've probably already been notified that 
+        // there was a problem with a allocation unit in a prior call to 
+        // validateAllocUnit(), but this assert is here just to make sure you know 
+        // about it. :)
+        m_assert( errors == 0 );
+
+        // Log any errors
+        if (errors) 
+            log("[!] While validating all allocation units, %d allocation unit(s) were found to have problems", 
+            errors );
+
+        // Return the error status
+        return errors != 0;
+    }
+
+    /** Determines how much RAM is unused.
+    */
+    unsigned int MemoryManager::calcUnused( const sAllocUnit *allocUnit )
+    {
+        const unsigned long *ptr = (const unsigned long *)allocUnit->reportedAddress;
+        unsigned int count = 0;
+
+        for( unsigned int i = 0; i < allocUnit->reportedSize; i += sizeof(long), ptr++ )
+        {
+            if (*ptr == unusedPattern) count += sizeof(long);
+        }
+
+        return count;
+    }
+
+    unsigned int MemoryManager::calcAllUnused()
+    {
+        // Just go through each allocation unit in the hash table and count the 
+        // unused RAM
+        unsigned int total = 0;
+        for( unsigned int i = 0; i < hashSize; i++ )
+        {
+            sAllocUnit *ptr = hashTable[i];
+            while(ptr)
+            {
+                total += calcUnused(ptr);
+                ptr = ptr->next;
+            }
+        }
+
+        return total;
+    }
+
+    void MemoryManager::dumpAllocUnit(const sAllocUnit *allocUnit, const char *prefix)
+    {
+        log("[I] %sAddress (reported): %010p",       prefix, allocUnit->reportedAddress);
+        log("[I] %sAddress (actual)  : %010p",       prefix, allocUnit->actualAddress);
+        log("[I] %sSize (reported)   : 0x%08X (%s)", prefix, allocUnit->reportedSize, 
+                                                    memorySizeString(allocUnit->reportedSize));
+        log("[I] %sSize (actual)     : 0x%08X (%s)", prefix, allocUnit->actualSize, 
+                                                    memorySizeString(allocUnit->actualSize));
+        log("[I] %sOwner             : %s(%d)::%s",  prefix, allocUnit->sourceFile, allocUnit->sourceLine, allocUnit->sourceFunc);
+        log("[I] %sAllocation type   : %s",          prefix, allocationTypes[allocUnit->allocationType]);
+        log("[I] %sAllocation number : %d",          prefix, allocUnit->allocationNumber);
+    }
+
+    void MemoryManager::dumpMemReport(const char *filename, const bool overwrite)
+    {
+        // Open the report file
+        FILE    *fp = NULL;
+        
+        if (overwrite)    
+            fp = fopen(filename, "w+b");
+        else        
+            fp = fopen(filename, "ab");
+
+        // If you hit this assert, then the memory report generator is unable to 
+        // log information to a file (can't open the file for some reason.)
+        m_assert(fp);
+        if (!fp) 
+            return;
+
+        // Header
+        char    timeString[25];
+        memset(timeString, 0, sizeof(timeString));
+        time_t  t = time(NULL);
+        struct  tm *tme = localtime(&t);
+
+        fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");
+        fprintf(fp, "|                                             Memory report for: %02d/%02d/%04d %02d:%02d:%02d                                     |\r\n", tme->tm_mon + 1, tme->tm_mday, tme->tm_year + 1900, tme->tm_hour, tme->tm_min, tme->tm_sec);
+        fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");
+        fprintf(fp, "\r\n");
+        fprintf(fp, "\r\n");
+
+        // Report summary
+        fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");
+        fprintf(fp, "|                                                           T O T A L S                                                            |\r\n");
+        fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");
+        fprintf(fp, "              Allocation unit count: %10s\r\n", insertCommas(stats.totalAllocUnitCount));
+        fprintf(fp, "            Reported to application: %s\r\n", memorySizeString(stats.totalReportedMemory));
+        fprintf(fp, "         Actual total memory in use: %s\r\n", memorySizeString(stats.totalActualMemory));
+        fprintf(fp, "           Memory tracking overhead: %s\r\n", memorySizeString(stats.totalActualMemory - stats.totalReportedMemory));
+        fprintf(fp, "\r\n");
+
+        fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");
+        fprintf(fp, "|                                                            P E A K S                                                             |\r\n");
+        fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");
+        fprintf(fp, "              Allocation unit count: %10s\r\n", insertCommas(stats.peakAllocUnitCount));
+        fprintf(fp, "            Reported to application: %s\r\n", memorySizeString(stats.peakReportedMemory));
+        fprintf(fp, "                             Actual: %s\r\n", memorySizeString(stats.peakActualMemory));
+        fprintf(fp, "           Memory tracking overhead: %s\r\n", memorySizeString(stats.peakActualMemory - stats.peakReportedMemory));
+        fprintf(fp, "\r\n");
+
+        fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");
+        fprintf(fp, "|                                                      A C C U M U L A T E D                                                       |\r\n");
+        fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");
+        fprintf(fp, "              Allocation unit count: %s\r\n", memorySizeString(stats.accumulatedAllocUnitCount));
+        fprintf(fp, "            Reported to application: %s\r\n", memorySizeString(stats.accumulatedReportedMemory));
+        fprintf(fp, "                             Actual: %s\r\n", memorySizeString(stats.accumulatedActualMemory));
+        fprintf(fp, "\r\n");
+
+        fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");
+        fprintf(fp, "|                                                           U N U S E D                                                            |\r\n");
+        fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");
+        fprintf(fp, "    Memory allocated but not in use: %s\r\n", memorySizeString(calcAllUnused()));
+        fprintf(fp, "\r\n");
+
+        dumpAllocations(fp);
+
+        fclose(fp);
+    }
+
+    sMStats    MemoryManager::getMemStats()
+    {
+        return stats;
+    }
+
+    // ---------------------------------------------------------------------------------------------------------------------------------
+    // Global new/new[]
+    //
+    // These are the standard new/new[] operators. They are merely interface functions that operate like normal new/new[], but use our
+    // memory tracking routines.
+    // ---------------------------------------------------------------------------------------------------------------------------------
+    void *MemoryManager::op_new_sc( size_t reportedSize, unsigned processID )
+    {
+        // Save these off...
+        const    char        *file = sourceFile;
+        const    unsigned int line = sourceLine;
+        const    char        *func = sourceFunc;
+
+        // ANSI says: allocation requests of 0 bytes will still return a valid value
+        if (reportedSize == 0) reportedSize = 1;
+
+        // ANSI says: loop continuously because the error handler could possibly free up some memory
+        for(;;)
+        {
+            // Try the allocation
+            void *ptr = allocMem(file, line, func, m_alloc_new, reportedSize, processID );
+            if( ptr )
+            {
+                return ptr;
+            }
+
+            // There isn't a way to determine the new handler, except through setting it. So we'll just set it to NULL, then
+            // set it back again.
+            std::new_handler nh = std::set_new_handler(0);
+            std::set_new_handler(nh);
+
+            // If there is an error handler, call it
+            if (nh)
+            {
+                (*nh)();
+            }
+
+            // Otherwise, throw the exception
+            else
+            {
+                throw std::bad_alloc();
+            }
+        }
+    }
+
+    // ---------------------------------------------------------------------------------------------------------------------------------
+    void *MemoryManager::op_new_vc( size_t reportedSize, unsigned processID )
+    {
+        // Save these off...
+        const    char        *file = sourceFile;
+        const    unsigned int line = sourceLine;
+        const    char        *func = sourceFunc;
+
+        // The ANSI standard says that allocation requests of 0 bytes will still return a valid value
+        if (reportedSize == 0) reportedSize = 1;
+
+        // ANSI says: loop continuously because the error handler could possibly free up some memory
+        for(;;)
+        {
+            // Try the allocation
+            void    *ptr = allocMem(file, line, func, m_alloc_new_array, reportedSize, processID );
+            if( ptr )
+            {
+                return ptr;
+            }
+
+            // There isn't a way to determine the new handler, except through setting it. So we'll just set it to NULL, then
+            // set it back again.
+            std::new_handler    nh = std::set_new_handler(0);
+            std::set_new_handler(nh);
+
+            // If there is an error handler, call it
+            if (nh)
+            {
+                (*nh)();
+            }
+
+            // Otherwise, throw the exception
+            else
+            {
+                throw std::bad_alloc();
+            }
+        }
+    }
+
+    // ---------------------------------------------------------------------------------------------------------------------------------
+    // Other global new/new[]
+    //
+    // These are the standard new/new[] operators as used by Microsoft's memory tracker. We don't want them interfering with our memory
+    // tracking efforts. Like the previous versions, these are merely interface functions that operate like normal new/new[], but use
+    // our memory tracking routines.
+    // ---------------------------------------------------------------------------------------------------------------------------------
+    void *MemoryManager::op_new_sc( size_t reportedSize, const char *sourceFile, int sourceLine, unsigned processID )
+    {
+        // The ANSI standard says that allocation requests of 0 bytes will still 
+        // return a valid value
+        if( reportedSize == 0 )
+            reportedSize = 1;
+
+        // ANSI says: loop continuously because the error handler could possibly 
+        // free up some memory
+        for(;;)
+        {
+            // Try the allocation
+
+            void    *ptr = allocMem(sourceFile, sourceLine, "??", m_alloc_new, reportedSize, processID );
+            if (ptr)
+            {
+                return ptr;
+            }
+
+            // There isn't a way to determine the new handler, except through setting it. So we'll just set it to NULL, then
+            // set it back again.
+
+            std::new_handler    nh = std::set_new_handler(0);
+            std::set_new_handler(nh);
+
+            // If there is an error handler, call it
+
+            if (nh)
+            {
+                (*nh)();
+            }
+
+            // Otherwise, throw the exception
+
+            else
+            {
+                throw std::bad_alloc();
+            }
+        }
+    }
+
+    // ---------------------------------------------------------------------------------------------------------------------------------
+    void *MemoryManager::op_new_vc(size_t reportedSize, const char *sourceFile, int sourceLine, unsigned processID )
+    {
+        // ANSI says : allocation requests of 0 bytes will still return a valid 
+        // value
+        if( reportedSize == 0 )
+            reportedSize = 1;
+
+        // ANSI says: loop continuously because the error handler could possibly 
+        // free up some memory
+
+        for(;;)
+        {
+            // Try the allocation
+            void *ptr = allocMem(
+                sourceFile, 
+                sourceLine, 
+                "??", 
+                m_alloc_new_array, 
+                reportedSize, 
+                processID );
+            if( ptr )
+            {
+                return ptr;
+            }
+
+            // There isn't a way to determine the new handler, except through 
+            // setting it. So we'll just set it to NULL, then set it back again.
+            std::new_handler nh = std::set_new_handler(0);
+            std::set_new_handler(nh);
+
+            // If there is an error handler, call it
+            if( nh )
+            {
+                (*nh)();
+            }
+
+            // Otherwise, throw the exception
+            else
+            {
+                throw std::bad_alloc();
+            }
+        }
+    }
+
+    // ---------------------------------------------------------------------------------------------------------------------------------
+    // Global delete/delete[]
+    //
+    // These are the standard delete/delete[] operators. They are merely interface functions that operate like normal delete/delete[],
+    // but use our memory tracking routines.
+    // ---------------------------------------------------------------------------------------------------------------------------------
+    void MemoryManager::op_del_sc(void *reportedAddress, unsigned processID )
+    {
+        // ANSI says: delete & delete[] allow NULL pointers (they do nothing)
+        if( reportedAddress )
+            dllocMem(sourceFile, sourceLine, sourceFunc, m_alloc_delete, reportedAddress, processID );
+        else if( alwaysLogAll )
+            log("[-] ----- %8s of NULL                      by %s", 
+            allocationTypes[m_alloc_delete], 
+            ownerString(sourceFile, sourceLine, sourceFunc) );
+
+        // Resetting the globals insures that if at some later time, somebody calls
+        // our memory manager from an unknown source (i.e. they didn't include our 
+        // H file) then we won't think it was the last allocation.
+        resetGlobals();
+    }
+
+    // ---------------------------------------------------------------------------------------------------------------------------------
+    void MemoryManager::op_del_vc(void *reportedAddress, unsigned processID )
+    {
+        // ANSI says: delete & delete[] allow NULL pointers (they do nothing)
+        if (reportedAddress) 
+            dllocMem(
+                sourceFile, 
+                sourceLine, 
+                sourceFunc, 
+                m_alloc_delete_array, 
+                reportedAddress, 
+                processID );
+        else if( alwaysLogAll )
+            log("[-] ----- %8s of NULL                      by %s", allocationTypes[m_alloc_delete_array], ownerString(sourceFile, sourceLine, sourceFunc));
+
+        // Resetting the globals insures that if at some later time, somebody calls
+        // our memory manager from an unknown source (i.e. they didn't include our 
+        // H file) then we won't think it was the last allocation.
+        resetGlobals();
+    }
+
+    MemoryManager::MemoryManager()
+        : m_uProcessIDs( 0 ), m_bDeinitTime( false )
+    {
+        doCleanupLogOnFirstRun();
+    }
+
+    MemoryManager::~MemoryManager()
+    {
+        m_bDeinitTime = true;
+        dumpLeakReport();    
+    }
+
+    unsigned MemoryManager::_getProcessID()
+    {
+        return ++m_uProcessIDs;
+    }
+ 
+#else
+
+    //-----------------------------------------------------------------------------
+    MemoryManager::MemoryManager()
+    {    
+    }
+
+    //-----------------------------------------------------------------------------
+    MemoryManager::~MemoryManager()
+    {                
+    }
+
+    //-----------------------------------------------------------------------------
+    void * MemoryManager::allocMem( const char *szFile, size_t uLine, 
+            size_t count ) throw()
+    {
+        void *ptr = malloc( count );
+        return ptr;
+    }        
+
+    //-----------------------------------------------------------------------------
+    void * MemoryManager::rllocMem( 
+        const char *szFile, size_t uLine, void *ptr , size_t count ) throw()
+    {
+        void *nptr = realloc( ptr, count );
+        return nptr;
+    }
+
+    //-----------------------------------------------------------------------------
+    void * MemoryManager::cllocMem( 
+        const char *szFile, size_t uLine, size_t num, size_t size ) throw()
+    {
+        void *ptr = malloc( num * size );
+
+        if( ptr )
+        {
+            memset( ptr , 0, num * size );
+        }
+        return ptr;
+    }
+
+    //-----------------------------------------------------------------------------
+    void MemoryManager::dllocMem( const char *szFile, size_t uLine, 
+            void *ptr) throw()
+    {
+        free( ptr );
+    }
+
+#endif // OGRE_DEBUG_MEMORY_MANAGER
+
+}
+
Index: /OgreMain/src/OgreMesh.cpp
===================================================================
--- /OgreMain/src/OgreMesh.cpp	(revision 5)
+++ /OgreMain/src/OgreMesh.cpp	(revision 5)
@@ -0,0 +1,2263 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreMesh.h"
+
+#include "OgreSubMesh.h"
+#include "OgreLogManager.h"
+#include "OgreMeshSerializer.h"
+#include "OgreSkeletonManager.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreStringConverter.h"
+#include "OgreException.h"
+#include "OgreMeshManager.h"
+#include "OgreEdgeListBuilder.h"
+#include "OgreAnimation.h"
+#include "OgreAnimationState.h"
+#include "OgreAnimationTrack.h"
+#include "OgreOptimisedUtil.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    MeshPtr::MeshPtr(const ResourcePtr& r) : SharedPtr<Mesh>()
+    {
+		// lock & copy other mutex pointer
+        OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+        {
+		    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+		    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+            pRep = static_cast<Mesh*>(r.getPointer());
+            pUseCount = r.useCountPointer();
+            if (pUseCount)
+            {
+                ++(*pUseCount);
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    MeshPtr& MeshPtr::operator=(const ResourcePtr& r)
+    {
+        if (pRep == static_cast<Mesh*>(r.getPointer()))
+            return *this;
+        release();
+		// lock & copy other mutex pointer
+        OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+        {
+		    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+		    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+            pRep = static_cast<Mesh*>(r.getPointer());
+            pUseCount = r.useCountPointer();
+            if (pUseCount)
+            {
+                ++(*pUseCount);
+            }
+        }
+		else
+		{
+			// RHS must be a null pointer
+			assert(r.isNull() && "RHS must be null if it has no mutex!");
+			setNull();
+		}
+        return *this;
+    }
+    //-----------------------------------------------------------------------
+    void MeshPtr::destroy(void)
+    {
+        // We're only overriding so that we can destroy after full definition of Mesh
+        SharedPtr<Mesh>::destroy();
+    }
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    Mesh::Mesh(ResourceManager* creator, const String& name, ResourceHandle handle,
+        const String& group, bool isManual, ManualResourceLoader* loader)
+        : Resource(creator, name, handle, group, isManual, loader),
+        mBoundRadius(0.0f),
+        mBoneAssignmentsOutOfDate(false),
+        mIsLodManual(false),
+        mNumLods(1),
+        mVertexBufferUsage(HardwareBuffer::HBU_STATIC_WRITE_ONLY),
+        mIndexBufferUsage(HardwareBuffer::HBU_STATIC_WRITE_ONLY),
+        mVertexBufferShadowBuffer(true),
+        mIndexBufferShadowBuffer(true),
+        mPreparedForShadowVolumes(false),
+        mEdgeListsBuilt(false),
+        mAutoBuildEdgeLists(true), // will be set to false by serializers of 1.30 and above
+		mSharedVertexDataAnimationType(VAT_NONE),
+		mAnimationTypesDirty(true),
+		sharedVertexData(0)
+    {
+
+		// Init first (manual) lod
+		MeshLodUsage lod;
+		lod.fromDepthSquared = 0.0f;
+        lod.edgeData = NULL;
+        lod.manualMesh.setNull();
+		mMeshLodUsageList.push_back(lod);
+
+    }
+    //-----------------------------------------------------------------------
+    Mesh::~Mesh()
+    {
+        // have to call this here reather than in Resource destructor
+        // since calling virtual methods in base destructors causes crash
+        unload();
+    }
+    //-----------------------------------------------------------------------
+    SubMesh* Mesh::createSubMesh()
+    {
+        SubMesh* sub = new SubMesh();
+        sub->parent = this;
+
+        mSubMeshList.push_back(sub);
+
+        return sub;
+    }
+    //-----------------------------------------------------------------------
+    SubMesh* Mesh::createSubMesh(const String& name)
+	{
+		SubMesh *sub = createSubMesh();
+		nameSubMesh(name, (ushort)mSubMeshList.size()-1);
+		return sub ;
+	}
+    //-----------------------------------------------------------------------
+    unsigned short Mesh::getNumSubMeshes() const
+    {
+        return static_cast< unsigned short >( mSubMeshList.size() );
+    }
+
+    //---------------------------------------------------------------------
+	void Mesh::nameSubMesh(const String& name, ushort index)
+	{
+		mSubMeshNameMap[name] = index ;
+	}
+
+    //-----------------------------------------------------------------------
+    SubMesh* Mesh::getSubMesh(const String& name) const
+	{
+		ushort index = _getSubMeshIndex(name);
+		return getSubMesh(index);
+	}
+    //-----------------------------------------------------------------------
+    SubMesh* Mesh::getSubMesh(unsigned short index) const
+    {
+        if (index >= mSubMeshList.size())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "Index out of bounds.",
+                "Mesh::getSubMesh");
+        }
+
+        return mSubMeshList[index];
+    }
+	//-----------------------------------------------------------------------
+	void Mesh::postLoadImpl(void)
+	{
+		// Prepare for shadow volumes?
+		if (MeshManager::getSingleton().getPrepareAllMeshesForShadowVolumes())
+		{
+			if (mEdgeListsBuilt || mAutoBuildEdgeLists)
+			{
+				prepareForShadowVolume();
+			}
+
+			if (!mEdgeListsBuilt && mAutoBuildEdgeLists)
+			{
+				buildEdgeList();
+			}
+		}
+	}
+	//-----------------------------------------------------------------------
+    void Mesh::loadImpl()
+    {
+        // Load from specified 'name'
+        MeshSerializer serializer;
+        LogManager::getSingleton().logMessage("Mesh: Loading " + mName + ".");
+
+        DataStreamPtr stream =
+            ResourceGroupManager::getSingleton().openResource(
+				mName, mGroup, true, this);
+        serializer.importMesh(stream, this);
+
+        /* check all submeshes to see if their materials should be
+           updated.  If the submesh has texture aliases that match those
+           found in the current material then a new material is created using
+           the textures from the submesh.
+        */
+        updateMaterialForAllSubMeshes();
+    }
+
+    //-----------------------------------------------------------------------
+    void Mesh::unloadImpl()
+    {
+        // Teardown submeshes
+        for (SubMeshList::iterator i = mSubMeshList.begin();
+            i != mSubMeshList.end(); ++i)
+        {
+            delete *i;
+        }
+        if (sharedVertexData)
+        {
+            delete sharedVertexData;
+            sharedVertexData = NULL;
+        }
+		// Clear SubMesh lists
+		mSubMeshList.clear();
+		mSubMeshNameMap.clear();
+        // Removes all LOD data
+        removeLodLevels();
+        mPreparedForShadowVolumes = false;
+
+		// remove all poses & animations
+		removeAllAnimations();
+		removeAllPoses();
+
+        // Clear bone assignments
+        mBoneAssignments.clear();
+        mBoneAssignmentsOutOfDate = false;
+
+        // Removes reference to skeleton
+        setSkeletonName(StringUtil::BLANK);
+    }
+
+    //-----------------------------------------------------------------------
+    MeshPtr Mesh::clone(const String& newName, const String& newGroup)
+    {
+        // This is a bit like a copy constructor, but with the additional aspect of registering the clone with
+        //  the MeshManager
+
+        // New Mesh is assumed to be manually defined rather than loaded since you're cloning it for a reason
+        String theGroup;
+        if (newGroup == StringUtil::BLANK)
+        {
+            theGroup = this->getGroup();
+        }
+        else
+        {
+            theGroup = newGroup;
+        }
+        MeshPtr newMesh = MeshManager::getSingleton().createManual(newName, theGroup);
+
+        // Copy submeshes first
+        std::vector<SubMesh*>::iterator subi;
+        SubMesh* newSub;
+        for (subi = mSubMeshList.begin(); subi != mSubMeshList.end(); ++subi)
+        {
+            newSub = newMesh->createSubMesh();
+            newSub->mMaterialName = (*subi)->mMaterialName;
+            newSub->mMatInitialised = (*subi)->mMatInitialised;
+            newSub->operationType = (*subi)->operationType;
+            newSub->useSharedVertices = (*subi)->useSharedVertices;
+            newSub->extremityPoints = (*subi)->extremityPoints;
+
+            if (!(*subi)->useSharedVertices)
+            {
+                // Copy unique vertex data
+				newSub->vertexData = (*subi)->vertexData->clone();
+                // Copy unique index map
+                newSub->blendIndexToBoneIndexMap = (*subi)->blendIndexToBoneIndexMap;
+            }
+
+            // Copy index data
+            delete newSub->indexData;
+			newSub->indexData = (*subi)->indexData->clone();
+            // Copy any bone assignments
+            newSub->mBoneAssignments = (*subi)->mBoneAssignments;
+            newSub->mBoneAssignmentsOutOfDate = (*subi)->mBoneAssignmentsOutOfDate;
+            // Copy texture aliases
+            newSub->mTextureAliases = (*subi)->mTextureAliases;
+
+            // Copy lod face lists
+            newSub->mLodFaceList.reserve((*subi)->mLodFaceList.size());
+            ProgressiveMesh::LODFaceList::const_iterator facei;
+            for (facei = (*subi)->mLodFaceList.begin(); facei != (*subi)->mLodFaceList.end(); ++facei) {
+                IndexData* newIndexData = (*facei)->clone();
+                newSub->mLodFaceList.push_back(newIndexData);
+            }
+        }
+
+        // Copy shared geometry and index map, if any
+        if (sharedVertexData)
+        {
+            newMesh->sharedVertexData = sharedVertexData->clone();
+            newMesh->sharedBlendIndexToBoneIndexMap = sharedBlendIndexToBoneIndexMap;
+        }
+
+		// Copy submesh names
+		newMesh->mSubMeshNameMap = mSubMeshNameMap ;
+        // Copy any bone assignments
+        newMesh->mBoneAssignments = mBoneAssignments;
+        newMesh->mBoneAssignmentsOutOfDate = mBoneAssignmentsOutOfDate;
+        // Copy bounds
+        newMesh->mAABB = mAABB;
+        newMesh->mBoundRadius = mBoundRadius;
+
+		newMesh->mIsLodManual = mIsLodManual;
+		newMesh->mNumLods = mNumLods;
+		newMesh->mMeshLodUsageList = mMeshLodUsageList;
+        // Unreference edge lists, otherwise we'll delete the same lot twice, build on demand
+        MeshLodUsageList::iterator lodi;
+        for (lodi = newMesh->mMeshLodUsageList.begin(); lodi != newMesh->mMeshLodUsageList.end(); ++lodi) {
+            MeshLodUsage& lod = *lodi;
+            lod.edgeData = NULL;
+            // TODO: Copy manual lod meshes
+        }
+
+		newMesh->mVertexBufferUsage = mVertexBufferUsage;
+		newMesh->mIndexBufferUsage = mIndexBufferUsage;
+		newMesh->mVertexBufferShadowBuffer = mVertexBufferShadowBuffer;
+		newMesh->mIndexBufferShadowBuffer = mIndexBufferShadowBuffer;
+
+        newMesh->mSkeletonName = mSkeletonName;
+        newMesh->mSkeleton = mSkeleton;
+
+		// Keep prepared shadow volume info (buffers may already be prepared)
+		newMesh->mPreparedForShadowVolumes = mPreparedForShadowVolumes;
+
+		// mEdgeListsBuilt and edgeData of mMeshLodUsageList
+		// will up to date on demand. Not copied since internal references, and mesh
+		// data may be altered
+		
+		// Clone vertex animation
+		for (AnimationList::iterator i = mAnimationsList.begin();
+			i != mAnimationsList.end(); ++i)
+		{
+			Animation *newAnim = i->second->clone(i->second->getName());
+			newMesh->mAnimationsList[newName] = newAnim;
+		}
+		// Clone pose list
+		for (PoseList::iterator i = mPoseList.begin(); i != mPoseList.end(); ++i)
+		{
+			Pose* newPose = (*i)->clone();
+			newMesh->mPoseList.push_back(newPose);
+		}
+		newMesh->mSharedVertexDataAnimationType = mSharedVertexDataAnimationType;
+		newMesh->mAnimationTypesDirty = mAnimationTypesDirty;
+
+
+        newMesh->load();
+        newMesh->touch();
+
+        return newMesh;
+
+    }
+    //-----------------------------------------------------------------------
+    const AxisAlignedBox& Mesh::getBounds(void) const
+    {
+        return mAABB;
+    }
+    //-----------------------------------------------------------------------
+    void Mesh::_setBounds(const AxisAlignedBox& bounds, bool pad)
+    {
+        mAABB = bounds;
+        Vector3 max = mAABB.getMaximum();
+        Vector3 min = mAABB.getMinimum();
+
+        // Set sphere bounds; not the tightest by since we're using
+        // manual AABB it is the only way
+        Real sqLen1 = min.squaredLength();
+        Real sqLen2 = max.squaredLength();
+
+        mBoundRadius = Math::Sqrt(std::max(sqLen1, sqLen2));
+        if (pad)
+        {
+            // Pad out the AABB a little, helps with most bounds tests
+            Vector3 scaler = (max - min) * MeshManager::getSingleton().getBoundsPaddingFactor();
+            mAABB.setExtents(min  - scaler, max + scaler);
+            // Pad out the sphere a little too
+            mBoundRadius = mBoundRadius + (mBoundRadius * MeshManager::getSingleton().getBoundsPaddingFactor());
+        }
+        else
+        {
+            mAABB.setExtents(min, max);
+            mBoundRadius = mBoundRadius;
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void Mesh::_setBoundingSphereRadius(Real radius)
+    {
+        mBoundRadius = radius;
+    }
+    //-----------------------------------------------------------------------
+    void Mesh::setSkeletonName(const String& skelName)
+    {
+        mSkeletonName = skelName;
+
+        if (skelName.empty())
+        {
+            // No skeleton
+            mSkeleton.setNull();
+        }
+        else
+        {
+            // Load skeleton
+            try {
+                mSkeleton = SkeletonManager::getSingleton().load(skelName, mGroup);
+            }
+            catch (...)
+            {
+                mSkeleton.setNull();
+                // Log this error
+                String msg = "Unable to load skeleton ";
+                msg += skelName + " for Mesh " + mName
+                    + ". This Mesh will not be animated. "
+                    + "You can ignore this message if you are using an offline tool.";
+                LogManager::getSingleton().logMessage(msg);
+
+            }
+
+
+        }
+    }
+    //-----------------------------------------------------------------------
+    bool Mesh::hasSkeleton(void) const
+    {
+        return !(mSkeletonName.empty());
+    }
+    //-----------------------------------------------------------------------
+    const SkeletonPtr& Mesh::getSkeleton(void) const
+    {
+        return mSkeleton;
+    }
+    //-----------------------------------------------------------------------
+    void Mesh::addBoneAssignment(const VertexBoneAssignment& vertBoneAssign)
+    {
+        mBoneAssignments.insert(
+            VertexBoneAssignmentList::value_type(vertBoneAssign.vertexIndex, vertBoneAssign));
+        mBoneAssignmentsOutOfDate = true;
+    }
+    //-----------------------------------------------------------------------
+    void Mesh::clearBoneAssignments(void)
+    {
+        mBoneAssignments.clear();
+        mBoneAssignmentsOutOfDate = true;
+    }
+    //-----------------------------------------------------------------------
+    void Mesh::_initAnimationState(AnimationStateSet* animSet)
+    {
+		// Animation states for skeletal animation
+		if (hasSkeleton())
+		{
+			// Delegate to Skeleton
+			assert(!mSkeleton.isNull() && "Skeleton not present");
+			mSkeleton->_initAnimationState(animSet);
+
+			// Take the opportunity to update the compiled bone assignments
+            _updateCompiledBoneAssignments();
+		}
+
+		// Animation states for vertex animation
+		for (AnimationList::iterator i = mAnimationsList.begin();
+			i != mAnimationsList.end(); ++i)
+		{
+			// Only create a new animation state if it doesn't exist
+			// We can have the same named animation in both skeletal and vertex
+			// with a shared animation state affecting both, for combined effects
+			// The animations should be the same length if this feature is used!
+			if (!animSet->hasAnimationState(i->second->getName()))
+			{
+				animSet->createAnimationState(i->second->getName(), 0.0,
+					i->second->getLength());
+			}
+
+		}
+
+    }
+	//---------------------------------------------------------------------
+	void Mesh::_refreshAnimationState(AnimationStateSet* animSet)
+	{
+		if (hasSkeleton())
+		{
+			mSkeleton->_refreshAnimationState(animSet);
+		}
+
+		// Merge in any new vertex animations
+		AnimationList::iterator i;
+		for (i = mAnimationsList.begin(); i != mAnimationsList.end(); ++i)
+		{
+			Animation* anim = i->second;
+			// Create animation at time index 0, default params mean this has weight 1 and is disabled
+			const String& animName = anim->getName();
+			if (!animSet->hasAnimationState(animName))
+			{
+				animSet->createAnimationState(animName, 0.0, anim->getLength());
+			}
+			else
+			{
+				// Update length incase changed
+				AnimationState* animState = animSet->getAnimationState(animName);
+				animState->setLength(anim->getLength());
+				animState->setTimePosition(std::min(anim->getLength(), animState->getTimePosition()));
+			}
+		}
+
+	}
+    //-----------------------------------------------------------------------
+    void Mesh::_updateCompiledBoneAssignments(void)
+    {
+        if (mBoneAssignmentsOutOfDate)
+            _compileBoneAssignments();
+
+        SubMeshList::iterator i;
+        for (i = mSubMeshList.begin(); i != mSubMeshList.end(); ++i)
+        {
+            if ((*i)->mBoneAssignmentsOutOfDate)
+            {
+                (*i)->_compileBoneAssignments();
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    typedef std::multimap<Real, Mesh::VertexBoneAssignmentList::iterator> WeightIteratorMap;
+    unsigned short Mesh::_rationaliseBoneAssignments(size_t vertexCount, Mesh::VertexBoneAssignmentList& assignments)
+    {
+        // Iterate through, finding the largest # bones per vertex
+        unsigned short maxBones = 0;
+		bool existsNonSkinnedVertices = false;
+        VertexBoneAssignmentList::iterator i;
+
+        for (size_t v = 0; v < vertexCount; ++v)
+        {
+            // Get number of entries for this vertex
+            unsigned short currBones = static_cast<unsigned short>(assignments.count(v));
+			if (currBones <= 0)
+				existsNonSkinnedVertices = true;
+
+            // Deal with max bones update
+            // (note this will record maxBones even if they exceed limit)
+            if (maxBones < currBones)
+                maxBones = currBones;
+            // does the number of bone assignments exceed limit?
+            if (currBones > OGRE_MAX_BLEND_WEIGHTS)
+            {
+                // To many bone assignments on this vertex
+                // Find the start & end (end is in iterator terms ie exclusive)
+                std::pair<VertexBoneAssignmentList::iterator, VertexBoneAssignmentList::iterator> range;
+                // map to sort by weight
+                WeightIteratorMap weightToAssignmentMap;
+                range = assignments.equal_range(v);
+                // Add all the assignments to map
+                for (i = range.first; i != range.second; ++i)
+                {
+                    // insert value weight->iterator
+                    weightToAssignmentMap.insert(
+                        WeightIteratorMap::value_type(i->second.weight, i));
+                }
+                // Reverse iterate over weight map, remove lowest n
+                unsigned short numToRemove = currBones - OGRE_MAX_BLEND_WEIGHTS;
+                WeightIteratorMap::iterator remIt = weightToAssignmentMap.begin();
+
+                while (numToRemove--)
+                {
+                    // Erase this one
+                    assignments.erase(remIt->second);
+                    ++remIt;
+                }
+            } // if (currBones > OGRE_MAX_BLEND_WEIGHTS)
+
+            // Make sure the weights are normalised
+            // Do this irrespective of whether we had to remove assignments or not
+            //   since it gives us a guarantee that weights are normalised
+            //  We assume this, so it's a good idea since some modellers may not
+            std::pair<VertexBoneAssignmentList::iterator, VertexBoneAssignmentList::iterator> normalise_range = assignments.equal_range(v);
+            Real totalWeight = 0;
+            // Find total first
+            for (i = normalise_range.first; i != normalise_range.second; ++i)
+            {
+                totalWeight += i->second.weight;
+            }
+            // Now normalise if total weight is outside tolerance
+            if (!Math::RealEqual(totalWeight, 1.0f))
+            {
+                for (i = normalise_range.first; i != normalise_range.second; ++i)
+                {
+                    i->second.weight = i->second.weight / totalWeight;
+                }
+            }
+
+        }
+
+		if (maxBones > OGRE_MAX_BLEND_WEIGHTS)
+		{
+            // Warn that we've reduced bone assignments
+            LogManager::getSingleton().logMessage("WARNING: the mesh '" + mName + "' "
+                "includes vertices with more than " +
+                StringConverter::toString(OGRE_MAX_BLEND_WEIGHTS) + " bone assignments. "
+                "The lowest weighted assignments beyond this limit have been removed, so "
+                "your animation may look slightly different. To eliminate this, reduce "
+                "the number of bone assignments per vertex on your mesh to " +
+                StringConverter::toString(OGRE_MAX_BLEND_WEIGHTS) + ".");
+            // we've adjusted them down to the max
+            maxBones = OGRE_MAX_BLEND_WEIGHTS;
+
+        }
+
+		if (existsNonSkinnedVertices)
+		{
+            // Warn that we've non-skinned vertices
+            LogManager::getSingleton().logMessage("WARNING: the mesh '" + mName + "' "
+                "includes vertices without bone assignments. Those vertices will "
+				"transform to wrong position when skeletal animation enabled. "
+				"To eliminate this, assign at least one bone assignment per vertex "
+				"on your mesh.");
+		}
+
+        return maxBones;
+    }
+    //-----------------------------------------------------------------------
+    void  Mesh::_compileBoneAssignments(void)
+    {
+        unsigned short maxBones =
+            _rationaliseBoneAssignments(sharedVertexData->vertexCount, mBoneAssignments);
+
+        if (maxBones != 0)
+        {
+            compileBoneAssignments(mBoneAssignments, maxBones, 
+                sharedBlendIndexToBoneIndexMap, sharedVertexData);
+        }
+
+        mBoneAssignmentsOutOfDate = false;
+    }
+    //---------------------------------------------------------------------
+    void Mesh::buildIndexMap(const VertexBoneAssignmentList& boneAssignments,
+        IndexMap& boneIndexToBlendIndexMap, IndexMap& blendIndexToBoneIndexMap)
+    {
+        if (boneAssignments.empty())
+        {
+            // Just in case
+            boneIndexToBlendIndexMap.clear();
+            blendIndexToBoneIndexMap.clear();
+            return;
+        }
+
+        typedef std::set<unsigned short> BoneIndexSet;
+        BoneIndexSet usedBoneIndices;
+
+        // Collect actually used bones
+        VertexBoneAssignmentList::const_iterator itVBA, itendVBA;
+        itendVBA = boneAssignments.end();
+        for (itVBA = boneAssignments.begin(); itVBA != itendVBA; ++itVBA)
+        {
+            usedBoneIndices.insert(itVBA->second.boneIndex);
+        }
+
+        // Allocate space for index map
+        blendIndexToBoneIndexMap.resize(usedBoneIndices.size());
+        boneIndexToBlendIndexMap.resize(*usedBoneIndices.rbegin() + 1);
+
+        // Make index map between bone index and blend index
+        BoneIndexSet::const_iterator itBoneIndex, itendBoneIndex;
+        unsigned short blendIndex = 0;
+        itendBoneIndex = usedBoneIndices.end();
+        for (itBoneIndex = usedBoneIndices.begin(); itBoneIndex != itendBoneIndex; ++itBoneIndex, ++blendIndex)
+        {
+            boneIndexToBlendIndexMap[*itBoneIndex] = blendIndex;
+            blendIndexToBoneIndexMap[blendIndex] = *itBoneIndex;
+        }
+    }
+    //---------------------------------------------------------------------
+    void Mesh::compileBoneAssignments(
+        const VertexBoneAssignmentList& boneAssignments,
+        unsigned short numBlendWeightsPerVertex,
+        IndexMap& blendIndexToBoneIndexMap,
+        VertexData* targetVertexData)
+    {
+        // Create or reuse blend weight / indexes buffer
+        // Indices are always a UBYTE4 no matter how many weights per vertex
+        // Weights are more specific though since they are Reals
+        VertexDeclaration* decl = targetVertexData->vertexDeclaration;
+        VertexBufferBinding* bind = targetVertexData->vertexBufferBinding;
+        unsigned short bindIndex;
+
+        // Build the index map brute-force. It's possible to store the index map
+        // in .mesh, but maybe trivial.
+        IndexMap boneIndexToBlendIndexMap;
+        buildIndexMap(boneAssignments, boneIndexToBlendIndexMap, blendIndexToBoneIndexMap);
+
+        const VertexElement* testElem =
+            decl->findElementBySemantic(VES_BLEND_INDICES);
+        if (testElem)
+        {
+            // Already have a buffer, unset it & delete elements
+            bindIndex = testElem->getSource();
+            // unset will cause deletion of buffer
+            bind->unsetBinding(bindIndex);
+            decl->removeElement(VES_BLEND_INDICES);
+            decl->removeElement(VES_BLEND_WEIGHTS);
+        }
+        else
+        {
+            // Get new binding
+            bindIndex = bind->getNextIndex();
+        }
+
+        HardwareVertexBufferSharedPtr vbuf =
+            HardwareBufferManager::getSingleton().createVertexBuffer(
+                sizeof(unsigned char)*4 + sizeof(float)*numBlendWeightsPerVertex,
+                targetVertexData->vertexCount,
+                HardwareBuffer::HBU_STATIC_WRITE_ONLY,
+                true // use shadow buffer
+                );
+        // bind new buffer
+        bind->setBinding(bindIndex, vbuf);
+        const VertexElement *pIdxElem, *pWeightElem;
+
+        // add new vertex elements
+        // Note, insert directly after all elements using the same source as
+        // position to abide by pre-Dx9 format restrictions
+        const VertexElement* firstElem = decl->getElement(0);
+        if(firstElem->getSemantic() == VES_POSITION)
+        {
+            unsigned short insertPoint = 1;
+            while (insertPoint < decl->getElementCount() &&
+                decl->getElement(insertPoint)->getSource() == firstElem->getSource())
+            {
+                ++insertPoint;
+            }
+            const VertexElement& idxElem =
+                decl->insertElement(insertPoint, bindIndex, 0, VET_UBYTE4, VES_BLEND_INDICES);
+            const VertexElement& wtElem =
+                decl->insertElement(insertPoint+1, bindIndex, sizeof(unsigned char)*4,
+                VertexElement::multiplyTypeCount(VET_FLOAT1, numBlendWeightsPerVertex),
+                VES_BLEND_WEIGHTS);
+            pIdxElem = &idxElem;
+            pWeightElem = &wtElem;
+        }
+        else
+        {
+            // Position is not the first semantic, therefore this declaration is
+            // not pre-Dx9 compatible anyway, so just tack it on the end
+            const VertexElement& idxElem =
+                decl->addElement(bindIndex, 0, VET_UBYTE4, VES_BLEND_INDICES);
+            const VertexElement& wtElem =
+                decl->addElement(bindIndex, sizeof(unsigned char)*4,
+                VertexElement::multiplyTypeCount(VET_FLOAT1, numBlendWeightsPerVertex),
+                VES_BLEND_WEIGHTS);
+            pIdxElem = &idxElem;
+            pWeightElem = &wtElem;
+        }
+
+        // Assign data
+        size_t v;
+        VertexBoneAssignmentList::const_iterator i, iend;
+        i = boneAssignments.begin();
+		iend = boneAssignments.end();
+        unsigned char *pBase = static_cast<unsigned char*>(
+            vbuf->lock(HardwareBuffer::HBL_DISCARD));
+        // Iterate by vertex
+        float *pWeight;
+        unsigned char *pIndex;
+        for (v = 0; v < targetVertexData->vertexCount; ++v)
+        {
+            /// Convert to specific pointers
+            pWeightElem->baseVertexPointerToElement(pBase, &pWeight);
+            pIdxElem->baseVertexPointerToElement(pBase, &pIndex);
+            for (unsigned short bone = 0; bone < numBlendWeightsPerVertex; ++bone)
+            {
+                // Do we still have data for this vertex?
+                if (i != iend && i->second.vertexIndex == v)
+                {
+                    // If so, write weight
+                    *pWeight++ = i->second.weight;
+                    *pIndex++ = boneIndexToBlendIndexMap[i->second.boneIndex];
+                    ++i;
+                }
+                else
+                {
+                    // Ran out of assignments for this vertex, use weight 0 to indicate empty
+                    *pWeight++ = 0.0f;
+                    *pIndex++ = 0;
+                }
+            }
+            pBase += vbuf->getVertexSize();
+        }
+
+        vbuf->unlock();
+
+    }
+    //---------------------------------------------------------------------
+    void Mesh::_notifySkeleton(SkeletonPtr& pSkel)
+    {
+        mSkeleton = pSkel;
+        mSkeletonName = pSkel->getName();
+    }
+    //---------------------------------------------------------------------
+    Mesh::BoneAssignmentIterator Mesh::getBoneAssignmentIterator(void)
+    {
+        return BoneAssignmentIterator(mBoneAssignments.begin(),
+            mBoneAssignments.end());
+    }
+    //---------------------------------------------------------------------
+    const String& Mesh::getSkeletonName(void) const
+    {
+        return mSkeletonName;
+    }
+    //---------------------------------------------------------------------
+    void Mesh::generateLodLevels(const LodDistanceList& lodDistances,
+        ProgressiveMesh::VertexReductionQuota reductionMethod, Real reductionValue)
+    {
+#if OGRE_DEBUG_MODE
+        Real prev = 0;
+        for (LodDistanceList::const_iterator it = lodDistances.begin();
+            it != lodDistances.end(); ++it)
+        {
+            Real cur = (*it) * (*it);
+            assert(cur >= prev && "The lod distances must be sort ascending");
+            prev = cur;
+        }
+#endif
+
+        removeLodLevels();
+
+		StringUtil::StrStreamType str;
+		str << "Generating " << lodDistances.size()
+			<< " lower LODs for mesh " << mName;
+        LogManager::getSingleton().logMessage(str.str());
+
+        SubMeshList::iterator isub, isubend;
+        isubend = mSubMeshList.end();
+        for (isub = mSubMeshList.begin(); isub != isubend; ++isub)
+        {
+            // Set up data for reduction
+            VertexData* pVertexData = (*isub)->useSharedVertices ? sharedVertexData : (*isub)->vertexData;
+
+            ProgressiveMesh pm(pVertexData, (*isub)->indexData);
+            pm.build(
+            static_cast<ushort>(lodDistances.size()),
+                &((*isub)->mLodFaceList),
+                reductionMethod, reductionValue);
+
+        }
+
+        // Iterate over the lods and record usage
+        LodDistanceList::const_iterator idist, idistend;
+        idistend = lodDistances.end();
+        mMeshLodUsageList.resize(lodDistances.size() + 1);
+        MeshLodUsageList::iterator ilod = mMeshLodUsageList.begin();
+        for (idist = lodDistances.begin(); idist != idistend; ++idist)
+        {
+            // Record usage
+            MeshLodUsage& lod = *++ilod;
+            lod.fromDepthSquared = (*idist) * (*idist);
+            lod.edgeData = 0;
+            lod.manualMesh.setNull();
+        }
+        mNumLods = static_cast<ushort>(lodDistances.size() + 1);
+    }
+    //---------------------------------------------------------------------
+    ushort Mesh::getNumLodLevels(void) const
+    {
+        return mNumLods;
+    }
+    //---------------------------------------------------------------------
+    const MeshLodUsage& Mesh::getLodLevel(ushort index) const
+    {
+        assert(index < mMeshLodUsageList.size());
+        if (mIsLodManual && index > 0 && mMeshLodUsageList[index].manualMesh.isNull())
+        {
+            // Load the mesh now
+			try {
+				mMeshLodUsageList[index].manualMesh =
+					MeshManager::getSingleton().load(
+						mMeshLodUsageList[index].manualName,
+						mGroup);
+				// get the edge data, if required
+				if (!mMeshLodUsageList[index].edgeData)
+				{
+					mMeshLodUsageList[index].edgeData =
+						mMeshLodUsageList[index].manualMesh->getEdgeList(0);
+				}
+			}
+			catch (Exception& )
+			{
+				StringUtil::StrStreamType str;
+				str << "Error while loading manual LOD level "
+					<< mMeshLodUsageList[index].manualName
+					<< " - this LOD level will not be rendered. You can "
+					<< "ignore this error in offline mesh tools.";
+				LogManager::getSingleton().logMessage(str.str());
+			}
+
+        }
+        return mMeshLodUsageList[index];
+    }
+    //---------------------------------------------------------------------
+	struct ManualLodSortLess :
+	public std::binary_function<const MeshLodUsage&, const MeshLodUsage&, bool>
+	{
+		bool operator() (const MeshLodUsage& mesh1, const MeshLodUsage& mesh2)
+		{
+			// sort ascending by depth
+			return mesh1.fromDepthSquared < mesh2.fromDepthSquared;
+		}
+	};
+	void Mesh::createManualLodLevel(Real fromDepth, const String& meshName)
+	{
+
+		// Basic prerequisites
+        assert(fromDepth > 0 && "The LOD depth must be greater than zero");
+        assert((mIsLodManual || mNumLods == 1) && "Generated LODs already in use!");
+
+		mIsLodManual = true;
+		MeshLodUsage lod;
+		lod.fromDepthSquared = fromDepth * fromDepth;
+		lod.manualName = meshName;
+		lod.manualMesh.setNull();
+        lod.edgeData = 0;
+		mMeshLodUsageList.push_back(lod);
+		++mNumLods;
+
+		std::sort(mMeshLodUsageList.begin(), mMeshLodUsageList.end(), ManualLodSortLess());
+	}
+    //---------------------------------------------------------------------
+	void Mesh::updateManualLodLevel(ushort index, const String& meshName)
+	{
+
+		// Basic prerequisites
+		assert(mIsLodManual && "Not using manual LODs!");
+		assert(index != 0 && "Can't modify first lod level (full detail)");
+		assert(index < mMeshLodUsageList.size() && "Index out of bounds");
+		// get lod
+		MeshLodUsage* lod = &(mMeshLodUsageList[index]);
+
+		lod->manualName = meshName;
+		lod->manualMesh.setNull();
+        if (lod->edgeData) delete lod->edgeData;
+        lod->edgeData = 0;
+	}
+    //---------------------------------------------------------------------
+	ushort Mesh::getLodIndex(Real depth) const
+	{
+		return getLodIndexSquaredDepth(depth * depth);
+	}
+    //---------------------------------------------------------------------
+	ushort Mesh::getLodIndexSquaredDepth(Real squaredDepth) const
+	{
+		MeshLodUsageList::const_iterator i, iend;
+		iend = mMeshLodUsageList.end();
+		ushort index = 0;
+		for (i = mMeshLodUsageList.begin(); i != iend; ++i, ++index)
+		{
+			if (i->fromDepthSquared > squaredDepth)
+			{
+				return index - 1;
+			}
+		}
+
+		// If we fall all the way through, use the highest value
+		return static_cast<ushort>(mMeshLodUsageList.size() - 1);
+
+
+	}
+    //---------------------------------------------------------------------
+	void Mesh::_setLodInfo(unsigned short numLevels, bool isManual)
+	{
+        assert(!mEdgeListsBuilt && "Can't modify LOD after edge lists built");
+
+		// Basic prerequisites
+        assert(numLevels > 0 && "Must be at least one level (full detail level must exist)");
+
+		mNumLods = numLevels;
+		mMeshLodUsageList.resize(numLevels);
+		// Resize submesh face data lists too
+		for (SubMeshList::iterator i = mSubMeshList.begin(); i != mSubMeshList.end(); ++i)
+		{
+			(*i)->mLodFaceList.resize(numLevels - 1);
+		}
+		mIsLodManual = isManual;
+	}
+    //---------------------------------------------------------------------
+	void Mesh::_setLodUsage(unsigned short level, MeshLodUsage& usage)
+	{
+        assert(!mEdgeListsBuilt && "Can't modify LOD after edge lists built");
+
+		// Basic prerequisites
+		assert(level != 0 && "Can't modify first lod level (full detail)");
+		assert(level < mMeshLodUsageList.size() && "Index out of bounds");
+
+		mMeshLodUsageList[level] = usage;
+	}
+    //---------------------------------------------------------------------
+	void Mesh::_setSubMeshLodFaceList(unsigned short subIdx, unsigned short level,
+		IndexData* facedata)
+	{
+        assert(!mEdgeListsBuilt && "Can't modify LOD after edge lists built");
+
+		// Basic prerequisites
+		assert(!mIsLodManual && "Not using generated LODs!");
+        assert(subIdx <= mSubMeshList.size() && "Index out of bounds");
+		assert(level != 0 && "Can't modify first lod level (full detail)");
+		assert(level <= mSubMeshList[subIdx]->mLodFaceList.size() && "Index out of bounds");
+
+		SubMesh* sm = mSubMeshList[subIdx];
+		sm->mLodFaceList[level - 1] = facedata;
+
+	}
+    //---------------------------------------------------------------------
+	ushort Mesh::_getSubMeshIndex(const String& name) const
+	{
+		SubMeshNameMap::const_iterator i = mSubMeshNameMap.find(name) ;
+		if (i == mSubMeshNameMap.end())
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "No SubMesh named " + name + " found.",
+                "Mesh::_getSubMeshIndex");
+
+		return i->second;
+	}
+    //---------------------------------------------------------------------
+    void Mesh::removeLodLevels(void)
+    {
+        if (!mIsLodManual)
+        {
+            // Remove data from SubMeshes
+            SubMeshList::iterator isub, isubend;
+            isubend = mSubMeshList.end();
+            for (isub = mSubMeshList.begin(); isub != isubend; ++isub)
+            {
+                (*isub)->removeLodLevels();
+            }
+        }
+
+        freeEdgeList();
+        mMeshLodUsageList.clear();
+
+        // Reinitialise
+        mNumLods = 1;
+		// Init first (manual) lod
+		MeshLodUsage lod;
+		lod.fromDepthSquared = 0.0f;
+        lod.edgeData = 0;
+        lod.manualMesh.setNull();
+		mMeshLodUsageList.push_back(lod);
+		mIsLodManual = false;
+
+
+    }
+    //---------------------------------------------------------------------
+    Real Mesh::getBoundingSphereRadius(void) const
+    {
+        return mBoundRadius;
+    }
+    //---------------------------------------------------------------------
+	void Mesh::setVertexBufferPolicy(HardwareBuffer::Usage vbUsage, bool shadowBuffer)
+	{
+		mVertexBufferUsage = vbUsage;
+		mVertexBufferShadowBuffer = shadowBuffer;
+	}
+    //---------------------------------------------------------------------
+	void Mesh::setIndexBufferPolicy(HardwareBuffer::Usage vbUsage, bool shadowBuffer)
+	{
+		mIndexBufferUsage = vbUsage;
+		mIndexBufferShadowBuffer = shadowBuffer;
+	}
+    //---------------------------------------------------------------------
+    void Mesh::organiseTangentsBuffer(VertexData *vertexData,
+        VertexElementSemantic targetSemantic, unsigned short index, 
+		unsigned short sourceTexCoordSet)
+    {
+	    VertexDeclaration *vDecl = vertexData->vertexDeclaration ;
+	    VertexBufferBinding *vBind = vertexData->vertexBufferBinding ;
+
+	    const VertexElement *tangentsElem = vDecl->findElementBySemantic(targetSemantic, index);
+	    bool needsToBeCreated = false;
+
+	    if (!tangentsElem)
+        { // no tex coords with index 1
+			    needsToBeCreated = true ;
+	    }
+        else if (tangentsElem->getType() != VET_FLOAT3)
+        {
+            //  buffer exists, but not 3D
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "Target semantic set already exists but is not 3D, therefore "
+				"cannot contain tangents. Pick an alternative destination semantic. ",
+                "Mesh::organiseTangentsBuffer");
+	    }
+
+	    HardwareVertexBufferSharedPtr newBuffer;
+	    if (needsToBeCreated)
+        {
+            // To be most efficient with our vertex streams,
+            // tack the new tangents onto the same buffer as the
+            // source texture coord set
+            const VertexElement* prevTexCoordElem =
+                vertexData->vertexDeclaration->findElementBySemantic(
+                    VES_TEXTURE_COORDINATES, sourceTexCoordSet);
+            if (!prevTexCoordElem)
+            {
+                OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+                    "Cannot locate the first texture coordinate element to "
+					"which to append the new tangents.", 
+					"Mesh::orgagniseTangentsBuffer");
+            }
+            // Find the buffer associated with  this element
+            HardwareVertexBufferSharedPtr origBuffer =
+                vertexData->vertexBufferBinding->getBuffer(
+                    prevTexCoordElem->getSource());
+            // Now create a new buffer, which includes the previous contents
+            // plus extra space for the 3D coords
+		    newBuffer = HardwareBufferManager::getSingleton().createVertexBuffer(
+                origBuffer->getVertexSize() + 3*sizeof(float),
+                vertexData->vertexCount,
+			    origBuffer->getUsage(),
+			    origBuffer->hasShadowBuffer() );
+            // Add the new element
+		    vDecl->addElement(
+                prevTexCoordElem->getSource(),
+                origBuffer->getVertexSize(),
+                VET_FLOAT3,
+                targetSemantic,
+                index);
+            // Now copy the original data across
+            unsigned char* pSrc = static_cast<unsigned char*>(
+                origBuffer->lock(HardwareBuffer::HBL_READ_ONLY));
+            unsigned char* pDest = static_cast<unsigned char*>(
+                newBuffer->lock(HardwareBuffer::HBL_DISCARD));
+            size_t vertSize = origBuffer->getVertexSize();
+            for (size_t v = 0; v < vertexData->vertexCount; ++v)
+            {
+                // Copy original vertex data
+                memcpy(pDest, pSrc, vertSize);
+                pSrc += vertSize;
+                pDest += vertSize;
+                // Set the new part to 0 since we'll accumulate in this
+                memset(pDest, 0, sizeof(float)*3);
+                pDest += sizeof(float)*3;
+            }
+            origBuffer->unlock();
+            newBuffer->unlock();
+
+            // Rebind the new buffer
+            vBind->setBinding(prevTexCoordElem->getSource(), newBuffer);
+	    }
+    }
+    //---------------------------------------------------------------------
+    void Mesh::buildTangentVectors(VertexElementSemantic targetSemantic, 
+		unsigned short sourceTexCoordSet, unsigned short index)
+    {
+		if (index == 0 && targetSemantic == VES_TEXTURE_COORDINATES)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Destination texture coordinate set must be greater than 0",
+				"Mesh::buildTangentVectors");
+		}
+
+	    // our temp. buffers
+	    uint32			vertInd[3];
+	    Vector3         vertPos[3];
+        Real            u[3], v[3];
+	    // setup a new 3D texture coord-set buffer for every sub mesh
+	    int nSubMesh = getNumSubMeshes();
+	    for (int sm = 0; sm < nSubMesh; sm++)
+	    {
+		    // retrieve buffer pointers
+		    uint16	*pVIndices16 = NULL;    // the face indices buffer, read only
+		    uint32	*pVIndices32 = NULL;    // the face indices buffer, read only
+		    float	*p2DTC;	                // pointer to 2D tex.coords, read only
+		    float	*p3DTC;	                // pointer to 3D tex.coords, write/read (discard)
+		    float	*pVPos;	                // vertex position buffer, read only
+			float	*pVNorm;	            // vertex normal buffer, read only
+
+		    SubMesh *pSubMesh = getSubMesh(sm);
+
+		    // retrieve buffer pointers
+		    // first, indices
+		    IndexData *indexData = pSubMesh->indexData;
+		    HardwareIndexBufferSharedPtr buffIndex = indexData->indexBuffer;
+			bool use32bit = false;
+			if (buffIndex->getType() == HardwareIndexBuffer::IT_32BIT)
+			{
+		    	pVIndices32 = static_cast<uint32*>(
+					buffIndex->lock(HardwareBuffer::HBL_READ_ONLY));
+				use32bit = true;
+			}
+			else
+			{
+		    	pVIndices16 = static_cast<uint16*>(
+					buffIndex->lock(HardwareBuffer::HBL_READ_ONLY));
+			}
+		    // then, vertices
+		    VertexData *usedVertexData ;
+		    if (pSubMesh->useSharedVertices) {
+			    usedVertexData = sharedVertexData;
+		    } else {
+			    usedVertexData = pSubMesh->vertexData;
+		    }
+		    VertexDeclaration *vDecl = usedVertexData->vertexDeclaration;
+		    VertexBufferBinding *vBind = usedVertexData->vertexBufferBinding;
+
+
+		    // make sure we have a 3D coord to place data in
+			organiseTangentsBuffer(usedVertexData, targetSemantic, index, sourceTexCoordSet);
+
+            // Get the target element
+            const VertexElement* destElem = vDecl->findElementBySemantic(
+				targetSemantic, index);
+            // Get the source element
+            const VertexElement* srcElem = vDecl->findElementBySemantic(
+				VES_TEXTURE_COORDINATES, sourceTexCoordSet);
+
+            if (!srcElem || srcElem->getType() != VET_FLOAT2)
+            {
+                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                    "SubMesh " + StringConverter::toString(sm) + " of Mesh " + mName +
+                    " has no 2D texture coordinates at the selected set, therefore we cannot calculate tangents.",
+                    "Mesh::buildTangentVectors");
+            }
+            HardwareVertexBufferSharedPtr srcBuf, destBuf, posBuf, normBuf;
+            unsigned char *pSrcBase, *pDestBase, *pPosBase, *pNormBase;
+            size_t srcInc, destInc, posInc, normInc;
+
+            srcBuf = vBind->getBuffer(srcElem->getSource());
+            // Is the source and destination buffer the same?
+            if (srcElem->getSource() == destElem->getSource())
+            {
+                // lock source for read and write
+                pSrcBase = static_cast<unsigned char*>(
+                    srcBuf->lock(HardwareBuffer::HBL_NORMAL));
+                srcInc = srcBuf->getVertexSize();
+                pDestBase = pSrcBase;
+                destInc = srcInc;
+            }
+            else
+            {
+                pSrcBase = static_cast<unsigned char*>(
+                    srcBuf->lock(HardwareBuffer::HBL_READ_ONLY));
+                srcInc = srcBuf->getVertexSize();
+                destBuf = vBind->getBuffer(destElem->getSource());
+                destInc = destBuf->getVertexSize();
+                pDestBase = static_cast<unsigned char*>(
+                    destBuf->lock(HardwareBuffer::HBL_NORMAL));
+            }
+
+		    // find a vertex coord buffer
+		    const VertexElement *elemVPos = vDecl->findElementBySemantic(VES_POSITION);
+            if (elemVPos->getSource() == srcElem->getSource())
+            {
+                pPosBase = pSrcBase;
+                posInc = srcInc;
+            }
+            else if (elemVPos->getSource() == destElem->getSource())
+            {
+                pPosBase = pDestBase;
+                posInc = destInc;
+            }
+            else
+            {
+                // A different buffer
+                posBuf = vBind->getBuffer(elemVPos->getSource());
+                pPosBase = static_cast<unsigned char*>(
+                    posBuf->lock(HardwareBuffer::HBL_READ_ONLY));
+                posInc = posBuf->getVertexSize();
+            }
+			// find a normal buffer
+			const VertexElement *elemVNorm = vDecl->findElementBySemantic(VES_NORMAL);
+			if (!elemVNorm)
+				OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+					"No VES_NORMAL vertex element found", 
+					"Mesh::buildTangentVectors");
+
+			if (elemVNorm->getSource() == srcElem->getSource())
+			{
+				pNormBase = pSrcBase;
+				normInc = srcInc;
+			}
+			else if (elemVNorm->getSource() == destElem->getSource())
+			{
+				pNormBase = pDestBase;
+				normInc = destInc;
+			}
+			else if (elemVNorm->getSource() == elemVPos->getSource())
+			{
+			    // normals are in the same buffer as position
+			    // this condition arises when an animated(skeleton) mesh is not built with 
+			    // an edge list buffer ie no shadows being used.
+			    pNormBase = pPosBase;
+			    normInc = posInc;
+			}
+			else
+			{
+				// A different buffer
+				normBuf = vBind->getBuffer(elemVNorm->getSource());
+				pNormBase = static_cast<unsigned char*>(
+					normBuf->lock(HardwareBuffer::HBL_READ_ONLY));
+				normInc = normBuf->getVertexSize();
+			}
+
+		    size_t numFaces = indexData->indexCount / 3 ;
+
+		    // loop through all faces to calculate the tangents and normals
+		    size_t n;
+		    for (n = 0; n < numFaces; ++n)
+		    {
+			    int i;
+			    for (i = 0; i < 3; ++i)
+			    {
+				    // get indexes of vertices that form a polygon in the position buffer
+				    if (use32bit)
+					{
+						vertInd[i] = *pVIndices32++;
+					}
+					else
+					{
+						vertInd[i] = *pVIndices16++;
+					}
+				    // get the vertices positions from the position buffer
+                    unsigned char* vBase = pPosBase + (posInc * vertInd[i]);
+                    elemVPos->baseVertexPointerToElement(vBase, &pVPos);
+				    vertPos[i].x = pVPos[0];
+				    vertPos[i].y = pVPos[1];
+				    vertPos[i].z = pVPos[2];
+				    // get the vertices tex.coords from the 2D tex.coords buffer
+                    vBase = pSrcBase + (srcInc * vertInd[i]);
+                    srcElem->baseVertexPointerToElement(vBase, &p2DTC);
+				    u[i] = p2DTC[0];
+				    v[i] = p2DTC[1];
+			    }
+			    // calculate the TSB
+                Vector3 tangent = Math::calculateTangentSpaceVector(
+                    vertPos[0], vertPos[1], vertPos[2],
+                    u[0], v[0], u[1], v[1], u[2], v[2]);
+			    // write new tex.coords
+                // note we only write the tangent, not the binormal since we can calculate
+                // the binormal in the vertex program
+			    for (i = 0; i < 3; ++i)
+			    {
+				    // write values (they must be 0 and we must add them so we can average
+                    // all the contributions from all the faces
+                    unsigned char* vBase = pDestBase + (destInc * vertInd[i]);
+                    destElem->baseVertexPointerToElement(vBase, &p3DTC);
+				    p3DTC[0] += tangent.x;
+				    p3DTC[1] += tangent.y;
+				    p3DTC[2] += tangent.z;
+			    }
+		    }
+		    // now loop through all vertices and normalize them
+		    size_t numVerts = usedVertexData->vertexCount ;
+		    for (n = 0; n < numVerts; ++n)
+		    {
+                destElem->baseVertexPointerToElement(pDestBase, &p3DTC);
+			    // read the vertex
+			    Vector3 temp(p3DTC[0], p3DTC[1], p3DTC[2]);
+				// Orthogonalise with the vertex normal since it's currently
+				// orthogonal with the face normals, but will be close to ortho
+				// with vertex normal
+				// Get normal				
+				unsigned char* vBase = pNormBase + (normInc * n);
+				elemVNorm->baseVertexPointerToElement(vBase, &pVNorm);
+				Vector3 normal(pVNorm[0], pVNorm[1], pVNorm[2]);
+				// Apply Gram-Schmidt orthogonalise
+				temp = temp - (normal * normal.dotProduct(temp));
+				
+				// normalize the vertex
+			    temp.normalise();
+
+			    // write it back
+			    p3DTC[0] = temp.x;
+			    p3DTC[1] = temp.y;
+			    p3DTC[2] = temp.z;
+
+                pDestBase += destInc;
+		    }
+		    // unlock buffers
+            srcBuf->unlock();
+            if (!destBuf.isNull())
+            {
+                destBuf->unlock();
+            }
+            if (!posBuf.isNull())
+            {
+                posBuf->unlock();
+            }
+			if (!normBuf.isNull())
+			{
+				normBuf->unlock();
+			}
+		    buffIndex->unlock();
+	    }
+
+    }
+
+    //---------------------------------------------------------------------
+    bool Mesh::suggestTangentVectorBuildParams(VertexElementSemantic targetSemantic,
+		unsigned short& outSourceCoordSet, unsigned short& outIndex)
+    {
+        // Go through all the vertex data and locate source and dest (must agree)
+        bool sharedGeometryDone = false;
+        bool foundExisting = false;
+		VertexElementSemantic foundSemantic = VES_TEXTURE_COORDINATES;
+        bool firstOne = true;
+        SubMeshList::iterator i, iend;
+        iend = mSubMeshList.end();
+        for (i = mSubMeshList.begin(); i != iend; ++i)
+        {
+            SubMesh* sm = *i;
+            VertexData* vertexData;
+
+            if (sm->useSharedVertices)
+            {
+                if (sharedGeometryDone)
+                    continue;
+                vertexData = sharedVertexData;
+                sharedGeometryDone = true;
+            }
+            else
+            {
+                vertexData = sm->vertexData;
+            }
+
+            const VertexElement *sourceElem = 0;
+            unsigned short targetIndex = 0;
+            for (targetIndex = 0; targetIndex < OGRE_MAX_TEXTURE_COORD_SETS; ++targetIndex)
+            {
+                const VertexElement* testElem =
+                    vertexData->vertexDeclaration->findElementBySemantic(
+                        VES_TEXTURE_COORDINATES, targetIndex);
+                if (!testElem)
+                    break; // finish if we've run out, t will be the target
+
+                if (!sourceElem)
+                {
+                    // We're still looking for the source texture coords
+                    if (testElem->getType() == VET_FLOAT2)
+                    {
+                        // Ok, we found it
+                        sourceElem = testElem;
+                    }
+                }
+                else
+                {
+                    // We're looking for the destination
+                    // Check to see if we've found a possible
+                    if (testElem->getType() == VET_FLOAT3)
+                    {
+                        // This is a 3D set, might be tangents
+                        foundExisting = true;
+						foundSemantic = VES_TEXTURE_COORDINATES;
+                    }
+
+                }
+
+            }
+
+			if (!foundExisting && targetSemantic != VES_TEXTURE_COORDINATES)
+			{
+				targetIndex = 0;
+				// Look for existing semantic
+				const VertexElement* testElem =
+					vertexData->vertexDeclaration->findElementBySemantic(
+					targetSemantic, targetIndex);
+				if (testElem)
+				{
+					foundExisting = true;
+					foundSemantic = targetSemantic;
+				}
+
+			}
+
+            // After iterating, we should have a source and a possible destination (t)
+            if (!sourceElem)
+            {
+                OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+                    "Cannot locate an appropriate 2D texture coordinate set for "
+                    "all the vertex data in this mesh to create tangents from. ",
+                    "Mesh::suggestTangentVectorBuildParams");
+            }
+            // Check that we agree with previous decisions, if this is not the
+            // first one
+            if (!firstOne)
+            {
+                if (sourceElem->getIndex() != outSourceCoordSet)
+                {
+                    OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                        "Multiple sets of vertex data in this mesh disagree on "
+                        "the appropriate index to use for the source texture coordinates. "
+                        "This ambiguity must be rectified before tangents can be generated.",
+                        "Mesh::suggestTangentVectorBuildParams");
+                }
+                if (targetIndex != outIndex)
+                {
+                    OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                        "Multiple sets of vertex data in this mesh disagree on "
+                        "the appropriate index to use for the target texture coordinates. "
+                        "This ambiguity must be rectified before tangents can be generated.",
+                        "Mesh::suggestTangentVectorBuildParams");
+                }
+            }
+
+            // Otherwise, save this result
+            outSourceCoordSet = sourceElem->getIndex();
+            outIndex = targetIndex;
+
+            firstOne = false;
+
+       }
+
+        return foundExisting;
+
+    }
+    //---------------------------------------------------------------------
+    void Mesh::buildEdgeList(void)
+    {
+        if (mEdgeListsBuilt)
+            return;
+
+        // Loop over LODs
+        for (unsigned int lodIndex = 0; lodIndex < mMeshLodUsageList.size(); ++lodIndex)
+        {
+            // use getLodLevel to enforce loading of manual mesh lods
+            MeshLodUsage& usage = const_cast<MeshLodUsage&>(getLodLevel(lodIndex));
+
+			bool atLeastOneIndexSet = false;
+
+            if (mIsLodManual && lodIndex != 0)
+            {
+                // Delegate edge building to manual mesh
+                // It should have already built it's own edge list while loading
+				if (!usage.manualMesh.isNull())
+				{
+					usage.edgeData = usage.manualMesh->getEdgeList(0);
+				}
+            }
+            else
+            {
+                // Build
+                EdgeListBuilder eb;
+                size_t vertexSetCount = 0;
+
+                if (sharedVertexData)
+                {
+                    eb.addVertexData(sharedVertexData);
+                    vertexSetCount++;
+                }
+
+                // Prepare the builder using the submesh information
+                SubMeshList::iterator i, iend;
+                iend = mSubMeshList.end();
+                for (i = mSubMeshList.begin(); i != iend; ++i)
+                {
+                    SubMesh* s = *i;
+					if (s->operationType != RenderOperation::OT_TRIANGLE_FAN && 
+						s->operationType != RenderOperation::OT_TRIANGLE_LIST && 
+						s->operationType != RenderOperation::OT_TRIANGLE_STRIP)
+					{
+						// Skip this submesh
+						continue;
+					}
+                    if (s->useSharedVertices)
+                    {
+                        // Use shared vertex data, index as set 0
+                        if (lodIndex == 0)
+                        {
+                            eb.addIndexData(s->indexData, 0, s->operationType);
+                        }
+                        else
+                        {
+                            eb.addIndexData(s->mLodFaceList[lodIndex-1], 0,
+                                s->operationType);
+                        }
+                    }
+                    else
+                    {
+                        // own vertex data, add it and reference it directly
+                        eb.addVertexData(s->vertexData);
+                        if (lodIndex == 0)
+                        {
+                            // Base index data
+                            eb.addIndexData(s->indexData, vertexSetCount++,
+                                s->operationType);
+                        }
+                        else
+                        {
+                            // LOD index data
+                            eb.addIndexData(s->mLodFaceList[lodIndex-1],
+                                vertexSetCount++, s->operationType);
+                        }
+
+                    }
+					atLeastOneIndexSet = true;
+                }
+
+                if (atLeastOneIndexSet)
+				{
+					usage.edgeData = eb.build();
+
+                #if OGRE_DEBUG_MODE
+                    // Override default log
+                    Log* log = LogManager::getSingleton().createLog(
+                        mName + "_lod" + StringConverter::toString(lodIndex) +
+                        "_prepshadow.log", false, false);
+                    usage.edgeData->log(log);
+					// clean up log & close file handle
+					LogManager::getSingleton().destroyLog(log);
+                #endif
+				}
+
+            }
+        }
+        mEdgeListsBuilt = true;
+    }
+    //---------------------------------------------------------------------
+    void Mesh::freeEdgeList(void)
+    {
+        if (!mEdgeListsBuilt)
+            return;
+
+        // Loop over LODs
+        MeshLodUsageList::iterator i, iend;
+        iend = mMeshLodUsageList.end();
+        unsigned short index = 0;
+        for (i = mMeshLodUsageList.begin(); i != iend; ++i, ++index)
+        {
+            MeshLodUsage& usage = *i;
+
+            if (!mIsLodManual || index == 0)
+            {
+                // Only delete if we own this data
+                // Manual LODs > 0 own their own
+                delete usage.edgeData;
+            }
+            usage.edgeData = NULL;
+        }
+
+        mEdgeListsBuilt = false;
+    }
+    //---------------------------------------------------------------------
+    void Mesh::prepareForShadowVolume(void)
+    {
+        if (mPreparedForShadowVolumes)
+            return;
+
+        if (sharedVertexData)
+        {
+            sharedVertexData->prepareForShadowVolume();
+        }
+        SubMeshList::iterator i, iend;
+        iend = mSubMeshList.end();
+        for (i = mSubMeshList.begin(); i != iend; ++i)
+        {
+            SubMesh* s = *i;
+            if (!s->useSharedVertices && 
+				(s->operationType == RenderOperation::OT_TRIANGLE_FAN || 
+				s->operationType == RenderOperation::OT_TRIANGLE_LIST ||
+				s->operationType == RenderOperation::OT_TRIANGLE_STRIP))
+            {
+                s->vertexData->prepareForShadowVolume();
+            }
+        }
+        mPreparedForShadowVolumes = true;
+    }
+    //---------------------------------------------------------------------
+    EdgeData* Mesh::getEdgeList(unsigned int lodIndex)
+    {
+        // Build edge list on demand
+        if (!mEdgeListsBuilt && mAutoBuildEdgeLists)
+        {
+            buildEdgeList();
+        }
+
+        return getLodLevel(lodIndex).edgeData;
+    }
+    //---------------------------------------------------------------------
+    const EdgeData* Mesh::getEdgeList(unsigned int lodIndex) const
+    {
+        return getLodLevel(lodIndex).edgeData;
+    }
+    //---------------------------------------------------------------------
+    void Mesh::prepareMatricesForVertexBlend(const Matrix4** blendMatrices,
+        const Matrix4* boneMatrices, const IndexMap& indexMap)
+    {
+        assert(indexMap.size() <= 256);
+        IndexMap::const_iterator it, itend;
+        itend = indexMap.end();
+        for (it = indexMap.begin(); it != itend; ++it)
+        {
+            *blendMatrices++ = boneMatrices + *it;
+        }
+    }
+    //---------------------------------------------------------------------
+    void Mesh::softwareVertexBlend(const VertexData* sourceVertexData,
+        const VertexData* targetVertexData,
+        const Matrix4* const* blendMatrices, size_t numMatrices,
+        bool blendNormals)
+    {
+        float *pSrcPos = 0;
+        float *pSrcNorm = 0;
+        float *pDestPos = 0;
+        float *pDestNorm = 0;
+        float *pBlendWeight = 0;
+        unsigned char* pBlendIdx = 0;
+        size_t srcPosStride = 0;
+        size_t srcNormStride = 0;
+        size_t destPosStride = 0;
+        size_t destNormStride = 0;
+        size_t blendWeightStride = 0;
+        size_t blendIdxStride = 0;
+
+
+        // Get elements for source
+        const VertexElement* srcElemPos =
+            sourceVertexData->vertexDeclaration->findElementBySemantic(VES_POSITION);
+        const VertexElement* srcElemNorm =
+            sourceVertexData->vertexDeclaration->findElementBySemantic(VES_NORMAL);
+        const VertexElement* srcElemBlendIndices =
+            sourceVertexData->vertexDeclaration->findElementBySemantic(VES_BLEND_INDICES);
+        const VertexElement* srcElemBlendWeights =
+            sourceVertexData->vertexDeclaration->findElementBySemantic(VES_BLEND_WEIGHTS);
+        assert (srcElemPos && srcElemBlendIndices && srcElemBlendWeights &&
+            "You must supply at least positions, blend indices and blend weights");
+        // Get elements for target
+        const VertexElement* destElemPos =
+            targetVertexData->vertexDeclaration->findElementBySemantic(VES_POSITION);
+        const VertexElement* destElemNorm =
+            targetVertexData->vertexDeclaration->findElementBySemantic(VES_NORMAL);
+
+        // Do we have normals and want to blend them?
+        bool includeNormals = blendNormals && (srcElemNorm != NULL) && (destElemNorm != NULL);
+
+
+        // Get buffers for source
+        HardwareVertexBufferSharedPtr srcPosBuf, srcNormBuf, srcIdxBuf, srcWeightBuf;
+        srcPosBuf = sourceVertexData->vertexBufferBinding->getBuffer(srcElemPos->getSource());
+        srcPosStride = srcPosBuf->getVertexSize();
+        srcIdxBuf = sourceVertexData->vertexBufferBinding->getBuffer(srcElemBlendIndices->getSource());
+        blendIdxStride = srcIdxBuf->getVertexSize();
+        srcWeightBuf = sourceVertexData->vertexBufferBinding->getBuffer(srcElemBlendWeights->getSource());
+        blendWeightStride = srcWeightBuf->getVertexSize();
+        if (includeNormals)
+        {
+            srcNormBuf = sourceVertexData->vertexBufferBinding->getBuffer(srcElemNorm->getSource());
+            srcNormStride = srcNormBuf->getVertexSize();
+        }
+        // Get buffers for target
+        HardwareVertexBufferSharedPtr destPosBuf, destNormBuf;
+        destPosBuf = targetVertexData->vertexBufferBinding->getBuffer(destElemPos->getSource());
+        destPosStride = destPosBuf->getVertexSize();
+        if (includeNormals)
+        {
+            destNormBuf = targetVertexData->vertexBufferBinding->getBuffer(destElemNorm->getSource());
+            destNormStride = destNormBuf->getVertexSize();
+        }
+
+        void* pBuffer;
+
+        // Lock source buffers for reading
+        pBuffer = srcPosBuf->lock(HardwareBuffer::HBL_READ_ONLY);
+        srcElemPos->baseVertexPointerToElement(pBuffer, &pSrcPos);
+        if (includeNormals)
+        {
+            if (srcNormBuf != srcPosBuf)
+            {
+                // Different buffer
+                pBuffer = srcNormBuf->lock(HardwareBuffer::HBL_READ_ONLY);
+            }
+            srcElemNorm->baseVertexPointerToElement(pBuffer, &pSrcNorm);
+        }
+
+        // Indices must be 4 bytes
+        assert(srcElemBlendIndices->getType() == VET_UBYTE4 &&
+               "Blend indices must be VET_UBYTE4");
+        pBuffer = srcIdxBuf->lock(HardwareBuffer::HBL_READ_ONLY);
+        srcElemBlendIndices->baseVertexPointerToElement(pBuffer, &pBlendIdx);
+        if (srcWeightBuf != srcIdxBuf)
+        {
+            // Lock buffer
+            pBuffer = srcWeightBuf->lock(HardwareBuffer::HBL_READ_ONLY);
+        }
+        srcElemBlendWeights->baseVertexPointerToElement(pBuffer, &pBlendWeight);
+        unsigned short numWeightsPerVertex =
+            VertexElement::getTypeCount(srcElemBlendWeights->getType());
+
+
+        // Lock destination buffers for writing
+        pBuffer = destPosBuf->lock(
+            (destNormBuf != destPosBuf && destPosBuf->getVertexSize() == destElemPos->getSize()) ||
+            (destNormBuf == destPosBuf && destPosBuf->getVertexSize() == destElemPos->getSize() + destElemNorm->getSize()) ?
+            HardwareBuffer::HBL_DISCARD : HardwareBuffer::HBL_NORMAL);
+        destElemPos->baseVertexPointerToElement(pBuffer, &pDestPos);
+        if (includeNormals)
+        {
+            if (destNormBuf != destPosBuf)
+            {
+                pBuffer = destNormBuf->lock(
+                    destNormBuf->getVertexSize() == destElemNorm->getSize() ?
+                    HardwareBuffer::HBL_DISCARD : HardwareBuffer::HBL_NORMAL);
+            }
+            destElemNorm->baseVertexPointerToElement(pBuffer, &pDestNorm);
+        }
+
+        OptimisedUtil::getImplementation()->softwareVertexSkinning(
+            pSrcPos, pDestPos,
+            pSrcNorm, pDestNorm,
+            pBlendWeight, pBlendIdx,
+            blendMatrices,
+            srcPosStride, destPosStride,
+            srcNormStride, destNormStride,
+            blendWeightStride, blendIdxStride,
+            numWeightsPerVertex,
+            targetVertexData->vertexCount);
+
+        // Unlock source buffers
+        srcPosBuf->unlock();
+        srcIdxBuf->unlock();
+        if (srcWeightBuf != srcIdxBuf)
+        {
+            srcWeightBuf->unlock();
+        }
+        if (includeNormals && srcNormBuf != srcPosBuf)
+        {
+            srcNormBuf->unlock();
+        }
+        // Unlock destination buffers
+        destPosBuf->unlock();
+        if (includeNormals && destNormBuf != destPosBuf)
+        {
+            destNormBuf->unlock();
+        }
+
+    }
+	//---------------------------------------------------------------------
+	void Mesh::softwareVertexMorph(Real t,
+		const HardwareVertexBufferSharedPtr& b1,
+		const HardwareVertexBufferSharedPtr& b2,
+		VertexData* targetVertexData)
+	{
+		float* pb1 = static_cast<float*>(b1->lock(HardwareBuffer::HBL_READ_ONLY));
+		float* pb2;
+		if (b1.get() != b2.get())
+		{
+			pb2 = static_cast<float*>(b2->lock(HardwareBuffer::HBL_READ_ONLY));
+		}
+		else
+		{
+			// Same buffer - track with only one entry or time index exactly matching
+			// one keyframe
+			// For simplicity of main code, interpolate still but with same val
+			pb2 = pb1;
+		}
+
+		const VertexElement* posElem =
+			targetVertexData->vertexDeclaration->findElementBySemantic(VES_POSITION);
+		assert(posElem);
+		HardwareVertexBufferSharedPtr destBuf =
+			targetVertexData->vertexBufferBinding->getBuffer(
+				posElem->getSource());
+		assert(posElem->getSize() == destBuf->getVertexSize() &&
+			"Positions must be in a buffer on their own for morphing");
+		float* pdst = static_cast<float*>(
+			destBuf->lock(HardwareBuffer::HBL_DISCARD));
+
+        OptimisedUtil::getImplementation()->softwareVertexMorph(
+            t, pb1, pb2, pdst,
+            targetVertexData->vertexCount);
+
+		destBuf->unlock();
+		b1->unlock();
+		if (b1.get() != b2.get())
+			b2->unlock();
+	}
+	//---------------------------------------------------------------------
+	void Mesh::softwareVertexPoseBlend(Real weight,
+		const std::map<size_t, Vector3>& vertexOffsetMap,
+		VertexData* targetVertexData)
+	{
+		// Do nothing if no weight
+		if (weight == 0.0f)
+			return;
+
+		const VertexElement* posElem =
+			targetVertexData->vertexDeclaration->findElementBySemantic(VES_POSITION);
+		assert(posElem);
+		HardwareVertexBufferSharedPtr destBuf =
+			targetVertexData->vertexBufferBinding->getBuffer(
+			posElem->getSource());
+		assert(posElem->getSize() == destBuf->getVertexSize() &&
+			"Positions must be in a buffer on their own for pose blending");
+
+		// Have to lock in normal mode since this is incremental
+		float* pBase = static_cast<float*>(
+			destBuf->lock(HardwareBuffer::HBL_NORMAL));
+
+		// Iterate over affected vertices
+		for (std::map<size_t, Vector3>::const_iterator i = vertexOffsetMap.begin();
+			i != vertexOffsetMap.end(); ++i)
+		{
+			// Adjust pointer
+			float *pdst = pBase + i->first*3;
+
+			*pdst = *pdst + (i->second.x * weight);
+			++pdst;
+			*pdst = *pdst + (i->second.y * weight);
+			++pdst;
+			*pdst = *pdst + (i->second.z * weight);
+			++pdst;
+
+		}
+
+		destBuf->unlock();
+	}
+    //---------------------------------------------------------------------
+	size_t Mesh::calculateSize(void) const
+	{
+		// calculate GPU size
+		size_t ret = 0;
+		unsigned short i;
+		// Shared vertices
+		if (sharedVertexData)
+		{
+			for (i = 0;
+				i < sharedVertexData->vertexBufferBinding->getBufferCount();
+				++i)
+			{
+				ret += sharedVertexData->vertexBufferBinding
+					->getBuffer(i)->getSizeInBytes();
+			}
+		}
+
+		SubMeshList::const_iterator si;
+		for (si = mSubMeshList.begin(); si != mSubMeshList.end(); ++si)
+		{
+			// Dedicated vertices
+			if (!(*si)->useSharedVertices)
+			{
+				for (i = 0;
+					i < (*si)->vertexData->vertexBufferBinding->getBufferCount();
+					++i)
+				{
+					ret += (*si)->vertexData->vertexBufferBinding
+						->getBuffer(i)->getSizeInBytes();
+				}
+			}
+			if (!(*si)->indexData->indexBuffer.isNull())
+			{
+				// Index data
+				ret += (*si)->indexData->indexBuffer->getSizeInBytes();
+			}
+
+		}
+		return ret;
+	}
+	//-----------------------------------------------------------------------------
+	bool Mesh::hasVertexAnimation(void) const
+	{
+		return !mAnimationsList.empty();
+	}
+	//---------------------------------------------------------------------
+	VertexAnimationType Mesh::getSharedVertexDataAnimationType(void) const
+	{
+		if (mAnimationTypesDirty)
+		{
+			_determineAnimationTypes();
+		}
+
+		return mSharedVertexDataAnimationType;
+	}
+	//---------------------------------------------------------------------
+	void Mesh::_determineAnimationTypes(void) const
+	{
+		// Don't check flag here; since detail checks on track changes are not
+		// done, allow caller to force if they need to
+
+		// Initialise all types to nothing
+		mSharedVertexDataAnimationType = VAT_NONE;
+		for (SubMeshList::const_iterator i = mSubMeshList.begin();
+			i != mSubMeshList.end(); ++i)
+		{
+			(*i)->mVertexAnimationType = VAT_NONE;
+		}
+
+		// Scan all animations and determine the type of animation tracks
+		// relating to each vertex data
+		for(AnimationList::const_iterator ai = mAnimationsList.begin();
+			ai != mAnimationsList.end(); ++ai)
+		{
+			Animation* anim = ai->second;
+			Animation::VertexTrackIterator vit = anim->getVertexTrackIterator();
+			while (vit.hasMoreElements())
+			{
+				VertexAnimationTrack* track = vit.getNext();
+				ushort handle = track->getHandle();
+				if (handle == 0)
+				{
+					// shared data
+					if (mSharedVertexDataAnimationType != VAT_NONE &&
+						mSharedVertexDataAnimationType != track->getAnimationType())
+					{
+						// Mixing of morph and pose animation on same data is not allowed
+						OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+							"Animation tracks for shared vertex data on mesh "
+							+ mName + " try to mix vertex animation types, which is "
+							"not allowed.",
+							"Mesh::_determineAnimationTypes");
+					}
+					mSharedVertexDataAnimationType = track->getAnimationType();
+				}
+				else
+				{
+					// submesh index (-1)
+					SubMesh* sm = getSubMesh(handle-1);
+					if (sm->mVertexAnimationType != VAT_NONE &&
+						sm->mVertexAnimationType != track->getAnimationType())
+					{
+						// Mixing of morph and pose animation on same data is not allowed
+						OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+							"Animation tracks for dedicated vertex data "
+							+ StringConverter::toString(handle-1) + " on mesh "
+							+ mName + " try to mix vertex animation types, which is "
+							"not allowed.",
+							"Mesh::_determineAnimationTypes");
+					}
+					sm->mVertexAnimationType = track->getAnimationType();
+
+				}
+			}
+		}
+
+		mAnimationTypesDirty = false;
+	}
+	//---------------------------------------------------------------------
+	Animation* Mesh::createAnimation(const String& name, Real length)
+	{
+		// Check name not used
+		if (mAnimationsList.find(name) != mAnimationsList.end())
+		{
+			OGRE_EXCEPT(
+				Exception::ERR_DUPLICATE_ITEM,
+				"An animation with the name " + name + " already exists",
+				"Mesh::createAnimation");
+		}
+
+		Animation* ret = new Animation(name, length);
+
+		// Add to list
+		mAnimationsList[name] = ret;
+
+		// Mark animation types dirty
+		mAnimationTypesDirty = true;
+
+		return ret;
+
+	}
+	//---------------------------------------------------------------------
+	Animation* Mesh::getAnimation(const String& name) const
+	{
+		Animation* ret = _getAnimationImpl(name);
+		if (!ret)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+				"No animation entry found named " + name,
+				"Mesh::getAnimation");
+		}
+
+		return ret;
+	}
+	//---------------------------------------------------------------------
+	Animation* Mesh::getAnimation(unsigned short index) const
+	{
+		// If you hit this assert, then the index is out of bounds.
+		assert( index < mAnimationsList.size() );
+
+		AnimationList::const_iterator i = mAnimationsList.begin();
+
+		std::advance(i, index);
+
+		return i->second;
+
+	}
+	//---------------------------------------------------------------------
+	unsigned short Mesh::getNumAnimations(void) const
+	{
+		return static_cast<unsigned short>(mAnimationsList.size());
+	}
+	//---------------------------------------------------------------------
+	bool Mesh::hasAnimation(const String& name)
+	{
+		return _getAnimationImpl(name) != 0;
+	}
+	//---------------------------------------------------------------------
+	Animation* Mesh::_getAnimationImpl(const String& name) const
+	{
+		Animation* ret = 0;
+		AnimationList::const_iterator i = mAnimationsList.find(name);
+
+		if (i != mAnimationsList.end())
+		{
+			ret = i->second;
+		}
+
+		return ret;
+
+	}
+	//---------------------------------------------------------------------
+	void Mesh::removeAnimation(const String& name)
+	{
+		AnimationList::iterator i = mAnimationsList.find(name);
+
+		if (i == mAnimationsList.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "No animation entry found named " + name,
+				"Mesh::getAnimation");
+		}
+
+		delete i->second;
+
+		mAnimationsList.erase(i);
+
+		mAnimationTypesDirty = true;
+	}
+	//---------------------------------------------------------------------
+	void Mesh::removeAllAnimations(void)
+	{
+		AnimationList::iterator i = mAnimationsList.begin();
+		for (; i != mAnimationsList.end(); ++i)
+		{
+			delete i->second;
+		}
+		mAnimationsList.clear();
+		mAnimationTypesDirty = true;
+	}
+	//---------------------------------------------------------------------
+	VertexData* Mesh::getVertexDataByTrackHandle(unsigned short handle)
+	{
+		if (handle == 0)
+		{
+			return sharedVertexData;
+		}
+		else
+		{
+			return getSubMesh(handle-1)->vertexData;
+		}
+	}
+	//---------------------------------------------------------------------
+	Pose* Mesh::createPose(ushort target, const String& name)
+	{
+		Pose* retPose = new Pose(target, name);
+		mPoseList.push_back(retPose);
+		return retPose;
+	}
+	//---------------------------------------------------------------------
+	Pose* Mesh::getPose(ushort index)
+	{
+		if (index >= getPoseCount())
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Index out of bounds",
+				"Mesh::getPose");
+		}
+
+		return mPoseList[index];
+
+	}
+	//---------------------------------------------------------------------
+	Pose* Mesh::getPose(const String& name)
+	{
+		for (PoseList::iterator i = mPoseList.begin(); i != mPoseList.end(); ++i)
+		{
+			if ((*i)->getName() == name)
+				return *i;
+		}
+		StringUtil::StrStreamType str;
+		str << "No pose called " << name << " found in Mesh " << mName;
+		OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+			str.str(),
+			"Mesh::getPose");
+
+	}
+	//---------------------------------------------------------------------
+	void Mesh::removePose(ushort index)
+	{
+		if (index >= getPoseCount())
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Index out of bounds",
+				"Mesh::removePose");
+		}
+		PoseList::iterator i = mPoseList.begin();
+		std::advance(i, index);
+		delete *i;
+		mPoseList.erase(i);
+
+	}
+	//---------------------------------------------------------------------
+	void Mesh::removePose(const String& name)
+	{
+		for (PoseList::iterator i = mPoseList.begin(); i != mPoseList.end(); ++i)
+		{
+			if ((*i)->getName() == name)
+			{
+				delete *i;
+				mPoseList.erase(i);
+				return;
+			}
+		}
+		StringUtil::StrStreamType str;
+		str << "No pose called " << name << " found in Mesh " << mName;
+		OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+			str.str(),
+			"Mesh::removePose");
+	}
+	//---------------------------------------------------------------------
+	void Mesh::removeAllPoses(void)
+	{
+		for (PoseList::iterator i = mPoseList.begin(); i != mPoseList.end(); ++i)
+		{
+			delete *i;
+		}
+		mPoseList.clear();
+	}
+	//---------------------------------------------------------------------
+	Mesh::PoseIterator Mesh::getPoseIterator(void)
+	{
+		return PoseIterator(mPoseList.begin(), mPoseList.end());
+	}
+	//---------------------------------------------------------------------
+	Mesh::ConstPoseIterator Mesh::getPoseIterator(void) const
+	{
+		return ConstPoseIterator(mPoseList.begin(), mPoseList.end());
+	}
+	//-----------------------------------------------------------------------------
+	const PoseList& Mesh::getPoseList(void) const
+	{
+		return mPoseList;
+	}
+	//---------------------------------------------------------------------
+	void Mesh::updateMaterialForAllSubMeshes(void)
+	{
+        // iterate through each sub mesh and request the submesh to update its material
+        std::vector<SubMesh*>::iterator subi;
+        for (subi = mSubMeshList.begin(); subi != mSubMeshList.end(); ++subi)
+        {
+            (*subi)->updateMaterialUsingTextureAliases();
+        }
+
+    }
+	//---------------------------------------------------------------------
+
+}
+
Index: /OgreMain/src/OgreMeshManager.cpp
===================================================================
--- /OgreMain/src/OgreMeshManager.cpp	(revision 5)
+++ /OgreMain/src/OgreMeshManager.cpp	(revision 5)
@@ -0,0 +1,934 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreMeshManager.h"
+
+#include "OgreMesh.h"
+#include "OgreSubMesh.h"
+#include "OgreMatrix4.h"
+#include "OgreMatrix3.h"
+#include "OgreVector3.h"
+#include "OgrePlane.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgrePatchSurface.h"
+#include "OgreException.h"
+
+#include "OgrePrefabFactory.h"
+
+namespace Ogre
+{
+	#define PI 3.1415926535897932384626433832795
+
+    //-----------------------------------------------------------------------
+    template<> MeshManager* Singleton<MeshManager>::ms_Singleton = 0;
+    MeshManager* MeshManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    MeshManager& MeshManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+    //-----------------------------------------------------------------------
+    MeshManager::MeshManager():
+    mBoundsPaddingFactor(0.01)
+    {
+        mPrepAllMeshesForShadowVolumes = false;
+
+        mLoadOrder = 350.0f;
+        mResourceType = "Mesh";
+
+        ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
+
+    }
+    //-----------------------------------------------------------------------
+    MeshManager::~MeshManager()
+    {
+        ResourceGroupManager::getSingleton()._unregisterResourceManager(mResourceType);
+    }
+    //-----------------------------------------------------------------------
+    void MeshManager::_initialise(void)
+    {
+        // Create prefab objects
+        createPrefabPlane();
+		createPrefabCube();
+		createPrefabSphere();
+    }
+    //-----------------------------------------------------------------------
+    MeshPtr MeshManager::load( const String& filename, const String& groupName, 
+		HardwareBuffer::Usage vertexBufferUsage, 
+		HardwareBuffer::Usage indexBufferUsage, 
+		bool vertexBufferShadowed, bool indexBufferShadowed)
+    {
+        ResourceCreateOrRetrieveResult res = createOrRetrieve(filename, groupName);
+		MeshPtr pMesh = res.first;
+		// Was it created?
+        if (res.second)
+        {
+			pMesh->setVertexBufferPolicy(vertexBufferUsage, vertexBufferShadowed);
+			pMesh->setIndexBufferPolicy(indexBufferUsage, indexBufferShadowed);
+        }
+		pMesh->load();
+        return pMesh;
+
+    }
+    //-----------------------------------------------------------------------
+    MeshPtr MeshManager::createManual( const String& name, const String& groupName, 
+        ManualResourceLoader* loader)
+    {
+		// Don't try to get existing, create should fail if already exists
+        return create(name, groupName, true, loader);
+    }
+    //-----------------------------------------------------------------------
+    MeshPtr MeshManager::createPlane( const String& name, const String& groupName,
+        const Plane& plane, Real width, Real height, int xsegments, int ysegments,
+        bool normals, int numTexCoordSets, Real xTile, Real yTile, const Vector3& upVector,
+		HardwareBuffer::Usage vertexBufferUsage, HardwareBuffer::Usage indexBufferUsage,
+		bool vertexShadowBuffer, bool indexShadowBuffer)
+    {
+        // Create manual mesh which calls back self to load
+        MeshPtr pMesh = createManual(name, groupName, this);
+		// Planes can never be manifold
+		pMesh->setAutoBuildEdgeLists(false);
+        // store parameters
+        MeshBuildParams params;
+        params.type = MBT_PLANE;
+        params.plane = plane;
+        params.width = width;
+        params.height = height;
+        params.xsegments = xsegments;
+        params.ysegments = ysegments;
+        params.normals = normals;
+        params.numTexCoordSets = numTexCoordSets;
+        params.xTile = xTile;
+        params.yTile = yTile;
+        params.upVector = upVector;
+        params.vertexBufferUsage = vertexBufferUsage;
+        params.indexBufferUsage = indexBufferUsage;
+        params.vertexShadowBuffer = vertexShadowBuffer;
+        params.indexShadowBuffer = indexShadowBuffer;
+        mMeshBuildParams[pMesh.getPointer()] = params;
+
+        // to preserve previous behaviour, load immediately
+        pMesh->load();
+
+        return pMesh;
+    }
+	
+	//-----------------------------------------------------------------------
+	MeshPtr MeshManager::createCurvedPlane( const String& name, const String& groupName, 
+        const Plane& plane, Real width, Real height, Real bow, int xsegments, int ysegments,
+        bool normals, int numTexCoordSets, Real xTile, Real yTile, const Vector3& upVector,
+			HardwareBuffer::Usage vertexBufferUsage, HardwareBuffer::Usage indexBufferUsage,
+			bool vertexShadowBuffer, bool indexShadowBuffer)
+    {
+        // Create manual mesh which calls back self to load
+        MeshPtr pMesh = createManual(name, groupName, this);
+		// Planes can never be manifold
+		pMesh->setAutoBuildEdgeLists(false);
+        // store parameters
+        MeshBuildParams params;
+        params.type = MBT_CURVED_PLANE;
+        params.plane = plane;
+        params.width = width;
+        params.height = height;
+        params.curvature = bow;
+        params.xsegments = xsegments;
+        params.ysegments = ysegments;
+        params.normals = normals;
+        params.numTexCoordSets = numTexCoordSets;
+        params.xTile = xTile;
+        params.yTile = yTile;
+        params.upVector = upVector;
+        params.vertexBufferUsage = vertexBufferUsage;
+        params.indexBufferUsage = indexBufferUsage;
+        params.vertexShadowBuffer = vertexShadowBuffer;
+        params.indexShadowBuffer = indexShadowBuffer;
+        mMeshBuildParams[pMesh.getPointer()] = params;
+
+        // to preserve previous behaviour, load immediately
+        pMesh->load();
+
+        return pMesh;
+
+    }
+    //-----------------------------------------------------------------------
+	MeshPtr MeshManager::createCurvedIllusionPlane(
+        const String& name, const String& groupName, const Plane& plane,
+        Real width, Real height, Real curvature,
+        int xsegments, int ysegments,
+        bool normals, int numTexCoordSets,
+        Real uTile, Real vTile, const Vector3& upVector,
+		const Quaternion& orientation, 
+        HardwareBuffer::Usage vertexBufferUsage, 
+		HardwareBuffer::Usage indexBufferUsage,
+		bool vertexShadowBuffer, bool indexShadowBuffer,
+        int ySegmentsToKeep)
+	{
+        // Create manual mesh which calls back self to load
+        MeshPtr pMesh = createManual(name, groupName, this);
+		// Planes can never be manifold
+		pMesh->setAutoBuildEdgeLists(false);
+        // store parameters
+        MeshBuildParams params;
+        params.type = MBT_CURVED_ILLUSION_PLANE;
+        params.plane = plane;
+        params.width = width;
+        params.height = height;
+        params.curvature = curvature;
+        params.xsegments = xsegments;
+        params.ysegments = ysegments;
+        params.normals = normals;
+        params.numTexCoordSets = numTexCoordSets;
+        params.xTile = uTile;
+        params.yTile = vTile;
+        params.upVector = upVector;
+        params.orientation = orientation;
+        params.vertexBufferUsage = vertexBufferUsage;
+        params.indexBufferUsage = indexBufferUsage;
+        params.vertexShadowBuffer = vertexShadowBuffer;
+        params.indexShadowBuffer = indexShadowBuffer;
+        params.ySegmentsToKeep = ySegmentsToKeep;
+        mMeshBuildParams[pMesh.getPointer()] = params;
+
+        // to preserve previous behaviour, load immediately
+        pMesh->load();
+
+        return pMesh;
+	}
+
+    //-----------------------------------------------------------------------
+    void MeshManager::tesselate2DMesh(SubMesh* sm, int meshWidth, int meshHeight, 
+		bool doubleSided, HardwareBuffer::Usage indexBufferUsage, bool indexShadowBuffer)
+    {
+        // The mesh is built, just make a list of indexes to spit out the triangles
+        int vInc, uInc, v, u, iterations;
+        int vCount, uCount;
+
+        if (doubleSided)
+        {
+            iterations = 2;
+            vInc = 1;
+            v = 0; // Start with front
+        }
+        else
+        {
+            iterations = 1;
+            vInc = 1;
+            v = 0;
+        }
+
+        // Allocate memory for faces
+        // Num faces, width*height*2 (2 tris per square), index count is * 3 on top
+        sm->indexData->indexCount = (meshWidth-1) * (meshHeight-1) * 2 * iterations * 3;
+		sm->indexData->indexBuffer = HardwareBufferManager::getSingleton().
+			createIndexBuffer(HardwareIndexBuffer::IT_16BIT,
+			sm->indexData->indexCount, indexBufferUsage, indexShadowBuffer);
+
+        int v1, v2, v3;
+        //bool firstTri = true;
+		HardwareIndexBufferSharedPtr ibuf = sm->indexData->indexBuffer;
+		// Lock the whole buffer
+		unsigned short* pIndexes = static_cast<unsigned short*>(
+			ibuf->lock(HardwareBuffer::HBL_DISCARD) );
+
+        while (iterations--)
+        {
+            // Make tris in a zigzag pattern (compatible with strips)
+            u = 0;
+            uInc = 1; // Start with moving +u
+
+            vCount = meshHeight - 1;
+            while (vCount--)
+            {
+                uCount = meshWidth - 1;
+                while (uCount--)
+                {
+                    // First Tri in cell
+                    // -----------------
+                    v1 = ((v + vInc) * meshWidth) + u;
+                    v2 = (v * meshWidth) + u;
+                    v3 = ((v + vInc) * meshWidth) + (u + uInc);
+                    // Output indexes
+                    *pIndexes++ = v1;
+                    *pIndexes++ = v2;
+                    *pIndexes++ = v3;
+                    // Second Tri in cell
+                    // ------------------
+                    v1 = ((v + vInc) * meshWidth) + (u + uInc);
+                    v2 = (v * meshWidth) + u;
+                    v3 = (v * meshWidth) + (u + uInc);
+                    // Output indexes
+                    *pIndexes++ = v1;
+                    *pIndexes++ = v2;
+                    *pIndexes++ = v3;
+
+                    // Next column
+                    u += uInc;
+                }
+                // Next row
+                v += vInc;
+                u = 0;
+
+
+            }
+
+            // Reverse vInc for double sided
+            v = meshHeight - 1;
+            vInc = -vInc;
+
+        }
+		// Unlock
+		ibuf->unlock();
+
+    }
+
+    //-----------------------------------------------------------------------
+    void MeshManager::createPrefabPlane(void)
+    {
+        MeshPtr msh = create(
+            "Prefab_Plane", 
+            ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME, 
+            true, // manually loaded
+            this);
+		// Planes can never be manifold
+		msh->setAutoBuildEdgeLists(false);
+        // to preserve previous behaviour, load immediately
+        msh->load();
+    }
+	//-----------------------------------------------------------------------
+	void MeshManager::createPrefabCube(void)
+	{
+		MeshPtr msh = create(
+			"Prefab_Cube", 
+			ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME, 
+			true, // manually loaded
+			this);
+
+		// to preserve previous behaviour, load immediately
+		msh->load();
+	}
+
+	void MeshManager::createPrefabSphere(void)
+	{
+		MeshPtr msh = create(
+			"Prefab_Sphere", 
+			ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME, 
+			true, // manually loaded
+			this);
+
+		// to preserve previous behaviour, load immediately
+		msh->load();
+	}
+
+    //-----------------------------------------------------------------------
+	void MeshManager::loadResource(Resource* res)
+	{
+		Mesh* msh = static_cast<Mesh*>(res);
+
+		// attempt to create a prefab mesh
+		bool createdPrefab = PrefabFactory::createPrefab(msh);
+
+		// the mesh was not a prefab..
+		if(!createdPrefab)
+		{
+			// Find build parameters
+			MeshBuildParamsMap::iterator ibld = mMeshBuildParams.find(res);
+			if (ibld == mMeshBuildParams.end())
+			{
+				OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+					"Cannot find build parameters for " + res->getName(),
+					"MeshManager::loadResource");
+			}
+			MeshBuildParams& params = ibld->second;
+
+			switch(params.type)
+			{
+			case MBT_PLANE:
+				loadManualPlane(msh, params);
+				break;
+			case MBT_CURVED_ILLUSION_PLANE:
+				loadManualCurvedIllusionPlane(msh, params);
+				break;
+			case MBT_CURVED_PLANE:
+				loadManualCurvedPlane(msh, params);
+				break;
+			default:
+				OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+					"Unknown build parameters for " + res->getName(),
+					"MeshManager::loadResource");
+			}
+		}
+	}
+
+    //-----------------------------------------------------------------------
+    void MeshManager::loadManualPlane(Mesh* pMesh, MeshBuildParams& params)
+    {
+        int i;
+
+        SubMesh *pSub = pMesh->createSubMesh();
+
+        // Set up vertex data
+        // Use a single shared buffer
+        pMesh->sharedVertexData = new VertexData();
+        VertexData* vertexData = pMesh->sharedVertexData;
+        // Set up Vertex Declaration
+        VertexDeclaration* vertexDecl = vertexData->vertexDeclaration;
+        size_t currOffset = 0;
+        // We always need positions
+        vertexDecl->addElement(0, currOffset, VET_FLOAT3, VES_POSITION);
+        currOffset += VertexElement::getTypeSize(VET_FLOAT3);
+        // Optional normals
+        if(params.normals)
+        {
+            vertexDecl->addElement(0, currOffset, VET_FLOAT3, VES_NORMAL);
+            currOffset += VertexElement::getTypeSize(VET_FLOAT3);
+        }
+
+        for (i = 0; i < params.numTexCoordSets; ++i)
+        {
+            // Assumes 2D texture coords
+            vertexDecl->addElement(0, currOffset, VET_FLOAT2, VES_TEXTURE_COORDINATES, i);
+            currOffset += VertexElement::getTypeSize(VET_FLOAT2);
+        }
+
+        vertexData->vertexCount = (params.xsegments + 1) * (params.ysegments + 1);
+
+        // Allocate vertex buffer
+        HardwareVertexBufferSharedPtr vbuf = 
+            HardwareBufferManager::getSingleton().
+            createVertexBuffer(vertexDecl->getVertexSize(0), vertexData->vertexCount,
+            params.vertexBufferUsage, params.vertexShadowBuffer);
+
+        // Set up the binding (one source only)
+        VertexBufferBinding* binding = vertexData->vertexBufferBinding;
+        binding->setBinding(0, vbuf);
+
+        // Work out the transform required
+        // Default orientation of plane is normal along +z, distance 0
+        Matrix4 xlate, xform, rot;
+        Matrix3 rot3;
+        xlate = rot = Matrix4::IDENTITY;
+        // Determine axes
+        Vector3 zAxis, yAxis, xAxis;
+        zAxis = params.plane.normal;
+        zAxis.normalise();
+        yAxis = params.upVector;
+        yAxis.normalise();
+        xAxis = yAxis.crossProduct(zAxis);
+        if (xAxis.length() == 0)
+        {
+            //upVector must be wrong
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "The upVector you supplied is parallel to the plane normal, so is not valid.",
+                "MeshManager::createPlane");
+        }
+
+        rot3.FromAxes(xAxis, yAxis, zAxis);
+        rot = rot3;
+
+        // Set up standard xform from origin
+        xlate.setTrans(params.plane.normal * -params.plane.d);
+
+        // concatenate
+        xform = xlate * rot;
+
+        // Generate vertex data
+        // Lock the whole buffer
+        float* pReal = static_cast<float*>(
+            vbuf->lock(HardwareBuffer::HBL_DISCARD) );
+        Real xSpace = params.width / params.xsegments;
+        Real ySpace = params.height / params.ysegments;
+        Real halfWidth = params.width / 2;
+        Real halfHeight = params.height / 2;
+        Real xTex = (1.0f * params.xTile) / params.xsegments;
+        Real yTex = (1.0f * params.yTile) / params.ysegments;
+        Vector3 vec;
+        Vector3 min, max;
+        Real maxSquaredLength = 0;
+        bool firstTime = true;
+
+        for (int y = 0; y < params.ysegments + 1; ++y)
+        {
+            for (int x = 0; x < params.xsegments + 1; ++x)
+            {
+                // Work out centered on origin
+                vec.x = (x * xSpace) - halfWidth;
+                vec.y = (y * ySpace) - halfHeight;
+                vec.z = 0.0f;
+                // Transform by orientation and distance
+                vec = xform.transformAffine(vec);
+                // Assign to geometry
+                *pReal++ = vec.x;
+                *pReal++ = vec.y;
+                *pReal++ = vec.z;
+
+                // Build bounds as we go
+                if (firstTime)
+                {
+                    min = vec;
+                    max = vec;
+                    maxSquaredLength = vec.squaredLength();
+                    firstTime = false;
+                }
+                else
+                {
+                    min.makeFloor(vec);
+                    max.makeCeil(vec);
+                    maxSquaredLength = std::max(maxSquaredLength, vec.squaredLength());
+                }
+
+                if (params.normals)
+                {
+                    // Default normal is along unit Z
+                    vec = Vector3::UNIT_Z;
+                    // Rotate
+                    vec = rot.transformAffine(vec);
+
+                    *pReal++ = vec.x;
+                    *pReal++ = vec.y;
+                    *pReal++ = vec.z;
+                }
+
+                for (i = 0; i < params.numTexCoordSets; ++i)
+                {
+                    *pReal++ = x * xTex;
+                    *pReal++ = 1 - (y * yTex);
+                }
+
+
+            } // x
+        } // y
+
+        // Unlock
+        vbuf->unlock();
+        // Generate face list
+        pSub->useSharedVertices = true;
+        tesselate2DMesh(pSub, params.xsegments + 1, params.ysegments + 1, false, 
+            params.indexBufferUsage, params.indexShadowBuffer);
+
+        pMesh->_setBounds(AxisAlignedBox(min, max), true);
+        pMesh->_setBoundingSphereRadius(Math::Sqrt(maxSquaredLength));
+    }
+    //-----------------------------------------------------------------------
+    void MeshManager::loadManualCurvedPlane(Mesh* pMesh, MeshBuildParams& params)
+    {
+        int i;
+        SubMesh *pSub = pMesh->createSubMesh();
+
+        // Set options
+        pMesh->sharedVertexData = new VertexData();
+        pMesh->sharedVertexData->vertexStart = 0;
+        VertexBufferBinding* bind = pMesh->sharedVertexData->vertexBufferBinding;
+        VertexDeclaration* decl = pMesh->sharedVertexData->vertexDeclaration;
+
+        pMesh->sharedVertexData->vertexCount = (params.xsegments + 1) * (params.ysegments + 1);
+
+        size_t offset = 0;
+        decl->addElement(0, offset, VET_FLOAT3, VES_POSITION);
+        offset += VertexElement::getTypeSize(VET_FLOAT3);
+        if (params.normals)
+        {
+            decl->addElement(0, 0, VET_FLOAT3, VES_NORMAL);
+            offset += VertexElement::getTypeSize(VET_FLOAT3);
+        }
+
+        for (i = 0; i < params.numTexCoordSets; ++i)
+        {
+            decl->addElement(0, offset, VET_FLOAT2, VES_TEXTURE_COORDINATES, i);
+            offset += VertexElement::getTypeSize(VET_FLOAT2);
+        }
+
+
+        // Allocate memory
+        HardwareVertexBufferSharedPtr vbuf = 
+            HardwareBufferManager::getSingleton().createVertexBuffer(
+            offset, 
+            pMesh->sharedVertexData->vertexCount, 
+            params.vertexBufferUsage, 
+            params.vertexShadowBuffer);
+        bind->setBinding(0, vbuf);
+
+        // Work out the transform required
+        // Default orientation of plane is normal along +z, distance 0
+        Matrix4 xlate, xform, rot;
+        Matrix3 rot3;
+        xlate = rot = Matrix4::IDENTITY;
+        // Determine axes
+        Vector3 zAxis, yAxis, xAxis;
+        zAxis = params.plane.normal;
+        zAxis.normalise();
+        yAxis = params.upVector;
+        yAxis.normalise();
+        xAxis = yAxis.crossProduct(zAxis);
+        if (xAxis.length() == 0)
+        {
+            //upVector must be wrong
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "The upVector you supplied is parallel to the plane normal, so is not valid.",
+                "MeshManager::createPlane");
+        }
+
+        rot3.FromAxes(xAxis, yAxis, zAxis);
+        rot = rot3;
+
+        // Set up standard xform from origin
+        xlate.setTrans(params.plane.normal * -params.plane.d);
+
+        // concatenate
+        xform = xlate * rot;
+
+        // Generate vertex data
+        float* pFloat = static_cast<float*>(
+            vbuf->lock(HardwareBuffer::HBL_DISCARD)); 
+        Real xSpace = params.width / params.xsegments;
+        Real ySpace = params.height / params.ysegments;
+        Real halfWidth = params.width / 2;
+        Real halfHeight = params.height / 2;
+        Real xTex = (1.0f * params.xTile) / params.xsegments;
+        Real yTex = (1.0f * params.yTile) / params.ysegments;
+        Vector3 vec;
+
+        Vector3 min, max;
+        Real maxSqLen = 0;
+        bool first = true;
+
+        Real diff_x, diff_y, dist;
+
+        for (int y = 0; y < params.ysegments + 1; ++y)
+        {
+            for (int x = 0; x < params.xsegments + 1; ++x)
+            {
+                // Work out centered on origin
+                vec.x = (x * xSpace) - halfWidth;
+                vec.y = (y * ySpace) - halfHeight;
+
+                // Here's where curved plane is different from standard plane.  Amazing, I know.
+                diff_x = (x - ((params.xsegments) / 2)) / static_cast<Real>((params.xsegments));
+                diff_y = (y - ((params.ysegments) / 2)) / static_cast<Real>((params.ysegments));
+                dist = sqrt(diff_x*diff_x + diff_y * diff_y );
+                vec.z = (-sin((1-dist) * (PI/2)) * params.curvature) + params.curvature;
+
+                // Transform by orientation and distance
+                Vector3 pos = xform.transformAffine(vec);
+                // Assign to geometry
+                *pFloat++ = pos.x;
+                *pFloat++ = pos.y;
+                *pFloat++ = pos.z;
+
+                // Record bounds
+                if (first)
+                {
+                    min = max = vec;
+                    maxSqLen = vec.squaredLength();
+                    first = false;
+                }
+                else
+                {
+                    min.makeFloor(vec);
+                    max.makeCeil(vec);
+                    maxSqLen = std::max(maxSqLen, vec.squaredLength());
+                }
+
+                if (params.normals)
+                {
+                    // This part is kinda 'wrong' for curved planes... but curved planes are
+                    //   very valuable outside sky planes, which don't typically need normals
+                    //   so I'm not going to mess with it for now. 
+
+                    // Default normal is along unit Z
+                    //vec = Vector3::UNIT_Z;
+                    // Rotate
+                    vec = rot.transformAffine(vec);
+					vec.normalise();
+
+                    *pFloat++ = vec.x;
+                    *pFloat++ = vec.y;
+                    *pFloat++ = vec.z;
+                }
+
+                for (i = 0; i < params.numTexCoordSets; ++i)
+                {
+                    *pFloat++ = x * xTex;
+                    *pFloat++ = 1 - (y * yTex);
+                }
+
+            } // x
+        } // y
+        vbuf->unlock();
+
+        // Generate face list
+        tesselate2DMesh(pSub, params.xsegments + 1, params.ysegments + 1, 
+            false, params.indexBufferUsage, params.indexShadowBuffer);
+
+        pMesh->_setBounds(AxisAlignedBox(min, max), true);
+        pMesh->_setBoundingSphereRadius(Math::Sqrt(maxSqLen));
+
+    }
+    //-----------------------------------------------------------------------
+    void MeshManager::loadManualCurvedIllusionPlane(Mesh* pMesh, MeshBuildParams& params)
+    {
+        int i;
+        SubMesh *pSub = pMesh->createSubMesh();
+
+        if (params.ySegmentsToKeep == -1) params.ySegmentsToKeep = params.ysegments;
+
+        // Set up vertex data
+        // Use a single shared buffer
+        pMesh->sharedVertexData = new VertexData();
+        VertexData* vertexData = pMesh->sharedVertexData;
+        // Set up Vertex Declaration
+        VertexDeclaration* vertexDecl = vertexData->vertexDeclaration;
+        size_t currOffset = 0;
+        // We always need positions
+        vertexDecl->addElement(0, currOffset, VET_FLOAT3, VES_POSITION);
+        currOffset += VertexElement::getTypeSize(VET_FLOAT3);
+        // Optional normals
+        if(params.normals)
+        {
+            vertexDecl->addElement(0, currOffset, VET_FLOAT3, VES_NORMAL);
+            currOffset += VertexElement::getTypeSize(VET_FLOAT3);
+        }
+
+        for (i = 0; i < params.numTexCoordSets; ++i)
+        {
+            // Assumes 2D texture coords
+            vertexDecl->addElement(0, currOffset, VET_FLOAT2, VES_TEXTURE_COORDINATES, i);
+            currOffset += VertexElement::getTypeSize(VET_FLOAT2);
+        }
+
+        vertexData->vertexCount = (params.xsegments + 1) * (params.ySegmentsToKeep + 1);
+
+        // Allocate vertex buffer
+        HardwareVertexBufferSharedPtr vbuf = 
+            HardwareBufferManager::getSingleton().
+            createVertexBuffer(vertexDecl->getVertexSize(0), vertexData->vertexCount,
+            params.vertexBufferUsage, params.vertexShadowBuffer);
+
+        // Set up the binding (one source only)
+        VertexBufferBinding* binding = vertexData->vertexBufferBinding;
+        binding->setBinding(0, vbuf);
+
+        // Work out the transform required
+        // Default orientation of plane is normal along +z, distance 0
+        Matrix4 xlate, xform, rot;
+        Matrix3 rot3;
+        xlate = rot = Matrix4::IDENTITY;
+        // Determine axes
+        Vector3 zAxis, yAxis, xAxis;
+        zAxis = params.plane.normal;
+        zAxis.normalise();
+        yAxis = params.upVector;
+        yAxis.normalise();
+        xAxis = yAxis.crossProduct(zAxis);
+        if (xAxis.length() == 0)
+        {
+            //upVector must be wrong
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "The upVector you supplied is parallel to the plane normal, so is not valid.",
+                "MeshManager::createPlane");
+        }
+
+        rot3.FromAxes(xAxis, yAxis, zAxis);
+        rot = rot3;
+
+        // Set up standard xform from origin
+        xlate.setTrans(params.plane.normal * -params.plane.d);
+
+        // concatenate
+        xform = xlate * rot;
+
+        // Generate vertex data
+        // Imagine a large sphere with the camera located near the top
+        // The lower the curvature, the larger the sphere
+        // Use the angle from viewer to the points on the plane
+        // Credit to Aftershock for the general approach
+        Real camPos;      // Camera position relative to sphere center
+
+        // Derive sphere radius
+        Vector3 vertPos;  // position relative to camera
+        Real sphDist;      // Distance from camera to sphere along box vertex vector
+        // Vector3 camToSph; // camera position to sphere
+        Real sphereRadius;// Sphere radius
+        // Actual values irrelevant, it's the relation between sphere radius and camera position that's important
+        const Real SPHERE_RAD = 100.0;
+        const Real CAM_DIST = 5.0;
+
+        sphereRadius = SPHERE_RAD - params.curvature;
+        camPos = sphereRadius - CAM_DIST;
+
+        // Lock the whole buffer
+        float* pFloat = static_cast<float*>(
+            vbuf->lock(HardwareBuffer::HBL_DISCARD) );
+        Real xSpace = params.width / params.xsegments;
+        Real ySpace = params.height / params.ysegments;
+        Real halfWidth = params.width / 2;
+        Real halfHeight = params.height / 2;
+        Vector3 vec, norm;
+        Vector3 min, max;
+        Real maxSquaredLength = 0;
+        bool firstTime = true;
+
+        for (int y = params.ysegments - params.ySegmentsToKeep; y < params.ysegments + 1; ++y)
+        {
+            for (int x = 0; x < params.xsegments + 1; ++x)
+            {
+                // Work out centered on origin
+                vec.x = (x * xSpace) - halfWidth;
+                vec.y = (y * ySpace) - halfHeight;
+                vec.z = 0.0f;
+                // Transform by orientation and distance
+                vec = xform.transformAffine(vec);
+                // Assign to geometry
+                *pFloat++ = vec.x;
+                *pFloat++ = vec.y;
+                *pFloat++ = vec.z;
+
+                // Build bounds as we go
+                if (firstTime)
+                {
+                    min = vec;
+                    max = vec;
+                    maxSquaredLength = vec.squaredLength();
+                    firstTime = false;
+                }
+                else
+                {
+                    min.makeFloor(vec);
+                    max.makeCeil(vec);
+                    maxSquaredLength = std::max(maxSquaredLength, vec.squaredLength());
+                }
+
+                if (params.normals)
+                {
+                    // Default normal is along unit Z
+                    norm = Vector3::UNIT_Z;
+                    // Rotate
+                    norm = params.orientation * norm;
+
+                    *pFloat++ = norm.x;
+                    *pFloat++ = norm.y;
+                    *pFloat++ = norm.z;
+                }
+
+                // Generate texture coords
+                // Normalise position
+                // modify by orientation to return +y up
+                vec = params.orientation.Inverse() * vec;
+                vec.normalise();
+                // Find distance to sphere
+                sphDist = Math::Sqrt(camPos*camPos * (vec.y*vec.y-1.0) + sphereRadius*sphereRadius) - camPos*vec.y;
+
+                vec.x *= sphDist;
+                vec.z *= sphDist;
+
+                // Use x and y on sphere as texture coordinates, tiled
+                Real s = vec.x * (0.01 * params.xTile);
+                Real t = 1 - (vec.z * (0.01 * params.yTile));
+                for (i = 0; i < params.numTexCoordSets; ++i)
+                {
+                    *pFloat++ = s;
+                    *pFloat++ = t;
+                }
+
+
+            } // x
+        } // y
+
+        // Unlock
+        vbuf->unlock();
+        // Generate face list
+        pSub->useSharedVertices = true;
+        tesselate2DMesh(pSub, params.xsegments + 1, params.ySegmentsToKeep + 1, false, 
+            params.indexBufferUsage, params.indexShadowBuffer);
+
+        pMesh->_setBounds(AxisAlignedBox(min, max), true);
+        pMesh->_setBoundingSphereRadius(Math::Sqrt(maxSquaredLength));
+    }
+    //-----------------------------------------------------------------------
+    PatchMeshPtr MeshManager::createBezierPatch(const String& name, const String& groupName, 
+            void* controlPointBuffer, VertexDeclaration *declaration, 
+            size_t width, size_t height,
+            size_t uMaxSubdivisionLevel, size_t vMaxSubdivisionLevel,
+            PatchSurface::VisibleSide visibleSide, 
+            HardwareBuffer::Usage vbUsage, HardwareBuffer::Usage ibUsage,
+            bool vbUseShadow, bool ibUseShadow)
+    {
+        if (width < 3 || height < 3)
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "Bezier patch require at least 3x3 control points",
+                "MeshManager::createBezierPatch");
+        }
+
+        MeshPtr pMesh = getByName(name);
+        if (!pMesh.isNull())
+        {
+            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, "A mesh called " + name + 
+                " already exists!", "MeshManager::createBezierPatch");
+        }
+        PatchMesh* pm = new PatchMesh(this, name, getNextHandle(), groupName);
+        pm->define(controlPointBuffer, declaration, width, height,
+            uMaxSubdivisionLevel, vMaxSubdivisionLevel, visibleSide, vbUsage, ibUsage,
+            vbUseShadow, ibUseShadow);
+        pm->load();
+        ResourcePtr res(pm);
+        addImpl(res);
+
+        return res;
+    }
+    //-----------------------------------------------------------------------
+    void MeshManager::setPrepareAllMeshesForShadowVolumes(bool enable)
+    {
+        mPrepAllMeshesForShadowVolumes = enable;
+    }
+    //-----------------------------------------------------------------------
+    bool MeshManager::getPrepareAllMeshesForShadowVolumes(void)
+    {
+        return mPrepAllMeshesForShadowVolumes;
+    }
+    //-----------------------------------------------------------------------
+    Real MeshManager::getBoundsPaddingFactor(void)
+    {
+        return mBoundsPaddingFactor;
+    }
+    //-----------------------------------------------------------------------
+    void MeshManager::setBoundsPaddingFactor(Real paddingFactor)
+    {
+        mBoundsPaddingFactor = paddingFactor;
+    }
+    //-----------------------------------------------------------------------
+    Resource* MeshManager::createImpl(const String& name, ResourceHandle handle, 
+        const String& group, bool isManual, ManualResourceLoader* loader, 
+        const NameValuePairList* createParams)
+    {
+        // no use for createParams here
+        return new Mesh(this, name, handle, group, isManual, loader);
+    }
+    //-----------------------------------------------------------------------
+
+}
Index: /OgreMain/src/OgreMeshSerializer.cpp
===================================================================
--- /OgreMain/src/OgreMeshSerializer.cpp	(revision 5)
+++ /OgreMain/src/OgreMeshSerializer.cpp	(revision 5)
@@ -0,0 +1,131 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreMeshSerializer.h"
+#include "OgreMeshFileFormat.h"
+#include "OgreMesh.h"
+#include "OgreSubMesh.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreSkeleton.h"
+
+namespace Ogre {
+
+    String MeshSerializer::msCurrentVersion = "[MeshSerializer_v1.40]";
+    const unsigned short HEADER_CHUNK_ID = 0x1000;
+    //---------------------------------------------------------------------
+    MeshSerializer::MeshSerializer()
+    {
+        // Set up map
+        mImplementations.insert(
+            MeshSerializerImplMap::value_type("[MeshSerializer_v1.10]", 
+            new MeshSerializerImpl_v1_1() ) );
+
+        mImplementations.insert(
+            MeshSerializerImplMap::value_type("[MeshSerializer_v1.20]", 
+            new MeshSerializerImpl_v1_2() ) );
+
+        mImplementations.insert(
+            MeshSerializerImplMap::value_type("[MeshSerializer_v1.30]", 
+            new MeshSerializerImpl_v1_3() ) );
+
+        mImplementations.insert(
+            MeshSerializerImplMap::value_type(msCurrentVersion, 
+            new MeshSerializerImpl() ) );
+    }
+    //---------------------------------------------------------------------
+    MeshSerializer::~MeshSerializer()
+    {
+        // delete map
+        for (MeshSerializerImplMap::iterator i = mImplementations.begin();
+            i != mImplementations.end(); ++i)
+        {
+            delete i->second;
+        }
+        mImplementations.clear();
+
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializer::exportMesh(const Mesh* pMesh, const String& filename,
+		Endian endianMode)
+    {
+        MeshSerializerImplMap::iterator impl = mImplementations.find(msCurrentVersion);
+        if (impl == mImplementations.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Cannot find serializer implementation for "
+                "current version " + msCurrentVersion, "MeshSerializer::exportMesh");
+        }
+
+        impl->second->exportMesh(pMesh, filename, endianMode);
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializer::importMesh(DataStreamPtr& stream, Mesh* pDest)
+    {
+        determineEndianness(stream);
+
+        // Read header and determine the version
+        unsigned short headerID;
+        
+        // Read header ID
+        readShorts(stream, &headerID, 1);
+        
+        if (headerID != HEADER_CHUNK_ID)
+        {
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "File header not found",
+                "MeshSerializer::importMesh");
+        }
+        // Read version
+        String ver = readString(stream);
+        // Jump back to start
+        stream->seek(0);
+
+        // Find the implementation to use
+        MeshSerializerImplMap::iterator impl = mImplementations.find(ver);
+        if (impl == mImplementations.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Cannot find serializer implementation for "
+                "current version " + ver, "MeshSerializer::importMesh");
+        }
+
+        // Call implementation
+        impl->second->importMesh(stream, pDest);
+        // Warn on old version of mesh
+        if (ver != msCurrentVersion)
+        {
+            LogManager::getSingleton().logMessage("WARNING: " + pDest->getName() + 
+                " is an older format (" + ver + "); you should upgrade it as soon as possible" +
+                " using the OgreMeshUpgrade tool.");
+        }
+
+    }
+    //---------------------------------------------------------------------
+
+}
+
Index: /OgreMain/src/OgreMeshSerializerImpl.cpp
===================================================================
--- /OgreMain/src/OgreMeshSerializerImpl.cpp	(revision 5)
+++ /OgreMain/src/OgreMeshSerializerImpl.cpp	(revision 5)
@@ -0,0 +1,2910 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreMeshSerializerImpl.h"
+#include "OgreMeshFileFormat.h"
+#include "OgreMesh.h"
+#include "OgreSubMesh.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreSkeleton.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreMaterial.h"
+#include "OgreTechnique.h"
+#include "OgrePass.h"
+#include "OgreAnimation.h"
+#include "OgreAnimationTrack.h"
+#include "OgreKeyFrame.h"
+#include "OgreRoot.h"
+
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+// Disable conversion warnings, we do a lot of them, intentionally
+#   pragma warning (disable : 4267)
+#endif
+
+
+namespace Ogre {
+
+    /// stream overhead = ID + size
+    const long STREAM_OVERHEAD_SIZE = sizeof(uint16) + sizeof(uint32);
+    //---------------------------------------------------------------------
+    MeshSerializerImpl::MeshSerializerImpl()
+    {
+
+        // Version number
+        mVersion = "[MeshSerializer_v1.40]";
+    }
+    //---------------------------------------------------------------------
+    MeshSerializerImpl::~MeshSerializerImpl()
+    {
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::exportMesh(const Mesh* pMesh, 
+		const String& filename, Endian endianMode)
+    {
+        LogManager::getSingleton().logMessage("MeshSerializer writing mesh data to " + filename + "...");
+
+		// Decide on endian mode
+		determineEndianness(endianMode);
+
+        // Check that the mesh has it's bounds set
+        if (pMesh->getBounds().isNull() || pMesh->getBoundingSphereRadius() == 0.0f)
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "The Mesh you have supplied does not have its"
+                " bounds completely defined. Define them first before exporting.",
+                "MeshSerializerImpl::exportMesh");
+        }
+        mpfFile = fopen(filename.c_str(), "wb");
+		if (!mpfFile)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Unable to open file " + filename + " for writing",
+				"MeshSerializerImpl::exportMesh");
+		}
+
+        writeFileHeader();
+        LogManager::getSingleton().logMessage("File header written.");
+
+
+        LogManager::getSingleton().logMessage("Writing mesh data...");
+        writeMesh(pMesh);
+        LogManager::getSingleton().logMessage("Mesh data exported.");
+
+        fclose(mpfFile);
+        LogManager::getSingleton().logMessage("MeshSerializer export successful.");
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::importMesh(DataStreamPtr& stream, Mesh* pMesh)
+    {
+		// Determine endianness (must be the first thing we do!)
+		determineEndianness(stream);
+
+        // Check header
+        readFileHeader(stream);
+
+        unsigned short streamID;
+        while(!stream->eof())
+        {
+            streamID = readChunk(stream);
+            switch (streamID)
+            {
+            case M_MESH:
+                readMesh(stream, pMesh);
+                break;
+			}
+
+        }
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::writeMesh(const Mesh* pMesh)
+    {
+        // Header
+        writeChunkHeader(M_MESH, calcMeshSize(pMesh));
+
+		// bool skeletallyAnimated
+		bool skelAnim = pMesh->hasSkeleton();
+		writeBools(&skelAnim, 1);
+
+        // Write shared geometry
+        if (pMesh->sharedVertexData)
+            writeGeometry(pMesh->sharedVertexData);
+
+        // Write Submeshes
+        for (int i = 0; i < pMesh->getNumSubMeshes(); ++i)
+        {
+            LogManager::getSingleton().logMessage("Writing submesh...");
+            writeSubMesh(pMesh->getSubMesh(i));
+            LogManager::getSingleton().logMessage("Submesh exported.");
+        }
+
+        // Write skeleton info if required
+        if (pMesh->hasSkeleton())
+        {
+            LogManager::getSingleton().logMessage("Exporting skeleton link...");
+            // Write skeleton link
+            writeSkeletonLink(pMesh->getSkeletonName());
+            LogManager::getSingleton().logMessage("Skeleton link exported.");
+
+            // Write bone assignments
+            if (!pMesh->mBoneAssignments.empty())
+            {
+                LogManager::getSingleton().logMessage("Exporting shared geometry bone assignments...");
+
+                Mesh::VertexBoneAssignmentList::const_iterator vi;
+                for (vi = pMesh->mBoneAssignments.begin();
+                vi != pMesh->mBoneAssignments.end(); ++vi)
+                {
+                    writeMeshBoneAssignment(vi->second);
+                }
+
+                LogManager::getSingleton().logMessage("Shared geometry bone assignments exported.");
+            }
+        }
+
+        // Write LOD data if any
+        if (pMesh->getNumLodLevels() > 1)
+        {
+            LogManager::getSingleton().logMessage("Exporting LOD information....");
+            writeLodInfo(pMesh);
+            LogManager::getSingleton().logMessage("LOD information exported.");
+
+        }
+        // Write bounds information
+        LogManager::getSingleton().logMessage("Exporting bounds information....");
+        writeBoundsInfo(pMesh);
+        LogManager::getSingleton().logMessage("Bounds information exported.");
+
+		// Write submesh name table
+		LogManager::getSingleton().logMessage("Exporting submesh name table...");
+		writeSubMeshNameTable(pMesh);
+		LogManager::getSingleton().logMessage("Submesh name table exported.");
+
+		// Write edge lists
+		if (pMesh->isEdgeListBuilt())
+		{
+			LogManager::getSingleton().logMessage("Exporting edge lists...");
+			writeEdgeList(pMesh);
+			LogManager::getSingleton().logMessage("Edge lists exported");
+		}
+
+		// Write morph animation
+		writePoses(pMesh);
+		if (pMesh->hasVertexAnimation())
+		{
+			writeAnimations(pMesh);
+        }
+
+        // Write submesh extremes
+        writeExtremes(pMesh);
+    }
+    //---------------------------------------------------------------------
+	// Added by DrEvil
+	void MeshSerializerImpl::writeSubMeshNameTable(const Mesh* pMesh)
+	{
+		// Header
+		writeChunkHeader(M_SUBMESH_NAME_TABLE, calcSubMeshNameTableSize(pMesh));
+
+		// Loop through and save out the index and names.
+		Mesh::SubMeshNameMap::const_iterator it = pMesh->mSubMeshNameMap.begin();
+
+		while(it != pMesh->mSubMeshNameMap.end())
+		{
+			// Header
+			writeChunkHeader(M_SUBMESH_NAME_TABLE_ELEMENT, STREAM_OVERHEAD_SIZE +
+				sizeof(unsigned short) + (unsigned long)it->first.length() + 1);
+
+			// write the index
+			writeShorts(&it->second, 1);
+			// name
+	        writeString(it->first);
+
+			++it;
+		}
+	}
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::writeSubMesh(const SubMesh* s)
+    {
+        // Header
+        writeChunkHeader(M_SUBMESH, calcSubMeshSize(s));
+
+        // char* materialName
+        writeString(s->getMaterialName());
+
+        // bool useSharedVertices
+        writeBools(&s->useSharedVertices, 1);
+
+		unsigned int indexCount = s->indexData->indexCount;
+        writeInts(&indexCount, 1);
+
+        // bool indexes32Bit
+        bool idx32bit = (s->indexData->indexBuffer->getType() == HardwareIndexBuffer::IT_32BIT);
+        writeBools(&idx32bit, 1);
+
+        // unsigned short* faceVertexIndices ((indexCount)
+        HardwareIndexBufferSharedPtr ibuf = s->indexData->indexBuffer;
+        void* pIdx = ibuf->lock(HardwareBuffer::HBL_READ_ONLY);
+        if (idx32bit)
+        {
+            unsigned int* pIdx32 = static_cast<unsigned int*>(pIdx);
+            writeInts(pIdx32, s->indexData->indexCount);
+        }
+        else
+        {
+            unsigned short* pIdx16 = static_cast<unsigned short*>(pIdx);
+            writeShorts(pIdx16, s->indexData->indexCount);
+        }
+        ibuf->unlock();
+
+        // M_GEOMETRY stream (Optional: present only if useSharedVertices = false)
+        if (!s->useSharedVertices)
+        {
+            writeGeometry(s->vertexData);
+        }
+
+        // end of sub mesh chunk
+
+        // write out texture alias chunks
+        writeSubMeshTextureAliases(s);
+
+        // Operation type
+        writeSubMeshOperation(s);
+
+        // Bone assignments
+        if (!s->mBoneAssignments.empty())
+        {
+            LogManager::getSingleton().logMessage("Exporting dedicated geometry bone assignments...");
+
+            SubMesh::VertexBoneAssignmentList::const_iterator vi;
+            for (vi = s->mBoneAssignments.begin();
+            vi != s->mBoneAssignments.end(); ++vi)
+            {
+                writeSubMeshBoneAssignment(vi->second);
+            }
+
+            LogManager::getSingleton().logMessage("Dedicated geometry bone assignments exported.");
+        }
+
+
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::writeExtremes(const Mesh *pMesh)
+    {
+        bool has_extremes = false;
+        for (int i = 0; i < pMesh->getNumSubMeshes(); ++i)
+        {
+            SubMesh *sm = pMesh->getSubMesh(i);
+            if (sm->extremityPoints.empty())
+                continue;
+            if (!has_extremes)
+            {
+                has_extremes = true;
+                LogManager::getSingleton().logMessage("Writing submesh extremes...");
+            }
+            writeSubMeshExtremes(i, sm);
+        }
+        if (has_extremes)
+            LogManager::getSingleton().logMessage("Extremes exported.");
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::writeSubMeshExtremes(unsigned short idx, const SubMesh* s)
+    {
+        size_t chunkSize = STREAM_OVERHEAD_SIZE + sizeof (unsigned short) +
+            s->extremityPoints.size () * sizeof (float) * 3;
+        writeChunkHeader(M_TABLE_EXTREMES, chunkSize);
+
+        writeShorts(&idx, 1);
+
+        float *vertices = new float [s->extremityPoints.size() * 3];
+		float *pVert = vertices;
+
+        for (std::vector<Vector3>::const_iterator i = s->extremityPoints.begin();
+             i != s->extremityPoints.end(); ++i)
+        {
+			*pVert++ = i->x;
+			*pVert++ = i->y;
+			*pVert++ = i->z;
+        }
+
+        writeFloats(vertices, s->extremityPoints.size () * 3);
+        delete [] vertices;
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::writeSubMeshTextureAliases(const SubMesh* s)
+    {
+        size_t chunkSize;
+        AliasTextureNamePairList::const_iterator i;
+
+		LogManager::getSingleton().logMessage("Exporting submesh texture aliases...");
+
+        // iterate through texture aliases and write them out as a chunk
+        for (i = s->mTextureAliases.begin(); i != s->mTextureAliases.end(); ++i)
+        {
+            // calculate chunk size based on string length + 1.  Add 1 for the line feed.
+            chunkSize = STREAM_OVERHEAD_SIZE + i->first.length() + i->second.length() + 2;
+			writeChunkHeader(M_SUBMESH_TEXTURE_ALIAS, chunkSize);
+            // write out alias name
+            writeString(i->first);
+            // write out texture name
+            writeString(i->second);
+        }
+
+		LogManager::getSingleton().logMessage("Submesh texture aliases exported.");
+    }
+
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::writeSubMeshOperation(const SubMesh* sm)
+    {
+        // Header
+        writeChunkHeader(M_SUBMESH_OPERATION, calcSubMeshOperationSize(sm));
+
+        // unsigned short operationType
+        unsigned short opType = static_cast<unsigned short>(sm->operationType);
+        writeShorts(&opType, 1);
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::writeGeometry(const VertexData* vertexData)
+    {
+		// calc size
+        const VertexDeclaration::VertexElementList& elemList =
+            vertexData->vertexDeclaration->getElements();
+        const VertexBufferBinding::VertexBufferBindingMap& bindings =
+            vertexData->vertexBufferBinding->getBindings();
+        VertexBufferBinding::VertexBufferBindingMap::const_iterator vbi, vbiend;
+
+		size_t size = STREAM_OVERHEAD_SIZE + sizeof(unsigned int) + // base
+			(STREAM_OVERHEAD_SIZE + elemList.size() * (STREAM_OVERHEAD_SIZE + sizeof(unsigned short) * 5)); // elements
+        vbiend = bindings.end();
+		for (vbi = bindings.begin(); vbi != vbiend; ++vbi)
+		{
+			const HardwareVertexBufferSharedPtr& vbuf = vbi->second;
+			size += (STREAM_OVERHEAD_SIZE * 2) + (sizeof(unsigned short) * 2) + vbuf->getSizeInBytes();
+		}
+
+		// Header
+        writeChunkHeader(M_GEOMETRY, size);
+
+        unsigned int vertexCount = vertexData->vertexCount;
+        writeInts(&vertexCount, 1);
+
+		// Vertex declaration
+		size = STREAM_OVERHEAD_SIZE + elemList.size() * (STREAM_OVERHEAD_SIZE + sizeof(unsigned short) * 5);
+		writeChunkHeader(M_GEOMETRY_VERTEX_DECLARATION, size);
+
+        VertexDeclaration::VertexElementList::const_iterator vei, veiend;
+		veiend = elemList.end();
+		unsigned short tmp;
+		size = STREAM_OVERHEAD_SIZE + sizeof(unsigned short) * 5;
+		for (vei = elemList.begin(); vei != veiend; ++vei)
+		{
+			const VertexElement& elem = *vei;
+			writeChunkHeader(M_GEOMETRY_VERTEX_ELEMENT, size);
+			// unsigned short source;  	// buffer bind source
+			tmp = elem.getSource();
+			writeShorts(&tmp, 1);
+			// unsigned short type;    	// VertexElementType
+			tmp = static_cast<unsigned short>(elem.getType());
+			writeShorts(&tmp, 1);
+			// unsigned short semantic; // VertexElementSemantic
+			tmp = static_cast<unsigned short>(elem.getSemantic());
+			writeShorts(&tmp, 1);
+			// unsigned short offset;	// start offset in buffer in bytes
+			tmp = static_cast<unsigned short>(elem.getOffset());
+			writeShorts(&tmp, 1);
+			// unsigned short index;	// index of the semantic (for colours and texture coords)
+			tmp = elem.getIndex();
+			writeShorts(&tmp, 1);
+
+		}
+
+		// Buffers and bindings
+		vbiend = bindings.end();
+		for (vbi = bindings.begin(); vbi != vbiend; ++vbi)
+		{
+			const HardwareVertexBufferSharedPtr& vbuf = vbi->second;
+			size = (STREAM_OVERHEAD_SIZE * 2) + (sizeof(unsigned short) * 2) + vbuf->getSizeInBytes();
+			writeChunkHeader(M_GEOMETRY_VERTEX_BUFFER,  size);
+			// unsigned short bindIndex;	// Index to bind this buffer to
+			tmp = vbi->first;
+			writeShorts(&tmp, 1);
+			// unsigned short vertexSize;	// Per-vertex size, must agree with declaration at this index
+			tmp = (unsigned short)vbuf->getVertexSize();
+			writeShorts(&tmp, 1);
+
+			// Data
+			size = STREAM_OVERHEAD_SIZE + vbuf->getSizeInBytes();
+			writeChunkHeader(M_GEOMETRY_VERTEX_BUFFER_DATA, size);
+			void* pBuf = vbuf->lock(HardwareBuffer::HBL_READ_ONLY);
+
+			if (mFlipEndian)
+			{
+				// endian conversion
+				// Copy data
+				unsigned char* tempData = new unsigned char[vbuf->getSizeInBytes()];
+				memcpy(tempData, pBuf, vbuf->getSizeInBytes());
+				flipToLittleEndian(
+					tempData,
+					vertexData->vertexCount,
+					vbuf->getVertexSize(),
+					vertexData->vertexDeclaration->findElementsBySource(vbi->first));
+				writeData(tempData, vbuf->getVertexSize(), vertexData->vertexCount);
+				delete [] tempData;
+			}
+			else
+			{
+				writeData(pBuf, vbuf->getVertexSize(), vertexData->vertexCount);
+			}
+            vbuf->unlock();
+		}
+
+
+    }
+    //---------------------------------------------------------------------
+	size_t MeshSerializerImpl::calcSubMeshNameTableSize(const Mesh* pMesh)
+	{
+		size_t size = STREAM_OVERHEAD_SIZE;
+		// Figure out the size of the Name table.
+		// Iterate through the subMeshList & add up the size of the indexes and names.
+		Mesh::SubMeshNameMap::const_iterator it = pMesh->mSubMeshNameMap.begin();
+		while(it != pMesh->mSubMeshNameMap.end())
+		{
+			// size of the index + header size for each element chunk
+			size += STREAM_OVERHEAD_SIZE + sizeof(uint16);
+			// name
+			size += it->first.length() + 1;
+
+			++it;
+		}
+
+		// size of the sub-mesh name table.
+		return size;
+	}
+    //---------------------------------------------------------------------
+    size_t MeshSerializerImpl::calcMeshSize(const Mesh* pMesh)
+    {
+        size_t size = STREAM_OVERHEAD_SIZE;
+
+        // Num shared vertices
+        size += sizeof(uint32);
+
+        // Geometry
+        if (pMesh->sharedVertexData && pMesh->sharedVertexData->vertexCount > 0)
+        {
+            size += calcGeometrySize(pMesh->sharedVertexData);
+        }
+
+        // Submeshes
+        for (unsigned short i = 0; i < pMesh->getNumSubMeshes(); ++i)
+        {
+            size += calcSubMeshSize(pMesh->getSubMesh(i));
+        }
+
+        // Skeleton link
+        if (pMesh->hasSkeleton())
+        {
+            size += calcSkeletonLinkSize(pMesh->getSkeletonName());
+        }
+
+		// Submesh name table
+		size += calcSubMeshNameTableSize(pMesh);
+
+		// Edge list
+		if (pMesh->isEdgeListBuilt())
+		{
+			size += calcEdgeListSize(pMesh);
+		}
+
+		// Animations
+		for (unsigned short a = 0; a < pMesh->getNumAnimations(); ++a)
+		{
+			Animation* anim = pMesh->getAnimation(a);
+			size += calcAnimationSize(anim);
+		}
+
+		return size;
+    }
+    //---------------------------------------------------------------------
+    size_t MeshSerializerImpl::calcSubMeshSize(const SubMesh* pSub)
+    {
+        size_t size = STREAM_OVERHEAD_SIZE;
+
+        // Material name
+        size += pSub->getMaterialName().length() + 1;
+
+        // bool useSharedVertices
+        size += sizeof(bool);
+        // unsigned int indexCount
+        size += sizeof(unsigned int);
+        // bool indexes32bit
+        size += sizeof(bool);
+        // unsigned int* faceVertexIndices
+        size += sizeof(unsigned int) * pSub->indexData->indexCount;
+
+        // Geometry
+        if (!pSub->useSharedVertices)
+        {
+            size += calcGeometrySize(pSub->vertexData);
+        }
+
+        size += calcSubMeshTextureAliasesSize(pSub);
+        size += calcSubMeshOperationSize(pSub);
+
+        // Bone assignments
+        if (!pSub->mBoneAssignments.empty())
+        {
+            SubMesh::VertexBoneAssignmentList::const_iterator vi;
+            for (vi = pSub->mBoneAssignments.begin();
+                 vi != pSub->mBoneAssignments.end(); ++vi)
+            {
+                size += calcBoneAssignmentSize();
+            }
+        }
+
+        return size;
+    }
+    //---------------------------------------------------------------------
+    size_t MeshSerializerImpl::calcSubMeshOperationSize(const SubMesh* pSub)
+    {
+        return STREAM_OVERHEAD_SIZE + sizeof(uint16);
+    }
+    //---------------------------------------------------------------------
+    size_t MeshSerializerImpl::calcSubMeshTextureAliasesSize(const SubMesh* pSub)
+    {
+        size_t chunkSize = 0;
+        AliasTextureNamePairList::const_iterator i;
+
+        // iterate through texture alias map and calc size of strings
+        for (i = pSub->mTextureAliases.begin(); i != pSub->mTextureAliases.end(); ++i)
+        {
+            // calculate chunk size based on string length + 1.  Add 1 for the line feed.
+            chunkSize += STREAM_OVERHEAD_SIZE + i->first.length() + i->second.length() + 2;
+        }
+
+        return chunkSize;
+    }
+    //---------------------------------------------------------------------
+    size_t MeshSerializerImpl::calcGeometrySize(const VertexData* vertexData)
+    {
+        size_t size = STREAM_OVERHEAD_SIZE;
+
+        // Num vertices
+        size += sizeof(unsigned int);
+
+        const VertexDeclaration::VertexElementList& elems =
+            vertexData->vertexDeclaration->getElements();
+
+        VertexDeclaration::VertexElementList::const_iterator i, iend;
+        iend = elems.end();
+        for (i = elems.begin(); i != iend; ++i)
+        {
+            const VertexElement& elem = *i;
+            // Vertex element
+            size += VertexElement::getTypeSize(elem.getType()) * vertexData->vertexCount;
+        }
+        return size;
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::readGeometry(DataStreamPtr& stream, Mesh* pMesh,
+        VertexData* dest)
+    {
+
+        dest->vertexStart = 0;
+
+        unsigned int vertexCount = 0;
+        readInts(stream, &vertexCount, 1);
+        dest->vertexCount = vertexCount;
+
+        // Find optional geometry streams
+        if (!stream->eof())
+        {
+            unsigned short streamID = readChunk(stream);
+            while(!stream->eof() &&
+                (streamID == M_GEOMETRY_VERTEX_DECLARATION ||
+                 streamID == M_GEOMETRY_VERTEX_BUFFER ))
+            {
+                switch (streamID)
+                {
+                case M_GEOMETRY_VERTEX_DECLARATION:
+                    readGeometryVertexDeclaration(stream, pMesh, dest);
+                    break;
+                case M_GEOMETRY_VERTEX_BUFFER:
+                    readGeometryVertexBuffer(stream, pMesh, dest);
+                    break;
+                }
+                // Get next stream
+                if (!stream->eof())
+                {
+                    streamID = readChunk(stream);
+                }
+            }
+            if (!stream->eof())
+            {
+                // Backpedal back to start of non-submesh stream
+                stream->skip(-STREAM_OVERHEAD_SIZE);
+            }
+        }
+
+		// Perform any necessary colour conversion for an active rendersystem
+		if (Root::getSingletonPtr() && Root::getSingleton().getRenderSystem())
+		{
+			// We don't know the source type if it's VET_COLOUR, but assume ARGB
+			// since that's the most common. Won't get used unless the mesh is
+			// ambiguous anyway, which will have been warned about in the log
+			dest->convertPackedColour(VET_COLOUR_ARGB, 
+				VertexElement::getBestColourVertexElementType());
+		}
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::readGeometryVertexDeclaration(DataStreamPtr& stream,
+        Mesh* pMesh, VertexData* dest)
+    {
+        // Find optional geometry streams
+        if (!stream->eof())
+        {
+            unsigned short streamID = readChunk(stream);
+            while(!stream->eof() &&
+                (streamID == M_GEOMETRY_VERTEX_ELEMENT ))
+            {
+                switch (streamID)
+                {
+                case M_GEOMETRY_VERTEX_ELEMENT:
+                    readGeometryVertexElement(stream, pMesh, dest);
+                    break;
+                }
+                // Get next stream
+                if (!stream->eof())
+                {
+                    streamID = readChunk(stream);
+                }
+            }
+            if (!stream->eof())
+            {
+                // Backpedal back to start of non-submesh stream
+                stream->skip(-STREAM_OVERHEAD_SIZE);
+            }
+        }
+
+	}
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::readGeometryVertexElement(DataStreamPtr& stream,
+        Mesh* pMesh, VertexData* dest)
+    {
+		unsigned short source, offset, index, tmp;
+		VertexElementType vType;
+		VertexElementSemantic vSemantic;
+		// unsigned short source;  	// buffer bind source
+		readShorts(stream, &source, 1);
+		// unsigned short type;    	// VertexElementType
+		readShorts(stream, &tmp, 1);
+		vType = static_cast<VertexElementType>(tmp);
+		// unsigned short semantic; // VertexElementSemantic
+		readShorts(stream, &tmp, 1);
+		vSemantic = static_cast<VertexElementSemantic>(tmp);
+		// unsigned short offset;	// start offset in buffer in bytes
+		readShorts(stream, &offset, 1);
+		// unsigned short index;	// index of the semantic
+		readShorts(stream, &index, 1);
+
+		dest->vertexDeclaration->addElement(source, offset, vType, vSemantic, index);
+
+		if (vType == VET_COLOUR)
+		{
+			StringUtil::StrStreamType s;
+			s << "Warning: VET_COLOUR element type is deprecated, you should use "
+				<< "one of the more specific types to indicate the byte order. "
+				<< "Use OgreMeshUpgrade on " << pMesh->getName() << " as soon as possible. ";
+			LogManager::getSingleton().logMessage(s.str());
+		}
+
+	}
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::readGeometryVertexBuffer(DataStreamPtr& stream,
+        Mesh* pMesh, VertexData* dest)
+    {
+		unsigned short bindIndex, vertexSize;
+		// unsigned short bindIndex;	// Index to bind this buffer to
+		readShorts(stream, &bindIndex, 1);
+		// unsigned short vertexSize;	// Per-vertex size, must agree with declaration at this index
+		readShorts(stream, &vertexSize, 1);
+
+		// Check for vertex data header
+		unsigned short headerID;
+		headerID = readChunk(stream);
+		if (headerID != M_GEOMETRY_VERTEX_BUFFER_DATA)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Can't find vertex buffer data area",
+            	"MeshSerializerImpl::readGeometryVertexBuffer");
+		}
+		// Check that vertex size agrees
+		if (dest->vertexDeclaration->getVertexSize(bindIndex) != vertexSize)
+		{
+			OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Buffer vertex size does not agree with vertex declaration",
+            	"MeshSerializerImpl::readGeometryVertexBuffer");
+		}
+
+		// Create / populate vertex buffer
+		HardwareVertexBufferSharedPtr vbuf;
+        vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(
+            vertexSize,
+            dest->vertexCount,
+            pMesh->mVertexBufferUsage,
+			pMesh->mVertexBufferShadowBuffer);
+        void* pBuf = vbuf->lock(HardwareBuffer::HBL_DISCARD);
+        stream->read(pBuf, dest->vertexCount * vertexSize);
+
+		// endian conversion for OSX
+		flipFromLittleEndian(
+			pBuf,
+			dest->vertexCount,
+			vertexSize,
+			dest->vertexDeclaration->findElementsBySource(bindIndex));
+        vbuf->unlock();
+
+		// Set binding
+        dest->vertexBufferBinding->setBinding(bindIndex, vbuf);
+
+	}
+    //---------------------------------------------------------------------
+	void MeshSerializerImpl::readSubMeshNameTable(DataStreamPtr& stream, Mesh* pMesh)
+	{
+		// The map for
+		std::map<unsigned short, String> subMeshNames;
+		unsigned short streamID, subMeshIndex;
+
+		// Need something to store the index, and the objects name
+		// This table is a method that imported meshes can retain their naming
+		// so that the names established in the modelling software can be used
+		// to get the sub-meshes by name. The exporter must support exporting
+		// the optional stream M_SUBMESH_NAME_TABLE.
+
+        // Read in all the sub-streams. Each sub-stream should contain an index and Ogre::String for the name.
+		if (!stream->eof())
+		{
+			streamID = readChunk(stream);
+			while(!stream->eof() && (streamID == M_SUBMESH_NAME_TABLE_ELEMENT ))
+			{
+				// Read in the index of the submesh.
+				readShorts(stream, &subMeshIndex, 1);
+				// Read in the String and map it to its index.
+				subMeshNames[subMeshIndex] = readString(stream);
+
+				// If we're not end of file get the next stream ID
+				if (!stream->eof())
+					streamID = readChunk(stream);
+			}
+			if (!stream->eof())
+			{
+				// Backpedal back to start of stream
+				stream->skip(-STREAM_OVERHEAD_SIZE);
+			}
+		}
+
+		// Set all the submeshes names
+		// ?
+
+		// Loop through and save out the index and names.
+		std::map<unsigned short, String>::const_iterator it = subMeshNames.begin();
+
+		while(it != subMeshNames.end())
+		{
+			// Name this submesh to the stored name.
+			pMesh->nameSubMesh(it->second, it->first);
+			++it;
+		}
+
+
+
+	}
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::readMesh(DataStreamPtr& stream, Mesh* pMesh)
+    {
+        unsigned short streamID;
+
+        // Never automatically build edge lists for this version
+        // expect them in the file or not at all
+        pMesh->mAutoBuildEdgeLists = false;
+
+		// bool skeletallyAnimated
+		bool skeletallyAnimated;
+		readBools(stream, &skeletallyAnimated, 1);
+
+        // Find all substreams
+        if (!stream->eof())
+        {
+            streamID = readChunk(stream);
+            while(!stream->eof() &&
+                (streamID == M_GEOMETRY ||
+				 streamID == M_SUBMESH ||
+                 streamID == M_MESH_SKELETON_LINK ||
+                 streamID == M_MESH_BONE_ASSIGNMENT ||
+				 streamID == M_MESH_LOD ||
+                 streamID == M_MESH_BOUNDS ||
+				 streamID == M_SUBMESH_NAME_TABLE ||
+				 streamID == M_EDGE_LISTS ||
+				 streamID == M_POSES ||
+				 streamID == M_ANIMATIONS ||
+				 streamID == M_TABLE_EXTREMES))
+            {
+                switch(streamID)
+                {
+				case M_GEOMETRY:
+					pMesh->sharedVertexData = new VertexData();
+					try {
+						readGeometry(stream, pMesh, pMesh->sharedVertexData);
+					}
+					catch (Exception& e)
+					{
+						if (e.getNumber() == Exception::ERR_ITEM_NOT_FOUND)
+						{
+							// duff geometry data entry with 0 vertices
+							delete pMesh->sharedVertexData;
+							pMesh->sharedVertexData = 0;
+							// Skip this stream (pointer will have been returned to just after header)
+							stream->skip(mCurrentstreamLen - STREAM_OVERHEAD_SIZE);
+						}
+						else
+						{
+							throw;
+						}
+					}
+					break;
+                case M_SUBMESH:
+                    readSubMesh(stream, pMesh);
+                    break;
+                case M_MESH_SKELETON_LINK:
+                    readSkeletonLink(stream, pMesh);
+                    break;
+                case M_MESH_BONE_ASSIGNMENT:
+                    readMeshBoneAssignment(stream, pMesh);
+                    break;
+                case M_MESH_LOD:
+					readMeshLodInfo(stream, pMesh);
+					break;
+                case M_MESH_BOUNDS:
+                    readBoundsInfo(stream, pMesh);
+                    break;
+				case M_SUBMESH_NAME_TABLE:
+    	            readSubMeshNameTable(stream, pMesh);
+					break;
+                case M_EDGE_LISTS:
+                    readEdgeList(stream, pMesh);
+                    break;
+				case M_POSES:
+					readPoses(stream, pMesh);
+					break;
+				case M_ANIMATIONS:
+					readAnimations(stream, pMesh);
+                    break;
+                case M_TABLE_EXTREMES:
+                    readExtremes(stream, pMesh);
+                    break;
+                }
+
+                if (!stream->eof())
+                {
+                    streamID = readChunk(stream);
+                }
+
+            }
+            if (!stream->eof())
+            {
+                // Backpedal back to start of stream
+                stream->skip(-STREAM_OVERHEAD_SIZE);
+            }
+        }
+
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::readSubMesh(DataStreamPtr& stream, Mesh* pMesh)
+    {
+        unsigned short streamID;
+
+        SubMesh* sm = pMesh->createSubMesh();
+        // char* materialName
+        String materialName = readString(stream);
+        sm->setMaterialName(materialName);
+        // bool useSharedVertices
+        readBools(stream,&sm->useSharedVertices, 1);
+
+        sm->indexData->indexStart = 0;
+        unsigned int indexCount = 0;
+        readInts(stream, &indexCount, 1);
+        sm->indexData->indexCount = indexCount;
+
+        HardwareIndexBufferSharedPtr ibuf;
+        // bool indexes32Bit
+        bool idx32bit;
+        readBools(stream, &idx32bit, 1);
+        if (idx32bit)
+        {
+            ibuf = HardwareBufferManager::getSingleton().
+                createIndexBuffer(
+                    HardwareIndexBuffer::IT_32BIT,
+                    sm->indexData->indexCount,
+                    pMesh->mIndexBufferUsage,
+					pMesh->mIndexBufferShadowBuffer);
+            // unsigned int* faceVertexIndices
+            unsigned int* pIdx = static_cast<unsigned int*>(
+                ibuf->lock(HardwareBuffer::HBL_DISCARD)
+                );
+            readInts(stream, pIdx, sm->indexData->indexCount);
+            ibuf->unlock();
+
+        }
+        else // 16-bit
+        {
+            ibuf = HardwareBufferManager::getSingleton().
+                createIndexBuffer(
+                    HardwareIndexBuffer::IT_16BIT,
+                    sm->indexData->indexCount,
+                    pMesh->mIndexBufferUsage,
+					pMesh->mIndexBufferShadowBuffer);
+            // unsigned short* faceVertexIndices
+            unsigned short* pIdx = static_cast<unsigned short*>(
+                ibuf->lock(HardwareBuffer::HBL_DISCARD)
+                );
+            readShorts(stream, pIdx, sm->indexData->indexCount);
+            ibuf->unlock();
+        }
+        sm->indexData->indexBuffer = ibuf;
+
+        // M_GEOMETRY stream (Optional: present only if useSharedVertices = false)
+        if (!sm->useSharedVertices)
+        {
+            streamID = readChunk(stream);
+            if (streamID != M_GEOMETRY)
+            {
+                OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Missing geometry data in mesh file",
+                    "MeshSerializerImpl::readSubMesh");
+            }
+            sm->vertexData = new VertexData();
+            readGeometry(stream, pMesh, sm->vertexData);
+        }
+
+
+        // Find all bone assignments, submesh operation, and texture aliases (if present)
+        if (!stream->eof())
+        {
+            streamID = readChunk(stream);
+            while(!stream->eof() &&
+                (streamID == M_SUBMESH_BONE_ASSIGNMENT ||
+                 streamID == M_SUBMESH_OPERATION ||
+                 streamID == M_SUBMESH_TEXTURE_ALIAS))
+            {
+                switch(streamID)
+                {
+                case M_SUBMESH_OPERATION:
+                    readSubMeshOperation(stream, pMesh, sm);
+                    break;
+                case M_SUBMESH_BONE_ASSIGNMENT:
+                    readSubMeshBoneAssignment(stream, pMesh, sm);
+                    break;
+                case M_SUBMESH_TEXTURE_ALIAS:
+                    readSubMeshTextureAlias(stream, pMesh, sm);
+                    break;
+                }
+
+                if (!stream->eof())
+                {
+                    streamID = readChunk(stream);
+                }
+
+            }
+            if (!stream->eof())
+            {
+                // Backpedal back to start of stream
+                stream->skip(-STREAM_OVERHEAD_SIZE);
+            }
+        }
+
+
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::readSubMeshOperation(DataStreamPtr& stream,
+        Mesh* pMesh, SubMesh* sm)
+    {
+        // unsigned short operationType
+        unsigned short opType;
+        readShorts(stream, &opType, 1);
+        sm->operationType = static_cast<RenderOperation::OperationType>(opType);
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::readSubMeshTextureAlias(DataStreamPtr& stream, Mesh* pMesh, SubMesh* sub)
+    {
+        String aliasName = readString(stream);
+        String textureName = readString(stream);
+        sub->addTextureAlias(aliasName, textureName);
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::writeSkeletonLink(const String& skelName)
+    {
+        writeChunkHeader(M_MESH_SKELETON_LINK, calcSkeletonLinkSize(skelName));
+
+        writeString(skelName);
+
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::readSkeletonLink(DataStreamPtr& stream, Mesh* pMesh)
+    {
+        String skelName = readString(stream);
+        pMesh->setSkeletonName(skelName);
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::readTextureLayer(DataStreamPtr& stream, Mesh* pMesh,
+        MaterialPtr& pMat)
+    {
+        // Material definition section phased out of 1.1
+    }
+    //---------------------------------------------------------------------
+    size_t MeshSerializerImpl::calcSkeletonLinkSize(const String& skelName)
+    {
+        size_t size = STREAM_OVERHEAD_SIZE;
+
+        size += skelName.length() + 1;
+
+        return size;
+
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::writeMeshBoneAssignment(const VertexBoneAssignment& assign)
+    {
+        writeChunkHeader(M_MESH_BONE_ASSIGNMENT, calcBoneAssignmentSize());
+
+        // unsigned int vertexIndex;
+        writeInts(&(assign.vertexIndex), 1);
+        // unsigned short boneIndex;
+        writeShorts(&(assign.boneIndex), 1);
+        // float weight;
+        writeFloats(&(assign.weight), 1);
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::writeSubMeshBoneAssignment(const VertexBoneAssignment& assign)
+    {
+        writeChunkHeader(M_SUBMESH_BONE_ASSIGNMENT, calcBoneAssignmentSize());
+
+        // unsigned int vertexIndex;
+        writeInts(&(assign.vertexIndex), 1);
+        // unsigned short boneIndex;
+        writeShorts(&(assign.boneIndex), 1);
+        // float weight;
+        writeFloats(&(assign.weight), 1);
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::readMeshBoneAssignment(DataStreamPtr& stream, Mesh* pMesh)
+    {
+        VertexBoneAssignment assign;
+
+        // unsigned int vertexIndex;
+        readInts(stream, &(assign.vertexIndex),1);
+        // unsigned short boneIndex;
+        readShorts(stream, &(assign.boneIndex),1);
+        // float weight;
+        readFloats(stream, &(assign.weight), 1);
+
+        pMesh->addBoneAssignment(assign);
+
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::readSubMeshBoneAssignment(DataStreamPtr& stream,
+        Mesh* pMesh, SubMesh* sub)
+    {
+        VertexBoneAssignment assign;
+
+        // unsigned int vertexIndex;
+        readInts(stream, &(assign.vertexIndex),1);
+        // unsigned short boneIndex;
+        readShorts(stream, &(assign.boneIndex),1);
+        // float weight;
+        readFloats(stream, &(assign.weight), 1);
+
+        sub->addBoneAssignment(assign);
+
+    }
+    //---------------------------------------------------------------------
+    size_t MeshSerializerImpl::calcBoneAssignmentSize(void)
+    {
+        size_t size = STREAM_OVERHEAD_SIZE;
+
+        // Vert index
+        size += sizeof(unsigned int);
+        // Bone index
+        size += sizeof(unsigned short);
+        // weight
+        size += sizeof(float);
+
+        return size;
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::writeLodInfo(const Mesh* pMesh)
+    {
+        unsigned short numLods = pMesh->getNumLodLevels();
+        bool manual = pMesh->isLodManual();
+        writeLodSummary(numLods, manual);
+
+		// Loop from LOD 1 (not 0, this is full detail)
+        for (unsigned short i = 1; i < numLods; ++i)
+        {
+			const MeshLodUsage& usage = pMesh->getLodLevel(i);
+			if (manual)
+			{
+				writeLodUsageManual(usage);
+			}
+			else
+			{
+				writeLodUsageGenerated(pMesh, usage, i);
+			}
+
+        }
+
+
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::writeLodSummary(unsigned short numLevels, bool manual)
+    {
+        // Header
+        size_t size = STREAM_OVERHEAD_SIZE;
+        // unsigned short numLevels;
+        size += sizeof(unsigned short);
+        // bool manual;  (true for manual alternate meshes, false for generated)
+        size += sizeof(bool);
+        writeChunkHeader(M_MESH_LOD, size);
+
+        // Details
+        // unsigned short numLevels;
+        writeShorts(&numLevels, 1);
+        // bool manual;  (true for manual alternate meshes, false for generated)
+        writeBools(&manual, 1);
+
+
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::writeLodUsageManual(const MeshLodUsage& usage)
+    {
+        // Header
+        size_t size = STREAM_OVERHEAD_SIZE;
+        size_t manualSize = STREAM_OVERHEAD_SIZE;
+        // float fromDepthSquared;
+        size += sizeof(float);
+        // Manual part size
+
+        // String manualMeshName;
+        manualSize += usage.manualName.length() + 1;
+
+        size += manualSize;
+
+        writeChunkHeader(M_MESH_LOD_USAGE, size);
+        writeFloats(&(usage.fromDepthSquared), 1);
+
+        writeChunkHeader(M_MESH_LOD_MANUAL, manualSize);
+        writeString(usage.manualName);
+
+
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::writeLodUsageGenerated(const Mesh* pMesh, const MeshLodUsage& usage,
+		unsigned short lodNum)
+    {
+		// Usage Header
+        size_t size = STREAM_OVERHEAD_SIZE;
+		unsigned short subidx;
+
+        // float fromDepthSquared;
+        size += sizeof(float);
+
+        // Calc generated SubMesh sections size
+		for(subidx = 0; subidx < pMesh->getNumSubMeshes(); ++subidx)
+		{
+			// header
+			size += STREAM_OVERHEAD_SIZE;
+			// unsigned int numFaces;
+			size += sizeof(unsigned int);
+			SubMesh* sm = pMesh->getSubMesh(subidx);
+            const IndexData* indexData = sm->mLodFaceList[lodNum - 1];
+
+            // bool indexes32Bit
+			size += sizeof(bool);
+			// unsigned short*/int* faceIndexes;
+            if (indexData->indexBuffer->getType() == HardwareIndexBuffer::IT_32BIT)
+            {
+			    size += static_cast<unsigned long>(
+                    sizeof(unsigned int) * indexData->indexCount);
+            }
+            else
+            {
+			    size += static_cast<unsigned long>(
+                    sizeof(unsigned short) * indexData->indexCount);
+            }
+
+		}
+
+        writeChunkHeader(M_MESH_LOD_USAGE, size);
+        writeFloats(&(usage.fromDepthSquared), 1);
+
+		// Now write sections
+        // Calc generated SubMesh sections size
+		for(subidx = 0; subidx < pMesh->getNumSubMeshes(); ++subidx)
+		{
+			size = STREAM_OVERHEAD_SIZE;
+			// unsigned int numFaces;
+			size += sizeof(unsigned int);
+			SubMesh* sm = pMesh->getSubMesh(subidx);
+            const IndexData* indexData = sm->mLodFaceList[lodNum - 1];
+            // bool indexes32Bit
+			size += sizeof(bool);
+			// unsigned short*/int* faceIndexes;
+            if (indexData->indexBuffer->getType() == HardwareIndexBuffer::IT_32BIT)
+            {
+			    size += static_cast<unsigned long>(
+                    sizeof(unsigned int) * indexData->indexCount);
+            }
+            else
+            {
+			    size += static_cast<unsigned long>(
+                    sizeof(unsigned short) * indexData->indexCount);
+            }
+
+			writeChunkHeader(M_MESH_LOD_GENERATED, size);
+			unsigned int idxCount = static_cast<unsigned int>(indexData->indexCount);
+			writeInts(&idxCount, 1);
+            // Lock index buffer to write
+            HardwareIndexBufferSharedPtr ibuf = indexData->indexBuffer;
+			// bool indexes32bit
+			bool idx32 = (ibuf->getType() == HardwareIndexBuffer::IT_32BIT);
+			writeBools(&idx32, 1);
+            if (idx32)
+            {
+                unsigned int* pIdx = static_cast<unsigned int*>(
+                    ibuf->lock(HardwareBuffer::HBL_READ_ONLY));
+			    writeInts(pIdx, indexData->indexCount);
+                ibuf->unlock();
+            }
+            else
+            {
+                unsigned short* pIdx = static_cast<unsigned short*>(
+                    ibuf->lock(HardwareBuffer::HBL_READ_ONLY));
+			    writeShorts(pIdx, indexData->indexCount);
+                ibuf->unlock();
+            }
+		}
+
+
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::writeBoundsInfo(const Mesh* pMesh)
+    {
+		// Usage Header
+        unsigned long size = STREAM_OVERHEAD_SIZE;
+
+        size += sizeof(float) * 7;
+        writeChunkHeader(M_MESH_BOUNDS, size);
+
+        // float minx, miny, minz
+        const Vector3& min = pMesh->mAABB.getMinimum();
+        const Vector3& max = pMesh->mAABB.getMaximum();
+        writeFloats(&min.x, 1);
+        writeFloats(&min.y, 1);
+        writeFloats(&min.z, 1);
+        // float maxx, maxy, maxz
+        writeFloats(&max.x, 1);
+        writeFloats(&max.y, 1);
+        writeFloats(&max.z, 1);
+        // float radius
+        writeFloats(&pMesh->mBoundRadius, 1);
+
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::readBoundsInfo(DataStreamPtr& stream, Mesh* pMesh)
+    {
+        Vector3 min, max;
+        // float minx, miny, minz
+        readFloats(stream, &min.x, 1);
+        readFloats(stream, &min.y, 1);
+        readFloats(stream, &min.z, 1);
+        // float maxx, maxy, maxz
+        readFloats(stream, &max.x, 1);
+        readFloats(stream, &max.y, 1);
+        readFloats(stream, &max.z, 1);
+        AxisAlignedBox box(min, max);
+        pMesh->_setBounds(box, true);
+        // float radius
+        float radius;
+        readFloats(stream, &radius, 1);
+        pMesh->_setBoundingSphereRadius(radius);
+
+
+
+    }
+    //---------------------------------------------------------------------
+	void MeshSerializerImpl::readMeshLodInfo(DataStreamPtr& stream, Mesh* pMesh)
+	{
+		unsigned short streamID, i;
+
+        // unsigned short numLevels;
+		readShorts(stream, &(pMesh->mNumLods), 1);
+        // bool manual;  (true for manual alternate meshes, false for generated)
+		readBools(stream, &(pMesh->mIsLodManual), 1);
+
+		// Preallocate submesh lod face data if not manual
+		if (!pMesh->mIsLodManual)
+		{
+			unsigned short numsubs = pMesh->getNumSubMeshes();
+			for (i = 0; i < numsubs; ++i)
+			{
+				SubMesh* sm = pMesh->getSubMesh(i);
+				sm->mLodFaceList.resize(pMesh->mNumLods-1);
+			}
+		}
+
+		// Loop from 1 rather than 0 (full detail index is not in file)
+		for (i = 1; i < pMesh->mNumLods; ++i)
+		{
+			streamID = readChunk(stream);
+			if (streamID != M_MESH_LOD_USAGE)
+			{
+				OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+					"Missing M_MESH_LOD_USAGE stream in " + pMesh->getName(),
+					"MeshSerializerImpl::readMeshLodInfo");
+			}
+			// Read depth
+			MeshLodUsage usage;
+			readFloats(stream, &(usage.fromDepthSquared), 1);
+
+			if (pMesh->isLodManual())
+			{
+				readMeshLodUsageManual(stream, pMesh, i, usage);
+			}
+			else //(!pMesh->isLodManual)
+			{
+				readMeshLodUsageGenerated(stream, pMesh, i, usage);
+			}
+            usage.edgeData = NULL;
+
+			// Save usage
+			pMesh->mMeshLodUsageList.push_back(usage);
+		}
+
+
+	}
+    //---------------------------------------------------------------------
+	void MeshSerializerImpl::readMeshLodUsageManual(DataStreamPtr& stream,
+        Mesh* pMesh, unsigned short lodNum, MeshLodUsage& usage)
+	{
+		unsigned long streamID;
+		// Read detail stream
+		streamID = readChunk(stream);
+		if (streamID != M_MESH_LOD_MANUAL)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+				"Missing M_MESH_LOD_MANUAL stream in " + pMesh->getName(),
+				"MeshSerializerImpl::readMeshLodUsageManual");
+		}
+
+		usage.manualName = readString(stream);
+		usage.manualMesh.setNull(); // will trigger load later
+	}
+    //---------------------------------------------------------------------
+	void MeshSerializerImpl::readMeshLodUsageGenerated(DataStreamPtr& stream,
+        Mesh* pMesh, unsigned short lodNum, MeshLodUsage& usage)
+	{
+		usage.manualName = "";
+		usage.manualMesh.setNull();
+
+		// Get one set of detail per SubMesh
+		unsigned short numSubs, i;
+		unsigned long streamID;
+		numSubs = pMesh->getNumSubMeshes();
+		for (i = 0; i < numSubs; ++i)
+		{
+			streamID = readChunk(stream);
+			if (streamID != M_MESH_LOD_GENERATED)
+			{
+				OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+					"Missing M_MESH_LOD_GENERATED stream in " + pMesh->getName(),
+					"MeshSerializerImpl::readMeshLodUsageGenerated");
+			}
+
+			SubMesh* sm = pMesh->getSubMesh(i);
+			// lodNum - 1 because SubMesh doesn't store full detail LOD
+            sm->mLodFaceList[lodNum - 1] = new IndexData();
+			IndexData* indexData = sm->mLodFaceList[lodNum - 1];
+            // unsigned int numIndexes
+            unsigned int numIndexes;
+			readInts(stream, &numIndexes, 1);
+            indexData->indexCount = static_cast<size_t>(numIndexes);
+            // bool indexes32Bit
+            bool idx32Bit;
+            readBools(stream, &idx32Bit, 1);
+            // unsigned short*/int* faceIndexes;  ((v1, v2, v3) * numFaces)
+            if (idx32Bit)
+            {
+                indexData->indexBuffer = HardwareBufferManager::getSingleton().
+                    createIndexBuffer(HardwareIndexBuffer::IT_32BIT, indexData->indexCount,
+                    pMesh->mIndexBufferUsage, pMesh->mIndexBufferShadowBuffer);
+                unsigned int* pIdx = static_cast<unsigned int*>(
+                    indexData->indexBuffer->lock(
+                        0,
+                        indexData->indexBuffer->getSizeInBytes(),
+                        HardwareBuffer::HBL_DISCARD) );
+
+			    readInts(stream, pIdx, indexData->indexCount);
+                indexData->indexBuffer->unlock();
+
+            }
+            else
+            {
+                indexData->indexBuffer = HardwareBufferManager::getSingleton().
+                    createIndexBuffer(HardwareIndexBuffer::IT_16BIT, indexData->indexCount,
+                    pMesh->mIndexBufferUsage, pMesh->mIndexBufferShadowBuffer);
+                unsigned short* pIdx = static_cast<unsigned short*>(
+                    indexData->indexBuffer->lock(
+                        0,
+                        indexData->indexBuffer->getSizeInBytes(),
+                        HardwareBuffer::HBL_DISCARD) );
+			    readShorts(stream, pIdx, indexData->indexCount);
+                indexData->indexBuffer->unlock();
+
+            }
+
+		}
+	}
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::flipFromLittleEndian(void* pData, size_t vertexCount,
+        size_t vertexSize, const VertexDeclaration::VertexElementList& elems)
+	{
+		if (mFlipEndian)
+		{
+	        flipEndian(pData, vertexCount, vertexSize, elems);
+		}
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::flipToLittleEndian(void* pData, size_t vertexCount,
+			size_t vertexSize, const VertexDeclaration::VertexElementList& elems)
+	{
+		if (mFlipEndian)
+		{
+	        flipEndian(pData, vertexCount, vertexSize, elems);
+		}
+	}
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl::flipEndian(void* pData, size_t vertexCount,
+        size_t vertexSize, const VertexDeclaration::VertexElementList& elems)
+	{
+		void *pBase = pData;
+		for (size_t v = 0; v < vertexCount; ++v)
+		{
+			VertexDeclaration::VertexElementList::const_iterator ei, eiend;
+			eiend = elems.end();
+			for (ei = elems.begin(); ei != eiend; ++ei)
+			{
+				void *pElem;
+				// re-base pointer to the element
+				(*ei).baseVertexPointerToElement(pBase, &pElem);
+				// Flip the endian based on the type
+				size_t typeSize = 0;
+				switch (VertexElement::getBaseType((*ei).getType()))
+				{
+					case VET_FLOAT1:
+						typeSize = sizeof(float);
+						break;
+					case VET_SHORT1:
+						typeSize = sizeof(short);
+						break;
+					case VET_COLOUR:
+					case VET_COLOUR_ABGR:
+					case VET_COLOUR_ARGB:
+						typeSize = sizeof(RGBA);
+						break;
+					case VET_UBYTE4:
+						typeSize = 0; // NO FLIPPING
+						break;
+					default:
+						assert(false); // Should never happen
+				};
+                Serializer::flipEndian(pElem, typeSize,
+					VertexElement::getTypeCount((*ei).getType()));
+
+			}
+
+			pBase = static_cast<void*>(
+				static_cast<unsigned char*>(pBase) + vertexSize);
+
+		}
+	}
+    //---------------------------------------------------------------------
+	size_t MeshSerializerImpl::calcEdgeListSize(const Mesh* pMesh)
+	{
+        size_t size = STREAM_OVERHEAD_SIZE;
+
+        for (ushort i = 0; i < pMesh->getNumLodLevels(); ++i)
+        {
+
+            const EdgeData* edgeData = pMesh->getEdgeList(i);
+            bool isManual = pMesh->isLodManual() && (i > 0);
+
+            size += calcEdgeListLodSize(edgeData, isManual);
+
+        }
+
+        return size;
+	}
+    //---------------------------------------------------------------------
+    size_t MeshSerializerImpl::calcEdgeListLodSize(const EdgeData* edgeData, bool isManual)
+    {
+        size_t size = STREAM_OVERHEAD_SIZE;
+
+        // unsigned short lodIndex
+        size += sizeof(uint16);
+
+        // bool isManual			// If manual, no edge data here, loaded from manual mesh
+        size += sizeof(bool);
+        if (!isManual)
+        {
+            // bool isClosed
+            size += sizeof(bool);
+            // unsigned long numTriangles
+            size += sizeof(uint32);
+            // unsigned long numEdgeGroups
+            size += sizeof(uint32);
+            // Triangle* triangleList
+            size_t triSize = 0;
+            // unsigned long indexSet
+            // unsigned long vertexSet
+            // unsigned long vertIndex[3]
+            // unsigned long sharedVertIndex[3]
+            // float normal[4]
+            triSize += sizeof(uint32) * 8
+                    + sizeof(float) * 4;
+
+            size += triSize * edgeData->triangles.size();
+            // Write the groups
+            for (EdgeData::EdgeGroupList::const_iterator gi = edgeData->edgeGroups.begin();
+                gi != edgeData->edgeGroups.end(); ++gi)
+            {
+                const EdgeData::EdgeGroup& edgeGroup = *gi;
+                size += calcEdgeGroupSize(edgeGroup);
+            }
+
+        }
+
+        return size;
+    }
+    //---------------------------------------------------------------------
+    size_t MeshSerializerImpl::calcEdgeGroupSize(const EdgeData::EdgeGroup& group)
+    {
+        size_t size = STREAM_OVERHEAD_SIZE;
+
+        // unsigned long vertexSet
+        size += sizeof(uint32);
+        // unsigned long triStart
+        size += sizeof(uint32);
+        // unsigned long triCount
+        size += sizeof(uint32);
+        // unsigned long numEdges
+        size += sizeof(uint32);
+        // Edge* edgeList
+        size_t edgeSize = 0;
+        // unsigned long  triIndex[2]
+        // unsigned long  vertIndex[2]
+        // unsigned long  sharedVertIndex[2]
+        // bool degenerate
+        edgeSize += sizeof(uint32) * 6 + sizeof(bool);
+        size += edgeSize * group.edges.size();
+
+        return size;
+    }
+    //---------------------------------------------------------------------
+	void MeshSerializerImpl::writeEdgeList(const Mesh* pMesh)
+	{
+        writeChunkHeader(M_EDGE_LISTS, calcEdgeListSize(pMesh));
+
+        for (ushort i = 0; i < pMesh->getNumLodLevels(); ++i)
+        {
+            const EdgeData* edgeData = pMesh->getEdgeList(i);
+            bool isManual = pMesh->isLodManual() && (i > 0);
+            writeChunkHeader(M_EDGE_LIST_LOD, calcEdgeListLodSize(edgeData, isManual));
+
+            // unsigned short lodIndex
+            writeShorts(&i, 1);
+
+            // bool isManual			// If manual, no edge data here, loaded from manual mesh
+            writeBools(&isManual, 1);
+            if (!isManual)
+            {
+                // bool isClosed
+                writeBools(&edgeData->isClosed, 1);
+                // unsigned long  numTriangles
+                uint32 count = static_cast<uint32>(edgeData->triangles.size());
+                writeInts(&count, 1);
+                // unsigned long numEdgeGroups
+                count = static_cast<uint32>(edgeData->edgeGroups.size());
+                writeInts(&count, 1);
+                // Triangle* triangleList
+                // Iterate rather than writing en-masse to allow endian conversion
+                EdgeData::TriangleList::const_iterator t = edgeData->triangles.begin();
+                EdgeData::TriangleFaceNormalList::const_iterator fni = edgeData->triangleFaceNormals.begin();
+                for ( ; t != edgeData->triangles.end(); ++t, ++fni)
+                {
+                    const EdgeData::Triangle& tri = *t;
+                    // unsigned long indexSet;
+                    uint32 tmp[3];
+                    tmp[0] = tri.indexSet;
+                    writeInts(tmp, 1);
+                    // unsigned long vertexSet;
+                    tmp[0] = tri.vertexSet;
+                    writeInts(tmp, 1);
+                    // unsigned long vertIndex[3];
+                    tmp[0] = tri.vertIndex[0];
+                    tmp[1] = tri.vertIndex[1];
+                    tmp[2] = tri.vertIndex[2];
+                    writeInts(tmp, 3);
+                    // unsigned long sharedVertIndex[3];
+                    tmp[0] = tri.sharedVertIndex[0];
+                    tmp[1] = tri.sharedVertIndex[1];
+                    tmp[2] = tri.sharedVertIndex[2];
+                    writeInts(tmp, 3);
+                    // float normal[4];
+                    writeFloats(&(fni->x), 4);
+
+                }
+                // Write the groups
+                for (EdgeData::EdgeGroupList::const_iterator gi = edgeData->edgeGroups.begin();
+                    gi != edgeData->edgeGroups.end(); ++gi)
+                {
+                    const EdgeData::EdgeGroup& edgeGroup = *gi;
+                    writeChunkHeader(M_EDGE_GROUP, calcEdgeGroupSize(edgeGroup));
+                    // unsigned long vertexSet
+                    uint32 vertexSet = static_cast<uint32>(edgeGroup.vertexSet);
+                    writeInts(&vertexSet, 1);
+                    // unsigned long triStart
+                    uint32 triStart = static_cast<uint32>(edgeGroup.triStart);
+                    writeInts(&triStart, 1);
+                    // unsigned long triCount
+                    uint32 triCount = static_cast<uint32>(edgeGroup.triCount);
+                    writeInts(&triCount, 1);
+                    // unsigned long numEdges
+                    count = static_cast<uint32>(edgeGroup.edges.size());
+                    writeInts(&count, 1);
+                    // Edge* edgeList
+                    // Iterate rather than writing en-masse to allow endian conversion
+                    for (EdgeData::EdgeList::const_iterator ei = edgeGroup.edges.begin();
+                        ei != edgeGroup.edges.end(); ++ei)
+                    {
+                        const EdgeData::Edge& edge = *ei;
+                        uint32 tmp[2];
+                        // unsigned long  triIndex[2]
+                        tmp[0] = edge.triIndex[0];
+                        tmp[1] = edge.triIndex[1];
+                        writeInts(tmp, 2);
+                        // unsigned long  vertIndex[2]
+                        tmp[0] = edge.vertIndex[0];
+                        tmp[1] = edge.vertIndex[1];
+                        writeInts(tmp, 2);
+                        // unsigned long  sharedVertIndex[2]
+                        tmp[0] = edge.sharedVertIndex[0];
+                        tmp[1] = edge.sharedVertIndex[1];
+                        writeInts(tmp, 2);
+                        // bool degenerate
+                        writeBools(&(edge.degenerate), 1);
+                    }
+
+                }
+
+            }
+
+        }
+	}
+    //---------------------------------------------------------------------
+	void MeshSerializerImpl::readEdgeList(DataStreamPtr& stream, Mesh* pMesh)
+	{
+        unsigned short streamID;
+
+        if (!stream->eof())
+        {
+            streamID = readChunk(stream);
+            while(!stream->eof() &&
+                streamID == M_EDGE_LIST_LOD)
+            {
+                // Process single LOD
+
+                // unsigned short lodIndex
+                unsigned short lodIndex;
+                readShorts(stream, &lodIndex, 1);
+
+                // bool isManual			// If manual, no edge data here, loaded from manual mesh
+                bool isManual;
+                readBools(stream, &isManual, 1);
+                // Only load in non-manual levels; others will be connected up by Mesh on demand
+                if (!isManual)
+                {
+                    MeshLodUsage& usage = const_cast<MeshLodUsage&>(pMesh->getLodLevel(lodIndex));
+
+                    usage.edgeData = new EdgeData();
+
+                    // Read detail information of the edge list
+                    readEdgeListLodInfo(stream, usage.edgeData);
+
+                    // Postprocessing edge groups
+                    EdgeData::EdgeGroupList::iterator egi, egend;
+                    egend = usage.edgeData->edgeGroups.end();
+                    for (egi = usage.edgeData->edgeGroups.begin(); egi != egend; ++egi)
+                    {
+                        EdgeData::EdgeGroup& edgeGroup = *egi;
+                        // Populate edgeGroup.vertexData pointers
+                        // If there is shared vertex data, vertexSet 0 is that,
+                        // otherwise 0 is first dedicated
+                        if (pMesh->sharedVertexData)
+                        {
+                            if (edgeGroup.vertexSet == 0)
+                            {
+                                edgeGroup.vertexData = pMesh->sharedVertexData;
+                            }
+                            else
+                            {
+                                edgeGroup.vertexData = pMesh->getSubMesh(
+                                    edgeGroup.vertexSet-1)->vertexData;
+                            }
+                        }
+                        else
+                        {
+                            edgeGroup.vertexData = pMesh->getSubMesh(
+                                edgeGroup.vertexSet)->vertexData;
+                        }
+                    }
+                }
+
+                if (!stream->eof())
+                {
+                    streamID = readChunk(stream);
+                }
+
+            }
+            if (!stream->eof())
+            {
+                // Backpedal back to start of stream
+                stream->skip(-STREAM_OVERHEAD_SIZE);
+            }
+        }
+
+        pMesh->mEdgeListsBuilt = true;
+	}
+	//---------------------------------------------------------------------
+    void MeshSerializerImpl::readEdgeListLodInfo(DataStreamPtr& stream,
+        EdgeData* edgeData)
+    {
+        // bool isClosed
+        readBools(stream, &edgeData->isClosed, 1);
+        // unsigned long numTriangles
+        uint32 numTriangles;
+        readInts(stream, &numTriangles, 1);
+        // Allocate correct amount of memory
+        edgeData->triangles.resize(numTriangles);
+        edgeData->triangleFaceNormals.resize(numTriangles);
+        edgeData->triangleLightFacings.resize(numTriangles);
+        // unsigned long numEdgeGroups
+        uint32 numEdgeGroups;
+        readInts(stream, &numEdgeGroups, 1);
+        // Allocate correct amount of memory
+        edgeData->edgeGroups.resize(numEdgeGroups);
+        // Triangle* triangleList
+        uint32 tmp[3];
+        for (size_t t = 0; t < numTriangles; ++t)
+        {
+            EdgeData::Triangle& tri = edgeData->triangles[t];
+            // unsigned long indexSet
+            readInts(stream, tmp, 1);
+            tri.indexSet = tmp[0];
+            // unsigned long vertexSet
+            readInts(stream, tmp, 1);
+            tri.vertexSet = tmp[0];
+            // unsigned long vertIndex[3]
+            readInts(stream, tmp, 3);
+            tri.vertIndex[0] = tmp[0];
+            tri.vertIndex[1] = tmp[1];
+            tri.vertIndex[2] = tmp[2];
+            // unsigned long sharedVertIndex[3]
+            readInts(stream, tmp, 3);
+            tri.sharedVertIndex[0] = tmp[0];
+            tri.sharedVertIndex[1] = tmp[1];
+            tri.sharedVertIndex[2] = tmp[2];
+            // float normal[4]
+            readFloats(stream, &(edgeData->triangleFaceNormals[t].x), 4);
+
+        }
+
+        for (uint32 eg = 0; eg < numEdgeGroups; ++eg)
+        {
+            unsigned short streamID = readChunk(stream);
+            if (streamID != M_EDGE_GROUP)
+            {
+                OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR,
+                    "Missing M_EDGE_GROUP stream",
+                    "MeshSerializerImpl::readEdgeListLodInfo");
+            }
+            EdgeData::EdgeGroup& edgeGroup = edgeData->edgeGroups[eg];
+
+            // unsigned long vertexSet
+            readInts(stream, tmp, 1);
+            edgeGroup.vertexSet = tmp[0];
+            // unsigned long triStart
+            readInts(stream, tmp, 1);
+            edgeGroup.triStart = tmp[0];
+            // unsigned long triCount
+            readInts(stream, tmp, 1);
+            edgeGroup.triCount = tmp[0];
+            // unsigned long numEdges
+            uint32 numEdges;
+            readInts(stream, &numEdges, 1);
+            edgeGroup.edges.resize(numEdges);
+            // Edge* edgeList
+            for (uint32 e = 0; e < numEdges; ++e)
+            {
+                EdgeData::Edge& edge = edgeGroup.edges[e];
+                // unsigned long  triIndex[2]
+                readInts(stream, tmp, 2);
+                edge.triIndex[0] = tmp[0];
+                edge.triIndex[1] = tmp[1];
+                // unsigned long  vertIndex[2]
+                readInts(stream, tmp, 2);
+                edge.vertIndex[0] = tmp[0];
+                edge.vertIndex[1] = tmp[1];
+                // unsigned long  sharedVertIndex[2]
+                readInts(stream, tmp, 2);
+                edge.sharedVertIndex[0] = tmp[0];
+                edge.sharedVertIndex[1] = tmp[1];
+                // bool degenerate
+                readBools(stream, &(edge.degenerate), 1);
+            }
+        }
+    }
+	//---------------------------------------------------------------------
+	size_t MeshSerializerImpl::calcAnimationsSize(const Mesh* pMesh)
+	{
+		size_t size = STREAM_OVERHEAD_SIZE;
+
+		for (unsigned short a = 0; a < pMesh->getNumAnimations(); ++a)
+		{
+			Animation* anim = pMesh->getAnimation(a);
+			size += calcAnimationSize(anim);
+		}
+		return size;
+
+	}
+	//---------------------------------------------------------------------
+	size_t MeshSerializerImpl::calcAnimationSize(const Animation* anim)
+	{
+		size_t size = STREAM_OVERHEAD_SIZE;
+		// char* name
+		size += anim->getName().length() + 1;
+
+		// float length
+		size += sizeof(float);
+
+		Animation::VertexTrackIterator trackIt = anim->getVertexTrackIterator();
+		while (trackIt.hasMoreElements())
+		{
+			VertexAnimationTrack* vt = trackIt.getNext();
+			size += calcAnimationTrackSize(vt);
+		}
+
+		return size;
+	}
+	//---------------------------------------------------------------------
+	size_t MeshSerializerImpl::calcAnimationTrackSize(const VertexAnimationTrack* track)
+	{
+		size_t size = STREAM_OVERHEAD_SIZE;
+		// uint16 type
+		size += sizeof(uint16);
+		// unsigned short target		// 0 for shared geometry,
+		size += sizeof(unsigned short);
+
+		if (track->getAnimationType() == VAT_MORPH)
+		{
+			for (unsigned short i = 0; i < track->getNumKeyFrames(); ++i)
+			{
+				VertexMorphKeyFrame* kf = track->getVertexMorphKeyFrame(i);
+				size += calcMorphKeyframeSize(kf, track->getAssociatedVertexData()->vertexCount);
+			}
+		}
+		else
+		{
+			for (unsigned short i = 0; i < track->getNumKeyFrames(); ++i)
+			{
+				VertexPoseKeyFrame* kf = track->getVertexPoseKeyFrame(i);
+				size += calcPoseKeyframeSize(kf);
+			}
+		}
+		return size;
+	}
+	//---------------------------------------------------------------------
+	size_t MeshSerializerImpl::calcMorphKeyframeSize(const VertexMorphKeyFrame* kf,
+		size_t vertexCount)
+	{
+		size_t size = STREAM_OVERHEAD_SIZE;
+		// float time
+		size += sizeof(float);
+		// bool isOriginalGeometry  // point at original geometry?
+		size += sizeof(bool);
+		// float x,y,z
+		size += sizeof(float) * 3 * vertexCount;
+
+		return size;
+	}
+	//---------------------------------------------------------------------
+	size_t MeshSerializerImpl::calcPoseKeyframeSize(const VertexPoseKeyFrame* kf)
+	{
+		size_t size = STREAM_OVERHEAD_SIZE;
+
+		// float time
+		size += sizeof(float);
+
+		size += calcPoseKeyframePoseRefSize() * kf->getPoseReferences().size();
+
+		return size;
+
+	}
+	//---------------------------------------------------------------------
+	size_t MeshSerializerImpl::calcPoseKeyframePoseRefSize(void)
+	{
+		size_t size = STREAM_OVERHEAD_SIZE;
+		// unsigned short poseIndex
+		size += sizeof(uint16);
+		// float influence
+		size += sizeof(float);
+
+		return size;
+
+	}
+	//---------------------------------------------------------------------
+	size_t MeshSerializerImpl::calcPosesSize(const Mesh* pMesh)
+	{
+		size_t size = STREAM_OVERHEAD_SIZE;
+
+		Mesh::ConstPoseIterator poseIt = pMesh->getPoseIterator();
+		while (poseIt.hasMoreElements())
+		{
+			size += calcPoseSize(poseIt.getNext());
+		}
+		return size;
+	}
+	//---------------------------------------------------------------------
+	size_t MeshSerializerImpl::calcPoseSize(const Pose* pose)
+	{
+		size_t size = STREAM_OVERHEAD_SIZE;
+
+		// char* name (may be blank)
+		size += pose->getName().length() + 1;
+		// unsigned short target
+		size += sizeof(uint16);
+
+		// vertex offsets
+		size += pose->getVertexOffsets().size() * calcPoseVertexSize();
+
+		return size;
+
+	}
+	//---------------------------------------------------------------------
+	size_t MeshSerializerImpl::calcPoseVertexSize(void)
+	{
+		size_t size = STREAM_OVERHEAD_SIZE;
+		// unsigned long vertexIndex
+		size += sizeof(uint32);
+		// float xoffset, yoffset, zoffset
+		size += sizeof(float) * 3;
+
+		return size;
+	}
+	//---------------------------------------------------------------------
+	void MeshSerializerImpl::writePoses(const Mesh* pMesh)
+	{
+		Mesh::ConstPoseIterator poseIterator = pMesh->getPoseIterator();
+		if (poseIterator.hasMoreElements())
+		{
+			writeChunkHeader(M_POSES, calcPosesSize(pMesh));
+			while (poseIterator.hasMoreElements())
+			{
+				writePose(poseIterator.getNext());
+			}
+		}
+
+	}
+	//---------------------------------------------------------------------
+	void MeshSerializerImpl::writePose(const Pose* pose)
+	{
+		writeChunkHeader(M_POSE, calcPoseSize(pose));
+
+		// char* name (may be blank)
+		writeString(pose->getName());
+
+		// unsigned short target
+		ushort val = pose->getTarget();
+		writeShorts(&val, 1);
+
+		size_t vertexSize = calcPoseVertexSize();
+		Pose::ConstVertexOffsetIterator vit = pose->getVertexOffsetIterator();
+		while (vit.hasMoreElements())
+		{
+			uint32 vertexIndex = (uint32)vit.peekNextKey();
+			Vector3 offset = vit.getNext();
+			writeChunkHeader(M_POSE_VERTEX, vertexSize);
+			// unsigned long vertexIndex
+			writeInts(&vertexIndex, 1);
+			// float xoffset, yoffset, zoffset
+			writeFloats(offset.ptr(), 3);
+		}
+
+
+	}
+	//---------------------------------------------------------------------
+	void MeshSerializerImpl::writeAnimations(const Mesh* pMesh)
+	{
+		writeChunkHeader(M_ANIMATIONS, calcAnimationsSize(pMesh));
+
+		for (unsigned short a = 0; a < pMesh->getNumAnimations(); ++a)
+		{
+			Animation* anim = pMesh->getAnimation(a);
+			LogManager::getSingleton().logMessage("Exporting animation " + anim->getName());
+			writeAnimation(anim);
+			LogManager::getSingleton().logMessage("Animation exported.");
+		}
+	}
+	//---------------------------------------------------------------------
+	void MeshSerializerImpl::writeAnimation(const Animation* anim)
+	{
+		writeChunkHeader(M_ANIMATION, calcAnimationSize(anim));
+		// char* name
+		writeString(anim->getName());
+		// float length
+		float len = anim->getLength();
+		writeFloats(&len, 1);
+		Animation::VertexTrackIterator trackIt = anim->getVertexTrackIterator();
+		while (trackIt.hasMoreElements())
+		{
+			VertexAnimationTrack* vt = trackIt.getNext();
+			writeAnimationTrack(vt);
+		}
+
+
+	}
+    //---------------------------------------------------------------------
+	void MeshSerializerImpl::writeAnimationTrack(const VertexAnimationTrack* track)
+	{
+		writeChunkHeader(M_ANIMATION_TRACK, calcAnimationTrackSize(track));
+		// unsigned short type			// 1 == morph, 2 == pose
+		uint16 animType = (uint16)track->getAnimationType();
+		writeShorts(&animType, 1);
+		// unsigned short target
+		uint16 target = track->getHandle();
+		writeShorts(&target, 1);
+
+		if (track->getAnimationType() == VAT_MORPH)
+		{
+			for (unsigned short i = 0; i < track->getNumKeyFrames(); ++i)
+			{
+				VertexMorphKeyFrame* kf = track->getVertexMorphKeyFrame(i);
+				writeMorphKeyframe(kf, track->getAssociatedVertexData()->vertexCount);
+			}
+		}
+		else // VAT_POSE
+		{
+			for (unsigned short i = 0; i < track->getNumKeyFrames(); ++i)
+			{
+				VertexPoseKeyFrame* kf = track->getVertexPoseKeyFrame(i);
+				writePoseKeyframe(kf);
+			}
+		}
+
+	}
+	//---------------------------------------------------------------------
+	void MeshSerializerImpl::writeMorphKeyframe(const VertexMorphKeyFrame* kf, size_t vertexCount)
+	{
+		writeChunkHeader(M_ANIMATION_MORPH_KEYFRAME, calcMorphKeyframeSize(kf, vertexCount));
+		// float time
+		float timePos = kf->getTime();
+		writeFloats(&timePos, 1);
+		// float x,y,z			// repeat by number of vertices in original geometry
+		float* pSrc = static_cast<float*>(
+			kf->getVertexBuffer()->lock(HardwareBuffer::HBL_READ_ONLY));
+		writeFloats(pSrc, vertexCount * 3);
+		kf->getVertexBuffer()->unlock();
+	}
+	//---------------------------------------------------------------------
+	void MeshSerializerImpl::writePoseKeyframe(const VertexPoseKeyFrame* kf)
+	{
+		writeChunkHeader(M_ANIMATION_POSE_KEYFRAME, calcPoseKeyframeSize(kf));
+		// float time
+		float timePos = kf->getTime();
+		writeFloats(&timePos, 1);
+
+		// pose references
+		VertexPoseKeyFrame::ConstPoseRefIterator poseRefIt =
+			kf->getPoseReferenceIterator();
+		while (poseRefIt.hasMoreElements())
+		{
+			writePoseKeyframePoseRef(poseRefIt.getNext());
+		}
+
+
+
+	}
+	//---------------------------------------------------------------------
+	void MeshSerializerImpl::writePoseKeyframePoseRef(
+		const VertexPoseKeyFrame::PoseRef& poseRef)
+	{
+		writeChunkHeader(M_ANIMATION_POSE_REF, calcPoseKeyframePoseRefSize());
+		// unsigned short poseIndex
+		writeShorts(&(poseRef.poseIndex), 1);
+		// float influence
+		writeFloats(&(poseRef.influence), 1);
+	}
+	//---------------------------------------------------------------------
+	void MeshSerializerImpl::readPoses(DataStreamPtr& stream, Mesh* pMesh)
+	{
+		unsigned short streamID;
+
+		// Find all substreams
+		if (!stream->eof())
+		{
+			streamID = readChunk(stream);
+			while(!stream->eof() &&
+				(streamID == M_POSE))
+			{
+				switch(streamID)
+				{
+				case M_POSE:
+					readPose(stream, pMesh);
+					break;
+
+				}
+
+				if (!stream->eof())
+				{
+					streamID = readChunk(stream);
+				}
+
+			}
+			if (!stream->eof())
+			{
+				// Backpedal back to start of stream
+				stream->skip(-STREAM_OVERHEAD_SIZE);
+			}
+		}
+	}
+	//---------------------------------------------------------------------
+	void MeshSerializerImpl::readPose(DataStreamPtr& stream, Mesh* pMesh)
+	{
+		// char* name (may be blank)
+		String name = readString(stream);
+		// unsigned short target
+		unsigned short target;
+		readShorts(stream, &target, 1);
+
+		Pose* pose = pMesh->createPose(target, name);
+
+		// Find all substreams
+		unsigned short streamID;
+		if (!stream->eof())
+		{
+			streamID = readChunk(stream);
+			while(!stream->eof() &&
+				(streamID == M_POSE_VERTEX))
+			{
+				switch(streamID)
+				{
+				case M_POSE_VERTEX:
+					// create vertex offset
+					uint32 vertIndex;
+					Vector3 offset;
+					// unsigned long vertexIndex
+					readInts(stream, &vertIndex, 1);
+					// float xoffset, yoffset, zoffset
+					readFloats(stream, offset.ptr(), 3);
+
+					pose->addVertex(vertIndex, offset);
+					break;
+
+				}
+
+				if (!stream->eof())
+				{
+					streamID = readChunk(stream);
+				}
+
+			}
+			if (!stream->eof())
+			{
+				// Backpedal back to start of stream
+				stream->skip(-STREAM_OVERHEAD_SIZE);
+			}
+		}
+
+	}
+	//---------------------------------------------------------------------
+	void MeshSerializerImpl::readAnimations(DataStreamPtr& stream, Mesh* pMesh)
+	{
+		unsigned short streamID;
+
+		// Find all substreams
+		if (!stream->eof())
+		{
+			streamID = readChunk(stream);
+			while(!stream->eof() &&
+				(streamID == M_ANIMATION))
+			{
+				switch(streamID)
+				{
+				case M_ANIMATION:
+					readAnimation(stream, pMesh);
+					break;
+
+				}
+
+				if (!stream->eof())
+				{
+					streamID = readChunk(stream);
+				}
+
+			}
+			if (!stream->eof())
+			{
+				// Backpedal back to start of stream
+				stream->skip(-STREAM_OVERHEAD_SIZE);
+			}
+		}
+
+
+	}
+	//---------------------------------------------------------------------
+	void MeshSerializerImpl::readAnimation(DataStreamPtr& stream, Mesh* pMesh)
+	{
+
+		// char* name
+		String name = readString(stream);
+		// float length
+		float len;
+		readFloats(stream, &len, 1);
+
+		Animation* anim = pMesh->createAnimation(name, len);
+
+		// tracks
+		unsigned short streamID;
+
+		if (!stream->eof())
+		{
+			streamID = readChunk(stream);
+			while(!stream->eof() &&
+				streamID == M_ANIMATION_TRACK)
+			{
+				switch(streamID)
+				{
+				case M_ANIMATION_TRACK:
+					readAnimationTrack(stream, anim, pMesh);
+					break;
+				};
+				if (!stream->eof())
+				{
+					streamID = readChunk(stream);
+				}
+
+			}
+			if (!stream->eof())
+			{
+				// Backpedal back to start of stream
+				stream->skip(-STREAM_OVERHEAD_SIZE);
+			}
+		}
+	}
+	//---------------------------------------------------------------------
+	void MeshSerializerImpl::readAnimationTrack(DataStreamPtr& stream,
+		Animation* anim, Mesh* pMesh)
+	{
+		// ushort type
+		uint16 inAnimType;
+		readShorts(stream, &inAnimType, 1);
+		VertexAnimationType animType = (VertexAnimationType)inAnimType;
+
+		// unsigned short target
+		uint16 target;
+		readShorts(stream, &target, 1);
+
+		VertexAnimationTrack* track = anim->createVertexTrack(target,
+			pMesh->getVertexDataByTrackHandle(target), animType);
+
+		// keyframes
+		unsigned short streamID;
+
+		if (!stream->eof())
+		{
+			streamID = readChunk(stream);
+			while(!stream->eof() &&
+				(streamID == M_ANIMATION_MORPH_KEYFRAME ||
+				 streamID == M_ANIMATION_POSE_KEYFRAME))
+			{
+				switch(streamID)
+				{
+				case M_ANIMATION_MORPH_KEYFRAME:
+					readMorphKeyFrame(stream, track);
+					break;
+				case M_ANIMATION_POSE_KEYFRAME:
+					readPoseKeyFrame(stream, track);
+					break;
+				};
+				if (!stream->eof())
+				{
+					streamID = readChunk(stream);
+				}
+
+			}
+			if (!stream->eof())
+			{
+				// Backpedal back to start of stream
+				stream->skip(-STREAM_OVERHEAD_SIZE);
+			}
+		}
+
+	}
+	//---------------------------------------------------------------------
+	void MeshSerializerImpl::readMorphKeyFrame(DataStreamPtr& stream, VertexAnimationTrack* track)
+	{
+		// float time
+		float timePos;
+		readFloats(stream, &timePos, 1);
+
+		VertexMorphKeyFrame* kf = track->createVertexMorphKeyFrame(timePos);
+
+		// Create buffer, allow read and use shadow buffer
+		size_t vertexCount = track->getAssociatedVertexData()->vertexCount;
+		HardwareVertexBufferSharedPtr vbuf =
+			HardwareBufferManager::getSingleton().createVertexBuffer(
+				VertexElement::getTypeSize(VET_FLOAT3), vertexCount,
+				HardwareBuffer::HBU_STATIC, true);
+		// float x,y,z			// repeat by number of vertices in original geometry
+		float* pDst = static_cast<float*>(
+			vbuf->lock(HardwareBuffer::HBL_DISCARD));
+		readFloats(stream, pDst, vertexCount * 3);
+		vbuf->unlock();
+		kf->setVertexBuffer(vbuf);
+
+	}
+	//---------------------------------------------------------------------
+	void MeshSerializerImpl::readPoseKeyFrame(DataStreamPtr& stream, VertexAnimationTrack* track)
+	{
+		// float time
+		float timePos;
+		readFloats(stream, &timePos, 1);
+
+		// Create keyframe
+		VertexPoseKeyFrame* kf = track->createVertexPoseKeyFrame(timePos);
+
+		unsigned short streamID;
+
+		if (!stream->eof())
+		{
+			streamID = readChunk(stream);
+			while(!stream->eof() &&
+				streamID == M_ANIMATION_POSE_REF)
+			{
+				switch(streamID)
+				{
+				case M_ANIMATION_POSE_REF:
+					uint16 poseIndex;
+					float influence;
+					// unsigned short poseIndex
+					readShorts(stream, &poseIndex, 1);
+					// float influence
+					readFloats(stream, &influence, 1);
+
+					kf->addPoseReference(poseIndex, influence);
+
+					break;
+				};
+				if (!stream->eof())
+				{
+					streamID = readChunk(stream);
+				}
+
+			}
+			if (!stream->eof())
+			{
+				// Backpedal back to start of stream
+				stream->skip(-STREAM_OVERHEAD_SIZE);
+			}
+		}
+
+	}
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    MeshSerializerImpl_v1_3::MeshSerializerImpl_v1_3()
+    {
+        // Version number
+        mVersion = "[MeshSerializer_v1.30]";
+    }
+    //---------------------------------------------------------------------
+    MeshSerializerImpl_v1_3::~MeshSerializerImpl_v1_3()
+    {
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl_v1_3::readEdgeListLodInfo(DataStreamPtr& stream,
+        EdgeData* edgeData)
+    {
+        // unsigned long numTriangles
+        uint32 numTriangles;
+        readInts(stream, &numTriangles, 1);
+        // Allocate correct amount of memory
+        edgeData->triangles.resize(numTriangles);
+        edgeData->triangleFaceNormals.resize(numTriangles);
+        edgeData->triangleLightFacings.resize(numTriangles);
+        // unsigned long numEdgeGroups
+        uint32 numEdgeGroups;
+        readInts(stream, &numEdgeGroups, 1);
+        // Allocate correct amount of memory
+        edgeData->edgeGroups.resize(numEdgeGroups);
+        // Triangle* triangleList
+        uint32 tmp[3];
+        for (size_t t = 0; t < numTriangles; ++t)
+        {
+            EdgeData::Triangle& tri = edgeData->triangles[t];
+            // unsigned long indexSet
+            readInts(stream, tmp, 1);
+            tri.indexSet = tmp[0];
+            // unsigned long vertexSet
+            readInts(stream, tmp, 1);
+            tri.vertexSet = tmp[0];
+            // unsigned long vertIndex[3]
+            readInts(stream, tmp, 3);
+            tri.vertIndex[0] = tmp[0];
+            tri.vertIndex[1] = tmp[1];
+            tri.vertIndex[2] = tmp[2];
+            // unsigned long sharedVertIndex[3]
+            readInts(stream, tmp, 3);
+            tri.sharedVertIndex[0] = tmp[0];
+            tri.sharedVertIndex[1] = tmp[1];
+            tri.sharedVertIndex[2] = tmp[2];
+            // float normal[4]
+            readFloats(stream, &(edgeData->triangleFaceNormals[t].x), 4);
+
+        }
+
+        // Assume the mesh is closed, it will update later
+        edgeData->isClosed = true;
+
+        for (uint32 eg = 0; eg < numEdgeGroups; ++eg)
+        {
+            unsigned short streamID = readChunk(stream);
+            if (streamID != M_EDGE_GROUP)
+            {
+                OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR,
+                    "Missing M_EDGE_GROUP stream",
+                    "MeshSerializerImpl_v1_3::readEdgeListLodInfo");
+            }
+            EdgeData::EdgeGroup& edgeGroup = edgeData->edgeGroups[eg];
+
+            // unsigned long vertexSet
+            readInts(stream, tmp, 1);
+            edgeGroup.vertexSet = tmp[0];
+            // unsigned long numEdges
+            uint32 numEdges;
+            readInts(stream, &numEdges, 1);
+            edgeGroup.edges.resize(numEdges);
+            // Edge* edgeList
+            for (uint32 e = 0; e < numEdges; ++e)
+            {
+                EdgeData::Edge& edge = edgeGroup.edges[e];
+                // unsigned long  triIndex[2]
+                readInts(stream, tmp, 2);
+                edge.triIndex[0] = tmp[0];
+                edge.triIndex[1] = tmp[1];
+                // unsigned long  vertIndex[2]
+                readInts(stream, tmp, 2);
+                edge.vertIndex[0] = tmp[0];
+                edge.vertIndex[1] = tmp[1];
+                // unsigned long  sharedVertIndex[2]
+                readInts(stream, tmp, 2);
+                edge.sharedVertIndex[0] = tmp[0];
+                edge.sharedVertIndex[1] = tmp[1];
+                // bool degenerate
+                readBools(stream, &(edge.degenerate), 1);
+
+                // The mesh is closed only if no degenerate edge here
+                if (edge.degenerate)
+                {
+                    edgeData->isClosed = false;
+                }
+            }
+        }
+
+        reorganiseTriangles(edgeData);
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl_v1_3::reorganiseTriangles(EdgeData* edgeData)
+    {
+        size_t numTriangles = edgeData->triangles.size();
+
+        if (edgeData->edgeGroups.size() == 1)
+        {
+            // Special case for only one edge group in the edge list, which occuring
+            // most time. In this case, all triangles belongs to that group.
+            edgeData->edgeGroups.front().triStart = 0;
+            edgeData->edgeGroups.front().triCount = numTriangles;
+        }
+        else
+        {
+            EdgeData::EdgeGroupList::iterator egi, egend;
+            egend = edgeData->edgeGroups.end();
+
+            // Calculate number of triangles for edge groups
+
+            for (egi = edgeData->edgeGroups.begin(); egi != egend; ++egi)
+            {
+                egi->triStart = 0;
+                egi->triCount = 0;
+            }
+
+            bool isGrouped = true;
+            EdgeData::EdgeGroup* lastEdgeGroup = 0;
+            for (size_t t = 0; t < numTriangles; ++t)
+            {
+                // Gets the edge group that the triangle belongs to
+                const EdgeData::Triangle& tri = edgeData->triangles[t];
+                EdgeData::EdgeGroup* edgeGroup = &edgeData->edgeGroups[tri.vertexSet];
+
+                // Does edge group changes from last edge group?
+                if (isGrouped && edgeGroup != lastEdgeGroup)
+                {
+                    // Remember last edge group
+                    lastEdgeGroup = edgeGroup;
+
+                    // Is't first time encounter this edge group?
+                    if (!edgeGroup->triCount && !edgeGroup->triStart)
+                    {
+                        // setup first triangle of this edge group
+                        edgeGroup->triStart = t;
+                    }
+                    else
+                    {
+                        // original triangles doesn't grouping by edge group
+                        isGrouped = false;
+                    }
+                }
+
+                // Count number of triangles for this edge group
+                ++edgeGroup->triCount;
+            }
+
+            //
+            // Note that triangles has been sorted by vertex set for a long time,
+            // but never stored to old version mesh file.
+            //
+            // Adopt this fact to avoid remap triangles here.
+            //
+
+            // Does triangles grouped by vertex set?
+            if (!isGrouped)
+            {
+                // Ok, the triangles of this edge list isn't grouped by vertex set
+                // perfectly, seems ancient mesh file.
+                //
+                // We need work hardly to group triangles by vertex set.
+                //
+
+                // Calculate triStart and reset triCount to zero for each edge group first
+                size_t triStart = 0;
+                for (egi = edgeData->edgeGroups.begin(); egi != egend; ++egi)
+                {
+                    egi->triStart = triStart;
+                    triStart += egi->triCount;
+                    egi->triCount = 0;
+                }
+
+                // The map used to mapping original triangle index to new index
+                typedef std::vector<size_t> TriangleIndexRemap;
+                TriangleIndexRemap triangleIndexRemap(numTriangles);
+
+                // New triangles information that should be group by vertex set.
+                EdgeData::TriangleList newTriangles(numTriangles);
+                EdgeData::TriangleFaceNormalList newTriangleFaceNormals(numTriangles);
+
+                // Calculate triangle index map and organise triangles information
+                for (size_t t = 0; t < numTriangles; ++t)
+                {
+                    // Gets the edge group that the triangle belongs to
+                    const EdgeData::Triangle& tri = edgeData->triangles[t];
+                    EdgeData::EdgeGroup& edgeGroup = edgeData->edgeGroups[tri.vertexSet];
+
+                    // Calculate new index
+                    size_t newIndex = edgeGroup.triStart + edgeGroup.triCount;
+                    ++edgeGroup.triCount;
+
+                    // Setup triangle index mapping entry
+                    triangleIndexRemap[t] = newIndex;
+
+                    // Copy triangle info to new placement
+                    newTriangles[newIndex] = tri;
+                    newTriangleFaceNormals[newIndex] = edgeData->triangleFaceNormals[t];
+                }
+
+                // Replace with new triangles information
+                edgeData->triangles.swap(newTriangles);
+                edgeData->triangleFaceNormals.swap(newTriangleFaceNormals);
+
+                // Now, update old triangle indices to new index
+                for (egi = edgeData->edgeGroups.begin(); egi != egend; ++egi)
+                {
+                    EdgeData::EdgeList::iterator ei, eend;
+                    eend = egi->edges.end();
+                    for (ei = egi->edges.begin(); ei != eend; ++ei)
+                    {
+                        ei->triIndex[0] = triangleIndexRemap[ei->triIndex[0]];
+                        if (!ei->degenerate)
+                        {
+                            ei->triIndex[1] = triangleIndexRemap[ei->triIndex[1]];
+                        }
+                    }
+                }
+            }
+        }
+    }
+	//---------------------------------------------------------------------
+	void MeshSerializerImpl::readExtremes(DataStreamPtr& stream, Mesh *pMesh)
+	{
+		unsigned short idx;
+		readShorts(stream, &idx, 1);
+
+		SubMesh *sm = pMesh->getSubMesh (idx);
+
+		int n_floats = (mCurrentstreamLen - STREAM_OVERHEAD_SIZE -
+						sizeof (unsigned short)) / sizeof (float);
+
+        assert ((n_floats % 3) == 0);
+
+        float *vert = new float[n_floats];
+		readFloats(stream, vert, n_floats);
+
+        for (int i = 0; i < n_floats; i += 3)
+			sm->extremityPoints.push_back(Vector3(vert [i], vert [i + 1], vert [i + 2]));
+
+        delete [] vert;
+	}
+	//---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    MeshSerializerImpl_v1_2::MeshSerializerImpl_v1_2()
+    {
+        // Version number
+        mVersion = "[MeshSerializer_v1.20]";
+    }
+    //---------------------------------------------------------------------
+    MeshSerializerImpl_v1_2::~MeshSerializerImpl_v1_2()
+    {
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl_v1_2::readMesh(DataStreamPtr& stream, Mesh* pMesh)
+    {
+        MeshSerializerImpl::readMesh(stream, pMesh);
+        // Always automatically build edge lists for this version
+        pMesh->mAutoBuildEdgeLists = true;
+
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl_v1_2::readGeometry(DataStreamPtr& stream, Mesh* pMesh,
+        VertexData* dest)
+    {
+        unsigned short texCoordSet = 0;
+
+        unsigned short bindIdx = 0;
+
+        dest->vertexStart = 0;
+
+        unsigned int vertexCount = 0;
+        readInts(stream, &vertexCount, 1);
+        dest->vertexCount = vertexCount;
+
+        // Vertex buffers
+
+        readGeometryPositions(bindIdx, stream, pMesh, dest);
+        ++bindIdx;
+
+        // Find optional geometry streams
+        if (!stream->eof())
+        {
+            unsigned short streamID = readChunk(stream);
+            while(!stream->eof() &&
+                (streamID == M_GEOMETRY_NORMALS ||
+                 streamID == M_GEOMETRY_COLOURS ||
+                 streamID == M_GEOMETRY_TEXCOORDS ))
+            {
+                switch (streamID)
+                {
+                case M_GEOMETRY_NORMALS:
+                    readGeometryNormals(bindIdx++, stream, pMesh, dest);
+                    break;
+                case M_GEOMETRY_COLOURS:
+                    readGeometryColours(bindIdx++, stream, pMesh, dest);
+                    break;
+                case M_GEOMETRY_TEXCOORDS:
+                    readGeometryTexCoords(bindIdx++, stream, pMesh, dest, texCoordSet++);
+                    break;
+                }
+                // Get next stream
+                if (!stream->eof())
+                {
+                    streamID = readChunk(stream);
+                }
+            }
+            if (!stream->eof())
+            {
+                // Backpedal back to start of non-submesh stream
+                stream->skip(-STREAM_OVERHEAD_SIZE);
+            }
+        }
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl_v1_2::readGeometryPositions(unsigned short bindIdx,
+        DataStreamPtr& stream, Mesh* pMesh, VertexData* dest)
+    {
+        float *pFloat = 0;
+        HardwareVertexBufferSharedPtr vbuf;
+        // float* pVertices (x, y, z order x numVertices)
+        dest->vertexDeclaration->addElement(bindIdx, 0, VET_FLOAT3, VES_POSITION);
+        vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(
+            dest->vertexDeclaration->getVertexSize(bindIdx),
+            dest->vertexCount,
+            pMesh->mVertexBufferUsage,
+			pMesh->mIndexBufferShadowBuffer);
+        pFloat = static_cast<float*>(
+            vbuf->lock(HardwareBuffer::HBL_DISCARD));
+        readFloats(stream, pFloat, dest->vertexCount * 3);
+        vbuf->unlock();
+        dest->vertexBufferBinding->setBinding(bindIdx, vbuf);
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl_v1_2::readGeometryNormals(unsigned short bindIdx,
+        DataStreamPtr& stream, Mesh* pMesh, VertexData* dest)
+    {
+        float *pFloat = 0;
+        HardwareVertexBufferSharedPtr vbuf;
+        // float* pNormals (x, y, z order x numVertices)
+        dest->vertexDeclaration->addElement(bindIdx, 0, VET_FLOAT3, VES_NORMAL);
+        vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(
+            dest->vertexDeclaration->getVertexSize(bindIdx),
+            dest->vertexCount,
+            pMesh->mVertexBufferUsage,
+			pMesh->mVertexBufferShadowBuffer);
+        pFloat = static_cast<float*>(
+            vbuf->lock(HardwareBuffer::HBL_DISCARD));
+        readFloats(stream, pFloat, dest->vertexCount * 3);
+        vbuf->unlock();
+        dest->vertexBufferBinding->setBinding(bindIdx, vbuf);
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl_v1_2::readGeometryColours(unsigned short bindIdx,
+        DataStreamPtr& stream, Mesh* pMesh, VertexData* dest)
+    {
+        RGBA* pRGBA = 0;
+        HardwareVertexBufferSharedPtr vbuf;
+        // unsigned long* pColours (RGBA 8888 format x numVertices)
+        dest->vertexDeclaration->addElement(bindIdx, 0, VET_COLOUR, VES_DIFFUSE);
+        vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(
+            dest->vertexDeclaration->getVertexSize(bindIdx),
+            dest->vertexCount,
+            pMesh->mVertexBufferUsage,
+			pMesh->mVertexBufferShadowBuffer);
+        pRGBA = static_cast<RGBA*>(
+            vbuf->lock(HardwareBuffer::HBL_DISCARD));
+        readInts(stream, pRGBA, dest->vertexCount);
+        vbuf->unlock();
+        dest->vertexBufferBinding->setBinding(bindIdx, vbuf);
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl_v1_2::readGeometryTexCoords(unsigned short bindIdx,
+        DataStreamPtr& stream, Mesh* pMesh, VertexData* dest, unsigned short texCoordSet)
+    {
+        float *pFloat = 0;
+        HardwareVertexBufferSharedPtr vbuf;
+        // unsigned short dimensions    (1 for 1D, 2 for 2D, 3 for 3D)
+        unsigned short dim;
+        readShorts(stream, &dim, 1);
+        // float* pTexCoords  (u [v] [w] order, dimensions x numVertices)
+        dest->vertexDeclaration->addElement(
+            bindIdx,
+            0,
+            VertexElement::multiplyTypeCount(VET_FLOAT1, dim),
+            VES_TEXTURE_COORDINATES,
+            texCoordSet);
+        vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(
+            dest->vertexDeclaration->getVertexSize(bindIdx),
+            dest->vertexCount,
+            pMesh->mVertexBufferUsage,
+			pMesh->mVertexBufferShadowBuffer);
+        pFloat = static_cast<float*>(
+            vbuf->lock(HardwareBuffer::HBL_DISCARD));
+        readFloats(stream, pFloat, dest->vertexCount * dim);
+        vbuf->unlock();
+        dest->vertexBufferBinding->setBinding(bindIdx, vbuf);
+    }
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    MeshSerializerImpl_v1_1::MeshSerializerImpl_v1_1()
+    {
+        // Version number
+        mVersion = "[MeshSerializer_v1.10]";
+    }
+    //---------------------------------------------------------------------
+    MeshSerializerImpl_v1_1::~MeshSerializerImpl_v1_1()
+    {
+    }
+    //---------------------------------------------------------------------
+    void MeshSerializerImpl_v1_1::readGeometryTexCoords(unsigned short bindIdx,
+        DataStreamPtr& stream, Mesh* pMesh, VertexData* dest, unsigned short texCoordSet)
+    {
+        float *pFloat = 0;
+        HardwareVertexBufferSharedPtr vbuf;
+        // unsigned short dimensions    (1 for 1D, 2 for 2D, 3 for 3D)
+        unsigned short dim;
+        readShorts(stream, &dim, 1);
+        // float* pTexCoords  (u [v] [w] order, dimensions x numVertices)
+        dest->vertexDeclaration->addElement(
+            bindIdx,
+            0,
+            VertexElement::multiplyTypeCount(VET_FLOAT1, dim),
+            VES_TEXTURE_COORDINATES,
+            texCoordSet);
+        vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(
+            dest->vertexDeclaration->getVertexSize(bindIdx),
+            dest->vertexCount,
+            pMesh->getVertexBufferUsage(),
+			pMesh->isVertexBufferShadowed());
+        pFloat = static_cast<float*>(
+            vbuf->lock(HardwareBuffer::HBL_DISCARD));
+        readFloats(stream, pFloat, dest->vertexCount * dim);
+
+        // Adjust individual v values to (1 - v)
+        if (dim == 2)
+        {
+            for (size_t i = 0; i < dest->vertexCount; ++i)
+            {
+                ++pFloat; // skip u
+                *pFloat = 1.0 - *pFloat; // v = 1 - v
+                ++pFloat;
+            }
+
+        }
+        vbuf->unlock();
+        dest->vertexBufferBinding->setBinding(bindIdx, vbuf);
+    }
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+
+
+
+
+}
+
Index: /OgreMain/src/OgreMovableObject.cpp
===================================================================
--- /OgreMain/src/OgreMovableObject.cpp	(revision 5)
+++ /OgreMain/src/OgreMovableObject.cpp	(revision 5)
@@ -0,0 +1,393 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreMovableObject.h"
+#include "OgreSceneNode.h"
+#include "OgreTagPoint.h"
+#include "OgreLight.h"
+#include "OgreEntity.h"
+#include "OgreRoot.h"
+#include "OgreSceneManager.h"
+#include "OgreCamera.h"
+
+namespace Ogre {
+	//-----------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	uint32 MovableObject::msDefaultQueryFlags = 0xFFFFFFFF;
+	uint32 MovableObject::msDefaultVisibilityFlags = 0xFFFFFFFF;
+    //-----------------------------------------------------------------------
+    MovableObject::MovableObject()
+        : mCreator(0)
+        , mManager(0)
+        , mParentNode(0)
+        , mParentIsTagPoint(false)
+        , mVisible(true)
+        , mUpperDistance(0)
+        , mSquaredUpperDistance(0)
+        , mBeyondFarDistance(false)
+        , mRenderQueueID(RENDER_QUEUE_MAIN)
+        , mRenderQueueIDSet(false)
+        , mQueryFlags(msDefaultQueryFlags)
+        , mVisibilityFlags(msDefaultVisibilityFlags)
+        , mCastShadows(true)
+        , mRenderingDisabled(false)
+        , mListener(0)
+        , mLightListUpdated(0)
+    {
+    }
+    //-----------------------------------------------------------------------
+    MovableObject::MovableObject(const String& name)
+        : mName(name)
+        , mCreator(0)
+        , mManager(0)
+        , mParentNode(0)
+        , mParentIsTagPoint(false)
+        , mVisible(true)
+        , mUpperDistance(0)
+        , mSquaredUpperDistance(0)
+        , mBeyondFarDistance(false)
+        , mRenderQueueID(RENDER_QUEUE_MAIN)
+        , mRenderQueueIDSet(false)
+        , mQueryFlags(msDefaultQueryFlags)
+        , mVisibilityFlags(msDefaultVisibilityFlags)
+        , mCastShadows(true)
+        , mRenderingDisabled(false)
+        , mListener(0)
+        , mLightListUpdated(0)
+    {
+    }
+    //-----------------------------------------------------------------------
+    MovableObject::~MovableObject()
+    {
+        // Call listener (note, only called if there's something to do)
+        if (mListener)
+        {
+            mListener->objectDestroyed(this);
+        }
+
+        if (mParentNode)
+        {
+            // detach from parent
+            if (mParentIsTagPoint)
+            {
+                // May be we are a lod entity which not in the parent entity child object list,
+                // call this method could safely ignore this case.
+                static_cast<TagPoint*>(mParentNode)->getParentEntity()->detachObjectFromBone(this);
+            }
+            else
+            {
+                // May be we are a lod entity which not in the parent node child object list,
+                // call this method could safely ignore this case.
+                static_cast<SceneNode*>(mParentNode)->detachObject(this);
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MovableObject::_notifyAttached(Node* parent, bool isTagPoint)
+    {
+        assert(!mParentNode || !parent);
+
+        bool different = (parent != mParentNode);
+
+        mParentNode = parent;
+        mParentIsTagPoint = isTagPoint;
+
+        // Mark light list being dirty, simply decrease
+        // counter by one for minimise overhead
+        --mLightListUpdated;
+
+        // Call listener (note, only called if there's something to do)
+        if (mListener && different)
+        {
+            if (mParentNode)
+                mListener->objectAttached(this);
+            else
+                mListener->objectDetached(this);
+        }
+    }
+    //-----------------------------------------------------------------------
+    Node* MovableObject::getParentNode(void) const
+    {
+        return mParentNode;
+    }
+    //-----------------------------------------------------------------------
+    SceneNode* MovableObject::getParentSceneNode(void) const
+    {
+        if (mParentIsTagPoint)
+        {
+            TagPoint* tp = static_cast<TagPoint*>(mParentNode);
+            return tp->getParentEntity()->getParentSceneNode();
+        }
+        else
+        {
+            return static_cast<SceneNode*>(mParentNode);
+        }
+    }
+    //-----------------------------------------------------------------------
+    bool MovableObject::isAttached(void) const
+    {
+        return (mParentNode != 0);
+
+    }
+    //-----------------------------------------------------------------------
+	bool MovableObject::isInScene(void) const
+	{
+		if (mParentNode != 0)
+		{
+			if (mParentIsTagPoint)
+			{
+				TagPoint* tp = static_cast<TagPoint*>(mParentNode);
+				return tp->getParentEntity()->isInScene();
+			}
+			else
+			{
+				SceneNode* sn = static_cast<SceneNode*>(mParentNode);
+				return sn->isInSceneGraph();
+			}
+		}
+		else
+		{
+			return false;
+		}
+	}
+    //-----------------------------------------------------------------------
+    void MovableObject::_notifyMoved(void)
+    {
+        // Mark light list being dirty, simply decrease
+        // counter by one for minimise overhead
+        --mLightListUpdated;
+
+        // Notify listener if exists
+        if (mListener)
+        {
+            mListener->objectMoved(this);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void MovableObject::setVisible(bool visible)
+    {
+        mVisible = visible;
+    }
+    //-----------------------------------------------------------------------
+    bool MovableObject::getVisible(void) const
+    {
+        return mVisible;
+    }
+    //-----------------------------------------------------------------------
+    bool MovableObject::isVisible(void) const
+    {
+        if (!mVisible || mBeyondFarDistance || mRenderingDisabled)
+            return false;
+
+        SceneManager* sm = Root::getSingleton()._getCurrentSceneManager();
+        if (sm && !(mVisibilityFlags & sm->_getCombinedVisibilityMask()))
+            return false;
+
+        return true;
+    }
+	//-----------------------------------------------------------------------
+	void MovableObject::_notifyCurrentCamera(Camera* cam)
+	{
+		if (mParentNode)
+		{
+			if (cam->getUseRenderingDistance() && mUpperDistance > 0)
+			{
+				Real rad = getBoundingRadius();
+				Real squaredDepth = mParentNode->getSquaredViewDepth(cam);
+				// Max distance to still render
+				Real maxDist = mUpperDistance + rad;
+				if (squaredDepth > Math::Sqr(maxDist))
+				{
+					mBeyondFarDistance = true;
+				}
+				else
+				{
+					mBeyondFarDistance = false;
+				}
+			}
+			else
+			{
+				mBeyondFarDistance = false;
+			}
+		}
+
+        mRenderingDisabled = mListener && !mListener->objectRendering(this, cam);
+	}
+    //-----------------------------------------------------------------------
+    void MovableObject::setRenderQueueGroup(uint8 queueID)
+    {
+		assert(queueID <= RENDER_QUEUE_MAX && "Render queue out of range!");
+        mRenderQueueID = queueID;
+        mRenderQueueIDSet = true;
+    }
+    //-----------------------------------------------------------------------
+    uint8 MovableObject::getRenderQueueGroup(void) const
+    {
+        return mRenderQueueID;
+    }
+    //-----------------------------------------------------------------------
+	const Matrix4& MovableObject::_getParentNodeFullTransform(void) const
+	{
+		
+		if(mParentNode)
+		{
+			// object attached to a sceneNode
+			return mParentNode->_getFullTransform();
+		}
+        // fallback
+        return Matrix4::IDENTITY;
+	}
+    //-----------------------------------------------------------------------
+    const AxisAlignedBox& MovableObject::getWorldBoundingBox(bool derive) const
+    {
+        if (derive)
+        {
+            mWorldAABB = this->getBoundingBox();
+            mWorldAABB.transformAffine(_getParentNodeFullTransform());
+        }
+
+        return mWorldAABB;
+
+    }
+    //-----------------------------------------------------------------------
+	const Sphere& MovableObject::getWorldBoundingSphere(bool derive) const
+	{
+		if (derive)
+		{
+			mWorldBoundingSphere.setRadius(getBoundingRadius());
+			mWorldBoundingSphere.setCenter(mParentNode->_getDerivedPosition());
+		}
+		return mWorldBoundingSphere;
+	}
+    //-----------------------------------------------------------------------
+    const LightList& MovableObject::queryLights(void) const
+    {
+        // Try listener first
+        if (mListener)
+        {
+            const LightList* lightList =
+                mListener->objectQueryLights(this);
+            if (lightList)
+            {
+                return *lightList;
+            }
+        }
+
+        // Query from parent entity if exists
+        if (mParentIsTagPoint)
+        {
+            TagPoint* tp = static_cast<TagPoint*>(mParentNode);
+            return tp->getParentEntity()->queryLights();
+        }
+
+        if (mParentNode)
+        {
+            SceneNode* sn = static_cast<SceneNode*>(mParentNode);
+
+            // Make sure we only update this only if need.
+            ulong frame = sn->getCreator()->_getLightsDirtyCounter();
+            if (mLightListUpdated != frame)
+            {
+                mLightListUpdated = frame;
+
+                sn->findLights(mLightList, this->getBoundingRadius());
+            }
+        }
+        else
+        {
+            mLightList.clear();
+        }
+
+        return mLightList;
+    }
+    //-----------------------------------------------------------------------
+    ShadowCaster::ShadowRenderableListIterator MovableObject::getShadowVolumeRenderableIterator(
+        ShadowTechnique shadowTechnique, const Light* light, 
+        HardwareIndexBufferSharedPtr* indexBuffer, 
+        bool extrudeVertices, Real extrusionDist, unsigned long flags )
+    {
+        static ShadowRenderableList dummyList;
+        return ShadowRenderableListIterator(dummyList.begin(), dummyList.end());
+    }
+    //-----------------------------------------------------------------------
+    const AxisAlignedBox& MovableObject::getLightCapBounds(void) const
+    {
+        // Same as original bounds
+        return getWorldBoundingBox();
+    }
+    //-----------------------------------------------------------------------
+    const AxisAlignedBox& MovableObject::getDarkCapBounds(const Light& light, Real extrusionDist) const
+    {
+        // Extrude own light cap bounds
+        mWorldDarkCapBounds = getLightCapBounds();
+        this->extrudeBounds(mWorldDarkCapBounds, light.getAs4DVector(), 
+            extrusionDist);
+        return mWorldDarkCapBounds;
+
+    }
+    //-----------------------------------------------------------------------
+    Real MovableObject::getPointExtrusionDistance(const Light* l) const
+    {
+        if (mParentNode)
+        {
+            return getExtrusionDistance(mParentNode->_getDerivedPosition(), l);
+        }
+        else
+        {
+            return 0;
+        }
+    }
+	//-----------------------------------------------------------------------
+	uint32 MovableObject::getTypeFlags(void) const
+	{
+		if (mCreator)
+		{
+			return mCreator->getTypeFlags();
+		}
+		else
+		{
+			return 0xFFFFFFFF;
+		}
+	}
+	//-----------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	MovableObject* MovableObjectFactory::createInstance(
+		const String& name, SceneManager* manager, 
+		const NameValuePairList* params)
+	{
+		MovableObject* m = createInstanceImpl(name, params);
+		m->_notifyCreator(this);
+		m->_notifyManager(manager);
+		return m;
+	}
+
+
+}
+
Index: /OgreMain/src/OgreMovablePlane.cpp
===================================================================
--- /OgreMain/src/OgreMovablePlane.cpp	(revision 5)
+++ /OgreMain/src/OgreMovablePlane.cpp	(revision 5)
@@ -0,0 +1,103 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreMovablePlane.h"
+#include "OgreNode.h"
+
+namespace Ogre {
+
+    String MovablePlane::msMovableType = "MovablePlane";
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    MovablePlane::MovablePlane(const String& name) : Plane(), MovableObject(name),
+        mLastTranslate(Vector3::ZERO), 
+        mLastRotate(Quaternion::IDENTITY),
+        mDirty(true)
+    {
+    }
+    //-----------------------------------------------------------------------
+    MovablePlane::MovablePlane (const Plane& rhs) : Plane(rhs), 
+        mLastTranslate(Vector3::ZERO), mLastRotate(Quaternion::IDENTITY), 
+        mDirty(true)
+    {
+    }
+    //-----------------------------------------------------------------------
+    MovablePlane::MovablePlane (const Vector3& rkNormal, Real fConstant)
+        : Plane (rkNormal, fConstant), mLastTranslate(Vector3::ZERO), 
+        mLastRotate(Quaternion::IDENTITY), mDirty(true)
+    {
+    }
+    //-----------------------------------------------------------------------
+    MovablePlane::MovablePlane (const Vector3& rkNormal, const Vector3& rkPoint)
+        : Plane(rkNormal, rkPoint), mLastTranslate(Vector3::ZERO), 
+        mLastRotate(Quaternion::IDENTITY), mDirty(true)
+    {
+    }
+    //-----------------------------------------------------------------------
+    MovablePlane::MovablePlane (const Vector3& rkPoint0, const Vector3& rkPoint1,
+        const Vector3& rkPoint2)
+        : Plane(rkPoint0, rkPoint1, rkPoint2), mLastTranslate(Vector3::ZERO), 
+        mLastRotate(Quaternion::IDENTITY), mDirty(true)
+    {
+    }
+    //-----------------------------------------------------------------------
+    const Plane& MovablePlane::_getDerivedPlane(void) const
+    {
+        if (mParentNode)
+        {
+            if (mDirty ||
+                !(mParentNode->_getDerivedOrientation() == mLastRotate &&
+                mParentNode->_getDerivedPosition() == mLastTranslate))
+            {
+                mLastRotate = mParentNode->_getDerivedOrientation();
+                mLastTranslate = mParentNode->_getDerivedPosition();
+                // Rotate normal
+                mDerivedPlane.normal = mLastRotate * normal;
+                // d remains the same in rotation, since rotation happens first
+                mDerivedPlane.d = d;
+                // Add on the effect of the translation (project onto new normal)
+                mDerivedPlane.d -= mDerivedPlane.normal.dotProduct(mLastTranslate);
+
+                mDirty = false;
+
+            }
+        }
+        else
+        {
+            return *this;
+        }
+
+        return mDerivedPlane;
+    }
+    //-----------------------------------------------------------------------
+    const String& MovablePlane::getMovableType(void) const
+    {
+        return msMovableType;
+    }
+}
Index: /OgreMain/src/OgreNode.cpp
===================================================================
--- /OgreMain/src/OgreNode.cpp	(revision 5)
+++ /OgreMain/src/OgreNode.cpp	(revision 5)
@@ -0,0 +1,840 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreNode.h"
+
+#include "OgreException.h"
+#include "OgreMath.h"
+
+// Dependencies on render-related types due to ability to render node
+#include "OgreMaterialManager.h"
+#include "OgreMeshManager.h"
+#include "OgreMesh.h"
+#include "OgreSubMesh.h"
+#include "OgreCamera.h"
+
+namespace Ogre {
+
+    unsigned long Node::msNextGeneratedNameExt = 1;
+	Node::QueuedUpdates Node::msQueuedUpdates;
+    //-----------------------------------------------------------------------
+    Node::Node()
+		:mParent(0),
+		mNeedParentUpdate(false),
+		mNeedChildUpdate(false),
+		mParentNotified(false),
+        mQueuedForUpdate(false),
+		mOrientation(Quaternion::IDENTITY),
+		mPosition(Vector3::ZERO),
+		mScale(Vector3::UNIT_SCALE),
+        mInheritOrientation(true),
+		mInheritScale(true),
+		mDerivedOrientation(Quaternion::IDENTITY),
+		mDerivedPosition(Vector3::ZERO),
+		mDerivedScale(Vector3::UNIT_SCALE),
+		mInitialPosition(Vector3::ZERO),
+		mInitialOrientation(Quaternion::IDENTITY),
+		mInitialScale(Vector3::UNIT_SCALE),
+		mCachedTransformOutOfDate(true),
+		mListener(0)
+    {
+        // Generate a name
+		StringUtil::StrStreamType str;
+		str << "Unnamed_" << msNextGeneratedNameExt++;
+        mName = str.str();
+
+        needUpdate();
+
+    }
+    //-----------------------------------------------------------------------
+	Node::Node(const String& name) : Renderable(),
+		mParent(0),
+		mNeedParentUpdate(false),
+		mNeedChildUpdate(false),
+		mParentNotified(false),
+        mQueuedForUpdate(false),
+		mName(name),
+		mOrientation(Quaternion::IDENTITY),
+		mPosition(Vector3::ZERO),
+		mScale(Vector3::UNIT_SCALE),
+        mInheritOrientation(true),
+		mInheritScale(true),
+		mDerivedOrientation(Quaternion::IDENTITY),
+		mDerivedPosition(Vector3::ZERO),
+		mDerivedScale(Vector3::UNIT_SCALE),
+		mInitialPosition(Vector3::ZERO),
+		mInitialOrientation(Quaternion::IDENTITY),
+		mInitialScale(Vector3::UNIT_SCALE),
+		mCachedTransformOutOfDate(true),
+		mListener(0)
+
+    {
+
+        needUpdate();
+
+    }
+
+    //-----------------------------------------------------------------------
+    Node::~Node()
+    {
+		// Call listener (note, only called if there's something to do)
+		if (mListener)
+		{
+			mListener->nodeDestroyed(this);
+		}
+
+		removeAllChildren();
+		if(mParent)
+			mParent->removeChild(this);
+
+        if (mQueuedForUpdate)
+        {
+            // Erase from queued updates
+            QueuedUpdates::iterator it =
+                std::find(msQueuedUpdates.begin(), msQueuedUpdates.end(), this);
+            assert(it != msQueuedUpdates.end());
+            if (it != msQueuedUpdates.end())
+            {
+                // Optimised algorithm to erase an element from unordered vector.
+                *it = msQueuedUpdates.back();
+                msQueuedUpdates.pop_back();
+            }
+        }
+	}
+    //-----------------------------------------------------------------------
+    Node* Node::getParent(void) const
+    {
+        return mParent;
+    }
+
+    //-----------------------------------------------------------------------
+    void Node::setParent(Node* parent)
+    {
+		bool different = (parent != mParent);
+
+        mParent = parent;
+        // Request update from parent
+		mParentNotified = false ;
+        needUpdate();
+
+		// Call listener (note, only called if there's something to do)
+		if (mListener && different)
+		{
+			if (mParent)
+				mListener->nodeAttached(this);
+			else
+				mListener->nodeDetached(this);
+		}
+
+    }
+
+    //-----------------------------------------------------------------------
+    const Matrix4& Node::_getFullTransform(void) const
+    {
+        if (mCachedTransformOutOfDate)
+        {
+            // Use derived values
+            mCachedTransform.makeTransform(
+                _getDerivedPosition(),
+                _getDerivedScale(),
+                _getDerivedOrientation());
+            mCachedTransformOutOfDate = false;
+        }
+        return mCachedTransform;
+    }
+    //-----------------------------------------------------------------------
+    void Node::_update(bool updateChildren, bool parentHasChanged)
+    {
+		// always clear information about parent notification
+		mParentNotified = false ;
+
+        // Short circuit the off case
+        if (!updateChildren && !mNeedParentUpdate && !mNeedChildUpdate && !parentHasChanged )
+        {
+            return;
+        }
+
+
+        // See if we should process everyone
+        if (mNeedParentUpdate || parentHasChanged)
+        {
+            // Update transforms from parent
+            _updateFromParent();
+		}
+
+		if (mNeedChildUpdate || parentHasChanged)
+		{
+
+            ChildNodeMap::iterator it, itend;
+			itend = mChildren.end();
+            for (it = mChildren.begin(); it != itend; ++it)
+            {
+                Node* child = it->second;
+                child->_update(true, true);
+            }
+            mChildrenToUpdate.clear();
+        }
+        else
+        {
+            // Just update selected children
+
+            ChildUpdateSet::iterator it, itend;
+			itend = mChildrenToUpdate.end();
+            for(it = mChildrenToUpdate.begin(); it != itend; ++it)
+            {
+                Node* child = *it;
+                child->_update(true, false);
+            }
+
+            mChildrenToUpdate.clear();
+        }
+
+        mNeedChildUpdate = false;
+
+    }
+	//-----------------------------------------------------------------------
+	void Node::_updateFromParent(void) const
+	{
+		updateFromParentImpl();
+
+		// Call listener (note, this method only called if there's something to do)
+		if (mListener)
+		{
+			mListener->nodeUpdated(this);
+		}
+	}
+    //-----------------------------------------------------------------------
+    void Node::updateFromParentImpl(void) const
+    {
+        if (mParent)
+        {
+            // Update orientation
+            const Quaternion& parentOrientation = mParent->_getDerivedOrientation();
+            if (mInheritOrientation)
+            {
+                // Combine orientation with that of parent
+                mDerivedOrientation = parentOrientation * mOrientation;
+            }
+			else
+            {
+                // No inheritence
+                mDerivedOrientation = mOrientation;
+            }
+
+            // Update scale
+            const Vector3& parentScale = mParent->_getDerivedScale();
+            if (mInheritScale)
+            {
+                // Scale own position by parent scale, NB just combine
+                // as equivalent axes, no shearing
+                mDerivedScale = parentScale * mScale;
+            }
+            else
+            {
+                // No inheritence
+                mDerivedScale = mScale;
+            }
+
+            // Change position vector based on parent's orientation & scale
+            mDerivedPosition = parentOrientation * (parentScale * mPosition);
+
+            // Add altered position vector to parents
+            mDerivedPosition += mParent->_getDerivedPosition();
+        }
+        else
+        {
+            // Root node, no parent
+            mDerivedOrientation = mOrientation;
+            mDerivedPosition = mPosition;
+            mDerivedScale = mScale;
+        }
+
+		mCachedTransformOutOfDate = true;
+		mNeedParentUpdate = false;
+
+    }
+    //-----------------------------------------------------------------------
+    Node* Node::createChild(const Vector3& translate, const Quaternion& rotate)
+    {
+        Node* newNode = createChildImpl();
+        newNode->translate(translate);
+        newNode->rotate(rotate);
+        this->addChild(newNode);
+
+        return newNode;
+    }
+    //-----------------------------------------------------------------------
+    Node* Node::createChild(const String& name, const Vector3& translate, const Quaternion& rotate)
+    {
+        Node* newNode = createChildImpl(name);
+        newNode->translate(translate);
+        newNode->rotate(rotate);
+        this->addChild(newNode);
+
+        return newNode;
+    }
+    //-----------------------------------------------------------------------
+    void Node::addChild(Node* child)
+    {
+        if (child->mParent)
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "Node '" + child->getName() + "' already was a child of '" +
+                child->mParent->getName() + "'.",
+                "Node::addChild");
+        }
+
+        mChildren.insert(ChildNodeMap::value_type(child->getName(), child));
+        child->setParent(this);
+
+    }
+    //-----------------------------------------------------------------------
+    unsigned short Node::numChildren(void) const
+    {
+        return static_cast< unsigned short >( mChildren.size() );
+    }
+    //-----------------------------------------------------------------------
+    Node* Node::getChild(unsigned short index) const
+    {
+        if( index < mChildren.size() )
+        {
+            ChildNodeMap::const_iterator i = mChildren.begin();
+            while (index--) ++i;
+            return i->second;
+        }
+        else
+            return NULL;
+    }
+    //-----------------------------------------------------------------------
+    Node* Node::removeChild(unsigned short index)
+    {
+        Node* ret;
+        if (index < mChildren.size())
+        {
+            ChildNodeMap::iterator i = mChildren.begin();
+            while (index--) ++i;
+            ret = i->second;
+            // cancel any pending update
+            cancelUpdate(ret);
+
+            mChildren.erase(i);
+            ret->setParent(NULL);
+            return ret;
+        }
+        else
+        {
+            OGRE_EXCEPT(
+                Exception::ERR_INVALIDPARAMS,
+                "Child index out of bounds.",
+                "Node::getChild" );
+        }
+        return 0;
+    }
+    //-----------------------------------------------------------------------
+    Node* Node::removeChild(Node* child)
+    {
+        if (child)
+        {
+            ChildNodeMap::iterator i = mChildren.find(child->getName());
+            // ensure it's our child
+            if (i != mChildren.end() && i->second == child)
+            {
+                // cancel any pending update
+                cancelUpdate(child);
+
+                mChildren.erase(i);
+                child->setParent(NULL);
+            }
+        }
+        return child;
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& Node::getOrientation() const
+    {
+        return mOrientation;
+    }
+
+    //-----------------------------------------------------------------------
+    void Node::setOrientation( const Quaternion & q )
+    {
+        mOrientation = q;
+        needUpdate();
+    }
+    //-----------------------------------------------------------------------
+    void Node::setOrientation( Real w, Real x, Real y, Real z)
+    {
+        mOrientation.w = w;
+        mOrientation.x = x;
+        mOrientation.y = y;
+        mOrientation.z = z;
+        needUpdate();
+    }
+    //-----------------------------------------------------------------------
+    void Node::resetOrientation(void)
+    {
+        mOrientation = Quaternion::IDENTITY;
+        needUpdate();
+    }
+
+    //-----------------------------------------------------------------------
+    void Node::setPosition(const Vector3& pos)
+    {
+        mPosition = pos;
+        needUpdate();
+    }
+
+
+    //-----------------------------------------------------------------------
+    void Node::setPosition(Real x, Real y, Real z)
+    {
+        Vector3 v(x,y,z);
+        setPosition(v);
+    }
+
+    //-----------------------------------------------------------------------
+    const Vector3 & Node::getPosition(void) const
+    {
+        return mPosition;
+    }
+    //-----------------------------------------------------------------------
+    Matrix3 Node::getLocalAxes(void) const
+    {
+        Vector3 axisX = Vector3::UNIT_X;
+        Vector3 axisY = Vector3::UNIT_Y;
+        Vector3 axisZ = Vector3::UNIT_Z;
+
+        axisX = mOrientation * axisX;
+        axisY = mOrientation * axisY;
+        axisZ = mOrientation * axisZ;
+
+        return Matrix3(axisX.x, axisY.x, axisZ.x,
+                       axisX.y, axisY.y, axisZ.y,
+                       axisX.z, axisY.z, axisZ.z);
+    }
+
+    //-----------------------------------------------------------------------
+    void Node::translate(const Vector3& d, TransformSpace relativeTo)
+    {
+        switch(relativeTo)
+        {
+        case TS_LOCAL:
+            // position is relative to parent so transform downwards
+            mPosition += mOrientation * d;
+        	break;
+        case TS_WORLD:
+            // position is relative to parent so transform upwards
+            if (mParent)
+            {
+                mPosition += (mParent->_getDerivedOrientation().Inverse() * d)
+                    / mParent->_getDerivedScale();
+            }
+            else
+            {
+                mPosition += d;
+            }
+        	break;
+        case TS_PARENT:
+            mPosition += d;
+            break;
+        }
+        needUpdate();
+
+    }
+    //-----------------------------------------------------------------------
+    void Node::translate(Real x, Real y, Real z, TransformSpace relativeTo)
+    {
+        Vector3 v(x,y,z);
+        translate(v, relativeTo);
+    }
+    //-----------------------------------------------------------------------
+    void Node::translate(const Matrix3& axes, const Vector3& move, TransformSpace relativeTo)
+    {
+        Vector3 derived = axes * move;
+        translate(derived, relativeTo);
+    }
+    //-----------------------------------------------------------------------
+    void Node::translate(const Matrix3& axes, Real x, Real y, Real z, TransformSpace relativeTo)
+    {
+        Vector3 d(x,y,z);
+        translate(axes,d,relativeTo);
+    }
+    //-----------------------------------------------------------------------
+    void Node::roll(const Radian& angle, TransformSpace relativeTo)
+    {
+        rotate(Vector3::UNIT_Z, angle, relativeTo);
+    }
+    //-----------------------------------------------------------------------
+    void Node::pitch(const Radian& angle, TransformSpace relativeTo)
+    {
+        rotate(Vector3::UNIT_X, angle, relativeTo);
+    }
+    //-----------------------------------------------------------------------
+    void Node::yaw(const Radian& angle, TransformSpace relativeTo)
+    {
+        rotate(Vector3::UNIT_Y, angle, relativeTo);
+
+    }
+    //-----------------------------------------------------------------------
+    void Node::rotate(const Vector3& axis, const Radian& angle, TransformSpace relativeTo)
+    {
+        Quaternion q;
+        q.FromAngleAxis(angle,axis);
+        rotate(q, relativeTo);
+    }
+
+    //-----------------------------------------------------------------------
+    void Node::rotate(const Quaternion& q, TransformSpace relativeTo)
+    {
+        switch(relativeTo)
+        {
+        case TS_PARENT:
+            // Rotations are normally relative to local axes, transform up
+            mOrientation = q * mOrientation;
+            break;
+        case TS_WORLD:
+            // Rotations are normally relative to local axes, transform up
+            mOrientation = mOrientation * _getDerivedOrientation().Inverse()
+                * q * _getDerivedOrientation();
+            break;
+        case TS_LOCAL:
+            // Note the order of the mult, i.e. q comes after
+            mOrientation = mOrientation * q;
+            break;
+        }
+        needUpdate();
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion & Node::_getDerivedOrientation(void) const
+    {
+		if (mNeedParentUpdate)
+		{
+        	_updateFromParent();
+		}
+        return mDerivedOrientation;
+    }
+    //-----------------------------------------------------------------------
+    const Vector3 & Node::_getDerivedPosition(void) const
+    {
+		if (mNeedParentUpdate)
+		{
+        	_updateFromParent();
+		}
+        return mDerivedPosition;
+    }
+    //-----------------------------------------------------------------------
+    const Vector3 & Node::_getDerivedScale(void) const
+    {
+        if (mNeedParentUpdate)
+        {
+            _updateFromParent();
+        }
+        return mDerivedScale;
+    }
+    //-----------------------------------------------------------------------
+    void Node::removeAllChildren(void)
+    {
+		ChildNodeMap::iterator i, iend;
+		iend = mChildren.end();
+		for (i = mChildren.begin(); i != iend; ++i)
+		{
+			i->second->setParent(0);
+		}
+        mChildren.clear();
+		mChildrenToUpdate.clear();
+    }
+    //-----------------------------------------------------------------------
+    void Node::setScale(const Vector3& scale)
+    {
+        mScale = scale;
+        needUpdate();
+    }
+    //-----------------------------------------------------------------------
+    void Node::setScale(Real x, Real y, Real z)
+    {
+        mScale.x = x;
+        mScale.y = y;
+        mScale.z = z;
+        needUpdate();
+    }
+    //-----------------------------------------------------------------------
+    const Vector3 & Node::getScale(void) const
+    {
+        return mScale;
+    }
+    //-----------------------------------------------------------------------
+    void Node::setInheritOrientation(bool inherit)
+    {
+        mInheritOrientation = inherit;
+        needUpdate();
+    }
+    //-----------------------------------------------------------------------
+    bool Node::getInheritOrientation(void) const
+    {
+        return mInheritOrientation;
+    }
+    //-----------------------------------------------------------------------
+    void Node::setInheritScale(bool inherit)
+    {
+        mInheritScale = inherit;
+        needUpdate();
+    }
+    //-----------------------------------------------------------------------
+    bool Node::getInheritScale(void) const
+    {
+        return mInheritScale;
+    }
+    //-----------------------------------------------------------------------
+    void Node::scale(const Vector3& scale)
+    {
+        mScale = mScale * scale;
+        needUpdate();
+
+    }
+    //-----------------------------------------------------------------------
+    void Node::scale(Real x, Real y, Real z)
+    {
+        mScale.x *= x;
+        mScale.y *= y;
+        mScale.z *= z;
+        needUpdate();
+
+    }
+    //-----------------------------------------------------------------------
+    const String& Node::getName(void) const
+    {
+        return mName;
+    }
+    //-----------------------------------------------------------------------
+    const MaterialPtr& Node::getMaterial(void) const
+    {
+        if (mpMaterial.isNull())
+        {
+            mpMaterial = MaterialManager::getSingleton().getByName("Core/NodeMaterial");
+			if (mpMaterial.isNull())
+				OGRE_EXCEPT( Exception::ERR_ITEM_NOT_FOUND, "Could not find material Core/NodeMaterial",
+					"Node::getMaterial" );
+            mpMaterial->load();
+        }
+        return mpMaterial;
+
+    }
+    //-----------------------------------------------------------------------
+    void Node::getRenderOperation(RenderOperation& op)
+    {
+        static SubMesh* pSubMesh = 0;
+        if (!pSubMesh)
+        {
+            MeshPtr pMesh = MeshManager::getSingleton().load("axes.mesh",
+				ResourceGroupManager::BOOTSTRAP_RESOURCE_GROUP_NAME);
+            pSubMesh = pMesh->getSubMesh(0);
+        }
+        pSubMesh->_getRenderOperation(op);
+    }
+    //-----------------------------------------------------------------------
+    void Node::getWorldTransforms(Matrix4* xform) const
+    {
+        // Assumes up to date
+        *xform = this->_getFullTransform();
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& Node::getWorldOrientation(void) const
+    {
+        return _getDerivedOrientation();
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& Node::getWorldPosition(void) const
+    {
+        return _getDerivedPosition();
+    }
+    //-----------------------------------------------------------------------
+    void Node::setInitialState(void)
+    {
+        mInitialPosition = mPosition;
+        mInitialOrientation = mOrientation;
+        mInitialScale = mScale;
+    }
+    //-----------------------------------------------------------------------
+    void Node::resetToInitialState(void)
+    {
+        mPosition = mInitialPosition;
+        mOrientation = mInitialOrientation;
+        mScale = mInitialScale;
+
+        needUpdate();
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& Node::getInitialPosition(void) const
+    {
+        return mInitialPosition;
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& Node::getInitialOrientation(void) const
+    {
+        return mInitialOrientation;
+
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& Node::getInitialScale(void) const
+    {
+        return mInitialScale;
+    }
+    //-----------------------------------------------------------------------
+    Node* Node::getChild(const String& name) const
+    {
+        ChildNodeMap::const_iterator i = mChildren.find(name);
+
+        if (i == mChildren.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Child node named " + name +
+                " does not exist.", "Node::getChild");
+        }
+        return i->second;
+
+    }
+    //-----------------------------------------------------------------------
+    Node* Node::removeChild(const String& name)
+    {
+        ChildNodeMap::iterator i = mChildren.find(name);
+
+        if (i == mChildren.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Child node named " + name +
+                " does not exist.", "Node::removeChild");
+        }
+
+        Node* ret = i->second;
+        // Cancel any pending update
+        cancelUpdate(ret);
+
+        mChildren.erase(i);
+        ret->setParent(NULL);
+
+        return ret;
+
+
+    }
+    //-----------------------------------------------------------------------
+    Node::ChildNodeIterator Node::getChildIterator(void)
+    {
+        return ChildNodeIterator(mChildren.begin(), mChildren.end());
+    }
+	//-----------------------------------------------------------------------
+	Node::ConstChildNodeIterator Node::getChildIterator(void) const
+	{
+		return ConstChildNodeIterator(mChildren.begin(), mChildren.end());
+	}
+    //-----------------------------------------------------------------------
+    Real Node::getSquaredViewDepth(const Camera* cam) const
+    {
+        Vector3 diff = _getDerivedPosition() - cam->getDerivedPosition();
+
+        // NB use squared length rather than real depth to avoid square root
+        return diff.squaredLength();
+    }
+    //-----------------------------------------------------------------------
+    void Node::needUpdate(bool forceParentUpdate)
+    {
+
+        mNeedParentUpdate = true;
+		mNeedChildUpdate = true;
+        mCachedTransformOutOfDate = true;
+
+        // Make sure we're not root and parent hasn't been notified before
+        if (mParent && (!mParentNotified || forceParentUpdate))
+        {
+            mParent->requestUpdate(this, forceParentUpdate);
+			mParentNotified = true ;
+        }
+
+        // all children will be updated
+        mChildrenToUpdate.clear();
+    }
+    //-----------------------------------------------------------------------
+    void Node::requestUpdate(Node* child, bool forceParentUpdate)
+    {
+        // If we're already going to update everything this doesn't matter
+        if (mNeedChildUpdate)
+        {
+            return;
+        }
+
+        mChildrenToUpdate.insert(child);
+        // Request selective update of me, if we didn't do it before
+        if (mParent && (!mParentNotified || forceParentUpdate))
+		{
+            mParent->requestUpdate(this, forceParentUpdate);
+			mParentNotified = true ;
+		}
+
+    }
+    //-----------------------------------------------------------------------
+    void Node::cancelUpdate(Node* child)
+    {
+        mChildrenToUpdate.erase(child);
+
+        // Propogate this up if we're done
+        if (mChildrenToUpdate.empty() && mParent && !mNeedChildUpdate)
+        {
+            mParent->cancelUpdate(this);
+			mParentNotified = false ;
+        }
+    }
+	//-----------------------------------------------------------------------
+	void Node::queueNeedUpdate(Node* n)
+	{
+        // Don't queue the node more than once
+        if (!n->mQueuedForUpdate)
+        {
+            n->mQueuedForUpdate = true;
+		    msQueuedUpdates.push_back(n);
+        }
+	}
+	//-----------------------------------------------------------------------
+	void Node::processQueuedUpdates(void)
+	{
+		for (QueuedUpdates::iterator i = msQueuedUpdates.begin();
+			i != msQueuedUpdates.end(); ++i)
+		{
+			// Update, and force parent update since chances are we've ended
+			// up with some mixed state in there due to re-entrancy
+            Node* n = *i;
+            n->mQueuedForUpdate = false;
+			n->needUpdate(true);
+		}
+		msQueuedUpdates.clear();
+	}
+    //-----------------------------------------------------------------------
+    const LightList& Node::getLights(void) const
+    {
+        // Nodes should not be lit by the scene, this will not get called
+        static LightList ll;
+        return ll;
+    }
+}
+
Index: /OgreMain/src/OgreNumerics.cpp
===================================================================
--- /OgreMain/src/OgreNumerics.cpp	(revision 5)
+++ /OgreMain/src/OgreNumerics.cpp	(revision 5)
@@ -0,0 +1,80 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreStableHeaders.h"
+#include "OgreCommon.h"
+#include "OgreNumerics.h"
+
+
+namespace Ogre
+{
+	bool NumericSolver::solveNxNLinearSysDestr(int n, PreciseReal **coeff, PreciseReal *col)
+	{
+		// we'll use standard row reduction; since we only care about systems with unique
+		// solutions, our job is slightly easier.  more can probably be done later to improve
+		// precision versus this naive method
+
+		int i, j;
+
+		for(j=0; j<n; j++)
+		{
+			// look for a row with a leading coefficient we can use to cancel the rest
+			int nonzeroIndex = -1;
+			for(i=j; i<n; i++) {
+				if (coeff[i][j] != 0.0) {
+					nonzeroIndex = i;
+					break;
+				}
+			}
+			if (nonzeroIndex < 0) 
+				return false;
+			PreciseReal *tptr = coeff[j];
+			coeff[j] = coeff[nonzeroIndex];
+			coeff[nonzeroIndex] = tptr;
+			PreciseReal tval = col[j];
+			col[j] = col[nonzeroIndex];
+			col[nonzeroIndex] = tval;
+			nonzeroIndex = j;
+
+			// normalize row to have leading coeff of 1 and kill other rows' entries
+			PreciseReal invelt = 1.0 / coeff[nonzeroIndex][j];
+			int k;
+			for (k=j; k<n; k++)
+				coeff[nonzeroIndex][k] *= invelt;
+			col[nonzeroIndex] *= invelt;
+			for (i=0; i<n; i++) {
+				if (i==nonzeroIndex || coeff[i][j] == 0.0)
+					continue;
+				PreciseReal temp = coeff[i][j];
+				for (k=j; k<n; k++)
+					coeff[i][k] -= temp * coeff[nonzeroIndex][k];
+				col[i] -= temp * col[nonzeroIndex];
+			}
+		}
+
+		return true;
+	}
+
+}
Index: /OgreMain/src/OgreOptimisedUtil.cpp
===================================================================
--- /OgreMain/src/OgreOptimisedUtil.cpp	(revision 5)
+++ /OgreMain/src/OgreOptimisedUtil.cpp	(revision 5)
@@ -0,0 +1,393 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreOptimisedUtil.h"
+
+#include "OgrePlatformInformation.h"
+
+//#define __DO_PROFILE__
+#ifdef __DO_PROFILE__
+#include "OgreRoot.h"
+#endif
+
+namespace Ogre {
+
+    //---------------------------------------------------------------------
+    // External functions
+    extern OptimisedUtil* _getOptimisedUtilGeneral(void);
+#if __OGRE_HAVE_SSE
+    extern OptimisedUtil* _getOptimisedUtilSSE(void);
+#endif
+
+#ifdef __DO_PROFILE__
+    //---------------------------------------------------------------------
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+    typedef unsigned __int64 uint64;
+#pragma warning(push)
+#pragma warning(disable: 4035)  // no return value
+    static FORCEINLINE uint64 getCpuTimestamp(void)
+    {
+        __asm rdtsc
+        // Return values in edx:eax, No return statment requirement here for VC.
+    }
+#pragma warning(pop)
+
+#elif OGRE_COMPILER == OGRE_COMPILER_GNUC
+    typedef unsigned long long uint64;
+    static FORCEINLINE uint64 getCpuTimestamp(void)
+    {
+        uint64 result;
+        __asm__ __volatile__ ( "rdtsc" : "=A" (result) );
+        return result;
+    }
+
+#endif  // OGRE_COMPILER
+
+    //---------------------------------------------------------------------
+    class OptimisedUtilProfiler : public OptimisedUtil
+    {
+    protected:
+
+        enum
+        {
+            IMPL_DEFAULT,
+#if __OGRE_HAVE_SSE
+            IMPL_SSE,
+#endif
+            IMPL_COUNT
+        };
+
+        struct ProfileItem
+        {
+            uint mAvgTicks;
+            uint mCount;
+            uint64 mTotalTicks;
+            uint64 mStartTick;
+
+            ProfileItem(void)
+                : mAvgTicks()
+                , mCount()
+                , mTotalTicks()
+            {
+            }
+
+            void begin(void)
+            {
+                mStartTick = getCpuTimestamp();
+            }
+
+            void end(void)
+            {
+                uint64 ticks = getCpuTimestamp() - mStartTick;
+                mTotalTicks += ticks;
+                ++mCount;
+                mAvgTicks = mTotalTicks / mCount;
+            }
+        };
+
+        typedef ProfileItem ProfileItems[IMPL_COUNT];
+
+        typedef std::vector<OptimisedUtil*> OptimisedUtilList;
+        OptimisedUtilList mOptimisedUtils;
+
+    public:
+        OptimisedUtilProfiler(void)
+        {
+            mOptimisedUtils.push_back(_getOptimisedUtilGeneral());
+#if __OGRE_HAVE_SSE
+            if (PlatformInformation::getCpuFeatures() & PlatformInformation::CPU_FEATURE_SSE)
+            {
+                mOptimisedUtils.push_back(_getOptimisedUtilSSE());
+            }
+#endif
+        }
+
+        virtual void softwareVertexSkinning(
+            const float *srcPosPtr, float *destPosPtr,
+            const float *srcNormPtr, float *destNormPtr,
+            const float *blendWeightPtr, const unsigned char* blendIndexPtr,
+            const Matrix4* const* blendMatrices,
+            size_t srcPosStride, size_t destPosStride,
+            size_t srcNormStride, size_t destNormStride,
+            size_t blendWeightStride, size_t blendIndexStride,
+            size_t numWeightsPerVertex,
+            size_t numVertices)
+        {
+            static ProfileItems results;
+            static size_t index;
+            index = Root::getSingleton().getCurrentFrameNumber() % mOptimisedUtils.size();
+            OptimisedUtil* impl = mOptimisedUtils[index];
+            ProfileItem& profile = results[index];
+
+            profile.begin();
+            impl->softwareVertexSkinning(
+                srcPosPtr, destPosPtr,
+                srcNormPtr, destNormPtr,
+                blendWeightPtr, blendIndexPtr,
+                blendMatrices,
+                srcPosStride, destPosStride,
+                srcNormStride, destNormStride,
+                blendWeightStride, blendIndexStride,
+                numWeightsPerVertex,
+                numVertices);
+            profile.end();
+
+            // You can put break point here while running test application, to
+            // watch profile results.
+            ++index;    // So we can put break point here even if in release build
+        }
+
+        virtual void softwareVertexMorph(
+            Real t,
+            const float *srcPos1, const float *srcPos2,
+            float *dstPos,
+            size_t numVertices)
+        {
+            static ProfileItems results;
+            static size_t index;
+            index = Root::getSingleton().getCurrentFrameNumber() % mOptimisedUtils.size();
+            OptimisedUtil* impl = mOptimisedUtils[index];
+            ProfileItem& profile = results[index];
+
+            profile.begin();
+            impl->softwareVertexMorph(
+                t,
+                srcPos1, srcPos2,
+                dstPos,
+                numVertices);
+            profile.end();
+
+            // You can put break point here while running test application, to
+            // watch profile results.
+            ++index;    // So we can put break point here even if in release build
+        }
+
+        virtual void concatenateAffineMatrices(
+            const Matrix4& baseMatrix,
+            const Matrix4* srcMatrices,
+            Matrix4* dstMatrices,
+            size_t numMatrices)
+        {
+            static ProfileItems results;
+            static size_t index;
+            index = Root::getSingleton().getCurrentFrameNumber() % mOptimisedUtils.size();
+            OptimisedUtil* impl = mOptimisedUtils[index];
+            ProfileItem& profile = results[index];
+
+            profile.begin();
+            impl->concatenateAffineMatrices(
+                baseMatrix,
+                srcMatrices,
+                dstMatrices,
+                numMatrices);
+            profile.end();
+
+            // You can put break point here while running test application, to
+            // watch profile results.
+            ++index;    // So we can put break point here even if in release build
+        }
+
+        /// @copydoc OptimisedUtil::calculateFaceNormals
+        virtual void calculateFaceNormals(
+            const float *positions,
+            const EdgeData::Triangle *triangles,
+            Vector4 *faceNormals,
+            size_t numTriangles)
+        {
+            static ProfileItems results;
+            static size_t index;
+            index = Root::getSingleton().getCurrentFrameNumber() % mOptimisedUtils.size();
+            OptimisedUtil* impl = mOptimisedUtils[index];
+            ProfileItem& profile = results[index];
+
+            profile.begin();
+            impl->calculateFaceNormals(
+                positions,
+                triangles,
+                faceNormals,
+                numTriangles);
+            profile.end();
+
+            //
+            //   Dagon SkeletonAnimation sample test results (CPU timestamp per-function call):
+            //
+            //                  Pentium 4 3.0G HT       Athlon XP 2500+
+            //
+            //      General     657080                  486494
+            //      SSE         223559                  399495
+            //
+
+            // You can put break point here while running test application, to
+            // watch profile results.
+            ++index;    // So we can put break point here even if in release build
+        }
+
+        /// @copydoc OptimisedUtil::calculateLightFacing
+        virtual void calculateLightFacing(
+            const Vector4& lightPos,
+            const Vector4* faceNormals,
+            char* lightFacings,
+            size_t numFaces)
+        {
+            static ProfileItems results;
+            static size_t index;
+            index = Root::getSingleton().getCurrentFrameNumber() % mOptimisedUtils.size();
+            OptimisedUtil* impl = mOptimisedUtils[index];
+            ProfileItem& profile = results[index];
+
+            profile.begin();
+            impl->calculateLightFacing(
+                lightPos,
+                faceNormals,
+                lightFacings,
+                numFaces);
+            profile.end();
+
+            //
+            //   Dagon SkeletonAnimation sample test results (CPU timestamp per-function call):
+            //
+            //                  Pentium 4 3.0G HT       Athlon XP 2500+
+            //
+            //      General     171875                  86998
+            //      SSE          47934                  63995
+            //
+
+            // You can put break point here while running test application, to
+            // watch profile results.
+            ++index;    // So we can put break point here even if in release build
+        }
+
+        virtual void extrudeVertices(
+            const Vector4& lightPos,
+            Real extrudeDist,
+            const float* srcPositions,
+            float* destPositions,
+            size_t numVertices)
+        {
+            static ProfileItems results;
+            static size_t index;
+            index = Root::getSingleton().getCurrentFrameNumber() % mOptimisedUtils.size();
+            OptimisedUtil* impl = mOptimisedUtils[index];
+            ProfileItem& profile = results[index];
+
+            profile.begin();
+            impl->extrudeVertices(
+                lightPos,
+                extrudeDist,
+                srcPositions,
+                destPositions,
+                numVertices);
+            profile.end();
+
+            //
+            //   Dagon SkeletonAnimation sample test results (CPU timestamp per-function call):
+            //
+            //                                  Pentium 4 3.0G HT   Athlon XP 2500+
+            //
+            //      Directional Light, General   38106               92306
+            //      Directional Light, SSE       27292               67055
+            //
+            //      Point Light, General        224209              155483
+            //      Point Light, SSE             56817              106663
+            //
+
+            // You can put break point here while running test application, to
+            // watch profile results.
+            ++index;    // So we can put break point here even if in release build
+        }
+
+    };
+#endif // __DO_PROFILE__
+
+    //---------------------------------------------------------------------
+    OptimisedUtil* OptimisedUtil::msImplementation = OptimisedUtil::_detectImplementation();
+
+    //---------------------------------------------------------------------
+    OptimisedUtil* OptimisedUtil::_detectImplementation(void)
+    {
+        //
+        // Some speed test results (averaged number of CPU timestamp (RDTSC) per-function call):
+        //
+        //   Dagon SkeletonAnimation sample - softwareVertexSkinning:
+        //
+        //                                      Pentium 4 3.0G HT       Athlon XP 2500+     Athlon 64 X2 Dual Core 3800+
+        //
+        //      Shared Buffers, General C       763677                  462903              473038
+        //      Shared Buffers, Unrolled SSE    210030 *best*           369762              228328 *best*
+        //      Shared Buffers, General SSE     286202                  352412 *best*       302796
+        //
+        //      Separated Buffers, General C    762640                  464840              478740
+        //      Separated Buffers, Unrolled SSE 219222 *best*           287992 *best*       238770 *best*
+        //      Separated Buffers, General SSE  290129                  341614              307262
+        //
+        //      PosOnly, General C              388663                  257350              262831
+        //      PosOnly, Unrolled SSE           139814 *best*           200323 *best*       168995 *best*
+        //      PosOnly, General SSE            172693                  213704              175447
+        //
+        //   Another my own test scene - softwareVertexSkinning:
+        //
+        //                                      Pentium P4 3.0G HT      Athlon XP 2500+
+        //
+        //      Shared Buffers, General C       74527                   -
+        //      Shared Buffers, Unrolled SSE    22743 *best*            -
+        //      Shared Buffers, General SSE     28527                   -
+        //
+        //
+        // Note that speed test appears unaligned load/store instruction version
+        // loss performance 5%-10% than aligned load/store version, even if both
+        // of them access to aligned data. Thus, we should use aligned load/store
+        // as soon as possible.
+        //
+        //
+        // We are pick up the implementation based on test results above.
+        //
+#ifdef __DO_PROFILE__
+        {
+            static OptimisedUtilProfiler msOptimisedUtilProfiler;
+            return &msOptimisedUtilProfiler;
+        }
+
+#else   // !__DO_PROFILE__
+
+#if __OGRE_HAVE_SSE
+        if (PlatformInformation::getCpuFeatures() & PlatformInformation::CPU_FEATURE_SSE)
+        {
+            return _getOptimisedUtilSSE();
+        }
+        else
+#endif  // __OGRE_HAVE_SSE
+        {
+            return _getOptimisedUtilGeneral();
+        }
+
+#endif  // __DO_PROFILE__
+    }
+
+}
Index: /OgreMain/src/OgreOptimisedUtilGeneral.cpp
===================================================================
--- /OgreMain/src/OgreOptimisedUtilGeneral.cpp	(revision 5)
+++ /OgreMain/src/OgreOptimisedUtilGeneral.cpp	(revision 5)
@@ -0,0 +1,373 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreOptimisedUtil.h"
+
+#include "OgreVector3.h"
+#include "OgreMatrix4.h"
+
+namespace Ogre {
+
+//-------------------------------------------------------------------------
+// Local classes
+//-------------------------------------------------------------------------
+
+    /** General implementation of OptimisedUtil.
+    @note
+        Don't use this class directly, use OptimisedUtil instead.
+    */
+    class _OgrePrivate OptimisedUtilGeneral : public OptimisedUtil
+    {
+    public:
+        /// @copydoc OptimisedUtil::softwareVertexSkinning
+        virtual void softwareVertexSkinning(
+            const float *srcPosPtr, float *destPosPtr,
+            const float *srcNormPtr, float *destNormPtr,
+            const float *blendWeightPtr, const unsigned char* blendIndexPtr,
+            const Matrix4* const* blendMatrices,
+            size_t srcPosStride, size_t destPosStride,
+            size_t srcNormStride, size_t destNormStride,
+            size_t blendWeightStride, size_t blendIndexStride,
+            size_t numWeightsPerVertex,
+            size_t numVertices);
+
+        /// @copydoc OptimisedUtil::softwareVertexMorph
+        virtual void softwareVertexMorph(
+            Real t,
+            const float *srcPos1, const float *srcPos2,
+            float *dstPos,
+            size_t numVertices);
+
+        /// @copydoc OptimisedUtil::concatenateAffineMatrices
+        virtual void concatenateAffineMatrices(
+            const Matrix4& baseMatrix,
+            const Matrix4* srcMatrices,
+            Matrix4* dstMatrices,
+            size_t numMatrices);
+
+        /// @copydoc OptimisedUtil::calculateFaceNormals
+        virtual void calculateFaceNormals(
+            const float *positions,
+            const EdgeData::Triangle *triangles,
+            Vector4 *faceNormals,
+            size_t numTriangles);
+
+        /// @copydoc OptimisedUtil::calculateLightFacing
+        virtual void calculateLightFacing(
+            const Vector4& lightPos,
+            const Vector4* faceNormals,
+            char* lightFacings,
+            size_t numFaces);
+
+        /// @copydoc OptimisedUtil::extrudeVertices
+        virtual void extrudeVertices(
+            const Vector4& lightPos,
+            Real extrudeDist,
+            const float* srcPositions,
+            float* destPositions,
+            size_t numVertices);
+    };
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    void OptimisedUtilGeneral::softwareVertexSkinning(
+        const float *pSrcPos, float *pDestPos,
+        const float *pSrcNorm, float *pDestNorm,
+        const float *pBlendWeight, const unsigned char* pBlendIndex,
+        const Matrix4* const* blendMatrices,
+        size_t srcPosStride, size_t destPosStride,
+        size_t srcNormStride, size_t destNormStride,
+        size_t blendWeightStride, size_t blendIndexStride,
+        size_t numWeightsPerVertex,
+        size_t numVertices)
+    {
+        // Source vectors
+        Vector3 sourceVec, sourceNorm;
+        // Accumulation vectors
+        Vector3 accumVecPos, accumVecNorm;
+
+        // Loop per vertex
+        for (size_t vertIdx = 0; vertIdx < numVertices; ++vertIdx)
+        {
+            // Load source vertex elements
+            sourceVec.x = pSrcPos[0];
+            sourceVec.y = pSrcPos[1];
+            sourceVec.z = pSrcPos[2];
+
+            if (pSrcNorm)
+            {
+                sourceNorm.x = pSrcNorm[0];
+                sourceNorm.y = pSrcNorm[1];
+                sourceNorm.z = pSrcNorm[2];
+            }
+
+            // Load accumulators
+            accumVecPos = Vector3::ZERO;
+            accumVecNorm = Vector3::ZERO;
+
+            // Loop per blend weight
+            //
+            // Note: Don't change "unsigned short" here!!! If use "size_t" instead,
+            // VC7.1 unroll this loop to four blend weights pre-iteration, and then
+            // loss performance 10% in this function. Ok, this give a hint that we
+            // should unroll this loop manually for better performance, will do that
+            // later.
+            //
+            for (unsigned short blendIdx = 0; blendIdx < numWeightsPerVertex; ++blendIdx)
+            {
+                // Blend by multiplying source by blend matrix and scaling by weight
+                // Add to accumulator
+                // NB weights must be normalised!!
+                Real weight = pBlendWeight[blendIdx];
+                if (weight)
+                {
+                    // Blend position, use 3x4 matrix
+                    const Matrix4& mat = *blendMatrices[pBlendIndex[blendIdx]];
+                    accumVecPos.x +=
+                        (mat[0][0] * sourceVec.x +
+                         mat[0][1] * sourceVec.y +
+                         mat[0][2] * sourceVec.z +
+                         mat[0][3])
+                         * weight;
+                    accumVecPos.y +=
+                        (mat[1][0] * sourceVec.x +
+                         mat[1][1] * sourceVec.y +
+                         mat[1][2] * sourceVec.z +
+                         mat[1][3])
+                         * weight;
+                    accumVecPos.z +=
+                        (mat[2][0] * sourceVec.x +
+                         mat[2][1] * sourceVec.y +
+                         mat[2][2] * sourceVec.z +
+                         mat[2][3])
+                         * weight;
+                    if (pSrcNorm)
+                    {
+                        // Blend normal
+                        // We should blend by inverse transpose here, but because we're assuming the 3x3
+                        // aspect of the matrix is orthogonal (no non-uniform scaling), the inverse transpose
+                        // is equal to the main 3x3 matrix
+                        // Note because it's a normal we just extract the rotational part, saves us renormalising here
+                        accumVecNorm.x +=
+                            (mat[0][0] * sourceNorm.x +
+                             mat[0][1] * sourceNorm.y +
+                             mat[0][2] * sourceNorm.z)
+                             * weight;
+                        accumVecNorm.y +=
+                            (mat[1][0] * sourceNorm.x +
+                             mat[1][1] * sourceNorm.y +
+                             mat[1][2] * sourceNorm.z)
+                            * weight;
+                        accumVecNorm.z +=
+                            (mat[2][0] * sourceNorm.x +
+                             mat[2][1] * sourceNorm.y +
+                             mat[2][2] * sourceNorm.z)
+                            * weight;
+                    }
+                }
+            }
+
+            // Stored blended vertex in hardware buffer
+            pDestPos[0] = accumVecPos.x;
+            pDestPos[1] = accumVecPos.y;
+            pDestPos[2] = accumVecPos.z;
+
+            // Stored blended vertex in temp buffer
+            if (pSrcNorm)
+            {
+                // Normalise
+                accumVecNorm.normalise();
+                pDestNorm[0] = accumVecNorm.x;
+                pDestNorm[1] = accumVecNorm.y;
+                pDestNorm[2] = accumVecNorm.z;
+                // Advance pointers
+                advanceRawPointer(pSrcNorm, srcNormStride);
+                advanceRawPointer(pDestNorm, destNormStride);
+            }
+
+            // Advance pointers
+            advanceRawPointer(pSrcPos, srcPosStride);
+            advanceRawPointer(pDestPos, destPosStride);
+            advanceRawPointer(pBlendWeight, blendWeightStride);
+            advanceRawPointer(pBlendIndex, blendIndexStride);
+        }
+    }
+    //---------------------------------------------------------------------
+    void OptimisedUtilGeneral::concatenateAffineMatrices(
+        const Matrix4& baseMatrix,
+        const Matrix4* pSrcMat,
+        Matrix4* pDstMat,
+        size_t numMatrices)
+    {
+        const Matrix4& m = baseMatrix;
+
+        for (size_t i = 0; i < numMatrices; ++i)
+        {
+            const Matrix4& s = *pSrcMat;
+            Matrix4& d = *pDstMat;
+
+            // TODO: Promote following code to Matrix4 class.
+
+            d[0][0] = m[0][0] * s[0][0] + m[0][1] * s[1][0] + m[0][2] * s[2][0];
+            d[0][1] = m[0][0] * s[0][1] + m[0][1] * s[1][1] + m[0][2] * s[2][1];
+            d[0][2] = m[0][0] * s[0][2] + m[0][1] * s[1][2] + m[0][2] * s[2][2];
+            d[0][3] = m[0][0] * s[0][3] + m[0][1] * s[1][3] + m[0][2] * s[2][3] + m[0][3];
+
+            d[1][0] = m[1][0] * s[0][0] + m[1][1] * s[1][0] + m[1][2] * s[2][0];
+            d[1][1] = m[1][0] * s[0][1] + m[1][1] * s[1][1] + m[1][2] * s[2][1];
+            d[1][2] = m[1][0] * s[0][2] + m[1][1] * s[1][2] + m[1][2] * s[2][2];
+            d[1][3] = m[1][0] * s[0][3] + m[1][1] * s[1][3] + m[1][2] * s[2][3] + m[1][3];
+
+            d[2][0] = m[2][0] * s[0][0] + m[2][1] * s[1][0] + m[2][2] * s[2][0];
+            d[2][1] = m[2][0] * s[0][1] + m[2][1] * s[1][1] + m[2][2] * s[2][1];
+            d[2][2] = m[2][0] * s[0][2] + m[2][1] * s[1][2] + m[2][2] * s[2][2];
+            d[2][3] = m[2][0] * s[0][3] + m[2][1] * s[1][3] + m[2][2] * s[2][3] + m[2][3];
+
+            d[3][0] = 0;
+            d[3][1] = 0;
+            d[3][2] = 0;
+            d[3][3] = 1;
+
+            ++pSrcMat;
+            ++pDstMat;
+        }
+    }
+    //---------------------------------------------------------------------
+    void OptimisedUtilGeneral::softwareVertexMorph(
+        Real t,
+        const float *pSrc1, const float *pSrc2,
+        float *pDst,
+        size_t numVertices)
+    {
+        for (size_t i = 0; i < numVertices; ++i)
+        {
+            // x
+            *pDst++ = *pSrc1 + t * (*pSrc2 - *pSrc1) ;
+            ++pSrc1; ++pSrc2;
+            // y
+            *pDst++ = *pSrc1 + t * (*pSrc2 - *pSrc1) ;
+            ++pSrc1; ++pSrc2;
+            // z
+            *pDst++ = *pSrc1 + t * (*pSrc2 - *pSrc1) ;
+            ++pSrc1; ++pSrc2;
+        }
+    }
+    //---------------------------------------------------------------------
+    void OptimisedUtilGeneral::calculateFaceNormals(
+        const float *positions,
+        const EdgeData::Triangle *triangles,
+        Vector4 *faceNormals,
+        size_t numTriangles)
+    {
+        for ( ; numTriangles; --numTriangles)
+        {
+            const EdgeData::Triangle& t = *triangles++;
+            size_t offset;
+
+            offset = t.vertIndex[0] * 3;
+            Vector3 v1(positions[offset+0], positions[offset+1], positions[offset+2]);
+
+            offset = t.vertIndex[1] * 3;
+            Vector3 v2(positions[offset+0], positions[offset+1], positions[offset+2]);
+
+            offset = t.vertIndex[2] * 3;
+            Vector3 v3(positions[offset+0], positions[offset+1], positions[offset+2]);
+
+            *faceNormals++ = Math::calculateFaceNormalWithoutNormalize(v1, v2, v3);
+        }
+    }
+    //---------------------------------------------------------------------
+    void OptimisedUtilGeneral::calculateLightFacing(
+        const Vector4& lightPos,
+        const Vector4* faceNormals,
+        char* lightFacings,
+        size_t numFaces)
+    {
+        for (size_t i = 0; i < numFaces; ++i)
+        {
+            *lightFacings++ = (lightPos.dotProduct(*faceNormals++) > 0);
+        }
+    }
+    //---------------------------------------------------------------------
+    void OptimisedUtilGeneral::extrudeVertices(
+        const Vector4& lightPos,
+        Real extrudeDist,
+        const float* pSrcPos,
+        float* pDestPos,
+        size_t numVertices)
+    {
+        if (lightPos.w == 0.0f)
+        {
+            // Directional light, extrusion is along light direction
+
+            Vector3 extrusionDir(
+                -lightPos.x,
+                -lightPos.y,
+                -lightPos.z);
+            extrusionDir.normalise();
+            extrusionDir *= extrudeDist;
+
+            for (size_t vert = 0; vert < numVertices; ++vert)
+            {
+                *pDestPos++ = *pSrcPos++ + extrusionDir.x;
+                *pDestPos++ = *pSrcPos++ + extrusionDir.y;
+                *pDestPos++ = *pSrcPos++ + extrusionDir.z;
+            }
+        }
+        else
+        {
+            // Point light, calculate extrusionDir for every vertex
+            assert(lightPos.w == 1.0f);
+
+            for (size_t vert = 0; vert < numVertices; ++vert)
+            {
+                Vector3 extrusionDir(
+                    pSrcPos[0] - lightPos.x,
+                    pSrcPos[1] - lightPos.y,
+                    pSrcPos[2] - lightPos.z);
+                extrusionDir.normalise();
+                extrusionDir *= extrudeDist;
+
+                *pDestPos++ = *pSrcPos++ + extrusionDir.x;
+                *pDestPos++ = *pSrcPos++ + extrusionDir.y;
+                *pDestPos++ = *pSrcPos++ + extrusionDir.z;
+            }
+        }
+    }
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    extern OptimisedUtil* _getOptimisedUtilGeneral(void)
+    {
+        static OptimisedUtilGeneral msOptimisedUtilGeneral;
+        return &msOptimisedUtilGeneral;
+    }
+
+}
Index: /OgreMain/src/OgreOptimisedUtilSSE.cpp
===================================================================
--- /OgreMain/src/OgreOptimisedUtilSSE.cpp	(revision 5)
+++ /OgreMain/src/OgreOptimisedUtilSSE.cpp	(revision 5)
@@ -0,0 +1,2080 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreOptimisedUtil.h"
+#include "OgrePlatformInformation.h"
+
+#if __OGRE_HAVE_SSE
+
+#include "OgreMatrix4.h"
+
+// Should keep this includes at latest to avoid potential "xmmintrin.h" included by
+// other header file on some platform for some reason.
+#include "OgreSIMDHelper.h"
+
+// I'd like to merge this file with OgreOptimisedUtil.cpp, but it's
+// impossible when compile with gcc, due SSE instructions can only
+// enable/disable at file level.
+
+//-------------------------------------------------------------------------
+//
+// The routines implemented in this file are performance oriented,
+// which means saving every penny as possible. This requirement might
+// break some C++/STL-rules.
+//
+//
+// Some rules I'd like to respects:
+//
+// 1. Had better use unpacklo/hi, movelh/hl instead of shuffle because
+//    it can saving one byte of binary code :)
+// 2. Use add/sub instead of mul.
+// 3. Eliminate prolog code of function call.
+//
+// The last, anything recommended by Intel Optimization Reference Manual.
+//
+//-------------------------------------------------------------------------
+
+// Use unrolled SSE version when vertices exceeds this limit
+#define OGRE_SSE_SKINNING_UNROLL_VERTICES  16
+
+namespace Ogre {
+
+//-------------------------------------------------------------------------
+// Local classes
+//-------------------------------------------------------------------------
+
+    /** SSE implementation of OptimisedUtil.
+    @note
+        Don't use this class directly, use OptimisedUtil instead.
+    */
+    class _OgrePrivate OptimisedUtilSSE : public OptimisedUtil
+    {
+    protected:
+        /// Does we prefer use general SSE version for position/normals shared buffers?
+        bool mPreferGeneralVersionForSharedBuffers;
+
+    public:
+        /// Constructor
+        OptimisedUtilSSE(void);
+
+        /// @copydoc OptimisedUtil::softwareVertexSkinning
+        virtual void softwareVertexSkinning(
+            const float *srcPosPtr, float *destPosPtr,
+            const float *srcNormPtr, float *destNormPtr,
+            const float *blendWeightPtr, const unsigned char* blendIndexPtr,
+            const Matrix4* const* blendMatrices,
+            size_t srcPosStride, size_t destPosStride,
+            size_t srcNormStride, size_t destNormStride,
+            size_t blendWeightStride, size_t blendIndexStride,
+            size_t numWeightsPerVertex,
+            size_t numVertices);
+
+        /// @copydoc OptimisedUtil::softwareVertexMorph
+        virtual void softwareVertexMorph(
+            Real t,
+            const float *srcPos1, const float *srcPos2,
+            float *dstPos,
+            size_t numVertices);
+
+        /// @copydoc OptimisedUtil::concatenateAffineMatrices
+        virtual void concatenateAffineMatrices(
+            const Matrix4& baseMatrix,
+            const Matrix4* srcMatrices,
+            Matrix4* dstMatrices,
+            size_t numMatrices);
+
+        /// @copydoc OptimisedUtil::calculateFaceNormals
+        virtual void calculateFaceNormals(
+            const float *positions,
+            const EdgeData::Triangle *triangles,
+            Vector4 *faceNormals,
+            size_t numTriangles);
+
+        /// @copydoc OptimisedUtil::calculateLightFacing
+        virtual void calculateLightFacing(
+            const Vector4& lightPos,
+            const Vector4* faceNormals,
+            char* lightFacings,
+            size_t numFaces);
+
+        /// @copydoc OptimisedUtil::extrudeVertices
+        virtual void extrudeVertices(
+            const Vector4& lightPos,
+            Real extrudeDist,
+            const float* srcPositions,
+            float* destPositions,
+            size_t numVertices);
+    };
+
+#if defined(__OGRE_SIMD_ALIGN_STACK)
+    /** Stack-align implementation of OptimisedUtil.
+    @remarks
+        User code compiled by icc and gcc might not align stack
+        properly, we need ensure stack align to a 16-bytes boundary
+        when execute SSE function.
+    @par
+        We implemeted as align stack following a virtual function call,
+        then should guarantee call instruction are used instead of inline
+        underlying function body here (which might causing problem).
+    @note
+        Don't use this class directly, use OptimisedUtil instead.
+    */
+    class _OgrePrivate OptimisedUtilWithStackAlign : public OptimisedUtil
+    {
+    protected:
+        /// The actual implementation
+        OptimisedUtil* mImpl;
+
+    public:
+        /// Constructor
+        OptimisedUtilWithStackAlign(OptimisedUtil* impl)
+            : mImpl(impl)
+        {
+        }
+
+        /// @copydoc OptimisedUtil::softwareVertexSkinning
+        virtual void softwareVertexSkinning(
+            const float *srcPosPtr, float *destPosPtr,
+            const float *srcNormPtr, float *destNormPtr,
+            const float *blendWeightPtr, const unsigned char* blendIndexPtr,
+            const Matrix4* const* blendMatrices,
+            size_t srcPosStride, size_t destPosStride,
+            size_t srcNormStride, size_t destNormStride,
+            size_t blendWeightStride, size_t blendIndexStride,
+            size_t numWeightsPerVertex,
+            size_t numVertices)
+        {
+            __OGRE_SIMD_ALIGN_STACK();
+
+            mImpl->softwareVertexSkinning(
+                srcPosPtr, destPosPtr,
+                srcNormPtr, destNormPtr,
+                blendWeightPtr, blendIndexPtr,
+                blendMatrices,
+                srcPosStride, destPosStride,
+                srcNormStride, destNormStride,
+                blendWeightStride, blendIndexStride,
+                numWeightsPerVertex,
+                numVertices);
+        }
+
+        /// @copydoc OptimisedUtil::softwareVertexMorph
+        virtual void softwareVertexMorph(
+            Real t,
+            const float *srcPos1, const float *srcPos2,
+            float *dstPos,
+            size_t numVertices)
+        {
+            __OGRE_SIMD_ALIGN_STACK();
+
+            mImpl->softwareVertexMorph(
+                t,
+                srcPos1, srcPos2,
+                dstPos,
+                numVertices);
+        }
+
+        /// @copydoc OptimisedUtil::concatenateAffineMatrices
+        virtual void concatenateAffineMatrices(
+            const Matrix4& baseMatrix,
+            const Matrix4* srcMatrices,
+            Matrix4* dstMatrices,
+            size_t numMatrices)
+        {
+            __OGRE_SIMD_ALIGN_STACK();
+
+            mImpl->concatenateAffineMatrices(
+                baseMatrix,
+                srcMatrices,
+                dstMatrices,
+                numMatrices);
+        }
+
+        /// @copydoc OptimisedUtil::calculateFaceNormals
+        virtual void calculateFaceNormals(
+            const float *positions,
+            const EdgeData::Triangle *triangles,
+            Vector4 *faceNormals,
+            size_t numTriangles)
+        {
+            __OGRE_SIMD_ALIGN_STACK();
+
+            mImpl->calculateFaceNormals(
+                positions,
+                triangles,
+                faceNormals,
+                numTriangles);
+        }
+
+        /// @copydoc OptimisedUtil::calculateLightFacing
+        virtual void calculateLightFacing(
+            const Vector4& lightPos,
+            const Vector4* faceNormals,
+            char* lightFacings,
+            size_t numFaces)
+        {
+            __OGRE_SIMD_ALIGN_STACK();
+
+            mImpl->calculateLightFacing(
+                lightPos,
+                faceNormals,
+                lightFacings,
+                numFaces);
+        }
+
+        /// @copydoc OptimisedUtil::extrudeVertices
+        virtual void extrudeVertices(
+            const Vector4& lightPos,
+            Real extrudeDist,
+            const float* srcPositions,
+            float* destPositions,
+            size_t numVertices)
+        {
+            __OGRE_SIMD_ALIGN_STACK();
+
+            mImpl->extrudeVertices(
+                lightPos,
+                extrudeDist,
+                srcPositions,
+                destPositions,
+                numVertices);
+        }
+    };
+#endif  // !defined(__OGRE_SIMD_ALIGN_STACK)
+
+//---------------------------------------------------------------------
+// Some useful macro for collapse matrices.
+//---------------------------------------------------------------------
+
+#define __LOAD_MATRIX(row0, row1, row2, pMatrix)                        \
+    {                                                                   \
+        row0 = __MM_LOAD_PS((*pMatrix)[0]);                             \
+        row1 = __MM_LOAD_PS((*pMatrix)[1]);                             \
+        row2 = __MM_LOAD_PS((*pMatrix)[2]);                             \
+    }
+
+#define __LERP_MATRIX(row0, row1, row2, weight, pMatrix)                \
+    {                                                                   \
+        row0 = __MM_LERP_PS(weight, row0, __MM_LOAD_PS((*pMatrix)[0])); \
+        row1 = __MM_LERP_PS(weight, row1, __MM_LOAD_PS((*pMatrix)[1])); \
+        row2 = __MM_LERP_PS(weight, row2, __MM_LOAD_PS((*pMatrix)[2])); \
+    }
+
+#define __LOAD_WEIGHTED_MATRIX(row0, row1, row2, weight, pMatrix)       \
+    {                                                                   \
+        row0 = _mm_mul_ps(__MM_LOAD_PS((*pMatrix)[0]), weight);         \
+        row1 = _mm_mul_ps(__MM_LOAD_PS((*pMatrix)[1]), weight);         \
+        row2 = _mm_mul_ps(__MM_LOAD_PS((*pMatrix)[2]), weight);         \
+    }
+
+#define __ACCUM_WEIGHTED_MATRIX(row0, row1, row2, weight, pMatrix)      \
+    {                                                                   \
+        row0 = __MM_MADD_PS(__MM_LOAD_PS((*pMatrix)[0]), weight, row0); \
+        row1 = __MM_MADD_PS(__MM_LOAD_PS((*pMatrix)[1]), weight, row1); \
+        row2 = __MM_MADD_PS(__MM_LOAD_PS((*pMatrix)[2]), weight, row2); \
+    }
+
+//---------------------------------------------------------------------
+// The following macros request variables declared by caller.
+//
+// :) Thank row-major matrix used in Ogre, it make we accessing affine matrix easy.
+//---------------------------------------------------------------------
+
+/** Collapse one-weighted matrix.
+    Eliminated multiply by weight since the weight should be equal to one always
+*/
+#define __COLLAPSE_MATRIX_W1(row0, row1, row2, ppMatrices, pIndices, pWeights)  \
+    {                                                                           \
+        pMatrix0 = blendMatrices[pIndices[0]];                                  \
+        __LOAD_MATRIX(row0, row1, row2, pMatrix0);                              \
+    }
+
+/** Collapse two-weighted matrix.
+    Based on the fact that accumulated weights are equal to one, by use lerp,
+    replaced two multiplies and one additive with one multiplie and two additives.
+*/
+#define __COLLAPSE_MATRIX_W2(row0, row1, row2, ppMatrices, pIndices, pWeights)  \
+    {                                                                           \
+        weight = _mm_load_ps1(pWeights + 1);                                    \
+        pMatrix0 = ppMatrices[pIndices[0]];                                     \
+        __LOAD_MATRIX(row0, row1, row2, pMatrix0);                              \
+        pMatrix1 = ppMatrices[pIndices[1]];                                     \
+        __LERP_MATRIX(row0, row1, row2, weight, pMatrix1);                      \
+    }
+
+/** Collapse three-weighted matrix.
+*/
+#define __COLLAPSE_MATRIX_W3(row0, row1, row2, ppMatrices, pIndices, pWeights)  \
+    {                                                                           \
+        weight = _mm_load_ps1(pWeights + 0);                                    \
+        pMatrix0 = ppMatrices[pIndices[0]];                                     \
+        __LOAD_WEIGHTED_MATRIX(row0, row1, row2, weight, pMatrix0);             \
+        weight = _mm_load_ps1(pWeights + 1);                                    \
+        pMatrix1 = ppMatrices[pIndices[1]];                                     \
+        __ACCUM_WEIGHTED_MATRIX(row0, row1, row2, weight, pMatrix1);            \
+        weight = _mm_load_ps1(pWeights + 2);                                    \
+        pMatrix2 = ppMatrices[pIndices[2]];                                     \
+        __ACCUM_WEIGHTED_MATRIX(row0, row1, row2, weight, pMatrix2);            \
+    }
+
+/** Collapse four-weighted matrix.
+*/
+#define __COLLAPSE_MATRIX_W4(row0, row1, row2, ppMatrices, pIndices, pWeights)  \
+    {                                                                           \
+        /* Load four blend weights at one time, they will be shuffled later */  \
+        weights = _mm_loadu_ps(pWeights);                                       \
+                                                                                \
+        pMatrix0 = ppMatrices[pIndices[0]];                                     \
+        weight = __MM_SELECT(weights, 0);                                       \
+        __LOAD_WEIGHTED_MATRIX(row0, row1, row2, weight, pMatrix0);             \
+        pMatrix1 = ppMatrices[pIndices[1]];                                     \
+        weight = __MM_SELECT(weights, 1);                                       \
+        __ACCUM_WEIGHTED_MATRIX(row0, row1, row2, weight, pMatrix1);            \
+        pMatrix2 = ppMatrices[pIndices[2]];                                     \
+        weight = __MM_SELECT(weights, 2);                                       \
+        __ACCUM_WEIGHTED_MATRIX(row0, row1, row2, weight, pMatrix2);            \
+        pMatrix3 = ppMatrices[pIndices[3]];                                     \
+        weight = __MM_SELECT(weights, 3);                                       \
+        __ACCUM_WEIGHTED_MATRIX(row0, row1, row2, weight, pMatrix3);            \
+    }
+
+
+
+    //---------------------------------------------------------------------
+    // Collapse a matrix at one time. The collapsed matrix are weighted by
+    // blend-weights, and then can use to transform corresponding vertex directly.
+    //
+    // I'd like use inline function instead of macro here, but I also want to
+    // ensure compiler integrate this code into its callers (release build at
+    // least), doesn't matter about specific compile options. Inline function
+    // work fine for VC, but looks like gcc (3.4.4 here) generate function-call
+    // when implemented as inline function, even if compile with "-O3" option.
+    //
+#define _collapseOneMatrix(                                                     \
+        m00, m01, m02,                                                          \
+        pBlendWeight, pBlendIndex,                                              \
+        blendMatrices,                                                          \
+        blendWeightStride, blendIndexStride,                                    \
+        numWeightsPerVertex)                                                    \
+    {                                                                           \
+        /* Important Note: If reuse pMatrixXXX frequently, M$ VC7.1 will */     \
+        /* generate wrong code here!!!                                   */     \
+        const Matrix4* pMatrix0, *pMatrix1, *pMatrix2, *pMatrix3;               \
+        __m128 weight, weights;                                                 \
+                                                                                \
+        switch (numWeightsPerVertex)                                            \
+        {                                                                       \
+        default:    /* Just in case and make compiler happy */                  \
+        case 1:                                                                 \
+            __COLLAPSE_MATRIX_W1(m00, m01, m02, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 0 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 0 * blendWeightStride));         \
+            break;                                                              \
+                                                                                \
+        case 2:                                                                 \
+            __COLLAPSE_MATRIX_W2(m00, m01, m02, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 0 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 0 * blendWeightStride));         \
+            break;                                                              \
+                                                                                \
+        case 3:                                                                 \
+            __COLLAPSE_MATRIX_W3(m00, m01, m02, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 0 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 0 * blendWeightStride));         \
+            break;                                                              \
+                                                                                \
+        case 4:                                                                 \
+            __COLLAPSE_MATRIX_W4(m00, m01, m02, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 0 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 0 * blendWeightStride));         \
+            break;                                                              \
+        }                                                                       \
+    }
+
+    //---------------------------------------------------------------------
+    // Collapse four matrices at one time. The collapsed matrix are weighted by
+    // blend-weights, and then can use to transform corresponding vertex directly.
+    //
+    // I'd like use inline function instead of macro here, but I also want to
+    // ensure compiler integrate this code into its callers (release build at
+    // least), doesn't matter about specific compile options. Inline function
+    // work fine for VC, but looks like gcc (3.4.4 here) generate function-call
+    // when implemented as inline function, even if compile with "-O3" option.
+    //
+#define _collapseFourMatrices(                                                  \
+        m00, m01, m02,                                                          \
+        m10, m11, m12,                                                          \
+        m20, m21, m22,                                                          \
+        m30, m31, m32,                                                          \
+        pBlendWeight, pBlendIndex,                                              \
+        blendMatrices,                                                          \
+        blendWeightStride, blendIndexStride,                                    \
+        numWeightsPerVertex)                                                    \
+    {                                                                           \
+        /* Important Note: If reuse pMatrixXXX frequently, M$ VC7.1 will */     \
+        /* generate wrong code here!!!                                   */     \
+        const Matrix4* pMatrix0, *pMatrix1, *pMatrix2, *pMatrix3;               \
+        __m128 weight, weights;                                                 \
+                                                                                \
+        switch (numWeightsPerVertex)                                            \
+        {                                                                       \
+        default:    /* Just in case and make compiler happy */                  \
+        case 1:                                                                 \
+            __COLLAPSE_MATRIX_W1(m00, m01, m02, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 0 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 0 * blendWeightStride));         \
+            __COLLAPSE_MATRIX_W1(m10, m11, m12, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 1 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 1 * blendWeightStride));         \
+            __COLLAPSE_MATRIX_W1(m20, m21, m22, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 2 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 2 * blendWeightStride));         \
+            __COLLAPSE_MATRIX_W1(m30, m31, m32, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 3 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 3 * blendWeightStride));         \
+            break;                                                              \
+                                                                                \
+        case 2:                                                                 \
+            __COLLAPSE_MATRIX_W2(m00, m01, m02, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 0 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 0 * blendWeightStride));         \
+            __COLLAPSE_MATRIX_W2(m10, m11, m12, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 1 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 1 * blendWeightStride));         \
+            __COLLAPSE_MATRIX_W2(m20, m21, m22, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 2 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 2 * blendWeightStride));         \
+            __COLLAPSE_MATRIX_W2(m30, m31, m32, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 3 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 3 * blendWeightStride));         \
+            break;                                                              \
+                                                                                \
+        case 3:                                                                 \
+            __COLLAPSE_MATRIX_W3(m00, m01, m02, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 0 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 0 * blendWeightStride));         \
+            __COLLAPSE_MATRIX_W3(m10, m11, m12, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 1 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 1 * blendWeightStride));         \
+            __COLLAPSE_MATRIX_W3(m20, m21, m22, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 2 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 2 * blendWeightStride));         \
+            __COLLAPSE_MATRIX_W3(m30, m31, m32, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 3 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 3 * blendWeightStride));         \
+            break;                                                              \
+                                                                                \
+        case 4:                                                                 \
+            __COLLAPSE_MATRIX_W4(m00, m01, m02, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 0 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 0 * blendWeightStride));         \
+            __COLLAPSE_MATRIX_W4(m10, m11, m12, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 1 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 1 * blendWeightStride));         \
+            __COLLAPSE_MATRIX_W4(m20, m21, m22, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 2 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 2 * blendWeightStride));         \
+            __COLLAPSE_MATRIX_W4(m30, m31, m32, blendMatrices,                  \
+                rawOffsetPointer(pBlendIndex, 3 * blendIndexStride),            \
+                rawOffsetPointer(pBlendWeight, 3 * blendWeightStride));         \
+            break;                                                              \
+        }                                                                       \
+    }
+
+
+
+    //---------------------------------------------------------------------
+    // General SSE version skinning positions, and optional skinning normals.
+    static void softwareVertexSkinning_SSE_General(
+        const float *pSrcPos, float *pDestPos,
+        const float *pSrcNorm, float *pDestNorm,
+        const float *pBlendWeight, const unsigned char* pBlendIndex,
+        const Matrix4* const* blendMatrices,
+        size_t srcPosStride, size_t destPosStride,
+        size_t srcNormStride, size_t destNormStride,
+        size_t blendWeightStride, size_t blendIndexStride,
+        size_t numWeightsPerVertex,
+        size_t numVertices)
+    {
+        for (size_t i = 0; i < numVertices; ++i)
+        {
+            // Collapse matrices
+            __m128 m00, m01, m02;
+            _collapseOneMatrix(
+                m00, m01, m02,
+                pBlendWeight, pBlendIndex,
+                blendMatrices,
+                blendWeightStride, blendIndexStride,
+                numWeightsPerVertex);
+
+            // Advance blend weight and index pointers
+            advanceRawPointer(pBlendWeight, blendWeightStride);
+            advanceRawPointer(pBlendIndex, blendIndexStride);
+
+            //------------------------------------------------------------------
+
+            // Rearrange to column-major matrix with rows shuffled order to: Z 0 X Y
+            __m128 m03 = _mm_setzero_ps();
+            __MM_TRANSPOSE4x4_PS(m02, m03, m00, m01);
+
+            //------------------------------------------------------------------
+            // Transform position
+            //------------------------------------------------------------------
+
+            __m128 s0, s1, s2;
+
+            // Load source position
+            s0 = _mm_load_ps1(pSrcPos + 0);
+            s1 = _mm_load_ps1(pSrcPos + 1);
+            s2 = _mm_load_ps1(pSrcPos + 2);
+
+            // Transform by collapsed matrix
+            __m128 accumPos = __MM_DOT4x3_PS(m02, m03, m00, m01, s0, s1, s2);   // z 0 x y
+
+            // Store blended position, no aligned requirement
+            _mm_storeh_pi((__m64*)pDestPos, accumPos);
+            _mm_store_ss(pDestPos+2, accumPos);
+
+            // Advance source and target position pointers
+            advanceRawPointer(pSrcPos, srcPosStride);
+            advanceRawPointer(pDestPos, destPosStride);
+
+            //------------------------------------------------------------------
+            // Optional blend normal
+            //------------------------------------------------------------------
+
+            if (pSrcNorm)
+            {
+                // Load source normal
+                s0 = _mm_load_ps1(pSrcNorm + 0);
+                s1 = _mm_load_ps1(pSrcNorm + 1);
+                s2 = _mm_load_ps1(pSrcNorm + 2);
+
+                // Transform by collapsed matrix
+                __m128 accumNorm = __MM_DOT3x3_PS(m02, m03, m00, s0, s1, s2);   // z 0 x y
+
+                // Normalise normal
+                __m128 tmp = _mm_mul_ps(accumNorm, accumNorm);                  // z^2 0 x^2 y^2
+                tmp = __MM_ACCUM3_PS(tmp,
+                        _mm_shuffle_ps(tmp, tmp, _MM_SHUFFLE(0,3,1,2)),         // x^2 0 y^2 z^2
+                        _mm_shuffle_ps(tmp, tmp, _MM_SHUFFLE(2,0,1,3)));        // y^2 0 z^2 x^2
+                // Note: zero divided here, but neglectable
+                tmp = __MM_RSQRT_PS(tmp);
+                accumNorm = _mm_mul_ps(accumNorm, tmp);
+
+                // Store blended normal, no aligned requirement
+                _mm_storeh_pi((__m64*)pDestNorm, accumNorm);
+                _mm_store_ss(pDestNorm+2, accumNorm);
+
+                // Advance source and target normal pointers
+                advanceRawPointer(pSrcNorm, srcNormStride);
+                advanceRawPointer(pDestNorm, destNormStride);
+            }
+        }
+    }
+    //---------------------------------------------------------------------
+    // Special SSE version skinning shared buffers of position and normal,
+    // and the buffer are packed.
+    template <bool srcAligned, bool destAligned>
+    struct SoftwareVertexSkinning_SSE_PosNorm_Shared_Packed
+    {
+        static void apply(
+            const float* pSrc, float* pDest,
+            const float* pBlendWeight, const unsigned char* pBlendIndex,
+            const Matrix4* const* blendMatrices,
+            size_t blendWeightStride, size_t blendIndexStride,
+            size_t numWeightsPerVertex,
+            size_t numIterations)
+        {
+            typedef SSEMemoryAccessor<srcAligned> SrcAccessor;
+            typedef SSEMemoryAccessor<destAligned> DestAccessor;
+
+            // Blending 4 vertices per-iteration
+            for (size_t i = 0; i < numIterations; ++i)
+            {
+                // Collapse matrices
+                __m128 m00, m01, m02, m10, m11, m12, m20, m21, m22, m30, m31, m32;
+                _collapseFourMatrices(
+                    m00, m01, m02,
+                    m10, m11, m12,
+                    m20, m21, m22,
+                    m30, m31, m32,
+                    pBlendWeight, pBlendIndex,
+                    blendMatrices,
+                    blendWeightStride, blendIndexStride,
+                    numWeightsPerVertex);
+
+                // Advance 4 vertices
+                advanceRawPointer(pBlendWeight, 4 * blendWeightStride);
+                advanceRawPointer(pBlendIndex, 4 * blendIndexStride);
+
+                //------------------------------------------------------------------
+                // Transform position/normals
+                //------------------------------------------------------------------
+
+                __m128 s0, s1, s2, s3, s4, s5, d0, d1, d2, d3, d4, d5;
+                __m128 t0, t1, t2, t3, t4, t5;
+
+                // Load source position/normals
+                s0 = SrcAccessor::load(pSrc + 0);                       // px0 py0 pz0 nx0
+                s1 = SrcAccessor::load(pSrc + 4);                       // ny0 nz0 px1 py1
+                s2 = SrcAccessor::load(pSrc + 8);                       // pz1 nx1 ny1 nz1
+                s3 = SrcAccessor::load(pSrc + 12);                      // px2 py2 pz2 nx2
+                s4 = SrcAccessor::load(pSrc + 16);                      // ny2 nz2 px3 py3
+                s5 = SrcAccessor::load(pSrc + 20);                      // pz3 nx3 ny3 nz3
+
+                // Rearrange to component-major for batches calculate.
+
+                t0 = _mm_unpacklo_ps(s0, s3);                           // px0 px2 py0 py2
+                t1 = _mm_unpackhi_ps(s0, s3);                           // pz0 pz2 nx0 nx2
+                t2 = _mm_unpacklo_ps(s1, s4);                           // ny0 ny2 nz0 nz2
+                t3 = _mm_unpackhi_ps(s1, s4);                           // px1 px3 py1 py3
+                t4 = _mm_unpacklo_ps(s2, s5);                           // pz1 pz3 nx1 nx3
+                t5 = _mm_unpackhi_ps(s2, s5);                           // ny1 ny3 nz1 nz3
+
+                s0 = _mm_unpacklo_ps(t0, t3);                           // px0 px1 px2 px3
+                s1 = _mm_unpackhi_ps(t0, t3);                           // py0 py1 py2 py3
+                s2 = _mm_unpacklo_ps(t1, t4);                           // pz0 pz1 pz2 pz3
+                s3 = _mm_unpackhi_ps(t1, t4);                           // nx0 nx1 nx2 nx3
+                s4 = _mm_unpacklo_ps(t2, t5);                           // ny0 ny1 ny2 ny3
+                s5 = _mm_unpackhi_ps(t2, t5);                           // nz0 nz1 nz2 nz3
+
+                // Transform by collapsed matrix
+
+                // Shuffle row 0 of four collapsed matrices for calculate X component
+                __MM_TRANSPOSE4x4_PS(m00, m10, m20, m30);
+
+                // Transform X components
+                d0 = __MM_DOT4x3_PS(m00, m10, m20, m30, s0, s1, s2);    // PX0 PX1 PX2 PX3
+                d3 = __MM_DOT3x3_PS(m00, m10, m20, s3, s4, s5);         // NX0 NX1 NX2 NX3
+
+                // Shuffle row 1 of four collapsed matrices for calculate Y component
+                __MM_TRANSPOSE4x4_PS(m01, m11, m21, m31);
+
+                // Transform Y components
+                d1 = __MM_DOT4x3_PS(m01, m11, m21, m31, s0, s1, s2);    // PY0 PY1 PY2 PY3
+                d4 = __MM_DOT3x3_PS(m01, m11, m21, s3, s4, s5);         // NY0 NY1 NY2 NY3
+
+                // Shuffle row 2 of four collapsed matrices for calculate Z component
+                __MM_TRANSPOSE4x4_PS(m02, m12, m22, m32);
+
+                // Transform Z components
+                d2 = __MM_DOT4x3_PS(m02, m12, m22, m32, s0, s1, s2);    // PZ0 PZ1 PZ2 PZ3
+                d5 = __MM_DOT3x3_PS(m02, m12, m22, s3, s4, s5);         // NZ0 NZ1 NZ2 NZ3
+
+                // Normalise normals
+                __m128 tmp = __MM_DOT3x3_PS(d3, d4, d5, d3, d4, d5);
+                tmp = __MM_RSQRT_PS(tmp);
+                d3 = _mm_mul_ps(d3, tmp);
+                d4 = _mm_mul_ps(d4, tmp);
+                d5 = _mm_mul_ps(d5, tmp);
+
+                // Arrange back to continuous format for store results
+
+                t0 = _mm_unpacklo_ps(d0, d1);                           // PX0 PY0 PX1 PY1
+                t1 = _mm_unpackhi_ps(d0, d1);                           // PX2 PY2 PX3 PY3
+                t2 = _mm_unpacklo_ps(d2, d3);                           // PZ0 NX0 PZ1 NX1
+                t3 = _mm_unpackhi_ps(d2, d3);                           // PZ2 NX2 PZ3 NX3
+                t4 = _mm_unpacklo_ps(d4, d5);                           // NY0 NZ0 NY1 NZ1
+                t5 = _mm_unpackhi_ps(d4, d5);                           // NY2 NZ2 NY3 NZ3
+
+                d0 = _mm_movelh_ps(t0, t2);                             // PX0 PY0 PZ0 NX0
+                d1 = _mm_shuffle_ps(t4, t0, _MM_SHUFFLE(3,2,1,0));      // NY0 NZ0 PX1 PY1
+                d2 = _mm_movehl_ps(t4, t2);                             // PZ1 NX1 NY1 NZ1
+                d3 = _mm_movelh_ps(t1, t3);                             // PX2 PY2 PZ2 NX2
+                d4 = _mm_shuffle_ps(t5, t1, _MM_SHUFFLE(3,2,1,0));      // NY2 NZ2 PX3 PY3
+                d5 = _mm_movehl_ps(t5, t3);                             // PZ3 NX3 NY3 NZ3
+
+                // Store blended position/normals
+                DestAccessor::store(pDest + 0, d0);
+                DestAccessor::store(pDest + 4, d1);
+                DestAccessor::store(pDest + 8, d2);
+                DestAccessor::store(pDest + 12, d3);
+                DestAccessor::store(pDest + 16, d4);
+                DestAccessor::store(pDest + 20, d5);
+
+                // Advance 4 vertices
+                pSrc += 4 * (3 + 3);
+                pDest += 4 * (3 + 3);
+            }
+        }
+    };
+    static FORCEINLINE void softwareVertexSkinning_SSE_PosNorm_Shared_Packed(
+            const float* pSrcPos, float* pDestPos,
+            const float* pBlendWeight, const unsigned char* pBlendIndex,
+            const Matrix4* const* blendMatrices,
+            size_t blendWeightStride, size_t blendIndexStride,
+            size_t numWeightsPerVertex,
+            size_t numIterations)
+    {
+        // pSrcPos might can't align to 16 bytes because 8 bytes alignment shift per-vertex
+
+        // Instantiating two version only, since other alignement combination not that important.
+        if (_isAlignedForSSE(pSrcPos) && _isAlignedForSSE(pDestPos))
+        {
+            SoftwareVertexSkinning_SSE_PosNorm_Shared_Packed<true, true>::apply(
+                pSrcPos, pDestPos,
+                pBlendWeight, pBlendIndex,
+                blendMatrices,
+                blendWeightStride, blendIndexStride,
+                numWeightsPerVertex,
+                numIterations);
+        }
+        else
+        {
+            SoftwareVertexSkinning_SSE_PosNorm_Shared_Packed<false, false>::apply(
+                pSrcPos, pDestPos,
+                pBlendWeight, pBlendIndex,
+                blendMatrices,
+                blendWeightStride, blendIndexStride,
+                numWeightsPerVertex,
+                numIterations);
+        }
+    }
+    //---------------------------------------------------------------------
+    // Special SSE version skinning separated buffers of position and normal,
+    // both of position and normal buffer are packed.
+    template <bool srcPosAligned, bool destPosAligned, bool srcNormAligned, bool destNormAligned>
+    struct SoftwareVertexSkinning_SSE_PosNorm_Separated_Packed
+    {
+        static void apply(
+            const float* pSrcPos, float* pDestPos,
+            const float* pSrcNorm, float* pDestNorm,
+            const float* pBlendWeight, const unsigned char* pBlendIndex,
+            const Matrix4* const* blendMatrices,
+            size_t blendWeightStride, size_t blendIndexStride,
+            size_t numWeightsPerVertex,
+            size_t numIterations)
+        {
+            typedef SSEMemoryAccessor<srcPosAligned> SrcPosAccessor;
+            typedef SSEMemoryAccessor<destPosAligned> DestPosAccessor;
+            typedef SSEMemoryAccessor<srcNormAligned> SrcNormAccessor;
+            typedef SSEMemoryAccessor<destNormAligned> DestNormAccessor;
+
+            // Blending 4 vertices per-iteration
+            for (size_t i = 0; i < numIterations; ++i)
+            {
+                // Collapse matrices
+                __m128 m00, m01, m02, m10, m11, m12, m20, m21, m22, m30, m31, m32;
+                _collapseFourMatrices(
+                    m00, m01, m02,
+                    m10, m11, m12,
+                    m20, m21, m22,
+                    m30, m31, m32,
+                    pBlendWeight, pBlendIndex,
+                    blendMatrices,
+                    blendWeightStride, blendIndexStride,
+                    numWeightsPerVertex);
+
+                // Advance 4 vertices
+                advanceRawPointer(pBlendWeight, 4 * blendWeightStride);
+                advanceRawPointer(pBlendIndex, 4 * blendIndexStride);
+
+                //------------------------------------------------------------------
+                // Transform positions
+                //------------------------------------------------------------------
+
+                __m128 s0, s1, s2, d0, d1, d2;
+
+                // Load source positions
+                s0 = SrcPosAccessor::load(pSrcPos + 0);                 // x0 y0 z0 x1
+                s1 = SrcPosAccessor::load(pSrcPos + 4);                 // y1 z1 x2 y2
+                s2 = SrcPosAccessor::load(pSrcPos + 8);                 // z2 x3 y3 z3
+
+                // Arrange to 3x4 component-major for batches calculate
+                __MM_TRANSPOSE4x3_PS(s0, s1, s2);
+
+                // Transform by collapsed matrix
+
+                // Shuffle row 0 of four collapsed matrices for calculate X component
+                __MM_TRANSPOSE4x4_PS(m00, m10, m20, m30);
+
+                // Transform X components
+                d0 = __MM_DOT4x3_PS(m00, m10, m20, m30, s0, s1, s2);    // X0 X1 X2 X3
+
+                // Shuffle row 1 of four collapsed matrices for calculate Y component
+                __MM_TRANSPOSE4x4_PS(m01, m11, m21, m31);
+
+                // Transform Y components
+                d1 = __MM_DOT4x3_PS(m01, m11, m21, m31, s0, s1, s2);    // Y0 Y1 Y2 Y3
+
+                // Shuffle row 2 of four collapsed matrices for calculate Z component
+                __MM_TRANSPOSE4x4_PS(m02, m12, m22, m32);
+
+                // Transform Z components
+                d2 = __MM_DOT4x3_PS(m02, m12, m22, m32, s0, s1, s2);    // Z0 Z1 Z2 Z3
+
+                // Arrange back to 4x3 continuous format for store results
+                __MM_TRANSPOSE3x4_PS(d0, d1, d2);
+
+                // Store blended positions
+                DestPosAccessor::store(pDestPos + 0, d0);
+                DestPosAccessor::store(pDestPos + 4, d1);
+                DestPosAccessor::store(pDestPos + 8, d2);
+
+                // Advance 4 vertices
+                pSrcPos += 4 * 3;
+                pDestPos += 4 * 3;
+
+                //------------------------------------------------------------------
+                // Transform normals
+                //------------------------------------------------------------------
+
+                // Load source normals
+                s0 = SrcNormAccessor::load(pSrcNorm + 0);               // x0 y0 z0 x1
+                s1 = SrcNormAccessor::load(pSrcNorm + 4);               // y1 z1 x2 y2
+                s2 = SrcNormAccessor::load(pSrcNorm + 8);               // z2 x3 y3 z3
+
+                // Arrange to 3x4 component-major for batches calculate
+                __MM_TRANSPOSE4x3_PS(s0, s1, s2);
+
+                // Transform by collapsed and shuffled matrices
+                d0 = __MM_DOT3x3_PS(m00, m10, m20, s0, s1, s2);         // X0 X1 X2 X3
+                d1 = __MM_DOT3x3_PS(m01, m11, m21, s0, s1, s2);         // Y0 Y1 Y2 Y3
+                d2 = __MM_DOT3x3_PS(m02, m12, m22, s0, s1, s2);         // Z0 Z1 Z2 Z3
+
+                // Normalise normals
+                __m128 tmp = __MM_DOT3x3_PS(d0, d1, d2, d0, d1, d2);
+                tmp = __MM_RSQRT_PS(tmp);
+                d0 = _mm_mul_ps(d0, tmp);
+                d1 = _mm_mul_ps(d1, tmp);
+                d2 = _mm_mul_ps(d2, tmp);
+
+                // Arrange back to 4x3 continuous format for store results
+                __MM_TRANSPOSE3x4_PS(d0, d1, d2);
+
+                // Store blended normals
+                DestNormAccessor::store(pDestNorm + 0, d0);
+                DestNormAccessor::store(pDestNorm + 4, d1);
+                DestNormAccessor::store(pDestNorm + 8, d2);
+
+                // Advance 4 vertices
+                pSrcNorm += 4 * 3;
+                pDestNorm += 4 * 3;
+            }
+        }
+    };
+    static FORCEINLINE void softwareVertexSkinning_SSE_PosNorm_Separated_Packed(
+        const float* pSrcPos, float* pDestPos,
+        const float* pSrcNorm, float* pDestNorm,
+        const float* pBlendWeight, const unsigned char* pBlendIndex,
+        const Matrix4* const* blendMatrices,
+        size_t blendWeightStride, size_t blendIndexStride,
+        size_t numWeightsPerVertex,
+        size_t numIterations)
+    {
+        assert(_isAlignedForSSE(pSrcPos));
+
+        // Instantiating two version only, since other alignement combination not that important.
+        if (_isAlignedForSSE(pSrcNorm) && _isAlignedForSSE(pDestPos) && _isAlignedForSSE(pDestNorm))
+        {
+            SoftwareVertexSkinning_SSE_PosNorm_Separated_Packed<true, true, true, true>::apply(
+                pSrcPos, pDestPos,
+                pSrcNorm, pDestNorm,
+                pBlendWeight, pBlendIndex,
+                blendMatrices,
+                blendWeightStride, blendIndexStride,
+                numWeightsPerVertex,
+                numIterations);
+        }
+        else
+        {
+            SoftwareVertexSkinning_SSE_PosNorm_Separated_Packed<true, false, false, false>::apply(
+                pSrcPos, pDestPos,
+                pSrcNorm, pDestNorm,
+                pBlendWeight, pBlendIndex,
+                blendMatrices,
+                blendWeightStride, blendIndexStride,
+                numWeightsPerVertex,
+                numIterations);
+        }
+    }
+    //---------------------------------------------------------------------
+    // Special SSE version skinning position only, the position buffer are
+    // packed.
+    template <bool srcPosAligned, bool destPosAligned>
+    struct SoftwareVertexSkinning_SSE_PosOnly_Packed
+    {
+        static void apply(
+            const float* pSrcPos, float* pDestPos,
+            const float* pBlendWeight, const unsigned char* pBlendIndex,
+            const Matrix4* const* blendMatrices,
+            size_t blendWeightStride, size_t blendIndexStride,
+            size_t numWeightsPerVertex,
+            size_t numIterations)
+        {
+            typedef SSEMemoryAccessor<srcPosAligned> SrcPosAccessor;
+            typedef SSEMemoryAccessor<destPosAligned> DestPosAccessor;
+
+            // Blending 4 vertices per-iteration
+            for (size_t i = 0; i < numIterations; ++i)
+            {
+                // Collapse matrices
+                __m128 m00, m01, m02, m10, m11, m12, m20, m21, m22, m30, m31, m32;
+                _collapseFourMatrices(
+                    m00, m01, m02,
+                    m10, m11, m12,
+                    m20, m21, m22,
+                    m30, m31, m32,
+                    pBlendWeight, pBlendIndex,
+                    blendMatrices,
+                    blendWeightStride, blendIndexStride,
+                    numWeightsPerVertex);
+
+                // Advance 4 vertices
+                advanceRawPointer(pBlendWeight, 4 * blendWeightStride);
+                advanceRawPointer(pBlendIndex, 4 * blendIndexStride);
+
+                //------------------------------------------------------------------
+                // Transform positions
+                //------------------------------------------------------------------
+
+                __m128 s0, s1, s2, d0, d1, d2;
+
+                // Load source positions
+                s0 = SrcPosAccessor::load(pSrcPos + 0);                 // x0 y0 z0 x1
+                s1 = SrcPosAccessor::load(pSrcPos + 4);                 // y1 z1 x2 y2
+                s2 = SrcPosAccessor::load(pSrcPos + 8);                 // z2 x3 y3 z3
+
+                // Arrange to 3x4 component-major for batches calculate
+                __MM_TRANSPOSE4x3_PS(s0, s1, s2);
+
+                // Transform by collapsed matrix
+
+                // Shuffle row 0 of four collapsed matrices for calculate X component
+                __MM_TRANSPOSE4x4_PS(m00, m10, m20, m30);
+
+                // Transform X components
+                d0 = __MM_DOT4x3_PS(m00, m10, m20, m30, s0, s1, s2);    // X0 X1 X2 X3
+
+                // Shuffle row 1 of four collapsed matrices for calculate Y component
+                __MM_TRANSPOSE4x4_PS(m01, m11, m21, m31);
+
+                // Transform Y components
+                d1 = __MM_DOT4x3_PS(m01, m11, m21, m31, s0, s1, s2);    // Y0 Y1 Y2 Y3
+
+                // Shuffle row 2 of four collapsed matrices for calculate Z component
+                __MM_TRANSPOSE4x4_PS(m02, m12, m22, m32);
+
+                // Transform Z components
+                d2 = __MM_DOT4x3_PS(m02, m12, m22, m32, s0, s1, s2);    // Z0 Z1 Z2 Z3
+
+                // Arrange back to 4x3 continuous format for store results
+                __MM_TRANSPOSE3x4_PS(d0, d1, d2);
+
+                // Store blended positions
+                DestPosAccessor::store(pDestPos + 0, d0);
+                DestPosAccessor::store(pDestPos + 4, d1);
+                DestPosAccessor::store(pDestPos + 8, d2);
+
+                // Advance 4 vertices
+                pSrcPos += 4 * 3;
+                pDestPos += 4 * 3;
+            }
+        }
+    };
+    static FORCEINLINE void softwareVertexSkinning_SSE_PosOnly_Packed(
+        const float* pSrcPos, float* pDestPos,
+        const float* pBlendWeight, const unsigned char* pBlendIndex,
+        const Matrix4* const* blendMatrices,
+        size_t blendWeightStride, size_t blendIndexStride,
+        size_t numWeightsPerVertex,
+        size_t numIterations)
+    {
+        assert(_isAlignedForSSE(pSrcPos));
+
+        // Instantiating two version only, since other alignement combination not that important.
+        if (_isAlignedForSSE(pDestPos))
+        {
+            SoftwareVertexSkinning_SSE_PosOnly_Packed<true, true>::apply(
+                pSrcPos, pDestPos,
+                pBlendWeight, pBlendIndex,
+                blendMatrices,
+                blendWeightStride, blendIndexStride,
+                numWeightsPerVertex,
+                numIterations);
+        }
+        else
+        {
+            SoftwareVertexSkinning_SSE_PosOnly_Packed<true, false>::apply(
+                pSrcPos, pDestPos,
+                pBlendWeight, pBlendIndex,
+                blendMatrices,
+                blendWeightStride, blendIndexStride,
+                numWeightsPerVertex,
+                numIterations);
+        }
+    }
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    OptimisedUtilSSE::OptimisedUtilSSE(void)
+        : mPreferGeneralVersionForSharedBuffers(false)
+    {
+        // For AMD Athlon XP (but not that for Althon 64), it's prefer to never use
+        // unrolled version for shared buffers at all, I guess because that version
+        // run out of usable CPU registers, or L1/L2 cache related problem, causing
+        // slight performance loss than general version.
+        //
+
+		if (PlatformInformation::getCpuIdentifier().find("AuthenticAMD") != String::npos)
+        {
+            // How can I check it's an Athlon XP but not Althon 64?
+            // Ok, just test whether supports SSE2/SSE3 or not, if not,
+            // assume general version faster than unrolled version :)
+            //
+            if (!(PlatformInformation::getCpuFeatures() &
+                (PlatformInformation::CPU_FEATURE_SSE2 | PlatformInformation::CPU_FEATURE_SSE3)))
+            {
+                mPreferGeneralVersionForSharedBuffers = true;
+            }
+        }
+    }
+    //---------------------------------------------------------------------
+    void OptimisedUtilSSE::softwareVertexSkinning(
+        const float *pSrcPos, float *pDestPos,
+        const float *pSrcNorm, float *pDestNorm,
+        const float *pBlendWeight, const unsigned char* pBlendIndex,
+        const Matrix4* const* blendMatrices,
+        size_t srcPosStride, size_t destPosStride,
+        size_t srcNormStride, size_t destNormStride,
+        size_t blendWeightStride, size_t blendIndexStride,
+        size_t numWeightsPerVertex,
+        size_t numVertices)
+    {
+        __OGRE_CHECK_STACK_ALIGNED_FOR_SSE();
+
+        // All position/normal pointers should be perfect aligned, but still check here
+        // for avoid hardware buffer which allocated by potential buggy driver doesn't
+        // support alignment properly.
+        // Because we are used meta-function technique here, the code is easy to maintenance
+        // and still provides all possible alignment combination.
+        //
+
+        // Use unrolled routines only if there a lot of vertices
+        if (numVertices > OGRE_SSE_SKINNING_UNROLL_VERTICES)
+        {
+            if (pSrcNorm)
+            {
+                // Blend position and normal
+
+                if (!mPreferGeneralVersionForSharedBuffers &&
+                    srcPosStride == sizeof(float) * (3 + 3) && destPosStride == sizeof(float) * (3 + 3) &&
+                    pSrcNorm == pSrcPos + 3 && pDestNorm == pDestPos + 3)
+                {
+                    // Position and normal are sharing with packed buffer
+
+                    size_t srcPosAlign = (size_t)pSrcPos & 15;
+                    assert((srcPosAlign & 3) == 0);
+
+                    // Blend unaligned vertices with general SIMD routine
+                    if (srcPosAlign == 8)   // Because 8 bytes alignment shift per-vertex
+                    {
+                        size_t count = srcPosAlign / 8;
+                        numVertices -= count;
+                        softwareVertexSkinning_SSE_General(
+                            pSrcPos, pDestPos,
+                            pSrcNorm, pDestNorm,
+                            pBlendWeight, pBlendIndex,
+                            blendMatrices,
+                            srcPosStride, destPosStride,
+                            srcNormStride, destNormStride,
+                            blendWeightStride, blendIndexStride,
+                            numWeightsPerVertex,
+                            count);
+
+                        pSrcPos += count * (3 + 3);
+                        pDestPos += count * (3 + 3);
+                        pSrcNorm += count * (3 + 3);
+                        pDestNorm += count * (3 + 3);
+                        advanceRawPointer(pBlendWeight, count * blendWeightStride);
+                        advanceRawPointer(pBlendIndex, count * blendIndexStride);
+                    }
+
+                    // Blend vertices, four vertices per-iteration
+                    size_t numIterations = numVertices / 4;
+                    softwareVertexSkinning_SSE_PosNorm_Shared_Packed(
+                        pSrcPos, pDestPos,
+                        pBlendWeight, pBlendIndex,
+                        blendMatrices,
+                        blendWeightStride, blendIndexStride,
+                        numWeightsPerVertex,
+                        numIterations);
+
+                    // Advance pointers for remaining vertices
+                    numVertices &= 3;
+                    if (numVertices)
+                    {
+                        pSrcPos += numIterations * 4 * (3 + 3);
+                        pDestPos += numIterations * 4 * (3 + 3);
+                        pSrcNorm += numIterations * 4 * (3 + 3);
+                        pDestNorm += numIterations * 4 * (3 + 3);
+                        advanceRawPointer(pBlendWeight, numIterations * 4 * blendWeightStride);
+                        advanceRawPointer(pBlendIndex, numIterations * 4 * blendIndexStride);
+                    }
+                }
+                else if (srcPosStride == sizeof(float) * 3 && destPosStride == sizeof(float) * 3 &&
+                         srcNormStride == sizeof(float) * 3 && destNormStride == sizeof(float) * 3)
+                {
+                    // Position and normal are separate buffers, and all of them are packed
+
+                    size_t srcPosAlign = (size_t)pSrcPos & 15;
+                    assert((srcPosAlign & 3) == 0);
+
+                    // Blend unaligned vertices with general SIMD routine
+                    if (srcPosAlign)
+                    {
+                        size_t count = srcPosAlign / 4;
+                        numVertices -= count;
+                        softwareVertexSkinning_SSE_General(
+                            pSrcPos, pDestPos,
+                            pSrcNorm, pDestNorm,
+                            pBlendWeight, pBlendIndex,
+                            blendMatrices,
+                            srcPosStride, destPosStride,
+                            srcNormStride, destNormStride,
+                            blendWeightStride, blendIndexStride,
+                            numWeightsPerVertex,
+                            count);
+
+                        pSrcPos += count * 3;
+                        pDestPos += count * 3;
+                        pSrcNorm += count * 3;
+                        pDestNorm += count * 3;
+                        advanceRawPointer(pBlendWeight, count * blendWeightStride);
+                        advanceRawPointer(pBlendIndex, count * blendIndexStride);
+                    }
+
+                    // Blend vertices, four vertices per-iteration
+                    size_t numIterations = numVertices / 4;
+                    softwareVertexSkinning_SSE_PosNorm_Separated_Packed(
+                        pSrcPos, pDestPos,
+                        pSrcNorm, pDestNorm,
+                        pBlendWeight, pBlendIndex,
+                        blendMatrices,
+                        blendWeightStride, blendIndexStride,
+                        numWeightsPerVertex,
+                        numIterations);
+
+                    // Advance pointers for remaining vertices
+                    numVertices &= 3;
+                    if (numVertices)
+                    {
+                        pSrcPos += numIterations * 4 * 3;
+                        pDestPos += numIterations * 4 * 3;
+                        pSrcNorm += numIterations * 4 * 3;
+                        pDestNorm += numIterations * 4 * 3;
+                        advanceRawPointer(pBlendWeight, numIterations * 4 * blendWeightStride);
+                        advanceRawPointer(pBlendIndex, numIterations * 4 * blendIndexStride);
+                    }
+                }
+                else    // Not 'packed' form or wrong order between position and normal
+                {
+                    // Should never occuring, do nothing here just in case
+                }
+            }
+            else    // !pSrcNorm
+            {
+                // Blend position only
+
+                if (srcPosStride == sizeof(float) * 3 && destPosStride == sizeof(float) * 3)
+                {
+                    // All buffers are packed
+
+                    size_t srcPosAlign = (size_t)pSrcPos & 15;
+                    assert((srcPosAlign & 3) == 0);
+
+                    // Blend unaligned vertices with general SIMD routine
+                    if (srcPosAlign)
+                    {
+                        size_t count = srcPosAlign / 4;
+                        numVertices -= count;
+                        softwareVertexSkinning_SSE_General(
+                            pSrcPos, pDestPos,
+                            pSrcNorm, pDestNorm,
+                            pBlendWeight, pBlendIndex,
+                            blendMatrices,
+                            srcPosStride, destPosStride,
+                            srcNormStride, destNormStride,
+                            blendWeightStride, blendIndexStride,
+                            numWeightsPerVertex,
+                            count);
+
+                        pSrcPos += count * 3;
+                        pDestPos += count * 3;
+                        advanceRawPointer(pBlendWeight, count * blendWeightStride);
+                        advanceRawPointer(pBlendIndex, count * blendIndexStride);
+                    }
+
+                    // Blend vertices, four vertices per-iteration
+                    size_t numIterations = numVertices / 4;
+                    softwareVertexSkinning_SSE_PosOnly_Packed(
+                        pSrcPos, pDestPos,
+                        pBlendWeight, pBlendIndex,
+                        blendMatrices,
+                        blendWeightStride, blendIndexStride,
+                        numWeightsPerVertex,
+                        numIterations);
+
+                    // Advance pointers for remaining vertices
+                    numVertices &= 3;
+                    if (numVertices)
+                    {
+                        pSrcPos += numIterations * 4 * 3;
+                        pDestPos += numIterations * 4 * 3;
+                        advanceRawPointer(pBlendWeight, numIterations * 4 * blendWeightStride);
+                        advanceRawPointer(pBlendIndex, numIterations * 4 * blendIndexStride);
+                    }
+                }
+                else    // Not 'packed' form
+                {
+                    // Might occuring only if user forced software blending position only
+                }
+            }
+        }
+
+        // Blend remaining vertices, need to do it with SIMD for identical result,
+        // since mixing general floating-point and SIMD algorithm will causing
+        // floating-point error.
+        if (numVertices)
+        {
+            softwareVertexSkinning_SSE_General(
+                pSrcPos, pDestPos,
+                pSrcNorm, pDestNorm,
+                pBlendWeight, pBlendIndex,
+                blendMatrices,
+                srcPosStride, destPosStride,
+                srcNormStride, destNormStride,
+                blendWeightStride, blendIndexStride,
+                numWeightsPerVertex,
+                numVertices);
+        }
+    }
+    //---------------------------------------------------------------------
+    void OptimisedUtilSSE::softwareVertexMorph(
+        Real t,
+        const float *pSrc1, const float *pSrc2,
+        float *pDst,
+        size_t numVertices)
+    {
+        __OGRE_CHECK_STACK_ALIGNED_FOR_SSE();
+
+        __m128 src01, src02, src11, src12, src21, src22;
+        __m128 dst0, dst1, dst2;
+
+        __m128 t4 = _mm_load_ps1(&t);
+
+        size_t numIterations = numVertices / 4;
+        numVertices &= 3;
+
+        // Never use meta-function technique to accessing memory because looks like
+        // VC7.1 generate a bit inefficient binary code when put following code into
+        // inline function.
+
+        if (_isAlignedForSSE(pSrc1) && _isAlignedForSSE(pSrc2) && _isAlignedForSSE(pDst))
+        {
+            // All data aligned
+
+            // Morph 4 vertices per-iteration. Special designed for use all
+            // available CPU registers as possible (7 registers used here),
+            // and avoid temporary values allocated in stack for suppress
+            // extra memory access.
+            for (size_t i = 0; i < numIterations; ++i)
+            {
+                // 12 floating-point values
+                src01 = __MM_LOAD_PS(pSrc1 + 0);
+                src02 = __MM_LOAD_PS(pSrc2 + 0);
+                src11 = __MM_LOAD_PS(pSrc1 + 4);
+                src12 = __MM_LOAD_PS(pSrc2 + 4);
+                src21 = __MM_LOAD_PS(pSrc1 + 8);
+                src22 = __MM_LOAD_PS(pSrc2 + 8);
+                pSrc1 += 12; pSrc2 += 12;
+
+                dst0 = __MM_LERP_PS(t4, src01, src02);
+                dst1 = __MM_LERP_PS(t4, src11, src12);
+                dst2 = __MM_LERP_PS(t4, src21, src22);
+
+                __MM_STORE_PS(pDst + 0, dst0);
+                __MM_STORE_PS(pDst + 4, dst1);
+                __MM_STORE_PS(pDst + 8, dst2);
+                pDst += 12;
+            }
+
+            // Morph remaining vertices
+            switch (numVertices)
+            {
+            case 3:
+                // 9 floating-point values
+                src01 = __MM_LOAD_PS(pSrc1 + 0);
+                src02 = __MM_LOAD_PS(pSrc2 + 0);
+                src11 = __MM_LOAD_PS(pSrc1 + 4);
+                src12 = __MM_LOAD_PS(pSrc2 + 4);
+                src21 = _mm_load_ss(pSrc1 + 8);
+                src22 = _mm_load_ss(pSrc2 + 8);
+
+                dst0 = __MM_LERP_PS(t4, src01, src02);
+                dst1 = __MM_LERP_PS(t4, src11, src12);
+                dst2 = __MM_LERP_SS(t4, src21, src22);
+
+                __MM_STORE_PS(pDst + 0, dst0);
+                __MM_STORE_PS(pDst + 4, dst1);
+                _mm_store_ss(pDst + 8, dst2);
+                break;
+
+            case 2:
+                // 6 floating-point values
+                src01 = __MM_LOAD_PS(pSrc1 + 0);
+                src02 = __MM_LOAD_PS(pSrc2 + 0);
+                src11 = _mm_loadl_pi(t4, (__m64*)(pSrc1 + 4));  // t4 is meaningless here
+                src12 = _mm_loadl_pi(t4, (__m64*)(pSrc2 + 4));  // t4 is meaningless here
+
+                dst0 = __MM_LERP_PS(t4, src01, src02);
+                dst1 = __MM_LERP_PS(t4, src11, src12);
+
+                __MM_STORE_PS(pDst + 0, dst0);
+                _mm_storel_pi((__m64*)(pDst + 4), dst1);
+                break;
+
+            case 1:
+                // 3 floating-point values
+                src01 = _mm_load_ss(pSrc1 + 2);
+                src02 = _mm_load_ss(pSrc2 + 2);
+                src01 = _mm_loadh_pi(src01, (__m64*)(pSrc1 + 0));
+                src02 = _mm_loadh_pi(src02, (__m64*)(pSrc2 + 0));
+
+                dst0 = __MM_LERP_PS(t4, src01, src02);
+
+                _mm_storeh_pi((__m64*)(pDst + 0), dst0);
+                _mm_store_ss(pDst + 2, dst0);
+                break;
+            }
+        }
+        else    // Should never occuring, just in case buggy driver
+        {
+            // Assume all data unaligned
+
+            // Morph 4 vertices per-iteration. Special designed for use all
+            // available CPU registers as possible (7 registers used here),
+            // and avoid temporary values allocated in stack for suppress
+            // extra memory access.
+            for (size_t i = 0; i < numIterations; ++i)
+            {
+                // 12 floating-point values
+                src01 = _mm_loadu_ps(pSrc1 + 0);
+                src02 = _mm_loadu_ps(pSrc2 + 0);
+                src11 = _mm_loadu_ps(pSrc1 + 4);
+                src12 = _mm_loadu_ps(pSrc2 + 4);
+                src21 = _mm_loadu_ps(pSrc1 + 8);
+                src22 = _mm_loadu_ps(pSrc2 + 8);
+                pSrc1 += 12; pSrc2 += 12;
+
+                dst0 = __MM_LERP_PS(t4, src01, src02);
+                dst1 = __MM_LERP_PS(t4, src11, src12);
+                dst2 = __MM_LERP_PS(t4, src21, src22);
+
+                _mm_storeu_ps(pDst + 0, dst0);
+                _mm_storeu_ps(pDst + 4, dst1);
+                _mm_storeu_ps(pDst + 8, dst2);
+                pDst += 12;
+            }
+
+            // Morph remaining vertices
+            switch (numVertices)
+            {
+            case 3:
+                // 9 floating-point values
+                src01 = _mm_loadu_ps(pSrc1 + 0);
+                src02 = _mm_loadu_ps(pSrc2 + 0);
+                src11 = _mm_loadu_ps(pSrc1 + 4);
+                src12 = _mm_loadu_ps(pSrc2 + 4);
+                src21 = _mm_load_ss(pSrc1 + 8);
+                src22 = _mm_load_ss(pSrc2 + 8);
+
+                dst0 = __MM_LERP_PS(t4, src01, src02);
+                dst1 = __MM_LERP_PS(t4, src11, src12);
+                dst2 = __MM_LERP_SS(t4, src21, src22);
+
+                _mm_storeu_ps(pDst + 0, dst0);
+                _mm_storeu_ps(pDst + 4, dst1);
+                _mm_store_ss(pDst + 8, dst2);
+                break;
+
+            case 2:
+                // 6 floating-point values
+                src01 = _mm_loadu_ps(pSrc1 + 0);
+                src02 = _mm_loadu_ps(pSrc2 + 0);
+                src11 = _mm_loadl_pi(t4, (__m64*)(pSrc1 + 4));  // t4 is meaningless here
+                src12 = _mm_loadl_pi(t4, (__m64*)(pSrc2 + 4));  // t4 is meaningless here
+
+                dst0 = __MM_LERP_PS(t4, src01, src02);
+                dst1 = __MM_LERP_PS(t4, src11, src12);
+
+                _mm_storeu_ps(pDst + 0, dst0);
+                _mm_storel_pi((__m64*)(pDst + 4), dst1);
+                break;
+
+            case 1:
+                // 3 floating-point values
+                src01 = _mm_load_ss(pSrc1 + 2);
+                src02 = _mm_load_ss(pSrc2 + 2);
+                src01 = _mm_loadh_pi(src01, (__m64*)(pSrc1 + 0));
+                src02 = _mm_loadh_pi(src02, (__m64*)(pSrc2 + 0));
+
+                dst0 = __MM_LERP_PS(t4, src01, src02);
+
+                _mm_storeh_pi((__m64*)(pDst + 0), dst0);
+                _mm_store_ss(pDst + 2, dst0);
+                break;
+            }
+        }
+    }
+    //---------------------------------------------------------------------
+    void OptimisedUtilSSE::concatenateAffineMatrices(
+        const Matrix4& baseMatrix,
+        const Matrix4* pSrcMat,
+        Matrix4* pDstMat,
+        size_t numMatrices)
+    {
+        __OGRE_CHECK_STACK_ALIGNED_FOR_SSE();
+
+        assert(_isAlignedForSSE(pSrcMat));
+        assert(_isAlignedForSSE(pDstMat));
+
+        // Load base matrix, unaligned
+        __m128 m0 = _mm_loadu_ps(baseMatrix[0]);
+        __m128 m1 = _mm_loadu_ps(baseMatrix[1]);
+        __m128 m2 = _mm_loadu_ps(baseMatrix[2]);
+        __m128 m3 = _mm_loadu_ps(baseMatrix[3]);        // m3 should be equal to (0, 0, 0, 1)
+
+        for (size_t i = 0; i < numMatrices; ++i)
+        {
+            // Load source matrix, aligned
+            __m128 s0 = __MM_LOAD_PS((*pSrcMat)[0]);
+            __m128 s1 = __MM_LOAD_PS((*pSrcMat)[1]);
+            __m128 s2 = __MM_LOAD_PS((*pSrcMat)[2]);
+
+            ++pSrcMat;
+
+            __m128 t0, t1, t2, t3;
+
+            // Concatenate matrix, and store results
+
+            // Row 0
+            t0 = _mm_mul_ps(__MM_SELECT(m0, 0), s0);
+            t1 = _mm_mul_ps(__MM_SELECT(m0, 1), s1);
+            t2 = _mm_mul_ps(__MM_SELECT(m0, 2), s2);
+            t3 = _mm_mul_ps(m0, m3);    // Compiler should optimise this out of the loop
+            __MM_STORE_PS((*pDstMat)[0], __MM_ACCUM4_PS(t0,t1,t2,t3));
+
+            // Row 1
+            t0 = _mm_mul_ps(__MM_SELECT(m1, 0), s0);
+            t1 = _mm_mul_ps(__MM_SELECT(m1, 1), s1);
+            t2 = _mm_mul_ps(__MM_SELECT(m1, 2), s2);
+            t3 = _mm_mul_ps(m1, m3);    // Compiler should optimise this out of the loop
+            __MM_STORE_PS((*pDstMat)[1], __MM_ACCUM4_PS(t0,t1,t2,t3));
+
+            // Row 2
+            t0 = _mm_mul_ps(__MM_SELECT(m2, 0), s0);
+            t1 = _mm_mul_ps(__MM_SELECT(m2, 1), s1);
+            t2 = _mm_mul_ps(__MM_SELECT(m2, 2), s2);
+            t3 = _mm_mul_ps(m2, m3);    // Compiler should optimise this out of the loop
+            __MM_STORE_PS((*pDstMat)[2], __MM_ACCUM4_PS(t0,t1,t2,t3));
+
+            // Row 3
+            __MM_STORE_PS((*pDstMat)[3], m3);
+
+            ++pDstMat;
+        }
+    }
+    //---------------------------------------------------------------------
+    void OptimisedUtilSSE::calculateFaceNormals(
+        const float *positions,
+        const EdgeData::Triangle *triangles,
+        Vector4 *faceNormals,
+        size_t numTriangles)
+    {
+        __OGRE_CHECK_STACK_ALIGNED_FOR_SSE();
+
+        assert(_isAlignedForSSE(faceNormals));
+
+// Load Vector3 as: (x, 0, y, z)
+#define __LOAD_VECTOR3(p)   _mm_loadh_pi(_mm_load_ss(p), (__m64*)((p)+1))
+
+        // Mask used to changes sign of single precision floating point values.
+        OGRE_SIMD_ALIGNED_DECL(static const uint32, msSignMask[4]) =
+        {
+            0x80000000, 0x80000000, 0x80000000, 0x80000000,
+        };
+
+        size_t numIterations = numTriangles / 4;
+        numTriangles &= 3;
+
+        // Four triangles per-iteration
+        for (size_t i = 0; i < numIterations; ++i)
+        {
+
+// Load four Vector3 as: (x0, x1, x2, x3), (y0, y1, y2, y3), (z0, z1, z2, z3)
+#define __LOAD_FOUR_VECTOR3(x, y, z, p0, p1, p2, p3)                    \
+            {                                                           \
+                __m128 v0 = __LOAD_VECTOR3(p0);     /* x0 -- y0 z0 */   \
+                __m128 v1 = __LOAD_VECTOR3(p1);     /* x1 -- y1 z1 */   \
+                __m128 v2 = __LOAD_VECTOR3(p2);     /* x2 -- y2 z2 */   \
+                __m128 v3 = __LOAD_VECTOR3(p3);     /* x3 -- y3 z3 */   \
+                __m128 t0, t1;                                          \
+                                                                        \
+                t0 = _mm_unpacklo_ps(v0, v2);       /* x0 x2 -- -- */   \
+                t1 = _mm_unpacklo_ps(v1, v3);       /* x1 x3 -- -- */   \
+                x  = _mm_unpacklo_ps(t0, t1);       /* x0 x1 x2 x3 */   \
+                                                                        \
+                t0 = _mm_unpackhi_ps(v0, v2);       /* y0 y2 z0 z2 */   \
+                t1 = _mm_unpackhi_ps(v1, v3);       /* y1 y3 z1 z3 */   \
+                y  = _mm_unpacklo_ps(t0, t1);       /* y0 y1 y2 y3 */   \
+                z  = _mm_unpackhi_ps(t0, t1);       /* z0 z1 z2 z3 */   \
+            }
+
+            __m128 x0, x1, x2, y0, y1, y2, z0, z1, z2;
+
+            // Load vertex 0 of four triangles, packed as component-major format: xxxx yyyy zzzz
+            __LOAD_FOUR_VECTOR3(x0, y0, z0,
+                positions + triangles[0].vertIndex[0] * 3,
+                positions + triangles[1].vertIndex[0] * 3,
+                positions + triangles[2].vertIndex[0] * 3,
+                positions + triangles[3].vertIndex[0] * 3);
+
+            // Load vertex 1 of four triangles, packed as component-major format: xxxx yyyy zzzz
+            __LOAD_FOUR_VECTOR3(x1, y1, z1,
+                positions + triangles[0].vertIndex[1] * 3,
+                positions + triangles[1].vertIndex[1] * 3,
+                positions + triangles[2].vertIndex[1] * 3,
+                positions + triangles[3].vertIndex[1] * 3);
+
+            // Load vertex 2 of four triangles, packed as component-major format: xxxx yyyy zzzz
+            __LOAD_FOUR_VECTOR3(x2, y2, z2,
+                positions + triangles[0].vertIndex[2] * 3,
+                positions + triangles[1].vertIndex[2] * 3,
+                positions + triangles[2].vertIndex[2] * 3,
+                positions + triangles[3].vertIndex[2] * 3);
+
+            triangles += 4;
+
+            // Calculate triangle face normals
+
+            // a = v1 - v0
+            __m128 ax = _mm_sub_ps(x1, x0);
+            __m128 ay = _mm_sub_ps(y1, y0);
+            __m128 az = _mm_sub_ps(z1, z0);
+
+            // b = v2 - v0
+            __m128 bx = _mm_sub_ps(x2, x0);
+            __m128 by = _mm_sub_ps(y2, y0);
+            __m128 bz = _mm_sub_ps(z2, z0);
+
+            // n = a cross b
+            __m128 nx = _mm_sub_ps(_mm_mul_ps(ay, bz), _mm_mul_ps(az, by));
+            __m128 ny = _mm_sub_ps(_mm_mul_ps(az, bx), _mm_mul_ps(ax, bz));
+            __m128 nz = _mm_sub_ps(_mm_mul_ps(ax, by), _mm_mul_ps(ay, bx));
+
+            // w = - (n dot v0)
+            __m128 nw = _mm_xor_ps(
+                __MM_DOT3x3_PS(nx, ny, nz, x0, y0, z0),
+                *(const __m128 *)&msSignMask);
+
+            // Arrange to per-triangle face normal major format
+            __MM_TRANSPOSE4x4_PS(nx, ny, nz, nw);
+
+            // Store results
+            __MM_STORE_PS(&faceNormals[0].x, nx);
+            __MM_STORE_PS(&faceNormals[1].x, ny);
+            __MM_STORE_PS(&faceNormals[2].x, nz);
+            __MM_STORE_PS(&faceNormals[3].x, nw);
+            faceNormals += 4;
+
+#undef __LOAD_FOUR_VECTOR3
+        }
+
+        // Dealing with remaining triangles
+        for (size_t j = 0; j < numTriangles; ++j)
+        {
+            // Load vertices of the triangle
+            __m128 v0 = __LOAD_VECTOR3(positions + triangles->vertIndex[0] * 3);
+            __m128 v1 = __LOAD_VECTOR3(positions + triangles->vertIndex[1] * 3);
+            __m128 v2 = __LOAD_VECTOR3(positions + triangles->vertIndex[2] * 3);
+            ++triangles;
+
+            // Calculate face normal
+
+            __m128 t0, t1;
+
+            __m128 a = _mm_sub_ps(v1, v0);                      // ax 0 ay az
+            __m128 b = _mm_sub_ps(v2, v0);                      // bx 0 by bz
+            t0 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(2,0,1,3));    // az 0 ax ay
+            t1 = _mm_shuffle_ps(b, b, _MM_SHUFFLE(2,0,1,3));    // bz 0 bx by
+            t0 = _mm_mul_ps(t0, b);                             // az*bx 0 ax*by ay*bz
+            t1 = _mm_mul_ps(t1, a);                             // ax*bz 0 ay*bx az*by
+
+            __m128 n = _mm_sub_ps(t0, t1);                      // ny 0  nz nx
+
+            __m128 d = _mm_mul_ps(                              // dy 0  dz dx
+                _mm_shuffle_ps(v0, v0, _MM_SHUFFLE(0,3,1,2)), n);
+
+            n = _mm_sub_ps(_mm_sub_ps(_mm_sub_ps(               // nx ny nz -(dx+dy+dz)
+                _mm_shuffle_ps(n, n, _MM_SHUFFLE(1,2,0,3)),     // nx ny nz 0
+                _mm_shuffle_ps(d, d, _MM_SHUFFLE(3,1,1,1))),    // 0  0  0  dx
+                _mm_shuffle_ps(d, d, _MM_SHUFFLE(0,1,1,1))),    // 0  0  0  dy
+                _mm_shuffle_ps(d, d, _MM_SHUFFLE(2,1,1,1)));    // 0  0  0  dz
+
+            // Store result
+            __MM_STORE_PS(&faceNormals->x, n);
+            ++faceNormals;
+        }
+
+#undef __LOAD_VECTOR3
+    }
+    //---------------------------------------------------------------------
+    void OptimisedUtilSSE::calculateLightFacing(
+        const Vector4& lightPos,
+        const Vector4* faceNormals,
+        char* lightFacings,
+        size_t numFaces)
+    {
+        __OGRE_CHECK_STACK_ALIGNED_FOR_SSE();
+
+        assert(_isAlignedForSSE(faceNormals));
+
+        // Map to convert 4-bits mask to 4 byte values
+        static const char msMaskMapping[16][4] =
+        {
+            {0, 0, 0, 0},   {1, 0, 0, 0},   {0, 1, 0, 0},   {1, 1, 0, 0},
+            {0, 0, 1, 0},   {1, 0, 1, 0},   {0, 1, 1, 0},   {1, 1, 1, 0},
+            {0, 0, 0, 1},   {1, 0, 0, 1},   {0, 1, 0, 1},   {1, 1, 0, 1},
+            {0, 0, 1, 1},   {1, 0, 1, 1},   {0, 1, 1, 1},   {1, 1, 1, 1},
+        };
+
+        __m128 n0, n1, n2, n3;
+        __m128 t0, t1;
+        __m128 dp;
+        int bitmask;
+
+        // Load light vector, unaligned
+        __m128 lp = _mm_loadu_ps(&lightPos.x);
+
+        // Perload zero to register for compare dot product values
+        __m128 zero = _mm_setzero_ps();
+
+        size_t numIterations = numFaces / 4;
+        numFaces &= 3;
+
+        // Four faces per-iteration
+        for (size_t i = 0; i < numIterations; ++i)
+        {
+            // Load face normals, aligned
+            n0 = __MM_LOAD_PS(&faceNormals[0].x);
+            n1 = __MM_LOAD_PS(&faceNormals[1].x);
+            n2 = __MM_LOAD_PS(&faceNormals[2].x);
+            n3 = __MM_LOAD_PS(&faceNormals[3].x);
+            faceNormals += 4;
+
+            // Multiply by light vector
+            n0 = _mm_mul_ps(n0, lp);        // x0 y0 z0 w0
+            n1 = _mm_mul_ps(n1, lp);        // x1 y1 z1 w1
+            n2 = _mm_mul_ps(n2, lp);        // x2 y2 z2 w2
+            n3 = _mm_mul_ps(n3, lp);        // x3 y3 z3 w3
+
+            // Horizontal add four vector values.
+            t0 = _mm_add_ps(                                            // x0+z0 x1+z1 y0+w0 y1+w1
+                _mm_unpacklo_ps(n0, n1),    // x0 x1 y0 y1
+                _mm_unpackhi_ps(n0, n1));   // z0 z1 w0 w1
+            t1 = _mm_add_ps(                                            // x2+z2 x3+z3 y2+w2 y3+w3
+                _mm_unpacklo_ps(n2, n3),    // x2 x3 y2 y3
+                _mm_unpackhi_ps(n2, n3));   // z2 z3 w2 w3
+            dp = _mm_add_ps(                                            // dp0 dp1 dp2 dp3
+                _mm_movelh_ps(t0, t1),      // x0+z0 x1+z1 x2+z2 x3+z3
+                _mm_movehl_ps(t1, t0));     // y0+w0 y1+w1 y2+w2 y3+w3
+
+            // Compare greater than zero and setup 4-bits mask. Use '_mm_cmpnle_ps'
+            // instead of '_mm_cmpgt_ps' here because we want keep 'zero' untouch,
+            // i.e. it's 2nd operand of the assembly instruction. And in fact
+            // '_mm_cmpgt_ps' was implemented as 'CMPLTPS' with operands swapped
+            // in VC7.1.
+            bitmask = _mm_movemask_ps(_mm_cmpnle_ps(dp, zero));
+
+            // Convert 4-bits mask to 4 bytes, and store results.
+            *reinterpret_cast<uint32*>(lightFacings) =
+                *reinterpret_cast<const uint32*>(msMaskMapping[bitmask]);
+            lightFacings += 4;
+        }
+
+        // Dealing with remaining faces
+        switch (numFaces)
+        {
+        case 3:
+            n0 = __MM_LOAD_PS(&faceNormals[0].x);
+            n1 = __MM_LOAD_PS(&faceNormals[1].x);
+            n2 = __MM_LOAD_PS(&faceNormals[2].x);
+
+            n0 = _mm_mul_ps(n0, lp);        // x0 y0 z0 w0
+            n1 = _mm_mul_ps(n1, lp);        // x1 y1 z1 w1
+            n2 = _mm_mul_ps(n2, lp);        // x2 y2 z2 w2
+
+            t0 = _mm_add_ps(                                            // x0+z0 x1+z1 y0+w0 y1+w1
+                _mm_unpacklo_ps(n0, n1),    // x0 x1 y0 y1
+                _mm_unpackhi_ps(n0, n1));   // z0 z1 w0 w1
+            t1 = _mm_add_ps(                                            // x2+z2 x2+z2 y2+w2 y2+w2
+                _mm_unpacklo_ps(n2, n2),    // x2 x2 y2 y2
+                _mm_unpackhi_ps(n2, n2));   // z2 z2 w2 w2
+            dp = _mm_add_ps(                                            // dp0 dp1 dp2 dp2
+                _mm_movelh_ps(t0, t1),      // x0+z0 x1+z1 x2+z2 x2+z2
+                _mm_movehl_ps(t1, t0));     // y0+w0 y1+w1 y2+w2 y2+w2
+
+            bitmask = _mm_movemask_ps(_mm_cmpnle_ps(dp, zero));
+
+            lightFacings[0] = msMaskMapping[bitmask][0];
+            lightFacings[1] = msMaskMapping[bitmask][1];
+            lightFacings[2] = msMaskMapping[bitmask][2];
+            break;
+
+        case 2:
+            n0 = __MM_LOAD_PS(&faceNormals[0].x);
+            n1 = __MM_LOAD_PS(&faceNormals[1].x);
+
+            n0 = _mm_mul_ps(n0, lp);        // x0 y0 z0 w0
+            n1 = _mm_mul_ps(n1, lp);        // x1 y1 z1 w1
+
+            t0 = _mm_add_ps(                                            // x0+z0 x1+z1 y0+w0 y1+w1
+                _mm_unpacklo_ps(n0, n1),    // x0 x1 y0 y1
+                _mm_unpackhi_ps(n0, n1));   // z0 z1 w0 w1
+            dp = _mm_add_ps(                                            // dp0 dp1 dp0 dp1
+                _mm_movelh_ps(t0, t0),      // x0+z0 x1+z1 x0+z0 x1+z1
+                _mm_movehl_ps(t0, t0));     // y0+w0 y1+w1 y0+w0 y1+w1
+
+            bitmask = _mm_movemask_ps(_mm_cmpnle_ps(dp, zero));
+
+            lightFacings[0] = msMaskMapping[bitmask][0];
+            lightFacings[1] = msMaskMapping[bitmask][1];
+            break;
+
+        case 1:
+            n0 = __MM_LOAD_PS(&faceNormals[0].x);
+
+            n0 = _mm_mul_ps(n0, lp);        // x0 y0 z0 w0
+
+            t0 = _mm_add_ps(                                            // x0+z0 x0+z0 y0+w0 y0+w0
+                _mm_unpacklo_ps(n0, n0),    // x0 x0 y0 y0
+                _mm_unpackhi_ps(n0, n0));   // z0 z0 w0 w0
+            dp = _mm_add_ps(                                            // dp0 dp0 dp0 dp0
+                _mm_movelh_ps(t0, t0),      // x0+z0 x0+z0 x0+z0 x0+z0
+                _mm_movehl_ps(t0, t0));     // y0+w0 y0+w0 y0+w0 y0+w0
+
+            bitmask = _mm_movemask_ps(_mm_cmpnle_ps(dp, zero));
+
+            lightFacings[0] = msMaskMapping[bitmask][0];
+            break;
+        }
+    }
+    //---------------------------------------------------------------------
+    // Template to extrude vertices for directional light.
+    template <bool srcAligned, bool destAligned>
+    struct ExtrudeVertices_SSE_DirectionalLight
+    {
+        static void apply(
+            const Vector4& lightPos,
+            Real extrudeDist,
+            const float* pSrcPos,
+            float* pDestPos,
+            size_t numVertices)
+        {
+            typedef SSEMemoryAccessor<srcAligned> SrcAccessor;
+            typedef SSEMemoryAccessor<destAligned> DestAccessor;
+
+            // Directional light, extrusion is along light direction
+
+            // Load light vector, unaligned
+            __m128 lp = _mm_loadu_ps(&lightPos.x);
+
+            // Calculate extrusion direction, note that we use inverted direction here
+            // for eliminate an extra negative instruction, we'll compensate for that
+            // by use subtract instruction instead later.
+            __m128 tmp = _mm_mul_ps(lp, lp);
+            tmp = _mm_add_ss(_mm_add_ss(tmp, _mm_shuffle_ps(tmp, tmp, 1)), _mm_movehl_ps(tmp, tmp));
+            // Looks like VC7.1 generate a bit inefficient code for 'rsqrtss', so use 'rsqrtps' instead
+            tmp = _mm_mul_ss(_mm_rsqrt_ps(tmp), _mm_load_ss(&extrudeDist));
+            __m128 dir = _mm_mul_ps(lp, __MM_SELECT(tmp, 0));               // X Y Z -
+
+            // Prepare extrude direction for extruding 4 vertices parallelly
+            __m128 dir0 = _mm_shuffle_ps(dir, dir, _MM_SHUFFLE(0,2,1,0));   // X Y Z X
+            __m128 dir1 = _mm_shuffle_ps(dir, dir, _MM_SHUFFLE(1,0,2,1));   // Y Z X Y
+            __m128 dir2 = _mm_shuffle_ps(dir, dir, _MM_SHUFFLE(2,1,0,2));   // Z X Y Z
+
+            __m128 s0, s1, s2;
+            __m128 d0, d1, d2;
+
+            size_t numIterations = numVertices / 4;
+            numVertices &= 3;
+
+            // Extruding 4 vertices per-iteration
+            for (size_t i = 0; i < numIterations; ++i)
+            {
+                s0 = SrcAccessor::load(pSrcPos + 0);
+                s1 = SrcAccessor::load(pSrcPos + 4);
+                s2 = SrcAccessor::load(pSrcPos + 8);
+                pSrcPos += 12;
+
+                // The extrusion direction is inverted, use subtract instruction here
+                d0 = _mm_sub_ps(s0, dir0);                      // X0 Y0 Z0 X1
+                d1 = _mm_sub_ps(s1, dir1);                      // Y1 Z1 X2 Y2
+                d2 = _mm_sub_ps(s2, dir2);                      // Z2 X3 Y3 Z3
+
+                DestAccessor::store(pDestPos + 0, d0);
+                DestAccessor::store(pDestPos + 4, d1);
+                DestAccessor::store(pDestPos + 8, d2);
+                pDestPos += 12;
+            }
+
+            // Dealing with remaining vertices
+            switch (numVertices)
+            {
+            case 3:
+                // 9 floating-point values
+                s0 = SrcAccessor::load(pSrcPos + 0);
+                s1 = SrcAccessor::load(pSrcPos + 4);
+                s2 = _mm_load_ss(pSrcPos + 8);
+
+                // The extrusion direction is inverted, use subtract instruction here
+                d0 = _mm_sub_ps(s0, dir0);                      // X0 Y0 Z0 X1
+                d1 = _mm_sub_ps(s1, dir1);                      // Y1 Z1 X2 Y2
+                d2 = _mm_sub_ss(s2, dir2);                      // Z2 -- -- --
+
+                DestAccessor::store(pDestPos + 0, d0);
+                DestAccessor::store(pDestPos + 4, d1);
+                _mm_store_ss(pDestPos + 8, d2);
+                break;
+
+            case 2:
+                // 6 floating-point values
+                s0 = SrcAccessor::load(pSrcPos + 0);
+                s1 = _mm_loadl_pi(dir1, (__m64*)(pSrcPos + 4)); // dir1 is meaningless here
+
+                // The extrusion direction is inverted, use subtract instruction here
+                d0 = _mm_sub_ps(s0, dir0);                      // X0 Y0 Z0 X1
+                d1 = _mm_sub_ps(s1, dir1);                      // Y1 Z1 -- --
+
+                DestAccessor::store(pDestPos + 0, d0);
+                _mm_storel_pi((__m64*)(pDestPos + 4), d1);
+                break;
+
+            case 1:
+                // 3 floating-point values
+                s0 = _mm_loadl_pi(dir0, (__m64*)(pSrcPos + 0)); // dir0 is meaningless here
+                s1 = _mm_load_ss(pSrcPos + 2);
+
+                // The extrusion direction is inverted, use subtract instruction here
+                d0 = _mm_sub_ps(s0, dir0);                      // X0 Y0 -- --
+                d1 = _mm_sub_ss(s1, dir2);                      // Z0 -- -- --
+
+                _mm_storel_pi((__m64*)(pDestPos + 0), d0);
+                _mm_store_ss(pDestPos + 2, d1);
+                break;
+            }
+        }
+    };
+    //---------------------------------------------------------------------
+    // Template to extrude vertices for point light.
+    template <bool srcAligned, bool destAligned>
+    struct ExtrudeVertices_SSE_PointLight
+    {
+        static void apply(
+            const Vector4& lightPos,
+            Real extrudeDist,
+            const float* pSrcPos,
+            float* pDestPos,
+            size_t numVertices)
+        {
+            typedef SSEMemoryAccessor<srcAligned> SrcAccessor;
+            typedef SSEMemoryAccessor<destAligned> DestAccessor;
+
+            // Point light, will calculate extrusion direction for every vertex
+
+            // Load light vector, unaligned
+            __m128 lp = _mm_loadu_ps(&lightPos.x);
+
+            // Load extrude distance
+            __m128 extrudeDist4 = _mm_load_ps1(&extrudeDist);
+
+            size_t numIterations = numVertices / 4;
+            numVertices &= 3;
+
+            // Extruding 4 vertices per-iteration
+            for (size_t i = 0; i < numIterations; ++i)
+            {
+                // Load source positions
+                __m128 s0 = SrcAccessor::load(pSrcPos + 0);     // x0 y0 z0 x1
+                __m128 s1 = SrcAccessor::load(pSrcPos + 4);     // y1 z1 x2 y2
+                __m128 s2 = SrcAccessor::load(pSrcPos + 8);     // z2 x3 y3 z3
+                pSrcPos += 12;
+
+                // Arrange to 3x4 component-major for batches calculate
+                __MM_TRANSPOSE4x3_PS(s0, s1, s2);
+
+                // Calculate unnormalised extrusion direction
+                __m128 dx = _mm_sub_ps(s0, __MM_SELECT(lp, 0)); // X0 X1 X2 X3
+                __m128 dy = _mm_sub_ps(s1, __MM_SELECT(lp, 1)); // Y0 Y1 Y2 Y3
+                __m128 dz = _mm_sub_ps(s2, __MM_SELECT(lp, 2)); // Z0 Z1 Z2 Z3
+
+                // Normalise extrusion direction and multiply by extrude distance
+                __m128 tmp = __MM_DOT3x3_PS(dx, dy, dz, dx, dy, dz);
+                tmp = _mm_mul_ps(_mm_rsqrt_ps(tmp), extrudeDist4);
+                dx = _mm_mul_ps(dx, tmp);
+                dy = _mm_mul_ps(dy, tmp);
+                dz = _mm_mul_ps(dz, tmp);
+
+                // Calculate extruded positions
+                __m128 d0 = _mm_add_ps(dx, s0);
+                __m128 d1 = _mm_add_ps(dy, s1);
+                __m128 d2 = _mm_add_ps(dz, s2);
+
+                // Arrange back to 4x3 continuous format for store results
+                __MM_TRANSPOSE3x4_PS(d0, d1, d2);
+
+                // Store extruded positions
+                DestAccessor::store(pDestPos + 0, d0);
+                DestAccessor::store(pDestPos + 4, d1);
+                DestAccessor::store(pDestPos + 8, d2);
+                pDestPos += 12;
+            }
+
+            // Dealing with remaining vertices
+            for (size_t j = 0; j  < numVertices; ++j)
+            {
+                // Load source position
+                __m128 src = _mm_loadh_pi(_mm_load_ss(pSrcPos + 0), (__m64*)(pSrcPos + 1)); // x 0 y z
+                pSrcPos += 3;
+
+                // Calculate unnormalised extrusion direction
+                __m128 dir = _mm_sub_ps(src, _mm_shuffle_ps(lp, lp, _MM_SHUFFLE(2,1,3,0))); // X 1 Y Z
+
+                // Normalise extrusion direction and multiply by extrude distance
+                __m128 tmp = _mm_mul_ps(dir, dir);
+                tmp = _mm_add_ss(_mm_add_ss(tmp, _mm_movehl_ps(tmp, tmp)), _mm_shuffle_ps(tmp, tmp, 3));
+                // Looks like VC7.1 generate a bit inefficient code for 'rsqrtss', so use 'rsqrtps' instead
+                tmp = _mm_mul_ss(_mm_rsqrt_ps(tmp), extrudeDist4);
+                dir = _mm_mul_ps(dir, __MM_SELECT(tmp, 0));
+
+                // Calculate extruded position
+                __m128 dst = _mm_add_ps(dir, src);
+
+                // Store extruded position
+                _mm_store_ss(pDestPos + 0, dst);
+                _mm_storeh_pi((__m64*)(pDestPos + 1), dst);
+                pDestPos += 3;
+            }
+        }
+    };
+    //---------------------------------------------------------------------
+    void OptimisedUtilSSE::extrudeVertices(
+        const Vector4& lightPos,
+        Real extrudeDist,
+        const float* pSrcPos,
+        float* pDestPos,
+        size_t numVertices)
+    {
+        __OGRE_CHECK_STACK_ALIGNED_FOR_SSE();
+
+        // Note: Since pDestPos is following tail of pSrcPos, we can't assume
+        // it's aligned to SIMD alignment properly, so must check for it here.
+        //
+        // TODO: Add extra vertex to the vertex buffer for make sure pDestPos
+        // aligned same as pSrcPos.
+        //
+
+        // We are use SSE reciprocal square root directly while calculating
+        // extrusion direction, since precision loss not that important here.
+        //
+        if (lightPos.w == 0.0f)
+        {
+            if (_isAlignedForSSE(pSrcPos))
+            {
+                if (_isAlignedForSSE(pDestPos))
+                    ExtrudeVertices_SSE_DirectionalLight<true, true>::apply(
+                        lightPos, extrudeDist, pSrcPos, pDestPos, numVertices);
+                else
+                    ExtrudeVertices_SSE_DirectionalLight<true, false>::apply(
+                        lightPos, extrudeDist, pSrcPos, pDestPos, numVertices);
+            }
+            else
+            {
+                if (_isAlignedForSSE(pDestPos))
+                    ExtrudeVertices_SSE_DirectionalLight<false, true>::apply(
+                        lightPos, extrudeDist, pSrcPos, pDestPos, numVertices);
+                else
+                    ExtrudeVertices_SSE_DirectionalLight<false, false>::apply(
+                        lightPos, extrudeDist, pSrcPos, pDestPos, numVertices);
+            }
+        }
+        else
+        {
+            assert(lightPos.w == 1.0f);
+
+            if (_isAlignedForSSE(pSrcPos))
+            {
+                if (_isAlignedForSSE(pDestPos))
+                    ExtrudeVertices_SSE_PointLight<true, true>::apply(
+                        lightPos, extrudeDist, pSrcPos, pDestPos, numVertices);
+                else
+                    ExtrudeVertices_SSE_PointLight<true, false>::apply(
+                        lightPos, extrudeDist, pSrcPos, pDestPos, numVertices);
+            }
+            else
+            {
+                if (_isAlignedForSSE(pDestPos))
+                    ExtrudeVertices_SSE_PointLight<false, true>::apply(
+                        lightPos, extrudeDist, pSrcPos, pDestPos, numVertices);
+                else
+                    ExtrudeVertices_SSE_PointLight<false, false>::apply(
+                        lightPos, extrudeDist, pSrcPos, pDestPos, numVertices);
+            }
+        }
+    }
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    extern OptimisedUtil* _getOptimisedUtilSSE(void)
+    {
+        static OptimisedUtilSSE msOptimisedUtilSSE;
+#if defined(__OGRE_SIMD_ALIGN_STACK)
+        static OptimisedUtilWithStackAlign msOptimisedUtilWithStackAlign(&msOptimisedUtilSSE);
+        return &msOptimisedUtilWithStackAlign;
+#else
+        return &msOptimisedUtilSSE;
+#endif
+    }
+
+}
+
+#endif // __OGRE_HAVE_SSE
Index: /OgreMain/src/OgreOverlay.cpp
===================================================================
--- /OgreMain/src/OgreOverlay.cpp	(revision 5)
+++ /OgreMain/src/OgreOverlay.cpp	(revision 5)
@@ -0,0 +1,353 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreOverlay.h"
+#include "OgreRoot.h"
+#include "OgreSceneManager.h"
+#include "OgreOverlayContainer.h"
+#include "OgreCamera.h"
+#include "OgreOverlayManager.h"
+#include "OgreQuaternion.h"
+#include "OgreVector3.h"
+
+
+namespace Ogre {
+
+    //---------------------------------------------------------------------
+    Overlay::Overlay(const String& name) :
+        mName(name),
+        mRotate(0.0f), 
+        mScrollX(0.0f), mScrollY(0.0f),
+        mScaleX(1.0f), mScaleY(1.0f), 
+        mTransformOutOfDate(true), mTransformUpdated(true), 
+        mZOrder(100), mVisible(false), mInitialised(false)
+
+    {
+        mRootNode = new SceneNode(NULL);
+
+    }
+    //---------------------------------------------------------------------
+    Overlay::~Overlay()
+    {
+        delete mRootNode;
+    }
+    //---------------------------------------------------------------------
+    const String& Overlay::getName(void) const
+    {
+        return mName;
+    }
+    //---------------------------------------------------------------------
+    void Overlay::setZOrder(ushort zorder)
+    {
+        // Limit to 650 since this is multiplied by 100 to pad out for containers
+        assert (zorder <= 650 && "Overlay ZOrder cannot be greater than 650!");
+
+        mZOrder = zorder;
+
+        // Notify attached 2D elements
+        OverlayContainerList::iterator i, iend;
+        iend = m2DElements.end();
+        for (i = m2DElements.begin(); i != iend; ++i)
+        {
+            (*i)->_notifyZOrder(zorder * 100);
+        }
+
+    }
+    //---------------------------------------------------------------------
+    ushort Overlay::getZOrder(void) const
+    {
+        return mZOrder;
+    }
+    //---------------------------------------------------------------------
+    bool Overlay::isVisible(void) const
+    {
+        return mVisible;
+    }
+    //---------------------------------------------------------------------
+    void Overlay::show(void)
+    {
+        mVisible = true;
+		if (!mInitialised)
+		{
+			initialise();
+		}
+    }
+    //---------------------------------------------------------------------
+    void Overlay::hide(void)
+    {
+        mVisible = false;
+    }
+    //---------------------------------------------------------------------
+	void Overlay::initialise(void)
+	{
+		OverlayContainerList::iterator i, iend;
+		iend = m2DElements.end();
+		for (i = m2DElements.begin(); i != m2DElements.end(); ++i)
+		{
+			(*i)->initialise();
+		}
+		mInitialised = true;
+	}
+	//---------------------------------------------------------------------
+    void Overlay::add2D(OverlayContainer* cont)
+    {
+        m2DElements.push_back(cont);
+        // Notify parent
+        cont->_notifyParent(0, this);
+        // Set Z order, scaled to separate overlays
+        // NB max 100 container levels per overlay, should be plenty
+        cont->_notifyZOrder(mZOrder * 100);
+
+        Matrix4 xform;
+        _getWorldTransforms(&xform);
+        cont->_notifyWorldTransforms(xform);
+        cont->_notifyViewport();
+    }
+    //---------------------------------------------------------------------
+    void Overlay::remove2D(OverlayContainer* cont)
+    {
+        m2DElements.remove(cont);
+    }
+    //---------------------------------------------------------------------
+    void Overlay::add3D(SceneNode* node)
+    {
+        mRootNode->addChild(node);
+    }
+    //---------------------------------------------------------------------
+    void Overlay::remove3D(SceneNode* node)
+    {
+        mRootNode->removeChild(node->getName());
+    }
+    //---------------------------------------------------------------------
+    void Overlay::clear(void)
+    {
+        mRootNode->removeAllChildren();
+        m2DElements.clear();
+        // Note no deallocation, memory handled by OverlayManager & SceneManager
+    }
+    //---------------------------------------------------------------------
+    void Overlay::setScroll(Real x, Real y)
+    {
+        mScrollX = x;
+        mScrollY = y;
+        mTransformOutOfDate = true;
+        mTransformUpdated = true;
+    }
+    //---------------------------------------------------------------------
+    Real Overlay::getScrollX(void) const
+    {
+        return mScrollX;
+    }
+    //---------------------------------------------------------------------
+    Real Overlay::getScrollY(void) const
+    {
+        return mScrollY;
+    }
+      //---------------------------------------------------------------------
+    OverlayContainer* Overlay::getChild(const String& name)
+    {
+
+        OverlayContainerList::iterator i, iend;
+        iend = m2DElements.end();
+        for (i = m2DElements.begin(); i != iend; ++i)
+        {
+            if ((*i)->getName() == name)
+			{
+				return *i;
+
+			}
+        }
+        return NULL;
+    }
+  //---------------------------------------------------------------------
+    void Overlay::scroll(Real xoff, Real yoff)
+    {
+        mScrollX += xoff;
+        mScrollY += yoff;
+        mTransformOutOfDate = true;
+        mTransformUpdated = true;
+    }
+    //---------------------------------------------------------------------
+    void Overlay::setRotate(const Radian& angle)
+    {
+        mRotate = angle;
+        mTransformOutOfDate = true;
+        mTransformUpdated = true;
+    }
+    //---------------------------------------------------------------------
+    void Overlay::rotate(const Radian& angle)
+    {
+        setRotate(mRotate + angle);
+    }
+    //---------------------------------------------------------------------
+    void Overlay::setScale(Real x, Real y)
+    {
+        mScaleX = x;
+        mScaleY = y;
+        mTransformOutOfDate = true;
+        mTransformUpdated = true;
+    }
+    //---------------------------------------------------------------------
+    Real Overlay::getScaleX(void) const
+    {
+        return mScaleX;
+    }
+    //---------------------------------------------------------------------
+    Real Overlay::getScaleY(void) const
+    {
+        return mScaleY;
+    }
+    //---------------------------------------------------------------------
+    void Overlay::_getWorldTransforms(Matrix4* xform) const
+    {
+        if (mTransformOutOfDate)
+        {
+            updateTransform();
+        }
+        *xform = mTransform;
+
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& Overlay::getWorldOrientation(void) const
+    {
+        // n/a
+        return Quaternion::IDENTITY;
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& Overlay::getWorldPosition(void) const
+    {
+        // n/a
+        return Vector3::ZERO;
+    }
+    //---------------------------------------------------------------------
+    void Overlay::_findVisibleObjects(Camera* cam, RenderQueue* queue)
+    {
+        OverlayContainerList::iterator i, iend;
+
+        if (OverlayManager::getSingleton().hasViewportChanged())
+        {
+            iend = m2DElements.end();
+            for (i = m2DElements.begin(); i != iend; ++i)
+            {
+                (*i)->_notifyViewport();
+            }
+        }
+
+        // update elements
+        if (mTransformUpdated)
+        {
+            OverlayContainerList::iterator i, iend;
+            Matrix4 xform;
+
+            _getWorldTransforms(&xform);
+            iend = m2DElements.end();
+            for (i = m2DElements.begin(); i != iend; ++i)
+            {
+                (*i)->_notifyWorldTransforms(xform);
+            }
+
+            mTransformUpdated = false;
+        }
+
+        if (mVisible)
+        {
+            // Add 3D elements
+            mRootNode->setPosition(cam->getDerivedPosition());
+            mRootNode->setOrientation(cam->getDerivedOrientation());
+            mRootNode->_update(true, false);
+            // Set up the default queue group for the objects about to be added
+            uint8 oldgrp = queue->getDefaultQueueGroup();
+            ushort oldPriority = queue-> getDefaultRenderablePriority();
+            queue->setDefaultQueueGroup(RENDER_QUEUE_OVERLAY);
+            queue->setDefaultRenderablePriority((mZOrder*100)-1);
+            mRootNode->_findVisibleObjects(cam, queue, NULL, true, false);
+            // Reset the group
+            queue->setDefaultQueueGroup(oldgrp);
+            queue->setDefaultRenderablePriority(oldPriority);
+            // Add 2D elements
+            iend = m2DElements.end();
+            for (i = m2DElements.begin(); i != iend; ++i)
+            {
+                (*i)->_update();
+
+                (*i)->_updateRenderQueue(queue);
+            }
+        }
+
+
+
+       
+    }
+    //---------------------------------------------------------------------
+    void Overlay::updateTransform(void) const
+    {
+        // Ordering:
+        //    1. Scale
+        //    2. Rotate
+        //    3. Translate
+
+        Matrix3 rot3x3, scale3x3;
+        rot3x3.FromEulerAnglesXYZ(Radian(0),Radian(0),mRotate);
+        scale3x3 = Matrix3::ZERO;
+        scale3x3[0][0] = mScaleX;
+        scale3x3[1][1] = mScaleY;
+        scale3x3[2][2] = 1.0f;
+
+        mTransform = Matrix4::IDENTITY;
+        mTransform = rot3x3 * scale3x3;
+        mTransform.setTrans(Vector3(mScrollX, mScrollY, 0));
+
+        mTransformOutOfDate = false;
+    }
+    //---------------------------------------------------------------------
+	OverlayElement* Overlay::findElementAt(Real x, Real y)
+	{
+		OverlayElement* ret = NULL;
+		int currZ = -1;
+        OverlayContainerList::iterator i, iend;
+        iend = m2DElements.end();
+        for (i = m2DElements.begin(); i != iend; ++i)
+        {
+			int z = (*i)->getZOrder();
+			if (z > currZ)
+			{
+				OverlayElement* elementFound = (*i)->findElementAt(x,y);
+				if(elementFound)
+				{
+					currZ = elementFound->getZOrder();
+					ret = elementFound;
+				}
+			}
+        }
+		return ret;
+	}
+
+}
+
Index: /OgreMain/src/OgreOverlayContainer.cpp
===================================================================
--- /OgreMain/src/OgreOverlayContainer.cpp	(revision 5)
+++ /OgreMain/src/OgreOverlayContainer.cpp	(revision 5)
@@ -0,0 +1,385 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreOverlayContainer.h"
+#include "OgreException.h"
+#include "OgreOverlayManager.h"
+
+namespace Ogre {
+
+    //---------------------------------------------------------------------
+    OverlayContainer::OverlayContainer(const String& name)
+        : OverlayElement(name),
+		mChildrenProcessEvents(true)
+    {
+    }
+    //---------------------------------------------------------------------
+    OverlayContainer::~OverlayContainer()
+    {
+		// remove from parent overlay if root
+		if (mOverlay && !mParent)
+		{
+			mOverlay->remove2D(this);
+		}
+
+        OverlayContainer::ChildIterator ci = getChildIterator();
+        while (ci.hasMoreElements())
+        {
+            OverlayElement* child = ci.getNext();
+			child->_notifyParent(0, 0);
+        }
+    }
+    //---------------------------------------------------------------------
+    void OverlayContainer::addChild(OverlayElement* elem)
+    {
+        if (elem->isContainer())
+		{
+			addChildImpl(static_cast<OverlayContainer*>(elem));
+		}
+		else
+		{
+			addChildImpl(elem);
+		}
+
+	}
+    //---------------------------------------------------------------------
+    void OverlayContainer::addChildImpl(OverlayElement* elem)
+    {
+        String name = elem->getName();
+        ChildMap::iterator i = mChildren.find(name);
+        if (i != mChildren.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, "Child with name " + name + 
+                " already defined.", "OverlayContainer::addChild");
+        }
+
+        mChildren.insert(ChildMap::value_type(name, elem));
+        // tell child about parent & ZOrder
+        elem->_notifyParent(this, mOverlay);
+	    elem->_notifyZOrder(mZOrder + 1);
+	    elem->_notifyWorldTransforms(mXForm);
+	    elem->_notifyViewport();
+
+    }
+    //---------------------------------------------------------------------
+    void OverlayContainer::addChildImpl(OverlayContainer* cont)
+    {
+        // Add to main map first 
+        // This will pick up duplicates
+        OverlayElement* pElem = cont;
+        addChildImpl(pElem);
+
+        /*
+        cont->_notifyParent(this, mOverlay);
+        cont->_notifyZOrder(mZOrder + 1);
+	    cont->_notifyWorldTransforms(mXForm);
+
+		// tell children of new container the current overlay
+        ChildIterator it = cont->getChildIterator();
+        while (it.hasMoreElements())
+        {
+            // Give children ZOrder 1 higher than this
+            GuiElement* pElemChild = it.getNext();
+			pElemChild->_notifyParent(cont, mOverlay);
+            pElemChild->_notifyZOrder(cont->getZOrder() + 1);
+    	    pElemChild->_notifyWorldTransforms(mXForm);
+        }
+        */
+
+        // Now add to specific map too
+        mChildContainers.insert(ChildContainerMap::value_type(cont->getName(), cont));
+
+    }
+    //---------------------------------------------------------------------
+    void OverlayContainer::removeChild(const String& name)
+    {
+        ChildMap::iterator i = mChildren.find(name);
+        if (i == mChildren.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Child with name " + name + 
+                " not found.", "OverlayContainer::removeChild");
+        }
+
+        OverlayElement* element = i->second;
+        mChildren.erase(i);
+
+            // remove from container list (if found)
+        ChildContainerMap::iterator j = mChildContainers.find(name);
+        if (j != mChildContainers.end())
+            mChildContainers.erase(j);
+
+        element->_setParent(0);
+    }
+    //---------------------------------------------------------------------
+    void OverlayContainer::_addChild(OverlayElement* elem)
+    {
+        if (elem->isContainer())
+		{
+			addChildImpl(static_cast<OverlayContainer*>(elem));
+		}
+		else
+		{
+			addChildImpl(elem);
+		}
+	}
+    //---------------------------------------------------------------------
+    void OverlayContainer::_removeChild(const String& name)
+    {
+        ChildMap::iterator i = mChildren.find(name);
+        if (i == mChildren.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Child with name " + name + 
+                " not found.", "OverlayContainer::removeChild");
+        }
+
+        OverlayElement* element = i->second;
+        mChildren.erase(i);
+
+            // remove from container list (if found)
+        ChildContainerMap::iterator j = mChildContainers.find(name);
+        if (j != mChildContainers.end())
+            mChildContainers.erase(j);
+
+        element->_setParent(0);
+    }
+    //---------------------------------------------------------------------
+    OverlayElement* OverlayContainer::getChild(const String& name)
+    {
+        ChildMap::iterator i = mChildren.find(name);
+        if (i == mChildren.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Child with name " + name + 
+                " not found.", "OverlayContainer::getChild");
+        }
+
+        return i->second;
+    }
+    //---------------------------------------------------------------------
+    OverlayContainer::ChildIterator OverlayContainer::getChildIterator(void)
+    {
+        return ChildIterator(mChildren.begin(), mChildren.end());
+    }
+    //---------------------------------------------------------------------
+    OverlayContainer::ChildContainerIterator OverlayContainer::getChildContainerIterator(void)
+    {
+        return ChildContainerIterator(mChildContainers.begin(), mChildContainers.end());
+    }
+	//---------------------------------------------------------------------
+	void OverlayContainer::initialise(void)
+	{
+		ChildContainerMap::iterator coni;
+		for (coni =  mChildContainers.begin(); coni != mChildContainers.end(); ++coni)
+		{
+			coni->second->initialise();
+		}
+		ChildMap::iterator ci;
+		for (ci =  mChildren.begin(); ci != mChildren.end(); ++ci)
+		{
+			ci->second->initialise();
+		}
+	}
+    //---------------------------------------------------------------------
+	void OverlayContainer::_positionsOutOfDate(void)
+	{
+		OverlayElement::_positionsOutOfDate();
+
+        ChildIterator it = getChildIterator();
+        while (it.hasMoreElements())
+        {
+			it.getNext()->_positionsOutOfDate();
+        }
+	}
+
+    //---------------------------------------------------------------------
+    void OverlayContainer::_update(void)
+    {
+        // call superclass
+        OverlayElement::_update();
+
+        // Update children
+        ChildIterator it = getChildIterator();
+        while (it.hasMoreElements())
+        {
+            it.getNext()->_update();
+        }
+
+
+    }
+    //---------------------------------------------------------------------
+    void OverlayContainer::_notifyZOrder(ushort newZOrder)
+    {
+        OverlayElement::_notifyZOrder(newZOrder);
+
+        // Update children
+        ChildIterator it = getChildIterator();
+        while (it.hasMoreElements())
+        {
+            // Give children ZOrder 1 higher than this
+            it.getNext()->_notifyZOrder(newZOrder + 1);
+        }
+    }
+    //---------------------------------------------------------------------
+    void OverlayContainer::_notifyWorldTransforms(const Matrix4& xform)
+    {
+        OverlayElement::_notifyWorldTransforms(xform);
+
+        // Update children
+        ChildIterator it = getChildIterator();
+        while (it.hasMoreElements())
+        {
+            it.getNext()->_notifyWorldTransforms(xform);
+        }
+    }
+    //---------------------------------------------------------------------
+    void OverlayContainer::_notifyViewport()
+    {
+        OverlayElement::_notifyViewport();
+
+        // Update children
+        ChildIterator it = getChildIterator();
+        while (it.hasMoreElements())
+        {
+            it.getNext()->_notifyViewport();
+        }
+    }
+    //---------------------------------------------------------------------
+    void OverlayContainer::_notifyParent(OverlayContainer* parent, Overlay* overlay)
+    {
+        OverlayElement::_notifyParent(parent, overlay);
+
+        // Update children
+        ChildIterator it = getChildIterator();
+        while (it.hasMoreElements())
+        {
+            // Notify the children of the overlay 
+            it.getNext()->_notifyParent(this, overlay);
+        }
+    }
+
+    //---------------------------------------------------------------------
+    void OverlayContainer::_updateRenderQueue(RenderQueue* queue)
+    {
+        if (mVisible)
+        {
+
+            OverlayElement::_updateRenderQueue(queue);
+
+            // Also add children
+            ChildIterator it = getChildIterator();
+            while (it.hasMoreElements())
+            {
+                // Give children ZOrder 1 higher than this
+                it.getNext()->_updateRenderQueue(queue);
+            }
+        }
+
+    }
+
+
+	OverlayElement* OverlayContainer::findElementAt(Real x, Real y) 		// relative to parent
+	{
+
+		OverlayElement* ret = NULL;
+
+		int currZ = -1;
+
+		if (mVisible)
+		{
+			ret = OverlayElement::findElementAt(x,y);	//default to the current container if no others are found
+			if (ret && mChildrenProcessEvents)
+			{
+				ChildIterator it = getChildIterator();
+				while (it.hasMoreElements())
+				{
+					OverlayElement* currentOverlayElement = it.getNext();
+					if (currentOverlayElement->isVisible() && currentOverlayElement->isEnabled())
+					{
+						int z = currentOverlayElement->getZOrder();
+						if (z > currZ)
+						{
+							OverlayElement* elementFound = currentOverlayElement->findElementAt(x ,y );
+							if (elementFound)
+							{
+								currZ = z;
+								ret = elementFound;
+							}
+						}
+					}
+				}
+			}
+		}
+		return ret;
+	}
+
+    void OverlayContainer::copyFromTemplate(OverlayElement* templateOverlay)
+    {
+        OverlayElement::copyFromTemplate(templateOverlay);
+
+		    if (templateOverlay->isContainer() && isContainer())
+		    {
+    	     OverlayContainer::ChildIterator it = static_cast<OverlayContainer*>(templateOverlay)->getChildIterator();
+			 while (it.hasMoreElements())
+			 {
+				 OverlayElement* oldChildElement = it.getNext();
+				 if (oldChildElement->isCloneable())
+				 {
+					 OverlayElement* newChildElement = 
+						 OverlayManager::getSingleton().createOverlayElement(
+							oldChildElement->getTypeName(), 
+							mName+"/"+oldChildElement->getName());
+					 newChildElement->copyFromTemplate(oldChildElement);
+					 addChild((OverlayContainer*)newChildElement);
+				 }
+			 }
+        }
+    }
+
+    OverlayElement* OverlayContainer::clone(const String& instanceName)
+    {
+        OverlayContainer *newContainer;
+
+        newContainer = static_cast<OverlayContainer*>(OverlayElement::clone(instanceName));
+
+    	  ChildIterator it = getChildIterator();
+  		  while (it.hasMoreElements())
+			  {
+				    OverlayElement* oldChildElement = it.getNext();
+				    if (oldChildElement->isCloneable())
+				    {
+                OverlayElement* newChildElement = oldChildElement->clone(instanceName);
+                newContainer->_addChild(newChildElement);
+            }
+        }
+
+        return newContainer;
+    }
+
+}
+
Index: /OgreMain/src/OgreOverlayElement.cpp
===================================================================
--- /OgreMain/src/OgreOverlayElement.cpp	(revision 5)
+++ /OgreMain/src/OgreOverlayElement.cpp	(revision 5)
@@ -0,0 +1,845 @@
+
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreOverlayElement.h"
+#include "OgreMaterialManager.h"
+#include "OgreOverlay.h"
+#include "OgreOverlayContainer.h"
+#include "OgreOverlayManager.h"
+#include "OgreException.h"
+#include "OgreRenderQueue.h"
+
+namespace Ogre {
+
+
+    //---------------------------------------------------------------------
+    // Define static members
+    OverlayElementCommands::CmdLeft OverlayElement::msLeftCmd;
+    OverlayElementCommands::CmdTop OverlayElement::msTopCmd;
+    OverlayElementCommands::CmdWidth OverlayElement::msWidthCmd;
+    OverlayElementCommands::CmdHeight OverlayElement::msHeightCmd;
+    OverlayElementCommands::CmdMaterial OverlayElement::msMaterialCmd;
+    OverlayElementCommands::CmdCaption OverlayElement::msCaptionCmd;
+    OverlayElementCommands::CmdMetricsMode OverlayElement::msMetricsModeCmd;
+    OverlayElementCommands::CmdHorizontalAlign OverlayElement::msHorizontalAlignCmd;
+    OverlayElementCommands::CmdVerticalAlign OverlayElement::msVerticalAlignCmd;
+    OverlayElementCommands::CmdVisible OverlayElement::msVisibleCmd;
+    //---------------------------------------------------------------------
+    OverlayElement::OverlayElement(const String& name)
+      : mName(name)
+      , mVisible(true)
+      , mCloneable(true)
+      , mLeft(0.0f)
+      , mTop(0.0f)
+      , mWidth(1.0f)
+      , mHeight(1.0f)
+      , mMetricsMode(GMM_RELATIVE)
+      , mHorzAlign(GHA_LEFT)
+      , mVertAlign(GVA_TOP)
+      , mPixelTop(0.0)
+      , mPixelLeft(0.0)
+      , mPixelWidth(1.0)
+      , mPixelHeight(1.0)
+      , mPixelScaleX(1.0)
+      , mPixelScaleY(1.0)
+      , mParent(0)
+      , mOverlay(0)
+      , mDerivedOutOfDate(true)
+      , mGeomPositionsOutOfDate(true)
+      , mGeomUVsOutOfDate(true)
+      , mZOrder(0)
+      , mEnabled(true)
+      , mInitialised(false)
+      , mSourceTemplate(0)
+    {
+		// default overlays to preserve their own detail level
+		mPolygonModeOverrideable = false;
+
+        // use identity projection and view matrices
+        mUseIdentityProjection = true;
+        mUseIdentityView = true;
+    }
+    //---------------------------------------------------------------------
+    OverlayElement::~OverlayElement()
+    {
+		if (mParent)
+		{
+			mParent->removeChild(mName);
+			mParent = 0;
+		}
+    }
+    //---------------------------------------------------------------------
+    const String& OverlayElement::getName(void) const
+    {
+        return mName;
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::show(void)
+    {
+        mVisible = true;
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::hide(void)
+    {
+        mVisible = false;
+    }
+    //---------------------------------------------------------------------
+    bool OverlayElement::isVisible(void) const
+    {
+        return mVisible;
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::setDimensions(Real width, Real height)
+    {
+        if (mMetricsMode != GMM_RELATIVE)
+        {
+            mPixelWidth = width;
+            mPixelHeight = height;
+        }
+        else
+        {
+            mWidth = width;
+            mHeight = height;
+        }
+        mDerivedOutOfDate = true;
+        _positionsOutOfDate();
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::setPosition(Real left, Real top)
+    {
+        if (mMetricsMode != GMM_RELATIVE)
+        {
+            mPixelLeft = left;
+            mPixelTop = top;
+        }
+        else
+        {
+            mLeft = left;
+            mTop = top;
+        }
+        mDerivedOutOfDate = true;
+        _positionsOutOfDate();
+
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::setWidth(Real width)
+    {
+        if (mMetricsMode != GMM_RELATIVE)
+        {
+            mPixelWidth = width;
+        }
+        else
+        {
+            mWidth = width;
+        }
+        mDerivedOutOfDate = true;
+        _positionsOutOfDate();
+    }
+    //---------------------------------------------------------------------
+    Real OverlayElement::getWidth(void) const
+    {
+        if (mMetricsMode != GMM_RELATIVE)
+        {
+			return mPixelWidth;
+		}
+		else
+		{
+        	return mWidth;
+		}
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::setHeight(Real height)
+    {
+        if (mMetricsMode != GMM_RELATIVE)
+        {
+            mPixelHeight = height;
+        }
+        else
+        {
+            mHeight = height;
+        }
+        mDerivedOutOfDate = true;
+        _positionsOutOfDate();
+    }
+    //---------------------------------------------------------------------
+    Real OverlayElement::getHeight(void) const
+    {
+        if (mMetricsMode != GMM_RELATIVE)
+        {
+			return mPixelHeight;
+		}
+		else
+		{
+			return mHeight;
+		}
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::setLeft(Real left)
+    {
+        if (mMetricsMode != GMM_RELATIVE)
+        {
+            mPixelLeft = left;
+        }
+        else
+        {
+            mLeft = left;
+        }
+        mDerivedOutOfDate = true;
+        _positionsOutOfDate();
+    }
+    //---------------------------------------------------------------------
+    Real OverlayElement::getLeft(void) const
+    {
+        if (mMetricsMode != GMM_RELATIVE)
+        {
+			return mPixelLeft;
+		}
+		else
+		{
+        	return mLeft;
+		}
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::setTop(Real top)
+    {
+        if (mMetricsMode != GMM_RELATIVE)
+        {
+            mPixelTop = top;
+        }
+        else
+        {
+            mTop = top;
+        }
+
+        mDerivedOutOfDate = true;
+        _positionsOutOfDate();
+    }
+    //---------------------------------------------------------------------
+    Real OverlayElement::getTop(void) const
+    {
+        if (mMetricsMode != GMM_RELATIVE)
+        {
+			return mPixelTop;
+		}
+		else
+		{
+	        return mTop;
+		}
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::_setLeft(Real left)
+    {
+        mLeft = left;
+        mPixelLeft = left / mPixelScaleX;
+
+        mDerivedOutOfDate = true;
+        _positionsOutOfDate();
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::_setTop(Real top)
+    {
+        mTop = top;
+        mPixelTop = top / mPixelScaleY;
+
+        mDerivedOutOfDate = true;
+        _positionsOutOfDate();
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::_setWidth(Real width)
+    {
+        mWidth = width;
+        mPixelWidth = width / mPixelScaleX;
+
+        mDerivedOutOfDate = true;
+        _positionsOutOfDate();
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::_setHeight(Real height)
+    {
+        mHeight = height;
+        mPixelHeight = height / mPixelScaleY;
+
+        mDerivedOutOfDate = true;
+        _positionsOutOfDate();
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::_setPosition(Real left, Real top)
+    {
+        mLeft = left;
+        mTop  = top;
+        mPixelLeft = left / mPixelScaleX;
+        mPixelTop  = top / mPixelScaleY;
+
+        mDerivedOutOfDate = true;
+        _positionsOutOfDate();
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::_setDimensions(Real width, Real height)
+    {
+        mWidth  = width;
+        mHeight = height;
+        mPixelWidth  = width / mPixelScaleX;
+        mPixelHeight = height / mPixelScaleY;
+
+        mDerivedOutOfDate = true;
+        _positionsOutOfDate();
+    }
+    //---------------------------------------------------------------------
+    const String& OverlayElement::getMaterialName(void) const
+    {
+        return mMaterialName;
+
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::setMaterialName(const String& matName)
+    {
+        mMaterialName = matName;
+        mpMaterial = MaterialManager::getSingleton().getByName(matName);
+		if (mpMaterial.isNull())
+			OGRE_EXCEPT( Exception::ERR_ITEM_NOT_FOUND, "Could not find material " + matName,
+				"OverlayElement::setMaterialName" );
+        mpMaterial->load();
+        // Set some prerequisites to be sure
+        mpMaterial->setLightingEnabled(false);
+        mpMaterial->setDepthCheckEnabled(false);
+
+    }
+    //---------------------------------------------------------------------
+    const MaterialPtr& OverlayElement::getMaterial(void) const
+    {
+        return mpMaterial;
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::getWorldTransforms(Matrix4* xform) const
+    {
+        mOverlay->_getWorldTransforms(xform);
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& OverlayElement::getWorldOrientation(void) const
+    {
+        return mOverlay->getWorldOrientation();
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& OverlayElement::getWorldPosition(void) const
+    {
+        return mOverlay->getWorldPosition();
+    }
+    //---------------------------------------------------------------------
+	void OverlayElement::_positionsOutOfDate(void)
+	{
+		mGeomPositionsOutOfDate = true;
+	}
+
+    //---------------------------------------------------------------------
+    void OverlayElement::_update(void)
+    {
+        // Check size if pixel-based
+        switch (mMetricsMode)
+        {
+        case GMM_PIXELS :
+            if (OverlayManager::getSingleton().hasViewportChanged() || mGeomPositionsOutOfDate)
+            {
+                Real vpWidth, vpHeight;
+                OverlayManager& oMgr = OverlayManager::getSingleton();
+                vpWidth = (Real) (oMgr.getViewportWidth());
+                vpHeight = (Real) (oMgr.getViewportHeight());
+
+                mPixelScaleX = 1.0 / vpWidth;
+                mPixelScaleY = 1.0 / vpHeight;
+
+                mLeft = mPixelLeft * mPixelScaleX;
+                mTop = mPixelTop * mPixelScaleY;
+                mWidth = mPixelWidth * mPixelScaleX;
+                mHeight = mPixelHeight * mPixelScaleY;
+            }
+            break;
+
+        case GMM_RELATIVE_ASPECT_ADJUSTED :
+            if (OverlayManager::getSingleton().hasViewportChanged() || mGeomPositionsOutOfDate)
+            {
+                Real vpWidth, vpHeight;
+                OverlayManager& oMgr = OverlayManager::getSingleton();
+                vpWidth = (Real) (oMgr.getViewportWidth());
+                vpHeight = (Real) (oMgr.getViewportHeight());
+
+                mPixelScaleX = 1.0 / (10000.0 * (vpWidth / vpHeight));
+                mPixelScaleY = 1.0 /  10000.0;
+
+                mLeft = mPixelLeft * mPixelScaleX;
+                mTop = mPixelTop * mPixelScaleY;
+                mWidth = mPixelWidth * mPixelScaleX;
+                mHeight = mPixelHeight * mPixelScaleY;
+            }
+            break;
+        default:
+            break;
+        }
+
+        _updateFromParent();
+        // NB container subclasses will update children too
+
+        // Tell self to update own position geometry
+        if (mGeomPositionsOutOfDate && mInitialised)
+        {
+            updatePositionGeometry();
+            mGeomPositionsOutOfDate = false;
+        }
+		// Tell self to update own texture geometry
+		if (mGeomUVsOutOfDate && mInitialised)
+		{
+			updateTextureGeometry();
+			mGeomUVsOutOfDate = false;
+		}
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::_updateFromParent(void)
+    {
+        Real parentLeft, parentTop, parentBottom, parentRight;
+
+        if (mParent)
+        {
+            parentLeft = mParent->_getDerivedLeft();
+            parentTop = mParent->_getDerivedTop();
+            if (mHorzAlign == GHA_CENTER || mHorzAlign == GHA_RIGHT)
+            {
+                parentRight = parentLeft + mParent->_getRelativeWidth();
+            }
+            if (mVertAlign == GVA_CENTER || mVertAlign == GVA_BOTTOM)
+            {
+                parentBottom = parentTop + mParent->_getRelativeHeight();
+            }
+
+        }
+        else
+        {
+            RenderSystem* rSys = Root::getSingleton().getRenderSystem();
+            OverlayManager& oMgr = OverlayManager::getSingleton();
+
+            // Calculate offsets required for mapping texel origins to pixel origins in the
+            // current rendersystem
+            Real hOffset = rSys->getHorizontalTexelOffset() / oMgr.getViewportWidth();
+            Real vOffset = rSys->getVerticalTexelOffset() / oMgr.getViewportHeight();
+
+            parentLeft = 0.0f + hOffset;
+            parentTop = 0.0f + vOffset;
+            parentRight = 1.0f + hOffset;
+            parentBottom = 1.0f + vOffset;
+        }
+
+        // Sort out position based on alignment
+        // NB all we do is derived the origin, we don't automatically sort out the position
+        // This is more flexible than forcing absolute right & middle 
+        switch(mHorzAlign)
+        {
+        case GHA_CENTER:
+            mDerivedLeft = ((parentLeft + parentRight) * 0.5f) + mLeft;
+            break;
+        case GHA_LEFT:
+            mDerivedLeft = parentLeft + mLeft;
+            break;
+        case GHA_RIGHT:
+            mDerivedLeft = parentRight + mLeft;
+            break;
+        };
+        switch(mVertAlign)
+        {
+        case GVA_CENTER:
+            mDerivedTop = ((parentTop + parentBottom) * 0.5f) + mTop;
+            break;
+        case GVA_TOP:
+            mDerivedTop = parentTop + mTop;
+            break;
+        case GVA_BOTTOM:
+            mDerivedTop = parentBottom + mTop;
+            break;
+        };
+
+        mDerivedOutOfDate = false;
+
+        if (mParent != 0)
+        {
+            Rectangle parent;
+            Rectangle child;
+
+            mParent->_getClippingRegion(parent);
+
+            child.left   = mDerivedLeft;
+            child.top    = mDerivedTop;
+            child.right  = mDerivedLeft + mWidth;
+            child.bottom = mDerivedTop + mHeight;
+
+            mClippingRegion = intersect(parent, child);
+        }
+        else
+        {
+            mClippingRegion.left   = mDerivedLeft;
+            mClippingRegion.top    = mDerivedTop;
+            mClippingRegion.right  = mDerivedLeft + mWidth;
+            mClippingRegion.bottom = mDerivedTop + mHeight;
+        }
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::_notifyParent(OverlayContainer* parent, Overlay* overlay)
+    {
+        mParent = parent;
+        mOverlay = overlay;
+
+		if (mOverlay && mOverlay->isInitialised() && !mInitialised)
+		{
+			initialise();
+		}
+
+        mDerivedOutOfDate = true;
+    }
+    //---------------------------------------------------------------------
+    Real OverlayElement::_getDerivedLeft(void)
+    {
+        if (mDerivedOutOfDate)
+        {
+            _updateFromParent();
+        }
+        return mDerivedLeft;
+    }
+    //---------------------------------------------------------------------
+    Real OverlayElement::_getDerivedTop(void)
+    {
+        if (mDerivedOutOfDate)
+        {
+            _updateFromParent();
+        }
+        return mDerivedTop;
+    }
+	//---------------------------------------------------------------------
+	Real OverlayElement::_getRelativeWidth(void)
+	{
+		return mWidth;
+	}
+	//---------------------------------------------------------------------
+	Real OverlayElement::_getRelativeHeight(void)
+	{
+		return mHeight;
+	}
+    //---------------------------------------------------------------------    
+    void OverlayElement::_getClippingRegion(Rectangle &clippingRegion)
+    {
+        if (mDerivedOutOfDate)
+        {
+            _updateFromParent();
+        }
+        clippingRegion = mClippingRegion;
+    }
+    //---------------------------------------------------------------------
+    void OverlayElement::_notifyZOrder(ushort newZOrder)
+    {
+        mZOrder = newZOrder;
+    }
+
+    //---------------------------------------------------------------------
+    void OverlayElement::_notifyWorldTransforms(const Matrix4& xform)
+    {
+        mXForm = xform;
+    }
+
+    //---------------------------------------------------------------------
+    void OverlayElement::_notifyViewport()
+    {
+        switch (mMetricsMode)
+        {
+        case GMM_PIXELS :
+            {
+                Real vpWidth, vpHeight;
+                OverlayManager& oMgr = OverlayManager::getSingleton();
+                vpWidth = (Real) (oMgr.getViewportWidth());
+                vpHeight = (Real) (oMgr.getViewportHeight());
+
+                mPixelScaleX = 1.0 / vpWidth;
+                mPixelScaleY = 1.0 / vpHeight;
+            }
+            break;
+
+        case GMM_RELATIVE_ASPECT_ADJUSTED :
+            {
+                Real vpWidth, vpHeight;
+                OverlayManager& oMgr = OverlayManager::getSingleton();
+                vpWidth = (Real) (oMgr.getViewportWidth());
+                vpHeight = (Real) (oMgr.getViewportHeight());
+
+                mPixelScaleX = 1.0 / (10000.0 * (vpWidth / vpHeight));
+                mPixelScaleY = 1.0 /  10000.0;
+            }
+            break;
+
+        case GMM_RELATIVE :
+            mPixelScaleX = 1.0;
+            mPixelScaleY = 1.0;
+            mPixelLeft = mLeft;
+            mPixelTop = mTop;
+            mPixelWidth = mWidth;
+            mPixelHeight = mHeight;
+            break;
+        }
+
+        mLeft = mPixelLeft * mPixelScaleX;
+        mTop = mPixelTop * mPixelScaleY;
+        mWidth = mPixelWidth * mPixelScaleX;
+        mHeight = mPixelHeight * mPixelScaleY;
+
+        mGeomPositionsOutOfDate = true;
+    }
+
+    //---------------------------------------------------------------------
+    void OverlayElement::_updateRenderQueue(RenderQueue* queue)
+    {
+        if (mVisible)
+        {
+            queue->addRenderable(this, RENDER_QUEUE_OVERLAY, mZOrder);
+        }
+      
+    }
+    //-----------------------------------------------------------------------
+    void OverlayElement::addBaseParameters(void)    
+    {
+        ParamDictionary* dict = getParamDictionary();
+
+        dict->addParameter(ParameterDef("left", 
+            "The position of the left border of the gui element."
+            , PT_REAL),
+            &msLeftCmd);
+        dict->addParameter(ParameterDef("top", 
+            "The position of the top border of the gui element."
+            , PT_REAL),
+            &msTopCmd);
+        dict->addParameter(ParameterDef("width", 
+            "The width of the element."
+            , PT_REAL),
+            &msWidthCmd);
+        dict->addParameter(ParameterDef("height", 
+            "The height of the element."
+            , PT_REAL),
+            &msHeightCmd);
+        dict->addParameter(ParameterDef("material", 
+            "The name of the material to use."
+            , PT_STRING),
+            &msMaterialCmd);
+        dict->addParameter(ParameterDef("caption", 
+            "The element caption, if supported."
+            , PT_STRING),
+            &msCaptionCmd);
+        dict->addParameter(ParameterDef("metrics_mode", 
+            "The type of metrics to use, either 'relative' to the screen, 'pixels' or 'relative_aspect_adjusted'."
+            , PT_STRING),
+            &msMetricsModeCmd);
+        dict->addParameter(ParameterDef("horz_align", 
+            "The horizontal alignment, 'left', 'right' or 'center'."
+            , PT_STRING),
+            &msHorizontalAlignCmd);
+        dict->addParameter(ParameterDef("vert_align", 
+            "The vertical alignment, 'top', 'bottom' or 'center'."
+            , PT_STRING),
+            &msVerticalAlignCmd);
+        dict->addParameter(ParameterDef("visible", 
+            "Initial visibility of element, either 'true' or 'false' (default true)."
+            , PT_STRING),
+            &msVisibleCmd);
+    }
+    //-----------------------------------------------------------------------
+    void OverlayElement::setCaption( const DisplayString& caption )
+    {
+        mCaption = caption;
+        _positionsOutOfDate();
+    }
+    //-----------------------------------------------------------------------
+	const DisplayString& OverlayElement::getCaption() const
+    {
+        return mCaption;
+    }
+    //-----------------------------------------------------------------------
+    void OverlayElement::setColour(const ColourValue& col)
+    {
+        mColour = col;
+    }
+    //-----------------------------------------------------------------------
+    const ColourValue& OverlayElement::getColour(void) const
+    {
+        return mColour;
+    }
+    //-----------------------------------------------------------------------
+    void OverlayElement::setMetricsMode(GuiMetricsMode gmm)
+    {
+        switch (gmm)
+        {
+        case GMM_PIXELS :
+            {
+                Real vpWidth, vpHeight;
+                OverlayManager& oMgr = OverlayManager::getSingleton();
+                vpWidth = (Real) (oMgr.getViewportWidth());
+                vpHeight = (Real) (oMgr.getViewportHeight());
+
+                mPixelScaleX = 1.0 / vpWidth;
+                mPixelScaleY = 1.0 / vpHeight;
+
+                if (mMetricsMode == GMM_RELATIVE)
+                {
+                    mPixelLeft = mLeft;
+                    mPixelTop = mTop;
+                    mPixelWidth = mWidth;
+                    mPixelHeight = mHeight;
+                }
+            }
+            break;
+
+        case GMM_RELATIVE_ASPECT_ADJUSTED :
+            {
+                Real vpWidth, vpHeight;
+                OverlayManager& oMgr = OverlayManager::getSingleton();
+                vpWidth = (Real) (oMgr.getViewportWidth());
+                vpHeight = (Real) (oMgr.getViewportHeight());
+
+                mPixelScaleX = 1.0 / (10000.0 * (vpWidth / vpHeight));
+                mPixelScaleY = 1.0 /  10000.0;
+
+                if (mMetricsMode == GMM_RELATIVE)
+                {
+                    mPixelLeft = mLeft;
+                    mPixelTop = mTop;
+                    mPixelWidth = mWidth;
+                    mPixelHeight = mHeight;
+                }
+            }
+            break;
+
+        case GMM_RELATIVE :
+            mPixelScaleX = 1.0;
+            mPixelScaleY = 1.0;
+            mPixelLeft = mLeft;
+            mPixelTop = mTop;
+            mPixelWidth = mWidth;
+            mPixelHeight = mHeight;
+            break;
+        }
+
+        mLeft = mPixelLeft * mPixelScaleX;
+        mTop = mPixelTop * mPixelScaleY;
+        mWidth = mPixelWidth * mPixelScaleX;
+        mHeight = mPixelHeight * mPixelScaleY;
+
+        mMetricsMode = gmm;
+        mDerivedOutOfDate = true;
+        _positionsOutOfDate();
+    }
+    //-----------------------------------------------------------------------
+    GuiMetricsMode OverlayElement::getMetricsMode(void) const
+    {
+        return mMetricsMode;
+    }
+    //-----------------------------------------------------------------------
+    void OverlayElement::setHorizontalAlignment(GuiHorizontalAlignment gha)
+    {
+        mHorzAlign = gha;
+        _positionsOutOfDate();
+    }
+    //-----------------------------------------------------------------------
+    GuiHorizontalAlignment OverlayElement::getHorizontalAlignment(void) const
+    {
+        return mHorzAlign;
+    }
+    //-----------------------------------------------------------------------
+    void OverlayElement::setVerticalAlignment(GuiVerticalAlignment gva)
+    {
+        mVertAlign = gva;
+        _positionsOutOfDate();
+    }
+    //-----------------------------------------------------------------------
+    GuiVerticalAlignment OverlayElement::getVerticalAlignment(void) const
+    {
+        return mVertAlign;
+    }
+    //-----------------------------------------------------------------------
+
+
+    //-----------------------------------------------------------------------
+	bool OverlayElement::contains(Real x, Real y) const
+	{
+        return mClippingRegion.inside(x, y);
+	}
+
+    //-----------------------------------------------------------------------
+	OverlayElement* OverlayElement::findElementAt(Real x, Real y) 		// relative to parent
+	{
+		OverlayElement* ret = NULL;
+		if (contains(x , y ))
+		{
+			ret = this;
+		}
+		return ret;
+	}
+
+    //-----------------------------------------------------------------------
+	OverlayContainer* OverlayElement::getParent() 
+	{ 
+		return mParent;		
+	}
+
+    void OverlayElement::copyFromTemplate(OverlayElement* templateOverlay)
+	{
+		templateOverlay->copyParametersTo(this);
+    mSourceTemplate = templateOverlay ;
+		return;
+	}
+
+    OverlayElement* OverlayElement::clone(const String& instanceName)
+    {
+        OverlayElement* newElement;
+
+        newElement = OverlayManager::getSingleton().createOverlayElement(
+			getTypeName(), instanceName + "/" + mName);
+        copyParametersTo(newElement);
+
+        return newElement;
+    }
+
+    //-----------------------------------------------------------------------
+	bool OverlayElement::isEnabled() const
+	{ 
+		return mEnabled;
+	}
+
+    //-----------------------------------------------------------------------
+	void OverlayElement::setEnabled(bool b) 
+	{
+		mEnabled = b;
+	}
+
+
+}
+
Index: /OgreMain/src/OgreOverlayElementCommands.cpp
===================================================================
--- /OgreMain/src/OgreOverlayElementCommands.cpp	(revision 5)
+++ /OgreMain/src/OgreOverlayElementCommands.cpp	(revision 5)
@@ -0,0 +1,236 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreOverlayElementCommands.h"
+#include "OgreOverlayElement.h"
+#include "OgreStringConverter.h"
+
+
+namespace Ogre {
+
+    namespace OverlayElementCommands {
+
+        //-----------------------------------------------------------------------
+        String CmdLeft::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const OverlayElement*>(target)->getLeft() );
+        }
+        void CmdLeft::doSet(void* target, const String& val)
+        {
+            static_cast<OverlayElement*>(target)->setLeft(StringConverter::parseReal(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdTop::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const OverlayElement*>(target)->getTop() );
+        }
+        void CmdTop::doSet(void* target, const String& val)
+        {
+            static_cast<OverlayElement*>(target)->setTop(StringConverter::parseReal(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdWidth::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const OverlayElement*>(target)->getWidth() );
+        }
+        void CmdWidth::doSet(void* target, const String& val)
+        {
+            static_cast<OverlayElement*>(target)->setWidth(StringConverter::parseReal(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdHeight::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const OverlayElement*>(target)->getHeight() );
+        }
+        void CmdHeight::doSet(void* target, const String& val)
+        {
+            static_cast<OverlayElement*>(target)->setHeight(StringConverter::parseReal(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdMaterial::doGet(const void* target) const
+        {
+            return static_cast<const OverlayElement*>(target)->getMaterialName();
+        }
+        void CmdMaterial::doSet(void* target, const String& val)
+        {
+			if (val != "")
+			{
+				static_cast<OverlayElement*>(target)->setMaterialName(val);
+			}
+        }
+        //-----------------------------------------------------------------------
+        //-----------------------------------------------------------------------
+        String CmdCaption::doGet(const void* target) const
+        {
+            return static_cast<const OverlayElement*>(target)->getCaption();
+        }
+        void CmdCaption::doSet(void* target, const String& val)
+        {
+            static_cast<OverlayElement*>(target)->setCaption(val);
+        }
+        //-----------------------------------------------------------------------
+        //-----------------------------------------------------------------------
+        //-----------------------------------------------------------------------
+        String CmdMetricsMode::doGet(const void* target) const
+        {
+            GuiMetricsMode gmm = 
+                static_cast<const OverlayElement*>(target)->getMetricsMode();
+
+            switch (gmm)
+            {
+            case GMM_PIXELS :
+                return "pixels";
+
+            case GMM_RELATIVE_ASPECT_ADJUSTED :
+                return "relative_aspect_adjusted";
+
+            default :
+                return "relative";
+            }
+        }
+        void CmdMetricsMode::doSet(void* target, const String& val)
+        {
+            if (val == "pixels")
+            {
+                static_cast<OverlayElement*>(target)->setMetricsMode(GMM_PIXELS);
+            }
+            else if (val == "relative_aspect_adjusted")
+            {
+                static_cast<OverlayElement*>(target)->setMetricsMode(GMM_RELATIVE_ASPECT_ADJUSTED);
+            }
+            else
+            {
+                static_cast<OverlayElement*>(target)->setMetricsMode(GMM_RELATIVE);
+            }
+        }
+        //-----------------------------------------------------------------------
+        //-----------------------------------------------------------------------
+        //-----------------------------------------------------------------------
+        String CmdHorizontalAlign::doGet(const void* target) const
+        {
+            GuiHorizontalAlignment gha = 
+                static_cast<const OverlayElement*>(target)->getHorizontalAlignment();
+            switch(gha)
+            {
+            case GHA_LEFT:
+                return "left";
+            case GHA_RIGHT:
+                return "right";
+            case GHA_CENTER:
+                return "center";
+            }
+            // To keep compiler happy
+            return "center";
+        }
+        void CmdHorizontalAlign::doSet(void* target, const String& val)
+        {
+            if (val == "left")
+            {
+                static_cast<OverlayElement*>(target)->setHorizontalAlignment(GHA_LEFT);
+            }
+            else if (val == "right")
+            {
+                static_cast<OverlayElement*>(target)->setHorizontalAlignment(GHA_RIGHT);
+            }
+            else
+            {
+                static_cast<OverlayElement*>(target)->setHorizontalAlignment(GHA_CENTER);
+            }
+        }
+        //-----------------------------------------------------------------------
+        //-----------------------------------------------------------------------
+        //-----------------------------------------------------------------------
+        String CmdVerticalAlign::doGet(const void* target) const
+        {
+            GuiVerticalAlignment gva = 
+                static_cast<const OverlayElement*>(target)->getVerticalAlignment();
+            switch(gva)
+            {
+            case GVA_TOP:
+                return "top";
+            case GVA_BOTTOM:
+                return "bottom";
+            case GVA_CENTER:
+                return "center";
+            }
+            // To keep compiler happy
+            return "center";
+        }
+        void CmdVerticalAlign::doSet(void* target, const String& val)
+        {
+            if (val == "top")
+            {
+                static_cast<OverlayElement*>(target)->setVerticalAlignment(GVA_TOP);
+            }
+            else if (val == "bottom")
+            {
+                static_cast<OverlayElement*>(target)->setVerticalAlignment(GVA_BOTTOM);
+            }
+            else
+            {
+                static_cast<OverlayElement*>(target)->setVerticalAlignment(GVA_CENTER);
+            }
+        }
+        //-----------------------------------------------------------------------
+        //-----------------------------------------------------------------------
+        //-----------------------------------------------------------------------
+        //-----------------------------------------------------------------------
+        String CmdVisible::doGet(const void* target) const
+        {
+            bool visible = 
+                static_cast<const OverlayElement*>(target)->isVisible();
+            switch(visible)
+            {
+            case true:
+                return "true";
+            case false:
+                return "false";
+            }
+            // To keep compiler happy
+            return "true";
+        }
+        void CmdVisible::doSet(void* target, const String& val)
+        {
+            if (val == "true")
+            {
+                static_cast<OverlayElement*>(target)->show();
+            }
+            else if (val == "false")
+            {
+                static_cast<OverlayElement*>(target)->hide();
+            }
+        }
+        //-----------------------------------------------------------------------
+    }
+}
+
Index: /OgreMain/src/OgreOverlayManager.cpp
===================================================================
--- /OgreMain/src/OgreOverlayManager.cpp	(revision 5)
+++ /OgreMain/src/OgreOverlayManager.cpp	(revision 5)
@@ -0,0 +1,673 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreOverlayManager.h"
+#include "OgreStringVector.h"
+#include "OgreOverlayContainer.h"
+#include "OgreStringConverter.h"
+#include "OgreLogManager.h"
+#include "OgreSceneManagerEnumerator.h"
+#include "OgreSceneManager.h"
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreException.h"
+#include "OgreViewport.h"
+#include "OgreOverlayElementFactory.h"
+
+namespace Ogre {
+
+    //---------------------------------------------------------------------
+    template<> OverlayManager *Singleton<OverlayManager>::ms_Singleton = 0;
+    OverlayManager* OverlayManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    OverlayManager& OverlayManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+    //---------------------------------------------------------------------
+    OverlayManager::OverlayManager() 
+      : mLastViewportWidth(0), 
+        mLastViewportHeight(0), 
+        mViewportDimensionsChanged(false)
+    {
+
+        // Scripting is supported by this manager
+        mScriptPatterns.push_back("*.overlay");
+		ResourceGroupManager::getSingleton()._registerScriptLoader(this);
+
+    }
+    //---------------------------------------------------------------------
+    OverlayManager::~OverlayManager()
+    {
+		destroyAllOverlayElements(false);
+		destroyAllOverlayElements(true);
+        destroyAll();
+
+        // Unregister with resource group manager
+		ResourceGroupManager::getSingleton()._unregisterScriptLoader(this);
+    }
+    //---------------------------------------------------------------------
+    const StringVector& OverlayManager::getScriptPatterns(void) const
+    {
+        return mScriptPatterns;
+    }
+    //---------------------------------------------------------------------
+    Real OverlayManager::getLoadingOrder(void) const
+    {
+        // Load late
+        return 1100.0f;
+    }
+    //---------------------------------------------------------------------
+    Overlay* OverlayManager::create(const String& name)
+    {
+        Overlay* ret = 0;
+        OverlayMap::iterator i = mOverlayMap.find(name);
+
+        if (i == mOverlayMap.end())
+        {
+            ret = new Overlay(name);
+            assert(ret && "Overlay creation failed");
+            mOverlayMap[name] = ret;
+        }
+        else
+        {
+            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, 
+                "Overlay with name '" + name + "' already exists!",
+                "OverlayManager::create");
+        }
+
+        return ret;
+
+    }
+    //---------------------------------------------------------------------
+    Overlay* OverlayManager::getByName(const String& name)
+    {
+        OverlayMap::iterator i = mOverlayMap.find(name);
+        if (i == mOverlayMap.end())
+        {
+            return 0;
+        }
+        else
+        {
+            return i->second;
+        }
+
+    }
+    //---------------------------------------------------------------------
+    void OverlayManager::destroy(const String& name)
+    {
+        OverlayMap::iterator i = mOverlayMap.find(name);
+        if (i == mOverlayMap.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Overlay with name '" + name + "' not found.",
+                "OverlayManager::destroy");
+        }
+        else
+        {
+            delete i->second;
+            mOverlayMap.erase(i);
+        }
+    }
+    //---------------------------------------------------------------------
+    void OverlayManager::destroy(Overlay* overlay)
+    {
+        for (OverlayMap::iterator i = mOverlayMap.begin();
+            i != mOverlayMap.end(); ++i)
+        {
+            if (i->second == overlay)
+            {
+                delete i->second;
+                mOverlayMap.erase(i);
+                return;
+            }
+        }
+
+        OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+            "Overlay not found.",
+            "OverlayManager::destroy");
+    }
+    //---------------------------------------------------------------------
+    void OverlayManager::destroyAll(void)
+    {
+        for (OverlayMap::iterator i = mOverlayMap.begin();
+            i != mOverlayMap.end(); ++i)
+        {
+            delete i->second;
+        }
+        mOverlayMap.clear();
+		mLoadedScripts.clear();
+    }
+    //---------------------------------------------------------------------
+    OverlayManager::OverlayMapIterator OverlayManager::getOverlayIterator(void)
+    {
+        return OverlayMapIterator(mOverlayMap.begin(), mOverlayMap.end());
+    }
+    //---------------------------------------------------------------------
+    void OverlayManager::parseScript(DataStreamPtr& stream, const String& groupName)
+    {
+		// check if we've seen this script before (can happen if included 
+		// multiple times)
+		if (!stream->getName().empty() && 
+			mLoadedScripts.find(stream->getName()) != mLoadedScripts.end())
+		{
+			LogManager::getSingleton().logMessage( 
+				"Skipping loading overlay include: '"
+				+ stream->getName() + " as it is already loaded.");
+			return;
+		}
+	    String line;
+	    Overlay* pOverlay = 0;
+		bool skipLine;
+
+	    while(!stream->eof())
+	    {
+			bool isTemplate = false;
+			skipLine = false;
+		    line = stream->getLine();
+		    // Ignore comments & blanks
+		    if (!(line.length() == 0 || line.substr(0,2) == "//"))
+		    {
+				if (line.substr(0,8) == "#include")
+				{
+                    std::vector<String> params = StringUtil::split(line, "\t\n ()<>");
+                    DataStreamPtr includeStream = 
+                        ResourceGroupManager::getSingleton().openResource(
+                            params[1], groupName);
+					parseScript(includeStream, groupName);
+					continue;
+				}
+			    if (!pOverlay)
+			    {
+				    // No current overlay
+
+					// check to see if there is a template
+					if (line.substr(0,8) == "template")
+					{
+						isTemplate = true;
+
+					}
+					else
+					{
+			
+						// So first valid data should be overlay name
+						pOverlay = create(line);
+						pOverlay->_notifyOrigin(stream->getName());
+						// Skip to and over next {
+						skipToNextOpenBrace(stream);
+						skipLine = true;
+					}
+			    }
+			    if ((pOverlay && !skipLine) || isTemplate)
+			    {
+				    // Already in overlay
+                    std::vector<String> params = StringUtil::split(line, "\t\n ()");
+
+
+				    if (line == "}")
+				    {
+					    // Finished overlay
+					    pOverlay = 0;
+						isTemplate = false;
+				    }
+				    else if (parseChildren(stream,line, pOverlay, isTemplate, NULL))
+						
+				    {
+
+				    }
+				    else
+				    {
+					    // Attribute
+						if (!isTemplate)
+						{
+							parseAttrib(line, pOverlay);
+						}
+				    }
+
+			    }
+
+		    }
+
+
+	    }
+
+		// record as parsed
+		mLoadedScripts.insert(stream->getName());
+
+    }
+    //---------------------------------------------------------------------
+    void OverlayManager::_queueOverlaysForRendering(Camera* cam, 
+        RenderQueue* pQueue, Viewport* vp)
+    {
+        // Flag for update pixel-based GUIElements if viewport has changed dimensions
+        if (mLastViewportWidth != vp->getActualWidth() || 
+            mLastViewportHeight != vp->getActualHeight())
+        {
+            mViewportDimensionsChanged = true;
+            mLastViewportWidth = vp->getActualWidth();
+            mLastViewportHeight = vp->getActualHeight();
+
+        }
+        else
+        {
+            mViewportDimensionsChanged = false;
+        }
+
+        OverlayMap::iterator i, iend;
+        iend = mOverlayMap.end();
+        for (i = mOverlayMap.begin(); i != iend; ++i)
+        {
+            Overlay* o = i->second;
+            o->_findVisibleObjects(cam, pQueue);
+        }
+    }
+    //---------------------------------------------------------------------
+    void OverlayManager::parseNewElement( DataStreamPtr& stream, String& elemType, String& elemName, 
+            bool isContainer, Overlay* pOverlay, bool isTemplate, String templateName, OverlayContainer* container)
+    {
+        String line;
+
+		OverlayElement* newElement = NULL;
+		newElement = 
+				OverlayManager::getSingleton().createOverlayElementFromTemplate(templateName, elemType, elemName, isTemplate);
+
+			// do not add a template to an overlay
+
+		// add new element to parent
+		if (container)
+		{
+			// Attach to container
+			container->addChild(newElement);
+		}
+		// do not add a template to the overlay. For templates overlay = 0
+		else if (pOverlay)	
+		{
+			pOverlay->add2D((OverlayContainer*)newElement);
+		}
+
+        while(!stream->eof())
+        {
+            line = stream->getLine();
+            // Ignore comments & blanks
+            if (!(line.length() == 0 || line.substr(0,2) == "//"))
+            {
+                if (line == "}")
+                {
+                    // Finished element
+                    break;
+                }
+                else
+                {
+                    if (isContainer && parseChildren(stream,line, pOverlay, isTemplate, static_cast<OverlayContainer*>(newElement)))
+                    {
+					    // nested children... don't reparse it
+                    }
+                    else
+                    {
+                        // Attribute
+                        parseElementAttrib(line, pOverlay, newElement);
+                    }
+                }
+            }
+        }
+    }
+
+    //---------------------------------------------------------------------
+    bool OverlayManager::parseChildren( DataStreamPtr& stream, const String& line,
+            Overlay* pOverlay, bool isTemplate, OverlayContainer* parent)
+	{
+		bool ret = false;
+		uint skipParam =0;
+		std::vector<String> params = StringUtil::split(line, "\t\n ()");
+
+		if (isTemplate)
+		{
+			if (params[0] == "template")
+			{
+				skipParam++;		// the first param = 'template' on a new child element
+			}
+		}
+						
+		// top level component cannot be an element, it must be a container unless it is a template
+		if (params[0+skipParam] == "container" || (params[0+skipParam] == "element" && (isTemplate || parent != NULL)) )
+		{
+			String templateName;
+			ret = true;
+			// nested container/element
+			if (params.size() > 3+skipParam)
+			{
+				if (params.size() != 5+skipParam)
+				{
+					LogManager::getSingleton().logMessage( 
+						"Bad element/container line: '"
+						+ line + "' in " + parent->getTypeName()+ " " + parent->getName() +
+						", expecting ':' templateName");
+					skipToNextCloseBrace(stream);
+					// barf 
+					return ret;
+				}
+				if (params[3+skipParam] != ":")
+				{
+					LogManager::getSingleton().logMessage( 
+						"Bad element/container line: '"
+						+ line + "' in " + parent->getTypeName()+ " " + parent->getName() +
+						", expecting ':' for element inheritance");
+					skipToNextCloseBrace(stream);
+					// barf 
+					return ret;
+				}
+
+				templateName = params[4+skipParam];
+			}
+
+			else if (params.size() != 3+skipParam)
+			{
+				LogManager::getSingleton().logMessage( 
+					"Bad element/container line: '"
+						+ line + "' in " + parent->getTypeName()+ " " + parent->getName() +
+					", expecting 'element type(name)'");
+				skipToNextCloseBrace(stream);
+				// barf 
+				return ret;
+			}
+       
+			skipToNextOpenBrace(stream);
+			parseNewElement(stream, params[1+skipParam], params[2+skipParam], true, pOverlay, isTemplate, templateName, (OverlayContainer*)parent);
+
+		}
+
+
+		return ret;
+	}
+
+    //---------------------------------------------------------------------
+    void OverlayManager::parseAttrib( const String& line, Overlay* pOverlay)
+    {
+        // Split params on first space
+        std::vector<String> vecparams = StringUtil::split(line, "\t ", 1);
+
+        // Look up first param (command setting)
+		StringUtil::toLowerCase(vecparams[0]);
+        if (vecparams[0] == "zorder")
+        {
+            pOverlay->setZOrder(StringConverter::parseUnsignedInt(vecparams[1]));
+        }
+        else
+        {
+            LogManager::getSingleton().logMessage("Bad overlay attribute line: '"
+                + line + "' for overlay " + pOverlay->getName());
+        }
+    }
+    //---------------------------------------------------------------------
+    void OverlayManager::parseElementAttrib( const String& line, Overlay* pOverlay, OverlayElement* pElement )
+    {
+        // Split params on first space
+        std::vector<String> vecparams = StringUtil::split(line, "\t ", 1);
+
+        // Look up first param (command setting)
+		StringUtil::toLowerCase(vecparams[0]);
+        if (!pElement->setParameter(vecparams[0], vecparams[1]))
+        {
+            // BAD command. BAD!
+            LogManager::getSingleton().logMessage("Bad element attribute line: '"
+                + line + "' for element " + pElement->getName() + " in overlay " + 
+                (!pOverlay ? StringUtil::BLANK : pOverlay->getName()));
+        }
+    }
+    //-----------------------------------------------------------------------
+    void OverlayManager::skipToNextCloseBrace(DataStreamPtr& stream)
+    {
+        String line;
+        while (!stream->eof() && line != "}")
+        {
+            line = stream->getLine();
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void OverlayManager::skipToNextOpenBrace(DataStreamPtr& stream)
+    {
+        String line;
+        while (!stream->eof() && line != "{")
+        {
+            line = stream->getLine();
+        }
+
+    }
+    //---------------------------------------------------------------------
+    bool OverlayManager::hasViewportChanged(void) const
+    {
+        return mViewportDimensionsChanged;
+    }
+    //---------------------------------------------------------------------
+    int OverlayManager::getViewportHeight(void) const
+    {
+        return mLastViewportHeight;
+    }
+    //---------------------------------------------------------------------
+    int OverlayManager::getViewportWidth(void) const
+    {
+        return mLastViewportWidth;
+    }
+    //---------------------------------------------------------------------
+    Real OverlayManager::getViewportAspectRatio(void) const
+    {
+        return (Real)mLastViewportHeight / (Real)mLastViewportWidth;
+    }
+    //---------------------------------------------------------------------
+	//---------------------------------------------------------------------
+	OverlayManager::ElementMap& OverlayManager::getElementMap(bool isTemplate)
+	{
+		return (isTemplate)?mTemplates:mInstances;
+	}
+
+	//---------------------------------------------------------------------
+	OverlayElement* OverlayManager::createOverlayElementFromTemplate(const String& templateName, const String& typeName, const String& instanceName, bool isTemplate)
+	{
+
+		OverlayElement* newObj  = NULL;
+
+		if (templateName.empty())
+		{
+			newObj = createOverlayElement(typeName, instanceName, isTemplate);
+		}
+		else
+		{
+			// no template 
+			OverlayElement* templateGui = getOverlayElement(templateName, true);
+
+			String typeNameToCreate;
+			if (typeName.empty())
+			{
+				typeNameToCreate = templateGui->getTypeName();
+			}
+			else
+			{
+				typeNameToCreate = typeName;
+			}
+
+			newObj = createOverlayElement(typeNameToCreate, instanceName, isTemplate);
+
+			((OverlayContainer*)newObj)->copyFromTemplate(templateGui);
+		}
+
+		return newObj;
+	}
+
+
+	//---------------------------------------------------------------------
+	OverlayElement* OverlayManager::cloneOverlayElementFromTemplate(const String& templateName, const String& instanceName)
+	{
+		OverlayElement* templateGui = getOverlayElement(templateName, true);
+		return templateGui->clone(instanceName);
+	}
+
+	//---------------------------------------------------------------------
+	OverlayElement* OverlayManager::createOverlayElement(const String& typeName, const String& instanceName, bool isTemplate)
+	{
+		return createOverlayElementImpl(typeName, instanceName, getElementMap(isTemplate));
+	}
+
+	//---------------------------------------------------------------------
+	OverlayElement* OverlayManager::createOverlayElementImpl(const String& typeName, const String& instanceName, ElementMap& elementMap)
+	{
+		// Check not duplicated
+		ElementMap::iterator ii = elementMap.find(instanceName);
+		if (ii != elementMap.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, "OverlayElement with name " + instanceName +
+				" already exists.", "OverlayManager::createOverlayElement" );
+		}
+		OverlayElement* newElem = createOverlayElementFromFactory(typeName, instanceName);
+
+		// Register
+		elementMap.insert(ElementMap::value_type(instanceName, newElem));
+
+		return newElem;
+
+
+	}
+
+	//---------------------------------------------------------------------
+	OverlayElement* OverlayManager::createOverlayElementFromFactory(const String& typeName, const String& instanceName)
+	{
+		// Look up factory
+		FactoryMap::iterator fi = mFactories.find(typeName);
+		if (fi == mFactories.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Cannot locate factory for element type " + typeName,
+				"OverlayManager::createOverlayElement");
+		}
+
+		// create
+		return fi->second->createOverlayElement(instanceName);
+	}
+
+	//---------------------------------------------------------------------
+	OverlayElement* OverlayManager::getOverlayElement(const String& name, bool isTemplate)
+	{
+		return getOverlayElementImpl(name, getElementMap(isTemplate));
+	}
+	//---------------------------------------------------------------------
+	OverlayElement* OverlayManager::getOverlayElementImpl(const String& name, ElementMap& elementMap)
+	{
+		// Locate instance
+		ElementMap::iterator ii = elementMap.find(name);
+		if (ii == elementMap.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "OverlayElement with name " + name +
+				" not found.", "OverlayManager::getOverlayElementImpl" );
+		}
+
+		return ii->second;
+	}
+	//---------------------------------------------------------------------
+	void OverlayManager::destroyOverlayElement(const String& instanceName, bool isTemplate)
+	{
+		destroyOverlayElementImpl(instanceName, getElementMap(isTemplate));
+	}
+
+	//---------------------------------------------------------------------
+	void OverlayManager::destroyOverlayElement(OverlayElement* pInstance, bool isTemplate)
+	{
+		destroyOverlayElementImpl(pInstance->getName(), getElementMap(isTemplate));
+	}
+
+	//---------------------------------------------------------------------
+	void OverlayManager::destroyOverlayElementImpl(const String& instanceName, ElementMap& elementMap)
+	{
+		// Locate instance
+		ElementMap::iterator ii = elementMap.find(instanceName);
+		if (ii == elementMap.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "OverlayElement with name " + instanceName +
+				" not found.", "OverlayManager::destroyOverlayElement" );
+		}
+		// Look up factory
+		const String& typeName = ii->second->getTypeName();
+		FactoryMap::iterator fi = mFactories.find(typeName);
+		if (fi == mFactories.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Cannot locate factory for element type " + typeName,
+				"OverlayManager::destroyOverlayElement");
+		}
+
+		fi->second->destroyOverlayElement(ii->second);
+		elementMap.erase(ii);
+	}
+	//---------------------------------------------------------------------
+	void OverlayManager::destroyAllOverlayElements(bool isTemplate)
+	{
+		destroyAllOverlayElementsImpl(getElementMap(isTemplate));
+	}
+	//---------------------------------------------------------------------
+	void OverlayManager::destroyAllOverlayElementsImpl(ElementMap& elementMap)
+	{
+		ElementMap::iterator i;
+
+		while ((i = elementMap.begin()) != elementMap.end())
+		{
+			OverlayElement* element = i->second;
+
+			// Get factory to delete
+			FactoryMap::iterator fi = mFactories.find(element->getTypeName());
+			if (fi == mFactories.end())
+			{
+				OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Cannot locate factory for element " 
+					+ element->getName(),
+					"OverlayManager::destroyAllOverlayElements");
+			}
+
+			// remove from parent, if any
+			OverlayContainer* parent;
+			if ((parent = element->getParent()) != 0)
+			{
+				parent->_removeChild(element->getName());
+			}
+
+			// children of containers will be auto-removed when container is destroyed.
+			// destroy the element and remove it from the list
+			fi->second->destroyOverlayElement(element);
+			elementMap.erase(i);
+		}
+	}
+	//---------------------------------------------------------------------
+	void OverlayManager::addOverlayElementFactory(OverlayElementFactory* elemFactory)
+	{
+		// Add / replace
+		mFactories[elemFactory->getTypeName()] = elemFactory;
+
+		LogManager::getSingleton().logMessage("OverlayElementFactory for type " + elemFactory->getTypeName()
+			+ " registered.");
+	}
+}
+
Index: /OgreMain/src/OgrePanelOverlayElement.cpp
===================================================================
--- /OgreMain/src/OgrePanelOverlayElement.cpp	(revision 5)
+++ /OgreMain/src/OgrePanelOverlayElement.cpp	(revision 5)
@@ -0,0 +1,428 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright  2000-2005 The OGRE Team
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgrePanelOverlayElement.h"
+#include "OgreMaterial.h"
+#include "OgreTechnique.h"
+#include "OgrePass.h"
+#include "OgreStringConverter.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+
+namespace Ogre {
+    //---------------------------------------------------------------------
+    String PanelOverlayElement::msTypeName = "Panel";
+    PanelOverlayElement::CmdTiling PanelOverlayElement::msCmdTiling;
+    PanelOverlayElement::CmdTransparent PanelOverlayElement::msCmdTransparent;
+    PanelOverlayElement::CmdUVCoords PanelOverlayElement::msCmdUVCoords;
+    //---------------------------------------------------------------------
+    // vertex buffer bindings, set at compile time (we could look these up but no point)
+    #define POSITION_BINDING 0
+    #define TEXCOORD_BINDING 1
+
+    //---------------------------------------------------------------------
+    PanelOverlayElement::PanelOverlayElement(const String& name)
+        : OverlayContainer(name)
+        , mTransparent(false)
+        // Defer creation of texcoord buffer until we know how big it needs to be
+        , mNumTexCoordsInBuffer(0)
+        , mU1(0.0)
+        , mV1(0.0)
+        , mU2(1.0)
+        , mV2(1.0)
+
+    {
+        // Init tiling
+        for (ushort i = 0; i < OGRE_MAX_TEXTURE_COORD_SETS; ++i)
+        {
+            mTileX[i] = 1.0f;
+            mTileY[i] = 1.0f;
+        }
+
+        // No normals or colours
+        if (createParamDictionary("PanelOverlayElement"))
+        {
+            addBaseParameters();
+        }
+
+    }
+    //---------------------------------------------------------------------
+    PanelOverlayElement::~PanelOverlayElement()
+    {
+        delete mRenderOp.vertexData;
+    }
+    //---------------------------------------------------------------------
+    void PanelOverlayElement::initialise(void)
+    {
+		bool init = !mInitialised;
+
+		OverlayContainer::initialise();
+		if (init)
+		{
+			// Setup render op in advance
+			mRenderOp.vertexData = new VertexData();
+			// Vertex declaration: 1 position, add texcoords later depending on #layers
+			// Create as separate buffers so we can lock & discard separately
+			VertexDeclaration* decl = mRenderOp.vertexData->vertexDeclaration;
+			decl->addElement(POSITION_BINDING, 0, VET_FLOAT3, VES_POSITION);
+
+			// Basic vertex data
+			mRenderOp.vertexData->vertexStart = 0;
+			mRenderOp.vertexData->vertexCount = 4;
+
+			// Vertex buffer #1
+			HardwareVertexBufferSharedPtr vbuf =
+				HardwareBufferManager::getSingleton().createVertexBuffer(
+				decl->getVertexSize(POSITION_BINDING), mRenderOp.vertexData->vertexCount,
+				HardwareBuffer::HBU_STATIC_WRITE_ONLY// mostly static except during resizing
+				);
+			// Bind buffer
+			mRenderOp.vertexData->vertexBufferBinding->setBinding(POSITION_BINDING, vbuf);
+
+			// No indexes & issue as a strip
+			mRenderOp.useIndexes = false;
+			mRenderOp.operationType = RenderOperation::OT_TRIANGLE_STRIP;
+
+			mInitialised = true;
+		}
+    }
+    //---------------------------------------------------------------------
+    void PanelOverlayElement::setTiling(Real x, Real y, ushort layer)
+    {
+        assert (layer < OGRE_MAX_TEXTURE_COORD_SETS);
+        assert (x != 0 && y != 0);
+
+        mTileX[layer] = x;
+        mTileY[layer] = y;
+
+        mGeomUVsOutOfDate = true;
+
+    }
+    //---------------------------------------------------------------------
+    Real PanelOverlayElement::getTileX(ushort layer) const
+    {
+        return mTileX[layer];
+    }
+    //---------------------------------------------------------------------
+    Real PanelOverlayElement::getTileY(ushort layer) const
+    {
+        return mTileY[layer];
+    }
+    //---------------------------------------------------------------------
+    void PanelOverlayElement::setTransparent(bool isTransparent)
+    {
+        mTransparent = isTransparent;
+    }
+    //---------------------------------------------------------------------
+    bool PanelOverlayElement::isTransparent(void) const
+    {
+        return mTransparent;
+    }
+    //---------------------------------------------------------------------
+    void PanelOverlayElement::setUV(Real u1, Real v1, Real u2, Real v2)
+    {
+		mU1 = u1;
+		mU2 = u2;
+		mV1 = v1;
+		mV2 = v2;
+		mGeomUVsOutOfDate = true;
+    }
+    void PanelOverlayElement::getUV(Real& u1, Real& v1, Real& u2, Real& v2) const
+    {
+		u1 = mU1;
+		u2 = mU2;
+		v1 = mV1;
+		v2 = mV2;
+    }
+    //---------------------------------------------------------------------
+    const String& PanelOverlayElement::getTypeName(void) const
+    {
+        return msTypeName;
+    }
+    //---------------------------------------------------------------------
+    void PanelOverlayElement::getRenderOperation(RenderOperation& op)
+    {
+        op = mRenderOp;
+    }
+    //---------------------------------------------------------------------
+    void PanelOverlayElement::setMaterialName(const String& matName)
+    {
+        OverlayContainer::setMaterialName(matName);
+    }
+    //---------------------------------------------------------------------
+    void PanelOverlayElement::_updateRenderQueue(RenderQueue* queue)
+    {
+        if (mVisible)
+        {
+
+            if (!mTransparent && !mpMaterial.isNull())
+            {
+                OverlayElement::_updateRenderQueue(queue);
+            }
+
+            // Also add children
+            ChildIterator it = getChildIterator();
+            while (it.hasMoreElements())
+            {
+                // Give children ZOrder 1 higher than this
+                it.getNext()->_updateRenderQueue(queue);
+            }
+        }
+    }
+    //---------------------------------------------------------------------
+    void PanelOverlayElement::updatePositionGeometry(void)
+    {
+		/*
+			0-----2
+			|    /|
+			|  /  |
+			|/    |
+			1-----3
+		*/
+		Real left, right, top, bottom;
+
+		/* Convert positions into -1, 1 coordinate space (homogenous clip space).
+			- Left / right is simple range conversion
+			- Top / bottom also need inverting since y is upside down - this means
+			that top will end up greater than bottom and when computing texture
+			coordinates, we have to flip the v-axis (ie. subtract the value from
+			1.0 to get the actual correct value).
+		*/
+		left = _getDerivedLeft() * 2 - 1;
+		right = left + (mWidth * 2);
+		top = -((_getDerivedTop() * 2) - 1);
+		bottom =  top -  (mHeight * 2);
+
+		HardwareVertexBufferSharedPtr vbuf =
+			mRenderOp.vertexData->vertexBufferBinding->getBuffer(POSITION_BINDING);
+		float* pPos = static_cast<float*>(
+			vbuf->lock(HardwareBuffer::HBL_DISCARD) );
+
+		// Use the furthest away depth value, since materials should have depth-check off
+		// This initialised the depth buffer for any 3D objects in front
+		Real zValue = Root::getSingleton().getRenderSystem()->getMaximumDepthInputValue();
+		*pPos++ = left;
+		*pPos++ = top;
+		*pPos++ = zValue;
+
+		*pPos++ = left;
+		*pPos++ = bottom;
+		*pPos++ = zValue;
+
+		*pPos++ = right;
+		*pPos++ = top;
+		*pPos++ = zValue;
+
+		*pPos++ = right;
+		*pPos++ = bottom;
+		*pPos++ = zValue;
+
+		vbuf->unlock();
+    }
+    //---------------------------------------------------------------------
+    void PanelOverlayElement::updateTextureGeometry(void)
+    {
+        // Generate for as many texture layers as there are in material
+        if (!mpMaterial.isNull() && mInitialised)
+        {
+            // Assume one technique and pass for the moment
+            size_t numLayers = mpMaterial->getTechnique(0)->getPass(0)->getNumTextureUnitStates();
+
+            VertexDeclaration* decl = mRenderOp.vertexData->vertexDeclaration;
+            // Check the number of texcoords we have in our buffer now
+            if (mNumTexCoordsInBuffer > numLayers)
+            {
+                // remove extras
+                for (size_t i = mNumTexCoordsInBuffer; i > numLayers; --i)
+                {
+                    decl->removeElement(VES_TEXTURE_COORDINATES, 
+						static_cast<unsigned short>(i));
+                }
+            }
+            else if (mNumTexCoordsInBuffer < numLayers)
+            {
+                // Add extra texcoord elements
+                size_t offset = VertexElement::getTypeSize(VET_FLOAT2) * mNumTexCoordsInBuffer;
+                for (size_t i = mNumTexCoordsInBuffer; i < numLayers; ++i)
+                {
+                    decl->addElement(TEXCOORD_BINDING,
+                        offset, VET_FLOAT2, VES_TEXTURE_COORDINATES, 
+						static_cast<unsigned short>(i));
+                    offset += VertexElement::getTypeSize(VET_FLOAT2);
+
+                }
+            }
+
+            // if number of layers changed at all, we'll need to reallocate buffer
+            if (mNumTexCoordsInBuffer != numLayers)
+            {
+                // NB reference counting will take care of the old one if it exists
+                HardwareVertexBufferSharedPtr newbuf =
+                    HardwareBufferManager::getSingleton().createVertexBuffer(
+                    decl->getVertexSize(TEXCOORD_BINDING), mRenderOp.vertexData->vertexCount,
+                    HardwareBuffer::HBU_STATIC_WRITE_ONLY // mostly static except during resizing
+                    );
+                // Bind buffer, note this will unbind the old one and destroy the buffer it had
+                mRenderOp.vertexData->vertexBufferBinding->setBinding(TEXCOORD_BINDING, newbuf);
+                // Set num tex coords in use now
+                mNumTexCoordsInBuffer = numLayers;
+            }
+
+            // Get the tcoord buffer & lock
+			if (mNumTexCoordsInBuffer)
+			{
+				HardwareVertexBufferSharedPtr vbuf =
+					mRenderOp.vertexData->vertexBufferBinding->getBuffer(TEXCOORD_BINDING);
+				float* pVBStart = static_cast<float*>(
+					vbuf->lock(HardwareBuffer::HBL_DISCARD) );
+
+				size_t uvSize = VertexElement::getTypeSize(VET_FLOAT2) / sizeof(float);
+				size_t vertexSize = decl->getVertexSize(TEXCOORD_BINDING) / sizeof(float);
+				for (ushort i = 0; i < numLayers; ++i)
+				{
+				    // Calc upper tex coords
+                    Real upperX = mU2 * mTileX[i];
+                    Real upperY = mV2 * mTileY[i];
+
+
+				    /*
+					    0-----2
+					    |    /|
+					    |  /  |
+					    |/    |
+					    1-----3
+				    */
+				    // Find start offset for this set
+				    float* pTex = pVBStart + (i * uvSize);
+
+                    pTex[0] = mU1;
+                    pTex[1] = mV1;
+
+                    pTex += vertexSize; // jump by 1 vertex stride
+                    pTex[0] = mU1;
+                    pTex[1] = upperY;
+
+                    pTex += vertexSize;
+                    pTex[0] = upperX;
+                    pTex[1] = mV1;
+
+                    pTex += vertexSize;
+                    pTex[0] = upperX;
+                    pTex[1] = upperY;
+				}
+				vbuf->unlock();
+			}
+        }
+    }
+    //-----------------------------------------------------------------------
+    void PanelOverlayElement::addBaseParameters(void)
+    {
+        OverlayContainer::addBaseParameters();
+        ParamDictionary* dict = getParamDictionary();
+
+        dict->addParameter(ParameterDef("uv_coords",
+           "The texture coordinates for the texture. 1 set of uv values."
+           , PT_STRING),
+           &msCmdUVCoords);
+
+        dict->addParameter(ParameterDef("tiling",
+            "The number of times to repeat the background texture."
+            , PT_STRING),
+            &msCmdTiling);
+
+        dict->addParameter(ParameterDef("transparent",
+            "Sets whether the panel is transparent, i.e. invisible itself "
+            "but it's contents are still displayed."
+            , PT_BOOL),
+            &msCmdTransparent);
+    }
+    //-----------------------------------------------------------------------
+    // Command objects
+    //-----------------------------------------------------------------------
+    String PanelOverlayElement::CmdTiling::doGet(const void* target) const
+    {
+        // NB only returns 1st layer tiling
+        String ret = "0 " + StringConverter::toString(
+            static_cast<const PanelOverlayElement*>(target)->getTileX() );
+        ret += " " + StringConverter::toString(
+            static_cast<const PanelOverlayElement*>(target)->getTileY() );
+        return ret;
+    }
+    void PanelOverlayElement::CmdTiling::doSet(void* target, const String& val)
+    {
+        // 3 params: <layer> <x_tile> <y_tile>
+        // Param count is validated higher up
+        std::vector<String> vec = StringUtil::split(val);
+        ushort layer = (ushort)StringConverter::parseUnsignedInt(vec[0]);
+        Real x_tile = StringConverter::parseReal(vec[1]);
+        Real y_tile = StringConverter::parseReal(vec[2]);
+
+        static_cast<PanelOverlayElement*>(target)->setTiling(x_tile, y_tile, layer);
+    }
+    //-----------------------------------------------------------------------
+    String PanelOverlayElement::CmdTransparent::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const PanelOverlayElement*>(target)->isTransparent() );
+    }
+    void PanelOverlayElement::CmdTransparent::doSet(void* target, const String& val)
+    {
+        static_cast<PanelOverlayElement*>(target)->setTransparent(
+            StringConverter::parseBool(val));
+    }
+    //-----------------------------------------------------------------------
+    String PanelOverlayElement::CmdUVCoords::doGet(const void* target) const
+    {
+        Real u1, v1, u2, v2;
+
+        static_cast<const PanelOverlayElement*>(target)->getUV(u1, v1, u2, v2);
+        String ret = " " + StringConverter::toString(u1) + " "
+             + StringConverter::toString(v1) + " " + StringConverter::toString(u2) + " "
+             + StringConverter::toString(v2);
+
+        return ret;
+    }
+    void PanelOverlayElement::CmdUVCoords::doSet(void* target, const String& val)
+    {
+        std::vector<String> vec = StringUtil::split(val);
+
+        static_cast<PanelOverlayElement*>(target)->setUV(
+            StringConverter::parseReal(vec[0]),
+            StringConverter::parseReal(vec[1]),
+            StringConverter::parseReal(vec[2]),
+            StringConverter::parseReal(vec[3])
+            );
+    }
+
+}
+
+
+
Index: /OgreMain/src/OgreParticle.cpp
===================================================================
--- /OgreMain/src/OgreParticle.cpp	(revision 5)
+++ /OgreMain/src/OgreParticle.cpp	(revision 5)
@@ -0,0 +1,61 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreParticle.h"
+#include "OgreParticleSystem.h"
+
+namespace Ogre
+{
+	//-----------------------------------------------------------------------
+    void Particle::setRotation(const Radian& rot)
+    {
+        rotation = rot;
+        if (rotation != Radian(0))
+            mParentSystem->_notifyParticleRotated();
+    }
+    //-----------------------------------------------------------------------
+    void Particle::setDimensions(Real width, Real height)
+    {
+        mOwnDimensions = true;
+        mWidth = width;
+        mHeight = height;
+        mParentSystem->_notifyParticleResized();
+    }
+    //-----------------------------------------------------------------------
+    void Particle::_notifyOwner(ParticleSystem* owner)
+    {
+        mParentSystem = owner;
+    }
+    //-----------------------------------------------------------------------
+    void Particle::resetDimensions(void)
+    {
+        mOwnDimensions = false;
+    }
+}
Index: /OgreMain/src/OgreParticleEmitter.cpp
===================================================================
--- /OgreMain/src/OgreParticleEmitter.cpp	(revision 5)
+++ /OgreMain/src/OgreParticleEmitter.cpp	(revision 5)
@@ -0,0 +1,638 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreParticleEmitter.h"
+#include "OgreParticleEmitterFactory.h"
+
+namespace Ogre
+{
+	// Define static members
+    EmitterCommands::CmdAngle ParticleEmitter::msAngleCmd;
+    EmitterCommands::CmdColour ParticleEmitter::msColourCmd;
+    EmitterCommands::CmdColourRangeStart ParticleEmitter::msColourRangeStartCmd;
+    EmitterCommands::CmdColourRangeEnd ParticleEmitter::msColourRangeEndCmd;
+    EmitterCommands::CmdDirection ParticleEmitter::msDirectionCmd;
+    EmitterCommands::CmdEmissionRate ParticleEmitter::msEmissionRateCmd;
+    EmitterCommands::CmdMaxTTL ParticleEmitter::msMaxTTLCmd;
+    EmitterCommands::CmdMaxVelocity ParticleEmitter::msMaxVelocityCmd;
+    EmitterCommands::CmdMinTTL ParticleEmitter::msMinTTLCmd;
+    EmitterCommands::CmdMinVelocity ParticleEmitter::msMinVelocityCmd;
+    EmitterCommands::CmdPosition ParticleEmitter::msPositionCmd;
+    EmitterCommands::CmdTTL ParticleEmitter::msTTLCmd;
+    EmitterCommands::CmdVelocity ParticleEmitter::msVelocityCmd;
+    EmitterCommands::CmdDuration ParticleEmitter::msDurationCmd;
+    EmitterCommands::CmdMinDuration ParticleEmitter::msMinDurationCmd;
+    EmitterCommands::CmdMaxDuration ParticleEmitter::msMaxDurationCmd;
+    EmitterCommands::CmdRepeatDelay ParticleEmitter::msRepeatDelayCmd;
+    EmitterCommands::CmdMinRepeatDelay ParticleEmitter::msMinRepeatDelayCmd;
+    EmitterCommands::CmdMaxRepeatDelay ParticleEmitter::msMaxRepeatDelayCmd;
+    EmitterCommands::CmdName ParticleEmitter::msNameCmd;
+    EmitterCommands::CmdEmittedEmitter ParticleEmitter::msEmittedEmitterCmd;
+
+
+    //-----------------------------------------------------------------------
+    ParticleEmitter::ParticleEmitter(ParticleSystem* psys)
+      : mParent(psys),
+        mStartTime(0),
+        mDurationMin(0),
+        mDurationMax(0),
+        mDurationRemain(0),
+        mRepeatDelayMin(0),
+        mRepeatDelayMax(0),
+        mRepeatDelayRemain(0)
+    {
+
+        // Reasonable defaults
+        mAngle = 0;
+        setDirection(Vector3::UNIT_X);
+        mEmissionRate = 10;
+        mMaxSpeed = mMinSpeed = 1;
+        mMaxTTL = mMinTTL = 5;
+        mPosition = Vector3::ZERO;
+        mColourRangeStart = mColourRangeEnd = ColourValue::White;
+        mEnabled = true;
+        mRemainder = 0;
+		mName = StringUtil::BLANK;
+		mEmittedEmitter = StringUtil::BLANK;
+		mEmitted = false;
+    }
+    //-----------------------------------------------------------------------
+    ParticleEmitter::~ParticleEmitter() 
+    {
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setPosition(const Vector3& pos) 
+    { 
+        mPosition = pos; 
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& ParticleEmitter::getPosition(void) const 
+    { 
+        return mPosition; 
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setDirection(const Vector3& direction) 
+    { 
+        mDirection = direction; 
+        mDirection.normalise();
+        // Generate an up vector (any will do)
+        mUp = mDirection.perpendicular();
+        mUp.normalise();
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& ParticleEmitter::getDirection(void) const
+    { 
+        return mDirection; 
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setAngle(const Radian& angle)
+    {
+        // Store as radians for efficiency
+        mAngle = angle;
+    }
+    //-----------------------------------------------------------------------
+    const Radian& ParticleEmitter::getAngle(void) const
+    {
+        return mAngle;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setParticleVelocity(Real speed)
+    {
+        mMinSpeed = mMaxSpeed = speed;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setParticleVelocity(Real min, Real max)
+    {
+        mMinSpeed = min;
+        mMaxSpeed = max;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setEmissionRate(Real particlesPerSecond) 
+    { 
+        mEmissionRate = particlesPerSecond; 
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleEmitter::getEmissionRate(void) const 
+    { 
+        return mEmissionRate; 
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setTimeToLive(Real ttl)
+    {
+        mMinTTL = mMaxTTL = ttl;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setTimeToLive(Real minTtl, Real maxTtl)
+    {
+        mMinTTL = minTtl;
+        mMaxTTL = maxTtl;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setColour(const ColourValue& colour)
+    {
+        mColourRangeStart = mColourRangeEnd = colour;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setColour(const ColourValue& colourStart, const ColourValue& colourEnd)
+    {
+        mColourRangeStart = colourStart;
+        mColourRangeEnd = colourEnd;
+    }
+	//-----------------------------------------------------------------------
+    const String& ParticleEmitter::getName(void) const
+    {
+        return mName;
+    }
+	//-----------------------------------------------------------------------
+    void ParticleEmitter::setName(const String& newName)
+    {
+		mName = newName;
+    }
+	//-----------------------------------------------------------------------
+    const String& ParticleEmitter::getEmittedEmitter(void) const
+    {
+        return mEmittedEmitter;
+    }
+	//-----------------------------------------------------------------------
+    void ParticleEmitter::setEmittedEmitter(const String& emittedEmitter)
+    {
+        mEmittedEmitter = emittedEmitter;
+    }
+	//-----------------------------------------------------------------------
+	bool ParticleEmitter::isEmitted(void) const
+    {
+		return mEmitted;
+    }
+	//-----------------------------------------------------------------------
+	void ParticleEmitter::setEmitted(bool emitted)
+    {
+        mEmitted = emitted;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::genEmissionDirection(Vector3& destVector)
+    {
+        if (mAngle != Radian(0))
+        {
+            // Randomise angle
+            Radian angle = Math::UnitRandom() * mAngle;
+
+            // Randomise direction
+            destVector = mDirection.randomDeviant(angle, mUp);
+        }
+        else
+        {
+            // Constant angle
+            destVector = mDirection;
+        }
+
+        // Don't normalise, we can assume that it will still be a unit vector since
+        // both direction and 'up' are.
+
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::genEmissionVelocity(Vector3& destVector)
+    {
+        Real scalar;
+        if (mMinSpeed != mMaxSpeed)
+        {
+            scalar = mMinSpeed + (Math::UnitRandom() * (mMaxSpeed - mMinSpeed));
+        }
+        else
+        {
+            scalar = mMinSpeed;
+        }
+
+        destVector *= scalar;
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleEmitter::genEmissionTTL(void)
+    {
+        if (mMaxTTL != mMinTTL)
+        {
+            return mMinTTL + (Math::UnitRandom() * (mMaxTTL - mMinTTL));
+        }
+        else
+        {
+            return mMinTTL;
+        }
+    }
+    //-----------------------------------------------------------------------
+    unsigned short ParticleEmitter::genConstantEmissionCount(Real timeElapsed)
+    {
+        unsigned short intRequest;
+        
+        if (mEnabled)
+        {
+            // Keep fractions, otherwise a high frame rate will result in zero emissions!
+            mRemainder += mEmissionRate * timeElapsed;
+            intRequest = (unsigned short)mRemainder;
+            mRemainder -= intRequest;
+
+            // Check duration
+            if (mDurationMax)
+            {
+                mDurationRemain -= timeElapsed;
+                if (mDurationRemain <= 0) 
+                {
+                    // Disable, duration is out (takes effect next time)
+                    setEnabled(false);
+                }
+            }
+            return intRequest;
+        }
+        else
+        {
+            // Check repeat
+            if (mRepeatDelayMax)
+            {
+                mRepeatDelayRemain -= timeElapsed;
+                if (mRepeatDelayRemain <= 0)
+                {
+                    // Enable, repeat delay is out (takes effect next time)
+                    setEnabled(true);
+                }
+            }
+            if(mStartTime)
+            {
+                mStartTime -= timeElapsed;
+                if(mStartTime <= 0)
+                {
+                    setEnabled(true);
+                    mStartTime = 0;
+                }
+            }
+            return 0;
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::genEmissionColour(ColourValue& destColour)
+    {
+        if (mColourRangeStart != mColourRangeEnd)
+        {
+            // Randomise
+            //Real t = Math::UnitRandom();
+            destColour.r = mColourRangeStart.r + (Math::UnitRandom() * (mColourRangeEnd.r - mColourRangeStart.r));
+            destColour.g = mColourRangeStart.g + (Math::UnitRandom() * (mColourRangeEnd.g - mColourRangeStart.g));
+            destColour.b = mColourRangeStart.b + (Math::UnitRandom() * (mColourRangeEnd.b - mColourRangeStart.b));
+            destColour.a = mColourRangeStart.a + (Math::UnitRandom() * (mColourRangeEnd.a - mColourRangeStart.a));
+        }
+        else
+        {
+            destColour = mColourRangeStart;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::addBaseParameters(void)    
+    {
+        ParamDictionary* dict = getParamDictionary();
+
+        dict->addParameter(ParameterDef("angle", 
+            "The angle up to which particles may vary in their initial direction "
+            "from the emitters direction, in degrees." , PT_REAL),
+            &msAngleCmd);
+
+        dict->addParameter(ParameterDef("colour", 
+            "The colour of emitted particles.", PT_COLOURVALUE),
+            &msColourCmd);
+
+        dict->addParameter(ParameterDef("colour_range_start", 
+            "The start of a range of colours to be assigned to emitted particles.", PT_COLOURVALUE),
+            &msColourRangeStartCmd);
+
+        dict->addParameter(ParameterDef("colour_range_end", 
+            "The end of a range of colours to be assigned to emitted particles.", PT_COLOURVALUE),
+            &msColourRangeEndCmd);
+
+        dict->addParameter(ParameterDef("direction", 
+            "The base direction of the emitter." , PT_VECTOR3),
+            &msDirectionCmd);
+
+        dict->addParameter(ParameterDef("emission_rate", 
+            "The number of particles emitted per second." , PT_REAL),
+            &msEmissionRateCmd);
+
+        dict->addParameter(ParameterDef("position", 
+            "The position of the emitter relative to the particle system center." , PT_VECTOR3),
+            &msPositionCmd);
+
+        dict->addParameter(ParameterDef("velocity", 
+            "The initial velocity to be assigned to every particle, in world units per second." , PT_REAL),
+            &msVelocityCmd);
+
+        dict->addParameter(ParameterDef("velocity_min", 
+            "The minimum initial velocity to be assigned to each particle." , PT_REAL),
+            &msMinVelocityCmd);
+
+        dict->addParameter(ParameterDef("velocity_max", 
+            "The maximum initial velocity to be assigned to each particle." , PT_REAL),
+            &msMaxVelocityCmd);
+
+        dict->addParameter(ParameterDef("time_to_live", 
+            "The lifetime of each particle in seconds." , PT_REAL),
+            &msTTLCmd);
+
+        dict->addParameter(ParameterDef("time_to_live_min", 
+            "The minimum lifetime of each particle in seconds." , PT_REAL),
+            &msMinTTLCmd);
+
+        dict->addParameter(ParameterDef("time_to_live_max", 
+            "The maximum lifetime of each particle in seconds." , PT_REAL),
+            &msMaxTTLCmd);
+
+        dict->addParameter(ParameterDef("duration", 
+            "The length of time in seconds which an emitter stays enabled for." , PT_REAL),
+            &msDurationCmd);
+
+        dict->addParameter(ParameterDef("duration_min", 
+            "The minimum length of time in seconds which an emitter stays enabled for." , PT_REAL),
+            &msMinDurationCmd);
+
+        dict->addParameter(ParameterDef("duration_max", 
+            "The maximum length of time in seconds which an emitter stays enabled for." , PT_REAL),
+            &msMaxDurationCmd);
+
+        dict->addParameter(ParameterDef("repeat_delay", 
+            "If set, after disabling an emitter will repeat (reenable) after this many seconds." , PT_REAL),
+            &msRepeatDelayCmd);
+
+        dict->addParameter(ParameterDef("repeat_delay_min", 
+            "If set, after disabling an emitter will repeat (reenable) after this minimum number of seconds." , PT_REAL),
+            &msMinRepeatDelayCmd);
+
+        dict->addParameter(ParameterDef("repeat_delay_max", 
+            "If set, after disabling an emitter will repeat (reenable) after this maximum number of seconds." , PT_REAL),
+            &msMaxRepeatDelayCmd);
+
+		dict->addParameter(ParameterDef("name", 
+			"This is the name of the emitter" , PT_STRING),
+			&msNameCmd);
+		
+		dict->addParameter(ParameterDef("emit_emitter", 
+			"If set, this emitter will emit other emitters instead of visual particles" , PT_STRING),
+			&msEmittedEmitterCmd);
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleEmitter::getParticleVelocity(void) const
+    {
+        return mMinSpeed;
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleEmitter::getMinParticleVelocity(void) const
+    {
+        return mMinSpeed;
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleEmitter::getMaxParticleVelocity(void) const
+    {
+        return mMaxSpeed;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setMinParticleVelocity(Real min)
+    {
+        mMinSpeed = min;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setMaxParticleVelocity(Real max)
+    {
+        mMaxSpeed = max;
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleEmitter::getTimeToLive(void) const
+    {
+        return mMinTTL;
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleEmitter::getMinTimeToLive(void) const
+    {
+        return mMinTTL;
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleEmitter::getMaxTimeToLive(void) const
+    {
+        return mMaxTTL;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setMinTimeToLive(Real min)
+    {
+        mMinTTL = min;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setMaxTimeToLive(Real max)
+    {
+        mMaxTTL = max;
+    }
+    //-----------------------------------------------------------------------
+    const ColourValue& ParticleEmitter::getColour(void) const
+    {
+        return mColourRangeStart;
+    }
+    //-----------------------------------------------------------------------
+    const ColourValue& ParticleEmitter::getColourRangeStart(void) const
+    {
+        return mColourRangeStart;
+    }
+    //-----------------------------------------------------------------------
+    const ColourValue& ParticleEmitter::getColourRangeEnd(void) const
+    {
+        return mColourRangeEnd;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setColourRangeStart(const ColourValue& val)
+    {
+        mColourRangeStart = val;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setColourRangeEnd(const ColourValue& val )
+    {
+        mColourRangeEnd = val;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setEnabled(bool enabled)
+    {
+        mEnabled = enabled;
+        // Reset duration & repeat
+        initDurationRepeat();
+    }
+    //-----------------------------------------------------------------------
+    bool ParticleEmitter::getEnabled(void) const
+    {
+        return mEnabled;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setStartTime(Real startTime)
+    {
+        setEnabled(false);
+        mStartTime = startTime;
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleEmitter::getStartTime(void) const
+    {
+        return mStartTime;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setDuration(Real duration)
+    {
+        setDuration(duration, duration);
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleEmitter::getDuration(void) const
+    {
+        return mDurationMin;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setDuration(Real min, Real max)
+    {
+        mDurationMin = min;
+        mDurationMax = max;
+        initDurationRepeat();
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setMinDuration(Real min)
+    {
+        mDurationMin = min;
+        initDurationRepeat();
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setMaxDuration(Real max)
+    {
+        mDurationMax = max;
+        initDurationRepeat();
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::initDurationRepeat(void)
+    {
+        if (mEnabled)
+        {
+            if (mDurationMin == mDurationMax)
+            {
+                mDurationRemain = mDurationMin;
+            }
+            else
+            {
+                mDurationRemain = Math::RangeRandom(mDurationMin, mDurationMax);
+            }
+        }
+        else
+        {
+            // Reset repeat
+            if (mRepeatDelayMin == mRepeatDelayMax)
+            {
+                mRepeatDelayRemain = mRepeatDelayMin;
+            }
+            else
+            {
+                mRepeatDelayRemain = Math::RangeRandom(mRepeatDelayMax, mRepeatDelayMin);
+            }
+
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setRepeatDelay(Real delay)
+    {
+        setRepeatDelay(delay, delay);
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleEmitter::getRepeatDelay(void) const
+    {
+        return mRepeatDelayMin;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setRepeatDelay(Real min, Real max)
+    {
+        mRepeatDelayMin = min;
+        mRepeatDelayMax = max;
+        initDurationRepeat();
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setMinRepeatDelay(Real min)
+    {
+        mRepeatDelayMin = min;
+        initDurationRepeat();
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitter::setMaxRepeatDelay(Real max)
+    {
+        mRepeatDelayMax = max;
+        initDurationRepeat();
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleEmitter::getMinDuration(void) const
+    {
+        return mDurationMin;
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleEmitter::getMaxDuration(void) const
+    {
+        return mDurationMax;
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleEmitter::getMinRepeatDelay(void) const
+    {
+        return mRepeatDelayMin;    
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleEmitter::getMaxRepeatDelay(void) const
+    {
+        return mRepeatDelayMax;    
+    }
+
+    //-----------------------------------------------------------------------
+    ParticleEmitterFactory::~ParticleEmitterFactory()
+    {
+        // Destroy all emitters
+        std::vector<ParticleEmitter*>::iterator i;
+        for (i = mEmitters.begin(); i != mEmitters.end(); ++i)
+        {
+            delete (*i);
+        }
+            
+        mEmitters.clear();
+
+    }
+    //-----------------------------------------------------------------------
+    void ParticleEmitterFactory::destroyEmitter(ParticleEmitter* e)        
+    {
+        std::vector<ParticleEmitter*>::iterator i;
+        for (i = mEmitters.begin(); i != mEmitters.end(); ++i)
+        {
+            if ((*i) == e)
+            {
+                mEmitters.erase(i);
+                delete e;
+                break;
+            }
+        }
+    }
+
+    //-----------------------------------------------------------------------
+
+}
+
Index: /OgreMain/src/OgreParticleEmitterCommands.cpp
===================================================================
--- /OgreMain/src/OgreParticleEmitterCommands.cpp	(revision 5)
+++ /OgreMain/src/OgreParticleEmitterCommands.cpp	(revision 5)
@@ -0,0 +1,254 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreParticleEmitterCommands.h"
+#include "OgreParticleEmitter.h"
+#include "OgreStringConverter.h"
+
+
+namespace Ogre {
+
+    namespace EmitterCommands {
+
+        //-----------------------------------------------------------------------
+        String CmdAngle::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getAngle() );
+        }
+        void CmdAngle::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setAngle(StringConverter::parseAngle(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdColour::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getColour() );
+        }
+        void CmdColour::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setColour(StringConverter::parseColourValue(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdColourRangeStart::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getColourRangeStart() );
+        }
+        void CmdColourRangeStart::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setColourRangeStart(StringConverter::parseColourValue(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdColourRangeEnd::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getColourRangeEnd() );
+        }
+        void CmdColourRangeEnd::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setColourRangeEnd(StringConverter::parseColourValue(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdDirection::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getDirection() );
+        }
+        void CmdDirection::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setDirection(StringConverter::parseVector3(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdEmissionRate::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getEmissionRate() );
+        }
+        void CmdEmissionRate::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setEmissionRate(StringConverter::parseReal(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdMaxTTL::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getMaxTimeToLive() );
+        }
+        void CmdMaxTTL::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setMaxTimeToLive(StringConverter::parseReal(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdMinTTL::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getMinTimeToLive() );
+        }
+        void CmdMinTTL::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setMinTimeToLive(StringConverter::parseReal(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdMaxVelocity::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getMaxParticleVelocity() );
+        }
+        void CmdMaxVelocity::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setMaxParticleVelocity(StringConverter::parseReal(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdMinVelocity::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getMinParticleVelocity() );
+        }
+        void CmdMinVelocity::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setMinParticleVelocity(StringConverter::parseReal(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdPosition::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getPosition() );
+        }
+        void CmdPosition::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setPosition(StringConverter::parseVector3(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdTTL::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getTimeToLive() );
+        }
+        void CmdTTL::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setTimeToLive(StringConverter::parseReal(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdVelocity::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getParticleVelocity() );
+        }
+        void CmdVelocity::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setParticleVelocity(StringConverter::parseReal(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdDuration::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getDuration() );
+        }
+        void CmdDuration::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setDuration(StringConverter::parseReal(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdMinDuration::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getMinDuration() );
+        }
+        void CmdMinDuration::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setMinDuration(StringConverter::parseReal(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdMaxDuration::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getMaxDuration() );
+        }
+        void CmdMaxDuration::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setMaxDuration(StringConverter::parseReal(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdRepeatDelay::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getRepeatDelay() );
+        }
+        void CmdRepeatDelay::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setRepeatDelay(StringConverter::parseReal(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdMinRepeatDelay::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getMinRepeatDelay() );
+        }
+        void CmdMinRepeatDelay::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setMinRepeatDelay(StringConverter::parseReal(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdMaxRepeatDelay::doGet(const void* target) const
+        {
+            return StringConverter::toString(
+                static_cast<const ParticleEmitter*>(target)->getMaxRepeatDelay() );
+        }
+        void CmdMaxRepeatDelay::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setMaxRepeatDelay(StringConverter::parseReal(val));
+        }
+        //-----------------------------------------------------------------------
+        String CmdName::doGet(const void* target) const
+        {
+            return 
+                static_cast<const ParticleEmitter*>(target)->getName();
+        }
+        void CmdName::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setName(val);
+        }
+        //-----------------------------------------------------------------------
+        String CmdEmittedEmitter::doGet(const void* target) const
+        {
+            return 
+                static_cast<const ParticleEmitter*>(target)->getEmittedEmitter();
+        }
+        void CmdEmittedEmitter::doSet(void* target, const String& val)
+        {
+            static_cast<ParticleEmitter*>(target)->setEmittedEmitter(val);
+        }
+ 
+
+    
+    }
+}
+
Index: /OgreMain/src/OgreParticleIterator.cpp
===================================================================
--- /OgreMain/src/OgreParticleIterator.cpp	(revision 5)
+++ /OgreMain/src/OgreParticleIterator.cpp	(revision 5)
@@ -0,0 +1,54 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreParticleIterator.h"
+#include "OgreParticle.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    ParticleIterator::ParticleIterator(std::list<Particle*>::iterator start, 
+        std::list<Particle*>::iterator end)
+    {
+        mStart = mPos = start;
+        mEnd = end;
+    }
+    //-----------------------------------------------------------------------
+    bool ParticleIterator::end(void)
+    {
+        return (mPos == mEnd);
+    }
+    //-----------------------------------------------------------------------
+    Particle* ParticleIterator::getNext(void)
+    {
+        return static_cast<Particle*>(*mPos++);
+    }
+
+
+}
Index: /OgreMain/src/OgreParticleSystem.cpp
===================================================================
--- /OgreMain/src/OgreParticleSystem.cpp	(revision 5)
+++ /OgreMain/src/OgreParticleSystem.cpp	(revision 5)
@@ -0,0 +1,1587 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreParticleSystem.h"
+#include "OgreParticleSystemManager.h"
+#include "OgreRenderQueue.h"
+#include "OgreBillboardSet.h"
+#include "OgreParticleEmitter.h"
+#include "OgreParticleAffector.h"
+#include "OgreParticle.h"
+#include "OgreSceneNode.h"
+#include "OgreCamera.h"
+#include "OgreStringConverter.h"
+#include "OgreLogManager.h"
+#include "OgreException.h"
+#include "OgreParticleAffectorFactory.h"
+#include "OgreParticleSystemRenderer.h"
+#include "OgreMaterialManager.h"
+#include "OgreSceneManager.h"
+#include "OgreControllerManager.h"
+#include "OgreRoot.h"
+
+namespace Ogre {
+    // Init statics
+    ParticleSystem::CmdCull ParticleSystem::msCullCmd;
+    ParticleSystem::CmdHeight ParticleSystem::msHeightCmd;
+    ParticleSystem::CmdMaterial ParticleSystem::msMaterialCmd;
+    ParticleSystem::CmdQuota ParticleSystem::msQuotaCmd;
+	ParticleSystem::CmdEmittedEmitterQuota ParticleSystem::msEmittedEmitterQuotaCmd;
+    ParticleSystem::CmdWidth ParticleSystem::msWidthCmd;
+    ParticleSystem::CmdRenderer ParticleSystem::msRendererCmd;
+	ParticleSystem::CmdSorted ParticleSystem::msSortedCmd;
+	ParticleSystem::CmdLocalSpace ParticleSystem::msLocalSpaceCmd;
+	ParticleSystem::CmdIterationInterval ParticleSystem::msIterationIntervalCmd;
+	ParticleSystem::CmdNonvisibleTimeout ParticleSystem::msNonvisibleTimeoutCmd;
+
+    RadixSort<ParticleSystem::ActiveParticleList, Particle*, float> ParticleSystem::mRadixSorter;
+
+    Real ParticleSystem::msDefaultIterationInterval = 0;
+    Real ParticleSystem::msDefaultNonvisibleTimeout = 0;
+
+	//-----------------------------------------------------------------------
+	// Local class for updating based on time
+	class ParticleSystemUpdateValue : public ControllerValue<Real>
+	{
+	protected:
+		ParticleSystem* mTarget;
+	public:
+		ParticleSystemUpdateValue(ParticleSystem* target) : mTarget(target) {}
+
+		Real getValue(void) const { return 0; } // N/A
+
+		void setValue(Real value) { mTarget->_update(value); }
+
+	};
+    //-----------------------------------------------------------------------
+    ParticleSystem::ParticleSystem() 
+      : mAABB(),
+        mBoundingRadius(1.0f),
+        mBoundsAutoUpdate(true),
+        mBoundsUpdateTime(10.0f),
+        mUpdateRemainTime(0),
+        mWorldAABB(),
+        mResourceGroupName(ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME),
+        mIsRendererConfigured(false),
+        mSpeedFactor(1.0f),
+        mIterationInterval(0),
+		mIterationIntervalSet(false),
+        mSorted(false),
+        mLocalSpace(false),
+		mNonvisibleTimeout(0),
+		mNonvisibleTimeoutSet(false),
+		mTimeSinceLastVisible(0),
+		mLastVisibleFrame(0),
+        mTimeController(0),
+		mEmittedEmitterPoolInitialised(false),
+        mRenderer(0),
+        mCullIndividual(false),
+        mPoolSize(0),
+		mEmittedEmitterPoolSize(0)
+	{
+        initParameters();
+
+        // Default to billboard renderer
+        setRenderer("billboard");
+
+    }
+    //-----------------------------------------------------------------------
+    ParticleSystem::ParticleSystem(const String& name, const String& resourceGroup)
+      : MovableObject(name),
+        mAABB(),
+        mBoundingRadius(1.0f),
+        mBoundsAutoUpdate(true),
+        mBoundsUpdateTime(10.0f),
+        mUpdateRemainTime(0),
+        mWorldAABB(),
+        mResourceGroupName(resourceGroup),
+        mIsRendererConfigured(false),
+        mSpeedFactor(1.0f),
+        mIterationInterval(0),
+		mIterationIntervalSet(false),
+        mSorted(false),
+        mLocalSpace(false),
+		mNonvisibleTimeout(0),
+		mNonvisibleTimeoutSet(false),
+		mTimeSinceLastVisible(0),
+		mLastVisibleFrame(Root::getSingleton().getCurrentFrameNumber()),
+        mTimeController(0),
+		mEmittedEmitterPoolInitialised(false),
+        mRenderer(0), 
+		mCullIndividual(false),
+        mPoolSize(0),
+		mEmittedEmitterPoolSize(0)
+    {
+        setDefaultDimensions( 100, 100 );
+        setMaterialName( "BaseWhite" );
+        // Default to 10 particles, expect app to specify (will only be increased, not decreased)
+        setParticleQuota( 10 );
+		setEmittedEmitterQuota( 3 );
+        initParameters();
+
+        // Default to billboard renderer
+        setRenderer("billboard");
+    }
+    //-----------------------------------------------------------------------
+    ParticleSystem::~ParticleSystem()
+    {
+        if (mTimeController)
+        {
+            // Destroy controller
+            ControllerManager::getSingleton().destroyController(mTimeController);
+            mTimeController = 0;
+        }
+
+		// Arrange for the deletion of emitters & affectors
+        removeAllEmitters();
+		removeAllEmittedEmitters();
+        removeAllAffectors();
+
+		// Deallocate all particles
+		destroyVisualParticles(0, mParticlePool.size());
+        // Free pool items
+        ParticlePool::iterator i;
+        for (i = mParticlePool.begin(); i != mParticlePool.end(); ++i)
+        {
+            delete *i;
+        }
+
+        if (mRenderer)
+        {
+            ParticleSystemManager::getSingleton()._destroyRenderer(mRenderer);
+            mRenderer = 0;
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    ParticleEmitter* ParticleSystem::addEmitter(const String& emitterType)
+    {
+        ParticleEmitter* em = 
+            ParticleSystemManager::getSingleton()._createEmitter(emitterType, this);
+        mEmitters.push_back(em);
+        return em;
+    }
+    //-----------------------------------------------------------------------
+    ParticleEmitter* ParticleSystem::getEmitter(unsigned short index) const
+    {
+        assert(index < mEmitters.size() && "Emitter index out of bounds!");
+        return mEmitters[index];
+    }
+    //-----------------------------------------------------------------------
+    unsigned short ParticleSystem::getNumEmitters(void) const
+    {
+        return static_cast< unsigned short >( mEmitters.size() );
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::removeEmitter(unsigned short index)
+    {
+        assert(index < mEmitters.size() && "Emitter index out of bounds!");
+        ParticleEmitterList::iterator ei = mEmitters.begin() + index;
+        ParticleSystemManager::getSingleton()._destroyEmitter(*ei);
+        mEmitters.erase(ei);
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::removeAllEmitters(void)
+    {
+        // DON'T delete directly, we don't know what heap these have been created on
+        ParticleEmitterList::iterator ei;
+        for (ei = mEmitters.begin(); ei != mEmitters.end(); ++ei)
+        {
+            ParticleSystemManager::getSingleton()._destroyEmitter(*ei);
+        }
+        mEmitters.clear();
+    }
+    //-----------------------------------------------------------------------
+    ParticleAffector* ParticleSystem::addAffector(const String& affectorType)
+    {
+        ParticleAffector* af = 
+            ParticleSystemManager::getSingleton()._createAffector(affectorType, this);
+        mAffectors.push_back(af);
+        return af;
+    }
+    //-----------------------------------------------------------------------
+    ParticleAffector* ParticleSystem::getAffector(unsigned short index) const
+    {
+        assert(index < mAffectors.size() && "Affector index out of bounds!");
+        return mAffectors[index];
+    }
+    //-----------------------------------------------------------------------
+    unsigned short ParticleSystem::getNumAffectors(void) const
+    {
+        return static_cast< unsigned short >( mAffectors.size() );
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::removeAffector(unsigned short index)
+    {
+        assert(index < mAffectors.size() && "Affector index out of bounds!");
+        ParticleAffectorList::iterator ai = mAffectors.begin() + index;
+        ParticleSystemManager::getSingleton()._destroyAffector(*ai);
+        mAffectors.erase(ai);
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::removeAllAffectors(void)
+    {
+        // DON'T delete directly, we don't know what heap these have been created on
+        ParticleAffectorList::iterator ai;
+        for (ai = mAffectors.begin(); ai != mAffectors.end(); ++ai)
+        {
+            ParticleSystemManager::getSingleton()._destroyAffector(*ai);
+        }
+        mAffectors.clear();
+    }
+    //-----------------------------------------------------------------------
+    ParticleSystem& ParticleSystem::operator=(const ParticleSystem& rhs)
+    {
+        // Blank this system's emitters & affectors
+        removeAllEmitters();
+		removeAllEmittedEmitters();
+        removeAllAffectors();
+
+        // Copy emitters
+        unsigned int i;
+        for(i = 0; i < rhs.getNumEmitters(); ++i)
+        {
+            ParticleEmitter* rhsEm = rhs.getEmitter(i);
+            ParticleEmitter* newEm = addEmitter(rhsEm->getType());
+            rhsEm->copyParametersTo(newEm);
+        }
+        // Copy affectors
+        for(i = 0; i < rhs.getNumAffectors(); ++i)
+        {
+            ParticleAffector* rhsAf = rhs.getAffector(i);
+            ParticleAffector* newAf = addAffector(rhsAf->getType());
+            rhsAf->copyParametersTo(newAf);
+        }
+        setParticleQuota(rhs.getParticleQuota());
+		setEmittedEmitterQuota(rhs.getEmittedEmitterQuota());
+        setMaterialName(rhs.mMaterialName);
+        setDefaultDimensions(rhs.mDefaultWidth, rhs.mDefaultHeight);
+        mCullIndividual = rhs.mCullIndividual;
+		mSorted = rhs.mSorted;
+		mLocalSpace = rhs.mLocalSpace;
+		mIterationInterval = rhs.mIterationInterval;
+		mIterationIntervalSet = rhs.mIterationIntervalSet;
+		mNonvisibleTimeout = rhs.mNonvisibleTimeout;
+		mNonvisibleTimeoutSet = rhs.mNonvisibleTimeoutSet;
+		// last frame visible and time since last visible should be left default
+
+        setRenderer(rhs.getRendererName());
+        // Copy settings
+        if (mRenderer && rhs.getRenderer())
+        {
+            rhs.getRenderer()->copyParametersTo(mRenderer);
+        }
+
+        return *this;
+
+    }
+    //-----------------------------------------------------------------------
+    size_t ParticleSystem::getNumParticles(void) const
+    {
+        return mActiveParticles.size();
+    }
+    //-----------------------------------------------------------------------
+    size_t ParticleSystem::getParticleQuota(void) const
+    {
+        return mPoolSize;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::setParticleQuota(size_t size)
+    {
+        // Never shrink below size()
+        size_t currSize = mParticlePool.size();
+
+        if( currSize < size )
+        {
+            // Will allocate particles on demand
+            mPoolSize = size;
+            
+        }
+    }
+	//-----------------------------------------------------------------------
+	size_t ParticleSystem::getEmittedEmitterQuota(void) const
+	{
+		return mEmittedEmitterPoolSize;
+	}
+	//-----------------------------------------------------------------------
+	void ParticleSystem::setEmittedEmitterQuota(size_t size)
+	{
+		// Never shrink below size()
+		EmittedEmitterPool::iterator i;
+		size_t currSize = 0;
+		for (i = mEmittedEmitterPool.begin(); i != mEmittedEmitterPool.end(); ++i)
+		{
+			currSize += i->second.size();
+		}
+
+		if( currSize < size )
+		{
+			// Will allocate emitted emitters on demand
+			mEmittedEmitterPoolSize = size;
+		}
+	}
+    //-----------------------------------------------------------------------
+	void ParticleSystem::setNonVisibleUpdateTimeout(Real timeout)
+	{
+		mNonvisibleTimeout = timeout;
+		mNonvisibleTimeoutSet = true;
+	}
+    //-----------------------------------------------------------------------
+	void ParticleSystem::setIterationInterval(Real interval)
+	{
+		mIterationInterval = interval;
+		mIterationIntervalSet = true;
+	}
+    //-----------------------------------------------------------------------
+    void ParticleSystem::_update(Real timeElapsed)
+    {
+        // Only update if attached to a node
+        if (!mParentNode)
+            return;
+
+		Real nonvisibleTimeout = mNonvisibleTimeoutSet ?
+			mNonvisibleTimeout : msDefaultNonvisibleTimeout;
+
+		if (nonvisibleTimeout > 0)
+		{
+			// Check whether it's been more than one frame (update is ahead of
+			// camera notification by one frame because of the ordering)
+			long frameDiff = Root::getSingleton().getCurrentFrameNumber() - mLastVisibleFrame;
+			if (frameDiff > 1 || frameDiff < 0) // < 0 if wrap only
+			{
+				mTimeSinceLastVisible += timeElapsed;
+				if (mTimeSinceLastVisible >= nonvisibleTimeout)
+				{
+					// No update
+					return;
+				}
+			}
+		}
+
+		// Scale incoming speed for the rest of the calculation
+		timeElapsed *= mSpeedFactor;
+
+        // Init renderer if not done already
+        configureRenderer();
+
+		// Initialise emitted emitters list if not done already
+		initialiseEmittedEmitters();
+
+		Real iterationInterval = mIterationIntervalSet ? 
+            mIterationInterval : msDefaultIterationInterval;
+        if (iterationInterval > 0)
+        {
+            mUpdateRemainTime += timeElapsed;
+
+            while (mUpdateRemainTime >= iterationInterval)
+            {
+                // Update existing particles
+                _expire(iterationInterval);
+                _triggerAffectors(iterationInterval);
+                _applyMotion(iterationInterval);
+                // Emit new particles
+                _triggerEmitters(iterationInterval);
+
+                mUpdateRemainTime -= iterationInterval;
+            }
+        }
+        else
+        {
+            // Update existing particles
+            _expire(timeElapsed);
+            _triggerAffectors(timeElapsed);
+            _applyMotion(timeElapsed);
+            // Emit new particles
+            _triggerEmitters(timeElapsed);
+        }
+
+        if (!mBoundsAutoUpdate && mBoundsUpdateTime > 0.0f)
+            mBoundsUpdateTime -= timeElapsed; // count down 
+        _updateBounds();
+
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::_expire(Real timeElapsed)
+    {
+        ActiveParticleList::iterator i, itEnd;
+        Particle* pParticle;
+		ParticleEmitter* pParticleEmitter;
+
+        itEnd = mActiveParticles.end();
+
+        for (i = mActiveParticles.begin(); i != itEnd; )
+        {
+            pParticle = static_cast<Particle*>(*i);
+            if (pParticle->timeToLive < timeElapsed)
+            {
+                // Notify renderer
+                mRenderer->_notifyParticleExpired(pParticle);
+
+				// Identify the particle type
+				if (pParticle->particleType == Particle::Visual)
+				{
+	                // Destroy this one
+		            mFreeParticles.splice(mFreeParticles.end(), mActiveParticles, i++);
+				}
+				else
+				{
+					// For now, it can only be an emitted emitter
+					pParticleEmitter = static_cast<ParticleEmitter*>(*i);
+					std::list<ParticleEmitter*>* fee = findFreeEmittedEmitter(pParticleEmitter->getName());
+					fee->push_back(pParticleEmitter);
+
+					// Also erase from mActiveEmittedEmitters
+					removeFromActiveEmittedEmitters (pParticleEmitter);
+
+					// And erase from mActiveParticles
+					i = mActiveParticles.erase( i );
+				}
+            }
+            else
+            {
+                // Decrement TTL
+                pParticle->timeToLive -= timeElapsed;
+				++i;
+            }
+
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::_triggerEmitters(Real timeElapsed)
+    {
+        // Add up requests for emission
+        static std::vector<unsigned> requested;
+        if( requested.size() != mEmitters.size() )
+            requested.resize( mEmitters.size() );
+
+        size_t totalRequested, emitterCount, i, emissionAllowed;
+        ParticleEmitterList::iterator itEmit, iEmitEnd;
+		ActiveEmittedEmitterList::iterator itActiveEmit;
+        iEmitEnd = mEmitters.end();
+        emitterCount = mEmitters.size();
+        emissionAllowed = mFreeParticles.size();
+        totalRequested = 0;
+
+        // Count up total requested emissions for regular emitters (and exclude the ones that are used as
+		// a template for emitted emitters)
+        for (itEmit = mEmitters.begin(), i = 0; itEmit != iEmitEnd; ++itEmit, ++i)
+        {
+			if (!(*itEmit)->isEmitted())
+			{
+				requested[i] = (*itEmit)->_getEmissionCount(timeElapsed);
+				totalRequested += requested[i];
+			}
+        }
+
+		// Add up total requested emissions for (active) emitted emitters
+		for (itActiveEmit = mActiveEmittedEmitters.begin(); itActiveEmit != mActiveEmittedEmitters.end(); ++itActiveEmit)
+		{
+			totalRequested += (*itActiveEmit)->_getEmissionCount(timeElapsed);
+		}
+
+        // Check if the quota will be exceeded, if so reduce demand
+		Real ratio =  1.0f;
+        if (totalRequested > emissionAllowed)
+        {
+            // Apportion down requested values to allotted values
+            ratio =  (Real)emissionAllowed / (Real)totalRequested;
+            for (i = 0; i < emitterCount; ++i)
+            {
+                requested[i] = static_cast<unsigned>(requested[i] * ratio);
+            }
+        }
+
+        // Emit
+		// For each emission, apply a subset of the motion for the frame
+		// this ensures an even distribution of particles when many are
+		// emitted in a single frame
+        for (itEmit = mEmitters.begin(), i = 0; itEmit != iEmitEnd; ++itEmit, ++i)
+        {
+			// Trigger the emitters, but exclude the emitters that are already in the emitted emitters list; 
+			// they are handled in a separate loop
+			if (!(*itEmit)->isEmitted())
+				_executeTriggerEmitters (*itEmit, static_cast<unsigned>(requested[i]), timeElapsed);
+        }
+
+		// Do the same with all active emitted emitters
+		for (itActiveEmit = mActiveEmittedEmitters.begin(), i = 0; itActiveEmit != mActiveEmittedEmitters.end(); ++itActiveEmit, ++i)
+			_executeTriggerEmitters (*itActiveEmit, static_cast<unsigned>((*itActiveEmit)->_getEmissionCount(timeElapsed) * ratio), timeElapsed);
+	}
+    //-----------------------------------------------------------------------
+    void ParticleSystem::_executeTriggerEmitters(ParticleEmitter* emitter, unsigned requested, Real timeElapsed)
+    {
+		ParticleAffectorList::iterator	itAff, itAffEnd;
+		Real timePoint = 0.0f;
+		Real timeInc = timeElapsed / requested;
+
+		for (unsigned int j = 0; j < requested; ++j)
+		{
+			// Create a new particle & init using emitter
+			// The particle is a visual particle if the emit_emitter property of the emitter isn't set 
+			Particle* p = 0;
+			String	emitterName = emitter->getEmittedEmitter();
+			if (emitterName == StringUtil::BLANK)
+				p = createParticle();
+			else
+				p = createEmitterParticle(emitterName);
+
+			// Only continue if the particle was really created (not null)
+			if (!p)
+				return;
+
+			emitter->_initParticle(p);
+
+			// Translate position & direction into world space
+			if (!mLocalSpace)
+			{
+				p->position  = 
+					(mParentNode->_getDerivedOrientation() *
+					(mParentNode->_getDerivedScale() * p->position))
+					+ mParentNode->_getDerivedPosition();
+				p->direction = 
+					(mParentNode->_getDerivedOrientation() * p->direction);
+			}
+
+			// apply partial frame motion to this particle
+            p->position += (p->direction * timePoint);
+
+			// apply particle initialization by the affectors
+			itAffEnd = mAffectors.end();
+			for (itAff = mAffectors.begin(); itAff != itAffEnd; ++itAff)
+				(*itAff)->_initParticle(p);
+
+			// Increment time fragment
+			timePoint += timeInc;
+
+			if (p->particleType == Particle::Emitter)
+			{
+				// If the particle is an emitter, the position on the emitter side must also be initialised
+				// Note, that position of the emitter becomes a position in worldspace if mLocalSpace is set 
+				// to false (will this become a problem?)
+				ParticleEmitter* pParticleEmitter = static_cast<ParticleEmitter*>(p);
+				pParticleEmitter->setPosition(p->position);
+			}
+
+            // Notify renderer
+            mRenderer->_notifyParticleEmitted(p);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::_applyMotion(Real timeElapsed)
+    {
+        ActiveParticleList::iterator i, itEnd;
+        Particle* pParticle;
+		ParticleEmitter* pParticleEmitter;
+
+        itEnd = mActiveParticles.end();
+        for (i = mActiveParticles.begin(); i != itEnd; ++i)
+        {
+            pParticle = static_cast<Particle*>(*i);
+            pParticle->position += (pParticle->direction * timeElapsed);
+
+			if (pParticle->particleType == Particle::Emitter)
+			{
+				// If it is an emitter, the emitter position must also be updated
+				// Note, that position of the emitter becomes a position in worldspace if mLocalSpace is set 
+				// to false (will this become a problem?)
+				pParticleEmitter = static_cast<ParticleEmitter*>(*i);
+				pParticleEmitter->setPosition(pParticle->position);
+			}
+        }
+
+        // Notify renderer
+        mRenderer->_notifyParticleMoved(mActiveParticles);
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::_triggerAffectors(Real timeElapsed)
+    {
+        ParticleAffectorList::iterator i, itEnd;
+        
+        itEnd = mAffectors.end();
+        for (i = mAffectors.begin(); i != itEnd; ++i)
+        {
+            (*i)->_affectParticles(this, timeElapsed);
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::increasePool(size_t size)
+    {
+        size_t oldSize = mParticlePool.size();
+
+        // Increase size
+        mParticlePool.reserve(size);
+        mParticlePool.resize(size);
+
+        // Create new particles
+        for( size_t i = oldSize; i < size; i++ )
+		{
+            mParticlePool[i] = new Particle();
+		}
+
+		if (mIsRendererConfigured)
+		{
+			createVisualParticles(oldSize, size);
+		}
+
+
+    }
+    //-----------------------------------------------------------------------
+    ParticleIterator ParticleSystem::_getIterator(void)
+    {
+        return ParticleIterator(mActiveParticles.begin(), mActiveParticles.end());
+    }
+    //-----------------------------------------------------------------------
+	Particle* ParticleSystem::getParticle(size_t index) 
+	{
+		assert (index < mActiveParticles.size() && "Index out of bounds!");
+		ActiveParticleList::iterator i = mActiveParticles.begin();
+		std::advance(i, index);
+		return *i;
+	}
+    //-----------------------------------------------------------------------
+    Particle* ParticleSystem::createParticle(void)
+    {
+		Particle* p = 0;
+		if (!mFreeParticles.empty())
+		{
+	        // Fast creation (don't use superclass since emitter will init)
+	        p = mFreeParticles.front();
+	        mActiveParticles.splice(mActiveParticles.end(), mFreeParticles, mFreeParticles.begin());
+
+			p->_notifyOwner(this);
+		}
+
+        return p;
+
+    }
+    //-----------------------------------------------------------------------
+    Particle* ParticleSystem::createEmitterParticle(const String& emitterName)
+    {
+		// Get the appropriate list and retrieve an emitter	
+		Particle* p = 0;
+		std::list<ParticleEmitter*>* fee = findFreeEmittedEmitter(emitterName);
+		if (fee && !fee->empty())
+		{
+	        p = fee->front();
+			p->particleType = Particle::Emitter;
+			fee->pop_front();
+			mActiveParticles.push_back(p);
+
+			// Also add to mActiveEmittedEmitters. This is needed to traverse through all active emitters
+			// that are emitted. Don't use mActiveParticles for that (although they are added to
+			// mActiveParticles also), because it would take too long to traverse.
+			mActiveEmittedEmitters.push_back(static_cast<ParticleEmitter*>(p));
+			
+			p->_notifyOwner(this);
+		}
+
+        return p;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::_updateRenderQueue(RenderQueue* queue)
+    {
+        if (mRenderer)
+        {
+            mRenderer->_updateRenderQueue(queue, mActiveParticles, mCullIndividual);
+        }
+    }
+    void ParticleSystem::initParameters(void)
+    {
+        if (createParamDictionary("ParticleSystem"))
+        {
+            ParamDictionary* dict = getParamDictionary();
+
+            dict->addParameter(ParameterDef("quota", 
+                "The maximum number of particle allowed at once in this system.",
+                PT_UNSIGNED_INT),
+                &msQuotaCmd);
+
+            dict->addParameter(ParameterDef("emit_emitter_quota", 
+                "The maximum number of emitters to be emitted at once in this system.",
+                PT_UNSIGNED_INT),
+				&msEmittedEmitterQuotaCmd);
+
+			dict->addParameter(ParameterDef("material", 
+                "The name of the material to be used to render all particles in this system.",
+                PT_STRING),
+                &msMaterialCmd);
+
+            dict->addParameter(ParameterDef("particle_width", 
+                "The width of particles in world units.",
+                PT_REAL),
+                &msWidthCmd);
+
+            dict->addParameter(ParameterDef("particle_height", 
+                "The height of particles in world units.",
+                PT_REAL),
+                &msHeightCmd);
+
+            dict->addParameter(ParameterDef("cull_each", 
+                "If true, each particle is culled in it's own right. If false, the entire system is culled as a whole.",
+                PT_BOOL),
+                &msCullCmd);
+
+			dict->addParameter(ParameterDef("renderer", 
+				"Sets the particle system renderer to use (default 'billboard').",
+				PT_STRING),
+				&msRendererCmd);
+
+			dict->addParameter(ParameterDef("sorted", 
+				"Sets whether particles should be sorted relative to the camera. ",
+				PT_BOOL),
+				&msSortedCmd);
+
+			dict->addParameter(ParameterDef("local_space", 
+				"Sets whether particles should be kept in local space rather than "
+				"emitted into world space. ",
+				PT_BOOL),
+				&msLocalSpaceCmd);
+
+			dict->addParameter(ParameterDef("iteration_interval", 
+				"Sets a fixed update interval for the system, or 0 for the frame rate. ",
+				PT_REAL),
+				&msIterationIntervalCmd);
+
+			dict->addParameter(ParameterDef("nonvisible_update_timeout", 
+				"Sets a timeout on updates to the system if the system is not visible "
+				"for the given number of seconds (0 to always update)",
+				PT_REAL),
+				&msNonvisibleTimeoutCmd);
+
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::_updateBounds()
+    {
+
+        if (mParentNode && (mBoundsAutoUpdate || mBoundsUpdateTime > 0.0f))
+        {
+            if (mActiveParticles.empty())
+            {
+                // No particles, reset to null if auto update bounds
+                if (mBoundsAutoUpdate)
+                {
+                    mWorldAABB.setNull();
+                }
+            }
+            else
+            {
+                Vector3 min;
+                Vector3 max;
+                if (!mBoundsAutoUpdate && mWorldAABB.isFinite())
+                {
+                    // We're on a limit, grow rather than reset each time
+                    // so that we pick up the worst case scenario
+                    min = mWorldAABB.getMinimum();
+                    max = mWorldAABB.getMaximum();
+                }
+                else
+                {
+                    min.x = min.y = min.z = Math::POS_INFINITY;
+                    max.x = max.y = max.z = Math::NEG_INFINITY;
+                }
+                ActiveParticleList::iterator p;
+                Vector3 halfScale = Vector3::UNIT_SCALE * 0.5;
+                Vector3 defaultPadding = 
+                    halfScale * std::max(mDefaultHeight, mDefaultWidth);
+                for (p = mActiveParticles.begin(); p != mActiveParticles.end(); ++p)
+                {
+                    if ((*p)->mOwnDimensions)
+                    {
+                        Vector3 padding = 
+                            halfScale * std::max((*p)->mWidth, (*p)->mHeight);
+                        min.makeFloor((*p)->position - padding);
+                        max.makeCeil((*p)->position + padding);
+                    }
+                    else
+                    {
+                        min.makeFloor((*p)->position - defaultPadding);
+                        max.makeCeil((*p)->position + defaultPadding);
+                    }
+                }
+                mWorldAABB.setExtents(min, max);
+            }
+
+
+            if (mLocalSpace)
+            {
+                // Merge calculated box with current AABB to preserve any user-set AABB
+                mAABB.merge(mWorldAABB);
+            }
+            else
+            {
+                // We've already put particles in world space to decouple them from the
+                // node transform, so reverse transform back since we're expected to 
+                // provide a local AABB
+                AxisAlignedBox newAABB(mWorldAABB);
+                newAABB.transformAffine(mParentNode->_getFullTransform().inverseAffine());
+
+                // Merge calculated box with current AABB to preserve any user-set AABB
+                mAABB.merge(newAABB);
+            }
+
+            mParentNode->needUpdate();
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::fastForward(Real time, Real interval)
+    {
+        // First make sure all transforms are up to date
+
+        for (Real ftime = 0; ftime < time; ftime += interval)
+        {
+            _update(interval);
+        }
+    }
+    //-----------------------------------------------------------------------
+    const String& ParticleSystem::getMovableType(void) const
+    {
+        return ParticleSystemFactory::FACTORY_TYPE_NAME;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::_notifyParticleResized(void)
+    {
+        if (mRenderer)
+        {
+            mRenderer->_notifyParticleResized();
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::_notifyParticleRotated(void)
+    {
+        if (mRenderer)
+        {
+            mRenderer->_notifyParticleRotated();
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::setDefaultDimensions( Real width, Real height )
+    {
+        mDefaultWidth = width;
+        mDefaultHeight = height;
+        if (mRenderer)
+        {
+            mRenderer->_notifyDefaultDimensions(width, height);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::setDefaultWidth(Real width)
+    {
+        mDefaultWidth = width;
+        if (mRenderer)
+        {
+            mRenderer->_notifyDefaultDimensions(mDefaultWidth, mDefaultHeight);
+        }
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleSystem::getDefaultWidth(void) const
+    {
+        return mDefaultWidth;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::setDefaultHeight(Real height)
+    {
+        mDefaultHeight = height;
+        if (mRenderer)
+        {
+            mRenderer->_notifyDefaultDimensions(mDefaultWidth, mDefaultHeight);
+        }
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleSystem::getDefaultHeight(void) const
+    {
+        return mDefaultHeight;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::_notifyCurrentCamera(Camera* cam)
+    {
+		MovableObject::_notifyCurrentCamera(cam);
+
+		// Record visible
+		mLastVisibleFrame = Root::getSingleton().getCurrentFrameNumber();
+		mTimeSinceLastVisible = 0.0f;
+
+        if (mSorted)
+		{
+			_sortParticles(cam);
+		}
+
+		if (mRenderer)
+        {
+			if (!mIsRendererConfigured)
+				configureRenderer();
+
+            mRenderer->_notifyCurrentCamera(cam);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::_notifyAttached(Node* parent, bool isTagPoint)
+    {
+        MovableObject::_notifyAttached(parent, isTagPoint);
+        if (mRenderer && mIsRendererConfigured)
+        {
+            mRenderer->_notifyAttached(parent, isTagPoint);
+        }
+
+        if (parent && !mTimeController)
+        {
+            // Assume visible
+            mTimeSinceLastVisible = 0;
+            mLastVisibleFrame = Root::getSingleton().getCurrentFrameNumber();
+
+            // Create time controller when attached
+            ControllerManager& mgr = ControllerManager::getSingleton(); 
+            ControllerValueRealPtr updValue(new ParticleSystemUpdateValue(this));
+            mTimeController = mgr.createFrameTimePassthroughController(updValue);
+        }
+        else if (!parent && mTimeController)
+        {
+            // Destroy controller
+            ControllerManager::getSingleton().destroyController(mTimeController);
+            mTimeController = 0;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::setMaterialName(const String& name)
+    {
+        mMaterialName = name;
+        if (mIsRendererConfigured)
+        {
+            MaterialPtr mat = MaterialManager::getSingleton().load(
+                mMaterialName, mResourceGroupName);
+            mRenderer->_setMaterial(mat);
+        }
+    }
+    //-----------------------------------------------------------------------
+    const String& ParticleSystem::getMaterialName(void) const
+    {
+        return mMaterialName;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::clear()
+    {
+        // Notify renderer if exists
+        if (mRenderer)
+        {
+            mRenderer->_notifyParticleCleared(mActiveParticles);
+        }
+
+        // Move actives to free list
+        mFreeParticles.splice(mFreeParticles.end(), mActiveParticles);
+
+        // Add active emitted emitters to free list
+		addActiveEmittedEmittersToFreeList();
+
+		// Remove all active emitted emitter instances
+		mActiveEmittedEmitters.clear();
+
+		// Reset update remain time
+        mUpdateRemainTime = 0;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::setRenderer(const String& rendererName)
+    {
+		if (mRenderer)
+		{
+			// Destroy existing
+			destroyVisualParticles(0, mParticlePool.size());
+			ParticleSystemManager::getSingleton()._destroyRenderer(mRenderer);
+			mRenderer = 0;
+		}
+
+        if (!rendererName.empty())
+        {
+			mRenderer = ParticleSystemManager::getSingleton()._createRenderer(rendererName);
+            mIsRendererConfigured = false;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::configureRenderer(void)
+    {
+        // Actual allocate particles
+        size_t currSize = mParticlePool.size();
+        size_t size = mPoolSize;
+        if( currSize < size )
+        {
+            this->increasePool(size);
+
+            for( size_t i = currSize; i < size; ++i )
+            {
+                // Add new items to the queue
+                mFreeParticles.push_back( mParticlePool[i] );
+            }
+
+            // Tell the renderer, if already configured
+            if (mRenderer && mIsRendererConfigured)
+            {
+                mRenderer->_notifyParticleQuota(size);
+            }
+        }
+
+        if (mRenderer && !mIsRendererConfigured)
+        {
+            mRenderer->_notifyParticleQuota(mParticlePool.size());
+            mRenderer->_notifyAttached(mParentNode, mParentIsTagPoint);
+            mRenderer->_notifyDefaultDimensions(mDefaultWidth, mDefaultHeight);
+            createVisualParticles(0, mParticlePool.size());
+            MaterialPtr mat = MaterialManager::getSingleton().load(
+                mMaterialName, mResourceGroupName);
+            mRenderer->_setMaterial(mat);
+			if (mRenderQueueIDSet)
+				mRenderer->setRenderQueueGroup(mRenderQueueID);
+			mRenderer->setKeepParticlesInLocalSpace(mLocalSpace);
+            mIsRendererConfigured = true;
+        }
+    }
+    //-----------------------------------------------------------------------
+    ParticleSystemRenderer* ParticleSystem::getRenderer(void) const
+    {
+        return mRenderer;
+    }
+    //-----------------------------------------------------------------------
+    const String& ParticleSystem::getRendererName(void) const
+    {
+        if (mRenderer)
+        {
+            return mRenderer->getType();
+        }
+        else
+        {
+            return StringUtil::BLANK;
+        }
+    }
+    //-----------------------------------------------------------------------
+    bool ParticleSystem::getCullIndividually(void) const
+    {
+        return mCullIndividual;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::setCullIndividually(bool cullIndividual)
+    {
+        mCullIndividual = cullIndividual;
+    }
+    //-----------------------------------------------------------------------
+	void ParticleSystem::createVisualParticles(size_t poolstart, size_t poolend)
+	{
+		ParticlePool::iterator i = mParticlePool.begin();
+		ParticlePool::iterator iend = mParticlePool.begin();
+		std::advance(i, poolstart);
+		std::advance(iend, poolend);
+		for (; i != iend; ++i)
+		{
+			(*i)->_notifyVisualData(
+				mRenderer->_createVisualData());
+		}
+	}
+    //-----------------------------------------------------------------------
+	void ParticleSystem::destroyVisualParticles(size_t poolstart, size_t poolend)
+	{
+		ParticlePool::iterator i = mParticlePool.begin();
+		ParticlePool::iterator iend = mParticlePool.begin();
+		std::advance(i, poolstart);
+		std::advance(iend, poolend);
+		for (; i != iend; ++i)
+		{
+			mRenderer->_destroyVisualData((*i)->getVisualData());
+			(*i)->_notifyVisualData(0);
+		}
+	}
+    //-----------------------------------------------------------------------
+    void ParticleSystem::setBounds(const AxisAlignedBox& aabb)
+    {
+        mAABB = aabb;
+        Real sqDist = std::max(mAABB.getMinimum().squaredLength(), 
+            mAABB.getMaximum().squaredLength());
+        mBoundingRadius = Math::Sqrt(sqDist);
+
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystem::setBoundsAutoUpdated(bool autoUpdate, Real stopIn)
+    {
+        mBoundsAutoUpdate = autoUpdate;
+        mBoundsUpdateTime = stopIn;
+    }
+	//-----------------------------------------------------------------------
+	void ParticleSystem::setRenderQueueGroup(uint8 queueID)
+	{
+		MovableObject::setRenderQueueGroup(queueID);
+		if (mRenderer)
+		{
+			mRenderer->setRenderQueueGroup(queueID);
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ParticleSystem::setKeepParticlesInLocalSpace(bool keepLocal)
+	{
+		mLocalSpace = keepLocal;
+		if (mRenderer)
+		{
+			mRenderer->setKeepParticlesInLocalSpace(keepLocal);
+		}
+	}
+    //-----------------------------------------------------------------------
+    void ParticleSystem::_sortParticles(Camera* cam)
+    {
+        if (mRenderer)
+        {
+            SortMode sortMode = mRenderer->_getSortMode();
+            if (sortMode == SM_DIRECTION)
+            {
+                Vector3 camDir = cam->getDerivedDirection();
+                if (mLocalSpace)
+                {
+                    // transform the camera direction into local space
+                    camDir = mParentNode->_getDerivedOrientation().UnitInverse() * camDir;
+                }
+                mRadixSorter.sort(mActiveParticles, SortByDirectionFunctor(- camDir));
+            }
+            else if (sortMode == SM_DISTANCE)
+            {
+                Vector3 camPos = cam->getDerivedPosition();
+                if (mLocalSpace)
+                {
+                    // transform the camera position into local space
+                    camPos = mParentNode->_getDerivedOrientation().UnitInverse() *
+                        (camPos - mParentNode->_getDerivedPosition()) / mParentNode->_getDerivedScale();
+                }
+                mRadixSorter.sort(mActiveParticles, SortByDistanceFunctor(camPos));
+            }
+        }
+    }
+    ParticleSystem::SortByDirectionFunctor::SortByDirectionFunctor(const Vector3& dir)
+        : sortDir(dir)
+    {
+    }
+    float ParticleSystem::SortByDirectionFunctor::operator()(Particle* p) const
+    {
+        return sortDir.dotProduct(p->position);
+    }
+    ParticleSystem::SortByDistanceFunctor::SortByDistanceFunctor(const Vector3& pos)
+        : sortPos(pos)
+    {
+    }
+    float ParticleSystem::SortByDistanceFunctor::operator()(Particle* p) const
+    {
+        // Sort descending by squared distance
+        return - (sortPos - p->position).squaredLength();
+    }
+	//-----------------------------------------------------------------------
+	uint32 ParticleSystem::getTypeFlags(void) const
+	{
+		return SceneManager::FX_TYPE_MASK;
+	}
+	//-----------------------------------------------------------------------
+    void ParticleSystem::initialiseEmittedEmitters(void)
+    {
+		// Initialise the pool if needed
+		size_t currSize = 0;
+		if (mEmittedEmitterPool.empty())
+		{
+			if (mEmittedEmitterPoolInitialised)
+			{
+				// It was already initialised, but apparently no emitted emitters were used
+				return;
+			}
+			else
+			{
+				initialiseEmittedEmitterPool();
+			}
+		}
+		else
+		{
+			EmittedEmitterPool::iterator i;
+			for (i = mEmittedEmitterPool.begin(); i != mEmittedEmitterPool.end(); ++i)
+			{
+				currSize += i->second.size();
+			}
+		}
+
+        size_t size = mEmittedEmitterPoolSize;
+        if( currSize < size && !mEmittedEmitterPool.empty())
+        {
+			// Increase the pool. Equally distribute over all vectors in the map
+            increaseEmittedEmitterPool(size);
+			
+			// Add new items to the free list
+			addFreeEmittedEmitters();
+		}
+    }
+
+	//-----------------------------------------------------------------------
+	void ParticleSystem::initialiseEmittedEmitterPool(void)
+	{
+		if (mEmittedEmitterPoolInitialised)
+			return;
+
+		// Run through mEmitters and add keys to the pool
+		ParticleEmitterList::iterator emitterIterator;
+		ParticleEmitterList::iterator emitterIteratorInner;
+		ParticleEmitter* emitter = 0;
+		ParticleEmitter* emitterInner = 0;
+		for (emitterIterator = mEmitters.begin(); emitterIterator != mEmitters.end(); ++emitterIterator)
+		{
+			// Determine the names of all emitters that are emitted
+			emitter = *emitterIterator ;
+			if (emitter && emitter->getEmittedEmitter() != StringUtil::BLANK)
+			{
+				// This one will be emitted, register its name and leave the vector empty!
+				EmittedEmitterList empty;
+				mEmittedEmitterPool.insert(make_pair(emitter->getEmittedEmitter(), empty));
+			}
+
+			// Determine whether the emitter itself will be emitted and set the 'mEmitted' attribute
+			for (emitterIteratorInner = mEmitters.begin(); emitterIteratorInner != mEmitters.end(); ++emitterIteratorInner)
+			{
+				emitterInner = *emitterIteratorInner;
+				if (emitter && 
+					emitterInner && 
+					emitter->getName() != StringUtil::BLANK && 
+					emitter->getName() == emitterInner->getEmittedEmitter())
+				{
+					emitter->setEmitted(true);
+					break;
+				}
+				else
+				{
+					// Set explicitly to 'false' although the default value is already 'false'
+					emitter->setEmitted(false);
+				}
+			}
+		}
+
+		mEmittedEmitterPoolInitialised = true;
+	}
+    //-----------------------------------------------------------------------
+    void ParticleSystem::increaseEmittedEmitterPool(size_t size)
+    {
+		// Don't proceed if the pool doesn't contain any keys of emitted emitters
+		if (mEmittedEmitterPool.empty())
+			return;
+
+		EmittedEmitterPool::iterator emittedEmitterPoolIterator;
+		ParticleEmitterList::iterator emitterIterator;
+		ParticleEmitter* emitter = 0;
+		ParticleEmitter* clonedEmitter = 0;
+		String name = StringUtil::BLANK;
+		EmittedEmitterList* e = 0;
+		size_t maxNumberOfEmitters = size / mEmittedEmitterPool.size(); // equally distribute the number for each emitted emitter list
+		size_t oldSize = 0;
+	
+		// Run through mEmittedEmitterPool and search for every key (=name) its corresponding emitter in mEmitters
+		for (emittedEmitterPoolIterator = mEmittedEmitterPool.begin(); emittedEmitterPoolIterator != mEmittedEmitterPool.end(); ++emittedEmitterPoolIterator)
+        {
+			name = emittedEmitterPoolIterator->first;
+			e = &emittedEmitterPoolIterator->second;
+
+			// Search the correct emitter in the mEmitters vector
+			emitter = 0;
+			for (emitterIterator = mEmitters.begin(); emitterIterator != mEmitters.end(); ++emitterIterator)
+			{
+				emitter = *emitterIterator;
+				if (emitter && 
+					name != StringUtil::BLANK && 
+					name == emitter->getName())
+				{		
+					// Found the right emitter, clone each emitter a number of times
+					oldSize = e->size();
+					for (size_t t = oldSize; t < maxNumberOfEmitters; ++t)
+					{
+						clonedEmitter = ParticleSystemManager::getSingleton()._createEmitter(emitter->getType(), this);
+						emitter->copyParametersTo(clonedEmitter);
+						clonedEmitter->setEmitted(emitter->isEmitted()); // is always 'true' by the way, but just in case
+
+						// Initially deactivate the emitted emitter if duration/repeat_delay are set
+						if (clonedEmitter->getDuration() > 0.0f && 
+							(clonedEmitter->getRepeatDelay() > 0.0f || clonedEmitter->getMinRepeatDelay() > 0.0f || clonedEmitter->getMinRepeatDelay() > 0.0f))
+							clonedEmitter->setEnabled(false);
+
+						// Add cloned emitters to the pool
+						e->push_back(clonedEmitter);
+					}
+				}
+			}
+        }
+	}
+    //-----------------------------------------------------------------------
+    void ParticleSystem::addFreeEmittedEmitters(void)
+    {
+		// Don't proceed if the EmittedEmitterPool is empty
+		if (mEmittedEmitterPool.empty())
+			return;
+
+		// Copy all pooled emitters to the free list
+		EmittedEmitterPool::iterator emittedEmitterPoolIterator;
+		EmittedEmitterList::iterator emittedEmitterIterator;
+		EmittedEmitterList* emittedEmitters = 0;
+		std::list<ParticleEmitter*>* fee = 0;
+		String name = StringUtil::BLANK;
+
+		// Run through the emittedEmitterPool map
+		for (emittedEmitterPoolIterator = mEmittedEmitterPool.begin(); emittedEmitterPoolIterator != mEmittedEmitterPool.end(); ++emittedEmitterPoolIterator)
+        {
+			name = emittedEmitterPoolIterator->first;
+			emittedEmitters = &emittedEmitterPoolIterator->second;
+			fee = findFreeEmittedEmitter(name);
+
+			// If it´s not in the map, create an empty one
+			if (!fee)
+			{
+				FreeEmittedEmitterList empty;
+				mFreeEmittedEmitters.insert(make_pair(name, empty));
+				fee = findFreeEmittedEmitter(name);
+			}
+
+			// Check anyway if it´s ok now
+			if (!fee)
+				return; // forget it!
+
+			// Add all emitted emitters from the pool to the free list
+			for(emittedEmitterIterator = emittedEmitters->begin(); emittedEmitterIterator != emittedEmitters->end(); ++emittedEmitterIterator)
+			{
+				fee->push_back(*emittedEmitterIterator);
+			}
+		}
+	}
+    //-----------------------------------------------------------------------
+    void ParticleSystem::removeAllEmittedEmitters(void)
+    {
+		EmittedEmitterPool::iterator emittedEmitterPoolIterator;
+		EmittedEmitterList::iterator emittedEmitterListIterator;
+		EmittedEmitterList* e = 0;
+        for (emittedEmitterPoolIterator = mEmittedEmitterPool.begin(); emittedEmitterPoolIterator != mEmittedEmitterPool.end(); ++emittedEmitterPoolIterator)
+        {
+			e = &emittedEmitterPoolIterator->second;
+			for (emittedEmitterListIterator = e->begin(); emittedEmitterListIterator != e->end(); ++emittedEmitterListIterator)
+			{
+				ParticleSystemManager::getSingleton()._destroyEmitter(*emittedEmitterListIterator);
+			}
+			e->clear();
+        }
+
+		// Don´t leave any references behind
+		mEmittedEmitterPool.clear();
+		mFreeEmittedEmitters.clear();
+		mActiveEmittedEmitters.clear();
+    }
+	//-----------------------------------------------------------------------
+	std::list<ParticleEmitter*>* ParticleSystem::findFreeEmittedEmitter (const String& name)
+	{
+		FreeEmittedEmitterMap::iterator it;
+		it = mFreeEmittedEmitters.find (name);
+		if (it != mFreeEmittedEmitters.end())
+		{
+			// Found it
+			return &it->second;
+		}
+
+		return 0;
+	}
+	//-----------------------------------------------------------------------
+	void ParticleSystem::removeFromActiveEmittedEmitters (ParticleEmitter* emitter)
+	{
+		assert(emitter && "Emitter to be removed is 0!");
+		ActiveEmittedEmitterList::iterator itActiveEmit;
+		for (itActiveEmit = mActiveEmittedEmitters.begin(); itActiveEmit != mActiveEmittedEmitters.end(); ++itActiveEmit)
+		{
+			if (emitter == (*itActiveEmit))
+			{
+				mActiveEmittedEmitters.erase(itActiveEmit);
+				break;
+			}
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ParticleSystem::addActiveEmittedEmittersToFreeList (void)
+	{
+		ActiveEmittedEmitterList::iterator itActiveEmit;
+		for (itActiveEmit = mActiveEmittedEmitters.begin(); itActiveEmit != mActiveEmittedEmitters.end(); ++itActiveEmit)
+		{
+			std::list<ParticleEmitter*>* fee = findFreeEmittedEmitter ((*itActiveEmit)->getName());
+			if (fee)
+				fee->push_back(*itActiveEmit);
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ParticleSystem::_notifyReorganiseEmittedEmitterData (void)
+	{
+		removeAllEmittedEmitters();
+		mEmittedEmitterPoolInitialised = false; // Don´t rearrange immediately; it will be performed in the regular flow
+	}
+    //-----------------------------------------------------------------------
+    String ParticleSystem::CmdCull::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ParticleSystem*>(target)->getCullIndividually() );
+    }
+    void ParticleSystem::CmdCull::doSet(void* target, const String& val)
+    {
+        static_cast<ParticleSystem*>(target)->setCullIndividually(
+            StringConverter::parseBool(val));
+    }
+    //-----------------------------------------------------------------------
+    String ParticleSystem::CmdHeight::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ParticleSystem*>(target)->getDefaultHeight() );
+    }
+    void ParticleSystem::CmdHeight::doSet(void* target, const String& val)
+    {
+        static_cast<ParticleSystem*>(target)->setDefaultHeight(
+            StringConverter::parseReal(val));
+    }
+    //-----------------------------------------------------------------------
+    String ParticleSystem::CmdWidth::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ParticleSystem*>(target)->getDefaultWidth() );
+    }
+    void ParticleSystem::CmdWidth::doSet(void* target, const String& val)
+    {
+        static_cast<ParticleSystem*>(target)->setDefaultWidth(
+            StringConverter::parseReal(val));
+    }
+    //-----------------------------------------------------------------------
+    String ParticleSystem::CmdMaterial::doGet(const void* target) const
+    {
+        return static_cast<const ParticleSystem*>(target)->getMaterialName();
+    }
+    void ParticleSystem::CmdMaterial::doSet(void* target, const String& val)
+    {
+        static_cast<ParticleSystem*>(target)->setMaterialName(val);
+    }
+    //-----------------------------------------------------------------------
+    String ParticleSystem::CmdQuota::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ParticleSystem*>(target)->getParticleQuota() );
+    }
+    void ParticleSystem::CmdQuota::doSet(void* target, const String& val)
+    {
+        static_cast<ParticleSystem*>(target)->setParticleQuota(
+            StringConverter::parseUnsignedInt(val));
+    }
+    //-----------------------------------------------------------------------
+    String ParticleSystem::CmdEmittedEmitterQuota::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ParticleSystem*>(target)->getEmittedEmitterQuota() );
+    }
+    void ParticleSystem::CmdEmittedEmitterQuota::doSet(void* target, const String& val)
+    {
+        static_cast<ParticleSystem*>(target)->setEmittedEmitterQuota(
+            StringConverter::parseUnsignedInt(val));
+    }
+    //-----------------------------------------------------------------------
+    String ParticleSystem::CmdRenderer::doGet(const void* target) const
+    {
+        return static_cast<const ParticleSystem*>(target)->getRendererName();
+    }
+    void ParticleSystem::CmdRenderer::doSet(void* target, const String& val)
+    {
+        static_cast<ParticleSystem*>(target)->setRenderer(val);
+    }
+	//-----------------------------------------------------------------------
+	String ParticleSystem::CmdSorted::doGet(const void* target) const
+	{
+		return StringConverter::toString(
+			static_cast<const ParticleSystem*>(target)->getSortingEnabled());
+	}
+	void ParticleSystem::CmdSorted::doSet(void* target, const String& val)
+	{
+		static_cast<ParticleSystem*>(target)->setSortingEnabled(
+			StringConverter::parseBool(val));
+	}
+	//-----------------------------------------------------------------------
+	String ParticleSystem::CmdLocalSpace::doGet(const void* target) const
+	{
+		return StringConverter::toString(
+			static_cast<const ParticleSystem*>(target)->getKeepParticlesInLocalSpace());
+	}
+	void ParticleSystem::CmdLocalSpace::doSet(void* target, const String& val)
+	{
+		static_cast<ParticleSystem*>(target)->setKeepParticlesInLocalSpace(
+			StringConverter::parseBool(val));
+	}
+	//-----------------------------------------------------------------------
+	String ParticleSystem::CmdIterationInterval::doGet(const void* target) const
+	{
+		return StringConverter::toString(
+			static_cast<const ParticleSystem*>(target)->getIterationInterval());
+	}
+	void ParticleSystem::CmdIterationInterval::doSet(void* target, const String& val)
+	{
+		static_cast<ParticleSystem*>(target)->setIterationInterval(
+			StringConverter::parseReal(val));
+	}
+	//-----------------------------------------------------------------------
+	String ParticleSystem::CmdNonvisibleTimeout::doGet(const void* target) const
+	{
+		return StringConverter::toString(
+			static_cast<const ParticleSystem*>(target)->getNonVisibleUpdateTimeout());
+	}
+	void ParticleSystem::CmdNonvisibleTimeout::doSet(void* target, const String& val)
+	{
+		static_cast<ParticleSystem*>(target)->setNonVisibleUpdateTimeout(
+			StringConverter::parseReal(val));
+	}
+   //-----------------------------------------------------------------------
+    ParticleAffector::~ParticleAffector() 
+    {
+    }
+    //-----------------------------------------------------------------------
+    ParticleAffectorFactory::~ParticleAffectorFactory() 
+    {
+        // Destroy all affectors
+        std::vector<ParticleAffector*>::iterator i;
+        for (i = mAffectors.begin(); i != mAffectors.end(); ++i)
+        {
+            delete (*i);
+        }
+            
+        mAffectors.clear();
+
+    }
+    //-----------------------------------------------------------------------
+    void ParticleAffectorFactory::destroyAffector(ParticleAffector* e)
+    {
+        std::vector<ParticleAffector*>::iterator i;
+        for (i = mAffectors.begin(); i != mAffectors.end(); ++i)
+        {
+            if ((*i) == e)
+            {
+                mAffectors.erase(i);
+                delete e;
+                break;
+            }
+        }
+    }
+
+}
Index: /OgreMain/src/OgreParticleSystemManager.cpp
===================================================================
--- /OgreMain/src/OgreParticleSystemManager.cpp	(revision 5)
+++ /OgreMain/src/OgreParticleSystemManager.cpp	(revision 5)
@@ -0,0 +1,625 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreParticleSystemManager.h"
+#include "OgreParticleEmitterFactory.h"
+#include "OgreParticleAffectorFactory.h"
+#include "OgreException.h"
+#include "OgreRoot.h"
+#include "OgreLogManager.h"
+#include "OgreString.h"
+#include "OgreParticleSystemRenderer.h"
+#include "OgreBillboardParticleRenderer.h"
+#include "OgreStringConverter.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    // Shortcut to set up billboard particle renderer
+    BillboardParticleRendererFactory* mBillboardRendererFactory = 0;
+    //-----------------------------------------------------------------------
+    template<> ParticleSystemManager* Singleton<ParticleSystemManager>::ms_Singleton = 0;
+    ParticleSystemManager* ParticleSystemManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    ParticleSystemManager& ParticleSystemManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+    //-----------------------------------------------------------------------
+    ParticleSystemManager::ParticleSystemManager()
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        mScriptPatterns.push_back("*.particle");
+        ResourceGroupManager::getSingleton()._registerScriptLoader(this);
+		mFactory = new ParticleSystemFactory();
+		Root::getSingleton().addMovableObjectFactory(mFactory);
+    }
+    //-----------------------------------------------------------------------
+    ParticleSystemManager::~ParticleSystemManager()
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        // Destroy all templates
+        ParticleTemplateMap::iterator t;
+        for (t = mSystemTemplates.begin(); t != mSystemTemplates.end(); ++t)
+        {
+            delete t->second;
+        }
+        mSystemTemplates.clear();
+        ResourceGroupManager::getSingleton()._unregisterScriptLoader(this);
+        // delete billboard factory
+        if (mBillboardRendererFactory)
+		{
+            delete mBillboardRendererFactory;
+			mBillboardRendererFactory = 0;
+		}
+
+		if (mFactory)
+		{
+			// delete particle system factory
+			Root::getSingleton().removeMovableObjectFactory(mFactory);
+			delete mFactory;
+			mFactory = 0;
+		}
+
+    }
+    //-----------------------------------------------------------------------
+    const StringVector& ParticleSystemManager::getScriptPatterns(void) const
+    {
+        return mScriptPatterns;
+    }
+    //-----------------------------------------------------------------------
+    Real ParticleSystemManager::getLoadingOrder(void) const
+    {
+        /// Load late
+        return 1000.0f;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystemManager::parseScript(DataStreamPtr& stream, const String& groupName)
+    {
+        String line;
+        ParticleSystem* pSys;
+        std::vector<String> vecparams;
+
+        pSys = 0;
+
+        while(!stream->eof())
+        {
+            line = stream->getLine();
+            // Ignore comments & blanks
+            if (!(line.length() == 0 || line.substr(0,2) == "//"))
+            {
+                if (pSys == 0)
+                {
+                    // No current system
+                    // So first valid data should be a system name
+                    pSys = createTemplate(line, groupName);
+					pSys->_notifyOrigin(stream->getName());
+                    // Skip to and over next {
+                    skipToNextOpenBrace(stream);
+                }
+                else
+                {
+                    // Already in a system
+                    if (line == "}")
+                    {
+                        // Finished system
+                        pSys = 0;
+                    }
+                    else if (line.substr(0,7) == "emitter")
+                    {
+                        // new emitter
+                        // Get typename
+                        vecparams = StringUtil::split(line, "\t ");
+                        if (vecparams.size() < 2)
+                        {
+                            // Oops, bad emitter
+                            LogManager::getSingleton().logMessage("Bad particle system emitter line: '"
+                                + line + "' in " + pSys->getName());
+                            skipToNextCloseBrace(stream);
+
+                        }
+                        skipToNextOpenBrace(stream);
+                        parseNewEmitter(vecparams[1], stream, pSys);
+
+                    }
+                    else if (line.substr(0,8) == "affector")
+                    {
+                        // new affector
+                        // Get typename
+                        vecparams = StringUtil::split(line, "\t ");
+                        if (vecparams.size() < 2)
+                        {
+                            // Oops, bad affector
+                            LogManager::getSingleton().logMessage("Bad particle system affector line: '"
+                                + line + "' in " + pSys->getName());
+                            skipToNextCloseBrace(stream);
+
+                        }
+                        skipToNextOpenBrace(stream);
+                        parseNewAffector(vecparams[1],stream, pSys);
+                    }
+                    else
+                    {
+                        // Attribute
+                        parseAttrib(line, pSys);
+                    }
+
+                }
+
+            }
+
+
+        }
+
+
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystemManager::addEmitterFactory(ParticleEmitterFactory* factory)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        String name = factory->getName();
+        mEmitterFactories[name] = factory;
+        LogManager::getSingleton().logMessage("Particle Emitter Type '" + name + "' registered");
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystemManager::addAffectorFactory(ParticleAffectorFactory* factory)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        String name = factory->getName();
+        mAffectorFactories[name] = factory;
+        LogManager::getSingleton().logMessage("Particle Affector Type '" + name + "' registered");
+    }
+	//-----------------------------------------------------------------------
+	void ParticleSystemManager::addRendererFactory(ParticleSystemRendererFactory* factory)
+	{
+		OGRE_LOCK_AUTO_MUTEX 
+		String name = factory->getType();
+        mRendererFactories[name] = factory;
+        LogManager::getSingleton().logMessage("Particle Renderer Type '" + name + "' registered");
+	}
+	//-----------------------------------------------------------------------
+    void ParticleSystemManager::addTemplate(const String& name, ParticleSystem* sysTemplate)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+		// check name
+		if (mSystemTemplates.find(name) != mSystemTemplates.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, 
+				"ParticleSystem template with name '" + name + "' already exists.", 
+				"ParticleSystemManager::addTemplate");
+		}
+
+        mSystemTemplates[name] = sysTemplate;
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystemManager::removeTemplate(const String& name, bool deleteTemplate)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        ParticleTemplateMap::iterator itr = mSystemTemplates.find(name);
+        if (itr == mSystemTemplates.end())
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+                "ParticleSystem template with name '" + name + "' cannot be found.",
+                "ParticleSystemManager::removeTemplate");
+
+        if (deleteTemplate)
+            delete itr->second;
+
+        mSystemTemplates.erase(itr);
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystemManager::removeAllTemplates(bool deleteTemplate)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        if (deleteTemplate)
+        {
+            ParticleTemplateMap::iterator itr;
+            for (itr = mSystemTemplates.begin(); itr != mSystemTemplates.end(); ++itr)
+                delete itr->second;
+        }
+
+        mSystemTemplates.clear();
+    }
+    //-----------------------------------------------------------------------
+    ParticleSystem* ParticleSystemManager::createTemplate(const String& name, 
+        const String& resourceGroup)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+		// check name
+		if (mSystemTemplates.find(name) != mSystemTemplates.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, 
+				"ParticleSystem template with name '" + name + "' already exists.", 
+				"ParticleSystemManager::createTemplate");
+		}
+
+        ParticleSystem* tpl = new ParticleSystem(name, resourceGroup);
+        addTemplate(name, tpl);
+        return tpl;
+
+    }
+    //-----------------------------------------------------------------------
+    ParticleSystem* ParticleSystemManager::getTemplate(const String& name)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        ParticleTemplateMap::iterator i = mSystemTemplates.find(name);
+        if (i != mSystemTemplates.end())
+        {
+            return i->second;
+        }
+        else
+        {
+            return 0;
+        }
+    }
+	//-----------------------------------------------------------------------
+    ParticleSystem* ParticleSystemManager::createSystemImpl(const String& name,
+		size_t quota, const String& resourceGroup)
+    {
+        ParticleSystem* sys = new ParticleSystem(name, resourceGroup);
+        sys->setParticleQuota(quota);
+        return sys;
+    }
+    //-----------------------------------------------------------------------
+    ParticleSystem* ParticleSystemManager::createSystemImpl(const String& name, 
+		const String& templateName)
+    {
+        // Look up template
+        ParticleSystem* pTemplate = getTemplate(templateName);
+        if (!pTemplate)
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Cannot find required template '" + templateName + "'", "ParticleSystemManager::createSystem");
+        }
+
+        ParticleSystem* sys = createSystemImpl(name, pTemplate->getParticleQuota(), 
+            pTemplate->getResourceGroupName());
+        // Copy template settings
+        *sys = *pTemplate;
+        return sys;
+        
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystemManager::destroySystemImpl(ParticleSystem* sys)
+	{
+		delete sys;
+	}
+    //-----------------------------------------------------------------------
+    ParticleEmitter* ParticleSystemManager::_createEmitter(
+        const String& emitterType, ParticleSystem* psys)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        // Locate emitter type
+        ParticleEmitterFactoryMap::iterator pFact = mEmitterFactories.find(emitterType);
+
+        if (pFact == mEmitterFactories.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Cannot find requested emitter type.", 
+                "ParticleSystemManager::_createEmitter");
+        }
+
+        return pFact->second->createEmitter(psys);
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystemManager::_destroyEmitter(ParticleEmitter* emitter)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        // Destroy using the factory which created it
+        ParticleEmitterFactoryMap::iterator pFact = mEmitterFactories.find(emitter->getType());
+
+        if (pFact == mEmitterFactories.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Cannot find emitter factory to destroy emitter.", 
+                "ParticleSystemManager::_destroyEmitter");
+        }
+
+        pFact->second->destroyEmitter(emitter);
+    }
+    //-----------------------------------------------------------------------
+    ParticleAffector* ParticleSystemManager::_createAffector(
+        const String& affectorType, ParticleSystem* psys)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        // Locate affector type
+        ParticleAffectorFactoryMap::iterator pFact = mAffectorFactories.find(affectorType);
+
+        if (pFact == mAffectorFactories.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Cannot find requested affector type.", 
+                "ParticleSystemManager::_createAffector");
+        }
+
+        return pFact->second->createAffector(psys);
+
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystemManager::_destroyAffector(ParticleAffector* affector)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        // Destroy using the factory which created it
+        ParticleAffectorFactoryMap::iterator pFact = mAffectorFactories.find(affector->getType());
+
+        if (pFact == mAffectorFactories.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Cannot find affector factory to destroy affector.", 
+                "ParticleSystemManager::_destroyAffector");
+        }
+
+        pFact->second->destroyAffector(affector);
+    }
+    //-----------------------------------------------------------------------
+    ParticleSystemRenderer* ParticleSystemManager::_createRenderer(const String& rendererType)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+        // Locate affector type
+        ParticleSystemRendererFactoryMap::iterator pFact = mRendererFactories.find(rendererType);
+
+        if (pFact == mRendererFactories.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Cannot find requested renderer type.", 
+                "ParticleSystemManager::_createRenderer");
+        }
+
+        return pFact->second->createInstance(rendererType);
+	}
+	//-----------------------------------------------------------------------
+    void ParticleSystemManager::_destroyRenderer(ParticleSystemRenderer* renderer)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+        // Destroy using the factory which created it
+        ParticleSystemRendererFactoryMap::iterator pFact = mRendererFactories.find(renderer->getType());
+
+        if (pFact == mRendererFactories.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Cannot find renderer factory to destroy renderer.", 
+                "ParticleSystemManager::_destroyRenderer");
+        }
+
+        pFact->second->destroyInstance(renderer);
+	}
+    //-----------------------------------------------------------------------
+    void ParticleSystemManager::_initialise(void)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+        // Create Billboard renderer factory
+        mBillboardRendererFactory = new BillboardParticleRendererFactory();
+        addRendererFactory(mBillboardRendererFactory);
+
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystemManager::parseNewEmitter(const String& type, DataStreamPtr& stream, ParticleSystem* sys)
+    {
+        // Create new emitter
+        ParticleEmitter* pEmit = sys->addEmitter(type);
+        // Parse emitter details
+        String line;
+
+        while(!stream->eof())
+        {
+            line = stream->getLine();
+            // Ignore comments & blanks
+            if (!(line.length() == 0 || line.substr(0,2) == "//"))
+            {
+                if (line == "}")
+                {
+                    // Finished emitter
+                    break;
+                }
+                else
+                {
+                    // Attribute
+					StringUtil::toLowerCase(line);
+                    parseEmitterAttrib(line, pEmit);
+                }
+            }
+        }
+
+
+        
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystemManager::parseNewAffector(const String& type, DataStreamPtr& stream, ParticleSystem* sys)
+    {
+        // Create new affector
+        ParticleAffector* pAff = sys->addAffector(type);
+        // Parse affector details
+        String line;
+
+        while(!stream->eof())
+        {
+            line = stream->getLine();
+            // Ignore comments & blanks
+            if (!(line.length() == 0 || line.substr(0,2) == "//"))
+            {
+                if (line == "}")
+                {
+                    // Finished affector
+                    break;
+                }
+                else
+                {
+                    // Attribute
+					StringUtil::toLowerCase(line);
+                    parseAffectorAttrib(line, pAff);
+                }
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystemManager::parseAttrib(const String& line, ParticleSystem* sys)
+    {
+        // Split params on space
+        std::vector<String> vecparams = StringUtil::split(line, "\t ", 1);
+
+        // Look up first param (command setting)
+        if (!sys->setParameter(vecparams[0], vecparams[1]))
+        {
+            // Attribute not supported by particle system, try the renderer
+            ParticleSystemRenderer* renderer = sys->getRenderer();
+            if (renderer)
+            {
+                if (!renderer->setParameter(vecparams[0], vecparams[1]))
+                {
+                    LogManager::getSingleton().logMessage("Bad particle system attribute line: '"
+                        + line + "' in " + sys->getName() + " (tried renderer)");
+                }
+            }
+            else
+            {
+                // BAD command. BAD!
+                LogManager::getSingleton().logMessage("Bad particle system attribute line: '"
+                    + line + "' in " + sys->getName() + " (no renderer)");
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystemManager::parseEmitterAttrib(const String& line, ParticleEmitter* emit)
+    {
+        // Split params on first space
+        std::vector<String> vecparams = StringUtil::split(line, "\t ", 1);
+
+        // Look up first param (command setting)
+        if (!emit->setParameter(vecparams[0], vecparams[1]))
+        {
+            // BAD command. BAD!
+            LogManager::getSingleton().logMessage("Bad particle emitter attribute line: '"
+                + line + "' for emitter " + emit->getType());
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystemManager::parseAffectorAttrib(const String& line, ParticleAffector* aff)
+    {
+        // Split params on space
+        std::vector<String> vecparams = StringUtil::split(line, "\t ", 1);
+
+        // Look up first param (command setting)
+        if (!aff->setParameter(vecparams[0], vecparams[1]))
+        {
+            // BAD command. BAD!
+            LogManager::getSingleton().logMessage("Bad particle affector attribute line: '"
+                + line + "' for affector " + aff->getType());
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystemManager::skipToNextCloseBrace(DataStreamPtr& stream)
+    {
+        String line;
+        while (!stream->eof() && line != "}")
+        {
+            line = stream->getLine();
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void ParticleSystemManager::skipToNextOpenBrace(DataStreamPtr& stream)
+    {
+        String line;
+        while (!stream->eof() && line != "{")
+        {
+            line = stream->getLine();
+        }
+
+    }
+	//-----------------------------------------------------------------------
+	ParticleSystemManager::ParticleAffectorFactoryIterator 
+	ParticleSystemManager::getAffectorFactoryIterator(void)
+	{
+		return ParticleAffectorFactoryIterator(
+			mAffectorFactories.begin(), mAffectorFactories.end());
+	}
+	//-----------------------------------------------------------------------
+	ParticleSystemManager::ParticleEmitterFactoryIterator 
+	ParticleSystemManager::getEmitterFactoryIterator(void)
+	{
+		return ParticleEmitterFactoryIterator(
+			mEmitterFactories.begin(), mEmitterFactories.end());
+	}
+	//-----------------------------------------------------------------------
+	ParticleSystemManager::ParticleRendererFactoryIterator 
+	ParticleSystemManager::getRendererFactoryIterator(void)
+	{
+		return ParticleRendererFactoryIterator(
+			mRendererFactories.begin(), mRendererFactories.end());
+	}
+	//-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+	String ParticleSystemFactory::FACTORY_TYPE_NAME = "ParticleSystem";
+    //-----------------------------------------------------------------------
+	MovableObject* ParticleSystemFactory::createInstanceImpl( const String& name, 
+			const NameValuePairList* params)
+	{
+		if (params != 0)
+		{
+			NameValuePairList::const_iterator ni = params->find("templateName");
+			if (ni != params->end())
+			{
+				String templateName = ni->second;
+				// create using manager
+				return ParticleSystemManager::getSingleton().createSystemImpl(
+						name, templateName);
+			}
+		}
+		// Not template based, look for quota & resource name
+		size_t quota = 500;
+		String resourceGroup = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME;
+		if (params != 0)
+		{
+			NameValuePairList::const_iterator ni = params->find("quota");
+			if (ni != params->end())
+			{
+				quota = StringConverter::parseUnsignedInt(ni->second);
+			}
+			ni = params->find("resourceGroup");
+			if (ni != params->end())
+			{
+				resourceGroup = ni->second;
+			}
+		}
+		// create using manager
+		return ParticleSystemManager::getSingleton().createSystemImpl(
+				name, quota, resourceGroup);
+				
+
+	}
+    //-----------------------------------------------------------------------
+	const String& ParticleSystemFactory::getType(void) const
+	{
+		return FACTORY_TYPE_NAME;
+	}
+    //-----------------------------------------------------------------------
+	void ParticleSystemFactory::destroyInstance( MovableObject* obj) 
+	{
+		// use manager
+		ParticleSystemManager::getSingleton().destroySystemImpl(
+			static_cast<ParticleSystem*>(obj));
+
+	}
+    //-----------------------------------------------------------------------
+}
Index: /OgreMain/src/OgrePass.cpp
===================================================================
--- /OgreMain/src/OgrePass.cpp	(revision 5)
+++ /OgreMain/src/OgrePass.cpp	(revision 5)
@@ -0,0 +1,1542 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgrePass.h"
+#include "OgreTechnique.h"
+#include "OgreException.h"
+#include "OgreGpuProgramUsage.h"
+#include "OgreTextureUnitState.h"
+#include "OgreStringConverter.h"
+
+namespace Ogre {
+
+	/** Default pass hash function.
+	@remarks
+		Tries to minimise the number of texture changes.
+	*/
+	struct MinTextureStateChangeHashFunc : public Pass::HashFunc
+	{
+		uint32 operator()(const Pass* p) const
+		{
+
+			_StringHash H;
+			uint32 hash = p->getIndex() << 28;
+			size_t c = p->getNumTextureUnitStates();
+
+			const TextureUnitState* t0 = 0;
+			const TextureUnitState* t1 = 0;
+			if (c)
+				t0 = p->getTextureUnitState(0);
+			if (c > 1)
+				t1 = p->getTextureUnitState(1);
+
+			if (t0 && !t0->getTextureName().empty())
+				hash += (static_cast<uint32>(H(t0->getTextureName())) 
+					% (1 << 14)) << 14;
+			if (t1 && !t1->getTextureName().empty())
+				hash += (static_cast<uint32>(H(t1->getTextureName()))
+					% (1 << 14));
+
+			return hash;
+		}
+	};
+	MinTextureStateChangeHashFunc sMinTextureStateChangeHashFunc;
+	/** Alternate pass hash function.
+	@remarks
+		Tries to minimise the number of GPU program changes.
+	*/
+	struct MinGpuProgramChangeHashFunc : public Pass::HashFunc
+	{
+		uint32 operator()(const Pass* p) const
+		{
+
+			_StringHash H;
+			uint32 hash = p->getIndex() << 28;
+			if (p->hasVertexProgram())
+				hash += (static_cast<uint32>(H(p->getVertexProgramName()))
+					% (1 << 14)) << 14;
+			if (p->hasFragmentProgram())
+				hash += (static_cast<uint32>(H(p->getFragmentProgramName()))
+					% (1 << 14));
+
+			return hash;
+		}
+	};
+	MinGpuProgramChangeHashFunc sMinGpuProgramChangeHashFunc;
+    //-----------------------------------------------------------------------------
+	Pass::PassSet Pass::msDirtyHashList;
+    Pass::PassSet Pass::msPassGraveyard;
+	OGRE_STATIC_MUTEX_INSTANCE(Pass::msDirtyHashListMutex)
+	OGRE_STATIC_MUTEX_INSTANCE(Pass::msPassGraveyardMutex)
+
+	Pass::HashFunc* Pass::msHashFunc = &sMinTextureStateChangeHashFunc;
+	//-----------------------------------------------------------------------------
+	void Pass::setHashFunction(BuiltinHashFunction builtin)
+	{
+		switch(builtin)
+		{
+		case MIN_TEXTURE_CHANGE:
+			msHashFunc = &sMinTextureStateChangeHashFunc;
+			break;
+		case MIN_GPU_PROGRAM_CHANGE:
+			msHashFunc = &sMinGpuProgramChangeHashFunc;
+			break;
+		}
+	}
+    //-----------------------------------------------------------------------------
+	Pass::Pass(Technique* parent, unsigned short index)
+        : mParent(parent)
+		, mIndex(index)
+		, mHash(0)
+		, mAmbient(ColourValue::White)
+		, mDiffuse(ColourValue::White)
+		, mSpecular(ColourValue::Black)
+		, mEmissive(ColourValue::Black)
+		, mShininess(0)
+		, mTracking(TVC_NONE)
+		, mSourceBlendFactor(SBF_ONE)
+		, mDestBlendFactor(SBF_ZERO)
+		, mDepthCheck(true)
+		, mDepthWrite(true)
+		, mDepthFunc(CMPF_LESS_EQUAL)
+		, mDepthBiasConstant(0.0f)
+		, mDepthBiasSlopeScale(0.0f)
+		, mColourWrite(true)
+		, mAlphaRejectFunc(CMPF_ALWAYS_PASS)
+		, mAlphaRejectVal(0)
+		, mCullMode(CULL_CLOCKWISE)
+		, mManualCullMode(MANUAL_CULL_BACK)
+		, mLightingEnabled(true)
+		, mMaxSimultaneousLights(OGRE_MAX_SIMULTANEOUS_LIGHTS)
+		, mStartLight(0)
+		, mIteratePerLight(false)
+		, mLightsPerIteration(1)
+		, mRunOnlyForOneLightType(false)
+		, mOnlyLightType(Light::LT_POINT)
+		, mShadeOptions(SO_GOURAUD)
+		, mPolygonMode(PM_SOLID)
+		, mFogOverride(false)
+		, mFogMode(FOG_NONE)
+		, mFogColour(ColourValue::White)
+		, mFogStart(0.0)
+		, mFogEnd(1.0)
+		, mFogDensity(0.001)
+		, mVertexProgramUsage(0)
+		, mShadowCasterVertexProgramUsage(0)
+		, mShadowReceiverVertexProgramUsage(0)
+		, mFragmentProgramUsage(0)
+		, mShadowReceiverFragmentProgramUsage(0)
+		, mQueuedForDeletion(false)
+		, mPassIterationCount(1)
+		, mPointSize(1.0f)
+		, mPointMinSize(0.0f)
+		, mPointMaxSize(0.0f)
+		, mPointSpritesEnabled(false)
+		, mPointAttenuationEnabled(false)
+		, mContentTypeLookupBuilt(false)
+    {
+		mPointAttenuationCoeffs[0] = 1.0f;
+		mPointAttenuationCoeffs[1] = mPointAttenuationCoeffs[2] = 0.0f;
+
+        // default name to index
+        mName = StringConverter::toString(mIndex);
+
+        _dirtyHash();
+   }
+
+    //-----------------------------------------------------------------------------
+	Pass::Pass(Technique *parent, unsigned short index, const Pass& oth)
+        :mParent(parent), mIndex(index), mQueuedForDeletion(false), mPassIterationCount(1)
+    {
+        *this = oth;
+        mParent = parent;
+        mIndex = index;
+        mQueuedForDeletion = false;
+        _dirtyHash();
+    }
+    //-----------------------------------------------------------------------------
+    Pass::~Pass()
+    {
+
+    }
+    //-----------------------------------------------------------------------------
+    Pass& Pass::operator=(const Pass& oth)
+    {
+        mName = oth.mName;
+        mHash = oth.mHash;
+	    mAmbient = oth.mAmbient;
+        mDiffuse = oth.mDiffuse;
+	    mSpecular = oth.mSpecular;
+        mEmissive = oth.mEmissive;
+	    mShininess = oth.mShininess;
+        mTracking = oth.mTracking;
+
+        // Copy fog parameters
+        mFogOverride = oth.mFogOverride;
+        mFogMode = oth.mFogMode;
+        mFogColour = oth.mFogColour;
+        mFogStart = oth.mFogStart;
+        mFogEnd = oth.mFogEnd;
+        mFogDensity = oth.mFogDensity;
+
+	    // Default blending (overwrite)
+	    mSourceBlendFactor = oth.mSourceBlendFactor;
+	    mDestBlendFactor = oth.mDestBlendFactor;
+
+	    mDepthCheck = oth.mDepthCheck;
+	    mDepthWrite = oth.mDepthWrite;
+		mAlphaRejectFunc = oth.mAlphaRejectFunc;
+		mAlphaRejectVal = oth.mAlphaRejectVal;
+        mColourWrite = oth.mColourWrite;
+	    mDepthFunc = oth.mDepthFunc;
+        mDepthBiasConstant = oth.mDepthBiasConstant;
+		mDepthBiasSlopeScale = oth.mDepthBiasSlopeScale;
+	    mCullMode = oth.mCullMode;
+	    mManualCullMode = oth.mManualCullMode;
+	    mLightingEnabled = oth.mLightingEnabled;
+        mMaxSimultaneousLights = oth.mMaxSimultaneousLights;
+		mStartLight = oth.mStartLight;
+		mIteratePerLight = oth.mIteratePerLight;
+		mLightsPerIteration = oth.mLightsPerIteration;
+        mRunOnlyForOneLightType = oth.mRunOnlyForOneLightType;
+        mOnlyLightType = oth.mOnlyLightType;
+	    mShadeOptions = oth.mShadeOptions;
+		mPolygonMode = oth.mPolygonMode;
+        mPassIterationCount = oth.mPassIterationCount;
+		mPointSize = oth.mPointSize;
+		mPointMinSize = oth.mPointMinSize;
+		mPointMaxSize = oth.mPointMaxSize;
+		mPointSpritesEnabled = oth.mPointSpritesEnabled;
+		mPointAttenuationEnabled = oth.mPointAttenuationEnabled;
+		memcpy(mPointAttenuationCoeffs, oth.mPointAttenuationCoeffs, sizeof(Real)*3);
+		mShadowContentTypeLookup = oth.mShadowContentTypeLookup;
+		mContentTypeLookupBuilt = oth.mContentTypeLookupBuilt;
+
+
+		if (oth.mVertexProgramUsage)
+		{
+			mVertexProgramUsage = new GpuProgramUsage(*(oth.mVertexProgramUsage));
+		}
+		else
+		{
+		    mVertexProgramUsage = NULL;
+		}
+        if (oth.mShadowCasterVertexProgramUsage)
+        {
+            mShadowCasterVertexProgramUsage = new GpuProgramUsage(*(oth.mShadowCasterVertexProgramUsage));
+        }
+        else
+        {
+            mShadowCasterVertexProgramUsage = NULL;
+        }
+        if (oth.mShadowReceiverVertexProgramUsage)
+        {
+            mShadowReceiverVertexProgramUsage = new GpuProgramUsage(*(oth.mShadowReceiverVertexProgramUsage));
+        }
+        else
+        {
+            mShadowReceiverVertexProgramUsage = NULL;
+        }
+		if (oth.mFragmentProgramUsage)
+		{
+		    mFragmentProgramUsage = new GpuProgramUsage(*(oth.mFragmentProgramUsage));
+        }
+        else
+        {
+		    mFragmentProgramUsage = NULL;
+        }
+		if (oth.mShadowReceiverFragmentProgramUsage)
+		{
+			mShadowReceiverFragmentProgramUsage = new GpuProgramUsage(*(oth.mShadowReceiverFragmentProgramUsage));
+		}
+		else
+		{
+			mShadowReceiverFragmentProgramUsage = NULL;
+		}
+
+		TextureUnitStates::const_iterator i, iend;
+
+        // Clear texture units but doesn't notify need recompilation in the case
+        // we are cloning, The parent material will take care of this.
+        iend = mTextureUnitStates.end();
+        for (i = mTextureUnitStates.begin(); i != iend; ++i)
+        {
+            delete *i;
+        }
+
+        mTextureUnitStates.clear();
+
+		// Copy texture units
+		iend = oth.mTextureUnitStates.end();
+		for (i = oth.mTextureUnitStates.begin(); i != iend; ++i)
+		{
+			TextureUnitState* t = new TextureUnitState(this, *(*i));
+			mTextureUnitStates.push_back(t);
+		}
+
+        _dirtyHash();
+
+		return *this;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setName(const String& name)
+    {
+        mName = name;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setPointSize(Real ps)
+    {
+	    mPointSize = ps;
+    }
+    //-----------------------------------------------------------------------
+	void Pass::setPointSpritesEnabled(bool enabled)
+	{
+		mPointSpritesEnabled = enabled;
+	}
+    //-----------------------------------------------------------------------
+	bool Pass::getPointSpritesEnabled(void) const
+	{
+		return mPointSpritesEnabled;
+	}
+    //-----------------------------------------------------------------------
+	void Pass::setPointAttenuation(bool enabled,
+		Real constant, Real linear, Real quadratic)
+	{
+		mPointAttenuationEnabled = enabled;
+		mPointAttenuationCoeffs[0] = constant;
+		mPointAttenuationCoeffs[1] = linear;
+		mPointAttenuationCoeffs[2] = quadratic;
+	}
+    //-----------------------------------------------------------------------
+	bool Pass::isPointAttenuationEnabled(void) const
+	{
+		return mPointAttenuationEnabled;
+	}
+    //-----------------------------------------------------------------------
+	Real Pass::getPointAttenuationConstant(void) const
+	{
+		return mPointAttenuationCoeffs[0];
+	}
+    //-----------------------------------------------------------------------
+	Real Pass::getPointAttenuationLinear(void) const
+	{
+		return mPointAttenuationCoeffs[1];
+	}
+    //-----------------------------------------------------------------------
+	Real Pass::getPointAttenuationQuadratic(void) const
+	{
+		return mPointAttenuationCoeffs[2];
+	}
+    //-----------------------------------------------------------------------
+	void Pass::setPointMinSize(Real min)
+	{
+		mPointMinSize = min;
+	}
+    //-----------------------------------------------------------------------
+	Real Pass::getPointMinSize(void) const
+	{
+		return mPointMinSize;
+	}
+    //-----------------------------------------------------------------------
+	void Pass::setPointMaxSize(Real max)
+	{
+		mPointMaxSize = max;
+	}
+    //-----------------------------------------------------------------------
+	Real Pass::getPointMaxSize(void) const
+	{
+		return mPointMaxSize;
+	}
+    //-----------------------------------------------------------------------
+    void Pass::setAmbient(Real red, Real green, Real blue)
+    {
+	    mAmbient.r = red;
+	    mAmbient.g = green;
+	    mAmbient.b = blue;
+
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setAmbient(const ColourValue& ambient)
+    {
+	    mAmbient = ambient;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setDiffuse(Real red, Real green, Real blue, Real alpha)
+    {
+	    mDiffuse.r = red;
+	    mDiffuse.g = green;
+	    mDiffuse.b = blue;
+		mDiffuse.a = alpha;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setDiffuse(const ColourValue& diffuse)
+    {
+	    mDiffuse = diffuse;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setSpecular(Real red, Real green, Real blue, Real alpha)
+    {
+	    mSpecular.r = red;
+	    mSpecular.g = green;
+	    mSpecular.b = blue;
+		mSpecular.a = alpha;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setSpecular(const ColourValue& specular)
+    {
+	    mSpecular = specular;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setShininess(Real val)
+    {
+	    mShininess = val;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setSelfIllumination(Real red, Real green, Real blue)
+    {
+	    mEmissive.r = red;
+	    mEmissive.g = green;
+	    mEmissive.b = blue;
+
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setSelfIllumination(const ColourValue& selfIllum)
+    {
+	    mEmissive = selfIllum;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setVertexColourTracking(TrackVertexColourType tracking)
+    {
+        mTracking = tracking;
+    }
+    //-----------------------------------------------------------------------
+    Real Pass::getPointSize(void) const
+    {
+	    return mPointSize;
+    }
+    //-----------------------------------------------------------------------
+    const ColourValue& Pass::getAmbient(void) const
+    {
+	    return mAmbient;
+    }
+    //-----------------------------------------------------------------------
+    const ColourValue& Pass::getDiffuse(void) const
+    {
+	    return mDiffuse;
+    }
+    //-----------------------------------------------------------------------
+    const ColourValue& Pass::getSpecular(void) const
+    {
+	    return mSpecular;
+    }
+    //-----------------------------------------------------------------------
+    const ColourValue& Pass::getSelfIllumination(void) const
+    {
+	    return mEmissive;
+    }
+    //-----------------------------------------------------------------------
+    Real Pass::getShininess(void) const
+    {
+	    return mShininess;
+    }
+    //-----------------------------------------------------------------------
+    TrackVertexColourType Pass::getVertexColourTracking(void) const
+    {
+        return mTracking;
+    }
+    //-----------------------------------------------------------------------
+    TextureUnitState* Pass::createTextureUnitState(void)
+    {
+        TextureUnitState *t = new TextureUnitState(this);
+        addTextureUnitState(t);
+		mContentTypeLookupBuilt = false;
+	    return t;
+    }
+    //-----------------------------------------------------------------------
+    TextureUnitState* Pass::createTextureUnitState(
+        const String& textureName, unsigned short texCoordSet)
+    {
+        TextureUnitState *t = new TextureUnitState(this);
+	    t->setTextureName(textureName);
+	    t->setTextureCoordSet(texCoordSet);
+        addTextureUnitState(t);
+		mContentTypeLookupBuilt = false;
+	    return t;
+    }
+    //-----------------------------------------------------------------------
+	void Pass::addTextureUnitState(TextureUnitState* state)
+	{
+        assert(state && "state is 0 in Pass::addTextureUnitState()");
+        if (state)
+        {
+            // only attach TUS to pass if TUS does not belong to another pass
+            if ((state->getParent() == 0) || (state->getParent() == this))
+            {
+		        mTextureUnitStates.push_back(state);
+				// Notify state
+				state->_notifyParent(this);
+                // if texture unit state name is empty then give it a default name based on its index
+                if (state->getName().empty())
+                {
+                    // its the last entry in the container so its index is size - 1
+                    size_t idx = mTextureUnitStates.size() - 1;
+                    state->setName( StringConverter::toString(idx) );
+                    /** since the name was never set and a default one has been made, clear the alias name
+                     so that when the texture unit name is set by the user, the alias name will be set to
+                     that name
+                    */
+                    state->setTextureNameAlias(StringUtil::BLANK);
+                }
+                // Needs recompilation
+                mParent->_notifyNeedsRecompile();
+                _dirtyHash();
+            }
+            else
+            {
+			    OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "TextureUnitState already attached to another pass",
+				    "Pass:addTextureUnitState");
+
+            }
+			mContentTypeLookupBuilt = false;
+        }
+	}
+    //-----------------------------------------------------------------------
+    TextureUnitState* Pass::getTextureUnitState(unsigned short index)
+    {
+        assert (index < mTextureUnitStates.size() && "Index out of bounds");
+	    return mTextureUnitStates[index];
+    }
+    //-----------------------------------------------------------------------------
+    TextureUnitState* Pass::getTextureUnitState(const String& name)
+    {
+        TextureUnitStates::iterator i    = mTextureUnitStates.begin();
+        TextureUnitStates::iterator iend = mTextureUnitStates.end();
+        TextureUnitState* foundTUS = 0;
+
+        // iterate through TUS Container to find a match
+        while (i != iend)
+        {
+            if ( (*i)->getName() == name )
+            {
+                foundTUS = (*i);
+                break;
+            }
+
+            ++i;
+        }
+
+        return foundTUS;
+    }
+	//-----------------------------------------------------------------------
+	const TextureUnitState* Pass::getTextureUnitState(unsigned short index) const
+	{
+		assert (index < mTextureUnitStates.size() && "Index out of bounds");
+		return mTextureUnitStates[index];
+	}
+	//-----------------------------------------------------------------------------
+	const TextureUnitState* Pass::getTextureUnitState(const String& name) const
+	{
+		TextureUnitStates::const_iterator i    = mTextureUnitStates.begin();
+		TextureUnitStates::const_iterator iend = mTextureUnitStates.end();
+		const TextureUnitState* foundTUS = 0;
+
+		// iterate through TUS Container to find a match
+		while (i != iend)
+		{
+			if ( (*i)->getName() == name )
+			{
+				foundTUS = (*i);
+				break;
+			}
+
+			++i;
+		}
+
+		return foundTUS;
+	}
+
+    //-----------------------------------------------------------------------
+    unsigned short Pass::getTextureUnitStateIndex(const TextureUnitState* state) const
+    {
+        assert(state && "state is 0 in Pass::getTextureUnitStateIndex()");
+
+        // only find index for state attached to this pass
+        if (state->getParent() == this)
+        {
+            TextureUnitStates::const_iterator i =
+                std::find(mTextureUnitStates.begin(), mTextureUnitStates.end(), state);
+            assert(i != mTextureUnitStates.end() && "state is supposed to attached to this pass");
+            return static_cast<unsigned short>(std::distance(mTextureUnitStates.begin(), i));
+        }
+        else
+        {
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "TextureUnitState is not attached to this pass",
+				"Pass:getTextureUnitStateIndex");
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    Pass::TextureUnitStateIterator
+        Pass::getTextureUnitStateIterator(void)
+    {
+        return TextureUnitStateIterator(mTextureUnitStates.begin(), mTextureUnitStates.end());
+    }
+	//-----------------------------------------------------------------------
+	Pass::ConstTextureUnitStateIterator
+		Pass::getTextureUnitStateIterator(void) const
+	{
+		return ConstTextureUnitStateIterator(mTextureUnitStates.begin(), mTextureUnitStates.end());
+	}
+    //-----------------------------------------------------------------------
+    void Pass::removeTextureUnitState(unsigned short index)
+    {
+        assert (index < mTextureUnitStates.size() && "Index out of bounds");
+
+        TextureUnitStates::iterator i = mTextureUnitStates.begin() + index;
+        delete *i;
+	    mTextureUnitStates.erase(i);
+        if (!mQueuedForDeletion)
+        {
+            // Needs recompilation
+            mParent->_notifyNeedsRecompile();
+        }
+        _dirtyHash();
+		mContentTypeLookupBuilt = false;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::removeAllTextureUnitStates(void)
+    {
+        TextureUnitStates::iterator i, iend;
+        iend = mTextureUnitStates.end();
+        for (i = mTextureUnitStates.begin(); i != iend; ++i)
+        {
+            delete *i;
+        }
+        mTextureUnitStates.clear();
+        if (!mQueuedForDeletion)
+        {
+            // Needs recompilation
+            mParent->_notifyNeedsRecompile();
+        }
+        _dirtyHash();
+		mContentTypeLookupBuilt = false;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setSceneBlending(SceneBlendType sbt)
+    {
+	    // Turn predefined type into blending factors
+	    switch (sbt)
+	    {
+	    case SBT_TRANSPARENT_ALPHA:
+		    setSceneBlending(SBF_SOURCE_ALPHA, SBF_ONE_MINUS_SOURCE_ALPHA);
+		    break;
+	    case SBT_TRANSPARENT_COLOUR:
+		    setSceneBlending(SBF_SOURCE_COLOUR, SBF_ONE_MINUS_SOURCE_COLOUR);
+		    break;
+		case SBT_MODULATE:
+			setSceneBlending(SBF_DEST_COLOUR, SBF_ZERO);
+			break;
+	    case SBT_ADD:
+		    setSceneBlending(SBF_ONE, SBF_ONE);
+		    break;
+        case SBT_REPLACE:
+            setSceneBlending(SBF_ONE, SBF_ZERO);
+            break;
+	    // TODO: more
+	    }
+
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor)
+    {
+	    mSourceBlendFactor = sourceFactor;
+	    mDestBlendFactor = destFactor;
+    }
+    //-----------------------------------------------------------------------
+    SceneBlendFactor Pass::getSourceBlendFactor(void) const
+    {
+	    return mSourceBlendFactor;
+    }
+    //-----------------------------------------------------------------------
+    SceneBlendFactor Pass::getDestBlendFactor(void) const
+    {
+	    return mDestBlendFactor;
+    }
+    //-----------------------------------------------------------------------
+    bool Pass::isTransparent(void) const
+    {
+		// Transparent if any of the destination colour is taken into account
+		if (mDestBlendFactor == SBF_ZERO &&
+			mSourceBlendFactor != SBF_DEST_COLOUR &&
+			mSourceBlendFactor != SBF_ONE_MINUS_DEST_COLOUR &&
+			mSourceBlendFactor != SBF_DEST_ALPHA &&
+			mSourceBlendFactor != SBF_ONE_MINUS_DEST_ALPHA)
+		{
+		    return false;
+		}
+	    else
+		{
+		    return true;
+		}
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setDepthCheckEnabled(bool enabled)
+    {
+	    mDepthCheck = enabled;
+    }
+    //-----------------------------------------------------------------------
+    bool Pass::getDepthCheckEnabled(void) const
+    {
+	    return mDepthCheck;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setDepthWriteEnabled(bool enabled)
+    {
+	    mDepthWrite = enabled;
+    }
+    //-----------------------------------------------------------------------
+    bool Pass::getDepthWriteEnabled(void) const
+    {
+	    return mDepthWrite;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setDepthFunction( CompareFunction func)
+    {
+	    mDepthFunc = func;
+    }
+    //-----------------------------------------------------------------------
+    CompareFunction Pass::getDepthFunction(void) const
+    {
+	    return mDepthFunc;
+    }
+	//-----------------------------------------------------------------------
+	void Pass::setAlphaRejectSettings(CompareFunction func, unsigned char value)
+	{
+		mAlphaRejectFunc = func;
+		mAlphaRejectVal = value;
+	}
+	//-----------------------------------------------------------------------
+	void Pass::setAlphaRejectFunction(CompareFunction func)
+	{
+		mAlphaRejectFunc = func;
+	}
+	//-----------------------------------------------------------------------
+	void Pass::setAlphaRejectValue(unsigned char val)
+	{
+		mAlphaRejectVal = val;
+	}
+    //-----------------------------------------------------------------------
+	void Pass::setColourWriteEnabled(bool enabled)
+	{
+		mColourWrite = enabled;
+	}
+    //-----------------------------------------------------------------------
+	bool Pass::getColourWriteEnabled(void) const
+	{
+		return mColourWrite;
+	}
+    //-----------------------------------------------------------------------
+    void Pass::setCullingMode( CullingMode mode)
+    {
+	    mCullMode = mode;
+    }
+    //-----------------------------------------------------------------------
+    CullingMode Pass::getCullingMode(void) const
+    {
+	    return mCullMode;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setLightingEnabled(bool enabled)
+    {
+	    mLightingEnabled = enabled;
+    }
+    //-----------------------------------------------------------------------
+    bool Pass::getLightingEnabled(void) const
+    {
+	    return mLightingEnabled;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setMaxSimultaneousLights(unsigned short maxLights)
+    {
+        mMaxSimultaneousLights = maxLights;
+    }
+    //-----------------------------------------------------------------------
+    unsigned short Pass::getMaxSimultaneousLights(void) const
+    {
+        return mMaxSimultaneousLights;
+    }
+	//-----------------------------------------------------------------------
+	void Pass::setStartLight(unsigned short startLight)
+	{
+		mStartLight = startLight;
+	}
+	//-----------------------------------------------------------------------
+	unsigned short Pass::getStartLight(void) const
+	{
+		return mStartLight;
+	}
+	//-----------------------------------------------------------------------
+	void Pass::setLightCountPerIteration(unsigned short c)
+	{
+		mLightsPerIteration = c;
+	}
+	//-----------------------------------------------------------------------
+	unsigned short Pass::getLightCountPerIteration(void) const
+	{
+		return mLightsPerIteration;
+	}
+    //-----------------------------------------------------------------------
+    void Pass::setIteratePerLight(bool enabled,
+            bool onlyForOneLightType, Light::LightTypes lightType)
+    {
+        mIteratePerLight = enabled;
+        mRunOnlyForOneLightType = onlyForOneLightType;
+        mOnlyLightType = lightType;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setShadingMode(ShadeOptions mode)
+    {
+	    mShadeOptions = mode;
+    }
+    //-----------------------------------------------------------------------
+    ShadeOptions Pass::getShadingMode(void) const
+    {
+	    return mShadeOptions;
+    }
+	//-----------------------------------------------------------------------
+	void Pass::setPolygonMode(PolygonMode mode)
+	{
+		mPolygonMode = mode;
+	}
+	//-----------------------------------------------------------------------
+	PolygonMode Pass::getPolygonMode(void) const
+	{
+		return mPolygonMode;
+	}
+    //-----------------------------------------------------------------------
+    void Pass::setManualCullingMode(ManualCullingMode mode)
+    {
+	    mManualCullMode = mode;
+    }
+    //-----------------------------------------------------------------------
+    ManualCullingMode Pass::getManualCullingMode(void) const
+    {
+	    return mManualCullMode;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setFog(bool overrideScene, FogMode mode, const ColourValue& colour, Real density, Real start, Real end)
+    {
+	    mFogOverride = overrideScene;
+	    if (overrideScene)
+	    {
+		    mFogMode = mode;
+		    mFogColour = colour;
+		    mFogStart = start;
+		    mFogEnd = end;
+		    mFogDensity = density;
+	    }
+    }
+    //-----------------------------------------------------------------------
+    bool Pass::getFogOverride(void) const
+    {
+	    return mFogOverride;
+    }
+    //-----------------------------------------------------------------------
+    FogMode Pass::getFogMode(void) const
+    {
+	    return mFogMode;
+    }
+    //-----------------------------------------------------------------------
+    const ColourValue& Pass::getFogColour(void) const
+    {
+	    return mFogColour;
+    }
+    //-----------------------------------------------------------------------
+    Real Pass::getFogStart(void) const
+    {
+	    return mFogStart;
+    }
+    //-----------------------------------------------------------------------
+    Real Pass::getFogEnd(void) const
+    {
+	    return mFogEnd;
+    }
+    //-----------------------------------------------------------------------
+    Real Pass::getFogDensity(void) const
+    {
+	    return mFogDensity;
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setDepthBias(float constantBias, float slopeScaleBias)
+    {
+       mDepthBiasConstant = constantBias;
+	   mDepthBiasSlopeScale = slopeScaleBias;
+    }
+    //-----------------------------------------------------------------------
+    float Pass::getDepthBiasConstant(void) const
+    {
+        return mDepthBiasConstant;
+    }
+	//-----------------------------------------------------------------------
+	float Pass::getDepthBiasSlopeScale(void) const
+	{
+		return mDepthBiasSlopeScale;
+	}
+    //-----------------------------------------------------------------------
+	Pass* Pass::_split(unsigned short numUnits)
+	{
+		if (mVertexProgramUsage || mFragmentProgramUsage)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Programmable passes cannot be "
+				"automatically split, define a fallback technique instead.",
+				"Pass:_split");
+		}
+
+		if (mTextureUnitStates.size() > numUnits)
+		{
+			size_t start = mTextureUnitStates.size() - numUnits;
+
+			Pass* newPass = mParent->createPass();
+
+			TextureUnitStates::iterator istart, i, iend;
+			iend = mTextureUnitStates.end();
+			i = istart = mTextureUnitStates.begin() + start;
+			// Set the new pass to fallback using scene blend
+			newPass->setSceneBlending(
+				(*i)->getColourBlendFallbackSrc(), (*i)->getColourBlendFallbackDest());
+			// Fixup the texture unit 0   of new pass   blending method   to replace
+			// all colour and alpha   with texture without adjustment, because we
+			// assume it's detail texture.
+			(*i)->setColourOperationEx(LBX_SOURCE1,   LBS_TEXTURE, LBS_CURRENT);
+			(*i)->setAlphaOperation(LBX_SOURCE1, LBS_TEXTURE, LBS_CURRENT);
+
+			// Add all the other texture unit states
+			for (; i != iend; ++i)
+			{
+				// detach from parent first
+				(*i)->_notifyParent(0);
+				newPass->addTextureUnitState(*i);
+			}
+			// Now remove texture units from this Pass, we don't need to delete since they've
+			// been transferred
+			mTextureUnitStates.erase(istart, iend);
+			_dirtyHash();
+			mContentTypeLookupBuilt = false;
+			return newPass;
+		}
+		return NULL;
+	}
+	//-----------------------------------------------------------------------------
+	void Pass::_notifyIndex(unsigned short index)
+	{
+		if (mIndex != index)
+		{
+			mIndex = index;
+			_dirtyHash();
+		}
+	}
+    //-----------------------------------------------------------------------
+	void Pass::_load(void)
+	{
+		// We assume the Technique only calls this when the material is being
+		// loaded
+
+		// Load each TextureUnitState
+		TextureUnitStates::iterator i, iend;
+		iend = mTextureUnitStates.end();
+		for (i = mTextureUnitStates.begin(); i != iend; ++i)
+		{
+			(*i)->_load();
+		}
+
+		// Load programs
+		if (mVertexProgramUsage)
+		{
+			// Load vertex program
+            mVertexProgramUsage->_load();
+        }
+        if (mShadowCasterVertexProgramUsage)
+        {
+            // Load vertex program
+            mShadowCasterVertexProgramUsage->_load();
+        }
+        if (mShadowReceiverVertexProgramUsage)
+        {
+            // Load vertex program
+            mShadowReceiverVertexProgramUsage->_load();
+        }
+
+        if (mFragmentProgramUsage)
+        {
+			// Load fragment program
+            mFragmentProgramUsage->_load();
+		}
+		if (mShadowReceiverFragmentProgramUsage)
+		{
+			// Load Fragment program
+			mShadowReceiverFragmentProgramUsage->_load();
+		}
+
+	}
+    //-----------------------------------------------------------------------
+	void Pass::_unload(void)
+	{
+		// Unload each TextureUnitState
+		TextureUnitStates::iterator i, iend;
+		iend = mTextureUnitStates.end();
+		for (i = mTextureUnitStates.begin(); i != iend; ++i)
+		{
+			(*i)->_unload();
+		}
+
+		// Unload programs
+		if (mVertexProgramUsage)
+		{
+			// TODO
+		}
+        if (mFragmentProgramUsage)
+        {
+            // TODO
+        }
+	}
+    //-----------------------------------------------------------------------
+	void Pass::setVertexProgram(const String& name, bool resetParams)
+	{
+        // Turn off vertex program if name blank
+        if (name.empty())
+        {
+            if (mVertexProgramUsage) delete mVertexProgramUsage;
+            mVertexProgramUsage = NULL;
+        }
+        else
+        {
+            if (!mVertexProgramUsage)
+            {
+                mVertexProgramUsage = new GpuProgramUsage(GPT_VERTEX_PROGRAM);
+            }
+		    mVertexProgramUsage->setProgramName(name, resetParams);
+        }
+        // Needs recompilation
+        mParent->_notifyNeedsRecompile();
+	}
+    //-----------------------------------------------------------------------
+	void Pass::setVertexProgramParameters(GpuProgramParametersSharedPtr params)
+	{
+		if (!mVertexProgramUsage)
+        {
+            OGRE_EXCEPT (Exception::ERR_INVALIDPARAMS,
+                "This pass does not have a vertex program assigned!",
+                "Pass::setVertexProgramParameters");
+        }
+		mVertexProgramUsage->setParameters(params);
+	}
+    //-----------------------------------------------------------------------
+	void Pass::setFragmentProgram(const String& name, bool resetParams)
+	{
+        // Turn off fragment program if name blank
+        if (name.empty())
+        {
+            if (mFragmentProgramUsage) delete mFragmentProgramUsage;
+            mFragmentProgramUsage = NULL;
+        }
+        else
+        {
+            if (!mFragmentProgramUsage)
+            {
+                mFragmentProgramUsage = new GpuProgramUsage(GPT_FRAGMENT_PROGRAM);
+            }
+		    mFragmentProgramUsage->setProgramName(name, resetParams);
+        }
+        // Needs recompilation
+        mParent->_notifyNeedsRecompile();
+	}
+    //-----------------------------------------------------------------------
+	void Pass::setFragmentProgramParameters(GpuProgramParametersSharedPtr params)
+	{
+		if (!mFragmentProgramUsage)
+        {
+            OGRE_EXCEPT (Exception::ERR_INVALIDPARAMS,
+                "This pass does not have a fragment program assigned!",
+                "Pass::setFragmentProgramParameters");
+        }
+		mFragmentProgramUsage->setParameters(params);
+	}
+	//-----------------------------------------------------------------------
+	const String& Pass::getVertexProgramName(void) const
+	{
+        if (!mVertexProgramUsage)
+            return StringUtil::BLANK;
+        else
+		    return mVertexProgramUsage->getProgramName();
+	}
+	//-----------------------------------------------------------------------
+	GpuProgramParametersSharedPtr Pass::getVertexProgramParameters(void) const
+	{
+		if (!mVertexProgramUsage)
+        {
+            OGRE_EXCEPT (Exception::ERR_INVALIDPARAMS,
+                "This pass does not have a vertex program assigned!",
+                "Pass::getVertexProgramParameters");
+        }
+		return mVertexProgramUsage->getParameters();
+	}
+	//-----------------------------------------------------------------------
+	const GpuProgramPtr& Pass::getVertexProgram(void) const
+	{
+		return mVertexProgramUsage->getProgram();
+	}
+	//-----------------------------------------------------------------------
+	const String& Pass::getFragmentProgramName(void) const
+	{
+        if (!mFragmentProgramUsage)
+            return StringUtil::BLANK;
+        else
+    		return mFragmentProgramUsage->getProgramName();
+	}
+	//-----------------------------------------------------------------------
+	GpuProgramParametersSharedPtr Pass::getFragmentProgramParameters(void) const
+	{
+		return mFragmentProgramUsage->getParameters();
+	}
+	//-----------------------------------------------------------------------
+	const GpuProgramPtr& Pass::getFragmentProgram(void) const
+	{
+		return mFragmentProgramUsage->getProgram();
+	}
+	//-----------------------------------------------------------------------
+    bool Pass::isLoaded(void) const
+    {
+        return mParent->isLoaded();
+    }
+	//-----------------------------------------------------------------------
+    void Pass::_recalculateHash(void)
+    {
+        /* Hash format is 32-bit, divided as follows (high to low bits)
+           bits   purpose
+            4     Pass index (i.e. max 16 passes!)
+           14     Hashed texture name from unit 0
+           14     Hashed texture name from unit 1
+
+           Note that at the moment we don't sort on the 3rd texture unit plus
+           on the assumption that these are less frequently used; sorting on
+           the first 2 gives us the most benefit for now.
+       */
+        mHash = (*msHashFunc)(this);
+    }
+    //-----------------------------------------------------------------------
+	void Pass::_dirtyHash(void)
+	{
+		OGRE_LOCK_MUTEX(msDirtyHashListMutex)
+		// Mark this hash as for follow up
+		msDirtyHashList.insert(this);
+	}
+	//---------------------------------------------------------------------
+	void Pass::clearDirtyHashList(void) 
+	{ 
+		OGRE_LOCK_MUTEX(msDirtyHashListMutex)
+		msDirtyHashList.clear(); 
+	}
+    //-----------------------------------------------------------------------
+    void Pass::_notifyNeedsRecompile(void)
+    {
+        mParent->_notifyNeedsRecompile();
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setTextureFiltering(TextureFilterOptions filterType)
+    {
+        TextureUnitStates::iterator i, iend;
+        iend = mTextureUnitStates.end();
+        for (i = mTextureUnitStates.begin(); i != iend; ++i)
+        {
+            (*i)->setTextureFiltering(filterType);
+        }
+    }
+    // --------------------------------------------------------------------
+    void Pass::setTextureAnisotropy(unsigned int maxAniso)
+    {
+        TextureUnitStates::iterator i, iend;
+        iend = mTextureUnitStates.end();
+        for (i = mTextureUnitStates.begin(); i != iend; ++i)
+        {
+            (*i)->setTextureAnisotropy(maxAniso);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Pass::_updateAutoParamsNoLights(const AutoParamDataSource& source) const
+    {
+        if (hasVertexProgram())
+        {
+            // Update vertex program auto params
+            mVertexProgramUsage->getParameters()->_updateAutoParamsNoLights(source);
+        }
+
+        if (hasFragmentProgram())
+        {
+            // Update fragment program auto params
+            mFragmentProgramUsage->getParameters()->_updateAutoParamsNoLights(source);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Pass::_updateAutoParamsLightsOnly(const AutoParamDataSource& source) const
+    {
+        if (hasVertexProgram())
+        {
+            // Update vertex program auto params
+            mVertexProgramUsage->getParameters()->_updateAutoParamsLightsOnly(source);
+        }
+
+        if (hasFragmentProgram())
+        {
+            // Update fragment program auto params
+            mFragmentProgramUsage->getParameters()->_updateAutoParamsLightsOnly(source);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Pass::processPendingPassUpdates(void)
+    {
+		{
+			OGRE_LOCK_MUTEX(msPassGraveyardMutex)
+			// Delete items in the graveyard
+			PassSet::iterator i, iend;
+			iend = msPassGraveyard.end();
+			for (i = msPassGraveyard.begin(); i != iend; ++i)
+			{
+				delete *i;
+			}
+			msPassGraveyard.clear();
+		}
+
+		{
+			OGRE_LOCK_MUTEX(msDirtyHashListMutex)
+			PassSet::iterator i, iend;
+			// The dirty ones will have been removed from the groups above using the old hash now
+			iend = msDirtyHashList.end();
+			for (i = msDirtyHashList.begin(); i != iend; ++i)
+			{
+				Pass* p = *i;
+				p->_recalculateHash();
+			}
+			// Clear the dirty list
+			msDirtyHashList.clear();
+		}
+    }
+    //-----------------------------------------------------------------------
+    void Pass::queueForDeletion(void)
+    {
+        mQueuedForDeletion = true;
+
+        removeAllTextureUnitStates();
+        if (mVertexProgramUsage)
+        {
+            delete mVertexProgramUsage;
+            mVertexProgramUsage = 0;
+        }
+        if (mShadowCasterVertexProgramUsage)
+        {
+            delete mShadowCasterVertexProgramUsage;
+            mShadowCasterVertexProgramUsage = 0;
+        }
+        if (mShadowReceiverVertexProgramUsage)
+        {
+            delete mShadowReceiverVertexProgramUsage;
+            mShadowReceiverVertexProgramUsage = 0;
+        }
+        if (mFragmentProgramUsage)
+        {
+            delete mFragmentProgramUsage;
+            mFragmentProgramUsage = 0;
+        }
+		if (mShadowReceiverFragmentProgramUsage)
+		{
+			delete mShadowReceiverFragmentProgramUsage;
+			mShadowReceiverFragmentProgramUsage = 0;
+		}
+        // remove from dirty list, if there
+		{
+			OGRE_LOCK_MUTEX(msDirtyHashListMutex)
+			msDirtyHashList.erase(this);
+		}
+		{
+			OGRE_LOCK_MUTEX(msPassGraveyardMutex)
+			msPassGraveyard.insert(this);
+		}
+    }
+    //-----------------------------------------------------------------------
+    bool Pass::isAmbientOnly(void) const
+    {
+        // treat as ambient if lighting is off, or colour write is off,
+        // or all non-ambient (& emissive) colours are black
+        // NB a vertex program could override this, but passes using vertex
+        // programs are expected to indicate they are ambient only by
+        // setting the state so it matches one of the conditions above, even
+        // though this state is not used in rendering.
+        return (!mLightingEnabled || !mColourWrite ||
+            (mDiffuse == ColourValue::Black &&
+             mSpecular == ColourValue::Black));
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setShadowCasterVertexProgram(const String& name)
+    {
+        // Turn off vertex program if name blank
+        if (name.empty())
+        {
+            if (mShadowCasterVertexProgramUsage) delete mShadowCasterVertexProgramUsage;
+            mShadowCasterVertexProgramUsage = NULL;
+        }
+        else
+        {
+            if (!mShadowCasterVertexProgramUsage)
+            {
+                mShadowCasterVertexProgramUsage = new GpuProgramUsage(GPT_VERTEX_PROGRAM);
+            }
+            mShadowCasterVertexProgramUsage->setProgramName(name);
+        }
+        // Needs recompilation
+        mParent->_notifyNeedsRecompile();
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setShadowCasterVertexProgramParameters(GpuProgramParametersSharedPtr params)
+    {
+        if (!mShadowCasterVertexProgramUsage)
+        {
+            OGRE_EXCEPT (Exception::ERR_INVALIDPARAMS,
+                "This pass does not have a shadow caster vertex program assigned!",
+                "Pass::setShadowCasterVertexProgramParameters");
+        }
+        mShadowCasterVertexProgramUsage->setParameters(params);
+    }
+    //-----------------------------------------------------------------------
+    const String& Pass::getShadowCasterVertexProgramName(void) const
+    {
+        if (!mShadowCasterVertexProgramUsage)
+            return StringUtil::BLANK;
+        else
+            return mShadowCasterVertexProgramUsage->getProgramName();
+    }
+    //-----------------------------------------------------------------------
+    GpuProgramParametersSharedPtr Pass::getShadowCasterVertexProgramParameters(void) const
+    {
+        if (!mShadowCasterVertexProgramUsage)
+        {
+            OGRE_EXCEPT (Exception::ERR_INVALIDPARAMS,
+                "This pass does not have a shadow caster vertex program assigned!",
+                "Pass::getShadowCasterVertexProgramParameters");
+        }
+        return mShadowCasterVertexProgramUsage->getParameters();
+    }
+    //-----------------------------------------------------------------------
+    const GpuProgramPtr& Pass::getShadowCasterVertexProgram(void) const
+    {
+        return mShadowCasterVertexProgramUsage->getProgram();
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setShadowReceiverVertexProgram(const String& name)
+    {
+        // Turn off vertex program if name blank
+        if (name.empty())
+        {
+            if (mShadowReceiverVertexProgramUsage) delete mShadowReceiverVertexProgramUsage;
+            mShadowReceiverVertexProgramUsage = NULL;
+        }
+        else
+        {
+            if (!mShadowReceiverVertexProgramUsage)
+            {
+                mShadowReceiverVertexProgramUsage = new GpuProgramUsage(GPT_VERTEX_PROGRAM);
+            }
+            mShadowReceiverVertexProgramUsage->setProgramName(name);
+        }
+        // Needs recompilation
+        mParent->_notifyNeedsRecompile();
+    }
+    //-----------------------------------------------------------------------
+    void Pass::setShadowReceiverVertexProgramParameters(GpuProgramParametersSharedPtr params)
+    {
+        if (!mShadowReceiverVertexProgramUsage)
+        {
+            OGRE_EXCEPT (Exception::ERR_INVALIDPARAMS,
+                "This pass does not have a shadow receiver vertex program assigned!",
+                "Pass::setShadowReceiverVertexProgramParameters");
+        }
+        mShadowReceiverVertexProgramUsage->setParameters(params);
+    }
+    //-----------------------------------------------------------------------
+    const String& Pass::getShadowReceiverVertexProgramName(void) const
+    {
+        if (!mShadowReceiverVertexProgramUsage)
+            return StringUtil::BLANK;
+        else
+            return mShadowReceiverVertexProgramUsage->getProgramName();
+    }
+    //-----------------------------------------------------------------------
+    GpuProgramParametersSharedPtr Pass::getShadowReceiverVertexProgramParameters(void) const
+    {
+        if (!mShadowReceiverVertexProgramUsage)
+        {
+            OGRE_EXCEPT (Exception::ERR_INVALIDPARAMS,
+                "This pass does not have a shadow receiver vertex program assigned!",
+                "Pass::getShadowReceiverVertexProgramParameters");
+        }
+        return mShadowReceiverVertexProgramUsage->getParameters();
+    }
+    //-----------------------------------------------------------------------
+    const GpuProgramPtr& Pass::getShadowReceiverVertexProgram(void) const
+    {
+        return mShadowReceiverVertexProgramUsage->getProgram();
+    }
+	//-----------------------------------------------------------------------
+	void Pass::setShadowReceiverFragmentProgram(const String& name)
+	{
+		// Turn off Fragment program if name blank
+		if (name.empty())
+		{
+			if (mShadowReceiverFragmentProgramUsage) delete mShadowReceiverFragmentProgramUsage;
+			mShadowReceiverFragmentProgramUsage = NULL;
+		}
+		else
+		{
+			if (!mShadowReceiverFragmentProgramUsage)
+			{
+				mShadowReceiverFragmentProgramUsage = new GpuProgramUsage(GPT_FRAGMENT_PROGRAM);
+			}
+			mShadowReceiverFragmentProgramUsage->setProgramName(name);
+		}
+		// Needs recompilation
+		mParent->_notifyNeedsRecompile();
+	}
+	//-----------------------------------------------------------------------
+	void Pass::setShadowReceiverFragmentProgramParameters(GpuProgramParametersSharedPtr params)
+	{
+		if (!mShadowReceiverFragmentProgramUsage)
+		{
+			OGRE_EXCEPT (Exception::ERR_INVALIDPARAMS,
+				"This pass does not have a shadow receiver fragment program assigned!",
+				"Pass::setShadowReceiverFragmentProgramParameters");
+		}
+		mShadowReceiverFragmentProgramUsage->setParameters(params);
+	}
+	//-----------------------------------------------------------------------
+	const String& Pass::getShadowReceiverFragmentProgramName(void) const
+	{
+		if (!mShadowReceiverFragmentProgramUsage)
+			return StringUtil::BLANK;
+		else
+			return mShadowReceiverFragmentProgramUsage->getProgramName();
+	}
+	//-----------------------------------------------------------------------
+	GpuProgramParametersSharedPtr Pass::getShadowReceiverFragmentProgramParameters(void) const
+	{
+		if (!mShadowReceiverFragmentProgramUsage)
+		{
+			OGRE_EXCEPT (Exception::ERR_INVALIDPARAMS,
+				"This pass does not have a shadow receiver fragment program assigned!",
+				"Pass::getShadowReceiverFragmentProgramParameters");
+		}
+		return mShadowReceiverFragmentProgramUsage->getParameters();
+	}
+	//-----------------------------------------------------------------------
+	const GpuProgramPtr& Pass::getShadowReceiverFragmentProgram(void) const
+	{
+		return mShadowReceiverFragmentProgramUsage->getProgram();
+	}
+    //-----------------------------------------------------------------------
+	const String& Pass::getResourceGroup(void) const
+	{
+		return mParent->getResourceGroup();
+	}
+
+    //-----------------------------------------------------------------------
+    bool Pass::applyTextureAliases(const AliasTextureNamePairList& aliasList, const bool apply) const
+    {
+        // iterate through each texture unit state and apply the texture alias if it applies
+        TextureUnitStates::const_iterator i, iend;
+        iend = mTextureUnitStates.end();
+        bool testResult = false;
+
+        for (i = mTextureUnitStates.begin(); i != iend; ++i)
+        {
+            if ((*i)->applyTextureAliases(aliasList, apply))
+                testResult = true;
+        }
+
+        return testResult;
+
+    }
+	//-----------------------------------------------------------------------
+	unsigned short Pass::_getTextureUnitWithContentTypeIndex(
+		TextureUnitState::ContentType contentType, unsigned short index) const
+	{
+		if (!mContentTypeLookupBuilt)
+		{
+			mShadowContentTypeLookup.clear();
+			for (unsigned short i = 0; i < mTextureUnitStates.size(); ++i)
+			{
+				if (mTextureUnitStates[i]->getContentType() == TextureUnitState::CONTENT_SHADOW)
+				{
+					mShadowContentTypeLookup.push_back(i);
+				}
+			}
+			mContentTypeLookupBuilt = true;
+		}
+
+		switch(contentType)
+		{
+		case TextureUnitState::CONTENT_SHADOW:
+			if (index < mShadowContentTypeLookup.size())
+			{
+				return mShadowContentTypeLookup[index];
+			}
+			break;
+		default:
+			// Simple iteration
+			for (unsigned short i = 0; i < mTextureUnitStates.size(); ++i)
+			{
+				if (mTextureUnitStates[i]->getContentType() == TextureUnitState::CONTENT_SHADOW)
+				{
+					if (index == 0)
+					{
+						return i;
+					}
+					else
+					{
+						--index;
+					}
+				}
+			}
+			break;
+		}
+
+		// not found - return out of range
+		return static_cast<unsigned short>(mTextureUnitStates.size() + 1);
+
+	}
+
+
+}
Index: /OgreMain/src/OgrePatchMesh.cpp
===================================================================
--- /OgreMain/src/OgrePatchMesh.cpp	(revision 5)
+++ /OgreMain/src/OgrePatchMesh.cpp	(revision 5)
@@ -0,0 +1,111 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgrePatchMesh.h"
+#include "OgreSubMesh.h"
+#include "OgreHardwareBufferManager.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    PatchMesh::PatchMesh(ResourceManager* creator, const String& name, ResourceHandle handle,
+        const String& group)
+        : Mesh(creator, name, handle, group, false, 0)
+    {
+    }
+    //-----------------------------------------------------------------------
+    void PatchMesh::define(void* controlPointBuffer, 
+            VertexDeclaration *declaration, size_t width, size_t height,
+            size_t uMaxSubdivisionLevel, size_t vMaxSubdivisionLevel,
+            PatchSurface::VisibleSide visibleSide, HardwareBuffer::Usage vbUsage, 
+            HardwareBuffer::Usage ibUsage,
+            bool vbUseShadow, bool ibUseShadow) 
+    {
+        mVertexBufferUsage = vbUsage;
+        mVertexBufferShadowBuffer = vbUseShadow;
+        mIndexBufferUsage = ibUsage;
+        mIndexBufferShadowBuffer = ibUseShadow;
+
+        // Init patch builder
+        // define the surface
+        // NB clone the declaration to make it independent
+        mDeclaration = declaration->clone();
+        mSurface.defineSurface(controlPointBuffer, mDeclaration, width, height, 
+            PatchSurface::PST_BEZIER, uMaxSubdivisionLevel, vMaxSubdivisionLevel, 
+            visibleSide);
+
+    }
+    //-----------------------------------------------------------------------
+    void PatchMesh::setSubdivision(Real factor)
+    {
+        mSurface.setSubdivisionFactor(factor);
+        SubMesh* sm = this->getSubMesh(0);
+        sm->indexData->indexCount = mSurface.getCurrentIndexCount();
+        
+    }
+    //-----------------------------------------------------------------------
+    void PatchMesh::loadImpl(void)
+    {
+        SubMesh* sm = this->createSubMesh();
+        sm->vertexData = new VertexData();
+        sm->useSharedVertices = false;
+
+        // Set up vertex buffer
+        sm->vertexData->vertexStart = 0;
+        sm->vertexData->vertexCount = mSurface.getRequiredVertexCount();
+        sm->vertexData->vertexDeclaration = mDeclaration;
+        HardwareVertexBufferSharedPtr vbuf = HardwareBufferManager::getSingleton().
+            createVertexBuffer(
+                mDeclaration->getVertexSize(0), 
+                sm->vertexData->vertexCount, 
+                mVertexBufferUsage, 
+                mVertexBufferShadowBuffer);
+        sm->vertexData->vertexBufferBinding->setBinding(0, vbuf);
+
+        // Set up index buffer
+        sm->indexData->indexStart = 0;
+        sm->indexData->indexCount = mSurface.getRequiredIndexCount();
+        sm->indexData->indexBuffer = HardwareBufferManager::getSingleton().
+            createIndexBuffer(
+                HardwareIndexBuffer::IT_16BIT, // only 16-bit indexes supported, patches shouldn't be bigger than that
+                sm->indexData->indexCount,
+                mIndexBufferUsage, 
+                mIndexBufferShadowBuffer);
+        
+        // Build patch
+        mSurface.build(vbuf, 0, sm->indexData->indexBuffer, 0);
+
+        // Set bounds
+        this->_setBounds(mSurface.getBounds(), true);
+        this->_setBoundingSphereRadius(mSurface.getBoundingSphereRadius());
+
+    }
+
+}
+
Index: /OgreMain/src/OgrePatchSurface.cpp
===================================================================
--- /OgreMain/src/OgrePatchSurface.cpp	(revision 5)
+++ /OgreMain/src/OgrePatchSurface.cpp	(revision 5)
@@ -0,0 +1,714 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgrePatchSurface.h"
+
+#include "OgreMeshManager.h"
+#include "OgreMesh.h"
+#include "OgreSubMesh.h"
+#include "OgreException.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreHardwareIndexBuffer.h"
+
+#define LEVEL_WIDTH(lvl) ((1 << (lvl+1)) + 1)
+
+namespace Ogre {
+
+    // TODO: make this deal with specular colours and more than 2 texture coords
+
+    //-----------------------------------------------------------------------
+    PatchSurface::PatchSurface()
+    {
+        mType = PST_BEZIER;
+    }
+    //-----------------------------------------------------------------------
+    PatchSurface::~PatchSurface()
+    {
+    }
+    //-----------------------------------------------------------------------
+    void PatchSurface::defineSurface(void* controlPointBuffer, 
+            VertexDeclaration *declaration, size_t width, size_t height,
+            PatchSurfaceType pType, size_t uMaxSubdivisionLevel, 
+            size_t vMaxSubdivisionLevel, VisibleSide visibleSide)
+    {
+        if (height == 0 || width == 0)
+            return; // Do nothing - garbage
+
+        mType = pType;
+        mCtlWidth = width;
+        mCtlHeight = height;
+        mCtlCount = width * height;
+        mControlPointBuffer = controlPointBuffer;
+        mDeclaration = declaration;
+
+        // Copy positions into Vector3 vector
+        mVecCtlPoints.clear();
+        const VertexElement* elem = declaration->findElementBySemantic(VES_POSITION);
+        size_t vertSize = declaration->getVertexSize(0);
+        const unsigned char *pVert = static_cast<const unsigned char*>(controlPointBuffer);
+        float* pFloat;
+        for (size_t i = 0; i < mCtlCount; ++i)
+        {
+            elem->baseVertexPointerToElement((void*)pVert, &pFloat);
+            mVecCtlPoints.push_back(Vector3(pFloat[0], pFloat[1], pFloat[2]));
+            pVert += vertSize;
+        }
+
+        mVSide = visibleSide;
+
+        // Determine max level
+        // Initialise to 100% detail
+        mSubdivisionFactor = 1.0f;
+        if (uMaxSubdivisionLevel == AUTO_LEVEL)
+        {
+            mULevel = mMaxULevel = getAutoULevel();
+        }
+        else
+        {
+            mULevel = mMaxULevel = uMaxSubdivisionLevel;
+        }
+
+        if (vMaxSubdivisionLevel == AUTO_LEVEL)
+        {
+            mVLevel = mMaxVLevel = getAutoVLevel();
+        }
+        else
+        {
+            mVLevel = mMaxVLevel = vMaxSubdivisionLevel;
+        }
+
+
+
+        // Derive mesh width / height
+        mMeshWidth  = (LEVEL_WIDTH(mMaxULevel)-1) * ((mCtlWidth-1)/2) + 1;
+        mMeshHeight = (LEVEL_WIDTH(mMaxVLevel)-1) * ((mCtlHeight-1)/2) + 1;
+
+
+        // Calculate number of required vertices / indexes at max resolution
+        mRequiredVertexCount = mMeshWidth * mMeshHeight;
+        int iterations = (mVSide == VS_BOTH)? 2 : 1;
+        mRequiredIndexCount = (mMeshWidth-1) * (mMeshHeight-1) * 2 * iterations * 3;
+
+        // Calculate bounds based on control points
+        std::vector<Vector3>::const_iterator ctli;
+        Vector3 min, max;
+        Real maxSqRadius;
+        bool first = true;
+        for (ctli = mVecCtlPoints.begin(); ctli != mVecCtlPoints.end(); ++ctli)
+        {
+            if (first)
+            {
+                min = max = *ctli;
+                maxSqRadius = ctli->squaredLength();
+                first = false;
+            }
+            else
+            {
+                min.makeFloor(*ctli);
+                max.makeCeil(*ctli);
+                maxSqRadius = std::max(ctli->squaredLength(), maxSqRadius);
+
+            }
+        }
+        mAABB.setExtents(min, max);
+        mBoundingSphere = Math::Sqrt(maxSqRadius);
+
+    }
+    //-----------------------------------------------------------------------
+    const AxisAlignedBox& PatchSurface::getBounds(void) const
+    {
+        return mAABB;
+    }
+    //-----------------------------------------------------------------------
+    Real PatchSurface::getBoundingSphereRadius(void) const
+    {
+        return mBoundingSphere;
+    }
+    //-----------------------------------------------------------------------
+    size_t PatchSurface::getRequiredVertexCount(void) const
+    {
+        return mRequiredVertexCount;
+    }
+    //-----------------------------------------------------------------------
+    size_t PatchSurface::getRequiredIndexCount(void) const
+    {
+        return mRequiredIndexCount;
+    }
+    //-----------------------------------------------------------------------
+    void PatchSurface::build(HardwareVertexBufferSharedPtr destVertexBuffer, 
+        size_t vertexStart, HardwareIndexBufferSharedPtr destIndexBuffer, size_t indexStart)
+    {
+
+        if (mVecCtlPoints.empty())
+            return;
+
+        mVertexBuffer = destVertexBuffer;
+        mVertexOffset = vertexStart;
+        mIndexBuffer = destIndexBuffer;
+        mIndexOffset = indexStart;
+
+        // Lock just the region we are interested in 
+        void* lockedBuffer = mVertexBuffer->lock(
+            mVertexOffset * mDeclaration->getVertexSize(0), 
+            mRequiredVertexCount * mDeclaration->getVertexSize(0),
+            HardwareBuffer::HBL_NO_OVERWRITE);
+
+        distributeControlPoints(lockedBuffer);
+
+        // Subdivide the curve to the MAX :)
+        // Do u direction first, so need to step over v levels not done yet
+        size_t vStep = 1 << mMaxVLevel;
+        size_t uStep = 1 << mMaxULevel;
+
+        size_t v, u;
+        for (v = 0; v < mMeshHeight; v += vStep)
+        {
+            // subdivide this row in u
+            subdivideCurve(lockedBuffer, v*mMeshWidth, uStep, mMeshWidth / uStep, mULevel);
+        }
+
+        // Now subdivide in v direction, this time all the u direction points are there so no step
+        for (u = 0; u < mMeshWidth; ++u)
+        {
+            subdivideCurve(lockedBuffer, u, vStep*mMeshWidth, mMeshHeight / vStep, mVLevel);
+        }
+        
+
+        mVertexBuffer->unlock();
+
+        // Make triangles from mesh at this current level of detail
+        makeTriangles();
+
+    }
+    //-----------------------------------------------------------------------
+    size_t PatchSurface::getAutoULevel(bool forMax)
+    {
+        // determine levels
+        // Derived from work by Bart Sekura in Rogl
+        Vector3 a,b,c;
+        size_t u,v;
+        bool found=false;
+        // Find u level
+        for(v = 0; v < mCtlHeight; v++) {
+            for(u = 0; u < mCtlWidth-1; u += 2) {
+                a = mVecCtlPoints[v * mCtlWidth + u];
+                b = mVecCtlPoints[v * mCtlWidth + u+1];
+                c = mVecCtlPoints[v * mCtlWidth + u+2];
+                if(a!=c) {
+                    found=true;
+                    break;
+                }
+            }
+            if(found) break;
+        }
+        if(!found) {
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Can't find suitable control points for determining U subdivision level",
+                "PatchSurface::getAutoULevel");
+        }
+
+        return findLevel(a,b,c);
+
+    }
+    //-----------------------------------------------------------------------
+    size_t PatchSurface::getAutoVLevel(bool forMax)
+    {
+        Vector3 a,b,c;
+        size_t u,v;
+        bool found=false;
+        for(u = 0; u < mCtlWidth; u++) {
+            for(v = 0; v < mCtlHeight-1; v += 2) {
+                a = mVecCtlPoints[v * mCtlWidth + u];
+                b = mVecCtlPoints[(v+1) * mCtlWidth + u];
+                c = mVecCtlPoints[(v+2) * mCtlWidth + u];
+                if(a!=c) {
+                    found=true;
+                    break;
+                }
+            }
+            if(found) break;
+        }
+        if(!found) {
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Can't find suitable control points for determining V subdivision level",
+                "PatchSurface::getAutoVLevel");
+        }
+
+        return findLevel(a,b,c);
+
+    }
+    //-----------------------------------------------------------------------
+    void PatchSurface::setSubdivisionFactor(Real factor)
+    {
+        assert(factor >= 0.0f && factor <= 1.0f);
+
+        mSubdivisionFactor = factor;
+        mULevel = static_cast<size_t>(factor * mMaxULevel);
+        mVLevel = static_cast<size_t>(factor * mMaxVLevel);
+
+        makeTriangles();
+
+
+    }
+    //-----------------------------------------------------------------------
+    Real PatchSurface::getSubdivisionFactor(void) const
+    {
+        return mSubdivisionFactor;
+    }
+    //-----------------------------------------------------------------------
+    size_t PatchSurface::getCurrentIndexCount(void) const
+    {
+        return mCurrIndexCount;
+    }
+    //-----------------------------------------------------------------------
+    size_t PatchSurface::findLevel(Vector3& a, Vector3& b, Vector3& c)
+    {
+        // Derived from work by Bart Sekura in rogl
+        // Apart from I think I fixed a bug - see below
+        // I also commented the code, the only thing wrong with rogl is almost no comments!!
+
+        const size_t max_levels = 5;
+        const float subdiv = 10;
+        size_t level;
+
+        float test=subdiv*subdiv;
+        Vector3 s,t,d;
+        for(level=0; level<max_levels-1; level++)
+        {
+            // Subdivide the 2 lines
+            s = a.midPoint(b);
+            t = b.midPoint(c);
+            // Find the midpoint between the 2 midpoints
+            c = s.midPoint(t);
+            // Get the vector between this subdivided midpoint and the middle point of the original line
+            d = c - b;
+            // Find the squared length, and break when small enough
+            if(d.dotProduct(d) < test) {
+                break;
+            }
+            b=a; 
+        }
+
+        return level;
+
+    }
+
+    /*
+    //-----------------------------------------------------------------------
+    void PatchSurface::allocateMemory(void)
+    {
+        if (mMemoryAllocated)
+            deallocateMemory();
+
+        // Allocate to the size of max level
+
+        // Create mesh
+        mMesh = MeshManager::getSingleton().createManual(mMeshName);
+        mMesh->sharedVertexData = new VertexData();
+        // Copy all vertex parameters
+        mMesh->sharedVertexData->vertexStart = 0;
+        // Vertex count will be set on build() because it depends on current level
+        // NB clone the declaration because Mesh's VertexData will destroy it
+        mMesh->sharedVertexData->vertexDeclaration = mDeclaration->clone();
+        // Create buffer (only a single buffer)
+        // Allocate enough buffer memory for maximum subdivision, not current subdivision
+        HardwareVertexBufferSharedPtr vbuf = HardwareBufferManager::getSingleton().
+            createVertexBuffer(
+                mDeclaration->getVertexSize(0), 
+                mMaxMeshHeight * mMaxMeshWidth, // maximum size 
+                HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY); // dynamic for changing level
+
+        // Set binding
+        mMesh->sharedVertexData->vertexBufferBinding->setBinding(0, vbuf);
+
+        SubMesh* sm = mMesh->createSubMesh();
+        // Allocate enough index data for max subdivision
+        sm->indexData->indexStart = 0;
+        // Index count will be set on build()
+        unsigned short iterations = (mVSide == VS_BOTH ? 2 : 1);
+        sm->indexData->indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+            HardwareIndexBuffer::IT_16BIT, 
+            (mMaxMeshWidth-1) * (mMaxMeshHeight-1) * 2 * iterations * 3,  
+            HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY);
+
+        mMesh->load();
+
+        // Derive bounds from control points, cannot stray outside that
+        Vector3 min, max;
+        Real maxSquaredRadius;
+        bool first = true;
+        std::vector<Vector3>::iterator i, iend;
+        iend = mVecCtlPoints.end();
+        for (i = mVecCtlPoints.begin(); i != iend; ++i)
+        {
+            if (first)
+            {
+                min = max = *i;
+                maxSquaredRadius = i->squaredLength();
+            }
+            else
+            {
+                min.makeFloor(*i);
+                max.makeCeil(*i);
+                maxSquaredRadius = std::max(maxSquaredRadius, i->squaredLength());
+            }
+
+        }
+        mMesh->_setBounds(AxisAlignedBox(min, max));
+        mMesh->_setBoundingSphereRadius(Math::Sqrt(maxSquaredRadius));
+
+
+
+    }
+    */
+    //-----------------------------------------------------------------------
+    void PatchSurface::distributeControlPoints(void* lockedBuffer)
+    {
+        // Insert original control points into expanded mesh
+        size_t uStep = 1 << mULevel;
+        size_t vStep = 1 << mVLevel;
+
+
+        void* pSrc = mControlPointBuffer;
+        size_t vertexSize = mDeclaration->getVertexSize(0);
+        float *pSrcReal, *pDestReal;
+        RGBA *pSrcRGBA, *pDestRGBA;
+        void* pDest;
+        const VertexElement* elemPos = mDeclaration->findElementBySemantic(VES_POSITION);
+        const VertexElement* elemNorm = mDeclaration->findElementBySemantic(VES_NORMAL);
+        const VertexElement* elemTex0 = mDeclaration->findElementBySemantic(VES_TEXTURE_COORDINATES, 0);
+        const VertexElement* elemTex1 = mDeclaration->findElementBySemantic(VES_TEXTURE_COORDINATES, 1);
+        const VertexElement* elemDiffuse = mDeclaration->findElementBySemantic(VES_DIFFUSE);
+        for (size_t v = 0; v < mMeshHeight; v += vStep)
+        {
+            // set dest by v from base
+            pDest = static_cast<void*>(
+                static_cast<unsigned char*>(lockedBuffer) + (vertexSize * mMeshWidth * v));
+            for (size_t u = 0; u < mMeshWidth; u += uStep)
+            {
+
+                // Copy Position
+                elemPos->baseVertexPointerToElement(pSrc, &pSrcReal);
+                elemPos->baseVertexPointerToElement(pDest, &pDestReal);
+                *pDestReal++ = *pSrcReal++;
+                *pDestReal++ = *pSrcReal++;
+                *pDestReal++ = *pSrcReal++;
+
+                // Copy Normals
+                if (elemNorm)
+                {
+                    elemNorm->baseVertexPointerToElement(pSrc, &pSrcReal);
+                    elemNorm->baseVertexPointerToElement(pDest, &pDestReal);
+                    *pDestReal++ = *pSrcReal++;
+                    *pDestReal++ = *pSrcReal++;
+                    *pDestReal++ = *pSrcReal++;
+                }
+
+                // Copy Diffuse
+                if (elemDiffuse)
+                {
+                    elemDiffuse->baseVertexPointerToElement(pSrc, &pSrcRGBA);
+                    elemDiffuse->baseVertexPointerToElement(pDest, &pDestRGBA);
+                    *pDestRGBA++ = *pSrcRGBA++;
+                }
+
+                // Copy texture coords
+                if (elemTex0)
+                {
+                    elemTex0->baseVertexPointerToElement(pSrc, &pSrcReal);
+                    elemTex0->baseVertexPointerToElement(pDest, &pDestReal);
+                    for (size_t dim = 0; dim < VertexElement::getTypeCount(elemTex0->getType()); ++dim)
+                        *pDestReal++ = *pSrcReal++;
+                }
+                if (elemTex1)
+                {
+                    elemTex1->baseVertexPointerToElement(pSrc, &pSrcReal);
+                    elemTex1->baseVertexPointerToElement(pDest, &pDestReal);
+                    for (size_t dim = 0; dim < VertexElement::getTypeCount(elemTex1->getType()); ++dim)
+                        *pDestReal++ = *pSrcReal++;
+                }
+
+                // Increment source by one vertex
+                pSrc = static_cast<void*>(
+                    static_cast<unsigned char*>(pSrc) + vertexSize);
+                // Increment dest by 1 vertex * uStep
+                pDest = static_cast<void*>(
+                    static_cast<unsigned char*>(pDest) + (vertexSize * uStep));
+            } // u
+        } // v
+
+       
+    }
+    //-----------------------------------------------------------------------
+    void PatchSurface::subdivideCurve(void* lockedBuffer, size_t startIdx, size_t stepSize, size_t numSteps, size_t iterations)
+    {
+        // Subdivides a curve within a sparsely populated buffer (gaps are already there to be interpolated into)
+        size_t leftIdx, rightIdx, destIdx, halfStep, maxIdx;
+        bool firstSegment;
+
+        maxIdx = startIdx + (numSteps * stepSize);
+        size_t step = stepSize;
+
+        while(iterations--)
+        {
+            halfStep = step / 2;
+            leftIdx = startIdx;
+            destIdx = leftIdx + halfStep;
+            rightIdx = leftIdx + step;
+            firstSegment = true;
+            while (leftIdx < maxIdx)
+            {
+                // Interpolate
+                interpolateVertexData(lockedBuffer, leftIdx, rightIdx, destIdx);
+
+                // If 2nd or more segment, interpolate current left between current and last mid points
+                if (!firstSegment)
+                {
+                    interpolateVertexData(lockedBuffer, leftIdx - halfStep, leftIdx + halfStep, leftIdx);
+                }
+                // Next segment
+                leftIdx = rightIdx;
+                destIdx = leftIdx + halfStep;
+                rightIdx = leftIdx + step;
+                firstSegment = false;
+            }
+
+            step = halfStep;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void PatchSurface::makeTriangles(void)
+    {
+        // Our vertex buffer is subdivided to the highest level, we need to generate tris
+        // which step over the vertices we don't need for this level of detail.
+
+        // Calculate steps
+        int vStep = 1 << (mMaxVLevel - mVLevel);
+        int uStep = 1 << (mMaxULevel - mULevel);
+        size_t currWidth = (LEVEL_WIDTH(mULevel)-1) * ((mCtlWidth-1)/2) + 1;
+        size_t currHeight = (LEVEL_WIDTH(mVLevel)-1) * ((mCtlHeight-1)/2) + 1;
+
+        bool use32bitindexes = (mIndexBuffer->getType() == HardwareIndexBuffer::IT_32BIT);
+
+        // The mesh is built, just make a list of indexes to spit out the triangles
+        int vInc, uInc;
+        
+        size_t vCount, uCount, v, u, iterations;
+
+        if (mVSide == VS_BOTH)
+        {
+            iterations = 2;
+            vInc = vStep;
+            v = 0; // Start with front
+        }
+        else
+        {
+            iterations = 1;
+            if (mVSide == VS_FRONT)
+            {
+                vInc = vStep;
+                v = 0;
+            }
+            else
+            {
+                vInc = -vStep;
+                v = mMeshHeight - 1;
+            }
+        }
+
+        // Calc num indexes
+        mCurrIndexCount = (currWidth - 1) * (currHeight - 1) * 6 * iterations;
+
+        size_t v1, v2, v3;
+        // Lock just the section of the buffer we need
+        unsigned short* p16;
+        unsigned int* p32;
+        if (use32bitindexes)
+        {
+            p32 = static_cast<unsigned int*>(
+                mIndexBuffer->lock(
+                    mIndexOffset * sizeof(unsigned int), 
+                    mRequiredIndexCount * sizeof(unsigned int), 
+                    HardwareBuffer::HBL_NO_OVERWRITE));
+        }
+        else
+        {
+            p16 = static_cast<unsigned short*>(
+                mIndexBuffer->lock(
+                    mIndexOffset * sizeof(unsigned short), 
+                    mRequiredIndexCount * sizeof(unsigned short), 
+                    HardwareBuffer::HBL_NO_OVERWRITE));
+        }
+
+        while (iterations--)
+        {
+            // Make tris in a zigzag pattern (compatible with strips)
+            u = 0;
+            uInc = uStep; // Start with moving +u
+
+            vCount = currHeight - 1;
+            while (vCount--)
+            {
+                uCount = currWidth - 1;
+                while (uCount--)
+                {
+                    // First Tri in cell
+                    // -----------------
+                    v1 = ((v + vInc) * mMeshWidth) + u;
+                    v2 = (v * mMeshWidth) + u;
+                    v3 = ((v + vInc) * mMeshWidth) + (u + uInc);
+                    // Output indexes
+                    if (use32bitindexes)
+                    {
+                        *p32++ = static_cast<unsigned int>(v1);
+                        *p32++ = static_cast<unsigned int>(v2);
+                        *p32++ = static_cast<unsigned int>(v3);
+                    }
+                    else
+                    {
+                        *p16++ = static_cast<unsigned short>(v1);
+                        *p16++ = static_cast<unsigned short>(v2);
+                        *p16++ = static_cast<unsigned short>(v3);
+                    }
+                    // Second Tri in cell
+                    // ------------------
+                    v1 = ((v + vInc) * mMeshWidth) + (u + uInc);
+                    v2 = (v * mMeshWidth) + u;
+                    v3 = (v * mMeshWidth) + (u + uInc);
+                    // Output indexes
+                    if (use32bitindexes)
+                    {
+                        *p32++ = static_cast<unsigned int>(v1);
+                        *p32++ = static_cast<unsigned int>(v2);
+                        *p32++ = static_cast<unsigned int>(v3);
+                    }
+                    else
+                    {
+                        *p16++ = static_cast<unsigned short>(v1);
+                        *p16++ = static_cast<unsigned short>(v2);
+                        *p16++ = static_cast<unsigned short>(v3);
+                    }
+
+                    // Next column
+                    u += uInc;
+                }
+                // Next row
+                v += vInc;
+                u = 0;
+
+
+            }
+
+            // Reverse vInc for double sided
+            v = mMeshHeight - 1;
+            vInc = -vInc;
+
+        }
+
+        mIndexBuffer->unlock();
+
+
+    }
+    //-----------------------------------------------------------------------
+    void PatchSurface::interpolateVertexData(void* lockedBuffer, size_t leftIdx, size_t rightIdx, size_t destIdx)
+    {
+        size_t vertexSize = mDeclaration->getVertexSize(0);
+        const VertexElement* elemPos = mDeclaration->findElementBySemantic(VES_POSITION);
+        const VertexElement* elemNorm = mDeclaration->findElementBySemantic(VES_NORMAL);
+        const VertexElement* elemDiffuse = mDeclaration->findElementBySemantic(VES_DIFFUSE);
+        const VertexElement* elemTex0 = mDeclaration->findElementBySemantic(VES_TEXTURE_COORDINATES, 0);
+        const VertexElement* elemTex1 = mDeclaration->findElementBySemantic(VES_TEXTURE_COORDINATES, 1);
+
+        float *pDestReal, *pLeftReal, *pRightReal;
+        unsigned char *pDestChar, *pLeftChar, *pRightChar;
+        unsigned char *pDest, *pLeft, *pRight;
+
+        // Set up pointers & interpolate
+        pDest = static_cast<unsigned char*>(lockedBuffer) + (vertexSize * destIdx);
+        pLeft = static_cast<unsigned char*>(lockedBuffer) + (vertexSize * leftIdx);
+        pRight = static_cast<unsigned char*>(lockedBuffer) + (vertexSize * rightIdx);
+
+        // Position
+        elemPos->baseVertexPointerToElement(pDest, &pDestReal);
+        elemPos->baseVertexPointerToElement(pLeft, &pLeftReal);
+        elemPos->baseVertexPointerToElement(pRight, &pRightReal);
+
+        *pDestReal++ = (*pLeftReal++ + *pRightReal++) * 0.5;
+        *pDestReal++ = (*pLeftReal++ + *pRightReal++) * 0.5;
+        *pDestReal++ = (*pLeftReal++ + *pRightReal++) * 0.5;
+
+        if (elemNorm)
+        {
+            elemNorm->baseVertexPointerToElement(pDest, &pDestReal);
+            elemNorm->baseVertexPointerToElement(pLeft, &pLeftReal);
+            elemNorm->baseVertexPointerToElement(pRight, &pRightReal);
+            Vector3 norm;
+            norm.x = (*pLeftReal++ + *pRightReal++) * 0.5;
+            norm.y = (*pLeftReal++ + *pRightReal++) * 0.5;
+            norm.z = (*pLeftReal++ + *pRightReal++) * 0.5;
+            norm.normalise();
+
+            *pDestReal++ = norm.x;
+            *pDestReal++ = norm.y;
+            *pDestReal++ = norm.z;
+        }
+        if (elemDiffuse)
+        {
+            // Blend each byte individually
+            elemDiffuse->baseVertexPointerToElement(pDest, &pDestChar);
+            elemDiffuse->baseVertexPointerToElement(pLeft, &pLeftChar);
+            elemDiffuse->baseVertexPointerToElement(pRight, &pRightChar);
+            // 4 bytes to RGBA
+            *pDestChar++ = static_cast<unsigned char>(((*pLeftChar++) + (*pRightChar++)) * 0.5);
+            *pDestChar++ = static_cast<unsigned char>(((*pLeftChar++) + (*pRightChar++)) * 0.5);
+            *pDestChar++ = static_cast<unsigned char>(((*pLeftChar++) + (*pRightChar++)) * 0.5);
+            *pDestChar++ = static_cast<unsigned char>(((*pLeftChar++) + (*pRightChar++)) * 0.5);
+        }
+        if (elemTex0)
+        {
+            elemTex0->baseVertexPointerToElement(pDest, &pDestReal);
+            elemTex0->baseVertexPointerToElement(pLeft, &pLeftReal);
+            elemTex0->baseVertexPointerToElement(pRight, &pRightReal);
+
+            for (size_t dim = 0; dim < VertexElement::getTypeCount(elemTex0->getType()); ++dim)
+                *pDestReal++ = ((*pLeftReal++) + (*pRightReal++)) * 0.5;
+        }
+        if (elemTex1)
+        {
+            elemTex1->baseVertexPointerToElement(pDest, &pDestReal);
+            elemTex1->baseVertexPointerToElement(pLeft, &pLeftReal);
+            elemTex1->baseVertexPointerToElement(pRight, &pRightReal);
+
+            for (size_t dim = 0; dim < VertexElement::getTypeCount(elemTex1->getType()); ++dim)
+                *pDestReal++ = ((*pLeftReal++) + (*pRightReal++)) * 0.5;
+        }
+    }
+
+}
+
Index: /OgreMain/src/OgrePixelConversions.h
===================================================================
--- /OgreMain/src/OgrePixelConversions.h	(revision 5)
+++ /OgreMain/src/OgrePixelConversions.h	(revision 5)
@@ -0,0 +1,428 @@
+ /*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/** Internal include file -- do not use externally */
+using namespace Ogre;
+
+// NB VC6 can't handle these templates
+#if OGRE_COMPILER != OGRE_COMPILER_MSVC || OGRE_COMP_VER >= 1300
+
+#define FMTCONVERTERID(from,to) (((from)<<8)|(to))
+
+/**
+ * Convert a box of pixel from one type to another. Who needs automatic code 
+ * generation when we have C++ templates and the policy design pattern.
+ * 
+ * @param   U       Policy class to facilitate pixel-to-pixel conversion. This class
+ *    has at least two typedefs: SrcType and DstType. SrcType is the source element type,
+ *    dstType is the destination element type. It also has a static method, pixelConvert, that
+ *    converts a srcType into a dstType.
+ */
+
+template <class U> struct PixelBoxConverter 
+{
+    static const int ID = U::ID;
+    static void conversion(const PixelBox &src, const PixelBox &dst)
+    {
+        typename U::SrcType *srcptr = static_cast<typename U::SrcType*>(src.data);
+        typename U::DstType *dstptr = static_cast<typename U::DstType*>(dst.data);
+        const size_t srcSliceSkip = src.getSliceSkip();
+        const size_t dstSliceSkip = dst.getSliceSkip();
+        const size_t k = src.right - src.left;
+        for(size_t z=src.front; z<src.back; z++) 
+        {
+            for(size_t y=src.top; y<src.bottom; y++)
+            {
+                for(size_t x=0; x<k; x++)
+                {
+                    dstptr[x] = U::pixelConvert(srcptr[x]);
+                }
+                srcptr += src.rowPitch;
+                dstptr += dst.rowPitch;
+            }
+            srcptr += srcSliceSkip;
+            dstptr += dstSliceSkip;
+        }    
+    }
+};
+
+template <typename T, typename U, int id> struct PixelConverter {
+    static const int ID = id;
+    typedef T SrcType;
+    typedef U DstType;    
+    
+    //inline static DstType pixelConvert(const SrcType &inp);
+};
+
+
+/** Type for PF_R8G8B8/PF_B8G8R8 */
+struct Col3b {
+    Col3b(unsigned int a, unsigned int b, unsigned int c): 
+        x((uint8)a), y((uint8)b), z((uint8)c) { }
+    uint8 x,y,z;
+};
+/** Type for PF_FLOAT32_RGB */
+struct Col3f {
+	Col3f(float r, float g, float b):
+		r(r), g(g), b(b) { }
+	float r,g,b;
+};
+/** Type for PF_FLOAT32_RGBA */
+struct Col4f {
+	Col4f(float r, float g, float b, float a):
+		r(r), g(g), b(b), a(a) { }
+	float r,g,b,a;
+};
+
+struct A8R8G8B8toA8B8G8R8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_A8R8G8B8, PF_A8B8G8R8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0x000000FF)<<16)|(inp&0xFF00FF00)|((inp&0x00FF0000)>>16);
+    }
+};
+
+struct A8R8G8B8toB8G8R8A8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_A8R8G8B8, PF_B8G8R8A8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0x000000FF)<<24)|((inp&0x0000FF00)<<8)|((inp&0x00FF0000)>>8)|((inp&0xFF000000)>>24);
+    }
+};
+
+struct A8R8G8B8toR8G8B8A8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_A8R8G8B8, PF_R8G8B8A8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0x00FFFFFF)<<8)|((inp&0xFF000000)>>24);
+    }
+};
+
+struct A8B8G8R8toA8R8G8B8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_A8B8G8R8, PF_A8R8G8B8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0x000000FF)<<16)|(inp&0xFF00FF00)|((inp&0x00FF0000)>>16);
+    }
+};
+
+struct A8B8G8R8toB8G8R8A8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_A8B8G8R8, PF_B8G8R8A8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0x00FFFFFF)<<8)|((inp&0xFF000000)>>24);
+    }
+};
+
+struct A8B8G8R8toR8G8B8A8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_A8B8G8R8, PF_R8G8B8A8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0x000000FF)<<24)|((inp&0x0000FF00)<<8)|((inp&0x00FF0000)>>8)|((inp&0xFF000000)>>24);
+    }
+};
+
+struct B8G8R8A8toA8R8G8B8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_B8G8R8A8, PF_A8R8G8B8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0x000000FF)<<24)|((inp&0x0000FF00)<<8)|((inp&0x00FF0000)>>8)|((inp&0xFF000000)>>24);
+    }
+};
+
+struct B8G8R8A8toA8B8G8R8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_B8G8R8A8, PF_A8B8G8R8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0x000000FF)<<24)|((inp&0xFFFFFF00)>>8);
+    }
+};
+
+struct B8G8R8A8toR8G8B8A8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_B8G8R8A8, PF_R8G8B8A8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0x0000FF00)<<16)|(inp&0x00FF00FF)|((inp&0xFF000000)>>16);
+    }
+};
+
+struct R8G8B8A8toA8R8G8B8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_R8G8B8A8, PF_A8R8G8B8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0x000000FF)<<24)|((inp&0xFFFFFF00)>>8);
+    }
+};
+
+struct R8G8B8A8toA8B8G8R8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_R8G8B8A8, PF_A8B8G8R8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0x000000FF)<<24)|((inp&0x0000FF00)<<8)|((inp&0x00FF0000)>>8)|((inp&0xFF000000)>>24);
+    }
+};
+
+struct R8G8B8A8toB8G8R8A8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_R8G8B8A8, PF_B8G8R8A8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0x0000FF00)<<16)|(inp&0x00FF00FF)|((inp&0xFF000000)>>16);
+    }
+};
+
+struct A8B8G8R8toL8: public PixelConverter <uint32, uint8, FMTCONVERTERID(PF_A8B8G8R8, PF_L8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return (uint8)(inp&0x000000FF);
+    }
+};
+
+struct L8toA8B8G8R8: public PixelConverter <uint8, uint32, FMTCONVERTERID(PF_L8, PF_A8B8G8R8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return 0xFF000000|(((unsigned int)inp)<<0)|(((unsigned int)inp)<<8)|(((unsigned int)inp)<<16);
+    }
+};
+
+struct A8R8G8B8toL8: public PixelConverter <uint32, uint8, FMTCONVERTERID(PF_A8R8G8B8, PF_L8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return (uint8)((inp&0x00FF0000)>>16);
+    }
+};
+
+struct L8toA8R8G8B8: public PixelConverter <uint8, uint32, FMTCONVERTERID(PF_L8, PF_A8R8G8B8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return 0xFF000000|(((unsigned int)inp)<<0)|(((unsigned int)inp)<<8)|(((unsigned int)inp)<<16);
+    }
+};
+
+struct B8G8R8A8toL8: public PixelConverter <uint32, uint8, FMTCONVERTERID(PF_B8G8R8A8, PF_L8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return (uint8)((inp&0x0000FF00)>>8);
+    }
+};
+
+struct L8toB8G8R8A8: public PixelConverter <uint8, uint32, FMTCONVERTERID(PF_L8, PF_B8G8R8A8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return 0x000000FF|(((unsigned int)inp)<<8)|(((unsigned int)inp)<<16)|(((unsigned int)inp)<<24);
+    }
+};
+
+struct L8toL16: public PixelConverter <uint8, uint16, FMTCONVERTERID(PF_L8, PF_L16)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return (uint16)((((unsigned int)inp)<<8)|(((unsigned int)inp)));
+    }
+};
+
+struct L16toL8: public PixelConverter <uint16, uint8, FMTCONVERTERID(PF_L16, PF_L8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return (uint8)(inp>>8);
+    }
+};
+
+struct R8G8B8toB8G8R8: public PixelConverter <Col3b, Col3b, FMTCONVERTERID(PF_R8G8B8, PF_B8G8R8)>
+{
+    inline static DstType pixelConvert(const SrcType &inp)
+    {
+        return Col3b(inp.z, inp.y, inp.x);
+    }  
+};
+
+struct B8G8R8toR8G8B8: public PixelConverter <Col3b, Col3b, FMTCONVERTERID(PF_B8G8R8, PF_R8G8B8)>
+{
+    inline static DstType pixelConvert(const SrcType &inp)
+    {
+        return Col3b(inp.z, inp.y, inp.x);
+    }  
+};
+
+// X8Y8Z8 ->  X8<<xshift Y8<<yshift Z8<<zshift A8<<ashift
+template <int id, unsigned int xshift, unsigned int yshift, unsigned int zshift, unsigned int ashift> struct Col3btoUint32swizzler:
+    public PixelConverter <Col3b, uint32, id>
+{
+    inline static uint32 pixelConvert(const Col3b &inp)
+    {
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+        return (0xFF<<ashift) | (((unsigned int)inp.x)<<xshift) | (((unsigned int)inp.y)<<yshift) | (((unsigned int)inp.z)<<zshift);
+#else
+        return (0xFF<<ashift) | (((unsigned int)inp.x)<<zshift) | (((unsigned int)inp.y)<<yshift) | (((unsigned int)inp.z)<<xshift);
+#endif
+    }
+};
+
+struct R8G8B8toA8R8G8B8: public Col3btoUint32swizzler<FMTCONVERTERID(PF_R8G8B8, PF_A8R8G8B8), 16, 8, 0, 24> { };
+struct B8G8R8toA8R8G8B8: public Col3btoUint32swizzler<FMTCONVERTERID(PF_B8G8R8, PF_A8R8G8B8), 0, 8, 16, 24> { };
+struct R8G8B8toA8B8G8R8: public Col3btoUint32swizzler<FMTCONVERTERID(PF_R8G8B8, PF_A8B8G8R8), 0, 8, 16, 24> { };
+struct B8G8R8toA8B8G8R8: public Col3btoUint32swizzler<FMTCONVERTERID(PF_B8G8R8, PF_A8B8G8R8), 16, 8, 0, 24> { };
+struct R8G8B8toB8G8R8A8: public Col3btoUint32swizzler<FMTCONVERTERID(PF_R8G8B8, PF_B8G8R8A8), 8, 16, 24, 0> { };
+struct B8G8R8toB8G8R8A8: public Col3btoUint32swizzler<FMTCONVERTERID(PF_B8G8R8, PF_B8G8R8A8), 24, 16, 8, 0> { };
+
+struct A8R8G8B8toR8G8B8: public PixelConverter <uint32, Col3b, FMTCONVERTERID(PF_A8R8G8B8, PF_BYTE_RGB)>
+{
+    inline static DstType pixelConvert(uint32 inp)
+    {
+        return Col3b((uint8)((inp>>16)&0xFF), (uint8)((inp>>8)&0xFF), (uint8)((inp>>0)&0xFF));
+    }
+};
+struct A8R8G8B8toB8G8R8: public PixelConverter <uint32, Col3b, FMTCONVERTERID(PF_A8R8G8B8, PF_BYTE_BGR)>
+{
+    inline static DstType pixelConvert(uint32 inp)
+    {
+        return Col3b((uint8)((inp>>0)&0xFF), (uint8)((inp>>8)&0xFF), (uint8)((inp>>16)&0xFF));
+    }
+};
+
+// Only conversions from X8R8G8B8 to formats with alpha need to be defined, the rest is implicitly the same
+// as A8R8G8B8
+struct X8R8G8B8toA8R8G8B8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_X8R8G8B8, PF_A8R8G8B8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return inp | 0xFF000000;
+    }
+};
+struct X8R8G8B8toA8B8G8R8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_X8R8G8B8, PF_A8B8G8R8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0x0000FF)<<16)|((inp&0xFF0000)>>16)|(inp&0x00FF00)|0xFF000000;
+    }
+};
+struct X8R8G8B8toB8G8R8A8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_X8R8G8B8, PF_B8G8R8A8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0x0000FF)<<24)|((inp&0xFF0000)>>8)|((inp&0x00FF00)<<8)|0x000000FF;
+    }
+};
+struct X8R8G8B8toR8G8B8A8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_X8R8G8B8, PF_R8G8B8A8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0xFFFFFF)<<8)|0x000000FF;
+    }
+};
+
+// X8B8G8R8
+struct X8B8G8R8toA8R8G8B8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_X8B8G8R8, PF_A8R8G8B8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0x0000FF)<<16)|((inp&0xFF0000)>>16)|(inp&0x00FF00)|0xFF000000;
+    }
+};
+struct X8B8G8R8toA8B8G8R8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_X8B8G8R8, PF_A8B8G8R8)>
+{
+	inline static DstType pixelConvert(SrcType inp)
+    {
+        return inp | 0xFF000000;
+    }
+};
+struct X8B8G8R8toB8G8R8A8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_X8B8G8R8, PF_B8G8R8A8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0xFFFFFF)<<8)|0x000000FF;
+    }
+};
+struct X8B8G8R8toR8G8B8A8: public PixelConverter <uint32, uint32, FMTCONVERTERID(PF_X8B8G8R8, PF_R8G8B8A8)>
+{
+    inline static DstType pixelConvert(SrcType inp)
+    {
+        return ((inp&0x0000FF)<<24)|((inp&0xFF0000)>>8)|((inp&0x00FF00)<<8)|0x000000FF;
+    }
+};
+
+
+#define CASECONVERTER(type) case type::ID : PixelBoxConverter<type>::conversion(src, dst); return 1;
+
+inline int doOptimizedConversion(const PixelBox &src, const PixelBox &dst)
+{;
+    switch(FMTCONVERTERID(src.format, dst.format))
+    {
+        // Register converters here
+		CASECONVERTER(A8R8G8B8toA8B8G8R8);
+		CASECONVERTER(A8R8G8B8toB8G8R8A8);
+		CASECONVERTER(A8R8G8B8toR8G8B8A8);
+		CASECONVERTER(A8B8G8R8toA8R8G8B8);
+		CASECONVERTER(A8B8G8R8toB8G8R8A8);
+		CASECONVERTER(A8B8G8R8toR8G8B8A8);
+		CASECONVERTER(B8G8R8A8toA8R8G8B8);
+		CASECONVERTER(B8G8R8A8toA8B8G8R8);
+		CASECONVERTER(B8G8R8A8toR8G8B8A8);
+		CASECONVERTER(R8G8B8A8toA8R8G8B8);
+		CASECONVERTER(R8G8B8A8toA8B8G8R8);
+		CASECONVERTER(R8G8B8A8toB8G8R8A8);
+        CASECONVERTER(A8B8G8R8toL8);
+        CASECONVERTER(L8toA8B8G8R8);
+        CASECONVERTER(A8R8G8B8toL8);
+        CASECONVERTER(L8toA8R8G8B8);
+        CASECONVERTER(B8G8R8A8toL8);
+        CASECONVERTER(L8toB8G8R8A8);
+        CASECONVERTER(L8toL16);
+        CASECONVERTER(L16toL8);
+        CASECONVERTER(B8G8R8toR8G8B8);
+        CASECONVERTER(R8G8B8toB8G8R8);
+        CASECONVERTER(R8G8B8toA8R8G8B8);
+        CASECONVERTER(B8G8R8toA8R8G8B8);
+        CASECONVERTER(R8G8B8toA8B8G8R8);
+        CASECONVERTER(B8G8R8toA8B8G8R8);
+        CASECONVERTER(R8G8B8toB8G8R8A8);
+        CASECONVERTER(B8G8R8toB8G8R8A8);
+		CASECONVERTER(A8R8G8B8toR8G8B8);
+		CASECONVERTER(A8R8G8B8toB8G8R8);
+		CASECONVERTER(X8R8G8B8toA8R8G8B8);
+		CASECONVERTER(X8R8G8B8toA8B8G8R8);
+		CASECONVERTER(X8R8G8B8toB8G8R8A8);
+		CASECONVERTER(X8R8G8B8toR8G8B8A8);
+		CASECONVERTER(X8B8G8R8toA8R8G8B8);
+		CASECONVERTER(X8B8G8R8toA8B8G8R8);
+		CASECONVERTER(X8B8G8R8toB8G8R8A8);
+		CASECONVERTER(X8B8G8R8toR8G8B8A8);
+
+        default:
+            return 0;
+    }
+}
+#undef CASECONVERTER
+
+#endif // VC6 protection
Index: /OgreMain/src/OgrePixelFormat.cpp
===================================================================
--- /OgreMain/src/OgrePixelFormat.cpp	(revision 5)
+++ /OgreMain/src/OgrePixelFormat.cpp	(revision 5)
@@ -0,0 +1,1299 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgrePixelFormat.h"
+#include "OgreBitwise.h"
+#include "OgreColourValue.h"
+#include "OgreException.h"
+
+
+namespace {
+#include "OgrePixelConversions.h"
+};
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    /**
+    * A record that describes a pixel format in detail.
+    */
+    struct PixelFormatDescription {
+        /* Name of the format, as in the enum */
+        char *name;
+        /* Number of bytes one element (colour value) takes. */
+        unsigned char elemBytes;
+        /* Pixel format flags, see enum PixelFormatFlags for the bit field
+        * definitions
+        */
+        uint32 flags;
+        /** Component type
+         */
+        PixelComponentType componentType;
+        /** Component count
+         */
+        unsigned char componentCount;
+        /* Number of bits for red(or luminance), green, blue, alpha
+        */
+        unsigned char rbits,gbits,bbits,abits; /*, ibits, dbits, ... */
+
+        /* Masks and shifts as used by packers/unpackers */
+        uint32 rmask, gmask, bmask, amask;
+        unsigned char rshift, gshift, bshift, ashift;
+    };
+    //-----------------------------------------------------------------------
+    /** Pixel format database */
+    PixelFormatDescription _pixelFormats[PF_COUNT] = {
+	//-----------------------------------------------------------------------
+        {"PF_UNKNOWN",
+            /* Bytes per element */
+            0,
+            /* Flags */
+            0,
+            /* Component type and count */
+            PCT_BYTE, 0,
+            /* rbits, gbits, bbits, abits */
+            0, 0, 0, 0,
+            /* Masks and shifts */
+            0, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_L8",
+        /* Bytes per element */
+        1,
+        /* Flags */
+        PFF_LUMINANCE | PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 1,
+        /* rbits, gbits, bbits, abits */
+        8, 0, 0, 0,
+        /* Masks and shifts */
+        0xFF, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_L16",
+        /* Bytes per element */
+        2,
+        /* Flags */
+        PFF_LUMINANCE | PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_SHORT, 1,
+        /* rbits, gbits, bbits, abits */
+        16, 0, 0, 0,
+        /* Masks and shifts */
+        0xFFFF, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_A8",
+        /* Bytes per element */
+        1,
+        /* Flags */
+        PFF_HASALPHA | PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 1,
+        /* rbits, gbits, bbits, abits */
+        0, 0, 0, 8,
+        /* Masks and shifts */
+        0, 0, 0, 0xFF, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_A4L4",
+        /* Bytes per element */
+        1,
+        /* Flags */
+        PFF_HASALPHA | PFF_LUMINANCE | PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 2,
+        /* rbits, gbits, bbits, abits */
+        4, 0, 0, 4,
+        /* Masks and shifts */
+        0x0F, 0, 0, 0xF0, 0, 0, 0, 4
+        },
+	//-----------------------------------------------------------------------
+        {"PF_BYTE_LA",
+        /* Bytes per element */
+        2,
+        /* Flags */
+        PFF_HASALPHA | PFF_LUMINANCE,
+        /* Component type and count */
+        PCT_BYTE, 2,
+        /* rbits, gbits, bbits, abits */
+        8, 0, 0, 8,
+        /* Masks and shifts */
+        0,0,0,0,0,0,0,0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_R5G6B5",
+        /* Bytes per element */
+        2,
+        /* Flags */
+        PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 3,
+        /* rbits, gbits, bbits, abits */
+        5, 6, 5, 0,
+        /* Masks and shifts */
+        0xF800, 0x07E0, 0x001F, 0,
+        11, 5, 0, 0
+        },
+	//-----------------------------------------------------------------------
+		{"PF_B5G6R5",
+        /* Bytes per element */
+        2,
+        /* Flags */
+        PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 3,
+        /* rbits, gbits, bbits, abits */
+        5, 6, 5, 0,
+        /* Masks and shifts */
+        0x001F, 0x07E0, 0xF800, 0,
+        0, 5, 11, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_A4R4G4B4",
+        /* Bytes per element */
+        2,
+        /* Flags */
+        PFF_HASALPHA | PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 4,
+        /* rbits, gbits, bbits, abits */
+        4, 4, 4, 4,
+        /* Masks and shifts */
+        0x0F00, 0x00F0, 0x000F, 0xF000,
+        8, 4, 0, 12
+        },
+	//-----------------------------------------------------------------------
+        {"PF_A1R5G5B5",
+        /* Bytes per element */
+        2,
+        /* Flags */
+        PFF_HASALPHA | PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 4,
+        /* rbits, gbits, bbits, abits */
+        5, 5, 5, 1,
+        /* Masks and shifts */
+        0x7C00, 0x03E0, 0x001F, 0x8000,
+        10, 5, 0, 15,
+        },
+	//-----------------------------------------------------------------------
+        {"PF_R8G8B8",
+        /* Bytes per element */
+        3,  // 24 bit integer -- special
+        /* Flags */
+        PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 3,
+        /* rbits, gbits, bbits, abits */
+        8, 8, 8, 0,
+        /* Masks and shifts */
+        0xFF0000, 0x00FF00, 0x0000FF, 0,
+        16, 8, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_B8G8R8",
+        /* Bytes per element */
+        3,  // 24 bit integer -- special
+        /* Flags */
+        PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 3,
+        /* rbits, gbits, bbits, abits */
+        8, 8, 8, 0,
+        /* Masks and shifts */
+        0x0000FF, 0x00FF00, 0xFF0000, 0,
+        0, 8, 16, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_A8R8G8B8",
+        /* Bytes per element */
+        4,
+        /* Flags */
+        PFF_HASALPHA | PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 4,
+        /* rbits, gbits, bbits, abits */
+        8, 8, 8, 8,
+        /* Masks and shifts */
+        0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
+        16, 8, 0, 24
+        },
+	//-----------------------------------------------------------------------
+        {"PF_A8B8G8R8",
+        /* Bytes per element */
+        4,
+        /* Flags */
+        PFF_HASALPHA | PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 4,
+        /* rbits, gbits, bbits, abits */
+        8, 8, 8, 8,
+        /* Masks and shifts */
+        0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000,
+        0, 8, 16, 24,
+        },
+	//-----------------------------------------------------------------------
+        {"PF_B8G8R8A8",
+        /* Bytes per element */
+        4,
+        /* Flags */
+        PFF_HASALPHA | PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 4,
+        /* rbits, gbits, bbits, abits */
+        8, 8, 8, 8,
+        /* Masks and shifts */
+        0x0000FF00, 0x00FF0000, 0xFF000000, 0x000000FF,
+        8, 16, 24, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_A2R10G10B10",
+        /* Bytes per element */
+        4,
+        /* Flags */
+        PFF_HASALPHA | PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 4,
+        /* rbits, gbits, bbits, abits */
+        10, 10, 10, 2,
+        /* Masks and shifts */
+        0x3FF00000, 0x000FFC00, 0x000003FF, 0xC0000000,
+        20, 10, 0, 30
+        },
+	//-----------------------------------------------------------------------
+        {"PF_A2B10G10R10",
+        /* Bytes per element */
+        4,
+        /* Flags */
+        PFF_HASALPHA | PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 4,
+        /* rbits, gbits, bbits, abits */
+        10, 10, 10, 2,
+        /* Masks and shifts */
+        0x000003FF, 0x000FFC00, 0x3FF00000, 0xC0000000,
+        0, 10, 20, 30
+        },
+	//-----------------------------------------------------------------------
+        {"PF_DXT1",
+        /* Bytes per element */
+        0,
+        /* Flags */
+        PFF_COMPRESSED | PFF_HASALPHA,
+        /* Component type and count */
+        PCT_BYTE, 3, // No alpha
+        /* rbits, gbits, bbits, abits */
+        0, 0, 0, 0,
+        /* Masks and shifts */
+        0, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_DXT2",
+        /* Bytes per element */
+        0,
+        /* Flags */
+        PFF_COMPRESSED | PFF_HASALPHA,
+        /* Component type and count */
+        PCT_BYTE, 4,
+        /* rbits, gbits, bbits, abits */
+        0, 0, 0, 0,
+        /* Masks and shifts */
+        0, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_DXT3",
+        /* Bytes per element */
+        0,
+        /* Flags */
+        PFF_COMPRESSED | PFF_HASALPHA,
+        /* Component type and count */
+        PCT_BYTE, 4,
+        /* rbits, gbits, bbits, abits */
+        0, 0, 0, 0,
+        /* Masks and shifts */
+        0, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_DXT4",
+        /* Bytes per element */
+        0,
+        /* Flags */
+        PFF_COMPRESSED | PFF_HASALPHA,
+        /* Component type and count */
+        PCT_BYTE, 4,
+        /* rbits, gbits, bbits, abits */
+        0, 0, 0, 0,
+        /* Masks and shifts */
+        0, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_DXT5",
+        /* Bytes per element */
+        0,
+        /* Flags */
+        PFF_COMPRESSED | PFF_HASALPHA,
+        /* Component type and count */
+        PCT_BYTE, 4,
+        /* rbits, gbits, bbits, abits */
+        0, 0, 0, 0,
+        /* Masks and shifts */
+        0, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_FLOAT16_RGB",
+        /* Bytes per element */
+        6,
+        /* Flags */
+        PFF_FLOAT,
+        /* Component type and count */
+        PCT_FLOAT16, 3,
+        /* rbits, gbits, bbits, abits */
+        16, 16, 16, 0,
+        /* Masks and shifts */
+        0, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_FLOAT16_RGBA",
+        /* Bytes per element */
+        8,
+        /* Flags */
+        PFF_FLOAT,
+        /* Component type and count */
+        PCT_FLOAT16, 4,
+        /* rbits, gbits, bbits, abits */
+        16, 16, 16, 16,
+        /* Masks and shifts */
+        0, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_FLOAT32_RGB",
+        /* Bytes per element */
+        12,
+        /* Flags */
+        PFF_FLOAT,
+        /* Component type and count */
+        PCT_FLOAT32, 3,
+        /* rbits, gbits, bbits, abits */
+        32, 32, 32, 0,
+        /* Masks and shifts */
+        0, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_FLOAT32_RGBA",
+        /* Bytes per element */
+        16,
+        /* Flags */
+        PFF_FLOAT,
+        /* Component type and count */
+        PCT_FLOAT32, 4,
+        /* rbits, gbits, bbits, abits */
+        32, 32, 32, 32,
+        /* Masks and shifts */
+        0, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_X8R8G8B8",
+        /* Bytes per element */
+        4,
+        /* Flags */
+        PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 3,
+        /* rbits, gbits, bbits, abits */
+        8, 8, 8, 0,
+        /* Masks and shifts */
+        0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
+        16, 8, 0, 24
+        },
+	//-----------------------------------------------------------------------
+        {"PF_X8B8G8R8",
+        /* Bytes per element */
+        4,
+        /* Flags */
+        PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 3,
+        /* rbits, gbits, bbits, abits */
+        8, 8, 8, 0,
+        /* Masks and shifts */
+        0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000,
+        0, 8, 16, 24
+        },
+	//-----------------------------------------------------------------------
+        {"PF_R8G8B8A8",
+        /* Bytes per element */
+        4,
+        /* Flags */
+        PFF_HASALPHA | PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 4,
+        /* rbits, gbits, bbits, abits */
+        8, 8, 8, 8,
+        /* Masks and shifts */
+        0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF,
+        24, 16, 8, 0
+        },
+	//-----------------------------------------------------------------------
+		{"PF_DEPTH",
+        /* Bytes per element */
+        4,
+        /* Flags */
+        PFF_DEPTH,
+        /* Component type and count */
+        PCT_FLOAT32, 1, // ?
+        /* rbits, gbits, bbits, abits */
+        0, 0, 0, 0,
+        /* Masks and shifts */
+		0, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+		{"PF_SHORT_RGBA",
+		/* Bytes per element */
+        8,
+        /* Flags */
+        PFF_HASALPHA,
+        /* Component type and count */
+        PCT_SHORT, 4,
+        /* rbits, gbits, bbits, abits */
+        16, 16, 16, 16,
+        /* Masks and shifts */
+		0, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_R3G3B2",
+        /* Bytes per element */
+        1,
+        /* Flags */
+        PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_BYTE, 3,
+        /* rbits, gbits, bbits, abits */
+        3, 3, 2, 0,
+        /* Masks and shifts */
+        0xE0, 0x1C, 0x03, 0,
+        5, 2, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_FLOAT16_R",
+        /* Bytes per element */
+        2,
+        /* Flags */
+        PFF_FLOAT,
+        /* Component type and count */
+        PCT_FLOAT16, 1,
+        /* rbits, gbits, bbits, abits */
+        16, 0, 0, 0,
+        /* Masks and shifts */
+        0, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_FLOAT32_R",
+        /* Bytes per element */
+        4,
+        /* Flags */
+        PFF_FLOAT,
+        /* Component type and count */
+        PCT_FLOAT32, 1,
+        /* rbits, gbits, bbits, abits */
+        32, 0, 0, 0,
+        /* Masks and shifts */
+        0, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_SHORT_GR",
+        /* Bytes per element */
+        4,
+        /* Flags */
+        PFF_NATIVEENDIAN,
+        /* Component type and count */
+        PCT_SHORT, 2,
+        /* rbits, gbits, bbits, abits */
+        16, 16, 0, 0,
+        /* Masks and shifts */
+        0x0000FFFF, 0xFFFF0000, 0, 0, 
+		0, 16, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_FLOAT16_GR",
+        /* Bytes per element */
+        4,
+        /* Flags */
+        PFF_FLOAT,
+        /* Component type and count */
+        PCT_FLOAT16, 2,
+        /* rbits, gbits, bbits, abits */
+        16, 16, 0, 0,
+        /* Masks and shifts */
+        0, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+        {"PF_FLOAT32_GR",
+        /* Bytes per element */
+        8,
+        /* Flags */
+        PFF_FLOAT,
+        /* Component type and count */
+        PCT_FLOAT32, 2,
+        /* rbits, gbits, bbits, abits */
+        32, 32, 0, 0,
+        /* Masks and shifts */
+        0, 0, 0, 0, 0, 0, 0, 0
+        },
+	//-----------------------------------------------------------------------
+		{"PF_SHORT_RGB",
+		/* Bytes per element */
+        6,
+        /* Flags */
+        0,
+        /* Component type and count */
+        PCT_SHORT, 3,
+        /* rbits, gbits, bbits, abits */
+        16, 16, 16, 0,
+        /* Masks and shifts */
+		0, 0, 0, 0, 0, 0, 0, 0
+        },
+    };
+    //-----------------------------------------------------------------------
+	size_t PixelBox::getConsecutiveSize() const
+	{
+		return PixelUtil::getMemorySize(getWidth(), getHeight(), getDepth(), format);
+	}
+	PixelBox PixelBox::getSubVolume(const Box &def) const
+	{
+		if(PixelUtil::isCompressed(format))
+		{
+			if(def.left == left && def.top == top && def.front == front &&
+			   def.right == right && def.bottom == bottom && def.back == back)
+			{
+				// Entire buffer is being queried
+				return *this;
+			}
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Cannot return subvolume of compressed PixelBuffer", "PixelBox::getSubVolume");
+		}
+		if(!contains(def))
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Bounds out of range", "PixelBox::getSubVolume");
+
+		const size_t elemSize = PixelUtil::getNumElemBytes(format);
+		// Calculate new data origin
+		PixelBox rval(def, format, ((uint8*)data)
+			+ ((def.left-left)*elemSize)
+			+ ((def.top-top)*rowPitch*elemSize)
+			+ ((def.front-front)*slicePitch*elemSize)
+		);
+
+		rval.rowPitch = rowPitch;
+		rval.slicePitch = slicePitch;
+		rval.format = format;
+
+		return rval;
+	}
+    //-----------------------------------------------------------------------
+    /**
+    * Directly get the description record for provided pixel format. For debug builds,
+    * this checks the bounds of fmt with an assertion.
+    */
+    static inline const PixelFormatDescription &getDescriptionFor(const PixelFormat fmt)
+    {
+        const int ord = (int)fmt;
+        assert(ord>=0 && ord<PF_COUNT);
+
+        return _pixelFormats[ord];
+    }
+    //-----------------------------------------------------------------------
+    size_t PixelUtil::getNumElemBytes( PixelFormat format )
+    {
+        return getDescriptionFor(format).elemBytes;
+    }
+	//-----------------------------------------------------------------------
+	size_t PixelUtil::getMemorySize(size_t width, size_t height, size_t depth, PixelFormat format)
+	{
+		if(isCompressed(format))
+		{
+			switch(format)
+			{
+				// DXT formats work by dividing the image into 4x4 blocks, then encoding each
+				// 4x4 block with a certain number of bytes. DXT can only be used on 2D images.
+				case PF_DXT1:
+					assert(depth == 1);
+					return ((width+3)/4)*((height+3)/4)*8;
+				case PF_DXT2:
+				case PF_DXT3:
+				case PF_DXT4:
+				case PF_DXT5:
+					assert(depth == 1);
+					return ((width+3)/4)*((height+3)/4)*16;
+				default:
+				OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Invalid compressed pixel format",
+					"PixelUtil::getMemorySize");
+			}
+		}
+		else
+		{
+			return width*height*depth*getNumElemBytes(format);
+		}
+	}
+    //-----------------------------------------------------------------------
+    size_t PixelUtil::getNumElemBits( PixelFormat format )
+    {
+        return getDescriptionFor(format).elemBytes * 8;
+    }
+    //-----------------------------------------------------------------------
+    unsigned int PixelUtil::getFlags( PixelFormat format )
+    {
+        return getDescriptionFor(format).flags;
+    }
+    //-----------------------------------------------------------------------
+    bool PixelUtil::hasAlpha(PixelFormat format)
+    {
+        return (PixelUtil::getFlags(format) & PFF_HASALPHA) > 0;
+    }
+    //-----------------------------------------------------------------------
+    bool PixelUtil::isFloatingPoint(PixelFormat format)
+    {
+        return (PixelUtil::getFlags(format) & PFF_FLOAT) > 0;
+    }
+    //-----------------------------------------------------------------------
+    bool PixelUtil::isCompressed(PixelFormat format)
+    {
+        return (PixelUtil::getFlags(format) & PFF_COMPRESSED) > 0;
+    }
+    //-----------------------------------------------------------------------
+    bool PixelUtil::isDepth(PixelFormat format)
+    {
+        return (PixelUtil::getFlags(format) & PFF_DEPTH) > 0;
+    }
+    //-----------------------------------------------------------------------
+    bool PixelUtil::isNativeEndian(PixelFormat format)
+    {
+        return (PixelUtil::getFlags(format) & PFF_NATIVEENDIAN) > 0;
+    }
+    //-----------------------------------------------------------------------
+    bool PixelUtil::isLuminance(PixelFormat format)
+    {
+        return (PixelUtil::getFlags(format) & PFF_LUMINANCE) > 0;
+    }
+    //-----------------------------------------------------------------------
+	bool PixelUtil::isValidExtent(size_t width, size_t height, size_t depth, PixelFormat format)
+	{
+		if(isCompressed(format))
+		{
+			switch(format)
+			{
+				case PF_DXT1:
+				case PF_DXT2:
+				case PF_DXT3:
+				case PF_DXT4:
+				case PF_DXT5:
+					return ((width&3)==0 && (height&3)==0 && depth==1);
+				default:
+					return true;
+			}
+		}
+		else
+		{
+			return true;
+		}
+	}
+	//-----------------------------------------------------------------------
+    void PixelUtil::getBitDepths(PixelFormat format, int rgba[4])
+    {
+        const PixelFormatDescription &des = getDescriptionFor(format);
+        rgba[0] = des.rbits;
+        rgba[1] = des.gbits;
+        rgba[2] = des.bbits;
+        rgba[3] = des.abits;
+    }
+	//-----------------------------------------------------------------------
+	void PixelUtil::getBitMasks(PixelFormat format, uint32 rgba[4])
+    {
+        const PixelFormatDescription &des = getDescriptionFor(format);
+        rgba[0] = des.rmask;
+        rgba[1] = des.gmask;
+        rgba[2] = des.bmask;
+        rgba[3] = des.amask;
+    }
+    //-----------------------------------------------------------------------
+    String PixelUtil::getFormatName(PixelFormat srcformat)
+    {
+        return getDescriptionFor(srcformat).name;
+    }
+    //-----------------------------------------------------------------------
+    bool PixelUtil::isAccessible(PixelFormat srcformat)
+    {
+        if (srcformat == PF_UNKNOWN)
+            return false;
+        unsigned int flags = getFlags(srcformat);
+        return !((flags & PFF_COMPRESSED) || (flags & PFF_DEPTH));
+    }
+    //-----------------------------------------------------------------------
+    PixelComponentType PixelUtil::getComponentType(PixelFormat fmt)
+    {
+        const PixelFormatDescription &des = getDescriptionFor(fmt);
+        return des.componentType;
+    }
+    //-----------------------------------------------------------------------
+    size_t PixelUtil::getComponentCount(PixelFormat fmt)
+    {
+        const PixelFormatDescription &des = getDescriptionFor(fmt);
+        return des.componentCount;
+    }
+    //-----------------------------------------------------------------------
+    PixelFormat PixelUtil::getFormatFromName(const String& name, bool accessibleOnly, bool caseSensitive)
+    {
+        String tmp = name;
+        if (!caseSensitive)
+        {
+            // We are stored upper-case format names.
+            StringUtil::toUpperCase(tmp);
+        }
+
+        for (int i = 0; i < PF_COUNT; ++i)
+        {
+            PixelFormat pf = static_cast<PixelFormat>(i);
+            if (!accessibleOnly || isAccessible(pf))
+            {
+                if (tmp == getFormatName(pf))
+                    return pf;
+            }
+        }
+        return PF_UNKNOWN;
+    }
+    //-----------------------------------------------------------------------
+    String PixelUtil::getBNFExpressionOfPixelFormats(bool accessibleOnly)
+    {
+        // Collect format names sorted by length, it's required by BNF compiler
+        // that similar tokens need longer ones comes first.
+        typedef std::multimap<String::size_type, String> FormatNameMap;
+        FormatNameMap formatNames;
+        for (size_t i = 0; i < PF_COUNT; ++i)
+        {
+            PixelFormat pf = static_cast<PixelFormat>(i);
+            if (!accessibleOnly || isAccessible(pf))
+            {
+                String formatName = getFormatName(pf);
+                formatNames.insert(std::make_pair(formatName.length(), formatName));
+            }
+        }
+
+        // Populate the BNF expression in reverse order
+        String result;
+        // Note: Stupid M$ VC7.1 can't dealing operator!= with FormatNameMap::const_reverse_iterator.
+        for (FormatNameMap::reverse_iterator j = formatNames.rbegin(); j != formatNames.rend(); ++j)
+        {
+            if (!result.empty())
+                result += " | ";
+            result += "'" + j->second + "'";
+        }
+
+        return result;
+    }
+    //-----------------------------------------------------------------------
+    PixelFormat PixelUtil::getFormatForBitDepths(PixelFormat fmt, ushort integerBits, ushort floatBits)
+    {
+        switch (integerBits)
+        {
+        case 16:
+            switch (fmt)
+            {
+            case PF_R8G8B8:
+            case PF_X8R8G8B8:
+                return PF_R5G6B5;
+
+            case PF_B8G8R8:
+            case PF_X8B8G8R8:
+                return PF_B5G6R5;
+
+            case PF_A8R8G8B8:
+            case PF_R8G8B8A8:
+            case PF_A8B8G8R8:
+            case PF_B8G8R8A8:
+                return PF_A4R4G4B4;
+
+            case PF_A2R10G10B10:
+            case PF_A2B10G10R10:
+                return PF_A1R5G5B5;
+
+            default:
+                // use original image format
+                break;
+            }
+            break;
+
+        case 32:
+            switch (fmt)
+            {
+            case PF_R5G6B5:
+                return PF_X8R8G8B8;
+
+            case PF_B5G6R5:
+                return PF_X8B8G8R8;
+
+            case PF_A4R4G4B4:
+                return PF_A8R8G8B8;
+
+            case PF_A1R5G5B5:
+                return PF_A2R10G10B10;
+
+            default:
+                // use original image format
+                break;
+            }
+            break;
+
+        default:
+            // use original image format
+            break;
+        }
+
+        switch (floatBits)
+        {
+        case 16:
+            switch (fmt)
+            {
+            case PF_FLOAT32_R:
+                return PF_FLOAT16_R;
+
+            case PF_FLOAT32_RGB:
+                return PF_FLOAT16_RGB;
+
+            case PF_FLOAT32_RGBA:
+                return PF_FLOAT16_RGBA;
+
+            default:
+                // use original image format
+                break;
+            }
+            break;
+
+        case 32:
+            switch (fmt)
+            {
+            case PF_FLOAT16_R:
+                return PF_FLOAT32_R;
+
+            case PF_FLOAT16_RGB:
+                return PF_FLOAT32_RGB;
+
+            case PF_FLOAT16_RGBA:
+                return PF_FLOAT32_RGBA;
+
+            default:
+                // use original image format
+                break;
+            }
+            break;
+
+        default:
+            // use original image format
+            break;
+        }
+
+        return fmt;
+    }
+    //-----------------------------------------------------------------------
+    /*************************************************************************
+    * Pixel packing/unpacking utilities
+    */
+    void PixelUtil::packColour(const ColourValue &colour, const PixelFormat pf,  void* dest)
+    {
+        packColour(colour.r, colour.g, colour.b, colour.a, pf, dest);
+    }
+    //-----------------------------------------------------------------------
+    void PixelUtil::packColour(const uint8 r, const uint8 g, const uint8 b, const uint8 a, const PixelFormat pf,  void* dest)
+    {
+        const PixelFormatDescription &des = getDescriptionFor(pf);
+        if(des.flags & PFF_NATIVEENDIAN) {
+            // Shortcut for integer formats packing
+            unsigned int value = ((Bitwise::fixedToFixed(r, 8, des.rbits)<<des.rshift) & des.rmask) |
+                ((Bitwise::fixedToFixed(g, 8, des.gbits)<<des.gshift) & des.gmask) |
+                ((Bitwise::fixedToFixed(b, 8, des.bbits)<<des.bshift) & des.bmask) |
+                ((Bitwise::fixedToFixed(a, 8, des.abits)<<des.ashift) & des.amask);
+            // And write to memory
+            Bitwise::intWrite(dest, des.elemBytes, value);
+        } else {
+            // Convert to float
+            packColour((float)r/255.0f,(float)g/255.0f,(float)b/255.0f,(float)a/255.0f, pf, dest);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void PixelUtil::packColour(const float r, const float g, const float b, const float a, const PixelFormat pf,  void* dest)
+    {
+        // Catch-it-all here
+        const PixelFormatDescription &des = getDescriptionFor(pf);
+        if(des.flags & PFF_NATIVEENDIAN) {
+            // Do the packing
+            //std::cerr << dest << " " << r << " " << g <<  " " << b << " " << a << std::endl;
+            const unsigned int value = ((Bitwise::floatToFixed(r, des.rbits)<<des.rshift) & des.rmask) |
+                ((Bitwise::floatToFixed(g, des.gbits)<<des.gshift) & des.gmask) |
+                ((Bitwise::floatToFixed(b, des.bbits)<<des.bshift) & des.bmask) |
+                ((Bitwise::floatToFixed(a, des.abits)<<des.ashift) & des.amask);
+            // And write to memory
+            Bitwise::intWrite(dest, des.elemBytes, value);
+        } else {
+            switch(pf)
+            {
+            case PF_FLOAT32_R:
+                ((float*)dest)[0] = r;
+                break;
+			case PF_FLOAT32_GR:
+				((float*)dest)[0] = g;
+				((float*)dest)[1] = r;
+				break;
+            case PF_FLOAT32_RGB:
+                ((float*)dest)[0] = r;
+                ((float*)dest)[1] = g;
+                ((float*)dest)[2] = b;
+                break;
+            case PF_FLOAT32_RGBA:
+                ((float*)dest)[0] = r;
+                ((float*)dest)[1] = g;
+                ((float*)dest)[2] = b;
+                ((float*)dest)[3] = a;
+                break;
+            case PF_FLOAT16_R:
+                ((uint16*)dest)[0] = Bitwise::floatToHalf(r);
+                break;
+			case PF_FLOAT16_GR:
+				((uint16*)dest)[0] = Bitwise::floatToHalf(g);
+				((uint16*)dest)[1] = Bitwise::floatToHalf(r);
+				break;
+            case PF_FLOAT16_RGB:
+                ((uint16*)dest)[0] = Bitwise::floatToHalf(r);
+                ((uint16*)dest)[1] = Bitwise::floatToHalf(g);
+                ((uint16*)dest)[2] = Bitwise::floatToHalf(b);
+                break;
+            case PF_FLOAT16_RGBA:
+                ((uint16*)dest)[0] = Bitwise::floatToHalf(r);
+                ((uint16*)dest)[1] = Bitwise::floatToHalf(g);
+                ((uint16*)dest)[2] = Bitwise::floatToHalf(b);
+                ((uint16*)dest)[3] = Bitwise::floatToHalf(a);
+                break;
+            case PF_SHORT_RGB:
+				((uint16*)dest)[0] = Bitwise::floatToFixed(r, 16);
+                ((uint16*)dest)[1] = Bitwise::floatToFixed(g, 16);
+                ((uint16*)dest)[2] = Bitwise::floatToFixed(b, 16);
+                break;
+			case PF_SHORT_RGBA:
+				((uint16*)dest)[0] = Bitwise::floatToFixed(r, 16);
+                ((uint16*)dest)[1] = Bitwise::floatToFixed(g, 16);
+                ((uint16*)dest)[2] = Bitwise::floatToFixed(b, 16);
+                ((uint16*)dest)[3] = Bitwise::floatToFixed(a, 16);
+				break;
+			case PF_BYTE_LA:
+				((uint8*)dest)[0] = Bitwise::floatToFixed(r, 8);
+                ((uint8*)dest)[1] = Bitwise::floatToFixed(a, 8);
+				break;
+            default:
+                // Not yet supported
+                OGRE_EXCEPT(
+                    Exception::ERR_NOT_IMPLEMENTED,
+                    "pack to "+getFormatName(pf)+" not implemented",
+                    "PixelUtil::packColour");
+                break;
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void PixelUtil::unpackColour(ColourValue *colour, PixelFormat pf,  const void* src)
+    {
+        unpackColour(&colour->r, &colour->g, &colour->b, &colour->a, pf, src);
+    }
+    //-----------------------------------------------------------------------
+    void PixelUtil::unpackColour(uint8 *r, uint8 *g, uint8 *b, uint8 *a, PixelFormat pf,  const void* src)
+    {
+        const PixelFormatDescription &des = getDescriptionFor(pf);
+        if(des.flags & PFF_NATIVEENDIAN) {
+            // Shortcut for integer formats unpacking
+            const unsigned int value = Bitwise::intRead(src, des.elemBytes);
+            if(des.flags & PFF_LUMINANCE)
+            {
+                // Luminance format -- only rbits used
+                *r = *g = *b = Bitwise::fixedToFixed(
+                    (value & des.rmask)>>des.rshift, des.rbits, 8);
+            }
+            else
+            {
+                *r = Bitwise::fixedToFixed((value & des.rmask)>>des.rshift, des.rbits, 8);
+                *g = Bitwise::fixedToFixed((value & des.gmask)>>des.gshift, des.gbits, 8);
+                *b = Bitwise::fixedToFixed((value & des.bmask)>>des.bshift, des.bbits, 8);
+            }
+            if(des.flags & PFF_HASALPHA)
+            {
+                *a = Bitwise::fixedToFixed((value & des.amask)>>des.ashift, des.abits, 8);
+            }
+            else
+            {
+                *a = 255; // No alpha, default a component to full
+            }
+        } else {
+            // Do the operation with the more generic floating point
+            float rr, gg, bb, aa;
+            unpackColour(&rr,&gg,&bb,&aa, pf, src);
+            *r = Bitwise::floatToFixed(rr, 8);
+            *g = Bitwise::floatToFixed(gg, 8);
+            *b = Bitwise::floatToFixed(bb, 8);
+            *a = Bitwise::floatToFixed(aa, 8);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void PixelUtil::unpackColour(float *r, float *g, float *b, float *a,
+        PixelFormat pf,  const void* src)
+    {
+        const PixelFormatDescription &des = getDescriptionFor(pf);
+        if(des.flags & PFF_NATIVEENDIAN) {
+            // Shortcut for integer formats unpacking
+            const unsigned int value = Bitwise::intRead(src, des.elemBytes);
+            if(des.flags & PFF_LUMINANCE)
+            {
+                // Luminance format -- only rbits used
+                *r = *g = *b = Bitwise::fixedToFloat(
+                    (value & des.rmask)>>des.rshift, des.rbits);
+            }
+            else
+            {
+                *r = Bitwise::fixedToFloat((value & des.rmask)>>des.rshift, des.rbits);
+                *g = Bitwise::fixedToFloat((value & des.gmask)>>des.gshift, des.gbits);
+                *b = Bitwise::fixedToFloat((value & des.bmask)>>des.bshift, des.bbits);
+            }
+            if(des.flags & PFF_HASALPHA)
+            {
+                *a = Bitwise::fixedToFloat((value & des.amask)>>des.ashift, des.abits);
+            }
+            else
+            {
+                *a = 1.0f; // No alpha, default a component to full
+            }
+        } else {
+            switch(pf)
+            {
+            case PF_FLOAT32_R:
+                *r = *g = *b = ((float*)src)[0];
+                *a = 1.0f;
+                break;
+			case PF_FLOAT32_GR:
+				*g = ((float*)src)[0];
+				*r = *b = ((float*)src)[1];
+				*a = 1.0f;
+				break;
+            case PF_FLOAT32_RGB:
+                *r = ((float*)src)[0];
+                *g = ((float*)src)[1];
+                *b = ((float*)src)[2];
+                *a = 1.0f;
+                break;
+            case PF_FLOAT32_RGBA:
+                *r = ((float*)src)[0];
+                *g = ((float*)src)[1];
+                *b = ((float*)src)[2];
+                *a = ((float*)src)[3];
+                break;
+            case PF_FLOAT16_R:
+                *r = *g = *b = Bitwise::halfToFloat(((uint16*)src)[0]);
+                *a = 1.0f;
+                break;
+			case PF_FLOAT16_GR:
+				*g = Bitwise::halfToFloat(((uint16*)src)[0]);
+				*r = *b = Bitwise::halfToFloat(((uint16*)src)[1]);
+				*a = 1.0f;
+				break;
+            case PF_FLOAT16_RGB:
+                *r = Bitwise::halfToFloat(((uint16*)src)[0]);
+                *g = Bitwise::halfToFloat(((uint16*)src)[1]);
+                *b = Bitwise::halfToFloat(((uint16*)src)[2]);
+                *a = 1.0f;
+                break;
+            case PF_FLOAT16_RGBA:
+                *r = Bitwise::halfToFloat(((uint16*)src)[0]);
+                *g = Bitwise::halfToFloat(((uint16*)src)[1]);
+                *b = Bitwise::halfToFloat(((uint16*)src)[2]);
+                *a = Bitwise::halfToFloat(((uint16*)src)[3]);
+                break;
+			case PF_SHORT_RGB:
+				*r = Bitwise::fixedToFloat(((uint16*)src)[0], 16);
+                *g = Bitwise::fixedToFloat(((uint16*)src)[1], 16);
+				*b = Bitwise::fixedToFloat(((uint16*)src)[2], 16);
+				*a = 1.0f;
+				break;
+			case PF_SHORT_RGBA:
+				*r = Bitwise::fixedToFloat(((uint16*)src)[0], 16);
+                *g = Bitwise::fixedToFloat(((uint16*)src)[1], 16);
+				*b = Bitwise::fixedToFloat(((uint16*)src)[2], 16);
+				*a = Bitwise::fixedToFloat(((uint16*)src)[3], 16);
+				break;
+			case PF_BYTE_LA:
+				*r = *g = *b = Bitwise::fixedToFloat(((uint8*)src)[0], 8);
+				*a = Bitwise::fixedToFloat(((uint8*)src)[1], 8);
+				break;
+            default:
+                // Not yet supported
+                OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED,
+                    "unpack from "+getFormatName(pf)+" not implemented",
+                    "PixelUtil::unpackColour");
+                break;
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    /* Convert pixels from one format to another */
+    void PixelUtil::bulkPixelConversion(void *srcp, PixelFormat srcFormat,
+        void *destp, PixelFormat dstFormat, unsigned int count)
+    {
+        PixelBox src(count, 1, 1, srcFormat, srcp),
+				 dst(count, 1, 1, dstFormat, destp);
+
+        bulkPixelConversion(src, dst);
+    }
+    //-----------------------------------------------------------------------
+    void PixelUtil::bulkPixelConversion(const PixelBox &src, const PixelBox &dst)
+    {
+        assert(src.getWidth() == dst.getWidth() &&
+			   src.getHeight() == dst.getHeight() &&
+			   src.getDepth() == dst.getDepth());
+
+		// Check for compressed formats, we don't support decompression, compression or recoding
+		if(PixelUtil::isCompressed(src.format) || PixelUtil::isCompressed(dst.format))
+		{
+			if(src.format == dst.format)
+			{
+				memcpy(dst.data, src.data, src.getConsecutiveSize());
+				return;
+			}
+			else
+			{
+				OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED,
+					"This method can not be used to compress or decompress images",
+					"PixelUtil::bulkPixelConversion");
+			}
+		}
+
+        // The easy case
+        if(src.format == dst.format) {
+            // Everything consecutive?
+            if(src.isConsecutive() && dst.isConsecutive())
+            {
+				memcpy(dst.data, src.data, src.getConsecutiveSize());
+                return;
+            }
+
+            uint8 *srcptr = static_cast<uint8*>(src.data);
+            uint8 *dstptr = static_cast<uint8*>(dst.data);
+            const size_t srcPixelSize = PixelUtil::getNumElemBytes(src.format);
+            const size_t dstPixelSize = PixelUtil::getNumElemBytes(dst.format);
+
+            // Calculate pitches+skips in bytes
+            const size_t srcRowPitchBytes = src.rowPitch*srcPixelSize;
+            //const size_t srcRowSkipBytes = src.getRowSkip()*srcPixelSize;
+            const size_t srcSliceSkipBytes = src.getSliceSkip()*srcPixelSize;
+
+            const size_t dstRowPitchBytes = dst.rowPitch*dstPixelSize;
+            //const size_t dstRowSkipBytes = dst.getRowSkip()*dstPixelSize;
+            const size_t dstSliceSkipBytes = dst.getSliceSkip()*dstPixelSize;
+
+            // Otherwise, copy per row
+            const size_t rowSize = src.getWidth()*srcPixelSize;
+            for(size_t z=src.front; z<src.back; z++)
+            {
+                for(size_t y=src.top; y<src.bottom; y++)
+                {
+					memcpy(dstptr, srcptr, rowSize);
+                    srcptr += srcRowPitchBytes;
+                    dstptr += dstRowPitchBytes;
+                }
+                srcptr += srcSliceSkipBytes;
+                dstptr += dstSliceSkipBytes;
+            }
+            return;
+        }
+		// Converting to PF_X8R8G8B8 is exactly the same as converting to
+		// PF_A8R8G8B8. (same with PF_X8B8G8R8 and PF_A8B8G8R8)
+		if(dst.format == PF_X8R8G8B8 || dst.format == PF_X8B8G8R8)
+		{
+			// Do the same conversion, with PF_A8R8G8B8, which has a lot of
+			// optimized conversions
+			PixelBox tempdst = dst;
+			tempdst.format = dst.format==PF_X8R8G8B8?PF_A8R8G8B8:PF_A8B8G8R8;
+			bulkPixelConversion(src, tempdst);
+			return;
+		}
+		// Converting from PF_X8R8G8B8 is exactly the same as converting from
+		// PF_A8R8G8B8, given that the destination format does not have alpha.
+		if((src.format == PF_X8R8G8B8||src.format == PF_X8B8G8R8) && !hasAlpha(dst.format))
+		{
+			// Do the same conversion, with PF_A8R8G8B8, which has a lot of
+			// optimized conversions
+			PixelBox tempsrc = src;
+			tempsrc.format = src.format==PF_X8R8G8B8?PF_A8R8G8B8:PF_A8B8G8R8;
+			bulkPixelConversion(tempsrc, dst);
+			return;
+		}
+
+// NB VC6 can't handle the templates required for optimised conversion, tough
+#if OGRE_COMPILER != OGRE_COMPILER_MSVC || OGRE_COMP_VER >= 1300
+        // Is there a specialized, inlined, conversion?
+        if(doOptimizedConversion(src, dst))
+        {
+            // If so, good
+            return;
+        }
+#endif
+
+        uint8 *srcptr = static_cast<uint8*>(src.data);
+        uint8 *dstptr = static_cast<uint8*>(dst.data);
+        const size_t srcPixelSize = PixelUtil::getNumElemBytes(src.format);
+        const size_t dstPixelSize = PixelUtil::getNumElemBytes(dst.format);
+
+        // Calculate pitches+skips in bytes
+        const size_t srcRowSkipBytes = src.getRowSkip()*srcPixelSize;
+        const size_t srcSliceSkipBytes = src.getSliceSkip()*srcPixelSize;
+        const size_t dstRowSkipBytes = dst.getRowSkip()*dstPixelSize;
+        const size_t dstSliceSkipBytes = dst.getSliceSkip()*dstPixelSize;
+
+        // The brute force fallback
+        float r,g,b,a;
+        for(size_t z=src.front; z<src.back; z++)
+        {
+            for(size_t y=src.top; y<src.bottom; y++)
+            {
+                for(size_t x=src.left; x<src.right; x++)
+                {
+                    unpackColour(&r, &g, &b, &a, src.format, srcptr);
+                    packColour(r, g, b, a, dst.format, dstptr);
+                    srcptr += srcPixelSize;
+                    dstptr += dstPixelSize;
+                }
+                srcptr += srcRowSkipBytes;
+                dstptr += dstRowSkipBytes;
+            }
+            srcptr += srcSliceSkipBytes;
+            dstptr += dstSliceSkipBytes;
+        }
+    }
+
+}
Index: /OgreMain/src/OgrePlane.cpp
===================================================================
--- /OgreMain/src/OgrePlane.cpp	(revision 5)
+++ /OgreMain/src/OgrePlane.cpp	(revision 5)
@@ -0,0 +1,166 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgrePlane.h"
+#include "OgreMatrix3.h"
+#include "OgreAxisAlignedBox.h" 
+
+namespace Ogre {
+	//-----------------------------------------------------------------------
+	Plane::Plane ()
+	{
+		normal = Vector3::ZERO;
+		d = 0.0;
+	}
+	//-----------------------------------------------------------------------
+	Plane::Plane (const Plane& rhs)
+	{
+		normal = rhs.normal;
+		d = rhs.d;
+	}
+	//-----------------------------------------------------------------------
+	Plane::Plane (const Vector3& rkNormal, Real fConstant)
+	{
+		normal = rkNormal;
+		d = -fConstant;
+	}
+	//-----------------------------------------------------------------------
+	Plane::Plane (const Vector3& rkNormal, const Vector3& rkPoint)
+	{
+		redefine(rkNormal, rkPoint);
+	}
+	//-----------------------------------------------------------------------
+	Plane::Plane (const Vector3& rkPoint0, const Vector3& rkPoint1,
+		const Vector3& rkPoint2)
+	{
+		redefine(rkPoint0, rkPoint1, rkPoint2);
+	}
+	//-----------------------------------------------------------------------
+	Real Plane::getDistance (const Vector3& rkPoint) const
+	{
+		return normal.dotProduct(rkPoint) + d;
+	}
+	//-----------------------------------------------------------------------
+	Plane::Side Plane::getSide (const Vector3& rkPoint) const
+	{
+		Real fDistance = getDistance(rkPoint);
+
+		if ( fDistance < 0.0 )
+			return Plane::NEGATIVE_SIDE;
+
+		if ( fDistance > 0.0 )
+			return Plane::POSITIVE_SIDE;
+
+		return Plane::NO_SIDE;
+	}
+
+
+	//-----------------------------------------------------------------------
+	Plane::Side Plane::getSide (const AxisAlignedBox& box) const
+	{
+		if (box.isNull()) 
+			return NO_SIDE;
+		if (box.isInfinite())
+			return BOTH_SIDE;
+
+        return getSide(box.getCenter(), box.getHalfSize());
+	}
+    //-----------------------------------------------------------------------
+    Plane::Side Plane::getSide (const Vector3& centre, const Vector3& halfSize) const
+    {
+        // Calculate the distance between box centre and the plane
+        Real dist = getDistance(centre);
+
+        // Calculate the maximise allows absolute distance for
+        // the distance between box centre and plane
+        Real maxAbsDist = normal.absDotProduct(halfSize);
+
+        if (dist < -maxAbsDist)
+            return Plane::NEGATIVE_SIDE;
+
+        if (dist > +maxAbsDist)
+            return Plane::POSITIVE_SIDE;
+
+        return Plane::BOTH_SIDE;
+    }
+	//-----------------------------------------------------------------------
+	void Plane::redefine(const Vector3& rkPoint0, const Vector3& rkPoint1,
+		const Vector3& rkPoint2)
+	{
+		Vector3 kEdge1 = rkPoint1 - rkPoint0;
+		Vector3 kEdge2 = rkPoint2 - rkPoint0;
+		normal = kEdge1.crossProduct(kEdge2);
+		normal.normalise();
+		d = -normal.dotProduct(rkPoint0);
+	}
+	//-----------------------------------------------------------------------
+	void Plane::redefine(const Vector3& rkNormal, const Vector3& rkPoint)
+	{
+		normal = rkNormal;
+		d = -rkNormal.dotProduct(rkPoint);
+	}
+	//-----------------------------------------------------------------------
+	Vector3 Plane::projectVector(const Vector3& p) const
+	{
+		// We know plane normal is unit length, so use simple method
+		Matrix3 xform;
+		xform[0][0] = 1.0f - normal.x * normal.x;
+		xform[0][1] = -normal.x * normal.y;
+		xform[0][2] = -normal.x * normal.z;
+		xform[1][0] = -normal.y * normal.x;
+		xform[1][1] = 1.0f - normal.y * normal.y;
+		xform[1][2] = -normal.y * normal.z;
+		xform[2][0] = -normal.z * normal.x;
+		xform[2][1] = -normal.z * normal.y;
+		xform[2][2] = 1.0f - normal.z * normal.z;
+		return xform * p;
+
+	}
+	//-----------------------------------------------------------------------
+    Real Plane::normalise(void)
+    {
+        Real fLength = normal.length();
+
+        // Will also work for zero-sized vectors, but will change nothing
+        if (fLength > 1e-08f)
+        {
+            Real fInvLength = 1.0f / fLength;
+            normal *= fInvLength;
+            d *= fInvLength;
+        }
+
+        return fLength;
+    }
+	//-----------------------------------------------------------------------
+	std::ostream& operator<< (std::ostream& o, const Plane& p)
+	{
+		o << "Plane(normal=" << p.normal << ", d=" << p.d << ")";
+		return o;
+	}
+} // namespace Ogre
Index: /OgreMain/src/OgrePlatformInformation.cpp
===================================================================
--- /OgreMain/src/OgrePlatformInformation.cpp	(revision 5)
+++ /OgreMain/src/OgrePlatformInformation.cpp	(revision 5)
@@ -0,0 +1,523 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgrePlatformInformation.h"
+#include "OgreLog.h"
+#include "OgreStringConverter.h"
+
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+#include <excpt.h>      // For SEH values
+	#if _MSC_VER >= 1400
+		#include <intrin.h>
+	#endif
+#elif OGRE_COMPILER == OGRE_COMPILER_GNUC
+#include <signal.h>
+#include <setjmp.h>
+
+#endif
+
+// Yes, I known, this file looks very ugly, but there hasn't other ways to do it better.
+
+namespace Ogre {
+
+#if OGRE_CPU == OGRE_CPU_X86
+
+    //---------------------------------------------------------------------
+    // Struct for store CPUID instruction result, compiler-independent
+    //---------------------------------------------------------------------
+    struct CpuidResult
+    {
+        // Note: DO NOT CHANGE THE ORDER, some code based on that.
+        uint _eax;
+        uint _ebx;
+        uint _edx;
+        uint _ecx;
+    };
+
+    //---------------------------------------------------------------------
+    // Compiler-dependent routines
+    //---------------------------------------------------------------------
+
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+#pragma warning(push)
+#pragma warning(disable: 4035)  // no return value
+#endif
+
+    //---------------------------------------------------------------------
+    // Detect whether CPU supports CPUID instruction, returns non-zero if supported.
+    static int _isSupportCpuid(void)
+    {
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+		// Visual Studio 2005 & 64-bit compilers always supports __cpuid intrinsic
+		// note that even though this is a build rather than runtime setting, all
+		// 64-bit CPUs support this so since binary is 64-bit only we're ok
+	#if _MSC_VER >= 1400 && defined(_M_X64)
+		return true;
+	#else
+		// If we can modify flag register bit 21, the cpu is supports CPUID instruction
+        __asm
+        {
+            // Read EFLAG
+            pushfd
+            pop     eax
+            mov     ecx, eax
+
+            // Modify bit 21
+            xor     eax, 0x200000
+            push    eax
+            popfd
+
+            // Read back EFLAG
+            pushfd
+            pop     eax
+
+            // Restore EFLAG
+            push    ecx
+            popfd
+
+            // Check bit 21 modifiable
+            xor     eax, ecx
+            neg     eax
+            sbb     eax, eax
+
+            // Return values in eax, no return statment requirement here for VC.
+        }
+	#endif
+#elif OGRE_COMPILER == OGRE_COMPILER_GNUC
+        unsigned oldFlags, newFlags;
+        __asm__
+        (
+            "pushfl         \n\t"
+            "pop    %0      \n\t"
+            "mov    %0, %1  \n\t"
+            "xor    %2, %0  \n\t"
+            "push   %0      \n\t"
+            "popfl          \n\t"
+            "pushfl         \n\t"
+            "pop    %0      \n\t"
+            "push   %1      \n\t"
+            "popfl          \n\t"
+            : "=r" (oldFlags), "=r" (newFlags)
+            : "n" (0x200000)
+        );
+        return oldFlags != newFlags;
+
+#else
+        // TODO: Supports other compiler
+        return false;
+#endif
+    }
+
+    //---------------------------------------------------------------------
+    // Performs CPUID instruction with 'query', fill the results, and return value of eax.
+    static uint _performCpuid(int query, CpuidResult& result)
+    {
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+	#if _MSC_VER >= 1400 
+		int CPUInfo[4];
+		__cpuid(CPUInfo, query);
+		result._eax = CPUInfo[0];
+		result._ebx = CPUInfo[1];
+		result._ecx = CPUInfo[2];
+		result._edx = CPUInfo[3];
+		return result._eax;
+	#else
+        __asm
+        {
+            mov     edi, result
+            mov     eax, query
+            cpuid
+            mov     [edi]._eax, eax
+            mov     [edi]._ebx, ebx
+            mov     [edi]._edx, edx
+            mov     [edi]._ecx, ecx
+            // Return values in eax, no return statment requirement here for VC.
+        }
+	#endif
+#elif OGRE_COMPILER == OGRE_COMPILER_GNUC
+        __asm__
+        (
+            "pushl  %%ebx           \n\t"
+            "cpuid                  \n\t"
+            "movl   %%ebx, %%edi    \n\t"
+            "popl   %%ebx           \n\t"
+            : "=a" (result._eax), "=D" (result._ebx), "=c" (result._ecx), "=d" (result._edx)
+            : "a" (query)
+        );
+        return result._eax;
+
+#else
+        // TODO: Supports other compiler
+        return 0;
+#endif
+    }
+
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+#pragma warning(pop)
+#endif
+
+    //---------------------------------------------------------------------
+    // Detect whether or not os support Streaming SIMD Extension.
+#if OGRE_COMPILER == OGRE_COMPILER_GNUC
+    static jmp_buf sIllegalJmpBuf;
+    static void _illegalHandler(int x)
+    {
+        (void)(x); // Unused
+        longjmp(sIllegalJmpBuf, 1);
+    }
+#endif
+    static bool _checkOperatingSystemSupportSSE(void)
+    {
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+        /*
+            The FP part of SSE introduces a new architectural state and therefore
+            requires support from the operating system. So even if CPUID indicates
+            support for SSE FP, the application might not be able to use it. If
+            CPUID indicates support for SSE FP, check here whether it is also
+            supported by the OS, and turn off the SSE FP feature bit if there
+            is no OS support for SSE FP.
+
+            Operating systems that do not support SSE FP return an illegal
+            instruction exception if execution of an SSE FP instruction is performed.
+            Here, a sample SSE FP instruction is executed, and is checked for an
+            exception using the (non-standard) __try/__except mechanism
+            of Microsoft Visual C/C++.
+        */
+		// Visual Studio 2005, Both AMD and Intel x64 support SSE
+		// note that even though this is a build rather than runtime setting, all
+		// 64-bit CPUs support this so since binary is 64-bit only we're ok
+	#if _MSC_VER >= 1400 && defined(_M_X64)
+			return true;
+	#else
+        __try
+        {
+            __asm orps  xmm0, xmm0
+            return true;
+        }
+        __except(EXCEPTION_EXECUTE_HANDLER)
+        {
+            return false;
+        }
+	#endif
+#elif OGRE_COMPILER == OGRE_COMPILER_GNUC
+        // Does gcc have __try/__except similar mechanism?
+        // Use signal, setjmp/longjmp instead.
+        void (*oldHandler)(int);
+        oldHandler = signal(SIGILL, _illegalHandler);
+
+        if (setjmp(sIllegalJmpBuf))
+        {
+            signal(SIGILL, oldHandler);
+            return false;
+        }
+        else
+        {
+            __asm__ __volatile__ ("orps %xmm0, %xmm0");
+            signal(SIGILL, oldHandler);
+            return true;
+        }
+
+#else
+        // TODO: Supports other compiler, assumed is supported by default
+        return true;
+#endif
+    }
+
+    //---------------------------------------------------------------------
+    // Compiler-independent routines
+    //---------------------------------------------------------------------
+
+    static uint queryCpuFeatures(void)
+    {
+#define CPUID_STD_FPU               (1<<0)
+#define CPUID_STD_TSC               (1<<4)
+#define CPUID_STD_CMOV              (1<<15)
+#define CPUID_STD_MMX               (1<<23)
+#define CPUID_STD_SSE               (1<<25)
+#define CPUID_STD_SSE2              (1<<26)
+#define CPUID_STD_HTT               (1<<28)     // EDX[28] - Bit 28 set indicates  Hyper-Threading Technology is supported in hardware.
+
+#define CPUID_STD_SSE3              (1<<0)      // ECX[0] - Bit 0 of standard function 1 indicate SSE3 supported
+
+#define CPUID_FAMILY_ID_MASK        0x0F00      // EAX[11:8] - Bit 11 thru 8 contains family  processor id
+#define CPUID_EXT_FAMILY_ID_MASK    0x0F00000   // EAX[23:20] - Bit 23 thru 20 contains extended family processor id
+#define CPUID_PENTIUM4_ID           0x0F00      // Pentium 4 family processor id
+
+#define CPUID_EXT_3DNOW             (1<<31)
+#define CPUID_EXT_AMD_3DNOWEXT      (1<<30)
+#define CPUID_EXT_AMD_MMXEXT        (1<<22)
+
+        uint features = 0;
+
+        // Supports CPUID instruction ?
+        if (_isSupportCpuid())
+        {
+            CpuidResult result;
+
+            // Has standard feature ?
+            if (_performCpuid(0, result))
+            {
+                // Check vendor strings
+                if (memcmp(&result._ebx, "GenuineIntel", 12) == 0)
+                {
+                    if (result._eax > 2)
+                        features |= PlatformInformation::CPU_FEATURE_PRO;
+
+                    // Check standard feature
+                    _performCpuid(1, result);
+
+                    if (result._edx & CPUID_STD_FPU)
+                        features |= PlatformInformation::CPU_FEATURE_FPU;
+                    if (result._edx & CPUID_STD_TSC)
+                        features |= PlatformInformation::CPU_FEATURE_TSC;
+                    if (result._edx & CPUID_STD_CMOV)
+                        features |= PlatformInformation::CPU_FEATURE_CMOV;
+                    if (result._edx & CPUID_STD_MMX)
+                        features |= PlatformInformation::CPU_FEATURE_MMX;
+                    if (result._edx & CPUID_STD_SSE)
+                        features |= PlatformInformation::CPU_FEATURE_MMXEXT | PlatformInformation::CPU_FEATURE_SSE;
+                    if (result._edx & CPUID_STD_SSE2)
+                        features |= PlatformInformation::CPU_FEATURE_SSE2;
+
+                    if (result._ecx & CPUID_STD_SSE3)
+                        features |= PlatformInformation::CPU_FEATURE_SSE3;
+
+                    // Check to see if this is a Pentium 4 or later processor
+                    if ((result._eax & CPUID_EXT_FAMILY_ID_MASK) ||
+                        (result._eax & CPUID_FAMILY_ID_MASK) == CPUID_PENTIUM4_ID)
+                    {
+                        // Check hyper-threading technology
+                        if (result._edx & CPUID_STD_HTT)
+                            features |= PlatformInformation::CPU_FEATURE_HTT;
+                    }
+                }
+                else if (memcmp(&result._ebx, "AuthenticAMD", 12) == 0)
+                {
+                    features |= PlatformInformation::CPU_FEATURE_PRO;
+
+                    // Check standard feature
+                    _performCpuid(1, result);
+
+                    if (result._edx & CPUID_STD_FPU)
+                        features |= PlatformInformation::CPU_FEATURE_FPU;
+                    if (result._edx & CPUID_STD_TSC)
+                        features |= PlatformInformation::CPU_FEATURE_TSC;
+                    if (result._edx & CPUID_STD_CMOV)
+                        features |= PlatformInformation::CPU_FEATURE_CMOV;
+                    if (result._edx & CPUID_STD_MMX)
+                        features |= PlatformInformation::CPU_FEATURE_MMX;
+                    if (result._edx & CPUID_STD_SSE)
+                        features |= PlatformInformation::CPU_FEATURE_SSE;
+                    if (result._edx & CPUID_STD_SSE2)
+                        features |= PlatformInformation::CPU_FEATURE_SSE2;
+
+                    if (result._ecx & CPUID_STD_SSE3)
+                        features |= PlatformInformation::CPU_FEATURE_SSE3;
+
+                    // Has extended feature ?
+                    if (_performCpuid(0x80000000, result) > 0x80000000)
+                    {
+                        // Check extended feature
+                        _performCpuid(0x80000001, result);
+
+                        if (result._edx & CPUID_EXT_3DNOW)
+                            features |= PlatformInformation::CPU_FEATURE_3DNOW;
+                        if (result._edx & CPUID_EXT_AMD_3DNOWEXT)
+                            features |= PlatformInformation::CPU_FEATURE_3DNOWEXT;
+                        if (result._edx & CPUID_EXT_AMD_MMXEXT)
+                            features |= PlatformInformation::CPU_FEATURE_MMXEXT;
+                    }
+                }
+            }
+        }
+
+        return features;
+    }
+    //---------------------------------------------------------------------
+    static uint _detectCpuFeatures(void)
+    {
+        uint features = queryCpuFeatures();
+
+        const uint sse_features = PlatformInformation::CPU_FEATURE_SSE |
+            PlatformInformation::CPU_FEATURE_SSE2 | PlatformInformation::CPU_FEATURE_SSE3;
+        if ((features & sse_features) && !_checkOperatingSystemSupportSSE())
+        {
+            features &= ~sse_features;
+        }
+
+        return features;
+    }
+    //---------------------------------------------------------------------
+    static String _detectCpuIdentifier(void)
+    {
+		// Supports CPUID instruction ?
+		if (_isSupportCpuid())
+		{
+			CpuidResult result;
+			uint nExIds;
+			char CPUString[0x20];
+			char CPUBrandString[0x40];
+
+			StringUtil::StrStreamType detailedIdentStr;
+
+
+			// Has standard feature ?
+			if (_performCpuid(0, result))
+			{
+				memset(CPUString, 0, sizeof(CPUString));
+				memset(CPUBrandString, 0, sizeof(CPUBrandString));
+
+				*((int*)CPUString) = result._ebx;
+				*((int*)(CPUString+4)) = result._edx;
+				*((int*)(CPUString+8)) = result._ecx;
+
+				detailedIdentStr << CPUString;
+
+				// Calling _performCpuid with 0x80000000 as the query argument
+				// gets the number of valid extended IDs.
+				nExIds = _performCpuid(0x80000000, result);
+
+				for (uint i=0x80000000; i<=nExIds; ++i)
+				{
+					_performCpuid(i, result);
+
+					// Interpret CPU brand string and cache information.
+					if  (i == 0x80000002)
+                    {
+						memcpy(CPUBrandString + 0, &result._eax, sizeof(result._eax));
+						memcpy(CPUBrandString + 4, &result._ebx, sizeof(result._ebx));
+						memcpy(CPUBrandString + 8, &result._ecx, sizeof(result._ecx));
+						memcpy(CPUBrandString + 12, &result._edx, sizeof(result._edx));
+                    }
+					else if  (i == 0x80000003)
+                    {
+						memcpy(CPUBrandString + 16 + 0, &result._eax, sizeof(result._eax));
+						memcpy(CPUBrandString + 16 + 4, &result._ebx, sizeof(result._ebx));
+						memcpy(CPUBrandString + 16 + 8, &result._ecx, sizeof(result._ecx));
+						memcpy(CPUBrandString + 16 + 12, &result._edx, sizeof(result._edx));
+                    }
+					else if  (i == 0x80000004)
+                    {
+						memcpy(CPUBrandString + 32 + 0, &result._eax, sizeof(result._eax));
+						memcpy(CPUBrandString + 32 + 4, &result._ebx, sizeof(result._ebx));
+						memcpy(CPUBrandString + 32 + 8, &result._ecx, sizeof(result._ecx));
+						memcpy(CPUBrandString + 32 + 12, &result._edx, sizeof(result._edx));
+                    }
+				}
+
+				String brand(CPUBrandString);
+				StringUtil::trim(brand);
+				if (!brand.empty())
+					detailedIdentStr << ": " << brand;
+
+				return detailedIdentStr.str();
+			}
+		}
+
+		return "X86";
+    }
+
+#else   // OGRE_CPU == OGRE_CPU_X86
+
+    //---------------------------------------------------------------------
+    static uint _detectCpuFeatures(void)
+    {
+        return 0;
+    }
+    //---------------------------------------------------------------------
+    static String _detectCpuIdentifier(void)
+    {
+        return "Unknown";
+    }
+
+#endif  // OGRE_CPU
+
+    //---------------------------------------------------------------------
+    // Platform-independent routines, but the returns value are platform-dependent
+    //---------------------------------------------------------------------
+
+    const String& PlatformInformation::getCpuIdentifier(void)
+    {
+        static const String sIdentifier = _detectCpuIdentifier();
+        return sIdentifier;
+    }
+    //---------------------------------------------------------------------
+    uint PlatformInformation::getCpuFeatures(void)
+    {
+        static const uint sFeatures = _detectCpuFeatures();
+        return sFeatures;
+    }
+	//---------------------------------------------------------------------
+	bool PlatformInformation::hasCpuFeature(CpuFeatures feature)
+	{
+		return (getCpuFeatures() & feature) != 0;
+	}
+	//---------------------------------------------------------------------
+	void PlatformInformation::log(Log* pLog)
+	{
+		pLog->logMessage("CPU Identifier & Features");
+		pLog->logMessage("-------------------------");
+		pLog->logMessage(
+			" *   CPU ID: " + getCpuIdentifier());
+#if OGRE_CPU == OGRE_CPU_X86
+		if(_isSupportCpuid())
+		{
+			pLog->logMessage(
+				" *      SSE: " + StringConverter::toString(hasCpuFeature(CPU_FEATURE_SSE), true));
+			pLog->logMessage(
+				" *     SSE2: " + StringConverter::toString(hasCpuFeature(CPU_FEATURE_SSE2), true));
+			pLog->logMessage(
+				" *     SSE3: " + StringConverter::toString(hasCpuFeature(CPU_FEATURE_SSE3), true));
+			pLog->logMessage(
+				" *      MMX: " + StringConverter::toString(hasCpuFeature(CPU_FEATURE_MMX), true));
+			pLog->logMessage(
+				" *   MMXEXT: " + StringConverter::toString(hasCpuFeature(CPU_FEATURE_MMXEXT), true));
+			pLog->logMessage(
+				" *    3DNOW: " + StringConverter::toString(hasCpuFeature(CPU_FEATURE_3DNOW), true));
+			pLog->logMessage(
+				" * 3DNOWEXT: " + StringConverter::toString(hasCpuFeature(CPU_FEATURE_3DNOWEXT), true));
+			pLog->logMessage(
+				" *     CMOV: " + StringConverter::toString(hasCpuFeature(CPU_FEATURE_CMOV), true));
+			pLog->logMessage(
+				" *      TSC: " + StringConverter::toString(hasCpuFeature(CPU_FEATURE_TSC), true));
+			pLog->logMessage(
+				" *      FPU: " + StringConverter::toString(hasCpuFeature(CPU_FEATURE_FPU), true));
+			pLog->logMessage(
+				" *      PRO: " + StringConverter::toString(hasCpuFeature(CPU_FEATURE_PRO), true));
+			pLog->logMessage(
+				" *       HT: " + StringConverter::toString(hasCpuFeature(CPU_FEATURE_HTT), true));
+		}
+#endif
+		pLog->logMessage("-------------------------");
+
+	}
+
+
+}
Index: /OgreMain/src/OgrePolygon.cpp
===================================================================
--- /OgreMain/src/OgrePolygon.cpp	(revision 5)
+++ /OgreMain/src/OgrePolygon.cpp	(revision 5)
@@ -0,0 +1,227 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Copyright (c) 2006 Matthias Fink, netAllied GmbH <matthias.fink@web.de>								
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgrePolygon.h"
+#include "OgreException.h"
+#include "OgreVector3.h"
+
+namespace Ogre
+{
+
+	//-----------------------------------------------------------------------
+	Polygon::Polygon()
+	: mNormal( Vector3::ZERO )
+	, mIsNormalSet(false)
+	{
+		// reserve space for 6 vertices to reduce allocation cost
+		mVertexList.reserve(6);
+	}
+	//-----------------------------------------------------------------------
+	Polygon::~Polygon()
+	{
+	}
+	//-----------------------------------------------------------------------
+	Polygon::Polygon( const Polygon& cpy )
+	{
+		mVertexList = cpy.mVertexList;
+		mNormal = cpy.mNormal;
+		mIsNormalSet = cpy.mIsNormalSet;
+	}
+	//-----------------------------------------------------------------------
+	void Polygon::insertVertex(const Vector3& vdata, size_t vertex )
+	{
+		// TODO: optional: check planarity
+		OgreAssert(vertex <= getVertexCount(), "Insert position out of range" );
+
+		VertexList::iterator it = mVertexList.begin();
+
+		std::advance(it, vertex);
+		mVertexList.insert(it, vdata);
+
+	}
+	//-----------------------------------------------------------------------
+	void Polygon::insertVertex(const Vector3& vdata)
+	{
+		mVertexList.push_back(vdata);
+	}
+	//-----------------------------------------------------------------------
+	const Vector3& Polygon::getVertex( size_t vertex ) const
+	{
+		OgreAssert(vertex < getVertexCount(), "Search position out of range");
+
+		return mVertexList[vertex];
+	}
+	//-----------------------------------------------------------------------
+	void Polygon::setVertex(const Vector3& vdata, size_t vertex )
+	{
+		// TODO: optional: check planarity
+		OgreAssert(vertex < getVertexCount(), "Search position out of range" );
+
+		// set new vertex
+		mVertexList[ vertex ] = vdata;
+	}
+	//-----------------------------------------------------------------------
+	void Polygon::removeDuplicates( void )
+	{
+		for ( size_t i = 0; i < getVertexCount(); ++i )
+		{
+			const Vector3& a = getVertex( i );
+			const Vector3& b = getVertex( (i + 1)%getVertexCount() );
+
+			if (a.positionEquals(b))
+			{
+				deleteVertex(i);
+				--i;
+			}
+		}
+	}
+	//-----------------------------------------------------------------------
+	size_t Polygon::getVertexCount( void ) const
+	{
+		return mVertexList.size();
+	}
+	//-----------------------------------------------------------------------
+	const Vector3& Polygon::getNormal( void )
+	{
+		OgreAssert( getVertexCount() >= 3, "Insufficient vertex count!" );
+
+		updateNormal();
+
+		return mNormal;
+	}
+	//-----------------------------------------------------------------------
+	void Polygon::updateNormal( void )
+	{
+		OgreAssert( getVertexCount() >= 3, "Insufficient vertex count!" );
+
+		if (mIsNormalSet)
+			return;
+
+		// vertex order is ccw
+		const Vector3& a = getVertex( 0 );
+		const Vector3& b = getVertex( 1 );
+		const Vector3& c = getVertex( 2 );
+
+		// used method: Newell
+		mNormal.x = 0.5f * ( (a.y - b.y) * (a.z + b.z) +
+							   (b.y - c.y) * (b.z + c.z) + 
+							   (c.y - a.y) * (c.z + a.z));
+
+		mNormal.y = 0.5f * ( (a.z - b.z) * (a.x + b.x) +
+							   (b.z - c.z) * (b.x + c.x) + 
+							   (c.z - a.z) * (c.x + a.x));
+
+		mNormal.z = 0.5f * ( (a.x - b.x) * (a.y + b.y) +
+							   (b.x - c.x) * (b.y + c.y) + 
+							   (c.x - a.x) * (c.y + a.y));
+
+		mNormal.normalise();
+
+		mIsNormalSet = true;
+
+	}
+	//-----------------------------------------------------------------------
+	void Polygon::deleteVertex( size_t vertex )
+	{
+		OgreAssert( vertex < getVertexCount(), "Search position out of range" );
+
+		VertexList::iterator it = mVertexList.begin();
+		std::advance(it, vertex);
+
+		mVertexList.erase( it );
+	}
+	//-----------------------------------------------------------------------
+	void Polygon::storeEdges( Polygon::EdgeMap *edgeMap ) const
+	{
+		OgreAssert( edgeMap != NULL, "EdgeMap ptr is NULL" );
+
+		size_t vertexCount = getVertexCount();
+
+		for ( size_t i = 0; i < vertexCount; ++i )
+		{
+			edgeMap->insert( Edge( getVertex( i ), getVertex( ( i + 1 ) % vertexCount ) ) );
+		}
+	}
+	//-----------------------------------------------------------------------
+	void Polygon::reset( void )
+	{
+		// could use swap() to free memory here, but assume most may be reused so avoid realloc
+		mVertexList.clear();
+
+		mIsNormalSet = false;
+	}
+	//-----------------------------------------------------------------------
+	bool Polygon::operator == (const Polygon& rhs) const
+	{
+		if ( getVertexCount() != rhs.getVertexCount() )
+			return false;
+
+		// Compare vertices. They may differ in its starting position.
+		// find start
+		size_t start;
+		bool foundStart = false;
+		for (size_t i = 0; i < getVertexCount(); ++i )
+		{	
+			if (getVertex(0).positionEquals(rhs.getVertex(i)))
+			{
+				start = i;
+				foundStart = true;
+				break;
+			}
+		}
+
+		if (!foundStart)
+			return false;
+
+		for (size_t i = 0; i < getVertexCount(); ++i )
+		{
+			const Vector3& vA = getVertex( i );
+			const Vector3& vB = rhs.getVertex( ( i + start) % getVertexCount() );
+
+			if (!vA.positionEquals(vB))
+				return false;
+		}
+
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	std::ostream& operator<< ( std::ostream& strm, const Polygon& poly )
+	{
+		strm << "NUM VERTICES: " << poly.getVertexCount() << std::endl;
+
+		for (size_t j = 0; j < poly.getVertexCount(); ++j )
+		{
+			strm << "VERTEX " << j << ": " << poly.getVertex( j ) << std::endl;
+		}
+
+		return strm;
+	}
+	//-----------------------------------------------------------------------
+}
Index: /OgreMain/src/OgrePose.cpp
===================================================================
--- /OgreMain/src/OgrePose.cpp	(revision 5)
+++ /OgreMain/src/OgrePose.cpp	(revision 5)
@@ -0,0 +1,114 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2005 The OGRE Team
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgrePose.h"
+#include "OgreHardwareBufferManager.h"
+
+namespace Ogre {
+	//---------------------------------------------------------------------
+	Pose::Pose(ushort target, const String& name)
+		: mTarget(target), mName(name)
+	{
+	}
+	//---------------------------------------------------------------------
+	Pose::~Pose()
+	{
+	}
+	//---------------------------------------------------------------------
+	void Pose::addVertex(size_t index, const Vector3& offset)
+	{
+		mVertexOffsetMap[index] = offset;
+		mBuffer.setNull();
+	}
+	//---------------------------------------------------------------------
+	void Pose::removeVertex(size_t index)
+	{
+		VertexOffsetMap::iterator i = mVertexOffsetMap.find(index);
+		if (i != mVertexOffsetMap.end())
+		{
+			mVertexOffsetMap.erase(i);
+			mBuffer.setNull();
+		}
+	}
+	//---------------------------------------------------------------------
+	void Pose::clearVertexOffsets(void)
+	{
+		mVertexOffsetMap.clear();
+		mBuffer.setNull();
+	}
+	//---------------------------------------------------------------------
+	Pose::ConstVertexOffsetIterator 
+		Pose::getVertexOffsetIterator(void) const
+	{
+		return ConstVertexOffsetIterator(mVertexOffsetMap.begin(), mVertexOffsetMap.end());
+	}
+	//---------------------------------------------------------------------
+	Pose::VertexOffsetIterator 
+		Pose::getVertexOffsetIterator(void)
+	{
+		return VertexOffsetIterator(mVertexOffsetMap.begin(), mVertexOffsetMap.end());
+	}
+	//---------------------------------------------------------------------
+	const HardwareVertexBufferSharedPtr& Pose::_getHardwareVertexBuffer(size_t numVertices) const
+	{
+		if (mBuffer.isNull())
+		{
+			// Create buffer
+			mBuffer = HardwareBufferManager::getSingleton().createVertexBuffer(
+				VertexElement::getTypeSize(VET_FLOAT3),
+				numVertices, HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+
+			float* pFloat = static_cast<float*>(
+				mBuffer->lock(HardwareBuffer::HBL_DISCARD));
+			// initialise
+			memset(pFloat, 0, mBuffer->getSizeInBytes()); 
+			// Set each vertex
+			for (VertexOffsetMap::const_iterator i = mVertexOffsetMap.begin();
+				i != mVertexOffsetMap.end(); ++i)
+			{
+				float* pDst = pFloat + (3 * i->first);
+				*pDst++ = i->second.x;
+				*pDst++ = i->second.y;
+				*pDst++ = i->second.z;
+			}
+			mBuffer->unlock();
+		}
+		return mBuffer;
+	}
+	//---------------------------------------------------------------------
+	Pose* Pose::clone(void) const
+	{
+		Pose* newPose = new Pose(mTarget, mName);
+		newPose->mVertexOffsetMap = mVertexOffsetMap;
+		// Allow buffer to recreate itself, contents may change anyway
+		return newPose;
+	}
+
+}
+
Index: /OgreMain/src/OgrePrecompiledHeaders.cpp
===================================================================
--- /OgreMain/src/OgrePrecompiledHeaders.cpp	(revision 5)
+++ /OgreMain/src/OgrePrecompiledHeaders.cpp	(revision 5)
@@ -0,0 +1,32 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+// This source file generates the precompiled headers
+
+#include "OgreStableHeaders.h"
Index: /OgreMain/src/OgrePredefinedControllers.cpp
===================================================================
--- /OgreMain/src/OgrePredefinedControllers.cpp	(revision 5)
+++ /OgreMain/src/OgrePredefinedControllers.cpp	(revision 5)
@@ -0,0 +1,371 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgrePredefinedControllers.h"
+
+#include "OgreRoot.h"
+#include "OgreMath.h"
+#include "OgreLogManager.h"
+#include "OgreTextureUnitState.h"
+
+namespace Ogre
+{
+    //-----------------------------------------------------------------------
+    // FrameTimeControllerValue
+    //-----------------------------------------------------------------------
+    FrameTimeControllerValue::FrameTimeControllerValue()
+    {
+        // Register self
+        Root::getSingleton().addFrameListener(this);
+        mFrameTime = 0;
+		mTimeFactor = 1;
+		mFrameDelay = 0;
+        mElapsedTime = 0;
+
+    }
+    //-----------------------------------------------------------------------
+    bool FrameTimeControllerValue::frameStarted(const FrameEvent &evt)
+    {
+		if(mFrameDelay) 
+		{
+			// Fixed frame time
+			mFrameTime = mFrameDelay;
+			mTimeFactor =  mFrameDelay / evt.timeSinceLastFrame;
+		}
+		else 
+		{
+			// Save the time value after applying time factor
+			mFrameTime = mTimeFactor * evt.timeSinceLastFrame;
+		}
+        // Accumulate the elapsed time
+        mElapsedTime += mFrameTime;
+        return true;
+    }
+    //-----------------------------------------------------------------------
+    bool FrameTimeControllerValue::frameEnded(const FrameEvent &evt)
+    {
+        return true;
+    }
+    //-----------------------------------------------------------------------
+    Real FrameTimeControllerValue::getValue() const
+    {
+        return mFrameTime;
+    }
+    //-----------------------------------------------------------------------
+    void FrameTimeControllerValue::setValue(Real value)
+    {
+        // Do nothing - value is set from frame listener
+    }
+	//-----------------------------------------------------------------------
+	Real FrameTimeControllerValue::getTimeFactor(void) const {
+		return mTimeFactor;
+	}
+	//-----------------------------------------------------------------------
+	void FrameTimeControllerValue::setTimeFactor(Real tf) {
+		if(tf >= 0) 
+		{
+			mTimeFactor = tf;
+			mFrameDelay = 0;
+		}
+	}
+	//-----------------------------------------------------------------------
+	Real FrameTimeControllerValue::getFrameDelay(void) const {
+		return mFrameDelay;
+	}
+	//-----------------------------------------------------------------------
+	void FrameTimeControllerValue::setFrameDelay(Real fd) {
+		mTimeFactor = 0;
+		mFrameDelay = fd;
+	}
+    //-----------------------------------------------------------------------
+    Real FrameTimeControllerValue::getElapsedTime(void) const
+    {
+        return mElapsedTime;
+    }
+    //-----------------------------------------------------------------------
+    void FrameTimeControllerValue::setElapsedTime(Real elapsedTime)
+    {
+        mElapsedTime = elapsedTime;
+    }
+    //-----------------------------------------------------------------------
+    // TextureFrameControllerValue
+    //-----------------------------------------------------------------------
+    TextureFrameControllerValue::TextureFrameControllerValue(TextureUnitState* t)
+    {
+        mTextureLayer = t;
+    }
+    //-----------------------------------------------------------------------
+    Real TextureFrameControllerValue::getValue(void) const
+    {
+        int numFrames = mTextureLayer->getNumFrames();
+        return (mTextureLayer->getCurrentFrame() / numFrames);
+    }
+    //-----------------------------------------------------------------------
+    void TextureFrameControllerValue::setValue(Real value)
+    {
+        int numFrames = mTextureLayer->getNumFrames();
+        mTextureLayer->setCurrentFrame((int)(value * numFrames) % numFrames);
+    }
+    //-----------------------------------------------------------------------
+    // TexCoordModifierControllerValue
+    //-----------------------------------------------------------------------
+    TexCoordModifierControllerValue::TexCoordModifierControllerValue(TextureUnitState* t,
+        bool translateU, bool translateV, bool scaleU, bool scaleV, bool rotate )
+    {
+        mTextureLayer = t;
+        mTransU = translateU;
+        mTransV = translateV;
+        mScaleU = scaleU;
+        mScaleV = scaleV;
+        mRotate = rotate;
+    }
+    //-----------------------------------------------------------------------
+    Real TexCoordModifierControllerValue::getValue() const
+    {
+        const Matrix4& pMat = mTextureLayer->getTextureTransform();
+        if (mTransU)
+        {
+            return pMat[0][3];
+        }
+        else if (mTransV)
+        {
+            return pMat[1][3];
+        }
+        else if (mScaleU)
+        {
+            return pMat[0][0];
+        }
+        else if (mScaleV)
+        {
+            return pMat[1][1];
+        }
+        // Shouldn't get here
+        return 0;
+    }
+    //-----------------------------------------------------------------------
+    void TexCoordModifierControllerValue::setValue(Real value)
+    {
+        if (mTransU)
+        {
+            mTextureLayer->setTextureUScroll(value);
+        }
+        if (mTransV)
+        {
+            mTextureLayer->setTextureVScroll(value);
+        }
+        if (mScaleU)
+        {
+            if (value >= 0)
+            {
+                // Add 1 to scale (+ve scales up)
+                mTextureLayer->setTextureUScale(1 + value);
+            }
+            else
+            {
+                // (-ve scales down)
+                mTextureLayer->setTextureUScale(1 / -value);
+            }
+        }
+        if (mScaleV)
+        {
+            if (value >= 0)
+            {
+                // Add 1 to scale (+ve scales up)
+                mTextureLayer->setTextureVScale(1 + value);
+            }
+            else
+            {
+                // (-ve scales down)
+                mTextureLayer->setTextureVScale(1 / -value);
+            }
+        }
+        if (mRotate)
+        {
+            mTextureLayer->setTextureRotate(Radian(value * Math::TWO_PI));
+        }
+    }
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+	FloatGpuParameterControllerValue::FloatGpuParameterControllerValue(
+			GpuProgramParameters* params, size_t index) :
+		mParams(params), mParamIndex(index)
+	{
+	}
+    //-----------------------------------------------------------------------
+	Real FloatGpuParameterControllerValue::getValue(void) const
+	{
+		// do nothing, reading from a set of params not supported
+		return 0.0f;
+	}
+    //-----------------------------------------------------------------------
+	void FloatGpuParameterControllerValue::setValue(Real val)
+	{
+		static Vector4 v4 = Vector4(0,0,0,0);
+		v4.x = val;
+		mParams->setConstant(mParamIndex, v4);
+	}
+	//-----------------------------------------------------------------------
+	// PassthroughControllerFunction
+	//-----------------------------------------------------------------------
+	PassthroughControllerFunction::PassthroughControllerFunction(bool delta) 
+		: ControllerFunction<Real>(delta)
+	{
+	}
+	//-----------------------------------------------------------------------
+	Real PassthroughControllerFunction::calculate(Real source)
+	{
+		return getAdjustedInput(source);
+
+	}
+    //-----------------------------------------------------------------------
+    // AnimationControllerFunction
+    //-----------------------------------------------------------------------
+    AnimationControllerFunction::AnimationControllerFunction(Real sequenceTime, Real timeOffset) 
+		: ControllerFunction<Real>(false)
+    {
+        mSeqTime = sequenceTime;
+        mTime = timeOffset;
+    }
+    //-----------------------------------------------------------------------
+    Real AnimationControllerFunction::calculate(Real source)
+    {
+        // Assume source is time since last update
+        mTime += source;
+        // Wrap
+        while (mTime >= mSeqTime) mTime -= mSeqTime;
+        while (mTime < 0) mTime += mSeqTime;
+
+        // Return parametric
+        return mTime / mSeqTime;
+    }
+	//-----------------------------------------------------------------------
+	void AnimationControllerFunction::setTime(Real timeVal)
+	{
+		mTime = timeVal;
+	}
+	//-----------------------------------------------------------------------
+	void AnimationControllerFunction::setSequenceTime(Real seqVal)
+	{
+		mSeqTime = seqVal;
+	}
+    //-----------------------------------------------------------------------
+    // ScaleControllerFunction
+    //-----------------------------------------------------------------------
+    ScaleControllerFunction::ScaleControllerFunction(Real factor, bool delta) : ControllerFunction<Real>(delta)
+    {
+        mScale = factor;
+    }
+    //-----------------------------------------------------------------------
+    Real ScaleControllerFunction::calculate(Real source)
+    {
+        return getAdjustedInput(source * mScale);
+
+    }
+    //-----------------------------------------------------------------------
+    // WaveformControllerFunction
+    //-----------------------------------------------------------------------
+    WaveformControllerFunction::WaveformControllerFunction(WaveformType wType, Real base,  Real frequency, Real phase, Real amplitude, bool delta, Real dutyCycle)
+        :ControllerFunction<Real>(delta)
+    {
+        mWaveType = wType;
+        mBase = base;
+        mFrequency = frequency;
+        mPhase = phase;
+        mAmplitude = amplitude;
+        mDeltaCount = phase;
+		mDutyCycle = dutyCycle;
+    }
+    //-----------------------------------------------------------------------
+    Real WaveformControllerFunction::getAdjustedInput(Real input)
+    {
+        Real adjusted = ControllerFunction<Real>::getAdjustedInput(input);
+
+        // If not delta, adjust by phase here
+        // (delta inputs have it adjusted at initialisation)
+        if (!mDeltaInput)
+        {
+            adjusted += mPhase;
+        }
+
+        return adjusted;
+    }
+    //-----------------------------------------------------------------------
+    Real WaveformControllerFunction::calculate(Real source)
+    {
+        Real input = getAdjustedInput(source * mFrequency);
+        Real output;
+        // For simplicity, factor input down to {0,1)
+        // Use looped subtract rather than divide / round
+        while (input >= 1.0)
+            input -= 1.0;
+        while (input < 0.0)
+            input += 1.0;
+
+        // Calculate output in -1..1 range
+        switch (mWaveType)
+        {
+        case WFT_SINE:
+            output = Math::Sin(Radian(input * Math::TWO_PI));
+            break;
+        case WFT_TRIANGLE:
+            if (input < 0.25)
+                output = input * 4;
+            else if (input >= 0.25 && input < 0.75)
+                output = 1.0 - ((input - 0.25) * 4);
+            else
+                output = ((input - 0.75) * 4) - 1.0;
+
+            break;
+        case WFT_SQUARE:
+            if (input <= 0.5)
+                output = 1.0;
+            else
+                output = -1.0;
+            break;
+        case WFT_SAWTOOTH:
+            output = (input * 2) - 1;
+            break;
+        case WFT_INVERSE_SAWTOOTH:
+            output = -((input * 2) - 1);
+            break;
+		case WFT_PWM:
+			if( input <= mDutyCycle )
+				output = 1.0;
+			else
+				output = -1.0;
+			break;
+        }
+
+        // Scale output into 0..1 range and then by base + amplitude
+        return mBase + ((output + 1.0) * 0.5 * mAmplitude);
+
+
+    }
+}
+
Index: /OgreMain/src/OgrePrefabFactory.cpp
===================================================================
--- /OgreMain/src/OgrePrefabFactory.cpp	(revision 5)
+++ /OgreMain/src/OgrePrefabFactory.cpp	(revision 5)
@@ -0,0 +1,372 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreStableHeaders.h"
+#include "OgrePrefabFactory.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreMesh.h"
+#include "OgreSubMesh.h"
+
+namespace Ogre {
+	//---------------------------------------------------------------------
+	bool PrefabFactory::createPrefab(Mesh* mesh)
+	{
+		const String& resourceName = mesh->getName();
+
+		if(resourceName == "Prefab_Plane")
+		{
+			createPlane(mesh);
+			return true;
+		}
+		else if(resourceName == "Prefab_Cube")
+		{
+			createCube(mesh);
+			return true;
+		}
+		else if(resourceName == "Prefab_Sphere")
+		{
+			createSphere(mesh);
+			return true;
+		}
+	
+		return false;
+	}
+	//---------------------------------------------------------------------
+	void PrefabFactory::createPlane(Mesh* mesh)
+	{
+		SubMesh* sub = mesh->createSubMesh();
+		float vertices[32] = {
+			-100, -100, 0,	// pos
+			0,0,1,			// normal
+			0,1,			// texcoord
+			100, -100, 0,
+			0,0,1,
+			1,1,
+			100,  100, 0,
+			0,0,1,
+			1,0,
+			-100,  100, 0 ,
+			0,0,1,
+			0,0 
+		};
+		mesh->sharedVertexData = new VertexData();
+		mesh->sharedVertexData->vertexCount = 4;
+		VertexDeclaration* decl = mesh->sharedVertexData->vertexDeclaration;
+		VertexBufferBinding* bind = mesh->sharedVertexData->vertexBufferBinding;
+
+		size_t offset = 0;
+		decl->addElement(0, offset, VET_FLOAT3, VES_POSITION);
+		offset += VertexElement::getTypeSize(VET_FLOAT3);
+		decl->addElement(0, offset, VET_FLOAT3, VES_NORMAL);
+		offset += VertexElement::getTypeSize(VET_FLOAT3);
+		decl->addElement(0, offset, VET_FLOAT2, VES_TEXTURE_COORDINATES, 0);
+		offset += VertexElement::getTypeSize(VET_FLOAT2);
+
+		HardwareVertexBufferSharedPtr vbuf = 
+			HardwareBufferManager::getSingleton().createVertexBuffer(
+			offset, 4, HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+		bind->setBinding(0, vbuf);
+
+		vbuf->writeData(0, vbuf->getSizeInBytes(), vertices, true);
+
+		sub->useSharedVertices = true;
+		HardwareIndexBufferSharedPtr ibuf = HardwareBufferManager::getSingleton().
+			createIndexBuffer(
+			HardwareIndexBuffer::IT_16BIT, 
+			6, 
+			HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+
+		unsigned short faces[6] = {0,1,2,
+			0,2,3 };
+		sub->indexData->indexBuffer = ibuf;
+		sub->indexData->indexCount = 6;
+		sub->indexData->indexStart =0;
+		ibuf->writeData(0, ibuf->getSizeInBytes(), faces, true);
+
+		mesh->_setBounds(AxisAlignedBox(-100,-100,0,100,100,0), true);
+		mesh->_setBoundingSphereRadius(Math::Sqrt(100*100+100*100));
+	}
+	//---------------------------------------------------------------------
+	void PrefabFactory::createCube(Mesh* mesh)
+	{
+		SubMesh* sub = mesh->createSubMesh();
+
+		const int NUM_VERTICES = 4 * 6; // 4 vertices per side * 6 sides
+		const int NUM_ENTRIES_PER_VERTEX = 8;
+		const int NUM_VERTEX_ENTRIES = NUM_VERTICES * NUM_ENTRIES_PER_VERTEX;
+		const int NUM_INDICES = 3 * 2 * 6; // 3 indices per face * 2 faces per side * 6 sides
+
+		const Real CUBE_SIZE = 100.0;
+		const Real CUBE_HALF_SIZE = CUBE_SIZE / 2.0;
+
+		// Create 4 vertices per side instead of 6 that are shared for the whole cube.
+		// The reason for this is with only 6 vertices the normals will look bad
+		// since each vertex can "point" in a different direction depending on the face it is included in.
+		float vertices[NUM_VERTEX_ENTRIES] = {
+			// front side
+			-CUBE_HALF_SIZE, -CUBE_HALF_SIZE, CUBE_HALF_SIZE,	// pos
+			0,0,1,	// normal
+			0,1,	// texcoord
+			CUBE_HALF_SIZE, -CUBE_HALF_SIZE, CUBE_HALF_SIZE,
+			0,0,1,
+			1,1,
+			CUBE_HALF_SIZE,  CUBE_HALF_SIZE, CUBE_HALF_SIZE,
+			0,0,1,
+			1,0,
+			-CUBE_HALF_SIZE,  CUBE_HALF_SIZE, CUBE_HALF_SIZE ,
+			0,0,1,
+			0,0,
+
+			// back side
+			CUBE_HALF_SIZE, -CUBE_HALF_SIZE, -CUBE_HALF_SIZE,
+			0,0,-1,
+			0,1,
+			-CUBE_HALF_SIZE, -CUBE_HALF_SIZE, -CUBE_HALF_SIZE,
+			0,0,-1,
+			1,1,
+			-CUBE_HALF_SIZE, CUBE_HALF_SIZE, -CUBE_HALF_SIZE,
+			0,0,-1,
+			1,0,
+			CUBE_HALF_SIZE, CUBE_HALF_SIZE, -CUBE_HALF_SIZE,
+			0,0,-1,
+			0,0,
+
+			// left side
+			-CUBE_HALF_SIZE, -CUBE_HALF_SIZE, -CUBE_HALF_SIZE,
+			-1,0,0,
+			0,1,
+			-CUBE_HALF_SIZE, -CUBE_HALF_SIZE, CUBE_HALF_SIZE,
+			-1,0,0,
+			1,1,
+			-CUBE_HALF_SIZE, CUBE_HALF_SIZE, CUBE_HALF_SIZE,
+			-1,0,0,
+			1,0,
+			-CUBE_HALF_SIZE, CUBE_HALF_SIZE, -CUBE_HALF_SIZE,
+			-1,0,0,
+			0,0, 
+
+			// right side
+			CUBE_HALF_SIZE, -CUBE_HALF_SIZE, CUBE_HALF_SIZE,
+			1,0,0,
+			0,1,
+			CUBE_HALF_SIZE, -CUBE_HALF_SIZE, -CUBE_HALF_SIZE,
+			1,0,0,
+			1,1,
+			CUBE_HALF_SIZE, CUBE_HALF_SIZE, -CUBE_HALF_SIZE,
+			1,0,0,
+			1,0,
+			CUBE_HALF_SIZE, CUBE_HALF_SIZE, CUBE_HALF_SIZE,
+			1,0,0,
+			0,0,
+
+			// up side
+			-CUBE_HALF_SIZE, CUBE_HALF_SIZE, CUBE_HALF_SIZE,
+			0,1,0,
+			0,1,
+			CUBE_HALF_SIZE, CUBE_HALF_SIZE, CUBE_HALF_SIZE,
+			0,1,0,
+			1,1,
+			CUBE_HALF_SIZE, CUBE_HALF_SIZE, -CUBE_HALF_SIZE,
+			0,1,0,
+			1,0,
+			-CUBE_HALF_SIZE, CUBE_HALF_SIZE, -CUBE_HALF_SIZE,
+			0,1,0,
+			0,0,
+
+			// down side
+			-CUBE_HALF_SIZE, -CUBE_HALF_SIZE, -CUBE_HALF_SIZE,
+			0,-1,0,
+			0,1,
+			CUBE_HALF_SIZE, -CUBE_HALF_SIZE, -CUBE_HALF_SIZE,
+			0,-1,0,
+			1,1,
+			CUBE_HALF_SIZE, -CUBE_HALF_SIZE, CUBE_HALF_SIZE,
+			0,-1,0,
+			1,0,
+			-CUBE_HALF_SIZE, -CUBE_HALF_SIZE, CUBE_HALF_SIZE,
+			0,-1,0,
+			0,0 
+		};
+
+		mesh->sharedVertexData = new VertexData();
+		mesh->sharedVertexData->vertexCount = NUM_VERTICES;
+		VertexDeclaration* decl = mesh->sharedVertexData->vertexDeclaration;
+		VertexBufferBinding* bind = mesh->sharedVertexData->vertexBufferBinding;
+
+		size_t offset = 0;
+		decl->addElement(0, offset, VET_FLOAT3, VES_POSITION);
+		offset += VertexElement::getTypeSize(VET_FLOAT3);
+		decl->addElement(0, offset, VET_FLOAT3, VES_NORMAL);
+		offset += VertexElement::getTypeSize(VET_FLOAT3);
+		decl->addElement(0, offset, VET_FLOAT2, VES_TEXTURE_COORDINATES, 0);
+		offset += VertexElement::getTypeSize(VET_FLOAT2);
+
+		HardwareVertexBufferSharedPtr vbuf = 
+			HardwareBufferManager::getSingleton().createVertexBuffer(
+			offset, NUM_VERTICES, HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+		bind->setBinding(0, vbuf);
+
+		vbuf->writeData(0, vbuf->getSizeInBytes(), vertices, true);
+
+		sub->useSharedVertices = true;
+		HardwareIndexBufferSharedPtr ibuf = HardwareBufferManager::getSingleton().
+			createIndexBuffer(
+			HardwareIndexBuffer::IT_16BIT, 
+			NUM_INDICES,
+			HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+
+		unsigned short faces[NUM_INDICES] = {
+			// front
+			0,1,2,
+			0,2,3,
+
+			// back
+			4,5,6,
+			4,6,7,
+
+			// left
+			8,9,10,
+			8,10,11,
+
+			// right
+			12,13,14,
+			12,14,15,
+
+			// up
+			16,17,18,
+			16,18,19,
+
+			// down
+			20,21,22,
+			20,22,23
+		};
+
+		sub->indexData->indexBuffer = ibuf;
+		sub->indexData->indexCount = NUM_INDICES;
+		sub->indexData->indexStart = 0;
+		ibuf->writeData(0, ibuf->getSizeInBytes(), faces, true);
+
+		mesh->_setBounds(AxisAlignedBox(-CUBE_HALF_SIZE, -CUBE_HALF_SIZE, -CUBE_HALF_SIZE,
+			CUBE_HALF_SIZE, CUBE_HALF_SIZE, CUBE_HALF_SIZE), true);
+
+		mesh->_setBoundingSphereRadius(CUBE_HALF_SIZE);
+	}
+	//---------------------------------------------------------------------
+	void PrefabFactory::createSphere(Mesh* mesh)
+	{
+		// sphere creation code taken from the DeferredShading sample, originally from the wiki
+		SubMesh *pSphereVertex = mesh->createSubMesh();
+
+		const int NUM_SEGMENTS = 16;
+		const int NUM_RINGS = 16;
+		const Real SPHERE_RADIUS = 50.0;
+
+		mesh->sharedVertexData = new VertexData();
+		VertexData* vertexData = mesh->sharedVertexData;
+
+		// define the vertex format
+		VertexDeclaration* vertexDecl = vertexData->vertexDeclaration;
+		size_t currOffset = 0;
+		// positions
+		vertexDecl->addElement(0, currOffset, VET_FLOAT3, VES_POSITION);
+		currOffset += VertexElement::getTypeSize(VET_FLOAT3);
+		// normals
+		vertexDecl->addElement(0, currOffset, VET_FLOAT3, VES_NORMAL);
+		currOffset += VertexElement::getTypeSize(VET_FLOAT3);
+		// two dimensional texture coordinates
+		vertexDecl->addElement(0, currOffset, VET_FLOAT2, VES_TEXTURE_COORDINATES, 0);
+		currOffset += VertexElement::getTypeSize(VET_FLOAT2);
+
+		// allocate the vertex buffer
+		vertexData->vertexCount = (NUM_RINGS + 1) * (NUM_SEGMENTS+1);
+		HardwareVertexBufferSharedPtr vBuf = HardwareBufferManager::getSingleton().createVertexBuffer(vertexDecl->getVertexSize(0), vertexData->vertexCount, HardwareBuffer::HBU_STATIC_WRITE_ONLY, false);
+		VertexBufferBinding* binding = vertexData->vertexBufferBinding;
+		binding->setBinding(0, vBuf);
+		float* pVertex = static_cast<float*>(vBuf->lock(HardwareBuffer::HBL_DISCARD));
+
+		// allocate index buffer
+		pSphereVertex->indexData->indexCount = 6 * NUM_RINGS * (NUM_SEGMENTS + 1);
+		pSphereVertex->indexData->indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(HardwareIndexBuffer::IT_16BIT, pSphereVertex->indexData->indexCount, HardwareBuffer::HBU_STATIC_WRITE_ONLY, false);
+		HardwareIndexBufferSharedPtr iBuf = pSphereVertex->indexData->indexBuffer;
+		unsigned short* pIndices = static_cast<unsigned short*>(iBuf->lock(HardwareBuffer::HBL_DISCARD));
+
+		float fDeltaRingAngle = (Math::PI / NUM_RINGS);
+		float fDeltaSegAngle = (2 * Math::PI / NUM_SEGMENTS);
+		unsigned short wVerticeIndex = 0 ;
+
+		// Generate the group of rings for the sphere
+		for( int ring = 0; ring <= NUM_RINGS; ring++ ) {
+			float r0 = SPHERE_RADIUS * sinf (ring * fDeltaRingAngle);
+			float y0 = SPHERE_RADIUS * cosf (ring * fDeltaRingAngle);
+
+			// Generate the group of segments for the current ring
+			for(int seg = 0; seg <= NUM_SEGMENTS; seg++) {
+				float x0 = r0 * sinf(seg * fDeltaSegAngle);
+				float z0 = r0 * cosf(seg * fDeltaSegAngle);
+
+				// Add one vertex to the strip which makes up the sphere
+				*pVertex++ = x0;
+				*pVertex++ = y0;
+				*pVertex++ = z0;
+
+				Vector3 vNormal = Vector3(x0, y0, z0).normalisedCopy();
+				*pVertex++ = vNormal.x;
+				*pVertex++ = vNormal.y;
+				*pVertex++ = vNormal.z;
+
+				*pVertex++ = (float) seg / (float) NUM_SEGMENTS;
+				*pVertex++ = (float) ring / (float) NUM_RINGS;
+
+				if (ring != NUM_RINGS) {
+					// each vertex (except the last) has six indicies pointing to it
+					*pIndices++ = wVerticeIndex + NUM_SEGMENTS + 1;
+					*pIndices++ = wVerticeIndex;               
+					*pIndices++ = wVerticeIndex + NUM_SEGMENTS;
+					*pIndices++ = wVerticeIndex + NUM_SEGMENTS + 1;
+					*pIndices++ = wVerticeIndex + 1;
+					*pIndices++ = wVerticeIndex;
+					wVerticeIndex ++;
+				}
+			}; // end for seg
+		} // end for ring
+
+		// Unlock
+		vBuf->unlock();
+		iBuf->unlock();
+		// Generate face list
+		pSphereVertex->useSharedVertices = true;
+
+		// the original code was missing this line:
+		mesh->_setBounds( AxisAlignedBox( Vector3(-SPHERE_RADIUS, -SPHERE_RADIUS, -SPHERE_RADIUS), 
+			Vector3(SPHERE_RADIUS, SPHERE_RADIUS, SPHERE_RADIUS) ), false );
+
+		mesh->_setBoundingSphereRadius(SPHERE_RADIUS);
+	}
+	//---------------------------------------------------------------------
+}
Index: /OgreMain/src/OgreProfiler.cpp
===================================================================
--- /OgreMain/src/OgreProfiler.cpp	(revision 5)
+++ /OgreMain/src/OgreProfiler.cpp	(revision 5)
@@ -0,0 +1,849 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+/*
+
+    Although the code is original, many of the ideas for the profiler were borrowed from 
+"Real-Time In-Game Profiling" by Steve Rabin which can be found in Game Programming
+Gems 1.
+
+    This code can easily be adapted to your own non-Ogre project. The only code that is 
+Ogre-dependent is in the visualization/logging routines and the use of the Timer class.
+
+    Enjoy!
+
+*/
+
+#include "OgreProfiler.h"
+#include "OgreTimer.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreOverlayManager.h"
+#include "OgreOverlayElement.h"
+#include "OgreOverlayContainer.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    // PROFILE DEFINITIONS
+    //-----------------------------------------------------------------------
+    template<> Profiler* Singleton<Profiler>::ms_Singleton = 0;
+    Profiler* Profiler::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    Profiler& Profiler::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+    //-----------------------------------------------------------------------
+    Profile::Profile(const String& profileName) {
+
+        mName = profileName;
+
+        Ogre::Profiler::getSingleton().beginProfile(profileName);
+
+    }
+    //-----------------------------------------------------------------------
+    Profile::~Profile() {
+
+        Ogre::Profiler::getSingleton().endProfile(mName);
+
+    }
+    //-----------------------------------------------------------------------
+
+
+    //-----------------------------------------------------------------------
+    // PROFILER DEFINITIONS
+    //-----------------------------------------------------------------------
+    Profiler::Profiler() {
+
+        // init some variables
+        mTimer = 0;
+        mTotalFrameTime = 0;
+        mUpdateDisplayFrequency = 0;
+        mCurrentFrame = 0;
+        mEnabled = mNewEnableState = false; // the profiler starts out as disabled
+        mEnableStateChangePending = false;
+        mInitialized = false;
+        maxProfiles = 50;
+
+        // by default the display will be updated every 10 frames
+        mUpdateDisplayFrequency = 10;
+
+    }
+    //-----------------------------------------------------------------------
+    Profiler::~Profiler() {
+
+        if (!mProfileHistory.empty()) {
+            // log the results of our profiling before we quit
+            logResults();
+        }
+
+        // clear all our lists
+        mProfiles.clear();
+        mProfileFrame.clear();
+        mProfileHistoryMap.clear();
+        mProfileHistory.clear();
+        mDisabledProfiles.clear();
+        mProfileBars.clear();
+
+    }
+    //-----------------------------------------------------------------------
+    void Profiler::initialize() {
+
+        // init some gui characteristics
+        mBarHeight = 10; //0.02;
+        mGuiBorderWidth = 10; //0.02;
+        mGuiHeight = 25; //0.05;
+        mGuiWidth = 250; //0.15;
+        mBarIndent = mGuiWidth;
+        mBarLineWidth = 2;
+
+        // create a new overlay to hold our Profiler display
+        mOverlay = OverlayManager::getSingleton().create("Profiler");
+        mOverlay->setZOrder(500);
+
+        // this panel will be the main container for our profile bars
+        mProfileGui = createContainer();
+
+        OverlayElement* element;
+
+        // we create the little "ticks" above the profiles
+        for (uint k = 1; k < 10; ++k) { // we don't want a tick at 0% or 100%
+
+            if (k != 5) { // we don't want a tick at 50%
+                element = createTextArea("ProfileKeyLine" + StringConverter::toString(k), 20, 10, 2, mGuiWidth * (1 + k * .1), 9, "|");
+                mProfileGui->addChild(element);
+            }
+
+        }
+
+        // we create a 0% marker
+        element = createTextArea("ProfileKey0", 50, 10, 2, mGuiWidth * 0.99, 9, "0%");
+        mProfileGui->addChild(element);
+
+        // we create a 50% marker
+        element = createTextArea("ProfileyKey50", 50, 10, 2, mGuiWidth * 1.48, 9, "50%");
+        mProfileGui->addChild(element);
+
+        // we create a 100% marker
+        element = createTextArea("ProfileKey100", 50, 10, 2, mGuiWidth * 1.98, 9, "100%");
+        mProfileGui->addChild(element);
+
+        // we create an initial pool of 50 profile bars
+        for (uint i = 0; i < maxProfiles; ++i) {
+
+            // this is for the profile name and the number of times it was called in a frame
+            element = createTextArea("profileText" + StringConverter::toString(i), 90, mBarHeight, mGuiBorderWidth + (mBarHeight * 2) * i, 0, 14, "", false);
+            mProfileGui->addChild(element);
+            mProfileBars.push_back(element);
+
+            // this indicates the current frame time
+            element = createPanel("currBar" + StringConverter::toString(i), 0, mBarHeight, mGuiBorderWidth + (mBarHeight * 2) * i, mBarIndent, "Core/ProfilerCurrent", false);
+            mProfileGui->addChild(element);
+            mProfileBars.push_back(element);
+
+            // this indicates the minimum frame time
+            element = createPanel("minBar" + StringConverter::toString(i), mBarLineWidth, mBarHeight, mGuiBorderWidth + (mBarHeight * 2) * i, 0, "Core/ProfilerMin", false);
+            mProfileGui->addChild(element);
+            mProfileBars.push_back(element);
+
+            // this indicates the maximum frame time
+            element = createPanel("maxBar" + StringConverter::toString(i), mBarLineWidth, mBarHeight, mGuiBorderWidth + (mBarHeight * 2) * i, 0, "Core/ProfilerMax", false);
+            mProfileGui->addChild(element);
+            mProfileBars.push_back(element);
+
+            // this indicates the average frame time
+            element = createPanel("avgBar" + StringConverter::toString(i), mBarLineWidth, mBarHeight, mGuiBorderWidth + (mBarHeight * 2) * i, 0, "Core/ProfilerAvg", false);
+            mProfileGui->addChild(element);
+            mProfileBars.push_back(element);
+
+        }
+
+        // throw everything all the GUI stuff into the overlay and display it
+        mOverlay->add2D(mProfileGui);
+        mOverlay->show();
+
+    }
+    //-----------------------------------------------------------------------
+    void Profiler::setTimer(Timer* t) {
+
+        mTimer = t;
+
+    }
+    //-----------------------------------------------------------------------
+    Timer* Profiler::getTimer() {
+
+        assert(mTimer && "Timer not set!");
+        return mTimer;
+
+    }
+    //-----------------------------------------------------------------------
+    void Profiler::setEnabled(bool enabled) {
+
+        if (!mInitialized && enabled) {
+
+            // the user wants to enable the Profiler for the first time
+            // so we initialize the GUI stuff
+            initialize();
+            mInitialized = true;
+            mEnabled = true;
+
+        }
+        else {
+            // We store this enable/disable request until the frame ends
+            // (don't want to screw up any open profiles!)
+            mEnableStateChangePending = true;
+            mNewEnableState = enabled;
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    bool Profiler::getEnabled() const {
+
+        return mEnabled;
+
+    }
+    //-----------------------------------------------------------------------
+    void Profiler::disableProfile(const String& profileName) {
+
+        // make sure the profile isn't already disabled
+        DisabledProfileMap::iterator iter;
+        iter = mDisabledProfiles.find(profileName);
+
+        // make sure you don't disable a profile in the middle of that profile
+        ProfileStack::iterator pIter;
+        for (pIter = mProfiles.begin(); pIter != mProfiles.end(); ++pIter) {
+
+            if (profileName == (*pIter).name)
+                break;
+
+        }
+
+        // if those two conditions are met, disable the profile
+        if ( (iter == mDisabledProfiles.end()) && (pIter == mProfiles.end()) ) {
+
+            mDisabledProfiles.insert(std::pair<String, bool>(profileName, true));
+
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void Profiler::enableProfile(const String& profileName) {
+
+        // make sure the profile is actually disabled
+        DisabledProfileMap::iterator iter;
+        iter = mDisabledProfiles.find(profileName);
+
+        // make sure you don't enable a profile in the middle of that profile
+        ProfileStack::iterator pIter;
+        for (pIter = mProfiles.begin(); pIter != mProfiles.end(); ++pIter) {
+
+            if (profileName == (*pIter).name)
+                break;
+
+        }
+
+        // if those two conditions are met, enable the profile by removing it from
+        // the disabled list
+        if ( (iter != mDisabledProfiles.end()) && (pIter == mProfiles.end()) ) {
+
+            mDisabledProfiles.erase(iter);
+
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void Profiler::beginProfile(const String& profileName) {
+
+        // if the profiler is enabled
+        if (!mEnabled) {
+
+            return;
+
+        }
+
+        // empty string is reserved for the root
+        assert ((profileName != "") && ("Profile name can't be an empty string"));
+
+        ProfileStack::iterator iter;
+        for (iter = mProfiles.begin(); iter != mProfiles.end(); ++iter) {
+
+            if ((*iter).name == profileName) {
+
+                break;
+
+            }
+
+        }
+
+        // make sure this profile isn't being used more than once
+        assert ((iter == mProfiles.end()) && ("This profile name is already being used"));
+
+        // we only process this profile if isn't disabled
+        DisabledProfileMap::iterator dIter;
+        dIter = mDisabledProfiles.find(profileName);
+        if ( dIter != mDisabledProfiles.end() ) {
+
+            return;
+
+        }
+
+        ProfileInstance p;
+		p.hierarchicalLvl = static_cast<uint>(mProfiles.size());
+
+        // this is the root, it has no parent
+        if (mProfiles.empty()) {
+
+            p.parent = "";
+
+        }
+        // otherwise peek at the stack and use the top as the parent
+        else {
+
+            ProfileInstance parent = mProfiles.back();
+            p.parent = parent.name;
+
+        }
+
+        // need a timer to profile!
+        assert (mTimer && "Timer not set!");
+
+        ProfileFrameList::iterator fIter;
+        ProfileHistoryList::iterator hIter;
+
+        // we check to see if this profile has been called in the frame before
+        for (fIter = mProfileFrame.begin(); fIter != mProfileFrame.end(); ++fIter) {
+
+            if ((*fIter).name == profileName)
+                break;
+
+        }
+        // if it hasn't been called before, set its position in the stack
+        if (fIter == mProfileFrame.end()) {
+
+            ProfileFrame f;
+            f.name = profileName;
+            f.frameTime = 0;
+            f.calls = 0;
+            f.hierarchicalLvl = (uint) mProfiles.size();
+            mProfileFrame.push_back(f);
+
+        }
+
+        // we check to see if this profile has been called in the app before
+        ProfileHistoryMap::iterator histMapIter;
+        histMapIter = mProfileHistoryMap.find(profileName);
+
+        // if not we add a profile with just the name into the history
+        if (histMapIter == mProfileHistoryMap.end()) {
+
+            ProfileHistory h;
+            h.name = profileName;
+            h.numCallsThisFrame = 0;
+            h.totalTime = 0;
+            h.totalCalls = 0;
+            h.maxTime = 0;
+            h.minTime = 1;
+            h.hierarchicalLvl = p.hierarchicalLvl;
+            h.currentTime = 0;
+
+            // we add this to the history
+            hIter = mProfileHistory.insert(mProfileHistory.end(), h);
+
+            // for quick look-ups, we'll add it to the history map as well
+            mProfileHistoryMap.insert(std::pair<String, ProfileHistoryList::iterator>(profileName, hIter));
+
+        }
+
+        // add the stats to this profile and push it on the stack
+        // we do this at the very end of the function to get the most
+        // accurate timing results
+        p.name = profileName;
+        p.currTime = mTimer->getMicroseconds();
+        p.accum = 0;
+        mProfiles.push_back(p);
+
+    }
+    //-----------------------------------------------------------------------
+    void Profiler::endProfile(const String& profileName) {
+
+		// if the profiler received a request to be enabled or disabled
+		// we reached the end of the frame so we can safely do this
+		if (mEnableStateChangePending) {
+
+			changeEnableState();
+
+		}
+
+     // if the profiler is enabled
+        if(!mEnabled) {
+
+            return;
+
+        }
+
+        // need a timer to profile!
+        assert (mTimer && "Timer not set!");
+
+        // get the end time of this profile
+        // we do this as close the beginning of this function as possible
+        // to get more accurate timing results
+        ulong endTime = mTimer->getMicroseconds();
+
+        // empty string is reserved for designating an empty parent
+        assert ((profileName != "") && ("Profile name can't be an empty string"));
+
+        // we only process this profile if isn't disabled
+        DisabledProfileMap::iterator dIter;
+        dIter = mDisabledProfiles.find(profileName);
+        if ( dIter != mDisabledProfiles.end() ) {
+
+            return;
+
+        }
+
+        // stack shouldnt be empty
+        assert (!mProfiles.empty());
+
+        // get the start of this profile
+        ProfileInstance bProfile;
+        bProfile = mProfiles.back();
+        mProfiles.pop_back();
+
+        // calculate the elapsed time of this profile
+        ulong timeElapsed = endTime - bProfile.currTime;
+
+        // update parent's accumalator if it isn't the root
+        if (bProfile.parent != "") {
+
+            // find the parent
+            ProfileStack::iterator iter;
+            for(iter = mProfiles.begin(); iter != mProfiles.end(); ++iter) {
+
+                if ((*iter).name == bProfile.parent)
+                    break;
+
+            }
+
+            // the parent should be found 
+            assert(iter != mProfiles.end());
+
+            // add this profile's time to the parent's accumlator
+            (*iter).accum += timeElapsed;
+
+        }
+
+        // we find the profile in this frame
+        ProfileFrameList::iterator iter;
+        for (iter = mProfileFrame.begin(); iter != mProfileFrame.end(); ++iter) {
+
+            if ((*iter).name == bProfile.name)
+                break;
+
+        }
+
+        // we subtract the time the children profiles took from this profile
+        (*iter).frameTime += timeElapsed - bProfile.accum;
+        (*iter).calls++;
+
+        // the stack is empty and all the profiles have been completed
+        // we have reached the end of the frame so process the frame statistics
+        if (mProfiles.empty()) {
+
+            // we know that the time elapsed of the main loop is the total time the frame took
+            mTotalFrameTime = timeElapsed;
+
+            // we got all the information we need, so process the profiles
+            // for this frame
+            processFrameStats();
+
+            // clear the frame stats for next frame
+            mProfileFrame.clear();
+
+            // we display everything to the screen
+            displayResults();
+
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void Profiler::processFrameStats() {
+
+        ProfileFrameList::iterator frameIter;
+        ProfileHistoryList::iterator historyIter;
+
+        // we set the number of times each profile was called per frame to 0
+        // because not all profiles are called every frame
+        for (historyIter = mProfileHistory.begin(); historyIter != mProfileHistory.end(); ++historyIter) {
+
+            (*historyIter).numCallsThisFrame = 0;
+
+        }
+
+        // iterate through each of the profiles processed during this frame
+        for (frameIter = mProfileFrame.begin(); frameIter != mProfileFrame.end(); ++frameIter) {
+
+            String s = (*frameIter).name;
+
+            // use our map to find the appropriate profile in the history
+            historyIter = (*mProfileHistoryMap.find(s)).second;
+
+            // extract the frame stats
+            ulong frameTime = (*frameIter).frameTime;
+            uint calls = (*frameIter).calls;
+            uint lvl = (*frameIter).hierarchicalLvl;
+
+            // calculate what percentage of frame time this profile took
+            Real framePercentage = (Real) frameTime / (Real) mTotalFrameTime;
+
+            // update the profile stats
+            (*historyIter).currentTime = framePercentage;
+            (*historyIter).totalTime += framePercentage;
+            (*historyIter).totalCalls++;
+            (*historyIter).numCallsThisFrame = calls;
+            (*historyIter).hierarchicalLvl = lvl;
+
+            // if we find a new minimum for this profile, update it
+            if ((framePercentage) < ((*historyIter).minTime)) {
+
+                (*historyIter).minTime = framePercentage;
+
+            }
+
+            // if we find a new maximum for this profile, update it
+            if ((framePercentage) > ((*historyIter).maxTime)) {
+
+                (*historyIter).maxTime = framePercentage;
+
+            }
+
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void Profiler::displayResults() {
+
+        if (!mEnabled) {
+
+            return;
+
+        }
+
+        // if its time to update the display
+        if (mCurrentFrame >= mUpdateDisplayFrequency) {
+
+            mCurrentFrame = 0;
+
+            ProfileHistoryList::iterator iter;
+            ProfileBarList::iterator bIter;
+
+            OverlayElement* g;
+
+            Real newGuiHeight = mGuiHeight;
+
+            int temp = 0; // dummy variable for weird Ogre issue
+
+            // go through each profile and display it
+            for (iter = mProfileHistory.begin(), bIter = mProfileBars.begin(); 
+				iter != mProfileHistory.end() && bIter != mProfileBars.end(); 
+				++iter, ++bIter) 
+			{
+
+                // display the profile's name and the number of times it was called in a frame
+                g = *bIter;
+                g->show();
+                g->setCaption(String((*iter).name + " (" + StringConverter::toString((*iter).numCallsThisFrame) + ")"));
+                g->setLeft(10 + (*iter).hierarchicalLvl * 15);
+
+                // display the main bar that show the percentage of the frame time that this
+                // profile has taken
+                bIter++;
+                g = *bIter;
+                g->show();
+                // most of this junk has been set before, but we do this to get around a weird
+                // Ogre gui issue (bug?)
+                g->setMetricsMode(GMM_PIXELS);
+                g->setHeight(mBarHeight);
+                g->setWidth(((*iter).currentTime) * mGuiWidth);
+                g->setLeft(mGuiWidth);
+                g->setTop(mGuiBorderWidth + temp * mBarHeight * 2);
+
+                // display line to indicate the minimum frame time for this profile
+                bIter++;
+                g = *bIter;
+                g->show();
+                g->setLeft(mBarIndent + (*iter).minTime * mGuiWidth);
+
+                // display line to indicate the maximum frame time for this profile
+                bIter++;
+                g = *bIter;
+                g->show();
+                g->setLeft(mBarIndent + (*iter).maxTime * mGuiWidth);
+
+                // display line to indicate the average frame time for this profile
+                bIter++;
+                g = *bIter;
+                g->show();
+                if ((*iter).totalCalls != 0)
+                    g->setLeft(mBarIndent + ((*iter).totalTime / (*iter).totalCalls) * mGuiWidth);
+                else
+                    g->setLeft(mBarIndent);
+                // we set the height of the display with respect to the number of profiles displayed
+                newGuiHeight += mBarHeight * 2;
+
+                temp++;
+
+            }
+
+            // set the main display dimensions
+            mProfileGui->setMetricsMode(GMM_PIXELS);
+            mProfileGui->setHeight(newGuiHeight);
+            mProfileGui->setWidth(mGuiWidth * 2 + 15);
+            mProfileGui->setTop(5);
+            mProfileGui->setLeft(5);
+
+            // we hide all the remaining pre-created bars
+            for (; bIter != mProfileBars.end(); ++bIter) {
+
+                (*bIter)->hide();
+
+            }
+
+        }
+
+        // not time to update the display yet
+        else {
+
+            mCurrentFrame++;
+
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    bool Profiler::watchForMax(const String& profileName) {
+
+        ProfileHistoryMap::iterator mapIter;
+        ProfileHistoryList::iterator iter;
+
+        mapIter = mProfileHistoryMap.find(profileName);
+
+        // if we don't find the profile, return false
+        if (mapIter == mProfileHistoryMap.end())
+            return false;
+
+        iter = (*mapIter).second;
+
+        return ((*iter).currentTime == (*iter).maxTime);
+
+    }
+    //-----------------------------------------------------------------------
+    bool Profiler::watchForMin(const String& profileName) {
+
+        ProfileHistoryMap::iterator mapIter;
+        ProfileHistoryList::iterator iter;
+
+        mapIter = mProfileHistoryMap.find(profileName);
+
+        // if we don't find the profile, return false
+        if (mapIter == mProfileHistoryMap.end())
+            return false;
+
+        iter = (*mapIter).second;
+
+        return ((*iter).currentTime == (*iter).minTime);
+
+    }
+    //-----------------------------------------------------------------------
+    bool Profiler::watchForLimit(const String& profileName, Real limit, bool greaterThan) {
+
+        ProfileHistoryMap::iterator mapIter;
+        ProfileHistoryList::iterator iter;
+
+        mapIter = mProfileHistoryMap.find(profileName);
+
+        // if we don't find the profile, return false
+        if (mapIter == mProfileHistoryMap.end())
+            return false;
+
+        iter = (*mapIter).second;
+
+        if (greaterThan)
+            return ((*iter).currentTime > limit);
+        else
+            return ((*iter).currentTime < limit);
+
+    }
+    //-----------------------------------------------------------------------
+    void Profiler::logResults() {
+
+        ProfileHistoryList::iterator iter;
+
+        LogManager::getSingleton().logMessage("----------------------Profiler Results----------------------");
+
+        for (iter = mProfileHistory.begin(); iter != mProfileHistory.end(); ++iter) {
+
+            // create an indent that represents the hierarchical order of the profile
+            String indent = "";
+            for (uint i = 0; i < (*iter).hierarchicalLvl; ++i) {
+
+                indent = indent + "   ";
+
+            }
+
+            LogManager::getSingleton().logMessage(indent + "Name " + (*iter).name + " | Min " + StringConverter::toString((*iter).minTime) + " | Max " + StringConverter::toString((*iter).maxTime) + " | Avg "+ StringConverter::toString((*iter).totalTime / (*iter).totalCalls));
+
+        }
+
+        LogManager::getSingleton().logMessage("------------------------------------------------------------");
+
+    }
+    //-----------------------------------------------------------------------
+    void Profiler::reset() {
+
+        ProfileHistoryList::iterator iter;
+        for (iter = mProfileHistory.begin(); iter != mProfileHistory.end(); ++iter) {
+        
+            (*iter).currentTime = (*iter).maxTime = (*iter).totalTime = 0;
+            (*iter).numCallsThisFrame = (*iter).totalCalls = 0;
+
+            (*iter).minTime = 1;
+
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void Profiler::setUpdateDisplayFrequency(uint freq) {
+
+        mUpdateDisplayFrequency = freq;
+
+    }
+    //-----------------------------------------------------------------------
+    uint Profiler::getUpdateDisplayFrequency() const {
+
+        return mUpdateDisplayFrequency;
+
+    }
+    //-----------------------------------------------------------------------
+    void Profiler::changeEnableState() {
+
+        if (mNewEnableState) {
+
+            mOverlay->show();
+
+        }
+        else {
+
+            mOverlay->hide();
+
+        }
+        mEnabled = mNewEnableState;
+        mEnableStateChangePending = false;
+
+    }
+    //-----------------------------------------------------------------------
+    OverlayContainer* Profiler::createContainer() {
+
+        OverlayContainer* container = (OverlayContainer*) 
+			OverlayManager::getSingleton().createOverlayElement(
+				"BorderPanel", "profiler");
+        container->setMetricsMode(GMM_PIXELS);
+        container->setMaterialName("Core/StatsBlockCenter");
+        container->setHeight(mGuiHeight);
+        container->setWidth(mGuiWidth * 2 + 15);
+        container->setParameter("border_size", "1 1 1 1");
+        container->setParameter("border_material", "Core/StatsBlockBorder");
+        container->setParameter("border_topleft_uv", "0.0000 1.0000 0.0039 0.9961");
+        container->setParameter("border_top_uv", "0.0039 1.0000 0.9961 0.9961");
+        container->setParameter("border_topright_uv", "0.9961 1.0000 1.0000 0.9961");
+        container->setParameter("border_left_uv","0.0000 0.9961 0.0039 0.0039");
+        container->setParameter("border_right_uv","0.9961 0.9961 1.0000 0.0039");
+        container->setParameter("border_bottomleft_uv","0.0000 0.0039 0.0039 0.0000");
+        container->setParameter("border_bottom_uv","0.0039 0.0039 0.9961 0.0000");
+        container->setParameter("border_bottomright_uv","0.9961 0.0039 1.0000 0.0000");
+        container->setLeft(5);
+        container->setTop(5);
+
+        return container;
+
+    }
+    //-----------------------------------------------------------------------
+    OverlayElement* Profiler::createTextArea(const String& name, Real width, Real height, Real top, Real left, 
+                                         uint fontSize, const String& caption, bool show) {
+
+
+        OverlayElement* textArea = 
+			OverlayManager::getSingleton().createOverlayElement("TextArea", name);
+        textArea->setMetricsMode(GMM_PIXELS);
+        textArea->setWidth(width);
+        textArea->setHeight(height);
+        textArea->setTop(top);
+        textArea->setLeft(left);
+        textArea->setParameter("font_name", "BlueHighway");
+        textArea->setParameter("char_height", StringConverter::toString(fontSize));
+        textArea->setCaption(caption);
+        textArea->setParameter("colour_top", "1 1 1");
+        textArea->setParameter("colour_bottom", "1 1 1");
+
+        if (show) {
+            textArea->show();
+        }
+        else {
+            textArea->hide();
+        }
+
+        return textArea;
+
+    }
+    //-----------------------------------------------------------------------
+    OverlayElement* Profiler::createPanel(const String& name, Real width, Real height, Real top, Real left, 
+                                      const String& materialName, bool show) {
+
+        OverlayElement* panel = 
+			OverlayManager::getSingleton().createOverlayElement("Panel", name);
+        panel->setMetricsMode(GMM_PIXELS);
+        panel->setWidth(width);
+        panel->setHeight(height);
+        panel->setTop(top);
+        panel->setLeft(left);
+        panel->setMaterialName(materialName);
+
+        if (show) {
+            panel->show();
+        }
+        else {
+            panel->hide();
+        }
+
+        return panel;
+		
+    }
+    //-----------------------------------------------------------------------
+
+}
Index: /OgreMain/src/OgreProgressiveMesh.cpp
===================================================================
--- /OgreMain/src/OgreProgressiveMesh.cpp	(revision 5)
+++ /OgreMain/src/OgreProgressiveMesh.cpp	(revision 5)
@@ -0,0 +1,987 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+// The algorithm in this file is based heavily on:
+/*
+*  Progressive Mesh type Polygon Reduction Algorithm
+*  by Stan Melax (c) 1998
+*/
+
+#include "OgreProgressiveMesh.h"
+#include "OgreString.h"
+#include "OgreHardwareBufferManager.h"
+#include <algorithm>
+
+#include <iostream>
+
+#if OGRE_DEBUG_MODE 
+std::ofstream ofdebug;
+#endif 
+
+namespace Ogre {
+	#define NEVER_COLLAPSE_COST 99999.9f
+
+
+    /** Comparator for unique vertex list
+    */
+    struct vectorLess
+    {
+		_OgreExport bool operator()(const Vector3& v1, const Vector3& v2) const
+        {
+			if (v1.x < v2.x) return true;
+			if (v1.x == v2.x && v1.y < v2.y) return true;
+			if (v1.x == v2.x && v1.y == v2.y && v1.z < v2.z) return true;
+
+			return false;
+		}
+	};
+    //---------------------------------------------------------------------
+    ProgressiveMesh::ProgressiveMesh(const VertexData* vertexData, 
+        const IndexData* indexData)
+    {
+        addWorkingData(vertexData, indexData);
+        mpVertexData = vertexData;
+        mpIndexData = indexData;
+        mWorstCosts.resize(vertexData->vertexCount);
+
+
+
+    }
+    //---------------------------------------------------------------------
+    ProgressiveMesh::~ProgressiveMesh()
+    {
+    }
+    //---------------------------------------------------------------------
+    void ProgressiveMesh::addExtraVertexPositionBuffer(const VertexData* vertexData)
+    {
+        addWorkingData(vertexData, mpIndexData);
+    }
+    //---------------------------------------------------------------------
+    void ProgressiveMesh::build(ushort numLevels, LODFaceList* outList, 
+			VertexReductionQuota quota, Real reductionValue)
+    {
+        IndexData* newLod;
+
+        computeAllCosts();
+
+#if OGRE_DEBUG_MODE
+		dumpContents("pm_before.log");
+#endif
+
+        // Init
+        mCurrNumIndexes = mpIndexData->indexCount;
+        size_t numVerts, numCollapses;
+        // Use COMMON vert count, not original vert count
+        // Since collapsing 1 common vert position is equivalent to collapsing them all
+        numVerts = mNumCommonVertices;
+		
+#if OGRE_DEBUG_MODE 
+		ofdebug.open("progressivemesh.log");
+#endif
+		numCollapses = 0;
+		bool abandon = false;
+		while (numLevels--)
+        {
+            // NB idf 'abandon' is set, we stop reducing 
+            // However, we still bake the number of LODs requested, even if it 
+            // means they are the same
+            if (!abandon)
+            {
+			    if (quota == VRQ_PROPORTIONAL)
+			    {
+				    numCollapses = static_cast<size_t>(numVerts * reductionValue);
+			    }
+			    else 
+			    {
+				    numCollapses = static_cast<size_t>(reductionValue);
+			    }
+                // Minimum 3 verts!
+                if ( (numVerts - numCollapses) < 3) 
+                    numCollapses = numVerts - 3;
+			    // Store new number of verts
+			    numVerts = numVerts - numCollapses;
+
+			    while(numCollapses-- && !abandon)
+                {
+                    size_t nextIndex = getNextCollapser();
+                    // Collapse on every buffer
+                    WorkingDataList::iterator idata, idataend;
+                    idataend = mWorkingData.end();
+                    for (idata = mWorkingData.begin(); idata != idataend; ++idata)
+                    {
+                        PMVertex* collapser = &( idata->mVertList.at( nextIndex ) );
+                        // This will reduce mCurrNumIndexes and recalc costs as required
+					    if (collapser->collapseTo == NULL)
+					    {
+						    // Must have run out of valid collapsables
+						    abandon = true;
+						    break;
+					    }
+#if OGRE_DEBUG_MODE 
+					    ofdebug << "Collapsing index " << (unsigned int)collapser->index << "(border: "<< collapser->isBorder() <<
+						    ") to " << (unsigned int)collapser->collapseTo->index << "(border: "<< collapser->collapseTo->isBorder() <<
+						    ")" << std::endl;
+#endif
+					    assert(collapser->collapseTo->removed == false);
+
+                        collapse(collapser);
+                    }
+
+                }
+            }
+#if OGRE_DEBUG_MODE
+			StringUtil::StrStreamType logname;
+			logname << "pm_level" << numLevels << ".log";
+			dumpContents(logname.str());
+#endif
+
+            // Bake a new LOD and add it to the list
+            newLod = new IndexData();
+            bakeNewLOD(newLod);
+            outList->push_back(newLod);
+			
+        }
+
+
+
+    }
+    //---------------------------------------------------------------------
+    void ProgressiveMesh::addWorkingData(const VertexData * vertexData, 
+        const IndexData * indexData)
+    {
+        // Insert blank working data, then fill 
+        mWorkingData.push_back(PMWorkingData());
+
+        PMWorkingData& work = mWorkingData.back();
+
+        // Build vertex list
+		// Resize face list (this will always be this big)
+		work.mFaceVertList.resize(vertexData->vertexCount);
+		// Also resize common vert list to max, to avoid reallocations
+		work.mVertList.resize(vertexData->vertexCount);
+
+		// locate position element & hte buffer to go with it
+		const VertexElement* posElem = vertexData->vertexDeclaration->findElementBySemantic(VES_POSITION);
+		HardwareVertexBufferSharedPtr vbuf = 
+			vertexData->vertexBufferBinding->getBuffer(posElem->getSource());
+		// lock the buffer for reading
+		unsigned char* pVertex = static_cast<unsigned char*>(
+			vbuf->lock(HardwareBuffer::HBL_READ_ONLY));
+		float* pFloat;
+		Vector3 pos;
+		// Map for identifying duplicate position vertices
+		typedef std::map<Vector3, size_t, vectorLess> CommonVertexMap;
+		CommonVertexMap commonVertexMap;
+		CommonVertexMap::iterator iCommonVertex;
+		size_t numCommon = 0;
+        size_t i = 0;
+        for (i = 0; i < vertexData->vertexCount; ++i, pVertex += vbuf->getVertexSize())
+        {
+			posElem->baseVertexPointerToElement(pVertex, &pFloat);
+
+            pos.x = *pFloat++;
+            pos.y = *pFloat++;
+            pos.z = *pFloat++;
+
+			// Try to find this position in the existing map 
+			iCommonVertex = commonVertexMap.find(pos);
+			if (iCommonVertex == commonVertexMap.end())
+			{
+				// Doesn't exist, so create it
+				PMVertex* commonVert = &(work.mVertList[numCommon]);
+				commonVert->setDetails(pos, numCommon);
+				commonVert->removed = false;
+				commonVert->toBeRemoved = false;
+				commonVert->seam = false;
+
+				// Enter it in the map
+				commonVertexMap.insert(CommonVertexMap::value_type(pos, numCommon) );
+				// Increment common index
+				++numCommon;
+
+				work.mFaceVertList[i].commonVertex = commonVert;
+				work.mFaceVertList[i].realIndex = i;
+			}
+			else
+			{
+				// Exists already, reference it
+				PMVertex* existingVert = &(work.mVertList[iCommonVertex->second]);
+				work.mFaceVertList[i].commonVertex = existingVert;
+				work.mFaceVertList[i].realIndex = i;
+
+				// Also tag original as a seam since duplicates at this location
+				work.mFaceVertList[i].commonVertex->seam = true;
+
+			}
+			
+        }
+		vbuf->unlock();
+
+		mNumCommonVertices = numCommon;
+
+        // Build tri list
+        size_t numTris = indexData->indexCount / 3;
+		unsigned short* pShort;
+		unsigned int* pInt;
+		HardwareIndexBufferSharedPtr ibuf = indexData->indexBuffer;
+		bool use32bitindexes = (ibuf->getType() == HardwareIndexBuffer::IT_32BIT);
+		if (use32bitindexes)
+		{
+			pInt = static_cast<unsigned int*>(
+				ibuf->lock(HardwareBuffer::HBL_READ_ONLY));
+		}
+		else
+		{
+			pShort = static_cast<unsigned short*>(
+				ibuf->lock(HardwareBuffer::HBL_READ_ONLY));
+		}
+        work.mTriList.resize(numTris); // assumed tri list
+        for (i = 0; i < numTris; ++i)
+        {
+			PMFaceVertex *v0, *v1, *v2;
+			// use 32-bit index always since we're not storing
+			unsigned int vindex = use32bitindexes? *pInt++ : *pShort++;
+			v0 = &(work.mFaceVertList[vindex]);
+			vindex = use32bitindexes? *pInt++ : *pShort++;
+			v1 = &(work.mFaceVertList[vindex]);
+			vindex = use32bitindexes? *pInt++ : *pShort++;
+			v2 = &(work.mFaceVertList[vindex]);
+
+			work.mTriList[i].setDetails(i, v0, v1, v2);
+
+            work.mTriList[i].removed = false;
+
+        }
+		ibuf->unlock();
+
+    }
+    //---------------------------------------------------------------------
+    Real ProgressiveMesh::computeEdgeCollapseCost(PMVertex *src, PMVertex *dest)
+    {
+        // if we collapse edge uv by moving src to dest then how 
+        // much different will the model change, i.e. how much "error".
+        // The method of determining cost was designed in order 
+        // to exploit small and coplanar regions for
+        // effective polygon reduction.
+        Vector3 edgeVector = src->position - dest->position;
+
+        Real cost;
+		Real curvature = 0.001f;
+
+        // find the "sides" triangles that are on the edge uv
+        PMVertex::FaceList sides;
+        PMVertex::FaceList::iterator srcface, srcfaceEnd;
+        srcfaceEnd = src->face.end();
+        // Iterate over src's faces and find 'sides' of the shared edge which is being collapsed
+        for(srcface = src->face.begin(); srcface != srcfaceEnd; ++srcface)
+        {
+            // Check if this tri also has dest in it (shared edge)
+            if( (*srcface)->hasCommonVertex(dest) )
+            {
+                sides.insert(*srcface);
+            }
+        }
+
+		// Special cases
+		// If we're looking at a border vertex
+        if(src->isBorder())
+        {
+			if (sides.size() > 1) 
+			{
+				// src is on a border, but the src-dest edge has more than one tri on it
+				// So it must be collapsing inwards
+				// Mark as very high-value cost
+				// curvature = 1.0f;
+				cost = 1.0f;
+			}
+			else
+			{
+				// Collapsing ALONG a border
+				// We can't use curvature to measure the effect on the model
+				// Instead, see what effect it has on 'pulling' the other border edges
+				// The more colinear, the less effect it will have
+				// So measure the 'kinkiness' (for want of a better term)
+				// Normally there can be at most 1 other border edge attached to this
+				// However in weird cases there may be more, so find the worst
+				Vector3 collapseEdge, otherBorderEdge;
+				Real kinkiness, maxKinkiness;
+				PMVertex::NeighborList::iterator n, nend;
+				nend = src->neighbor.end();
+				maxKinkiness = 0.0f;
+				edgeVector.normalise();
+				collapseEdge = edgeVector;
+				for (n = src->neighbor.begin(); n != nend; ++n)
+				{
+					if (*n != dest && (*n)->isManifoldEdgeWith(src))
+					{
+						otherBorderEdge = src->position - (*n)->position;
+						otherBorderEdge.normalise();
+						// This time, the nearer the dot is to -1, the better, because that means
+						// the edges are opposite each other, therefore less kinkiness
+						// Scale into [0..1]
+						kinkiness = (otherBorderEdge.dotProduct(collapseEdge) + 1.002f) * 0.5f;
+						maxKinkiness = std::max(kinkiness, maxKinkiness);
+
+					}
+				}
+
+				cost = maxKinkiness; 
+
+			}
+        } 
+		else // not a border
+		{
+
+			// Standard inner vertex
+			// Calculate curvature
+			// use the triangle facing most away from the sides 
+			// to determine our curvature term
+			// Iterate over src's faces again
+			for(srcface = src->face.begin(); srcface != srcfaceEnd; ++srcface) 
+			{
+				Real mincurv = 1.0f; // curve for face i and closer side to it
+				// Iterate over the sides
+				PMVertex::FaceList::iterator sidesFace, sidesFaceEnd;
+				sidesFaceEnd = sides.end();
+				for(sidesFace = sides.begin(); sidesFace != sidesFaceEnd; ++sidesFace) 
+				{
+					// Dot product of face normal gives a good delta angle
+					Real dotprod = (*srcface)->normal.dotProduct( (*sidesFace)->normal );
+					// NB we do (1-..) to invert curvature where 1 is high curvature [0..1]
+					// Whilst dot product is high when angle difference is low
+					mincurv =  std::min(mincurv,(1.002f - dotprod) * 0.5f);
+				}
+				curvature = std::max(curvature, mincurv);
+			}
+			cost = curvature;
+		}
+
+        // check for texture seam ripping
+		if (src->seam && !dest->seam)
+		{
+			cost = 1.0f;
+		}
+
+        // Check for singular triangle destruction
+        // If src and dest both only have 1 triangle (and it must be a shared one)
+        // then this would destroy the shape, so don't do this
+        if (src->face.size() == 1 && dest->face.size() == 1)
+        {
+            cost = NEVER_COLLAPSE_COST;
+        }
+
+
+		// Degenerate case check
+		// Are we going to invert a face normal of one of the neighbouring faces?
+		// Can occur when we have a very small remaining edge and collapse crosses it
+		// Look for a face normal changing by > 90 degrees
+		for(srcface = src->face.begin(); srcface != srcfaceEnd; ++srcface) 
+		{
+			// Ignore the deleted faces (those including src & dest)
+			if( !(*srcface)->hasCommonVertex(dest) )
+			{
+				// Test the new face normal
+				PMVertex *v0, *v1, *v2;
+				// Replace src with dest wherever it is
+				v0 = ( (*srcface)->vertex[0]->commonVertex == src) ? dest : (*srcface)->vertex[0]->commonVertex;
+				v1 = ( (*srcface)->vertex[1]->commonVertex == src) ? dest : (*srcface)->vertex[1]->commonVertex;
+				v2 = ( (*srcface)->vertex[2]->commonVertex == src) ? dest : (*srcface)->vertex[2]->commonVertex;
+
+				// Cross-product 2 edges
+				Vector3 e1 = v1->position - v0->position; 
+				Vector3 e2 = v2->position - v1->position;
+
+				Vector3 newNormal = e1.crossProduct(e2);
+				newNormal.normalise();
+
+				// Dot old and new face normal
+				// If < 0 then more than 90 degree difference
+				if (newNormal.dotProduct( (*srcface)->normal ) < 0.0f )
+				{
+					// Don't do it!
+					cost = NEVER_COLLAPSE_COST;
+					break; // No point continuing
+				}
+
+
+			}
+		}
+		
+
+		assert (cost >= 0);
+		return cost;
+    }
+    //---------------------------------------------------------------------
+    void ProgressiveMesh::initialiseEdgeCollapseCosts(void)
+    {
+        WorkingDataList::iterator i, iend;
+        iend = mWorkingData.end();
+        for (i = mWorkingData.begin(); i != iend; ++i)
+        {
+            CommonVertexList::iterator v, vend;
+            vend = i->mVertList.end();
+            for (v = i->mVertList.begin(); v != vend; ++v)
+            {
+                v->collapseTo = NULL;
+                v->collapseCost = NEVER_COLLAPSE_COST;
+            }
+        }
+
+        
+    }
+    //---------------------------------------------------------------------
+    Real ProgressiveMesh::computeEdgeCostAtVertexForBuffer(WorkingDataList::iterator idata, size_t vertIndex)
+    {
+        // compute the edge collapse cost for all edges that start
+        // from vertex v.  Since we are only interested in reducing
+        // the object by selecting the min cost edge at each step, we
+        // only cache the cost of the least cost edge at this vertex
+        // (in member variable collapse) as well as the value of the 
+        // cost (in member variable objdist).
+
+        CommonVertexList::iterator v = idata->mVertList.begin();
+        v += vertIndex;
+
+        if(v->neighbor.empty()) {
+            // v doesn't have neighbors so nothing to collapse
+            v->notifyRemoved();
+            return v->collapseCost;
+        }
+
+        // Init metrics
+        v->collapseCost = NEVER_COLLAPSE_COST;
+        v->collapseTo = NULL;
+
+        // search all neighboring edges for "least cost" edge
+        PMVertex::NeighborList::iterator n, nend;
+        nend = v->neighbor.end();
+        Real cost;
+        for(n = v->neighbor.begin(); n != nend; ++n) 
+        {
+            cost = computeEdgeCollapseCost(&(*v), *n);
+            if( (!v->collapseTo) || cost < v->collapseCost) 
+            {
+                v->collapseTo = *n;  // candidate for edge collapse
+                v->collapseCost = cost;             // cost of the collapse
+            }
+        }
+
+        return v->collapseCost;
+    }
+    //---------------------------------------------------------------------
+    void ProgressiveMesh::computeAllCosts(void)
+    {
+        initialiseEdgeCollapseCosts();
+        size_t i;
+        for (i = 0; i < mpVertexData->vertexCount; ++i)
+        {
+            computeEdgeCostAtVertex(i);
+        }
+    }
+    //---------------------------------------------------------------------
+    void ProgressiveMesh::collapse(ProgressiveMesh::PMVertex *src)
+    {
+        PMVertex *dest = src->collapseTo;
+		std::set<PMVertex*> recomputeSet;
+
+		// Abort if we're never supposed to collapse
+		if (src->collapseCost == NEVER_COLLAPSE_COST) 
+			return;
+
+		// Remove this vertex from the running for the next check
+		src->collapseTo = NULL;
+		src->collapseCost = NEVER_COLLAPSE_COST;
+		mWorstCosts[src->index] = NEVER_COLLAPSE_COST;
+
+		// Collapse the edge uv by moving vertex u onto v
+	    // Actually remove tris on uv, then update tris that
+	    // have u to have v, and then remove u.
+	    if(!dest) {
+		    // src is a vertex all by itself 
+#if OGRE_DEBUG_MODE 
+			ofdebug << "Aborting collapse, orphan vertex. " << std::endl;
+#endif
+			return;
+	    }
+
+		// Add dest and all the neighbours of source and dest to recompute list
+		recomputeSet.insert(dest);
+		PMVertex::NeighborList::iterator n, nend;
+        nend = src->neighbor.end();
+
+		PMVertex* temp;
+
+	    for(n = src->neighbor.begin(); n != nend; ++n)
+        {
+			temp = *n;
+			recomputeSet.insert( *n );
+		}
+        nend = dest->neighbor.end();
+	    for(n = dest->neighbor.begin(); n != nend; ++n)
+        {
+			temp = *n;
+			recomputeSet.insert( *n );
+		}
+
+	    // delete triangles on edge src-dest
+        // Notify others to replace src with dest
+        PMVertex::FaceList::iterator f, fend;
+        fend = src->face.end();
+		// Queue of faces for removal / replacement
+		// prevents us screwing up the iterators while we parse
+		PMVertex::FaceList faceRemovalList, faceReplacementList;
+	    for(f = src->face.begin(); f != fend; ++f) 
+        {
+		    if((*f)->hasCommonVertex(dest)) 
+            {
+                // Tri is on src-dest therefore is gone
+				faceRemovalList.insert(*f);
+                // Reduce index count by 3 (useful for quick allocation later)
+                mCurrNumIndexes -= 3;
+		    }
+            else
+            {
+                // Only src involved, replace with dest
+				faceReplacementList.insert(*f);
+            }
+	    }
+
+		src->toBeRemoved = true;
+		// Replace all the faces queued for replacement
+	    for(f = faceReplacementList.begin(); f != faceReplacementList.end(); ++f) 
+		{
+			/* Locate the face vertex which corresponds with the common 'dest' vertex
+			To to this, find a removed face which has the FACE vertex corresponding with
+			src, and use it's FACE vertex version of dest.
+			*/
+			PMFaceVertex* srcFaceVert = (*f)->getFaceVertexFromCommon(src);
+			PMFaceVertex* destFaceVert = NULL;
+			PMVertex::FaceList::iterator iremoved;
+			for(iremoved = faceRemovalList.begin(); iremoved != faceRemovalList.end(); ++iremoved) 
+			{
+				//if ( (*iremoved)->hasFaceVertex(srcFaceVert) )
+				//{
+					destFaceVert = (*iremoved)->getFaceVertexFromCommon(dest); 
+				//}
+			}
+			
+			assert(destFaceVert);
+
+#if OGRE_DEBUG_MODE 
+			ofdebug << "Replacing vertex on face " << (unsigned int)(*f)->index << std::endl;
+#endif
+            (*f)->replaceVertex(srcFaceVert, destFaceVert);
+		}
+		// Remove all the faces queued for removal
+	    for(f = faceRemovalList.begin(); f != faceRemovalList.end(); ++f) 
+		{
+#if OGRE_DEBUG_MODE 
+			ofdebug << "Removing face " << (unsigned int)(*f)->index << std::endl;
+#endif
+			(*f)->notifyRemoved();
+		}
+
+        // Notify the vertex that it is gone
+        src->notifyRemoved();
+
+        // recompute costs
+		std::set<PMVertex*>::iterator irecomp, irecompend;
+		irecompend = recomputeSet.end();
+		for (irecomp = recomputeSet.begin(); irecomp != irecompend; ++irecomp)
+		{
+			temp = (*irecomp);
+			computeEdgeCostAtVertex( (*irecomp)->index );
+		}
+		
+    }
+    //---------------------------------------------------------------------
+    void ProgressiveMesh::computeEdgeCostAtVertex(size_t vertIndex)
+    {
+		// Call computer for each buffer on this vertex
+        Real worstCost = -0.01f;
+        WorkingDataList::iterator i, iend;
+        iend = mWorkingData.end();
+        for (i = mWorkingData.begin(); i != iend; ++i)
+        {
+            worstCost = std::max(worstCost, 
+                computeEdgeCostAtVertexForBuffer(i, vertIndex));
+        }
+        // Save the worst cost
+        mWorstCosts[vertIndex] = worstCost;
+    }
+    //---------------------------------------------------------------------
+    size_t ProgressiveMesh::getNextCollapser(void)
+    {
+        // Scan
+        // Not done as a sort because want to keep the lookup simple for now
+        Real bestVal = NEVER_COLLAPSE_COST;
+        size_t i, bestIndex;
+		bestIndex = 0; // NB this is ok since if nothing is better than this, nothing will collapse
+        for (i = 0; i < mNumCommonVertices; ++i)
+        {
+            if (mWorstCosts[i] < bestVal)
+            {
+                bestVal = mWorstCosts[i];
+                bestIndex = i;
+            }
+        }
+        return bestIndex;
+    }
+    //---------------------------------------------------------------------
+    void ProgressiveMesh::bakeNewLOD(IndexData* pData)
+    {
+        assert(mCurrNumIndexes > 0 && "No triangles to bake!");
+        // Zip through the tri list of any working data copy and bake
+        pData->indexCount = mCurrNumIndexes;
+		pData->indexStart = 0;
+		// Base size of indexes on original 
+		bool use32bitindexes = 
+			(mpIndexData->indexBuffer->getType() == HardwareIndexBuffer::IT_32BIT);
+
+		// Create index buffer, we don't need to read it back or modify it a lot
+		pData->indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+			use32bitindexes? HardwareIndexBuffer::IT_32BIT : HardwareIndexBuffer::IT_16BIT,
+			pData->indexCount, HardwareBuffer::HBU_STATIC_WRITE_ONLY, false);
+
+        unsigned short* pShort;
+		unsigned int* pInt;
+		if (use32bitindexes)
+		{
+			pInt = static_cast<unsigned int*>(
+				pData->indexBuffer->lock( 0,
+					pData->indexBuffer->getSizeInBytes(),
+					HardwareBuffer::HBL_DISCARD));
+		}
+		else
+		{
+			pShort = static_cast<unsigned short*>(
+				pData->indexBuffer->lock( 0,
+					pData->indexBuffer->getSizeInBytes(),
+					HardwareBuffer::HBL_DISCARD));
+		}
+        TriangleList::iterator tri, triend;
+        // Use the first working data buffer, they are all the same index-wise
+        WorkingDataList::iterator pWork = mWorkingData.begin();
+        triend = pWork->mTriList.end();
+        for (tri = pWork->mTriList.begin(); tri != triend; ++tri)
+        {
+            if (!tri->removed)
+            {
+				if (use32bitindexes)
+				{
+					*pInt++ = static_cast<unsigned int>(tri->vertex[0]->realIndex);
+					*pInt++ = static_cast<unsigned int>(tri->vertex[1]->realIndex);
+					*pInt++ = static_cast<unsigned int>(tri->vertex[2]->realIndex);
+				}
+				else
+				{
+					*pShort++ = static_cast<unsigned short>(tri->vertex[0]->realIndex);
+					*pShort++ = static_cast<unsigned short>(tri->vertex[1]->realIndex);
+					*pShort++ = static_cast<unsigned short>(tri->vertex[2]->realIndex);
+				}
+            }
+        }
+		pData->indexBuffer->unlock();
+
+    }
+    //---------------------------------------------------------------------
+    ProgressiveMesh::PMTriangle::PMTriangle() : removed(false)
+    {
+    }
+    //---------------------------------------------------------------------
+    void ProgressiveMesh::PMTriangle::setDetails(size_t newindex, 
+		ProgressiveMesh::PMFaceVertex *v0, ProgressiveMesh::PMFaceVertex *v1, 
+        ProgressiveMesh::PMFaceVertex *v2)
+    {
+        assert(v0!=v1 && v1!=v2 && v2!=v0);
+
+        index = newindex;
+		vertex[0]=v0;
+        vertex[1]=v1;
+        vertex[2]=v2;
+
+        computeNormal();
+
+        // Add tri to vertices
+        // Also tell vertices they are neighbours
+        for(int i=0;i<3;i++) {
+            vertex[i]->commonVertex->face.insert(this);
+            for(int j=0;j<3;j++) if(i!=j) {
+                vertex[i]->commonVertex->neighbor.insert(vertex[j]->commonVertex);
+            }
+        }
+    }
+    //---------------------------------------------------------------------
+    void ProgressiveMesh::PMTriangle::notifyRemoved(void)
+    {
+        int i;
+        for(i=0; i<3; i++) {
+            // remove this tri from the vertices
+            if(vertex[i]) vertex[i]->commonVertex->face.erase(this);
+        }
+        for(i=0; i<3; i++) {
+            int i2 = (i+1)%3;
+            if(!vertex[i] || !vertex[i2]) continue;
+            // Check remaining vertices and remove if not neighbours anymore
+            // NB May remain neighbours if other tris link them
+            vertex[i ]->commonVertex->removeIfNonNeighbor(vertex[i2]->commonVertex);
+            vertex[i2]->commonVertex->removeIfNonNeighbor(vertex[i ]->commonVertex);
+        }
+
+        removed = true;
+    }
+    //---------------------------------------------------------------------
+    bool ProgressiveMesh::PMTriangle::hasCommonVertex(ProgressiveMesh::PMVertex *v) const
+    {
+        return (v == vertex[0]->commonVertex ||
+			v == vertex[1]->commonVertex || 
+			v == vertex[2]->commonVertex);
+    }
+    //---------------------------------------------------------------------
+	bool ProgressiveMesh::PMTriangle::hasFaceVertex(ProgressiveMesh::PMFaceVertex *v) const
+	{
+		return (v == vertex[0] ||
+				v == vertex[1] || 
+				v == vertex[2]);
+	}
+    //---------------------------------------------------------------------
+	ProgressiveMesh::PMFaceVertex* 
+	ProgressiveMesh::PMTriangle::getFaceVertexFromCommon(ProgressiveMesh::PMVertex* commonVert)
+	{
+		if (vertex[0]->commonVertex == commonVert) return vertex[0];
+		if (vertex[1]->commonVertex == commonVert) return vertex[1];
+		if (vertex[2]->commonVertex == commonVert) return vertex[2];
+
+		return NULL;
+
+	}
+    //---------------------------------------------------------------------
+    void ProgressiveMesh::PMTriangle::computeNormal()
+    {
+        Vector3 v0=vertex[0]->commonVertex->position;
+        Vector3 v1=vertex[1]->commonVertex->position;
+        Vector3 v2=vertex[2]->commonVertex->position;
+        // Cross-product 2 edges
+        Vector3 e1 = v1 - v0; 
+        Vector3 e2 = v2 - v1;
+
+        normal = e1.crossProduct(e2);
+        normal.normalise();
+    }
+    //---------------------------------------------------------------------
+    void ProgressiveMesh::PMTriangle::replaceVertex(
+		ProgressiveMesh::PMFaceVertex *vold, ProgressiveMesh::PMFaceVertex *vnew) 
+    {
+        assert(vold && vnew);
+        assert(vold==vertex[0] || vold==vertex[1] || vold==vertex[2]);
+        assert(vnew!=vertex[0] && vnew!=vertex[1] && vnew!=vertex[2]);
+        if(vold==vertex[0]){
+            vertex[0]=vnew;
+        }
+        else if(vold==vertex[1]){
+            vertex[1]=vnew;
+        }
+        else {
+            assert(vold==vertex[2]);
+            vertex[2]=vnew;
+        }
+        int i;
+        vold->commonVertex->face.erase(this);
+        vnew->commonVertex->face.insert(this);
+        for(i=0;i<3;i++) {
+            vold->commonVertex->removeIfNonNeighbor(vertex[i]->commonVertex);
+            vertex[i]->commonVertex->removeIfNonNeighbor(vold->commonVertex);
+        }
+        for(i=0;i<3;i++) {
+            assert(vertex[i]->commonVertex->face.find(this) != vertex[i]->commonVertex->face.end());
+            for(int j=0;j<3;j++) if(i!=j) {
+#if OGRE_DEBUG_MODE 
+				ofdebug << "Adding vertex " << (unsigned int)vertex[j]->commonVertex->index << " to the neighbor list "
+					"of vertex " << (unsigned int)vertex[i]->commonVertex->index << std::endl;
+#endif 
+                vertex[i]->commonVertex->neighbor.insert(vertex[j]->commonVertex);
+            }
+        }
+        computeNormal();
+    }
+    //---------------------------------------------------------------------
+    ProgressiveMesh::PMVertex::PMVertex() : removed(false)
+    {
+    }
+    //---------------------------------------------------------------------
+    void ProgressiveMesh::PMVertex::setDetails(const Vector3& v, size_t newindex)
+    {
+        position = v;
+        index = newindex;
+    }
+    //---------------------------------------------------------------------
+    void ProgressiveMesh::PMVertex::notifyRemoved(void)
+    {
+        NeighborList::iterator i, iend;
+        iend = neighbor.end();
+        for (i = neighbor.begin(); i != iend; ++i)
+        {
+            // Remove me from neighbor
+            (*i)->neighbor.erase(this);
+        }
+        removed = true;
+		this->collapseTo = NULL;
+        this->collapseCost = NEVER_COLLAPSE_COST;
+    }
+    //---------------------------------------------------------------------
+    bool ProgressiveMesh::PMVertex::isBorder() 
+    {
+        // Look for edges which only have one tri attached, this is a border
+
+        NeighborList::iterator i, iend;
+        iend = neighbor.end();
+        // Loop for each neighbor
+        for(i = neighbor.begin(); i != iend; ++i) 
+        {
+            // Count of tris shared between the edge between this and neighbor
+            ushort count = 0;
+            // Loop over each face, looking for shared ones
+            FaceList::iterator j, jend;
+            jend = face.end();
+            for(j = face.begin(); j != jend; ++j) 
+            {
+                if((*j)->hasCommonVertex(*i))
+                {
+                    // Shared tri
+                    count ++;
+                }
+            }
+            //assert(count>0); // Must be at least one!
+            // This edge has only 1 tri on it, it's a border
+            if(count == 1) 
+				return true;
+        }
+        return false;
+    } 
+	//---------------------------------------------------------------------
+	bool ProgressiveMesh::PMVertex::isManifoldEdgeWith(ProgressiveMesh::PMVertex* v)
+	{
+		// Check the sides involving both these verts
+		// If there is only 1 this is a manifold edge
+		ushort sidesCount = 0;
+		FaceList::iterator i, iend;
+		iend = face.end();
+		for (i = face.begin(); i != iend; ++i)
+		{
+			if ((*i)->hasCommonVertex(v))
+			{
+				sidesCount++;
+			}
+		}
+
+		return (sidesCount == 1);
+	}
+	//---------------------------------------------------------------------
+    void ProgressiveMesh::PMVertex::removeIfNonNeighbor(ProgressiveMesh::PMVertex *n) 
+    {
+        // removes n from neighbor list if n isn't a neighbor.
+        NeighborList::iterator i = neighbor.find(n);
+        if (i == neighbor.end())
+            return; // Not in neighbor list anyway
+
+        FaceList::iterator f, fend;
+        fend = face.end();
+        for(f = face.begin(); f != fend; ++f) 
+        {
+            if((*f)->hasCommonVertex(n)) return; // Still a neighbor
+        }
+
+#if OGRE_DEBUG_MODE 
+		ofdebug << "Vertex " << (unsigned int)n->index << " is no longer a neighbour of vertex " << (unsigned int)this->index <<
+			" so has been removed from the latter's neighbor list." << std::endl;
+#endif
+        neighbor.erase(n);
+
+		if (neighbor.empty() && !toBeRemoved)
+		{
+			// This vertex has been removed through isolation (collapsing around it)
+			this->notifyRemoved();
+		}
+    }
+    //---------------------------------------------------------------------
+    void ProgressiveMesh::dumpContents(const String& log)
+	{
+		std::ofstream ofdump(log.c_str());
+
+		// Just dump 1st working data for now
+		WorkingDataList::iterator worki = mWorkingData.begin();
+
+		CommonVertexList::iterator vi, vend;
+		vend = worki->mVertList.end();
+		ofdump << "-------== VERTEX LIST ==-----------------" << std::endl;
+		size_t i;
+		for (vi = worki->mVertList.begin(), i = 0; i < mNumCommonVertices; ++vi, ++i)
+		{
+			ofdump << "Vertex " << (unsigned int)vi->index << " pos: " << vi->position << " removed: " 
+				<< vi->removed << " isborder: " << vi->isBorder() << std::endl;
+			ofdump << "    Faces:" << std::endl;
+			PMVertex::FaceList::iterator f, fend;
+			fend = vi->face.end();
+			for(f = vi->face.begin(); f != fend; ++f)
+			{
+				ofdump << "    Triangle index " << (unsigned int)(*f)->index << std::endl;
+			}
+			ofdump << "    Neighbours:" << std::endl;
+			PMVertex::NeighborList::iterator n, nend;
+			nend = vi->neighbor.end();
+			for (n = vi->neighbor.begin(); n != nend; ++n)
+			{
+				ofdump << "    Vertex index " << (unsigned int)(*n)->index << std::endl;
+			}
+
+		}
+
+		TriangleList::iterator ti, tend;
+		tend = worki->mTriList.end();
+		ofdump << "-------== TRIANGLE LIST ==-----------------" << std::endl;
+		for(ti = worki->mTriList.begin(); ti != tend; ++ti)
+		{
+			ofdump << "Triangle " << (unsigned int)ti->index << " norm: " << ti->normal << " removed: " << ti->removed << std::endl;
+			ofdump << "    Vertex 0: " << (unsigned int)ti->vertex[0]->realIndex << std::endl;
+			ofdump << "    Vertex 1: " << (unsigned int)ti->vertex[1]->realIndex << std::endl;
+			ofdump << "    Vertex 2: " << (unsigned int)ti->vertex[2]->realIndex << std::endl;
+		}
+
+		ofdump << "-------== COLLAPSE COST LIST ==-----------------" << std::endl;
+		for (size_t ci = 0; ci < mNumCommonVertices; ++ci)
+		{
+			ofdump << "Vertex " << (unsigned int)ci << ": " << mWorstCosts[ci] << std::endl;
+		}
+
+		ofdump.close();
+	}
+
+
+}
Index: /OgreMain/src/OgreQuaternion.cpp
===================================================================
--- /OgreMain/src/OgreQuaternion.cpp	(revision 5)
+++ /OgreMain/src/OgreQuaternion.cpp	(revision 5)
@@ -0,0 +1,616 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+// NOTE THAT THIS FILE IS BASED ON MATERIAL FROM:
+
+// Magic Software, Inc.
+// http://www.geometrictools.com
+// Copyright (c) 2000, All Rights Reserved
+//
+// Source code from Magic Software is supplied under the terms of a license
+// agreement and may not be copied or disclosed except in accordance with the
+// terms of that agreement.  The various license agreements may be found at
+// the Magic Software web site.  This file is subject to the license
+//
+// FREE SOURCE CODE
+// http://www.geometrictools.com/License/WildMagic3License.pdf
+
+#include "OgreQuaternion.h"
+
+#include "OgreMath.h"
+#include "OgreMatrix3.h"
+#include "OgreVector3.h"
+
+namespace Ogre {
+
+    const Real Quaternion::ms_fEpsilon = 1e-03;
+    const Quaternion Quaternion::ZERO(0.0,0.0,0.0,0.0);
+    const Quaternion Quaternion::IDENTITY(1.0,0.0,0.0,0.0);
+
+    //-----------------------------------------------------------------------
+    void Quaternion::FromRotationMatrix (const Matrix3& kRot)
+    {
+        // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes
+        // article "Quaternion Calculus and Fast Animation".
+
+        Real fTrace = kRot[0][0]+kRot[1][1]+kRot[2][2];
+        Real fRoot;
+
+        if ( fTrace > 0.0 )
+        {
+            // |w| > 1/2, may as well choose w > 1/2
+            fRoot = Math::Sqrt(fTrace + 1.0);  // 2w
+            w = 0.5*fRoot;
+            fRoot = 0.5/fRoot;  // 1/(4w)
+            x = (kRot[2][1]-kRot[1][2])*fRoot;
+            y = (kRot[0][2]-kRot[2][0])*fRoot;
+            z = (kRot[1][0]-kRot[0][1])*fRoot;
+        }
+        else
+        {
+            // |w| <= 1/2
+            static size_t s_iNext[3] = { 1, 2, 0 };
+            size_t i = 0;
+            if ( kRot[1][1] > kRot[0][0] )
+                i = 1;
+            if ( kRot[2][2] > kRot[i][i] )
+                i = 2;
+            size_t j = s_iNext[i];
+            size_t k = s_iNext[j];
+
+            fRoot = Math::Sqrt(kRot[i][i]-kRot[j][j]-kRot[k][k] + 1.0);
+            Real* apkQuat[3] = { &x, &y, &z };
+            *apkQuat[i] = 0.5*fRoot;
+            fRoot = 0.5/fRoot;
+            w = (kRot[k][j]-kRot[j][k])*fRoot;
+            *apkQuat[j] = (kRot[j][i]+kRot[i][j])*fRoot;
+            *apkQuat[k] = (kRot[k][i]+kRot[i][k])*fRoot;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Quaternion::ToRotationMatrix (Matrix3& kRot) const
+    {
+        Real fTx  = 2.0*x;
+        Real fTy  = 2.0*y;
+        Real fTz  = 2.0*z;
+        Real fTwx = fTx*w;
+        Real fTwy = fTy*w;
+        Real fTwz = fTz*w;
+        Real fTxx = fTx*x;
+        Real fTxy = fTy*x;
+        Real fTxz = fTz*x;
+        Real fTyy = fTy*y;
+        Real fTyz = fTz*y;
+        Real fTzz = fTz*z;
+
+        kRot[0][0] = 1.0-(fTyy+fTzz);
+        kRot[0][1] = fTxy-fTwz;
+        kRot[0][2] = fTxz+fTwy;
+        kRot[1][0] = fTxy+fTwz;
+        kRot[1][1] = 1.0-(fTxx+fTzz);
+        kRot[1][2] = fTyz-fTwx;
+        kRot[2][0] = fTxz-fTwy;
+        kRot[2][1] = fTyz+fTwx;
+        kRot[2][2] = 1.0-(fTxx+fTyy);
+    }
+    //-----------------------------------------------------------------------
+    void Quaternion::FromAngleAxis (const Radian& rfAngle,
+        const Vector3& rkAxis)
+    {
+        // assert:  axis[] is unit length
+        //
+        // The quaternion representing the rotation is
+        //   q = cos(A/2)+sin(A/2)*(x*i+y*j+z*k)
+
+        Radian fHalfAngle ( 0.5*rfAngle );
+        Real fSin = Math::Sin(fHalfAngle);
+        w = Math::Cos(fHalfAngle);
+        x = fSin*rkAxis.x;
+        y = fSin*rkAxis.y;
+        z = fSin*rkAxis.z;
+    }
+    //-----------------------------------------------------------------------
+    void Quaternion::ToAngleAxis (Radian& rfAngle, Vector3& rkAxis) const
+    {
+        // The quaternion representing the rotation is
+        //   q = cos(A/2)+sin(A/2)*(x*i+y*j+z*k)
+
+        Real fSqrLength = x*x+y*y+z*z;
+        if ( fSqrLength > 0.0 )
+        {
+            rfAngle = 2.0*Math::ACos(w);
+            Real fInvLength = Math::InvSqrt(fSqrLength);
+            rkAxis.x = x*fInvLength;
+            rkAxis.y = y*fInvLength;
+            rkAxis.z = z*fInvLength;
+        }
+        else
+        {
+            // angle is 0 (mod 2*pi), so any axis will do
+            rfAngle = Radian(0.0);
+            rkAxis.x = 1.0;
+            rkAxis.y = 0.0;
+            rkAxis.z = 0.0;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Quaternion::FromAxes (const Vector3* akAxis)
+    {
+        Matrix3 kRot;
+
+        for (size_t iCol = 0; iCol < 3; iCol++)
+        {
+            kRot[0][iCol] = akAxis[iCol].x;
+            kRot[1][iCol] = akAxis[iCol].y;
+            kRot[2][iCol] = akAxis[iCol].z;
+        }
+
+        FromRotationMatrix(kRot);
+    }
+    //-----------------------------------------------------------------------
+    void Quaternion::FromAxes (const Vector3& xaxis, const Vector3& yaxis, const Vector3& zaxis)
+    {
+        Matrix3 kRot;
+
+        kRot[0][0] = xaxis.x;
+        kRot[1][0] = xaxis.y;
+        kRot[2][0] = xaxis.z;
+
+        kRot[0][1] = yaxis.x;
+        kRot[1][1] = yaxis.y;
+        kRot[2][1] = yaxis.z;
+
+        kRot[0][2] = zaxis.x;
+        kRot[1][2] = zaxis.y;
+        kRot[2][2] = zaxis.z;
+
+        FromRotationMatrix(kRot);
+
+    }
+    //-----------------------------------------------------------------------
+    void Quaternion::ToAxes (Vector3* akAxis) const
+    {
+        Matrix3 kRot;
+
+        ToRotationMatrix(kRot);
+
+        for (size_t iCol = 0; iCol < 3; iCol++)
+        {
+            akAxis[iCol].x = kRot[0][iCol];
+            akAxis[iCol].y = kRot[1][iCol];
+            akAxis[iCol].z = kRot[2][iCol];
+        }
+    }
+    //-----------------------------------------------------------------------
+    Vector3 Quaternion::xAxis(void) const
+    {
+        //Real fTx  = 2.0*x;
+        Real fTy  = 2.0*y;
+        Real fTz  = 2.0*z;
+        Real fTwy = fTy*w;
+        Real fTwz = fTz*w;
+        Real fTxy = fTy*x;
+        Real fTxz = fTz*x;
+        Real fTyy = fTy*y;
+        Real fTzz = fTz*z;
+
+        return Vector3(1.0-(fTyy+fTzz), fTxy+fTwz, fTxz-fTwy);
+    }
+    //-----------------------------------------------------------------------
+    Vector3 Quaternion::yAxis(void) const
+    {
+        Real fTx  = 2.0*x;
+        Real fTy  = 2.0*y;
+        Real fTz  = 2.0*z;
+        Real fTwx = fTx*w;
+        Real fTwz = fTz*w;
+        Real fTxx = fTx*x;
+        Real fTxy = fTy*x;
+        Real fTyz = fTz*y;
+        Real fTzz = fTz*z;
+
+        return Vector3(fTxy-fTwz, 1.0-(fTxx+fTzz), fTyz+fTwx);
+    }
+    //-----------------------------------------------------------------------
+    Vector3 Quaternion::zAxis(void) const
+    {
+        Real fTx  = 2.0*x;
+        Real fTy  = 2.0*y;
+        Real fTz  = 2.0*z;
+        Real fTwx = fTx*w;
+        Real fTwy = fTy*w;
+        Real fTxx = fTx*x;
+        Real fTxz = fTz*x;
+        Real fTyy = fTy*y;
+        Real fTyz = fTz*y;
+
+        return Vector3(fTxz+fTwy, fTyz-fTwx, 1.0-(fTxx+fTyy));
+    }
+    //-----------------------------------------------------------------------
+    void Quaternion::ToAxes (Vector3& xaxis, Vector3& yaxis, Vector3& zaxis) const
+    {
+        Matrix3 kRot;
+
+        ToRotationMatrix(kRot);
+
+        xaxis.x = kRot[0][0];
+        xaxis.y = kRot[1][0];
+        xaxis.z = kRot[2][0];
+
+        yaxis.x = kRot[0][1];
+        yaxis.y = kRot[1][1];
+        yaxis.z = kRot[2][1];
+
+        zaxis.x = kRot[0][2];
+        zaxis.y = kRot[1][2];
+        zaxis.z = kRot[2][2];
+    }
+
+    //-----------------------------------------------------------------------
+    Quaternion Quaternion::operator+ (const Quaternion& rkQ) const
+    {
+        return Quaternion(w+rkQ.w,x+rkQ.x,y+rkQ.y,z+rkQ.z);
+    }
+    //-----------------------------------------------------------------------
+    Quaternion Quaternion::operator- (const Quaternion& rkQ) const
+    {
+        return Quaternion(w-rkQ.w,x-rkQ.x,y-rkQ.y,z-rkQ.z);
+    }
+    //-----------------------------------------------------------------------
+    Quaternion Quaternion::operator* (const Quaternion& rkQ) const
+    {
+        // NOTE:  Multiplication is not generally commutative, so in most
+        // cases p*q != q*p.
+
+        return Quaternion
+        (
+            w * rkQ.w - x * rkQ.x - y * rkQ.y - z * rkQ.z,
+            w * rkQ.x + x * rkQ.w + y * rkQ.z - z * rkQ.y,
+            w * rkQ.y + y * rkQ.w + z * rkQ.x - x * rkQ.z,
+            w * rkQ.z + z * rkQ.w + x * rkQ.y - y * rkQ.x
+        );
+    }
+    //-----------------------------------------------------------------------
+    Quaternion Quaternion::operator* (Real fScalar) const
+    {
+        return Quaternion(fScalar*w,fScalar*x,fScalar*y,fScalar*z);
+    }
+    //-----------------------------------------------------------------------
+    Quaternion operator* (Real fScalar, const Quaternion& rkQ)
+    {
+        return Quaternion(fScalar*rkQ.w,fScalar*rkQ.x,fScalar*rkQ.y,
+            fScalar*rkQ.z);
+    }
+    //-----------------------------------------------------------------------
+    Quaternion Quaternion::operator- () const
+    {
+        return Quaternion(-w,-x,-y,-z);
+    }
+    //-----------------------------------------------------------------------
+    Real Quaternion::Dot (const Quaternion& rkQ) const
+    {
+        return w*rkQ.w+x*rkQ.x+y*rkQ.y+z*rkQ.z;
+    }
+    //-----------------------------------------------------------------------
+    Real Quaternion::Norm () const
+    {
+        return w*w+x*x+y*y+z*z;
+    }
+    //-----------------------------------------------------------------------
+    Quaternion Quaternion::Inverse () const
+    {
+        Real fNorm = w*w+x*x+y*y+z*z;
+        if ( fNorm > 0.0 )
+        {
+            Real fInvNorm = 1.0/fNorm;
+            return Quaternion(w*fInvNorm,-x*fInvNorm,-y*fInvNorm,-z*fInvNorm);
+        }
+        else
+        {
+            // return an invalid result to flag the error
+            return ZERO;
+        }
+    }
+    //-----------------------------------------------------------------------
+    Quaternion Quaternion::UnitInverse () const
+    {
+        // assert:  'this' is unit length
+        return Quaternion(w,-x,-y,-z);
+    }
+    //-----------------------------------------------------------------------
+    Quaternion Quaternion::Exp () const
+    {
+        // If q = A*(x*i+y*j+z*k) where (x,y,z) is unit length, then
+        // exp(q) = cos(A)+sin(A)*(x*i+y*j+z*k).  If sin(A) is near zero,
+        // use exp(q) = cos(A)+A*(x*i+y*j+z*k) since A/sin(A) has limit 1.
+
+        Radian fAngle ( Math::Sqrt(x*x+y*y+z*z) );
+        Real fSin = Math::Sin(fAngle);
+
+        Quaternion kResult;
+        kResult.w = Math::Cos(fAngle);
+
+        if ( Math::Abs(fSin) >= ms_fEpsilon )
+        {
+            Real fCoeff = fSin/(fAngle.valueRadians());
+            kResult.x = fCoeff*x;
+            kResult.y = fCoeff*y;
+            kResult.z = fCoeff*z;
+        }
+        else
+        {
+            kResult.x = x;
+            kResult.y = y;
+            kResult.z = z;
+        }
+
+        return kResult;
+    }
+    //-----------------------------------------------------------------------
+    Quaternion Quaternion::Log () const
+    {
+        // If q = cos(A)+sin(A)*(x*i+y*j+z*k) where (x,y,z) is unit length, then
+        // log(q) = A*(x*i+y*j+z*k).  If sin(A) is near zero, use log(q) =
+        // sin(A)*(x*i+y*j+z*k) since sin(A)/A has limit 1.
+
+        Quaternion kResult;
+        kResult.w = 0.0;
+
+        if ( Math::Abs(w) < 1.0 )
+        {
+            Radian fAngle ( Math::ACos(w) );
+            Real fSin = Math::Sin(fAngle);
+            if ( Math::Abs(fSin) >= ms_fEpsilon )
+            {
+                Real fCoeff = fAngle.valueRadians()/fSin;
+                kResult.x = fCoeff*x;
+                kResult.y = fCoeff*y;
+                kResult.z = fCoeff*z;
+                return kResult;
+            }
+        }
+
+        kResult.x = x;
+        kResult.y = y;
+        kResult.z = z;
+
+        return kResult;
+    }
+    //-----------------------------------------------------------------------
+    Vector3 Quaternion::operator* (const Vector3& v) const
+    {
+		// nVidia SDK implementation
+		Vector3 uv, uuv;
+		Vector3 qvec(x, y, z);
+		uv = qvec.crossProduct(v);
+		uuv = qvec.crossProduct(uv);
+		uv *= (2.0f * w);
+		uuv *= 2.0f;
+
+		return v + uv + uuv;
+
+    }
+    //-----------------------------------------------------------------------
+	bool Quaternion::equals(const Quaternion& rhs, const Radian& tolerance) const
+	{
+        Real fCos = Dot(rhs);
+        Radian angle = Math::ACos(fCos);
+
+		return (Math::Abs(angle.valueRadians()) <= tolerance.valueRadians())
+            || Math::RealEqual(angle.valueRadians(), Math::PI, tolerance.valueRadians());
+
+
+	}
+    //-----------------------------------------------------------------------
+    Quaternion Quaternion::Slerp (Real fT, const Quaternion& rkP,
+        const Quaternion& rkQ, bool shortestPath)
+    {
+        Real fCos = rkP.Dot(rkQ);
+        Quaternion rkT;
+
+        // Do we need to invert rotation?
+        if (fCos < 0.0f && shortestPath)
+        {
+            fCos = -fCos;
+            rkT = -rkQ;
+        }
+        else
+        {
+            rkT = rkQ;
+        }
+
+        if (Math::Abs(fCos) < 1 - ms_fEpsilon)
+        {
+            // Standard case (slerp)
+            Real fSin = Math::Sqrt(1 - Math::Sqr(fCos));
+            Radian fAngle = Math::ATan2(fSin, fCos);
+            Real fInvSin = 1.0f / fSin;
+            Real fCoeff0 = Math::Sin((1.0f - fT) * fAngle) * fInvSin;
+            Real fCoeff1 = Math::Sin(fT * fAngle) * fInvSin;
+            return fCoeff0 * rkP + fCoeff1 * rkT;
+        }
+        else
+        {
+            // There are two situations:
+            // 1. "rkP" and "rkQ" are very close (fCos ~= +1), so we can do a linear
+            //    interpolation safely.
+            // 2. "rkP" and "rkQ" are almost inverse of each other (fCos ~= -1), there
+            //    are an infinite number of possibilities interpolation. but we haven't
+            //    have method to fix this case, so just use linear interpolation here.
+            Quaternion t = (1.0f - fT) * rkP + fT * rkT;
+            // taking the complement requires renormalisation
+            t.normalise();
+            return t;
+        }
+    }
+    //-----------------------------------------------------------------------
+    Quaternion Quaternion::SlerpExtraSpins (Real fT,
+        const Quaternion& rkP, const Quaternion& rkQ, int iExtraSpins)
+    {
+        Real fCos = rkP.Dot(rkQ);
+        Radian fAngle ( Math::ACos(fCos) );
+
+        if ( Math::Abs(fAngle.valueRadians()) < ms_fEpsilon )
+            return rkP;
+
+        Real fSin = Math::Sin(fAngle);
+        Radian fPhase ( Math::PI*iExtraSpins*fT );
+        Real fInvSin = 1.0/fSin;
+        Real fCoeff0 = Math::Sin((1.0-fT)*fAngle - fPhase)*fInvSin;
+        Real fCoeff1 = Math::Sin(fT*fAngle + fPhase)*fInvSin;
+        return fCoeff0*rkP + fCoeff1*rkQ;
+    }
+    //-----------------------------------------------------------------------
+    void Quaternion::Intermediate (const Quaternion& rkQ0,
+        const Quaternion& rkQ1, const Quaternion& rkQ2,
+        Quaternion& rkA, Quaternion& rkB)
+    {
+        // assert:  q0, q1, q2 are unit quaternions
+
+        Quaternion kQ0inv = rkQ0.UnitInverse();
+        Quaternion kQ1inv = rkQ1.UnitInverse();
+        Quaternion rkP0 = kQ0inv*rkQ1;
+        Quaternion rkP1 = kQ1inv*rkQ2;
+        Quaternion kArg = 0.25*(rkP0.Log()-rkP1.Log());
+        Quaternion kMinusArg = -kArg;
+
+        rkA = rkQ1*kArg.Exp();
+        rkB = rkQ1*kMinusArg.Exp();
+    }
+    //-----------------------------------------------------------------------
+    Quaternion Quaternion::Squad (Real fT,
+        const Quaternion& rkP, const Quaternion& rkA,
+        const Quaternion& rkB, const Quaternion& rkQ, bool shortestPath)
+    {
+        Real fSlerpT = 2.0*fT*(1.0-fT);
+        Quaternion kSlerpP = Slerp(fT, rkP, rkQ, shortestPath);
+        Quaternion kSlerpQ = Slerp(fT, rkA, rkB);
+        return Slerp(fSlerpT, kSlerpP ,kSlerpQ);
+    }
+    //-----------------------------------------------------------------------
+    Real Quaternion::normalise(void)
+    {
+        Real len = Norm();
+        Real factor = 1.0f / Math::Sqrt(len);
+        *this = *this * factor;
+        return len;
+    }
+    //-----------------------------------------------------------------------
+	Radian Quaternion::getRoll(bool reprojectAxis) const
+	{
+		if (reprojectAxis)
+		{
+			// roll = atan2(localx.y, localx.x)
+			// pick parts of xAxis() implementation that we need
+			Real fTx  = 2.0*x;
+			Real fTy  = 2.0*y;
+			Real fTz  = 2.0*z;
+			Real fTwz = fTz*w;
+			Real fTxy = fTy*x;
+			Real fTyy = fTy*y;
+			Real fTzz = fTz*z;
+
+			// Vector3(1.0-(fTyy+fTzz), fTxy+fTwz, fTxz-fTwy);
+
+			return Radian(Math::ATan2(fTxy+fTwz, 1.0-(fTyy+fTzz)));
+
+		}
+		else
+		{
+			return Radian(Math::ATan2(2*(x*y + w*z), w*w + x*x - y*y - z*z));
+		}
+	}
+    //-----------------------------------------------------------------------
+	Radian Quaternion::getPitch(bool reprojectAxis) const
+	{
+		if (reprojectAxis)
+		{
+			// pitch = atan2(localy.z, localy.y)
+			// pick parts of yAxis() implementation that we need
+			Real fTx  = 2.0*x;
+			Real fTy  = 2.0*y;
+			Real fTz  = 2.0*z;
+			Real fTwx = fTx*w;
+			Real fTxx = fTx*x;
+			Real fTyz = fTz*y;
+			Real fTzz = fTz*z;
+
+			// Vector3(fTxy-fTwz, 1.0-(fTxx+fTzz), fTyz+fTwx);
+			return Radian(Math::ATan2(fTyz+fTwx, 1.0-(fTxx+fTzz)));
+		}
+		else
+		{
+			// internal version
+			return Radian(Math::ATan2(2*(y*z + w*x), w*w - x*x - y*y + z*z));
+		}
+	}
+    //-----------------------------------------------------------------------
+	Radian Quaternion::getYaw(bool reprojectAxis) const
+	{
+		if (reprojectAxis)
+		{
+			// yaw = atan2(localz.x, localz.z)
+			// pick parts of zAxis() implementation that we need
+			Real fTx  = 2.0*x;
+			Real fTy  = 2.0*y;
+			Real fTz  = 2.0*z;
+			Real fTwy = fTy*w;
+			Real fTxx = fTx*x;
+			Real fTxz = fTz*x;
+			Real fTyy = fTy*y;
+
+			// Vector3(fTxz+fTwy, fTyz-fTwx, 1.0-(fTxx+fTyy));
+
+			return Radian(Math::ATan2(fTxz+fTwy, 1.0-(fTxx+fTyy)));
+
+		}
+		else
+		{
+			// internal version
+			return Radian(Math::ASin(-2*(x*z - w*y)));
+		}
+	}
+    //-----------------------------------------------------------------------
+    Quaternion Quaternion::nlerp(Real fT, const Quaternion& rkP,
+        const Quaternion& rkQ, bool shortestPath)
+    {
+		Quaternion result;
+        Real fCos = rkP.Dot(rkQ);
+		if (fCos < 0.0f && shortestPath)
+		{
+			result = rkP + fT * ((-rkQ) - rkP);
+		}
+		else
+		{
+			result = rkP + fT * (rkQ - rkP);
+		}
+        result.normalise();
+        return result;
+    }
+}
Index: /OgreMain/src/OgreRectangle2D.cpp
===================================================================
--- /OgreMain/src/OgreRectangle2D.cpp	(revision 5)
+++ /OgreMain/src/OgreRectangle2D.cpp	(revision 5)
@@ -0,0 +1,158 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreRectangle2D.h"
+
+#include "OgreSimpleRenderable.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreCamera.h"
+
+namespace Ogre {
+#define POSITION_BINDING 0
+#define TEXCOORD_BINDING 1
+
+    Rectangle2D::Rectangle2D(bool includeTextureCoords) 
+    {
+        // use identity projection and view matrices
+        mUseIdentityProjection = true;
+        mUseIdentityView = true;
+
+        mRenderOp.vertexData = new VertexData();
+
+        mRenderOp.indexData = 0;
+        mRenderOp.vertexData->vertexCount = 4; 
+        mRenderOp.vertexData->vertexStart = 0; 
+        mRenderOp.operationType = RenderOperation::OT_TRIANGLE_STRIP; 
+        mRenderOp.useIndexes = false; 
+
+        VertexDeclaration* decl = mRenderOp.vertexData->vertexDeclaration;
+        VertexBufferBinding* bind = mRenderOp.vertexData->vertexBufferBinding;
+
+        decl->addElement(POSITION_BINDING, 0, VET_FLOAT3, VES_POSITION);
+
+
+        HardwareVertexBufferSharedPtr vbuf = 
+            HardwareBufferManager::getSingleton().createVertexBuffer(
+            decl->getVertexSize(POSITION_BINDING),
+            mRenderOp.vertexData->vertexCount,
+            HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+
+        // Bind buffer
+        bind->setBinding(POSITION_BINDING, vbuf);
+
+        if (includeTextureCoords)
+        {
+            decl->addElement(TEXCOORD_BINDING, 0, VET_FLOAT2, VES_TEXTURE_COORDINATES);
+
+
+            HardwareVertexBufferSharedPtr tvbuf = 
+                HardwareBufferManager::getSingleton().createVertexBuffer(
+                decl->getVertexSize(TEXCOORD_BINDING),
+                mRenderOp.vertexData->vertexCount,
+                HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+
+            // Bind buffer
+            bind->setBinding(TEXCOORD_BINDING, tvbuf);
+
+            // Set up basic tex coordinates
+            float* pTex = static_cast<float*>(
+                tvbuf->lock(HardwareBuffer::HBL_DISCARD));
+            *pTex++ = 0.0f;
+            *pTex++ = 0.0f;
+            *pTex++ = 0.0f;
+            *pTex++ = 1.0f;
+            *pTex++ = 1.0f;
+            *pTex++ = 0.0f;
+            *pTex++ = 1.0f;
+            *pTex++ = 1.0f;
+            tvbuf->unlock();
+        }
+
+        // set basic white material
+        this->setMaterial("BaseWhiteNoLighting");
+
+
+
+    }
+
+    Rectangle2D::~Rectangle2D() 
+    {
+        delete mRenderOp.vertexData;
+    }
+
+    void Rectangle2D::setCorners(Real left, Real top, Real right, Real bottom) 
+    {
+        HardwareVertexBufferSharedPtr vbuf = 
+            mRenderOp.vertexData->vertexBufferBinding->getBuffer(POSITION_BINDING);
+        float* pFloat = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD));
+
+        *pFloat++ = left;
+        *pFloat++ = top;
+        *pFloat++ = -1;
+
+        *pFloat++ = left;
+        *pFloat++ = bottom;
+        *pFloat++ = -1;
+
+        *pFloat++ = right;
+        *pFloat++ = top;
+        *pFloat++ = -1;
+
+        *pFloat++ = right;
+        *pFloat++ = bottom;
+        *pFloat++ = -1;
+
+        vbuf->unlock();
+
+        mBox.setExtents(
+            std::min(left, right), std::min(top, bottom), 0,
+            std::max(left, right), std::max(top, bottom), 0);
+
+    }
+
+    // Override this method to prevent parent transforms (rotation,translation,scale)
+    void Rectangle2D::getWorldTransforms( Matrix4* xform ) const
+    {
+        // return identity matrix to prevent parent transforms
+        *xform = Matrix4::IDENTITY;
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& Rectangle2D::getWorldOrientation(void) const
+    {
+        return Quaternion::IDENTITY;
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& Rectangle2D::getWorldPosition(void) const
+    {
+        return Vector3::ZERO;
+    }
+
+
+}
+
Index: /OgreMain/src/OgreRenderQueue.cpp
===================================================================
--- /OgreMain/src/OgreRenderQueue.cpp	(revision 5)
+++ /OgreMain/src/OgreRenderQueue.cpp	(revision 5)
@@ -0,0 +1,244 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreRenderQueue.h"
+
+#include "OgreRenderable.h"
+#include "OgreMaterial.h"
+#include "OgreRenderQueueSortingGrouping.h"
+#include "OgrePass.h"
+#include "OgreMaterialManager.h"
+
+
+namespace Ogre {
+
+    //---------------------------------------------------------------------
+    RenderQueue::RenderQueue()
+        : mSplitPassesByLightingType(false)
+		, mSplitNoShadowPasses(false)
+        , mShadowCastersCannotBeReceivers(false)
+		, mRenderableListener(0)
+    {
+        // Create the 'main' queue up-front since we'll always need that
+        mGroups.insert(
+            RenderQueueGroupMap::value_type(
+                RENDER_QUEUE_MAIN, 
+                new RenderQueueGroup(this,
+                    mSplitPassesByLightingType,
+                    mSplitNoShadowPasses,
+                    mShadowCastersCannotBeReceivers)
+                )
+            );
+
+        // set default queue
+        mDefaultQueueGroup = RENDER_QUEUE_MAIN;
+		mDefaultRenderablePriority = OGRE_RENDERABLE_DEFAULT_PRIORITY;
+
+    }
+    //---------------------------------------------------------------------
+    RenderQueue::~RenderQueue()
+    {
+        
+        // trigger the pending pass updates, otherwise we could leak
+        Pass::processPendingPassUpdates();
+        
+        // Destroy the queues for good
+        RenderQueueGroupMap::iterator i, iend;
+        i = mGroups.begin();
+        iend = mGroups.end();
+        for (; i != iend; ++i)
+        {
+            delete i->second;
+        }
+        mGroups.clear();
+
+
+
+
+    }
+    //-----------------------------------------------------------------------
+    void RenderQueue::addRenderable(Renderable* pRend, uint8 groupID, ushort priority)
+    {
+        // Find group
+        RenderQueueGroup* pGroup = getQueueGroup(groupID);
+
+
+		Technique* pTech;
+
+		// tell material it's been used
+		if (!pRend->getMaterial().isNull())
+			pRend->getMaterial()->touch();
+
+		// Check material & technique supplied (the former since the default implementation
+        // of getTechnique is based on it for backwards compatibility
+        if(pRend->getMaterial().isNull() || !(pTech = pRend->getTechnique()))
+        {
+            // Use default base white
+			MaterialPtr baseWhite = MaterialManager::getSingleton().getByName("BaseWhite");
+            pTech = baseWhite->getTechnique(0);
+        }
+
+		if (mRenderableListener)
+		{
+			// Allow listener to override technique and to abort
+			if (!mRenderableListener->renderableQueued(pRend, groupID, priority, &pTech))
+				return; // rejected
+
+			// tell material it's been used (incase changed)
+			pTech->getParent()->touch();
+		}
+		
+        pGroup->addRenderable(pRend, pTech, priority);
+
+    }
+    //-----------------------------------------------------------------------
+    void RenderQueue::clear(bool destroyPassMaps)
+    {
+        // Clear the queues
+        RenderQueueGroupMap::iterator i, iend;
+        i = mGroups.begin();
+        iend = mGroups.end();
+        for (; i != iend; ++i)
+        {
+            i->second->clear(destroyPassMaps);
+        }
+
+        // Now trigger the pending pass updates
+        Pass::processPendingPassUpdates();
+
+        // NB this leaves the items present (but empty)
+        // We're assuming that frame-by-frame, the same groups are likely to 
+        //  be used, so no point destroying the vectors and incurring the overhead
+        //  that would cause, let them be destroyed in the destructor.
+    }
+    //-----------------------------------------------------------------------
+    RenderQueue::QueueGroupIterator RenderQueue::_getQueueGroupIterator(void)
+    {
+        return QueueGroupIterator(mGroups.begin(), mGroups.end());
+    }
+    //-----------------------------------------------------------------------
+    void RenderQueue::addRenderable(Renderable* pRend, uint8 groupID)
+    {
+        addRenderable(pRend, groupID, mDefaultRenderablePriority);
+    }
+	//-----------------------------------------------------------------------
+    void RenderQueue::addRenderable(Renderable* pRend)
+    {
+        addRenderable(pRend, mDefaultQueueGroup, mDefaultRenderablePriority);
+    }
+    //-----------------------------------------------------------------------
+    uint8 RenderQueue::getDefaultQueueGroup(void) const
+    {
+        return mDefaultQueueGroup;
+    }
+    //-----------------------------------------------------------------------
+    void RenderQueue::setDefaultQueueGroup(uint8 grp)
+    {
+        mDefaultQueueGroup = grp;
+    }
+    //-----------------------------------------------------------------------
+    ushort RenderQueue::getDefaultRenderablePriority(void) const
+    {
+        return mDefaultRenderablePriority;
+    }
+    //-----------------------------------------------------------------------
+    void RenderQueue::setDefaultRenderablePriority(ushort priority)
+    {
+        mDefaultRenderablePriority = priority;
+    }
+	
+	
+	//-----------------------------------------------------------------------
+	RenderQueueGroup* RenderQueue::getQueueGroup(uint8 groupID)
+	{
+		// Find group
+		RenderQueueGroupMap::iterator groupIt;
+		RenderQueueGroup* pGroup;
+
+		groupIt = mGroups.find(groupID);
+		if (groupIt == mGroups.end())
+		{
+			// Insert new
+			pGroup = new RenderQueueGroup(this,
+                mSplitPassesByLightingType,
+                mSplitNoShadowPasses,
+                mShadowCastersCannotBeReceivers);
+			mGroups.insert(RenderQueueGroupMap::value_type(groupID, pGroup));
+		}
+		else
+		{
+			pGroup = groupIt->second;
+		}
+
+		return pGroup;
+
+	}
+    //-----------------------------------------------------------------------
+    void RenderQueue::setSplitPassesByLightingType(bool split)
+    {
+        mSplitPassesByLightingType = split;
+
+        RenderQueueGroupMap::iterator i, iend;
+        i = mGroups.begin();
+        iend = mGroups.end();
+        for (; i != iend; ++i)
+        {
+            i->second->setSplitPassesByLightingType(split);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void RenderQueue::setSplitNoShadowPasses(bool split)
+    {
+        mSplitNoShadowPasses = split;
+
+        RenderQueueGroupMap::iterator i, iend;
+        i = mGroups.begin();
+        iend = mGroups.end();
+        for (; i != iend; ++i)
+        {
+            i->second->setSplitNoShadowPasses(split);
+        }
+    }
+	//-----------------------------------------------------------------------
+	void RenderQueue::setShadowCastersCannotBeReceivers(bool ind)
+	{
+		mShadowCastersCannotBeReceivers = ind;
+
+		RenderQueueGroupMap::iterator i, iend;
+		i = mGroups.begin();
+		iend = mGroups.end();
+		for (; i != iend; ++i)
+		{
+			i->second->setShadowCastersCannotBeReceivers(ind);
+		}
+	}
+
+}
+
Index: /OgreMain/src/OgreRenderQueueInvocation.cpp
===================================================================
--- /OgreMain/src/OgreRenderQueueInvocation.cpp	(revision 5)
+++ /OgreMain/src/OgreRenderQueueInvocation.cpp	(revision 5)
@@ -0,0 +1,137 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2005 The OGRE Team
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreRenderQueueInvocation.h"
+#include "OgreSceneManager.h"
+#include "OgreException.h"
+
+namespace Ogre
+{
+	String RenderQueueInvocation::RENDER_QUEUE_INVOCATION_SHADOWS = "SHADOWS";
+	//-----------------------------------------------------------------------------
+	RenderQueueInvocation::RenderQueueInvocation(uint8 renderQueueGroupID, 
+		const String& invocationName)
+		: mRenderQueueGroupID(renderQueueGroupID), mInvocationName(invocationName), 
+		mSolidsOrganisation(QueuedRenderableCollection::OM_PASS_GROUP), 
+		mSuppressShadows(false), mSuppressRenderStateChanges(false)
+	{
+
+	}
+	//-----------------------------------------------------------------------------
+	RenderQueueInvocation::~RenderQueueInvocation()
+	{
+
+	}
+	//-----------------------------------------------------------------------------
+	void RenderQueueInvocation::invoke(RenderQueueGroup* group, SceneManager* targetSceneManager)
+	{
+		bool oldShadows = targetSceneManager->_areShadowsSuppressed();
+		bool oldRSChanges = targetSceneManager->_areRenderStateChangesSuppressed();
+
+		targetSceneManager->_suppressShadows(mSuppressShadows);
+		targetSceneManager->_suppressRenderStateChanges(mSuppressRenderStateChanges);
+
+		targetSceneManager->_renderQueueGroupObjects(group, mSolidsOrganisation);
+
+		targetSceneManager->_suppressShadows(oldShadows);
+		targetSceneManager->_suppressRenderStateChanges(oldRSChanges);
+
+	}
+	//-----------------------------------------------------------------------------
+	//-----------------------------------------------------------------------------
+	RenderQueueInvocationSequence::RenderQueueInvocationSequence(const String& name)
+		:mName(name)
+	{
+	}
+	//-----------------------------------------------------------------------------
+	RenderQueueInvocationSequence::~RenderQueueInvocationSequence()
+	{
+		clear();
+	}
+	//-----------------------------------------------------------------------------
+	RenderQueueInvocation* RenderQueueInvocationSequence::add(uint8 renderQueueGroupID, 
+		const String& invocationName)
+	{
+		RenderQueueInvocation* ret = 
+			new RenderQueueInvocation(renderQueueGroupID, invocationName);
+
+		mInvocations.push_back(ret);
+
+		return ret;
+
+	}
+	//-----------------------------------------------------------------------------
+	void RenderQueueInvocationSequence::add(RenderQueueInvocation* i)
+	{
+		mInvocations.push_back(i);
+	}
+	//-----------------------------------------------------------------------------
+	void RenderQueueInvocationSequence::clear(void)
+	{
+		for (RenderQueueInvocationList::iterator i = mInvocations.begin();
+			i != mInvocations.end(); ++i)
+		{
+			delete *i;
+		}
+		mInvocations.clear();
+	}
+	//-----------------------------------------------------------------------------
+	RenderQueueInvocation* RenderQueueInvocationSequence::get(size_t index)
+	{
+		if (index >= size())
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Index out of bounds", 
+				"RenderQueueInvocationSequence::get");
+
+		return mInvocations[index];
+	}
+	//-----------------------------------------------------------------------------
+	void RenderQueueInvocationSequence::remove(size_t index)
+	{
+		if (index >= size())
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+			"Index out of bounds", 
+			"RenderQueueInvocationSequence::remove");
+		
+		RenderQueueInvocationList::iterator i = mInvocations.begin();
+		std::advance(i, index);
+		delete *i;
+		mInvocations.erase(i);
+		
+	}
+	//-----------------------------------------------------------------------------
+	RenderQueueInvocationIterator RenderQueueInvocationSequence::iterator(void)
+	{
+		return RenderQueueInvocationIterator(mInvocations.begin(), mInvocations.end());
+	}
+	//-----------------------------------------------------------------------------
+
+
+}
Index: /OgreMain/src/OgreRenderQueueSortingGrouping.cpp
===================================================================
--- /OgreMain/src/OgreRenderQueueSortingGrouping.cpp	(revision 5)
+++ /OgreMain/src/OgreRenderQueueSortingGrouping.cpp	(revision 5)
@@ -0,0 +1,446 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreRenderQueueSortingGrouping.h"
+#include "OgreException.h"
+
+namespace Ogre {
+    // Init statics
+    RadixSort<QueuedRenderableCollection::RenderablePassList,
+        RenderablePass, uint32> QueuedRenderableCollection::msRadixSorter1;
+    RadixSort<QueuedRenderableCollection::RenderablePassList,
+        RenderablePass, float> QueuedRenderableCollection::msRadixSorter2;
+
+
+	//-----------------------------------------------------------------------
+	RenderPriorityGroup::RenderPriorityGroup(RenderQueueGroup* parent, 
+            bool splitPassesByLightingType,
+            bool splitNoShadowPasses, 
+			bool shadowCastersNotReceivers)
+	 	: mParent(parent)
+        , mSplitPassesByLightingType(splitPassesByLightingType)
+        , mSplitNoShadowPasses(splitNoShadowPasses)
+        , mShadowCastersNotReceivers(shadowCastersNotReceivers)
+	{
+		// Initialise collection sorting options
+		// this can become dynamic according to invocation later
+		defaultOrganisationMode();
+
+		// Transparents will always be sorted this way
+		mTransparents.addOrganisationMode(QueuedRenderableCollection::OM_SORT_DESCENDING);
+
+		
+	}
+	//-----------------------------------------------------------------------
+	void RenderPriorityGroup::resetOrganisationModes(void)
+	{
+		mSolidsBasic.resetOrganisationModes();
+		mSolidsDiffuseSpecular.resetOrganisationModes();
+		mSolidsDecal.resetOrganisationModes();
+		mSolidsNoShadowReceive.resetOrganisationModes();
+	}
+	//-----------------------------------------------------------------------
+	void RenderPriorityGroup::addOrganisationMode(QueuedRenderableCollection::OrganisationMode om)
+	{
+		mSolidsBasic.addOrganisationMode(om);
+		mSolidsDiffuseSpecular.addOrganisationMode(om);
+		mSolidsDecal.addOrganisationMode(om);
+		mSolidsNoShadowReceive.addOrganisationMode(om);
+	}
+	//-----------------------------------------------------------------------
+	void RenderPriorityGroup::defaultOrganisationMode(void)
+	{
+		resetOrganisationModes();
+		addOrganisationMode(QueuedRenderableCollection::OM_PASS_GROUP);
+	}
+	//-----------------------------------------------------------------------
+    void RenderPriorityGroup::addRenderable(Renderable* rend, Technique* pTech)
+    {
+        // Transparent and depth/colour settings mean depth sorting is required?
+        // Note: colour write disabled with depth check/write enabled means
+        //       setup depth buffer for other passes use.
+        if (pTech->isTransparent() && 
+            (!pTech->isDepthWriteEnabled() ||
+             !pTech->isDepthCheckEnabled() ||
+             pTech->hasColourWriteDisabled()))
+        {
+            addTransparentRenderable(pTech, rend);
+        }
+        else
+        {
+            if (mSplitNoShadowPasses &&
+                mParent->getShadowsEnabled() &&
+				(!pTech->getParent()->getReceiveShadows() ||
+				rend->getCastsShadows() && mShadowCastersNotReceivers))
+            {
+                // Add solid renderable and add passes to no-shadow group
+                addSolidRenderable(pTech, rend, true);
+            }
+            else
+            {
+                if (mSplitPassesByLightingType && mParent->getShadowsEnabled())
+                {
+                    addSolidRenderableSplitByLightType(pTech, rend);
+                }
+                else
+                {
+                    addSolidRenderable(pTech, rend, false);
+                }
+            }
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void RenderPriorityGroup::addSolidRenderable(Technique* pTech, 
+        Renderable* rend, bool addToNoShadow)
+    {
+        Technique::PassIterator pi = pTech->getPassIterator();
+
+		QueuedRenderableCollection* collection;
+        if (addToNoShadow)
+        {
+            collection = &mSolidsNoShadowReceive;
+        }
+        else
+        {
+            collection = &mSolidsBasic;
+        }
+
+
+        while (pi.hasMoreElements())
+        {
+            // Insert into solid list
+            Pass* p = pi.getNext();
+			collection->addRenderable(p, rend);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void RenderPriorityGroup::addSolidRenderableSplitByLightType(Technique* pTech,
+        Renderable* rend)
+    {
+        // Divide the passes into the 3 categories
+        Technique::IlluminationPassIterator pi = 
+            pTech->getIlluminationPassIterator();
+
+        while (pi.hasMoreElements())
+        {
+            // Insert into solid list
+            IlluminationPass* p = pi.getNext();
+            QueuedRenderableCollection* collection;
+            switch(p->stage)
+            {
+            case IS_AMBIENT:
+                collection = &mSolidsBasic;
+                break;
+            case IS_PER_LIGHT:
+                collection = &mSolidsDiffuseSpecular;
+                break;
+            case IS_DECAL:
+                collection = &mSolidsDecal;
+                break;
+            default:
+                assert(false); // should never happen
+            };
+
+			collection->addRenderable(p->pass, rend);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void RenderPriorityGroup::addTransparentRenderable(Technique* pTech, Renderable* rend)
+    {
+        Technique::PassIterator pi = pTech->getPassIterator();
+
+        while (pi.hasMoreElements())
+        {
+            // Insert into transparent list
+            mTransparents.addRenderable(pi.getNext(), rend);
+        }
+    }
+    //-----------------------------------------------------------------------
+	void RenderPriorityGroup::removePassEntry(Pass* p)
+	{
+		mSolidsBasic.removePassGroup(p);
+		mSolidsDiffuseSpecular.removePassGroup(p);
+		mSolidsNoShadowReceive.removePassGroup(p);
+		mSolidsDecal.removePassGroup(p);
+		mTransparents.removePassGroup(p); // shouldn't be any, but for completeness
+	}	
+    //-----------------------------------------------------------------------
+    void RenderPriorityGroup::clear(void)
+    {
+        // Delete queue groups which are using passes which are to be
+        // deleted, we won't need these any more and they clutter up 
+        // the list and can cause problems with future clones
+		{
+			// Hmm, a bit hacky but least obtrusive for now
+			OGRE_LOCK_MUTEX(Pass::msPassGraveyardMutex)
+			const Pass::PassSet& graveyardList = Pass::getPassGraveyard();
+			Pass::PassSet::const_iterator gi, giend;
+			giend = graveyardList.end();
+			for (gi = graveyardList.begin(); gi != giend; ++gi)
+			{
+				removePassEntry(*gi);
+			}
+		}
+
+        // Now remove any dirty passes, these will have their hashes recalculated
+        // by the parent queue after all groups have been processed
+        // If we don't do this, the std::map will become inconsistent for new insterts
+		{
+			// Hmm, a bit hacky but least obtrusive for now
+			OGRE_LOCK_MUTEX(Pass::msDirtyHashListMutex)
+			const Pass::PassSet& dirtyList = Pass::getDirtyHashList();
+			Pass::PassSet::const_iterator di, diend;
+			diend = dirtyList.end();
+			for (di = dirtyList.begin(); di != diend; ++di)
+			{
+				removePassEntry(*di);
+			}
+		}
+        // NB we do NOT clear the graveyard or the dirty list here, because 
+        // it needs to be acted on for all groups, the parent queue takes 
+        // care of this afterwards
+
+		// Now empty the remaining collections
+		// Note that groups don't get deleted, just emptied hence the difference
+		// between the pass groups which are removed above, and clearing done
+		// here
+		mSolidsBasic.clear();
+        mSolidsDecal.clear();
+        mSolidsDiffuseSpecular.clear();
+        mSolidsNoShadowReceive.clear();
+        mTransparents.clear();
+
+    }
+	//-----------------------------------------------------------------------
+	void RenderPriorityGroup::sort(const Camera* cam)
+	{
+		mSolidsBasic.sort(cam);
+		mSolidsDecal.sort(cam);
+		mSolidsDiffuseSpecular.sort(cam);
+		mSolidsNoShadowReceive.sort(cam);
+		mTransparents.sort(cam);
+	}
+    //-----------------------------------------------------------------------
+	QueuedRenderableCollection::QueuedRenderableCollection(void)
+		:mOrganisationMode(0)
+	{
+	}
+    //-----------------------------------------------------------------------
+	QueuedRenderableCollection::~QueuedRenderableCollection(void)
+	{
+        // destroy all the pass map entries (rather than clearing)
+        PassGroupRenderableMap::iterator i, iend;
+        iend = mGrouped.end();
+        for (i = mGrouped.begin(); i != iend; ++i)
+        {
+            // Free the list associated with this pass
+            delete i->second;
+        }
+		
+	}
+    //-----------------------------------------------------------------------
+	void QueuedRenderableCollection::clear(void)
+	{
+        PassGroupRenderableMap::iterator i, iend;
+        iend = mGrouped.end();
+        for (i = mGrouped.begin(); i != iend; ++i)
+        {
+            // Clear the list associated with this pass, but leave the pass entry
+            i->second->clear();
+        }
+
+		// Clear sorted list
+		mSortedDescending.clear();
+	}
+    //-----------------------------------------------------------------------
+	void QueuedRenderableCollection::removePassGroup(Pass* p)
+	{
+        PassGroupRenderableMap::iterator i;
+
+        i = mGrouped.find(p);
+        if (i != mGrouped.end())
+        {
+            // free memory
+            delete i->second;
+            // erase from map
+            mGrouped.erase(i);
+        }
+	}
+    //-----------------------------------------------------------------------
+	void QueuedRenderableCollection::sort(const Camera* cam)
+    {
+		// ascending and descending sort both set bit 1
+		if (mOrganisationMode & OM_SORT_DESCENDING)
+		{
+			
+			// We can either use a stable_sort and the 'less' implementation,
+			// or a 2-pass radix sort (once by pass, then by distance, since
+			// radix sorting is inherently stable this will work)
+			// We use stable_sort if the number of items is 512 or less, since
+			// the complexity of the radix sort is approximately O(10N), since 
+			// each sort is O(5N) (1 pass histograms, 4 passes sort)
+			// Since stable_sort has a worst-case performance of O(N(logN)^2)
+			// the performance tipping point is from about 1500 items, but in
+			// stable_sorts best-case scenario O(NlogN) it would be much higher.
+			// Take a stab at 2000 items.
+			
+			if (mSortedDescending.size() > 2000)
+			{
+				// sort by pass
+				msRadixSorter1.sort(mSortedDescending, RadixSortFunctorPass());
+				// sort by depth
+				msRadixSorter2.sort(mSortedDescending, RadixSortFunctorDistance(cam));
+			}
+			else
+			{
+				std::stable_sort(
+					mSortedDescending.begin(), mSortedDescending.end(), 
+					DepthSortDescendingLess(cam));
+			}
+		}
+
+		// Nothing needs to be done for pass groups, they auto-organise
+
+    }
+    //-----------------------------------------------------------------------
+    void QueuedRenderableCollection::addRenderable(Pass* pass, Renderable* rend)
+	{
+		// ascending and descending sort both set bit 1
+		if (mOrganisationMode & OM_SORT_DESCENDING)
+		{
+			mSortedDescending.push_back(RenderablePass(rend, pass));
+		}
+
+		if (mOrganisationMode & OM_PASS_GROUP)
+		{
+            PassGroupRenderableMap::iterator i = mGrouped.find(pass);
+            if (i == mGrouped.end())
+            {
+                std::pair<PassGroupRenderableMap::iterator, bool> retPair;
+                // Create new pass entry, build a new list
+                // Note that this pass and list are never destroyed until the 
+				// engine shuts down, or a pass is destroyed or has it's hash
+				// recalculated, although the lists will be cleared
+                retPair = mGrouped.insert(
+                    PassGroupRenderableMap::value_type(
+						pass, new RenderableList() ));
+                assert(retPair.second && 
+					"Error inserting new pass entry into PassGroupRenderableMap");
+                i = retPair.first;
+            }
+            // Insert renderable
+            i->second->push_back(rend);
+			
+		}
+		
+	}
+    //-----------------------------------------------------------------------
+	void QueuedRenderableCollection::acceptVisitor(
+		QueuedRenderableVisitor* visitor, OrganisationMode om) const
+	{
+		if ((om & mOrganisationMode) == 0)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"Organisation mode requested in acceptVistor was not notified "
+				"to this class ahead of time, therefore may not be supported.", 
+				"QueuedRenderableCollection::acceptVisitor");
+		}
+
+		switch(om)
+		{
+		case OM_PASS_GROUP:
+			acceptVisitorGrouped(visitor);
+			break;
+		case OM_SORT_DESCENDING:
+			acceptVisitorDescending(visitor);
+			break;
+		case OM_SORT_ASCENDING:
+			acceptVisitorAscending(visitor);
+			break;
+		}
+		
+	}
+    //-----------------------------------------------------------------------
+	void QueuedRenderableCollection::acceptVisitorGrouped(
+		QueuedRenderableVisitor* visitor) const
+	{
+		PassGroupRenderableMap::const_iterator ipass, ipassend;
+		ipassend = mGrouped.end();
+		for (ipass = mGrouped.begin(); ipass != ipassend; ++ipass)
+		{
+			// Fast bypass if this group is now empty
+			if (ipass->second->empty()) continue;
+
+			// Visit Pass - allow skip
+			if (!visitor->visit(ipass->first))
+				continue;
+
+			RenderableList* rendList = ipass->second;
+			RenderableList::const_iterator irend, irendend;
+			irendend = rendList->end();
+			for (irend = rendList->begin(); irend != irendend; ++irend)
+			{
+				// Visit Renderable
+				visitor->visit(*irend);
+			}
+		} 
+
+	}
+    //-----------------------------------------------------------------------
+	void QueuedRenderableCollection::acceptVisitorDescending(
+		QueuedRenderableVisitor* visitor) const
+	{
+		// List is already in descending order, so iterate forward
+		RenderablePassList::const_iterator i, iend;
+
+		iend = mSortedDescending.end();
+		for (i = mSortedDescending.begin(); i != iend; ++i)
+		{
+			visitor->visit(&(*i));
+		}
+	}
+    //-----------------------------------------------------------------------
+	void QueuedRenderableCollection::acceptVisitorAscending(
+		QueuedRenderableVisitor* visitor) const
+	{
+		// List is in descending order, so iterate in reverse
+		RenderablePassList::const_reverse_iterator i, iend;
+
+		iend = mSortedDescending.rend();
+		for (i = mSortedDescending.rbegin(); i != iend; ++i)
+		{
+			visitor->visit(&(*i));
+		}
+
+	}
+
+
+}
+
Index: /OgreMain/src/OgreRenderSystem.cpp
===================================================================
--- /OgreMain/src/OgreRenderSystem.cpp	(revision 5)
+++ /OgreMain/src/OgreRenderSystem.cpp	(revision 5)
@@ -0,0 +1,610 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+// RenderSystem implementation
+// Note that most of this class is abstract since
+//  we cannot know how to implement the behaviour without
+//  being aware of the 3D API. However there are a few
+//  simple functions which can have a base implementation
+
+#include "OgreRenderSystem.h"
+
+#include "OgreRoot.h"
+#include "OgreViewport.h"
+#include "OgreException.h"
+#include "OgreRenderTarget.h"
+#include "OgreRenderWindow.h"
+#include "OgreMeshManager.h"
+#include "OgreMaterial.h"
+#include "OgreTimer.h"
+#include "OgreHardwarePixelBuffer.h"
+#include "OgreHardwareOcclusionQuery.h"
+
+namespace Ogre {
+
+    const PlaneList Renderable::msDummyPlaneList; // FIX ME: temporary
+    static const TexturePtr sNullTexPtr;
+
+    //-----------------------------------------------------------------------
+    RenderSystem::RenderSystem()
+        : mActiveRenderTarget(0)
+        , mTextureManager(0)
+        , mCapabilities(0)
+        , mActiveViewport(0)
+        // This means CULL clockwise vertices, i.e. front of poly is counter-clockwise
+        // This makes it the same as OpenGL and other right-handed systems
+        , mCullingMode(CULL_CLOCKWISE)
+        , mVSync(true)
+		, mWBuffer(false)
+        , mInvertVertexWinding(false)
+        , mDisabledTexUnitsFrom(0)
+        , mCurrentPassIterationCount(0)
+        , mVertexProgramBound(false)
+        , mFragmentProgramBound(false)
+    {
+        // instanciate RenderSystemCapabilities
+        mCapabilities = new RenderSystemCapabilities();
+    }
+
+    //-----------------------------------------------------------------------
+    RenderSystem::~RenderSystem()
+    {
+        shutdown();
+		delete mCapabilities;
+		mCapabilities = 0;
+    }
+    //-----------------------------------------------------------------------
+    void RenderSystem::_initRenderTargets(void)
+    {
+
+        // Init stats
+        for(
+            RenderTargetMap::iterator it = mRenderTargets.begin();
+            it != mRenderTargets.end();
+            ++it )
+        {
+            it->second->resetStatistics();
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void RenderSystem::_updateAllRenderTargets(void)
+    {
+        // Update all in order of priority
+        // This ensures render-to-texture targets get updated before render windows
+		RenderTargetPriorityMap::iterator itarg, itargend;
+		itargend = mPrioritisedRenderTargets.end();
+		for( itarg = mPrioritisedRenderTargets.begin(); itarg != itargend; ++itarg )
+		{
+			if( itarg->second->isActive() && itarg->second->isAutoUpdated())
+				itarg->second->update();
+		}
+    }
+    //-----------------------------------------------------------------------
+    RenderWindow* RenderSystem::initialise(bool autoCreateWindow, const String& windowTitle)
+    {
+        // Have I been registered by call to Root::setRenderSystem?
+		/** Don't do this anymore, just allow via Root
+        RenderSystem* regPtr = Root::getSingleton().getRenderSystem();
+        if (!regPtr || regPtr != this)
+            // Register self - library user has come to me direct
+            Root::getSingleton().setRenderSystem(this);
+		*/
+
+
+        // Subclasses should take it from here
+        // They should ALL call this superclass method from
+        //   their own initialise() implementations.
+        
+        mVertexProgramBound = false;
+        mFragmentProgramBound = false;
+
+        return 0;
+    }
+	//---------------------------------------------------------------------
+	RenderTexture * RenderSystem::createRenderTexture( const String & name, 
+		unsigned int width, unsigned int height,
+		TextureType texType, PixelFormat internalFormat, const NameValuePairList *miscParams )
+	{
+		/// Create a new 2D texture, and return surface to render to
+        TexturePtr mTexture = TextureManager::getSingleton().createManual( name, 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, texType, 
+			width, height, 0, internalFormat, TU_RENDERTARGET );
+            
+        // Ensure texture loaded and internal resources created
+        mTexture->load();
+
+        return mTexture->getBuffer()->getRenderTarget();
+	}
+    //---------------------------------------------------------------------------------------------
+    void RenderSystem::destroyRenderWindow(const String& name)
+    {
+        destroyRenderTarget(name);
+    }
+    //---------------------------------------------------------------------------------------------
+    void RenderSystem::destroyRenderTexture(const String& name)
+    {
+        destroyRenderTarget(name);
+    }
+    //---------------------------------------------------------------------------------------------
+    void RenderSystem::destroyRenderTarget(const String& name)
+    {
+        RenderTarget* rt = detachRenderTarget(name);
+        delete rt;
+    }
+    //---------------------------------------------------------------------------------------------
+    void RenderSystem::attachRenderTarget( RenderTarget &target )
+    {
+		assert( target.getPriority() < OGRE_NUM_RENDERTARGET_GROUPS );
+
+        mRenderTargets.insert( RenderTargetMap::value_type( target.getName(), &target ) );
+        mPrioritisedRenderTargets.insert(
+            RenderTargetPriorityMap::value_type(target.getPriority(), &target ));
+    }
+
+    //---------------------------------------------------------------------------------------------
+    RenderTarget * RenderSystem::getRenderTarget( const String &name )
+    {
+        RenderTargetMap::iterator it = mRenderTargets.find( name );
+        RenderTarget *ret = NULL;
+
+        if( it != mRenderTargets.end() )
+        {
+            ret = it->second;
+        }
+
+        return ret;
+    }
+
+    //---------------------------------------------------------------------------------------------
+    RenderTarget * RenderSystem::detachRenderTarget( const String &name )
+    {
+        RenderTargetMap::iterator it = mRenderTargets.find( name );
+        RenderTarget *ret = NULL;
+
+        if( it != mRenderTargets.end() )
+        {
+            ret = it->second;
+			
+			/* Remove the render target from the priority groups. */
+            RenderTargetPriorityMap::iterator itarg, itargend;
+            itargend = mPrioritisedRenderTargets.end();
+			for( itarg = mPrioritisedRenderTargets.begin(); itarg != itargend; ++itarg )
+            {
+				if( itarg->second == ret ) {
+					mPrioritisedRenderTargets.erase( itarg );
+					break;
+				}
+            }
+
+            mRenderTargets.erase( it );
+        }
+        /// If detached render target is the active render target, reset active render target
+        if(ret == mActiveRenderTarget)
+            mActiveRenderTarget = 0;
+
+        return ret;
+    }
+    //-----------------------------------------------------------------------
+    Viewport* RenderSystem::_getViewport(void)
+    {
+        return mActiveViewport;
+    }
+    //-----------------------------------------------------------------------
+    void RenderSystem::_setTextureUnitSettings(size_t texUnit, TextureUnitState& tl)
+    {
+        // This method is only ever called to set a texture unit to valid details
+        // The method _disableTextureUnit is called to turn a unit off
+
+        const TexturePtr& tex = tl._getTexturePtr();
+		// Vertex texture binding?
+		if (mCapabilities->hasCapability(RSC_VERTEX_TEXTURE_FETCH) && 
+			!mCapabilities->getVertexTextureUnitsShared())
+		{
+			if (tl.getBindingType() == TextureUnitState::BT_VERTEX)
+			{
+				// Bind vertex texture
+				_setVertexTexture(texUnit, tex);
+				// bind nothing to fragment unit (hardware isn't shared but fragment
+				// unit can't be using the same index
+				_setTexture(texUnit, true, sNullTexPtr);
+			}
+			else
+			{
+				// vice versa
+				_setVertexTexture(texUnit, sNullTexPtr);
+				_setTexture(texUnit, true, tex);
+			}
+		}
+		else
+		{
+			// Shared vertex / fragment textures or no vertex texture support
+			// Bind texture (may be blank)
+			_setTexture(texUnit, true, tex);
+		}
+
+        // Set texture coordinate set
+        _setTextureCoordSet(texUnit, tl.getTextureCoordSet());
+
+        // Set texture layer filtering
+        _setTextureUnitFiltering(texUnit, 
+            tl.getTextureFiltering(FT_MIN), 
+            tl.getTextureFiltering(FT_MAG), 
+            tl.getTextureFiltering(FT_MIP));
+
+        // Set texture layer filtering
+        _setTextureLayerAnisotropy(texUnit, tl.getTextureAnisotropy());
+
+		// Set mipmap biasing
+		_setTextureMipmapBias(texUnit, tl.getTextureMipmapBias());
+
+		// Set blend modes
+		// Note, colour before alpha is important
+        _setTextureBlendMode(texUnit, tl.getColourBlendMode());
+        _setTextureBlendMode(texUnit, tl.getAlphaBlendMode());
+
+        // Texture addressing mode
+        const TextureUnitState::UVWAddressingMode& uvw = tl.getTextureAddressingMode();
+        _setTextureAddressingMode(texUnit, uvw);
+        // Set texture border colour only if required
+        if (uvw.u == TextureUnitState::TAM_BORDER ||
+            uvw.v == TextureUnitState::TAM_BORDER ||
+            uvw.w == TextureUnitState::TAM_BORDER)
+        {
+            _setTextureBorderColour(texUnit, tl.getTextureBorderColour());
+        }
+
+        // Set texture effects
+        TextureUnitState::EffectMap::iterator effi;
+        // Iterate over new effects
+        bool anyCalcs = false;
+        for (effi = tl.mEffects.begin(); effi != tl.mEffects.end(); ++effi)
+        {
+            switch (effi->second.type)
+            {
+            case TextureUnitState::ET_ENVIRONMENT_MAP:
+                if (effi->second.subtype == TextureUnitState::ENV_CURVED)
+                {
+                    _setTextureCoordCalculation(texUnit, TEXCALC_ENVIRONMENT_MAP);
+                    anyCalcs = true;
+                }
+                else if (effi->second.subtype == TextureUnitState::ENV_PLANAR)
+                {
+                    _setTextureCoordCalculation(texUnit, TEXCALC_ENVIRONMENT_MAP_PLANAR);
+                    anyCalcs = true;
+                }
+                else if (effi->second.subtype == TextureUnitState::ENV_REFLECTION)
+                {
+                    _setTextureCoordCalculation(texUnit, TEXCALC_ENVIRONMENT_MAP_REFLECTION);
+                    anyCalcs = true;
+                }
+                else if (effi->second.subtype == TextureUnitState::ENV_NORMAL)
+                {
+                    _setTextureCoordCalculation(texUnit, TEXCALC_ENVIRONMENT_MAP_NORMAL);
+                    anyCalcs = true;
+                }
+                break;
+            case TextureUnitState::ET_UVSCROLL:
+			case TextureUnitState::ET_USCROLL:
+			case TextureUnitState::ET_VSCROLL:
+            case TextureUnitState::ET_ROTATE:
+            case TextureUnitState::ET_TRANSFORM:
+                break;
+            case TextureUnitState::ET_PROJECTIVE_TEXTURE:
+                _setTextureCoordCalculation(texUnit, TEXCALC_PROJECTIVE_TEXTURE, 
+                    effi->second.frustum);
+                anyCalcs = true;
+                break;
+            }
+        }
+        // Ensure any previous texcoord calc settings are reset if there are now none
+        if (!anyCalcs)
+        {
+            _setTextureCoordCalculation(texUnit, TEXCALC_NONE);
+        }
+
+        // Change tetxure matrix 
+        _setTextureMatrix(texUnit, tl.getTextureTransform());
+
+
+    }
+    //-----------------------------------------------------------------------
+	void RenderSystem::_setTexture(size_t unit, bool enabled, 
+		const String &texname)
+	{
+		TexturePtr t = TextureManager::getSingleton().getByName(texname);
+		_setTexture(unit, enabled, t);
+	}
+	//-----------------------------------------------------------------------
+	void RenderSystem::_setVertexTexture(size_t unit, const TexturePtr& tex)
+	{
+		OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, 
+			"This rendersystem does not support separate vertex texture samplers, "
+			"you should use the regular texture samplers which are shared between "
+			"the vertex and fragment units.", 
+			"RenderSystem::_setVertexTexture");
+	}
+    //-----------------------------------------------------------------------
+    void RenderSystem::_disableTextureUnit(size_t texUnit)
+    {
+        _setTexture(texUnit, false, sNullTexPtr);
+    }
+    //---------------------------------------------------------------------
+    void RenderSystem::_disableTextureUnitsFrom(size_t texUnit)
+    {
+        size_t disableTo = mCapabilities->getNumTextureUnits();
+        if (disableTo > mDisabledTexUnitsFrom)
+            disableTo = mDisabledTexUnitsFrom;
+        mDisabledTexUnitsFrom = texUnit;
+        for (size_t i = texUnit; i < disableTo; ++i)
+        {
+            _disableTextureUnit(i);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void RenderSystem::_setTextureUnitFiltering(size_t unit, FilterOptions minFilter,
+            FilterOptions magFilter, FilterOptions mipFilter)
+    {
+        _setTextureUnitFiltering(unit, FT_MIN, minFilter);
+        _setTextureUnitFiltering(unit, FT_MAG, magFilter);
+        _setTextureUnitFiltering(unit, FT_MIP, mipFilter);
+    }
+    //-----------------------------------------------------------------------
+    CullingMode RenderSystem::_getCullingMode(void) const
+    {
+        return mCullingMode;
+    }
+    //-----------------------------------------------------------------------
+    bool RenderSystem::getWaitForVerticalBlank(void) const
+    {
+        return mVSync;
+    }
+    //-----------------------------------------------------------------------
+    void RenderSystem::setWaitForVerticalBlank(bool enabled)
+    {
+        mVSync = enabled;
+    }
+    bool RenderSystem::getWBufferEnabled(void) const
+    {
+        return mWBuffer;
+    }
+    //-----------------------------------------------------------------------
+    void RenderSystem::setWBufferEnabled(bool enabled)
+    {
+        mWBuffer = enabled;
+    }
+    //-----------------------------------------------------------------------
+    void RenderSystem::shutdown(void)
+    {
+		// Remove occlusion queries
+		for (HardwareOcclusionQueryList::iterator i = mHwOcclusionQueries.begin();
+			i != mHwOcclusionQueries.end(); ++i)
+		{
+			delete *i;
+		}
+		mHwOcclusionQueries.clear();
+
+        // Remove all the render targets.
+		// (destroy primary target last since others may depend on it)
+		RenderTarget* primary = 0;
+		for (RenderTargetMap::iterator it = mRenderTargets.begin(); it != mRenderTargets.end(); ++it)
+		{
+			if (!primary && it->second->isPrimary())
+				primary = it->second;
+			else
+				delete it->second;
+		}
+		delete primary;
+		mRenderTargets.clear();
+
+		mPrioritisedRenderTargets.clear();
+    }
+    //-----------------------------------------------------------------------
+    void RenderSystem::_beginGeometryCount(void)
+    {
+        mBatchCount = mFaceCount = mVertexCount = 0;
+
+    }
+    //-----------------------------------------------------------------------
+    unsigned int RenderSystem::_getFaceCount(void) const
+    {
+        return static_cast< unsigned int >( mFaceCount );
+    }
+    //-----------------------------------------------------------------------
+    unsigned int RenderSystem::_getBatchCount(void) const
+    {
+        return static_cast< unsigned int >( mBatchCount );
+    }
+    //-----------------------------------------------------------------------
+    unsigned int RenderSystem::_getVertexCount(void) const
+    {
+        return static_cast< unsigned int >( mVertexCount );
+    }
+    //-----------------------------------------------------------------------
+	void RenderSystem::convertColourValue(const ColourValue& colour, uint32* pDest)
+	{
+		*pDest = VertexElement::convertColourValue(colour, getColourVertexElementType());
+
+	}
+    //-----------------------------------------------------------------------
+    void RenderSystem::_setWorldMatrices(const Matrix4* m, unsigned short count)
+    {
+        // Do nothing with these matrices here, it never used for now,
+		// derived class should take care with them if required.
+
+        // Set hardware matrix to nothing
+        _setWorldMatrix(Matrix4::IDENTITY);
+    }
+    //-----------------------------------------------------------------------
+    void RenderSystem::_render(const RenderOperation& op)
+    {
+        // Update stats
+        size_t val;
+
+        if (op.useIndexes)
+            val = op.indexData->indexCount;
+        else
+            val = op.vertexData->vertexCount;
+
+        // account for a pass having multiple iterations
+        if (mCurrentPassIterationCount > 1)
+            val *= mCurrentPassIterationCount;
+
+        switch(op.operationType)
+        {
+		case RenderOperation::OT_TRIANGLE_LIST:
+            mFaceCount += val / 3;
+            break;
+        case RenderOperation::OT_TRIANGLE_STRIP:
+        case RenderOperation::OT_TRIANGLE_FAN:
+            mFaceCount += val - 2;
+            break;
+	    case RenderOperation::OT_POINT_LIST:
+	    case RenderOperation::OT_LINE_LIST:
+	    case RenderOperation::OT_LINE_STRIP:
+	        break;
+	    }
+
+        mVertexCount += op.vertexData->vertexCount;
+        mBatchCount += mCurrentPassIterationCount;
+    }
+    //-----------------------------------------------------------------------
+    void RenderSystem::setInvertVertexWinding(bool invert)
+    {
+        mInvertVertexWinding = invert;
+    }
+    //-----------------------------------------------------------------------
+    void RenderSystem::setClipPlane (ushort index, const Plane &p)
+    {
+        setClipPlane (index, p.normal.x, p.normal.y, p.normal.z, p.d);
+    }
+    //-----------------------------------------------------------------------
+    void RenderSystem::_notifyCameraRemoved(const Camera* cam)
+    {
+        RenderTargetMap::iterator i, iend;
+        iend = mRenderTargets.end();
+        for (i = mRenderTargets.begin(); i != iend; ++i)
+        {
+            RenderTarget* target = i->second;
+            target->_notifyCameraRemoved(cam);
+        }
+    }
+
+	//---------------------------------------------------------------------
+    bool RenderSystem::updatePassIterationRenderState(void)
+    {
+        if (mCurrentPassIterationCount <= 1)
+            return false;
+
+        --mCurrentPassIterationCount;
+        if (!mActiveVertexGpuProgramParameters.isNull())
+        {
+            mActiveVertexGpuProgramParameters->incPassIterationNumber();
+            bindGpuProgramPassIterationParameters(GPT_VERTEX_PROGRAM);
+        }
+        if (!mActiveFragmentGpuProgramParameters.isNull())
+        {
+            mActiveFragmentGpuProgramParameters->incPassIterationNumber();
+            bindGpuProgramPassIterationParameters(GPT_FRAGMENT_PROGRAM);
+        }
+        return true;
+    }
+
+	//-----------------------------------------------------------------------
+	void RenderSystem::addListener(Listener* l)
+	{
+		mEventListeners.push_back(l);
+	}
+	//-----------------------------------------------------------------------
+	void RenderSystem::removeListener(Listener* l)
+	{
+		mEventListeners.remove(l);
+	}
+	//-----------------------------------------------------------------------
+	void RenderSystem::fireEvent(const String& name, const NameValuePairList* params)
+	{
+		for(ListenerList::iterator i = mEventListeners.begin(); 
+			i != mEventListeners.end(); ++i)
+		{
+			(*i)->eventOccurred(name, params);
+		}
+	}
+	//-----------------------------------------------------------------------
+	void RenderSystem::destroyHardwareOcclusionQuery( HardwareOcclusionQuery *hq)
+	{
+		HardwareOcclusionQueryList::iterator i =
+			std::find(mHwOcclusionQueries.begin(), mHwOcclusionQueries.end(), hq);
+		if (i != mHwOcclusionQueries.end())
+		{
+			mHwOcclusionQueries.erase(i);
+			delete hq;
+		}
+	}
+	//-----------------------------------------------------------------------
+	void RenderSystem::bindGpuProgram(GpuProgram* prg)
+	{
+	    switch(prg->getType())
+	    {
+        case GPT_VERTEX_PROGRAM:
+            mVertexProgramBound = true;
+	        break;
+        case GPT_FRAGMENT_PROGRAM:
+            mFragmentProgramBound = true;
+	        break;
+	    }
+	}
+	//-----------------------------------------------------------------------
+	void RenderSystem::unbindGpuProgram(GpuProgramType gptype)
+	{
+	    switch(gptype)
+	    {
+        case GPT_VERTEX_PROGRAM:
+            mVertexProgramBound = false;
+	        break;
+        case GPT_FRAGMENT_PROGRAM:
+            mFragmentProgramBound = false;
+	        break;
+	    }
+	}
+	//-----------------------------------------------------------------------
+	bool RenderSystem::isGpuProgramBound(GpuProgramType gptype)
+	{
+	    switch(gptype)
+	    {
+        case GPT_VERTEX_PROGRAM:
+            return mVertexProgramBound;
+        case GPT_FRAGMENT_PROGRAM:
+            return mFragmentProgramBound;
+	    }
+        // Make compiler happy
+        return false;
+	}
+
+}
+
Index: /OgreMain/src/OgreRenderSystemCapabilities.cpp
===================================================================
--- /OgreMain/src/OgreRenderSystemCapabilities.cpp	(revision 5)
+++ /OgreMain/src/OgreRenderSystemCapabilities.cpp	(revision 5)
@@ -0,0 +1,175 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreRenderSystemCapabilities.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreException.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    RenderSystemCapabilities::RenderSystemCapabilities()
+      : mNumWorldMatrices(0), mNumTextureUnits(0), mStencilBufferBitDepth(0),
+        mNumVertexBlendMatrices(0), mCapabilities(0), mNumMultiRenderTargets(1), 
+		mNonPOW2TexturesLimited(false)
+    {
+    }
+    //-----------------------------------------------------------------------
+    RenderSystemCapabilities::~RenderSystemCapabilities()
+    {
+    }
+    //-----------------------------------------------------------------------
+    void RenderSystemCapabilities::log(Log* pLog)
+    {
+        pLog->logMessage("RenderSystem capabilities");
+        pLog->logMessage("-------------------------");
+        pLog->logMessage(
+            " * Hardware generation of mipmaps: "
+            + StringConverter::toString(hasCapability(RSC_AUTOMIPMAP), true));
+        pLog->logMessage(
+            " * Texture blending: "
+            + StringConverter::toString(hasCapability(RSC_BLENDING), true));
+        pLog->logMessage(
+            " * Anisotropic texture filtering: "
+            + StringConverter::toString(hasCapability(RSC_ANISOTROPY), true));
+        pLog->logMessage(
+            " * Dot product texture operation: "
+            + StringConverter::toString(hasCapability(RSC_DOT3), true));
+        pLog->logMessage(
+            " * Cube mapping: "
+            + StringConverter::toString(hasCapability(RSC_CUBEMAPPING), true));
+        pLog->logMessage(
+            " * Hardware stencil buffer: "
+            + StringConverter::toString(hasCapability(RSC_HWSTENCIL), true));
+        if (hasCapability(RSC_HWSTENCIL))
+        {
+            pLog->logMessage(
+                "   - Stencil depth: "
+                + StringConverter::toString(getStencilBufferBitDepth()));
+            pLog->logMessage(
+                "   - Two sided stencil support: "
+                + StringConverter::toString(hasCapability(RSC_TWO_SIDED_STENCIL), true));
+            pLog->logMessage(
+                "   - Wrap stencil values: "
+                + StringConverter::toString(hasCapability(RSC_STENCIL_WRAP), true));
+        }
+        pLog->logMessage(
+            " * Hardware vertex / index buffers: "
+            + StringConverter::toString(hasCapability(RSC_VBO), true));
+        pLog->logMessage(
+            " * Vertex programs: "
+            + StringConverter::toString(hasCapability(RSC_VERTEX_PROGRAM), true));
+        if (hasCapability(RSC_VERTEX_PROGRAM))
+        {
+            pLog->logMessage(
+                "   - Max vertex program version: "
+                + getMaxVertexProgramVersion());
+        }
+        pLog->logMessage(
+            " * Fragment programs: "
+            + StringConverter::toString(hasCapability(RSC_FRAGMENT_PROGRAM), true));
+        if (hasCapability(RSC_FRAGMENT_PROGRAM))
+        {
+            pLog->logMessage(
+                "   - Max fragment program version: "
+                + getMaxFragmentProgramVersion());
+        }
+
+        pLog->logMessage(
+            " * Texture Compression: "
+            + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION), true));
+        if (hasCapability(RSC_TEXTURE_COMPRESSION))
+        {
+            pLog->logMessage(
+                "   - DXT: "
+                + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_DXT), true));
+            pLog->logMessage(
+                "   - VTC: "
+                + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_VTC), true));
+        }
+
+        pLog->logMessage(
+            " * Scissor Rectangle: "
+            + StringConverter::toString(hasCapability(RSC_SCISSOR_TEST), true));
+        pLog->logMessage(
+            " * Hardware Occlusion Query: "
+            + StringConverter::toString(hasCapability(RSC_HWOCCLUSION), true));
+        pLog->logMessage(
+            " * User clip planes: "
+            + StringConverter::toString(hasCapability(RSC_USER_CLIP_PLANES), true));
+        pLog->logMessage(
+            " * VET_UBYTE4 vertex element type: "
+            + StringConverter::toString(hasCapability(RSC_VERTEX_FORMAT_UBYTE4), true));
+        pLog->logMessage(
+            " * Infinite far plane projection: "
+            + StringConverter::toString(hasCapability(RSC_INFINITE_FAR_PLANE), true));
+		pLog->logMessage(
+            " * Hardware render-to-texture: "
+            + StringConverter::toString(hasCapability(RSC_HWRENDER_TO_TEXTURE), true));
+        pLog->logMessage(
+            " * Floating point textures: "
+            + StringConverter::toString(hasCapability(RSC_TEXTURE_FLOAT), true));
+        pLog->logMessage(
+            " * Non-power-of-two textures: "
+            + StringConverter::toString(hasCapability(RSC_NON_POWER_OF_2_TEXTURES), true)
+			+ (mNonPOW2TexturesLimited ? " (limited)" : ""));
+		pLog->logMessage(
+            " * Volume textures: "
+            + StringConverter::toString(hasCapability(RSC_TEXTURE_3D), true));
+		pLog->logMessage(
+            " * Multiple Render Targets: "
+            + StringConverter::toString(mNumMultiRenderTargets));
+		pLog->logMessage(
+			" * Point Sprites: "
+			+ StringConverter::toString(hasCapability(RSC_POINT_SPRITES), true));
+		pLog->logMessage(
+			" * Extended point parameters: "
+			+ StringConverter::toString(hasCapability(RSC_POINT_EXTENDED_PARAMETERS), true));
+		pLog->logMessage(
+			" * Max Point Size: "
+			+ StringConverter::toString(mMaxPointSize));
+		pLog->logMessage(
+			" * Vertex texture fetch: "
+			+ StringConverter::toString(hasCapability(RSC_VERTEX_TEXTURE_FETCH), true));
+		if (hasCapability(RSC_VERTEX_TEXTURE_FETCH))
+		{
+			pLog->logMessage(
+				"   - Max vertex textures: "
+					+ StringConverter::toString(mNumVertexTextureUnits));
+			pLog->logMessage(
+				"   - Vertex textures shared: "
+				+ StringConverter::toString(mVertexTextureUnitsShared, true));
+
+		}
+
+
+    }
+};
Index: /OgreMain/src/OgreRenderTarget.cpp
===================================================================
--- /OgreMain/src/OgreRenderTarget.cpp	(revision 5)
+++ /OgreMain/src/OgreRenderTarget.cpp	(revision 5)
@@ -0,0 +1,482 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreRenderTarget.h"
+#include "OgreStringConverter.h"
+
+#include "OgreViewport.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreRenderTargetListener.h"
+#include "OgreRoot.h"
+
+namespace Ogre {
+
+    RenderTarget::RenderTarget()
+		:mPriority(OGRE_DEFAULT_RT_GROUP),
+		mActive(true),
+		mAutoUpdate(true)
+    {
+        mTimer = Root::getSingleton().getTimer();
+        resetStatistics();
+    }
+
+    RenderTarget::~RenderTarget()
+    {
+        // Delete viewports
+        for (ViewportList::iterator i = mViewportList.begin();
+            i != mViewportList.end(); ++i)
+        {
+            fireViewportRemoved(i->second);
+            delete (*i).second;
+        }
+
+
+        // Write closing message
+		StringUtil::StrStreamType msg;
+		msg << "Render Target '" << mName << "' "
+			<< "Average FPS: " << mStats.avgFPS << " "
+			<< "Best FPS: " << mStats.bestFPS << " "
+			<< "Worst FPS: " << mStats.worstFPS; 
+        LogManager::getSingleton().logMessage(msg.str());
+
+    }
+
+    const String& RenderTarget::getName(void) const
+    {
+        return mName;
+    }
+
+
+    void RenderTarget::getMetrics(unsigned int& width, unsigned int& height, unsigned int& colourDepth)
+    {
+        width = mWidth;
+        height = mHeight;
+        colourDepth = mColourDepth;
+    }
+
+    unsigned int RenderTarget::getWidth(void) const
+    {
+        return mWidth;
+    }
+    unsigned int RenderTarget::getHeight(void) const
+    {
+        return mHeight;
+    }
+    unsigned int RenderTarget::getColourDepth(void) const
+    {
+        return mColourDepth;
+    }
+
+    void RenderTarget::update(void)
+    {
+
+        // notify listeners (pre)
+        firePreUpdate();
+
+        mStats.triangleCount = 0;
+        mStats.batchCount = 0;
+        // Go through viewports in Z-order
+        // Tell each to refresh
+        ViewportList::iterator it = mViewportList.begin();
+        while (it != mViewportList.end())
+        {
+            fireViewportPreUpdate((*it).second);
+            (*it).second->update();
+            mStats.triangleCount += (*it).second->_getNumRenderedFaces();
+            mStats.batchCount += (*it).second->_getNumRenderedBatches();
+            fireViewportPostUpdate((*it).second);
+            ++it;
+        }
+
+        // notify listeners (post)
+        firePostUpdate();
+
+        // Update statistics (always on top)
+        updateStats();
+
+
+    }
+
+    Viewport* RenderTarget::addViewport(Camera* cam, int ZOrder, float left, float top ,
+        float width , float height)
+    {
+        // Check no existing viewport with this Z-order
+        ViewportList::iterator it = mViewportList.find(ZOrder);
+
+        if (it != mViewportList.end())
+        {
+			StringUtil::StrStreamType str;
+			str << "Can't create another viewport for "
+				<< mName << " with Z-Order " << ZOrder
+				<< " because a viewport exists with this Z-Order already.";
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, str.str(), "RenderTarget::addViewport");
+        }
+        // Add viewport to list
+        // Order based on Z-Order
+        Viewport* vp = new Viewport(cam, this, left, top, width, height, ZOrder);
+
+        mViewportList.insert(ViewportList::value_type(ZOrder, vp));
+
+		fireViewportAdded(vp);
+
+        return vp;
+    }
+	//-----------------------------------------------------------------------
+    void RenderTarget::removeViewport(int ZOrder)
+    {
+        ViewportList::iterator it = mViewportList.find(ZOrder);
+
+        if (it != mViewportList.end())
+        {
+			fireViewportRemoved((*it).second);
+            delete (*it).second;
+            mViewportList.erase(ZOrder);
+        }
+    }
+
+    void RenderTarget::removeAllViewports(void)
+    {
+
+
+        for (ViewportList::iterator it = mViewportList.begin(); it != mViewportList.end(); ++it)
+        {
+            fireViewportRemoved(it->second);
+            delete (*it).second;
+        }
+
+        mViewportList.clear();
+
+    }
+
+    void RenderTarget::getStatistics(float& lastFPS, float& avgFPS,
+        float& bestFPS, float& worstFPS) const
+    {
+
+        // Note - the will have been updated by the last render
+        lastFPS = mStats.lastFPS;
+        avgFPS = mStats.avgFPS;
+        bestFPS = mStats.bestFPS;
+        worstFPS = mStats.worstFPS;
+
+
+    }
+
+    const RenderTarget::FrameStats& RenderTarget::getStatistics(void) const
+    {
+        return mStats;
+    }
+
+    float RenderTarget::getLastFPS() const
+    {
+        return mStats.lastFPS;
+    }
+    float RenderTarget::getAverageFPS() const
+    {
+        return mStats.avgFPS;
+    }
+    float RenderTarget::getBestFPS() const
+    {
+        return mStats.bestFPS;
+    }
+    float RenderTarget::getWorstFPS() const
+    {
+        return mStats.worstFPS;
+    }
+
+    size_t RenderTarget::getTriangleCount(void) const
+    {
+        return mStats.triangleCount;
+    }
+
+    size_t RenderTarget::getBatchCount(void) const
+    {
+        return mStats.batchCount;
+    }
+
+    float RenderTarget::getBestFrameTime() const
+    {
+        return mStats.bestFrameTime;
+    }
+
+    float RenderTarget::getWorstFrameTime() const
+    {
+        return mStats.worstFrameTime;
+    }
+
+    void RenderTarget::resetStatistics(void)
+    {
+        mStats.avgFPS = 0.0;
+        mStats.bestFPS = 0.0;
+        mStats.lastFPS = 0.0;
+        mStats.worstFPS = 999.0;
+        mStats.triangleCount = 0;
+        mStats.batchCount = 0;
+        mStats.bestFrameTime = 999999;
+        mStats.worstFrameTime = 0;
+
+        mLastTime = mTimer->getMilliseconds();
+        mLastSecond = mLastTime;
+        mFrameCount = 0;
+    }
+
+    void RenderTarget::updateStats(void)
+    {
+        ++mFrameCount;
+        unsigned long thisTime = mTimer->getMilliseconds();
+
+        // check frame time
+        unsigned long frameTime = thisTime - mLastTime ;
+        mLastTime = thisTime ;
+
+        mStats.bestFrameTime = std::min(mStats.bestFrameTime, frameTime);
+        mStats.worstFrameTime = std::max(mStats.worstFrameTime, frameTime);
+
+        // check if new second (update only once per second)
+        if (thisTime - mLastSecond > 1000) 
+        { 
+            // new second - not 100% precise
+            mStats.lastFPS = (float)mFrameCount / (float)(thisTime - mLastSecond) * 1000.0;
+
+            if (mStats.avgFPS == 0)
+                mStats.avgFPS = mStats.lastFPS;
+            else
+                mStats.avgFPS = (mStats.avgFPS + mStats.lastFPS) / 2; // not strictly correct, but good enough
+
+            mStats.bestFPS = std::max(mStats.bestFPS, mStats.lastFPS);
+            mStats.worstFPS = std::min(mStats.worstFPS, mStats.lastFPS);
+
+            mLastSecond = thisTime ;
+            mFrameCount  = 0;
+
+        }
+
+    }
+
+    void RenderTarget::getCustomAttribute(const String& name, void* pData)
+    {
+        OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Attribute not found.", "RenderTarget::getCustomAttribute");
+    }
+    //-----------------------------------------------------------------------
+    void RenderTarget::addListener(RenderTargetListener* listener)
+    {
+        mListeners.push_back(listener);
+    }
+    //-----------------------------------------------------------------------
+    void RenderTarget::removeListener(RenderTargetListener* listener)
+    {
+        RenderTargetListenerList::iterator i;
+        for (i = mListeners.begin(); i != mListeners.end(); ++i)
+        {
+            if (*i == listener)
+            {
+                mListeners.erase(i);
+                break;
+            }
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void RenderTarget::removeAllListeners(void)
+    {
+        mListeners.clear();
+    }
+    //-----------------------------------------------------------------------
+    void RenderTarget::firePreUpdate(void)
+    {
+        RenderTargetEvent evt;
+        evt.source = this;
+
+        RenderTargetListenerList::iterator i, iend;
+        i = mListeners.begin();
+        iend = mListeners.end();
+        for(; i != iend; ++i)
+        {
+            (*i)->preRenderTargetUpdate(evt);
+        }
+
+
+    }
+    //-----------------------------------------------------------------------
+    void RenderTarget::firePostUpdate(void)
+    {
+        RenderTargetEvent evt;
+        evt.source = this;
+
+        RenderTargetListenerList::iterator i, iend;
+        i = mListeners.begin();
+        iend = mListeners.end();
+        for(; i != iend; ++i)
+        {
+            (*i)->postRenderTargetUpdate(evt);
+        }
+    }
+    //-----------------------------------------------------------------------
+    unsigned short RenderTarget::getNumViewports(void) const
+    {
+        return (unsigned short)mViewportList.size();
+
+    }
+    //-----------------------------------------------------------------------
+    Viewport* RenderTarget::getViewport(unsigned short index)
+    {
+        assert (index < mViewportList.size() && "Index out of bounds");
+
+        ViewportList::iterator i = mViewportList.begin();
+        while (index--)
+            ++i;
+        return i->second;
+    }
+    //-----------------------------------------------------------------------
+    bool RenderTarget::isActive() const
+    {
+        return mActive;
+    }
+    //-----------------------------------------------------------------------
+    void RenderTarget::setActive( bool state )
+    {
+        mActive = state;
+    }
+    //-----------------------------------------------------------------------
+    void RenderTarget::fireViewportPreUpdate(Viewport* vp)
+    {
+        RenderTargetViewportEvent evt;
+        evt.source = vp;
+
+        RenderTargetListenerList::iterator i, iend;
+        i = mListeners.begin();
+        iend = mListeners.end();
+        for(; i != iend; ++i)
+        {
+            (*i)->preViewportUpdate(evt);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void RenderTarget::fireViewportPostUpdate(Viewport* vp)
+    {
+        RenderTargetViewportEvent evt;
+        evt.source = vp;
+
+        RenderTargetListenerList::iterator i, iend;
+        i = mListeners.begin();
+        iend = mListeners.end();
+        for(; i != iend; ++i)
+        {
+            (*i)->postViewportUpdate(evt);
+        }
+    }
+	//-----------------------------------------------------------------------
+	void RenderTarget::fireViewportAdded(Viewport* vp)
+	{
+		RenderTargetViewportEvent evt;
+		evt.source = vp;
+
+		RenderTargetListenerList::iterator i, iend;
+		i = mListeners.begin();
+		iend = mListeners.end();
+		for(; i != iend; ++i)
+		{
+			(*i)->viewportAdded(evt);
+		}
+	}
+	//-----------------------------------------------------------------------
+	void RenderTarget::fireViewportRemoved(Viewport* vp)
+	{
+		RenderTargetViewportEvent evt;
+		evt.source = vp;
+
+		// Make a temp copy of the listeners
+		// some will want to remove themselves as listeners when they get this
+		RenderTargetListenerList tempList = mListeners;
+
+		RenderTargetListenerList::iterator i, iend;
+		i = tempList.begin();
+		iend = tempList.end();
+		for(; i != iend; ++i)
+		{
+			(*i)->viewportRemoved(evt);
+		}
+	}
+    //-----------------------------------------------------------------------
+    String RenderTarget::writeContentsToTimestampedFile(const String& filenamePrefix, const String& filenameSuffix)
+    {
+        struct tm *pTime;
+        time_t ctTime; time(&ctTime);
+        pTime = localtime( &ctTime );
+        std::ostringstream oss;
+        oss	<< std::setw(2) << std::setfill('0') << (pTime->tm_mon + 1)
+            << std::setw(2) << std::setfill('0') << pTime->tm_mday
+            << std::setw(2) << std::setfill('0') << (pTime->tm_year + 1900)
+            << "_" << std::setw(2) << std::setfill('0') << pTime->tm_hour
+            << std::setw(2) << std::setfill('0') << pTime->tm_min
+            << std::setw(2) << std::setfill('0') << pTime->tm_sec
+            << std::setw(3) << std::setfill('0') << (mTimer->getMilliseconds() % 1000);
+        String filename = filenamePrefix + String(oss.str()) + filenameSuffix;
+        writeContentsToFile(filename);
+        return filename;
+
+    }
+    //-----------------------------------------------------------------------
+    void RenderTarget::_notifyCameraRemoved(const Camera* cam)
+    {
+        ViewportList::iterator i, iend;
+        iend = mViewportList.end();
+        for (i = mViewportList.begin(); i != iend; ++i)
+        {
+            Viewport* v = i->second;
+            if (v->getCamera() == cam)
+            {
+                // disable camera link
+                v->setCamera(0);
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void RenderTarget::setAutoUpdated(bool autoup)
+    {
+        mAutoUpdate = autoup;
+    }
+    //-----------------------------------------------------------------------
+    bool RenderTarget::isAutoUpdated(void) const
+    {
+        return mAutoUpdate;
+    }
+    //-----------------------------------------------------------------------
+    bool RenderTarget::isPrimary(void) const
+    {
+        // RenderWindow will override and return true for the primary window
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    RenderTarget::Impl *RenderTarget::_getImpl()
+    {
+        return 0;
+    }
+
+}        
Index: /OgreMain/src/OgreRenderTexture.cpp
===================================================================
--- /OgreMain/src/OgreRenderTexture.cpp	(revision 5)
+++ /OgreMain/src/OgreRenderTexture.cpp	(revision 5)
@@ -0,0 +1,116 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreRenderTexture.h"
+#include "OgreException.h"
+#include "OgreHardwarePixelBuffer.h"
+#include "OgreImage.h"
+#include "OgreImageCodec.h"
+
+namespace Ogre
+{
+
+    //-----------------------------------------------------------------------------
+	RenderTexture::RenderTexture(HardwarePixelBuffer *buffer, size_t zoffset):
+		mBuffer(buffer), mZOffset(zoffset)
+    {
+        mPriority = OGRE_REND_TO_TEX_RT_GROUP;
+		mWidth = static_cast<unsigned int>(mBuffer->getWidth());
+		mHeight = static_cast<unsigned int>(mBuffer->getHeight());
+        mColourDepth = static_cast<unsigned int>(
+			Ogre::PixelUtil::getNumElemBits(mBuffer->getFormat()));
+    }
+    RenderTexture::~RenderTexture()
+    {
+		mBuffer->_clearSliceRTT(0);
+    }
+
+	void RenderTexture::writeContentsToFile( const String & filename )
+    {
+		// copyToMemory
+        ImageCodec::ImageData *imgData = new ImageCodec::ImageData();
+        
+        imgData->width = mWidth;
+        imgData->height = mHeight;
+		imgData->depth = 1;
+        imgData->format = PF_BYTE_RGBA;
+		size_t size = imgData->width * imgData->height * 4;
+
+        // Allocate buffer 
+        uchar* pBuffer = new uchar[size];
+
+        // Read pixels
+        mBuffer->blitToMemory(
+			Box(0,0,mZOffset,mWidth,mHeight,mZOffset+1), 
+			PixelBox(mWidth, mHeight, 1, imgData->format, pBuffer)
+		);
+
+        // Wrap buffer in a chunk
+        MemoryDataStreamPtr stream(new MemoryDataStream(
+            pBuffer, size, false));
+
+        // Get codec 
+        size_t pos = filename.find_last_of(".");
+            String extension;
+        if( pos == String::npos )
+            OGRE_EXCEPT(
+                Exception::ERR_INVALIDPARAMS, 
+            "Unable to determine image type for '" + filename + "' - invalid extension.",
+                "GLRenderTexture::writeContentsToFile" );
+
+        while( pos != filename.length() - 1 )
+            extension += filename[++pos];
+
+        // Get the codec
+        Codec * pCodec = Codec::getCodec(extension);
+
+        // Write out
+        Codec::CodecDataPtr codecDataPtr(imgData);
+        pCodec->codeToFile(stream, filename, codecDataPtr);
+
+		delete [] pBuffer;
+    }
+	//-----------------------------------------------------------------------------
+	MultiRenderTarget::MultiRenderTarget(const String &name)
+    {
+        mPriority = OGRE_REND_TO_TEX_RT_GROUP;
+		mName = name;
+		/// Width and height is unknown with no targets attached
+		mWidth = mHeight = 0;
+    }
+	//-----------------------------------------------------------------------------
+	void MultiRenderTarget::writeContentsToFile( const String & filename )
+	{
+		OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"Cannot write MultiRenderTargets to disk",
+                "MultiRenderTarget::writeContentsToFile");
+	}
+
+}
Index: /OgreMain/src/OgreRenderWindow.cpp
===================================================================
--- /OgreMain/src/OgreRenderWindow.cpp	(revision 5)
+++ /OgreMain/src/OgreRenderWindow.cpp	(revision 5)
@@ -0,0 +1,83 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreRenderWindow.h"
+
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreViewport.h"
+#include "OgreSceneManager.h"
+
+namespace Ogre {
+
+    RenderWindow::RenderWindow()
+        : RenderTarget(), mIsPrimary(false)
+    {
+    }
+
+    //-----------------------------------------------------------------------
+    void RenderWindow::getMetrics(unsigned int& width, unsigned int& height, unsigned int& colourDepth,
+		int& left, int& top)
+    {
+        width = mWidth;
+        height = mHeight;
+        colourDepth = mColourDepth;
+        left = mLeft;
+        top = mTop;
+    }
+    //-----------------------------------------------------------------------
+    bool RenderWindow::isFullScreen(void) const
+    {
+        return mIsFullScreen;
+    }
+	//-----------------------------------------------------------------------
+    bool RenderWindow::isPrimary(void) const
+    {
+        return mIsPrimary;
+    }
+    //-----------------------------------------------------------------------
+    void RenderWindow::update(void)
+    {
+		update(true);
+	}
+    //-----------------------------------------------------------------------
+    void RenderWindow::update(bool swap)
+    {
+        // call superclass
+        RenderTarget::update();
+
+
+		if (swap)
+		{
+			// Swap buffers
+    	    swapBuffers(Root::getSingleton().getRenderSystem()->getWaitForVerticalBlank());
+		}
+    }
+
+}
Index: /OgreMain/src/OgreResource.cpp
===================================================================
--- /OgreMain/src/OgreResource.cpp	(revision 5)
+++ /OgreMain/src/OgreResource.cpp	(revision 5)
@@ -0,0 +1,245 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+// Ogre includes
+#include "OgreStableHeaders.h"
+
+#include "OgreResource.h"
+#include "OgreResourceManager.h"
+#include "OgreResourceBackgroundQueue.h"
+#include "OgreLogManager.h"
+#include "OgreException.h"
+
+namespace Ogre 
+{
+	//-----------------------------------------------------------------------
+	Resource::Resource(ResourceManager* creator, const String& name, ResourceHandle handle,
+		const String& group, bool isManual, ManualResourceLoader* loader)
+		: mCreator(creator), mName(name), mGroup(group), mHandle(handle), 
+		mLoadingState(LOADSTATE_UNLOADED), mIsBackgroundLoaded(false),
+		mSize(0), mIsManual(isManual), mLoader(loader)
+	{
+	}
+	//-----------------------------------------------------------------------
+	Resource::~Resource() 
+	{ 
+	}
+	//-----------------------------------------------------------------------
+	void Resource::escalateLoading()
+	{
+		// Just call load as if this is the background thread, locking on
+		// load status will prevent race conditions
+		load(true);
+	}
+	//-----------------------------------------------------------------------
+	void Resource::load(bool background)
+	{
+		// Early-out without lock (mitigate perf cost of ensuring loaded)
+		// Don't load if:
+		// 1. We're already loaded
+		// 2. Another thread is loading right now
+		// 3. We're marked for background loading and this is not the background
+		//    loading thread we're being called by
+		if (mLoadingState != LOADSTATE_UNLOADED || (mIsBackgroundLoaded && !background))
+			return;
+
+		// Scope lock over load status
+		{
+			OGRE_LOCK_MUTEX(mLoadingStatusMutex)
+			// Check again just in case status changed (since we didn't lock above)
+			if (mLoadingState != LOADSTATE_UNLOADED || (mIsBackgroundLoaded && !background))
+			{
+				// no loading to be done
+				return;
+			}
+			mLoadingState = LOADSTATE_LOADING;
+		}
+
+		// Scope lock for actual loading
+        try
+		{
+
+			OGRE_LOCK_AUTO_MUTEX
+			preLoadImpl();
+
+			if (mIsManual)
+			{
+				// Load from manual loader
+				if (mLoader)
+				{
+					mLoader->loadResource(this);
+				}
+				else
+				{
+					// Warn that this resource is not reloadable
+					LogManager::getSingleton().logMessage(
+						"WARNING: " + mCreator->getResourceType() + 
+						" instance '" + mName + "' was defined as manually "
+						"loaded, but no manual loader was provided. This Resource "
+						"will be lost if it has to be reloaded.");
+				}
+			}
+			else
+			{
+				if (mGroup == ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
+				{
+					// Derive resource group
+					changeGroupOwnership(
+						ResourceGroupManager::getSingleton()
+						.findGroupContainingResource(mName));
+				}
+				loadImpl();
+			}
+			// Calculate resource size
+			mSize = calculateSize();
+
+			postLoadImpl();
+		}
+        catch (...)
+        {
+            // Reset loading in-progress flag in case failed for some reason
+            OGRE_LOCK_MUTEX(mLoadingStatusMutex)
+            mLoadingState = LOADSTATE_UNLOADED;
+            // Re-throw
+            throw;
+        }
+
+		// Scope lock for loading progress
+		{
+			OGRE_LOCK_MUTEX(mLoadingStatusMutex)
+		
+			// Now loaded
+			mLoadingState = LOADSTATE_LOADED;
+		}
+
+		// Notify manager
+		if(mCreator)
+			mCreator->_notifyResourceLoaded(this);
+
+		// Fire (deferred) events
+		if (mIsBackgroundLoaded)
+			queueFireBackgroundLoadingComplete();
+
+
+	}
+	//-----------------------------------------------------------------------
+	void Resource::changeGroupOwnership(const String& newGroup)
+	{
+		if (mGroup != newGroup)
+		{
+			String oldGroup = mGroup;
+			mGroup = newGroup;
+			ResourceGroupManager::getSingleton()
+				._notifyResourceGroupChanged(oldGroup, this);
+		}
+	}
+	//-----------------------------------------------------------------------
+	void Resource::unload(void) 
+	{ 
+		// Early-out without lock (mitigate perf cost of ensuring unloaded)
+		if (mLoadingState != LOADSTATE_LOADED)
+			return;
+
+		// Scope lock for loading status
+		{
+			OGRE_LOCK_MUTEX(mLoadingStatusMutex)
+			if (mLoadingState == LOADSTATE_LOADING)
+			{
+				OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+					"Cannot unload resource " + mName + " whilst loading is in progress!", 
+					"Resource::unload");
+			}
+			if (mLoadingState != LOADSTATE_LOADED)
+				return; // nothing to do
+
+			mLoadingState = LOADSTATE_UNLOADING;
+		}
+
+		// Scope lock for actual unload
+		{
+			OGRE_LOCK_AUTO_MUTEX
+			preUnloadImpl();
+			unloadImpl();
+			postUnloadImpl();
+		}
+
+		// Scope lock for loading status
+		{
+			OGRE_LOCK_MUTEX(mLoadingStatusMutex)
+			mLoadingState = LOADSTATE_UNLOADED;
+		}
+
+		// Notify manager
+		if(mCreator)
+			mCreator->_notifyResourceUnloaded(this);
+
+	}
+	//-----------------------------------------------------------------------
+	void Resource::reload(void) 
+	{ 
+		OGRE_LOCK_AUTO_MUTEX
+		if (mLoadingState == LOADSTATE_LOADED)
+		{
+			unload();
+			load();
+		}
+	}
+	//-----------------------------------------------------------------------
+	void Resource::touch(void) 
+	{
+		OGRE_LOCK_AUTO_MUTEX
+        // make sure loaded
+        load();
+
+		if(mCreator)
+			mCreator->_notifyResourceTouched(this);
+	}
+	//-----------------------------------------------------------------------
+	void Resource::addListener(Resource::Listener* lis)
+	{
+		mListenerList.push_back(lis);
+	}
+	//-----------------------------------------------------------------------
+	void Resource::removeListener(Resource::Listener* lis)
+	{
+		// O(n) but not called very often
+		mListenerList.remove(lis);
+	}
+	//-----------------------------------------------------------------------
+	void Resource::queueFireBackgroundLoadingComplete(void)
+	{
+		ResourceBackgroundQueue& rbq = ResourceBackgroundQueue::getSingleton();
+		for (ListenerList::iterator i = mListenerList.begin();
+			i != mListenerList.end(); ++i)
+		{
+			rbq._queueFireBackgroundLoadingComplete(*i, this);
+		}
+	}
+
+
+}
Index: /OgreMain/src/OgreResourceBackgroundQueue.cpp
===================================================================
--- /OgreMain/src/OgreResourceBackgroundQueue.cpp	(revision 5)
+++ /OgreMain/src/OgreResourceBackgroundQueue.cpp	(revision 5)
@@ -0,0 +1,509 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreResourceBackgroundQueue.h"
+#include "OgreLogManager.h"
+#include "OgreException.h"
+#include "OgreResourceGroupManager.h"
+#include "OgreResourceManager.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+
+namespace Ogre {
+
+	//------------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    template<> ResourceBackgroundQueue* Singleton<ResourceBackgroundQueue>::ms_Singleton = 0;
+    ResourceBackgroundQueue* ResourceBackgroundQueue::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    ResourceBackgroundQueue& ResourceBackgroundQueue::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+    //-----------------------------------------------------------------------	
+	//------------------------------------------------------------------------
+	ResourceBackgroundQueue::ResourceBackgroundQueue()
+		:mNextTicketID(0), mStartThread(true), mThread(0)
+#if OGRE_THREAD_SUPPORT
+        , mShuttingDown(false)
+#endif
+	{
+	}
+	//------------------------------------------------------------------------
+	ResourceBackgroundQueue::~ResourceBackgroundQueue()
+	{
+		shutdown();
+	}
+	//------------------------------------------------------------------------
+	void ResourceBackgroundQueue::initialise(void)
+	{
+#if OGRE_THREAD_SUPPORT
+		if (mStartThread)
+		{
+			{
+				OGRE_LOCK_AUTO_MUTEX
+				mShuttingDown = false;
+			}
+
+			RenderSystem* rs = Root::getSingleton().getRenderSystem();
+
+			LogManager::getSingleton().logMessage(
+				"ResourceBackgroundQueue - threading enabled, starting own thread");
+			{
+				OGRE_LOCK_MUTEX_NAMED(initMutex, initLock)
+
+				// Call thread creation pre-hook
+				rs->preExtraThreadsStarted();
+
+				mThread = new boost::thread(
+					boost::function0<void>(&ResourceBackgroundQueue::threadFunc));
+				// Wait for init to finish before allowing main thread to continue
+				// this releases the initMutex until notified
+				OGRE_THREAD_WAIT(initSync, initLock)
+
+				// Call thread creation post-hook
+				rs->postExtraThreadsStarted();
+			}
+
+		}
+		else
+		{
+			LogManager::getSingleton().logMessage(
+				"ResourceBackgroundQueue - threading enabled, user thread");
+		}
+#else
+		LogManager::getSingleton().logMessage(
+			"ResourceBackgroundQueue - threading disabled");	
+#endif
+	}
+	//------------------------------------------------------------------------
+	void ResourceBackgroundQueue::shutdown(void)
+	{
+#if OGRE_THREAD_SUPPORT
+		if (mThread)
+		{
+			// Put a shutdown request on the queue
+			Request req;
+			req.type = RT_SHUTDOWN;
+			addRequest(req);
+			// Wait for thread to finish
+			mThread->join();
+			delete mThread;
+			mThread = 0;
+			mRequestQueue.clear();
+			mRequestTicketMap.clear();
+		}
+#endif
+	}
+	//------------------------------------------------------------------------
+	BackgroundProcessTicket ResourceBackgroundQueue::initialiseResourceGroup(
+		const String& name, ResourceBackgroundQueue::Listener* listener)
+	{
+#if OGRE_THREAD_SUPPORT
+		if (!mThread && mStartThread)
+		{
+			OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+				"Thread not initialised",
+				"ResourceBackgroundQueue::initialiseResourceGroup");
+		}
+		// queue a request
+		Request req;
+		req.type = RT_INITIALISE_GROUP;
+		req.groupName = name;
+		req.listener = listener;
+		return addRequest(req);
+#else
+		// synchronous
+		ResourceGroupManager::getSingleton().initialiseResourceGroup(name);
+		return 0; 
+#endif
+	}
+	//------------------------------------------------------------------------
+	BackgroundProcessTicket 
+	ResourceBackgroundQueue::initialiseAllResourceGroups( 
+		ResourceBackgroundQueue::Listener* listener)
+	{
+#if OGRE_THREAD_SUPPORT
+		if (!mThread && mStartThread)
+		{
+			OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+				"Thread not initialised",
+				"ResourceBackgroundQueue::initialiseAllResourceGroups");
+		}
+		// queue a request
+		Request req;
+		req.type = RT_INITIALISE_ALL_GROUPS;
+		req.listener = listener;
+		return addRequest(req);
+#else
+		// synchronous
+		ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+		return 0; 
+#endif
+	}
+	//------------------------------------------------------------------------
+	BackgroundProcessTicket ResourceBackgroundQueue::loadResourceGroup(
+		const String& name, ResourceBackgroundQueue::Listener* listener)
+	{
+#if OGRE_THREAD_SUPPORT
+		if (!mThread && mStartThread)
+		{
+			OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+				"Thread not initialised",
+				"ResourceBackgroundQueue::loadResourceGroup");
+		}
+		// queue a request
+		Request req;
+		req.type = RT_LOAD_GROUP;
+		req.groupName = name;
+		req.listener = listener;
+		return addRequest(req);
+#else
+		// synchronous
+		ResourceGroupManager::getSingleton().loadResourceGroup(name);
+		return 0; 
+#endif
+	}
+	//------------------------------------------------------------------------
+	BackgroundProcessTicket ResourceBackgroundQueue::load(
+		const String& resType, const String& name, 
+		const String& group, bool isManual, 
+		ManualResourceLoader* loader, 
+		const NameValuePairList* loadParams, 
+		ResourceBackgroundQueue::Listener* listener)
+	{
+#if OGRE_THREAD_SUPPORT
+		if (!mThread && mStartThread)
+		{
+			OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+				"Thread not initialised",
+				"ResourceBackgroundQueue::load");
+		}
+		// queue a request
+		Request req;
+		req.type = RT_LOAD_RESOURCE;
+		req.resourceType = resType;
+		req.resourceName = name;
+		req.groupName = group;
+		req.isManual = isManual;
+		req.loader = loader;
+		req.loadParams = loadParams;
+		req.listener = listener;
+		return addRequest(req);
+#else
+		// synchronous
+		ResourceManager* rm = 
+			ResourceGroupManager::getSingleton()._getResourceManager(resType);
+		rm->load(name, group, isManual, loader, loadParams);
+		return 0; 
+#endif
+	}
+	//---------------------------------------------------------------------
+	BackgroundProcessTicket ResourceBackgroundQueue::unload(
+		const String& resType, const String& name, Listener* listener)
+	{
+#if OGRE_THREAD_SUPPORT
+		if (!mThread && mStartThread)
+		{
+			OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+				"Thread not initialised",
+				"ResourceBackgroundQueue::unload");
+		}
+		// queue a request
+		Request req;
+		req.type = RT_UNLOAD_RESOURCE;
+		req.resourceType = resType;
+		req.resourceName = name;
+		req.listener = listener;
+		return addRequest(req);
+#else
+		// synchronous
+		ResourceManager* rm = 
+			ResourceGroupManager::getSingleton()._getResourceManager(resType);
+		rm->unload(name);
+		return 0; 
+#endif
+
+	}
+	//---------------------------------------------------------------------
+	BackgroundProcessTicket ResourceBackgroundQueue::unload(
+		const String& resType, ResourceHandle handle, Listener* listener)
+	{
+#if OGRE_THREAD_SUPPORT
+		if (!mThread && mStartThread)
+		{
+			OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+				"Thread not initialised",
+				"ResourceBackgroundQueue::unload");
+		}
+		// queue a request
+		Request req;
+		req.type = RT_UNLOAD_RESOURCE;
+		req.resourceType = resType;
+		req.resourceHandle = handle;
+		req.listener = listener;
+		return addRequest(req);
+#else
+		// synchronous
+		ResourceManager* rm = 
+			ResourceGroupManager::getSingleton()._getResourceManager(resType);
+		rm->unload(handle);
+		return 0; 
+#endif
+
+	}
+	//---------------------------------------------------------------------
+	BackgroundProcessTicket ResourceBackgroundQueue::unloadResourceGroup(
+		const String& name, Listener* listener)
+	{
+#if OGRE_THREAD_SUPPORT
+		if (!mThread && mStartThread)
+		{
+			OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+				"Thread not initialised",
+				"ResourceBackgroundQueue::unloadResourceGroup");
+		}
+		// queue a request
+		Request req;
+		req.type = RT_UNLOAD_GROUP;
+		req.groupName = name;
+		req.listener = listener;
+		return addRequest(req);
+#else
+		// synchronous
+		ResourceGroupManager::getSingleton().unloadResourceGroup(name);
+		return 0; 
+#endif
+
+	}
+	//------------------------------------------------------------------------
+	bool ResourceBackgroundQueue::isProcessComplete(
+			BackgroundProcessTicket ticket)
+	{
+		// Lock
+		OGRE_LOCK_AUTO_MUTEX
+
+		return mRequestTicketMap.find(ticket) == mRequestTicketMap.end();
+	}
+	//------------------------------------------------------------------------
+#if OGRE_THREAD_SUPPORT
+	BackgroundProcessTicket ResourceBackgroundQueue::addRequest(Request& req)
+	{
+		// Lock
+		OGRE_LOCK_AUTO_MUTEX
+
+		req.ticketID = ++mNextTicketID;
+		mRequestQueue.push_back(req);
+		Request* requestInList = &(mRequestQueue.back());
+		mRequestTicketMap[req.ticketID] = requestInList;
+
+		// Notify to wake up loading thread
+		OGRE_THREAD_NOTIFY_ONE(mCondition)
+
+		return req.ticketID;
+	}
+	//------------------------------------------------------------------------
+	void ResourceBackgroundQueue::threadFunc(void)
+	{
+		// Background thread implementation 
+		// Static (since no params allowed), so get instance
+		ResourceBackgroundQueue& queueInstance = 
+			ResourceBackgroundQueue::getSingleton();
+
+		LogManager::getSingleton().logMessage("ResourceBackgroundQueue - thread starting.");
+
+		// Initialise the thread
+		queueInstance._initThread();
+
+		// Spin forever until we're told to shut down
+		while (!queueInstance.mShuttingDown)
+		{
+			// Our thread will just wait when there is nothing on the queue
+			// _doNextQueuedBackgroundProcess won't do this since the thread
+			// may be shared
+
+            // Manual scope block just to define scope of lock
+            {
+                // Lock; note that 'mCondition.wait()' will free the lock
+                boost::recursive_mutex::scoped_lock queueLock(
+                    queueInstance.OGRE_AUTO_MUTEX_NAME);
+                if (queueInstance.mRequestQueue.empty())
+                {
+                    // frees lock and suspends the thread
+                    queueInstance.mCondition.wait(queueLock);
+                }
+                // When we get back here, it's because we've been notified 
+                // and thus the thread as been woken up. Lock has also been
+                // re-acquired.
+            } // release lock so queueing can be done while we process one request
+
+			queueInstance._doNextQueuedBackgroundProcess();
+
+
+		}
+
+		LogManager::getSingleton().logMessage("ResourceBackgroundQueue - thread stopped.");
+
+	
+		
+	}
+#endif
+	//-----------------------------------------------------------------------
+	void ResourceBackgroundQueue::_initThread()
+	{
+		// Register the calling thread with RenderSystem
+		// Note how we assume only one thread is processing the queue
+		Root::getSingleton().getRenderSystem()->registerThread();
+		{
+			// notify waiting thread(s)
+			OGRE_LOCK_MUTEX(initMutex)
+			OGRE_THREAD_NOTIFY_ALL(initSync)
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	bool ResourceBackgroundQueue::_doNextQueuedBackgroundProcess()
+	{
+
+		Request* req;
+		// Manual scope block just to define scope of lock
+		{
+			OGRE_LOCK_AUTO_MUTEX
+			// return false if nothing in the queue
+			if (mRequestQueue.empty())
+				return false;
+
+			// Process one request
+			req = &(mRequestQueue.front());
+		} // release lock so queueing can be done while we process one request
+		// use of std::list means that references guarateed to remain valid
+		// we only allow one background thread
+
+		ResourceManager* rm = 0;
+		switch (req->type)
+		{
+		case RT_INITIALISE_GROUP:
+			ResourceGroupManager::getSingleton().initialiseResourceGroup(
+				req->groupName);
+			break;
+		case RT_INITIALISE_ALL_GROUPS:
+			ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+			break;
+		case RT_LOAD_GROUP:
+			ResourceGroupManager::getSingleton().loadResourceGroup(
+				req->groupName);
+			break;
+		case RT_UNLOAD_GROUP:
+			ResourceGroupManager::getSingleton().unloadResourceGroup(
+				req->groupName);
+			break;
+		case RT_LOAD_RESOURCE:
+			rm = ResourceGroupManager::getSingleton()._getResourceManager(
+				req->resourceType);
+			rm->load(req->resourceName, req->groupName, req->isManual, 
+				req->loader, req->loadParams);
+			break;
+		case RT_UNLOAD_RESOURCE:
+			rm = ResourceGroupManager::getSingleton()._getResourceManager(
+				req->resourceType);
+			if (req->resourceName.empty())
+				rm->unload(req->resourceHandle);
+			else
+				rm->unload(req->resourceName);
+			break;
+		case RT_SHUTDOWN:
+			// That's all folks
+#if OGRE_THREAD_SUPPORT
+			mShuttingDown = true;
+			Root::getSingleton().getRenderSystem()->unregisterThread();
+#endif
+			break;
+		};
+
+		// Queue notification (don't do shutdown since not needed & listeners 
+		// might be being destroyed too
+		if (req->listener && req->type != RT_SHUTDOWN)
+		{
+			// Fire in-thread notification first
+			req->listener->operationCompletedInThread(req->ticketID);
+			// Then queue main thread notification
+			queueFireBackgroundOperationComplete(req->listener, req->ticketID);
+		}
+
+
+		{
+			// re-lock to consume completed request
+			OGRE_LOCK_AUTO_MUTEX
+
+			// Consume the ticket
+			mRequestTicketMap.erase(req->ticketID);
+			mRequestQueue.pop_front();
+		}
+
+		return true;
+
+	}
+	//-----------------------------------------------------------------------
+	void ResourceBackgroundQueue::_queueFireBackgroundLoadingComplete(
+		Resource::Listener* listener, Resource* res)
+	{
+		OGRE_LOCK_MUTEX(mNotificationQueueMutex);
+		mNotificationQueue.push_back(QueuedNotification(listener, res));
+
+	}
+	//-----------------------------------------------------------------------
+	void ResourceBackgroundQueue::queueFireBackgroundOperationComplete(
+		ResourceBackgroundQueue::Listener* listener, BackgroundProcessTicket ticket)
+	{
+		OGRE_LOCK_MUTEX(mNotificationQueueMutex);
+		mNotificationQueue.push_back(QueuedNotification(listener, ticket));
+	}
+	//-----------------------------------------------------------------------
+	void ResourceBackgroundQueue::_fireBackgroundLoadingComplete()
+	{
+		OGRE_LOCK_MUTEX(mNotificationQueueMutex);
+		for (NotificationQueue::iterator i = mNotificationQueue.begin();
+			i != mNotificationQueue.end(); ++i)
+		{
+			if (i->resource)
+				i->resourceListener->backgroundLoadingComplete(i->resource);
+			else
+				i->opListener->operationCompleted(i->ticket);
+		}
+		mNotificationQueue.clear();
+
+	}
+	//------------------------------------------------------------------------
+
+}
+
+
+
Index: /OgreMain/src/OgreResourceGroupManager.cpp
===================================================================
--- /OgreMain/src/OgreResourceGroupManager.cpp	(revision 5)
+++ /OgreMain/src/OgreResourceGroupManager.cpp	(revision 5)
@@ -0,0 +1,1440 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreResourceGroupManager.h"
+#include "OgreException.h"
+#include "OgreArchive.h"
+#include "OgreArchiveManager.h"
+#include "OgreLogManager.h"
+#include "OgreScriptLoader.h"
+#include "OgreSceneManager.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    template<> ResourceGroupManager* Singleton<ResourceGroupManager>::ms_Singleton = 0;
+    ResourceGroupManager* ResourceGroupManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    ResourceGroupManager& ResourceGroupManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+	String ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME = "General";
+	String ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME = "Internal";
+	String ResourceGroupManager::BOOTSTRAP_RESOURCE_GROUP_NAME = "Bootstrap";
+	String ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME = "Autodetect";
+	// A reference count of 3 means that only RGM and RM have references
+	// RGM has one (this one) and RM has 2 (by name and by handle)
+	size_t ResourceGroupManager::RESOURCE_SYSTEM_NUM_REFERENCE_COUNTS = 3;
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    ResourceGroupManager::ResourceGroupManager()
+        : mCurrentGroup(0)
+    {
+        // Create the 'General' group
+        createResourceGroup(DEFAULT_RESOURCE_GROUP_NAME);
+        // Create the 'Internal' group
+        createResourceGroup(INTERNAL_RESOURCE_GROUP_NAME);
+		// Create the 'Autodetect' group (only used for temp storage)
+		createResourceGroup(AUTODETECT_RESOURCE_GROUP_NAME);
+        // default world group to the default group
+        mWorldGroupName = DEFAULT_RESOURCE_GROUP_NAME;
+    }
+    //-----------------------------------------------------------------------
+    ResourceGroupManager::~ResourceGroupManager()
+    {
+        // delete all resource groups
+        ResourceGroupMap::iterator i, iend;
+        iend = mResourceGroupMap.end();
+        for (i = mResourceGroupMap.begin(); i != iend; ++i)
+        {
+			deleteGroup(i->second);
+        }
+        mResourceGroupMap.clear();
+    }
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::createResourceGroup(const String& name)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+
+		LogManager::getSingleton().logMessage("Creating resource group " + name);
+        if (getResourceGroup(name))
+        {
+            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, 
+                "Resource group with name '" + name + "' already exists!", 
+                "ResourceGroupManager::createResourceGroup");
+        }
+        ResourceGroup* grp = new ResourceGroup();
+		grp->initialised = false;
+        grp->name = name;
+        grp->worldGeometrySceneManager = 0;
+        mResourceGroupMap.insert(
+            ResourceGroupMap::value_type(name, grp));
+    }
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::initialiseResourceGroup(const String& name)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+		LogManager::getSingleton().logMessage("Initialising resource group " + name);
+		ResourceGroup* grp = getResourceGroup(name);
+		if (!grp)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Cannot find a group named " + name, 
+				"ResourceGroupManager::parseResourceGroupScripts");
+		}
+		OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+
+		if (!grp->initialised)
+		{
+			// Set current group
+			parseResourceGroupScripts(grp);
+			mCurrentGroup = grp;
+			createDeclaredResources(grp);
+			grp->initialised = true;
+
+			// Reset current group
+			mCurrentGroup = 0;
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::initialiseAllResourceGroups(void)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		// Intialise all declared resource groups
+		ResourceGroupMap::iterator i, iend;
+		iend = mResourceGroupMap.end();
+		for (i = mResourceGroupMap.begin(); i != iend; ++i)
+		{
+			ResourceGroup* grp = i->second;
+			OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+			if (!grp->initialised)
+			{
+				// Set current group
+				mCurrentGroup = grp;
+				parseResourceGroupScripts(grp);
+				createDeclaredResources(grp);
+				grp->initialised = true;
+				// Reset current group
+				mCurrentGroup = 0;
+			}
+		}
+	}
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::loadResourceGroup(const String& name, 
+		bool loadMainResources, bool loadWorldGeom)
+    {
+		// Can only bulk-load one group at a time (reasonable limitation I think)
+		OGRE_LOCK_AUTO_MUTEX
+
+		StringUtil::StrStreamType str;
+		str << "Loading resource group '" << name << "' - Resources: "
+			<< loadMainResources << " World Geometry: " << loadWorldGeom;
+		LogManager::getSingleton().logMessage(str.str());
+		// load all created resources
+		ResourceGroup* grp = getResourceGroup(name);
+		if (!grp)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Cannot find a group named " + name, 
+				"ResourceGroupManager::loadResourceGroup");
+		}
+
+		OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex 
+		// Set current group
+		mCurrentGroup = grp;
+
+		// Count up resources for starting event
+		ResourceGroup::LoadResourceOrderMap::iterator oi;
+		size_t resourceCount = 0;
+		if (loadMainResources)
+		{
+			for (oi = grp->loadResourceOrderMap.begin(); oi != grp->loadResourceOrderMap.end(); ++oi)
+			{
+				resourceCount += oi->second->size();
+			}
+		}
+        // Estimate world geometry size
+        if (grp->worldGeometrySceneManager && loadWorldGeom)
+        {
+            resourceCount += 
+				grp->worldGeometrySceneManager->estimateWorldGeometry(
+					grp->worldGeometry);
+        }
+
+		fireResourceGroupLoadStarted(name, resourceCount);
+
+		// Now load for real
+		if (loadMainResources)
+		{
+			for (oi = grp->loadResourceOrderMap.begin(); 
+				oi != grp->loadResourceOrderMap.end(); ++oi)
+			{
+				size_t n = 0;
+				for (LoadUnloadResourceList::iterator l = oi->second->begin();
+					l != oi->second->end(); ++l, ++n)
+				{
+					ResourcePtr res = *l;
+
+					// Fire resource events no matter whether resource is already
+					// loaded or not. This ensures that the number of callbacks
+					// matches the number originally estimated, which is important
+					// for progress bars.
+					fireResourceStarted(res);
+
+					// If loading one of these resources cascade-loads another resource, 
+					// the list will get longer! But these should be loaded immediately
+					// Call load regardless, already loaded resources will be skipped
+					res->load();
+
+					// Did the resource change group? if so, our iterator will have
+					// been invalidated
+					if (res->getGroup() != name)
+					{
+						l = oi->second->begin();
+						std::advance(l, n);
+					}
+
+					fireResourceEnded();
+				}
+			}
+		}
+        // Load World Geometry
+        if (grp->worldGeometrySceneManager && loadWorldGeom)
+        {
+            grp->worldGeometrySceneManager->setWorldGeometry(
+                grp->worldGeometry);
+        }
+		fireResourceGroupLoadEnded(name);
+
+		// reset current group
+		mCurrentGroup = 0;
+		
+		LogManager::getSingleton().logMessage("Finished loading resource group " + name);
+    }
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::unloadResourceGroup(const String& name, bool reloadableOnly)
+    {
+		// Can only bulk-unload one group at a time (reasonable limitation I think)
+		OGRE_LOCK_AUTO_MUTEX
+
+		LogManager::getSingleton().logMessage("Unloading resource group " + name);
+		ResourceGroup* grp = getResourceGroup(name);
+		if (!grp)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Cannot find a group named " + name, 
+				"ResourceGroupManager::unloadResourceGroup");
+		}
+		// Set current group
+		mCurrentGroup = grp;
+		OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex 
+
+		// Count up resources for starting event
+		ResourceGroup::LoadResourceOrderMap::reverse_iterator oi;
+		// unload in reverse order
+		for (oi = grp->loadResourceOrderMap.rbegin(); oi != grp->loadResourceOrderMap.rend(); ++oi)
+		{
+			for (LoadUnloadResourceList::iterator l = oi->second->begin();
+				l != oi->second->end(); ++l)
+			{
+				Resource* resource = l->get();
+				if (!reloadableOnly || resource->isReloadable())
+				{
+					resource->unload();
+				}
+			}
+		}
+
+		// reset current group
+		mCurrentGroup = 0;
+		LogManager::getSingleton().logMessage("Finished unloading resource group " + name);
+    }
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::unloadUnreferencedResourcesInGroup(
+		const String& name, bool reloadableOnly )
+	{
+		// Can only bulk-unload one group at a time (reasonable limitation I think)
+		OGRE_LOCK_AUTO_MUTEX
+
+		LogManager::getSingleton().logMessage(
+			"Unloading unused resources in resource group " + name);
+		ResourceGroup* grp = getResourceGroup(name);
+		if (!grp)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Cannot find a group named " + name, 
+				"ResourceGroupManager::unloadUnreferencedResourcesInGroup");
+		}
+		// Set current group
+		mCurrentGroup = grp;
+
+		ResourceGroup::LoadResourceOrderMap::reverse_iterator oi;
+		// unload in reverse order
+		for (oi = grp->loadResourceOrderMap.rbegin(); oi != grp->loadResourceOrderMap.rend(); ++oi)
+		{
+			for (LoadUnloadResourceList::iterator l = oi->second->begin();
+				l != oi->second->end(); ++l)
+			{
+				// A use count of 3 means that only RGM and RM have references
+				// RGM has one (this one) and RM has 2 (by name and by handle)
+				if (l->useCount() == RESOURCE_SYSTEM_NUM_REFERENCE_COUNTS)
+				{
+					Resource* resource = l->get();
+					if (!reloadableOnly || resource->isReloadable())
+					{
+						resource->unload();
+					}
+				}
+			}
+		}
+
+		// reset current group
+		mCurrentGroup = 0;
+		LogManager::getSingleton().logMessage(
+			"Finished unloading unused resources in resource group " + name);
+	}
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::clearResourceGroup(const String& name)
+	{
+		// Can only bulk-clear one group at a time (reasonable limitation I think)
+		OGRE_LOCK_AUTO_MUTEX
+
+			LogManager::getSingleton().logMessage("Clearing resource group " + name);
+		ResourceGroup* grp = getResourceGroup(name);
+		if (!grp)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Cannot find a group named " + name, 
+				"ResourceGroupManager::clearResourceGroup");
+		}
+		// set current group
+		mCurrentGroup = grp;
+		dropGroupContents(grp);
+		// clear initialised flag
+		grp->initialised = false;
+		// reset current group
+		mCurrentGroup = 0;
+		LogManager::getSingleton().logMessage("Finished clearing resource group " + name);
+	}
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::destroyResourceGroup(const String& name)
+    {
+		// Can only bulk-destroy one group at a time (reasonable limitation I think)
+		OGRE_LOCK_AUTO_MUTEX
+
+		LogManager::getSingleton().logMessage("Destroying resource group " + name);
+		ResourceGroup* grp = getResourceGroup(name);
+		if (!grp)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Cannot find a group named " + name, 
+				"ResourceGroupManager::destroyResourceGroup");
+		}
+		// set current group
+		mCurrentGroup = grp;
+        unloadResourceGroup(name, false); // will throw an exception if name not valid
+		dropGroupContents(grp);
+		deleteGroup(grp);
+        mResourceGroupMap.erase(mResourceGroupMap.find(name));
+		// reset current group
+		mCurrentGroup = 0;
+    }
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::addResourceLocation(const String& name, 
+        const String& locType, const String& resGroup, bool recursive)
+    {
+        ResourceGroup* grp = getResourceGroup(resGroup);
+        if (!grp)
+        {
+            createResourceGroup(resGroup);
+            grp = getResourceGroup(resGroup);
+        }
+
+		OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+
+        // Get archive
+        Archive* pArch = ArchiveManager::getSingleton().load( name, locType );
+        // Add to location list
+		ResourceLocation* loc = new ResourceLocation();
+		loc->archive = pArch;
+		loc->recursive = recursive;
+        grp->locationList.push_back(loc);
+        // Index resources
+        StringVectorPtr vec = pArch->find("*", recursive);
+        for( StringVector::iterator it = vec->begin(); it != vec->end(); ++it )
+        {
+			// Index under full name, case sensitive
+            grp->resourceIndexCaseSensitive[(*it)] = pArch;
+            if (!pArch->isCaseSensitive())
+            {
+	            // Index under lower case name too for case insensitive match
+    	        String indexName = (*it);
+                StringUtil::toLowerCase(indexName);
+	            grp->resourceIndexCaseInsensitive[indexName] = pArch;
+            }
+        }
+		
+		StringUtil::StrStreamType msg;
+		msg << "Added resource location '" << name << "' of type '" << locType
+			<< "' to resource group '" << resGroup << "'";
+		if (recursive)
+			msg << " with recursive option";
+		LogManager::getSingleton().logMessage(msg.str());
+
+    }
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::removeResourceLocation(const String& name, 
+        const String& resGroup)
+    {
+		ResourceGroup* grp = getResourceGroup(resGroup);
+		if (!grp)
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Cannot locate a resource group called '" + resGroup + "'", 
+                "ResourceGroupManager::addResourceLocation");
+        }
+
+		OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+
+        // Remove from location list
+		LocationList::iterator li, liend;
+		liend = grp->locationList.end();
+		for (li = grp->locationList.begin(); li != liend; ++li)
+		{
+			Archive* pArch = (*li)->archive;
+			if (pArch->getName() == name)
+			{
+				// Delete indexes
+				ResourceLocationIndex::iterator rit, ritend;
+				ritend = grp->resourceIndexCaseInsensitive.end();
+				for (rit = grp->resourceIndexCaseInsensitive.begin(); rit != ritend;)
+				{
+					if (rit->second == pArch)
+					{
+						ResourceLocationIndex::iterator del = rit++;
+						grp->resourceIndexCaseInsensitive.erase(del);
+					}
+					else
+					{
+						++rit;
+					}
+				}
+                ritend = grp->resourceIndexCaseSensitive.end();
+                for (rit = grp->resourceIndexCaseSensitive.begin(); rit != ritend;)
+                {
+                    if (rit->second == pArch)
+                    {
+                        ResourceLocationIndex::iterator del = rit++;
+                        grp->resourceIndexCaseSensitive.erase(del);
+                    }
+                    else
+                    {
+                        ++rit;
+                    }
+                }
+				// Erase list entry
+				delete *li;
+				grp->locationList.erase(li);
+				break;
+			}
+
+		}
+
+		LogManager::getSingleton().logMessage("Removed resource location " + name);
+
+
+    }
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::declareResource(const String& name, 
+        const String& resourceType, const String& groupName,
+		const NameValuePairList& loadParameters)
+    {
+        declareResource(name, resourceType, groupName, 0, loadParameters);
+    }
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::declareResource(const String& name, 
+        const String& resourceType, const String& groupName,
+        ManualResourceLoader* loader,
+        const NameValuePairList& loadParameters)
+    {
+		ResourceGroup* grp = getResourceGroup(groupName);
+		if (!grp)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Cannot find a group named " + groupName, 
+				"ResourceGroupManager::declareResource");
+		}
+		
+		OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+
+		ResourceDeclaration dcl;
+		dcl.loader = loader;
+		dcl.parameters = loadParameters;
+		dcl.resourceName = name;
+		dcl.resourceType = resourceType;
+		grp->resourceDeclarations.push_back(dcl);
+    }
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::undeclareResource(const String& name, 
+		const String& groupName)
+    {
+		ResourceGroup* grp = getResourceGroup(groupName);
+		if (!grp)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Cannot find a group named " + groupName, 
+				"ResourceGroupManager::undeclareResource");
+		}
+
+		OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+
+		for (ResourceDeclarationList::iterator i = grp->resourceDeclarations.begin();
+			i != grp->resourceDeclarations.end(); ++i)
+		{
+			if (i->resourceName == name)
+			{
+				grp->resourceDeclarations.erase(i);
+				break;
+			}
+		}
+    }
+    //-----------------------------------------------------------------------
+    DataStreamPtr ResourceGroupManager::openResource(
+        const String& resourceName, const String& groupName, 
+		bool searchGroupsIfNotFound, Resource* resourceBeingLoaded)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+		// Try to find in resource index first
+		ResourceGroup* grp = getResourceGroup(groupName);
+		if (!grp)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Cannot locate a resource group called '" + groupName + 
+				"' for resource '" + resourceName + "'" , 
+				"ResourceGroupManager::openResource");
+		}
+
+		OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+
+		Archive* pArch = 0;
+		ResourceLocationIndex::iterator rit = grp->resourceIndexCaseSensitive.find(resourceName);
+		if (rit != grp->resourceIndexCaseSensitive.end())
+		{
+			// Found in the index
+			pArch = rit->second;
+			return pArch->open(resourceName);
+		}
+        else 
+        {
+            // try case insensitive
+            String lcResourceName = resourceName;
+            StringUtil::toLowerCase(lcResourceName);
+            rit = grp->resourceIndexCaseInsensitive.find(lcResourceName);
+            if (rit != grp->resourceIndexCaseInsensitive.end())
+            {
+                // Found in the index
+                pArch = rit->second;
+                return pArch->open(resourceName);
+            }
+		    else
+		    {
+			    // Search the hard way
+			    LocationList::iterator li, liend;
+			    liend = grp->locationList.end();
+			    for (li = grp->locationList.begin(); li != liend; ++li)
+			    {
+				    Archive* arch = (*li)->archive;
+                    if (arch->exists(resourceName))
+				    {
+                        DataStreamPtr ptr = arch->open(resourceName);
+					    return ptr;
+				    }
+			    }
+		    }
+        }
+
+		
+		// Not found
+		if (searchGroupsIfNotFound)
+		{
+			ResourceGroup* grp = findGroupContainingResourceImpl(resourceName); 
+			if (grp)
+			{
+				if (resourceBeingLoaded)
+				{
+					resourceBeingLoaded->changeGroupOwnership(grp->name);
+				}
+				return openResource(resourceName, grp->name, false);
+			}
+			else
+			{
+				OGRE_EXCEPT(Exception::ERR_FILE_NOT_FOUND, 
+					"Cannot locate resource " + resourceName + 
+					" in resource group " + groupName + " or any other group.", 
+					"ResourceGroupManager::openResource");
+			}
+		}
+		OGRE_EXCEPT(Exception::ERR_FILE_NOT_FOUND, "Cannot locate resource " + 
+			resourceName + " in resource group " + groupName + ".", 
+			"ResourceGroupManager::openResource");
+
+		// Keep compiler happy
+		return DataStreamPtr();
+
+
+    }
+    //-----------------------------------------------------------------------
+    DataStreamListPtr ResourceGroupManager::openResources(
+        const String& pattern, const String& groupName)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+		ResourceGroup* grp = getResourceGroup(groupName);
+		if (!grp)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Cannot locate a resource group called '" + groupName + "'", 
+				"ResourceGroupManager::openResources");
+		}
+
+		OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+
+		// Iterate through all the archives and build up a combined list of
+		// streams
+		DataStreamListPtr ret = DataStreamListPtr(new DataStreamList());
+
+		LocationList::iterator li, liend;
+		liend = grp->locationList.end();
+		for (li = grp->locationList.begin(); li != liend; ++li)
+		{
+			Archive* arch = (*li)->archive;
+			// Find all the names based on whether this archive is recursive
+			StringVectorPtr names = arch->find(pattern, (*li)->recursive);
+
+			// Iterate over the names and load a stream for each
+			for (StringVector::iterator ni = names->begin(); ni != names->end(); ++ni)
+			{
+				DataStreamPtr ptr = arch->open(*ni);
+				if (!ptr.isNull())
+				{
+					ret->push_back(ptr);
+				}
+			}
+		}
+		return ret;
+		
+    }
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::addResourceGroupListener(ResourceGroupListener* l)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+
+		mResourceGroupListenerList.push_back(l);
+    }
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::removeResourceGroupListener(ResourceGroupListener* l)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+
+		for (ResourceGroupListenerList::iterator i = mResourceGroupListenerList.begin();
+			i != mResourceGroupListenerList.end(); ++i)
+		{
+			if (*i == l)
+			{
+				mResourceGroupListenerList.erase(i);
+				break;
+			}
+		}
+    }
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::_registerResourceManager(
+        const String& resourceType, ResourceManager* rm)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+
+		LogManager::getSingleton().logMessage(
+			"Registering ResourceManager for type " + resourceType);
+		mResourceManagerMap[resourceType] = rm;
+    }
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::_unregisterResourceManager(
+        const String& resourceType)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+
+		LogManager::getSingleton().logMessage(
+			"Unregistering ResourceManager for type " + resourceType);
+		
+		ResourceManagerMap::iterator i = mResourceManagerMap.find(resourceType);
+		if (i != mResourceManagerMap.end())
+		{
+			mResourceManagerMap.erase(i);
+		}
+    }
+	//-----------------------------------------------------------------------
+    void ResourceGroupManager::_registerScriptLoader(ScriptLoader* su)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		mScriptLoaderOrderMap.insert(
+			ScriptLoaderOrderMap::value_type(su->getLoadingOrder(), su));
+	}
+	//-----------------------------------------------------------------------
+    void ResourceGroupManager::_unregisterScriptLoader(ScriptLoader* su)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		Real order = su->getLoadingOrder();
+		ScriptLoaderOrderMap::iterator oi = mScriptLoaderOrderMap.find(order);
+		while (oi != mScriptLoaderOrderMap.end() && oi->first == order)
+		{
+			if (oi->second == su)
+			{
+				// erase does not invalidate on multimap, except current
+				ScriptLoaderOrderMap::iterator del = oi++;
+				mScriptLoaderOrderMap.erase(del);
+			}
+			else
+			{
+				++oi;
+			}
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::parseResourceGroupScripts(ResourceGroup* grp)
+	{
+
+		LogManager::getSingleton().logMessage(
+			"Parsing scripts for resource group " + grp->name);
+
+		// Count up the number of scripts we have to parse
+        typedef std::list<FileInfoListPtr> FileListList;
+        typedef SharedPtr<FileListList> FileListListPtr;
+        typedef std::pair<ScriptLoader*, FileListListPtr> LoaderFileListPair;
+        typedef std::list<LoaderFileListPair> ScriptLoaderFileList;
+        ScriptLoaderFileList scriptLoaderFileList;
+		size_t scriptCount = 0;
+		// Iterate over script users in loading order and get streams
+		ScriptLoaderOrderMap::iterator oi;
+		for (oi = mScriptLoaderOrderMap.begin();
+			oi != mScriptLoaderOrderMap.end(); ++oi)
+		{
+			ScriptLoader* su = oi->second;
+            FileListListPtr fileListList(new FileListList);
+
+			// Get all the patterns and search them
+			const StringVector& patterns = su->getScriptPatterns();
+			for (StringVector::const_iterator p = patterns.begin(); p != patterns.end(); ++p)
+			{
+				FileInfoListPtr fileList = findResourceFileInfo(grp->name, *p);
+				scriptCount += fileList->size();
+				fileListList->push_back(fileList);
+			}
+            scriptLoaderFileList.push_back(
+                LoaderFileListPair(su, fileListList));
+		}
+		// Fire scripting event
+		fireResourceGroupScriptingStarted(grp->name, scriptCount);
+
+		// Iterate over scripts and parse
+		// Note we respect original ordering
+        for (ScriptLoaderFileList::iterator slfli = scriptLoaderFileList.begin();
+            slfli != scriptLoaderFileList.end(); ++slfli)
+        {
+			ScriptLoader* su = slfli->first;
+            // Iterate over each list
+            for (FileListList::iterator flli = slfli->second->begin(); flli != slfli->second->end(); ++flli)
+            {
+			    // Iterate over each item in the list
+			    for (FileInfoList::iterator fii = (*flli)->begin(); fii != (*flli)->end(); ++fii)
+			    {
+                    LogManager::getSingleton().logMessage(
+                        "Parsing script " + fii->filename);
+                    fireScriptStarted(fii->filename);
+                    {
+                        DataStreamPtr stream = fii->archive->open(fii->filename);
+                        if (!stream.isNull())
+                        {
+                            su->parseScript(stream, grp->name);
+                        }
+                    }
+				    fireScriptEnded(fii->filename);
+			    }
+            }
+		}
+
+		fireResourceGroupScriptingEnded(grp->name);
+		LogManager::getSingleton().logMessage(
+			"Finished parsing scripts for resource group " + grp->name);
+	}
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::createDeclaredResources(ResourceGroup* grp)
+	{
+
+		for (ResourceDeclarationList::iterator i = grp->resourceDeclarations.begin();
+			i != grp->resourceDeclarations.end(); ++i)
+		{
+			ResourceDeclaration& dcl = *i;
+			// Retrieve the appropriate manager
+			ResourceManager* mgr = _getResourceManager(dcl.resourceType);
+			// Create the resource
+			ResourcePtr res = mgr->create(dcl.resourceName, grp->name,
+                dcl.loader != 0, dcl.loader, &dcl.parameters);
+			// Add resource to load list
+			ResourceGroup::LoadResourceOrderMap::iterator li = 
+				grp->loadResourceOrderMap.find(mgr->getLoadingOrder());
+			LoadUnloadResourceList* loadList;
+			if (li == grp->loadResourceOrderMap.end())
+			{
+				loadList = new LoadUnloadResourceList();
+				grp->loadResourceOrderMap[mgr->getLoadingOrder()] = loadList;
+			}
+			else
+			{
+				loadList = li->second;
+			}
+			loadList->push_back(res);
+
+		}
+
+	}
+    //-----------------------------------------------------------------------
+	void ResourceGroupManager::_notifyResourceCreated(ResourcePtr& res)
+	{
+		if (mCurrentGroup && res->getGroup() == mCurrentGroup->name)
+		{
+			// Use current group (batch loading)
+			addCreatedResource(res, *mCurrentGroup);
+		}
+		else
+		{
+			// Find group
+			ResourceGroup* grp = getResourceGroup(res->getGroup());
+			if (grp)
+			{
+				addCreatedResource(res, *grp);
+			}
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::_notifyResourceRemoved(ResourcePtr& res)
+	{
+		if (mCurrentGroup)
+		{
+			// Do nothing - we're batch unloading so list will be cleared
+		}
+		else
+		{
+			// Find group
+			ResourceGroup* grp = getResourceGroup(res->getGroup());
+			if (grp)
+			{
+				OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+				ResourceGroup::LoadResourceOrderMap::iterator i = 
+					grp->loadResourceOrderMap.find(
+						res->getCreator()->getLoadingOrder());
+				if (i != grp->loadResourceOrderMap.end())
+				{
+					// Iterate over the resource list and remove
+					LoadUnloadResourceList* resList = i->second;
+					for (LoadUnloadResourceList::iterator l = resList->begin();
+						l != resList->end(); ++ l)
+					{
+						if ((*l).getPointer() == res.getPointer())
+						{
+							// this is the one
+							resList->erase(l);
+							break;
+						}
+					}
+				}
+			}
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::_notifyResourceGroupChanged(const String& oldGroup, 
+		Resource* res)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+	
+		// New group
+		ResourceGroup* newGrp = getResourceGroup(res->getGroup());
+		// find old entry
+		ResourceGroupMap::iterator grpi = mResourceGroupMap.find(oldGroup);
+
+		assert(grpi != mResourceGroupMap.end());
+		ResourceGroup* grp = grpi->second;
+		Real order = res->getCreator()->getLoadingOrder();
+		ResourceGroup::LoadResourceOrderMap::iterator i = 
+			grp->loadResourceOrderMap.find(order);
+		assert(i != grp->loadResourceOrderMap.end());
+		LoadUnloadResourceList* loadList = i->second;
+		for (LoadUnloadResourceList::iterator l = loadList->begin(); 
+			l != loadList->end(); ++l)
+		{
+			if ((*l).getPointer() == res)
+			{
+				addCreatedResource(*l, *newGrp);
+				loadList->erase(l);
+				break;
+			}
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::_notifyAllResourcesRemoved(ResourceManager* manager)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		// Iterate over all groups
+		for (ResourceGroupMap::iterator grpi = mResourceGroupMap.begin();
+			grpi != mResourceGroupMap.end(); ++grpi)
+		{
+			OGRE_LOCK_MUTEX(grpi->second->OGRE_AUTO_MUTEX_NAME)
+			// Iterate over all priorities
+			for (ResourceGroup::LoadResourceOrderMap::iterator oi = grpi->second->loadResourceOrderMap.begin();
+				oi != grpi->second->loadResourceOrderMap.end(); ++oi)
+			{
+				// Iterate over all resources
+				for (LoadUnloadResourceList::iterator l = oi->second->begin();
+					l != oi->second->end(); )
+				{
+					if ((*l)->getCreator() == manager)
+					{
+						// Increment first since iterator will be invalidated
+						LoadUnloadResourceList::iterator del = l++;
+						oi->second->erase(del);
+					}
+					else
+					{
+						++l;
+					}
+				}
+			}
+
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::addCreatedResource(ResourcePtr& res, ResourceGroup& grp)
+	{
+		OGRE_LOCK_MUTEX(grp.OGRE_AUTO_MUTEX_NAME)
+		Real order = res->getCreator()->getLoadingOrder();
+
+		ResourceGroup::LoadResourceOrderMap::iterator i = grp.loadResourceOrderMap.find(order);
+		LoadUnloadResourceList* loadList;
+		if (i == grp.loadResourceOrderMap.end())
+		{
+			loadList = new LoadUnloadResourceList();
+			grp.loadResourceOrderMap[order] = loadList;
+		}
+		else
+		{
+			loadList = i->second;
+		}
+		loadList->push_back(res);
+	}
+	//-----------------------------------------------------------------------
+	ResourceGroupManager::ResourceGroup* ResourceGroupManager::getResourceGroup(const String& name)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		ResourceGroupMap::iterator i = mResourceGroupMap.find(name);
+		if (i != mResourceGroupMap.end())
+		{
+			return i->second;
+		}
+		return 0;
+
+	}
+    //-----------------------------------------------------------------------
+    ResourceManager* ResourceGroupManager::_getResourceManager(const String& resourceType) 
+    {
+		OGRE_LOCK_AUTO_MUTEX
+
+        ResourceManagerMap::iterator i = mResourceManagerMap.find(resourceType);
+        if (i == mResourceManagerMap.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Cannot locate resource manager for resource type '" +
+                resourceType + "'", "ResourceGroupManager::_getResourceManager");
+        }
+        return i->second;
+
+    }
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::dropGroupContents(ResourceGroup* grp)
+	{
+		OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME)
+
+		bool groupSet = false;
+		if (!mCurrentGroup)
+		{
+			// Set current group to indicate ignoring of notifications
+			mCurrentGroup = grp;
+			groupSet = true;
+		}
+		// delete all the load list entries
+		ResourceGroup::LoadResourceOrderMap::iterator j, jend;
+		jend = grp->loadResourceOrderMap.end();
+		for (j = grp->loadResourceOrderMap.begin(); j != jend; ++j)
+		{
+			// Iterate over resources
+			for (LoadUnloadResourceList::iterator k = j->second->begin();
+				k != j->second->end(); ++k)
+			{
+				(*k)->getCreator()->remove((*k)->getHandle());
+			}
+			delete j->second;
+		}
+        grp->loadResourceOrderMap.clear();
+
+		if (groupSet)
+		{
+			mCurrentGroup = 0;
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::deleteGroup(ResourceGroup* grp)
+	{
+        {
+		    OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME)
+		    // delete all the load list entries
+		    ResourceGroup::LoadResourceOrderMap::iterator j, jend;
+		    jend = grp->loadResourceOrderMap.end();
+		    for (j = grp->loadResourceOrderMap.begin(); j != jend; ++j)
+		    {
+			    // Don't iterate over resources to drop with ResourceManager
+			    // Assume this is being done anyway since this is a shutdown method
+			    delete j->second;
+		    }
+		    // Drop location list
+		    for (LocationList::iterator ll = grp->locationList.begin();
+			    ll != grp->locationList.end(); ++ll)
+		    {
+			    delete *ll;
+		    }
+        }
+
+		// delete ResourceGroup
+		delete grp;
+	}
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::fireResourceGroupScriptingStarted(const String& groupName, size_t scriptCount)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+		for (ResourceGroupListenerList::iterator l = mResourceGroupListenerList.begin();
+			l != mResourceGroupListenerList.end(); ++l)
+		{
+			(*l)->resourceGroupScriptingStarted(groupName, scriptCount);
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::fireScriptStarted(const String& scriptName)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+		for (ResourceGroupListenerList::iterator l = mResourceGroupListenerList.begin();
+			l != mResourceGroupListenerList.end(); ++l)
+		{
+			(*l)->scriptParseStarted(scriptName);
+		}
+	}
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::fireScriptEnded(const String& scriptName)
+    {
+        OGRE_LOCK_AUTO_MUTEX
+            for (ResourceGroupListenerList::iterator l = mResourceGroupListenerList.begin();
+                l != mResourceGroupListenerList.end(); ++l)
+            {
+                (*l)->scriptParseEnded(scriptName);
+            }
+    }
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::fireResourceGroupScriptingEnded(const String& groupName)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+		for (ResourceGroupListenerList::iterator l = mResourceGroupListenerList.begin();
+			l != mResourceGroupListenerList.end(); ++l)
+		{
+			(*l)->resourceGroupScriptingEnded(groupName);
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::fireResourceGroupLoadStarted(const String& groupName, size_t resourceCount)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+		for (ResourceGroupListenerList::iterator l = mResourceGroupListenerList.begin();
+			l != mResourceGroupListenerList.end(); ++l)
+		{
+			(*l)->resourceGroupLoadStarted(groupName, resourceCount);
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::fireResourceStarted(const ResourcePtr& resource)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+		for (ResourceGroupListenerList::iterator l = mResourceGroupListenerList.begin();
+			l != mResourceGroupListenerList.end(); ++l)
+		{
+			(*l)->resourceLoadStarted(resource);
+		}
+	}
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::fireResourceEnded(void)
+    {
+        OGRE_LOCK_AUTO_MUTEX
+            for (ResourceGroupListenerList::iterator l = mResourceGroupListenerList.begin();
+                l != mResourceGroupListenerList.end(); ++l)
+            {
+                (*l)->resourceLoadEnded();
+            }
+    }
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::_notifyWorldGeometryStageStarted(const String& desc)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+		for (ResourceGroupListenerList::iterator l = mResourceGroupListenerList.begin();
+			l != mResourceGroupListenerList.end(); ++l)
+		{
+			(*l)->worldGeometryStageStarted(desc);
+		}
+    }
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::_notifyWorldGeometryStageEnded(void)
+    {
+        OGRE_LOCK_AUTO_MUTEX
+            for (ResourceGroupListenerList::iterator l = mResourceGroupListenerList.begin();
+                l != mResourceGroupListenerList.end(); ++l)
+            {
+                (*l)->worldGeometryStageEnded();
+            }
+    }
+	//-----------------------------------------------------------------------
+	void ResourceGroupManager::fireResourceGroupLoadEnded(const String& groupName)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+		for (ResourceGroupListenerList::iterator l = mResourceGroupListenerList.begin();
+			l != mResourceGroupListenerList.end(); ++l)
+		{
+			(*l)->resourceGroupLoadEnded(groupName);
+		}
+	}
+	//-----------------------------------------------------------------------
+    void ResourceGroupManager::shutdownAll(void)
+    {
+        OGRE_LOCK_AUTO_MUTEX
+
+        ResourceManagerMap::iterator i, iend;
+        iend = mResourceManagerMap.end();
+        for (i = mResourceManagerMap.begin(); i != iend; ++i)
+        {
+            i->second->removeAll();
+        }
+    }
+    //-----------------------------------------------------------------------
+    StringVectorPtr ResourceGroupManager::listResourceNames(const String& groupName, bool dirs)
+    {
+        OGRE_LOCK_AUTO_MUTEX
+        StringVectorPtr vec(new StringVector());
+
+        // Try to find in resource index first
+        ResourceGroup* grp = getResourceGroup(groupName);
+        if (!grp)
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Cannot locate a resource group called '" + groupName + "'", 
+                "ResourceGroupManager::listResourceNames");
+        }
+
+        OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+
+        // Iterate over the archives
+        LocationList::iterator i, iend;
+        iend = grp->locationList.end();
+        for (i = grp->locationList.begin(); i != iend; ++i)
+        {
+            StringVectorPtr lst = (*i)->archive->list((*i)->recursive, dirs);
+            vec->insert(vec->end(), lst->begin(), lst->end());
+        }
+
+        return vec;
+
+
+    }
+    //-----------------------------------------------------------------------
+    FileInfoListPtr ResourceGroupManager::listResourceFileInfo(const String& groupName, bool dirs)
+    {
+        OGRE_LOCK_AUTO_MUTEX
+        FileInfoListPtr vec(new FileInfoList());
+
+        // Try to find in resource index first
+        ResourceGroup* grp = getResourceGroup(groupName);
+        if (!grp)
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Cannot locate a resource group called '" + groupName + "'", 
+                "ResourceGroupManager::listResourceFileInfo");
+        }
+
+        OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+
+        // Iterate over the archives
+        LocationList::iterator i, iend;
+        iend = grp->locationList.end();
+        for (i = grp->locationList.begin(); i != iend; ++i)
+        {
+            FileInfoListPtr lst = (*i)->archive->listFileInfo((*i)->recursive, dirs);
+            vec->insert(vec->end(), lst->begin(), lst->end());
+        }
+
+        return vec;
+
+    }
+    //-----------------------------------------------------------------------
+    StringVectorPtr ResourceGroupManager::findResourceNames(const String& groupName, 
+        const String& pattern, bool dirs)
+    {
+        OGRE_LOCK_AUTO_MUTEX
+        StringVectorPtr vec(new StringVector());
+
+        // Try to find in resource index first
+        ResourceGroup* grp = getResourceGroup(groupName);
+        if (!grp)
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Cannot locate a resource group called '" + groupName + "'", 
+                "ResourceGroupManager::findResourceNames");
+        }
+
+        OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+
+            // Iterate over the archives
+            LocationList::iterator i, iend;
+        iend = grp->locationList.end();
+        for (i = grp->locationList.begin(); i != iend; ++i)
+        {
+            StringVectorPtr lst = (*i)->archive->find(pattern, (*i)->recursive, dirs);
+            vec->insert(vec->end(), lst->begin(), lst->end());
+        }
+
+        return vec;
+    }
+    //-----------------------------------------------------------------------
+    FileInfoListPtr ResourceGroupManager::findResourceFileInfo(const String& groupName, 
+        const String& pattern, bool dirs)
+    {
+        OGRE_LOCK_AUTO_MUTEX
+        FileInfoListPtr vec(new FileInfoList());
+
+        // Try to find in resource index first
+        ResourceGroup* grp = getResourceGroup(groupName);
+        if (!grp)
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Cannot locate a resource group called '" + groupName + "'", 
+                "ResourceGroupManager::findResourceFileInfo");
+        }
+
+        OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+
+            // Iterate over the archives
+            LocationList::iterator i, iend;
+        iend = grp->locationList.end();
+        for (i = grp->locationList.begin(); i != iend; ++i)
+        {
+            FileInfoListPtr lst = (*i)->archive->findFileInfo(pattern, (*i)->recursive, dirs);
+            vec->insert(vec->end(), lst->begin(), lst->end());
+        }
+
+        return vec;
+    }
+    //-----------------------------------------------------------------------
+	bool ResourceGroupManager::resourceExists(const String& groupName, const String& resourceName)
+	{
+        OGRE_LOCK_AUTO_MUTEX
+
+		// Try to find in resource index first
+        ResourceGroup* grp = getResourceGroup(groupName);
+        if (!grp)
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Cannot locate a resource group called '" + groupName + "'", 
+                "ResourceGroupManager::resourceExists");
+        }
+
+		return resourceExists(grp, resourceName);
+	}
+    //-----------------------------------------------------------------------
+	bool ResourceGroupManager::resourceExists(ResourceGroup* grp, const String& resourceName)
+	{
+
+		OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+
+		// Try indexes first
+		ResourceLocationIndex::iterator rit = grp->resourceIndexCaseSensitive.find(resourceName);
+		if (rit != grp->resourceIndexCaseSensitive.end())
+		{
+			// Found in the index
+			return true;
+		}
+        else 
+        {
+            // try case insensitive
+            String lcResourceName = resourceName;
+            StringUtil::toLowerCase(lcResourceName);
+            rit = grp->resourceIndexCaseInsensitive.find(lcResourceName);
+            if (rit != grp->resourceIndexCaseInsensitive.end())
+            {
+                // Found in the index
+                return true;
+            }
+		    else
+		    {
+			    // Search the hard way
+			    LocationList::iterator li, liend;
+			    liend = grp->locationList.end();
+			    for (li = grp->locationList.begin(); li != liend; ++li)
+			    {
+				    Archive* arch = (*li)->archive;
+                    if (arch->exists(resourceName))
+				    {
+						return true;
+				    }
+			    }
+		    }
+        }
+
+		return false;
+
+	}
+    //-----------------------------------------------------------------------
+	ResourceGroupManager::ResourceGroup* 
+	ResourceGroupManager::findGroupContainingResourceImpl(const String& filename)
+	{
+        OGRE_LOCK_AUTO_MUTEX
+
+			// Iterate over resource groups and find
+		for (ResourceGroupMap::iterator i = mResourceGroupMap.begin();
+			i != mResourceGroupMap.end(); ++i)
+		{
+	        ResourceGroup* grp = i->second;
+
+			OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+				
+			if (resourceExists(grp, filename))
+				return grp;
+		}
+		// Not found
+		return 0;
+	}
+    //-----------------------------------------------------------------------
+	const String& ResourceGroupManager::findGroupContainingResource(const String& filename)
+	{
+		ResourceGroup* grp = findGroupContainingResourceImpl(filename);
+		if (!grp)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+				"Unable to derive resource group for " + 
+				filename + " automatically since the resource was not "
+				"found.", 
+				"ResourceGroupManager::findGroupContainingResource");
+		}
+		return grp->name;
+	}
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::linkWorldGeometryToResourceGroup(const String& group, 
+        const String& worldGeometry, SceneManager* sceneManager)
+    {
+        OGRE_LOCK_AUTO_MUTEX
+        ResourceGroup* grp = getResourceGroup(group);
+        if (!grp)
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Cannot locate a resource group called '" + group + "'", 
+                "ResourceGroupManager::linkWorldGeometryToResourceGroup");
+        }
+
+        OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+
+        grp->worldGeometry = worldGeometry;
+        grp->worldGeometrySceneManager = sceneManager;
+    }
+    //-----------------------------------------------------------------------
+    void ResourceGroupManager::unlinkWorldGeometryFromResourceGroup(const String& group)
+    {
+        OGRE_LOCK_AUTO_MUTEX
+        ResourceGroup* grp = getResourceGroup(group);
+        if (!grp)
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Cannot locate a resource group called '" + group + "'", 
+                "ResourceGroupManager::unlinkWorldGeometryFromResourceGroup");
+        }
+
+		OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+        grp->worldGeometry = StringUtil::BLANK;
+        grp->worldGeometrySceneManager = 0;
+    }
+    //-----------------------------------------------------------------------
+	StringVector ResourceGroupManager::getResourceGroups(void)
+	{
+        OGRE_LOCK_AUTO_MUTEX
+		StringVector vec;
+		for (ResourceGroupMap::iterator i = mResourceGroupMap.begin();
+			i != mResourceGroupMap.end(); ++i)
+		{
+			vec.push_back(i->second->name);
+		}
+		return vec;
+	}
+    //-----------------------------------------------------------------------
+	ResourceGroupManager::ResourceDeclarationList 
+	ResourceGroupManager::getResourceDeclarationList(const String& group)
+	{
+        OGRE_LOCK_AUTO_MUTEX
+        ResourceGroup* grp = getResourceGroup(group);
+        if (!grp)
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Cannot locate a resource group called '" + group + "'", 
+                "ResourceGroupManager::getResourceDeclarationList");
+        }
+
+		OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME) // lock group mutex
+		return grp->resourceDeclarations;
+	}
+	//-----------------------------------------------------------------------
+	ScriptLoader::~ScriptLoader()
+	{
+	}
+
+
+}
Index: /OgreMain/src/OgreResourceManager.cpp
===================================================================
--- /OgreMain/src/OgreResourceManager.cpp	(revision 5)
+++ /OgreMain/src/OgreResourceManager.cpp	(revision 5)
@@ -0,0 +1,356 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreResourceManager.h"
+
+#include "OgreException.h"
+#include "OgreArchive.h"
+#include "OgreArchiveManager.h"
+#include "OgreStringVector.h"
+#include "OgreStringConverter.h"
+#include "OgreResourceGroupManager.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    ResourceManager::ResourceManager()
+		: mNextHandle(1), mMemoryUsage(0), mLoadOrder(0)
+    {
+        // Init memory limit & usage
+        mMemoryBudget = std::numeric_limits<unsigned long>::max();
+    }
+    //-----------------------------------------------------------------------
+    ResourceManager::~ResourceManager()
+    {
+        removeAll();
+    }
+	//-----------------------------------------------------------------------
+    ResourcePtr ResourceManager::create(const String& name, const String& group, 
+		bool isManual, ManualResourceLoader* loader, const NameValuePairList* params)
+	{
+		// Call creation implementation
+		ResourcePtr ret = ResourcePtr(
+            createImpl(name, getNextHandle(), group, isManual, loader, params));
+        if (params)
+            ret->setParameterList(*params);
+
+		addImpl(ret);
+		// Tell resource group manager
+		ResourceGroupManager::getSingleton()._notifyResourceCreated(ret);
+		return ret;
+
+	}
+    //-----------------------------------------------------------------------
+    ResourceManager::ResourceCreateOrRetrieveResult 
+	ResourceManager::createOrRetrieve(
+		const String& name, const String& group, 
+		bool isManual, ManualResourceLoader* loader, 
+		const NameValuePairList* params)
+	{
+		// Lock for the whole get / insert
+		OGRE_LOCK_AUTO_MUTEX
+
+		ResourcePtr res = getByName(name);
+		bool created = false;
+		if (res.isNull())
+		{
+			created = true;
+			res = create(name, group, isManual, loader, params);
+		}
+
+		return ResourceCreateOrRetrieveResult(res, created);
+	}
+    //-----------------------------------------------------------------------
+    ResourcePtr ResourceManager::load(const String& name, 
+        const String& group, bool isManual, ManualResourceLoader* loader, 
+        const NameValuePairList* loadParams)
+    {
+        ResourcePtr ret = getByName(name);
+        if (ret.isNull())
+        {
+            ret = create(name, group, isManual, loader, loadParams);
+        }
+		// ensure loaded
+        ret->load();
+        return ret;
+    }
+    //-----------------------------------------------------------------------
+    void ResourceManager::addImpl( ResourcePtr& res )
+    {
+		OGRE_LOCK_AUTO_MUTEX
+
+        std::pair<ResourceMap::iterator, bool> result = 
+            mResources.insert( ResourceMap::value_type( res->getName(), res ) );
+        if (!result.second)
+        {
+            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, "Resource with the name " + res->getName() + 
+                " already exists.", "ResourceManager::add");
+        }
+        std::pair<ResourceHandleMap::iterator, bool> resultHandle = 
+            mResourcesByHandle.insert( ResourceHandleMap::value_type( res->getHandle(), res ) );
+        if (!resultHandle.second)
+        {
+            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, "Resource with the handle " + 
+                StringConverter::toString((long) (res->getHandle())) + 
+                " already exists.", "ResourceManager::add");
+        }
+
+    }
+	//-----------------------------------------------------------------------
+	void ResourceManager::removeImpl( ResourcePtr& res )
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		ResourceMap::iterator nameIt = mResources.find(res->getName());
+		if (nameIt != mResources.end())
+		{
+			mResources.erase(nameIt);
+		}
+
+		ResourceHandleMap::iterator handleIt = mResourcesByHandle.find(res->getHandle());
+		if (handleIt != mResourcesByHandle.end())
+		{
+			mResourcesByHandle.erase(handleIt);
+		}
+		// Tell resource group manager
+		ResourceGroupManager::getSingleton()._notifyResourceRemoved(res);
+	}
+    //-----------------------------------------------------------------------
+    void ResourceManager::setMemoryBudget( size_t bytes)
+    {
+        // Update limit & check usage
+        mMemoryBudget = bytes;
+        checkUsage();
+    }
+    //-----------------------------------------------------------------------
+    size_t ResourceManager::getMemoryBudget(void) const
+    {
+        return mMemoryBudget;
+    }
+	//-----------------------------------------------------------------------
+	void ResourceManager::unload(const String& name)
+	{
+		ResourcePtr res = getByName(name);
+
+		if (!res.isNull())
+		{
+			// Unload resource
+			res->unload();
+
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ResourceManager::unload(ResourceHandle handle)
+	{
+		ResourcePtr res = getByHandle(handle);
+
+		if (!res.isNull())
+		{
+			// Unload resource
+			res->unload();
+
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ResourceManager::unloadAll(bool reloadableOnly)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		ResourceMap::iterator i, iend;
+		iend = mResources.end();
+		for (i = mResources.begin(); i != iend; ++i)
+		{
+			if (!reloadableOnly || i->second->isReloadable())
+			{
+				i->second->unload();
+			}
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	void ResourceManager::reloadAll(bool reloadableOnly)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		ResourceMap::iterator i, iend;
+		iend = mResources.end();
+		for (i = mResources.begin(); i != iend; ++i)
+		{
+			if (!reloadableOnly || i->second->isReloadable())
+			{
+				i->second->reload();
+			}
+		}
+
+	}
+    //-----------------------------------------------------------------------
+    void ResourceManager::unloadUnreferencedResources(bool reloadableOnly)
+    {
+        OGRE_LOCK_AUTO_MUTEX
+
+        ResourceMap::iterator i, iend;
+        iend = mResources.end();
+        for (i = mResources.begin(); i != iend; ++i)
+        {
+            // A use count of 3 means that only RGM and RM have references
+            // RGM has one (this one) and RM has 2 (by name and by handle)
+            if (i->second.useCount() == ResourceGroupManager::RESOURCE_SYSTEM_NUM_REFERENCE_COUNTS)
+            {
+                Resource* res = i->second.get();
+                if (!reloadableOnly || res->isReloadable())
+                {
+                    res->unload();
+                }
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ResourceManager::reloadUnreferencedResources(bool reloadableOnly)
+    {
+        OGRE_LOCK_AUTO_MUTEX
+
+        ResourceMap::iterator i, iend;
+        iend = mResources.end();
+        for (i = mResources.begin(); i != iend; ++i)
+        {
+            // A use count of 3 means that only RGM and RM have references
+            // RGM has one (this one) and RM has 2 (by name and by handle)
+            if (i->second.useCount() == ResourceGroupManager::RESOURCE_SYSTEM_NUM_REFERENCE_COUNTS)
+            {
+                Resource* res = i->second.get();
+                if (!reloadableOnly || res->isReloadable())
+                {
+                    res->reload();
+                }
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ResourceManager::remove(ResourcePtr& res)
+    {
+        removeImpl(res);
+    }
+	//-----------------------------------------------------------------------
+	void ResourceManager::remove(const String& name)
+	{
+		ResourcePtr res = getByName(name);
+
+		if (!res.isNull())
+		{
+			removeImpl(res);
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ResourceManager::remove(ResourceHandle handle)
+	{
+		ResourcePtr res = getByHandle(handle);
+
+		if (!res.isNull())
+		{
+			removeImpl(res);
+		}
+	}
+	//-----------------------------------------------------------------------
+	void ResourceManager::removeAll(void)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		mResources.clear();
+		mResourcesByHandle.clear();
+		// Notify resource group manager
+		ResourceGroupManager::getSingleton()._notifyAllResourcesRemoved(this);
+	}
+    //-----------------------------------------------------------------------
+    ResourcePtr ResourceManager::getByName(const String& name)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+
+        ResourceMap::iterator it = mResources.find(name);
+
+        if( it == mResources.end())
+		{
+            return ResourcePtr();
+		}
+        else
+        {
+            return it->second;
+        }
+    }
+    //-----------------------------------------------------------------------
+    ResourcePtr ResourceManager::getByHandle(ResourceHandle handle)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+
+        ResourceHandleMap::iterator it = mResourcesByHandle.find(handle);
+        if (it == mResourcesByHandle.end())
+        {
+            return ResourcePtr();
+        }
+        else
+        {
+            return it->second;
+        }
+    }
+    //-----------------------------------------------------------------------
+    ResourceHandle ResourceManager::getNextHandle(void)
+    {
+		OGRE_LOCK_AUTO_MUTEX
+
+        return mNextHandle++;
+    }
+    //-----------------------------------------------------------------------
+    void ResourceManager::checkUsage(void)
+    {
+        // TODO Page out here?
+    }
+	//-----------------------------------------------------------------------
+	void ResourceManager::_notifyResourceTouched(Resource* res)
+	{
+		// TODO
+	}
+	//-----------------------------------------------------------------------
+	void ResourceManager::_notifyResourceLoaded(Resource* res)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		mMemoryUsage += res->getSize();
+	}
+	//-----------------------------------------------------------------------
+	void ResourceManager::_notifyResourceUnloaded(Resource* res)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		mMemoryUsage -= res->getSize();
+	}
+	//-----------------------------------------------------------------------
+
+}
+
+
+
Index: /OgreMain/src/OgreRibbonTrail.cpp
===================================================================
--- /OgreMain/src/OgreRibbonTrail.cpp	(revision 5)
+++ /OgreMain/src/OgreRibbonTrail.cpp	(revision 5)
@@ -0,0 +1,514 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreRibbonTrail.h"
+#include "OgreMath.h"
+#include "OgreException.h"
+#include "OgreSceneNode.h"
+#include "OgreStringConverter.h"
+
+namespace Ogre
+{
+    namespace
+    {
+        /** Controller value for pass frame time to RibbonTrail
+        */
+        class _OgrePrivate TimeControllerValue : public ControllerValue<Real>
+        {
+        protected:
+            RibbonTrail* mTrail;
+        public:
+            TimeControllerValue(RibbonTrail* r) { mTrail = r; }
+
+            Real getValue(void) const { return 0; }// not a source 
+            void setValue(Real value) { mTrail->_timeUpdate(value); }
+        };
+    }
+	//-----------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	RibbonTrail::RibbonTrail(const String& name, size_t maxElements, 
+		size_t numberOfChains, bool useTextureCoords, bool useColours)
+		:BillboardChain(name, maxElements, 0, useTextureCoords, useColours, true),
+		mFadeController(0)
+	{
+		setTrailLength(100);
+		setNumberOfChains(numberOfChains);
+		mTimeControllerValue = ControllerValueRealPtr(new TimeControllerValue(this));
+
+		// use V as varying texture coord, so we can use 1D textures to 'smear'
+		setTextureCoordDirection(TCD_V);
+
+
+	}
+	//-----------------------------------------------------------------------
+	RibbonTrail::~RibbonTrail()
+	{
+		// Detach listeners
+		for (NodeList::iterator i = mNodeList.begin(); i != mNodeList.end(); ++i)
+		{
+			(*i)->setListener(0);
+		}
+
+        if (mFadeController)
+        {
+			// destroy controller
+			ControllerManager::getSingleton().destroyController(mFadeController);
+        }
+
+	}
+	//-----------------------------------------------------------------------
+	void RibbonTrail::addNode(Node* n)
+	{
+		if (mNodeList.size() == mChainCount)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				mName + " cannot monitor any more nodes, chain count exceeded",
+				"RibbonTrail::addNode");
+		}
+		if (n->getListener())
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				mName + " cannot monitor node " + n->getName() + " since it already has a listener.",
+				"RibbonTrail::addNode");
+		}
+
+        // initialise the chain
+        resetTrail(mNodeList.size(), n);
+
+		mNodeList.push_back(n);
+		n->setListener(this);
+
+	}
+	//-----------------------------------------------------------------------
+	void RibbonTrail::removeNode(Node* n)
+	{
+		NodeList::iterator i = std::find(mNodeList.begin(), mNodeList.end(), n);
+		if (i != mNodeList.end())
+		{
+			n->setListener(0);
+			mNodeList.erase(i);
+		}
+	}
+	//-----------------------------------------------------------------------
+	RibbonTrail::NodeIterator 
+	RibbonTrail::getNodeIterator(void) const
+	{
+		return NodeIterator(mNodeList.begin(), mNodeList.end());
+	}
+	//-----------------------------------------------------------------------
+	void RibbonTrail::setTrailLength(Real len)
+	{
+		mTrailLength = len;
+		mElemLength = mTrailLength / mMaxElementsPerChain;
+		mSquaredElemLength = mElemLength * mElemLength;
+	}
+	//-----------------------------------------------------------------------
+	void RibbonTrail::setMaxChainElements(size_t maxElements)
+	{
+		BillboardChain::setMaxChainElements(maxElements);
+		mElemLength = mTrailLength / mMaxElementsPerChain;
+		mSquaredElemLength = mElemLength * mElemLength;
+
+        resetAllTrails();
+	}
+	//-----------------------------------------------------------------------
+	void RibbonTrail::setNumberOfChains(size_t numChains)
+	{
+        if (numChains < mNodeList.size())
+        {
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Can't shrink the number of chains less than number of tracking nodes",
+                "RibbonTrail::setNumberOfChains");
+        }
+
+		BillboardChain::setNumberOfChains(numChains);
+
+		mInitialColour.resize(numChains, ColourValue::White);
+        mDeltaColour.resize(numChains, ColourValue::ZERO);
+		mInitialWidth.resize(numChains, 10);
+		mDeltaWidth.resize(numChains, 0);
+
+        resetAllTrails();
+	}
+	//-----------------------------------------------------------------------
+    void RibbonTrail::clearChain(size_t chainIndex)
+    {
+        BillboardChain::clearChain(chainIndex);
+
+        // Reset if we are tracking for this chain
+        if (chainIndex < mNodeList.size())
+        {
+            resetTrail(chainIndex, mNodeList[chainIndex]);
+        }
+    }
+	//-----------------------------------------------------------------------
+	void RibbonTrail::setInitialColour(size_t chainIndex, const ColourValue& col)
+	{
+		setInitialColour(chainIndex, col.r, col.g, col.b, col.a);
+	}
+	//-----------------------------------------------------------------------
+	void RibbonTrail::setInitialColour(size_t chainIndex, Real r, Real g, Real b, Real a)
+	{
+		if (chainIndex >= mChainCount)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"chainIndex out of bounds", "RibbonTrail::setInitialColour");
+		}
+		mInitialColour[chainIndex].r = r;
+		mInitialColour[chainIndex].g = g;
+		mInitialColour[chainIndex].b = b;
+		mInitialColour[chainIndex].a = a;
+	}
+	//-----------------------------------------------------------------------
+	const ColourValue& RibbonTrail::getInitialColour(size_t chainIndex) const
+	{
+		if (chainIndex >= mChainCount)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"chainIndex out of bounds", "RibbonTrail::getInitialColour");
+		}
+		return mInitialColour[chainIndex];
+	}
+	//-----------------------------------------------------------------------
+	void RibbonTrail::setInitialWidth(size_t chainIndex, Real width)
+	{
+		if (chainIndex >= mChainCount)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"chainIndex out of bounds", "RibbonTrail::setInitialWidth");
+		}
+		mInitialWidth[chainIndex] = width;
+	}
+	//-----------------------------------------------------------------------
+	Real RibbonTrail::getInitialWidth(size_t chainIndex) const
+	{
+		if (chainIndex >= mChainCount)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"chainIndex out of bounds", "RibbonTrail::getInitialWidth");
+		}
+		return mInitialWidth[chainIndex];
+	}
+	//-----------------------------------------------------------------------
+	void RibbonTrail::setColourChange(size_t chainIndex, const ColourValue& valuePerSecond)
+	{
+		setColourChange(chainIndex, 
+			valuePerSecond.r, valuePerSecond.g, valuePerSecond.b, valuePerSecond.a);
+	}
+	//-----------------------------------------------------------------------
+	void RibbonTrail::setColourChange(size_t chainIndex, Real r, Real g, Real b, Real a)
+	{
+		if (chainIndex >= mChainCount)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"chainIndex out of bounds", "RibbonTrail::setColourChange");
+		}
+		mDeltaColour[chainIndex].r = r;
+		mDeltaColour[chainIndex].g = g;
+		mDeltaColour[chainIndex].b = b;
+		mDeltaColour[chainIndex].a = a;
+
+		manageController();
+
+	}
+	//-----------------------------------------------------------------------
+	const ColourValue& RibbonTrail::getColourChange(size_t chainIndex) const
+	{
+		if (chainIndex >= mChainCount)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"chainIndex out of bounds", "RibbonTrail::getColourChange");
+		}
+		return mDeltaColour[chainIndex];
+	}
+	//-----------------------------------------------------------------------
+	void RibbonTrail::setWidthChange(size_t chainIndex, Real widthDeltaPerSecond)
+	{
+		if (chainIndex >= mChainCount)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"chainIndex out of bounds", "RibbonTrail::setWidthChange");
+		}
+		mDeltaWidth[chainIndex] = widthDeltaPerSecond;
+		manageController();
+	}
+	//-----------------------------------------------------------------------
+	Real RibbonTrail::getWidthChange(size_t chainIndex) const
+	{
+		if (chainIndex >= mChainCount)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"chainIndex out of bounds", "RibbonTrail::getWidthChange");
+		}
+		return mDeltaWidth[chainIndex];
+
+	}
+	//-----------------------------------------------------------------------
+	void RibbonTrail::manageController(void)
+	{
+		bool needController = false;
+		for (size_t i = 0; i < mChainCount; ++i)
+		{
+			if (mDeltaWidth[i] != 0 || mDeltaColour[i] != ColourValue::ZERO)
+			{
+				needController = true;
+				break;
+			}
+		}
+		if (!mFadeController && needController)
+		{
+			// Set up fading via frame time controller
+			ControllerManager& mgr = ControllerManager::getSingleton();
+			mFadeController = mgr.createFrameTimePassthroughController(mTimeControllerValue);
+		}
+		else if (mFadeController && !needController)
+		{
+			// destroy controller
+			ControllerManager::getSingleton().destroyController(mFadeController);
+			mFadeController = 0;
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	void RibbonTrail::nodeUpdated(const Node* node)
+	{
+		
+		for (size_t idx = 0; idx < mNodeList.size(); ++idx)
+		{
+			if (mNodeList[idx] == node)
+			{
+				updateTrail(idx, node);
+				break;
+			}
+		}
+	}
+	//-----------------------------------------------------------------------
+	void RibbonTrail::nodeDestroyed(const Node* node)
+	{
+		removeNode(const_cast<Node*>(node));
+
+	}
+	//-----------------------------------------------------------------------
+	void RibbonTrail::updateTrail(size_t index, const Node* node)
+	{
+		// Repeat this entire process if chain is stretched beyond its natural length
+		bool done = false;
+		while (!done)
+		{
+			// Node has changed somehow, we're only interested in the derived position
+			ChainSegment& seg = mChainSegmentList[index];
+			Element& headElem = mChainElementList[seg.start + seg.head];
+			size_t nextElemIdx = seg.head + 1;
+			// wrap
+			if (nextElemIdx == mMaxElementsPerChain)
+				nextElemIdx = 0;
+			Element& nextElem = mChainElementList[seg.start + nextElemIdx];
+
+			// Vary the head elem, but bake new version if that exceeds element len
+			Vector3 newPos = node->_getDerivedPosition();
+			if (mParentNode)
+			{
+				// Transform position to ourself space
+				newPos = mParentNode->_getDerivedOrientation().UnitInverse() *
+					(newPos - mParentNode->_getDerivedPosition()) / mParentNode->_getDerivedScale();
+			}
+			Vector3 diff = newPos - nextElem.position;
+			Real sqlen = diff.squaredLength();
+			if (sqlen >= mSquaredElemLength)
+			{
+				// Move existing head to mElemLength
+				Vector3 scaledDiff = diff * (mElemLength / Math::Sqrt(sqlen));
+				headElem.position = nextElem.position + scaledDiff;
+				// Add a new element to be the new head
+				Element newElem(newPos, mInitialWidth[index], 0.0f, mInitialColour[index]);
+				addChainElement(index, newElem);
+				// alter diff to represent new head size
+				diff = newPos - headElem.position;
+				// check whether another step is needed or not
+				if (diff.squaredLength() <= mSquaredElemLength)   
+					done = true;
+
+			}
+			else
+			{
+				// Extend existing head
+				headElem.position = newPos;
+				done = true;
+			}
+
+			// Is this segment full?
+			if ((seg.tail + 1) % mMaxElementsPerChain == seg.head)
+			{
+				// If so, shrink tail gradually to match head extension
+				Element& tailElem = mChainElementList[seg.start + seg.tail];
+				size_t preTailIdx;
+				if (seg.tail == 0)
+					preTailIdx = mMaxElementsPerChain - 1;
+				else
+					preTailIdx = seg.tail - 1;
+				Element& preTailElem = mChainElementList[seg.start + preTailIdx];
+
+				// Measure tail diff from pretail to tail
+				Vector3 taildiff = tailElem.position - preTailElem.position;
+				Real taillen = taildiff.length();
+				if (taillen > 1e-06)
+				{
+					Real tailsize = mElemLength - diff.length();
+					taildiff *= tailsize / taillen;
+					tailElem.position = preTailElem.position + taildiff;
+				}
+
+			}
+		} // end while
+
+
+		mBoundsDirty = true;
+		// Need to dirty the parent node, but can't do it using needUpdate() here 
+		// since we're in the middle of the scene graph update (node listener), 
+		// so re-entrant calls don't work. Queue.
+		if (mParentNode)
+		{
+			Node::queueNeedUpdate(getParentSceneNode());
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	void RibbonTrail::_timeUpdate(Real time)
+	{
+		// Apply all segment effects
+		for (size_t s = 0; s < mChainSegmentList.size(); ++s)
+		{
+			ChainSegment& seg = mChainSegmentList[s];
+			if (seg.head != SEGMENT_EMPTY && seg.head != seg.tail)
+			{
+				
+				for(size_t e = seg.head + 1;; ++e) // until break
+				{
+					e = e % mMaxElementsPerChain;
+
+					Element& elem = mChainElementList[seg.start + e];
+					elem.width = elem.width - (time * mDeltaWidth[s]);
+					elem.width = std::max(Real(0.0f), elem.width);
+					elem.colour = elem.colour - (mDeltaColour[s] * time);
+					elem.colour.saturate();
+
+					if (e == seg.tail)
+						break;
+					
+				}
+			}
+
+		}
+
+	}
+    //-----------------------------------------------------------------------
+    void RibbonTrail::resetTrail(size_t index, const Node* node)
+    {
+        assert(index < mChainCount);
+
+        ChainSegment& seg = mChainSegmentList[index];
+        // set up this segment
+        seg.head = seg.tail = SEGMENT_EMPTY;
+        // Create new element, v coord is always 0.0f
+        Element e(node->_getDerivedPosition(),
+            mInitialWidth[index], 0.0f, mInitialColour[index]);
+        // Add the start position
+        addChainElement(index, e);
+        // Add another on the same spot, this will extend
+        addChainElement(index, e);
+    }
+	//-----------------------------------------------------------------------
+    void RibbonTrail::resetAllTrails(void)
+    {
+        for (size_t i = 0; i < mNodeList.size(); ++i)
+        {
+            resetTrail(i, mNodeList[i]);
+        }
+    }
+	//-----------------------------------------------------------------------
+	const String& RibbonTrail::getMovableType(void) const
+	{
+		return RibbonTrailFactory::FACTORY_TYPE_NAME;
+	}
+	//-----------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	String RibbonTrailFactory::FACTORY_TYPE_NAME = "RibbonTrail";
+	//-----------------------------------------------------------------------
+	const String& RibbonTrailFactory::getType(void) const
+	{
+		return FACTORY_TYPE_NAME;
+	}
+	//-----------------------------------------------------------------------
+	MovableObject* RibbonTrailFactory::createInstanceImpl( const String& name,
+		const NameValuePairList* params)
+	{
+		size_t maxElements = 20;
+		size_t numberOfChains = 1;
+		bool useTex = true;
+		bool useCol = true;
+		// optional params
+		if (params != 0)
+		{
+			NameValuePairList::const_iterator ni = params->find("maxElements");
+			if (ni != params->end())
+			{
+				maxElements = StringConverter::parseUnsignedLong(ni->second);
+			}
+			ni = params->find("numberOfChains");
+			if (ni != params->end())
+			{
+				numberOfChains = StringConverter::parseUnsignedLong(ni->second);
+			}
+			ni = params->find("useTextureCoords");
+			if (ni != params->end())
+			{
+				useTex = StringConverter::parseBool(ni->second);
+			}
+			ni = params->find("useVertexColours");
+			if (ni != params->end())
+			{
+				useCol = StringConverter::parseBool(ni->second);
+			}
+
+		}
+
+		return new RibbonTrail(name, maxElements, numberOfChains, useTex, useCol);
+
+	}
+	//-----------------------------------------------------------------------
+	void RibbonTrailFactory::destroyInstance( MovableObject* obj)
+	{
+		delete obj;
+	}
+
+
+
+
+}
+
Index: /OgreMain/src/OgreRoot.cpp
===================================================================
--- /OgreMain/src/OgreRoot.cpp	(revision 5)
+++ /OgreMain/src/OgreRoot.cpp	(revision 5)
@@ -0,0 +1,1189 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+// Ogre includes
+#include "OgreStableHeaders.h"
+
+#include "OgreRoot.h"
+
+#include "OgreRenderSystem.h"
+#include "OgreRenderWindow.h"
+#include "OgreException.h"
+#include "OgreControllerManager.h"
+#include "OgreLogManager.h"
+#include "OgreMath.h"
+#include "OgreDynLibManager.h"
+#include "OgreDynLib.h"
+#include "OgreConfigFile.h"
+#include "OgreMaterialManager.h"
+#include "OgreMeshManager.h"
+#include "OgreTextureManager.h"
+#include "OgreParticleSystemManager.h"
+#include "OgreSkeletonManager.h"
+#include "OgreOverlayElementFactory.h"
+#include "OgreOverlayManager.h"
+#include "OgreProfiler.h"
+#include "OgreErrorDialog.h"
+#include "OgreConfigDialog.h"
+#include "OgreStringConverter.h"
+#include "OgreArchiveManager.h"
+#include "OgrePlugin.h"
+#include "OgreZip.h"
+#include "OgreFileSystem.h"
+#include "OgreShadowVolumeExtrudeProgram.h"
+#include "OgreResourceBackgroundQueue.h"
+#include "OgreEntity.h"
+#include "OgreBillboardSet.h"
+#include "OgreBillboardChain.h"
+#include "OgreRibbonTrail.h"
+#include "OgreLight.h"
+#include "OgreManualObject.h"
+#include "OgreRenderQueueInvocation.h"
+#include "OgrePlatformInformation.h"
+#include "OgreConvexBody.h"
+	
+#if OGRE_NO_FREEIMAGE == 0
+#include "OgreFreeImageCodec.h"
+#endif
+#if OGRE_NO_DEVIL == 0
+#include "OgreILCodecs.h"
+#endif
+#if OGRE_NO_DDS_CODEC == 0
+#include "OgreDDSCodec.h"
+#endif
+
+#include "OgreFontManager.h"
+#include "OgreHardwareBufferManager.h"
+
+#include "OgreOverlay.h"
+#include "OgreHighLevelGpuProgramManager.h"
+
+#include "OgreExternalTextureSourceManager.h"
+#include "OgreCompositorManager.h"
+
+#include "OgreWindowEventUtilities.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    template<> Root* Singleton<Root>::ms_Singleton = 0;
+    Root* Root::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    Root& Root::getSingleton(void)
+    {
+        assert( ms_Singleton );  return ( *ms_Singleton );
+    }
+
+    typedef void (*DLL_START_PLUGIN)(void);
+    typedef void (*DLL_STOP_PLUGIN)(void);
+
+
+    //-----------------------------------------------------------------------
+    Root::Root(const String& pluginFileName, const String& configFileName, 
+		const String& logFileName)
+      : mLogManager(0), mCurrentFrame(0), mFrameSmoothingTime(0.0f),
+	  mNextMovableObjectTypeFlag(1), mIsInitialised(false)
+    {
+        // superclass will do singleton checking
+        String msg;
+
+        // Init
+        mActiveRenderer = 0;
+        mVersion = StringConverter::toString(OGRE_VERSION_MAJOR) + "." +
+            StringConverter::toString(OGRE_VERSION_MINOR) + "." +
+            StringConverter::toString(OGRE_VERSION_PATCH) + 
+			OGRE_VERSION_SUFFIX + " " +
+            "(" + OGRE_VERSION_NAME + ")";
+		mConfigFileName = configFileName;
+
+		// Create log manager and default log file if there is no log manager yet
+		if(LogManager::getSingletonPtr() == 0)
+		{
+			mLogManager = new LogManager();
+			mLogManager->createLog(logFileName, true, true);
+		}
+
+        // Dynamic library manager
+        mDynLibManager = new DynLibManager();
+
+        mArchiveManager = new ArchiveManager();
+
+		// ResourceGroupManager
+		mResourceGroupManager = new ResourceGroupManager();
+
+		// ResourceBackgroundQueue
+		mResourceBackgroundQueue = new ResourceBackgroundQueue();
+
+		// Create SceneManager enumerator (note - will be managed by singleton)
+        mSceneManagerEnum = new SceneManagerEnumerator();
+        mCurrentSceneManager = NULL;
+
+		mShadowTextureManager = new ShadowTextureManager();
+
+        // ..material manager
+        mMaterialManager = new MaterialManager();
+
+        // Mesh manager
+        mMeshManager = new MeshManager();
+
+        // Skeleton manager
+        mSkeletonManager = new SkeletonManager();
+
+        // ..particle system manager
+        mParticleManager = new ParticleSystemManager();
+
+        mTimer = new Timer();
+
+        // Overlay manager
+        mOverlayManager = new OverlayManager();
+
+        mPanelFactory = new PanelOverlayElementFactory();
+        mOverlayManager->addOverlayElementFactory(mPanelFactory);
+
+        mBorderPanelFactory = new BorderPanelOverlayElementFactory();
+        mOverlayManager->addOverlayElementFactory(mBorderPanelFactory);
+
+        mTextAreaFactory = new TextAreaOverlayElementFactory();
+        mOverlayManager->addOverlayElementFactory(mTextAreaFactory);
+        // Font manager
+        mFontManager = new FontManager();
+
+#if OGRE_PROFILING
+        // Profiler
+        mProfiler = new Profiler();
+		Profiler::getSingleton().setTimer(mTimer);
+#endif
+        mFileSystemArchiveFactory = new FileSystemArchiveFactory();
+        ArchiveManager::getSingleton().addArchiveFactory( mFileSystemArchiveFactory );
+        mZipArchiveFactory = new ZipArchiveFactory();
+        ArchiveManager::getSingleton().addArchiveFactory( mZipArchiveFactory );
+#if OGRE_NO_FREEIMAGE == 0
+		// Register image codecs
+		FreeImageCodec::startup();
+#endif
+#if OGRE_NO_DEVIL == 0
+	    // Register image codecs
+	    ILCodecs::registerCodecs();
+#endif
+#if OGRE_NO_DDS_CODEC == 0
+		// Register image codecs
+		DDSCodec::startup();
+#endif
+
+        mHighLevelGpuProgramManager = new HighLevelGpuProgramManager();
+
+		mExternalTextureSourceManager = new ExternalTextureSourceManager();
+        mCompositorManager = new CompositorManager();
+
+        // Auto window
+        mAutoWindow = 0;
+
+		// instantiate and register base movable factories
+		mEntityFactory = new EntityFactory();
+		addMovableObjectFactory(mEntityFactory);
+		mLightFactory = new LightFactory();
+		addMovableObjectFactory(mLightFactory);
+		mBillboardSetFactory = new BillboardSetFactory();
+		addMovableObjectFactory(mBillboardSetFactory);
+		mManualObjectFactory = new ManualObjectFactory();
+		addMovableObjectFactory(mManualObjectFactory);
+		mBillboardChainFactory = new BillboardChainFactory();
+		addMovableObjectFactory(mBillboardChainFactory);
+		mRibbonTrailFactory = new RibbonTrailFactory();
+		addMovableObjectFactory(mRibbonTrailFactory);
+
+		// Load plugins
+        if (!pluginFileName.empty())
+            loadPlugins(pluginFileName);
+
+		LogManager::getSingleton().logMessage("*-*-* OGRE Initialising");
+        msg = "*-*-* Version " + mVersion;
+        LogManager::getSingleton().logMessage(msg);
+
+        // Can't create managers until initialised
+        mControllerManager = 0;
+
+        mFirstTimePostWindowInit = false;
+
+    }
+
+    //-----------------------------------------------------------------------
+    Root::~Root()
+    {
+        shutdown();
+        delete mSceneManagerEnum;
+		delete mShadowTextureManager;
+
+		destroyAllRenderQueueInvocationSequences();
+        delete mCompositorManager;
+		delete mExternalTextureSourceManager;
+#if OGRE_NO_FREEIMAGE == 0
+		FreeImageCodec::shutdown();
+#endif
+#if OGRE_NO_DEVIL == 0
+        ILCodecs::deleteCodecs();
+#endif
+#if OGRE_NO_DDS_CODEC == 0
+		DDSCodec::shutdown();
+#endif
+#if OGRE_PROFILING
+        delete mProfiler;
+#endif
+        delete mOverlayManager;
+        delete mFontManager;
+        delete mArchiveManager;
+        delete mZipArchiveFactory;
+        delete mFileSystemArchiveFactory;
+        delete mSkeletonManager;
+        delete mMeshManager;
+        delete mParticleManager;
+
+        if( mControllerManager )
+            delete mControllerManager;
+        if (mHighLevelGpuProgramManager)
+            delete mHighLevelGpuProgramManager;
+
+        delete mTextAreaFactory;
+        delete mBorderPanelFactory;
+        delete mPanelFactory;
+
+        unloadPlugins();
+        delete mMaterialManager;
+        Pass::processPendingPassUpdates(); // make sure passes are cleaned
+		delete mResourceBackgroundQueue;
+        delete mResourceGroupManager;
+
+		delete mEntityFactory;
+		delete mLightFactory;
+		delete mBillboardSetFactory;
+		delete mManualObjectFactory;
+		delete mBillboardChainFactory;
+		delete mRibbonTrailFactory;
+
+	delete mTimer;
+
+        delete mDynLibManager;
+        delete mLogManager;
+
+		mAutoWindow = 0;
+		mFirstTimePostWindowInit = false;
+
+
+        StringInterface::cleanupDictionary ();
+    }
+
+    //-----------------------------------------------------------------------
+    void Root::saveConfig(void)
+    {
+        if (mConfigFileName.empty ())
+            return;
+
+		std::ofstream of(mConfigFileName.c_str());
+
+        if (!of)
+            OGRE_EXCEPT(Exception::ERR_CANNOT_WRITE_TO_FILE, "Cannot create settings file.",
+            "Root::saveConfig");
+
+        if (mActiveRenderer)
+        {
+            of << "Render System=" << mActiveRenderer->getName() << std::endl;
+        }
+        else
+        {
+            of << "Render System=" << std::endl;
+        }
+
+        for (RenderSystemList::const_iterator pRend = getAvailableRenderers()->begin(); pRend != getAvailableRenderers()->end(); ++pRend)
+        {
+            RenderSystem* rs = *pRend;
+            of << std::endl;
+            of << "[" << rs->getName() << "]" << std::endl;
+            const ConfigOptionMap& opts = rs->getConfigOptions();
+            for (ConfigOptionMap::const_iterator pOpt = opts.begin(); pOpt != opts.end(); ++pOpt)
+            {
+				of << pOpt->first << "=" << pOpt->second.currentValue << std::endl;
+            }
+        }
+
+        of.close();
+
+    }
+    //-----------------------------------------------------------------------
+    bool Root::restoreConfig(void)
+    {
+        if (mConfigFileName.empty ())
+            return true;
+
+        // Restores configuration from saved state
+        // Returns true if a valid saved configuration is
+        //   available, and false if no saved config is
+        //   stored, or if there has been a problem
+        ConfigFile cfg;
+        //RenderSystemList::iterator pRend;
+
+        try {
+            // Don't trim whitespace
+            cfg.load(mConfigFileName, "\t:=", false);
+        }
+        catch (Exception& e)
+        {
+            if (e.getNumber() == Exception::ERR_FILE_NOT_FOUND)
+            {
+                return false;
+            }
+            else
+            {
+                throw;
+            }
+        }
+
+        ConfigFile::SectionIterator iSection = cfg.getSectionIterator();
+        while (iSection.hasMoreElements())
+        {
+            const String& renderSystem = iSection.peekNextKey();
+            const ConfigFile::SettingsMultiMap& settings = *iSection.getNext();
+
+            RenderSystem* rs = getRenderSystemByName(renderSystem);
+            if (!rs)
+            {
+                // Unrecognised render system
+                continue;
+            }
+
+            ConfigFile::SettingsMultiMap::const_iterator i;
+            for (i = settings.begin(); i != settings.end(); ++i)
+            {
+                rs->setConfigOption(i->first, i->second);
+            }
+        }
+
+        RenderSystem* rs = getRenderSystemByName(cfg.getSetting("Render System"));
+        if (!rs)
+        {
+            // Unrecognised render system
+            return false;
+        }
+
+        setRenderSystem(rs);
+
+        // Successful load
+        return true;
+
+    }
+
+    //-----------------------------------------------------------------------
+    bool Root::showConfigDialog(void)
+    {
+        // Displays the standard config dialog
+        // Will use stored defaults if available
+        ConfigDialog* dlg;
+        bool isOk;
+
+        restoreConfig();
+
+        dlg = new ConfigDialog();
+
+        if ((isOk = dlg->display()))
+            saveConfig();
+
+        delete dlg;
+        return isOk;
+    }
+
+    //-----------------------------------------------------------------------
+    RenderSystemList* Root::getAvailableRenderers(void)
+    {
+        // Returns a vector of renders
+
+        return &mRenderers;
+
+    }
+
+    //-----------------------------------------------------------------------
+    RenderSystem* Root::getRenderSystemByName(const String& name)
+    {
+        if (name.empty())
+        {
+            // No render system
+            return NULL;
+        }
+
+        RenderSystemList::const_iterator pRend;
+        for (pRend = getAvailableRenderers()->begin(); pRend != getAvailableRenderers()->end(); ++pRend)
+        {
+            RenderSystem* rs = *pRend;
+            if (rs->getName() == name)
+                return rs;
+        }
+
+        // Unrecognised render system
+        return NULL;
+    }
+
+    //-----------------------------------------------------------------------
+    void Root::setRenderSystem(RenderSystem* system)
+    {
+        // Sets the active rendering system
+        // Can be called direct or will be called by
+        //   standard config dialog
+
+        // Is there already an active renderer?
+        // If so, disable it and init the new one
+        if( mActiveRenderer && mActiveRenderer != system )
+        {
+            mActiveRenderer->shutdown();
+        }
+
+        mActiveRenderer = system;
+        // Tell scene managers
+        SceneManagerEnumerator::getSingleton().setRenderSystem(system);
+
+    }
+    //-----------------------------------------------------------------------
+    void Root::addRenderSystem(RenderSystem *newRend)
+    {
+        mRenderers.push_back(newRend);
+    }
+    //-----------------------------------------------------------------------
+	void Root::_setCurrentSceneManager(SceneManager* sm)
+	{
+		mCurrentSceneManager = sm;
+	}
+    //-----------------------------------------------------------------------
+    RenderSystem* Root::getRenderSystem(void)
+    {
+        // Gets the currently active renderer
+        return mActiveRenderer;
+
+    }
+
+    //-----------------------------------------------------------------------
+    RenderWindow* Root::initialise(bool autoCreateWindow, const String& windowTitle)
+    {
+        if (!mActiveRenderer)
+            OGRE_EXCEPT(Exception::ERR_INVALID_STATE,
+            "Cannot initialise - no render "
+            "system has been selected.", "Root::initialise");
+
+        if (!mControllerManager)
+			mControllerManager = new ControllerManager();
+
+		PlatformInformation::log(LogManager::getSingleton().getDefaultLog());
+		mAutoWindow =  mActiveRenderer->initialise(autoCreateWindow, windowTitle);
+
+
+        if (autoCreateWindow && !mFirstTimePostWindowInit)
+        {
+            oneTimePostWindowInit();
+            mAutoWindow->_setPrimary();
+        }
+
+        // Initialise timer
+        mTimer->reset();
+
+		// Init pools
+		ConvexBody::_initialisePool();
+
+		mIsInitialised = true;
+
+        return mAutoWindow;
+
+    }
+    //-----------------------------------------------------------------------
+    String Root::getErrorDescription(long errorNumber)
+    {
+
+        // Pass to render system
+        if (mActiveRenderer)
+            return mActiveRenderer->getErrorDescription(errorNumber);
+        else
+            return "";
+
+    }
+	//-----------------------------------------------------------------------
+	void Root::addSceneManagerFactory(SceneManagerFactory* fact)
+	{
+		mSceneManagerEnum->addFactory(fact);
+	}
+	//-----------------------------------------------------------------------
+	void Root::removeSceneManagerFactory(SceneManagerFactory* fact)
+	{
+		mSceneManagerEnum->removeFactory(fact);
+	}
+	//-----------------------------------------------------------------------
+	const SceneManagerMetaData* Root::getSceneManagerMetaData(const String& typeName) const
+	{
+		return mSceneManagerEnum->getMetaData(typeName);
+	}
+	//-----------------------------------------------------------------------
+	SceneManagerEnumerator::MetaDataIterator 
+	Root::getSceneManagerMetaDataIterator(void) const
+	{
+		return mSceneManagerEnum->getMetaDataIterator();
+
+	}
+	//-----------------------------------------------------------------------
+	SceneManager* Root::createSceneManager(const String& typeName, 
+		const String& instanceName)
+	{
+		return mSceneManagerEnum->createSceneManager(typeName, instanceName);
+	}
+	//-----------------------------------------------------------------------
+	SceneManager* Root::createSceneManager(SceneTypeMask typeMask, 
+		const String& instanceName)
+	{
+		return mSceneManagerEnum->createSceneManager(typeMask, instanceName);
+	}
+	//-----------------------------------------------------------------------
+	void Root::destroySceneManager(SceneManager* sm)
+	{
+		mSceneManagerEnum->destroySceneManager(sm);
+	}
+	//-----------------------------------------------------------------------
+	SceneManager* Root::getSceneManager(const String& instanceName) const
+	{
+		return mSceneManagerEnum->getSceneManager(instanceName);
+	}
+	//-----------------------------------------------------------------------
+	SceneManagerEnumerator::SceneManagerIterator Root::getSceneManagerIterator(void)
+	{
+		return mSceneManagerEnum->getSceneManagerIterator();
+	}
+    //-----------------------------------------------------------------------
+    TextureManager* Root::getTextureManager(void)
+    {
+        return &TextureManager::getSingleton();
+    }
+    //-----------------------------------------------------------------------
+    MeshManager* Root::getMeshManager(void)
+    {
+        return &MeshManager::getSingleton();
+    }
+    //-----------------------------------------------------------------------
+    void Root::addFrameListener(FrameListener* newListener)
+    {
+		// Check if the specified listener is scheduled for removal
+		std::set<FrameListener *>::iterator i = mRemovedFrameListeners.find(newListener);
+
+		// If yes, cancel the removal. Otherwise add it to other listeners.
+		if (i != mRemovedFrameListeners.end())
+			mRemovedFrameListeners.erase(*i);
+		else
+			mFrameListeners.insert(newListener); // Insert, unique only (set)
+    }
+
+    //-----------------------------------------------------------------------
+    void Root::removeFrameListener(FrameListener* oldListener)
+    {
+        // Remove, 1 only (set)
+        mRemovedFrameListeners.insert(oldListener);
+    }
+    //-----------------------------------------------------------------------
+    bool Root::_fireFrameStarted(FrameEvent& evt)
+    {
+        // Increment frame number
+        ++mCurrentFrame;
+
+        // Remove all marked listeners
+        std::set<FrameListener*>::iterator i;
+        for (i = mRemovedFrameListeners.begin();
+            i != mRemovedFrameListeners.end(); i++)
+        {
+            mFrameListeners.erase(*i);
+        }
+        mRemovedFrameListeners.clear();
+
+        // Tell all listeners
+        for (i= mFrameListeners.begin(); i != mFrameListeners.end(); ++i)
+        {
+            if (!(*i)->frameStarted(evt))
+                return false;
+        }
+
+        return true;
+
+    }
+    //-----------------------------------------------------------------------
+    bool Root::_fireFrameEnded(FrameEvent& evt)
+    {
+        // Remove all marked listeners
+        std::set<FrameListener*>::iterator i;
+        for (i = mRemovedFrameListeners.begin();
+            i != mRemovedFrameListeners.end(); i++)
+        {
+            mFrameListeners.erase(*i);
+        }
+        mRemovedFrameListeners.clear();
+
+        // Tell all listeners
+		bool ret = true;
+        for (i= mFrameListeners.begin(); i != mFrameListeners.end(); ++i)
+        {
+            if (!(*i)->frameEnded(evt))
+			{
+                ret = false;
+				break;
+			}
+        }
+
+        // Tell buffer manager to free temp buffers used this frame
+        if (HardwareBufferManager::getSingletonPtr())
+            HardwareBufferManager::getSingleton()._releaseBufferCopies();
+
+		// Also tell the ResourceBackgroundQueue to propagate background load events
+		ResourceBackgroundQueue::getSingleton()._fireBackgroundLoadingComplete();
+
+        return ret;
+    }
+    //-----------------------------------------------------------------------
+    bool Root::_fireFrameStarted()
+    {
+        unsigned long now = mTimer->getMilliseconds();
+        FrameEvent evt;
+        evt.timeSinceLastEvent = calculateEventTime(now, FETT_ANY);
+        evt.timeSinceLastFrame = calculateEventTime(now, FETT_STARTED);
+
+        return _fireFrameStarted(evt);
+    }
+    //-----------------------------------------------------------------------
+    bool Root::_fireFrameEnded()
+    {
+        unsigned long now = mTimer->getMilliseconds();
+        FrameEvent evt;
+        evt.timeSinceLastEvent = calculateEventTime(now, FETT_ANY);
+        evt.timeSinceLastFrame = calculateEventTime(now, FETT_ENDED);
+
+        return _fireFrameEnded(evt);
+    }
+    //-----------------------------------------------------------------------
+    Real Root::calculateEventTime(unsigned long now, FrameEventTimeType type)
+    {
+        // Calculate the average time passed between events of the given type
+        // during the last mFrameSmoothingTime seconds.
+
+        std::deque<unsigned long>& times = mEventTimes[type];
+        times.push_back(now);
+
+        if(times.size() == 1)
+            return 0;
+
+        // Times up to mFrameSmoothingTime seconds old should be kept
+        unsigned long discardThreshold =
+			static_cast<unsigned long>(mFrameSmoothingTime * 1000.0f);
+
+        // Find the oldest time to keep
+        std::deque<unsigned long>::iterator it = times.begin(),
+            end = times.end()-2; // We need at least two times
+        while(it != end)
+        {
+            if (now - *it > discardThreshold)
+                ++it;
+            else
+                break;
+        }
+
+        // Remove old times
+        times.erase(times.begin(), it);
+
+        return Real(times.back() - times.front()) / ((times.size()-1) * 1000);
+    }
+    //-----------------------------------------------------------------------
+    void Root::queueEndRendering(void)
+    {
+	    mQueuedEnd = true;
+    }
+    //-----------------------------------------------------------------------
+    void Root::startRendering(void)
+    {
+        assert(mActiveRenderer != 0);
+
+        mActiveRenderer->_initRenderTargets();
+
+        // Clear event times
+        for(int i=0; i!=3; ++i)
+            mEventTimes[i].clear();
+
+        // Infinite loop, until broken out of by frame listeners
+        // or break out by calling queueEndRendering()
+        mQueuedEnd = false;
+
+        while( !mQueuedEnd )
+        {
+			//Pump messages in all registered RenderWindow windows
+			WindowEventUtilities::messagePump();
+
+			if (!renderOneFrame())
+                break;
+        }
+    }
+    //-----------------------------------------------------------------------
+    bool Root::renderOneFrame(void)
+    {
+        if(!_fireFrameStarted())
+            return false;
+
+        _updateAllRenderTargets();
+
+        return _fireFrameEnded();
+    }
+
+    //-----------------------------------------------------------------------
+    void Root::shutdown(void)
+    {
+		SceneManagerEnumerator::getSingleton().shutdownAll();
+		shutdownPlugins();
+
+        ShadowVolumeExtrudeProgram::shutdown();
+		mResourceBackgroundQueue->shutdown();
+        ResourceGroupManager::getSingleton().shutdownAll();
+
+		// Destroy pools
+		ConvexBody::_destroyPool();
+
+
+		mIsInitialised = false;
+
+		LogManager::getSingleton().logMessage("*-*-* OGRE Shutdown");
+    }
+    //-----------------------------------------------------------------------
+    void Root::loadPlugins( const String& pluginsfile )
+    {
+        StringVector pluginList;
+        String pluginDir;
+        ConfigFile cfg;
+
+		try {
+        	cfg.load( pluginsfile );
+		}
+		catch (Exception)
+		{
+			LogManager::getSingleton().logMessage(pluginsfile + " not found, automatic plugin loading disabled.");
+			return;
+		}
+
+        pluginDir = cfg.getSetting("PluginFolder"); // Ignored on Mac OS X, uses Resources/ directory
+        pluginList = cfg.getMultiSetting("Plugin");
+
+        char last_char = pluginDir[pluginDir.length()-1];
+        if (last_char != '/' && last_char != '\\')
+        {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+            pluginDir += "\\";
+#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
+            pluginDir += "/";
+#endif
+        }
+
+        for( StringVector::iterator it = pluginList.begin(); it != pluginList.end(); ++it )
+        {
+			loadPlugin(pluginDir + (*it));
+        }
+
+    }
+    //-----------------------------------------------------------------------
+	void Root::shutdownPlugins(void)
+	{
+		// NB Shutdown plugins in reverse order to enforce dependencies
+		for (PluginInstanceList::reverse_iterator i = mPlugins.rbegin(); i != mPlugins.rend(); ++i)
+		{
+			(*i)->shutdown();
+		}
+	}
+	//-----------------------------------------------------------------------
+	void Root::initialisePlugins(void)
+	{
+		for (PluginInstanceList::iterator i = mPlugins.begin(); i != mPlugins.end(); ++i)
+		{
+			(*i)->initialise();
+		}
+	}
+	//-----------------------------------------------------------------------
+	void Root::unloadPlugins(void)
+    {
+		// unload dynamic libs first
+        for (PluginLibList::reverse_iterator i = mPluginLibs.rbegin(); i != mPluginLibs.rend(); ++i)
+        {
+            // Call plugin shutdown
+            DLL_STOP_PLUGIN pFunc = (DLL_STOP_PLUGIN)(*i)->getSymbol("dllStopPlugin");
+			// this will call uninstallPlugin
+            pFunc();
+            // Unload library & destroy
+            DynLibManager::getSingleton().unload(*i);
+
+        }
+		mPluginLibs.clear();
+
+		// now deal with any remaining plugins that were registered through other means
+		for (PluginInstanceList::reverse_iterator i = mPlugins.rbegin(); i != mPlugins.rend(); ++i)
+		{
+			// Note this does NOT call uninstallPlugin - this shutdown is for the 
+			// detail objects
+			(*i)->uninstall();
+		}
+		mPlugins.clear();
+
+    }
+    //-----------------------------------------------------------------------
+    void Root::addResourceLocation(const String& name, const String& locType,
+		const String& groupName, bool recursive)
+    {
+		ResourceGroupManager::getSingleton().addResourceLocation(
+			name, locType, groupName, recursive);
+    }
+	//-----------------------------------------------------------------------
+	void Root::removeResourceLocation(const String& name, const String& groupName)
+	{
+		ResourceGroupManager::getSingleton().removeResourceLocation(
+			name, groupName);
+	}
+    //-----------------------------------------------------------------------
+    void Root::convertColourValue(const ColourValue& colour, uint32* pDest)
+    {
+        assert(mActiveRenderer != 0);
+        mActiveRenderer->convertColourValue(colour, pDest);
+    }
+    //-----------------------------------------------------------------------
+    RenderWindow* Root::getAutoCreatedWindow(void)
+    {
+        return mAutoWindow;
+    }
+    //-----------------------------------------------------------------------
+	RenderWindow* Root::createRenderWindow(const String &name, unsigned int width, unsigned int height,
+			bool fullScreen, const NameValuePairList *miscParams)
+	{
+        if (!mActiveRenderer)
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALID_STATE,
+            "Cannot create window - no render "
+            "system has been selected.", "Root::createRenderWindow");
+        }
+        RenderWindow* ret;
+        ret = mActiveRenderer->createRenderWindow(name, width, height, fullScreen, miscParams);
+
+        // Initialisation for classes dependent on first window created
+        if(!mFirstTimePostWindowInit)
+        {
+            oneTimePostWindowInit();
+            ret->_setPrimary();
+        }
+
+        return ret;
+
+    }
+    //-----------------------------------------------------------------------
+    void Root::detachRenderTarget(RenderTarget* target)
+    {
+        if (!mActiveRenderer)
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALID_STATE,
+            "Cannot create window - no render "
+            "system has been selected.", "Root::destroyRenderWindow");
+        }
+
+        mActiveRenderer->detachRenderTarget( target->getName() );
+    }
+    //-----------------------------------------------------------------------
+    void Root::detachRenderTarget(const String &name)
+    {
+        if (!mActiveRenderer)
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALID_STATE,
+            "Cannot create window - no render "
+            "system has been selected.", "Root::destroyRenderWindow");
+        }
+
+        mActiveRenderer->detachRenderTarget( name );
+    }
+    //-----------------------------------------------------------------------
+    RenderTarget* Root::getRenderTarget(const String &name)
+    {
+        if (!mActiveRenderer)
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALID_STATE,
+            "Cannot create window - no render "
+            "system has been selected.", "Root::getRenderWindow");
+        }
+
+        return mActiveRenderer->getRenderTarget(name);
+    }
+	//---------------------------------------------------------------------
+	void Root::installPlugin(Plugin* plugin)
+	{
+		LogManager::getSingleton().logMessage("Installing plugin: " + plugin->getName());
+
+		mPlugins.push_back(plugin);
+		plugin->install();
+
+		// if rendersystem is already initialised, call rendersystem init too
+		if (mIsInitialised)
+		{
+			plugin->initialise();
+		}
+
+		LogManager::getSingleton().logMessage("Plugin successfully installed");
+	}
+	//---------------------------------------------------------------------
+	void Root::uninstallPlugin(Plugin* plugin)
+	{
+		LogManager::getSingleton().logMessage("Uninstalling plugin: " + plugin->getName());
+		PluginInstanceList::iterator i = 
+			std::find(mPlugins.begin(), mPlugins.end(), plugin);
+		if (i != mPlugins.end())
+		{
+			if (mIsInitialised)
+				plugin->shutdown();
+			plugin->uninstall();
+			mPlugins.erase(i);
+		}
+		LogManager::getSingleton().logMessage("Plugin successfully uninstalled");
+
+	}
+    //-----------------------------------------------------------------------
+	void Root::loadPlugin(const String& pluginName)
+	{
+		// Load plugin library
+        DynLib* lib = DynLibManager::getSingleton().load( pluginName );
+		// Store for later unload
+		mPluginLibs.push_back(lib);
+
+		// Call startup function
+		DLL_START_PLUGIN pFunc = (DLL_START_PLUGIN)lib->getSymbol("dllStartPlugin");
+
+		if (!pFunc)
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Cannot find symbol dllStartPlugin in library " + pluginName,
+				"Root::loadPlugin");
+
+		// This must call installPlugin
+		pFunc();
+
+	}
+    //-----------------------------------------------------------------------
+	void Root::unloadPlugin(const String& pluginName)
+	{
+        PluginLibList::iterator i;
+
+        for (i = mPluginLibs.begin(); i != mPluginLibs.end(); ++i)
+        {
+			if ((*i)->getName() == pluginName)
+			{
+				// Call plugin shutdown
+				DLL_STOP_PLUGIN pFunc = (DLL_STOP_PLUGIN)(*i)->getSymbol("dllStopPlugin");
+				// this must call uninstallPlugin
+				pFunc();
+				// Unload library (destroyed by DynLibManager)
+				DynLibManager::getSingleton().unload(*i);
+				mPluginLibs.erase(i);
+				return;
+			}
+
+        }
+	}
+    //-----------------------------------------------------------------------
+    Timer* Root::getTimer(void)
+    {
+        return mTimer;
+    }
+    //-----------------------------------------------------------------------
+    void Root::oneTimePostWindowInit(void)
+    {
+        if (!mFirstTimePostWindowInit)
+        {
+			// Background loader
+			mResourceBackgroundQueue->initialise();
+			// Initialise material manager
+			mMaterialManager->initialise();
+            // Init particle systems manager
+            mParticleManager->_initialise();
+			// Init mesh manager
+			MeshManager::getSingleton()._initialise();
+			// Init plugins - after window creation so rsys resources available
+			initialisePlugins();
+            mFirstTimePostWindowInit = true;
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void Root::_updateAllRenderTargets(void)
+    {
+        // delegate
+        mActiveRenderer->_updateAllRenderTargets();
+    }
+	//-----------------------------------------------------------------------
+	void Root::clearEventTimes(void)
+	{
+		// Clear event times
+		for(int i=0; i<3; ++i)
+			mEventTimes[i].clear();
+	}
+	//---------------------------------------------------------------------
+	void Root::addMovableObjectFactory(MovableObjectFactory* fact,
+		bool overrideExisting)
+	{
+		MovableObjectFactoryMap::iterator facti = mMovableObjectFactoryMap.find(
+			fact->getType());
+		if (!overrideExisting && facti != mMovableObjectFactoryMap.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM,
+				"A factory of type '" + fact->getType() + "' already exists.",
+				"Root::addMovableObjectFactory");
+		}
+
+		if (fact->requestTypeFlags())
+		{
+			if (facti != mMovableObjectFactoryMap.end() && facti->second->requestTypeFlags())
+			{
+				// Copy type flags from the factory we're replacing
+				fact->_notifyTypeFlags(facti->second->getTypeFlags());
+			}
+			else
+			{
+				// Allocate new
+				fact->_notifyTypeFlags(_allocateNextMovableObjectTypeFlag());
+			}
+		}
+
+		// Save
+		mMovableObjectFactoryMap[fact->getType()] = fact;
+
+		LogManager::getSingleton().logMessage("MovableObjectFactory for type '" +
+			fact->getType() + "' registered.");
+
+	}
+	//---------------------------------------------------------------------
+	bool Root::hasMovableObjectFactory(const String& typeName) const
+	{
+		return !(mMovableObjectFactoryMap.find(typeName) == mMovableObjectFactoryMap.end());
+	}
+	//---------------------------------------------------------------------
+	MovableObjectFactory* Root::getMovableObjectFactory(const String& typeName)
+	{
+		MovableObjectFactoryMap::iterator i =
+			mMovableObjectFactoryMap.find(typeName);
+		if (i == mMovableObjectFactoryMap.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+				"MovableObjectFactory of type " + typeName + " does not exist",
+				"Root::getMovableObjectFactory");
+		}
+		return i->second;
+	}
+	//---------------------------------------------------------------------
+	uint32 Root::_allocateNextMovableObjectTypeFlag(void)
+	{
+		if (mNextMovableObjectTypeFlag == SceneManager::USER_TYPE_MASK_LIMIT)
+		{
+			OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM,
+				"Cannot allocate a type flag since "
+				"all the available flags have been used.",
+				"Root::_allocateNextMovableObjectTypeFlag");
+
+		}
+		uint32 ret = mNextMovableObjectTypeFlag;
+		mNextMovableObjectTypeFlag <<= 1;
+		return ret;
+
+	}
+	//---------------------------------------------------------------------
+	void Root::removeMovableObjectFactory(MovableObjectFactory* fact)
+	{
+		MovableObjectFactoryMap::iterator i = mMovableObjectFactoryMap.find(
+			fact->getType());
+		if (i != mMovableObjectFactoryMap.end())
+		{
+			mMovableObjectFactoryMap.erase(i);
+		}
+
+	}
+	//---------------------------------------------------------------------
+	Root::MovableObjectFactoryIterator
+	Root::getMovableObjectFactoryIterator(void) const
+	{
+		return MovableObjectFactoryIterator(mMovableObjectFactoryMap.begin(),
+			mMovableObjectFactoryMap.end());
+
+	}
+	//---------------------------------------------------------------------
+	RenderQueueInvocationSequence* Root::createRenderQueueInvocationSequence(
+		const String& name)
+	{
+		RenderQueueInvocationSequenceMap::iterator i =
+			mRQSequenceMap.find(name);
+		if (i != mRQSequenceMap.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM,
+				"RenderQueueInvocationSequence with the name " + name +
+					" already exists.",
+				"Root::createRenderQueueInvocationSequence");
+		}
+		RenderQueueInvocationSequence* ret = new RenderQueueInvocationSequence(name);
+		mRQSequenceMap[name] = ret;
+		return ret;
+	}
+	//---------------------------------------------------------------------
+	RenderQueueInvocationSequence* Root::getRenderQueueInvocationSequence(
+		const String& name)
+	{
+		RenderQueueInvocationSequenceMap::iterator i =
+			mRQSequenceMap.find(name);
+		if (i == mRQSequenceMap.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+				"RenderQueueInvocationSequence with the name " + name +
+				" not found.",
+				"Root::getRenderQueueInvocationSequence");
+		}
+		return i->second;
+	}
+	//---------------------------------------------------------------------
+	void Root::destroyRenderQueueInvocationSequence(
+		const String& name)
+	{
+		RenderQueueInvocationSequenceMap::iterator i =
+			mRQSequenceMap.find(name);
+		if (i != mRQSequenceMap.end())
+		{
+			delete i->second;
+			mRQSequenceMap.erase(i);
+		}
+	}
+	//---------------------------------------------------------------------
+	void Root::destroyAllRenderQueueInvocationSequences(void)
+	{
+		for (RenderQueueInvocationSequenceMap::iterator i = mRQSequenceMap.begin();
+			i != mRQSequenceMap.end(); ++i)
+		{
+			delete i->second;
+		}
+		mRQSequenceMap.clear();
+	}
+	//---------------------------------------------------------------------
+
+
+
+}
Index: /OgreMain/src/OgreRotationSpline.cpp
===================================================================
--- /OgreMain/src/OgreRotationSpline.cpp	(revision 5)
+++ /OgreMain/src/OgreRotationSpline.cpp	(revision 5)
@@ -0,0 +1,226 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreRotationalSpline.h"
+
+
+
+namespace Ogre {
+
+    //---------------------------------------------------------------------
+    RotationalSpline::RotationalSpline()
+        : mAutoCalc(true)
+    {
+    }
+    //---------------------------------------------------------------------
+    RotationalSpline::~RotationalSpline()
+    {
+    }
+    //---------------------------------------------------------------------
+    void RotationalSpline::addPoint(const Quaternion& p)
+    {
+        mPoints.push_back(p);
+        if (mAutoCalc)
+        {
+            recalcTangents();
+        }
+    }
+    //---------------------------------------------------------------------
+    Quaternion RotationalSpline::interpolate(Real t, bool useShortestPath)
+    {
+        // Work out which segment this is in
+        Real fSeg = t * (mPoints.size() - 1);
+        unsigned int segIdx = (unsigned int)fSeg;
+        // Apportion t 
+        t = fSeg - segIdx;
+
+        return interpolate(segIdx, t, useShortestPath);
+
+    }
+    //---------------------------------------------------------------------
+    Quaternion RotationalSpline::interpolate(unsigned int fromIndex, Real t,
+		bool useShortestPath)
+    {
+        // Bounds check
+        assert (fromIndex >= 0 && fromIndex < mPoints.size() &&
+            "fromIndex out of bounds");
+
+        if ((fromIndex + 1) == mPoints.size())
+        {
+            // Duff request, cannot blend to nothing
+            // Just return source
+            return mPoints[fromIndex];
+
+        }
+        // Fast special cases
+        if (t == 0.0f)
+        {
+            return mPoints[fromIndex];
+        }
+        else if(t == 1.0f)
+        {
+            return mPoints[fromIndex + 1];
+        }
+
+        // Real interpolation
+        // Use squad using tangents we've already set up
+        Quaternion &p = mPoints[fromIndex];
+        Quaternion &q = mPoints[fromIndex+1];
+        Quaternion &a = mTangents[fromIndex];
+        Quaternion &b = mTangents[fromIndex+1];
+
+        // NB interpolate to nearest rotation
+        return Quaternion::Squad(t, p, a, b, q, useShortestPath);
+
+    }
+    //---------------------------------------------------------------------
+    void RotationalSpline::recalcTangents(void)
+    {
+        // ShoeMake (1987) approach
+        // Just like Catmull-Rom really, just more gnarly
+        // And no, I don't understand how to derive this!
+        //
+        // let p = point[i], pInv = p.Inverse
+        // tangent[i] = p * exp( -0.25 * ( log(pInv * point[i+1]) + log(pInv * point[i-1]) ) )
+        //
+        // Assume endpoint tangents are parallel with line with neighbour
+
+        unsigned int i, numPoints;
+        bool isClosed;
+
+        numPoints = (unsigned int)mPoints.size();
+
+        if (numPoints < 2)
+        {
+            // Can't do anything yet
+            return;
+        }
+
+        mTangents.resize(numPoints);
+
+        if (mPoints[0] == mPoints[numPoints-1])
+        {
+            isClosed = true;
+        }
+        else
+        {
+            isClosed = false;
+        }
+
+        Quaternion invp, part1, part2, preExp;
+        for(i = 0; i < numPoints; ++i)
+        {
+            Quaternion &p = mPoints[i];
+            invp = p.Inverse();
+
+            if (i ==0)
+            {
+                // special case start
+                part1 = (invp * mPoints[i+1]).Log();
+                if (isClosed)
+                {
+                    // Use numPoints-2 since numPoints-1 == end == start == this one
+                    part2 = (invp * mPoints[numPoints-2]).Log();
+                }
+                else
+                {
+                    part2 = (invp * p).Log();
+                }
+            }
+            else if (i == numPoints-1)
+            {
+                // special case end
+                if (isClosed)
+                {
+                    // Wrap to [1] (not [0], this is the same as end == this one)
+                    part1 = (invp * mPoints[1]).Log();
+                }
+                else
+                {
+                    part1 = (invp * p).Log();
+                }
+                part2 = (invp * mPoints[i-1]).Log();
+            }
+            else
+            {
+                part1 = (invp * mPoints[i+1]).Log();
+                part2 = (invp * mPoints[i-1]).Log();
+            }
+
+            preExp = -0.25 * (part1 + part2);
+            mTangents[i] = p * preExp.Exp();
+            
+        }
+
+
+
+    }
+    //---------------------------------------------------------------------
+    const Quaternion& RotationalSpline::getPoint(unsigned short index) const
+    {
+        assert (index < mPoints.size() && "Point index is out of bounds!!");
+
+        return mPoints[index];
+    }
+    //---------------------------------------------------------------------
+    unsigned short RotationalSpline::getNumPoints(void) const
+    {
+        return (unsigned short)mPoints.size();
+    }
+    //---------------------------------------------------------------------
+    void RotationalSpline::clear(void)
+    {
+        mPoints.clear();
+        mTangents.clear();
+    }
+    //---------------------------------------------------------------------
+    void RotationalSpline::updatePoint(unsigned short index, const Quaternion& value)
+    {
+        assert (index < mPoints.size() && "Point index is out of bounds!!");
+
+        mPoints[index] = value;
+        if (mAutoCalc)
+        {
+            recalcTangents();
+        }
+    }
+    //---------------------------------------------------------------------
+    void RotationalSpline::setAutoCalculate(bool autoCalc)
+    {
+        mAutoCalc = autoCalc;
+    }
+    //---------------------------------------------------------------------
+
+
+
+}
+
+
+
+
Index: /OgreMain/src/OgreSIMDHelper.h
===================================================================
--- /OgreMain/src/OgreSIMDHelper.h	(revision 5)
+++ /OgreMain/src/OgreSIMDHelper.h	(revision 5)
@@ -0,0 +1,456 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __SIMDHelper_H__
+#define __SIMDHelper_H__
+
+#include "OgrePrerequisites.h"
+#include "OgrePlatformInformation.h"
+
+// Stack-alignment hackery.
+//
+// If macro __OGRE_SIMD_ALIGN_STACK defined, means there requests
+// special code to ensure stack align to a 16-bytes boundary.
+//
+// Note:
+//   This macro can only guarantee callee stack pointer (esp) align
+// to a 16-bytes boundary, but not that for frame pointer (ebp).
+// Because most compiler might use frame pointer to access to stack
+// variables, so you need to wrap those alignment required functions
+// with extra function call.
+//
+#if defined(__INTEL_COMPILER)
+// For intel's compiler, simply calling alloca seems to do the right
+// thing. The size of the allocated block seems to be irrelevant.
+#define __OGRE_SIMD_ALIGN_STACK()   _alloca(16)
+
+#elif OGRE_CPU == OGRE_CPU_X86 && OGRE_COMPILER == OGRE_COMPILER_GNUC
+//
+// Horrible hack to align the stack to a 16-bytes boundary for gcc.
+//
+// We assume a gcc version >= 2.95 so that
+// -mpreferred-stack-boundary works.  Otherwise, all bets are
+// off.  However, -mpreferred-stack-boundary does not create a
+// stack alignment, but it only preserves it.  Unfortunately,
+// since Ogre are designed as a flexibility library, user might
+// compile their application with wrong stack alignment, even
+// if user taken care with stack alignment, but many versions
+// of libc on linux call main() with the wrong initial stack
+// alignment the result that the code is now pessimally aligned
+// instead of having a 50% chance of being correct.
+//
+#define __OGRE_SIMD_ALIGN_STACK()                                   \
+    {                                                               \
+        /* Use alloca to allocate some memory on the stack.  */     \
+        /* This alerts gcc that something funny is going on, */     \
+        /* so that it does not omit the frame pointer etc.   */     \
+        (void)__builtin_alloca(16);                                 \
+        /* Now align the stack pointer */                           \
+        __asm__ __volatile__ ("andl $-16, %esp");                   \
+    }
+
+#elif defined(_MSC_VER)
+// Fortunately, MSVC will align the stack automatically
+
+#endif
+
+
+// Additional platform-dependent header files and declares.
+//
+// NOTE: Should be sync with __OGRE_HAVE_SSE macro.
+//
+
+#if OGRE_DOUBLE_PRECISION == 0 && OGRE_CPU == OGRE_CPU_X86
+
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC || defined(__INTEL_COMPILER)
+#include "OgreNoMemoryMacros.h"
+#include <xmmintrin.h>
+#include "OgreMemoryMacros.h"
+
+#elif OGRE_COMPILER == OGRE_COMPILER_GNUC
+// Don't define ourself version SSE intrinsics if "xmmintrin.h" already included.
+//
+// Note: gcc in some platform already included "xmmintrin.h" for some reason.
+// I pick up macro _XMMINTRIN_H_INCLUDED here which based on the "xmmintrin.h"
+// comes with cygwin gcc 3.4.4, guess it should be solved duplicate definition
+// problem on gcc for x86.
+//
+#if !defined(_XMMINTRIN_H_INCLUDED)
+
+// Simulate VC/ICC intrinsics. Only used intrinsics are declared here.
+
+typedef float __m128 __attribute__ ((mode(V4SF),aligned(16)));
+typedef int __m64 __attribute__ ((mode(V2SI)));
+
+// Macro for declare intrinsic routines always inline even if in debug build
+#define __ALWAYS_INLINE    FORCEINLINE __attribute__ ((__always_inline__))
+
+// Shuffle instruction must be declare as macro
+
+#define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \
+    (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | ((fp0)))
+
+#define _mm_shuffle_ps(a, b, imm8) __extension__                                        \
+    ({				                                                                    \
+        __m128 result;								                                    \
+        __asm__("shufps %3, %2, %0" : "=x" (result) : "0" (a), "xm" (b), "N" (imm8));   \
+        result;								                                            \
+    })
+
+
+// Load/store instructions
+
+#define __MM_DECL_LD(name, instruction, type)                               \
+    static __ALWAYS_INLINE __m128 _mm_##name(const type *addr)              \
+    {                                                                       \
+        __m128 result;                                                      \
+        __asm__( #instruction " %1, %0" : "=x" (result) : "m" (*addr));     \
+        return result;                                                      \
+    }
+
+#define __MM_DECL_LD2(name, instruction, type)                                      \
+    static __ALWAYS_INLINE __m128 _mm_##name(__m128 val, const type *addr)          \
+    {                                                                               \
+        __m128 result;                                                              \
+        __asm__( #instruction " %2, %0" : "=x" (result) : "0"(val), "m" (*addr));   \
+        return result;                                                              \
+    }
+
+#define __MM_DECL_ST(name, instruction, type)                               \
+    static __ALWAYS_INLINE void _mm_##name(type *addr, __m128 val)          \
+    {                                                                       \
+        __asm__( #instruction " %1, %0" : "=m" (*addr) : "x" (val));        \
+    }
+
+__MM_DECL_LD(loadu_ps, movups, float)
+__MM_DECL_ST(storeu_ps, movups, float)
+
+__MM_DECL_LD(load_ss, movss, float)
+__MM_DECL_ST(store_ss, movss, float)
+
+__MM_DECL_ST(storel_pi, movlps, __m64)
+__MM_DECL_ST(storeh_pi, movhps, __m64)
+__MM_DECL_LD2(loadl_pi, movlps, __m64)
+__MM_DECL_LD2(loadh_pi, movhps, __m64)
+
+#undef __MM_DECL_LD
+#undef __MM_DECL_LD2
+#undef __MM_DECL_ST
+
+// Two operand instructions
+
+#define __MM_DECL_OP2(name, instruction, constraint)                                    \
+    static __ALWAYS_INLINE __m128 _mm_##name(__m128 a, __m128 b)                        \
+    {                                                                                   \
+        __m128 result;                                                                  \
+        __asm__( #instruction " %2, %0" : "=x" (result) : "0" (a), #constraint (b));    \
+        return result;                                                                  \
+    }
+
+__MM_DECL_OP2(add_ps, addps, xm)
+__MM_DECL_OP2(add_ss, addss, xm)
+__MM_DECL_OP2(sub_ps, subps, xm)
+__MM_DECL_OP2(sub_ss, subss, xm)
+__MM_DECL_OP2(mul_ps, mulps, xm)
+__MM_DECL_OP2(mul_ss, mulss, xm)
+
+__MM_DECL_OP2(xor_ps, xorps, xm)
+
+__MM_DECL_OP2(unpacklo_ps, unpcklps, xm)
+__MM_DECL_OP2(unpackhi_ps, unpckhps, xm)
+
+__MM_DECL_OP2(movehl_ps, movhlps, x)
+__MM_DECL_OP2(movelh_ps, movlhps, x)
+
+__MM_DECL_OP2(cmpnle_ps, cmpnleps, xm)
+
+#undef __MM_DECL_OP2
+
+// Other used instructions
+
+    static __ALWAYS_INLINE __m128 _mm_load_ps1(const float *addr)
+    {
+        __m128 tmp = _mm_load_ss(addr);
+        return _mm_shuffle_ps(tmp, tmp, 0);
+    }
+
+    static __ALWAYS_INLINE __m128 _mm_setzero_ps(void)
+    {
+        __m128 result;
+        __asm__("xorps %0, %0" : "=x" (result));
+        return result;
+    }
+
+    static __ALWAYS_INLINE __m128 _mm_rsqrt_ps(__m128 val)
+    {
+        __m128 result;
+        __asm__("rsqrtps %1, %0" : "=x" (result) : "xm" (val));
+        //__asm__("rsqrtps %0, %0" : "=x" (result) : "0" (val));
+        return result;
+    }
+
+    static __ALWAYS_INLINE int _mm_movemask_ps(__m128 val)
+    {
+        int result;
+        __asm__("movmskps %1, %0" : "=r" (result) : "x" (val));
+        return result;
+    }
+
+#endif // !defined(_XMMINTRIN_H_INCLUDED)
+
+#endif // OGRE_COMPILER == OGRE_COMPILER_GNUC
+
+#endif // OGRE_DOUBLE_PRECISION == 0 && OGRE_CPU == OGRE_CPU_X86
+
+
+
+//---------------------------------------------------------------------
+// SIMD macros and helpers
+//---------------------------------------------------------------------
+
+
+namespace Ogre {
+
+#if __OGRE_HAVE_SSE
+
+/** Macro __MM_RSQRT_PS calculate square root, which should be used for
+    normalise normals only. It might be use NewtonRaphson reciprocal square
+    root for high precision, or use SSE rsqrt instruction directly, based
+    on profile to pick up perfect one.
+@note:
+    Prefer to never use NewtonRaphson reciprocal square root at all, since
+    speed test indicate performance loss 10% for unrolled version, and loss
+    %25 for general version (P4 3.0G HT). A slight loss in precision not
+    that important in case of normalise normals.
+*/
+#if 1
+#define __MM_RSQRT_PS(x)    _mm_rsqrt_ps(x)
+#else
+#define __MM_RSQRT_PS(x)    __mm_rsqrt_nr_ps(x) // Implemented below
+#endif
+
+/** Performing the transpose of a 4x4 matrix of single precision floating
+    point values.
+    Arguments r0, r1, r2, and r3 are __m128 values whose elements
+    form the corresponding rows of a 4x4 matrix.
+    The matrix transpose is returned in arguments r0, r1, r2, and
+    r3 where r0 now holds column 0 of the original matrix, r1 now
+    holds column 1 of the original matrix, etc.
+*/
+#define __MM_TRANSPOSE4x4_PS(r0, r1, r2, r3)                                        \
+    {                                                                               \
+        __m128 t3, t2, t1, t0;                                                      \
+                                                                                    \
+                                                            /* r00 r01 r02 r03 */   \
+                                                            /* r10 r11 r12 r13 */   \
+                                                            /* r20 r21 r22 r23 */   \
+                                                            /* r30 r31 r32 r33 */   \
+                                                                                    \
+        t0 = _mm_unpacklo_ps(r0, r1);                       /* r00 r10 r01 r11 */   \
+        t2 = _mm_unpackhi_ps(r0, r1);                       /* r02 r12 r03 r13 */   \
+        t1 = _mm_unpacklo_ps(r2, r3);                       /* r20 r30 r21 r31 */   \
+        t3 = _mm_unpackhi_ps(r2, r3);                       /* r22 r32 r23 r33 */   \
+                                                                                    \
+        r0 = _mm_movelh_ps(t0, t1);                         /* r00 r10 r20 r30 */   \
+        r1 = _mm_movehl_ps(t1, t0);                         /* r01 r11 r21 r31 */   \
+        r2 = _mm_movelh_ps(t2, t3);                         /* r02 r12 r22 r32 */   \
+        r3 = _mm_movehl_ps(t3, t2);                         /* r03 r13 r23 r33 */   \
+    }
+
+/** Performing the transpose of a continuous stored rows of a 4x3 matrix to
+    a 3x4 matrix of single precision floating point values.
+    Arguments v0, v1, and v2 are __m128 values whose elements form the
+    corresponding continuous stored rows of a 4x3 matrix.
+    The matrix transpose is returned in arguments v0, v1, and v2, where
+    v0 now holds column 0 of the original matrix, v1 now holds column 1
+    of the original matrix, etc.
+*/
+#define __MM_TRANSPOSE4x3_PS(v0, v1, v2)                                            \
+    {                                                                               \
+        __m128 t0, t1, t2;                                                          \
+                                                                                    \
+                                                            /* r00 r01 r02 r10 */   \
+                                                            /* r11 r12 r20 r21 */   \
+                                                            /* r22 r30 r31 r32 */   \
+                                                                                    \
+        t0 = _mm_shuffle_ps(v0, v2, _MM_SHUFFLE(3,0,3,0));  /* r00 r10 r22 r32 */   \
+        t1 = _mm_shuffle_ps(v0, v1, _MM_SHUFFLE(1,0,2,1));  /* r01 r02 r11 r12 */   \
+        t2 = _mm_shuffle_ps(v1, v2, _MM_SHUFFLE(2,1,3,2));  /* r20 r21 r30 r31 */   \
+                                                                                    \
+        v0 = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(2,0,1,0));  /* r00 r10 r20 r30 */   \
+        v1 = _mm_shuffle_ps(t1, t2, _MM_SHUFFLE(3,1,2,0));  /* r01 r11 r21 r31 */   \
+        v2 = _mm_shuffle_ps(t1, t0, _MM_SHUFFLE(3,2,3,1));  /* r02 r12 r22 r32 */   \
+    }
+
+/** Performing the transpose of a 3x4 matrix to a continuous stored rows of
+    a 4x3 matrix of single precision floating point values.
+    Arguments v0, v1, and v2 are __m128 values whose elements form the
+    corresponding columns of a 3x4 matrix.
+    The matrix transpose is returned in arguments v0, v1, and v2, as a
+    continuous stored rows of a 4x3 matrix.
+*/
+#define __MM_TRANSPOSE3x4_PS(v0, v1, v2)                                            \
+    {                                                                               \
+        __m128 t0, t1, t2;                                                          \
+                                                                                    \
+                                                            /* r00 r10 r20 r30 */   \
+                                                            /* r01 r11 r21 r31 */   \
+                                                            /* r02 r12 r22 r32 */   \
+                                                                                    \
+        t0 = _mm_shuffle_ps(v0, v2, _MM_SHUFFLE(2,0,3,1));  /* r10 r30 r02 r22 */   \
+        t1 = _mm_shuffle_ps(v1, v2, _MM_SHUFFLE(3,1,3,1));  /* r11 r31 r12 r32 */   \
+        t2 = _mm_shuffle_ps(v0, v1, _MM_SHUFFLE(2,0,2,0));  /* r00 r20 r01 r21 */   \
+                                                                                    \
+        v0 = _mm_shuffle_ps(t2, t0, _MM_SHUFFLE(0,2,2,0));  /* r00 r01 r02 r10 */   \
+        v1 = _mm_shuffle_ps(t1, t2, _MM_SHUFFLE(3,1,2,0));  /* r11 r12 r20 r21 */   \
+        v2 = _mm_shuffle_ps(t0, t1, _MM_SHUFFLE(3,1,1,3));  /* r22 r30 r31 r32 */   \
+    }
+
+/** Fill vector of single precision floating point with selected value.
+    Argument 'fp' is a digit[0123] that represents the fp of argument 'v'.
+*/
+#define __MM_SELECT(v, fp)                                                          \
+    _mm_shuffle_ps((v), (v), _MM_SHUFFLE((fp),(fp),(fp),(fp)))
+
+/// Accumulate four vector of single precision floating point values.
+#define __MM_ACCUM4_PS(a, b, c, d)                                                  \
+    _mm_add_ps(_mm_add_ps(a, b), _mm_add_ps(c, d))
+
+/** Performing dot-product between two of four vector of single precision
+    floating point values.
+*/
+#define __MM_DOT4x4_PS(a0, a1, a2, a3, b0, b1, b2, b3)                              \
+    __MM_ACCUM4_PS(_mm_mul_ps(a0, b0), _mm_mul_ps(a1, b1), _mm_mul_ps(a2, b2), _mm_mul_ps(a3, b3))
+
+/** Performing dot-product between four vector and three vector of single
+    precision floating point values.
+*/
+#define __MM_DOT4x3_PS(r0, r1, r2, r3, v0, v1, v2)                                  \
+    __MM_ACCUM4_PS(_mm_mul_ps(r0, v0), _mm_mul_ps(r1, v1), _mm_mul_ps(r2, v2), r3)
+
+/// Accumulate three vector of single precision floating point values.
+#define __MM_ACCUM3_PS(a, b, c)                                                     \
+    _mm_add_ps(_mm_add_ps(a, b), c)
+
+/** Performing dot-product between two of three vector of single precision
+    floating point values.
+*/
+#define __MM_DOT3x3_PS(r0, r1, r2, v0, v1, v2)                                      \
+    __MM_ACCUM3_PS(_mm_mul_ps(r0, v0), _mm_mul_ps(r1, v1), _mm_mul_ps(r2, v2))
+
+/// Calculate multiply of two vector and plus another vector
+#define __MM_MADD_PS(a, b, c)                                                       \
+    _mm_add_ps(_mm_mul_ps(a, b), c)
+
+/// Linear interpolation
+#define __MM_LERP_PS(t, a, b)                                                       \
+    __MM_MADD_PS(_mm_sub_ps(b, a), t, a)
+
+/// Calculate multiply of two single floating value and plus another floating value
+#define __MM_MADD_SS(a, b, c)                                                       \
+    _mm_add_ss(_mm_mul_ss(a, b), c)
+
+/// Linear interpolation
+#define __MM_LERP_SS(t, a, b)                                                       \
+    __MM_MADD_SS(_mm_sub_ss(b, a), t, a)
+
+/// Same as _mm_load_ps, but can help VC generate more optimised code.
+#define __MM_LOAD_PS(p)                                                             \
+    (*(__m128*)(p))
+
+/// Same as _mm_store_ps, but can help VC generate more optimised code.
+#define __MM_STORE_PS(p, v)                                                         \
+    (*(__m128*)(p) = (v))
+
+
+    /** Helper to load/store SSE data based on whether or not aligned.
+    */
+    template <bool aligned = false>
+    struct SSEMemoryAccessor
+    {
+        static FORCEINLINE __m128 load(const float *p)
+        {
+            return _mm_loadu_ps(p);
+        }
+        static FORCEINLINE void store(float *p, const __m128& v)
+        {
+            _mm_storeu_ps(p, v);
+        }
+    };
+    // Special aligned accessor
+    template <>
+    struct SSEMemoryAccessor<true>
+    {
+        static FORCEINLINE const __m128& load(const float *p)
+        {
+            return __MM_LOAD_PS(p);
+        }
+        static FORCEINLINE void store(float *p, const __m128& v)
+        {
+            __MM_STORE_PS(p, v);
+        }
+    };
+
+    /** Check whether or not the given pointer perfect aligned for SSE.
+    */
+    static FORCEINLINE bool _isAlignedForSSE(const void *p)
+    {
+        return (((size_t)p) & 15) == 0;
+    }
+
+    /** Calculate NewtonRaphson Reciprocal Square Root with formula:
+            0.5 * rsqrt(x) * (3 - x * rsqrt(x)^2)
+    */
+    static FORCEINLINE __m128 __mm_rsqrt_nr_ps(const __m128& x)
+    {
+        static const __m128 v0pt5 = { 0.5f, 0.5f, 0.5f, 0.5f };
+        static const __m128 v3pt0 = { 3.0f, 3.0f, 3.0f, 3.0f };
+        __m128 t = _mm_rsqrt_ps(x);
+        return _mm_mul_ps(_mm_mul_ps(v0pt5, t),
+            _mm_sub_ps(v3pt0, _mm_mul_ps(_mm_mul_ps(x, t), t)));
+    }
+
+// Macro to check the stack aligned for SSE
+#if OGRE_DEBUG_MODE
+#define __OGRE_CHECK_STACK_ALIGNED_FOR_SSE()        \
+    {                                               \
+        __m128 test;                                \
+        assert(_isAlignedForSSE(&test));            \
+    }
+
+#else   // !OGRE_DEBUG_MODE
+#define __OGRE_CHECK_STACK_ALIGNED_FOR_SSE()
+
+#endif  // OGRE_DEBUG_MODE
+
+
+#endif  // __OGRE_HAVE_SSE
+
+}
+
+#endif // __SIMDHelper_H__
Index: /OgreMain/src/OgreSceneManager.cpp
===================================================================
--- /OgreMain/src/OgreSceneManager.cpp	(revision 5)
+++ /OgreMain/src/OgreSceneManager.cpp	(revision 5)
@@ -0,0 +1,5544 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreSceneManager.h"
+
+#include "OgreCamera.h"
+#include "OgreRenderSystem.h"
+#include "OgreMeshManager.h"
+#include "OgreMesh.h"
+#include "OgreSubMesh.h"
+#include "OgreEntity.h"
+#include "OgreSubEntity.h"
+#include "OgreLight.h"
+#include "OgreMath.h"
+#include "OgreControllerManager.h"
+#include "OgreMaterialManager.h"
+#include "OgreAnimation.h"
+#include "OgreAnimationTrack.h"
+#include "OgreRenderQueueSortingGrouping.h"
+#include "OgreOverlay.h"
+#include "OgreOverlayManager.h"
+#include "OgreStringConverter.h"
+#include "OgreRenderQueueListener.h"
+#include "OgreBillboardSet.h"
+#include "OgrePass.h"
+#include "OgreTechnique.h"
+#include "OgreTextureUnitState.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreRoot.h"
+#include "OgreSpotShadowFadePng.h"
+#include "OgreGpuProgramManager.h"
+#include "OgreGpuProgram.h"
+#include "OgreShadowVolumeExtrudeProgram.h"
+#include "OgreDataStream.h"
+#include "OgreStaticGeometry.h"
+#include "OgreHardwarePixelBuffer.h"
+#include "OgreManualObject.h"
+#include "OgreRenderQueueInvocation.h"
+#include "OgreBillboardChain.h"
+#include "OgreRibbonTrail.h"
+#include "OgreParticleSystemManager.h"
+// This class implements the most basic scene manager
+
+#include <cstdio>
+
+namespace Ogre {
+
+//-----------------------------------------------------------------------
+uint32 SceneManager::WORLD_GEOMETRY_TYPE_MASK	= 0x80000000;
+uint32 SceneManager::ENTITY_TYPE_MASK			= 0x40000000;
+uint32 SceneManager::FX_TYPE_MASK				= 0x20000000;
+uint32 SceneManager::STATICGEOMETRY_TYPE_MASK   = 0x10000000;
+uint32 SceneManager::LIGHT_TYPE_MASK			= 0x08000000;
+uint32 SceneManager::USER_TYPE_MASK_LIMIT         = SceneManager::LIGHT_TYPE_MASK;
+//-----------------------------------------------------------------------
+SceneManager::SceneManager(const String& name) :
+mName(name),
+mRenderQueue(0),
+mCurrentViewport(0),
+mSkyPlaneEntity(0),
+mSkyPlaneNode(0),
+mSkyDomeNode(0),
+mSkyBoxNode(0),
+mSkyPlaneEnabled(false),
+mSkyBoxEnabled(false),
+mSkyDomeEnabled(false),
+mFogMode(FOG_NONE),
+mFogColour(),
+mFogStart(0),
+mFogEnd(0),
+mFogDensity(0),
+mSpecialCaseQueueMode(SCRQM_EXCLUDE),
+mWorldGeometryRenderQueue(RENDER_QUEUE_WORLD_GEOMETRY_1),
+mLastFrameNumber(0),
+mResetIdentityView(false),
+mResetIdentityProj(false),
+mLightsDirtyCounter(0),
+mShadowCasterPlainBlackPass(0),
+mShadowReceiverPass(0),
+mDisplayNodes(false),
+mShowBoundingBoxes(false),
+mShadowTechnique(SHADOWTYPE_NONE),
+mDebugShadows(false),
+mShadowColour(ColourValue(0.25, 0.25, 0.25)),
+mShadowDebugPass(0),
+mShadowStencilPass(0),
+mShadowModulativePass(0),
+mShadowMaterialInitDone(false),
+mShadowIndexBufferSize(51200),
+mFullScreenQuad(0),
+mShadowDirLightExtrudeDist(10000),
+mIlluminationStage(IRS_NONE),
+mShadowTextureConfigDirty(true),
+mShadowUseInfiniteFarPlane(true),
+mShadowCasterRenderBackFaces(true),
+mShadowCasterSphereQuery(0),
+mShadowCasterAABBQuery(0),
+mShadowFarDist(0),
+mShadowFarDistSquared(0),
+mShadowTextureOffset(0.6), 
+mShadowTextureFadeStart(0.7), 
+mShadowTextureFadeEnd(0.9),
+mShadowTextureSelfShadow(false),
+mShadowTextureCustomCasterPass(0),
+mShadowTextureCustomReceiverPass(0),
+mVisibilityMask(0xFFFFFFFF),
+mFindVisibleObjects(true),
+mSuppressRenderStateChanges(false),
+mSuppressShadows(false)
+{
+    // Root scene node
+    mSceneRoot = new SceneNode(this, "root node");
+	mSceneRoot->_notifyRootNode();
+
+    // init sky
+    size_t i;
+    for (i = 0; i < 6; ++i)
+    {
+        mSkyBoxEntity[i] = 0;
+    }
+    for (i = 0; i < 5; ++i)
+    {
+        mSkyDomeEntity[i] = 0;
+    }
+
+	mShadowCasterQueryListener = new ShadowCasterSceneQueryListener(this);
+
+    Root *root = Root::getSingletonPtr();
+    if (root)
+        _setDestinationRenderSystem(root->getRenderSystem());
+
+	// Setup default queued renderable visitor
+	mActiveQueuedRenderableVisitor = &mDefaultQueuedRenderableVisitor;
+
+	// set up default shadow camera setup
+	mDefaultShadowCameraSetup.bind(new DefaultShadowCameraSetup);
+
+	// init shadow texture config
+	setShadowTextureCount(1);
+
+
+}
+//-----------------------------------------------------------------------
+SceneManager::~SceneManager()
+{
+    clearScene();
+    destroyAllCameras();
+
+	// clear down movable object collection map
+	{
+		OGRE_LOCK_MUTEX(mMovableObjectCollectionMapMutex)
+		for (MovableObjectCollectionMap::iterator i = mMovableObjectCollectionMap.begin();
+			i != mMovableObjectCollectionMap.end(); ++i)
+		{
+			delete i->second;
+		}
+		mMovableObjectCollectionMap.clear();
+	}
+
+	delete mShadowCasterQueryListener;
+    delete mSceneRoot;
+    delete mFullScreenQuad;
+    delete mShadowCasterSphereQuery;
+    delete mShadowCasterAABBQuery;
+    delete mRenderQueue;
+}
+//-----------------------------------------------------------------------
+RenderQueue* SceneManager::getRenderQueue(void)
+{
+    if (!mRenderQueue)
+    {
+        initRenderQueue();
+    }
+    return mRenderQueue;
+}
+//-----------------------------------------------------------------------
+void SceneManager::initRenderQueue(void)
+{
+    mRenderQueue = new RenderQueue();
+    // init render queues that do not need shadows
+    mRenderQueue->getQueueGroup(RENDER_QUEUE_BACKGROUND)->setShadowsEnabled(false);
+    mRenderQueue->getQueueGroup(RENDER_QUEUE_OVERLAY)->setShadowsEnabled(false);
+    mRenderQueue->getQueueGroup(RENDER_QUEUE_SKIES_EARLY)->setShadowsEnabled(false);
+    mRenderQueue->getQueueGroup(RENDER_QUEUE_SKIES_LATE)->setShadowsEnabled(false);
+}
+//-----------------------------------------------------------------------
+void SceneManager::addSpecialCaseRenderQueue(uint8 qid)
+{
+	mSpecialCaseQueueList.insert(qid);
+}
+//-----------------------------------------------------------------------
+void SceneManager::removeSpecialCaseRenderQueue(uint8 qid)
+{
+	mSpecialCaseQueueList.erase(qid);
+}
+//-----------------------------------------------------------------------
+void SceneManager::clearSpecialCaseRenderQueues(void)
+{
+	mSpecialCaseQueueList.clear();
+}
+//-----------------------------------------------------------------------
+void SceneManager::setSpecialCaseRenderQueueMode(SceneManager::SpecialCaseRenderQueueMode mode)
+{
+	mSpecialCaseQueueMode = mode;
+}
+//-----------------------------------------------------------------------
+SceneManager::SpecialCaseRenderQueueMode SceneManager::getSpecialCaseRenderQueueMode(void)
+{
+	return mSpecialCaseQueueMode;
+}
+//-----------------------------------------------------------------------
+bool SceneManager::isRenderQueueToBeProcessed(uint8 qid)
+{
+	bool inList = mSpecialCaseQueueList.find(qid) != mSpecialCaseQueueList.end();
+	return (inList && mSpecialCaseQueueMode == SCRQM_INCLUDE)
+		|| (!inList && mSpecialCaseQueueMode == SCRQM_EXCLUDE);
+}
+//-----------------------------------------------------------------------
+void SceneManager::setWorldGeometryRenderQueue(uint8 qid)
+{
+	mWorldGeometryRenderQueue = qid;
+}
+//-----------------------------------------------------------------------
+uint8 SceneManager::getWorldGeometryRenderQueue(void)
+{
+	return mWorldGeometryRenderQueue;
+}
+//-----------------------------------------------------------------------
+Camera* SceneManager::createCamera(const String& name)
+{
+    // Check name not used
+    if (mCameras.find(name) != mCameras.end())
+    {
+        OGRE_EXCEPT(
+            Exception::ERR_DUPLICATE_ITEM,
+            "A camera with the name " + name + " already exists",
+            "SceneManager::createCamera" );
+    }
+
+    Camera *c = new Camera(name, this);
+    mCameras.insert(CameraList::value_type(name, c));
+
+	// create visible bounds aab map entry
+	mCamVisibleObjectsMap[c] = VisibleObjectsBoundsInfo();
+
+    return c;
+}
+
+//-----------------------------------------------------------------------
+Camera* SceneManager::getCamera(const String& name) const
+{
+    CameraList::const_iterator i = mCameras.find(name);
+    if (i == mCameras.end())
+    {
+        OGRE_EXCEPT( Exception::ERR_ITEM_NOT_FOUND, 
+            "Cannot find Camera with name " + name,
+            "SceneManager::getCamera");
+    }
+    else
+    {
+        return i->second;
+    }
+}
+//-----------------------------------------------------------------------
+bool SceneManager::hasCamera(const String& name) const
+{
+	return (mCameras.find(name) != mCameras.end());
+}
+
+//-----------------------------------------------------------------------
+void SceneManager::destroyCamera(Camera *cam)
+{
+	destroyCamera(cam->getName());
+
+}
+
+//-----------------------------------------------------------------------
+void SceneManager::destroyCamera(const String& name)
+{
+    // Find in list
+    CameraList::iterator i = mCameras.find(name);
+    if (i != mCameras.end())
+    {
+		// Remove visible boundary AAB entry
+		CamVisibleObjectsMap::iterator camVisObjIt = mCamVisibleObjectsMap.find( i->second );
+		if ( camVisObjIt != mCamVisibleObjectsMap.end() )
+			mCamVisibleObjectsMap.erase( camVisObjIt );
+
+		// Remove light-shadow cam mapping entry
+		ShadowCamLightMapping::iterator camLightIt = mShadowCamLightMapping.find( i->second );
+		if ( camLightIt != mShadowCamLightMapping.end() )
+			mShadowCamLightMapping.erase( camLightIt );
+
+		// Notify render system
+        mDestRenderSystem->_notifyCameraRemoved(i->second);
+        delete i->second;
+        mCameras.erase(i);
+    }
+
+}
+
+//-----------------------------------------------------------------------
+void SceneManager::destroyAllCameras(void)
+{
+
+    CameraList::iterator i = mCameras.begin();
+    for (; i != mCameras.end(); ++i)
+    {
+        // Notify render system
+        mDestRenderSystem->_notifyCameraRemoved(i->second);
+        delete i->second;
+    }
+    mCameras.clear();
+	mCamVisibleObjectsMap.clear();
+	mShadowCamLightMapping.clear();
+}
+//-----------------------------------------------------------------------
+Light* SceneManager::createLight(const String& name)
+{
+	return static_cast<Light*>(
+		createMovableObject(name, LightFactory::FACTORY_TYPE_NAME));
+}
+//-----------------------------------------------------------------------
+Light* SceneManager::getLight(const String& name) const
+{
+	return static_cast<Light*>(
+		getMovableObject(name, LightFactory::FACTORY_TYPE_NAME));
+}
+//-----------------------------------------------------------------------
+bool SceneManager::hasLight(const String& name) const
+{
+	return hasMovableObject(name, LightFactory::FACTORY_TYPE_NAME);
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroyLight(Light *l)
+{
+	destroyMovableObject(l);
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroyLight(const String& name)
+{
+	destroyMovableObject(name, LightFactory::FACTORY_TYPE_NAME);
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroyAllLights(void)
+{
+	destroyAllMovableObjectsByType(LightFactory::FACTORY_TYPE_NAME);
+}
+//-----------------------------------------------------------------------
+const LightList& SceneManager::_getLightsAffectingFrustum(void) const
+{
+    return mLightsAffectingFrustum;
+}
+//-----------------------------------------------------------------------
+bool SceneManager::lightLess::operator()(const Light* a, const Light* b) const
+{
+    return a->tempSquareDist < b->tempSquareDist;
+}
+//-----------------------------------------------------------------------
+void SceneManager::_populateLightList(const Vector3& position, Real radius, 
+									  LightList& destList)
+{
+    // Really basic trawl of the lights, then sort
+    // Subclasses could do something smarter
+
+    // Pick up the lights that affecting frustum only, which should has been
+    // cached, so better than take all lights in the scene into account.
+    const LightList& candidateLights = _getLightsAffectingFrustum();
+
+    // Pre-allocate memory
+    destList.clear();
+    destList.reserve(candidateLights.size());
+
+    LightList::const_iterator it;
+    for (it = candidateLights.begin(); it != candidateLights.end(); ++it)
+    {
+        Light* lt = *it;
+        if (lt->getType() == Light::LT_DIRECTIONAL)
+        {
+            // No distance
+            lt->tempSquareDist = 0.0f;
+            destList.push_back(lt);
+        }
+        else
+        {
+            // Calc squared distance
+            lt->tempSquareDist = (lt->getDerivedPosition() - position).squaredLength();
+            // only add in-range lights
+            Real range = lt->getAttenuationRange();
+            Real maxDist = range + radius;
+            if (lt->tempSquareDist <= Math::Sqr(maxDist))
+            {
+                destList.push_back(lt);
+            }
+        }
+    }
+
+    // Sort (stable to guarantee ordering on directional lights)
+	if (isShadowTechniqueTextureBased())
+	{
+		// Note that if we're using texture shadows, we actually want to use
+		// the first few lights unchanged from the frustum list, matching the
+		// texture shadows that were generated
+		// Thus we only allow object-relative sorting on the remainder of the list
+		if (destList.size() > getShadowTextureCount())
+		{
+			LightList::iterator start = destList.begin();
+			std::advance(start, getShadowTextureCount());
+			std::stable_sort(start, destList.end(), lightLess());
+		}
+	}
+	else
+	{
+		std::stable_sort(destList.begin(), destList.end(), lightLess());
+	}
+
+
+}
+//-----------------------------------------------------------------------
+Entity* SceneManager::createEntity(const String& entityName, PrefabType ptype)
+{
+    switch (ptype)
+    {
+    case PT_PLANE:
+        return createEntity(entityName, "Prefab_Plane");
+	case PT_CUBE:
+		return createEntity(entityName, "Prefab_Cube");
+	case PT_SPHERE:
+		return createEntity(entityName, "Prefab_Sphere");
+
+        break;
+    }
+
+    OGRE_EXCEPT( Exception::ERR_ITEM_NOT_FOUND, 
+        "Unknown prefab type for entity " + entityName,
+        "SceneManager::createEntity");
+}
+
+//-----------------------------------------------------------------------
+Entity* SceneManager::createEntity(
+                                   const String& entityName,
+                                   const String& meshName )
+{
+	// delegate to factory implementation
+	NameValuePairList params;
+	params["mesh"] = meshName;
+	return static_cast<Entity*>(
+		createMovableObject(entityName, EntityFactory::FACTORY_TYPE_NAME, 
+			&params));
+
+}
+
+//-----------------------------------------------------------------------
+Entity* SceneManager::getEntity(const String& name) const
+{
+	return static_cast<Entity*>(
+		getMovableObject(name, EntityFactory::FACTORY_TYPE_NAME));
+}
+//-----------------------------------------------------------------------
+bool SceneManager::hasEntity(const String& name) const
+{
+	return hasMovableObject(name, EntityFactory::FACTORY_TYPE_NAME);
+}
+
+//-----------------------------------------------------------------------
+void SceneManager::destroyEntity(Entity *e)
+{
+	destroyMovableObject(e);
+}
+
+//-----------------------------------------------------------------------
+void SceneManager::destroyEntity(const String& name)
+{
+	destroyMovableObject(name, EntityFactory::FACTORY_TYPE_NAME);
+
+}
+
+//-----------------------------------------------------------------------
+void SceneManager::destroyAllEntities(void)
+{
+
+	destroyAllMovableObjectsByType(EntityFactory::FACTORY_TYPE_NAME);
+}
+
+//-----------------------------------------------------------------------
+void SceneManager::destroyAllBillboardSets(void)
+{
+	destroyAllMovableObjectsByType(BillboardSetFactory::FACTORY_TYPE_NAME);
+}
+//-----------------------------------------------------------------------
+ManualObject* SceneManager::createManualObject(const String& name)
+{
+	return static_cast<ManualObject*>(
+		createMovableObject(name, ManualObjectFactory::FACTORY_TYPE_NAME));
+}
+//-----------------------------------------------------------------------
+ManualObject* SceneManager::getManualObject(const String& name) const
+{
+	return static_cast<ManualObject*>(
+		getMovableObject(name, ManualObjectFactory::FACTORY_TYPE_NAME));
+
+}
+//-----------------------------------------------------------------------
+bool SceneManager::hasManualObject(const String& name) const
+{
+	return hasMovableObject(name, ManualObjectFactory::FACTORY_TYPE_NAME);
+
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroyManualObject(ManualObject* obj)
+{
+	destroyMovableObject(obj);
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroyManualObject(const String& name)
+{
+	destroyMovableObject(name, ManualObjectFactory::FACTORY_TYPE_NAME);
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroyAllManualObjects(void)
+{
+	destroyAllMovableObjectsByType(ManualObjectFactory::FACTORY_TYPE_NAME);
+}
+//-----------------------------------------------------------------------
+BillboardChain* SceneManager::createBillboardChain(const String& name)
+{
+	return static_cast<BillboardChain*>(
+		createMovableObject(name, BillboardChainFactory::FACTORY_TYPE_NAME));
+}
+//-----------------------------------------------------------------------
+BillboardChain* SceneManager::getBillboardChain(const String& name) const
+{
+	return static_cast<BillboardChain*>(
+		getMovableObject(name, BillboardChainFactory::FACTORY_TYPE_NAME));
+
+}
+//-----------------------------------------------------------------------
+bool SceneManager::hasBillboardChain(const String& name) const
+{
+	return hasMovableObject(name, BillboardChainFactory::FACTORY_TYPE_NAME);
+}
+
+//-----------------------------------------------------------------------
+void SceneManager::destroyBillboardChain(BillboardChain* obj)
+{
+	destroyMovableObject(obj);
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroyBillboardChain(const String& name)
+{
+	destroyMovableObject(name, BillboardChainFactory::FACTORY_TYPE_NAME);
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroyAllBillboardChains(void)
+{
+	destroyAllMovableObjectsByType(BillboardChainFactory::FACTORY_TYPE_NAME);
+}
+//-----------------------------------------------------------------------
+RibbonTrail* SceneManager::createRibbonTrail(const String& name)
+{
+	return static_cast<RibbonTrail*>(
+		createMovableObject(name, RibbonTrailFactory::FACTORY_TYPE_NAME));
+}
+//-----------------------------------------------------------------------
+RibbonTrail* SceneManager::getRibbonTrail(const String& name) const
+{
+	return static_cast<RibbonTrail*>(
+		getMovableObject(name, RibbonTrailFactory::FACTORY_TYPE_NAME));
+
+}
+//-----------------------------------------------------------------------
+bool SceneManager::hasRibbonTrail(const String& name) const
+{
+	return hasMovableObject(name, RibbonTrailFactory::FACTORY_TYPE_NAME);
+}
+
+//-----------------------------------------------------------------------
+void SceneManager::destroyRibbonTrail(RibbonTrail* obj)
+{
+	destroyMovableObject(obj);
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroyRibbonTrail(const String& name)
+{
+	destroyMovableObject(name, RibbonTrailFactory::FACTORY_TYPE_NAME);
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroyAllRibbonTrails(void)
+{
+	destroyAllMovableObjectsByType(RibbonTrailFactory::FACTORY_TYPE_NAME);
+}
+//-----------------------------------------------------------------------
+ParticleSystem* SceneManager::createParticleSystem(const String& name,
+	const String& templateName)
+{
+	NameValuePairList params;
+	params["templateName"] = templateName;
+	
+	return static_cast<ParticleSystem*>(
+		createMovableObject(name, ParticleSystemFactory::FACTORY_TYPE_NAME, 
+			&params));
+}
+//-----------------------------------------------------------------------
+ParticleSystem* SceneManager::createParticleSystem(const String& name,
+	size_t quota, const String& group)
+{
+	NameValuePairList params;
+	params["quota"] = StringConverter::toString(quota);
+	params["resourceGroup"] = group;
+	
+	return static_cast<ParticleSystem*>(
+		createMovableObject(name, ParticleSystemFactory::FACTORY_TYPE_NAME, 
+			&params));
+}
+//-----------------------------------------------------------------------
+ParticleSystem* SceneManager::getParticleSystem(const String& name) const
+{
+	return static_cast<ParticleSystem*>(
+		getMovableObject(name, ParticleSystemFactory::FACTORY_TYPE_NAME));
+
+}
+//-----------------------------------------------------------------------
+bool SceneManager::hasParticleSystem(const String& name) const
+{
+	return hasMovableObject(name, ParticleSystemFactory::FACTORY_TYPE_NAME);
+}
+
+//-----------------------------------------------------------------------
+void SceneManager::destroyParticleSystem(ParticleSystem* obj)
+{
+	destroyMovableObject(obj);
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroyParticleSystem(const String& name)
+{
+	destroyMovableObject(name, ParticleSystemFactory::FACTORY_TYPE_NAME);
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroyAllParticleSystems(void)
+{
+	destroyAllMovableObjectsByType(ParticleSystemFactory::FACTORY_TYPE_NAME);
+}
+//-----------------------------------------------------------------------
+void SceneManager::clearScene(void)
+{
+	destroyAllStaticGeometry();
+	destroyAllMovableObjects();
+
+	// Clear root node of all children
+	mSceneRoot->removeAllChildren();
+	mSceneRoot->detachAllObjects();
+
+	// Delete all SceneNodes, except root that is
+	for (SceneNodeList::iterator i = mSceneNodes.begin();
+		i != mSceneNodes.end(); ++i)
+	{
+		delete i->second;
+	}
+	mSceneNodes.clear();
+	mAutoTrackingSceneNodes.clear();
+
+
+	
+	// Clear animations
+    destroyAllAnimations();
+
+    // Remove sky nodes since they've been deleted
+    mSkyBoxNode = mSkyPlaneNode = mSkyDomeNode = 0;
+    mSkyBoxEnabled = mSkyPlaneEnabled = mSkyDomeEnabled = false; 
+
+	// Clear render queue, empty completely
+	if (mRenderQueue)
+		mRenderQueue->clear(true);
+
+}
+//-----------------------------------------------------------------------
+SceneNode* SceneManager::createSceneNode(void)
+{
+    SceneNode* sn = new SceneNode(this);
+    assert(mSceneNodes.find(sn->getName()) == mSceneNodes.end());
+    mSceneNodes[sn->getName()] = sn;
+    return sn;
+}
+//-----------------------------------------------------------------------
+SceneNode* SceneManager::createSceneNode(const String& name)
+{
+    // Check name not used
+    if (mSceneNodes.find(name) != mSceneNodes.end())
+    {
+        OGRE_EXCEPT(
+            Exception::ERR_DUPLICATE_ITEM,
+            "A scene node with the name " + name + " already exists",
+            "SceneManager::createSceneNode" );
+    }
+
+    SceneNode* sn = new SceneNode(this, name);
+    mSceneNodes[sn->getName()] = sn;
+    return sn;
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroySceneNode(const String& name)
+{
+    SceneNodeList::iterator i = mSceneNodes.find(name);
+
+    if (i == mSceneNodes.end())
+    {
+        OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "SceneNode '" + name + "' not found.",
+            "SceneManager::destroySceneNode");
+    }
+
+    // Find any scene nodes which are tracking this node, and turn them off
+    AutoTrackingSceneNodes::iterator ai, aiend;
+    aiend = mAutoTrackingSceneNodes.end();
+    for (ai = mAutoTrackingSceneNodes.begin(); ai != aiend; )
+    {
+		// Pre-increment incase we delete
+		AutoTrackingSceneNodes::iterator curri = ai++;
+        SceneNode* n = *curri;
+        // Tracking this node
+        if (n->getAutoTrackTarget() == i->second)
+        {
+            // turn off, this will notify SceneManager to remove
+            n->setAutoTracking(false);
+        }
+        // node is itself a tracker
+        else if (n == i->second)
+        {
+            mAutoTrackingSceneNodes.erase(curri);
+        }
+    }
+
+	// detach from parent (don't do this in destructor since bulk destruction
+	// behaves differently)
+	Node* parentNode = i->second->getParent();
+	if (parentNode)
+	{
+		parentNode->removeChild(i->second);
+	}
+    delete i->second;
+    mSceneNodes.erase(i);
+}
+//-----------------------------------------------------------------------
+SceneNode* SceneManager::getRootSceneNode(void) const
+{
+    return mSceneRoot;
+}
+//-----------------------------------------------------------------------
+SceneNode* SceneManager::getSceneNode(const String& name) const
+{
+    SceneNodeList::const_iterator i = mSceneNodes.find(name);
+
+    if (i == mSceneNodes.end())
+    {
+        OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "SceneNode '" + name + "' not found.",
+            "SceneManager::getSceneNode");
+    }
+
+    return i->second;
+
+}
+//-----------------------------------------------------------------------
+bool SceneManager::hasSceneNode(const String& name) const
+{
+	return (mSceneNodes.find(name) != mSceneNodes.end());
+}
+
+//-----------------------------------------------------------------------
+const Pass* SceneManager::_setPass(const Pass* pass, bool evenIfSuppressed, 
+								   bool shadowDerivation)
+{
+	if (!mSuppressRenderStateChanges || evenIfSuppressed)
+	{
+		if (mIlluminationStage == IRS_RENDER_TO_TEXTURE && shadowDerivation)
+		{
+			// Derive a special shadow caster pass from this one
+			pass = deriveShadowCasterPass(pass);
+		}
+		else if (mIlluminationStage == IRS_RENDER_RECEIVER_PASS && shadowDerivation)
+		{
+			pass = deriveShadowReceiverPass(pass);
+		}
+
+        // Tell params about current pass
+        mAutoParamDataSource.setCurrentPass(pass);
+
+		// TEST
+		/*
+		LogManager::getSingleton().logMessage("BEGIN PASS " + StringConverter::toString(pass->getIndex()) + 
+		" of " + pass->getParent()->getParent()->getName());
+		*/
+		bool passSurfaceAndLightParams = true;
+
+		if (pass->hasVertexProgram())
+		{
+			mDestRenderSystem->bindGpuProgram(pass->getVertexProgram()->_getBindingDelegate());
+			// bind parameters later since they can be per-object
+			// does the vertex program want surface and light params passed to rendersystem?
+			passSurfaceAndLightParams = pass->getVertexProgram()->getPassSurfaceAndLightStates();
+		}
+		else
+		{
+			// Unbind program?
+			if (mDestRenderSystem->isGpuProgramBound(GPT_VERTEX_PROGRAM))
+			{
+				mDestRenderSystem->unbindGpuProgram(GPT_VERTEX_PROGRAM);
+			}
+			// Set fixed-function vertex parameters
+		}
+
+		if (passSurfaceAndLightParams)
+		{
+			// Set surface reflectance properties, only valid if lighting is enabled
+			if (pass->getLightingEnabled())
+			{
+				mDestRenderSystem->_setSurfaceParams( 
+					pass->getAmbient(), 
+					pass->getDiffuse(), 
+					pass->getSpecular(), 
+					pass->getSelfIllumination(), 
+					pass->getShininess(),
+			pass->getVertexColourTracking() );
+			}
+
+			// Dynamic lighting enabled?
+			mDestRenderSystem->setLightingEnabled(pass->getLightingEnabled());
+		}
+
+		// Using a fragment program?
+		if (pass->hasFragmentProgram())
+		{
+			mDestRenderSystem->bindGpuProgram(
+				pass->getFragmentProgram()->_getBindingDelegate());
+			// bind parameters later since they can be per-object
+		}
+		else
+		{
+			// Unbind program?
+			if (mDestRenderSystem->isGpuProgramBound(GPT_FRAGMENT_PROGRAM))
+			{
+				mDestRenderSystem->unbindGpuProgram(GPT_FRAGMENT_PROGRAM);
+			}
+
+			// Set fixed-function fragment settings
+		}
+
+        /* We need sets fog properties always. In D3D, it applies to shaders prior
+        to version vs_3_0 and ps_3_0. And in OGL, it applies to "ARB_fog_XXX" in
+        fragment program, and in other ways, them maybe access by gpu program via
+        "state.fog.XXX".
+        */
+        // New fog params can either be from scene or from material
+        FogMode newFogMode;
+        ColourValue newFogColour;
+        Real newFogStart, newFogEnd, newFogDensity;
+        if (pass->getFogOverride())
+        {
+            // New fog params from material
+            newFogMode = pass->getFogMode();
+            newFogColour = pass->getFogColour();
+            newFogStart = pass->getFogStart();
+            newFogEnd = pass->getFogEnd();
+            newFogDensity = pass->getFogDensity();
+        }
+        else
+        {
+            // New fog params from scene
+            newFogMode = mFogMode;
+            newFogColour = mFogColour;
+            newFogStart = mFogStart;
+            newFogEnd = mFogEnd;
+            newFogDensity = mFogDensity;
+        }
+        mDestRenderSystem->_setFog(
+            newFogMode, newFogColour, newFogDensity, newFogStart, newFogEnd);
+        // Tell params about ORIGINAL fog
+		// Need to be able to override fixed function fog, but still have
+		// original fog parameters available to a shader than chooses to use
+        mAutoParamDataSource.setFog(
+            mFogMode, mFogColour, mFogDensity, mFogStart, mFogEnd);
+
+		// The rest of the settings are the same no matter whether we use programs or not
+
+		// Set scene blending
+		mDestRenderSystem->_setSceneBlending(
+			pass->getSourceBlendFactor(), pass->getDestBlendFactor());
+
+		// Set point parameters
+		mDestRenderSystem->_setPointParameters(
+			pass->getPointSize(),
+			pass->isPointAttenuationEnabled(), 
+			pass->getPointAttenuationConstant(), 
+			pass->getPointAttenuationLinear(), 
+			pass->getPointAttenuationQuadratic(), 
+			pass->getPointMinSize(), 
+			pass->getPointMaxSize());
+
+		mDestRenderSystem->_setPointSpritesEnabled(pass->getPointSpritesEnabled());
+
+		// Texture unit settings
+
+		Pass::ConstTextureUnitStateIterator texIter =  pass->getTextureUnitStateIterator();
+		size_t unit = 0;
+		// Reset the shadow texture index for each pass
+		size_t shadowTexIndex = pass->getStartLight(); // all shadow casters are at the start
+		while(texIter.hasMoreElements())
+		{
+			TextureUnitState* pTex = texIter.getNext();
+			if (!pass->getIteratePerLight() && 
+				isShadowTechniqueTextureBased() && 
+				pTex->getContentType() == TextureUnitState::CONTENT_SHADOW)
+			{
+				// Need to bind the correct shadow texture, based on the start light
+				// Even though the light list can change per object, our restrictions
+				// say that when texture shadows are enabled, the lights up to the
+				// number of texture shadows will be fixed for all objects
+				// to match the shadow textures that have been generated
+				// see ShadowListener::sortLightsAffectingFrustum and
+				// MovableObject::Listener::objectQueryLights
+				// Note that light iteration throws the indexes out so we don't bind here
+				// if that's the case, we have to bind when lights are iterated
+				// in renderSingleObject
+
+				TexturePtr shadowTex;
+				if (shadowTexIndex < mShadowTextures.size())
+				{
+					shadowTex = getShadowTexture(shadowTexIndex);
+					// Hook up projection frustum
+					Camera *cam = shadowTex->getBuffer()->getRenderTarget()->getViewport(0)->getCamera();
+					// Enable projective texturing if fixed-function, but also need to
+					// disable it explicitly for program pipeline.
+					pTex->setProjectiveTexturing(!pass->hasVertexProgram(), cam);
+					mAutoParamDataSource.setTextureProjector(cam, shadowTexIndex);
+				}
+				else
+				{
+					// Use fallback 'null' shadow texture
+					// no projection since all uniform colour anyway
+					shadowTex = mNullShadowTexture;
+					pTex->setProjectiveTexturing(false);
+					mAutoParamDataSource.setTextureProjector(0, shadowTexIndex);
+
+				}
+				pTex->_setTexturePtr(shadowTex);
+
+				++shadowTexIndex;
+			}
+			else if (mIlluminationStage == IRS_NONE && pass->hasVertexProgram())
+			{
+				// Manually set texture projector for shaders if present
+				// This won't get set any other way if using manual projection
+				TextureUnitState::EffectMap::const_iterator effi = 
+					pTex->getEffects().find(TextureUnitState::ET_PROJECTIVE_TEXTURE);
+				if (effi != pTex->getEffects().end())
+				{
+					mAutoParamDataSource.setTextureProjector(effi->second.frustum, unit);
+				}
+			}
+			mDestRenderSystem->_setTextureUnitSettings(unit, *pTex);
+			++unit;
+		}
+		// Disable remaining texture units
+		mDestRenderSystem->_disableTextureUnitsFrom(pass->getNumTextureUnitStates());
+
+		// Set up non-texture related material settings
+		// Depth buffer settings
+		mDestRenderSystem->_setDepthBufferFunction(pass->getDepthFunction());
+		mDestRenderSystem->_setDepthBufferCheckEnabled(pass->getDepthCheckEnabled());
+		mDestRenderSystem->_setDepthBufferWriteEnabled(pass->getDepthWriteEnabled());
+		mDestRenderSystem->_setDepthBias(pass->getDepthBiasConstant(), 
+			pass->getDepthBiasSlopeScale());
+		// Alpha-reject settings
+		mDestRenderSystem->_setAlphaRejectSettings(
+			pass->getAlphaRejectFunction(), pass->getAlphaRejectValue());
+		// Set colour write mode
+		// Right now we only use on/off, not per-channel
+		bool colWrite = pass->getColourWriteEnabled();
+		mDestRenderSystem->_setColourBufferWriteEnabled(colWrite, colWrite, colWrite, colWrite);
+		// Culling mode
+		if (isShadowTechniqueTextureBased() 
+			&& mIlluminationStage == IRS_RENDER_TO_TEXTURE
+			&& mShadowCasterRenderBackFaces
+			&& pass->getCullingMode() == CULL_CLOCKWISE)
+		{
+			// render back faces into shadow caster, can help with depth comparison
+			mDestRenderSystem->_setCullingMode(CULL_ANTICLOCKWISE);
+		}
+		else
+		{
+			mDestRenderSystem->_setCullingMode(pass->getCullingMode());
+		}
+		
+		// Shading
+		mDestRenderSystem->setShadingType(pass->getShadingMode());
+		// Polygon mode
+		mDestRenderSystem->_setPolygonMode(pass->getPolygonMode());
+
+		// set pass number
+    	mAutoParamDataSource.setPassNumber( pass->getIndex() );
+	}
+
+    return pass;
+}
+//-----------------------------------------------------------------------
+void SceneManager::prepareRenderQueue(void)
+{
+	RenderQueue* q = getRenderQueue();
+	// Clear the render queue
+	q->clear();
+
+	// Prep the ordering options
+
+	// If we're using a custom render squence, define based on that
+	RenderQueueInvocationSequence* seq = 
+		mCurrentViewport->_getRenderQueueInvocationSequence();
+	if (seq)
+	{
+		// Iterate once to crate / reset all
+		RenderQueueInvocationIterator invokeIt = seq->iterator();
+		while (invokeIt.hasMoreElements())
+		{
+			RenderQueueInvocation* invocation = invokeIt.getNext();
+			RenderQueueGroup* group = 
+				q->getQueueGroup(invocation->getRenderQueueGroupID());
+			group->resetOrganisationModes();
+		}
+		// Iterate again to build up options (may be more than one)
+		invokeIt = seq->iterator();
+		while (invokeIt.hasMoreElements())
+		{
+			RenderQueueInvocation* invocation = invokeIt.getNext();
+			RenderQueueGroup* group = 
+				q->getQueueGroup(invocation->getRenderQueueGroupID());
+			group->addOrganisationMode(invocation->getSolidsOrganisation());
+			// also set splitting options
+			updateRenderQueueGroupSplitOptions(group, invocation->getSuppressShadows(), 
+				invocation->getSuppressRenderStateChanges());
+		}
+	}
+	else
+	{
+		// Default all the queue groups that are there, new ones will be created
+		// with defaults too
+		RenderQueue::QueueGroupIterator groupIter = q->_getQueueGroupIterator();
+		while (groupIter.hasMoreElements())
+		{
+			RenderQueueGroup* g = groupIter.getNext();
+			g->defaultOrganisationMode();
+		}
+		// Global split options
+		updateRenderQueueSplitOptions();
+	}
+
+}
+//-----------------------------------------------------------------------
+void SceneManager::_renderScene(Camera* camera, Viewport* vp, bool includeOverlays)
+{
+    Root::getSingleton()._setCurrentSceneManager(this);
+	mActiveQueuedRenderableVisitor->targetSceneMgr = this;
+	mAutoParamDataSource.setCurrentSceneManager(this);
+
+	// Also set the internal viewport pointer at this point, for calls that need it
+	// However don't call setViewport just yet (see below)
+	mCurrentViewport = vp;
+
+    if (isShadowTechniqueInUse())
+    {
+        // Prepare shadow materials
+        initShadowVolumeMaterials();
+    }
+
+    // Perform a quick pre-check to see whether we should override far distance
+    // When using stencil volumes we have to use infinite far distance
+    // to prevent dark caps getting clipped
+    if (isShadowTechniqueStencilBased() && 
+        camera->getProjectionType() == PT_PERSPECTIVE &&
+        camera->getFarClipDistance() != 0 && 
+        mDestRenderSystem->getCapabilities()->hasCapability(RSC_INFINITE_FAR_PLANE) && 
+        mShadowUseInfiniteFarPlane)
+    {
+        // infinite far distance
+        camera->setFarClipDistance(0);
+    }
+
+    mCameraInProgress = camera;
+
+
+    // Update controllers 
+    ControllerManager::getSingleton().updateAllControllers();
+
+    // Update the scene, only do this once per frame
+    unsigned long thisFrameNumber = Root::getSingleton().getCurrentFrameNumber();
+    if (thisFrameNumber != mLastFrameNumber)
+    {
+        // Update animations
+        _applySceneAnimations();
+        mLastFrameNumber = thisFrameNumber;
+    }
+
+	{
+		// Lock scene graph mutex, no more changes until we're ready to render
+		OGRE_LOCK_MUTEX(sceneGraphMutex)
+
+		// Update scene graph for this camera (can happen multiple times per frame)
+		_updateSceneGraph(camera);
+
+		// Auto-track nodes
+		AutoTrackingSceneNodes::iterator atsni, atsniend;
+		atsniend = mAutoTrackingSceneNodes.end();
+		for (atsni = mAutoTrackingSceneNodes.begin(); atsni != atsniend; ++atsni)
+		{
+			(*atsni)->_autoTrack();
+		}
+		// Auto-track camera if required
+		camera->_autoTrack();
+
+
+		if (mIlluminationStage != IRS_RENDER_TO_TEXTURE && mFindVisibleObjects)
+		{
+			// Locate any lights which could be affecting the frustum
+			findLightsAffectingFrustum(camera);
+
+			// Are we using any shadows at all?
+			if (isShadowTechniqueInUse() && vp->getShadowsEnabled())
+			{
+				// Prepare shadow textures if texture shadow based shadowing
+				// technique in use
+				if (isShadowTechniqueTextureBased())
+				{
+					// *******
+					// WARNING
+					// *******
+					// This call will result in re-entrant calls to this method
+					// therefore anything which comes before this is NOT 
+					// guaranteed persistent. Make sure that anything which 
+					// MUST be specific to this camera / target is done 
+					// AFTER THIS POINT
+					prepareShadowTextures(camera, vp);
+					// reset the cameras because of the re-entrant call
+					mCameraInProgress = camera;
+				}
+			}
+		}
+
+		// Invert vertex winding?
+		if (camera->isReflected())
+		{
+			mDestRenderSystem->setInvertVertexWinding(true);
+		}
+		else
+		{
+			mDestRenderSystem->setInvertVertexWinding(false);
+		}
+
+		// Tell params about viewport
+		mAutoParamDataSource.setCurrentViewport(vp);
+		// Set the viewport - this is deliberately after the shadow texture update
+		setViewport(vp);
+
+		// Tell params about camera
+		mAutoParamDataSource.setCurrentCamera(camera);
+		// Set autoparams for finite dir light extrusion
+		mAutoParamDataSource.setShadowDirLightExtrusionDistance(mShadowDirLightExtrudeDist);
+
+		// Tell params about current ambient light
+		mAutoParamDataSource.setAmbientLightColour(mAmbientLight);
+		// Tell rendersystem
+		mDestRenderSystem->setAmbientLight(mAmbientLight.r, mAmbientLight.g, mAmbientLight.b);
+
+		// Tell params about render target
+		mAutoParamDataSource.setCurrentRenderTarget(vp->getTarget());
+
+
+		// Set camera window clipping planes (if any)
+		if (mDestRenderSystem->getCapabilities()->hasCapability(RSC_USER_CLIP_PLANES))
+		{
+			if (camera->isWindowSet())  
+			{
+				const std::vector<Plane>& planeList = 
+					camera->getWindowPlanes();
+				for (ushort i = 0; i < 4; ++i)
+				{
+					mDestRenderSystem->enableClipPlane(i, true);
+					mDestRenderSystem->setClipPlane(i, planeList[i]);
+				}
+			}
+			else
+			{
+				for (ushort i = 0; i < 4; ++i)
+				{
+					mDestRenderSystem->enableClipPlane(i, false);
+				}
+			}
+		}
+
+		// Prepare render queue for receiving new objects
+		prepareRenderQueue();
+
+		if (mFindVisibleObjects)
+		{
+			// Assemble an AAB on the fly which contains the scene elements visible
+			// by the camera.
+			CamVisibleObjectsMap::iterator camVisObjIt = mCamVisibleObjectsMap.find( camera );
+
+			assert (camVisObjIt != mCamVisibleObjectsMap.end() &&
+				"Should never fail to find a visible object bound for a camera, "
+				"did you override SceneManager::createCamera or something?");
+
+			// reset the bounds
+			camVisObjIt->second.reset();
+
+			// Parse the scene and tag visibles
+			_findVisibleObjects(camera, &(camVisObjIt->second),
+				mIlluminationStage == IRS_RENDER_TO_TEXTURE? true : false);
+
+			mAutoParamDataSource.setMainCamBoundsInfo(&(camVisObjIt->second));
+		}
+		// Add overlays, if viewport deems it
+		if (vp->getOverlaysEnabled() && mIlluminationStage != IRS_RENDER_TO_TEXTURE)
+		{
+			OverlayManager::getSingleton()._queueOverlaysForRendering(camera, getRenderQueue(), vp);
+		}
+		// Queue skies, if viewport seems it
+		if (vp->getSkiesEnabled() && mFindVisibleObjects && mIlluminationStage != IRS_RENDER_TO_TEXTURE)
+		{
+			_queueSkiesForRendering(camera);
+		}
+	} // end lock on scene graph mutex
+
+    mDestRenderSystem->_beginGeometryCount();
+	// Clear the viewport if required
+	if (mCurrentViewport->getClearEveryFrame())
+	{
+		mDestRenderSystem->clearFrameBuffer(
+			mCurrentViewport->getClearBuffers(), 
+			mCurrentViewport->getBackgroundColour());
+	}        
+    // Begin the frame
+    mDestRenderSystem->_beginFrame();
+
+    // Set rasterisation mode
+    mDestRenderSystem->_setPolygonMode(camera->getPolygonMode());
+
+	// Set initial camera state
+	mDestRenderSystem->_setProjectionMatrix(mCameraInProgress->getProjectionMatrixRS());
+	mDestRenderSystem->_setViewMatrix(mCameraInProgress->getViewMatrix(true));
+
+    // Render scene content
+    _renderVisibleObjects();
+
+    // End frame
+    mDestRenderSystem->_endFrame();
+
+    // Notify camera of vis faces
+    camera->_notifyRenderedFaces(mDestRenderSystem->_getFaceCount());
+
+    // Notify camera of vis batches
+    camera->_notifyRenderedBatches(mDestRenderSystem->_getBatchCount());
+
+
+}
+
+
+//-----------------------------------------------------------------------
+void SceneManager::_setDestinationRenderSystem(RenderSystem* sys)
+{
+    mDestRenderSystem = sys;
+
+}
+
+
+//-----------------------------------------------------------------------
+void SceneManager::setWorldGeometry(const String& filename)
+{
+    // This default implementation cannot handle world geometry
+    OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+        "World geometry is not supported by the generic SceneManager.",
+        "SceneManager::setWorldGeometry");
+}
+//-----------------------------------------------------------------------
+void SceneManager::setWorldGeometry(DataStreamPtr& stream, 
+	const String& typeName)
+{
+    // This default implementation cannot handle world geometry
+    OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+        "World geometry is not supported by the generic SceneManager.",
+        "SceneManager::setWorldGeometry");
+}
+
+//-----------------------------------------------------------------------
+bool SceneManager::materialLess::operator() (const Material* x, const Material* y) const
+{
+    // If x transparent and y not, x > y (since x has to overlap y)
+    if (x->isTransparent() && !y->isTransparent())
+    {
+        return false;
+    }
+    // If y is transparent and x not, x < y
+    else if (!x->isTransparent() && y->isTransparent())
+    {
+        return true;
+    }
+    else
+    {
+        // Otherwise don't care (both transparent or both solid)
+        // Just arbitrarily use pointer
+        return x < y;
+    }
+
+}
+
+//-----------------------------------------------------------------------
+void SceneManager::setSkyPlane(
+                               bool enable,
+                               const Plane& plane,
+                               const String& materialName,
+                               Real gscale,
+                               Real tiling,
+                               bool drawFirst,
+                               Real bow, 
+                               int xsegments, int ysegments, 
+                               const String& groupName)
+{
+    if (enable)
+    {
+        String meshName = mName + "SkyPlane";
+        mSkyPlane = plane;
+
+        MaterialPtr m = MaterialManager::getSingleton().getByName(materialName);
+        if (m.isNull())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+                "Sky plane material '" + materialName + "' not found.",
+                "SceneManager::setSkyPlane");
+        }
+        // Make sure the material doesn't update the depth buffer
+        m->setDepthWriteEnabled(false);
+        // Ensure loaded
+        m->load();
+
+        mSkyPlaneDrawFirst = drawFirst;
+
+        // Set up the plane
+        MeshPtr planeMesh = MeshManager::getSingleton().getByName(meshName);
+        if (!planeMesh.isNull())
+        {
+            // Destroy the old one
+            MeshManager::getSingleton().remove(planeMesh->getHandle());
+        }
+
+        // Create up vector
+        Vector3 up = plane.normal.crossProduct(Vector3::UNIT_X);
+        if (up == Vector3::ZERO)
+            up = plane.normal.crossProduct(-Vector3::UNIT_Z);
+
+        // Create skyplane
+        if( bow > 0 )
+        {
+            // Build a curved skyplane
+            planeMesh = MeshManager::getSingleton().createCurvedPlane(
+                meshName, groupName, plane, gscale * 100, gscale * 100, gscale * bow * 100, 
+                xsegments, ysegments, false, 1, tiling, tiling, up);
+        }
+        else
+        {
+            planeMesh = MeshManager::getSingleton().createPlane(
+                meshName, groupName, plane, gscale * 100, gscale * 100, xsegments, ysegments, false, 
+                1, tiling, tiling, up);
+        }
+
+        // Create entity 
+        if (mSkyPlaneEntity)
+        {
+            // destroy old one, do it by name for speed
+            destroyEntity(meshName);
+        }
+        // Create, use the same name for mesh and entity
+        mSkyPlaneEntity = createEntity(meshName, meshName);
+        mSkyPlaneEntity->setMaterialName(materialName);
+        mSkyPlaneEntity->setCastShadows(false);
+
+        // Create node and attach
+        if (!mSkyPlaneNode)
+        {
+            mSkyPlaneNode = createSceneNode(meshName + "Node");
+        }
+        else
+        {
+            mSkyPlaneNode->detachAllObjects();
+        }
+        mSkyPlaneNode->attachObject(mSkyPlaneEntity);
+
+    }
+	mSkyPlaneEnabled = enable;
+	mSkyPlaneGenParameters.skyPlaneBow = bow;
+	mSkyPlaneGenParameters.skyPlaneScale = gscale;
+	mSkyPlaneGenParameters.skyPlaneTiling = tiling;
+	mSkyPlaneGenParameters.skyPlaneXSegments = xsegments;
+	mSkyPlaneGenParameters.skyPlaneYSegments = ysegments;
+}
+//-----------------------------------------------------------------------
+void SceneManager::setSkyBox(
+                             bool enable,
+                             const String& materialName,
+                             Real distance,
+                             bool drawFirst,
+                             const Quaternion& orientation,
+                             const String& groupName)
+{
+    if (enable)
+    {
+        MaterialPtr m = MaterialManager::getSingleton().getByName(materialName);
+        if (m.isNull())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+                "Sky box material '" + materialName + "' not found.",
+                "SceneManager::setSkyBox");
+        }
+        // Make sure the material doesn't update the depth buffer
+        m->setDepthWriteEnabled(false);
+        // Ensure loaded
+        m->load();
+        // Also clamp texture, don't wrap (otherwise edges can get filtered)
+        m->getBestTechnique()->getPass(0)->getTextureUnitState(0)->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
+
+
+        mSkyBoxDrawFirst = drawFirst;
+
+        // Create node 
+        if (!mSkyBoxNode)
+        {
+            mSkyBoxNode = createSceneNode("SkyBoxNode");
+        }
+        else
+        {
+            mSkyBoxNode->detachAllObjects();
+        }
+
+        MaterialManager& matMgr = MaterialManager::getSingleton();
+        // Set up the box (6 planes)
+        for (int i = 0; i < 6; ++i)
+        {
+            MeshPtr planeMesh = createSkyboxPlane((BoxPlane)i, distance, orientation, groupName);
+            String entName = mName + "SkyBoxPlane" + StringConverter::toString(i);
+
+            // Create entity 
+            if (mSkyBoxEntity[i])
+            {
+                // destroy old one, do it by name for speed
+                destroyEntity(entName);
+            }
+            mSkyBoxEntity[i] = createEntity(entName, planeMesh->getName());
+            mSkyBoxEntity[i]->setCastShadows(false);
+            // Have to create 6 materials, one for each frame
+            // Used to use combined material but now we're using queue we can't split to change frame
+            // This doesn't use much memory because textures aren't duplicated
+            MaterialPtr boxMat = matMgr.getByName(entName);
+            if (boxMat.isNull())
+            {
+                // Create new by clone
+                boxMat = m->clone(entName);
+                boxMat->load();
+            }
+            else
+            {
+                // Copy over existing
+                m->copyDetailsTo(boxMat);
+                boxMat->load();
+            }
+            // Set active frame
+			Material::TechniqueIterator ti = boxMat->getSupportedTechniqueIterator();
+			while (ti.hasMoreElements())
+			{
+				Technique* tech = ti.getNext();
+				tech->getPass(0)->getTextureUnitState(0)->setCurrentFrame(i);
+			}
+
+            mSkyBoxEntity[i]->setMaterialName(boxMat->getName());
+
+            // Attach to node
+            mSkyBoxNode->attachObject(mSkyBoxEntity[i]);
+        } // for each plane
+
+    }
+	mSkyBoxEnabled = enable;
+	mSkyBoxGenParameters.skyBoxDistance = distance;
+}
+//-----------------------------------------------------------------------
+void SceneManager::setSkyDome(
+                              bool enable,
+                              const String& materialName,
+                              Real curvature,
+                              Real tiling,
+                              Real distance,
+                              bool drawFirst,
+                              const Quaternion& orientation,
+                              int xsegments, int ysegments, int ySegmentsToKeep,
+                              const String& groupName)
+{
+    if (enable)
+    {
+        MaterialPtr m = MaterialManager::getSingleton().getByName(materialName);
+        if (m.isNull())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+                "Sky dome material '" + materialName + "' not found.",
+                "SceneManager::setSkyDome");
+        }
+        // Make sure the material doesn't update the depth buffer
+        m->setDepthWriteEnabled(false);
+        // Ensure loaded
+        m->load();
+
+        mSkyDomeDrawFirst = drawFirst;
+
+        // Create node 
+        if (!mSkyDomeNode)
+        {
+            mSkyDomeNode = createSceneNode("SkyDomeNode");
+        }
+        else
+        {
+            mSkyDomeNode->detachAllObjects();
+        }
+
+        // Set up the dome (5 planes)
+        for (int i = 0; i < 5; ++i)
+        {
+            MeshPtr planeMesh = createSkydomePlane((BoxPlane)i, curvature, 
+                tiling, distance, orientation, xsegments, ysegments, 
+                i!=BP_UP ? ySegmentsToKeep : -1, groupName);
+
+            String entName = "SkyDomePlane" + StringConverter::toString(i);
+
+            // Create entity 
+            if (mSkyDomeEntity[i])
+            {
+                // destroy old one, do it by name for speed
+                destroyEntity(entName);
+            }
+            mSkyDomeEntity[i] = createEntity(entName, planeMesh->getName());
+            mSkyDomeEntity[i]->setMaterialName(m->getName());
+            mSkyDomeEntity[i]->setCastShadows(false);
+
+            // Attach to node
+            mSkyDomeNode->attachObject(mSkyDomeEntity[i]);
+        } // for each plane
+
+    }
+	mSkyDomeEnabled = enable;
+	mSkyDomeGenParameters.skyDomeCurvature = curvature;
+	mSkyDomeGenParameters.skyDomeDistance = distance;
+	mSkyDomeGenParameters.skyDomeTiling = tiling;
+	mSkyDomeGenParameters.skyDomeXSegments = xsegments;
+	mSkyDomeGenParameters.skyDomeYSegments = ysegments;
+	mSkyDomeGenParameters.skyDomeYSegments_keep = ySegmentsToKeep;
+}
+//-----------------------------------------------------------------------
+MeshPtr SceneManager::createSkyboxPlane(
+                                      BoxPlane bp,
+                                      Real distance,
+                                      const Quaternion& orientation,
+                                      const String& groupName)
+{
+    Plane plane;
+    String meshName;
+    Vector3 up;
+
+    meshName = mName + "SkyBoxPlane_";
+    // Set up plane equation
+    plane.d = distance;
+    switch(bp)
+    {
+    case BP_FRONT:
+        plane.normal = Vector3::UNIT_Z;
+        up = Vector3::UNIT_Y;
+        meshName += "Front";
+        break;
+    case BP_BACK:
+        plane.normal = -Vector3::UNIT_Z;
+        up = Vector3::UNIT_Y;
+        meshName += "Back";
+        break;
+    case BP_LEFT:
+        plane.normal = Vector3::UNIT_X;
+        up = Vector3::UNIT_Y;
+        meshName += "Left";
+        break;
+    case BP_RIGHT:
+        plane.normal = -Vector3::UNIT_X;
+        up = Vector3::UNIT_Y;
+        meshName += "Right";
+        break;
+    case BP_UP:
+        plane.normal = -Vector3::UNIT_Y;
+        up = Vector3::UNIT_Z;
+        meshName += "Up";
+        break;
+    case BP_DOWN:
+        plane.normal = Vector3::UNIT_Y;
+        up = -Vector3::UNIT_Z;
+        meshName += "Down";
+        break;
+    }
+    // Modify by orientation
+    plane.normal = orientation * plane.normal;
+    up = orientation * up;
+
+
+    // Check to see if existing plane
+    MeshManager& mm = MeshManager::getSingleton();
+    MeshPtr planeMesh = mm.getByName(meshName);
+    if(!planeMesh.isNull())
+    {
+        // destroy existing
+        mm.remove(planeMesh->getHandle());
+    }
+    // Create new
+    Real planeSize = distance * 2;
+    const int BOX_SEGMENTS = 1;
+    planeMesh = mm.createPlane(meshName, groupName, plane, planeSize, planeSize, 
+        BOX_SEGMENTS, BOX_SEGMENTS, false, 1, 1, 1, up);
+
+    //planeMesh->_dumpContents(meshName);
+
+    return planeMesh;
+
+}
+//-----------------------------------------------------------------------
+MeshPtr SceneManager::createSkydomePlane(
+                                       BoxPlane bp,
+                                       Real curvature,
+                                       Real tiling,
+                                       Real distance,
+                                       const Quaternion& orientation,
+                                       int xsegments, int ysegments, int ysegments_keep, 
+                                       const String& groupName)
+{
+
+    Plane plane;
+    String meshName;
+    Vector3 up;
+
+    meshName = mName + "SkyDomePlane_";
+    // Set up plane equation
+    plane.d = distance;
+    switch(bp)
+    {
+    case BP_FRONT:
+        plane.normal = Vector3::UNIT_Z;
+        up = Vector3::UNIT_Y;
+        meshName += "Front";
+        break;
+    case BP_BACK:
+        plane.normal = -Vector3::UNIT_Z;
+        up = Vector3::UNIT_Y;
+        meshName += "Back";
+        break;
+    case BP_LEFT:
+        plane.normal = Vector3::UNIT_X;
+        up = Vector3::UNIT_Y;
+        meshName += "Left";
+        break;
+    case BP_RIGHT:
+        plane.normal = -Vector3::UNIT_X;
+        up = Vector3::UNIT_Y;
+        meshName += "Right";
+        break;
+    case BP_UP:
+        plane.normal = -Vector3::UNIT_Y;
+        up = Vector3::UNIT_Z;
+        meshName += "Up";
+        break;
+    case BP_DOWN:
+        // no down
+        return MeshPtr();
+    }
+    // Modify by orientation
+    plane.normal = orientation * plane.normal;
+    up = orientation * up;
+
+    // Check to see if existing plane
+    MeshManager& mm = MeshManager::getSingleton();
+    MeshPtr planeMesh = mm.getByName(meshName);
+    if(!planeMesh.isNull())
+    {
+        // destroy existing
+        mm.remove(planeMesh->getHandle());
+    }
+    // Create new
+    Real planeSize = distance * 2;
+    planeMesh = mm.createCurvedIllusionPlane(meshName, groupName, plane, 
+        planeSize, planeSize, curvature, 
+        xsegments, ysegments, false, 1, tiling, tiling, up, 
+        orientation, HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
+        false, false, ysegments_keep);
+
+    //planeMesh->_dumpContents(meshName);
+
+    return planeMesh;
+
+}
+
+
+//-----------------------------------------------------------------------
+void SceneManager::_updateSceneGraph(Camera* cam)
+{
+	// Process queued needUpdate calls 
+	Node::processQueuedUpdates();
+
+    // Cascade down the graph updating transforms & world bounds
+    // In this implementation, just update from the root
+    // Smarter SceneManager subclasses may choose to update only
+    //   certain scene graph branches
+    mSceneRoot->_update(true, false);
+
+
+}
+//-----------------------------------------------------------------------
+void SceneManager::_findVisibleObjects(
+	Camera* cam, VisibleObjectsBoundsInfo* visibleBounds, bool onlyShadowCasters)
+{
+    // Tell nodes to find, cascade down all nodes
+    mSceneRoot->_findVisibleObjects(cam, getRenderQueue(), visibleBounds, true, 
+        mDisplayNodes, onlyShadowCasters);
+
+}
+//-----------------------------------------------------------------------
+void SceneManager::_renderVisibleObjects(void)
+{
+	RenderQueueInvocationSequence* invocationSequence = 
+		mCurrentViewport->_getRenderQueueInvocationSequence();
+	// Use custom sequence only if we're not doing the texture shadow render
+	// since texture shadow render should not be interfered with by suppressing
+	// render state changes for example
+	if (invocationSequence && mIlluminationStage != IRS_RENDER_TO_TEXTURE)
+	{
+		renderVisibleObjectsCustomSequence(invocationSequence);
+	}
+	else
+	{
+		renderVisibleObjectsDefaultSequence();
+	}
+}
+//-----------------------------------------------------------------------
+void SceneManager::renderVisibleObjectsCustomSequence(RenderQueueInvocationSequence* seq)
+{
+	RenderQueueInvocationIterator invocationIt = seq->iterator();
+	while (invocationIt.hasMoreElements())
+	{
+		RenderQueueInvocation* invocation = invocationIt.getNext();
+		uint8 qId = invocation->getRenderQueueGroupID();
+		// Skip this one if not to be processed
+		if (!isRenderQueueToBeProcessed(qId))
+			continue;
+
+
+		bool repeatQueue = false;
+		const String& invocationName = invocation->getInvocationName();
+		RenderQueueGroup* queueGroup = getRenderQueue()->getQueueGroup(qId);
+		do // for repeating queues
+		{
+			// Fire queue started event
+			if (fireRenderQueueStarted(qId, invocationName))
+			{
+				// Someone requested we skip this queue
+				break;
+			}
+
+			// Invoke it
+			invocation->invoke(queueGroup, this);
+
+			// Fire queue ended event
+			if (fireRenderQueueEnded(qId, invocationName))
+			{
+				// Someone requested we repeat this queue
+				repeatQueue = true;
+			}
+			else
+			{
+				repeatQueue = false;
+			}
+		} while (repeatQueue);
+
+
+	}
+}
+//-----------------------------------------------------------------------
+void SceneManager::renderVisibleObjectsDefaultSequence(void)
+{
+    // Render each separate queue
+    RenderQueue::QueueGroupIterator queueIt = getRenderQueue()->_getQueueGroupIterator();
+
+    // NB only queues which have been created are rendered, no time is wasted
+    //   parsing through non-existent queues (even though there are 10 available)
+
+    while (queueIt.hasMoreElements())
+    {
+        // Get queue group id
+        uint8 qId = queueIt.peekNextKey();
+		RenderQueueGroup* pGroup = queueIt.getNext();
+		// Skip this one if not to be processed
+		if (!isRenderQueueToBeProcessed(qId))
+			continue;
+
+
+        bool repeatQueue = false;
+        do // for repeating queues
+        {
+            // Fire queue started event
+			if (fireRenderQueueStarted(qId, 
+				mIlluminationStage == IRS_RENDER_TO_TEXTURE ? 
+					RenderQueueInvocation::RENDER_QUEUE_INVOCATION_SHADOWS : 
+					StringUtil::BLANK))
+            {
+                // Someone requested we skip this queue
+                break;
+            }
+
+			_renderQueueGroupObjects(pGroup, QueuedRenderableCollection::OM_PASS_GROUP);
+
+            // Fire queue ended event
+			if (fireRenderQueueEnded(qId, 
+				mIlluminationStage == IRS_RENDER_TO_TEXTURE ? 
+					RenderQueueInvocation::RENDER_QUEUE_INVOCATION_SHADOWS : 
+					StringUtil::BLANK))
+            {
+                // Someone requested we repeat this queue
+                repeatQueue = true;
+            }
+            else
+            {
+                repeatQueue = false;
+            }
+        } while (repeatQueue);
+
+    } // for each queue group
+
+}
+//-----------------------------------------------------------------------
+void SceneManager::renderAdditiveStencilShadowedQueueGroupObjects(
+	RenderQueueGroup* pGroup, 
+	QueuedRenderableCollection::OrganisationMode om)
+{
+    RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator();
+    LightList lightList;
+
+    while (groupIt.hasMoreElements())
+    {
+        RenderPriorityGroup* pPriorityGrp = groupIt.getNext();
+
+        // Sort the queue first
+        pPriorityGrp->sort(mCameraInProgress);
+
+        // Clear light list
+        lightList.clear();
+
+        // Render all the ambient passes first, no light iteration, no lights
+        renderObjects(pPriorityGrp->getSolidsBasic(), om, false, &lightList);
+        // Also render any objects which have receive shadows disabled
+        renderObjects(pPriorityGrp->getSolidsNoShadowReceive(), om, true);
+
+
+        // Now iterate per light
+        // Iterate over lights, render all volumes to stencil
+        LightList::const_iterator li, liend;
+        liend = mLightsAffectingFrustum.end();
+
+        for (li = mLightsAffectingFrustum.begin(); li != liend; ++li)
+        {
+            Light* l = *li;
+            // Set light state
+
+            if (l->getCastShadows())
+            {
+                // Clear stencil
+                mDestRenderSystem->clearFrameBuffer(FBT_STENCIL);
+                renderShadowVolumesToStencil(l, mCameraInProgress);
+                // turn stencil check on
+                mDestRenderSystem->setStencilCheckEnabled(true);
+                // NB we render where the stencil is equal to zero to render lit areas
+                mDestRenderSystem->setStencilBufferParams(CMPF_EQUAL, 0);
+            }
+
+            // render lighting passes for this light
+            if (lightList.empty())
+                lightList.push_back(l);
+            else
+                lightList[0] = l;
+            renderObjects(pPriorityGrp->getSolidsDiffuseSpecular(), om, false, &lightList);
+
+            // Reset stencil params
+            mDestRenderSystem->setStencilBufferParams();
+            mDestRenderSystem->setStencilCheckEnabled(false);
+            mDestRenderSystem->_setDepthBufferParams();
+
+        }// for each light
+
+
+        // Now render decal passes, no need to set lights as lighting will be disabled
+        renderObjects(pPriorityGrp->getSolidsDecal(), om, false);
+
+
+    }// for each priority
+
+    // Iterate again - variable name changed to appease gcc.
+    RenderQueueGroup::PriorityMapIterator groupIt2 = pGroup->getIterator();
+    while (groupIt2.hasMoreElements())
+    {
+        RenderPriorityGroup* pPriorityGrp = groupIt2.getNext();
+
+        // Do transparents (always descending sort)
+        renderObjects(pPriorityGrp->getTransparents(), 
+			QueuedRenderableCollection::OM_SORT_DESCENDING, true);
+
+    }// for each priority
+
+
+}
+//-----------------------------------------------------------------------
+void SceneManager::renderModulativeStencilShadowedQueueGroupObjects(
+	RenderQueueGroup* pGroup, 
+	QueuedRenderableCollection::OrganisationMode om)
+{
+    /* For each light, we need to render all the solids from each group, 
+    then do the modulative shadows, then render the transparents from
+    each group.
+    Now, this means we are going to reorder things more, but that it required
+    if the shadows are to look correct. The overall order is preserved anyway,
+    it's just that all the transparents are at the end instead of them being
+    interleaved as in the normal rendering loop. 
+    */
+    // Iterate through priorities
+    RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator();
+
+    while (groupIt.hasMoreElements())
+    {
+        RenderPriorityGroup* pPriorityGrp = groupIt.getNext();
+
+        // Sort the queue first
+        pPriorityGrp->sort(mCameraInProgress);
+
+        // Do (shadowable) solids
+        renderObjects(pPriorityGrp->getSolidsBasic(), om, true);
+    }
+
+
+    // Iterate over lights, render all volumes to stencil
+    LightList::const_iterator li, liend;
+    liend = mLightsAffectingFrustum.end();
+
+    for (li = mLightsAffectingFrustum.begin(); li != liend; ++li)
+    {
+        Light* l = *li;
+        if (l->getCastShadows())
+        {
+            // Clear stencil
+            mDestRenderSystem->clearFrameBuffer(FBT_STENCIL);
+            renderShadowVolumesToStencil(l, mCameraInProgress);
+            // render full-screen shadow modulator for all lights
+            _setPass(mShadowModulativePass);
+            // turn stencil check on
+            mDestRenderSystem->setStencilCheckEnabled(true);
+            // NB we render where the stencil is not equal to zero to render shadows, not lit areas
+            mDestRenderSystem->setStencilBufferParams(CMPF_NOT_EQUAL, 0);
+            renderSingleObject(mFullScreenQuad, mShadowModulativePass, false);
+            // Reset stencil params
+            mDestRenderSystem->setStencilBufferParams();
+            mDestRenderSystem->setStencilCheckEnabled(false);
+            mDestRenderSystem->_setDepthBufferParams();
+        }
+
+    }// for each light
+
+    // Iterate again - variable name changed to appease gcc.
+    RenderQueueGroup::PriorityMapIterator groupIt2 = pGroup->getIterator();
+    while (groupIt2.hasMoreElements())
+    {
+        RenderPriorityGroup* pPriorityGrp = groupIt2.getNext();
+
+        // Do non-shadowable solids
+        renderObjects(pPriorityGrp->getSolidsNoShadowReceive(), om, true);
+
+    }// for each priority
+
+
+    // Iterate again - variable name changed to appease gcc.
+    RenderQueueGroup::PriorityMapIterator groupIt3 = pGroup->getIterator();
+    while (groupIt3.hasMoreElements())
+    {
+        RenderPriorityGroup* pPriorityGrp = groupIt3.getNext();
+
+        // Do transparents (always descending sort)
+        renderObjects(pPriorityGrp->getTransparents(), 
+			QueuedRenderableCollection::OM_SORT_DESCENDING, true);
+
+    }// for each priority
+
+}
+//-----------------------------------------------------------------------
+void SceneManager::renderTextureShadowCasterQueueGroupObjects(
+	RenderQueueGroup* pGroup, 
+	QueuedRenderableCollection::OrganisationMode om)
+{
+    static LightList nullLightList;
+    // This is like the basic group render, except we skip all transparents
+    // and we also render any non-shadowed objects
+    // Note that non-shadow casters will have already been eliminated during
+    // _findVisibleObjects
+
+    // Iterate through priorities
+    RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator();
+
+    // Override auto param ambient to force vertex programs and fixed function to 
+	if (isShadowTechniqueAdditive())
+	{
+		// Use simple black / white mask if additive
+		mAutoParamDataSource.setAmbientLightColour(ColourValue::Black);
+		mDestRenderSystem->setAmbientLight(0, 0, 0);
+	}
+	else
+	{
+		// Use shadow colour as caster colour if modulative
+		mAutoParamDataSource.setAmbientLightColour(mShadowColour);
+		mDestRenderSystem->setAmbientLight(mShadowColour.r, mShadowColour.g, mShadowColour.b);
+	}
+
+    while (groupIt.hasMoreElements())
+    {
+        RenderPriorityGroup* pPriorityGrp = groupIt.getNext();
+
+        // Sort the queue first
+        pPriorityGrp->sort(mCameraInProgress);
+
+        // Do solids, override light list incase any vertex programs use them
+        renderObjects(pPriorityGrp->getSolidsBasic(), om, false, &nullLightList);
+        renderObjects(pPriorityGrp->getSolidsNoShadowReceive(), om, false, &nullLightList);
+		// Do transparents that cast shadows
+		renderTransparentShadowCasterObjects(
+				pPriorityGrp->getTransparents(), 
+				QueuedRenderableCollection::OM_SORT_DESCENDING, 
+				false, &nullLightList);
+
+
+    }// for each priority
+
+    // reset ambient light
+    mAutoParamDataSource.setAmbientLightColour(mAmbientLight);
+    mDestRenderSystem->setAmbientLight(mAmbientLight.r, mAmbientLight.g, mAmbientLight.b);
+}
+//-----------------------------------------------------------------------
+void SceneManager::renderModulativeTextureShadowedQueueGroupObjects(
+	RenderQueueGroup* pGroup, 
+	QueuedRenderableCollection::OrganisationMode om)
+{
+    /* For each light, we need to render all the solids from each group, 
+    then do the modulative shadows, then render the transparents from
+    each group.
+    Now, this means we are going to reorder things more, but that it required
+    if the shadows are to look correct. The overall order is preserved anyway,
+    it's just that all the transparents are at the end instead of them being
+    interleaved as in the normal rendering loop. 
+    */
+    // Iterate through priorities
+    RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator();
+
+    while (groupIt.hasMoreElements())
+    {
+        RenderPriorityGroup* pPriorityGrp = groupIt.getNext();
+
+        // Sort the queue first
+        pPriorityGrp->sort(mCameraInProgress);
+
+        // Do solids
+        renderObjects(pPriorityGrp->getSolidsBasic(), om, true);
+        renderObjects(pPriorityGrp->getSolidsNoShadowReceive(), om, true);
+    }
+
+
+    // Iterate over lights, render received shadows
+    // only perform this if we're in the 'normal' render stage, to avoid
+    // doing it during the render to texture
+    if (mIlluminationStage == IRS_NONE)
+    {
+        mIlluminationStage = IRS_RENDER_RECEIVER_PASS;
+
+        LightList::iterator i, iend;
+        ShadowTextureList::iterator si, siend;
+        iend = mLightsAffectingFrustum.end();
+        siend = mShadowTextures.end();
+        for (i = mLightsAffectingFrustum.begin(), si = mShadowTextures.begin();
+            i != iend && si != siend; ++i)
+        {
+            Light* l = *i;
+
+            if (!l->getCastShadows())
+                continue;
+
+			// Store current shadow texture
+            mCurrentShadowTexture = si->getPointer();
+			// Get camera for current shadow texture
+            Camera *cam = mCurrentShadowTexture->getBuffer()->getRenderTarget()->getViewport(0)->getCamera();
+            // Hook up receiver texture
+			Pass* targetPass = mShadowTextureCustomReceiverPass ?
+				mShadowTextureCustomReceiverPass : mShadowReceiverPass;
+			targetPass->getTextureUnitState(0)->setTextureName(
+				mCurrentShadowTexture->getName());
+			// Hook up projection frustum if fixed-function, but also need to
+			// disable it explicitly for program pipeline.
+			TextureUnitState* texUnit = targetPass->getTextureUnitState(0);
+			texUnit->setProjectiveTexturing(!targetPass->hasVertexProgram(), cam);
+			// clamp to border colour in case this is a custom material
+			texUnit->setTextureAddressingMode(TextureUnitState::TAM_BORDER);
+			texUnit->setTextureBorderColour(ColourValue::White);
+
+            mAutoParamDataSource.setTextureProjector(cam, 0);
+            // if this light is a spotlight, we need to add the spot fader layer
+			// BUT not if using a custom projection matrix, since then it will be
+			// inappropriately shaped most likely
+            if (l->getType() == Light::LT_SPOTLIGHT && !cam->isCustomProjectionMatrixEnabled())
+            {
+				// remove all TUs except 0 & 1 
+				// (only an issue if additive shadows have been used)
+				while(targetPass->getNumTextureUnitStates() > 2)
+					targetPass->removeTextureUnitState(2);
+
+                // Add spot fader if not present already
+                if (targetPass->getNumTextureUnitStates() == 2 && 
+					targetPass->getTextureUnitState(1)->getTextureName() == 
+						"spot_shadow_fade.png")
+				{
+					// Just set 
+					TextureUnitState* t = 
+						targetPass->getTextureUnitState(1);
+					t->setProjectiveTexturing(!targetPass->hasVertexProgram(), cam);
+				}
+                else
+				{
+					// Remove any non-conforming spot layers
+					while(targetPass->getNumTextureUnitStates() > 1)
+						targetPass->removeTextureUnitState(1);
+
+                    TextureUnitState* t = 
+                        targetPass->createTextureUnitState("spot_shadow_fade.png");
+                    t->setProjectiveTexturing(!targetPass->hasVertexProgram(), cam);
+                    t->setColourOperation(LBO_ADD);
+                    t->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
+                }
+            }
+            else 
+            {
+				// remove all TUs except 0 including spot
+				while(targetPass->getNumTextureUnitStates() > 1)
+	                targetPass->removeTextureUnitState(1);
+
+            }
+			// Set lighting / blending modes
+			targetPass->setSceneBlending(SBF_DEST_COLOUR, SBF_ZERO);
+			targetPass->setLightingEnabled(false);
+
+            targetPass->_load();
+
+			// Fire pre-receiver event
+			fireShadowTexturesPreReceiver(l, cam);
+
+            renderTextureShadowReceiverQueueGroupObjects(pGroup, om);
+
+            ++si;
+
+        }// for each light
+
+        mIlluminationStage = IRS_NONE;
+
+    }
+
+    // Iterate again - variable name changed to appease gcc.
+    RenderQueueGroup::PriorityMapIterator groupIt3 = pGroup->getIterator();
+    while (groupIt3.hasMoreElements())
+    {
+        RenderPriorityGroup* pPriorityGrp = groupIt3.getNext();
+
+        // Do transparents (always descending)
+        renderObjects(pPriorityGrp->getTransparents(), 
+			QueuedRenderableCollection::OM_SORT_DESCENDING, true);
+
+    }// for each priority
+
+}
+//-----------------------------------------------------------------------
+void SceneManager::renderAdditiveTextureShadowedQueueGroupObjects(
+	RenderQueueGroup* pGroup, 
+	QueuedRenderableCollection::OrganisationMode om)
+{
+	RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator();
+	LightList lightList;
+
+	while (groupIt.hasMoreElements())
+	{
+		RenderPriorityGroup* pPriorityGrp = groupIt.getNext();
+
+		// Sort the queue first
+		pPriorityGrp->sort(mCameraInProgress);
+
+		// Clear light list
+		lightList.clear();
+
+		// Render all the ambient passes first, no light iteration, no lights
+		renderObjects(pPriorityGrp->getSolidsBasic(), om, false, &lightList);
+		// Also render any objects which have receive shadows disabled
+		renderObjects(pPriorityGrp->getSolidsNoShadowReceive(), om, true);
+
+
+		// only perform this next part if we're in the 'normal' render stage, to avoid
+		// doing it during the render to texture
+		if (mIlluminationStage == IRS_NONE)
+		{
+			// Iterate over lights, render masked
+			LightList::const_iterator li, liend;
+			ShadowTextureList::iterator si, siend;
+			liend = mLightsAffectingFrustum.end();
+			siend = mShadowTextures.end();
+            si = mShadowTextures.begin();
+
+			for (li = mLightsAffectingFrustum.begin(); li != liend; ++li)
+			{
+				Light* l = *li;
+
+				if (l->getCastShadows() && si != siend)
+				{
+					// Store current shadow texture
+					mCurrentShadowTexture = si->getPointer();
+					// Get camera for current shadow texture
+					Camera *cam = mCurrentShadowTexture->getBuffer()->getRenderTarget()->getViewport(0)->getCamera();
+					// Hook up receiver texture
+					Pass* targetPass = mShadowTextureCustomReceiverPass ?
+						mShadowTextureCustomReceiverPass : mShadowReceiverPass;
+					targetPass->getTextureUnitState(0)->setTextureName(
+						mCurrentShadowTexture->getName());
+					// Hook up projection frustum if fixed-function, but also need to
+					// disable it explicitly for program pipeline.
+					TextureUnitState* texUnit = targetPass->getTextureUnitState(0);
+					texUnit->setProjectiveTexturing(!targetPass->hasVertexProgram(), cam);
+					// clamp to border colour in case this is a custom material
+					texUnit->setTextureAddressingMode(TextureUnitState::TAM_BORDER);
+					texUnit->setTextureBorderColour(ColourValue::White);
+					mAutoParamDataSource.setTextureProjector(cam, 0);
+					// Remove any spot fader layer
+					if (targetPass->getNumTextureUnitStates() > 1 && 
+						targetPass->getTextureUnitState(1)->getTextureName() 
+							== "spot_shadow_fade.png")
+					{
+						// remove spot fader layer (should only be there if
+						// we previously used modulative shadows)
+						targetPass->removeTextureUnitState(1);
+					}
+					// Set lighting / blending modes
+					targetPass->setSceneBlending(SBF_ONE, SBF_ONE);
+					targetPass->setLightingEnabled(true);
+					targetPass->_load();
+
+					// increment shadow texture since used
+					++si;
+
+					mIlluminationStage = IRS_RENDER_RECEIVER_PASS;
+
+				}
+				else
+				{
+					mIlluminationStage = IRS_NONE;
+
+				}
+
+                // render lighting passes for this light
+                if (lightList.empty())
+                    lightList.push_back(l);
+                else
+                    lightList[0] = l;
+				renderObjects(pPriorityGrp->getSolidsDiffuseSpecular(), om, false, &lightList);
+
+			}// for each light
+
+			mIlluminationStage = IRS_NONE;
+
+			// Now render decal passes, no need to set lights as lighting will be disabled
+			renderObjects(pPriorityGrp->getSolidsDecal(), om, false);
+
+		}
+
+
+	}// for each priority
+
+	// Iterate again - variable name changed to appease gcc.
+	RenderQueueGroup::PriorityMapIterator groupIt2 = pGroup->getIterator();
+	while (groupIt2.hasMoreElements())
+	{
+		RenderPriorityGroup* pPriorityGrp = groupIt2.getNext();
+
+		// Do transparents (always descending sort)
+		renderObjects(pPriorityGrp->getTransparents(), 
+			QueuedRenderableCollection::OM_SORT_DESCENDING, true);
+
+	}// for each priority
+
+}
+//-----------------------------------------------------------------------
+void SceneManager::renderTextureShadowReceiverQueueGroupObjects(
+	RenderQueueGroup* pGroup, 
+	QueuedRenderableCollection::OrganisationMode om)
+{
+    static LightList nullLightList;
+
+    // Iterate through priorities
+    RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator();
+
+    // Override auto param ambient to force vertex programs to go full-bright
+    mAutoParamDataSource.setAmbientLightColour(ColourValue::White);
+    mDestRenderSystem->setAmbientLight(1, 1, 1);
+
+    while (groupIt.hasMoreElements())
+    {
+        RenderPriorityGroup* pPriorityGrp = groupIt.getNext();
+
+        // Do solids, override light list incase any vertex programs use them
+        renderObjects(pPriorityGrp->getSolidsBasic(), om, false, &nullLightList);
+
+        // Don't render transparents or passes which have shadow receipt disabled
+
+    }// for each priority
+
+    // reset ambient
+    mAutoParamDataSource.setAmbientLightColour(mAmbientLight);
+    mDestRenderSystem->setAmbientLight(mAmbientLight.r, mAmbientLight.g, mAmbientLight.b);
+
+}
+//-----------------------------------------------------------------------
+void SceneManager::SceneMgrQueuedRenderableVisitor::visit(const Renderable* r)
+{
+	// Give SM a chance to eliminate
+	if (targetSceneMgr->validateRenderableForRendering(mUsedPass, r))
+	{
+		// Render a single object, this will set up auto params if required
+		targetSceneMgr->renderSingleObject(r, mUsedPass, autoLights, manualLightList);
+	}
+}
+//-----------------------------------------------------------------------
+bool SceneManager::SceneMgrQueuedRenderableVisitor::visit(const Pass* p)
+{
+	// Give SM a chance to eliminate this pass
+	if (!targetSceneMgr->validatePassForRendering(p))
+		return false;
+
+	// Set pass, store the actual one used
+	mUsedPass = targetSceneMgr->_setPass(p);
+
+
+	return true;
+}
+//-----------------------------------------------------------------------
+void SceneManager::SceneMgrQueuedRenderableVisitor::visit(const RenderablePass* rp)
+{
+	// Skip this one if we're in transparency cast shadows mode & it doesn't
+	// Don't need to implement this one in the other visit methods since
+	// transparents are never grouped, always sorted
+	if (transparentShadowCastersMode && 
+		!rp->pass->getParent()->getParent()->getTransparencyCastsShadows())
+		return;
+
+	// Give SM a chance to eliminate
+	if (targetSceneMgr->validateRenderableForRendering(rp->pass, rp->renderable))
+	{
+		mUsedPass = targetSceneMgr->_setPass(rp->pass);
+		targetSceneMgr->renderSingleObject(rp->renderable, mUsedPass, autoLights, 
+			manualLightList);
+	}
+}
+//-----------------------------------------------------------------------
+bool SceneManager::validatePassForRendering(const Pass* pass)
+{
+    // Bypass if we're doing a texture shadow render and 
+    // this pass is after the first (only 1 pass needed for shadow texture render, and 
+	// one pass for shadow texture receive for modulative technique)
+	// Also bypass if passes above the first if render state changes are
+	// suppressed since we're not actually using this pass data anyway
+    if (!mSuppressShadows && mCurrentViewport->getShadowsEnabled() &&
+		((isShadowTechniqueModulative() && mIlluminationStage == IRS_RENDER_RECEIVER_PASS)
+		 || mIlluminationStage == IRS_RENDER_TO_TEXTURE || mSuppressRenderStateChanges) && 
+        pass->getIndex() > 0)
+    {
+        return false;
+    }
+
+    return true;
+}
+//-----------------------------------------------------------------------
+bool SceneManager::validateRenderableForRendering(const Pass* pass, const Renderable* rend)
+{
+    // Skip this renderable if we're doing modulative texture shadows, it casts shadows
+    // and we're doing the render receivers pass and we're not self-shadowing
+	// also if pass number > 0
+    if (!mSuppressShadows && mCurrentViewport->getShadowsEnabled() &&
+		isShadowTechniqueTextureBased())
+	{
+		if (mIlluminationStage == IRS_RENDER_RECEIVER_PASS && 
+			rend->getCastsShadows() && !mShadowTextureSelfShadow)
+		{
+			return false;
+		}
+		// Some duplication here with validatePassForRendering, for transparents
+		if (((isShadowTechniqueModulative() && mIlluminationStage == IRS_RENDER_RECEIVER_PASS)
+			|| mIlluminationStage == IRS_RENDER_TO_TEXTURE || mSuppressRenderStateChanges) && 
+			pass->getIndex() > 0)
+		{
+			return false;
+		}
+    }
+
+    return true;
+
+}
+//-----------------------------------------------------------------------
+void SceneManager::renderObjects(const QueuedRenderableCollection& objs, 
+								 QueuedRenderableCollection::OrganisationMode om, 
+								 bool doLightIteration, 
+                                 const LightList* manualLightList)
+{
+	mActiveQueuedRenderableVisitor->autoLights = doLightIteration;
+	mActiveQueuedRenderableVisitor->manualLightList = manualLightList;
+	mActiveQueuedRenderableVisitor->transparentShadowCastersMode = false;
+	// Use visitor
+	objs.acceptVisitor(mActiveQueuedRenderableVisitor, om);
+}
+//-----------------------------------------------------------------------
+void SceneManager::_renderQueueGroupObjects(RenderQueueGroup* pGroup, 
+										   QueuedRenderableCollection::OrganisationMode om)
+{
+	bool doShadows = 
+		pGroup->getShadowsEnabled() && 
+		mCurrentViewport->getShadowsEnabled() && 
+		!mSuppressShadows && !mSuppressRenderStateChanges;
+	
+    if (doShadows && mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE)
+    {
+        // Additive stencil shadows in use
+        renderAdditiveStencilShadowedQueueGroupObjects(pGroup, om);
+    }
+    else if (doShadows && mShadowTechnique == SHADOWTYPE_STENCIL_MODULATIVE)
+    {
+        // Modulative stencil shadows in use
+        renderModulativeStencilShadowedQueueGroupObjects(pGroup, om);
+    }
+    else if (isShadowTechniqueTextureBased())
+    {
+        // Modulative texture shadows in use
+        if (mIlluminationStage == IRS_RENDER_TO_TEXTURE)
+        {
+            // Shadow caster pass
+            if (mCurrentViewport->getShadowsEnabled() &&
+                !mSuppressShadows && !mSuppressRenderStateChanges)
+            {
+                renderTextureShadowCasterQueueGroupObjects(pGroup, om);
+            }
+        }
+        else
+        {
+            // Ordinary + receiver pass
+            if (doShadows && !isShadowTechniqueIntegrated())
+			{
+				// Receiver pass(es)
+				if (isShadowTechniqueAdditive())
+				{
+					// Auto-additive
+					renderAdditiveTextureShadowedQueueGroupObjects(pGroup, om);
+				}
+				else
+				{
+					// Modulative
+            		renderModulativeTextureShadowedQueueGroupObjects(pGroup, om);
+				}
+			}
+			else
+				renderBasicQueueGroupObjects(pGroup, om);
+        }
+    }
+    else
+    {
+        // No shadows, ordinary pass
+        renderBasicQueueGroupObjects(pGroup, om);
+    }
+
+
+}
+//-----------------------------------------------------------------------
+void SceneManager::renderBasicQueueGroupObjects(RenderQueueGroup* pGroup, 
+												QueuedRenderableCollection::OrganisationMode om)
+{
+    // Basic render loop
+    // Iterate through priorities
+    RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator();
+
+    while (groupIt.hasMoreElements())
+    {
+        RenderPriorityGroup* pPriorityGrp = groupIt.getNext();
+
+        // Sort the queue first
+        pPriorityGrp->sort(mCameraInProgress);
+
+        // Do solids
+        renderObjects(pPriorityGrp->getSolidsBasic(), om, true);
+        // Do transparents (always descending)
+        renderObjects(pPriorityGrp->getTransparents(), 
+			QueuedRenderableCollection::OM_SORT_DESCENDING, true);
+
+
+    }// for each priority
+}
+//-----------------------------------------------------------------------
+void SceneManager::renderTransparentShadowCasterObjects(
+	const QueuedRenderableCollection& objs, 
+	QueuedRenderableCollection::OrganisationMode om, bool doLightIteration,
+	const LightList* manualLightList)
+{
+	mActiveQueuedRenderableVisitor->transparentShadowCastersMode = true;
+	mActiveQueuedRenderableVisitor->autoLights = doLightIteration;
+	mActiveQueuedRenderableVisitor->manualLightList = manualLightList;
+	
+	// Sort descending (transparency)
+	objs.acceptVisitor(mActiveQueuedRenderableVisitor, 
+		QueuedRenderableCollection::OM_SORT_DESCENDING);
+
+	mActiveQueuedRenderableVisitor->transparentShadowCastersMode = false;
+}
+//-----------------------------------------------------------------------
+void SceneManager::renderSingleObject(const Renderable* rend, const Pass* pass, 
+                                      bool doLightIteration, const LightList* manualLightList)
+{
+    unsigned short numMatrices;
+    static RenderOperation ro;
+
+    // Set up rendering operation
+    // I know, I know, const_cast is nasty but otherwise it requires all internal
+    // state of the Renderable assigned to the rop to be mutable
+    const_cast<Renderable*>(rend)->getRenderOperation(ro);
+    ro.srcRenderable = rend;
+
+    // Set world transformation
+    rend->getWorldTransforms(mTempXform);
+    numMatrices = rend->getNumWorldTransforms();
+    if (numMatrices > 1)
+    {
+        mDestRenderSystem->_setWorldMatrices(mTempXform, numMatrices);
+    }
+    else
+    {
+        mDestRenderSystem->_setWorldMatrix(*mTempXform);
+    }
+
+    // Issue view / projection changes if any
+    useRenderableViewProjMode(rend);
+
+    if (!mSuppressRenderStateChanges)
+    {
+        bool passSurfaceAndLightParams = true;
+
+        if (pass->isProgrammable())
+        {
+            // Tell auto params object about the renderable change
+            mAutoParamDataSource.setCurrentRenderable(rend);
+            // Tell auto params object about the world matrices, eliminated query from renderable again
+            mAutoParamDataSource.setWorldMatrices(mTempXform, numMatrices);
+            pass->_updateAutoParamsNoLights(mAutoParamDataSource);
+            if (pass->hasVertexProgram())
+            {
+                passSurfaceAndLightParams = pass->getVertexProgram()->getPassSurfaceAndLightStates();
+            }
+        }
+
+        // Reissue any texture gen settings which are dependent on view matrix
+        Pass::ConstTextureUnitStateIterator texIter =  pass->getTextureUnitStateIterator();
+        size_t unit = 0;
+        while(texIter.hasMoreElements())
+        {
+            TextureUnitState* pTex = texIter.getNext();
+            if (pTex->hasViewRelativeTextureCoordinateGeneration())
+            {
+                mDestRenderSystem->_setTextureUnitSettings(unit, *pTex);
+            }
+            ++unit;
+        }
+
+        // Sort out normalisation
+        mDestRenderSystem->setNormaliseNormals(rend->getNormaliseNormals());
+
+        // Set up the solid / wireframe override
+		// Precedence is Camera, Object, Material
+		// Camera might not override object if not overrideable
+		PolygonMode reqMode = pass->getPolygonMode();
+		if (rend->getPolygonModeOverrideable())
+		{
+            PolygonMode camPolyMode = mCameraInProgress->getPolygonMode();
+			// check camera detial only when render detail is overridable
+			if (reqMode > camPolyMode)
+			{
+				// only downgrade detail; if cam says wireframe we don't go up to solid
+				reqMode = camPolyMode;
+			}
+		}
+		mDestRenderSystem->_setPolygonMode(reqMode);
+
+		mDestRenderSystem->setClipPlanes(rend->getClipPlanes());
+
+		if (doLightIteration)
+		{
+            // Create local light list for faster light iteration setup
+            static LightList localLightList;
+
+
+			// Here's where we issue the rendering operation to the render system
+			// Note that we may do this once per light, therefore it's in a loop
+			// and the light parameters are updated once per traversal through the
+			// loop
+			const LightList& rendLightList = rend->getLights();
+
+			bool iteratePerLight = pass->getIteratePerLight();
+
+			// deliberately unsigned in case start light exceeds number of lights
+			// in which case this pass would be skipped
+			int lightsLeft = 1;
+			if (iteratePerLight)
+			{
+				lightsLeft = static_cast<int>(rendLightList.size()) - pass->getStartLight();
+				// Don't allow total light count for all iterations to exceed max per pass
+				if (lightsLeft > static_cast<int>(pass->getMaxSimultaneousLights()))
+				{
+					lightsLeft = static_cast<int>(pass->getMaxSimultaneousLights());
+				}
+
+			}
+
+			const LightList* pLightListToUse;
+			// Start counting from the start light
+			size_t lightIndex = pass->getStartLight();
+
+			while (lightsLeft > 0)
+			{
+				// Determine light list to use
+				if (iteratePerLight)
+				{
+					localLightList.resize(pass->getLightCountPerIteration());
+
+					LightList::iterator destit = localLightList.begin();
+					unsigned short numShadowTextureLights = 0;
+					for (; destit != localLightList.end() 
+							&& lightIndex < rendLightList.size(); 
+						++lightIndex, --lightsLeft)
+					{
+						// Check whether we need to filter this one out
+						if (pass->getRunOnlyForOneLightType() && 
+							pass->getOnlyLightType() != rendLightList[lightIndex]->getType())
+						{
+							// Skip
+							continue;
+						}
+
+						*destit++ = rendLightList[lightIndex];
+						// potentially need to update content_type shadow texunit
+						// corresponding to this light
+						if (isShadowTechniqueTextureBased() && lightIndex < mShadowTextures.size())
+						{
+							// link the numShadowTextureLights'th shadow texture unit
+							unsigned short tuindex = 
+								pass->_getTextureUnitWithContentTypeIndex(
+								TextureUnitState::CONTENT_SHADOW, numShadowTextureLights);
+							if (tuindex < pass->getNumTextureUnitStates())
+							{
+								// I know, nasty const_cast
+								TextureUnitState* tu = 
+									const_cast<TextureUnitState*>(
+										pass->getTextureUnitState(tuindex));
+								const TexturePtr& shadowTex = mShadowTextures[lightIndex];
+								tu->_setTexturePtr(shadowTex);
+								Camera *cam = shadowTex->getBuffer()->getRenderTarget()->getViewport(0)->getCamera();
+								tu->setProjectiveTexturing(!pass->hasVertexProgram(), cam);
+								mAutoParamDataSource.setTextureProjector(cam, numShadowTextureLights);
+								++numShadowTextureLights;
+								// Have to set TU on rendersystem right now, although
+								// autoparams will be set later
+								mDestRenderSystem->_setTextureUnitSettings(tuindex, *tu);
+							}
+
+						}
+
+
+
+					}
+					// Did we run out of lights before slots? e.g. 5 lights, 2 per iteration
+					if (destit != localLightList.end())
+					{
+						localLightList.erase(destit, localLightList.end());
+						lightsLeft = 0;
+					}
+					pLightListToUse = &localLightList;
+				}
+				else
+				{
+					// Use complete light list potentially adjusted by start light
+					if (pass->getStartLight() || pass->getMaxSimultaneousLights() != OGRE_MAX_SIMULTANEOUS_LIGHTS)
+					{
+						// out of lights?
+						if (pass->getStartLight() >= rendLightList.size())
+						{
+							lightsLeft = 0;
+							break;
+						}
+						else
+						{
+							localLightList.clear();
+							LightList::const_iterator copyStart = rendLightList.begin();
+							std::advance(copyStart, pass->getStartLight());
+							LightList::const_iterator copyEnd = copyStart;
+							// Clamp lights to copy to avoid overrunning the end of the list
+							size_t lightsToCopy = std::min(
+								static_cast<size_t>(pass->getMaxSimultaneousLights()), 
+								rendLightList.size() - pass->getStartLight());
+							std::advance(copyEnd, lightsToCopy);
+							localLightList.insert(localLightList.begin(), 
+								copyStart, copyEnd);
+							pLightListToUse = &localLightList;
+						}
+					}
+					else
+					{
+						pLightListToUse = &rendLightList;
+					}
+					lightsLeft = 0;
+				}
+
+
+				// Do we need to update GPU program parameters?
+				if (pass->isProgrammable())
+				{
+					// Update any automatic gpu params for lights
+					// Other bits of information will have to be looked up
+					mAutoParamDataSource.setCurrentLightList(pLightListToUse);
+					pass->_updateAutoParamsLightsOnly(mAutoParamDataSource);
+					// NOTE: We MUST bind parameters AFTER updating the autos
+
+					if (pass->hasVertexProgram())
+					{
+						mDestRenderSystem->bindGpuProgramParameters(GPT_VERTEX_PROGRAM, 
+							pass->getVertexProgramParameters());
+					}
+					if (pass->hasFragmentProgram())
+					{
+						mDestRenderSystem->bindGpuProgramParameters(GPT_FRAGMENT_PROGRAM, 
+							pass->getFragmentProgramParameters());
+					}
+				}
+				// Do we need to update light states? 
+				// Only do this if fixed-function vertex lighting applies
+				if (pass->getLightingEnabled() && passSurfaceAndLightParams)
+				{
+					mDestRenderSystem->_useLights(*pLightListToUse, pass->getMaxSimultaneousLights());
+				}
+				// issue the render op		
+				// nfz: check for gpu_multipass
+				mDestRenderSystem->setCurrentPassIterationCount(pass->getPassIterationCount());
+				mDestRenderSystem->_render(ro);
+			} // possibly iterate per light
+		}
+		else // no automatic light processing
+		{
+			// Even if manually driving lights, check light type passes
+			bool skipBecauseOfLightType = false;
+			if (pass->getRunOnlyForOneLightType())
+			{
+				if (!manualLightList ||
+					(manualLightList->size() == 1 && 
+					manualLightList->at(0)->getType() != pass->getOnlyLightType())) 
+				{
+					skipBecauseOfLightType = true;
+				}
+			}
+
+			if (!skipBecauseOfLightType)
+			{
+				// Do we need to update GPU program parameters?
+				if (pass->isProgrammable())
+				{
+					// Do we have a manual light list?
+					if (manualLightList)
+					{
+						// Update any automatic gpu params for lights
+						mAutoParamDataSource.setCurrentLightList(manualLightList);
+						pass->_updateAutoParamsLightsOnly(mAutoParamDataSource);
+					}
+
+					if (pass->hasVertexProgram())
+					{
+						mDestRenderSystem->bindGpuProgramParameters(GPT_VERTEX_PROGRAM, 
+							pass->getVertexProgramParameters());
+					}
+					if (pass->hasFragmentProgram())
+					{
+						mDestRenderSystem->bindGpuProgramParameters(GPT_FRAGMENT_PROGRAM, 
+							pass->getFragmentProgramParameters());
+					}
+				}
+
+				// Use manual lights if present, and not using vertex programs that don't use fixed pipeline
+				if (manualLightList && 
+					pass->getLightingEnabled() && passSurfaceAndLightParams)
+				{
+					mDestRenderSystem->_useLights(*manualLightList, pass->getMaxSimultaneousLights());
+				}
+				// issue the render op		
+				// nfz: set up multipass rendering
+				mDestRenderSystem->setCurrentPassIterationCount(pass->getPassIterationCount());
+				mDestRenderSystem->_render(ro);
+			} // !skipBecauseOfLightType
+		}
+
+	}
+	else // mSuppressRenderStateChanges
+	{
+		// Just render
+		mDestRenderSystem->setCurrentPassIterationCount(1);
+		mDestRenderSystem->_render(ro);
+	}
+	
+    // Reset view / projection changes if any
+    resetViewProjMode();
+
+}
+//-----------------------------------------------------------------------
+void SceneManager::setAmbientLight(const ColourValue& colour)
+{
+    mAmbientLight = colour;
+}
+//-----------------------------------------------------------------------
+const ColourValue& SceneManager::getAmbientLight(void) const
+{
+    return mAmbientLight;
+}
+//-----------------------------------------------------------------------
+ViewPoint SceneManager::getSuggestedViewpoint(bool random)
+{
+    // By default return the origin
+    ViewPoint vp;
+    vp.position = Vector3::ZERO;
+    vp.orientation = Quaternion::IDENTITY;
+    return vp;
+}
+//-----------------------------------------------------------------------
+void SceneManager::setFog(FogMode mode, const ColourValue& colour, Real density, Real start, Real end)
+{
+    mFogMode = mode;
+    mFogColour = colour;
+    mFogStart = start;
+    mFogEnd = end;
+    mFogDensity = density;
+}
+//-----------------------------------------------------------------------
+FogMode SceneManager::getFogMode(void) const
+{
+    return mFogMode;
+}
+//-----------------------------------------------------------------------
+const ColourValue& SceneManager::getFogColour(void) const
+{
+    return mFogColour;
+}
+//-----------------------------------------------------------------------
+Real SceneManager::getFogStart(void) const
+{
+    return mFogStart;
+}
+//-----------------------------------------------------------------------
+Real SceneManager::getFogEnd(void) const
+{
+    return mFogEnd;
+}
+//-----------------------------------------------------------------------
+Real SceneManager::getFogDensity(void) const
+{
+    return mFogDensity;
+}
+//-----------------------------------------------------------------------
+BillboardSet* SceneManager::createBillboardSet(const String& name, unsigned int poolSize)
+{
+	NameValuePairList params;
+	params["poolSize"] = StringConverter::toString(poolSize);
+	return static_cast<BillboardSet*>(
+		createMovableObject(name, BillboardSetFactory::FACTORY_TYPE_NAME, &params));
+}
+//-----------------------------------------------------------------------
+BillboardSet* SceneManager::getBillboardSet(const String& name) const
+{
+	return static_cast<BillboardSet*>(
+		getMovableObject(name, BillboardSetFactory::FACTORY_TYPE_NAME));
+}
+//-----------------------------------------------------------------------
+bool SceneManager::hasBillboardSet(const String& name) const
+{
+	return hasMovableObject(name, BillboardSetFactory::FACTORY_TYPE_NAME);
+}
+
+//-----------------------------------------------------------------------
+void SceneManager::destroyBillboardSet(BillboardSet* set)
+{
+	destroyMovableObject(set);
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroyBillboardSet(const String& name)
+{
+	destroyMovableObject(name, BillboardSetFactory::FACTORY_TYPE_NAME);
+}
+//-----------------------------------------------------------------------
+void SceneManager::setDisplaySceneNodes(bool display)
+{
+    mDisplayNodes = display;
+}
+//-----------------------------------------------------------------------
+Animation* SceneManager::createAnimation(const String& name, Real length)
+{
+	OGRE_LOCK_MUTEX(mAnimationsListMutex)
+
+    // Check name not used
+    if (mAnimationsList.find(name) != mAnimationsList.end())
+    {
+        OGRE_EXCEPT(
+            Exception::ERR_DUPLICATE_ITEM,
+            "An animation with the name " + name + " already exists",
+            "SceneManager::createAnimation" );
+    }
+
+    Animation* pAnim = new Animation(name, length);
+    mAnimationsList[name] = pAnim;
+    return pAnim;
+}
+//-----------------------------------------------------------------------
+Animation* SceneManager::getAnimation(const String& name) const
+{
+	OGRE_LOCK_MUTEX(mAnimationsListMutex)
+
+	AnimationList::const_iterator i = mAnimationsList.find(name);
+    if (i == mAnimationsList.end())
+    {
+        OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+            "Cannot find animation with name " + name, 
+            "SceneManager::getAnimation");
+    }
+    return i->second;
+}
+//-----------------------------------------------------------------------
+bool SceneManager::hasAnimation(const String& name) const
+{
+	OGRE_LOCK_MUTEX(mAnimationsListMutex)
+	return (mAnimationsList.find(name) != mAnimationsList.end());
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroyAnimation(const String& name)
+{
+	OGRE_LOCK_MUTEX(mAnimationsListMutex)
+
+	// Also destroy any animation states referencing this animation
+	mAnimationStates.removeAnimationState(name);
+
+	AnimationList::iterator i = mAnimationsList.find(name);
+	if (i == mAnimationsList.end())
+	{
+		OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+			"Cannot find animation with name " + name, 
+			"SceneManager::getAnimation");
+	}
+
+	// Free memory
+	delete i->second;
+
+	mAnimationsList.erase(i);
+
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroyAllAnimations(void)
+{
+	OGRE_LOCK_MUTEX(mAnimationsListMutex)
+    // Destroy all states too, since they cannot reference destroyed animations
+    destroyAllAnimationStates();
+
+	AnimationList::iterator i;
+	for (i = mAnimationsList.begin(); i != mAnimationsList.end(); ++i)
+	{
+		// destroy
+		delete i->second;
+	}
+	mAnimationsList.clear();
+}
+//-----------------------------------------------------------------------
+AnimationState* SceneManager::createAnimationState(const String& animName)
+{
+    // Get animation, this will throw an exception if not found
+    Animation* anim = getAnimation(animName);
+
+    // Create new state
+	return mAnimationStates.createAnimationState(animName, 0, anim->getLength());
+
+}
+//-----------------------------------------------------------------------
+AnimationState* SceneManager::getAnimationState(const String& animName) const
+{
+	return mAnimationStates.getAnimationState(animName);
+
+}
+//-----------------------------------------------------------------------
+bool SceneManager::hasAnimationState(const String& name) const
+{
+	return mAnimationStates.hasAnimationState(name);
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroyAnimationState(const String& name)
+{
+	mAnimationStates.removeAnimationState(name);
+}
+//-----------------------------------------------------------------------
+void SceneManager::destroyAllAnimationStates(void)
+{
+    mAnimationStates.removeAllAnimationStates();
+}
+//-----------------------------------------------------------------------
+void SceneManager::_applySceneAnimations(void)
+{
+	// manual lock over states (extended duration required)
+	OGRE_LOCK_MUTEX(mAnimationStates.OGRE_AUTO_MUTEX_NAME)
+
+    ConstEnabledAnimationStateIterator stateIt = mAnimationStates.getEnabledAnimationStateIterator();
+
+    while (stateIt.hasMoreElements())
+    {
+        const AnimationState* state = stateIt.getNext();
+        Animation* anim = getAnimation(state->getAnimationName());
+
+        // Reset any nodes involved
+        // NB this excludes blended animations
+        Animation::NodeTrackIterator nodeTrackIt = anim->getNodeTrackIterator();
+        while(nodeTrackIt.hasMoreElements())
+        {
+            Node* nd = nodeTrackIt.getNext()->getAssociatedNode();
+			if (nd)
+				nd->resetToInitialState();
+        }
+
+        Animation::NumericTrackIterator numTrackIt = anim->getNumericTrackIterator();
+        while(numTrackIt.hasMoreElements())
+        {
+            const AnimableValuePtr& anim = numTrackIt.getNext()->getAssociatedAnimable();
+			if (!anim.isNull())
+				anim->resetToBaseValue();
+        }
+
+        // Apply the animation
+        anim->apply(state->getTimePosition(), state->getWeight());
+    }
+
+
+}
+//---------------------------------------------------------------------
+void SceneManager::manualRender(RenderOperation* rend, 
+                                Pass* pass, Viewport* vp, const Matrix4& worldMatrix, 
+                                const Matrix4& viewMatrix, const Matrix4& projMatrix, 
+                                bool doBeginEndFrame) 
+{
+    mDestRenderSystem->_setViewport(vp);
+    mDestRenderSystem->_setWorldMatrix(worldMatrix);
+    mDestRenderSystem->_setViewMatrix(viewMatrix);
+    mDestRenderSystem->_setProjectionMatrix(projMatrix);
+
+    if (doBeginEndFrame)
+        mDestRenderSystem->_beginFrame();
+
+    _setPass(pass);
+	// Do we need to update GPU program parameters?
+	if (pass->isProgrammable())
+	{
+		mAutoParamDataSource.setCurrentViewport(vp);
+		mAutoParamDataSource.setCurrentRenderTarget(vp->getTarget());
+		mAutoParamDataSource.setCurrentSceneManager(this);
+		mAutoParamDataSource.setWorldMatrices(&worldMatrix, 1);
+		Camera dummyCam(StringUtil::BLANK, 0);
+		dummyCam.setCustomViewMatrix(true, viewMatrix);
+		dummyCam.setCustomProjectionMatrix(true, projMatrix);
+		pass->_updateAutoParamsNoLights(mAutoParamDataSource);
+		// NOTE: We MUST bind parameters AFTER updating the autos
+		if (pass->hasVertexProgram())
+		{
+			mDestRenderSystem->bindGpuProgramParameters(GPT_VERTEX_PROGRAM, 
+				pass->getVertexProgramParameters());
+		}
+		if (pass->hasFragmentProgram())
+		{
+			mDestRenderSystem->bindGpuProgramParameters(GPT_FRAGMENT_PROGRAM, 
+				pass->getFragmentProgramParameters());
+		}
+	}
+    mDestRenderSystem->_render(*rend);
+
+    if (doBeginEndFrame)
+        mDestRenderSystem->_endFrame();
+
+}
+//---------------------------------------------------------------------
+void SceneManager::useRenderableViewProjMode(const Renderable* pRend)
+{
+    // Check view matrix
+    bool useIdentityView = pRend->getUseIdentityView();
+    if (useIdentityView)
+    {
+        // Using identity view now, change it
+        mDestRenderSystem->_setViewMatrix(Matrix4::IDENTITY);
+        mResetIdentityView = true;
+    }
+
+    bool useIdentityProj = pRend->getUseIdentityProjection();
+    if (useIdentityProj)
+    {
+        // Use identity projection matrix, still need to take RS depth into account.
+        Matrix4 mat;
+        mDestRenderSystem->_convertProjectionMatrix(Matrix4::IDENTITY, mat);
+        mDestRenderSystem->_setProjectionMatrix(mat);
+
+        mResetIdentityProj = true;
+    }
+
+    
+}
+//---------------------------------------------------------------------
+void SceneManager::resetViewProjMode(void)
+{
+    if (mResetIdentityView)
+    {
+        // Coming back to normal from identity view
+        mDestRenderSystem->_setViewMatrix(mCameraInProgress->getViewMatrix(true));
+        mResetIdentityView = false;
+    }
+    
+    if (mResetIdentityProj)
+    {
+        // Coming back from flat projection
+        mDestRenderSystem->_setProjectionMatrix(mCameraInProgress->getProjectionMatrixRS());
+        mResetIdentityProj = false;
+    }
+    
+
+}
+//---------------------------------------------------------------------
+void SceneManager::_queueSkiesForRendering(Camera* cam)
+{
+    // Update nodes
+    // Translate the box by the camera position (constant distance)
+    if (mSkyPlaneNode)
+    {
+        // The plane position relative to the camera has already been set up
+        mSkyPlaneNode->setPosition(cam->getDerivedPosition());
+    }
+
+    if (mSkyBoxNode)
+    {
+        mSkyBoxNode->setPosition(cam->getDerivedPosition());
+    }
+
+    if (mSkyDomeNode)
+    {
+        mSkyDomeNode->setPosition(cam->getDerivedPosition());
+    }
+
+    uint8 qid;
+    if (mSkyPlaneEnabled)
+    {
+        qid = mSkyPlaneDrawFirst? 
+RENDER_QUEUE_SKIES_EARLY : RENDER_QUEUE_SKIES_LATE;
+        getRenderQueue()->addRenderable(mSkyPlaneEntity->getSubEntity(0), qid, OGRE_RENDERABLE_DEFAULT_PRIORITY);
+    }
+
+    uint plane;
+    if (mSkyBoxEnabled)
+    {
+        qid = mSkyBoxDrawFirst? 
+RENDER_QUEUE_SKIES_EARLY : RENDER_QUEUE_SKIES_LATE;
+
+        for (plane = 0; plane < 6; ++plane)
+        {
+            getRenderQueue()->addRenderable(
+                mSkyBoxEntity[plane]->getSubEntity(0), qid, OGRE_RENDERABLE_DEFAULT_PRIORITY);
+        }
+    }
+
+    if (mSkyDomeEnabled)
+    {
+        qid = mSkyDomeDrawFirst? 
+RENDER_QUEUE_SKIES_EARLY : RENDER_QUEUE_SKIES_LATE;
+
+        for (plane = 0; plane < 5; ++plane)
+        {
+            getRenderQueue()->addRenderable(
+                mSkyDomeEntity[plane]->getSubEntity(0), qid, OGRE_RENDERABLE_DEFAULT_PRIORITY);
+        }
+    }
+}
+//---------------------------------------------------------------------
+void SceneManager::addRenderQueueListener(RenderQueueListener* newListener)
+{
+    mRenderQueueListeners.push_back(newListener);
+}
+//---------------------------------------------------------------------
+void SceneManager::removeRenderQueueListener(RenderQueueListener* delListener)
+{
+    RenderQueueListenerList::iterator i, iend;
+    iend = mRenderQueueListeners.end();
+    for (i = mRenderQueueListeners.begin(); i != iend; ++i)
+    {
+        if (*i == delListener)
+        {
+            mRenderQueueListeners.erase(i);
+            break;
+        }
+    }
+
+}
+//---------------------------------------------------------------------
+void SceneManager::addShadowListener(ShadowListener* newListener)
+{
+    mShadowListeners.push_back(newListener);
+}
+//---------------------------------------------------------------------
+void SceneManager::removeShadowListener(ShadowListener* delListener)
+{
+    ShadowListenerList::iterator i, iend;
+    iend = mShadowListeners.end();
+    for (i = mShadowListeners.begin(); i != iend; ++i)
+    {
+        if (*i == delListener)
+        {
+            mShadowListeners.erase(i);
+            break;
+        }
+    }
+
+}
+//---------------------------------------------------------------------
+bool SceneManager::fireRenderQueueStarted(uint8 id, const String& invocation)
+{
+    RenderQueueListenerList::iterator i, iend;
+    bool skip = false;
+
+    iend = mRenderQueueListeners.end();
+    for (i = mRenderQueueListeners.begin(); i != iend; ++i)
+    {
+        (*i)->renderQueueStarted(id, invocation, skip);
+    }
+    return skip;
+}
+//---------------------------------------------------------------------
+bool SceneManager::fireRenderQueueEnded(uint8 id, const String& invocation)
+{
+    RenderQueueListenerList::iterator i, iend;
+    bool repeat = false;
+
+    iend = mRenderQueueListeners.end();
+    for (i = mRenderQueueListeners.begin(); i != iend; ++i)
+    {
+        (*i)->renderQueueEnded(id, invocation, repeat);
+    }
+    return repeat;
+}
+//---------------------------------------------------------------------
+void SceneManager::fireShadowTexturesUpdated(size_t numberOfShadowTextures)
+{
+    ShadowListenerList::iterator i, iend;
+
+    iend = mShadowListeners.end();
+    for (i = mShadowListeners.begin(); i != iend; ++i)
+    {
+        (*i)->shadowTexturesUpdated(numberOfShadowTextures);
+    }
+}
+//---------------------------------------------------------------------
+void SceneManager::fireShadowTexturesPreCaster(Light* light, Camera* camera)
+{
+    ShadowListenerList::iterator i, iend;
+
+    iend = mShadowListeners.end();
+    for (i = mShadowListeners.begin(); i != iend; ++i)
+    {
+        (*i)->shadowTextureCasterPreViewProj(light, camera);
+    }
+}
+//---------------------------------------------------------------------
+void SceneManager::fireShadowTexturesPreReceiver(Light* light, Frustum* f)
+{
+    ShadowListenerList::iterator i, iend;
+
+    iend = mShadowListeners.end();
+    for (i = mShadowListeners.begin(); i != iend; ++i)
+    {
+        (*i)->shadowTextureReceiverPreViewProj(light, f);
+    }
+}
+//---------------------------------------------------------------------
+void SceneManager::setViewport(Viewport* vp)
+{
+    mCurrentViewport = vp;
+    // Set viewport in render system
+    mDestRenderSystem->_setViewport(vp);
+	// Set the active material scheme for this viewport
+	MaterialManager::getSingleton().setActiveScheme(vp->getMaterialScheme());
+}
+//---------------------------------------------------------------------
+void SceneManager::showBoundingBoxes(bool bShow) 
+{
+    mShowBoundingBoxes = bShow;
+}
+//---------------------------------------------------------------------
+bool SceneManager::getShowBoundingBoxes() const
+{
+    return mShowBoundingBoxes;
+}
+//---------------------------------------------------------------------
+void SceneManager::_notifyAutotrackingSceneNode(SceneNode* node, bool autoTrack)
+{
+    if (autoTrack)
+    {
+        mAutoTrackingSceneNodes.insert(node);
+    }
+    else
+    {
+        mAutoTrackingSceneNodes.erase(node);
+    }
+}
+//---------------------------------------------------------------------
+void SceneManager::setShadowTechnique(ShadowTechnique technique)
+{
+    mShadowTechnique = technique;
+    if (isShadowTechniqueStencilBased())
+    {
+        // Firstly check that we  have a stencil
+        // Otherwise forget it
+        if (!mDestRenderSystem->getCapabilities()->hasCapability(RSC_HWSTENCIL))
+        {
+            LogManager::getSingleton().logMessage(
+                "WARNING: Stencil shadows were requested, but this device does not "
+                "have a hardware stencil. Shadows disabled.");
+            mShadowTechnique = SHADOWTYPE_NONE;
+        }
+        else if (mShadowIndexBuffer.isNull())
+        {
+            // Create an estimated sized shadow index buffer
+            mShadowIndexBuffer = HardwareBufferManager::getSingleton().
+                createIndexBuffer(HardwareIndexBuffer::IT_16BIT, 
+                mShadowIndexBufferSize, 
+                HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, 
+                false);
+            // tell all meshes to prepare shadow volumes
+            MeshManager::getSingleton().setPrepareAllMeshesForShadowVolumes(true);
+        }
+	}
+
+    if (!isShadowTechniqueTextureBased())
+    {
+        // Destroy shadow textures to optimise resource usage
+        destroyShadowTextures();
+    }
+	else
+	{
+		// assure no custom shadow matrix is used accidentally in case we switch
+		// from a custom shadow mapping type to a non-custom (uniform shadow mapping)
+		for ( size_t i = 0; i < mShadowTextureCameras.size(); ++i )
+		{
+			Camera* texCam = mShadowTextureCameras[i];
+
+			texCam->setCustomViewMatrix(false);
+			texCam->setCustomProjectionMatrix(false);
+		}
+	}
+
+}
+//---------------------------------------------------------------------
+void SceneManager::_suppressShadows(bool suppress)
+{
+	mSuppressShadows = suppress;
+}
+//---------------------------------------------------------------------
+void SceneManager::_suppressRenderStateChanges(bool suppress)
+{
+	mSuppressRenderStateChanges = suppress;
+}
+//---------------------------------------------------------------------
+void SceneManager::updateRenderQueueSplitOptions(void)
+{
+	if (isShadowTechniqueStencilBased())
+	{
+		// Casters can always be receivers
+		getRenderQueue()->setShadowCastersCannotBeReceivers(false);
+	}
+	else // texture based
+	{
+		getRenderQueue()->setShadowCastersCannotBeReceivers(!mShadowTextureSelfShadow);
+	}
+
+	if (isShadowTechniqueAdditive() && !isShadowTechniqueIntegrated()
+		&& mCurrentViewport->getShadowsEnabled())
+	{
+		// Additive lighting, we need to split everything by illumination stage
+		getRenderQueue()->setSplitPassesByLightingType(true);
+	}
+	else
+	{
+		getRenderQueue()->setSplitPassesByLightingType(false);
+	}
+
+	if (isShadowTechniqueInUse() && mCurrentViewport->getShadowsEnabled()
+		&& !isShadowTechniqueIntegrated())
+	{
+		// Tell render queue to split off non-shadowable materials
+		getRenderQueue()->setSplitNoShadowPasses(true);
+	}
+	else
+	{
+		getRenderQueue()->setSplitNoShadowPasses(false);
+	}
+
+
+}
+//---------------------------------------------------------------------
+void SceneManager::updateRenderQueueGroupSplitOptions(RenderQueueGroup* group, 
+	bool suppressShadows, bool suppressRenderState)
+{
+	if (isShadowTechniqueStencilBased())
+	{
+		// Casters can always be receivers
+		group->setShadowCastersCannotBeReceivers(false);
+	}
+	else if (isShadowTechniqueTextureBased()) 
+	{
+		group->setShadowCastersCannotBeReceivers(!mShadowTextureSelfShadow);
+	}
+
+	if (!suppressShadows && mCurrentViewport->getShadowsEnabled() &&
+		isShadowTechniqueAdditive() && !isShadowTechniqueIntegrated())
+	{
+		// Additive lighting, we need to split everything by illumination stage
+		group->setSplitPassesByLightingType(true);
+	}
+	else
+	{
+		group->setSplitPassesByLightingType(false);
+	}
+
+	if (!suppressShadows && mCurrentViewport->getShadowsEnabled() 
+		&& isShadowTechniqueInUse())
+	{
+		// Tell render queue to split off non-shadowable materials
+		group->setSplitNoShadowPasses(true);
+	}
+	else
+	{
+		group->setSplitNoShadowPasses(false);
+	}
+
+
+}
+//-----------------------------------------------------------------------
+void SceneManager::_notifyLightsDirty(void)
+{
+    ++mLightsDirtyCounter;
+}
+//---------------------------------------------------------------------
+bool SceneManager::lightsForShadowTextureLess::operator ()(
+	const Ogre::Light *l1, const Ogre::Light *l2) const
+{
+	if (l1 == l2)
+		return false;
+
+	// sort shadow casting lights ahead of non-shadow casting
+	if (l1->getCastShadows() != l2->getCastShadows())
+	{
+		return l1->getCastShadows();
+	}
+
+	// otherwise sort by distance (directional lights will have 0 here)
+	return l1->tempSquareDist < l2->tempSquareDist;
+
+}
+//---------------------------------------------------------------------
+void SceneManager::findLightsAffectingFrustum(const Camera* camera)
+{
+    // Basic iteration for this SM
+
+    MovableObjectCollection* lights =
+        getMovableObjectCollection(LightFactory::FACTORY_TYPE_NAME);
+
+
+	{
+		OGRE_LOCK_MUTEX(lights->mutex)
+
+		// Pre-allocate memory
+		mTestLightInfos.clear();
+		mTestLightInfos.reserve(lights->map.size());
+
+		MovableObjectIterator it(lights->map.begin(), lights->map.end());
+
+		while(it.hasMoreElements())
+		{
+			Light* l = static_cast<Light*>(it.getNext());
+			if (l->isVisible())
+			{
+				LightInfo lightInfo;
+				lightInfo.light = l;
+				lightInfo.type = l->getType();
+				if (lightInfo.type == Light::LT_DIRECTIONAL)
+				{
+					// Always visible
+					lightInfo.position = Vector3::ZERO;
+					lightInfo.range = 0;
+					mTestLightInfos.push_back(lightInfo);
+				}
+				else
+				{
+					// NB treating spotlight as point for simplicity
+					// Just see if the lights attenuation range is within the frustum
+					lightInfo.range = l->getAttenuationRange();
+					lightInfo.position = l->getDerivedPosition();
+					Sphere sphere(lightInfo.position, lightInfo.range);
+					if (camera->isVisible(sphere))
+					{
+						mTestLightInfos.push_back(lightInfo);
+					}
+				}
+			}
+		}
+	} // release lock on lights collection
+
+    // Update lights affecting frustum if changed
+    if (mCachedLightInfos != mTestLightInfos)
+    {
+        mLightsAffectingFrustum.resize(mTestLightInfos.size());
+        LightInfoList::const_iterator i;
+        LightList::iterator j = mLightsAffectingFrustum.begin();
+        for (i = mTestLightInfos.begin(); i != mTestLightInfos.end(); ++i, ++j)
+        {
+            *j = i->light;
+			// add cam distance for sorting if texture shadows
+			if (isShadowTechniqueTextureBased())
+			{
+				(*j)->tempSquareDist = 
+					(camera->getDerivedPosition() - (*j)->getDerivedPosition()).squaredLength();
+			}
+        }
+
+		// Sort the lights if using texture shadows, since the first 'n' will be
+		// used to generate shadow textures and we should pick the most appropriate
+		if (isShadowTechniqueTextureBased())
+		{
+			// Allow a ShadowListener to override light sorting
+			// Reverse iterate so last takes precedence
+			bool overridden = false;
+			for (ShadowListenerList::reverse_iterator ri = mShadowListeners.rbegin();
+				ri != mShadowListeners.rend(); ++ri)
+			{
+				overridden = (*ri)->sortLightsAffectingFrustum(mLightsAffectingFrustum);
+				if (overridden)
+					break;
+			}
+			if (!overridden)
+			{
+				// default sort (stable to preserve directional light ordering
+				std::stable_sort(
+					mLightsAffectingFrustum.begin(), mLightsAffectingFrustum.end(), 
+					lightsForShadowTextureLess());
+			}
+			
+		}
+
+        // Use swap instead of copy operator for efficiently
+        mCachedLightInfos.swap(mTestLightInfos);
+
+        // notify light dirty, so all movable objects will re-populate
+        // their light list next time
+        _notifyLightsDirty();
+    }
+
+}
+//---------------------------------------------------------------------
+bool SceneManager::ShadowCasterSceneQueryListener::queryResult(
+    MovableObject* object)
+{
+    if (object->getCastShadows() && object->isVisible() && 
+		mSceneMgr->isRenderQueueToBeProcessed(object->getRenderQueueGroup()) &&
+		// objects need an edge list to cast shadows (shadow volumes only)
+		((mSceneMgr->getShadowTechnique() & SHADOWDETAILTYPE_TEXTURE) ||
+		 (mSceneMgr->getShadowTechnique() & SHADOWDETAILTYPE_STENCIL) && object->hasEdgeList()
+		)
+	   )
+    {
+        if (mFarDistSquared)
+        {
+            // Check object is within the shadow far distance
+            Vector3 toObj = object->getParentNode()->_getDerivedPosition() 
+                - mCamera->getDerivedPosition();
+            Real radius = object->getWorldBoundingSphere().getRadius();
+            Real dist =  toObj.squaredLength();               
+            if (dist - (radius * radius) > mFarDistSquared)
+            {
+                // skip, beyond max range
+                return true;
+            }
+        }
+
+        // If the object is in the frustum, we can always see the shadow
+        if (mCamera->isVisible(object->getWorldBoundingBox()))
+        {
+            mCasterList->push_back(object);
+            return true;
+        }
+
+        // Otherwise, object can only be casting a shadow into our view if
+        // the light is outside the frustum (or it's a directional light, 
+        // which are always outside), and the object is intersecting
+        // on of the volumes formed between the edges of the frustum and the
+        // light
+        if (!mIsLightInFrustum || mLight->getType() == Light::LT_DIRECTIONAL)
+        {
+            // Iterate over volumes
+            PlaneBoundedVolumeList::const_iterator i, iend;
+            iend = mLightClipVolumeList->end();
+            for (i = mLightClipVolumeList->begin(); i != iend; ++i)
+            {
+                if (i->intersects(object->getWorldBoundingBox()))
+                {
+                    mCasterList->push_back(object);
+                    return true;
+                }
+
+            }
+
+        }
+    }
+    return true;
+}
+//---------------------------------------------------------------------
+bool SceneManager::ShadowCasterSceneQueryListener::queryResult(
+    SceneQuery::WorldFragment* fragment)
+{
+    // don't deal with world geometry
+    return true;
+}
+//---------------------------------------------------------------------
+const SceneManager::ShadowCasterList& SceneManager::findShadowCastersForLight(
+    const Light* light, const Camera* camera)
+{
+    mShadowCasterList.clear();
+
+    if (light->getType() == Light::LT_DIRECTIONAL)
+    {
+        // Basic AABB query encompassing the frustum and the extrusion of it
+        AxisAlignedBox aabb;
+        const Vector3* corners = camera->getWorldSpaceCorners();
+        Vector3 min, max;
+        Vector3 extrude = light->getDerivedDirection() * -mShadowDirLightExtrudeDist;
+        // do first corner
+        min = max = corners[0];
+        min.makeFloor(corners[0] + extrude);
+        max.makeCeil(corners[0] + extrude);
+        for (size_t c = 1; c < 8; ++c)
+        {
+            min.makeFloor(corners[c]);
+            max.makeCeil(corners[c]);
+            min.makeFloor(corners[c] + extrude);
+            max.makeCeil(corners[c] + extrude);
+        }
+        aabb.setExtents(min, max);
+
+        if (!mShadowCasterAABBQuery)
+            mShadowCasterAABBQuery = createAABBQuery(aabb);
+        else
+            mShadowCasterAABBQuery->setBox(aabb);
+        // Execute, use callback
+        mShadowCasterQueryListener->prepare(false, 
+            &(light->_getFrustumClipVolumes(camera)), 
+            light, camera, &mShadowCasterList, mShadowFarDistSquared);
+        mShadowCasterAABBQuery->execute(mShadowCasterQueryListener);
+
+
+    }
+    else
+    {
+        Sphere s(light->getDerivedPosition(), light->getAttenuationRange());
+        // eliminate early if camera cannot see light sphere
+        if (camera->isVisible(s))
+        {
+            if (!mShadowCasterSphereQuery)
+                mShadowCasterSphereQuery = createSphereQuery(s);
+            else
+                mShadowCasterSphereQuery->setSphere(s);
+
+            // Determine if light is inside or outside the frustum
+            bool lightInFrustum = camera->isVisible(light->getDerivedPosition());
+            const PlaneBoundedVolumeList* volList = 0;
+            if (!lightInFrustum)
+            {
+                // Only worth building an external volume list if
+                // light is outside the frustum
+                volList = &(light->_getFrustumClipVolumes(camera));
+            }
+
+            // Execute, use callback
+            mShadowCasterQueryListener->prepare(lightInFrustum, 
+                volList, light, camera, &mShadowCasterList, mShadowFarDistSquared);
+            mShadowCasterSphereQuery->execute(mShadowCasterQueryListener);
+
+        }
+
+    }
+
+
+    return mShadowCasterList;
+}
+//---------------------------------------------------------------------
+void SceneManager::initShadowVolumeMaterials(void)
+{
+    /* This should have been set in the SceneManager constructor, but if you
+       created the SceneManager BEFORE the Root object, you will need to call
+       SceneManager::_setDestinationRenderSystem manually.
+     */
+    assert( mDestRenderSystem );
+
+    if (mShadowMaterialInitDone)
+        return;
+
+    if (!mShadowDebugPass)
+    {
+        MaterialPtr matDebug = 
+            MaterialManager::getSingleton().getByName("Ogre/Debug/ShadowVolumes");
+        if (matDebug.isNull())
+        {
+            // Create
+            matDebug = MaterialManager::getSingleton().create(
+                "Ogre/Debug/ShadowVolumes", 
+                ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME);
+            mShadowDebugPass = matDebug->getTechnique(0)->getPass(0);
+            mShadowDebugPass->setSceneBlending(SBT_ADD); 
+            mShadowDebugPass->setLightingEnabled(false);
+            mShadowDebugPass->setDepthWriteEnabled(false);
+            TextureUnitState* t = mShadowDebugPass->createTextureUnitState();
+            t->setColourOperationEx(LBX_MODULATE, LBS_MANUAL, LBS_CURRENT, 
+                ColourValue(0.7, 0.0, 0.2));
+            mShadowDebugPass->setCullingMode(CULL_NONE);
+
+            if (mDestRenderSystem->getCapabilities()->hasCapability(
+                RSC_VERTEX_PROGRAM))
+            {
+                ShadowVolumeExtrudeProgram::initialise();
+
+                // Enable the (infinite) point light extruder for now, just to get some params
+                mShadowDebugPass->setVertexProgram(
+                    ShadowVolumeExtrudeProgram::programNames[ShadowVolumeExtrudeProgram::POINT_LIGHT]);
+                mInfiniteExtrusionParams = 
+                    mShadowDebugPass->getVertexProgramParameters();
+                mInfiniteExtrusionParams->setAutoConstant(0, 
+                    GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);
+                mInfiniteExtrusionParams->setAutoConstant(4, 
+                    GpuProgramParameters::ACT_LIGHT_POSITION_OBJECT_SPACE);
+            }	
+            matDebug->compile();
+
+        }
+        else
+        {
+            mShadowDebugPass = matDebug->getTechnique(0)->getPass(0);
+
+            if (mDestRenderSystem->getCapabilities()->hasCapability(RSC_VERTEX_PROGRAM))
+            {
+                mInfiniteExtrusionParams = mShadowDebugPass->getVertexProgramParameters();
+            }
+        }
+    }
+
+    if (!mShadowStencilPass)
+    {
+
+        MaterialPtr matStencil = MaterialManager::getSingleton().getByName(
+            "Ogre/StencilShadowVolumes");
+        if (matStencil.isNull())
+        {
+            // Init
+            matStencil = MaterialManager::getSingleton().create(
+                "Ogre/StencilShadowVolumes",
+                ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME);
+            mShadowStencilPass = matStencil->getTechnique(0)->getPass(0);
+
+            if (mDestRenderSystem->getCapabilities()->hasCapability(
+                RSC_VERTEX_PROGRAM))
+            {
+
+                // Enable the finite point light extruder for now, just to get some params
+                mShadowStencilPass->setVertexProgram(
+                    ShadowVolumeExtrudeProgram::programNames[ShadowVolumeExtrudeProgram::POINT_LIGHT_FINITE]);
+                mFiniteExtrusionParams = 
+                    mShadowStencilPass->getVertexProgramParameters();
+                mFiniteExtrusionParams->setAutoConstant(0, 
+                    GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);
+                mFiniteExtrusionParams->setAutoConstant(4, 
+                    GpuProgramParameters::ACT_LIGHT_POSITION_OBJECT_SPACE);
+                // Note extra parameter
+                mFiniteExtrusionParams->setAutoConstant(5, 
+                    GpuProgramParameters::ACT_SHADOW_EXTRUSION_DISTANCE);
+            }
+            matStencil->compile();
+            // Nothing else, we don't use this like a 'real' pass anyway,
+            // it's more of a placeholder
+        }
+        else
+        {
+            mShadowStencilPass = matStencil->getTechnique(0)->getPass(0);
+
+            if (mDestRenderSystem->getCapabilities()->hasCapability(RSC_VERTEX_PROGRAM))
+            {
+                mFiniteExtrusionParams = mShadowStencilPass->getVertexProgramParameters();
+            }
+        }
+    }
+
+
+
+
+    if (!mShadowModulativePass)
+    {
+
+        MaterialPtr matModStencil = MaterialManager::getSingleton().getByName(
+            "Ogre/StencilShadowModulationPass");
+        if (matModStencil.isNull())
+        {
+            // Init
+            matModStencil = MaterialManager::getSingleton().create(
+                "Ogre/StencilShadowModulationPass",
+                ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME);
+            mShadowModulativePass = matModStencil->getTechnique(0)->getPass(0);
+            mShadowModulativePass->setSceneBlending(SBF_DEST_COLOUR, SBF_ZERO); 
+            mShadowModulativePass->setLightingEnabled(false);
+            mShadowModulativePass->setDepthWriteEnabled(false);
+            mShadowModulativePass->setDepthCheckEnabled(false);
+            TextureUnitState* t = mShadowModulativePass->createTextureUnitState();
+            t->setColourOperationEx(LBX_MODULATE, LBS_MANUAL, LBS_CURRENT, 
+                mShadowColour);
+            mShadowModulativePass->setCullingMode(CULL_NONE);
+        }
+        else
+        {
+            mShadowModulativePass = matModStencil->getTechnique(0)->getPass(0);
+        }
+    }
+
+    // Also init full screen quad while we're at it
+    if (!mFullScreenQuad)
+    {
+        mFullScreenQuad = new Rectangle2D();
+        mFullScreenQuad->setCorners(-1,1,1,-1);
+    }
+
+    // Also init shadow caster material for texture shadows
+    if (!mShadowCasterPlainBlackPass)
+    {
+        MaterialPtr matPlainBlack = MaterialManager::getSingleton().getByName(
+            "Ogre/TextureShadowCaster");
+        if (matPlainBlack.isNull())
+        {
+            matPlainBlack = MaterialManager::getSingleton().create(
+                "Ogre/TextureShadowCaster",
+                ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME);
+            mShadowCasterPlainBlackPass = matPlainBlack->getTechnique(0)->getPass(0);
+            // Lighting has to be on, because we need shadow coloured objects
+            // Note that because we can't predict vertex programs, we'll have to
+            // bind light values to those, and so we bind White to ambient
+            // reflectance, and we'll set the ambient colour to the shadow colour
+            mShadowCasterPlainBlackPass->setAmbient(ColourValue::White);
+            mShadowCasterPlainBlackPass->setDiffuse(ColourValue::Black);
+            mShadowCasterPlainBlackPass->setSelfIllumination(ColourValue::Black);
+            mShadowCasterPlainBlackPass->setSpecular(ColourValue::Black);
+			// Override fog
+			mShadowCasterPlainBlackPass->setFog(true, FOG_NONE);
+            // no textures or anything else, we will bind vertex programs
+            // every so often though
+        }
+        else
+        {
+            mShadowCasterPlainBlackPass = matPlainBlack->getTechnique(0)->getPass(0);
+        }
+    }
+
+    if (!mShadowReceiverPass)
+    {
+        MaterialPtr matShadRec = MaterialManager::getSingleton().getByName(
+            "Ogre/TextureShadowReceiver");
+        if (matShadRec.isNull())			
+        {
+            matShadRec = MaterialManager::getSingleton().create(
+                "Ogre/TextureShadowReceiver",
+                ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME);
+            mShadowReceiverPass = matShadRec->getTechnique(0)->getPass(0);
+			// Don't set lighting and blending modes here, depends on additive / modulative
+            TextureUnitState* t = mShadowReceiverPass->createTextureUnitState();
+            t->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
+        }
+        else
+        {
+            mShadowReceiverPass = matShadRec->getTechnique(0)->getPass(0);
+        }
+    }
+
+    // Set up spot shadow fade texture (loaded from code data block)
+    TexturePtr spotShadowFadeTex = 
+        TextureManager::getSingleton().getByName("spot_shadow_fade.png");
+    if (spotShadowFadeTex.isNull())
+    {
+        // Load the manual buffer into an image (don't destroy memory!
+        DataStreamPtr stream(
+			new MemoryDataStream(SPOT_SHADOW_FADE_PNG, SPOT_SHADOW_FADE_PNG_SIZE, false));
+        Image img;
+        img.load(stream, "png");
+        spotShadowFadeTex = 
+            TextureManager::getSingleton().loadImage(
+			"spot_shadow_fade.png", ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME, 
+			img, TEX_TYPE_2D);
+    }
+
+    mShadowMaterialInitDone = true;
+}
+//---------------------------------------------------------------------
+const Pass* SceneManager::deriveShadowCasterPass(const Pass* pass)
+{
+	if (isShadowTechniqueTextureBased())
+    {
+		Pass* retPass = mShadowTextureCustomCasterPass ? 
+			mShadowTextureCustomCasterPass : mShadowCasterPlainBlackPass;
+
+		
+		// Special case alpha-blended passes
+		if ((pass->getSourceBlendFactor() == SBF_SOURCE_ALPHA && 
+			pass->getDestBlendFactor() == SBF_ONE_MINUS_SOURCE_ALPHA) 
+			|| pass->getAlphaRejectFunction() != CMPF_ALWAYS_PASS)
+		{
+			// Alpha blended passes must retain their transparency
+			retPass->setAlphaRejectSettings(pass->getAlphaRejectFunction(), 
+				pass->getAlphaRejectValue());
+			retPass->setSceneBlending(pass->getSourceBlendFactor(), pass->getDestBlendFactor());
+			retPass->getParent()->getParent()->setTransparencyCastsShadows(true);
+
+			// So we allow the texture units, but override the colour functions
+			// Copy texture state, shift up one since 0 is shadow texture
+			unsigned short origPassTUCount = pass->getNumTextureUnitStates();
+			for (unsigned short t = 0; t < origPassTUCount; ++t)
+			{
+				TextureUnitState* tex;
+				if (retPass->getNumTextureUnitStates() <= t)
+				{
+					tex = retPass->createTextureUnitState();
+				}
+				else
+				{
+					tex = retPass->getTextureUnitState(t);
+				}
+				// copy base state
+				(*tex) = *(pass->getTextureUnitState(t));
+				// override colour function
+				tex->setColourOperationEx(LBX_SOURCE1, LBS_MANUAL, LBS_CURRENT,
+					isShadowTechniqueAdditive()? ColourValue::Black : mShadowColour);
+
+			}
+			// Remove any extras
+			while (retPass->getNumTextureUnitStates() > origPassTUCount)
+			{
+				retPass->removeTextureUnitState(origPassTUCount);
+			}
+
+		}
+		else
+		{
+			// reset
+			retPass->setSceneBlending(SBT_REPLACE);
+			retPass->setAlphaRejectFunction(CMPF_ALWAYS_PASS);
+			while (retPass->getNumTextureUnitStates() > 0)
+			{
+				retPass->removeTextureUnitState(0);
+			}
+		}
+
+		// Propagate culling modes
+		retPass->setCullingMode(pass->getCullingMode());
+		retPass->setManualCullingMode(pass->getManualCullingMode());
+		
+
+		// Does incoming pass have a custom shadow caster program?
+		if (!pass->getShadowCasterVertexProgramName().empty())
+		{
+			// Have to merge the shadow caster vertex program in
+			retPass->setVertexProgram(
+				pass->getShadowCasterVertexProgramName(), false);
+			const GpuProgramPtr& prg = retPass->getVertexProgram();
+			// Load this program if not done already
+			if (!prg->isLoaded())
+				prg->load();
+			// Copy params
+			retPass->setVertexProgramParameters(
+				pass->getShadowCasterVertexProgramParameters());
+			// Also have to hack the light autoparams, that is done later
+		}
+		else 
+		{
+			if (retPass == mShadowTextureCustomCasterPass)
+			{
+				// reset vp?
+				if (mShadowTextureCustomCasterPass->getVertexProgramName() !=
+					mShadowTextureCustomCasterVertexProgram)
+				{
+					mShadowTextureCustomCasterPass->setVertexProgram(
+						mShadowTextureCustomCasterVertexProgram, false);
+					if(mShadowTextureCustomCasterPass->hasVertexProgram())
+					{
+						mShadowTextureCustomCasterPass->setVertexProgramParameters(
+							mShadowTextureCustomCasterVPParams);
+
+					}
+
+				}
+
+			}
+			else
+			{
+				// Standard shadow caster pass, reset to no vp
+				retPass->setVertexProgram(StringUtil::BLANK);
+			}
+		}
+		return retPass;
+	}
+	else
+	{
+        return pass;
+    }
+
+}
+//---------------------------------------------------------------------
+const Pass* SceneManager::deriveShadowReceiverPass(const Pass* pass)
+{
+
+    if (isShadowTechniqueTextureBased())
+    {
+		Pass* retPass = mShadowTextureCustomReceiverPass ? 
+			mShadowTextureCustomReceiverPass : mShadowReceiverPass;
+
+		// Does incoming pass have a custom shadow receiver program?
+		if (!pass->getShadowReceiverVertexProgramName().empty())
+		{
+			// Have to merge the shadow receiver vertex program in
+			retPass->setVertexProgram(
+				pass->getShadowReceiverVertexProgramName(), false);
+			const GpuProgramPtr& prg = retPass->getVertexProgram();
+			// Load this program if not done already
+			if (!prg->isLoaded())
+				prg->load();
+			// Copy params
+			retPass->setVertexProgramParameters(
+				pass->getShadowReceiverVertexProgramParameters());
+			// Also have to hack the light autoparams, that is done later
+		}
+		else 
+		{
+			if (retPass == mShadowTextureCustomReceiverPass)
+			{
+				// reset vp?
+				if (mShadowTextureCustomReceiverPass->getVertexProgramName() !=
+					mShadowTextureCustomReceiverVertexProgram)
+				{
+					mShadowTextureCustomReceiverPass->setVertexProgram(
+						mShadowTextureCustomReceiverVertexProgram, false);
+					if(mShadowTextureCustomReceiverPass->hasVertexProgram())
+					{
+						mShadowTextureCustomReceiverPass->setVertexProgramParameters(
+							mShadowTextureCustomReceiverVPParams);
+
+					}
+
+				}
+
+			}
+			else
+			{
+				// Standard shadow receiver pass, reset to no vp
+				retPass->setVertexProgram(StringUtil::BLANK);
+			}
+		}
+
+        unsigned short keepTUCount;
+		// If additive, need lighting parameters & standard programs
+		if (isShadowTechniqueAdditive())
+		{
+			retPass->setLightingEnabled(true);
+			retPass->setAmbient(pass->getAmbient());
+			retPass->setSelfIllumination(pass->getSelfIllumination());
+			retPass->setDiffuse(pass->getDiffuse());
+			retPass->setSpecular(pass->getSpecular());
+			retPass->setShininess(pass->getShininess());
+			retPass->setIteratePerLight(pass->getIteratePerLight(), 
+				pass->getRunOnlyForOneLightType(), pass->getOnlyLightType());
+
+            // We need to keep alpha rejection settings
+            retPass->setAlphaRejectSettings(pass->getAlphaRejectFunction(),
+                pass->getAlphaRejectValue());
+            // Copy texture state, shift up one since 0 is shadow texture
+            unsigned short origPassTUCount = pass->getNumTextureUnitStates();
+            for (unsigned short t = 0; t < origPassTUCount; ++t)
+            {
+                unsigned short targetIndex = t+1;
+                TextureUnitState* tex;
+                if (retPass->getNumTextureUnitStates() <= targetIndex)
+                {
+                    tex = retPass->createTextureUnitState();
+                }
+                else
+                {
+                    tex = retPass->getTextureUnitState(targetIndex);
+                }
+                (*tex) = *(pass->getTextureUnitState(t));
+				// If programmable, have to adjust the texcoord sets too
+				// D3D insists that texcoordsets match tex unit in programmable mode
+				if (retPass->hasVertexProgram())
+					tex->setTextureCoordSet(targetIndex);
+            }
+            keepTUCount = origPassTUCount + 1;
+		}// additive lighting
+		else
+		{
+			// need to keep spotlight fade etc
+			keepTUCount = retPass->getNumTextureUnitStates();
+		}
+
+
+		// Will also need fragment programs since this is a complex light setup
+		if (!pass->getShadowReceiverFragmentProgramName().empty())
+		{
+			// Have to merge the shadow receiver vertex program in
+			retPass->setFragmentProgram(
+				pass->getShadowReceiverFragmentProgramName(), false);
+			const GpuProgramPtr& prg = retPass->getFragmentProgram();
+			// Load this program if not done already
+			if (!prg->isLoaded())
+				prg->load();
+			// Copy params
+			retPass->setFragmentProgramParameters(
+				pass->getShadowReceiverFragmentProgramParameters());
+
+			// Did we bind a shadow vertex program?
+			if (pass->hasVertexProgram() && !retPass->hasVertexProgram())
+			{
+				// We didn't bind a receiver-specific program, so bind the original
+				retPass->setVertexProgram(pass->getVertexProgramName(), false);
+				const GpuProgramPtr& prg = retPass->getVertexProgram();
+				// Load this program if required
+				if (!prg->isLoaded())
+					prg->load();
+				// Copy params
+				retPass->setVertexProgramParameters(
+					pass->getVertexProgramParameters());
+
+			}
+		}
+		else 
+		{
+			// Reset any merged fragment programs from last time
+			if (retPass == mShadowTextureCustomReceiverPass)
+			{
+				// reset fp?
+				if (mShadowTextureCustomReceiverPass->getFragmentProgramName() !=
+					mShadowTextureCustomReceiverFragmentProgram)
+				{
+					mShadowTextureCustomReceiverPass->setFragmentProgram(
+						mShadowTextureCustomReceiverFragmentProgram, false);
+					if(mShadowTextureCustomReceiverPass->hasFragmentProgram())
+					{
+						mShadowTextureCustomReceiverPass->setFragmentProgramParameters(
+							mShadowTextureCustomReceiverFPParams);
+
+					}
+
+				}
+
+			}
+			else
+			{
+				// Standard shadow receiver pass, reset to no fp
+				retPass->setFragmentProgram(StringUtil::BLANK);
+			}
+
+		}
+
+        // Remove any extra texture units
+        while (retPass->getNumTextureUnitStates() > keepTUCount)
+        {
+            retPass->removeTextureUnitState(keepTUCount);
+        }
+
+		retPass->_load();
+
+		return retPass;
+	}
+	else
+	{
+        return pass;
+    }
+
+}
+//---------------------------------------------------------------------
+void SceneManager::renderShadowVolumesToStencil(const Light* light, const Camera* camera)
+{
+    // Get the shadow caster list
+    const ShadowCasterList& casters = findShadowCastersForLight(light, camera);
+    // Check there are some shadow casters to render
+    if (casters.empty())
+    {
+        // No casters, just do nothing
+        return;
+    }
+
+    // Set up scissor test (point & spot lights only)
+    bool scissored = false;
+    if (light->getType() != Light::LT_DIRECTIONAL && 
+        mDestRenderSystem->getCapabilities()->hasCapability(RSC_SCISSOR_TEST))
+    {
+        // Project the sphere onto the camera
+        Real left, right, top, bottom;
+        Sphere sphere(light->getDerivedPosition(), light->getAttenuationRange());
+        if (camera->projectSphere(sphere, &left, &top, &right, &bottom))
+        {
+            scissored = true;
+            // Turn normalised device coordinates into pixels
+            int iLeft, iTop, iWidth, iHeight;
+            mCurrentViewport->getActualDimensions(iLeft, iTop, iWidth, iHeight);
+            size_t szLeft, szRight, szTop, szBottom;
+
+            szLeft = (size_t)(iLeft + ((left + 1) * 0.5 * iWidth));
+            szRight = (size_t)(iLeft + ((right + 1) * 0.5 * iWidth));
+            szTop = (size_t)(iTop + ((-top + 1) * 0.5 * iHeight));
+            szBottom = (size_t)(iTop + ((-bottom + 1) * 0.5 * iHeight));
+
+            mDestRenderSystem->setScissorTest(true, szLeft, szTop, szRight, szBottom);
+        }
+    }
+
+    mDestRenderSystem->unbindGpuProgram(GPT_FRAGMENT_PROGRAM);
+
+    // Can we do a 2-sided stencil?
+    bool stencil2sided = false;
+    if (mDestRenderSystem->getCapabilities()->hasCapability(RSC_TWO_SIDED_STENCIL) && 
+        mDestRenderSystem->getCapabilities()->hasCapability(RSC_STENCIL_WRAP))
+    {
+        // enable
+        stencil2sided = true;
+    }
+
+    // Do we have access to vertex programs?
+    bool extrudeInSoftware = true;
+    bool finiteExtrude = !mShadowUseInfiniteFarPlane || 
+        !mDestRenderSystem->getCapabilities()->hasCapability(RSC_INFINITE_FAR_PLANE);
+    if (mDestRenderSystem->getCapabilities()->hasCapability(RSC_VERTEX_PROGRAM))
+    {
+        extrudeInSoftware = false;
+        // attach the appropriate extrusion vertex program
+        // Note we never unset it because support for vertex programs is constant
+        mShadowStencilPass->setVertexProgram(
+            ShadowVolumeExtrudeProgram::getProgramName(light->getType(), finiteExtrude, false)
+            , false);
+        // Set params
+        if (finiteExtrude)
+        {
+            mShadowStencilPass->setVertexProgramParameters(mFiniteExtrusionParams);
+        }
+        else
+        {
+            mShadowStencilPass->setVertexProgramParameters(mInfiniteExtrusionParams);
+        }
+        if (mDebugShadows)
+        {
+            mShadowDebugPass->setVertexProgram(
+                ShadowVolumeExtrudeProgram::getProgramName(light->getType(), finiteExtrude, true)
+                , false);
+            // Set params
+            if (finiteExtrude)
+            {
+                mShadowDebugPass->setVertexProgramParameters(mFiniteExtrusionParams);
+            }
+            else
+            {
+                mShadowDebugPass->setVertexProgramParameters(mInfiniteExtrusionParams);
+            }
+        }
+
+        mDestRenderSystem->bindGpuProgram(mShadowStencilPass->getVertexProgram()->_getBindingDelegate());
+
+    }
+    else
+    {
+        mDestRenderSystem->unbindGpuProgram(GPT_VERTEX_PROGRAM);
+    }
+
+    // Add light to internal list for use in render call
+    LightList lightList;
+    // const_cast is forgiveable here since we pass this const
+    lightList.push_back(const_cast<Light*>(light));
+
+    // Turn off colour writing and depth writing
+    mDestRenderSystem->_setColourBufferWriteEnabled(false, false, false, false);
+	mDestRenderSystem->_disableTextureUnitsFrom(0);
+    mDestRenderSystem->_setDepthBufferParams(true, false, CMPF_LESS);
+    mDestRenderSystem->setStencilCheckEnabled(true);
+
+    // Calculate extrusion distance
+    // Use direction light extrusion distance now, just form optimize code
+    // generate a little, point/spot light will up to date later
+    Real extrudeDist = mShadowDirLightExtrudeDist;
+
+    // Figure out the near clip volume
+    const PlaneBoundedVolume& nearClipVol = 
+        light->_getNearClipVolume(camera);
+
+    // Now iterate over the casters and render
+    ShadowCasterList::const_iterator si, siend;
+    siend = casters.end();
+
+
+	// Now iterate over the casters and render
+	for (si = casters.begin(); si != siend; ++si)
+	{
+        ShadowCaster* caster = *si;
+		bool zfailAlgo = camera->isCustomNearClipPlaneEnabled();
+		unsigned long flags = 0;
+
+        if (light->getType() != Light::LT_DIRECTIONAL)
+        {
+            extrudeDist = caster->getPointExtrusionDistance(light); 
+        }
+
+        if (!extrudeInSoftware && !finiteExtrude)
+        {
+            // hardware extrusion, to infinity (and beyond!)
+            flags |= SRF_EXTRUDE_TO_INFINITY;
+        }
+
+		// Determine whether zfail is required
+        if (zfailAlgo || nearClipVol.intersects(caster->getWorldBoundingBox()))
+        {
+            // We use zfail for this object only because zfail
+	        // compatible with zpass algorithm
+			zfailAlgo = true;
+            // We need to include the light and / or dark cap
+            // But only if they will be visible
+            if(camera->isVisible(caster->getLightCapBounds()))
+            {
+                flags |= SRF_INCLUDE_LIGHT_CAP;
+            }
+			// zfail needs dark cap 
+			// UNLESS directional lights using hardware extrusion to infinity
+			// since that extrudes to a single point
+			if(!((flags & SRF_EXTRUDE_TO_INFINITY) && 
+				light->getType() == Light::LT_DIRECTIONAL) &&
+				camera->isVisible(caster->getDarkCapBounds(*light, extrudeDist)))
+			{
+				flags |= SRF_INCLUDE_DARK_CAP;
+			}
+        }
+		else
+		{
+			// In zpass we need a dark cap if
+			// 1: infinite extrusion on point/spotlight sources in modulative shadows
+			//    mode, since otherwise in areas where there is no depth (skybox)
+			//    the infinitely projected volume will leave a dark band
+			// 2: finite extrusion on any light source since glancing angles
+			//    can peek through the end and shadow objects behind incorrectly
+			if ((flags & SRF_EXTRUDE_TO_INFINITY) && 
+				light->getType() != Light::LT_DIRECTIONAL && 
+				isShadowTechniqueModulative() && 
+				camera->isVisible(caster->getDarkCapBounds(*light, extrudeDist)))
+			{
+				flags |= SRF_INCLUDE_DARK_CAP;
+			}
+			else if (!(flags & SRF_EXTRUDE_TO_INFINITY) && 
+				camera->isVisible(caster->getDarkCapBounds(*light, extrudeDist)))
+			{
+				flags |= SRF_INCLUDE_DARK_CAP;
+			}
+
+		}
+
+        // Get shadow renderables			
+        ShadowCaster::ShadowRenderableListIterator iShadowRenderables =
+            caster->getShadowVolumeRenderableIterator(mShadowTechnique,
+            light, &mShadowIndexBuffer, extrudeInSoftware, 
+            extrudeDist, flags);
+
+        // Render a shadow volume here
+        //  - if we have 2-sided stencil, one render with no culling
+        //  - otherwise, 2 renders, one with each culling method and invert the ops
+        setShadowVolumeStencilState(false, zfailAlgo, stencil2sided);
+        renderShadowVolumeObjects(iShadowRenderables, mShadowStencilPass, &lightList, flags,
+            false, zfailAlgo, stencil2sided);
+        if (!stencil2sided)
+        {
+            // Second pass
+            setShadowVolumeStencilState(true, zfailAlgo, false);
+            renderShadowVolumeObjects(iShadowRenderables, mShadowStencilPass, &lightList, flags,
+                true, zfailAlgo, false);
+        }
+
+        // Do we need to render a debug shadow marker?
+        if (mDebugShadows)
+        {
+            // reset stencil & colour ops
+            mDestRenderSystem->setStencilBufferParams();
+            mShadowDebugPass->getTextureUnitState(0)->
+                setColourOperationEx(LBX_MODULATE, LBS_MANUAL, LBS_CURRENT,
+                zfailAlgo ? ColourValue(0.7, 0.0, 0.2) : ColourValue(0.0, 0.7, 0.2));
+            _setPass(mShadowDebugPass);
+            renderShadowVolumeObjects(iShadowRenderables, mShadowDebugPass, &lightList, flags,
+                true, false, false);
+            mDestRenderSystem->_setColourBufferWriteEnabled(false, false, false, false);
+            mDestRenderSystem->_setDepthBufferFunction(CMPF_LESS);
+        }
+    }
+
+    // revert colour write state
+    mDestRenderSystem->_setColourBufferWriteEnabled(true, true, true, true);
+    // revert depth state
+    mDestRenderSystem->_setDepthBufferParams();
+
+    mDestRenderSystem->setStencilCheckEnabled(false);
+
+    mDestRenderSystem->unbindGpuProgram(GPT_VERTEX_PROGRAM);
+
+    if (scissored)
+    {
+        // disable scissor test
+        mDestRenderSystem->setScissorTest(false);
+    }
+
+}
+//---------------------------------------------------------------------
+void SceneManager::renderShadowVolumeObjects(ShadowCaster::ShadowRenderableListIterator iShadowRenderables,
+                                             Pass* pass,
+                                             const LightList *manualLightList,
+                                             unsigned long flags,
+                                             bool secondpass, bool zfail, bool twosided)
+{
+    // ----- SHADOW VOLUME LOOP -----
+    // Render all shadow renderables with same stencil operations
+    while (iShadowRenderables.hasMoreElements())
+    {
+        ShadowRenderable* sr = iShadowRenderables.getNext();
+
+        // omit hidden renderables
+        if (sr->isVisible())
+        {
+            // render volume, including dark and (maybe) light caps
+            renderSingleObject(sr, pass, false, manualLightList);
+
+            // optionally render separate light cap
+            if (sr->isLightCapSeparate() && (flags & SRF_INCLUDE_LIGHT_CAP))
+            {
+                ShadowRenderable* lightCap = sr->getLightCapRenderable();
+                assert(lightCap && "Shadow renderable is missing a separate light cap renderable!");
+
+                // We must take care with light caps when we could 'see' the back facing
+                // triangles directly:
+                //   1. The front facing light caps must render as always fail depth
+                //      check to avoid 'depth fighting'.
+                //   2. The back facing light caps must use normal depth function to
+                //      avoid break the standard depth check
+                //
+                // TODO:
+                //   1. Separate light caps rendering doesn't need for the 'closed'
+                //      mesh that never touch the near plane, because in this instance,
+                //      we couldn't 'see' any back facing triangles directly. The
+                //      'closed' mesh must determinate by edge list builder.
+                //   2. There still exists 'depth fighting' bug with coplane triangles
+                //      that has opposite facing. This usually occur when use two side
+                //      material in the modeling tools and the model exporting tools
+                //      exporting double triangles to represent this model. This bug
+                //      can't fixed in GPU only, there must has extra work on edge list
+                //      builder and shadow volume generater to fix it.
+                //
+                if (twosided)
+                {
+                    // select back facing light caps to render
+                    mDestRenderSystem->_setCullingMode(CULL_ANTICLOCKWISE);
+                    // use normal depth function for back facing light caps
+                    renderSingleObject(lightCap, pass, false, manualLightList);
+
+                    // select front facing light caps to render
+                    mDestRenderSystem->_setCullingMode(CULL_CLOCKWISE);
+                    // must always fail depth check for front facing light caps
+                    mDestRenderSystem->_setDepthBufferFunction(CMPF_ALWAYS_FAIL);
+                    renderSingleObject(lightCap, pass, false, manualLightList);
+
+                    // reset depth function
+                    mDestRenderSystem->_setDepthBufferFunction(CMPF_LESS);
+                    // reset culling mode
+                    mDestRenderSystem->_setCullingMode(CULL_NONE);
+                }
+                else if ((secondpass || zfail) && !(secondpass && zfail))
+                {
+                    // use normal depth function for back facing light caps
+                    renderSingleObject(lightCap, pass, false, manualLightList);
+                }
+                else
+                {
+                    // must always fail depth check for front facing light caps
+                    mDestRenderSystem->_setDepthBufferFunction(CMPF_ALWAYS_FAIL);
+                    renderSingleObject(lightCap, pass, false, manualLightList);
+
+                    // reset depth function
+                    mDestRenderSystem->_setDepthBufferFunction(CMPF_LESS);
+                }
+            }
+        }
+    }
+}
+//---------------------------------------------------------------------
+void SceneManager::setShadowVolumeStencilState(bool secondpass, bool zfail, bool twosided)
+{
+    // Determinate the best stencil operation
+    StencilOperation incrOp, decrOp;
+    if (mDestRenderSystem->getCapabilities()->hasCapability(RSC_STENCIL_WRAP))
+    {
+        incrOp = SOP_INCREMENT_WRAP;
+        decrOp = SOP_DECREMENT_WRAP;
+    }
+    else
+    {
+        incrOp = SOP_INCREMENT;
+        decrOp = SOP_DECREMENT;
+    }
+
+    // First pass, do front faces if zpass
+    // Second pass, do back faces if zpass
+    // Invert if zfail
+    // this is to ensure we always increment before decrement
+    // When two-sided stencil, always pass front face stencil
+    // operation parameters and the inverse of them will happen
+    // for back faces
+    if ( !twosided && ((secondpass || zfail) && !(secondpass && zfail)) )
+    {
+        mDestRenderSystem->_setCullingMode(
+            twosided? CULL_NONE : CULL_ANTICLOCKWISE);
+        mDestRenderSystem->setStencilBufferParams(
+            CMPF_ALWAYS_PASS, // always pass stencil check
+            0, // no ref value (no compare)
+            0xFFFFFFFF, // no mask
+            SOP_KEEP, // stencil test will never fail
+            zfail ? incrOp : SOP_KEEP, // back face depth fail
+            zfail ? SOP_KEEP : decrOp, // back face pass
+            twosided
+            );
+    }
+    else
+    {
+        mDestRenderSystem->_setCullingMode(
+            twosided? CULL_NONE : CULL_CLOCKWISE);
+        mDestRenderSystem->setStencilBufferParams(
+            CMPF_ALWAYS_PASS, // always pass stencil check
+            0, // no ref value (no compare)
+            0xFFFFFFFF, // no mask
+            SOP_KEEP, // stencil test will never fail
+            zfail ? decrOp : SOP_KEEP, // front face depth fail
+            zfail ? SOP_KEEP : incrOp, // front face pass
+            twosided
+            );
+    }
+}
+//---------------------------------------------------------------------
+void SceneManager::setShadowColour(const ColourValue& colour)
+{
+    mShadowColour = colour;
+
+    // Change shadow material setting only when it's prepared,
+    // otherwise, it'll set up while preparing shadow materials.
+    if (mShadowModulativePass)
+    {
+        mShadowModulativePass->getTextureUnitState(0)->setColourOperationEx(
+            LBX_MODULATE, LBS_MANUAL, LBS_CURRENT, colour);
+    }
+}
+//---------------------------------------------------------------------
+const ColourValue& SceneManager::getShadowColour(void) const
+{
+    return mShadowColour;
+}
+//---------------------------------------------------------------------
+void SceneManager::setShadowFarDistance(Real distance)
+{
+    mShadowFarDist = distance;
+    mShadowFarDistSquared = distance * distance;
+}
+//---------------------------------------------------------------------
+void SceneManager::setShadowDirectionalLightExtrusionDistance(Real dist)
+{
+    mShadowDirLightExtrudeDist = dist;
+}
+//---------------------------------------------------------------------
+Real SceneManager::getShadowDirectionalLightExtrusionDistance(void) const
+{
+    return mShadowDirLightExtrudeDist;
+}
+//---------------------------------------------------------------------
+void SceneManager::setShadowIndexBufferSize(size_t size)
+{
+    if (!mShadowIndexBuffer.isNull() && size != mShadowIndexBufferSize)
+    {
+        // re-create shadow buffer with new size
+        mShadowIndexBuffer = HardwareBufferManager::getSingleton().
+            createIndexBuffer(HardwareIndexBuffer::IT_16BIT, 
+            size, 
+            HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, 
+            false);
+    }
+    mShadowIndexBufferSize = size;
+}
+//---------------------------------------------------------------------
+void SceneManager::setShadowTextureConfig(size_t shadowIndex, unsigned short width, 
+	unsigned short height, PixelFormat format)
+{
+	ShadowTextureConfig conf;
+	conf.width = width;
+	conf.height = height;
+	conf.format = format;
+
+	setShadowTextureConfig(shadowIndex, conf);
+
+
+}
+//---------------------------------------------------------------------
+void SceneManager::setShadowTextureConfig(size_t shadowIndex, 
+	const ShadowTextureConfig& config)
+{
+	if (shadowIndex >= mShadowTextureConfigList.size())
+	{
+		OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+			"shadowIndex out of bounds",
+			"SceneManager::setShadowTextureConfig");
+	}
+	mShadowTextureConfigList[shadowIndex] = config;
+
+	mShadowTextureConfigDirty = true;
+}
+//---------------------------------------------------------------------
+ConstShadowTextureConfigIterator SceneManager::getShadowTextureConfigIterator() const
+{
+	return ConstShadowTextureConfigIterator(
+		mShadowTextureConfigList.begin(), mShadowTextureConfigList.end());
+
+}
+//---------------------------------------------------------------------
+void SceneManager::setShadowTextureSize(unsigned short size)
+{
+	// default all current
+	for (ShadowTextureConfigList::iterator i = mShadowTextureConfigList.begin();
+		i != mShadowTextureConfigList.end(); ++i)
+	{
+		if (i->width != size || i->height != size)
+		{
+			i->width = i->height = size;
+			mShadowTextureConfigDirty = true;
+		}
+	}
+
+}
+//---------------------------------------------------------------------
+void SceneManager::setShadowTextureCount(size_t count)
+{
+    // Change size, any new items will take default
+	if (count != mShadowTextureConfigList.size())
+	{
+		mShadowTextureConfigList.resize(count);
+		mShadowTextureConfigDirty = true;
+	}
+}
+//---------------------------------------------------------------------
+void SceneManager::setShadowTexturePixelFormat(PixelFormat fmt)
+{
+	for (ShadowTextureConfigList::iterator i = mShadowTextureConfigList.begin();
+		i != mShadowTextureConfigList.end(); ++i)
+	{
+		if (i->format != fmt)
+		{
+			i->format = fmt;
+			mShadowTextureConfigDirty = true;
+		}
+	}
+}
+//---------------------------------------------------------------------
+void SceneManager::setShadowTextureSettings(unsigned short size, 
+	unsigned short count, PixelFormat fmt)
+{
+	setShadowTextureCount(count);
+	for (ShadowTextureConfigList::iterator i = mShadowTextureConfigList.begin();
+		i != mShadowTextureConfigList.end(); ++i)
+	{
+		if (i->width != size || i->height != size || i->format != fmt)
+		{
+			i->width = i->height = size;
+			i->format = fmt;
+			mShadowTextureConfigDirty = true;
+		}
+	}
+}
+//---------------------------------------------------------------------
+const TexturePtr& SceneManager::getShadowTexture(size_t shadowIndex)
+{
+	if (shadowIndex >= mShadowTextureConfigList.size())
+	{
+		OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+			"shadowIndex out of bounds",
+			"SceneManager::getShadowTexture");
+	}
+	ensureShadowTexturesCreated();
+
+	return mShadowTextures[shadowIndex];
+
+
+}
+//---------------------------------------------------------------------
+void SceneManager::setShadowTextureSelfShadow(bool selfShadow) 
+{ 
+	mShadowTextureSelfShadow = selfShadow;
+	if (isShadowTechniqueTextureBased())
+		getRenderQueue()->setShadowCastersCannotBeReceivers(!selfShadow);
+}
+//---------------------------------------------------------------------
+void SceneManager::setShadowTextureCasterMaterial(const String& name)
+{
+	if (name.empty())
+	{
+		mShadowTextureCustomCasterPass = 0;
+	}
+	else
+	{
+		MaterialPtr mat = MaterialManager::getSingleton().getByName(name);
+		if (mat.isNull())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+				"Cannot locate material called '" + name + "'", 
+				"SceneManager::setShadowTextureCasterMaterial");
+		}
+		mat->load();
+		mShadowTextureCustomCasterPass = mat->getBestTechnique()->getPass(0);
+		if (mShadowTextureCustomCasterPass->hasVertexProgram())
+		{
+			// Save vertex program and params in case we have to swap them out
+			mShadowTextureCustomCasterVertexProgram = 
+				mShadowTextureCustomCasterPass->getVertexProgramName();
+			mShadowTextureCustomCasterVPParams = 
+				mShadowTextureCustomCasterPass->getVertexProgramParameters();
+
+		}
+	}
+}
+//---------------------------------------------------------------------
+void SceneManager::setShadowTextureReceiverMaterial(const String& name)
+{
+	if (name.empty())
+	{
+		mShadowTextureCustomReceiverPass = 0;
+	}
+	else
+	{
+		MaterialPtr mat = MaterialManager::getSingleton().getByName(name);
+		if (mat.isNull())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+				"Cannot locate material called '" + name + "'", 
+				"SceneManager::setShadowTextureReceiverMaterial");
+		}
+		mat->load();
+		mShadowTextureCustomReceiverPass = mat->getBestTechnique()->getPass(0);
+		if (mShadowTextureCustomReceiverPass->hasVertexProgram())
+		{
+			// Save vertex program and params in case we have to swap them out
+			mShadowTextureCustomReceiverVertexProgram = 
+				mShadowTextureCustomReceiverPass->getVertexProgramName();
+			mShadowTextureCustomReceiverVPParams = 
+				mShadowTextureCustomReceiverPass->getVertexProgramParameters();
+
+		}
+		else
+		{
+			mShadowTextureCustomReceiverVertexProgram = StringUtil::BLANK;
+
+		}
+		if (mShadowTextureCustomReceiverPass->hasFragmentProgram())
+		{
+			// Save fragment program and params in case we have to swap them out
+			mShadowTextureCustomReceiverFragmentProgram = 
+				mShadowTextureCustomReceiverPass->getFragmentProgramName();
+			mShadowTextureCustomReceiverFPParams = 
+				mShadowTextureCustomReceiverPass->getFragmentProgramParameters();
+
+		}
+		else
+		{
+			mShadowTextureCustomReceiverFragmentProgram = StringUtil::BLANK;
+
+		}
+	}
+}
+//---------------------------------------------------------------------
+void SceneManager::setShadowCameraSetup(const ShadowCameraSetupPtr& shadowSetup)
+{
+	mDefaultShadowCameraSetup = shadowSetup;
+
+}
+//---------------------------------------------------------------------
+const ShadowCameraSetupPtr& SceneManager::getShadowCameraSetup() const
+{
+	return mDefaultShadowCameraSetup;
+}
+//---------------------------------------------------------------------
+void SceneManager::ensureShadowTexturesCreated()
+{
+	if (mShadowTextureConfigDirty)
+	{
+		destroyShadowTextures();
+		ShadowTextureManager::getSingleton().getShadowTextures(
+			mShadowTextureConfigList, mShadowTextures);
+
+		// clear shadow cam - light mapping
+		mShadowCamLightMapping.clear();
+
+
+		// Recreate shadow textures
+		for (ShadowTextureList::iterator i = mShadowTextures.begin(); 
+			i != mShadowTextures.end(); ++i) 
+		{
+			const TexturePtr& shadowTex = *i;
+
+			// Camera names are local to SM 
+			String camName = shadowTex->getName() + "Cam";
+			// Material names are global to SM, make specific
+			String matName = shadowTex->getName() + "Mat" + getName();
+
+			RenderTexture *shadowRTT = shadowTex->getBuffer()->getRenderTarget();
+
+			// Create camera for this texture, but note that we have to rebind
+			// in prepareShadowTextures to coexist with multiple SMs
+			Camera* cam = createCamera(camName);
+			cam->setAspectRatio(shadowTex->getWidth() / shadowTex->getHeight());
+			// Don't use rendering distance for light cameras; we don't want shadows
+			// for visible objects disappearing, especially for directional lights
+			cam->setUseRenderingDistance(false);
+			mShadowTextureCameras.push_back(cam);
+
+			// Create a viewport, if not there already
+			if (shadowRTT->getNumViewports() == 0)
+			{
+				// Note camera assignment is transient when multiple SMs
+				Viewport *v = shadowRTT->addViewport(cam);
+				v->setClearEveryFrame(true);
+				// remove overlays
+				v->setOverlaysEnabled(false);
+			}
+
+			// Don't update automatically - we'll do it when required
+			shadowRTT->setAutoUpdated(false);
+
+			// Also create corresponding Material used for rendering this shadow
+			MaterialPtr mat = MaterialManager::getSingleton().getByName(matName);
+			if (mat.isNull())
+			{
+				mat = MaterialManager::getSingleton().create(
+					matName, ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME);
+			}
+			Pass* p = mat->getTechnique(0)->getPass(0);
+			if (p->getNumTextureUnitStates() != 1 ||
+				p->getTextureUnitState(0)->_getTexturePtr(0) != shadowTex)
+			{
+				mat->getTechnique(0)->getPass(0)->removeAllTextureUnitStates();
+				// create texture unit referring to render target texture
+				TextureUnitState* texUnit = 
+					p->createTextureUnitState(shadowTex->getName());
+				// set projective based on camera
+				texUnit->setProjectiveTexturing(!p->hasVertexProgram(), cam);
+				// clamp to border colour
+				texUnit->setTextureAddressingMode(TextureUnitState::TAM_BORDER);
+				texUnit->setTextureBorderColour(ColourValue::White);
+				mat->touch();
+
+			}
+
+			// insert dummy camera-light combination
+			mShadowCamLightMapping[cam] = 0;
+
+			// Get null shadow texture
+			if (mShadowTextureConfigList.empty())
+			{
+				mNullShadowTexture.setNull();
+			}
+			else
+			{
+				mNullShadowTexture = 
+					ShadowTextureManager::getSingleton().getNullShadowTexture(
+						mShadowTextureConfigList[0].format);
+			}
+
+
+		}
+		mShadowTextureConfigDirty = false;
+	}
+
+}
+//---------------------------------------------------------------------
+void SceneManager::destroyShadowTextures(void)
+{
+	
+    ShadowTextureList::iterator i, iend;
+    ShadowTextureCameraList::iterator ci;
+    iend = mShadowTextures.end();
+    ci = mShadowTextureCameras.begin();
+    for (i = mShadowTextures.begin(); i != iend; ++i, ++ci)
+    {
+        TexturePtr &shadowTex = *i;
+
+		// Cleanup material that references this texture
+		String matName = shadowTex->getName() + "Mat" + getName();
+		MaterialPtr mat = MaterialManager::getSingleton().getByName(matName);
+		if (!mat.isNull())
+		{
+			// manually clear TUS to ensure texture ref released
+			mat->getTechnique(0)->getPass(0)->removeAllTextureUnitStates();
+			MaterialManager::getSingleton().remove(mat->getHandle());
+		}
+
+		// Always destroy camera since they are local to this SM
+   		destroyCamera(*ci);
+    }
+    mShadowTextures.clear();
+	mShadowTextureCameras.clear();
+
+	// Will destroy if no other scene managers referencing
+	ShadowTextureManager::getSingleton().clearUnused();
+
+	mShadowTextureConfigDirty = true;
+        
+}
+//---------------------------------------------------------------------
+void SceneManager::prepareShadowTextures(Camera* cam, Viewport* vp)
+{
+	// create shadow textures if needed
+	ensureShadowTexturesCreated();
+
+    // Set the illumination stage, prevents recursive calls
+    IlluminationRenderStage savedStage = mIlluminationStage;
+    mIlluminationStage = IRS_RENDER_TO_TEXTURE;
+
+    // Determine far shadow distance
+    Real shadowDist = mShadowFarDist;
+    if (!shadowDist)
+    {
+        // need a shadow distance, make one up
+        shadowDist = cam->getNearClipDistance() * 300;
+    }
+	Real shadowOffset = shadowDist * mShadowTextureOffset;
+    // Precalculate fading info
+	Real shadowEnd = shadowDist + shadowOffset;
+	Real fadeStart = shadowEnd * mShadowTextureFadeStart;
+	Real fadeEnd = shadowEnd * mShadowTextureFadeEnd;
+	// Additive lighting should not use fogging, since it will overbrighten; use border clamp
+	if (!isShadowTechniqueAdditive())
+	{
+		// set fogging to hide the shadow edge 
+		mShadowReceiverPass->setFog(true, FOG_LINEAR, ColourValue::White, 
+			0, fadeStart, fadeEnd);
+	}
+    else
+    {
+        // disable fogging explicitly
+        mShadowReceiverPass->setFog(true, FOG_NONE);
+    }
+
+    // Iterate over the lights we've found, max out at the limit of light textures
+	// Note that the light sorting must now place shadow casting lights at the
+	// start of the light list, therefore we do not need to deal with potential
+	// mismatches in the light<->shadow texture list any more
+
+    LightList::iterator i, iend;
+    ShadowTextureList::iterator si, siend;
+	ShadowTextureCameraList::iterator ci;
+    iend = mLightsAffectingFrustum.end();
+    siend = mShadowTextures.end();
+	ci = mShadowTextureCameras.begin();
+    for (i = mLightsAffectingFrustum.begin(), si = mShadowTextures.begin();
+        i != iend && si != siend; ++i)
+    {
+        Light* light = *i;
+
+		// skip light if shadows are disabled
+		if (!light->getCastShadows())
+			continue;
+
+		TexturePtr &shadowTex = *si;
+        RenderTarget *shadowRTT = shadowTex->getBuffer()->getRenderTarget();
+        Viewport *shadowView = shadowRTT->getViewport(0);
+        Camera *texCam = *ci;
+		// rebind camera, incase another SM in use which has switched to its cam
+		shadowView->setCamera(texCam);
+        
+		// update shadow cam - light mapping
+		ShadowCamLightMapping::iterator camLightIt = mShadowCamLightMapping.find( texCam );
+		assert(camLightIt != mShadowCamLightMapping.end());
+		camLightIt->second = light;
+
+		if (light->getCustomShadowCameraSetup().isNull())
+			mDefaultShadowCameraSetup->getShadowCamera(this, cam, vp, light, texCam);
+		else
+			light->getCustomShadowCameraSetup()->getShadowCamera(this, cam, vp, light, texCam);
+
+        // Setup background colour
+        shadowView->setBackgroundColour(ColourValue::White);
+
+		// Fire shadow caster update, callee can alter camera settings
+		fireShadowTexturesPreCaster(light, texCam);
+
+        // Update target
+        shadowRTT->update();
+
+        ++si; // next shadow texture
+		++ci; // next camera
+    }
+    // Set the illumination stage, prevents recursive calls
+    mIlluminationStage = savedStage;
+
+	fireShadowTexturesUpdated(
+		std::min(mLightsAffectingFrustum.size(), mShadowTextures.size()));
+
+	ShadowTextureManager::getSingleton().clearUnused();
+
+}
+//---------------------------------------------------------------------
+StaticGeometry* SceneManager::createStaticGeometry(const String& name)
+{
+	// Check not existing
+	if (mStaticGeometryList.find(name) != mStaticGeometryList.end())
+	{
+		OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, 
+			"StaticGeometry with name '" + name + "' already exists!", 
+			"SceneManager::createStaticGeometry");
+	}
+	StaticGeometry* ret = new StaticGeometry(this, name);
+	mStaticGeometryList[name] = ret;
+	return ret;
+}
+//---------------------------------------------------------------------
+StaticGeometry* SceneManager::getStaticGeometry(const String& name) const
+{
+	StaticGeometryList::const_iterator i = mStaticGeometryList.find(name);
+	if (i == mStaticGeometryList.end())
+	{
+		OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+			"StaticGeometry with name '" + name + "' not found", 
+			"SceneManager::createStaticGeometry");
+	}
+	return i->second;
+}
+//-----------------------------------------------------------------------
+bool SceneManager::hasStaticGeometry(const String& name) const
+{
+	return (mStaticGeometryList.find(name) != mStaticGeometryList.end());
+}
+
+//---------------------------------------------------------------------
+void SceneManager::destroyStaticGeometry(StaticGeometry* geom)
+{
+	destroyStaticGeometry(geom->getName());
+}
+//---------------------------------------------------------------------
+void SceneManager::destroyStaticGeometry(const String& name)
+{
+	StaticGeometryList::iterator i = mStaticGeometryList.find(name);
+	if (i != mStaticGeometryList.end())
+	{
+		delete i->second;
+		mStaticGeometryList.erase(i);
+	}
+
+}
+//---------------------------------------------------------------------
+void SceneManager::destroyAllStaticGeometry(void)
+{
+	StaticGeometryList::iterator i, iend;
+	iend = mStaticGeometryList.end();
+	for (i = mStaticGeometryList.begin(); i != iend; ++i)
+	{
+		delete i->second;
+	}
+	mStaticGeometryList.clear();
+}
+//---------------------------------------------------------------------
+InstancedGeometry* SceneManager::createInstancedGeometry(const String& name)
+{
+	// Check not existing
+	if (mInstancedGeometryList.find(name) != mInstancedGeometryList.end())
+	{
+		OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, 
+			"InstancedGeometry with name '" + name + "' already exists!", 
+			"SceneManager::createInstancedGeometry");
+	}
+	InstancedGeometry* ret = new InstancedGeometry(this, name);
+	mInstancedGeometryList[name] = ret;
+	return ret;
+}
+//---------------------------------------------------------------------
+InstancedGeometry* SceneManager::getInstancedGeometry(const String& name) const
+{
+	InstancedGeometryList::const_iterator i = mInstancedGeometryList.find(name);
+	if (i == mInstancedGeometryList.end())
+	{
+		OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+			"InstancedGeometry with name '" + name + "' not found", 
+			"SceneManager::createInstancedGeometry");
+	}
+	return i->second;
+}
+//---------------------------------------------------------------------
+void SceneManager::destroyInstancedGeometry(InstancedGeometry* geom)
+{
+	destroyInstancedGeometry(geom->getName());
+}
+//---------------------------------------------------------------------
+void SceneManager::destroyInstancedGeometry(const String& name)
+{
+	InstancedGeometryList::iterator i = mInstancedGeometryList.find(name);
+	if (i != mInstancedGeometryList.end())
+	{
+		delete i->second;
+		mInstancedGeometryList.erase(i);
+	}
+
+}
+//---------------------------------------------------------------------
+void SceneManager::destroyAllInstancedGeometry(void)
+{
+	InstancedGeometryList::iterator i, iend;
+	iend = mInstancedGeometryList.end();
+	for (i = mInstancedGeometryList.begin(); i != iend; ++i)
+	{
+		delete i->second;
+	}
+	mInstancedGeometryList.clear();
+}
+//---------------------------------------------------------------------
+AxisAlignedBoxSceneQuery* 
+SceneManager::createAABBQuery(const AxisAlignedBox& box, unsigned long mask)
+{
+    DefaultAxisAlignedBoxSceneQuery* q = new DefaultAxisAlignedBoxSceneQuery(this);
+    q->setBox(box);
+    q->setQueryMask(mask);
+    return q;
+}
+//---------------------------------------------------------------------
+SphereSceneQuery* 
+SceneManager::createSphereQuery(const Sphere& sphere, unsigned long mask)
+{
+    DefaultSphereSceneQuery* q = new DefaultSphereSceneQuery(this);
+    q->setSphere(sphere);
+    q->setQueryMask(mask);
+    return q;
+}
+//---------------------------------------------------------------------
+PlaneBoundedVolumeListSceneQuery* 
+SceneManager::createPlaneBoundedVolumeQuery(const PlaneBoundedVolumeList& volumes, 
+                                            unsigned long mask)
+{
+    DefaultPlaneBoundedVolumeListSceneQuery* q = new DefaultPlaneBoundedVolumeListSceneQuery(this);
+    q->setVolumes(volumes);
+    q->setQueryMask(mask);
+    return q;
+}
+
+//---------------------------------------------------------------------
+RaySceneQuery* 
+SceneManager::createRayQuery(const Ray& ray, unsigned long mask)
+{
+    DefaultRaySceneQuery* q = new DefaultRaySceneQuery(this);
+    q->setRay(ray);
+    q->setQueryMask(mask);
+    return q;
+}
+//---------------------------------------------------------------------
+IntersectionSceneQuery* 
+SceneManager::createIntersectionQuery(unsigned long mask)
+{
+
+    DefaultIntersectionSceneQuery* q = new DefaultIntersectionSceneQuery(this);
+    q->setQueryMask(mask);
+    return q;
+}
+//---------------------------------------------------------------------
+void SceneManager::destroyQuery(SceneQuery* query)
+{
+    delete query;
+}
+//---------------------------------------------------------------------
+SceneManager::MovableObjectCollection* 
+SceneManager::getMovableObjectCollection(const String& typeName)
+{
+	// lock collection mutex
+	OGRE_LOCK_MUTEX(mMovableObjectCollectionMapMutex)
+
+	MovableObjectCollectionMap::iterator i = 
+		mMovableObjectCollectionMap.find(typeName);
+	if (i == mMovableObjectCollectionMap.end())
+	{
+		// create
+		MovableObjectCollection* newCollection = new MovableObjectCollection();
+		mMovableObjectCollectionMap[typeName] = newCollection;
+		return newCollection;
+	}
+	else
+	{
+		return i->second;
+	}
+}
+//---------------------------------------------------------------------
+const SceneManager::MovableObjectCollection* 
+SceneManager::getMovableObjectCollection(const String& typeName) const
+{
+	// lock collection mutex
+	OGRE_LOCK_MUTEX(mMovableObjectCollectionMapMutex)
+
+	MovableObjectCollectionMap::const_iterator i = 
+		mMovableObjectCollectionMap.find(typeName);
+	if (i == mMovableObjectCollectionMap.end())
+	{
+		OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+			"Object collection named '" + typeName + "' does not exist.", 
+			"SceneManager::getMovableObjectCollection");
+	}
+	else
+	{
+		return i->second;
+	}
+}
+//---------------------------------------------------------------------
+MovableObject* SceneManager::createMovableObject(const String& name, 
+	const String& typeName, const NameValuePairList* params)
+{
+	MovableObjectFactory* factory = 
+		Root::getSingleton().getMovableObjectFactory(typeName);
+	// Check for duplicate names
+	MovableObjectCollection* objectMap = getMovableObjectCollection(typeName);
+
+	{
+		OGRE_LOCK_MUTEX(objectMap->mutex)
+
+		if (objectMap->map.find(name) != objectMap->map.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, 
+				"An object of type '" + typeName + "' with name '" + name
+				+ "' already exists.", 
+				"SceneManager::createMovableObject");
+		}
+
+		MovableObject* newObj = factory->createInstance(name, this, params);
+		objectMap->map[name] = newObj;
+		return newObj;
+	}
+
+}
+//---------------------------------------------------------------------
+void SceneManager::destroyMovableObject(const String& name, const String& typeName)
+{
+	MovableObjectCollection* objectMap = getMovableObjectCollection(typeName);
+	MovableObjectFactory* factory = 
+		Root::getSingleton().getMovableObjectFactory(typeName);
+
+	{
+		OGRE_LOCK_MUTEX(objectMap->mutex)
+
+		MovableObjectMap::iterator mi = objectMap->map.find(name);
+		if (mi != objectMap->map.end())
+		{
+			factory->destroyInstance(mi->second);
+			objectMap->map.erase(mi);
+		}
+	}
+}
+//---------------------------------------------------------------------
+void SceneManager::destroyAllMovableObjectsByType(const String& typeName)
+{
+	MovableObjectCollection* objectMap = getMovableObjectCollection(typeName);
+	MovableObjectFactory* factory = 
+		Root::getSingleton().getMovableObjectFactory(typeName);
+	
+	{
+		OGRE_LOCK_MUTEX(objectMap->mutex)
+		MovableObjectMap::iterator i = objectMap->map.begin();
+		for (; i != objectMap->map.end(); ++i)
+		{
+			// Only destroy our own
+			if (i->second->_getManager() == this)
+			{
+				factory->destroyInstance(i->second);
+			}
+		}
+		objectMap->map.clear();
+	}
+}
+//---------------------------------------------------------------------
+void SceneManager::destroyAllMovableObjects(void)
+{
+	// Lock collection mutex
+	OGRE_LOCK_MUTEX(mMovableObjectCollectionMapMutex)
+
+	MovableObjectCollectionMap::iterator ci = mMovableObjectCollectionMap.begin();
+
+	for(;ci != mMovableObjectCollectionMap.end(); ++ci)
+	{
+		MovableObjectCollection* coll = ci->second;
+
+		// lock map mutex
+		OGRE_LOCK_MUTEX(coll->mutex)
+
+		if (Root::getSingleton().hasMovableObjectFactory(ci->first))
+		{
+			// Only destroy if we have a factory instance; otherwise must be injected
+			MovableObjectFactory* factory = 
+				Root::getSingleton().getMovableObjectFactory(ci->first);
+			MovableObjectMap::iterator i = coll->map.begin();
+			for (; i != coll->map.end(); ++i)
+			{
+				if (i->second->_getManager() == this)
+				{
+					factory->destroyInstance(i->second);
+				}
+			}
+		}
+		coll->map.clear();
+	}
+
+}
+//---------------------------------------------------------------------
+MovableObject* SceneManager::getMovableObject(const String& name, const String& typeName) const
+{
+	const MovableObjectCollection* objectMap = getMovableObjectCollection(typeName);
+	
+	{
+		OGRE_LOCK_MUTEX(objectMap->mutex)
+		MovableObjectMap::const_iterator mi = objectMap->map.find(name);
+		if (mi == objectMap->map.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Object named '" + name + "' does not exist.", 
+				"SceneManager::getMovableObject");
+		}
+		return mi->second;
+	}
+	
+}
+//-----------------------------------------------------------------------
+bool SceneManager::hasMovableObject(const String& name, const String& typeName) const
+{
+	OGRE_LOCK_MUTEX(mMovableObjectCollectionMapMutex)
+
+	MovableObjectCollectionMap::const_iterator i = 
+		mMovableObjectCollectionMap.find(typeName);
+	if (i == mMovableObjectCollectionMap.end())
+		return false;
+	
+	{
+		OGRE_LOCK_MUTEX(i->second->mutex)
+		return (i->second->map.find(name) != i->second->map.end());
+	}
+}
+
+//---------------------------------------------------------------------
+SceneManager::MovableObjectIterator 
+SceneManager::getMovableObjectIterator(const String& typeName)
+{
+	MovableObjectCollection* objectMap = getMovableObjectCollection(typeName);
+	// Iterator not thread safe! Warned in header.
+	return MovableObjectIterator(objectMap->map.begin(), objectMap->map.end());
+}
+//---------------------------------------------------------------------
+void SceneManager::destroyMovableObject(MovableObject* m)
+{
+	destroyMovableObject(m->getName(), m->getMovableType());
+}
+//---------------------------------------------------------------------
+void SceneManager::injectMovableObject(MovableObject* m)
+{
+	MovableObjectCollection* objectMap = getMovableObjectCollection(m->getMovableType());
+	{
+		OGRE_LOCK_MUTEX(objectMap->mutex)
+
+		objectMap->map[m->getName()] = m;
+	}
+}
+//---------------------------------------------------------------------
+void SceneManager::extractMovableObject(const String& name, const String& typeName)
+{
+	MovableObjectCollection* objectMap = getMovableObjectCollection(typeName);
+	{
+		OGRE_LOCK_MUTEX(objectMap->mutex)
+		MovableObjectMap::iterator mi = objectMap->map.find(name);
+		if (mi != objectMap->map.end())
+		{
+			// no delete
+			objectMap->map.erase(mi);
+		}
+	}
+
+}
+//---------------------------------------------------------------------
+void SceneManager::extractMovableObject(MovableObject* m)
+{
+	extractMovableObject(m->getName(), m->getMovableType());
+}
+//---------------------------------------------------------------------
+void SceneManager::extractAllMovableObjectsByType(const String& typeName)
+{
+	MovableObjectCollection* objectMap = getMovableObjectCollection(typeName);
+	{
+		OGRE_LOCK_MUTEX(objectMap->mutex)
+		// no deletion
+		objectMap->map.clear();
+	}
+}
+//---------------------------------------------------------------------
+void SceneManager::_injectRenderWithPass(Pass *pass, Renderable *rend, bool shadowDerivation )
+{
+	// render something as if it came from the current queue
+    const Pass *usedPass = _setPass(pass, false, shadowDerivation);
+    renderSingleObject(rend, usedPass, false);
+}
+//---------------------------------------------------------------------
+RenderSystem *SceneManager::getDestinationRenderSystem()
+{
+	return mDestRenderSystem;
+}
+//---------------------------------------------------------------------
+uint32 SceneManager::_getCombinedVisibilityMask(void) const
+{
+	return mCurrentViewport ?
+		mCurrentViewport->getVisibilityMask() & mVisibilityMask : mVisibilityMask;
+
+}
+//---------------------------------------------------------------------
+const VisibleObjectsBoundsInfo& 
+SceneManager::getVisibleObjectsBoundsInfo(const Camera* cam) const
+{
+	static VisibleObjectsBoundsInfo nullBox;
+
+	CamVisibleObjectsMap::const_iterator camVisObjIt = mCamVisibleObjectsMap.find( cam );
+
+	if ( camVisObjIt == mCamVisibleObjectsMap.end() )
+		return nullBox;
+	else
+		return camVisObjIt->second;
+}
+//---------------------------------------------------------------------
+const VisibleObjectsBoundsInfo& 
+SceneManager::getShadowCasterBoundsInfo( const Light* light ) const
+{
+	static VisibleObjectsBoundsInfo nullBox;
+
+	// find light
+	ShadowCamLightMapping::const_iterator it; 
+	for ( it = mShadowCamLightMapping.begin() ; it != mShadowCamLightMapping.end(); ++it )
+	{
+		if ( it->second == light )
+		{
+			// search the camera-aab list for the texture cam
+			CamVisibleObjectsMap::const_iterator camIt = mCamVisibleObjectsMap.find( it->first );
+
+			if ( camIt == mCamVisibleObjectsMap.end() )
+			{
+				return nullBox;
+			}
+			else
+			{
+                return camIt->second;
+			}
+		}
+	}
+
+	// AAB not available
+	return nullBox;
+}
+//---------------------------------------------------------------------
+void SceneManager::setQueuedRenderableVisitor(SceneManager::SceneMgrQueuedRenderableVisitor* visitor)
+{
+	if (visitor)
+		mActiveQueuedRenderableVisitor = visitor;
+	else
+		mActiveQueuedRenderableVisitor = &mDefaultQueuedRenderableVisitor;
+}
+//---------------------------------------------------------------------
+SceneManager::SceneMgrQueuedRenderableVisitor* SceneManager::getQueuedRenderableVisitor(void) const
+{
+	return mActiveQueuedRenderableVisitor;
+}
+
+
+
+}
Index: /OgreMain/src/OgreSceneManagerEnumerator.cpp
===================================================================
--- /OgreMain/src/OgreSceneManagerEnumerator.cpp	(revision 5)
+++ /OgreMain/src/OgreSceneManagerEnumerator.cpp	(revision 5)
@@ -0,0 +1,338 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreSceneManagerEnumerator.h"
+
+#include "OgreDynLibManager.h"
+#include "OgreDynLib.h"
+#include "OgreConfigFile.h"
+#include "OgreMaterial.h"
+#include "OgreException.h"
+#include "OgreRoot.h"
+#include "OgreLogManager.h"
+
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    template<> SceneManagerEnumerator* Singleton<SceneManagerEnumerator>::ms_Singleton = 0;
+    SceneManagerEnumerator* SceneManagerEnumerator::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    SceneManagerEnumerator& SceneManagerEnumerator::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+
+    //-----------------------------------------------------------------------
+    SceneManagerEnumerator::SceneManagerEnumerator()
+		: mInstanceCreateCount(0), mCurrentRenderSystem(0)
+    {
+        addFactory(&mDefaultFactory);
+
+    }
+    //-----------------------------------------------------------------------
+    SceneManagerEnumerator::~SceneManagerEnumerator()
+    {
+		// Destroy all remaining instances
+		// Really should have shutdown and unregistered by now, but catch here in case
+		for (Instances::iterator i = mInstances.begin(); i != mInstances.end(); ++i)
+		{
+			// destroy instances
+			for(Factories::iterator f = mFactories.begin(); f != mFactories.end(); ++f)
+			{
+				if ((*f)->getMetaData().typeName == i->second->getTypeName())
+				{
+					(*f)->destroyInstance(i->second);
+					break;
+				}
+			}
+
+		}
+		mInstances.clear();
+
+    }
+	//-----------------------------------------------------------------------
+	void SceneManagerEnumerator::addFactory(SceneManagerFactory* fact)
+	{
+		mFactories.push_back(fact);
+		// add to metadata
+		mMetaDataList.push_back(&fact->getMetaData());
+		// Log
+		LogManager::getSingleton().logMessage("SceneManagerFactory for type '" +
+			fact->getMetaData().typeName + "' registered.");
+	}
+	//-----------------------------------------------------------------------
+	void SceneManagerEnumerator::removeFactory(SceneManagerFactory* fact)
+	{
+		// destroy all instances for this factory
+		for (Instances::iterator i = mInstances.begin(); i != mInstances.end(); )
+		{
+			SceneManager* instance = i->second;
+			if (instance->getTypeName() == fact->getMetaData().typeName)
+			{
+				fact->destroyInstance(instance);
+				Instances::iterator deli = i++;
+				mInstances.erase(deli);
+			}
+			else
+			{
+				++i;
+			}
+		}
+		// remove from metadata
+		for (MetaDataList::iterator m = mMetaDataList.begin(); m != mMetaDataList.end(); ++m)
+		{
+			if(*m == &(fact->getMetaData()))
+			{
+				mMetaDataList.erase(m);
+				break;
+			}
+		}
+		mFactories.remove(fact);
+	}
+	//-----------------------------------------------------------------------
+	const SceneManagerMetaData* SceneManagerEnumerator::getMetaData(const String& typeName) const
+	{
+		for (MetaDataList::const_iterator i = mMetaDataList.begin(); 
+			i != mMetaDataList.end(); ++i)
+		{
+			if (typeName == (*i)->typeName)
+			{
+				return *i;
+			}
+		}
+
+	    OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+		    "No metadata found for scene manager of type '" + typeName + "'",
+		    "SceneManagerEnumerator::createSceneManager");
+
+	}
+	//-----------------------------------------------------------------------
+	SceneManagerEnumerator::MetaDataIterator 
+	SceneManagerEnumerator::getMetaDataIterator(void) const
+	{
+		return MetaDataIterator(mMetaDataList.begin(), mMetaDataList.end());
+
+	}
+	//-----------------------------------------------------------------------
+	SceneManager* SceneManagerEnumerator::createSceneManager(
+		const String& typeName, const String& instanceName)
+	{
+		if (mInstances.find(instanceName) != mInstances.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, 
+				"SceneManager instance called '" + instanceName + "' already exists",
+				"SceneManagerEnumerator::createSceneManager");
+		}
+
+		SceneManager* inst = 0;
+		for(Factories::iterator i = mFactories.begin(); i != mFactories.end(); ++i)
+		{
+			if ((*i)->getMetaData().typeName == typeName)
+			{
+				if (instanceName.empty())
+				{
+					// generate a name
+					StringUtil::StrStreamType s;
+					s << "SceneManagerInstance" << ++mInstanceCreateCount;
+					inst = (*i)->createInstance(s.str());
+				}
+				else
+				{
+					inst = (*i)->createInstance(instanceName);
+				}
+				break;
+			}
+		}
+
+		if (!inst)
+		{
+			// Error!
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"No factory found for scene manager of type '" + typeName + "'",
+				"SceneManagerEnumerator::createSceneManager");
+		}
+
+		/// assign rs if already configured
+		if (mCurrentRenderSystem)
+			inst->_setDestinationRenderSystem(mCurrentRenderSystem);
+
+		mInstances[inst->getName()] = inst;
+		
+		return inst;
+		
+
+	}
+	//-----------------------------------------------------------------------
+	SceneManager* SceneManagerEnumerator::createSceneManager(
+		SceneTypeMask typeMask, const String& instanceName)
+	{
+		if (mInstances.find(instanceName) != mInstances.end())
+		{
+			OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, 
+				"SceneManager instance called '" + instanceName + "' already exists",
+				"SceneManagerEnumerator::createSceneManager");
+		}
+
+		SceneManager* inst = 0;
+		String name = instanceName;
+		if (name.empty())
+		{
+			// generate a name
+			StringUtil::StrStreamType s;
+			s << "SceneManagerInstance" << ++mInstanceCreateCount;
+			name = s.str();
+		}
+
+		// Iterate backwards to find the matching factory registered last
+		for(Factories::reverse_iterator i = mFactories.rbegin(); i != mFactories.rend(); ++i)
+		{
+			if ((*i)->getMetaData().sceneTypeMask & typeMask)
+			{
+				inst = (*i)->createInstance(name);
+				break;
+			}
+		}
+
+		// use default factory if none
+		if (!inst)
+			inst = mDefaultFactory.createInstance(name);
+
+		/// assign rs if already configured
+		if (mCurrentRenderSystem)
+			inst->_setDestinationRenderSystem(mCurrentRenderSystem);
+		
+		mInstances[inst->getName()] = inst;
+
+		return inst;
+
+	}
+	//-----------------------------------------------------------------------
+	void SceneManagerEnumerator::destroySceneManager(SceneManager* sm)
+	{
+		// Erase instance from map
+		mInstances.erase(sm->getName());
+
+		// Find factory to destroy
+		for(Factories::iterator i = mFactories.begin(); i != mFactories.end(); ++i)
+		{
+			if ((*i)->getMetaData().typeName == sm->getTypeName())
+			{
+				(*i)->destroyInstance(sm);
+				break;
+			}
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	SceneManager* SceneManagerEnumerator::getSceneManager(const String& instanceName) const
+	{
+		Instances::const_iterator i = mInstances.find(instanceName);
+		if(i != mInstances.end())
+		{
+			return i->second;
+		}
+		else
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"SceneManager instance with name '" + instanceName + "' not found.",
+				"SceneManagerEnumerator::getSceneManager");
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	SceneManagerEnumerator::SceneManagerIterator 
+	SceneManagerEnumerator::getSceneManagerIterator(void)
+	{
+		return SceneManagerIterator(mInstances.begin(), mInstances.end());
+
+	}
+	//-----------------------------------------------------------------------
+    void SceneManagerEnumerator::setRenderSystem(RenderSystem* rs)
+    {
+		mCurrentRenderSystem = rs;
+
+		for (Instances::iterator i = mInstances.begin(); i != mInstances.end(); ++i)
+		{
+            i->second->_setDestinationRenderSystem(rs);
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void SceneManagerEnumerator::shutdownAll(void)
+    {
+		for (Instances::iterator i = mInstances.begin(); i != mInstances.end(); ++i)
+		{
+			// shutdown instances (clear scene)
+			i->second->clearScene();			
+        }
+
+    }
+    //-----------------------------------------------------------------------
+	const String DefaultSceneManagerFactory::FACTORY_TYPE_NAME = "DefaultSceneManager";
+    //-----------------------------------------------------------------------
+	void DefaultSceneManagerFactory::initMetaData(void) const
+	{
+		mMetaData.typeName = FACTORY_TYPE_NAME;
+		mMetaData.description = "The default scene manager";
+		mMetaData.sceneTypeMask = ST_GENERIC;
+		mMetaData.worldGeometrySupported = false;
+	}
+    //-----------------------------------------------------------------------
+	SceneManager* DefaultSceneManagerFactory::createInstance(
+		const String& instanceName)
+	{
+		return new DefaultSceneManager(instanceName);
+	}
+    //-----------------------------------------------------------------------
+	void DefaultSceneManagerFactory::destroyInstance(SceneManager* instance)
+	{
+		delete instance;
+	}
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+	DefaultSceneManager::DefaultSceneManager(const String& name)
+		: SceneManager(name)
+	{
+	}
+    //-----------------------------------------------------------------------
+	DefaultSceneManager::~DefaultSceneManager()
+	{
+	}
+    //-----------------------------------------------------------------------
+	const String& DefaultSceneManager::getTypeName(void) const
+	{
+		return DefaultSceneManagerFactory::FACTORY_TYPE_NAME;
+	}
+    //-----------------------------------------------------------------------
+
+
+}
Index: /OgreMain/src/OgreSceneNode.cpp
===================================================================
--- /OgreMain/src/OgreSceneNode.cpp	(revision 5)
+++ /OgreMain/src/OgreSceneNode.cpp	(revision 5)
@@ -0,0 +1,674 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreSceneNode.h"
+
+#include "OgreException.h"
+#include "OgreEntity.h"
+#include "OgreCamera.h"
+#include "OgreLight.h"
+#include "OgreMath.h"
+#include "OgreSceneManager.h"
+#include "OgreMovableObject.h"
+#include "OgreWireBoundingBox.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    SceneNode::SceneNode(SceneManager* creator)
+        : Node()
+        , mWireBoundingBox(0)
+        , mShowBoundingBox(false)
+        , mCreator(creator)
+        , mYawFixed(false)
+        , mAutoTrackTarget(0)
+        , mIsInSceneGraph(false)
+    {
+        needUpdate();
+    }
+    //-----------------------------------------------------------------------
+    SceneNode::SceneNode(SceneManager* creator, const String& name)
+        : Node(name)
+        , mWireBoundingBox(0)
+        , mShowBoundingBox(false)
+        , mCreator(creator)
+        , mYawFixed(false)
+        , mAutoTrackTarget(0)
+        , mIsInSceneGraph(false)
+    {
+        needUpdate();
+    }
+    //-----------------------------------------------------------------------
+    SceneNode::~SceneNode()
+    {
+        // Detach all objects, do this manually to avoid needUpdate() call 
+        // which can fail because of deleted items
+		ObjectMap::iterator itr;
+		MovableObject* ret;
+		for ( itr = mObjectsByName.begin(); itr != mObjectsByName.end(); itr++ )
+		{
+		  ret = itr->second;
+		  ret->_notifyAttached((SceneNode*)0);
+		}
+        mObjectsByName.clear();
+
+        if (mWireBoundingBox) {
+			delete mWireBoundingBox;
+		}
+    }
+    //-----------------------------------------------------------------------
+    void SceneNode::_update(bool updateChildren, bool parentHasChanged)
+    {
+        Node::_update(updateChildren, parentHasChanged);
+        _updateBounds();
+    }
+    //-----------------------------------------------------------------------
+	void SceneNode::setParent(Node* parent)
+	{
+		Node::setParent(parent);
+
+		if (parent)
+		{
+			SceneNode* sceneParent = static_cast<SceneNode*>(parent);
+			setInSceneGraph(sceneParent->isInSceneGraph());
+		}
+		else
+		{
+			setInSceneGraph(false);
+		}
+	}
+    //-----------------------------------------------------------------------
+	void SceneNode::setInSceneGraph(bool inGraph)
+	{
+		if (inGraph != mIsInSceneGraph)
+		{
+			mIsInSceneGraph = inGraph;
+			// Tell children
+	        ChildNodeMap::iterator child;
+    	    for (child = mChildren.begin(); child != mChildren.end(); ++child)
+        	{
+            	SceneNode* sceneChild = static_cast<SceneNode*>(child->second);
+				sceneChild->setInSceneGraph(inGraph);
+			}
+		}
+	}
+    //-----------------------------------------------------------------------
+    void SceneNode::attachObject(MovableObject* obj)
+    {
+        if (obj->isAttached())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "Object already attached to a SceneNode or a Bone",
+                "SceneNode::attachObject");
+        }
+
+        obj->_notifyAttached(this);
+
+        // Also add to name index
+        std::pair<ObjectMap::iterator, bool> insresult = 
+            mObjectsByName.insert(ObjectMap::value_type(obj->getName(), obj));
+        assert(insresult.second && "Object was not attached because an object of the "
+            "same name was already attached to this node.");
+
+        // Make sure bounds get updated (must go right to the top)
+        needUpdate();
+    }
+    //-----------------------------------------------------------------------
+    unsigned short SceneNode::numAttachedObjects(void) const
+    {
+        return static_cast< unsigned short >( mObjectsByName.size() );
+    }
+    //-----------------------------------------------------------------------
+    MovableObject* SceneNode::getAttachedObject(unsigned short index)
+    {
+        if (index < mObjectsByName.size())
+        {
+            ObjectMap::iterator i = mObjectsByName.begin();
+            // Increment (must do this one at a time)            
+            while (index--)++i;
+
+            return i->second;
+        }
+        else
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Object index out of bounds.", "SceneNode::getAttachedObject");
+        }
+        return 0;
+    }
+    //-----------------------------------------------------------------------
+    MovableObject* SceneNode::getAttachedObject(const String& name)
+    {
+        // Look up 
+        ObjectMap::iterator i = mObjectsByName.find(name);
+
+        if (i == mObjectsByName.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Attached object " + 
+                name + " not found.", "SceneNode::getAttachedObject");
+        }
+
+        return i->second;
+
+    }
+    //-----------------------------------------------------------------------
+    MovableObject* SceneNode::detachObject(unsigned short index)
+    {
+        MovableObject* ret;
+        if (index < mObjectsByName.size())
+        {
+
+            ObjectMap::iterator i = mObjectsByName.begin();
+            // Increment (must do this one at a time)            
+            while (index--)++i;
+
+            ret = i->second;
+            mObjectsByName.erase(i);
+            ret->_notifyAttached((SceneNode*)0);
+
+            // Make sure bounds get updated (must go right to the top)
+            needUpdate();
+
+            return ret;
+
+        }
+        else
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Object index out of bounds.", "SceneNode::getAttchedEntity");
+        }
+        return 0;
+
+    }
+    //-----------------------------------------------------------------------
+    MovableObject* SceneNode::detachObject(const String& name)
+    {
+        ObjectMap::iterator it = mObjectsByName.find(name);
+        if (it == mObjectsByName.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Object " + name + " is not attached "
+                "to this node.", "SceneNode::detachObject");
+        }
+        MovableObject* ret = it->second;
+        mObjectsByName.erase(it);
+        ret->_notifyAttached((SceneNode*)0);
+        // Make sure bounds get updated (must go right to the top)
+        needUpdate();
+        
+        return ret;
+
+    }
+    //-----------------------------------------------------------------------
+    void SceneNode::detachObject(MovableObject* obj)
+    {
+        ObjectMap::iterator i, iend;
+        iend = mObjectsByName.end();
+        for (i = mObjectsByName.begin(); i != iend; ++i)
+        {
+            if (i->second == obj)
+            {
+                mObjectsByName.erase(i);
+                break;
+            }
+        }
+        obj->_notifyAttached((SceneNode*)0);
+
+        // Make sure bounds get updated (must go right to the top)
+        needUpdate();
+
+    }
+    //-----------------------------------------------------------------------
+    void SceneNode::detachAllObjects(void)
+    {
+		ObjectMap::iterator itr;
+		MovableObject* ret;
+		for ( itr = mObjectsByName.begin(); itr != mObjectsByName.end(); itr++ )
+		{
+		  ret = itr->second;
+		  ret->_notifyAttached((SceneNode*)0);
+		}
+        mObjectsByName.clear();
+        // Make sure bounds get updated (must go right to the top)
+        needUpdate();
+    }
+    //-----------------------------------------------------------------------
+    void SceneNode::_updateBounds(void)
+    {
+        // Reset bounds first
+        mWorldAABB.setNull();
+
+        // Update bounds from own attached objects
+        ObjectMap::iterator i;
+        for (i = mObjectsByName.begin(); i != mObjectsByName.end(); ++i)
+        {
+            // Merge world bounds of each object
+            mWorldAABB.merge(i->second->getWorldBoundingBox(true));
+        }
+
+        // Merge with children
+        ChildNodeMap::iterator child;
+        for (child = mChildren.begin(); child != mChildren.end(); ++child)
+        {
+            SceneNode* sceneChild = static_cast<SceneNode*>(child->second);
+            mWorldAABB.merge(sceneChild->mWorldAABB);
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void SceneNode::_findVisibleObjects(Camera* cam, RenderQueue* queue, 
+		VisibleObjectsBoundsInfo* visibleBounds, bool includeChildren, 
+		bool displayNodes, bool onlyShadowCasters)
+    {
+        // Check self visible
+        if (!cam->isVisible(mWorldAABB))
+            return;
+
+        // Add all entities
+        ObjectMap::iterator iobj;
+        ObjectMap::iterator iobjend = mObjectsByName.end();
+        for (iobj = mObjectsByName.begin(); iobj != iobjend; ++iobj)
+        {
+            // Tell attached objects about camera position (incase any extra processing they want to do)
+            iobj->second->_notifyCurrentCamera(cam);
+            if (iobj->second->isVisible() && 
+                (!onlyShadowCasters || iobj->second->getCastShadows()))
+            {
+                iobj->second->_updateRenderQueue(queue);
+
+				// update visible boundaries aab
+				if (visibleBounds)
+				{
+					visibleBounds->merge(iobj->second->getWorldBoundingBox(true), 
+						iobj->second->getWorldBoundingSphere(true), cam);
+				}
+            }
+        }
+
+        if (includeChildren)
+        {
+            ChildNodeMap::iterator child, childend;
+            childend = mChildren.end();
+            for (child = mChildren.begin(); child != childend; ++child)
+            {
+                SceneNode* sceneChild = static_cast<SceneNode*>(child->second);
+                sceneChild->_findVisibleObjects(cam, queue, visibleBounds, includeChildren, 
+					displayNodes, onlyShadowCasters);
+            }
+        }
+
+        if (displayNodes)
+        {
+            // Include self in the render queue
+            queue->addRenderable(this);
+        }
+
+		// Check if the bounding box should be shown.
+		// See if our flag is set or if the scene manager flag is set.
+		if (mShowBoundingBox || (mCreator && mCreator->getShowBoundingBoxes())) 
+		{ 
+			_addBoundingBoxToQueue(queue);
+		}
+
+
+    }
+
+
+	void SceneNode::_addBoundingBoxToQueue(RenderQueue* queue) {
+		// Create a WireBoundingBox if needed.
+		if (mWireBoundingBox == NULL) {
+			mWireBoundingBox = new WireBoundingBox();
+		}
+		mWireBoundingBox->setupBoundingBox(mWorldAABB);
+		queue->addRenderable(mWireBoundingBox);
+	}
+
+	void SceneNode::showBoundingBox(bool bShow) {
+		mShowBoundingBox = bShow;
+	}
+
+	bool SceneNode::getShowBoundingBox() const {
+		return mShowBoundingBox;
+	}
+
+
+    //-----------------------------------------------------------------------
+    void SceneNode::updateFromParentImpl(void) const
+    {
+        Node::updateFromParentImpl();
+
+        // Notify objects that it has been moved
+        ObjectMap::const_iterator i;
+        for (i = mObjectsByName.begin(); i != mObjectsByName.end(); ++i)
+        {
+            MovableObject* object = i->second;
+            object->_notifyMoved();
+        }
+    }
+    //-----------------------------------------------------------------------
+    Node* SceneNode::createChildImpl(void)
+    {
+        assert(mCreator);
+        return mCreator->createSceneNode();
+    }
+    //-----------------------------------------------------------------------
+    Node* SceneNode::createChildImpl(const String& name)
+    {
+        assert(mCreator);
+        return mCreator->createSceneNode(name);
+    }
+    //-----------------------------------------------------------------------
+    const AxisAlignedBox& SceneNode::_getWorldAABB(void) const
+    {
+        return mWorldAABB;
+    }
+    //-----------------------------------------------------------------------
+    SceneNode::ObjectIterator SceneNode::getAttachedObjectIterator(void)
+    {
+        return ObjectIterator(mObjectsByName.begin(), mObjectsByName.end());
+    }
+	//-----------------------------------------------------------------------
+	SceneNode::ConstObjectIterator SceneNode::getAttachedObjectIterator(void) const
+	{
+		return ConstObjectIterator(mObjectsByName.begin(), mObjectsByName.end());
+	}
+    //-----------------------------------------------------------------------
+    void SceneNode::removeAndDestroyChild(const String& name)
+    {
+        SceneNode* pChild = static_cast<SceneNode*>(getChild(name));
+        pChild->removeAndDestroyAllChildren();
+
+        removeChild(name);
+        pChild->getCreator()->destroySceneNode(name);
+
+    }
+    //-----------------------------------------------------------------------
+    void SceneNode::removeAndDestroyChild(unsigned short index)
+    {
+        SceneNode* pChild = static_cast<SceneNode*>(getChild(index));
+        pChild->removeAndDestroyAllChildren();
+
+        removeChild(index);
+        pChild->getCreator()->destroySceneNode(pChild->getName());
+    }
+    //-----------------------------------------------------------------------
+    void SceneNode::removeAndDestroyAllChildren(void)
+    {
+        ChildNodeMap::iterator i, iend;
+        iend = mChildren.end();
+        for (i = mChildren.begin(); i != iend;)
+        {
+            SceneNode* sn = static_cast<SceneNode*>(i->second);
+			// increment iterator before destroying (iterator invalidated by 
+			// SceneManager::destroySceneNode because it causes removal from parent)
+			++i;
+            sn->removeAndDestroyAllChildren();
+            sn->getCreator()->destroySceneNode(sn->getName());
+        }
+	    mChildren.clear();
+        needUpdate();
+    }
+    //-----------------------------------------------------------------------
+	SceneNode* SceneNode::createChildSceneNode(const Vector3& translate, 
+        const Quaternion& rotate)
+	{
+		return static_cast<SceneNode*>(this->createChild(translate, rotate));
+	}
+    //-----------------------------------------------------------------------
+    SceneNode* SceneNode::createChildSceneNode(const String& name, const Vector3& translate, 
+		const Quaternion& rotate)
+	{
+		return static_cast<SceneNode*>(this->createChild(name, translate, rotate));
+	}
+    //-----------------------------------------------------------------------
+    void SceneNode::findLights(LightList& destList, Real radius) const
+    {
+        // No any optimisation here, hope inherits more smart for that.
+        //
+        // If a scene node is static and lights have moved, light list won't change
+        // can't use a simple global boolean flag since this is only called for
+        // visible nodes, so temporarily visible nodes will not be updated
+        // Since this is only called for visible nodes, skip the check for now
+        //
+        if (mCreator)
+        {
+            // Use SceneManager to calculate
+            mCreator->_populateLightList(this->_getDerivedPosition(), radius, destList);
+        }
+        else
+        {
+            destList.clear();
+        }
+    }
+    //-----------------------------------------------------------------------
+    void SceneNode::setAutoTracking(bool enabled, SceneNode* target, 
+        const Vector3& localDirectionVector,
+        const Vector3& offset)
+    {
+        if (enabled)
+        {
+            mAutoTrackTarget = target;
+            mAutoTrackOffset = offset;
+            mAutoTrackLocalDirection = localDirectionVector;
+        }
+        else
+        {
+            mAutoTrackTarget = 0;
+        }
+        if (mCreator)
+            mCreator->_notifyAutotrackingSceneNode(this, enabled);
+    }
+    //-----------------------------------------------------------------------
+    void SceneNode::setFixedYawAxis(bool useFixed, const Vector3& fixedAxis)
+    {
+        mYawFixed = useFixed;
+        mYawFixedAxis = fixedAxis;
+    }
+
+	//-----------------------------------------------------------------------
+	void SceneNode::yaw(const Radian& angle, TransformSpace relativeTo)
+	{
+		if (mYawFixed)
+		{
+			rotate(mYawFixedAxis, angle, relativeTo);
+		}
+		else
+		{
+			rotate(Vector3::UNIT_Y, angle, relativeTo);
+		}
+
+	}
+    //-----------------------------------------------------------------------
+    void SceneNode::setDirection(Real x, Real y, Real z, TransformSpace relativeTo, 
+        const Vector3& localDirectionVector)
+    {
+        setDirection(Vector3(x,y,z), relativeTo, localDirectionVector);
+    }
+
+    //-----------------------------------------------------------------------
+    void SceneNode::setDirection(const Vector3& vec, TransformSpace relativeTo, 
+        const Vector3& localDirectionVector)
+    {
+        // Do nothing if given a zero vector
+        if (vec == Vector3::ZERO) return;
+
+        // The direction we want the local direction point to
+        Vector3 targetDir = vec.normalisedCopy();
+
+        // Transform target direction to world space
+        switch (relativeTo)
+        {
+        case TS_PARENT:
+            if (mInheritOrientation)
+            {
+                if (mParent)
+                {
+                    targetDir = mParent->_getDerivedOrientation() * targetDir;
+                }
+            }
+            break;
+        case TS_LOCAL:
+            targetDir = _getDerivedOrientation() * targetDir;
+            break;
+        case TS_WORLD:
+            // default orientation
+            break;
+        }
+
+        // Calculate target orientation relative to world space
+        Quaternion targetOrientation;
+        if( mYawFixed )
+        {
+            // Calculate the quaternion for rotate local Z to target direction
+            Vector3 xVec = mYawFixedAxis.crossProduct(targetDir);
+            xVec.normalise();
+            Vector3 yVec = targetDir.crossProduct(xVec);
+            yVec.normalise();
+            Quaternion unitZToTarget = Quaternion(xVec, yVec, targetDir);
+
+            if (localDirectionVector == Vector3::NEGATIVE_UNIT_Z)
+            {
+                // Specail case for avoid calculate 180 degree turn
+                targetOrientation =
+                    Quaternion(-unitZToTarget.y, -unitZToTarget.z, unitZToTarget.w, unitZToTarget.x);
+            }
+            else
+            {
+                // Calculate the quaternion for rotate local direction to target direction
+                Quaternion localToUnitZ = localDirectionVector.getRotationTo(Vector3::UNIT_Z);
+                targetOrientation = unitZToTarget * localToUnitZ;
+            }
+        }
+        else
+        {
+            const Quaternion& currentOrient = _getDerivedOrientation();
+
+            // Get current local direction relative to world space
+            Vector3 currentDir = currentOrient * localDirectionVector;
+
+            if ((currentDir+targetDir).squaredLength() < 0.00005f)
+            {
+                // Oops, a 180 degree turn (infinite possible rotation axes)
+                // Default to yaw i.e. use current UP
+                targetOrientation =
+                    Quaternion(-currentOrient.y, -currentOrient.z, currentOrient.w, currentOrient.x);
+            }
+            else
+            {
+                // Derive shortest arc to new direction
+                Quaternion rotQuat = currentDir.getRotationTo(targetDir);
+                targetOrientation = rotQuat * currentOrient;
+            }
+        }
+
+        // Set target orientation, transformed to parent space
+        if (mParent && mInheritOrientation)
+            setOrientation(mParent->_getDerivedOrientation().UnitInverse() * targetOrientation);
+        else
+            setOrientation(targetOrientation);
+    }
+    //-----------------------------------------------------------------------
+    void SceneNode::lookAt( const Vector3& targetPoint, TransformSpace relativeTo, 
+        const Vector3& localDirectionVector)
+    {
+        // Calculate ourself origin relative to the given transform space
+        Vector3 origin;
+        switch (relativeTo)
+        {
+        default:    // Just in case
+        case TS_WORLD:
+            origin = _getDerivedPosition();
+            break;
+        case TS_PARENT:
+            origin = mPosition;
+            break;
+        case TS_LOCAL:
+            origin = Vector3::ZERO;
+            break;
+        }
+
+        setDirection(targetPoint - origin, relativeTo, localDirectionVector);
+    }
+    //-----------------------------------------------------------------------
+    void SceneNode::_autoTrack(void)
+    {
+        // NB assumes that all scene nodes have been updated
+        if (mAutoTrackTarget)
+        {
+            lookAt(mAutoTrackTarget->_getDerivedPosition() + mAutoTrackOffset, 
+                TS_WORLD, mAutoTrackLocalDirection);
+            // update self & children
+            _update(true, true);
+        }
+    }
+    //-----------------------------------------------------------------------
+    SceneNode* SceneNode::getParentSceneNode(void) const
+    {
+        return static_cast<SceneNode*>(getParent());
+    }
+    //-----------------------------------------------------------------------
+    void SceneNode::setVisible(bool visible, bool cascade)
+    {
+        ObjectMap::iterator oi, oiend;
+        oiend = mObjectsByName.end();
+        for (oi = mObjectsByName.begin(); oi != oiend; ++oi)
+        {
+            oi->second->setVisible(visible);
+        }
+
+        if (cascade)
+        {
+            ChildNodeMap::iterator i, iend;
+            iend = mChildren.end();
+            for (i = mChildren.begin(); i != iend; ++i)
+            {
+                static_cast<SceneNode*>(i->second)->setVisible(visible, cascade);
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void SceneNode::flipVisibility(bool cascade)
+    {
+        ObjectMap::iterator oi, oiend;
+        oiend = mObjectsByName.end();
+        for (oi = mObjectsByName.begin(); oi != oiend; ++oi)
+        {
+            oi->second->setVisible(!oi->second->getVisible());
+        }
+
+        if (cascade)
+        {
+            ChildNodeMap::iterator i, iend;
+            iend = mChildren.end();
+            for (i = mChildren.begin(); i != iend; ++i)
+            {
+                static_cast<SceneNode*>(i->second)->flipVisibility(cascade);
+            }
+        }
+    }
+
+
+
+}
Index: /OgreMain/src/OgreSceneQuery.cpp
===================================================================
--- /OgreMain/src/OgreSceneQuery.cpp	(revision 5)
+++ /OgreMain/src/OgreSceneQuery.cpp	(revision 5)
@@ -0,0 +1,370 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreSceneQuery.h"
+#include "OgreException.h"
+#include "OgreSceneManager.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    SceneQuery::SceneQuery(SceneManager* mgr)
+        : mParentSceneMgr(mgr), mQueryMask(0xFFFFFFFF), 
+		mWorldFragmentType(SceneQuery::WFT_NONE)
+    {
+		// default type mask to everything except lights & fx (previous behaviour)
+		mQueryTypeMask = (0xFFFFFFFF & ~SceneManager::FX_TYPE_MASK) 
+			& ~SceneManager::LIGHT_TYPE_MASK;
+
+    }
+    //-----------------------------------------------------------------------
+    SceneQuery::~SceneQuery()
+    {
+    }
+    //-----------------------------------------------------------------------
+    void SceneQuery::setQueryMask(uint32 mask)
+    {
+        mQueryMask = mask;
+    }
+    //-----------------------------------------------------------------------
+    uint32 SceneQuery::getQueryMask(void) const
+    {
+        return mQueryMask;
+    }
+	//-----------------------------------------------------------------------
+	void SceneQuery::setQueryTypeMask(uint32 mask)
+	{
+		mQueryTypeMask = mask;
+	}
+	//-----------------------------------------------------------------------
+	uint32 SceneQuery::getQueryTypeMask(void) const
+	{
+		return mQueryTypeMask;
+	}
+    //-----------------------------------------------------------------------
+    void SceneQuery::setWorldFragmentType(enum SceneQuery::WorldFragmentType wft)
+    {
+        // Check supported
+        if (mSupportedWorldFragments.find(wft) == mSupportedWorldFragments.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "This world fragment type is not supported.",
+                "SceneQuery::setWorldFragmentType");
+        }
+        mWorldFragmentType = wft;
+    }
+    //-----------------------------------------------------------------------
+    SceneQuery::WorldFragmentType 
+    SceneQuery::getWorldFragmentType(void) const
+    {
+        return mWorldFragmentType;
+    }
+    //-----------------------------------------------------------------------
+    RegionSceneQuery::RegionSceneQuery(SceneManager* mgr)
+        :SceneQuery(mgr), mLastResult(NULL)
+    {
+    }
+    //-----------------------------------------------------------------------
+    RegionSceneQuery::~RegionSceneQuery()
+    {
+        clearResults();
+    }
+    //-----------------------------------------------------------------------
+    SceneQueryResult& RegionSceneQuery::getLastResults(void) const
+    {
+        assert(mLastResult);
+        return *mLastResult;
+    }
+    //-----------------------------------------------------------------------
+    void RegionSceneQuery::clearResults(void)
+    {
+        if (mLastResult)
+        {
+            delete mLastResult;
+        }
+        mLastResult = NULL;
+    }
+	//---------------------------------------------------------------------
+    SceneQueryResult&
+    RegionSceneQuery::execute(void)
+    {
+        clearResults();
+        mLastResult = new SceneQueryResult();
+        // Call callback version with self as listener
+        execute(this);
+        return *mLastResult;
+    }
+	//---------------------------------------------------------------------
+    bool RegionSceneQuery::
+        queryResult(MovableObject* obj)
+    {
+        // Add to internal list
+        mLastResult->movables.push_back(obj);
+        // Continue
+        return true;
+    }
+	//---------------------------------------------------------------------
+    bool RegionSceneQuery::queryResult(SceneQuery::WorldFragment* fragment)
+    {
+        // Add to internal list
+        mLastResult->worldFragments.push_back(fragment);
+        // Continue
+        return true;
+    }
+    //-----------------------------------------------------------------------
+    AxisAlignedBoxSceneQuery::AxisAlignedBoxSceneQuery(SceneManager* mgr)
+        : RegionSceneQuery(mgr)
+    {
+    }
+    //-----------------------------------------------------------------------
+    AxisAlignedBoxSceneQuery::~AxisAlignedBoxSceneQuery()
+    {
+    }
+    //-----------------------------------------------------------------------
+    void AxisAlignedBoxSceneQuery::setBox(const AxisAlignedBox& box)
+    {
+        mAABB = box;
+    }
+    //-----------------------------------------------------------------------
+    const AxisAlignedBox& AxisAlignedBoxSceneQuery::getBox(void) const
+    {
+        return mAABB;
+    }
+    //-----------------------------------------------------------------------
+    SphereSceneQuery::SphereSceneQuery(SceneManager* mgr)
+        : RegionSceneQuery(mgr)
+    {
+    }
+    //-----------------------------------------------------------------------
+    SphereSceneQuery::~SphereSceneQuery()
+    {
+    }
+    //-----------------------------------------------------------------------
+    void SphereSceneQuery::setSphere(const Sphere& sphere)
+    {
+        mSphere = sphere;
+    }
+    //-----------------------------------------------------------------------
+    const Sphere& SphereSceneQuery::getSphere() const
+    {
+        return mSphere;
+    }
+
+    //-----------------------------------------------------------------------
+    PlaneBoundedVolumeListSceneQuery::PlaneBoundedVolumeListSceneQuery(SceneManager* mgr)
+        : RegionSceneQuery(mgr)
+    {
+    }
+    //-----------------------------------------------------------------------
+    PlaneBoundedVolumeListSceneQuery::~PlaneBoundedVolumeListSceneQuery()
+    {
+    }
+    //-----------------------------------------------------------------------
+    void PlaneBoundedVolumeListSceneQuery::setVolumes(const PlaneBoundedVolumeList& volumes)
+    {
+        mVolumes = volumes;
+    }
+    //-----------------------------------------------------------------------
+    const PlaneBoundedVolumeList& PlaneBoundedVolumeListSceneQuery::getVolumes() const
+    {
+        return mVolumes;
+    }
+
+    //-----------------------------------------------------------------------
+    RaySceneQuery::RaySceneQuery(SceneManager* mgr) : SceneQuery(mgr)
+    {
+        mSortByDistance = false;
+        mMaxResults = 0;
+    }
+    //-----------------------------------------------------------------------
+    RaySceneQuery::~RaySceneQuery()
+    {
+    }
+    //-----------------------------------------------------------------------
+    void RaySceneQuery::setRay(const Ray& ray)
+    {
+        mRay = ray;
+    }
+    //-----------------------------------------------------------------------
+    const Ray& RaySceneQuery::getRay(void) const
+    {
+        return mRay;
+    }
+    //-----------------------------------------------------------------------
+    void RaySceneQuery::setSortByDistance(bool sort, ushort maxresults)
+    {
+        mSortByDistance = sort;
+        mMaxResults = maxresults;
+    }
+    //-----------------------------------------------------------------------
+    bool RaySceneQuery::getSortByDistance(void) const
+    {
+        return mSortByDistance;
+    }
+    //-----------------------------------------------------------------------
+    ushort RaySceneQuery::getMaxResults(void) const
+    {
+        return mMaxResults;
+    }
+    //-----------------------------------------------------------------------
+    RaySceneQueryResult& RaySceneQuery::execute(void)
+    {
+        // Clear without freeing the vector buffer
+        mResult.clear();
+        
+        // Call callback version with self as listener
+        this->execute(this);
+
+        if (mSortByDistance)
+        {
+            if (mMaxResults != 0 && mMaxResults < mResult.size())
+            {
+                // Partially sort the N smallest elements, discard others
+                std::partial_sort(mResult.begin(), mResult.begin()+mMaxResults, mResult.end());
+                mResult.resize(mMaxResults);
+            }
+            else
+            {
+                // Sort entire result array
+                std::sort(mResult.begin(), mResult.end());
+            }
+        }
+
+        return mResult;
+    }
+    //-----------------------------------------------------------------------
+    RaySceneQueryResult& RaySceneQuery::getLastResults(void)
+    {
+        return mResult;
+    }
+    //-----------------------------------------------------------------------
+    void RaySceneQuery::clearResults(void)
+    {
+        // C++ idiom to free vector buffer: swap with empty vector
+        RaySceneQueryResult().swap(mResult);
+    }
+    //-----------------------------------------------------------------------
+    bool RaySceneQuery::queryResult(MovableObject* obj, Real distance)
+    {
+        // Add to internal list
+        RaySceneQueryResultEntry dets;
+        dets.distance = distance;
+        dets.movable = obj;
+        dets.worldFragment = NULL;
+        mResult.push_back(dets);
+        // Continue
+        return true;
+    }
+    //-----------------------------------------------------------------------
+    bool RaySceneQuery::queryResult(SceneQuery::WorldFragment* fragment, Real distance)
+    {
+        // Add to internal list
+        RaySceneQueryResultEntry dets;
+        dets.distance = distance;
+        dets.movable = NULL;
+        dets.worldFragment = fragment;
+        mResult.push_back(dets);
+        // Continue
+        return true;
+    }
+    //-----------------------------------------------------------------------
+    /*
+    PyramidSceneQuery::PyramidSceneQuery(SceneManager* mgr) : RegionSceneQuery(mgr)
+    {
+    }
+    //-----------------------------------------------------------------------
+    PyramidSceneQuery::~PyramidSceneQuery()
+    {
+    }
+    */
+    //-----------------------------------------------------------------------
+    IntersectionSceneQuery::IntersectionSceneQuery(SceneManager* mgr)
+    : SceneQuery(mgr), mLastResult(NULL)
+    {
+    }
+    //-----------------------------------------------------------------------
+    IntersectionSceneQuery::~IntersectionSceneQuery()
+    {
+        clearResults();
+    }
+    //-----------------------------------------------------------------------
+    IntersectionSceneQueryResult& IntersectionSceneQuery::getLastResults(void) const
+    {
+        assert(mLastResult);
+        return *mLastResult;
+    }
+    //-----------------------------------------------------------------------
+    void IntersectionSceneQuery::clearResults(void)
+    {
+        if (mLastResult)
+        {
+            delete mLastResult;
+        }
+        mLastResult = NULL;
+    }
+	//---------------------------------------------------------------------
+    IntersectionSceneQueryResult&
+    IntersectionSceneQuery::execute(void)
+    {
+        clearResults();
+        mLastResult = new IntersectionSceneQueryResult();
+        // Call callback version with self as listener
+        execute(this);
+        return *mLastResult;
+    }
+	//---------------------------------------------------------------------
+    bool IntersectionSceneQuery::
+        queryResult(MovableObject* first, MovableObject* second)
+    {
+        // Add to internal list
+        mLastResult->movables2movables.push_back(
+            SceneQueryMovableObjectPair(first, second)
+            );
+        // Continue
+        return true;
+    }
+	//---------------------------------------------------------------------
+    bool IntersectionSceneQuery::
+        queryResult(MovableObject* movable, SceneQuery::WorldFragment* fragment)
+    {
+        // Add to internal list
+        mLastResult->movables2world.push_back(
+            SceneQueryMovableObjectWorldFragmentPair(movable, fragment)
+            );
+        // Continue
+        return true;
+    }
+
+
+
+
+}
+    
+
+
+
Index: /OgreMain/src/OgreSearchOps.cpp
===================================================================
--- /OgreMain/src/OgreSearchOps.cpp	(revision 5)
+++ /OgreMain/src/OgreSearchOps.cpp	(revision 5)
@@ -0,0 +1,164 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+// Emulate _findfirst, _findnext on non-Windows platforms
+
+
+#include "OgreSearchOps.h"
+#include <stdio.h>
+#include <ctype.h>
+
+/* Win32 directory operations emulation */
+#if OGRE_PLATFORM != OGRE_PLATFORM_WIN32
+
+#include "OgreNoMemoryMacros.h"
+
+struct _find_search_t
+{
+    char *pattern;
+    char *curfn;
+    char *directory;
+    int dirlen;
+    DIR *dirfd;
+};
+        
+long _findfirst(const char *pattern, struct _finddata_t *data)
+{
+    _find_search_t *fs = new _find_search_t;
+    fs->curfn = NULL;
+    fs->pattern = NULL;
+
+    // Separate the mask from directory name
+    const char *mask = strrchr (pattern, '/');
+    if (mask)
+    {
+        fs->dirlen = mask - pattern;
+        mask++;
+        fs->directory = (char *)malloc (fs->dirlen + 1);
+        memcpy (fs->directory, pattern, fs->dirlen);
+        fs->directory [fs->dirlen] = 0;
+    }
+    else
+    {
+        mask = pattern;
+        fs->directory = strdup (".");
+        fs->dirlen = 1;
+    }
+
+    fs->dirfd = opendir (fs->directory);
+    if (!fs->dirfd)
+    {
+        _findclose ((long)fs);
+        return -1;
+    }
+
+    /* Hack for "*.*" -> "*' from DOS/Windows */
+    if (strcmp (mask, "*.*") == 0)
+        mask += 2;
+    fs->pattern = strdup (mask);
+
+    /* Get the first entry */
+    if (_findnext ((long)fs, data) < 0)
+    {
+        _findclose ((long)fs);
+        return -1;
+    }
+
+    return (long)fs;
+}
+
+int _findnext(long id, struct _finddata_t *data)
+{
+    _find_search_t *fs = (_find_search_t *)id;
+
+    /* Loop until we run out of entries or find the next one */
+    dirent *entry;
+    for (;;)
+    {
+        if (!(entry = readdir (fs->dirfd)))
+            return -1;
+
+        /* See if the filename matches our pattern */
+        if (fnmatch (fs->pattern, entry->d_name, 0) == 0)
+            break;
+    }
+
+    if (fs->curfn)
+        free (fs->curfn);
+    data->name = fs->curfn = strdup (entry->d_name);
+
+    size_t namelen = strlen (entry->d_name);
+    char *xfn = new char [fs->dirlen + 1 + namelen + 1];
+    sprintf (xfn, "%s/%s", fs->directory, entry->d_name);
+
+    /* stat the file to get if it's a subdir and to find its length */
+    struct stat stat_buf;
+    if (stat (xfn, &stat_buf))
+    {
+        // Hmm strange, imitate a zero-length file then
+        data->attrib = _A_NORMAL;
+        data->size = 0;
+    }
+    else
+    {
+        if (S_ISDIR(stat_buf.st_mode))
+            data->attrib = _A_SUBDIR;
+        else
+            /* Default type to a normal file */
+            data->attrib = _A_NORMAL;
+
+        data->size = stat_buf.st_size;
+    }
+
+    delete [] xfn;
+
+    /* Files starting with a dot are hidden files in Unix */
+    if (data->name [0] == '.')
+        data->attrib |= _A_HIDDEN;
+
+    return 0;
+}
+
+int _findclose(long id)
+{
+    int ret;
+    _find_search_t *fs = (_find_search_t *)id;
+    
+    ret = fs->dirfd ? closedir (fs->dirfd) : 0;
+    free (fs->pattern);
+    free (fs->directory);
+    if (fs->curfn)
+        free (fs->curfn);
+    delete fs;
+
+    return ret;
+}
+
+#include "OgreMemoryMacros.h"
+#endif
Index: /OgreMain/src/OgreSerializer.cpp
===================================================================
--- /OgreMain/src/OgreSerializer.cpp	(revision 5)
+++ /OgreMain/src/OgreSerializer.cpp	(revision 5)
@@ -0,0 +1,399 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreSerializer.h"
+#include "OgreLogManager.h"
+#include "OgreDataStream.h"
+#include "OgreException.h"
+#include "OgreVector3.h"
+#include "OgreQuaternion.h"
+
+
+namespace Ogre {
+
+    /// stream overhead = ID + size
+    const size_t STREAM_OVERHEAD_SIZE = sizeof(uint16) + sizeof(uint32);
+    const uint16 HEADER_STREAM_ID = 0x1000;
+    const uint16 OTHER_ENDIAN_HEADER_STREAM_ID = 0x0010;
+    //---------------------------------------------------------------------
+    Serializer::Serializer()
+    {
+        // Version number
+        mVersion = "[Serializer_v1.00]";
+		mFlipEndian = false;
+    }
+    //---------------------------------------------------------------------
+    Serializer::~Serializer()
+    {
+    }
+    //---------------------------------------------------------------------
+	void Serializer::determineEndianness(DataStreamPtr& stream)
+	{
+		if (stream->tell() != 0)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Can only determine the endianness of the input stream if it "
+				"is at the start", "Serializer::determineEndianness");
+		}
+				
+		uint16 dest;
+		// read header id manually (no conversion)
+        stream->read(&dest, sizeof(uint16));
+		// skip back
+		stream->skip(0 - sizeof(uint16));
+		if (dest == HEADER_STREAM_ID)
+		{
+			mFlipEndian = false;
+		}
+		else if (dest == OTHER_ENDIAN_HEADER_STREAM_ID)
+		{
+			mFlipEndian = true;
+		}
+		else
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Can't find a header chunk to determine endianness",
+				"Serializer::determineEndianness");
+		}
+	}
+    //---------------------------------------------------------------------
+	void Serializer::determineEndianness(Endian requestedEndian)
+	{
+		switch(requestedEndian)
+		{
+		case ENDIAN_NATIVE:
+			mFlipEndian = false;
+			break;
+		case ENDIAN_BIG:
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+			mFlipEndian = false;
+#else
+			mFlipEndian = true;
+#endif
+			break;
+		case ENDIAN_LITTLE:
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+			mFlipEndian = true;
+#else
+			mFlipEndian = false;
+#endif
+			break;
+		}
+	}
+    //---------------------------------------------------------------------
+    void Serializer::writeFileHeader(void)
+    {
+        
+        uint16 val = HEADER_STREAM_ID;
+        writeShorts(&val, 1);
+
+        writeString(mVersion);
+
+    }
+    //---------------------------------------------------------------------
+    void Serializer::writeChunkHeader(uint16 id, size_t size)
+    {
+        writeShorts(&id, 1);
+		uint32 uint32size = static_cast<uint32>(size);
+        writeInts(&uint32size, 1);
+    }
+    //---------------------------------------------------------------------
+    void Serializer::writeFloats(const float* const pFloat, size_t count)
+    {
+		if (mFlipEndian)
+		{
+            float * pFloatToWrite = (float *)malloc(sizeof(float) * count);
+            memcpy(pFloatToWrite, pFloat, sizeof(float) * count);
+            
+            flipToLittleEndian(pFloatToWrite, sizeof(float), count);
+            writeData(pFloatToWrite, sizeof(float), count);
+            
+            free(pFloatToWrite);
+		}
+		else
+		{
+            writeData(pFloat, sizeof(float), count);
+		}
+    }
+    //---------------------------------------------------------------------
+    void Serializer::writeFloats(const double* const pDouble, size_t count)
+    {
+		// Convert to float, then write
+		float* tmp = new float[count];
+		for (unsigned int i = 0; i < count; ++i)
+		{
+			tmp[i] = static_cast<float>(pDouble[i]);
+		}
+		if(mFlipEndian)
+		{
+            flipToLittleEndian(tmp, sizeof(float), count);
+            writeData(tmp, sizeof(float), count);
+		}
+		else
+		{
+            writeData(tmp, sizeof(float), count);
+		}
+		delete [] tmp;
+    }
+    //---------------------------------------------------------------------
+    void Serializer::writeShorts(const uint16* const pShort, size_t count = 1)
+    {
+		if(mFlipEndian)
+		{
+            unsigned short * pShortToWrite = (unsigned short *)malloc(sizeof(unsigned short) * count);
+            memcpy(pShortToWrite, pShort, sizeof(unsigned short) * count);
+            
+            flipToLittleEndian(pShortToWrite, sizeof(unsigned short), count);
+            writeData(pShortToWrite, sizeof(unsigned short), count);
+            
+            free(pShortToWrite);
+		}
+		else
+		{
+            writeData(pShort, sizeof(unsigned short), count);
+		}
+    }
+    //---------------------------------------------------------------------
+    void Serializer::writeInts(const uint32* const pInt, size_t count = 1)
+    {
+		if(mFlipEndian)
+		{
+            unsigned int * pIntToWrite = (unsigned int *)malloc(sizeof(unsigned int) * count);
+            memcpy(pIntToWrite, pInt, sizeof(unsigned int) * count);
+            
+            flipToLittleEndian(pIntToWrite, sizeof(unsigned int), count);
+            writeData(pIntToWrite, sizeof(unsigned int), count);
+            
+            free(pIntToWrite);
+		}
+		else
+		{
+            writeData(pInt, sizeof(unsigned int), count);
+		}
+    }
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    void Serializer::writeBools(const bool* const pBool, size_t count = 1)
+    {
+    //no endian flipping for 1-byte bools
+    //XXX Nasty Hack to convert to 1-byte bools
+#	if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+        char * pCharToWrite = (char *)malloc(sizeof(char) * count);
+        for(int i = 0; i < count; i++)
+        {
+            *(char *)(pCharToWrite + i) = *(bool *)(pBool + i);
+        }
+        
+        writeData(pCharToWrite, sizeof(char), count);
+        
+        free(pCharToWrite);
+#	else
+        writeData(pBool, sizeof(bool), count);
+#	endif
+
+    }
+    
+    //---------------------------------------------------------------------
+    void Serializer::writeData(const void* const buf, size_t size, size_t count)
+    {
+        fwrite((void* const)buf, size, count, mpfFile);
+    }
+    //---------------------------------------------------------------------
+    void Serializer::writeString(const String& string)
+    {
+        fputs(string.c_str(), mpfFile);
+        // Write terminating newline char
+        fputc('\n', mpfFile);
+    }
+    //---------------------------------------------------------------------
+    void Serializer::readFileHeader(DataStreamPtr& stream)
+    {
+        unsigned short headerID;
+        
+        // Read header ID
+        readShorts(stream, &headerID, 1);
+        
+        if (headerID == HEADER_STREAM_ID)
+        {
+            // Read version
+            String ver = readString(stream);
+            if (ver != mVersion)
+            {
+                OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+                    "Invalid file: version incompatible, file reports " + String(ver) +
+                    " Serializer is version " + mVersion,
+                    "Serializer::readFileHeader");
+            }
+        }
+        else
+        {
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Invalid file: no header", 
+                "Serializer::readFileHeader");
+        }
+
+    }
+    //---------------------------------------------------------------------
+    unsigned short Serializer::readChunk(DataStreamPtr& stream)
+    {
+        unsigned short id;
+        readShorts(stream, &id, 1);
+        
+        readInts(stream, &mCurrentstreamLen, 1);
+        return id;
+    }
+    //---------------------------------------------------------------------
+    void Serializer::readBools(DataStreamPtr& stream, bool* pDest, size_t count)
+    {
+        //XXX Nasty Hack to convert 1 byte bools to 4 byte bools
+#	if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+        char * pTemp = (char *)malloc(1*count); // to hold 1-byte bools
+        stream->read(pTemp, 1 * count);
+        for(int i = 0; i < count; i++)
+            *(bool *)(pDest + i) = *(char *)(pTemp + i);
+            
+        free (pTemp);
+#	else
+        stream->read(pDest, sizeof(bool) * count);
+#	endif
+        //no flipping on 1-byte datatypes
+    }
+    //---------------------------------------------------------------------
+    void Serializer::readFloats(DataStreamPtr& stream, float* pDest, size_t count)
+    {
+        stream->read(pDest, sizeof(float) * count);
+        flipFromLittleEndian(pDest, sizeof(float), count);
+    }
+    //---------------------------------------------------------------------
+    void Serializer::readFloats(DataStreamPtr& stream, double* pDest, size_t count)
+    {
+		// Read from float, convert to double
+		float* tmp = new float[count];
+		float* ptmp = tmp;
+        stream->read(tmp, sizeof(float) * count);
+        flipFromLittleEndian(tmp, sizeof(float), count);
+		// Convert to doubles (no cast required)
+		while(count--)
+		{
+			*pDest++ = *ptmp++;
+		}
+		delete [] tmp;
+    }
+    //---------------------------------------------------------------------
+    void Serializer::readShorts(DataStreamPtr& stream, unsigned short* pDest, size_t count)
+    {
+        stream->read(pDest, sizeof(unsigned short) * count);
+        flipFromLittleEndian(pDest, sizeof(unsigned short), count);
+    }
+    //---------------------------------------------------------------------
+    void Serializer::readInts(DataStreamPtr& stream, unsigned int* pDest, size_t count)
+    {
+        stream->read(pDest, sizeof(unsigned int) * count);
+        flipFromLittleEndian(pDest, sizeof(unsigned int), count);
+    }
+    //---------------------------------------------------------------------
+    String Serializer::readString(DataStreamPtr& stream, size_t numChars)
+    {
+        assert (numChars <= 255);
+        char str[255];
+        stream->read(str, numChars);
+        str[numChars] = '\0';
+        return str;
+    }
+    //---------------------------------------------------------------------
+    String Serializer::readString(DataStreamPtr& stream)
+    {
+        return stream->getLine(false);
+    }
+    //---------------------------------------------------------------------
+    void Serializer::writeObject(const Vector3& vec)
+    {
+        writeFloats(vec.ptr(), 3);
+    }
+    //---------------------------------------------------------------------
+    void Serializer::writeObject(const Quaternion& q)
+    {
+        float tmp[4] = { q.x, q.y, q.z, q.w };
+        writeFloats(tmp, 4);
+    }
+    //---------------------------------------------------------------------
+    void Serializer::readObject(DataStreamPtr& stream, Vector3& pDest)
+    {
+        readFloats(stream, pDest.ptr(), 3);
+    }
+    //---------------------------------------------------------------------
+    void Serializer::readObject(DataStreamPtr& stream, Quaternion& pDest)
+    {
+        float tmp[4];
+        readFloats(stream, tmp, 4);
+        pDest.x = tmp[0];
+        pDest.y = tmp[1];
+        pDest.z = tmp[2];
+        pDest.w = tmp[3];
+    }
+    //---------------------------------------------------------------------
+
+
+    void Serializer::flipToLittleEndian(void* pData, size_t size, size_t count)
+    {
+		if(mFlipEndian)
+		{
+	        flipEndian(pData, size, count);
+		}
+    }
+    
+    void Serializer::flipFromLittleEndian(void* pData, size_t size, size_t count)
+    {
+		if(mFlipEndian)
+		{
+	        flipEndian(pData, size, count);
+		}
+    }
+    
+    void Serializer::flipEndian(void * pData, size_t size, size_t count)
+    {
+        for(unsigned int index = 0; index < count; index++)
+        {
+            flipEndian((void *)((long)pData + (index * size)), size);
+        }
+    }
+    
+    void Serializer::flipEndian(void * pData, size_t size)
+    {
+        char swapByte;
+        for(unsigned int byteIndex = 0; byteIndex < size/2; byteIndex++)
+        {
+            swapByte = *(char *)((long)pData + byteIndex);
+            *(char *)((long)pData + byteIndex) = *(char *)((long)pData + size - byteIndex - 1);
+            *(char *)((long)pData + size - byteIndex - 1) = swapByte;
+        }
+    }
+    
+}
+
Index: /OgreMain/src/OgreShadowCameraSetup.cpp
===================================================================
--- /OgreMain/src/OgreShadowCameraSetup.cpp	(revision 5)
+++ /OgreMain/src/OgreShadowCameraSetup.cpp	(revision 5)
@@ -0,0 +1,179 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2006  Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreStableHeaders.h"
+#include "OgreCommon.h"
+#include "OgreSceneManager.h"
+#include "OgreLight.h"
+#include "OgreShadowCameraSetup.h"
+#include "OgreCamera.h"
+#include "OgreViewport.h"
+
+
+namespace Ogre 
+{
+	/// Default constructor
+	DefaultShadowCameraSetup::DefaultShadowCameraSetup()  {}
+	
+	/// Destructor
+	DefaultShadowCameraSetup::~DefaultShadowCameraSetup() {}
+	
+	/// Default shadow camera setup implementation
+	void DefaultShadowCameraSetup::getShadowCamera (const SceneManager *sm, const Camera *cam, 
+		const Viewport *vp, const Light *light, Camera *texCam) const
+	{
+		Vector3 pos, dir;
+
+		// reset custom view / projection matrix in case already set
+		texCam->setCustomViewMatrix(false);
+		texCam->setCustomProjectionMatrix(false);
+
+		// get the shadow frustum's far distance
+		Real shadowDist = sm->getShadowFarDistance();
+		if (!shadowDist)
+		{
+			// need a shadow distance, make one up
+			shadowDist = cam->getNearClipDistance() * 300;
+		}
+		Real shadowOffset = shadowDist * (sm->getShadowDirLightTextureOffset());
+
+		// Directional lights 
+		if (light->getType() == Light::LT_DIRECTIONAL)
+		{
+			// set up the shadow texture
+			// Set ortho projection
+			texCam->setProjectionType(PT_ORTHOGRAPHIC);
+			// set easy FOV and near dist so that texture covers far dist
+			texCam->setFOVy(Degree(90));
+			texCam->setNearClipDistance(shadowDist);
+
+			// Calculate look at position
+			// We want to look at a spot shadowOffset away from near plane
+			// 0.5 is a litle too close for angles
+			Vector3 target = cam->getDerivedPosition() + 
+				(cam->getDerivedDirection() * shadowOffset);
+
+			// Calculate direction, which same as directional light direction
+			dir = - light->getDerivedDirection(); // backwards since point down -z
+			dir.normalise();
+
+			// Calculate position
+			// We want to be in the -ve direction of the light direction
+			// far enough to project for the dir light extrusion distance
+			pos = target + dir * sm->getShadowDirectionalLightExtrusionDistance();
+
+			// Round local x/y position based on a world-space texel; this helps to reduce
+			// jittering caused by the projection moving with the camera
+			// Viewport is 2 * near clip distance across (90 degree fov)
+			Real worldTexelSize = (texCam->getNearClipDistance() * 20) / vp->getActualWidth();
+			pos.x -= fmod(pos.x, worldTexelSize);
+			pos.y -= fmod(pos.y, worldTexelSize);
+			pos.z -= fmod(pos.z, worldTexelSize);
+		}
+		// Spotlight
+		else if (light->getType() == Light::LT_SPOTLIGHT)
+		{
+			// Set perspective projection
+			texCam->setProjectionType(PT_PERSPECTIVE);
+			// set FOV slightly larger than the spotlight range to ensure coverage
+			texCam->setFOVy(light->getSpotlightOuterAngle()*1.2);
+			// set near clip the same as main camera, since they are likely
+			// to both reflect the nature of the scene
+			texCam->setNearClipDistance(cam->getNearClipDistance());
+
+			// Calculate position, which same as spotlight position
+			pos = light->getDerivedPosition();
+
+			// Calculate direction, which same as spotlight direction
+			dir = - light->getDerivedDirection(); // backwards since point down -z
+			dir.normalise();
+		}
+		// Point light
+		else
+		{
+			// Set perspective projection
+			texCam->setProjectionType(PT_PERSPECTIVE);
+			// Use 120 degree FOV for point light to ensure coverage more area
+			texCam->setFOVy(Degree(120));
+			// set near clip the same as main camera, since they are likely
+			// to both reflect the nature of the scene
+			texCam->setNearClipDistance(cam->getNearClipDistance());
+
+			// Calculate look at position
+			// We want to look at a spot shadowOffset away from near plane
+			// 0.5 is a litle too close for angles
+			Vector3 target = cam->getDerivedPosition() + 
+				(cam->getDerivedDirection() * shadowOffset);
+
+			// Calculate position, which same as point light position
+			pos = light->getDerivedPosition();
+
+			dir = (pos - target); // backwards since point down -z
+			dir.normalise();
+		}
+
+		// Finally set position
+		texCam->setPosition(pos);
+
+		// Calculate orientation based on direction calculated above
+		/*
+		// Next section (camera oriented shadow map) abandoned
+		// Always point in the same direction, if we don't do this then
+		// we get 'shadow swimming' as camera rotates
+		// As it is, we get swimming on moving but this is less noticeable
+
+		// calculate up vector, we want it aligned with cam direction
+		Vector3 up = cam->getDerivedDirection();
+		// Check it's not coincident with dir
+		if (up.dotProduct(dir) >= 1.0f)
+		{
+		// Use camera up
+		up = cam->getUp();
+		}
+		*/
+		Vector3 up = Vector3::UNIT_Y;
+		// Check it's not coincident with dir
+		if (Math::Abs(up.dotProduct(dir)) >= 1.0f)
+		{
+			// Use camera up
+			up = Vector3::UNIT_Z;
+		}
+		// cross twice to rederive, only direction is unaltered
+		Vector3 left = dir.crossProduct(up);
+		left.normalise();
+		up = dir.crossProduct(left);
+		up.normalise();
+		// Derive quaternion from axes
+		Quaternion q;
+		q.FromAxes(left, up, dir);
+		texCam->setOrientation(q);
+	}
+
+
+}
Index: /OgreMain/src/OgreShadowCameraSetupFocused.cpp
===================================================================
--- /OgreMain/src/OgreShadowCameraSetupFocused.cpp	(revision 5)
+++ /OgreMain/src/OgreShadowCameraSetupFocused.cpp	(revision 5)
@@ -0,0 +1,711 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2006  Torus Knot Software Ltd
+Copyright (c) 2006 Matthias Fink, netAllied GmbH <matthias.fink@web.de>								
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreStableHeaders.h"
+#include "OgreShadowCameraSetupFocused.h"
+#include "OgreRoot.h"
+#include "OgreSceneManager.h"
+#include "OgreCamera.h"
+#include "OgreLight.h"
+#include "OgrePlane.h"
+#include "OgreLogManager.h"
+
+
+namespace Ogre
+{
+	/** transform from normal to light space */
+	const Matrix4 FocusedShadowCameraSetup::msNormalToLightSpace(
+		1,  0,  0,  0,		// x
+		0,  0, -1,  0,		// y
+		0,  1,  0,  0,		// z
+		0,  0,  0,  1);	// w
+	/** transform  from light to normal space */
+	const Matrix4 FocusedShadowCameraSetup::msLightSpaceToNormal(
+		1,  0,  0,  0,		// x
+		0,  0,  1,  0,		// y
+		0, -1,  0,  0,		// z
+		0,  0,  0,  1);	// w
+
+	FocusedShadowCameraSetup::FocusedShadowCameraSetup(void)
+		: mTempFrustum(new Frustum())
+		, mLightFrustumCamera(new Camera("TEMP LIGHT INTERSECT CAM", NULL))
+		, mLightFrustumCameraCalculated(false)
+		, mUseAggressiveRegion(true)
+	{
+		mTempFrustum->setProjectionType(PT_PERSPECTIVE);
+	}
+	//-----------------------------------------------------------------------
+	FocusedShadowCameraSetup::~FocusedShadowCameraSetup(void)
+	{
+		delete mTempFrustum;
+		delete mLightFrustumCamera;
+	}
+	//-----------------------------------------------------------------------
+	void FocusedShadowCameraSetup::calculateShadowMappingMatrix(const SceneManager& sm,
+		const Camera& cam, const Light& light, Matrix4 *out_view, Matrix4 *out_proj, 
+		Camera *out_cam) const
+	{
+		const Vector3& camDir = cam.getDerivedDirection();
+
+		// get the shadow frustum's far distance
+		Real shadowDist = sm.getShadowFarDistance();
+		if (!shadowDist)
+		{
+			// need a shadow distance, make one up
+			shadowDist = cam.getNearClipDistance() * 3000;
+		}
+		Real shadowOffset = shadowDist * sm.getShadowDirLightTextureOffset();
+
+
+		if (light.getType() == Light::LT_DIRECTIONAL)
+		{
+			// generate view matrix if requested
+			if (out_view != NULL)
+			{
+				*out_view = buildViewMatrix(cam.getDerivedPosition(), 
+					-light.getDerivedDirection(), 
+					camDir);
+			}
+
+			// generate projection matrix if requested
+			if (out_proj != NULL)
+			{
+				*out_proj = Matrix4::IDENTITY;
+			}
+
+			// set up camera if requested
+			if (out_cam != NULL)
+			{
+				out_cam->setProjectionType(PT_ORTHOGRAPHIC);
+				out_cam->setDirection(light.getDerivedDirection());
+				out_cam->setPosition(cam.getDerivedPosition());
+				out_cam->setFOVy(Degree(90));
+				out_cam->setNearClipDistance(shadowOffset);
+			}
+		}
+		else if (light.getType() == Light::LT_POINT)
+		{
+			// target analogue to the default shadow textures
+			// Calculate look at position
+			// We want to look at a spot shadowOffset away from near plane
+			// 0.5 is a little too close for angles
+			Vector3 target = cam.getDerivedPosition() + 
+				(cam.getDerivedDirection() * shadowOffset);
+			Vector3 lightDir = target - light.getDerivedPosition();
+			lightDir.normalise();
+
+			// generate view matrix if requested
+			if (out_view != NULL)
+			{
+				*out_view = buildViewMatrix(light.getDerivedPosition(), 
+					lightDir, 
+					camDir);
+			}
+
+			// generate projection matrix if requested
+			if (out_proj != NULL)
+			{
+				// set FOV to 120 degrees
+				mTempFrustum->setFOVy(Degree(120));
+
+				// set near clip distance like the camera
+				mTempFrustum->setNearClipDistance(cam.getNearClipDistance());
+
+				*out_proj = mTempFrustum->getProjectionMatrix();
+			}
+
+			// set up camera if requested
+			if (out_cam != NULL)
+			{
+				out_cam->setProjectionType(PT_PERSPECTIVE);
+				out_cam->setDirection(lightDir);
+				out_cam->setPosition(light.getDerivedPosition());
+				out_cam->setFOVy(Degree(120));
+				out_cam->setNearClipDistance(cam.getNearClipDistance());
+			}
+		}
+		else if (light.getType() == Light::LT_SPOTLIGHT)
+		{
+			// generate view matrix if requested
+			if (out_view != NULL)
+			{
+				*out_view = buildViewMatrix(light.getDerivedPosition(), 
+					light.getDerivedDirection(), 
+					camDir);
+			}
+
+			// generate projection matrix if requested
+			if (out_proj != NULL)
+			{
+				// set FOV slightly larger than spotlight range
+				mTempFrustum->setFOVy(light.getSpotlightOuterAngle() * 1.2);
+
+				// set near clip distance like the camera
+				mTempFrustum->setNearClipDistance(cam.getNearClipDistance());
+
+				*out_proj = mTempFrustum->getProjectionMatrix();
+			}
+
+			// set up camera if requested
+			if (out_cam != NULL)
+			{
+				out_cam->setProjectionType(PT_PERSPECTIVE);
+				out_cam->setDirection(light.getDerivedDirection());
+				out_cam->setPosition(light.getDerivedPosition());
+				out_cam->setFOVy(light.getSpotlightOuterAngle() * 1.2);
+				out_cam->setNearClipDistance(cam.getNearClipDistance());
+			}
+		}
+	}
+	//-----------------------------------------------------------------------
+	void FocusedShadowCameraSetup::calculateB(const SceneManager& sm, const Camera& cam, 
+		const Light& light, const AxisAlignedBox& sceneBB, PointListBody *out_bodyB) const
+	{
+		OgreAssert(out_bodyB != NULL, "bodyB vertex list is NULL");
+
+		/// perform convex intersection of the form B = ((V \cap S) + l) \cap S \cap L
+
+		// get V
+		mBodyB.define(cam);
+
+		if (light.getType() != Light::LT_DIRECTIONAL)
+		{
+			// clip bodyB with sceneBB
+			/* Note, Matthias' original code states this:
+			"The procedure ((V \cap S) + l) \cap S \cap L (Wimmer et al.) leads in some 
+			cases to disappearing shadows. Valid parts of the scene are clipped, so shadows 
+			are partly incomplete. The cause may be the	transformation into light space that 
+			is only done for the corner points which may not contain the whole scene afterwards 
+			any more. So we fall back to the method of Stamminger et al. (V + l) \cap S \cap L 
+			which does not show these anomalies."
+
+			.. leading to the commenting out of the below clip. However, ift makes a major
+			difference to the quality of the focus, and so far I haven't noticed
+			the clipping issues described. Intuitively I would have thought that
+			any clipping issue would be due to the findCastersForLight not being
+			quite right, since if the sceneBB includes those there is no reason for
+			this clip instruction to omit a genuine shadow caster.
+
+			I have made this a user option since the quality effect is major and
+			the clipping problem only seems to occur in some specific cases. 
+			*/
+			if (mUseAggressiveRegion)
+				mBodyB.clip(sceneBB);
+
+			// form a convex hull of bodyB with the light position
+			mBodyB.extend(light.getDerivedPosition());
+
+			// clip bodyB with sceneBB
+			mBodyB.clip(sceneBB);
+
+			// clip with the light frustum
+			// set up light camera to clip with the resulting frustum planes
+			if (!mLightFrustumCameraCalculated)
+			{
+				calculateShadowMappingMatrix(sm, cam, light, NULL, NULL, mLightFrustumCamera);
+				mLightFrustumCameraCalculated = true;
+			}
+			mBodyB.clip(*mLightFrustumCamera);
+
+			// extract bodyB vertices
+			out_bodyB->build(mBodyB);
+
+		}
+		else
+		{
+			// clip bodyB with sceneBB
+			mBodyB.clip(sceneBB);
+
+			// Also clip based on shadow far distance if appropriate
+			Real farDist = sm.getShadowFarDistance();
+			if (farDist)
+			{
+				Vector3 pointOnPlane = cam.getDerivedPosition() + 
+					(cam.getDerivedDirection() * farDist);
+				Plane p(cam.getDerivedDirection(), pointOnPlane);
+				mBodyB.clip(p);
+			}
+
+			// Extrude the intersection bodyB into the inverted light direction and store 
+			// the info in the point list.
+			// The sceneBB holds the maximum extent of the extrusion.
+			out_bodyB->buildAndIncludeDirection(mBodyB, 
+				sceneBB, 
+				-light.getDerivedDirection());
+		}
+	}
+
+	//-----------------------------------------------------------------------
+	void FocusedShadowCameraSetup::calculateLVS(const SceneManager& sm, const Camera& cam, 
+		const Light& light, const AxisAlignedBox& sceneBB, PointListBody *out_LVS) const
+	{
+		ConvexBody bodyLVS;
+
+		// init body with view frustum
+		bodyLVS.define(cam);
+
+		// clip the body with the light frustum (point + spot)
+		// for a directional light the space of the intersected
+		// view frustum and sceneBB is always lighted and in front
+		// of the viewer.
+		if (light.getType() != Light::LT_DIRECTIONAL)
+		{
+			// clip with the light frustum
+			// set up light camera to clip the resulting frustum
+			if (!mLightFrustumCameraCalculated)
+			{
+				calculateShadowMappingMatrix(sm, cam, light, NULL, NULL, mLightFrustumCamera);
+				mLightFrustumCameraCalculated = true;
+			}
+			bodyLVS.clip(*mLightFrustumCamera);
+		}
+
+		// clip the body with the scene bounding box
+		bodyLVS.clip(sceneBB);
+
+		// extract bodyLVS vertices
+		out_LVS->build(bodyLVS);
+	}
+	//-----------------------------------------------------------------------
+	Vector3 FocusedShadowCameraSetup::getLSProjViewDir(const Matrix4& lightSpace, 
+		const Camera& cam, const PointListBody& bodyLVS) const
+	{
+		// goal is to construct a view direction
+		// because parallel lines are not parallel any more after perspective projection we have to transform
+		// a ray to point us the viewing direction
+
+		// fetch a point near the camera
+		const Vector3 e_world = getNearCameraPoint_ws(cam.getViewMatrix(), bodyLVS);
+
+		// plus the direction results in a second point
+		const Vector3 b_world = e_world + cam.getDerivedDirection();
+
+		// transformation into light space
+		const Vector3 e_ls = lightSpace * e_world;
+		const Vector3 b_ls = lightSpace * b_world;
+
+		// calculate the projection direction, which is the subtraction of
+		// b_ls from e_ls. The y component is set to 0 to project the view
+		// direction into the shadow map plane.
+		Vector3 projectionDir(b_ls - e_ls);
+		projectionDir.y = 0;
+		projectionDir.normalise();
+
+		return projectionDir;
+	}
+	//-----------------------------------------------------------------------
+	Vector3 FocusedShadowCameraSetup::getNearCameraPoint_ws(const Matrix4& viewMatrix, 
+		const PointListBody& bodyLVS) const
+	{
+		if (bodyLVS.getPointCount() == 0)
+			return Vector3(0,0,0);
+
+		Vector3 nearEye = viewMatrix * bodyLVS.getPoint(0),	// for comparison
+			nearWorld = bodyLVS.getPoint(0);				// represents the final point
+
+		// store the vertex with the highest z-value which is the nearest point
+		for (size_t i = 1; i < bodyLVS.getPointCount(); ++i)
+		{
+			const Vector3& vWorld = bodyLVS.getPoint(i);
+
+			// comparison is done from the viewer
+			Vector3 vEye = viewMatrix * vWorld;
+
+			if (vEye.z > nearEye.z)
+			{
+				nearEye		= vEye;
+				nearWorld	= vWorld;
+			}
+		}
+
+		return nearWorld;
+	}
+	//-----------------------------------------------------------------------
+	Matrix4 FocusedShadowCameraSetup::transformToUnitCube(const Matrix4& m, 
+		const PointListBody& body) const
+	{
+		// map the transformed body AAB points to the unit cube (-1/-1/-1) / (+1/+1/+1) corners
+		AxisAlignedBox aab_trans;
+
+		for (size_t i = 0; i < body.getPointCount(); ++i)
+		{
+			aab_trans.merge(m * body.getPoint(i));
+		}
+
+		Vector3 vMin, vMax;
+
+		vMin = aab_trans.getMinimum();
+		vMax = aab_trans.getMaximum();
+
+		const Vector3 trans(-(vMax.x + vMin.x) / (vMax.x - vMin.x),
+			-(vMax.y + vMin.y) / (vMax.y - vMin.y),
+			-(vMax.z + vMin.z) / (vMax.z - vMin.z));
+
+		const Vector3 scale(2 / (vMax.x - vMin.x),
+			2 / (vMax.y - vMin.y),
+			2 / (vMax.z - vMin.z));
+
+		Matrix4 mOut(Matrix4::IDENTITY);
+		mOut.setTrans(trans);
+		mOut.setScale(scale);
+
+		return mOut;
+	}
+	//-----------------------------------------------------------------------
+	Matrix4 FocusedShadowCameraSetup::buildViewMatrix(const Vector3& pos, const Vector3& dir, 
+		const Vector3& up) const
+	{
+		Vector3 xN = dir.crossProduct(up);
+		xN.normalise();
+		Vector3 upN = xN.crossProduct(dir);
+		upN.normalise();
+
+		Matrix4 m(xN.x,		xN.y,		xN.z,		-xN.dotProduct(pos),
+			upN.x,		upN.y,		upN.z,		-upN.dotProduct(pos),
+			-dir.x,		-dir.y,	-dir.z,	dir.dotProduct(pos),
+			0.0,			0.0,		0.0,		1.0
+			);
+
+		return m;
+	}
+	//-----------------------------------------------------------------------
+	void FocusedShadowCameraSetup::getShadowCamera (const SceneManager *sm, const Camera *cam, 
+		const Viewport *vp, const Light *light, Camera *texCam) const
+	{
+		// check availability - viewport not needed
+		OgreAssert(sm != NULL, "SceneManager is NULL");
+		OgreAssert(cam != NULL, "Camera (viewer) is NULL");
+		OgreAssert(light != NULL, "Light is NULL");
+		OgreAssert(texCam != NULL, "Camera (texture) is NULL");
+		mLightFrustumCameraCalculated = false;
+
+		// calculate standard shadow mapping matrix
+		Matrix4 LView, LProj;
+		calculateShadowMappingMatrix(*sm, *cam, *light, &LView, &LProj, NULL);
+
+		// build scene bounding box
+		const VisibleObjectsBoundsInfo& visInfo = sm->getShadowCasterBoundsInfo(light);
+		AxisAlignedBox sceneBB = visInfo.aabb;
+		sceneBB.merge(sm->getVisibleObjectsBoundsInfo(cam).aabb);
+		sceneBB.merge(cam->getDerivedPosition());
+
+		// in case the sceneBB is empty (e.g. nothing visible to the cam) simply
+		// return the standard shadow mapping matrix
+		if (sceneBB.isNull())
+		{
+			texCam->setCustomViewMatrix(true, LView);
+			texCam->setCustomProjectionMatrix(true, LProj);
+			return;
+		}
+
+		// calculate the intersection body B
+		mPointListBodyB.reset();
+		calculateB(*sm, *cam, *light, sceneBB, &mPointListBodyB);
+
+		// in case the bodyB is empty (e.g. nothing visible to the light or the cam)
+		// simply return the standard shadow mapping matrix
+		if (mPointListBodyB.getPointCount() == 0)
+		{
+			texCam->setCustomViewMatrix(true, LView);
+			texCam->setCustomProjectionMatrix(true, LProj);
+			return;
+		}
+
+		// transform to light space: y -> -z, z -> y
+		LProj = msNormalToLightSpace * LProj;
+
+		// calculate LVS so it does not need to be calculated twice
+		// calculate the body L \cap V \cap S to make sure all returned points are in 
+		// front of the camera
+		mPointListBodyLVS.reset();
+		calculateLVS(*sm, *cam, *light, sceneBB, &mPointListBodyLVS);
+
+		// fetch the viewing direction
+		const Vector3 viewDir = getLSProjViewDir(LProj * LView, *cam, mPointListBodyLVS);
+
+		// The light space will be rotated in such a way, that the projected light view 
+		// always points upwards, so the up-vector is the y-axis (we already prepared the
+		// light space for this usage).The transformation matrix is set up with the
+		// following parameters:
+		// - position is the origin
+		// - the view direction is the calculated viewDir
+		// - the up vector is the y-axis
+		LProj = buildViewMatrix(Vector3::ZERO, viewDir, Vector3::UNIT_Y) * LProj;
+
+		// map bodyB to unit cube
+		LProj = transformToUnitCube(LProj * LView, mPointListBodyB) * LProj;
+
+		// transform from light space to normal space: y -> z, z -> -y
+		LProj = msLightSpaceToNormal * LProj;
+
+		// set the two custom matrices
+		texCam->setCustomViewMatrix(true, LView);
+		texCam->setCustomProjectionMatrix(true, LProj);
+	}
+
+	//---------------------------------------------------------------------
+	//---------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	FocusedShadowCameraSetup::PointListBody::PointListBody()
+	{
+		// Preallocate some space
+		mBodyPoints.reserve(12);
+	}
+	//-----------------------------------------------------------------------
+	FocusedShadowCameraSetup::PointListBody::PointListBody(const ConvexBody& body)
+	{
+		build(body);
+	}
+	//-----------------------------------------------------------------------
+	FocusedShadowCameraSetup::PointListBody::~PointListBody()
+	{
+	}
+	//-----------------------------------------------------------------------
+	void FocusedShadowCameraSetup::PointListBody::merge(const PointListBody& plb)
+	{
+		size_t size = plb.getPointCount();
+		for (size_t i = 0; i < size; ++i)
+		{
+			this->addPoint(plb.getPoint(i));
+		}
+	}
+	//-----------------------------------------------------------------------
+	void FocusedShadowCameraSetup::PointListBody::build(const ConvexBody& body, bool filterDuplicates)
+	{
+		// erase list
+		mBodyPoints.clear();
+
+		// Try to reserve a representative amount of memory
+		mBodyPoints.reserve(body.getPolygonCount() * 6);
+
+		// build new list
+		for (size_t i = 0; i < body.getPolygonCount(); ++i)
+		{
+			for (size_t j = 0; j < body.getVertexCount(i); ++j)
+			{
+				const Vector3 &vInsert = body.getVertex(i, j);
+
+				// duplicates allowed?
+				if (filterDuplicates)
+				{
+					bool bPresent = false;
+
+					for(Polygon::VertexList::iterator vit = mBodyPoints.begin();
+						vit != mBodyPoints.end(); ++vit)
+					{
+						const Vector3& v = *vit;
+
+						if (vInsert.positionEquals(v))
+						{
+							bPresent = true;
+							break;
+						}
+					}
+
+					if (bPresent == false)
+					{
+						mBodyPoints.push_back(body.getVertex(i, j));
+					}
+				}
+
+				// else insert directly
+				else
+				{
+					mBodyPoints.push_back(body.getVertex(i, j));
+				}
+			}
+		}
+
+		// update AAB
+		// no points altered, so take body AAB
+		mAAB = body.getAABB();
+	}
+	//-----------------------------------------------------------------------
+	void FocusedShadowCameraSetup::PointListBody::buildAndIncludeDirection(
+		const ConvexBody& body, const AxisAlignedBox& aabMax, const Vector3& dir)
+	{
+		// reset point list
+		this->reset();
+
+		// intersect the rays formed by the points in the list with the given direction and
+		// insert them into the list
+
+		// min/max aab points for comparison
+		const Vector3& min = aabMax.getMinimum();
+		const Vector3& max = aabMax.getMaximum();
+
+		// assemble the clipping planes
+		Plane pl[6];
+
+		// front
+		pl[0].redefine(Vector3::UNIT_Z, max);
+		// back
+		pl[1].redefine(Vector3::NEGATIVE_UNIT_Z, min);
+		// left
+		pl[2].redefine(Vector3::NEGATIVE_UNIT_X, min);
+		// right
+		pl[3].redefine(Vector3::UNIT_X, max);
+		// bottom
+		pl[4].redefine(Vector3::NEGATIVE_UNIT_Y, min);
+		// top
+		pl[5].redefine(Vector3::UNIT_Y, max);
+
+
+		const size_t polyCount = body.getPolygonCount();
+		for (size_t iPoly = 0; iPoly < polyCount; ++iPoly)
+		{
+
+			// store the old inserted point and plane info
+			// if the currently processed point hits a different plane than the previous point an 
+			// intersection point is calculated that lies on the two planes' intersection edge
+
+			// fetch current polygon
+			const Polygon& p = body.getPolygon(iPoly);
+
+			size_t pointCount = p.getVertexCount();
+			for (size_t iPoint = 0; iPoint < pointCount ; ++iPoint)
+			{
+				// base point
+				const Vector3& pt = p.getVertex(iPoint);
+
+				// add the base point
+				this->addPoint(pt);
+
+				// intersection ray
+				Ray ray(pt, dir);
+
+				// intersect with each plane
+				for (size_t iPlane = 0; iPlane < 6; ++iPlane)
+				{
+					std::pair< bool, Real > intersect = ray.intersects(pl[ iPlane ]);
+
+					const Vector3 ptIntersect = ray.getPoint(intersect.second);
+
+					// intersection point must exist (first) and the point distance must be greater than null (second)
+					// in case of distance null the intersection point equals the base point
+					if (intersect.first && intersect.second > 0)
+					{
+						if (ptIntersect.x < max.x + 1e-3f && ptIntersect.x > min.x - 1e-3f && 
+							ptIntersect.y < max.y + 1e-3f && ptIntersect.y > min.y - 1e-3f && 
+							ptIntersect.z < max.z + 1e-3f && ptIntersect.z > min.z - 1e-3f)
+						{
+							// in case the point lies on the boundary, continue and see if there is another plane that intersects
+							if (pt.positionEquals(ptIntersect))
+							{
+								continue;
+							}
+
+							// add intersection point
+							this->addPoint(ptIntersect);
+						}
+
+					} // if: intersection available
+
+				} // for: plane intersection
+
+			} // for: polygon point iteration
+
+		} // for: polygon iteration
+	}
+	//-----------------------------------------------------------------------
+	const AxisAlignedBox& FocusedShadowCameraSetup::PointListBody::getAAB(void) const
+	{
+		return mAAB;
+	}
+	//-----------------------------------------------------------------------	
+	void FocusedShadowCameraSetup::PointListBody::addPoint(const Vector3& point)
+	{
+		// dont check for doubles, simply add
+		mBodyPoints.push_back(point);
+
+		// update AAB
+		mAAB.merge(point);
+	}
+	//-----------------------------------------------------------------------
+	void FocusedShadowCameraSetup::PointListBody::addAAB(const AxisAlignedBox& aab)
+	{
+		const Vector3& min = aab.getMinimum();
+		const Vector3& max = aab.getMaximum();
+
+		Vector3 currentVertex = min;
+		// min min min
+		addPoint(currentVertex);
+
+		// min min max
+		currentVertex.z = max.z;
+		addPoint(currentVertex);
+
+		// min max max
+		currentVertex.y = max.y;
+		addPoint(currentVertex);
+
+		// min max min
+		currentVertex.z = min.z;
+		addPoint(currentVertex);
+
+		// max max min
+		currentVertex.x = max.x;
+		addPoint(currentVertex);
+
+		// max max max
+		currentVertex.z = max.z;
+		addPoint(currentVertex);
+
+		// max min max
+		currentVertex.y = min.y;
+		addPoint(currentVertex);
+
+		// max min min
+		currentVertex.z = min.z;
+		addPoint(currentVertex); 
+
+	}
+	//-----------------------------------------------------------------------	
+	const Vector3& FocusedShadowCameraSetup::PointListBody::getPoint(size_t cnt) const
+	{
+		OgreAssert(cnt >= 0 && cnt < getPointCount(), "Search position out of range");
+
+		return mBodyPoints[ cnt ];
+	}
+	//-----------------------------------------------------------------------	
+	size_t FocusedShadowCameraSetup::PointListBody::getPointCount(void) const
+	{
+		return mBodyPoints.size();
+	}
+	//-----------------------------------------------------------------------	
+	void FocusedShadowCameraSetup::PointListBody::reset(void)
+	{
+		mBodyPoints.clear();
+		mAAB.setNull();
+	}
+
+}
+
+
Index: /OgreMain/src/OgreShadowCameraSetupLiSPSM.cpp
===================================================================
--- /OgreMain/src/OgreShadowCameraSetupLiSPSM.cpp	(revision 5)
+++ /OgreMain/src/OgreShadowCameraSetupLiSPSM.cpp	(revision 5)
@@ -0,0 +1,301 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2006  Torus Knot Software Ltd
+Copyright (c) 2006 Matthias Fink, netAllied GmbH <matthias.fink@web.de>								
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreStableHeaders.h"
+#include "OgreShadowCameraSetupLiSPSM.h"
+#include "OgreRoot.h"
+#include "OgreSceneManager.h"
+#include "OgreCamera.h"
+#include "OgreLight.h"
+#include "OgrePlane.h"
+#include "OgreConvexBody.h"
+
+namespace Ogre
+{
+
+
+	LiSPSMShadowCameraSetup::LiSPSMShadowCameraSetup(void)
+		: mOptAdjustFactor(0.1f), mUseSimpleNOpt(true)
+	{
+	}
+	//-----------------------------------------------------------------------
+	LiSPSMShadowCameraSetup::~LiSPSMShadowCameraSetup(void)
+	{
+	}
+	//-----------------------------------------------------------------------
+	Matrix4 LiSPSMShadowCameraSetup::calculateLiSPSM(const Matrix4& lightSpace, 
+		const PointListBody& bodyB, const PointListBody& bodyLVS,
+		const SceneManager& sm, const Camera& cam, const Light& light) const
+	{
+		// set up bodyB AAB in light space
+		AxisAlignedBox bodyBAAB_ls;
+		for (size_t i = 0; i < bodyB.getPointCount(); ++i)
+		{
+			bodyBAAB_ls.merge(lightSpace * bodyB.getPoint(i));
+		}
+
+		// near camera point in light space
+		const Vector3 e_ls = lightSpace * getNearCameraPoint_ws(cam.getViewMatrix(), bodyLVS);
+
+		// C_start has x and y of e and z from the bodyABB_ls (we look down the negative z axis, so take the maximum z value)
+		const Vector3 C_start_ls(e_ls.x, e_ls.y, bodyBAAB_ls.getMaximum().z);
+
+		// calculate the optimal distance between origin and near plane
+		Real n_opt;
+
+		if (mUseSimpleNOpt)
+			n_opt = calculateNOptSimple(bodyLVS, cam);
+		else
+			n_opt = calculateNOpt(lightSpace, bodyBAAB_ls, bodyLVS, cam);
+
+		// in case n_opt is null, uniform shadow mapping will be done
+		if (n_opt <= 0.0)
+		{
+			return Matrix4::IDENTITY;
+		}
+
+		// calculate the projection center C which is n units behind the near plane of P
+		// we look into the negative z direction so add n
+		const Vector3 C(C_start_ls + n_opt * Vector3::UNIT_Z);
+
+		// set up a transformation matrix to transform the light space to its new origin
+		Matrix4 lightSpaceTranslation(Matrix4::IDENTITY);
+		lightSpaceTranslation.setTrans(-C);
+
+		// range from bMin to bMax; d = |B_z_far - B_z_near|
+		Real d = Math::Abs(bodyBAAB_ls.getMaximum().z - bodyBAAB_ls.getMinimum().z);
+
+		// set up the LiSPSM perspective transformation
+		// build up frustum to map P onto the unit cube with (-1/-1/-1) and (+1/+1/+1)
+		Matrix4 P = buildFrustumProjection(-1, 1, -1, 1, n_opt, n_opt + d);
+
+		return P * lightSpaceTranslation;
+	}
+	//-----------------------------------------------------------------------
+	Real LiSPSMShadowCameraSetup::calculateNOpt(const Matrix4& lightSpace, 
+		const AxisAlignedBox& bodyBABB_ls, const PointListBody& bodyLVS, 
+		const Camera& cam) const
+	{
+		// get inverse light space matrix
+		Matrix4 invLightSpace = lightSpace.inverse();
+
+		// get view matrix
+		const Matrix4& viewMatrix = cam.getViewMatrix();
+
+		// calculate z0_ls
+		const Vector3 e_ws  = getNearCameraPoint_ws(viewMatrix, bodyLVS);
+		const Vector3 z0_ls = calculateZ0_ls(lightSpace, e_ws, bodyBABB_ls.getMaximum().z, cam);
+
+		// z1_ls has the same x and y values as z0_ls and the minimum z values of bodyABB_ls
+		const Vector3 z1_ls = Vector3(z0_ls.x, z0_ls.y, bodyBABB_ls.getMinimum().z);
+
+		// world
+		const Vector3 z0_ws = invLightSpace * z0_ls;
+		const Vector3 z1_ws = invLightSpace * z1_ls;
+
+		// eye
+		const Vector3 z0_es = viewMatrix * z0_ws;
+		const Vector3 z1_es = viewMatrix * z1_ws;
+
+		const Real z0 = z0_es.z;
+		const Real z1 = z1_es.z;
+
+		// check if we have to do uniform shadow mapping
+		if ((z0 < 0 && z1 > 0) ||
+			(z1 < 0 && z0 > 0))
+		{
+			// apply uniform shadow mapping
+			return 0.0;
+		}
+		return cam.getNearClipDistance() + Math::Sqrt(z0 * z1) * mOptAdjustFactor;
+	}
+	//-----------------------------------------------------------------------
+	Real LiSPSMShadowCameraSetup::calculateNOptSimple(const PointListBody& bodyLVS, 
+		const Camera& cam) const
+	{
+		// get view matrix
+		const Matrix4& viewMatrix = cam.getViewMatrix();
+
+		// calculate e_es
+		const Vector3 e_ws  = getNearCameraPoint_ws(viewMatrix, bodyLVS);
+		const Vector3 e_es = viewMatrix * e_ws;
+
+		// according to the new formula (mainly for directional lights)
+		// n_opt = zn + sqrt(z0 * z1);
+		// zn is set to Abs(near eye point)
+		// z0 is set to the near camera clip distance
+		// z1 is set to the far camera clip distance
+		return (Math::Abs(e_es.z) + Math::Sqrt(cam.getNearClipDistance() * cam.getFarClipDistance())) * mOptAdjustFactor;
+	}
+	//-----------------------------------------------------------------------
+	Vector3 LiSPSMShadowCameraSetup::calculateZ0_ls(const Matrix4& lightSpace, 
+		const Vector3& e, Real bodyB_zMax_ls, const Camera& cam) const
+	{
+		// z0_ls lies on the intersection point between the planes 'bodyB_ls near plane 
+		// (z = bodyB_zNear_ls)' and plane with normal UNIT_X where e_ls lies upon (x = e_ls_x) 
+		// and the camera's near clipping plane (ls). We are looking towards the negative 
+		// z-direction, so bodyB_zNear_ls equals bodyB_zMax_ls.
+
+		const Vector3& camDir = cam.getDerivedDirection();
+		const Vector3 e_ls = lightSpace * e;
+
+		// set up a plane with the camera direction as normal and e as a point on the plane
+		Plane plane(camDir, e);
+
+		plane = lightSpace * plane;
+
+		// try to intersect plane with a ray from origin V3(e_ls_x, 0.0, bodyB_zNear_ls)T
+		// and direction +/- UNIT_Y
+		Ray ray(Vector3(e_ls.x, 0.0, bodyB_zMax_ls), Vector3::UNIT_Y);
+		std::pair< bool, Real > intersect = ray.intersects(plane);
+
+		// we got an intersection point
+		if (intersect.first == true)
+		{
+			return ray.getPoint(intersect.second);
+		}
+		else
+		{
+			// try the other direction
+			ray = Ray(Vector3(e_ls.x, 0.0, bodyB_zMax_ls), Vector3::NEGATIVE_UNIT_Y);
+			std::pair< bool, Real > intersect = ray.intersects(plane);
+
+			// we got an intersection point
+			if (intersect.first == true)
+			{
+				return ray.getPoint(intersect.second);
+			}
+			else
+			{
+				// failure!
+				return Vector3(0.0, 0.0, 0.0);
+			}
+		}
+	}
+	//-----------------------------------------------------------------------
+	Matrix4 LiSPSMShadowCameraSetup::buildFrustumProjection(Real left, Real right, 
+		Real bottom, Real top, Real near, Real far) const
+	{
+		Real m00 = 2 * near / (right - left),
+			m02 = (right + left) / (right - left),
+			m11 = 2 * near / (top - bottom),
+			m12 = (top + bottom) / (top - bottom),
+			m22 = -(far + near) / (far - near),
+			m23 = -2 * far * near / (far - near),
+			m32 = -1;
+
+		Matrix4 m(m00, 0.0, m02, 0.0,
+			0.0, m11, m12, 0.0,
+			0.0, 0.0, m22, m23,
+			0.0, 0.0, m32, 0.0);
+
+		return m;
+	}
+	//-----------------------------------------------------------------------
+	void LiSPSMShadowCameraSetup::getShadowCamera (const SceneManager *sm, const Camera *cam, 
+		const Viewport *vp, const Light *light, Camera *texCam) const
+	{
+		// check availability - viewport not needed
+		OgreAssert(sm != NULL, "SceneManager is NULL");
+		OgreAssert(cam != NULL, "Camera (viewer) is NULL");
+		OgreAssert(light != NULL, "Light is NULL");
+		OgreAssert(texCam != NULL, "Camera (texture) is NULL");
+		mLightFrustumCameraCalculated = false;
+
+
+		// calculate standard shadow mapping matrix
+		Matrix4 LView, LProj;
+		calculateShadowMappingMatrix(*sm, *cam, *light, &LView, &LProj, NULL);
+
+		// build scene bounding box
+		const VisibleObjectsBoundsInfo& visInfo = sm->getShadowCasterBoundsInfo(light);
+		AxisAlignedBox sceneBB = visInfo.aabb;
+		sceneBB.merge(sm->getVisibleObjectsBoundsInfo(cam).aabb);
+		sceneBB.merge(cam->getDerivedPosition());
+
+		// in case the sceneBB is empty (e.g. nothing visible to the cam) simply
+		// return the standard shadow mapping matrix
+		if (sceneBB.isNull())
+		{
+			texCam->setCustomViewMatrix(true, LView);
+			texCam->setCustomProjectionMatrix(true, LProj);
+			return;
+		}
+
+		// calculate the intersection body B
+		mPointListBodyB.reset();
+		calculateB(*sm, *cam, *light, sceneBB, &mPointListBodyB);
+
+		// in case the bodyB is empty (e.g. nothing visible to the light or the cam)
+		// simply return the standard shadow mapping matrix
+		if (mPointListBodyB.getPointCount() == 0)
+		{
+			texCam->setCustomViewMatrix(true, LView);
+			texCam->setCustomProjectionMatrix(true, LProj);
+			return;
+		}
+
+		// transform to light space: y -> -z, z -> y
+		LProj = msNormalToLightSpace * LProj;
+
+		// calculate LVS so it does not need to be calculated twice
+		// calculate the body L \cap V \cap S to make sure all returned points are in 
+		// front of the camera
+		calculateLVS(*sm, *cam, *light, sceneBB, &mPointListBodyLVS);
+
+		// fetch the viewing direction
+		const Vector3 viewDir = getLSProjViewDir(LProj * LView, *cam, mPointListBodyLVS);
+
+		// The light space will be rotated in such a way, that the projected light view 
+		// always points upwards, so the up-vector is the y-axis (we already prepared the
+		// light space for this usage).The transformation matrix is set up with the
+		// following parameters:
+		// - position is the origin
+		// - the view direction is the calculated viewDir
+		// - the up vector is the y-axis
+		LProj = buildViewMatrix(Vector3::ZERO, viewDir, Vector3::UNIT_Y) * LProj;
+
+		// calculate LiSPSM projection
+		LProj = calculateLiSPSM(LProj * LView, mPointListBodyB, mPointListBodyLVS, *sm, *cam, *light) * LProj;
+
+		// map bodyB to unit cube
+		LProj = transformToUnitCube(LProj * LView, mPointListBodyB) * LProj;
+
+		// transform from light space to normal space: y -> z, z -> -y
+		LProj = msLightSpaceToNormal * LProj;
+
+		// LView = Lv^-1
+		// LProj = Switch_{-ls} * FocusBody * P * L_r * Switch_{ls} * L_p
+		texCam->setCustomViewMatrix(true, LView);
+		texCam->setCustomProjectionMatrix(true, LProj);
+	}
+
+}
+
Index: /OgreMain/src/OgreShadowCameraSetupPlaneOptimal.cpp
===================================================================
--- /OgreMain/src/OgreShadowCameraSetupPlaneOptimal.cpp	(revision 5)
+++ /OgreMain/src/OgreShadowCameraSetupPlaneOptimal.cpp	(revision 5)
@@ -0,0 +1,416 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2006  Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreStableHeaders.h"
+#include "OgreCommon.h"
+#include "OgreSceneManager.h"
+#include "OgreLight.h"
+#include "OgreShadowCameraSetupPlaneOptimal.h"
+#include "OgreNumerics.h"
+#include "OgreCamera.h"
+#include "OgreViewport.h"
+
+
+namespace Ogre 
+{
+	// --------------------------------------------------------------------
+	Matrix4 PlaneOptimalShadowCameraSetup::computeConstrainedProjection(
+		const Vector4& pinhole, 
+		const std::vector<Vector4>& fpoint, 
+		const std::vector<Vector2>& constraint) const
+	{
+		// NOTE: will assume the z coordinates should be decided such that
+		// the first 3 points (in fpoint) will have post projective
+		// z coordinates of about +1 and the 4th (in fpoint) will have a 
+		// post projective z coordinate of about -1.
+
+		// TODO: could use SVD to avoid arbitrarily choosing one 
+		// matrix element to be 1.0 (and thereby fix the scale).
+
+		Matrix4 ret;
+		int i;
+		bool incrPrecision = false; // use to control numerical solving
+
+		if(fpoint.size() < 4 || constraint.size() < 4) {
+			return Matrix4::IDENTITY;
+		}
+
+		// allocate memory
+		PreciseReal **mat = NULL;
+		PreciseReal **backmat = NULL;
+		{
+			mat = new PreciseReal*[11];
+			if(incrPrecision)
+				backmat = new PreciseReal*[11];
+			for(i=0; i<11; i++) 
+			{
+				mat[i] = new PreciseReal[11];
+				if(incrPrecision)
+					backmat[i] = new PreciseReal[11];
+			}
+		}
+
+		// set up linear system to solve for all rows of projective matrix
+		// except for the 3rd which corresponds to mapping of z values
+
+		// we choose a nonzero element of the last row to set to the arbitrary
+		// constant 1.0.
+		int nzind = 3;
+		PreciseReal col[11];
+		PreciseReal backcol[11];
+
+		// fill in light position constraints
+		mat[0][0] = pinhole.x;
+		mat[0][1] = pinhole.y;
+		mat[0][2] = pinhole.z;
+		mat[0][3] = pinhole.w;
+		for(i=4; i<11; i++)
+			mat[0][i] = 0.0;
+		col[0] = 0.0;
+
+		for(i=0; i<11; i++)
+			mat[1][i] = 0.0;
+		mat[1][4] = pinhole.x;
+		mat[1][5] = pinhole.y;
+		mat[1][6] = pinhole.z;
+		mat[1][7] = pinhole.w;
+		col[1] = 0.0;
+
+		PreciseReal larr[4];
+		larr[0] = pinhole.x;
+		larr[1] = pinhole.y;
+		larr[2] = pinhole.z;
+		larr[3] = pinhole.w;
+		for(i=0; i<8; i++)
+			mat[2][i] = 0.0;
+		int ind = 8;
+		for(i=0; i<4; i++)
+		{
+			if(nzind == i)
+				continue;
+			mat[2][ind++] = larr[i];
+		}
+		col[2] = -larr[nzind];
+
+		// fill in all the other constraints
+		int row=3;
+		for(i=0; i<4; i++)
+		{
+			int j;
+			larr[0] = fpoint[i].x;
+			larr[1] = fpoint[i].y;
+			larr[2] = fpoint[i].z;
+			larr[3] = fpoint[i].w;
+
+			// lexel s coordinate constraint
+			for(j=0; j<4; j++)
+				mat[row][j] = larr[j];
+			for(j=4; j<8; j++)
+				mat[row][j] = 0.0;
+			ind=8;
+			for(j=0; j<4; j++)
+			{
+				if(nzind==j)
+					continue;
+				mat[row][ind++] = larr[j] * (-constraint[i].x);
+			}
+			col[row] = larr[nzind] * constraint[i].x;
+			++row;
+
+			// lexel t coordinate constraint
+			for(j=0; j<4; j++)
+				mat[row][j] = 0.0;
+			for(j=4; j<8; j++)
+				mat[row][j] = larr[j-4];
+
+			ind=8;
+			for(j=0; j<4; j++)
+			{
+				if(nzind==j)
+					continue;
+				mat[row][ind++] = larr[j] * (-constraint[i].y);
+			}
+			col[row] = larr[nzind] * constraint[i].y;
+			++row;
+		}
+
+		// copy the matrix and vector for later computation
+		if(incrPrecision)
+		{
+			for (i=0; i<11; i++)
+			{
+				for(int j=0; j<11; j++)
+					backmat[i][j] = mat[i][j];
+				backcol[i] = col[i];
+			}
+		}
+
+		// solve for the matrix elements
+		if(!NumericSolver::solveNxNLinearSysDestr(11, mat, col)) 
+		{
+			// error solving for projective matrix (rows 1,2,4)
+		}
+
+		// get a little more precision
+		if(incrPrecision)
+		{
+			for (int k=0; k<3; k++)
+			{
+				PreciseReal nvec[11];
+				for(i=0; i<11; i++)
+				{
+					int j;
+					nvec[i] = backmat[i][0] * col[0];
+					mat[i][0] = backmat[i][0];
+					for(j=1; j<11; j++) 
+					{
+						nvec[i] += backmat[i][j] * col[j];
+						mat[i][j] = backmat[i][j];
+					}
+					nvec[i] -= backcol[i];
+				}
+				if(!NumericSolver::solveNxNLinearSysDestr(11, mat, nvec)) 
+				{
+					// error solving for increased precision rows 1,2,4
+				}
+				for(i=0; i<11; i++)
+					col[i] -= nvec[i];
+			}
+		}
+
+		PreciseReal row4[4];
+		ind = 8;
+		for(i=0; i<4; i++)
+		{
+			if (i == nzind)
+				row4[i] = 1.0;
+			else
+				row4[i] = col[ind++];
+		}
+
+
+		// now solve for the 3rd row which affects depth precision
+		PreciseReal zrow[4];
+
+		// we want the affine skew such that isoplanes of constant depth are parallel to
+		// the world plane of interest
+		// NOTE: recall we perturbed the last fpoint off the plane, so we'll again modify
+		// this one since we want 3 points on the plane = far plane, and 1 on the near plane
+		int nearind = 3;
+		for(i=0; i<3; i++)
+		{
+			mat[i][0] = fpoint[i].x;
+			mat[i][1] = fpoint[i].y;
+			mat[i][2] = fpoint[i].z;
+			mat[i][3] = 1.0;
+			zrow[i] = (row4[0] * fpoint[i].x +
+				row4[1] * fpoint[i].y +
+				row4[2] * fpoint[i].z +
+				row4[3]) * 0.99 ;
+		}
+		mat[3][0] = fpoint[nearind].x;
+		mat[3][1] = fpoint[nearind].y;
+		mat[3][2] = fpoint[nearind].z;
+		mat[3][3] = 1.0;
+		zrow[3] =	 -row4[0] * fpoint[nearind].x -
+			row4[1] * fpoint[nearind].y -
+			row4[2] * fpoint[nearind].z -
+			row4[3] ;
+
+		// solve for the z row of the matrix
+		if(!NumericSolver::solveNxNLinearSysDestr(4, mat, zrow)) 
+		{
+			// error solving for projective matrix (row 3)
+		}
+
+		// set projective texture matrix
+		ret = Matrix4(  col[0],  col[1],  col[2],  col[3],
+			col[4],  col[5],  col[6],  col[7], 
+			zrow[0], zrow[1], zrow[2], zrow[3],
+			row4[0], row4[1], row4[2], row4[3] );
+
+
+		// check for clip 
+		Vector4 testCoord = ret * fpoint[0];
+		if(testCoord.w < 0.0) 
+			ret = ret *  (-1.0);
+
+		// free memory
+		for (i=0; i<11; i++)
+		{
+			if (mat[i])
+				delete [] mat[i];
+			if (incrPrecision)
+				delete [] backmat[i];
+		}
+		delete [] mat;
+		if(incrPrecision)
+			delete [] backmat;
+
+		return ret;
+
+	}
+
+	// --------------------------------------------------------------------
+
+	/// Construct object to consider a specified plane of interest
+	PlaneOptimalShadowCameraSetup::PlaneOptimalShadowCameraSetup(MovablePlane* plane)
+	{
+		m_plane = plane;
+	}
+
+	/// Destructor
+	PlaneOptimalShadowCameraSetup::~PlaneOptimalShadowCameraSetup() {}
+
+	/// Implements the plane optimal shadow camera setup algorithm
+	void PlaneOptimalShadowCameraSetup::getShadowCamera (const SceneManager *sm, const Camera *cam, 
+		const Viewport *vp, const Light *light, Camera *texCam) const
+	{
+		// get the plane transformed by the parent node(s)
+		// Also, make sure the plane is normalized
+		Plane worldPlane = m_plane->_getDerivedPlane();
+		worldPlane.normalise();
+
+		// get camera's projection matrix
+		Matrix4 camProjection = cam->getProjectionMatrix() * cam->getViewMatrix();
+
+		// get the world points to constrain
+		std::vector<Vector4> vhull;
+		cam->forwardIntersect(worldPlane, &vhull);
+		if (vhull.size() < 4)
+			return;
+
+		// make sure the last point is a finite point (not point at infinity)
+        if (vhull[3].w == 0.0)
+        {
+		    int finiteIndex = -1;
+		    for (uint loopIndex = 0; loopIndex < vhull.size(); loopIndex++)
+		    {
+			    if (vhull[loopIndex].w != 0.0)
+                {
+				    finiteIndex = loopIndex;
+                    break;
+                }
+		    }
+		    if (finiteIndex == -1)
+		    {
+                // there are no finite points, which means camera doesn't see plane of interest.
+                // so we don't care what the shadow map matrix is
+                // We'll map points off the shadow map so they aren't even stored
+                Matrix4 crazyMat(0.0, 0.0, 0.0, 5.0,
+                                 0.0, 0.0, 0.0, 5.0,
+                                 0.0, 0.0, 0.0, 5.0,
+                                 0.0, 0.0, 0.0, 1.0);
+                texCam->setCustomViewMatrix(true, Matrix4::IDENTITY);
+                texCam->setCustomProjectionMatrix(true, crazyMat);	
+                return;
+		    }
+            // swap finite point to last point
+            std::swap(vhull[3], vhull[finiteIndex]);
+        }
+        vhull.resize(4);
+
+		// get the post-projective coordinate constraints
+		std::vector<Vector2> constraint;
+		for (int i=0; i<4; i++)
+		{
+			Vector4 postProjPt = camProjection * vhull[i];
+			postProjPt *= 1.0 / postProjPt.w;
+			constraint.push_back(Vector2(postProjPt.x, postProjPt.y));
+		}
+
+		// perturb one point so we don't have coplanarity
+		const Vector4& pinhole = light->getAs4DVector();
+		const Vector4& oldPt = vhull.back();
+        Vector4 newPt;
+        if (pinhole.w == 0)
+        {
+            // It's directional light
+            static const Real NEAR_SCALE = 100.0;
+            newPt = oldPt + (pinhole * (cam->getNearClipDistance() * NEAR_SCALE));
+        }
+        else
+        {
+            // It's point or spotlight
+		    Vector4 displacement = oldPt - pinhole;
+		    Vector3 displace3    = Vector3(displacement.x, displacement.y, displacement.z);
+		    Real dotProd = fabs(displace3.dotProduct(worldPlane.normal));
+		    static const Real NEAR_FACTOR = 0.05;
+		    newPt = pinhole + (displacement * (cam->getNearClipDistance() * NEAR_FACTOR / dotProd));
+        }
+		vhull.back() = newPt;
+
+		// solve for the matrix that stabilizes the plane
+		Matrix4 customMatrix = computeConstrainedProjection(pinhole, vhull, constraint);
+
+        if (pinhole.w == 0)
+        {
+            // TODO: factor into view and projection pieces.
+            // Note: In fact, it's unnecessary to factor into view and projection pieces,
+            // but if we do, we will more according with academic requirement :)
+            texCam->setCustomViewMatrix(true, Matrix4::IDENTITY);
+            texCam->setCustomProjectionMatrix(true, customMatrix);
+            return;
+        }
+
+        Vector3 tempPos = Vector3(pinhole.x, pinhole.y, pinhole.z);
+
+		// factor into view and projection pieces
+		Matrix4    translation(1.0, 0.0, 0.0,  tempPos.x,
+			0.0, 1.0, 0.0,  tempPos.y,
+			0.0, 0.0, 1.0,  tempPos.z,
+			0.0, 0.0, 0.0,  1.0);
+		Matrix4 invTranslation(1.0, 0.0, 0.0, -tempPos.x,
+			0.0, 1.0, 0.0, -tempPos.y,
+			0.0, 0.0, 1.0, -tempPos.z,
+			0.0, 0.0, 0.0,  1.0);
+		Matrix4 tempMatrix = customMatrix * translation;
+		Vector3 zRow(-tempMatrix[3][0], -tempMatrix[3][1], -tempMatrix[3][2]);
+		zRow.normalise();
+		Vector3 up;
+		if (zRow.y == 1.0)
+			up = Vector3(1,0,0);
+		else
+			up = Vector3(0,1,0);
+		Vector3 xDir = up.crossProduct(zRow);
+		xDir.normalise();
+		up = zRow.crossProduct(xDir);
+		Matrix4 rotation(xDir.x, up.x, zRow.x, 0.0,
+			xDir.y, up.y, zRow.y, 0.0,
+			xDir.z, up.z, zRow.z, 0.0,
+			0.0,  0.0,    0.0, 1.0 );
+		Matrix4 customProj = tempMatrix * rotation;
+		Matrix4 customView = rotation.transpose() * invTranslation;
+		// note: now customProj * (0,0,0,1)^t = (0, 0, k, 0)^t for k some constant
+		// note: also customProj's 4th row is (0, 0, c, 0) for some negative c.
+
+
+		// set the shadow map camera
+		texCam->setCustomViewMatrix(true, customView);
+		texCam->setCustomProjectionMatrix(true, customProj);
+	}
+
+}
+
Index: /OgreMain/src/OgreShadowCaster.cpp
===================================================================
--- /OgreMain/src/OgreShadowCaster.cpp	(revision 5)
+++ /OgreMain/src/OgreShadowCaster.cpp	(revision 5)
@@ -0,0 +1,412 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreLight.h"
+#include "OgreEdgeListBuilder.h"
+#include "OgreOptimisedUtil.h"
+
+namespace Ogre {
+    const LightList& ShadowRenderable::getLights(void) const 
+    {
+        // return empty
+        static LightList ll;
+        return ll;
+    }
+    // ------------------------------------------------------------------------
+    void ShadowCaster::updateEdgeListLightFacing(EdgeData* edgeData, 
+        const Vector4& lightPos)
+    {
+        edgeData->updateTriangleLightFacing(lightPos);
+    }
+    // ------------------------------------------------------------------------
+    void ShadowCaster::generateShadowVolume(EdgeData* edgeData, 
+        const HardwareIndexBufferSharedPtr& indexBuffer, const Light* light,
+        ShadowRenderableList& shadowRenderables, unsigned long flags)
+    {
+        // Edge groups should be 1:1 with shadow renderables
+        assert(edgeData->edgeGroups.size() == shadowRenderables.size());
+
+        EdgeData::EdgeGroupList::const_iterator egi, egiend;
+        ShadowRenderableList::const_iterator si;
+
+        Light::LightTypes lightType = light->getType();
+
+		// pre-count the size of index data we need since it makes a big perf difference
+		// to GL in particular if we lock a smaller area of the index buffer
+		size_t preCountIndexes = 0;
+
+		si = shadowRenderables.begin();
+		egiend = edgeData->edgeGroups.end();
+		for (egi = edgeData->edgeGroups.begin(); egi != egiend; ++egi, ++si)
+		{
+			const EdgeData::EdgeGroup& eg = *egi;
+			bool  firstDarkCapTri = true;
+
+			EdgeData::EdgeList::const_iterator i, iend;
+			iend = eg.edges.end();
+			for (i = eg.edges.begin(); i != iend; ++i)
+			{
+				const EdgeData::Edge& edge = *i;
+
+				// Silhouette edge, when two tris has opposite light facing, or
+				// degenerate edge where only tri 1 is valid and the tri light facing
+				char lightFacing = edgeData->triangleLightFacings[edge.triIndex[0]];
+				if ((edge.degenerate && lightFacing) ||
+					(!edge.degenerate && (lightFacing != edgeData->triangleLightFacings[edge.triIndex[1]])))
+				{
+
+					preCountIndexes += 3;
+
+					// Are we extruding to infinity?
+					if (!(lightType == Light::LT_DIRECTIONAL &&
+						flags & SRF_EXTRUDE_TO_INFINITY))
+					{
+						preCountIndexes += 3;
+					}
+
+					// Do dark cap tri
+					// Use McGuire et al method, a triangle fan covering all silhouette
+					// edges and one point (taken from the initial tri)
+					if (flags & SRF_INCLUDE_DARK_CAP)
+					{
+						if (firstDarkCapTri)
+						{
+							firstDarkCapTri = false;
+						}
+						else
+						{
+							preCountIndexes += 3;
+						}
+
+					}
+				}
+
+			}
+
+			// Do light cap
+			if (flags & SRF_INCLUDE_LIGHT_CAP) 
+			{
+				// Iterate over the triangles which are using this vertex set
+				EdgeData::TriangleList::const_iterator ti, tiend;
+				EdgeData::TriangleLightFacingList::const_iterator lfi;
+				ti = edgeData->triangles.begin() + eg.triStart;
+				tiend = ti + eg.triCount;
+				lfi = edgeData->triangleLightFacings.begin() + eg.triStart;
+				for ( ; ti != tiend; ++ti, ++lfi)
+				{
+					const EdgeData::Triangle& t = *ti;
+					assert(t.vertexSet == eg.vertexSet);
+					// Check it's light facing
+					if (*lfi)
+					{
+						preCountIndexes += 3;
+					}
+				}
+
+			}
+
+		}
+		// End pre-count
+
+
+        // Lock index buffer for writing, just enough length as we need
+        unsigned short* pIdx = static_cast<unsigned short*>(
+            indexBuffer->lock(0, sizeof(unsigned short) * preCountIndexes, 
+			HardwareBuffer::HBL_DISCARD));
+        size_t numIndices = 0;
+
+        // Iterate over the groups and form renderables for each based on their
+        // lightFacing
+        si = shadowRenderables.begin();
+        egiend = edgeData->edgeGroups.end();
+        for (egi = edgeData->edgeGroups.begin(); egi != egiend; ++egi, ++si)
+        {
+            const EdgeData::EdgeGroup& eg = *egi;
+            // Initialise the index start for this shadow renderable
+            IndexData* indexData = (*si)->getRenderOperationForUpdate()->indexData;
+            indexData->indexStart = numIndices;
+            // original number of verts (without extruded copy)
+            size_t originalVertexCount = eg.vertexData->vertexCount;
+            bool  firstDarkCapTri = true;
+            unsigned short darkCapStart;
+
+            EdgeData::EdgeList::const_iterator i, iend;
+            iend = eg.edges.end();
+            for (i = eg.edges.begin(); i != iend; ++i)
+            {
+                const EdgeData::Edge& edge = *i;
+
+                // Silhouette edge, when two tris has opposite light facing, or
+                // degenerate edge where only tri 1 is valid and the tri light facing
+                char lightFacing = edgeData->triangleLightFacings[edge.triIndex[0]];
+                if ((edge.degenerate && lightFacing) ||
+                    (!edge.degenerate && (lightFacing != edgeData->triangleLightFacings[edge.triIndex[1]])))
+                {
+                    size_t v0 = edge.vertIndex[0];
+                    size_t v1 = edge.vertIndex[1];
+                    if (!lightFacing)
+                    {
+                        // Inverse edge indexes when t1 is light away
+                        std::swap(v0, v1);
+                    }
+
+                    /* Note edge(v0, v1) run anticlockwise along the edge from
+                    the light facing tri so to point shadow volume tris outward,
+                    light cap indexes have to be backwards
+
+                    We emit 2 tris if light is a point light, 1 if light 
+                    is directional, because directional lights cause all
+                    points to converge to a single point at infinity.
+
+                    First side tri = near1, near0, far0
+                    Second tri = far0, far1, near1
+
+                    'far' indexes are 'near' index + originalVertexCount
+                    because 'far' verts are in the second half of the 
+                    buffer
+                    */
+					assert(v1 < 65536 && v0 < 65536 && (v0 + originalVertexCount) < 65536 &&
+						"Vertex count exceeds 16-bit index limit!");
+                    *pIdx++ = static_cast<unsigned short>(v1);
+                    *pIdx++ = static_cast<unsigned short>(v0);
+                    *pIdx++ = static_cast<unsigned short>(v0 + originalVertexCount);
+                    numIndices += 3;
+
+                    // Are we extruding to infinity?
+                    if (!(lightType == Light::LT_DIRECTIONAL &&
+                        flags & SRF_EXTRUDE_TO_INFINITY))
+                    {
+                        // additional tri to make quad
+                        *pIdx++ = static_cast<unsigned short>(v0 + originalVertexCount);
+                        *pIdx++ = static_cast<unsigned short>(v1 + originalVertexCount);
+                        *pIdx++ = static_cast<unsigned short>(v1);
+                        numIndices += 3;
+                    }
+
+                    // Do dark cap tri
+                    // Use McGuire et al method, a triangle fan covering all silhouette
+                    // edges and one point (taken from the initial tri)
+                    if (flags & SRF_INCLUDE_DARK_CAP)
+                    {
+                        if (firstDarkCapTri)
+                        {
+                            darkCapStart = static_cast<unsigned short>(v0 + originalVertexCount);
+                            firstDarkCapTri = false;
+                        }
+                        else
+                        {
+                            *pIdx++ = darkCapStart;
+                            *pIdx++ = static_cast<unsigned short>(v1 + originalVertexCount);
+                            *pIdx++ = static_cast<unsigned short>(v0 + originalVertexCount);
+                            numIndices += 3;
+                        }
+
+                    }
+                }
+
+            }
+
+            // Do light cap
+            if (flags & SRF_INCLUDE_LIGHT_CAP) 
+            {
+                // separate light cap?
+                if ((*si)->isLightCapSeparate())
+                {
+                    // update index count for this shadow renderable
+                    indexData->indexCount = numIndices - indexData->indexStart;
+
+                    // get light cap index data for update
+                    indexData = (*si)->getLightCapRenderable()->getRenderOperationForUpdate()->indexData;
+                    // start indexes after the current total
+                    indexData->indexStart = numIndices;
+                }
+
+                // Iterate over the triangles which are using this vertex set
+                EdgeData::TriangleList::const_iterator ti, tiend;
+                EdgeData::TriangleLightFacingList::const_iterator lfi;
+                ti = edgeData->triangles.begin() + eg.triStart;
+                tiend = ti + eg.triCount;
+                lfi = edgeData->triangleLightFacings.begin() + eg.triStart;
+                for ( ; ti != tiend; ++ti, ++lfi)
+                {
+                    const EdgeData::Triangle& t = *ti;
+                    assert(t.vertexSet == eg.vertexSet);
+                    // Check it's light facing
+                    if (*lfi)
+                    {
+						assert(t.vertIndex[0] < 65536 && t.vertIndex[1] < 65536 &&
+							t.vertIndex[2] < 65536 && 
+							"16-bit index limit exceeded!");
+                        *pIdx++ = static_cast<unsigned short>(t.vertIndex[0]);
+                        *pIdx++ = static_cast<unsigned short>(t.vertIndex[1]);
+                        *pIdx++ = static_cast<unsigned short>(t.vertIndex[2]);
+                        numIndices += 3;
+                    }
+                }
+
+            }
+
+            // update index count for current index data (either this shadow renderable or its light cap)
+            indexData->indexCount = numIndices - indexData->indexStart;
+
+        }
+
+
+        // Unlock index buffer
+        indexBuffer->unlock();
+
+		// In debug mode, check we didn't overrun the index buffer
+		assert(numIndices <= indexBuffer->getNumIndexes() &&
+            "Index buffer overrun while generating shadow volume!! "
+			"You must increase the size of the shadow index buffer.");
+
+    }
+    // ------------------------------------------------------------------------
+    void ShadowCaster::extrudeVertices(
+        const HardwareVertexBufferSharedPtr& vertexBuffer, 
+        size_t originalVertexCount, const Vector4& light, Real extrudeDist)
+    {
+        assert (vertexBuffer->getVertexSize() == sizeof(float) * 3
+            && "Position buffer should contain only positions!");
+
+        // Extrude the first area of the buffer into the second area
+        // Lock the entire buffer for writing, even though we'll only be
+        // updating the latter because you can't have 2 locks on the same
+        // buffer
+        float* pSrc = static_cast<float*>(
+            vertexBuffer->lock(HardwareBuffer::HBL_NORMAL));
+
+        // TODO: We should add extra (ununsed) vertices ensure source and
+        // destination buffer have same alignment for slight performance gain.
+        float* pDest = pSrc + originalVertexCount * 3;
+
+        OptimisedUtil::getImplementation()->extrudeVertices(
+            light, extrudeDist,
+            pSrc, pDest, originalVertexCount);
+
+        vertexBuffer->unlock();
+
+    }
+    // ------------------------------------------------------------------------
+    void ShadowCaster::extrudeBounds(AxisAlignedBox& box, const Vector4& light, Real extrudeDist) const
+    {
+        Vector3 extrusionDir;
+
+        if (light.w == 0)
+        {
+            // Parallel projection guarantees min/max relationship remains the same
+            extrusionDir.x = -light.x;
+            extrusionDir.y = -light.y;
+            extrusionDir.z = -light.z;
+            extrusionDir.normalise();
+            extrusionDir *= extrudeDist;
+            box.setExtents(box.getMinimum() + extrusionDir, 
+                box.getMaximum() + extrusionDir);
+        }
+        else
+        {
+            Vector3 oldMin, oldMax, currentCorner;
+            // Getting the original values
+            oldMin = box.getMinimum();
+            oldMax = box.getMaximum();
+            // Starting the box again with a null content
+            box.setNull();
+            
+            // merging all the extruded corners
+
+            // 0 : min min min
+            currentCorner = oldMin;
+            extrusionDir.x = currentCorner.x - light.x;
+            extrusionDir.y = currentCorner.y - light.y;
+            extrusionDir.z = currentCorner.z - light.z;
+            extrusionDir.normalise();
+            extrusionDir *= extrudeDist;
+            box.merge(currentCorner + extrusionDir);
+
+            // 6 : min min max
+            // only z has changed
+            currentCorner.z = oldMax.z;
+            extrusionDir.z = currentCorner.z - light.z;
+            extrusionDir.normalise();
+            extrusionDir *= extrudeDist;
+            box.merge(currentCorner + extrusionDir);
+
+            // 5 : min max max
+            currentCorner.y = oldMax.y;
+            extrusionDir.y = currentCorner.y - light.y;
+            extrusionDir.normalise();
+            extrusionDir *= extrudeDist;
+            box.merge(currentCorner + extrusionDir);
+
+            // 1 : min max min
+            currentCorner.z = oldMin.z;
+            extrusionDir.z = currentCorner.z - light.z;
+            extrusionDir.normalise();
+            extrusionDir *= extrudeDist;
+            box.merge(currentCorner + extrusionDir);
+
+            // 2 : max max min
+            currentCorner.x = oldMax.x;
+            extrusionDir.x = currentCorner.x - light.x;
+            extrusionDir.normalise();
+            extrusionDir *= extrudeDist;
+            box.merge(currentCorner + extrusionDir);
+
+            // 4 : max max max
+            currentCorner.z = oldMax.z;
+            extrusionDir.z = currentCorner.z - light.z;
+            extrusionDir.normalise();
+            extrusionDir *= extrudeDist;
+            box.merge(currentCorner + extrusionDir);
+
+            // 7 : max min max
+            currentCorner.y = oldMin.y;
+            extrusionDir.y = currentCorner.y - light.y;
+            extrusionDir.normalise();
+            extrusionDir *= extrudeDist;
+            box.merge(currentCorner + extrusionDir);
+
+            // 3 : max min min
+            currentCorner.z = oldMin.z;
+            extrusionDir.z = currentCorner.z - light.z;
+            extrusionDir.normalise();
+            extrusionDir *= extrudeDist;
+            box.merge(currentCorner + extrusionDir);
+
+        }
+
+    }
+    // ------------------------------------------------------------------------
+    Real ShadowCaster::getExtrusionDistance(const Vector3& objectPos, const Light* light) const
+    {
+        Vector3 diff = objectPos - light->getDerivedPosition();
+        return light->getAttenuationRange() - diff.length();
+    }
+
+}
Index: /OgreMain/src/OgreShadowTextureManager.cpp
===================================================================
--- /OgreMain/src/OgreShadowTextureManager.cpp	(revision 5)
+++ /OgreMain/src/OgreShadowTextureManager.cpp	(revision 5)
@@ -0,0 +1,208 @@
+/*-------------------------------------------------------------------------
+This source file is a part of OGRE
+(Object-oriented Graphics Rendering Engine)
+
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License (LGPL) as 
+published by the Free Software Foundation; either version 2.1 of the 
+License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful, but 
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
+or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License 
+along with this library; if not, write to the Free Software Foundation, 
+Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA or go to
+http://www.gnu.org/copyleft/lesser.txt
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-------------------------------------------------------------------------*/
+#include "OgreStableHeaders.h"
+#include "OgreShadowTextureManager.h"
+#include "OgreResourceGroupManager.h"
+#include "OgreTextureManager.h"
+#include "OgreStringConverter.h"
+#include "OgreHardwarePixelBuffer.h"
+
+namespace Ogre
+{
+	//-----------------------------------------------------------------------
+	bool operator== ( const ShadowTextureConfig& lhs, const ShadowTextureConfig& rhs )
+	{
+		if ( lhs.width != rhs.width ||
+			lhs.height != rhs.height ||
+			lhs.format != rhs.format )
+		{
+			return false;
+		}
+
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	bool operator!= ( const ShadowTextureConfig& lhs, const ShadowTextureConfig& rhs )
+	{
+		return !( lhs == rhs );
+	}
+	//-----------------------------------------------------------------------
+	template<> ShadowTextureManager* Singleton<ShadowTextureManager>::ms_Singleton = 0;
+	ShadowTextureManager* ShadowTextureManager::getSingletonPtr(void)
+	{
+		return ms_Singleton;
+	}
+	ShadowTextureManager& ShadowTextureManager::getSingleton(void)
+	{
+		assert( ms_Singleton );  return ( *ms_Singleton );
+	}
+	//---------------------------------------------------------------------
+	ShadowTextureManager::ShadowTextureManager()
+		: mCount(0)
+	{
+
+	}
+	//---------------------------------------------------------------------
+	ShadowTextureManager::~ShadowTextureManager()
+	{
+		clear();
+	}
+	//---------------------------------------------------------------------
+	void ShadowTextureManager::getShadowTextures(const ShadowTextureConfigList& config, 
+		ShadowTextureList& listToPopulate)
+	{
+		listToPopulate.clear();
+
+		std::set<Texture*> usedTextures;
+
+		for (ShadowTextureConfigList::const_iterator c = config.begin(); c != config.end(); ++c)
+		{
+			const ShadowTextureConfig& config = *c;
+			bool found = false;
+			for (ShadowTextureList::iterator t = mTextureList.begin(); t != mTextureList.end(); ++t)
+			{
+				const TexturePtr& tex = *t;
+				// Skip if already used this one
+				if (usedTextures.find(tex.getPointer()) != usedTextures.end())
+					continue;
+
+				if (config.width == tex->getWidth() && config.height == tex->getHeight()
+					&& config.format == tex->getFormat())
+				{
+					// Ok, a match
+					listToPopulate.push_back(tex);
+					usedTextures.insert(tex.getPointer());
+					found = true;
+					break;
+				}
+			}
+			if (!found)
+			{
+				// Create a new texture
+				static const String baseName = "Ogre/ShadowTexture";
+				String targName = baseName + StringConverter::toString(mCount++);
+				TexturePtr shadowTex = TextureManager::getSingleton().createManual(
+					targName, 
+					ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME, 
+					TEX_TYPE_2D, config.width, config.height, 0, config.format, 
+					TU_RENDERTARGET);
+				// Ensure texture loaded
+				shadowTex->load();
+				listToPopulate.push_back(shadowTex);
+				usedTextures.insert(shadowTex.getPointer());
+				mTextureList.push_back(shadowTex);
+			}
+		}
+
+	}
+	//---------------------------------------------------------------------
+	TexturePtr ShadowTextureManager::getNullShadowTexture(PixelFormat format)
+	{
+		for (ShadowTextureList::iterator t = mNullTextureList.begin(); t != mNullTextureList.end(); ++t)
+		{
+			const TexturePtr& tex = *t;
+
+			if (format == tex->getFormat())
+			{
+				// Ok, a match
+				return tex;
+			}
+		}
+
+		// not found, create a new one
+		// A 1x1 texture of the correct format, not a render target
+		static const String baseName = "Ogre/ShadowTextureNull";
+		String targName = baseName + StringConverter::toString(mCount++);
+		TexturePtr shadowTex = TextureManager::getSingleton().createManual(
+			targName, 
+			ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME, 
+			TEX_TYPE_2D, 1, 1, 0, format);
+		mNullTextureList.push_back(shadowTex);
+
+		// lock & populate the texture based on format
+		shadowTex->getBuffer()->lock(HardwareBuffer::HBL_DISCARD);
+		const PixelBox& box = shadowTex->getBuffer()->getCurrentLock();
+
+		// set high-values across all bytes of the format
+		memset(box.data, 0xFFFF, PixelUtil::getNumElemBytes(format));
+
+		shadowTex->getBuffer()->unlock();
+
+		return shadowTex;
+	
+	}
+	//---------------------------------------------------------------------
+	void ShadowTextureManager::clearUnused()
+	{
+		for (ShadowTextureList::iterator i = mTextureList.begin(); i != mTextureList.end(); )
+		{
+			// Unreferenced if only this reference and the resource system
+			// Any cached shadow textures should be re-bound each frame dropping
+			// any old references
+			if ((*i).useCount() == ResourceGroupManager::RESOURCE_SYSTEM_NUM_REFERENCE_COUNTS + 1)
+			{
+				TextureManager::getSingleton().remove((*i)->getHandle());
+				i = mTextureList.erase(i);
+			}
+			else
+			{
+				++i;
+			}
+		}
+		for (ShadowTextureList::iterator i = mNullTextureList.begin(); i != mNullTextureList.end(); )
+		{
+			// Unreferenced if only this reference and the resource system
+			// Any cached shadow textures should be re-bound each frame dropping
+			// any old references
+			if ((*i).useCount() == ResourceGroupManager::RESOURCE_SYSTEM_NUM_REFERENCE_COUNTS + 1)
+			{
+				TextureManager::getSingleton().remove((*i)->getHandle());
+				i = mNullTextureList.erase(i);
+			}
+			else
+			{
+				++i;
+			}
+		}
+
+	}
+	//---------------------------------------------------------------------
+	void ShadowTextureManager::clear()
+	{
+		for (ShadowTextureList::iterator i = mTextureList.begin(); i != mTextureList.end(); ++i)
+		{
+			TextureManager::getSingleton().remove((*i)->getHandle());
+		}
+		mTextureList.clear();
+
+	}
+	//---------------------------------------------------------------------
+
+}
+
Index: /OgreMain/src/OgreShadowVolumeExtrudeProgram.cpp
===================================================================
--- /OgreMain/src/OgreShadowVolumeExtrudeProgram.cpp	(revision 5)
+++ /OgreMain/src/OgreShadowVolumeExtrudeProgram.cpp	(revision 5)
@@ -0,0 +1,563 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreStableHeaders.h"
+#include "OgreShadowVolumeExtrudeProgram.h"
+#include "OgreString.h"
+#include "OgreGpuProgramManager.h"
+#include "OgreGpuProgram.h"
+#include "OgreException.h"
+
+namespace Ogre {
+
+    // c4 is the light position/direction in these
+    String ShadowVolumeExtrudeProgram::mPointArbvp1 = 
+        "!!ARBvp1.0\n"
+        "PARAM c5 = { 0, 0, 0, 0 };\n"
+        "TEMP R0;\n"
+        "ATTRIB v24 = vertex.texcoord[0];\n"
+        "ATTRIB v16 = vertex.position;\n"
+        "PARAM c0[4] = { program.local[0..3] };\n"
+        "PARAM c4 = program.local[4];\n"
+        "ADD R0.xyz, v16.xyzx, -c4.xyzx;\n"
+        "MOV R0.w, c5.x;\n"
+        "MAD R0, v24.x, c4, R0;\n"
+        "DP4 result.position.x, c0[0], R0;\n"
+        "DP4 result.position.y, c0[1], R0;\n"
+        "DP4 result.position.z, c0[2], R0;\n"
+        "DP4 result.position.w, c0[3], R0;\n"
+        "END\n";
+
+    String ShadowVolumeExtrudeProgram::mPointVs_1_1 = 
+        "vs_1_1\n"
+        "def c5, 0, 0, 0, 0\n"
+        "dcl_texcoord0 v7\n"
+        "dcl_position v0\n"
+        "add r0.xyz, v0.xyz, -c4.xyz\n"
+        "mov r0.w, c5.x\n"
+        "mad r0, v7.x, c4, r0\n"
+        "dp4 oPos.x, c0, r0\n"
+        "dp4 oPos.y, c1, r0\n"
+        "dp4 oPos.z, c2, r0\n"
+        "dp4 oPos.w, c3, r0\n";
+
+    String ShadowVolumeExtrudeProgram::mDirArbvp1 = 
+        "!!ARBvp1.0\n"
+        "TEMP R0;\n"
+        "ATTRIB v24 = vertex.texcoord[0];\n"
+        "ATTRIB v16 = vertex.position;\n"
+        "PARAM c0[4] = { program.local[0..3] };\n"
+        "PARAM c4 = program.local[4];\n"
+        "ADD R0, v16, c4;\n"
+        "MAD R0, v24.x, R0, -c4;\n"
+        "DP4 result.position.x, c0[0], R0;\n"
+        "DP4 result.position.y, c0[1], R0;\n"
+        "DP4 result.position.z, c0[2], R0;\n"
+        "DP4 result.position.w, c0[3], R0;\n"
+        "END\n";
+
+    String ShadowVolumeExtrudeProgram::mDirVs_1_1 = 
+        "vs_1_1\n"
+        "dcl_texcoord0 v7\n"
+        "dcl_position v0\n"
+        "add r0, v0, c4\n"
+        "mad r0, v7.x, r0, -c4\n"
+        "dp4 oPos.x, c0, r0\n"
+        "dp4 oPos.y, c1, r0\n"
+        "dp4 oPos.z, c2, r0\n"
+        "dp4 oPos.w, c3, r0\n";
+
+
+    String ShadowVolumeExtrudeProgram::mPointArbvp1Debug = 
+        "!!ARBvp1.0\n"
+        "PARAM c5 = { 0, 0, 0, 0 };\n"
+        "PARAM c6 = { 1, 1, 1, 1 };\n"
+        "TEMP R0;\n"
+        "ATTRIB v24 = vertex.texcoord[0];\n"
+        "ATTRIB v16 = vertex.position;\n"
+        "PARAM c0[4] = { program.local[0..3] };\n"
+        "PARAM c4 = program.local[4];\n"
+        "ADD R0.xyz, v16.xyzx, -c4.xyzx;\n"
+        "MOV R0.w, c5.x;\n"
+        "MAD R0, v24.x, c4, R0;\n"
+        "DP4 result.position.x, c0[0], R0;\n"
+        "DP4 result.position.y, c0[1], R0;\n"
+        "DP4 result.position.z, c0[2], R0;\n"
+        "DP4 result.position.w, c0[3], R0;\n"
+        "MOV result.color.front.primary, c6.x;\n"
+        "END\n";
+
+    String ShadowVolumeExtrudeProgram::mPointVs_1_1Debug = 
+        "vs_1_1\n"
+        "def c5, 0, 0, 0, 0\n"
+        "def c6, 1, 1, 1, 1\n"
+        "dcl_texcoord0 v7\n"
+        "dcl_position v0\n"
+        "add r0.xyz, v0.xyz, -c4.xyz\n"
+        "mov r0.w, c5.x\n"
+        "mad r0, v7.x, c4, r0\n"
+        "dp4 oPos.x, c0, r0\n"
+        "dp4 oPos.y, c1, r0\n"
+        "dp4 oPos.z, c2, r0\n"
+        "dp4 oPos.w, c3, r0\n"
+        "mov oD0, c6.x\n";
+
+    String ShadowVolumeExtrudeProgram::mDirArbvp1Debug = 
+        "!!ARBvp1.0\n"
+        "PARAM c5 = { 1, 1, 1, 1};\n"
+        "TEMP R0;\n"
+        "ATTRIB v24 = vertex.texcoord[0];\n"
+        "ATTRIB v16 = vertex.position;\n"
+        "PARAM c0[4] = { program.local[0..3] };\n"
+        "PARAM c4 = program.local[4];\n"
+        "ADD R0, v16, c4;\n"
+        "MAD R0, v24.x, R0, -c4;\n"
+        "DP4 result.position.x, c0[0], R0;\n"
+        "DP4 result.position.y, c0[1], R0;\n"
+        "DP4 result.position.z, c0[2], R0;\n"
+        "DP4 result.position.w, c0[3], R0;\n"
+        "MOV result.color.front.primary, c5.x;"
+        "END\n";
+
+    String ShadowVolumeExtrudeProgram::mDirVs_1_1Debug = 
+        "vs_1_1\n"
+        "def c5, 1, 1, 1, 1\n"
+        "dcl_texcoord0 v7\n"
+        "dcl_position v0\n"
+        "add r0, v0, c4\n"
+        "mad r0, v7.x, r0, -c4\n"
+        "dp4 oPos.x, c0, r0\n"
+        "dp4 oPos.y, c1, r0\n"
+        "dp4 oPos.z, c2, r0\n"
+        "dp4 oPos.w, c3, r0\n"
+        "mov oD0, c5.x\n";
+
+
+    // c4 is the light position/direction in these
+    // c5 is extrusion distance
+    String ShadowVolumeExtrudeProgram::mPointArbvp1Finite = 
+        "!!ARBvp1.0\n" 
+        "PARAM c6 = { 1, 0, 0, 0 };\n"
+        "TEMP R0;\n"
+        "ATTRIB v24 = vertex.texcoord[0];\n"
+        "ATTRIB v16 = vertex.position;\n"
+        "PARAM c0[4] = { program.local[0..3] };\n"
+        "PARAM c5 = program.local[5];\n"
+        "PARAM c4 = program.local[4];\n"
+        "ADD R0.x, c6.x, -v24.x;\n"
+        "MUL R0.w, R0.x, c5.x;\n"
+        "ADD R0.xyz, v16.xyzx, -c4.xyzx;\n"
+        "MAD R0.xyz, R0.w, R0.xyzx, v16.xyzx;\n"
+        "DPH result.position.x, R0.xyzz, c0[0];\n"
+        "DPH result.position.y, R0.xyzz, c0[1];\n"
+        "DPH result.position.z, R0.xyzz, c0[2];\n"
+        "DPH result.position.w, R0.xyzz, c0[3];\n"
+        "END\n";
+
+    String ShadowVolumeExtrudeProgram::mPointVs_1_1Finite = 
+        "vs_1_1\n"
+        "def c6, 1, 0, 0, 0\n"
+        "dcl_texcoord0 v7\n"
+        "dcl_position v0\n"
+        "add r0.x, c6.x, -v7.x\n"
+        "mul r1.x, r0.x, c5.x\n"
+        "add r0.yzw, v0.xxyz, -c4.xxyz\n"
+        "dp3 r0.x, r0.yzw, r0.yzw\n"
+        "rsq r0.x, r0.x\n"
+        "mul r0.xyz, r0.x, r0.yzw\n"
+        "mad r0.xyz, r1.x, r0.xyz, v0.xyz\n"
+        "mov r0.w, c6.x\n"
+        "dp4 oPos.x, c0, r0\n"
+        "dp4 oPos.y, c1, r0\n"
+        "dp4 oPos.z, c2, r0\n"
+        "dp4 oPos.w, c3, r0\n";
+    String ShadowVolumeExtrudeProgram::mDirArbvp1Finite = 
+        "!!ARBvp1.0\n"
+        "PARAM c6 = { 1, 0, 0, 0 };\n"
+        "TEMP R0;\n"
+        "ATTRIB v24 = vertex.texcoord[0];\n"
+        "ATTRIB v16 = vertex.position;\n"
+        "PARAM c0[4] = { program.local[0..3] };\n"
+        "PARAM c4 = program.local[4];\n"
+        "PARAM c5 = program.local[5];\n"
+        "ADD R0.x, c6.x, -v24.x;\n"
+        "MUL R0.x, R0.x, c5.x;\n"
+        "MAD R0.xyz, -R0.x, c4.xyzx, v16.xyzx;\n"
+        "DPH result.position.x, R0.xyzz, c0[0];\n"
+        "DPH result.position.y, R0.xyzz, c0[1];\n"
+        "DPH result.position.z, R0.xyzz, c0[2];\n"
+        "DPH result.position.w, R0.xyzz, c0[3];\n"
+        "END\n";
+    String ShadowVolumeExtrudeProgram::mDirVs_1_1Finite = 
+        "vs_1_1\n"
+        "def c6, 1, 0, 0, 0\n"
+        "dcl_texcoord0 v7\n"
+        "dcl_position v0\n"
+        "add r0.x, c6.x, -v7.x\n"
+        "mul r0.x, r0.x, c5.x\n"
+        "mad r0.xyz, -r0.x, c4.xyz, v0.xyz\n"
+        "mov r0.w, c6.x\n"
+        "dp4 oPos.x, c0, r0\n"
+        "dp4 oPos.y, c1, r0\n"
+        "dp4 oPos.z, c2, r0\n"
+        "dp4 oPos.w, c3, r0\n";
+    String ShadowVolumeExtrudeProgram::mPointArbvp1FiniteDebug = 
+        "!!ARBvp1.0\n"
+        "PARAM c6 = { 1, 0, 0, 0 };\n"
+        "TEMP R0, R1;\n"
+        "ATTRIB v24 = vertex.texcoord[0];\n"
+        "ATTRIB v16 = vertex.position;\n"
+        "PARAM c0[4] = { program.local[0..3] };\n"
+        "PARAM c5 = program.local[5];\n"
+        "PARAM c4 = program.local[4];\n"
+        "MOV result.color.front.primary, c6.x;\n"
+        "ADD R0.x, c6.x, -v24.x;\n"
+        "MUL R1.x, R0.x, c5.x;\n"
+        "ADD R0.yzw, v16.xxyz, -c4.xxyz;\n"
+        "DP3 R0.x, R0.yzwy, R0.yzwy;\n"
+        "RSQ R0.x, R0.x;\n"
+        "MUL R0.xyz, R0.x, R0.yzwy;\n"
+        "MAD R0.xyz, R1.x, R0.xyzx, v16.xyzx;\n"
+        "DPH result.position.x, R0.xyzz, c0[0];\n"
+        "DPH result.position.y, R0.xyzz, c0[1];\n"
+        "DPH result.position.z, R0.xyzz, c0[2];\n"
+        "DPH result.position.w, R0.xyzz, c0[3];\n"
+        "END\n";
+    String ShadowVolumeExtrudeProgram::mPointVs_1_1FiniteDebug = 
+        "vs_1_1\n"
+        "def c6, 1, 0, 0, 0\n"
+        "dcl_texcoord0 v7\n"
+        "dcl_position v0\n"
+        "mov oD0, c6.x\n"
+        "add r0.x, c6.x, -v7.x\n"
+        "mul r1.x, r0.x, c5.x\n"
+        "add r0.yzw, v0.xxyz, -c4.xxyz\n"
+        "dp3 r0.x, r0.yzw, r0.yzw\n"
+        "rsq r0.x, r0.x\n"
+        "mul r0.xyz, r0.x, r0.yzw\n"
+        "mad r0.xyz, r1.x, r0.xyz, v0.xyz\n"
+        "mov r0.w, c6.x\n"
+        "dp4 oPos.x, c0, r0\n"
+        "dp4 oPos.y, c1, r0\n"
+        "dp4 oPos.z, c2, r0\n"
+        "dp4 oPos.w, c3, r0\n";
+    String ShadowVolumeExtrudeProgram::mDirArbvp1FiniteDebug = 
+        "!!ARBvp1.0\n"
+        "PARAM c6 = { 1, 0, 0, 0 };\n"
+        "TEMP R0;\n"
+        "ATTRIB v24 = vertex.texcoord[0];\n"
+        "ATTRIB v16 = vertex.position;\n"
+        "PARAM c0[4] = { program.local[0..3] };\n"
+        "PARAM c4 = program.local[4];\n"
+        "PARAM c5 = program.local[5];\n"
+        "MOV result.color.front.primary, c6.x;\n"
+        "ADD R0.x, c6.x, -v24.x;\n"
+        "MUL R0.x, R0.x, c5.x;\n"
+        "MAD R0.xyz, -R0.x, c4.xyzx, v16.xyzx;\n"
+        "DPH result.position.x, R0.xyzz, c0[0];\n"
+        "DPH result.position.y, R0.xyzz, c0[1];\n"
+        "DPH result.position.z, R0.xyzz, c0[2];\n"
+        "DPH result.position.w, R0.xyzz, c0[3];\n"
+        "END\n";
+    String ShadowVolumeExtrudeProgram::mDirVs_1_1FiniteDebug = 
+        "vs_1_1\n"
+        "def c6, 1, 0, 0, 0\n"
+        "dcl_texcoord0 v7\n"
+        "dcl_position v0\n"
+        "mov oD0, c6.x\n"
+        "add r0.x, c6.x, -v7.x\n"
+        "mul r0.x, r0.x, c5.x\n"
+        "mad r0.xyz, -r0.x, c4.xyz, v0.xyz\n"
+        "mov r0.w, c6.x\n"
+        "dp4 oPos.x, c0, r0\n"
+        "dp4 oPos.y, c1, r0\n"
+        "dp4 oPos.z, c2, r0\n"
+        "dp4 oPos.w, c3, r0\n";
+
+
+    const String ShadowVolumeExtrudeProgram::programNames[OGRE_NUM_SHADOW_EXTRUDER_PROGRAMS] = 
+    {
+        "Ogre/ShadowExtrudePointLight",
+            "Ogre/ShadowExtrudePointLightDebug",
+            "Ogre/ShadowExtrudeDirLight",
+            "Ogre/ShadowExtrudeDirLightDebug",
+            "Ogre/ShadowExtrudePointLightFinite",
+            "Ogre/ShadowExtrudePointLightFiniteDebug",
+            "Ogre/ShadowExtrudeDirLightFinite",
+            "Ogre/ShadowExtrudeDirLightFiniteDebug"
+    };
+
+	bool ShadowVolumeExtrudeProgram::mInitialised = false;
+    //---------------------------------------------------------------------
+    //---------------------------------------------------------------------
+    void ShadowVolumeExtrudeProgram::initialise(void)
+    {
+		if (!mInitialised)
+		{
+			String syntax;
+			bool vertexProgramFinite[8] = 
+			{
+				false, false, false, false, 
+					true, true, true, true
+			};
+			bool vertexProgramDebug[8] = 
+			{
+				false, true, false, true, 
+					false, true, false, true
+			};
+			Light::LightTypes vertexProgramLightTypes[8] = 
+			{
+				Light::LT_POINT, Light::LT_POINT, 
+					Light::LT_DIRECTIONAL, Light::LT_DIRECTIONAL, 
+					Light::LT_POINT, Light::LT_POINT, 
+					Light::LT_DIRECTIONAL, Light::LT_DIRECTIONAL 
+			};
+
+			// load hardware extrusion programs for point & dir lights
+			if (GpuProgramManager::getSingleton().isSyntaxSupported("arbvp1"))
+			{
+				// ARBvp1
+				syntax = "arbvp1";
+			}
+			else if (GpuProgramManager::getSingleton().isSyntaxSupported("vs_1_1"))
+			{
+				syntax = "vs_1_1";
+			}
+			else
+			{
+				OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+					"Vertex programs are supposedly supported, but neither "
+					"arbvp1 nor vs_1_1 syntaxes are present.", 
+					"SceneManager::initShadowVolumeMaterials");
+			}
+			// Create all programs
+			for (unsigned short v = 0; v < OGRE_NUM_SHADOW_EXTRUDER_PROGRAMS; ++v)
+			{
+				// Create debug extruders
+				if (GpuProgramManager::getSingleton().getByName(
+					programNames[v]).isNull())
+				{
+					GpuProgramPtr vp = 
+						GpuProgramManager::getSingleton().createProgramFromString(
+						programNames[v], ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME,
+						ShadowVolumeExtrudeProgram::getProgramSource(
+						vertexProgramLightTypes[v], syntax, 
+						vertexProgramFinite[v], vertexProgramDebug[v]),
+						GPT_VERTEX_PROGRAM, syntax);
+					vp->load();
+				}
+			}
+			mInitialised = true;
+		}
+    }
+    //---------------------------------------------------------------------
+    void ShadowVolumeExtrudeProgram::shutdown(void)
+    {
+        if (mInitialised)
+        {
+            for (unsigned short v = 0; v < OGRE_NUM_SHADOW_EXTRUDER_PROGRAMS; ++v)
+            {
+                // Destroy debug extruders
+                GpuProgramManager::getSingleton().remove(programNames[v]);
+            }
+            mInitialised = false;
+        }
+    }
+    //---------------------------------------------------------------------
+    const String& ShadowVolumeExtrudeProgram::getProgramSource(
+        Light::LightTypes lightType, const String syntax, bool finite, bool debug)
+    {
+        if (lightType == Light::LT_DIRECTIONAL)
+        {
+            if (syntax == "arbvp1")
+            {
+                if (finite)
+                {
+                    if (debug)
+                    {
+                        return getDirectionalLightExtruderArbvp1FiniteDebug();
+                    }
+                    else
+                    {
+                        return getDirectionalLightExtruderArbvp1Finite();
+                    }
+                }
+                else
+                {
+                    if (debug)
+                    {
+                        return getDirectionalLightExtruderArbvp1Debug();
+                    }
+                    else
+                    {
+                        return getDirectionalLightExtruderArbvp1();
+                    }
+                }
+            }
+            else
+            {
+                if (finite)
+                {
+                    if (debug)
+                    {
+                        return getDirectionalLightExtruderVs_1_1FiniteDebug();
+                    }
+                    else
+                    {
+                        return getDirectionalLightExtruderVs_1_1Finite();
+                    }
+                }
+                else
+                {
+                    if (debug)
+                    {
+                        return getDirectionalLightExtruderVs_1_1Debug();
+                    }
+                    else
+                    {
+                        return getDirectionalLightExtruderVs_1_1();
+                    }
+                }
+            }
+        }
+        else
+        {
+            if (syntax == "arbvp1")
+            {
+                if (finite)
+                {
+                    if (debug)
+                    {
+                        return getPointLightExtruderArbvp1FiniteDebug();
+                    }
+                    else
+                    {
+                        return getPointLightExtruderArbvp1Finite();
+                    }
+                }
+                else
+                {
+                    if (debug)
+                    {
+                        return getPointLightExtruderArbvp1Debug();
+                    }
+                    else
+                    {
+                        return getPointLightExtruderArbvp1();
+                    }
+                }
+            }
+            else
+            {
+                if (finite)
+                {
+                    if (debug)
+                    {
+                        return getPointLightExtruderVs_1_1FiniteDebug();
+                    }
+                    else
+                    {
+                        return getPointLightExtruderVs_1_1Finite();
+                    }
+                }
+                else
+                {
+                    if (debug)
+                    {
+                        return getPointLightExtruderVs_1_1Debug();
+                    }
+                    else
+                    {
+                        return getPointLightExtruderVs_1_1();
+                    }
+                }
+            }
+        }
+        // to keep compiler happy
+        return StringUtil::BLANK;
+    }
+    //---------------------------------------------------------------------
+    const String& ShadowVolumeExtrudeProgram::getProgramName(
+        Light::LightTypes lightType, bool finite, bool debug)
+    {
+        if (lightType == Light::LT_DIRECTIONAL)
+        {
+            if (finite)
+            {
+                if (debug)
+                {
+                    return programNames[DIRECTIONAL_LIGHT_FINITE_DEBUG];
+                }
+                else
+                {
+                    return programNames[DIRECTIONAL_LIGHT_FINITE];
+                }
+            }
+            else
+            {
+                if (debug)
+                {
+                    return programNames[DIRECTIONAL_LIGHT_DEBUG];
+                }
+                else
+                {
+                    return programNames[DIRECTIONAL_LIGHT];
+                }
+            }
+        }
+        else
+        {
+            if (finite)
+            {
+                if (debug)
+                {
+                    return programNames[POINT_LIGHT_FINITE_DEBUG];
+                }
+                else
+                {
+                    return programNames[POINT_LIGHT_FINITE];
+                }
+            }
+            else
+            {
+                if (debug)
+                {
+                    return programNames[POINT_LIGHT_DEBUG];
+                }
+                else
+                {
+                    return programNames[POINT_LIGHT];
+                }
+            }
+        }
+    }
+
+
+
+}
Index: /OgreMain/src/OgreSimpleRenderable.cpp
===================================================================
--- /OgreMain/src/OgreSimpleRenderable.cpp	(revision 5)
+++ /OgreMain/src/OgreSimpleRenderable.cpp	(revision 5)
@@ -0,0 +1,143 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreSimpleRenderable.h"
+#include "OgreException.h"
+#include "OgreSceneNode.h"
+
+#include "OgreMaterialManager.h"
+
+namespace Ogre {
+
+    uint SimpleRenderable::ms_uGenNameCount = 0;
+
+    SimpleRenderable::SimpleRenderable()
+    {
+        m_matWorldTransform = Matrix4::IDENTITY;
+
+        m_strMatName = "BaseWhite"; 
+        m_pMaterial = MaterialManager::getSingleton().getByName("BaseWhite");
+
+        m_pParentSceneManager = NULL;
+
+        mParentNode = NULL;
+        m_pCamera = NULL;
+
+        // Generate name
+		StringUtil::StrStreamType name;
+		name << "SimpleRenderable" << ms_uGenNameCount++;
+		mName = name.str();
+    }
+
+    void SimpleRenderable::setMaterial( const String& matName )
+    {
+        m_strMatName = matName;
+        m_pMaterial = MaterialManager::getSingleton().getByName(m_strMatName);
+		if (m_pMaterial.isNull())
+			OGRE_EXCEPT( Exception::ERR_ITEM_NOT_FOUND, "Could not find material " + m_strMatName,
+				"SimpleRenderable::setMaterial" );
+    
+        // Won't load twice anyway
+        m_pMaterial->load();
+    }
+
+    const MaterialPtr& SimpleRenderable::getMaterial(void) const
+    {
+        return m_pMaterial;
+    }
+
+    void SimpleRenderable::getRenderOperation(RenderOperation& op)
+    {
+        op = mRenderOp;
+    }
+
+    void SimpleRenderable::setRenderOperation( const RenderOperation& rend )
+    {
+        mRenderOp = rend;
+    }
+
+    void SimpleRenderable::setWorldTransform( const Matrix4& xform )
+    {
+        m_matWorldTransform = xform;
+    }
+
+    void SimpleRenderable::getWorldTransforms( Matrix4* xform ) const
+    {
+        *xform = m_matWorldTransform * mParentNode->_getFullTransform();
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& SimpleRenderable::getWorldOrientation(void) const
+    {
+        return mParentNode->_getDerivedOrientation();
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& SimpleRenderable::getWorldPosition(void) const
+    {
+        return mParentNode->_getDerivedPosition();
+    }
+
+    void SimpleRenderable::_notifyCurrentCamera(Camera* cam)
+    {
+		MovableObject::_notifyCurrentCamera(cam);
+
+        m_pCamera = cam;
+    }
+
+    void SimpleRenderable::setBoundingBox( const AxisAlignedBox& box )
+    {
+        mBox = box;
+    }
+
+    const AxisAlignedBox& SimpleRenderable::getBoundingBox(void) const
+    {
+        return mBox;
+    }
+
+    void SimpleRenderable::_updateRenderQueue(RenderQueue* queue)
+    {
+        queue->addRenderable( this, mRenderQueueID, OGRE_RENDERABLE_DEFAULT_PRIORITY); 
+    }
+
+    SimpleRenderable::~SimpleRenderable()
+    {
+    }
+    //-----------------------------------------------------------------------
+    const String& SimpleRenderable::getMovableType(void) const
+    {
+        static String movType = "SimpleRenderable";
+        return movType;
+    }
+    //-----------------------------------------------------------------------
+    const LightList& SimpleRenderable::getLights(void) const
+    {
+        // Use movable query lights
+        return queryLights();
+    }
+
+}
Index: /OgreMain/src/OgreSimpleSpline.cpp
===================================================================
--- /OgreMain/src/OgreSimpleSpline.cpp	(revision 5)
+++ /OgreMain/src/OgreSimpleSpline.cpp	(revision 5)
@@ -0,0 +1,271 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreSimpleSpline.h"
+#include "OgreVector4.h"
+#include "OgreMatrix4.h"
+
+
+
+namespace Ogre {
+
+    //---------------------------------------------------------------------
+    SimpleSpline::SimpleSpline()
+    {
+        // Set up matrix
+        // Hermite polynomial
+        mCoeffs[0][0] = 2;
+        mCoeffs[0][1] = -2;
+        mCoeffs[0][2] = 1;
+        mCoeffs[0][3] = 1;
+        mCoeffs[1][0] = -3;
+        mCoeffs[1][1] = 3;
+        mCoeffs[1][2] = -2;
+        mCoeffs[1][3] = -1;
+        mCoeffs[2][0] = 0;
+        mCoeffs[2][1] = 0;
+        mCoeffs[2][2] = 1;
+        mCoeffs[2][3] = 0;
+        mCoeffs[3][0] = 1;
+        mCoeffs[3][1] = 0;
+        mCoeffs[3][2] = 0;
+        mCoeffs[3][3] = 0;
+
+        mAutoCalc = true;
+    }
+    //---------------------------------------------------------------------
+    SimpleSpline::~SimpleSpline()
+    {
+    }
+    //---------------------------------------------------------------------
+    void SimpleSpline::addPoint(const Vector3& p)
+    {
+        mPoints.push_back(p);
+        if (mAutoCalc)
+        {
+            recalcTangents();
+        }
+    }
+    //---------------------------------------------------------------------
+    Vector3 SimpleSpline::interpolate(Real t)
+    {
+        // Currently assumes points are evenly spaced, will cause velocity
+        // change where this is not the case
+        // TODO: base on arclength?
+
+        
+        // Work out which segment this is in
+        Real fSeg = t * (mPoints.size() - 1);
+        unsigned int segIdx = (unsigned int)fSeg;
+        // Apportion t 
+        t = fSeg - segIdx;
+
+        return interpolate(segIdx, t);
+
+    }
+    //---------------------------------------------------------------------
+    Vector3 SimpleSpline::interpolate(unsigned int fromIndex, Real t)
+    {
+        // Bounds check
+        assert (fromIndex < mPoints.size() &&
+            "fromIndex out of bounds");
+
+        if ((fromIndex + 1) == mPoints.size())
+        {
+            // Duff request, cannot blend to nothing
+            // Just return source
+            return mPoints[fromIndex];
+
+        }
+
+        // Fast special cases
+        if (t == 0.0f)
+        {
+            return mPoints[fromIndex];
+        }
+        else if(t == 1.0f)
+        {
+            return mPoints[fromIndex + 1];
+        }
+
+        // Real interpolation
+        // Form a vector of powers of t
+        Real t2, t3;
+        t2 = t * t;
+        t3 = t2 * t;
+        Vector4 powers(t3, t2, t, 1);
+
+
+        // Algorithm is ret = powers * mCoeffs * Matrix4(point1, point2, tangent1, tangent2)
+        Vector3& point1 = mPoints[fromIndex];
+        Vector3& point2 = mPoints[fromIndex+1];
+        Vector3& tan1 = mTangents[fromIndex];
+        Vector3& tan2 = mTangents[fromIndex+1];
+        Matrix4 pt;
+
+        pt[0][0] = point1.x;
+        pt[0][1] = point1.y;
+        pt[0][2] = point1.z;
+        pt[0][3] = 1.0f;
+        pt[1][0] = point2.x;
+        pt[1][1] = point2.y;
+        pt[1][2] = point2.z;
+        pt[1][3] = 1.0f;
+        pt[2][0] = tan1.x;
+        pt[2][1] = tan1.y;
+        pt[2][2] = tan1.z;
+        pt[2][3] = 1.0f;
+        pt[3][0] = tan2.x;
+        pt[3][1] = tan2.y;
+        pt[3][2] = tan2.z;
+        pt[3][3] = 1.0f;
+
+        Vector4 ret = powers * mCoeffs * pt;
+
+
+        return Vector3(ret.x, ret.y, ret.z);
+
+
+
+
+    }
+    //---------------------------------------------------------------------
+    void SimpleSpline::recalcTangents(void)
+    {
+        // Catmull-Rom approach
+        // 
+        // tangent[i] = 0.5 * (point[i+1] - point[i-1])
+        //
+        // Assume endpoint tangents are parallel with line with neighbour
+
+        size_t i, numPoints;
+        bool isClosed;
+
+        numPoints = mPoints.size();
+        if (numPoints < 2)
+        {
+            // Can't do anything yet
+            return;
+        }
+
+        // Closed or open?
+        if (mPoints[0] == mPoints[numPoints-1])
+        {
+            isClosed = true;
+        }
+        else
+        {
+            isClosed = false;
+        }
+
+        mTangents.resize(numPoints);
+
+
+
+        for(i = 0; i < numPoints; ++i)
+        {
+            if (i ==0)
+            {
+                // Special case start
+                if (isClosed)
+                {
+                    // Use numPoints-2 since numPoints-1 is the last point and == [0]
+                    mTangents[i] = 0.5 * (mPoints[1] - mPoints[numPoints-2]);
+                }
+                else
+                {
+                    mTangents[i] = 0.5 * (mPoints[1] - mPoints[0]);
+                }
+            }
+            else if (i == numPoints-1)
+            {
+                // Special case end
+                if (isClosed)
+                {
+                    // Use same tangent as already calculated for [0]
+                    mTangents[i] = mTangents[0];
+                }
+                else
+                {
+                    mTangents[i] = 0.5 * (mPoints[i] - mPoints[i-1]);
+                }
+            }
+            else
+            {
+                mTangents[i] = 0.5 * (mPoints[i+1] - mPoints[i-1]);
+            }
+            
+        }
+
+
+
+    }
+    //---------------------------------------------------------------------
+    const Vector3& SimpleSpline::getPoint(unsigned short index) const
+    {
+        assert (index < mPoints.size() && "Point index is out of bounds!!");
+
+        return mPoints[index];
+    }
+    //---------------------------------------------------------------------
+    unsigned short SimpleSpline::getNumPoints(void) const
+    {
+        return (unsigned short)mPoints.size();
+    }
+    //---------------------------------------------------------------------
+    void SimpleSpline::clear(void)
+    {
+        mPoints.clear();
+        mTangents.clear();
+    }
+    //---------------------------------------------------------------------
+    void SimpleSpline::updatePoint(unsigned short index, const Vector3& value)
+    {
+        assert (index < mPoints.size() && "Point index is out of bounds!!");
+
+        mPoints[index] = value;
+        if (mAutoCalc)
+        {
+            recalcTangents();
+        }
+    }
+    //---------------------------------------------------------------------
+    void SimpleSpline::setAutoCalculate(bool autoCalc)
+    {
+        mAutoCalc = autoCalc;
+    }
+
+
+
+
+}
+
+
+
+
Index: /OgreMain/src/OgreSkeleton.cpp
===================================================================
--- /OgreMain/src/OgreSkeleton.cpp	(revision 5)
+++ /OgreMain/src/OgreSkeleton.cpp	(revision 5)
@@ -0,0 +1,1024 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreSkeleton.h"
+#include "OgreBone.h"
+#include "OgreAnimation.h"
+#include "OgreAnimationState.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreSkeletonManager.h"
+#include "OgreSkeletonSerializer.h"
+#include "OgreStringConverter.h"
+// Just for logging
+#include "OgreAnimationTrack.h"
+#include "OgreKeyFrame.h"
+
+
+namespace Ogre {
+
+    //---------------------------------------------------------------------
+	Skeleton::Skeleton()
+		: Resource(),
+        mBlendState(ANIMBLEND_AVERAGE),
+		mNextAutoHandle(0),
+		mManualBonesDirty(false)
+	{
+	}
+	//---------------------------------------------------------------------
+    Skeleton::Skeleton(ResourceManager* creator, const String& name, ResourceHandle handle,
+        const String& group, bool isManual, ManualResourceLoader* loader) 
+        : Resource(creator, name, handle, group, isManual, loader), 
+        mBlendState(ANIMBLEND_AVERAGE), mNextAutoHandle(0)
+        // set animation blending to weighted, not cumulative
+    {
+        if (createParamDictionary("Skeleton"))
+        {
+            // no custom params
+        }
+    }
+    //---------------------------------------------------------------------
+    Skeleton::~Skeleton()
+    {
+        // have to call this here reather than in Resource destructor
+        // since calling virtual methods in base destructors causes crash
+        unload(); 
+    }
+    //---------------------------------------------------------------------
+    void Skeleton::loadImpl(void)
+    {
+        SkeletonSerializer serializer;
+		StringUtil::StrStreamType msg;
+		msg << "Skeleton: Loading " << mName;
+        LogManager::getSingleton().logMessage(msg.str());
+
+        DataStreamPtr stream = 
+            ResourceGroupManager::getSingleton().openResource(
+				mName, mGroup, true, this);
+
+        serializer.importSkeleton(stream, this);
+
+		// Load any linked skeletons
+		LinkedSkeletonAnimSourceList::iterator i;
+		for (i = mLinkedSkeletonAnimSourceList.begin(); 
+			i != mLinkedSkeletonAnimSourceList.end(); ++i)
+		{
+			i->pSkeleton = SkeletonManager::getSingleton().load(
+				i->skeletonName, mGroup);
+		}
+
+
+    }
+    //---------------------------------------------------------------------
+    void Skeleton::unloadImpl(void)
+    {
+        // destroy bones
+        BoneList::iterator i;
+        for (i = mBoneList.begin(); i != mBoneList.end(); ++i)
+        {
+            delete *i;
+        }
+        mBoneList.clear();
+        mBoneListByName.clear();
+		mRootBones.clear();
+        mManualBones.clear();
+        mManualBonesDirty = false;
+
+        // Destroy animations
+        AnimationList::iterator ai;
+        for (ai = mAnimationsList.begin(); ai != mAnimationsList.end(); ++ai)
+        {
+            delete ai->second;
+        }
+        mAnimationsList.clear();
+
+        // Remove all linked skeletons
+        mLinkedSkeletonAnimSourceList.clear();
+    }
+    //---------------------------------------------------------------------
+    Bone* Skeleton::createBone(void)
+    {
+        // use autohandle
+        return createBone(mNextAutoHandle++);
+    }
+    //---------------------------------------------------------------------
+    Bone* Skeleton::createBone(const String& name)
+    {
+        return createBone(name, mNextAutoHandle++);
+    }
+    //---------------------------------------------------------------------
+    Bone* Skeleton::createBone(unsigned short handle)
+    {
+        if (handle >= OGRE_MAX_NUM_BONES)
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Exceeded the maximum number of bones per skeleton.",
+                "Skeleton::createBone");
+        }
+        // Check handle not used
+        if (handle < mBoneList.size() && mBoneList[handle] != NULL)
+        {
+            OGRE_EXCEPT(
+                Exception::ERR_DUPLICATE_ITEM,
+                "A bone with the handle " + StringConverter::toString(handle) + " already exists",
+                "Skeleton::createBone" );
+        }
+        Bone* ret = new Bone(handle, this);
+        assert(mBoneListByName.find(ret->getName()) == mBoneListByName.end());
+        if (mBoneList.size() <= handle)
+        {
+            mBoneList.resize(handle+1);
+        }
+        mBoneList[handle] = ret;
+        mBoneListByName[ret->getName()] = ret;
+        return ret;
+
+    }
+    //---------------------------------------------------------------------
+    Bone* Skeleton::createBone(const String& name, unsigned short handle)
+    {
+        if (handle >= OGRE_MAX_NUM_BONES)
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Exceeded the maximum number of bones per skeleton.",
+                "Skeleton::createBone");
+        }
+        // Check handle not used
+        if (handle < mBoneList.size() && mBoneList[handle] != NULL)
+        {
+            OGRE_EXCEPT(
+                Exception::ERR_DUPLICATE_ITEM,
+                "A bone with the handle " + StringConverter::toString(handle) + " already exists",
+                "Skeleton::createBone" );
+        }
+        // Check name not used
+        if (mBoneListByName.find(name) != mBoneListByName.end())
+        {
+            OGRE_EXCEPT(
+                Exception::ERR_DUPLICATE_ITEM,
+                "A bone with the name " + name + " already exists",
+                "Skeleton::createBone" );
+        }
+        Bone* ret = new Bone(name, handle, this);
+        if (mBoneList.size() <= handle)
+        {
+            mBoneList.resize(handle+1);
+        }
+        mBoneList[handle] = ret;
+        mBoneListByName[name] = ret;
+        return ret;
+    }
+
+
+
+    //---------------------------------------------------------------------
+    Bone* Skeleton::getRootBone(void) const
+    {
+        if (mRootBones.empty())
+        {
+            deriveRootBone();
+        }
+
+        return mRootBones[0];
+    }
+    //---------------------------------------------------------------------
+    void Skeleton::setAnimationState(const AnimationStateSet& animSet)
+    {
+        /* 
+        Algorithm:
+          1. Reset all bone positions
+          2. Iterate per AnimationState, if enabled get Animation and call Animation::apply
+        */
+
+        // Reset bones
+        reset();
+
+		Real weightFactor = 1.0f;
+		if (mBlendState == ANIMBLEND_AVERAGE)
+		{
+			// Derive total weights so we can rebalance if > 1.0f
+			Real totalWeights = 0.0f;
+			ConstEnabledAnimationStateIterator stateIt = 
+				animSet.getEnabledAnimationStateIterator();
+			while (stateIt.hasMoreElements())
+			{
+				const AnimationState* animState = stateIt.getNext();
+				// Make sure we have an anim to match implementation
+				const LinkedSkeletonAnimationSource* linked = 0;
+				if (_getAnimationImpl(animState->getAnimationName(), &linked))
+				{
+					totalWeights += animState->getWeight();
+				}
+			}
+
+			// Allow < 1.0f, allows fade out of all anims if required 
+			if (totalWeights > 1.0f)
+			{
+				weightFactor = 1.0f / totalWeights;
+			}
+		}
+
+        // Per enabled animation state
+        ConstEnabledAnimationStateIterator stateIt = 
+            animSet.getEnabledAnimationStateIterator();
+        while (stateIt.hasMoreElements())
+        {
+            const AnimationState* animState = stateIt.getNext();
+            const LinkedSkeletonAnimationSource* linked = 0;
+            Animation* anim = _getAnimationImpl(animState->getAnimationName(), &linked);
+            // tolerate state entries for animations we're not aware of
+            if (anim)
+            {
+                if (linked)
+                {
+                    anim->apply(this, animState->getTimePosition(), 
+						animState->getWeight() * weightFactor, linked->scale);
+                }
+                else
+                {
+                    anim->apply(this, animState->getTimePosition(), 
+						animState->getWeight() * weightFactor);
+                }
+            }
+        }
+
+
+    }
+    //---------------------------------------------------------------------
+    void Skeleton::setBindingPose(void)
+    {
+        // Update the derived transforms
+        _updateTransforms();
+
+
+        BoneList::iterator i;
+        for (i = mBoneList.begin(); i != mBoneList.end(); ++i)
+        {            
+            (*i)->setBindingPose();
+        }
+    }
+    //---------------------------------------------------------------------
+    void Skeleton::reset(bool resetManualBones)
+    {
+        BoneList::iterator i;
+        for (i = mBoneList.begin(); i != mBoneList.end(); ++i)
+        {
+            if(!(*i)->isManuallyControlled() || resetManualBones)
+                (*i)->reset();
+        }
+    }
+    //---------------------------------------------------------------------
+    Animation* Skeleton::createAnimation(const String& name, Real length)
+    {
+        // Check name not used
+        if (mAnimationsList.find(name) != mAnimationsList.end())
+        {
+            OGRE_EXCEPT(
+                Exception::ERR_DUPLICATE_ITEM,
+                "An animation with the name " + name + " already exists",
+                "Skeleton::createAnimation");
+        }
+
+        Animation* ret = new Animation(name, length);
+
+        // Add to list
+        mAnimationsList[name] = ret;
+
+        return ret;
+
+    }
+	//---------------------------------------------------------------------
+	Animation* Skeleton::getAnimation(const String& name, 
+		const LinkedSkeletonAnimationSource** linker) const
+	{
+		Animation* ret = _getAnimationImpl(name, linker);
+		if (!ret)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "No animation entry found named " + name, 
+				"Skeleton::getAnimation");
+		}
+
+		return ret;
+	}
+	//---------------------------------------------------------------------
+	bool Skeleton::hasAnimation(const String& name)
+	{
+		return _getAnimationImpl(name) != 0;
+	}
+    //---------------------------------------------------------------------
+    Animation* Skeleton::_getAnimationImpl(const String& name, 
+		const LinkedSkeletonAnimationSource** linker) const
+    {
+		Animation* ret = 0;
+        AnimationList::const_iterator i = mAnimationsList.find(name);
+
+        if (i == mAnimationsList.end())
+        {
+			LinkedSkeletonAnimSourceList::const_iterator i;
+			for (i = mLinkedSkeletonAnimSourceList.begin(); 
+				i != mLinkedSkeletonAnimSourceList.end() && !ret; ++i)
+			{
+				if (!i->pSkeleton.isNull())
+				{
+					ret = i->pSkeleton->_getAnimationImpl(name);
+					if (ret && linker)
+					{
+						*linker = &(*i);
+					}
+
+				}
+			}
+
+        }
+		else
+		{
+			if (linker)
+				*linker = 0;
+			ret = i->second;
+		}
+
+		return ret;
+
+    }
+    //---------------------------------------------------------------------
+    void Skeleton::removeAnimation(const String& name)
+    {
+        AnimationList::iterator i = mAnimationsList.find(name);
+
+        if (i == mAnimationsList.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "No animation entry found named " + name, 
+            "Skeleton::getAnimation");
+        }
+
+        delete i->second;
+
+        mAnimationsList.erase(i);
+
+    }
+    //-----------------------------------------------------------------------
+    void Skeleton::_initAnimationState(AnimationStateSet* animSet)
+    {
+        animSet->removeAllAnimationStates();
+           
+        AnimationList::iterator i;
+        for (i = mAnimationsList.begin(); i != mAnimationsList.end(); ++i)
+        {
+            Animation* anim = i->second;
+            // Create animation at time index 0, default params mean this has weight 1 and is disabled
+            const String& animName = anim->getName();
+            animSet->createAnimationState(animName, 0.0, anim->getLength());
+        }
+
+		// Also iterate over linked animation
+		LinkedSkeletonAnimSourceList::iterator li;
+		for (li = mLinkedSkeletonAnimSourceList.begin(); 
+			li != mLinkedSkeletonAnimSourceList.end(); ++li)
+		{
+			if (!li->pSkeleton.isNull())
+			{
+				li->pSkeleton->_refreshAnimationState(animSet);
+			}
+		}
+
+    }
+	//-----------------------------------------------------------------------
+	void Skeleton::_refreshAnimationState(AnimationStateSet* animSet)
+	{
+		// Merge in any new animations
+		AnimationList::iterator i;
+		for (i = mAnimationsList.begin(); i != mAnimationsList.end(); ++i)
+		{
+			Animation* anim = i->second;
+			// Create animation at time index 0, default params mean this has weight 1 and is disabled
+			const String& animName = anim->getName();
+			if (!animSet->hasAnimationState(animName))
+			{
+				animSet->createAnimationState(animName, 0.0, anim->getLength());
+			}
+			else
+			{
+				// Update length incase changed
+				AnimationState* animState = animSet->getAnimationState(animName);
+				animState->setLength(anim->getLength());
+				animState->setTimePosition(std::min(anim->getLength(), animState->getTimePosition()));
+			}
+		}
+		// Also iterate over linked animation
+		LinkedSkeletonAnimSourceList::iterator li;
+		for (li = mLinkedSkeletonAnimSourceList.begin(); 
+			li != mLinkedSkeletonAnimSourceList.end(); ++li)
+		{
+			if (!li->pSkeleton.isNull())
+			{
+				li->pSkeleton->_refreshAnimationState(animSet);
+			}
+		}
+	}
+	//-----------------------------------------------------------------------
+	void Skeleton::_notifyManualBonesDirty(void)
+	{
+		mManualBonesDirty = true;
+	}
+	//-----------------------------------------------------------------------
+	void Skeleton::_notifyManualBoneStateChange(Bone* bone)
+	{
+		if (bone->isManuallyControlled())
+			mManualBones.insert(bone);
+		else
+			mManualBones.erase(bone);
+	}
+    //-----------------------------------------------------------------------
+    unsigned short Skeleton::getNumBones(void) const
+    {
+        return (unsigned short)mBoneList.size();
+    }
+    //-----------------------------------------------------------------------
+    void Skeleton::_getBoneMatrices(Matrix4* pMatrices)
+    {
+        // Update derived transforms
+        _updateTransforms();
+
+        /*
+            Calculating the bone matrices
+            -----------------------------
+            Now that we have the derived scaling factors, orientations & positions in the
+            Bone nodes, we have to compute the Matrix4 to apply to the vertices of a mesh.
+            Because any modification of a vertex has to be relative to the bone, we must
+            first reverse transform by the Bone's original derived position/orientation/scale,
+            then transform by the new derived position/orientation/scale.
+            Also note we combine scale as equivalent axes, no shearing.
+        */
+
+        BoneList::const_iterator i, boneend;
+        boneend = mBoneList.end();
+        for (i = mBoneList.begin();i != boneend; ++i)
+        {
+            Bone* pBone = *i;
+            pBone->_getOffsetTransform(*pMatrices);
+            pMatrices++;
+        }
+
+    }
+    //---------------------------------------------------------------------
+    unsigned short Skeleton::getNumAnimations(void) const
+    {
+        return (unsigned short)mAnimationsList.size();
+    }
+    //---------------------------------------------------------------------
+    Animation* Skeleton::getAnimation(unsigned short index) const
+    {
+		// If you hit this assert, then the index is out of bounds.
+        assert( index < mAnimationsList.size() );
+
+        AnimationList::const_iterator i = mAnimationsList.begin();
+
+		std::advance(i, index);
+
+        return i->second;
+    }
+    //---------------------------------------------------------------------
+    Bone* Skeleton::getBone(unsigned short handle) const
+    {
+        assert(handle < mBoneList.size() && "Index out of bounds");
+        return mBoneList[handle];
+    }
+    //---------------------------------------------------------------------
+    Bone* Skeleton::getBone(const String& name) const
+    {
+        BoneListByName::const_iterator i = mBoneListByName.find(name);
+
+        if (i == mBoneListByName.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Bone named '" + name + "' not found.", 
+                "Skeleton::getBone");
+        }
+
+        return i->second;
+
+    }
+    //---------------------------------------------------------------------
+    void Skeleton::deriveRootBone(void) const
+    {
+        // Start at the first bone and work up
+        if (mBoneList.empty())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Cannot derive root bone as this "
+                "skeleton has no bones!", "Skeleton::deriveRootBone");
+        }
+
+        mRootBones.clear();
+
+        Bone* currentBone;
+        BoneList::const_iterator i;
+        BoneList::const_iterator iend = mBoneList.end();
+        for (i = mBoneList.begin(); i != iend; ++i)
+        {
+            currentBone = *i;
+            if (currentBone->getParent() == 0)
+            {
+                // This is a root
+                mRootBones.push_back(currentBone);
+            }
+        }
+    }
+    //---------------------------------------------------------------------
+    void Skeleton::_dumpContents(const String& filename)
+    {
+        std::ofstream of;
+
+        Quaternion q;
+        Radian angle;
+        Vector3 axis;
+        of.open(filename.c_str());
+
+        of << "-= Debug output of skeleton " << mName << " =-" << std::endl << std::endl;
+        of << "== Bones ==" << std::endl;
+        of << "Number of bones: " << (unsigned int)mBoneList.size() << std::endl;
+        
+        BoneList::iterator bi;
+        for (bi = mBoneList.begin(); bi != mBoneList.end(); ++bi)
+        {
+            Bone* bone = *bi;
+
+            of << "-- Bone " << bone->getHandle() << " --" << std::endl;
+            of << "Position: " << bone->getPosition();
+            q = bone->getOrientation();
+            of << "Rotation: " << q;
+            q.ToAngleAxis(angle, axis);
+            of << " = " << angle.valueRadians() << " radians around axis " << axis << std::endl << std::endl;
+        }
+
+        of << "== Animations ==" << std::endl;
+        of << "Number of animations: " << (unsigned int)mAnimationsList.size() << std::endl;
+
+        AnimationList::iterator ai;
+        for (ai = mAnimationsList.begin(); ai != mAnimationsList.end(); ++ai)
+        {
+            Animation* anim = ai->second;
+
+            of << "-- Animation '" << anim->getName() << "' (length " << anim->getLength() << ") --" << std::endl;
+            of << "Number of tracks: " << anim->getNumNodeTracks() << std::endl;
+
+            int ti;
+            for (ti = 0; ti < anim->getNumNodeTracks(); ++ti)
+            {
+                NodeAnimationTrack* track = anim->getNodeTrack(ti);
+                of << "  -- AnimationTrack " << ti << " --" << std::endl;
+                of << "  Affects bone: " << ((Bone*)track->getAssociatedNode())->getHandle() << std::endl;
+                of << "  Number of keyframes: " << track->getNumKeyFrames() << std::endl;
+
+                int ki;
+                
+                for (ki = 0; ki < track->getNumKeyFrames(); ++ki)
+                {
+                    TransformKeyFrame* key = track->getNodeKeyFrame(ki);
+                    of << "    -- KeyFrame " << ki << " --" << std::endl;
+                    of << "    Time index: " << key->getTime(); 
+                    of << "    Translation: " << key->getTranslate() << std::endl;
+                    q = key->getRotation();
+                    of << "    Rotation: " << q;
+                    q.ToAngleAxis(angle, axis);
+                    of << " = " << angle.valueRadians() << " radians around axis " << axis << std::endl;
+                }
+
+            }
+
+
+
+        }
+
+    }
+    //---------------------------------------------------------------------
+	SkeletonAnimationBlendMode Skeleton::getBlendMode() const
+    {
+		return mBlendState;
+	}
+    //---------------------------------------------------------------------
+	void Skeleton::setBlendMode(SkeletonAnimationBlendMode state) 
+    {
+		mBlendState = state;
+	}
+    //---------------------------------------------------------------------
+    Skeleton::BoneIterator Skeleton::getRootBoneIterator(void)
+    {
+        if (mRootBones.empty())
+        {
+            deriveRootBone();
+        }
+        return BoneIterator(mRootBones.begin(), mRootBones.end());
+    }
+    //---------------------------------------------------------------------
+    Skeleton::BoneIterator Skeleton::getBoneIterator(void)
+    {
+        return BoneIterator(mBoneList.begin(), mBoneList.end());
+    }
+    //---------------------------------------------------------------------
+    void Skeleton::_updateTransforms(void)
+    {
+        BoneList::iterator i, iend;
+        iend = mRootBones.end();
+        for (i = mRootBones.begin(); i != iend; ++i)
+        {
+            (*i)->_update(true, false);
+        }
+		mManualBonesDirty = false;
+    }
+    //---------------------------------------------------------------------
+	void Skeleton::optimiseAllAnimations(bool preservingIdentityNodeTracks)
+	{
+        AnimationList::iterator ai, aiend;
+        aiend = mAnimationsList.end();
+
+        if (!preservingIdentityNodeTracks)
+        {
+            Animation::TrackHandleList tracksToDestroy;
+
+            // Assume all node tracks are identity
+            ushort numBones = getNumBones();
+            for (ushort h = 0; h < numBones; ++h)
+            {
+                tracksToDestroy.insert(h);
+            }
+
+            // Collect identity node tracks for all animations
+            for (ai = mAnimationsList.begin(); ai != aiend; ++ai)
+            {
+                ai->second->_collectIdentityNodeTracks(tracksToDestroy);
+            }
+
+            // Destroy identity node tracks
+            for (ai = mAnimationsList.begin(); ai != aiend; ++ai)
+            {
+                ai->second->_destroyNodeTracks(tracksToDestroy);
+            }
+        }
+
+        for (ai = mAnimationsList.begin(); ai != aiend; ++ai)
+        {
+            // Don't discard identity node tracks here
+			ai->second->optimise(false);
+		}
+	}
+	//---------------------------------------------------------------------
+	void Skeleton::addLinkedSkeletonAnimationSource(const String& skelName, 
+		Real scale)
+	{
+		// Check not already linked
+		LinkedSkeletonAnimSourceList::iterator i;
+		for (i = mLinkedSkeletonAnimSourceList.begin(); 
+			i != mLinkedSkeletonAnimSourceList.end(); ++i)
+		{
+			if (skelName == i->skeletonName)
+				return; // don't bother
+		}
+
+		if (isLoaded())
+		{
+			// Load immediately
+			SkeletonPtr skelPtr = 
+				SkeletonManager::getSingleton().load(skelName, mGroup);
+			mLinkedSkeletonAnimSourceList.push_back(
+				LinkedSkeletonAnimationSource(skelName, scale, skelPtr));
+
+		}
+		else
+		{
+			// Load later
+			mLinkedSkeletonAnimSourceList.push_back(
+				LinkedSkeletonAnimationSource(skelName, scale));
+		}
+
+	}
+	//---------------------------------------------------------------------
+	void Skeleton::removeAllLinkedSkeletonAnimationSources(void)
+	{
+		mLinkedSkeletonAnimSourceList.clear();
+	}
+	//---------------------------------------------------------------------
+	Skeleton::LinkedSkeletonAnimSourceIterator 
+	Skeleton::getLinkedSkeletonAnimationSourceIterator(void) const
+	{
+		return LinkedSkeletonAnimSourceIterator(
+			mLinkedSkeletonAnimSourceList.begin(), 
+			mLinkedSkeletonAnimSourceList.end());
+	}
+	//---------------------------------------------------------------------
+    struct DeltaTransform
+    {
+        Vector3 translate;
+        Quaternion rotate;
+        Vector3 scale;
+        bool isIdentity;
+    };
+    void Skeleton::_mergeSkeletonAnimations(const Skeleton* src,
+        const BoneHandleMap& boneHandleMap,
+        const StringVector& animations)
+    {
+        ushort handle;
+
+        ushort numSrcBones = src->getNumBones();
+        ushort numDstBones = this->getNumBones();
+
+        if (boneHandleMap.size() != numSrcBones)
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "Number of bones in the bone handle map must equal to "
+                "number of bones in the source skeleton.",
+                "Skeleton::_mergeSkeletonAnimations");
+        }
+
+        bool existsMissingBone = false;
+
+        // Check source skeleton structures compatible with ourself (that means
+        // identically bones with identical handles, and with same hierarchy, but
+        // not necessary to have same number of bones and bone names).
+        for (handle = 0; handle < numSrcBones; ++handle)
+        {
+            const Bone* srcBone = src->getBone(handle);
+            ushort dstHandle = boneHandleMap[handle];
+
+            // Does it exists in target skeleton?
+            if (dstHandle < numDstBones)
+            {
+                Bone* destBone = this->getBone(dstHandle);
+
+                // Check both bones have identical parent, or both are root bone.
+                const Bone* srcParent = static_cast<Bone*>(srcBone->getParent());
+                Bone* destParent = static_cast<Bone*>(destBone->getParent());
+                if ((srcParent || destParent) &&
+                    (!srcParent || !destParent ||
+                     boneHandleMap[srcParent->getHandle()] != destParent->getHandle()))
+                {
+                    OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                        "Source skeleton incompatible with this skeleton: "
+                        "difference hierarchy between bone '" + srcBone->getName() +
+                        "' and '" + destBone->getName() + "'.",
+                        "Skeleton::_mergeSkeletonAnimations");
+                }
+            }
+            else
+            {
+                existsMissingBone = true;
+            }
+        }
+
+        // Clone bones if need
+        if (existsMissingBone)
+        {
+            // Create missing bones
+            for (handle = 0; handle < numSrcBones; ++handle)
+            {
+                const Bone* srcBone = src->getBone(handle);
+                ushort dstHandle = boneHandleMap[handle];
+
+                // The bone is missing in target skeleton?
+                if (dstHandle >= numDstBones)
+                {
+                    Bone* dstBone = this->createBone(srcBone->getName(), dstHandle);
+                    // Sets initial transform
+                    dstBone->setPosition(srcBone->getInitialPosition());
+                    dstBone->setOrientation(srcBone->getInitialOrientation());
+                    dstBone->setScale(srcBone->getInitialScale());
+                    dstBone->setInitialState();
+                }
+            }
+
+            // Link new bones to parent
+            for (handle = 0; handle < numSrcBones; ++handle)
+            {
+                const Bone* srcBone = src->getBone(handle);
+                ushort dstHandle = boneHandleMap[handle];
+
+                // Is new bone?
+                if (dstHandle >= numDstBones)
+                {
+                    const Bone* srcParent = static_cast<Bone*>(srcBone->getParent());
+                    if (srcParent)
+                    {
+                        Bone* destParent = this->getBone(boneHandleMap[srcParent->getHandle()]);
+                        Bone* dstBone = this->getBone(dstHandle);
+                        destParent->addChild(dstBone);
+                    }
+                }
+            }
+
+            // Derive root bones in case it was changed
+            this->deriveRootBone();
+
+            // Reset binding pose for new bones
+            this->reset(true);
+            this->setBindingPose();
+        }
+
+        //
+        // We need to adapt animations from source to target skeleton, but since source
+        // and target skeleton bones bind transform might difference, so we need to alter
+        // keyframes in source to suit to target skeleton.
+        //
+        // For any given animation time, formula:
+        //
+        //      LocalTransform = BindTransform * KeyFrame;
+        //      DerivedTransform = ParentDerivedTransform * LocalTransform
+        //
+        // And all derived transforms should be keep identically after adapt to
+        // target skeleton, Then:
+        //
+        //      DestDerivedTransform == SrcDerivedTransform
+        //      DestParentDerivedTransform == SrcParentDerivedTransform
+        // ==>
+        //      DestLocalTransform = SrcLocalTransform
+        // ==>
+        //      DestBindTransform * DestKeyFrame = SrcBindTransform * SrcKeyFrame
+        // ==>
+        //      DestKeyFrame = inverse(DestBindTransform) * SrcBindTransform * SrcKeyFrame
+        //
+        // We define (inverse(DestBindTransform) * SrcBindTransform) as 'delta-transform' here.
+        //
+
+        // Calculate delta-transforms for all source bones.
+        std::vector<DeltaTransform> deltaTransforms(numSrcBones);
+        for (handle = 0; handle < numSrcBones; ++handle)
+        {
+            const Bone* srcBone = src->getBone(handle);
+            DeltaTransform& deltaTransform = deltaTransforms[handle];
+            ushort dstHandle = boneHandleMap[handle];
+
+            if (dstHandle < numDstBones)
+            {
+                // Common bone, calculate delta-transform
+
+                Bone* dstBone = this->getBone(dstHandle);
+
+                deltaTransform.translate = srcBone->getInitialPosition() - dstBone->getInitialPosition();
+                deltaTransform.rotate = dstBone->getInitialOrientation().Inverse() * srcBone->getInitialOrientation();
+                deltaTransform.scale = srcBone->getInitialScale() / dstBone->getInitialScale();
+
+                // Check whether or not delta-transform is identity
+                const Real tolerance = 1e-3f;
+                Vector3 axis;
+                Radian angle;
+                deltaTransform.rotate.ToAngleAxis(angle, axis);
+                deltaTransform.isIdentity =
+                    deltaTransform.translate.positionEquals(Vector3::ZERO, tolerance) &&
+                    deltaTransform.scale.positionEquals(Vector3::UNIT_SCALE, tolerance) &&
+                    Math::RealEqual(angle.valueRadians(), 0.0f, tolerance);
+            }
+            else
+            {
+                // New bone, the delta-transform is identity
+
+                deltaTransform.translate = Vector3::ZERO;
+                deltaTransform.rotate = Quaternion::IDENTITY;
+                deltaTransform.scale = Vector3::UNIT_SCALE;
+                deltaTransform.isIdentity = true;
+            }
+        }
+
+        // Now copy animations
+
+        ushort numAnimations;
+        if (animations.empty())
+            numAnimations = src->getNumAnimations();
+        else
+            numAnimations = static_cast<ushort>(animations.size());
+        for (ushort i = 0; i < numAnimations; ++i)
+        {
+            const Animation* srcAnimation;
+            if (animations.empty())
+            {
+                // Get animation of source skeleton by the given index
+                srcAnimation = src->getAnimation(i);
+            }
+            else
+            {
+                // Get animation of source skeleton by the given name
+                const LinkedSkeletonAnimationSource* linker;
+                srcAnimation = src->_getAnimationImpl(animations[i], &linker);
+                if (!srcAnimation || linker)
+                {
+                    OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+                        "No animation entry found named " + animations[i],
+                        "Skeleton::_mergeSkeletonAnimations");
+                }
+            }
+
+            // Create target animation
+            Animation* dstAnimation = this->createAnimation(srcAnimation->getName(), srcAnimation->getLength());
+
+            // Copy interpolation modes
+            dstAnimation->setInterpolationMode(srcAnimation->getInterpolationMode());
+            dstAnimation->setRotationInterpolationMode(srcAnimation->getRotationInterpolationMode());
+
+            // Copy track for each bone
+            for (handle = 0; handle < numSrcBones; ++handle)
+            {
+                const DeltaTransform& deltaTransform = deltaTransforms[handle];
+                ushort dstHandle = boneHandleMap[handle];
+
+                if (srcAnimation->hasNodeTrack(handle))
+                {
+                    // Clone track from source animation
+
+                    const NodeAnimationTrack* srcTrack = srcAnimation->getNodeTrack(handle);
+                    NodeAnimationTrack* dstTrack = dstAnimation->createNodeTrack(dstHandle, this->getBone(dstHandle));
+                    dstTrack->setUseShortestRotationPath(srcTrack->getUseShortestRotationPath());
+
+                    ushort numKeyFrames = srcTrack->getNumKeyFrames();
+                    for (ushort k = 0; k < numKeyFrames; ++k)
+                    {
+                        const TransformKeyFrame* srcKeyFrame = srcTrack->getNodeKeyFrame(k);
+                        TransformKeyFrame* dstKeyFrame = dstTrack->createNodeKeyFrame(srcKeyFrame->getTime());
+
+                        // Adjust keyframes to match target binding pose
+                        if (deltaTransform.isIdentity)
+                        {
+                            dstKeyFrame->setTranslate(srcKeyFrame->getTranslate());
+                            dstKeyFrame->setRotation(srcKeyFrame->getRotation());
+                            dstKeyFrame->setScale(srcKeyFrame->getScale());
+                        }
+                        else
+                        {
+                            dstKeyFrame->setTranslate(deltaTransform.translate + srcKeyFrame->getTranslate());
+                            dstKeyFrame->setRotation(deltaTransform.rotate * srcKeyFrame->getRotation());
+                            dstKeyFrame->setScale(deltaTransform.scale * srcKeyFrame->getScale());
+                        }
+                    }
+                }
+                else if (!deltaTransform.isIdentity)
+                {
+                    // Create 'static' track for this bone
+
+                    NodeAnimationTrack* dstTrack = dstAnimation->createNodeTrack(dstHandle, this->getBone(dstHandle));
+                    TransformKeyFrame* dstKeyFrame;
+
+                    dstKeyFrame = dstTrack->createNodeKeyFrame(0);
+                    dstKeyFrame->setTranslate(deltaTransform.translate);
+                    dstKeyFrame->setRotation(deltaTransform.rotate);
+                    dstKeyFrame->setScale(deltaTransform.scale);
+
+                    dstKeyFrame = dstTrack->createNodeKeyFrame(dstAnimation->getLength());
+                    dstKeyFrame->setTranslate(deltaTransform.translate);
+                    dstKeyFrame->setRotation(deltaTransform.rotate);
+                    dstKeyFrame->setScale(deltaTransform.scale);
+                }
+            }
+        }
+    }
+    //---------------------------------------------------------------------
+    void Skeleton::_buildMapBoneByHandle(const Skeleton* src,
+        BoneHandleMap& boneHandleMap) const
+    {
+        ushort numSrcBones = src->getNumBones();
+        boneHandleMap.resize(numSrcBones);
+
+        for (ushort handle = 0; handle < numSrcBones; ++handle)
+        {
+            boneHandleMap[handle] = handle;
+        }
+    }
+    //---------------------------------------------------------------------
+    void Skeleton::_buildMapBoneByName(const Skeleton* src,
+        BoneHandleMap& boneHandleMap) const
+    {
+        ushort numSrcBones = src->getNumBones();
+        boneHandleMap.resize(numSrcBones);
+
+        ushort newBoneHandle = this->getNumBones();
+        for (ushort handle = 0; handle < numSrcBones; ++handle)
+        {
+            const Bone* srcBone = src->getBone(handle);
+            BoneListByName::const_iterator i = this->mBoneListByName.find(srcBone->getName());
+            if (i == mBoneListByName.end())
+                boneHandleMap[handle] = newBoneHandle++;
+            else
+                boneHandleMap[handle] = i->second->getHandle();
+        }
+    }
+
+}
+
Index: /OgreMain/src/OgreSkeletonInstance.cpp
===================================================================
--- /OgreMain/src/OgreSkeletonInstance.cpp	(revision 5)
+++ /OgreMain/src/OgreSkeletonInstance.cpp	(revision 5)
@@ -0,0 +1,248 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreSkeletonInstance.h"
+#include "OgreBone.h"
+#include "OgreTagPoint.h"
+
+
+namespace Ogre {
+    //-------------------------------------------------------------------------
+    SkeletonInstance::SkeletonInstance(const SkeletonPtr& masterCopy) 
+        : Skeleton()
+        , mSkeleton(masterCopy)
+        , mNextTagPointAutoHandle(0)
+    {
+    }
+    //-------------------------------------------------------------------------
+    SkeletonInstance::~SkeletonInstance()
+    {
+        // have to call this here rather than in Resource destructor
+        // since calling virtual methods in base destructors causes crash
+        // ...and calling it in Skeleton destructor does not unload
+        // SkeletonInstance since it has seized to be by then.
+        unload();
+    }
+    //-------------------------------------------------------------------------
+    unsigned short SkeletonInstance::getNumAnimations(void) const
+    {
+        return mSkeleton->getNumAnimations();
+    }
+    //-------------------------------------------------------------------------
+    Animation* SkeletonInstance::getAnimation(unsigned short index) const
+    {
+        return mSkeleton->getAnimation(index);
+    }
+    //-------------------------------------------------------------------------
+    Animation* SkeletonInstance::createAnimation(const String& name, Real length)
+    {
+        return mSkeleton->createAnimation(name, length);
+    }
+    //-------------------------------------------------------------------------
+    Animation* SkeletonInstance::getAnimation(const String& name, 
+		const LinkedSkeletonAnimationSource** linker) const
+    {
+        return mSkeleton->getAnimation(name, linker);
+    }
+	//-------------------------------------------------------------------------
+	Animation* SkeletonInstance::_getAnimationImpl(const String& name, 
+		const LinkedSkeletonAnimationSource** linker) const
+	{
+		return mSkeleton->_getAnimationImpl(name, linker);
+	}
+    //-------------------------------------------------------------------------
+    void SkeletonInstance::removeAnimation(const String& name)
+    {
+        mSkeleton->removeAnimation(name);
+    }
+	//-------------------------------------------------------------------------
+	void SkeletonInstance::addLinkedSkeletonAnimationSource(const String& skelName, 
+		Real scale)
+	{
+		mSkeleton->addLinkedSkeletonAnimationSource(skelName, scale);
+	}
+	//-------------------------------------------------------------------------
+	void SkeletonInstance::removeAllLinkedSkeletonAnimationSources(void)
+	{
+		mSkeleton->removeAllLinkedSkeletonAnimationSources();
+	}
+	//-------------------------------------------------------------------------
+	Skeleton::LinkedSkeletonAnimSourceIterator 
+	SkeletonInstance::getLinkedSkeletonAnimationSourceIterator(void) const
+	{
+		return mSkeleton->getLinkedSkeletonAnimationSourceIterator();
+	}
+	//-------------------------------------------------------------------------
+	void SkeletonInstance::_initAnimationState(AnimationStateSet* animSet)
+	{
+		mSkeleton->_initAnimationState(animSet);
+	}
+	//-------------------------------------------------------------------------
+	void SkeletonInstance::_refreshAnimationState(AnimationStateSet* animSet)
+	{
+		mSkeleton->_refreshAnimationState(animSet);
+	}
+    //-------------------------------------------------------------------------
+    void SkeletonInstance::cloneBoneAndChildren(Bone* source, Bone* parent)
+    {
+        Bone* newBone;
+        if (source->getName().empty())
+        {
+            newBone = createBone(source->getHandle());
+        }
+        else
+        {
+            newBone = createBone(source->getName(), source->getHandle());
+        }
+        if (parent == NULL)
+        {
+            mRootBones.push_back(newBone);
+        }
+        else
+        {
+            parent->addChild(newBone);
+        }
+        newBone->setOrientation(source->getOrientation());
+        newBone->setPosition(source->getPosition());
+        newBone->setScale(source->getScale());
+
+        // Process children
+        Node::ChildNodeIterator it = source->getChildIterator();
+        while (it.hasMoreElements())
+        {
+            cloneBoneAndChildren(static_cast<Bone*>(it.getNext()), newBone);
+        }
+    }
+    //-------------------------------------------------------------------------
+    void SkeletonInstance::loadImpl(void)
+    {
+        mNextAutoHandle = mSkeleton->mNextAutoHandle;
+        mNextTagPointAutoHandle = 0;
+        // construct self from master
+        mBlendState = mSkeleton->mBlendState;
+        // Copy bones
+        BoneIterator i = mSkeleton->getRootBoneIterator();
+        while (i.hasMoreElements())
+        {
+            Bone* b = i.getNext();
+            cloneBoneAndChildren(b, 0);
+            b->_update(true, false);
+        }
+        setBindingPose();
+    }
+    //-------------------------------------------------------------------------
+    void SkeletonInstance::unloadImpl(void)
+    {
+        Skeleton::unloadImpl();
+
+        // destroy TagPoints
+        for (TagPointList::const_iterator it = mActiveTagPoints.begin(); it != mActiveTagPoints.end(); ++it)
+        {
+            TagPoint* tagPoint = *it;
+            // Woohoo! The child object all the same attaching this skeleton instance, but is ok we can just
+            // ignore it:
+            //   1. The parent node of the tagPoint already deleted by Skeleton::unload(), nothing need to do now
+            //   2. And the child object relationship already detached by Entity::~Entity()
+            delete tagPoint;
+        }
+        mActiveTagPoints.clear();
+        for (TagPointList::const_iterator it2 = mFreeTagPoints.begin(); it2 != mFreeTagPoints.end(); ++it2)
+        {
+            TagPoint* tagPoint = *it2;
+            delete tagPoint;
+        }
+        mFreeTagPoints.clear();
+    }
+
+    //-------------------------------------------------------------------------
+    TagPoint* SkeletonInstance::createTagPointOnBone(Bone* bone,
+        const Quaternion &offsetOrientation, 
+        const Vector3 &offsetPosition)
+    {
+        TagPoint* ret;
+        if (mFreeTagPoints.empty()) {
+            ret = new TagPoint(mNextTagPointAutoHandle++, this);
+            mActiveTagPoints.push_back(ret);
+        } else {
+            ret = mFreeTagPoints.front();
+            mActiveTagPoints.splice(
+                mActiveTagPoints.end(), mFreeTagPoints, mFreeTagPoints.begin());
+            // Initial some members ensure identically behavior, avoiding potential bug.
+            ret->setParentEntity(0);
+            ret->setChildObject(0);
+            ret->setInheritOrientation(true);
+            ret->setInheritScale(true);
+            ret->setInheritParentEntityOrientation(true);
+            ret->setInheritParentEntityScale(true);
+        }
+
+        ret->setPosition(offsetPosition);
+        ret->setOrientation(offsetOrientation);
+        ret->setScale(Vector3::UNIT_SCALE);
+        ret->setBindingPose();
+        bone->addChild(ret);
+
+        return ret;
+    }
+    //-------------------------------------------------------------------------
+    void SkeletonInstance::freeTagPoint(TagPoint* tagPoint)
+    {
+        TagPointList::iterator it =
+            std::find(mActiveTagPoints.begin(), mActiveTagPoints.end(), tagPoint);
+        assert(it != mActiveTagPoints.end());
+        if (it != mActiveTagPoints.end())
+        {
+            if (tagPoint->getParent())
+                tagPoint->getParent()->removeChild(tagPoint);
+
+            mFreeTagPoints.splice(mFreeTagPoints.end(), mActiveTagPoints, it);
+        }
+    }
+	//-------------------------------------------------------------------------
+	const String& SkeletonInstance::getName(void) const
+	{
+		// delegate
+		return mSkeleton->getName();
+	}
+	//-------------------------------------------------------------------------
+	ResourceHandle SkeletonInstance::getHandle(void) const
+	{
+		// delegate
+		return mSkeleton->getHandle();
+	}
+	//-------------------------------------------------------------------------
+	const String& SkeletonInstance::getGroup(void)
+	{
+		// delegate
+		return mSkeleton->getGroup();
+	}
+
+
+}
+
Index: /OgreMain/src/OgreSkeletonManager.cpp
===================================================================
--- /OgreMain/src/OgreSkeletonManager.cpp	(revision 5)
+++ /OgreMain/src/OgreSkeletonManager.cpp	(revision 5)
@@ -0,0 +1,69 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreSkeletonManager.h"
+
+#include "OgreSkeleton.h"
+
+namespace Ogre
+{
+    //-----------------------------------------------------------------------
+    template<> SkeletonManager* Singleton<SkeletonManager>::ms_Singleton = 0;
+    SkeletonManager* SkeletonManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    SkeletonManager& SkeletonManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+    //-----------------------------------------------------------------------
+    SkeletonManager::SkeletonManager()
+    {
+        mLoadOrder = 300.0f;
+        mResourceType = "Skeleton";
+
+        ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
+    }
+    //-----------------------------------------------------------------------
+    SkeletonManager::~SkeletonManager()
+    {
+        ResourceGroupManager::getSingleton()._unregisterResourceManager(mResourceType);
+    }
+    //-----------------------------------------------------------------------
+    Resource* SkeletonManager::createImpl(const String& name, ResourceHandle handle, 
+        const String& group, bool isManual, ManualResourceLoader* loader, 
+        const NameValuePairList* createParams)
+    {
+        return new Skeleton(this, name, handle, group, isManual, loader);
+    }
+
+
+
+}
Index: /OgreMain/src/OgreSkeletonSerializer.cpp
===================================================================
--- /OgreMain/src/OgreSkeletonSerializer.cpp	(revision 5)
+++ /OgreMain/src/OgreSkeletonSerializer.cpp	(revision 5)
@@ -0,0 +1,579 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreSkeletonFileFormat.h"
+#include "OgreSkeletonSerializer.h"
+#include "OgreSkeleton.h"
+#include "OgreAnimation.h"
+#include "OgreAnimationTrack.h"
+#include "OgreKeyFrame.h"
+#include "OgreBone.h"
+#include "OgreString.h"
+#include "OgreDataStream.h"
+#include "OgreLogManager.h"
+
+
+
+
+namespace Ogre {
+    /// stream overhead = ID + size
+    const long STREAM_OVERHEAD_SIZE = sizeof(uint16) + sizeof(uint32);
+    //---------------------------------------------------------------------
+    SkeletonSerializer::SkeletonSerializer()
+    {
+        // Version number
+        // NB changed to include bone names in 1.1
+        mVersion = "[Serializer_v1.10]";
+    }
+    //---------------------------------------------------------------------
+    SkeletonSerializer::~SkeletonSerializer()
+    {
+    }
+    //---------------------------------------------------------------------
+    void SkeletonSerializer::exportSkeleton(const Skeleton* pSkeleton, 
+		const String& filename, Endian endianMode)
+    {
+		// Decide on endian mode
+		determineEndianness(endianMode);
+
+        String msg;
+        mpfFile = fopen(filename.c_str(), "wb");
+		if (!mpfFile)
+		{
+			OGRE_EXCEPT(Exception::ERR_CANNOT_WRITE_TO_FILE,
+				"Unable to open file " + filename + " for writing",
+				"SkeletonSerializer::exportSkeleton");
+		}
+
+        writeFileHeader();
+
+        // Write main skeleton data
+        LogManager::getSingleton().logMessage("Exporting bones..");
+        writeSkeleton(pSkeleton);
+        LogManager::getSingleton().logMessage("Bones exported.");
+
+        // Write all animations
+        unsigned short numAnims = pSkeleton->getNumAnimations();
+        msg = "Exporting animations, count=";
+		StringUtil::StrStreamType num;
+		num << numAnims;
+        msg += num.str();
+        LogManager::getSingleton().logMessage(msg);
+        for (unsigned short i = 0; i < numAnims; ++i)
+        {
+            Animation* pAnim = pSkeleton->getAnimation(i);
+            msg = "Exporting animation: " + pAnim->getName();
+            LogManager::getSingleton().logMessage(msg);
+            writeAnimation(pSkeleton, pAnim);
+            LogManager::getSingleton().logMessage("Animation exported.");
+
+        }
+
+		// Write links
+		Skeleton::LinkedSkeletonAnimSourceIterator linkIt = 
+			pSkeleton->getLinkedSkeletonAnimationSourceIterator();
+		while(linkIt.hasMoreElements())
+		{
+			const LinkedSkeletonAnimationSource& link = linkIt.getNext();
+			writeSkeletonAnimationLink(pSkeleton, link);
+		}
+
+        fclose(mpfFile);
+
+    }
+    //---------------------------------------------------------------------
+    void SkeletonSerializer::importSkeleton(DataStreamPtr& stream, Skeleton* pSkel)
+    {
+		// Determine endianness (must be the first thing we do!)
+		determineEndianness(stream);
+
+		// Check header
+        readFileHeader(stream);
+
+        unsigned short streamID;
+        while(!stream->eof())
+        {
+            streamID = readChunk(stream);
+            switch (streamID)
+            {
+            case SKELETON_BONE:
+                readBone(stream, pSkel);
+                break;
+            case SKELETON_BONE_PARENT:
+                readBoneParent(stream, pSkel);
+                break;
+            case SKELETON_ANIMATION:
+                readAnimation(stream, pSkel);
+				break;
+			case SKELETON_ANIMATION_LINK:
+				readSkeletonAnimationLink(stream, pSkel);
+				break;
+            }
+        }
+
+        // Assume bones are stored in the binding pose
+        pSkel->setBindingPose();
+
+
+    }
+    //---------------------------------------------------------------------
+    void SkeletonSerializer::writeSkeleton(const Skeleton* pSkel)
+    {
+        // Write each bone
+        unsigned short numBones = pSkel->getNumBones();
+        unsigned short i;
+        for (i = 0; i < numBones; ++i)
+        {
+            Bone* pBone = pSkel->getBone(i);
+            writeBone(pSkel, pBone);
+        }
+        // Write parents
+        for (i = 0; i < numBones; ++i)
+        {
+            Bone* pBone = pSkel->getBone(i);
+            unsigned short handle = pBone->getHandle();
+            Bone* pParent = (Bone*)pBone->getParent(); 
+            if (pParent != NULL) 
+            {
+                writeBoneParent(pSkel, handle, pParent->getHandle());             
+            }
+        }
+    }
+    //---------------------------------------------------------------------
+    void SkeletonSerializer::writeBone(const Skeleton* pSkel, const Bone* pBone)
+    {
+        writeChunkHeader(SKELETON_BONE, calcBoneSize(pSkel, pBone));
+
+        unsigned short handle = pBone->getHandle();
+        // char* name
+        writeString(pBone->getName());
+        // unsigned short handle            : handle of the bone, should be contiguous & start at 0
+        writeShorts(&handle, 1);
+        // Vector3 position                 : position of this bone relative to parent 
+        writeObject(pBone->getPosition());
+        // Quaternion orientation           : orientation of this bone relative to parent 
+        writeObject(pBone->getOrientation());
+        // Vector3 scale                    : scale of this bone relative to parent 
+        if (pBone->getScale() != Vector3::UNIT_SCALE)
+        {
+            writeObject(pBone->getScale());
+        }
+    }
+    //---------------------------------------------------------------------
+    void SkeletonSerializer::writeBoneParent(const Skeleton* pSkel, 
+        unsigned short boneId, unsigned short parentId)
+    {
+        writeChunkHeader(SKELETON_BONE_PARENT, calcBoneParentSize(pSkel));
+
+        // unsigned short handle             : child bone
+        writeShorts(&boneId, 1);
+        // unsigned short parentHandle   : parent bone
+        writeShorts(&parentId, 1);
+
+    }
+    //---------------------------------------------------------------------
+    void SkeletonSerializer::writeAnimation(const Skeleton* pSkel, 
+        const Animation* anim)
+    {
+        writeChunkHeader(SKELETON_ANIMATION, calcAnimationSize(pSkel, anim));
+
+        // char* name                       : Name of the animation
+        writeString(anim->getName());
+        // float length                      : Length of the animation in seconds
+        float len = anim->getLength();
+        writeFloats(&len, 1);
+
+        // Write all tracks
+        Animation::NodeTrackIterator trackIt = anim->getNodeTrackIterator();
+        while(trackIt.hasMoreElements())
+        {
+            writeAnimationTrack(pSkel, trackIt.getNext());
+        }
+
+    }
+    //---------------------------------------------------------------------
+    void SkeletonSerializer::writeAnimationTrack(const Skeleton* pSkel, 
+        const NodeAnimationTrack* track)
+    {
+        writeChunkHeader(SKELETON_ANIMATION_TRACK, calcAnimationTrackSize(pSkel, track));
+
+        // unsigned short boneIndex     : Index of bone to apply to
+        Bone* bone = (Bone*)track->getAssociatedNode();
+        unsigned short boneid = bone->getHandle();
+        writeShorts(&boneid, 1);
+
+        // Write all keyframes
+        for (unsigned short i = 0; i < track->getNumKeyFrames(); ++i)
+        {
+            writeKeyFrame(pSkel, track->getNodeKeyFrame(i));
+        }
+
+    }
+    //---------------------------------------------------------------------
+    void SkeletonSerializer::writeKeyFrame(const Skeleton* pSkel, 
+        const TransformKeyFrame* key)
+    {
+
+        writeChunkHeader(SKELETON_ANIMATION_TRACK_KEYFRAME, 
+            calcKeyFrameSize(pSkel, key));
+
+        // float time                    : The time position (seconds)
+        float time = key->getTime();
+        writeFloats(&time, 1);
+        // Quaternion rotate            : Rotation to apply at this keyframe
+        writeObject(key->getRotation());
+        // Vector3 translate            : Translation to apply at this keyframe
+        writeObject(key->getTranslate());
+        // Vector3 scale                : Scale to apply at this keyframe
+        if (key->getScale() != Vector3::UNIT_SCALE)
+        {
+            writeObject(key->getScale());
+        }
+    }
+    //---------------------------------------------------------------------
+    size_t SkeletonSerializer::calcBoneSize(const Skeleton* pSkel, 
+        const Bone* pBone)
+    {
+        size_t size = STREAM_OVERHEAD_SIZE;
+
+        // handle
+        size += sizeof(unsigned short);
+
+        // position
+        size += sizeof(float) * 3;
+
+        // orientation
+        size += sizeof(float) * 4;
+
+        // scale
+        if (pBone->getScale() != Vector3::UNIT_SCALE)
+        {
+            size += sizeof(float) * 3;
+        }
+
+        return size;
+    }
+    //---------------------------------------------------------------------
+    size_t SkeletonSerializer::calcBoneSizeWithoutScale(const Skeleton* pSkel, 
+        const Bone* pBone)
+    {
+        size_t size = STREAM_OVERHEAD_SIZE;
+
+        // handle
+        size += sizeof(unsigned short);
+
+        // position
+        size += sizeof(float) * 3;
+
+        // orientation
+        size += sizeof(float) * 4;
+
+        return size;
+    }
+    //---------------------------------------------------------------------
+    size_t SkeletonSerializer::calcBoneParentSize(const Skeleton* pSkel)
+    {
+        size_t size = STREAM_OVERHEAD_SIZE;
+
+        // handle
+        size += sizeof(unsigned short);
+
+        // parent handle
+        size += sizeof(unsigned short);
+
+        return size;
+    }
+    //---------------------------------------------------------------------
+    size_t SkeletonSerializer::calcAnimationSize(const Skeleton* pSkel, 
+        const Animation* pAnim)
+    {
+        size_t size = STREAM_OVERHEAD_SIZE;
+
+        // Name, including terminator
+        size += pAnim->getName().length() + 1;
+        // length
+        size += sizeof(float);
+
+        // Nested animation tracks
+		Animation::NodeTrackIterator trackIt = pAnim->getNodeTrackIterator();
+		while(trackIt.hasMoreElements())
+		{
+            size += calcAnimationTrackSize(pSkel, trackIt.getNext());
+        }
+
+        return size;
+    }
+    //---------------------------------------------------------------------
+    size_t SkeletonSerializer::calcAnimationTrackSize(const Skeleton* pSkel, 
+        const NodeAnimationTrack* pTrack)
+    {
+        size_t size = STREAM_OVERHEAD_SIZE;
+
+        // unsigned short boneIndex     : Index of bone to apply to
+        size += sizeof(unsigned short);
+
+        // Nested keyframes
+        for (unsigned short i = 0; i < pTrack->getNumKeyFrames(); ++i)
+        {
+            size += calcKeyFrameSize(pSkel, pTrack->getNodeKeyFrame(i));
+        }
+
+        return size;
+    }
+    //---------------------------------------------------------------------
+    size_t SkeletonSerializer::calcKeyFrameSize(const Skeleton* pSkel, 
+        const TransformKeyFrame* pKey)
+    {
+        size_t size = STREAM_OVERHEAD_SIZE;
+
+        // float time                    : The time position (seconds)
+        size += sizeof(float);
+        // Quaternion rotate            : Rotation to apply at this keyframe
+        size += sizeof(float) * 4;
+        // Vector3 translate            : Translation to apply at this keyframe
+        size += sizeof(float) * 3;
+        // Vector3 scale                : Scale to apply at this keyframe
+        if (pKey->getScale() != Vector3::UNIT_SCALE)
+        {
+            size += sizeof(float) * 3;
+        }
+
+        return size;
+    }
+    //---------------------------------------------------------------------
+    size_t SkeletonSerializer::calcKeyFrameSizeWithoutScale(const Skeleton* pSkel, 
+        const TransformKeyFrame* pKey)
+    {
+        size_t size = STREAM_OVERHEAD_SIZE;
+
+        // float time                    : The time position (seconds)
+        size += sizeof(float);
+        // Quaternion rotate            : Rotation to apply at this keyframe
+        size += sizeof(float) * 4;
+        // Vector3 translate            : Translation to apply at this keyframe
+        size += sizeof(float) * 3;
+
+        return size;
+    }
+    //---------------------------------------------------------------------
+    void SkeletonSerializer::readBone(DataStreamPtr& stream, Skeleton* pSkel)
+    {
+        // char* name
+        String name = readString(stream);
+        // unsigned short handle            : handle of the bone, should be contiguous & start at 0
+        unsigned short handle;
+        readShorts(stream, &handle, 1);
+
+        // Create new bone
+        Bone* pBone = pSkel->createBone(name, handle);
+
+        // Vector3 position                 : position of this bone relative to parent 
+        Vector3 pos;
+        readObject(stream, pos);
+        pBone->setPosition(pos);
+        // Quaternion orientation           : orientation of this bone relative to parent 
+        Quaternion q;
+        readObject(stream, q);
+        pBone->setOrientation(q);
+        // Do we have scale?
+        if (mCurrentstreamLen > calcBoneSizeWithoutScale(pSkel, pBone))
+        {
+            Vector3 scale;
+            readObject(stream, scale);
+            pBone->setScale(scale);
+        }
+    }
+    //---------------------------------------------------------------------
+    void SkeletonSerializer::readBoneParent(DataStreamPtr& stream, Skeleton* pSkel)
+    {
+        // All bones have been created by this point
+        Bone *child, *parent;
+        unsigned short childHandle, parentHandle;
+
+        // unsigned short handle             : child bone
+        readShorts(stream, &childHandle, 1);
+        // unsigned short parentHandle   : parent bone
+        readShorts(stream, &parentHandle, 1);
+
+        // Find bones
+        parent = pSkel->getBone(parentHandle);
+        child = pSkel->getBone(childHandle);
+
+        // attach
+        parent->addChild(child);
+
+    }
+    //---------------------------------------------------------------------
+    void SkeletonSerializer::readAnimation(DataStreamPtr& stream, Skeleton* pSkel)
+    {
+        // char* name                       : Name of the animation
+        String name;
+        name = readString(stream);
+        // float length                      : Length of the animation in seconds
+        float len;
+        readFloats(stream, &len, 1);
+
+        Animation *pAnim = pSkel->createAnimation(name, len);
+
+        // Read all tracks
+        if (!stream->eof())
+        {
+            unsigned short streamID = readChunk(stream);
+            while(streamID == SKELETON_ANIMATION_TRACK && !stream->eof())
+            {
+                readAnimationTrack(stream, pAnim, pSkel);
+
+                if (!stream->eof())
+                {
+                    // Get next stream
+                    streamID = readChunk(stream);
+                }
+            }
+            if (!stream->eof())
+            {
+                // Backpedal back to start of this stream if we've found a non-track
+                stream->skip(-STREAM_OVERHEAD_SIZE);
+            }
+
+        }
+
+
+
+    }
+    //---------------------------------------------------------------------
+    void SkeletonSerializer::readAnimationTrack(DataStreamPtr& stream, Animation* anim, 
+        Skeleton* pSkel)
+    {
+        // unsigned short boneIndex     : Index of bone to apply to
+        unsigned short boneHandle;
+        readShorts(stream, &boneHandle, 1);
+
+        // Find bone
+        Bone *targetBone = pSkel->getBone(boneHandle);
+
+        // Create track
+        NodeAnimationTrack* pTrack = anim->createNodeTrack(boneHandle, targetBone);
+
+        // Keep looking for nested keyframes
+        if (!stream->eof())
+        {
+            unsigned short streamID = readChunk(stream);
+            while(streamID == SKELETON_ANIMATION_TRACK_KEYFRAME && !stream->eof())
+            {
+                readKeyFrame(stream, pTrack, pSkel);
+
+                if (!stream->eof())
+                {
+                    // Get next stream
+                    streamID = readChunk(stream);
+                }
+            }
+            if (!stream->eof())
+            {
+                // Backpedal back to start of this stream if we've found a non-keyframe
+                stream->skip(-STREAM_OVERHEAD_SIZE);
+            }
+
+        }
+
+
+    }
+    //---------------------------------------------------------------------
+    void SkeletonSerializer::readKeyFrame(DataStreamPtr& stream, NodeAnimationTrack* track, 
+        Skeleton* pSkel)
+    {
+        // float time                    : The time position (seconds)
+        float time;
+        readFloats(stream, &time, 1);
+
+        TransformKeyFrame *kf = track->createNodeKeyFrame(time);
+
+        // Quaternion rotate            : Rotation to apply at this keyframe
+        Quaternion rot;
+        readObject(stream, rot);
+        kf->setRotation(rot);
+        // Vector3 translate            : Translation to apply at this keyframe
+        Vector3 trans;
+        readObject(stream, trans);
+        kf->setTranslate(trans);
+        // Do we have scale?
+        if (mCurrentstreamLen > calcKeyFrameSizeWithoutScale(pSkel, kf))
+        {
+            Vector3 scale;
+            readObject(stream, scale);
+            kf->setScale(scale);
+        }
+    }
+	//---------------------------------------------------------------------
+	void SkeletonSerializer::writeSkeletonAnimationLink(const Skeleton* pSkel, 
+		const LinkedSkeletonAnimationSource& link)
+	{
+		writeChunkHeader(SKELETON_ANIMATION_LINK, 
+			calcSkeletonAnimationLinkSize(pSkel, link));
+
+		// char* skeletonName
+		writeString(link.skeletonName);
+		// float scale
+		writeFloats(&(link.scale), 1);
+
+	}
+    //---------------------------------------------------------------------
+	size_t SkeletonSerializer::calcSkeletonAnimationLinkSize(const Skeleton* pSkel, 
+		const LinkedSkeletonAnimationSource& link)
+	{
+		size_t size = STREAM_OVERHEAD_SIZE;
+
+		// char* skeletonName
+		size += link.skeletonName.length() + 1;
+		// float scale
+		size += sizeof(float);
+
+		return size;
+
+	}
+	//---------------------------------------------------------------------
+	void SkeletonSerializer::readSkeletonAnimationLink(DataStreamPtr& stream, 
+		Skeleton* pSkel)
+	{
+		// char* skeletonName
+		String skelName = readString(stream);
+		// float scale
+		float scale;
+		readFloats(stream, &scale, 1);
+
+		pSkel->addLinkedSkeletonAnimationSource(skelName, scale);
+
+	}
+
+
+
+}
+
+
Index: /OgreMain/src/OgreStaticGeometry.cpp
===================================================================
--- /OgreMain/src/OgreStaticGeometry.cpp	(revision 5)
+++ /OgreMain/src/OgreStaticGeometry.cpp	(revision 5)
@@ -0,0 +1,1681 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreStaticGeometry.h"
+#include "OgreEntity.h"
+#include "OgreSubEntity.h"
+#include "OgreSceneNode.h"
+#include "OgreException.h"
+#include "OgreMesh.h"
+#include "OgreSubMesh.h"
+#include "OgreLogManager.h"
+#include "OgreSceneManager.h"
+#include "OgreCamera.h"
+#include "OgreMaterialManager.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreEdgeListBuilder.h"
+
+namespace Ogre {
+
+	#define REGION_RANGE 1024
+	#define REGION_HALF_RANGE 512
+	#define REGION_MAX_INDEX 511
+	#define REGION_MIN_INDEX -512
+
+	//--------------------------------------------------------------------------
+	StaticGeometry::StaticGeometry(SceneManager* owner, const String& name):
+		mOwner(owner),
+		mName(name),
+		mBuilt(false),
+		mUpperDistance(0.0f),
+		mSquaredUpperDistance(0.0f),
+		mCastShadows(false),
+		mRegionDimensions(Vector3(1000,1000,1000)),
+		mHalfRegionDimensions(Vector3(500,500,500)),
+		mOrigin(Vector3(0,0,0)),
+		mVisible(true),
+        mRenderQueueID(RENDER_QUEUE_MAIN),
+        mRenderQueueIDSet(false)
+	{
+	}
+	//--------------------------------------------------------------------------
+	StaticGeometry::~StaticGeometry()
+	{
+		reset();
+	}
+	//--------------------------------------------------------------------------
+	StaticGeometry::Region* StaticGeometry::getRegion(const AxisAlignedBox& bounds,
+		bool autoCreate)
+	{
+		if (bounds.isNull())
+			return 0;
+
+		// Get the region which has the largest overlapping volume
+		const Vector3 min = bounds.getMinimum();
+		const Vector3 max = bounds.getMaximum();
+
+		// Get the min and max region indexes
+		ushort minx, miny, minz;
+		ushort maxx, maxy, maxz;
+		getRegionIndexes(min, minx, miny, minz);
+		getRegionIndexes(max, maxx, maxy, maxz);
+		Real maxVolume = 0.0f;
+		ushort finalx, finaly, finalz;
+		for (ushort x = minx; x <= maxx; ++x)
+		{
+			for (ushort y = miny; y <= maxy; ++y)
+			{
+				for (ushort z = minz; z <= maxz; ++z)
+				{
+					Real vol = getVolumeIntersection(bounds, x, y, z);
+					if (vol > maxVolume)
+					{
+						maxVolume = vol;
+						finalx = x;
+						finaly = y;
+						finalz = z;
+					}
+
+				}
+			}
+		}
+
+		assert(maxVolume > 0.0f &&
+			"Static geometry: Problem determining closest volume match!");
+
+		return getRegion(finalx, finaly, finalz, autoCreate);
+
+	}
+	//--------------------------------------------------------------------------
+	Real StaticGeometry::getVolumeIntersection(const AxisAlignedBox& box,
+		ushort x, ushort y, ushort z)
+	{
+		// Get bounds of indexed region
+		AxisAlignedBox regionBounds = getRegionBounds(x, y, z);
+		AxisAlignedBox intersectBox = regionBounds.intersection(box);
+		// return a 'volume' which ignores zero dimensions
+		// since we only use this for relative comparisons of the same bounds
+		// this will still be internally consistent
+		Vector3 boxdiff = box.getMaximum() - box.getMinimum();
+		Vector3 intersectDiff = intersectBox.getMaximum() - intersectBox.getMinimum();
+
+		return (boxdiff.x == 0 ? 1 : intersectDiff.x) *
+			(boxdiff.y == 0 ? 1 : intersectDiff.y) *
+			(boxdiff.z == 0 ? 1 : intersectDiff.z);
+
+	}
+	//--------------------------------------------------------------------------
+	AxisAlignedBox StaticGeometry::getRegionBounds(ushort x, ushort y, ushort z)
+	{
+		Vector3 min(
+			((Real)x - REGION_HALF_RANGE) * mRegionDimensions.x + mOrigin.x,
+			((Real)y - REGION_HALF_RANGE) * mRegionDimensions.y + mOrigin.y,
+			((Real)z - REGION_HALF_RANGE) * mRegionDimensions.z + mOrigin.z
+			);
+		Vector3 max = min + mRegionDimensions;
+		return AxisAlignedBox(min, max);
+	}
+	//--------------------------------------------------------------------------
+ 	Vector3 StaticGeometry::getRegionCentre(ushort x, ushort y, ushort z)
+	{
+		return Vector3(
+			((Real)x - REGION_HALF_RANGE) * mRegionDimensions.x + mOrigin.x
+				+ mHalfRegionDimensions.x,
+			((Real)y - REGION_HALF_RANGE) * mRegionDimensions.y + mOrigin.y
+				+ mHalfRegionDimensions.y,
+			((Real)z - REGION_HALF_RANGE) * mRegionDimensions.z + mOrigin.z
+				+ mHalfRegionDimensions.z
+			);
+	}
+	//--------------------------------------------------------------------------
+	StaticGeometry::Region* StaticGeometry::getRegion(
+			ushort x, ushort y, ushort z, bool autoCreate)
+	{
+		uint32 index = packIndex(x, y, z);
+		Region* ret = getRegion(index);
+		if (!ret && autoCreate)
+		{
+			// Make a name
+			StringUtil::StrStreamType str;
+			str << mName << ":" << index;
+			// Calculate the region centre
+			Vector3 centre = getRegionCentre(x, y, z);
+			ret = new Region(this, str.str(), mOwner, index, centre);
+			mOwner->injectMovableObject(ret);
+			ret->setVisible(mVisible);
+			ret->setCastShadows(mCastShadows);
+			if (mRenderQueueIDSet)
+			{
+				ret->setRenderQueueGroup(mRenderQueueID);
+			}
+			mRegionMap[index] = ret;
+		}
+		return ret;
+	}
+	//--------------------------------------------------------------------------
+	StaticGeometry::Region* StaticGeometry::getRegion(uint32 index)
+	{
+		RegionMap::iterator i = mRegionMap.find(index);
+		if (i != mRegionMap.end())
+		{
+			return i->second;
+		}
+		else
+		{
+			return 0;
+		}
+
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::getRegionIndexes(const Vector3& point,
+		ushort& x, ushort& y, ushort& z)
+	{
+		// Scale the point into multiples of region and adjust for origin
+		Vector3 scaledPoint = (point - mOrigin) / mRegionDimensions;
+
+		// Round down to 'bottom left' point which represents the cell index
+		int ix = Math::IFloor(scaledPoint.x);
+		int iy = Math::IFloor(scaledPoint.y);
+		int iz = Math::IFloor(scaledPoint.z);
+
+		// Check bounds
+		if (ix < REGION_MIN_INDEX || ix > REGION_MAX_INDEX
+			|| iy < REGION_MIN_INDEX || iy > REGION_MAX_INDEX
+			|| iz < REGION_MIN_INDEX || iz > REGION_MAX_INDEX)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Point out of bounds",
+				"StaticGeometry::getRegionIndexes");
+		}
+		// Adjust for the fact that we use unsigned values for simplicity
+		// (requires less faffing about for negatives give 10-bit packing
+		x = static_cast<ushort>(ix + REGION_HALF_RANGE);
+		y = static_cast<ushort>(iy + REGION_HALF_RANGE);
+		z = static_cast<ushort>(iz + REGION_HALF_RANGE);
+
+
+	}
+	//--------------------------------------------------------------------------
+	uint32 StaticGeometry::packIndex(ushort x, ushort y, ushort z)
+	{
+		return x + (y << 10) + (z << 20);
+	}
+	//--------------------------------------------------------------------------
+	StaticGeometry::Region* StaticGeometry::getRegion(const Vector3& point,
+		bool autoCreate)
+	{
+		ushort x, y, z;
+		getRegionIndexes(point, x, y, z);
+		return getRegion(x, y, z, autoCreate);
+	}
+	//--------------------------------------------------------------------------
+	AxisAlignedBox StaticGeometry::calculateBounds(VertexData* vertexData,
+		const Vector3& position, const Quaternion& orientation,
+		const Vector3& scale)
+	{
+		const VertexElement* posElem =
+			vertexData->vertexDeclaration->findElementBySemantic(
+				VES_POSITION);
+		HardwareVertexBufferSharedPtr vbuf =
+			vertexData->vertexBufferBinding->getBuffer(posElem->getSource());
+		unsigned char* vertex =
+			static_cast<unsigned char*>(
+				vbuf->lock(HardwareBuffer::HBL_READ_ONLY));
+		float* pFloat;
+
+		Vector3 min, max;
+		bool first = true;
+
+		for(size_t j = 0; j < vertexData->vertexCount; ++j, vertex += vbuf->getVertexSize())
+		{
+			posElem->baseVertexPointerToElement(vertex, &pFloat);
+
+			Vector3 pt;
+
+			pt.x = (*pFloat++);
+			pt.y = (*pFloat++);
+			pt.z = (*pFloat++);
+			// Transform to world (scale, rotate, translate)
+			pt = (orientation * (pt * scale)) + position;
+			if (first)
+			{
+				min = max = pt;
+				first = false;
+			}
+			else
+			{
+				min.makeFloor(pt);
+				max.makeCeil(pt);
+			}
+
+		}
+		vbuf->unlock();
+		return AxisAlignedBox(min, max);
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::addEntity(Entity* ent, const Vector3& position,
+		const Quaternion& orientation, const Vector3& scale)
+	{
+		const MeshPtr& msh = ent->getMesh();
+		// Validate
+		if (msh->isLodManual())
+		{
+			LogManager::getSingleton().logMessage(
+				"WARNING (StaticGeometry): Manual LOD is not supported. "
+				"Using only highest LOD level for mesh " + msh->getName());
+		}
+
+		AxisAlignedBox sharedWorldBounds;
+		// queue this entities submeshes and choice of material
+		// also build the lists of geometry to be used for the source of lods
+		for (uint i = 0; i < ent->getNumSubEntities(); ++i)
+		{
+			SubEntity* se = ent->getSubEntity(i);
+			QueuedSubMesh* q = new QueuedSubMesh();
+
+			// Get the geometry for this SubMesh
+			q->submesh = se->getSubMesh();
+			q->geometryLodList = determineGeometry(q->submesh);
+			q->materialName = se->getMaterialName();
+			q->orientation = orientation;
+			q->position = position;
+			q->scale = scale;
+			// Determine the bounds based on the highest LOD
+			q->worldBounds = calculateBounds(
+				(*q->geometryLodList)[0].vertexData,
+					position, orientation, scale);
+
+			mQueuedSubMeshes.push_back(q);
+		}
+	}
+	//--------------------------------------------------------------------------
+	StaticGeometry::SubMeshLodGeometryLinkList*
+	StaticGeometry::determineGeometry(SubMesh* sm)
+	{
+		// First, determine if we've already seen this submesh before
+		SubMeshGeometryLookup::iterator i =
+			mSubMeshGeometryLookup.find(sm);
+		if (i != mSubMeshGeometryLookup.end())
+		{
+			return i->second;
+		}
+		// Otherwise, we have to create a new one
+		SubMeshLodGeometryLinkList* lodList = new SubMeshLodGeometryLinkList();
+		mSubMeshGeometryLookup[sm] = lodList;
+		ushort numLods = sm->parent->isLodManual() ? 1 :
+			sm->parent->getNumLodLevels();
+		lodList->resize(numLods);
+		for (ushort lod = 0; lod < numLods; ++lod)
+		{
+			SubMeshLodGeometryLink& geomLink = (*lodList)[lod];
+			IndexData *lodIndexData;
+			if (lod == 0)
+			{
+				lodIndexData = sm->indexData;
+			}
+			else
+			{
+				lodIndexData = sm->mLodFaceList[lod - 1];
+			}
+			// Can use the original mesh geometry?
+			if (sm->useSharedVertices)
+			{
+				if (sm->parent->getNumSubMeshes() == 1)
+				{
+					// Ok, this is actually our own anyway
+					geomLink.vertexData = sm->parent->sharedVertexData;
+					geomLink.indexData = lodIndexData;
+				}
+				else
+				{
+					// We have to split it
+					splitGeometry(sm->parent->sharedVertexData,
+						lodIndexData, &geomLink);
+				}
+			}
+			else
+			{
+				if (lod == 0)
+				{
+					// Ok, we can use the existing geometry; should be in full
+					// use by just this SubMesh
+					geomLink.vertexData = sm->vertexData;
+					geomLink.indexData = sm->indexData;
+				}
+				else
+				{
+					// We have to split it
+					splitGeometry(sm->vertexData,
+						lodIndexData, &geomLink);
+				}
+			}
+			assert (geomLink.vertexData->vertexStart == 0 &&
+				"Cannot use vertexStart > 0 on indexed geometry due to "
+				"rendersystem incompatibilities - see the docs!");
+		}
+
+
+		return lodList;
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::splitGeometry(VertexData* vd, IndexData* id,
+			StaticGeometry::SubMeshLodGeometryLink* targetGeomLink)
+	{
+		// Firstly we need to scan to see how many vertices are being used
+		// and while we're at it, build the remap we can use later
+		bool use32bitIndexes =
+			id->indexBuffer->getType() == HardwareIndexBuffer::IT_32BIT;
+		uint16 *p16;
+		uint32 *p32;
+		IndexRemap indexRemap;
+		if (use32bitIndexes)
+		{
+			p32 = static_cast<uint32*>(id->indexBuffer->lock(
+				id->indexStart, 
+				id->indexCount * id->indexBuffer->getIndexSize(), 
+				HardwareBuffer::HBL_READ_ONLY));
+			buildIndexRemap(p32, id->indexCount, indexRemap);
+			id->indexBuffer->unlock();
+		}
+		else
+		{
+			p16 = static_cast<uint16*>(id->indexBuffer->lock(
+				id->indexStart, 
+				id->indexCount * id->indexBuffer->getIndexSize(), 
+				HardwareBuffer::HBL_READ_ONLY));
+			buildIndexRemap(p16, id->indexCount, indexRemap);
+			id->indexBuffer->unlock();
+		}
+		if (indexRemap.size() == vd->vertexCount)
+		{
+			// ha, complete usage after all
+			targetGeomLink->vertexData = vd;
+			targetGeomLink->indexData = id;
+			return;
+		}
+
+
+		// Create the new vertex data records
+		targetGeomLink->vertexData = vd->clone(false);
+		// Convenience
+		VertexData* newvd = targetGeomLink->vertexData;
+		//IndexData* newid = targetGeomLink->indexData;
+		// Update the vertex count
+		newvd->vertexCount = indexRemap.size();
+
+		size_t numvbufs = vd->vertexBufferBinding->getBufferCount();
+		// Copy buffers from old to new
+		for (unsigned short b = 0; b < numvbufs; ++b)
+		{
+			// Lock old buffer
+			HardwareVertexBufferSharedPtr oldBuf =
+				vd->vertexBufferBinding->getBuffer(b);
+			// Create new buffer
+			HardwareVertexBufferSharedPtr newBuf =
+				HardwareBufferManager::getSingleton().createVertexBuffer(
+					oldBuf->getVertexSize(),
+					indexRemap.size(),
+					HardwareBuffer::HBU_STATIC);
+			// rebind
+			newvd->vertexBufferBinding->setBinding(b, newBuf);
+
+			// Copy all the elements of the buffer across, by iterating over
+			// the IndexRemap which describes how to move the old vertices
+			// to the new ones. By nature of the map the remap is in order of
+			// indexes in the old buffer, but note that we're not guaranteed to
+			// address every vertex (which is kinda why we're here)
+			uchar* pSrcBase = static_cast<uchar*>(
+				oldBuf->lock(HardwareBuffer::HBL_READ_ONLY));
+			uchar* pDstBase = static_cast<uchar*>(
+				newBuf->lock(HardwareBuffer::HBL_DISCARD));
+			size_t vertexSize = oldBuf->getVertexSize();
+			// Buffers should be the same size
+			assert (vertexSize == newBuf->getVertexSize());
+
+			for (IndexRemap::iterator r = indexRemap.begin();
+				r != indexRemap.end(); ++r)
+			{
+				assert (r->first < oldBuf->getNumVertices());
+				assert (r->second < newBuf->getNumVertices());
+
+				uchar* pSrc = pSrcBase + r->first * vertexSize;
+				uchar* pDst = pDstBase + r->second * vertexSize;
+				memcpy(pDst, pSrc, vertexSize);
+			}
+			// unlock
+			oldBuf->unlock();
+			newBuf->unlock();
+
+		}
+
+		// Now create a new index buffer
+		HardwareIndexBufferSharedPtr ibuf =
+			HardwareBufferManager::getSingleton().createIndexBuffer(
+				id->indexBuffer->getType(), id->indexCount,
+				HardwareBuffer::HBU_STATIC);
+
+		if (use32bitIndexes)
+		{
+			uint32 *pSrc32, *pDst32;
+			pSrc32 = static_cast<uint32*>(id->indexBuffer->lock(
+				id->indexStart, 
+				id->indexCount * id->indexBuffer->getIndexSize(), 
+				HardwareBuffer::HBL_READ_ONLY));
+			pDst32 = static_cast<uint32*>(ibuf->lock(
+				HardwareBuffer::HBL_DISCARD));
+			remapIndexes(pSrc32, pDst32, indexRemap, id->indexCount);
+			id->indexBuffer->unlock();
+			ibuf->unlock();
+		}
+		else
+		{
+			uint16 *pSrc16, *pDst16;
+			pSrc16 = static_cast<uint16*>(id->indexBuffer->lock(
+				id->indexStart, 
+				id->indexCount * id->indexBuffer->getIndexSize(), 
+				HardwareBuffer::HBL_READ_ONLY));
+			pDst16 = static_cast<uint16*>(ibuf->lock(
+				HardwareBuffer::HBL_DISCARD));
+			remapIndexes(pSrc16, pDst16, indexRemap, id->indexCount);
+			id->indexBuffer->unlock();
+			ibuf->unlock();
+		}
+
+		targetGeomLink->indexData = new IndexData();
+		targetGeomLink->indexData->indexStart = 0;
+		targetGeomLink->indexData->indexCount = id->indexCount;
+		targetGeomLink->indexData->indexBuffer = ibuf;
+
+		// Store optimised geometry for deallocation later
+		OptimisedSubMeshGeometry *optGeom = new OptimisedSubMeshGeometry();
+		optGeom->indexData = targetGeomLink->indexData;
+		optGeom->vertexData = targetGeomLink->vertexData;
+		mOptimisedSubMeshGeometryList.push_back(optGeom);
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::addSceneNode(const SceneNode* node)
+	{
+		SceneNode::ConstObjectIterator obji = node->getAttachedObjectIterator();
+		while (obji.hasMoreElements())
+		{
+			MovableObject* mobj = obji.getNext();
+			if (mobj->getMovableType() == "Entity")
+			{
+				addEntity(static_cast<Entity*>(mobj),
+					node->_getDerivedPosition(),
+					node->_getDerivedOrientation(),
+					node->_getDerivedScale());
+			}
+		}
+		// Iterate through all the child-nodes
+		SceneNode::ConstChildNodeIterator nodei = node->getChildIterator();
+
+		while (nodei.hasMoreElements())
+		{
+			const SceneNode* node = static_cast<const SceneNode*>(nodei.getNext());
+			// Add this subnode and its children...
+			addSceneNode( node );
+		}
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::build(void)
+	{
+		// Make sure there's nothing from previous builds
+		destroy();
+
+		// Firstly allocate meshes to regions
+		for (QueuedSubMeshList::iterator qi = mQueuedSubMeshes.begin();
+			qi != mQueuedSubMeshes.end(); ++qi)
+		{
+			QueuedSubMesh* qsm = *qi;
+			Region* region = getRegion(qsm->worldBounds, true);
+			region->assign(qsm);
+		}
+		bool stencilShadows = false;
+		if (mCastShadows && mOwner->isShadowTechniqueStencilBased())
+		{
+			stencilShadows = true;
+		}
+
+		// Now tell each region to build itself
+		for (RegionMap::iterator ri = mRegionMap.begin();
+			ri != mRegionMap.end(); ++ri)
+		{
+			ri->second->build(stencilShadows);
+		}
+
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::destroy(void)
+	{
+		// delete the regions
+		for (RegionMap::iterator i = mRegionMap.begin();
+			i != mRegionMap.end(); ++i)
+		{
+			mOwner->extractMovableObject(i->second);
+			delete i->second;
+		}
+		mRegionMap.clear();
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::reset(void)
+	{
+		destroy();
+		for (QueuedSubMeshList::iterator i = mQueuedSubMeshes.begin();
+			i != mQueuedSubMeshes.end(); ++i)
+		{
+			delete *i;
+		}
+		mQueuedSubMeshes.clear();
+		// Delete precached geoemtry lists
+		for (SubMeshGeometryLookup::iterator l = mSubMeshGeometryLookup.begin();
+			l != mSubMeshGeometryLookup.end(); ++l)
+		{
+			delete l->second;
+		}
+		mSubMeshGeometryLookup.clear();
+		// Delete optimised geometry
+		for (OptimisedSubMeshGeometryList::iterator o = mOptimisedSubMeshGeometryList.begin();
+			o != mOptimisedSubMeshGeometryList.end(); ++o)
+		{
+			delete *o;
+		}
+		mOptimisedSubMeshGeometryList.clear();
+
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::setVisible(bool visible)
+	{
+		mVisible = visible;
+		// tell any existing regions
+		for (RegionMap::iterator ri = mRegionMap.begin();
+			ri != mRegionMap.end(); ++ri)
+		{
+			ri->second->setVisible(visible);
+		}
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::setCastShadows(bool castShadows)
+	{
+		mCastShadows = castShadows;
+		// tell any existing regions
+		for (RegionMap::iterator ri = mRegionMap.begin();
+			ri != mRegionMap.end(); ++ri)
+		{
+			ri->second->setCastShadows(castShadows);
+		}
+
+	}
+	//--------------------------------------------------------------------------
+    void StaticGeometry::setRenderQueueGroup(uint8 queueID)
+	{
+		assert(queueID <= RENDER_QUEUE_MAX && "Render queue out of range!");
+		mRenderQueueIDSet = true;
+		mRenderQueueID = queueID;
+		// tell any existing regions
+		for (RegionMap::iterator ri = mRegionMap.begin();
+			ri != mRegionMap.end(); ++ri)
+		{
+			ri->second->setRenderQueueGroup(queueID);
+		}
+	}
+	//--------------------------------------------------------------------------
+	uint8 StaticGeometry::getRenderQueueGroup(void) const
+	{
+		return mRenderQueueID;
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::dump(const String& filename) const
+	{
+		std::ofstream of(filename.c_str());
+		of << "Static Geometry Report for " << mName << std::endl;
+		of << "-------------------------------------------------" << std::endl;
+		of << "Number of queued submeshes: " << mQueuedSubMeshes.size() << std::endl;
+		of << "Number of regions: " << mRegionMap.size() << std::endl;
+		of << "Region dimensions: " << mRegionDimensions << std::endl;
+		of << "Origin: " << mOrigin << std::endl;
+		of << "Max distance: " << mUpperDistance << std::endl;
+		of << "Casts shadows?: " << mCastShadows << std::endl;
+		of << std::endl;
+		for (RegionMap::const_iterator ri = mRegionMap.begin();
+			ri != mRegionMap.end(); ++ri)
+		{
+			ri->second->dump(of);
+		}
+		of << "-------------------------------------------------" << std::endl;
+	}
+	//--------------------------------------------------------------------------
+	StaticGeometry::RegionIterator StaticGeometry::getRegionIterator(void)
+	{
+		return RegionIterator(mRegionMap.begin(), mRegionMap.end());
+	}
+	//--------------------------------------------------------------------------
+	//--------------------------------------------------------------------------
+	StaticGeometry::Region::Region(StaticGeometry* parent, const String& name,
+		SceneManager* mgr, uint32 regionID, const Vector3& centre)
+		: MovableObject(name), mParent(parent), mSceneMgr(mgr), mNode(0),
+		mRegionID(regionID), mCentre(centre), mBoundingRadius(0.0f),
+		mCurrentLod(0), mEdgeList(0), mVertexProgramInUse(false)
+	{
+		// First LOD mandatory, and always from 0
+		mLodSquaredDistances.push_back(0.0f);
+	}
+	//--------------------------------------------------------------------------
+	StaticGeometry::Region::~Region()
+	{
+		if (mNode)
+		{
+			mNode->getParentSceneNode()->removeChild(mNode);
+			mSceneMgr->destroySceneNode(mNode->getName());
+			mNode = 0;
+		}
+		// delete
+		for (LODBucketList::iterator i = mLodBucketList.begin();
+			i != mLodBucketList.end(); ++i)
+		{
+			delete *i;
+		}
+		mLodBucketList.clear();
+
+		for (ShadowRenderableList::iterator s = mShadowRenderables.begin();
+			s != mShadowRenderables.end(); ++s)
+		{
+			delete *s;
+		}
+		mShadowRenderables.clear();
+		delete mEdgeList;
+
+		// no need to delete queued meshes, these are managed in StaticGeometry
+
+	}
+	//--------------------------------------------------------------------------
+	uint32 StaticGeometry::Region::getTypeFlags(void) const
+	{
+		return SceneManager::STATICGEOMETRY_TYPE_MASK;
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::Region::assign(QueuedSubMesh* qmesh)
+	{
+		mQueuedSubMeshes.push_back(qmesh);
+		// update lod distances
+		ushort lodLevels = qmesh->submesh->parent->getNumLodLevels();
+		assert(qmesh->geometryLodList->size() == lodLevels);
+
+		while(mLodSquaredDistances.size() < lodLevels)
+		{
+			mLodSquaredDistances.push_back(0.0f);
+		}
+		// Make sure LOD levels are max of all at the requested level
+		for (ushort lod = 1; lod < lodLevels; ++lod)
+		{
+			const MeshLodUsage& meshLod =
+				qmesh->submesh->parent->getLodLevel(lod);
+			mLodSquaredDistances[lod] = std::max(mLodSquaredDistances[lod],
+				meshLod.fromDepthSquared);
+		}
+
+		// update bounds
+		// Transform world bounds relative to our centre
+		AxisAlignedBox localBounds(
+			qmesh->worldBounds.getMinimum() - mCentre,
+			qmesh->worldBounds.getMaximum() - mCentre);
+		mAABB.merge(localBounds);
+		mBoundingRadius = std::max(mBoundingRadius, localBounds.getMinimum().length());
+		mBoundingRadius = std::max(mBoundingRadius, localBounds.getMaximum().length());
+
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::Region::build(bool stencilShadows)
+	{
+		// Create a node
+		mNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(mName,
+			mCentre);
+		mNode->attachObject(this);
+		// We need to create enough LOD buckets to deal with the highest LOD
+		// we encountered in all the meshes queued
+		for (ushort lod = 0; lod < mLodSquaredDistances.size(); ++lod)
+		{
+			LODBucket* lodBucket =
+				new LODBucket(this, lod, mLodSquaredDistances[lod]);
+			mLodBucketList.push_back(lodBucket);
+			// Now iterate over the meshes and assign to LODs
+			// LOD bucket will pick the right LOD to use
+			QueuedSubMeshList::iterator qi, qiend;
+			qiend = mQueuedSubMeshes.end();
+			for (qi = mQueuedSubMeshes.begin(); qi != qiend; ++qi)
+			{
+				lodBucket->assign(*qi, lod);
+			}
+			// now build
+			lodBucket->build(stencilShadows);
+		}
+
+		// Do we need to build an edge list?
+		if (stencilShadows)
+		{
+			EdgeListBuilder eb;
+			size_t vertexSet = 0;
+			LODIterator lodIterator = getLODIterator();
+			while (lodIterator.hasMoreElements())
+			{
+				LODBucket* lod = lodIterator.getNext();
+				LODBucket::MaterialIterator matIt = lod->getMaterialIterator();
+				while (matIt.hasMoreElements())
+				{
+					MaterialBucket* mat = matIt.getNext();
+					MaterialBucket::GeometryIterator geomIt =
+						mat->getGeometryIterator();
+					// Check if we have vertex programs here
+					Technique* t = mat->getMaterial()->getBestTechnique();
+					if (t)
+					{
+						Pass* p = t->getPass(0);
+						if (p)
+						{
+							if (p->hasVertexProgram())
+							{
+								mVertexProgramInUse = true;
+							}
+						}
+					}
+
+					while (geomIt.hasMoreElements())
+					{
+						GeometryBucket* geom = geomIt.getNext();
+
+						// Check we're dealing with 16-bit indexes here
+						// Since stencil shadows can only deal with 16-bit
+						// More than that and stencil is probably too CPU-heavy
+						// in any case
+						assert(geom->getIndexData()->indexBuffer->getType()
+							== HardwareIndexBuffer::IT_16BIT &&
+							"Only 16-bit indexes allowed when using stencil shadows");
+						eb.addVertexData(geom->getVertexData());
+						eb.addIndexData(geom->getIndexData(), vertexSet++);
+					}
+				}
+			}
+			mEdgeList = eb.build();
+
+		}
+
+
+	}
+	//--------------------------------------------------------------------------
+	const String& StaticGeometry::Region::getMovableType(void) const
+	{
+		static String sType = "StaticGeometry";
+		return sType;
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::Region::_notifyCurrentCamera(Camera* cam)
+	{
+		// Calculate squared view depth
+		Vector3 diff = cam->getDerivedPosition() - mCentre;
+		Real squaredDepth = diff.squaredLength();
+
+		// Determine whether to still render
+		Real renderingDist = mParent->getRenderingDistance();
+		if (renderingDist > 0)
+		{
+			// Max distance to still render
+			Real maxDist = renderingDist + mBoundingRadius;
+			if (squaredDepth > Math::Sqr(maxDist))
+			{
+				mBeyondFarDistance = true;
+				return;
+			}
+		}
+
+		mBeyondFarDistance = false;
+
+		// Distance from the edge of the bounding sphere
+		mCamDistanceSquared = squaredDepth - mBoundingRadius * mBoundingRadius;
+		// Clamp to 0
+		mCamDistanceSquared = std::max(static_cast<Real>(0.0), mCamDistanceSquared);
+
+		// Determine active lod
+		mCurrentLod = static_cast<ushort>(mLodSquaredDistances.size() - 1);
+		for (ushort i = 0; i < mLodSquaredDistances.size(); ++i)
+		{
+			if (mLodSquaredDistances[i] > mCamDistanceSquared)
+			{
+				mCurrentLod = i - 1;
+				break;
+			}
+		}
+
+	}
+	//--------------------------------------------------------------------------
+	const AxisAlignedBox& StaticGeometry::Region::getBoundingBox(void) const
+	{
+		return mAABB;
+	}
+	//--------------------------------------------------------------------------
+	Real StaticGeometry::Region::getBoundingRadius(void) const
+	{
+		return mBoundingRadius;
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::Region::_updateRenderQueue(RenderQueue* queue)
+	{
+		mLodBucketList[mCurrentLod]->addRenderables(queue, mRenderQueueID,
+			mCamDistanceSquared);
+	}
+	//--------------------------------------------------------------------------
+	bool StaticGeometry::Region::isVisible(void) const
+	{
+		return mVisible && !mBeyondFarDistance;
+	}
+	//--------------------------------------------------------------------------
+	StaticGeometry::Region::LODIterator
+	StaticGeometry::Region::getLODIterator(void)
+	{
+		return LODIterator(mLodBucketList.begin(), mLodBucketList.end());
+	}
+	//--------------------------------------------------------------------------
+	ShadowCaster::ShadowRenderableListIterator
+	StaticGeometry::Region::getShadowVolumeRenderableIterator(
+		ShadowTechnique shadowTechnique, const Light* light,
+		HardwareIndexBufferSharedPtr* indexBuffer,
+		bool extrude, Real extrusionDistance, unsigned long flags)
+	{
+
+		assert(indexBuffer && "Only external index buffers are supported right now");
+		assert((*indexBuffer)->getType() == HardwareIndexBuffer::IT_16BIT &&
+			"Only 16-bit indexes supported for now");
+
+		// Calculate the object space light details
+		Vector4 lightPos = light->getAs4DVector();
+		Matrix4 world2Obj = mParentNode->_getFullTransform().inverseAffine();
+		lightPos = world2Obj.transformAffine(lightPos);
+
+		// We need to search the edge list for silhouette edges
+		if (!mEdgeList)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"You enabled stencil shadows after the buid process!",
+				"StaticGeometry::Region::getShadowVolumeRenderableIterator");
+		}
+
+		// Init shadow renderable list if required
+		bool init = mShadowRenderables.empty();
+
+		EdgeData::EdgeGroupList::iterator egi;
+		ShadowRenderableList::iterator si, siend;
+		RegionShadowRenderable* esr = 0;
+		if (init)
+			mShadowRenderables.resize(mEdgeList->edgeGroups.size());
+
+		//bool updatedSharedGeomNormals = false;
+		siend = mShadowRenderables.end();
+		egi = mEdgeList->edgeGroups.begin();
+		for (si = mShadowRenderables.begin(); si != siend; ++si, ++egi)
+		{
+			if (init)
+			{
+				// Create a new renderable, create a separate light cap if
+				// we're using a vertex program (either for this model, or
+				// for extruding the shadow volume) since otherwise we can
+				// get depth-fighting on the light cap
+
+				*si = new RegionShadowRenderable(this, indexBuffer,
+					egi->vertexData, mVertexProgramInUse || !extrude);
+			}
+			// Get shadow renderable
+			esr = static_cast<RegionShadowRenderable*>(*si);
+			HardwareVertexBufferSharedPtr esrPositionBuffer = esr->getPositionBuffer();
+			// Extrude vertices in software if required
+			if (extrude)
+			{
+				extrudeVertices(esrPositionBuffer,
+					egi->vertexData->vertexCount,
+					lightPos, extrusionDistance);
+
+			}
+
+		}
+		// Calc triangle light facing
+		updateEdgeListLightFacing(mEdgeList, lightPos);
+
+		// Generate indexes and update renderables
+		generateShadowVolume(mEdgeList, *indexBuffer, light,
+			mShadowRenderables, flags);
+
+
+		return ShadowRenderableListIterator(mShadowRenderables.begin(), mShadowRenderables.end());
+
+
+	}
+	//--------------------------------------------------------------------------
+	EdgeData* StaticGeometry::Region::getEdgeList(void)
+	{
+		return mEdgeList;
+	}
+	//--------------------------------------------------------------------------
+	bool StaticGeometry::Region::hasEdgeList(void)
+	{
+		return mEdgeList != 0;
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::Region::dump(std::ofstream& of) const
+	{
+		of << "Region " << mRegionID << std::endl;
+		of << "--------------------------" << std::endl;
+		of << "Centre: " << mCentre << std::endl;
+		of << "Local AABB: " << mAABB << std::endl;
+		of << "Bounding radius: " << mBoundingRadius << std::endl;
+		of << "Number of LODs: " << mLodBucketList.size() << std::endl;
+
+		for (LODBucketList::const_iterator i = mLodBucketList.begin();
+			i != mLodBucketList.end(); ++i)
+		{
+			(*i)->dump(of);
+		}
+		of << "--------------------------" << std::endl;
+	}
+	//--------------------------------------------------------------------------
+	//--------------------------------------------------------------------------
+	StaticGeometry::Region::RegionShadowRenderable::RegionShadowRenderable(
+		Region* parent, HardwareIndexBufferSharedPtr* indexBuffer,
+		const VertexData* vertexData, bool createSeparateLightCap,
+		bool isLightCap)
+		: mParent(parent)
+	{
+		// Initialise render op
+		mRenderOp.indexData = new IndexData();
+		mRenderOp.indexData->indexBuffer = *indexBuffer;
+		mRenderOp.indexData->indexStart = 0;
+		// index start and count are sorted out later
+
+		// Create vertex data which just references position component (and 2 component)
+		mRenderOp.vertexData = new VertexData();
+		// Map in position data
+		mRenderOp.vertexData->vertexDeclaration->addElement(0,0,VET_FLOAT3, VES_POSITION);
+		ushort origPosBind =
+			vertexData->vertexDeclaration->findElementBySemantic(VES_POSITION)->getSource();
+		mPositionBuffer = vertexData->vertexBufferBinding->getBuffer(origPosBind);
+		mRenderOp.vertexData->vertexBufferBinding->setBinding(0, mPositionBuffer);
+		// Map in w-coord buffer (if present)
+		if(!vertexData->hardwareShadowVolWBuffer.isNull())
+		{
+			mRenderOp.vertexData->vertexDeclaration->addElement(1,0,VET_FLOAT1, VES_TEXTURE_COORDINATES, 0);
+			mWBuffer = vertexData->hardwareShadowVolWBuffer;
+			mRenderOp.vertexData->vertexBufferBinding->setBinding(1, mWBuffer);
+		}
+		// Use same vertex start as input
+		mRenderOp.vertexData->vertexStart = vertexData->vertexStart;
+
+		if (isLightCap)
+		{
+			// Use original vertex count, no extrusion
+			mRenderOp.vertexData->vertexCount = vertexData->vertexCount;
+		}
+		else
+		{
+			// Vertex count must take into account the doubling of the buffer,
+			// because second half of the buffer is the extruded copy
+			mRenderOp.vertexData->vertexCount =
+				vertexData->vertexCount * 2;
+			if (createSeparateLightCap)
+			{
+				// Create child light cap
+				mLightCap = new RegionShadowRenderable(parent,
+					indexBuffer, vertexData, false, true);
+			}
+		}
+	}
+	//--------------------------------------------------------------------------
+	StaticGeometry::Region::RegionShadowRenderable::~RegionShadowRenderable()
+	{
+		delete mRenderOp.indexData;
+		delete mRenderOp.vertexData;
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::Region::RegionShadowRenderable::getWorldTransforms(
+		Matrix4* xform) const
+	{
+		// pretransformed
+		*xform = mParent->_getParentNodeFullTransform();
+	}
+	//--------------------------------------------------------------------------
+	const Quaternion&
+	StaticGeometry::Region::RegionShadowRenderable::getWorldOrientation(void) const
+	{
+		return mParent->getParentNode()->_getDerivedOrientation();
+	}
+	//--------------------------------------------------------------------------
+	const Vector3&
+	StaticGeometry::Region::RegionShadowRenderable::getWorldPosition(void) const
+	{
+		return mParent->getCentre();
+	}
+	//--------------------------------------------------------------------------
+	//--------------------------------------------------------------------------
+	StaticGeometry::LODBucket::LODBucket(Region* parent, unsigned short lod,
+		Real lodDist)
+		: mParent(parent), mLod(lod), mSquaredDistance(lodDist)
+	{
+	}
+	//--------------------------------------------------------------------------
+	StaticGeometry::LODBucket::~LODBucket()
+	{
+		// delete
+		for (MaterialBucketMap::iterator i = mMaterialBucketMap.begin();
+			i != mMaterialBucketMap.end(); ++i)
+		{
+			delete i->second;
+		}
+		mMaterialBucketMap.clear();
+		for(QueuedGeometryList::iterator qi = mQueuedGeometryList.begin();
+			qi != mQueuedGeometryList.end(); ++qi)
+		{
+			delete *qi;
+		}
+		mQueuedGeometryList.clear();
+
+		// no need to delete queued meshes, these are managed in StaticGeometry
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::LODBucket::assign(QueuedSubMesh* qmesh, ushort atLod)
+	{
+		QueuedGeometry* q = new QueuedGeometry();
+		mQueuedGeometryList.push_back(q);
+		q->position = qmesh->position;
+		q->orientation = qmesh->orientation;
+		q->scale = qmesh->scale;
+		if (qmesh->geometryLodList->size() > atLod)
+		{
+			// This submesh has enough lods, use the right one
+			q->geometry = &(*qmesh->geometryLodList)[atLod];
+		}
+		else
+		{
+			// Not enough lods, use the lowest one we have
+			q->geometry =
+				&(*qmesh->geometryLodList)[qmesh->geometryLodList->size() - 1];
+		}
+		// Locate a material bucket
+		MaterialBucket* mbucket = 0;
+		MaterialBucketMap::iterator m =
+			mMaterialBucketMap.find(qmesh->materialName);
+		if (m != mMaterialBucketMap.end())
+		{
+			mbucket = m->second;
+		}
+		else
+		{
+			mbucket = new MaterialBucket(this, qmesh->materialName);
+			mMaterialBucketMap[qmesh->materialName] = mbucket;
+		}
+		mbucket->assign(q);
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::LODBucket::build(bool stencilShadows)
+	{
+		// Just pass this on to child buckets
+		for (MaterialBucketMap::iterator i = mMaterialBucketMap.begin();
+			i != mMaterialBucketMap.end(); ++i)
+		{
+			i->second->build(stencilShadows);
+		}
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::LODBucket::addRenderables(RenderQueue* queue,
+		uint8 group, Real camDistanceSquared)
+	{
+		// Just pass this on to child buckets
+		MaterialBucketMap::iterator i, iend;
+		iend =  mMaterialBucketMap.end();
+		for (i = mMaterialBucketMap.begin(); i != iend; ++i)
+		{
+			i->second->addRenderables(queue, group, camDistanceSquared);
+		}
+	}
+	//--------------------------------------------------------------------------
+	StaticGeometry::LODBucket::MaterialIterator
+	StaticGeometry::LODBucket::getMaterialIterator(void)
+	{
+		return MaterialIterator(
+			mMaterialBucketMap.begin(), mMaterialBucketMap.end());
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::LODBucket::dump(std::ofstream& of) const
+	{
+		of << "LOD Bucket " << mLod << std::endl;
+		of << "------------------" << std::endl;
+		of << "Distance: " << Math::Sqrt(mSquaredDistance) << std::endl;
+		of << "Number of Materials: " << mMaterialBucketMap.size() << std::endl;
+		for (MaterialBucketMap::const_iterator i = mMaterialBucketMap.begin();
+			i != mMaterialBucketMap.end(); ++i)
+		{
+			i->second->dump(of);
+		}
+		of << "------------------" << std::endl;
+
+	}
+	//--------------------------------------------------------------------------
+	//--------------------------------------------------------------------------
+	StaticGeometry::MaterialBucket::MaterialBucket(LODBucket* parent,
+		const String& materialName)
+		: mParent(parent), mMaterialName(materialName)
+	{
+	}
+	//--------------------------------------------------------------------------
+	StaticGeometry::MaterialBucket::~MaterialBucket()
+	{
+		// delete
+		for (GeometryBucketList::iterator i = mGeometryBucketList.begin();
+			i != mGeometryBucketList.end(); ++i)
+		{
+			delete *i;
+		}
+		mGeometryBucketList.clear();
+
+		// no need to delete queued meshes, these are managed in StaticGeometry
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::MaterialBucket::assign(QueuedGeometry* qgeom)
+	{
+		// Look up any current geometry
+		String formatString = getGeometryFormatString(qgeom->geometry);
+		CurrentGeometryMap::iterator gi = mCurrentGeometryMap.find(formatString);
+		bool newBucket = true;
+		if (gi != mCurrentGeometryMap.end())
+		{
+			// Found existing geometry, try to assign
+			newBucket = !gi->second->assign(qgeom);
+			// Note that this bucket will be replaced as the 'current'
+			// for this format string below since it's out of space
+		}
+		// Do we need to create a new one?
+		if (newBucket)
+		{
+			GeometryBucket* gbucket = new GeometryBucket(this, formatString,
+				qgeom->geometry->vertexData, qgeom->geometry->indexData);
+			// Add to main list
+			mGeometryBucketList.push_back(gbucket);
+			// Also index in 'current' list
+			mCurrentGeometryMap[formatString] = gbucket;
+			if (!gbucket->assign(qgeom))
+			{
+				OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR,
+					"Somehow we couldn't fit the requested geometry even in a "
+					"brand new GeometryBucket!! Must be a bug, please report.",
+					"StaticGeometry::MaterialBucket::assign");
+			}
+		}
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::MaterialBucket::build(bool stencilShadows)
+	{
+		mMaterial = MaterialManager::getSingleton().getByName(mMaterialName);
+		if (mMaterial.isNull())
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+				"Material '" + mMaterialName + "' not found.",
+				"StaticGeometry::MaterialBucket::build");
+		}
+		mMaterial->load();
+		// tell the geometry buckets to build
+		for (GeometryBucketList::iterator i = mGeometryBucketList.begin();
+			i != mGeometryBucketList.end(); ++i)
+		{
+			(*i)->build(stencilShadows);
+		}
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::MaterialBucket::addRenderables(RenderQueue* queue,
+		uint8 group, Real camDistanceSquared)
+	{
+		// Determine the current material technique
+		mTechnique = mMaterial->getBestTechnique(
+			mMaterial->getLodIndexSquaredDepth(camDistanceSquared));
+
+		GeometryBucketList::iterator i, iend;
+		iend =  mGeometryBucketList.end();
+		for (i = mGeometryBucketList.begin(); i != iend; ++i)
+		{
+			queue->addRenderable(*i, group);
+		}
+
+	}
+	//--------------------------------------------------------------------------
+	String StaticGeometry::MaterialBucket::getGeometryFormatString(
+		SubMeshLodGeometryLink* geom)
+	{
+		// Formulate an identifying string for the geometry format
+		// Must take into account the vertex declaration and the index type
+		// Format is (all lines separated by '|'):
+		// Index type
+		// Vertex element (repeating)
+		//   source
+		//   semantic
+		//   type
+		StringUtil::StrStreamType str;
+
+		str << geom->indexData->indexBuffer->getType() << "|";
+		const VertexDeclaration::VertexElementList& elemList =
+			geom->vertexData->vertexDeclaration->getElements();
+		VertexDeclaration::VertexElementList::const_iterator ei, eiend;
+		eiend = elemList.end();
+		for (ei = elemList.begin(); ei != eiend; ++ei)
+		{
+			const VertexElement& elem = *ei;
+			str << elem.getSource() << "|";
+			str << elem.getSource() << "|";
+			str << elem.getSemantic() << "|";
+			str << elem.getType() << "|";
+		}
+
+		return str.str();
+
+	}
+	//--------------------------------------------------------------------------
+	StaticGeometry::MaterialBucket::GeometryIterator
+	StaticGeometry::MaterialBucket::getGeometryIterator(void)
+	{
+		return GeometryIterator(
+			mGeometryBucketList.begin(), mGeometryBucketList.end());
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::MaterialBucket::dump(std::ofstream& of) const
+	{
+		of << "Material Bucket " << mMaterialName << std::endl;
+		of << "--------------------------------------------------" << std::endl;
+		of << "Geometry buckets: " << mGeometryBucketList.size() << std::endl;
+		for (GeometryBucketList::const_iterator i = mGeometryBucketList.begin();
+			i != mGeometryBucketList.end(); ++i)
+		{
+			(*i)->dump(of);
+		}
+		of << "--------------------------------------------------" << std::endl;
+
+	}
+	//--------------------------------------------------------------------------
+	//--------------------------------------------------------------------------
+	StaticGeometry::GeometryBucket::GeometryBucket(MaterialBucket* parent,
+		const String& formatString, const VertexData* vData,
+		const IndexData* iData)
+		: Renderable(), mParent(parent), mFormatString(formatString)
+	{
+		// Clone the structure from the example
+		mVertexData = vData->clone(false);
+		mIndexData = iData->clone(false);
+		mVertexData->vertexCount = 0;
+		mVertexData->vertexStart = 0;
+		mIndexData->indexCount = 0;
+		mIndexData->indexStart = 0;
+		mIndexType = iData->indexBuffer->getType();
+		// Derive the max vertices
+		if (mIndexType == HardwareIndexBuffer::IT_32BIT)
+		{
+			mMaxVertexIndex = 0xFFFFFFFF;
+		}
+		else
+		{
+			mMaxVertexIndex = 0xFFFF;
+		}
+
+		// Check to see if we have blend indices / blend weights
+		// remove them if so, they can try to blend non-existent bones!
+		const VertexElement* blendIndices =
+			mVertexData->vertexDeclaration->findElementBySemantic(VES_BLEND_INDICES);
+		const VertexElement* blendWeights =
+			mVertexData->vertexDeclaration->findElementBySemantic(VES_BLEND_WEIGHTS);
+		if (blendIndices && blendWeights)
+		{
+			assert(blendIndices->getSource() == blendWeights->getSource()
+				&& "Blend indices and weights should be in the same buffer");
+			// Get the source
+			ushort source = blendIndices->getSource();
+			assert(blendIndices->getSize() + blendWeights->getSize() ==
+				mVertexData->vertexBufferBinding->getBuffer(source)->getVertexSize()
+				&& "Blend indices and blend buffers should have buffer to themselves!");
+			// Unset the buffer
+			mVertexData->vertexBufferBinding->unsetBinding(source);
+			// Remove the elements
+			mVertexData->vertexDeclaration->removeElement(VES_BLEND_INDICES);
+			mVertexData->vertexDeclaration->removeElement(VES_BLEND_WEIGHTS);
+            // Close gaps in bindings for effective and safely
+            mVertexData->closeGapsInBindings();
+		}
+
+
+	}
+	//--------------------------------------------------------------------------
+	StaticGeometry::GeometryBucket::~GeometryBucket()
+	{
+		delete mVertexData;
+		delete mIndexData;
+	}
+	//--------------------------------------------------------------------------
+	const MaterialPtr& StaticGeometry::GeometryBucket::getMaterial(void) const
+	{
+		return mParent->getMaterial();
+	}
+	//--------------------------------------------------------------------------
+	Technique* StaticGeometry::GeometryBucket::getTechnique(void) const
+	{
+		return mParent->getCurrentTechnique();
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::GeometryBucket::getRenderOperation(RenderOperation& op)
+	{
+		op.indexData = mIndexData;
+		op.operationType = RenderOperation::OT_TRIANGLE_LIST;
+		op.srcRenderable = this;
+		op.useIndexes = true;
+		op.vertexData = mVertexData;
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::GeometryBucket::getWorldTransforms(Matrix4* xform) const
+	{
+		// Should be the identity transform, but lets allow transformation of the
+		// nodes the regions are attached to for kicks
+		*xform = mParent->getParent()->getParent()->_getParentNodeFullTransform();
+	}
+	//--------------------------------------------------------------------------
+	const Quaternion& StaticGeometry::GeometryBucket::getWorldOrientation(void) const
+	{
+		return Quaternion::IDENTITY;
+	}
+	//--------------------------------------------------------------------------
+	const Vector3& StaticGeometry::GeometryBucket::getWorldPosition(void) const
+	{
+		return mParent->getParent()->getParent()->getCentre();
+	}
+	//--------------------------------------------------------------------------
+	Real StaticGeometry::GeometryBucket::getSquaredViewDepth(const Camera* cam) const
+	{
+		return mParent->getParent()->getSquaredDistance();
+	}
+	//--------------------------------------------------------------------------
+	const LightList& StaticGeometry::GeometryBucket::getLights(void) const
+	{
+		return mParent->getParent()->getParent()->queryLights();
+	}
+	//--------------------------------------------------------------------------
+	bool StaticGeometry::GeometryBucket::getCastsShadows(void) const
+	{
+		return mParent->getParent()->getParent()->getCastShadows();
+	}
+	//--------------------------------------------------------------------------
+	bool StaticGeometry::GeometryBucket::assign(QueuedGeometry* qgeom)
+	{
+		// Do we have enough space?
+		if (mVertexData->vertexCount + qgeom->geometry->vertexData->vertexCount
+			> mMaxVertexIndex)
+		{
+			return false;
+		}
+
+		mQueuedGeometry.push_back(qgeom);
+		mVertexData->vertexCount += qgeom->geometry->vertexData->vertexCount;
+		mIndexData->indexCount += qgeom->geometry->indexData->indexCount;
+
+		return true;
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::GeometryBucket::build(bool stencilShadows)
+	{
+		// Ok, here's where we transfer the vertices and indexes to the shared
+		// buffers
+		// Shortcuts
+		VertexDeclaration* dcl = mVertexData->vertexDeclaration;
+		VertexBufferBinding* binds = mVertexData->vertexBufferBinding;
+
+		// create index buffer, and lock
+		mIndexData->indexBuffer = HardwareBufferManager::getSingleton()
+			.createIndexBuffer(mIndexType, mIndexData->indexCount,
+				HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+		uint32* p32Dest = 0;
+		uint16* p16Dest = 0;
+		if (mIndexType == HardwareIndexBuffer::IT_32BIT)
+		{
+			p32Dest = static_cast<uint32*>(
+				mIndexData->indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+		}
+		else
+		{
+			p16Dest = static_cast<uint16*>(
+				mIndexData->indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+		}
+		// create all vertex buffers, and lock
+		ushort b;
+		ushort posBufferIdx = dcl->findElementBySemantic(VES_POSITION)->getSource();
+
+		std::vector<uchar*> destBufferLocks;
+		std::vector<VertexDeclaration::VertexElementList> bufferElements;
+		for (b = 0; b < binds->getBufferCount(); ++b)
+		{
+			size_t vertexCount = mVertexData->vertexCount;
+			// Need to double the vertex count for the position buffer
+			// if we're doing stencil shadows
+			if (stencilShadows && b == posBufferIdx)
+			{
+				vertexCount = vertexCount * 2;
+				assert(vertexCount <= mMaxVertexIndex &&
+					"Index range exceeded when using stencil shadows, consider "
+					"reducing your region size or reducing poly count");
+			}
+			HardwareVertexBufferSharedPtr vbuf =
+				HardwareBufferManager::getSingleton().createVertexBuffer(
+					dcl->getVertexSize(b),
+					vertexCount,
+					HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+			binds->setBinding(b, vbuf);
+			uchar* pLock = static_cast<uchar*>(
+				vbuf->lock(HardwareBuffer::HBL_DISCARD));
+			destBufferLocks.push_back(pLock);
+			// Pre-cache vertex elements per buffer
+			bufferElements.push_back(dcl->findElementsBySource(b));
+		}
+
+
+		// Iterate over the geometry items
+		size_t indexOffset = 0;
+		QueuedGeometryList::iterator gi, giend;
+		giend = mQueuedGeometry.end();
+		Vector3 regionCentre = mParent->getParent()->getParent()->getCentre();
+		for (gi = mQueuedGeometry.begin(); gi != giend; ++gi)
+		{
+			QueuedGeometry* geom = *gi;
+			// Copy indexes across with offset
+			IndexData* srcIdxData = geom->geometry->indexData;
+			if (mIndexType == HardwareIndexBuffer::IT_32BIT)
+			{
+				// Lock source indexes
+				uint32* pSrc = static_cast<uint32*>(
+					srcIdxData->indexBuffer->lock(
+						srcIdxData->indexStart, 
+						srcIdxData->indexCount * srcIdxData->indexBuffer->getIndexSize(),
+						HardwareBuffer::HBL_READ_ONLY));
+
+				copyIndexes(pSrc, p32Dest, srcIdxData->indexCount, indexOffset);
+				p32Dest += srcIdxData->indexCount;
+				srcIdxData->indexBuffer->unlock();
+			}
+			else
+			{
+				// Lock source indexes
+				uint16* pSrc = static_cast<uint16*>(
+					srcIdxData->indexBuffer->lock(
+					srcIdxData->indexStart, 
+					srcIdxData->indexCount * srcIdxData->indexBuffer->getIndexSize(),
+					HardwareBuffer::HBL_READ_ONLY));
+
+				copyIndexes(pSrc, p16Dest, srcIdxData->indexCount, indexOffset);
+				p16Dest += srcIdxData->indexCount;
+				srcIdxData->indexBuffer->unlock();
+			}
+
+			// Now deal with vertex buffers
+			// we can rely on buffer counts / formats being the same
+			VertexData* srcVData = geom->geometry->vertexData;
+			VertexBufferBinding* srcBinds = srcVData->vertexBufferBinding;
+			for (b = 0; b < binds->getBufferCount(); ++b)
+			{
+				// lock source
+				HardwareVertexBufferSharedPtr srcBuf =
+					srcBinds->getBuffer(b);
+				uchar* pSrcBase = static_cast<uchar*>(
+					srcBuf->lock(HardwareBuffer::HBL_READ_ONLY));
+				// Get buffer lock pointer, we'll update this later
+				uchar* pDstBase = destBufferLocks[b];
+				size_t bufInc = srcBuf->getVertexSize();
+
+				// Iterate over vertices
+				float *pSrcReal, *pDstReal;
+				Vector3 tmp;
+				for (size_t v = 0; v < srcVData->vertexCount; ++v)
+				{
+					// Iterate over vertex elements
+					VertexDeclaration::VertexElementList& elems =
+						bufferElements[b];
+					VertexDeclaration::VertexElementList::iterator ei;
+					for (ei = elems.begin(); ei != elems.end(); ++ei)
+					{
+						VertexElement& elem = *ei;
+						elem.baseVertexPointerToElement(pSrcBase, &pSrcReal);
+						elem.baseVertexPointerToElement(pDstBase, &pDstReal);
+						switch (elem.getSemantic())
+						{
+						case VES_POSITION:
+							tmp.x = *pSrcReal++;
+							tmp.y = *pSrcReal++;
+							tmp.z = *pSrcReal++;
+							// transform
+							tmp = (geom->orientation * (tmp * geom->scale)) +
+								geom->position;
+							// Adjust for region centre
+							tmp -= regionCentre;
+							*pDstReal++ = tmp.x;
+							*pDstReal++ = tmp.y;
+							*pDstReal++ = tmp.z;
+							break;
+						case VES_NORMAL:
+						case VES_TANGENT:
+						case VES_BINORMAL:
+							tmp.x = *pSrcReal++;
+							tmp.y = *pSrcReal++;
+							tmp.z = *pSrcReal++;
+							// scale (invert)
+							tmp = tmp / geom->scale;
+							tmp.normalise();
+							// rotation
+							tmp = geom->orientation * tmp;
+							*pDstReal++ = tmp.x;
+							*pDstReal++ = tmp.y;
+							*pDstReal++ = tmp.z;
+							break;
+						default:
+							// just raw copy
+							memcpy(pDstReal, pSrcReal,
+									VertexElement::getTypeSize(elem.getType()));
+							break;
+						};
+
+					}
+
+					// Increment both pointers
+					pDstBase += bufInc;
+					pSrcBase += bufInc;
+
+				}
+
+				// Update pointer
+				destBufferLocks[b] = pDstBase;
+				srcBuf->unlock();
+			}
+
+			indexOffset += geom->geometry->vertexData->vertexCount;
+		}
+
+		// Unlock everything
+		mIndexData->indexBuffer->unlock();
+		for (b = 0; b < binds->getBufferCount(); ++b)
+		{
+			binds->getBuffer(b)->unlock();
+		}
+
+		// If we're dealing with stencil shadows, copy the position data from
+		// the early half of the buffer to the latter part
+		if (stencilShadows)
+		{
+			HardwareVertexBufferSharedPtr buf = binds->getBuffer(posBufferIdx);
+			void* pSrc = buf->lock(HardwareBuffer::HBL_NORMAL);
+			// Point dest at second half (remember vertexcount is original count)
+			void* pDest = static_cast<uchar*>(pSrc) +
+				buf->getVertexSize() * mVertexData->vertexCount;
+			memcpy(pDest, pSrc, buf->getVertexSize() * mVertexData->vertexCount);
+			buf->unlock();
+
+			// Also set up hardware W buffer if appropriate
+			RenderSystem* rend = Root::getSingleton().getRenderSystem();
+			if (rend && rend->getCapabilities()->hasCapability(RSC_VERTEX_PROGRAM))
+			{
+				buf = HardwareBufferManager::getSingleton().createVertexBuffer(
+					sizeof(float), mVertexData->vertexCount * 2,
+					HardwareBuffer::HBU_STATIC_WRITE_ONLY, false);
+				// Fill the first half with 1.0, second half with 0.0
+				float *pW = static_cast<float*>(
+					buf->lock(HardwareBuffer::HBL_DISCARD));
+				size_t v;
+				for (v = 0; v < mVertexData->vertexCount; ++v)
+				{
+					*pW++ = 1.0f;
+				}
+				for (v = 0; v < mVertexData->vertexCount; ++v)
+				{
+					*pW++ = 0.0f;
+				}
+				buf->unlock();
+				mVertexData->hardwareShadowVolWBuffer = buf;
+			}
+		}
+
+	}
+	//--------------------------------------------------------------------------
+	void StaticGeometry::GeometryBucket::dump(std::ofstream& of) const
+	{
+		of << "Geometry Bucket" << std::endl;
+		of << "---------------" << std::endl;
+		of << "Format string: " << mFormatString << std::endl;
+		of << "Geometry items: " << mQueuedGeometry.size() << std::endl;
+		of << "Vertex count: " << mVertexData->vertexCount << std::endl;
+		of << "Index count: " << mIndexData->indexCount << std::endl;
+		of << "---------------" << std::endl;
+
+	}
+	//--------------------------------------------------------------------------
+
+}
+
Index: /OgreMain/src/OgreString.cpp
===================================================================
--- /OgreMain/src/OgreString.cpp	(revision 5)
+++ /OgreMain/src/OgreString.cpp	(revision 5)
@@ -0,0 +1,288 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreString.h"
+
+#include "OgreStringVector.h"
+
+namespace Ogre {
+
+	//-----------------------------------------------------------------------
+	const String StringUtil::BLANK;
+	//-----------------------------------------------------------------------
+    void StringUtil::trim(String& str, bool left, bool right)
+    {
+        /*
+        size_t lspaces, rspaces, len = length(), i;
+
+        lspaces = rspaces = 0;
+
+        if( left )
+        {
+            // Find spaces / tabs on the left
+            for( i = 0;
+                i < len && ( at(i) == ' ' || at(i) == '\t' || at(i) == '\r');
+                ++lspaces, ++i );
+        }
+        
+        if( right && lspaces < len )
+        {
+            // Find spaces / tabs on the right
+            for( i = len - 1;
+                i >= 0 && ( at(i) == ' ' || at(i) == '\t' || at(i) == '\r');
+                rspaces++, i-- );
+        }
+
+        *this = substr(lspaces, len-lspaces-rspaces);
+        */
+        static const String delims = " \t\r";
+        if(right)
+            str.erase(str.find_last_not_of(delims)+1); // trim right
+        if(left)
+            str.erase(0, str.find_first_not_of(delims)); // trim left
+    }
+
+    //-----------------------------------------------------------------------
+    std::vector<String> StringUtil::split( const String& str, const String& delims, unsigned int maxSplits)
+    {
+        std::vector<String> ret;
+        // Pre-allocate some space for performance
+        ret.reserve(maxSplits ? maxSplits+1 : 10);    // 10 is guessed capacity for most case
+
+        unsigned int numSplits = 0;
+
+        // Use STL methods 
+        size_t start, pos;
+        start = 0;
+        do 
+        {
+            pos = str.find_first_of(delims, start);
+            if (pos == start)
+            {
+                // Do nothing
+                start = pos + 1;
+            }
+            else if (pos == String::npos || (maxSplits && numSplits == maxSplits))
+            {
+                // Copy the rest of the string
+                ret.push_back( str.substr(start) );
+                break;
+            }
+            else
+            {
+                // Copy up to delimiter
+                ret.push_back( str.substr(start, pos - start) );
+                start = pos + 1;
+            }
+            // parse up to next real data
+            start = str.find_first_not_of(delims, start);
+            ++numSplits;
+
+        } while (pos != String::npos);
+
+
+
+        return ret;
+    }
+
+    //-----------------------------------------------------------------------
+    void StringUtil::toLowerCase(String& str)
+    {
+        std::transform(
+            str.begin(),
+            str.end(),
+            str.begin(),
+			tolower);
+    }
+
+    //-----------------------------------------------------------------------
+    void StringUtil::toUpperCase(String& str) 
+    {
+        std::transform(
+            str.begin(),
+            str.end(),
+            str.begin(),
+			toupper);
+    }
+    //-----------------------------------------------------------------------
+    bool StringUtil::startsWith(const String& str, const String& pattern, bool lowerCase)
+    {
+        size_t thisLen = str.length();
+        size_t patternLen = pattern.length();
+        if (thisLen < patternLen || patternLen == 0)
+            return false;
+
+        String startOfThis = str.substr(0, patternLen);
+        if (lowerCase)
+            StringUtil::toLowerCase(startOfThis);
+
+        return (startOfThis == pattern);
+    }
+    //-----------------------------------------------------------------------
+    bool StringUtil::endsWith(const String& str, const String& pattern, bool lowerCase)
+    {
+        size_t thisLen = str.length();
+        size_t patternLen = pattern.length();
+        if (thisLen < patternLen || patternLen == 0)
+            return false;
+
+        String endOfThis = str.substr(thisLen - patternLen, patternLen);
+        if (lowerCase)
+            StringUtil::toLowerCase(endOfThis);
+
+        return (endOfThis == pattern);
+    }
+    //-----------------------------------------------------------------------
+    String StringUtil::standardisePath(const String& init)
+    {
+        String path = init;
+
+        std::replace( path.begin(), path.end(), '\\', '/' );
+        if( path[path.length() - 1] != '/' )
+            path += '/';
+
+        return path;
+    }
+    //-----------------------------------------------------------------------
+    void StringUtil::splitFilename(const String& qualifiedName, 
+        String& outBasename, String& outPath)
+    {
+        String path = qualifiedName;
+        // Replace \ with / first
+        std::replace( path.begin(), path.end(), '\\', '/' );
+        // split based on final /
+        size_t i = path.find_last_of('/');
+
+        if (i == String::npos)
+        {
+            outPath.clear();
+			outBasename = qualifiedName;
+        }
+        else
+        {
+            outBasename = path.substr(i+1, path.size() - i - 1);
+            outPath = path.substr(0, i+1);
+        }
+
+    }
+	//-----------------------------------------------------------------------
+	void StringUtil::splitBaseFilename(const Ogre::String& fullName, 
+		Ogre::String& outBasename, Ogre::String& outExtention)
+	{
+		size_t i = fullName.find_last_of(".");
+		if (i == Ogre::String::npos)
+		{
+			outExtention.clear();
+			outBasename = fullName;
+		}
+		else
+		{
+			outExtention = fullName.substr(i+1);
+			outBasename = fullName.substr(0, i);
+		}
+	}
+	// ----------------------------------------------------------------------------------------------------------------------------------------------
+	void StringUtil::splitFullFilename(	const Ogre::String& qualifiedName, 
+		Ogre::String& outBasename, Ogre::String& outExtention, Ogre::String& outPath )
+	{
+		Ogre::String fullName;
+		splitFilename( qualifiedName, fullName, outPath );
+		splitBaseFilename( fullName, outBasename, outExtention );
+	}
+    //-----------------------------------------------------------------------
+    bool StringUtil::match(const String& str, const String& pattern, bool caseSensitive)
+    {
+        String tmpStr = str;
+		String tmpPattern = pattern;
+        if (!caseSensitive)
+        {
+            StringUtil::toLowerCase(tmpStr);
+            StringUtil::toLowerCase(tmpPattern);
+        }
+
+        String::const_iterator strIt = tmpStr.begin();
+        String::const_iterator patIt = tmpPattern.begin();
+		String::const_iterator lastWildCardIt = tmpPattern.end();
+        while (strIt != tmpStr.end() && patIt != tmpPattern.end())
+        {
+            if (*patIt == '*')
+            {
+				lastWildCardIt = patIt;
+                // Skip over looking for next character
+                ++patIt;
+                if (patIt == tmpPattern.end())
+				{
+					// Skip right to the end since * matches the entire rest of the string
+					strIt = tmpStr.end();
+				}
+				else
+                {
+					// scan until we find next pattern character
+                    while(strIt != tmpStr.end() && *strIt != *patIt)
+                        ++strIt;
+                }
+            }
+            else
+            {
+                if (*patIt != *strIt)
+                {
+					if (lastWildCardIt != tmpPattern.end())
+					{
+						// The last wildcard can match this incorrect sequence
+						// rewind pattern to wildcard and keep searching
+						patIt = lastWildCardIt;
+						lastWildCardIt = tmpPattern.end();
+					}
+					else
+					{
+						// no wildwards left
+						return false;
+					}
+                }
+                else
+                {
+                    ++patIt;
+                    ++strIt;
+                }
+            }
+
+        }
+		// If we reached the end of both the pattern and the string, we succeeded
+		if (patIt == tmpPattern.end() && strIt == tmpStr.end())
+		{
+        	return true;
+		}
+		else
+		{
+			return false;
+		}
+
+    }
+
+}
Index: /OgreMain/src/OgreStringConverter.cpp
===================================================================
--- /OgreMain/src/OgreStringConverter.cpp	(revision 5)
+++ /OgreMain/src/OgreStringConverter.cpp	(revision 5)
@@ -0,0 +1,412 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreStringConverter.h"
+#include "OgreVector2.h"
+#include "OgreVector3.h"
+#include "OgreVector4.h"
+#include "OgreMatrix3.h"
+#include "OgreMatrix4.h"
+#include "OgreQuaternion.h"
+#include "OgreColourValue.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    String StringConverter::toString(Real val, unsigned short precision, 
+        unsigned short width, char fill, std::ios::fmtflags flags)
+    {
+        StringUtil::StrStreamType stream;
+        stream.precision(precision);
+        stream.width(width);
+        stream.fill(fill);
+        if (flags)
+            stream.setf(flags);
+        stream << val;
+        return stream.str();
+    }
+    //-----------------------------------------------------------------------
+    String StringConverter::toString(int val, 
+        unsigned short width, char fill, std::ios::fmtflags flags)
+    {
+        StringUtil::StrStreamType stream;
+		stream.width(width);
+        stream.fill(fill);
+        if (flags)
+            stream.setf(flags);
+        stream << val;
+        return stream.str();
+    }
+    //-----------------------------------------------------------------------
+#if OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_64 || OGRE_PLATFORM == OGRE_PLATFORM_APPLE    
+    String StringConverter::toString(unsigned int val, 
+        unsigned short width, char fill, std::ios::fmtflags flags)
+    {
+        StringUtil::StrStreamType stream;
+        stream.width(width);
+        stream.fill(fill);
+        if (flags)
+            stream.setf(flags);
+        stream << val;
+        return stream.str();
+    }
+    //-----------------------------------------------------------------------
+    String StringConverter::toString(size_t val, 
+        unsigned short width, char fill, std::ios::fmtflags flags)
+    {
+        StringUtil::StrStreamType stream;
+        stream.width(width);
+        stream.fill(fill);
+        if (flags)
+            stream.setf(flags);
+        stream << val;
+        return stream.str();
+    }
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+    //-----------------------------------------------------------------------
+    String StringConverter::toString(unsigned long val, 
+        unsigned short width, char fill, std::ios::fmtflags flags)
+    {
+        StringUtil::StrStreamType stream;
+        stream.width(width);
+        stream.fill(fill);
+        if (flags)
+            stream.setf(flags);
+        stream << val;
+        return stream.str();
+    }
+
+#endif
+    //-----------------------------------------------------------------------
+#else
+    String StringConverter::toString(size_t val, 
+        unsigned short width, char fill, std::ios::fmtflags flags)
+    {
+        StringUtil::StrStreamType stream;
+		stream.width(width);
+        stream.fill(fill);
+        if (flags)
+            stream.setf(flags);
+        stream << val;
+        return stream.str();
+    }
+    //-----------------------------------------------------------------------
+    String StringConverter::toString(unsigned long val, 
+        unsigned short width, char fill, std::ios::fmtflags flags)
+    {
+        StringUtil::StrStreamType stream;
+		stream.width(width);
+        stream.fill(fill);
+        if (flags)
+            stream.setf(flags);
+        stream << val;
+        return stream.str();
+    }
+    //-----------------------------------------------------------------------
+#endif
+    String StringConverter::toString(long val, 
+        unsigned short width, char fill, std::ios::fmtflags flags)
+    {
+        StringUtil::StrStreamType stream;
+		stream.width(width);
+        stream.fill(fill);
+        if (flags)
+            stream.setf(flags);
+        stream << val;
+        return stream.str();
+    }
+	//-----------------------------------------------------------------------
+    String StringConverter::toString(const Vector2& val)
+    {
+        StringUtil::StrStreamType stream;
+		stream << val.x << " " << val.y;
+        return stream.str();
+    }
+    //-----------------------------------------------------------------------
+    String StringConverter::toString(const Vector3& val)
+    {
+        StringUtil::StrStreamType stream;
+		stream << val.x << " " << val.y << " " << val.z;
+        return stream.str();
+    }
+	//-----------------------------------------------------------------------
+    String StringConverter::toString(const Vector4& val)
+    {
+        StringUtil::StrStreamType stream;
+		stream << val.x << " " << val.y << " " << val.z << " " << val.w;
+        return stream.str();
+    }
+    //-----------------------------------------------------------------------
+    String StringConverter::toString(const Matrix3& val)
+    {
+		StringUtil::StrStreamType stream;
+        stream << val[0][0] << " " 
+            << val[0][1] << " "             
+            << val[0][2] << " "             
+            << val[1][0] << " "             
+            << val[1][1] << " "             
+            << val[1][2] << " "             
+            << val[2][0] << " "             
+            << val[2][1] << " "             
+            << val[2][2];
+        return stream.str();
+    }
+    //-----------------------------------------------------------------------
+    String StringConverter::toString(bool val, bool yesNo)
+    {
+        if (val)
+        {
+            if (yesNo)
+            {
+                return "yes";
+            }
+            else
+            {
+                return "true";
+            }
+        }
+        else
+            if (yesNo)
+            {
+                return "no";
+            }
+            else
+            {
+                return "false";
+            }
+    }
+    //-----------------------------------------------------------------------
+    String StringConverter::toString(const Matrix4& val)
+    {
+		StringUtil::StrStreamType stream;
+        stream << val[0][0] << " " 
+            << val[0][1] << " "             
+            << val[0][2] << " "             
+            << val[0][3] << " "             
+            << val[1][0] << " "             
+            << val[1][1] << " "             
+            << val[1][2] << " "             
+            << val[1][3] << " "             
+            << val[2][0] << " "             
+            << val[2][1] << " "             
+            << val[2][2] << " "             
+            << val[2][3] << " "             
+            << val[3][0] << " "             
+            << val[3][1] << " "             
+            << val[3][2] << " "             
+            << val[3][3];
+        return stream.str();
+    }
+    //-----------------------------------------------------------------------
+    String StringConverter::toString(const Quaternion& val)
+    {
+		StringUtil::StrStreamType stream;
+        stream  << val.w << " " << val.x << " " << val.y << " " << val.z;
+        return stream.str();
+    }
+    //-----------------------------------------------------------------------
+    String StringConverter::toString(const ColourValue& val)
+    {
+		StringUtil::StrStreamType stream;
+        stream << val.r << " " << val.g << " " << val.b << " " << val.a;
+        return stream.str();
+    }
+    //-----------------------------------------------------------------------
+    String StringConverter::toString(const StringVector& val)
+    {
+		StringUtil::StrStreamType stream;
+        StringVector::const_iterator i, iend, ibegin;
+        ibegin = val.begin();
+        iend = val.end();
+        for (i = ibegin; i != iend; ++i)
+        {
+            if (i != ibegin)
+                stream << " ";
+
+            stream << *i; 
+        }
+        return stream.str();
+    }
+    //-----------------------------------------------------------------------
+    Real StringConverter::parseReal(const String& val)
+    {
+		// Use istringstream for direct correspondence with toString
+		std::istringstream str(val);
+		Real ret = 0;
+		str >> ret;
+
+        return ret;
+    }
+    //-----------------------------------------------------------------------
+    int StringConverter::parseInt(const String& val)
+    {
+		// Use istringstream for direct correspondence with toString
+		std::istringstream str(val);
+		int ret = 0;
+		str >> ret;
+
+        return ret;
+    }
+    //-----------------------------------------------------------------------
+    unsigned int StringConverter::parseUnsignedInt(const String& val)
+    {
+		// Use istringstream for direct correspondence with toString
+		std::istringstream str(val);
+		unsigned int ret = 0;
+		str >> ret;
+
+		return ret;
+    }
+    //-----------------------------------------------------------------------
+    long StringConverter::parseLong(const String& val)
+    {
+		// Use istringstream for direct correspondence with toString
+		std::istringstream str(val);
+		long ret = 0;
+		str >> ret;
+
+		return ret;
+    }
+    //-----------------------------------------------------------------------
+    unsigned long StringConverter::parseUnsignedLong(const String& val)
+    {
+		// Use istringstream for direct correspondence with toString
+		std::istringstream str(val);
+		unsigned long ret = 0;
+		str >> ret;
+
+		return ret;
+    }
+    //-----------------------------------------------------------------------
+    bool StringConverter::parseBool(const String& val)
+    {
+		return (StringUtil::startsWith(val, "true") || StringUtil::startsWith(val, "yes")
+			|| StringUtil::startsWith(val, "1"));
+    }
+    //-----------------------------------------------------------------------
+    Vector3 StringConverter::parseVector3(const String& val)
+    {
+        // Split on space
+        std::vector<String> vec = StringUtil::split(val);
+
+        if (vec.size() != 3)
+        {
+            return Vector3::ZERO;
+        }
+        else
+        {
+            return Vector3(parseReal(vec[0]),parseReal(vec[1]),parseReal(vec[2]));
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    Matrix3 StringConverter::parseMatrix3(const String& val)
+    {
+        // Split on space
+        std::vector<String> vec = StringUtil::split(val);
+
+        if (vec.size() != 9)
+        {
+            return Matrix3::IDENTITY;
+        }
+        else
+        {
+            return Matrix3(parseReal(vec[0]),parseReal(vec[1]),parseReal(vec[2]),
+                parseReal(vec[3]),parseReal(vec[4]),parseReal(vec[5]),
+                parseReal(vec[6]),parseReal(vec[7]),parseReal(vec[8]));
+        }
+    }
+    //-----------------------------------------------------------------------
+    Matrix4 StringConverter::parseMatrix4(const String& val)
+    {
+        // Split on space
+        std::vector<String> vec = StringUtil::split(val);
+
+        if (vec.size() != 16)
+        {
+            return Matrix4::IDENTITY;
+        }
+        else
+        {
+            return Matrix4(parseReal(vec[0]),parseReal(vec[1]),parseReal(vec[2]), parseReal(vec[3]),
+                parseReal(vec[4]),parseReal(vec[5]), parseReal(vec[6]), parseReal(vec[7]),
+                parseReal(vec[8]),parseReal(vec[9]), parseReal(vec[10]), parseReal(vec[11]),
+                parseReal(vec[12]),parseReal(vec[13]), parseReal(vec[14]), parseReal(vec[15]));
+        }
+    }
+    //-----------------------------------------------------------------------
+    Quaternion StringConverter::parseQuaternion(const String& val)
+    {
+        // Split on space
+        std::vector<String> vec = StringUtil::split(val);
+
+        if (vec.size() != 4)
+        {
+            return Quaternion::IDENTITY;
+        }
+        else
+        {
+            return Quaternion(parseReal(vec[0]),parseReal(vec[1]),parseReal(vec[2]), parseReal(vec[3]));
+        }
+    }
+    //-----------------------------------------------------------------------
+    ColourValue StringConverter::parseColourValue(const String& val)
+    {
+        // Split on space
+        std::vector<String> vec = StringUtil::split(val);
+
+        if (vec.size() == 4)
+        {
+            return ColourValue(parseReal(vec[0]),parseReal(vec[1]),parseReal(vec[2]), parseReal(vec[3]));
+        }
+        else if (vec.size() == 3)
+        {
+            return ColourValue(parseReal(vec[0]),parseReal(vec[1]),parseReal(vec[2]), 1.0f);
+        }
+        else
+        {
+            return ColourValue::Black;
+        }
+    }
+    //-----------------------------------------------------------------------
+    StringVector StringConverter::parseStringVector(const String& val)
+    {
+        return StringUtil::split(val);
+    }
+	//-----------------------------------------------------------------------
+	bool StringConverter::isNumber(const String& val)
+	{
+		std::istringstream str(val);
+		float tst;
+		str >> tst;
+		return !str.fail() && str.eof();
+	}
+}
+
+
Index: /OgreMain/src/OgreStringInterface.cpp
===================================================================
--- /OgreMain/src/OgreStringInterface.cpp	(revision 5)
+++ /OgreMain/src/OgreStringInterface.cpp	(revision 5)
@@ -0,0 +1,81 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreStringInterface.h"
+
+namespace Ogre {
+
+    ParamDictionaryMap StringInterface::msDictionary;
+
+
+    const ParameterList& StringInterface::getParameters(void) const
+    {
+        static ParameterList emptyList;
+
+        const ParamDictionary* dict = getParamDictionary();
+        if (dict)
+            return dict->getParameters();
+        else
+            return emptyList;
+
+    };
+
+    bool StringInterface::setParameter(const String& name, const String& value)
+    {
+        // Get dictionary
+        ParamDictionary* dict = getParamDictionary();
+
+        if (dict)
+        {
+            // Look up command object
+            ParamCommand* cmd = dict->getParamCommand(name);
+            if (cmd)
+            {
+                cmd->doSet(this, value);
+                return true;
+            }
+        }
+        // Fallback
+        return false;
+    }
+	//-----------------------------------------------------------------------
+	void StringInterface::setParameterList(const NameValuePairList& paramList)
+	{
+		NameValuePairList::const_iterator i, iend;
+		iend = paramList.end();
+		for (i = paramList.begin(); i != iend; ++i)
+		{
+			setParameter(i->first, i->second);
+		}
+	}
+    //-----------------------------------------------------------------------
+    void StringInterface::cleanupDictionary () {
+      msDictionary.clear();
+    }
+}
Index: /OgreMain/src/OgreSubEntity.cpp
===================================================================
--- /OgreMain/src/OgreSubEntity.cpp	(revision 5)
+++ /OgreMain/src/OgreSubEntity.cpp	(revision 5)
@@ -0,0 +1,440 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreSubEntity.h"
+
+#include "OgreEntity.h"
+#include "OgreSkeletonInstance.h"
+#include "OgreSceneManager.h"
+#include "OgreMaterialManager.h"
+#include "OgreSubMesh.h"
+#include "OgreTagPoint.h"
+#include "OgreLogManager.h"
+#include "OgreMesh.h"
+#include "OgreException.h"
+#include "OgreCamera.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    SubEntity::SubEntity (Entity* parent, SubMesh* subMeshBasis)
+        : Renderable(), mParentEntity(parent), mMaterialName("BaseWhite"),
+		mSubMesh(subMeshBasis), mCachedCamera(0)
+    {
+        mpMaterial = MaterialManager::getSingleton().getByName(mMaterialName);
+        mMaterialLodIndex = 0;
+        mVisible = true;
+        mSkelAnimVertexData = 0;
+		mSoftwareVertexAnimVertexData = 0;
+		mHardwareVertexAnimVertexData = 0;
+		mHardwarePoseCount = 0;
+
+
+
+    }
+    //-----------------------------------------------------------------------
+    SubEntity::~SubEntity()
+    {
+        if (mSkelAnimVertexData)
+            delete mSkelAnimVertexData;
+		if (mHardwareVertexAnimVertexData)
+			delete mHardwareVertexAnimVertexData;
+		if (mSoftwareVertexAnimVertexData)
+			delete mSoftwareVertexAnimVertexData;
+    }
+    //-----------------------------------------------------------------------
+    SubMesh* SubEntity::getSubMesh(void)
+    {
+        return mSubMesh;
+    }
+    //-----------------------------------------------------------------------
+    const String& SubEntity::getMaterialName(void) const
+    {
+        return mMaterialName;
+    }
+    //-----------------------------------------------------------------------
+    void SubEntity::setMaterialName( const String& name)
+    {
+
+        //String oldName = mMaterialName;
+        mMaterialName = name;
+        mpMaterial = MaterialManager::getSingleton().getByName(mMaterialName);
+
+        if (mpMaterial.isNull())
+        {
+            LogManager::getSingleton().logMessage("Can't assign material " + name + 
+                " to SubEntity of " + mParentEntity->getName() + " because this "
+                "Material does not exist. Have you forgotten to define it in a "
+                ".material script?");
+            mpMaterial = MaterialManager::getSingleton().getByName("BaseWhite");
+            if (mpMaterial.isNull())
+            {
+                OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Can't assign default material "
+                    "to SubEntity of " + mParentEntity->getName() + ". Did "
+                    "you forget to call MaterialManager::initialise()?",
+                    "SubEntity.setMaterialName");
+            }
+        }
+        // Ensure new material loaded (will not load again if already loaded)
+        mpMaterial->load();
+
+        // tell parent to reconsider material vertex processing options
+        mParentEntity->reevaluateVertexProcessing();
+
+
+    }
+    //-----------------------------------------------------------------------
+    const MaterialPtr& SubEntity::getMaterial(void) const
+    {
+        return mpMaterial;
+    }
+    //-----------------------------------------------------------------------
+    Technique* SubEntity::getTechnique(void) const
+    {
+        return mpMaterial->getBestTechnique(mMaterialLodIndex);
+    }
+    //-----------------------------------------------------------------------
+    void SubEntity::getRenderOperation(RenderOperation& op)
+    {
+		// Use LOD
+        mSubMesh->_getRenderOperation(op, mParentEntity->mMeshLodIndex);
+		// Deal with any vertex data overrides
+		op.vertexData = getVertexDataForBinding();
+
+    }
+	//-----------------------------------------------------------------------
+	VertexData* SubEntity::getVertexDataForBinding(void)
+	{
+		if (mSubMesh->useSharedVertices)
+		{
+			return mParentEntity->getVertexDataForBinding();
+		}
+		else
+		{
+			Entity::VertexDataBindChoice c = 
+				mParentEntity->chooseVertexDataForBinding(
+					mSubMesh->getVertexAnimationType() != VAT_NONE);
+			switch(c)
+			{
+			case Entity::BIND_ORIGINAL:
+				return mSubMesh->vertexData;
+			case Entity::BIND_HARDWARE_MORPH:
+				return mHardwareVertexAnimVertexData;
+			case Entity::BIND_SOFTWARE_MORPH:
+				return mSoftwareVertexAnimVertexData;
+			case Entity::BIND_SOFTWARE_SKELETAL:
+				return mSkelAnimVertexData;
+			};
+			// keep compiler happy
+			return mSubMesh->vertexData;
+
+		}
+	}
+    //-----------------------------------------------------------------------
+    void SubEntity::getWorldTransforms(Matrix4* xform) const
+    {
+        if (!mParentEntity->mNumBoneMatrices ||
+            !mParentEntity->isHardwareAnimationEnabled())
+        {
+            // No skeletal animation, or software skinning
+            *xform = mParentEntity->_getParentNodeFullTransform();
+        }
+        else
+        {
+            // Hardware skinning, pass all actually used matrices
+            const Mesh::IndexMap& indexMap = mSubMesh->useSharedVertices ?
+                mSubMesh->parent->sharedBlendIndexToBoneIndexMap : mSubMesh->blendIndexToBoneIndexMap;
+            assert(indexMap.size() <= mParentEntity->mNumBoneMatrices);
+
+            if (mParentEntity->_isSkeletonAnimated())
+            {
+                // Bones, use cached matrices built when Entity::_updateRenderQueue was called
+                assert(mParentEntity->mBoneWorldMatrices);
+
+                Mesh::IndexMap::const_iterator it, itend;
+                itend = indexMap.end();
+                for (it = indexMap.begin(); it != itend; ++it, ++xform)
+                {
+                    *xform = mParentEntity->mBoneWorldMatrices[*it];
+                }
+            }
+            else
+            {
+                // All animations disabled, use parent entity world transform only
+                std::fill_n(xform, indexMap.size(), mParentEntity->_getParentNodeFullTransform());
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& SubEntity::getWorldOrientation(void) const
+    {
+        return mParentEntity->mParentNode->_getDerivedOrientation();
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& SubEntity::getWorldPosition(void) const
+    {
+        return mParentEntity->mParentNode->_getDerivedPosition();
+    }
+
+    //-----------------------------------------------------------------------
+    unsigned short SubEntity::getNumWorldTransforms(void) const
+    {
+        if (!mParentEntity->mNumBoneMatrices ||
+            !mParentEntity->isHardwareAnimationEnabled())
+        {
+            // No skeletal animation, or software skinning
+            return 1;
+        }
+        else
+        {
+            // Hardware skinning, pass all actually used matrices
+            const Mesh::IndexMap& indexMap = mSubMesh->useSharedVertices ?
+                mSubMesh->parent->sharedBlendIndexToBoneIndexMap : mSubMesh->blendIndexToBoneIndexMap;
+            assert(indexMap.size() <= mParentEntity->mNumBoneMatrices);
+
+            return static_cast<unsigned short>(indexMap.size());
+        }
+    }
+    //-----------------------------------------------------------------------
+    Real SubEntity::getSquaredViewDepth(const Camera* cam) const
+    {
+        // First of all, check the cached value
+		// NB this is manually invalidated by parent each _notifyCurrentCamera call
+		// Done this here rather than there since we only need this for transparent objects
+        if (mCachedCamera == cam)
+            return mCachedCameraDist;
+
+        Node* n = mParentEntity->getParentNode();
+        assert(n);
+        Real dist;
+        if (!mSubMesh->extremityPoints.empty())
+        {
+            const Vector3 &cp = cam->getDerivedPosition();
+            const Matrix4 &l2w = mParentEntity->_getParentNodeFullTransform();
+			dist = std::numeric_limits<Real>::infinity();
+            for (std::vector<Vector3>::const_iterator i = mSubMesh->extremityPoints.begin();
+                 i != mSubMesh->extremityPoints.end (); ++i)
+            {
+                Vector3 v = l2w * (*i);
+                Real d = (v - cp).squaredLength();
+                
+				dist = std::min(d, dist);
+            }
+        }
+        else
+            dist = n->getSquaredViewDepth(cam);
+
+        mCachedCameraDist = dist;
+        mCachedCamera = cam;
+
+        return dist;
+    }
+    //-----------------------------------------------------------------------
+    bool SubEntity::getNormaliseNormals(void) const
+    {
+        return mParentEntity->mNormaliseNormals;
+    }
+    //-----------------------------------------------------------------------
+    const LightList& SubEntity::getLights(void) const
+    {
+        return mParentEntity->queryLights();
+    }
+    //-----------------------------------------------------------------------
+    void SubEntity::setVisible(bool visible)
+    {
+        mVisible = visible;
+    }
+    //-----------------------------------------------------------------------
+    bool SubEntity::isVisible(void) const
+    {
+        return mVisible;
+
+    }
+    //-----------------------------------------------------------------------
+    void SubEntity::prepareTempBlendBuffers(void)
+    {
+		if (mSubMesh->useSharedVertices)
+			return;
+
+        if (mSkelAnimVertexData) 
+        {
+            delete mSkelAnimVertexData;
+            mSkelAnimVertexData = 0;
+        }
+		if (mSoftwareVertexAnimVertexData) 
+		{
+			delete mSoftwareVertexAnimVertexData;
+			mSoftwareVertexAnimVertexData = 0;
+		}
+		if (mHardwareVertexAnimVertexData) 
+		{
+			delete mHardwareVertexAnimVertexData;
+			mHardwareVertexAnimVertexData = 0;
+		}
+
+		if (!mSubMesh->useSharedVertices)
+		{
+			if (mSubMesh->getVertexAnimationType() != VAT_NONE)
+			{
+				// Create temporary vertex blend info
+				// Prepare temp vertex data if needed
+				// Clone without copying data, don't remove any blending info
+				// (since if we skeletally animate too, we need it)
+				mSoftwareVertexAnimVertexData = mSubMesh->vertexData->clone(false);
+				mParentEntity->extractTempBufferInfo(mSoftwareVertexAnimVertexData, &mTempVertexAnimInfo);
+
+				// Also clone for hardware usage, don't remove blend info since we'll
+				// need it if we also hardware skeletally animate
+				mHardwareVertexAnimVertexData = mSubMesh->vertexData->clone(false);
+			}
+
+			if (mParentEntity->hasSkeleton())
+			{
+				// Create temporary vertex blend info
+				// Prepare temp vertex data if needed
+				// Clone without copying data, remove blending info
+				// (since blend is performed in software)
+				mSkelAnimVertexData = 
+					mParentEntity->cloneVertexDataRemoveBlendInfo(mSubMesh->vertexData);
+				mParentEntity->extractTempBufferInfo(mSkelAnimVertexData, &mTempSkelAnimInfo);
+
+			}
+		}
+    }
+    //-----------------------------------------------------------------------
+    bool SubEntity::getCastsShadows(void) const
+    {
+        return mParentEntity->getCastShadows();
+    }
+	//-----------------------------------------------------------------------
+	VertexData* SubEntity::_getSkelAnimVertexData(void) 
+	{
+		assert (mSkelAnimVertexData && "Not software skinned or has no dedicated geometry!");
+		return mSkelAnimVertexData;
+	}
+	//-----------------------------------------------------------------------
+	VertexData* SubEntity::_getSoftwareVertexAnimVertexData(void)
+	{
+		assert (mSoftwareVertexAnimVertexData && "Not vertex animated or has no dedicated geometry!");
+		return mSoftwareVertexAnimVertexData;
+	}
+	//-----------------------------------------------------------------------
+	VertexData* SubEntity::_getHardwareVertexAnimVertexData(void)
+	{
+		assert (mHardwareVertexAnimVertexData && "Not vertex animated or has no dedicated geometry!");
+		return mHardwareVertexAnimVertexData;
+	}
+	//-----------------------------------------------------------------------
+	TempBlendedBufferInfo* SubEntity::_getSkelAnimTempBufferInfo(void) 
+	{
+		return &mTempSkelAnimInfo;
+	}
+	//-----------------------------------------------------------------------
+	TempBlendedBufferInfo* SubEntity::_getVertexAnimTempBufferInfo(void) 
+	{
+		return &mTempVertexAnimInfo;
+	}
+	//-----------------------------------------------------------------------
+	void SubEntity::_updateCustomGpuParameter(
+		const GpuProgramParameters::AutoConstantEntry& constantEntry,
+		GpuProgramParameters* params) const
+	{
+		if (constantEntry.paramType == GpuProgramParameters::ACT_ANIMATION_PARAMETRIC)
+		{
+			// Set up to 4 values, or up to limit of hardware animation entries
+			// Pack into 4-element constants offset based on constant data index
+			// If there are more than 4 entries, this will be called more than once
+			Vector4 val(0.0f,0.0f,0.0f,0.0f);
+
+			size_t animIndex = constantEntry.data * 4;
+			for (size_t i = 0; i < 4 && 
+				animIndex < mHardwareVertexAnimVertexData->hwAnimationDataList.size();
+				++i, ++animIndex)
+			{
+				val[i] = 
+					mHardwareVertexAnimVertexData->hwAnimationDataList[animIndex].parametric;
+			}
+			// set the parametric morph value
+			params->_writeRawConstant(constantEntry.physicalIndex, val);
+		}
+		else
+		{
+			// default
+			return Renderable::_updateCustomGpuParameter(constantEntry, params);
+		}
+	}
+	//-----------------------------------------------------------------------------
+	void SubEntity::_markBuffersUnusedForAnimation(void)
+	{
+		mVertexAnimationAppliedThisFrame = false;
+	}
+	//-----------------------------------------------------------------------------
+	void SubEntity::_markBuffersUsedForAnimation(void)
+	{
+		mVertexAnimationAppliedThisFrame = true;
+	}
+	//-----------------------------------------------------------------------------
+	void SubEntity::_restoreBuffersForUnusedAnimation(bool hardwareAnimation)
+	{
+		// Rebind original positions if:
+		//  We didn't apply any animation and 
+		//    We're morph animated (hardware binds keyframe, software is missing)
+		//    or we're pose animated and software (hardware is fine, still bound)
+		if (mSubMesh->getVertexAnimationType() != VAT_NONE && 
+			!mSubMesh->useSharedVertices && 
+			!mVertexAnimationAppliedThisFrame &&
+			(!hardwareAnimation || mSubMesh->getVertexAnimationType() == VAT_MORPH))
+		{
+			const VertexElement* srcPosElem = 
+				mSubMesh->vertexData->vertexDeclaration->findElementBySemantic(VES_POSITION);
+			HardwareVertexBufferSharedPtr srcBuf = 
+				mSubMesh->vertexData->vertexBufferBinding->getBuffer(
+				srcPosElem->getSource());
+
+			// Bind to software
+			const VertexElement* destPosElem = 
+				mSoftwareVertexAnimVertexData->vertexDeclaration->findElementBySemantic(VES_POSITION);
+			mSoftwareVertexAnimVertexData->vertexBufferBinding->setBinding(
+				destPosElem->getSource(), srcBuf);
+
+		}
+
+		// rebind any missing hardware pose buffers
+		// Caused by not having any animations enabled, or keyframes which reference
+		// no poses
+		if (!mSubMesh->useSharedVertices && hardwareAnimation 
+			&& mSubMesh->getVertexAnimationType() == VAT_POSE)
+		{
+			mParentEntity->bindMissingHardwarePoseBuffers(
+				mSubMesh->vertexData, mHardwareVertexAnimVertexData);
+		}
+
+	}
+
+
+}
Index: /OgreMain/src/OgreSubMesh.cpp
===================================================================
--- /OgreMain/src/OgreSubMesh.cpp	(revision 5)
+++ /OgreMain/src/OgreSubMesh.cpp	(revision 5)
@@ -0,0 +1,414 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreSubMesh.h"
+
+#include "OgreMesh.h"
+#include "OgreException.h"
+#include "OgreMeshManager.h"
+#include "OgreMaterialManager.h"
+#include "OgreStringConverter.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    SubMesh::SubMesh()
+        : useSharedVertices(true)
+        , operationType(RenderOperation::OT_TRIANGLE_LIST)
+        , vertexData(0)
+        , mMatInitialised(false)
+        , mBoneAssignmentsOutOfDate(false)
+		, mVertexAnimationType(VAT_NONE)
+    {
+		indexData = new IndexData();
+    }
+    //-----------------------------------------------------------------------
+    SubMesh::~SubMesh()
+    {
+        delete vertexData;
+		delete indexData;
+
+		removeLodLevels();
+    }
+
+    //-----------------------------------------------------------------------
+    void SubMesh::setMaterialName(const String& name)
+    {
+        mMaterialName = name;
+        mMatInitialised = true;
+    }
+    //-----------------------------------------------------------------------
+    const String& SubMesh::getMaterialName() const
+    {
+        return mMaterialName;
+    }
+    //-----------------------------------------------------------------------
+    bool SubMesh::isMatInitialised(void) const
+    {
+        return mMatInitialised;
+
+    }
+    //-----------------------------------------------------------------------
+    void SubMesh::_getRenderOperation(RenderOperation& ro, ushort lodIndex)
+    {
+
+		// SubMeshes always use indexes
+        ro.useIndexes = true;
+		if (lodIndex > 0 && static_cast< size_t >( lodIndex - 1 ) < mLodFaceList.size())
+		{
+			// lodIndex - 1 because we don't store full detail version in mLodFaceList
+			ro.indexData = mLodFaceList[lodIndex-1];
+        }
+        else
+        {
+    		ro.indexData = indexData;
+        }
+		ro.operationType = operationType;
+		ro.vertexData = useSharedVertices? parent->sharedVertexData : vertexData;
+
+    }
+    //-----------------------------------------------------------------------
+    void SubMesh::addBoneAssignment(const VertexBoneAssignment& vertBoneAssign)
+    {
+        if (useSharedVertices)
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "This SubMesh uses shared geometry,  you "
+                "must assign bones to the Mesh, not the SubMesh", "SubMesh.addBoneAssignment");
+        }
+        mBoneAssignments.insert(
+            VertexBoneAssignmentList::value_type(vertBoneAssign.vertexIndex, vertBoneAssign));
+        mBoneAssignmentsOutOfDate = true;
+    }
+    //-----------------------------------------------------------------------
+    void SubMesh::clearBoneAssignments(void)
+    {
+        mBoneAssignments.clear();
+        mBoneAssignmentsOutOfDate = true;
+    }
+
+    //-----------------------------------------------------------------------
+    void SubMesh::_compileBoneAssignments(void)
+    {
+        unsigned short maxBones =
+            parent->_rationaliseBoneAssignments(vertexData->vertexCount, mBoneAssignments);
+
+        if (maxBones != 0)
+        {
+            parent->compileBoneAssignments(mBoneAssignments, maxBones, 
+                blendIndexToBoneIndexMap, vertexData);
+        }
+
+        mBoneAssignmentsOutOfDate = false;
+    }
+    //---------------------------------------------------------------------
+    SubMesh::BoneAssignmentIterator SubMesh::getBoneAssignmentIterator(void)
+    {
+        return BoneAssignmentIterator(mBoneAssignments.begin(),
+            mBoneAssignments.end());
+    }
+    //---------------------------------------------------------------------
+    SubMesh::AliasTextureIterator SubMesh::getAliasTextureIterator(void) const
+    {
+        return AliasTextureIterator(mTextureAliases.begin(),
+            mTextureAliases.end());
+    }
+    //---------------------------------------------------------------------
+    void SubMesh::addTextureAlias(const String& aliasName, const String& textureName)
+    {
+        mTextureAliases[aliasName] = textureName;
+    }
+    //---------------------------------------------------------------------
+    void SubMesh::removeTextureAlias(const String& aliasName)
+    {
+        mTextureAliases.erase(aliasName);
+    }
+    //---------------------------------------------------------------------
+    void SubMesh::removeAllTextureAliases(void)
+    {
+        mTextureAliases.clear();
+    }
+    //---------------------------------------------------------------------
+    bool SubMesh::updateMaterialUsingTextureAliases(void)
+    {
+        bool newMaterialCreated = false;
+        // if submesh has texture aliases
+        // ask the material manager if the current summesh material exists
+        if (hasTextureAliases() && MaterialManager::getSingleton().resourceExists(mMaterialName))
+        {
+            // get the current submesh material
+            MaterialPtr material = MaterialManager::getSingleton().getByName( mMaterialName );
+            // get test result for if change will occur when the texture aliases are applied
+            if (material->applyTextureAliases(mTextureAliases, false))
+            {
+                // material textures will be changed so copy material,
+                // new material name is old material name + index
+                // check with material manager and find a unique name
+                size_t index = 0;
+                String newMaterialName = mMaterialName + "_" + StringConverter::toString(index);
+                while (MaterialManager::getSingleton().resourceExists(newMaterialName))
+                {
+                    // increment index for next name
+                    newMaterialName = mMaterialName + "_" + StringConverter::toString(++index);
+                }
+
+                Ogre::MaterialPtr newMaterial = Ogre::MaterialManager::getSingleton().create(
+                    newMaterialName, material->getGroup());
+                // copy parent material details to new material
+                material->copyDetailsTo(newMaterial);
+                // apply texture aliases to new material
+                newMaterial->applyTextureAliases(mTextureAliases);
+                // place new material name in submesh
+                setMaterialName(newMaterialName);
+                newMaterialCreated = true;
+            }
+        }
+
+        return newMaterialCreated;
+    }
+    //---------------------------------------------------------------------
+    void SubMesh::removeLodLevels(void)
+    {
+        ProgressiveMesh::LODFaceList::iterator lodi, lodend;
+		lodend = mLodFaceList.end();
+		for (lodi = mLodFaceList.begin(); lodi != lodend; ++lodi)
+		{
+			delete *lodi;
+		}
+
+        mLodFaceList.clear();
+
+    }
+	//---------------------------------------------------------------------
+	VertexAnimationType SubMesh::getVertexAnimationType(void) const
+	{
+		if(parent->_getAnimationTypesDirty())
+		{
+			parent->_determineAnimationTypes();
+		}
+		return mVertexAnimationType;
+	}
+	//---------------------------------------------------------------------
+    /* To find as many points from different domains as we need,
+     * such that those domains are from different parts of the mesh,
+     * we implement a simplified Heckbert quantization algorithm.
+     *
+     * This struct is like AxisAlignedBox with some specialized methods
+     * for doing quantization.
+     */
+    struct Cluster
+    {
+        Vector3 mMin, mMax;
+        std::set<uint32> mIndices;
+
+        Cluster ()
+        { }
+
+        bool empty () const
+        {
+            if (mIndices.empty ())
+                return true;
+            if (mMin == mMax)
+                return true;
+            return false;
+        }
+
+        float volume () const
+        {
+            return (mMax.x - mMin.x) * (mMax.y - mMin.y) * (mMax.z - mMin.z);
+        }
+
+        void extend (float *v)
+        {
+            if (v [0] < mMin.x) mMin.x = v [0];
+            if (v [1] < mMin.y) mMin.y = v [1];
+            if (v [2] < mMin.z) mMin.z = v [2];
+            if (v [0] > mMax.x) mMax.x = v [0];
+            if (v [1] > mMax.y) mMax.y = v [1];
+            if (v [2] > mMax.z) mMax.z = v [2];
+        }
+
+        void computeBBox (const VertexElement *poselem, uint8 *vdata, size_t vsz)
+        {
+            mMin.x = mMin.y = mMin.z = Math::POS_INFINITY;
+            mMax.x = mMax.y = mMax.z = Math::NEG_INFINITY;
+
+            for (std::set<uint32>::const_iterator i = mIndices.begin ();
+                 i != mIndices.end (); ++i)
+            {
+                float *v;
+                poselem->baseVertexPointerToElement (vdata + *i * vsz, &v);
+                extend (v);
+            }
+        }
+
+        Cluster split (int split_axis, const VertexElement *poselem,
+                       uint8 *vdata, size_t vsz)
+        {
+            Real r = (mMin [split_axis] + mMax [split_axis]) * 0.5;
+            Cluster newbox;
+
+            // Separate all points that are inside the new bbox
+            for (std::set<uint32>::iterator i = mIndices.begin ();
+                 i != mIndices.end (); )
+            {
+                float *v;
+                poselem->baseVertexPointerToElement (vdata + *i * vsz, &v);
+                if (v [split_axis] > r)
+                {
+                    newbox.mIndices.insert (*i);
+                    std::set<uint32>::iterator x = i++;
+                    mIndices.erase(x);
+                }
+                else
+                    ++i;
+            }
+
+            computeBBox (poselem, vdata, vsz);
+            newbox.computeBBox (poselem, vdata, vsz);
+
+            return newbox;
+        }
+    };
+    //---------------------------------------------------------------------
+    void SubMesh::generateExtremes(size_t count)
+    {
+        extremityPoints.clear();
+
+        /* Currently this uses just one criteria: the points must be
+         * as far as possible from each other. This at least ensures
+         * that the extreme points characterise the submesh as
+         * detailed as it's possible.
+         */
+
+        uint elsz = indexData->indexBuffer->getType () == HardwareIndexBuffer::IT_32BIT ?
+            4 : 2;
+        uint8 *idata = (uint8 *)indexData->indexBuffer->lock (
+            indexData->indexStart * elsz, indexData->indexCount * elsz,
+            HardwareIndexBuffer::HBL_READ_ONLY);
+
+        VertexData *vert = useSharedVertices ?
+            parent->sharedVertexData : vertexData;
+        const VertexElement *poselem = vert->vertexDeclaration->
+            findElementBySemantic (VES_POSITION);
+        HardwareVertexBufferSharedPtr vbuf = vert->vertexBufferBinding->
+            getBuffer (poselem->getSource ());
+        uint8 *vdata = (uint8 *)vbuf->lock (HardwareBuffer::HBL_READ_ONLY);
+        size_t vsz = vbuf->getVertexSize ();
+
+        std::vector<Cluster> boxes;
+        boxes.reserve (count);
+
+        // First of all, find min and max bounding box of the submesh
+        boxes.push_back (Cluster ());
+        for (size_t i = 0; i < indexData->indexCount; i++)
+        {
+            int idx = (elsz == 2) ? ((uint16 *)idata) [i] : ((uint32 *)idata) [i];
+            boxes [0].mIndices.insert (idx);
+        }
+
+        boxes [0].computeBBox (poselem, vdata, vsz);
+
+        // Remember the geometrical center of the submesh
+        Vector3 center = (boxes [0].mMax + boxes [0].mMin) * 0.5;
+
+        // Ok, now loop until we have as many boxes, as we need extremes
+        while (boxes.size () < count)
+        {
+            // Find the largest box with more than one vertex :)
+            Cluster *split_box = NULL;
+            Real split_volume = -1;
+            for (std::vector<Cluster>::iterator b = boxes.begin ();
+                 b != boxes.end (); ++b)
+            {
+                if (b->empty ())
+                    continue;
+                Real v = b->volume ();
+                if (v > split_volume)
+                {
+                    split_volume = v;
+                    split_box = &*b;
+                }
+            }
+
+            // If we don't have what to split, break
+            if (!split_box)
+                break;
+
+            // Find the coordinate axis to split the box into two
+            int split_axis = 0;
+            Real split_length = split_box->mMax.x - split_box->mMin.x;
+            for (int i = 1; i < 3; i++)
+            {
+                Real l = split_box->mMax [i] - split_box->mMin [i];
+                if (l > split_length)
+                {
+                    split_length = l;
+                    split_axis = i;
+                }
+            }
+
+            // Now split the box into halves
+            boxes.push_back (split_box->split (split_axis, poselem, vdata, vsz));
+        }
+
+        // Fine, now from every cluster choose the vertex that is most
+        // distant from the geometrical center and from other extremes.
+        for (std::vector<Cluster>::const_iterator b = boxes.begin ();
+             b != boxes.end (); ++b)
+        {
+            Real rating = 0;
+            Vector3 best_vertex;
+
+            for (std::set<uint32>::const_iterator i = b->mIndices.begin ();
+                 i != b->mIndices.end (); ++i)
+            {
+                float *v;
+                poselem->baseVertexPointerToElement (vdata + *i * vsz, &v);
+
+                Vector3 vv (v [0], v [1], v [2]);
+                Real r = (vv - center).squaredLength ();
+
+                for (std::vector<Vector3>::const_iterator e = extremityPoints.begin ();
+                     e != extremityPoints.end (); ++e)
+                    r += (*e - vv).squaredLength ();
+                if (r > rating)
+                {
+                    rating = r;
+                    best_vertex = vv;
+                }
+            }
+
+            if (rating > 0)
+                extremityPoints.push_back (best_vertex);
+        }
+
+        vbuf->unlock ();
+        indexData->indexBuffer->unlock ();
+    }
+}
+
Index: /OgreMain/src/OgreTagPoint.cpp
===================================================================
--- /OgreMain/src/OgreTagPoint.cpp	(revision 5)
+++ /OgreMain/src/OgreTagPoint.cpp	(revision 5)
@@ -0,0 +1,179 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreTagPoint.h"
+#include "OgreMatrix4.h"
+#include "OgreMatrix3.h"
+#include "OgreEntity.h"
+#include "OgreSceneNode.h"
+#include "OgreSkeleton.h"
+#include "OgreQuaternion.h"
+
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------------
+    TagPoint::TagPoint(unsigned short handle, Skeleton* creator)
+        : Bone(handle, creator)
+        , mParentEntity(0)
+        , mChildObject(0)
+        , mInheritParentEntityOrientation(true)
+        , mInheritParentEntityScale(true)
+    {
+    }
+    //-----------------------------------------------------------------------------
+    TagPoint::~TagPoint()
+    {
+    }
+    //-----------------------------------------------------------------------------
+    Entity *TagPoint::getParentEntity(void) const
+    {
+        return mParentEntity;
+    }
+    //-----------------------------------------------------------------------------
+    MovableObject* TagPoint::getChildObject(void) const
+    {
+        return mChildObject;
+    }
+    //-----------------------------------------------------------------------------
+    void TagPoint::setParentEntity(Entity *pEntity)
+    {
+        mParentEntity = pEntity;
+    }
+    //-----------------------------------------------------------------------------
+    void TagPoint::setChildObject(MovableObject *pObject)
+    {
+        mChildObject = pObject;
+    }
+    //-----------------------------------------------------------------------------
+    void TagPoint::setInheritParentEntityOrientation(bool inherit)
+    {
+        mInheritParentEntityOrientation = inherit;
+        needUpdate();
+    }
+    //-----------------------------------------------------------------------------
+    bool TagPoint::getInheritParentEntityOrientation(void) const
+    {
+        return mInheritParentEntityOrientation;
+    }
+    //-----------------------------------------------------------------------------
+    void TagPoint::setInheritParentEntityScale(bool inherit)
+    {
+        mInheritParentEntityScale = inherit;
+        needUpdate();
+    }
+    //-----------------------------------------------------------------------------
+    bool TagPoint::getInheritParentEntityScale(void) const
+    {
+        return mInheritParentEntityScale;
+    }
+    //-----------------------------------------------------------------------------
+    const Matrix4& TagPoint::_getFullLocalTransform(void) const
+    {
+        return mFullLocalTransform;
+    }
+    //-----------------------------------------------------------------------------
+    const Matrix4& TagPoint::getParentEntityTransform(void) const
+    {
+
+        return mParentEntity->_getParentNodeFullTransform();
+    }
+    //-----------------------------------------------------------------------------
+    void TagPoint::needUpdate(bool forceParentUpdate)
+    {
+		Bone::needUpdate(forceParentUpdate);
+
+        // We need to tell parent entities node
+        if (mParentEntity)
+        {
+            Node* n = mParentEntity->getParentNode();
+            if (n)
+            {
+                n->needUpdate();
+            }
+
+        }
+
+    }
+    //-----------------------------------------------------------------------------
+    void TagPoint::updateFromParentImpl(void) const
+    {
+        // Call superclass
+        Bone::updateFromParentImpl();
+
+        // Save transform for local skeleton
+        mFullLocalTransform.makeTransform(
+            mDerivedPosition,
+            mDerivedScale,
+            mDerivedOrientation);
+
+        // Include Entity transform
+        if (mParentEntity)
+        {
+            Node* entityParentNode = mParentEntity->getParentNode();
+            if (entityParentNode)
+            {
+                // Note: orientation/scale inherits from parent node already take care with
+                // Bone::_updateFromParent, don't do that with parent entity transform.
+
+                // Combine orientation with that of parent entity
+                const Quaternion& parentOrientation = entityParentNode->_getDerivedOrientation();
+                if (mInheritParentEntityOrientation)
+                {
+                    mDerivedOrientation = parentOrientation * mDerivedOrientation;
+                }
+
+                // Incorporate parent entity scale
+                const Vector3& parentScale = entityParentNode->_getDerivedScale();
+                if (mInheritParentEntityScale)
+                {
+                    mDerivedScale *= parentScale;
+                }
+
+                // Change position vector based on parent entity's orientation & scale
+                mDerivedPosition = parentOrientation * (parentScale * mDerivedPosition);
+
+                // Add altered position vector to parent entity
+                mDerivedPosition += entityParentNode->_getDerivedPosition();
+            }
+        }
+
+        if (mChildObject)
+        {
+            mChildObject->_notifyMoved();
+        }
+    }
+    //-----------------------------------------------------------------------------
+    const LightList& TagPoint::getLights(void) const
+    {
+        return mParentEntity->queryLights();
+    }
+
+}
Index: /OgreMain/src/OgreTechnique.cpp
===================================================================
--- /OgreMain/src/OgreTechnique.cpp	(revision 5)
+++ /OgreMain/src/OgreTechnique.cpp	(revision 5)
@@ -0,0 +1,996 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreTechnique.h"
+#include "OgreMaterial.h"
+#include "OgrePass.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreRenderSystemCapabilities.h"
+#include "OgreGpuProgramManager.h"
+#include "OgreMaterialManager.h"
+
+
+namespace Ogre {
+    //-----------------------------------------------------------------------------
+    Technique::Technique(Material* parent)
+        : mParent(parent), mIsSupported(false), mIlluminationPassesCompilationPhase(IPS_NOT_COMPILED), mLodIndex(0), mSchemeIndex(0)
+    {
+        // See above, defaults to unsupported until examined
+    }
+    //-----------------------------------------------------------------------------
+    Technique::Technique(Material* parent, const Technique& oth)
+        : mParent(parent), mLodIndex(0), mSchemeIndex(0)
+    {
+        // Copy using operator=
+        *this = oth;
+    }
+    //-----------------------------------------------------------------------------
+    Technique::~Technique()
+    {
+        removeAllPasses();
+        clearIlluminationPasses();
+    }
+    //-----------------------------------------------------------------------------
+    bool Technique::isSupported(void) const
+    {
+        return mIsSupported;
+    }
+    //-----------------------------------------------------------------------------
+    String Technique::_compile(bool autoManageTextureUnits)
+    {
+		StringUtil::StrStreamType compileErrors;
+
+		// assume not supported
+		mIsSupported = false;
+        // Go through each pass, checking requirements
+        Passes::iterator i;
+		unsigned short passNum = 0;
+		const RenderSystemCapabilities* caps =
+			Root::getSingleton().getRenderSystem()->getCapabilities();
+		unsigned short numTexUnits = caps->getNumTextureUnits();
+        for (i = mPasses.begin(); i != mPasses.end(); ++i, ++passNum)
+        {
+            Pass* currPass = *i;
+			// Adjust pass index
+			currPass->_notifyIndex(passNum);
+            // Check texture unit requirements
+            size_t numTexUnitsRequested = currPass->getNumTextureUnitStates();
+			// Don't trust getNumTextureUnits for programmable
+			if(!currPass->hasFragmentProgram())
+			{
+	#if defined(OGRE_PRETEND_TEXTURE_UNITS) && OGRE_PRETEND_TEXTURE_UNITS > 0
+				if (numTexUnits > OGRE_PRETEND_TEXTURE_UNITS)
+					numTexUnits = OGRE_PRETEND_TEXTURE_UNITS;
+	#endif
+				if (numTexUnitsRequested > numTexUnits)
+				{
+					if (!autoManageTextureUnits)
+					{
+						// The user disabled auto pass split
+						compileErrors << "Pass " << passNum << 
+							": Too many texture units for the current hardware and no splitting allowed."
+							<< std::endl;
+						return compileErrors.str();
+					}
+					else if (currPass->hasVertexProgram())
+					{
+						// Can't do this one, and can't split a programmable pass
+						compileErrors << "Pass " << passNum << 
+							": Too many texture units for the current hardware and "
+							"cannot split programmable passes."
+							<< std::endl;
+						return compileErrors.str();
+					}
+				}
+			}
+
+			if (currPass->hasVertexProgram())
+			{
+				// Check vertex program version
+				if (!currPass->getVertexProgram()->isSupported() )
+				{
+					// Can't do this one
+					compileErrors << "Pass " << passNum << 
+						": Vertex program " << currPass->getVertexProgram()->getName()
+						<< " cannot be used - ";
+					if (currPass->getVertexProgram()->hasCompileError())
+						compileErrors << "compile error.";
+					else
+						compileErrors << "not supported.";
+
+					compileErrors << std::endl;
+					return compileErrors.str();
+				}
+			}
+            if (currPass->hasFragmentProgram())
+            {
+                // Check fragment program version
+                if (!currPass->getFragmentProgram()->isSupported())
+                {
+                    // Can't do this one
+					compileErrors << "Pass " << passNum << 
+						": Fragment program " << currPass->getFragmentProgram()->getName()
+						<< " cannot be used - ";
+					if (currPass->getFragmentProgram()->hasCompileError())
+						compileErrors << "compile error.";
+					else
+						compileErrors << "not supported.";
+
+					compileErrors << std::endl;
+					return compileErrors.str();
+                }
+            }
+            else
+            {
+				// Check a few fixed-function options in texture layers
+                Pass::TextureUnitStateIterator texi = currPass->getTextureUnitStateIterator();
+				size_t texUnit = 0;
+				while (texi.hasMoreElements())
+				{
+					TextureUnitState* tex = texi.getNext();
+					// Any Cube textures? NB we make the assumption that any
+					// card capable of running fragment programs can support
+					// cubic textures, which has to be true, surely?
+					if (tex->is3D() && !caps->hasCapability(RSC_CUBEMAPPING))
+					{
+						// Fail
+						compileErrors << "Pass " << passNum << 
+							" Tex " << texUnit <<
+							": Cube maps not supported by current environment."
+							<< std::endl;
+						return compileErrors.str();
+					}
+					// Any 3D textures? NB we make the assumption that any
+					// card capable of running fragment programs can support
+					// 3D textures, which has to be true, surely?
+					if (tex->getTextureType() == TEX_TYPE_3D && !caps->hasCapability(RSC_TEXTURE_3D))
+					{
+						// Fail
+						compileErrors << "Pass " << passNum << 
+							" Tex " << texUnit <<
+							": Volume textures not supported by current environment."
+							<< std::endl;
+						return compileErrors.str();
+					}
+					// Any Dot3 blending?
+					if (tex->getColourBlendMode().operation == LBX_DOTPRODUCT &&
+							!caps->hasCapability(RSC_DOT3))
+					{
+						// Fail
+						compileErrors << "Pass " << passNum << 
+							" Tex " << texUnit <<
+							": DOT3 blending not supported by current environment."
+							<< std::endl;
+						return compileErrors.str();
+					}
+					++texUnit;
+				}
+
+				// We're ok on operations, now we need to check # texture units
+				if (!currPass->hasFragmentProgram())
+				{
+					// Keep splitting this pass so long as units requested > gpu units
+					while (numTexUnitsRequested > numTexUnits)
+					{
+						// chop this pass into many passes
+						currPass = currPass->_split(numTexUnits);
+						numTexUnitsRequested = currPass->getNumTextureUnitStates();
+						// Advance pass number
+						++passNum;
+						// Reset iterator
+						i = mPasses.begin() + passNum;
+						// Move the new pass to the right place (will have been created
+						// at the end, may be other passes in between)
+						assert(mPasses.back() == currPass);
+						std::copy_backward(i, (mPasses.end()-1), mPasses.end());
+						*i = currPass;
+						// Adjust pass index
+						currPass->_notifyIndex(passNum);
+					}
+				}
+            }
+
+		}
+        // If we got this far, we're ok
+        mIsSupported = true;
+
+        // Compile for categorised illumination on demand
+        clearIlluminationPasses();
+        mIlluminationPassesCompilationPhase = IPS_NOT_COMPILED;
+
+		return StringUtil::BLANK;
+
+    }
+    //-----------------------------------------------------------------------------
+    Pass* Technique::createPass(void)
+    {
+		Pass* newPass = new Pass(this, static_cast<unsigned short>(mPasses.size()));
+		mPasses.push_back(newPass);
+		return newPass;
+    }
+    //-----------------------------------------------------------------------------
+    Pass* Technique::getPass(unsigned short index)
+    {
+		assert(index < mPasses.size() && "Index out of bounds");
+		return mPasses[index];
+    }
+    //-----------------------------------------------------------------------------
+    Pass* Technique::getPass(const String& name)
+    {
+        Passes::iterator i    = mPasses.begin();
+        Passes::iterator iend = mPasses.end();
+        Pass* foundPass = 0;
+
+        // iterate through techniques to find a match
+        while (i != iend)
+        {
+            if ( (*i)->getName() == name )
+            {
+                foundPass = (*i);
+                break;
+            }
+            ++i;
+        }
+
+        return foundPass;
+    }
+    //-----------------------------------------------------------------------------
+    unsigned short Technique::getNumPasses(void) const
+    {
+		return static_cast<unsigned short>(mPasses.size());
+    }
+    //-----------------------------------------------------------------------------
+    void Technique::removePass(unsigned short index)
+    {
+		assert(index < mPasses.size() && "Index out of bounds");
+		Passes::iterator i = mPasses.begin() + index;
+		(*i)->queueForDeletion();
+		i = mPasses.erase(i);
+		// Adjust passes index
+		for (; i != mPasses.end(); ++i, ++index)
+		{
+			(*i)->_notifyIndex(index);
+		}
+    }
+    //-----------------------------------------------------------------------------
+    void Technique::removeAllPasses(void)
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->queueForDeletion();
+        }
+        mPasses.clear();
+    }
+
+    //-----------------------------------------------------------------------------
+    bool Technique::movePass(const unsigned short sourceIndex, const unsigned short destinationIndex)
+    {
+        bool moveSuccessful = false;
+
+        // don't move the pass if source == destination
+        if (sourceIndex == destinationIndex) return true;
+
+        if( (sourceIndex < mPasses.size()) && (destinationIndex < mPasses.size()))
+        {
+            Passes::iterator i = mPasses.begin() + sourceIndex;
+            //Passes::iterator DestinationIterator = mPasses.begin() + destinationIndex;
+
+            Pass* pass = (*i);
+            mPasses.erase(i);
+
+            i = mPasses.begin() + destinationIndex;
+
+            // compensate for source erase if destination is greater than source
+            if (destinationIndex > sourceIndex) --i;
+
+            mPasses.insert(i, pass);
+
+			// Adjust passes index
+			unsigned short beginIndex, endIndex;
+			if (destinationIndex > sourceIndex)
+			{
+				beginIndex = sourceIndex;
+				endIndex = destinationIndex;
+			}
+			else
+			{
+				beginIndex = destinationIndex;
+				endIndex = sourceIndex;
+			}
+			for (unsigned short index = beginIndex; index <= endIndex; ++index)
+			{
+				mPasses[index]->_notifyIndex(index);
+			}
+            moveSuccessful = true;
+        }
+
+        return moveSuccessful;
+    }
+
+    //-----------------------------------------------------------------------------
+    const Technique::PassIterator Technique::getPassIterator(void)
+    {
+		return PassIterator(mPasses.begin(), mPasses.end());
+    }
+    //-----------------------------------------------------------------------------
+    Technique& Technique::operator=(const Technique& rhs)
+    {
+        mName = rhs.mName;
+		this->mIsSupported = rhs.mIsSupported;
+        this->mLodIndex = rhs.mLodIndex;
+		this->mSchemeIndex = rhs.mSchemeIndex;
+		// copy passes
+		removeAllPasses();
+		Passes::const_iterator i, iend;
+		iend = rhs.mPasses.end();
+		for (i = rhs.mPasses.begin(); i != iend; ++i)
+		{
+			Pass* p = new Pass(this, (*i)->getIndex(), *(*i));
+			mPasses.push_back(p);
+		}
+        // Compile for categorised illumination on demand
+        clearIlluminationPasses();
+        mIlluminationPassesCompilationPhase = IPS_NOT_COMPILED;
+		return *this;
+    }
+    //-----------------------------------------------------------------------------
+    bool Technique::isTransparent(void) const
+    {
+        if (mPasses.empty())
+        {
+            return false;
+        }
+        else
+        {
+            // Base decision on the transparency of the first pass
+            return mPasses[0]->isTransparent();
+        }
+    }
+    //-----------------------------------------------------------------------------
+    bool Technique::isDepthWriteEnabled(void) const
+    {
+        if (mPasses.empty())
+        {
+            return false;
+        }
+        else
+        {
+            // Base decision on the depth settings of the first pass
+            return mPasses[0]->getDepthWriteEnabled();
+        }
+    }
+    //-----------------------------------------------------------------------------
+    bool Technique::isDepthCheckEnabled(void) const
+    {
+        if (mPasses.empty())
+        {
+            return false;
+        }
+        else
+        {
+            // Base decision on the depth settings of the first pass
+            return mPasses[0]->getDepthCheckEnabled();
+        }
+    }
+    //-----------------------------------------------------------------------------
+    bool Technique::hasColourWriteDisabled(void) const
+    {
+        if (mPasses.empty())
+        {
+            return true;
+        }
+        else
+        {
+            // Base decision on the colour write settings of the first pass
+            return !mPasses[0]->getColourWriteEnabled();
+        }
+    }
+    //-----------------------------------------------------------------------------
+    void Technique::_load(void)
+    {
+		assert (mIsSupported && "This technique is not supported");
+		// Load each pass
+		Passes::iterator i, iend;
+		iend = mPasses.end();
+		for (i = mPasses.begin(); i != iend; ++i)
+		{
+			(*i)->_load();
+		}
+
+		IlluminationPassList::iterator il, ilend;
+		ilend = mIlluminationPasses.end();
+		for (il = mIlluminationPasses.begin(); il != ilend; ++il)
+		{
+			if((*il)->pass != (*il)->originalPass)
+			    (*il)->pass->_load();
+		}
+    }
+    //-----------------------------------------------------------------------------
+    void Technique::_unload(void)
+    {
+		// Unload each pass
+		Passes::iterator i, iend;
+		iend = mPasses.end();
+		for (i = mPasses.begin(); i != iend; ++i)
+		{
+			(*i)->_unload();
+		}
+    }
+    //-----------------------------------------------------------------------------
+    bool Technique::isLoaded(void) const
+    {
+        // Only supported technique will be loaded
+        return mParent->isLoaded() && mIsSupported;
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setPointSize(Real ps)
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setPointSize(ps);
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setAmbient(Real red, Real green, Real blue)
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setAmbient(red, green, blue);
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setAmbient(const ColourValue& ambient)
+    {
+        setAmbient(ambient.r, ambient.g, ambient.b);
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setDiffuse(Real red, Real green, Real blue, Real alpha)
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setDiffuse(red, green, blue, alpha);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setDiffuse(const ColourValue& diffuse)
+    {
+        setDiffuse(diffuse.r, diffuse.g, diffuse.b, diffuse.a);
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setSpecular(Real red, Real green, Real blue, Real alpha)
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setSpecular(red, green, blue, alpha);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setSpecular(const ColourValue& specular)
+    {
+        setSpecular(specular.r, specular.g, specular.b, specular.a);
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setShininess(Real val)
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setShininess(val);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setSelfIllumination(Real red, Real green, Real blue)
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setSelfIllumination(red, green, blue);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setSelfIllumination(const ColourValue& selfIllum)
+    {
+        setSelfIllumination(selfIllum.r, selfIllum.g, selfIllum.b);
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setDepthCheckEnabled(bool enabled)
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setDepthCheckEnabled(enabled);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setDepthWriteEnabled(bool enabled)
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setDepthWriteEnabled(enabled);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setDepthFunction( CompareFunction func )
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setDepthFunction(func);
+        }
+    }
+    //-----------------------------------------------------------------------
+	void Technique::setColourWriteEnabled(bool enabled)
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setColourWriteEnabled(enabled);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setCullingMode( CullingMode mode )
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setCullingMode(mode);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setManualCullingMode( ManualCullingMode mode )
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setManualCullingMode(mode);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setLightingEnabled(bool enabled)
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setLightingEnabled(enabled);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setShadingMode( ShadeOptions mode )
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setShadingMode(mode);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setFog(bool overrideScene, FogMode mode, const ColourValue& colour,
+        Real expDensity, Real linearStart, Real linearEnd)
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setFog(overrideScene, mode, colour, expDensity, linearStart, linearEnd);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setDepthBias(float constantBias, float slopeScaleBias)
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setDepthBias(constantBias, slopeScaleBias);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setTextureFiltering(TextureFilterOptions filterType)
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setTextureFiltering(filterType);
+        }
+    }
+    // --------------------------------------------------------------------
+    void Technique::setTextureAnisotropy(unsigned int maxAniso)
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setTextureAnisotropy(maxAniso);
+        }
+    }
+    // --------------------------------------------------------------------
+    void Technique::setSceneBlending( const SceneBlendType sbt )
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setSceneBlending(sbt);
+        }
+    }
+    // --------------------------------------------------------------------
+    void Technique::setSceneBlending( const SceneBlendFactor sourceFactor,
+        const SceneBlendFactor destFactor)
+    {
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        for (i = mPasses.begin(); i != iend; ++i)
+        {
+            (*i)->setSceneBlending(sourceFactor, destFactor);
+        }
+    }
+
+    // --------------------------------------------------------------------
+    void Technique::setName(const String& name)
+    {
+        mName = name;
+    }
+
+
+    //-----------------------------------------------------------------------
+    void Technique::_notifyNeedsRecompile(void)
+    {
+        // Disable require to recompile when splitting illumination passes
+        if (mIlluminationPassesCompilationPhase != IPS_COMPILE_DISABLED)
+        {
+            mParent->_notifyNeedsRecompile();
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Technique::setLodIndex(unsigned short index)
+    {
+        mLodIndex = index;
+        _notifyNeedsRecompile();
+    }
+    //-----------------------------------------------------------------------
+	void Technique::setSchemeName(const String& schemeName)
+	{
+		mSchemeIndex = MaterialManager::getSingleton()._getSchemeIndex(schemeName);
+        _notifyNeedsRecompile();
+	}
+    //-----------------------------------------------------------------------
+	const String& Technique::getSchemeName(void) const
+	{
+		return MaterialManager::getSingleton()._getSchemeName(mSchemeIndex);
+	}
+    //-----------------------------------------------------------------------
+	unsigned short Technique::_getSchemeIndex(void) const
+	{
+		return mSchemeIndex;
+	}
+    //-----------------------------------------------------------------------
+    void Technique::_compileIlluminationPasses(void)
+    {
+        clearIlluminationPasses();
+
+        Passes::iterator i, iend;
+        iend = mPasses.end();
+        i = mPasses.begin();
+
+        IlluminationStage iStage = IS_AMBIENT;
+
+        bool haveAmbient = false;
+        while (i != iend)
+        {
+            IlluminationPass* iPass;
+            Pass* p = *i;
+            switch(iStage)
+            {
+            case IS_AMBIENT:
+                // Keep looking for ambient only
+                if (p->isAmbientOnly())
+                {
+                    // Add this pass wholesale
+                    iPass = new IlluminationPass();
+                    iPass->destroyOnShutdown = false;
+                    iPass->originalPass = iPass->pass = p;
+                    iPass->stage = iStage;
+                    mIlluminationPasses.push_back(iPass);
+                    haveAmbient = true;
+                    // progress to next pass
+                    ++i;
+                }
+                else
+                {
+                    // Split off any ambient part
+                    if (p->getAmbient() != ColourValue::Black ||
+                        p->getSelfIllumination() != ColourValue::Black ||
+                        p->getAlphaRejectFunction() != CMPF_ALWAYS_PASS)
+                    {
+                        // Copy existing pass
+                        Pass* newPass = new Pass(this, p->getIndex(), *p);
+                        if (newPass->getAlphaRejectFunction() != CMPF_ALWAYS_PASS)
+                        {
+                            // Alpha rejection passes must retain their transparency, so
+                            // we allow the texture units, but override the colour functions
+                            Pass::TextureUnitStateIterator tusi = newPass->getTextureUnitStateIterator();
+                            while (tusi.hasMoreElements())
+                            {
+                                TextureUnitState* tus = tusi.getNext();
+                                tus->setColourOperationEx(LBX_SOURCE1, LBS_CURRENT);
+                            }
+                        }
+                        else
+                        {
+                            // Remove any texture units
+                            newPass->removeAllTextureUnitStates();
+                        }
+                        // Remove any fragment program
+                        if (newPass->hasFragmentProgram())
+                            newPass->setFragmentProgram("");
+                        // We have to leave vertex program alone (if any) and
+                        // just trust that the author is using light bindings, which
+                        // we will ensure there are none in the ambient pass
+                        newPass->setDiffuse(0, 0, 0, newPass->getDiffuse().a);  // Preserving alpha
+                        newPass->setSpecular(ColourValue::Black);
+
+                        // Calculate hash value for new pass, because we are compiling
+                        // illumination passes on demand, which will loss hash calculate
+                        // before it add to render queue first time.
+                        newPass->_recalculateHash();
+
+                        iPass = new IlluminationPass();
+                        iPass->destroyOnShutdown = true;
+                        iPass->originalPass = p;
+                        iPass->pass = newPass;
+                        iPass->stage = iStage;
+
+                        mIlluminationPasses.push_back(iPass);
+                        haveAmbient = true;
+
+                    }
+
+                    if (!haveAmbient)
+                    {
+                        // Make up a new basic pass
+                        Pass* newPass = new Pass(this, p->getIndex());
+                        newPass->setAmbient(ColourValue::Black);
+                        newPass->setDiffuse(ColourValue::Black);
+
+                        // Calculate hash value for new pass, because we are compiling
+                        // illumination passes on demand, which will loss hash calculate
+                        // before it add to render queue first time.
+                        newPass->_recalculateHash();
+
+                        iPass = new IlluminationPass();
+                        iPass->destroyOnShutdown = true;
+                        iPass->originalPass = p;
+                        iPass->pass = newPass;
+                        iPass->stage = iStage;
+                        mIlluminationPasses.push_back(iPass);
+                        haveAmbient = true;
+                    }
+                    // This means we're done with ambients, progress to per-light
+                    iStage = IS_PER_LIGHT;
+                }
+                break;
+            case IS_PER_LIGHT:
+                if (p->getIteratePerLight())
+                {
+                    // If this is per-light already, use it directly
+                    iPass = new IlluminationPass();
+                    iPass->destroyOnShutdown = false;
+                    iPass->originalPass = iPass->pass = p;
+                    iPass->stage = iStage;
+                    mIlluminationPasses.push_back(iPass);
+                    // progress to next pass
+                    ++i;
+                }
+                else
+                {
+                    // Split off per-light details (can only be done for one)
+                    if (p->getLightingEnabled() &&
+                        (p->getDiffuse() != ColourValue::Black ||
+                        p->getSpecular() != ColourValue::Black))
+                    {
+                        // Copy existing pass
+                        Pass* newPass = new Pass(this, p->getIndex(), *p);
+                        if (newPass->getAlphaRejectFunction() != CMPF_ALWAYS_PASS)
+                        {
+                            // Alpha rejection passes must retain their transparency, so
+                            // we allow the texture units, but override the colour functions
+                            Pass::TextureUnitStateIterator tusi = newPass->getTextureUnitStateIterator();
+                            while (tusi.hasMoreElements())
+                            {
+                                TextureUnitState* tus = tusi.getNext();
+                                tus->setColourOperationEx(LBX_SOURCE1, LBS_CURRENT);
+                            }
+                        }
+                        else
+                        {
+                            // remove texture units
+                            newPass->removeAllTextureUnitStates();
+                        }
+                        // remove fragment programs
+                        if (newPass->hasFragmentProgram())
+                            newPass->setFragmentProgram("");
+                        // Cannot remove vertex program, have to assume that
+                        // it will process diffuse lights, ambient will be turned off
+                        newPass->setAmbient(ColourValue::Black);
+                        newPass->setSelfIllumination(ColourValue::Black);
+                        // must be additive
+                        newPass->setSceneBlending(SBF_ONE, SBF_ONE);
+
+                        // Calculate hash value for new pass, because we are compiling
+                        // illumination passes on demand, which will loss hash calculate
+                        // before it add to render queue first time.
+                        newPass->_recalculateHash();
+
+                        iPass = new IlluminationPass();
+                        iPass->destroyOnShutdown = true;
+                        iPass->originalPass = p;
+                        iPass->pass = newPass;
+                        iPass->stage = iStage;
+
+                        mIlluminationPasses.push_back(iPass);
+
+                    }
+                    // This means the end of per-light passes
+                    iStage = IS_DECAL;
+                }
+                break;
+            case IS_DECAL:
+                // We just want a 'lighting off' pass to finish off
+                // and only if there are texture units
+                if (p->getNumTextureUnitStates() > 0)
+                {
+                    if (!p->getLightingEnabled())
+                    {
+                        // we assume this pass already combines as required with the scene
+                        iPass = new IlluminationPass();
+                        iPass->destroyOnShutdown = false;
+                        iPass->originalPass = iPass->pass = p;
+                        iPass->stage = iStage;
+                        mIlluminationPasses.push_back(iPass);
+                    }
+                    else
+                    {
+                        // Copy the pass and tweak away the lighting parts
+                        Pass* newPass = new Pass(this, p->getIndex(), *p);
+                        newPass->setAmbient(ColourValue::Black);
+                        newPass->setDiffuse(0, 0, 0, newPass->getDiffuse().a);  // Preserving alpha
+                        newPass->setSpecular(ColourValue::Black);
+                        newPass->setSelfIllumination(ColourValue::Black);
+                        newPass->setLightingEnabled(false);
+						newPass->setIteratePerLight(false, false);
+                        // modulate
+                        newPass->setSceneBlending(SBF_DEST_COLOUR, SBF_ZERO);
+
+                        // Calculate hash value for new pass, because we are compiling
+                        // illumination passes on demand, which will loss hash calculate
+                        // before it add to render queue first time.
+                        newPass->_recalculateHash();
+
+                        // NB there is nothing we can do about vertex & fragment
+                        // programs here, so people will just have to make their
+                        // programs friendly-like if they want to use this technique
+                        iPass = new IlluminationPass();
+                        iPass->destroyOnShutdown = true;
+                        iPass->originalPass = p;
+                        iPass->pass = newPass;
+                        iPass->stage = iStage;
+                        mIlluminationPasses.push_back(iPass);
+
+                    }
+                }
+                ++i; // always increment on decal, since nothing more to do with this pass
+
+                break;
+            }
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void Technique::clearIlluminationPasses(void)
+    {
+        IlluminationPassList::iterator i, iend;
+        iend = mIlluminationPasses.end();
+        for (i = mIlluminationPasses.begin(); i != iend; ++i)
+        {
+            if ((*i)->destroyOnShutdown)
+            {
+                (*i)->pass->queueForDeletion();
+            }
+            delete *i;
+        }
+        mIlluminationPasses.clear();
+    }
+    //-----------------------------------------------------------------------
+    const Technique::IlluminationPassIterator
+    Technique::getIlluminationPassIterator(void)
+    {
+        IlluminationPassesState targetState = IPS_COMPILED;
+        if (mIlluminationPassesCompilationPhase != targetState)
+        {
+            // prevents parent->_notifyNeedsRecompile() call during compile
+            mIlluminationPassesCompilationPhase = IPS_COMPILE_DISABLED;
+            // Splitting the passes into illumination passes
+            _compileIlluminationPasses();
+            // Mark that illumination passes compilation finished
+            mIlluminationPassesCompilationPhase = targetState;
+        }
+
+        return IlluminationPassIterator(mIlluminationPasses.begin(),
+            mIlluminationPasses.end());
+    }
+    //-----------------------------------------------------------------------
+	const String& Technique::getResourceGroup(void) const
+	{
+		return mParent->getGroup();
+	}
+
+    //-----------------------------------------------------------------------
+    bool Technique::applyTextureAliases(const AliasTextureNamePairList& aliasList, const bool apply) const
+    {
+        // iterate through passes and apply texture alias
+        Passes::const_iterator i, iend;
+        iend = mPasses.end();
+        bool testResult = false;
+
+        for(i = mPasses.begin(); i != iend; ++i)
+        {
+            if ((*i)->applyTextureAliases(aliasList, apply))
+                testResult = true;
+        }
+
+        return testResult;
+    }
+
+}
Index: /OgreMain/src/OgreTextAreaOverlayElement.cpp
===================================================================
--- /OgreMain/src/OgreTextAreaOverlayElement.cpp	(revision 5)
+++ /OgreMain/src/OgreTextAreaOverlayElement.cpp	(revision 5)
@@ -0,0 +1,710 @@
+/*-------------------------------------------------------------------------
+This source file is a part of OGRE
+(Object-oriented Graphics Rendering Engine)
+
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License (LGPL) as 
+published by the Free Software Foundation; either version 2.1 of the 
+License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful, but 
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
+or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License 
+along with this library; if not, write to the Free Software Foundation, 
+Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA or go to
+http://www.gnu.org/copyleft/lesser.txt
+-------------------------------------------------------------------------*/
+#include "OgreStableHeaders.h"
+
+#include "OgreTextAreaOverlayElement.h"
+#include "OgreRoot.h"
+#include "OgreLogManager.h"
+#include "OgreOverlayManager.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreException.h"
+#include "OgreStringConverter.h"
+#include "OgreFont.h"
+#include "OgreFontManager.h"
+
+namespace Ogre {
+
+#define DEFAULT_INITIAL_CHARS 12
+    //---------------------------------------------------------------------
+    String TextAreaOverlayElement::msTypeName = "TextArea";
+    TextAreaOverlayElement::CmdCharHeight TextAreaOverlayElement::msCmdCharHeight;
+    TextAreaOverlayElement::CmdSpaceWidth TextAreaOverlayElement::msCmdSpaceWidth;
+    TextAreaOverlayElement::CmdFontName TextAreaOverlayElement::msCmdFontName;
+    TextAreaOverlayElement::CmdColour TextAreaOverlayElement::msCmdColour;
+    TextAreaOverlayElement::CmdColourBottom TextAreaOverlayElement::msCmdColourBottom;
+    TextAreaOverlayElement::CmdColourTop TextAreaOverlayElement::msCmdColourTop;
+    TextAreaOverlayElement::CmdAlignment TextAreaOverlayElement::msCmdAlignment;
+    //---------------------------------------------------------------------
+    #define POS_TEX_BINDING 0
+    #define COLOUR_BINDING 1
+	#define UNICODE_NEL 0x0085
+	#define UNICODE_CR 0x000D
+	#define UNICODE_LF 0x000A
+	#define UNICODE_SPACE 0x0020
+	#define UNICODE_ZERO 0x0030
+    //---------------------------------------------------------------------
+    TextAreaOverlayElement::TextAreaOverlayElement(const String& name)
+        : OverlayElement(name)
+    {
+        mTransparent = false;
+        mAlignment = Left;
+
+        mColourTop = ColourValue::White;
+        mColourBottom = ColourValue::White;
+        mColoursChanged = true;
+
+        mAllocSize = 0;
+
+        mCharHeight = 0.02;
+		mPixelCharHeight = 12;
+		mSpaceWidth = 0;
+		mPixelSpaceWidth = 0;
+		mViewportAspectCoef = 1;
+
+        if (createParamDictionary("TextAreaOverlayElement"))
+        {
+            addBaseParameters();
+        }
+    }
+
+    void TextAreaOverlayElement::initialise(void)
+    {
+		if (!mInitialised)
+		{
+			// Set up the render op
+			// Combine positions and texture coords since they tend to change together
+			// since character sizes are different
+			mRenderOp.vertexData = new VertexData();
+			VertexDeclaration* decl = mRenderOp.vertexData->vertexDeclaration;
+			size_t offset = 0;
+			// Positions
+			decl->addElement(POS_TEX_BINDING, offset, VET_FLOAT3, VES_POSITION);
+			offset += VertexElement::getTypeSize(VET_FLOAT3);
+			// Texcoords
+			decl->addElement(POS_TEX_BINDING, offset, VET_FLOAT2, VES_TEXTURE_COORDINATES, 0);
+			offset += VertexElement::getTypeSize(VET_FLOAT2);
+			// Colours - store these in a separate buffer because they change less often
+			decl->addElement(COLOUR_BINDING, 0, VET_COLOUR, VES_DIFFUSE);
+
+			mRenderOp.operationType = RenderOperation::OT_TRIANGLE_LIST;
+			mRenderOp.useIndexes = false;
+			mRenderOp.vertexData->vertexStart = 0;
+			// Vertex buffer will be created in checkMemoryAllocation
+
+			checkMemoryAllocation( DEFAULT_INITIAL_CHARS );
+
+			mInitialised = true;
+		}
+
+    }
+
+    void TextAreaOverlayElement::checkMemoryAllocation( size_t numChars )
+    {
+        if( mAllocSize < numChars)
+        {
+            // Create and bind new buffers
+            // Note that old buffers will be deleted automatically through reference counting
+            
+            // 6 verts per char since we're doing tri lists without indexes
+            // Allocate space for positions & texture coords
+            VertexDeclaration* decl = mRenderOp.vertexData->vertexDeclaration;
+            VertexBufferBinding* bind = mRenderOp.vertexData->vertexBufferBinding;
+
+            mRenderOp.vertexData->vertexCount = numChars * 6;
+
+            // Create dynamic since text tends to change alot
+            // positions & texcoords
+            HardwareVertexBufferSharedPtr vbuf = 
+                HardwareBufferManager::getSingleton().
+                    createVertexBuffer(
+                        decl->getVertexSize(POS_TEX_BINDING), 
+                        mRenderOp.vertexData->vertexCount,
+                        HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY);
+            bind->setBinding(POS_TEX_BINDING, vbuf);
+
+            // colours
+            vbuf = HardwareBufferManager::getSingleton().
+                    createVertexBuffer(
+                        decl->getVertexSize(COLOUR_BINDING), 
+                        mRenderOp.vertexData->vertexCount,
+                        HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY);
+            bind->setBinding(COLOUR_BINDING, vbuf);
+
+            mAllocSize = numChars;
+            mColoursChanged = true; // force colour buffer regeneration
+        }
+
+    }
+
+    void TextAreaOverlayElement::updatePositionGeometry()
+    {
+		float *pVert;
+
+		if (mpFont.isNull())
+		{
+			// not initialised yet, probably due to the order of creation in a template
+			return;
+		}
+
+		size_t charlen = mCaption.size();
+		checkMemoryAllocation( charlen );
+
+		mRenderOp.vertexData->vertexCount = charlen * 6;
+		// Get position / texcoord buffer
+		HardwareVertexBufferSharedPtr vbuf = 
+			mRenderOp.vertexData->vertexBufferBinding->getBuffer(POS_TEX_BINDING);
+		pVert = static_cast<float*>(
+			vbuf->lock(HardwareBuffer::HBL_DISCARD) );
+
+		float largestWidth = 0;
+		float left = _getDerivedLeft() * 2.0 - 1.0;
+		float top = -( (_getDerivedTop() * 2.0 ) - 1.0 );
+
+		// Derive space with from a number 0
+		if (mSpaceWidth == 0)
+		{
+			mSpaceWidth = mpFont->getGlyphAspectRatio(UNICODE_ZERO) * mCharHeight * 2.0 * mViewportAspectCoef;
+		}
+
+		// Use iterator
+		DisplayString::iterator i, iend;
+		iend = mCaption.end();
+		bool newLine = true;
+		for( i = mCaption.begin(); i != iend; ++i )
+		{
+			if( newLine )
+			{
+				Real len = 0.0f;
+				for( DisplayString::iterator j = i; j != iend; j++ )
+				{
+					Font::CodePoint character = OGRE_DEREF_DISPLAYSTRING_ITERATOR(j);
+					if (character == UNICODE_CR
+						|| character == UNICODE_NEL
+						|| character == UNICODE_LF) 
+					{
+						break;
+					}
+					else if (character == UNICODE_SPACE) // space
+					{
+						len += mSpaceWidth;
+					}
+					else 
+					{
+						len += mpFont->getGlyphAspectRatio(character) * mCharHeight * 2.0 * mViewportAspectCoef;
+					}
+				}
+
+				if( mAlignment == Right )
+					left -= len;
+				else if( mAlignment == Center )
+					left -= len * 0.5;
+
+				newLine = false;
+			}
+
+			Font::CodePoint character = OGRE_DEREF_DISPLAYSTRING_ITERATOR(i);
+			if (character == UNICODE_CR
+				|| character == UNICODE_NEL
+				|| character == UNICODE_LF)
+			{
+				left = _getDerivedLeft() * 2.0 - 1.0;
+				top -= mCharHeight * 2.0;
+				newLine = true;
+				// Also reduce tri count
+				mRenderOp.vertexData->vertexCount -= 6;
+
+				// consume CR/LF in one
+				if (character == UNICODE_CR)
+				{
+					DisplayString::iterator peeki = i;
+					peeki++;
+					if (peeki != iend && OGRE_DEREF_DISPLAYSTRING_ITERATOR(peeki) == UNICODE_LF)
+					{
+						i = peeki; // skip both as one newline
+						// Also reduce tri count
+						mRenderOp.vertexData->vertexCount -= 6;
+					}
+
+				}
+				continue;
+			}
+			else if (character == UNICODE_SPACE) // space
+			{
+				// Just leave a gap, no tris
+				left += mSpaceWidth;
+				// Also reduce tri count
+				mRenderOp.vertexData->vertexCount -= 6;
+				continue;
+			}
+
+			Real horiz_height = mpFont->getGlyphAspectRatio(character) * mViewportAspectCoef ;
+			const Font::UVRect& uvRect = mpFont->getGlyphTexCoords(character);
+
+			// each vert is (x, y, z, u, v)
+			//-------------------------------------------------------------------------------------
+			// First tri
+			//
+			// Upper left
+			*pVert++ = left;
+			*pVert++ = top;
+			*pVert++ = -1.0;
+			*pVert++ = uvRect.left;
+			*pVert++ = uvRect.top;
+
+			top -= mCharHeight * 2.0;
+
+			// Bottom left
+			*pVert++ = left;
+			*pVert++ = top;
+			*pVert++ = -1.0;
+			*pVert++ = uvRect.left;
+			*pVert++ = uvRect.bottom;
+
+			top += mCharHeight * 2.0;
+			left += horiz_height * mCharHeight * 2.0;
+
+			// Top right
+			*pVert++ = left;
+			*pVert++ = top;
+			*pVert++ = -1.0;
+			*pVert++ = uvRect.right;
+			*pVert++ = uvRect.top;
+			//-------------------------------------------------------------------------------------
+
+			//-------------------------------------------------------------------------------------
+			// Second tri
+			//
+			// Top right (again)
+			*pVert++ = left;
+			*pVert++ = top;
+			*pVert++ = -1.0;
+			*pVert++ = uvRect.right;
+			*pVert++ = uvRect.top;
+
+			top -= mCharHeight * 2.0;
+			left -= horiz_height  * mCharHeight * 2.0;
+
+			// Bottom left (again)
+			*pVert++ = left;
+			*pVert++ = top;
+			*pVert++ = -1.0;
+			*pVert++ = uvRect.left;
+			*pVert++ = uvRect.bottom;
+
+			left += horiz_height  * mCharHeight * 2.0;
+
+			// Bottom right
+			*pVert++ = left;
+			*pVert++ = top;
+			*pVert++ = -1.0;
+			*pVert++ = uvRect.right;
+			*pVert++ = uvRect.bottom;
+			//-------------------------------------------------------------------------------------
+
+			// Go back up with top
+			top += mCharHeight * 2.0;
+
+			float currentWidth = (left + 1)/2 - _getDerivedLeft();
+			if (currentWidth > largestWidth)
+			{
+				largestWidth = currentWidth;
+
+			}
+		}
+		// Unlock vertex buffer
+		vbuf->unlock();
+
+		if (mMetricsMode == GMM_PIXELS)
+		{
+			// Derive parametric version of dimensions
+			Real vpWidth;
+			vpWidth = (Real) (OverlayManager::getSingleton().getViewportWidth());
+
+			largestWidth *= vpWidth;
+		};
+
+		if (getWidth() < largestWidth)
+			setWidth(largestWidth);
+    }
+
+	void TextAreaOverlayElement::updateTextureGeometry()
+	{
+		// Nothing to do, we combine positions and textures
+	}
+
+    void TextAreaOverlayElement::setCaption( const DisplayString& caption )
+    {
+        mCaption = caption;
+		mGeomPositionsOutOfDate = true;
+		mGeomUVsOutOfDate = true;
+    }
+
+    void TextAreaOverlayElement::setFontName( const String& font )
+    {
+        mpFont = FontManager::getSingleton().getByName( font );
+        if (mpFont.isNull())
+			OGRE_EXCEPT( Exception::ERR_ITEM_NOT_FOUND, "Could not find font " + font,
+				"TextAreaOverlayElement::setFontName" );
+        mpFont->load();
+        mpMaterial = mpFont->getMaterial();
+        mpMaterial->setDepthCheckEnabled(false);
+        mpMaterial->setLightingEnabled(false);
+		
+		mGeomPositionsOutOfDate = true;
+		mGeomUVsOutOfDate = true;
+    }
+    const String& TextAreaOverlayElement::getFontName() const
+    {
+        return mpFont->getName();
+    }
+
+    void TextAreaOverlayElement::setCharHeight( Real height )
+    {
+        if (mMetricsMode != GMM_RELATIVE)
+        {
+            mPixelCharHeight = static_cast<unsigned>(height);
+        }
+        else
+        {
+            mCharHeight = height;
+        }
+        mGeomPositionsOutOfDate = true;
+    }
+	Real TextAreaOverlayElement::getCharHeight() const
+	{
+		if (mMetricsMode == GMM_PIXELS)
+		{
+			return mPixelCharHeight;
+		}
+		else
+		{
+			return mCharHeight;
+		}
+	}
+
+    void TextAreaOverlayElement::setSpaceWidth( Real width )
+    {
+        if (mMetricsMode != GMM_RELATIVE)
+        {
+            mPixelSpaceWidth = static_cast<unsigned>(width);
+        }
+        else
+        {
+            mSpaceWidth = width;
+        }
+
+        mGeomPositionsOutOfDate = true;
+    }
+	Real TextAreaOverlayElement::getSpaceWidth() const
+	{
+		if (mMetricsMode == GMM_PIXELS)
+		{
+			return mPixelSpaceWidth;
+		}
+		else
+		{
+			return mSpaceWidth;
+		}
+	}
+
+    //---------------------------------------------------------------------
+    TextAreaOverlayElement::~TextAreaOverlayElement()
+    {
+        delete mRenderOp.vertexData;
+    }
+    //---------------------------------------------------------------------
+    const String& TextAreaOverlayElement::getTypeName(void) const
+    {
+        return msTypeName;
+    }
+    //---------------------------------------------------------------------
+    void TextAreaOverlayElement::getRenderOperation(RenderOperation& op)
+    {
+        op = mRenderOp;
+    }
+    //---------------------------------------------------------------------
+    void TextAreaOverlayElement::setMaterialName(const String& matName)
+    {
+        OverlayElement::setMaterialName(matName);
+    }
+    //---------------------------------------------------------------------
+    void TextAreaOverlayElement::addBaseParameters(void)
+    {
+        OverlayElement::addBaseParameters();
+        ParamDictionary* dict = getParamDictionary();
+
+        dict->addParameter(ParameterDef("char_height", 
+            "Sets the height of the characters in relation to the screen."
+            , PT_REAL),
+            &msCmdCharHeight);
+
+        dict->addParameter(ParameterDef("space_width", 
+            "Sets the width of a space in relation to the screen."
+            , PT_REAL),
+            &msCmdSpaceWidth);
+
+        dict->addParameter(ParameterDef("font_name", 
+            "Sets the name of the font to use."
+            , PT_STRING),
+            &msCmdFontName);
+
+        dict->addParameter(ParameterDef("colour", 
+            "Sets the colour of the font (a solid colour)."
+            , PT_STRING),
+            &msCmdColour);
+
+        dict->addParameter(ParameterDef("colour_bottom", 
+            "Sets the colour of the font at the bottom (a gradient colour)."
+            , PT_STRING),
+            &msCmdColourBottom);
+
+        dict->addParameter(ParameterDef("colour_top", 
+            "Sets the colour of the font at the top (a gradient colour)."
+            , PT_STRING),
+            &msCmdColourTop);
+
+        dict->addParameter(ParameterDef("alignment", 
+            "Sets the alignment of the text: 'left', 'center' or 'right'."
+            , PT_STRING),
+            &msCmdAlignment);
+    }
+    //---------------------------------------------------------------------
+    void TextAreaOverlayElement::setColour(const ColourValue& col)
+    {
+        mColourBottom = mColourTop = col;
+        mColoursChanged = true;
+    }
+    //---------------------------------------------------------------------
+    const ColourValue& TextAreaOverlayElement::getColour(void) const
+    {
+        // Either one
+        return mColourTop;
+    }
+    //---------------------------------------------------------------------
+    void TextAreaOverlayElement::setColourBottom(const ColourValue& col)
+    {
+        mColourBottom = col;
+        mColoursChanged = true;
+    }
+    //---------------------------------------------------------------------
+    const ColourValue& TextAreaOverlayElement::getColourBottom(void) const
+    {
+        return mColourBottom;
+    }
+    //---------------------------------------------------------------------
+    void TextAreaOverlayElement::setColourTop(const ColourValue& col)
+    {
+        mColourTop = col;
+        mColoursChanged = true;
+    }
+    //---------------------------------------------------------------------
+    const ColourValue& TextAreaOverlayElement::getColourTop(void) const
+    {
+        return mColourTop;
+    }
+    //---------------------------------------------------------------------
+    void TextAreaOverlayElement::updateColours(void)
+    {
+        // Convert to system-specific
+        RGBA topColour, bottomColour;
+        Root::getSingleton().convertColourValue(mColourTop, &topColour);
+        Root::getSingleton().convertColourValue(mColourBottom, &bottomColour);
+
+        HardwareVertexBufferSharedPtr vbuf = 
+            mRenderOp.vertexData->vertexBufferBinding->getBuffer(COLOUR_BINDING);
+
+        RGBA* pDest = static_cast<RGBA*>(
+            vbuf->lock(HardwareBuffer::HBL_DISCARD) );
+
+        for (size_t i = 0; i < mAllocSize; ++i)
+        {
+            // First tri (top, bottom, top)
+            *pDest++ = topColour;
+            *pDest++ = bottomColour;
+            *pDest++ = topColour;
+            // Second tri (top, bottom, bottom)
+            *pDest++ = topColour;
+            *pDest++ = bottomColour;
+            *pDest++ = bottomColour;
+        }
+        vbuf->unlock();
+
+    }
+    //-----------------------------------------------------------------------
+    void TextAreaOverlayElement::setMetricsMode(GuiMetricsMode gmm)
+    {
+        Real vpWidth, vpHeight;
+
+		vpWidth = (Real) (OverlayManager::getSingleton().getViewportWidth());
+        vpHeight = (Real) (OverlayManager::getSingleton().getViewportHeight());
+		mViewportAspectCoef = vpHeight/vpWidth;
+
+		OverlayElement::setMetricsMode(gmm);
+        if (gmm != GMM_RELATIVE)
+        {
+            // Set pixel variables based on viewport multipliers
+            mPixelCharHeight = static_cast<unsigned>(mCharHeight * vpHeight);
+            mPixelSpaceWidth = static_cast<unsigned>(mSpaceWidth * vpHeight);
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    void TextAreaOverlayElement::_update(void)
+    {
+        Real vpWidth, vpHeight;
+
+        vpWidth = (Real) (OverlayManager::getSingleton().getViewportWidth());
+        vpHeight = (Real) (OverlayManager::getSingleton().getViewportHeight());
+		mViewportAspectCoef = vpHeight/vpWidth;
+		
+		if (mMetricsMode != GMM_RELATIVE && 
+            (OverlayManager::getSingleton().hasViewportChanged() || mGeomPositionsOutOfDate))
+        {
+            // Recalc character size
+
+            mCharHeight = (Real) mPixelCharHeight / vpHeight;
+            mSpaceWidth = (Real) mPixelSpaceWidth / vpHeight;
+			mGeomPositionsOutOfDate = true;
+        }
+        OverlayElement::_update();
+
+		if (mColoursChanged && mInitialised)
+		{
+			updateColours();
+			mColoursChanged = false;
+		}
+    }
+    //---------------------------------------------------------------------------------------------
+    // Char height command object
+    //
+    String TextAreaOverlayElement::CmdCharHeight::doGet( const void* target ) const
+    {
+        return StringConverter::toString( 
+            static_cast< const TextAreaOverlayElement* >( target )->getCharHeight() );
+    }
+    void TextAreaOverlayElement::CmdCharHeight::doSet( void* target, const String& val )
+    {
+        static_cast< TextAreaOverlayElement* >( target )->setCharHeight( 
+            StringConverter::parseReal( val ) );
+    }
+    //---------------------------------------------------------------------------------------------
+    // Space width command object
+    //
+    String TextAreaOverlayElement::CmdSpaceWidth::doGet( const void* target ) const
+    {
+        return StringConverter::toString( 
+            static_cast< const TextAreaOverlayElement* >( target )->getSpaceWidth() );
+    }
+    void TextAreaOverlayElement::CmdSpaceWidth::doSet( void* target, const String& val )
+    {
+        static_cast< TextAreaOverlayElement* >( target )->setSpaceWidth( 
+            StringConverter::parseReal( val ) );
+    }
+    //---------------------------------------------------------------------------------------------
+
+    //---------------------------------------------------------------------------------------------
+    // Font name command object
+    //
+    String TextAreaOverlayElement::CmdFontName::doGet( const void* target ) const
+    {
+        return static_cast< const TextAreaOverlayElement* >( target )->getFontName();
+    }
+    void TextAreaOverlayElement::CmdFontName::doSet( void* target, const String& val )
+    {
+        static_cast< TextAreaOverlayElement* >( target )->setFontName( val );
+    }
+    //---------------------------------------------------------------------------------------------
+    //---------------------------------------------------------------------------------------------
+    // Colour command object
+    //
+    String TextAreaOverlayElement::CmdColour::doGet( const void* target ) const
+    {
+        return StringConverter::toString (
+            static_cast< const TextAreaOverlayElement* >( target )->getColour());
+    }
+    void TextAreaOverlayElement::CmdColour::doSet( void* target, const String& val )
+    {
+        static_cast< TextAreaOverlayElement* >( target )->setColour( 
+            StringConverter::parseColourValue(val) );
+    }
+    //---------------------------------------------------------------------------------------------
+    //---------------------------------------------------------------------------------------------
+    //---------------------------------------------------------------------------------------------
+    // Top colour command object
+    //
+    String TextAreaOverlayElement::CmdColourTop::doGet( const void* target ) const
+    {
+        return StringConverter::toString (
+            static_cast< const TextAreaOverlayElement* >( target )->getColourTop());
+    }
+    void TextAreaOverlayElement::CmdColourTop::doSet( void* target, const String& val )
+    {
+        static_cast< TextAreaOverlayElement* >( target )->setColourTop( 
+            StringConverter::parseColourValue(val) );
+    }
+    //---------------------------------------------------------------------------------------------
+    //---------------------------------------------------------------------------------------------
+    //---------------------------------------------------------------------------------------------
+    // Bottom colour command object
+    //
+    String TextAreaOverlayElement::CmdColourBottom::doGet( const void* target ) const
+    {
+        return StringConverter::toString (
+            static_cast< const TextAreaOverlayElement* >( target )->getColourBottom());
+    }
+    void TextAreaOverlayElement::CmdColourBottom::doSet( void* target, const String& val )
+    {
+        static_cast< TextAreaOverlayElement* >( target )->setColourBottom( 
+            StringConverter::parseColourValue(val) );
+    }
+    //---------------------------------------------------------------------------------------------
+    //---------------------------------------------------------------------------------------------
+    //---------------------------------------------------------------------------------------------
+    // Alignment command object
+    //
+    String TextAreaOverlayElement::CmdAlignment::doGet( const void* target ) const
+    {
+        Alignment align = static_cast< const TextAreaOverlayElement* >( target )->getAlignment();
+        switch (align)
+        {
+            case Left:
+                return "left";
+            case Center:
+                return "center";
+            case Right:
+                return "right";
+                
+        }
+        // To keep compiler happy
+        return "left";
+    }
+    void TextAreaOverlayElement::CmdAlignment::doSet( void* target, const String& val )
+    {
+        if (val == "center")
+        {
+            static_cast< TextAreaOverlayElement* >( target )->setAlignment(Center);
+        }
+        else if (val == "right")
+        {
+            static_cast< TextAreaOverlayElement* >( target )->setAlignment(Right);
+        }
+        else
+        {
+            static_cast< TextAreaOverlayElement* >( target )->setAlignment(Left);
+        }
+    }
+    //---------------------------------------------------------------------------------------------
+}
Index: /OgreMain/src/OgreTexture.cpp
===================================================================
--- /OgreMain/src/OgreTexture.cpp	(revision 5)
+++ /OgreMain/src/OgreTexture.cpp	(revision 5)
@@ -0,0 +1,388 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreLogManager.h"
+#include "OgreHardwarePixelBuffer.h"
+#include "OgreImage.h"
+#include "OgreTexture.h"
+#include "OgreException.h"
+#include "OgreResourceManager.h"
+#include "OgreTextureManager.h"
+
+namespace Ogre {
+	//--------------------------------------------------------------------------
+    Texture::Texture(ResourceManager* creator, const String& name, 
+        ResourceHandle handle, const String& group, bool isManual, 
+        ManualResourceLoader* loader)
+        : Resource(creator, name, handle, group, isManual, loader),
+            // init defaults; can be overridden before load()
+            mHeight(512),
+            mWidth(512),
+            mDepth(1),
+			mNumRequestedMipmaps(0),
+            mNumMipmaps(0),
+			mMipmapsHardwareGenerated(false),
+            mGamma(1.0f),
+            mTextureType(TEX_TYPE_2D),            
+            mFormat(PF_UNKNOWN),
+            mUsage(TU_DEFAULT),
+            mSrcFormat(PF_UNKNOWN),
+            mSrcWidth(0),
+            mSrcHeight(0), 
+            mSrcDepth(0),
+            mDesiredFormat(PF_UNKNOWN),
+            mDesiredIntegerBitDepth(0),
+            mDesiredFloatBitDepth(0),
+            mTreatLuminanceAsAlpha(false),
+            mInternalResourcesCreated(false)
+    {
+        if (createParamDictionary("Texture"))
+        {
+            // Define the parameters that have to be present to load
+            // from a generic source; actually there are none, since when
+            // predeclaring, you use a texture file which includes all the
+            // information required.
+        }
+
+		// Set some defaults for default load path
+		if (TextureManager::getSingletonPtr())
+		{
+			TextureManager& tmgr = TextureManager::getSingleton();
+			setNumMipmaps(tmgr.getDefaultNumMipmaps());
+			setDesiredBitDepths(tmgr.getPreferredIntegerBitDepth(), tmgr.getPreferredFloatBitDepth());
+		}
+
+        
+    }
+	//--------------------------------------------------------------------------
+	void Texture::loadRawData( DataStreamPtr& stream, 
+		ushort uWidth, ushort uHeight, PixelFormat eFormat)
+	{
+		Image img;
+		img.loadRawData(stream, uWidth, uHeight, eFormat);
+		loadImage(img);
+	}
+	//--------------------------------------------------------------------------    
+	void Texture::loadImage( const Image &img )
+	{
+		// Scope lock over load status
+		{
+			OGRE_LOCK_MUTEX(mLoadingStatusMutex)
+			if (mLoadingState != LOADSTATE_UNLOADED)
+			{
+				// no loading to be done
+				return;
+			}
+			mLoadingState = LOADSTATE_LOADING;
+		}
+
+		// Scope lock for actual loading
+		try
+		{
+			OGRE_LOCK_AUTO_MUTEX
+			std::vector<const Image*> imagePtrs;
+			imagePtrs.push_back(&img);
+			_loadImages( imagePtrs );
+
+		}
+		catch (...)
+		{
+			// Reset loading in-progress flag in case failed for some reason
+			OGRE_LOCK_MUTEX(mLoadingStatusMutex)
+			mLoadingState = LOADSTATE_UNLOADED;
+			// Re-throw
+			throw;
+		}
+
+		// Scope lock for loading progress
+		{
+			OGRE_LOCK_MUTEX(mLoadingStatusMutex)
+
+			// Now loaded
+			mLoadingState = LOADSTATE_LOADED;
+		}
+
+		// Notify manager
+		if(mCreator)
+			mCreator->_notifyResourceLoaded(this);
+
+		// No deferred loading events since this method is not called in background
+
+
+	}
+    //--------------------------------------------------------------------------
+    void Texture::setFormat(PixelFormat pf)
+    {
+        mFormat = pf;
+        mDesiredFormat = pf;
+        mSrcFormat = pf;
+    }
+    //--------------------------------------------------------------------------
+    bool Texture::hasAlpha(void) const
+    {
+        return PixelUtil::hasAlpha(mFormat);
+    }
+    //--------------------------------------------------------------------------
+    void Texture::setDesiredIntegerBitDepth(ushort bits)
+    {
+        mDesiredIntegerBitDepth = bits;
+    }
+    //--------------------------------------------------------------------------
+    ushort Texture::getDesiredIntegerBitDepth(void) const
+    {
+        return mDesiredIntegerBitDepth;
+    }
+    //--------------------------------------------------------------------------
+    void Texture::setDesiredFloatBitDepth(ushort bits)
+    {
+        mDesiredFloatBitDepth = bits;
+    }
+    //--------------------------------------------------------------------------
+    ushort Texture::getDesiredFloatBitDepth(void) const
+    {
+        return mDesiredFloatBitDepth;
+    }
+    //--------------------------------------------------------------------------
+    void Texture::setDesiredBitDepths(ushort integerBits, ushort floatBits)
+    {
+        mDesiredIntegerBitDepth = integerBits;
+        mDesiredFloatBitDepth = floatBits;
+    }
+    //--------------------------------------------------------------------------
+    void Texture::setTreatLuminanceAsAlpha(bool asAlpha)
+    {
+        mTreatLuminanceAsAlpha = asAlpha;
+    }
+    //--------------------------------------------------------------------------
+    bool Texture::getTreatLuminanceAsAlpha(void) const
+    {
+        return mTreatLuminanceAsAlpha;
+    }
+    //--------------------------------------------------------------------------
+	size_t Texture::calculateSize(void) const
+	{
+        return getNumFaces() * PixelUtil::getMemorySize(mWidth, mHeight, mDepth, mFormat);
+	}
+	//--------------------------------------------------------------------------
+	size_t Texture::getNumFaces(void) const
+	{
+		return getTextureType() == TEX_TYPE_CUBE_MAP ? 6 : 1;
+	}
+	//--------------------------------------------------------------------------
+    void Texture::_loadImages( const ConstImagePtrList& images )
+    {
+		if(images.size() < 1)
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Cannot load empty vector of images",
+			 "Texture::loadImages");
+        
+		// Set desired texture size and properties from images[0]
+		mSrcWidth = mWidth = images[0]->getWidth();
+		mSrcHeight = mHeight = images[0]->getHeight();
+		mSrcDepth = mDepth = images[0]->getDepth();
+
+        // Get source image format and adjust if required
+        mSrcFormat = images[0]->getFormat();
+        if (mTreatLuminanceAsAlpha && mSrcFormat == PF_L8)
+        {
+            mSrcFormat = PF_A8;
+        }
+
+        if (mDesiredFormat != PF_UNKNOWN)
+        {
+            // If have desired format, use it
+            mFormat = mDesiredFormat;
+        }
+        else
+        {
+            // Get the format according with desired bit depth
+            mFormat = PixelUtil::getFormatForBitDepths(mSrcFormat, mDesiredIntegerBitDepth, mDesiredFloatBitDepth);
+        }
+
+		// The custom mipmaps in the image have priority over everything
+        size_t imageMips = images[0]->getNumMipmaps();
+
+		if(imageMips > 0) {
+			mNumMipmaps = mNumRequestedMipmaps = images[0]->getNumMipmaps();
+			// Disable flag for auto mip generation
+			mUsage &= ~TU_AUTOMIPMAP;
+		}
+		
+        // Create the texture
+        createInternalResources();
+		// Check if we're loading one image with multiple faces
+		// or a vector of images representing the faces
+		size_t faces;
+		bool multiImage; // Load from multiple images?
+		if(images.size() > 1)
+		{
+			faces = images.size();
+			multiImage = true;
+		}
+		else
+		{
+			faces = images[0]->getNumFaces();
+			multiImage = false;
+		}
+		
+		// Check wether number of faces in images exceeds number of faces
+		// in this texture. If so, clamp it.
+		if(faces > getNumFaces())
+			faces = getNumFaces();
+		
+		// Say what we're doing
+		StringUtil::StrStreamType str;
+		str << "Texture: " << mName << ": Loading " << faces << " faces"
+			<< "(" << PixelUtil::getFormatName(images[0]->getFormat()) << "," <<
+			images[0]->getWidth() << "x" << images[0]->getHeight() << "x" << images[0]->getDepth() <<
+			") with ";
+		if (!(mMipmapsHardwareGenerated && mNumMipmaps == 0))
+			str << mNumMipmaps;
+		if(mUsage & TU_AUTOMIPMAP)
+		{
+			if (mMipmapsHardwareGenerated)
+				str << " hardware";
+
+			str << " generated mipmaps";
+		}
+		else
+		{
+			str << " custom mipmaps";
+		}
+ 		if(multiImage)
+			str << " from multiple Images.";
+		else
+			str << " from Image.";
+		// Scoped
+		{
+			// Print data about first destination surface
+			HardwarePixelBufferSharedPtr buf = getBuffer(0, 0); 
+			str << " Internal format is " << PixelUtil::getFormatName(buf->getFormat()) << 
+			"," << buf->getWidth() << "x" << buf->getHeight() << "x" << buf->getDepth() << ".";
+		}
+		LogManager::getSingleton().logMessage( 
+				LML_NORMAL, str.str());
+		
+		// Main loading loop
+        // imageMips == 0 if the image has no custom mipmaps, otherwise contains the number of custom mips
+        for(size_t mip = 0; mip<=imageMips; ++mip)
+        {
+            for(size_t i = 0; i < faces; ++i)
+            {
+                PixelBox src;
+                if(multiImage)
+                {
+                    // Load from multiple images
+                    src = images[i]->getPixelBox(0, mip);
+                }
+                else
+                {
+                    // Load from faces of images[0]
+                    src = images[0]->getPixelBox(i, mip);
+                }
+    
+                // Sets to treated format in case is difference
+                src.format = mSrcFormat;
+
+                if(mGamma != 1.0f) {
+                    // Apply gamma correction
+                    // Do not overwrite original image but do gamma correction in temporary buffer
+                    MemoryDataStreamPtr buf; // for scoped deletion of conversion buffer
+                    buf.bind(new MemoryDataStream(
+                        PixelUtil::getMemorySize(
+                            src.getWidth(), src.getHeight(), src.getDepth(), src.format)));
+                    
+                    PixelBox corrected = PixelBox(src.getWidth(), src.getHeight(), src.getDepth(), src.format, buf->getPtr());
+                    PixelUtil::bulkPixelConversion(src, corrected);
+                    
+                    Image::applyGamma(static_cast<uint8*>(corrected.data), mGamma, corrected.getConsecutiveSize(), 
+                        static_cast<uchar>(PixelUtil::getNumElemBits(src.format)));
+    
+                    // Destination: entire texture. blitFromMemory does the scaling to
+                    // a power of two for us when needed
+                    getBuffer(i, mip)->blitFromMemory(corrected);
+                }
+                else 
+                {
+                    // Destination: entire texture. blitFromMemory does the scaling to
+                    // a power of two for us when needed
+                    getBuffer(i, mip)->blitFromMemory(src);
+                }
+                
+            }
+        }
+        // Update size (the final size, not including temp space)
+        mSize = getNumFaces() * PixelUtil::getMemorySize(mWidth, mHeight, mDepth, mFormat);
+
+    }
+	//-----------------------------------------------------------------------------
+	void Texture::createInternalResources(void)
+	{
+		if (!mInternalResourcesCreated)
+		{
+			createInternalResourcesImpl();
+			mInternalResourcesCreated = true;
+		}
+	}
+	//-----------------------------------------------------------------------------
+	void Texture::freeInternalResources(void)
+	{
+		if (mInternalResourcesCreated)
+		{
+			freeInternalResourcesImpl();
+			mInternalResourcesCreated = false;
+		}
+	}
+	//-----------------------------------------------------------------------------
+	void Texture::unloadImpl(void)
+	{
+		freeInternalResources();
+	}
+    //-----------------------------------------------------------------------------   
+    void Texture::copyToTexture( TexturePtr& target )
+    {
+        if(target->getNumFaces() != getNumFaces())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+                "Texture types must match",
+                "Texture::copyToTexture");
+        }
+        size_t numMips = std::min(getNumMipmaps(), target->getNumMipmaps());
+        if((mUsage & TU_AUTOMIPMAP) || (target->getUsage()&TU_AUTOMIPMAP))
+            numMips = 0;
+        for(unsigned int face=0; face<getNumFaces(); face++)
+        {
+            for(unsigned int mip=0; mip<=numMips; mip++)
+            {
+                target->getBuffer(face, mip)->blit(getBuffer(face, mip));
+            }
+        }
+    }
+
+
+}
Index: /OgreMain/src/OgreTextureManager.cpp
===================================================================
--- /OgreMain/src/OgreTextureManager.cpp	(revision 5)
+++ /OgreMain/src/OgreTextureManager.cpp	(revision 5)
@@ -0,0 +1,237 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreTextureManager.h"
+#include "OgreException.h"
+#include "OgrePixelFormat.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    template<> TextureManager* Singleton<TextureManager>::ms_Singleton = 0;
+    TextureManager* TextureManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    TextureManager& TextureManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+    //-----------------------------------------------------------------------
+    TextureManager::TextureManager(void)
+         : mPreferredIntegerBitDepth(0)
+         , mPreferredFloatBitDepth(0)
+         , mDefaultNumMipmaps(MIP_UNLIMITED)
+    {
+        mResourceType = "Texture";
+        mLoadOrder = 75.0f;
+
+        // Subclasses should register (when this is fully constructed)
+    }
+    //-----------------------------------------------------------------------
+    TextureManager::~TextureManager()
+    {
+        // subclasses should unregister with resource group manager
+
+    }
+    //-----------------------------------------------------------------------
+    TexturePtr TextureManager::load(const String &name, const String& group,
+        TextureType texType, int numMipmaps, Real gamma, bool isAlpha, PixelFormat desiredFormat)
+    {
+		ResourceCreateOrRetrieveResult res = createOrRetrieve(name, group);
+        TexturePtr tex = res.first;
+		// Was it created?
+		if(res.second)
+        {
+            tex->setTextureType(texType);
+            tex->setNumMipmaps((numMipmaps == MIP_DEFAULT)? mDefaultNumMipmaps :
+				static_cast<size_t>(numMipmaps));
+            tex->setGamma(gamma);
+            tex->setTreatLuminanceAsAlpha(isAlpha);
+            tex->setFormat(desiredFormat);
+        }
+		tex->load();
+
+        return tex;
+    }
+
+    //-----------------------------------------------------------------------
+    TexturePtr TextureManager::loadImage( const String &name, const String& group,
+        const Image &img, TextureType texType, int numMipmaps, Real gamma, bool isAlpha, PixelFormat desiredFormat)
+    {
+        TexturePtr tex = create(name, group, true);
+
+        tex->setTextureType(texType);
+        tex->setNumMipmaps((numMipmaps == MIP_DEFAULT)? mDefaultNumMipmaps :
+			static_cast<size_t>(numMipmaps));
+        tex->setGamma(gamma);
+        tex->setTreatLuminanceAsAlpha(isAlpha);
+        tex->setFormat(desiredFormat);
+        tex->loadImage(img);
+
+        return tex;
+    }
+    //-----------------------------------------------------------------------
+    TexturePtr TextureManager::loadRawData(const String &name, const String& group,
+        DataStreamPtr& stream, ushort uWidth, ushort uHeight, 
+        PixelFormat format, TextureType texType, 
+        int numMipmaps, Real gamma)
+	{
+        TexturePtr tex = create(name, group, true);
+
+        tex->setTextureType(texType);
+        tex->setNumMipmaps((numMipmaps == MIP_DEFAULT)? mDefaultNumMipmaps :
+			static_cast<size_t>(numMipmaps));
+        tex->setGamma(gamma);
+		tex->loadRawData(stream, uWidth, uHeight, format);
+		
+        return tex;
+	}
+    //-----------------------------------------------------------------------
+    TexturePtr TextureManager::createManual(const String & name, const String& group,
+        TextureType texType, uint width, uint height, uint depth, int numMipmaps,
+        PixelFormat format, int usage, ManualResourceLoader* loader)
+    {
+        TexturePtr ret = create(name, group, true, loader);
+        ret->setTextureType(texType);
+        ret->setWidth(width);
+        ret->setHeight(height);
+		ret->setDepth(depth);
+        ret->setNumMipmaps((numMipmaps == MIP_DEFAULT)? mDefaultNumMipmaps :
+			static_cast<size_t>(numMipmaps));
+        ret->setFormat(format);
+        ret->setUsage(usage);
+		ret->createInternalResources();
+		return ret;
+    }
+    //-----------------------------------------------------------------------
+    void TextureManager::setPreferredIntegerBitDepth(ushort bits, bool reloadTextures)
+    {
+        mPreferredIntegerBitDepth = bits;
+
+        if (reloadTextures)
+        {
+            // Iterate throught all textures
+            for (ResourceMap::iterator it = mResources.begin(); it != mResources.end(); ++it)
+            {
+                Texture* texture = static_cast<Texture*>(it->second.get());
+                // Reload loaded and reloadable texture only
+                if (texture->isLoaded() && texture->isReloadable())
+                {
+                    texture->unload();
+                    texture->setDesiredIntegerBitDepth(bits);
+                    texture->load();
+                }
+                else
+                {
+                    texture->setDesiredIntegerBitDepth(bits);
+                }
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    ushort TextureManager::getPreferredIntegerBitDepth(void) const
+    {
+        return mPreferredIntegerBitDepth;
+    }
+    //-----------------------------------------------------------------------
+    void TextureManager::setPreferredFloatBitDepth(ushort bits, bool reloadTextures)
+    {
+        mPreferredFloatBitDepth = bits;
+
+        if (reloadTextures)
+        {
+            // Iterate throught all textures
+            for (ResourceMap::iterator it = mResources.begin(); it != mResources.end(); ++it)
+            {
+                Texture* texture = static_cast<Texture*>(it->second.get());
+                // Reload loaded and reloadable texture only
+                if (texture->isLoaded() && texture->isReloadable())
+                {
+                    texture->unload();
+                    texture->setDesiredFloatBitDepth(bits);
+                    texture->load();
+                }
+                else
+                {
+                    texture->setDesiredFloatBitDepth(bits);
+                }
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    ushort TextureManager::getPreferredFloatBitDepth(void) const
+    {
+        return mPreferredFloatBitDepth;
+    }
+    //-----------------------------------------------------------------------
+    void TextureManager::setPreferredBitDepths(ushort integerBits, ushort floatBits, bool reloadTextures)
+    {
+        mPreferredIntegerBitDepth = integerBits;
+        mPreferredFloatBitDepth = floatBits;
+
+        if (reloadTextures)
+        {
+            // Iterate throught all textures
+            for (ResourceMap::iterator it = mResources.begin(); it != mResources.end(); ++it)
+            {
+                Texture* texture = static_cast<Texture*>(it->second.get());
+                // Reload loaded and reloadable texture only
+                if (texture->isLoaded() && texture->isReloadable())
+                {
+                    texture->unload();
+                    texture->setDesiredBitDepths(integerBits, floatBits);
+                    texture->load();
+                }
+                else
+                {
+                    texture->setDesiredBitDepths(integerBits, floatBits);
+                }
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void TextureManager::setDefaultNumMipmaps( size_t num )
+    {
+        mDefaultNumMipmaps = num;
+    }
+    //-----------------------------------------------------------------------
+	bool TextureManager::isFormatSupported(TextureType ttype, PixelFormat format, int usage)
+	{
+		return getNativeFormat(ttype, format, usage) == format;
+	}
+    //-----------------------------------------------------------------------
+	bool TextureManager::isEquivalentFormatSupported(TextureType ttype, PixelFormat format, int usage)
+	{
+		PixelFormat supportedFormat = getNativeFormat(ttype, format, usage);
+
+		// Assume that same or greater number of bits means quality not degraded
+		return PixelUtil::getNumElemBits(supportedFormat) >= PixelUtil::getNumElemBits(format);
+		
+	}
+}
Index: /OgreMain/src/OgreTextureUnitState.cpp
===================================================================
--- /OgreMain/src/OgreTextureUnitState.cpp	(revision 5)
+++ /OgreMain/src/OgreTextureUnitState.cpp	(revision 5)
@@ -0,0 +1,1310 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreTextureUnitState.h"
+#include "OgrePass.h"
+#include "OgreMaterialManager.h"
+#include "OgreControllerManager.h"
+#include "OgreLogManager.h"
+#include "OgreException.h"
+#include "OgreTextureManager.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    TextureUnitState::TextureUnitState(Pass* parent)
+        : mCurrentFrame(0)
+		, mAnimDuration(0)
+		, mCubic(false)
+		, mTextureType(TEX_TYPE_2D)
+        , mDesiredFormat(PF_UNKNOWN)
+		, mTextureSrcMipmaps(MIP_DEFAULT)
+		, mTextureCoordSetIndex(0)
+		, mBorderColour(ColourValue::Black)
+		, mTextureLoadFailed(false)
+		, mIsAlpha(false)
+		, mRecalcTexMatrix(false)
+		, mUMod(0)
+		, mVMod(0)
+		, mUScale(1)
+		, mVScale(1)
+		, mRotate(0)
+		, mTexModMatrix(Matrix4::IDENTITY)
+		, mMinFilter(FO_LINEAR)
+		, mMagFilter(FO_LINEAR)
+		, mMipFilter(FO_POINT)
+		, mMaxAniso(MaterialManager::getSingleton().getDefaultAnisotropy())
+		, mMipmapBias(0)
+		, mIsDefaultAniso(true)
+		, mIsDefaultFiltering(true)
+		, mBindingType(BT_FRAGMENT)
+		, mContentType(CONTENT_NAMED)
+		, mParent(parent)
+		, mAnimController(0)
+    {
+		mColourBlendMode.blendType = LBT_COLOUR;
+		mAlphaBlendMode.operation = LBX_MODULATE;
+		mAlphaBlendMode.blendType = LBT_ALPHA;
+		mAlphaBlendMode.source1 = LBS_TEXTURE;
+		mAlphaBlendMode.source2 = LBS_CURRENT;
+		setColourOperation(LBO_MODULATE);
+		setTextureAddressingMode(TAM_WRAP);
+
+        mParent->_dirtyHash();
+
+    }
+
+    //-----------------------------------------------------------------------
+    TextureUnitState::TextureUnitState(Pass* parent, const TextureUnitState& oth )
+    {
+        mParent = parent;
+        mAnimController = 0;
+        *this = oth;
+    }
+
+    //-----------------------------------------------------------------------
+    TextureUnitState::TextureUnitState( Pass* parent, const String& texName, unsigned int texCoordSet)
+		: mCurrentFrame(0)
+		, mAnimDuration(0)
+		, mCubic(false)
+		, mTextureType(TEX_TYPE_2D)
+        , mDesiredFormat(PF_UNKNOWN)
+		, mTextureSrcMipmaps(MIP_DEFAULT)
+		, mTextureCoordSetIndex(0)
+		, mBorderColour(ColourValue::Black)
+		, mTextureLoadFailed(false)
+		, mIsAlpha(false)
+		, mRecalcTexMatrix(false)
+		, mUMod(0)
+		, mVMod(0)
+		, mUScale(1)
+		, mVScale(1)
+		, mRotate(0)
+		, mTexModMatrix(Matrix4::IDENTITY)
+		, mMinFilter(FO_LINEAR)
+		, mMagFilter(FO_LINEAR)
+		, mMipFilter(FO_POINT)
+		, mMaxAniso(MaterialManager::getSingleton().getDefaultAnisotropy())
+		, mIsDefaultAniso(true)
+		, mIsDefaultFiltering(true)
+		, mBindingType(BT_FRAGMENT)
+		, mContentType(CONTENT_NAMED)
+		, mParent(parent)
+		, mAnimController(0)
+    {
+
+        setTextureName(texName);
+        setTextureCoordSet(texCoordSet);
+
+        mParent->_dirtyHash();
+
+    }
+    //-----------------------------------------------------------------------
+    TextureUnitState::~TextureUnitState()
+    {
+        // Unload ensure all controllers destroyed
+        _unload();
+    }
+    //-----------------------------------------------------------------------
+    TextureUnitState & TextureUnitState::operator = ( 
+        const TextureUnitState &oth )
+    {
+        assert(mAnimController == 0);
+        assert(mEffects.empty());
+
+        // copy basic members (int's, real's)
+        memcpy( this, &oth, (uchar *)(&oth.mFrames) - (uchar *)(&oth) );
+        // copy complex members
+        mFrames  = oth.mFrames;
+		mFramePtrs = oth.mFramePtrs;
+        mName    = oth.mName;
+        mEffects = oth.mEffects;
+
+        mTextureNameAlias = oth.mTextureNameAlias;
+
+        // Can't sharing controllers with other TUS, reset to null to avoid potential bug.
+        for (EffectMap::iterator j = mEffects.begin(); j != mEffects.end(); ++j)
+        {
+            j->second.controller = 0;
+        }
+
+        // Load immediately if Material loaded
+        if (isLoaded())
+        {
+            _load();
+        }
+		// Tell parent to recalculate hash
+		mParent->_dirtyHash();
+
+        return *this;
+    }
+    //-----------------------------------------------------------------------
+    const String& TextureUnitState::getTextureName(void) const
+    {
+        // Return name of current frame
+        if (mCurrentFrame < mFrames.size())
+            return mFrames[mCurrentFrame];
+        else
+            return StringUtil::BLANK;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setTextureName( const String& name, TextureType texType)
+    {
+		setContentType(CONTENT_NAMED);
+		mTextureLoadFailed = false;
+
+		if (texType == TEX_TYPE_CUBE_MAP)
+        {
+            // delegate to cubic texture implementation
+            setCubicTextureName(name, true);
+        }
+        else
+        {
+            mFrames.resize(1);
+			mFramePtrs.resize(1);
+            mFrames[0] = name;
+			mFramePtrs[0].setNull();
+			// defer load until used, so don't grab pointer yet
+            mCurrentFrame = 0;
+            mCubic = false;
+            mTextureType = texType;
+            if (name.empty())
+            {
+                return;
+            }
+
+            
+            // Load immediately ?
+            if (isLoaded())
+            {
+                _load(); // reload
+            }
+			// Tell parent to recalculate hash
+			mParent->_dirtyHash();
+        }
+
+    }
+	//-----------------------------------------------------------------------
+	void TextureUnitState::setBindingType(TextureUnitState::BindingType bt)
+	{
+		mBindingType = bt;
+
+	}
+	//-----------------------------------------------------------------------
+	TextureUnitState::BindingType TextureUnitState::getBindingType(void) const
+	{
+		return mBindingType;
+	}
+	//-----------------------------------------------------------------------
+	void TextureUnitState::setContentType(TextureUnitState::ContentType ct)
+	{
+		mContentType = ct;
+		if (ct == CONTENT_SHADOW)
+		{
+			// Clear out texture frames, not applicable
+			mFrames.clear();
+			// One reference space, set manually through _setTexturePtr
+			mFramePtrs.resize(1);
+			mFramePtrs[0].setNull();
+		}
+	}
+	//-----------------------------------------------------------------------
+	TextureUnitState::ContentType TextureUnitState::getContentType(void) const
+	{
+		return mContentType;
+	}
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setCubicTextureName( const String& name, bool forUVW)
+    {
+        if (forUVW)
+        {
+            setCubicTextureName(&name, forUVW);
+        }
+        else
+        {
+			setContentType(CONTENT_NAMED);
+			mTextureLoadFailed = false;
+            String ext;
+            String suffixes[6] = {"_fr", "_bk", "_lf", "_rt", "_up", "_dn"};
+            String baseName;
+            String fullNames[6];
+
+            size_t pos = name.find_last_of(".");
+			if( pos != String::npos )
+			{
+				baseName = name.substr(0, pos);
+				ext = name.substr(pos);
+			}
+			else
+				baseName = name;
+
+            for (int i = 0; i < 6; ++i)
+            {
+                fullNames[i] = baseName + suffixes[i] + ext;
+            }
+
+            setCubicTextureName(fullNames, forUVW);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setCubicTextureName(const String* const names, bool forUVW)
+    {
+		setContentType(CONTENT_NAMED);
+		mTextureLoadFailed = false;
+        mFrames.resize(forUVW ? 1 : 6);
+		// resize pointers, but don't populate until asked for
+        mFramePtrs.resize(forUVW ? 1 : 6);
+        mCurrentFrame = 0;
+        mCubic = true;
+        mTextureType = forUVW ? TEX_TYPE_CUBE_MAP : TEX_TYPE_2D;
+
+        for (unsigned int i = 0; i < mFrames.size(); ++i)
+        {
+            mFrames[i] = names[i];
+			mFramePtrs[i].setNull();
+        }
+        // Tell parent we need recompiling, will cause reload too
+        mParent->_notifyNeedsRecompile();
+    }
+    //-----------------------------------------------------------------------
+    bool TextureUnitState::isCubic(void) const
+    {
+        return mCubic;
+    }
+    //-----------------------------------------------------------------------
+    bool TextureUnitState::is3D(void) const
+    {
+        return mTextureType == TEX_TYPE_CUBE_MAP;
+    }
+    //-----------------------------------------------------------------------
+    TextureType TextureUnitState::getTextureType(void) const
+    {
+        return mTextureType;
+
+    }
+
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setFrameTextureName(const String& name, unsigned int frameNumber)
+    {
+		mTextureLoadFailed = false;
+        if (frameNumber < mFrames.size())
+        {
+            mFrames[frameNumber] = name;
+			// reset pointer (don't populate until requested)
+			mFramePtrs[frameNumber].setNull();	
+
+            if (isLoaded())
+            {
+                _load(); // reload
+            }
+			// Tell parent to recalculate hash
+			mParent->_dirtyHash();
+        }
+        else // raise exception for frameNumber out of bounds
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "frameNumber paramter value exceeds number of stored frames.",
+                "TextureUnitState::setFrameTextureName");
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    void TextureUnitState::addFrameTextureName(const String& name)
+    {
+		setContentType(CONTENT_NAMED);
+		mTextureLoadFailed = false;
+
+        mFrames.push_back(name);
+		// Add blank pointer, load on demand
+		mFramePtrs.push_back(TexturePtr());
+
+        // Load immediately if Material loaded
+        if (isLoaded())
+        {
+            _load();
+        }
+		// Tell parent to recalculate hash
+		mParent->_dirtyHash();
+    }
+
+    //-----------------------------------------------------------------------
+    void TextureUnitState::deleteFrameTextureName(const size_t frameNumber)
+    {
+		mTextureLoadFailed = false;
+        if (frameNumber < mFrames.size())
+        {
+            mFrames.erase(mFrames.begin() + frameNumber);
+            mFramePtrs.erase(mFramePtrs.begin() + frameNumber);
+
+            if (isLoaded())
+            {
+                _load();
+            }
+			// Tell parent to recalculate hash
+			mParent->_dirtyHash();
+        }
+        else
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "frameNumber paramter value exceeds number of stored frames.",
+                "TextureUnitState::deleteFrameTextureName");
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setAnimatedTextureName( const String& name, unsigned int numFrames, Real duration)
+    {
+		setContentType(CONTENT_NAMED);
+		mTextureLoadFailed = false;
+
+		String ext;
+        String baseName;
+
+        size_t pos = name.find_last_of(".");
+        baseName = name.substr(0, pos);
+        ext = name.substr(pos);
+
+        mFrames.resize(numFrames);
+		// resize pointers, but don't populate until needed
+        mFramePtrs.resize(numFrames);
+        mAnimDuration = duration;
+        mCurrentFrame = 0;
+        mCubic = false;
+
+        for (unsigned int i = 0; i < mFrames.size(); ++i)
+        {
+			StringUtil::StrStreamType str;
+            str << baseName << "_" << i << ext;
+            mFrames[i] = str.str();
+			mFramePtrs[i].setNull();
+        }
+
+        // Load immediately if Material loaded
+        if (isLoaded())
+        {
+            _load();
+        }
+		// Tell parent to recalculate hash
+		mParent->_dirtyHash();
+
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setAnimatedTextureName(const String* const names, unsigned int numFrames, Real duration)
+    {
+		setContentType(CONTENT_NAMED);
+		mTextureLoadFailed = false;
+
+		mFrames.resize(numFrames);
+		// resize pointers, but don't populate until needed
+        mFramePtrs.resize(numFrames);
+        mAnimDuration = duration;
+        mCurrentFrame = 0;
+        mCubic = false;
+
+        for (unsigned int i = 0; i < mFrames.size(); ++i)
+        {
+            mFrames[i] = names[i];
+			mFramePtrs[i].setNull();
+        }
+
+        // Load immediately if Material loaded
+        if (isLoaded())
+        {
+            _load();
+        }
+		// Tell parent to recalculate hash
+		mParent->_dirtyHash();
+    }
+    //-----------------------------------------------------------------------
+    std::pair< size_t, size_t > TextureUnitState::getTextureDimensions( unsigned int frame ) const
+    {
+		
+		TexturePtr tex = _getTexturePtr(frame);
+	    if (tex.isNull())
+		    OGRE_EXCEPT( Exception::ERR_ITEM_NOT_FOUND, "Could not find texture " + mFrames[ frame ],
+		    "TextureUnitState::getTextureDimensions" );
+
+		return std::pair< size_t, size_t >( tex->getWidth(), tex->getHeight() );
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setCurrentFrame(unsigned int frameNumber)
+    {
+        if (frameNumber < mFrames.size())
+        {
+            mCurrentFrame = frameNumber;
+            // this will affect the hash
+            mParent->_dirtyHash();
+        }
+        else
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "frameNumber paramter value exceeds number of stored frames.",
+                "TextureUnitState::setCurrentFrame");
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    unsigned int TextureUnitState::getCurrentFrame(void) const
+    {
+        return mCurrentFrame;
+    }
+    //-----------------------------------------------------------------------
+    unsigned int TextureUnitState::getNumFrames(void) const
+    {
+        return (unsigned int)mFrames.size();
+    }
+    //-----------------------------------------------------------------------
+    const String& TextureUnitState::getFrameTextureName(unsigned int frameNumber) const
+    {
+        if (frameNumber >= mFrames.size())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "frameNumber paramter value exceeds number of stored frames.",
+                "TextureUnitState::getFrameTextureName");
+        }
+
+        return mFrames[frameNumber];
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setDesiredFormat(PixelFormat desiredFormat)
+    {
+        mDesiredFormat = desiredFormat;
+    }
+    //-----------------------------------------------------------------------
+    PixelFormat TextureUnitState::getDesiredFormat(void) const
+    {
+        return mDesiredFormat;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setNumMipmaps(int numMipmaps)
+    {
+        mTextureSrcMipmaps = numMipmaps;
+    }
+    //-----------------------------------------------------------------------
+    int TextureUnitState::getNumMipmaps(void) const
+    {
+        return mTextureSrcMipmaps;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setIsAlpha(bool isAlpha)
+    {
+        mIsAlpha = isAlpha;
+    }
+    //-----------------------------------------------------------------------
+    bool TextureUnitState::getIsAlpha(void) const
+    {
+        return mIsAlpha;
+    }
+    //-----------------------------------------------------------------------
+    unsigned int TextureUnitState::getTextureCoordSet(void) const
+    {
+        return mTextureCoordSetIndex;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setTextureCoordSet(unsigned int set)
+    {
+        mTextureCoordSetIndex = set;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setColourOperationEx(LayerBlendOperationEx op,
+        LayerBlendSource source1,
+        LayerBlendSource source2,
+        const ColourValue& arg1,
+        const ColourValue& arg2,
+        Real manualBlend)
+    {
+        mColourBlendMode.operation = op;
+        mColourBlendMode.source1 = source1;
+        mColourBlendMode.source2 = source2;
+        mColourBlendMode.colourArg1 = arg1;
+        mColourBlendMode.colourArg2 = arg2;
+        mColourBlendMode.factor = manualBlend;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setColourOperation(LayerBlendOperation op)
+    {
+        // Set up the multitexture and multipass blending operations
+        switch (op)
+        {
+        case LBO_REPLACE:
+            setColourOperationEx(LBX_SOURCE1, LBS_TEXTURE, LBS_CURRENT);
+            setColourOpMultipassFallback(SBF_ONE, SBF_ZERO);
+            break;
+        case LBO_ADD:
+            setColourOperationEx(LBX_ADD, LBS_TEXTURE, LBS_CURRENT);
+            setColourOpMultipassFallback(SBF_ONE, SBF_ONE);
+            break;
+        case LBO_MODULATE:
+            setColourOperationEx(LBX_MODULATE, LBS_TEXTURE, LBS_CURRENT);
+            setColourOpMultipassFallback(SBF_DEST_COLOUR, SBF_ZERO);
+            break;
+        case LBO_ALPHA_BLEND:
+            setColourOperationEx(LBX_BLEND_TEXTURE_ALPHA, LBS_TEXTURE, LBS_CURRENT);
+            setColourOpMultipassFallback(SBF_SOURCE_ALPHA, SBF_ONE_MINUS_SOURCE_ALPHA);
+            break;
+        }
+
+
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setColourOpMultipassFallback(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor)
+    {
+        mColourBlendFallbackSrc = sourceFactor;
+        mColourBlendFallbackDest = destFactor;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setAlphaOperation(LayerBlendOperationEx op,
+        LayerBlendSource source1,
+        LayerBlendSource source2,
+        Real arg1,
+        Real arg2,
+        Real manualBlend)
+    {
+        mAlphaBlendMode.operation = op;
+        mAlphaBlendMode.source1 = source1;
+        mAlphaBlendMode.source2 = source2;
+        mAlphaBlendMode.alphaArg1 = arg1;
+        mAlphaBlendMode.alphaArg2 = arg2;
+        mAlphaBlendMode.factor = manualBlend;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::addEffect(TextureEffect& effect)
+    {
+        // Ensure controller pointer is null
+        effect.controller = 0;
+
+        if (effect.type == ET_ENVIRONMENT_MAP 
+			|| effect.type == ET_UVSCROLL
+			|| effect.type == ET_USCROLL
+			|| effect.type == ET_VSCROLL
+			|| effect.type == ET_ROTATE
+            || effect.type == ET_PROJECTIVE_TEXTURE)
+        {
+            // Replace - must be unique
+            // Search for existing effect of this type
+            EffectMap::iterator i = mEffects.find(effect.type);
+            if (i != mEffects.end())
+            {
+                // Destroy old effect controller if exist
+                if (i->second.controller)
+                {
+                    ControllerManager::getSingleton().destroyController(i->second.controller);
+                }
+
+                mEffects.erase(i);
+            }
+        }
+
+        if (isLoaded())
+        {
+            // Create controller
+            createEffectController(effect);
+        }
+
+        // Record new effect
+        mEffects.insert(EffectMap::value_type(effect.type, effect));
+
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::removeAllEffects(void)
+    {
+        // Iterate over effects to remove controllers
+        EffectMap::iterator i, iend;
+        iend = mEffects.end();
+        for (i = mEffects.begin(); i != iend; ++i)
+        {
+            if (i->second.controller)
+            {
+                ControllerManager::getSingleton().destroyController(i->second.controller);
+            }
+        }
+
+        mEffects.clear();
+    }
+
+    //-----------------------------------------------------------------------
+    bool TextureUnitState::isBlank(void) const
+    {
+		if (mFrames.empty())
+			return true;
+		else
+			return mFrames[0].empty() || mTextureLoadFailed;
+    }
+
+    //-----------------------------------------------------------------------
+    SceneBlendFactor TextureUnitState::getColourBlendFallbackSrc(void) const
+    {
+        return mColourBlendFallbackSrc;
+    }
+    //-----------------------------------------------------------------------
+    SceneBlendFactor TextureUnitState::getColourBlendFallbackDest(void) const
+    {
+        return mColourBlendFallbackDest;
+    }
+    //-----------------------------------------------------------------------
+    const LayerBlendModeEx& TextureUnitState::getColourBlendMode(void) const
+    {
+        return mColourBlendMode;
+    }
+    //-----------------------------------------------------------------------
+    const LayerBlendModeEx& TextureUnitState::getAlphaBlendMode(void) const
+    {
+        return mAlphaBlendMode;
+    }
+    //-----------------------------------------------------------------------
+    const TextureUnitState::UVWAddressingMode& 
+	TextureUnitState::getTextureAddressingMode(void) const
+    {
+        return mAddressMode;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setTextureAddressingMode(
+		TextureUnitState::TextureAddressingMode tam)
+    {
+        mAddressMode.u = tam;
+        mAddressMode.v = tam;
+        mAddressMode.w = tam;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setTextureAddressingMode(
+		TextureUnitState::TextureAddressingMode u, 
+		TextureUnitState::TextureAddressingMode v,
+		TextureUnitState::TextureAddressingMode w)
+    {
+        mAddressMode.u = u;
+        mAddressMode.v = v;
+        mAddressMode.w = w;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setTextureAddressingMode(
+		const TextureUnitState::UVWAddressingMode& uvw)
+    {
+        mAddressMode = uvw;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setTextureBorderColour(const ColourValue& colour)
+    {
+        mBorderColour = colour;
+    }
+    //-----------------------------------------------------------------------
+    const ColourValue& TextureUnitState::getTextureBorderColour(void) const
+    {
+        return mBorderColour;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setEnvironmentMap(bool enable, EnvMapType envMapType)
+    {
+        if (enable)
+        {
+            TextureEffect eff;
+            eff.type = ET_ENVIRONMENT_MAP;
+
+            eff.subtype = envMapType;
+            addEffect(eff);
+        }
+        else
+        {
+            removeEffect(ET_ENVIRONMENT_MAP);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::removeEffect(TextureEffectType type)
+    {
+        // Get range of items matching this effect
+        std::pair< EffectMap::iterator, EffectMap::iterator > remPair = 
+            mEffects.equal_range( type );
+        // Remove controllers
+        for (EffectMap::iterator i = remPair.first; i != remPair.second; ++i)
+        {
+            if (i->second.controller)
+            {
+                ControllerManager::getSingleton().destroyController(i->second.controller);
+            }
+        }
+        // Erase         
+        mEffects.erase( remPair.first, remPair.second );
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setBlank(void)
+    {
+		setTextureName(StringUtil::BLANK);
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setTextureTransform(const Matrix4& xform)
+    {
+        mTexModMatrix = xform;
+        mRecalcTexMatrix = false;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setTextureScroll(Real u, Real v)
+    {
+        mUMod = u;
+        mVMod = v;
+        mRecalcTexMatrix = true;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setTextureScale(Real uScale, Real vScale)
+    {
+        mUScale = uScale;
+        mVScale = vScale;
+        mRecalcTexMatrix = true;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setTextureRotate(const Radian& angle)
+    {
+        mRotate = angle;
+        mRecalcTexMatrix = true;
+    }
+    //-----------------------------------------------------------------------
+    const Matrix4& TextureUnitState::getTextureTransform() const
+    {
+        if (mRecalcTexMatrix)
+            recalcTextureMatrix();
+        return mTexModMatrix;
+
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::recalcTextureMatrix() const
+    {
+        // Assumption: 2D texture coords
+        Matrix4 xform;
+
+        xform = Matrix4::IDENTITY;
+        if (mUScale != 1 || mVScale != 1)
+        {
+            // Offset to center of texture
+            xform[0][0] = 1/mUScale;
+            xform[1][1] = 1/mVScale;
+            // Skip matrix concat since first matrix update
+            xform[0][3] = (-0.5 * xform[0][0]) + 0.5;
+            xform[1][3] = (-0.5 * xform[1][1]) + 0.5;
+        }
+
+        if (mUMod || mVMod)
+        {
+            Matrix4 xlate = Matrix4::IDENTITY;
+
+            xlate[0][3] = mUMod;
+            xlate[1][3] = mVMod;
+
+            xform = xlate * xform;
+        }
+
+        if (mRotate != Radian(0))
+        {
+            Matrix4 rot = Matrix4::IDENTITY;
+            Radian theta ( mRotate );
+            Real cosTheta = Math::Cos(theta);
+            Real sinTheta = Math::Sin(theta);
+
+            rot[0][0] = cosTheta;
+            rot[0][1] = -sinTheta;
+            rot[1][0] = sinTheta;
+            rot[1][1] = cosTheta;
+            // Offset center of rotation to center of texture
+            rot[0][3] = 0.5 + ( (-0.5 * cosTheta) - (-0.5 * sinTheta) );
+            rot[1][3] = 0.5 + ( (-0.5 * sinTheta) + (-0.5 * cosTheta) );
+
+            xform = rot * xform;
+        }
+
+        mTexModMatrix = xform;
+        mRecalcTexMatrix = false;
+
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setTextureUScroll(Real value)
+    {
+        mUMod = value;
+        mRecalcTexMatrix = true;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setTextureVScroll(Real value)
+    {
+        mVMod = value;
+        mRecalcTexMatrix = true;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setTextureUScale(Real value)
+    {
+        mUScale = value;
+        mRecalcTexMatrix = true;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setTextureVScale(Real value)
+    {
+        mVScale = value;
+        mRecalcTexMatrix = true;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setScrollAnimation(Real uSpeed, Real vSpeed)
+    {
+        // Remove existing effects
+        removeEffect(ET_UVSCROLL);
+        removeEffect(ET_USCROLL);
+        removeEffect(ET_VSCROLL);
+        // Create new effect
+        TextureEffect eff;
+	if(uSpeed == vSpeed) 
+	{
+		eff.type = ET_UVSCROLL;
+		eff.arg1 = uSpeed;
+		addEffect(eff);
+	}
+	else
+	{
+		if(uSpeed)
+		{
+			eff.type = ET_USCROLL;
+        eff.arg1 = uSpeed;
+        addEffect(eff);
+    }
+		if(vSpeed)
+		{
+			eff.type = ET_VSCROLL;
+			eff.arg1 = vSpeed;
+			addEffect(eff);
+		}
+	}
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setRotateAnimation(Real speed)
+    {
+        // Remove existing effect
+        removeEffect(ET_ROTATE);
+        // Create new effect
+        TextureEffect eff;
+        eff.type = ET_ROTATE;
+        eff.arg1 = speed;
+        addEffect(eff);
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setTransformAnimation(TextureTransformType ttype,
+        WaveformType waveType, Real base, Real frequency, Real phase, Real amplitude)
+    {
+        // Remove existing effect
+        removeEffect(ET_TRANSFORM);
+        // Create new effect
+        TextureEffect eff;
+        eff.type = ET_TRANSFORM;
+        eff.subtype = ttype;
+        eff.waveType = waveType;
+        eff.base = base;
+        eff.frequency = frequency;
+        eff.phase = phase;
+        eff.amplitude = amplitude;
+        addEffect(eff);
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::_load(void)
+    {
+        // Unload first
+        _unload();
+
+        // Load textures
+		for (unsigned int i = 0; i < mFrames.size(); ++i)
+		{
+			ensureLoaded(i);
+		}
+        // Animation controller
+        if (mAnimDuration != 0)
+        {
+            createAnimController();
+        }
+        // Effect controllers
+        for (EffectMap::iterator it = mEffects.begin(); it != mEffects.end(); ++it)
+        {
+            createEffectController(it->second);
+        }
+
+    }
+    //-----------------------------------------------------------------------
+	const TexturePtr& TextureUnitState::_getTexturePtr(void) const
+	{
+		return _getTexturePtr(mCurrentFrame);
+	}
+    //-----------------------------------------------------------------------
+	const TexturePtr& TextureUnitState::_getTexturePtr(size_t frame) const
+	{
+		if (mContentType == CONTENT_NAMED)
+		{
+			if (frame < mFrames.size() && !mTextureLoadFailed)
+			{
+				ensureLoaded(frame);
+				return mFramePtrs[frame];
+			}
+			else
+			{
+				// Silent fail with empty texture for internal method
+				static TexturePtr nullTexPtr;
+				return nullTexPtr;
+			}
+		}
+		else
+		{
+			// Manually bound texture, no name or loading
+			assert(frame < mFramePtrs.size());
+			return mFramePtrs[frame];
+
+		}
+		
+	}
+	//-----------------------------------------------------------------------
+	void TextureUnitState::_setTexturePtr(const TexturePtr& texptr)
+	{
+		_setTexturePtr(texptr, mCurrentFrame);
+	}
+	//-----------------------------------------------------------------------
+	void TextureUnitState::_setTexturePtr(const TexturePtr& texptr, size_t frame)
+	{
+		assert(frame < mFramePtrs.size());
+		mFramePtrs[frame] = texptr;
+	}
+    //-----------------------------------------------------------------------
+	void TextureUnitState::ensureLoaded(size_t frame) const
+	{
+		if (!mFrames[frame].empty())
+		{
+			// Ensure texture is loaded, specified number of mipmaps and
+			// priority
+			if (mFramePtrs[frame].isNull())
+			{
+				try {
+					mFramePtrs[frame] = 
+						TextureManager::getSingleton().load(mFrames[frame], 
+							mParent->getResourceGroup(), mTextureType, 
+							mTextureSrcMipmaps, 1.0f, mIsAlpha, mDesiredFormat);
+				}
+				catch (Exception &e) {
+					String msg;
+					msg = msg + "Error loading texture " + mFrames[frame]  + 
+						". Texture layer will be blank. Loading the texture "
+						"failed with the following exception: " 
+						+ e.getFullDescription();
+					LogManager::getSingleton().logMessage(msg);
+					mTextureLoadFailed = true;
+				}	
+			}
+			else
+			{
+				// Just ensure existing pointer is loaded
+				mFramePtrs[frame]->load();
+			}
+		}
+	}
+    //-----------------------------------------------------------------------
+    void TextureUnitState::createAnimController(void)
+    {
+        assert(mAnimController == 0);
+        mAnimController = ControllerManager::getSingleton().createTextureAnimator(this, mAnimDuration);
+
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::createEffectController(TextureEffect& effect)
+    {
+        assert(effect.controller == 0);
+        ControllerManager& cMgr = ControllerManager::getSingleton();
+        switch (effect.type)
+        {
+        case ET_UVSCROLL:
+            effect.controller = cMgr.createTextureUVScroller(this, effect.arg1);
+            break;
+        case ET_USCROLL:
+            effect.controller = cMgr.createTextureUScroller(this, effect.arg1);
+            break;
+        case ET_VSCROLL:
+            effect.controller = cMgr.createTextureVScroller(this, effect.arg1);
+            break;
+        case ET_ROTATE:
+            effect.controller = cMgr.createTextureRotater(this, effect.arg1);
+            break;
+        case ET_TRANSFORM:
+            effect.controller = cMgr.createTextureWaveTransformer(this, (TextureUnitState::TextureTransformType)effect.subtype, effect.waveType, effect.base,
+                effect.frequency, effect.phase, effect.amplitude);
+            break;
+        case ET_ENVIRONMENT_MAP:
+            break;
+        default:
+            break;
+        }
+    }
+    //-----------------------------------------------------------------------
+	Real TextureUnitState::getTextureUScroll(void) const
+    {
+		return mUMod;
+    }
+
+	//-----------------------------------------------------------------------
+	Real TextureUnitState::getTextureVScroll(void) const
+    {
+		return mVMod;
+    }
+
+	//-----------------------------------------------------------------------
+	Real TextureUnitState::getTextureUScale(void) const
+    {
+		return mUScale;
+    }
+
+	//-----------------------------------------------------------------------
+	Real TextureUnitState::getTextureVScale(void) const
+    {
+		return mVScale;
+    }
+
+	//-----------------------------------------------------------------------
+	const Radian& TextureUnitState::getTextureRotate(void) const
+    {
+		return mRotate;
+    }
+	
+	//-----------------------------------------------------------------------
+	Real TextureUnitState::getAnimationDuration(void) const
+	{
+		return mAnimDuration;
+	}
+
+	//-----------------------------------------------------------------------
+	const TextureUnitState::EffectMap& TextureUnitState::getEffects(void) const
+	{
+		return mEffects;
+	}
+
+	//-----------------------------------------------------------------------
+	void TextureUnitState::setTextureFiltering(TextureFilterOptions filterType)
+	{
+        switch (filterType)
+        {
+        case TFO_NONE:
+            setTextureFiltering(FO_POINT, FO_POINT, FO_NONE);
+            break;
+        case TFO_BILINEAR:
+            setTextureFiltering(FO_LINEAR, FO_LINEAR, FO_POINT);
+            break;
+        case TFO_TRILINEAR:
+            setTextureFiltering(FO_LINEAR, FO_LINEAR, FO_LINEAR);
+            break;
+        case TFO_ANISOTROPIC:
+            setTextureFiltering(FO_ANISOTROPIC, FO_ANISOTROPIC, FO_LINEAR);
+            break;
+        }
+        mIsDefaultFiltering = false;
+	}
+	//-----------------------------------------------------------------------
+    void TextureUnitState::setTextureFiltering(FilterType ft, FilterOptions fo)
+    {
+        switch (ft)
+        {
+        case FT_MIN:
+            mMinFilter = fo;
+            break;
+        case FT_MAG:
+            mMagFilter = fo;
+            break;
+        case FT_MIP:
+            mMipFilter = fo;
+            break;
+        }
+        mIsDefaultFiltering = false;
+    }
+	//-----------------------------------------------------------------------
+    void TextureUnitState::setTextureFiltering(FilterOptions minFilter, 
+        FilterOptions magFilter, FilterOptions mipFilter)
+    {
+        mMinFilter = minFilter;
+        mMagFilter = magFilter;
+        mMipFilter = mipFilter;
+        mIsDefaultFiltering = false;
+    }
+	//-----------------------------------------------------------------------
+	FilterOptions TextureUnitState::getTextureFiltering(FilterType ft) const
+	{
+
+        switch (ft)
+        {
+        case FT_MIN:
+            return mIsDefaultFiltering ? 
+                MaterialManager::getSingleton().getDefaultTextureFiltering(FT_MIN) : mMinFilter;
+        case FT_MAG:
+            return mIsDefaultFiltering ? 
+                MaterialManager::getSingleton().getDefaultTextureFiltering(FT_MAG) : mMagFilter;
+        case FT_MIP:
+            return mIsDefaultFiltering ? 
+                MaterialManager::getSingleton().getDefaultTextureFiltering(FT_MIP) : mMipFilter;
+        }
+		// to keep compiler happy
+		return mMinFilter;
+	}
+
+	//-----------------------------------------------------------------------
+	void TextureUnitState::setTextureAnisotropy(unsigned int maxAniso)
+	{
+		mMaxAniso = maxAniso;
+        mIsDefaultAniso = false;
+	}
+	//-----------------------------------------------------------------------
+	unsigned int TextureUnitState::getTextureAnisotropy() const
+	{
+        return mIsDefaultAniso? MaterialManager::getSingleton().getDefaultAnisotropy() : mMaxAniso;
+	}
+
+	//-----------------------------------------------------------------------
+    void TextureUnitState::_unload(void)
+    {
+        // Destroy animation controller
+        if (mAnimController)
+        {
+            ControllerManager::getSingleton().destroyController(mAnimController);
+            mAnimController = 0;
+        }
+
+        // Destroy effect controllers
+        for (EffectMap::iterator i = mEffects.begin(); i != mEffects.end(); ++i)
+        {
+            if (i->second.controller)
+            {
+                ControllerManager::getSingleton().destroyController(i->second.controller);
+                i->second.controller = 0;
+            }
+        }
+
+        // Unreference but don't unload textures. may be used elsewhere
+        std::vector<TexturePtr>::iterator ti, tiend;
+        tiend = mFramePtrs.end();
+        for (ti = mFramePtrs.begin(); ti != tiend; ++ti)
+        {
+            ti->setNull();
+        }
+    }
+    //-----------------------------------------------------------------------------
+    bool TextureUnitState::isLoaded(void) const
+    {
+        return mParent->isLoaded();
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::_notifyNeedsRecompile(void)
+    {
+        mParent->_notifyNeedsRecompile();
+    }
+    //-----------------------------------------------------------------------
+    bool TextureUnitState::hasViewRelativeTextureCoordinateGeneration(void) const
+    {
+        // Right now this only returns true for reflection maps
+
+        EffectMap::const_iterator i, iend;
+        iend = mEffects.end();
+        
+        for(i = mEffects.find(ET_ENVIRONMENT_MAP); i != iend; ++i)
+        {
+            if (i->second.subtype == ENV_REFLECTION)
+                return true;
+        }
+        for(i = mEffects.find(ET_PROJECTIVE_TEXTURE); i != iend; ++i)
+        {
+            return true;
+        }
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setProjectiveTexturing(bool enable, 
+        const Frustum* projectionSettings)
+    {
+        if (enable)
+        {
+            TextureEffect eff;
+            eff.type = ET_PROJECTIVE_TEXTURE;
+            eff.frustum = projectionSettings;
+            addEffect(eff);
+        }
+        else
+        {
+            removeEffect(ET_PROJECTIVE_TEXTURE);
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setName(const String& name)
+    {
+        mName = name;
+		if (mTextureNameAlias.empty())
+			mTextureNameAlias = mName;
+    }
+
+    //-----------------------------------------------------------------------
+    void TextureUnitState::setTextureNameAlias(const String& name)
+    {
+        mTextureNameAlias = name;
+    }
+
+    //-----------------------------------------------------------------------
+    bool TextureUnitState::applyTextureAliases(const AliasTextureNamePairList& aliasList, const bool apply)
+    {
+        bool testResult = false;
+        // if TUS has an alias see if its in the alias container
+        if (!mTextureNameAlias.empty())
+        {
+            AliasTextureNamePairList::const_iterator aliasEntry =
+                aliasList.find(mTextureNameAlias);
+
+            if (aliasEntry != aliasList.end())
+            {
+                // match was found so change the texture name in mFrames
+                testResult = true;
+
+                if (apply)
+                {
+                    // currently assumes animated frames are sequentially numbered
+                    // cubic, 1d, 2d, and 3d textures are determined from current TUS state
+                    
+                    // if cubic or 3D
+                    if (mCubic)
+                    {
+                        setCubicTextureName(aliasEntry->second, mTextureType == TEX_TYPE_CUBE_MAP);
+                    }
+                    else
+                    {
+                        // if more than one frame then assume animated frames
+                        if (mFrames.size() > 1)
+                            setAnimatedTextureName(aliasEntry->second, 
+								static_cast<unsigned int>(mFrames.size()), mAnimDuration);
+                        else
+                            setTextureName(aliasEntry->second, mTextureType);
+                    }
+                }
+                
+            }
+        }
+
+        return testResult;
+    }
+	//-----------------------------------------------------------------------------
+	void TextureUnitState::_notifyParent(Pass* parent)
+	{
+		mParent = parent;
+	}
+
+}
Index: /OgreMain/src/OgreUnifiedHighLevelGpuProgram.cpp
===================================================================
--- /OgreMain/src/OgreUnifiedHighLevelGpuProgram.cpp	(revision 5)
+++ /OgreMain/src/OgreUnifiedHighLevelGpuProgram.cpp	(revision 5)
@@ -0,0 +1,391 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreUnifiedHighLevelGpuProgram.h"
+#include "OgreString.h"
+#include "OgreException.h"
+#include "OgreGpuProgramManager.h"
+
+namespace Ogre
+{
+	//-----------------------------------------------------------------------
+	UnifiedHighLevelGpuProgram::CmdDelegate UnifiedHighLevelGpuProgram::msCmdDelegate;
+    static const String sLanguage = "unified";
+	//-----------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	UnifiedHighLevelGpuProgram::UnifiedHighLevelGpuProgram(
+		ResourceManager* creator, const String& name, ResourceHandle handle,
+		const String& group, bool isManual, ManualResourceLoader* loader)
+		:HighLevelGpuProgram(creator, name, handle, group, isManual, loader)
+	{
+		if (createParamDictionary("UnifiedHighLevelGpuProgram"))
+		{
+			setupBaseParamDictionary();
+
+			ParamDictionary* dict = getParamDictionary();
+
+			dict->addParameter(ParameterDef("delegate", 
+				"Additional delegate programs containing implementations.",
+				PT_STRING),&msCmdDelegate);
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	UnifiedHighLevelGpuProgram::~UnifiedHighLevelGpuProgram()
+	{
+
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgram::chooseDelegate() const
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		mChosenDelegate.setNull();
+
+		for (StringVector::const_iterator i = mDelegateNames.begin();
+			i != mDelegateNames.end(); ++i)
+		{
+			HighLevelGpuProgramPtr deleg = 
+				HighLevelGpuProgramManager::getSingleton().getByName(*i);
+
+			// Silently ignore missing links
+			if(!deleg.isNull()
+				&& deleg->isSupported())
+			{
+				mChosenDelegate = deleg;
+				break;
+			}
+
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	const HighLevelGpuProgramPtr& UnifiedHighLevelGpuProgram::_getDelegate() const
+	{
+		if (mChosenDelegate.isNull())
+		{
+			chooseDelegate();
+		}
+		return mChosenDelegate;
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgram::addDelegateProgram(const String& name)
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		mDelegateNames.push_back(name);
+
+		// reset chosen delegate
+		mChosenDelegate.setNull();
+
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgram::clearDelegatePrograms()
+	{
+		OGRE_LOCK_AUTO_MUTEX
+
+		mDelegateNames.clear();
+		mChosenDelegate.setNull();
+
+	}
+    //-----------------------------------------------------------------------
+    const String& UnifiedHighLevelGpuProgram::getLanguage(void) const
+    {
+        return sLanguage;
+    }
+	//-----------------------------------------------------------------------
+	GpuProgramParametersSharedPtr UnifiedHighLevelGpuProgram::createParameters(void)
+	{
+		if (isSupported())
+		{
+			return _getDelegate()->createParameters();
+		}
+		else
+		{
+			// return a default set
+			GpuProgramParametersSharedPtr params = GpuProgramManager::getSingleton().createParameters();
+			// avoid any errors on parameter names that don't exist
+			params->setIgnoreMissingParams(true);
+			return params;
+		}
+	}
+	//-----------------------------------------------------------------------
+	GpuProgram* UnifiedHighLevelGpuProgram::_getBindingDelegate(void)
+	{
+		if (!_getDelegate().isNull())
+			return _getDelegate()->_getBindingDelegate();
+		else
+			return 0;
+	}
+	//-----------------------------------------------------------------------
+	bool UnifiedHighLevelGpuProgram::isSupported(void) const
+	{
+		// Supported if one of the delegates is
+		return !(_getDelegate().isNull());
+	}
+	//-----------------------------------------------------------------------
+	bool UnifiedHighLevelGpuProgram::isSkeletalAnimationIncluded(void) const
+	{
+		if (!_getDelegate().isNull())
+			return _getDelegate()->isSkeletalAnimationIncluded();
+		else
+			return false;
+	}
+	//-----------------------------------------------------------------------
+	bool UnifiedHighLevelGpuProgram::isMorphAnimationIncluded(void) const
+	{
+		if (!_getDelegate().isNull())
+			return _getDelegate()->isMorphAnimationIncluded();
+		else
+			return false;
+	}
+	//-----------------------------------------------------------------------
+	bool UnifiedHighLevelGpuProgram::isPoseAnimationIncluded(void) const
+	{
+		if (!_getDelegate().isNull())
+			return _getDelegate()->isPoseAnimationIncluded();
+		else
+			return false;
+	}
+	//-----------------------------------------------------------------------
+	bool UnifiedHighLevelGpuProgram::isVertexTextureFetchRequired(void) const
+	{
+		if (!_getDelegate().isNull())
+			return _getDelegate()->isVertexTextureFetchRequired();
+		else
+			return false;
+	}
+	//-----------------------------------------------------------------------
+	GpuProgramParametersSharedPtr UnifiedHighLevelGpuProgram::getDefaultParameters(void)
+	{
+		if (!_getDelegate().isNull())
+			return _getDelegate()->getDefaultParameters();
+		else
+			return GpuProgramParametersSharedPtr();
+	}
+	//-----------------------------------------------------------------------
+	bool UnifiedHighLevelGpuProgram::hasDefaultParameters(void) const
+	{
+		if (!_getDelegate().isNull())
+			return _getDelegate()->hasDefaultParameters();
+		else
+			return false;
+	}
+	//-----------------------------------------------------------------------
+	bool UnifiedHighLevelGpuProgram::getPassSurfaceAndLightStates(void) const
+	{
+		if (!_getDelegate().isNull())
+			return _getDelegate()->getPassSurfaceAndLightStates();
+		else
+			return false;
+	}
+	//-----------------------------------------------------------------------
+	bool UnifiedHighLevelGpuProgram::hasCompileError(void) const
+	{
+		if (_getDelegate().isNull())
+		{
+			return false;
+		}
+		else
+		{
+			return _getDelegate()->hasCompileError();
+		}
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgram::resetCompileError(void)
+	{
+		if (!_getDelegate().isNull())
+			_getDelegate()->resetCompileError();
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgram::load(bool backgroundThread)
+	{
+		if (!_getDelegate().isNull())
+			_getDelegate()->load(backgroundThread);
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgram::reload(void)
+	{
+		if (!_getDelegate().isNull())
+			_getDelegate()->reload();
+	}
+	//-----------------------------------------------------------------------
+	bool UnifiedHighLevelGpuProgram::isReloadable(void) const
+	{
+		if (!_getDelegate().isNull())
+			return _getDelegate()->isReloadable();
+		else
+			return true;
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgram::unload(void)
+	{
+		if (!_getDelegate().isNull())
+			_getDelegate()->unload();
+	}
+	//-----------------------------------------------------------------------
+	bool UnifiedHighLevelGpuProgram::isLoaded(void) const
+	{
+		if (!_getDelegate().isNull())
+			return _getDelegate()->isLoaded();
+		else
+			return false;
+	}
+	//-----------------------------------------------------------------------
+	Resource::LoadingState UnifiedHighLevelGpuProgram::isLoading() const
+	{
+		if (!_getDelegate().isNull())
+			return _getDelegate()->isLoading();
+		else
+			return Resource::LOADSTATE_UNLOADED;
+	}
+	//-----------------------------------------------------------------------
+	Resource::LoadingState UnifiedHighLevelGpuProgram::getLoadingState() const
+	{
+		if (!_getDelegate().isNull())
+			return _getDelegate()->getLoadingState();
+		else
+			return Resource::LOADSTATE_UNLOADED;
+	}
+	//-----------------------------------------------------------------------
+	size_t UnifiedHighLevelGpuProgram::getSize(void) const
+	{
+		if (!_getDelegate().isNull())
+			return _getDelegate()->getSize();
+		else
+			return 0;
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgram::touch(void)
+	{
+		if (!_getDelegate().isNull())
+			_getDelegate()->touch();
+	}
+	//-----------------------------------------------------------------------
+	bool UnifiedHighLevelGpuProgram::isBackgroundLoaded(void) const
+	{
+		if (!_getDelegate().isNull())
+			return _getDelegate()->isBackgroundLoaded();
+		else
+			return false;
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgram::setBackgroundLoaded(bool bl)
+	{
+		if (!_getDelegate().isNull())
+			_getDelegate()->setBackgroundLoaded(bl);
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgram::escalateLoading()
+	{
+		if (!_getDelegate().isNull())
+			_getDelegate()->escalateLoading();
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgram::addListener(Resource::Listener* lis)
+	{
+		if (!_getDelegate().isNull())
+			_getDelegate()->addListener(lis);
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgram::removeListener(Resource::Listener* lis)
+	{
+		if (!_getDelegate().isNull())
+			_getDelegate()->removeListener(lis);
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgram::createLowLevelImpl(void)
+	{
+		OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, 
+			"This method should never get called!",
+			"UnifiedHighLevelGpuProgram::createLowLevelImpl");
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgram::unloadHighLevelImpl(void)
+	{
+		OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, 
+			"This method should never get called!",
+			"UnifiedHighLevelGpuProgram::unloadHighLevelImpl");
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgram::buildConstantDefinitions() const
+	{
+		OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, 
+			"This method should never get called!",
+			"UnifiedHighLevelGpuProgram::buildConstantDefinitions");
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgram::loadFromSource(void)
+	{
+		OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, 
+			"This method should never get called!",
+			"UnifiedHighLevelGpuProgram::loadFromSource");
+	}
+	//-----------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	String UnifiedHighLevelGpuProgram::CmdDelegate::doGet(const void* target) const
+	{
+		// Can't do this (not one delegate), shouldn't matter
+		return StringUtil::BLANK;
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgram::CmdDelegate::doSet(void* target, const String& val)
+	{
+		static_cast<UnifiedHighLevelGpuProgram*>(target)->addDelegateProgram(val);
+	}
+	//-----------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	UnifiedHighLevelGpuProgramFactory::UnifiedHighLevelGpuProgramFactory()
+	{
+	}
+	//-----------------------------------------------------------------------
+	UnifiedHighLevelGpuProgramFactory::~UnifiedHighLevelGpuProgramFactory()
+	{
+	}
+	//-----------------------------------------------------------------------
+	const String& UnifiedHighLevelGpuProgramFactory::getLanguage(void) const
+	{
+		return sLanguage;
+	}
+	//-----------------------------------------------------------------------
+	HighLevelGpuProgram* UnifiedHighLevelGpuProgramFactory::create(ResourceManager* creator, 
+		const String& name, ResourceHandle handle,
+		const String& group, bool isManual, ManualResourceLoader* loader)
+	{
+		return new UnifiedHighLevelGpuProgram(creator, name, handle, group, isManual, loader);
+	}
+	//-----------------------------------------------------------------------
+	void UnifiedHighLevelGpuProgramFactory::destroy(HighLevelGpuProgram* prog)
+	{
+		delete prog;
+	}
+	//-----------------------------------------------------------------------
+
+}
+
Index: /OgreMain/src/OgreUserDefinedObject.cpp
===================================================================
--- /OgreMain/src/OgreUserDefinedObject.cpp	(revision 5)
+++ /OgreMain/src/OgreUserDefinedObject.cpp	(revision 5)
@@ -0,0 +1,51 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreUserDefinedObject.h"
+#include "OgreString.h"
+
+namespace Ogre
+{
+
+    UserDefinedObject::UserDefinedObject()
+    {
+    }
+
+    long UserDefinedObject::getTypeID(void) const
+    {
+        return 0;
+    }
+    const String& UserDefinedObject::getTypeName(void) const
+    {
+        static String sName("Unspecified");
+        return sName;
+    }
+
+}
+
Index: /OgreMain/src/OgreVector2.cpp
===================================================================
--- /OgreMain/src/OgreVector2.cpp	(revision 5)
+++ /OgreMain/src/OgreVector2.cpp	(revision 5)
@@ -0,0 +1,44 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreStableHeaders.h"
+#include "OgreVector2.h"
+#include "OgreMath.h"
+
+namespace Ogre
+{
+    const Vector2 Vector2::ZERO( 0, 0);
+
+    const Vector2 Vector2::UNIT_X( 1, 0);
+    const Vector2 Vector2::UNIT_Y( 0, 1);
+    const Vector2 Vector2::NEGATIVE_UNIT_X( -1,  0);
+    const Vector2 Vector2::NEGATIVE_UNIT_Y(  0, -1);
+    const Vector2 Vector2::UNIT_SCALE(1, 1);
+
+}
Index: /OgreMain/src/OgreVector3.cpp
===================================================================
--- /OgreMain/src/OgreVector3.cpp	(revision 5)
+++ /OgreMain/src/OgreVector3.cpp	(revision 5)
@@ -0,0 +1,44 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreVector3.h"
+#include "OgreMath.h"
+
+namespace Ogre
+{
+    const Vector3 Vector3::ZERO( 0, 0, 0 );
+
+    const Vector3 Vector3::UNIT_X( 1, 0, 0 );
+    const Vector3 Vector3::UNIT_Y( 0, 1, 0 );
+    const Vector3 Vector3::UNIT_Z( 0, 0, 1 );
+    const Vector3 Vector3::NEGATIVE_UNIT_X( -1,  0,  0 );
+    const Vector3 Vector3::NEGATIVE_UNIT_Y(  0, -1,  0 );
+    const Vector3 Vector3::NEGATIVE_UNIT_Z(  0,  0, -1 );
+    const Vector3 Vector3::UNIT_SCALE(1, 1, 1);
+}
Index: /OgreMain/src/OgreVector4.cpp
===================================================================
--- /OgreMain/src/OgreVector4.cpp	(revision 5)
+++ /OgreMain/src/OgreVector4.cpp	(revision 5)
@@ -0,0 +1,36 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreVector4.h"
+#include "OgreMath.h"
+
+namespace Ogre
+{
+    const Vector4 Vector4::ZERO( 0, 0, 0, 0 );
+}
Index: /OgreMain/src/OgreVertexIndexData.cpp
===================================================================
--- /OgreMain/src/OgreVertexIndexData.cpp	(revision 5)
+++ /OgreMain/src/OgreVertexIndexData.cpp	(revision 5)
@@ -0,0 +1,958 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreVertexIndexData.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreHardwareIndexBuffer.h"
+#include "OgreVector3.h"
+#include "OgreAxisAlignedBox.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h" 
+#include "OgreException.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+	VertexData::VertexData()
+	{
+		vertexBufferBinding = HardwareBufferManager::getSingleton().
+			createVertexBufferBinding();
+		vertexDeclaration = HardwareBufferManager::getSingleton().
+			createVertexDeclaration();
+		vertexCount = 0;
+		vertexStart = 0;
+		hwAnimDataItemsUsed = 0;
+
+	}
+    //-----------------------------------------------------------------------
+	VertexData::~VertexData()
+	{
+		HardwareBufferManager::getSingleton().
+			destroyVertexBufferBinding(vertexBufferBinding);
+		HardwareBufferManager::getSingleton().destroyVertexDeclaration(vertexDeclaration);
+
+	}
+    //-----------------------------------------------------------------------
+	VertexData* VertexData::clone(bool copyData) const
+	{
+		VertexData* dest = new VertexData();
+
+		// Copy vertex buffers in turn
+		const VertexBufferBinding::VertexBufferBindingMap& bindings = 
+			this->vertexBufferBinding->getBindings();
+		VertexBufferBinding::VertexBufferBindingMap::const_iterator vbi, vbend;
+		vbend = bindings.end();
+		for (vbi = bindings.begin(); vbi != vbend; ++vbi)
+		{
+			HardwareVertexBufferSharedPtr srcbuf = vbi->second;
+            HardwareVertexBufferSharedPtr dstBuf;
+            if (copyData)
+            {
+			    // create new buffer with the same settings
+			    dstBuf = 
+				    HardwareBufferManager::getSingleton().createVertexBuffer(
+					    srcbuf->getVertexSize(), srcbuf->getNumVertices(), srcbuf->getUsage(),
+					    srcbuf->hasShadowBuffer());
+
+			    // copy data
+			    dstBuf->copyData(*srcbuf, 0, 0, srcbuf->getSizeInBytes(), true);
+            }
+            else
+            {
+                // don't copy, point at existing buffer
+                dstBuf = srcbuf;
+            }
+
+			// Copy binding
+			dest->vertexBufferBinding->setBinding(vbi->first, dstBuf);
+        }
+
+        // Basic vertex info
+        dest->vertexStart = this->vertexStart;
+		dest->vertexCount = this->vertexCount;
+        // Copy elements
+        const VertexDeclaration::VertexElementList elems = 
+            this->vertexDeclaration->getElements();
+        VertexDeclaration::VertexElementList::const_iterator ei, eiend;
+        eiend = elems.end();
+        for (ei = elems.begin(); ei != eiend; ++ei)
+        {
+            dest->vertexDeclaration->addElement(
+                ei->getSource(),
+                ei->getOffset(),
+                ei->getType(),
+                ei->getSemantic(),
+                ei->getIndex() );
+        }
+
+		// Copy reference to hardware shadow buffer, no matter whether copy data or not
+        dest->hardwareShadowVolWBuffer = hardwareShadowVolWBuffer;
+
+		// copy anim data
+		dest->hwAnimationDataList = hwAnimationDataList;
+		dest->hwAnimDataItemsUsed = hwAnimDataItemsUsed;
+
+        
+        return dest;
+	}
+    //-----------------------------------------------------------------------
+    void VertexData::prepareForShadowVolume(void)
+    {
+        /* NOTE
+        I would dearly, dearly love to just use a 4D position buffer in order to 
+        store the extra 'w' value I need to differentiate between extruded and 
+        non-extruded sections of the buffer, so that vertex programs could use that.
+        Hey, it works fine for GL. However, D3D9 in it's infinite stupidity, does not
+        support 4d position vertices in the fixed-function pipeline. If you use them, 
+        you just see nothing. Since we can't know whether the application is going to use
+        fixed function or vertex programs, we have to stick to 3d position vertices and
+        store the 'w' in a separate 1D texture coordinate buffer, which is only used
+        when rendering the shadow.
+        */
+
+        // Upfront, lets check whether we have vertex program capability
+        RenderSystem* rend = Root::getSingleton().getRenderSystem();
+        bool useVertexPrograms = false;
+        if (rend && rend->getCapabilities()->hasCapability(RSC_VERTEX_PROGRAM))
+        {
+            useVertexPrograms = true;
+        }
+
+
+        // Look for a position element
+        const VertexElement* posElem = vertexDeclaration->findElementBySemantic(VES_POSITION);
+        if (posElem)
+        {
+            size_t v;
+            unsigned posOldSource = posElem->getSource();
+
+            HardwareVertexBufferSharedPtr vbuf = vertexBufferBinding->getBuffer(posOldSource);
+            bool wasSharedBuffer = false;
+            // Are there other elements in the buffer except for the position?
+            if (vbuf->getVertexSize() > posElem->getSize())
+            {
+                // We need to create another buffer to contain the remaining elements
+                // Most drivers don't like gaps in the declaration, and in any case it's waste
+                wasSharedBuffer = true;
+            }
+            HardwareVertexBufferSharedPtr newPosBuffer, newRemainderBuffer;
+            if (wasSharedBuffer)
+            {
+                newRemainderBuffer = HardwareBufferManager::getSingleton().createVertexBuffer(
+                    vbuf->getVertexSize() - posElem->getSize(), vbuf->getNumVertices(), vbuf->getUsage(),
+                    vbuf->hasShadowBuffer());
+            }
+            // Allocate new position buffer, will be FLOAT3 and 2x the size
+            size_t oldVertexCount = vbuf->getNumVertices();
+            size_t newVertexCount = oldVertexCount * 2;
+            newPosBuffer = HardwareBufferManager::getSingleton().createVertexBuffer(
+                VertexElement::getTypeSize(VET_FLOAT3), newVertexCount, vbuf->getUsage(), 
+                vbuf->hasShadowBuffer());
+
+            // Iterate over the old buffer, copying the appropriate elements and initialising the rest
+            float* pSrc;
+            unsigned char *pBaseSrc = static_cast<unsigned char*>(
+                vbuf->lock(HardwareBuffer::HBL_READ_ONLY));
+            // Point first destination pointer at the start of the new position buffer,
+            // the other one half way along
+            float *pDest = static_cast<float*>(newPosBuffer->lock(HardwareBuffer::HBL_DISCARD));
+            float* pDest2 = pDest + oldVertexCount * 3; 
+
+            // Precalculate any dimensions of vertex areas outside the position
+            size_t prePosVertexSize = 0, postPosVertexSize, postPosVertexOffset;
+            unsigned char *pBaseDestRem = 0;
+            if (wasSharedBuffer)
+            {
+                pBaseDestRem = static_cast<unsigned char*>(
+                    newRemainderBuffer->lock(HardwareBuffer::HBL_DISCARD));
+                prePosVertexSize = posElem->getOffset();
+                postPosVertexOffset = prePosVertexSize + posElem->getSize();
+                postPosVertexSize = vbuf->getVertexSize() - postPosVertexOffset;
+                // the 2 separate bits together should be the same size as the remainder buffer vertex
+                assert (newRemainderBuffer->getVertexSize() == prePosVertexSize + postPosVertexSize);
+
+                // Iterate over the vertices
+                for (v = 0; v < oldVertexCount; ++v)
+                {
+                    // Copy position, into both buffers
+                    posElem->baseVertexPointerToElement(pBaseSrc, &pSrc);
+                    *pDest++ = *pDest2++ = *pSrc++;
+                    *pDest++ = *pDest2++ = *pSrc++;
+                    *pDest++ = *pDest2++ = *pSrc++;
+
+                    // now deal with any other elements 
+                    // Basically we just memcpy the vertex excluding the position
+                    if (prePosVertexSize > 0)
+                        memcpy(pBaseDestRem, pBaseSrc, prePosVertexSize);
+                    if (postPosVertexSize > 0)
+                        memcpy(pBaseDestRem + prePosVertexSize, 
+                            pBaseSrc + postPosVertexOffset, postPosVertexSize);
+                    pBaseDestRem += newRemainderBuffer->getVertexSize();
+
+                    pBaseSrc += vbuf->getVertexSize();
+
+                } // next vertex
+            }
+            else
+            {
+                // Unshared buffer, can block copy the whole thing
+                memcpy(pDest, pBaseSrc, vbuf->getSizeInBytes());
+                memcpy(pDest2, pBaseSrc, vbuf->getSizeInBytes());
+            }
+
+            vbuf->unlock();
+            newPosBuffer->unlock();
+            if (wasSharedBuffer)
+                newRemainderBuffer->unlock();
+
+            // At this stage, he original vertex buffer is going to be destroyed
+            // So we should force the deallocation of any temporary copies
+            HardwareBufferManager::getSingleton()._forceReleaseBufferCopies(vbuf);
+
+            if (useVertexPrograms)
+            {
+                // Now it's time to set up the w buffer
+                hardwareShadowVolWBuffer = HardwareBufferManager::getSingleton().createVertexBuffer(
+                    sizeof(float), newVertexCount, HardwareBuffer::HBU_STATIC_WRITE_ONLY, false);
+                // Fill the first half with 1.0, second half with 0.0
+                pDest = static_cast<float*>(
+                    hardwareShadowVolWBuffer->lock(HardwareBuffer::HBL_DISCARD));
+                for (v = 0; v < oldVertexCount; ++v)
+                {
+                    *pDest++ = 1.0f;
+                }
+                for (v = 0; v < oldVertexCount; ++v)
+                {
+                    *pDest++ = 0.0f;
+                }
+                hardwareShadowVolWBuffer->unlock();
+            }
+
+            unsigned short newPosBufferSource; 
+            if (wasSharedBuffer)
+            {
+                // Get the a new buffer binding index
+                newPosBufferSource= vertexBufferBinding->getNextIndex();
+                // Re-bind the old index to the remainder buffer
+                vertexBufferBinding->setBinding(posOldSource, newRemainderBuffer);
+            }
+            else
+            {
+                // We can just re-use the same source idex for the new position buffer
+                newPosBufferSource = posOldSource;
+            }
+            // Bind the new position buffer
+            vertexBufferBinding->setBinding(newPosBufferSource, newPosBuffer);
+
+            // Now, alter the vertex declaration to change the position source
+            // and the offsets of elements using the same buffer
+            VertexDeclaration::VertexElementList::const_iterator elemi = 
+                vertexDeclaration->getElements().begin();
+            VertexDeclaration::VertexElementList::const_iterator elemiend = 
+                vertexDeclaration->getElements().end();
+            unsigned short idx;
+            for(idx = 0; elemi != elemiend; ++elemi, ++idx) 
+            {
+                if (&(*elemi) == posElem)
+                {
+                    // Modify position to point at new position buffer
+                    vertexDeclaration->modifyElement(
+                        idx, 
+                        newPosBufferSource, // new source buffer
+                        0, // no offset now
+                        VET_FLOAT3, 
+                        VES_POSITION);
+                }
+                else if (wasSharedBuffer &&
+                    elemi->getSource() == posOldSource &&
+                    elemi->getOffset() > prePosVertexSize )
+                {
+                    // This element came after position, remove the position's
+                    // size
+                    vertexDeclaration->modifyElement(
+                        idx, 
+                        posOldSource, // same old source
+                        elemi->getOffset() - posElem->getSize(), // less offset now
+                        elemi->getType(), 
+                        elemi->getSemantic(),
+                        elemi->getIndex());
+
+                }
+
+            }
+
+
+            // Note that we don't change vertexCount, because the other buffer(s) are still the same
+            // size after all
+
+
+        }
+    }
+	//-----------------------------------------------------------------------
+	void VertexData::reorganiseBuffers(VertexDeclaration* newDeclaration, const BufferUsageList& bufferUsages)
+	{
+        // Firstly, close up any gaps in the buffer sources which might have arisen
+        newDeclaration->closeGapsInSource();
+
+		// Build up a list of both old and new elements in each buffer
+		unsigned short buf = 0;
+		std::vector<void*> oldBufferLocks;
+        std::vector<size_t> oldBufferVertexSizes;
+		std::vector<void*> newBufferLocks;
+        std::vector<size_t> newBufferVertexSizes;
+		VertexBufferBinding* newBinding = 
+			HardwareBufferManager::getSingleton().createVertexBufferBinding();
+        const VertexBufferBinding::VertexBufferBindingMap& oldBindingMap = vertexBufferBinding->getBindings();
+        VertexBufferBinding::VertexBufferBindingMap::const_iterator itBinding;
+
+        // Pre-allocate old buffer locks
+        if (!oldBindingMap.empty())
+        {
+            size_t count = oldBindingMap.rbegin()->first + 1;
+            oldBufferLocks.resize(count);
+            oldBufferVertexSizes.resize(count);
+        }
+		// Lock all the old buffers for reading
+        for (itBinding = oldBindingMap.begin(); itBinding != oldBindingMap.end(); ++itBinding)
+        {
+            assert(itBinding->second->getNumVertices() >= vertexCount);
+
+            oldBufferVertexSizes[itBinding->first] =
+                itBinding->second->getVertexSize();
+            oldBufferLocks[itBinding->first] =
+                itBinding->second->lock(
+                    HardwareBuffer::HBL_READ_ONLY);
+        }
+		
+		// Create new buffers and lock all for writing
+		buf = 0;
+		while (!newDeclaration->findElementsBySource(buf).empty())
+		{
+            size_t vertexSize = newDeclaration->getVertexSize(buf);
+
+			HardwareVertexBufferSharedPtr vbuf = 
+				HardwareBufferManager::getSingleton().createVertexBuffer(
+					vertexSize,
+					vertexCount, 
+					bufferUsages[buf]);
+			newBinding->setBinding(buf, vbuf);
+
+            newBufferVertexSizes.push_back(vertexSize);
+			newBufferLocks.push_back(
+				vbuf->lock(HardwareBuffer::HBL_DISCARD));
+			buf++;
+		}
+
+		// Map from new to old elements
+        typedef std::map<const VertexElement*, const VertexElement*> NewToOldElementMap;
+		NewToOldElementMap newToOldElementMap;
+		const VertexDeclaration::VertexElementList& newElemList = newDeclaration->getElements();
+		VertexDeclaration::VertexElementList::const_iterator ei, eiend;
+		eiend = newElemList.end();
+		for (ei = newElemList.begin(); ei != eiend; ++ei)
+		{
+			// Find corresponding old element
+			const VertexElement* oldElem = 
+				vertexDeclaration->findElementBySemantic(
+					(*ei).getSemantic(), (*ei).getIndex());
+			if (!oldElem)
+			{
+				// Error, cannot create new elements with this method
+				OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+					"Element not found in old vertex declaration", 
+					"VertexData::reorganiseBuffers");
+			}
+			newToOldElementMap[&(*ei)] = oldElem;
+		}
+		// Now iterate over the new buffers, pulling data out of the old ones
+		// For each vertex
+		for (size_t v = 0; v < vertexCount; ++v)
+		{
+			// For each (new) element
+			for (ei = newElemList.begin(); ei != eiend; ++ei)
+			{
+				const VertexElement* newElem = &(*ei);
+                NewToOldElementMap::iterator noi = newToOldElementMap.find(newElem);
+				const VertexElement* oldElem = noi->second;
+				unsigned short oldBufferNo = oldElem->getSource();
+				unsigned short newBufferNo = newElem->getSource();
+				void* pSrcBase = static_cast<void*>(
+					static_cast<unsigned char*>(oldBufferLocks[oldBufferNo])
+					+ v * oldBufferVertexSizes[oldBufferNo]);
+				void* pDstBase = static_cast<void*>(
+					static_cast<unsigned char*>(newBufferLocks[newBufferNo])
+					+ v * newBufferVertexSizes[newBufferNo]);
+				void *pSrc, *pDst;
+				oldElem->baseVertexPointerToElement(pSrcBase, &pSrc);
+				newElem->baseVertexPointerToElement(pDstBase, &pDst);
+				
+				memcpy(pDst, pSrc, newElem->getSize());
+				
+			}
+		}
+
+		// Unlock all buffers
+        for (itBinding = oldBindingMap.begin(); itBinding != oldBindingMap.end(); ++itBinding)
+        {
+            itBinding->second->unlock();
+        }
+        for (buf = 0; buf < newBinding->getBufferCount(); ++buf)
+        {
+            newBinding->getBuffer(buf)->unlock();
+        }
+
+		// Delete old binding & declaration
+		HardwareBufferManager::getSingleton().
+			destroyVertexBufferBinding(vertexBufferBinding);
+		HardwareBufferManager::getSingleton().destroyVertexDeclaration(vertexDeclaration);
+
+		// Assign new binding and declaration
+		vertexDeclaration = newDeclaration;
+		vertexBufferBinding = newBinding;		
+
+	}
+    //-----------------------------------------------------------------------
+    void VertexData::reorganiseBuffers(VertexDeclaration* newDeclaration)
+    {
+        // Derive the buffer usages from looking at where the source has come
+        // from
+        BufferUsageList usages;
+        for (unsigned short b = 0; b <= newDeclaration->getMaxSource(); ++b)
+        {
+            VertexDeclaration::VertexElementList destElems = newDeclaration->findElementsBySource(b);
+            // Initialise with most restrictive version 
+            // (not really a usable option, but these flags will be removed)
+            HardwareBuffer::Usage final = static_cast<HardwareBuffer::Usage>(
+                HardwareBuffer::HBU_STATIC_WRITE_ONLY | HardwareBuffer::HBU_DISCARDABLE);
+            VertexDeclaration::VertexElementList::iterator v;
+            for (v = destElems.begin(); v != destElems.end(); ++v)
+            {
+                VertexElement& destelem = *v;
+                // get source
+                const VertexElement* srcelem =
+                    vertexDeclaration->findElementBySemantic(
+                        destelem.getSemantic(), destelem.getIndex());
+                // get buffer
+                HardwareVertexBufferSharedPtr srcbuf = 
+                    vertexBufferBinding->getBuffer(srcelem->getSource());
+                // improve flexibility only
+                if (srcbuf->getUsage() & HardwareBuffer::HBU_DYNAMIC)
+                {
+                    // remove static
+                    final = static_cast<HardwareBuffer::Usage>(
+                        final & ~HardwareBuffer::HBU_STATIC);
+                    // add dynamic
+                    final = static_cast<HardwareBuffer::Usage>(
+                        final | HardwareBuffer::HBU_DYNAMIC);
+                }
+                if (!(srcbuf->getUsage() & HardwareBuffer::HBU_WRITE_ONLY))
+                {
+                    // remove write only
+                    final = static_cast<HardwareBuffer::Usage>(
+                        final & ~HardwareBuffer::HBU_WRITE_ONLY);
+                }
+                if (!(srcbuf->getUsage() & HardwareBuffer::HBU_DISCARDABLE))
+                {
+                    // remove discardable
+                    final = static_cast<HardwareBuffer::Usage>(
+                        final & ~HardwareBuffer::HBU_DISCARDABLE);
+                }
+                
+            }
+            usages.push_back(final);
+        }
+        // Call specific method
+        reorganiseBuffers(newDeclaration, usages);
+
+    }
+    //-----------------------------------------------------------------------
+    void VertexData::closeGapsInBindings(void)
+    {
+        if (!vertexBufferBinding->hasGaps())
+            return;
+
+        // Check for error first
+        const VertexDeclaration::VertexElementList& allelems = 
+            vertexDeclaration->getElements();
+        VertexDeclaration::VertexElementList::const_iterator ai;
+        for (ai = allelems.begin(); ai != allelems.end(); ++ai)
+        {
+            const VertexElement& elem = *ai;
+            if (!vertexBufferBinding->isBufferBound(elem.getSource()))
+            {
+                OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+                    "No buffer is bound to that element source.",
+                    "VertexData::closeGapsInBindings");
+            }
+        }
+
+        // Close gaps in the vertex buffer bindings
+        VertexBufferBinding::BindingIndexMap bindingIndexMap;
+        vertexBufferBinding->closeGaps(bindingIndexMap);
+
+        // Modify vertex elements to reference to new buffer index
+        unsigned short elemIndex = 0;
+        for (ai = allelems.begin(); ai != allelems.end(); ++ai, ++elemIndex)
+        {
+            const VertexElement& elem = *ai;
+            VertexBufferBinding::BindingIndexMap::const_iterator it =
+                bindingIndexMap.find(elem.getSource());
+            assert(it != bindingIndexMap.end());
+            ushort targetSource = it->second;
+            if (elem.getSource() != targetSource)
+            {
+                vertexDeclaration->modifyElement(elemIndex, 
+                    targetSource, elem.getOffset(), elem.getType(), 
+                    elem.getSemantic(), elem.getIndex());
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void VertexData::removeUnusedBuffers(void)
+    {
+        std::set<ushort> usedBuffers;
+
+        // Collect used buffers
+        const VertexDeclaration::VertexElementList& allelems = 
+            vertexDeclaration->getElements();
+        VertexDeclaration::VertexElementList::const_iterator ai;
+        for (ai = allelems.begin(); ai != allelems.end(); ++ai)
+        {
+            const VertexElement& elem = *ai;
+            usedBuffers.insert(elem.getSource());
+        }
+
+        // Unset unused buffer bindings
+        ushort count = vertexBufferBinding->getLastBoundIndex();
+        for (ushort index = 0; index < count; ++index)
+        {
+            if (usedBuffers.find(index) == usedBuffers.end() &&
+                vertexBufferBinding->isBufferBound(index))
+            {
+                vertexBufferBinding->unsetBinding(index);
+            }
+        }
+
+        // Close gaps
+        closeGapsInBindings();
+    }
+	//-----------------------------------------------------------------------
+	void VertexData::convertPackedColour(
+		VertexElementType srcType, VertexElementType destType)
+	{
+		if (destType != VET_COLOUR_ABGR && destType != VET_COLOUR_ARGB)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Invalid destType parameter", "VertexData::convertPackedColour");
+		}
+		if (srcType != VET_COLOUR_ABGR && srcType != VET_COLOUR_ARGB)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Invalid srcType parameter", "VertexData::convertPackedColour");
+		}
+
+		const VertexBufferBinding::VertexBufferBindingMap& bindMap = 
+			vertexBufferBinding->getBindings();
+		VertexBufferBinding::VertexBufferBindingMap::const_iterator bindi;
+		for (bindi = bindMap.begin(); bindi != bindMap.end(); ++bindi)
+		{
+			VertexDeclaration::VertexElementList elems = 
+				vertexDeclaration->findElementsBySource(bindi->first);
+			bool conversionNeeded = false;
+			VertexDeclaration::VertexElementList::iterator elemi;
+			for (elemi = elems.begin(); elemi != elems.end(); ++elemi)
+			{
+				VertexElement& elem = *elemi;
+				if (elem.getType() == VET_COLOUR || 
+					((elem.getType() == VET_COLOUR_ABGR || elem.getType() == VET_COLOUR_ARGB) 
+					&& elem.getType() != destType))
+				{
+					conversionNeeded = true;
+				}
+			}
+
+			if (conversionNeeded)
+			{
+				void* pBase = bindi->second->lock(HardwareBuffer::HBL_NORMAL);
+
+				for (size_t v = 0; v < bindi->second->getNumVertices(); ++v)
+				{
+
+					for (elemi = elems.begin(); elemi != elems.end(); ++elemi)
+					{
+						VertexElement& elem = *elemi;
+						VertexElementType currType = (elem.getType() == VET_COLOUR) ?
+							srcType : elem.getType();
+						if (elem.getType() == VET_COLOUR || 
+							((elem.getType() == VET_COLOUR_ABGR || elem.getType() == VET_COLOUR_ARGB) 
+							&& elem.getType() != destType))
+						{
+							uint32* pRGBA;
+							elem.baseVertexPointerToElement(pBase, &pRGBA);
+							VertexElement::convertColourValue(currType, destType, pRGBA);
+						}
+					}
+					pBase = static_cast<void*>(
+						static_cast<char*>(pBase) + bindi->second->getVertexSize());
+				}
+				bindi->second->unlock();
+
+				// Modify the elements to reflect the changed type
+				const VertexDeclaration::VertexElementList& allelems = 
+					vertexDeclaration->getElements();
+				VertexDeclaration::VertexElementList::const_iterator ai;
+				unsigned short elemIndex = 0;
+				for (ai = allelems.begin(); ai != allelems.end(); ++ai, ++elemIndex)
+				{
+					const VertexElement& elem = *ai;
+					if (elem.getType() == VET_COLOUR || 
+						((elem.getType() == VET_COLOUR_ABGR || elem.getType() == VET_COLOUR_ARGB) 
+						&& elem.getType() != destType))
+					{
+						vertexDeclaration->modifyElement(elemIndex, 
+							elem.getSource(), elem.getOffset(), destType, 
+							elem.getSemantic(), elem.getIndex());
+					}
+				}
+
+			}
+
+
+		} // each buffer
+
+
+	}
+	//-----------------------------------------------------------------------
+	void VertexData::allocateHardwareAnimationElements(ushort count)
+	{
+		// Find first free texture coord set
+		unsigned short texCoord = 0;
+		const VertexDeclaration::VertexElementList& vel = vertexDeclaration->getElements();
+		for (VertexDeclaration::VertexElementList::const_iterator i = vel.begin(); 
+			i != vel.end(); ++i)
+		{
+			const VertexElement& el = *i;
+			if (el.getSemantic() == VES_TEXTURE_COORDINATES)
+			{
+				++texCoord;
+			}
+		}
+		assert(texCoord <= OGRE_MAX_TEXTURE_COORD_SETS);
+
+		// Increase to correct size
+		for (size_t c = hwAnimationDataList.size(); c < count; ++c)
+		{
+			// Create a new 3D texture coordinate set
+			HardwareAnimationData data;
+			data.targetVertexElement = &(vertexDeclaration->addElement(
+				vertexBufferBinding->getNextIndex(), 0, VET_FLOAT3, VES_TEXTURE_COORDINATES, texCoord++));
+
+			hwAnimationDataList.push_back(data);
+			// Vertex buffer will not be bound yet, we expect this to be done by the
+			// caller when it becomes appropriate (e.g. through a VertexAnimationTrack)
+		}
+	}
+    //-----------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	IndexData::IndexData()
+	{
+		indexCount = 0;
+		indexStart = 0;
+		
+	}
+    //-----------------------------------------------------------------------
+	IndexData::~IndexData()
+	{
+	}
+    //-----------------------------------------------------------------------
+	IndexData* IndexData::clone(bool copyData) const
+	{
+		IndexData* dest = new IndexData();
+		if (indexBuffer.get())
+		{
+            if (copyData)
+            {
+			    dest->indexBuffer = HardwareBufferManager::getSingleton().
+				    createIndexBuffer(indexBuffer->getType(), indexBuffer->getNumIndexes(),
+				    indexBuffer->getUsage(), indexBuffer->hasShadowBuffer());
+			    dest->indexBuffer->copyData(*indexBuffer, 0, 0, indexBuffer->getSizeInBytes(), true);
+            }
+            else
+            {
+                dest->indexBuffer = indexBuffer;
+            }
+        }
+		dest->indexCount = indexCount;
+		dest->indexStart = indexStart;
+		return dest;
+	}
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+	// Local Utility class for vertex cache optimizer
+	class Triangle
+    {
+    public:
+		enum EdgeMatchType {
+			AB, BC, CA, ANY, NONE
+		};
+
+		uint32 a, b, c;		
+
+		inline Triangle()
+		{
+		}
+
+		inline Triangle( uint32 ta, uint32 tb, uint32 tc ) 
+			: a( ta ), b( tb ), c( tc )
+		{
+		}
+
+		inline Triangle( uint32 t[3] )
+			: a( t[0] ), b( t[1] ), c( t[2] )
+		{
+		}
+
+		inline Triangle( const Triangle& t )
+			: a( t.a ), b( t.b ), c( t.c )
+		{
+		}
+
+		inline bool sharesEdge(const Triangle& t) const
+		{
+			return(	a == t.a && b == t.c ||
+					a == t.b && b == t.a ||
+					a == t.c && b == t.b ||
+					b == t.a && c == t.c ||
+					b == t.b && c == t.a ||
+					b == t.c && c == t.b ||
+					c == t.a && a == t.c ||
+					c == t.b && a == t.a ||
+					c == t.c && a == t.b );
+		}
+
+		inline bool sharesEdge(const uint32 ea, const uint32 eb, const Triangle& t) const
+		{
+			return(	ea == t.a && eb == t.c ||
+					ea == t.b && eb == t.a ||
+					ea == t.c && eb == t.b );	
+		}
+
+		inline bool sharesEdge(const EdgeMatchType edge, const Triangle& t) const
+		{
+			if (edge == AB)
+				return sharesEdge(a, b, t);
+			else if (edge == BC)
+				return sharesEdge(b, c, t);
+			else if (edge == CA)
+				return sharesEdge(c, a, t);
+			else
+				return (edge == ANY) == sharesEdge(t);
+		}
+
+		inline EdgeMatchType endoSharedEdge(const Triangle& t) const
+		{
+			if (sharesEdge(a, b, t)) return AB;
+			if (sharesEdge(b, c, t)) return BC;
+			if (sharesEdge(c, a, t)) return CA;
+			return NONE;
+		}
+
+		inline EdgeMatchType exoSharedEdge(const Triangle& t) const
+		{
+			return t.endoSharedEdge(*this);
+		}
+
+		inline void shiftClockwise()
+		{
+			uint32 t = a;
+			a = c;
+			c = b;
+			b = t;
+		}
+
+		inline void shiftCounterClockwise()
+		{
+			uint32 t = a;
+			a = b;
+			b = c;
+			c = t;
+		}
+	};
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+	void IndexData::optimiseVertexCacheTriList(void)
+	{
+		if (indexBuffer->isLocked()) return;
+
+		void *buffer = indexBuffer->lock(HardwareBuffer::HBL_NORMAL);
+
+		Triangle* triangles;
+		uint32 *dest;
+
+		size_t nIndexes = indexCount;
+		size_t nTriangles = nIndexes / 3;
+		size_t i, j;
+		uint16 *source;
+
+		if (indexBuffer->getType() == HardwareIndexBuffer::IT_16BIT)
+		{
+			triangles = new Triangle[nTriangles];
+			source = (uint16 *)buffer;
+			dest = (uint32 *)triangles;
+			for (i = 0; i < nIndexes; ++i) dest[i] = source[i];
+		}
+		else
+			triangles = (Triangle*)buffer;
+
+		// sort triangles based on shared edges
+		uint32 *destlist = new uint32[nTriangles];
+		unsigned char *visited = new unsigned char[nTriangles];
+
+		for (i = 0; i < nTriangles; ++i) visited[i] = 0;
+
+		uint32 start = 0, ti = 0, destcount = 0;
+
+		bool found = false;
+		for (i = 0; i < nTriangles; ++i)
+		{
+			if (found)
+				found = false;
+			else
+			{
+				while (visited[start++]);
+				ti = start - 1;
+			}
+
+			destlist[destcount++] = ti;
+			visited[ti] = 1;
+
+			for (j = start; j < nTriangles; ++j)
+			{
+				if (visited[j]) continue;
+				
+				if (triangles[ti].sharesEdge(triangles[j]))
+				{
+					found = true;
+					ti = static_cast<uint32>(j);
+					break;
+				}
+			}
+		}
+
+		if (indexBuffer->getType() == HardwareIndexBuffer::IT_16BIT)
+		{
+			// reorder the indexbuffer
+			j = 0;
+			for (i = 0; i < nTriangles; ++i)
+			{
+				Triangle *t = &triangles[destlist[i]];
+				source[j++] = t->a;
+				source[j++] = t->b;
+				source[j++] = t->c;
+			}
+			delete[] triangles;
+		}
+		else
+		{
+			uint32 *reflist = new uint32[nTriangles];
+
+			// fill the referencebuffer
+			for (i = 0; i < nTriangles; ++i)
+				reflist[destlist[i]] = static_cast<uint32>(i);
+			
+			// reorder the indexbuffer
+			for (i = 0; i < nTriangles; ++i)
+			{
+				j = destlist[i];
+				if (i == j) continue; // do not move triangle
+
+				// swap triangles
+
+				Triangle t = triangles[i];
+				triangles[i] = triangles[j];
+				triangles[j] = t;
+
+				// change reference
+				destlist[reflist[i]] = static_cast<uint32>(j);
+				// destlist[i] = i; // not needed, it will not be used
+			}
+
+			delete[] reflist;
+		}
+
+		delete[] destlist;
+		delete[] visited;
+					
+		indexBuffer->unlock();
+	}
+	//-----------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	void VertexCacheProfiler::profile(const HardwareIndexBufferSharedPtr& indexBuffer)
+    {
+		if (indexBuffer->isLocked()) return;
+
+		uint16 *shortbuffer = (uint16 *)indexBuffer->lock(HardwareBuffer::HBL_READ_ONLY);
+
+		if (indexBuffer->getType() == HardwareIndexBuffer::IT_16BIT)
+			for (unsigned int i = 0; i < indexBuffer->getNumIndexes(); ++i)
+				inCache(shortbuffer[i]);
+		else
+		{
+			uint32 *buffer = (uint32 *)shortbuffer;
+			for (unsigned int i = 0; i < indexBuffer->getNumIndexes(); ++i)
+				inCache(buffer[i]);
+		}
+
+		indexBuffer->unlock();
+	}
+
+	//-----------------------------------------------------------------------
+	bool VertexCacheProfiler::inCache(unsigned int index)
+	{
+		for (unsigned int i = 0; i < buffersize; ++i)
+		{
+			if (index == cache[i])
+			{
+				hit++;
+				return true;
+			}
+		}
+
+		miss++;
+		cache[tail++] = index;
+		tail %= size;
+
+		if (buffersize < size) buffersize++;
+
+		return false;
+	}
+	
+
+}
Index: /OgreMain/src/OgreViewport.cpp
===================================================================
--- /OgreMain/src/OgreViewport.cpp	(revision 5)
+++ /OgreMain/src/OgreViewport.cpp	(revision 5)
@@ -0,0 +1,305 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreViewport.h"
+
+#include "OgreLogManager.h"
+#include "OgreRenderTarget.h"
+#include "OgreCamera.h"
+#include "OgreMath.h"
+#include "OgreRoot.h"
+#include "OgreMaterialManager.h"
+
+
+namespace Ogre {
+    //---------------------------------------------------------------------
+    Viewport::Viewport(Camera* cam, RenderTarget* target, Real left, Real top, Real width, Real height, int ZOrder)
+        : mCamera(cam)
+        , mTarget(target)
+        , mRelLeft(left)
+        , mRelTop(top)
+        , mRelWidth(width)
+        , mRelHeight(height)
+        // Actual dimensions will update later
+        , mZOrder(ZOrder)
+        , mBackColour(ColourValue::Black)
+        , mClearEveryFrame(true)
+		, mClearBuffers(FBT_COLOUR | FBT_DEPTH)
+        , mUpdated(false)
+        , mShowOverlays(true)
+        , mShowSkies(true)
+		, mShowShadows(true)
+		, mVisibilityMask(0xFFFFFFFF)
+		, mRQSequence(0)
+		, mMaterialSchemeName(MaterialManager::DEFAULT_SCHEME_NAME)
+    {
+
+		StringUtil::StrStreamType msg;
+
+        msg << "Creating viewport on target '" << target->getName() << "'"
+			<< ", rendering from camera '" << (cam != 0 ? cam->getName() : "NULL") << "'"
+			<< ", relative dimensions "	<< std::fixed << std::setprecision(2) 
+			<< "L: " << left << " T: " << top << " W: " << width << " H: " << height
+			<< " ZOrder: " << ZOrder;
+        LogManager::getSingleton().logMessage(msg.str());
+
+        // Calculate actual dimensions
+        _updateDimensions();
+
+        // notify camera
+        if(cam) cam->_notifyViewport(this);
+    }
+    //---------------------------------------------------------------------
+    Viewport::~Viewport()
+    {
+
+    }
+    //---------------------------------------------------------------------
+    bool Viewport::_isUpdated(void) const
+    {
+        return mUpdated;
+    }
+    //---------------------------------------------------------------------
+    void Viewport::_clearUpdatedFlag(void)
+    {
+        mUpdated = false;
+    }
+    //---------------------------------------------------------------------
+    void Viewport::_updateDimensions(void)
+    {
+        Real height = (Real) mTarget->getHeight();
+        Real width = (Real) mTarget->getWidth();
+
+        mActLeft = (int) (mRelLeft * width);
+        mActTop = (int) (mRelTop * height);
+        mActWidth = (int) (mRelWidth * width);
+        mActHeight = (int) (mRelHeight * height);
+
+        // This will check if  the cameras getAutoAspectRation() property is set.
+        // If it's true its aspect ratio is fit to the current viewport
+        // If it's false the camera remains unchanged.
+        // This allows cameras to be used to render to many viewports,
+        // which can have their own dimensions and aspect ratios.
+
+        if (mCamera && mCamera->getAutoAspectRatio()) 
+        {
+            mCamera->setAspectRatio((Real) mActWidth / (Real) mActHeight);
+        }
+
+		StringUtil::StrStreamType msg;
+
+		msg << "Viewport for camera '" << (mCamera != 0 ? mCamera->getName() : "NULL") << "'"
+			<< ", actual dimensions "	<< std::fixed << std::setprecision(2) 
+			<< "L: " << mActLeft << " T: " << mActTop << " W: " << mActWidth << " H: " << mActHeight;
+
+        LogManager::getSingleton().logMessage(msg.str(), LML_TRIVIAL);
+
+        mUpdated = true;
+    }
+	//---------------------------------------------------------------------
+	int Viewport::getZOrder(void) const
+	{
+		return mZOrder;
+	}
+	//---------------------------------------------------------------------
+    RenderTarget* Viewport::getTarget(void) const
+    {
+        return mTarget;
+    }
+    //---------------------------------------------------------------------
+    Camera* Viewport::getCamera(void) const
+    {
+        return mCamera;
+    }
+    //---------------------------------------------------------------------
+    Real Viewport::getLeft(void) const
+    {
+        return mRelLeft;
+    }
+    //---------------------------------------------------------------------
+    Real Viewport::getTop(void) const
+    {
+        return mRelTop;
+    }
+    //---------------------------------------------------------------------
+    Real Viewport::getWidth(void) const
+    {
+        return mRelWidth;
+    }
+    //---------------------------------------------------------------------
+    Real Viewport::getHeight(void) const
+    {
+        return mRelHeight;
+    }
+    //---------------------------------------------------------------------
+    int Viewport::getActualLeft(void) const
+    {
+        return mActLeft;
+    }
+    //---------------------------------------------------------------------
+    int Viewport::getActualTop(void) const
+    {
+        return mActTop;
+    }
+    //---------------------------------------------------------------------
+    int Viewport::getActualWidth(void) const
+    {
+        return mActWidth;
+    }
+    //---------------------------------------------------------------------
+    int Viewport::getActualHeight(void) const
+    {
+        return mActHeight;
+    }
+    //---------------------------------------------------------------------
+    void Viewport::setDimensions(Real left, Real top, Real width, Real height)
+    {
+        mRelLeft = left;
+        mRelTop = top;
+        mRelWidth = width;
+        mRelHeight = height;
+        _updateDimensions();
+    }
+    //---------------------------------------------------------------------
+    void Viewport::update(void)
+    {
+        if (mCamera)
+        {
+            // Tell Camera to render into me
+            mCamera->_renderScene(this, mShowOverlays);
+        }
+    }
+    //---------------------------------------------------------------------
+    void Viewport::setBackgroundColour(const ColourValue& colour)
+    {
+        mBackColour = colour;
+    }
+    //---------------------------------------------------------------------
+    const ColourValue& Viewport::getBackgroundColour(void) const
+    {
+        return mBackColour;
+    }
+    //---------------------------------------------------------------------
+    void Viewport::setClearEveryFrame(bool clear, unsigned int buffers)
+    {
+        mClearEveryFrame = clear;
+		mClearBuffers = buffers;
+    }
+    //---------------------------------------------------------------------
+    bool Viewport::getClearEveryFrame(void) const
+    {
+        return mClearEveryFrame;
+    }
+    //---------------------------------------------------------------------
+    unsigned int Viewport::getClearBuffers(void) const
+    {
+        return mClearBuffers;
+    }
+    //---------------------------------------------------------------------
+    void Viewport::getActualDimensions(int &left, int&top, int &width, int &height) const
+    {
+        left = mActLeft;
+        top = mActTop;
+        width = mActWidth;
+        height = mActHeight;
+
+    }
+    //---------------------------------------------------------------------
+    unsigned int Viewport::_getNumRenderedFaces(void) const
+    {
+		return mCamera ? mCamera->_getNumRenderedFaces() : 0;
+    }
+    //---------------------------------------------------------------------
+    unsigned int Viewport::_getNumRenderedBatches(void) const
+    {
+		return mCamera ? mCamera->_getNumRenderedBatches() : 0;
+    }
+    //---------------------------------------------------------------------
+    void Viewport::setCamera(Camera* cam)
+    {
+        mCamera = cam;
+		if(cam) mCamera->_notifyViewport(this);
+    }
+    //---------------------------------------------------------------------
+    void Viewport::setOverlaysEnabled(bool enabled)
+    {
+        mShowOverlays = enabled;
+    }
+    //---------------------------------------------------------------------
+    bool Viewport::getOverlaysEnabled(void) const
+    {
+        return mShowOverlays;
+    }
+    //---------------------------------------------------------------------
+    void Viewport::setSkiesEnabled(bool enabled)
+    {
+        mShowSkies = enabled;
+    }
+    //---------------------------------------------------------------------
+    bool Viewport::getSkiesEnabled(void) const
+    {
+        return mShowSkies;
+    }
+    //---------------------------------------------------------------------
+    void Viewport::setShadowsEnabled(bool enabled)
+    {
+        mShowShadows = enabled;
+    }
+    //---------------------------------------------------------------------
+    bool Viewport::getShadowsEnabled(void) const
+    {
+        return mShowShadows;
+    }
+	//-----------------------------------------------------------------------
+	void Viewport::setRenderQueueInvocationSequenceName(const String& sequenceName)
+	{
+		mRQSequenceName = sequenceName;
+		if (mRQSequenceName.empty())
+		{
+			mRQSequence = 0;
+		}
+		else
+		{
+			mRQSequence =
+				Root::getSingleton().getRenderQueueInvocationSequence(mRQSequenceName);
+		}
+	}
+	//-----------------------------------------------------------------------
+	const String& Viewport::getRenderQueueInvocationSequenceName(void) const
+	{
+		return mRQSequenceName;
+	}
+	//-----------------------------------------------------------------------
+	RenderQueueInvocationSequence* Viewport::_getRenderQueueInvocationSequence(void)
+	{
+		return mRQSequence;
+	}
+	//-----------------------------------------------------------------------
+
+}
Index: /OgreMain/src/OgreWindowEventUtilities.cpp
===================================================================
--- /OgreMain/src/OgreWindowEventUtilities.cpp	(revision 5)
+++ /OgreMain/src/OgreWindowEventUtilities.cpp	(revision 5)
@@ -0,0 +1,314 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreWindowEventUtilities.h"
+#include "OgreRenderWindow.h"
+#include "OgreLogManager.h"
+#include "OgreRoot.h"
+#include "OgreException.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
+#include <X11/Xlib.h>
+void GLXProc( const XEvent &event );
+#endif
+
+using namespace Ogre;
+
+WindowEventUtilities::WindowEventListeners WindowEventUtilities::_msListeners;
+WindowEventUtilities::Windows WindowEventUtilities::_msWindows;
+
+//--------------------------------------------------------------------------------//
+void WindowEventUtilities::messagePump()
+{
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+	// Windows Message Loop (NULL means check all HWNDs belonging to this context)
+	MSG  msg;
+	while( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) )
+	{
+		TranslateMessage( &msg );
+		DispatchMessage( &msg );
+	}
+#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
+	//GLX Message Pump (Display is probably Common for all RenderWindows.. But, to be safe loop
+	//through all)
+	Windows::iterator i = _msWindows.begin(), e = _msWindows.end();
+	for( ; i != e; ++i )
+	{
+		::Display* display;
+		(*i)->getCustomAttribute("DISPLAY", &display);
+		while(XPending(display) > 0)
+		{
+			XEvent event;
+			XNextEvent(display, &event);
+			GLXProc(event);
+		}
+	}
+	#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+	// OSX Message Pump
+	EventRef event = NULL;
+	EventTargetRef targetWindow;
+	targetWindow = GetEventDispatcherTarget();
+	if( ReceiveNextEvent( 0, NULL, kEventDurationNoWait, true, &event ) == noErr )
+	{
+		SendEventToEventTarget( event, targetWindow );
+		ReleaseEvent( event );
+	}
+#endif
+}
+
+//--------------------------------------------------------------------------------//
+void WindowEventUtilities::addWindowEventListener( RenderWindow* window, WindowEventListener* listener )
+{
+	_msListeners.insert(std::make_pair(window, listener));
+}
+
+//--------------------------------------------------------------------------------//
+void WindowEventUtilities::removeWindowEventListener( RenderWindow* window, WindowEventListener* listener )
+{
+	WindowEventListeners::iterator i = _msListeners.begin(), e = _msListeners.end();
+
+	for( ; i != e; ++i )
+	{
+		if( i->first == window && i->second == listener )
+		{
+			_msListeners.erase(i);
+			break;
+		}
+	}
+}
+
+//--------------------------------------------------------------------------------//
+void WindowEventUtilities::_addRenderWindow(RenderWindow* window)
+{
+	_msWindows.push_back(window);
+}
+
+//--------------------------------------------------------------------------------//
+void WindowEventUtilities::_removeRenderWindow(RenderWindow* window)
+{
+	Windows::iterator i = std::find(_msWindows.begin(), _msWindows.end(), window);
+	if( i != _msWindows.end() )
+		_msWindows.erase( i );
+}
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+//--------------------------------------------------------------------------------//
+LRESULT CALLBACK WindowEventUtilities::_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+	if (uMsg == WM_CREATE)
+	{	// Store pointer to Win32Window in user data area
+		SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)(((LPCREATESTRUCT)lParam)->lpCreateParams));
+		return 0;
+	}
+
+	// look up window instance
+	// note: it is possible to get a WM_SIZE before WM_CREATE
+	RenderWindow* win = (RenderWindow*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
+	if (!win)
+		return DefWindowProc(hWnd, uMsg, wParam, lParam);
+
+	//LogManager* log = LogManager::getSingletonPtr();
+	//Iterator of all listeners registered to this RenderWindow
+	WindowEventListeners::iterator start = _msListeners.lower_bound(win),
+						end = _msListeners.upper_bound(win);
+
+	switch( uMsg )
+	{
+	case WM_ACTIVATE:
+	{
+		bool active = (LOWORD(wParam) != WA_INACTIVE);
+		win->setActive( active );
+		for( ; start != end; ++start )
+			(start->second)->windowFocusChange(win);
+		break;
+	}
+	case WM_SYSKEYDOWN:
+		switch( wParam )
+		{
+		case VK_CONTROL:
+		case VK_SHIFT:
+		case VK_MENU: //ALT
+			//return zero to bypass defProc and signal we processed the message
+			return 0;
+		}
+		break;
+	case WM_SYSKEYUP:
+		switch( wParam )
+		{
+		case VK_CONTROL:
+		case VK_SHIFT:
+		case VK_MENU: //ALT
+		case VK_F10:
+			//return zero to bypass defProc and signal we processed the message
+			return 0;
+		}
+		break;
+	case WM_SYSCHAR:
+		// return zero to bypass defProc and signal we processed the message, unless it's an ALT-space
+		if (wParam != VK_SPACE)
+			return 0;
+		break;
+	case WM_ENTERSIZEMOVE:
+		//log->logMessage("WM_ENTERSIZEMOVE");
+		break;
+	case WM_EXITSIZEMOVE:
+		//log->logMessage("WM_EXITSIZEMOVE");
+		break;
+	case WM_MOVE:
+		//log->logMessage("WM_MOVE");
+		win->windowMovedOrResized();
+		for( ; start != end; ++start )
+			(start->second)->windowMoved(win);
+		break;
+	case WM_DISPLAYCHANGE:
+		win->windowMovedOrResized();
+		for( ; start != end; ++start )
+			(start->second)->windowResized(win);
+		break;
+	case WM_SIZE:
+		//log->logMessage("WM_SIZE");
+		win->windowMovedOrResized();
+		for( ; start != end; ++start )
+			(start->second)->windowResized(win);
+		break;
+	case WM_GETMINMAXINFO:
+		// Prevent the window from going smaller than some minimu size
+		((MINMAXINFO*)lParam)->ptMinTrackSize.x = 100;
+		((MINMAXINFO*)lParam)->ptMinTrackSize.y = 100;
+		break;
+	case WM_CLOSE:
+		//log->logMessage("WM_CLOSE");
+		win->destroy();
+		for( ; start != end; ++start )
+			(start->second)->windowClosed(win);
+		return 0;
+	}
+
+	return DefWindowProc( hWnd, uMsg, wParam, lParam );
+}
+#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
+//--------------------------------------------------------------------------------//
+void GLXProc( const XEvent &event )
+{
+	//We have to find appropriate window based on window id ( kindof hackish :/,
+	//but at least this only happens when there is a Window's event - and not that often
+	WindowEventUtilities::Windows::iterator i = WindowEventUtilities::_msWindows.begin(),
+						e = WindowEventUtilities::_msWindows.end();
+	RenderWindow* win = 0;
+	for(; i != e; ++i )
+	{
+		std::size_t wind = 0;
+		(*i)->getCustomAttribute("WINDOW", &wind);
+		if( event.xany.window == wind )
+		{
+			win = *i;
+			break;
+		}
+	}
+
+	//Sometimes, seems we get other windows, so just ignore
+	if( win == 0 ) return;
+
+	//Now that we have the correct RenderWindow for the generated Event, get an iterator for the listeners
+	WindowEventUtilities::WindowEventListeners::iterator 
+		start = WindowEventUtilities::_msListeners.lower_bound(win),
+		end   = WindowEventUtilities::_msListeners.upper_bound(win);
+
+	switch(event.type)
+	{
+	case ClientMessage:
+	{
+		::Atom atom;
+		win->getCustomAttribute("ATOM", &atom);
+		if(event.xclient.format == 32 && event.xclient.data.l[0] == (long)atom)
+		{	//Window Closed (via X button)
+			//Send message first, to allow app chance to unregister things that need done before
+			//window is shutdown
+			for( ; start != end; ++start )
+				(start->second)->windowClosed(win);
+			win->destroy();
+		}
+		break;
+	}
+	case ConfigureNotify:	//Moving or Resizing
+		unsigned int width, height, depth;
+		int left, top;
+		win->getMetrics(width, height, depth, left, top);
+
+		//determine if moving or sizing:
+		if( left == event.xconfigure.x && top == event.xconfigure.y )
+		{	//Resize width, height
+			win->windowMovedOrResized();
+			for( ; start != end; ++start )
+				(start->second)->windowResized(win);
+		}
+		else if( width == event.xconfigure.width && height == event.xconfigure.height )
+		{	//Moving x, y
+			win->windowMovedOrResized();
+			for( ; start != end; ++start )
+				(start->second)->windowMoved(win);
+		}
+		break;
+	case MapNotify:   //Restored
+		win->setActive( true );
+		for( ; start != end; ++start )
+			(start->second)->windowFocusChange(win);
+		break;
+	case UnmapNotify: //Minimised
+		win->setActive( false );
+		win->setVisible( false );
+		for( ; start != end; ++start )
+			(start->second)->windowFocusChange(win);
+		break;
+	case VisibilityNotify:
+		switch(event.xvisibility.state)
+		{
+		case VisibilityUnobscured:
+			win->setActive( true );
+			win->setVisible( true );
+			break;
+		case VisibilityPartiallyObscured:
+			win->setActive( true );
+			win->setVisible( true );
+			break;
+		case VisibilityFullyObscured:
+			win->setActive( false );
+			win->setVisible( false );
+			break;
+		}
+
+		//Notify Listeners that focus of window has changed in some way
+		for( ; start != end; ++start )
+			(start->second)->windowFocusChange(win);
+		break;
+	default:
+		break;
+	} //End switch event.type
+}
+#endif
Index: /OgreMain/src/OgreWireBoundingBox.cpp
===================================================================
--- /OgreMain/src/OgreWireBoundingBox.cpp	(revision 5)
+++ /OgreMain/src/OgreWireBoundingBox.cpp	(revision 5)
@@ -0,0 +1,233 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreWireBoundingBox.h"
+
+#include "OgreSimpleRenderable.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreCamera.h"
+
+namespace Ogre {
+    #define POSITION_BINDING 0
+
+	WireBoundingBox::WireBoundingBox() 
+    {
+        mRenderOp.vertexData = new VertexData();
+
+        mRenderOp.indexData = 0;
+		mRenderOp.vertexData->vertexCount = 24; 
+		mRenderOp.vertexData->vertexStart = 0; 
+		mRenderOp.operationType = RenderOperation::OT_LINE_LIST; 
+		mRenderOp.useIndexes = false; 
+
+        VertexDeclaration* decl = mRenderOp.vertexData->vertexDeclaration;
+        VertexBufferBinding* bind = mRenderOp.vertexData->vertexBufferBinding;
+
+        decl->addElement(POSITION_BINDING, 0, VET_FLOAT3, VES_POSITION);
+
+
+        HardwareVertexBufferSharedPtr vbuf = 
+            HardwareBufferManager::getSingleton().createVertexBuffer(
+                decl->getVertexSize(POSITION_BINDING),
+                mRenderOp.vertexData->vertexCount,
+                HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+
+        // Bind buffer
+        bind->setBinding(POSITION_BINDING, vbuf);
+
+        // set basic white material
+        this->setMaterial("BaseWhiteNoLighting");
+
+
+        
+	}
+	
+	WireBoundingBox::~WireBoundingBox() 
+    {
+        delete mRenderOp.vertexData;
+	}
+
+	void WireBoundingBox::setupBoundingBox(const AxisAlignedBox& aabb) 
+    {
+		// init the vertices to the aabb
+		setupBoundingBoxVertices(aabb);
+
+    	// setup the bounding box of this SimpleRenderable
+		setBoundingBox(aabb);
+
+	}
+
+	// Override this method to prevent parent transforms (rotation,translation,scale)
+    void WireBoundingBox::getWorldTransforms( Matrix4* xform ) const
+    {
+		// return identity matrix to prevent parent transforms
+        *xform = Matrix4::IDENTITY;
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& WireBoundingBox::getWorldOrientation(void) const
+    {
+        return Quaternion::IDENTITY;
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& WireBoundingBox::getWorldPosition(void) const
+    {
+        return Vector3::ZERO;
+    }
+
+    //-----------------------------------------------------------------------
+	void WireBoundingBox::setupBoundingBoxVertices(const AxisAlignedBox& aab) {
+
+		Vector3 vmax = aab.getMaximum();
+		Vector3 vmin = aab.getMinimum();
+
+        Real sqLen = std::max(vmax.squaredLength(), vmin.squaredLength());
+        mRadius = Math::Sqrt(sqLen);
+		
+
+		
+		
+		Real maxx = vmax.x;
+		Real maxy = vmax.y;
+		Real maxz = vmax.z;
+		
+		Real minx = vmin.x;
+		Real miny = vmin.y;
+		Real minz = vmin.z;
+		
+		// fill in the Vertex buffer: 12 lines with 2 endpoints each make up a box
+        HardwareVertexBufferSharedPtr vbuf =
+            mRenderOp.vertexData->vertexBufferBinding->getBuffer(POSITION_BINDING);     
+
+        float* pPos = static_cast<float*>(
+            vbuf->lock(HardwareBuffer::HBL_DISCARD));
+
+		// line 0
+        *pPos++ = minx;
+        *pPos++ = miny;
+        *pPos++ = minz;
+        *pPos++ = maxx;
+        *pPos++ = miny;
+        *pPos++ = minz;
+		// line 1
+        *pPos++ = minx;
+        *pPos++ = miny;
+        *pPos++ = minz;
+        *pPos++ = minx;
+        *pPos++ = miny;
+        *pPos++ = maxz;
+		// line 2
+        *pPos++ = minx;
+        *pPos++ = miny;
+        *pPos++ = minz;
+        *pPos++ = minx;
+        *pPos++ = maxy;
+        *pPos++ = minz;
+		// line 3
+        *pPos++ = minx;
+        *pPos++ = maxy;
+        *pPos++ = minz;
+        *pPos++ = minx;
+        *pPos++ = maxy;
+        *pPos++ = maxz;
+		// line 4
+        *pPos++ = minx;
+        *pPos++ = maxy;
+        *pPos++ = minz;
+        *pPos++ = maxx;
+        *pPos++ = maxy;
+        *pPos++ = minz;
+		// line 5
+        *pPos++ = maxx;
+        *pPos++ = miny;
+        *pPos++ = minz;
+        *pPos++ = maxx;
+        *pPos++ = miny;
+        *pPos++ = maxz;
+		// line 6
+        *pPos++ = maxx;
+        *pPos++ = miny;
+        *pPos++ = minz;
+        *pPos++ = maxx;
+        *pPos++ = maxy;
+        *pPos++ = minz;
+		// line 7
+        *pPos++ = minx;
+        *pPos++ = maxy;
+        *pPos++ = maxz;
+        *pPos++ = maxx;
+        *pPos++ = maxy;
+        *pPos++ = maxz;
+		// line 8
+        *pPos++ = minx;
+        *pPos++ = maxy;
+        *pPos++ = maxz;
+        *pPos++ = minx;
+        *pPos++ = miny;
+        *pPos++ = maxz;
+		// line 9
+        *pPos++ = maxx;
+        *pPos++ = maxy;
+        *pPos++ = minz;
+        *pPos++ = maxx;
+        *pPos++ = maxy;
+        *pPos++ = maxz;
+		// line 10
+        *pPos++ = maxx;
+        *pPos++ = miny;
+        *pPos++ = maxz;
+        *pPos++ = maxx;
+        *pPos++ = maxy;
+        *pPos++ = maxz;
+		// line 11
+        *pPos++ = minx;
+        *pPos++ = miny;
+        *pPos++ = maxz;
+        *pPos++ = maxx;
+        *pPos++ = miny;
+        *pPos++ = maxz;
+        vbuf->unlock();
+	}
+
+    //-----------------------------------------------------------------------
+	Real WireBoundingBox::getSquaredViewDepth(const Camera* cam) const
+	{
+		Vector3 min, max, mid, dist;
+		min = mBox.getMinimum();
+		max = mBox.getMaximum();
+		mid = ((max - min) * 0.5) + min;
+		dist = cam->getDerivedPosition() - mid;
+
+
+		return dist.squaredLength();
+	}
+
+
+
+}
+
Index: /OgreMain/src/OgreZip.cpp
===================================================================
--- /OgreMain/src/OgreZip.cpp	(revision 5)
+++ /OgreMain/src/OgreZip.cpp	(revision 5)
@@ -0,0 +1,300 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreZip.h"
+
+#include "OgreLogManager.h"
+#include "OgreException.h"
+#include "OgreStringVector.h"
+#include "OgreRoot.h"
+
+#include <zzip/zzip.h>
+
+
+namespace Ogre {
+
+    /// Utility method to format out zzip errors
+    String getZzipErrorDescription(zzip_error_t zzipError) 
+    {
+        String errorMsg;
+        switch (zzipError)
+        {
+        case ZZIP_NO_ERROR:
+            break;
+        case ZZIP_OUTOFMEM:
+            errorMsg = "Out of memory.";
+            break;            
+        case ZZIP_DIR_OPEN:
+        case ZZIP_DIR_STAT: 
+        case ZZIP_DIR_SEEK:
+        case ZZIP_DIR_READ:
+            errorMsg = "Unable to read zip file.";
+            break;            
+        case ZZIP_UNSUPP_COMPR:
+            errorMsg = "Unsupported compression format.";
+            break;            
+        case ZZIP_CORRUPTED:
+            errorMsg = "Corrupted archive.";
+            break;            
+        default:
+            errorMsg = "Unknown error.";
+            break;            
+        };
+
+        return errorMsg;
+    }
+    //-----------------------------------------------------------------------
+    ZipArchive::ZipArchive(const String& name, const String& archType )
+        : Archive(name, archType), mZzipDir(0)
+    {
+    }
+    //-----------------------------------------------------------------------
+    ZipArchive::~ZipArchive()
+    {
+        unload();
+    }
+    //-----------------------------------------------------------------------
+    void ZipArchive::load()
+    {
+        if (!mZzipDir)
+        {
+            zzip_error_t zzipError;
+            mZzipDir = zzip_dir_open(mName.c_str(), &zzipError);
+            checkZzipError(zzipError, "opening archive");
+
+            // Cache names
+            ZZIP_DIRENT zzipEntry;
+            while (zzip_dir_read(mZzipDir, &zzipEntry))
+            {
+                FileInfo info;
+				info.archive = this;
+                // Get basename / path
+                StringUtil::splitFilename(zzipEntry.d_name, info.basename, info.path);
+                info.filename = zzipEntry.d_name;
+                // Get sizes
+                info.compressedSize = static_cast<size_t>(zzipEntry.d_csize);
+                info.uncompressedSize = static_cast<size_t>(zzipEntry.st_size);
+                // folder entries
+                if (info.basename.empty())
+                {
+                    info.filename = info.filename.substr (0, info.filename.length () - 1);
+                    StringUtil::splitFilename(info.filename, info.basename, info.path);
+                    // Set compressed size to -1 for folders; anyway nobody will check
+                    // the compressed size of a folder, and if he does, its useless anyway
+                    info.compressedSize = size_t (-1);
+                }
+
+                mFileList.push_back(info);
+
+            }
+
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ZipArchive::unload()
+    {
+        if (mZzipDir)
+        {
+            zzip_dir_close(mZzipDir);
+            mZzipDir = 0;
+            mFileList.clear();
+        }
+    
+    }
+    //-----------------------------------------------------------------------
+	DataStreamPtr ZipArchive::open(const String& filename) const
+    {
+
+        // Format not used here (always binary)
+        ZZIP_FILE* zzipFile = 
+            zzip_file_open(mZzipDir, filename.c_str(), ZZIP_ONLYZIP | ZZIP_CASELESS);
+        if (!zzipFile)
+		{
+            int zerr = zzip_error(mZzipDir);
+            String zzDesc = getZzipErrorDescription((zzip_error_t)zerr);
+            LogManager::getSingleton().logMessage(
+                mName + " - Unable to open file " + filename + ", error was '" + zzDesc + "'");
+                
+			// return null pointer
+			return DataStreamPtr();
+		}
+
+		// Get uncompressed size too
+		ZZIP_STAT zstat;
+		zzip_dir_stat(mZzipDir, filename.c_str(), &zstat, ZZIP_CASEINSENSITIVE);
+
+        // Construct & return stream
+        return DataStreamPtr(new ZipDataStream(filename, zzipFile, static_cast<size_t>(zstat.st_size)));
+
+    }
+    //-----------------------------------------------------------------------
+    StringVectorPtr ZipArchive::list(bool recursive, bool dirs)
+    {
+        StringVectorPtr ret = StringVectorPtr(new StringVector());
+
+        FileInfoList::iterator i, iend;
+        iend = mFileList.end();
+        for (i = mFileList.begin(); i != iend; ++i)
+            if ((dirs == (i->compressedSize == size_t (-1))) &&
+                (recursive || i->path.empty()))
+                ret->push_back(i->filename);
+
+        return ret;
+    }
+    //-----------------------------------------------------------------------
+    FileInfoListPtr ZipArchive::listFileInfo(bool recursive, bool dirs)
+    {
+        FileInfoList* fil = new FileInfoList();
+        FileInfoList::const_iterator i, iend;
+        iend = mFileList.end();
+        for (i = mFileList.begin(); i != iend; ++i)
+            if ((dirs == (i->compressedSize == size_t (-1))) &&
+                (recursive || i->path.empty()))
+                fil->push_back(*i);
+
+        return FileInfoListPtr(fil);
+    }
+    //-----------------------------------------------------------------------
+    StringVectorPtr ZipArchive::find(const String& pattern, bool recursive, bool dirs)
+    {
+        StringVectorPtr ret = StringVectorPtr(new StringVector());
+        // If pattern contains a directory name, do a full match
+        bool full_match = (pattern.find ('/') != String::npos) ||
+                          (pattern.find ('\\') != String::npos);
+
+        FileInfoList::iterator i, iend;
+        iend = mFileList.end();
+        for (i = mFileList.begin(); i != iend; ++i)
+            if ((dirs == (i->compressedSize == size_t (-1))) &&
+                (recursive || full_match || i->path.empty()))
+                // Check basename matches pattern (zip is case insensitive)
+                if (StringUtil::match(full_match ? i->filename : i->basename, pattern, false))
+                    ret->push_back(i->filename);
+
+        return ret;
+    }
+    //-----------------------------------------------------------------------
+	FileInfoListPtr ZipArchive::findFileInfo(const String& pattern, 
+        bool recursive, bool dirs)
+    {
+        FileInfoListPtr ret = FileInfoListPtr(new FileInfoList());
+        // If pattern contains a directory name, do a full match
+        bool full_match = (pattern.find ('/') != String::npos) ||
+                          (pattern.find ('\\') != String::npos);
+
+        FileInfoList::iterator i, iend;
+        iend = mFileList.end();
+        for (i = mFileList.begin(); i != iend; ++i)
+            if ((dirs == (i->compressedSize == size_t (-1))) &&
+                (recursive || full_match || i->path.empty()))
+                // Check name matches pattern (zip is case insensitive)
+                if (StringUtil::match(full_match ? i->filename : i->basename, pattern, false))
+                    ret->push_back(*i);
+
+        return ret;
+    }
+    //-----------------------------------------------------------------------
+	bool ZipArchive::exists(const String& filename)
+	{
+		ZZIP_STAT zstat;
+		int res = zzip_dir_stat(mZzipDir, filename.c_str(), &zstat, ZZIP_CASEINSENSITIVE);
+
+		return (res == ZZIP_NO_ERROR);
+
+	}
+	//-----------------------------------------------------------------------
+    void ZipArchive::checkZzipError(int zzipError, const String& operation) const
+    {
+        if (zzipError != ZZIP_NO_ERROR)
+        {
+            String errorMsg = getZzipErrorDescription(static_cast<zzip_error_t>(zzipError));
+
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+                mName + " - error whilst " + operation + ": " + errorMsg,
+                "ZipArchive::checkZzipError");
+        }
+    }
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    ZipDataStream::ZipDataStream(ZZIP_FILE* zzipFile, size_t uncompressedSize)
+        : mZzipFile(zzipFile)
+    {
+		mSize = uncompressedSize;
+    }
+    //-----------------------------------------------------------------------
+    ZipDataStream::ZipDataStream(const String& name, ZZIP_FILE* zzipFile, size_t uncompressedSize)
+        :DataStream(name), mZzipFile(zzipFile)
+    {
+		mSize = uncompressedSize;
+    }
+    //-----------------------------------------------------------------------
+	ZipDataStream::~ZipDataStream()
+	{
+		close();
+	}
+    //-----------------------------------------------------------------------
+    size_t ZipDataStream::read(void* buf, size_t count)
+    {
+        return zzip_file_read(mZzipFile, (char*)buf, count);
+    }
+    //-----------------------------------------------------------------------
+    void ZipDataStream::skip(long count)
+    {
+        zzip_seek(mZzipFile, static_cast<zzip_off_t>(count), SEEK_CUR);
+    }
+    //-----------------------------------------------------------------------
+    void ZipDataStream::seek( size_t pos )
+    {
+		zzip_seek(mZzipFile, static_cast<zzip_off_t>(pos), SEEK_SET);
+    }
+    //-----------------------------------------------------------------------
+    size_t ZipDataStream::tell(void) const
+    {
+		return zzip_tell(mZzipFile);
+    }
+    //-----------------------------------------------------------------------
+    bool ZipDataStream::eof(void) const
+    {
+        return (zzip_tell(mZzipFile) >= static_cast<zzip_off_t>(mSize));
+    }
+    //-----------------------------------------------------------------------
+    void ZipDataStream::close(void)
+    {
+        zzip_file_close(mZzipFile);
+    }
+    //-----------------------------------------------------------------------
+    const String& ZipArchiveFactory::getType(void) const
+    {
+        static String name = "Zip";
+        return name;
+    }
+
+}
Index: /OgreMain/src/WIN32/OgreConfigDialog.cpp
===================================================================
--- /OgreMain/src/WIN32/OgreConfigDialog.cpp	(revision 5)
+++ /OgreMain/src/WIN32/OgreConfigDialog.cpp	(revision 5)
@@ -0,0 +1,331 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreConfigDialog.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreException.h"
+#include "resource.h"
+
+namespace
+{
+    Ogre::ConfigDialog* dlg;  // This is a pointer to instance, since this is a static member
+}
+
+
+namespace Ogre
+{
+    ConfigDialog::ConfigDialog()
+    {
+#ifdef OGRE_STATIC_LIB
+		mHInstance = GetModuleHandle( NULL );
+#else
+#  if OGRE_DEBUG_MODE == 1
+        mHInstance = GetModuleHandle("OgreMain_d.dll");
+#  else
+        mHInstance = GetModuleHandle("OgreMain.dll");
+#  endif
+#endif
+        mSelectedRenderSystem = 0;
+    }
+
+	ConfigDialog::~ConfigDialog()
+    {
+	}
+
+#if OGRE_ARCHITECTURE_64 == OGRE_ARCH_TYPE
+    INT_PTR ConfigDialog::DlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam)
+#else
+    BOOL ConfigDialog::DlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam)
+#endif
+    {
+        HWND hwndDlgItem;
+        static RenderSystemList* lstRend;
+        RenderSystemList::iterator pRend;
+        static ConfigOptionMap opts;
+        String err;
+
+        int i, sel, savedSel;
+
+        switch (iMsg)
+        {
+
+        case WM_INITDIALOG:
+            // Load saved settings
+            dlg->mSelectedRenderSystem = Root::getSingleton().getRenderSystem();
+            // Get all render systems
+            lstRend = Root::getSingleton().getAvailableRenderers();
+            pRend = lstRend->begin();            
+            i = 0;
+            while (pRend != lstRend->end())
+            {
+                hwndDlgItem = GetDlgItem(hDlg, IDC_CBO_RENDERSYSTEM);
+
+                SendMessage(hwndDlgItem, CB_ADDSTRING, 0,
+                    (LPARAM)(char*)(*pRend)->getName().c_str());
+
+                if (*pRend == dlg->mSelectedRenderSystem)
+                {
+                    // Select
+                    SendMessage(hwndDlgItem, CB_SETCURSEL, (WPARAM)i, 0);
+                    // Refresh Options
+                    // Get options from render system
+                    opts = (*pRend)->getConfigOptions();
+                    // Reset list box
+                    hwndDlgItem = GetDlgItem(hDlg, IDC_LST_OPTIONS);
+                    //SendMessage(hwndDlgItem, LB_RESETCONTENT, 0, 0);
+                    // Iterate through options
+                    ConfigOptionMap::iterator pOpt = opts.begin();
+                    String strLine;
+                    while( pOpt!= opts.end() )
+                    {
+                        strLine = pOpt->second.name + ": " + pOpt->second.currentValue;
+                        SendMessage(hwndDlgItem, LB_ADDSTRING, 0, (LPARAM)strLine.c_str());
+                        ++pOpt;
+                    }
+                }
+
+                ++pRend;
+                ++i;
+            }
+
+            // Center myself
+            int x, y, screenWidth, screenHeight;
+            RECT rcDlg;
+            GetWindowRect(hDlg, &rcDlg);
+            screenWidth = GetSystemMetrics(SM_CXFULLSCREEN);
+            screenHeight = GetSystemMetrics(SM_CYFULLSCREEN);
+
+            x = (screenWidth / 2) - ((rcDlg.right - rcDlg.left) / 2);
+            y = (screenHeight / 2) - ((rcDlg.bottom - rcDlg.top) / 2);
+
+            MoveWindow(hDlg, x, y, (rcDlg.right - rcDlg.left),
+                (rcDlg.bottom - rcDlg.top), TRUE);
+
+            return TRUE;
+
+        case WM_COMMAND:
+            switch (LOWORD(wParam))
+            {
+            case IDC_CBO_RENDERSYSTEM:
+                hwndDlgItem = GetDlgItem(hDlg, IDC_CBO_RENDERSYSTEM);
+                sel = SendMessage( hwndDlgItem, CB_GETCOUNT, 0, 0 );
+
+                if (HIWORD(wParam) == CBN_SELCHANGE )
+                {
+                    // RenderSystem selected
+                    // Get selected index
+                    hwndDlgItem = GetDlgItem(hDlg, IDC_CBO_RENDERSYSTEM);
+                    sel = SendMessage(hwndDlgItem, CB_GETCURSEL,0,0);
+                    if (sel != -1)
+                    {
+                        // Get RenderSystem selected
+                        pRend = lstRend->begin();
+                        dlg->mSelectedRenderSystem = pRend[sel];
+                        // refresh options
+                        // Get options from render system
+                        opts = pRend[sel]->getConfigOptions();
+                        // Reset list box
+                        hwndDlgItem = GetDlgItem(hDlg, IDC_LST_OPTIONS);
+                        SendMessage(hwndDlgItem, LB_RESETCONTENT, 0, 0);
+                        // Iterate through options
+                        ConfigOptionMap::iterator pOpt = opts.begin();
+                        String strLine;
+                        while (pOpt!=opts.end())
+                        {
+                            strLine = pOpt->second.name + ": " + pOpt->second.currentValue;
+                            SendMessage(hwndDlgItem, LB_ADDSTRING, 0, (LPARAM)strLine.c_str());
+                            ++pOpt;
+                        }
+                    }                    
+                }
+
+                return TRUE;
+
+            case IDC_LST_OPTIONS:
+                if (HIWORD(wParam) == LBN_SELCHANGE)
+                {
+                    // Selection in list box of options changed
+                    // Update combo and label in edit section
+                    hwndDlgItem = GetDlgItem(hDlg, IDC_LST_OPTIONS);
+                    sel = SendMessage(hwndDlgItem, LB_GETCURSEL, 0, 0);
+                    if (sel != -1)
+                    {
+                        ConfigOptionMap::iterator pOpt = opts.begin();
+                        for (i = 0; i < sel; i++)
+                            ++pOpt;
+                        // Set label text
+                        hwndDlgItem = GetDlgItem(hDlg, IDC_LBL_OPTION);
+                        SetWindowText(hwndDlgItem, pOpt->second.name.c_str());
+                        // Set combo options
+                        hwndDlgItem = GetDlgItem(hDlg, IDC_CBO_OPTION);
+                        SendMessage(hwndDlgItem, CB_RESETCONTENT, 0, 0);
+                        StringVector::iterator pPoss = pOpt->second.possibleValues.begin();
+                        i = 0;
+                        while (pPoss!=pOpt->second.possibleValues.end())
+                        {
+                            SendMessage(hwndDlgItem, CB_ADDSTRING, 0, (LPARAM)pPoss[0].c_str());
+                            if (pPoss[0] == pOpt->second.currentValue)
+                                // Select current value
+                                SendMessage(hwndDlgItem, CB_SETCURSEL, (WPARAM)i, 0);
+                            ++pPoss;
+                            ++i;
+                        }
+                        // Enable/disable combo depending on (not)immutable
+                        EnableWindow(hwndDlgItem, !(pOpt->second.immutable));
+                    }
+                }
+
+                return TRUE;
+
+            case IDC_CBO_OPTION:
+                if (HIWORD(wParam) == CBN_SELCHANGE)
+                {
+                    // Updated an option
+                    // Get option
+                    hwndDlgItem = GetDlgItem(hDlg, IDC_LST_OPTIONS);
+                    sel = SendMessage(hwndDlgItem, LB_GETCURSEL, 0, 0);
+                    savedSel = sel;
+                    ConfigOptionMap::iterator pOpt = opts.begin();
+                    for (i = 0; i < sel; i++)
+                        ++pOpt;
+                    // Get selected value
+                    hwndDlgItem = GetDlgItem(hDlg, IDC_CBO_OPTION);
+                    sel = SendMessage(hwndDlgItem, CB_GETCURSEL, 0, 0);
+
+                    if (sel != -1)
+                    {
+                        StringVector::iterator pPoss = pOpt->second.possibleValues.begin();
+
+                        // Set option
+                        dlg->mSelectedRenderSystem->setConfigOption(
+                            pOpt->second.name, pPoss[sel]);
+                        // Re-retrieve options
+                        opts = dlg->mSelectedRenderSystem->getConfigOptions();
+
+                        // Reset options list box
+                        hwndDlgItem = GetDlgItem(hDlg, IDC_LST_OPTIONS);
+                        SendMessage(hwndDlgItem, LB_RESETCONTENT, 0, 0);
+                        // Iterate through options
+                        pOpt = opts.begin();
+                        String strLine;
+                        while (pOpt!=opts.end())
+                        {
+                            strLine = pOpt->second.name + ": " + pOpt->second.currentValue;
+                            SendMessage(hwndDlgItem, LB_ADDSTRING, 0, (LPARAM)strLine.c_str());
+                            ++pOpt;
+                        }
+                        // Select previously selected item
+                        SendMessage(hwndDlgItem, LB_SETCURSEL, savedSel, 0);
+                    }
+
+                }
+                return TRUE;
+
+            case IDOK:
+                // Set render system
+                if (!dlg->mSelectedRenderSystem)
+                {
+                    MessageBox(NULL, "Please choose a rendering system.", "OGRE", MB_OK | MB_ICONEXCLAMATION);
+                    return TRUE;
+                }
+                err = dlg->mSelectedRenderSystem->validateConfigOptions();
+                if (err.length() > 0)
+                {
+                    // refresh options incase updated by validation
+                    // Get options from render system
+                    opts = dlg->mSelectedRenderSystem->getConfigOptions();
+                    // Reset list box
+                    hwndDlgItem = GetDlgItem(hDlg, IDC_LST_OPTIONS);
+                    SendMessage(hwndDlgItem, LB_RESETCONTENT, 0, 0);
+                    // Iterate through options
+                    ConfigOptionMap::iterator pOpt = opts.begin();
+                    String strLine;
+                    while (pOpt!=opts.end())
+                    {
+                        strLine = pOpt->second.name + ": " + pOpt->second.currentValue;
+                        SendMessage(hwndDlgItem, LB_ADDSTRING, 0, (LPARAM)strLine.c_str());
+                        ++pOpt;
+                    }
+                    MessageBox(NULL, err.c_str(), "OGRE", MB_OK | MB_ICONEXCLAMATION);
+                    return TRUE;
+                }
+
+                Root::getSingleton().setRenderSystem(dlg->mSelectedRenderSystem);
+
+                EndDialog(hDlg, TRUE);
+                return TRUE;
+
+            case IDCANCEL:
+                EndDialog(hDlg, FALSE);
+                return TRUE;
+            }
+        }
+
+        return FALSE;
+    }
+
+
+    bool ConfigDialog::display(void)
+    {
+        // Display dialog
+        // Don't return to caller until dialog dismissed
+        int i;
+        dlg = this;
+        
+        i = DialogBox(mHInstance, MAKEINTRESOURCE(IDD_DLG_CONFIG), NULL, DlgProc);
+
+        if (i == -1)
+        {
+            int winError = GetLastError();
+            char* errDesc;
+            int i;
+
+            errDesc = new char[255];
+            // Try windows errors first
+            i = FormatMessage(
+                FORMAT_MESSAGE_FROM_SYSTEM |
+                FORMAT_MESSAGE_IGNORE_INSERTS,
+                NULL,
+                winError,
+                MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+                (LPTSTR) errDesc,
+                255,
+                NULL
+            );
+
+            throw Exception(winError,errDesc, "ConfigDialog::display");
+        }
+        if (i)
+            return true;
+        else
+            return false;
+
+    }
+}
Index: /OgreMain/src/WIN32/OgreErrorDialog.cpp
===================================================================
--- /OgreMain/src/WIN32/OgreErrorDialog.cpp	(revision 5)
+++ /OgreMain/src/WIN32/OgreErrorDialog.cpp	(revision 5)
@@ -0,0 +1,107 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreErrorDialog.h"
+#include "resource.h"
+
+namespace {
+    Ogre::ErrorDialog* dlg;  // This is a pointer to instance, since this is a static member
+}
+
+namespace Ogre
+{
+    ErrorDialog::ErrorDialog()
+    {
+#ifdef OGRE_STATIC_LIB
+		mHInstance = GetModuleHandle( NULL );
+#else
+#  if OGRE_DEBUG_MODE == 1
+        mHInstance = GetModuleHandle("OgreMain_d.dll");
+#  else
+        mHInstance = GetModuleHandle("OgreMain.dll");
+#  endif
+#endif
+    }
+
+#if OGRE_ARCHITECTURE_64 == OGRE_ARCH_TYPE
+    INT_PTR CALLBACK ErrorDialog::DlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam)
+#else
+    BOOL CALLBACK ErrorDialog::DlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam)
+#endif
+    {
+        HWND hwndDlgItem;
+
+        switch (iMsg)
+        {
+
+        case WM_INITDIALOG:
+            // Center myself
+            int x, y, screenWidth, screenHeight;
+            RECT rcDlg;
+            GetWindowRect(hDlg, &rcDlg);
+            screenWidth = GetSystemMetrics(SM_CXFULLSCREEN);
+            screenHeight = GetSystemMetrics(SM_CYFULLSCREEN);
+
+            x = (screenWidth / 2) - ((rcDlg.right - rcDlg.left) / 2);
+            y = (screenHeight / 2) - ((rcDlg.bottom - rcDlg.top) / 2);
+
+            MoveWindow(hDlg, x, y, (rcDlg.right - rcDlg.left),
+                (rcDlg.bottom - rcDlg.top), TRUE);
+
+            // Fill in details of error
+            hwndDlgItem = GetDlgItem(hDlg, IDC_ERRMSG);
+            SetWindowText(hwndDlgItem, dlg->mErrorMsg.c_str());
+
+            return TRUE;
+        case WM_COMMAND:
+            switch (LOWORD(wParam))
+            {
+            case IDOK:
+
+                EndDialog(hDlg, TRUE);
+                return TRUE;
+            }
+        }
+
+        return FALSE;
+
+    }
+
+
+    void ErrorDialog::display(const String& errorMessage, String logName)
+    {
+        // Display dialog
+        // Don't return to caller until dialog dismissed
+        dlg = this;
+        mErrorMsg = errorMessage;
+        DialogBox(mHInstance, MAKEINTRESOURCE(IDD_DLG_ERROR), NULL, DlgProc);
+
+
+    }
+}
Index: /OgreMain/src/WIN32/OgreTimer.cpp
===================================================================
--- /OgreMain/src/WIN32/OgreTimer.cpp	(revision 5)
+++ /OgreMain/src/WIN32/OgreTimer.cpp	(revision 5)
@@ -0,0 +1,160 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+#include "OgreTimer.h"
+
+using namespace Ogre;
+
+//-------------------------------------------------------------------------
+Timer::Timer()
+{
+	reset();
+}
+
+//-------------------------------------------------------------------------
+Timer::~Timer()
+{
+}
+
+//-------------------------------------------------------------------------
+void Timer::reset()
+{
+	zeroClock = clock();
+
+    QueryPerformanceFrequency(&mFrequency);
+    QueryPerformanceCounter(&mStartTime);
+    mStartTick = GetTickCount();
+    mLastTime = 0;
+	mQueryCount = 0;
+
+    // Save the current process
+    HANDLE mProc = GetCurrentProcess();
+
+    // Get the current Affinity
+#if _MSC_VER >= 1400 && defined (_M_X64)
+	GetProcessAffinityMask(mProc, (PDWORD_PTR)&mProcMask, (PDWORD_PTR)&mSysMask);
+#else
+	GetProcessAffinityMask(mProc, &mProcMask, &mSysMask);
+#endif
+
+    mThread = GetCurrentThread();
+}
+
+//-------------------------------------------------------------------------
+unsigned long Timer::getMilliseconds()
+{
+    LARGE_INTEGER curTime;
+
+    // Set affinity to the first core
+    SetThreadAffinityMask(mThread, 1);
+
+    // Query the timer
+    QueryPerformanceCounter(&curTime);
+
+    // Reset affinity
+    SetThreadAffinityMask(mThread, mProcMask);
+
+	// Resample the frequency
+    mQueryCount++;
+    if(mQueryCount == FREQUENCY_RESAMPLE_RATE)
+    {
+        mQueryCount = 0;
+        QueryPerformanceFrequency(&mFrequency);
+    }
+
+    LONGLONG newTime = curTime.QuadPart - mStartTime.QuadPart;
+    
+    // scale by 1000 for milliseconds
+    unsigned long newTicks = (unsigned long) (1000 * newTime / mFrequency.QuadPart);
+
+    // detect and compensate for performance counter leaps
+    // (surprisingly common, see Microsoft KB: Q274323)
+    unsigned long check = GetTickCount() - mStartTick;
+    signed long msecOff = (signed long)(newTicks - check);
+    if (msecOff < -100 || msecOff > 100)
+    {
+        // We must keep the timer running forward :)
+        LONGLONG adjust = (std::min)(msecOff * mFrequency.QuadPart / 1000, newTime - mLastTime);
+        mStartTime.QuadPart += adjust;
+        newTime -= adjust;
+
+        // Re-calculate milliseconds
+        newTicks = (unsigned long) (1000 * newTime / mFrequency.QuadPart);
+    }
+
+    // Record last time for adjust
+    mLastTime = newTime;
+
+    return newTicks;
+}
+
+//-------------------------------------------------------------------------
+unsigned long Timer::getMicroseconds()
+{
+    LARGE_INTEGER curTime;
+    QueryPerformanceCounter(&curTime);
+    LONGLONG newTime = curTime.QuadPart - mStartTime.QuadPart;
+    
+    // get milliseconds to check against GetTickCount
+    unsigned long newTicks = (unsigned long) (1000 * newTime / mFrequency.QuadPart);
+    
+    // detect and compensate for performance counter leaps
+    // (surprisingly common, see Microsoft KB: Q274323)
+    unsigned long check = GetTickCount() - mStartTick;
+    signed long msecOff = (signed long)(newTicks - check);
+    if (msecOff < -100 || msecOff > 100)
+    {
+        // We must keep the timer running forward :)
+        LONGLONG adjust = (std::min)(msecOff * mFrequency.QuadPart / 1000, newTime - mLastTime);
+        mStartTime.QuadPart += adjust;
+        newTime -= adjust;
+    }
+
+    // Record last time for adjust
+    mLastTime = newTime;
+
+    // scale by 1000000 for microseconds
+    unsigned long newMicro = (unsigned long) (1000000 * newTime / mFrequency.QuadPart);
+
+    return newMicro;
+}
+
+//-------------------------------------------------------------------------
+unsigned long Timer::getMillisecondsCPU()
+{
+	clock_t newClock = clock();
+	return (unsigned long)((float)(newClock-zeroClock) / ((float)CLOCKS_PER_SEC/1000.0)) ;
+}
+
+//-------------------------------------------------------------------------
+unsigned long Timer::getMicrosecondsCPU()
+{
+	clock_t newClock = clock();
+	return (unsigned long)((float)(newClock-zeroClock) / ((float)CLOCKS_PER_SEC/1000000.0)) ;
+}
Index: /OgreMain/src/WIN32/OgreWin32Resources.rc
===================================================================
--- /OgreMain/src/WIN32/OgreWin32Resources.rc	(revision 5)
+++ /OgreMain/src/WIN32/OgreWin32Resources.rc	(revision 5)
@@ -0,0 +1,156 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "winres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Neutral resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDB_SPLASH              BITMAP                  "ogrelogo.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_OGREICON            ICON                    "ogre.ico"
+#endif    // Neutral resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.K.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE 
+BEGIN
+    "#include ""winres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DLG_CONFIG DIALOGEX 0, 0, 329, 270
+STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION
+CAPTION "OGRE Engine Rendering Setup"
+FONT 8, "MS Sans Serif", 0, 0, 0x0
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDOK,205,253,60,14
+    PUSHBUTTON      "&Cancel",IDCANCEL,267,253,60,14
+    LTEXT           "Rendering Subsystem:",IDC_STATIC,21,136,73,12
+    COMBOBOX        IDC_CBO_RENDERSYSTEM,95,134,219,57,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    GROUPBOX        "Rendering System Options",IDC_OPTFRAME,5,152,322,101
+    LISTBOX         IDC_LST_OPTIONS,13,163,310,68,LBS_NOINTEGRALHEIGHT | 
+                    WS_VSCROLL | WS_TABSTOP
+    RTEXT           "[Click On An Option]:",IDC_LBL_OPTION,14,237,125,11
+    COMBOBOX        IDC_CBO_OPTION,143,235,180,94,CBS_DROPDOWNLIST | 
+                    WS_DISABLED | WS_VSCROLL | WS_TABSTOP
+    CONTROL         106,IDC_STATIC,"Static",SS_BITMAP,0,0,327,140
+END
+
+IDD_DLG_ERROR DIALOG  0, 0, 243, 178
+STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION
+CAPTION "Error"
+FONT 8, "MS Sans Serif"
+BEGIN
+    DEFPUSHBUTTON   "&Close",IDOK,81,157,80,14
+    LTEXT           "The Ogre engine has encountered an error from which it cannot recover. The last message was:",
+                    IDC_STATIC,7,7,229,19
+    LTEXT           "",IDC_ERRMSG,17,29,209,84,SS_SUNKEN
+    LTEXT           "If you cannot resolve this issue yourself, please report it through the web site at http://www.ogre3d.org.",
+                    IDC_STATIC,7,118,229,19
+    LTEXT           "If you report the error, please include details of your hardware setup, and attach a copy of the 'ogre.log' file which you will find in the local folder.",
+                    IDC_STATIC,7,138,229,17
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO 
+BEGIN
+    IDD_DLG_CONFIG, DIALOG
+    BEGIN
+        RIGHTMARGIN, 300
+        BOTTOMMARGIN, 267
+    END
+
+    IDD_DLG_ERROR, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 236
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 171
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+#endif    // English (U.K.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
Index: /OgreMain/src/WIN32/resource.h
===================================================================
--- /OgreMain/src/WIN32/resource.h	(revision 5)
+++ /OgreMain/src/WIN32/resource.h	(revision 5)
@@ -0,0 +1,36 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by OgreWin32Resources.rc
+//
+#define IDD_DLG_VIDEO                   101
+#define IDD_DLG_CONFIG                  101
+#define IDI_ICON1                       103
+#define IDB_SPLASH                      106
+#define IDD_DLG_ERROR                   107
+#define IDI_OGREICON                    111
+#define IDC_CBO_VIDEO                   1001
+#define IDC_VIDEO_MODE                  1002
+#define ID_LBL_RES                      1003
+#define IDC_CBO_RESOLUTION              1004
+#define IDC_CBO_VIDEOMODE               1004
+#define IDC_COLOUR_DEPTH                1005
+#define IDC_CBO_COLOUR_DEPTH            1006
+#define IDC_CHK_FULLSCREEN              1007
+#define IDC_CBO_RENDERSYSTEM            1009
+#define IDC_OPTFRAME                    1010
+#define IDC_CBO_OPTION                  1011
+#define IDC_LST_OPTIONS                 1013
+#define IDC_LBL_OPTION                  1014
+#define IDC_ERRMSG                      1018
+#define IDC_SELECT_VIDEO                -1
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        115
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1020
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
Index: /OgreMain/src/WIN32/winres.h
===================================================================
--- /OgreMain/src/WIN32/winres.h	(revision 5)
+++ /OgreMain/src/WIN32/winres.h	(revision 5)
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2000 Francois Gouget
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <winresrc.h>
+
+#ifdef IDC_STATIC
+#undef IDC_STATIC
+#endif
+#define IDC_STATIC      (-1)
+
Index: /OgreMain/src/gtk/GLX_backdrop.h
===================================================================
--- /OgreMain/src/gtk/GLX_backdrop.h	(revision 5)
+++ /OgreMain/src/gtk/GLX_backdrop.h	(revision 5)
@@ -0,0 +1,1 @@
+static uint8 GLX_backdrop_data[12490]={137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,1,235,0,0,0,212,8,3,0,0,0,139,118,251,95,0,0,3,0,80,76,84,69,0,1,0,0,2,0,1,4,0,3,5,1,0,9,3,12,5,4,7,10,6,1,14,7,14,13,2,6,17,12,13,16,12,13,20,8,17,19,16,19,24,15,15,26,17,22,23,21,18,26,22,19,29,20,32,24,14,25,26,24,21,31,22,29,30,28,27,33,26,24,35,26,26,37,28,34,36,33,32,39,36,34,39,31,30,41,32,46,36,17,39,40,38,34,45,36,41,43,40,37,45,41,39,45,36,37,48,39,39,48,34,45,47,44,38,53,39,41,53,43,48,49,46,61,48,19,44,52,48,47,52,44,40,57,44,50,53,40,44,55,46,41,59,48,46,58,48,45,60,44,49,58,44,47,59,49,52,57,49,54,56,53,48,60,50,49,61,51,50,62,52,52,62,47,51,62,52,55,61,52,53,65,55,56,65,50,54,66,56,80,60,26,62,64,61,58,66,62,61,66,58,57,69,59,60,69,54,63,72,57,61,73,63,64,72,68,67,73,64,61,77,60,70,73,60,66,76,61,71,73,70,65,77,67,70,75,67,94,71,31,66,82,65,69,81,70,74,80,72,78,80,77,78,82,68,70,86,69,81,80,73,73,85,74,73,90,73,87,84,71,77,89,79,86,85,78,93,83,76,108,83,37,77,92,76,83,89,80,86,88,85,86,90,76,86,93,73,80,97,80,84,96,86,94,95,75,96,93,81,92,94,91,88,98,82,93,96,83,85,101,84,106,92,86,99,97,84,89,101,90,96,98,95,88,104,87,122,95,43,149,75,77,91,104,93,94,104,88,90,106,89,99,102,88,104,101,88,91,108,90,94,106,95,92,109,92,101,106,93,102,104,101,150,84,85,94,111,93,108,105,92,109,108,83,122,100,94,107,109,92,97,114,96,100,112,101,107,109,106,99,116,98,136,107,48,110,112,109,102,119,101,105,117,106,114,116,113,116,118,97,106,123,105,115,119,108,109,122,110,162,100,99,118,120,116,140,111,105,110,127,109,119,121,118,154,117,54,114,127,116,125,126,107,123,125,122,114,132,113,129,128,102,126,128,125,171,110,108,118,136,117,121,134,122,129,131,128,157,120,114,133,133,111,123,140,122,170,130,53,134,136,133,126,144,125,131,143,130,140,141,120,140,142,139,138,144,134,131,149,130,177,131,129,149,147,121,146,146,137,135,153,134,185,142,58,163,140,131,140,154,142,139,156,138,149,151,147,193,135,137,143,161,142,189,139,138,146,160,148,161,160,132,200,154,63,157,159,156,198,141,142,150,164,152,148,166,147,195,144,143,166,160,147,151,170,150,160,166,156,155,169,157,195,151,148,163,165,161,170,167,135,205,147,149,155,173,154,186,158,150,158,176,157,205,153,153,213,165,67,183,165,155,175,173,140,161,179,160,173,175,172,163,182,162,176,175,166,183,173,160,177,181,165,167,186,166,185,183,151,206,170,169,232,176,72,186,182,168,181,183,179,171,190,170,170,196,175,175,194,174,177,195,176,188,190,187,179,197,178,174,200,179,180,199,179,183,201,182,178,204,182,246,188,83,193,195,191,198,199,176,181,208,186,216,191,189,200,201,198,186,212,190,205,207,204,192,218,196,211,212,209,199,224,197,230,210,212,216,219,215,220,219,210,207,231,203,223,225,221,234,221,221,212,236,208,229,228,219,229,231,228,236,235,226,235,237,234,229,243,231,242,244,240,249,243,242,248,247,238,253,247,246,248,250,247,254,255,252,46,85,12,249,0,0,32,0,73,68,65,84,120,218,237,157,15,88,83,247,189,240,205,147,92,64,105,117,80,45,218,226,208,226,22,153,187,233,113,193,228,225,200,31,43,96,177,168,192,28,211,177,105,221,11,183,218,92,53,217,51,102,250,188,246,236,221,34,32,114,153,215,43,56,185,92,106,7,165,175,111,214,145,183,88,70,113,166,227,181,237,152,151,107,100,207,216,24,73,142,33,68,231,170,115,179,115,172,243,218,13,222,223,249,155,115,146,243,47,39,1,145,158,239,211,231,169,74,114,18,206,231,124,255,254,190,191,239,111,222,148,34,159,20,153,167,220,2,133,181,34,10,107,69,20,214,138,40,172,21,81,88,43,162,176,86,68,97,173,136,194,90,17,133,181,34,115,135,245,245,214,13,173,215,21,126,115,159,245,7,135,151,169,48,217,123,95,33,56,167,89,223,173,89,161,162,100,175,66,112,14,179,190,186,65,197,20,197,140,207,85,214,247,14,46,81,177,165,85,65,56,39,89,223,222,206,128,172,126,228,41,236,127,27,20,132,115,144,245,157,131,12,210,143,60,169,131,211,176,63,172,83,16,206,57,214,183,246,50,64,63,149,14,3,89,128,253,185,73,65,56,199,88,223,221,18,180,221,143,231,239,200,54,2,212,90,252,175,87,21,132,115,138,245,221,45,106,138,116,220,202,125,230,82,3,134,26,126,18,251,251,106,133,224,92,98,205,212,233,101,21,54,83,174,1,35,13,235,113,19,126,86,33,56,135,88,95,137,163,73,127,186,12,65,202,96,2,53,156,142,255,219,45,133,224,156,97,61,73,7,223,113,43,42,16,91,101,190,222,72,160,206,122,92,49,225,179,143,245,221,59,87,106,106,246,28,126,239,206,71,50,148,250,17,138,244,99,101,72,173,121,179,129,84,106,56,75,135,187,240,43,10,192,217,194,250,238,232,107,228,34,5,46,43,106,222,187,117,55,130,183,223,167,148,58,110,73,145,213,134,236,206,167,72,3,214,159,194,127,112,79,1,56,43,88,95,103,98,14,202,178,195,239,93,151,166,225,53,148,167,94,176,173,218,102,179,22,235,131,168,201,228,250,160,194,111,22,176,30,13,166,73,92,178,162,70,244,10,183,87,211,193,119,149,13,65,42,11,244,12,210,100,100,118,87,225,247,192,89,211,110,86,136,182,176,253,125,143,122,225,162,173,213,54,164,154,14,191,73,193,63,96,153,130,239,65,179,190,190,34,20,172,26,72,56,238,213,13,247,69,47,161,94,185,175,222,94,95,153,99,48,178,80,27,241,203,29,86,240,61,88,214,247,246,132,82,198,56,171,53,241,26,77,56,239,195,247,133,171,39,139,138,204,45,246,150,50,35,91,169,225,172,149,248,79,63,82,240,61,80,214,87,23,49,64,171,84,154,248,133,75,83,82,245,208,82,173,65,15,165,44,140,15,211,240,13,163,97,151,56,76,199,100,171,77,39,187,157,166,130,16,165,134,179,32,60,50,91,33,250,101,62,56,219,10,228,202,213,233,13,215,239,190,87,243,153,154,243,183,62,105,172,131,26,9,152,106,230,235,116,165,213,213,136,21,169,181,229,99,140,114,96,67,42,160,173,209,104,152,180,31,97,155,226,6,218,215,47,219,103,110,243,187,118,146,57,53,67,183,179,240,149,107,149,112,124,119,251,220,22,186,226,166,90,176,225,244,149,105,2,30,172,246,108,104,186,114,247,147,195,58,88,207,84,169,151,150,237,54,219,106,65,4,141,137,53,155,84,205,108,125,250,163,56,109,166,118,175,184,77,95,225,206,58,26,207,70,83,139,51,208,95,14,17,239,52,192,91,131,138,45,90,51,187,254,218,167,195,227,131,79,55,141,70,255,43,222,186,26,20,76,149,39,217,31,4,30,170,209,123,159,4,214,53,193,223,57,165,2,33,49,99,242,77,19,76,103,76,217,176,118,169,6,195,205,52,230,164,106,95,167,23,169,227,214,87,32,61,222,64,123,129,142,12,198,224,202,221,116,205,12,194,31,169,243,252,26,189,129,47,250,127,236,140,204,254,180,201,171,231,91,183,111,88,16,126,69,174,143,90,178,253,236,213,201,57,205,122,114,53,253,203,46,52,90,113,210,230,125,85,184,108,203,4,18,116,186,185,218,197,137,26,182,114,3,213,190,223,16,140,223,151,148,89,219,250,199,199,218,33,136,68,173,179,182,148,66,108,19,126,151,175,132,35,156,236,237,137,88,185,111,159,223,251,25,85,196,242,153,189,103,63,152,171,172,175,211,85,178,249,5,214,90,0,186,170,162,162,172,162,218,12,196,106,6,128,128,106,194,70,35,173,220,233,143,198,227,180,105,220,12,68,139,158,177,158,236,241,5,92,38,170,252,109,208,53,142,13,213,83,203,30,240,99,216,139,182,112,215,112,246,136,83,216,30,129,110,223,62,183,231,49,149,124,217,112,244,252,157,185,199,122,148,118,212,233,102,76,167,77,207,110,168,176,214,218,172,102,171,21,177,237,38,41,25,51,25,209,180,126,177,38,212,113,19,230,251,115,38,164,7,29,11,184,119,106,201,183,65,250,22,15,144,122,45,142,62,107,13,239,178,199,245,16,139,186,124,151,5,72,94,70,66,200,71,52,220,151,8,122,139,52,164,150,190,186,146,229,124,63,92,176,229,181,235,115,138,53,237,170,53,5,128,180,213,180,173,226,120,119,191,203,237,114,182,219,172,136,169,128,210,72,35,195,146,195,217,218,20,14,218,159,42,179,217,93,168,207,223,89,70,186,106,24,202,239,10,160,94,175,207,215,130,87,196,179,136,172,46,28,215,237,131,172,11,229,53,15,94,163,100,196,97,201,99,21,229,197,13,249,253,209,237,146,213,55,3,255,16,240,25,201,60,47,136,219,114,238,246,28,97,125,143,118,213,41,149,64,151,119,124,241,128,125,216,231,247,121,80,212,239,115,183,151,229,6,211,37,22,108,224,184,113,218,12,216,106,200,220,230,26,3,239,124,133,114,213,48,148,211,131,161,246,122,81,255,43,192,17,144,106,29,182,236,113,255,44,75,163,155,71,174,133,74,71,9,227,5,175,137,168,244,25,30,211,189,60,35,40,203,217,172,201,135,42,204,138,80,105,192,225,209,185,192,154,174,104,194,72,189,121,91,89,251,128,123,12,197,241,0,25,115,85,232,152,213,77,118,9,44,55,45,94,19,84,109,181,182,220,62,132,250,188,1,215,1,122,165,26,42,236,9,144,151,242,93,218,164,135,179,240,252,91,29,154,216,140,50,22,213,18,74,6,175,113,202,136,37,168,120,123,4,73,135,171,110,137,165,195,17,254,252,92,115,56,234,44,121,187,216,255,54,216,177,43,131,59,13,56,60,122,255,33,103,77,133,85,234,205,141,72,105,197,241,254,128,143,2,237,245,122,134,46,30,209,177,74,217,236,26,24,208,108,10,182,250,209,156,147,93,128,180,199,223,95,65,185,106,88,151,67,163,246,250,235,181,84,251,104,232,62,174,215,130,55,52,217,50,114,141,95,234,104,173,91,199,27,53,157,99,19,74,46,105,238,187,22,177,244,53,239,90,206,141,123,154,72,222,3,25,255,228,116,179,254,128,36,189,184,124,247,166,205,166,225,128,207,27,36,237,113,95,184,240,146,14,230,149,236,84,181,134,128,29,247,212,86,171,221,237,71,189,30,247,155,155,40,251,13,27,202,130,168,125,174,173,107,97,24,111,82,88,196,86,235,219,193,152,44,185,89,132,193,200,46,218,137,114,195,190,190,154,101,179,235,6,175,201,23,71,93,73,114,236,146,124,78,190,87,90,91,143,110,216,64,37,133,235,206,79,47,107,226,222,168,53,233,154,184,202,161,113,6,105,212,231,190,216,219,219,91,1,193,2,146,22,135,235,116,170,201,218,50,0,72,123,61,222,227,122,186,240,98,52,118,211,168,189,227,141,64,173,245,28,43,92,65,61,76,16,212,105,10,64,178,16,108,166,249,78,142,10,52,245,112,117,132,43,248,246,40,108,121,24,223,144,229,164,233,100,125,133,68,173,82,111,117,250,153,58,237,15,12,28,63,80,81,81,145,111,20,98,13,235,210,116,16,188,219,106,179,123,253,216,187,46,85,25,130,46,221,80,224,162,175,136,186,203,32,216,136,123,235,71,120,236,119,158,52,52,35,121,188,176,25,22,66,85,226,184,22,43,25,108,206,11,137,216,150,157,189,29,59,190,44,105,154,62,214,53,212,90,199,214,158,113,63,133,5,4,224,129,225,215,143,108,133,116,16,4,9,163,54,148,34,181,181,72,117,219,16,238,228,253,174,29,90,198,235,161,130,97,218,245,251,91,116,84,201,140,245,236,54,209,90,40,157,13,101,199,55,240,123,234,146,193,107,177,149,142,146,16,220,103,110,199,140,47,75,70,167,139,245,106,106,249,178,116,156,180,182,62,255,56,58,60,220,221,184,9,210,234,97,81,49,230,90,17,171,181,177,199,139,235,175,159,21,180,235,180,176,217,77,199,243,3,57,64,223,23,133,121,107,186,220,145,55,18,193,141,111,230,180,120,65,11,145,17,107,210,132,247,8,193,205,65,123,242,170,44,190,146,20,123,94,76,180,90,165,42,67,9,99,139,6,134,58,91,204,185,5,70,173,222,8,75,16,160,214,214,90,167,15,120,106,212,227,31,119,149,106,25,133,53,107,91,151,219,27,12,194,105,181,190,194,129,58,161,57,178,219,222,204,145,103,7,45,68,199,181,233,18,86,146,31,70,251,252,58,249,136,19,64,198,175,18,220,166,28,37,107,170,51,97,55,17,125,163,62,180,167,84,167,213,25,12,146,64,99,25,152,9,65,108,157,110,159,63,128,186,157,245,197,140,48,14,42,117,143,7,3,51,143,11,171,200,60,22,234,173,41,212,201,17,103,69,205,97,22,143,70,93,50,114,109,26,101,164,142,21,154,159,227,72,94,35,225,155,103,177,212,57,28,228,175,79,252,235,244,176,174,33,13,120,25,102,130,81,116,204,55,96,205,129,36,98,166,170,41,133,101,251,76,181,157,246,147,230,82,152,105,244,141,80,103,192,235,235,30,34,109,248,120,27,80,235,39,254,33,164,71,129,90,233,88,46,131,14,169,96,203,238,135,160,142,212,66,200,177,229,204,130,237,106,58,3,59,47,139,47,83,166,147,245,34,34,44,171,240,250,80,95,0,5,78,186,24,50,192,145,137,209,160,7,188,11,244,90,29,251,173,250,226,254,49,212,93,79,198,102,168,207,164,131,141,196,250,241,100,152,38,202,83,68,178,182,213,192,190,86,114,223,181,25,144,65,166,41,63,72,44,207,222,95,38,139,239,12,177,38,189,117,86,192,239,119,59,187,90,108,59,11,160,112,148,107,159,126,90,204,162,27,57,108,190,182,18,68,230,67,181,36,235,177,75,57,198,172,39,66,194,41,42,106,46,145,105,76,19,24,227,117,206,69,97,33,162,166,253,200,123,172,165,194,200,248,50,107,117,196,202,249,180,176,94,65,88,240,242,27,94,103,75,181,217,92,14,51,3,111,195,211,107,63,191,246,243,112,65,193,87,191,156,175,135,34,212,118,112,165,110,191,215,231,180,145,172,3,141,64,173,227,216,77,225,163,209,161,6,166,148,52,162,193,218,223,204,161,14,161,141,25,151,211,68,6,16,33,223,240,95,104,90,98,179,143,200,204,218,228,108,52,155,17,83,49,211,83,175,253,124,209,215,190,246,207,223,249,206,171,239,252,240,63,94,29,238,218,17,33,108,35,108,31,7,233,91,127,21,225,175,125,78,216,144,181,140,221,81,72,153,188,60,249,119,155,76,179,207,211,169,227,76,162,198,104,7,151,72,86,127,48,69,148,113,162,41,224,76,35,235,59,4,235,248,106,107,181,21,49,229,208,238,214,248,244,211,79,111,252,206,143,223,121,231,157,159,253,236,63,223,122,249,27,63,29,27,63,169,21,167,203,42,166,85,97,165,21,159,115,7,174,215,104,192,170,205,130,212,236,70,225,131,209,227,25,73,38,195,179,134,7,130,26,75,193,130,49,249,185,232,89,119,16,5,216,233,100,109,66,172,200,110,26,214,211,79,195,69,95,123,245,135,63,123,7,151,255,120,249,27,255,119,204,63,144,47,18,178,25,33,29,107,133,68,219,232,199,213,249,139,56,235,177,254,2,61,233,173,107,216,165,89,85,66,84,69,143,14,82,177,201,107,245,93,155,113,25,177,132,180,41,70,195,218,34,60,242,45,6,172,147,172,8,82,78,161,54,126,254,203,255,246,195,31,255,132,36,253,214,191,190,252,141,87,61,30,116,159,78,48,16,215,105,33,179,221,196,44,190,0,214,168,219,21,32,89,251,27,181,100,243,232,234,80,11,30,101,205,154,48,162,228,181,58,174,61,8,233,99,175,140,204,82,214,100,118,61,223,140,88,41,189,93,107,252,231,31,254,236,39,239,188,243,238,59,152,9,127,231,95,95,126,249,229,95,142,5,236,66,168,115,10,55,153,108,118,207,184,255,152,214,192,100,237,25,118,6,186,95,242,2,214,168,167,28,34,213,250,86,200,114,148,37,218,76,151,113,151,119,93,123,48,18,92,101,197,164,121,54,178,190,75,149,194,227,77,182,74,178,97,255,243,95,126,245,103,63,121,247,119,31,127,252,241,31,127,12,96,255,24,160,254,233,216,152,51,87,192,130,235,203,145,30,191,63,128,122,125,238,83,65,167,173,61,6,88,247,4,218,91,176,202,153,255,164,14,38,182,245,208,205,163,183,73,7,27,245,141,14,70,71,201,35,215,30,148,116,48,202,228,150,168,127,153,171,49,103,29,108,252,7,172,183,98,201,150,113,45,252,111,239,252,228,173,95,127,252,247,191,131,255,222,125,11,56,235,111,0,212,62,119,169,78,168,32,94,140,92,34,214,199,60,238,215,105,216,80,153,27,69,135,253,118,187,31,43,143,230,232,201,221,122,87,67,2,179,232,87,29,29,49,49,158,49,180,227,179,144,53,163,121,35,222,100,45,52,232,245,16,132,153,239,95,255,241,227,191,127,140,233,245,187,63,6,222,250,213,95,142,249,124,149,58,193,197,143,194,234,30,146,181,239,34,189,203,26,171,144,246,12,251,6,48,119,29,232,212,145,19,174,104,111,125,61,202,204,154,67,177,75,174,61,72,25,89,62,123,89,215,208,91,49,227,181,181,78,91,229,206,242,210,205,157,191,121,231,173,183,254,60,133,145,158,250,227,91,111,253,228,173,159,255,212,227,241,185,109,144,200,162,166,169,203,79,53,25,5,91,88,180,245,55,237,46,148,232,88,43,213,147,185,245,21,182,183,78,136,197,194,35,165,216,131,215,30,172,148,196,128,117,178,240,180,137,121,81,84,81,48,157,214,154,108,39,157,246,246,246,150,206,225,128,231,151,239,190,245,235,201,191,3,19,254,231,255,124,235,221,159,255,151,119,12,132,224,223,92,37,150,89,239,238,36,123,17,81,215,1,218,4,232,218,124,151,60,68,201,172,7,34,75,102,116,110,125,247,145,152,4,102,204,27,180,235,218,181,217,1,59,26,251,34,92,14,151,201,154,218,99,7,72,35,86,171,9,105,115,162,168,7,107,37,252,205,187,191,251,243,159,127,247,243,159,255,215,47,193,95,60,94,159,247,117,209,213,77,67,161,141,108,72,240,13,100,27,232,230,163,33,119,63,190,76,58,54,108,210,145,222,154,94,16,34,7,108,196,38,152,170,155,21,106,77,195,206,152,109,172,201,226,104,165,215,14,80,35,85,21,38,107,63,209,106,230,113,255,210,237,30,118,227,160,189,168,111,232,117,9,197,81,163,213,139,146,253,197,101,84,65,93,95,232,118,15,96,255,234,27,170,212,146,237,40,203,66,86,173,99,228,97,71,30,188,183,102,186,219,217,198,250,42,113,209,250,155,126,127,167,25,65,158,127,182,168,162,173,223,137,239,206,240,224,130,255,193,135,94,60,64,238,222,160,10,45,156,58,174,47,30,26,35,3,241,151,168,82,42,180,115,236,117,204,93,163,190,122,157,49,203,176,128,181,192,69,38,92,125,49,212,167,190,217,192,26,15,208,162,96,45,82,14,151,199,154,88,235,173,68,135,134,253,190,22,243,142,103,139,138,138,14,216,177,238,110,255,24,176,229,40,16,207,152,127,168,247,165,124,210,128,67,122,35,108,128,244,112,110,129,129,43,211,134,204,68,183,153,199,251,10,245,52,104,235,81,59,102,217,253,206,66,240,180,172,198,75,225,119,216,107,153,203,99,117,139,59,98,120,173,40,83,175,132,217,199,26,223,213,166,54,87,125,177,226,136,179,173,8,67,253,236,179,85,136,169,209,222,213,53,236,118,99,58,61,220,127,172,44,27,194,45,178,65,171,53,183,239,6,145,122,249,190,106,235,238,66,46,213,214,86,226,176,61,222,94,170,254,6,217,189,78,160,236,168,23,129,224,44,35,222,122,180,36,196,132,215,197,236,22,39,68,127,173,24,213,97,234,162,122,236,166,133,53,190,110,29,191,227,217,103,139,158,41,218,134,161,6,176,139,170,172,102,147,201,108,179,154,76,187,119,151,22,100,99,109,38,70,3,164,211,230,88,59,81,95,11,57,97,193,102,226,116,217,90,43,214,154,232,65,169,98,138,126,243,240,48,222,80,216,89,168,15,223,173,23,23,227,104,170,36,250,40,47,86,62,0,184,108,249,111,110,22,57,198,106,158,236,66,74,252,14,130,50,41,207,22,33,245,102,171,213,106,222,185,89,15,97,13,69,6,157,214,152,191,195,116,178,223,31,64,253,3,32,134,195,4,169,134,141,220,176,125,62,175,255,77,234,135,218,70,255,16,48,225,62,23,254,104,60,193,222,132,123,61,182,38,28,24,241,232,175,21,171,162,219,96,66,20,172,69,202,225,242,88,227,149,20,245,38,220,120,151,109,35,88,111,220,54,224,233,170,69,172,102,179,185,218,84,94,90,80,80,96,61,217,237,118,163,1,31,138,250,157,36,106,32,197,220,181,113,173,201,55,134,82,205,225,186,74,20,197,186,133,125,45,5,224,213,132,9,63,24,210,197,29,195,132,120,164,110,214,176,6,188,102,25,107,98,237,56,19,163,188,195,90,129,33,127,230,153,23,251,125,168,223,237,114,118,219,187,250,251,7,250,47,13,15,251,2,32,82,67,177,93,93,118,164,154,66,141,236,230,89,7,209,90,3,93,36,106,189,161,31,111,22,246,59,119,234,57,230,40,108,137,249,2,100,212,238,192,17,51,214,35,9,242,223,75,172,151,157,141,45,235,251,196,170,47,48,226,101,166,106,164,236,153,103,182,29,235,114,99,121,19,234,241,129,88,220,7,242,45,31,74,138,223,221,217,104,166,181,218,138,152,120,247,117,153,201,233,55,250,108,59,209,108,238,174,199,23,200,62,29,50,71,97,65,12,11,41,49,146,230,216,245,25,91,228,255,98,34,229,112,153,181,20,98,153,233,153,29,7,90,236,221,206,250,35,175,12,248,253,120,50,236,195,82,46,98,71,151,199,23,240,130,160,124,184,167,209,84,109,101,176,182,242,182,168,232,72,212,107,237,55,136,157,30,246,157,192,125,103,25,23,177,77,248,93,98,5,114,54,161,190,102,177,196,206,198,56,102,25,235,219,228,20,155,174,192,152,223,139,249,100,66,15,93,46,55,16,144,100,251,61,192,154,119,181,32,54,155,173,154,73,26,131,93,174,23,233,59,107,31,35,250,9,251,173,133,224,177,200,250,92,136,9,191,26,117,41,49,246,146,23,59,214,81,132,244,211,195,154,220,141,242,15,175,4,112,29,38,170,217,253,54,4,131,91,107,239,26,234,110,193,6,228,152,173,92,82,44,220,122,166,179,141,227,94,222,131,182,108,214,211,19,174,84,255,77,203,247,98,184,238,17,179,234,102,12,191,142,252,224,33,65,228,172,4,153,172,137,213,135,69,67,158,224,126,107,127,39,105,172,65,146,109,230,198,44,144,116,5,155,12,187,110,160,110,55,48,20,61,230,92,204,132,27,240,53,173,138,9,90,142,204,66,214,177,252,58,242,253,181,72,57,92,46,107,252,184,218,184,87,2,140,33,10,222,54,196,134,167,86,38,76,120,89,239,20,64,109,128,12,186,130,238,238,182,198,198,206,150,122,194,0,144,38,220,29,100,157,249,192,187,72,56,150,79,102,197,218,201,244,176,38,76,248,139,1,134,90,123,189,192,85,187,156,253,253,253,93,64,236,8,55,109,196,148,197,207,26,170,108,44,221,92,110,6,15,74,181,213,180,53,139,176,245,68,3,204,141,89,205,218,49,43,194,135,17,98,116,94,140,89,19,59,98,30,185,52,198,68,141,185,88,144,107,121,124,99,126,191,127,124,160,29,225,176,227,136,185,80,192,91,107,91,198,237,216,115,210,136,181,155,83,29,196,196,186,71,96,86,179,110,158,21,172,197,202,225,81,212,195,85,199,2,94,126,241,249,93,237,225,168,173,197,66,203,217,218,147,227,32,61,247,143,185,27,43,131,29,14,4,107,134,94,19,150,106,118,165,92,115,151,53,97,193,151,13,123,188,66,226,67,27,67,52,27,177,149,11,118,46,104,27,199,137,40,175,107,115,240,117,68,24,254,251,89,205,58,111,206,178,190,23,23,22,152,113,195,30,170,175,102,107,117,185,112,12,174,251,38,145,190,249,187,24,245,22,156,245,202,137,89,205,122,185,42,97,86,88,23,76,78,199,148,53,49,204,96,59,234,241,138,193,118,178,148,186,50,95,164,247,12,170,240,223,184,17,24,243,162,195,155,67,88,31,152,221,172,103,199,247,17,91,250,144,193,154,88,82,84,15,249,189,162,2,82,110,26,53,178,19,22,27,185,96,216,209,102,250,230,43,61,30,223,80,238,67,197,122,112,206,178,38,2,179,196,33,159,56,107,212,219,82,77,146,54,21,139,207,69,74,95,245,248,147,95,249,202,139,189,99,3,91,245,15,19,107,199,236,248,62,37,42,193,163,49,100,176,38,55,236,73,98,237,245,15,16,164,43,11,141,226,115,84,18,87,125,127,255,161,253,251,95,56,228,190,84,1,241,179,94,50,195,61,190,35,14,203,174,140,140,100,106,162,116,137,165,57,116,222,112,221,236,96,45,86,14,143,156,53,121,164,210,82,183,20,214,190,118,130,116,112,184,70,22,15,232,44,221,226,255,245,6,32,13,228,91,110,215,14,1,214,51,154,95,15,114,14,11,86,37,100,88,58,250,88,198,179,143,251,49,113,56,58,44,224,225,112,56,70,30,66,214,68,190,165,81,237,11,72,65,221,111,6,209,119,105,208,81,103,101,174,76,215,113,226,134,146,254,253,237,239,190,128,161,126,97,246,176,118,100,8,31,7,80,98,193,25,102,240,125,31,7,251,241,112,60,92,172,111,147,187,184,82,134,165,184,107,95,155,217,86,89,192,112,212,89,107,206,252,232,127,234,160,112,218,208,170,55,46,31,2,168,15,189,248,228,63,126,127,108,96,83,112,210,48,110,71,218,30,4,235,193,12,105,227,198,240,1,244,14,190,160,141,245,90,203,116,170,183,42,100,34,88,180,172,183,144,106,93,17,64,37,168,181,203,22,18,125,127,182,230,111,127,251,240,240,182,252,48,218,139,191,251,171,183,49,165,254,202,163,42,237,64,192,21,140,195,137,153,102,93,12,214,69,51,52,3,161,35,33,146,9,130,14,129,219,207,164,93,55,221,172,167,98,197,250,30,185,185,103,233,176,164,200,204,94,89,202,218,234,97,212,142,78,125,120,166,233,116,195,118,61,27,182,110,213,251,151,191,15,212,250,133,248,39,170,188,129,241,254,96,205,37,156,245,177,153,89,211,108,142,108,90,164,131,167,200,18,38,37,15,11,107,162,247,72,163,38,139,153,34,38,28,181,26,216,61,40,6,248,131,169,191,158,107,104,106,58,125,208,184,150,249,131,212,127,250,213,251,255,242,194,254,67,207,169,43,236,221,93,61,45,116,209,133,220,222,51,243,172,251,34,156,12,90,199,83,60,13,23,177,6,88,129,12,67,112,236,25,225,48,150,196,140,245,18,66,173,227,157,18,10,41,30,127,91,232,192,74,163,225,250,212,228,47,142,54,1,216,53,207,48,127,246,133,183,47,191,15,130,240,67,107,146,244,58,184,220,84,157,77,179,206,196,89,119,50,88,219,103,100,107,124,50,165,173,14,71,51,118,196,215,114,177,35,186,4,202,27,21,153,153,153,11,36,79,191,105,118,8,84,75,146,75,58,100,151,195,35,99,93,67,122,235,2,175,4,111,141,94,12,219,163,105,132,174,78,77,126,120,250,4,6,187,233,217,224,184,5,232,235,151,47,191,15,162,240,67,107,82,129,242,27,10,138,131,193,220,231,240,113,179,46,6,235,75,51,209,111,102,225,208,214,62,135,195,98,41,201,224,62,147,201,34,224,8,240,166,154,223,59,159,87,73,26,190,87,226,16,249,86,204,131,199,166,143,245,10,242,184,135,122,143,4,181,118,247,238,8,235,34,92,117,126,106,234,47,103,128,17,7,176,15,63,163,15,178,126,255,50,110,195,159,92,154,29,114,174,83,88,171,194,196,239,137,32,103,38,212,154,207,83,140,96,39,53,89,168,2,139,192,43,137,251,159,73,126,115,215,70,41,251,198,19,196,88,99,53,29,75,184,53,23,25,100,23,33,107,106,38,37,220,35,193,132,163,67,111,134,119,7,175,58,55,53,53,121,14,103,221,116,250,232,51,107,25,172,47,99,172,255,113,113,54,187,194,98,36,134,103,220,156,152,217,34,105,71,216,33,107,188,150,211,65,76,127,183,8,181,138,80,223,252,15,75,196,141,120,179,74,2,107,252,36,169,142,8,203,225,17,177,30,165,102,92,73,98,237,58,21,190,221,250,179,255,7,92,6,119,216,64,90,247,234,200,23,232,159,3,172,127,0,226,240,175,39,178,205,190,113,53,110,194,159,96,162,158,137,4,155,154,56,38,169,11,221,33,96,152,137,203,252,137,250,234,7,196,119,152,102,72,100,29,102,205,99,203,154,24,43,172,78,65,250,125,18,76,248,197,151,194,103,144,226,172,71,73,214,77,77,123,141,212,65,230,111,19,172,247,63,202,154,174,98,200,37,188,198,1,22,235,138,168,103,190,73,44,65,73,180,30,14,1,11,64,92,232,18,241,197,209,151,196,199,213,57,132,30,5,11,199,153,143,180,53,143,154,245,71,119,238,92,169,169,169,217,190,26,19,178,102,6,213,14,136,235,181,103,184,183,44,188,233,127,109,209,71,224,154,77,39,72,214,173,219,201,177,11,208,247,47,95,126,3,160,62,244,92,10,195,136,107,141,95,223,22,218,129,4,164,69,198,222,189,145,14,75,137,165,78,114,155,61,29,126,245,69,201,154,72,186,122,48,251,237,172,146,114,209,12,161,116,210,194,153,2,144,214,60,79,197,119,124,176,4,214,247,175,212,172,8,191,178,70,189,19,233,20,143,195,81,215,155,28,211,10,215,174,191,59,53,117,239,181,6,74,177,27,54,18,53,21,237,119,47,191,255,254,183,176,26,233,147,233,180,253,214,29,255,193,254,253,161,221,225,178,2,113,122,82,119,134,68,218,17,13,184,19,98,77,208,57,118,172,98,77,232,169,186,252,215,146,88,58,40,9,177,230,162,229,112,1,214,13,156,15,145,90,157,104,69,36,56,108,207,208,41,142,134,35,125,254,221,96,112,134,201,30,40,152,116,29,194,21,123,49,245,46,237,247,254,250,246,254,253,120,108,246,24,139,245,159,34,13,206,154,131,89,146,196,81,194,17,77,17,236,19,0,216,193,81,64,23,90,142,93,46,157,53,183,146,79,202,97,205,115,122,144,90,157,138,32,86,68,108,245,218,227,189,244,122,182,129,131,53,54,244,132,193,186,105,35,113,126,57,252,6,193,26,40,246,194,28,2,255,247,254,250,151,247,247,239,255,114,104,203,48,144,53,145,5,103,205,146,239,116,56,235,18,201,175,22,42,112,176,44,110,159,24,191,104,88,175,155,146,193,186,134,167,62,164,81,25,106,173,86,115,59,234,247,8,70,102,23,122,185,88,227,73,23,147,245,233,61,90,98,166,202,183,72,214,251,247,63,158,138,185,108,168,248,183,128,53,200,195,30,9,15,206,34,219,229,211,204,117,46,185,84,214,25,81,178,14,91,253,216,53,34,230,13,164,30,116,224,224,194,115,94,6,107,230,89,177,106,252,63,26,246,78,91,173,13,177,54,118,97,103,218,242,26,240,11,189,23,57,143,199,197,89,255,226,104,80,175,79,20,129,36,219,184,201,144,255,54,201,250,208,151,240,188,11,250,31,151,255,242,215,223,254,251,11,251,151,132,39,93,206,72,134,104,132,21,182,165,40,54,93,36,73,136,150,53,171,200,150,176,75,240,195,7,19,34,137,68,200,58,217,158,199,164,29,156,202,203,154,62,36,83,131,157,76,13,157,236,52,239,219,183,207,92,106,204,202,73,157,191,52,93,183,201,132,32,230,70,251,176,223,239,65,57,81,247,246,94,120,157,115,159,117,24,235,211,53,128,172,238,88,149,246,235,148,94,31,42,208,104,179,97,227,23,222,254,237,135,191,122,99,255,161,13,225,197,148,63,68,50,182,144,194,118,204,126,76,37,121,126,82,112,229,58,90,214,193,43,101,236,18,241,58,212,252,217,140,72,30,226,207,128,28,182,233,211,28,231,186,73,101,125,150,68,141,145,78,204,255,166,251,198,248,13,76,2,40,234,115,59,91,234,183,174,209,110,46,219,97,178,214,219,123,92,104,192,23,98,204,81,144,110,1,214,167,56,183,89,227,172,175,48,88,55,53,109,211,195,218,150,182,207,234,223,248,54,193,122,255,139,107,146,160,92,120,213,15,46,227,121,216,215,85,161,5,241,137,137,141,210,51,108,210,130,171,61,2,43,100,35,35,252,190,208,17,37,235,18,172,155,33,207,210,44,126,29,122,212,176,212,12,131,177,134,121,251,220,222,37,123,207,137,157,188,59,143,119,187,22,142,90,93,236,26,187,129,6,143,191,69,81,255,152,215,211,211,98,45,215,21,20,110,174,168,182,181,117,247,3,99,142,50,72,187,93,189,24,235,3,16,47,235,91,39,78,48,20,251,32,96,125,114,0,134,190,68,234,245,254,253,223,126,110,97,26,156,254,79,191,122,31,99,253,34,238,63,142,179,88,159,146,238,215,136,27,168,30,19,90,13,13,7,17,52,252,29,82,111,58,15,76,201,141,40,193,169,210,50,88,75,147,121,188,206,26,160,86,197,181,7,124,104,248,186,52,240,212,151,218,172,149,5,75,31,47,171,52,217,234,187,134,189,30,63,246,28,248,60,30,175,235,2,142,250,77,238,179,0,112,214,247,90,25,172,155,106,12,89,186,125,238,50,72,247,197,32,236,34,245,66,237,23,222,127,255,242,255,6,41,55,190,26,88,197,98,237,146,108,196,201,46,160,110,193,149,239,140,93,252,14,219,34,213,226,71,89,179,29,12,46,154,74,93,214,89,206,62,21,67,22,235,91,180,86,27,157,227,40,79,27,130,15,117,245,119,215,86,108,50,166,105,11,247,213,183,116,58,221,110,247,176,203,217,251,38,33,189,71,184,7,196,19,172,79,51,89,55,109,89,11,85,5,58,33,24,90,79,195,62,244,165,53,73,154,71,87,124,247,123,20,107,118,32,62,241,132,84,207,203,90,104,90,207,253,174,62,142,48,143,14,222,243,102,134,181,131,25,195,197,170,151,80,2,107,66,173,129,86,111,26,31,23,106,28,244,249,221,67,206,54,83,190,54,233,201,92,147,181,214,84,94,156,155,157,155,155,79,8,207,206,173,85,216,68,166,15,26,152,172,79,31,214,67,101,222,129,205,144,81,247,213,32,236,67,95,89,163,86,205,127,113,63,201,122,229,4,135,17,151,176,50,65,56,222,35,248,155,218,121,42,148,37,92,177,121,114,4,6,53,122,214,236,92,121,230,88,215,208,106,221,118,67,180,203,104,12,29,238,105,51,105,151,62,153,14,27,244,6,134,240,108,242,192,89,143,178,98,179,166,19,27,245,5,195,94,147,30,206,218,248,149,253,180,28,250,246,115,171,215,0,214,47,46,8,221,168,25,52,226,142,72,88,183,243,44,93,13,114,90,8,71,4,55,62,90,214,33,167,54,169,34,122,64,90,163,97,189,130,82,235,85,168,148,238,19,128,123,200,222,104,42,76,215,166,137,158,173,7,27,245,87,57,88,175,215,21,12,143,119,193,134,44,67,74,48,64,195,116,27,107,75,122,78,29,158,116,77,76,108,149,104,96,9,100,106,215,196,205,83,124,103,34,237,226,206,213,235,84,92,65,193,96,71,51,15,107,217,13,112,140,35,155,142,204,48,235,143,104,181,174,149,210,238,79,88,115,183,179,211,102,218,12,231,27,69,54,109,173,221,120,47,44,231,106,106,221,184,74,223,25,112,99,123,179,141,208,87,25,176,113,224,68,65,148,93,76,161,202,41,226,117,145,145,176,254,253,176,87,36,240,92,168,36,196,118,12,118,88,176,246,163,188,216,178,30,177,4,61,117,123,100,251,151,196,70,205,138,179,174,161,212,250,179,93,126,175,84,65,253,126,151,189,222,106,174,218,10,195,66,184,215,174,255,8,124,196,249,6,22,235,211,53,90,237,201,128,167,30,75,210,178,214,127,149,205,250,219,107,56,86,176,233,14,15,241,114,117,158,216,194,131,133,55,220,182,208,161,220,136,195,146,151,204,31,152,91,100,179,102,146,94,210,31,97,27,134,120,131,153,24,235,21,148,90,151,213,246,251,188,210,197,23,24,234,105,68,170,205,251,202,115,12,188,251,244,180,223,155,12,89,251,192,87,54,33,192,218,215,78,248,248,204,47,179,212,154,112,215,234,137,80,105,147,184,190,204,46,145,134,47,115,145,117,73,206,60,7,223,13,80,18,196,204,151,112,203,101,237,96,46,75,62,255,7,209,150,27,194,48,145,82,98,41,17,219,91,47,198,186,129,84,107,117,138,213,100,247,123,35,17,212,239,117,181,219,170,17,115,101,49,31,237,85,63,2,31,49,121,54,132,245,137,76,173,25,245,247,23,226,149,182,44,253,122,70,56,254,226,227,156,38,124,98,2,149,26,38,55,11,162,166,87,129,57,139,112,35,37,146,154,254,101,177,238,219,197,124,132,22,116,75,104,175,226,92,140,26,149,207,154,78,184,10,107,77,93,145,177,198,61,247,112,103,35,190,51,83,111,224,101,125,231,196,9,54,235,166,53,233,101,110,31,90,73,86,218,12,153,69,95,197,35,51,144,120,61,174,226,12,205,128,28,151,90,215,10,238,213,201,27,225,87,123,158,252,205,17,214,205,207,103,236,35,233,157,24,105,46,97,217,10,213,75,55,39,100,178,126,236,190,108,214,228,209,183,26,245,66,43,98,238,244,161,94,111,196,184,81,39,54,26,101,119,190,62,124,135,158,241,11,87,195,67,51,44,56,75,207,233,241,121,90,232,179,210,245,153,69,95,122,174,40,115,205,250,212,36,181,70,21,190,128,141,201,205,5,82,79,193,28,177,96,57,205,242,93,125,130,75,19,124,213,245,193,93,172,165,170,228,104,89,15,214,133,112,6,230,219,37,173,149,142,139,245,25,249,53,82,42,50,83,23,216,172,230,22,52,114,214,152,41,239,49,3,213,182,150,134,111,175,215,231,223,99,183,165,16,114,102,125,18,92,234,14,116,21,4,223,96,52,66,41,139,83,117,217,233,36,235,238,48,214,228,254,143,232,102,198,55,11,67,164,148,223,146,33,184,160,29,25,107,21,47,105,177,253,75,92,172,239,203,103,77,70,102,248,249,229,214,70,183,207,43,7,182,175,203,140,109,177,223,183,41,116,59,230,103,177,208,140,220,11,192,12,196,247,46,53,150,186,199,134,118,178,151,75,114,224,44,216,168,33,88,191,20,206,122,98,101,212,167,86,143,36,136,238,220,160,121,55,19,27,125,44,124,141,70,146,109,56,203,43,44,58,206,90,193,147,200,122,121,134,165,206,177,60,82,119,29,194,250,35,74,173,55,219,172,86,107,117,227,208,152,44,216,158,30,98,198,213,142,144,242,153,22,235,114,188,26,138,186,169,233,232,98,125,97,143,63,112,50,188,134,110,76,178,14,123,236,0,0,13,121,73,68,65,84,212,168,57,106,164,204,226,89,130,252,61,205,228,109,95,31,229,233,156,14,161,214,137,65,254,126,146,184,50,231,31,216,191,146,24,107,124,117,116,132,153,18,54,201,102,253,30,217,42,186,16,193,167,200,154,91,134,252,242,52,187,197,140,143,185,218,186,134,181,37,87,127,107,106,234,254,143,194,89,55,60,165,43,176,251,3,93,28,169,249,66,181,154,163,70,74,200,75,81,30,130,77,150,198,214,59,35,91,75,228,73,116,249,62,132,39,70,88,84,214,29,30,112,10,179,30,225,248,212,117,178,89,31,38,76,184,106,149,141,152,84,101,70,156,126,89,62,219,221,98,194,53,123,171,46,109,21,221,241,173,123,30,120,151,15,155,78,132,177,110,221,166,205,183,251,61,174,240,117,208,220,20,210,97,223,152,224,183,226,50,247,108,246,145,22,220,53,241,188,244,142,149,136,89,91,234,120,20,219,57,193,23,131,72,252,125,34,118,216,243,56,14,89,211,168,178,106,233,25,116,78,121,1,154,183,141,152,128,84,170,77,74,53,48,51,174,223,132,171,53,86,37,45,174,117,163,168,73,199,203,186,103,130,223,138,203,131,52,66,134,195,167,38,38,60,17,116,254,71,202,218,17,238,99,136,15,94,207,241,11,69,212,250,158,17,93,126,189,154,100,173,15,178,54,201,201,188,188,94,159,219,86,141,107,118,14,188,144,218,144,167,5,25,215,228,47,142,114,178,206,71,220,104,160,37,108,245,36,119,169,154,112,216,7,184,88,79,156,82,169,164,183,35,113,167,91,91,25,107,96,50,93,191,32,235,193,112,147,220,204,171,216,17,177,142,216,97,207,227,10,195,85,186,32,107,171,109,72,150,25,247,17,199,175,33,166,124,67,234,66,60,192,214,126,235,254,212,228,95,206,156,224,100,13,99,172,187,194,151,66,117,26,33,214,100,251,176,28,216,84,73,204,195,88,55,83,45,151,5,123,80,176,75,70,197,167,216,207,71,201,58,98,135,61,143,51,12,47,181,49,38,137,218,236,178,204,248,152,11,63,135,15,169,52,130,44,57,189,0,54,2,181,158,252,203,79,57,80,3,214,90,93,241,144,207,115,41,108,140,165,136,94,83,109,134,145,195,46,161,215,150,152,149,25,153,176,5,171,93,203,121,21,219,21,29,107,241,193,71,66,172,239,144,97,120,124,53,194,28,16,108,178,123,229,36,218,254,129,90,28,118,57,156,157,54,63,5,134,158,159,156,250,219,47,106,154,184,89,107,211,64,20,232,14,155,57,141,249,107,65,214,55,23,201,242,217,20,234,83,212,117,186,85,81,192,22,100,157,199,161,216,9,60,138,29,136,232,60,170,72,27,83,88,172,239,82,172,77,44,214,32,209,118,249,101,249,108,124,92,188,173,92,15,235,19,231,167,129,40,226,195,51,13,60,172,33,77,103,192,59,126,82,27,41,235,137,49,181,140,1,67,20,234,170,112,215,47,7,182,32,107,11,71,18,69,246,28,161,97,191,77,68,205,10,68,147,195,107,242,88,143,82,233,181,149,205,218,90,45,47,247,66,199,156,8,54,185,16,59,165,37,81,125,101,106,242,167,71,155,248,88,199,119,201,99,29,132,189,124,48,82,212,27,185,92,127,66,95,108,89,55,115,196,124,100,193,174,61,58,214,196,198,192,45,242,88,55,144,21,210,165,72,8,107,0,219,142,202,178,227,67,45,102,236,92,69,16,115,61,254,200,209,15,184,2,51,210,134,235,220,168,199,127,92,6,235,32,236,4,105,229,210,145,12,46,212,65,216,145,167,112,130,181,90,206,109,182,22,174,47,16,41,107,162,233,38,78,30,235,26,146,117,186,13,9,59,171,195,212,54,44,167,96,234,247,56,27,109,187,241,240,58,69,245,248,11,103,120,89,23,15,251,199,208,10,72,6,235,137,177,69,244,170,165,4,213,238,75,230,70,205,128,157,17,97,185,52,89,176,158,206,149,204,17,161,123,92,116,172,201,14,241,235,178,88,111,8,79,175,177,122,8,161,229,166,22,87,196,153,182,199,61,52,60,124,164,140,104,32,206,77,87,199,109,57,209,202,205,58,77,87,223,53,208,19,214,105,44,137,245,196,205,141,210,39,126,210,237,185,27,249,51,184,72,7,135,10,55,156,37,115,252,144,220,229,225,14,253,6,145,157,11,27,161,195,102,177,102,44,104,210,160,173,213,64,172,54,0,28,56,109,79,68,180,81,239,208,197,222,222,222,173,58,154,96,138,250,83,219,27,78,115,176,78,75,44,176,153,65,122,6,203,98,205,160,36,130,201,177,92,0,117,48,64,3,177,112,115,204,88,103,132,42,246,96,29,185,232,18,174,215,145,205,253,137,208,97,51,89,79,178,195,112,92,159,43,11,179,178,179,179,138,203,203,203,77,86,179,169,205,237,11,120,36,226,246,120,188,23,223,236,189,112,225,20,179,64,162,95,168,142,219,115,38,84,183,91,139,146,52,38,4,225,56,106,83,42,107,170,242,69,68,228,124,209,213,96,176,167,168,138,251,50,221,193,249,130,201,210,117,91,152,53,187,69,169,207,18,236,6,223,24,37,235,8,29,54,23,235,68,210,110,87,150,21,230,194,6,35,16,131,94,175,135,179,225,130,194,82,107,203,16,234,151,18,165,225,59,187,46,92,120,101,7,187,62,146,173,93,172,249,204,158,214,208,102,5,108,90,67,101,65,248,50,151,100,214,19,195,43,153,221,35,187,56,34,165,102,198,140,232,83,188,238,96,43,243,161,233,136,128,245,46,193,229,52,66,177,29,172,38,51,142,42,105,132,243,188,136,199,230,3,249,254,90,61,191,28,177,238,43,47,206,129,245,76,149,196,153,67,58,237,166,170,227,23,253,30,81,165,30,190,216,123,161,247,248,14,35,20,230,130,181,139,19,159,58,122,250,12,109,202,207,180,30,141,75,69,108,229,48,199,46,94,233,172,233,214,210,224,126,231,58,7,21,99,141,56,234,242,18,194,58,249,196,45,132,42,33,79,202,240,164,12,193,106,151,131,92,168,236,40,9,153,110,121,100,34,90,214,98,39,217,11,176,110,165,20,27,206,133,33,190,109,58,122,128,251,245,113,84,4,53,78,122,43,4,113,92,36,43,39,43,245,201,53,27,246,30,61,122,186,181,181,245,116,205,134,21,203,210,16,164,148,243,243,104,214,85,226,172,39,60,207,75,155,9,252,252,205,136,46,147,128,61,53,44,226,216,217,14,216,225,14,22,108,80,37,16,225,202,230,8,207,215,224,178,45,146,135,163,15,58,154,45,37,228,144,76,89,122,125,139,10,206,22,231,8,31,164,101,56,137,250,133,204,247,208,197,11,189,167,42,116,188,167,236,229,192,169,11,83,83,159,124,126,219,182,47,110,76,75,213,155,108,54,158,19,208,105,214,47,77,72,17,151,4,218,75,156,226,151,89,207,249,206,229,25,172,17,164,98,59,74,66,42,162,108,121,226,148,139,235,147,69,7,102,247,57,234,44,121,236,241,183,113,81,173,115,105,52,169,89,194,39,105,105,247,13,241,196,104,168,199,235,190,120,225,205,83,21,144,224,121,138,112,110,54,108,92,187,185,180,180,188,178,114,55,136,252,248,78,228,163,26,73,157,19,210,196,117,124,129,48,234,227,127,144,114,25,103,153,42,82,201,8,85,60,76,154,49,221,15,123,62,54,182,163,60,159,203,203,26,155,113,156,193,125,40,197,30,121,172,169,54,82,96,198,117,194,170,173,219,220,19,24,11,91,255,2,177,183,219,117,225,66,239,43,91,69,72,83,49,0,49,181,16,139,252,120,44,136,70,35,208,151,194,29,93,117,151,197,241,241,88,195,123,147,57,30,154,69,145,177,78,166,44,186,240,168,241,56,174,222,35,94,214,35,192,85,236,18,185,162,188,90,10,125,198,3,128,29,151,150,45,108,199,55,183,12,224,19,22,188,140,9,27,195,151,46,130,140,250,149,50,163,36,210,18,158,133,68,138,117,96,34,18,113,30,89,195,97,54,171,156,19,145,93,165,234,9,85,108,101,81,149,83,216,172,80,172,153,238,88,68,100,174,125,208,179,174,0,109,181,38,201,32,72,91,15,151,90,59,187,188,126,31,118,234,245,88,96,220,63,116,225,205,55,95,63,114,228,192,14,24,50,198,6,117,110,154,90,30,107,108,186,225,165,150,3,153,75,168,192,59,243,64,207,205,9,25,114,179,187,106,101,108,48,103,170,50,143,136,63,107,3,17,94,117,201,158,235,114,251,82,130,131,41,49,213,78,76,23,86,58,200,80,86,217,226,116,185,7,6,250,123,218,26,143,188,148,159,155,159,171,211,233,98,69,26,124,194,66,249,172,99,39,191,199,158,26,22,241,5,153,64,138,142,97,50,112,9,136,75,28,202,41,137,79,168,100,200,27,246,182,158,191,122,55,162,19,60,230,241,142,166,196,85,91,151,45,188,117,62,171,184,18,65,42,119,228,27,117,90,173,14,155,167,0,199,80,178,83,49,212,15,156,53,45,110,128,53,48,33,92,91,229,150,50,151,212,207,16,75,36,86,102,30,56,246,255,174,222,147,115,66,125,248,158,220,134,71,40,214,137,73,26,181,58,45,71,100,80,2,92,152,107,132,12,70,120,26,68,143,145,214,240,109,222,155,85,226,10,139,219,151,96,186,159,89,129,235,254,159,34,112,61,60,33,66,102,230,17,96,67,136,11,253,247,212,84,108,88,3,218,164,151,91,156,163,77,157,175,121,52,61,87,228,36,227,105,225,140,31,208,22,84,235,39,38,102,187,252,105,128,178,232,238,232,174,243,60,219,91,20,29,107,9,189,98,12,89,147,109,226,170,244,66,172,230,161,86,167,194,15,70,12,241,65,181,62,48,241,201,17,231,145,76,96,21,42,142,217,121,28,70,108,89,19,109,226,187,173,59,141,192,142,206,79,209,61,16,212,185,12,111,189,114,66,145,105,98,141,151,207,226,170,17,100,119,46,172,134,170,55,231,232,99,27,116,73,147,36,53,173,214,1,5,240,52,177,38,218,196,211,108,216,182,141,82,53,84,143,152,203,139,11,140,144,209,56,163,168,161,160,5,223,161,240,157,46,214,68,155,120,46,214,156,98,43,85,65,181,120,215,66,101,105,46,44,54,210,42,166,38,124,41,157,91,199,253,94,225,59,189,172,55,7,89,147,221,72,166,221,229,249,250,153,98,109,156,175,254,36,6,102,179,130,53,222,147,100,179,150,207,20,235,116,218,130,43,129,217,180,251,235,220,90,0,183,30,102,53,149,34,72,217,12,89,113,108,225,154,176,224,143,41,22,124,218,227,240,149,192,100,151,239,78,103,178,70,144,173,51,101,195,117,241,148,90,59,21,184,211,201,26,95,198,94,100,52,234,245,198,52,252,220,30,10,117,177,126,6,77,184,98,193,103,130,245,85,188,150,178,6,235,77,209,210,243,52,176,137,24,51,134,154,158,167,160,26,86,216,78,43,107,162,101,97,25,222,135,148,152,104,37,96,35,166,130,153,43,168,104,149,24,124,134,88,19,69,210,5,68,154,171,202,49,97,249,53,98,202,157,49,173,134,115,82,213,74,113,116,134,88,19,45,11,233,216,226,117,186,58,49,171,180,210,106,155,73,173,206,73,35,81,171,149,226,232,180,179,38,54,221,39,146,165,74,173,209,88,80,158,63,115,168,179,211,212,228,84,179,118,5,236,180,179,158,194,143,167,85,227,70,251,81,117,106,54,108,152,193,234,40,61,132,244,33,88,181,158,11,172,241,161,118,170,212,92,252,206,39,206,232,162,71,110,154,154,218,60,127,117,82,17,46,137,45,107,114,182,116,26,214,147,146,164,90,154,43,33,114,78,131,179,99,140,250,236,148,34,177,20,190,51,145,137,62,36,53,214,73,106,140,87,139,159,208,3,235,83,22,167,194,185,49,8,203,52,10,234,25,102,77,157,148,187,16,111,16,73,204,146,64,9,74,74,76,53,102,71,31,150,145,109,243,87,20,56,51,196,154,62,1,59,41,27,155,97,148,158,45,41,168,154,31,151,22,157,1,79,167,80,47,251,72,97,51,99,172,105,205,78,201,206,214,170,227,37,101,92,217,240,82,77,98,154,33,138,8,60,142,68,189,90,65,61,147,172,233,83,176,23,19,86,92,146,117,206,49,104,83,151,166,69,29,150,29,156,84,200,204,40,107,106,195,143,58,5,206,78,84,37,234,164,5,94,224,153,208,25,100,26,112,42,44,107,80,184,204,52,107,122,195,79,98,154,62,69,173,153,230,62,241,28,90,171,215,41,88,102,158,53,189,149,79,157,152,150,54,95,149,168,205,153,214,194,168,74,209,234,7,200,58,184,149,79,29,175,77,82,107,82,34,170,160,233,211,177,105,25,210,72,131,8,92,165,104,245,3,101,77,69,227,216,182,205,164,164,120,117,162,54,130,4,218,152,24,159,152,2,193,82,234,105,233,73,100,9,92,85,163,48,121,80,172,169,104,28,167,157,136,109,211,141,160,20,170,93,154,168,210,36,38,165,26,115,4,85,90,191,56,81,41,150,205,6,214,83,215,87,48,104,107,52,234,71,211,33,201,181,208,92,99,74,162,6,120,251,148,116,125,110,46,247,64,36,93,90,74,60,181,132,169,138,83,138,101,15,148,245,212,212,232,18,22,108,128,123,169,100,222,57,176,97,177,70,173,214,196,167,164,164,167,167,107,13,122,125,118,110,46,105,25,178,245,218,212,68,112,65,122,177,67,165,160,126,208,172,167,238,31,140,99,210,198,216,1,222,90,35,156,131,157,131,40,194,26,184,109,53,241,30,32,241,24,244,148,84,61,38,80,74,60,147,179,162,213,179,130,245,212,212,221,117,44,67,78,176,155,191,48,37,29,4,230,185,164,132,218,111,240,15,70,109,202,194,249,26,182,0,188,244,37,212,242,134,55,41,50,157,172,65,170,189,130,65,69,77,170,55,176,205,137,73,41,164,96,6,90,15,225,232,179,245,134,244,148,148,164,133,137,26,26,108,16,52,253,102,246,148,136,117,183,20,26,179,132,53,213,171,194,198,77,209,195,9,226,115,16,30,93,138,113,143,39,127,192,66,204,122,123,200,60,144,189,138,82,207,38,214,83,247,246,132,0,10,81,218,112,205,85,135,105,47,151,172,168,25,85,214,58,102,25,235,169,169,171,27,56,80,169,213,194,42,44,50,168,235,160,178,124,57,43,89,3,218,7,151,196,110,100,163,122,203,123,119,20,4,179,150,53,144,59,87,222,219,43,151,238,178,195,173,103,15,47,83,92,244,195,194,26,147,201,209,154,21,145,32,94,189,238,112,205,217,91,119,200,153,138,119,239,140,54,40,46,250,97,97,141,201,71,163,13,219,151,8,2,198,8,215,188,119,231,206,93,229,62,63,228,172,9,131,126,231,189,154,154,154,13,171,87,147,189,136,139,86,175,222,94,83,211,48,170,0,158,123,172,153,118,61,138,45,9,138,60,92,172,21,81,88,43,162,176,86,68,97,173,136,194,90,17,133,181,34,10,107,69,20,214,10,107,69,20,214,138,40,172,21,81,88,43,162,176,86,68,97,173,136,194,90,17,133,181,34,10,107,69,20,214,138,40,172,21,214,138,40,172,21,153,3,242,255,1,37,92,112,194,126,113,197,147,0,0,0,0,73,69,78,68,174,66,96,130};
Index: /OgreMain/src/gtk/OgreConfigDialog.cpp
===================================================================
--- /OgreMain/src/gtk/OgreConfigDialog.cpp	(revision 5)
+++ /OgreMain/src/gtk/OgreConfigDialog.cpp	(revision 5)
@@ -0,0 +1,298 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreConfigDialog.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+
+#include <gtk/gtk.h>
+
+namespace Ogre {
+
+/**
+Backdrop image. This is an arbitrary PNG file encoded into a C array.
+
+You can easily generate your own backdrop with the following python script:
+
+#!/usr/bin/python
+import sys
+pngstring=open(sys.argv[2], "rb").read()
+print "static uint8 %s[%i]={%s};" % (sys.argv[1],len(pngstring), ",".join([str(ord(x)) for x in pngstring]))
+
+Call this with
+$ bintoheader.py GLX_backdrop_data GLX_backdrop.png > GLX_backdrop.h
+*/
+#include "GLX_backdrop.h"
+
+/*
+ * A GTK+2 dialog window, making it possible to configure OGRE
+ * in a graphical way. It uses plain C gtk+ bindings since gtk-- is not
+ * part of most standard distributions while gtk+ itself is present
+ * in every Linux distribution I ever seen.
+ */
+
+bool _OgrePrivate __gtk_init_once ()
+{
+    static bool gtk_already_initialized = false;
+    if (gtk_already_initialized)
+        return true;
+
+    gtk_already_initialized = true;
+
+    // Initialize gtk+
+    int argc = 0;
+    char **argv = NULL;
+    // Avoid gtk calling setlocale() otherwise
+    // scanf("%f") won't work on some locales etc.
+    // Leave this on application developer's responsability.
+    gtk_disable_setlocale ();
+    return gtk_init_check (&argc, &argv);
+}
+
+ConfigDialog::ConfigDialog ()
+{
+}
+
+void ConfigDialog::rendererChanged (GtkComboBox *widget, gpointer data)
+{
+    ConfigDialog *This = static_cast<ConfigDialog *> (data);
+
+    gchar *renderer = gtk_combo_box_get_active_text (widget);
+
+    RenderSystemList *renderers = Root::getSingleton ().getAvailableRenderers ();
+    for (RenderSystemList::iterator r = renderers->begin(); r != renderers->end (); r++)
+        if (strcmp (renderer, (*r)->getName ().c_str ()) == 0)
+        {
+            This->mSelectedRenderSystem = *r;
+            This->setupRendererParams ();
+        }
+}
+
+void ConfigDialog::optionChanged (GtkComboBox *widget, gpointer data)
+{
+    ConfigDialog *This = static_cast<ConfigDialog *> (data);
+    GtkWidget *ro_label = static_cast<GtkWidget *> (
+        g_object_get_data (G_OBJECT (widget), "renderer-option"));
+
+    This->mSelectedRenderSystem->setConfigOption (
+        gtk_label_get_text (GTK_LABEL (ro_label)),
+        gtk_combo_box_get_active_text (widget));
+}
+
+static void remove_all_callback (GtkWidget *widget, gpointer data)
+{
+    GtkWidget *container = static_cast<GtkWidget *> (data);
+    gtk_container_remove (GTK_CONTAINER (container), widget);
+}
+
+void ConfigDialog::setupRendererParams ()
+{
+    // Remove all existing child widgets
+    gtk_container_forall (GTK_CONTAINER (mParamTable),
+                          remove_all_callback, mParamTable);
+
+    ConfigOptionMap options = mSelectedRenderSystem->getConfigOptions ();
+
+    // Resize the table to hold as many options as we have
+    gtk_table_resize (GTK_TABLE (mParamTable), options.size (), 2);
+
+    uint row = 0;
+    for (ConfigOptionMap::iterator i = options.begin (); i != options.end (); i++, row++)
+    {
+        GtkWidget *ro_label = gtk_label_new (i->second.name.c_str ());
+        gtk_widget_show (ro_label);
+        gtk_table_attach (GTK_TABLE (mParamTable), ro_label, 0, 1, row, row + 1,
+                          GtkAttachOptions (GTK_EXPAND | GTK_FILL),
+                          GtkAttachOptions (0), 5, 0);
+        gtk_label_set_justify (GTK_LABEL (ro_label), GTK_JUSTIFY_RIGHT);
+        gtk_misc_set_alignment (GTK_MISC (ro_label), 1, 0.5);
+
+        GtkWidget *ro_cb = gtk_combo_box_new_text ();
+        gtk_widget_show (ro_cb);
+        gtk_table_attach (GTK_TABLE (mParamTable), ro_cb, 1, 2, row, row + 1,
+                          GtkAttachOptions (GTK_EXPAND | GTK_FILL),
+                          GtkAttachOptions (0), 5, 0);
+
+        // Set up a link from the combobox to the label
+        g_object_set_data (G_OBJECT (ro_cb), "renderer-option", ro_label);
+
+        StringVector::iterator opt_it;
+        uint idx = 0;
+        for (opt_it = i->second.possibleValues.begin ();
+             opt_it != i->second.possibleValues.end (); opt_it++, idx++)
+        {
+            gtk_combo_box_append_text (GTK_COMBO_BOX (ro_cb),
+                                       (*opt_it).c_str ());
+            if (strcmp (i->second.currentValue.c_str (), (*opt_it).c_str ()) == 0)
+                gtk_combo_box_set_active (GTK_COMBO_BOX (ro_cb), idx);
+        }
+
+        g_signal_connect (G_OBJECT (ro_cb), "changed",
+                          G_CALLBACK (optionChanged), this);
+    }
+}
+
+static void backdrop_destructor (guchar *pixels, gpointer data)
+{
+    free (pixels);
+}
+
+bool ConfigDialog::createWindow ()
+{
+    // Create the dialog window
+    mDialog = gtk_dialog_new_with_buttons (
+        "OGRE Engine Setup", NULL, GTK_DIALOG_MODAL,
+        GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+        GTK_STOCK_OK, GTK_RESPONSE_OK,
+        NULL);
+    gtk_window_set_position (GTK_WINDOW (mDialog), GTK_WIN_POS_CENTER);
+    gtk_window_set_resizable (GTK_WINDOW (mDialog), FALSE);
+    gtk_widget_show (GTK_DIALOG (mDialog)->vbox);
+
+    GtkWidget *vbox = gtk_vbox_new (FALSE, 5);
+    gtk_widget_show (vbox);
+    gtk_box_pack_start (GTK_BOX (GTK_DIALOG (mDialog)->vbox), vbox, TRUE, TRUE, 0);
+
+    // Unpack the image and create a GtkImage object from it
+    try
+    {
+        static String imgType ("png");
+        Image img;
+        MemoryDataStream *imgStream;
+        DataStreamPtr imgStreamPtr;
+
+        imgStream = new MemoryDataStream (GLX_backdrop_data, sizeof (GLX_backdrop_data), false);
+        imgStreamPtr = DataStreamPtr (imgStream);
+        img.load (imgStreamPtr, imgType);
+
+        PixelBox src = img.getPixelBox (0, 0);
+
+        size_t width = img.getWidth ();
+        size_t height = img.getHeight ();
+
+        // Convert and copy image -- must be allocated with malloc
+        uint8 *data = (uint8 *)malloc (width * height * 4);
+        // Keep in mind that PixelBox does not free the data - this is ok
+        // as gtk takes pixel data ownership in gdk_pixbuf_new_from_data
+        PixelBox dst (src, PF_A8B8G8R8, data);
+
+        PixelUtil::bulkPixelConversion (src, dst);
+
+        GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data (
+            (const guchar *)dst.data, GDK_COLORSPACE_RGB,
+            true, 8, width, height, width * 4,
+            backdrop_destructor, NULL);
+        GtkWidget *ogre_logo = gtk_image_new_from_pixbuf (pixbuf);
+
+        gdk_pixbuf_unref (pixbuf);
+
+        gtk_widget_show (ogre_logo);
+        gtk_box_pack_start (GTK_BOX (vbox), ogre_logo, FALSE, FALSE, 0);
+    }
+    catch (Exception &e)
+    {
+        // Could not decode image; never mind
+        LogManager::getSingleton().logMessage("WARNING: Failed to decode Ogre logo image");
+    }
+
+    GtkWidget *rs_hbox = gtk_hbox_new (FALSE, 0);
+    gtk_box_pack_start (GTK_BOX (vbox), rs_hbox, FALSE, TRUE, 0);
+
+    GtkWidget *rs_label = gtk_label_new ("Rendering subsystem:");
+    gtk_widget_show (rs_label);
+    gtk_box_pack_start (GTK_BOX (rs_hbox), rs_label, TRUE, TRUE, 5);
+    gtk_label_set_justify (GTK_LABEL (rs_label), GTK_JUSTIFY_RIGHT);
+    gtk_misc_set_alignment (GTK_MISC (rs_label), 1, 0.5);
+
+    GtkWidget *rs_cb = gtk_combo_box_new_text ();
+    gtk_widget_show (rs_cb);
+    gtk_box_pack_start (GTK_BOX (rs_hbox), rs_cb, TRUE, TRUE, 5);
+
+    g_signal_connect (G_OBJECT (rs_cb), "changed", G_CALLBACK (rendererChanged), this);
+
+    // Add all available renderers to the combo box
+    RenderSystemList *renderers = Root::getSingleton ().getAvailableRenderers ();
+    uint idx = 0, sel_renderer_idx = 0;
+    for (RenderSystemList::iterator r = renderers->begin(); r != renderers->end (); r++, idx++)
+    {
+        gtk_combo_box_append_text (GTK_COMBO_BOX (rs_cb), (*r)->getName ().c_str ());
+        if (mSelectedRenderSystem == *r)
+            sel_renderer_idx = idx;
+    }
+    // Don't show the renderer choice combobox if there's just one renderer
+    if (idx > 1)
+        gtk_widget_show (rs_hbox);
+ 
+    GtkWidget *ro_frame = gtk_frame_new (NULL);
+    gtk_widget_show (ro_frame);
+    gtk_box_pack_start (GTK_BOX (vbox), ro_frame, TRUE, TRUE, 0);
+
+    GtkWidget *ro_label = gtk_label_new ("Renderer options:");
+    gtk_widget_show (ro_label);
+    gtk_frame_set_label_widget (GTK_FRAME (ro_frame), ro_label);
+    gtk_label_set_use_markup (GTK_LABEL (ro_label), TRUE);
+
+    mParamTable = gtk_table_new (0, 0, FALSE);
+    gtk_widget_show (mParamTable);
+    gtk_container_add (GTK_CONTAINER (ro_frame), mParamTable);
+
+    gtk_combo_box_set_active (GTK_COMBO_BOX (rs_cb), sel_renderer_idx);
+
+    return true;
+}
+
+bool ConfigDialog::display ()
+{
+    if (!__gtk_init_once ())
+        return false;
+
+    /* Select previously selected rendersystem */
+    mSelectedRenderSystem = Root::getSingleton ().getRenderSystem ();
+
+    /* Attempt to create the window */
+    if (!createWindow ())
+        OGRE_EXCEPT (Exception::ERR_INTERNAL_ERROR, "Could not create configuration dialog",
+                     "ConfigDialog::display");
+
+    // Modal loop
+    gint result = gtk_dialog_run (GTK_DIALOG (mDialog));
+    gtk_widget_destroy (mDialog);
+
+    // Wait for all gtk events to be consumed ...
+    while (gtk_events_pending ())
+        gtk_main_iteration_do (FALSE);
+
+    if (result != GTK_RESPONSE_OK)
+        return false;
+
+    Root::getSingleton ().setRenderSystem (mSelectedRenderSystem);
+
+    return true;
+}
+
+}
Index: /OgreMain/src/gtk/OgreErrorDialog.cpp
===================================================================
--- /OgreMain/src/gtk/OgreErrorDialog.cpp	(revision 5)
+++ /OgreMain/src/gtk/OgreErrorDialog.cpp	(revision 5)
@@ -0,0 +1,64 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+ 
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+ 
+This program 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 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 Lesser General Public License for more details.
+ 
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreErrorDialog.h"
+
+#include <iostream>
+#include <gtk/gtk.h>
+
+namespace Ogre {
+
+extern bool __gtk_init_once ();
+
+//---------------------------------------------------------------------------//
+ErrorDialog::ErrorDialog ()
+{
+}
+
+//---------------------------------------------------------------------------//
+void ErrorDialog::display (const String& errorMessage, String logName)
+{
+    if (!__gtk_init_once ())
+    {
+        std::cerr << "*** ERROR: " << errorMessage << std::endl;
+        return;
+    }
+
+    GtkWidget *dialog = gtk_message_dialog_new (
+        NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+        errorMessage.c_str ());
+
+    gtk_dialog_run (GTK_DIALOG (dialog));
+    gtk_widget_destroy (dialog);
+
+    // Wait for all gtk events to be consumed ...
+    while (gtk_events_pending ())
+        gtk_main_iteration_do (FALSE);
+}
+
+}
Index: /OgreMain/src/ogremain.map
===================================================================
--- /OgreMain/src/ogremain.map	(revision 5)
+++ /OgreMain/src/ogremain.map	(revision 5)
@@ -0,0 +1,186 @@
+{
+    global:
+        extern "C++" {
+            Ogre::Ani*;
+            Ogre::A[rux]*;
+            Ogre::Billboard[^P]*;
+            Ogre::BillboardParticleRenderer::[^C]*;
+            Ogre::BillboardParticleRendererFactory*;
+            Ogre::Border[^P]*;
+            Ogre::BorderPanelOverlayElement::[^C]*;
+            Ogre::BorderPanelOverlayElementFactory::*;
+            Ogre::Bon*;
+            Ogre::Ca*;
+            Ogre::Codec::[^C]*;
+            Ogre::Co[lp]*;
+			Ogre::Composit*;
+            Ogre::Conf*;
+            Ogre::ControllerManager::*;
+            Ogre::Cu*;
+            Ogre::D[ay]*;
+            Ogre::Def*;
+            Ogre::E[^x]*;
+            Ogre::Exception::*;
+            Ogre::ExternalTextureSource::[^C]*;
+            Ogre::ExternalTextureSourceManager::*;
+            Ogre::FileSt*;
+            Ogre::FileH*;
+            Ogre::FileSystemArchive::*;
+            Ogre::Fo*;
+            Ogre::Fr*;
+            Ogre::Fl*;
+            Ogre::G*;
+            Ogre::GpuProgramParameters::[^C]*;
+            Ogre::GpuProgram::*;
+            Ogre::GpuProgramPtr::*;
+            Ogre::GpuProgramManager::*;
+            Ogre::GpuProgramUsage::*;
+            Ogre::Hardware[IOPV]*;
+            Ogre::HardwareBuffer::*;
+            Ogre::HardwareBufferLicensee::*;
+            Ogre::HardwareBufferManager::[^V]*;
+            Ogre::Hi*;
+            Ogre::Image::*;
+            Ogre::ImageCodec::[^I]*;
+            Ogre::ImageCodec::Image[^D]*;
+            Ogre::ILImage*;
+            Ogre::In*;
+            Ogre::K*;
+            Ogre::L*;
+            Ogre::Man*;
+            Ogre::Mat*;
+            Ogre::Mem*;
+            Ogre::Mesh::*;
+            Ogre::MeshPtr::*;
+            Ogre::MeshManager::*;
+            Ogre::MeshSerializer::*;
+            Ogre::Mou*;
+            Ogre::Mov*;
+            Ogre::MultiRenderTarget::*;
+            Ogre::N*;
+            Ogre::O*;
+            Ogre::PanelOverlayElementFactory*;
+            Ogre::PanelOverlayElement::[^C]*;
+            Ogre::Para*;
+            Ogre::Particle::*;
+            Ogre::Particle[AEVI]*;
+            Ogre::ParticleSystem::[^C]*;
+            Ogre::ParticleSystem[MR]*;
+            Ogre::Pa[st]*;
+            Ogre::P[lioy]*;
+            Ogre::Prof*;
+            Ogre::ProgressiveMesh::[^P]*;
+            Ogre::ProgressiveMesh::P[a-z]*;
+            Ogre::Q*;
+            Ogre::Ray*;
+            Ogre::Rec*;
+            Ogre::Reg*;
+            Ogre::Rendera*;
+            Ogre::RenderQueue::*;
+            Ogre::RenderQueueListener::*;
+            Ogre::RenderTarget::*;
+            Ogre::RenderS*;
+            Ogre::RenderTargetListener::*;
+            Ogre::RenderTe*;
+            Ogre::RenderW*;
+            Ogre::Res*;
+            Ogre::Ro*;
+            Ogre::Sc*;
+            Ogre::Se*;
+            Ogre::Shad*;
+            Ogre::Si*;
+            Ogre::Sk*;
+            Ogre::Sp*;
+            Ogre::StaticGeometry::[^O]*;
+            Ogre::Str*;
+            Ogre::Su*;
+            Ogre::Ta*;
+            Ogre::Te[cm]*;
+            Ogre::TexC*; 
+            Ogre::TextAreaOverlayElement::[^C]*;
+            Ogre::TextAreaOverlayElementFactory*;
+            Ogre::Texture*;
+            Ogre::T[ir]*;
+            Ogre::U*;
+            Ogre::Vector[234]*;
+            Ogre::Ver*;
+            Ogre::Vi*;
+            Ogre::W*;
+            Ogre::ZipArchive::*;
+            Ogre::[fo]*
+        };
+
+        _ZNS*;
+        _ZN9__gnu_cxx*;
+        _ZZN9__gnu_cxx*;
+
+        # export vtables & typeinfo
+        _ZT[ISV]N4Ogre[0-9][AB]*;
+        _ZT[ISV]N4Ogre5CodecE;
+        _ZT[ISV]N4Ogre6C*;
+        _ZT[ISV]N4Ogre[0-9][E-R]*;
+        _ZT[ISV]N4Ogre8SkeletonE;
+        _ZT[ISV]N4Ogre9SceneNodeE;
+        _ZT[ISV]N4Ogre9SubEntityE;
+        _ZT[ISV]N4Ogre5TimerE;
+        _ZT[ISV]N4Ogre7TextureE;
+        _ZT[ISV]N4Ogre[0-9][0-9][ADGHOR]*;
+        _ZT[ISV]N4Ogre12BillboardSetE;
+        _ZT[ISV]N4Ogre25BillboardParticleRendererE;
+        _ZT[ISV]N4Ogre32BillboardParticleRendererFactoryE;
+        _ZT[ISV]N4Ogre25BorderPanelOverlayElementE;
+        _ZT[ISV]N4Ogre32BorderPanelOverlayElementFactoryE;
+        _ZT[ISV]N4Ogre16BorderRenderableE;
+        _ZT[ISV]N4Ogre10ConfigFileE;
+        _ZT[ISV]N4Ogre12ConfigDialogE;
+        _ZT[ISV]N4Ogre1[0-9]E*;
+        _ZT[ISV]N4Ogre21ExternalTextureSourceE;
+        _ZT[ISV]N4Ogre11FontManagerE;
+        _ZT[ISV]N4Ogre13FrameListenerE;
+        _ZT[ISV]N4Ogre17FileSystemArchiveE;
+        _ZT[ISV]N4Ogre20FileHandleDataStreamE;
+        _ZT[ISV]N4Ogre20FileStreamDataStreamE;
+        _ZT[ISV]N4Ogre24FrameTimeControllerValueE;
+        _ZT[ISV]N4Ogre32FloatGpuParameterControllerValueE;
+        _ZT[ISV]N4Ogre10ImageCodecE;
+        _ZT[ISV]N4Ogre11InputReaderE;
+        _ZT[ISV]N4Ogre22IntersectionSceneQueryE;
+        _ZT[ISV]N4Ogre30IntersectionSceneQueryListenerE;
+        _ZT[ISV]N4Ogre11LogListenerE;
+        _ZT[ISV]N4Ogre[0-9][0-9]M[ao]*;
+        _ZT[ISV]N4Ogre[0-9][0-9]MeshM*;
+        _ZT[ISV]N4Ogre12ParamCommandE;
+        _ZT[ISV]N4Ogre12PatchMeshPtrE;
+        _ZT[ISV]N4Ogre14ParticleSystemE;
+        _ZT[ISV]N4Ogre14PositionTargetE;
+        _ZT[ISV]N4Ogre15ParticleEmitterE;
+        _ZT[ISV]N4Ogre15ProgressiveMeshE;
+        _ZT[ISV]N4Ogre16ParticleAffectorE;
+        _ZT[ISV]N4Ogre19PanelOverlayElementE;
+        _ZT[ISV]N4Ogre21ParticleSystemManagerE;
+        _ZT[ISV]N4Ogre22ParticleEmitterFactoryE;
+        _ZT[ISV]N4Ogre22ParticleSystemRendererE;
+        _ZT[ISV]N4Ogre23ParticleAffectorFactoryE;
+        _ZT[ISV]N4Ogre26PanelOverlayElementFactoryE;
+        _ZT[ISV]N4Ogre29ParticleSystemRendererFactoryE;
+        _ZT[ISV]N4Ogre32PlaneBoundedVolumeListSceneQueryE;
+        _ZT[ISV]N4Ogre[0-9][0-9]S[cehikp]*;
+        _ZT[ISV]N4Ogre14StaticGeometryE;
+        _ZT[ISV]N4Ogre15StringInterfaceE;
+        _ZT[ISV]N4Ogre[0-9][0-9]Texture*;
+        _ZT[ISV]N4Ogre21TempBlendedBufferInfoE;
+        _ZT[ISV]N4Ogre22TextAreaOverlayElementE;
+        _ZT[ISV]N4Ogre29TextAreaOverlayElementFactoryE;
+        _ZT[ISV]N4Ogre31TexCoordModifierControllerValueE;
+        _ZT[ISV]N4Ogre[0-9][0-9][U-W]*;
+        _ZT[ISV]N4Ogre10ZipArchiveE;
+        _ZT[ISV]N4Ogre17MultiRenderTargetE;
+        _ZT[ISV]N4Ogre[0-9]Composit*E;
+        _ZT[ISV]N4Ogre[1-9][0-9]Composit*E;
+		_ZT[ISV]N4Ogre8TagPointE;
+        _ZT[ISV]N4Ogre16MemoryDataStreamE;
+
+        # export thunks
+        _ZThn*;
+    local: *;
+};
Index: /OgreStatic.sln
===================================================================
--- /OgreStatic.sln	(revision 5)
+++ /OgreStatic.sln	(revision 5)
@@ -0,0 +1,80 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OgreMain", "OgreMain\scripts\OgreMain.vcproj", "{35AFBABB-DF05-43DE-91A7-BB828A874015}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_BSPSceneManager", "PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.vcproj", "{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_CgProgramManager", "PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager.vcproj", "{1C741C2F-3278-43D8-9FD2-E631A64B70AE}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_OctreeSceneManager", "PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager.vcproj", "{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_ParticleFX", "PlugIns\ParticleFX\scripts\Plugin_ParticleFX.vcproj", "{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RenderSystem_Direct3D9", "RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9.vcproj", "{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RenderSystem_GL", "RenderSystems\GL\scripts\RenderSystem_GL.vcproj", "{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OgreGUIRenderer", "Samples\Common\CEGUIRenderer\scripts\OgreGUIRenderer.vcproj", "{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		DebugStaticLib = DebugStaticLib
+		ReleaseStaticLib = ReleaseStaticLib
+	EndGlobalSection
+	GlobalSection(ProjectDependencies) = postSolution
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.DebugStaticLib.ActiveCfg = DebugStaticLib|Win32
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.DebugStaticLib.Build.0 = DebugStaticLib|Win32
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.ReleaseStaticLib.ActiveCfg = ReleaseStaticLib|Win32
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.ReleaseStaticLib.Build.0 = ReleaseStaticLib|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DebugStaticLib.ActiveCfg = DebugStaticLib|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DebugStaticLib.Build.0 = DebugStaticLib|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.ReleaseStaticLib.ActiveCfg = ReleaseStaticLib|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.ReleaseStaticLib.Build.0 = ReleaseStaticLib|Win32
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE}.DebugStaticLib.ActiveCfg = DebugStaticLib|Win32
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE}.DebugStaticLib.Build.0 = DebugStaticLib|Win32
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE}.ReleaseStaticLib.ActiveCfg = ReleaseStaticLib|Win32
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE}.ReleaseStaticLib.Build.0 = ReleaseStaticLib|Win32
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}.DebugStaticLib.ActiveCfg = DebugStaticLib|Win32
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}.DebugStaticLib.Build.0 = DebugStaticLib|Win32
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}.ReleaseStaticLib.ActiveCfg = ReleaseStaticLib|Win32
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}.ReleaseStaticLib.Build.0 = ReleaseStaticLib|Win32
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}.DebugStaticLib.ActiveCfg = DebugStaticLib|Win32
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}.DebugStaticLib.Build.0 = DebugStaticLib|Win32
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}.ReleaseStaticLib.ActiveCfg = ReleaseStaticLib|Win32
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}.ReleaseStaticLib.Build.0 = ReleaseStaticLib|Win32
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}.DebugStaticLib.ActiveCfg = DebugStaticLib|Win32
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}.DebugStaticLib.Build.0 = DebugStaticLib|Win32
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}.ReleaseStaticLib.ActiveCfg = ReleaseStaticLib|Win32
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}.ReleaseStaticLib.Build.0 = ReleaseStaticLib|Win32
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}.DebugStaticLib.ActiveCfg = DebugStaticLib|Win32
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}.DebugStaticLib.Build.0 = DebugStaticLib|Win32
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}.ReleaseStaticLib.ActiveCfg = ReleaseStaticLib|Win32
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}.ReleaseStaticLib.Build.0 = ReleaseStaticLib|Win32
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}.DebugStaticLib.ActiveCfg = DebugStaticLib|Win32
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}.DebugStaticLib.Build.0 = DebugStaticLib|Win32
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}.ReleaseStaticLib.ActiveCfg = ReleaseStaticLib|Win32
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}.ReleaseStaticLib.Build.0 = ReleaseStaticLib|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		DPBuild = 5
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
Index: /Ogre_linux.workspace
===================================================================
--- /Ogre_linux.workspace	(revision 5)
+++ /Ogre_linux.workspace	(revision 5)
@@ -0,0 +1,279 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_workspace_file>
+	<Workspace title="Ogre  workspace">
+		<Project filename="OgreMain/scripts/OgreMain_linux.cbp" active="1" />
+		<Project filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+		</Project>
+		<Project filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+		</Project>
+		<Project filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+		</Project>
+		<Project filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+		</Project>
+		<Project filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+		</Project>
+		<Project filename="Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+		</Project>
+		<Project filename="Samples/BezierPatch/scripts/Demo_BezierPatch_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/BSP/scripts/Demo_BSP_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/CameraTrack/scripts/Demo_CameraTrack_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/CelShading/scripts/Demo_CelShading_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/Compositor/scripts/Demo_Compositor_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+			<Depends filename="Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer_linux.cbp" />
+		</Project>
+		<Project filename="Samples/Instancing/scripts/Demo_Crowd_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+			<Depends filename="Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer_linux.cbp" />
+		</Project>
+		<Project filename="Samples/CubeMapping/scripts/Demo_CubeMapping_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/DeferredShading/scripts/Demo_DeferredShading_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/Dot3Bump/scripts/Demo_Dot3Bump_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/DynTex/scripts/Demo_DynTex_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/EnvMapping/scripts/Demo_EnvMapping_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/Fresnel/scripts/Demo_Fresnel_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/FacialAnimation/scripts/Demo_FacialAnimation_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+			<Depends filename="Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer_linux.cbp" />
+		</Project>
+		<Project filename="Samples/Grass/scripts/Demo_Grass_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/Gui/scripts/Demo_Gui_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+			<Depends filename="Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer_linux.cbp" />
+		</Project>
+		<Project filename="Samples/Instancing/scripts/Demo_Instancing_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+			<Depends filename="Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer_linux.cbp" />
+		</Project>
+		<Project filename="Samples/Lighting/scripts/Demo_Lighting_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/OceanDemo/script/Demo_Ocean_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+			<Depends filename="Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer_linux.cbp" />
+		</Project>
+		<Project filename="Samples/ParticleFX/scripts/Demo_ParticleFX_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/RenderToTexture/scripts/Demo_RenderToTexture_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/Shadows/scripts/Demo_Shadows_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+			<Depends filename="Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer_linux.cbp" />
+		</Project>
+		<Project filename="Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/SkyBox/scripts/Demo_SkyBox_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/SkyDome/scripts/Demo_SkyDome_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/SkyPlane/scripts/Demo_SkyPlane_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/Smoke/scripts/Demo_Smoke_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/Terrain/scripts/Demo_Terrain_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/TextureFX/scripts/Demo_TextureFX_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/Transpacency/scripts/Demo_Transparency_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/VolumeTex/scripts/Demo_VolumeTex_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+		<Project filename="Samples/Water/scripts/Demo_Water_linux.cbp">
+			<Depends filename="OgreMain/scripts/OgreMain_linux.cbp" />
+			<Depends filename="PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp" />
+			<Depends filename="PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp" />
+			<Depends filename="PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp" />
+			<Depends filename="RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp" />
+		</Project>
+	</Workspace>
+</CodeBlocks_workspace_file>
Index: /Ogre_stlp.workspace
===================================================================
--- /Ogre_stlp.workspace	(revision 5)
+++ /Ogre_stlp.workspace	(revision 5)
@@ -0,0 +1,311 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_workspace_file>
+	<Workspace title="Ogre  workspace">
+		<Project filename="OgreMain\scripts\OgreMain_stlp.cbp" active="1" />
+		<Project filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+		</Project>
+		<Project filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+		</Project>
+		<Project filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+		</Project>
+		<Project filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+		</Project>
+		<Project filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+		</Project>
+		<Project filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\Common\CEGUIRenderer\scripts\OgreGUIRenderer_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+		</Project>
+		<Project filename="ReferenceApplication\ReferenceAppLayer\scripts\ReferenceAppLayer_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\BezierPatch\scripts\Demo_BezierPatch_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\BSP\scripts\Demo_BSP_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="ReferenceApplication\BspCollision\scripts\BspCollision_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+			<Depends filename="ReferenceApplication\ReferenceAppLayer\scripts\ReferenceAppLayer_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\CameraTrack\scripts\Demo_CameraTrack_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\CelShading\scripts\Demo_CelShading_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\Compositor\scripts\Demo_Compositor_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+			<Depends filename="Samples\Common\CEGUIRenderer\scripts\OgreGUIRenderer_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\CubeMapping\scripts\Demo_CubeMapping_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\DeferredShading\scripts\Demo_DeferredShading_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\Dot3Bump\scripts\Demo_Dot3Bump_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\DynTex\scripts\Demo_DynTex_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\EnvMapping\scripts\Demo_EnvMapping_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\FacialAnimation\scripts\Demo_FacialAnimation_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+			<Depends filename="Samples\Common\CEGUIRenderer\scripts\OgreGUIRenderer_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\Fresnel\scripts\Demo_Fresnel_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\Grass\scripts\Demo_Grass_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\Gui\scripts\Demo_Gui_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+			<Depends filename="Samples\Common\CEGUIRenderer\scripts\OgreGUIRenderer_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\Lighting\scripts\Demo_Lighting_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\OceanDemo\script\Demo_Ocean_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+			<Depends filename="Samples\Common\CEGUIRenderer\scripts\OgreGUIRenderer_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\ParticleFX\scripts\Demo_ParticleFX_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\RenderToTexture\scripts\Demo_RenderToTexture_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\Shadows\scripts\Demo_Shadows_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\SkeletalAnimation\scripts\Demo_SkeletalAnimation_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\SkyBox\scripts\Demo_SkyBox_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\SkyDome\scripts\Demo_SkyDome_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\SkyPlane\scripts\Demo_SkyPlane_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\Smoke\scripts\Demo_Smoke_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\Terrain\scripts\Demo_Terrain_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\TextureFX\scripts\Demo_TextureFX_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\Transpacency\scripts\Demo_Transparency_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\VolumeTex\scripts\Demo_VolumeTex_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Samples\Water\scripts\Demo_Water_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+			<Depends filename="PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_stlp.cbp" />
+			<Depends filename="PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_stlp.cbp" />
+			<Depends filename="PlugIns\ParticleFX\scripts\Plugin_ParticleFX_stlp.cbp" />
+			<Depends filename="RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_stlp.cbp" />
+			<Depends filename="RenderSystems\GL\scripts\RenderSystem_GL_stlp.cbp" />
+		</Project>
+		<Project filename="Tools\XMLConverter\scripts\XMLConverter_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+		</Project>
+		<Project filename="Tools\MeshUpgrader\scripts\MeshUpgrader_stlp.cbp">
+			<Depends filename="OgreMain\scripts\OgreMain_stlp.cbp" />
+		</Project>
+	</Workspace>
+</CodeBlocks_workspace_file>
Index: /Ogre_vc8.sln
===================================================================
--- /Ogre_vc8.sln	(revision 5)
+++ /Ogre_vc8.sln	(revision 5)
@@ -0,0 +1,910 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OgreMain", "OgreMain\scripts\OgreMain_vc8.vcproj", "{35AFBABB-DF05-43DE-91A7-BB828A874015}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_BSPSceneManager", "PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager_vc8.vcproj", "{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_CgProgramManager", "PlugIns\CgProgramManager\scripts\Plugin_CgProgramManager_vc8.vcproj", "{1C741C2F-3278-43D8-9FD2-E631A64B70AE}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_OctreeSceneManager", "PlugIns\OctreeSceneManager\scripts\Plugin_OctreeSceneManager_vc8.vcproj", "{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_ParticleFX", "PlugIns\ParticleFX\scripts\Plugin_ParticleFX_vc8.vcproj", "{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReferenceAppLayer", "ReferenceApplication\ReferenceAppLayer\scripts\ReferenceAppLayer_vc8.vcproj", "{6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_BspCollision", "ReferenceApplication\BspCollision\scripts\BspCollision_vc8.vcproj", "{1982C73F-3D1C-46A6-9DFB-C7B03310365B}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9} = {6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RenderSystem_Direct3D9", "RenderSystems\Direct3D9\scripts\RenderSystem_Direct3D9_vc8.vcproj", "{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RenderSystem_GL", "RenderSystems\GL\scripts\RenderSystem_GL_vc8.vcproj", "{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_BezierPatch", "Samples\BezierPatch\scripts\Demo_BezierPatch_vc8.vcproj", "{EDD4B978-5ABA-448B-8DA7-A02F99714D66}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_BSP", "Samples\BSP\scripts\Demo_BSP_vc8.vcproj", "{D5EAD9CA-691E-4367-BFCC-C671581851E4}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_CameraTrack", "Samples\CameraTrack\scripts\Demo_CameraTrack_vc8.vcproj", "{161D4349-5DB6-4BCC-A890-FC20A2BB181A}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_CelShading", "Samples\CelShading\scripts\Demo_CelShading_vc8.vcproj", "{A0C80324-EF9A-41AE-A833-1CC909C38ABB}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_CubeMapping", "Samples\CubeMapping\scripts\Demo_CubeMapping_vc8.vcproj", "{89C04C44-50A4-47E3-BA46-8EA257329C80}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Dot3Bump", "Samples\Dot3Bump\scripts\Demo_Dot3Bump_vc8.vcproj", "{279EA6C7-59CF-48E4-BAC7-3C356A8114F6}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_EnvMapping", "Samples\EnvMapping\scripts\Demo_EnvMapping_vc8.vcproj", "{40308138-609B-4162-AA55-E8E02BF207F0}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Fresnel", "Samples\Fresnel\scripts\Demo_Fresnel_vc8.vcproj", "{B5E6BAD4-960F-418B-8904-FE93EC51947B}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Lighting", "Samples\Lighting\scripts\Demo_Lighting_vc8.vcproj", "{09F9E809-02CF-4926-8203-2B9C02FBD916}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_ParticleFX", "Samples\ParticleFX\scripts\Demo_ParticleFX_vc8.vcproj", "{74204563-3B14-42A3-B9E6-8E3201D571BC}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_RenderToTexture", "Samples\RenderToTexture\scripts\Demo_RenderToTexture_vc8.vcproj", "{109F610E-9B23-4D05-819E-A7F27A42AA94}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_SkeletalAnimation", "Samples\SkeletalAnimation\scripts\Demo_SkeletalAnimation_vc8.vcproj", "{43E76713-7E47-4AB0-A2FE-F4296B5C3EF8}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_SkyBox", "Samples\SkyBox\scripts\Demo_SkyBox_vc8.vcproj", "{BC7E19F4-4B5D-4549-B473-E234011B6719}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_SkyDome", "Samples\SkyDome\scripts\Demo_SkyDome_vc8.vcproj", "{C9AF3D1F-44A3-413A-B137-264C6D559CED}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_SkyPlane", "Samples\SkyPlane\scripts\Demo_SkyPlane_vc8.vcproj", "{2EF34790-42A6-4722-925A-8255120A90E3}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Smoke", "Samples\Smoke\scripts\Demo_Smoke_vc8.vcproj", "{86B4ED07-3D95-45C3-B387-512046E95C68}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Terrain", "Samples\Terrain\scripts\Demo_Terrain_vc8.vcproj", "{1BB416AA-358A-4B4B-B565-14CE1BF9D4FD}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_TextureFX", "Samples\TextureFX\scripts\Demo_TextureFX_vc8.vcproj", "{4C359709-9A70-4ED8-9071-8BCF1BCD83E7}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Transparency", "Samples\Transpacency\scripts\Demo_Transparency_vc8.vcproj", "{AB50ACAA-ADE7-4554-B56B-68991C41D29A}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Water", "Samples\Water\scripts\Demo_Water_vc8.vcproj", "{C7167FBD-F166-4DEA-B50B-9F25E28B75F6}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MaterialUpgrader", "Tools\MaterialUpgrader\scripts\MaterialUpgrader_vc8.vcproj", "{2BA1BBEE-CE27-48D6-A89D-EBAA81D40B6D}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeshUpgrader", "Tools\MeshUpgrader\scripts\MeshUpgrader_vc8.vcproj", "{6B3CABED-0D07-4AF0-8931-929B9B28BA8B}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MilkshapeExport", "Tools\MilkshapeExport\scripts\MilkshapeExport_vc8.vcproj", "{D4929E45-2A25-4F53-96A1-E1BCD91D9B6A}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XMLConverter", "Tools\XMLConverter\scripts\XMLConverter_vc8.vcproj", "{B4FB6BCF-FA5A-42C2-9FA5-F1653B95ADE3}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Shadows", "Samples\Shadows\scripts\Demo_Shadows_vc8.vcproj", "{F6C5DBF5-AD48-4F33-B824-595092CFE850}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33} = {2250CA22-7F4D-4BC0-A8E7-B4400D209B33}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_DynTex", "Samples\DynTex\scripts\Demo_DynTex_vc8.vcproj", "{8330C155-7C4B-4564-A7D9-946DE5A19B27}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Gui", "Samples\Gui\scripts\Demo_Gui_vc8.vcproj", "{0F83CA41-4364-49FF-A230-613B08B5CF82}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33} = {2250CA22-7F4D-4BC0-A8E7-B4400D209B33}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Grass", "Samples\Grass\scripts\Demo_Grass_vc8.vcproj", "{A6698238-7305-11D9-AAC8-91EC5E497716}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OgreGUIRenderer", "Samples\Common\CEGUIRenderer\scripts\OgreGUIRenderer_vc8.vcproj", "{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_FacialAnimation", "Samples\FacialAnimation\scripts\Demo_FacialAnimation_vc8.vcproj", "{59670412-2E76-4AE7-9923-3BE8D44323EE}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33} = {2250CA22-7F4D-4BC0-A8E7-B4400D209B33}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_DeferredShading", "Samples\DeferredShading\scripts\Demo_DeferredShading_vc8.vcproj", "{A2404F4B-2FB1-41B1-AAA6-6FD10921A791}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Compositor", "Samples\Compositor\scripts\Demo_Compositor_vc8.vcproj", "{FBD73586-AD33-4191-A604-68AE21278729}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33} = {2250CA22-7F4D-4BC0-A8E7-B4400D209B33}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_VolumeTex", "Samples\VolumeTex\scripts\Demo_VolumeTex_vc8.vcproj", "{724B4906-44BE-49FB-B1C8-E02AAAC0780C}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Ocean", "Samples\OceanDemo\script\Demo_Ocean_vc8.vcproj", "{E726B7BD-CB22-4CA5-AB6A-124FDDA6C4AC}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33} = {2250CA22-7F4D-4BC0-A8E7-B4400D209B33}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Crowd", "Samples\Instancing\scripts\Demo_Crowd_vc8.vcproj", "{5C668293-B752-499A-98C1-5042CACA1897}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33} = {2250CA22-7F4D-4BC0-A8E7-B4400D209B33}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Instancing", "Samples\Instancing\scripts\Demo_Instancing_vc8.vcproj", "{35134523-6D5B-4AFA-BFB4-4D57C42C2169}"
+	ProjectSection(WebsiteProperties) = preProject
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.Debug = "False"
+	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33} = {2250CA22-7F4D-4BC0-A8E7-B4400D209B33}
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE} = {1C741C2F-3278-43D8-9FD2-E631A64B70AE}
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6} = {C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461} = {0F172B9C-E5D5-4EB1-BFDB-93D787A37461}
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F} = {A6830BB5-9993-4F6D-8D4E-930F36A1B88F}
+		{35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4} = {7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		DebugStaticLib|Win32 = DebugStaticLib|Win32
+		Release|Win32 = Release|Win32
+		ReleaseStaticLib|Win32 = ReleaseStaticLib|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.Debug|Win32.ActiveCfg = Debug|Win32
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.Debug|Win32.Build.0 = Debug|Win32
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.DebugStaticLib|Win32.ActiveCfg = DebugStaticLib|Win32
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.DebugStaticLib|Win32.Build.0 = DebugStaticLib|Win32
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.Release|Win32.ActiveCfg = Release|Win32
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.Release|Win32.Build.0 = Release|Win32
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.ReleaseStaticLib|Win32.ActiveCfg = ReleaseStaticLib|Win32
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.ReleaseStaticLib|Win32.Build.0 = ReleaseStaticLib|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Debug|Win32.ActiveCfg = Debug|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Debug|Win32.Build.0 = Debug|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DebugStaticLib|Win32.ActiveCfg = DebugStaticLib|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DebugStaticLib|Win32.Build.0 = DebugStaticLib|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release|Win32.ActiveCfg = Release|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release|Win32.Build.0 = Release|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.ReleaseStaticLib|Win32.ActiveCfg = ReleaseStaticLib|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.ReleaseStaticLib|Win32.Build.0 = ReleaseStaticLib|Win32
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE}.Debug|Win32.Build.0 = Debug|Win32
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE}.DebugStaticLib|Win32.ActiveCfg = DebugStaticLib|Win32
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE}.DebugStaticLib|Win32.Build.0 = DebugStaticLib|Win32
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE}.Release|Win32.ActiveCfg = Release|Win32
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE}.Release|Win32.Build.0 = Release|Win32
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE}.ReleaseStaticLib|Win32.ActiveCfg = ReleaseStaticLib|Win32
+		{1C741C2F-3278-43D8-9FD2-E631A64B70AE}.ReleaseStaticLib|Win32.Build.0 = ReleaseStaticLib|Win32
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}.Debug|Win32.Build.0 = Debug|Win32
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}.DebugStaticLib|Win32.ActiveCfg = DebugStaticLib|Win32
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}.DebugStaticLib|Win32.Build.0 = DebugStaticLib|Win32
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}.Release|Win32.ActiveCfg = Release|Win32
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}.Release|Win32.Build.0 = Release|Win32
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}.ReleaseStaticLib|Win32.ActiveCfg = ReleaseStaticLib|Win32
+		{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}.ReleaseStaticLib|Win32.Build.0 = ReleaseStaticLib|Win32
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}.Debug|Win32.Build.0 = Debug|Win32
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}.DebugStaticLib|Win32.ActiveCfg = DebugStaticLib|Win32
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}.DebugStaticLib|Win32.Build.0 = DebugStaticLib|Win32
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}.Release|Win32.ActiveCfg = Release|Win32
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}.Release|Win32.Build.0 = Release|Win32
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}.ReleaseStaticLib|Win32.ActiveCfg = ReleaseStaticLib|Win32
+		{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}.ReleaseStaticLib|Win32.Build.0 = ReleaseStaticLib|Win32
+		{6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9}.Debug|Win32.Build.0 = Debug|Win32
+		{6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9}.Release|Win32.ActiveCfg = Release|Win32
+		{6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9}.Release|Win32.Build.0 = Release|Win32
+		{6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{1982C73F-3D1C-46A6-9DFB-C7B03310365B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1982C73F-3D1C-46A6-9DFB-C7B03310365B}.Debug|Win32.Build.0 = Debug|Win32
+		{1982C73F-3D1C-46A6-9DFB-C7B03310365B}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{1982C73F-3D1C-46A6-9DFB-C7B03310365B}.Release|Win32.ActiveCfg = Release|Win32
+		{1982C73F-3D1C-46A6-9DFB-C7B03310365B}.Release|Win32.Build.0 = Release|Win32
+		{1982C73F-3D1C-46A6-9DFB-C7B03310365B}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}.Debug|Win32.Build.0 = Debug|Win32
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}.DebugStaticLib|Win32.ActiveCfg = DebugStaticLib|Win32
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}.DebugStaticLib|Win32.Build.0 = DebugStaticLib|Win32
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}.Release|Win32.ActiveCfg = Release|Win32
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}.Release|Win32.Build.0 = Release|Win32
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}.ReleaseStaticLib|Win32.ActiveCfg = ReleaseStaticLib|Win32
+		{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}.ReleaseStaticLib|Win32.Build.0 = ReleaseStaticLib|Win32
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}.Debug|Win32.Build.0 = Debug|Win32
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}.DebugStaticLib|Win32.ActiveCfg = DebugStaticLib|Win32
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}.DebugStaticLib|Win32.Build.0 = DebugStaticLib|Win32
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}.Release|Win32.ActiveCfg = Release|Win32
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}.Release|Win32.Build.0 = Release|Win32
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}.ReleaseStaticLib|Win32.ActiveCfg = ReleaseStaticLib|Win32
+		{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}.ReleaseStaticLib|Win32.Build.0 = ReleaseStaticLib|Win32
+		{EDD4B978-5ABA-448B-8DA7-A02F99714D66}.Debug|Win32.ActiveCfg = Debug|Win32
+		{EDD4B978-5ABA-448B-8DA7-A02F99714D66}.Debug|Win32.Build.0 = Debug|Win32
+		{EDD4B978-5ABA-448B-8DA7-A02F99714D66}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{EDD4B978-5ABA-448B-8DA7-A02F99714D66}.Release|Win32.ActiveCfg = Release|Win32
+		{EDD4B978-5ABA-448B-8DA7-A02F99714D66}.Release|Win32.Build.0 = Release|Win32
+		{EDD4B978-5ABA-448B-8DA7-A02F99714D66}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{D5EAD9CA-691E-4367-BFCC-C671581851E4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D5EAD9CA-691E-4367-BFCC-C671581851E4}.Debug|Win32.Build.0 = Debug|Win32
+		{D5EAD9CA-691E-4367-BFCC-C671581851E4}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{D5EAD9CA-691E-4367-BFCC-C671581851E4}.Release|Win32.ActiveCfg = Release|Win32
+		{D5EAD9CA-691E-4367-BFCC-C671581851E4}.Release|Win32.Build.0 = Release|Win32
+		{D5EAD9CA-691E-4367-BFCC-C671581851E4}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{161D4349-5DB6-4BCC-A890-FC20A2BB181A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{161D4349-5DB6-4BCC-A890-FC20A2BB181A}.Debug|Win32.Build.0 = Debug|Win32
+		{161D4349-5DB6-4BCC-A890-FC20A2BB181A}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{161D4349-5DB6-4BCC-A890-FC20A2BB181A}.Release|Win32.ActiveCfg = Release|Win32
+		{161D4349-5DB6-4BCC-A890-FC20A2BB181A}.Release|Win32.Build.0 = Release|Win32
+		{161D4349-5DB6-4BCC-A890-FC20A2BB181A}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{A0C80324-EF9A-41AE-A833-1CC909C38ABB}.Debug|Win32.ActiveCfg = Debug|Win32
+		{A0C80324-EF9A-41AE-A833-1CC909C38ABB}.Debug|Win32.Build.0 = Debug|Win32
+		{A0C80324-EF9A-41AE-A833-1CC909C38ABB}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{A0C80324-EF9A-41AE-A833-1CC909C38ABB}.Release|Win32.ActiveCfg = Release|Win32
+		{A0C80324-EF9A-41AE-A833-1CC909C38ABB}.Release|Win32.Build.0 = Release|Win32
+		{A0C80324-EF9A-41AE-A833-1CC909C38ABB}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{89C04C44-50A4-47E3-BA46-8EA257329C80}.Debug|Win32.ActiveCfg = Debug|Win32
+		{89C04C44-50A4-47E3-BA46-8EA257329C80}.Debug|Win32.Build.0 = Debug|Win32
+		{89C04C44-50A4-47E3-BA46-8EA257329C80}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{89C04C44-50A4-47E3-BA46-8EA257329C80}.Release|Win32.ActiveCfg = Release|Win32
+		{89C04C44-50A4-47E3-BA46-8EA257329C80}.Release|Win32.Build.0 = Release|Win32
+		{89C04C44-50A4-47E3-BA46-8EA257329C80}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{279EA6C7-59CF-48E4-BAC7-3C356A8114F6}.Debug|Win32.ActiveCfg = Debug|Win32
+		{279EA6C7-59CF-48E4-BAC7-3C356A8114F6}.Debug|Win32.Build.0 = Debug|Win32
+		{279EA6C7-59CF-48E4-BAC7-3C356A8114F6}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{279EA6C7-59CF-48E4-BAC7-3C356A8114F6}.Release|Win32.ActiveCfg = Release|Win32
+		{279EA6C7-59CF-48E4-BAC7-3C356A8114F6}.Release|Win32.Build.0 = Release|Win32
+		{279EA6C7-59CF-48E4-BAC7-3C356A8114F6}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{40308138-609B-4162-AA55-E8E02BF207F0}.Debug|Win32.ActiveCfg = Debug|Win32
+		{40308138-609B-4162-AA55-E8E02BF207F0}.Debug|Win32.Build.0 = Debug|Win32
+		{40308138-609B-4162-AA55-E8E02BF207F0}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{40308138-609B-4162-AA55-E8E02BF207F0}.Release|Win32.ActiveCfg = Release|Win32
+		{40308138-609B-4162-AA55-E8E02BF207F0}.Release|Win32.Build.0 = Release|Win32
+		{40308138-609B-4162-AA55-E8E02BF207F0}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{B5E6BAD4-960F-418B-8904-FE93EC51947B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B5E6BAD4-960F-418B-8904-FE93EC51947B}.Debug|Win32.Build.0 = Debug|Win32
+		{B5E6BAD4-960F-418B-8904-FE93EC51947B}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{B5E6BAD4-960F-418B-8904-FE93EC51947B}.Release|Win32.ActiveCfg = Release|Win32
+		{B5E6BAD4-960F-418B-8904-FE93EC51947B}.Release|Win32.Build.0 = Release|Win32
+		{B5E6BAD4-960F-418B-8904-FE93EC51947B}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{09F9E809-02CF-4926-8203-2B9C02FBD916}.Debug|Win32.ActiveCfg = Debug|Win32
+		{09F9E809-02CF-4926-8203-2B9C02FBD916}.Debug|Win32.Build.0 = Debug|Win32
+		{09F9E809-02CF-4926-8203-2B9C02FBD916}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{09F9E809-02CF-4926-8203-2B9C02FBD916}.Release|Win32.ActiveCfg = Release|Win32
+		{09F9E809-02CF-4926-8203-2B9C02FBD916}.Release|Win32.Build.0 = Release|Win32
+		{09F9E809-02CF-4926-8203-2B9C02FBD916}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{74204563-3B14-42A3-B9E6-8E3201D571BC}.Debug|Win32.ActiveCfg = Debug|Win32
+		{74204563-3B14-42A3-B9E6-8E3201D571BC}.Debug|Win32.Build.0 = Debug|Win32
+		{74204563-3B14-42A3-B9E6-8E3201D571BC}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{74204563-3B14-42A3-B9E6-8E3201D571BC}.Release|Win32.ActiveCfg = Release|Win32
+		{74204563-3B14-42A3-B9E6-8E3201D571BC}.Release|Win32.Build.0 = Release|Win32
+		{74204563-3B14-42A3-B9E6-8E3201D571BC}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{109F610E-9B23-4D05-819E-A7F27A42AA94}.Debug|Win32.ActiveCfg = Debug|Win32
+		{109F610E-9B23-4D05-819E-A7F27A42AA94}.Debug|Win32.Build.0 = Debug|Win32
+		{109F610E-9B23-4D05-819E-A7F27A42AA94}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{109F610E-9B23-4D05-819E-A7F27A42AA94}.Release|Win32.ActiveCfg = Release|Win32
+		{109F610E-9B23-4D05-819E-A7F27A42AA94}.Release|Win32.Build.0 = Release|Win32
+		{109F610E-9B23-4D05-819E-A7F27A42AA94}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{43E76713-7E47-4AB0-A2FE-F4296B5C3EF8}.Debug|Win32.ActiveCfg = Debug|Win32
+		{43E76713-7E47-4AB0-A2FE-F4296B5C3EF8}.Debug|Win32.Build.0 = Debug|Win32
+		{43E76713-7E47-4AB0-A2FE-F4296B5C3EF8}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{43E76713-7E47-4AB0-A2FE-F4296B5C3EF8}.Release|Win32.ActiveCfg = Release|Win32
+		{43E76713-7E47-4AB0-A2FE-F4296B5C3EF8}.Release|Win32.Build.0 = Release|Win32
+		{43E76713-7E47-4AB0-A2FE-F4296B5C3EF8}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{BC7E19F4-4B5D-4549-B473-E234011B6719}.Debug|Win32.ActiveCfg = Debug|Win32
+		{BC7E19F4-4B5D-4549-B473-E234011B6719}.Debug|Win32.Build.0 = Debug|Win32
+		{BC7E19F4-4B5D-4549-B473-E234011B6719}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{BC7E19F4-4B5D-4549-B473-E234011B6719}.Release|Win32.ActiveCfg = Release|Win32
+		{BC7E19F4-4B5D-4549-B473-E234011B6719}.Release|Win32.Build.0 = Release|Win32
+		{BC7E19F4-4B5D-4549-B473-E234011B6719}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{C9AF3D1F-44A3-413A-B137-264C6D559CED}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C9AF3D1F-44A3-413A-B137-264C6D559CED}.Debug|Win32.Build.0 = Debug|Win32
+		{C9AF3D1F-44A3-413A-B137-264C6D559CED}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{C9AF3D1F-44A3-413A-B137-264C6D559CED}.Release|Win32.ActiveCfg = Release|Win32
+		{C9AF3D1F-44A3-413A-B137-264C6D559CED}.Release|Win32.Build.0 = Release|Win32
+		{C9AF3D1F-44A3-413A-B137-264C6D559CED}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{2EF34790-42A6-4722-925A-8255120A90E3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{2EF34790-42A6-4722-925A-8255120A90E3}.Debug|Win32.Build.0 = Debug|Win32
+		{2EF34790-42A6-4722-925A-8255120A90E3}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{2EF34790-42A6-4722-925A-8255120A90E3}.Release|Win32.ActiveCfg = Release|Win32
+		{2EF34790-42A6-4722-925A-8255120A90E3}.Release|Win32.Build.0 = Release|Win32
+		{2EF34790-42A6-4722-925A-8255120A90E3}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{86B4ED07-3D95-45C3-B387-512046E95C68}.Debug|Win32.ActiveCfg = Debug|Win32
+		{86B4ED07-3D95-45C3-B387-512046E95C68}.Debug|Win32.Build.0 = Debug|Win32
+		{86B4ED07-3D95-45C3-B387-512046E95C68}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{86B4ED07-3D95-45C3-B387-512046E95C68}.Release|Win32.ActiveCfg = Release|Win32
+		{86B4ED07-3D95-45C3-B387-512046E95C68}.Release|Win32.Build.0 = Release|Win32
+		{86B4ED07-3D95-45C3-B387-512046E95C68}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{1BB416AA-358A-4B4B-B565-14CE1BF9D4FD}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1BB416AA-358A-4B4B-B565-14CE1BF9D4FD}.Debug|Win32.Build.0 = Debug|Win32
+		{1BB416AA-358A-4B4B-B565-14CE1BF9D4FD}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{1BB416AA-358A-4B4B-B565-14CE1BF9D4FD}.Release|Win32.ActiveCfg = Release|Win32
+		{1BB416AA-358A-4B4B-B565-14CE1BF9D4FD}.Release|Win32.Build.0 = Release|Win32
+		{1BB416AA-358A-4B4B-B565-14CE1BF9D4FD}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{4C359709-9A70-4ED8-9071-8BCF1BCD83E7}.Debug|Win32.ActiveCfg = Debug|Win32
+		{4C359709-9A70-4ED8-9071-8BCF1BCD83E7}.Debug|Win32.Build.0 = Debug|Win32
+		{4C359709-9A70-4ED8-9071-8BCF1BCD83E7}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{4C359709-9A70-4ED8-9071-8BCF1BCD83E7}.Release|Win32.ActiveCfg = Release|Win32
+		{4C359709-9A70-4ED8-9071-8BCF1BCD83E7}.Release|Win32.Build.0 = Release|Win32
+		{4C359709-9A70-4ED8-9071-8BCF1BCD83E7}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{AB50ACAA-ADE7-4554-B56B-68991C41D29A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{AB50ACAA-ADE7-4554-B56B-68991C41D29A}.Debug|Win32.Build.0 = Debug|Win32
+		{AB50ACAA-ADE7-4554-B56B-68991C41D29A}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{AB50ACAA-ADE7-4554-B56B-68991C41D29A}.Release|Win32.ActiveCfg = Release|Win32
+		{AB50ACAA-ADE7-4554-B56B-68991C41D29A}.Release|Win32.Build.0 = Release|Win32
+		{AB50ACAA-ADE7-4554-B56B-68991C41D29A}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{C7167FBD-F166-4DEA-B50B-9F25E28B75F6}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C7167FBD-F166-4DEA-B50B-9F25E28B75F6}.Debug|Win32.Build.0 = Debug|Win32
+		{C7167FBD-F166-4DEA-B50B-9F25E28B75F6}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{C7167FBD-F166-4DEA-B50B-9F25E28B75F6}.Release|Win32.ActiveCfg = Release|Win32
+		{C7167FBD-F166-4DEA-B50B-9F25E28B75F6}.Release|Win32.Build.0 = Release|Win32
+		{C7167FBD-F166-4DEA-B50B-9F25E28B75F6}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{2BA1BBEE-CE27-48D6-A89D-EBAA81D40B6D}.Debug|Win32.ActiveCfg = Debug|Win32
+		{2BA1BBEE-CE27-48D6-A89D-EBAA81D40B6D}.Debug|Win32.Build.0 = Debug|Win32
+		{2BA1BBEE-CE27-48D6-A89D-EBAA81D40B6D}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{2BA1BBEE-CE27-48D6-A89D-EBAA81D40B6D}.Release|Win32.ActiveCfg = Release|Win32
+		{2BA1BBEE-CE27-48D6-A89D-EBAA81D40B6D}.Release|Win32.Build.0 = Release|Win32
+		{2BA1BBEE-CE27-48D6-A89D-EBAA81D40B6D}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{6B3CABED-0D07-4AF0-8931-929B9B28BA8B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{6B3CABED-0D07-4AF0-8931-929B9B28BA8B}.Debug|Win32.Build.0 = Debug|Win32
+		{6B3CABED-0D07-4AF0-8931-929B9B28BA8B}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{6B3CABED-0D07-4AF0-8931-929B9B28BA8B}.Release|Win32.ActiveCfg = Release|Win32
+		{6B3CABED-0D07-4AF0-8931-929B9B28BA8B}.Release|Win32.Build.0 = Release|Win32
+		{6B3CABED-0D07-4AF0-8931-929B9B28BA8B}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{D4929E45-2A25-4F53-96A1-E1BCD91D9B6A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D4929E45-2A25-4F53-96A1-E1BCD91D9B6A}.Debug|Win32.Build.0 = Debug|Win32
+		{D4929E45-2A25-4F53-96A1-E1BCD91D9B6A}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{D4929E45-2A25-4F53-96A1-E1BCD91D9B6A}.Release|Win32.ActiveCfg = Release|Win32
+		{D4929E45-2A25-4F53-96A1-E1BCD91D9B6A}.Release|Win32.Build.0 = Release|Win32
+		{D4929E45-2A25-4F53-96A1-E1BCD91D9B6A}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{B4FB6BCF-FA5A-42C2-9FA5-F1653B95ADE3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B4FB6BCF-FA5A-42C2-9FA5-F1653B95ADE3}.Debug|Win32.Build.0 = Debug|Win32
+		{B4FB6BCF-FA5A-42C2-9FA5-F1653B95ADE3}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{B4FB6BCF-FA5A-42C2-9FA5-F1653B95ADE3}.Release|Win32.ActiveCfg = Release|Win32
+		{B4FB6BCF-FA5A-42C2-9FA5-F1653B95ADE3}.Release|Win32.Build.0 = Release|Win32
+		{B4FB6BCF-FA5A-42C2-9FA5-F1653B95ADE3}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{F6C5DBF5-AD48-4F33-B824-595092CFE850}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F6C5DBF5-AD48-4F33-B824-595092CFE850}.Debug|Win32.Build.0 = Debug|Win32
+		{F6C5DBF5-AD48-4F33-B824-595092CFE850}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{F6C5DBF5-AD48-4F33-B824-595092CFE850}.Release|Win32.ActiveCfg = Release|Win32
+		{F6C5DBF5-AD48-4F33-B824-595092CFE850}.Release|Win32.Build.0 = Release|Win32
+		{F6C5DBF5-AD48-4F33-B824-595092CFE850}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{8330C155-7C4B-4564-A7D9-946DE5A19B27}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8330C155-7C4B-4564-A7D9-946DE5A19B27}.Debug|Win32.Build.0 = Debug|Win32
+		{8330C155-7C4B-4564-A7D9-946DE5A19B27}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{8330C155-7C4B-4564-A7D9-946DE5A19B27}.Release|Win32.ActiveCfg = Release|Win32
+		{8330C155-7C4B-4564-A7D9-946DE5A19B27}.Release|Win32.Build.0 = Release|Win32
+		{8330C155-7C4B-4564-A7D9-946DE5A19B27}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{0F83CA41-4364-49FF-A230-613B08B5CF82}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0F83CA41-4364-49FF-A230-613B08B5CF82}.Debug|Win32.Build.0 = Debug|Win32
+		{0F83CA41-4364-49FF-A230-613B08B5CF82}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{0F83CA41-4364-49FF-A230-613B08B5CF82}.Release|Win32.ActiveCfg = Release|Win32
+		{0F83CA41-4364-49FF-A230-613B08B5CF82}.Release|Win32.Build.0 = Release|Win32
+		{0F83CA41-4364-49FF-A230-613B08B5CF82}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{A6698238-7305-11D9-AAC8-91EC5E497716}.Debug|Win32.ActiveCfg = Debug|Win32
+		{A6698238-7305-11D9-AAC8-91EC5E497716}.Debug|Win32.Build.0 = Debug|Win32
+		{A6698238-7305-11D9-AAC8-91EC5E497716}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{A6698238-7305-11D9-AAC8-91EC5E497716}.Release|Win32.ActiveCfg = Release|Win32
+		{A6698238-7305-11D9-AAC8-91EC5E497716}.Release|Win32.Build.0 = Release|Win32
+		{A6698238-7305-11D9-AAC8-91EC5E497716}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}.Debug|Win32.ActiveCfg = Debug|Win32
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}.Debug|Win32.Build.0 = Debug|Win32
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}.DebugStaticLib|Win32.ActiveCfg = DebugStaticLib|Win32
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}.DebugStaticLib|Win32.Build.0 = DebugStaticLib|Win32
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}.Release|Win32.ActiveCfg = Release|Win32
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}.Release|Win32.Build.0 = Release|Win32
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}.ReleaseStaticLib|Win32.ActiveCfg = ReleaseStaticLib|Win32
+		{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}.ReleaseStaticLib|Win32.Build.0 = ReleaseStaticLib|Win32
+		{59670412-2E76-4AE7-9923-3BE8D44323EE}.Debug|Win32.ActiveCfg = Debug|Win32
+		{59670412-2E76-4AE7-9923-3BE8D44323EE}.Debug|Win32.Build.0 = Debug|Win32
+		{59670412-2E76-4AE7-9923-3BE8D44323EE}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{59670412-2E76-4AE7-9923-3BE8D44323EE}.Release|Win32.ActiveCfg = Release|Win32
+		{59670412-2E76-4AE7-9923-3BE8D44323EE}.Release|Win32.Build.0 = Release|Win32
+		{59670412-2E76-4AE7-9923-3BE8D44323EE}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{A2404F4B-2FB1-41B1-AAA6-6FD10921A791}.Debug|Win32.ActiveCfg = Debug|Win32
+		{A2404F4B-2FB1-41B1-AAA6-6FD10921A791}.Debug|Win32.Build.0 = Debug|Win32
+		{A2404F4B-2FB1-41B1-AAA6-6FD10921A791}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{A2404F4B-2FB1-41B1-AAA6-6FD10921A791}.Release|Win32.ActiveCfg = Release|Win32
+		{A2404F4B-2FB1-41B1-AAA6-6FD10921A791}.Release|Win32.Build.0 = Release|Win32
+		{A2404F4B-2FB1-41B1-AAA6-6FD10921A791}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{FBD73586-AD33-4191-A604-68AE21278729}.Debug|Win32.ActiveCfg = Debug|Win32
+		{FBD73586-AD33-4191-A604-68AE21278729}.Debug|Win32.Build.0 = Debug|Win32
+		{FBD73586-AD33-4191-A604-68AE21278729}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{FBD73586-AD33-4191-A604-68AE21278729}.Release|Win32.ActiveCfg = Release|Win32
+		{FBD73586-AD33-4191-A604-68AE21278729}.Release|Win32.Build.0 = Release|Win32
+		{FBD73586-AD33-4191-A604-68AE21278729}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{724B4906-44BE-49FB-B1C8-E02AAAC0780C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{724B4906-44BE-49FB-B1C8-E02AAAC0780C}.Debug|Win32.Build.0 = Debug|Win32
+		{724B4906-44BE-49FB-B1C8-E02AAAC0780C}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{724B4906-44BE-49FB-B1C8-E02AAAC0780C}.Release|Win32.ActiveCfg = Release|Win32
+		{724B4906-44BE-49FB-B1C8-E02AAAC0780C}.Release|Win32.Build.0 = Release|Win32
+		{724B4906-44BE-49FB-B1C8-E02AAAC0780C}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{E726B7BD-CB22-4CA5-AB6A-124FDDA6C4AC}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E726B7BD-CB22-4CA5-AB6A-124FDDA6C4AC}.Debug|Win32.Build.0 = Debug|Win32
+		{E726B7BD-CB22-4CA5-AB6A-124FDDA6C4AC}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{E726B7BD-CB22-4CA5-AB6A-124FDDA6C4AC}.Release|Win32.ActiveCfg = Release|Win32
+		{E726B7BD-CB22-4CA5-AB6A-124FDDA6C4AC}.Release|Win32.Build.0 = Release|Win32
+		{E726B7BD-CB22-4CA5-AB6A-124FDDA6C4AC}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{5C668293-B752-499A-98C1-5042CACA1897}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5C668293-B752-499A-98C1-5042CACA1897}.Debug|Win32.Build.0 = Debug|Win32
+		{5C668293-B752-499A-98C1-5042CACA1897}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{5C668293-B752-499A-98C1-5042CACA1897}.DebugStaticLib|Win32.Build.0 = Debug|Win32
+		{5C668293-B752-499A-98C1-5042CACA1897}.Release|Win32.ActiveCfg = Release|Win32
+		{5C668293-B752-499A-98C1-5042CACA1897}.Release|Win32.Build.0 = Release|Win32
+		{5C668293-B752-499A-98C1-5042CACA1897}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{5C668293-B752-499A-98C1-5042CACA1897}.ReleaseStaticLib|Win32.Build.0 = Release|Win32
+		{35134523-6D5B-4AFA-BFB4-4D57C42C2169}.Debug|Win32.ActiveCfg = Debug|Win32
+		{35134523-6D5B-4AFA-BFB4-4D57C42C2169}.Debug|Win32.Build.0 = Debug|Win32
+		{35134523-6D5B-4AFA-BFB4-4D57C42C2169}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+		{35134523-6D5B-4AFA-BFB4-4D57C42C2169}.DebugStaticLib|Win32.Build.0 = Debug|Win32
+		{35134523-6D5B-4AFA-BFB4-4D57C42C2169}.Release|Win32.ActiveCfg = Release|Win32
+		{35134523-6D5B-4AFA-BFB4-4D57C42C2169}.Release|Win32.Build.0 = Release|Win32
+		{35134523-6D5B-4AFA-BFB4-4D57C42C2169}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+		{35134523-6D5B-4AFA-BFB4-4D57C42C2169}.ReleaseStaticLib|Win32.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		DPBuild = 5
+	EndGlobalSection
+EndGlobal
Index: /Other/add_crlf.py
===================================================================
--- /Other/add_crlf.py	(revision 5)
+++ /Other/add_crlf.py	(revision 5)
@@ -0,0 +1,44 @@
+import sys
+import os
+import getopt
+import string
+
+def fnParse( arg, dirname, files ):
+    for file in files:
+        for ext in arg:
+            if file.rfind( ext, len(file)-len(ext), len(file) ) != -1 and not os.path.isdir( dirname + "/" + file ):
+                fo = open( dirname + "/" + file, "rb" )
+                lines = fo.read()
+                if not '\0' in lines and lines[len(lines)-1] != '\n':
+                    newlines = lines + '\n'
+                    fo.close()
+                    fo = open( dirname + "/" + file, "wb" )
+                    fo.write(newlines)
+                    print "File " + dirname + "/" + file + " was changed."
+                fo.close()
+
+def fnHelp():
+    helpstr = """
+This nifty little program adds a CR/LF at the end of every
+file with the given extension within the directory tree
+from where it was called (i.e. recurses in sub-directories).
+
+Syntax:
+    add_crlf [ext1] [ext2] [...]
+
+Extensions are given in the form:
+    .cpp .h .txt (no asterisk at the beginning)
+
+Copyright (c) 2002 by Adrian Cearnau (cearny@cearny.ro)
+Any use, commercial or not, is allowed
+"""
+    print helpstr
+
+if len(sys.argv) < 2:
+    fnHelp()
+else:
+    exts = sys.argv[1].split()
+    currdir = os.getcwd()
+    os.path.walk( currdir, fnParse, exts )
+    #print "\nTotally", num_files, "files were patched\n"
+    print "done"
Index: /Other/rem_endspc.py
===================================================================
--- /Other/rem_endspc.py	(revision 5)
+++ /Other/rem_endspc.py	(revision 5)
@@ -0,0 +1,60 @@
+#! /usr/bin/env python
+
+import sys
+import os
+import getopt
+import string
+import re
+
+def fnParse( arg, dirname, files ):
+    for file in files:
+        for ext in arg:
+            if file.rfind( ext, len(file)-len(ext), len(file) ) != -1 and not os.path.isdir( dirname + "/" + file ):
+                print "Parsing file " + dirname + "/" + file + "..."
+                fo = open( dirname + "/" + file, "r" )
+                lines = fo.readlines()
+                fo.close()
+                fo = open( dirname + "/" + file, "r" )
+                newlines = fo.readlines()
+                changed = 0
+                for i in range(0, len(newlines) - 1):
+                    newlines[i] = re.sub( "[ \t]+$", "", newlines[i] )
+                    changed = 1
+                if changed == 1:
+                    backup = open( dirname + "/" + file + "~", "w" )
+                    backup.writelines( lines )
+                    backup.close()
+
+                    fo.close()
+                    fo = open( dirname + "/" + file, "w" )
+                    fo.writelines( newlines )
+
+                    print "File " + dirname + "/" + file + " was changed."
+                fo.close()
+
+def fnHelp():
+    helpstr = """
+This program deletes all the 'dangling' spaces at the end
+of all the lines in all the files with the passed extensions
+within the directory tree from whose root it was called
+(i.e. recurses into sub-directories)
+
+Syntax:
+    rem_endspc [ext1] [ext2] [...]
+
+Extensions are given in the form:
+    .cpp .h .txt (no asterisk at the beginning)
+
+Copyright (c) 2002 by Adrian Cearnau (cearny@cearny.ro)
+Any use, commercial or not, is allowed
+"""
+    print helpstr
+
+if len(sys.argv) < 2:
+    fnHelp()
+else:
+    exts = sys.argv[1].split()
+    currdir = os.getcwd()
+    os.path.walk( currdir, fnParse, exts )
+    #print "\nTotally", num_files, "files were patched\n"
+    print "done"
Index: /Other/tab2spc.py
===================================================================
--- /Other/tab2spc.py	(revision 5)
+++ /Other/tab2spc.py	(revision 5)
@@ -0,0 +1,56 @@
+#! /usr/bin/env python
+
+import sys
+import os
+import getopt
+import string
+import re
+
+def fnParse( arg, dirname, files ):
+    for file in files:
+        for ext in arg:
+            if file.rfind( ext, len(file)-len(ext), len(file) ) != -1 and not os.path.isdir( dirname + "/" + file ):
+                fo = open( dirname + "/" + file, "rb" )
+                lines = fo.read()
+                if not '\0' in lines:
+                    newlines = re.sub( "\t", globals()['spaces'], lines )
+                    if newlines != lines:
+                        backup = open( dirname + "/" + file + "~", "wb" )
+                        backup.write( lines )
+                        backup.close()
+
+                        fo.close()
+                        fo = open( dirname + "/" + file, "wb" )
+                        fo.write(newlines)
+
+                        print "File " + dirname + "/" + file + " was changed."
+                fo.close()
+
+def fnHelp():
+    helpstr = """
+This program transforms all the TAB characters in all
+the files with the given extension from the directory
+tree into the given number of spaces.
+
+Syntax:
+    tab2spc [num_spaces] [ext1] [ext2] [...]
+
+Extensions are given in the form:
+    .cpp .h .txt (no asterisk at the beginning)
+
+Copyright (c) 2002 by Adrian Cearnau (cearny@cearny.ro)
+Any use, commercial or not, is allowed
+"""
+    print helpstr
+
+if len(sys.argv) != 3:
+    fnHelp()
+else:
+    spaces = ""
+    for i in range( 0, int(sys.argv[1]) ):
+        spaces = spaces + ' '
+    exts = sys.argv[2].split()
+    currdir = os.getcwd()
+    os.path.walk( currdir, fnParse, exts )
+    #print "\nTotally", num_files, "files were patched\n"
+    print "done"
Index: /PlugIns/BSPSceneManager/Makefile.am
===================================================================
--- /PlugIns/BSPSceneManager/Makefile.am	(revision 5)
+++ /PlugIns/BSPSceneManager/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /PlugIns/BSPSceneManager/Makefile.in
===================================================================
--- /PlugIns/BSPSceneManager/Makefile.in	(revision 5)
+++ /PlugIns/BSPSceneManager/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = PlugIns/BSPSceneManager
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  PlugIns/BSPSceneManager/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  PlugIns/BSPSceneManager/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /PlugIns/BSPSceneManager/include/Makefile.am
===================================================================
--- /PlugIns/BSPSceneManager/include/Makefile.am	(revision 5)
+++ /PlugIns/BSPSceneManager/include/Makefile.am	(revision 5)
@@ -0,0 +1,11 @@
+noinst_HEADERS = OgreBspLevel.h \
+                 OgreBspNode.h \
+                 OgreBspPrerequisites.h \
+                 OgreBspResourceManager.h \
+                 OgreBspSceneManager.h \
+				 OgreBspSceneManagerPlugin.h \
+				 OgreBspSceneNode.h \
+                 OgreQuake3Level.h \
+                 OgreQuake3Shader.h \
+                 OgreQuake3ShaderManager.h \
+                 OgreQuake3Types.h
Index: /PlugIns/BSPSceneManager/include/Makefile.in
===================================================================
--- /PlugIns/BSPSceneManager/include/Makefile.in	(revision 5)
+++ /PlugIns/BSPSceneManager/include/Makefile.in	(revision 5)
@@ -0,0 +1,447 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = PlugIns/BSPSceneManager/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = OgreBspLevel.h \
+                 OgreBspNode.h \
+                 OgreBspPrerequisites.h \
+                 OgreBspResourceManager.h \
+                 OgreBspSceneManager.h \
+				 OgreBspSceneManagerPlugin.h \
+				 OgreBspSceneNode.h \
+                 OgreQuake3Level.h \
+                 OgreQuake3Shader.h \
+                 OgreQuake3ShaderManager.h \
+                 OgreQuake3Types.h
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  PlugIns/BSPSceneManager/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  PlugIns/BSPSceneManager/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /PlugIns/BSPSceneManager/include/OgreBspLevel.h
===================================================================
--- /PlugIns/BSPSceneManager/include/OgreBspLevel.h	(revision 5)
+++ /PlugIns/BSPSceneManager/include/OgreBspLevel.h	(revision 5)
@@ -0,0 +1,278 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _BspLevel_H__
+#define _BspLevel_H__
+
+#include "OgreBspPrerequisites.h"
+#include "OgreResource.h"
+#include "OgreStaticFaceGroup.h"
+#include "OgreSceneManager.h"
+#include "OgreBspNode.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreDefaultHardwareBufferManager.h"
+#include "OgreQuake3Level.h"
+
+
+namespace Ogre {
+
+    /** Holds all the data associated with a Binary Space Parition
+        (BSP) based indoor level.
+        The data used here is populated by loading level files via
+        the BspLevelManager::load method, although application users
+        are more likely to call SceneManager::setWorldGeometry which will
+        automatically arrange the loading of the level. Note that this assumes
+        that you have asked for an indoor-specialised SceneManager (specify
+        ST_INDOOR when calling Root::getSceneManager).</p>
+        Ogre currently only supports loading from Quake3 Arena level files,
+        although any source that can be converted into this classes structure
+        could also be used. The Quake3 level load process is in a different
+        class called Quake3Level to keep the specifics separate.</p>
+    */
+    class BspLevel : public Resource
+    {
+        friend class BspSceneManager;
+    public:
+        /** Default constructor - used by BspResourceManager (do not call directly) */
+        BspLevel(ResourceManager* creator, const String& name, ResourceHandle handle,
+            const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
+        ~BspLevel();
+
+        /** Determines if one leaf node is visible from another. */
+        bool isLeafVisible(const BspNode* from, const BspNode* to) const;
+
+        /** Returns a pointer to the root node (BspNode) of the BSP tree. */
+        const BspNode* getRootNode(void);
+
+        /** Walks the entire BSP tree and returns the leaf
+            which contains the given point.
+        */
+        BspNode* findLeaf(const Vector3& point) const;
+
+        /** Ensures that the MovableObject is attached to the right leaves of the 
+            BSP tree.
+        */
+        void _notifyObjectMoved(const MovableObject* mov, 
+            const Vector3& pos);
+		/** Internal method, makes sure an object is removed from the leaves when detached from a node. */
+		void _notifyObjectDetached(const MovableObject* mov);
+        /** Gets a pointer to the start of the leaf nodes. */
+        BspNode* getLeafStart(void) {return &mRootNode[mLeafStart]; }
+        /** Gets the number of leaf nodes */
+        int getNumLeaves(void) const { return mNumLeaves; }
+
+        /** Calculate the number of loading stages required for a given level */
+        static size_t calculateLoadingStages(const String& levelName);
+        /** Calculate the number of loading stages required for a given level */
+        static size_t calculateLoadingStages(DataStreamPtr& stream);
+
+		/** Load direct from stream */
+		void load(DataStreamPtr& stream);
+
+		/** Is sky enabled? */
+		bool isSkyEnabled(void) const;
+		/** Get Sky material name */
+		const String& getSkyMaterialName(void) const;
+		/** Get sky curvature */
+		Real getSkyCurvature(void) const;
+
+        /** Utility class just to enable queueing of patches */
+    protected:
+        /** @copydoc Resource::loadImpl. */
+        void loadImpl(void);
+        /** @copydoc Resource::unloadImpl. */
+        void unloadImpl(void);
+        /** @copydoc Resource::calculateSize. */
+        size_t calculateSize(void) const;
+        /** Pointer to the root node of the BSP tree;
+            This pointer actually has a dual purpose; to avoid allocating lots of small chunks of
+            memory, the BspLevel actually allocates all nodes required through this pointer. So this
+            pointer is the handle for the allocation of memory for all nodes. It also happens to point
+            to the root node, since the first one in the memory chunk is the root node.
+        */
+        BspNode* mRootNode;
+        int mNumNodes;
+        int mNumLeaves;
+        int mLeafStart; // the index at which leaf nodes begin
+
+        /** Vertex format for fixed geometry.
+            Note that in this case vertex components (position, normal, texture coords etc)
+            are held interleaved in the same buffer. However, the format here is different from 
+            the format used by Quake because older Direct3d drivers like the vertex elements
+            to be in a particular order within the buffer. See VertexDeclaration for full
+            details of this marvellous(not) feature.
+        */
+        struct BspVertex
+        {
+            float position[3];
+            float normal[3];
+            int colour;
+            float texcoords[2];
+            float lightmap[2];
+        };
+        /*
+        /// Array of vertices for whole level.
+        BspVertex* mVertices;
+        int mNumVertices;
+        */
+        /// Vertex data holding all the data for the level, but able to render parts of it
+        VertexData* mVertexData;
+
+        /** Array of indexes into the mFaceGroups array. This buffer is organised
+            by leaf node so leaves can just use contiguous chunks of it and
+            get repointed to the actual entries in mFaceGroups. */
+        int* mLeafFaceGroups;
+        int mNumLeafFaceGroups;
+
+        /** Array of face groups, indexed into by contents of mLeafFaceGroups. */
+        StaticFaceGroup* mFaceGroups;
+        int mNumFaceGroups;
+
+
+        /*
+        /// Array of elements i.e. vertex indexes as used by face groups.
+        int* mElements;
+        int mNumElements;
+        */
+
+        /// indexes for the whole level, will be copied to the real indexdata per frame
+        size_t mNumIndexes;
+        // system-memory buffer
+        HardwareIndexBufferSharedPtr mIndexes;
+
+        /// Brushes as used for collision, main memory is here
+        BspNode::Brush *mBrushes;
+
+        /** Vector of player start points */
+        std::vector<ViewPoint> mPlayerStarts;
+
+        /** Internal utility function for loading data from Quake3. */
+        void loadQuake3Level(const Quake3Level& q3lvl);
+        /** Internal lookup table to determine visibility between leaves.
+            Leaf nodes are assigned to 'clusters' of nodes, which are used to group nodes together for
+            visibility testing. This data holds a lookup table which is used to determine if one cluster of leaves
+            is visible from another cluster. Whilst it would be possible to expand all this out so that
+            each node had a list of pointers to other visible nodes, this would be very expensive in terms
+            of storage (using the cluster method there is a table which is 1-bit squared per cluster, rounded
+            up to the nearest byte obviously, which uses far less space than 4-bytes per linked node per source
+            node). Of course the limitation here is that you have to each leaf in turn to determine if it is visible
+            rather than just following a list, but since this is only done once per frame this is not such a big
+            overhead.</p>
+            Each row in the table is a 'from' cluster, with each bit in the row corresponding to a 'to' cluster,
+            both ordered based on cluster index. A 0 in the bit indicates the 'to' cluster is not visible from the
+            'from' cluster, whilst a 1 indicates it is.</p>
+            As many will notice, this is lifted directly from the Quake implementation of PVS.
+        */
+        struct VisData
+        {
+            unsigned char *tableData;
+            int numClusters;            // Number of clusters, therefore number of rows
+            int rowLength;                // Length in bytes of each row (num clusters / 8 rounded up)
+        };
+
+        VisData mVisData;
+
+
+        /** Internal method for parsing chosen entities. */
+        void loadEntities(const Quake3Level& q3lvl);
+
+        typedef std::map<const MovableObject*, std::list<BspNode*> > MovableToNodeMap;
+        /// Map for locating the nodes a movable is currently a member of
+        MovableToNodeMap mMovableToNodeMap;
+
+        void tagNodesWithMovable(BspNode* node, const MovableObject* mov, const Vector3& pos);
+
+        // Storage of patches 
+        typedef std::map<int, PatchSurface*> PatchMap;
+        PatchMap mPatches;
+        // Total number of vertices required for all patches
+        size_t mPatchVertexCount;
+        // Total number of indexes required for all patches
+        size_t mPatchIndexCount;
+		// Sky enabled?
+		bool mSkyEnabled;
+		// Sky material
+		String mSkyMaterial;
+		// Sky details
+		Real mSkyCurvature;
+
+
+        void initQuake3Patches(const Quake3Level & q3lvl, VertexDeclaration* decl);
+        void buildQuake3Patches(size_t vertOffset, size_t indexOffset);
+
+        void quakeVertexToBspVertex(const bsp_vertex_t* src, BspVertex* dest);
+
+
+    };
+    /** Specialisation of SharedPtr to allow SharedPtr to be assigned to BspLevelPtr 
+    @note Has to be a subclass since we need operator=.
+    We could templatise this instead of repeating per Resource subclass, 
+    except to do so requires a form VC6 does not support i.e.
+    ResourceSubclassPtr<T> : public SharedPtr<T>
+    */
+    class BspLevelPtr : public SharedPtr<BspLevel> 
+    {
+    public:
+        BspLevelPtr() : SharedPtr<BspLevel>() {}
+        explicit BspLevelPtr(BspLevel* rep) : SharedPtr<BspLevel>(rep) {}
+        BspLevelPtr(const BspLevelPtr& r) : SharedPtr<BspLevel>(r) {} 
+        BspLevelPtr(const ResourcePtr& r) : SharedPtr<BspLevel>()
+        {
+			// lock & copy other mutex pointer
+			OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+            pRep = static_cast<BspLevel*>(r.getPointer());
+            pUseCount = r.useCountPointer();
+            if (pUseCount)
+            {
+                ++(*pUseCount);
+            }
+        }
+
+        /// Operator used to convert a ResourcePtr to a BspLevelPtr
+        BspLevelPtr& operator=(const ResourcePtr& r)
+        {
+            if (pRep == static_cast<BspLevel*>(r.getPointer()))
+                return *this;
+            release();
+			// lock & copy other mutex pointer
+			OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+            pRep = static_cast<BspLevel*>(r.getPointer());
+            pUseCount = r.useCountPointer();
+            if (pUseCount)
+            {
+                ++(*pUseCount);
+            }
+            return *this;
+        }
+    };
+
+}
+
+#endif
Index: /PlugIns/BSPSceneManager/include/OgreBspNode.h
===================================================================
--- /PlugIns/BSPSceneManager/include/OgreBspNode.h	(revision 5)
+++ /PlugIns/BSPSceneManager/include/OgreBspNode.h	(revision 5)
@@ -0,0 +1,213 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _BspNode_H__
+#define _BspNode_H__
+
+#include "OgreBspPrerequisites.h"
+#include "OgrePlane.h"
+#include "OgreAxisAlignedBox.h"
+#include "OgreSceneQuery.h"
+
+namespace Ogre {
+
+    /** Encapsulates a node in a BSP tree.
+        A BSP tree represents space partitioned by planes . The space which is
+        partitioned is either the world (in the case of the root node) or the space derived
+        from their parent node. Each node can have elements which are in front or behind it, which are
+        it's children and these elements can either be further subdivided by planes,
+        or they can be undivided spaces or 'leaf nodes' - these are the nodes which actually contain
+        objects and world geometry.The leaves of the tree are the stopping point of any tree walking algorithm,
+        both for rendering and collision detection etc.</p>
+        Ogre chooses not to represent splitting nodes and leaves as separate structures, but to merge the two for simplicity
+        of the walking algorithm. If a node is a leaf, the isLeaf() method returns true and both getFront() and
+        getBack() return null pointers. If the node is a partitioning plane isLeaf() returns false and getFront()
+        and getBack() will return the corresponding BspNode objects.
+    */
+    class BspNode
+    {
+        friend class BspLevel;
+
+    public:
+        /** Constructor, only to be used by BspLevel. */
+        BspNode(BspLevel* owner, bool isLeaf);
+
+        BspNode();
+        ~BspNode();
+
+        /** Returns true if this node is a leaf (i.e. contains geometry) or false if it is a splitting plane.
+            A BspNode can either be a splitting plane (the typical representation of a BSP node) or an undivided
+            region contining geometry (a leaf node). Ogre represents both using the same class for simplicity
+            of tree walking. However it is important that you use this method to determine which type you are dealing
+            with, since certain methods are only supported with one of the subtypes. Details are given in the individual methods.
+            Note that I could have represented splitting / leaf nodes as a class hierarchy but the
+            virtual methods / run-time type identification would have a performance hit, and it would not make the
+            code much (any?) simpler anyway. I think this is a fair trade-off in this case.
+        */
+        bool isLeaf(void) const;
+
+        /** Returns a pointer to a BspNode containing the subspace on the positive side of the splitting plane.
+            This method should only be called on a splitting node, i.e. where isLeaf() returns false. Calling this
+            method on a leaf node will throw an exception.
+        */
+        BspNode* getFront(void) const;
+
+        /** Returns a pointer to a BspNode containing the subspace on the negative side of the splitting plane.
+            This method should only be called on a splitting node, i.e. where isLeaf() returns false. Calling this
+            method on a leaf node will throw an exception.
+        */
+        BspNode* getBack(void) const;
+
+        /** Determines which side of the splitting plane a worldspace point is.
+            This method should only be called on a splitting node, i.e. where isLeaf() returns false. Calling this
+            method on a leaf node will throw an exception.
+        */
+        Plane::Side getSide (const Vector3& point) const;
+
+        /** Gets the next node down in the tree, with the intention of
+            locating the leaf containing the given point.
+            This method should only be called on a splitting node, i.e. where isLeaf() returns false. Calling this
+            method on a leaf node will throw an exception.
+        */
+        BspNode* getNextNode(const Vector3& point) const;
+
+
+        /** Returns details of the plane which is used to subdivide the space of his node's children.
+            This method should only be called on a splitting node, i.e. where isLeaf() returns false. Calling this
+            method on a leaf node will throw an exception.
+        */
+        const Plane& getSplitPlane(void) const;
+
+        /** Returns the axis-aligned box which contains this node if it is a leaf.
+            This method should only be called on a leaf node. It returns a box which can be used in calls like
+            Camera::isVisible to determine if the leaf node is visible in the view.
+        */
+        const AxisAlignedBox& getBoundingBox(void) const;
+
+        /** Returns the number of faces contained in this leaf node.
+            Should only be called on a leaf node.
+        */
+        int getNumFaceGroups(void) const;
+        /** Returns the index to the face group index list for this leaf node.
+            The contents of this buffer is a list of indexes which point to the
+            actual face groups held in a central buffer in the BspLevel class (in
+            actual fact for efficency the indexes themselves are also held in a single
+            buffer in BspLevel too). The reason for this indirection is that the buffer
+            of indexes to face groups is organised in chunks relative to nodes, whilst the
+            main buffer of face groups may not be.
+            Should only be called on a leaf node.
+        */
+        int getFaceGroupStart(void) const;
+
+        /** Determines if the passed in node (must also be a leaf) is visible from this leaf.
+            Must only be called on a leaf node, and the parameter must also be a leaf node. If
+            this method returns true, then the leaf passed in is visible from this leaf.
+            Note that internally this uses the Potentially Visible Set (PVS) which is precalculated
+            and stored with the BSP level.
+        */
+        bool isLeafVisible(const BspNode* leaf) const;
+
+        friend std::ostream& operator<< (std::ostream& o, BspNode& n);
+
+        /// Internal method for telling the node that a movable intersects it
+        void _addMovable(const MovableObject* mov);
+
+        /// Internal method for telling the node that a movable no longer intersects it
+        void _removeMovable(const MovableObject* mov);
+
+        /// Gets the signed distance to the dividing plane
+        Real getDistance(const Vector3& pos) const;
+
+        typedef std::set<const MovableObject*> IntersectingObjectSet;
+
+        struct Brush
+        {
+            std::list<Plane> planes;
+            SceneQuery::WorldFragment fragment; // For query reporting
+        };
+        typedef std::vector<Brush*> NodeBrushList; // Main brush memory held on level
+
+        /** Get the list of solid Brushes for this node.
+        @remarks Only applicable for leaf nodes. 
+        */
+        const NodeBrushList& getSolidBrushes(void) const;
+    protected:
+        BspLevel* mOwner; // Back-reference to containing level
+        bool mIsLeaf;
+
+        // Node-only members
+        /** The plane which splits space in a non-leaf node.
+            Note that nodes do not allocate the memory for other nodes - for simplicity and bulk-allocation
+            of memory the BspLevel is responsible for assigning enough memory for all nodes in one go.
+        */
+        Plane mSplitPlane;
+        /** Pointer to the node in front of this non-leaf node. */
+        BspNode* mFront;
+        /** Pointer to the node behind this non-leaf node. */
+        BspNode* mBack;
+
+        // Leaf-only members
+        /** The cluster number of this leaf.
+            Leaf nodes are assigned to 'clusters' of nodes, which are used to group nodes together for
+            visibility testing. There is a lookup table which is used to determine if one cluster of leaves
+            is visible from another cluster. Whilst it would be possible to expand all this out so that
+            each node had a list of pointers to other visible nodes, this would be very expensive in terms
+            of storage (using the cluster method there is a table which is 1-bit squared per cluster, rounded
+            up to the nearest byte obviously, which uses far less space than 4-bytes per linked node per source
+            node). Of course the limitation here is that you have to each leaf in turn to determine if it is visible
+            rather than just following a list, but since this is only done once per frame this is not such a big
+            overhead.
+        */
+        int mVisCluster;
+
+        /** The axis-aligned box which bounds node if it is a leaf. */
+        AxisAlignedBox mBounds;
+        /** Number of face groups in this node if it is a leaf. */
+        int mNumFaceGroups;
+        /** Index to the part of the main leaf facegroup index buffer(held in BspLevel) for this leaf.
+            This leaf uses mNumFaceGroups from this pointer onwards. From here you use the index
+            in this buffer to look up the actual face.
+            Note that again for simplicity and bulk memory allocation the face
+            group list itself is allocated by the BspLevel for all nodes, and each leaf node is given a section of it to
+            work on. This saves lots of small memory allocations / deallocations which limits memory fragmentation.
+        */
+        int mFaceGroupStart;
+
+        IntersectingObjectSet mMovables;
+
+        NodeBrushList mSolidBrushes;
+    public:
+        const IntersectingObjectSet& getObjects(void) const { return mMovables; }
+
+
+    };
+
+
+}
+
+#endif
Index: /PlugIns/BSPSceneManager/include/OgreBspPrerequisites.h
===================================================================
--- /PlugIns/BSPSceneManager/include/OgreBspPrerequisites.h	(revision 5)
+++ /PlugIns/BSPSceneManager/include/OgreBspPrerequisites.h	(revision 5)
@@ -0,0 +1,66 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __BspPrerequisites_H__
+#define __BspPrerequisites_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+    // Predeclare classes
+
+    class BspLevel;
+    class BspNode;
+    class BspResourceManager;
+    class BspSceneManager;
+    class Quake3Level;
+    class Quake3ShaderManager;
+    class Quake3Shader;
+
+#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) && !defined(OGRE_STATIC_LIB)
+#	ifdef OGRE_BSPPLUGIN_EXPORTS
+#		define _OgreBspPluginExport __declspec(dllexport)
+#	else
+#       if defined( __MINGW32__ )
+#           define _OgreBspPluginExport
+#       else
+#    		define _OgreBspPluginExport __declspec(dllimport)
+#       endif
+#   endif
+#elif defined ( OGRE_GCC_VISIBILITY )
+#    define _OgreBspPluginExport  __attribute__ ((visibility("default")))
+#else
+#	define _OgreBspPluginExport
+#endif	// OGRE_WIN32
+
+
+}
+
+
+#endif
Index: /PlugIns/BSPSceneManager/include/OgreBspResourceManager.h
===================================================================
--- /PlugIns/BSPSceneManager/include/OgreBspResourceManager.h	(revision 5)
+++ /PlugIns/BSPSceneManager/include/OgreBspResourceManager.h	(revision 5)
@@ -0,0 +1,111 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _BspLevelManager_H__
+#define _BspLevelManager_H__
+
+#include "OgreBspPrerequisites.h"
+#include "OgreResourceManager.h"
+#include "OgreSingleton.h"
+
+namespace Ogre {
+
+    /** Manages the locating and loading of BSP-based indoor levels.
+    Like other ResourceManager specialisations it manages the location and loading
+    of a specific type of resource, in this case files containing Binary
+    Space Partition (BSP) based level files e.g. Quake3 levels.</p>
+    However, note that unlike other ResourceManager implementations,
+    only 1 BspLevel resource is allowed to be loaded at one time. Loading
+    another automatically unloads the currently loaded level if any.
+    */
+    class BspResourceManager : public ResourceManager, public Singleton<BspResourceManager>
+    {
+    public:
+        BspResourceManager();
+        ~BspResourceManager();
+
+        /** Loads a BSP-based level from the named file.
+            Currently only supports loading of Quake3 .bsp files.
+        */
+        ResourcePtr load(const String& name, 
+            const String& group, bool isManual = false, 
+            ManualResourceLoader* loader = 0, const NameValuePairList* loadParams = 0);
+
+        /** Loads a BSP-based level from a stream.
+            Currently only supports loading of Quake3 .bsp files.
+        */
+        ResourcePtr load(DataStreamPtr& stream, const String& group);
+
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static BspResourceManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static BspResourceManager* getSingletonPtr(void);
+
+
+    protected:
+        /** @copydoc ResourceManager::createImpl. */
+        Resource* createImpl(const String& name, ResourceHandle handle, 
+            const String& group, bool isManual, ManualResourceLoader* loader, 
+            const NameValuePairList* createParams);
+
+        // Singleton managed by this class
+        Quake3ShaderManager *mShaderMgr;
+
+    };
+
+}
+
+#endif
Index: /PlugIns/BSPSceneManager/include/OgreBspSceneManager.h
===================================================================
--- /PlugIns/BSPSceneManager/include/OgreBspSceneManager.h	(revision 5)
+++ /PlugIns/BSPSceneManager/include/OgreBspSceneManager.h	(revision 5)
@@ -0,0 +1,282 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __BspSceneManager_H__
+#define __BspSceneManager_H__
+
+
+#include "OgreBspPrerequisites.h"
+#include "OgreSceneManager.h"
+#include "OgreStaticFaceGroup.h"
+#include "OgreRenderOperation.h"
+#include "OgreBspLevel.h"
+#include <set>
+
+
+namespace Ogre {
+
+
+    /** Specialisation of the SceneManager class to deal with indoor scenes
+        based on a BSP tree.
+        This class refines the behaviour of the default SceneManager to manage
+        a scene whose bulk of geometry is made up of an indoor environment which
+        is organised by a Binary Space Partition (BSP) tree. </p>
+        A BSP tree progressively subdivides the space using planes which are the nodes of the tree.
+        At some point we stop subdividing and everything in the remaining space is part of a 'leaf' which
+        contains a number of polygons. Typically we traverse the tree to locate the leaf in which a
+        point in space is (say the camera origin) and work from there. A second structure, the
+        Potentially Visible Set, tells us which other leaves can been seen from this
+        leaf, and we test their bounding boxes against the camera frustum to see which
+        we need to draw. Leaves are also a good place to start for collision detection since
+        they divide the level into discrete areas for testing.</p>
+        This BSP and PVS technique has been made famous by engines such as Quake and Unreal. Ogre
+        provides support for loading Quake3 level files to populate your world through this class,
+        by calling the BspSceneManager::setWorldGeometry. Note that this interface is made
+        available at the top level of the SceneManager class so you don't have to write your code
+        specifically for this class - just call Root::getSceneManager passing a SceneType of ST_INTERIOR
+        and in the current implementation you will get a BspSceneManager silently disguised as a
+        standard SceneManager.
+    */
+    class BspSceneManager : public SceneManager
+    {
+    protected:
+
+        // World geometry
+        BspLevelPtr mLevel;
+
+        // State variables for rendering WIP
+        // Set of face groups (by index) already included
+        typedef std::set<int> FaceGroupSet;
+        FaceGroupSet mFaceGroupSet;
+        // Material -> face group hashmap
+        typedef std::map<Material*, std::vector<StaticFaceGroup*>, materialLess > MaterialFaceGroupMap;
+        MaterialFaceGroupMap mMatFaceGroupMap;
+
+        RenderOperation mRenderOp;
+
+        // Debugging features
+        bool mShowNodeAABs;
+        RenderOperation mAABGeometry;
+
+        /** Walks the BSP tree looking for the node which the camera
+            is in, and tags any geometry which is in a visible leaf for
+            later processing.
+            @param camera Pointer to the viewpoint.
+            @returns The BSP node the camera was found in, for info.
+        */
+        BspNode* walkTree(Camera* camera, VisibleObjectsBoundsInfo* visibleBounds, bool onlyShadowCasters);
+        /** Tags geometry in the leaf specified for later rendering. */
+        void processVisibleLeaf(BspNode* leaf, Camera* cam, 
+			VisibleObjectsBoundsInfo* visibleBounds, bool onlyShadowCasters);
+
+        /** Caches a face group for imminent rendering. */
+        unsigned int cacheGeometry(unsigned int* pIndexes, const StaticFaceGroup* faceGroup);
+
+        /** Frees up allocated memory for geometry caches. */
+        void freeMemory(void);
+
+        /** Adds a bounding box to draw if turned on. */
+        void addBoundingBox(const AxisAlignedBox& aab, bool visible);
+
+        /** Renders the static level geometry tagged in walkTree. */
+        void renderStaticGeometry(void);
+
+		/** @copydoc SceneManager::clearScene */
+		void clearScene(void);
+
+
+        typedef std::set<const MovableObject*> MovablesForRendering;
+        MovablesForRendering mMovablesForRendering;
+
+    public:
+        BspSceneManager(const String& name);
+        ~BspSceneManager();
+
+
+		/// @copydoc SceneManager::getTypeName
+		const String& getTypeName(void) const;
+
+        /** Specialised from SceneManager to support Quake3 bsp files. */
+        void setWorldGeometry(const String& filename);
+
+        /** Specialised from SceneManager to support Quake3 bsp files. */
+        size_t estimateWorldGeometry(const String& filename);
+        
+        /** Specialised from SceneManager to support Quake3 bsp files. */
+        void setWorldGeometry(DataStreamPtr& stream, 
+			const String& typeName = StringUtil::BLANK);
+
+        /** Specialised from SceneManager to support Quake3 bsp files. */
+        size_t estimateWorldGeometry(DataStreamPtr& stream, 
+			const String& typeName = StringUtil::BLANK);
+
+		/** Tells the manager whether to draw the axis-aligned boxes that surround
+            nodes in the Bsp tree. For debugging purposes.
+        */
+        void showNodeBoxes(bool show);
+
+        /** Specialised to suggest viewpoints. */
+        ViewPoint getSuggestedViewpoint(bool random = false);
+
+        const BspLevelPtr& getLevel(void) {return mLevel; }
+
+        /** Overriden from SceneManager. */
+        void _findVisibleObjects(Camera* cam, VisibleObjectsBoundsInfo* visibleBounds, 
+			bool onlyShadowCasters);
+
+        /** Overriden from SceneManager. */
+        void _renderVisibleObjects(void);
+
+        /** Creates a specialized BspSceneNode */
+        SceneNode * createSceneNode ( void );
+        /** Creates a specialized BspSceneNode */
+        SceneNode * createSceneNode ( const String &name );
+
+        /** Internal method for tagging BspNodes with objects which intersect them. */
+        void _notifyObjectMoved(const MovableObject* mov, const Vector3& pos);
+		/** Internal method for notifying the level that an object has been detached from a node */
+		void _notifyObjectDetached(const MovableObject* mov);
+
+        /** Creates an AxisAlignedBoxSceneQuery for this scene manager. 
+        @remarks
+            This method creates a new instance of a query object for this scene manager, 
+            for an axis aligned box region. See SceneQuery and AxisAlignedBoxSceneQuery 
+            for full details.
+        @par
+            The instance returned from this method must be destroyed by calling
+            SceneManager::destroyQuery when it is no longer required.
+        @param box Details of the box which describes the region for this query.
+        @param mask The query mask to apply to this query; can be used to filter out
+            certain objects; see SceneQuery for details.
+        */
+        /*
+        virtual AxisAlignedBoxSceneQuery* 
+            createAABBQuery(const AxisAlignedBox& box, unsigned long mask = 0xFFFFFFFF);
+        */
+        /** Creates a SphereSceneQuery for this scene manager. 
+        @remarks
+            This method creates a new instance of a query object for this scene manager, 
+            for a spherical region. See SceneQuery and SphereSceneQuery 
+            for full details.
+        @par
+            The instance returned from this method must be destroyed by calling
+            SceneManager::destroyQuery when it is no longer required.
+        @param sphere Details of the sphere which describes the region for this query.
+        @param mask The query mask to apply to this query; can be used to filter out
+            certain objects; see SceneQuery for details.
+        */
+        /*
+        virtual SphereSceneQuery* 
+            createSphereQuery(const Sphere& sphere, unsigned long mask = 0xFFFFFFFF);
+        */
+        /** Creates a RaySceneQuery for this scene manager. 
+        @remarks
+            This method creates a new instance of a query object for this scene manager, 
+            looking for objects which fall along a ray. See SceneQuery and RaySceneQuery 
+            for full details.
+        @par
+            The instance returned from this method must be destroyed by calling
+            SceneManager::destroyQuery when it is no longer required.
+        @param ray Details of the ray which describes the region for this query.
+        @param mask The query mask to apply to this query; can be used to filter out
+            certain objects; see SceneQuery for details.
+        */
+        virtual RaySceneQuery* 
+            createRayQuery(const Ray& ray, unsigned long mask = 0xFFFFFFFF);
+        /** Creates an IntersectionSceneQuery for this scene manager. 
+        @remarks
+            This method creates a new instance of a query object for locating
+            intersecting objects. See SceneQuery and IntersectionSceneQuery
+            for full details.
+        @par
+            The instance returned from this method must be destroyed by calling
+            SceneManager::destroyQuery when it is no longer required.
+        @param mask The query mask to apply to this query; can be used to filter out
+            certain objects; see SceneQuery for details.
+        */
+        virtual IntersectionSceneQuery* 
+            createIntersectionQuery(unsigned long mask = 0xFFFFFFFF);
+
+    };
+
+    /** BSP specialisation of IntersectionSceneQuery */
+    class BspIntersectionSceneQuery : public DefaultIntersectionSceneQuery
+    {
+    public:
+        BspIntersectionSceneQuery(SceneManager* creator);
+
+        /** See IntersectionSceneQuery. */
+        void execute(IntersectionSceneQueryListener* listener);
+
+    };
+
+    /** BSP specialisation of RaySceneQuery */
+    class BspRaySceneQuery : public DefaultRaySceneQuery
+    {
+    public:
+        BspRaySceneQuery(SceneManager* creator);
+        ~BspRaySceneQuery();
+
+        /** See RaySceneQuery. */
+        void execute(RaySceneQueryListener* listener);
+    protected:
+        /// Set for eliminating duplicates since objects can be in > 1 node
+        std::set<MovableObject*> mObjsThisQuery;
+        /// list of the last single intersection world fragments (derived)
+        std::vector<SceneQuery::WorldFragment*> mSingleIntersections;
+
+        void clearTemporaries(void);
+        /** Internal processing of a single node.
+        @returns true if we should continue tracing, false otherwise
+        */
+        bool processNode(const BspNode* node, const Ray& tracingRay, RaySceneQueryListener* listener,
+            Real maxDistance = Math::POS_INFINITY, Real traceDistance = 0.0f);
+        /** Internal processing of a single leaf.
+        @returns true if we should continue tracing, false otherwise
+        */
+        bool processLeaf(const BspNode* node, const Ray& tracingRay, RaySceneQueryListener* listener,
+            Real maxDistance = Math::POS_INFINITY, Real traceDistance = 0.0f);
+
+    };
+
+	/// Factory for BspSceneManager
+	class BspSceneManagerFactory : public SceneManagerFactory
+	{
+	protected:
+		void initMetaData(void) const;
+	public:
+		BspSceneManagerFactory() {}
+		~BspSceneManagerFactory() {}
+		/// Factory type name
+		static const String FACTORY_TYPE_NAME;
+		SceneManager* createInstance(const String& instanceName);
+		void destroyInstance(SceneManager* instance);
+	};
+}
+
+#endif
Index: /PlugIns/BSPSceneManager/include/OgreBspSceneManagerPlugin.h
===================================================================
--- /PlugIns/BSPSceneManager/include/OgreBspSceneManagerPlugin.h	(revision 5)
+++ /PlugIns/BSPSceneManager/include/OgreBspSceneManagerPlugin.h	(revision 5)
@@ -0,0 +1,68 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __BspSceneManagerPlugin_H__
+#define __BspSceneManagerPlugin_H__
+
+#include "OgrePlugin.h"
+#include "OgreBspSceneManager.h"
+#include "OgreBspResourceManager.h"
+
+namespace Ogre
+{
+
+	/** Plugin instance for BSPSceneManager */
+	class BspSceneManagerPlugin : public Plugin
+	{
+	public:
+		BspSceneManagerPlugin();
+
+
+		/// @copydoc Plugin::getName
+		const String& getName() const;
+
+		/// @copydoc Plugin::install
+		void install();
+
+		/// @copydoc Plugin::initialise
+		void initialise();
+
+		/// @copydoc Plugin::shutdown
+		void shutdown();
+
+		/// @copydoc Plugin::uninstall
+		void uninstall();
+	protected:
+		BspSceneManagerFactory* mBspFactory;
+		BspResourceManager* mBspResourceManager;
+
+
+	};
+}
+
+#endif
Index: /PlugIns/BSPSceneManager/include/OgreBspSceneNode.h
===================================================================
--- /PlugIns/BSPSceneManager/include/OgreBspSceneNode.h	(revision 5)
+++ /PlugIns/BSPSceneManager/include/OgreBspSceneNode.h	(revision 5)
@@ -0,0 +1,80 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __BSPSCENENODE_H__
+#define __BSPSCENENODE_H__
+
+#include "OgreBspPrerequisites.h"
+#include "OgreSceneNode.h"
+
+namespace Ogre {
+
+    /** Specialisation of SceneNode for the BspSceneManager.
+    @remarks
+        This specialisation of SceneNode is to enable information about the
+        leaf node in which any attached objects are held is stored for
+        use in the visibility determination. 
+    @par
+        Do not confuse this class with BspNode, which reflects nodes in the
+        BSP tree itself. This class is just like a regular SceneNode, except that
+        it should be locating BspNode leaf elements which objects should be included
+        in. Note that because objects are movable, and thus may very well be overlapping
+        the boundaries of more than one leaf, that it is possible that an object attached
+        to one BspSceneNode may actually be associated with more than one BspNode.
+    */
+    class BspSceneNode : public SceneNode
+    {
+	protected:
+		/// Overridden from SceneNode
+		void setInSceneGraph(bool inGraph);		
+    public:
+        BspSceneNode(SceneManager* creator) : SceneNode(creator) {}
+        BspSceneNode(SceneManager* creator, const String& name) 
+            : SceneNode(creator, name) {}
+        /// Overridden from Node
+        void _update(bool updateChildren, bool parentHasChanged);
+        /** Detaches the indexed object from this scene node.
+        @remarks
+            Detaches by index, see the alternate version to detach by name. Object indexes
+            may change as other objects are added / removed.
+        */
+        MovableObject* detachObject(unsigned short index);
+
+        /** Detaches the named object from this node and returns a pointer to it. */
+        MovableObject* detachObject(const String& name);
+
+        /** Detaches all objects attached to this node.
+        */
+        void detachAllObjects(void);
+
+
+    };
+
+}
+
+#endif
Index: /PlugIns/BSPSceneManager/include/OgreQuake3Level.h
===================================================================
--- /PlugIns/BSPSceneManager/include/OgreQuake3Level.h	(revision 5)
+++ /PlugIns/BSPSceneManager/include/OgreQuake3Level.h	(revision 5)
@@ -0,0 +1,168 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Quake3Level_H__
+#define __Quake3Level_H__
+
+#include "OgreBspPrerequisites.h"
+#include "OgreQuake3Types.h"
+#include "OgreDataStream.h"
+
+
+namespace Ogre {
+
+    /** Support for loading and extracting data from a Quake3 level file.
+    This class implements the required methods for opening Quake3 level files
+    and extracting the pertinent data within. Ogre supports BSP based levels
+    through it's own BspLevel class, which is not specific to any file format,
+    so this class is here to source that data from the Quake3 format.</p>
+    Quake3 levels include far more than just data for rendering - typically the
+    <strong>leaves</strong> of the tree are used for rendering, and <strong>brushes,</strong>
+    are used to    define convex hulls made of planes for collision detection. There are also
+    <strong>entities</strong> which define non-visual elements like player start
+    points, triggers etc and <strong>models</strong> which are used for movable
+    scenery like doors and platforms. <strong>Shaders</strong> meanwhile are textures
+    with extra effects and 'content flags' indicating special properties like
+    water or lava.</p>
+    I will try to support as much of this as I can in Ogre, but I won't duplicate
+    the structure or necesarily use the same terminology. Quake3 is designed for a very specific
+    purpose and code structure, whereas Ogre is designed to be more flexible,
+    so for example I'm likely to separate game-related properties like surface flags
+    from the generics of materials in my implementation.</p>
+    This is a utility class only - a single call to loadFromChunk should be
+    enough. You should not expect the state of this object to be consistent
+    between calls, since it uses pointers to memory which may no longer
+    be valid after the original call. This is why it has no accessor methods
+    for reading it's internal state.
+    */
+    class Quake3Level
+    {
+    public:
+        Quake3Level();
+
+        /** Load just the header information from a Quake3 file. 
+        @remarks
+            This method loads just the header information from the 
+            Quake3 file, in order to estimate the loading time.
+        */
+        void loadHeaderFromStream(DataStreamPtr& inStream);
+
+        /** Reads Quake3 bsp data from a stream as read from the file.
+            Since ResourceManagers generally locate data in a variety of
+            places they typically manipulate them as a chunk of data, rather than
+            a file pointer since this is unsupported through compressed archives.</p>
+            Quake3 files are made up of a header (which contains version info and
+            a table of the contents) and 17 'lumps' i.e. sections of data,
+            the offsets to which are kept in the table of contents. The 17 types
+            are predefined (You can find them in OgreQuake3Types.h)
+
+            @param inStream Stream containing Quake3 data
+        */
+        void loadFromStream(DataStreamPtr& inStream);
+
+        /* Extracts the embedded lightmap texture data and loads them as textures.
+           Calling this method makes the lightmap texture data embedded in
+           the .bsp file available to the renderer. Lightmaps are extracted
+           and loaded as Texture objects (subclass specific to RenderSystem
+           subclass) and are named "@lightmap1", "@lightmap2" etc.
+        */
+        void extractLightmaps(void) const;
+
+        /** Utility function read the header and set up pointers. */
+        void initialise(bool headerOnly = false);
+        /** Utility function read the header and set up counters. */
+        void initialiseCounts(void);
+        /** Utility function read the header and set up pointers. */
+        void initialisePointers(void);
+
+        /** Utility function to return a pointer to a lump. */
+        void* getLump(int lumpType);
+        int getLumpSize(int lumpType);
+
+        /** Debug method. */
+        void dumpContents(void);
+
+        // Internal storage
+        // This is ALL temporary. Don't rely on it being static
+        MemoryDataStreamPtr mChunk;
+
+        // NB no brushes, fog or local lightvolumes yet
+        bsp_header_t* mHeader;
+        unsigned char* mLumpStart;
+
+        int* mElements; // vertex indexes for faces
+        int mNumElements;
+
+        void* mEntities;
+        int mNumEntities;
+
+        bsp_model_t* mModels;
+        int mNumModels;
+
+        bsp_node_t* mNodes;
+        int mNumNodes;
+
+        bsp_leaf_t* mLeaves;
+        int mNumLeaves;
+
+        int* mLeafFaces;     // Indexes to face groups by leaf
+        int mNumLeafFaces;
+
+        bsp_plane_t* mPlanes;
+        int mNumPlanes;
+
+        bsp_face_t* mFaces;      // Groups of faces
+        int mNumFaces;
+
+        bsp_vertex_t* mVertices;
+        int mNumVertices;
+
+        bsp_shader_t* mShaders;
+        int mNumShaders;
+
+        unsigned char* mLightmaps;
+        int mNumLightmaps;
+
+        bsp_vis_t* mVis;
+
+        bsp_brush_t* mBrushes;
+        int mNumBrushes;
+
+        bsp_brushside_t* mBrushSides;
+        int mNumBrushSides;
+
+        int* mLeafBrushes;      // Groups of indexes to brushes by leaf
+        int mNumLeafBrushes;
+
+
+
+    };
+}
+
+
+#endif
Index: /PlugIns/BSPSceneManager/include/OgreQuake3Shader.h
===================================================================
--- /PlugIns/BSPSceneManager/include/OgreQuake3Shader.h	(revision 5)
+++ /PlugIns/BSPSceneManager/include/OgreQuake3Shader.h	(revision 5)
@@ -0,0 +1,120 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __QUAKE3SHADER_H__
+#define __QUAKE3SHADER_H__
+
+#include "OgreResource.h"
+#include "OgreBspPrerequisites.h"
+#include "OgreQuake3Types.h"
+#include "OgreCommon.h"
+#include "OgreColourValue.h"
+#include "OgreBlendMode.h"
+#include "OgreTextureUnitState.h"
+
+namespace Ogre {
+
+
+    /** Class for recording Quake3 shaders.
+        This is a temporary holding area since shaders are actually converted into
+        Material objects for use in the engine proper. However, because we have to read
+        in shader definitions en masse (because they are stored in shared .shader files)
+        without knowing which will actually be used, we store their definitions here
+        temporarily since their instantiations as Materials would use precious resources
+        because of the automatic loading of textures etc.
+    */
+    class Quake3Shader 
+    {
+    protected:
+        String getAlternateName(const String& texName);
+        String mName;
+
+    public:
+
+        /** Default constructor - used by Quake3ShaderManager (do not call directly) */
+        Quake3Shader(const String& name);
+        ~Quake3Shader();
+
+        /** Creates this shader as an OGRE material.
+            Creates a new material based on this shaders settings. 
+            Material name shader#lightmap.
+        */
+        MaterialPtr createAsMaterial(int lightmapNumber);
+
+        struct Pass {
+            unsigned int flags;
+            String textureName;
+            TexGen texGen;
+            // Multitexture blend
+            LayerBlendOperation blend;
+            // Multipass blends (Quake3 only supports multipass?? Surely not?)
+            SceneBlendFactor blendSrc;
+            SceneBlendFactor blendDest;
+            bool customBlend;
+            CompareFunction depthFunc;
+            TextureUnitState::TextureAddressingMode addressMode;
+            // TODO - alphaFunc
+            GenFunc rgbGenFunc;
+            WaveType rgbGenWave;
+            Real rgbGenParams[4];    // base, amplitude, phase, frequency
+            Real tcModScale[2];
+            Real tcModRotate;
+            Real tcModScroll[2];
+            Real tcModTransform[6];
+            bool tcModTurbOn;
+            Real tcModTurb[4];
+            WaveType tcModStretchWave;
+            Real tcModStretchParams[4];    // base, amplitude, phase, frequency
+            CompareFunction alphaFunc;
+            unsigned char alphaVal;
+
+            Real animFps;
+            unsigned int animNumFrames;
+            String frames[32];
+        };
+
+        unsigned int flags;
+        int numPasses;
+        typedef std::vector<Pass> PassList;
+        PassList pass;
+        bool farbox;            // Skybox
+        String farboxName;
+        bool skyDome;
+        Real cloudHeight;       // Skydome
+        DeformFunc deformFunc;
+        Real deformParams[5];
+        ManualCullingMode cullMode;
+
+        bool fog;
+        ColourValue fogColour;
+        Real fogDistance;
+
+    };
+}
+
+#endif
Index: /PlugIns/BSPSceneManager/include/OgreQuake3ShaderManager.h
===================================================================
--- /PlugIns/BSPSceneManager/include/OgreQuake3ShaderManager.h	(revision 5)
+++ /PlugIns/BSPSceneManager/include/OgreQuake3ShaderManager.h	(revision 5)
@@ -0,0 +1,126 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __QUAKE3SHADERMANAGER_H__
+#define __QUAKE3SHADERMANAGER_H__
+
+#include "OgreBspPrerequisites.h"
+#include "OgreSingleton.h"
+#include "OgreResourceManager.h"
+#include "OgreQuake3Shader.h"
+#include "OgreBlendMode.h"
+
+namespace Ogre {
+
+
+    /** Class for managing Quake3 custom shaders.
+        Quake3 uses .shader files to define custom shaders, or Materials in Ogre-speak.
+        When a surface texture is mentioned in a level file, it includes no file extension
+        meaning that it can either be a standard texture image (+lightmap) if there is only a .jpg or .tga
+        file, or it may refer to a custom shader if a shader with that name is included in one of the .shader
+        files in the scripts/ folder. Because there are multiple shaders per file you have to parse all the
+        .shader files available to know if there is a custom shader available. This class is designed to parse
+        all the .shader files available and save their settings for future use. </p>
+        I choose not to set up Material instances for shaders found since they may or may not be used by a level,
+        so it would be very wasteful to set up Materials since they load texture images for each layer (apart from the
+        lightmap). Once the usage of a shader is confirmed, a full Material instance can be set up from it.</p>
+        Because this is a subclass of ScriptLoader, any files mentioned will be searched for in any path or
+        archive added to the ResourceGroupManager::WORLD_GROUP_NAME group. See ResourceGroupManager for details.
+    */
+    class Quake3ShaderManager : public ScriptLoader, public Singleton<Quake3ShaderManager>
+    {
+    protected:
+        void parseNewShaderPass(DataStreamPtr& stream, Quake3Shader* pShader);
+        void parseShaderAttrib( const String& line, Quake3Shader* pShader);
+        void parseShaderPassAttrib( const String& line, Quake3Shader* pShader, Quake3Shader::Pass* pPass);
+        SceneBlendFactor convertBlendFunc( const String& q3func);
+
+        typedef std::map<String, Quake3Shader*> Quake3ShaderMap;
+        Quake3ShaderMap mShaderMap;
+        StringVector mScriptPatterns;
+
+
+    public:
+        Quake3ShaderManager();
+        virtual ~Quake3ShaderManager();
+
+        /** @copydoc ScriptLoader::getScriptPatterns */
+        const StringVector& getScriptPatterns(void) const;
+
+        /** @copydoc ScriptLoader::parseScript */
+        void parseScript(DataStreamPtr& stream, const String& groupName);
+
+        /** @copydoc ScriptLoader::parseScript */
+        Real getLoadingOrder(void) const;
+
+        /** Create implementation. */
+        Quake3Shader* create(const String& name);
+        /** Clear all the current shaders */
+        void clear(void);
+        /** Retrieve a Quake3Shader by name */
+        Quake3Shader* getByName(const String& name);
+
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static Quake3ShaderManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static Quake3ShaderManager* getSingletonPtr(void);
+
+
+    };
+
+}
+
+#endif
Index: /PlugIns/BSPSceneManager/include/OgreQuake3Types.h
===================================================================
--- /PlugIns/BSPSceneManager/include/OgreQuake3Types.h	(revision 5)
+++ /PlugIns/BSPSceneManager/include/OgreQuake3Types.h	(revision 5)
@@ -0,0 +1,250 @@
+// Quake 3 data definitions
+// Copyright (C) 1999-2000 Id Software, Inc.
+//
+// This file must be identical in the quake and utils directories
+
+// contents flags are seperate bits
+// a given brush can contribute multiple content bits
+
+// these definitions also need to be in q_shared.h!
+#ifndef __Quake3Types_H__
+#define __Quake3Types_H__
+
+
+#define BSP_HEADER_ID   (*(int*)"IBSP")
+#define BSP_HEADER_VER  (46)
+
+#define BSP_ENTITIES_LUMP   (0)
+#define BSP_SHADERS_LUMP    (1)
+#define BSP_PLANES_LUMP     (2)
+#define BSP_NODES_LUMP      (3)
+#define BSP_LEAVES_LUMP     (4)
+#define BSP_LFACES_LUMP     (5)
+#define BSP_LBRUSHES_LUMP   (6)
+#define BSP_MODELS_LUMP     (7)
+#define BSP_BRUSH_LUMP      (8)
+#define BSP_BRUSHSIDES_LUMP (9)
+#define BSP_VERTICES_LUMP   (10)
+#define BSP_ELEMENTS_LUMP   (11)
+#define BSP_FOG_LUMP        (12)
+#define BSP_FACES_LUMP      (13)
+#define BSP_LIGHTMAPS_LUMP  (14)
+#define BSP_LIGHTVOLS_LUMP  (15)
+#define BSP_VISIBILITY_LUMP (16)
+
+#define BSP_LIGHTMAP_BANKSIZE   (128*128*3)
+
+
+#define    CONTENTS_SOLID            1        // an eye is never valid in a solid
+#define    CONTENTS_LAVA            8
+#define    CONTENTS_SLIME            16
+#define    CONTENTS_WATER            32
+#define    CONTENTS_FOG            64
+
+#define    CONTENTS_AREAPORTAL        0x8000
+
+#define    CONTENTS_PLAYERCLIP        0x10000
+#define    CONTENTS_MONSTERCLIP    0x20000
+//bot specific contents types
+#define    CONTENTS_TELEPORTER        0x40000
+#define    CONTENTS_JUMPPAD        0x80000
+#define CONTENTS_CLUSTERPORTAL    0x100000
+#define CONTENTS_DONOTENTER        0x200000
+
+#define    CONTENTS_ORIGIN            0x1000000    // removed before bsping an entity
+
+#define    CONTENTS_BODY            0x2000000    // should never be on a brush, only in game
+#define    CONTENTS_CORPSE            0x4000000
+#define    CONTENTS_DETAIL            0x8000000    // brushes not used for the bsp
+#define    CONTENTS_STRUCTURAL        0x10000000    // brushes used for the bsp
+#define    CONTENTS_TRANSLUCENT    0x20000000    // don't consume surface fragments inside
+#define    CONTENTS_TRIGGER        0x40000000
+#define    CONTENTS_NODROP            0x80000000    // don't leave bodies or items (death fog, lava)
+
+#define    SURF_NODAMAGE            0x1        // never give falling damage
+#define    SURF_SLICK                0x2        // effects game physics
+#define    SURF_SKY                0x4        // lighting from environment map
+#define    SURF_LADDER                0x8
+#define    SURF_NOIMPACT            0x10    // don't make missile explosions
+#define    SURF_NOMARKS            0x20    // don't leave missile marks
+#define    SURF_FLESH                0x40    // make flesh sounds and effects
+#define    SURF_NODRAW                0x80    // don't generate a drawsurface at all
+#define    SURF_HINT                0x100    // make a primary bsp splitter
+#define    SURF_SKIP                0x200    // completely ignore, allowing non-closed brushes
+#define    SURF_NOLIGHTMAP            0x400    // surface doesn't need a lightmap
+#define    SURF_POINTLIGHT            0x800    // generate lighting info at vertexes
+#define    SURF_METALSTEPS            0x1000    // clanking footsteps
+#define    SURF_NOSTEPS            0x2000    // no footstep sounds
+#define    SURF_NONSOLID            0x4000    // don't collide against curves with this set
+#define SURF_LIGHTFILTER        0x8000    // act as a light filter during q3map -light
+#define    SURF_ALPHASHADOW        0x10000    // do per-pixel light shadow casting in q3map
+#define    SURF_NODLIGHT            0x20000    // don't dlight even if solid (solid lava, skies)
+
+/* Shader flags */
+enum
+{
+    SHADER_NOCULL        = 1 << 0,
+    SHADER_TRANSPARENT   = 1 << 1,
+    SHADER_DEPTHWRITE    = 1 << 2,
+    SHADER_SKY           = 1 << 3,
+    SHADER_NOMIPMAPS     = 1 << 4,
+    SHADER_NEEDCOLOURS   = 1 << 5,
+    SHADER_DEFORMVERTS   = 1 << 6
+};
+
+/* Shaderpass flags */
+enum
+{
+    SHADER_LIGHTMAP   = 1 << 0,
+    SHADER_BLEND      = 1 << 1,
+    SHADER_ALPHAFUNC  = 1 << 3,
+    SHADER_TCMOD      = 1 << 4,
+    SHADER_ANIMMAP    = 1 << 5,
+    SHADER_TCGEN_ENV  = 1 << 6
+};
+
+/* Transform functions */
+enum WaveType
+{
+    SHADER_FUNC_NONE            = 0,
+    SHADER_FUNC_SIN             = 1,
+    SHADER_FUNC_TRIANGLE        = 2,
+    SHADER_FUNC_SQUARE          = 3,
+    SHADER_FUNC_SAWTOOTH        = 4,
+    SHADER_FUNC_INVERSESAWTOOTH = 5
+};
+
+/* *Gen functions */
+enum GenFunc
+{
+    SHADER_GEN_IDENTITY = 0,
+    SHADER_GEN_WAVE     = 1,
+    SHADER_GEN_VERTEX   = 2
+};
+
+enum TexGen
+{
+    TEXGEN_BASE = 0,        // Coord set 0
+    TEXGEN_LIGHTMAP = 1,    // Coord set 1
+    TEXGEN_ENVIRONMENT = 2  // Neither, generated
+};
+
+enum DeformFunc
+{
+    DEFORM_FUNC_NONE = 0,
+    DEFORM_FUNC_BULGE = 1,
+    DEFORM_FUNC_WAVE = 2,
+    DEFORM_FUNC_NORMAL = 3,
+    DEFORM_FUNC_MOVE = 4,
+    DEFORM_FUNC_AUTOSPRITE = 5,
+    DEFORM_FUNC_AUTOSPRITE2 = 6
+
+};
+/////////////////////////////////////////////////////////
+//
+// bsp contents
+//
+
+struct bsp_plane_t {
+    float normal[3];
+    float dist;
+};
+
+struct bsp_model_t {
+    float bbox[6];
+    int face_start;
+    int face_count;
+    int brush_start;
+    int brush_count;
+};
+
+struct bsp_node_t {
+    int plane;          // dividing plane
+    //int children[2];    // left and right nodes,
+                        // negative are leaves
+    int front;
+    int back;
+    int bbox[6];
+};
+
+struct bsp_leaf_t {
+    int cluster;    // visibility cluster number
+    int area;
+    int bbox[6];
+    int face_start;
+    int face_count;
+    int brush_start;
+    int brush_count;
+};
+
+#define BSP_FACETYPE_NORMAL (1)
+#define BSP_FACETYPE_PATCH  (2)
+#define BSP_FACETYPE_MESH   (3)
+#define BSP_FACETYPE_FLARE  (4)
+
+struct bsp_face_t {
+    int shader;         // shader ref
+    int unknown;
+    int type;           // face type
+    int vert_start;
+    int vert_count;
+    int elem_start;
+    int elem_count;
+    int lm_texture;     // lightmap
+    int lm_offset[2];
+    int lm_size[2];
+    float org[3];       // facetype_normal only
+    float bbox[6];      // facetype_patch only
+    float normal[3];    // facetype_normal only
+    int mesh_cp[2];     // patch control point dims
+};
+
+struct bsp_shader_t {
+    char name[64];
+    int surface_flags;
+    int content_flags;
+};
+
+struct bsp_vertex_t {
+    float point[3];
+    float texture[2];
+    float lightmap[2];
+    float normal[3];
+    int color;
+};
+
+struct bsp_vis_t {
+    int cluster_count;
+    int row_size;
+    unsigned char data[1];
+};
+
+// OGRE additions
+struct bsp_lump_entry_t {
+    int offset;
+    int size;
+};
+struct bsp_header_t {
+    char magic[4];
+    int version;
+    bsp_lump_entry_t lumps[17];
+};
+
+//
+// Brushes sides in BSP tree
+//
+struct bsp_brushside_t {
+	int planenum;
+	int content;			// ??shader??
+};
+
+
+//
+// Brushes in BSP tree
+//
+struct bsp_brush_t {
+	int firstside;
+	int numsides;
+	int shaderIndex;
+};
+#endif
Index: /PlugIns/BSPSceneManager/obj/Debug/.keepme
===================================================================
--- /PlugIns/BSPSceneManager/obj/Debug/.keepme	(revision 5)
+++ /PlugIns/BSPSceneManager/obj/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager.cbp
===================================================================
--- /PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager.cbp	(revision 5)
+++ /PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager.cbp	(revision 5)
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Plugin_BSPSceneManager" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\lib\Plugin_BSPSceneManager_d.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\lib\Plugin_BSPSceneManager.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O2" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add option="-D_USRDLL" />
+			<Add option="-DOGRE_BSPPLUGIN_EXPORTS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\OgreBspLevel.h" />
+		<Unit filename="..\include\OgreBspNode.h" />
+		<Unit filename="..\include\OgreBspPrerequisites.h" />
+		<Unit filename="..\include\OgreBspResourceManager.h" />
+		<Unit filename="..\include\OgreBspSceneManager.h" />
+		<Unit filename="..\include\OgreBspSceneManagerPlugin.h" />
+		<Unit filename="..\include\OgreBspSceneNode.h" />
+		<Unit filename="..\include\OgreQuake3Level.h" />
+		<Unit filename="..\include\OgreQuake3Shader.h" />
+		<Unit filename="..\include\OgreQuake3ShaderManager.h" />
+		<Unit filename="..\include\OgreQuake3Types.h" />
+		<Unit filename="..\misc\OgreBspSceneManager.def" />
+		<Unit filename="..\src\OgreBspLevel.cpp" />
+		<Unit filename="..\src\OgreBspNode.cpp" />
+		<Unit filename="..\src\OgreBspResourceManager.cpp" />
+		<Unit filename="..\src\OgreBspSceneManager.cpp" />
+		<Unit filename="..\src\OgreBspSceneManagerDll.cpp" />
+		<Unit filename="..\src\OgreBspSceneManagerPlugin.cpp" />
+		<Unit filename="..\src\OgreBspSceneNode.cpp" />
+		<Unit filename="..\src\OgreQuake3Level.cpp" />
+		<Unit filename="..\src\OgreQuake3Shader.cpp" />
+		<Unit filename="..\src\OgreQuake3ShaderManager.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager.vcproj
===================================================================
--- /PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager.vcproj	(revision 5)
+++ /PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager.vcproj	(revision 5)
@@ -0,0 +1,319 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Plugin_BSPSceneManager"
+	ProjectGUID="{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_BSPPLUGIN_EXPORTS"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="2"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain_d.lib"
+				OutputFile="$(OutDir)/$(ProjectName)_d.dll"
+				Version="0.99"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName)_d.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_BSPPLUGIN_EXPORTS"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain.lib"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_BSPPLUGIN_EXPORTS;OGRE_STATIC_LIB"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="2"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)/$(ProjectName)Static_d.lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_BSPPLUGIN_EXPORTS;OGRE_STATIC_LIB"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)/$(ProjectName)Static.lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\OgreBspLevel.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreBspNode.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreBspResourceManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreBspSceneManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreBspSceneManagerDll.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreBspSceneManagerPlugin.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreBspSceneNode.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreQuake3Level.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreQuake3Shader.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreQuake3ShaderManager.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\OgreBspLevel.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreBspNode.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreBspPrerequisites.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreBspResourceManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreBspSceneManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreBspSceneManagerPlugin.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreBspSceneNode.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreQuake3Level.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreQuake3Shader.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreQuake3ShaderManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreQuake3Types.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp
===================================================================
--- /PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp	(revision 5)
+++ /PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_linux.cbp	(revision 5)
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Plugin_BSPSceneManager" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../../lib/Plugin_BSPSceneManager_d.so" prefix_auto="0" extension_auto="0" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cp $($(TARGET_NAME)_OUTPUT_FILE) ../../../Samples/Common/bin/$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../../lib/Plugin_BSPSceneManager.so" prefix_auto="0" extension_auto="0" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O2" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cp $($(TARGET_NAME)_OUTPUT_FILE) ../../../Samples/Common/bin/$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-fvisibility=hidden" />
+			<Add option="-fvisibility-inlines-hidden" />
+			<Add option="-fPIC" />
+			<Add option="-DOGRE_BSPPLUGIN_EXPORTS" />
+			<Add option="-DPIC" />
+			<Add option="-DOGRE_GCC_VISIBILITY" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../../Samples/Common/bin/$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="../include/OgreBspLevel.h" />
+		<Unit filename="../include/OgreBspNode.h" />
+		<Unit filename="../include/OgreBspPrerequisites.h" />
+		<Unit filename="../include/OgreBspResourceManager.h" />
+		<Unit filename="../include/OgreBspSceneManager.h" />
+		<Unit filename="../include/OgreBspSceneManagerPlugin.h" />
+		<Unit filename="../include/OgreBspSceneNode.h" />
+		<Unit filename="../include/OgreQuake3Level.h" />
+		<Unit filename="../include/OgreQuake3Shader.h" />
+		<Unit filename="../include/OgreQuake3ShaderManager.h" />
+		<Unit filename="../include/OgreQuake3Types.h" />
+		<Unit filename="../src/OgreBspLevel.cpp" />
+		<Unit filename="../src/OgreBspNode.cpp" />
+		<Unit filename="../src/OgreBspResourceManager.cpp" />
+		<Unit filename="../src/OgreBspSceneManager.cpp" />
+		<Unit filename="../src/OgreBspSceneManagerDll.cpp" />
+		<Unit filename="../src/OgreBspSceneManagerPlugin.cpp" />
+		<Unit filename="../src/OgreBspSceneNode.cpp" />
+		<Unit filename="../src/OgreQuake3Level.cpp" />
+		<Unit filename="../src/OgreQuake3Shader.cpp" />
+		<Unit filename="../src/OgreQuake3ShaderManager.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_stlp.cbp
===================================================================
--- /PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_stlp.cbp	(revision 5)
+++ /PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_stlp.cbp	(revision 5)
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Plugin_BSPSceneManager" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\lib\Plugin_BSPSceneManager_d.dll" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\lib\Plugin_BSPSceneManager.dll" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O2" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="stlport.5.1" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add option="-D_USRDLL" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\OgreBspLevel.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreBspNode.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreBspPrerequisites.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreBspResourceManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreBspSceneManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreBspSceneManagerPlugin.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreBspSceneNode.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreQuake3Level.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreQuake3Shader.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreQuake3ShaderManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreQuake3Types.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\misc\OgreBspSceneManager.def">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreBspLevel.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreBspNode.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreBspResourceManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreBspSceneManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreBspSceneManagerPlugin.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreBspSceneManagerDll.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreBspSceneNode.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreQuake3Level.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreQuake3Shader.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreQuake3ShaderManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_vc8.vcproj
===================================================================
--- /PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_vc8.vcproj	(revision 5)
+++ /PlugIns/BSPSceneManager/scripts/Plugin_BSPSceneManager_vc8.vcproj	(revision 5)
@@ -0,0 +1,452 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Plugin_BSPSceneManager"
+	ProjectGUID="{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_BSPPLUGIN_EXPORTS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain_d.lib"
+				OutputFile="$(OutDir)/Plugin_BSPSceneManager_d.dll"
+				Version=""
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName)_d.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/Plugin_BSPSceneManager_d.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				EnableFiberSafeOptimizations="true"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_BSPPLUGIN_EXPORTS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain.lib"
+				OutputFile="$(OutDir)/Plugin_BSPSceneManager.dll"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/Plugin_BSPSceneManager.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_STATIC_LIB"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)\$(ProjectName)Static_d.lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				EnableFiberSafeOptimizations="true"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_STATIC_LIB"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)\$(ProjectName)Static.lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine=""
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\OgreBspLevel.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreBspNode.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreBspResourceManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreBspSceneManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreBspSceneManagerDll.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreBspSceneManagerPlugin.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreBspSceneNode.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreQuake3Level.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreQuake3Shader.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreQuake3ShaderManager.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\OgreBspLevel.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreBspNode.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreBspPrerequisites.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreBspResourceManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreBspSceneManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreBspSceneManagerPlugin.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreBspSceneNode.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreQuake3Level.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreQuake3Shader.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreQuake3ShaderManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreQuake3Types.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /PlugIns/BSPSceneManager/src/Makefile.am
===================================================================
--- /PlugIns/BSPSceneManager/src/Makefile.am	(revision 5)
+++ /PlugIns/BSPSceneManager/src/Makefile.am	(revision 5)
@@ -0,0 +1,18 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/PlugIns/BSPSceneManager/include -I$(top_srcdir)/OgreMain/include
+
+pkglib_LTLIBRARIES = Plugin_BSPSceneManager.la
+
+Plugin_BSPSceneManager_la_SOURCES = OgreBspLevel.cpp \
+                             OgreBspNode.cpp \
+                             OgreBspResourceManager.cpp \
+                             OgreBspSceneManager.cpp \
+                             OgreBspSceneManagerDll.cpp \
+							 OgreBspSceneManagerPlugin.cpp \
+							 OgreBspSceneNode.cpp \
+                             OgreQuake3ShaderManager.cpp \
+                             OgreQuake3Shader.cpp \
+                             OgreQuake3Level.cpp
+
+
+Plugin_BSPSceneManager_la_LDFLAGS = -module $(PLUGIN_FLAGS) -L$(top_builddir)/OgreMain/src -Wl,-z,defs
+Plugin_BSPSceneManager_la_LIBADD = -lOgreMain -lc $(OGRE_THREAD_LIBS)
Index: /PlugIns/BSPSceneManager/src/Makefile.in
===================================================================
--- /PlugIns/BSPSceneManager/src/Makefile.in	(revision 5)
+++ /PlugIns/BSPSceneManager/src/Makefile.in	(revision 5)
@@ -0,0 +1,554 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = PlugIns/BSPSceneManager/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+pkglibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+Plugin_BSPSceneManager_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_Plugin_BSPSceneManager_la_OBJECTS = OgreBspLevel.lo OgreBspNode.lo \
+	OgreBspResourceManager.lo OgreBspSceneManager.lo \
+	OgreBspSceneManagerDll.lo OgreBspSceneManagerPlugin.lo \
+	OgreBspSceneNode.lo OgreQuake3ShaderManager.lo \
+	OgreQuake3Shader.lo OgreQuake3Level.lo
+Plugin_BSPSceneManager_la_OBJECTS =  \
+	$(am_Plugin_BSPSceneManager_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Plugin_BSPSceneManager_la_SOURCES)
+DIST_SOURCES = $(Plugin_BSPSceneManager_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/PlugIns/BSPSceneManager/include -I$(top_srcdir)/OgreMain/include
+pkglib_LTLIBRARIES = Plugin_BSPSceneManager.la
+Plugin_BSPSceneManager_la_SOURCES = OgreBspLevel.cpp \
+                             OgreBspNode.cpp \
+                             OgreBspResourceManager.cpp \
+                             OgreBspSceneManager.cpp \
+                             OgreBspSceneManagerDll.cpp \
+							 OgreBspSceneManagerPlugin.cpp \
+							 OgreBspSceneNode.cpp \
+                             OgreQuake3ShaderManager.cpp \
+                             OgreQuake3Shader.cpp \
+                             OgreQuake3Level.cpp
+
+Plugin_BSPSceneManager_la_LDFLAGS = -module $(PLUGIN_FLAGS) -L$(top_builddir)/OgreMain/src -Wl,-z,defs
+Plugin_BSPSceneManager_la_LIBADD = -lOgreMain -lc $(OGRE_THREAD_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  PlugIns/BSPSceneManager/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  PlugIns/BSPSceneManager/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)"
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    f=$(am__strip_dir) \
+	    echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	    $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  p=$(am__strip_dir) \
+	  echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \
+	  $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+Plugin_BSPSceneManager.la: $(Plugin_BSPSceneManager_la_OBJECTS) $(Plugin_BSPSceneManager_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(Plugin_BSPSceneManager_la_LDFLAGS) $(Plugin_BSPSceneManager_la_OBJECTS) $(Plugin_BSPSceneManager_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreBspLevel.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreBspNode.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreBspResourceManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreBspSceneManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreBspSceneManagerDll.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreBspSceneManagerPlugin.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreBspSceneNode.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreQuake3Level.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreQuake3Shader.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreQuake3ShaderManager.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-pkglibLTLIBRARIES install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-pkglibLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /PlugIns/BSPSceneManager/src/OgreBspLevel.cpp
===================================================================
--- /PlugIns/BSPSceneManager/src/OgreBspLevel.cpp	(revision 5)
+++ /PlugIns/BSPSceneManager/src/OgreBspLevel.cpp	(revision 5)
@@ -0,0 +1,1019 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreBspLevel.h"
+#include "OgreBspResourceManager.h"
+#include "OgreException.h"
+#include "OgreMaterial.h"
+#include "OgreMaterialManager.h"
+#include "OgreMovableObject.h"
+#include "OgreSceneManager.h"
+#include "OgrePatchSurface.h"
+#include "OgreQuake3ShaderManager.h"
+#include "OgreQuake3Shader.h"
+#include "OgreMath.h"
+#include "OgreStringVector.h"
+#include "OgreStringConverter.h"
+#include "OgreLogManager.h"
+#include "OgreSceneManagerEnumerator.h"
+#include "OgreTechnique.h"
+#include "OgrePass.h"
+#include "OgreTextureUnitState.h"
+#include "OgreResourceGroupManager.h"
+
+namespace Ogre {
+
+    #define NUM_FACES_PER_PROGRESS_REPORT 100
+    #define NUM_NODES_PER_PROGRESS_REPORT 50
+    #define NUM_LEAVES_PER_PROGRESS_REPORT 50
+    #define NUM_BRUSHES_PER_PROGRESS_REPORT 50
+
+    //-----------------------------------------------------------------------
+    BspLevel::BspLevel(ResourceManager* creator, const String& name, 
+        ResourceHandle handle, const String& group, bool isManual, 
+        ManualResourceLoader* loader)
+      : Resource(creator, name, handle, group, isManual, loader), 
+        mRootNode(0), 
+        mVertexData(0), 
+        mLeafFaceGroups(0),
+        mFaceGroups(0), 
+        mBrushes(0),
+		mSkyEnabled(false)
+    {
+        mVisData.tableData = 0;
+
+        if (createParamDictionary("BspLevel"))
+        {
+            // nothing
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    BspLevel::~BspLevel()
+    {
+        // have to call this here reather than in Resource destructor
+        // since calling virtual methods in base destructors causes crash
+        unload(); 
+
+    }
+
+    //-----------------------------------------------------------------------
+    void BspLevel::loadImpl()
+    {
+		mSkyEnabled = false;
+
+        // Use Quake3 file loader
+        Quake3Level q3;
+        DataStreamPtr stream = 
+			ResourceGroupManager::getSingleton().openResource(mName, 
+				ResourceGroupManager::getSingleton().getWorldResourceGroupName());
+
+        q3.loadFromStream(stream);
+
+        loadQuake3Level(q3);
+
+    }
+	//-----------------------------------------------------------------------
+	bool BspLevel::isSkyEnabled(void) const
+	{
+		return mSkyEnabled;
+	}
+	//-----------------------------------------------------------------------
+	const String& BspLevel::getSkyMaterialName(void) const
+	{
+		return mSkyMaterial;
+	}
+	//-----------------------------------------------------------------------
+	Real BspLevel::getSkyCurvature(void) const
+	{
+		return mSkyCurvature;
+	}
+    //-----------------------------------------------------------------------
+    void BspLevel::load(DataStreamPtr& stream)
+    {
+        // Use Quake3 file loader
+        Quake3Level q3;
+        q3.loadFromStream(stream);
+
+        loadQuake3Level(q3);
+
+    }
+    //-----------------------------------------------------------------------
+    void BspLevel::unloadImpl()
+    {
+        if (mVertexData)
+            delete mVertexData;
+        mIndexes.setNull();
+        if (mFaceGroups)
+            delete [] mFaceGroups;
+        if (mLeafFaceGroups)
+            delete [] mLeafFaceGroups;
+        if (mRootNode)
+            delete [] mRootNode;
+        if (mVisData.tableData)
+            delete [] mVisData.tableData;
+        if (mBrushes)
+            delete [] mBrushes;
+
+        mVertexData = 0;
+        mRootNode = 0;
+        mFaceGroups = 0;
+        mLeafFaceGroups = 0;
+        mBrushes = 0;
+        mVisData.tableData = 0;
+        for (PatchMap::iterator pi = mPatches.begin(); pi != mPatches.end(); ++pi)
+        {
+            delete pi->second;
+        }
+        mPatches.clear();
+    }
+    //-----------------------------------------------------------------------
+    size_t BspLevel::calculateLoadingStages(const String& levelName)
+    {
+        DataStreamPtr stream = 
+            ResourceGroupManager::getSingleton().openResource(levelName, 
+            ResourceGroupManager::getSingleton().getWorldResourceGroupName());
+		return calculateLoadingStages(stream);
+	}
+    //-----------------------------------------------------------------------
+    size_t BspLevel::calculateLoadingStages(DataStreamPtr& stream)
+    {
+        Quake3Level q3;
+
+        // Load header only
+        q3.loadHeaderFromStream(stream);
+
+        // Ok, count up the things that we will report
+        size_t stages = 0;
+
+        // loadEntities (1 stage)
+        ++stages;
+        // extractLightmaps (external, 1 stage)
+        ++stages;
+        // initQuake3Patches
+        ++stages;
+        // vertex setup
+        ++stages;
+        // face setup
+        ++stages;
+        // patch building
+        ++stages;
+        // material setup
+        // this is not strictly based on load, since we only know the number
+        // of faces, not the number of materials
+        // raise one event for every 50 faces, plus one at the end
+        stages += (q3.mNumFaces / NUM_FACES_PER_PROGRESS_REPORT) + 1;
+        // node setup
+        stages += (q3.mNumNodes / NUM_NODES_PER_PROGRESS_REPORT) + 1;
+        // brush setup
+        stages += (q3.mNumBrushes / NUM_BRUSHES_PER_PROGRESS_REPORT) + 1;
+        // leaf setup
+        stages += (q3.mNumLeaves / NUM_LEAVES_PER_PROGRESS_REPORT) + 1;
+        // vis
+        ++stages;
+
+        return stages;
+
+    }
+    //-----------------------------------------------------------------------
+    void BspLevel::loadQuake3Level(const Quake3Level& q3lvl)
+    {
+        MaterialManager& mm = MaterialManager::getSingleton();
+        ResourceGroupManager& rgm = ResourceGroupManager::getSingleton();
+
+        rgm._notifyWorldGeometryStageStarted("Parsing entities");
+        loadEntities(q3lvl);
+        rgm._notifyWorldGeometryStageEnded();
+
+        // Extract lightmaps into textures
+        rgm._notifyWorldGeometryStageStarted("Extracting lightmaps");
+        q3lvl.extractLightmaps();
+        rgm._notifyWorldGeometryStageEnded();
+
+        //-----------------------------------------------------------------------
+        // Vertices
+        //-----------------------------------------------------------------------
+        // Allocate memory for vertices & copy
+        mVertexData = new VertexData();
+
+        /// Create vertex declaration
+        VertexDeclaration* decl = mVertexData->vertexDeclaration;
+        size_t offset = 0;
+        decl->addElement(0, offset, VET_FLOAT3, VES_POSITION);
+        offset += VertexElement::getTypeSize(VET_FLOAT3);
+        decl->addElement(0, offset, VET_FLOAT3, VES_NORMAL);
+        offset += VertexElement::getTypeSize(VET_FLOAT3);
+        decl->addElement(0, offset, VET_COLOUR, VES_DIFFUSE);
+        offset += VertexElement::getTypeSize(VET_COLOUR);
+        decl->addElement(0, offset, VET_FLOAT2, VES_TEXTURE_COORDINATES, 0);
+        offset += VertexElement::getTypeSize(VET_FLOAT2);
+        decl->addElement(0, offset, VET_FLOAT2, VES_TEXTURE_COORDINATES, 1);
+
+        // Build initial patches - we need to know how big the vertex buffer needs to be
+        // to accommodate the subdivision
+        rgm._notifyWorldGeometryStageStarted("Initialising patches");
+        initQuake3Patches(q3lvl, decl);
+        rgm._notifyWorldGeometryStageEnded();
+
+        /// Create the vertex buffer, allow space for patches
+        rgm._notifyWorldGeometryStageStarted("Setting up vertex data");
+        HardwareVertexBufferSharedPtr vbuf = HardwareBufferManager::getSingleton()
+            .createVertexBuffer(
+                sizeof(BspVertex), 
+                q3lvl.mNumVertices + mPatchVertexCount, 
+                HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+        //COPY static vertex data - Note that we can't just block-copy the vertex data because we have to reorder
+        //    our vertex elements; this is to ensure compatibility with older cards when using
+        //    hardware vertex buffers - Direct3D requires that the buffer format maps onto a
+        //    FVF in those older drivers. 
+        // Lock just the non-patch area for now
+        BspVertex* pVert = static_cast<BspVertex*>(
+            vbuf->lock(0, q3lvl.mNumVertices * sizeof(BspVertex), HardwareBuffer::HBL_DISCARD) );
+        // Keep another base pointer for use later in patch building
+        for (int v = 0; v < q3lvl.mNumVertices; ++v)
+        {
+            quakeVertexToBspVertex(&q3lvl.mVertices[v], pVert++);
+        }
+        vbuf->unlock();
+        // Setup binding
+        mVertexData->vertexBufferBinding->setBinding(0, vbuf);
+        // Set other data
+        mVertexData->vertexStart = 0;
+        mVertexData->vertexCount = q3lvl.mNumVertices + mPatchVertexCount;
+        rgm._notifyWorldGeometryStageEnded();
+
+        //-----------------------------------------------------------------------
+        // Faces
+        // --------
+        rgm._notifyWorldGeometryStageStarted("Setting up face data");
+        mNumLeafFaceGroups = q3lvl.mNumLeafFaces;
+        mLeafFaceGroups = new int[mNumLeafFaceGroups];
+        memcpy(mLeafFaceGroups, q3lvl.mLeafFaces, sizeof(int)*mNumLeafFaceGroups);
+        mNumFaceGroups = q3lvl.mNumFaces;
+        mFaceGroups = new StaticFaceGroup[mNumFaceGroups];
+        // Set up index buffer
+        // NB Quake3 indexes are 32-bit
+        // Copy the indexes into a software area for staging
+        mNumIndexes = q3lvl.mNumElements + mPatchIndexCount;
+        // Create an index buffer manually in system memory, allow space for patches
+        mIndexes.bind(new DefaultHardwareIndexBuffer(
+            HardwareIndexBuffer::IT_32BIT, 
+            mNumIndexes, 
+            HardwareBuffer::HBU_DYNAMIC));
+        // Write main indexes
+        mIndexes->writeData(0, sizeof(unsigned int) * q3lvl.mNumElements, q3lvl.mElements, true);
+        rgm._notifyWorldGeometryStageEnded();
+
+        // now build patch information
+        rgm._notifyWorldGeometryStageStarted("Building patches");
+        buildQuake3Patches(q3lvl.mNumVertices, q3lvl.mNumElements);
+        rgm._notifyWorldGeometryStageEnded();
+
+        //-----------------------------------------------------------------------
+        // Create materials for shaders
+        //-----------------------------------------------------------------------
+        // NB this only works for the 'default' shaders for now
+        //  i.e. those that don't have a .shader script and thus default
+        //  to just texture + lightmap
+        // TODO: pre-parse all .shader files and create lookup for next stage (use ROGL shader_file_t)
+
+        // Material names are shadername#lightmapnumber
+        // This is because I like to define materials up front completely
+        //  rather than combine lightmap and shader dynamically (it's
+        //  more generic). It results in more materials, but they're small
+        //  beer anyway. Texture duplication is prevented by infrastructure.
+        // To do this I actually need to parse the faces since they have the
+        //  shader/lightmap combo (lightmap number is not in the shader since
+        //  it can be used with multiple lightmaps)
+        String shaderName;
+        int face;
+        face = q3lvl.mNumFaces;
+        int matHandle;
+        String meshName;
+
+        String resourceGroup = ResourceGroupManager::getSingleton().getWorldResourceGroupName();
+        size_t progressCountdown = NUM_FACES_PER_PROGRESS_REPORT;
+        size_t progressCount = 0;
+
+        while(face--)
+        {
+            // Progress reporting
+            if (progressCountdown == NUM_FACES_PER_PROGRESS_REPORT)
+            {
+                ++progressCount;
+                StringUtil::StrStreamType str;
+                str << "Loading materials (phase " << progressCount << ")"; 
+                rgm._notifyWorldGeometryStageStarted(str.str());
+            }
+            else if (progressCountdown == 0)
+            {
+                // stage report
+                rgm._notifyWorldGeometryStageEnded();
+                progressCountdown = NUM_FACES_PER_PROGRESS_REPORT + 1; 
+
+            }
+
+            // Check to see if existing material
+            // Format shader#lightmap
+            int shadIdx = q3lvl.mFaces[face].shader;
+			StringUtil::StrStreamType tmp;
+			tmp << q3lvl.mShaders[shadIdx].name << "#" << q3lvl.mFaces[face].lm_texture;
+			shaderName = tmp.str();
+
+            MaterialPtr shadMat = MaterialManager::getSingleton().getByName(shaderName);
+            if (shadMat.isNull())
+            {
+                // Build new material
+
+                // Colour layer
+                // NB no extension in Q3A(doh), have to try shader, .jpg, .tga
+                String tryName = q3lvl.mShaders[shadIdx].name;
+                // Try shader first
+                Quake3Shader* pShad = Quake3ShaderManager::getSingleton().getByName(tryName);
+                if (pShad)
+                {
+                    shadMat = pShad->createAsMaterial(q3lvl.mFaces[face].lm_texture);
+					// Do skydome (use this material)
+					if (pShad->skyDome)
+					{
+						mSkyEnabled = true;
+						mSkyMaterial = shadMat->getName();
+						mSkyCurvature = 20 - (pShad->cloudHeight / 256 * 18);
+					}
+                }
+                else
+                {
+                    // No shader script, try default type texture
+                    shadMat = mm.create(shaderName, resourceGroup);
+                    Pass *shadPass = shadMat->getTechnique(0)->getPass(0);
+                    // Try jpg
+                    TextureUnitState* tex = 0;
+                    if (ResourceGroupManager::getSingleton().resourceExists(resourceGroup, tryName + ".jpg"))
+                    {
+                        tex = shadPass->createTextureUnitState(tryName + ".jpg");
+                    }
+                    else if (ResourceGroupManager::getSingleton().resourceExists(resourceGroup, tryName + ".tga"))
+                    {
+                        tex = shadPass->createTextureUnitState(tryName + ".tga");
+                    }
+
+                    if (tex)
+                    {
+                        // Set replace on all first layer textures for now
+                        tex->setColourOperation(LBO_REPLACE);
+                        tex->setTextureAddressingMode(TextureUnitState::TAM_WRAP);
+                    }
+
+                    if (q3lvl.mFaces[face].lm_texture >= 0)
+                    {
+                        // Add lightmap, additive blending
+						StringUtil::StrStreamType lightmapName;
+                        lightmapName << "@lightmap" << q3lvl.mFaces[face].lm_texture;
+                        tex = shadPass->createTextureUnitState(lightmapName.str());
+                        // Blend
+                        tex->setColourOperation(LBO_MODULATE);
+                        // Use 2nd texture co-ordinate set
+                        tex->setTextureCoordSet(1);
+                        // Clamp
+                        tex->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
+
+                    }
+                    // Set culling mode to none
+                    shadMat->setCullingMode(CULL_NONE);
+                    // No dynamic lighting
+                    shadMat->setLightingEnabled(false);
+
+                }
+            }
+            matHandle = shadMat->getHandle();
+            shadMat->load();
+
+            // Copy face data
+            StaticFaceGroup* dest = &mFaceGroups[face];
+            bsp_face_t* src = &q3lvl.mFaces[face];
+
+            if (q3lvl.mShaders[src->shader].surface_flags & SURF_SKY)
+            {
+                dest->isSky = true;
+            }
+            else
+            {
+                dest->isSky = false;
+            }
+
+
+            dest->materialHandle = matHandle;
+            dest->elementStart = src->elem_start;
+            dest->numElements = src->elem_count;
+            dest->numVertices = src->vert_count;
+            dest->vertexStart = src->vert_start;
+            if (src->type == BSP_FACETYPE_NORMAL)
+            {
+                dest->fType = FGT_FACE_LIST;
+                // Assign plane
+                dest->plane.normal = Vector3(src->normal[0], src->normal[1], src->normal[2]);
+                dest->plane.d = -dest->plane.normal.dotProduct(
+					Vector3(src->org[0], src->org[1], src->org[2]));
+
+                // Don't rebase indexes here - Quake3 re-uses some indexes for multiple vertex
+                // groups eg repeating small details have the same relative vertex data but
+                // use the same index data.
+
+            }
+            else if (src->type == BSP_FACETYPE_PATCH)
+            {
+                // Seems to be some crap in the Q3 level where vertex count = 0 or num control points = 0?
+                if (dest->numVertices == 0 || src->mesh_cp[0] == 0)
+                {
+                    dest->fType = FGT_UNKNOWN;
+                }
+                else
+                {
+
+                    // Set up patch surface
+                    dest->fType = FGT_PATCH;
+                    
+                    // Locate the patch we already built
+                    PatchMap::iterator p = mPatches.find(face);
+                    if (p == mPatches.end())
+                    {
+                        OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Patch not found from previous built state",
+                        "BspLevel::loadQuake3Level");
+                    }
+
+                    dest->patchSurf = p->second;
+                    
+                }
+
+
+            }
+			else if (src->type == BSP_FACETYPE_MESH)
+			{
+				dest->fType = FGT_FACE_LIST;
+				// Assign plane
+				dest->plane.normal = Vector3(src->normal[0], src->normal[1], src->normal[2]);
+				dest->plane.d = -dest->plane.normal.dotProduct(
+					Vector3(src->org[0], src->org[1], src->org[2]));                
+			}
+			else
+			{
+				LogManager::getSingleton().logMessage("!!! Unknown Face Type !!!", LML_CRITICAL);
+			}
+
+            // progress reporting
+            --progressCountdown;
+
+        }
+        // final stage report
+        rgm._notifyWorldGeometryStageEnded();
+
+        //-----------------------------------------------------------------------
+        // Nodes
+        //-----------------------------------------------------------------------
+        // Allocate memory for all nodes (leaves and splitters)
+        mNumNodes = q3lvl.mNumNodes + q3lvl.mNumLeaves;
+        mNumLeaves = q3lvl.mNumLeaves;
+        mLeafStart = q3lvl.mNumNodes;
+        mRootNode = new BspNode[mNumNodes];
+        int i;
+        // Convert nodes
+        // In our array, first q3lvl.mNumNodes are non-leaf, others are leaves
+        progressCountdown = NUM_NODES_PER_PROGRESS_REPORT;
+        progressCount = 0;
+
+        for (i = 0; i < q3lvl.mNumNodes; ++i)
+        {
+            // Progress reporting
+            if (progressCountdown == NUM_NODES_PER_PROGRESS_REPORT)
+            {
+                ++progressCount;
+                StringUtil::StrStreamType str;
+                str << "Loading nodes (phase " << progressCount << ")"; 
+                    rgm._notifyWorldGeometryStageStarted(str.str());
+            }
+            else if (progressCountdown == 0)
+            {
+                // stage report
+                rgm._notifyWorldGeometryStageEnded();
+                progressCountdown = NUM_NODES_PER_PROGRESS_REPORT + 1; 
+
+            }
+
+            BspNode* node = &mRootNode[i];
+            bsp_node_t* q3node = &q3lvl.mNodes[i];
+
+            // Set non-leaf
+            node->mIsLeaf = false;
+            // Set owner
+            node->mOwner = this;
+            // Set plane
+            node->mSplitPlane.normal.x = q3lvl.mPlanes[q3node->plane].normal[0];
+            node->mSplitPlane.normal.y = q3lvl.mPlanes[q3node->plane].normal[1];
+            node->mSplitPlane.normal.z = q3lvl.mPlanes[q3node->plane].normal[2];
+            node->mSplitPlane.d = -q3lvl.mPlanes[q3node->plane].dist;
+            // Set bounding box
+            node->mBounds.setMinimum(Vector3(&q3node->bbox[0]));
+            node->mBounds.setMaximum(Vector3(&q3node->bbox[3]));
+            // Set back pointer
+            // Negative indexes in Quake3 mean leaves
+            if (q3node->back < 0)
+            {
+                // Points to leaf, offset to leaf start and negate index
+                node->mBack = &mRootNode[mLeafStart + (~(q3node->back))];
+
+            }
+            else
+            {
+                // Points to node
+                node->mBack = &mRootNode[q3node->back];
+            }
+            // Set front pointer
+            // Negative indexes in Quake3 mean leaves
+            if (q3node->front < 0)
+            {
+                // Points to leaf, offset to leaf start and negate index
+                node->mFront = &mRootNode[mLeafStart + (~(q3node->front))];
+
+            }
+            else
+            {
+                // Points to node
+                node->mFront = &mRootNode[q3node->front];
+            }
+
+            --progressCountdown;
+
+
+        }
+        // final stage report
+        rgm._notifyWorldGeometryStageEnded();
+
+        //-----------------------------------------------------------------------
+        // Brushes
+        //-----------------------------------------------------------------------
+        // Reserve enough memory for all brushes, solid or not (need to maintain indexes)
+        mBrushes = new BspNode::Brush[q3lvl.mNumBrushes];
+        progressCountdown = NUM_BRUSHES_PER_PROGRESS_REPORT;
+        progressCount = 0;
+
+        for (i = 0; i < q3lvl.mNumBrushes; ++i)
+        {
+            // Progress reporting
+            if (progressCountdown == NUM_BRUSHES_PER_PROGRESS_REPORT)
+            {
+                ++progressCount;
+                StringUtil::StrStreamType str;
+                str << "Loading brushes (phase " << progressCount << ")"; 
+                    rgm._notifyWorldGeometryStageStarted(str.str());
+            }
+            else if (progressCountdown == 0)
+            {
+                // stage report
+                rgm._notifyWorldGeometryStageEnded();
+                progressCountdown = NUM_BRUSHES_PER_PROGRESS_REPORT + 1; 
+
+            }
+            bsp_brush_t* q3brush = &q3lvl.mBrushes[i];
+
+            // Create a new OGRE brush
+            BspNode::Brush *pBrush = &(mBrushes[i]);
+            int brushSideIdx, numBrushSides;
+            numBrushSides = q3brush->numsides;
+            brushSideIdx = q3brush->firstside;
+            // Iterate over the sides and create plane for each
+            while (numBrushSides--)
+            {
+                bsp_brushside_t* q3brushside = &q3lvl.mBrushSides[brushSideIdx];
+                bsp_plane_t* q3brushplane = &q3lvl.mPlanes[q3brushside->planenum];
+                // Notice how we normally invert Q3A plane distances, but here we do not
+                // Because we want plane normals pointing out of solid brushes, not in
+                Plane brushSide(
+					Vector3(
+						q3brushplane->normal[0], 
+						q3brushplane->normal[1], 
+						q3brushplane->normal[2]), 
+					q3brushplane->dist);
+                pBrush->planes.push_back(brushSide);
+                ++brushSideIdx;
+            }
+            // Build world fragment
+            pBrush->fragment.fragmentType = SceneQuery::WFT_PLANE_BOUNDED_REGION;
+            pBrush->fragment.planes = &(pBrush->planes);
+
+            --progressCountdown;
+
+        }
+        // final stage report
+        rgm._notifyWorldGeometryStageEnded();
+
+
+
+        //-----------------------------------------------------------------------
+        // Leaves
+        //-----------------------------------------------------------------------
+        progressCountdown = NUM_LEAVES_PER_PROGRESS_REPORT;
+        progressCount = 0;
+        for (i = 0; i < q3lvl.mNumLeaves; ++i)
+        {
+            // Progress reporting
+            if (progressCountdown == NUM_LEAVES_PER_PROGRESS_REPORT)
+            {
+                ++progressCount;
+                StringUtil::StrStreamType str;
+                str << "Loading leaves (phase " << progressCount << ")"; 
+                    rgm._notifyWorldGeometryStageStarted(str.str());
+            }
+            else if (progressCountdown == 0)
+            {
+                // stage report
+                rgm._notifyWorldGeometryStageEnded();
+                progressCountdown = NUM_LEAVES_PER_PROGRESS_REPORT + 1; 
+
+            }
+            BspNode* node = &mRootNode[i + mLeafStart];
+            bsp_leaf_t* q3leaf = &q3lvl.mLeaves[i];
+
+            // Set leaf
+            node->mIsLeaf = true;
+            // Set owner
+            node->mOwner = this;
+            // Set bounding box
+            node->mBounds.setMinimum(Vector3(&q3leaf->bbox[0]));
+            node->mBounds.setMaximum(Vector3(&q3leaf->bbox[3]));
+            // Set faces
+            node->mFaceGroupStart = q3leaf->face_start;
+            node->mNumFaceGroups = q3leaf->face_count;
+
+            node->mVisCluster = q3leaf->cluster;
+
+            // Load Brushes for this leaf
+            int brushIdx, brushCount, realBrushIdx;
+            brushCount = q3leaf->brush_count;
+            brushIdx = q3leaf->brush_start;
+
+            while(brushCount--)
+            {
+                realBrushIdx = q3lvl.mLeafBrushes[brushIdx];
+                bsp_brush_t* q3brush = &q3lvl.mBrushes[realBrushIdx];
+                // Only load solid ones, we don't care about any other types
+                // Shader determines this
+                bsp_shader_t* brushShader = &q3lvl.mShaders[q3brush->shaderIndex];
+                if (brushShader->content_flags & CONTENTS_SOLID)
+                {
+                    // Get brush 
+                    BspNode::Brush *pBrush = &(mBrushes[realBrushIdx]);
+                    assert(pBrush->fragment.fragmentType == SceneQuery::WFT_PLANE_BOUNDED_REGION);
+                    // Assign node pointer
+                    node->mSolidBrushes.push_back(pBrush);
+                }
+                ++brushIdx;
+            }
+
+            --progressCountdown;
+
+        }
+        // final stage report
+        rgm._notifyWorldGeometryStageEnded();
+
+
+
+        // Vis - just copy
+        // final stage report
+        rgm._notifyWorldGeometryStageStarted("Copying Vis data");
+        mVisData.numClusters = q3lvl.mVis->cluster_count;
+        mVisData.rowLength = q3lvl.mVis->row_size;
+        mVisData.tableData = new unsigned char[q3lvl.mVis->row_size * q3lvl.mVis->cluster_count];
+        memcpy(mVisData.tableData, q3lvl.mVis->data, q3lvl.mVis->row_size * q3lvl.mVis->cluster_count);
+        rgm._notifyWorldGeometryStageEnded();
+
+
+
+    }
+
+    //-----------------------------------------------------------------------
+    void BspLevel::initQuake3Patches(const Quake3Level & q3lvl, VertexDeclaration* decl)
+    {
+        int face;
+
+        mPatchVertexCount = 0;
+        mPatchIndexCount = 0;
+
+        // We're just building the patch here to get a hold on the size of the mesh
+        // although we'll reuse this information later
+        face = q3lvl.mNumFaces;
+        while (face--)
+        {
+
+            bsp_face_t* src = &q3lvl.mFaces[face];
+
+            if (src->type == BSP_FACETYPE_PATCH)
+            {
+                // Seems to be some crap in the Q3 level where vertex count = 0 or num control points = 0?
+                if (src->vert_count == 0 || src->mesh_cp[0] == 0)
+                {
+                    continue;
+                }
+                PatchSurface* ps = new PatchSurface();
+                // Set up control points & format
+                // Reuse the vertex declaration 
+                // Copy control points into a buffer so we can convert their format
+                BspVertex* pControlPoints = new BspVertex[src->vert_count];
+                bsp_vertex_t* pSrc = q3lvl.mVertices + src->vert_start;
+                for (int v = 0; v < src->vert_count; ++v)
+                {
+                    quakeVertexToBspVertex(pSrc++, &pControlPoints[v]);
+                }
+                // Define the surface, but don't build it yet (no vertex / index buffer)
+                ps->defineSurface(
+                    pControlPoints,
+                    decl, 
+                    src->mesh_cp[0],
+                    src->mesh_cp[1],
+                    PatchSurface::PST_BEZIER);
+                // Get stats
+                mPatchVertexCount += ps->getRequiredVertexCount();
+                mPatchIndexCount += ps->getRequiredIndexCount();
+
+                // Save the surface for later
+                mPatches[face] = ps;
+            }
+
+
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void BspLevel::buildQuake3Patches(size_t vertOffset, size_t indexOffset)
+    {
+        // Loop through the patches
+        PatchMap::iterator i, iend;
+        iend = mPatches.end();
+
+        size_t currVertOffset = vertOffset;
+        size_t currIndexOffset = indexOffset;
+
+        HardwareVertexBufferSharedPtr vbuf = mVertexData->vertexBufferBinding->getBuffer(0);
+
+        for (i = mPatches.begin(); i != iend; ++i)
+        {
+            PatchSurface* ps = i->second;
+            
+            ps->build(vbuf, currVertOffset, mIndexes, currIndexOffset);
+
+            // No need for control points anymore
+            BspVertex* pCP = static_cast<BspVertex*>(ps->getControlPointBuffer());
+            delete [] pCP;
+            ps->notifyControlPointBufferDeallocated();
+
+            currVertOffset += ps->getRequiredVertexCount();
+            currIndexOffset += ps->getRequiredIndexCount();
+        
+        }
+    }
+    //-----------------------------------------------------------------------
+    bool BspLevel::isLeafVisible(const BspNode* from, const BspNode* to) const
+    {
+        if (to->mVisCluster == -1)
+            return false;
+        if (from->mVisCluster == -1)
+            // Camera outside world?
+            return true;
+
+
+        if (!from->isLeaf() || !to->isLeaf())
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "Both nodes must be leaf nodes for visibility testing.",
+                "BspLevel::isLeafVisible");
+
+        // Use PVS to determine visibility
+
+        /*
+        // In wordier terms, the fairly cryptic (but fast) version is doing this:
+        //   Could make it a macro for even more speed?
+
+        // Row offset = from cluster number * row size
+        int offset = from->mVisCluster*mVisData.rowLength;
+
+        // Column offset (in bytes) = to cluster number divided by 8 (since 8 bits per bytes)
+        offset += to->mVisCluster >> 3;
+
+        // Get the right bit within the byte, i.e. bitwise 'and' with bit at remainder position
+        int result = *(mVisData.tableData + offset) & (1 << (to->mVisCluster & 7));
+
+        return (result != 0);
+        */
+
+        //return ((*(mVisData.tableData + from->mVisCluster * mVisData.rowLength +
+        //           ((to->mVisCluster)>>3)) & (1 << ((to->mVisCluster) & 7))) != 0);
+
+        return (*(mVisData.tableData + from->mVisCluster*mVisData.rowLength +
+                   ((to->mVisCluster)>>3)) & (1 << ((to->mVisCluster) & 7))) != 0;
+
+    }
+    //-----------------------------------------------------------------------
+    const BspNode* BspLevel::getRootNode(void)
+    {
+        return mRootNode;
+    }
+    //-----------------------------------------------------------------------
+    BspNode* BspLevel::findLeaf(const Vector3& point) const
+    {
+        BspNode* node = mRootNode;
+
+        while (!node->isLeaf())
+        {
+            node = node->getNextNode(point);
+        }
+
+        return node;
+
+    }
+    //-----------------------------------------------------------------------
+    void BspLevel::loadEntities(const Quake3Level& q3lvl)
+    {
+        char* strEnt;
+        String line;
+        StringVector vecparams;
+        Vector3 origin;
+        Radian angle ( 0 );
+        size_t pos;
+        char* lineend;
+        bool isPlayerStart;
+
+        isPlayerStart = false;
+        strEnt = (char*)q3lvl.mEntities;
+
+        lineend = strchr(strEnt, '\n');
+        while (lineend != 0)
+        {
+            *lineend = '\0';
+            line = strEnt;
+            strEnt = lineend+1;
+            StringUtil::trim(line);
+            if (line.length() > 0)
+            {
+                StringUtil::toLowerCase(line);
+                // Remove quotes
+				while( ( pos = line.find("\"",0) ) != String::npos )
+                {
+                    line = line.substr(0,pos) + line.substr(pos+1,line.length()-(pos+1));
+                }
+                vecparams = StringUtil::split(line);
+                StringVector::iterator params = vecparams.begin();
+
+                if (params[0] == "origin")
+                {
+                    origin.x = atof(params[1].c_str());
+                    origin.y = atof(params[2].c_str());
+                    origin.z = atof(params[3].c_str());
+                }
+                if (params[0] == "angle")
+                {
+                    angle = Degree(atof(params[1].c_str()));
+                }
+                if (params[0] == "classname" && params[1] == "info_player_deathmatch")
+                {
+                    isPlayerStart = true;
+                }
+                if (params[0] == "}")
+                {
+                    if (isPlayerStart)
+                    {
+                        // Save player start
+                        ViewPoint vp;
+                        vp.position = origin;
+                        vp.orientation.FromAngleAxis(angle, Vector3::UNIT_Z);
+                        mPlayerStarts.push_back(vp);
+                    }
+                    isPlayerStart = false;
+                }
+            }
+
+            lineend = strchr(strEnt, '\n');
+        }
+
+
+    }
+    //-----------------------------------------------------------------------
+    void BspLevel::_notifyObjectMoved(const MovableObject* mov, 
+            const Vector3& pos)
+    {
+
+        // Locate any current nodes the object is supposed to be attached to
+        MovableToNodeMap::iterator i = mMovableToNodeMap.find(mov);
+        if (i != mMovableToNodeMap.end())
+        {
+            std::list<BspNode*>::iterator nodeit, nodeitend;
+            nodeitend = i->second.end();
+            for (nodeit = i->second.begin(); nodeit != nodeitend; ++nodeit)
+            {
+                // Tell each node
+                (*nodeit)->_removeMovable(mov);
+            }
+            // Clear the existing list of nodes because we'll reevaluate it
+            i->second.clear();
+        }
+
+        tagNodesWithMovable(mRootNode, mov, pos);
+    }
+    //-----------------------------------------------------------------------
+    void BspLevel::tagNodesWithMovable(BspNode* node, const MovableObject* mov,
+        const Vector3& pos)
+    {
+        if (node->isLeaf())
+        {
+            // Add to movable->node map
+            // Insert all the time, will get current if already there
+            std::pair<MovableToNodeMap::iterator, bool> p = 
+                mMovableToNodeMap.insert(
+                MovableToNodeMap::value_type(mov, std::list<BspNode*>()));
+
+            p.first->second.push_back(node);
+
+            // Add movable to node
+            node->_addMovable(mov);
+
+        }
+        else
+        {
+            // Find distance to dividing plane
+            Real dist = node->getDistance(pos);
+            if (Math::Abs(dist) < mov->getBoundingRadius())
+            {
+                // Bounding sphere crosses the plane, do both
+                tagNodesWithMovable(node->getBack(), mov, pos);
+                tagNodesWithMovable(node->getFront(), mov, pos);
+            }
+            else if (dist < 0)
+            {    //-----------------------------------------------------------------------
+
+                // Do back
+                tagNodesWithMovable(node->getBack(), mov, pos);
+            }
+            else
+            {
+                // Do front
+                tagNodesWithMovable(node->getFront(), mov, pos);
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+	void BspLevel::_notifyObjectDetached(const MovableObject* mov)	
+	{
+        // Locate any current nodes the object is supposed to be attached to
+        MovableToNodeMap::iterator i = mMovableToNodeMap.find(mov);
+        if (i != mMovableToNodeMap.end())
+        {
+            std::list<BspNode*>::iterator nodeit, nodeitend;
+            nodeitend = i->second.end();
+            for (nodeit = i->second.begin(); nodeit != nodeitend; ++nodeit)
+            {
+                // Tell each node
+                (*nodeit)->_removeMovable(mov);
+            }
+            // delete the entry for this MovableObject
+            mMovableToNodeMap.erase(i);
+        }
+	}
+    //-----------------------------------------------------------------------
+    void BspLevel::quakeVertexToBspVertex(const bsp_vertex_t* src, BspVertex* dest)
+    {
+        memcpy(dest->position, src->point, sizeof(float) * 3);
+        memcpy(dest->normal, src->normal,  sizeof(float) * 3);
+        dest->colour = src->color;
+        dest->texcoords[0]  = src->texture[0];
+        dest->texcoords[1]  = src->texture[1];
+        dest->lightmap[0]  = src->lightmap[0];
+        dest->lightmap[1]  = src->lightmap[1];
+    }
+    //-----------------------------------------------------------------------
+    size_t BspLevel::calculateSize(void) const
+    {
+        return 0; // TODO
+    }
+}
Index: /PlugIns/BSPSceneManager/src/OgreBspNode.cpp
===================================================================
--- /PlugIns/BSPSceneManager/src/OgreBspNode.cpp	(revision 5)
+++ /PlugIns/BSPSceneManager/src/OgreBspNode.cpp	(revision 5)
@@ -0,0 +1,206 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreBspNode.h"
+#include "OgreBspLevel.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    BspNode::BspNode(BspLevel* owner, bool isLeaf)
+    {
+        mOwner = owner;
+        mIsLeaf = isLeaf;
+
+    }
+
+    //-----------------------------------------------------------------------
+    BspNode::BspNode()
+    {
+    }
+    //-----------------------------------------------------------------------
+    BspNode::~BspNode()
+    {
+    }
+
+    //-----------------------------------------------------------------------
+    bool BspNode::isLeaf(void) const
+    {
+        return mIsLeaf;
+    }
+
+    //-----------------------------------------------------------------------
+    BspNode* BspNode::getFront(void) const
+    {
+        if (mIsLeaf)
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "This method is not valid on a leaf node.",
+                "BspNode::getFront");
+        return mFront;
+    }
+
+    //-----------------------------------------------------------------------
+    BspNode* BspNode::getBack(void) const
+    {
+        if (mIsLeaf)
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "This method is not valid on a leaf node.",
+                "BspNode::getBack");
+        return mBack;
+    }
+
+    //-----------------------------------------------------------------------
+    const Plane& BspNode::getSplitPlane(void) const
+    {
+        if (mIsLeaf)
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "This method is not valid on a leaf node.",
+                "BspNode::getSplitPlane");
+
+        return mSplitPlane;
+
+    }
+
+    //-----------------------------------------------------------------------
+    const AxisAlignedBox& BspNode::getBoundingBox(void) const
+    {
+        if (!mIsLeaf)
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "This method is only valid on a leaf node.",
+                "BspNode::getBoundingBox");
+        return mBounds;
+
+    }
+
+    //-----------------------------------------------------------------------
+    int BspNode::getNumFaceGroups(void) const
+    {
+        if (!mIsLeaf)
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "This method is only valid on a leaf node.",
+                "BspNode::getNumFaces");
+        return mNumFaceGroups;
+    }
+
+    //-----------------------------------------------------------------------
+    int BspNode::getFaceGroupStart(void) const
+    {
+        if (!mIsLeaf)
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "This method is only valid on a leaf node.",
+                "BspNode::getFaces");
+        return mFaceGroupStart;
+    }
+
+    //-----------------------------------------------------------------------
+    bool BspNode::isLeafVisible(const BspNode* leaf) const
+    {
+        return mOwner->isLeafVisible(this, leaf);
+    }
+    //-----------------------------------------------------------------------
+    Plane::Side BspNode::getSide (const Vector3& point) const
+    {
+        if (mIsLeaf)
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "This method is not valid on a leaf node.",
+                "BspNode::getSide");
+
+        return mSplitPlane.getSide(point);
+
+    }
+    //-----------------------------------------------------------------------
+    BspNode* BspNode::getNextNode(const Vector3& point) const
+    {
+
+        if (mIsLeaf)
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "This method is not valid on a leaf node.",
+                "BspNode::getNextNode");
+
+        Plane::Side sd = getSide(point);
+        if (sd == Plane::NEGATIVE_SIDE)
+        {
+            //LogManager::getSingleton().logMessage("back");
+            return getBack();
+        }
+        else
+        {
+            //LogManager::getSingleton().logMessage("front");
+            return getFront();
+        }
+
+
+
+    }
+    //-----------------------------------------------------------------------
+    void BspNode::_addMovable(const MovableObject* mov)
+    {
+        mMovables.insert(mov);
+    }
+    //-----------------------------------------------------------------------
+    void BspNode::_removeMovable(const MovableObject* mov)
+    {
+        mMovables.erase(mov);
+    }
+    //-----------------------------------------------------------------------
+    Real BspNode::getDistance(const Vector3& pos) const
+    {
+        if (mIsLeaf)
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                "This method is not valid on a leaf node.",
+                "BspNode::getSide");
+
+        return mSplitPlane.getDistance(pos);
+
+    }
+    //-----------------------------------------------------------------------
+    const BspNode::NodeBrushList& BspNode::getSolidBrushes(void) const
+    {
+        return mSolidBrushes;
+    }
+    //-----------------------------------------------------------------------
+    std::ostream& operator<< (std::ostream& o, BspNode& n)
+    {
+        o << "BspNode(";
+        if (n.mIsLeaf)
+        {
+            o << "leaf, bbox=" << n.mBounds << ", cluster=" << n.mVisCluster;
+            o << ", faceGrps=" << n.mNumFaceGroups << ", faceStart=" << n.mFaceGroupStart << ")";
+        }
+        else
+        {
+            o <<  "splitter, plane=" << n.mSplitPlane << ")";
+        }
+        return o;
+
+    }
+
+}
Index: /PlugIns/BSPSceneManager/src/OgreBspResourceManager.cpp
===================================================================
--- /PlugIns/BSPSceneManager/src/OgreBspResourceManager.cpp	(revision 5)
+++ /PlugIns/BSPSceneManager/src/OgreBspResourceManager.cpp	(revision 5)
@@ -0,0 +1,97 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreBspResourceManager.h"
+#include "OgreBspLevel.h"
+#include "OgreQuake3ShaderManager.h"
+
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    template<> BspResourceManager* Singleton<BspResourceManager>::ms_Singleton = 0;
+    BspResourceManager* BspResourceManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    BspResourceManager& BspResourceManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+    //-----------------------------------------------------------------------
+
+    //-----------------------------------------------------------------------
+    BspResourceManager::BspResourceManager()
+    {
+        mResourceType = "BspLevel";
+        // Also create related shader manager (singleton managed)
+        mShaderMgr = new Quake3ShaderManager();
+
+        ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
+    }
+    //-----------------------------------------------------------------------
+    BspResourceManager::~BspResourceManager()
+    {
+        delete mShaderMgr;
+        ResourceGroupManager::getSingleton()._unregisterResourceManager(mResourceType);
+    }
+    //-----------------------------------------------------------------------
+    ResourcePtr BspResourceManager::load(const String& name, 
+        const String& group, bool isManual, 
+        ManualResourceLoader* loader, const NameValuePairList* loadParams)
+    {
+        // Only 1 BSP level allowed loaded at once
+        removeAll();
+
+        return ResourceManager::load(name, group, isManual, loader, loadParams);
+
+    }
+    //-----------------------------------------------------------------------
+    ResourcePtr BspResourceManager::load(DataStreamPtr& stream, 
+		const String& group)
+    {
+        // Only 1 BSP level allowed loaded at once
+        removeAll();
+
+		ResourcePtr ret = create("bsplevel", group, true, 0);
+		BspLevelPtr bspLevel = ret;
+		bspLevel->load(stream);
+		
+        return ret;
+
+    }
+    //-----------------------------------------------------------------------
+    Resource* BspResourceManager::createImpl(const String& name, ResourceHandle handle, 
+        const String& group, bool isManual, ManualResourceLoader* loader, 
+        const NameValuePairList* createParams)
+    {
+        return new BspLevel(this, name, handle, group, isManual, loader);
+    }
+
+
+}
Index: /PlugIns/BSPSceneManager/src/OgreBspSceneManager.cpp
===================================================================
--- /PlugIns/BSPSceneManager/src/OgreBspSceneManager.cpp	(revision 5)
+++ /PlugIns/BSPSceneManager/src/OgreBspSceneManager.cpp	(revision 5)
@@ -0,0 +1,987 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreBspSceneManager.h"
+#include "OgreBspResourceManager.h"
+#include "OgreBspNode.h"
+#include "OgreException.h"
+#include "OgreRenderSystem.h"
+#include "OgreCamera.h"
+#include "OgreMaterial.h"
+#include "OgrePatchSurface.h"
+#include "OgreMesh.h"
+#include "OgreSubMesh.h"
+#include "OgreMath.h"
+#include "OgreControllerManager.h"
+#include "OgreLogManager.h"
+#include "OgreBspSceneNode.h"
+#include "OgreStringConverter.h"
+#include "OgreLogManager.h"
+#include "OgreTechnique.h"
+#include "OgrePass.h"
+#include "OgreMaterialManager.h"
+
+
+#include <fstream>
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    BspSceneManager::BspSceneManager(const String& name)
+		: SceneManager(name)
+    {
+        // Set features for debugging render
+        mShowNodeAABs = false;
+
+        // No sky by default
+        mSkyPlaneEnabled = false;
+        mSkyBoxEnabled = false;
+        mSkyDomeEnabled = false;
+
+        mLevel.setNull();
+
+    }
+	//-----------------------------------------------------------------------
+	const String& BspSceneManager::getTypeName(void) const
+	{
+		return BspSceneManagerFactory::FACTORY_TYPE_NAME;
+	}
+    //-----------------------------------------------------------------------
+    BspSceneManager::~BspSceneManager()
+    {
+        freeMemory();
+        mLevel.setNull();
+    }
+    //-----------------------------------------------------------------------
+    size_t BspSceneManager::estimateWorldGeometry(const String& filename)
+    {
+        return BspLevel::calculateLoadingStages(filename);
+        
+    }
+    //-----------------------------------------------------------------------
+    size_t BspSceneManager::estimateWorldGeometry(DataStreamPtr& stream, 
+		const String& typeName)
+    {
+        return BspLevel::calculateLoadingStages(stream);
+        
+    }
+    //-----------------------------------------------------------------------
+    void BspSceneManager::setWorldGeometry(const String& filename)
+    {
+        mLevel.setNull();
+        // Check extension is .bsp
+        char extension[6];
+        size_t pos = filename.find_last_of(".");
+		if( pos == String::npos )
+            OGRE_EXCEPT(
+				Exception::ERR_INVALIDPARAMS,
+                "Unable to load world geometry. Invalid extension (must be .bsp).",
+                "BspSceneManager::setWorldGeometry");
+
+        strcpy(extension, filename.substr(pos + 1, filename.length() - pos).c_str());
+
+        if (stricmp(extension, "bsp"))
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+			"Unable to load world geometry. Invalid extension (must be .bsp).",
+            "BspSceneManager::setWorldGeometry");
+
+        // Load using resource manager
+        mLevel = BspResourceManager::getSingleton().load(filename, 
+            ResourceGroupManager::getSingleton().getWorldResourceGroupName());
+
+		if (mLevel->isSkyEnabled())
+		{
+			// Quake3 is always aligned with Z upwards
+			Quaternion q;
+			q.FromAngleAxis(Radian(Math::HALF_PI), Vector3::UNIT_X);
+			// Also draw last, and make close to camera (far clip plane is shorter)
+			setSkyDome(true, mLevel->getSkyMaterialName(),
+				mLevel->getSkyCurvature(), 12, 2000, false, q);
+		}
+		else
+		{
+			setSkyDome(false, StringUtil::BLANK);
+		}
+
+        // Init static render operation
+        mRenderOp.vertexData = mLevel->mVertexData;
+        // index data is per-frame
+        mRenderOp.indexData = new IndexData();
+        mRenderOp.indexData->indexStart = 0;
+        mRenderOp.indexData->indexCount = 0;
+        // Create enough index space to render whole level
+        mRenderOp.indexData->indexBuffer = HardwareBufferManager::getSingleton()
+            .createIndexBuffer(
+                HardwareIndexBuffer::IT_32BIT, // always 32-bit
+                mLevel->mNumIndexes, 
+                HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, false);
+
+        mRenderOp.operationType = RenderOperation::OT_TRIANGLE_LIST;
+        mRenderOp.useIndexes = true;
+
+
+    }
+    //-----------------------------------------------------------------------
+    void BspSceneManager::setWorldGeometry(DataStreamPtr& stream, 
+		const String& typeName)
+    {
+        mLevel.setNull();
+
+        // Load using resource manager
+        mLevel = BspResourceManager::getSingleton().load(stream, 
+			ResourceGroupManager::getSingleton().getWorldResourceGroupName());
+
+		if (mLevel->isSkyEnabled())
+		{
+			// Quake3 is always aligned with Z upwards
+			Quaternion q;
+			q.FromAngleAxis(Radian(Math::HALF_PI), Vector3::UNIT_X);
+			// Also draw last, and make close to camera (far clip plane is shorter)
+			setSkyDome(true, mLevel->getSkyMaterialName(),
+				mLevel->getSkyCurvature(), 12, 2000, false, q);
+		}
+		else
+		{
+			setSkyDome(false, StringUtil::BLANK);
+		}
+
+        // Init static render operation
+        mRenderOp.vertexData = mLevel->mVertexData;
+        // index data is per-frame
+        mRenderOp.indexData = new IndexData();
+        mRenderOp.indexData->indexStart = 0;
+        mRenderOp.indexData->indexCount = 0;
+        // Create enough index space to render whole level
+        mRenderOp.indexData->indexBuffer = HardwareBufferManager::getSingleton()
+            .createIndexBuffer(
+                HardwareIndexBuffer::IT_32BIT, // always 32-bit
+                mLevel->mNumIndexes, 
+                HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, false);
+
+        mRenderOp.operationType = RenderOperation::OT_TRIANGLE_LIST;
+        mRenderOp.useIndexes = true;
+
+
+    }
+    //-----------------------------------------------------------------------
+    void BspSceneManager::_findVisibleObjects(Camera* cam, 
+		VisibleObjectsBoundsInfo* visibleBounds, bool onlyShadowCasters)
+    {
+        // Clear unique list of movables for this frame
+        mMovablesForRendering.clear();
+
+		// Assemble an AAB on the fly which contains the scene elements visible
+		// by the camera.
+		CamVisibleObjectsMap::iterator findIt = mCamVisibleObjectsMap.find( cam );
+
+        // Walk the tree, tag static geometry, return camera's node (for info only)
+        // Movables are now added to the render queue in processVisibleLeaf
+        walkTree(cam, &(findIt->second), onlyShadowCasters);
+    }
+    //-----------------------------------------------------------------------
+    void BspSceneManager::renderStaticGeometry(void)
+    {
+		// Check we should be rendering
+		if (!isRenderQueueToBeProcessed(mWorldGeometryRenderQueue))
+			return;
+
+        // Cache vertex/face data first
+        std::vector<StaticFaceGroup*>::const_iterator faceGrpi;
+        static RenderOperation patchOp;
+        
+        // no world transform required
+        mDestRenderSystem->_setWorldMatrix(Matrix4::IDENTITY);
+        // Set view / proj
+        mDestRenderSystem->_setViewMatrix(mCameraInProgress->getViewMatrix(true));
+        mDestRenderSystem->_setProjectionMatrix(mCameraInProgress->getProjectionMatrixRS());
+
+        // For each material in turn, cache rendering data & render
+        MaterialFaceGroupMap::const_iterator mati;
+
+        for (mati = mMatFaceGroupMap.begin(); mati != mMatFaceGroupMap.end(); ++mati)
+        {
+            // Get Material
+            Material* thisMaterial = mati->first;
+
+            // Empty existing cache
+            mRenderOp.indexData->indexCount = 0;
+            // lock index buffer ready to receive data
+            unsigned int* pIdx = static_cast<unsigned int*>(
+                mRenderOp.indexData->indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+
+            for (faceGrpi = mati->second.begin(); faceGrpi != mati->second.end(); ++faceGrpi)
+            {
+                // Cache each
+                unsigned int numelems = cacheGeometry(pIdx, *faceGrpi);
+                mRenderOp.indexData->indexCount += numelems;
+                pIdx += numelems;
+            }
+            // Unlock the buffer
+            mRenderOp.indexData->indexBuffer->unlock();
+
+            // Skip if no faces to process (we're not doing flare types yet)
+            if (mRenderOp.indexData->indexCount == 0)
+                continue;
+
+            Technique::PassIterator pit = thisMaterial->getTechnique(0)->getPassIterator();
+
+            while (pit.hasMoreElements())
+            {
+                _setPass(pit.getNext());
+
+                mDestRenderSystem->_render(mRenderOp);
+
+
+            } 
+
+
+        } // for each material
+
+        /*
+        if (mShowNodeAABs)
+        {
+            mDestRenderSystem->_render(mAABGeometry);
+        }
+        */
+    }
+    //-----------------------------------------------------------------------
+    void BspSceneManager::_renderVisibleObjects(void)
+    {
+        // Render static level geometry first
+        renderStaticGeometry();
+
+        // Call superclass to render the rest
+        SceneManager::_renderVisibleObjects();
+
+    }
+
+    //-----------------------------------------------------------------------
+    // REMOVE THIS CRAP
+    //-----------------------------------------------------------------------
+    // Temp debug lines
+    bool firstTime = true;
+    std::ofstream of;
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    BspNode* BspSceneManager::walkTree(Camera* camera, 
+		VisibleObjectsBoundsInfo *visibleBounds, bool onlyShadowCasters)
+    {
+		if (mLevel.isNull()) return 0;
+
+        // Locate the leaf node where the camera is located
+        BspNode* cameraNode = mLevel->findLeaf(camera->getDerivedPosition());
+
+        mMatFaceGroupMap.clear();
+        mFaceGroupSet.clear();
+
+        // Scan through all the other leaf nodes looking for visibles
+        int i = mLevel->mNumNodes - mLevel->mLeafStart;
+        BspNode* nd = mLevel->mRootNode + mLevel->mLeafStart;
+
+        /*
+        if (firstTime)
+        {
+            camera->getViewMatrix(); // Force update view before report
+            of.open("BspSceneManager.log");
+            of << *camera << std::endl;
+            of << "Camera Node: " << *cameraNode << std::endl;
+            of << "Vertex Data: " << std::endl;
+            for (int testi = 0; testi < mLevel->mNumVertices; ++testi)
+            {
+                of << " " << testi << ": pos(" <<
+                  mLevel->mVertices[testi].position[0] << ", " <<
+                    mLevel->mVertices[testi].position[1] << ", " << mLevel->mVertices[testi].position[2] << ")" <<
+                    " uv(" << mLevel->mVertices[testi].texcoords[0] << ", " << mLevel->mVertices[testi].texcoords[1] << ")" <<
+                    " lm(" << mLevel->mVertices[testi].lightmap[0] << ", " << mLevel->mVertices[testi].lightmap[1] << ")" << std::endl;
+            }
+            of << "Element data:" << std::endl;
+            for (testi = 0; testi < mLevel->mNumElements; ++testi)
+            {
+                of << " " << testi << ": " << mLevel->mElements[testi] << std::endl;
+
+            }
+        }
+        */
+
+        while (i--)
+        {
+            if (mLevel->isLeafVisible(cameraNode, nd))
+            {
+
+                // Visible according to PVS, check bounding box against frustum
+                FrustumPlane plane;
+                if (camera->isVisible(nd->getBoundingBox(), &plane))
+                {
+                    //if (firstTime)
+                    //{
+                    //    of << "Visible Node: " << *nd << std::endl;
+                    //}
+                    processVisibleLeaf(nd, camera, visibleBounds, onlyShadowCasters);
+                    if (mShowNodeAABs)
+                        addBoundingBox(nd->getBoundingBox(), true);
+                }
+            }
+            nd++;
+        }
+
+
+        // TEST
+        //if (firstTime)
+        //{
+        //    of.close();
+        //    firstTime = false;
+        //}
+        return cameraNode;
+
+    }
+    //-----------------------------------------------------------------------
+    void BspSceneManager::processVisibleLeaf(BspNode* leaf, Camera* cam, 
+		VisibleObjectsBoundsInfo* visibleBounds, bool onlyShadowCasters)
+    {
+        MaterialPtr pMat;
+        // Skip world geometry if we're only supposed to process shadow casters
+        // World is pre-lit
+        if (!onlyShadowCasters)
+        {
+            // Parse the leaf node's faces, add face groups to material map
+            int numGroups = leaf->getNumFaceGroups();
+            int idx = leaf->getFaceGroupStart();
+
+            while (numGroups--)
+            {
+                int realIndex = mLevel->mLeafFaceGroups[idx++];
+                // Check not already included
+                if (mFaceGroupSet.find(realIndex) != mFaceGroupSet.end())
+                    continue;
+                StaticFaceGroup* faceGroup = mLevel->mFaceGroups + realIndex;
+                // Get Material pointer by handle
+                pMat = MaterialManager::getSingleton().getByHandle(faceGroup->materialHandle);
+                assert (!pMat.isNull());
+                // Check normal (manual culling)
+                ManualCullingMode cullMode = pMat->getTechnique(0)->getPass(0)->getManualCullingMode();
+                if (cullMode != MANUAL_CULL_NONE)
+                {
+                    Real dist = faceGroup->plane.getDistance(cam->getDerivedPosition());
+                    if ( (dist < 0 && cullMode == MANUAL_CULL_BACK) ||
+                        (dist > 0 && cullMode == MANUAL_CULL_FRONT) )
+                        continue; // skip
+                }
+                mFaceGroupSet.insert(realIndex);
+                // Try to insert, will find existing if already there
+                std::pair<MaterialFaceGroupMap::iterator, bool> matgrpi;
+                matgrpi = mMatFaceGroupMap.insert(
+                    MaterialFaceGroupMap::value_type(pMat.getPointer(), std::vector<StaticFaceGroup*>())
+                    );
+                // Whatever happened, matgrpi.first is map iterator
+                // Need to get second part of that to get vector
+                matgrpi.first->second.push_back(faceGroup);
+
+                //if (firstTime)
+                //{
+                //    of << "  Emitting faceGroup: index=" << realIndex << ", " << *faceGroup << std::endl;
+                //}
+            }
+        }
+
+        // Add movables to render queue, provided it hasn't been seen already
+        const BspNode::IntersectingObjectSet& objects = leaf->getObjects();
+        BspNode::IntersectingObjectSet::const_iterator oi, oiend;
+        oiend = objects.end();
+        for (oi = objects.begin(); oi != oiend; ++oi)
+        {
+            if (mMovablesForRendering.find(*oi) == mMovablesForRendering.end())
+            {
+                // It hasn't been seen yet
+                MovableObject *mov = const_cast<MovableObject*>(*oi); // hacky
+                if (mov->isVisible() && 
+                    (!onlyShadowCasters || mov->getCastShadows()) && 
+					cam->isVisible(mov->getWorldBoundingBox()))
+                {
+                    mov->_notifyCurrentCamera(cam);
+                    mov->_updateRenderQueue(getRenderQueue());
+                    // Check if the bounding box should be shown.
+                    SceneNode* sn = static_cast<SceneNode*>(mov->getParentNode());
+                    if (sn->getShowBoundingBox() || mShowBoundingBoxes)
+                    {
+                        sn->_addBoundingBoxToQueue(getRenderQueue());
+                    }
+                    mMovablesForRendering.insert(*oi);
+
+					// update visible boundaries aab
+					if (visibleBounds)
+					{
+						visibleBounds->merge((*oi)->getWorldBoundingBox(true), 
+							(*oi)->getWorldBoundingSphere(true), cam);
+					}
+                }
+
+            }
+        }
+
+
+    }
+    //-----------------------------------------------------------------------
+    unsigned int BspSceneManager::cacheGeometry(unsigned int* pIndexes, 
+        const StaticFaceGroup* faceGroup)
+    {
+        // Skip sky always
+        if (faceGroup->isSky)
+            return 0;
+
+        size_t idxStart, numIdx, vertexStart;
+
+        if (faceGroup->fType == FGT_FACE_LIST)
+        {
+            idxStart = faceGroup->elementStart;
+            numIdx = faceGroup->numElements;
+            vertexStart = faceGroup->vertexStart;
+        }
+        else if (faceGroup->fType == FGT_PATCH)
+        {
+
+            idxStart = faceGroup->patchSurf->getIndexOffset();
+            numIdx = faceGroup->patchSurf->getCurrentIndexCount();
+            vertexStart = faceGroup->patchSurf->getVertexOffset();
+        }
+		else
+		{
+			// Unsupported face type
+			return 0;
+		}
+
+
+        // Copy index data
+        unsigned int* pSrc = static_cast<unsigned int*>(
+            mLevel->mIndexes->lock(
+                idxStart * sizeof(unsigned int),
+                numIdx * sizeof(unsigned int), 
+                HardwareBuffer::HBL_READ_ONLY));
+        // Offset the indexes here
+        // we have to do this now rather than up-front because the 
+        // indexes are sometimes reused to address different vertex chunks
+        for (size_t elem = 0; elem < numIdx; ++elem)
+        {
+            *pIndexes++ = *pSrc++ + vertexStart;
+        }
+        mLevel->mIndexes->unlock();
+
+        // return number of elements
+        return static_cast<unsigned int>(numIdx);
+
+
+    }
+
+    //-----------------------------------------------------------------------
+    void BspSceneManager::freeMemory(void)
+    {
+        // no need to delete index buffer, will be handled by shared pointer
+        delete mRenderOp.indexData;
+		mRenderOp.indexData = 0;
+    }
+    //-----------------------------------------------------------------------
+    void BspSceneManager::showNodeBoxes(bool show)
+    {
+        mShowNodeAABs = show;
+    }
+    //-----------------------------------------------------------------------
+    void BspSceneManager::addBoundingBox(const AxisAlignedBox& aab, bool visible)
+    {
+        /*
+        unsigned long visibleColour;
+        unsigned long nonVisibleColour;
+        Root& r = Root::getSingleton();
+
+        r.convertColourValue(ColourValue::White, &visibleColour);
+        r.convertColourValue(ColourValue::Blue, &nonVisibleColour);
+        if (mShowNodeAABs)
+        {
+            // Add set of lines
+            float* pVertices = (float*)mAABGeometry.pVertices + (mAABGeometry.numVertices*3);
+            unsigned short* pIndexes = mAABGeometry.pIndexes + mAABGeometry.numIndexes;
+            unsigned long* pColours = (unsigned long*)mAABGeometry.pDiffuseColour + mAABGeometry.numVertices;
+
+            const Vector3* pCorner = aab.getAllCorners();
+
+            int i;
+            for (i = 0; i < 8; ++i)
+            {
+                *pVertices++ = pCorner->x;
+                *pVertices++ = pCorner->y;
+                *pVertices++ = pCorner->z;
+                pCorner++;
+
+                if (visible)
+                {
+                    *pColours++ = visibleColour;
+                }
+                else
+                {
+                    *pColours++ = nonVisibleColour;
+                }
+
+            }
+
+            *pIndexes++ = 0 + mAABGeometry.numVertices;
+            *pIndexes++ = 1 + mAABGeometry.numVertices;
+            *pIndexes++ = 1 + mAABGeometry.numVertices;
+            *pIndexes++ = 2 + mAABGeometry.numVertices;
+            *pIndexes++ = 2 + mAABGeometry.numVertices;
+            *pIndexes++ = 3 + mAABGeometry.numVertices;
+            *pIndexes++ = 3 + mAABGeometry.numVertices;
+            *pIndexes++ = 1 + mAABGeometry.numVertices;
+            *pIndexes++ = 4 + mAABGeometry.numVertices;
+            *pIndexes++ = 5 + mAABGeometry.numVertices;
+            *pIndexes++ = 5 + mAABGeometry.numVertices;
+            *pIndexes++ = 6 + mAABGeometry.numVertices;
+            *pIndexes++ = 6 + mAABGeometry.numVertices;
+            *pIndexes++ = 7 + mAABGeometry.numVertices;
+            *pIndexes++ = 7 + mAABGeometry.numVertices;
+            *pIndexes++ = 4 + mAABGeometry.numVertices;
+            *pIndexes++ = 1 + mAABGeometry.numVertices;
+            *pIndexes++ = 5 + mAABGeometry.numVertices;
+            *pIndexes++ = 2 + mAABGeometry.numVertices;
+            *pIndexes++ = 4 + mAABGeometry.numVertices;
+            *pIndexes++ = 0 + mAABGeometry.numVertices;
+            *pIndexes++ = 6 + mAABGeometry.numVertices;
+            *pIndexes++ = 3 + mAABGeometry.numVertices;
+            *pIndexes++ = 7 + mAABGeometry.numVertices;
+
+
+            mAABGeometry.numVertices += 8;
+            mAABGeometry.numIndexes += 24;
+
+
+        }
+        */
+
+    }
+    //-----------------------------------------------------------------------
+    ViewPoint BspSceneManager::getSuggestedViewpoint(bool random)
+    {
+        if (mLevel.isNull() || mLevel->mPlayerStarts.size() == 0)
+        {
+            // No level, use default
+            return SceneManager::getSuggestedViewpoint(random);
+        }
+        else
+        {
+            if (random)
+            {
+                size_t idx = (size_t)( Math::UnitRandom() * mLevel->mPlayerStarts.size() );
+                return mLevel->mPlayerStarts[idx];
+            }
+            else
+            {
+                return mLevel->mPlayerStarts[0];
+            }
+
+
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    SceneNode * BspSceneManager::createSceneNode( void )
+    {
+        BspSceneNode * sn = new BspSceneNode( this );
+        mSceneNodes[ sn->getName() ] = sn;
+        return sn;
+    }
+    //-----------------------------------------------------------------------
+    SceneNode * BspSceneManager::createSceneNode( const String &name )
+    {
+        BspSceneNode * sn = new BspSceneNode( this, name );
+        mSceneNodes[ sn->getName() ] = sn;
+        return sn;
+    }
+    //-----------------------------------------------------------------------
+    void BspSceneManager::_notifyObjectMoved(const MovableObject* mov, 
+        const Vector3& pos)
+    {
+		if (!mLevel.isNull())
+		{
+			mLevel->_notifyObjectMoved(mov, pos);
+		}
+    }
+    //-----------------------------------------------------------------------
+	void BspSceneManager::_notifyObjectDetached(const MovableObject* mov)
+	{
+		if (!mLevel.isNull())
+		{
+			mLevel->_notifyObjectDetached(mov);
+		}
+	}
+	//-----------------------------------------------------------------------
+	void BspSceneManager::clearScene(void)
+	{
+		SceneManager::clearScene();
+		freeMemory();
+		// Clear level
+		mLevel.setNull();
+	}
+    //-----------------------------------------------------------------------
+    /*
+    AxisAlignedBoxSceneQuery* BspSceneManager::
+    createAABBQuery(const AxisAlignedBox& box, unsigned long mask)
+    {
+        // TODO
+        return NULL;
+    }
+    //-----------------------------------------------------------------------
+    SphereSceneQuery* BspSceneManager::
+    createSphereQuery(const Sphere& sphere, unsigned long mask)
+    {
+        // TODO
+        return NULL;
+    }
+    */
+    //-----------------------------------------------------------------------
+    RaySceneQuery* BspSceneManager::
+    createRayQuery(const Ray& ray, unsigned long mask)
+    {
+        BspRaySceneQuery* q = new BspRaySceneQuery(this);
+        q->setRay(ray);
+        q->setQueryMask(mask);
+        return q;
+    }
+    //-----------------------------------------------------------------------
+    IntersectionSceneQuery* BspSceneManager::
+    createIntersectionQuery(unsigned long mask)
+    {
+        BspIntersectionSceneQuery* q = new BspIntersectionSceneQuery(this);
+        q->setQueryMask(mask);
+        return q;
+    }
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    BspIntersectionSceneQuery::BspIntersectionSceneQuery(SceneManager* creator) 
+        : DefaultIntersectionSceneQuery(creator)
+    {
+        // Add bounds fragment type
+        mSupportedWorldFragments.insert(SceneQuery::WFT_PLANE_BOUNDED_REGION);
+        
+    }
+    void BspIntersectionSceneQuery::execute(IntersectionSceneQueryListener* listener)
+    {
+        /*
+        Go through each leaf node in BspLevel and check movables against each other and world
+        Issue: some movable-movable intersections could be reported twice if 2 movables
+        overlap 2 leaves?
+        */
+        const BspLevelPtr& lvl = ((BspSceneManager*)mParentSceneMgr)->getLevel();
+		if (lvl.isNull()) return;
+
+        BspNode* leaf = lvl->getLeafStart();
+        int numLeaves = lvl->getNumLeaves();
+        
+        while (numLeaves--)
+        {
+            const BspNode::IntersectingObjectSet& objects = leaf->getObjects();
+            int numObjects = (int)objects.size();
+
+            BspNode::IntersectingObjectSet::const_iterator a, b, theEnd;
+            theEnd = objects.end();
+            a = objects.begin();
+            for (int oi = 0; oi < numObjects; ++oi, ++a)
+            {
+                const MovableObject* aObj = *a;
+                // Skip this object if collision not enabled
+                if (!(aObj->getQueryFlags() & mQueryMask) ||
+					!(aObj->getTypeFlags() & mQueryTypeMask) ||
+					!aObj->isInScene())
+                    continue;
+
+                if (oi < (numObjects-1))
+                {
+                    // Check object against others in this node
+                    b = a;
+                    for (++b; b != theEnd; ++b)
+                    {
+                        const MovableObject* bObj = *b;
+                        // Apply mask to b (both must pass)
+                        if ((bObj->getQueryFlags() & mQueryMask) && 
+							(bObj->getTypeFlags() & mQueryTypeMask) && 
+							bObj->isInScene())
+                        {
+                            const AxisAlignedBox& box1 = aObj->getWorldBoundingBox();
+                            const AxisAlignedBox& box2 = bObj->getWorldBoundingBox();
+
+                            if (box1.intersects(box2))
+                            {
+                                if (!listener->queryResult(const_cast<MovableObject*>(aObj), 
+                                    const_cast<MovableObject*>(bObj)))
+									return; 
+                            }
+                        }
+                    }
+                }
+                // Check object against brushes
+                if (mQueryTypeMask & SceneManager::WORLD_GEOMETRY_TYPE_MASK)
+                {
+                    const BspNode::NodeBrushList& brushes = leaf->getSolidBrushes();
+                    BspNode::NodeBrushList::const_iterator bi, biend;
+                    biend = brushes.end();
+                    Real radius = aObj->getBoundingRadius();
+                    const Vector3& pos = aObj->getParentNode()->_getDerivedPosition();
+
+                    for (bi = brushes.begin(); bi != biend; ++bi)
+                    {
+                        std::list<Plane>::const_iterator planeit, planeitend;
+                        planeitend = (*bi)->planes.end();
+                        bool brushIntersect = true; // Assume intersecting for now
+
+                        for (planeit = (*bi)->planes.begin(); planeit != planeitend; ++planeit)
+                        {
+                            Real dist = planeit->getDistance(pos);
+                            if (dist > radius)
+                            {
+                                // Definitely excluded
+                                brushIntersect = false;
+                                break;
+                            }
+                        }
+                        if (brushIntersect)
+                        {
+                            // report this brush as it's WorldFragment
+                            assert((*bi)->fragment.fragmentType == SceneQuery::WFT_PLANE_BOUNDED_REGION);
+                            if (!listener->queryResult(const_cast<MovableObject*>(aObj), 
+                                    const_cast<WorldFragment*>(&((*bi)->fragment))))
+								return; 
+                        }
+
+                    }
+                }
+
+
+            }
+
+            ++leaf;
+        }
+
+
+
+    }
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    BspRaySceneQuery::BspRaySceneQuery(SceneManager* creator)
+        :DefaultRaySceneQuery(creator)
+    {
+        // Add supported fragment types
+        mSupportedWorldFragments.insert(SceneQuery::WFT_SINGLE_INTERSECTION);
+        mSupportedWorldFragments.insert(SceneQuery::WFT_PLANE_BOUNDED_REGION);
+    }
+    //-----------------------------------------------------------------------
+    void BspRaySceneQuery::execute(RaySceneQueryListener* listener)
+    {
+        clearTemporaries();
+		BspLevelPtr lvl = static_cast<BspSceneManager*>(mParentSceneMgr)->getLevel();
+		if (!lvl.isNull())
+		{
+			processNode(
+				lvl->getRootNode(), 
+				mRay, listener);
+		}
+    }
+    //-----------------------------------------------------------------------
+    BspRaySceneQuery::~BspRaySceneQuery()
+    {
+        clearTemporaries();
+    }
+    //-----------------------------------------------------------------------
+    void BspRaySceneQuery::clearTemporaries(void)
+    {
+        mObjsThisQuery.clear();
+        std::vector<WorldFragment*>::iterator i;
+        for (i = mSingleIntersections.begin(); i != mSingleIntersections.end(); ++i)
+        {
+            delete *i;
+        }
+        mSingleIntersections.clear();
+    }
+    //-----------------------------------------------------------------------
+    bool BspRaySceneQuery::processNode(const BspNode* node, const Ray& tracingRay, 
+        RaySceneQueryListener* listener, Real maxDistance, Real traceDistance)
+    {
+        if (node->isLeaf())
+        {
+            return processLeaf(node, tracingRay, listener, maxDistance, traceDistance);
+        }
+
+        bool res = true;
+        std::pair<bool, Real> result = tracingRay.intersects(node->getSplitPlane());
+        if (result.first && result.second < maxDistance)
+        {
+            // Crosses the split plane, need to perform 2 queries
+            // Calculate split point ray
+            Vector3 splitPoint = tracingRay.getOrigin() 
+                + tracingRay.getDirection() * result.second;
+            Ray splitRay(splitPoint, tracingRay.getDirection());
+
+            if (node->getSide(tracingRay.getOrigin()) == Plane::NEGATIVE_SIDE)
+            {
+                // Intersects from -ve side, so do back then front
+                res = processNode(
+                    node->getBack(), tracingRay, listener, result.second, traceDistance);
+                if (!res) return res;
+                
+                res = processNode(
+                    node->getFront(), splitRay, listener, 
+                    maxDistance - result.second, 
+                    traceDistance + result.second);
+            }
+            else
+            {
+                // Intersects from +ve side, so do front then back
+                res = processNode(node->getFront(), tracingRay, listener, 
+                    result.second, traceDistance);
+                if (!res) return res;
+                res = processNode(node->getBack(), splitRay, listener,
+                    maxDistance - result.second, 
+                    traceDistance + result.second);
+            }
+        }
+        else
+        {
+            // Does not cross the splitting plane, just cascade down one side
+            res = processNode(node->getNextNode(tracingRay.getOrigin()),
+                tracingRay, listener, maxDistance, traceDistance);
+        }
+
+        return res;
+    }
+    //-----------------------------------------------------------------------
+    bool BspRaySceneQuery::processLeaf(const BspNode* leaf, const Ray& tracingRay, 
+        RaySceneQueryListener* listener, Real maxDistance, Real traceDistance)
+    {
+        const BspNode::IntersectingObjectSet& objects = leaf->getObjects();
+
+        BspNode::IntersectingObjectSet::const_iterator i, iend;
+        iend = objects.end();
+        //Check ray against objects
+        for(i = objects.begin(); i != iend; ++i)
+        {
+            // cast away constness, constness of node is nothing to do with objects
+            MovableObject* obj = const_cast<MovableObject*>(*i);
+            // Skip this object if not enabled
+            if(!(obj->getQueryFlags() & mQueryMask) ||
+				!((obj->getTypeFlags() & mQueryTypeMask)))
+                continue;
+
+            // check we haven't reported this one already
+            // (objects can be intersecting more than one node)
+            if (mObjsThisQuery.find(obj) != mObjsThisQuery.end())
+                continue;
+
+            //Test object as bounding box
+            std::pair<bool, Real> result = 
+                tracingRay.intersects(obj->getWorldBoundingBox());
+            // if the result came back positive and intersection point is inside
+            // the node, fire the event handler
+            if(result.first && result.second <= maxDistance)
+            {
+                if (!listener->queryResult(obj, result.second + traceDistance))
+					return false;
+            }
+        }
+
+
+        // Check ray against brushes
+        if (mQueryTypeMask & SceneManager::WORLD_GEOMETRY_TYPE_MASK)
+        {
+            const BspNode::NodeBrushList& brushList = leaf->getSolidBrushes();
+            BspNode::NodeBrushList::const_iterator bi, biend;
+            biend = brushList.end();
+            bool intersectedBrush = false;
+            for (bi = brushList.begin(); bi != biend; ++bi)
+            {
+                BspNode::Brush* brush = *bi;
+                
+
+                std::pair<bool, Real> result = Math::intersects(tracingRay, brush->planes, true);
+                // if the result came back positive and intersection point is inside
+                // the node, check if this brush is closer
+                if(result.first && result.second <= maxDistance)
+                {
+                    intersectedBrush = true;
+                    if(mWorldFragmentType == SceneQuery::WFT_SINGLE_INTERSECTION)
+                    {
+                        // We're interested in a single intersection
+                        // Have to create these 
+                        SceneQuery::WorldFragment* wf = new SceneQuery::WorldFragment();
+                        wf->fragmentType = SceneQuery::WFT_SINGLE_INTERSECTION;
+                        wf->singleIntersection = tracingRay.getPoint(result.second);
+                        // save this so we can clean up later
+                        mSingleIntersections.push_back(wf);
+                        if (!listener->queryResult(wf, result.second + traceDistance))
+							return false;
+                    }
+                    else if (mWorldFragmentType ==  SceneQuery::WFT_PLANE_BOUNDED_REGION)
+                    {
+                        // We want the whole bounded volume
+                        assert((*bi)->fragment.fragmentType == SceneQuery::WFT_PLANE_BOUNDED_REGION);
+                        if (!listener->queryResult(const_cast<WorldFragment*>(&(brush->fragment)), 
+                            result.second + traceDistance))
+							return false; 
+
+                    }
+                }
+            }
+            if (intersectedBrush)
+            {
+                return false; // stop here
+            }
+        }
+
+        return true;
+
+    } 
+    //-----------------------------------------------------------------------
+	//-----------------------------------------------------------------------
+	const String BspSceneManagerFactory::FACTORY_TYPE_NAME = "BspSceneManager";
+	//-----------------------------------------------------------------------
+	void BspSceneManagerFactory::initMetaData(void) const
+	{
+		mMetaData.typeName = FACTORY_TYPE_NAME;
+		mMetaData.description = "Scene manager for loading Quake3 .bsp files.";
+		mMetaData.sceneTypeMask = ST_INTERIOR;
+		mMetaData.worldGeometrySupported = true;
+	}
+	//-----------------------------------------------------------------------
+	SceneManager* BspSceneManagerFactory::createInstance(
+		const String& instanceName)
+	{
+		return new BspSceneManager(instanceName);
+	}
+	//-----------------------------------------------------------------------
+	void BspSceneManagerFactory::destroyInstance(SceneManager* instance)
+	{
+		delete instance;
+	}
+
+}
+
Index: /PlugIns/BSPSceneManager/src/OgreBspSceneManagerDll.cpp
===================================================================
--- /PlugIns/BSPSceneManager/src/OgreBspSceneManagerDll.cpp	(revision 5)
+++ /PlugIns/BSPSceneManager/src/OgreBspSceneManagerDll.cpp	(revision 5)
@@ -0,0 +1,49 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreRoot.h"
+#include "OgreBspSceneManagerPlugin.h"
+
+Ogre::BspSceneManagerPlugin* bspPlugin;
+//-----------------------------------------------------------------------
+extern "C" void _OgreBspPluginExport dllStartPlugin(void)
+{
+    // Create new scene manager
+    bspPlugin = new Ogre::BspSceneManagerPlugin();
+
+    // Register
+    Ogre::Root::getSingleton().installPlugin(bspPlugin);
+
+
+}
+extern "C" void _OgreBspPluginExport dllStopPlugin(void)
+{
+	Ogre::Root::getSingleton().uninstallPlugin(bspPlugin);
+    delete bspPlugin;
+}
Index: /PlugIns/BSPSceneManager/src/OgreBspSceneManagerPlugin.cpp
===================================================================
--- /PlugIns/BSPSceneManager/src/OgreBspSceneManagerPlugin.cpp	(revision 5)
+++ /PlugIns/BSPSceneManager/src/OgreBspSceneManagerPlugin.cpp	(revision 5)
@@ -0,0 +1,83 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreBspSceneManagerPlugin.h"
+#include "OgreRoot.h"
+
+namespace Ogre 
+{
+	const String sPluginName = "BSP Scene Manager";
+	//---------------------------------------------------------------------
+	BspSceneManagerPlugin::BspSceneManagerPlugin()
+		:mBspFactory(0), mBspResourceManager(0)
+	{
+
+	}
+	//---------------------------------------------------------------------
+	const String& BspSceneManagerPlugin::getName() const
+	{
+		return sPluginName;
+	}
+	//---------------------------------------------------------------------
+	void BspSceneManagerPlugin::install()
+	{
+		// Create new scene manager
+		mBspFactory = new BspSceneManagerFactory();
+
+	}
+	//---------------------------------------------------------------------
+	void BspSceneManagerPlugin::initialise()
+	{
+		// Register (factory not dependent on rsys resources)
+		Root::getSingleton().addSceneManagerFactory(mBspFactory);
+		// Create resource manager (registers itself)
+		mBspResourceManager = new BspResourceManager();
+	}
+	//---------------------------------------------------------------------
+	void BspSceneManagerPlugin::shutdown()
+	{
+		// Unregister SM factory
+		Root::getSingleton().removeSceneManagerFactory(mBspFactory);
+
+		// delete resource manager, will unregister itself
+		delete mBspResourceManager;
+		mBspResourceManager = 0;
+
+	}
+	//---------------------------------------------------------------------
+	void BspSceneManagerPlugin::uninstall()
+	{
+
+		delete mBspFactory;
+		mBspFactory = 0;
+
+	}
+
+
+}
Index: /PlugIns/BSPSceneManager/src/OgreBspSceneNode.cpp
===================================================================
--- /PlugIns/BSPSceneManager/src/OgreBspSceneNode.cpp	(revision 5)
+++ /PlugIns/BSPSceneManager/src/OgreBspSceneNode.cpp	(revision 5)
@@ -0,0 +1,120 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreBspSceneNode.h"
+#include "OgreBspSceneManager.h"
+
+namespace Ogre {
+
+
+    void BspSceneNode::_update(bool updateChildren, bool parentHasChanged)
+    {
+        bool checkMovables = false;
+
+        if (mNeedParentUpdate || parentHasChanged)
+        {
+            // This means we've moved
+            checkMovables = true;
+        }
+
+        // Call superclass
+        SceneNode::_update(updateChildren, parentHasChanged);
+
+        if (checkMovables)
+        {
+            // Check membership of attached objects
+            ObjectMap::const_iterator it, itend;
+            itend = mObjectsByName.end();
+            for (it = mObjectsByName.begin(); it != itend; ++it)
+            {
+                MovableObject* mov = it->second;
+
+                static_cast<BspSceneManager*>(mCreator)->_notifyObjectMoved(
+                    mov, this->_getDerivedPosition());
+
+            }
+        }
+
+    }
+	//-------------------------------------------------------------------------
+	MovableObject* BspSceneNode::detachObject(unsigned short index)
+	{
+		MovableObject* ret = SceneNode::detachObject(index);
+		static_cast<BspSceneManager*>(mCreator)->_notifyObjectDetached(ret);
+		return ret;
+		
+	}
+	//-------------------------------------------------------------------------
+	MovableObject* BspSceneNode::detachObject(const String& name)
+	{
+		MovableObject* ret = SceneNode::detachObject(name);
+		static_cast<BspSceneManager*>(mCreator)->_notifyObjectDetached(ret);
+		return ret;
+	}
+	//-------------------------------------------------------------------------
+	void BspSceneNode::detachAllObjects(void)
+	{
+		ObjectMap::const_iterator i, iend;
+		iend = mObjectsByName.end();
+		for (i = mObjectsByName.begin(); i != iend; ++i)
+		{
+			static_cast<BspSceneManager*>(mCreator)
+				->_notifyObjectDetached(i->second);
+		}
+		SceneNode::detachAllObjects();
+	}
+	//-------------------------------------------------------------------------
+	void BspSceneNode::setInSceneGraph(bool inGraph)
+	{
+		if (mIsInSceneGraph != inGraph)
+		{
+			ObjectMap::const_iterator i, iend;
+			iend = mObjectsByName.end();
+			for (i = mObjectsByName.begin(); i != iend; ++i)
+			{
+				if (!inGraph)
+				{
+					// Equivalent to detaching
+					static_cast<BspSceneManager*>(mCreator)
+						->_notifyObjectDetached(i->second);
+				}
+				else
+				{
+					// move deals with re-adding
+	                static_cast<BspSceneManager*>(mCreator)->_notifyObjectMoved(
+    	                i->second, this->_getDerivedPosition());
+				}
+			}
+		}
+		mIsInSceneGraph = inGraph;
+	}
+
+}
+
+
+
Index: /PlugIns/BSPSceneManager/src/OgreQuake3Level.cpp
===================================================================
--- /PlugIns/BSPSceneManager/src/OgreQuake3Level.cpp	(revision 5)
+++ /PlugIns/BSPSceneManager/src/OgreQuake3Level.cpp	(revision 5)
@@ -0,0 +1,263 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreQuake3Level.h"
+#include "OgreLogManager.h"
+#include "OgreTextureManager.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    Quake3Level::Quake3Level()
+    {
+
+    }
+    //-----------------------------------------------------------------------
+    void Quake3Level::loadHeaderFromStream(DataStreamPtr& inStream)
+    {
+        // Load just the header
+        bsp_header_t* pHeader =  new bsp_header_t();
+        inStream->read(pHeader, sizeof(bsp_header_t));
+        mChunk = MemoryDataStreamPtr(
+            new MemoryDataStream(pHeader, sizeof(bsp_header_t), false));
+        // Grab all the counts, header only
+        initialise(true);
+		// Delete manually since delete and delete[] (as used by MemoryDataStream)
+		// are not compatible
+		delete pHeader;
+
+    }
+    //-----------------------------------------------------------------------
+    void Quake3Level::loadFromStream(DataStreamPtr& stream)
+    {
+        mChunk = MemoryDataStreamPtr(new MemoryDataStream(stream));
+        initialise();
+
+#ifdef _DEBUG
+        dumpContents();
+#endif
+
+
+    }
+    //-----------------------------------------------------------------------
+   // byte swapping functions
+   void SwapFourBytes(uint32* dw)
+   {
+      uint32 tmp;
+      tmp =  (*dw & 0x000000FF);
+      tmp = ((*dw & 0x0000FF00) >> 0x08) | (tmp << 0x08);
+      tmp = ((*dw & 0x00FF0000) >> 0x10) | (tmp << 0x08);
+      tmp = ((*dw & 0xFF000000) >> 0x18) | (tmp << 0x08);
+      memcpy (dw, &tmp, sizeof(uint32));
+   }
+   //-----------------------------------------------------------------------
+   void SwapFourBytesGrup (uint32* src, int size)
+   {
+      uint32* ptr = (uint32*)src;
+      int i;
+      for (i = 0; i < size/4; ++i) {
+         SwapFourBytes (&ptr[i]);
+      }
+   }
+   //-----------------------------------------------------------------------
+    void Quake3Level::initialise(bool headerOnly)
+    {
+        mHeader = (bsp_header_t*)mChunk->getPtr();
+
+        // Header counts
+        initialiseCounts();
+        // Data pointers
+        if (headerOnly)
+        {
+            mLumpStart = 0;
+        }
+        else
+        {
+            mLumpStart = ((unsigned char*)mHeader) + sizeof(mHeader);
+			initialisePointers();
+        }
+
+
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+		// swap header
+        SwapFourBytes ((uint32*)&mHeader->version);
+#endif
+    }
+    //-----------------------------------------------------------------------
+    void Quake3Level::initialiseCounts(void)
+    {
+        mNumEntities = getLumpSize(BSP_ENTITIES_LUMP);
+        mNumElements = getLumpSize(BSP_ELEMENTS_LUMP) / sizeof(int);
+        mNumFaces = getLumpSize(BSP_FACES_LUMP) / sizeof(bsp_face_t);
+        mNumLeafFaces = getLumpSize(BSP_LFACES_LUMP) / sizeof(int);
+        mNumLeaves = getLumpSize(BSP_LEAVES_LUMP) / sizeof(bsp_leaf_t);
+        mNumLightmaps = getLumpSize(BSP_LIGHTMAPS_LUMP)/BSP_LIGHTMAP_BANKSIZE;
+        mNumModels = getLumpSize(BSP_MODELS_LUMP) / sizeof(bsp_model_t);
+        mNumNodes = getLumpSize(BSP_NODES_LUMP) / sizeof(bsp_node_t);
+        mNumPlanes = getLumpSize(BSP_PLANES_LUMP)/sizeof(bsp_plane_t);
+        mNumShaders = getLumpSize(BSP_SHADERS_LUMP)/sizeof(bsp_shader_t);
+        mNumVertices = getLumpSize(BSP_VERTICES_LUMP)/sizeof(bsp_vertex_t);
+        mNumLeafBrushes = getLumpSize(BSP_LBRUSHES_LUMP)/sizeof(int);
+        mNumBrushes = getLumpSize(BSP_BRUSH_LUMP)/sizeof(bsp_brush_t);
+        mNumBrushSides = getLumpSize(BSP_BRUSHSIDES_LUMP)/sizeof(bsp_brushside_t);
+    }
+    //-----------------------------------------------------------------------
+    void Quake3Level::initialisePointers(void)
+    {
+        mEntities = (unsigned char*)getLump(BSP_ENTITIES_LUMP);
+        mElements = (int*)getLump(BSP_ELEMENTS_LUMP);
+        mFaces = (bsp_face_t*)getLump(BSP_FACES_LUMP);
+        mLeafFaces = (int*)getLump(BSP_LFACES_LUMP);
+        mLeaves = (bsp_leaf_t*)getLump(BSP_LEAVES_LUMP);
+        mLightmaps = (unsigned char*)getLump(BSP_LIGHTMAPS_LUMP);
+        mModels = (bsp_model_t*)getLump(BSP_MODELS_LUMP);
+        mNodes = (bsp_node_t*)getLump(BSP_NODES_LUMP);
+        mPlanes = (bsp_plane_t*) getLump(BSP_PLANES_LUMP);
+        mShaders = (bsp_shader_t*) getLump(BSP_SHADERS_LUMP);
+        mVis = (bsp_vis_t*)getLump(BSP_VISIBILITY_LUMP);
+        mVertices = (bsp_vertex_t*) getLump(BSP_VERTICES_LUMP);
+        mLeafBrushes = (int*)getLump(BSP_LBRUSHES_LUMP);
+        mBrushes = (bsp_brush_t*) getLump(BSP_BRUSH_LUMP);
+        mBrushSides = (bsp_brushside_t*) getLump(BSP_BRUSHSIDES_LUMP);
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+        SwapFourBytesGrup ((uint32*)mElements, mNumElements*sizeof(int));
+        SwapFourBytesGrup ((uint32*)mFaces, mNumFaces*sizeof(bsp_face_t));
+        SwapFourBytesGrup ((uint32*)mLeafFaces, mNumLeafFaces*sizeof(int));
+        SwapFourBytesGrup ((uint32*)mLeaves, mNumLeaves*sizeof(bsp_leaf_t));
+        SwapFourBytesGrup ((uint32*)mModels, mNumModels*sizeof(bsp_model_t));
+        SwapFourBytesGrup ((uint32*)mNodes, mNumNodes*sizeof(bsp_node_t));
+        SwapFourBytesGrup ((uint32*)mPlanes, mNumPlanes*sizeof(bsp_plane_t));
+        for (int i=0; i < mNumShaders; ++i) {
+            SwapFourBytes((uint32*)&mShaders[i].surface_flags);
+            SwapFourBytes((uint32*)&mShaders[i].content_flags);
+        }   
+        SwapFourBytes((uint32*)&mVis->cluster_count);
+        SwapFourBytes((uint32*)&mVis->row_size);
+        SwapFourBytesGrup ((uint32*)mVertices, mNumVertices*sizeof(bsp_vertex_t));
+        SwapFourBytesGrup ((uint32*)mLeafBrushes, mNumLeafBrushes*sizeof(int));
+        SwapFourBytesGrup ((uint32*)mBrushes,  mNumBrushes*sizeof(bsp_brush_t));
+        SwapFourBytesGrup ((uint32*)mBrushSides, mNumBrushSides*sizeof(bsp_brushside_t));
+#endif
+    }
+    //-----------------------------------------------------------------------
+    void* Quake3Level::getLump(int lumpType)
+    {
+        if (mLumpStart)
+        {
+       
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+            // swap lump offset
+            SwapFourBytes ((uint32*)&mHeader->lumps[lumpType].offset);
+#endif
+            return (unsigned char*)mHeader + mHeader->lumps[lumpType].offset;
+        }
+        else
+        {
+            return 0;
+        }
+    }
+    //-----------------------------------------------------------------------
+    int Quake3Level::getLumpSize(int lumpType)
+    {
+
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+        // swap lump size
+        SwapFourBytes ((uint32*)&mHeader->lumps[lumpType].size);
+#endif
+        return mHeader->lumps[lumpType].size;
+    }
+    //-----------------------------------------------------------------------
+    void Quake3Level::dumpContents(void)
+    {
+        std::ofstream of;
+        of.open("Quake3Level.log");
+
+
+        of << "Quake3 level statistics" << std::endl;
+        of << "-----------------------" << std::endl;
+        of << "Entities     : " << mNumEntities << std::endl;
+        of << "Faces        : " << mNumFaces << std::endl;
+        of << "Leaf Faces   : " << mNumLeafFaces << std::endl;
+        of << "Leaves       : " << mNumLeaves << std::endl;
+        of << "Lightmaps    : " << mNumLightmaps << std::endl;
+        of << "Elements     : " << mNumElements << std::endl;
+        of << "Models       : " << mNumModels << std::endl;
+        of << "Nodes        : " << mNumNodes << std::endl;
+        of << "Planes       : " << mNumPlanes << std::endl;
+        of << "Shaders      : " << mNumShaders << std::endl;
+        of << "Vertices     : " << mNumVertices << std::endl;
+        of << "Vis Clusters : " << mVis->cluster_count << std::endl;
+
+        of << std::endl;
+        of << "-= Shaders =-";
+        of << std::endl;
+        for (int i = 0; i < mNumShaders; ++i)
+        {
+            of << "Shader " << i << ": " << mShaders[i].name << std::endl;
+        }
+
+        of << std::endl;
+        of << "-= Entities =-";
+        of << std::endl;
+        char* strEnt = strtok((char*)mEntities, "\0");
+        while (strEnt != 0)
+        {
+            of << strEnt << std::endl;
+            strEnt = strtok(0, "\0");
+        }
+
+
+
+
+        of.close();
+    }
+    //-----------------------------------------------------------------------
+    void Quake3Level::extractLightmaps(void) const
+    {
+        // Lightmaps are always 128x128x24 (RGB)
+        unsigned char* pLightmap = mLightmaps;
+        for (int i = 0; i < mNumLightmaps; ++i)
+        {
+			StringUtil::StrStreamType name;
+            name << "@lightmap" << i;
+
+            // Load, no mipmaps, brighten by factor 2.5
+			DataStreamPtr stream(new MemoryDataStream(pLightmap, 128 * 128 * 3, false));
+            Image img; 
+			img.loadRawData( stream, 128, 128, PF_BYTE_RGB );
+            TextureManager::getSingleton().loadImage( name.str(), 
+				ResourceGroupManager::getSingleton().getWorldResourceGroupName(), img, TEX_TYPE_2D, 0, 4.0f );
+            pLightmap += BSP_LIGHTMAP_BANKSIZE;
+        }
+
+
+    }
+    //-----------------------------------------------------------------------
+
+
+}
Index: /PlugIns/BSPSceneManager/src/OgreQuake3Shader.cpp
===================================================================
--- /PlugIns/BSPSceneManager/src/OgreQuake3Shader.cpp	(revision 5)
+++ /PlugIns/BSPSceneManager/src/OgreQuake3Shader.cpp	(revision 5)
@@ -0,0 +1,285 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreQuake3Shader.h"
+#include "OgreSceneManager.h"
+#include "OgreMaterial.h"
+#include "OgreTechnique.h"
+#include "OgrePass.h"
+#include "OgreTextureUnitState.h"
+#include "OgreMath.h"
+#include "OgreLogManager.h"
+#include "OgreTextureManager.h"
+#include "OgreRoot.h"
+#include "OgreMaterialManager.h"
+
+namespace Ogre {
+
+
+    //-----------------------------------------------------------------------
+    Quake3Shader::Quake3Shader(const String& name)
+    {
+        mName = name;
+        numPasses = 0;
+        deformFunc = DEFORM_FUNC_NONE;
+        farbox = false;
+        skyDome = false;
+        flags = 0;
+        fog = false;
+        cullMode = MANUAL_CULL_BACK;
+
+    }
+    //-----------------------------------------------------------------------
+    Quake3Shader::~Quake3Shader()
+    {
+    }
+    //-----------------------------------------------------------------------
+    MaterialPtr Quake3Shader::createAsMaterial(int lightmapNumber)
+    {
+		String matName;
+		StringUtil::StrStreamType str;
+        String resourceGroup = ResourceGroupManager::getSingleton().getWorldResourceGroupName();
+
+        str << mName << "#" << lightmapNumber;
+		matName = str.str();
+
+        MaterialPtr mat = MaterialManager::getSingleton().create(matName, 
+            resourceGroup);
+		Ogre::Pass* ogrePass = mat->getTechnique(0)->getPass(0);
+
+        LogManager::getSingleton().logMessage("Using Q3 shader " + mName, LML_CRITICAL);
+        for (int p = 0; p < numPasses; ++p)
+        {
+            TextureUnitState* t;
+            // Create basic texture
+            if (pass[p].textureName == "$lightmap")
+            {
+                StringUtil::StrStreamType str2;
+				str2 << "@lightmap" << lightmapNumber;
+                t = ogrePass->createTextureUnitState(str2.str());
+            }
+            // Animated texture support
+            else if (pass[p].animNumFrames > 0)
+            {
+                Real sequenceTime = pass[p].animNumFrames / pass[p].animFps;
+                /* Pre-load textures
+                   We need to know if each one was loaded OK since extensions may change for each
+                   Quake3 can still include alternate extension filenames e.g. jpg instead of tga
+                   Pain in the arse - have to check for each frame as letters<n>.tga for example
+                   is different per frame!
+                */
+                for (unsigned int alt = 0; alt < pass[p].animNumFrames; ++alt)
+                {
+                    if (!ResourceGroupManager::getSingleton().resourceExists(
+                        resourceGroup, pass[p].frames[alt]))
+                    {
+                        // Try alternate extension
+                        pass[p].frames[alt] = getAlternateName(pass[p].frames[alt]);
+                        if (!ResourceGroupManager::getSingleton().resourceExists(
+                            resourceGroup, pass[p].frames[alt]))
+                        { 
+                            // stuffed - no texture
+                            continue;
+                        }
+                    }
+
+                }
+
+                t = ogrePass->createTextureUnitState("");
+                t->setAnimatedTextureName(pass[p].frames, pass[p].animNumFrames, sequenceTime);
+
+            }
+            else
+            {
+                // Quake3 can still include alternate extension filenames e.g. jpg instead of tga
+                // Pain in the arse - have to check for failure
+                if (!ResourceGroupManager::getSingleton().resourceExists(
+                    resourceGroup, pass[p].textureName))
+                {
+                    // Try alternate extension
+                    pass[p].textureName = getAlternateName(pass[p].textureName);
+                    if (!ResourceGroupManager::getSingleton().resourceExists(
+                        resourceGroup, pass[p].textureName))
+                    { 
+                        // stuffed - no texture
+                        continue;
+                    }
+                }
+                t = ogrePass->createTextureUnitState(pass[p].textureName);
+            }
+            // Blending
+            if (p == 0)
+            {
+                // scene blend
+                mat->setSceneBlending(pass[p].blendSrc, pass[p].blendDest);
+                if (mat->isTransparent())
+                    mat->setDepthWriteEnabled(false);
+
+                t->setColourOperation(LBO_REPLACE);
+				// Alpha mode
+				ogrePass->setAlphaRejectSettings(
+					pass[p].alphaFunc, pass[p].alphaVal);
+            }
+            else
+            {
+                if (pass[p].customBlend)
+                {
+                    // Fallback for now
+                    t->setColourOperation(LBO_MODULATE);
+                }
+                else
+                {
+                    // simple layer blend
+                    t->setColourOperation(pass[p].blend);
+                }
+				// Alpha mode, prefer 'most alphary'
+				CompareFunction currFunc = ogrePass->getAlphaRejectFunction();
+				unsigned char currVal = ogrePass->getAlphaRejectValue();
+				if (pass[p].alphaFunc > currFunc ||
+					(pass[p].alphaFunc == currFunc && pass[p].alphaVal < currVal))
+				{
+					ogrePass->setAlphaRejectSettings(
+						pass[p].alphaFunc, pass[p].alphaVal);
+				}
+            }
+            // Tex coords
+            if (pass[p].texGen == TEXGEN_BASE)
+            {
+                t->setTextureCoordSet(0);
+            }
+            else if (pass[p].texGen == TEXGEN_LIGHTMAP)
+            {
+                t->setTextureCoordSet(1);
+            }
+            else if (pass[p].texGen == TEXGEN_ENVIRONMENT)
+            {
+                t->setEnvironmentMap(true, TextureUnitState::ENV_PLANAR);
+            }
+            // Tex mod
+            // Scale
+            t->setTextureUScale(pass[p].tcModScale[0]);
+            t->setTextureVScale(pass[p].tcModScale[1]);
+            // Procedural mods
+            // Custom - don't use mod if generating environment
+            // Because I do env a different way it look horrible
+            if (pass[p].texGen != TEXGEN_ENVIRONMENT)
+            {
+                if (pass[p].tcModRotate)
+                {
+                    t->setRotateAnimation(pass[p].tcModRotate);
+                }
+                if (pass[p].tcModScroll[0] || pass[p].tcModScroll[1])
+                {
+                    if (pass[p].tcModTurbOn)
+                    {
+                        // Turbulent scroll
+                        if (pass[p].tcModScroll[0])
+                        {
+                            t->setTransformAnimation(TextureUnitState::TT_TRANSLATE_U, WFT_SINE,
+                                pass[p].tcModTurb[0], pass[p].tcModTurb[3], pass[p].tcModTurb[2], pass[p].tcModTurb[1]);
+                        }
+                        if (pass[p].tcModScroll[1])
+                        {
+                            t->setTransformAnimation(TextureUnitState::TT_TRANSLATE_V, WFT_SINE,
+                                pass[p].tcModTurb[0], pass[p].tcModTurb[3], pass[p].tcModTurb[2], pass[p].tcModTurb[1]);
+                        }
+                    }
+                    else
+                    {
+                        // Constant scroll
+                        t->setScrollAnimation(pass[p].tcModScroll[0], pass[p].tcModScroll[1]);
+                    }
+                }
+                if (pass[p].tcModStretchWave != SHADER_FUNC_NONE)
+                {
+                    WaveformType wft;
+                    switch(pass[p].tcModStretchWave)
+                    {
+                    case SHADER_FUNC_SIN:
+                        wft = WFT_SINE;
+                        break;
+                    case SHADER_FUNC_TRIANGLE:
+                        wft = WFT_TRIANGLE;
+                        break;
+                    case SHADER_FUNC_SQUARE:
+                        wft = WFT_SQUARE;
+                        break;
+                    case SHADER_FUNC_SAWTOOTH:
+                        wft = WFT_SAWTOOTH;
+                        break;
+                    case SHADER_FUNC_INVERSESAWTOOTH:
+                        wft = WFT_INVERSE_SAWTOOTH;
+                        break;
+                    default:
+                        break;
+                    }
+                    // Create wave-based stretcher
+                    t->setTransformAnimation(TextureUnitState::TT_SCALE_U, wft, pass[p].tcModStretchParams[3],
+                        pass[p].tcModStretchParams[0], pass[p].tcModStretchParams[2], pass[p].tcModStretchParams[1]);
+                    t->setTransformAnimation(TextureUnitState::TT_SCALE_V, wft, pass[p].tcModStretchParams[3],
+                        pass[p].tcModStretchParams[0], pass[p].tcModStretchParams[2], pass[p].tcModStretchParams[1]);
+                }
+            }
+            // Address mode
+            t->setTextureAddressingMode(pass[p].addressMode);
+
+            //assert(!t->isBlank());
+
+
+        }
+        // Do farbox (create new material)
+
+        // Set culling mode and lighting to defaults
+        mat->setCullingMode(CULL_NONE);
+        mat->setManualCullingMode(cullMode);
+        mat->setLightingEnabled(false);
+        mat->load();
+        return mat;
+    }
+    String Quake3Shader::getAlternateName(const String& texName)
+    {
+        // Get alternative JPG to TGA and vice versa
+        size_t pos;
+        String ext, base;
+
+        pos = texName.find_last_of(".");
+        ext = texName.substr(pos, 4);
+		StringUtil::toLowerCase(ext);
+        base = texName.substr(0,pos);
+        if (ext == ".jpg")
+        {
+            return base + ".tga";
+        }
+        else
+        {
+            return base + ".jpg";
+        }
+
+    }
+}
Index: /PlugIns/BSPSceneManager/src/OgreQuake3ShaderManager.cpp
===================================================================
--- /PlugIns/BSPSceneManager/src/OgreQuake3ShaderManager.cpp	(revision 5)
+++ /PlugIns/BSPSceneManager/src/OgreQuake3ShaderManager.cpp	(revision 5)
@@ -0,0 +1,508 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreQuake3ShaderManager.h"
+#include "OgreQuake3Shader.h"
+#include "OgreStringVector.h"
+#include "OgreException.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    template<> Quake3ShaderManager *Singleton<Quake3ShaderManager>::ms_Singleton = 0;
+    Quake3ShaderManager* Quake3ShaderManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    Quake3ShaderManager& Quake3ShaderManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+    //-----------------------------------------------------------------------
+
+    //-----------------------------------------------------------------------
+    Quake3ShaderManager::Quake3ShaderManager()
+    {
+        mScriptPatterns.push_back("*.shader");
+        ResourceGroupManager::getSingleton()._registerScriptLoader(this);
+    }
+    //-----------------------------------------------------------------------
+    Quake3ShaderManager::~Quake3ShaderManager()
+    {
+        // delete all shaders
+        clear();
+        ResourceGroupManager::getSingleton()._unregisterScriptLoader(this);
+    }
+    //-----------------------------------------------------------------------
+    const StringVector& Quake3ShaderManager::getScriptPatterns(void) const
+    {
+        return mScriptPatterns;
+    }
+    //-----------------------------------------------------------------------
+    Real Quake3ShaderManager::getLoadingOrder(void) const
+    {
+        return 110.0f;
+    }
+    //-----------------------------------------------------------------------
+    void Quake3ShaderManager::clear(void)
+    {
+        for (Quake3ShaderMap::iterator i = mShaderMap.begin();
+            i != mShaderMap.end(); ++i)
+        {
+            delete i->second;
+        }
+        mShaderMap.clear();
+    }
+    //-----------------------------------------------------------------------
+    Quake3Shader* Quake3ShaderManager::getByName(const String& name)
+    {
+        Quake3ShaderMap::iterator i = mShaderMap.find(name);
+        if (i == mShaderMap.end())
+        {
+            return 0;
+        }
+        return i->second;
+    }
+    //-----------------------------------------------------------------------
+    void Quake3ShaderManager::parseScript(DataStreamPtr& stream, const String& group)
+    {
+        String line;
+        Quake3Shader* pShader;
+        char tempBuf[512];
+
+        pShader = 0;
+        bool dummy = false;
+
+        while(!stream->eof())
+        {
+            line = stream->getLine();
+            // Ignore comments & blanks
+            if (!(line.length() == 0 || line.substr(0,2) == "//"))
+            {
+                if (pShader == 0)
+                {
+                    // No current shader
+                    if (getByName(line) == 0)
+                    {
+                        dummy = false;
+                    }
+                    else
+                    {
+                        // Defined before, parse but ignore
+                        // Q3A has duplicates in shaders, doh
+                        dummy = true;
+                    }
+
+                    // So first valid data should be a shader name
+                    pShader = create(line);
+                    // Skip to and over next {
+                    stream->readLine(tempBuf, 511, "{");
+                }
+                else
+                {
+                    // Already in a shader
+                    if (line == "}")
+                    {
+                        // Finished shader
+                        if (dummy && pShader)
+                        {
+                            delete pShader;
+                        }
+                        pShader = 0;
+                    }
+                    else if (line == "{")
+                    {
+                        // new pass
+                        parseNewShaderPass(stream, pShader);
+
+                    }
+                    else
+                    {
+                        // Attribute
+						StringUtil::toLowerCase(line);
+                        parseShaderAttrib(line, pShader);
+                    }
+
+                }
+
+            }
+
+
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    Quake3Shader* Quake3ShaderManager::create( const String& name)
+    {
+        // Gah, Q3A shader scripts include some duplicates - grr
+        Quake3Shader* s = new Quake3Shader(name);
+        if (mShaderMap.find(name) == mShaderMap.end())
+        {
+            mShaderMap[name] = s;
+        }
+        else
+        {
+            // deliberately ignore, will get parsed again but will not be used
+        }
+        return s;
+    }
+    //-----------------------------------------------------------------------
+    void Quake3ShaderManager::parseNewShaderPass(DataStreamPtr& stream, Quake3Shader* pShader)
+    {
+        String line;
+        int passIdx;
+
+        passIdx = pShader->numPasses;
+        pShader->numPasses++;
+        pShader->pass.resize(pShader->numPasses);
+
+        // Default pass details
+        pShader->pass[passIdx].animNumFrames = 0;
+        pShader->pass[passIdx].blend = LBO_REPLACE;
+        pShader->pass[passIdx].blendDest = SBF_ZERO;
+        pShader->pass[passIdx].blendSrc = SBF_ONE;
+        pShader->pass[passIdx].depthFunc = CMPF_LESS_EQUAL;
+        pShader->pass[passIdx].flags = 0;
+        pShader->pass[passIdx].rgbGenFunc = SHADER_GEN_IDENTITY;
+        pShader->pass[passIdx].tcModRotate = 0;
+        pShader->pass[passIdx].tcModScale[0] = pShader->pass[passIdx].tcModScale[1] = 1.0;
+        pShader->pass[passIdx].tcModScroll[0] = pShader->pass[passIdx].tcModScroll[1] = 0;
+        pShader->pass[passIdx].tcModStretchWave = SHADER_FUNC_NONE;
+        pShader->pass[passIdx].tcModTransform[0] = pShader->pass[passIdx].tcModTransform[1] = 0;
+        pShader->pass[passIdx].tcModTurbOn = false;
+        pShader->pass[passIdx].tcModTurb[0] = pShader->pass[passIdx].tcModTurb[1] =
+            pShader->pass[passIdx].tcModTurb[2] = pShader->pass[passIdx].tcModTurb[3] = 0;
+        pShader->pass[passIdx].texGen = TEXGEN_BASE;
+        pShader->pass[passIdx].addressMode = TextureUnitState::TAM_WRAP;
+        pShader->pass[passIdx].customBlend = false;
+        pShader->pass[passIdx].alphaVal = 0;
+        pShader->pass[passIdx].alphaFunc = CMPF_ALWAYS_PASS;
+
+        while (!stream->eof())
+        {
+            line = stream->getLine();
+            // Ignore comments & blanks
+            if (line.length() != 0 && line.substr(0,2) != "//")
+            {
+                if (line == "}")
+                {
+                    // end of shader
+                    return;
+                }
+                else
+                {
+                    parseShaderPassAttrib(line, pShader, &pShader->pass[passIdx]);
+                }
+            }
+
+
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Quake3ShaderManager::parseShaderAttrib( const String& line, Quake3Shader* pShader)
+    {
+        StringVector vecparams;
+
+        vecparams = StringUtil::split(line, " \t");
+        StringVector::iterator params = vecparams.begin();
+
+        if (params[0] == "skyparms")
+        {
+            if (params[1] != "-")
+            {
+                pShader->farbox = true;
+                pShader->farboxName = params[1];
+            }
+            if (params[2] != "-")
+            {
+                pShader->skyDome = true;
+                pShader->cloudHeight = atof(params[2].c_str());
+            }
+            // nearbox not supported
+        }
+        else if (params[0] == "cull")
+        {
+            if (params[1] == "disable" || params[1] == "none")
+            {
+                pShader->cullMode = MANUAL_CULL_NONE;
+            }
+            else if (params[1] == "front")
+            {
+                pShader->cullMode = MANUAL_CULL_FRONT;
+            }
+            else if (params[1] == "back")
+            {
+                pShader->cullMode = MANUAL_CULL_BACK;
+            }
+        }
+        else if (params[0] == "deformvertexes")
+        {
+            // TODO
+        }
+        else if (params[0] == "fogparms")
+        {
+            Real r,g,b;
+            r = atof(params[1].c_str());
+            g = atof(params[2].c_str());
+            b = atof(params[3].c_str());
+            pShader->fog = true;
+            pShader->fogColour = ColourValue(r,g,b);
+            pShader->fogDistance = atof(params[4].c_str());
+
+        }
+    }
+    //-----------------------------------------------------------------------
+    void Quake3ShaderManager::parseShaderPassAttrib( const String& line, Quake3Shader* pShader, Quake3Shader::Pass* pPass)
+    {
+        StringVector vecparams;
+
+        vecparams = StringUtil::split(line, " \t");
+        StringVector::iterator params = vecparams.begin();
+
+        StringUtil::toLowerCase(params[0]);
+        if (params[0] != "map" && params[0] != "clampmap" && params[0] != "animmap")
+        {
+            // lower case all except textures
+            for (size_t i = 1; i < vecparams.size(); ++i)
+                StringUtil::toLowerCase(params[i]);
+        }
+
+
+        // MAP
+        if (params[0] == "map")
+        {
+            pPass->textureName = params[1];
+			StringUtil::toLowerCase(params[1]);
+            if (params[1] == "$lightmap")
+                pPass->texGen = TEXGEN_LIGHTMAP;
+        }
+        // CLAMPMAP
+        if (params[0] == "clampmap")
+        {
+            pPass->textureName = params[1];
+			StringUtil::toLowerCase(params[1]);
+            if (params[1] == "$lightmap")
+                pPass->texGen = TEXGEN_LIGHTMAP;
+            pPass->addressMode = TextureUnitState::TAM_CLAMP;
+        }
+        // ANIMMAP
+        else if (params[0] == "animmap")
+        {
+            pPass->animFps = atof(params[1].c_str());
+            pPass->animNumFrames = static_cast<unsigned int>( vecparams.size() - 2 );
+            for (unsigned int frame = 0; frame < pPass->animNumFrames; ++frame)
+            {
+                pPass->frames[frame] = params[frame+2];
+            }
+        }
+        // BLENDFUNC
+        else if (params[0] == "blendfunc")
+        {
+            if (params[1] == "add" || params[1] == "gl_add")
+            {
+                pPass->blend = LBO_ADD;
+                pPass->blendDest = SBF_ONE;
+                pPass->blendSrc = SBF_ONE;
+            }
+            else if (params[1] == "filter" || params[1] == "gl_filter")
+            {
+                pPass->blend = LBO_MODULATE;
+                pPass->blendDest = SBF_ZERO;
+                pPass->blendSrc = SBF_DEST_COLOUR;
+            }
+            else if (params[1] == "blend" || params[1] == "gl_blend")
+            {
+                pPass->blend = LBO_ALPHA_BLEND;
+                pPass->blendDest = SBF_ONE_MINUS_SOURCE_ALPHA;
+                pPass->blendSrc = SBF_SOURCE_ALPHA;
+            }
+            else
+            {
+                // Manual blend
+                pPass->blendSrc = convertBlendFunc(params[1]);
+                pPass->blendDest = convertBlendFunc(params[2]);
+                // Detect common blends
+                if (pPass->blendSrc == SBF_ONE && pPass->blendDest == SBF_ZERO)
+                    pPass->blend = LBO_REPLACE;
+                else if (pPass->blendSrc == SBF_ONE && pPass->blendDest == SBF_ONE)
+                    pPass->blend = LBO_ADD;
+                else if ((pPass->blendSrc == SBF_ZERO && pPass->blendDest == SBF_SOURCE_COLOUR) ||
+                    (pPass->blendSrc == SBF_DEST_COLOUR && pPass->blendDest == SBF_ZERO))
+                    pPass->blend = LBO_MODULATE;
+                else if (pPass->blendSrc == SBF_SOURCE_ALPHA && pPass->blendDest == SBF_ONE_MINUS_SOURCE_ALPHA)
+                    pPass->blend = LBO_ALPHA_BLEND;
+                else
+                    pPass->customBlend = true;
+
+
+                // NB other custom blends might not work due to OGRE trying to use multitexture over multipass
+            }
+        }
+        // RGBGEN
+        else if (params[0] == "rgbgen")
+        {
+            // TODO
+        }
+        // ALPHAGEN
+        else if (params[0] == "alphagen")
+        {
+            // TODO
+        }
+        // TCGEN
+        else if (params[0] == "tcgen")
+        {
+            if (params[1] == "base")
+            {
+                pPass->texGen = TEXGEN_BASE;
+            }
+            else if (params[1] == "lightmap")
+            {
+                pPass->texGen = TEXGEN_LIGHTMAP;
+            }
+            else if (params[1] == "environment")
+            {
+                pPass->texGen = TEXGEN_ENVIRONMENT;
+            }
+        }
+        // TCMOD
+        else if (params[0] == "tcmod")
+        {
+            if (params[1] == "rotate")
+            {
+                pPass->tcModRotate = -atof(params[2].c_str()) / 360; // +ve is clockwise degrees in Q3 shader, anticlockwise complete rotations in Ogre
+            }
+            else if (params[1] == "scroll")
+            {
+                pPass->tcModScroll[0] = atof(params[2].c_str());
+                pPass->tcModScroll[1] = atof(params[3].c_str());
+            }
+            else if (params[1] == "scale")
+            {
+                pPass->tcModScale[0] = atof(params[2].c_str());
+                pPass->tcModScale[1] = atof(params[3].c_str());
+            }
+            else if (params[1] == "stretch")
+            {
+                if (params[2] == "sin")
+                    pPass->tcModStretchWave = SHADER_FUNC_SIN;
+                else if (params[2] == "triangle")
+                    pPass->tcModStretchWave = SHADER_FUNC_TRIANGLE;
+                else if (params[2] == "square")
+                    pPass->tcModStretchWave = SHADER_FUNC_SQUARE;
+                else if (params[2] == "sawtooth")
+                    pPass->tcModStretchWave = SHADER_FUNC_SAWTOOTH;
+                else if (params[2] == "inversesawtooth")
+                    pPass->tcModStretchWave = SHADER_FUNC_INVERSESAWTOOTH;
+
+                pPass->tcModStretchParams[0] = atof(params[3].c_str());
+                pPass->tcModStretchParams[1] = atof(params[4].c_str());
+                pPass->tcModStretchParams[2] = atof(params[5].c_str());
+                pPass->tcModStretchParams[3] = atof(params[6].c_str());
+
+            }
+        }
+        // TURB
+        else if (params[0] == "turb")
+        {
+            pPass->tcModTurbOn = true;
+            pPass->tcModTurb[0] = atof(params[2].c_str());
+            pPass->tcModTurb[1] = atof(params[3].c_str());
+            pPass->tcModTurb[2] = atof(params[4].c_str());
+            pPass->tcModTurb[3] = atof(params[5].c_str());
+        }
+        // DEPTHFUNC
+        else if (params[0] == "depthfunc")
+        {
+            // TODO
+        }
+        // DEPTHWRITE
+        else if (params[0] == "depthwrite")
+        {
+            // TODO
+        }
+        // ALPHAFUNC
+        else if (params[0] == "alphafunc")
+        {
+            if (params[1] == "gt0")
+            {
+                pPass->alphaVal = 0;
+                pPass->alphaFunc = CMPF_GREATER;
+            }
+            else if (params[1] == "ge128")
+            {
+                pPass->alphaVal = 128;
+                pPass->alphaFunc = CMPF_GREATER_EQUAL;
+            }
+            else if (params[1] == "lt128")
+            {
+                pPass->alphaVal = 128;
+                pPass->alphaFunc = CMPF_LESS;
+            }
+        }
+
+
+
+    }
+    //-----------------------------------------------------------------------
+    SceneBlendFactor Quake3ShaderManager::convertBlendFunc( const String& q3func)
+    {
+        if (q3func == "gl_one")
+        {
+            return SBF_ONE;
+        }
+        else if (q3func == "gl_zero")
+        {
+            return SBF_ZERO;
+        }
+        else if (q3func == "gl_dst_color")
+        {
+            return SBF_DEST_COLOUR;
+        }
+        else if (q3func == "gl_src_color")
+        {
+            return SBF_SOURCE_COLOUR;
+        }
+        else if (q3func == "gl_one_minus_dest_color")
+        {
+            return SBF_ONE_MINUS_DEST_COLOUR;
+        }
+        else if (q3func == "gl_src_alpha")
+        {
+            return SBF_SOURCE_ALPHA;
+        }
+        else if (q3func == "gl_one_minus_src_alpha")
+        {
+            return SBF_ONE_MINUS_SOURCE_ALPHA;
+        }
+
+        // Default if unrecognised
+        return SBF_ONE;
+
+    }
+
+}
Index: /PlugIns/CgProgramManager/Makefile.am
===================================================================
--- /PlugIns/CgProgramManager/Makefile.am	(revision 5)
+++ /PlugIns/CgProgramManager/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /PlugIns/CgProgramManager/Makefile.in
===================================================================
--- /PlugIns/CgProgramManager/Makefile.in	(revision 5)
+++ /PlugIns/CgProgramManager/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = PlugIns/CgProgramManager
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  PlugIns/CgProgramManager/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  PlugIns/CgProgramManager/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /PlugIns/CgProgramManager/include/Makefile.am
===================================================================
--- /PlugIns/CgProgramManager/include/Makefile.am	(revision 5)
+++ /PlugIns/CgProgramManager/include/Makefile.am	(revision 5)
@@ -0,0 +1,4 @@
+noinst_HEADERS = OgreCgPrerequisites.h \
+				 OgreCgPlugin.h \
+                 OgreCgProgram.h \
+                 OgreCgProgramFactory.h 
Index: /PlugIns/CgProgramManager/include/Makefile.in
===================================================================
--- /PlugIns/CgProgramManager/include/Makefile.in	(revision 5)
+++ /PlugIns/CgProgramManager/include/Makefile.in	(revision 5)
@@ -0,0 +1,440 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = PlugIns/CgProgramManager/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = OgreCgPrerequisites.h \
+				 OgreCgPlugin.h \
+                 OgreCgProgram.h \
+                 OgreCgProgramFactory.h 
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  PlugIns/CgProgramManager/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  PlugIns/CgProgramManager/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /PlugIns/CgProgramManager/include/OgreCgPlugin.h
===================================================================
--- /PlugIns/CgProgramManager/include/OgreCgPlugin.h	(revision 5)
+++ /PlugIns/CgProgramManager/include/OgreCgPlugin.h	(revision 5)
@@ -0,0 +1,66 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __CgPlugin_H__
+#define __CgPlugin_H__
+
+#include "OgrePlugin.h"
+#include "OgreCgProgramFactory.h"
+
+namespace Ogre
+{
+
+	/** Plugin instance for Cg Program Manager */
+	class CgPlugin : public Plugin
+	{
+	public:
+		CgPlugin();
+
+
+		/// @copydoc Plugin::getName
+		const String& getName() const;
+
+		/// @copydoc Plugin::install
+		void install();
+
+		/// @copydoc Plugin::initialise
+		void initialise();
+
+		/// @copydoc Plugin::shutdown
+		void shutdown();
+
+		/// @copydoc Plugin::uninstall
+		void uninstall();
+	protected:
+		CgProgramFactory* mCgProgramFactory;
+
+
+	};
+}
+
+#endif
Index: /PlugIns/CgProgramManager/include/OgreCgPrerequisites.h
===================================================================
--- /PlugIns/CgProgramManager/include/OgreCgPrerequisites.h	(revision 5)
+++ /PlugIns/CgProgramManager/include/OgreCgPrerequisites.h	(revision 5)
@@ -0,0 +1,63 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __CgPrerequisites_H__
+#define __CgPrerequisites_H__
+
+#include "OgreException.h"
+#include <Cg/cg.h>
+
+
+namespace Ogre {
+
+    /** Utility function, checks Cg for errors, throw exception if detected.
+    @param ogreMethod Ogre method name, as Class::method
+    @param errorTextPrefix The text to prefix the Cg error text with
+    */
+    void checkForCgError(const String& ogreMethod, const String& errorTextPrefix, CGcontext context);
+
+
+#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) && !defined(__MINGW32__) && !defined(OGRE_STATIC_LIB)
+#	ifdef OGRE_CGPLUGIN_EXPORTS
+#		define _OgreCgPluginExport __declspec(dllexport)
+#	else
+#       if defined( __MINGW32__ )
+#           define _OgreCgPluginExport
+#       else
+#    		define _OgreCgPluginExport __declspec(dllimport)
+#       endif
+#   endif
+#elif defined ( OGRE_GCC_VISIBILITY )
+#   define _OgreCgPluginExport  __attribute__ ((visibility("default")))
+#else
+#	define _OgreCgPluginExport
+#endif	// OGRE_WIN32
+
+}
+
+#endif
Index: /PlugIns/CgProgramManager/include/OgreCgProgram.h
===================================================================
--- /PlugIns/CgProgramManager/include/OgreCgProgram.h	(revision 5)
+++ /PlugIns/CgProgramManager/include/OgreCgProgram.h	(revision 5)
@@ -0,0 +1,140 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __CgProgram_H__
+#define __CgProgram_H__
+
+#include "OgreCgPrerequisites.h"
+#include "OgreHighLevelGpuProgram.h"
+#include "OgreStringVector.h"
+
+namespace Ogre {
+    /** Specialisation of HighLevelGpuProgram to provide support for nVidia's CG language.
+    @remarks
+        Cg can be used to compile common, high-level, C-like code down to assembler
+        language for both GL and Direct3D, for multiple graphics cards. You must
+        supply a list of profiles which your program must support using
+        setProfiles() before the program is loaded in order for this to work. The
+        program will then negotiate with the renderer to compile the appropriate program
+        for the API and graphics card capabilities.
+    */
+    class CgProgram : public HighLevelGpuProgram
+    {
+    public:
+        /// Command object for setting entry point
+        class CmdEntryPoint : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for setting profiles
+        class CmdProfiles : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for setting compilation arguments
+        class CmdArgs : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+    protected:
+
+        static CmdEntryPoint msCmdEntryPoint;
+        static CmdProfiles msCmdProfiles;
+        static CmdArgs msCmdArgs;
+
+        /// The CG context to use, passed in by factory
+        CGcontext mCgContext;
+        /// Program handle
+        CGprogram mCgProgram;
+        /** Internal load implementation, must be implemented by subclasses.
+        */
+        void loadFromSource(void);
+        /** Internal method for creating an appropriate low-level program from this
+        high-level program, must be implemented by subclasses. */
+        void createLowLevelImpl(void);
+        /// Internal unload implementation, must be implemented by subclasses
+        void unloadHighLevelImpl(void);
+        /// Populate the passed parameters with name->index map, must be overridden
+        void buildConstantDefinitions() const;
+
+		/// Recurse down structures getting data on parameters
+		void recurseParams(CGparameter param, size_t contextArraySize = 1) const;
+		/// Turn a Cg type into a GpuConstantType and number of elements
+		void mapTypeAndElementSize(CGtype cgType, bool isRegisterCombiner, GpuConstantDefinition& def) const;
+
+        StringVector mProfiles;
+        String mEntryPoint;
+        String mSelectedProfile;
+        CGprofile mSelectedCgProfile;
+        String mCompileArgs;
+        // Unfortunately Cg uses char** for arguments - bleh
+        // This is a null-terminated list of char* (each null terminated)
+        char** mCgArguments;
+
+        /// Internal method which works out which profile to use for this program
+        void selectProfile(void);
+        /// Internal method which merges manual and automatic compile arguments
+        void buildArgs(void);
+        /// Releases memory for the horrible Cg char**
+        void freeCgArgs(void);
+
+
+    public:
+        CgProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
+            const String& group, bool isManual, ManualResourceLoader* loader, 
+            CGcontext context);
+        ~CgProgram();
+
+        /** Sets the entry point for this program ie the first method called. */
+        void setEntryPoint(const String& entryPoint) { mEntryPoint = entryPoint; }
+        /** Gets the entry point defined for this program. */
+        const String& getEntryPoint(void) const { return mEntryPoint; }
+        /** Sets the Cg profiles which can be supported by the program. */
+        void setProfiles(const StringVector& profiles);
+        /** Gets the Cg profiles which can be supported by the program. */
+        const StringVector& getProfiles(void) const { return mProfiles; }
+        /** Sets the compilation arguments for this program ie the first method called. */
+        void setCompileArguments(const String& args) { mCompileArgs = args; }
+        /** Gets the entry point defined for this program. */
+        const String& getCompileArguments(void) const { return mCompileArgs; }
+        /// Overridden from GpuProgram
+        bool isSupported(void) const;
+        /// Overridden from GpuProgram
+        const String& getLanguage(void) const;
+
+    };
+}
+
+#endif
Index: /PlugIns/CgProgramManager/include/OgreCgProgramFactory.h
===================================================================
--- /PlugIns/CgProgramManager/include/OgreCgProgramFactory.h	(revision 5)
+++ /PlugIns/CgProgramManager/include/OgreCgProgramFactory.h	(revision 5)
@@ -0,0 +1,56 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __CgProgramFactory_H__
+#define __CgProgramFactory_H__
+
+#include "OgreCgPrerequisites.h"
+#include "OgreHighLevelGpuProgramManager.h"
+
+namespace Ogre
+{
+    /** Factory class for Cg programs. */
+    class CgProgramFactory : public HighLevelGpuProgramFactory
+    {
+    protected:
+        CGcontext mCgContext;
+		static String sLanguageName;
+    public:
+        CgProgramFactory();
+        ~CgProgramFactory();
+		/// Get the name of the language this factory creates programs for
+		const String& getLanguage(void) const;
+        HighLevelGpuProgram* create(ResourceManager* creator, 
+            const String& name, ResourceHandle handle,
+            const String& group, bool isManual, ManualResourceLoader* loader);
+		void destroy(HighLevelGpuProgram* prog);
+
+    };
+}
+
+#endif
Index: /PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager.cbp
===================================================================
--- /PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager.cbp	(revision 5)
+++ /PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager.cbp	(revision 5)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Plugin_CgProgramManager" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\lib\Plugin_CgProgramManager_d.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="cg" />
+					<Add directory="..\..\..\Dependencies\lib\Debug" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\lib\Plugin_CgProgramManager.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="cg" />
+					<Add directory="..\..\..\Dependencies\lib\Release" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add option="-D_USRDLL" />
+			<Add option="-DOGRE_CGPLUGIN_EXPORTS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\..\..\Dependencies\include\Cg\cg.h" />
+		<Unit filename="..\include\OgreCgPlugin.h" />
+		<Unit filename="..\include\OgreCgPrerequisites.h" />
+		<Unit filename="..\include\OgreCgProgram.h" />
+		<Unit filename="..\include\OgreCgProgramFactory.h" />
+		<Unit filename="..\src\OgreCgPlugin.cpp" />
+		<Unit filename="..\src\OgreCgProgram.cpp" />
+		<Unit filename="..\src\OgreCgProgramFactory.cpp" />
+		<Unit filename="..\src\OgreCgProgramManagerDll.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager.vcproj
===================================================================
--- /PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager.vcproj	(revision 5)
+++ /PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager.vcproj	(revision 5)
@@ -0,0 +1,283 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Plugin_CgProgramManager"
+	ProjectGUID="{1C741C2F-3278-43D8-9FD2-E631A64B70AE}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_CGPLUGIN_EXPORTS"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="2"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain_d.lib cg.lib"
+				OutputFile="$(OutDir)/$(ProjectName)_d.dll"
+				Version="0.99"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName)_d.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_CGPLUGIN_EXPORTS"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain.lib  cg.lib"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_CGPLUGIN_EXPORTS;OGRE_STATIC_LIB"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="2"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)/$(ProjectName)Static_d.lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_CGPLUGIN_EXPORTS;OGRE_STATIC_LIB"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)/$(ProjectName)Static.lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\OgreCgPlugin.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCgProgram.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCgProgramFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCgProgramManagerDll.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\..\..\Dependencies\include\Cg\cg.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCgPlugin.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCgPrerequisites.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCgProgram.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCgProgramFactory.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp
===================================================================
--- /PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp	(revision 5)
+++ /PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_linux.cbp	(revision 5)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Plugin_CgProgramManager" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../../lib/Plugin_CgProgramManager_d.so" prefix_auto="0" extension_auto="0" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="Cg" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cp $($(TARGET_NAME)_OUTPUT_FILE) ../../../Samples/Common/bin/$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../../lib/Plugin_CgProgramManager.so" prefix_auto="0" extension_auto="0" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="Cg" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cp $($(TARGET_NAME)_OUTPUT_FILE) ../../../Samples/Common/bin/$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-fvisibility=hidden" />
+			<Add option="-fvisibility-inlines-hidden" />
+			<Add option="-fPIC" />
+			<Add option="-DOGRE_CGPLUGIN_EXPORTS" />
+			<Add option="-DPIC" />
+			<Add option="-DOGRE_GCC_VISIBILITY" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../../Samples/Common/bin/$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="../include/OgreCgPlugin.h" />
+		<Unit filename="../include/OgreCgPrerequisites.h" />
+		<Unit filename="../include/OgreCgProgram.h" />
+		<Unit filename="../include/OgreCgProgramFactory.h" />
+		<Unit filename="../src/OgreCgPlugin.cpp" />
+		<Unit filename="../src/OgreCgProgram.cpp" />
+		<Unit filename="../src/OgreCgProgramFactory.cpp" />
+		<Unit filename="../src/OgreCgProgramManagerDll.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_stlp.cbp
===================================================================
--- /PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_stlp.cbp	(revision 5)
+++ /PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_stlp.cbp	(revision 5)
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Plugin_CgProgramManager" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\lib\Plugin_CgProgramManager_d.dll" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="cg" />
+					<Add library="stlportstlg.5.1" />
+					<Add directory="..\..\..\Dependencies\lib\Debug" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\lib\Plugin_CgProgramManager.dll" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="cg" />
+					<Add library="stlport.5.1" />
+					<Add directory="..\..\..\Dependencies\lib\Release" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add option="-D_USRDLL" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\..\..\Dependencies\include\Cg\cg.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCgPrerequisites.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCgProgram.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCgPlugin.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCgProgramFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCgPlugin.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCgProgram.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCgProgramFactory.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCgProgramManagerDll.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_vc8.vcproj
===================================================================
--- /PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_vc8.vcproj	(revision 5)
+++ /PlugIns/CgProgramManager/scripts/Plugin_CgProgramManager_vc8.vcproj	(revision 5)
@@ -0,0 +1,408 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Plugin_CgProgramManager"
+	ProjectGUID="{1C741C2F-3278-43D8-9FD2-E631A64B70AE}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_CGPLUGIN_EXPORTS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain_d.lib cg.lib"
+				OutputFile="$(OutDir)/Plugin_CgProgramManager_d.dll"
+				Version=""
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName)_d.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/Plugin_CgProgramManager_d.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				EnableFiberSafeOptimizations="true"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_CGPLUGIN_EXPORTS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain.lib cg.lib"
+				OutputFile="$(OutDir)/Plugin_CgProgramManager.dll"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/Plugin_CgProgramManager.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_STATIC_LIB"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				AdditionalDependencies="cg.lib"
+				OutputFile="$(OutDir)\$(ProjectName)Static_d.lib"
+				AdditionalLibraryDirectories="..\..\..\Dependencies\lib\Debug"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				EnableFiberSafeOptimizations="true"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_STATIC_LIB"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				AdditionalDependencies="cg.lib"
+				OutputFile="$(OutDir)\$(ProjectName)Static.lib"
+				AdditionalLibraryDirectories="..\..\..\Dependencies\lib\Release"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine=""
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\OgreCgPlugin.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCgProgram.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCgProgramFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCgProgramManagerDll.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\..\..\Dependencies\include\Cg\cg.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCgPlugin.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCgPrerequisites.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCgProgram.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCgProgramFactory.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /PlugIns/CgProgramManager/src/Makefile.am
===================================================================
--- /PlugIns/CgProgramManager/src/Makefile.am	(revision 5)
+++ /PlugIns/CgProgramManager/src/Makefile.am	(revision 5)
@@ -0,0 +1,11 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/PlugIns/CgProgramManager/include -I$(top_srcdir)/OgreMain/include
+
+pkglib_LTLIBRARIES = Plugin_CgProgramManager.la
+
+Plugin_CgProgramManager_la_SOURCES = OgreCgProgram.cpp \
+							 OgreCgPlugin.cpp \
+                             OgreCgProgramFactory.cpp \
+                             OgreCgProgramManagerDll.cpp 
+
+Plugin_CgProgramManager_la_LDFLAGS = -module $(PLUGIN_FLAGS) -L$(top_builddir)/OgreMain/src -Wl,-z,defs
+Plugin_CgProgramManager_la_LIBADD = -lOgreMain -lCg $(OGRE_THREAD_LIBS)
Index: /PlugIns/CgProgramManager/src/Makefile.in
===================================================================
--- /PlugIns/CgProgramManager/src/Makefile.in	(revision 5)
+++ /PlugIns/CgProgramManager/src/Makefile.in	(revision 5)
@@ -0,0 +1,540 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = PlugIns/CgProgramManager/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+pkglibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+Plugin_CgProgramManager_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_Plugin_CgProgramManager_la_OBJECTS = OgreCgProgram.lo \
+	OgreCgPlugin.lo OgreCgProgramFactory.lo \
+	OgreCgProgramManagerDll.lo
+Plugin_CgProgramManager_la_OBJECTS =  \
+	$(am_Plugin_CgProgramManager_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Plugin_CgProgramManager_la_SOURCES)
+DIST_SOURCES = $(Plugin_CgProgramManager_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/PlugIns/CgProgramManager/include -I$(top_srcdir)/OgreMain/include
+pkglib_LTLIBRARIES = Plugin_CgProgramManager.la
+Plugin_CgProgramManager_la_SOURCES = OgreCgProgram.cpp \
+							 OgreCgPlugin.cpp \
+                             OgreCgProgramFactory.cpp \
+                             OgreCgProgramManagerDll.cpp 
+
+Plugin_CgProgramManager_la_LDFLAGS = -module $(PLUGIN_FLAGS) -L$(top_builddir)/OgreMain/src -Wl,-z,defs
+Plugin_CgProgramManager_la_LIBADD = -lOgreMain -lCg $(OGRE_THREAD_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  PlugIns/CgProgramManager/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  PlugIns/CgProgramManager/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)"
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    f=$(am__strip_dir) \
+	    echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	    $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  p=$(am__strip_dir) \
+	  echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \
+	  $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+Plugin_CgProgramManager.la: $(Plugin_CgProgramManager_la_OBJECTS) $(Plugin_CgProgramManager_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(Plugin_CgProgramManager_la_LDFLAGS) $(Plugin_CgProgramManager_la_OBJECTS) $(Plugin_CgProgramManager_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCgPlugin.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCgProgram.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCgProgramFactory.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCgProgramManagerDll.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-pkglibLTLIBRARIES install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-pkglibLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /PlugIns/CgProgramManager/src/OgreCgPlugin.cpp
===================================================================
--- /PlugIns/CgProgramManager/src/OgreCgPlugin.cpp	(revision 5)
+++ /PlugIns/CgProgramManager/src/OgreCgPlugin.cpp	(revision 5)
@@ -0,0 +1,80 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreCgPlugin.h"
+#include "OgreRoot.h"
+#include "OgreHighLevelGpuProgramManager.h"
+
+namespace Ogre 
+{
+	const String sPluginName = "Cg Program Manager";
+	//---------------------------------------------------------------------
+	CgPlugin::CgPlugin()
+		:mCgProgramFactory(0)
+	{
+
+	}
+	//---------------------------------------------------------------------
+	const String& CgPlugin::getName() const
+	{
+		return sPluginName;
+	}
+	//---------------------------------------------------------------------
+	void CgPlugin::install()
+	{
+		// Create new factory
+		mCgProgramFactory = new CgProgramFactory();
+		// Register
+		HighLevelGpuProgramManager::getSingleton().addFactory(mCgProgramFactory);
+	}
+	//---------------------------------------------------------------------
+	void CgPlugin::initialise()
+	{
+		// nothing to do
+	}
+	//---------------------------------------------------------------------
+	void CgPlugin::shutdown()
+	{
+		// nothing to do
+	}
+	//---------------------------------------------------------------------
+	void CgPlugin::uninstall()
+	{
+        if (mCgProgramFactory)
+        {
+            // Remove from manager safely
+            if (HighLevelGpuProgramManager::getSingletonPtr())
+                HighLevelGpuProgramManager::getSingleton().removeFactory(mCgProgramFactory);
+		    delete mCgProgramFactory;
+		    mCgProgramFactory = 0;
+        }
+	}
+
+
+}
Index: /PlugIns/CgProgramManager/src/OgreCgProgram.cpp
===================================================================
--- /PlugIns/CgProgramManager/src/OgreCgProgram.cpp	(revision 5)
+++ /PlugIns/CgProgramManager/src/OgreCgProgram.cpp	(revision 5)
@@ -0,0 +1,536 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreCgProgram.h"
+#include "OgreGpuProgramManager.h"
+#include "OgreStringConverter.h"
+#include "OgreLogManager.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    CgProgram::CmdEntryPoint CgProgram::msCmdEntryPoint;
+    CgProgram::CmdProfiles CgProgram::msCmdProfiles;
+    CgProgram::CmdArgs CgProgram::msCmdArgs;
+    //-----------------------------------------------------------------------
+    void CgProgram::selectProfile(void)
+    {
+        mSelectedProfile.clear();
+        mSelectedCgProfile = CG_PROFILE_UNKNOWN;
+
+        StringVector::iterator i, iend;
+        iend = mProfiles.end();
+        GpuProgramManager& gpuMgr = GpuProgramManager::getSingleton();
+        for (i = mProfiles.begin(); i != iend; ++i)
+        {
+            if (gpuMgr.isSyntaxSupported(*i))
+            {
+                mSelectedProfile = *i;
+                mSelectedCgProfile = cgGetProfile(mSelectedProfile.c_str());
+                // Check for errors
+                checkForCgError("CgProgram::selectProfile", 
+                    "Unable to find CG profile enum for program " + mName + ": ", mCgContext);
+                break;
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void CgProgram::buildArgs(void)
+    {
+        StringVector args;
+        if (!mCompileArgs.empty())
+            args = StringUtil::split(mCompileArgs);
+
+        StringVector::const_iterator i;
+        if (mSelectedCgProfile == CG_PROFILE_VS_1_1)
+        {
+            // Need the 'dcls' argument whenever we use this profile
+            // otherwise compilation of the assembler will fail
+            bool dclsFound = false;
+            for (i = args.begin(); i != args.end(); ++i)
+            {
+                if (*i == "dcls")
+                {
+                    dclsFound = true;
+                    break;
+                }
+            }
+            if (!dclsFound)
+            {
+                args.push_back("-profileopts");
+				args.push_back("dcls");
+            }
+        }
+        // Now split args into that god-awful char** that Cg insists on
+        freeCgArgs();
+        mCgArguments = new char*[args.size() + 1];
+        int index = 0;
+        for (i = args.begin(); i != args.end(); ++i, ++index)
+        {
+            mCgArguments[index] = new char[i->length() + 1];
+            strcpy(mCgArguments[index], i->c_str());
+        }
+        // Null terminate list
+        mCgArguments[index] = 0;
+
+
+    }
+    //-----------------------------------------------------------------------
+    void CgProgram::freeCgArgs(void)
+    {
+        if (mCgArguments)
+        {
+            size_t index = 0;
+            char* current = mCgArguments[index];
+            while (current)
+            {
+                delete [] current;
+                current = mCgArguments[++index];
+            }
+            delete [] mCgArguments;
+            mCgArguments = 0;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void CgProgram::loadFromSource(void)
+    {
+        // Create Cg Program
+        selectProfile();
+		if (mSelectedCgProfile == CG_PROFILE_UNKNOWN)
+		{
+			LogManager::getSingleton().logMessage(
+				"Attempted to load Cg program '" + mName + "', but no suported "
+				"profile was found. ");
+			return;
+		}
+        buildArgs();
+        mCgProgram = cgCreateProgram(mCgContext, CG_SOURCE, mSource.c_str(), 
+            mSelectedCgProfile, mEntryPoint.c_str(), const_cast<const char**>(mCgArguments));
+
+        // Test
+        //LogManager::getSingleton().logMessage(cgGetProgramString(mCgProgram, CG_COMPILED_PROGRAM));
+
+        // Check for errors
+        checkForCgError("CgProgram::loadFromSource", 
+            "Unable to compile Cg program " + mName + ": ", mCgContext);
+
+    }
+    //-----------------------------------------------------------------------
+    void CgProgram::createLowLevelImpl(void)
+    {
+		// ignore any previous error
+		if (mSelectedCgProfile != CG_PROFILE_UNKNOWN)
+		{
+
+			// Create a low-level program, give it the same name as us
+			mAssemblerProgram = 
+				GpuProgramManager::getSingleton().createProgramFromString(
+					mName, 
+					mGroup,
+					cgGetProgramString(mCgProgram, CG_COMPILED_PROGRAM),
+					mType, 
+					mSelectedProfile);
+		}
+    }
+    //-----------------------------------------------------------------------
+    void CgProgram::unloadHighLevelImpl(void)
+    {
+        // Unload Cg Program
+        // Lowlevel program will get unloaded elsewhere
+        if (mCgProgram)
+        {
+            cgDestroyProgram(mCgProgram);
+            checkForCgError("CgProgram::unloadImpl", 
+                "Error while unloading Cg program " + mName + ": ", 
+                mCgContext);
+            mCgProgram = 0;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void CgProgram::buildConstantDefinitions() const
+    {
+        // Derive parameter names from Cg
+
+		mFloatLogicalToPhysical.bufferSize = 0;
+		mIntLogicalToPhysical.bufferSize = 0;
+		mConstantDefs.floatBufferSize = 0;
+		mConstantDefs.intBufferSize = 0;
+
+		if (!mCgProgram)
+			return;
+
+		recurseParams(cgGetFirstParameter(mCgProgram, CG_PROGRAM));
+        recurseParams(cgGetFirstParameter(mCgProgram, CG_GLOBAL));
+	}
+	//---------------------------------------------------------------------
+	void CgProgram::recurseParams(CGparameter parameter, size_t contextArraySize) const
+	{
+		while (parameter != 0)
+        {
+            // Look for uniform (non-sampler) parameters only
+            // Don't bother enumerating unused parameters, especially since they will
+            // be optimised out and therefore not in the indexed versions
+            CGtype paramType = cgGetParameterType(parameter);
+
+            if (cgGetParameterVariability(parameter) == CG_UNIFORM &&
+                paramType != CG_SAMPLER1D &&
+                paramType != CG_SAMPLER2D &&
+                paramType != CG_SAMPLER3D &&
+                paramType != CG_SAMPLERCUBE &&
+                paramType != CG_SAMPLERRECT &&
+                cgGetParameterDirection(parameter) != CG_OUT && 
+                cgIsParameterReferenced(parameter))
+            {
+				int arraySize;
+
+				switch(paramType)
+				{
+				case CG_STRUCT:
+					recurseParams(cgGetFirstStructParameter(parameter));
+					break;
+				case CG_ARRAY:
+					// Support only 1-dimensional arrays
+					arraySize = cgGetArraySize(parameter, 0);
+					recurseParams(cgGetArrayParameter(parameter, 0), (size_t)arraySize);
+					break;
+				default:
+					// Normal path (leaf)
+					String paramName = cgGetParameterName(parameter);
+					size_t logicalIndex = cgGetParameterResourceIndex(parameter);
+
+					// Get the parameter resource, to calculate the physical index
+					CGresource res = cgGetParameterResource(parameter);
+					bool isRegisterCombiner = false;
+					size_t regCombinerPhysicalIndex = 0;
+					switch (res)
+					{
+					case CG_COMBINER_STAGE_CONST0:
+						// register combiner, const 0
+						// the index relates to the texture stage; store this as (stage * 2) + 0
+						regCombinerPhysicalIndex = logicalIndex * 2;
+						isRegisterCombiner = true;
+						break;
+					case CG_COMBINER_STAGE_CONST1:
+						// register combiner, const 1
+						// the index relates to the texture stage; store this as (stage * 2) + 1
+						regCombinerPhysicalIndex = (logicalIndex * 2) + 1;
+						isRegisterCombiner = true;
+						break;
+					default:
+						// normal constant
+						break;
+					}
+
+					// Trim the '[0]' suffix if it exists, we will add our own indexing later
+					if (StringUtil::endsWith(paramName, "[0]", false))
+					{
+						paramName.erase(paramName.size() - 3);
+					}
+
+
+					GpuConstantDefinition def;
+					def.arraySize = contextArraySize;
+					mapTypeAndElementSize(paramType, isRegisterCombiner, def);
+
+					if (def.constType == GCT_UNKNOWN)
+					{
+						LogManager::getSingleton().logMessage(
+							"Problem parsing the following Cg Uniform: '"
+							+ paramName + "' in file " + mName);
+						// next uniform
+						continue;
+					}
+					if (isRegisterCombiner)
+					{
+						def.physicalIndex = regCombinerPhysicalIndex;
+					}
+					else
+					{
+						// base position on existing buffer contents
+						if (def.isFloat())
+						{
+							def.physicalIndex = mFloatLogicalToPhysical.bufferSize;
+						}
+						else
+						{
+							def.physicalIndex = mIntLogicalToPhysical.bufferSize;
+						}
+					}
+
+
+					mConstantDefs.map.insert(GpuConstantDefinitionMap::value_type(paramName, def));
+
+					// Record logical / physical mapping
+					if (def.isFloat())
+					{
+						OGRE_LOCK_MUTEX(mFloatLogicalToPhysical.mutex)
+						mFloatLogicalToPhysical.map.insert(
+							GpuLogicalIndexUseMap::value_type(logicalIndex, 
+								GpuLogicalIndexUse(def.physicalIndex, def.arraySize * def.elementSize)));
+						mFloatLogicalToPhysical.bufferSize += def.arraySize * def.elementSize;
+						mConstantDefs.floatBufferSize = mFloatLogicalToPhysical.bufferSize;
+					}
+					else
+					{
+						OGRE_LOCK_MUTEX(mIntLogicalToPhysical.mutex)
+						mIntLogicalToPhysical.map.insert(
+							GpuLogicalIndexUseMap::value_type(logicalIndex, 
+								GpuLogicalIndexUse(def.physicalIndex, def.arraySize * def.elementSize)));
+						mIntLogicalToPhysical.bufferSize += def.arraySize * def.elementSize;
+						mConstantDefs.intBufferSize = mIntLogicalToPhysical.bufferSize;
+					}
+
+					// Deal with array indexing
+					mConstantDefs.generateConstantDefinitionArrayEntries(paramName, def);
+
+					break;
+		
+				}
+					
+            }
+            // Get next
+            parameter = cgGetNextParameter(parameter);
+        }
+
+        
+    }
+	//-----------------------------------------------------------------------
+	void CgProgram::mapTypeAndElementSize(CGtype cgType, bool isRegisterCombiner, 
+		GpuConstantDefinition& def) const
+	{
+		if (isRegisterCombiner)
+		{
+			// register combiners are the only single-float entries in our buffer
+			def.constType = GCT_FLOAT1;
+			def.elementSize = 1;
+		}
+		else
+		{
+			switch(cgType)
+			{
+			case CG_FLOAT:
+			case CG_FLOAT1:
+			case CG_HALF:
+			case CG_HALF1:
+				def.constType = GCT_FLOAT1;
+				def.elementSize = 4; // padded to 4 elements
+				break;
+			case CG_FLOAT2:
+			case CG_HALF2:
+				def.constType = GCT_FLOAT2;
+				def.elementSize = 4; // padded to 4 elements
+				break;
+			case CG_FLOAT3:
+			case CG_HALF3:
+				def.constType = GCT_FLOAT3;
+				def.elementSize = 4; // padded to 4 elements
+				break;
+			case CG_FLOAT4:
+			case CG_HALF4:
+				def.constType = GCT_FLOAT4;
+				def.elementSize = 4; 
+				break;
+			case CG_FLOAT2x2:
+			case CG_HALF2x2:
+				def.constType = GCT_MATRIX_2X2;
+				def.elementSize = 8; // Cg pads this to 2 float4s
+				break;
+			case CG_FLOAT2x3:
+			case CG_HALF2x3:
+				def.constType = GCT_MATRIX_2X3;
+				def.elementSize = 8; // Cg pads this to 2 float4s
+				break;
+			case CG_FLOAT2x4:
+			case CG_HALF2x4:
+				def.constType = GCT_MATRIX_2X4;
+				def.elementSize = 8; 
+				break;
+			case CG_FLOAT3x2:
+			case CG_HALF3x2:
+				def.constType = GCT_MATRIX_2X3;
+				def.elementSize = 12; // Cg pads this to 3 float4s
+				break;
+			case CG_FLOAT3x3:
+			case CG_HALF3x3:
+				def.constType = GCT_MATRIX_3X3;
+				def.elementSize = 12; // Cg pads this to 3 float4s
+				break;
+			case CG_FLOAT3x4:
+			case CG_HALF3x4:
+				def.constType = GCT_MATRIX_3X4;
+				def.elementSize = 12; 
+				break;
+			case CG_FLOAT4x2:
+			case CG_HALF4x2:
+				def.constType = GCT_MATRIX_4X2;
+				def.elementSize = 16; // Cg pads this to 4 float4s
+				break;
+			case CG_FLOAT4x3:
+			case CG_HALF4x3:
+				def.constType = GCT_MATRIX_4X3;
+				def.elementSize = 16; // Cg pads this to 4 float4s
+				break;
+			case CG_FLOAT4x4:
+			case CG_HALF4x4:
+				def.constType = GCT_MATRIX_4X4;
+				def.elementSize = 16; // Cg pads this to 4 float4s
+				break;
+			case CG_INT:
+			case CG_INT1:
+				def.constType = GCT_INT1;
+				def.elementSize = 4; // Cg pads this to int4
+				break;
+			case CG_INT2:
+				def.constType = GCT_INT2;
+				def.elementSize = 4; // Cg pads this to int4
+				break;
+			case CG_INT3:
+				def.constType = GCT_INT3;
+				def.elementSize = 4; // Cg pads this to int4
+				break;
+			case CG_INT4:
+				def.constType = GCT_INT4;
+				def.elementSize = 4; 
+				break;
+			default:
+				def.constType = GCT_UNKNOWN;
+				break;
+			}
+		}
+	}
+    //-----------------------------------------------------------------------
+    CgProgram::CgProgram(ResourceManager* creator, const String& name, 
+        ResourceHandle handle, const String& group, bool isManual, 
+        ManualResourceLoader* loader, CGcontext context)
+        : HighLevelGpuProgram(creator, name, handle, group, isManual, loader), 
+        mCgContext(context), mCgProgram(0), 
+        mSelectedCgProfile(CG_PROFILE_UNKNOWN), mCgArguments(0)
+    {
+        if (createParamDictionary("CgProgram"))
+        {
+            setupBaseParamDictionary();
+
+            ParamDictionary* dict = getParamDictionary();
+
+            dict->addParameter(ParameterDef("entry_point", 
+                "The entry point for the Cg program.",
+                PT_STRING),&msCmdEntryPoint);
+            dict->addParameter(ParameterDef("profiles", 
+                "Space-separated list of Cg profiles supported by this profile.",
+                PT_STRING),&msCmdProfiles);
+            dict->addParameter(ParameterDef("compile_arguments", 
+                "A string of compilation arguments to pass to the Cg compiler.",
+                PT_STRING),&msCmdArgs);
+        }
+        
+    }
+    //-----------------------------------------------------------------------
+    CgProgram::~CgProgram()
+    {
+        freeCgArgs();
+        // have to call this here reather than in Resource destructor
+        // since calling virtual methods in base destructors causes crash
+        if (isLoaded())
+        {
+            unload();
+        }
+        else
+        {
+            unloadHighLevel();
+        }
+    }
+    //-----------------------------------------------------------------------
+    bool CgProgram::isSupported(void) const
+    {
+        if (mCompileError || !isRequiredCapabilitiesSupported())
+            return false;
+
+		StringVector::const_iterator i, iend;
+        iend = mProfiles.end();
+        // Check to see if any of the profiles are supported
+        for (i = mProfiles.begin(); i != iend; ++i)
+        {
+            if (GpuProgramManager::getSingleton().isSyntaxSupported(*i))
+            {
+                return true;
+            }
+        }
+        return false;
+
+    }
+    //-----------------------------------------------------------------------
+    void CgProgram::setProfiles(const StringVector& profiles)
+    {
+        mProfiles.clear();
+        StringVector::const_iterator i, iend;
+        iend = profiles.end();
+        for (i = profiles.begin(); i != iend; ++i)
+        {
+            mProfiles.push_back(*i);
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    const String& CgProgram::getLanguage(void) const
+    {
+        static const String language = "cg";
+
+        return language;
+    }
+
+
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String CgProgram::CmdEntryPoint::doGet(const void *target) const
+    {
+        return static_cast<const CgProgram*>(target)->getEntryPoint();
+    }
+    void CgProgram::CmdEntryPoint::doSet(void *target, const String& val)
+    {
+        static_cast<CgProgram*>(target)->setEntryPoint(val);
+    }
+    //-----------------------------------------------------------------------
+    String CgProgram::CmdProfiles::doGet(const void *target) const
+    {
+        return StringConverter::toString(
+            static_cast<const CgProgram*>(target)->getProfiles() );
+    }
+    void CgProgram::CmdProfiles::doSet(void *target, const String& val)
+    {
+        static_cast<CgProgram*>(target)->setProfiles(StringUtil::split(val));
+    }
+    //-----------------------------------------------------------------------
+    String CgProgram::CmdArgs::doGet(const void *target) const
+    {
+        return static_cast<const CgProgram*>(target)->getCompileArguments();
+    }
+    void CgProgram::CmdArgs::doSet(void *target, const String& val)
+    {
+        static_cast<CgProgram*>(target)->setCompileArguments(val);
+    }
+
+}
Index: /PlugIns/CgProgramManager/src/OgreCgProgramFactory.cpp
===================================================================
--- /PlugIns/CgProgramManager/src/OgreCgProgramFactory.cpp	(revision 5)
+++ /PlugIns/CgProgramManager/src/OgreCgProgramFactory.cpp	(revision 5)
@@ -0,0 +1,72 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreCgProgramFactory.h"
+#include "OgreString.h"
+#include "OgreCgProgram.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    String CgProgramFactory::sLanguageName = "cg";
+    //-----------------------------------------------------------------------
+    CgProgramFactory::CgProgramFactory()
+    {
+        mCgContext = cgCreateContext();
+        // Check for errors
+        checkForCgError("CgProgramFactory::CgProgramFactory", 
+            "Unable to create initial Cg context: ", mCgContext);
+    }
+    //-----------------------------------------------------------------------
+    CgProgramFactory::~CgProgramFactory()
+    {
+        cgDestroyContext(mCgContext);
+        // Check for errors
+        checkForCgError("CgProgramFactory::~CgProgramFactory", 
+            "Unable to destroy Cg context: ", mCgContext);
+    }
+    //-----------------------------------------------------------------------
+    const String& CgProgramFactory::getLanguage(void) const
+    {
+        return sLanguageName;
+    }
+    //-----------------------------------------------------------------------
+    HighLevelGpuProgram* CgProgramFactory::create(ResourceManager* creator, 
+        const String& name, ResourceHandle handle,
+        const String& group, bool isManual, ManualResourceLoader* loader)
+    {
+        return new CgProgram(creator, name, handle, group, isManual, loader, mCgContext);
+    }
+    //-----------------------------------------------------------------------
+	void CgProgramFactory::destroy(HighLevelGpuProgram* prog)
+    {
+        delete prog;
+    }
+    //-----------------------------------------------------------------------
+
+}
Index: /PlugIns/CgProgramManager/src/OgreCgProgramManagerDll.cpp
===================================================================
--- /PlugIns/CgProgramManager/src/OgreCgProgramManagerDll.cpp	(revision 5)
+++ /PlugIns/CgProgramManager/src/OgreCgProgramManagerDll.cpp	(revision 5)
@@ -0,0 +1,70 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreCgPlugin.h"
+#include "OgreCgProgram.h"
+#include "OgreRoot.h"
+
+namespace Ogre {
+
+    CgPlugin* cgPlugin;
+    //-----------------------------------------------------------------------
+    extern "C" void _OgreCgPluginExport dllStartPlugin(void)
+    {
+        // Create new plugin
+        cgPlugin = new CgPlugin();
+
+        // Register
+        Root::getSingleton().installPlugin(cgPlugin);
+
+
+    }
+    extern "C" void _OgreCgPluginExport dllStopPlugin(void)
+    {
+		Root::getSingleton().uninstallPlugin(cgPlugin);
+		delete cgPlugin;
+    }
+
+    void checkForCgError(const String& ogreMethod, const String& errorTextPrefix, CGcontext context)
+    {
+        CGerror error = cgGetError();
+        if (error != CG_NO_ERROR)
+        {
+            String msg = errorTextPrefix + cgGetErrorString(error); 
+
+            if (error == CG_COMPILER_ERROR)
+            {
+                // Get listing with full compile errors
+                msg = msg + "\n" + cgGetLastListing(context);
+            }
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, msg, ogreMethod);
+        }
+    }
+
+}
Index: /PlugIns/EXRCodec/Makefile.am
===================================================================
--- /PlugIns/EXRCodec/Makefile.am	(revision 5)
+++ /PlugIns/EXRCodec/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /PlugIns/EXRCodec/Makefile.in
===================================================================
--- /PlugIns/EXRCodec/Makefile.in	(revision 5)
+++ /PlugIns/EXRCodec/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = PlugIns/EXRCodec
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  PlugIns/EXRCodec/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  PlugIns/EXRCodec/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /PlugIns/EXRCodec/include/Makefile.in
===================================================================
--- /PlugIns/EXRCodec/include/Makefile.in	(revision 5)
+++ /PlugIns/EXRCodec/include/Makefile.in	(revision 5)
@@ -0,0 +1,386 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = PlugIns/EXRCodec/include
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  PlugIns/EXRCodec/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  PlugIns/EXRCodec/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	distclean distclean-generic distclean-libtool distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-exec install-exec-am \
+	install-info install-info-am install-man install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /PlugIns/EXRCodec/include/OgreEXRCodec.h
===================================================================
--- /PlugIns/EXRCodec/include/OgreEXRCodec.h	(revision 5)
+++ /PlugIns/EXRCodec/include/OgreEXRCodec.h	(revision 5)
@@ -0,0 +1,57 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _EXRImageCodec_H__
+#define _EXRImageCodec_H__
+
+#include "OgreImageCodec.h"
+
+namespace Ogre {
+
+    /** 
+     * Codec specialized in loading OpenEXR high dynamic range images.
+     */
+    class EXRCodec : public ImageCodec
+    {
+    public:
+        EXRCodec();
+        virtual ~EXRCodec();
+
+        /// @copydoc Codec::code
+        DataStreamPtr code(MemoryDataStreamPtr& input, CodecDataPtr& pData) const;
+        /// @copydoc Codec::codeToFile
+        void codeToFile(MemoryDataStreamPtr& input, const String& outFileName, CodecDataPtr& pData) const;
+        /// @copydoc Codec::decode
+        DecodeResult decode(DataStreamPtr& input) const;
+
+        String getType() const;
+    };
+
+} // namespace
+
+#endif
Index: /PlugIns/EXRCodec/misc/OgreEXRCodec.def
===================================================================
--- /PlugIns/EXRCodec/misc/OgreEXRCodec.def	(revision 5)
+++ /PlugIns/EXRCodec/misc/OgreEXRCodec.def	(revision 5)
@@ -0,0 +1,4 @@
+LIBRARY Plugin_EXRCodec
+EXPORTS	
+	dllStartPlugin
+	dllStopPlugin
Index: /PlugIns/EXRCodec/scripts/Plugin_EXRCodec.vcproj
===================================================================
--- /PlugIns/EXRCodec/scripts/Plugin_EXRCodec.vcproj	(revision 5)
+++ /PlugIns/EXRCodec/scripts/Plugin_EXRCodec.vcproj	(revision 5)
@@ -0,0 +1,239 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8,00"
+	Name="Plugin_EXRCodec"
+	ProjectGUID="{68C72FB4-991C-44C2-AB87-B2720A3C5FD4}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PLUGIN_TERRAIN_EXPORTS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="2"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain_d.lib OgreMain.lib Half.lib Iex.lib Imath.lib IlmImf.lib"
+				OutputFile="$(OutDir)/Plugin_EXRCodec.dll"
+				Version="0.99"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile="..\misc\OgreEXRCodec.def"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Plugin_EXRCodec.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/Plugin_EXRCodec.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_TERRAIN_EXPORTS"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain.lib Half.lib Iex.lib Imath.lib IlmImf.lib zlib.lib"
+				OutputFile="$(OutDir)/Plugin_EXRCodec.dll"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile="..\misc\OgreEXRCodec.def"
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/Plugin_EXRCodec.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\O_IStream.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreEXRCodec.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\misc\OgreEXRCodec.def"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreEXRCodecDll.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\src\O_IStream.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreEXRCodec.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /PlugIns/EXRCodec/src/Makefile.am
===================================================================
--- /PlugIns/EXRCodec/src/Makefile.am	(revision 5)
+++ /PlugIns/EXRCodec/src/Makefile.am	(revision 5)
@@ -0,0 +1,10 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/PlugIns/EXRCodec/include -I$(top_srcdir)/OgreMain/include $(OPENEXR_CFLAGS)
+
+pkglib_LTLIBRARIES = Plugin_EXRCodec.la
+
+Plugin_EXRCodec_la_SOURCES = OgreEXRCodec.cpp \
+			     O_IStream.cpp \
+                             OgreEXRCodecDll.cpp 
+
+Plugin_EXRCodec_la_LDFLAGS = -module $(PLUGIN_FLAGS) -L$(top_builddir)/OgreMain/src -Wl,-z,defs
+Plugin_EXRCodec_la_LIBADD = -lOgreMain $(OPENEXR_LIBS) $(OGRE_THREAD_LIBS)
Index: /PlugIns/EXRCodec/src/Makefile.in
===================================================================
--- /PlugIns/EXRCodec/src/Makefile.in	(revision 5)
+++ /PlugIns/EXRCodec/src/Makefile.in	(revision 5)
@@ -0,0 +1,537 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = PlugIns/EXRCodec/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+pkglibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+Plugin_EXRCodec_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
+am_Plugin_EXRCodec_la_OBJECTS = OgreEXRCodec.lo O_IStream.lo \
+	OgreEXRCodecDll.lo
+Plugin_EXRCodec_la_OBJECTS = $(am_Plugin_EXRCodec_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Plugin_EXRCodec_la_SOURCES)
+DIST_SOURCES = $(Plugin_EXRCodec_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/PlugIns/EXRCodec/include -I$(top_srcdir)/OgreMain/include $(OPENEXR_CFLAGS)
+pkglib_LTLIBRARIES = Plugin_EXRCodec.la
+Plugin_EXRCodec_la_SOURCES = OgreEXRCodec.cpp \
+			     O_IStream.cpp \
+                             OgreEXRCodecDll.cpp 
+
+Plugin_EXRCodec_la_LDFLAGS = -module $(PLUGIN_FLAGS) -L$(top_builddir)/OgreMain/src -Wl,-z,defs
+Plugin_EXRCodec_la_LIBADD = -lOgreMain $(OPENEXR_LIBS) $(OGRE_THREAD_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  PlugIns/EXRCodec/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  PlugIns/EXRCodec/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)"
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    f=$(am__strip_dir) \
+	    echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	    $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  p=$(am__strip_dir) \
+	  echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \
+	  $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+Plugin_EXRCodec.la: $(Plugin_EXRCodec_la_OBJECTS) $(Plugin_EXRCodec_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(Plugin_EXRCodec_la_LDFLAGS) $(Plugin_EXRCodec_la_OBJECTS) $(Plugin_EXRCodec_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/O_IStream.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreEXRCodec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreEXRCodecDll.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-pkglibLTLIBRARIES install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-pkglibLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /PlugIns/EXRCodec/src/O_IStream.cpp
===================================================================
--- /PlugIns/EXRCodec/src/O_IStream.cpp	(revision 5)
+++ /PlugIns/EXRCodec/src/O_IStream.cpp	(revision 5)
@@ -0,0 +1,56 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "O_IStream.h"
+#include <Iex.h>
+using namespace Imf;
+
+
+namespace Ogre {
+
+bool O_IStream::read(char c[], int n) {
+    size_t s = _stream.read(c, n);
+    if(s != n)
+        throw Iex::InputExc ("Unexpected end of file.");
+    return _stream.eof();
+}
+
+Int64 O_IStream::tellg() {
+    return _stream.getCurrentPtr() - _stream.getPtr();
+}
+
+void O_IStream::seekg(Int64 pos) {
+    _stream.seek(pos);
+}
+
+void O_IStream::clear() {
+    /* Clear error flags -- there are no error flags */
+}
+
+
+};
Index: /PlugIns/EXRCodec/src/O_IStream.h
===================================================================
--- /PlugIns/EXRCodec/src/O_IStream.h	(revision 5)
+++ /PlugIns/EXRCodec/src/O_IStream.h	(revision 5)
@@ -0,0 +1,60 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _O_IStream_H__
+#define _O_IStream_H__
+
+#include "OgreDataStream.h"
+#include <ImfInt64.h>
+#include <ImfIO.h>
+
+
+namespace Ogre {
+   
+/**
+ * Adapter class for feeding OGRE data chunks as input to Imf.
+ */
+class O_IStream: public Imf::IStream
+{
+public:
+
+    O_IStream(MemoryDataStream& stream, const char fileName[]):
+        IStream (fileName), _stream(stream) {}
+
+    virtual bool    read (char c[], int n);
+    virtual Imf::Int64   tellg ();
+    virtual void    seekg (Imf::Int64 pos);
+    virtual void    clear ();
+
+private:
+    MemoryDataStream& _stream;
+};
+
+};
+
+#endif
Index: /PlugIns/EXRCodec/src/OgreEXRCodec.cpp
===================================================================
--- /PlugIns/EXRCodec/src/OgreEXRCodec.cpp	(revision 5)
+++ /PlugIns/EXRCodec/src/OgreEXRCodec.cpp	(revision 5)
@@ -0,0 +1,206 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreRoot.h"
+#include "OgreLogManager.h"
+#include "OgreImage.h"
+#include "OgreException.h"
+
+#include "OgreEXRCodec.h"
+
+#include "O_IStream.h"
+
+#include <cmath>
+#include <ImfOutputFile.h>
+#include <ImfInputFile.h>
+#include <ImfChannelList.h>
+#include <ImfStringAttribute.h>
+#include <ImfMatrixAttribute.h>
+#include <ImfArray.h>
+
+using namespace Imath;
+using namespace Imf;
+
+namespace Ogre {
+
+void writeEXRHalf(OStream *ost, const float *pixels,
+	      int width, int height, int components) 
+{
+	//assert(components==3 || components==4);
+	// TODO: throw std::exception if invalid number of components
+
+	Header header (width, height);
+	header.channels().insert ("R", Channel (HALF));
+	header.channels().insert ("G", Channel (HALF));
+	header.channels().insert ("B", Channel (HALF));
+	if(components==4)
+		header.channels().insert ("A", Channel (HALF));
+
+	// Convert data to half
+	half *data = new half [width*height*components];
+	
+	std::copy(pixels, pixels+(width*height*components), data);
+	
+	// And save it
+	OutputFile file (*ost, header);
+	FrameBuffer frameBuffer;
+
+	frameBuffer.insert("R",				// name
+			    Slice (HALF,		// type
+				   ((char *) data)+0,	// base
+				   2 * components,		// xStride
+				   2 * components * width));	// yStride
+	frameBuffer.insert("G",				// name
+			    Slice (HALF,		// type
+				   ((char *) data)+2,	// base
+				   2 * components,		// xStride
+				   2 * components * width));	// yStride
+	frameBuffer.insert("B",				// name
+			    Slice (HALF,		// type
+				   ((char *) data)+4,	// base
+				   2 * components,		// xStride
+				   2 * components * width));	// yStride
+	if(components==4) {
+		frameBuffer.insert("A",					// name
+				    Slice (HALF,			// type
+					   ((char *) data)+6,		// base
+					   2 * components,		// xStride
+					   2 * components * width));	// yStride
+	}
+
+	file.setFrameBuffer(frameBuffer);
+	file.writePixels(height);
+	delete data;
+}
+
+
+EXRCodec::EXRCodec() 
+{
+    LogManager::getSingleton().logMessage("EXRCodec initialised");
+}
+EXRCodec::~EXRCodec() 
+{
+    LogManager::getSingleton().logMessage("EXRCodec deinitialised");
+}
+
+DataStreamPtr EXRCodec::code(MemoryDataStreamPtr& input, CodecDataPtr& pData) const
+{
+
+}
+
+Codec::DecodeResult EXRCodec::decode(DataStreamPtr& input) const
+{
+    ImageData * imgData = new ImageData;
+    MemoryDataStreamPtr output;
+
+    try {
+        // Make a mutable clone of input to be able to change file pointer
+        MemoryDataStream myIn(input);
+    
+        // Now we can simulate an OpenEXR file with that
+        O_IStream str(myIn, "SomeChunk.exr");
+        InputFile file(str);
+    
+        Box2i dw = file.header().dataWindow();
+        int width  = dw.max.x - dw.min.x + 1;
+        int height = dw.max.y - dw.min.y + 1;
+        int components = 3;
+    
+        // Alpha channel present?
+        const ChannelList &channels = file.header().channels();
+        if(channels.findChannel("A"))
+            components = 4;
+        
+        // Allocate memory
+        output.bind(new MemoryDataStream(width*height*components*4));
+    
+        // Construct frame buffer
+        uchar *pixels = output->getPtr();
+        FrameBuffer frameBuffer;
+        frameBuffer.insert("R",             // name
+                    Slice (FLOAT,       // type
+                       ((char *) pixels)+0, // base
+                       4 * components,      // xStride
+                    4 * components * width));    // yStride
+        frameBuffer.insert("G",             // name
+                    Slice (FLOAT,       // type
+                       ((char *) pixels)+4, // base
+                       4 * components,      // xStride
+                    4 * components * width));    // yStride
+        frameBuffer.insert("B",             // name
+                    Slice (FLOAT,       // type
+                       ((char *) pixels)+8, // base
+                       4 * components,      // xStride
+                    4 * components * width));    // yStride
+        if(components==4) {
+            frameBuffer.insert("A",                 // name
+                        Slice (FLOAT,           // type
+                           ((char *) pixels)+12,        // base
+                           4 * components,      // xStride
+                        4 * components * width));    // yStride
+        }
+      
+        file.setFrameBuffer (frameBuffer);
+        file.readPixels (dw.min.y, dw.max.y);
+    
+        imgData->format = components==3 ? PF_FLOAT32_RGB : PF_FLOAT32_RGBA;
+        imgData->width = width;
+        imgData->height = height;
+        imgData->depth = 1;
+        imgData->size = width*height*components*4;
+        imgData->num_mipmaps = 0;
+        imgData->flags = 0;
+    } catch (const std::exception &exc) {
+        delete imgData;
+        throw(Exception(Exception::ERR_INTERNAL_ERROR,
+            "OpenEXR Error",
+            exc.what()));
+    }
+    
+    DecodeResult ret;
+    ret.first = output; 
+    ret.second = CodecDataPtr(imgData);
+    return ret;
+}
+
+void EXRCodec::codeToFile(MemoryDataStreamPtr& input, const String& outFileName, CodecDataPtr& pData) const
+{
+
+}
+
+
+String EXRCodec::getType() const 
+{
+    return "exr";
+}
+
+
+
+}
Index: /PlugIns/EXRCodec/src/OgreEXRCodecDll.cpp
===================================================================
--- /PlugIns/EXRCodec/src/OgreEXRCodecDll.cpp	(revision 5)
+++ /PlugIns/EXRCodec/src/OgreEXRCodecDll.cpp	(revision 5)
@@ -0,0 +1,46 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreEXRCodec.h"
+
+namespace Ogre {
+    Codec *mEXRCodec;
+    
+    //-----------------------------------------------------------------------
+    extern "C" void dllStartPlugin(void)
+    {
+        mEXRCodec = new EXRCodec;
+        Codec::registerCodec( mEXRCodec );
+    }
+    extern "C" void dllStopPlugin(void)
+    {
+        Codec::unRegisterCodec( mEXRCodec );
+        delete mEXRCodec;
+    }
+
+}
Index: /PlugIns/Makefile.am
===================================================================
--- /PlugIns/Makefile.am	(revision 5)
+++ /PlugIns/Makefile.am	(revision 5)
@@ -0,0 +1,9 @@
+SUBDIRS = BSPSceneManager ParticleFX OctreeSceneManager 
+
+if BUILD_CGPLUGIN
+SUBDIRS += CgProgramManager
+endif
+
+if BUILD_EXRPLUGIN
+SUBDIRS += EXRCodec
+endif
Index: /PlugIns/Makefile.in
===================================================================
--- /PlugIns/Makefile.in	(revision 5)
+++ /PlugIns/Makefile.in	(revision 5)
@@ -0,0 +1,548 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+@BUILD_CGPLUGIN_TRUE@am__append_1 = CgProgramManager
+@BUILD_EXRPLUGIN_TRUE@am__append_2 = EXRCodec
+subdir = PlugIns
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = BSPSceneManager ParticleFX OctreeSceneManager \
+	CgProgramManager EXRCodec
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = BSPSceneManager ParticleFX OctreeSceneManager \
+	$(am__append_1) $(am__append_2)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  PlugIns/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  PlugIns/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /PlugIns/OctreeSceneManager/Makefile.am
===================================================================
--- /PlugIns/OctreeSceneManager/Makefile.am	(revision 5)
+++ /PlugIns/OctreeSceneManager/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /PlugIns/OctreeSceneManager/Makefile.in
===================================================================
--- /PlugIns/OctreeSceneManager/Makefile.in	(revision 5)
+++ /PlugIns/OctreeSceneManager/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = PlugIns/OctreeSceneManager
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  PlugIns/OctreeSceneManager/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  PlugIns/OctreeSceneManager/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /PlugIns/OctreeSceneManager/include/Makefile.am
===================================================================
--- /PlugIns/OctreeSceneManager/include/Makefile.am	(revision 5)
+++ /PlugIns/OctreeSceneManager/include/Makefile.am	(revision 5)
@@ -0,0 +1,14 @@
+noinst_HEADERS = \
+		OgreHeightmapTerrainPageSource.h \
+		OgreOctreeCamera.h \
+        OgreOctreeNode.h \
+        OgreOctree.h \
+		OgreOctreePlugin.h \
+		OgreOctreeSceneManager.h \
+		OgreOctreeSceneQuery.h \
+		OgreTerrainPage.h \
+		OgreTerrainPageSource.h \
+		OgreTerrainPrerequisites.h \
+		OgreTerrainRenderable.h \
+		OgreTerrainSceneManager.h \
+		OgreTerrainVertexProgram.h 
Index: /PlugIns/OctreeSceneManager/include/Makefile.in
===================================================================
--- /PlugIns/OctreeSceneManager/include/Makefile.in	(revision 5)
+++ /PlugIns/OctreeSceneManager/include/Makefile.in	(revision 5)
@@ -0,0 +1,450 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = PlugIns/OctreeSceneManager/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = \
+		OgreHeightmapTerrainPageSource.h \
+		OgreOctreeCamera.h \
+        OgreOctreeNode.h \
+        OgreOctree.h \
+		OgreOctreePlugin.h \
+		OgreOctreeSceneManager.h \
+		OgreOctreeSceneQuery.h \
+		OgreTerrainPage.h \
+		OgreTerrainPageSource.h \
+		OgreTerrainPrerequisites.h \
+		OgreTerrainRenderable.h \
+		OgreTerrainSceneManager.h \
+		OgreTerrainVertexProgram.h 
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  PlugIns/OctreeSceneManager/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  PlugIns/OctreeSceneManager/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /PlugIns/OctreeSceneManager/include/OgreHeightmapTerrainPageSource.h
===================================================================
--- /PlugIns/OctreeSceneManager/include/OgreHeightmapTerrainPageSource.h	(revision 5)
+++ /PlugIns/OctreeSceneManager/include/OgreHeightmapTerrainPageSource.h	(revision 5)
@@ -0,0 +1,82 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __HeightmapTerrainPageSource_H__
+#define __HeightmapTerrainPageSource_H__
+
+#include "OgreTerrainPrerequisites.h"
+#include "OgreTerrainPageSource.h"
+#include "OgreImage.h"
+
+namespace Ogre {
+
+    /** Specialisation of the TerrainPageSource class to provide tiles loaded
+        from a 2D greyscale image.
+    @remarks
+        This is a simple tile provider that does not support paging; it is
+        assumed that the entire heightmap is loaded as one page.
+    */
+    class _OgreOctreePluginExport HeightmapTerrainPageSource : public TerrainPageSource
+    {
+    protected:
+        /// Is this input RAW?
+        bool mIsRaw;
+        /// Should we flip terrain vertically?
+        bool mFlipTerrain;
+        /// Image containing the source heightmap if loaded from non-RAW
+        Image mImage;
+        /// Arbitrary data loaded from RAW
+        MemoryDataStreamPtr mRawData;
+        /// The (single) terrain page this source will provide
+        TerrainPage* mPage;
+        /// Source file name
+        String mSource;
+        /// Manual size if source is RAW
+        size_t mRawSize;
+        /// Manual bpp if source is RAW
+        uchar mRawBpp;
+        
+        /// Load a heightmap
+        void loadHeightmap(void);
+    public:
+        HeightmapTerrainPageSource();
+        ~HeightmapTerrainPageSource();
+        /// @see TerrainPageSource
+        void shutdown(void);
+        /// @see TerrainPageSource
+        void requestPage(ushort x, ushort y);
+        /// @see TerrainPageSource
+        void expirePage(ushort x, ushort y);
+        /// @see TerrainPageSource
+        void initialise(TerrainSceneManager* tsm, 
+            ushort tileSize, ushort pageSize, bool asyncLoading, 
+            TerrainPageSourceOptionList& optionList);
+    };
+}
+
+#endif
Index: /PlugIns/OctreeSceneManager/include/OgreOctree.h
===================================================================
--- /PlugIns/OctreeSceneManager/include/OgreOctree.h	(revision 5)
+++ /PlugIns/OctreeSceneManager/include/OgreOctree.h	(revision 5)
@@ -0,0 +1,167 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/***************************************************************************
+octree.h  -  description
+-------------------
+begin                : Mon Sep 30 2002
+copyright            : (C) 2002 by Jon Anderson
+email                : janders@users.sf.net
+
+Enhancements 2003 - 2004 (C) The OGRE Team
+***************************************************************************/
+
+#ifndef OCTREE_H
+#define OCTREE_H
+
+#include <OgreAxisAlignedBox.h>
+#include <OgreWireBoundingBox.h>
+
+#include <list>
+
+namespace Ogre
+{
+
+class OctreeNode;
+
+typedef std::list < OctreeNode * > NodeList;
+
+
+/** Octree datastructure for managing scene nodes.
+@remarks
+This is a loose octree implementation, meaning that each
+octant child of the octree actually overlaps it's siblings by a factor
+of .5.  This guarantees that any thing that is half the size of the parent will
+fit completely into a child, with no splitting necessary.
+*/
+
+class Octree
+{
+public:
+    Octree( Octree * p );
+    ~Octree();
+
+    /** Adds an Octree scene node to this octree level.
+    @remarks
+    This is called by the OctreeSceneManager after
+    it has determined the correct Octree to insert the node into.
+    */
+    void _addNode( OctreeNode * );
+
+    /** Removes an Octree scene node to this octree level.
+    */
+    void _removeNode( OctreeNode * );
+
+    /** Returns the number of scene nodes attached to this octree
+    */
+    int numNodes()
+    {
+        return mNumNodes;
+    };
+
+    /** The bounding box of the octree
+    @remarks
+    This is used for octant index determination and rendering, but not culling
+    */
+    AxisAlignedBox mBox;
+    WireBoundingBox* mWireBoundingBox;
+    
+    /** Creates the wire frame bounding box for this octant
+    */
+    WireBoundingBox* getWireBoundingBox();
+
+    /** Vector containing the dimensions of this octree / 2
+    */
+    Vector3 mHalfSize;
+
+    /** 3D array of children of this octree.
+    @remarks
+    Children are dynamically created as needed when nodes are inserted in the Octree.
+    If, later, all the nodes are removed from the child, it is still kept around.
+    */
+    Octree * mChildren[ 2 ][ 2 ][ 2 ];
+
+    /** Determines if this octree is twice as big as the given box.
+    @remarks
+    This method is used by the OctreeSceneManager to determine if the given
+    box will fit into a child of this octree.
+    */
+    bool _isTwiceSize( const AxisAlignedBox &box ) const;
+
+    /**  Returns the appropriate indexes for the child of this octree into which the box will fit.
+    @remarks
+    This is used by the OctreeSceneManager to determine which child to traverse next when
+    finding the appropriate octree to insert the box.  Since it is a loose octree, only the
+    center of the box is checked to determine the octant.
+    */
+    void _getChildIndexes( const AxisAlignedBox &, int *x, int *y, int *z ) const;
+
+    /** Creates the AxisAlignedBox used for culling this octree.
+    @remarks
+    Since it's a loose octree, the culling bounds can be different than the actual bounds of the octree.
+    */
+    void _getCullBounds( AxisAlignedBox * ) const;
+
+
+    /** Public list of SceneNodes attached to this particular octree
+    */
+    NodeList mNodes;
+
+protected:
+
+    /** Increments the overall node count of this octree and all its parents
+    */
+    inline void _ref()
+    {
+        mNumNodes++;
+
+        if ( mParent != 0 ) mParent -> _ref();
+    };
+
+    /** Decrements the overall node count of this octree and all its parents
+    */
+    inline void _unref()
+    {
+        mNumNodes--;
+
+        if ( mParent != 0 ) mParent -> _unref();
+    };
+
+    ///number of SceneNodes in this octree and all its children.
+    int mNumNodes;
+
+    ///parent octree
+    Octree * mParent;
+
+};
+
+}
+
+#endif
+
+
Index: /PlugIns/OctreeSceneManager/include/OgreOctreeCamera.h
===================================================================
--- /PlugIns/OctreeSceneManager/include/OgreOctreeCamera.h	(revision 5)
+++ /PlugIns/OctreeSceneManager/include/OgreOctreeCamera.h	(revision 5)
@@ -0,0 +1,90 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/***************************************************************************
+octreecamera.h  -  description
+-------------------
+begin                : Fri Sep 27 2002
+copyright            : (C) 2002 by Jon Anderson
+email                : janders@users.sf.net
+
+Enhancements 2003 - 2004 (C) The OGRE Team
+***************************************************************************/
+
+#ifndef OCTREECAMERA_H
+#define OCTREECAMERA_H
+
+#include <OgreCamera.h>
+#include <OgreHardwareBufferManager.h>
+#include <OgreSimpleRenderable.h>
+#include "OgreTerrainPrerequisites.h"
+
+/**
+*@author Jon Anderson
+*/
+
+namespace Ogre
+{
+
+class Octree;
+
+
+/** Specialized viewpoint from which an Octree can be rendered.
+@remarks
+This class contains several specializations of the Ogre::Camera class. It
+implements the getRenderOperation method in order to return displayable geometry
+for debugging purposes. It also implements a visibility function that is more granular
+than the default.
+*/
+
+class _OgreOctreePluginExport OctreeCamera : public Camera
+{
+public:
+
+    /** Visibility types */
+    enum Visibility
+    {
+        NONE,
+        PARTIAL,
+        FULL
+    };
+
+    /* Standard constructor */
+    OctreeCamera( const String& name, SceneManager* sm );
+    /* Standard destructor */
+    ~OctreeCamera();
+
+    /** Returns the visiblity of the box
+    */
+    OctreeCamera::Visibility getVisibility( const AxisAlignedBox &bound );
+
+};
+
+}
+
+#endif
Index: /PlugIns/OctreeSceneManager/include/OgreOctreeNode.h
===================================================================
--- /PlugIns/OctreeSceneManager/include/OgreOctreeNode.h	(revision 5)
+++ /PlugIns/OctreeSceneManager/include/OgreOctreeNode.h	(revision 5)
@@ -0,0 +1,149 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/***************************************************************************
+octreenode.h  -  description
+-------------------
+begin                : Fri Sep 27 2002
+copyright            : (C) 2002 by Jon Anderson
+email                : janders@users.sf.net
+
+Enhancements 2003 - 2004 (C) The OGRE Team
+***************************************************************************/
+
+#ifndef OCTREENODE_H
+#define OCTREENODE_H
+
+#include <OgreSceneNode.h>
+
+#include <OgreOctreeSceneManager.h>
+#include "OgreTerrainPrerequisites.h"
+
+namespace Ogre
+{
+
+/** Specialized SceneNode that is customized for working within an Octree. Each node
+* maintains its own bounding box, rather than merging it with all the children.
+*
+*/
+
+class _OgreOctreePluginExport OctreeNode : public SceneNode
+{
+public:
+    /** Standard constructor */
+    OctreeNode( SceneManager* creator );
+    /** Standard constructor */
+    OctreeNode( SceneManager* creator, const String& name );
+    /** Standard destructor */
+    ~OctreeNode();
+
+    /** Overridden from Node to remove any reference to octants */
+    Node * removeChild( unsigned short index );
+    
+    /** Overridden from Node to remove any reference to octants */
+    Node * removeChild( const String & name );
+
+    /** Overridden from Node to remove any reference to octants */
+    Node * removeChild( Node* child);
+
+	/** Overridden from Node to remove any reference to octants */
+	void removeAllChildren(void);
+
+    /** Returns the Octree in which this OctreeNode resides
+    */
+    Octree * getOctant()
+    {
+        return mOctant;
+    };
+
+    /** Sets the Octree in which this OctreeNode resides
+    */
+    void setOctant( Octree *o )
+    {
+        mOctant = o;
+    };
+
+    /** Determines if the center of this node is within the given box
+    */
+    bool _isIn( AxisAlignedBox &box );
+
+    /** Adds all the attached scenenodes to the render queue
+    */
+    virtual void _addToRenderQueue( Camera* cam, RenderQueue * q, bool onlyShadowCasters, 
+		VisibleObjectsBoundsInfo* visibleBounds);
+
+    /** Sets up the LegacyRenderOperation for rendering this scene node as geometry.
+    @remarks
+    This will render the scenenode as a bounding box.
+    */
+    virtual void getRenderOperation( RenderOperation& op );
+
+    /** Returns the local bounding box of this OctreeNode.
+    @remarks
+    This is used to render the bounding box, rather then the global.
+    */
+    AxisAlignedBox & _getLocalAABB()
+    {
+        return mLocalAABB;
+    };
+
+
+
+
+protected:
+
+    /** Internal method for updating the bounds for this OctreeNode.
+    @remarks
+    This method determines the bounds solely from the attached objects, not
+    any children. If the node has changed its bounds, it is removed from its
+    current octree, and reinserted into the tree.
+    */
+    void _updateBounds( void );
+
+    void _removeNodeAndChildren( );
+
+    ///local bounding box
+    AxisAlignedBox mLocalAABB;
+
+    ///Octree this node is attached to.
+    Octree *mOctant;
+
+    ///preallocated corners for rendering
+    Real mCorners[ 24 ];
+    ///shared colors for rendering
+    static unsigned long mColors[ 8 ];
+    ///shared indexes for rendering
+    static unsigned short mIndexes[ 24 ];
+
+
+};
+
+}
+
+
+#endif
Index: /PlugIns/OctreeSceneManager/include/OgreOctreePlugin.h
===================================================================
--- /PlugIns/OctreeSceneManager/include/OgreOctreePlugin.h	(revision 5)
+++ /PlugIns/OctreeSceneManager/include/OgreOctreePlugin.h	(revision 5)
@@ -0,0 +1,68 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OctreePlugin_H__
+#define __OctreePlugin_H__
+
+#include "OgrePlugin.h"
+#include "OgreOctreeSceneManager.h"
+#include "OgreTerrainSceneManager.h"
+
+namespace Ogre
+{
+
+	/** Plugin instance for Octree Manager */
+	class OctreePlugin : public Plugin
+	{
+	public:
+		OctreePlugin();
+
+
+		/// @copydoc Plugin::getName
+		const String& getName() const;
+
+		/// @copydoc Plugin::install
+		void install();
+
+		/// @copydoc Plugin::initialise
+		void initialise();
+
+		/// @copydoc Plugin::shutdown
+		void shutdown();
+
+		/// @copydoc Plugin::uninstall
+		void uninstall();
+	protected:
+		OctreeSceneManagerFactory* mOctreeSMFactory;
+		TerrainSceneManagerFactory* mTerrainSMFactory;
+		TerrainPageSourceListenerManager* mTerrainPSListenerManager;
+
+	};
+}
+
+#endif
Index: /PlugIns/OctreeSceneManager/include/OgreOctreeSceneManager.h
===================================================================
--- /PlugIns/OctreeSceneManager/include/OgreOctreeSceneManager.h	(revision 5)
+++ /PlugIns/OctreeSceneManager/include/OgreOctreeSceneManager.h	(revision 5)
@@ -0,0 +1,255 @@
+/***************************************************************************
+octreescenemanager.h  -  description
+-------------------
+begin                : Fri Sep 27 2002
+copyright            : (C) 2002 by Jon Anderson
+email                : janders@users.sf.net
+***************************************************************************/
+
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef OCTREESCENEMANAGER_H
+#define OCTREESCENEMANAGER_H
+
+#include "OgreTerrainPrerequisites.h"
+#include "OgreSceneManager.h"
+#include "OgreRenderOperation.h"
+#include "OgreSphere.h"
+
+#include <list>
+#include <algorithm>
+
+#include <OgreOctree.h>
+
+
+namespace Ogre
+{
+
+class OctreeNode;
+
+class OctreeCamera;
+class OctreeIntersectionSceneQuery;
+class OctreeRaySceneQuery;
+class OctreeSphereSceneQuery;
+class OctreeAxisAlignedBoxSceneQuery;
+class OctreePlaneBoundedVolumeListSceneQuery;
+
+
+typedef std::list < WireBoundingBox * > BoxList;
+typedef std::list < unsigned long > ColorList;
+//typedef std::list < SceneNode * > SceneNodeList;
+
+
+/** Specialized SceneManager that divides the geometry into an octree in order to facilitate spatial queries.
+@remarks
+*/
+
+class _OgreOctreePluginExport OctreeSceneManager : public SceneManager
+{
+    friend class OctreeIntersectionSceneQuery;
+    friend class OctreeRaySceneQuery;
+    friend class OctreeSphereSceneQuery;
+    friend class OctreeAxisAlignedBoxSceneQuery;
+    friend class OctreePlaneBoundedVolumeListSceneQuery;
+
+public:
+    static int intersect_call;
+    /** Standard Constructor.  Initializes the octree to -10000,-10000,-10000 to 10000,10000,10000 with a depth of 8. */
+    OctreeSceneManager(const String& name);
+    /** Standard Constructor */
+    OctreeSceneManager(const String& name, AxisAlignedBox &box, int max_depth );
+    /** Standard destructor */
+    ~OctreeSceneManager();
+
+	/// @copydoc SceneManager::getTypeName
+	const String& getTypeName(void) const;
+
+    /** Initializes the manager to the given box and depth.
+    */
+    void init( AxisAlignedBox &box, int d );
+
+    /** Creates a specialized OctreeNode */
+    virtual	SceneNode * createSceneNode ( void );
+    /** Creates a specialized OctreeNode */
+    virtual SceneNode * createSceneNode ( const String &name );
+    /** Creates a specialized OctreeCamera */
+    virtual Camera * createCamera( const String &name );
+
+    /** Deletes a scene node */
+    virtual void destroySceneNode( const String &name );
+
+
+
+    /** Does nothing more */
+    virtual void _updateSceneGraph( Camera * cam );
+    /** Recurses through the octree determining which nodes are visible. */
+    virtual void _findVisibleObjects ( Camera * cam, 
+		VisibleObjectsBoundsInfo* visibleBounds, bool onlyShadowCasters );
+
+    /** Alerts each unculled object, notifying it that it will be drawn.
+     * Useful for doing calculations only on nodes that will be drawn, prior
+     * to drawing them...
+     */
+    virtual void _alertVisibleObjects( void );
+
+    /** Walks through the octree, adding any visible objects to the render queue.
+    @remarks
+    If any octant in the octree if completely within the view frustum,
+    all subchildren are automatically added with no visibility tests.
+    */
+    void walkOctree( OctreeCamera *, RenderQueue *, Octree *, 
+		VisibleObjectsBoundsInfo* visibleBounds, bool foundvisible, 
+		bool onlyShadowCasters);
+
+    /** Checks the given OctreeNode, and determines if it needs to be moved
+    * to a different octant.
+    */
+    void _updateOctreeNode( OctreeNode * );
+    /** Removes the given octree node */
+    void _removeOctreeNode( OctreeNode * );
+    /** Adds the Octree Node, starting at the given octree, and recursing at max to the specified depth.
+    */
+    void _addOctreeNode( OctreeNode *, Octree *octree, int depth = 0 );
+
+    /** Recurses the octree, adding any nodes intersecting with the box into the given list.
+    It ignores the exclude scene node.
+    */
+    void findNodesIn( const AxisAlignedBox &box, std::list < SceneNode * > &list, SceneNode *exclude = 0 );
+
+    /** Recurses the octree, adding any nodes intersecting with the sphere into the given list.
+    It ignores the exclude scene node.
+    */
+    void findNodesIn( const Sphere &sphere, std::list < SceneNode * > &list, SceneNode *exclude = 0 );
+
+    /** Recurses the octree, adding any nodes intersecting with the volume into the given list.
+      It ignores the exclude scene node.
+      */
+    void findNodesIn( const PlaneBoundedVolume &volume, std::list < SceneNode * > &list, SceneNode *exclude=0 );
+
+    /** Recurses the octree, adding any nodes intersecting with the ray into the given list.
+      It ignores the exclude scene node.
+      */
+    void findNodesIn( const Ray &ray, std::list < SceneNode * > &list, SceneNode *exclude=0 );
+
+    /** Sets the box visibility flag */
+    void setShowBoxes( bool b )
+    {
+        mShowBoxes = b;
+    };
+
+    void setLooseOctree( bool b )
+    {
+        mLoose = b;
+    };
+
+
+    /** Resizes the octree to the given size */
+    void resize( const AxisAlignedBox &box );
+
+    /** Sets the given option for the SceneManager
+               @remarks
+        Options are:
+        "Size", AxisAlignedBox *;
+        "Depth", int *;
+        "ShowOctree", bool *;
+    */
+
+    virtual bool setOption( const String &, const void * );
+    /** Gets the given option for the Scene Manager.
+        @remarks
+        See setOption
+    */
+    virtual bool getOption( const String &, void * );
+
+    bool getOptionValues( const String & key, StringVector &refValueList );
+    bool getOptionKeys( StringVector &refKeys );
+    /** Overridden from SceneManager */
+    void clearScene(void);
+
+    AxisAlignedBoxSceneQuery* createAABBQuery(const AxisAlignedBox& box, unsigned long mask);
+    SphereSceneQuery* createSphereQuery(const Sphere& sphere, unsigned long mask);
+    PlaneBoundedVolumeListSceneQuery* createPlaneBoundedVolumeQuery(const PlaneBoundedVolumeList& volumes, unsigned long mask);
+    RaySceneQuery* createRayQuery(const Ray& ray, unsigned long mask);
+    IntersectionSceneQuery* createIntersectionQuery(unsigned long mask);
+
+
+protected:
+
+
+    NodeList mVisible;
+
+    /// The root octree
+    Octree *mOctree;
+
+    /// List of boxes to be rendered
+    BoxList mBoxes;
+
+    /// Number of rendered objs
+    int mNumObjects;
+
+    /// Max depth for the tree
+    int mMaxDepth;
+    /// Size of the octree
+    AxisAlignedBox mBox;
+
+    /// Boxes visibility flag
+    bool mShowBoxes;
+
+
+    bool mLoose;
+
+    Real mCorners[ 24 ];
+    static unsigned long mColors[ 8 ];
+    static unsigned short mIndexes[ 24 ];
+
+    Matrix4 mScaleFactor;
+
+};
+
+/// Factory for OctreeSceneManager
+class OctreeSceneManagerFactory : public SceneManagerFactory
+{
+protected:
+	void initMetaData(void) const;
+public:
+	OctreeSceneManagerFactory() {}
+	~OctreeSceneManagerFactory() {}
+	/// Factory type name
+	static const String FACTORY_TYPE_NAME;
+	SceneManager* createInstance(const String& instanceName);
+	void destroyInstance(SceneManager* instance);
+};
+
+
+
+}
+
+#endif
+
Index: /PlugIns/OctreeSceneManager/include/OgreOctreeSceneQuery.h
===================================================================
--- /PlugIns/OctreeSceneManager/include/OgreOctreeSceneQuery.h	(revision 5)
+++ /PlugIns/OctreeSceneManager/include/OgreOctreeSceneQuery.h	(revision 5)
@@ -0,0 +1,103 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+ 
+Copyright  2000-2005 The OGRE Team
+Also see acknowledgements in Readme.html
+ 
+This program 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 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 Lesser General Public License for more details.
+ 
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/***************************************************************************
+OgreOctreeSceneQuery.h  -  description
+-------------------
+begin                : Tues July 20, 2004
+copyright            : (C) 2004 by Jon Anderson
+email                : janders@users.sf.net
+***************************************************************************/
+
+#ifndef OCTREESCENEQUERY_H
+#define OCTREESCENEQUERY_H
+
+#include "OgreTerrainPrerequisites.h"
+#include <OgreSceneManager.h>
+
+
+namespace Ogre
+{
+/** Octree implementation of IntersectionSceneQuery. */
+class _OgreOctreePluginExport OctreeIntersectionSceneQuery :  public DefaultIntersectionSceneQuery
+{
+public:
+    OctreeIntersectionSceneQuery(SceneManager* creator);
+    ~OctreeIntersectionSceneQuery();
+
+    /** See IntersectionSceneQuery. */
+    void execute(IntersectionSceneQueryListener* listener);
+};
+
+/** Octree implementation of RaySceneQuery. */
+class _OgreOctreePluginExport OctreeRaySceneQuery : public DefaultRaySceneQuery
+{
+public:
+    OctreeRaySceneQuery(SceneManager* creator);
+    ~OctreeRaySceneQuery();
+
+    /** See RayScenQuery. */
+    void execute(RaySceneQueryListener* listener);
+};
+/** Octree implementation of SphereSceneQuery. */
+class _OgreOctreePluginExport OctreeSphereSceneQuery : public DefaultSphereSceneQuery
+{
+public:
+    OctreeSphereSceneQuery(SceneManager* creator);
+    ~OctreeSphereSceneQuery();
+
+    /** See SceneQuery. */
+    void execute(SceneQueryListener* listener);
+};
+/** Octree implementation of PlaneBoundedVolumeListSceneQuery. */
+class _OgreOctreePluginExport OctreePlaneBoundedVolumeListSceneQuery : public DefaultPlaneBoundedVolumeListSceneQuery
+{
+public:
+    OctreePlaneBoundedVolumeListSceneQuery(SceneManager* creator);
+    ~OctreePlaneBoundedVolumeListSceneQuery();
+
+    /** See SceneQuery. */
+    void execute(SceneQueryListener* listener);
+};
+/** Octree implementation of AxisAlignedBoxSceneQuery. */
+class _OgreOctreePluginExport OctreeAxisAlignedBoxSceneQuery : public DefaultAxisAlignedBoxSceneQuery
+{
+public:
+    OctreeAxisAlignedBoxSceneQuery(SceneManager* creator);
+    ~OctreeAxisAlignedBoxSceneQuery();
+
+    /** See RaySceneQuery. */
+    void execute(SceneQueryListener* listener);
+};
+
+
+}
+
+#endif
+
+
Index: /PlugIns/OctreeSceneManager/include/OgreTerrainPage.h
===================================================================
--- /PlugIns/OctreeSceneManager/include/OgreTerrainPage.h	(revision 5)
+++ /PlugIns/OctreeSceneManager/include/OgreTerrainPage.h	(revision 5)
@@ -0,0 +1,94 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __TerrainPage_H__
+#define __TerrainPage_H__
+
+#include "OgreTerrainPrerequisites.h"
+#include "OgreRenderQueue.h"
+
+namespace Ogre {
+
+    /** Groups a number of TerrainRenderables (tiles) into a page, which is
+        the unit of loading / unloading.
+    @remarks
+        Note that this class, whilst holding onto TerrainRenderable instances, 
+        does not actually process or initialise them itself - this is 
+        intentional so the TerrainPageSource which is providing the tiles
+        is able to load and prepare each renderable incrementally if required, 
+        thus avoiding any 'single hit' load methods for the page.
+    @par
+        All this class does do is pre-create a 2D vector of 'slots' in which 
+        to place the TerrainRenderable pointers, which it does on 
+        construction. Note that this structure is public to allow completely
+        free access to users of this class.
+    */
+    class _OgreOctreePluginExport TerrainPage
+    {
+    public:
+        typedef std::vector < TerrainRenderable * > TerrainRow;
+        typedef std::vector < TerrainRow > Terrain2D;
+        
+        /// 2-dimensional vector of tiles, pre-allocated to the correct size
+        Terrain2D tiles;
+        /// The number of tiles across a page
+        unsigned short tilesPerPage;
+        /// The scene node to which all the tiles for this page are attached
+        SceneNode* pageSceneNode;
+
+        /** The main constructor. 
+        @param numTiles The number of terrain tiles (TerrainRenderable)
+            across (and down) a page
+        */
+        TerrainPage(unsigned short numTiles);
+
+        /** Destructor, will organise the deletion of pages
+        */
+        virtual ~TerrainPage();
+        /** After TerrainRenderables have been populated, this method
+            adds the neighbour links. 
+        @remarks
+            Should be called before adding the page to the scene manager.
+        */
+        void linkNeighbours(void);
+
+        /** Returns the TerrainRenderable that contains the given pt.
+        If no tile exists at the point, it returns 0;
+        */
+        TerrainRenderable * getTerrainTile( const Vector3 & pt );
+
+		/** Sets the render queue group which the tiles should be rendered in. */
+		void setRenderQueue(uint8 qid);
+
+
+    };
+
+
+}
+
+#endif
Index: /PlugIns/OctreeSceneManager/include/OgreTerrainPageSource.h
===================================================================
--- /PlugIns/OctreeSceneManager/include/OgreTerrainPageSource.h	(revision 5)
+++ /PlugIns/OctreeSceneManager/include/OgreTerrainPageSource.h	(revision 5)
@@ -0,0 +1,258 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __TerrainPageSource_H__
+#define __TerrainPageSource_H__
+
+#include "OgreTerrainPrerequisites.h"
+#include "OgreSingleton.h"
+
+namespace Ogre {
+
+    typedef std::pair<String, String> TerrainPageSourceOption;
+    typedef std::vector<TerrainPageSourceOption> TerrainPageSourceOptionList;
+
+    /** Abstract class which classes can override to receive notifications
+        when a page is ready to be added to the terrain manager.
+    */
+    class _OgreOctreePluginExport TerrainPageSourceListener
+    {
+    public:
+        /** Listener method called when a new page is about to be constructed. 
+		@param manager The manager in question
+        @param pagex, pagez The index of the page being constructed
+        @param heightData Array of normalised height data (0..1). The size of
+            this buffer will conform to the scene manager page size. The listener
+            may modify the data if it wishes.
+        */
+        virtual void pageConstructed(TerrainSceneManager* manager, size_t pagex, size_t pagez, Real* heightData) = 0;
+    };
+
+	/** Simple manager class to hold onto a list of page source listeners 
+	    across all sources.
+	*/
+	class _OgreOctreePluginExport TerrainPageSourceListenerManager :
+		public Singleton<TerrainPageSourceListenerManager>
+	{
+	protected:
+        typedef std::vector<TerrainPageSourceListener*> PageSourceListenerList;
+        PageSourceListenerList mPageSourceListeners;
+	public:
+        TerrainPageSourceListenerManager() {}
+        ~TerrainPageSourceListenerManager() {}
+
+        /** Register a class which will be called back whenever a new page is
+            available.
+        @remarks
+            Since this method is static, it applies to any page source which 
+            is in active use; there is no need to register one per source.
+        */
+        void addListener(TerrainPageSourceListener* pl);
+        /** Unregister a class which will be called back whenever a new page is
+        available.
+        */
+        void removeListener(TerrainPageSourceListener* pl);
+		
+        /// Fire pageContructed events
+        void firePageConstructed(TerrainSceneManager* manager, size_t pagex, size_t pagez, Real* heightData);
+
+       /** Override standard Singleton retrieval.
+        */
+        static TerrainPageSourceListenerManager& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        */
+        static TerrainPageSourceListenerManager* getSingletonPtr(void);	
+	
+	};
+
+
+    /** Abstract class which describes the interface which a source of terrain 
+        pages must implement.
+    @remarks
+        The TerrainSceneManager can accept external classes as providers of
+        terrain data, to allow terrain height data to come from anywhere the
+        user application may choose, and additionally to support on-demand
+        loading an unloading of terrain data. Providers must suclass this class, 
+        and implement the abstract methods (details are described within each method)
+    @par
+        The overall sequence of events is this:
+        <ol>
+        <li>TerrainSceneManager is created as usual, and options such as tile
+        size etc are set.</li>
+        <li>CustomTerrainPageSource is registered with TerrainSceneManager by 
+        calling registerPageSource(), registering a particular named type of source 
+        data with this tile source. <li>
+        <li>TerrainSceneManager::setWorldGeometry is called. Depending on the
+        configuration, this will call one of the page source classes 
+        initialise methods, when the scene manager will communicate it's 
+        preferred options. It does not have to load anything immediately on this 
+        call (especially if the terrain options include paging). It will 
+        also set this tile source as the primary.<li>
+        <li>As and when TerrainSceneManager requires more tiles (and this will
+        either be done all up-front, or progressively depending on paging settings)
+        it will call the primary tile source's requestPage() method, with the 
+        page it requires. </li>
+        <li>It is then the responsibility of the tile source to prepare
+        TerrainRenderable instances for the page(s) requested, and to attach them 
+        to the TerrainSceneManager. Note that preparing the tiles does not
+        involve modifying any shared data so may be done in an alternate thread,
+        if required. Attaching them must be done synchronously though.
+        <li>When paging, the TerrainSceneManager will request tiles in advance,
+        within it's 'buffer zone' so some delay in loading is acceptable. It
+        will also indicate when tiles are no longer required (and will detach
+        them); it is up to the tile source whether that memory is actually freed
+        or held for a while longer.
+        </ol>
+    @note The comments on paging above are in principle, the implementation of
+    paging in this manager is not present yet but the system is designed to 
+    extend to it. For now, all tiles are requested up-front.
+    */
+    class _OgreOctreePluginExport TerrainPageSource
+    {
+    protected:
+        /// Link back to parent manager
+        TerrainSceneManager* mSceneManager;
+        /// Has asynchronous loading been requested?
+        bool mAsyncLoading;
+        /// The expected size of the page in number of vertices
+        unsigned short mPageSize;
+        /// The expected size of a tile in number of vertices
+        unsigned short mTileSize;
+
+        /// Internal method for firing pageContructed events
+        void firePageConstructed(size_t pagex, size_t pagez, Real* heightData);
+
+        /** Utility method for building a page of tiles based on some source
+        data, wherever that may have come from.
+        @remarks
+            It is expected that this height data is represented in the range
+            [0..1], which will be duly scaled by the TerrainRenderables it
+            creates.
+        */
+        virtual TerrainPage* buildPage(Real* heightData, const MaterialPtr& pMaterial);
+
+
+    public:
+        TerrainPageSource(); 
+        virtual ~TerrainPageSource() { shutdown(); }
+
+        /** Initialise this tile source based on a series of options as
+            dictated by the scene manager. 
+        @param tsm The TerrainSceneManager doing the initialising. This should be 
+            allowed NULL, for use by external tools if they want to read data 
+            generically without necessarily having a real scene manager involved
+        @param tileSize The number of horizontal (and hence also vertical) 
+            vertices in a single tile (which is a TerrainRenderable). This will
+            always be (2^n)+1.
+        @param pageSize The number of horizontal (and hence also vertical) 
+            vertices in a single page. This will always be (2^n)+1.
+        @param asyncLoading
+            True if the scene manager would like the tile source to load tiles
+            asynchronously. It does not have to do this, although if it does not
+            when requested, it will likely result in stalls in the terrain rendering.
+        @param optionList 
+            A list of name/value pairs describing custom options for this particular
+            page source. The expected convention for option names is
+            "TypeName.OptionName", where TypeName is the type under which this
+            page source has been registered.
+        */
+        virtual void initialise(TerrainSceneManager* tsm, 
+            ushort tileSize, ushort pageSize, bool asyncLoading, 
+            TerrainPageSourceOptionList& optionList)
+        {
+            mSceneManager = tsm;
+            mTileSize = tileSize;
+            mPageSize = pageSize;
+            mAsyncLoading = asyncLoading;
+        }
+        /** Shut down this tile source, freeing all it's memory ready for 
+            decommissioning.
+        @remarks
+            This method will normally just be called on destruction; however
+            it may also be called by the TerrainSceneManager if another source
+            is provided for the same type of tile source.
+        */
+        virtual void shutdown(void) {}
+
+        /** Requests a new page of tiles from the source.
+        @remarks
+            The TerrainSceneManager will call this method when it needs new tiles.
+            In response, this class must prepare TerrainRenderable instances for
+            the page requested and attach the entire page when ready using 
+            TerrainSceneManager::attachTerrainPage.
+        @par
+            Now, the tile source does not necessarily need to do all that before the
+            return of this method. If it likes, and particularly if asynchronous 
+            loading is enabled, it can merely queue this request, and process it
+            either in another thread, or over a series of frames. The key thing
+            is that attaching the new page has to be done synchronously with 
+            the main rendering loop in order to avoid concurrency issues; 
+            other than that, you are free to load and prepare new tiles in 
+            a concurrent fashion if you like.
+        @par
+            Typically the scene manager will request at least one page up-front,
+            with the possibility of requesting more if paging is enabled.
+        @param x The x index of the page requested
+        @param z The z index of the page requested
+        */
+        virtual void requestPage(ushort x, ushort z) = 0;
+        /** This notifies the tile source that the specified page of tiles 
+            has been automatically detached.
+        @remarks
+            When paging is enabled, tiles go out of scope and the TerrainSceneManager
+            detaches them automatically, notifying the TerrainPageSource that 
+            this has happened. The tile source can choose to either keep these
+            tiles in memory (incase they are requested again) or can delete them
+            if it wishes to free memory. This freeing does not need to be done
+            before the return of this method - like requesting tiles, the
+            freeing of them can be done in another thread or across many frames
+            if required, since the shared data in TerrainSceneManager has already
+            been updated synchronously when the page was detached.
+        @param x The x index of the page expired
+        @param z The z index of the page expired
+        */
+        virtual void expirePage(ushort x, ushort z) = 0;
+        
+        /** Register a class which will be called back whenever a new page is
+            available.
+        @remarks
+            Since this method is static, it applies to any page source which 
+            is in active use; there is no need to register one per source.
+        */
+        static void addListener(TerrainPageSourceListener* pl);
+        /** Unregister a class which will be called back whenever a new page is
+        available.
+        */
+        static void removeListener(TerrainPageSourceListener* pl);
+
+    };
+
+}
+
+#endif
Index: /PlugIns/OctreeSceneManager/include/OgreTerrainPrerequisites.h
===================================================================
--- /PlugIns/OctreeSceneManager/include/OgreTerrainPrerequisites.h	(revision 5)
+++ /PlugIns/OctreeSceneManager/include/OgreTerrainPrerequisites.h	(revision 5)
@@ -0,0 +1,67 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __TerrainPrerequisites_H__
+#define __TerrainPrerequisites_H__
+
+#include "OgrePrerequisites.h"
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace Ogre
+{
+    class TerrainSceneManager;
+    class TerrainPageSource;
+    class TerrainRenderable;
+    class TerrainPage;
+}
+//-----------------------------------------------------------------------
+// Windows Settings
+//-----------------------------------------------------------------------
+
+#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32 ) && !defined(OGRE_STATIC_LIB)
+#   ifdef OGRE_TERRAINPLUGIN_EXPORTS
+#       define _OgreOctreePluginExport __declspec(dllexport)
+#   else
+#       if defined( __MINGW32__ )
+#           define _OgreOctreePluginExport
+#       else
+#    		define _OgreOctreePluginExport __declspec(dllimport)
+#       endif
+#   endif
+#elif defined ( OGRE_GCC_VISIBILITY )
+#    define _OgreOctreePluginExport  __attribute__ ((visibility("default")))
+#else
+#   define _OgreOctreePluginExport
+#endif
+
+#endif
+
Index: /PlugIns/OctreeSceneManager/include/OgreTerrainRenderable.h
===================================================================
--- /PlugIns/OctreeSceneManager/include/OgreTerrainRenderable.h	(revision 5)
+++ /PlugIns/OctreeSceneManager/include/OgreTerrainRenderable.h	(revision 5)
@@ -0,0 +1,415 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/***************************************************************************
+terrainrenderable.h  -  description
+-------------------
+begin                : Sat Oct 5 2002
+copyright            : (C) 2002 by Jon Anderson
+email                : janders@users.sf.net
+
+Enhancements 2003 - 2004 (C) The OGRE Team
+
+***************************************************************************/
+
+#ifndef TERRAINRENDERABLE_H
+#define TERRAINRENDERABLE_H
+
+#include "OgreTerrainPrerequisites.h"
+#include <OgreRenderable.h>
+#include <OgreMovableObject.h>
+#include <OgreAxisAlignedBox.h>
+#include <OgreString.h>
+#include <OgreHardwareBufferManager.h>
+
+#include <vector>
+
+#define MORPH_CUSTOM_PARAM_ID 77
+
+namespace Ogre
+{
+
+    typedef std::map <unsigned int, IndexData* > IndexMap;
+    typedef std::vector < IndexData* > IndexArray;
+    typedef std::vector < IndexMap* > LevelArray;
+
+    /**
+    * A cache of TerrainIndexBuffers.  Used to keep track of the buffers, and
+    * delete them when the program finishes.
+    */
+    class TerrainBufferCache
+    {
+    public:
+        void shutdown(void)
+        {
+            for( size_t i=0; i<mCache.size(); i++ )
+            {
+                delete mCache[i];
+            }
+            mCache.clear();
+        }
+        ~TerrainBufferCache()
+        {
+            shutdown();
+        }
+
+        IndexArray mCache;
+    };
+
+    inline Real _max( Real x, Real y )
+    {
+        return ( x > y ) ? x : y;
+    }
+
+    /** A simple class for encapsulating parameters which are commonly needed by 
+    both TerrainSceneManager and TerrainRenderable.
+    */
+    class TerrainOptions
+    {
+    public:
+        TerrainOptions()
+        {
+            pageSize = 0;
+            tileSize = 0;
+            tilesPerPage = 0;
+            maxGeoMipMapLevel = 0;
+            scale = Vector3::UNIT_SCALE;
+            maxPixelError = 4;
+            detailTile = 1;
+            lit = false;
+            coloured = false;
+            lodMorph = false;
+            lodMorphStart = 0.5;
+            useTriStrips = false;
+            primaryCamera = 0;
+            terrainMaterial.setNull();
+        };
+        /// The size of one edge of a terrain page, in vertices
+        size_t pageSize;
+        /// The size of one edge of a terrain tile, in vertices
+        size_t tileSize; 
+        /// Precalculated number of tiles per page
+        size_t tilesPerPage;
+        /// The primary camera, used for error metric calculation and page choice
+        const Camera* primaryCamera;
+        /// The maximum terrain geo-mipmap level
+        size_t maxGeoMipMapLevel;
+        /// The scale factor to apply to the terrain (each vertex is 1 unscaled unit
+        /// away from the next, and height is from 0 to 1)
+        Vector3 scale;
+        /// The maximum pixel error allowed
+        size_t maxPixelError;
+        /// Whether we should use triangle strips
+        bool useTriStrips;
+        /// The number of times to repeat a detail texture over a tile
+        size_t detailTile;
+        /// Whether LOD morphing is enabled
+        bool lodMorph;
+        /// At what point (parametric) should LOD morphing start
+        Real lodMorphStart;
+        /// Whether dynamic lighting is enabled
+        bool lit;
+        /// Whether vertex colours are enabled
+        bool coloured;
+        /// Pointer to the material to use to render the terrain
+        MaterialPtr terrainMaterial;
+
+    };
+
+#define STITCH_NORTH_SHIFT 0
+#define STITCH_SOUTH_SHIFT 8
+#define STITCH_WEST_SHIFT  16
+#define STITCH_EAST_SHIFT  24
+
+#define STITCH_NORTH  128 << STITCH_NORTH_SHIFT
+#define STITCH_SOUTH  128 << STITCH_SOUTH_SHIFT
+#define STITCH_WEST   128 << STITCH_WEST_SHIFT
+#define STITCH_EAST   128 << STITCH_EAST_SHIFT
+
+    /**
+    Represents a terrain tile.
+    @remarks
+    A TerrainRenderable represents a tile used to render a block of terrain using the geomipmap approach
+    for LOD.
+    *@author Jon Anderson
+    */
+
+    class _OgreOctreePluginExport TerrainRenderable : public Renderable, public MovableObject
+    {
+    public:
+
+        TerrainRenderable(const String& name, TerrainSceneManager* tsm);
+        ~TerrainRenderable();
+
+        void deleteGeometry();
+
+        enum Neighbor
+        {
+            NORTH = 0,
+            SOUTH = 1,
+            EAST = 2,
+            WEST = 3,
+            HERE = 4
+        };
+
+        /** Initializes the TerrainRenderable.
+        @param startx, startz 
+        The starting points of the top-left of this tile, in terms of the
+        number of vertices.
+        @param pageHeightData The source height data for the entire parent page
+        */
+        void initialise(int startx, int startz, Real* pageHeightData);
+
+        //movable object methods
+
+        /** Returns the type of the movable. */
+        virtual const String& getMovableType( void ) const
+        {
+            return mType;
+        };
+
+        /** Returns the bounding box of this TerrainRenderable */
+        const AxisAlignedBox& getBoundingBox( void ) const
+        {
+            return mBounds;
+        };
+
+        /** Updates the level of detail to be used for rendering this TerrainRenderable based on the passed in Camera */
+        virtual void _notifyCurrentCamera( Camera* cam );
+
+        virtual void _updateRenderQueue( RenderQueue* queue );
+
+        /**
+        Constructs a RenderOperation to render the TerrainRenderable.
+        @remarks
+        Each TerrainRenderable has a block of vertices that represent the terrain.  Index arrays are dynamically
+        created for mipmap level, and then cached.
+        */
+        virtual void getRenderOperation( RenderOperation& rend );
+
+        virtual const MaterialPtr& getMaterial( void ) const
+        {
+            return mMaterial;
+        };
+
+        virtual void getWorldTransforms( Matrix4* xform ) const;
+
+        virtual const Quaternion& getWorldOrientation(void) const;
+        virtual const Vector3& getWorldPosition(void) const;
+
+        /** Returns the mipmap level that will be rendered for this frame */
+        inline int getRenderLevel() const
+        {
+            return mRenderLevel;
+        };
+
+        /** Forces the LOD to the given level from this point on */
+        inline void setForcedRenderLevel( int i )
+        {
+            mForcedRenderLevel = i;
+        }
+
+        /** Calculates the normal at the given location */
+        void _getNormalAt( float x, float y, Vector3 * result );
+
+        /** Returns the terrain height at the given coordinates */
+        float getHeightAt( float x, float y );
+
+        /** Intersects the segment witht he terrain tile
+        */
+        bool intersectSegment( const Vector3 & start, const Vector3 & end, Vector3 * result );
+
+        /** Sets the appropriate neighbor for this TerrainRenderable.  Neighbors are necessary
+        to know when to bridge between LODs.
+        */
+        void _setNeighbor( Neighbor n, TerrainRenderable *t )
+        {
+            mNeighbors[ n ] = t;
+        };
+
+        /** Returns the neighbor TerrainRenderable
+        */
+        TerrainRenderable * _getNeighbor( Neighbor n )
+        {
+            return mNeighbors[ n ];
+        }
+
+
+        void setMaterial(const MaterialPtr& m )
+        {
+            mMaterial = m;
+        };
+
+        /** Calculates static normals for lighting the terrain */
+        void _calculateNormals();
+
+
+
+
+        /** Generates terrain shadows and lighting using vertex colors
+        */
+        void _generateVertexLighting( const Vector3 &sunlight, ColourValue ambient );
+
+
+        /** Overridden, see Renderable */
+        Real getSquaredViewDepth(const Camera* cam) const;
+
+        /** Overridden from MovableObject */
+        Real getBoundingRadius(void) const { return mBoundingRadius; }
+
+        /** @copydoc Renderable::getLights */
+        const LightList& getLights(void) const;
+
+        /// Overridden from Renderable to allow the morph LOD entry to be set
+        void _updateCustomGpuParameter(
+            const GpuProgramParameters::AutoConstantEntry& constantEntry,
+            GpuProgramParameters* params) const;
+		/// @see MovableObject
+		uint32 getTypeFlags(void) const;
+    protected:
+		/// Parent SceneManager
+		TerrainSceneManager* mSceneManager;
+        /// Link to shared options
+        const TerrainOptions* mOptions;
+
+        /** Returns the index into the height array for the given coords. */
+        inline size_t _index( int x, int z ) const
+        {
+            return ( x + z * mOptions->tileSize );
+        };
+
+        /** Returns the  vertex coord for the given coordinates */
+        inline float _vertex( int x, int z, int n )
+        {
+            return mPositionBuffer[x * 3 + z * mOptions->tileSize * 3 + n];
+        };
+
+
+        inline int _numNeighbors() const
+        {
+            int n = 0;
+
+            for ( int i = 0; i < 4; i++ )
+            {
+                if ( mNeighbors[ i ] != 0 )
+                    n++;
+            }
+
+            return n;
+        }
+
+        inline bool _hasNeighborRenderLevel( int i ) const
+        {
+            for ( int j = 0; j < 4; j++ )
+            {
+                if ( mNeighbors[ j ] != 0 && mNeighbors[ j ] ->mRenderLevel == i )
+                    return true;
+            }
+
+            return false;
+
+        }
+
+        void _adjustRenderLevel( int i );
+
+        bool _checkSize( int n );
+
+        void _calculateMinLevelDist2( Real C );
+
+        Real _calculateCFactor();
+
+        VertexData* mTerrain;
+
+        /// The current LOD level
+        int mRenderLevel;
+        /// The previous 'next' LOD level down, for frame coherency
+        int mLastNextLevel; 
+        /// The morph factor between this and the next LOD level down
+        Real mLODMorphFactor;
+        /// List of squared distances at which LODs change
+        Real *mMinLevelDistSqr;
+        /// Connection to tiles four neighbours
+        TerrainRenderable *mNeighbors [ 4 ];
+        /// Whether light list need to re-calculate
+        mutable bool mLightListDirty;
+        /// Cached light list
+        mutable LightList mLightList;
+        /// The bounding radius of this tile
+        Real mBoundingRadius;
+        /// Bounding box of this tile
+        AxisAlignedBox mBounds;
+        /// The center point of this tile
+        Vector3 mCenter;
+        /// The MovableObject type
+        static String mType;
+        /// Current material used by this tile
+        MaterialPtr mMaterial;    
+        /// Whether this tile has been initialised    
+        bool mInit;
+        /// The buffer with all the renderable geometry in it
+        HardwareVertexBufferSharedPtr mMainBuffer;
+        /// Optional set of delta buffers, used to morph from one LOD to the next
+        HardwareVertexBufferSharedPtr* mDeltaBuffers;
+        /// System-memory buffer with just positions in it, for CPU operations
+        float* mPositionBuffer;
+        /// Forced rendering LOD level, optional
+        int mForcedRenderLevel;
+        /// Array of LOD indexes specifying which LOD is the next one down
+        /// (deals with clustered error metrics which cause LODs to be skipped)
+        int mNextLevelDown[10];
+        /// Gets the index data for this tile based on current settings
+        IndexData* getIndexData(void);
+        /// Internal method for generating stripified terrain indexes
+        IndexData* generateTriStripIndexes(unsigned int stitchFlags);
+        /// Internal method for generating triangle list terrain indexes
+        IndexData* generateTriListIndexes(unsigned int stitchFlags);
+        /** Utility method to generate stitching indexes on the edge of a tile
+        @param neighbor The neighbor direction to stitch
+        @param hiLOD The LOD of this tile
+        @param loLOD The LOD of the neighbor
+        @param omitFirstTri Whether the first tri of the stitch (always clockwise
+        relative to the centre of this tile) is to be omitted because an 
+        adjoining edge is also being stitched
+        @param omitLastTri Whether the last tri of the stitch (always clockwise
+        relative to the centre of this tile) is to be omitted because an 
+        adjoining edge is also being stitched
+        @param pIdx Pointer to a pointer to the index buffer to push the results 
+        into (this pointer will be updated)
+        @returns The number of indexes added
+        */
+        int stitchEdge(Neighbor neighbor, int hiLOD, int loLOD, 
+            bool omitFirstTri, bool omitLastTri, unsigned short** ppIdx);
+
+        /// Create a blank delta buffer for usein morphing
+        HardwareVertexBufferSharedPtr createDeltaBuffer(void);
+
+    };
+
+}
+
+#endif
Index: /PlugIns/OctreeSceneManager/include/OgreTerrainSceneManager.h
===================================================================
--- /PlugIns/OctreeSceneManager/include/OgreTerrainSceneManager.h	(revision 5)
+++ /PlugIns/OctreeSceneManager/include/OgreTerrainSceneManager.h	(revision 5)
@@ -0,0 +1,435 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/***************************************************************************
+terrainscenemanager.h  -  description
+---------------------
+  begin                : Mon Sep 23 2002
+  copyright            : (C) 2002 by Jon Anderson
+  email                : janders@users.sf.net
+
+  Enhancements 2003 - 2004 (C) The OGRE Team
+
+***************************************************************************/
+
+#ifndef TERRAINSCENEMANAGER_H
+#define TERRAINSCENEMANAGER_H
+
+#include "OgreTerrainPrerequisites.h"
+#include "OgreOctreeSceneManager.h"
+#include "OgreOctreeSceneQuery.h"
+#include "OgreTerrainRenderable.h"
+#include "OgreTerrainPageSource.h"
+#include "OgreIteratorWrappers.h"
+
+
+namespace Ogre
+{
+
+class Image;
+
+typedef std::vector < TerrainPage * > TerrainPageRow;
+typedef std::vector < TerrainPageRow > TerrainPage2D;
+
+/** Default implementation of RaySceneQuery. */
+class _OgreOctreePluginExport TerrainRaySceneQuery : public OctreeRaySceneQuery
+{
+protected:
+	WorldFragment mWorldFrag;
+public:
+    TerrainRaySceneQuery(SceneManager* creator);
+    ~TerrainRaySceneQuery();
+
+    /** See RayScenQuery. */
+    void execute(RaySceneQueryListener* listener);
+};
+
+
+
+/** This is a basic SceneManager for organizing TerrainRenderables into a total landscape.
+  * It loads a terrain from a .cfg file that specifices what textures/scale/mipmaps/etc to use.
+  *@author Jon Anderson
+  */
+
+class _OgreOctreePluginExport TerrainSceneManager : public OctreeSceneManager
+{
+public:
+    TerrainSceneManager(const String& name);
+    virtual ~TerrainSceneManager( );
+
+	/// @copydoc SceneManager::getTypeName
+	const String& getTypeName(void) const;
+
+    /** Loads the terrain using parameters int he given config file. */
+    void setWorldGeometry( const String& filename );
+    /** Loads the terrain using parameters in the given config file (contained 
+		in a stream). */
+	virtual void setWorldGeometry(DataStreamPtr& stream, 
+		const String& typeName = StringUtil::BLANK);
+
+    /** Aligns TerrainRenderable neighbors, and renders them. */
+    virtual void _renderVisibleObjects( void );
+
+    /** Returns the height at the given terrain coordinates. */
+    float getHeightAt( float x, float y );
+
+
+    bool intersectSegment( const Vector3 & start, const Vector3 & end, Vector3 * result );
+
+    /** Sets the texture to use for the main world texture. */
+    void setWorldTexture(const String& textureName);
+    /** Sets the texture to use for the detail texture. */
+    void setDetailTexture(const String& textureName);
+    /** Sets the number of times per tile the detail texture should be repeated. */
+    void setDetailTextureRepeat(int repeat);
+    /** Sets the dimensions of each tile (must be power of 2 + 1) */
+    void setTileSize(int size); 
+    /** Sets the dimensions of each page (must be power of 2 + 1) */
+    void setPageSize(int size); 
+    /** Sets the maximum screen space pixel error.  */
+    void setMaxPixelError(int pixelError); 
+    /** Sets how to scale the terrain data. */
+    void setScale(const Vector3& scale);
+    /** Sets the maximum geomipmap level to allow. */
+    void setMaxGeoMipMapLevel(int maxMip);
+    
+    /** Gets the texture to use for the main world texture. */
+    const String& getWorldTexture(void) { return mWorldTextureName; }
+    /** Gets the texture to use for the detail texture. */
+    const String& getDetailTexture(void) { return mDetailTextureName; }
+    /** Gets the number of times per tile the detail texture should be repeated. */
+    int getDetailTextureRepeat(void);
+    /** Gets the dimensions of each tile (must be power of 2 + 1) */
+    int getTileSize(void); 
+    /** Gets the dimensions of each page (must be power of 2 + 1) */
+    int getPageSize(void); 
+    /** Gets the maximum screen space pixel error.  */
+    int getMaxPixelError(void); 
+    /** Gets how to scale the terrain data. */
+    const Vector3& getScale(void);
+    /** Gets the maximum geomipmap level to allow. */
+    int getMaxGeoMipMapLevel(void);
+
+
+
+    /** Sets whether the terrain should use triangle strips or not.
+    @remarks
+        The default is not, in which case it uses triangle lists. 
+    */
+    void setUseTriStrips(bool useStrips);
+    /** Sets whether or not terrain tiles should be morphed between LODs
+    (NB requires vertex program support). */
+    void setUseLODMorph(bool useMorph);
+    /** Sets whether vertex normals will be generated for the terrain. */
+    void setUseVertexNormals(bool useNormals);
+    /** Sets whether vertex colours will be used. */
+    void setUseVertexColours(bool useColours);
+
+    /** Sets the name of a custom material to use to shade the landcape.
+    @remarks
+        This method allows you to provide a custom material which will be
+        used to render the landscape instead of the standard internal 
+        material. This gives you a great deal of flexibility and allows you 
+        to perform special effects if you wish. Note that because you determine
+        every aspect of the material, this setting makes the use of setWorldTexture
+        and setDetailTexture redundant.
+    @par
+        In your custom material, you can use all the usual features of Ogre's
+        materials, including multiple passes if you wish. You can also use 
+        the programmable pipeline to hook vertex and fragment programs into the
+        terrain rendering. The plugin provides the following vertex components:
+        <ul>
+            <li>positions</li>
+            <li>2 sets of texture coordinates (index 0 is world texture, 
+            index 1 is detail texture)</li>
+            <li>Normals, if enabled</li>
+            <li>Per-vertex delta values, for morphing a higher LOD tile into 
+                a lower LOD tile. This is one float per vertex bound as 'blend
+                weight'. If you want to use this you also have to provide the
+                name or index of the parameter you wish to receive the morph factor
+                (@see setCustomMaterialMorphFactorParam)</li>
+        </ul>
+    */
+    void setCustomMaterial(const String& materialName);
+    /** Sets the name of the vertex program parameter to which to pass the
+        LOD morph factor.
+    @remarks
+        When LOD morphing is enabled, and you are using a custom material to 
+        shade the terrain, you need to inform this class of the parameter you
+        wish the current LOD morph factor to be passed to. This is a simple
+        float parameter value that the plugin will set from 0 to 1, depending on
+        the morph stage of a tile. 0 represents no morphing, ie the vertices are
+        all in the original position. 1 represents a complete morph such that
+        the height of the vertices is the same as they are at the next lower LOD
+        level. The vertex program must use this factor, in conjunction with the
+        per-vertex height delta values (bound as 'blend weight'), to displace
+        vertices.
+    @note This version of the method lets you specify a parameter name, compatible
+        with high-level vertex programs. There is an alternative signature method
+        which allows you to set the parameter index for low-level assembler programs.
+    @param paramName The name of the parameter which will receive the morph factor
+    */
+    void setCustomMaterialMorphFactorParam(const String& paramName);
+    /** Sets the index of the vertex program parameter to which to pass the
+        LOD morph factor.
+    @remarks
+        When LOD morphing is enabled, and you are using a custom material to 
+        shade the terrain, you need to inform this class of the parameter you
+        wish the current LOD morph factor to be passed to. This is a simple
+        float parameter value that the plugin will set from 0 to 1, depending on
+        the morph stage of a tile. 0 represents no morphing, ie the vertices are
+        all in the original position. 1 represents a complete morph such that
+        the height of the vertices is the same as they are at the next lower LOD
+        level. The vertex program must use this factor, in conjunction with the
+        per-vertex height delta values (bound as 'blend weight'), to displace
+        vertices.
+    @note This version of the method lets you specify a parameter index, compatible
+        with low-level assembler vertex programs. There is an alternative signature method
+        which allows you to set the parameter name for high-level programs.
+    @param paramName The name of the parameter which will receive the morph factor
+    */
+    void setCustomMaterialMorphFactorParam(size_t paramIndex);
+    /** Sets the distance at which the LOD will start to morph downwards, as
+    a proportion of the distance between the LODs. */
+    void setLODMorphStart(Real morphStart);
+
+    /** Returns the TerrainRenderable that contains the given pt.
+        If no tile exists at the point, it returns 0;
+    */
+    virtual TerrainRenderable * getTerrainTile( const Vector3 & pt );
+
+    /** Returns the TerrainPage that contains the given pt.
+    If no page exists at the point, it returns 0;
+    */
+    virtual TerrainPage* getTerrainPage( const Vector3 & pt );
+
+    /** Creates a RaySceneQuery for this scene manager. 
+    @remarks
+        This method creates a new instance of a query object for this scene manager, 
+        looking for objects which fall along a ray. See SceneQuery and RaySceneQuery 
+        for full details.
+    @par
+        The instance returned from this method must be destroyed by calling
+        SceneManager::destroyQuery when it is no longer required.
+    @param ray Details of the ray which describes the region for this query.
+    @param mask The query mask to apply to this query; can be used to filter out
+        certain objects; see SceneQuery for details.
+    */
+    RaySceneQuery* 
+        createRayQuery(const Ray& ray, unsigned long mask = 0xFFFFFFFF);
+
+    /** Overridden in order to store the first camera created as the primary
+        one, for determining error metrics and the 'home' terrain page.
+    */
+    Camera* createCamera( const String &name );
+    /// Gets the terrain options 
+    const TerrainOptions& getOptions(void) { return mOptions; }
+
+    /** Sets the given option for the SceneManager.
+    @remarks
+        Options are (in addition to those supported by superclasses):
+        "PageSize", int*;
+        "TileSize", int*; 
+        "PrimaryCamera, Camera*;
+        "MaxMipMapLevel", int*;
+        "Scale", Vector3 *;
+        "MaxPixelError", int*;
+        "UseTriStrips", bool*;
+        "VertexProgramMorph", bool*;
+        "DetailTile", int*;
+        "LodMorphStart", Real*;
+        "VertexNormals", bool*;
+        "VertexColours", bool*;
+        "MorphLODFactorParamName", String*;
+        "MorphLODFactorParamIndex", size_t*;
+        "CustomMaterialName", String*;
+        "WorldTexture", String*;
+        "DetailTexture", String*;
+    */
+    virtual bool setOption( const String &, const void * );
+
+    /** Sets the 'primary' camera, i.e. the one which will be used to determine
+        the 'home' terrain page, and to calculate the error metrics. 
+    */
+    virtual void setPrimaryCamera(const Camera* cam);
+    /// Internal map of page source name to page source
+    typedef std::map<String, TerrainPageSource*> PageSourceMap;
+
+    /// Iterator over all page sources
+    typedef ConstMapIterator<PageSourceMap> PageSourceIterator;
+    /// Get an iterator over all page sources
+    PageSourceIterator getPageSourceIterator(void);
+    /** Registers a TerrainPageSource class and associates it with a named type 
+        of source.
+    @remarks
+        This function allows external classes to register themselves as providers
+        of terrain pages of a particular type. Only one page source can be
+        active at once, and the active one is selected by calling 
+        selectPageSource(typeName), which is part of plugin configuration.
+    @note The terrain engine comes with a default page source which loads
+        greyscale heightmap images, registered under the type name "Heightmap".
+    @param typeName A unique String to associate with this type of source
+    @param source Pointer to the class which will implement this source.
+    */
+    virtual void registerPageSource(const String& typeName, TerrainPageSource* source);
+    /** Selects a given page source based on its type name.
+    @remarks
+        This method activates a single page source based on its typename, 
+        e.g. "Heightmap". It also passes to it a number of custom options
+        which the source is able to interpret however it likes.
+    @param typeName The type name of the page source to activate
+    @param optionList A list of string parameters, which are expected to begin
+        with 'typeName.' (e.g. "Heightmap.image"), with their appropriate
+        values.
+    */
+    virtual void selectPageSource(const String& typeName, 
+        TerrainPageSourceOptionList& optionList);
+
+    /** Attaches a previously built page to the list of available pages.
+    @remarks
+        TerrainPageSource subclasses will call this method once they have
+        pages available to be added to the working set. Note that whilst you
+        can build TerrainPage instances in another thread if you like, this
+        method must be called in the same thread as the main rendering loop 
+        in order to avoid concurrency issues. 
+    @param pageX, pageZ The page index at which to attach the page
+    @param page The page to attach
+    */
+    virtual void attachPage(ushort pageX, ushort pageZ, TerrainPage* page);
+    /// Get a pointer to the material being used for the terrain
+    MaterialPtr& getTerrainMaterial(void);
+    // Overridden from basic scene manager
+    void _renderScene(Camera *cam, Viewport *vp, bool includeOverlays);
+
+    /// Get the SceneNode under which all terrain nodes are attached.
+    SceneNode* getTerrainRootNode(void) const { return mTerrainRoot; }
+    /** Overridden from SceneManager */
+    void clearScene(void);
+	/** Overridden from SceneManager */
+	void setWorldGeometryRenderQueue(uint8 qid);
+
+	/// Get the shared list of indexes cached (internal use only)
+	TerrainBufferCache& _getIndexCache(void) {return mIndexCache;}
+
+	/// Get the shared level index list (internal use only)
+	LevelArray& _getLevelIndex(void) { return mLevelIndex; }
+
+	/// Get the current page count (internal use only)
+	size_t _getPageCount(void) { return mTerrainPages.size(); }
+
+	/// Shutdown cleanly before we get destroyed
+	void shutdown(void);
+
+
+protected:
+
+    /// Validates that the size picked for the terrain is acceptable
+    bool _checkSize( int s )
+    {
+        for ( int i = 0; i < 16; i++ )
+        {
+            printf( "Checking...%d\n", ( 1 << i ) + 1 );
+
+            if ( s == ( 1 << i ) + 1 )
+                return true;
+        }
+
+        return false;
+
+    }
+
+    /// The node to which all terrain tiles are attached
+    SceneNode * mTerrainRoot;
+    /// Terrain size, detail etc
+    TerrainOptions mOptions;
+    /// Should we use an externally-defined custom material?
+    bool mUseCustomMaterial;
+    /// The name of the custom material to use
+    String mCustomMaterialName;
+    /// The name of the world texture
+    String mWorldTextureName;
+    /// The name of the detail texture
+    String mDetailTextureName;
+    /// Are we using a named parameter to hook up LOD morph?
+    bool mUseNamedParameterLodMorph;
+    /// The name of the parameter to send the LOD morph to
+    String mLodMorphParamName;
+    /// The index of the parameter to send the LOD morph to
+    size_t mLodMorphParamIndex;
+    /// Whether paging is enabled, or whether a single page will be used
+    bool mPagingEnabled;
+    /// The number of pages to render outside the 'home' page
+    unsigned short mLivePageMargin;
+    /// The number of pages to keep loaded outside the 'home' page
+    unsigned short mBufferedPageMargin;
+    /// Grid of buffered pages
+    TerrainPage2D mTerrainPages;
+	//-- attributes to share across tiles
+	/// Shared list of index buffers
+	TerrainBufferCache mIndexCache;
+	/// Shared array of IndexData (reuse indexes across tiles)
+	LevelArray mLevelIndex;
+    
+    /// Internal method for loading configurations settings
+    void loadConfig(DataStreamPtr& stream);
+
+    /// Sets up the terrain material
+    void setupTerrainMaterial(void);
+    /// Sets up the terrain page slots
+    void setupTerrainPages(void);
+	/// Initialise level indexes
+	void initLevelIndexes(void);
+	/// Destroy level indexes
+	void destroyLevelIndexes(void);
+
+
+    /// Map of source type -> TerrainPageSource
+    PageSourceMap mPageSources;
+    /// The currently active page source
+    TerrainPageSource* mActivePageSource;
+
+};
+/// Factory for TerrainSceneManager
+class TerrainSceneManagerFactory : public SceneManagerFactory
+{
+protected:
+	typedef std::vector<TerrainPageSource*> TerrainPageSources;
+	TerrainPageSources mTerrainPageSources;
+	void initMetaData(void) const;
+public:
+	TerrainSceneManagerFactory();
+	~TerrainSceneManagerFactory();
+	/// Factory type name
+	static const String FACTORY_TYPE_NAME;
+	SceneManager* createInstance(const String& instanceName);
+	void destroyInstance(SceneManager* instance);
+};
+
+}
+
+#endif
Index: /PlugIns/OctreeSceneManager/include/OgreTerrainVertexProgram.h
===================================================================
--- /PlugIns/OctreeSceneManager/include/OgreTerrainVertexProgram.h	(revision 5)
+++ /PlugIns/OctreeSceneManager/include/OgreTerrainVertexProgram.h	(revision 5)
@@ -0,0 +1,226 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __TERRAINVERTEXPROGRAM_H__
+#define __TERRAINVERTEXPROGRAM_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreCommon.h"
+#include "OgreString.h"
+
+namespace Ogre {
+
+    /*
+    Static class containing the source to vertex programs used to 
+    morph the terrain LOD levels. The programs are generated from 
+    the following Cg:
+    @code 	
+    // No fog morphing terrain
+    void terrain_vp(
+	    float4 position : POSITION,
+	    float2 uv1   	: TEXCOORD0,
+	    float2 uv2	 	: TEXCOORD1,
+	    float delta     : BLENDWEIGHT,
+
+	    out float4 oPosition : POSITION,
+	    out float2 oUv1		 : TEXCOORD0,
+	    out float2 oUv2		 : TEXCOORD1,
+	    out float4 colour    : COLOR,
+	    uniform float4x4 worldViewProj,
+	    uniform float morphFactor
+	    )
+    {
+	    // Apply morph
+	    position.y = position.y + (delta.x * morphFactor);
+	    // world / view / projection
+	    oPosition = mul(worldViewProj, position);
+	    // Main texture coords
+	    oUv1 = uv1;
+	    // Detail texture coords
+	    oUv2 = uv2;
+	    // Full bright (no lighting)
+	    colour = float4(1,1,1,1);
+    }
+
+
+    // Linear fogged morphing terrain
+    void terrain_vp_linear(
+	    float4 position : POSITION,
+	    float2 uv1   	: TEXCOORD0,
+	    float2 uv2	 	: TEXCOORD1,
+	    float delta     : BLENDWEIGHT,
+
+	    out float4 oPosition : POSITION,
+	    out float2 oUv1		 : TEXCOORD0,
+	    out float2 oUv2		 : TEXCOORD1,
+	    out float4 colour    : COLOR,
+	    out float fog		 : FOG,
+	    uniform float4x4 worldViewProj,
+	    uniform float morphFactor
+	    )
+    {
+	    // Apply morph
+	    position.y = position.y + (delta.x * morphFactor);
+	    // world / view / projection
+	    oPosition = mul(worldViewProj, position);
+	    // Main texture coords
+	    oUv1 = uv1;
+	    // Detail texture coords
+	    oUv2 = uv2;
+	    // Full bright (no lighting)
+	    colour = float4(1,1,1,1);
+	    // Fog 
+	    // f = end - camz / end - start
+	    // when start / end has been set, fog value is distance
+	    fog = oPosition.z;
+    }
+
+
+    // Exp fogged morphing terrain
+    void terrain_vp_exp(
+	    float4 position : POSITION,
+	    float2 uv1   	: TEXCOORD0,
+	    float2 uv2	 	: TEXCOORD1,
+	    float delta     : BLENDWEIGHT,
+
+	    out float4 oPosition : POSITION,
+	    out float2 oUv1		 : TEXCOORD0,
+	    out float2 oUv2		 : TEXCOORD1,
+	    out float4 colour    : COLOR,
+	    out float fog		 : FOG,
+	    uniform float4x4 worldViewProj,
+	    uniform float morphFactor,
+	    uniform float fogDensity)
+    {
+	    // Apply morph
+	    position.y = position.y + (delta.x * morphFactor);
+	    // world / view / projection
+	    oPosition = mul(worldViewProj, position);
+	    // Main texture coords
+	    oUv1 = uv1;
+	    // Detail texture coords
+	    oUv2 = uv2;
+	    // Full bright (no lighting)
+	    colour = float4(1,1,1,1);
+	    // Fog 
+	    // f = 1 / e ^ (camz x density)
+	    // note pow = exp(src1 * log(src0)).
+	    fog = 1 / (exp((oPosition.z * fogDensity) * log(2.718281828)));
+    }
+
+
+    // Exp2 fogged morphing terrain
+    void terrain_vp_exp2(
+	    float4 position : POSITION,
+	    float2 uv1   	: TEXCOORD0,
+	    float2 uv2	 	: TEXCOORD1,
+	    float delta     : BLENDWEIGHT,
+
+	    out float4 oPosition : POSITION,
+	    out float2 oUv1		 : TEXCOORD0,
+	    out float2 oUv2		 : TEXCOORD1,
+	    out float4 colour    : COLOR,
+	    out float fog		 : FOG,
+	    uniform float4x4 worldViewProj,
+	    uniform float morphFactor,
+	    uniform float fogDensity)
+    {
+	    // Apply morph
+	    position.y = position.y + (delta.x * morphFactor);
+	    // world / view / projection
+	    oPosition = mul(worldViewProj, position);
+	    // Main texture coords
+	    oUv1 = uv1;
+	    // Detail texture coords
+	    oUv2 = uv2;
+	    // Full bright (no lighting)
+	    colour = float4(1,1,1,1);
+	    // Fog 
+	    // f = 1 / e ^ (camz x density)^2
+	    // note pow = exp(src1 * log(src0)).
+	    float src1 = oPosition.z * 0.002;
+	    fog = 1 / (exp((src1*src1) * log(2.718281828f)));
+    }
+
+	// Shadow receiver vertex program
+    void terrain_shadow_receiver_vp(
+	    float4 position : POSITION,
+	    float2 uv1   	: TEXCOORD0,
+	    float2 uv2	 	: TEXCOORD1,
+	    float delta     : BLENDWEIGHT,
+
+	    out float4 oPosition : POSITION,
+	    out float2 oUv1		 : TEXCOORD0,
+	    out float4 colour    : COLOR,
+	    uniform float4x4 worldViewProj,
+		uniform float4x4 world,
+	    uniform float4x4 textureViewProj,
+	    uniform float morphFactor
+	    )
+    {
+	    // Apply morph
+	    position.y = position.y + (delta.x * morphFactor);
+	    // world / view / projection
+	    oPosition = mul(worldViewProj, position);
+		
+	    // Main texture coords
+		float4 worldpos = mul(world, position);
+	    float4 projuv = mul(textureViewProj, worldpos);
+		oUv1.xy = projuv.xy / projuv.w;
+	    // Full bright (no lighting)
+	    colour = float4(1,1,1,1);
+    }
+
+    @endcode
+    */
+    class TerrainVertexProgram
+    {
+    private:
+        static String mNoFogArbvp1;
+        static String mLinearFogArbvp1;
+        static String mExpFogArbvp1;
+        static String mExp2FogArbvp1;
+		static String mShadowReceiverArbvp1;
+
+        static String mNoFogVs_1_1;
+        static String mLinearFogVs_1_1;
+        static String mExpFogVs_1_1;
+        static String mExp2FogVs_1_1;
+		static String mShadowReceiverVs_1_1;
+
+    public:
+        /// General purpose method to get any of the program sources
+        static const String& getProgramSource(FogMode fogMode, 
+			const String syntax, bool shadowReceiver = false);
+
+
+    };
+}
+
+#endif
Index: /PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager.cbp
===================================================================
--- /PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager.cbp	(revision 5)
+++ /PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager.cbp	(revision 5)
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Plugin_OctreeSceneManager" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\lib\Plugin_OctreeSceneManager_d.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\lib\Plugin_OctreeSceneManager.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O2" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add option="-D_USRDLL" />
+			<Add option="-DOGRE_TERRAINPLUGIN_EXPORTS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\OgreHeightmapTerrainPageSource.h" />
+		<Unit filename="..\include\OgreOctree.h" />
+		<Unit filename="..\include\OgreOctreeCamera.h" />
+		<Unit filename="..\include\OgreOctreeNode.h" />
+		<Unit filename="..\include\OgreOctreePlugin.h" />
+		<Unit filename="..\include\OgreOctreeSceneManager.h" />
+		<Unit filename="..\include\OgreOctreeSceneQuery.h" />
+		<Unit filename="..\include\OgreTerrainPage.h" />
+		<Unit filename="..\include\OgreTerrainPageSource.h" />
+		<Unit filename="..\include\OgreTerrainPrerequisites.h" />
+		<Unit filename="..\include\OgreTerrainRenderable.h" />
+		<Unit filename="..\include\OgreTerrainSceneManager.h" />
+		<Unit filename="..\include\OgreTerrainVertexProgram.h" />
+		<Unit filename="..\src\OgreHeightmapTerrainPageSource.cpp" />
+		<Unit filename="..\src\OgreOctree.cpp" />
+		<Unit filename="..\src\OgreOctreeCamera.cpp" />
+		<Unit filename="..\src\OgreOctreeNode.cpp" />
+		<Unit filename="..\src\OgreOctreePlugin.cpp" />
+		<Unit filename="..\src\OgreOctreeSceneManager.cpp" />
+		<Unit filename="..\src\OgreOctreeSceneManagerDll.cpp" />
+		<Unit filename="..\src\OgreOctreeSceneQuery.cpp" />
+		<Unit filename="..\src\OgreTerrainPage.cpp" />
+		<Unit filename="..\src\OgreTerrainPageSource.cpp" />
+		<Unit filename="..\src\OgreTerrainRenderable.cpp" />
+		<Unit filename="..\src\OgreTerrainSceneManager.cpp" />
+		<Unit filename="..\src\OgreTerrainVertexProgram.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager.vcproj
===================================================================
--- /PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager.vcproj	(revision 5)
+++ /PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager.vcproj	(revision 5)
@@ -0,0 +1,334 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Plugin_OctreeSceneManager"
+	ProjectGUID="{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_TERRAINPLUGIN_EXPORTS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="2"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain_d.lib"
+				OutputFile="$(OutDir)/$(ProjectName)_d.dll"
+				Version="0.99"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName)_d.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_TERRAINPLUGIN_EXPORTS"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain.lib"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_TERRAINPLUGIN_EXPORTS;OGRE_STATIC_LIB"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="2"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)/$(ProjectName)Static_d.lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_TERRAINPLUGIN_EXPORTS;OGRE_STATIC_LIB"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)/$(ProjectName)Static.lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\OgreHeightmapTerrainPageSource.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreOctree.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreOctreeCamera.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreOctreeNode.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreOctreePlugin.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreOctreeSceneManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreOctreeSceneManagerDll.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreOctreeSceneQuery.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreTerrainPage.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreTerrainPageSource.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreTerrainRenderable.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreTerrainSceneManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreTerrainVertexProgram.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\OgreHeightmapTerrainPageSource.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreOctree.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreOctreeCamera.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreOctreeNode.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreOctreePlugin.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreOctreeSceneManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreOctreeSceneQuery.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreTerrainPage.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreTerrainPageSource.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreTerrainPrerequisites.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreTerrainRenderable.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreTerrainSceneManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreTerrainVertexProgram.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp
===================================================================
--- /PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp	(revision 5)
+++ /PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_linux.cbp	(revision 5)
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Plugin_OctreeSceneManager" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../../lib/Plugin_OctreeSceneManager_d.so" prefix_auto="0" extension_auto="0" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cp $($(TARGET_NAME)_OUTPUT_FILE) ../../../Samples/Common/bin/$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../../lib/Plugin_OctreeSceneManager.so" prefix_auto="0" extension_auto="0" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O2" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cp $($(TARGET_NAME)_OUTPUT_FILE) ../../../Samples/Common/bin/$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-fvisibility=hidden" />
+			<Add option="-fvisibility-inlines-hidden" />
+			<Add option="-fPIC" />
+			<Add option="-DOGRE_TERRAINPLUGIN_EXPORTS" />
+			<Add option="-DOGRE_GCC_VISIBILITY" />
+			<Add option="-DPLUGIN_TERRAIN_EXPORTS" />
+			<Add option="-DPIC" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../../Samples/Common/bin/$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="../include/OgreHeightmapTerrainPageSource.h" />
+		<Unit filename="../include/OgreOctree.h" />
+		<Unit filename="../include/OgreOctreeCamera.h" />
+		<Unit filename="../include/OgreOctreeNode.h" />
+		<Unit filename="../include/OgreOctreePlugin.h" />
+		<Unit filename="../include/OgreOctreeSceneManager.h" />
+		<Unit filename="../include/OgreOctreeSceneQuery.h" />
+		<Unit filename="../include/OgreTerrainPage.h" />
+		<Unit filename="../include/OgreTerrainPageSource.h" />
+		<Unit filename="../include/OgreTerrainPrerequisites.h" />
+		<Unit filename="../include/OgreTerrainRenderable.h" />
+		<Unit filename="../include/OgreTerrainSceneManager.h" />
+		<Unit filename="../include/OgreTerrainVertexProgram.h" />
+		<Unit filename="../src/OgreHeightmapTerrainPageSource.cpp" />
+		<Unit filename="../src/OgreOctree.cpp" />
+		<Unit filename="../src/OgreOctreeCamera.cpp" />
+		<Unit filename="../src/OgreOctreeNode.cpp" />
+		<Unit filename="../src/OgreOctreePlugin.cpp" />
+		<Unit filename="../src/OgreOctreeSceneManager.cpp" />
+		<Unit filename="../src/OgreOctreeSceneManagerDll.cpp" />
+		<Unit filename="../src/OgreOctreeSceneQuery.cpp" />
+		<Unit filename="../src/OgreTerrainPage.cpp" />
+		<Unit filename="../src/OgreTerrainPageSource.cpp" />
+		<Unit filename="../src/OgreTerrainRenderable.cpp" />
+		<Unit filename="../src/OgreTerrainSceneManager.cpp" />
+		<Unit filename="../src/OgreTerrainVertexProgram.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_stlp.cbp
===================================================================
--- /PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_stlp.cbp	(revision 5)
+++ /PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_stlp.cbp	(revision 5)
@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Plugin_OctreeSceneManager" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\lib\Plugin_OctreeSceneManager_d.dll" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\lib\Plugin_OctreeSceneManager.dll" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O2" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="stlport.5.1" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add option="-D_USRDLL" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\OgreHeightmapTerrainPageSource.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreOctree.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreOctreeCamera.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreOctreeNode.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreOctreePlugin.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreOctreeSceneManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreOctreeSceneQuery.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreTerrainPage.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreTerrainPageSource.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreTerrainPrerequisites.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreTerrainRenderable.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreTerrainSceneManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreTerrainVertexProgram.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreHeightmapTerrainPageSource.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreOctree.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreOctreeCamera.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreOctreeNode.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreOctreePlugin.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreOctreeSceneManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreOctreeSceneManagerDll.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreOctreeSceneQuery.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreTerrainPage.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreTerrainPageSource.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreTerrainRenderable.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreTerrainSceneManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreTerrainVertexProgram.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_vc8.vcproj
===================================================================
--- /PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_vc8.vcproj	(revision 5)
+++ /PlugIns/OctreeSceneManager/scripts/Plugin_OctreeSceneManager_vc8.vcproj	(revision 5)
@@ -0,0 +1,472 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Plugin_OctreeSceneManager"
+	ProjectGUID="{A6830BB5-9993-4F6D-8D4E-930F36A1B88F}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_TERRAINPLUGIN_EXPORTS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain_d.lib"
+				OutputFile="$(OutDir)/Plugin_OctreeSceneManager_d.dll"
+				Version=""
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName)_d.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/Plugin_OctreeSceneManager_d.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				EnableFiberSafeOptimizations="true"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_TERRAINPLUGIN_EXPORTS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain.lib"
+				OutputFile="$(OutDir)/Plugin_OctreeSceneManager.dll"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/Plugin_OctreeSceneManager.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				EnableFiberSafeOptimizations="true"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_STATIC_LIB"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)\$(ProjectName)Static.lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_STATIC_LIB"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)\$(ProjectName)Static_d.lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine=""
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\OgreHeightmapTerrainPageSource.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreOctree.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreOctreeCamera.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreOctreeNode.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreOctreePlugin.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreOctreeSceneManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreOctreeSceneManagerDll.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreOctreeSceneQuery.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreTerrainPage.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreTerrainPageSource.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreTerrainRenderable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreTerrainSceneManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreTerrainVertexProgram.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\OgreHeightmapTerrainPageSource.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreOctree.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreOctreeCamera.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreOctreeNode.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreOctreePlugin.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreOctreeSceneManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreOctreeSceneQuery.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreTerrainPage.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreTerrainPageSource.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreTerrainPrerequisites.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreTerrainRenderable.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreTerrainSceneManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreTerrainVertexProgram.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /PlugIns/OctreeSceneManager/src/Makefile.am
===================================================================
--- /PlugIns/OctreeSceneManager/src/Makefile.am	(revision 5)
+++ /PlugIns/OctreeSceneManager/src/Makefile.am	(revision 5)
@@ -0,0 +1,22 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/PlugIns/OctreeSceneManager/include -I$(top_srcdir)/OgreMain/include -DPLUGIN_TERRAIN_EXPORTS
+
+pkglib_LTLIBRARIES = Plugin_OctreeSceneManager.la
+
+Plugin_OctreeSceneManager_la_SOURCES = \
+							OgreHeightmapTerrainPageSource.cpp \
+							OgreOctreeSceneManagerDll.cpp \
+                            OgreOctreeSceneManager.cpp \
+														OgreOctreeSceneQuery.cpp \
+                            OgreOctreeNode.cpp \
+                            OgreOctreeCamera.cpp \
+							OgreOctree.cpp \
+							OgreOctreePlugin.cpp \
+							OgreTerrainPage.cpp \
+							OgreTerrainPageSource.cpp \
+							OgreTerrainRenderable.cpp \
+							OgreTerrainSceneManager.cpp \
+							OgreTerrainVertexProgram.cpp 
+
+
+Plugin_OctreeSceneManager_la_LDFLAGS = -module $(PLUGIN_FLAGS) -L$(top_builddir)/OgreMain/src -Wl,-z,defs
+Plugin_OctreeSceneManager_la_LIBADD = -lOgreMain $(OGRE_THREAD_LIBS)
Index: /PlugIns/OctreeSceneManager/src/Makefile.in
===================================================================
--- /PlugIns/OctreeSceneManager/src/Makefile.in	(revision 5)
+++ /PlugIns/OctreeSceneManager/src/Makefile.in	(revision 5)
@@ -0,0 +1,563 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = PlugIns/OctreeSceneManager/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+pkglibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+Plugin_OctreeSceneManager_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_Plugin_OctreeSceneManager_la_OBJECTS =  \
+	OgreHeightmapTerrainPageSource.lo OgreOctreeSceneManagerDll.lo \
+	OgreOctreeSceneManager.lo OgreOctreeSceneQuery.lo \
+	OgreOctreeNode.lo OgreOctreeCamera.lo OgreOctree.lo \
+	OgreOctreePlugin.lo OgreTerrainPage.lo \
+	OgreTerrainPageSource.lo OgreTerrainRenderable.lo \
+	OgreTerrainSceneManager.lo OgreTerrainVertexProgram.lo
+Plugin_OctreeSceneManager_la_OBJECTS =  \
+	$(am_Plugin_OctreeSceneManager_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Plugin_OctreeSceneManager_la_SOURCES)
+DIST_SOURCES = $(Plugin_OctreeSceneManager_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/PlugIns/OctreeSceneManager/include -I$(top_srcdir)/OgreMain/include -DPLUGIN_TERRAIN_EXPORTS
+pkglib_LTLIBRARIES = Plugin_OctreeSceneManager.la
+Plugin_OctreeSceneManager_la_SOURCES = \
+							OgreHeightmapTerrainPageSource.cpp \
+							OgreOctreeSceneManagerDll.cpp \
+                            OgreOctreeSceneManager.cpp \
+														OgreOctreeSceneQuery.cpp \
+                            OgreOctreeNode.cpp \
+                            OgreOctreeCamera.cpp \
+							OgreOctree.cpp \
+							OgreOctreePlugin.cpp \
+							OgreTerrainPage.cpp \
+							OgreTerrainPageSource.cpp \
+							OgreTerrainRenderable.cpp \
+							OgreTerrainSceneManager.cpp \
+							OgreTerrainVertexProgram.cpp 
+
+Plugin_OctreeSceneManager_la_LDFLAGS = -module $(PLUGIN_FLAGS) -L$(top_builddir)/OgreMain/src -Wl,-z,defs
+Plugin_OctreeSceneManager_la_LIBADD = -lOgreMain $(OGRE_THREAD_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  PlugIns/OctreeSceneManager/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  PlugIns/OctreeSceneManager/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)"
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    f=$(am__strip_dir) \
+	    echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	    $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  p=$(am__strip_dir) \
+	  echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \
+	  $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+Plugin_OctreeSceneManager.la: $(Plugin_OctreeSceneManager_la_OBJECTS) $(Plugin_OctreeSceneManager_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(Plugin_OctreeSceneManager_la_LDFLAGS) $(Plugin_OctreeSceneManager_la_OBJECTS) $(Plugin_OctreeSceneManager_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreHeightmapTerrainPageSource.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreOctree.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreOctreeCamera.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreOctreeNode.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreOctreePlugin.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreOctreeSceneManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreOctreeSceneManagerDll.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreOctreeSceneQuery.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreTerrainPage.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreTerrainPageSource.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreTerrainRenderable.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreTerrainSceneManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreTerrainVertexProgram.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-pkglibLTLIBRARIES install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-pkglibLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /PlugIns/OctreeSceneManager/src/OgreHeightmapTerrainPageSource.cpp
===================================================================
--- /PlugIns/OctreeSceneManager/src/OgreHeightmapTerrainPageSource.cpp	(revision 5)
+++ /PlugIns/OctreeSceneManager/src/OgreHeightmapTerrainPageSource.cpp	(revision 5)
@@ -0,0 +1,286 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreHeightmapTerrainPageSource.h"
+#include "OgreTerrainPage.h"
+#include "OgreException.h"
+#include "OgreStringConverter.h"
+#include "OgreTerrainSceneManager.h"
+#include "OgreResourceManager.h"
+#include "OgreLogManager.h"
+
+namespace Ogre {
+
+    //-------------------------------------------------------------------------
+    HeightmapTerrainPageSource::HeightmapTerrainPageSource()
+        : mIsRaw(false), mFlipTerrain(false), mPage(0)
+    {
+    }
+    //-------------------------------------------------------------------------
+    HeightmapTerrainPageSource::~HeightmapTerrainPageSource()
+    {
+        shutdown();
+    }
+    //-------------------------------------------------------------------------
+    void HeightmapTerrainPageSource::shutdown(void)
+    {
+        // Image will destroy itself
+        delete mPage;
+        mPage = 0;
+    }
+    //-------------------------------------------------------------------------
+    void HeightmapTerrainPageSource::loadHeightmap(void)
+    {
+        size_t imgSize;
+        // Special-case RAW format
+        if (mIsRaw)
+        {
+            // Image size comes from setting (since RAW is not self-describing)
+            imgSize = mRawSize;
+            
+            // Load data
+            mRawData.setNull();
+            DataStreamPtr stream = 
+                ResourceGroupManager::getSingleton().openResource(
+                    mSource, ResourceGroupManager::getSingleton().getWorldResourceGroupName());
+            mRawData = MemoryDataStreamPtr(new MemoryDataStream(mSource, stream));
+
+            // Validate size
+            size_t numBytes = imgSize * imgSize * mRawBpp;
+            if (mRawData->size() != numBytes)
+            {
+                shutdown();
+                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+                    "RAW size (" + StringConverter::toString(mRawData->size()) + 
+                    ") does not agree with configuration settings.", 
+                    "HeightmapTerrainPageSource::loadHeightmap");
+            }
+        }
+        else
+        {
+            mImage.load(mSource, ResourceGroupManager::getSingleton().getWorldResourceGroupName());
+            // Must be square (dimensions checked later)
+            if ( mImage.getWidth() != mImage.getHeight())
+            {
+                shutdown();
+                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+                    "Heightmap must be square",
+                    "HeightmapTerrainPageSource::loadHeightmap");
+            }
+            imgSize = mImage.getWidth();
+        }
+        //check to make sure it's the expected size
+        if ( imgSize != mPageSize)
+        {
+            shutdown();
+            String err = "Error: Invalid heightmap size : " +
+                StringConverter::toString( imgSize ) +
+                ". Should be " + StringConverter::toString(mPageSize);
+            OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, err, 
+                "HeightmapTerrainPageSource::loadHeightmap" );
+        }
+
+    }
+    //-------------------------------------------------------------------------
+    void HeightmapTerrainPageSource::initialise(TerrainSceneManager* tsm, 
+        ushort tileSize, ushort pageSize, bool asyncLoading, 
+        TerrainPageSourceOptionList& optionList)
+    {
+        // Shutdown to clear any previous data
+        shutdown();
+
+        TerrainPageSource::initialise(tsm, tileSize, pageSize, asyncLoading, optionList);
+
+        // Get source image
+        TerrainPageSourceOptionList::iterator ti, tiend;
+        tiend = optionList.end();
+        bool imageFound = false;
+        mIsRaw = false;
+        bool rawSizeFound = false;
+        bool rawBppFound = false;
+        for (ti = optionList.begin(); ti != tiend; ++ti)
+        {
+            String val = ti->first;
+            StringUtil::trim(val);
+            if (StringUtil::startsWith(val, "Heightmap.image", false))
+            {
+                mSource = ti->second;
+                imageFound = true;
+                // is it a raw?
+                if (StringUtil::endsWith(mSource, "raw"))
+                {
+                    mIsRaw = true;
+                }
+            }
+            else if (StringUtil::startsWith(val, "Heightmap.raw.size", false))
+            {
+                mRawSize = atoi(ti->second.c_str());
+                rawSizeFound = true;
+            }
+            else if (StringUtil::startsWith(val, "Heightmap.raw.bpp", false))
+            {
+                mRawBpp = atoi(ti->second.c_str());
+                if (mRawBpp < 1 || mRawBpp > 2)
+                {
+                    OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+                        "Invalid value for 'Heightmap.raw.bpp', must be 1 or 2",
+                        "HeightmapTerrainPageSource::initialise");
+                }
+                rawBppFound = true;
+            }
+            else if (StringUtil::startsWith(val, "Heightmap.flip", false))
+            {
+                mFlipTerrain = StringConverter::parseBool(ti->second);
+            }
+            else
+            {
+                LogManager::getSingleton().logMessage("Warning: ignoring unknown Heightmap option '"
+                    + val + "'");
+            }
+        }
+        if (!imageFound)
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Missing option 'Heightmap.image'", 
+                "HeightmapTerrainPageSource::initialise");
+        }
+        if (mIsRaw && 
+            (!rawSizeFound || !rawBppFound))
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Options 'Heightmap.raw.size' and 'Heightmap.raw.bpp' must "
+                "be specified for RAW heightmap sources", 
+                "HeightmapTerrainPageSource::initialise");
+        }
+        // Load it!
+        loadHeightmap();
+    }
+    //-------------------------------------------------------------------------
+    void HeightmapTerrainPageSource::requestPage(ushort x, ushort y)
+    {
+        // Only 1 page provided
+        if (x == 0 && y == 0 && !mPage)
+        {
+            // Convert the image data to unscaled floats
+            ulong totalPageSize = mPageSize * mPageSize; 
+            Real *heightData = new Real[totalPageSize];
+            const uchar* pOrigSrc, *pSrc;
+            Real* pDest = heightData;
+            Real invScale;
+            bool is16bit = false;
+            
+            if (mIsRaw)
+            {
+                pOrigSrc = mRawData->getPtr();
+                is16bit = (mRawBpp == 2);
+            }
+            else
+            {
+                PixelFormat pf = mImage.getFormat();
+                if (pf != PF_L8 && pf != PF_L16)
+                {
+                    OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, 
+                        "Error: Image is not a grayscale image.",
+                        "HeightmapTerrainPageSource::requestPage" );
+                }
+
+                pOrigSrc = mImage.getData();
+                is16bit = (pf == PF_L16);
+            }
+            // Determine mapping from fixed to floating
+            ulong rowSize;
+            if ( is16bit )
+            {
+                invScale = 1.0f / 65535.0f; 
+                rowSize =  mPageSize * 2;
+            }
+            else 
+            {
+                invScale = 1.0f / 255.0f; 
+                rowSize =  mPageSize;
+            }
+            // Read the data
+            pSrc = pOrigSrc;
+            for (ulong j = 0; j < mPageSize; ++j)
+            {
+                if (mFlipTerrain)
+                {
+                    // Work backwards 
+                    pSrc = pOrigSrc + (rowSize * (mPageSize - j - 1));
+                }
+                for (ulong i = 0; i < mPageSize; ++i)
+                {
+                    if (is16bit)
+                    {
+                        #if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+                            ushort val = *pSrc++ << 8;
+                            val += *pSrc++;
+                        #else
+                            ushort val = *pSrc++;
+                            val += *pSrc++ << 8;
+                        #endif
+                        *pDest++ = Real(val) * invScale;
+                    }
+                    else
+                    {
+                        *pDest++ = Real(*pSrc++) * invScale;
+                    }
+                }
+            }
+
+            // Call listeners
+            firePageConstructed(0, 0, heightData);
+            // Now turn into TerrainPage
+            // Note that we're using a single material for now
+            if (mSceneManager)
+            {
+                mPage = buildPage(heightData, 
+                    mSceneManager->getOptions().terrainMaterial);
+                mSceneManager->attachPage(0, 0, mPage);
+            }
+
+            // Free temp store
+            delete [] heightData;
+        }
+    }
+    //-------------------------------------------------------------------------
+    void HeightmapTerrainPageSource::expirePage(ushort x, ushort y)
+    {
+        // Single page
+        if (x == 0 && y == 0 && mPage)
+        {
+            delete mPage;
+            mPage = 0;
+        }
+
+    }
+    //-------------------------------------------------------------------------
+
+
+}
Index: /PlugIns/OctreeSceneManager/src/OgreOctree.cpp
===================================================================
--- /PlugIns/OctreeSceneManager/src/OgreOctree.cpp	(revision 5)
+++ /PlugIns/OctreeSceneManager/src/OgreOctree.cpp	(revision 5)
@@ -0,0 +1,165 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/***************************************************************************
+octree.cpp  -  description
+-------------------
+begin                : Mon Sep 30 2002
+copyright            : (C) 2002 by Jon Anderson
+email                : janders@users.sf.net
+
+Enhancements 2003 - 2004 (C) The OGRE Team
+
+***************************************************************************/
+
+#include <OgreOctree.h>
+#include <OgreOctreeNode.h>
+
+namespace Ogre
+{
+
+/** Returns true is the box will fit in a child.
+*/
+bool Octree::_isTwiceSize( const AxisAlignedBox &box ) const
+{
+	// infinite boxes never fit in a child - always root node
+	if (box.isInfinite())
+		return false;
+
+    Vector3 halfMBoxSize = mBox.getHalfSize();
+    Vector3 boxSize = box.getSize();
+    return ((boxSize.x <= halfMBoxSize.x) && (boxSize.y <= halfMBoxSize.y) && (boxSize.z <= halfMBoxSize.z));
+
+}
+
+/** It's assumed the the given box has already been proven to fit into
+* a child.  Since it's a loose octree, only the centers need to be
+* compared to find the appropriate node.
+*/
+void Octree::_getChildIndexes( const AxisAlignedBox &box, int *x, int *y, int *z ) const
+{
+    Vector3 max = mBox.getMaximum();
+    Vector3 min = box.getMinimum();
+
+    Vector3 center = mBox.getMaximum().midPoint( mBox.getMinimum() );
+
+    Vector3 ncenter = box.getMaximum().midPoint( box.getMinimum() );
+
+    if ( ncenter.x > center.x )
+        * x = 1;
+    else
+        *x = 0;
+
+    if ( ncenter.y > center.y )
+        * y = 1;
+    else
+        *y = 0;
+
+    if ( ncenter.z > center.z )
+        * z = 1;
+    else
+        *z = 0;
+
+}
+
+Octree::Octree( Octree * parent ) 
+    : mWireBoundingBox(0),
+      mHalfSize( 0, 0, 0 )
+{
+    //initialize all children to null.
+    for ( int i = 0; i < 2; i++ )
+    {
+        for ( int j = 0; j < 2; j++ )
+        {
+            for ( int k = 0; k < 2; k++ )
+            {
+                mChildren[ i ][ j ][ k ] = 0;
+            }
+        }
+    }
+
+    mParent = parent;
+    mNumNodes = 0;
+}
+
+Octree::~Octree()
+{
+    //initialize all children to null.
+    for ( int i = 0; i < 2; i++ )
+    {
+        for ( int j = 0; j < 2; j++ )
+        {
+            for ( int k = 0; k < 2; k++ )
+            {
+                if ( mChildren[ i ][ j ][ k ] != 0 )
+                    delete mChildren[ i ][ j ][ k ];
+            }
+        }
+    }
+
+    if(mWireBoundingBox)
+        delete mWireBoundingBox;
+
+    mParent = 0;
+}
+
+void Octree::_addNode( OctreeNode * n )
+{
+    mNodes.push_back( n );
+    n -> setOctant( this );
+
+    //update total counts.
+    _ref();
+
+}
+
+void Octree::_removeNode( OctreeNode * n )
+{
+    mNodes.erase( std::find( mNodes.begin(), mNodes.end(), n ) );
+    n -> setOctant( 0 );
+
+    //update total counts.
+    _unref();
+}
+
+void Octree::_getCullBounds( AxisAlignedBox *b ) const
+{
+    b -> setExtents( mBox.getMinimum() - mHalfSize, mBox.getMaximum() + mHalfSize );
+}
+
+WireBoundingBox* Octree::getWireBoundingBox()
+{
+    // Create a WireBoundingBox if needed
+    if(mWireBoundingBox == 0)
+        mWireBoundingBox = new WireBoundingBox();
+
+    mWireBoundingBox->setupBoundingBox(mBox);
+    return mWireBoundingBox;
+}
+
+}
Index: /PlugIns/OctreeSceneManager/src/OgreOctreeCamera.cpp
===================================================================
--- /PlugIns/OctreeSceneManager/src/OgreOctreeCamera.cpp	(revision 5)
+++ /PlugIns/OctreeSceneManager/src/OgreOctreeCamera.cpp	(revision 5)
@@ -0,0 +1,96 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/***************************************************************************
+octreecamera.cpp  -  description
+-------------------
+begin                : Fri Sep 27 2002
+copyright            : (C) 2002 by Jon Anderson
+email                : janders@users.sf.net
+
+Enhancements 2003 - 2004 (C) The OGRE Team
+
+***************************************************************************/
+#include <OgreMath.h>
+#include <OgreAxisAlignedBox.h>
+#include <OgreRoot.h>
+
+#include <OgreOctreeCamera.h>
+
+namespace Ogre
+{
+OctreeCamera::OctreeCamera( const String& name, SceneManager* sm ) : Camera( name, sm )
+{
+                                                                      
+}
+
+OctreeCamera::~OctreeCamera()
+{
+}
+
+OctreeCamera::Visibility OctreeCamera::getVisibility( const AxisAlignedBox &bound )
+{
+
+    // Null boxes always invisible
+    if ( bound.isNull() )
+        return NONE;
+
+    // Get centre of the box
+    Vector3 centre = bound.getCenter();
+    // Get the half-size of the box
+    Vector3 halfSize = bound.getHalfSize();
+
+    bool all_inside = true;
+
+    for ( int plane = 0; plane < 6; ++plane )
+    {
+
+        // Skip far plane if infinite view frustum
+        if (plane == FRUSTUM_PLANE_FAR && mFarDist == 0)
+            continue;
+
+		// This updates frustum planes and deals with cull frustum
+        Plane::Side side = getFrustumPlane(plane).getSide(centre, halfSize);
+        if(side == Plane::NEGATIVE_SIDE) return NONE;
+        // We can't return now as the box could be later on the negative side of a plane.
+        if(side == Plane::BOTH_SIDE) 
+                all_inside = false;
+    }
+
+    if ( all_inside )
+        return FULL;
+    else
+        return PARTIAL;
+
+}
+
+}
+
+
+
+
Index: /PlugIns/OctreeSceneManager/src/OgreOctreeNode.cpp
===================================================================
--- /PlugIns/OctreeSceneManager/src/OgreOctreeNode.cpp	(revision 5)
+++ /PlugIns/OctreeSceneManager/src/OgreOctreeNode.cpp	(revision 5)
@@ -0,0 +1,236 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/***************************************************************************
+octreenode.cpp  -  description
+-------------------
+begin                : Fri Sep 27 2002
+copyright            : (C) 2002 by Jon Anderson
+email                : janders@users.sf.net
+
+Enhancements 2003 - 2004 (C) The OGRE Team
+
+***************************************************************************/
+
+#include <OgreRoot.h>
+
+#include <OgreOctreeNode.h>
+#include <OgreOctreeSceneManager.h>
+
+namespace Ogre
+{
+unsigned long green = 0xFFFFFFFF;
+
+unsigned short OctreeNode::mIndexes[ 24 ] = {0, 1, 1, 2, 2, 3, 3, 0,       //back
+        0, 6, 6, 5, 5, 1,             //left
+        3, 7, 7, 4, 4, 2,             //right
+        6, 7, 5, 4 };          //front
+unsigned long OctreeNode::mColors[ 8 ] = {green, green, green, green, green, green, green, green };
+
+OctreeNode::OctreeNode( SceneManager* creator ) : SceneNode( creator )
+{
+    mOctant = 0;
+}
+
+OctreeNode::OctreeNode( SceneManager* creator, const String& name ) : SceneNode( creator, name )
+{
+    mOctant = 0;
+}
+
+OctreeNode::~OctreeNode()
+{}
+void OctreeNode::_removeNodeAndChildren( )
+{
+    static_cast< OctreeSceneManager * > ( mCreator ) -> _removeOctreeNode( this ); 
+    //remove all the children nodes as well from the octree.
+    ChildNodeMap::iterator it = mChildren.begin();
+    while( it != mChildren.end() )
+    {
+        static_cast<OctreeNode *>( it->second ) -> _removeNodeAndChildren();
+        ++it;
+    }
+}
+Node * OctreeNode::removeChild( unsigned short index )
+{
+    OctreeNode *on = static_cast<OctreeNode* >( SceneNode::removeChild( index ) );
+    on -> _removeNodeAndChildren(); 
+    return on; 
+}
+Node * OctreeNode::removeChild( Node* child )
+{
+    OctreeNode *on = static_cast<OctreeNode* >( SceneNode::removeChild( child ) );
+    on -> _removeNodeAndChildren(); 
+    return on; 
+}
+void OctreeNode::removeAllChildren()
+{
+	ChildNodeMap::iterator i, iend;
+	iend = mChildren.end();
+	for (i = mChildren.begin(); i != iend; ++i)
+	{
+		OctreeNode* on = static_cast<OctreeNode*>(i->second);
+		on->setParent(0);
+		on->_removeNodeAndChildren();
+	}
+	mChildren.clear();
+	mChildrenToUpdate.clear();
+	
+}
+    
+Node * OctreeNode::removeChild( const String & name )
+{
+    OctreeNode *on = static_cast< OctreeNode * >( SceneNode::removeChild(  name ) );
+    on -> _removeNodeAndChildren( ); 
+    return on; 
+}
+
+//same as SceneNode, only it doesn't care about children...
+void OctreeNode::_updateBounds( void )
+{
+    mWorldAABB.setNull();
+    mLocalAABB.setNull();
+
+    // Update bounds from own attached objects
+    ObjectMap::iterator i = mObjectsByName.begin();
+    AxisAlignedBox bx;
+
+    while ( i != mObjectsByName.end() )
+    {
+
+        // Get local bounds of object
+        bx = i->second ->getBoundingBox();
+
+        mLocalAABB.merge( bx );
+
+        mWorldAABB.merge( i->second ->getWorldBoundingBox(true) );
+        ++i;
+    }
+
+
+    //update the OctreeSceneManager that things might have moved.
+    // if it hasn't been added to the octree, add it, and if has moved
+    // enough to leave it's current node, we'll update it.
+    if ( ! mWorldAABB.isNull() )
+    {
+        static_cast < OctreeSceneManager * > ( mCreator ) -> _updateOctreeNode( this );
+    }
+
+}
+
+/** Since we are loose, only check the center.
+*/
+bool OctreeNode::_isIn( AxisAlignedBox &box )
+{
+	// Always fail if not in the scene graph or box is null
+	if (!mIsInSceneGraph || box.isNull()) return false;
+
+	// Always succeed if AABB is infinite
+	if (box.isInfinite())
+		return true;
+
+    Vector3 center = mWorldAABB.getMaximum().midPoint( mWorldAABB.getMinimum() );
+
+    Vector3 bmin = box.getMinimum();
+    Vector3 bmax = box.getMaximum();
+
+    bool centre = ( bmax > center && bmin < center );
+	if (!centre)
+		return false;
+
+	// Even if covering the centre line, need to make sure this BB is not large
+	// enough to require being moved up into parent. When added, bboxes would
+	// end up in parent due to cascade but when updating need to deal with
+	// bbox growing too large for this child
+	Vector3 octreeSize = bmax - bmin;
+	Vector3 nodeSize = mWorldAABB.getMaximum() - mWorldAABB.getMinimum();
+	return nodeSize < octreeSize;
+
+}
+
+/** Addes the attached objects of this OctreeScene node into the queue. */
+void OctreeNode::_addToRenderQueue( Camera* cam, RenderQueue *queue, 
+	bool onlyShadowCasters, VisibleObjectsBoundsInfo* visibleBounds )
+{
+    ObjectMap::iterator mit = mObjectsByName.begin();
+
+    while ( mit != mObjectsByName.end() )
+    {
+        MovableObject * mo = mit->second;
+
+        mo->_notifyCurrentCamera(cam);
+        if ( mo->isVisible() &&
+            (!onlyShadowCasters || mo->getCastShadows()))
+        {
+            mo -> _updateRenderQueue( queue );
+
+			if (visibleBounds)
+			{
+				visibleBounds->merge(mo->getWorldBoundingBox(true), 
+					mo->getWorldBoundingSphere(true), cam);
+			}
+        }
+
+        ++mit;
+    }
+
+}
+
+
+void OctreeNode::getRenderOperation( RenderOperation& rend )
+{
+
+    /* TODO
+    rend.useIndexes = true;
+    rend.numTextureCoordSets = 0; // no textures
+    rend.vertexOptions = LegacyRenderOperation::VO_DIFFUSE_COLOURS;
+    rend.operationType = LegacyRenderOperation::OT_LINE_LIST;
+    rend.numVertices = 8;
+    rend.numIndexes = 24;
+
+    rend.pVertices = mCorners;
+    rend.pIndexes = mIndexes;
+    rend.pDiffuseColour = mColors;
+
+    const Vector3 * corners = _getLocalAABB().getAllCorners();
+
+    int index = 0;
+
+    for ( int i = 0; i < 8; i++ )
+    {
+        rend.pVertices[ index ] = corners[ i ].x;
+        index++;
+        rend.pVertices[ index ] = corners[ i ].y;
+        index++;
+        rend.pVertices[ index ] = corners[ i ].z;
+        index++;
+    }
+    */
+
+
+}
+}
Index: /PlugIns/OctreeSceneManager/src/OgreOctreePlugin.cpp
===================================================================
--- /PlugIns/OctreeSceneManager/src/OgreOctreePlugin.cpp	(revision 5)
+++ /PlugIns/OctreeSceneManager/src/OgreOctreePlugin.cpp	(revision 5)
@@ -0,0 +1,85 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreOctreePlugin.h"
+#include "OgreRoot.h"
+
+namespace Ogre 
+{
+	const String sPluginName = "Octree & Terrain Scene Manager";
+	//---------------------------------------------------------------------
+	OctreePlugin::OctreePlugin()
+		:mOctreeSMFactory(0), mTerrainSMFactory(0), mTerrainPSListenerManager(0)
+	{
+
+	}
+	//---------------------------------------------------------------------
+	const String& OctreePlugin::getName() const
+	{
+		return sPluginName;
+	}
+	//---------------------------------------------------------------------
+	void OctreePlugin::install()
+	{
+		// Create objects
+		mOctreeSMFactory = new OctreeSceneManagerFactory();
+		mTerrainSMFactory = new TerrainSceneManagerFactory();
+		mTerrainPSListenerManager = new TerrainPageSourceListenerManager();
+
+	}
+	//---------------------------------------------------------------------
+	void OctreePlugin::initialise()
+	{
+		// Register
+		Root::getSingleton().addSceneManagerFactory(mOctreeSMFactory);
+		Root::getSingleton().addSceneManagerFactory(mTerrainSMFactory);
+	}
+	//---------------------------------------------------------------------
+	void OctreePlugin::shutdown()
+	{
+		// Unregister
+		Root::getSingleton().removeSceneManagerFactory(mTerrainSMFactory);
+		Root::getSingleton().removeSceneManagerFactory(mOctreeSMFactory);
+	}
+	//---------------------------------------------------------------------
+	void OctreePlugin::uninstall()
+	{
+		// destroy 
+		delete mTerrainPSListenerManager;
+		mTerrainPSListenerManager = 0;
+		delete mTerrainSMFactory;
+		mTerrainSMFactory = 0;
+		delete mOctreeSMFactory;
+		mOctreeSMFactory = 0;
+
+
+	}
+
+
+}
Index: /PlugIns/OctreeSceneManager/src/OgreOctreeSceneManager.cpp
===================================================================
--- /PlugIns/OctreeSceneManager/src/OgreOctreeSceneManager.cpp	(revision 5)
+++ /PlugIns/OctreeSceneManager/src/OgreOctreeSceneManager.cpp	(revision 5)
@@ -0,0 +1,1191 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/***************************************************************************
+octreescenemanager.cpp  -  description
+-------------------
+begin                : Fri Sep 27 2002
+copyright            : (C) 2002 by Jon Anderson
+email                : janders@users.sf.net
+ 
+Enhancements 2003 - 2004 (C) The OGRE Team
+ 
+***************************************************************************/
+
+#include <OgreOctreeSceneManager.h>
+#include <OgreOctreeSceneQuery.h>
+#include <OgreOctreeNode.h>
+#include <OgreOctreeCamera.h>
+#include <OgreRenderSystem.h>
+
+
+extern "C"
+{
+    void findNodesInBox( Ogre::SceneManager *sm,
+                         const Ogre::AxisAlignedBox &box,
+                         std::list < Ogre::SceneNode * > &list,
+                         Ogre::SceneNode *exclude )
+    {
+        static_cast<Ogre::OctreeSceneManager*>( sm ) -> findNodesIn( box, list, exclude );
+    }
+    void findNodesInSphere( Ogre::SceneManager *sm,
+                            const Ogre::Sphere &sphere,
+                            std::list < Ogre::SceneNode * > &list,
+                            Ogre::SceneNode *exclude )
+    {
+        static_cast<Ogre::OctreeSceneManager*>( sm ) -> findNodesIn( sphere, list, exclude );
+    }
+}
+
+namespace Ogre
+{
+enum Intersection
+{
+    OUTSIDE=0,
+    INSIDE=1,
+    INTERSECT=2
+};
+int OctreeSceneManager::intersect_call = 0;
+
+Intersection intersect( const Ray &one, const AxisAlignedBox &two )
+{
+    OctreeSceneManager::intersect_call++;
+    // Null box?
+    if (two.isNull()) return OUTSIDE;
+	// Infinite box?
+	if (two.isInfinite()) return INTERSECT;
+
+    bool inside = true;
+    const Vector3& twoMin = two.getMinimum();
+    const Vector3& twoMax = two.getMaximum();
+    Vector3 origin = one.getOrigin();
+    Vector3 dir = one.getDirection();
+
+    Vector3 maxT(-1, -1, -1);
+
+    int i = 0;
+    for(i=0; i<3; i++ )
+    {
+        if( origin[i] < twoMin[i] )
+        {
+            inside = false;
+            if( dir[i] > 0 )
+            {
+                maxT[i] = (twoMin[i] - origin[i])/ dir[i];
+            }
+        }
+        else if( origin[i] > twoMax[i] )
+        {
+            inside = false;
+            if( dir[i] < 0 )
+            {
+                maxT[i] = (twoMax[i] - origin[i]) / dir[i];
+            }
+        }
+    }
+
+    if( inside )
+    {
+        return INTERSECT;
+    }
+    int whichPlane = 0;
+    if( maxT[1] > maxT[whichPlane])
+        whichPlane = 1;
+    if( maxT[2] > maxT[whichPlane])
+        whichPlane = 2;
+
+    if( ((int)maxT[whichPlane]) & 0x80000000 )
+    {
+        return OUTSIDE;
+    }
+    for(i=0; i<3; i++ )
+    {
+        if( i!= whichPlane )
+        {
+            float f = origin[i] + maxT[whichPlane] * dir[i];
+            if ( f < (twoMin[i] - 0.00001f) ||
+                    f > (twoMax[i] +0.00001f ) )
+            {
+                return OUTSIDE;
+            }
+        }
+    }
+
+    return INTERSECT;
+
+}
+
+
+/** Checks how the second box intersects with the first.
+*/
+Intersection intersect( const PlaneBoundedVolume &one, const AxisAlignedBox &two )
+{
+    OctreeSceneManager::intersect_call++;
+    // Null box?
+    if (two.isNull()) return OUTSIDE;
+	// Infinite box?
+	if (two.isInfinite()) return INTERSECT;
+
+    // Get centre of the box
+    Vector3 centre = two.getCenter();
+    // Get the half-size of the box
+    Vector3 halfSize = two.getHalfSize();
+
+    // For each plane, see if all points are on the negative side
+    // If so, object is not visible.
+    // If one or more are, it's partial.
+    // If all aren't, full
+    bool all_inside = true;
+    PlaneList::const_iterator i, iend;
+    iend = one.planes.end();
+    for (i = one.planes.begin(); i != iend; ++i)
+    {
+        const Plane& plane = *i;
+
+        Plane::Side side = plane.getSide(centre, halfSize);
+        if(side == one.outside)
+                return OUTSIDE;
+        if(side == Plane::BOTH_SIDE)
+                all_inside = false; 
+    }
+
+    if ( all_inside )
+        return INSIDE;
+    else
+        return INTERSECT;
+
+}
+
+
+/** Checks how the second box intersects with the first.
+*/
+Intersection intersect( const AxisAlignedBox &one, const AxisAlignedBox &two )
+{
+    OctreeSceneManager::intersect_call++;
+    // Null box?
+    if (one.isNull() || two.isNull()) return OUTSIDE;
+	if (one.isInfinite()) return INSIDE;
+	if (two.isInfinite()) return INTERSECT;
+
+
+    const Vector3& insideMin = two.getMinimum();
+    const Vector3& insideMax = two.getMaximum();
+
+    const Vector3& outsideMin = one.getMinimum();
+    const Vector3& outsideMax = one.getMaximum();
+
+    if (    insideMax.x < outsideMin.x ||
+            insideMax.y < outsideMin.y ||
+            insideMax.z < outsideMin.z ||
+            insideMin.x > outsideMax.x ||
+            insideMin.y > outsideMax.y ||
+            insideMin.z > outsideMax.z )
+    {
+        return OUTSIDE;
+    }
+
+    bool full = ( insideMin.x > outsideMin.x &&
+                  insideMin.y > outsideMin.y &&
+                  insideMin.z > outsideMin.z &&
+                  insideMax.x < outsideMax.x &&
+                  insideMax.y < outsideMax.y &&
+                  insideMax.z < outsideMax.z );
+
+    if ( full )
+        return INSIDE;
+    else
+        return INTERSECT;
+
+}
+
+/** Checks how the box intersects with the sphere.
+*/
+Intersection intersect( const Sphere &one, const AxisAlignedBox &two )
+{
+    OctreeSceneManager::intersect_call++;
+    // Null box?
+    if (two.isNull()) return OUTSIDE;
+	if (two.isInfinite()) return INTERSECT;
+
+    float sradius = one.getRadius();
+
+    sradius *= sradius;
+
+    Vector3 scenter = one.getCenter();
+
+    const Vector3& twoMin = two.getMinimum();
+    const Vector3& twoMax = two.getMaximum();
+
+    float s, d = 0;
+
+    Vector3 mndistance = ( twoMin - scenter );
+    Vector3 mxdistance = ( twoMax - scenter );
+
+    if ( mndistance.squaredLength() < sradius &&
+            mxdistance.squaredLength() < sradius )
+    {
+        return INSIDE;
+    }
+
+    //find the square of the distance
+    //from the sphere to the box
+    for ( int i = 0 ; i < 3 ; i++ )
+    {
+        if ( scenter[ i ] < twoMin[ i ] )
+        {
+            s = scenter[ i ] - twoMin[ i ];
+            d += s * s;
+        }
+
+        else if ( scenter[ i ] > twoMax[ i ] )
+        {
+            s = scenter[ i ] - twoMax[ i ];
+            d += s * s;
+        }
+
+    }
+
+    bool partial = ( d <= sradius );
+
+    if ( !partial )
+    {
+        return OUTSIDE;
+    }
+
+    else
+    {
+        return INTERSECT;
+    }
+
+
+}
+
+unsigned long white = 0xFFFFFFFF;
+
+unsigned short OctreeSceneManager::mIndexes[ 24 ] = {0, 1, 1, 2, 2, 3, 3, 0,       //back
+        0, 6, 6, 5, 5, 1,             //left
+        3, 7, 7, 4, 4, 2,             //right
+        6, 7, 5, 4 };          //front
+unsigned long OctreeSceneManager::mColors[ 8 ] = {white, white, white, white, white, white, white, white };
+
+
+OctreeSceneManager::OctreeSceneManager(const String& name) : SceneManager(name)
+{
+    AxisAlignedBox b( -10000, -10000, -10000, 10000, 10000, 10000 );
+    int depth = 8; 
+    mOctree = 0;
+    init( b, depth );
+}
+
+OctreeSceneManager::OctreeSceneManager(const String& name, AxisAlignedBox &box, int max_depth ) 
+: SceneManager(name)
+{
+    mOctree = 0;
+    init( box, max_depth );
+}
+
+const String& OctreeSceneManager::getTypeName(void) const
+{
+	return OctreeSceneManagerFactory::FACTORY_TYPE_NAME;
+}
+
+void OctreeSceneManager::init( AxisAlignedBox &box, int depth )
+{
+    delete mSceneRoot; //get rid of old root.
+
+    // -- Changes by Steve
+    // Don't do it this way, it will add it to the mSceneNodes which we don't want
+    //mSceneRoot = createSceneNode( "SceneRoot" );
+    mSceneRoot = new OctreeNode( this, "SceneRoot" );
+	mSceneRoot->_notifyRootNode();
+    // -- End changes by Steve
+
+    if ( mOctree != 0 )
+        delete mOctree;
+
+    mOctree = new Octree( 0 );
+
+    mMaxDepth = depth;
+    mBox = box;
+
+    mOctree -> mBox = box;
+
+    Vector3 min = box.getMinimum();
+
+    Vector3 max = box.getMaximum();
+
+    mOctree -> mHalfSize = ( max - min ) / 2;
+
+
+    mShowBoxes = false;
+
+    mNumObjects = 0;
+
+    Vector3 v( 1.5, 1.5, 1.5 );
+
+    mScaleFactor.setScale( v );
+
+
+
+    // setDisplaySceneNodes( true );
+    // setShowBoxes( true );
+
+    //
+    //mSceneRoot isn't put into the octree since it has no volume.
+
+}
+
+OctreeSceneManager::~OctreeSceneManager()
+{
+    // -- Changed by Steve
+    // Don't do this here, SceneManager will do it
+    /*
+    if( mSceneRoot )
+    delete mSceneRoot;
+    */ 
+    // --End Changes by Steve
+
+    if ( mOctree )
+	{
+        delete mOctree;
+		mOctree = 0;
+	}
+}
+
+Camera * OctreeSceneManager::createCamera( const String &name )
+{
+    Camera * c = new OctreeCamera( name, this );
+    mCameras.insert( CameraList::value_type( name, c ) );
+
+	// create visible bounds aab map entry
+	mCamVisibleObjectsMap[c] = VisibleObjectsBoundsInfo();
+	
+    return c;
+}
+
+void OctreeSceneManager::destroySceneNode( const String &name )
+{
+    OctreeNode * on = static_cast < OctreeNode* > ( getSceneNode( name ) );
+
+    if ( on != 0 )
+        _removeOctreeNode( on );
+
+    SceneManager::destroySceneNode( name );
+}
+
+bool OctreeSceneManager::getOptionValues( const String & key, StringVector  &refValueList )
+{
+    return SceneManager::getOptionValues( key, refValueList );
+}
+
+bool OctreeSceneManager::getOptionKeys( StringVector & refKeys )
+{
+    SceneManager::getOptionKeys( refKeys );
+    refKeys.push_back( "Size" );
+    refKeys.push_back( "ShowOctree" );
+    refKeys.push_back( "Depth" );
+
+    return true;
+}
+
+
+void OctreeSceneManager::_updateOctreeNode( OctreeNode * onode )
+{
+    const AxisAlignedBox& box = onode -> _getWorldAABB();
+
+    if ( box.isNull() )
+        return ;
+
+	// Skip if octree has been destroyed (shutdown conditions)
+	if (!mOctree)
+		return;
+
+    if ( onode -> getOctant() == 0 )
+    {
+        //if outside the octree, force into the root node.
+        if ( ! onode -> _isIn( mOctree -> mBox ) )
+            mOctree->_addNode( onode );
+        else
+            _addOctreeNode( onode, mOctree );
+        return ;
+    }
+
+    if ( ! onode -> _isIn( onode -> getOctant() -> mBox ) )
+    {
+        _removeOctreeNode( onode );
+
+        //if outside the octree, force into the root node.
+        if ( ! onode -> _isIn( mOctree -> mBox ) )
+            mOctree->_addNode( onode );
+        else
+            _addOctreeNode( onode, mOctree );
+    }
+}
+
+/** Only removes the node from the octree.  It leaves the octree, even if it's empty.
+*/
+void OctreeSceneManager::_removeOctreeNode( OctreeNode * n )
+{
+	// Skip if octree has been destroyed (shutdown conditions)
+	if (!mOctree)
+		return;
+
+    Octree * oct = n -> getOctant();
+
+    if ( oct )
+    {
+        oct -> _removeNode( n );
+    }
+
+    n->setOctant(0);
+}
+
+
+void OctreeSceneManager::_addOctreeNode( OctreeNode * n, Octree *octant, int depth )
+{
+
+	// Skip if octree has been destroyed (shutdown conditions)
+	if (!mOctree)
+		return;
+
+	const AxisAlignedBox& bx = n -> _getWorldAABB();
+
+
+    //if the octree is twice as big as the scene node,
+    //we will add it to a child.
+    if ( ( depth < mMaxDepth ) && octant -> _isTwiceSize( bx ) )
+    {
+        int x, y, z;
+        octant -> _getChildIndexes( bx, &x, &y, &z );
+
+        if ( octant -> mChildren[ x ][ y ][ z ] == 0 )
+        {
+            octant -> mChildren[ x ][ y ][ z ] = new Octree( octant );
+            const Vector3& octantMin = octant -> mBox.getMinimum();
+            const Vector3& octantMax = octant -> mBox.getMaximum();
+            Vector3 min, max;
+
+            if ( x == 0 )
+            {
+                min.x = octantMin.x;
+                max.x = ( octantMin.x + octantMax.x ) / 2;
+            }
+
+            else
+            {
+                min.x = ( octantMin.x + octantMax.x ) / 2;
+                max.x = octantMax.x;
+            }
+
+            if ( y == 0 )
+            {
+                min.y = octantMin.y;
+                max.y = ( octantMin.y + octantMax.y ) / 2;
+            }
+
+            else
+            {
+                min.y = ( octantMin.y + octantMax.y ) / 2;
+                max.y = octantMax.y;
+            }
+
+            if ( z == 0 )
+            {
+                min.z = octantMin.z;
+                max.z = ( octantMin.z + octantMax.z ) / 2;
+            }
+
+            else
+            {
+                min.z = ( octantMin.z + octantMax.z ) / 2;
+                max.z = octantMax.z;
+            }
+
+            octant -> mChildren[ x ][ y ][ z ] -> mBox.setExtents( min, max );
+            octant -> mChildren[ x ][ y ][ z ] -> mHalfSize = ( max - min ) / 2;
+        }
+
+        _addOctreeNode( n, octant -> mChildren[ x ][ y ][ z ], ++depth );
+
+    }
+
+    else
+    {
+        octant -> _addNode( n );
+    }
+}
+
+
+SceneNode * OctreeSceneManager::createSceneNode( void )
+{
+    OctreeNode * on = new OctreeNode( this );
+    mSceneNodes[ on->getName() ] = on;
+    return on;
+}
+
+SceneNode * OctreeSceneManager::createSceneNode( const String &name )
+{
+    // Check name not used
+    if (mSceneNodes.find(name) != mSceneNodes.end())
+    {
+        OGRE_EXCEPT(
+            Exception::ERR_DUPLICATE_ITEM,
+            "A scene node with the name " + name + " already exists",
+            "OctreeSceneManager::createSceneNode" );
+    }
+    OctreeNode * on = new OctreeNode( this, name );
+    mSceneNodes[ on->getName() ] = on;
+    return on;
+}
+
+void OctreeSceneManager::_updateSceneGraph( Camera * cam )
+{
+    SceneManager::_updateSceneGraph( cam );
+}
+
+void OctreeSceneManager::_alertVisibleObjects( void )
+{
+    OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED,
+        "Function doesn't do as advertised",
+        "OctreeSceneManager::_alertVisibleObjects" );
+
+    NodeList::iterator it = mVisible.begin();
+
+    while ( it != mVisible.end() )
+    {
+        OctreeNode * node = *it;
+
+        ++it;
+    }
+}
+
+void OctreeSceneManager::_findVisibleObjects(Camera * cam, 
+	VisibleObjectsBoundsInfo* visibleBounds, bool onlyShadowCasters )
+{
+
+    getRenderQueue()->clear();
+    mBoxes.clear();
+    mVisible.clear();
+
+    mNumObjects = 0;
+
+    //walk the octree, adding all visible Octreenodes nodes to the render queue.
+    walkOctree( static_cast < OctreeCamera * > ( cam ), getRenderQueue(), mOctree, 
+				visibleBounds, false, onlyShadowCasters );
+
+    // Show the octree boxes & cull camera if required
+    if ( mShowBoxes )
+    {
+        for ( BoxList::iterator it = mBoxes.begin(); it != mBoxes.end(); ++it )
+        {
+            getRenderQueue()->addRenderable(*it);
+        }
+    }
+}
+
+void OctreeSceneManager::walkOctree( OctreeCamera *camera, RenderQueue *queue, 
+	Octree *octant, VisibleObjectsBoundsInfo* visibleBounds, 
+	bool foundvisible, bool onlyShadowCasters )
+{
+
+    //return immediately if nothing is in the node.
+    if ( octant -> numNodes() == 0 )
+        return ;
+
+    OctreeCamera::Visibility v = OctreeCamera::NONE;
+
+    if ( foundvisible )
+    {
+        v = OctreeCamera::FULL;
+    }
+
+    else if ( octant == mOctree )
+    {
+        v = OctreeCamera::PARTIAL;
+    }
+
+    else
+    {
+        AxisAlignedBox box;
+        octant -> _getCullBounds( &box );
+        v = camera -> getVisibility( box );
+    }
+
+
+    // if the octant is visible, or if it's the root node...
+    if ( v != OctreeCamera::NONE )
+    {
+
+        //Add stuff to be rendered;
+        NodeList::iterator it = octant -> mNodes.begin();
+
+        if ( mShowBoxes )
+        {
+            mBoxes.push_back( octant->getWireBoundingBox() );
+        }
+
+        bool vis = true;
+
+        while ( it != octant -> mNodes.end() )
+        {
+            OctreeNode * sn = *it;
+
+            // if this octree is partially visible, manually cull all
+            // scene nodes attached directly to this level.
+
+            if ( v == OctreeCamera::PARTIAL )
+                vis = camera -> isVisible( sn -> _getWorldAABB() );
+
+            if ( vis )
+            {
+
+                mNumObjects++;
+                sn -> _addToRenderQueue(camera, queue, onlyShadowCasters, visibleBounds );
+
+                mVisible.push_back( sn );
+
+                if ( mDisplayNodes )
+                    queue -> addRenderable( sn );
+
+                // check if the scene manager or this node wants the bounding box shown.
+                if (sn->getShowBoundingBox() || mShowBoundingBoxes)
+                    sn->_addBoundingBoxToQueue(queue);
+            }
+
+            ++it;
+        }
+
+        Octree* child;
+        bool childfoundvisible = (v == OctreeCamera::FULL);
+        if ( (child = octant -> mChildren[ 0 ][ 0 ][ 0 ]) != 0 )
+            walkOctree( camera, queue, child, visibleBounds, childfoundvisible, onlyShadowCasters );
+
+        if ( (child = octant -> mChildren[ 1 ][ 0 ][ 0 ]) != 0 )
+            walkOctree( camera, queue, child, visibleBounds, childfoundvisible, onlyShadowCasters );
+
+        if ( (child = octant -> mChildren[ 0 ][ 1 ][ 0 ]) != 0 )
+            walkOctree( camera, queue, child, visibleBounds, childfoundvisible, onlyShadowCasters );
+
+        if ( (child = octant -> mChildren[ 1 ][ 1 ][ 0 ]) != 0 )
+            walkOctree( camera, queue, child, visibleBounds, childfoundvisible, onlyShadowCasters );
+
+        if ( (child = octant -> mChildren[ 0 ][ 0 ][ 1 ]) != 0 )
+            walkOctree( camera, queue, child, visibleBounds, childfoundvisible, onlyShadowCasters );
+
+        if ( (child = octant -> mChildren[ 1 ][ 0 ][ 1 ]) != 0 )
+            walkOctree( camera, queue, child, visibleBounds, childfoundvisible, onlyShadowCasters );
+
+        if ( (child = octant -> mChildren[ 0 ][ 1 ][ 1 ]) != 0 )
+            walkOctree( camera, queue, child, visibleBounds, childfoundvisible, onlyShadowCasters );
+
+        if ( (child = octant -> mChildren[ 1 ][ 1 ][ 1 ]) != 0 )
+            walkOctree( camera, queue, child, visibleBounds, childfoundvisible, onlyShadowCasters );
+
+    }
+
+}
+
+// --- non template versions
+void _findNodes( const AxisAlignedBox &t, std::list < SceneNode * > &list, SceneNode *exclude, bool full, Octree *octant )
+{
+
+	if ( !full )
+	{
+		AxisAlignedBox obox;
+		octant -> _getCullBounds( &obox );
+
+		Intersection isect = intersect( t, obox );
+
+		if ( isect == OUTSIDE )
+			return ;
+
+		full = ( isect == INSIDE );
+	}
+
+
+	NodeList::iterator it = octant -> mNodes.begin();
+
+	while ( it != octant -> mNodes.end() )
+	{
+		OctreeNode * on = ( *it );
+
+		if ( on != exclude )
+		{
+			if ( full )
+			{
+				list.push_back( on );
+			}
+
+			else
+			{
+				Intersection nsect = intersect( t, on -> _getWorldAABB() );
+
+				if ( nsect != OUTSIDE )
+				{
+					list.push_back( on );
+				}
+			}
+
+		}
+
+		++it;
+	}
+
+	Octree* child;
+
+	if ( (child=octant -> mChildren[ 0 ][ 0 ][ 0 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 1 ][ 0 ][ 0 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 0 ][ 1 ][ 0 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 1 ][ 1 ][ 0 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 0 ][ 0 ][ 1 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 1 ][ 0 ][ 1 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 0 ][ 1 ][ 1 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 1 ][ 1 ][ 1 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+}
+
+void _findNodes( const Sphere &t, std::list < SceneNode * > &list, SceneNode *exclude, bool full, Octree *octant )
+{
+
+	if ( !full )
+	{
+		AxisAlignedBox obox;
+		octant -> _getCullBounds( &obox );
+
+		Intersection isect = intersect( t, obox );
+
+		if ( isect == OUTSIDE )
+			return ;
+
+		full = ( isect == INSIDE );
+	}
+
+
+	NodeList::iterator it = octant -> mNodes.begin();
+
+	while ( it != octant -> mNodes.end() )
+	{
+		OctreeNode * on = ( *it );
+
+		if ( on != exclude )
+		{
+			if ( full )
+			{
+				list.push_back( on );
+			}
+
+			else
+			{
+				Intersection nsect = intersect( t, on -> _getWorldAABB() );
+
+				if ( nsect != OUTSIDE )
+				{
+					list.push_back( on );
+				}
+			}
+
+		}
+
+		++it;
+	}
+
+	Octree* child;
+
+	if ( (child=octant -> mChildren[ 0 ][ 0 ][ 0 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 1 ][ 0 ][ 0 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 0 ][ 1 ][ 0 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 1 ][ 1 ][ 0 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 0 ][ 0 ][ 1 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 1 ][ 0 ][ 1 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 0 ][ 1 ][ 1 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 1 ][ 1 ][ 1 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+}
+
+
+void _findNodes( const PlaneBoundedVolume &t, std::list < SceneNode * > &list, SceneNode *exclude, bool full, Octree *octant )
+{
+
+	if ( !full )
+	{
+		AxisAlignedBox obox;
+		octant -> _getCullBounds( &obox );
+
+		Intersection isect = intersect( t, obox );
+
+		if ( isect == OUTSIDE )
+			return ;
+
+		full = ( isect == INSIDE );
+	}
+
+
+	NodeList::iterator it = octant -> mNodes.begin();
+
+	while ( it != octant -> mNodes.end() )
+	{
+		OctreeNode * on = ( *it );
+
+		if ( on != exclude )
+		{
+			if ( full )
+			{
+				list.push_back( on );
+			}
+
+			else
+			{
+				Intersection nsect = intersect( t, on -> _getWorldAABB() );
+
+				if ( nsect != OUTSIDE )
+				{
+					list.push_back( on );
+				}
+			}
+
+		}
+
+		++it;
+	}
+
+	Octree* child;
+
+	if ( (child=octant -> mChildren[ 0 ][ 0 ][ 0 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 1 ][ 0 ][ 0 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 0 ][ 1 ][ 0 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 1 ][ 1 ][ 0 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 0 ][ 0 ][ 1 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 1 ][ 0 ][ 1 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 0 ][ 1 ][ 1 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 1 ][ 1 ][ 1 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+}
+
+void _findNodes( const Ray &t, std::list < SceneNode * > &list, SceneNode *exclude, bool full, Octree *octant )
+{
+
+	if ( !full )
+	{
+		AxisAlignedBox obox;
+		octant -> _getCullBounds( &obox );
+
+		Intersection isect = intersect( t, obox );
+
+		if ( isect == OUTSIDE )
+			return ;
+
+		full = ( isect == INSIDE );
+	}
+
+
+	NodeList::iterator it = octant -> mNodes.begin();
+
+	while ( it != octant -> mNodes.end() )
+	{
+		OctreeNode * on = ( *it );
+
+		if ( on != exclude )
+		{
+			if ( full )
+			{
+				list.push_back( on );
+			}
+
+			else
+			{
+				Intersection nsect = intersect( t, on -> _getWorldAABB() );
+
+				if ( nsect != OUTSIDE )
+				{
+					list.push_back( on );
+				}
+			}
+
+		}
+
+		++it;
+	}
+
+	Octree* child;
+
+	if ( (child=octant -> mChildren[ 0 ][ 0 ][ 0 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 1 ][ 0 ][ 0 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 0 ][ 1 ][ 0 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 1 ][ 1 ][ 0 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 0 ][ 0 ][ 1 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 1 ][ 0 ][ 1 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 0 ][ 1 ][ 1 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+	if ( (child=octant -> mChildren[ 1 ][ 1 ][ 1 ]) != 0 )
+		_findNodes( t, list, exclude, full, child );
+
+}
+
+void OctreeSceneManager::findNodesIn( const AxisAlignedBox &box, std::list < SceneNode * > &list, SceneNode *exclude )
+{
+    _findNodes( box, list, exclude, false, mOctree );
+}
+
+void OctreeSceneManager::findNodesIn( const Sphere &sphere, std::list < SceneNode * > &list, SceneNode *exclude )
+{
+    _findNodes( sphere, list, exclude, false, mOctree );
+}
+
+void OctreeSceneManager::findNodesIn( const PlaneBoundedVolume &volume, std::list < SceneNode * > &list, SceneNode *exclude )
+{
+    _findNodes( volume, list, exclude, false, mOctree );
+}
+
+void OctreeSceneManager::findNodesIn( const Ray &r, std::list < SceneNode * > &list, SceneNode *exclude )
+{
+    _findNodes( r, list, exclude, false, mOctree );
+}
+
+void OctreeSceneManager::resize( const AxisAlignedBox &box )
+{
+    std::list < SceneNode * > nodes;
+    std::list < SceneNode * > ::iterator it;
+
+    _findNodes( mOctree->mBox, nodes, 0, true, mOctree );
+
+    delete mOctree;
+
+    mOctree = new Octree( 0 );
+    mOctree->mBox = box;
+
+	const Vector3 min = box.getMinimum();
+	const Vector3 max = box.getMaximum();
+	mOctree->mHalfSize = ( max - min ) * 0.5f;
+
+    it = nodes.begin();
+
+    while ( it != nodes.end() )
+    {
+        OctreeNode * on = static_cast < OctreeNode * > ( *it );
+        on -> setOctant( 0 );
+        _updateOctreeNode( on );
+        ++it;
+    }
+
+}
+
+bool OctreeSceneManager::setOption( const String & key, const void * val )
+{
+    if ( key == "Size" )
+    {
+        resize( * static_cast < const AxisAlignedBox * > ( val ) );
+        return true;
+    }
+
+    else if ( key == "Depth" )
+    {
+        mMaxDepth = * static_cast < const int * > ( val );
+		// copy the box since resize will delete mOctree and reference won't work
+		AxisAlignedBox box = mOctree->mBox;
+        resize(box);
+        return true;
+    }
+
+    else if ( key == "ShowOctree" )
+    {
+        mShowBoxes = * static_cast < const bool * > ( val );
+        return true;
+    }
+
+
+    return SceneManager::setOption( key, val );
+
+
+}
+
+bool OctreeSceneManager::getOption( const String & key, void *val )
+{
+    if ( key == "Size" )
+    {
+        AxisAlignedBox * b = static_cast < AxisAlignedBox * > ( val );
+        b -> setExtents( mOctree->mBox.getMinimum(), mOctree->mBox.getMaximum() );
+        return true;
+    }
+
+    else if ( key == "Depth" )
+    {
+        * static_cast < int * > ( val ) = mMaxDepth;
+        return true;
+    }
+
+    else if ( key == "ShowOctree" )
+    {
+
+        * static_cast < bool * > ( val ) = mShowBoxes;
+        return true;
+    }
+
+
+    return SceneManager::getOption( key, val );
+
+}
+
+void OctreeSceneManager::clearScene(void)
+{
+    SceneManager::clearScene();
+    init(mBox, mMaxDepth);
+
+}
+
+//---------------------------------------------------------------------
+AxisAlignedBoxSceneQuery*
+OctreeSceneManager::createAABBQuery(const AxisAlignedBox& box, unsigned long mask)
+{
+    OctreeAxisAlignedBoxSceneQuery* q = new OctreeAxisAlignedBoxSceneQuery(this);
+    q->setBox(box);
+    q->setQueryMask(mask);
+    return q;
+}
+//---------------------------------------------------------------------
+SphereSceneQuery*
+OctreeSceneManager::createSphereQuery(const Sphere& sphere, unsigned long mask)
+{
+    OctreeSphereSceneQuery* q = new OctreeSphereSceneQuery(this);
+    q->setSphere(sphere);
+    q->setQueryMask(mask);
+    return q;
+}
+//---------------------------------------------------------------------
+PlaneBoundedVolumeListSceneQuery*
+OctreeSceneManager::createPlaneBoundedVolumeQuery(const PlaneBoundedVolumeList& volumes,
+        unsigned long mask)
+{
+    OctreePlaneBoundedVolumeListSceneQuery* q = new OctreePlaneBoundedVolumeListSceneQuery(this);
+    q->setVolumes(volumes);
+    q->setQueryMask(mask);
+    return q;
+}
+
+//---------------------------------------------------------------------
+RaySceneQuery*
+OctreeSceneManager::createRayQuery(const Ray& ray, unsigned long mask)
+{
+    OctreeRaySceneQuery* q = new OctreeRaySceneQuery(this);
+    q->setRay(ray);
+    q->setQueryMask(mask);
+    return q;
+}
+//---------------------------------------------------------------------
+IntersectionSceneQuery*
+OctreeSceneManager::createIntersectionQuery(unsigned long mask)
+{
+
+    // Octree implementation performs WORSE for < 500 objects
+    // TODO: optimise it so it's better in all cases
+    //OctreeIntersectionSceneQuery* q = new OctreeIntersectionSceneQuery(this);
+    DefaultIntersectionSceneQuery* q = new DefaultIntersectionSceneQuery(this);
+    q->setQueryMask(mask);
+    return q;
+}
+//-----------------------------------------------------------------------
+const String OctreeSceneManagerFactory::FACTORY_TYPE_NAME = "OctreeSceneManager";
+//-----------------------------------------------------------------------
+void OctreeSceneManagerFactory::initMetaData(void) const
+{
+	mMetaData.typeName = FACTORY_TYPE_NAME;
+	mMetaData.description = "Scene manager organising the scene on the basis of an octree.";
+	mMetaData.sceneTypeMask = 0xFFFF; // support all types
+	mMetaData.worldGeometrySupported = false;
+}
+//-----------------------------------------------------------------------
+SceneManager* OctreeSceneManagerFactory::createInstance(
+	const String& instanceName)
+{
+	return new OctreeSceneManager(instanceName);
+}
+//-----------------------------------------------------------------------
+void OctreeSceneManagerFactory::destroyInstance(SceneManager* instance)
+{
+	delete instance;
+}
+
+
+}
Index: /PlugIns/OctreeSceneManager/src/OgreOctreeSceneManagerDll.cpp
===================================================================
--- /PlugIns/OctreeSceneManager/src/OgreOctreeSceneManagerDll.cpp	(revision 5)
+++ /PlugIns/OctreeSceneManager/src/OgreOctreeSceneManagerDll.cpp	(revision 5)
@@ -0,0 +1,51 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include <OgreRoot.h>
+#include <OgreOctreePlugin.h>
+
+namespace Ogre
+{
+OctreePlugin* octreePlugin;
+
+extern "C" void _OgreOctreePluginExport dllStartPlugin( void )
+{
+    // Create new scene manager
+    octreePlugin = new OctreePlugin();
+
+    // Register
+    Root::getSingleton().installPlugin(octreePlugin);
+
+}
+extern "C" void _OgreOctreePluginExport dllStopPlugin( void )
+{
+	Root::getSingleton().uninstallPlugin(octreePlugin);
+	delete octreePlugin;
+}
+}
Index: /PlugIns/OctreeSceneManager/src/OgreOctreeSceneQuery.cpp
===================================================================
--- /PlugIns/OctreeSceneManager/src/OgreOctreeSceneQuery.cpp	(revision 5)
+++ /PlugIns/OctreeSceneManager/src/OgreOctreeSceneQuery.cpp	(revision 5)
@@ -0,0 +1,349 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+ 
+Copyright  2000-2005 The OGRE Team
+Also see acknowledgements in Readme.html
+ 
+This program 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 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 Lesser General Public License for more details.
+ 
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/***************************************************************************
+OgreOctreeSceneQuery.cpp  -  description
+-------------------
+begin                : Tues July 20, 2004
+copyright            : (C) 2004by Jon Anderson
+email                : janders@users.sf.net
+ 
+ 
+ 
+***************************************************************************/
+
+#include <OgreOctreeSceneQuery.h>
+#include <OgreOctreeSceneManager.h>
+#include <OgreEntity.h>
+#include <OgreRoot.h>
+
+namespace Ogre
+{
+
+//---------------------------------------------------------------------
+OctreeIntersectionSceneQuery::OctreeIntersectionSceneQuery(SceneManager* creator)
+        : DefaultIntersectionSceneQuery(creator)
+{
+
+}
+//---------------------------------------------------------------------
+OctreeIntersectionSceneQuery::~OctreeIntersectionSceneQuery()
+{}
+//---------------------------------------------------------------------
+void OctreeIntersectionSceneQuery::execute(IntersectionSceneQueryListener* listener)
+{
+    typedef std::pair<MovableObject *, MovableObject *> MovablePair;
+    typedef std::set
+        < std::pair<MovableObject *, MovableObject *> > MovableSet;
+
+    MovableSet set;
+
+	// Iterate over all movable types
+	Root::MovableObjectFactoryIterator factIt = 
+		Root::getSingleton().getMovableObjectFactoryIterator();
+	while(factIt.hasMoreElements())
+	{
+		SceneManager::MovableObjectIterator it = 
+			mParentSceneMgr->getMovableObjectIterator(
+			factIt.getNext()->getType());
+		while( it.hasMoreElements() )
+		{
+
+			MovableObject * e = it.getNext();
+
+			std::list < SceneNode * > list;
+			//find the nodes that intersect the AAB
+			static_cast<OctreeSceneManager*>( mParentSceneMgr ) -> findNodesIn( e->getWorldBoundingBox(), list, 0 );
+			//grab all moveables from the node that intersect...
+			std::list < SceneNode * >::iterator nit = list.begin();
+			while( nit != list.end() )
+			{
+				SceneNode::ObjectIterator oit = (*nit) -> getAttachedObjectIterator();
+				while( oit.hasMoreElements() )
+				{
+					MovableObject * m = oit.getNext();
+
+					if( m != e &&
+							set.find( MovablePair(e,m)) == set.end() &&
+							set.find( MovablePair(m,e)) == set.end() &&
+							(m->getQueryFlags() & mQueryMask) &&
+							(m->getTypeFlags() & mQueryTypeMask) &&
+							m->isInScene() && 
+							e->getWorldBoundingBox().intersects( m->getWorldBoundingBox() ) )
+					{
+						listener -> queryResult( e, m );
+						// deal with attached objects, since they are not directly attached to nodes
+						if (m->getMovableType() == "Entity")
+						{
+							Entity* e2 = static_cast<Entity*>(m);
+							Entity::ChildObjectListIterator childIt = e2->getAttachedObjectIterator();
+							while(childIt.hasMoreElements())
+							{
+								MovableObject* c = childIt.getNext();
+								if (c->getQueryFlags() & mQueryMask && 
+									e->getWorldBoundingBox().intersects( c->getWorldBoundingBox() ))
+								{
+									listener->queryResult(e, c);
+								}
+							}
+						}
+					}
+					set.insert( MovablePair(e,m) );
+
+				}
+				++nit;
+			}
+
+		}
+	}
+}
+/** Creates a custom Octree AAB query */
+OctreeAxisAlignedBoxSceneQuery::OctreeAxisAlignedBoxSceneQuery(SceneManager* creator)
+        : DefaultAxisAlignedBoxSceneQuery(creator)
+{
+}
+/** Deletes the custom Octree query */
+OctreeAxisAlignedBoxSceneQuery::~OctreeAxisAlignedBoxSceneQuery()
+{}
+
+/** Finds any entities that intersect the AAB for the query. */
+void OctreeAxisAlignedBoxSceneQuery::execute(SceneQueryListener* listener)
+{
+    std::list < SceneNode * > list;
+    //find the nodes that intersect the AAB
+    static_cast<OctreeSceneManager*>( mParentSceneMgr ) -> findNodesIn( mAABB, list, 0 );
+
+    //grab all moveables from the node that intersect...
+    std::list < SceneNode * >::iterator it = list.begin();
+    while( it != list.end() )
+    {
+        SceneNode::ObjectIterator oit = (*it) -> getAttachedObjectIterator();
+        while( oit.hasMoreElements() )
+        {
+            MovableObject * m = oit.getNext();
+            if( (m->getQueryFlags() & mQueryMask) && 
+				(m->getTypeFlags() & mQueryTypeMask) && 
+				m->isInScene() &&
+				mAABB.intersects( m->getWorldBoundingBox() ) )
+            {
+                listener -> queryResult( m );
+				// deal with attached objects, since they are not directly attached to nodes
+				if (m->getMovableType() == "Entity")
+				{
+					Entity* e = static_cast<Entity*>(m);
+					Entity::ChildObjectListIterator childIt = e->getAttachedObjectIterator();
+					while(childIt.hasMoreElements())
+					{
+						MovableObject* c = childIt.getNext();
+						if (c->getQueryFlags() & mQueryMask)
+						{
+							listener->queryResult(c);
+						}
+					}
+				}
+            }
+
+        }
+
+        ++it;
+    }
+
+}
+//---------------------------------------------------------------------
+OctreeRaySceneQuery::
+OctreeRaySceneQuery(SceneManager* creator) : DefaultRaySceneQuery(creator)
+{
+}
+//---------------------------------------------------------------------
+OctreeRaySceneQuery::~OctreeRaySceneQuery()
+{}
+//---------------------------------------------------------------------
+void OctreeRaySceneQuery::execute(RaySceneQueryListener* listener)
+{
+    std::list < SceneNode * > list;
+    //find the nodes that intersect the AAB
+    static_cast<OctreeSceneManager*>( mParentSceneMgr ) -> findNodesIn( mRay, list, 0 );
+
+    //grab all moveables from the node that intersect...
+    std::list < SceneNode * >::iterator it = list.begin();
+    while( it != list.end() )
+    {
+        SceneNode::ObjectIterator oit = (*it) -> getAttachedObjectIterator();
+        while( oit.hasMoreElements() )
+        {
+            MovableObject * m = oit.getNext();
+            if( (m->getQueryFlags() & mQueryMask) && 
+				(m->getTypeFlags() & mQueryTypeMask) && m->isInScene() )
+            {
+                std::pair<bool, Real> result = mRay.intersects(m->getWorldBoundingBox());
+
+                if( result.first )
+                {
+                    listener -> queryResult( m, result.second );
+					// deal with attached objects, since they are not directly attached to nodes
+					if (m->getMovableType() == "Entity")
+					{
+						Entity* e = static_cast<Entity*>(m);
+						Entity::ChildObjectListIterator childIt = e->getAttachedObjectIterator();
+						while(childIt.hasMoreElements())
+						{
+							MovableObject* c = childIt.getNext();
+							if (c->getQueryFlags() & mQueryMask)
+							{
+								result = mRay.intersects(c->getWorldBoundingBox());
+								if (result.first)
+								{
+									listener->queryResult(c, result.second);
+								}
+							}
+						}
+					}
+                }
+            }
+        }
+
+        ++it;
+    }
+
+}
+
+
+//---------------------------------------------------------------------
+OctreeSphereSceneQuery::
+OctreeSphereSceneQuery(SceneManager* creator) : DefaultSphereSceneQuery(creator)
+{
+}
+//---------------------------------------------------------------------
+OctreeSphereSceneQuery::~OctreeSphereSceneQuery()
+{}
+//---------------------------------------------------------------------
+void OctreeSphereSceneQuery::execute(SceneQueryListener* listener)
+{
+    std::list < SceneNode * > list;
+    //find the nodes that intersect the AAB
+    static_cast<OctreeSceneManager*>( mParentSceneMgr ) -> findNodesIn( mSphere, list, 0 );
+
+    //grab all moveables from the node that intersect...
+    std::list < SceneNode * >::iterator it = list.begin();
+    while( it != list.end() )
+    {
+        SceneNode::ObjectIterator oit = (*it) -> getAttachedObjectIterator();
+        while( oit.hasMoreElements() )
+        {
+            MovableObject * m = oit.getNext();
+            if( (m->getQueryFlags() & mQueryMask) && 
+				(m->getTypeFlags() & mQueryTypeMask) && 
+				m->isInScene() && 
+				mSphere.intersects( m->getWorldBoundingBox() ) )
+            {
+                listener -> queryResult( m );
+				// deal with attached objects, since they are not directly attached to nodes
+				if (m->getMovableType() == "Entity")
+				{
+					Entity* e = static_cast<Entity*>(m);
+					Entity::ChildObjectListIterator childIt = e->getAttachedObjectIterator();
+					while(childIt.hasMoreElements())
+					{
+						MovableObject* c = childIt.getNext();
+						if (c->getQueryFlags() & mQueryMask &&
+							mSphere.intersects( c->getWorldBoundingBox()))
+						{
+							listener->queryResult(c);
+						}
+					}
+				}
+            }
+        }
+
+        ++it;
+    }
+}
+//---------------------------------------------------------------------
+OctreePlaneBoundedVolumeListSceneQuery::
+OctreePlaneBoundedVolumeListSceneQuery(SceneManager* creator)
+        : DefaultPlaneBoundedVolumeListSceneQuery(creator)
+{
+
+}
+//---------------------------------------------------------------------
+OctreePlaneBoundedVolumeListSceneQuery::~OctreePlaneBoundedVolumeListSceneQuery()
+{}
+//---------------------------------------------------------------------
+void OctreePlaneBoundedVolumeListSceneQuery::execute(SceneQueryListener* listener)
+{
+    std::set<SceneNode*> checkedSceneNodes;
+
+    PlaneBoundedVolumeList::iterator pi, piend;
+    piend = mVolumes.end();
+    for (pi = mVolumes.begin(); pi != piend; ++pi)
+    {
+        std::list < SceneNode * > list;
+        //find the nodes that intersect the AAB
+        static_cast<OctreeSceneManager*>( mParentSceneMgr ) -> findNodesIn( *pi, list, 0 );
+
+        //grab all moveables from the node that intersect...
+        std::list < SceneNode * >::iterator it, itend;
+        itend = list.end();
+        for (it = list.begin(); it != itend; ++it)
+        {
+            // avoid double-check same scene node
+            if (!checkedSceneNodes.insert(*it).second)
+                continue;
+            SceneNode::ObjectIterator oit = (*it) -> getAttachedObjectIterator();
+            while( oit.hasMoreElements() )
+            {
+                MovableObject * m = oit.getNext();
+                if( (m->getQueryFlags() & mQueryMask) && 
+					(m->getTypeFlags() & mQueryTypeMask) && 
+					m->isInScene() &&
+					(*pi).intersects( m->getWorldBoundingBox() ) )
+                {
+                    listener -> queryResult( m );
+					// deal with attached objects, since they are not directly attached to nodes
+					if (m->getMovableType() == "Entity")
+					{
+						Entity* e = static_cast<Entity*>(m);
+						Entity::ChildObjectListIterator childIt = e->getAttachedObjectIterator();
+						while(childIt.hasMoreElements())
+						{
+							MovableObject* c = childIt.getNext();
+							if (c->getQueryFlags() & mQueryMask &&
+								(*pi).intersects( c->getWorldBoundingBox()))
+							{
+								listener->queryResult(c);
+							}
+						}
+					}
+                }
+            }
+        }
+    }//for
+}
+
+
+}
Index: /PlugIns/OctreeSceneManager/src/OgreTerrainPage.cpp
===================================================================
--- /PlugIns/OctreeSceneManager/src/OgreTerrainPage.cpp	(revision 5)
+++ /PlugIns/OctreeSceneManager/src/OgreTerrainPage.cpp	(revision 5)
@@ -0,0 +1,137 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreTerrainPage.h"
+#include "OgreTerrainRenderable.h"
+
+namespace Ogre {
+
+    //-------------------------------------------------------------------------
+    TerrainPage::TerrainPage(unsigned short numTiles)
+    {
+        tilesPerPage = numTiles;
+        // Set up an empty array of TerrainRenderable pointers
+        int i, j;
+        for ( i = 0; i < tilesPerPage; i++ )
+        {
+            tiles.push_back( TerrainRow() );
+
+            for ( j = 0; j < tilesPerPage; j++ )
+            {
+                tiles[ i ].push_back( 0 );
+            }
+        }
+
+        pageSceneNode = 0;
+
+    }
+    //-------------------------------------------------------------------------
+    TerrainPage::~TerrainPage()
+    {
+        Terrain2D::iterator i, iend;
+        iend = tiles.end();
+        for (i = tiles.begin(); i != iend; ++i)
+        {
+            TerrainRow::iterator j, jend;
+            jend = i->end();
+            for (j = i->begin(); j != jend; ++j)
+            {
+                delete *j;
+                *j = 0;
+            }
+        }
+
+    }
+    //-------------------------------------------------------------------------
+    void TerrainPage::linkNeighbours(void)
+    {
+        //setup the neighbor links.
+
+        for ( size_t j = 0; j < tilesPerPage; j++ )
+        {
+            for ( size_t i = 0; i < tilesPerPage; i++ )
+            {
+                if ( j != tilesPerPage - 1 )
+                {
+                    tiles[ i ][ j ] -> _setNeighbor( TerrainRenderable::SOUTH, tiles[ i ][ j + 1 ] );
+                    tiles[ i ][ j + 1 ] -> _setNeighbor( TerrainRenderable::NORTH, tiles[ i ][ j ] );
+                }
+
+                if ( i != tilesPerPage - 1 )
+                {
+                    tiles[ i ][ j ] -> _setNeighbor( TerrainRenderable::EAST, tiles[ i + 1 ][ j ] );
+                    tiles[ i + 1 ][ j ] -> _setNeighbor( TerrainRenderable::WEST, tiles[ i ][ j ] );
+                }
+
+            }
+        }
+    }
+    //-------------------------------------------------------------------------
+    TerrainRenderable * TerrainPage::getTerrainTile( const Vector3 & pt )
+    {
+        /* Since we don't know if the terrain is square, or has holes, we use a line trace
+        to find the containing tile...
+        */
+
+        TerrainRenderable * tile = tiles[ 0 ][ 0 ];
+
+        while ( tile != 0 )
+        {
+            AxisAlignedBox b = tile -> getBoundingBox();
+
+            if ( pt.x < b.getMinimum().x )
+                tile = tile -> _getNeighbor( TerrainRenderable::WEST );
+            else if ( pt.x > b.getMaximum().x )
+                tile = tile -> _getNeighbor( TerrainRenderable::EAST );
+            else if ( pt.z < b.getMinimum().z )
+                tile = tile -> _getNeighbor( TerrainRenderable::NORTH );
+            else if ( pt.z > b.getMaximum().z )
+                tile = tile -> _getNeighbor( TerrainRenderable::SOUTH );
+            else
+                return tile;
+        }
+
+        return 0;
+    }
+	//-------------------------------------------------------------------------
+	void TerrainPage::setRenderQueue(uint8 qid)
+	{
+		for ( size_t j = 0; j < tilesPerPage; j++ )
+		{
+			for ( size_t i = 0; i < tilesPerPage; i++ )
+			{
+				if ( j != tilesPerPage - 1 )
+				{
+					tiles[ i ][ j ]->setRenderQueueGroup(qid);
+				}
+			}
+		}
+	}
+
+}
+
Index: /PlugIns/OctreeSceneManager/src/OgreTerrainPageSource.cpp
===================================================================
--- /PlugIns/OctreeSceneManager/src/OgreTerrainPageSource.cpp	(revision 5)
+++ /PlugIns/OctreeSceneManager/src/OgreTerrainPageSource.cpp	(revision 5)
@@ -0,0 +1,188 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreTerrainPageSource.h"
+#include "OgreTerrainPage.h"
+#include "OgreTerrainRenderable.h"
+#include "OgreSceneNode.h"
+#include "OgreTerrainSceneManager.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    template<> TerrainPageSourceListenerManager* Singleton<TerrainPageSourceListenerManager>::ms_Singleton = 0;
+    TerrainPageSourceListenerManager* TerrainPageSourceListenerManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+    TerrainPageSourceListenerManager& TerrainPageSourceListenerManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+    //-------------------------------------------------------------------------
+	void TerrainPageSourceListenerManager::addListener(TerrainPageSourceListener* pl)
+	{
+        mPageSourceListeners.push_back(pl);
+	}
+    //-------------------------------------------------------------------------
+	void TerrainPageSourceListenerManager::removeListener(TerrainPageSourceListener* pl)
+	{
+        PageSourceListenerList::iterator i, iend;
+        iend = mPageSourceListeners.end();
+        for(i = mPageSourceListeners.begin(); i != iend; ++i)
+        {
+            if (*i == pl)
+            {
+                mPageSourceListeners.erase(i);
+                break;
+            }
+        }
+	}
+    //-------------------------------------------------------------------------
+	void TerrainPageSourceListenerManager::firePageConstructed(
+		TerrainSceneManager* sm, size_t pagex, size_t pagez, Real* heightData)
+	{
+        PageSourceListenerList::iterator i, iend;
+        iend = mPageSourceListeners.end();
+        for(i = mPageSourceListeners.begin(); i != iend; ++i)
+        {
+            (*i)->pageConstructed(sm, pagex, pagez, heightData);
+        }
+	}
+	//-------------------------------------------------------------------------
+	TerrainPageSource::TerrainPageSource() : mSceneManager(0), mAsyncLoading(false) {
+	}
+	//-------------------------------------------------------------------------
+	TerrainPage* TerrainPageSource::buildPage(Real* heightData, const MaterialPtr& pMaterial)
+    {
+        String name;
+
+        // Create a Terrain Page
+        TerrainPage* page = new TerrainPage((mPageSize-1) / (mTileSize-1));
+        // Create a node for all tiles to be attached to
+        // Note we sequentially name since page can be attached at different points
+        // so page x/z is not appropriate
+		StringUtil::StrStreamType page_str;
+		size_t pageIndex = mSceneManager->_getPageCount();
+		page_str << pageIndex;
+        name = "page[";
+        name += page_str.str() + "]";
+		if (mSceneManager->hasSceneNode(name))
+		{
+			page->pageSceneNode = mSceneManager->getSceneNode(name);
+		}
+		else
+		{
+			page->pageSceneNode = mSceneManager->createSceneNode(name);
+		}
+        
+        size_t q = 0;
+        for ( size_t j = 0; j < mPageSize - 1; j += ( mTileSize - 1 ) )
+        {
+            size_t p = 0;
+
+            for ( size_t i = 0; i < mPageSize - 1; i += ( mTileSize - 1 ) )
+            {
+				StringUtil::StrStreamType new_name_str;
+				
+                // Create scene node for the tile and the TerrainRenderable
+                new_name_str << "tile[" << pageIndex << "][" << (int)p << "," << (int)q << "]";
+				name = new_name_str.str();
+
+                SceneNode *c;
+				if (mSceneManager->hasSceneNode(name))
+				{
+					c = mSceneManager->getSceneNode( name );
+					if (c->getParentSceneNode() != page->pageSceneNode)
+						page->pageSceneNode->addChild(c);
+				}
+				else
+				{
+					c = page->pageSceneNode->createChildSceneNode( name );
+				}
+
+				TerrainRenderable *tile = new TerrainRenderable(name, mSceneManager);
+				// set queue
+				tile->setRenderQueueGroup(mSceneManager->getWorldGeometryRenderQueue());
+                // Initialise the tile
+                tile->setMaterial(pMaterial);
+                tile->initialise(i, j, heightData);
+                // Attach it to the page
+                page->tiles[ p ][ q ] = tile;
+                // Attach it to the node
+                c ->attachObject( tile );
+                p++;
+            }
+
+            q++;
+
+        }
+
+        pageIndex++;
+
+        // calculate neighbours for page
+        page->linkNeighbours();
+
+		if(mSceneManager->getOptions().lit)
+		{
+			q = 0;
+			for ( size_t j = 0; j < mPageSize - 1; j += ( mTileSize - 1 ) )
+			{
+				size_t p = 0;
+
+				for ( size_t i = 0; i < mPageSize - 1; i += ( mTileSize - 1 ) )
+				{
+					page->tiles[ p ][ q ]->_calculateNormals();
+					p++;
+				}
+				q++;
+			}
+		}
+
+        return page;
+    }
+    //-------------------------------------------------------------------------
+    void TerrainPageSource::firePageConstructed(size_t pagex, size_t pagez, Real* heightData)
+    {
+		TerrainPageSourceListenerManager::getSingleton().firePageConstructed(
+			mSceneManager, pagex, pagez, heightData);
+    }
+    //-------------------------------------------------------------------------
+    void TerrainPageSource::addListener(TerrainPageSourceListener* pl)
+    {
+		TerrainPageSourceListenerManager::getSingleton().addListener(pl);
+    }
+    //-------------------------------------------------------------------------
+    void TerrainPageSource::removeListener(TerrainPageSourceListener* pl)
+    {
+		TerrainPageSourceListenerManager::getSingleton().removeListener(pl);
+
+    }
+    //-------------------------------------------------------------------------
+
+}
Index: /PlugIns/OctreeSceneManager/src/OgreTerrainRenderable.cpp
===================================================================
--- /PlugIns/OctreeSceneManager/src/OgreTerrainRenderable.cpp	(revision 5)
+++ /PlugIns/OctreeSceneManager/src/OgreTerrainRenderable.cpp	(revision 5)
@@ -0,0 +1,1458 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/***************************************************************************
+terrainrenderable.cpp  -  description
+-------------------
+begin                : Sat Oct 5 2002
+copyright            : (C) 2002 by Jon Anderson
+email                : janders@users.sf.net
+
+Enhancements 2003 - 2004 (C) The OGRE Team
+
+***************************************************************************/
+
+#include "OgreTerrainRenderable.h"
+#include "OgreSceneNode.h"
+#include "OgreRenderQueue.h"
+#include "OgreRenderOperation.h"
+#include "OgreCamera.h"
+#include "OgreRoot.h"
+#include "OgreTerrainSceneManager.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreViewport.h"
+#include "OgreException.h"
+
+namespace Ogre
+{
+    //-----------------------------------------------------------------------
+    #define MAIN_BINDING 0
+    #define DELTA_BINDING 1
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String TerrainRenderable::mType = "TerrainMipMap";
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+
+    //-----------------------------------------------------------------------
+    TerrainRenderable::TerrainRenderable(const String& name, TerrainSceneManager* tsm)
+        : Renderable(), MovableObject(name), mSceneManager(tsm), mTerrain(0), mDeltaBuffers(0), mPositionBuffer(0)
+    {
+        mForcedRenderLevel = -1;
+        mLastNextLevel = -1;
+
+        mMinLevelDistSqr = 0;
+
+        mInit = false;
+        mLightListDirty = true;
+		MovableObject::mCastShadows = false;
+
+        for ( int i = 0; i < 4; i++ )
+        {
+            mNeighbors[ i ] = 0;
+        }
+
+		mOptions = &(mSceneManager->getOptions());
+
+
+    }
+    //-----------------------------------------------------------------------
+    TerrainRenderable::~TerrainRenderable()
+    {
+
+        deleteGeometry();
+    }
+	//-----------------------------------------------------------------------
+	uint32 TerrainRenderable::getTypeFlags(void) const
+	{
+		// return world flag
+		return SceneManager::WORLD_GEOMETRY_TYPE_MASK;
+	}
+    //-----------------------------------------------------------------------
+    void TerrainRenderable::deleteGeometry()
+    {
+        if(mTerrain)
+            delete mTerrain;
+
+        if (mPositionBuffer)
+            delete [] mPositionBuffer;
+
+        if (mDeltaBuffers)
+            delete [] mDeltaBuffers;
+
+        if ( mMinLevelDistSqr != 0 )
+            delete [] mMinLevelDistSqr;
+    }
+    //-----------------------------------------------------------------------
+    void TerrainRenderable::initialise(int startx, int startz,  
+        Real* pageHeightData)
+    {
+
+        if ( mOptions->maxGeoMipMapLevel != 0 )
+        {
+            int i = ( int ) 1 << ( mOptions->maxGeoMipMapLevel - 1 ) ;
+
+            if ( ( i + 1 ) > mOptions->tileSize )
+            {
+                printf( "Invalid maximum mipmap specifed, must be n, such that 2^(n-1)+1 < tileSize \n" );
+                return ;
+            }
+        }
+
+        deleteGeometry();
+
+        //calculate min and max heights;
+        Real min = 256000, max = 0;
+
+        mTerrain = new VertexData;
+        mTerrain->vertexStart = 0;
+        mTerrain->vertexCount = mOptions->tileSize * mOptions->tileSize;
+
+        VertexDeclaration* decl = mTerrain->vertexDeclaration;
+        VertexBufferBinding* bind = mTerrain->vertexBufferBinding;
+
+        // positions
+        size_t offset = 0;
+        decl->addElement(MAIN_BINDING, offset, VET_FLOAT3, VES_POSITION);
+        offset += VertexElement::getTypeSize(VET_FLOAT3);
+        if (mOptions->lit)
+        {
+            decl->addElement(MAIN_BINDING, offset, VET_FLOAT3, VES_NORMAL);
+            offset += VertexElement::getTypeSize(VET_FLOAT3);
+        }
+        // texture coord sets
+        decl->addElement(MAIN_BINDING, offset, VET_FLOAT2, VES_TEXTURE_COORDINATES, 0);
+        offset += VertexElement::getTypeSize(VET_FLOAT2);
+        decl->addElement(MAIN_BINDING, offset, VET_FLOAT2, VES_TEXTURE_COORDINATES, 1);
+        offset += VertexElement::getTypeSize(VET_FLOAT2);
+        if (mOptions->coloured)
+        {
+            decl->addElement(MAIN_BINDING, offset, VET_COLOUR, VES_DIFFUSE);
+            offset += VertexElement::getTypeSize(VET_COLOUR);
+        }
+
+        // Create shared vertex buffer
+        mMainBuffer =
+            HardwareBufferManager::getSingleton().createVertexBuffer(
+            decl->getVertexSize(MAIN_BINDING),
+            mTerrain->vertexCount, 
+            HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+        // Create system memory copy with just positions in it, for use in simple reads
+        mPositionBuffer = new float[mTerrain->vertexCount * 3];
+
+        bind->setBinding(MAIN_BINDING, mMainBuffer);
+
+        if (mOptions->lodMorph)
+        {
+            // Create additional element for delta
+            decl->addElement(DELTA_BINDING, 0, VET_FLOAT1, VES_BLEND_WEIGHTS);
+            // NB binding is not set here, it is set when deriving the LOD
+        }
+
+
+        mInit = true;
+
+        mRenderLevel = 1;
+
+        mMinLevelDistSqr = new Real[ mOptions->maxGeoMipMapLevel ];
+
+        int endx = startx + mOptions->tileSize;
+
+        int endz = startz + mOptions->tileSize;
+
+        Vector3 left, down, here;
+
+        const VertexElement* poselem = decl->findElementBySemantic(VES_POSITION);
+        const VertexElement* texelem0 = decl->findElementBySemantic(VES_TEXTURE_COORDINATES, 0);
+        const VertexElement* texelem1 = decl->findElementBySemantic(VES_TEXTURE_COORDINATES, 1);
+        float* pSysPos = mPositionBuffer;
+
+        unsigned char* pBase = static_cast<unsigned char*>(mMainBuffer->lock(HardwareBuffer::HBL_DISCARD));
+
+        for ( int j = startz; j < endz; j++ )
+        {
+            for ( int i = startx; i < endx; i++ )
+            {
+                float *pPos, *pTex0, *pTex1;
+                poselem->baseVertexPointerToElement(pBase, &pPos);
+                texelem0->baseVertexPointerToElement(pBase, &pTex0);
+                texelem1->baseVertexPointerToElement(pBase, &pTex1);
+    
+                Real height = pageHeightData[j * mOptions->pageSize + i];
+                height = height * mOptions->scale.y; // scale height 
+
+                *pSysPos++ = *pPos++ = ( float ) i * mOptions->scale.x; //x
+                *pSysPos++ = *pPos++ = height; // y
+                *pSysPos++ = *pPos++ = ( float ) j * mOptions->scale.z; //z
+
+                *pTex0++ = ( float ) i / ( float ) ( mOptions->pageSize - 1 );
+                *pTex0++ = ( float ) j / ( float ) ( mOptions->pageSize - 1 );
+
+                *pTex1++ = ( ( float ) i / ( float ) ( mOptions->tileSize - 1 ) ) * mOptions->detailTile;
+                *pTex1++ = ( ( float ) j / ( float ) ( mOptions->tileSize - 1 ) ) * mOptions->detailTile;
+
+                if ( height < min )
+                    min = ( Real ) height;
+
+                if ( height > max )
+                    max = ( Real ) height;
+
+                pBase += mMainBuffer->getVertexSize();
+            }
+        }
+
+        mMainBuffer->unlock();
+
+        mBounds.setExtents( 
+            ( Real ) startx * mOptions->scale.x, 
+            min, 
+            ( Real ) startz * mOptions->scale.z,
+            ( Real ) ( endx - 1 ) * mOptions->scale.x, 
+            max, 
+            ( Real ) ( endz - 1 ) * mOptions->scale.z );
+
+
+        mCenter = Vector3( ( startx * mOptions->scale.x + (endx - 1) * mOptions->scale.x ) / 2,
+            ( min + max ) / 2,
+            ( startz * mOptions->scale.z + (endz - 1) * mOptions->scale.z ) / 2 );
+
+        mBoundingRadius = Math::Sqrt(
+            Math::Sqr(max - min) +
+            Math::Sqr((endx - 1 - startx) * mOptions->scale.x) +
+            Math::Sqr((endz - 1 - startz) * mOptions->scale.z)) / 2;
+
+        // Create delta buffer list if required to morph
+        if (mOptions->lodMorph)
+        {
+            // Create delta buffer for all except the lowest mip
+            mDeltaBuffers = new HardwareVertexBufferSharedPtr[mOptions->maxGeoMipMapLevel - 1];
+        }
+
+        Real C = _calculateCFactor();
+
+        _calculateMinLevelDist2( C );
+
+    }
+    //-----------------------------------------------------------------------
+    void TerrainRenderable::_getNormalAt( float x, float z, Vector3 * result )
+    {
+
+        assert(mOptions->lit && "No normals present");
+
+        Vector3 here, left, down;
+        here.x = x;
+        here.y = getHeightAt( x, z );
+        here.z = z;
+
+        left.x = x - 1;
+        left.y = getHeightAt( x - 1, z );
+        left.z = z;
+
+        down.x = x;
+        down.y = getHeightAt( x, z + 1 );
+        down.z = z + 1;
+
+        left = left - here;
+
+        down = down - here;
+
+        left.normalise();
+        down.normalise();
+
+        *result = left.crossProduct( down );
+        result -> normalise();
+
+        // result->x = - result->x;
+        // result->y = - result->y;
+        // result->z = - result->z;
+    }
+    //-----------------------------------------------------------------------
+    void TerrainRenderable::_calculateNormals()
+    {
+
+        Vector3 norm;
+
+        assert (mOptions->lit && "No normals present");
+
+        HardwareVertexBufferSharedPtr vbuf = 
+            mTerrain->vertexBufferBinding->getBuffer(MAIN_BINDING);
+        const VertexElement* elem = mTerrain->vertexDeclaration->findElementBySemantic(VES_NORMAL);
+        unsigned char* pBase = static_cast<unsigned char*>( vbuf->lock(HardwareBuffer::HBL_DISCARD) );
+        float* pNorm;
+
+        for ( size_t j = 0; j < mOptions->tileSize; j++ )
+        {
+            for ( size_t i = 0; i < mOptions->tileSize; i++ )
+            {
+
+                _getNormalAt( _vertex( i, j, 0 ), _vertex( i, j, 2 ), &norm );
+
+                //  printf( "Normal = %5f,%5f,%5f\n", norm.x, norm.y, norm.z );
+                elem->baseVertexPointerToElement(pBase, &pNorm);
+                *pNorm++ = norm.x;
+                *pNorm++ = norm.y;
+                *pNorm++ = norm.z;
+                pBase += vbuf->getVertexSize();
+            }
+
+        }
+        vbuf->unlock();
+    }
+    //-----------------------------------------------------------------------
+    void TerrainRenderable::_notifyCurrentCamera( Camera* cam )
+    {
+		MovableObject::_notifyCurrentCamera(cam);
+
+        if ( mForcedRenderLevel >= 0 )
+        {
+            mRenderLevel = mForcedRenderLevel;
+            return ;
+        }
+
+
+        Vector3 cpos = cam -> getDerivedPosition();
+        const AxisAlignedBox& aabb = getWorldBoundingBox(true);
+        Vector3 diff(0, 0, 0);
+        diff.makeFloor(cpos - aabb.getMinimum());
+        diff.makeCeil(cpos - aabb.getMaximum());
+
+        Real L = diff.squaredLength();
+
+        mRenderLevel = -1;
+
+        for ( int i = 0; i < mOptions->maxGeoMipMapLevel; i++ )
+        {
+            if ( mMinLevelDistSqr[ i ] > L )
+            {
+                mRenderLevel = i - 1;
+                break;
+            }
+        }
+
+        if ( mRenderLevel < 0 )
+            mRenderLevel = mOptions->maxGeoMipMapLevel - 1;
+
+        if (mOptions->lodMorph)
+        {
+            // Get the next LOD level down
+            int nextLevel = mNextLevelDown[mRenderLevel];
+            if (nextLevel == 0)
+            {
+                // No next level, so never morph
+                mLODMorphFactor = 0;
+            }
+            else
+            {
+                // Set the morph such that the morph happens in the last 0.25 of
+                // the distance range
+                Real range = mMinLevelDistSqr[nextLevel] - mMinLevelDistSqr[mRenderLevel];
+                if (range)
+                {
+                    Real percent = (L - mMinLevelDistSqr[mRenderLevel]) / range;
+                    // scale result so that msLODMorphStart == 0, 1 == 1, clamp to 0 below that
+                    Real rescale = 1.0f / (1.0f - mOptions->lodMorphStart);
+                    mLODMorphFactor = std::max((percent - mOptions->lodMorphStart) * rescale, 
+						static_cast<Real>(0.0));
+                }
+                else
+                {
+                    // Identical ranges
+                    mLODMorphFactor = 0.0f;
+                }
+
+                assert(mLODMorphFactor >= 0 && mLODMorphFactor <= 1);
+            }
+
+            // Bind the correct delta buffer if it has changed
+            // nextLevel - 1 since the first entry is for LOD 1 (since LOD 0 never needs it)
+            if (mLastNextLevel != nextLevel)
+            {
+                if (nextLevel > 0)
+                {
+                    mTerrain->vertexBufferBinding->setBinding(DELTA_BINDING, 
+                        mDeltaBuffers[nextLevel - 1]);
+                }
+                else
+                {
+                    // bind dummy (incase bindings checked)
+                    mTerrain->vertexBufferBinding->setBinding(DELTA_BINDING, 
+                        mDeltaBuffers[0]);
+                }
+            }
+            mLastNextLevel = nextLevel;
+
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void TerrainRenderable::_updateRenderQueue( RenderQueue* queue )
+    {
+        // Notify need to calculate light list when our sending to render queue
+        mLightListDirty = true;
+
+        queue->addRenderable(this, mRenderQueueID);
+    }
+    //-----------------------------------------------------------------------
+    void TerrainRenderable::getRenderOperation( RenderOperation& op )
+    {
+        //setup indexes for vertices and uvs...
+
+        assert( mInit && "Uninitialized" );
+
+        op.useIndexes = true;
+        op.operationType = mOptions->useTriStrips ? 
+            RenderOperation::OT_TRIANGLE_STRIP : RenderOperation::OT_TRIANGLE_LIST;
+        op.vertexData = mTerrain;
+        op.indexData = getIndexData();
+
+
+    }
+    //-----------------------------------------------------------------------
+    void TerrainRenderable::getWorldTransforms( Matrix4* xform ) const
+    {
+        *xform = mParentNode->_getFullTransform();
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& TerrainRenderable::getWorldOrientation(void) const
+    {
+        return mParentNode->_getDerivedOrientation();
+    }
+    //-----------------------------------------------------------------------
+    const Vector3& TerrainRenderable::getWorldPosition(void) const
+    {
+        return mParentNode->_getDerivedPosition();
+    }
+    //-----------------------------------------------------------------------
+    bool TerrainRenderable::_checkSize( int n )
+    {
+        for ( int i = 0; i < 10; i++ )
+        {
+            if ( ( ( 1 << i ) + 1 ) == n )
+                return true;
+        }
+
+        return false;
+    }
+    //-----------------------------------------------------------------------
+    void TerrainRenderable::_calculateMinLevelDist2( Real C )
+    {
+        //level 0 has no delta.
+        mMinLevelDistSqr[ 0 ] = 0;
+
+        int i, j;
+
+        for ( int level = 1; level < mOptions->maxGeoMipMapLevel; level++ )
+        {
+            mMinLevelDistSqr[ level ] = 0;
+
+            int step = 1 << level;
+            // The step of the next higher LOD
+            int higherstep = step >> 1;
+
+            float* pDeltas = 0;
+            if (mOptions->lodMorph)
+            {
+                // Create a set of delta values (store at index - 1 since 0 has none)
+                mDeltaBuffers[level - 1]  = createDeltaBuffer();
+                // Lock, but don't discard (we want the pre-initialised zeros)
+                pDeltas = static_cast<float*>(
+                    mDeltaBuffers[level - 1]->lock(HardwareBuffer::HBL_NORMAL));
+            }
+
+            for ( j = 0; j < mOptions->tileSize - step; j += step )
+            {
+                for ( i = 0; i < mOptions->tileSize - step; i += step )
+                {
+                    /* Form planes relating to the lower detail tris to be produced
+                    For tri lists and even tri strip rows, they are this shape:
+                    x---x
+                    | / |
+                    x---x
+                    For odd tri strip rows, they are this shape:
+                    x---x
+                    | \ |
+                    x---x
+                    */
+
+                    Vector3 v1(_vertex( i, j, 0 ), _vertex( i, j, 1 ), _vertex( i, j, 2 ));
+                    Vector3 v2(_vertex( i + step, j, 0 ), _vertex( i + step, j, 1 ), _vertex( i + step, j, 2 ));
+                    Vector3 v3(_vertex( i, j + step, 0 ), _vertex( i, j + step, 1 ), _vertex( i, j + step, 2 ));
+                    Vector3 v4(_vertex( i + step, j + step, 0 ), _vertex( i + step, j + step, 1 ), _vertex( i + step, j + step, 2 ));
+
+                    Plane t1, t2;
+                    bool backwardTri = false;
+                    if (!mOptions->useTriStrips || j % 2 == 0)
+                    {
+                        t1.redefine(v1, v3, v2);
+                        t2.redefine(v2, v3, v4);
+                    }
+                    else
+                    {
+                        t1.redefine(v1, v3, v4);
+                        t2.redefine(v1, v4, v2);
+                        backwardTri = true;
+                    }
+
+                    // include the bottommost row of vertices if this is the last row
+                    int zubound = (j == (mOptions->tileSize - step)? step : step - 1);
+                    for ( int z = 0; z <= zubound; z++ )
+                    {
+                        // include the rightmost col of vertices if this is the last col
+                        int xubound = (i == (mOptions->tileSize - step)? step : step - 1);
+                        for ( int x = 0; x <= xubound; x++ )
+                        {
+                            int fulldetailx = i + x;
+                            int fulldetailz = j + z;
+                            if ( fulldetailx % step == 0 && 
+                                fulldetailz % step == 0 )
+                            {
+                                // Skip, this one is a vertex at this level
+                                continue;
+                            }
+
+                            Real zpct = (Real)z / (Real)step;
+                            Real xpct = (Real)x / (Real)step;
+
+                            //interpolated height
+                            Vector3 actualPos(
+                                _vertex( fulldetailx, fulldetailz, 0 ), 
+                                _vertex( fulldetailx, fulldetailz, 1 ), 
+                                _vertex( fulldetailx, fulldetailz, 2 ));
+                            Real interp_h;
+                            // Determine which tri we're on 
+                            if ((xpct + zpct <= 1.0f && !backwardTri) ||
+                                (xpct + (1-zpct) <= 1.0f && backwardTri))
+                            {
+                                // Solve for x/z
+                                interp_h = 
+                                    (-(t1.normal.x * actualPos.x)
+                                    - t1.normal.z * actualPos.z
+                                    - t1.d) / t1.normal.y;
+                            }
+                            else
+                            {
+                                // Second tri
+                                interp_h = 
+                                    (-(t2.normal.x * actualPos.x)
+                                    - t2.normal.z * actualPos.z
+                                    - t2.d) / t2.normal.y;
+                            }
+
+                            Real actual_h = _vertex( fulldetailx, fulldetailz, 1 );
+                            Real delta = fabs( interp_h - actual_h );
+
+                            Real D2 = delta * delta * C * C;
+
+                            if ( mMinLevelDistSqr[ level ] < D2 )
+                                mMinLevelDistSqr[ level ] = D2;
+
+                            // Should be save height difference?
+                            // Don't morph along edges
+                            if (mOptions->lodMorph && 
+                                fulldetailx != 0  && fulldetailx != (mOptions->tileSize - 1) && 
+                                fulldetailz != 0  && fulldetailz != (mOptions->tileSize - 1) )
+                            {
+                                // Save height difference 
+                                pDeltas[fulldetailx + (fulldetailz * mOptions->tileSize)] = 
+                                    interp_h - actual_h;
+                            }
+
+                        }
+
+                    }
+                }
+            }
+
+            // Unlock morph deltas if required
+            if (mOptions->lodMorph)
+            {
+                mDeltaBuffers[level - 1]->unlock();
+            }
+        }
+
+
+
+        // Post validate the whole set
+        for ( i = 1; i < mOptions->maxGeoMipMapLevel; i++ )
+        {
+
+            // Make sure no LOD transition within the tile
+            // This is especially a problem when using large tiles with flat areas
+            /* Hmm, this can look bad on some areas, disable for now
+            Vector3 delta(_vertex(0,0,0), mCenter.y, _vertex(0,0,2));
+            delta = delta - mCenter;
+            Real minDist = delta.squaredLength();
+            mMinLevelDistSqr[ i ] = std::max(mMinLevelDistSqr[ i ], minDist);
+            */
+
+            //make sure the levels are increasing...
+            if ( mMinLevelDistSqr[ i ] < mMinLevelDistSqr[ i - 1 ] )
+            {
+                mMinLevelDistSqr[ i ] = mMinLevelDistSqr[ i - 1 ];
+            }
+        }
+
+        // Now reverse traverse the list setting the 'next level down'
+        Real lastDist = -1;
+        int lastIndex = 0;
+        for (i = mOptions->maxGeoMipMapLevel - 1; i >= 0; --i)
+        {
+            if (i == mOptions->maxGeoMipMapLevel - 1)
+            {
+                // Last one is always 0
+                lastIndex = i;
+                lastDist = mMinLevelDistSqr[i];
+                mNextLevelDown[i] = 0;
+            }
+            else
+            {
+                mNextLevelDown[i] = lastIndex;
+                if (mMinLevelDistSqr[i] != lastDist)
+                {
+                    lastIndex = i;
+                    lastDist = mMinLevelDistSqr[i];
+                }
+            }
+
+        }
+
+
+    }
+    //-----------------------------------------------------------------------
+    void TerrainRenderable::_adjustRenderLevel( int i )
+    {
+
+        mRenderLevel = i;
+    }
+    //-----------------------------------------------------------------------
+    Real TerrainRenderable::_calculateCFactor()
+    {
+        Real A, T;
+
+        if (!mOptions->primaryCamera)
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "You have not created a camera yet!", 
+                "TerrainRenderable::_calculateCFactor");
+        }
+
+        //A = 1 / Math::Tan(Math::AngleUnitsToRadians(opts.primaryCamera->getFOVy()));
+        // Turn off detail compression at higher FOVs
+        A = 1.0f;
+
+        int vertRes = mOptions->primaryCamera->getViewport()->getActualHeight();
+
+        T = 2 * ( Real ) mOptions->maxPixelError / ( Real ) vertRes;
+
+        return A / T;
+    }
+    //-----------------------------------------------------------------------
+    float TerrainRenderable::getHeightAt( float x, float z )
+    {
+        Vector3 start;
+        Vector3 end;
+
+        start.x = _vertex( 0, 0, 0 );
+        start.y = _vertex( 0, 0, 1 );
+        start.z = _vertex( 0, 0, 2 );
+
+        end.x = _vertex( mOptions->tileSize - 1, mOptions->tileSize - 1, 0 );
+        end.y = _vertex( mOptions->tileSize - 1, mOptions->tileSize - 1, 1 );
+        end.z = _vertex( mOptions->tileSize - 1, mOptions->tileSize - 1, 2 );
+
+        /* Safety catch, if the point asked for is outside
+        * of this tile, it will ask the appropriate tile
+        */
+
+        if ( x < start.x )
+        {
+            if ( mNeighbors[ WEST ] != 0 )
+                return mNeighbors[ WEST ] ->getHeightAt( x, z );
+            else
+                x = start.x;
+        }
+
+        if ( x > end.x )
+        {
+            if ( mNeighbors[ EAST ] != 0 )
+                return mNeighbors[ EAST ] ->getHeightAt( x, z );
+            else
+                x = end.x;
+        }
+
+        if ( z < start.z )
+        {
+            if ( mNeighbors[ NORTH ] != 0 )
+                return mNeighbors[ NORTH ] ->getHeightAt( x, z );
+            else
+                z = start.z;
+        }
+
+        if ( z > end.z )
+        {
+            if ( mNeighbors[ SOUTH ] != 0 )
+                return mNeighbors[ SOUTH ] ->getHeightAt( x, z );
+            else
+                z = end.z;
+        }
+
+
+
+        float x_pct = ( x - start.x ) / ( end.x - start.x );
+        float z_pct = ( z - start.z ) / ( end.z - start.z );
+
+        float x_pt = x_pct * ( float ) ( mOptions->tileSize - 1 );
+        float z_pt = z_pct * ( float ) ( mOptions->tileSize - 1 );
+
+        int x_index = ( int ) x_pt;
+        int z_index = ( int ) z_pt;
+
+        // If we got to the far right / bottom edge, move one back
+        if (x_index == mOptions->tileSize - 1)
+        {
+            --x_index;
+            x_pct = 1.0f;
+        }
+        else
+        {
+            // get remainder
+            x_pct = x_pt - x_index;
+        }
+        if (z_index == mOptions->tileSize - 1)
+        {
+            --z_index;
+            z_pct = 1.0f;
+        }
+        else
+        {
+            z_pct = z_pt - z_index;
+        }
+
+        //bilinear interpolate to find the height.
+
+        float t1 = _vertex( x_index, z_index, 1 );
+        float t2 = _vertex( x_index + 1, z_index, 1 );
+        float b1 = _vertex( x_index, z_index + 1, 1 );
+        float b2 = _vertex( x_index + 1, z_index + 1, 1 );
+
+        float midpoint = (b1 + t2) / 2.0;
+
+        if (x_pct + z_pct <= 1) {
+            b2 = midpoint + (midpoint - t1);
+        } else {
+            t1 = midpoint + (midpoint - b2);
+        }
+
+        float t = ( t1 * ( 1 - x_pct ) ) + ( t2 * ( x_pct ) );
+        float b = ( b1 * ( 1 - x_pct ) ) + ( b2 * ( x_pct ) );
+
+        float h = ( t * ( 1 - z_pct ) ) + ( b * ( z_pct ) );
+
+        return h;
+    }
+    //-----------------------------------------------------------------------
+    bool TerrainRenderable::intersectSegment( const Vector3 & start, const Vector3 & end, Vector3 * result )
+    {
+        Vector3 dir = end - start;
+        Vector3 ray = start;
+
+        //special case...
+        if ( dir.x == 0 && dir.z == 0 )
+        {
+            if ( ray.y <= getHeightAt( ray.x, ray.z ) )
+            {
+                if ( result != 0 )
+                    * result = start;
+
+                return true;
+            }
+        }
+
+        dir.normalise();
+
+        //dir.x *= mScale.x;
+        //dir.y *= mScale.y;
+        //dir.z *= mScale.z;
+
+        const AxisAlignedBox& box = getBoundingBox();
+        //start with the next one...
+        ray += dir;
+
+
+        while ( ! ( ( ray.x < box.getMinimum().x ) ||
+            ( ray.x > box.getMaximum().x ) ||
+            ( ray.z < box.getMinimum().z ) ||
+            ( ray.z > box.getMaximum().z ) ) )
+        {
+
+
+            float h = getHeightAt( ray.x, ray.z );
+
+            if ( ray.y <= h )
+            {
+                if ( result != 0 )
+                    * result = ray;
+
+                return true;
+            }
+
+            else
+            {
+                ray += dir;
+            }
+
+        }
+
+        if ( ray.x < box.getMinimum().x && mNeighbors[ WEST ] != 0 )
+            return mNeighbors[ WEST ] ->intersectSegment( ray, end, result );
+        else if ( ray.z < box.getMinimum().z && mNeighbors[ NORTH ] != 0 )
+            return mNeighbors[ NORTH ] ->intersectSegment( ray, end, result );
+        else if ( ray.x > box.getMaximum().x && mNeighbors[ EAST ] != 0 )
+            return mNeighbors[ EAST ] ->intersectSegment( ray, end, result );
+        else if ( ray.z > box.getMaximum().z && mNeighbors[ SOUTH ] != 0 )
+            return mNeighbors[ SOUTH ] ->intersectSegment( ray, end, result );
+        else
+        {
+            if ( result != 0 )
+                * result = Vector3( -1, -1, -1 );
+
+            return false;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void TerrainRenderable::_generateVertexLighting( const Vector3 &sunlight, ColourValue ambient )
+    {
+
+        Vector3 pt;
+        Vector3 normal;
+        Vector3 light;
+
+        HardwareVertexBufferSharedPtr vbuf = 
+            mTerrain->vertexBufferBinding->getBuffer(MAIN_BINDING);
+        const VertexElement* elem = mTerrain->vertexDeclaration->findElementBySemantic(VES_DIFFUSE);
+        //for each point in the terrain, see if it's in the line of sight for the sun.
+        for ( size_t i = 0; i < mOptions->tileSize; i++ )
+        {
+            for ( size_t j = 0; j < mOptions->tileSize; j++ )
+            {
+                //  printf( "Checking %f,%f,%f ", pt.x, pt.y, pt.z );
+                pt.x = _vertex( i, j, 0 );
+                pt.y = _vertex( i, j, 1 );
+                pt.z = _vertex( i, j, 2 );
+
+                light = sunlight - pt;
+
+                light.normalise();
+
+                if ( ! intersectSegment( pt, sunlight, 0 ) )
+                {
+                    //
+                    _getNormalAt( _vertex( i, j, 0 ), _vertex( i, j, 2 ), &normal );
+
+                    float l = light.dotProduct( normal );
+
+                    ColourValue v;
+                    v.r = ambient.r + l;
+                    v.g = ambient.g + l;
+                    v.b = ambient.b + l;
+
+                    if ( v.r > 1 ) v.r = 1;
+
+                    if ( v.g > 1 ) v.g = 1;
+
+                    if ( v.b > 1 ) v.b = 1;
+
+                    if ( v.r < 0 ) v.r = 0;
+
+                    if ( v.g < 0 ) v.g = 0;
+
+                    if ( v.b < 0 ) v.b = 0;
+
+                    RGBA colour;
+                    Root::getSingleton().convertColourValue( v, &colour );
+                    vbuf->writeData(
+                        (_index( i, j ) * vbuf->getVertexSize()) + elem->getOffset(),
+                        sizeof(RGBA), &colour);
+                }
+
+                else
+                {
+                    RGBA colour;
+                    Root::getSingleton().convertColourValue( ambient, &colour );
+
+                    vbuf->writeData(
+                        (_index( i, j ) * vbuf->getVertexSize()) + elem->getOffset(), 
+                        sizeof(RGBA), &colour);
+                }
+
+            }
+
+        }
+
+        printf( "." );
+    }
+    //-----------------------------------------------------------------------
+    Real TerrainRenderable::getSquaredViewDepth(const Camera* cam) const
+    {
+        Vector3 diff = mCenter - cam->getDerivedPosition();
+        // Use squared length to avoid square root
+        return diff.squaredLength();
+    }
+
+    //-----------------------------------------------------------------------
+    const LightList& TerrainRenderable::getLights(void) const
+    {
+        if (mLightListDirty)
+        {
+            getParentSceneNode()->getCreator()->_populateLightList(
+                mCenter, this->getBoundingRadius(), mLightList);
+            mLightListDirty = false;
+        }
+        return mLightList;
+    }
+    //-----------------------------------------------------------------------
+    IndexData* TerrainRenderable::getIndexData(void)
+    {
+        unsigned int stitchFlags = 0;
+
+        if ( mNeighbors[ EAST ] != 0 && mNeighbors[ EAST ] -> mRenderLevel > mRenderLevel )
+        {
+            stitchFlags |= STITCH_EAST;
+            stitchFlags |= 
+                (mNeighbors[ EAST ] -> mRenderLevel - mRenderLevel) << STITCH_EAST_SHIFT;
+        }
+
+        if ( mNeighbors[ WEST ] != 0 && mNeighbors[ WEST ] -> mRenderLevel > mRenderLevel )
+        {
+            stitchFlags |= STITCH_WEST;
+            stitchFlags |= 
+                (mNeighbors[ WEST ] -> mRenderLevel - mRenderLevel) << STITCH_WEST_SHIFT;
+        }
+
+        if ( mNeighbors[ NORTH ] != 0 && mNeighbors[ NORTH ] -> mRenderLevel > mRenderLevel )
+        {
+            stitchFlags |= STITCH_NORTH;
+            stitchFlags |= 
+                (mNeighbors[ NORTH ] -> mRenderLevel - mRenderLevel) << STITCH_NORTH_SHIFT;
+        }
+
+        if ( mNeighbors[ SOUTH ] != 0 && mNeighbors[ SOUTH ] -> mRenderLevel > mRenderLevel )
+        {
+            stitchFlags |= STITCH_SOUTH;
+            stitchFlags |= 
+                (mNeighbors[ SOUTH ] -> mRenderLevel - mRenderLevel) << STITCH_SOUTH_SHIFT;
+        }
+
+        // Check preexisting
+		LevelArray& levelIndex = mSceneManager->_getLevelIndex();
+        IndexMap::iterator ii = levelIndex[ mRenderLevel ]->find( stitchFlags );
+        IndexData* indexData;
+        if ( ii == levelIndex[ mRenderLevel ]->end())
+        {
+            // Create
+            if (mOptions->useTriStrips)
+            {
+                indexData = generateTriStripIndexes(stitchFlags);
+            }
+            else
+            {
+                indexData = generateTriListIndexes(stitchFlags);
+            }
+            levelIndex[ mRenderLevel ]->insert(
+                IndexMap::value_type(stitchFlags, indexData));
+        }
+        else
+        {
+            indexData = ii->second;
+        }
+
+
+        return indexData;
+
+
+    }
+    //-----------------------------------------------------------------------
+    IndexData* TerrainRenderable::generateTriStripIndexes(unsigned int stitchFlags)
+    {
+        // The step used for the current level
+        int step = 1 << mRenderLevel;
+        // The step used for the lower level
+        int lowstep = 1 << (mRenderLevel + 1);
+
+        int numIndexes = 0;
+
+        // Calculate the number of indexes required
+        // This is the number of 'cells' at this detail level x 2
+        // plus 3 degenerates to turn corners
+        int numTrisAcross = (((mOptions->tileSize-1) / step) * 2) + 3;
+        // Num indexes is number of tris + 2
+        int new_length = numTrisAcross * ((mOptions->tileSize-1) / step) + 2;
+        //this is the maximum for a level.  It wastes a little, but shouldn't be a problem.
+
+        IndexData* indexData = new IndexData;
+        indexData->indexBuffer = 
+            HardwareBufferManager::getSingleton().createIndexBuffer(
+            HardwareIndexBuffer::IT_16BIT,
+            new_length, HardwareBuffer::HBU_STATIC_WRITE_ONLY);//, false);
+
+        mSceneManager->_getIndexCache().mCache.push_back( indexData );
+
+        unsigned short* pIdx = static_cast<unsigned short*>(
+            indexData->indexBuffer->lock(0, 
+            indexData->indexBuffer->getSizeInBytes(), 
+            HardwareBuffer::HBL_DISCARD));
+
+        // Stripified mesh
+        for ( int j = 0; j < mOptions->tileSize - 1; j += step )
+        {
+            int i;
+            // Forward strip
+            // We just do the |/ here, final | done after
+            for ( i = 0; i < mOptions->tileSize - 1; i += step )
+            {
+                int x[4], y[4];
+                x[0] = x[1] = i;
+                x[2] = x[3] = i + step;
+                y[0] = y[2] = j;
+                y[1] = y[3] = j + step;
+
+                if (j == 0  && (stitchFlags & STITCH_NORTH))
+                {
+                    // North reduction means rounding x[0] and x[2]
+                    if (x[0] % lowstep != 0)
+                    {
+                        // Since we know we only drop down one level of LOD,
+                        // removing 1 step of higher LOD should return to lower
+                        x[0] -= step;
+                    }
+                    if (x[2] % lowstep != 0)
+                    {
+                        x[2] -= step;
+                    }
+                }
+
+                // Never get a south tiling on a forward strip (always finish on 
+                // a backward strip)
+
+                if (i == 0  && (stitchFlags & STITCH_WEST))
+                {
+                    // West reduction means rounding y[0] / y[1]
+                    if (y[0] % lowstep != 0)
+                    {
+                        y[0] -= step;
+                    }
+                    if (y[1] % lowstep != 0)
+                    {
+                        y[1] -= step;
+                    }
+                }
+                if (i == (mOptions->tileSize - 1 - step) && (stitchFlags & STITCH_EAST))
+                {
+                    // East tiling means rounding y[2] & y[3]
+                    if (y[2] % lowstep != 0)
+                    {
+                        y[2] -= step;
+                    }
+                    if (y[3] % lowstep != 0)
+                    {
+                        y[3] -= step;
+                    }
+                }
+
+                //triangles
+                if (i == 0)
+                {
+                    // Starter
+                    *pIdx++ = _index( x[0], y[0] ); numIndexes++;
+                }
+                *pIdx++ = _index( x[1], y[1] ); numIndexes++;
+                *pIdx++ = _index( x[2], y[2] ); numIndexes++;
+
+                if (i == mOptions->tileSize - 1 - step)
+                {
+                    // Emit extra index to finish row
+                    *pIdx++ = _index( x[3], y[3] ); numIndexes++;
+                    if (j < mOptions->tileSize - 1 - step)
+                    {
+                        // Emit this index twice more (this is to turn around without
+                        // artefacts)
+                        // ** Hmm, looks like we can drop this and it's unnoticeable
+                        //*pIdx++ = _index( x[3], y[3] ); numIndexes++;
+                        //*pIdx++ = _index( x[3], y[3] ); numIndexes++;
+                    }
+                }
+
+            }
+            // Increment row
+            j += step;
+            // Backward strip
+            for ( i = mOptions->tileSize - 1; i > 0 ; i -= step )
+            {
+                int x[4], y[4];
+                x[0] = x[1] = i;
+                x[2] = x[3] = i - step;
+                y[0] = y[2] = j;
+                y[1] = y[3] = j + step;
+
+                // Never get a north tiling on a backward strip (always
+                // start on a forward strip)
+                if (j == (mOptions->tileSize - 1 - step) && (stitchFlags & STITCH_SOUTH))
+                {
+                    // South reduction means rounding x[1] / x[3]
+                    if (x[1] % lowstep != 0)
+                    {
+                        x[1] -= step;
+                    }
+                    if (x[3] % lowstep != 0)
+                    {
+                        x[3] -= step;
+                    }
+                }
+
+                if (i == step  && (stitchFlags & STITCH_WEST))
+                {
+                    // West tiling on backward strip is rounding of y[2] / y[3]
+                    if (y[2] % lowstep != 0)
+                    {
+                        y[2] -= step;
+                    }
+                    if (y[3] % lowstep != 0)
+                    {
+                        y[3] -= step;
+                    }
+                }
+                if (i == mOptions->tileSize - 1 && (stitchFlags & STITCH_EAST))
+                {
+                    // East tiling means rounding y[0] and y[1] on backward strip
+                    if (y[0] % lowstep != 0)
+                    {
+                        y[0] -= step;
+                    }
+                    if (y[1] % lowstep != 0)
+                    {
+                        y[1] -= step;
+                    }
+                }
+
+                //triangles
+                if (i == mOptions->tileSize)
+                {
+                    // Starter
+                    *pIdx++ = _index( x[0], y[0] ); numIndexes++;
+                }
+                *pIdx++ = _index( x[1], y[1] ); numIndexes++;
+                *pIdx++ = _index( x[2], y[2] ); numIndexes++;
+
+                if (i == step)
+                {
+                    // Emit extra index to finish row
+                    *pIdx++ = _index( x[3], y[3] ); numIndexes++;
+                    if (j < mOptions->tileSize - 1 - step)
+                    {
+                        // Emit this index once more (this is to turn around)
+                        *pIdx++ = _index( x[3], y[3] ); numIndexes++;
+                    }
+                }
+            }
+        }
+
+
+        indexData->indexBuffer->unlock();
+        indexData->indexCount = numIndexes;
+        indexData->indexStart = 0;
+
+        return indexData;
+
+    }
+    //-----------------------------------------------------------------------
+    IndexData* TerrainRenderable::generateTriListIndexes(unsigned int stitchFlags)
+    {
+
+        int numIndexes = 0;
+        int step = 1 << mRenderLevel;
+
+        IndexData* indexData = 0;
+
+        int north = stitchFlags & STITCH_NORTH ? step : 0;
+        int south = stitchFlags & STITCH_SOUTH ? step : 0;
+        int east = stitchFlags & STITCH_EAST ? step : 0;
+        int west = stitchFlags & STITCH_WEST ? step : 0;
+
+        int new_length = ( mOptions->tileSize / step ) * ( mOptions->tileSize / step ) * 2 * 2 * 2 ;
+        //this is the maximum for a level.  It wastes a little, but shouldn't be a problem.
+
+        indexData = new IndexData;
+        indexData->indexBuffer = 
+            HardwareBufferManager::getSingleton().createIndexBuffer(
+            HardwareIndexBuffer::IT_16BIT,
+            new_length, HardwareBuffer::HBU_STATIC_WRITE_ONLY);//, false);
+
+        mSceneManager->_getIndexCache().mCache.push_back( indexData );
+
+        unsigned short* pIdx = static_cast<unsigned short*>(
+            indexData->indexBuffer->lock(0, 
+            indexData->indexBuffer->getSizeInBytes(), 
+            HardwareBuffer::HBL_DISCARD));
+
+        // Do the core vertices, minus stitches
+        for ( int j = north; j < mOptions->tileSize - 1 - south; j += step )
+        {
+            for ( int i = west; i < mOptions->tileSize - 1 - east; i += step )
+            {
+                //triangles
+                *pIdx++ = _index( i, j ); numIndexes++;
+                *pIdx++ = _index( i, j + step ); numIndexes++;
+                *pIdx++ = _index( i + step, j ); numIndexes++;
+
+                *pIdx++ = _index( i, j + step ); numIndexes++;
+                *pIdx++ = _index( i + step, j + step ); numIndexes++;
+                *pIdx++ = _index( i + step, j ); numIndexes++;
+            }
+        }
+
+        // North stitching
+        if ( north > 0 )
+        {
+            numIndexes += stitchEdge(NORTH, mRenderLevel, mNeighbors[NORTH]->mRenderLevel,
+                west > 0, east > 0, &pIdx);
+        }
+        // East stitching
+        if ( east > 0 )
+        {
+            numIndexes += stitchEdge(EAST, mRenderLevel, mNeighbors[EAST]->mRenderLevel,
+                north > 0, south > 0, &pIdx);
+        }
+        // South stitching
+        if ( south > 0 )
+        {
+            numIndexes += stitchEdge(SOUTH, mRenderLevel, mNeighbors[SOUTH]->mRenderLevel,
+                east > 0, west > 0, &pIdx);
+        }
+        // West stitching
+        if ( west > 0 )
+        {
+            numIndexes += stitchEdge(WEST, mRenderLevel, mNeighbors[WEST]->mRenderLevel,
+                south > 0, north > 0, &pIdx);
+        }
+
+
+        indexData->indexBuffer->unlock();
+        indexData->indexCount = numIndexes;
+        indexData->indexStart = 0;
+
+        return indexData;
+    }
+    //-----------------------------------------------------------------------
+    HardwareVertexBufferSharedPtr TerrainRenderable::createDeltaBuffer(void)
+    {
+        // Delta buffer is a 1D float buffer of height offsets
+        HardwareVertexBufferSharedPtr buf = 
+            HardwareBufferManager::getSingleton().createVertexBuffer(
+            VertexElement::getTypeSize(VET_FLOAT1), 
+            mOptions->tileSize * mOptions->tileSize,
+            HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+        // Fill the buffer with zeros, we will only fill in delta
+        void* pVoid = buf->lock(HardwareBuffer::HBL_DISCARD);
+        memset(pVoid, 0, mOptions->tileSize * mOptions->tileSize * sizeof(float));
+        buf->unlock();
+
+        return buf;
+
+    }
+    //-----------------------------------------------------------------------
+    void TerrainRenderable::_updateCustomGpuParameter(
+        const GpuProgramParameters::AutoConstantEntry& constantEntry, 
+        GpuProgramParameters* params) const
+    {
+        if (constantEntry.data == MORPH_CUSTOM_PARAM_ID)
+        {
+            // Update morph LOD factor
+            params->_writeRawConstant(constantEntry.physicalIndex, mLODMorphFactor);
+        }
+        else
+        {
+            Renderable::_updateCustomGpuParameter(constantEntry, params);
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    int TerrainRenderable::stitchEdge(Neighbor neighbor, int hiLOD, int loLOD, 
+        bool omitFirstTri, bool omitLastTri, unsigned short** ppIdx)
+    {
+        assert(loLOD > hiLOD);
+        /* 
+        Now do the stitching; we can stitch from any level to any level.
+        The stitch pattern is like this for each pair of vertices in the lower LOD
+        (excuse the poor ascii art):
+
+        lower LOD
+        *-----------*
+        |\  \ 3 /  /|
+        |1\2 \ / 4/5|
+        *--*--*--*--*
+        higher LOD
+
+        The algorithm is, for each pair of lower LOD vertices:
+        1. Iterate over the higher LOD vertices, generating tris connected to the 
+        first lower LOD vertex, up to and including 1/2 the span of the lower LOD 
+        over the higher LOD (tris 1-2). Skip the first tri if it is on the edge 
+        of the tile and that edge is to be stitched itself.
+        2. Generate a single tri for the middle using the 2 lower LOD vertices and 
+        the middle vertex of the higher LOD (tri 3). 
+        3. Iterate over the higher LOD vertices from 1/2 the span of the lower LOD
+        to the end, generating tris connected to the second lower LOD vertex 
+        (tris 4-5). Skip the last tri if it is on the edge of a tile and that
+        edge is to be stitched itself.
+
+        The same algorithm works for all edges of the patch; stitching is done
+        clockwise so that the origin and steps used change, but the general
+        approach does not.
+        */
+
+        // Get pointer to be updated
+        unsigned short* pIdx = *ppIdx;
+
+        // Work out the steps ie how to increment indexes
+        // Step from one vertex to another in the high detail version
+        int step = 1 << hiLOD;
+        // Step from one vertex to another in the low detail version
+        int superstep = 1 << loLOD;
+        // Step half way between low detail steps
+        int halfsuperstep = superstep >> 1;
+
+        // Work out the starting points and sign of increments
+        // We always work the strip clockwise
+        int startx, starty, endx, rowstep;
+        bool horizontal;
+        switch(neighbor)
+        {
+        case NORTH:
+            startx = starty = 0;
+            endx = mOptions->tileSize - 1;
+            rowstep = step;
+            horizontal = true;
+            break;
+        case SOUTH:
+            // invert x AND y direction, helps to keep same winding
+            startx = starty = mOptions->tileSize - 1;
+            endx = 0;
+            rowstep = -step;
+            step = -step;
+            superstep = -superstep;
+            halfsuperstep = -halfsuperstep;
+            horizontal = true;
+            break;
+        case EAST:
+            startx = 0;
+            endx = mOptions->tileSize - 1;
+            starty = mOptions->tileSize - 1;
+            rowstep = -step;
+            horizontal = false;
+            break;
+        case WEST:
+            startx = mOptions->tileSize - 1;
+            endx = 0;
+            starty = 0;
+            rowstep = step;
+            step = -step;
+            superstep = -superstep;
+            halfsuperstep = -halfsuperstep;
+            horizontal = false;
+            break;
+        };
+
+        int numIndexes = 0;
+
+        for ( int j = startx; j != endx; j += superstep )
+        {
+            int k;
+            for (k = 0; k != halfsuperstep; k += step)
+            {
+                int jk = j + k;
+                //skip the first bit of the corner?
+                if ( j != startx || k != 0 || !omitFirstTri )
+                {
+                    if (horizontal)
+                    {
+                        *pIdx++ = _index( j , starty ); numIndexes++;
+                        *pIdx++ = _index( jk, starty + rowstep ); numIndexes++;
+                        *pIdx++ = _index( jk + step, starty + rowstep ); numIndexes++;
+                    }
+                    else
+                    {
+                        *pIdx++ = _index( starty, j ); numIndexes++;
+                        *pIdx++ = _index( starty + rowstep, jk ); numIndexes++;
+                        *pIdx++ = _index( starty + rowstep, jk + step); numIndexes++;
+                    }
+                }
+            }
+
+            // Middle tri
+            if (horizontal)
+            {
+                *pIdx++ = _index( j, starty ); numIndexes++;
+                *pIdx++ = _index( j + halfsuperstep, starty + rowstep); numIndexes++;
+                *pIdx++ = _index( j + superstep, starty ); numIndexes++;
+            }
+            else
+            {
+                *pIdx++ = _index( starty, j ); numIndexes++;
+                *pIdx++ = _index( starty + rowstep, j + halfsuperstep ); numIndexes++;
+                *pIdx++ = _index( starty, j + superstep ); numIndexes++;
+            }
+
+            for (k = halfsuperstep; k != superstep; k += step)
+            {
+                int jk = j + k;
+                if ( j != endx - superstep || k != superstep - step || !omitLastTri )
+                {
+                    if (horizontal)
+                    {
+                        *pIdx++ = _index( j + superstep, starty ); numIndexes++;
+                        *pIdx++ = _index( jk, starty + rowstep ); numIndexes++;
+                        *pIdx++ = _index( jk + step, starty + rowstep ); numIndexes++;
+                    }
+                    else
+                    {
+                        *pIdx++ = _index( starty, j + superstep ); numIndexes++;
+                        *pIdx++ = _index( starty + rowstep, jk ); numIndexes++;
+                        *pIdx++ = _index( starty + rowstep, jk + step ); numIndexes++;
+                    }
+                }
+            }
+        }
+
+        *ppIdx = pIdx;
+
+        return numIndexes;
+
+    }
+
+
+} //namespace
Index: /PlugIns/OctreeSceneManager/src/OgreTerrainSceneManager.cpp
===================================================================
--- /PlugIns/OctreeSceneManager/src/OgreTerrainSceneManager.cpp	(revision 5)
+++ /PlugIns/OctreeSceneManager/src/OgreTerrainSceneManager.cpp	(revision 5)
@@ -0,0 +1,1044 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/***************************************************************************
+terrainscenemanager.cpp  -  description
+-------------------
+begin                : Mon Sep 23 2002
+copyright            : (C) 2002 by Jon Anderson
+email                : janders@users.sf.net
+
+Enhancements 2003 - 2004 (C) The OGRE Team
+
+***************************************************************************/
+#include <OgreTerrainSceneManager.h>
+#include <OgreImage.h>
+#include <OgreConfigFile.h>
+#include <OgreMaterial.h>
+#include <OgreTechnique.h>
+#include <OgrePass.h>
+#include <OgreCamera.h>
+#include "OgreException.h"
+#include "OgreStringConverter.h"
+#include "OgreRenderSystem.h"
+#include "OgreRenderSystemCapabilities.h"
+#include "OgreGpuProgram.h"
+#include "OgreGpuProgramManager.h"
+#include "OgreTerrainVertexProgram.h"
+#include "OgreTerrainPage.h"
+#include "OgreLogManager.h"
+#include "OgreResourceGroupManager.h"
+#include "OgreMaterialManager.h"
+#include "OgreHeightmapTerrainPageSource.h"
+#include <fstream>
+
+#define TERRAIN_MATERIAL_NAME "TerrainSceneManager/Terrain"
+
+namespace Ogre
+{
+    //-------------------------------------------------------------------------
+    //-------------------------------------------------------------------------
+    TerrainSceneManager::TerrainSceneManager(const String& name) 
+		: OctreeSceneManager(name)
+    {
+        //setDisplaySceneNodes( true );
+        //setShowBoxes( true );
+
+        mUseCustomMaterial = false;
+        mUseNamedParameterLodMorph = false;
+        mLodMorphParamIndex = 3;
+        mTerrainRoot = 0;
+        mActivePageSource = 0;
+        mPagingEnabled = false;
+        mLivePageMargin = 0;
+        mBufferedPageMargin = 0;		
+
+
+    }
+	//-------------------------------------------------------------------------
+	const String& TerrainSceneManager::getTypeName(void) const
+	{
+		return TerrainSceneManagerFactory::FACTORY_TYPE_NAME;
+	}
+	//-------------------------------------------------------------------------
+	void TerrainSceneManager::shutdown(void)
+	{
+		// Make sure the indexes are destroyed during orderly shutdown
+		// and not when statics are destroyed (may be too late)
+		mIndexCache.shutdown();
+		destroyLevelIndexes();
+
+		// Make sure we free up material (static)
+		mOptions.terrainMaterial.setNull();
+
+		// Shut down page source to free terrain pages
+		if (mActivePageSource)
+		{
+			mActivePageSource->shutdown();
+		}
+
+	}
+    //-------------------------------------------------------------------------
+    TerrainSceneManager::~TerrainSceneManager()
+    {
+		shutdown();
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::loadConfig(DataStreamPtr& stream)
+    {
+        /* Set up the options */
+        ConfigFile config;
+        String val;
+
+        config.load( stream );
+
+        val = config.getSetting( "DetailTile" );
+        if ( !val.empty() )
+            setDetailTextureRepeat(atoi(val.c_str()));
+
+        val = config.getSetting( "MaxMipMapLevel" );
+        if ( !val.empty() )
+            setMaxGeoMipMapLevel(atoi( val.c_str() ));
+
+
+        val = config.getSetting( "PageSize" );
+        if ( !val.empty() )
+            setPageSize(atoi( val.c_str() ));
+        else
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Missing option 'PageSize'",
+            "TerrainSceneManager::loadConfig");
+
+
+        val = config.getSetting( "TileSize" );
+        if ( !val.empty() )
+            setTileSize(atoi( val.c_str() ));
+        else
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Missing option 'TileSize'",
+            "TerrainSceneManager::loadConfig");
+
+        Vector3 v = Vector3::UNIT_SCALE;
+
+        val = config.getSetting( "PageWorldX" );
+        if ( !val.empty() )
+            v.x = atof( val.c_str() );
+
+        val = config.getSetting( "MaxHeight" );
+        if ( !val.empty() )
+            v.y = atof( val.c_str() );
+
+        val = config.getSetting( "PageWorldZ" );
+        if ( !val.empty() )
+            v.z = atof( val.c_str() );
+
+        // Scale x/z relative to pagesize
+        v.x /= mOptions.pageSize - 1;
+        v.z /= mOptions.pageSize - 1;
+        setScale(v);
+
+        val = config.getSetting( "MaxPixelError" );
+        if ( !val.empty() )
+            setMaxPixelError(atoi( val.c_str() ));
+
+        mDetailTextureName = config.getSetting( "DetailTexture" );
+
+        mWorldTextureName = config.getSetting( "WorldTexture" );
+
+        if ( config.getSetting( "VertexColours" ) == "yes" )
+            mOptions.coloured = true;
+
+        if ( config.getSetting( "VertexNormals" ) == "yes" )
+            mOptions.lit = true;
+
+        if ( config.getSetting( "UseTriStrips" ) == "yes" )
+            setUseTriStrips(true);
+
+        if ( config.getSetting( "VertexProgramMorph" ) == "yes" )
+            setUseLODMorph(true);
+
+        val = config.getSetting( "LODMorphStart");
+        if ( !val.empty() )
+            setLODMorphStart(atof(val.c_str()));
+
+        val = config.getSetting( "CustomMaterialName" );
+        if ( !val.empty() )
+            setCustomMaterial(val);
+
+        val = config.getSetting( "MorphLODFactorParamName" );
+        if ( !val.empty() )
+            setCustomMaterialMorphFactorParam(val);
+
+        val = config.getSetting( "MorphLODFactorParamIndex" );
+        if ( !val.empty() )
+            setCustomMaterialMorphFactorParam(atoi(val.c_str()));
+
+        // Now scan through the remaining settings, looking for any PageSource
+        // prefixed items
+        String pageSourceName = config.getSetting("PageSource");
+        if (pageSourceName == "")
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Missing option 'PageSource'",
+            "TerrainSceneManager::loadConfig");
+        }
+        TerrainPageSourceOptionList optlist;
+        ConfigFile::SettingsIterator setIt = config.getSettingsIterator();
+        while (setIt.hasMoreElements())
+        {
+            String name = setIt.peekNextKey();
+            String value = setIt.getNext();
+            if (StringUtil::startsWith(name, pageSourceName, false))
+            {
+                optlist.push_back(TerrainPageSourceOption(name, value));
+            }
+        }
+        // set the page source
+        selectPageSource(pageSourceName, optlist);
+
+
+    }
+    //-------------------------------------------------------------------------
+    /*
+    void TerrainSceneManager::loadHeightmap(void)
+    {
+        Image image;
+
+        image.load( mHeightmapName );
+
+        //check to make sure it's 2^n + 1 size.
+        if ( image.getWidth() != image.getHeight() ||
+            ! _checkSize( image.getWidth() ) )
+        {
+            String err = "Error: Invalid heightmap size : " +
+                StringConverter::toString( image.getWidth() ) +
+                "," + StringConverter::toString( image.getHeight() ) +
+                ". Should be 2^n+1, 2^n+1";
+            OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, err, "TerrainSceneManager::loadHeightmap" );
+        }
+
+        int upperRange = 0;
+        int size = image.getWidth();
+
+        if ( image.getFormat() == PF_L8 )
+        {
+            upperRange = 255;
+
+            // Parse the char data into floats
+            mOptions.heightData = new Real[size*size];
+            const uchar* pSrc = image. getData();
+            Real* pDest = mOptions.heightData;
+            for (int i = 0; i < size*size; ++i)
+            {
+                *pDest++ = *pSrc++ * mOptions.scale.y;
+            }
+        }
+        else
+        {
+            OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, "Error: Image is not a grayscale image.",
+                "TerrainSceneManager::setWorldGeometry" );
+        }
+
+
+        // set up the octree size.
+        float max_x = mOptions.scale.x * size;
+
+        float max_y = upperRange * mOptions.scale.y;
+
+        float max_z = mOptions.scale.z * size;
+
+        resize( AxisAlignedBox( 0, 0, 0, max_x, max_y, max_z ) );
+
+        mOptions.pageSize = size;
+
+    }
+    */
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setupTerrainMaterial(void)
+    {
+        if (mCustomMaterialName == "")
+        {
+            // define our own material
+            mOptions.terrainMaterial = 
+                MaterialManager::getSingleton().getByName(TERRAIN_MATERIAL_NAME);
+			// Make unique terrain material name
+			StringUtil::StrStreamType s;
+			s << mName << "/Terrain";
+			mOptions.terrainMaterial = MaterialManager::getSingleton().getByName(s.str());
+            if (mOptions.terrainMaterial.isNull())
+            {
+                mOptions.terrainMaterial = MaterialManager::getSingleton().create(
+                    s.str(),
+                    ResourceGroupManager::getSingleton().getWorldResourceGroupName());
+
+            }
+            else
+            {
+                mOptions.terrainMaterial->getTechnique(0)->getPass(0)->removeAllTextureUnitStates();
+            }
+
+            Pass* pass = mOptions.terrainMaterial->getTechnique(0)->getPass(0);
+
+            if ( mWorldTextureName != "" )
+            {
+                pass->createTextureUnitState( mWorldTextureName, 0 );
+            }
+            if ( mDetailTextureName != "" )
+            {
+                pass->createTextureUnitState( mDetailTextureName, 1 );
+            }
+
+            mOptions.terrainMaterial -> setLightingEnabled( mOptions.lit );
+
+            if (mOptions.lodMorph && 
+                mDestRenderSystem->getCapabilities()->hasCapability(RSC_VERTEX_PROGRAM) &&
+				GpuProgramManager::getSingleton().getByName("Terrain/VertexMorph").isNull())
+            {
+                // Create & assign LOD morphing vertex program
+                String syntax;
+                if (GpuProgramManager::getSingleton().isSyntaxSupported("arbvp1"))
+                {
+                    syntax = "arbvp1";
+                }
+                else
+                {
+                    syntax = "vs_1_1";
+                }
+
+                // Get source, and take into account current fog mode
+                FogMode fm = getFogMode();
+                const String& source = TerrainVertexProgram::getProgramSource(
+                    fm, syntax);
+
+                GpuProgramPtr prog = GpuProgramManager::getSingleton().createProgramFromString(
+                    "Terrain/VertexMorph", ResourceGroupManager::getSingleton().getWorldResourceGroupName(), 
+                    source, GPT_VERTEX_PROGRAM, syntax);
+
+                // Attach
+                pass->setVertexProgram("Terrain/VertexMorph");
+
+                // Get params
+                GpuProgramParametersSharedPtr params = pass->getVertexProgramParameters();
+
+                // worldviewproj
+                params->setAutoConstant(0, GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);
+                // morph factor
+                params->setAutoConstant(4, GpuProgramParameters::ACT_CUSTOM, MORPH_CUSTOM_PARAM_ID);
+                // fog exp density(if relevant)
+                if (fm == FOG_EXP || fm == FOG_EXP2)
+                {
+                    params->setConstant(5, Vector3(getFogDensity(), 0, 0));
+                    // Override scene fog since otherwise it's applied twice
+                    // Set to linear and we derive [0,1] fog value in the shader
+                    pass->setFog(true, FOG_LINEAR, getFogColour(), 0, 1, 0);
+                }
+
+				// Also set shadow receiver program
+				const String& source2 = TerrainVertexProgram::getProgramSource(
+					fm, syntax, true);
+
+				prog = GpuProgramManager::getSingleton().createProgramFromString(
+					"Terrain/VertexMorphShadowReceive", 
+					ResourceGroupManager::getSingleton().getWorldResourceGroupName(), 
+					source2, GPT_VERTEX_PROGRAM, syntax);
+				pass->setShadowReceiverVertexProgram("Terrain/VertexMorphShadowReceive");
+				params = pass->getShadowReceiverVertexProgramParameters();
+				// worldviewproj
+				params->setAutoConstant(0, GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);
+				// world
+				params->setAutoConstant(4, GpuProgramParameters::ACT_WORLD_MATRIX);
+				// texture view / proj
+				params->setAutoConstant(8, GpuProgramParameters::ACT_TEXTURE_VIEWPROJ_MATRIX);
+				// morph factor
+				params->setAutoConstant(12, GpuProgramParameters::ACT_CUSTOM, MORPH_CUSTOM_PARAM_ID);
+
+
+                // Set param index
+                mLodMorphParamName = "";
+                mLodMorphParamIndex = 4;
+            }
+
+            mOptions.terrainMaterial->load();
+
+        }
+        else
+        {
+            // Custom material
+            mOptions.terrainMaterial = 
+                MaterialManager::getSingleton().getByName(mCustomMaterialName);
+            mOptions.terrainMaterial->load();
+
+        }
+
+        // now set up the linkage between vertex program and LOD morph param
+        if (mOptions.lodMorph)
+        {
+            Technique* t = mOptions.terrainMaterial->getBestTechnique();
+            for (ushort i = 0; i < t->getNumPasses(); ++i)
+            {
+                Pass* p = t->getPass(i);
+                if (p->hasVertexProgram())
+                {
+                    // we have to assume vertex program includes LOD morph capability
+                    GpuProgramParametersSharedPtr params = 
+                        p->getVertexProgramParameters();
+                    // Check to see if custom param is already there
+                    GpuProgramParameters::AutoConstantIterator aci = params->getAutoConstantIterator();
+                    bool found = false;
+                    while (aci.hasMoreElements())
+                    {
+                        const GpuProgramParameters::AutoConstantEntry& ace = aci.getNext();
+                        if (ace.paramType == GpuProgramParameters::ACT_CUSTOM && 
+                            ace.data == MORPH_CUSTOM_PARAM_ID)
+                        {
+                            found = true;
+                        }
+                    }
+                    if (!found)
+                    {
+                        if(mLodMorphParamName != "")
+                        {
+                            params->setNamedAutoConstant(mLodMorphParamName, 
+                                GpuProgramParameters::ACT_CUSTOM, MORPH_CUSTOM_PARAM_ID);
+                        }
+                        else
+                        {
+                            params->setAutoConstant(mLodMorphParamIndex, 
+                                GpuProgramParameters::ACT_CUSTOM, MORPH_CUSTOM_PARAM_ID);
+                        }
+                    }
+
+                }
+            }
+        }
+
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setupTerrainPages(void)
+    {
+
+        //create a root terrain node.
+        if (!mTerrainRoot)
+            mTerrainRoot = getRootSceneNode() -> createChildSceneNode( "Terrain" );
+
+        //setup the page array.
+        unsigned short pageSlots = 1 + (mBufferedPageMargin * 2);
+        unsigned short i, j;
+        for (i = 0; i < pageSlots; ++i)
+        {
+            mTerrainPages.push_back(TerrainPageRow());
+            for (j = 0; j < pageSlots; ++j)
+            {
+                mTerrainPages[i].push_back(0);
+            }
+        }
+
+		// If we're not paging, load immediate for convenience
+		if ( mActivePageSource && !mPagingEnabled )
+			mActivePageSource->requestPage(0,0);
+
+
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setWorldGeometry( const String& filename )
+    {
+		// try to open in the current folder first
+		std::ifstream fs;
+		fs.open(filename.c_str(), std::ios::in | std::ios::binary);
+		if (fs)
+		{
+			// Wrap as a stream
+			DataStreamPtr stream(
+				new FileStreamDataStream(filename, &fs, false));
+			setWorldGeometry(stream);
+		}
+		else
+		{
+			// otherwise try resource system
+			DataStreamPtr stream = 
+				ResourceGroupManager::getSingleton().openResource(filename, 
+					ResourceGroupManager::getSingleton().getWorldResourceGroupName());
+				
+			setWorldGeometry(stream);
+		}
+	}
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setWorldGeometry(DataStreamPtr& stream, const String& typeName )
+    {
+        // Clear out any existing world resources (if not default)
+        if (ResourceGroupManager::getSingleton().getWorldResourceGroupName() != 
+            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)
+        {
+            ResourceGroupManager::getSingleton().clearResourceGroup(
+                ResourceGroupManager::getSingleton().getWorldResourceGroupName());
+        }
+		destroyLevelIndexes();
+        mTerrainPages.clear();
+        // Load the configuration
+        loadConfig(stream);
+		initLevelIndexes();
+
+        // Resize the octree, allow for 1 page for now
+        float max_x = mOptions.scale.x * mOptions.pageSize;
+        float max_y = mOptions.scale.y;
+        float max_z = mOptions.scale.z * mOptions.pageSize;
+        resize( AxisAlignedBox( 0, 0, 0, max_x, max_y, max_z ) );
+
+        setupTerrainMaterial();
+
+        setupTerrainPages();
+
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::clearScene(void)
+    {
+        OctreeSceneManager::clearScene();
+        mTerrainPages.clear();
+		destroyLevelIndexes();
+        // Octree has destroyed our root
+        mTerrainRoot = 0;
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::_renderScene(Camera* cam, Viewport *vp, bool includeOverlays)
+    {
+        // For now, no paging and expect immediate response
+        if (!mTerrainPages.empty() && mTerrainPages[0][0] == 0)
+        {
+            mActivePageSource->requestPage(0, 0);
+        }
+        SceneManager::_renderScene(cam, vp, includeOverlays);
+
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::attachPage(ushort pageX, ushort pageZ, TerrainPage* page)
+    {
+        assert(pageX == 0 && pageZ == 0 && "Multiple pages not yet supported");
+
+        assert(mTerrainPages[pageX][pageZ] == 0 && "Page at that index not yet expired!");
+        // Insert page into list
+        mTerrainPages[pageX][pageZ] = page;
+        // Attach page to terrain root
+		if (page->pageSceneNode->getParentSceneNode() != mTerrainRoot)
+			mTerrainRoot->addChild(page->pageSceneNode);
+
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::_renderVisibleObjects( void )
+    {
+
+        OctreeSceneManager::_renderVisibleObjects();
+
+    }
+    //-------------------------------------------------------------------------
+    float TerrainSceneManager::getHeightAt( float x, float z )
+    {
+
+
+        Vector3 pt( x, 0, z );
+
+        TerrainRenderable * t = getTerrainTile( pt );
+
+        if ( t == 0 )
+        {
+            //  printf( "No tile found for point\n" );
+            return -1;
+        }
+
+        float h = t -> getHeightAt( x, z );
+
+        // printf( "Height is %f\n", h );
+        return h;
+
+    }
+    //-------------------------------------------------------------------------
+    TerrainPage* TerrainSceneManager::getTerrainPage( const Vector3 & pt )
+    {
+        if (mPagingEnabled)
+        {
+            // TODO
+            return 0;
+        }
+        else
+        {
+            // Single page
+            if (mTerrainPages.empty() || mTerrainPages[0].empty())
+                return 0;
+            return mTerrainPages[0][0];
+        }
+    }
+    //-------------------------------------------------------------------------
+    TerrainRenderable * TerrainSceneManager::getTerrainTile( const Vector3 & pt )
+    {
+		TerrainPage* tp = getTerrainPage(pt);
+		if (!tp)
+			return NULL;
+		else
+        	return tp->getTerrainTile(pt);
+    }
+    //-------------------------------------------------------------------------
+    bool TerrainSceneManager::intersectSegment( const Vector3 & start, 
+        const Vector3 & end, Vector3 * result )
+    {
+        TerrainRenderable * t = getTerrainTile( start );
+
+        if ( t == 0 )
+        {
+            *result = Vector3( -1, -1, -1 );
+            return false;
+        }
+
+        return t -> intersectSegment( start, end, result );
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setUseTriStrips(bool useStrips)
+    {
+        mOptions.useTriStrips = useStrips;
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setUseLODMorph(bool morph)
+    {
+        // Set true only if vertex programs are supported
+        mOptions.lodMorph = morph && 
+            mDestRenderSystem->getCapabilities()->hasCapability(RSC_VERTEX_PROGRAM);
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setUseVertexNormals(bool useNormals)
+    {
+        mOptions.lit = useNormals;
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setUseVertexColours(bool useColours)
+    {
+        mOptions.coloured = useColours;
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setWorldTexture(const String& textureName)
+    {
+        mWorldTextureName = textureName;
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setDetailTexture(const String& textureName)
+    {
+        mDetailTextureName = textureName;
+
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setDetailTextureRepeat(int repeat)
+    {
+        mOptions.detailTile = repeat;
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setTileSize(int size) 
+    {
+        mOptions.tileSize = size;
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setPageSize(int size)
+    {
+        mOptions.pageSize = size;
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setMaxPixelError(int pixelError) 
+    {
+        mOptions.maxPixelError = pixelError;
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setScale(const Vector3& scale)
+    {
+        mOptions.scale = scale;
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setMaxGeoMipMapLevel(int maxMip)
+    {
+        mOptions.maxGeoMipMapLevel = maxMip;
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setCustomMaterial(const String& materialName)
+    {
+        mCustomMaterialName = materialName;
+        if (materialName != "")
+            mUseCustomMaterial = true;
+        else
+            mUseCustomMaterial = false;
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setCustomMaterialMorphFactorParam(const String& paramName)
+    {
+        mUseNamedParameterLodMorph = true;
+        mLodMorphParamName = paramName;
+
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setCustomMaterialMorphFactorParam(size_t paramIndex)
+    {
+        mUseNamedParameterLodMorph = false;
+        mLodMorphParamIndex = paramIndex;
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setLODMorphStart(Real morphStart)
+    {
+        mOptions.lodMorphStart = morphStart;
+    }
+    //-------------------------------------------------------------------------
+    Camera* TerrainSceneManager::createCamera( const String &name )
+    {
+        Camera* c = OctreeSceneManager::createCamera(name);
+
+        // Set primary camera, if none
+        if (!mOptions.primaryCamera)
+            setPrimaryCamera(c);
+
+        return c;
+
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::setPrimaryCamera(const Camera* cam)
+    {
+        mOptions.primaryCamera = cam;
+    }
+    //-------------------------------------------------------------------------
+    bool TerrainSceneManager::setOption( const String & name, const void *value )
+    {
+        if (name == "PageSize")
+        {
+            setPageSize(*static_cast<const int*>(value));
+            return true;
+        } 
+        else if (name == "TileSize")
+        {
+            setTileSize(*static_cast<const int*>(value));
+            return true;
+        }
+        else if (name == "PrimaryCamera")
+        {
+            setPrimaryCamera(static_cast<const Camera*>(value));
+            return true;
+        }
+        else if (name == "MaxMipMapLevel")
+        {
+            setMaxGeoMipMapLevel(*static_cast<const int*>(value));
+            return true;
+        }
+        else if (name == "Scale")
+        {
+            setScale(*static_cast<const Vector3*>(value));
+            return true;
+        }
+        else if (name == "MaxPixelError")
+        {
+            setMaxPixelError(*static_cast<const int*>(value));
+            return true;
+        }
+        else if (name == "UseTriStrips")
+        {
+            setUseTriStrips(*static_cast<const bool*>(value));
+            return true;
+        }
+        else if (name == "VertexProgramMorph")
+        {
+            setUseLODMorph(*static_cast<const bool*>(value));
+            return true;
+        }
+        else if (name == "DetailTile")
+        {
+            setDetailTextureRepeat(*static_cast<const int*>(value));
+            return true;
+        }
+        else if (name == "LodMorphStart")
+        {
+            setLODMorphStart(*static_cast<const Real*>(value));
+            return true;
+        }
+        else if (name == "VertexNormals")
+        {
+            setUseVertexNormals(*static_cast<const bool*>(value));
+            return true;
+        }
+        else if (name == "VertexColours")
+        {
+            setUseVertexColours(*static_cast<const bool*>(value));
+            return true;
+        }
+        else if (name == "MorphLODFactorParamName")
+        {
+            setCustomMaterialMorphFactorParam(*static_cast<const String*>(value));
+            return true;
+        }
+        else if (name == "MorphLODFactorParamIndex")
+        {
+            setCustomMaterialMorphFactorParam(*static_cast<const size_t*>(value));
+            return true;
+        }
+        else if (name == "CustomMaterialName")
+        {
+            setCustomMaterial(*static_cast<const String*>(value));
+            return true;
+        }
+        else if (name == "WorldTexture")
+        {
+            setWorldTexture(*static_cast<const String*>(value));
+            return true;
+        }
+        else if (name == "DetailTexture")
+        {
+            setDetailTexture(*static_cast<const String*>(value));
+            return true;
+        }
+        else
+        {
+            return OctreeSceneManager::setOption(name, value);
+        }
+
+        return false;
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::registerPageSource(const String& typeName, 
+        TerrainPageSource* source)
+    {
+		std::pair<PageSourceMap::iterator, bool> retPair = 
+			mPageSources.insert(
+				PageSourceMap::value_type(typeName, source));
+		if (!retPair.second)
+		{
+			OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, 
+				"The page source " + typeName + " is already registered",
+				"TerrainSceneManager::registerPageSource");
+		}
+        LogManager::getSingleton().logMessage(
+            "TerrainSceneManager: Registered a new PageSource for "
+            "type " + typeName);
+    }
+    //-------------------------------------------------------------------------
+    void TerrainSceneManager::selectPageSource(const String& typeName, 
+        TerrainPageSourceOptionList& optionList)
+    {
+        PageSourceMap::iterator i = mPageSources.find(typeName);
+        if (i == mPageSources.end())
+        {
+            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+                "Cannot locate a TerrainPageSource for type " + typeName,
+                "TerrainSceneManager::selectPageSource");
+        }
+
+        if (mActivePageSource)
+        {
+            mActivePageSource->shutdown();
+        }
+        mActivePageSource = i->second;
+        mActivePageSource->initialise(this, mOptions.tileSize, mOptions.pageSize,
+            mPagingEnabled, optionList);
+
+        LogManager::getSingleton().logMessage(
+            "TerrainSceneManager: Activated PageSource " + typeName);
+
+    }
+    //-------------------------------------------------------------------------
+    int TerrainSceneManager::getDetailTextureRepeat(void)
+    {
+        return mOptions.detailTile;
+    }
+    //-------------------------------------------------------------------------
+    int TerrainSceneManager::getTileSize(void)
+    {
+        return mOptions.tileSize;
+    }
+    //-------------------------------------------------------------------------
+    int TerrainSceneManager::getPageSize(void)
+    {
+        return mOptions.pageSize;
+    }
+    //-------------------------------------------------------------------------
+    int TerrainSceneManager::getMaxPixelError(void)
+    {
+        return mOptions.maxPixelError;
+    }
+    //-------------------------------------------------------------------------
+    const Vector3& TerrainSceneManager::getScale(void)
+    {
+        return mOptions.scale;
+    }
+    //-------------------------------------------------------------------------
+    int TerrainSceneManager::getMaxGeoMipMapLevel(void)
+    {
+        return mOptions.maxGeoMipMapLevel;
+    }
+	//-----------------------------------------------------------------------
+	void TerrainSceneManager::initLevelIndexes()
+	{
+		if ( mLevelIndex.size() == 0 )
+		{
+			for ( int i = 0; i < 16; i++ )
+			{
+
+				mLevelIndex.push_back( new IndexMap() );
+
+			}
+
+		}
+	}
+	//-----------------------------------------------------------------------
+	void TerrainSceneManager::destroyLevelIndexes()
+	{
+		for ( int i = 0; i < mLevelIndex.size(); i++ )
+		{
+			delete mLevelIndex[i];
+		}
+		mLevelIndex.clear();
+	}
+    //-------------------------------------------------------------------------
+    //-------------------------------------------------------------------------
+    RaySceneQuery* 
+        TerrainSceneManager::createRayQuery(const Ray& ray, unsigned long mask)
+    {
+        TerrainRaySceneQuery *trsq = new TerrainRaySceneQuery(this);
+        trsq->setRay(ray);
+        trsq->setQueryMask(mask);
+        return trsq;
+    }
+    //-------------------------------------------------------------------------
+    TerrainRaySceneQuery::TerrainRaySceneQuery(SceneManager* creator)
+        :OctreeRaySceneQuery(creator)
+    {
+      mSupportedWorldFragments.insert(SceneQuery::WFT_SINGLE_INTERSECTION);
+    }
+    //-------------------------------------------------------------------------
+    TerrainRaySceneQuery::~TerrainRaySceneQuery()
+    {
+    }
+    //-------------------------------------------------------------------------
+    void TerrainRaySceneQuery::execute(RaySceneQueryListener* listener)
+    {
+        mWorldFrag.fragmentType = SceneQuery::WFT_SINGLE_INTERSECTION;
+
+        const Vector3& dir = mRay.getDirection();
+        const Vector3& origin = mRay.getOrigin();
+        // Straight up / down?
+        if (dir == Vector3::UNIT_Y || dir == Vector3::NEGATIVE_UNIT_Y)
+        {
+            Real height = static_cast<TerrainSceneManager*>(mParentSceneMgr)->getHeightAt(
+                origin.x, origin.z);
+            if (height != -1 && (height <= origin.y && dir.y < 0) || (height >= origin.y && dir.y > 0))
+            {
+                mWorldFrag.singleIntersection.x = origin.x;
+                mWorldFrag.singleIntersection.z = origin.z;
+                mWorldFrag.singleIntersection.y = height;
+                if (!listener->queryResult(&mWorldFrag, 
+                    (mWorldFrag.singleIntersection - origin).length()))
+					return;
+            }
+        }
+        else
+        {
+            // Perform arbitrary query
+            if (static_cast<TerrainSceneManager*>(mParentSceneMgr)->intersectSegment(
+                origin, origin + (dir * 100000), &mWorldFrag.singleIntersection))
+            {
+                if (!listener->queryResult(&mWorldFrag, 
+                    (mWorldFrag.singleIntersection - origin).length()))
+					return;
+            }
+
+
+        }
+        OctreeRaySceneQuery::execute(listener);
+
+    }
+    //-------------------------------------------------------------------------
+    MaterialPtr& TerrainSceneManager::getTerrainMaterial(void)
+    {
+        return mOptions.terrainMaterial;
+    }
+    //-------------------------------------------------------------------------
+    TerrainSceneManager::PageSourceIterator TerrainSceneManager::getPageSourceIterator(void)
+    {
+        return PageSourceIterator(mPageSources.begin(), mPageSources.end());
+    }
+	//-------------------------------------------------------------------------
+	void TerrainSceneManager::setWorldGeometryRenderQueue(uint8 qid)
+	{
+		OctreeSceneManager::setWorldGeometryRenderQueue(qid);
+
+		for (TerrainPage2D::iterator pi = mTerrainPages.begin(); 
+			pi != mTerrainPages.end(); ++pi)
+		{
+			TerrainPageRow& row = *pi;
+			for (TerrainPageRow::iterator ri = row.begin(); ri != row.end(); ++ri)
+			{
+				TerrainPage* page = *ri;
+				if (page)
+				{
+					page->setRenderQueue(qid);
+				}
+			}
+		}
+
+	}
+
+	//-----------------------------------------------------------------------
+	const String TerrainSceneManagerFactory::FACTORY_TYPE_NAME = "TerrainSceneManager";
+	//-----------------------------------------------------------------------
+	TerrainSceneManagerFactory::TerrainSceneManagerFactory()
+	{
+	}
+	//-----------------------------------------------------------------------
+	TerrainSceneManagerFactory::~TerrainSceneManagerFactory()
+	{
+		for (TerrainPageSources::iterator i = mTerrainPageSources.begin();
+			i != mTerrainPageSources.end(); ++i)
+		{
+			delete *i;
+		}
+		mTerrainPageSources.clear();
+	}
+	//-----------------------------------------------------------------------
+	void TerrainSceneManagerFactory::initMetaData(void) const
+	{
+		mMetaData.typeName = FACTORY_TYPE_NAME;
+		mMetaData.description = "Scene manager which generally organises the scene on "
+			"the basis of an octree, but also supports terrain world geometry. ";
+		mMetaData.sceneTypeMask = ST_EXTERIOR_CLOSE; // previous compatiblity
+		mMetaData.worldGeometrySupported = true;
+	}
+	//-----------------------------------------------------------------------
+	SceneManager* TerrainSceneManagerFactory::createInstance(
+		const String& instanceName)
+	{
+		TerrainSceneManager* tsm = new TerrainSceneManager(instanceName);
+		// Create & register default sources (one per manager)
+		HeightmapTerrainPageSource* ps = new HeightmapTerrainPageSource();
+		mTerrainPageSources.push_back(ps);
+		tsm->registerPageSource("Heightmap", ps);
+
+		return tsm;
+
+	}
+	//-----------------------------------------------------------------------
+	void TerrainSceneManagerFactory::destroyInstance(SceneManager* instance)
+	{
+		delete instance;
+	}
+
+
+} //namespace
Index: /PlugIns/OctreeSceneManager/src/OgreTerrainVertexProgram.cpp
===================================================================
--- /PlugIns/OctreeSceneManager/src/OgreTerrainVertexProgram.cpp	(revision 5)
+++ /PlugIns/OctreeSceneManager/src/OgreTerrainVertexProgram.cpp	(revision 5)
@@ -0,0 +1,346 @@
+
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreTerrainVertexProgram.h"
+
+namespace Ogre {
+
+    String TerrainVertexProgram::mNoFogArbvp1 = 
+        "!!ARBvp1.0\n"
+        "PARAM c5 = { 1, 1, 1, 1 };\n"
+        "#var float4x4 worldViewProj :  : c[0], 4 : 8 : 1\n"
+        "#var float morphFactor :  : c[4] : 9 : 1\n"
+        "TEMP R0;\n"
+        "ATTRIB v17 = vertex.attrib[1];\n"
+        "ATTRIB v25 = vertex.texcoord[1];\n"
+        "ATTRIB v24 = vertex.texcoord[0];\n"
+        "ATTRIB v16 = vertex.position;\n"
+        "PARAM c0[4] = { program.local[0..3] };\n"
+        "PARAM c4 = program.local[4];\n"
+        "	MOV result.texcoord[0], v24;\n"
+        "	MOV result.texcoord[1], v25;\n"
+        "	MOV R0, v16;\n"
+        "	MAD R0.y, v17.x, c4.x, R0.y;\n"
+        "	DP4 result.position.x, c0[0], R0;\n"
+        "	DP4 result.position.y, c0[1], R0;\n"
+        "	DP4 result.position.z, c0[2], R0;\n"
+        "	DP4 result.position.w, c0[3], R0;\n"
+        "	MOV result.color.front.primary, c5.x;\n"
+        "END\n";
+
+	String TerrainVertexProgram::mShadowReceiverArbvp1 = 
+		"!!ARBvp1.0\n"
+		"PARAM c[14] = { program.local[0..12], { 1 } };\n"
+		"TEMP R0;\n"
+		"TEMP R1;\n"
+		"TEMP R2;\n"
+		"MOV result.color, c[13].x;\n"
+		"MUL R0.x, vertex.attrib[1], c[12];\n"
+		"ADD R1.y, R0.x, vertex.position;\n"
+		"MOV R1.xzw, vertex.position;\n"
+		"DP4 result.position.w, R1, c[3];\n"
+		"DP4 result.position.z, R1, c[2];\n"
+		"DP4 R0.w, R1, c[7];\n"
+		"DP4 R0.z, R1, c[6];\n"
+		"DP4 R0.y, R1, c[5];\n"
+		"DP4 R0.x, R1, c[4];\n"
+		"DP4 result.position.y, R1, c[1];\n"
+		"DP4 R2.y, R0, c[9];\n"
+		"DP4 R2.z, R0, c[11];\n"
+		"DP4 R2.x, R0, c[8];\n"
+		"RCP R0.x, R2.z;\n"
+		"DP4 result.position.x, R1, c[0];\n"
+		"MUL result.texcoord[0].xy, R2, R0.x;\n"
+		"END\n";
+    String TerrainVertexProgram::mLinearFogArbvp1 = 
+        "!!ARBvp1.0\n"
+        "PARAM c5 = { 1, 1, 1, 1 };\n"
+        "#var float4x4 worldViewProj :  : c[0], 4 : 9 : 1\n"
+        "#var float morphFactor :  : c[4] : 10 : 1\n"
+        "TEMP R0, R1;\n"
+        "ATTRIB v17 = vertex.attrib[1];\n"
+        "ATTRIB v25 = vertex.texcoord[1];\n"
+        "ATTRIB v24 = vertex.texcoord[0];\n"
+        "ATTRIB v16 = vertex.position;\n"
+        "PARAM c0[4] = { program.local[0..3] };\n"
+        "PARAM c4 = program.local[4];\n"
+        "	MOV result.texcoord[0], v24;\n"
+        "	MOV result.texcoord[1], v25;\n"
+        "	MOV R1, v16;\n"
+        "	MAD R1.y, v17.x, c4.x, R1.y;\n"
+        "	DP4 R0.x, c0[0], R1;\n"
+        "	DP4 R0.y, c0[1], R1;\n"
+        "	DP4 R0.z, c0[2], R1;\n"
+        "	DP4 R0.w, c0[3], R1;\n"
+        "	MOV result.fogcoord.x, R0.z;\n"
+        "	MOV result.position, R0;\n"
+        "	MOV result.color.front.primary, c5.x;\n"
+        "END\n";
+    String TerrainVertexProgram::mExpFogArbvp1 = 
+        "!!ARBvp1.0\n"
+        "PARAM c6 = { 1, 1, 1, 1 };\n"
+        "PARAM c7 = { 2.71828, 0, 0, 0 };\n"
+        "#var float4x4 worldViewProj :  : c[0], 4 : 9 : 1\n"
+        "#var float morphFactor :  : c[4] : 10 : 1\n"
+        "#var float fogDensity :  : c[5] : 11 : 1\n"
+        "TEMP R0, R1;\n"
+        "ATTRIB v17 = vertex.attrib[1];\n"
+        "ATTRIB v25 = vertex.texcoord[1];\n"
+        "ATTRIB v24 = vertex.texcoord[0];\n"
+        "ATTRIB v16 = vertex.position;\n"
+        "PARAM c5 = program.local[5];\n"
+        "PARAM c0[4] = { program.local[0..3] };\n"
+        "PARAM c4 = program.local[4];\n"
+        "	MOV result.texcoord[0], v24;\n"
+        "	MOV result.texcoord[1], v25;\n"
+        "	MOV R1, v16;\n"
+        "	MAD R1.y, v17.x, c4.x, R1.y;\n"
+        "	DP4 R0.x, c0[0], R1;\n"
+        "	DP4 R0.y, c0[1], R1;\n"
+        "	DP4 R0.z, c0[2], R1;\n"
+        "	DP4 R0.w, c0[3], R1;\n"
+        "	MOV result.position, R0;\n"
+        "	MOV result.color.front.primary, c6.x;\n"
+        "	MUL R0.zw, R0.z, c5.x;\n"
+        "	MOV R0.xy, c7.x;\n"
+        "	LIT R0.z, R0;\n"
+        "	RCP result.fogcoord.x, R0.z;\n"
+        "END\n";
+    String TerrainVertexProgram::mExp2FogArbvp1 = 
+        "!!ARBvp1.0\n"
+        "PARAM c6 = { 1, 1, 1, 1 };\n"
+        "PARAM c7 = { 0.002, 2.71828, 0, 0 };\n"
+        "#var float4x4 worldViewProj :  : c[0], 4 : 9 : 1\n"
+        "#var float morphFactor :  : c[4] : 10 : 1\n"
+        "#var float fogDensity :  : c[5] : 11 : 1\n"
+        "TEMP R0, R1;\n"
+        "ATTRIB v17 = vertex.attrib[1];\n"
+        "ATTRIB v25 = vertex.texcoord[1];\n"
+        "ATTRIB v24 = vertex.texcoord[0];\n"
+        "ATTRIB v16 = vertex.position;\n"
+        "PARAM c0[4] = { program.local[0..3] };\n"
+        "PARAM c4 = program.local[4];\n"
+        "	MOV result.texcoord[0], v24;\n"
+        "	MOV result.texcoord[1], v25;\n"
+        "	MOV R1, v16;\n"
+        "	MAD R1.y, v17.x, c4.x, R1.y;\n"
+        "	DP4 R0.x, c0[0], R1;\n"
+        "	DP4 R0.y, c0[1], R1;\n"
+        "	DP4 R0.z, c0[2], R1;\n"
+        "	DP4 R0.w, c0[3], R1;\n"
+        "	MOV result.position, R0;\n"
+        "	MOV result.color.front.primary, c6.x;\n"
+        "	MUL R0.x, R0.z, c7.x;\n"
+        "	MUL R0.zw, R0.x, R0.x;\n"
+        "	MOV R0.xy, c7.y;\n"
+        "	LIT R0.z, R0;\n"
+        "	RCP result.fogcoord.x, R0.z;\n"
+        "END\n";
+
+    String TerrainVertexProgram::mNoFogVs_1_1 = 
+        "vs_1_1\n"
+        "def c5, 1, 1, 1, 1\n"
+        "//var float4x4 worldViewProj :  : c[0], 4 : 8 : 1\n"
+        "//var float morphFactor :  : c[4] : 9 : 1\n"
+        "dcl_blendweight v1\n"
+        "dcl_texcoord1 v8\n"
+        "dcl_texcoord0 v7\n"
+        "dcl_position v0\n"
+        "	mov oT0.xy, v7\n"
+        "	mov oT1.xy, v8\n"
+        "	mov r0, v0\n"
+        "	mad r0.y, v1.x, c4.x, r0.y\n"
+        "	dp4 oPos.x, c0, r0\n"
+        "	dp4 oPos.y, c1, r0\n"
+        "	dp4 oPos.z, c2, r0\n"
+        "	dp4 oPos.w, c3, r0\n"
+        "	mov oD0, c5.x\n";
+    String TerrainVertexProgram::mLinearFogVs_1_1 = 
+        "vs_1_1\n"
+        "def c5, 1, 1, 1, 1\n"
+        "//var float4x4 worldViewProj :  : c[0], 4 : 9 : 1\n"
+        "//var float morphFactor :  : c[4] : 10 : 1\n"
+        "dcl_blendweight v1\n"
+        "dcl_texcoord1 v8\n"
+        "dcl_texcoord0 v7\n"
+        "dcl_position v0\n"
+        "	mov oT0.xy, v7\n"
+        "	mov oT1.xy, v8\n"
+        "	mov r1, v0\n"
+        "	mad r1.y, v1.x, c4.x, r1.y\n"
+        "	dp4 r0.x, c0, r1\n"
+        "	dp4 r0.y, c1, r1\n"
+        "	dp4 r0.z, c2, r1\n"
+        "	dp4 r0.w, c3, r1\n"
+        "	mov oFog, r0.z\n"
+        "	mov oPos, r0\n"
+        "	mov oD0, c5.x\n";
+
+	String TerrainVertexProgram::mShadowReceiverVs_1_1 = 
+		"vs_1_1\n"
+		"def c13, 1, 1, 1, 1\n"
+		"dcl_blendweight v1\n"
+		"dcl_texcoord1 v8\n"
+		"dcl_texcoord0 v7\n"
+		"dcl_position v0\n"
+		"mov r1, v0\n"
+		"mad r1.y, v1.x, c12.x, r1.y\n"
+		"dp4 oPos.x, c0, r1\n"
+		"dp4 oPos.y, c1, r1\n"
+		"dp4 oPos.z, c2, r1\n"
+		"dp4 oPos.w, c3, r1\n"
+		"dp4 r0.x, c4, r1\n"
+		"dp4 r0.y, c5, r1\n"
+		"dp4 r0.z, c6, r1\n"
+		"dp4 r0.w, c7, r1\n"
+		"dp4 r1.x, c8, r0\n"
+		"dp4 r1.y, c9, r0\n"
+		"dp4 r1.w, c11, r0\n"
+		"rcp r0.x, r1.w\n"
+		"mul oT0.xy, r1.xy, r0.x\n"
+		"mov oD0, c13\n";
+	String TerrainVertexProgram::mExpFogVs_1_1 = 
+        "vs_1_1\n"
+        "def c6, 1, 1, 1, 1\n"
+        "def c7, 2.71828, 0, 0, 0\n"
+        "//var float4x4 worldViewProj :  : c[0], 4 : 9 : 1\n"
+        "//var float morphFactor :  : c[4] : 10 : 1\n"
+        "//var float fogDensity :  : c[5] : 11 : 1\n"
+        "dcl_blendweight v1\n"
+        "dcl_texcoord1 v8\n"
+        "dcl_texcoord0 v7\n"
+        "dcl_position v0\n"
+        "	mov oT0.xy, v7\n"
+        "	mov oT1.xy, v8\n"
+        "	mov r1, v0\n"
+        "	mad r1.y, v1.x, c4.x, r1.y\n"
+        "	dp4 r0.x, c0, r1\n"
+        "	dp4 r0.y, c1, r1\n"
+        "	dp4 r0.z, c2, r1\n"
+        "	dp4 r0.w, c3, r1\n"
+        "	mov oPos, r0\n"
+        "	mov oD0, c6.x\n"
+        "	mul r0.zw, r0.z, c5.x\n"
+        "	mov r0.xy, c7.x\n"
+        "	lit r0.z, r0\n"
+        "	rcp oFog, r0.z\n";
+    String TerrainVertexProgram::mExp2FogVs_1_1 = 
+        "vs_1_1\n"
+        "def c6, 1, 1, 1, 1\n"
+        "def c7, 0.002, 2.71828, 0, 0\n"
+        "//var float4x4 worldViewProj :  : c[0], 4 : 9 : 1\n"
+        "//var float morphFactor :  : c[4] : 10 : 1\n"
+        "//var float fogDensity :  : c[5] : 11 : 1\n"
+        "dcl_blendweight v1\n"
+        "dcl_texcoord1 v8\n"
+        "dcl_texcoord0 v7\n"
+        "dcl_position v0\n"
+        "	mov oT0.xy, v7\n"
+        "	mov oT1.xy, v8\n"
+        "	mov r1, v0\n"
+        "	mad r1.y, v1.x, c4.x, r1.y\n"
+        "	dp4 r0.x, c0, r1\n"
+        "	dp4 r0.y, c1, r1\n"
+        "	dp4 r0.z, c2, r1\n"
+        "	dp4 r0.w, c3, r1\n"
+        "	mov oPos, r0\n"
+        "	mov oD0, c6.x\n"
+        "	mul r0.x, r0.z, c7.x\n"
+        "	mul r0.zw, r0.x, r0.x\n"
+        "	mov r0.xy, c7.y\n"
+        "	lit r0.z, r0\n"
+        "	rcp oFog, r0.z\n";
+
+    const String& TerrainVertexProgram::getProgramSource(
+        FogMode fogMode, const String syntax, bool shadowReceiver)
+    {
+		if (shadowReceiver)
+		{
+			if (syntax == "arbvp1")
+			{
+				return mShadowReceiverArbvp1;
+			}
+			else
+			{
+				return mShadowReceiverVs_1_1;
+			}
+		}
+		else
+		{
+
+			switch(fogMode)
+			{
+			case FOG_NONE:
+				if (syntax == "arbvp1")
+				{
+					return mNoFogArbvp1;
+				}
+				else
+				{
+					return mNoFogVs_1_1;
+				}
+				break;
+			case FOG_LINEAR:
+				if (syntax == "arbvp1")
+				{
+					return mLinearFogArbvp1;
+				}
+				else
+				{
+					return mLinearFogVs_1_1;
+				}
+				break;
+			case FOG_EXP:
+				if (syntax == "arbvp1")
+				{
+					return mExpFogArbvp1;
+				}
+				else
+				{
+					return mExpFogVs_1_1;
+				}
+				break;
+			case FOG_EXP2:
+				if (syntax == "arbvp1")
+				{
+					return mExp2FogArbvp1;
+				}
+				else
+				{
+					return mExp2FogVs_1_1;
+				}
+				break;
+			};
+		}
+        // default
+        return StringUtil::BLANK;
+
+    }
+}
Index: /PlugIns/ParticleFX/Makefile.am
===================================================================
--- /PlugIns/ParticleFX/Makefile.am	(revision 5)
+++ /PlugIns/ParticleFX/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /PlugIns/ParticleFX/Makefile.in
===================================================================
--- /PlugIns/ParticleFX/Makefile.in	(revision 5)
+++ /PlugIns/ParticleFX/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = PlugIns/ParticleFX
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  PlugIns/ParticleFX/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  PlugIns/ParticleFX/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /PlugIns/ParticleFX/include/Makefile.am
===================================================================
--- /PlugIns/ParticleFX/include/Makefile.am	(revision 5)
+++ /PlugIns/ParticleFX/include/Makefile.am	(revision 5)
@@ -0,0 +1,33 @@
+noinst_HEADERS =OgreAreaEmitter.h \
+                OgreBoxEmitter.h \
+                OgreBoxEmitterFactory.h \
+                OgreColourFaderAffector.h \
+                OgreColourFaderAffector2.h \
+                OgreColourFaderAffectorFactory.h \
+                OgreColourFaderAffectorFactory2.h \
+				OgreColourImageAffector.h \
+				OgreColourImageAffectorFactory.h \
+				OgreColourInterpolatorAffector.h \
+				OgreColourInterpolatorAffectorFactory.h \
+                OgreCylinderEmitter.h \
+                OgreCylinderEmitterFactory.h \
+				OgreDeflectorPlaneAffector.h \
+				OgreDeflectorPlaneAffectorFactory.h \
+				OgreDirectionRandomiserAffector.h \
+				OgreDirectionRandomiserAffectorFactory.h \
+                OgreEllipsoidEmitter.h \
+                OgreEllipsoidEmitterFactory.h \
+                OgreHollowEllipsoidEmitter.h \
+                OgreHollowEllipsoidEmitterFactory.h \
+                OgreLinearForceAffector.h \
+                OgreLinearForceAffectorFactory.h \
+                OgreParticleFXPlugin.h \
+                OgreParticleFXPrerequisites.h \
+                OgrePointEmitter.h \
+                OgrePointEmitterFactory.h \
+                OgreRingEmitter.h \
+                OgreRingEmitterFactory.h \
+				OgreRotationAffector.h \
+				OgreRotationAffectorFactory.h \
+				OgreScaleAffector.h \
+				OgreScaleAffectorFactory.h 
Index: /PlugIns/ParticleFX/include/Makefile.in
===================================================================
--- /PlugIns/ParticleFX/include/Makefile.in	(revision 5)
+++ /PlugIns/ParticleFX/include/Makefile.in	(revision 5)
@@ -0,0 +1,469 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = PlugIns/ParticleFX/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = OgreAreaEmitter.h \
+                OgreBoxEmitter.h \
+                OgreBoxEmitterFactory.h \
+                OgreColourFaderAffector.h \
+                OgreColourFaderAffector2.h \
+                OgreColourFaderAffectorFactory.h \
+                OgreColourFaderAffectorFactory2.h \
+				OgreColourImageAffector.h \
+				OgreColourImageAffectorFactory.h \
+				OgreColourInterpolatorAffector.h \
+				OgreColourInterpolatorAffectorFactory.h \
+                OgreCylinderEmitter.h \
+                OgreCylinderEmitterFactory.h \
+				OgreDeflectorPlaneAffector.h \
+				OgreDeflectorPlaneAffectorFactory.h \
+				OgreDirectionRandomiserAffector.h \
+				OgreDirectionRandomiserAffectorFactory.h \
+                OgreEllipsoidEmitter.h \
+                OgreEllipsoidEmitterFactory.h \
+                OgreHollowEllipsoidEmitter.h \
+                OgreHollowEllipsoidEmitterFactory.h \
+                OgreLinearForceAffector.h \
+                OgreLinearForceAffectorFactory.h \
+                OgreParticleFXPlugin.h \
+                OgreParticleFXPrerequisites.h \
+                OgrePointEmitter.h \
+                OgrePointEmitterFactory.h \
+                OgreRingEmitter.h \
+                OgreRingEmitterFactory.h \
+				OgreRotationAffector.h \
+				OgreRotationAffectorFactory.h \
+				OgreScaleAffector.h \
+				OgreScaleAffectorFactory.h 
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  PlugIns/ParticleFX/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  PlugIns/ParticleFX/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /PlugIns/ParticleFX/include/OgreAreaEmitter.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreAreaEmitter.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreAreaEmitter.h	(revision 5)
@@ -0,0 +1,147 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __AreaEmitter_H__
+#define __AreaEmitter_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleEmitter.h"
+
+namespace Ogre {
+
+    /** Particle emitter which emits particles randomly from points inside
+        an area (box, sphere, ellipsoid whatever subclasses choose to be).
+    @remarks
+        This is an empty superclass and needs to be subclassed. Basic particle
+        emitter emits particles from/in an (unspecified) area. The
+        initial direction of these particles can either be a single direction
+        (i.e. a line), a random scattering inside a cone, or a random
+        scattering in all directions, depending the 'angle' parameter, which
+        is the angle across which to scatter the particles either side of the
+        base direction of the emitter. 
+    */
+    class _OgreParticleFXExport AreaEmitter : public ParticleEmitter
+    {
+    public:
+        /** Command object for area emitter size (see ParamCommand).*/
+        class CmdWidth : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for area emitter size (see ParamCommand).*/
+        class CmdHeight : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for area emitter size (see ParamCommand).*/
+        class CmdDepth : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+
+        AreaEmitter(ParticleSystem* psys) : ParticleEmitter(psys) {}
+
+
+        /** See ParticleEmitter. */
+        unsigned short _getEmissionCount(Real timeElapsed);
+
+        /** Overloaded to update the trans. matrix */
+        void setDirection( const Vector3& direction );
+
+        /** Sets the size of the area from which particles are emitted.
+        @param
+            size Vector describing the size of the area. The area extends
+            around the center point by half the x, y and z components of
+            this vector. The box is aligned such that it's local Z axis points
+            along it's direction (see setDirection)
+        */
+        void setSize(const Vector3& size);
+
+        /** Sets the size of the area from which particles are emitted.
+        @param x,y,z
+            Individual axis lengths describing the size of the area. The area
+            extends around the center point by half the x, y and z components
+            of this vector. The box is aligned such that it's local Z axis
+            points along it's direction (see setDirection)
+        */
+        void setSize(Real x, Real y, Real z);
+        /** Sets the size of the clear space inside the area from where NO particles are emitted.
+        @param x,y,z
+            Individual axis lengths describing the size of the clear space.
+            The clear space is aligned like the outer area.
+            (see setDirection and setSize)
+        */
+//        void setClearSpace(Real x, Real y, Real z);
+
+        /** Sets the width (local x size) of the emitter. */
+        void setWidth(Real width);
+        /** Gets the width (local x size) of the emitter. */
+        Real getWidth(void) const;
+        /** Sets the height (local y size) of the emitter. */
+        void setHeight(Real Height);
+        /** Gets the height (local y size) of the emitter. */
+        Real getHeight(void) const;
+        /** Sets the depth (local y size) of the emitter. */
+        void setDepth(Real Depth);
+        /** Gets the depth (local y size) of the emitter. */
+        Real getDepth(void) const;
+
+    protected:
+        /// Size of the area
+        Vector3 mSize;
+
+        /// Local axes, not normalised, their magnitude reflects area size
+        Vector3 mXRange, mYRange, mZRange;
+
+        /// Internal method for generating the area axes
+        void genAreaAxes(void);
+        /** Internal for initializing some defaults and parameters
+        @returns True if custom parameters need initialising
+        */
+        bool initDefaults(const String& mType);
+
+        /// Command objects
+        static CmdWidth msWidthCmd;
+        static CmdHeight msHeightCmd;
+        static CmdDepth msDepthCmd;
+
+
+
+    };
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreBoxEmitter.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreBoxEmitter.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreBoxEmitter.h	(revision 5)
@@ -0,0 +1,61 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __BoxEmitter_H__
+#define __BoxEmitter_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreAreaEmitter.h"
+
+namespace Ogre {
+
+    /** Particle emitter which emits particles randomly from points inside a box.
+    @remarks
+        This basic particle emitter emits particles from a box area. The
+        initial direction of these particles can either be a single direction (i.e. a line),
+        a random scattering inside a cone, or a random scattering in all directions, 
+        depending the 'angle' parameter, which is the angle across which to scatter the 
+        particles either side of the base direction of the emitter. 
+    */
+    class _OgreParticleFXExport BoxEmitter : public AreaEmitter
+    {
+    public:
+
+        BoxEmitter(ParticleSystem* psys);
+
+        /** See ParticleEmitter. */
+        void _initParticle(Particle* pParticle);
+
+    protected:
+
+    };
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreBoxEmitterFactory.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreBoxEmitterFactory.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreBoxEmitterFactory.h	(revision 5)
@@ -0,0 +1,67 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __BoxEmitterFactory_H__
+#define __BoxEmitterFactory_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleEmitterFactory.h"
+#include "OgreBoxEmitter.h"
+
+
+namespace Ogre {
+
+    /** Factory class for particle emitter of type "Box".
+    @remarks
+        Creates instances of BoxEmitter to be used in particle systems. 
+    */
+    class _OgreParticleFXExport BoxEmitterFactory : public ParticleEmitterFactory
+    {
+    protected:
+
+    public:
+        /** See ParticleEmitterFactory */
+        String getName() const
+        { 
+            return "Box"; 
+        }
+
+        /** See ParticleEmitterFactory */
+        ParticleEmitter* createEmitter(ParticleSystem* psys) 
+        {
+            ParticleEmitter* emit = new BoxEmitter(psys);
+            mEmitters.push_back(emit);
+            return emit;
+        }
+
+    };
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreColourFaderAffector.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreColourFaderAffector.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreColourFaderAffector.h	(revision 5)
@@ -0,0 +1,168 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ColourFaderAffector_H__
+#define __ColourFaderAffector_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffector.h"
+#include "OgreStringInterface.h"
+
+namespace Ogre {
+
+
+    /** This plugin subclass of ParticleAffector allows you to alter the colour of particles.
+    @remarks
+        This class supplies the ParticleAffector implementation required to modify the colour of
+        particle in mid-flight.
+    */
+    class _OgreParticleFXExport ColourFaderAffector : public ParticleAffector
+    {
+    public:
+
+        /** Command object for red adjust (see ParamCommand).*/
+        class CmdRedAdjust : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Command object for green adjust (see ParamCommand).*/
+        class CmdGreenAdjust : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Command object for blue adjust (see ParamCommand).*/
+        class CmdBlueAdjust : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Command object for alpha adjust (see ParamCommand).*/
+        class CmdAlphaAdjust : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+
+        /** Default constructor. */
+        ColourFaderAffector(ParticleSystem* psys);
+
+        /** See ParticleAffector. */
+        void _affectParticles(ParticleSystem* pSystem, Real timeElapsed);
+
+        /** Sets the colour adjustment to be made per second to particles. 
+        @param red, green, blue, alpha
+            Sets the adjustment to be made to each of the colour components per second. These
+            values will be added to the colour of all particles every second, scaled over each frame
+            for a smooth adjustment.
+        */
+        void setAdjust(float red, float green, float blue, float alpha = 0.0);
+        /** Sets the red adjustment to be made per second to particles. 
+        @param red
+            The adjustment to be made to the colour component per second. This
+            value will be added to the colour of all particles every second, scaled over each frame
+            for a smooth adjustment.
+        */
+        void setRedAdjust(float red);
+
+        /** Gets the red adjustment to be made per second to particles. */
+        float getRedAdjust(void) const;
+
+        /** Sets the green adjustment to be made per second to particles. 
+        @param green
+            The adjustment to be made to the colour component per second. This
+            value will be added to the colour of all particles every second, scaled over each frame
+            for a smooth adjustment.
+        */
+        void setGreenAdjust(float green);
+        /** Gets the green adjustment to be made per second to particles. */
+        float getGreenAdjust(void) const;
+        /** Sets the blue adjustment to be made per second to particles. 
+        @param blue
+            The adjustment to be made to the colour component per second. This
+            value will be added to the colour of all particles every second, scaled over each frame
+            for a smooth adjustment.
+        */
+        void setBlueAdjust(float blue);
+        /** Gets the blue adjustment to be made per second to particles. */
+        float getBlueAdjust(void) const;
+
+        /** Sets the alpha adjustment to be made per second to particles. 
+        @param alpha
+            The adjustment to be made to the colour component per second. This
+            value will be added to the colour of all particles every second, scaled over each frame
+            for a smooth adjustment.
+        */
+        void setAlphaAdjust(float alpha);
+        /** Gets the alpha adjustment to be made per second to particles. */
+        float getAlphaAdjust(void) const;
+
+        static CmdRedAdjust msRedCmd;
+        static CmdGreenAdjust msGreenCmd;
+        static CmdBlueAdjust msBlueCmd;
+        static CmdAlphaAdjust msAlphaCmd;
+
+    protected:
+        float mRedAdj;
+        float mGreenAdj;
+        float mBlueAdj;
+        float mAlphaAdj;
+
+        /** Internal method for adjusting while clamping to [0,1] */
+        inline void applyAdjustWithClamp(float* pComponent, float adjust)
+        {
+            *pComponent += adjust;
+            // Limit to 0
+            if (*pComponent < 0.0)
+            {
+                *pComponent = 0.0f;
+            }
+            // Limit to 1
+            else if (*pComponent > 1.0)
+            {
+                *pComponent = 1.0f;
+            }
+        }
+
+    };
+
+
+}
+
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreColourFaderAffector2.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreColourFaderAffector2.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreColourFaderAffector2.h	(revision 5)
@@ -0,0 +1,227 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ColourFaderAffector2_H__
+#define __ColourFaderAffector2_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffector.h"
+#include "OgreStringInterface.h"
+
+namespace Ogre {
+
+
+    /** This plugin subclass of ParticleAffector allows you to alter the colour of particles.
+    @remarks
+        This class supplies the ParticleAffector implementation required to modify the colour of
+        particle in mid-flight.
+    */
+    class _OgreParticleFXExport ColourFaderAffector2 : public ParticleAffector
+    {
+    public:
+
+        /** Command object for red adjust (see ParamCommand).*/
+        class CmdRedAdjust1 : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Command object for green adjust (see ParamCommand).*/
+        class CmdGreenAdjust1 : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Command object for blue adjust (see ParamCommand).*/
+        class CmdBlueAdjust1 : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Command object for alpha adjust (see ParamCommand).*/
+        class CmdAlphaAdjust1 : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Command object for red adjust (see ParamCommand).*/
+        class CmdRedAdjust2 : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Command object for green adjust (see ParamCommand).*/
+        class CmdGreenAdjust2 : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Command object for blue adjust (see ParamCommand).*/
+        class CmdBlueAdjust2 : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Command object for alpha adjust (see ParamCommand).*/
+        class CmdAlphaAdjust2 : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Command object for alpha adjust (see ParamCommand).*/
+        class CmdStateChange : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+
+        /** Default constructor. */
+        ColourFaderAffector2(ParticleSystem* psys);
+
+        /** See ParticleAffector. */
+        void _affectParticles(ParticleSystem* pSystem, Real timeElapsed);
+
+        /** Sets the colour adjustment to be made per second to particles. 
+        @param red, green, blue, alpha
+            Sets the adjustment to be made to each of the colour components per second. These
+            values will be added to the colour of all particles every second, scaled over each frame
+            for a smooth adjustment.
+        */
+        void setAdjust1(float red, float green, float blue, float alpha = 0.0);
+		void setAdjust2(float red, float green, float blue, float alpha = 0.0);
+        /** Sets the red adjustment to be made per second to particles. 
+        @param red
+            The adjustment to be made to the colour component per second. This
+            value will be added to the colour of all particles every second, scaled over each frame
+            for a smooth adjustment.
+        */
+        void setRedAdjust1(float red);
+		void setRedAdjust2(float red);
+
+        /** Gets the red adjustment to be made per second to particles. */
+        float getRedAdjust1(void) const;
+		float getRedAdjust2(void) const;
+
+        /** Sets the green adjustment to be made per second to particles. 
+        @param green
+            The adjustment to be made to the colour component per second. This
+            value will be added to the colour of all particles every second, scaled over each frame
+            for a smooth adjustment.
+        */
+        void setGreenAdjust1(float green);
+		void setGreenAdjust2(float green);
+        /** Gets the green adjustment to be made per second to particles. */
+        float getGreenAdjust1(void) const;
+		float getGreenAdjust2(void) const;
+        /** Sets the blue adjustment to be made per second to particles. 
+        @param blue
+            The adjustment to be made to the colour component per second. This
+            value will be added to the colour of all particles every second, scaled over each frame
+            for a smooth adjustment.
+        */
+        void setBlueAdjust1(float blue);
+		void setBlueAdjust2(float blue);
+        /** Gets the blue adjustment to be made per second to particles. */
+        float getBlueAdjust1(void) const;
+		float getBlueAdjust2(void) const;
+
+        /** Sets the alpha adjustment to be made per second to particles. 
+        @param alpha
+            The adjustment to be made to the colour component per second. This
+            value will be added to the colour of all particles every second, scaled over each frame
+            for a smooth adjustment.
+        */
+        void setAlphaAdjust1(float alpha);
+		void setAlphaAdjust2(float alpha);
+        /** Gets the alpha adjustment to be made per second to particles. */
+        float getAlphaAdjust1(void) const;
+		float getAlphaAdjust2(void) const;
+
+
+        void setStateChange(Real NewValue );
+        Real getStateChange(void) const;
+
+        static CmdRedAdjust1 msRedCmd1;
+		static CmdRedAdjust2 msRedCmd2;
+        static CmdGreenAdjust1 msGreenCmd1;
+		static CmdGreenAdjust2 msGreenCmd2;
+        static CmdBlueAdjust1 msBlueCmd1;
+		static CmdBlueAdjust2 msBlueCmd2;
+        static CmdAlphaAdjust1 msAlphaCmd1;
+		static CmdAlphaAdjust2 msAlphaCmd2;
+        static CmdStateChange msStateCmd;
+
+    protected:
+        float mRedAdj1, mRedAdj2;
+        float mGreenAdj1,  mGreenAdj2;
+        float mBlueAdj1, mBlueAdj2;
+        float mAlphaAdj1, mAlphaAdj2;
+		Real StateChangeVal;
+
+        /** Internal method for adjusting while clamping to [0,1] */
+        inline void applyAdjustWithClamp(float* pComponent, float adjust)
+        {
+            *pComponent += adjust;
+            // Limit to 0
+            if (*pComponent < 0.0)
+            {
+                *pComponent = 0.0f;
+            }
+            // Limit to 1
+            else if (*pComponent > 1.0)
+            {
+                *pComponent = 1.0f;
+            }
+        }
+
+    };
+
+
+}
+
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreColourFaderAffectorFactory.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreColourFaderAffectorFactory.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreColourFaderAffectorFactory.h	(revision 5)
@@ -0,0 +1,57 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ColourFaderAffectorFactory_H__
+#define __ColourFaderAffectorFactory_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffectorFactory.h"
+#include "OgreColourFaderAffector.h"
+
+namespace Ogre {
+
+    /** Factory class for ColourFaderAffector. */
+    class _OgreParticleFXExport ColourFaderAffectorFactory : public ParticleAffectorFactory
+    {
+        /** See ParticleAffectorFactory */
+        String getName() const { return "ColourFader"; }
+
+        /** See ParticleAffectorFactory */
+        ParticleAffector* createAffector(ParticleSystem* psys)
+        {
+            ParticleAffector* p = new ColourFaderAffector(psys);
+            mAffectors.push_back(p);
+            return p;
+        }
+    };
+
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreColourFaderAffectorFactory2.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreColourFaderAffectorFactory2.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreColourFaderAffectorFactory2.h	(revision 5)
@@ -0,0 +1,57 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ColourFaderAffectorFactory2_H__
+#define __ColourFaderAffectorFactory2_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffectorFactory.h"
+#include "OgreColourFaderAffector2.h"
+
+namespace Ogre {
+
+    /** Factory class for ColourFaderAffector. */
+    class _OgreParticleFXExport ColourFaderAffectorFactory2 : public ParticleAffectorFactory
+    {
+        /** See ParticleAffectorFactory */
+        String getName() const { return "ColourFader2"; }
+
+        /** See ParticleAffectorFactory */
+        ParticleAffector* createAffector(ParticleSystem* psys)
+        {
+            ParticleAffector* p = new ColourFaderAffector2(psys);
+            mAffectors.push_back(p);
+            return p;
+        }
+    };
+
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreColourImageAffector.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreColourImageAffector.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreColourImageAffector.h	(revision 5)
@@ -0,0 +1,81 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ColourImageAffector_H__
+#define __ColourImageAffector_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffector.h"
+#include "OgreStringInterface.h"
+#include "OgreColourValue.h"
+#include "OgreImage.h"
+
+namespace Ogre {
+
+
+    class _OgreParticleFXExport ColourImageAffector : public ParticleAffector
+    {
+    public:
+		/** Command object for red adjust (see ParamCommand).*/
+        class CmdImageAdjust : public ParamCommand
+        {
+		public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Default constructor. */
+        ColourImageAffector(ParticleSystem* psys);
+
+        /** See ParticleAffector. */
+		void _initParticle(Particle* pParticle);
+
+        /** See ParticleAffector. */
+        void _affectParticles(ParticleSystem* pSystem, Real timeElapsed);
+
+		void setImageAdjust(String name);
+		String getImageAdjust(void) const;
+        
+        
+        static CmdImageAdjust	msImageCmd;
+
+    protected:
+        Image					mColourImage;
+        bool                    mColourImageLoaded;
+		String					mColourImageName;
+
+        /** Internal method to load the image */
+        void _loadImage(void);
+    };
+
+
+}
+
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreColourImageAffectorFactory.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreColourImageAffectorFactory.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreColourImageAffectorFactory.h	(revision 5)
@@ -0,0 +1,57 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ColourImageAffectorFactory_H__
+#define __ColourImageAffectorFactory_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffectorFactory.h"
+#include "OgreColourImageAffector.h"
+
+namespace Ogre {
+
+    /** Factory class for ColourImageAffector. */
+    class _OgreParticleFXExport ColourImageAffectorFactory : public ParticleAffectorFactory
+    {
+        /** See ParticleAffectorFactory */
+        String getName() const { return "ColourImage"; }
+
+        /** See ParticleAffectorFactory */
+        ParticleAffector* createAffector(ParticleSystem* psys)
+        {
+            ParticleAffector* p = new ColourImageAffector(psys);
+            mAffectors.push_back(p);
+            return p;
+        }
+    };
+
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreColourInterpolatorAffector.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreColourInterpolatorAffector.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreColourInterpolatorAffector.h	(revision 5)
@@ -0,0 +1,98 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ColourInterpolatorAffector_H__
+#define __ColourInterpolatorAffector_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffector.h"
+#include "OgreStringInterface.h"
+#include "OgreColourValue.h"
+
+namespace Ogre {
+
+
+    class _OgreParticleFXExport ColourInterpolatorAffector : public ParticleAffector
+    {
+    public:
+		// this is something of a hack.. 
+		// needs to be replaced with something more.. 
+		// ..elegant
+		enum { MAX_STAGES = 6 };
+
+
+        /** Command object for red adjust (see ParamCommand).*/
+        class CmdColourAdjust : public ParamCommand
+        {
+		public:
+			size_t		mIndex;
+
+		public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Command object for red adjust (see ParamCommand).*/
+		class CmdTimeAdjust : public ParamCommand
+        {
+        public:
+			size_t		mIndex;
+
+		public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+		};
+
+        /** Default constructor. */
+        ColourInterpolatorAffector(ParticleSystem* psys);
+
+        /** See ParticleAffector. */
+        void _affectParticles(ParticleSystem* pSystem, Real timeElapsed);
+
+		void setColourAdjust(size_t index, ColourValue colour);
+		ColourValue getColourAdjust(size_t index) const;
+        
+		void setTimeAdjust(size_t index, Real time);
+        Real getTimeAdjust(size_t index) const;
+        
+        
+        static CmdColourAdjust	msColourCmd[MAX_STAGES];
+        static CmdTimeAdjust	msTimeCmd[MAX_STAGES];
+
+    protected:
+        ColourValue				mColourAdj[MAX_STAGES];
+		Real					mTimeAdj[MAX_STAGES];
+
+    };
+
+
+}
+
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreColourInterpolatorAffectorFactory.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreColourInterpolatorAffectorFactory.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreColourInterpolatorAffectorFactory.h	(revision 5)
@@ -0,0 +1,57 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ColourInterpolatorAffectorFactory_H__
+#define __ColourInterpolatorAffectorFactory_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffectorFactory.h"
+#include "OgreColourInterpolatorAffector.h"
+
+namespace Ogre {
+
+    /** Factory class for ColourInterpolatorAffector. */
+    class _OgreParticleFXExport ColourInterpolatorAffectorFactory : public ParticleAffectorFactory
+    {
+        /** See ParticleAffectorFactory */
+        String getName() const { return "ColourInterpolator"; }
+
+        /** See ParticleAffectorFactory */
+        ParticleAffector* createAffector(ParticleSystem* psys)
+        {
+            ParticleAffector* p = new ColourInterpolatorAffector(psys);
+            mAffectors.push_back(p);
+            return p;
+        }
+    };
+
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreCylinderEmitter.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreCylinderEmitter.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreCylinderEmitter.h	(revision 5)
@@ -0,0 +1,67 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright ) 2002 Tels <http://bloodgate.com> based on CylinderEmitter
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __CylinderEmitter_H__
+#define __CylinderEmitter_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreAreaEmitter.h"
+
+namespace Ogre {
+
+    /** Particle emitter which emits particles randomly from points inside a cylinder.
+    @remarks
+        This basic particle emitter emits particles from a cylinder area. The
+        initial direction of these particles can either be a single direction
+        (i.e. a line), a random scattering inside a cone, or a random
+        scattering in all directions, depending the 'angle' parameter, which
+        is the angle across which to scatter the particles either side of the
+        base direction of the emitter. 
+    */
+    class _OgreParticleFXExport CylinderEmitter : public AreaEmitter
+    {
+    public:
+        // See AreaEmitter
+
+        CylinderEmitter(ParticleSystem* psys);
+
+        /** See ParticleEmitter. */
+        void _initParticle(Particle* pParticle);
+
+    protected:
+        // See AreaEmitter
+
+
+
+
+    };
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreCylinderEmitterFactory.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreCylinderEmitterFactory.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreCylinderEmitterFactory.h	(revision 5)
@@ -0,0 +1,67 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright ) 2002 Tels >http://bloodgate.com> based on CylinderEmitter
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __CylinderEmitterFactory_H__
+#define __CylinderEmitterFactory_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleEmitterFactory.h"
+#include "OgreCylinderEmitter.h"
+
+
+namespace Ogre {
+
+    /** Factory class for particle emitter of type "Cylinder".
+    @remarks
+        Creates instances of CylinderEmitter to be used in particle systems. 
+    */
+    class _OgreParticleFXExport CylinderEmitterFactory : public ParticleEmitterFactory
+    {
+    protected:
+
+    public:
+        /** See ParticleEmitterFactory */
+        String getName() const
+        { 
+            return "Cylinder"; 
+        }
+
+        /** See ParticleEmitterFactory */
+        ParticleEmitter* createEmitter(ParticleSystem* psys) 
+        {
+            ParticleEmitter* emit = new CylinderEmitter(psys);
+            mEmitters.push_back(emit);
+            return emit;
+        }
+
+    };
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreDeflectorPlaneAffector.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreDeflectorPlaneAffector.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreDeflectorPlaneAffector.h	(revision 5)
@@ -0,0 +1,115 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __DeflectorPlaneAffector_H__
+#define __DeflectorPlaneAffector_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffector.h"
+#include "OgreVector3.h"
+
+
+namespace Ogre {
+
+    /** This class defines a ParticleAffector which deflects particles.
+    @remarks
+        This affector (see ParticleAffector) offers a simple (and inaccurate) physical deflection.
+        All particles which hit the plane are reflected.
+    @par
+        The plane is defined by a point (plane_point) and the normal (plane_normal).
+        In addition it is possible to change the strenght of the recoil by using the bounce parameter.
+    */
+    class _OgreParticleFXExport DeflectorPlaneAffector : public ParticleAffector
+    {
+    public:
+        /** Command object for plane point (see ParamCommand).*/
+        class CmdPlanePoint : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Command object for plane normal (see ParamCommand).*/
+        class CmdPlaneNormal : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Command object for bounce (see ParamCommand).*/
+        class CmdBounce : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /// Default constructor
+        DeflectorPlaneAffector(ParticleSystem* psys);
+
+        /** See ParticleAffector. */
+        void _affectParticles(ParticleSystem* pSystem, Real timeElapsed);
+
+        /** Sets the plane point of the deflector plane. */
+        void setPlanePoint(const Vector3& pos);
+
+        /** Gets the plane point of the deflector plane. */
+        Vector3 getPlanePoint(void) const;
+
+        /** Sets the plane normal of the deflector plane. */
+        void setPlaneNormal(const Vector3& normal);
+
+        /** Gets the plane normal of the deflector plane. */
+        Vector3 getPlaneNormal(void) const;
+
+        /** Sets the bounce value of the deflection. */
+        void setBounce(Real bounce);
+
+        /** Gets the bounce value of the deflection. */
+        Real getBounce(void) const;
+
+        /// Command objects
+        static CmdPlanePoint msPlanePointCmd;
+        static CmdPlaneNormal msPlaneNormalCmd;
+        static CmdBounce msBounceCmd;
+
+    protected:
+        /// deflector plane point
+        Vector3 mPlanePoint;
+        /// deflector plane normal vector
+        Vector3 mPlaneNormal;
+
+        /// bounce factor (0.5 means 50 percent)
+        Real mBounce;
+    };
+
+}
+
+#endif
Index: /PlugIns/ParticleFX/include/OgreDeflectorPlaneAffectorFactory.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreDeflectorPlaneAffectorFactory.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreDeflectorPlaneAffectorFactory.h	(revision 5)
@@ -0,0 +1,57 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __DeflectorPlaneAffectorFactory_H__
+#define __DeflectorPlaneAffectorFactory_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffectorFactory.h"
+#include "OgreDeflectorPlaneAffector.h"
+
+namespace Ogre {
+
+    /** Factory class for DeflectorPlaneAffector. */
+    class _OgreParticleFXExport DeflectorPlaneAffectorFactory : public ParticleAffectorFactory
+    {
+        /** See ParticleAffectorFactory */
+        String getName() const { return "DeflectorPlane"; }
+
+        /** See ParticleAffectorFactory */
+        ParticleAffector* createAffector(ParticleSystem* psys)
+        {
+            ParticleAffector* p = new DeflectorPlaneAffector(psys);
+            mAffectors.push_back(p);
+            return p;
+        }
+    };
+
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreDirectionRandomiserAffector.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreDirectionRandomiserAffector.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreDirectionRandomiserAffector.h	(revision 5)
@@ -0,0 +1,110 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __DirectionRandomiserAffector_H__
+#define __DirectionRandomiserAffector_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffector.h"
+#include "OgreVector3.h"
+
+
+namespace Ogre {
+
+    /** This class defines a ParticleAffector which applies randomness to the movement of the particles.
+    @remarks
+        This affector (see ParticleAffector) applies randomness to the movement of the particles by
+		changing the direction vectors.
+    @par
+        The most important parameter to control the effect is randomness. It controls the range in which changes
+        are applied to each axis of the direction vector.
+		The parameter scope can be used to limit the effect to a certain percentage of the particles.
+    */
+    class _OgreParticleFXExport DirectionRandomiserAffector : public ParticleAffector
+    {
+    public:
+        /** Command object for randomness (see ParamCommand).*/
+        class CmdRandomness : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+		/** Command object for scope (see ParamCommand).*/
+        class CmdScope : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+		/** Command object for keep_velocity (see ParamCommand).*/
+        class CmdKeepVelocity : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /// Default constructor
+        DirectionRandomiserAffector(ParticleSystem* psys);
+
+        /** See ParticleAffector. */
+        void _affectParticles(ParticleSystem* pSystem, Real timeElapsed);
+
+
+        /** Sets the randomness to apply to the particles in a system. */
+        void setRandomness(Real force);
+		/** Sets the scope (percentage of particles which are randomised). */
+        void setScope(Real force);
+		/** Set flag which detemines whether particle speed is changed. */
+        void setKeepVelocity(bool keepVelocity);
+
+        /** Gets the randomness to apply to the particles in a system. */
+        Real getRandomness(void) const;
+		/** Gets the scope (percentage of particles which are randomised). */
+        Real getScope(void) const;
+		/** Gets flag which detemines whether particle speed is changed. */
+        bool getKeepVelocity(void) const;
+
+        /// Command objects
+        static CmdRandomness msRandomnessCmd;
+		static CmdScope msScopeCmd;
+		static CmdKeepVelocity msKeepVelocityCmd;
+
+    protected:
+        Real mRandomness;
+		Real mScope;
+		bool mKeepVelocity;
+
+    };
+
+}
+
+#endif
Index: /PlugIns/ParticleFX/include/OgreDirectionRandomiserAffectorFactory.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreDirectionRandomiserAffectorFactory.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreDirectionRandomiserAffectorFactory.h	(revision 5)
@@ -0,0 +1,55 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __DirectionRandomiserAffectorFactory_H__
+#define __DirectionRandomiserAffectorFactory_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffectorFactory.h"
+#include "OgreDirectionRandomiserAffector.h"
+
+namespace Ogre {
+
+    /** Factory class for DirectionRandomiserAffector. */
+    class _OgreParticleFXExport DirectionRandomiserAffectorFactory : public ParticleAffectorFactory
+    {
+        /** See ParticleAffectorFactory */
+        String getName() const { return "DirectionRandomiser"; }
+
+        /** See ParticleAffectorFactory */
+        ParticleAffector* createAffector(ParticleSystem* psys)
+        {
+            ParticleAffector* p = new DirectionRandomiserAffector(psys);
+            mAffectors.push_back(p);
+            return p;
+        }
+    };
+
+}
+
+#endif
Index: /PlugIns/ParticleFX/include/OgreEllipsoidEmitter.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreEllipsoidEmitter.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreEllipsoidEmitter.h	(revision 5)
@@ -0,0 +1,64 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright ) 2002 Tels <http://bloodgate.com> based on BoxEmitter
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __EllipsoidEmitter_H__
+#define __EllipsoidEmitter_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreAreaEmitter.h"
+
+namespace Ogre {
+
+    /** Particle emitter which emits particles randomly from points inside an ellipsoid.
+    @remarks
+        This basic particle emitter emits particles from a ellipsoid area.
+        The initial direction of these particles can either be a single
+        direction (i.e. a line), a random scattering inside a cone, or a random
+        scattering in all directions, depending the 'angle' parameter, which
+        is the angle across which to scatter the particles either side of the
+        base direction of the emitter. 
+    */
+    class _OgreParticleFXExport EllipsoidEmitter : public AreaEmitter
+    {
+    public:
+        // See AreaEmitter
+
+        EllipsoidEmitter(ParticleSystem* psys);
+
+        /** See ParticleEmitter. */
+        void _initParticle(Particle* pParticle);
+
+    protected:
+        
+
+    };
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreEllipsoidEmitterFactory.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreEllipsoidEmitterFactory.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreEllipsoidEmitterFactory.h	(revision 5)
@@ -0,0 +1,67 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright ) 2002 Tels >http://bloodgate.com> based on BoxEmitter
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __EllipsoidEmitterFactory_H__
+#define __EllipsoidEmitterFactory_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleEmitterFactory.h"
+#include "OgreEllipsoidEmitter.h"
+
+
+namespace Ogre {
+
+    /** Factory class for particle emitter of type "Ellipsoid".
+    @remarks
+        Creates instances of EllipsoidEmitter to be used in particle systems. 
+    */
+    class _OgreParticleFXExport EllipsoidEmitterFactory : public ParticleEmitterFactory
+    {
+    protected:
+
+    public:
+        /** See ParticleEmitterFactory */
+        String getName() const
+        { 
+            return "Ellipsoid"; 
+        }
+
+        /** See ParticleEmitterFactory */
+        ParticleEmitter* createEmitter(ParticleSystem* psys) 
+        {
+            ParticleEmitter* emit = new EllipsoidEmitter(psys);
+            mEmitters.push_back(emit);
+            return emit;
+        }
+
+    };
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreHollowEllipsoidEmitter.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreHollowEllipsoidEmitter.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreHollowEllipsoidEmitter.h	(revision 5)
@@ -0,0 +1,126 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright ) 2002 Tels <http://bloodgate.com> based on BoxEmitter
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __HollowEllipsoidEmitter_H__
+#define __HollowEllipsoidEmitter_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreEllipsoidEmitter.h"
+
+namespace Ogre {
+
+    /** Particle emitter which emits particles randomly from points inside a hollow ellipsoid.
+    @remarks
+        This particle emitter emits particles from a hollow ellipsoid area.
+        The initial direction of these particles can either be a single
+        direction (i.e. a line), a random scattering inside a cone, or a random
+        scattering in all directions, depending the 'angle' parameter, which
+        is the angle across which to scatter the particles either side of the
+        base direction of the emitter. 
+    */
+    class _OgreParticleFXExport HollowEllipsoidEmitter : public EllipsoidEmitter
+    {
+    public:
+        /** Command object for inner size (see ParamCommand).*/
+        class CmdInnerX : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for inner size (see ParamCommand).*/
+        class CmdInnerY : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for inner size (see ParamCommand).*/
+        class CmdInnerZ : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        // See AreaEmitter
+
+        HollowEllipsoidEmitter(ParticleSystem* psys);
+
+        /** See ParticleEmitter. */
+        void _initParticle(Particle* pParticle);
+
+        /** Sets the size of the clear space inside the area from where NO particles are emitted.
+        @param x,y,z
+            Parametric values describing the proportion of the shape which is hollow in each direction.
+            E.g. 0 is solid, 0.5 is half-hollow etc
+        */
+        void setInnerSize(Real x, Real y, Real z);
+
+        /** Sets the x component of the area inside the ellipsoid which doesn't emit particles. 
+        @param x
+            Parametric value describing the proportion of the shape which is hollow in this direction.
+            E.g. 0 is solid, 0.5 is half-hollow etc
+        */
+        void setInnerSizeX(Real x);
+        /** Sets the y component of the area inside the ellipsoid which doesn't emit particles. 
+        @param y
+            Parametric value describing the proportion of the shape which is hollow in this direction.
+            E.g. 0 is solid, 0.5 is half-hollow etc
+        */
+        void setInnerSizeY(Real y);
+        /** Sets the z component of the area inside the ellipsoid which doesn't emit particles. 
+        @param z
+            Parametric value describing the proportion of the shape which is hollow in this direction.
+            E.g. 0 is solid, 0.5 is half-hollow etc
+        */
+        void setInnerSizeZ(Real z);
+        /** Gets the x component of the area inside the ellipsoid which doesn't emit particles. */
+        Real getInnerSizeX(void) const;
+        /** Gets the y component of the area inside the ellipsoid which doesn't emit particles. */
+        Real getInnerSizeY(void) const;
+        /** Gets the z component of the area inside the ellipsoid which doesn't emit particles. */
+        Real getInnerSizeZ(void) const;
+
+    protected:
+        // See ParticleEmitter
+
+        /// Size of 'clear' center area (> 0 and < 1.0)
+        Vector3 mInnerSize;
+
+        static CmdInnerX msCmdInnerX;
+        static CmdInnerY msCmdInnerY;
+        static CmdInnerZ msCmdInnerZ;
+
+
+
+    };
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreHollowEllipsoidEmitterFactory.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreHollowEllipsoidEmitterFactory.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreHollowEllipsoidEmitterFactory.h	(revision 5)
@@ -0,0 +1,67 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright ) 2002 Tels >http://bloodgate.com> based on BoxEmitter
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __HollowEllipsoidEmitterFactory_H__
+#define __HollowEllipsoidEmitterFactory_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleEmitterFactory.h"
+#include "OgreHollowEllipsoidEmitter.h"
+
+
+namespace Ogre {
+
+    /** Factory class for particle emitter of type "HollowEllipsoid".
+    @remarks
+        Creates instances of HollowEllipsoidEmitter to be used in particle systems. 
+    */
+    class _OgreParticleFXExport HollowEllipsoidEmitterFactory : public ParticleEmitterFactory
+    {
+    protected:
+
+    public:
+        /** See ParticleEmitterFactory */
+        String getName() const
+        { 
+            return "HollowEllipsoid"; 
+        }
+
+        /** See ParticleEmitterFactory */
+        ParticleEmitter* createEmitter(ParticleSystem* psys) 
+        {
+            ParticleEmitter* emit = new HollowEllipsoidEmitter(psys);
+            mEmitters.push_back(emit);
+            return emit;
+        }
+
+    };
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreLinearForceAffector.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreLinearForceAffector.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreLinearForceAffector.h	(revision 5)
@@ -0,0 +1,121 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __LinearForceAffector_H__
+#define __LinearForceAffector_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffector.h"
+#include "OgreVector3.h"
+
+
+namespace Ogre {
+
+    /** This class defines a ParticleAffector which applies a linear force to particles in a system.
+    @remarks
+        This affector (see ParticleAffector) applies a linear force, such as gravity, to a particle system.
+        This force can be applied in 2 ways: by taking the average of the particle's current momentum and the 
+        force vector, or by adding the force vector to the current particle's momentum. 
+    @par
+        The former approach is self-stabilising i.e. once a particle's momentum
+        is equal to the force vector, no further change is made to it's momentum. It also results in
+        a non-linear acceleration of particles.
+        The latter approach is simpler and applies a constant acceleration to particles. However,
+        it is not self-stabilising and can lead to perpetually increasing particle velocities. 
+        You choose the approach by calling the setForceApplication method.
+    */
+    class _OgreParticleFXExport LinearForceAffector : public ParticleAffector
+    {
+    public:
+        /** Command object for force vector (see ParamCommand).*/
+        class CmdForceVector : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Command object for force application (see ParamCommand).*/
+        class CmdForceApp : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Choice of how to apply the force vector to particles
+        enum ForceApplication
+        {
+            /// Take the average of the force vector and the particle momentum
+            FA_AVERAGE,
+            /// Add the force vector to the particle momentum
+            FA_ADD
+        };
+        /// Default constructor
+        LinearForceAffector(ParticleSystem* psys);
+
+        /** See ParticleAffector. */
+        void _affectParticles(ParticleSystem* pSystem, Real timeElapsed);
+
+
+        /** Sets the force vector to apply to the particles in a system. */
+        void setForceVector(const Vector3& force);
+
+        /** Gets the force vector to apply to the particles in a system. */
+        Vector3 getForceVector(void) const;
+
+        /** Sets how the force vector is applied to a particle. 
+        @remarks
+          The default is FA_ADD.
+        @param fa A member of the ForceApplication enum.
+        */
+        void setForceApplication(ForceApplication fa);
+
+        /** Retrieves how the force vector is applied to a particle. 
+        @param fa A member of the ForceApplication enum.
+        */
+        ForceApplication getForceApplication(void) const;
+
+        /// Command objects
+        static CmdForceVector msForceVectorCmd;
+        static CmdForceApp msForceAppCmd;
+
+    protected:
+        /// Force vector
+        Vector3 mForceVector;
+
+        /// How to apply force
+        ForceApplication mForceApplication;
+
+    };
+
+
+}
+
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreLinearForceAffectorFactory.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreLinearForceAffectorFactory.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreLinearForceAffectorFactory.h	(revision 5)
@@ -0,0 +1,57 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __LinearForceAffectorFactory_H__
+#define __LinearForceAffectorFactory_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffectorFactory.h"
+#include "OgreLinearForceAffector.h"
+
+namespace Ogre {
+
+    /** Factory class for LinearForceAffector. */
+    class _OgreParticleFXExport LinearForceAffectorFactory : public ParticleAffectorFactory
+    {
+        /** See ParticleAffectorFactory */
+        String getName() const { return "LinearForce"; }
+
+        /** See ParticleAffectorFactory */
+        ParticleAffector* createAffector(ParticleSystem* psys)
+        {
+            ParticleAffector* p = new LinearForceAffector(psys);
+            mAffectors.push_back(p);
+            return p;
+        }
+    };
+
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreParticleFXPlugin.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreParticleFXPlugin.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreParticleFXPlugin.h	(revision 5)
@@ -0,0 +1,67 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleFXPlugin_H__
+#define __ParticleFXPlugin_H__
+
+#include "OgrePlugin.h"
+#include "OgreParticleAffectorFactory.h"
+#include "OgreParticleEmitterFactory.h"
+
+namespace Ogre
+{
+
+	/** Plugin instance for ParticleFX Manager */
+	class ParticleFXPlugin : public Plugin
+	{
+	public:
+		ParticleFXPlugin();
+
+
+		/// @copydoc Plugin::getName
+		const String& getName() const;
+
+		/// @copydoc Plugin::install
+		void install();
+
+		/// @copydoc Plugin::initialise
+		void initialise();
+
+		/// @copydoc Plugin::shutdown
+		void shutdown();
+
+		/// @copydoc Plugin::uninstall
+		void uninstall();
+	protected:
+		std::vector<ParticleEmitterFactory*> mEmitterFactories;
+		std::vector<ParticleAffectorFactory*> mAffectorFactories;
+
+	};
+}
+
+#endif
Index: /PlugIns/ParticleFX/include/OgreParticleFXPrerequisites.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreParticleFXPrerequisites.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreParticleFXPrerequisites.h	(revision 5)
@@ -0,0 +1,69 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __SfxPluginPrerequisites_H__
+#define __SfxPluginPrerequisites_H__
+
+#include "OgrePrerequisites.h"
+
+//-----------------------------------------------------------------------
+// Windows Settings
+//-----------------------------------------------------------------------
+#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) && !defined(OGRE_STATIC_LIB)
+#   ifdef OGRE_PARTICLEFXPLUGIN_EXPORTS
+#       define _OgreParticleFXExport __declspec(dllexport)
+#   else
+#       if defined( __MINGW32__ )
+#           define _OgreParticleFXExport
+#       else
+#    		define _OgreParticleFXExport __declspec(dllimport)
+#       endif
+#   endif
+#elif defined ( OGRE_GCC_VISIBILITY )
+#    define _OgreParticleFXExport  __attribute__ ((visibility("default")))
+#else
+#   define _OgreParticleFXExport
+#endif
+
+
+namespace Ogre {
+
+    // Predeclare classes
+    class PointEmitter;
+    class PointEmitterFactory;
+    class LinearForceAffector;
+    class LinearForceAffectorFactory;
+	class DirectionRandomiserAffectorFactory;
+	class DeflectorPlaneAffectorFactory;
+
+
+
+}
+
+
+#endif
Index: /PlugIns/ParticleFX/include/OgrePointEmitter.h
===================================================================
--- /PlugIns/ParticleFX/include/OgrePointEmitter.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgrePointEmitter.h	(revision 5)
@@ -0,0 +1,63 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __PointEmitter_H__
+#define __PointEmitter_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleEmitter.h"
+
+namespace Ogre {
+
+    /** Particle emitter which emits particles from a single point.
+    @remarks
+        This basic particle emitter emits particles from a single point in space. The
+        initial direction of these particles can either be a single direction (i.e. a line),
+        a random scattering inside a cone, or a random scattering in all directions, 
+        depending the 'angle' parameter, which is the angle across which to scatter the 
+        particles either side of the base direction of the emitter. 
+    */
+    class _OgreParticleFXExport PointEmitter : public ParticleEmitter
+    {
+    public:
+        PointEmitter(ParticleSystem* psys);
+
+        /** See ParticleEmitter. */
+        void _initParticle(Particle* pParticle);
+
+        /** See ParticleEmitter. */
+        unsigned short _getEmissionCount(Real timeElapsed);
+
+
+
+
+    };
+
+}
+
+#endif
Index: /PlugIns/ParticleFX/include/OgrePointEmitterFactory.h
===================================================================
--- /PlugIns/ParticleFX/include/OgrePointEmitterFactory.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgrePointEmitterFactory.h	(revision 5)
@@ -0,0 +1,67 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __PointEmitterFactory_H__
+#define __PointEmitterFactory_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleEmitterFactory.h"
+#include "OgrePointEmitter.h"
+
+
+namespace Ogre {
+
+    /** Factory class for particle emitter of type "Point".
+    @remarks
+        Creates instances of PointEmitter to be used in particle systems. 
+    */
+    class _OgreParticleFXExport PointEmitterFactory : public ParticleEmitterFactory
+    {
+    protected:
+
+    public:
+        /** See ParticleEmitterFactory */
+        String getName() const
+        { 
+            return "Point"; 
+        }
+
+        /** See ParticleEmitterFactory */
+        ParticleEmitter* createEmitter(ParticleSystem* psys) 
+        {
+            ParticleEmitter* emit = new PointEmitter(psys);
+            mEmitters.push_back(emit);
+            return emit;
+        }
+
+    };
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreRingEmitter.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreRingEmitter.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreRingEmitter.h	(revision 5)
@@ -0,0 +1,111 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright ) 2002 Tels <http://bloodgate.com> based on BoxEmitter
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RingEmitter_H__
+#define __RingEmitter_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreAreaEmitter.h"
+#include "OgreMath.h"
+
+namespace Ogre {
+
+    /** Particle emitter which emits particles randomly from points inside a ring (e.g. a tube).
+    @remarks
+        This particle emitter emits particles from a ring-shaped area.
+        The initial direction of these particles can either be a single
+        direction (i.e. a line), a random scattering inside a cone, or a random
+        scattering in all directions, depending the 'angle' parameter, which
+        is the angle across which to scatter the particles either side of the
+        base direction of the emitter. 
+    */
+    class _OgreParticleFXExport RingEmitter : public AreaEmitter
+    {
+    public:
+        // See AreaEmitter
+        /** Command object for inner size (see ParamCommand).*/
+        class CmdInnerX : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /** Command object for inner size (see ParamCommand).*/
+        class CmdInnerY : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        RingEmitter(ParticleSystem* psys);
+
+        /** See ParticleEmitter. */
+        void _initParticle(Particle* pParticle);
+
+        /** Sets the size of the clear space inside the area from where NO particles are emitted.
+        @param x,y,z
+            Parametric values describing the proportion of the shape which is hollow in each direction.
+            E.g. 0 is solid, 0.5 is half-hollow etc
+        */
+        void setInnerSize(Real x, Real y);
+
+        /** Sets the x component of the area inside the ellipsoid which doesn't emit particles. 
+        @param x
+            Parametric value describing the proportion of the shape which is hollow in this direction.
+            E.g. 0 is solid, 0.5 is half-hollow etc
+        */
+        void setInnerSizeX(Real x);
+        /** Sets the y component of the area inside the ellipsoid which doesn't emit particles. 
+        @param y
+            Parametric value describing the proportion of the shape which is hollow in this direction.
+            E.g. 0 is solid, 0.5 is half-hollow etc
+        */
+        void setInnerSizeY(Real y);
+        /** Gets the x component of the area inside the ellipsoid which doesn't emit particles. */
+        Real getInnerSizeX(void) const;
+        /** Gets the y component of the area inside the ellipsoid which doesn't emit particles. */
+        Real getInnerSizeY(void) const;
+
+    protected:
+        // See ParticleEmitter
+        static CmdInnerX msCmdInnerX;
+        static CmdInnerY msCmdInnerY;
+
+        /// Size of 'clear' center area (> 0 and < 1.0)
+        Real mInnerSizex;
+        Real mInnerSizey;
+
+
+
+    };
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreRingEmitterFactory.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreRingEmitterFactory.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreRingEmitterFactory.h	(revision 5)
@@ -0,0 +1,67 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright ) 2002 Tels >http://bloodgate.com> based on BoxEmitter
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RingEmitterFactory_H__
+#define __RingEmitterFactory_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleEmitterFactory.h"
+#include "OgreRingEmitter.h"
+
+
+namespace Ogre {
+
+    /** Factory class for particle emitter of type "Ring".
+    @remarks
+        Creates instances of RingEmitter to be used in particle systems. 
+    */
+    class _OgreParticleFXExport RingEmitterFactory : public ParticleEmitterFactory
+    {
+    protected:
+
+    public:
+        /** See ParticleEmitterFactory */
+        String getName() const
+        { 
+            return "Ring"; 
+        }
+
+        /** See ParticleEmitterFactory */
+        ParticleEmitter* createEmitter(ParticleSystem* psys) 
+        {
+            ParticleEmitter* emit = new RingEmitter(psys);
+            mEmitters.push_back(emit);
+            return emit;
+        }
+
+    };
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreRotationAffector.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreRotationAffector.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreRotationAffector.h	(revision 5)
@@ -0,0 +1,152 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RotationAffector_H__
+#define __RotationAffector_H__
+
+#include "OgreMath.h"
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffector.h"
+#include "OgreStringInterface.h"
+
+namespace Ogre {
+
+
+    /** This plugin subclass of ParticleAffector allows you to alter the rotation of particles.
+    @remarks
+        This class supplies the ParticleAffector implementation required to make the particle expand
+		or contract in mid-flight.
+    */
+    class _OgreParticleFXExport RotationAffector : public ParticleAffector
+    {
+    public:
+		/// Command object for particle emitter  - see ParamCommand 
+        class CmdRotationSpeedRangeStart : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /// Command object for particle emitter  - see ParamCommand 
+        class CmdRotationSpeedRangeEnd : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+		/// Command object for particle emitter  - see ParamCommand 
+        class CmdRotationRangeStart : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /// Command object for particle emitter  - see ParamCommand 
+        class CmdRotationRangeEnd : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Default constructor. */
+        RotationAffector(ParticleSystem* psys);
+
+        /** See ParticleAffector. */
+		void _initParticle(Particle* pParticle);
+
+        /** See ParticleAffector. */
+        void _affectParticles(ParticleSystem* pSystem, Real timeElapsed);
+
+
+
+		/** Sets the minimum rotation speed of particles to be emitted. */
+        void setRotationSpeedRangeStart(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void setRotationSpeedRangeStart(Real angle) {
+            setRotationSpeedRangeStart(Angle(angle));
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+        /** Sets the maximum rotation speed of particles to be emitted. */
+        void setRotationSpeedRangeEnd(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void setRotationSpeedRangeEnd(Real angle) {
+            setRotationSpeedRangeEnd(Angle(angle));
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+        /** Gets the minimum rotation speed of particles to be emitted. */
+        const Radian& getRotationSpeedRangeStart(void) const;
+        /** Gets the maximum rotation speed of particles to be emitted. */
+        const Radian& getRotationSpeedRangeEnd(void) const;
+
+		
+		/** Sets the minimum rotation angle of particles to be emitted. */
+        void setRotationRangeStart(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void setRotationRangeStart(Real angle) {
+            setRotationRangeStart(Angle(angle));
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+        /** Sets the maximum rotation angle of particles to be emitted. */
+        void setRotationRangeEnd(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void setRotationRangeEnd(Real angle) {
+            setRotationRangeEnd(Angle(angle));
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+        /** Gets the minimum rotation of particles to be emitted. */
+        const Radian& getRotationRangeStart(void) const;
+        /** Gets the maximum rotation of particles to be emitted. */
+        const Radian& getRotationRangeEnd(void) const;
+
+		static CmdRotationSpeedRangeStart	msRotationSpeedRangeStartCmd;
+        static CmdRotationSpeedRangeEnd		msRotationSpeedRangeEndCmd;
+        static CmdRotationRangeStart		msRotationRangeStartCmd;
+        static CmdRotationRangeEnd			msRotationRangeEndCmd;
+        
+    protected:
+        /// Initial rotation speed of particles (range start)
+        Radian mRotationSpeedRangeStart;
+        /// Initial rotation speed of particles (range end)
+        Radian mRotationSpeedRangeEnd;
+        /// Initial rotation angle of particles (range start)
+        Radian mRotationRangeStart;
+        /// Initial rotation angle of particles (range end)
+        Radian mRotationRangeEnd;
+
+    };
+
+
+}
+
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreRotationAffectorFactory.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreRotationAffectorFactory.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreRotationAffectorFactory.h	(revision 5)
@@ -0,0 +1,57 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RotationAffectorFactory_H__
+#define __RotationAffectorFactory_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffectorFactory.h"
+#include "OgreRotationAffector.h"
+
+namespace Ogre {
+
+    /** Factory class for RotationAffector. */
+    class _OgreParticleFXExport RotationAffectorFactory : public ParticleAffectorFactory
+    {
+        /** See ParticleAffectorFactory */
+        String getName() const { return "Rotator"; }
+
+        /** See ParticleAffectorFactory */
+        ParticleAffector* createAffector(ParticleSystem* psys)
+        {
+            ParticleAffector* p = new RotationAffector(psys);
+            mAffectors.push_back(p);
+            return p;
+        }
+    };
+
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreScaleAffector.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreScaleAffector.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreScaleAffector.h	(revision 5)
@@ -0,0 +1,85 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ScaleAffector_H__
+#define __ScaleAffector_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffector.h"
+#include "OgreStringInterface.h"
+
+namespace Ogre {
+
+
+    /** This plugin subclass of ParticleAffector allows you to alter the scale of particles.
+    @remarks
+        This class supplies the ParticleAffector implementation required to make the particle expand
+		or contract in mid-flight.
+    */
+    class _OgreParticleFXExport ScaleAffector : public ParticleAffector
+    {
+    public:
+
+        /** Command object for scale adjust (see ParamCommand).*/
+        class CmdScaleAdjust : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+        /** Default constructor. */
+        ScaleAffector(ParticleSystem* psys);
+
+        /** See ParticleAffector. */
+        void _affectParticles(ParticleSystem* pSystem, Real timeElapsed);
+
+        /** Sets the scale adjustment to be made per second to particles. 
+        @param Rate
+            Sets the adjustment to be made to the x and y scale components per second. These
+            values will be added to the scale of all particles every second, scaled over each frame
+            for a smooth adjustment.
+        */
+        void setAdjust( Real rate );
+
+        /** Gets the scale adjustment to be made per second to particles. */
+        Real getAdjust(void) const;
+
+        static CmdScaleAdjust msScaleCmd;
+
+    protected:
+        Real mScaleAdj;
+
+    };
+
+
+}
+
+
+#endif
+
Index: /PlugIns/ParticleFX/include/OgreScaleAffectorFactory.h
===================================================================
--- /PlugIns/ParticleFX/include/OgreScaleAffectorFactory.h	(revision 5)
+++ /PlugIns/ParticleFX/include/OgreScaleAffectorFactory.h	(revision 5)
@@ -0,0 +1,57 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ScaleAffectorFactory_H__
+#define __ScaleAffectorFactory_H__
+
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreParticleAffectorFactory.h"
+#include "OgreScaleAffector.h"
+
+namespace Ogre {
+
+    /** Factory class for ScaleAffector. */
+    class _OgreParticleFXExport ScaleAffectorFactory : public ParticleAffectorFactory
+    {
+        /** See ParticleAffectorFactory */
+        String getName() const { return "Scaler"; }
+
+        /** See ParticleAffectorFactory */
+        ParticleAffector* createAffector(ParticleSystem* psys)
+        {
+            ParticleAffector* p = new ScaleAffector(psys);
+            mAffectors.push_back(p);
+            return p;
+        }
+    };
+
+
+}
+
+#endif
+
Index: /PlugIns/ParticleFX/scripts/Plugin_ParticleFX.cbp
===================================================================
--- /PlugIns/ParticleFX/scripts/Plugin_ParticleFX.cbp	(revision 5)
+++ /PlugIns/ParticleFX/scripts/Plugin_ParticleFX.cbp	(revision 5)
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Plugin_ParticleFX" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\lib\Plugin_ParticleFX_d.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\lib\Plugin_ParticleFX.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O2" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add option="-D_USRDLL" />
+			<Add option="-DOGRE_PARTICLEFXPLUGIN_EXPORTS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\OgreAreaEmitter.h" />
+		<Unit filename="..\include\OgreBoxEmitter.h" />
+		<Unit filename="..\include\OgreBoxEmitterFactory.h" />
+		<Unit filename="..\include\OgreColourFaderAffector.h" />
+		<Unit filename="..\include\OgreColourFaderAffector2.h" />
+		<Unit filename="..\include\OgreColourFaderAffectorFactory.h" />
+		<Unit filename="..\include\OgreColourFaderAffectorFactory2.h" />
+		<Unit filename="..\include\OgreColourImageAffector.h" />
+		<Unit filename="..\include\OgreColourImageAffectorFactory.h" />
+		<Unit filename="..\include\OgreColourInterpolatorAffector.h" />
+		<Unit filename="..\include\OgreCylinderEmitter.h" />
+		<Unit filename="..\include\OgreCylinderEmitterFactory.h" />
+		<Unit filename="..\include\OgreDeflectorPlaneAffector.h" />
+		<Unit filename="..\include\OgreDeflectorPlaneAffectorFactory.h" />
+		<Unit filename="..\include\OgreDirectionRandomiserAffector.h" />
+		<Unit filename="..\include\OgreDirectionRandomiserAffectorFactory.h" />
+		<Unit filename="..\include\OgreEllipsoidEmitter.h" />
+		<Unit filename="..\include\OgreEllipsoidEmitterFactory.h" />
+		<Unit filename="..\include\OgreHollowEllipsoidEmitter.h" />
+		<Unit filename="..\include\OgreHollowEllipsoidEmitterFactory.h" />
+		<Unit filename="..\include\OgreLinearForceAffector.h" />
+		<Unit filename="..\include\OgreLinearForceAffectorFactory.h" />
+		<Unit filename="..\include\OgreParticleFXPlugin.h" />
+		<Unit filename="..\include\OgreParticleFXPrerequisites.h" />
+		<Unit filename="..\include\OgrePointEmitter.h" />
+		<Unit filename="..\include\OgrePointEmitterFactory.h" />
+		<Unit filename="..\include\OgreRingEmitter.h" />
+		<Unit filename="..\include\OgreRingEmitterFactory.h" />
+		<Unit filename="..\include\OgreRotationAffector.h" />
+		<Unit filename="..\include\OgreRotationAffectorFactory.h" />
+		<Unit filename="..\include\OgreScaleAffector.h" />
+		<Unit filename="..\include\OgreScaleAffectorFactory.h" />
+		<Unit filename="..\misc\OgreParticleFXDll.def" />
+		<Unit filename="..\src\OgreAreaEmitter.cpp" />
+		<Unit filename="..\src\OgreBoxEmitter.cpp" />
+		<Unit filename="..\src\OgreColourFaderAffector.cpp" />
+		<Unit filename="..\src\OgreColourFaderAffector2.cpp" />
+		<Unit filename="..\src\OgreColourImageAffector.cpp" />
+		<Unit filename="..\src\OgreColourInterpolatorAffector.cpp" />
+		<Unit filename="..\src\OgreCylinderEmitter.cpp" />
+		<Unit filename="..\src\OgreDeflectorPlaneAffector.cpp" />
+		<Unit filename="..\src\OgreDirectionRandomiserAffector.cpp" />
+		<Unit filename="..\src\OgreEllipsoidEmitter.cpp" />
+		<Unit filename="..\src\OgreHollowEllipsoidEmitter.cpp" />
+		<Unit filename="..\src\OgreLinearForceAffector.cpp" />
+		<Unit filename="..\src\OgreParticleFX.cpp" />
+		<Unit filename="..\src\OgreParticleFXPlugin.cpp" />
+		<Unit filename="..\src\OgrePointEmitter.cpp" />
+		<Unit filename="..\src\OgreRingEmitter.cpp" />
+		<Unit filename="..\src\OgreRotationAffector.cpp" />
+		<Unit filename="..\src\OgreScaleAffector.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /PlugIns/ParticleFX/scripts/Plugin_ParticleFX.vcproj
===================================================================
--- /PlugIns/ParticleFX/scripts/Plugin_ParticleFX.vcproj	(revision 5)
+++ /PlugIns/ParticleFX/scripts/Plugin_ParticleFX.vcproj	(revision 5)
@@ -0,0 +1,420 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Plugin_ParticleFX"
+	ProjectGUID="{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="FALSE"
+				OptimizeForProcessor="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\zlib\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_PARTICLEFXPLUGIN_EXPORTS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="2"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain_d.lib"
+				OutputFile="$(OutDir)/$(ProjectName)_d.dll"
+				Version="0.99"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName)_d.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="
+"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="0"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\zlib\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_PARTICLEFXPLUGIN_EXPORTS"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain.lib"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="
+"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="0">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="FALSE"
+				OptimizeForProcessor="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\zlib\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_PARTICLEFXPLUGIN_EXPORTS;OGRE_STATIC_LIB"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="2"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)/$(ProjectName)Static_d.lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="
+"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="0"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\zlib\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_PARTICLEFXPLUGIN_EXPORTS;OGRE_STATIC_LIB"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)/$(ProjectName)Static.lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="
+"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\OgreAreaEmitter.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreBoxEmitter.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreColourFaderAffector.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreColourFaderAffector2.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreColourImageAffector.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreColourInterpolatorAffector.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCylinderEmitter.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreDeflectorPlaneAffector.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreDirectionRandomiserAffector.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreEllipsoidEmitter.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreHollowEllipsoidEmitter.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreLinearForceAffector.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreParticleFX.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreParticleFXPlugin.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgrePointEmitter.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRingEmitter.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRotationAffector.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreScaleAffector.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\OgreAreaEmitter.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreBoxEmitter.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreBoxEmitterFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreColourFaderAffector.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreColourFaderAffector2.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreColourFaderAffectorFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreColourFaderAffectorFactory2.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreColourImageAffector.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreColourImageAffectorFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreColourInterpolatorAffector.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCylinderEmitter.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCylinderEmitterFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreDeflectorPlaneAffector.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreDeflectorPlaneAffectorFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreDirectionRandomiserAffector.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreDirectionRandomiserAffectorFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreEllipsoidEmitter.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreEllipsoidEmitterFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreHollowEllipsoidEmitter.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreHollowEllipsoidEmitterFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreLinearForceAffector.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreLinearForceAffectorFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleFXPlugin.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleFXPrerequisites.h">
+			</File>
+			<File
+				RelativePath="..\include\OgrePointEmitter.h">
+			</File>
+			<File
+				RelativePath="..\include\OgrePointEmitterFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRingEmitter.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRingEmitterFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRotationAffector.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRotationAffectorFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreScaleAffector.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreScaleAffectorFactory.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp
===================================================================
--- /PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp	(revision 5)
+++ /PlugIns/ParticleFX/scripts/Plugin_ParticleFX_linux.cbp	(revision 5)
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Plugin_ParticleFX" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="../../../lib/Plugin_ParticleFX_d.so" prefix_auto="0" extension_auto="0" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cp $($(TARGET_NAME)_OUTPUT_FILE) ../../../Samples/Common/bin/$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="../../../lib/Plugin_ParticleFX.so" prefix_auto="0" extension_auto="0" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O2" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cp $($(TARGET_NAME)_OUTPUT_FILE) ../../../Samples/Common/bin/$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-fvisibility=hidden" />
+			<Add option="-fvisibility-inlines-hidden" />
+			<Add option="-fPIC" />
+			<Add option="-DOGRE_PARTICLEFXPLUGIN_EXPORTS" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add option="-DOGRE_GCC_VISIBILITY" />
+			<Add option="-DPIC" />
+			<Add directory="../include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../../Samples/Common/bin/$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="../include/OgreAreaEmitter.h" />
+		<Unit filename="../include/OgreBoxEmitter.h" />
+		<Unit filename="../include/OgreBoxEmitterFactory.h" />
+		<Unit filename="../include/OgreColourFaderAffector.h" />
+		<Unit filename="../include/OgreColourFaderAffector2.h" />
+		<Unit filename="../include/OgreColourFaderAffectorFactory.h" />
+		<Unit filename="../include/OgreColourFaderAffectorFactory2.h" />
+		<Unit filename="../include/OgreColourImageAffector.h" />
+		<Unit filename="../include/OgreColourImageAffectorFactory.h" />
+		<Unit filename="../include/OgreColourInterpolatorAffector.h" />
+		<Unit filename="../include/OgreCylinderEmitter.h" />
+		<Unit filename="../include/OgreCylinderEmitterFactory.h" />
+		<Unit filename="../include/OgreDeflectorPlaneAffector.h" />
+		<Unit filename="../include/OgreDeflectorPlaneAffectorFactory.h" />
+		<Unit filename="../include/OgreDirectionRandomiserAffector.h" />
+		<Unit filename="../include/OgreDirectionRandomiserAffectorFactory.h" />
+		<Unit filename="../include/OgreEllipsoidEmitter.h" />
+		<Unit filename="../include/OgreEllipsoidEmitterFactory.h" />
+		<Unit filename="../include/OgreHollowEllipsoidEmitter.h" />
+		<Unit filename="../include/OgreHollowEllipsoidEmitterFactory.h" />
+		<Unit filename="../include/OgreLinearForceAffector.h" />
+		<Unit filename="../include/OgreLinearForceAffectorFactory.h" />
+		<Unit filename="../include/OgreParticleFXPlugin.h" />
+		<Unit filename="../include/OgreParticleFXPrerequisites.h" />
+		<Unit filename="../include/OgrePointEmitter.h" />
+		<Unit filename="../include/OgrePointEmitterFactory.h" />
+		<Unit filename="../include/OgreRingEmitter.h" />
+		<Unit filename="../include/OgreRingEmitterFactory.h" />
+		<Unit filename="../include/OgreRotationAffector.h" />
+		<Unit filename="../include/OgreRotationAffectorFactory.h" />
+		<Unit filename="../include/OgreScaleAffector.h" />
+		<Unit filename="../include/OgreScaleAffectorFactory.h" />
+		<Unit filename="../misc/OgreParticleFXDll.def" />
+		<Unit filename="../src/OgreAreaEmitter.cpp" />
+		<Unit filename="../src/OgreBoxEmitter.cpp" />
+		<Unit filename="../src/OgreColourFaderAffector.cpp" />
+		<Unit filename="../src/OgreColourFaderAffector2.cpp" />
+		<Unit filename="../src/OgreColourImageAffector.cpp" />
+		<Unit filename="../src/OgreColourInterpolatorAffector.cpp" />
+		<Unit filename="../src/OgreCylinderEmitter.cpp" />
+		<Unit filename="../src/OgreDeflectorPlaneAffector.cpp" />
+		<Unit filename="../src/OgreDirectionRandomiserAffector.cpp" />
+		<Unit filename="../src/OgreEllipsoidEmitter.cpp" />
+		<Unit filename="../src/OgreHollowEllipsoidEmitter.cpp" />
+		<Unit filename="../src/OgreLinearForceAffector.cpp" />
+		<Unit filename="../src/OgreParticleFX.cpp" />
+		<Unit filename="../src/OgreParticleFXPlugin.cpp" />
+		<Unit filename="../src/OgrePointEmitter.cpp" />
+		<Unit filename="../src/OgreRingEmitter.cpp" />
+		<Unit filename="../src/OgreRotationAffector.cpp" />
+		<Unit filename="../src/OgreScaleAffector.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /PlugIns/ParticleFX/scripts/Plugin_ParticleFX_stlp.cbp
===================================================================
--- /PlugIns/ParticleFX/scripts/Plugin_ParticleFX_stlp.cbp	(revision 5)
+++ /PlugIns/ParticleFX/scripts/Plugin_ParticleFX_stlp.cbp	(revision 5)
@@ -0,0 +1,395 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Plugin_ParticleFX" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\lib\Plugin_ParticleFX_d.dll" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\lib\Plugin_ParticleFX.dll" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O2" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="stlport.5.1" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add option="-D_USRDLL" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\OgreAreaEmitter.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreBoxEmitter.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreBoxEmitterFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreColourFaderAffector.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreColourFaderAffector2.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreColourFaderAffectorFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreColourFaderAffectorFactory2.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreColourImageAffector.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreColourImageAffectorFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreColourInterpolatorAffector.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCylinderEmitter.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCylinderEmitterFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreDeflectorPlaneAffector.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreDeflectorPlaneAffectorFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreDirectionRandomiserAffector.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreDirectionRandomiserAffectorFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreEllipsoidEmitter.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreEllipsoidEmitterFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreHollowEllipsoidEmitter.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreHollowEllipsoidEmitterFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreLinearForceAffector.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreLinearForceAffectorFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreParticleFXPrerequisites.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreParticleFXPlugin.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgrePointEmitter.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgrePointEmitterFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRingEmitter.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRingEmitterFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRotationAffector.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRotationAffectorFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreScaleAffector.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreScaleAffectorFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\misc\OgreParticleFXDll.def">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreAreaEmitter.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreBoxEmitter.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreColourFaderAffector.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreColourFaderAffector2.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreColourImageAffector.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreColourInterpolatorAffector.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCylinderEmitter.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreDeflectorPlaneAffector.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreDirectionRandomiserAffector.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreEllipsoidEmitter.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreHollowEllipsoidEmitter.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreLinearForceAffector.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreParticleFX.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreParticleFXPlugin.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgrePointEmitter.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRingEmitter.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRotationAffector.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreScaleAffector.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /PlugIns/ParticleFX/scripts/Plugin_ParticleFX_vc8.vcproj
===================================================================
--- /PlugIns/ParticleFX/scripts/Plugin_ParticleFX_vc8.vcproj	(revision 5)
+++ /PlugIns/ParticleFX/scripts/Plugin_ParticleFX_vc8.vcproj	(revision 5)
@@ -0,0 +1,574 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Plugin_ParticleFX"
+	ProjectGUID="{C61A6060-5F0B-4B83-A0BC-678CCDA98FF6}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\zlib\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_PARTICLEFXPLUGIN_EXPORTS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="&#x0D;&#x0A;"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain_d.lib"
+				OutputFile="$(OutDir)/Plugin_ParticleFX_d.dll"
+				Version="0.99"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName)_d.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				ImportLibrary="$(OutDir)/Plugin_ParticleFX_d.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="0"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				EnableFiberSafeOptimizations="true"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\zlib\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_PARTICLEFXPLUGIN_EXPORTS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="&#x0D;&#x0A;"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain.lib"
+				OutputFile="$(OutDir)/Plugin_ParticleFX.dll"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				ImportLibrary=""
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\zlib\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_STATIC_LIB"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="&#x0D;&#x0A;"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)\$(ProjectName)Static_d.lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="0"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				EnableFiberSafeOptimizations="true"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\zlib\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_STATIC_LIB"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="&#x0D;&#x0A;"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)\$(ProjectName)Static.lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine=""
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\OgreAreaEmitter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreBoxEmitter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreColourFaderAffector.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreColourFaderAffector2.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreColourImageAffector.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreColourInterpolatorAffector.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCylinderEmitter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreDeflectorPlaneAffector.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreDirectionRandomiserAffector.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreEllipsoidEmitter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreHollowEllipsoidEmitter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreLinearForceAffector.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreParticleFX.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreParticleFXPlugin.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgrePointEmitter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRingEmitter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRotationAffector.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreScaleAffector.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\OgreAreaEmitter.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreBoxEmitter.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreBoxEmitterFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreColourFaderAffector.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreColourFaderAffector2.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreColourFaderAffectorFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreColourFaderAffectorFactory2.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreColourImageAffector.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreColourImageAffectorFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreColourInterpolatorAffector.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCylinderEmitter.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCylinderEmitterFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreDeflectorPlaneAffector.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreDeflectorPlaneAffectorFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreDirectionRandomiserAffector.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreDirectionRandomiserAffectorFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreEllipsoidEmitter.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreEllipsoidEmitterFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreHollowEllipsoidEmitter.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreHollowEllipsoidEmitterFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreLinearForceAffector.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreLinearForceAffectorFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleFXPlugin.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreParticleFXPrerequisites.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgrePointEmitter.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgrePointEmitterFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRingEmitter.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRingEmitterFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRotationAffector.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRotationAffectorFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreScaleAffector.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreScaleAffectorFactory.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /PlugIns/ParticleFX/src/Makefile.am
===================================================================
--- /PlugIns/ParticleFX/src/Makefile.am	(revision 5)
+++ /PlugIns/ParticleFX/src/Makefile.am	(revision 5)
@@ -0,0 +1,25 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/PlugIns/ParticleFX/include -I$(top_srcdir)/OgreMain/include -DPLUGIN_ParticleFX_EXPORTS
+
+pkglib_LTLIBRARIES = Plugin_ParticleFX.la
+
+Plugin_ParticleFX_la_SOURCES = OgreAreaEmitter.cpp \
+                        OgreBoxEmitter.cpp \
+                        OgreColourFaderAffector.cpp \
+                        OgreColourFaderAffector2.cpp \
+						OgreColourImageAffector.cpp \
+						OgreColourInterpolatorAffector.cpp \
+                        OgreCylinderEmitter.cpp \
+						OgreDeflectorPlaneAffector.cpp \
+						OgreDirectionRandomiserAffector.cpp \
+                        OgreEllipsoidEmitter.cpp \
+                        OgreHollowEllipsoidEmitter.cpp \
+                        OgreLinearForceAffector.cpp \
+                        OgreParticleFX.cpp \
+                        OgreParticleFXPlugin.cpp \
+                        OgrePointEmitter.cpp \
+                        OgreRingEmitter.cpp \
+						OgreRotationAffector.cpp \
+						OgreScaleAffector.cpp 
+
+Plugin_ParticleFX_la_LDFLAGS = -module $(PLUGIN_FLAGS) -L$(top_builddir)/OgreMain/src -Wl,-z,defs
+Plugin_ParticleFX_la_LIBADD = -lOgreMain $(OGRE_THREAD_LIBS)
Index: /PlugIns/ParticleFX/src/Makefile.in
===================================================================
--- /PlugIns/ParticleFX/src/Makefile.in	(revision 5)
+++ /PlugIns/ParticleFX/src/Makefile.in	(revision 5)
@@ -0,0 +1,573 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = PlugIns/ParticleFX/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+pkglibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+Plugin_ParticleFX_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_Plugin_ParticleFX_la_OBJECTS = OgreAreaEmitter.lo OgreBoxEmitter.lo \
+	OgreColourFaderAffector.lo OgreColourFaderAffector2.lo \
+	OgreColourImageAffector.lo OgreColourInterpolatorAffector.lo \
+	OgreCylinderEmitter.lo OgreDeflectorPlaneAffector.lo \
+	OgreDirectionRandomiserAffector.lo OgreEllipsoidEmitter.lo \
+	OgreHollowEllipsoidEmitter.lo OgreLinearForceAffector.lo \
+	OgreParticleFX.lo OgreParticleFXPlugin.lo OgrePointEmitter.lo \
+	OgreRingEmitter.lo OgreRotationAffector.lo \
+	OgreScaleAffector.lo
+Plugin_ParticleFX_la_OBJECTS = $(am_Plugin_ParticleFX_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Plugin_ParticleFX_la_SOURCES)
+DIST_SOURCES = $(Plugin_ParticleFX_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/PlugIns/ParticleFX/include -I$(top_srcdir)/OgreMain/include -DPLUGIN_ParticleFX_EXPORTS
+pkglib_LTLIBRARIES = Plugin_ParticleFX.la
+Plugin_ParticleFX_la_SOURCES = OgreAreaEmitter.cpp \
+                        OgreBoxEmitter.cpp \
+                        OgreColourFaderAffector.cpp \
+                        OgreColourFaderAffector2.cpp \
+						OgreColourImageAffector.cpp \
+						OgreColourInterpolatorAffector.cpp \
+                        OgreCylinderEmitter.cpp \
+						OgreDeflectorPlaneAffector.cpp \
+						OgreDirectionRandomiserAffector.cpp \
+                        OgreEllipsoidEmitter.cpp \
+                        OgreHollowEllipsoidEmitter.cpp \
+                        OgreLinearForceAffector.cpp \
+                        OgreParticleFX.cpp \
+                        OgreParticleFXPlugin.cpp \
+                        OgrePointEmitter.cpp \
+                        OgreRingEmitter.cpp \
+						OgreRotationAffector.cpp \
+						OgreScaleAffector.cpp 
+
+Plugin_ParticleFX_la_LDFLAGS = -module $(PLUGIN_FLAGS) -L$(top_builddir)/OgreMain/src -Wl,-z,defs
+Plugin_ParticleFX_la_LIBADD = -lOgreMain $(OGRE_THREAD_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  PlugIns/ParticleFX/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  PlugIns/ParticleFX/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)"
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    f=$(am__strip_dir) \
+	    echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	    $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  p=$(am__strip_dir) \
+	  echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \
+	  $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+Plugin_ParticleFX.la: $(Plugin_ParticleFX_la_OBJECTS) $(Plugin_ParticleFX_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(Plugin_ParticleFX_la_LDFLAGS) $(Plugin_ParticleFX_la_OBJECTS) $(Plugin_ParticleFX_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreAreaEmitter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreBoxEmitter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreColourFaderAffector.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreColourFaderAffector2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreColourImageAffector.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreColourInterpolatorAffector.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCylinderEmitter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreDeflectorPlaneAffector.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreDirectionRandomiserAffector.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreEllipsoidEmitter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreHollowEllipsoidEmitter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreLinearForceAffector.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreParticleFX.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreParticleFXPlugin.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgrePointEmitter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRingEmitter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRotationAffector.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreScaleAffector.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-pkglibLTLIBRARIES install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-pkglibLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /PlugIns/ParticleFX/src/OgreAreaEmitter.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgreAreaEmitter.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgreAreaEmitter.cpp	(revision 5)
@@ -0,0 +1,189 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright ) 2002 Tels <http://bloodgate.com> Based on OgrreBoxEmitter
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreAreaEmitter.h"
+#include "OgreParticle.h"
+#include "OgreQuaternion.h"
+#include "OgreException.h"
+#include "OgreStringConverter.h"
+
+
+
+namespace Ogre {
+
+    // Instatiate statics
+    AreaEmitter::CmdWidth AreaEmitter::msWidthCmd;
+    AreaEmitter::CmdHeight AreaEmitter::msHeightCmd;
+    AreaEmitter::CmdDepth AreaEmitter::msDepthCmd;
+
+    //-----------------------------------------------------------------------
+    bool AreaEmitter::initDefaults(const String& t)
+    {
+        // called by the constructor as initDefaults("Type")
+
+        // Defaults
+        mDirection = Vector3::UNIT_Z;
+        mUp = Vector3::UNIT_Y;
+        setSize(100,100,100);
+        mType = t;
+
+        // Set up parameters
+        if (createParamDictionary(mType + "Emitter"))
+        {
+
+            addBaseParameters();
+            ParamDictionary* dict = getParamDictionary();
+
+            // Custom params
+            dict->addParameter(ParameterDef("width", 
+                "Width of the shape in world coordinates.",
+                PT_REAL),&msWidthCmd);
+            dict->addParameter(ParameterDef("height", 
+                "Height of the shape in world coordinates.",
+                PT_REAL),&msHeightCmd);
+            dict->addParameter(ParameterDef("depth", 
+                "Depth of the shape in world coordinates.",
+                PT_REAL),&msDepthCmd);
+            return true;
+
+        }
+        return false;
+    }
+
+    //-----------------------------------------------------------------------
+    unsigned short AreaEmitter::_getEmissionCount(Real timeElapsed)
+    {
+        // Use basic constant emission 
+        return genConstantEmissionCount(timeElapsed);
+    }
+    //-----------------------------------------------------------------------
+    void AreaEmitter::setDirection( const Vector3& direction )
+    {
+        ParticleEmitter::setDirection( direction );
+
+        // Update the ranges
+        genAreaAxes();
+
+        
+    }
+    //-----------------------------------------------------------------------
+    void AreaEmitter::setSize(const Vector3& size)
+    {
+        mSize = size;
+        genAreaAxes();
+    }
+    //-----------------------------------------------------------------------
+    void AreaEmitter::setSize(Real x, Real y, Real z)
+    {
+        mSize.x = x;
+        mSize.y = y;
+        mSize.z = z;
+        genAreaAxes();
+    }
+    //-----------------------------------------------------------------------
+    void AreaEmitter::setWidth(Real width)
+    {
+        mSize.x = width;
+        genAreaAxes();
+    }
+    //-----------------------------------------------------------------------
+    Real AreaEmitter::getWidth(void) const
+    {
+        return mSize.x;
+    }
+    //-----------------------------------------------------------------------
+    void AreaEmitter::setHeight(Real height)
+    {
+        mSize.y = height;
+        genAreaAxes();
+    }
+    //-----------------------------------------------------------------------
+    Real AreaEmitter::getHeight(void) const
+    {
+        return mSize.y;
+    }
+    //-----------------------------------------------------------------------
+    void AreaEmitter::setDepth(Real depth)
+    {
+        mSize.z = depth;
+        genAreaAxes();
+    }
+    //-----------------------------------------------------------------------
+    Real AreaEmitter::getDepth(void) const
+    {
+        return mSize.z;
+    }
+    //-----------------------------------------------------------------------
+    void AreaEmitter::genAreaAxes(void)
+    {
+        Vector3 mLeft = mUp.crossProduct(mDirection);
+
+        mXRange = mLeft * (mSize.x * 0.5f);
+        mYRange = mUp * (mSize.y * 0.5f);
+        mZRange = mDirection * (mSize.z * 0.5f);
+    }
+
+    //-----------------------------------------------------------------------
+    // Command objects
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String AreaEmitter::CmdWidth::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const AreaEmitter*>(target)->getWidth() );
+    }
+    void AreaEmitter::CmdWidth::doSet(void* target, const String& val)
+    {
+        static_cast<AreaEmitter*>(target)->setWidth(StringConverter::parseReal(val));
+    }
+    //-----------------------------------------------------------------------
+    String AreaEmitter::CmdHeight::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const AreaEmitter*>(target)->getHeight() );
+    }
+    void AreaEmitter::CmdHeight::doSet(void* target, const String& val)
+    {
+        static_cast<AreaEmitter*>(target)->setHeight(StringConverter::parseReal(val));
+    }
+    //-----------------------------------------------------------------------
+    String AreaEmitter::CmdDepth::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const AreaEmitter*>(target)->getDepth() );
+    }
+    void AreaEmitter::CmdDepth::doSet(void* target, const String& val)
+    {
+        static_cast<AreaEmitter*>(target)->setDepth(StringConverter::parseReal(val));
+    }
+
+
+
+}
+
+
Index: /PlugIns/ParticleFX/src/OgreBoxEmitter.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgreBoxEmitter.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgreBoxEmitter.cpp	(revision 5)
@@ -0,0 +1,73 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreBoxEmitter.h"
+#include "OgreParticle.h"
+#include "OgreException.h"
+#include "OgreStringConverter.h"
+
+
+
+namespace Ogre {
+
+
+    //-----------------------------------------------------------------------
+    BoxEmitter::BoxEmitter(ParticleSystem* psys)
+        : AreaEmitter(psys)
+    {
+        initDefaults("Box");
+    }
+    //-----------------------------------------------------------------------
+    void BoxEmitter::_initParticle(Particle* pParticle)
+    {
+        Vector3 xOff, yOff, zOff;
+
+        // Call superclass
+        ParticleEmitter::_initParticle(pParticle);
+
+        xOff = Math::SymmetricRandom() * mXRange;
+        yOff = Math::SymmetricRandom() * mYRange;
+        zOff = Math::SymmetricRandom() * mZRange;
+
+        pParticle->position = mPosition + xOff + yOff + zOff;
+        
+
+        // Generate complex data by reference
+        genEmissionColour(pParticle->colour);
+        genEmissionDirection(pParticle->direction);
+        genEmissionVelocity(pParticle->direction);
+
+        // Generate simpler data
+        pParticle->timeToLive = pParticle->totalTimeToLive = genEmissionTTL();
+        
+    }
+
+
+}
+
+
Index: /PlugIns/ParticleFX/src/OgreColourFaderAffector.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgreColourFaderAffector.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgreColourFaderAffector.cpp	(revision 5)
@@ -0,0 +1,194 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreColourFaderAffector.h"
+#include "OgreParticleSystem.h"
+#include "OgreStringConverter.h"
+#include "OgreParticle.h"
+
+
+namespace Ogre {
+    
+    // init statics
+    ColourFaderAffector::CmdRedAdjust ColourFaderAffector::msRedCmd;
+    ColourFaderAffector::CmdGreenAdjust ColourFaderAffector::msGreenCmd;
+    ColourFaderAffector::CmdBlueAdjust ColourFaderAffector::msBlueCmd;
+    ColourFaderAffector::CmdAlphaAdjust ColourFaderAffector::msAlphaCmd;
+
+    //-----------------------------------------------------------------------
+    ColourFaderAffector::ColourFaderAffector(ParticleSystem* psys) : ParticleAffector(psys)
+    {
+        mRedAdj = mGreenAdj = mBlueAdj = mAlphaAdj = 0;
+        mType = "ColourFader";
+
+        // Init parameters
+        if (createParamDictionary("ColourFaderAffector"))
+        {
+            ParamDictionary* dict = getParamDictionary();
+
+            dict->addParameter(ParameterDef("red", 
+                "The amount by which to adjust the red component of particles per second.",
+                PT_REAL), &msRedCmd);
+            dict->addParameter(ParameterDef("green", 
+                "The amount by which to adjust the green component of particles per second.",
+                PT_REAL), &msGreenCmd);
+            dict->addParameter(ParameterDef("blue", 
+                "The amount by which to adjust the blue component of particles per second.",
+                PT_REAL), &msBlueCmd);
+            dict->addParameter(ParameterDef("alpha", 
+                "The amount by which to adjust the alpha component of particles per second.",
+                PT_REAL), &msAlphaCmd);
+
+
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ColourFaderAffector::_affectParticles(ParticleSystem* pSystem, Real timeElapsed)
+    {
+        ParticleIterator pi = pSystem->_getIterator();
+        Particle *p;
+        float dr, dg, db, da;
+
+        // Scale adjustments by time
+        dr = mRedAdj * timeElapsed;
+        dg = mGreenAdj * timeElapsed;
+        db = mBlueAdj * timeElapsed;
+        da = mAlphaAdj * timeElapsed;
+
+        while (!pi.end())
+        {
+            p = pi.getNext();
+            applyAdjustWithClamp(&p->colour.r, dr);
+            applyAdjustWithClamp(&p->colour.g, dg);
+            applyAdjustWithClamp(&p->colour.b, db);
+            applyAdjustWithClamp(&p->colour.a, da);
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void ColourFaderAffector::setAdjust(float red, float green, float blue, float alpha)
+    {
+        mRedAdj = red;
+        mGreenAdj = green;
+        mBlueAdj = blue;
+        mAlphaAdj = alpha;
+    }
+    //-----------------------------------------------------------------------
+    void ColourFaderAffector::setRedAdjust(float red)
+    {
+        mRedAdj = red;
+    }
+    //-----------------------------------------------------------------------
+    float ColourFaderAffector::getRedAdjust(void) const
+    {
+        return mRedAdj;
+    }
+    //-----------------------------------------------------------------------
+    void ColourFaderAffector::setGreenAdjust(float green)
+    {
+        mGreenAdj = green;
+    }
+    //-----------------------------------------------------------------------
+    float ColourFaderAffector::getGreenAdjust(void) const
+    {
+        return mGreenAdj;
+    }
+    //-----------------------------------------------------------------------
+    void ColourFaderAffector::setBlueAdjust(float blue)
+    {
+        mBlueAdj = blue;
+    }
+    //-----------------------------------------------------------------------
+    float ColourFaderAffector::getBlueAdjust(void) const
+    {
+        return mBlueAdj;
+    }
+    //-----------------------------------------------------------------------
+    void ColourFaderAffector::setAlphaAdjust(float alpha)
+    {
+        mAlphaAdj = alpha;
+    }
+    //-----------------------------------------------------------------------
+    float ColourFaderAffector::getAlphaAdjust(void) const
+    {
+        return mAlphaAdj;
+    }
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    // Command objects
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String ColourFaderAffector::CmdRedAdjust::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ColourFaderAffector*>(target)->getRedAdjust() );
+    }
+    void ColourFaderAffector::CmdRedAdjust::doSet(void* target, const String& val)
+    {
+        static_cast<ColourFaderAffector*>(target)->setRedAdjust(
+            StringConverter::parseReal(val));
+    }
+    //-----------------------------------------------------------------------
+    String ColourFaderAffector::CmdGreenAdjust::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ColourFaderAffector*>(target)->getGreenAdjust() );
+    }
+    void ColourFaderAffector::CmdGreenAdjust::doSet(void* target, const String& val)
+    {
+        static_cast<ColourFaderAffector*>(target)->setGreenAdjust(
+            StringConverter::parseReal(val));
+    }
+    //-----------------------------------------------------------------------
+    String ColourFaderAffector::CmdBlueAdjust::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ColourFaderAffector*>(target)->getBlueAdjust() );
+    }
+    void ColourFaderAffector::CmdBlueAdjust::doSet(void* target, const String& val)
+    {
+        static_cast<ColourFaderAffector*>(target)->setBlueAdjust(
+            StringConverter::parseReal(val));
+    }
+    //-----------------------------------------------------------------------
+    String ColourFaderAffector::CmdAlphaAdjust::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ColourFaderAffector*>(target)->getAlphaAdjust() );
+    }
+    void ColourFaderAffector::CmdAlphaAdjust::doSet(void* target, const String& val)
+    {
+        static_cast<ColourFaderAffector*>(target)->setAlphaAdjust(
+            StringConverter::parseReal(val));
+    }
+
+}
+
+
+
Index: /PlugIns/ParticleFX/src/OgreColourFaderAffector2.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgreColourFaderAffector2.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgreColourFaderAffector2.cpp	(revision 5)
@@ -0,0 +1,352 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreColourFaderAffector2.h"
+#include "OgreParticleSystem.h"
+#include "OgreStringConverter.h"
+#include "OgreParticle.h"
+
+
+namespace Ogre {
+    
+    // init statics
+	// Phase 1
+    ColourFaderAffector2::CmdRedAdjust1 ColourFaderAffector2::msRedCmd1;
+    ColourFaderAffector2::CmdGreenAdjust1 ColourFaderAffector2::msGreenCmd1;
+    ColourFaderAffector2::CmdBlueAdjust1 ColourFaderAffector2::msBlueCmd1;
+    ColourFaderAffector2::CmdAlphaAdjust1 ColourFaderAffector2::msAlphaCmd1;
+
+	// Phase 2
+	ColourFaderAffector2::CmdRedAdjust2 ColourFaderAffector2::msRedCmd2;
+    ColourFaderAffector2::CmdGreenAdjust2 ColourFaderAffector2::msGreenCmd2;
+    ColourFaderAffector2::CmdBlueAdjust2 ColourFaderAffector2::msBlueCmd2;
+    ColourFaderAffector2::CmdAlphaAdjust2 ColourFaderAffector2::msAlphaCmd2;
+
+	ColourFaderAffector2::CmdStateChange ColourFaderAffector2::msStateCmd;
+
+
+    //-----------------------------------------------------------------------
+    ColourFaderAffector2::ColourFaderAffector2(ParticleSystem* psys) : ParticleAffector(psys)
+    {
+        mRedAdj1 = mGreenAdj1 = mBlueAdj1 = mAlphaAdj1 = 0;
+		mRedAdj2 = mGreenAdj2 = mBlueAdj2 = mAlphaAdj2 = 0;
+        mType = "ColourFader2";
+		StateChangeVal = 1;	// Switch when there is 1 second left on the TTL
+
+        // Init parameters
+        if (createParamDictionary("ColourFaderAffector2"))
+        {
+            ParamDictionary* dict = getParamDictionary();
+
+			// Phase 1
+            dict->addParameter(ParameterDef("red1", 
+                "The amount by which to adjust the red component of particles per second.",
+                PT_REAL), &msRedCmd1);
+            dict->addParameter(ParameterDef("green1", 
+                "The amount by which to adjust the green component of particles per second.",
+                PT_REAL), &msGreenCmd1);
+            dict->addParameter(ParameterDef("blue1", 
+                "The amount by which to adjust the blue component of particles per second.",
+                PT_REAL), &msBlueCmd1);
+            dict->addParameter(ParameterDef("alpha1", 
+                "The amount by which to adjust the alpha component of particles per second.",
+                PT_REAL), &msAlphaCmd1);
+
+			// Phase 2
+            dict->addParameter(ParameterDef("red2", 
+                "The amount by which to adjust the red component of particles per second.",
+                PT_REAL), &msRedCmd2);
+            dict->addParameter(ParameterDef("green2", 
+                "The amount by which to adjust the green component of particles per second.",
+                PT_REAL), &msGreenCmd2);
+            dict->addParameter(ParameterDef("blue2", 
+                "The amount by which to adjust the blue component of particles per second.",
+                PT_REAL), &msBlueCmd2);
+            dict->addParameter(ParameterDef("alpha2", 
+                "The amount by which to adjust the alpha component of particles per second.",
+                PT_REAL), &msAlphaCmd2);
+
+			// State Change Value
+            dict->addParameter(ParameterDef("state_change", 
+                "When the particle has this much time to live left, it will switch to state 2.",
+                PT_REAL), &msStateCmd);
+
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ColourFaderAffector2::_affectParticles(ParticleSystem* pSystem, Real timeElapsed)
+    {
+        ParticleIterator pi = pSystem->_getIterator();
+        Particle *p;
+        float dr1, dg1, db1, da1;
+		float dr2, dg2, db2, da2;
+
+		// Scale adjustments by time
+		dr1 = mRedAdj1   * timeElapsed;
+		dg1 = mGreenAdj1 * timeElapsed;
+		db1 = mBlueAdj1  * timeElapsed;
+		da1 = mAlphaAdj1 * timeElapsed;
+
+		// Scale adjustments by time
+		dr2 = mRedAdj2   * timeElapsed;
+		dg2 = mGreenAdj2 * timeElapsed;
+		db2 = mBlueAdj2  * timeElapsed;
+		da2 = mAlphaAdj2 * timeElapsed;
+
+        while (!pi.end())
+        {
+			p = pi.getNext();
+
+			if( p->timeToLive > StateChangeVal )
+			{
+				applyAdjustWithClamp(&p->colour.r, dr1);
+				applyAdjustWithClamp(&p->colour.g, dg1);
+				applyAdjustWithClamp(&p->colour.b, db1);
+				applyAdjustWithClamp(&p->colour.a, da1);
+			}
+			else
+			{
+				applyAdjustWithClamp(&p->colour.r, dr2);
+				applyAdjustWithClamp(&p->colour.g, dg2);
+				applyAdjustWithClamp(&p->colour.b, db2);
+				applyAdjustWithClamp(&p->colour.a, da2);
+			}
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void ColourFaderAffector2::setAdjust1(float red, float green, float blue, float alpha)
+    {
+        mRedAdj1 = red;
+        mGreenAdj1 = green;
+        mBlueAdj1 = blue;
+        mAlphaAdj1 = alpha;
+    }
+	//-----------------------------------------------------------------------
+    void ColourFaderAffector2::setAdjust2(float red, float green, float blue, float alpha)
+    {
+        mRedAdj2 = red;
+        mGreenAdj2 = green;
+        mBlueAdj2 = blue;
+        mAlphaAdj2 = alpha;
+    }
+
+    //-----------------------------------------------------------------------
+    void ColourFaderAffector2::setRedAdjust1(float red)
+    {
+        mRedAdj1 = red;
+    }
+    //-----------------------------------------------------------------------
+    void ColourFaderAffector2::setRedAdjust2(float red)
+    {
+        mRedAdj2 = red;
+    }
+    //-----------------------------------------------------------------------
+    float ColourFaderAffector2::getRedAdjust1(void) const
+    {
+        return mRedAdj1;
+    }
+    //-----------------------------------------------------------------------
+    float ColourFaderAffector2::getRedAdjust2(void) const
+    {
+        return mRedAdj2;
+    }
+    //-----------------------------------------------------------------------
+    void ColourFaderAffector2::setGreenAdjust1(float green)
+    {
+        mGreenAdj1 = green;
+    }
+    //-----------------------------------------------------------------------
+    void ColourFaderAffector2::setGreenAdjust2(float green)
+    {
+        mGreenAdj2 = green;
+    }
+    //-----------------------------------------------------------------------
+    float ColourFaderAffector2::getGreenAdjust1(void) const
+    {
+        return mGreenAdj1;
+    }
+    //-----------------------------------------------------------------------
+    float ColourFaderAffector2::getGreenAdjust2(void) const
+    {
+        return mGreenAdj2;
+    }
+    //-----------------------------------------------------------------------
+    void ColourFaderAffector2::setBlueAdjust1(float blue)
+    {
+        mBlueAdj1 = blue;
+    }
+    //-----------------------------------------------------------------------
+    void ColourFaderAffector2::setBlueAdjust2(float blue)
+    {
+        mBlueAdj2 = blue;
+    }
+    //-----------------------------------------------------------------------
+    float ColourFaderAffector2::getBlueAdjust1(void) const
+    {
+        return mBlueAdj1;
+    }
+    //-----------------------------------------------------------------------
+    float ColourFaderAffector2::getBlueAdjust2(void) const
+    {
+        return mBlueAdj2;
+    }
+    //-----------------------------------------------------------------------
+    void ColourFaderAffector2::setAlphaAdjust1(float alpha)
+    {
+        mAlphaAdj1 = alpha;
+    }
+    //-----------------------------------------------------------------------
+    void ColourFaderAffector2::setAlphaAdjust2(float alpha)
+    {
+        mAlphaAdj2 = alpha;
+    }
+    //-----------------------------------------------------------------------
+    float ColourFaderAffector2::getAlphaAdjust1(void) const
+    {
+        return mAlphaAdj1;
+    }
+    //-----------------------------------------------------------------------
+    float ColourFaderAffector2::getAlphaAdjust2(void) const
+    {
+        return mAlphaAdj2;
+    }
+    //-----------------------------------------------------------------------
+    void ColourFaderAffector2::setStateChange(Real NewValue)
+    {
+        StateChangeVal = NewValue;
+    }
+    //-----------------------------------------------------------------------
+    Real ColourFaderAffector2::getStateChange(void) const
+    {
+        return StateChangeVal;
+    }
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    // Command objects
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String ColourFaderAffector2::CmdRedAdjust1::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ColourFaderAffector2*>(target)->getRedAdjust1() );
+    }
+    void ColourFaderAffector2::CmdRedAdjust1::doSet(void* target, const String& val)
+    {
+        static_cast<ColourFaderAffector2*>(target)->setRedAdjust1(
+            StringConverter::parseReal(val));
+    }
+    String ColourFaderAffector2::CmdRedAdjust2::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ColourFaderAffector2*>(target)->getRedAdjust2() );
+    }
+    void ColourFaderAffector2::CmdRedAdjust2::doSet(void* target, const String& val)
+    {
+        static_cast<ColourFaderAffector2*>(target)->setRedAdjust2(
+            StringConverter::parseReal(val));
+    }
+    //-----------------------------------------------------------------------
+    String ColourFaderAffector2::CmdGreenAdjust1::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ColourFaderAffector2*>(target)->getGreenAdjust1() );
+    }
+    void ColourFaderAffector2::CmdGreenAdjust1::doSet(void* target, const String& val)
+    {
+        static_cast<ColourFaderAffector2*>(target)->setGreenAdjust1(
+            StringConverter::parseReal(val));
+    }
+    String ColourFaderAffector2::CmdGreenAdjust2::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ColourFaderAffector2*>(target)->getGreenAdjust2() );
+    }
+    void ColourFaderAffector2::CmdGreenAdjust2::doSet(void* target, const String& val)
+    {
+        static_cast<ColourFaderAffector2*>(target)->setGreenAdjust2(
+            StringConverter::parseReal(val));
+    }
+    //-----------------------------------------------------------------------
+    String ColourFaderAffector2::CmdBlueAdjust1::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ColourFaderAffector2*>(target)->getBlueAdjust1() );
+    }
+    void ColourFaderAffector2::CmdBlueAdjust1::doSet(void* target, const String& val)
+    {
+        static_cast<ColourFaderAffector2*>(target)->setBlueAdjust1(
+            StringConverter::parseReal(val));
+    }
+    String ColourFaderAffector2::CmdBlueAdjust2::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ColourFaderAffector2*>(target)->getBlueAdjust2() );
+    }
+    void ColourFaderAffector2::CmdBlueAdjust2::doSet(void* target, const String& val)
+    {
+        static_cast<ColourFaderAffector2*>(target)->setBlueAdjust2(
+            StringConverter::parseReal(val));
+    }
+    //-----------------------------------------------------------------------
+    String ColourFaderAffector2::CmdAlphaAdjust1::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ColourFaderAffector2*>(target)->getAlphaAdjust1() );
+    }
+    void ColourFaderAffector2::CmdAlphaAdjust1::doSet(void* target, const String& val)
+    {
+        static_cast<ColourFaderAffector2*>(target)->setAlphaAdjust1(
+            StringConverter::parseReal(val));
+    }
+    String ColourFaderAffector2::CmdAlphaAdjust2::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ColourFaderAffector2*>(target)->getAlphaAdjust2() );
+    }
+    void ColourFaderAffector2::CmdAlphaAdjust2::doSet(void* target, const String& val)
+    {
+        static_cast<ColourFaderAffector2*>(target)->setAlphaAdjust2(
+            StringConverter::parseReal(val));
+    }
+    //-----------------------------------------------------------------------
+    String ColourFaderAffector2::CmdStateChange::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ColourFaderAffector2*>(target)->getStateChange() );
+    }
+    void ColourFaderAffector2::CmdStateChange::doSet(void* target, const String& val)
+    {
+        static_cast<ColourFaderAffector2*>(target)->setStateChange(
+            StringConverter::parseReal(val));
+    }
+}
+
+
+
Index: /PlugIns/ParticleFX/src/OgreColourImageAffector.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgreColourImageAffector.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgreColourImageAffector.cpp	(revision 5)
@@ -0,0 +1,165 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreColourImageAffector.h"
+#include "OgreParticleSystem.h"
+#include "OgreStringConverter.h"
+#include "OgreParticle.h"
+#include "OgreException.h"
+#include "OgreResourceGroupManager.h"
+
+namespace Ogre {
+    
+    // init statics
+	ColourImageAffector::CmdImageAdjust		ColourImageAffector::msImageCmd;
+
+    //-----------------------------------------------------------------------
+    ColourImageAffector::ColourImageAffector(ParticleSystem* psys)
+        :ParticleAffector(psys), mColourImageLoaded(false)
+    {
+        mType = "ColourImage";
+
+        // Init parameters
+        if (createParamDictionary("ColourImageAffector"))
+        {
+            ParamDictionary* dict = getParamDictionary();
+
+			dict->addParameter(ParameterDef("image", "image where the colours come from", PT_STRING), &msImageCmd);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ColourImageAffector::_initParticle(Particle* pParticle)
+	{
+        if (!mColourImageLoaded)
+        {
+            _loadImage();
+        }
+
+        pParticle->colour = mColourImage.getColourAt(0, 0, 0);
+    
+	}
+    //-----------------------------------------------------------------------
+    void ColourImageAffector::_affectParticles(ParticleSystem* pSystem, Real timeElapsed)
+    {
+        Particle*			p;
+		ParticleIterator	pi				= pSystem->_getIterator();
+
+        if (!mColourImageLoaded)
+        {
+            _loadImage();
+        }
+
+		int				   width			= mColourImage.getWidth()  - 1;
+        
+		while (!pi.end())
+		{
+			p = pi.getNext();
+			const Real		life_time		= p->totalTimeToLive;
+			Real			particle_time	= 1.0f - (p->timeToLive / life_time); 
+
+			if (particle_time > 1.0f)
+				particle_time = 1.0f;
+			if (particle_time < 0.0f)
+				particle_time = 0.0f;
+
+			const Real		float_index		= particle_time * width;
+			const int		index			= (int)float_index;
+
+            if(index < 0)
+            {
+				p->colour = mColourImage.getColourAt(0, 0, 0);
+            }
+            else if(index >= width) 
+            {
+                p->colour = mColourImage.getColourAt(width, 0, 0);
+            }
+            else
+            {
+                // Linear interpolation
+				const Real		fract		= float_index - (Real)index;
+				const Real		to_colour	= fract;
+				const Real		from_colour	= 1.0f - to_colour;
+             
+                ColourValue from=mColourImage.getColourAt(index, 0, 0),
+							to=mColourImage.getColourAt(index+1, 0, 0);
+
+				p->colour.r = from.r*from_colour + to.r*to_colour;
+                p->colour.g = from.g*from_colour + to.g*to_colour;
+                p->colour.b = from.b*from_colour + to.b*to_colour;
+                p->colour.a = from.a*from_colour + to.a*to_colour;
+			}
+		}
+    }
+    
+    //-----------------------------------------------------------------------
+    void ColourImageAffector::setImageAdjust(String name)
+    {
+		mColourImageName = name;
+        mColourImageLoaded = false;
+	}
+    //-----------------------------------------------------------------------
+    void ColourImageAffector::_loadImage(void)
+    {
+        mColourImage.load(mColourImageName, mParent->getResourceGroupName());
+
+		PixelFormat	format = mColourImage.getFormat();
+
+		if ( !PixelUtil::isAccessible(format) )
+		{
+			OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, "Error: Image is not accessible (rgba) image.",
+					"ColourImageAffector::_loadImage" );
+		}
+
+        mColourImageLoaded = true;
+	}
+    //-----------------------------------------------------------------------
+    String ColourImageAffector::getImageAdjust(void) const
+    {
+        return mColourImageName;
+    }
+    
+	
+	//-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    // Command objects
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String ColourImageAffector::CmdImageAdjust::doGet(const void* target) const
+    {
+        return static_cast<const ColourImageAffector*>(target)->getImageAdjust();
+    }
+    void ColourImageAffector::CmdImageAdjust::doSet(void* target, const String& val)
+    {
+        static_cast<ColourImageAffector*>(target)->setImageAdjust(val);
+    }
+
+}
+
+
+
Index: /PlugIns/ParticleFX/src/OgreColourInterpolatorAffector.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgreColourInterpolatorAffector.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgreColourInterpolatorAffector.cpp	(revision 5)
@@ -0,0 +1,171 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreColourInterpolatorAffector.h"
+#include "OgreParticleSystem.h"
+#include "OgreStringConverter.h"
+#include "OgreParticle.h"
+
+
+namespace Ogre {
+    
+    // init statics
+    ColourInterpolatorAffector::CmdColourAdjust		ColourInterpolatorAffector::msColourCmd[MAX_STAGES];
+    ColourInterpolatorAffector::CmdTimeAdjust		ColourInterpolatorAffector::msTimeCmd[MAX_STAGES];
+
+    //-----------------------------------------------------------------------
+    ColourInterpolatorAffector::ColourInterpolatorAffector(ParticleSystem* psys)
+        : ParticleAffector(psys)
+    {
+		for (int i=0;i<MAX_STAGES;i++)
+		{
+			// set default colour to transparent grey, transparent since we might not want to display the particle here
+			// grey because when a colour component is 0.5f the maximum difference to another colour component is 0.5f
+			mColourAdj[i]	= ColourValue(0.5f, 0.5f, 0.5f, 0.0f);
+			mTimeAdj[i]		= 1.0f;
+		}
+
+        mType = "ColourInterpolator";
+
+        // Init parameters
+        if (createParamDictionary("ColourInterpolatorAffector"))
+        {
+            ParamDictionary* dict = getParamDictionary();
+
+			for (int i=0;i<MAX_STAGES;i++)
+			{
+				msColourCmd[i].mIndex	= i;
+				msTimeCmd[i].mIndex		= i;
+
+				StringUtil::StrStreamType stage;
+				stage << i;
+				String	colour_title	= String("colour") + stage.str();
+				String	time_title		= String("time") + stage.str();
+				String	colour_descr	= String("Stage ") + stage.str() + String(" colour.");
+				String	time_descr		= String("Stage ") + stage.str() + String(" time.");
+
+				dict->addParameter(ParameterDef(colour_title, colour_descr, PT_COLOURVALUE), &msColourCmd[i]);
+				dict->addParameter(ParameterDef(time_title,   time_descr,   PT_REAL),		 &msTimeCmd[i]);
+			}
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ColourInterpolatorAffector::_affectParticles(ParticleSystem* pSystem, Real timeElapsed)
+    {
+        Particle*			p;
+		ParticleIterator	pi				= pSystem->_getIterator();
+
+
+		while (!pi.end())
+        {
+            p = pi.getNext();
+			const Real		life_time		= p->totalTimeToLive;
+			Real			particle_time	= 1.0f - (p->timeToLive / life_time); 
+
+			if (particle_time <= mTimeAdj[0])
+			{
+				p->colour = mColourAdj[0];
+			} else
+			if (particle_time >= mTimeAdj[MAX_STAGES - 1])
+			{
+				p->colour = mColourAdj[MAX_STAGES-1];
+			} else
+			{
+				for (int i=0;i<MAX_STAGES-1;i++)
+				{
+					if (particle_time >= mTimeAdj[i] && particle_time < mTimeAdj[i + 1])
+					{
+						particle_time -= mTimeAdj[i];
+						particle_time /= (mTimeAdj[i+1]-mTimeAdj[i]);
+						p->colour.r = ((mColourAdj[i+1].r * particle_time) + (mColourAdj[i].r * (1.0f - particle_time)));
+						p->colour.g = ((mColourAdj[i+1].g * particle_time) + (mColourAdj[i].g * (1.0f - particle_time)));
+						p->colour.b = ((mColourAdj[i+1].b * particle_time) + (mColourAdj[i].b * (1.0f - particle_time)));
+						p->colour.a = ((mColourAdj[i+1].a * particle_time) + (mColourAdj[i].a * (1.0f - particle_time)));
+						break;
+					}
+				}
+			}
+		}
+    }
+    
+	//-----------------------------------------------------------------------
+    void ColourInterpolatorAffector::setColourAdjust(size_t index, ColourValue colour)
+    {
+        mColourAdj[index] = colour;
+    }
+    //-----------------------------------------------------------------------
+    ColourValue ColourInterpolatorAffector::getColourAdjust(size_t index) const
+    {
+        return mColourAdj[index];
+    }
+
+
+    //-----------------------------------------------------------------------
+    void ColourInterpolatorAffector::setTimeAdjust(size_t index, Real time)
+    {
+        mTimeAdj[index] = time;
+    }
+    //-----------------------------------------------------------------------
+    Real ColourInterpolatorAffector::getTimeAdjust(size_t index) const
+    {
+        return mTimeAdj[index];
+    }
+    
+	
+	//-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    // Command objects
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String ColourInterpolatorAffector::CmdColourAdjust::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ColourInterpolatorAffector*>(target)->getColourAdjust(mIndex) );
+    }
+    void ColourInterpolatorAffector::CmdColourAdjust::doSet(void* target, const String& val)
+    {
+        static_cast<ColourInterpolatorAffector*>(target)->setColourAdjust(mIndex,
+            StringConverter::parseColourValue(val));
+    }
+	//-----------------------------------------------------------------------
+    String ColourInterpolatorAffector::CmdTimeAdjust::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ColourInterpolatorAffector*>(target)->getTimeAdjust(mIndex) );
+    }
+    void ColourInterpolatorAffector::CmdTimeAdjust::doSet(void* target, const String& val)
+    {
+        static_cast<ColourInterpolatorAffector*>(target)->setTimeAdjust(mIndex,
+            StringConverter::parseReal(val));
+    }
+
+}
+
+
+
Index: /PlugIns/ParticleFX/src/OgreCylinderEmitter.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgreCylinderEmitter.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgreCylinderEmitter.cpp	(revision 5)
@@ -0,0 +1,99 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright ) 2002 Tels <http://bloodgate.com> based on EllipsoidEmitter
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreCylinderEmitter.h"
+#include "OgreParticle.h"
+#include "OgreQuaternion.h"
+#include "OgreException.h"
+#include "OgreStringConverter.h"
+
+
+/* Implements an Emitter whose emitting points all lie inside a cylinder.
+*/
+
+namespace Ogre {
+
+
+    //-----------------------------------------------------------------------
+    CylinderEmitter::CylinderEmitter(ParticleSystem* psys)
+        : AreaEmitter(psys)
+    {
+        initDefaults("Cylinder");
+    }
+    //-----------------------------------------------------------------------
+    void CylinderEmitter::_initParticle(Particle* pParticle)
+    {
+        Real x, y, z;
+
+        // Call superclass
+        AreaEmitter::_initParticle(pParticle);
+
+        // First we create a random point inside a bounding cylinder with a
+        // radius and height of 1 (this is easy to do). The distance of the
+        // point from 0,0,0 must be <= 1 (== 1 means on the surface and we
+        // count this as inside, too).
+
+        while (true)
+        {
+/* ClearSpace not yet implemeted
+
+*/
+                // three random values for one random point in 3D space
+                x = Math::SymmetricRandom();
+                y = Math::SymmetricRandom();
+                z = Math::SymmetricRandom();
+
+                // the distance of x,y from 0,0 is sqrt(x*x+y*y), but
+                // as usual we can omit the sqrt(), since sqrt(1) == 1 and we
+                // use the 1 as boundary. z is not taken into account, since
+                // all values in the z-direction are inside the cylinder:
+                if ( x*x + y*y <= 1)
+                {
+                        break;          // found one valid point inside
+                }
+        }       
+
+        // scale the found point to the cylinder's size and move it
+        // relatively to the center of the emitter point
+
+        pParticle->position = mPosition + 
+         + x * mXRange + y * mYRange + z * mZRange;
+
+        // Generate complex data by reference
+        genEmissionColour(pParticle->colour);
+        genEmissionDirection(pParticle->direction);
+        genEmissionVelocity(pParticle->direction);
+
+        // Generate simpler data
+        pParticle->timeToLive = pParticle->totalTimeToLive = genEmissionTTL();
+        
+    }
+
+}
+
+
Index: /PlugIns/ParticleFX/src/OgreDeflectorPlaneAffector.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgreDeflectorPlaneAffector.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgreDeflectorPlaneAffector.cpp	(revision 5)
@@ -0,0 +1,172 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreDeflectorPlaneAffector.h"
+#include "OgreParticleSystem.h"
+#include "OgreParticle.h"
+#include "OgreStringConverter.h"
+
+
+namespace Ogre {
+
+    // Instantiate statics
+    DeflectorPlaneAffector::CmdPlanePoint DeflectorPlaneAffector::msPlanePointCmd;
+    DeflectorPlaneAffector::CmdPlaneNormal DeflectorPlaneAffector::msPlaneNormalCmd;
+    DeflectorPlaneAffector::CmdBounce DeflectorPlaneAffector::msBounceCmd;
+
+    //-----------------------------------------------------------------------
+    DeflectorPlaneAffector::DeflectorPlaneAffector(ParticleSystem* psys)
+        : ParticleAffector(psys)
+    {
+        mType = "DeflectorPlane";
+
+        // defaults
+        mPlanePoint = Vector3::ZERO;
+        mPlaneNormal = Vector3::UNIT_Y;
+        mBounce = 1.0;
+
+        // Set up parameters
+        if (createParamDictionary("DeflectorPlaneAffector"))
+        {
+            addBaseParameters();
+            // Add extra paramaters
+            ParamDictionary* dict = getParamDictionary();
+            dict->addParameter(ParameterDef("plane_point",
+                "A point on the deflector plane. Together with the normal vector it defines the plane.",
+                PT_VECTOR3), &msPlanePointCmd);
+            dict->addParameter(ParameterDef("plane_normal",
+                "The normal vector of the deflector plane. Together with the point it defines the plane.",
+                PT_VECTOR3), &msPlaneNormalCmd);
+            dict->addParameter(ParameterDef("bounce",
+                "The amount of bouncing when a particle is deflected. 0 means no deflection and 1 stands for 100 percent reflection.",
+                PT_REAL), &msBounceCmd);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void DeflectorPlaneAffector::_affectParticles(ParticleSystem* pSystem, Real timeElapsed)
+    {
+        // precalculate distance of plane from origin
+        Real planeDistance = - mPlaneNormal.dotProduct(mPlanePoint) / Math::Sqrt(mPlaneNormal.dotProduct(mPlaneNormal));
+		Vector3 directionPart;
+
+        ParticleIterator pi = pSystem->_getIterator();
+        Particle *p;
+
+        while (!pi.end())
+        {
+            p = pi.getNext();
+
+            Vector3 direction(p->direction * timeElapsed);
+            if (mPlaneNormal.dotProduct(p->position + direction) + planeDistance <= 0.0)
+            {
+                Real a = mPlaneNormal.dotProduct(p->position) + planeDistance;
+                if (a > 0.0)
+                {
+                    // for intersection point
+					directionPart = direction * (- a / direction.dotProduct( mPlaneNormal ));
+                    // set new position
+					p->position = (p->position + ( directionPart )) + (((directionPart) - direction) * mBounce);
+
+                    // reflect direction vector
+                    p->direction = (p->direction - (2.0 * p->direction.dotProduct( mPlaneNormal ) * mPlaneNormal)) * mBounce;
+                }
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void DeflectorPlaneAffector::setPlanePoint(const Vector3& pos)
+    {
+        mPlanePoint = pos;
+    }
+    //-----------------------------------------------------------------------
+    void DeflectorPlaneAffector::setPlaneNormal(const Vector3& normal)
+    {
+        mPlaneNormal = normal;
+    }
+    //-----------------------------------------------------------------------
+    void DeflectorPlaneAffector::setBounce(Real bounce)
+    {
+        mBounce = bounce;
+    }
+
+    //-----------------------------------------------------------------------
+    Vector3 DeflectorPlaneAffector::getPlanePoint(void) const
+    {
+        return mPlanePoint;
+    }
+    //-----------------------------------------------------------------------
+    Vector3 DeflectorPlaneAffector::getPlaneNormal(void) const
+    {
+        return mPlaneNormal;
+    }
+    //-----------------------------------------------------------------------
+    Real DeflectorPlaneAffector::getBounce(void) const
+    {
+        return mBounce;
+    }
+
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    // Command objects
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String DeflectorPlaneAffector::CmdPlanePoint::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const DeflectorPlaneAffector*>(target)->getPlanePoint() );
+    }
+    void DeflectorPlaneAffector::CmdPlanePoint::doSet(void* target, const String& val)
+    {
+        static_cast<DeflectorPlaneAffector*>(target)->setPlanePoint(
+            StringConverter::parseVector3(val));
+    }
+    //-----------------------------------------------------------------------
+    String DeflectorPlaneAffector::CmdPlaneNormal::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const DeflectorPlaneAffector*>(target)->getPlaneNormal() );
+    }
+    void DeflectorPlaneAffector::CmdPlaneNormal::doSet(void* target, const String& val)
+    {
+        static_cast<DeflectorPlaneAffector*>(target)->setPlaneNormal(
+            StringConverter::parseVector3(val));
+    }
+    //-----------------------------------------------------------------------
+    String DeflectorPlaneAffector::CmdBounce::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const DeflectorPlaneAffector*>(target)->getBounce() );
+
+    }
+    void DeflectorPlaneAffector::CmdBounce::doSet(void* target, const String& val)
+    {
+        static_cast<DeflectorPlaneAffector*>(target)->setBounce(
+            StringConverter::parseReal(val));
+    }
+
+}
Index: /PlugIns/ParticleFX/src/OgreDirectionRandomiserAffector.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgreDirectionRandomiserAffector.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgreDirectionRandomiserAffector.cpp	(revision 5)
@@ -0,0 +1,166 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreDirectionRandomiserAffector.h"
+#include "OgreParticleSystem.h"
+#include "OgreParticle.h"
+#include "OgreStringConverter.h"
+
+
+namespace Ogre {
+
+    // Instantiate statics
+    DirectionRandomiserAffector::CmdRandomness DirectionRandomiserAffector::msRandomnessCmd;
+    DirectionRandomiserAffector::CmdScope DirectionRandomiserAffector::msScopeCmd;
+    DirectionRandomiserAffector::CmdKeepVelocity DirectionRandomiserAffector::msKeepVelocityCmd;
+
+    //-----------------------------------------------------------------------
+    DirectionRandomiserAffector::DirectionRandomiserAffector(ParticleSystem* psys)
+       : ParticleAffector(psys)
+    {
+        mType = "DirectionRandomiser";
+
+        // defaults
+        mRandomness = 1.0;
+        mScope = 1.0;
+        mKeepVelocity = false;
+
+        // Set up parameters
+        if (createParamDictionary("DirectionRandomiserAffector"))
+        {
+            addBaseParameters();
+            // Add extra paramaters
+            ParamDictionary* dict = getParamDictionary();
+            dict->addParameter(ParameterDef("randomness",
+                "The amount of randomness (chaos) to apply to the particle movement.",
+                PT_REAL), &msRandomnessCmd);
+            dict->addParameter(ParameterDef("scope",
+                "The percentage of particles which is affected.",
+                PT_REAL), &msScopeCmd);
+            dict->addParameter(ParameterDef("keep_velocity",
+                "Detemines whether the velocity of the particles is changed.",
+                PT_BOOL), &msKeepVelocityCmd);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void DirectionRandomiserAffector::_affectParticles(ParticleSystem* pSystem, Real timeElapsed)
+    {
+        ParticleIterator pi = pSystem->_getIterator();
+        Particle *p;
+        Real length;
+
+        while (!pi.end())
+        {
+            p = pi.getNext();
+            if (mScope > Math::UnitRandom())
+            {
+                if (!p->direction.isZeroLength())
+                {
+                    if (mKeepVelocity)
+                    {
+                        length = p->direction.length();
+                    }
+
+                    p->direction += Vector3(Math::RangeRandom(-mRandomness, mRandomness) * timeElapsed,
+                        Math::RangeRandom(-mRandomness, mRandomness) * timeElapsed,
+                        Math::RangeRandom(-mRandomness, mRandomness) * timeElapsed);
+
+                    if (mKeepVelocity)
+                    {
+                        p->direction *= length / p->direction.length();
+                    }
+                }
+            }
+        }
+    }
+    //-----------------------------------------------------------------------
+    void DirectionRandomiserAffector::setRandomness(Real force)
+    {
+        mRandomness = force;
+    }
+    //-----------------------------------------------------------------------
+    void DirectionRandomiserAffector::setScope(Real scope)
+    {
+        mScope = scope;
+    }
+    //-----------------------------------------------------------------------
+    void DirectionRandomiserAffector::setKeepVelocity(bool keepVelocity)
+    {
+        mKeepVelocity = keepVelocity;
+    }
+    //-----------------------------------------------------------------------
+    Real DirectionRandomiserAffector::getRandomness(void) const
+    {
+        return mRandomness;
+    }
+    //-----------------------------------------------------------------------
+    Real DirectionRandomiserAffector::getScope(void) const
+    {
+        return mScope;
+    }
+    //-----------------------------------------------------------------------
+    bool DirectionRandomiserAffector::getKeepVelocity(void) const
+    {
+        return mKeepVelocity;
+    }
+
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    // Command objects
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String DirectionRandomiserAffector::CmdRandomness::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const DirectionRandomiserAffector*>(target)->getRandomness() );
+    }
+    void DirectionRandomiserAffector::CmdRandomness::doSet(void* target, const String& val)
+    {
+        static_cast<DirectionRandomiserAffector*>(target)->setRandomness(StringConverter::parseReal(val));
+    }
+
+    String DirectionRandomiserAffector::CmdScope::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const DirectionRandomiserAffector*>(target)->getScope() );
+    }
+    void DirectionRandomiserAffector::CmdScope::doSet(void* target, const String& val)
+    {
+        static_cast<DirectionRandomiserAffector*>(target)->setScope(StringConverter::parseReal(val));
+    }
+    String DirectionRandomiserAffector::CmdKeepVelocity::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const DirectionRandomiserAffector*>(target)->getKeepVelocity() );
+    }
+    void DirectionRandomiserAffector::CmdKeepVelocity::doSet(void* target, const String& val)
+    {
+        static_cast<DirectionRandomiserAffector*>(target)->setKeepVelocity(StringConverter::parseBool(val));
+    }
+
+}
Index: /PlugIns/ParticleFX/src/OgreEllipsoidEmitter.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgreEllipsoidEmitter.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgreEllipsoidEmitter.cpp	(revision 5)
@@ -0,0 +1,100 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright ) 2002 Tels <http://bloodgate.com> based on BoxEmitter
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreEllipsoidEmitter.h"
+#include "OgreParticle.h"
+#include "OgreException.h"
+#include "OgreStringConverter.h"
+
+
+/* Implements an Emitter whose emitting points all lie inside an ellipsoid.
+   See <http://mathworld.wolfram.com/Ellipsoid.html> for mathematical details.
+
+  If the lengths of two axes of an ellipsoid are the same, the figure is
+  called a 'spheroid' (depending on whether c < a or c > a, an 'oblate
+  spheroid' or 'prolate spheroid', respectively), and if all three are the
+  same, it is a 'sphere' (ball).
+*/
+
+namespace Ogre {
+
+
+    //-----------------------------------------------------------------------
+    EllipsoidEmitter::EllipsoidEmitter(ParticleSystem* psys)
+        : AreaEmitter(psys)
+    {
+        initDefaults("Ellipsoid");
+    }
+    //-----------------------------------------------------------------------
+    void EllipsoidEmitter::_initParticle(Particle* pParticle)
+    {
+        Real x, y, z;
+
+        // Call superclass
+        AreaEmitter::_initParticle(pParticle);
+        // First we create a random point inside a bounding sphere with a
+        // radius of 1 (this is easy to do). The distance of the point from
+        // 0,0,0 must be <= 1 (== 1 means on the surface and we count this as
+        // inside, too).
+
+        while (true)
+        {
+            // three random values for one random point in 3D space
+
+            x = Math::SymmetricRandom();
+            y = Math::SymmetricRandom();
+            z = Math::SymmetricRandom();
+
+            // the distance of x,y,z from 0,0,0 is sqrt(x*x+y*y+z*z), but
+            // as usual we can omit the sqrt(), since sqrt(1) == 1 and we
+            // use the 1 as boundary:
+            if ( x*x + y*y + z*z <= 1)
+                {
+                        break;          // found one valid point inside
+                }
+        }       
+
+        // scale the found point to the ellipsoid's size and move it
+        // relatively to the center of the emitter point
+
+        pParticle->position = mPosition + 
+         + x * mXRange + y * mYRange + z * mZRange;
+
+        // Generate complex data by reference
+        genEmissionColour(pParticle->colour);
+        genEmissionDirection(pParticle->direction);
+        genEmissionVelocity(pParticle->direction);
+
+        // Generate simpler data
+        pParticle->timeToLive = pParticle->totalTimeToLive = genEmissionTTL();
+        
+    }
+
+}
+
+
Index: /PlugIns/ParticleFX/src/OgreHollowEllipsoidEmitter.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgreHollowEllipsoidEmitter.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgreHollowEllipsoidEmitter.cpp	(revision 5)
@@ -0,0 +1,200 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright ) 2002 Tels <http://bloodgate.com> based on BoxEmitter
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreHollowEllipsoidEmitter.h"
+#include "OgreParticle.h"
+#include "OgreException.h"
+#include "OgreStringConverter.h"
+#include "OgreMath.h"
+
+/* Implements an Emitter whose emitting points all lie inside an ellipsoid.
+   See <http://mathworld.wolfram.com/Ellipsoid.html> for mathematical details.
+
+  If the lengths of two axes of an ellipsoid are the same, the figure is
+  called a 'spheroid' (depending on whether c < a or c > a, an 'oblate
+  spheroid' or 'prolate spheroid', respectively), and if all three are the
+  same, it is a 'sphere' (ball).
+*/
+
+namespace Ogre {
+
+    HollowEllipsoidEmitter::CmdInnerX HollowEllipsoidEmitter::msCmdInnerX;
+    HollowEllipsoidEmitter::CmdInnerY HollowEllipsoidEmitter::msCmdInnerY;
+    HollowEllipsoidEmitter::CmdInnerZ HollowEllipsoidEmitter::msCmdInnerZ;
+
+
+    //-----------------------------------------------------------------------
+    HollowEllipsoidEmitter::HollowEllipsoidEmitter(ParticleSystem* psys)
+        : EllipsoidEmitter(psys)
+    {
+        if (initDefaults("HollowEllipsoid"))
+        {
+            // Add custom parameters
+            ParamDictionary* pDict = getParamDictionary();
+
+            pDict->addParameter(ParameterDef("inner_width", "Parametric value describing the proportion of the "
+                "shape which is hollow.", PT_REAL), &msCmdInnerX);
+            pDict->addParameter(ParameterDef("inner_height", "Parametric value describing the proportion of the "
+                "shape which is hollow.", PT_REAL), &msCmdInnerY);
+            pDict->addParameter(ParameterDef("inner_depth", "Parametric value describing the proportion of the "
+                "shape which is hollow.", PT_REAL), &msCmdInnerZ);
+        }
+        // default is half empty
+        setInnerSize(0.5,0.5,0.5);
+    }
+    //-----------------------------------------------------------------------
+    void HollowEllipsoidEmitter::_initParticle(Particle* pParticle)
+    {
+        Real a, b, c, x, y, z;
+
+        // Init dimensions
+        pParticle->resetDimensions();
+
+        // create two random angles alpha and beta
+        // with these two angles, we are able to select any point on an
+        // ellipsoid's surface
+        Radian alpha ( Math::RangeRandom(0,Math::TWO_PI) );
+        Radian beta  ( Math::RangeRandom(0,Math::PI) );
+
+        // create three random radius values that are bigger than the inner
+        // size, but smaller/equal than/to the outer size 1.0 (inner size is
+        // between 0 and 1)
+        a = Math::RangeRandom(mInnerSize.x,1.0);
+        b = Math::RangeRandom(mInnerSize.y,1.0);
+        c = Math::RangeRandom(mInnerSize.z,1.0);
+
+        // with a,b,c we have defined a random ellipsoid between the inner
+        // ellipsoid and the outer sphere (radius 1.0)
+        // with alpha and beta we select on point on this random ellipsoid
+        // and calculate the 3D coordinates of this point
+		Real sinbeta ( Math::Sin(beta) );
+        x = a * Math::Cos(alpha) * sinbeta;
+        y = b * Math::Sin(alpha) * sinbeta;
+        z = c * Math::Cos(beta);
+
+        // scale the found point to the ellipsoid's size and move it
+        // relatively to the center of the emitter point
+
+        pParticle->position = mPosition + 
+         + x * mXRange + y * mYRange + z * mZRange;
+
+        // Generate complex data by reference
+        genEmissionColour(pParticle->colour);
+        genEmissionDirection(pParticle->direction);
+        genEmissionVelocity(pParticle->direction);
+
+        // Generate simpler data
+        pParticle->timeToLive = pParticle->totalTimeToLive = genEmissionTTL();
+        
+    }
+    //-----------------------------------------------------------------------
+    void HollowEllipsoidEmitter::setInnerSize(Real x, Real y, Real z)
+    {
+        assert((x > 0) && (x < 1.0) &&
+            (y > 0) && (y < 1.0) &&
+            (z > 0) && (z < 1.0));
+
+        mInnerSize.x = x;
+        mInnerSize.y = y;
+        mInnerSize.z = z;
+    }
+    //-----------------------------------------------------------------------
+    void HollowEllipsoidEmitter::setInnerSizeX(Real x)
+    {
+        assert(x > 0 && x < 1.0);
+
+        mInnerSize.x = x;
+    }
+    //-----------------------------------------------------------------------
+    void HollowEllipsoidEmitter::setInnerSizeY(Real y)
+    {
+        assert(y > 0 && y < 1.0);
+
+        mInnerSize.y = y;
+    }
+    //-----------------------------------------------------------------------
+    void HollowEllipsoidEmitter::setInnerSizeZ(Real z)
+    {
+        assert(z > 0 && z < 1.0);
+
+        mInnerSize.z = z;
+    }
+    //-----------------------------------------------------------------------
+    Real HollowEllipsoidEmitter::getInnerSizeX(void) const
+    {
+        return mInnerSize.x;
+    }
+    //-----------------------------------------------------------------------
+    Real HollowEllipsoidEmitter::getInnerSizeY(void) const
+    {
+        return mInnerSize.y;
+    }
+    //-----------------------------------------------------------------------
+    Real HollowEllipsoidEmitter::getInnerSizeZ(void) const
+    {
+        return mInnerSize.z;
+    }
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    // Command objects
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String HollowEllipsoidEmitter::CmdInnerX::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const HollowEllipsoidEmitter*>(target)->getInnerSizeX() );
+    }
+    void HollowEllipsoidEmitter::CmdInnerX::doSet(void* target, const String& val)
+    {
+        static_cast<HollowEllipsoidEmitter*>(target)->setInnerSizeX(StringConverter::parseReal(val));
+    }
+    //-----------------------------------------------------------------------
+    String HollowEllipsoidEmitter::CmdInnerY::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const HollowEllipsoidEmitter*>(target)->getInnerSizeY() );
+    }
+    void HollowEllipsoidEmitter::CmdInnerY::doSet(void* target, const String& val)
+    {
+        static_cast<HollowEllipsoidEmitter*>(target)->setInnerSizeY(StringConverter::parseReal(val));
+    }
+    //-----------------------------------------------------------------------
+    String HollowEllipsoidEmitter::CmdInnerZ::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const HollowEllipsoidEmitter*>(target)->getInnerSizeZ() );
+    }
+    void HollowEllipsoidEmitter::CmdInnerZ::doSet(void* target, const String& val)
+    {
+        static_cast<HollowEllipsoidEmitter*>(target)->setInnerSizeZ(StringConverter::parseReal(val));
+    }
+
+
+}
+
+
Index: /PlugIns/ParticleFX/src/OgreLinearForceAffector.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgreLinearForceAffector.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgreLinearForceAffector.cpp	(revision 5)
@@ -0,0 +1,164 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreLinearForceAffector.h"
+#include "OgreParticleSystem.h"
+#include "OgreParticle.h"
+#include "OgreStringConverter.h"
+
+
+namespace Ogre {
+
+    // Instantiate statics
+    LinearForceAffector::CmdForceVector LinearForceAffector::msForceVectorCmd;
+    LinearForceAffector::CmdForceApp LinearForceAffector::msForceAppCmd;
+
+
+    //-----------------------------------------------------------------------
+    LinearForceAffector::LinearForceAffector(ParticleSystem* psys)
+        :ParticleAffector(psys)
+    {
+        mType = "LinearForce";
+
+        // Default to gravity-like
+        mForceApplication = FA_ADD;
+        mForceVector.x = mForceVector.z = 0;
+        mForceVector.y = -100;
+
+        // Set up parameters
+        if (createParamDictionary("LinearForceAffector"))
+        {
+            addBaseParameters();
+            // Add extra paramaters
+            ParamDictionary* dict = getParamDictionary();
+            dict->addParameter(ParameterDef("force_vector", 
+                "The vector representing the force to apply.",
+                PT_VECTOR3),&msForceVectorCmd);
+            dict->addParameter(ParameterDef("force_application", 
+                "How to apply the force vector to partices.",
+                PT_STRING),&msForceAppCmd);
+
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void LinearForceAffector::_affectParticles(ParticleSystem* pSystem, Real timeElapsed)
+    {
+        ParticleIterator pi = pSystem->_getIterator();
+        Particle *p;
+
+        Vector3 scaledVector;
+
+        // Precalc scaled force for optimisation
+        if (mForceApplication == FA_ADD)
+        {
+            // Scale force by time
+            scaledVector = mForceVector * timeElapsed;
+        }
+
+        while (!pi.end())
+        {
+            p = pi.getNext();
+            if (mForceApplication == FA_ADD)
+            {
+                p->direction += scaledVector;
+            }
+            else // FA_AVERAGE
+            {
+                p->direction = (p->direction + mForceVector) / 2;
+            }
+        }
+        
+    }
+    //-----------------------------------------------------------------------
+    void LinearForceAffector::setForceVector(const Vector3& force)
+    {
+        mForceVector = force;
+    }
+    //-----------------------------------------------------------------------
+    void LinearForceAffector::setForceApplication(ForceApplication fa)
+    {
+        mForceApplication = fa;
+    }
+    //-----------------------------------------------------------------------
+    Vector3 LinearForceAffector::getForceVector(void) const
+    {
+        return mForceVector;
+    }
+    //-----------------------------------------------------------------------
+    LinearForceAffector::ForceApplication LinearForceAffector::getForceApplication(void) const
+    {
+        return mForceApplication;
+    }
+
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    // Command objects
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String LinearForceAffector::CmdForceVector::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const LinearForceAffector*>(target)->getForceVector() );
+    }
+    void LinearForceAffector::CmdForceVector::doSet(void* target, const String& val)
+    {
+        static_cast<LinearForceAffector*>(target)->setForceVector(
+            StringConverter::parseVector3(val));
+    }
+    //-----------------------------------------------------------------------
+    String LinearForceAffector::CmdForceApp::doGet(const void* target) const
+    {
+        ForceApplication app = static_cast<const LinearForceAffector*>(target)->getForceApplication();
+        switch(app)
+        {
+        case LinearForceAffector::FA_AVERAGE:
+            return "average";
+            break;
+        case LinearForceAffector::FA_ADD:
+            return "add";
+            break;
+        }
+        // Compiler nicety
+        return "";
+    }
+    void LinearForceAffector::CmdForceApp::doSet(void* target, const String& val)
+    {
+        if (val == "average")
+        {
+            static_cast<LinearForceAffector*>(target)->setForceApplication(FA_AVERAGE);
+        }
+        else if (val == "add")
+        {
+            static_cast<LinearForceAffector*>(target)->setForceApplication(FA_ADD);
+        }
+    }
+
+
+}
+
Index: /PlugIns/ParticleFX/src/OgreParticleFX.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgreParticleFX.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgreParticleFX.cpp	(revision 5)
@@ -0,0 +1,53 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreParticleFXPrerequisites.h"
+#include "OgreRoot.h"
+#include "OgreParticleFXPlugin.h"
+
+namespace Ogre {
+
+	ParticleFXPlugin* plugin;
+    //-----------------------------------------------------------------------
+    extern "C" void _OgreParticleFXExport dllStartPlugin(void) throw()
+    {
+		plugin = new ParticleFXPlugin();
+		Root::getSingleton().installPlugin(plugin);
+    }
+
+    //-----------------------------------------------------------------------
+    extern "C" void _OgreParticleFXExport dllStopPlugin(void)
+    {
+		Root::getSingleton().uninstallPlugin(plugin);
+		delete plugin;
+
+    }
+
+
+}
+
Index: /PlugIns/ParticleFX/src/OgreParticleFXPlugin.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgreParticleFXPlugin.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgreParticleFXPlugin.cpp	(revision 5)
@@ -0,0 +1,179 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreParticleFXPlugin.h"
+#include "OgreRoot.h"
+#include "OgreParticleSystemManager.h"
+
+#include "OgrePointEmitterFactory.h"
+#include "OgreBoxEmitterFactory.h"
+#include "OgreEllipsoidEmitterFactory.h"
+#include "OgreHollowEllipsoidEmitterFactory.h"
+#include "OgreRingEmitterFactory.h"
+#include "OgreCylinderEmitterFactory.h"
+#include "OgreLinearForceAffectorFactory.h"
+#include "OgreColourFaderAffectorFactory.h"
+#include "OgreColourFaderAffectorFactory2.h"
+#include "OgreColourImageAffectorFactory.h"
+#include "OgreColourInterpolatorAffectorFactory.h"
+#include "OgreScaleAffectorFactory.h"
+#include "OgreRotationAffectorFactory.h"
+#include "OgreDirectionRandomiserAffectorFactory.h"
+#include "OgreDeflectorPlaneAffectorFactory.h"
+
+namespace Ogre 
+{
+	const String sPluginName = "ParticleFX";
+	//---------------------------------------------------------------------
+	ParticleFXPlugin::ParticleFXPlugin()
+	{
+
+	}
+	//---------------------------------------------------------------------
+	const String& ParticleFXPlugin::getName() const
+	{
+		return sPluginName;
+	}
+	//---------------------------------------------------------------------
+	void ParticleFXPlugin::install()
+	{
+		// -- Create all new particle emitter factories --
+		ParticleEmitterFactory* pEmitFact;
+
+		// PointEmitter
+		pEmitFact = new PointEmitterFactory();
+		ParticleSystemManager::getSingleton().addEmitterFactory(pEmitFact);
+		mEmitterFactories.push_back(pEmitFact);
+
+		// BoxEmitter
+		pEmitFact = new BoxEmitterFactory();
+		ParticleSystemManager::getSingleton().addEmitterFactory(pEmitFact);
+		mEmitterFactories.push_back(pEmitFact);
+
+		// EllipsoidEmitter
+		pEmitFact = new EllipsoidEmitterFactory();
+		ParticleSystemManager::getSingleton().addEmitterFactory(pEmitFact);
+		mEmitterFactories.push_back(pEmitFact);
+
+		// CylinderEmitter
+		pEmitFact = new CylinderEmitterFactory();
+		ParticleSystemManager::getSingleton().addEmitterFactory(pEmitFact);
+		mEmitterFactories.push_back(pEmitFact);
+
+		// RingEmitter
+		pEmitFact = new RingEmitterFactory();
+		ParticleSystemManager::getSingleton().addEmitterFactory(pEmitFact);
+		mEmitterFactories.push_back(pEmitFact);
+
+		// HollowEllipsoidEmitter
+		pEmitFact = new HollowEllipsoidEmitterFactory();
+		ParticleSystemManager::getSingleton().addEmitterFactory(pEmitFact);
+		mEmitterFactories.push_back(pEmitFact);
+
+		// -- Create all new particle affector factories --
+		ParticleAffectorFactory* pAffFact;
+
+		// LinearForceAffector
+		pAffFact = new LinearForceAffectorFactory();
+		ParticleSystemManager::getSingleton().addAffectorFactory(pAffFact);
+		mAffectorFactories.push_back(pAffFact);
+
+		// ColourFaderAffector
+		pAffFact = new ColourFaderAffectorFactory();
+		ParticleSystemManager::getSingleton().addAffectorFactory(pAffFact);
+		mAffectorFactories.push_back(pAffFact);
+
+		// ColourFaderAffector2
+		pAffFact = new ColourFaderAffectorFactory2();
+		ParticleSystemManager::getSingleton().addAffectorFactory(pAffFact);
+		mAffectorFactories.push_back(pAffFact);
+
+		// ColourImageAffector
+		pAffFact = new ColourImageAffectorFactory();
+		ParticleSystemManager::getSingleton().addAffectorFactory(pAffFact);
+		mAffectorFactories.push_back(pAffFact);
+
+		// ColourInterpolatorAffector
+		pAffFact = new ColourInterpolatorAffectorFactory();
+		ParticleSystemManager::getSingleton().addAffectorFactory(pAffFact);
+		mAffectorFactories.push_back(pAffFact);
+
+		// ScaleAffector
+		pAffFact = new ScaleAffectorFactory();
+		ParticleSystemManager::getSingleton().addAffectorFactory(pAffFact);
+		mAffectorFactories.push_back(pAffFact);
+
+		// RotationAffector
+		pAffFact = new RotationAffectorFactory();
+		ParticleSystemManager::getSingleton().addAffectorFactory(pAffFact);
+		mAffectorFactories.push_back(pAffFact);
+
+
+		// DirectionRandomiserAffector
+		pAffFact = new DirectionRandomiserAffectorFactory();
+		ParticleSystemManager::getSingleton().addAffectorFactory(pAffFact);
+		mAffectorFactories.push_back(pAffFact);
+
+		// DeflectorPlaneAffector
+		pAffFact = new DeflectorPlaneAffectorFactory();
+		ParticleSystemManager::getSingleton().addAffectorFactory(pAffFact);
+		mAffectorFactories.push_back(pAffFact);
+	}
+	//---------------------------------------------------------------------
+	void ParticleFXPlugin::initialise()
+	{
+		// nothing to do
+	}
+	//---------------------------------------------------------------------
+	void ParticleFXPlugin::shutdown()
+	{
+		// nothing to do
+	}
+	//---------------------------------------------------------------------
+	void ParticleFXPlugin::uninstall()
+	{
+		// destroy 
+		std::vector<ParticleEmitterFactory*>::iterator ei;
+		std::vector<ParticleAffectorFactory*>::iterator ai;
+
+		for (ei = mEmitterFactories.begin(); ei != mEmitterFactories.end(); ++ei)
+		{
+			delete (*ei);
+		}
+
+		for (ai = mAffectorFactories.begin(); ai != mAffectorFactories.end(); ++ai)
+		{
+			delete (*ai);
+		}
+
+
+	}
+
+
+}
Index: /PlugIns/ParticleFX/src/OgrePointEmitter.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgrePointEmitter.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgrePointEmitter.cpp	(revision 5)
@@ -0,0 +1,76 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgrePointEmitter.h"
+#include "OgreParticle.h"
+
+
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    PointEmitter::PointEmitter(ParticleSystem* psys)
+        :ParticleEmitter(psys)
+    {
+        mType = "Point";
+        // Set up parameters
+        if (createParamDictionary("PointEmitter"))
+        {
+            addBaseParameters();
+        }
+        // No custom parameters
+    }
+    //-----------------------------------------------------------------------
+    void PointEmitter::_initParticle(Particle* pParticle)
+    {
+        // Very simple emitter, uses default implementations with no modification
+
+        // Call superclass
+        ParticleEmitter::_initParticle(pParticle);
+
+        // Point emitter emits from own position
+        pParticle->position = mPosition;
+
+        // Generate complex data by reference
+        genEmissionColour(pParticle->colour);
+        genEmissionDirection(pParticle->direction);
+        genEmissionVelocity(pParticle->direction);
+
+        // Generate simpler data
+        pParticle->timeToLive = pParticle->totalTimeToLive = genEmissionTTL();
+        
+    }
+    //-----------------------------------------------------------------------
+    unsigned short PointEmitter::_getEmissionCount(Real timeElapsed)
+    {
+        // Use basic constant emission 
+        return genConstantEmissionCount(timeElapsed);
+    }
+}
+
+
Index: /PlugIns/ParticleFX/src/OgreRingEmitter.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgreRingEmitter.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgreRingEmitter.cpp	(revision 5)
@@ -0,0 +1,160 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright ) 2002 Tels <http://bloodgate.com> based on BoxEmitter
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreRingEmitter.h"
+#include "OgreParticle.h"
+#include "OgreException.h"
+#include "OgreStringConverter.h"
+
+
+/* Implements an Emitter whose emitting points all lie inside a ring.
+*/
+
+namespace Ogre {
+
+    RingEmitter::CmdInnerX RingEmitter::msCmdInnerX;
+    RingEmitter::CmdInnerY RingEmitter::msCmdInnerY;
+
+    //-----------------------------------------------------------------------
+    RingEmitter::RingEmitter(ParticleSystem* psys)
+        : AreaEmitter(psys)
+    {
+        if (initDefaults("Ring"))
+        {
+            // Add custom parameters
+            ParamDictionary* pDict = getParamDictionary();
+
+            pDict->addParameter(ParameterDef("inner_width", "Parametric value describing the proportion of the "
+                "shape which is hollow.", PT_REAL), &msCmdInnerX);
+            pDict->addParameter(ParameterDef("inner_height", "Parametric value describing the proportion of the "
+                "shape which is hollow.", PT_REAL), &msCmdInnerY);
+        }
+        // default is half empty
+        setInnerSize(0.5,0.5);
+    }
+    //-----------------------------------------------------------------------
+    void RingEmitter::_initParticle(Particle* pParticle)
+    {
+        Real a, b, x, y, z;
+
+        // Call superclass
+        AreaEmitter::_initParticle(pParticle);
+        // create a random angle from 0 .. PI*2
+        Radian alpha ( Math::RangeRandom(0,Math::TWO_PI) );
+  
+        // create two random radius values that are bigger than the inner size
+        a = Math::RangeRandom(mInnerSizex,1.0);
+        b = Math::RangeRandom(mInnerSizey,1.0);
+
+        // with a and b we have defined a random ellipse inside the inner
+        // ellipse and the outer circle (radius 1.0)
+        // with alpha, and a and b we select a random point on this ellipse
+        // and calculate it's coordinates
+        x = a * Math::Sin(alpha);
+        y = b * Math::Cos(alpha);
+        // the height is simple -1 to 1
+        z = Math::SymmetricRandom();     
+
+        // scale the found point to the ring's size and move it
+        // relatively to the center of the emitter point
+
+        pParticle->position = mPosition + 
+         + x * mXRange + y * mYRange + z * mZRange;
+
+        // Generate complex data by reference
+        genEmissionColour(pParticle->colour);
+        genEmissionDirection(pParticle->direction);
+        genEmissionVelocity(pParticle->direction);
+
+        // Generate simpler data
+        pParticle->timeToLive = pParticle->totalTimeToLive = genEmissionTTL();
+        
+    }
+    //-----------------------------------------------------------------------
+    void RingEmitter::setInnerSize(Real x, Real y)
+    {
+        // TODO: should really throw some exception
+        if ((x > 0) && (x < 1.0) &&
+            (y > 0) && (y < 1.0))
+            {
+            mInnerSizex = x;
+            mInnerSizey = y;
+            }
+    }
+    //-----------------------------------------------------------------------
+    void RingEmitter::setInnerSizeX(Real x)
+    {
+        assert(x > 0 && x < 1.0);
+
+        mInnerSizex = x;
+    }
+    //-----------------------------------------------------------------------
+    void RingEmitter::setInnerSizeY(Real y)
+    {
+        assert(y > 0 && y < 1.0);
+
+        mInnerSizey = y;
+    }
+    //-----------------------------------------------------------------------
+    Real RingEmitter::getInnerSizeX(void) const
+    {
+        return mInnerSizex;
+    }
+    //-----------------------------------------------------------------------
+    Real RingEmitter::getInnerSizeY(void) const
+    {
+        return mInnerSizey;
+    }
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    // Command objects
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String RingEmitter::CmdInnerX::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const RingEmitter*>(target)->getInnerSizeX() );
+    }
+    void RingEmitter::CmdInnerX::doSet(void* target, const String& val)
+    {
+        static_cast<RingEmitter*>(target)->setInnerSizeX(StringConverter::parseReal(val));
+    }
+    //-----------------------------------------------------------------------
+    String RingEmitter::CmdInnerY::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const RingEmitter*>(target)->getInnerSizeY() );
+    }
+    void RingEmitter::CmdInnerY::doSet(void* target, const String& val)
+    {
+        static_cast<RingEmitter*>(target)->setInnerSizeY(StringConverter::parseReal(val));
+    }
+
+}
+
+
Index: /PlugIns/ParticleFX/src/OgreRotationAffector.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgreRotationAffector.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgreRotationAffector.cpp	(revision 5)
@@ -0,0 +1,200 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreRotationAffector.h"
+#include "OgreParticleSystem.h"
+#include "OgreStringConverter.h"
+#include "OgreParticle.h"
+
+
+namespace Ogre {
+    
+    // init statics
+	RotationAffector::CmdRotationSpeedRangeStart	RotationAffector::msRotationSpeedRangeStartCmd;
+    RotationAffector::CmdRotationSpeedRangeEnd		RotationAffector::msRotationSpeedRangeEndCmd;
+    RotationAffector::CmdRotationRangeStart			RotationAffector::msRotationRangeStartCmd;
+    RotationAffector::CmdRotationRangeEnd			RotationAffector::msRotationRangeEndCmd;
+    
+    //-----------------------------------------------------------------------
+	RotationAffector::RotationAffector(ParticleSystem* psys) :
+        ParticleAffector(psys),
+		mRotationSpeedRangeStart(0),
+		mRotationSpeedRangeEnd(0),
+		mRotationRangeStart(0),
+		mRotationRangeEnd(0)
+    {
+		mType = "Rotator";
+
+        // Init parameters
+        if (createParamDictionary("RotationAffector"))
+        {
+            ParamDictionary* dict = getParamDictionary();
+
+            dict->addParameter(ParameterDef("rotation_speed_range_start", 
+				"The start of a range of rotation speed to be assigned to emitted particles.", PT_REAL),
+				&msRotationSpeedRangeStartCmd);
+
+			dict->addParameter(ParameterDef("rotation_speed_range_end", 
+				"The end of a range of rotation speed to be assigned to emitted particles.", PT_REAL),
+				&msRotationSpeedRangeEndCmd);
+
+			dict->addParameter(ParameterDef("rotation_range_start", 
+				"The start of a range of rotation angles to be assigned to emitted particles.", PT_REAL),
+				&msRotationRangeStartCmd);
+
+			dict->addParameter(ParameterDef("rotation_range_end", 
+				"The end of a range of rotation angles to be assigned to emitted particles.", PT_REAL),
+				&msRotationRangeEndCmd);
+        }
+    }
+
+    //-----------------------------------------------------------------------
+	void RotationAffector::_initParticle(Particle* pParticle)
+	{
+		pParticle->setRotation(
+            mRotationRangeStart + 
+            (Math::UnitRandom() * 
+                (mRotationRangeEnd - mRotationRangeStart)));
+        pParticle->rotationSpeed =
+            mRotationSpeedRangeStart + 
+            (Math::UnitRandom() * 
+                (mRotationSpeedRangeEnd - mRotationSpeedRangeStart));
+        
+	}
+	//-----------------------------------------------------------------------
+    void RotationAffector::_affectParticles(ParticleSystem* pSystem, Real timeElapsed)
+    {
+        ParticleIterator pi = pSystem->_getIterator();
+        Particle *p;
+        Real ds;
+
+        // Rotation adjustments by time
+        ds = timeElapsed;
+
+		Radian NewRotation;
+
+        while (!pi.end())
+        {
+            p = pi.getNext();
+
+			NewRotation = p->rotation + (ds * p->rotationSpeed);
+			p->setRotation( NewRotation );
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    const Radian& RotationAffector::getRotationSpeedRangeStart(void) const
+    {
+        return mRotationSpeedRangeStart;
+    }
+    //-----------------------------------------------------------------------
+    const Radian& RotationAffector::getRotationSpeedRangeEnd(void) const
+    {
+        return mRotationSpeedRangeEnd;
+    }
+    //-----------------------------------------------------------------------
+    void RotationAffector::setRotationSpeedRangeStart(const Radian& val)
+    {
+        mRotationSpeedRangeStart = val;
+    }
+    //-----------------------------------------------------------------------
+    void RotationAffector::setRotationSpeedRangeEnd(const Radian& val )
+    {
+        mRotationSpeedRangeEnd = val;
+    }
+    //-----------------------------------------------------------------------
+    const Radian& RotationAffector::getRotationRangeStart(void) const
+    {
+        return mRotationRangeStart;
+    }
+    //-----------------------------------------------------------------------
+    const Radian& RotationAffector::getRotationRangeEnd(void) const
+    {
+        return mRotationRangeEnd;
+    }
+    //-----------------------------------------------------------------------
+    void RotationAffector::setRotationRangeStart(const Radian& val)
+    {
+        mRotationRangeStart = val;
+    }
+    //-----------------------------------------------------------------------
+    void RotationAffector::setRotationRangeEnd(const Radian& val )
+    {
+        mRotationRangeEnd = val;
+    }
+	//-----------------------------------------------------------------------
+
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    // Command objects
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String RotationAffector::CmdRotationSpeedRangeEnd::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const RotationAffector*>(target)->getRotationSpeedRangeEnd() );
+    }
+    void RotationAffector::CmdRotationSpeedRangeEnd::doSet(void* target, const String& val)
+    {
+        static_cast<RotationAffector*>(target)->setRotationSpeedRangeEnd(StringConverter::parseAngle(val));
+    }
+    //-----------------------------------------------------------------------
+    String RotationAffector::CmdRotationSpeedRangeStart::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const RotationAffector*>(target)->getRotationSpeedRangeStart() );
+    }
+    void RotationAffector::CmdRotationSpeedRangeStart::doSet(void* target, const String& val)
+    {
+        static_cast<RotationAffector*>(target)->setRotationSpeedRangeStart(StringConverter::parseAngle(val));
+    }
+    
+	//-----------------------------------------------------------------------
+    String RotationAffector::CmdRotationRangeEnd::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const RotationAffector*>(target)->getRotationRangeEnd() );
+    }
+    void RotationAffector::CmdRotationRangeEnd::doSet(void* target, const String& val)
+    {
+        static_cast<RotationAffector*>(target)->setRotationRangeEnd(StringConverter::parseAngle(val));
+    }
+    //-----------------------------------------------------------------------
+    String RotationAffector::CmdRotationRangeStart::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const RotationAffector*>(target)->getRotationRangeStart() );
+    }
+    void RotationAffector::CmdRotationRangeStart::doSet(void* target, const String& val)
+    {
+        static_cast<RotationAffector*>(target)->setRotationRangeStart(StringConverter::parseAngle(val));
+    }
+}
+
+
+
Index: /PlugIns/ParticleFX/src/OgreScaleAffector.cpp
===================================================================
--- /PlugIns/ParticleFX/src/OgreScaleAffector.cpp	(revision 5)
+++ /PlugIns/ParticleFX/src/OgreScaleAffector.cpp	(revision 5)
@@ -0,0 +1,119 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE 
+	(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with 
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to 
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreScaleAffector.h"
+#include "OgreParticleSystem.h"
+#include "OgreStringConverter.h"
+#include "OgreParticle.h"
+
+
+namespace Ogre {
+    
+    // init statics
+    ScaleAffector::CmdScaleAdjust ScaleAffector::msScaleCmd;
+
+    //-----------------------------------------------------------------------
+    ScaleAffector::ScaleAffector(ParticleSystem* psys)
+        :ParticleAffector(psys)
+    {
+        mScaleAdj = 0;
+        mType = "Scaler";
+
+        // Init parameters
+        if (createParamDictionary("ScaleAffector"))
+        {
+            ParamDictionary* dict = getParamDictionary();
+
+            dict->addParameter(ParameterDef("rate", 
+                "The amount by which to adjust the x and y scale components of particles per second.",
+                PT_REAL), &msScaleCmd);
+        }
+    }
+    //-----------------------------------------------------------------------
+    void ScaleAffector::_affectParticles(ParticleSystem* pSystem, Real timeElapsed)
+    {
+        ParticleIterator pi = pSystem->_getIterator();
+        Particle *p;
+        Real ds;
+
+        // Scale adjustments by time
+        ds = mScaleAdj * timeElapsed;
+
+		Real NewWide, NewHigh;
+
+        while (!pi.end())
+        {
+            p = pi.getNext();
+
+			if( p->hasOwnDimensions() == false )
+			{
+            	NewWide = pSystem->getDefaultWidth() + ds;
+	            NewHigh = pSystem->getDefaultHeight() + ds;
+
+			}
+			else
+			{
+            	NewWide = p->getOwnWidth()  + ds;
+            	NewHigh = p->getOwnHeight() + ds;
+			}
+			p->setDimensions( NewWide, NewHigh ); 
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void ScaleAffector::setAdjust( Real rate )
+    {
+        mScaleAdj = rate;
+    }
+    //-----------------------------------------------------------------------
+    Real ScaleAffector::getAdjust(void) const
+    {
+        return mScaleAdj;
+    }
+    //-----------------------------------------------------------------------
+
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    // Command objects
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String ScaleAffector::CmdScaleAdjust::doGet(const void* target) const
+    {
+        return StringConverter::toString(
+            static_cast<const ScaleAffector*>(target)->getAdjust() );
+    }
+    void ScaleAffector::CmdScaleAdjust::doSet(void* target, const String& val)
+    {
+        static_cast<ScaleAffector*>(target)->setAdjust(
+            StringConverter::parseReal(val));
+    }
+
+}
+
+
+
Index: /README
===================================================================
--- /README	(revision 5)
+++ /README	(revision 5)
@@ -0,0 +1,23 @@
+Please read ReadMe.html in the Docs folder.
+
+-----
+
+Copyright 1999-2006 The OGRE Team.
+
+This file is part of OGRE (Object-Oriented Graphics Rendering Engine).
+
+OGRE 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, or (at your option)
+any later version.
+
+OGRE 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 OGRE; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
Index: /ReferenceApplication/BspCollision/Makefile.am
===================================================================
--- /ReferenceApplication/BspCollision/Makefile.am	(revision 5)
+++ /ReferenceApplication/BspCollision/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src
Index: /ReferenceApplication/BspCollision/Makefile.in
===================================================================
--- /ReferenceApplication/BspCollision/Makefile.in	(revision 5)
+++ /ReferenceApplication/BspCollision/Makefile.in	(revision 5)
@@ -0,0 +1,475 @@
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = BspCollision
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/ReferenceAppLayer/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_LIBS = @OGRE_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  BspCollision/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  BspCollision/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /ReferenceApplication/BspCollision/scripts/BspCollision.cbp
===================================================================
--- /ReferenceApplication/BspCollision/scripts/BspCollision.cbp	(revision 5)
+++ /ReferenceApplication/BspCollision/scripts/BspCollision.cbp	(revision 5)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_BspCollision" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\Samples\Common\bin\Debug\Demo_BspCollision.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\..\Samples\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="ReferenceAppLayer_d" />
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add directory="..\..\Dependencies\lib\Debug" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\Samples\Common\bin\Release\Demo_BspCollision.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\..\Samples\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="ReferenceAppLayer" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add directory="..\..\Dependencies\lib\Release" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\ReferenceAppLayer\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ode" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\BspCollision.cpp" />
+		<Unit filename="..\..\Common\include\ExampleRefAppApplication.h" />
+		<Unit filename="..\..\Common\include\ExampleRefAppFrameListener.h" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /ReferenceApplication/BspCollision/scripts/BspCollision.vcproj
===================================================================
--- /ReferenceApplication/BspCollision/scripts/BspCollision.vcproj	(revision 5)
+++ /ReferenceApplication/BspCollision/scripts/BspCollision.vcproj	(revision 5)
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_BspCollision"
+	ProjectGUID="{1982C73F-3D1C-46A6-9DFB-C7B03310365B}"
+	RootNamespace="Demo_BspCollision"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\ReferenceAppLayer\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib ReferenceAppLayer_d.lib"
+				OutputFile="$(OutDir)/Demo_BspCollision.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_BspCollision.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(TargetPath) ..\..\..\Samples\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\ReferenceAppLayer\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib ReferenceAppLayer.lib"
+				OutputFile="$(OutDir)/Demo_BspCollision.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(TargetPath) ..\..\..\Samples\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\BspCollision.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\..\Common\include\ExampleRefAppApplication.h">
+			</File>
+			<File
+				RelativePath="..\..\Common\include\ExampleRefAppFrameListener.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /ReferenceApplication/BspCollision/scripts/BspCollision_stlp.cbp
===================================================================
--- /ReferenceApplication/BspCollision/scripts/BspCollision_stlp.cbp	(revision 5)
+++ /ReferenceApplication/BspCollision/scripts/BspCollision_stlp.cbp	(revision 5)
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_BspCollision" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\Samples\Common\bin\Debug\Demo_BspCollision.exe" />
+				<Option working_dir="..\..\..\Samples\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ReferenceAppLayer" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+					<Add directory="..\..\Dependencies\lib\Debug" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\Samples\Common\bin\Release\Demo_BspCollision.exe" />
+				<Option working_dir="..\..\..\Samples\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ReferenceAppLayer" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+					<Add directory="..\..\Dependencies\lib\Release" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\..\..\Dependencies\include\ode" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\ReferenceAppLayer\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\BspCollision.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\Common\include\ExampleRefAppApplication.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\Common\include\ExampleRefAppFrameListener.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /ReferenceApplication/BspCollision/scripts/BspCollision_vc8.vcproj
===================================================================
--- /ReferenceApplication/BspCollision/scripts/BspCollision_vc8.vcproj	(revision 5)
+++ /ReferenceApplication/BspCollision/scripts/BspCollision_vc8.vcproj	(revision 5)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_BspCollision"
+	ProjectGUID="{1982C73F-3D1C-46A6-9DFB-C7B03310365B}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\ReferenceAppLayer\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib ReferenceAppLayer_d.lib"
+				OutputFile="$(OutDir)/Demo_BspCollision.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib\&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_BspCollision.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\ReferenceAppLayer\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib ReferenceAppLayer.lib"
+				OutputFile="$(OutDir)/Demo_BspCollision.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib\&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\BspCollision.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\..\Common\include\ExampleRefAppApplication.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\Common\include\ExampleRefAppFrameListener.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /ReferenceApplication/BspCollision/scripts/BspCollision_vc8.vcproj.user
===================================================================
--- /ReferenceApplication/BspCollision/scripts/BspCollision_vc8.vcproj.user	(revision 5)
+++ /ReferenceApplication/BspCollision/scripts/BspCollision_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /ReferenceApplication/BspCollision/src/BspCollision.cpp
===================================================================
--- /ReferenceApplication/BspCollision/src/BspCollision.cpp	(revision 5)
+++ /ReferenceApplication/BspCollision/src/BspCollision.cpp	(revision 5)
@@ -0,0 +1,237 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/*
+-----------------------------------------------------------------------------
+Filename:    BspCollision.cpp
+Description: Somewhere to play in the sand...
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreReferenceAppLayer.h"
+
+#include "ExampleRefAppApplication.h"
+#include "OgreStringConverter.h"
+
+// Hacky globals
+ApplicationObject *ball;
+
+SceneNode* targetNode;
+RaySceneQuery* rsq = 0;
+
+
+// Event handler to add ability to alter curvature
+class BspCollisionListener : public ExampleRefAppFrameListener
+{
+protected:
+public:
+    BspCollisionListener(RenderWindow* win, CollideCamera* cam)
+        : ExampleRefAppFrameListener(win, cam)
+    {
+    }
+
+
+    bool frameEnded(const FrameEvent& evt)
+    {
+        // local just to stop toggles flipping too fast
+        static Real timeUntilNextToggle = 0;
+
+        // Deal with time delays that are too large
+        // If we exceed this limit, we ignore
+        static const Real MAX_TIME_INCREMENT = 0.5f;
+        if (evt.timeSinceLastEvent > MAX_TIME_INCREMENT)
+        {
+            return true;
+        }
+        
+        if (timeUntilNextToggle >= 0) 
+            timeUntilNextToggle -= evt.timeSinceLastFrame;
+
+        // Call superclass
+        bool ret = ExampleRefAppFrameListener::frameEnded(evt);        
+
+		if (mKeyboard->isKeyDown(OIS::KC_SPACE) && timeUntilNextToggle <= 0)
+        {
+            timeUntilNextToggle = 2;
+            ball->setPosition(mCamera->getPosition() + 
+                mCamera->getDirection() * mCamera->getNearClipDistance() * 2);
+            ball->setLinearVelocity(mCamera->getDirection() * 200);
+            ball->setAngularVelocity(Vector3::ZERO);
+        }
+
+        // Move the targeter
+        rsq->setRay(mCamera->getRealCamera()->getCameraToViewportRay(0.5, 0.5));
+        RaySceneQueryResult& rsqResult = rsq->execute();
+        RaySceneQueryResult::iterator ri = rsqResult.begin();
+        if (ri != rsqResult.end())
+        {
+            RaySceneQueryResultEntry& res = *ri;
+            targetNode->setPosition(rsq->getRay().getPoint(res.distance));
+
+        }
+        return ret;
+    }
+};
+
+class BspCollisionApplication : public ExampleRefAppApplication
+{
+public:
+    BspCollisionApplication() {
+    
+    }
+
+    ~BspCollisionApplication() 
+    {
+		delete rsq;
+    }
+
+protected:
+    
+    void chooseSceneManager(void)
+    {
+        mSceneMgr = mRoot->createSceneManager("BspSceneManager");
+    }
+    void createWorld(void)
+    {
+        // Create BSP-specific world
+        mWorld = new World(mSceneMgr, World::WT_REFAPP_BSP);
+    }
+    void createScene(void)
+    {
+        mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_MODULATIVE);
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.2, 0.2, 0.2));
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setPosition(-100,50,100);
+        l->setAttenuation(8000,1,0,0);
+
+
+        // Setup World
+        mWorld->setGravity(Vector3(0, 0, -60));
+        mWorld->getSceneManager()->setWorldGeometry("ogretestmap.bsp");
+
+        // modify camera for close work
+        mCamera->setNearClipDistance(10);
+        mCamera->setFarClipDistance(20000);
+
+        // Also change position, and set Quake-type orientation
+        // Get random player start point
+        ViewPoint vp = mSceneMgr->getSuggestedViewpoint(true);
+        mCamera->setPosition(vp.position);
+        mCamera->pitch(Degree(90)); // Quake uses X/Y horizon, Z up
+        mCamera->rotate(vp.orientation);
+        // Don't yaw along variable axis, causes leaning
+        mCamera->setFixedYawAxis(true, Vector3::UNIT_Z);
+        // Look at the boxes
+		mCamera->lookAt(-150,40,30);
+
+        ball = mWorld->createBall("ball", 7, vp.position + Vector3(0,0,80));
+        ball->setDynamicsEnabled(true);
+        ball->getEntity()->setMaterialName("Ogre/Eyes");
+
+		OgreRefApp::Box* box = mWorld->createBox("shelf", 75, 125, 5, Vector3(-150, 40, 30));
+        box->getEntity()->setMaterialName("Examples/Rocky");
+
+        static const Real BOX_SIZE = 15.0f;
+        static const int num_rows = 3;
+
+        for (int row = 0; row < num_rows; ++row)
+        {
+            for (int i = 0; i < (num_rows-row); ++i)
+            {
+                Real row_size = (num_rows - row) * BOX_SIZE * 1.25;
+                String name = "box";
+                name += StringConverter::toString((row*num_rows) + i);
+                box = mWorld->createBox(name, BOX_SIZE,BOX_SIZE,BOX_SIZE , 
+                    Vector3(-150, 
+                        40 - (row_size * 0.5) + (i * BOX_SIZE * 1.25) , 
+                        32.5 + (BOX_SIZE / 2) + (row * BOX_SIZE)));
+                box->setDynamicsEnabled(false, true);
+                box->getEntity()->setMaterialName("Examples/10PointBlock");
+            }
+        }
+        mCamera->setCollisionEnabled(false);
+        mCamera->getRealCamera()->setQueryFlags(0);
+
+        // Create the targeting sphere
+        Entity* targetEnt = mSceneMgr->createEntity("testray", "sphere.mesh");
+        MaterialPtr mat = MaterialManager::getSingleton().create("targeter", 
+            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+        Pass* pass = mat->getTechnique(0)->getPass(0);
+        TextureUnitState* tex = pass->createTextureUnitState();
+        tex->setColourOperationEx(LBX_SOURCE1, LBS_MANUAL, LBS_CURRENT, 
+            ColourValue::Red);
+        pass->setLightingEnabled(false);
+        pass->setSceneBlending(SBT_ADD);
+        pass->setDepthWriteEnabled(false);
+
+
+        targetEnt->setMaterialName("targeter");
+        targetEnt->setCastShadows(false);
+        targetEnt->setQueryFlags(0);
+        targetNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        targetNode->scale(0.025, 0.025, 0.025);
+        targetNode->attachObject(targetEnt);
+
+        rsq = mSceneMgr->createRayQuery(Ray());
+        rsq->setSortByDistance(true, 1);
+        rsq->setWorldFragmentType(SceneQuery::WFT_SINGLE_INTERSECTION);
+    }
+    // Create new frame listener
+    void createFrameListener(void)
+    {
+        mFrameListener= new BspCollisionListener(mWindow, mCamera);
+        mRoot->addFrameListener(mFrameListener);
+    }
+
+public:
+
+};
+
+
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+
+
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+    // Create application object
+    BspCollisionApplication app;
+
+    try {
+        app.go();
+    } catch( Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+
+    return 0;
+}
+
+
+
+
+
+
+
Index: /ReferenceApplication/BspCollision/src/Makefile.am
===================================================================
--- /ReferenceApplication/BspCollision/src/Makefile.am	(revision 5)
+++ /ReferenceApplication/BspCollision/src/Makefile.am	(revision 5)
@@ -0,0 +1,10 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/../OgreMain/include -I$(top_srcdir)/Common/include -I$(top_srcdir)/ReferenceAppLayer/include
+
+noinst_PROGRAMS = BspCollision
+
+BspCollision_SOURCES = BspCollision.cpp
+BspCollision_LDFLAGS = -L$(top_builddir)/../OgreMain/src -L$(top_builddir)/ReferenceAppLayer/src
+BspCollision_LDADD = -lOgreMain -lOgreReferenceAppLayer
+
+install-exec-local:
+	$(INSTALL_PROGRAM) .libs/BspCollision $(top_builddir)/../Samples/Common/bin/BspCollision
Index: /ReferenceApplication/BspCollision/src/Makefile.in
===================================================================
--- /ReferenceApplication/BspCollision/src/Makefile.in	(revision 5)
+++ /ReferenceApplication/BspCollision/src/Makefile.in	(revision 5)
@@ -0,0 +1,437 @@
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+SOURCES = $(BspCollision_SOURCES)
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+noinst_PROGRAMS = BspCollision$(EXEEXT)
+subdir = BspCollision/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/ReferenceAppLayer/include/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_BspCollision_OBJECTS = BspCollision.$(OBJEXT)
+BspCollision_OBJECTS = $(am_BspCollision_OBJECTS)
+BspCollision_DEPENDENCIES =
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/ReferenceAppLayer/include
+depcomp = $(SHELL) $(top_srcdir)/../depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(BspCollision_SOURCES)
+DIST_SOURCES = $(BspCollision_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_LIBS = @OGRE_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/../OgreMain/include -I$(top_srcdir)/Common/include -I$(top_srcdir)/ReferenceAppLayer/include
+BspCollision_SOURCES = BspCollision.cpp
+BspCollision_LDFLAGS = -L$(top_builddir)/../OgreMain/src -L$(top_builddir)/ReferenceAppLayer/src
+BspCollision_LDADD = -lOgreMain -lOgreReferenceAppLayer
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  BspCollision/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  BspCollision/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+BspCollision$(EXEEXT): $(BspCollision_OBJECTS) $(BspCollision_DEPENDENCIES) 
+	@rm -f BspCollision$(EXEEXT)
+	$(CXXLINK) $(BspCollision_LDFLAGS) $(BspCollision_OBJECTS) $(BspCollision_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BspCollision.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`; \
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$$depbase.Tpo" "$$depbase.Po"; else rm -f "$$depbase.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`; \
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$$depbase.Tpo" "$$depbase.Po"; else rm -f "$$depbase.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`; \
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$$depbase.Tpo" "$$depbase.Plo"; else rm -f "$$depbase.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-exec-local
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-exec-local install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am
+
+
+install-exec-local:
+	$(INSTALL_PROGRAM) .libs/BspCollision $(top_builddir)/../Samples/Common/bin/BspCollision
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /ReferenceApplication/Common/bin/Debug/Plugins.cfg
===================================================================
--- /ReferenceApplication/Common/bin/Debug/Plugins.cfg	(revision 5)
+++ /ReferenceApplication/Common/bin/Debug/Plugins.cfg	(revision 5)
@@ -0,0 +1,17 @@
+# Defines plugins to load
+
+# Define plugin folder
+PluginFolder=..\..\..\..\Samples\Common\bin\Debug
+
+# Define D3D rendering implementation plugin
+Plugin=RenderSystem_Direct3D7
+Plugin=RenderSystem_Direct3D8
+Plugin=RenderSystem_Direct3D9
+Plugin=RenderSystem_GL
+Plugin=Plugin_FileSystem
+Plugin=Plugin_ParticleFX
+Plugin=Plugin_BSPSceneManager
+#Plugin=Plugin_OctreeSceneManager
+Plugin=Plugin_NatureSceneManager
+
+
Index: /ReferenceApplication/Common/bin/Debug/resources.cfg
===================================================================
--- /ReferenceApplication/Common/bin/Debug/resources.cfg	(revision 5)
+++ /ReferenceApplication/Common/bin/Debug/resources.cfg	(revision 5)
@@ -0,0 +1,4 @@
+Zip=../../../../Samples/Media/dragon.zip
+Zip=../../../../Samples/Media/knot.zip
+Zip=../../../../Samples/Media/skybox.zip
+FileSystem=../../../../Samples/Media/
Index: /ReferenceApplication/Common/bin/Release/Plugins.cfg
===================================================================
--- /ReferenceApplication/Common/bin/Release/Plugins.cfg	(revision 5)
+++ /ReferenceApplication/Common/bin/Release/Plugins.cfg	(revision 5)
@@ -0,0 +1,17 @@
+# Defines plugins to load
+
+# Define plugin folder
+PluginFolder=..\..\..\..\Samples\Common\bin\Release
+
+# Define D3D rendering implementation plugin
+Plugin=RenderSystem_Direct3D7
+Plugin=RenderSystem_Direct3D8
+Plugin=RenderSystem_Direct3D9
+Plugin=RenderSystem_SDL
+Plugin=Plugin_FileSystem
+Plugin=Plugin_ParticleFX
+Plugin=Plugin_BSPSceneManager
+Plugin=Plugin_OctreeSceneManager
+Plugin=Plugin_NatureSceneManager
+
+
Index: /ReferenceApplication/Common/bin/Release/resources.cfg
===================================================================
--- /ReferenceApplication/Common/bin/Release/resources.cfg	(revision 5)
+++ /ReferenceApplication/Common/bin/Release/resources.cfg	(revision 5)
@@ -0,0 +1,4 @@
+Zip=../../../../Samples/Media/dragon.zip
+Zip=../../../../Samples/Media/knot.zip
+Zip=../../../../Samples/Media/skybox.zip
+FileSystem=../../../../Samples/Media/
Index: /ReferenceApplication/Common/include/ExampleRefAppApplication.h
===================================================================
--- /ReferenceApplication/Common/include/ExampleRefAppApplication.h	(revision 5)
+++ /ReferenceApplication/Common/include/ExampleRefAppApplication.h	(revision 5)
@@ -0,0 +1,210 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/*
+-----------------------------------------------------------------------------
+Filename:    ExampleApplication.h
+Description: Base class for all the OGRE ReferenceApplication examples
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __ExampleRefAppApplication_H__
+#define __ExampleRefAppApplication_H__
+
+#include "OgreReferenceAppLayer.h"
+#include "OgreConfigFile.h"
+#include "ExampleRefAppFrameListener.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#    include <SDL.h>
+#endif
+
+using namespace Ogre;
+using namespace OgreRefApp;
+
+/** Base class which manages the standard startup of an Ogre application
+    based on the ReferenceApplication layer.
+    Designed to be subclassed for specific examples if required.
+*/
+class ExampleRefAppApplication
+{
+public:
+    /// Standard constructor
+    ExampleRefAppApplication()
+    {
+        mFrameListener = 0;
+        mRoot = 0;
+        mWorld = 0;
+    }
+    /// Standard destructor
+    virtual ~ExampleRefAppApplication()
+    {
+        if (mFrameListener)
+            delete mFrameListener;
+        if (mWorld)
+            delete mWorld;
+        if (mRoot)
+            delete mRoot;
+    }
+
+    /// Start the example
+    virtual void go(void)
+    {
+        if (!setup())
+            return;
+
+        mRoot->startRendering();
+    }
+
+protected:
+    Root *mRoot;
+    CollideCamera* mCamera;
+    SceneManager* mSceneMgr;
+    FrameListener* mFrameListener;
+    RenderWindow* mWindow;
+    World* mWorld;
+
+    // These internal methods package up the stages in the startup process
+    /** Sets up the application - returns false if the user chooses to abandon configuration. */
+    virtual bool setup(void)
+    {
+        mRoot = new Root();
+
+        setupResources();
+
+        bool carryOn = configure();
+        if (!carryOn) return false;
+
+        chooseSceneManager();
+        createWorld();
+        createCamera();
+        createViewports();
+
+        // Set default mipmap level (NB some APIs ignore this)
+        TextureManager::getSingleton().setDefaultNumMipmaps(5);
+
+		// Create any resource listeners (for loading screens)
+		createResourceListener();
+		// Load resources
+		loadResources();
+
+        // Create the scene
+        createScene();
+
+        createFrameListener();
+
+        return true;
+
+    }
+    /** Configures the application - returns false if the user chooses to abandon configuration. */
+    virtual bool configure(void)
+    {
+        // Show the configuration dialog and initialise the system
+        // You can skip this and use root.restoreConfig() to load configuration
+        // settings if you were sure there are valid ones saved in ogre.cfg
+        if(mRoot->showConfigDialog())
+        {
+            // If returned true, user clicked OK so initialise
+            // Here we choose to let the system create a default rendering window by passing 'true'
+            mWindow = mRoot->initialise(true);
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+    virtual void chooseSceneManager(void)
+    {
+        // Get the SceneManager, in this case a generic one
+        mSceneMgr = mRoot->createSceneManager(ST_GENERIC, "RefAppSMInstance");
+    }
+    virtual void createCamera(void)
+    {
+        // Create the camera
+        mCamera = mWorld->createCamera("PlayerCam");
+
+        // Position it at 500 in Z direction
+        mCamera->setPosition(Vector3(0,0,500));
+        // Look back along -Z
+        mCamera->lookAt(Vector3(0,0,-300));
+        mCamera->setNearClipDistance(5);
+
+    }
+    virtual void createFrameListener(void)
+    {
+        mFrameListener= new ExampleRefAppFrameListener(mWindow, mCamera);
+        mRoot->addFrameListener(mFrameListener);
+    }
+
+    virtual void createScene(void) = 0;    // pure virtual - this has to be overridden
+
+    virtual void createViewports(void)
+    {
+        // Create one viewport, entire window
+        Viewport* vp = mWindow->addViewport(mCamera->getRealCamera());
+        vp->setBackgroundColour(ColourValue(0,0,0));
+    }
+
+    /// Method which will define the source of resources (other than current folder)
+    virtual void setupResources(void)
+    {
+        // Load resource paths from config file
+        ConfigFile cf;
+        cf.load("resources.cfg");
+
+        // Go through all sections & settings in the file
+        ConfigFile::SectionIterator seci = cf.getSectionIterator();
+
+        String secName, typeName, archName;
+        while (seci.hasMoreElements())
+        {
+            secName = seci.peekNextKey();
+            ConfigFile::SettingsMultiMap *settings = seci.getNext();
+            ConfigFile::SettingsMultiMap::iterator i;
+            for (i = settings->begin(); i != settings->end(); ++i)
+            {
+                typeName = i->first;
+                archName = i->second;
+                ResourceGroupManager::getSingleton().addResourceLocation(
+                    archName, typeName, secName);
+            }
+        }
+    }
+    virtual void createWorld(void)
+    {
+        mWorld = new World(mSceneMgr);
+    }
+	/// Optional override method where you can create resource listeners (e.g. for loading screens)
+	virtual void createResourceListener(void)
+	{
+
+	}
+
+	/// Optional override method where you can perform resource group loading
+	/// Must at least do ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+	virtual void loadResources(void)
+	{
+		// Initialise, parse scripts etc
+		ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+
+	}
+
+
+
+};
+
+
+#endif
Index: /ReferenceApplication/Common/include/ExampleRefAppFrameListener.h
===================================================================
--- /ReferenceApplication/Common/include/ExampleRefAppFrameListener.h	(revision 5)
+++ /ReferenceApplication/Common/include/ExampleRefAppFrameListener.h	(revision 5)
@@ -0,0 +1,286 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/*
+-----------------------------------------------------------------------------
+Filename:    ExampleFrameListener.h
+Description: Defines an example frame listener which responds to frame events.
+             This frame listener just moves a specified camera around based on
+             keyboard and mouse movements.
+             Mouse:    Freelook
+             W or Up:  Forward
+             S or Down:Backward
+             A:           Step left
+             D:        Step right
+             PgUp:     Move upwards
+             PgDown:   Move downwards
+             O/P:       Yaw the root scene node (and it's children)
+             I/K:       Pitch the root scene node (and it's children)
+             F:           Toggle frame rate stats on/off
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __ExampleRefAppFrameListener_H__
+#define __ExampleRefAppFrameListener_H__
+
+#include "OgreReferenceAppLayer.h"
+#include "OgreException.h"
+#include <OIS/OIS.h>
+
+using namespace Ogre;
+using namespace OgreRefApp;
+
+class ExampleRefAppFrameListener: public FrameListener
+{
+private:
+    void updateStats(void)
+    {
+        static String currFps = "Current FPS: ";
+        static String avgFps = "Average FPS: ";
+        static String bestFps = "Best FPS: ";
+        static String worstFps = "Worst FPS: ";
+        static String tris = "Triangle Count: ";
+
+        // update stats when necessary
+        OverlayElement* guiAvg = OverlayManager::getSingleton().getOverlayElement("Core/AverageFps");
+        OverlayElement* guiCurr = OverlayManager::getSingleton().getOverlayElement("Core/CurrFps");
+        OverlayElement* guiBest = OverlayManager::getSingleton().getOverlayElement("Core/BestFps");
+        OverlayElement* guiWorst = OverlayManager::getSingleton().getOverlayElement("Core/WorstFps");
+        
+        guiAvg->setCaption(avgFps + StringConverter::toString(mWindow->getAverageFPS()));
+        guiCurr->setCaption(currFps + StringConverter::toString(mWindow->getLastFPS()));
+        guiBest->setCaption(bestFps + StringConverter::toString(mWindow->getBestFPS())
+            +" "+StringConverter::toString(mWindow->getBestFrameTime())+" ms");
+        guiWorst->setCaption(worstFps + StringConverter::toString(mWindow->getWorstFPS())
+            +" "+StringConverter::toString(mWindow->getWorstFrameTime())+" ms");
+            
+        OverlayElement* guiTris = OverlayManager::getSingleton().getOverlayElement("Core/NumTris");
+        guiTris->setCaption(tris + StringConverter::toString(mWindow->getTriangleCount()));
+
+        OverlayElement* guiDbg = OverlayManager::getSingleton().getOverlayElement("Core/DebugText");
+        guiDbg->setCaption(mDebugText);
+    }
+    
+public:
+    // Constructor takes a RenderWindow because it uses that to determine input context
+    ExampleRefAppFrameListener(RenderWindow* win, CollideCamera* cam, bool bufferedKeys = false, bool bufferedMouse = false)
+    {
+		using namespace OIS;
+		ParamList pl;	
+		size_t windowHnd = 0;
+		std::ostringstream windowHndStr;
+
+		win->getCustomAttribute("WINDOW", &windowHnd);
+		windowHndStr << windowHnd;
+		pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
+
+		mInputManager = InputManager::createInputSystem( pl );
+
+		//Create all devices (We only catch joystick exceptions here, as, most people have Key/Mouse)
+		mKeyboard = static_cast<Keyboard*>(mInputManager->createInputObject( OISKeyboard, bufferedKeys ));
+		mMouse = static_cast<Mouse*>(mInputManager->createInputObject( OISMouse, bufferedMouse ));
+
+		unsigned int width, height, depth;
+		int left, top;
+		win->getMetrics(width, height, depth, left, top);
+
+		//Set Mouse Region.. if window resizes, we should alter this to reflect as well
+		const MouseState &ms = mMouse->getMouseState();
+		ms.width = width;
+		ms.height = height;
+
+		mCamera = cam;
+        mWindow = win;
+        mStatsOn = true;
+		mNumScreenShots = 0;
+		mTimeUntilNextToggle = 0;
+
+        showDebugOverlay(true);
+
+		mDebugText = "Press SPACE to throw the ball";
+    }
+    virtual ~ExampleRefAppFrameListener()
+    {
+		if(mInputManager)
+		{
+			mInputManager->destroyInputObject(mMouse);
+			mInputManager->destroyInputObject(mKeyboard);
+			OIS::InputManager::destroyInputSystem(mInputManager);
+			mInputManager = 0;
+		}
+    }
+
+    bool processUnbufferedKeyInput(const FrameEvent& evt)
+    {
+		using namespace OIS;
+
+		if(mKeyboard->isKeyDown(KC_A))
+			mTranslateVector.x = -mMoveScale;	// Move camera left
+
+		if(mKeyboard->isKeyDown(KC_D))
+			mTranslateVector.x = mMoveScale;	// Move camera RIGHT
+
+		if(mKeyboard->isKeyDown(KC_UP) || mKeyboard->isKeyDown(KC_W) )
+			mTranslateVector.z = -mMoveScale;	// Move camera forward
+
+		if(mKeyboard->isKeyDown(KC_DOWN) || mKeyboard->isKeyDown(KC_S) )
+			mTranslateVector.z = mMoveScale;	// Move camera backward
+
+		if(mKeyboard->isKeyDown(KC_PGUP))
+			mTranslateVector.y = mMoveScale;	// Move camera up
+
+		if(mKeyboard->isKeyDown(KC_PGDOWN))
+			mTranslateVector.y = -mMoveScale;	// Move camera down
+
+		if(mKeyboard->isKeyDown(KC_RIGHT))
+			mCamera->yaw(-mRotScale);
+		
+		if(mKeyboard->isKeyDown(KC_LEFT))
+			mCamera->yaw(mRotScale);
+
+		if( mKeyboard->isKeyDown(KC_ESCAPE) || mKeyboard->isKeyDown(KC_Q) )
+			return false;
+
+       	if( mKeyboard->isKeyDown(KC_F) && mTimeUntilNextToggle <= 0 ) 
+		{
+			mStatsOn = !mStatsOn;
+			showDebugOverlay(mStatsOn);
+			mTimeUntilNextToggle = 1;
+		}
+
+		if(mKeyboard->isKeyDown(KC_SYSRQ) && mTimeUntilNextToggle <= 0)
+		{
+			std::ostringstream ss;
+			ss << "screenshot_" << ++mNumScreenShots << ".png";
+			mWindow->writeContentsToFile(ss.str());
+			mTimeUntilNextToggle = 0.5;
+			mDebugText = "Saved: " + ss.str();
+		}
+
+
+		// Return true to continue rendering
+		return true;
+    }
+
+    bool processUnbufferedMouseInput(const FrameEvent& evt)
+    {
+		using namespace OIS;
+
+		// Rotation factors, may not be used if the second mouse button is pressed
+		// 2nd mouse button - slide, otherwise rotate
+		const MouseState &ms = mMouse->getMouseState();
+		if( ms.buttonDown( MB_Right ) )
+		{
+			mTranslateVector.x += ms.X.rel * 0.13;
+			mTranslateVector.y -= ms.Y.rel * 0.13;
+		}
+		else
+		{
+			mRotX = Degree(-ms.X.rel * 0.13);
+			mRotY = Degree(-ms.Y.rel * 0.13);
+		}
+
+		return true;
+	}
+
+	void moveCamera()
+	{
+
+        // Make all the changes to the camera
+        // Note that YAW direction is around a fixed axis (freelook style) rather than a natural YAW (e.g. airplane)
+        mCamera->yaw(mRotX);
+        mCamera->pitch(mRotY);
+        mCamera->translate(mTranslateVector);
+	}
+
+    void showDebugOverlay(bool show)
+    {   
+        Overlay* o = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
+        if (!o)
+            OGRE_EXCEPT( Exception::ERR_ITEM_NOT_FOUND, "Could not find overlay Core/DebugOverlay",
+                "showDebugOverlay" );
+        if (show)
+            o->show();
+        else
+            o->hide();
+    }
+
+    // Override frameEnded event 
+    bool frameEnded(const FrameEvent& evt)
+    {
+		mMouse->capture();
+		mKeyboard->capture();
+
+		if( !mMouse->buffered() || !mKeyboard->buffered() )
+		{
+			// one of the input modes is immediate, so setup what is needed for immediate mouse/key movement
+			if (mTimeUntilNextToggle >= 0) 
+				mTimeUntilNextToggle -= evt.timeSinceLastFrame;
+
+			// If this is the first frame, pick a speed
+			if (evt.timeSinceLastFrame == 0)
+			{
+				mMoveScale = 0.5;
+				mRotScale = 0.1;
+			}
+			// Otherwise scale movement units by time passed since last frame
+			else
+			{
+				// Move about 50 units per second,
+				mMoveScale = 50.0 * evt.timeSinceLastFrame;
+				// Take about 10 seconds for full rotation
+				mRotScale = Degree(36 * evt.timeSinceLastFrame);
+			}
+			mRotX = 0;
+            mRotY = 0;
+	        mTranslateVector = Vector3::ZERO;
+		}
+
+		//Check to see which device is not buffered, and handle it
+		if( !mKeyboard->buffered() )
+			if( processUnbufferedKeyInput(evt) == false )
+				return false;
+		if( !mMouse->buffered() )
+			if( processUnbufferedMouseInput(evt) == false )
+				return false;
+		
+		if( !mMouse->buffered() || !mKeyboard->buffered() )
+			moveCamera();
+
+        // Perform simulation step
+        World::getSingleton().simulationStep(evt.timeSinceLastFrame);
+
+        updateStats();
+		return true;
+    }
+
+protected:
+	OIS::Mouse *mMouse;
+	OIS::Keyboard *mKeyboard;
+    OIS::InputManager *mInputManager;
+    
+    CollideCamera* mCamera;
+    Vector3 mTranslateVector;
+    RenderWindow* mWindow;
+    bool mStatsOn;
+	unsigned int mNumScreenShots;
+    float mMoveScale;
+    Radian mRotScale;
+    // just to stop toggles flipping too fast
+    Real mTimeUntilNextToggle ;
+    Radian mRotX, mRotY;
+
+	std::string mDebugText;
+};
+#endif
Index: /ReferenceApplication/Makefile.am
===================================================================
--- /ReferenceApplication/Makefile.am	(revision 5)
+++ /ReferenceApplication/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = ReferenceAppLayer BspCollision
Index: /ReferenceApplication/Makefile.in
===================================================================
--- /ReferenceApplication/Makefile.in	(revision 5)
+++ /ReferenceApplication/Makefile.in	(revision 5)
@@ -0,0 +1,600 @@
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = .
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+DIST_COMMON = $(am__configure_deps) $(srcdir)/../config.guess \
+	$(srcdir)/../config.sub $(srcdir)/../install-sh \
+	$(srcdir)/../ltmain.sh $(srcdir)/../missing \
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/configure
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno configure.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/ReferenceAppLayer/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  { test ! -d $(distdir) \
+    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_LIBS = @OGRE_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = ReferenceAppLayer BspCollision
+all: all-recursive
+
+.SUFFIXES:
+am--refresh:
+	@:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+	      cd $(srcdir) && $(AUTOMAKE) --foreign  \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    echo ' $(SHELL) ./config.status'; \
+	    $(SHELL) ./config.status;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	$(am__remove_distdir)
+	mkdir $(distdir)
+	$(mkdir_p) $(distdir)/..
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+	|| chmod -R a+r $(distdir)
+dist-gzip: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+dist-bzip2: distdir
+	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+	$(am__remove_distdir)
+
+dist-tarZ: distdir
+	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+	$(am__remove_distdir)
+
+dist-shar: distdir
+	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	$(am__remove_distdir)
+
+dist-zip: distdir
+	-rm -f $(distdir).zip
+	zip -rq $(distdir).zip $(distdir)
+	$(am__remove_distdir)
+
+dist dist-all: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+	case '$(DIST_ARCHIVES)' in \
+	*.tar.gz*) \
+	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+	*.tar.bz2*) \
+	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.Z*) \
+	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+	*.shar.gz*) \
+	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+	*.zip*) \
+	  unzip $(distdir).zip ;;\
+	esac
+	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	mkdir $(distdir)/_build
+	mkdir $(distdir)/_inst
+	chmod a-w $(distdir)
+	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+	  && cd $(distdir)/_build \
+	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) check \
+	  && $(MAKE) $(AM_MAKEFLAGS) install \
+	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+	        distuninstallcheck \
+	  && chmod -R a-w "$$dc_install_base" \
+	  && ({ \
+	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
+	  && rm -rf "$$dc_destdir" \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist \
+	  && rm -rf $(DIST_ARCHIVES) \
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+	$(am__remove_distdir)
+	@(echo "$(distdir) archives ready for distribution: "; \
+	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+	  sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+distuninstallcheck:
+	@cd $(distuninstallcheck_dir) \
+	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+	   || { echo "ERROR: files left after uninstall:" ; \
+	        if test -n "$(DESTDIR)"; then \
+	          echo "  (check DESTDIR support)"; \
+	        fi ; \
+	        $(distuninstallcheck_listfiles) ; \
+	        exit 1; } >&2
+distcleancheck: distclean
+	@if test '$(srcdir)' = . ; then \
+	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+	  exit 1 ; \
+	fi
+	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+	  || { echo "ERROR: files left in build directory after distclean:" ; \
+	       $(distcleancheck_listfiles) ; \
+	       exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -rf $(top_srcdir)/autom4te.cache
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
+	check-am clean clean-generic clean-libtool clean-recursive \
+	ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+	dist-shar dist-tarZ dist-zip distcheck distclean \
+	distclean-generic distclean-libtool distclean-recursive \
+	distclean-tags distcleancheck distdir distuninstallcheck dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-exec install-exec-am \
+	install-info install-info-am install-man install-strip \
+	installcheck installcheck-am installdirs installdirs-am \
+	maintainer-clean maintainer-clean-generic \
+	maintainer-clean-recursive mostlyclean mostlyclean-generic \
+	mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
+	tags tags-recursive uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /ReferenceApplication/OgreReferenceApplication.sln
===================================================================
--- /ReferenceApplication/OgreReferenceApplication.sln	(revision 5)
+++ /ReferenceApplication/OgreReferenceApplication.sln	(revision 5)
@@ -0,0 +1,44 @@
+Microsoft Visual Studio Solution File, Format Version 7.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReferenceAppLayer", "ReferenceAppLayer\scripts\ReferenceAppLayer.vcproj", "{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OgreMain", "..\OgreMain\scripts\OgreMain.vcproj", "{35AFBABB-DF05-43DE-91A7-BB828A874015}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_BspCollision", "BspCollision\scripts\BspCollision.vcproj", "{EDD4B978-5ABA-448B-8DA7-A02F99714D66}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_BSPSceneManager", "..\PlugIns\BSPSceneManager\scripts\Plugin_BSPSceneManager.vcproj", "{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}"
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		ConfigName.0 = Debug
+		ConfigName.1 = Release
+	EndGlobalSection
+	GlobalSection(ProjectDependencies) = postSolution
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.0 = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+		{EDD4B978-5ABA-448B-8DA7-A02F99714D66}.0 = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{EDD4B978-5ABA-448B-8DA7-A02F99714D66}.1 = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{EDD4B978-5ABA-448B-8DA7-A02F99714D66}.2 = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.0 = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Debug.ActiveCfg = Debug|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Debug.Build.0 = Debug|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release.ActiveCfg = Release|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release.Build.0 = Release|Win32
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.Debug.ActiveCfg = Debug|Win32
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.Debug.Build.0 = Debug|Win32
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.Release.ActiveCfg = Release|Win32
+		{35AFBABB-DF05-43DE-91A7-BB828A874015}.Release.Build.0 = Release|Win32
+		{EDD4B978-5ABA-448B-8DA7-A02F99714D66}.Debug.ActiveCfg = Debug|Win32
+		{EDD4B978-5ABA-448B-8DA7-A02F99714D66}.Debug.Build.0 = Debug|Win32
+		{EDD4B978-5ABA-448B-8DA7-A02F99714D66}.Release.ActiveCfg = Release|Win32
+		{EDD4B978-5ABA-448B-8DA7-A02F99714D66}.Release.Build.0 = Release|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Debug.ActiveCfg = Debug|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Debug.Build.0 = Debug|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release.ActiveCfg = Release|Win32
+		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
Index: /ReferenceApplication/ReferenceAppLayer/Makefile.am
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/Makefile.am	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS=src include 
Index: /ReferenceApplication/ReferenceAppLayer/Makefile.in
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/Makefile.in	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/Makefile.in	(revision 5)
@@ -0,0 +1,475 @@
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = ReferenceAppLayer
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/ReferenceAppLayer/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_LIBS = @OGRE_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include 
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  ReferenceAppLayer/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  ReferenceAppLayer/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /ReferenceApplication/ReferenceAppLayer/include/Makefile.am
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/include/Makefile.am	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/include/Makefile.am	(revision 5)
@@ -0,0 +1,12 @@
+noinst_HEADERS = OgreRefAppApplicationObject.h \
+	OgreRefAppBall.h \
+	OgreRefAppBox.h \
+	OgreRefAppOgreHead.h \
+	OgreRefAppJoint.h \
+	OgreRefAppJointSubtypes.h \
+	OgreRefAppPrerequisites.h \
+    OgreRefAppWorld.h \
+	OgreRefAppPlane.h \
+	OgreRefAppCollideCamera.h \
+	OgreReferenceAppLayer.h
+
Index: /ReferenceApplication/ReferenceAppLayer/include/Makefile.in
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/include/Makefile.in	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/include/Makefile.in	(revision 5)
@@ -0,0 +1,396 @@
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = ReferenceAppLayer/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(srcdir)/config.h.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_LIBS = @OGRE_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = OgreRefAppApplicationObject.h \
+	OgreRefAppBall.h \
+	OgreRefAppBox.h \
+	OgreRefAppOgreHead.h \
+	OgreRefAppJoint.h \
+	OgreRefAppJointSubtypes.h \
+	OgreRefAppPrerequisites.h \
+    OgreRefAppWorld.h \
+	OgreRefAppPlane.h \
+	OgreRefAppCollideCamera.h \
+	OgreReferenceAppLayer.h
+
+all: config.h
+	$(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  ReferenceAppLayer/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  ReferenceAppLayer/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+config.h: stamp-h1
+	@if test ! -f $@; then \
+	  rm -f stamp-h1; \
+	  $(MAKE) stamp-h1; \
+	else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+	@rm -f stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status ReferenceAppLayer/include/config.h
+$(srcdir)/config.h.in:  $(am__configure_deps) 
+	cd $(top_srcdir) && $(AUTOHEADER)
+	rm -f stamp-h1
+	touch $@
+
+distclean-hdr:
+	-rm -f config.h stamp-h1
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS) config.h
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic distclean-hdr \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppApplicationObject.h
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppApplicationObject.h	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppApplicationObject.h	(revision 5)
@@ -0,0 +1,457 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __REFAPP_APPLICATIONOBJECT_H__
+#define __REFAPP_APPLICATIONOBJECT_H__
+
+#include "OgreRefAppPrerequisites.h"
+
+namespace OgreRefApp {
+
+    /** This object is the base class for all discrete objects in the application.
+    @remarks
+        This object holds a reference to the underlying OGRE entity / entities which 
+        comprise it, plus links to the additional properties required to make it
+        work in the application world.
+    @remarks
+        It extends the OGRE UserDefinedObject to allow reverse links from Ogre::Entity.
+        Note that this class does not override the UserDefinedObject's getTypeId method 
+        because this class is abstract.
+    */
+    class _OgreRefAppExport ApplicationObject : public UserDefinedObject
+    {
+    protected:
+        // Visual component
+        SceneNode* mSceneNode;
+        Entity* mEntity;
+
+        /// Dynamics properties, must be set up by subclasses if dynamics enabled
+        dBody* mOdeBody;
+        /// Mass parameters
+        dMass mMass;
+
+
+        /// Collision proxies, must be set up if collision enabled
+        typedef std::list<dGeom*> CollisionProxyList;
+        CollisionProxyList mCollisionProxies;
+
+
+        bool mDynamicsEnabled;
+        bool mReenableIfInteractedWith;
+        bool mCollisionEnabled;
+
+		Real mBounceCoeffRestitution;
+		Real mBounceVelocityThreshold;
+		Real mSoftness;
+        Real mFriction;
+        Real mLinearVelDisableThreshold;
+        Real mAngularVelDisableThreshold;
+        Real mDisableTime;
+        Real mDisableTimeEnd;
+
+        // Set up method, must override
+        virtual void setUp(const String& name) = 0;
+        /** Internal method for updating the state of the collision proxies. */
+        virtual void updateCollisionProxies(void);
+
+        /** Internal method for testing the plane bounded region WorldFragment type. */
+        virtual bool testCollidePlaneBounds(SceneQuery::WorldFragment* wf);
+
+        /// Internal method for updating the query mask
+        virtual void setEntityQueryFlags(void);
+
+    public:
+        ApplicationObject(const String& name);
+        virtual ~ApplicationObject();
+
+        /** Sets the position of this object. */
+        virtual void setPosition(const Vector3& vec);
+        /** Sets the position of this object. */
+        virtual void setPosition(Real x, Real y, Real z);
+        /** Sets the orientation of this object. */
+        virtual void setOrientation(const Quaternion& orientation);
+        /** Gets the current position of this object. */
+        virtual const Vector3& getPosition(void);
+        /** Gets the current orientation of this object. */
+        virtual const Quaternion& getOrientation(void);
+
+        /// Updates the position of this game object from the simulation
+        virtual void _updateFromDynamics(void);
+
+        /// Returns whether or not this object is considered for collision.
+        virtual bool isCollisionEnabled(void);
+        /** Returns whether or not this object is physically simulated.
+        @remarks
+            Objects which are not physically simulated only move when their
+            SceneNode is manually altered.
+        */
+        virtual bool isDynamicsEnabled(void);
+        /** Sets whether or not this object is considered for collision.
+        @remarks
+            Objects which have collision enabled must set up an ODE 
+            collision proxy as part of their setUp method.
+        */
+
+        /** Sets the linear and angular velocity thresholds, below which the 
+        object will have it's dynamics automatically disabled for performance.
+        @remarks
+            These thresholds are used to speed up the simulation and to make it more
+            stable, by turning off dynamics for objects that appear to be at rest.
+            Otherwise, objects which are supposedly stationary can jitter when involved
+            in large stacks, and can consume unnecessary CPU time. Note that if another
+            object interacts with the disabled object, it will automatically reenable itself.
+        @par
+            If you never want to disable dynamics automatically for this object, just 
+            set all the values to 0.
+        @param linearSq The squared linear velocity magnitude threshold
+        @param angularSq The squared angular velocity magnitude threshold
+        @param overTime The number of seconds over which the values must continue to be under
+            this threshold for the dynamics to be disabled. This is to catch cases
+            where the object almost stops moving because of a boundary condition, but
+            would speed up again later (e.g. box teetering on an edge).
+
+        */
+        virtual void setDynamicsDisableThreshold(Real linearSq, Real angularSq, Real overTime);
+
+        virtual void setCollisionEnabled(bool enabled);
+        /** Sets whether or not this object is physically simulated at this time.
+        @remarks
+            Objects which are not physically simulated only move when their
+            SceneNode is manually altered. Objects which are physically 
+            simulated must set up an ODE body as part of their setUp method.
+        @par
+            You can also use this to temporarily turn off simulation on an object,
+            such that it is not simulated until some other object which IS simulated
+            comes in contact with it, or is attached to it with a joint.
+        @param enabled Specifies whether dynamics is enabled
+        @param reEnableOnInteraction If set to true, this object will reenable if some
+            other dynamically simulated object interacts with it
+        */
+        virtual void setDynamicsEnabled(bool enabled, bool reEnableOnInteraction = false);
+
+        /** Sets the 'bounciness' of this object.
+		 * @remarks
+		 * Only applies if this object has both collision and dynamics enabled.
+		 * When 2 movable objects collide, the greatest bounce parameters 
+		 * from both objects apply, so even a non-bouncy object can
+		 * bounce if it hits a bouncy surface. 
+		 * @param restitutionValue Coeeficient of restitution 
+		 * 		(0 for no bounce, 1 for perfect bounciness)
+		 * @param velocityThreshold Velocity below which no bounce will occur; 
+		 * 		this is a dampening value to ensure small velocities do not
+		 * 		cause bounce.
+		 */
+		virtual void setBounceParameters(Real restitutionValue,	Real velocityThreshold);
+		/** Gets the cefficient of restitution (bounciness) for this object. */
+		virtual Real getBounceRestitutionValue(void);
+		/** Gets the bounce velocity threshold for this object. */
+		virtual Real getBounceVelocityThreshold(void);
+
+		/** Sets the softness of this object, which determines how much it is allowed to 
+		 * penetrate other objects.
+		 * @remarks
+		 * 	This parameter only has meaning if collision and dynamics are enabled for this object.
+		 * 	@param softness Softness factor (0 is completely hard). Softness will be combined from
+		 * 		both objects involved in a collision to determine how much they will penetrate.
+		 */
+		virtual void setSoftness(Real softness);
+		/** Gets the softness factor of this object. */
+		virtual Real getSoftness(void);
+
+        /** Sets the Coulomb frictional coefficient for this object.
+        @remarks
+            This coefficient affects how much an object will slip when it comes
+            into contact with another object. 
+        @param friction The Coulomb friction coefficient, valid from 0 to Math::POS_INFINITY.
+            0 means no friction, Math::POS_INFINITY means infinite friction ie no slippage.
+            Note that friction between these 2 bounds is more CPU intensive so use with caution.
+        */
+        virtual void setFriction(Real friction);
+        /** Gets the Coulomb frictional coefficient for this object. */
+        virtual Real getFriction(void);
+        /** Adds a linear force to this object, in object space, at the position indicated. 
+        @remarks
+            All forces are applied, then reset after World::applyDynamics is called. 
+        @param direction The force direction in object coordinates.
+        @param atPosition The position at which the force is to be applied, in object coordinates.
+        */
+        virtual void addForce(const Vector3& direction, const Vector3& atPosition = Vector3::ZERO);
+        /** Adds a linear force to this object, in object space, at the position indicated. 
+        @remarks
+            All forces are applied, then reset after World::applyDynamics is called. 
+        @param dir_x, dir_y, dir_z The force direction in object coordinates.
+        @param pos_x, pos_y, pos_z The position at which the force is to be applied, in object coordinates.
+        */
+        virtual void addForce(Real dir_x, Real dir_y, Real dir_z, 
+            Real pos_x = 0, Real pos_y = 0, Real pos_z = 0);
+        /** Adds a linear force to this object, in world space, at the position indicated. 
+        @remarks
+            All forces are applied, then reset after World::applyDynamics is called. 
+        @param direction The force direction in world coordinates.
+        @param atPosition The position at which the force is to be applied, in world coordinates.
+        */
+        virtual void addForceWorldSpace(const Vector3& direction, const Vector3& atPosition = Vector3::ZERO);
+        /** Adds a linear force to this object, in world space, at the position indicated. 
+        @remarks
+            All forces are applied, then reset after World::applyDynamics is called. 
+        @param dir_x, dir_y, dir_z The force direction in world coordinates.
+        @param pos_x, pos_y, pos_z The position at which the force is to be applied, in world coordinates.
+        */
+        virtual void addForceWorldSpace(Real dir_x, Real dir_y, Real dir_z, 
+        Real pos_x, Real pos_y, Real pos_z);
+        /** Adds rotational force to this object, in object space.
+        @remarks
+            All forces are applied, then reset after World::applyDynamics is called. 
+        @param direction The direction of the torque to apply, in object space. */
+        virtual void addTorque(const Vector3& direction);
+        /** Adds rotational force to this object, in object space.
+        @remarks
+            All forces are applied, then reset after World::applyDynamics is called. 
+        @param x, y, z The direction of the torque to apply, in object space. */
+        virtual void addTorque(Real x, Real y, Real z);
+        /** Adds rotational force to this object, in world space.
+        @remarks
+            All forces are applied, then reset after World::applyDynamics is called. 
+        @param direction The direction of the torque to apply, in world space. */
+        virtual void addTorqueWorldSpace(const Vector3& direction);
+        /** Adds rotational force to this object, in world space.
+        @remarks
+            All forces are applied, then reset after World::applyDynamics is called. 
+        @param x, y, z The direction of the torque to apply, in world space. */
+        virtual void addTorqueWorldSpace(Real x, Real y, Real z);
+
+        /** Tests to see if there is a detailed collision between this object and the object passed in.
+        @remarks
+            If there is a collision, both objects will be notified and if dynamics are enabled
+            on these objects, physics will be applied automatically.
+        @returns true if collision occurred
+
+        */
+        virtual bool testCollide(ApplicationObject* otherObj);
+
+        /** Tests to see if there is a detailed collision between this object and the 
+            world fragment passed in.
+        @remarks
+            If there is a collision, the object will be notified and if dynamics are enabled
+            on this object, physics will be applied automatically.
+        @returns true if collision occurred
+        */
+        virtual bool testCollide(SceneQuery::WorldFragment* wf);
+
+        /** Contains information about a collision; used in the _notifyCollided call. */
+        struct CollisionInfo
+        {
+            /// The position in world coordinates at which the collision occurred
+            Vector3 position;
+            /// The normal in world coordinates of the collision surface
+            Vector3 normal;
+            /// Penetration depth 
+            Real penetrationDepth;
+        };
+        /** This method is called automatically if testCollide indicates a real collision. 
+        */
+        virtual void _notifyCollided(ApplicationObject* otherObj, const CollisionInfo& info);
+        /** This method is called automatically if testCollide indicates a real collision. 
+        */
+        virtual void _notifyCollided(SceneQuery::WorldFragment* wf, const CollisionInfo& info);
+        /** Gets the SceneNode which is being used to represent this object's position in 
+            the OGRE world. */
+        SceneNode* getSceneNode(void);
+        /** Gets the Entity which is being used to represent this object in the OGRE world. */
+        Entity* getEntity(void);
+        /** Gets the ODE body used to represent this object's mass and current velocity. */
+        dBody* getOdeBody(void);
+
+        /** Set the mass parameters of this object to represent a sphere.
+        @remarks
+            This method sets the mass and inertia properties of this object such
+            that it is like a sphere, ie center of gravity at the origin and
+            an even distribution of mass in all directions.
+        @param density Density of the sphere in Kg/m^3
+        @param radius of the sphere mass
+        */
+        void setMassSphere(Real density, Real radius);
+
+        /** Set the mass parameters of this object to represent a box. 
+        @remarks
+            This method sets the mass and inertia properties of this object such
+            that it is like a box.
+        @param density Density of the box in Kg/m^3
+        @param dimensions Width, height and depth of the box.
+        @param orientation Optional orientation of the box.
+        */
+        void setMassBox(Real density, const Vector3& dimensions, 
+            const Quaternion& orientation = Quaternion::IDENTITY);
+
+        /** Set the mass parameters of this object to represent a capped cylinder. 
+        @remarks
+            This method sets the mass and inertia properties of this object such
+            that it is like a capped cylinder, by default lying along the Z-axis.
+        @param density Density of the cylinder in Kg/m^3
+        @param length Length of the cylinder
+        @param width Width of the cylinder
+        @param orientation Optional orientation if you wish the cylinder to lay 
+            along a different axis from Z.
+        */
+        void setMassCappedCylinder(Real density, Real length, Real width, 
+            const Quaternion& orientation = Quaternion::IDENTITY);
+
+        /** Sets the mass parameters manually, use only if you know how!
+        @param mass Mass in Kg
+        @param center The center of gravity
+        @param inertia The inertia matrix describing distribution of the mass around the body.
+        */
+        void setMassExpert(Real mass, const Vector3 center, const Matrix3 inertia);
+
+        /** Gets the ODE mass parameters for this object. */
+        const dMass* getOdeMass(void);
+
+        /** Sets the current linear velocity of this object.
+        @remarks
+            Only applicable if dynamics are enabled for this object. This method is useful
+            for starting an object off at a particular speed rather than applying forces to get 
+            it there.
+        */ 
+        void setLinearVelocity(const Vector3& vel);
+        /** Sets the current linear velocity of this object.
+        @remarks
+            Only applicable if dynamics are enabled for this object. This method is useful
+            for starting an object off at a particular speed rather than applying forces to get 
+            it there.
+        */ 
+        void setLinearVelocity(Real x, Real y, Real z);
+        /** Gets the current linear velocity of this object.
+        @remarks
+            Only applicable if dynamics are enabled for this object.
+        @returns Vector3 representing the velocity in units per second.
+        */
+        const Vector3& getLinearVelocity(void);
+
+        /** Gets the current angular velocity of this object.
+        @remarks
+            Only applicable if dynamics are enabled for this object.
+        @returns Vector3 representing the angular velocity in units per second around each axis.
+        */
+        const Vector3& getAngularVelocity(void);
+
+        /** Sets the current angular velocity of this object.
+        @remarks
+            Only applicable if dynamics are enabled for this object. This method is useful
+            for starting an object off rather than applying forces to get 
+            it there.
+        */ 
+        void setAngularVelocity(const Vector3& vel);
+        /** Sets the current angular velocity of this object.
+        @remarks
+            Only applicable if dynamics are enabled for this object. This method is useful
+            for starting an object off rather than applying forces to get 
+            it there.
+        */ 
+        void setAngularVelocity(Real x, Real y, Real z);
+
+        /** Moves the object along it's local  axes.
+            @par
+                This method moves the object by the supplied vector along the
+                local axes of the obect.
+            @param 
+                d Vector with x,y,z values representing the translation.
+        */
+        virtual void translate(const Vector3& d);
+        /** Moves the object along it's local axes.
+            @par
+                This method moves the object by the supplied vector along the
+                local axes of the obect.
+            @param x, y z Real x, y and z values representing the translation.
+        */
+        virtual void translate(Real x, Real y, Real z);
+
+        /** Moves the object along the world axes.
+            @par
+                This method moves the object by the supplied vector along the
+                world axes.
+            @param 
+                d Vector with x,y,z values representing the translation.
+        */
+        virtual void translateWorldSpace(const Vector3& d);
+        /** Moves the object along the world axes.
+            @par
+                This method moves the object by the supplied vector along the
+                local axes of the obect.
+            @param x, y z Real x, y and z values representing the translation.
+        */
+        virtual void translateWorldSpace(Real x, Real y, Real z);
+
+        /** Rotate the object around the local Z-axis.
+        */
+        virtual void roll(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void roll(Real angleunits) {
+            roll ( Angle(angleunits) );
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Rotate the object around the local X-axis.
+        */
+        virtual void pitch(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void pitch(Real angleunits) {
+            pitch ( Angle(angleunits) );
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Rotate the object around the local Y-axis.
+        */
+        virtual void yaw(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void yaw(Real angleunits) {
+            yaw ( Angle(angleunits) );
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Rotate the object around an arbitrary axis.
+        */
+        virtual void rotate(const Vector3& axis, const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void rotate(const Vector3& axis, Real angleunits) {
+            rotate ( axis, Angle(angleunits) );
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Rotate the object around an aritrary axis using a Quarternion.
+        */
+        virtual void rotate(const Quaternion& q);
+
+
+    };
+
+
+} // namespace
+
+#endif
+
+
Index: /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppBall.h
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppBall.h	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppBall.h	(revision 5)
@@ -0,0 +1,53 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __REFAPP_BALL_H__
+#define __REFAPP_BALL_H__
+
+#include "OgreRefAppPrerequisites.h"
+#include "OgreRefAppApplicationObject.h"
+
+namespace OgreRefApp {
+
+    class _OgreRefAppExport Ball : public ApplicationObject
+    {
+    protected:
+        Real mRadius;
+        void setUp(const String& name);
+    public:
+        Ball(const String& name, Real radius);
+        ~Ball();
+
+    };
+
+
+}
+
+#endif
+
+
Index: /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppBox.h
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppBox.h	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppBox.h	(revision 5)
@@ -0,0 +1,60 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __REFAPP_BOX_H__
+#define __REFAPP_BOX_H__
+
+#include "OgreRefAppPrerequisites.h"
+#include "OgreRefAppApplicationObject.h"
+
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+
+namespace OgreRefApp {
+
+    class _OgreRefAppExport Box : public ApplicationObject
+    {
+    protected:
+        Vector3 mDimensions;
+
+        void setUp(const String& name);
+    public:
+        Box(const String& name, Real width, Real height, Real depth);
+        ~Box();
+
+        void _notifyCollided(ApplicationObject* otherObj, const CollisionInfo& info)
+        {
+        }
+    };
+
+
+}
+
+#endif
+
+
Index: /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppCollideCamera.h
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppCollideCamera.h	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppCollideCamera.h	(revision 5)
@@ -0,0 +1,325 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __REFAPP_COLLIDECAMERA_H__
+#define __REFAPP_COLLIDECAMERA_H__
+
+#include "OgreRefAppPrerequisites.h"
+#include "OgreCamera.h"
+#include "OgreRefAppApplicationObject.h"
+
+namespace OgreRefApp {
+
+    /** A camera which can interact with the world. */
+    class _OgreRefAppExport CollideCamera : public ApplicationObject
+    {
+    protected:
+        /// Contained camera
+        /* Note that I choose to contain Camera rather than subclass because the
+           multiple inheritence would get very nasty (lots of method name clashes)
+           and it's better that we can hide a few non-relevant methods this way.
+           ApplicationObject needs to be the top-level interface anyway. */
+        Camera *mCamera;
+        /// Set up
+        void setUp(const String& name);
+        /// Triggers recacl of collison bounds
+        void nearDistChanged(void);
+    public:
+        CollideCamera(const String& name);
+
+        /** Gets the internal Camera object. */
+        Camera* getRealCamera(void) { return mCamera; }
+
+        // ----------------------------------------------
+        // Overridden methods from ApplicationObject
+        // Note that we position the camera using the node
+        // But we orient the camera on it's own rotation
+        // ----------------------------------------------
+       
+        /** This method is called automatically if testCollide indicates a real collision. 
+        */
+        void _notifyCollided(SceneQuery::WorldFragment* wf, const CollisionInfo& info);
+        /** Sets the orientation of this object. */
+        void setOrientation(const Quaternion& orientation);
+        /** Gets the current orientation of this object. */
+        const Quaternion& getOrientation(void);
+
+        /** Moves the object along it's local  axes.
+            @par
+                This method moves the object by the supplied vector along the
+                local axes of the obect.
+            @param 
+                d Vector with x,y,z values representing the translation.
+        */
+        void translate(const Vector3& d);
+        /** Rotate the object around the local Z-axis.
+        */
+        void roll(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void roll(Real angleunits) {
+            roll ( Angle(angleunits) );
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Rotate the object around the local X-axis.
+        */
+        void pitch(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void pitch(Real angleunits) {
+            pitch ( Angle(angleunits) );
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Rotate the object around the local Y-axis.
+        */
+        void yaw(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void yaw(Real angleunits) {
+            yaw ( Angle(angleunits) );
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Rotate the object around an arbitrary axis.
+        */
+        void rotate(const Vector3& axis, const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void rotate(const Vector3& axis, Real angleunits) {
+            rotate ( axis, Angle(angleunits) );
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Rotate the object around an aritrary axis using a Quarternion.
+        */
+        void rotate(const Quaternion& q);
+
+        // ----------------------------------------------
+        // The following are methods delegated to Camera
+        // ----------------------------------------------
+
+        /** Sets the type of projection to use (orthographic or perspective). Default is perspective.
+        */
+        void setProjectionType(ProjectionType pt);
+
+        /** Retrieves info on the type of projection used (orthographic or perspective).
+        */
+        ProjectionType getProjectionType(void) const;
+
+        /** Sets the level of rendering detail required from this camera.
+            @remarks
+                Each camera is set to render at full detail by default, that is
+                with full texturing, lighting etc. This method lets you change
+                that behaviour, allowing you to make the camera just render a
+                wireframe view, for example.
+        */
+        void setPolygonMode(PolygonMode sd);
+
+        /** Retrieves the level of detail that the camera will render.
+        */
+        PolygonMode getPolygonMode(void) const;
+
+        /** Sets the camera's direction vector.
+            @remarks
+                Note that the 'up' vector for the camera will automatically be recalculated based on the
+                current 'up' vector (i.e. the roll will remain the same).
+        */
+        void setDirection(Real x, Real y, Real z);
+
+        /** Sets the camera's direction vector.
+        */
+        void setDirection(const Vector3& vec);
+
+        /* Gets the camera's direction.
+        */
+        Vector3 getDirection(void) const;
+
+
+        /** Points the camera at a location in worldspace.
+            @remarks
+                This is a helper method to automatically generate the
+                direction vector for the camera, based on it's current position
+                and the supplied look-at point.
+            @param
+                targetPoint A vector specifying the look at point.
+        */
+        void lookAt( const Vector3& targetPoint );
+        /** Points the camera at a location in worldspace.
+            @remarks
+                This is a helper method to automatically generate the
+                direction vector for the camera, based on it's current position
+                and the supplied look-at point.
+            @param
+                x
+            @param
+                y
+            @param
+                z Co-ordinates of the point to look at.
+        */
+        void lookAt(Real x, Real y, Real z);
+
+        /** Tells the camera whether to yaw around it's own local Y axis or a fixed axis of choice.
+            @remarks
+                This method allows you to change the yaw behaviour of the camera - by default, the camera
+                yaws around it's own local Y axis. This is often what you want - for example a flying camera
+                - but sometimes this produces unwanted effects. For example, if you're making a first-person
+                shooter, you really don't want the yaw axis to reflect the local camera Y, because this would
+                mean a different yaw axis if the player is looking upwards rather than when they are looking
+                straight ahead. You can change this behaviour by setting the yaw to a fixed axis (say, the world Y).
+            @param
+                useFixed If true, the axis passed in the second parameter will always be the yaw axis no
+                matter what the camera orientation. If false, the camera returns to it's default behaviour.
+            @param
+                fixedAxis The axis to use if the first parameter is true.
+        */
+        void setFixedYawAxis( bool useFixed, const Vector3& fixedAxis = Vector3::UNIT_Y );
+
+        /** Sets the Y-dimension Field Of View (FOV) of the camera.
+            @remarks
+                Field Of View (FOV) is the angle made between the camera's position, and the left & right edges
+                of the 'screen' onto which the scene is projected. High values (90+) result in a wide-angle,
+                fish-eye kind of view, low values (30-) in a stretched, telescopic kind of view. Typical values
+                are between 45 and 60.
+            @par
+                This value represents the HORIZONTAL field-of-view. The vertical field of view is calculated from
+                this depending on the dimensions of the viewport (they will only be the same if the viewport is square).
+            @note
+                Setting the FOV overrides the value supplied for Camera::setNearClipPlane.
+         */
+        void setFOVy(const Radian& fovy);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+        inline void setFOVy(Real fovy) {
+            setFOVy ( Angle(fovy) );
+        }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+        /** Retrieves the cameras Y-dimension Field Of View (FOV).
+        */
+        const Radian& getFOVy(void) const;
+
+        /** Sets the position of the near clipping plane.
+            @remarks
+                The position of the near clipping plane is the distance from the cameras position to the screen
+                on which the world is projected. The near plane distance, combined with the field-of-view and the
+                aspect ratio, determines the size of the viewport through which the world is viewed (in world
+                co-ordinates). Note that this world viewport is different to a screen viewport, which has it's
+                dimensions expressed in pixels. The cameras viewport should have the same aspect ratio as the
+                screen viewport it renders into to avoid distortion.
+            @param
+                near The distance to the near clipping plane from the camera in world coordinates.
+         */
+        void setNearClipDistance(Real nearDist);
+
+        /** Sets the position of the near clipping plane.
+        */
+        Real getNearClipDistance(void) const;
+
+        /** Sets the distance to the far clipping plane.
+            @remarks
+                The view frustrum is a pyramid created from the camera position and the edges of the viewport.
+                This frustrum does not extend to infinity - it is cropped near to the camera and there is a far
+                plane beyond which nothing is displayed. This method sets the distance for the far plane. Different
+                applications need different values: e.g. a flight sim needs a much further far clipping plane than
+                a first-person shooter. An important point here is that the larger the gap between near and far
+                clipping planes, the lower the accuracy of the Z-buffer used to depth-cue pixels. This is because the
+                Z-range is limited to the size of the Z buffer (16 or 32-bit) and the max values must be spread over
+                the gap between near and far clip planes. The bigger the range, the more the Z values will
+                be approximated which can cause artifacts when lots of objects are close together in the Z-plane. So
+                make sure you clip as close to the camera as you can - don't set a huge value for the sake of
+                it.
+            @param
+                far The distance to the far clipping plane from the camera in world coordinates.
+        */
+        void setFarClipDistance(Real farDist);
+
+        /** Retrieves the distance from the camera to the far clipping plane.
+        */
+        Real getFarClipDistance(void) const;
+
+        /** Sets the aspect ratio for the camera viewport.
+            @remarks
+                The ratio between the x and y dimensions of the rectangular area visible through the camera
+                is known as aspect ratio: aspect = width / height .
+            @par
+                The default for most fullscreen windows is 1.3333 - this is also assumed by Ogre unless you
+                use this method to state otherwise.
+        */
+        void setAspectRatio(Real ratio);
+
+        /** Retreives the current aspect ratio.
+        */
+        Real getAspectRatio(void) const;
+
+        /** Retrieves a specified plane of the frustum.
+            @remarks
+                Gets a reference to one of the planes which make up the camera frustum, e.g. for clipping purposes.
+        */
+        const Plane& getFrustumPlane( FrustumPlane plane );
+
+        /** Tests whether the given container is visible in the Frustum.
+            @param
+                bound Bounding box to be checked
+            @param
+                culledBy Optional pointer to an int which will be filled by the plane number which culled
+                the box if the result was false;
+            @returns
+                If the box was visible, true is returned.
+            @par
+                Otherwise, false is returned.
+        */
+        bool isVisible(const AxisAlignedBox& bound, FrustumPlane* culledBy = 0);
+
+        /** Tests whether the given container is visible in the Frustum.
+            @param
+                bound Bounding sphere to be checked
+            @param
+                culledBy Optional pointer to an int which will be filled by the plane number which culled
+                the box if the result was false;
+            @returns
+                If the sphere was visible, true is returned.
+            @par
+                Otherwise, false is returned.
+        */
+        bool isVisible(const Sphere& bound, FrustumPlane* culledBy = 0);
+
+        /** Tests whether the given vertex is visible in the Frustum.
+            @param
+                vert Vertex to be checked
+            @param
+                culledBy Optional pointer to an int which will be filled by the plane number which culled
+                the box if the result was false;
+            @returns
+                If the box was visible, true is returned.
+            @par
+                Otherwise, false is returned.
+        */
+        bool isVisible(const Vector3& vert, FrustumPlane* culledBy = 0);
+
+    };
+
+}
+
+#endif
Index: /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppJoint.h
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppJoint.h	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppJoint.h	(revision 5)
@@ -0,0 +1,128 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __REFAPP_JOINT_H__
+#define __REFAPP_JOINT_H__
+
+#include "OgreRefAppPrerequisites.h"
+
+namespace OgreRefApp {
+
+    /** Represents a linkage between application objects or between them and the world, enforcing 
+        certain constraints.
+    @remarks
+        Joints can be used to link application objects together, or to link them to a static point
+        in the world according to certain constraints. You should create joints using 
+        World::createJoint. You should then set certain global options, like it's world
+        anchor position, before attaching it to application objects. You application objects
+        should already be positioned how you would like relative to the joint anchor, since once
+        they are attached, they will be constrained by it.
+    */
+    class _OgreRefAppExport Joint 
+    {
+    public:
+        /// The type of joint
+        enum JointType {
+            /// Ball & socket joint, has 3 degrees of freedom
+            JT_BALL,
+            /// Sliding joint, 1 degree of freedom (in-out)
+            JT_SLIDER,
+            /// Hinge joint, 1 degree of freedom
+            JT_HINGE,
+            /// Universal joint, like a double-hinge, 2 degrees of freedom
+            JT_UNIVERSAL,
+            /// 2 hinges in series, like the axel of a car
+            JT_HINGE2
+        };
+        /** Constructor, however you should use World::createJoint(type, obj1, obj2). */
+        Joint(JointType jtype);
+        virtual ~Joint() { if (mOdeJoint) delete mOdeJoint; }
+
+
+        /** Returns the type of this joint. */
+        JointType getType(void);
+        /** Set the anchor point of this joint.
+        @remarks
+            Sets the location, in world space, of the anchor point of this joint, which is usually 
+            the hinge point or just the origin of joint. It has no meaning for JT_SLIDER and thus
+            you don't need to call it for that.
+        */
+        virtual void setAnchorPosition(const Vector3& point) = 0;
+
+        /** Gets the anchor position of this joint. */
+        virtual const Vector3& getAnchorPosition(void);
+
+
+        /** Gets the attached objects, a NULL means no object ie a static attachment. */
+        virtual const std::pair<ApplicationObject*, ApplicationObject*>& getAttachments(void);
+
+        /** Sets the axes for this joint.
+        @remarks
+            The meaning of axes for a joint depends on it's type:
+            <ul>
+            <li>For JT_BALL, it has no meaning and you don't need to call it.</li>
+            <li>For JT_SLIDER, only one is applicable and it's the axis along which the slide occurs. </li>
+            <li>For JT_HINGE, only one is applicable and it's the hinge axis. </li>
+            <li>For JT_UNIVERSAL, and JT_HINGE2 it's the 2 hinge axes.</li>
+            </ul>
+        */
+        virtual void setAxes(const Vector3& primaryAxis, const Vector3& secondaryAxis = Vector3::ZERO) = 0;
+
+        /** Gets the axes of this joint. */
+        virtual const std::pair<Vector3, Vector3>& getAxes(void);
+
+    protected:
+
+        /** Sets the objects attached to this joint.
+        @remarks
+            It appears that this has to be set before other joint params like
+            anchor etc, otherwise the joint does not behave. Therefore it is internal
+            and is called during construction.
+        */
+        void setAttachments(ApplicationObject* obj1, ApplicationObject* obj2);
+
+        JointType mType;
+        Vector3 mAnchor;
+        std::pair<ApplicationObject*, ApplicationObject*> mAttachedObjects;
+        std::pair<Vector3, Vector3> mAxes;
+
+        // ODE object
+        dJoint* mOdeJoint;
+
+
+
+
+
+
+
+
+
+    };
+}
+
+#endif
Index: /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppJointSubtypes.h
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppJointSubtypes.h	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppJointSubtypes.h	(revision 5)
@@ -0,0 +1,158 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __REFAPP_JOINTSUBTYPES_H__
+#define __REFAPP_JOINTSUBTYPES_H__
+
+#include "OgreRefAppPrerequisites.h"
+#include "OgreRefAppJoint.h"
+
+namespace OgreRefApp {
+
+    /** Implementation of ball joint. */
+    class _OgreRefAppExport BallJoint : public Joint
+    {
+    public:
+        BallJoint(Joint::JointType jtype, ApplicationObject* obj1, ApplicationObject* obj2);
+        ~BallJoint() {}
+        /** Set the anchor point of this joint.
+        @remarks
+            Sets the location, in world space, of the anchor point of this joint, which can be
+            the hinge point or just the origin of joint.
+        */
+        void setAnchorPosition(const Vector3& point);
+
+        /** Sets the axes for this joint.
+        @remarks
+            Has no meaning for this type of joint, so does nothing.
+        */
+        void setAxes(const Vector3& primaryAxis, const Vector3& secondaryAxis = Vector3::ZERO) {}
+    protected:
+    };
+
+    /** Implementation of slider joint. */
+    class _OgreRefAppExport SliderJoint : public Joint
+    {
+    public:
+        SliderJoint(Joint::JointType jtype, ApplicationObject* obj1, ApplicationObject* obj2);
+        ~SliderJoint() {}
+        /** Set the anchor point of this joint.
+        @remarks
+            Has no meaning for a slider, thus unimplemented.
+        */
+        void setAnchorPosition(const Vector3& point) {}
+
+        /** Sets the axes for this joint.
+        @remarks
+            The meaning of axes for a joint depends on it's type:
+            <ul>
+            <li>For JT_BALL, it has no meaning and you don't need to call it.</li>
+            <li>For JT_SLIDER, only one is applicable and it's the axis along which the slide occurs. </li>
+            <li>For JT_HINGE, only one is applicable and it's the hinge axis. </li>
+            <li>For JT_UNIVERSAL, and JT_HINGE2 it's the 2 hinge axes.</li>
+            </ul>
+        */
+        void setAxes(const Vector3& primaryAxis, const Vector3& secondaryAxis = Vector3::ZERO);
+    protected:
+    };
+
+    /** Implementation of hinge joint. */
+    class _OgreRefAppExport HingeJoint : public Joint
+    {
+    public:
+        HingeJoint(Joint::JointType jtype, ApplicationObject* obj1, ApplicationObject* obj2);
+        ~HingeJoint() {}
+        /** Set the anchor point of this joint.
+        */
+        void setAnchorPosition(const Vector3& point);
+
+        /** Sets the axes for this joint.
+        @remarks
+            The meaning of axes for a joint depends on it's type:
+            <ul>
+            <li>For JT_BALL, it has no meaning and you don't need to call it.</li>
+            <li>For JT_SLIDER, only one is applicable and it's the axis along which the slide occurs. </li>
+            <li>For JT_HINGE, only one is applicable and it's the hinge axis. </li>
+            <li>For JT_UNIVERSAL, and JT_HINGE2 it's the 2 hinge axes.</li>
+            </ul>
+        */
+        void setAxes(const Vector3& primaryAxis, const Vector3& secondaryAxis = Vector3::ZERO);
+    protected:
+    };
+
+    /** Implementation of universal joint. */
+    class _OgreRefAppExport UniversalJoint : public Joint
+    {
+    public:
+        UniversalJoint(Joint::JointType jtype, ApplicationObject* obj1, ApplicationObject* obj2);
+        ~UniversalJoint() {}
+        /** Set the anchor point of this joint.
+        */
+        void setAnchorPosition(const Vector3& point);
+
+        /** Sets the axes for this joint.
+        @remarks
+            The meaning of axes for a joint depends on it's type:
+            <ul>
+            <li>For JT_BALL, it has no meaning and you don't need to call it.</li>
+            <li>For JT_SLIDER, only one is applicable and it's the axis along which the slide occurs. </li>
+            <li>For JT_HINGE, only one is applicable and it's the hinge axis. </li>
+            <li>For JT_UNIVERSAL, and JT_HINGE2 it's the 2 hinge axes.</li>
+            </ul>
+        */
+        void setAxes(const Vector3& primaryAxis, const Vector3& secondaryAxis = Vector3::ZERO);
+    protected:
+    };
+
+    /** Implementation of hinge2 joint. */
+    class _OgreRefAppExport Hinge2Joint : public Joint
+    {
+    public:
+        Hinge2Joint(Joint::JointType jtype, ApplicationObject* obj1, ApplicationObject* obj2);
+        ~Hinge2Joint() {}
+        /** Set the anchor point of this joint.
+        */
+        void setAnchorPosition(const Vector3& point);
+
+        /** Sets the axes for this joint.
+        @remarks
+            The meaning of axes for a joint depends on it's type:
+            <ul>
+            <li>For JT_BALL, it has no meaning and you don't need to call it.</li>
+            <li>For JT_SLIDER, only one is applicable and it's the axis along which the slide occurs. </li>
+            <li>For JT_HINGE, only one is applicable and it's the hinge axis. </li>
+            <li>For JT_UNIVERSAL, and JT_HINGE2 it's the 2 hinge axes.</li>
+            </ul>
+        */
+        void setAxes(const Vector3& primaryAxis, const Vector3& secondaryAxis = Vector3::ZERO);
+    protected:
+    };
+
+}
+
+#endif
Index: /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppOgreHead.h
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppOgreHead.h	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppOgreHead.h	(revision 5)
@@ -0,0 +1,52 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __REFAPP_OGREHEAD_H__
+#define __REFAPP_OGREHEAD_H__
+
+#include "OgreRefAppPrerequisites.h"
+#include "OgreRefAppApplicationObject.h"
+
+namespace OgreRefApp {
+
+    class _OgreRefAppExport OgreHead : public ApplicationObject
+    {
+    protected:
+        void setUp(const String& name);
+    public:
+        OgreHead(const String& name);
+        ~OgreHead();
+
+    };
+
+
+}
+
+#endif
+
+
Index: /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppPlane.h
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppPlane.h	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppPlane.h	(revision 5)
@@ -0,0 +1,49 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __REFAPP_PLANE_H__
+#define __REFAPP_PLANE_H__
+
+#include "OgreRefAppPrerequisites.h"
+#include "OgreRefAppApplicationObject.h"
+
+namespace OgreRefApp {
+
+    class _OgreRefAppExport FinitePlane : public ApplicationObject
+    {
+    protected:
+        Real mWidth;
+        Real mHeight;
+        void setUp(const String& name);
+    public:
+        FinitePlane(const String& name, Real width, Real height);
+        ~FinitePlane();
+    };
+
+}
+#endif
Index: /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppPrerequisites.h
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppPrerequisites.h	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppPrerequisites.h	(revision 5)
@@ -0,0 +1,93 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __REFAPP_PREREQUISITES_H__
+#define __REFAPP_PREREQUISITES_H__
+
+// Include ODE standard C header
+#include <ode/ode.h>
+// Include ODE C++ headers
+#include <ode/odecpp.h>
+#include <ode/odecpp_collision.h>
+
+// Include main application-facing Ogre header
+#include <Ogre.h>
+
+
+// To save us some typing
+using namespace Ogre;
+
+namespace OgreRefApp {
+
+    #if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) && !defined(OGRE_STATIC_LIB)
+    // Export control
+    #   if defined( REFERENCEAPPLAYER_EXPORTS )
+    #       define _OgreRefAppExport __declspec( dllexport )
+    #   else
+    #       if defined( __MINGW32__ )
+    #           define _OgreRefAppExport
+    #       else
+    #     	    define _OgreRefAppExport __declspec( dllimport )
+    #       endif
+    #   endif
+    #else // Linux / Mac OSX etc
+    #   define _OgreRefAppExport
+    #endif
+
+    // Quick conversions
+    inline void OgreToOde(const Matrix3& ogre, dMatrix3& ode)
+    {
+        ode[0] = ogre[0][0];
+        ode[1] = ogre[0][1];
+        ode[2] = ogre[0][2];
+        ode[3] = ogre[0][3];
+        ode[4] = ogre[1][0];
+        ode[5] = ogre[1][1];
+        ode[6] = ogre[1][2];
+        ode[7] = ogre[1][3];
+        ode[8] = ogre[2][0];
+        ode[9] = ogre[2][1];
+        ode[10] = ogre[2][2];
+        ode[11] = ogre[2][3];
+    }
+
+
+    // Forward definitions of classes to reduce dependencies
+    class ApplicationObject;
+    class OgreHead;
+    class FinitePlane;
+    class Ball;
+    class Box;
+    class CollideCamera;
+
+}
+
+
+
+#endif
+
Index: /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppWorld.h
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppWorld.h	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/include/OgreRefAppWorld.h	(revision 5)
@@ -0,0 +1,220 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __REFAPP_WORLD_H__
+#define __REFAPP_WORLD_H__
+
+#include "OgreRefAppPrerequisites.h"
+#include "OgreRefAppJoint.h"
+#include <OgreSingleton.h>
+
+namespace OgreRefApp {
+
+    class _OgreRefAppExport World : public Singleton<World>
+    {
+    public:
+        /// World type, you'll want to extend this for your own apps
+        enum WorldType {
+            WT_REFAPP_GENERIC,
+            WT_REFAPP_BSP
+        };
+    protected:
+        /// Pointer to OGRE's scene manager
+        SceneManager* mSceneMgr;
+
+        typedef std::map<String, ApplicationObject*> ObjectMap;
+        /// Main list of objects
+        ObjectMap mObjects;
+
+        typedef std::map<String, Joint*> JointMap;
+        JointMap mJoints;
+
+        typedef std::set<ApplicationObject*> ObjectSet;
+        /// Set of dynamics objects (those to perform physics on)
+        ObjectSet mDynamicsObjects;
+
+        // ODE world object
+        dWorld* mOdeWorld;
+
+        /// Contact joint group
+        dJointGroup* mOdeContactGroup;
+
+        Vector3 mGravity;
+
+        IntersectionSceneQuery* mIntersectionQuery;
+
+        /// The step size of the collision / physics simulation
+        Real mSimulationStepSize;
+
+        /// The type of world we're dealing with
+        WorldType mWorldType;
+
+    public:
+        /** Creates an instance of the world. 
+        @param sceneMgr Pointer to the scene manager which will manage the scene
+        @param worldType The type of world being used
+        */
+        World(SceneManager* sceneMgr, WorldType worldType = WT_REFAPP_GENERIC);
+        ~World();
+
+        /// Get the scene manager for this world
+        SceneManager* getSceneManager(void);
+
+        /** Create an OGRE head object. */
+        OgreHead* createOgreHead(const String& name, const Vector3& pos = Vector3::ZERO, 
+            const Quaternion& orientation = Quaternion::IDENTITY);
+
+        /** Create a plane object. */
+        FinitePlane* createPlane(const String& name, Real width, Real height, const Vector3& pos = Vector3::ZERO, 
+            const Quaternion& orientation = Quaternion::IDENTITY);
+
+        /** Create a ball object. */
+        Ball* createBall(const String& name, Real radius, const Vector3& pos = Vector3::ZERO, 
+            const Quaternion& orientation = Quaternion::IDENTITY);
+
+        /** Create a box object. */
+        Box* createBox(const String& name, Real width, Real height, Real depth,
+            const Vector3& pos = Vector3::ZERO, 
+            const Quaternion& orientation = Quaternion::IDENTITY);
+
+        /** Create a camera which interacts with the world. */
+        CollideCamera* createCamera(const String& name, 
+            const Vector3& pos = Vector3::ZERO, 
+            const Quaternion& orientation = Quaternion::IDENTITY);
+
+        /** Clears the scene. */
+        void clear(void);
+
+        dWorld* getOdeWorld(void);
+        dJointGroup* getOdeContactJointGroup(void);
+
+        /** Detects all the collisions in the world and acts on them.
+        @remarks
+            This method performs the appropriate queries to detect all the colliding objects
+            in the world, tells the objects about it and adds the appropriate physical simulation
+            constructs required to apply collision response when applyDynamics is called.
+        @par This method is called automatically by World::simulationStep()
+        */
+        void _applyCollision(void);
+
+        /** Updates the world simulation. 
+        @par This method is called automatically by World::simulationStep()
+        */
+        void _applyDynamics(Real timeElapsed);
+
+        /** Internal method for notifying the world of a change in the dynamics status of an object. */
+        void _notifyDynamicsStateForObject(ApplicationObject* obj, bool dynamicsEnabled);
+
+        /** Sets the gravity vector, units are in m/s^2.
+        @remarks
+            The world defaults to no gravity.
+            Tip: Earth gravity is Vector3(0, -9.81, 0);
+        */
+        void setGravity(const Vector3& vec);
+
+        /** Gets the gravity vector. */
+        const Vector3& getGravity(void);
+
+        /** Creates a Joint object for linking objects together in the world. 
+        @param name The name of the Joint.
+        @param jtype The type of joint, see Joint::JointType.
+        @param obj1 The first object to attach, or NULL to attach to the static world.
+        @param obj2 The second object to attach, or NULL to attach to the static world.
+        */
+        Joint* createJoint(const String& name, Joint::JointType jtype,
+            ApplicationObject* obj1, ApplicationObject* obj2);
+
+        /** Sets the step size of the simulation.
+        @remarks
+            This parameter allows you to alter the accuracy of the simulation. 
+            This is the interval at which collision and physics are performed,
+            such that in high frame rate scenarios these operations are
+            not done every single frame, and in low frame rate situations more
+            steps are performed per frame to ensure the stability of the
+            simulation.
+        @par
+            The default value for this parameter is 0.01s.
+        */
+        void setSimulationStepSize(Real step);
+        /** Returns the size of the simulation step. */
+        Real getSimulationStepSize(void);
+
+        /** Performs a simulation step, ie applies collision and physics.
+        @remarks
+            Collision events will cause callbacks to your ApplicationObject
+            instances to notify them of the collisions; this is for information,
+            dynamics are applied automatically if turned on for the objects so you
+            do not need to handle physics yourself if you do not wish to.
+        @par
+            Note that if the timeElapsed parameter is greater than the simulation
+            step size (as set using setSimulationStepSize), more than one collision
+            and dynamics step will take place during this call. Similarly, no step
+            may occur if the time elapsed has not reached the simulation step
+            size yet.
+        */
+        void simulationStep(Real timeElapsed);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static World& getSingleton(void);
+        /** Override standard Singleton retrieval.
+        @remarks
+        Why do we do this? Well, it's because the Singleton
+        implementation is in a .h file, which means it gets compiled
+        into anybody who includes it. This is needed for the
+        Singleton template to work, but we actually only want it
+        compiled into the implementation of the class based on the
+        Singleton, not all of them. If we don't change this, we get
+        link errors when trying to use the Singleton-based class from
+        an outside dll.
+        @par
+        This method just delegates to the template version anyway,
+        but the implementation stays in this single compilation unit,
+        preventing link errors.
+        */
+        static World* getSingletonPtr(void);
+
+    };
+
+
+}
+
+#endif
+
Index: /ReferenceApplication/ReferenceAppLayer/include/OgreReferenceAppLayer.h
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/include/OgreReferenceAppLayer.h	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/include/OgreReferenceAppLayer.h	(revision 5)
@@ -0,0 +1,46 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __REFERENCE_APP_LAYER_H__
+#define __REFERENCE_APP_LAYER_H__
+
+// This is a utility header for client applications to use
+#include "OgreRefAppPrerequisites.h"
+#include "OgreRefAppWorld.h"
+#include "OgreRefAppApplicationObject.h"
+#include "OgreRefAppOgreHead.h"
+#include "OgreRefAppPlane.h"
+#include "OgreRefAppBall.h"
+#include "OgreRefAppJoint.h"
+#include "OgreRefAppBox.h"
+#include "OgreRefAppCollideCamera.h"
+
+
+#endif
+
Index: /ReferenceApplication/ReferenceAppLayer/include/config.h.in
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/include/config.h.in	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/include/config.h.in	(revision 5)
@@ -0,0 +1,73 @@
+/* ReferenceAppLayer/include/config.h.in.  Generated from configure.in by autoheader.  */
+
+/* Use old STL hash options */
+#undef EXT_HASH
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define to 1 if you have the `ode' library (-lode). */
+#undef HAVE_LIBODE
+
+/* Define to 1 if you have the `z' library (-lz). */
+#undef HAVE_LIBZ
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* snprintf */
+#undef HAVE_SNPRINTF
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* vsnprintf */
+#undef HAVE_VSNPRINTF
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
Index: /ReferenceApplication/ReferenceAppLayer/scripts/ReferenceAppLayer.cbp
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/scripts/ReferenceAppLayer.cbp	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/scripts/ReferenceAppLayer.cbp	(revision 5)
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="ReferenceAppLayer" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\lib\ReferenceAppLayer_d.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="ode_d" />
+					<Add library="OgreMain_d" />
+					<Add directory="..\..\..\Dependencies\lib\Debug" />
+				</Linker>
+				<ExtraCommands>
+					<Add after='cmd /c copy &quot;$($(TARGET_NAME)_OUTPUT_FILE)&quot; &quot;..\..\..\Samples\Common\bin\$(TARGET_NAME)&quot;' />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\lib\ReferenceAppLayer.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="ode" />
+					<Add library="OgreMain" />
+					<Add directory="..\..\..\Dependencies\lib\Release" />
+				</Linker>
+				<ExtraCommands>
+					<Add after='cmd /c copy &quot;$($(TARGET_NAME)_OUTPUT_FILE)&quot; &quot;..\..\..\Samples\Common\bin\$(TARGET_NAME)&quot;' />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add option="-D_USRDLL" />
+			<Add option="-DREFERENCEAPPLAYER_EXPORTS" />
+			<Add directory="..\..\..\Dependencies\include\ode" />
+			<Add directory="..\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\..\..\Dependencies\include\ode\collision.h" />
+		<Unit filename="..\..\..\Dependencies\include\ode\common.h" />
+		<Unit filename="..\..\..\Dependencies\include\ode\contact.h" />
+		<Unit filename="..\..\..\Dependencies\include\ode\error.h" />
+		<Unit filename="..\..\..\Dependencies\include\ode\geom.h" />
+		<Unit filename="..\..\..\Dependencies\include\ode\mass.h" />
+		<Unit filename="..\..\..\Dependencies\include\ode\matrix.h" />
+		<Unit filename="..\..\..\Dependencies\include\ode\memory.h" />
+		<Unit filename="..\..\..\Dependencies\include\ode\misc.h" />
+		<Unit filename="..\..\..\Dependencies\include\ode\objects.h" />
+		<Unit filename="..\..\..\Dependencies\include\ode\ode.h" />
+		<Unit filename="..\..\..\Dependencies\include\ode\odecpp.h" />
+		<Unit filename="..\..\..\Dependencies\include\ode\odecpp_collision.h" />
+		<Unit filename="..\..\..\Dependencies\include\ode\odemath.h" />
+		<Unit filename="..\..\..\Dependencies\include\ode\rotation.h" />
+		<Unit filename="..\include\OgreRefAppApplicationObject.h" />
+		<Unit filename="..\include\OgreRefAppBall.h" />
+		<Unit filename="..\include\OgreRefAppBox.h" />
+		<Unit filename="..\include\OgreRefAppCollideCamera.h" />
+		<Unit filename="..\include\OgreRefAppJoint.h" />
+		<Unit filename="..\include\OgreRefAppJointSubtypes.h" />
+		<Unit filename="..\include\OgreRefAppOgreHead.h" />
+		<Unit filename="..\include\OgreRefAppPlane.h" />
+		<Unit filename="..\include\OgreRefAppPrerequisites.h" />
+		<Unit filename="..\include\OgreRefAppWorld.h" />
+		<Unit filename="..\include\OgreReferenceAppLayer.h" />
+		<Unit filename="..\src\OgreRefAppApplicationObject.cpp" />
+		<Unit filename="..\src\OgreRefAppBall.cpp" />
+		<Unit filename="..\src\OgreRefAppBox.cpp" />
+		<Unit filename="..\src\OgreRefAppCollideCamera.cpp" />
+		<Unit filename="..\src\OgreRefAppJoint.cpp" />
+		<Unit filename="..\src\OgreRefAppJointSubtypes.cpp" />
+		<Unit filename="..\src\OgreRefAppOgreHead.cpp" />
+		<Unit filename="..\src\OgreRefAppPlane.cpp" />
+		<Unit filename="..\src\OgreRefAppWorld.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /ReferenceApplication/ReferenceAppLayer/scripts/ReferenceAppLayer.vcproj
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/scripts/ReferenceAppLayer.vcproj	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/scripts/ReferenceAppLayer.vcproj	(revision 5)
@@ -0,0 +1,268 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="ReferenceAppLayer"
+	ProjectGUID="{6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;REFERENCEAPPLAYER_EXPORTS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="2"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain_d.lib ode.lib"
+				OutputFile="$(OutDir)/$(ProjectName)_d.dll"
+				Version="0.99"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName)_d.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;REFERENCEAPPLAYER_EXPORTS"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain.lib ode.lib"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\OgreRefAppApplicationObject.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRefAppBall.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRefAppBox.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRefAppCollideCamera.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRefAppJoint.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRefAppJointSubtypes.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRefAppOgreHead.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRefAppPlane.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreRefAppWorld.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\OgreRefAppApplicationObject.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppBall.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppBox.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppCollideCamera.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppJoint.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppJointSubtypes.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppOgreHead.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppPlane.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppPrerequisites.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppWorld.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreReferenceAppLayer.h">
+			</File>
+			<Filter
+				Name="ODE"
+				Filter="">
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\collision.h">
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\common.h">
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\contact.h">
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\error.h">
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\geom.h">
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\mass.h">
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\matrix.h">
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\memory.h">
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\misc.h">
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\objects.h">
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\ode.h">
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\odecpp.h">
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\odecpp_collision.h">
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\odemath.h">
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\rotation.h">
+				</File>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /ReferenceApplication/ReferenceAppLayer/scripts/ReferenceAppLayer_stlp.cbp
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/scripts/ReferenceAppLayer_stlp.cbp	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/scripts/ReferenceAppLayer_stlp.cbp	(revision 5)
@@ -0,0 +1,309 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="ReferenceAppLayer" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\lib\ReferenceAppLayer_d.dll" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ode" />
+					<Add library="OPCODE" />
+					<Add library="stlportstlg.5.1" />
+					<Add directory="..\..\..\Dependencies\lib\Debug" />
+				</Linker>
+				<ExtraCommands>
+					<Add after='cmd /c copy &quot;$($(TARGET_NAME)_OUTPUT_FILE)&quot; &quot;..\..\..\Samples\Common\bin\$(TARGET_NAME)&quot;' />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\lib\ReferenceAppLayer.dll" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ode" />
+					<Add library="OPCODE" />
+					<Add library="stlport.5.1" />
+					<Add directory="..\..\..\Dependencies\lib\Release" />
+				</Linker>
+				<ExtraCommands>
+					<Add after='cmd /c copy &quot;$($(TARGET_NAME)_OUTPUT_FILE)&quot; &quot;..\..\..\Samples\Common\bin\$(TARGET_NAME)&quot;' />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add option="-D_USRDLL" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\..\..\Dependencies\include\ode" />
+			<Add directory="..\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\..\..\Dependencies\include\ode\collision.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\..\Dependencies\include\ode\common.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\..\Dependencies\include\ode\contact.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\..\Dependencies\include\ode\error.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\..\Dependencies\include\ode\geom.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\..\Dependencies\include\ode\mass.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\..\Dependencies\include\ode\matrix.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\..\Dependencies\include\ode\memory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\..\Dependencies\include\ode\misc.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\..\Dependencies\include\ode\objects.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\..\Dependencies\include\ode\ode.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\..\Dependencies\include\ode\odecpp.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\..\Dependencies\include\ode\odecpp_collision.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\..\Dependencies\include\ode\odemath.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\..\Dependencies\include\ode\rotation.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRefAppApplicationObject.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRefAppBall.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRefAppBox.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRefAppCollideCamera.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRefAppJoint.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRefAppJointSubtypes.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRefAppOgreHead.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRefAppPlane.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRefAppPrerequisites.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreRefAppWorld.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreReferenceAppLayer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRefAppApplicationObject.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRefAppBall.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRefAppBox.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRefAppCollideCamera.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRefAppJoint.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRefAppJointSubtypes.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRefAppOgreHead.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRefAppPlane.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreRefAppWorld.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /ReferenceApplication/ReferenceAppLayer/scripts/ReferenceAppLayer_vc8.vcproj
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/scripts/ReferenceAppLayer_vc8.vcproj	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/scripts/ReferenceAppLayer_vc8.vcproj	(revision 5)
@@ -0,0 +1,370 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="ReferenceAppLayer"
+	ProjectGUID="{6FDA6A78-A473-4FEB-86A5-96D1CC65D5B9}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;REFERENCEAPPLAYER_EXPORTS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain_d.lib ode.lib"
+				OutputFile="$(OutDir)/ReferenceAppLayer_d.dll"
+				Version=""
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName)_d.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/ReferenceAppLayer_d.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				EnableFiberSafeOptimizations="true"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;REFERENCEAPPLAYER_EXPORTS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain.lib ode.lib"
+				OutputFile="$(OutDir)/ReferenceAppLayer.dll"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/ReferenceAppLayer.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\OgreRefAppApplicationObject.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRefAppBall.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRefAppBox.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRefAppCollideCamera.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRefAppJoint.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRefAppJointSubtypes.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRefAppOgreHead.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRefAppPlane.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreRefAppWorld.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\OgreRefAppApplicationObject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppBall.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppBox.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppCollideCamera.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppJoint.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppJointSubtypes.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppOgreHead.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppPlane.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppPrerequisites.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreRefAppWorld.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreReferenceAppLayer.h"
+				>
+			</File>
+			<Filter
+				Name="ODE"
+				>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\collision.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\common.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\contact.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\error.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\geom.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\mass.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\matrix.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\memory.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\misc.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\objects.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\ode.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\odecpp.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\odecpp_collision.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\odemath.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\Dependencies\include\ode\rotation.h"
+					>
+				</File>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /ReferenceApplication/ReferenceAppLayer/src/Makefile.am
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/src/Makefile.am	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/src/Makefile.am	(revision 5)
@@ -0,0 +1,15 @@
+INCLUDES = -I../../../OgreMain/include 
+
+lib_LTLIBRARIES=libOgreReferenceAppLayer.la
+
+libOgreReferenceAppLayer_la_SOURCES = OgreRefAppApplicationObject.cpp \
+			OgreRefAppBall.cpp \
+			OgreRefAppBox.cpp \
+			OgreRefAppOgreHead.cpp \
+			OgreRefAppJoint.cpp \
+			OgreRefAppJointSubtypes.cpp \
+			OgreRefAppPlane.cpp \
+			OgreRefAppCollideCamera.cpp \
+			OgreRefAppWorld.cpp
+
+libOgreReferenceAppLayer_la_LIBADD= -lOgreMain -lode
Index: /ReferenceApplication/ReferenceAppLayer/src/Makefile.in
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/src/Makefile.in	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/src/Makefile.in	(revision 5)
@@ -0,0 +1,486 @@
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+SOURCES = $(libOgreReferenceAppLayer_la_SOURCES)
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = ReferenceAppLayer/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/ReferenceAppLayer/include/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libdir)"
+libLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(lib_LTLIBRARIES)
+libOgreReferenceAppLayer_la_DEPENDENCIES =
+am_libOgreReferenceAppLayer_la_OBJECTS =  \
+	OgreRefAppApplicationObject.lo OgreRefAppBall.lo \
+	OgreRefAppBox.lo OgreRefAppOgreHead.lo OgreRefAppJoint.lo \
+	OgreRefAppJointSubtypes.lo OgreRefAppPlane.lo \
+	OgreRefAppCollideCamera.lo OgreRefAppWorld.lo
+libOgreReferenceAppLayer_la_OBJECTS =  \
+	$(am_libOgreReferenceAppLayer_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/ReferenceAppLayer/include
+depcomp = $(SHELL) $(top_srcdir)/../depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libOgreReferenceAppLayer_la_SOURCES)
+DIST_SOURCES = $(libOgreReferenceAppLayer_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_LIBS = @OGRE_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = -I../../../OgreMain/include 
+lib_LTLIBRARIES = libOgreReferenceAppLayer.la
+libOgreReferenceAppLayer_la_SOURCES = OgreRefAppApplicationObject.cpp \
+			OgreRefAppBall.cpp \
+			OgreRefAppBox.cpp \
+			OgreRefAppOgreHead.cpp \
+			OgreRefAppJoint.cpp \
+			OgreRefAppJointSubtypes.cpp \
+			OgreRefAppPlane.cpp \
+			OgreRefAppCollideCamera.cpp \
+			OgreRefAppWorld.cpp
+
+libOgreReferenceAppLayer_la_LIBADD = -lOgreMain -lode
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  ReferenceAppLayer/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  ReferenceAppLayer/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    f=$(am__strip_dir) \
+	    echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+	    $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  p=$(am__strip_dir) \
+	  echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+	  $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+	done
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libOgreReferenceAppLayer.la: $(libOgreReferenceAppLayer_la_OBJECTS) $(libOgreReferenceAppLayer_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(libdir) $(libOgreReferenceAppLayer_la_LDFLAGS) $(libOgreReferenceAppLayer_la_OBJECTS) $(libOgreReferenceAppLayer_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRefAppApplicationObject.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRefAppBall.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRefAppBox.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRefAppCollideCamera.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRefAppJoint.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRefAppJointSubtypes.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRefAppOgreHead.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRefAppPlane.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreRefAppWorld.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`; \
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$$depbase.Tpo" "$$depbase.Po"; else rm -f "$$depbase.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`; \
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$$depbase.Tpo" "$$depbase.Po"; else rm -f "$$depbase.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`; \
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$$depbase.Tpo" "$$depbase.Plo"; else rm -f "$$depbase.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(libdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-libLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libLTLIBRARIES clean-libtool ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am \
+	install-libLTLIBRARIES install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-libLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppApplicationObject.cpp
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppApplicationObject.cpp	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppApplicationObject.cpp	(revision 5)
@@ -0,0 +1,767 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreRefAppApplicationObject.h"
+#include "OgreRefAppWorld.h"
+#include "ode/collision.h"
+#include "OgreControllerManager.h"
+#include "OgreStringConverter.h"
+#include "OgreRoot.h"
+
+namespace OgreRefApp
+{
+    //-------------------------------------------------------------------------
+    ApplicationObject::ApplicationObject(const String& name)
+    {
+        mSceneNode = 0;
+        mEntity = 0;
+        mOdeBody = 0;
+        mDynamicsEnabled = false;
+        mReenableIfInteractedWith = false;
+        mCollisionEnabled = true;
+		mSoftness = 0.0;
+		mBounceCoeffRestitution = 0;
+		mBounceVelocityThreshold = 0.1;
+        setFriction(Math::POS_INFINITY);
+        dMassSetZero(&mMass);
+
+        mDisableTimeEnd = 0;
+        mDisableTime = 3000.0f; // millisenconds
+        mAngularVelDisableThreshold = 1.0f;
+        mLinearVelDisableThreshold = 1.0f;
+
+
+
+    }
+    //-------------------------------------------------------------------------
+    ApplicationObject::~ApplicationObject()
+    {
+        SceneManager* sm = World::getSingleton().getSceneManager();
+        if (mSceneNode)
+        {
+            sm->destroySceneNode(mSceneNode->getName());
+            mSceneNode = 0;
+        }
+
+        // TODO destroy entity
+
+        // Destroy mass
+        if (mOdeBody)
+        {
+            delete mOdeBody;
+            mOdeBody = 0;
+        }
+
+        // Destroy collision proxies
+        CollisionProxyList::iterator i, iend;
+        iend = mCollisionProxies.end();
+        for (i = mCollisionProxies.begin(); i != iend; ++i)
+        {
+            delete (*i);
+        }
+
+
+
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::setPosition(const Vector3& vec)
+    {
+        setPosition(vec.x, vec.y, vec.z);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::setPosition(Real x, Real y, Real z)
+    {
+        mSceneNode->setPosition(x, y, z);
+        if (isDynamicsEnabled() && mOdeBody)
+            mOdeBody->setPosition(x, y, z);
+        updateCollisionProxies();
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::setOrientation(const Quaternion& orientation)
+    {
+        mSceneNode->setOrientation(orientation);
+        if (isDynamicsEnabled() && mOdeBody)
+        {
+            dReal dquat[4] = {orientation.w, orientation.x, orientation.y, orientation.z };
+            mOdeBody->setQuaternion(dquat);
+        }
+        updateCollisionProxies();
+    }
+    //-------------------------------------------------------------------------
+    const Vector3& ApplicationObject::getPosition(void)
+    {
+        return mSceneNode->getPosition();
+    }
+    //-------------------------------------------------------------------------
+    const Quaternion& ApplicationObject::getOrientation(void)
+    {
+        return mSceneNode->getOrientation();
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::setDynamicsDisableThreshold(Real linearSq, 
+        Real angularSq, Real overTime)
+    {
+        mLinearVelDisableThreshold = linearSq;
+        mAngularVelDisableThreshold = angularSq;
+        mDisableTime = overTime * 1000;
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::_updateFromDynamics()
+    {
+        if (!mOdeBody)
+        {
+            return;
+        }
+        // Update dynamics enabled flag from dynamics (may have been reenabled)
+        if (mReenableIfInteractedWith)
+        {
+            mDynamicsEnabled = mOdeBody->isEnabled() == 0 ? false : true;
+        }
+
+        if (mDynamicsEnabled)
+        {
+            // Get position & rotation from ODE
+            const dReal* pos = mOdeBody->getPosition();
+            const dReal* quat = mOdeBody->getQuaternion();
+
+            mSceneNode->setPosition((Real)pos[0], (Real)pos[1], (Real)pos[2]);
+            mSceneNode->setOrientation((Real)quat[0], (Real)quat[1], 
+                (Real)quat[2], (Real)quat[3]);
+
+            updateCollisionProxies();
+
+            // Check to see if object has stabilised, if so turn off dynamics
+            // to save processor time
+            // NB will be reenabled if interacted with
+            
+            if (this->getLinearVelocity().squaredLength() <= mLinearVelDisableThreshold
+                && this->getAngularVelocity().squaredLength() <= mAngularVelDisableThreshold)
+            {
+                if (mDisableTimeEnd > 0.0f)
+                {
+                    // We're counting, check disable time
+                    if (Root::getSingleton().getTimer()->getMilliseconds() > mDisableTimeEnd)
+                    {
+                        this->setDynamicsEnabled(false, true);
+                        //LogManager::getSingleton().logMessage(mEntity->getName() + " disabled");
+                        mDisableTimeEnd = 0.0f;
+                    }
+
+                }
+                else 
+                {
+                    // We're not counting down yet, so start the count
+                    // NB is mDisableTime = 0 we never disable
+                    if (mDisableTime > 0)
+                    {
+                        mDisableTimeEnd = Root::getSingleton().getTimer()->getMilliseconds() + mDisableTime;
+                        //LogManager::getSingleton().logMessage("Starting countdown...");
+                    }
+                }
+            }
+            else
+            {
+                // We're still moving
+                mDisableTimeEnd = 0.0f;
+            }
+
+        }
+    }
+    //-------------------------------------------------------------------------
+    bool ApplicationObject::isCollisionEnabled(void)
+    {
+        return mCollisionEnabled;
+    }
+    //-------------------------------------------------------------------------
+    bool ApplicationObject::isDynamicsEnabled(void)
+    {
+        return (mDynamicsEnabled || mReenableIfInteractedWith);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::setCollisionEnabled(bool enabled)
+    {
+        mCollisionEnabled = enabled;
+        setEntityQueryFlags();
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::setDynamicsEnabled(bool enabled, bool reEnableOnInteraction)
+    {
+        
+        mDynamicsEnabled = enabled;
+        mReenableIfInteractedWith = reEnableOnInteraction;
+
+        // World must keep an eye on enabled or potentially reenabled objects
+        World::getSingleton()._notifyDynamicsStateForObject(this, 
+            mDynamicsEnabled || mReenableIfInteractedWith);
+        
+        if (mDynamicsEnabled)
+        {
+            // Ensure body is synced
+            mOdeBody->enable();
+        }
+        else if (mOdeBody)
+        {
+            mOdeBody->disable();
+        }
+        // Set properties
+        if (mDynamicsEnabled || mReenableIfInteractedWith)
+        {
+            const Vector3& pos = getPosition();
+            mOdeBody->setPosition(pos.x, pos.y, pos.z);
+            const Quaternion& q = getOrientation();
+            dReal dquat[4] = {q.w, q.x, q.y, q.z };
+            mOdeBody->setQuaternion(dquat);
+        }
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::addForce(const Vector3& direction, const Vector3& atPosition)
+    {
+        addForce(direction.x, direction.y, direction.z, 
+            atPosition.x, atPosition.y, atPosition.z);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::addForce(Real dir_x, Real dir_y, Real dir_z, 
+        Real pos_x, Real pos_y, Real pos_z)
+    {
+        assert (mOdeBody && "No dynamics body set up for this object");
+        mOdeBody->addRelForceAtRelPos(dir_x, dir_y, dir_z, 
+            pos_x, pos_y, pos_z);
+
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::addForceWorldSpace(const Vector3& direction, const Vector3& atPosition)
+    {
+        addForceWorldSpace(direction.x, direction.y, direction.z, 
+            atPosition.x, atPosition.y, atPosition.z);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::addForceWorldSpace(Real dir_x, Real dir_y, Real dir_z, 
+        Real pos_x, Real pos_y, Real pos_z)
+    {
+        assert (mOdeBody && "No dynamics body set up for this object");
+        mOdeBody->addForceAtPos(dir_x, dir_y, dir_z, 
+            pos_x, pos_y, pos_z);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::addTorque(const Vector3& direction)
+    {
+        addTorque(direction.x, direction.y, direction.z);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::addTorque(Real x, Real y, Real z)
+    {
+        assert (mOdeBody && "No dynamics body set up for this object");
+        mOdeBody->addRelTorque(x, y, z);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::addTorqueWorldSpace(const Vector3& direction)
+    {
+        addTorqueWorldSpace(direction.x, direction.y, direction.z);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::addTorqueWorldSpace(Real x, Real y, Real z)
+    {
+        assert (mOdeBody && "No dynamics body set up for this object");
+        mOdeBody->addTorque(x, y, z);
+    }
+    //-------------------------------------------------------------------------
+    SceneNode* ApplicationObject::getSceneNode(void)
+    {
+        return mSceneNode;
+    }
+    //-------------------------------------------------------------------------
+    Entity* ApplicationObject::getEntity(void)
+    {
+        return mEntity;
+    }
+    //-------------------------------------------------------------------------
+    dBody* ApplicationObject::getOdeBody(void)
+    {
+        if (isDynamicsEnabled())
+        {
+            return mOdeBody;
+        }
+        else
+        {
+            // dynamics are disabled
+            return 0;
+        }
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::updateCollisionProxies(void)
+    {
+        CollisionProxyList::iterator i, iend;
+        iend = mCollisionProxies.end();
+        for (i = mCollisionProxies.begin(); i != iend; ++i)
+        {
+            // set from node
+            const Vector3& pos = mSceneNode->getPosition();
+            dGeom* pProxy = *i;
+            pProxy->setPosition(pos.x, pos.y, pos.z);
+            const Quaternion& orientation = mSceneNode->getOrientation();
+            // Hmm, no setQuaternion on proxy
+            // Do a conversion
+            dReal dquat[4] = {orientation.w, orientation.x, orientation.y, orientation.z };
+            dMatrix3 dm3;
+            memset(dm3, 0, sizeof(dMatrix3));
+            dQtoR(dquat, dm3);
+            pProxy->setRotation(dm3); 
+            
+        }
+
+    }
+    //-------------------------------------------------------------------------
+    bool ApplicationObject::testCollide(ApplicationObject* otherObj)
+    {
+        bool collided = false;
+        dContactGeom contactGeom;
+        dGeom *o1, *o2;
+        CollisionProxyList::const_iterator proxy1, proxy2, proxy1end, proxy2end;
+        proxy1end = mCollisionProxies.end();
+        proxy2end = otherObj->mCollisionProxies.end();
+
+        CollisionInfo collInfo;
+
+        for (proxy1 = mCollisionProxies.begin(); proxy1 != proxy1end; ++proxy1)
+        {
+            for (proxy2 = otherObj->mCollisionProxies.begin(); proxy2 != proxy2end; ++proxy2)
+            {
+                o1 = *proxy1;
+                o2 = *proxy2;
+                int numc = dCollide(o1->id(), o2->id(), 0, &contactGeom, sizeof(dContactGeom));
+                if (numc)
+                {
+                    // Create contact joints if either object is dynamics simulated
+                    // If one is not, then sim will not affect it anyway, it will be fixed
+                    // However if one is enabled, we need the contact joint
+                    if (this->isDynamicsEnabled() || otherObj->isDynamicsEnabled())
+                    {
+						// We use the most agressive parameters from both objects for the contact
+                        dContact contact;
+						Real bounce, velThresh, softness;
+						// Use the highest coeff of restitution from both objects
+						bounce = std::max(this->getBounceRestitutionValue(), 
+								otherObj->getBounceRestitutionValue());
+						// Use the lowest velocity threshold from both objects
+						velThresh = std::min(this->getBounceVelocityThreshold(),
+								otherObj->getBounceVelocityThreshold());
+						// Set flags
+						contact.surface.mode = dContactBounce | dContactApprox1;
+						contact.surface.bounce = bounce;
+						contact.surface.bounce_vel = velThresh;
+
+						softness = this->getSoftness() + otherObj->getSoftness();
+						if (softness > 0)
+						{
+                        	contact.surface.mode |= dContactSoftCFM;
+							contact.surface.soft_cfm = softness;
+						}
+						
+                        // Set friction to min of 2 objects
+                        // Note that ODE dInfinity == Math::POS_INFINITY
+                        contact.surface.mu = std::min(this->getFriction(), otherObj->getFriction());
+                        contact.surface.mu2 = 0;
+                        contact.geom = contactGeom;
+                        dContactJoint contactJoint(
+                            World::getSingleton().getOdeWorld()->id(), 
+                            World::getSingleton().getOdeContactJointGroup()->id(), 
+                            &contact);
+
+                        // Get ODE bodies
+                        // May be null, if so use 0 (immovable) body ids
+                        dBody *b1, *b2;
+                        dBodyID bid1, bid2;
+                        bid1 = bid2 = 0;
+                        b1 = this->getOdeBody();
+                        b2 = otherObj->getOdeBody();
+                        if (b1) bid1 = b1->id();
+                        if (b2) bid2 = b2->id();
+                        contactJoint.attach(bid1, bid2);
+                    }
+
+                    // Tell both objects about the collision
+                    collInfo.position.x = contactGeom.pos[0];
+                    collInfo.position.y = contactGeom.pos[1];
+                    collInfo.position.z = contactGeom.pos[2];
+                    collInfo.normal.x = contactGeom.normal[0];
+                    collInfo.normal.y = contactGeom.normal[1];
+                    collInfo.normal.z = contactGeom.normal[2];
+                    collInfo.penetrationDepth = contactGeom.depth;
+                    this->_notifyCollided(otherObj, collInfo);
+                    otherObj->_notifyCollided(this, collInfo);
+
+
+                    // set return 
+                    collided = true;
+                }
+            }
+        }
+        return collided;
+
+    }
+    //-------------------------------------------------------------------------
+    bool ApplicationObject::testCollide(SceneQuery::WorldFragment* wf)
+    {
+        switch (wf->fragmentType)
+        {
+        case SceneQuery::WFT_NONE:
+            return false;
+        case SceneQuery::WFT_PLANE_BOUNDED_REGION:
+            return testCollidePlaneBounds(wf);
+        default:
+            break;
+        };
+
+        // not handled
+        return false;
+    }
+    //-------------------------------------------------------------------------
+    bool ApplicationObject::testCollidePlaneBounds(SceneQuery::WorldFragment* wf)
+    {
+        bool collided = false;
+        dContactGeom contactGeom;
+        dGeom *obj;
+        CollisionProxyList::const_iterator proxy, proxyend;
+        proxyend = mCollisionProxies.end();
+
+        std::list<Plane>::const_iterator pi, piend;
+        piend = wf->planes->end();
+
+        CollisionInfo collInfo;
+
+        for (proxy = mCollisionProxies.begin(); proxy != proxyend; ++proxy)
+        {
+            // Hack, simply collide against planes which is facing towards center
+            // We can't do this properly without mesh collision
+            obj = *proxy;
+            Real maxdist = -1.0f;
+            const Plane* bestPlane = 0;
+            for (pi = wf->planes->begin(); pi != piend; ++pi)
+            {
+                const Plane *boundPlane = &(*pi);
+                Real dist = boundPlane->getDistance(this->getPosition());
+                if (dist >= 0.0f)
+                {
+                    dPlane odePlane(0, boundPlane->normal.x, boundPlane->normal.y, boundPlane->normal.z, 
+                        -boundPlane->d);
+
+                    int numc = dCollide(obj->id(), odePlane.id() , 0, &contactGeom, sizeof(dContactGeom));
+                    if (numc)
+                    {
+                        // Create contact joints if object is dynamics simulated
+                        if (this->isDynamicsEnabled())
+                        {
+                            // TODO: combine object parameters with WorldFragment physical properties
+                            dContact contact;
+					        // Set flags
+					        contact.surface.mode = dContactBounce | dContactApprox1;
+					        contact.surface.bounce = this->getBounceRestitutionValue();
+					        contact.surface.bounce_vel = this->getBounceVelocityThreshold();
+					        Real softness = this->getSoftness();
+					        if (softness > 0)
+					        {
+                                contact.surface.mode |= dContactSoftCFM;
+						        contact.surface.soft_cfm = softness;
+					        }
+            				
+                            // Set friction 
+                            contact.surface.mu = this->getFriction();
+                            contact.surface.mu2 = 0;
+                            contact.geom = contactGeom;
+                            dContactJoint contactJoint(
+                                World::getSingleton().getOdeWorld()->id(), 
+                                World::getSingleton().getOdeContactJointGroup()->id(), 
+                                &contact);
+
+                            // Get ODE body,world fragment body is 0 clearly (immovable)
+                            dBody* body = this->getOdeBody();
+                            dBodyID bid;
+                            bid = 0;
+                            if (body) bid = body->id();
+                            contactJoint.attach(bid, 0);
+                        }
+
+                        // Tell object about the collision
+                        collInfo.position.x = contactGeom.pos[0];
+                        collInfo.position.y = contactGeom.pos[1];
+                        collInfo.position.z = contactGeom.pos[2];
+                        collInfo.normal.x = contactGeom.normal[0];
+                        collInfo.normal.y = contactGeom.normal[1];
+                        collInfo.normal.z = contactGeom.normal[2];
+
+                        // NB clamp the depth to compensate for crazy results
+                        collInfo.penetrationDepth = contactGeom.depth;
+                        //collInfo.penetrationDepth = std::max(collInfo.penetrationDepth,
+                        //    this->getLinearVelocity().length());
+                        this->_notifyCollided(wf, collInfo);
+
+
+                        // set return 
+                        collided = true;
+                    }
+                }
+            } 
+            
+        }
+        return collided;
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::_notifyCollided(ApplicationObject* otherObj, 
+        const ApplicationObject::CollisionInfo& info)
+    {
+        // NB contacts for physics are not created here but in testCollide
+        // Application subclasses should do their own respose here if required
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::_notifyCollided(SceneQuery::WorldFragment* wf, 
+        const CollisionInfo& info)
+    {
+        // NB contacts for physics are not created here but in testCollide
+        // Application subclasses should do their own respose here if required
+    }
+    //-------------------------------------------------------------------------
+	void ApplicationObject::setBounceParameters(Real restitutionValue, 
+			Real velocityThreshold)
+	{
+		mBounceCoeffRestitution = restitutionValue;
+		mBounceVelocityThreshold = velocityThreshold;
+	}
+    //-------------------------------------------------------------------------
+	Real ApplicationObject::getBounceRestitutionValue(void)
+	{
+		return mBounceCoeffRestitution;
+	}
+    //-------------------------------------------------------------------------
+	Real ApplicationObject::getBounceVelocityThreshold(void)
+	{
+		return mBounceVelocityThreshold;
+	}
+    //-------------------------------------------------------------------------
+	void ApplicationObject::setSoftness(Real softness)
+	{
+		mSoftness = softness;
+	}
+    //-------------------------------------------------------------------------
+	Real ApplicationObject::getSoftness(void)
+	{
+		return mSoftness;
+	}
+    //-------------------------------------------------------------------------
+    void ApplicationObject::setFriction(Real friction)
+    {
+        if (friction == Math::POS_INFINITY)
+        {
+            mFriction = dInfinity;
+        }
+        else
+        {
+            mFriction = friction;
+        }
+    }
+    //-------------------------------------------------------------------------
+    Real ApplicationObject::getFriction(void)
+    {
+        return mFriction;
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::setMassSphere(Real density, Real radius)
+    {
+        dMassSetSphere(&mMass, density, radius);
+        mOdeBody->setMass(&mMass);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::setMassBox(Real density, const Vector3& dimensions, 
+        const Quaternion& orientation)
+    {
+        dMassSetBox(&mMass, density, dimensions.x, dimensions.y, dimensions.z);
+
+        Matrix3 m3;
+        orientation.ToRotationMatrix(m3);
+        dMatrix3 dm3;
+        OgreToOde(m3, dm3);
+        dMassRotate(&mMass, dm3);
+
+        mOdeBody->setMass(&mMass);
+
+
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::setMassCappedCylinder(Real density, Real length, Real width, 
+        const Quaternion& orientation)
+    {
+        dMassSetCappedCylinder(&mMass, density, 3, width, length);
+
+        Matrix3 m3;
+        orientation.ToRotationMatrix(m3);
+        dMatrix3 dm3;
+        OgreToOde(m3, dm3);
+        dMassRotate(&mMass, dm3);
+
+        mOdeBody->setMass(&mMass);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::setMassExpert(Real mass, const Vector3 center, const Matrix3 inertia)
+    {
+
+        mMass.mass = mass;
+        mMass.c[0] = center.x;
+        mMass.c[1] = center.y;
+        mMass.c[2] = center.z;
+        OgreToOde(inertia, mMass.I);
+        
+        mOdeBody->setMass(&mMass);
+
+    }
+    //-------------------------------------------------------------------------
+    const dMass* ApplicationObject::getOdeMass(void)
+    {
+        return &mMass;
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::setLinearVelocity(const Vector3& vel)
+    {
+        setLinearVelocity(vel.x, vel.y, vel.z);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::setLinearVelocity(Real x, Real y, Real z)
+    {
+        assert(mOdeBody && isDynamicsEnabled() &&
+            "Cannot set velocity on an object unless dynamics are enabled and"
+            " an ODE body exists");
+        mOdeBody->setLinearVel(x, y, z);
+        // Reenable if on trigger
+        setDynamicsEnabled(true, true);
+    }
+    //-------------------------------------------------------------------------
+    const Vector3& ApplicationObject::getLinearVelocity(void)
+    {
+        assert(mOdeBody && isDynamicsEnabled() &&
+            "Cannot get velocity on an object unless dynamics are enabled and"
+            " an ODE body exists");
+        static Vector3 vel;
+        const dReal* odeVel = mOdeBody->getLinearVel();
+        vel.x = odeVel[0];
+        vel.y = odeVel[1];
+        vel.z = odeVel[2];
+        return vel;
+        
+    }
+    //-------------------------------------------------------------------------
+    const Vector3& ApplicationObject::getAngularVelocity(void)
+    {
+        assert(mOdeBody && isDynamicsEnabled() &&
+            "Cannot get velocity on an object unless dynamics are enabled and"
+            " an ODE body exists");
+        static Vector3 vel;
+        const dReal* odeVel = mOdeBody->getAngularVel();
+        vel.x = odeVel[0];
+        vel.y = odeVel[1];
+        vel.z = odeVel[2];
+        return vel;
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::setAngularVelocity(const Vector3& vel)
+    {
+        setAngularVelocity(vel.x, vel.y, vel.z);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::setAngularVelocity(Real x, Real y, Real z)
+    {
+        assert(mOdeBody && isDynamicsEnabled() &&
+            "Cannot set velocity on an object unless dynamics are enabled and"
+            " an ODE body exists");
+        mOdeBody->setAngularVel(x, y, z);
+        // Reenable if on trigger
+        setDynamicsEnabled(true, true);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::translate(const Vector3& d)
+    {
+        // Adjust position by rotation
+        Vector3 newTrans = mSceneNode->getOrientation() * d;
+        translateWorldSpace(newTrans);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::translate(Real x, Real y, Real z)
+    {
+        translate(Vector3(x, y, z));
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::translateWorldSpace(const Vector3& d)
+    {
+        setPosition(getPosition() + d);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::translateWorldSpace(Real x, Real y, Real z)
+    {
+        translateWorldSpace(Vector3(x, y, z));
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::roll(const Radian& angle)
+    {
+        rotate(Vector3::UNIT_Z, angle);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::pitch(const Radian& angle)
+    {
+        rotate(Vector3::UNIT_X, angle);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::yaw(const Radian& angle)
+    {
+        rotate(Vector3::UNIT_Y, angle);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::rotate(const Vector3& axis, const Radian& angle)
+    {
+        Quaternion q;
+        q.FromAngleAxis(angle,axis);
+        rotate(q);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::rotate(const Quaternion& q)
+    {
+        setOrientation(getOrientation() * q);
+    }
+    //-------------------------------------------------------------------------
+    void ApplicationObject::setEntityQueryFlags(void)
+    {
+        // Real basic query mask usage for now
+        // collision enabled = 0xFFFFFFFF
+        // collision disabled = 0x0
+        if (mEntity)
+        {
+            mEntity->setQueryFlags( mCollisionEnabled ? 0xFFFFFFFF : 0 );
+        }
+    }
+
+
+
+}
+
Index: /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppBall.cpp
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppBall.cpp	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppBall.cpp	(revision 5)
@@ -0,0 +1,81 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreRefAppBall.h"
+#include "OgreRefAppWorld.h"
+
+namespace OgreRefApp
+{
+
+    //-------------------------------------------------------------------------
+    Ball::Ball(const String& name, Real radius) : ApplicationObject(name)
+    {
+        mRadius = radius;
+        setUp(name);
+    }
+    //-------------------------------------------------------------------------
+    Ball::~Ball()
+    {
+
+    }
+    //-------------------------------------------------------------------------
+    void Ball::setUp(const String& name)
+    {
+        // Create visual presence
+        SceneManager* sm = World::getSingleton().getSceneManager();
+        mEntity = sm->createEntity(name, "sphere.mesh");
+        mSceneNode = sm->getRootSceneNode()->createChildSceneNode(name);
+        // Scale down, default size is 100
+        Real scale = mRadius / 100.0f;
+        mSceneNode->scale(scale, scale, scale);
+
+        mSceneNode->attachObject(mEntity);
+        // Add reverse reference
+        mEntity->setUserObject(this);
+
+        // Create mass body
+        mOdeBody = new dBody(World::getSingleton().getOdeWorld()->id());
+        // Set reverse reference
+        mOdeBody->setData(this);
+        // Set mass 
+        setMassSphere(0.1, mRadius); // TODO change to more realistic values
+
+        this->setBounceParameters(0.7, 0.1);
+        this->setSoftness(0.0f);
+        this->setFriction(Math::POS_INFINITY);
+
+        // Create collision proxy
+        dSphere* odeSphere = new dSphere(0, mRadius);
+        mCollisionProxies.push_back(odeSphere);
+        updateCollisionProxies();
+
+
+    }
+
+
+}
Index: /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppBox.cpp
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppBox.cpp	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppBox.cpp	(revision 5)
@@ -0,0 +1,83 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreRefAppBox.h"
+#include "OgreRefAppWorld.h"
+
+namespace OgreRefApp
+{
+
+    //-------------------------------------------------------------------------
+    Box::Box(const String& name, Real width, Real height, Real depth) : ApplicationObject(name)
+    {
+        mDimensions.x = width;
+        mDimensions.y = height;
+        mDimensions.z = depth;
+        setUp(name);
+    }
+    //-------------------------------------------------------------------------
+    Box::~Box()
+    {
+
+    }
+    //-------------------------------------------------------------------------
+    void Box::setUp(const String& name)
+    {
+        // Create visual presence
+        SceneManager* sm = World::getSingleton().getSceneManager();
+        mEntity = sm->createEntity(name, "cube.mesh");
+        mSceneNode = sm->getRootSceneNode()->createChildSceneNode(name);
+        // Scale down, default size is 100x100x100
+        mSceneNode->scale(mDimensions.x / 100.f, 
+            mDimensions.y / 100.f, mDimensions.z / 100.f);
+
+        mSceneNode->attachObject(mEntity);
+        // Add reverse reference
+        mEntity->setUserObject(this);
+
+        // Create mass body
+        mOdeBody = new dBody(World::getSingleton().getOdeWorld()->id());
+        // Set reverse reference
+        mOdeBody->setData(this);
+        // Set mass 
+        setMassBox(0.05, mDimensions);
+
+        this->setBounceParameters(0.0, 0.0);
+        this->setSoftness(0.0f);
+        this->setFriction(Math::POS_INFINITY);
+
+        // Create collision proxy
+        dBox* odeBox = new dBox(0, mDimensions.x, mDimensions.y, mDimensions.z);
+        mCollisionProxies.push_back(odeBox);
+        updateCollisionProxies();
+
+
+    }
+
+
+}
Index: /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppCollideCamera.cpp
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppCollideCamera.cpp	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppCollideCamera.cpp	(revision 5)
@@ -0,0 +1,238 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreRefAppCollideCamera.h"
+#include "OgreRefAppWorld.h"
+#include "OgreLogManager.h"
+
+
+namespace OgreRefApp {
+
+    //-----------------------------------------------------------------------
+    CollideCamera::CollideCamera(const String& name): ApplicationObject(name) 
+    {
+        setUp(name);
+        
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::setUp(const String& name)
+    {
+        // Create visual presence
+        SceneManager* sm = World::getSingleton().getSceneManager();
+        mSceneNode = sm->getRootSceneNode()->createChildSceneNode(name);
+
+        mCamera = sm->createCamera(name);
+
+        mSceneNode->attachObject(mCamera);
+        // Add reverse reference (to self!)
+        mCamera->setUserObject(this);
+
+        // No mass body (considered static)
+
+        // Create collision proxy, at near dist
+        // SpaceID is irrelevant, we're doing our own spacial partitioning
+        dSphere* odeSphere = new dSphere(0, mCamera->getNearClipDistance());
+        mCollisionProxies.push_back(odeSphere);
+        updateCollisionProxies();
+
+
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::_notifyCollided(SceneQuery::WorldFragment* wf, const CollisionInfo& info) 
+    {
+        this->translateWorldSpace(info.normal * info.penetrationDepth);
+
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::setOrientation(const Quaternion& orientation)
+    {
+        // Set on camera
+        mCamera->setOrientation(orientation);
+    }
+    //-----------------------------------------------------------------------
+    const Quaternion& CollideCamera::getOrientation(void)
+    {
+        return mCamera->getOrientation();
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::roll(const Radian& angle) 
+    {
+        mCamera->roll(angle);
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::pitch(const Radian& angle) 
+    {
+        mCamera->pitch(angle);
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::yaw(const Radian& angle) 
+    {
+        mCamera->yaw(angle);
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::rotate(const Vector3& axis, const Radian& angle) 
+    {
+        mCamera->rotate(axis, angle);
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::rotate(const Quaternion& q)
+    {
+        mCamera->rotate(q);
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::translate(const Vector3& d)
+    {
+        // Adjust position by rotation
+        Vector3 newTrans = mCamera->getOrientation() * d;
+        translateWorldSpace(newTrans);
+
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::setProjectionType(ProjectionType pt) 
+    {
+        mCamera->setProjectionType(pt);
+    }
+    //-----------------------------------------------------------------------
+    ProjectionType CollideCamera::getProjectionType(void) const 
+    {
+        return mCamera->getProjectionType();
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::setPolygonMode(PolygonMode sd) 
+    {
+        mCamera->setPolygonMode(sd);
+    }
+    //-----------------------------------------------------------------------
+    PolygonMode CollideCamera::getPolygonMode(void) const 
+    {
+        return mCamera->getPolygonMode();
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::setDirection(Real x, Real y, Real z) 
+    {
+        mCamera->setDirection(x, y, z);
+
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::setDirection(const Vector3& vec) 
+    {
+        mCamera->setDirection(vec);
+    }
+    //-----------------------------------------------------------------------
+    Vector3 CollideCamera::getDirection(void) const 
+    {
+        return mCamera->getDirection();
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::lookAt( const Vector3& targetPoint ) 
+    {
+        mCamera->lookAt(targetPoint);
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::lookAt(Real x, Real y, Real z) 
+    {
+        mCamera->lookAt(x, y, z);
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::setFixedYawAxis( bool useFixed, const Vector3& fixedAxis) 
+    {
+        mCamera->setFixedYawAxis(useFixed, fixedAxis);
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::setFOVy(const Radian& fovy)
+    {
+        mCamera->setFOVy(fovy);
+        nearDistChanged();
+    }
+    //-----------------------------------------------------------------------
+    const Radian& CollideCamera::getFOVy(void) const
+    {
+        return mCamera->getFOVy();
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::setNearClipDistance(Real nearDist) 
+    {
+        mCamera->setNearClipDistance(nearDist);
+        nearDistChanged();
+    }
+    //-----------------------------------------------------------------------
+    Real CollideCamera::getNearClipDistance(void) const 
+    {
+        return mCamera->getNearClipDistance();
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::setFarClipDistance(Real farDist) 
+    {
+        mCamera->setFarClipDistance(farDist);
+    }
+    //-----------------------------------------------------------------------
+    Real CollideCamera::getFarClipDistance(void) const 
+    {
+        return mCamera->getFarClipDistance();
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::setAspectRatio(Real ratio) 
+    {
+        mCamera->setAspectRatio(ratio);
+    }
+    //-----------------------------------------------------------------------
+    Real CollideCamera::getAspectRatio(void) const 
+    {
+        return mCamera->getAspectRatio();
+    }
+    //-----------------------------------------------------------------------
+    const Plane& CollideCamera::getFrustumPlane( FrustumPlane plane ) 
+    {
+        return mCamera->getFrustumPlane(plane);
+    }
+    //-----------------------------------------------------------------------
+    bool CollideCamera::isVisible(const AxisAlignedBox& bound, FrustumPlane* culledBy) 
+    {
+        return mCamera->isVisible(bound, culledBy);
+    }
+    //-----------------------------------------------------------------------
+    bool CollideCamera::isVisible(const Sphere& bound, FrustumPlane* culledBy) 
+    {
+        return mCamera->isVisible(bound, culledBy);
+    }
+    //-----------------------------------------------------------------------
+    bool CollideCamera::isVisible(const Vector3& vert, FrustumPlane* culledBy) 
+    {
+        return mCamera->isVisible(vert, culledBy);
+    }
+    //-----------------------------------------------------------------------
+    void CollideCamera::nearDistChanged(void)
+    {
+        // Alter the size of the collision proxy to compensate
+        CollisionProxyList::iterator i = mCollisionProxies.begin();
+        dSphere* sph = static_cast<dSphere*>(*i);
+        sph->setRadius(getNearClipDistance());
+    }
+
+}
+
Index: /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppJoint.cpp
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppJoint.cpp	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppJoint.cpp	(revision 5)
@@ -0,0 +1,91 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreRefAppJoint.h"
+#include "OgreRefAppApplicationObject.h"
+
+namespace OgreRefApp {
+
+    //-------------------------------------------------------------------------
+    Joint::Joint(Joint::JointType jtype) 
+        : mType(jtype), mAnchor(Vector3::ZERO), mOdeJoint(NULL)
+    {
+        mAxes.first = Vector3::UNIT_X;
+        mAxes.second = Vector3::UNIT_Z;
+
+        // Subclasses must set attachment since mOdeJoint must be created
+        
+    }
+    //-------------------------------------------------------------------------
+    Joint::JointType Joint::getType(void)
+    {
+        return mType;
+    }
+    //-------------------------------------------------------------------------
+    const Vector3& Joint::getAnchorPosition(void)
+    {
+        return mAnchor;
+    }
+    //-------------------------------------------------------------------------
+    void Joint::setAttachments(ApplicationObject* obj1, ApplicationObject* obj2)
+    {
+        dBodyID b1, b2;
+        b1 = b2 = 0;
+        if (obj1)
+        {
+            assert(obj1->getOdeBody() && "Cannot attach objects which do not have ODE bodies.");
+            b1 = obj1->getOdeBody()->id();
+        }
+        if (obj2)
+        {
+            assert(obj2->getOdeBody() && "Cannot attach objects which do not have ODE bodies.");
+            b2 = obj2->getOdeBody()->id();
+        }
+
+        mOdeJoint->attach(b1, b2);
+        mAttachedObjects.first = obj1;
+        mAttachedObjects.second = obj2;
+
+    }
+    //-------------------------------------------------------------------------
+    const std::pair<ApplicationObject*, ApplicationObject*>& 
+    Joint::getAttachments(void)
+    {
+        return mAttachedObjects;
+    }
+    //-------------------------------------------------------------------------
+    const std::pair<Vector3, Vector3>& 
+    Joint::getAxes(void)
+    {
+        return mAxes;
+    }
+    //-------------------------------------------------------------------------
+
+
+
+}
Index: /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppJointSubtypes.cpp
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppJointSubtypes.cpp	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppJointSubtypes.cpp	(revision 5)
@@ -0,0 +1,139 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreRefAppJointSubtypes.h"
+#include "OgreRefAppWorld.h"
+
+namespace OgreRefApp {
+
+    //-------------------------------------------------------------------------
+    BallJoint::BallJoint(Joint::JointType jtype, ApplicationObject* obj1, ApplicationObject* obj2)
+        : Joint(jtype)
+    {
+        mOdeJoint = new dBallJoint(World::getSingleton().getOdeWorld()->id());
+        setAttachments(obj1, obj2);
+    }
+    //-------------------------------------------------------------------------
+    void BallJoint::setAnchorPosition(const Vector3& point)
+    {
+        dBallJoint* ballJoint = static_cast<dBallJoint*>(mOdeJoint);
+
+        ballJoint->setAnchor(point.x, point.y, point.z);
+        mAnchor = point;
+    }
+    //-------------------------------------------------------------------------
+    //-------------------------------------------------------------------------
+    SliderJoint::SliderJoint(Joint::JointType jtype, ApplicationObject* obj1, ApplicationObject* obj2)
+        : Joint(jtype)
+    {
+        mOdeJoint = new dSliderJoint(World::getSingleton().getOdeWorld()->id());
+        setAttachments(obj1, obj2);
+
+    }
+    //-------------------------------------------------------------------------
+    void SliderJoint::setAxes(const Vector3& a1, const Vector3& na)
+    {
+        dSliderJoint* sliderJoint = static_cast<dSliderJoint*>(mOdeJoint);
+        sliderJoint->setAxis(a1.x, a1.y, a1.z);
+        mAxes.first = a1;
+
+    }
+    //-------------------------------------------------------------------------
+    //-------------------------------------------------------------------------
+    HingeJoint::HingeJoint(Joint::JointType jtype, ApplicationObject* obj1, ApplicationObject* obj2)
+        : Joint(jtype)
+    {
+        mOdeJoint = new dHingeJoint(World::getSingleton().getOdeWorld()->id());
+        setAttachments(obj1, obj2);
+    }
+    //-------------------------------------------------------------------------
+    void HingeJoint::setAnchorPosition(const Vector3& point)
+    {
+        dHingeJoint* hinge = static_cast<dHingeJoint*>(mOdeJoint);
+        hinge->setAnchor(point.x, point.y, point.z);
+        mAnchor = point;
+    }
+    //-------------------------------------------------------------------------
+    void HingeJoint::setAxes(const Vector3& a1, const Vector3& na)
+    {
+        dHingeJoint* hinge = static_cast<dHingeJoint*>(mOdeJoint);
+        hinge->setAxis(a1.x, a1.y, a1.z);
+        mAxes.first = a1;
+    }
+    //-------------------------------------------------------------------------
+    //-------------------------------------------------------------------------
+    UniversalJoint::UniversalJoint(Joint::JointType jtype, ApplicationObject* obj1, ApplicationObject* obj2)
+        : Joint(jtype)
+    {
+        mOdeJoint = new dUniversalJoint(World::getSingleton().getOdeWorld()->id());
+        setAttachments(obj1, obj2);
+    }
+    //-------------------------------------------------------------------------
+    void UniversalJoint::setAnchorPosition(const Vector3& point)
+    {
+        dUniversalJoint* univ = static_cast<dUniversalJoint*>(mOdeJoint);
+        univ->setAnchor(point.x, point.y, point.z);
+        mAnchor = point;
+    }
+    //-------------------------------------------------------------------------
+    void UniversalJoint::setAxes(const Vector3& a1, const Vector3& a2)
+    {
+        dUniversalJoint* univ = static_cast<dUniversalJoint*>(mOdeJoint);
+        univ->setAxis1(a1.x, a1.y, a1.z);
+        univ->setAxis2(a2.x, a2.y, a2.z);
+        mAxes.first = a1;
+        mAxes.second = a2;
+    }
+    //-------------------------------------------------------------------------
+    //-------------------------------------------------------------------------
+    Hinge2Joint::Hinge2Joint(Joint::JointType jtype, ApplicationObject* obj1, ApplicationObject* obj2)
+        : Joint(jtype)
+    {
+        mOdeJoint = new dHinge2Joint(World::getSingleton().getOdeWorld()->id());
+        setAttachments(obj1, obj2);
+    }
+    //-------------------------------------------------------------------------
+    void Hinge2Joint::setAnchorPosition(const Vector3& point)
+    {
+        dHinge2Joint* hinge = static_cast<dHinge2Joint*>(mOdeJoint);
+        hinge->setAnchor(point.x, point.y, point.z);
+        mAnchor = point;
+    }
+    //-------------------------------------------------------------------------
+    void Hinge2Joint::setAxes(const Vector3& a1, const Vector3& a2)
+    {
+        dHinge2Joint* hinge = static_cast<dHinge2Joint*>(mOdeJoint);
+        hinge->setAxis1(a1.x, a1.y, a1.z);
+        hinge->setAxis2(a2.x, a2.y, a2.z);
+        mAxes.first = a1;
+        mAxes.second = a2;
+    }
+
+
+
+}
Index: /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppOgreHead.cpp
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppOgreHead.cpp	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppOgreHead.cpp	(revision 5)
@@ -0,0 +1,76 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreRefAppOgreHead.h"
+#include "OgreRefAppWorld.h"
+
+namespace OgreRefApp
+{
+
+    //-------------------------------------------------------------------------
+    OgreHead::OgreHead(const String& name) : ApplicationObject(name)
+    {
+        setUp(name);
+    }
+    //-------------------------------------------------------------------------
+    OgreHead::~OgreHead()
+    {
+
+    }
+    //-------------------------------------------------------------------------
+    void OgreHead::setUp(const String& name)
+    {
+        // Create visual presence
+        SceneManager* sm = World::getSingleton().getSceneManager();
+        mEntity = sm->createEntity(name, "OgreHead.mesh");
+        mSceneNode = sm->getRootSceneNode()->createChildSceneNode(name);
+        mSceneNode->attachObject(mEntity);
+        // Add reverse reference
+        mEntity->setUserObject(this);
+
+        // Create mass body
+        mOdeBody = new dBody(World::getSingleton().getOdeWorld()->id());
+        // Set reverse reference
+        mOdeBody->setData(this);
+        // Set mass 
+        setMassSphere(0.1, 25); // TODO change to more realistic values
+
+        this->setBounceParameters(0.3, 0.1);
+        this->setSoftness(0.0f);
+        this->setFriction(Math::POS_INFINITY);
+
+        // Create collision proxy
+        dSphere* odeSphere = new dSphere(0, 25);
+        mCollisionProxies.push_back(odeSphere);
+        updateCollisionProxies();
+
+
+    }
+
+
+}
Index: /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppPlane.cpp
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppPlane.cpp	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppPlane.cpp	(revision 5)
@@ -0,0 +1,75 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreRefAppPlane.h"
+#include "OgreRefAppWorld.h"
+
+namespace OgreRefApp
+{
+    //-------------------------------------------------------------------------
+    FinitePlane::FinitePlane(const String& name, Real width, Real height) : ApplicationObject(name)
+    {
+        mWidth = width;
+        mHeight = height;
+        setUp(name);
+    }
+    //-------------------------------------------------------------------------
+    FinitePlane::~FinitePlane()
+    {
+
+    }
+    //-------------------------------------------------------------------------
+    void FinitePlane::setUp(const String& name)
+    {
+        // Create visual presence
+        SceneManager* sm = World::getSingleton().getSceneManager();
+        mEntity = sm->createEntity(name, "Prefab_Plane");
+        mSceneNode = sm->getRootSceneNode()->createChildSceneNode(name);
+        mSceneNode->attachObject(mEntity);
+        // Add reverse reference
+        mEntity->setUserObject(this);
+
+        // Default plane is 100x100
+        mSceneNode->scale(mWidth / 100.0f, mHeight / 100.0f, 1.0);
+
+        // No mass body (considered static)
+
+        // Create collision proxy
+        // SpaceID is irrelevant, we're doing our own spacial partitioning
+
+        // WARNING: an ODE dPlane seems to barf badly when you setPosition on it! Use a box.
+        // The other benefit here is that it reflects the width / height of the plane, not infinite
+        dBox* odeBox = new dBox(0, mWidth*2, mHeight*2, 1); 
+        mCollisionProxies.push_back(odeBox);
+        updateCollisionProxies();
+
+
+
+    }
+
+}
Index: /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppWorld.cpp
===================================================================
--- /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppWorld.cpp	(revision 5)
+++ /ReferenceApplication/ReferenceAppLayer/src/OgreRefAppWorld.cpp	(revision 5)
@@ -0,0 +1,338 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of the OGRE Reference Application, a layer built
+on top of OGRE(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreRefAppWorld.h"
+#include "OgreRefAppOgreHead.h"
+#include "OgreRefAppPlane.h"
+#include "OgreRefAppBall.h"
+#include "OgreRefAppJointSubtypes.h"
+#include "OgreRefAppBox.h"
+#include "OgreRefAppCollideCamera.h"
+
+//-------------------------------------------------------------------------
+template<> OgreRefApp::World* Ogre::Singleton<OgreRefApp::World>::ms_Singleton = 0;
+OgreRefApp::World* OgreRefApp::World::getSingletonPtr(void)
+{
+    return ms_Singleton;
+}
+OgreRefApp::World& OgreRefApp::World::getSingleton(void)
+{  
+    assert( ms_Singleton );  return ( *ms_Singleton );  
+}
+//-------------------------------------------------------------------------
+namespace OgreRefApp
+{
+    //-------------------------------------------------------------------------
+    World::World(SceneManager* sceneMgr, WorldType worldType)
+        : mSceneMgr(sceneMgr), mWorldType(worldType)
+    {
+        mSimulationStepSize = 0.01f;
+
+        // Create the dynamics world
+        mOdeWorld = new dWorld();
+        mOdeContactGroup = new dJointGroup();
+
+        mIntersectionQuery = mSceneMgr->createIntersectionQuery();
+        switch (worldType)
+        {
+        case World::WT_REFAPP_GENERIC:
+            mIntersectionQuery->setWorldFragmentType(SceneQuery::WFT_NONE);
+            break;
+        case World::WT_REFAPP_BSP:
+            mIntersectionQuery->setWorldFragmentType(SceneQuery::WFT_PLANE_BOUNDED_REGION);
+            break;
+        };
+
+    }
+    //-------------------------------------------------------------------------
+    World::~World()
+    {
+		clear();
+
+		delete mIntersectionQuery;
+
+        // Destroy dynamix world
+		delete mOdeContactGroup;
+        delete mOdeWorld;
+
+    }
+    //-------------------------------------------------------------------------
+    SceneManager* World::getSceneManager(void)
+    {
+        return mSceneMgr;
+    }
+    //-------------------------------------------------------------------------
+    OgreHead* World::createOgreHead(const String& name, 
+        const Vector3& pos, const Quaternion& orientation)
+    {
+        OgreHead* head = new OgreHead(name);
+        head->setPosition(pos);
+        head->setOrientation(orientation);
+
+        mObjects[name] = head;
+
+        return head;
+    }
+    //-------------------------------------------------------------------------
+    FinitePlane* World::createPlane(const String& name, Real width, Real height, const Vector3& pos, 
+        const Quaternion& orientation)
+    {
+        FinitePlane* plane = new FinitePlane(name, width, height);
+        plane->setPosition(pos);
+        plane->setOrientation(orientation);
+
+        mObjects[name] = plane;
+
+        return plane;
+    }
+    //-------------------------------------------------------------------------
+    Ball* World::createBall(const String& name, Real radius, const Vector3& pos, 
+        const Quaternion& orientation)
+    {
+        OgreRefApp::Ball* ball = new OgreRefApp::Ball(name, radius);
+        ball->setPosition(pos);
+        ball->setOrientation(orientation);
+
+        mObjects[name] = ball;
+
+        return ball;
+    }
+    //-------------------------------------------------------------------------
+    void World::clear(void)
+    {
+        ObjectMap::iterator i;
+        for (i = mObjects.begin(); i != mObjects.end(); ++i)
+        {
+            delete i->second;
+        }
+        mObjects.clear();
+
+        JointMap::iterator ji;
+        for (ji = mJoints.begin(); ji != mJoints.end(); ++ji)
+        {
+            delete ji->second;
+        }
+        mJoints.clear();
+    }
+    //-------------------------------------------------------------------------
+    dWorld* World::getOdeWorld(void)
+    {
+        return mOdeWorld;
+    }
+    //-------------------------------------------------------------------------
+    void World::_applyDynamics(Real timeElapsed)
+    {
+        if (timeElapsed != 0.0f)
+        {
+            // ODE will throw an error if timestep = 0
+
+            mOdeWorld->step(dReal(timeElapsed));
+            // Now update the objects in the world
+            ObjectSet::iterator i, iend;
+            iend = mDynamicsObjects.end();
+            for (i = mDynamicsObjects.begin(); i != iend; ++i)
+            {
+                (*i)->_updateFromDynamics();
+            }
+            // Clear contacts
+            mOdeContactGroup->empty();
+        }
+
+    }
+    //-------------------------------------------------------------------------
+    void World::_notifyDynamicsStateForObject(ApplicationObject* obj, bool dynamicsEnabled)
+    {
+        // NB std::set prevents duplicates & errors on erasing non-existent objects
+        if (dynamicsEnabled)
+        {
+            mDynamicsObjects.insert(obj);
+        }
+        else
+        {
+            mDynamicsObjects.erase(obj);
+        }
+    }
+    //-------------------------------------------------------------------------
+    void World::setGravity(const Vector3& vec)
+    {
+        mGravity = vec;
+        mOdeWorld->setGravity(vec.x, vec.y, vec.z);
+    }
+    //-------------------------------------------------------------------------
+    const Vector3& World::getGravity(void)
+    {
+        return mGravity;
+    }
+    //-------------------------------------------------------------------------
+    dJointGroup* World::getOdeContactJointGroup(void)
+    {
+        return mOdeContactGroup;
+    }
+    //-------------------------------------------------------------------------
+    void World::_applyCollision(void)
+    {
+        // Collision detection
+        IntersectionSceneQueryResult& results = mIntersectionQuery->execute();
+
+        // Movables to Movables
+        SceneQueryMovableIntersectionList::iterator it, itend;
+        itend = results.movables2movables.end();
+        for (it = results.movables2movables.begin(); it != itend; ++it)
+        {
+            /* debugging
+            MovableObject *mo1, *mo2;
+            mo1 = it->first;
+            mo2 = it->second;
+            */
+
+            // Get user defined objects (generic in OGRE)
+            UserDefinedObject *uo1, *uo2;
+            uo1 = it->first->getUserObject();
+            uo2 = it->second->getUserObject();
+
+            // Only perform collision if we have UserDefinedObject links
+            if (uo1 && uo2)
+            {
+                // Cast to ApplicationObject
+                ApplicationObject *ao1, *ao2;
+                ao1 = static_cast<ApplicationObject*>(uo1);
+                ao2 = static_cast<ApplicationObject*>(uo2);
+                // Do detailed collision test
+                ao1->testCollide(ao2);
+            }
+        }
+
+        // Movables to World
+        SceneQueryMovableWorldFragmentIntersectionList::iterator wit, witend;
+        witend = results.movables2world.end();
+        for (wit = results.movables2world.begin(); wit != witend; ++wit)
+        {
+            MovableObject *mo = wit->first;
+            SceneQuery::WorldFragment *wf = wit->second;
+
+            // Get user defined objects (generic in OGRE)
+            UserDefinedObject *uo = mo->getUserObject();
+
+            // Only perform collision if we have UserDefinedObject link
+            if (uo)
+            {
+                // Cast to ApplicationObject
+                ApplicationObject *ao = static_cast<ApplicationObject*>(uo);
+                // Do detailed collision test
+                ao->testCollide(wf);
+            }
+        }
+
+    }
+    //-------------------------------------------------------------------------
+    Joint* World::createJoint(const String& name, Joint::JointType jtype,
+        ApplicationObject* obj1, ApplicationObject* obj2)
+    {
+        Joint* ret;
+        switch (jtype)
+        {
+        case Joint::JT_BALL:
+            ret = new BallJoint(jtype, obj1, obj2);
+            break;
+        case Joint::JT_HINGE:
+            ret = new HingeJoint(jtype, obj1, obj2);
+            break;
+        case Joint::JT_HINGE2:
+            ret = new Hinge2Joint(jtype, obj1, obj2);
+            break;
+        case Joint::JT_SLIDER:
+            ret = new SliderJoint(jtype, obj1, obj2);
+            break;
+        case Joint::JT_UNIVERSAL:
+            ret = new UniversalJoint(jtype, obj1, obj2);
+            break;
+
+        }
+
+        mJoints[name] = ret;
+        return ret;
+    }
+    //-------------------------------------------------------------------------
+    void World::setSimulationStepSize(Real step)
+    {
+        mSimulationStepSize = step;
+    }
+    //-------------------------------------------------------------------------
+    Real World::getSimulationStepSize(void)
+    {
+        return mSimulationStepSize;
+    }
+    //-------------------------------------------------------------------------
+    void World::simulationStep(Real timeElapsed)
+    {
+        /* Hmm, gives somewhat jerky results*/
+        static Real leftOverTime = 0.0f;
+
+		Real time = timeElapsed + leftOverTime;	
+		unsigned int steps = (unsigned int)(time / mSimulationStepSize);
+		for(unsigned int  i=0; i < steps; ++i)
+        {
+			_applyCollision();
+            _applyDynamics(mSimulationStepSize);
+        }
+		leftOverTime = time - (steps * mSimulationStepSize);
+        /*
+		_applyCollision();
+        _applyDynamics(timeElapsed);
+        */
+
+
+    }
+    //-------------------------------------------------------------------------
+    OgreRefApp::Box* World::createBox(const String& name, 
+        Real width, Real height, Real depth,
+        const Vector3& pos, const Quaternion& orientation)
+    {
+        OgreRefApp::Box* box = new OgreRefApp::Box(name, width, height, depth);
+        box->setPosition(pos);
+        box->setOrientation(orientation);
+
+        mObjects[name] = box;
+
+        return box;
+    }
+    //-------------------------------------------------------------------------
+    CollideCamera* World::createCamera(const String& name, const Vector3& pos,
+        const Quaternion& orientation )
+    {
+        CollideCamera* cam = new CollideCamera(name);
+        cam->setPosition(pos);
+        cam->setOrientation(orientation);
+
+        mObjects[name] = cam;
+
+        return cam;
+
+    }
+}
+
Index: /ReferenceApplication/aclocal.m4
===================================================================
--- /ReferenceApplication/aclocal.m4	(revision 5)
+++ /ReferenceApplication/aclocal.m4	(revision 5)
@@ -0,0 +1,6893 @@
+# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005  Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+
+# serial 47 AC_PROG_LIBTOOL
+# Debian $Rev: 214 $
+
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If this macro is not defined by Autoconf, define it here.
+m4_ifdef([AC_PROVIDE_IFELSE],
+         [],
+         [m4_define([AC_PROVIDE_IFELSE],
+	         [m4_ifdef([AC_PROVIDE_$1],
+		           [$2], [$3])])])
+
+
+# AC_PROG_LIBTOOL
+# ---------------
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+  AC_PROVIDE_IFELSE([AC_PROG_CXX],
+    [AC_LIBTOOL_CXX],
+    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+  ])])
+dnl And a similar setup for Fortran 77 support
+  AC_PROVIDE_IFELSE([AC_PROG_F77],
+    [AC_LIBTOOL_F77],
+    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+    [AC_LIBTOOL_GCJ],
+    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+      [AC_LIBTOOL_GCJ],
+      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+	[AC_LIBTOOL_GCJ],
+      [ifdef([AC_PROG_GCJ],
+	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([A][M_PROG_GCJ],
+	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([LT_AC_PROG_GCJ],
+	     [define([LT_AC_PROG_GCJ],
+		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])# AC_PROG_LIBTOOL
+
+
+# _AC_PROG_LIBTOOL
+# ----------------
+AC_DEFUN([_AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])# _AC_PROG_LIBTOOL
+
+
+# AC_LIBTOOL_SETUP
+# ----------------
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.50)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
+
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_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.
+Xsed='sed -e s/^X//'
+[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 avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    AC_PATH_MAGIC
+  fi
+  ;;
+esac
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE([libtool-lock],
+    [AC_HELP_STRING([--disable-libtool-lock],
+	[avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+AC_ARG_WITH([pic],
+    [AC_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=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])# AC_LIBTOOL_SETUP
+
+
+# _LT_AC_SYS_COMPILER
+# -------------------
+AC_DEFUN([_LT_AC_SYS_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_AC_SYS_COMPILER
+
+
+# _LT_AC_SYS_LIBPATH_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.
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_AC_SYS_LIBPATH_AIX
+
+
+# _LT_AC_SHELL_INIT(ARG)
+# ----------------------
+AC_DEFUN([_LT_AC_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+	 [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_AC_SHELL_INIT
+
+
+# _LT_AC_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.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
+
+echo=${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 <<EOF
+[$]*
+EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$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 &&
+       echo_test_string="`eval $cmd`" &&
+       (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.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])])# _LT_AC_PROG_ECHO_BACKSLASH
+
+
+# _LT_AC_LOCK
+# -----------
+AC_DEFUN([_LT_AC_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+    [AC_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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|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-*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-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          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_TRY_LINK([],[],[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
+  ;;
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+  ])
+esac
+
+need_locks="$enable_libtool_lock"
+
+])# _LT_AC_LOCK
+
+
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
+[AC_REQUIRE([LT_AC_PROG_SED])
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   printf "$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}? :&$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
+     if test ! -s conftest.err; then
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$5], , :, [$5])
+else
+    ifelse([$6], , :, [$6])
+fi
+])# AC_LIBTOOL_COMPILER_OPTION
+
+
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                          [ACTION-SUCCESS], [ACTION-FAILURE])
+# ------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The compiler 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
+     else
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$4], , :, [$4])
+else
+    ifelse([$5], , :, [$5])
+fi
+])# AC_LIBTOOL_LINKER_OPTION
+
+
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
+# --------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
+[# 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*)
+    # 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;
+    ;;
+
+  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;
+    ;;
+
+ *)
+    # 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"`$CONFIG_SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+	       = "XX$teststring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
+	    lt_cv_sys_max_cmd_len=$new_result &&
+	    test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    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`
+    ;;
+  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
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
+
+
+# _LT_AC_CHECK_DLFCN
+# --------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)dnl
+])# _LT_AC_CHECK_DLFCN
+
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_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 <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}]
+EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_unknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
+
+
+# AC_LIBTOOL_DLOPEN_SELF
+# -------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_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*)
+    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="-dld"],
+	[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="-dld"])
+	      ])
+	    ])
+	  ])
+	])
+      ])
+    ;;
+  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"
+    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_AC_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
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+    	  lt_cv_dlopen_self_static, [dnl
+	  _LT_AC_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
+])# AC_LIBTOOL_DLOPEN_SELF
+
+
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
+# ---------------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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}? :&$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
+     if test ! -s out/conftest.err; then
+       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w .
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+])
+])# AC_LIBTOOL_PROG_CC_C_O
+
+
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
+# -----------------------------------------
+# Check to see if we can do hard links to lock some files if needed
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
+[AC_REQUIRE([_LT_AC_LOCK])dnl
+
+hard_links="nottested"
+if test "$_LT_AC_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
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
+
+
+# AC_LIBTOOL_OBJDIR
+# -----------------
+AC_DEFUN([AC_LIBTOOL_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
+])# AC_LIBTOOL_OBJDIR
+
+
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
+# ----------------------------------------------
+# Check hardcoding attributes.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+   test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
+   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$_LT_AC_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_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_AC_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; 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
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+
+
+# AC_LIBTOOL_SYS_LIB_STRIP
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
+[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"
+         AC_MSG_RESULT([yes])
+       else
+  AC_MSG_RESULT([no])
+fi
+       ;;
+   *)
+  AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+])# AC_LIBTOOL_SYS_LIB_STRIP
+
+
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+[AC_MSG_CHECKING([dynamic linker characteristics])
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | 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'
+  ;;
+
+netbsdelf*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=yes
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+
+
+# _LT_AC_TAGCONFIG
+# ----------------
+AC_DEFUN([_LT_AC_TAGCONFIG],
+[AC_ARG_WITH([tags],
+    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+        [include additional configurations @<:@automatic@:>@])],
+    [tagnames="$withval"])
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    AC_MSG_WARN([output file `$ofile' does not exist])
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
+    else
+      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+    fi
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+    "") ;;
+    *)  AC_MSG_ERROR([invalid tag name: $tagname])
+	;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      AC_MSG_ERROR([tag name \"$tagname\" already exists])
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      CXX)
+	if test -n "$CXX" && test "X$CXX" != "Xno"; then
+	  AC_LIBTOOL_LANG_CXX_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      F77)
+	if test -n "$F77" && test "X$F77" != "Xno"; then
+	  AC_LIBTOOL_LANG_F77_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      GCJ)
+	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+	  AC_LIBTOOL_LANG_GCJ_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      RC)
+	AC_LIBTOOL_LANG_RC_CONFIG
+	;;
+
+      *)
+	AC_MSG_ERROR([Unsupported tag name: $tagname])
+	;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    AC_MSG_ERROR([unable to update list of available tagged configurations.])
+  fi
+fi
+])# _LT_AC_TAGCONFIG
+
+
+# AC_LIBTOOL_DLOPEN
+# -----------------
+# enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_DLOPEN
+
+
+# AC_LIBTOOL_WIN32_DLL
+# --------------------
+# declare package support for building win32 dll's
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_WIN32_DLL
+
+
+# AC_ENABLE_SHARED([DEFAULT])
+# ---------------------------
+# implement the --enable-shared flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([shared],
+    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+	[build shared libraries @<:@default=]AC_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=]AC_ENABLE_SHARED_DEFAULT)
+])# AC_ENABLE_SHARED
+
+
+# AC_DISABLE_SHARED
+# -----------------
+#- set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])# AC_DISABLE_SHARED
+
+
+# AC_ENABLE_STATIC([DEFAULT])
+# ---------------------------
+# implement the --enable-static flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([static],
+    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+	[build static libraries @<:@default=]AC_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=]AC_ENABLE_STATIC_DEFAULT)
+])# AC_ENABLE_STATIC
+
+
+# AC_DISABLE_STATIC
+# -----------------
+# set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])# AC_DISABLE_STATIC
+
+
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
+# ---------------------------------
+# implement the --enable-fast-install flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([fast-install],
+    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]AC_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=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])# AC_ENABLE_FAST_INSTALL
+
+
+# AC_DISABLE_FAST_INSTALL
+# -----------------------
+# set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)
+])# AC_DISABLE_FAST_INSTALL
+
+
+# AC_LIBTOOL_PICMODE([MODE])
+# --------------------------
+# implement the --with-pic flag
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])# AC_LIBTOOL_PICMODE
+
+
+# AC_PROG_EGREP
+# -------------
+# This is predefined starting with Autoconf 2.54, so this conditional
+# definition can be removed once we require Autoconf 2.54 or later.
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])])
+
+
+# AC_PATH_TOOL_PREFIX
+# -------------------
+# find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_REQUIRE([AC_PROG_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="ifelse([$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 <<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
+
+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
+])# AC_PATH_TOOL_PREFIX
+
+
+# AC_PATH_MAGIC
+# -------------
+# find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_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
+    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# AC_PATH_MAGIC
+
+
+# AC_PROG_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+    [AC_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])
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])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 GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])# AC_PROG_LD
+
+
+# AC_PROG_LD_GNU
+# --------------
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AC_PROG_LD_GNU
+
+
+# AC_PROG_LD_RELOAD_FLAG
+# ----------------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+])# AC_PROG_LD_RELOAD_FLAG
+
+
+# AC_DEPLIBS_CHECK_METHOD
+# -----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi4*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu)
+  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)/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
+  ;;
+
+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*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+  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=unknown
+  ;;
+
+openbsd*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
+  else
+    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  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
+    ;;
+  esac
+  ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+  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
+])# AC_DEPLIBS_CHECK_METHOD
+
+
+# AC_PROG_NM
+# ----------
+# find the pathname to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm="$ac_dir/${ac_tool_prefix}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"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+])# AC_PROG_NM
+
+
+# AC_CHECK_LIBM
+# -------------
+# check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[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_CHECK_LIBM
+
+
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
+# -----------------------------------
+# 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 LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
+# DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
+# be prefixed 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_builddir and
+# top_srcdir appropriately in the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  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='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_CONVENIENCE
+
+
+# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
+# -----------------------------------
+# 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 LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
+# DIRECTORY is not provided and an installed libltdl is not found, it is
+# assumed to be `libltdl'.  LIBLTDL will be prefixed 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_builddir and top_srcdir appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  AC_CHECK_LIB(ltdl, lt_dlinit,
+  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+  [if test x"$enable_ltdl_install" = xno; then
+     AC_MSG_WARN([libltdl not installed, but installation disabled])
+   else
+     enable_ltdl_install=yes
+   fi
+  ])
+  if test x"$enable_ltdl_install" = x"yes"; then
+    ac_configure_args="$ac_configure_args --enable-ltdl-install"
+    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  else
+    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+    LIBLTDL="-lltdl"
+    LTDLINCL=
+  fi
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_INSTALLABLE
+
+
+# AC_LIBTOOL_CXX
+# --------------
+# enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX],
+[AC_REQUIRE([_LT_AC_LANG_CXX])
+])# AC_LIBTOOL_CXX
+
+
+# _LT_AC_LANG_CXX
+# ---------------
+AC_DEFUN([_LT_AC_LANG_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+])# _LT_AC_LANG_CXX
+
+
+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
+
+
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+])# _LT_AC_LANG_F77
+
+
+# AC_LIBTOOL_GCJ
+# --------------
+# enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
+])# AC_LIBTOOL_GCJ
+
+
+# _LT_AC_LANG_GCJ
+# ---------------
+AC_DEFUN([_LT_AC_LANG_GCJ],
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
+])# _LT_AC_LANG_GCJ
+
+
+# AC_LIBTOOL_RC
+# --------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
+])# AC_LIBTOOL_RC
+
+
+# AC_LIBTOOL_LANG_C_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
+[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_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+_LT_AC_SYS_COMPILER
+
+#
+# Check for any special shared library compilation flags.
+#
+_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
+    ;;
+  esac
+fi
+if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
+  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
+  if echo "$old_CC $old_CFLAGS " | grep "[[ 	]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ 	]]" >/dev/null; then :
+  else
+    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
+    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
+  fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
+  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
+  [],
+  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+# Report which librarie types wil 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
+  ;;
+
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+  darwin* | rhapsody*)
+  if test "$GCC" = yes; then
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    case "$host_os" in
+    rhapsody* | darwin1.[[012]])
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+      ;;
+    *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[[012]])
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+      ;;
+    esac
+    output_verbose_link_cmd='echo'
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
+    _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=no
+    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+  else
+    _LT_AC_TAGVAR(ld_shlibs, $1)=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])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_C_CONFIG
+
+
+# AC_LIBTOOL_LANG_CXX_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+[AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# 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
+  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
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+  AC_PROG_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_AC_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_AC_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_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  aix4* | aix5*)
+    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]].*|aix5*)
+	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_AC_TAGVAR(archive_cmds, $1)=''
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+    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
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	else
+	  # We have old collect2
+	  _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+	fi
+      esac
+      shared_flag='-shared'
+    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
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      _LT_AC_SYS_LIBPATH_AIX
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	_LT_AC_SYS_LIBPATH_AIX
+	_LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	# -bexpall does not export symbols beginning with underscore (_)
+	_LT_AC_TAGVAR(always_export_symbols, $1)=yes
+	# Exported symbols can be pulled into shared objects from archives
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+	# This is similar to how AIX traditionally builds it's shared libraries.
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+    # as there is no search path for DLLs.
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+    _LT_AC_TAGVAR(always_export_symbols, $1)=no
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      _LT_AC_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}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+  ;;
+
+  darwin* | rhapsody*)
+  if test "$GXX" = yes; then
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    case "$host_os" in
+    rhapsody* | darwin1.[[012]])
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+      ;;
+    *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[[012]])
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+      ;;
+    esac
+    lt_int_apple_cc_single_mod=no
+    output_verbose_link_cmd='echo'
+    if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+      lt_int_apple_cc_single_mod=yes
+    fi
+    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+    else
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -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'
+    fi
+    _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+
+    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=no
+    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+  else
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+  fi
+    ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      ghcx)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  freebsd[12]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  freebsd-elf*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  freebsd* | kfreebsd*-gnu)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    aCC)
+      _LT_AC_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) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case "$host_cpu" in
+      hppa*64*)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+        ;;
+      ia64*)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+        ;;
+      *)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        ;;
+      esac
+    fi
+    case "$host_cpu" in
+    hppa*64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+    ia64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    *)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      aCC)
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  _LT_AC_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 $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case "$host_cpu" in
+	    ia64*|hppa*64*)
+	      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	      ;;
+	    *)
+	      _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC)
+	# SGI C++
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${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_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+	  else
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+	;;
+    esac
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    ;;
+  linux*)
+    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_AC_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_AC_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 $list'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+	_LT_AC_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_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc)
+	# Intel C++
+	with_gnu_ld=yes
+	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      cxx)
+	# Compaq C++
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	_LT_AC_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 $templist | $SED "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 $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_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::"'
+    ;;
+  osf3*)
+    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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      cxx)
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	_LT_AC_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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	  _LT_AC_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 ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+	;;
+      RCC)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      cxx)
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+	_LT_AC_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 -set_version	$verstring` -update_registry $objdir/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	_LT_AC_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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	 _LT_AC_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` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  sco*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    case $cc_basename in
+      CC)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      lcc)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC)
+	# Sun C++ 4.2, 5.x and Centerline C++
+	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	_LT_AC_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} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	case $host_os in
+	  solaris2.[0-5] | solaris2.[0-5].*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+	# 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 -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+	# 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_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx)
+	# Green Hills C++ Compiler
+	_LT_AC_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_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+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
+])# AC_LIBTOOL_LANG_CXX_CONFIG
+
+# AC_LIBTOOL_POSTDEP_PREDEP([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.
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+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...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+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
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+  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_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	   else
+	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_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_AC_TAGVAR(postdeps, $1)"; then
+	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+	 else
+	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_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_AC_TAGVAR(predep_objects, $1)"; then
+	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
+	 else
+	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+	 fi
+       else
+	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+	 else
+	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_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
+
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])# AC_LIBTOOL_POSTDEP_PREDEP
+
+# AC_LIBTOOL_LANG_F77_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_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_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+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
+  ;;
+aix4* | aix5*)
+  test "$enable_shared" = yes && enable_static=no
+  ;;
+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])
+
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
+
+
+# AC_LIBTOOL_LANG_GCJ_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
+
+
+# AC_LIBTOOL_LANG_RC_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# 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_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
+
+
+# AC_LIBTOOL_CONFIG([TAGNAME])
+# ----------------------------
+# If TAGNAME is not passed, then 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
+# TAGNAME from the matching tagged config vars.
+AC_DEFUN([AC_LIBTOOL_CONFIG],
+[# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    _LT_AC_TAGVAR(compiler, $1) \
+    _LT_AC_TAGVAR(CC, $1) \
+    _LT_AC_TAGVAR(LD, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+    _LT_AC_TAGVAR(old_archive_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+    _LT_AC_TAGVAR(predep_objects, $1) \
+    _LT_AC_TAGVAR(postdep_objects, $1) \
+    _LT_AC_TAGVAR(predeps, $1) \
+    _LT_AC_TAGVAR(postdeps, $1) \
+    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+    _LT_AC_TAGVAR(archive_cmds, $1) \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(postinstall_cmds, $1) \
+    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+    _LT_AC_TAGVAR(no_undefined_flag, $1) \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+    _LT_AC_TAGVAR(hardcode_automatic, $1) \
+    _LT_AC_TAGVAR(module_cmds, $1) \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+    _LT_AC_TAGVAR(exclude_expsyms, $1) \
+    _LT_AC_TAGVAR(include_expsyms, $1); do
+
+    case $var in
+    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(module_cmds, $1) | \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\[$]0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+    ;;
+  esac
+
+ifelse([$1], [],
+  [cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  AC_MSG_NOTICE([creating $ofile])],
+  [cfgfile="$ofile"])
+
+  cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $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.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
+
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+  case $host_os in
+  aix3*)
+    cat <<\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
+EOF
+    ;;
+  esac
+
+  # 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 '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+])
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+])# AC_LIBTOOL_CONFIG
+
+
+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
+
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
+# 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]]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris* | sysv5*)
+  symcode='[[BDRT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# 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
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Write the raw and C identifiers.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+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 <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+	  cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[[]] =
+{
+EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+	  cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+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_AC_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 -f 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
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+
+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
+# ---------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # 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).
+      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # 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*)
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	else
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  ghcx)
+	    # Green Hills C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    if test "$host_cpu" != ia64; then
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	    fi
+	    ;;
+	  aCC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    case "$host_cpu" in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC)
+	    # KAI C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  icpc)
+	    # Intel C++
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  cxx)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    ;;
+	  RCC)
+	    # Rational C++ 2.4.1
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  cxx)
+	    # Digital/Compaq C++
+	    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      sco*)
+	case $cc_basename in
+	  CC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	    ;;
+	  gcx)
+	    # Green Hills C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC)
+	    # Sun C++ 4.x
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  lcc)
+	    # Lucid
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC)
+	    # NonStop-UX NCC 3.20
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      unixware*)
+	;;
+      vxworks*)
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+	;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    linux*)
+      case $CC in
+      icc* | ecc*)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      ccc*)
+        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+])
+
+
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
+# ------------------------------------
+# See if the linker supports building shared libraries.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
+[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # 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_AC_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_AC_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_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  linux*)
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=no
+  ;;
+  *)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+],[
+  runpath_var=
+  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_AC_TAGVAR(archive_cmds, $1)=
+  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+  _LT_AC_TAGVAR(module_cmds, $1)=
+  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(always_export_symbols, $1)=no
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_AC_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_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_AC_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}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=no
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	_LT_AC_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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds"
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` 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
+      if test $supports_anon_versioning = yes; then
+        _LT_AC_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 -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds"
+      fi
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=no
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+    ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
+      runpath_var=LD_RUN_PATH
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+      _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+      _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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_AC_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_AC_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]].*|aix5*)
+	  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_AC_TAGVAR(archive_cmds, $1)=''
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+      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
+  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	  else
+  	  # We have old collect2
+  	  _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+	esac
+	shared_flag='-shared'
+      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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       _LT_AC_SYS_LIBPATH_AIX
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 _LT_AC_SYS_LIBPATH_AIX
+	 _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      # see comment about different semantics on the GNU ld section
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    bsdi4*)
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+      # FIXME: Should let the user specify the lib program.
+      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    darwin* | rhapsody*)
+    if test "$GXX" = yes ; then
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      case "$host_os" in
+      rhapsody* | darwin1.[[012]])
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+	;;
+      *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[[012]])
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+	;;
+      esac
+    	lt_int_apple_cc_single_mod=no
+    	output_verbose_link_cmd='echo'
+    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+    	  lt_int_apple_cc_single_mod=yes
+    	fi
+    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+    	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+    	else
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -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'
+      fi
+      _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        else
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        fi
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+      ;;
+
+    dgux*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    freebsd1*)
+      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	_LT_AC_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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_AC_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*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  ;;
+	ia64*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    openbsd*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	   ;;
+	 *)
+	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_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_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_AC_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~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    sco3.2v5*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_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}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_AC_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'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+      esac
+      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+        ;;
+	motorola)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv5*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_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'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_AC_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*
+      printf "$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_AC_TAGVAR(lt_prog_compiler_wl, $1)
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+        then
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+        else
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+        fi
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+      ;;
+    esac
+  fi
+  ;;
+esac
+])# AC_LIBTOOL_PROG_LD_SHLIBS
+
+
+# _LT_AC_FILE_LTDLL_C
+# -------------------
+# Be careful that the start marker always follows a newline.
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# #  ifdef __CYGWIN32__
+# #    define __CYGWIN__ __CYGWIN32__
+# #  endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+#   __hDllInstance_base = hInst;
+#   return TRUE;
+# }
+# /* ltdll.c ends here */
+])# _LT_AC_FILE_LTDLL_C
+
+
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+# ---------------------------------
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+
+
+# old names
+AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+  AC_SUBST(GCJFLAGS)
+])
+
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
+])
+
+# 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.                               #
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+AC_DEFUN([LT_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
+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 && break
+  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_MSG_RESULT([$SED])
+])
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
+	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		AC_MSG_RESULT([yes])
+	else
+		AC_MSG_RESULT([no])
+		PKG_CONFIG=""
+	fi
+		
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test "x$ac_cv_env_[]$1[]_set" = "xset"; then
+	pkg_cv_[]$1=$ac_cv_env_[]$1[]_value
+elif test -n "$PKG_CONFIG"; then
+	if AC_RUN_LOG([$PKG_CONFIG --exists "$3" >/dev/null 2>&1]); then
+		pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+	else
+		pkg_failed=yes
+	fi
+else
+	pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.in
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_CACHE_CHECK([for $1][_CFLAGS], [pkg_cv_][$1][_CFLAGS],
+	[_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])])
+AC_CACHE_CHECK([for $1][_LIBS], [pkg_cv_][$1][_LIBS],
+	[_PKG_CONFIG([$1][_LIBS], [libs], [$2])])
+
+if test $pkg_failed = yes; then
+	$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+	# Put the nasty error message in config.log where it belongs
+	echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
+
+	ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.])],
+		[$4])
+elif test $pkg_failed = untried; then
+	ifelse([$4], , [AC_MSG_FAILURE(dnl
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
+		[$4])
+else
+	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+	ifelse([$3], , :, [$3])
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+	 [AM_AUTOMAKE_VERSION([1.9.5])])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 7
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`AS_DIRNAME("$mf")`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`AS_DIRNAME(["$file"])`
+    AS_MKDIR_P([$dirpart/$fdir])
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.58])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+	      		     [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $1 | $1:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes.	            -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+#
+# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+# created by `make install' are always world readable, even if the
+# installer happens to have an overly restrictive umask (e.g. 077).
+# This was a mistake.  There are at least two reasons why we must not
+# use `-m 0755':
+#   - it causes special bits like SGID to be ignored,
+#   - it may be too restrictive (some setups expect 775 directories).
+#
+# Do not use -m 0755 and let people choose whatever they expect by
+# setting umask.
+#
+# We cannot accept any implementation of `mkdir' that recognizes `-p'.
+# Some implementations (such as Solaris 8's) are not thread-safe: if a
+# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
+# concurrently, both version can detect that a/ is missing, but only
+# one can create it and the other will error out.  Consequently we
+# restrict ourselves to GNU make (using the --version option ensures
+# this.)
+AC_DEFUN([AM_PROG_MKDIR_P],
+[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+AC_SUBST([mkdir_p])])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
Index: /ReferenceApplication/autom4te.cache/output.0
===================================================================
--- /ReferenceApplication/autom4te.cache/output.0	(revision 5)
+++ /ReferenceApplication/autom4te.cache/output.0	(revision 5)
@@ -0,0 +1,21271 @@
+@%:@! /bin/sh
+@%:@ Guess values for system-dependent variables and create Makefiles.
+@%:@ Generated by GNU Autoconf 2.59 for OGRE_REFAPP 0.10.0.
+@%:@ 
+@%:@ Copyright (C) 2003 Free Software Foundation, Inc.
+@%:@ This configure script is free software; the Free Software Foundation
+@%:@ gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be 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+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+  ;;
+esac
+
+echo=${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 <<EOF
+$*
+EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$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 &&
+       echo_test_string="`eval $cmd`" &&
+       (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.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+tagnames=${tagnames+${tagnames},}CXX
+
+tagnames=${tagnames+${tagnames},}F77
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME='OGRE_REFAPP'
+PACKAGE_TARNAME='ogre_refapp'
+PACKAGE_VERSION='0.10.0'
+PACKAGE_STRING='OGRE_REFAPP 0.10.0'
+PACKAGE_BUGREPORT=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+#  include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PKG_CONFIG ac_pt_PKG_CONFIG OGRE_CFLAGS OGRE_LIBS LIB@&t@OBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_option in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_$ac_feature='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_$ac_package='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+	      localstatedir libdir includedir oldincludedir infodir mandir
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
+  else
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+  fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CXX_set=${CXX+set}
+ac_env_CXX_value=$CXX
+ac_cv_env_CXX_set=${CXX+set}
+ac_cv_env_CXX_value=$CXX
+ac_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_env_CXXFLAGS_value=$CXXFLAGS
+ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_cv_env_CXXFLAGS_value=$CXXFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+ac_env_CXXCPP_set=${CXXCPP+set}
+ac_env_CXXCPP_value=$CXXCPP
+ac_cv_env_CXXCPP_set=${CXXCPP+set}
+ac_cv_env_CXXCPP_value=$CXXCPP
+ac_env_F77_set=${F77+set}
+ac_env_F77_value=$F77
+ac_cv_env_F77_set=${F77+set}
+ac_cv_env_F77_value=$F77
+ac_env_FFLAGS_set=${FFLAGS+set}
+ac_env_FFLAGS_value=$FFLAGS
+ac_cv_env_FFLAGS_set=${FFLAGS+set}
+ac_cv_env_FFLAGS_value=$FFLAGS
+ac_env_PKG_CONFIG_set=${PKG_CONFIG+set}
+ac_env_PKG_CONFIG_value=$PKG_CONFIG
+ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set}
+ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG
+ac_env_OGRE_CFLAGS_set=${OGRE_CFLAGS+set}
+ac_env_OGRE_CFLAGS_value=$OGRE_CFLAGS
+ac_cv_env_OGRE_CFLAGS_set=${OGRE_CFLAGS+set}
+ac_cv_env_OGRE_CFLAGS_value=$OGRE_CFLAGS
+ac_env_OGRE_LIBS_set=${OGRE_LIBS+set}
+ac_env_OGRE_LIBS_value=$OGRE_LIBS
+ac_cv_env_OGRE_LIBS_set=${OGRE_LIBS+set}
+ac_cv_env_OGRE_LIBS_value=$OGRE_LIBS
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures OGRE_REFAPP 0.10.0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+			  [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+			  [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --infodir=DIR          info documentation [PREFIX/info]
+  --mandir=DIR           man documentation [PREFIX/man]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of OGRE_REFAPP 0.10.0:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-shared@<:@=PKGS@:>@ 
+                          build shared libraries @<:@default=yes@:>@
+  --enable-static@<:@=PKGS@:>@ 
+                          build static libraries @<:@default=yes@:>@
+  --enable-fast-install@<:@=PKGS@:>@ 
+                          optimize for fast installation @<:@default=yes@:>@
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-gnu-ld           assume the C compiler uses GNU ld @<:@default=no@:>@
+  --with-pic              try to use only PIC/non-PIC objects @<:@default=use
+                          both@:>@
+  --with-tags@<:@=TAGS@:>@ 
+                          include additional configurations @<:@automatic@:>@
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  CPP         C preprocessor
+  CXXCPP      C++ preprocessor
+  F77         Fortran 77 compiler command
+  FFLAGS      Fortran 77 compiler flags
+  PKG_CONFIG  path to pkg-config utility
+  OGRE_CFLAGS C compiler flags for OGRE, overriding pkg-config
+  OGRE_LIBS   linker flags for OGRE, overriding pkg-config
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+	   test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi
+    cd "$ac_popdir"
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\_ACEOF
+OGRE_REFAPP configure 0.10.0
+generated by GNU Autoconf 2.59
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by OGRE_REFAPP $as_me 0.10.0, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+@%:@@%:@ --------- @%:@@%:@
+@%:@@%:@ Platform. @%:@@%:@
+@%:@@%:@ --------- @%:@@%:@
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ Core tests. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+@%:@@%:@ ---------------- @%:@@%:@
+@%:@@%:@ Cache variables. @%:@@%:@
+@%:@@%:@ ---------------- @%:@@%:@
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+}
+    echo
+
+    cat <<\_ASBOX
+@%:@@%:@ ----------------- @%:@@%:@
+@%:@@%:@ Output variables. @%:@@%:@
+@%:@@%:@ ----------------- @%:@@%:@
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+@%:@@%:@ ------------- @%:@@%:@
+@%:@@%:@ Output files. @%:@@%:@
+@%:@@%:@ ------------- @%:@@%:@
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=$`echo $ac_var`
+	echo "$ac_var='"'"'$ac_val'"'"'"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ confdefs.h. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+_ASBOX
+      echo
+      sed "/^$/d" confdefs.h | sort
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core &&
+  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
+    esac
+  fi
+else
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+am__api_version="1.9"
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $.  echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AWK="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+all:
+	@echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+  SET_MAKE=
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='ogre_refapp'
+ VERSION='0.10.0'
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE "$PACKAGE"
+_ACEOF
+
+ 
+cat >>confdefs.h <<_ACEOF
+@%:@define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  STRIP=$ac_ct_STRIP
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+          ac_config_headers="$ac_config_headers ReferenceAppLayer/include/config.h"
+
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+  ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+  ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+  ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $@%:@ != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CC" && break
+done
+
+  CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Find the output, starting from the most likely.  This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+	;;
+    conftest.$ac_ext )
+	# This is the source file.
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	# FIXME: I believe we export ac_cv_exeext for Libtool,
+	# but it would be cool to find out if it's true.  Does anybody
+	# maintain Libtool? --akim.
+	export ac_cv_exeext
+	break;;
+    * )
+	break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  export ac_cv_exeext
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std1 is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std1.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext 
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+@%:@ifndef __cplusplus
+  choke me
+@%:@endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+@%:@include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+          ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval="$enable_dependency_tracking"
+  
+fi; 
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+ 
+
+if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC"   am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ 
+
+if 
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CXX" && break
+done
+test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
+
+  CXX=$ac_ct_CXX
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cxx_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+@%:@include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX"  am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ 
+
+if 
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval="$enable_shared"
+  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
+else
+  enable_shared=yes
+fi; 
+
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval="$enable_static"
+  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
+else
+  enable_static=yes
+fi; 
+
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval="$enable_fast_install"
+  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
+else
+  enable_fast_install=yes
+fi; 
+
+echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
+if test "${lt_cv_path_SED+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # 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
+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 && break
+  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
+
+fi
+
+echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+ 
+
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval="$with_gnu_ld"
+  test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi; 
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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 GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+
+echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
+if test "${lt_cv_path_NM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm="$ac_dir/${ac_tool_prefix}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"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+echo "${ECHO_T}$lt_cv_path_NM" >&6
+NM="$lt_cv_path_NM"
+
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
+echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
+echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi4*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu)
+  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)/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
+  ;;
+
+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*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+  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=unknown
+  ;;
+
+openbsd*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+  else
+    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  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
+    ;;
+  esac
+  ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
+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
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+  
+fi; 
+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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case "`/usr/bin/file conftest.o`" in
+    *32-bit*)
+      case $host in
+        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-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          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"
+  echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  lt_cv_cc_needs_belf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+lt_cv_cc_needs_belf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
+  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
+  ;;
+
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+  
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ 
+fi
+
+done
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+@%:@@%:@ -------------------------------------- @%:@@%:@
+@%:@@%:@ Report this to the OGRE_REFAPP lists.  @%:@@%:@
+@%:@@%:@ -------------------------------------- @%:@@%:@
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ 
+fi
+
+done
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
+if test -z "$CXXCPP"; then
+  if test "${ac_cv_prog_CXXCPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+  
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  echo "$as_me:$LINENO: result: $F77" >&5
+echo "${ECHO_T}$F77" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$F77" && break
+  done
+fi
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_F77="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+echo "${ECHO_T}$ac_ct_F77" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_F77" && break
+done
+
+  F77=$ac_ct_F77
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:__oline__:" \
+     "checking for Fortran 77 compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_f77_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_f77_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_f77_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+echo "${ECHO_T}$ac_cv_prog_f77_g" >&6
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
+
+G77=`test $ac_compiler_gnu = yes && echo yes`
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+
+# find the maximum length of command line arguments
+echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    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*)
+    # 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;
+    ;;
+
+  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;
+    ;;
+
+ *)
+    # 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"`$CONFIG_SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+	       = "XX$teststring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
+	    lt_cv_sys_max_cmd_len=$new_result &&
+	    test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    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`
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
+else
+  echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6
+fi
+
+
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  
+# 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]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris* | sysv5*)
+  symcode='[BDRT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# 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
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Write the raw and C identifiers.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && 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 <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+	  cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+	  cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+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_prog_compiler_no_builtin_flag"
+	  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && 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" >&5
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -f 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
+
+fi
+
+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
+  echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+else
+  echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+fi
+
+echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6
+if test "${lt_cv_objdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+fi
+echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+echo "${ECHO_T}$lt_cv_objdir" >&6
+objdir=$lt_cv_objdir
+
+
+
+
+
+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.
+Xsed='sed -e s/^X//'
+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 avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false"
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  AR=$ac_ct_AR
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  RANLIB=$ac_ct_RANLIB
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  STRIP=$ac_ct_STRIP
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      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 <<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
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      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 <<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
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+enable_dlopen=no
+enable_win32_dll=no
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+  
+fi; 
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+  withval="$with_pic"
+  pic_mode="$withval"
+else
+  pic_mode=default
+fi; 
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+#
+# Check for any special shared library compilation flags.
+#
+lt_prog_cc_shlib=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    lt_prog_cc_shlib='-belf'
+    ;;
+  esac
+fi
+if test -n "$lt_prog_cc_shlib"; then
+  { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5
+echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;}
+  if echo "$old_CC $old_CFLAGS " | grep "[ 	]$lt_prog_cc_shlib[ 	]" >/dev/null; then :
+  else
+    { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
+echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
+    lt_cv_prog_cc_can_build_shared=no
+  fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The compiler 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>&5
+     else
+       lt_prog_compiler_static_works=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
+
+if test x"$lt_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+## 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_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+  
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+ 
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      else
+	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-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_prog_compiler_pic='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    linux*)
+      case $CC in
+      icc* | ecc*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-KPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic='-Kpic'
+      lt_prog_compiler_static='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic='-Kconform_pic'
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+  
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
+
+if test x"$lt_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w .
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag=
+  enable_shared_with_static_runtimes=no
+  archive_cmds=
+  archive_expsym_cmds=
+  old_archive_From_new_cmds=
+  old_archive_from_expsyms_cmds=
+  export_dynamic_flag_spec=
+  whole_archive_flag_spec=
+  thread_safe_flag_spec=
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_flag_spec_ld=
+  hardcode_libdir_separator=
+  hardcode_direct=no
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  link_all_deplibs=unknown
+  hardcode_automatic=no
+  module_cmds=
+  module_expsym_cmds=
+  always_export_symbols=no
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # 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'.
+  exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$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)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds="$tmp_archive_cmds"
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` 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
+      if test $supports_anon_versioning = yes; then
+        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        archive_expsym_cmds="$tmp_archive_cmds"
+      fi
+      link_all_deplibs=no
+    else
+      ld_shlibs=no
+    fi
+    ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec='${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
+ 	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$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.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds='$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].*|aix5*)
+	  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.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+
+      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
+  	  hardcode_direct=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct=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
+  	  hardcode_minus_L=yes
+  	  hardcode_libdir_flag_spec='-L$libdir'
+  	  hardcode_libdir_separator=
+	  fi
+	esac
+	shared_flag='-shared'
+      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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=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.
+	allow_undefined_flag='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag="-z nodefs"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec='${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.
+	  no_undefined_flag=' ${wl}-bernotok'
+	  allow_undefined_flag=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec=' '
+	  archive_cmds_need_lc=yes
+	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$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)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs=no
+      ;;
+
+    bsdi4*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec=' '
+      allow_undefined_flag=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.
+      archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    darwin* | rhapsody*)
+    if test "$GXX" = yes ; then
+      archive_cmds_need_lc=no
+      case "$host_os" in
+      rhapsody* | darwin1.[012])
+	allow_undefined_flag='-undefined suppress'
+	;;
+      *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	allow_undefined_flag='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[012])
+            allow_undefined_flag='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            allow_undefined_flag='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+	;;
+      esac
+    	lt_int_apple_cc_single_mod=no
+    	output_verbose_link_cmd='echo'
+    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+    	  lt_int_apple_cc_single_mod=yes
+    	fi
+    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+    	  archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+    	else
+        archive_cmds='$CC -r ${wl}-bind_at_load -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'
+      fi
+      module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+          archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        else
+          archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        fi
+          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      hardcode_direct=no
+      hardcode_automatic=yes
+      hardcode_shlibpath_var=unsupported
+      whole_archive_flag_spec='-all_load $convenience'
+      link_all_deplibs=yes
+    else
+      ld_shlibs=no
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs=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*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu)
+      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds='$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
+	archive_cmds='$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
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds='$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*|ia64*)
+	  archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*)
+	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld='+b $libdir'
+	  hardcode_libdir_separator=:
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec='-L$libdir'
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator=:
+	  hardcode_direct=yes
+	  export_dynamic_flag_spec='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      link_all_deplibs=yes
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    openbsd*)
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$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'
+      old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      hardcode_libdir_separator=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z text'
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds='$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'
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+      esac
+      link_all_deplibs=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.
+	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds='$CC -r -o $output$reload_objs'
+	  hardcode_direct=no
+        ;;
+	motorola)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=no
+      hardcode_shlibpath_var=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds='$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'
+      hardcode_libdir_flag_spec=
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+echo "${ECHO_T}$ld_shlibs" >&6
+test "$ld_shlibs" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds 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.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag
+        allow_undefined_flag=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc=no
+        else
+	  archive_cmds_need_lc=yes
+        fi
+        allow_undefined_flag=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+echo "${ECHO_T}$archive_cmds_need_lc" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | 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'
+  ;;
+
+netbsdelf*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=yes
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+   test -n "$runpath_var " || \
+   test "X$hardcode_automatic"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct" != 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_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action" >&5
+echo "${ECHO_T}$hardcode_action" >&6
+
+if test "$hardcode_action" = relink; 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
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+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"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+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"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    ;;
+  esac
+fi
+
+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*)
+    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
+    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    
+fi
+
+   ;;
+
+  *)
+    echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+	      
+fi
+
+	    
+fi
+
+	  
+fi
+
+	
+fi
+
+      
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+    
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+      
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+    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
+
+
+# Report which librarie types wil actually be built
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+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
+  ;;
+
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+  darwin* | rhapsody*)
+  if test "$GCC" = yes; then
+    archive_cmds_need_lc=no
+    case "$host_os" in
+    rhapsody* | darwin1.[012])
+      allow_undefined_flag='-undefined suppress'
+      ;;
+    *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	allow_undefined_flag='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[012])
+            allow_undefined_flag='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            allow_undefined_flag='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+      ;;
+    esac
+    output_verbose_link_cmd='echo'
+    archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
+    module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+    archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    hardcode_direct=no
+    hardcode_automatic=yes
+    hardcode_shlibpath_var=unsupported
+    whole_archive_flag_spec='-all_load $convenience'
+    link_all_deplibs=yes
+  else
+    ld_shlibs=no
+  fi
+    ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler \
+    CC \
+    LD \
+    lt_prog_compiler_wl \
+    lt_prog_compiler_pic \
+    lt_prog_compiler_static \
+    lt_prog_compiler_no_builtin_flag \
+    export_dynamic_flag_spec \
+    thread_safe_flag_spec \
+    whole_archive_flag_spec \
+    enable_shared_with_static_runtimes \
+    old_archive_cmds \
+    old_archive_from_new_cmds \
+    predep_objects \
+    postdep_objects \
+    predeps \
+    postdeps \
+    compiler_lib_search_path \
+    archive_cmds \
+    archive_expsym_cmds \
+    postinstall_cmds \
+    postuninstall_cmds \
+    old_archive_from_expsyms_cmds \
+    allow_undefined_flag \
+    no_undefined_flag \
+    export_symbols_cmds \
+    hardcode_libdir_flag_spec \
+    hardcode_libdir_flag_spec_ld \
+    hardcode_libdir_separator \
+    hardcode_automatic \
+    module_cmds \
+    module_expsym_cmds \
+    lt_cv_prog_compiler_c_o \
+    exclude_expsyms \
+    include_expsyms; do
+
+    case $var in
+    old_archive_cmds | \
+    old_archive_from_new_cmds | \
+    archive_cmds | \
+    archive_expsym_cmds | \
+    module_cmds | \
+    module_expsym_cmds | \
+    old_archive_from_expsyms_cmds | \
+    export_symbols_cmds | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  { echo "$as_me:$LINENO: creating $ofile" >&5
+echo "$as_me: creating $ofile" >&6;}
+
+  cat <<__EOF__ >> "$cfgfile"
+#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+
+  case $host_os in
+  aix3*)
+    cat <<\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
+EOF
+    ;;
+  esac
+
+  # 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 '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+# Check whether --with-tags or --without-tags was given.
+if test "${with_tags+set}" = set; then
+  withval="$with_tags"
+  tagnames="$withval"
+fi; 
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
+    else
+      { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
+echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
+    fi
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
+    "") ;;
+    *)  { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
+echo "$as_me: error: invalid tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+	;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
+echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      CXX)
+	if test -n "$CXX" && test "X$CXX" != "Xno"; then
+	  ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# 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
+  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
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+  lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+  
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval="$with_gnu_ld"
+  test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi; 
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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 GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_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
+    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_CXX='${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
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_CXX=
+    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.
+    archive_cmds_CXX='$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
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+ld_shlibs_CXX=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  aix4* | aix5*)
+    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].*|aix5*)
+	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.
+
+    archive_cmds_CXX=''
+    hardcode_direct_CXX=yes
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+
+    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
+	  hardcode_direct_CXX=yes
+	else
+	  # We have old collect2
+	  hardcode_direct_CXX=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
+	  hardcode_minus_L_CXX=yes
+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
+	  hardcode_libdir_separator_CXX=
+	fi
+      esac
+      shared_flag='-shared'
+    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
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    always_export_symbols_CXX=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.
+      allow_undefined_flag_CXX='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+	allow_undefined_flag_CXX="-z nodefs"
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	hardcode_libdir_flag_spec_CXX='${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.
+	no_undefined_flag_CXX=' ${wl}-bernotok'
+	allow_undefined_flag_CXX=' ${wl}-berok'
+	# -bexpall does not export symbols beginning with underscore (_)
+	always_export_symbols_CXX=yes
+	# Exported symbols can be pulled into shared objects from archives
+	whole_archive_flag_spec_CXX=' '
+	archive_cmds_need_lc_CXX=yes
+	# This is similar to how AIX traditionally builds it's shared libraries.
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+    # as there is no search path for DLLs.
+    hardcode_libdir_flag_spec_CXX='-L$libdir'
+    allow_undefined_flag_CXX=unsupported
+    always_export_symbols_CXX=no
+    enable_shared_with_static_runtimes_CXX=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      archive_expsym_cmds_CXX='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}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+  ;;
+
+  darwin* | rhapsody*)
+  if test "$GXX" = yes; then
+    archive_cmds_need_lc_CXX=no
+    case "$host_os" in
+    rhapsody* | darwin1.[012])
+      allow_undefined_flag_CXX='-undefined suppress'
+      ;;
+    *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	allow_undefined_flag_CXX='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[012])
+            allow_undefined_flag_CXX='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            allow_undefined_flag_CXX='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+      ;;
+    esac
+    lt_int_apple_cc_single_mod=no
+    output_verbose_link_cmd='echo'
+    if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+      lt_int_apple_cc_single_mod=yes
+    fi
+    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+      archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+    else
+      archive_cmds_CXX='$CC -r ${wl}-bind_at_load -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'
+    fi
+    module_cmds_CXX='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+
+    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+      archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    hardcode_direct_CXX=no
+    hardcode_automatic_CXX=yes
+    hardcode_shlibpath_var_CXX=unsupported
+    whole_archive_flag_spec_CXX='-all_load $convenience'
+    link_all_deplibs_CXX=yes
+  else
+    ld_shlibs_CXX=no
+  fi
+    ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      ghcx)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  freebsd12*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    ld_shlibs_CXX=no
+    ;;
+  freebsd-elf*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  freebsd* | kfreebsd*-gnu)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    ld_shlibs_CXX=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    hardcode_direct_CXX=yes
+    hardcode_minus_L_CXX=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
+      ld_shlibs_CXX=no
+      ;;
+    aCC)
+      archive_cmds_CXX='$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) | grep "-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        archive_cmds_CXX='$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
+        ld_shlibs_CXX=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case "$host_cpu" in
+      hppa*64*)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+	hardcode_libdir_separator_CXX=:
+        ;;
+      ia64*)
+	hardcode_libdir_flag_spec_CXX='-L$libdir'
+        ;;
+      *)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+	export_dynamic_flag_spec_CXX='${wl}-E'
+        ;;
+      esac
+    fi
+    case "$host_cpu" in
+    hppa*64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      ;;
+    ia64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      hardcode_minus_L_CXX=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    *)
+      hardcode_direct_CXX=yes
+      hardcode_minus_L_CXX=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
+	ld_shlibs_CXX=no
+	;;
+      aCC)
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  archive_cmds_CXX='$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 $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case "$host_cpu" in
+	    ia64*|hppa*64*)
+	      archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	      ;;
+	    *)
+	      archive_cmds_CXX='$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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC)
+	# SGI C++
+	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${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.
+	old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test "$with_gnu_ld" = no; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+	  else
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	link_all_deplibs_CXX=yes
+	;;
+    esac
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    ;;
+  linux*)
+    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.
+	archive_cmds_CXX='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'
+	archive_expsym_cmds_CXX='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 $list'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc)
+	# Intel C++
+	with_gnu_ld=yes
+	archive_cmds_need_lc_CXX=no
+	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      cxx)
+	# Compaq C++
+	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_CXX='$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
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      hardcode_libdir_flag_spec_CXX='-R$libdir'
+      hardcode_direct_CXX=yes
+      hardcode_shlibpath_var_CXX=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::"'
+    ;;
+  osf3*)
+    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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx)
+	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+	;;
+      RCC)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx)
+	allow_undefined_flag_CXX=' -expect_unresolved \*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+	archive_expsym_cmds_CXX='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 -set_version	$verstring` -update_registry $objdir/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	 archive_cmds_CXX='$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` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  sco*)
+    archive_cmds_need_lc_CXX=no
+    case $cc_basename in
+      CC)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      lcc)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC)
+	# Sun C++ 4.2, 5.x and Centerline C++
+	no_undefined_flag_CXX=' -zdefs'
+	archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+	hardcode_libdir_flag_spec_CXX='-R$libdir'
+	hardcode_shlibpath_var_CXX=no
+	case $host_os in
+	  solaris2.0-5 | solaris2.0-5.*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	link_all_deplibs_CXX=yes
+
+	# 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 -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+	# 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.
+	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx)
+	# Green Hills C++ Compiler
+	archive_cmds_CXX='$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.
+	old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	;;
+      *)
+	# GNU C++ compiler with Solaris linker
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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.
+	    archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+esac
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$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...
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+  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 "$compiler_lib_search_path_CXX"; then
+	     compiler_lib_search_path_CXX="${prev}${p}"
+	   else
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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 "$postdeps_CXX"; then
+	   postdeps_CXX="${prev}${p}"
+	 else
+	   postdeps_CXX="${postdeps_CXX} ${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 "$predep_objects_CXX"; then
+	   predep_objects_CXX="$p"
+	 else
+	   predep_objects_CXX="$predep_objects_CXX $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_CXX"; then
+	   postdep_objects_CXX="$p"
+	 else
+	   postdep_objects_CXX="$postdep_objects_CXX $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+ 
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # 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_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # 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).
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # 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*)
+	;;
+      *)
+	lt_prog_compiler_pic_CXX='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  lt_prog_compiler_static_CXX='-Bstatic'
+	else
+	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  ghcx)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    if test "$host_cpu" != ia64; then
+	      lt_prog_compiler_pic_CXX='+Z'
+	    fi
+	    ;;
+	  aCC)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    case "$host_cpu" in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      lt_prog_compiler_pic_CXX='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC)
+	    # KAI C++ Compiler
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  icpc)
+	    # Intel C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  cxx)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx)
+	    lt_prog_compiler_pic_CXX='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC)
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    ;;
+	  RCC)
+	    # Rational C++ 2.4.1
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  cxx)
+	    # Digital/Compaq C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      sco*)
+	case $cc_basename in
+	  CC)
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    lt_prog_compiler_wl_CXX='-Qoption ld '
+	    ;;
+	  gcx)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC)
+	    # Sun C++ 4.x
+	    lt_prog_compiler_pic_CXX='-pic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  lcc)
+	    # Lucid
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC)
+	    # NonStop-UX NCC 3.20
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      unixware*)
+	;;
+      vxworks*)
+	;;
+      *)
+	lt_prog_compiler_can_build_shared_CXX=no
+	;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+  
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_CXX=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w .
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # 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
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  linux*)
+    link_all_deplibs_CXX=no
+  ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX 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.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_CXX
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+        allow_undefined_flag_CXX=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_CXX=no
+        else
+	  archive_cmds_need_lc_CXX=yes
+        fi
+        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | 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'
+  ;;
+
+netbsdelf*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=yes
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+   test -n "$runpath_var CXX" || \
+   test "X$hardcode_automatic_CXX"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_CXX" != 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_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6
+
+if test "$hardcode_action_CXX" = relink; 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
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+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"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+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"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    ;;
+  esac
+fi
+
+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*)
+    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
+    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    
+fi
+
+   ;;
+
+  *)
+    echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+	      
+fi
+
+	    
+fi
+
+	  
+fi
+
+	
+fi
+
+      
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+    
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+      
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+    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
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_CXX \
+    CC_CXX \
+    LD_CXX \
+    lt_prog_compiler_wl_CXX \
+    lt_prog_compiler_pic_CXX \
+    lt_prog_compiler_static_CXX \
+    lt_prog_compiler_no_builtin_flag_CXX \
+    export_dynamic_flag_spec_CXX \
+    thread_safe_flag_spec_CXX \
+    whole_archive_flag_spec_CXX \
+    enable_shared_with_static_runtimes_CXX \
+    old_archive_cmds_CXX \
+    old_archive_from_new_cmds_CXX \
+    predep_objects_CXX \
+    postdep_objects_CXX \
+    predeps_CXX \
+    postdeps_CXX \
+    compiler_lib_search_path_CXX \
+    archive_cmds_CXX \
+    archive_expsym_cmds_CXX \
+    postinstall_cmds_CXX \
+    postuninstall_cmds_CXX \
+    old_archive_from_expsyms_cmds_CXX \
+    allow_undefined_flag_CXX \
+    no_undefined_flag_CXX \
+    export_symbols_cmds_CXX \
+    hardcode_libdir_flag_spec_CXX \
+    hardcode_libdir_flag_spec_ld_CXX \
+    hardcode_libdir_separator_CXX \
+    hardcode_automatic_CXX \
+    module_cmds_CXX \
+    module_expsym_cmds_CXX \
+    lt_cv_prog_compiler_c_o_CXX \
+    exclude_expsyms_CXX \
+    include_expsyms_CXX; do
+
+    case $var in
+    old_archive_cmds_CXX | \
+    old_archive_from_new_cmds_CXX | \
+    archive_cmds_CXX | \
+    archive_expsym_cmds_CXX | \
+    module_cmds_CXX | \
+    module_expsym_cmds_CXX | \
+    old_archive_from_expsyms_cmds_CXX | \
+    export_symbols_cmds_CXX | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+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
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      F77)
+	if test -n "$F77" && test "X$F77" != "Xno"; then
+	  
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+compiler_F77=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+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
+  ;;
+aix4* | aix5*)
+  test "$enable_shared" = yes && enable_static=no
+  ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+GCC_F77="$G77"
+LD_F77="$LD"
+
+lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+ 
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_F77='-Wl,'
+    lt_prog_compiler_static_F77='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_F77='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_F77=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_F77=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic_F77='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_F77='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      else
+	lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_F77='-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_prog_compiler_pic_F77='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    linux*)
+      case $CC in
+      icc* | ecc*)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-KPIC'
+	lt_prog_compiler_static_F77='-static'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_F77='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_F77='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic_F77='-Kpic'
+      lt_prog_compiler_static_F77='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_F77='-Qoption ld '
+      lt_prog_compiler_pic_F77='-PIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_F77='-Kconform_pic'
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_F77='-pic'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+  
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_F77=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_F77"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works_F77=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
+
+if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+    case $lt_prog_compiler_pic_F77 in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+     esac
+else
+    lt_prog_compiler_pic_F77=
+     lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_F77=
+    ;;
+  *)
+    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_F77=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o_F77=yes
+     fi
+   fi
+   chmod u+w .
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag_F77=
+  enable_shared_with_static_runtimes_F77=no
+  archive_cmds_F77=
+  archive_expsym_cmds_F77=
+  old_archive_From_new_cmds_F77=
+  old_archive_from_expsyms_cmds_F77=
+  export_dynamic_flag_spec_F77=
+  whole_archive_flag_spec_F77=
+  thread_safe_flag_spec_F77=
+  hardcode_libdir_flag_spec_F77=
+  hardcode_libdir_flag_spec_ld_F77=
+  hardcode_libdir_separator_F77=
+  hardcode_direct_F77=no
+  hardcode_minus_L_F77=no
+  hardcode_shlibpath_var_F77=unsupported
+  link_all_deplibs_F77=unknown
+  hardcode_automatic_F77=no
+  module_cmds_F77=
+  module_expsym_cmds_F77=
+  always_export_symbols_F77=no
+  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_F77=
+  # 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'.
+  exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_F77=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_F77=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$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)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_F77=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_F77=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=no
+      enable_shared_with_static_runtimes_F77=yes
+      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_F77='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_F77=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds_F77="$tmp_archive_cmds"
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` 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
+      if test $supports_anon_versioning = yes; then
+        archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        archive_expsym_cmds_F77="$tmp_archive_cmds"
+      fi
+      link_all_deplibs_F77=no
+    else
+      ld_shlibs_F77=no
+    fi
+    ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_F77" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec_F77='${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
+ 	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_F77=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=yes
+      archive_expsym_cmds_F77='$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.
+      hardcode_minus_L_F77=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_F77=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_F77='$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].*|aix5*)
+	  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.
+
+      archive_cmds_F77=''
+      hardcode_direct_F77=yes
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+
+      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
+  	  hardcode_direct_F77=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct_F77=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
+  	  hardcode_minus_L_F77=yes
+  	  hardcode_libdir_flag_spec_F77='-L$libdir'
+  	  hardcode_libdir_separator_F77=
+	  fi
+	esac
+	shared_flag='-shared'
+      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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_F77=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.
+	allow_undefined_flag_F77='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_F77="-z nodefs"
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec_F77='${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.
+	  no_undefined_flag_F77=' ${wl}-bernotok'
+	  allow_undefined_flag_F77=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols_F77=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec_F77=' '
+	  archive_cmds_need_lc_F77=yes
+	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$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)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_F77=no
+      ;;
+
+    bsdi4*)
+      export_dynamic_flag_spec_F77=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec_F77=' '
+      allow_undefined_flag_F77=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.
+      archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_F77='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_F77=yes
+      ;;
+
+    darwin* | rhapsody*)
+    if test "$GXX" = yes ; then
+      archive_cmds_need_lc_F77=no
+      case "$host_os" in
+      rhapsody* | darwin1.[012])
+	allow_undefined_flag_F77='-undefined suppress'
+	;;
+      *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	allow_undefined_flag_F77='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[012])
+            allow_undefined_flag_F77='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            allow_undefined_flag_F77='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+	;;
+      esac
+    	lt_int_apple_cc_single_mod=no
+    	output_verbose_link_cmd='echo'
+    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+    	  lt_int_apple_cc_single_mod=yes
+    	fi
+    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+    	  archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+    	else
+        archive_cmds_F77='$CC -r ${wl}-bind_at_load -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'
+      fi
+      module_cmds_F77='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+          archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        else
+          archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        fi
+          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      hardcode_direct_F77=no
+      hardcode_automatic_F77=yes
+      hardcode_shlibpath_var_F77=unsupported
+      whole_archive_flag_spec_F77='-all_load $convenience'
+      link_all_deplibs_F77=yes
+    else
+      ld_shlibs_F77=no
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_F77=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*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu)
+      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$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
+	archive_cmds_F77='$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
+      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_direct_F77=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_F77=yes
+      export_dynamic_flag_spec_F77='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$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*|ia64*)
+	  archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*)
+	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+	  hardcode_libdir_separator_F77=:
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec_F77='-L$libdir'
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_F77=:
+	  hardcode_direct_F77=yes
+	  export_dynamic_flag_spec_F77='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      link_all_deplibs_F77=yes
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    newsos6)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_F77='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec_F77='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      allow_undefined_flag_F77=unsupported
+      archive_cmds_F77='$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'
+      old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag_F77=' -z text'
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds_F77='$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'
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_shlibpath_var_F77=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+      esac
+      link_all_deplibs_F77=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.
+	archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_F77='$CC -r -o $output$reload_objs'
+	  hardcode_direct_F77=no
+        ;;
+	motorola)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_F77=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_F77=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_F77='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag_F77=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_F77='$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'
+      hardcode_libdir_flag_spec_F77=
+      hardcode_shlibpath_var_F77=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      ld_shlibs_F77=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+echo "${ECHO_T}$ld_shlibs_F77" >&6
+test "$ld_shlibs_F77" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_F77=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_F77 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.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_F77
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+        allow_undefined_flag_F77=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_F77=no
+        else
+	  archive_cmds_need_lc_F77=yes
+        fi
+        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | 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'
+  ;;
+
+netbsdelf*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=yes
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" || \
+   test -n "$runpath_var F77" || \
+   test "X$hardcode_automatic_F77"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_F77" != 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_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+     test "$hardcode_minus_L_F77" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_F77=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_F77=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_F77=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+echo "${ECHO_T}$hardcode_action_F77" >&6
+
+if test "$hardcode_action_F77" = relink; 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
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+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"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+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"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    ;;
+  esac
+fi
+
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_F77 \
+    CC_F77 \
+    LD_F77 \
+    lt_prog_compiler_wl_F77 \
+    lt_prog_compiler_pic_F77 \
+    lt_prog_compiler_static_F77 \
+    lt_prog_compiler_no_builtin_flag_F77 \
+    export_dynamic_flag_spec_F77 \
+    thread_safe_flag_spec_F77 \
+    whole_archive_flag_spec_F77 \
+    enable_shared_with_static_runtimes_F77 \
+    old_archive_cmds_F77 \
+    old_archive_from_new_cmds_F77 \
+    predep_objects_F77 \
+    postdep_objects_F77 \
+    predeps_F77 \
+    postdeps_F77 \
+    compiler_lib_search_path_F77 \
+    archive_cmds_F77 \
+    archive_expsym_cmds_F77 \
+    postinstall_cmds_F77 \
+    postuninstall_cmds_F77 \
+    old_archive_from_expsyms_cmds_F77 \
+    allow_undefined_flag_F77 \
+    no_undefined_flag_F77 \
+    export_symbols_cmds_F77 \
+    hardcode_libdir_flag_spec_F77 \
+    hardcode_libdir_flag_spec_ld_F77 \
+    hardcode_libdir_separator_F77 \
+    hardcode_automatic_F77 \
+    module_cmds_F77 \
+    module_expsym_cmds_F77 \
+    lt_cv_prog_compiler_c_o_F77 \
+    exclude_expsyms_F77 \
+    include_expsyms_F77; do
+
+    case $var in
+    old_archive_cmds_F77 | \
+    old_archive_from_new_cmds_F77 | \
+    archive_cmds_F77 | \
+    archive_expsym_cmds_F77 | \
+    module_cmds_F77 | \
+    module_expsym_cmds_F77 | \
+    old_archive_from_expsyms_cmds_F77 | \
+    export_symbols_cmds_F77 | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_F77
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_F77
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_F77
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_F77"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      GCJ)
+	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+	  
+
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+objext_GCJ=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+compiler_GCJ=$CC
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+archive_cmds_need_lc_GCJ=no
+
+## 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_prog_compiler_no_builtin_flag_GCJ=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+
+  
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl_GCJ=
+lt_prog_compiler_pic_GCJ=
+lt_prog_compiler_static_GCJ=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+ 
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_GCJ='-Wl,'
+    lt_prog_compiler_static_GCJ='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_GCJ='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_GCJ=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_GCJ=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic_GCJ='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_GCJ='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      else
+	lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_GCJ='-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_prog_compiler_pic_GCJ='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    linux*)
+      case $CC in
+      icc* | ecc*)
+	lt_prog_compiler_wl_GCJ='-Wl,'
+	lt_prog_compiler_pic_GCJ='-KPIC'
+	lt_prog_compiler_static_GCJ='-static'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_GCJ='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_GCJ='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic_GCJ='-Kpic'
+      lt_prog_compiler_static_GCJ='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_GCJ='-Qoption ld '
+      lt_prog_compiler_pic_GCJ='-PIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_GCJ='-Kconform_pic'
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_GCJ='-pic'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_GCJ"; then
+  
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_GCJ=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works_GCJ=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
+
+if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+    case $lt_prog_compiler_pic_GCJ in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
+     esac
+else
+    lt_prog_compiler_pic_GCJ=
+     lt_prog_compiler_can_build_shared_GCJ=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_GCJ=
+    ;;
+  *)
+    lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_GCJ=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o_GCJ=yes
+     fi
+   fi
+   chmod u+w .
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag_GCJ=
+  enable_shared_with_static_runtimes_GCJ=no
+  archive_cmds_GCJ=
+  archive_expsym_cmds_GCJ=
+  old_archive_From_new_cmds_GCJ=
+  old_archive_from_expsyms_cmds_GCJ=
+  export_dynamic_flag_spec_GCJ=
+  whole_archive_flag_spec_GCJ=
+  thread_safe_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_ld_GCJ=
+  hardcode_libdir_separator_GCJ=
+  hardcode_direct_GCJ=no
+  hardcode_minus_L_GCJ=no
+  hardcode_shlibpath_var_GCJ=unsupported
+  link_all_deplibs_GCJ=unknown
+  hardcode_automatic_GCJ=no
+  module_cmds_GCJ=
+  module_expsym_cmds_GCJ=
+  always_export_symbols_GCJ=no
+  export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_GCJ=
+  # 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'.
+  exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_GCJ=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_GCJ=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$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)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_GCJ=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_GCJ=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=no
+      enable_shared_with_static_runtimes_GCJ=yes
+      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_GCJ='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_GCJ=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds_GCJ="$tmp_archive_cmds"
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` 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
+      if test $supports_anon_versioning = yes; then
+        archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        archive_expsym_cmds_GCJ="$tmp_archive_cmds"
+      fi
+      link_all_deplibs_GCJ=no
+    else
+      ld_shlibs_GCJ=no
+    fi
+    ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_GCJ" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec_GCJ='${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
+ 	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_GCJ=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=yes
+      archive_expsym_cmds_GCJ='$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.
+      hardcode_minus_L_GCJ=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_GCJ=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_GCJ='$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].*|aix5*)
+	  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.
+
+      archive_cmds_GCJ=''
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_separator_GCJ=':'
+      link_all_deplibs_GCJ=yes
+
+      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
+  	  hardcode_direct_GCJ=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct_GCJ=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
+  	  hardcode_minus_L_GCJ=yes
+  	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
+  	  hardcode_libdir_separator_GCJ=
+	  fi
+	esac
+	shared_flag='-shared'
+      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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_GCJ=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.
+	allow_undefined_flag_GCJ='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_GCJ="-z nodefs"
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec_GCJ='${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.
+	  no_undefined_flag_GCJ=' ${wl}-bernotok'
+	  allow_undefined_flag_GCJ=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols_GCJ=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec_GCJ=' '
+	  archive_cmds_need_lc_GCJ=yes
+	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$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)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_GCJ=no
+      ;;
+
+    bsdi4*)
+      export_dynamic_flag_spec_GCJ=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec_GCJ=' '
+      allow_undefined_flag_GCJ=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.
+      archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_GCJ='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_GCJ=yes
+      ;;
+
+    darwin* | rhapsody*)
+    if test "$GXX" = yes ; then
+      archive_cmds_need_lc_GCJ=no
+      case "$host_os" in
+      rhapsody* | darwin1.[012])
+	allow_undefined_flag_GCJ='-undefined suppress'
+	;;
+      *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	allow_undefined_flag_GCJ='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[012])
+            allow_undefined_flag_GCJ='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            allow_undefined_flag_GCJ='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+	;;
+      esac
+    	lt_int_apple_cc_single_mod=no
+    	output_verbose_link_cmd='echo'
+    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+    	  lt_int_apple_cc_single_mod=yes
+    	fi
+    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+    	  archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+    	else
+        archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -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'
+      fi
+      module_cmds_GCJ='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+          archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        else
+          archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        fi
+          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      hardcode_direct_GCJ=no
+      hardcode_automatic_GCJ=yes
+      hardcode_shlibpath_var_GCJ=unsupported
+      whole_archive_flag_spec_GCJ='-all_load $convenience'
+      link_all_deplibs_GCJ=yes
+    else
+      ld_shlibs_GCJ=no
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_GCJ=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*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu)
+      archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$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
+	archive_cmds_GCJ='$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
+      hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_direct_GCJ=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_GCJ=yes
+      export_dynamic_flag_spec_GCJ='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_GCJ='$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*|ia64*)
+	  archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*)
+	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
+	  hardcode_libdir_separator_GCJ=:
+	  hardcode_direct_GCJ=no
+	  hardcode_shlibpath_var_GCJ=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
+	  hardcode_direct_GCJ=no
+	  hardcode_shlibpath_var_GCJ=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_GCJ=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_GCJ=:
+	  hardcode_direct_GCJ=yes
+	  export_dynamic_flag_spec_GCJ='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_GCJ=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      link_all_deplibs_GCJ=yes
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    newsos6)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_GCJ='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec_GCJ='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      allow_undefined_flag_GCJ=unsupported
+      archive_cmds_GCJ='$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'
+      old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_GCJ=' -expect_unresolved \*'
+	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_GCJ=' -expect_unresolved \*'
+	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag_GCJ=' -z text'
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds_GCJ='$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'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+      esac
+      link_all_deplibs_GCJ=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.
+	archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_GCJ=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_GCJ='$CC -r -o $output$reload_objs'
+	  hardcode_direct_GCJ=no
+        ;;
+	motorola)
+	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_GCJ=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_GCJ=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=no
+      hardcode_shlibpath_var_GCJ=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_GCJ='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag_GCJ=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_GCJ='$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'
+      hardcode_libdir_flag_spec_GCJ=
+      hardcode_shlibpath_var_GCJ=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    *)
+      ld_shlibs_GCJ=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+echo "${ECHO_T}$ld_shlibs_GCJ" >&6
+test "$ld_shlibs_GCJ" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_GCJ" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_GCJ=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_GCJ 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.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_GCJ
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
+        allow_undefined_flag_GCJ=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_GCJ=no
+        else
+	  archive_cmds_need_lc_GCJ=yes
+        fi
+        allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | 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'
+  ;;
+
+netbsdelf*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=yes
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_GCJ=
+if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+   test -n "$runpath_var GCJ" || \
+   test "X$hardcode_automatic_GCJ"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_GCJ" != 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_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
+     test "$hardcode_minus_L_GCJ" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_GCJ=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_GCJ=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_GCJ=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+echo "${ECHO_T}$hardcode_action_GCJ" >&6
+
+if test "$hardcode_action_GCJ" = relink; 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
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+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"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+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"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    ;;
+  esac
+fi
+
+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*)
+    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
+    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    
+fi
+
+   ;;
+
+  *)
+    echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+	      
+fi
+
+	    
+fi
+
+	  
+fi
+
+	
+fi
+
+      
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+    
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+      
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+    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
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_GCJ \
+    CC_GCJ \
+    LD_GCJ \
+    lt_prog_compiler_wl_GCJ \
+    lt_prog_compiler_pic_GCJ \
+    lt_prog_compiler_static_GCJ \
+    lt_prog_compiler_no_builtin_flag_GCJ \
+    export_dynamic_flag_spec_GCJ \
+    thread_safe_flag_spec_GCJ \
+    whole_archive_flag_spec_GCJ \
+    enable_shared_with_static_runtimes_GCJ \
+    old_archive_cmds_GCJ \
+    old_archive_from_new_cmds_GCJ \
+    predep_objects_GCJ \
+    postdep_objects_GCJ \
+    predeps_GCJ \
+    postdeps_GCJ \
+    compiler_lib_search_path_GCJ \
+    archive_cmds_GCJ \
+    archive_expsym_cmds_GCJ \
+    postinstall_cmds_GCJ \
+    postuninstall_cmds_GCJ \
+    old_archive_from_expsyms_cmds_GCJ \
+    allow_undefined_flag_GCJ \
+    no_undefined_flag_GCJ \
+    export_symbols_cmds_GCJ \
+    hardcode_libdir_flag_spec_GCJ \
+    hardcode_libdir_flag_spec_ld_GCJ \
+    hardcode_libdir_separator_GCJ \
+    hardcode_automatic_GCJ \
+    module_cmds_GCJ \
+    module_expsym_cmds_GCJ \
+    lt_cv_prog_compiler_c_o_GCJ \
+    exclude_expsyms_GCJ \
+    include_expsyms_GCJ; do
+
+    case $var in
+    old_archive_cmds_GCJ | \
+    old_archive_from_new_cmds_GCJ | \
+    archive_cmds_GCJ | \
+    archive_expsym_cmds_GCJ | \
+    module_cmds_GCJ | \
+    module_expsym_cmds_GCJ | \
+    old_archive_from_expsyms_cmds_GCJ | \
+    export_symbols_cmds_GCJ | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_GCJ
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_GCJ
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_GCJ
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_GCJ
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_GCJ
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_GCJ
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_GCJ
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_GCJ
+archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_GCJ
+module_expsym_cmds=$lt_module_expsym_cmds_GCJ
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_GCJ
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_GCJ
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_GCJ
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_GCJ
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_GCJ
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_GCJ
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_GCJ
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_GCJ
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_GCJ
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_GCJ"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_GCJ
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_GCJ
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_GCJ
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_GCJ
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      RC)
+	
+
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+objext_RC=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# 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.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+compiler_RC=$CC
+lt_cv_prog_compiler_c_o_RC=yes
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_RC \
+    CC_RC \
+    LD_RC \
+    lt_prog_compiler_wl_RC \
+    lt_prog_compiler_pic_RC \
+    lt_prog_compiler_static_RC \
+    lt_prog_compiler_no_builtin_flag_RC \
+    export_dynamic_flag_spec_RC \
+    thread_safe_flag_spec_RC \
+    whole_archive_flag_spec_RC \
+    enable_shared_with_static_runtimes_RC \
+    old_archive_cmds_RC \
+    old_archive_from_new_cmds_RC \
+    predep_objects_RC \
+    postdep_objects_RC \
+    predeps_RC \
+    postdeps_RC \
+    compiler_lib_search_path_RC \
+    archive_cmds_RC \
+    archive_expsym_cmds_RC \
+    postinstall_cmds_RC \
+    postuninstall_cmds_RC \
+    old_archive_from_expsyms_cmds_RC \
+    allow_undefined_flag_RC \
+    no_undefined_flag_RC \
+    export_symbols_cmds_RC \
+    hardcode_libdir_flag_spec_RC \
+    hardcode_libdir_flag_spec_ld_RC \
+    hardcode_libdir_separator_RC \
+    hardcode_automatic_RC \
+    module_cmds_RC \
+    module_expsym_cmds_RC \
+    lt_cv_prog_compiler_c_o_RC \
+    exclude_expsyms_RC \
+    include_expsyms_RC; do
+
+    case $var in
+    old_archive_cmds_RC | \
+    old_archive_from_new_cmds_RC | \
+    archive_cmds_RC | \
+    archive_expsym_cmds_RC | \
+    module_cmds_RC | \
+    module_expsym_cmds_RC | \
+    old_archive_from_expsyms_cmds_RC | \
+    export_symbols_cmds_RC | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_RC
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_RC
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_RC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_RC
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_RC
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_RC
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_RC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_RC
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_RC
+archive_expsym_cmds=$lt_archive_expsym_cmds_RC
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_RC
+module_expsym_cmds=$lt_module_expsym_cmds_RC
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_RC
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_RC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_RC
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_RC
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_RC
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_RC
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_RC
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_RC
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_RC
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_RC
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_RC"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_RC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_RC
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_RC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_RC
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	;;
+
+      *)
+	{ { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
+echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+	;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
+echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Prevent multiple expansion
+
+
+
+
+
+
+
+
+
+
+
+  
+
+  
+
+
+  
+       
+       
+
+
+if test x$GCC = xyes; then
+    echo "$as_me:$LINENO: checking version 3.x of gcc" >&5
+echo $ECHO_N "checking version 3.x of gcc... $ECHO_C" >&6
+    if test -n "`$CC --version 2>&1|grep '3.'`"; then
+        
+cat >>confdefs.h <<\_ACEOF
+@%:@define EXT_HASH 
+_ACEOF
+
+        echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6;
+    else
+        echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6!
+    fi
+fi
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+
+if test -n "$ac_pt_PKG_CONFIG"; then
+  echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  PKG_CONFIG=$ac_pt_PKG_CONFIG
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.9.0
+	echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+	else
+		echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+		PKG_CONFIG=""
+	fi
+		
+fi
+
+pkg_failed=no
+echo "$as_me:$LINENO: checking for OGRE_CFLAGS" >&5
+echo $ECHO_N "checking for OGRE_CFLAGS... $ECHO_C" >&6
+if test "${pkg_cv_OGRE_CFLAGS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "x$ac_cv_env_OGRE_CFLAGS_set" = "xset"; then
+	pkg_cv_OGRE_CFLAGS=$ac_cv_env_OGRE_CFLAGS_value
+elif test -n "$PKG_CONFIG"; then
+	if { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists \"OGRE\" >/dev/null 2>&1") >&5
+  ($PKG_CONFIG --exists "OGRE" >/dev/null 2>&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+		pkg_cv_OGRE_CFLAGS=`$PKG_CONFIG --cflags "OGRE" 2>/dev/null`
+	else
+		pkg_failed=yes
+	fi
+else
+	pkg_failed=untried
+fi
+fi
+echo "$as_me:$LINENO: result: $pkg_cv_OGRE_CFLAGS" >&5
+echo "${ECHO_T}$pkg_cv_OGRE_CFLAGS" >&6
+echo "$as_me:$LINENO: checking for OGRE_LIBS" >&5
+echo $ECHO_N "checking for OGRE_LIBS... $ECHO_C" >&6
+if test "${pkg_cv_OGRE_LIBS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "x$ac_cv_env_OGRE_LIBS_set" = "xset"; then
+	pkg_cv_OGRE_LIBS=$ac_cv_env_OGRE_LIBS_value
+elif test -n "$PKG_CONFIG"; then
+	if { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists \"OGRE\" >/dev/null 2>&1") >&5
+  ($PKG_CONFIG --exists "OGRE" >/dev/null 2>&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+		pkg_cv_OGRE_LIBS=`$PKG_CONFIG --libs "OGRE" 2>/dev/null`
+	else
+		pkg_failed=yes
+	fi
+else
+	pkg_failed=untried
+fi
+fi
+echo "$as_me:$LINENO: result: $pkg_cv_OGRE_LIBS" >&5
+echo "${ECHO_T}$pkg_cv_OGRE_LIBS" >&6
+
+if test $pkg_failed = yes; then
+	OGRE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "OGRE"`
+	# Put the nasty error message in config.log where it belongs
+	echo "$OGRE_PKG_ERRORS" 1>&5
+
+	{ { echo "$as_me:$LINENO: error: Package requirements (OGRE) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the OGRE_CFLAGS and OGRE_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details." >&5
+echo "$as_me: error: Package requirements (OGRE) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the OGRE_CFLAGS and OGRE_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details." >&2;}
+   { (exit 1); exit 1; }; }
+elif test $pkg_failed = untried; then
+	{ { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively you may set the OGRE_CFLAGS and OGRE_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&5
+echo "$as_me: error: The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively you may set the OGRE_CFLAGS and OGRE_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+	OGRE_CFLAGS=$pkg_cv_OGRE_CFLAGS
+	OGRE_LIBS=$pkg_cv_OGRE_LIBS
+	:
+fi
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for main in -lode" >&5
+echo $ECHO_N "checking for main in -lode... $ECHO_C" >&6
+if test "${ac_cv_lib_ode_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lode  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_ode_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_ode_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ode_main" >&5
+echo "${ECHO_T}$ac_cv_lib_ode_main" >&6
+if test $ac_cv_lib_ode_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBODE 1
+_ACEOF
+
+  LIBS="-lode $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: Can't find libode" >&5
+echo "$as_me: error: Can't find libode" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for pow in -lm" >&5
+echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_pow+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char pow ();
+int
+main ()
+{
+pow ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_pow=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_pow=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5
+echo "${ECHO_T}$ac_cv_lib_m_pow" >&6
+if test $ac_cv_lib_m_pow = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+
+
+echo "$as_me:$LINENO: checking for gzopen in -lz" >&5
+echo $ECHO_N "checking for gzopen in -lz... $ECHO_C" >&6
+if test "${ac_cv_lib_z_gzopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char gzopen ();
+int
+main ()
+{
+gzopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_z_gzopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_z_gzopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzopen" >&5
+echo "${ECHO_T}$ac_cv_lib_z_gzopen" >&6
+if test $ac_cv_lib_z_gzopen = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBZ 1
+_ACEOF
+
+  LIBS="-lz $LIBS"
+
+fi
+
+echo "$as_me:$LINENO: checking for snprintf" >&5
+echo $ECHO_N "checking for snprintf... $ECHO_C" >&6
+if test "${ac_cv_func_snprintf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define snprintf to an innocuous variant, in case <limits.h> declares snprintf.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define snprintf innocuous_snprintf
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char snprintf (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef snprintf
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char snprintf ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_snprintf) || defined (__stub___snprintf)
+choke me
+#else
+char (*f) () = snprintf;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != snprintf;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_snprintf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_snprintf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_snprintf" >&5
+echo "${ECHO_T}$ac_cv_func_snprintf" >&6
+if test $ac_cv_func_snprintf = yes; then
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_SNPRINTF 
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for vsnprintf" >&5
+echo $ECHO_N "checking for vsnprintf... $ECHO_C" >&6
+if test "${ac_cv_func_vsnprintf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define vsnprintf to an innocuous variant, in case <limits.h> declares vsnprintf.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define vsnprintf innocuous_vsnprintf
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char vsnprintf (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef vsnprintf
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char vsnprintf ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_vsnprintf) || defined (__stub___vsnprintf)
+choke me
+#else
+char (*f) () = vsnprintf;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != vsnprintf;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_vsnprintf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_vsnprintf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_vsnprintf" >&5
+echo "${ECHO_T}$ac_cv_func_vsnprintf" >&6
+if test $ac_cv_func_vsnprintf = yes; then
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_VSNPRINTF 
+_ACEOF
+
+fi
+
+
+                                                            ac_config_files="$ac_config_files Makefile ReferenceAppLayer/Makefile ReferenceAppLayer/src/Makefile ReferenceAppLayer/include/Makefile BspCollision/Makefile BspCollision/src/Makefile"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+  (set) 2>&1 |
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+  if test -w $cache_file; then
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[	 ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[	 ]*$//;
+}'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_i=`echo "$ac_i" |
+	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIB@&t@OBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# 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+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.  Logging --version etc. is OK.
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX
+@%:@@%:@ Running $as_me. @%:@@%:@
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by OGRE_REFAPP $as_me 0.10.0, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -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
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+		   instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+		   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+OGRE_REFAPP config.status 0.10.0
+configured by $0, generated by GNU Autoconf 2.59,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  -*)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_option=$1
+     ac_need_defaults=false;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1" ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "ReferenceAppLayer/Makefile" ) CONFIG_FILES="$CONFIG_FILES ReferenceAppLayer/Makefile" ;;
+  "ReferenceAppLayer/src/Makefile" ) CONFIG_FILES="$CONFIG_FILES ReferenceAppLayer/src/Makefile" ;;
+  "ReferenceAppLayer/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES ReferenceAppLayer/include/Makefile" ;;
+  "BspCollision/Makefile" ) CONFIG_FILES="$CONFIG_FILES BspCollision/Makefile" ;;
+  "BspCollision/src/Makefile" ) CONFIG_FILES="$CONFIG_FILES BspCollision/src/Makefile" ;;
+  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+  "ReferenceAppLayer/include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ReferenceAppLayer/include/config.h" ;;
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./confstat$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@CYGPATH_W@,$CYGPATH_W,;t t
+s,@PACKAGE@,$PACKAGE,;t t
+s,@VERSION@,$VERSION,;t t
+s,@ACLOCAL@,$ACLOCAL,;t t
+s,@AUTOCONF@,$AUTOCONF,;t t
+s,@AUTOMAKE@,$AUTOMAKE,;t t
+s,@AUTOHEADER@,$AUTOHEADER,;t t
+s,@MAKEINFO@,$MAKEINFO,;t t
+s,@install_sh@,$install_sh,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s,@mkdir_p@,$mkdir_p,;t t
+s,@AWK@,$AWK,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@am__leading_dot@,$am__leading_dot,;t t
+s,@AMTAR@,$AMTAR,;t t
+s,@am__tar@,$am__tar,;t t
+s,@am__untar@,$am__untar,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@target@,$target,;t t
+s,@target_cpu@,$target_cpu,;t t
+s,@target_vendor@,$target_vendor,;t t
+s,@target_os@,$target_os,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@DEPDIR@,$DEPDIR,;t t
+s,@am__include@,$am__include,;t t
+s,@am__quote@,$am__quote,;t t
+s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s,@CCDEPMODE@,$CCDEPMODE,;t t
+s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@CXX@,$CXX,;t t
+s,@CXXFLAGS@,$CXXFLAGS,;t t
+s,@ac_ct_CXX@,$ac_ct_CXX,;t t
+s,@CXXDEPMODE@,$CXXDEPMODE,;t t
+s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t
+s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t
+s,@EGREP@,$EGREP,;t t
+s,@LN_S@,$LN_S,;t t
+s,@ECHO@,$ECHO,;t t
+s,@AR@,$AR,;t t
+s,@ac_ct_AR@,$ac_ct_AR,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@CPP@,$CPP,;t t
+s,@CXXCPP@,$CXXCPP,;t t
+s,@F77@,$F77,;t t
+s,@FFLAGS@,$FFLAGS,;t t
+s,@ac_ct_F77@,$ac_ct_F77,;t t
+s,@LIBTOOL@,$LIBTOOL,;t t
+s,@PKG_CONFIG@,$PKG_CONFIG,;t t
+s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
+s,@OGRE_CFLAGS@,$OGRE_CFLAGS,;t t
+s,@OGRE_LIBS@,$OGRE_LIBS,;t t
+s,@LIB@&t@OBJS@,$LIB@&t@OBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+  cat >>$CONFIG_STATUS <<\_ACEOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+  esac
+
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    configure_input=
+  else
+    configure_input="$ac_file.  "
+  fi
+  configure_input=$configure_input"Generated from `echo $ac_file_in |
+				     sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
+ac_dB='[	 ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 # Do quote $f, to prevent DOS paths from being IFS'd.
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+  # Remove the trailing spaces.
+  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h.  The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status.  Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless.  Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo '  :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+  # Write a limited-size here document to $tmp/defines.sed.
+  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#define' lines.
+  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/defines.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo '  fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+  # Write a limited-size here document to $tmp/undefs.sed.
+  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#undef'
+  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+  rm -f conftest.undefs
+  mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    echo "/* Generated by configure.  */" >$tmp/config.h
+  else
+    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
+  fi
+  cat $tmp/in >>$tmp/config.h
+  rm -f $tmp/in
+  if test x"$ac_file" != x-; then
+    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+      { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+      rm -f $ac_file
+      mv $tmp/config.h $ac_file
+    fi
+  else
+    cat $tmp/config.h
+    rm -f $tmp/config.h
+  fi
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $ac_file | $ac_file:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X$ac_file : 'X\(//\)[^/]' \| \
+	 X$ac_file : 'X\(//\)$' \| \
+	 X$ac_file : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`/stamp-h$_am_stamp_count
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_dest" : 'X\(//\)[^/]' \| \
+	 X"$ac_dest" : 'X\(//\)$' \| \
+	 X"$ac_dest" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+  case $ac_dest in
+    depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    { if $as_mkdir_p; then
+    mkdir -p $dirpart/$fdir
+  else
+    as_dir=$dirpart/$fdir
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+  esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+
Index: /ReferenceApplication/autom4te.cache/output.1
===================================================================
--- /ReferenceApplication/autom4te.cache/output.1	(revision 5)
+++ /ReferenceApplication/autom4te.cache/output.1	(revision 5)
@@ -0,0 +1,21259 @@
+@%:@! /bin/sh
+@%:@ Guess values for system-dependent variables and create Makefiles.
+@%:@ Generated by GNU Autoconf 2.59 for OGRE_REFAPP 0.10.0.
+@%:@ 
+@%:@ Copyright (C) 2003 Free Software Foundation, Inc.
+@%:@ This configure script is free software; the Free Software Foundation
+@%:@ gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be 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+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+  ;;
+esac
+
+echo=${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 <<EOF
+$*
+EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$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 &&
+       echo_test_string="`eval $cmd`" &&
+       (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.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+tagnames=${tagnames+${tagnames},}CXX
+
+tagnames=${tagnames+${tagnames},}F77
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME='OGRE_REFAPP'
+PACKAGE_TARNAME='ogre_refapp'
+PACKAGE_VERSION='0.10.0'
+PACKAGE_STRING='OGRE_REFAPP 0.10.0'
+PACKAGE_BUGREPORT=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+#  include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PKG_CONFIG ac_pt_PKG_CONFIG OGRE_CFLAGS OGRE_LIBS LIB@&t@OBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_option in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_$ac_feature='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_$ac_package='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+	      localstatedir libdir includedir oldincludedir infodir mandir
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
+  else
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+  fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CXX_set=${CXX+set}
+ac_env_CXX_value=$CXX
+ac_cv_env_CXX_set=${CXX+set}
+ac_cv_env_CXX_value=$CXX
+ac_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_env_CXXFLAGS_value=$CXXFLAGS
+ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_cv_env_CXXFLAGS_value=$CXXFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+ac_env_CXXCPP_set=${CXXCPP+set}
+ac_env_CXXCPP_value=$CXXCPP
+ac_cv_env_CXXCPP_set=${CXXCPP+set}
+ac_cv_env_CXXCPP_value=$CXXCPP
+ac_env_F77_set=${F77+set}
+ac_env_F77_value=$F77
+ac_cv_env_F77_set=${F77+set}
+ac_cv_env_F77_value=$F77
+ac_env_FFLAGS_set=${FFLAGS+set}
+ac_env_FFLAGS_value=$FFLAGS
+ac_cv_env_FFLAGS_set=${FFLAGS+set}
+ac_cv_env_FFLAGS_value=$FFLAGS
+ac_env_PKG_CONFIG_set=${PKG_CONFIG+set}
+ac_env_PKG_CONFIG_value=$PKG_CONFIG
+ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set}
+ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG
+ac_env_OGRE_CFLAGS_set=${OGRE_CFLAGS+set}
+ac_env_OGRE_CFLAGS_value=$OGRE_CFLAGS
+ac_cv_env_OGRE_CFLAGS_set=${OGRE_CFLAGS+set}
+ac_cv_env_OGRE_CFLAGS_value=$OGRE_CFLAGS
+ac_env_OGRE_LIBS_set=${OGRE_LIBS+set}
+ac_env_OGRE_LIBS_value=$OGRE_LIBS
+ac_cv_env_OGRE_LIBS_set=${OGRE_LIBS+set}
+ac_cv_env_OGRE_LIBS_value=$OGRE_LIBS
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures OGRE_REFAPP 0.10.0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+			  [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+			  [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --infodir=DIR          info documentation [PREFIX/info]
+  --mandir=DIR           man documentation [PREFIX/man]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of OGRE_REFAPP 0.10.0:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-shared@<:@=PKGS@:>@ 
+                          build shared libraries @<:@default=yes@:>@
+  --enable-static@<:@=PKGS@:>@ 
+                          build static libraries @<:@default=yes@:>@
+  --enable-fast-install@<:@=PKGS@:>@ 
+                          optimize for fast installation @<:@default=yes@:>@
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-gnu-ld           assume the C compiler uses GNU ld @<:@default=no@:>@
+  --with-pic              try to use only PIC/non-PIC objects @<:@default=use
+                          both@:>@
+  --with-tags@<:@=TAGS@:>@ 
+                          include additional configurations @<:@automatic@:>@
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  CPP         C preprocessor
+  CXXCPP      C++ preprocessor
+  F77         Fortran 77 compiler command
+  FFLAGS      Fortran 77 compiler flags
+  PKG_CONFIG  path to pkg-config utility
+  OGRE_CFLAGS C compiler flags for OGRE, overriding pkg-config
+  OGRE_LIBS   linker flags for OGRE, overriding pkg-config
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+	   test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi
+    cd "$ac_popdir"
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\_ACEOF
+OGRE_REFAPP configure 0.10.0
+generated by GNU Autoconf 2.59
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by OGRE_REFAPP $as_me 0.10.0, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+@%:@@%:@ --------- @%:@@%:@
+@%:@@%:@ Platform. @%:@@%:@
+@%:@@%:@ --------- @%:@@%:@
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ Core tests. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+@%:@@%:@ ---------------- @%:@@%:@
+@%:@@%:@ Cache variables. @%:@@%:@
+@%:@@%:@ ---------------- @%:@@%:@
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+}
+    echo
+
+    cat <<\_ASBOX
+@%:@@%:@ ----------------- @%:@@%:@
+@%:@@%:@ Output variables. @%:@@%:@
+@%:@@%:@ ----------------- @%:@@%:@
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+@%:@@%:@ ------------- @%:@@%:@
+@%:@@%:@ Output files. @%:@@%:@
+@%:@@%:@ ------------- @%:@@%:@
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=$`echo $ac_var`
+	echo "$ac_var='"'"'$ac_val'"'"'"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ confdefs.h. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+_ASBOX
+      echo
+      sed "/^$/d" confdefs.h | sort
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core &&
+  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
+    esac
+  fi
+else
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+am__api_version="1.9"
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $.  echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AWK="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+all:
+	@echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+  SET_MAKE=
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='ogre_refapp'
+ VERSION='0.10.0'
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE "$PACKAGE"
+_ACEOF
+
+ 
+cat >>confdefs.h <<_ACEOF
+@%:@define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  STRIP=$ac_ct_STRIP
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+          ac_config_headers="$ac_config_headers ReferenceAppLayer/include/config.h"
+
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+  ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+  ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+  ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $@%:@ != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CC" && break
+done
+
+  CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Find the output, starting from the most likely.  This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+	;;
+    conftest.$ac_ext )
+	# This is the source file.
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	# FIXME: I believe we export ac_cv_exeext for Libtool,
+	# but it would be cool to find out if it's true.  Does anybody
+	# maintain Libtool? --akim.
+	export ac_cv_exeext
+	break;;
+    * )
+	break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  export ac_cv_exeext
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std1 is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std1.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext 
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+@%:@ifndef __cplusplus
+  choke me
+@%:@endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+@%:@include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+          ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval="$enable_dependency_tracking"
+  
+fi; 
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+ 
+
+if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC"   am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ 
+
+if 
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CXX" && break
+done
+test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
+
+  CXX=$ac_ct_CXX
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cxx_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+@%:@include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX"  am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ 
+
+if 
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval="$enable_shared"
+  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
+else
+  enable_shared=yes
+fi; 
+
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval="$enable_static"
+  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
+else
+  enable_static=yes
+fi; 
+
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval="$enable_fast_install"
+  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
+else
+  enable_fast_install=yes
+fi; 
+
+echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
+if test "${lt_cv_path_SED+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # 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
+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 && break
+  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
+
+fi
+
+echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+ 
+
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval="$with_gnu_ld"
+  test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi; 
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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 GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+
+echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
+if test "${lt_cv_path_NM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm="$ac_dir/${ac_tool_prefix}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"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+echo "${ECHO_T}$lt_cv_path_NM" >&6
+NM="$lt_cv_path_NM"
+
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
+echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
+echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi4*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu)
+  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)/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
+  ;;
+
+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*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+  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=unknown
+  ;;
+
+openbsd*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+  else
+    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  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
+    ;;
+  esac
+  ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
+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
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+  
+fi; 
+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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case "`/usr/bin/file conftest.o`" in
+    *32-bit*)
+      case $host in
+        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-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          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"
+  echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  lt_cv_cc_needs_belf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+lt_cv_cc_needs_belf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
+  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
+  ;;
+
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+  
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ 
+fi
+
+done
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+@%:@@%:@ -------------------------------------- @%:@@%:@
+@%:@@%:@ Report this to the OGRE_REFAPP lists.  @%:@@%:@
+@%:@@%:@ -------------------------------------- @%:@@%:@
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ 
+fi
+
+done
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
+if test -z "$CXXCPP"; then
+  if test "${ac_cv_prog_CXXCPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+  
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  echo "$as_me:$LINENO: result: $F77" >&5
+echo "${ECHO_T}$F77" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$F77" && break
+  done
+fi
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_F77="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+echo "${ECHO_T}$ac_ct_F77" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_F77" && break
+done
+
+  F77=$ac_ct_F77
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:__oline__:" \
+     "checking for Fortran 77 compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_f77_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_f77_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_f77_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+echo "${ECHO_T}$ac_cv_prog_f77_g" >&6
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
+
+G77=`test $ac_compiler_gnu = yes && echo yes`
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+
+# find the maximum length of command line arguments
+echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    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*)
+    # 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;
+    ;;
+
+  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;
+    ;;
+
+ *)
+    # 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"`$CONFIG_SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+	       = "XX$teststring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
+	    lt_cv_sys_max_cmd_len=$new_result &&
+	    test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    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`
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
+else
+  echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6
+fi
+
+
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  
+# 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]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris* | sysv5*)
+  symcode='[BDRT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# 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
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Write the raw and C identifiers.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && 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 <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+	  cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+	  cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+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_prog_compiler_no_builtin_flag"
+	  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && 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" >&5
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -f 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
+
+fi
+
+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
+  echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+else
+  echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+fi
+
+echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6
+if test "${lt_cv_objdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+fi
+echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+echo "${ECHO_T}$lt_cv_objdir" >&6
+objdir=$lt_cv_objdir
+
+
+
+
+
+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.
+Xsed='sed -e s/^X//'
+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 avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false"
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  AR=$ac_ct_AR
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  RANLIB=$ac_ct_RANLIB
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  STRIP=$ac_ct_STRIP
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      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 <<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
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      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 <<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
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+enable_dlopen=no
+enable_win32_dll=no
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+  
+fi; 
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+  withval="$with_pic"
+  pic_mode="$withval"
+else
+  pic_mode=default
+fi; 
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+#
+# Check for any special shared library compilation flags.
+#
+lt_prog_cc_shlib=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    lt_prog_cc_shlib='-belf'
+    ;;
+  esac
+fi
+if test -n "$lt_prog_cc_shlib"; then
+  { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5
+echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;}
+  if echo "$old_CC $old_CFLAGS " | grep "[ 	]$lt_prog_cc_shlib[ 	]" >/dev/null; then :
+  else
+    { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
+echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
+    lt_cv_prog_cc_can_build_shared=no
+  fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The compiler 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>&5
+     else
+       lt_prog_compiler_static_works=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
+
+if test x"$lt_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+  
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+ 
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      else
+	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-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_prog_compiler_pic='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    linux*)
+      case $CC in
+      icc* | ecc*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-KPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic='-Kpic'
+      lt_prog_compiler_static='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic='-Kconform_pic'
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+  
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
+
+if test x"$lt_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w .
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag=
+  enable_shared_with_static_runtimes=no
+  archive_cmds=
+  archive_expsym_cmds=
+  old_archive_From_new_cmds=
+  old_archive_from_expsyms_cmds=
+  export_dynamic_flag_spec=
+  whole_archive_flag_spec=
+  thread_safe_flag_spec=
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_flag_spec_ld=
+  hardcode_libdir_separator=
+  hardcode_direct=no
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  link_all_deplibs=unknown
+  hardcode_automatic=no
+  module_cmds=
+  module_expsym_cmds=
+  always_export_symbols=no
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # 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'.
+  exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$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)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds="$tmp_archive_cmds"
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` 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
+      if test $supports_anon_versioning = yes; then
+        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        archive_expsym_cmds="$tmp_archive_cmds"
+      fi
+      link_all_deplibs=no
+    else
+      ld_shlibs=no
+    fi
+    ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec='${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
+ 	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$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.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds='$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].*|aix5*)
+	  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.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+
+      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
+  	  hardcode_direct=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct=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
+  	  hardcode_minus_L=yes
+  	  hardcode_libdir_flag_spec='-L$libdir'
+  	  hardcode_libdir_separator=
+	  fi
+	esac
+	shared_flag='-shared'
+      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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=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.
+	allow_undefined_flag='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag="-z nodefs"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec='${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.
+	  no_undefined_flag=' ${wl}-bernotok'
+	  allow_undefined_flag=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec=' '
+	  archive_cmds_need_lc=yes
+	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$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)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs=no
+      ;;
+
+    bsdi4*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec=' '
+      allow_undefined_flag=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.
+      archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    darwin* | rhapsody*)
+    if test "$GXX" = yes ; then
+      archive_cmds_need_lc=no
+      case "$host_os" in
+      rhapsody* | darwin1.[012])
+	allow_undefined_flag='-undefined suppress'
+	;;
+      *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	allow_undefined_flag='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[012])
+            allow_undefined_flag='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            allow_undefined_flag='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+	;;
+      esac
+    	lt_int_apple_cc_single_mod=no
+    	output_verbose_link_cmd='echo'
+    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+    	  lt_int_apple_cc_single_mod=yes
+    	fi
+    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+    	  archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+    	else
+        archive_cmds='$CC -r ${wl}-bind_at_load -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'
+      fi
+      module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+          archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        else
+          archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        fi
+          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      hardcode_direct=no
+      hardcode_automatic=yes
+      hardcode_shlibpath_var=unsupported
+      whole_archive_flag_spec='-all_load $convenience'
+      link_all_deplibs=yes
+    else
+      ld_shlibs=no
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs=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*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu)
+      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds='$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
+	archive_cmds='$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
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds='$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*|ia64*)
+	  archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*)
+	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld='+b $libdir'
+	  hardcode_libdir_separator=:
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec='-L$libdir'
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator=:
+	  hardcode_direct=yes
+	  export_dynamic_flag_spec='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      link_all_deplibs=yes
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    openbsd*)
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$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'
+      old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      hardcode_libdir_separator=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z text'
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds='$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'
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+      esac
+      link_all_deplibs=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.
+	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds='$CC -r -o $output$reload_objs'
+	  hardcode_direct=no
+        ;;
+	motorola)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=no
+      hardcode_shlibpath_var=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds='$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'
+      hardcode_libdir_flag_spec=
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+echo "${ECHO_T}$ld_shlibs" >&6
+test "$ld_shlibs" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds 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.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag
+        allow_undefined_flag=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc=no
+        else
+	  archive_cmds_need_lc=yes
+        fi
+        allow_undefined_flag=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+echo "${ECHO_T}$archive_cmds_need_lc" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | 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'
+  ;;
+
+netbsdelf*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=yes
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+   test -n "$runpath_var " || \
+   test "X$hardcode_automatic"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct" != 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_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action" >&5
+echo "${ECHO_T}$hardcode_action" >&6
+
+if test "$hardcode_action" = relink; 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
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+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"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+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"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    ;;
+  esac
+fi
+
+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*)
+    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
+    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    
+fi
+
+   ;;
+
+  *)
+    echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+	      
+fi
+
+	    
+fi
+
+	  
+fi
+
+	
+fi
+
+      
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+    
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+      
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+    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
+
+
+# Report which librarie types wil actually be built
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+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
+  ;;
+
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+  darwin* | rhapsody*)
+  if test "$GCC" = yes; then
+    archive_cmds_need_lc=no
+    case "$host_os" in
+    rhapsody* | darwin1.[012])
+      allow_undefined_flag='-undefined suppress'
+      ;;
+    *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	allow_undefined_flag='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[012])
+            allow_undefined_flag='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            allow_undefined_flag='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+      ;;
+    esac
+    output_verbose_link_cmd='echo'
+    archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
+    module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+    archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    hardcode_direct=no
+    hardcode_automatic=yes
+    hardcode_shlibpath_var=unsupported
+    whole_archive_flag_spec='-all_load $convenience'
+    link_all_deplibs=yes
+  else
+    ld_shlibs=no
+  fi
+    ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler \
+    CC \
+    LD \
+    lt_prog_compiler_wl \
+    lt_prog_compiler_pic \
+    lt_prog_compiler_static \
+    lt_prog_compiler_no_builtin_flag \
+    export_dynamic_flag_spec \
+    thread_safe_flag_spec \
+    whole_archive_flag_spec \
+    enable_shared_with_static_runtimes \
+    old_archive_cmds \
+    old_archive_from_new_cmds \
+    predep_objects \
+    postdep_objects \
+    predeps \
+    postdeps \
+    compiler_lib_search_path \
+    archive_cmds \
+    archive_expsym_cmds \
+    postinstall_cmds \
+    postuninstall_cmds \
+    old_archive_from_expsyms_cmds \
+    allow_undefined_flag \
+    no_undefined_flag \
+    export_symbols_cmds \
+    hardcode_libdir_flag_spec \
+    hardcode_libdir_flag_spec_ld \
+    hardcode_libdir_separator \
+    hardcode_automatic \
+    module_cmds \
+    module_expsym_cmds \
+    lt_cv_prog_compiler_c_o \
+    exclude_expsyms \
+    include_expsyms; do
+
+    case $var in
+    old_archive_cmds | \
+    old_archive_from_new_cmds | \
+    archive_cmds | \
+    archive_expsym_cmds | \
+    module_cmds | \
+    module_expsym_cmds | \
+    old_archive_from_expsyms_cmds | \
+    export_symbols_cmds | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  { echo "$as_me:$LINENO: creating $ofile" >&5
+echo "$as_me: creating $ofile" >&6;}
+
+  cat <<__EOF__ >> "$cfgfile"
+#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+
+  case $host_os in
+  aix3*)
+    cat <<\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
+EOF
+    ;;
+  esac
+
+  # 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 '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+# Check whether --with-tags or --without-tags was given.
+if test "${with_tags+set}" = set; then
+  withval="$with_tags"
+  tagnames="$withval"
+fi; 
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
+    else
+      { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
+echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
+    fi
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
+    "") ;;
+    *)  { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
+echo "$as_me: error: invalid tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+	;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
+echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      CXX)
+	if test -n "$CXX" && test "X$CXX" != "Xno"; then
+	  ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# 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
+  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
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+  lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+  
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval="$with_gnu_ld"
+  test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi; 
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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 GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_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
+    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_CXX='${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
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_CXX=
+    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.
+    archive_cmds_CXX='$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
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+ld_shlibs_CXX=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  aix4* | aix5*)
+    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].*|aix5*)
+	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.
+
+    archive_cmds_CXX=''
+    hardcode_direct_CXX=yes
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+
+    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
+	  hardcode_direct_CXX=yes
+	else
+	  # We have old collect2
+	  hardcode_direct_CXX=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
+	  hardcode_minus_L_CXX=yes
+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
+	  hardcode_libdir_separator_CXX=
+	fi
+      esac
+      shared_flag='-shared'
+    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
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    always_export_symbols_CXX=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.
+      allow_undefined_flag_CXX='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+	allow_undefined_flag_CXX="-z nodefs"
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	hardcode_libdir_flag_spec_CXX='${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.
+	no_undefined_flag_CXX=' ${wl}-bernotok'
+	allow_undefined_flag_CXX=' ${wl}-berok'
+	# -bexpall does not export symbols beginning with underscore (_)
+	always_export_symbols_CXX=yes
+	# Exported symbols can be pulled into shared objects from archives
+	whole_archive_flag_spec_CXX=' '
+	archive_cmds_need_lc_CXX=yes
+	# This is similar to how AIX traditionally builds it's shared libraries.
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+    # as there is no search path for DLLs.
+    hardcode_libdir_flag_spec_CXX='-L$libdir'
+    allow_undefined_flag_CXX=unsupported
+    always_export_symbols_CXX=no
+    enable_shared_with_static_runtimes_CXX=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      archive_expsym_cmds_CXX='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}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+  ;;
+
+  darwin* | rhapsody*)
+  if test "$GXX" = yes; then
+    archive_cmds_need_lc_CXX=no
+    case "$host_os" in
+    rhapsody* | darwin1.[012])
+      allow_undefined_flag_CXX='-undefined suppress'
+      ;;
+    *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	allow_undefined_flag_CXX='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[012])
+            allow_undefined_flag_CXX='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            allow_undefined_flag_CXX='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+      ;;
+    esac
+    lt_int_apple_cc_single_mod=no
+    output_verbose_link_cmd='echo'
+    if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+      lt_int_apple_cc_single_mod=yes
+    fi
+    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+      archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+    else
+      archive_cmds_CXX='$CC -r ${wl}-bind_at_load -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'
+    fi
+    module_cmds_CXX='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+
+    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+      archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    hardcode_direct_CXX=no
+    hardcode_automatic_CXX=yes
+    hardcode_shlibpath_var_CXX=unsupported
+    whole_archive_flag_spec_CXX='-all_load $convenience'
+    link_all_deplibs_CXX=yes
+  else
+    ld_shlibs_CXX=no
+  fi
+    ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      ghcx)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  freebsd12*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    ld_shlibs_CXX=no
+    ;;
+  freebsd-elf*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  freebsd* | kfreebsd*-gnu)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    ld_shlibs_CXX=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    hardcode_direct_CXX=yes
+    hardcode_minus_L_CXX=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
+      ld_shlibs_CXX=no
+      ;;
+    aCC)
+      archive_cmds_CXX='$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) | grep "-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        archive_cmds_CXX='$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
+        ld_shlibs_CXX=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case "$host_cpu" in
+      hppa*64*)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+	hardcode_libdir_separator_CXX=:
+        ;;
+      ia64*)
+	hardcode_libdir_flag_spec_CXX='-L$libdir'
+        ;;
+      *)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+	export_dynamic_flag_spec_CXX='${wl}-E'
+        ;;
+      esac
+    fi
+    case "$host_cpu" in
+    hppa*64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      ;;
+    ia64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      hardcode_minus_L_CXX=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    *)
+      hardcode_direct_CXX=yes
+      hardcode_minus_L_CXX=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
+	ld_shlibs_CXX=no
+	;;
+      aCC)
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  archive_cmds_CXX='$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 $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case "$host_cpu" in
+	    ia64*|hppa*64*)
+	      archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	      ;;
+	    *)
+	      archive_cmds_CXX='$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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC)
+	# SGI C++
+	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${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.
+	old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test "$with_gnu_ld" = no; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+	  else
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	link_all_deplibs_CXX=yes
+	;;
+    esac
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    ;;
+  linux*)
+    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.
+	archive_cmds_CXX='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'
+	archive_expsym_cmds_CXX='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 $list'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc)
+	# Intel C++
+	with_gnu_ld=yes
+	archive_cmds_need_lc_CXX=no
+	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      cxx)
+	# Compaq C++
+	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_CXX='$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
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      hardcode_libdir_flag_spec_CXX='-R$libdir'
+      hardcode_direct_CXX=yes
+      hardcode_shlibpath_var_CXX=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::"'
+    ;;
+  osf3*)
+    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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx)
+	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+	;;
+      RCC)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx)
+	allow_undefined_flag_CXX=' -expect_unresolved \*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+	archive_expsym_cmds_CXX='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 -set_version	$verstring` -update_registry $objdir/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	 archive_cmds_CXX='$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` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  sco*)
+    archive_cmds_need_lc_CXX=no
+    case $cc_basename in
+      CC)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      lcc)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC)
+	# Sun C++ 4.2, 5.x and Centerline C++
+	no_undefined_flag_CXX=' -zdefs'
+	archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+	hardcode_libdir_flag_spec_CXX='-R$libdir'
+	hardcode_shlibpath_var_CXX=no
+	case $host_os in
+	  solaris2.0-5 | solaris2.0-5.*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	link_all_deplibs_CXX=yes
+
+	# 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 -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+	# 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.
+	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx)
+	# Green Hills C++ Compiler
+	archive_cmds_CXX='$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.
+	old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	;;
+      *)
+	# GNU C++ compiler with Solaris linker
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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.
+	    archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+esac
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$LD"
+
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+  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 "$compiler_lib_search_path_CXX"; then
+	     compiler_lib_search_path_CXX="${prev}${p}"
+	   else
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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 "$postdeps_CXX"; then
+	   postdeps_CXX="${prev}${p}"
+	 else
+	   postdeps_CXX="${postdeps_CXX} ${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 "$predep_objects_CXX"; then
+	   predep_objects_CXX="$p"
+	 else
+	   predep_objects_CXX="$predep_objects_CXX $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_CXX"; then
+	   postdep_objects_CXX="$p"
+	 else
+	   postdep_objects_CXX="$postdep_objects_CXX $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+ 
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # 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_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # 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).
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # 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*)
+	;;
+      *)
+	lt_prog_compiler_pic_CXX='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  lt_prog_compiler_static_CXX='-Bstatic'
+	else
+	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  ghcx)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    if test "$host_cpu" != ia64; then
+	      lt_prog_compiler_pic_CXX='+Z'
+	    fi
+	    ;;
+	  aCC)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    case "$host_cpu" in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      lt_prog_compiler_pic_CXX='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC)
+	    # KAI C++ Compiler
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  icpc)
+	    # Intel C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  cxx)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx)
+	    lt_prog_compiler_pic_CXX='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC)
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    ;;
+	  RCC)
+	    # Rational C++ 2.4.1
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  cxx)
+	    # Digital/Compaq C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      sco*)
+	case $cc_basename in
+	  CC)
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    lt_prog_compiler_wl_CXX='-Qoption ld '
+	    ;;
+	  gcx)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC)
+	    # Sun C++ 4.x
+	    lt_prog_compiler_pic_CXX='-pic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  lcc)
+	    # Lucid
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC)
+	    # NonStop-UX NCC 3.20
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      unixware*)
+	;;
+      vxworks*)
+	;;
+      *)
+	lt_prog_compiler_can_build_shared_CXX=no
+	;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+  
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_CXX=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w .
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # 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
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  linux*)
+    link_all_deplibs_CXX=no
+  ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX 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.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_CXX
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+        allow_undefined_flag_CXX=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_CXX=no
+        else
+	  archive_cmds_need_lc_CXX=yes
+        fi
+        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | 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'
+  ;;
+
+netbsdelf*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=yes
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+   test -n "$runpath_var CXX" || \
+   test "X$hardcode_automatic_CXX"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_CXX" != 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_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6
+
+if test "$hardcode_action_CXX" = relink; 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
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+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"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+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"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    ;;
+  esac
+fi
+
+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*)
+    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
+    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    
+fi
+
+   ;;
+
+  *)
+    echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+	      
+fi
+
+	    
+fi
+
+	  
+fi
+
+	
+fi
+
+      
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+    
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+      
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+    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
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_CXX \
+    CC_CXX \
+    LD_CXX \
+    lt_prog_compiler_wl_CXX \
+    lt_prog_compiler_pic_CXX \
+    lt_prog_compiler_static_CXX \
+    lt_prog_compiler_no_builtin_flag_CXX \
+    export_dynamic_flag_spec_CXX \
+    thread_safe_flag_spec_CXX \
+    whole_archive_flag_spec_CXX \
+    enable_shared_with_static_runtimes_CXX \
+    old_archive_cmds_CXX \
+    old_archive_from_new_cmds_CXX \
+    predep_objects_CXX \
+    postdep_objects_CXX \
+    predeps_CXX \
+    postdeps_CXX \
+    compiler_lib_search_path_CXX \
+    archive_cmds_CXX \
+    archive_expsym_cmds_CXX \
+    postinstall_cmds_CXX \
+    postuninstall_cmds_CXX \
+    old_archive_from_expsyms_cmds_CXX \
+    allow_undefined_flag_CXX \
+    no_undefined_flag_CXX \
+    export_symbols_cmds_CXX \
+    hardcode_libdir_flag_spec_CXX \
+    hardcode_libdir_flag_spec_ld_CXX \
+    hardcode_libdir_separator_CXX \
+    hardcode_automatic_CXX \
+    module_cmds_CXX \
+    module_expsym_cmds_CXX \
+    lt_cv_prog_compiler_c_o_CXX \
+    exclude_expsyms_CXX \
+    include_expsyms_CXX; do
+
+    case $var in
+    old_archive_cmds_CXX | \
+    old_archive_from_new_cmds_CXX | \
+    archive_cmds_CXX | \
+    archive_expsym_cmds_CXX | \
+    module_cmds_CXX | \
+    module_expsym_cmds_CXX | \
+    old_archive_from_expsyms_cmds_CXX | \
+    export_symbols_cmds_CXX | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+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
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      F77)
+	if test -n "$F77" && test "X$F77" != "Xno"; then
+	  
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+compiler_F77=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+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
+  ;;
+aix4* | aix5*)
+  test "$enable_shared" = yes && enable_static=no
+  ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+GCC_F77="$G77"
+LD_F77="$LD"
+
+lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+ 
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_F77='-Wl,'
+    lt_prog_compiler_static_F77='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_F77='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_F77=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_F77=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic_F77='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_F77='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      else
+	lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_F77='-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_prog_compiler_pic_F77='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    linux*)
+      case $CC in
+      icc* | ecc*)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-KPIC'
+	lt_prog_compiler_static_F77='-static'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_F77='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_F77='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic_F77='-Kpic'
+      lt_prog_compiler_static_F77='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_F77='-Qoption ld '
+      lt_prog_compiler_pic_F77='-PIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_F77='-Kconform_pic'
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_F77='-pic'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+  
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_F77=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_F77"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works_F77=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
+
+if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+    case $lt_prog_compiler_pic_F77 in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+     esac
+else
+    lt_prog_compiler_pic_F77=
+     lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_F77=
+    ;;
+  *)
+    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_F77=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o_F77=yes
+     fi
+   fi
+   chmod u+w .
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag_F77=
+  enable_shared_with_static_runtimes_F77=no
+  archive_cmds_F77=
+  archive_expsym_cmds_F77=
+  old_archive_From_new_cmds_F77=
+  old_archive_from_expsyms_cmds_F77=
+  export_dynamic_flag_spec_F77=
+  whole_archive_flag_spec_F77=
+  thread_safe_flag_spec_F77=
+  hardcode_libdir_flag_spec_F77=
+  hardcode_libdir_flag_spec_ld_F77=
+  hardcode_libdir_separator_F77=
+  hardcode_direct_F77=no
+  hardcode_minus_L_F77=no
+  hardcode_shlibpath_var_F77=unsupported
+  link_all_deplibs_F77=unknown
+  hardcode_automatic_F77=no
+  module_cmds_F77=
+  module_expsym_cmds_F77=
+  always_export_symbols_F77=no
+  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_F77=
+  # 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'.
+  exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_F77=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_F77=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$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)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_F77=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_F77=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=no
+      enable_shared_with_static_runtimes_F77=yes
+      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_F77='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_F77=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds_F77="$tmp_archive_cmds"
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` 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
+      if test $supports_anon_versioning = yes; then
+        archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        archive_expsym_cmds_F77="$tmp_archive_cmds"
+      fi
+      link_all_deplibs_F77=no
+    else
+      ld_shlibs_F77=no
+    fi
+    ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_F77" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec_F77='${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
+ 	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_F77=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=yes
+      archive_expsym_cmds_F77='$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.
+      hardcode_minus_L_F77=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_F77=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_F77='$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].*|aix5*)
+	  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.
+
+      archive_cmds_F77=''
+      hardcode_direct_F77=yes
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+
+      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
+  	  hardcode_direct_F77=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct_F77=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
+  	  hardcode_minus_L_F77=yes
+  	  hardcode_libdir_flag_spec_F77='-L$libdir'
+  	  hardcode_libdir_separator_F77=
+	  fi
+	esac
+	shared_flag='-shared'
+      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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_F77=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.
+	allow_undefined_flag_F77='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_F77="-z nodefs"
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec_F77='${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.
+	  no_undefined_flag_F77=' ${wl}-bernotok'
+	  allow_undefined_flag_F77=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols_F77=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec_F77=' '
+	  archive_cmds_need_lc_F77=yes
+	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$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)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_F77=no
+      ;;
+
+    bsdi4*)
+      export_dynamic_flag_spec_F77=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec_F77=' '
+      allow_undefined_flag_F77=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.
+      archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_F77='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_F77=yes
+      ;;
+
+    darwin* | rhapsody*)
+    if test "$GXX" = yes ; then
+      archive_cmds_need_lc_F77=no
+      case "$host_os" in
+      rhapsody* | darwin1.[012])
+	allow_undefined_flag_F77='-undefined suppress'
+	;;
+      *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	allow_undefined_flag_F77='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[012])
+            allow_undefined_flag_F77='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            allow_undefined_flag_F77='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+	;;
+      esac
+    	lt_int_apple_cc_single_mod=no
+    	output_verbose_link_cmd='echo'
+    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+    	  lt_int_apple_cc_single_mod=yes
+    	fi
+    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+    	  archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+    	else
+        archive_cmds_F77='$CC -r ${wl}-bind_at_load -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'
+      fi
+      module_cmds_F77='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+          archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        else
+          archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        fi
+          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      hardcode_direct_F77=no
+      hardcode_automatic_F77=yes
+      hardcode_shlibpath_var_F77=unsupported
+      whole_archive_flag_spec_F77='-all_load $convenience'
+      link_all_deplibs_F77=yes
+    else
+      ld_shlibs_F77=no
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_F77=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*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu)
+      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$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
+	archive_cmds_F77='$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
+      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_direct_F77=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_F77=yes
+      export_dynamic_flag_spec_F77='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$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*|ia64*)
+	  archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*)
+	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+	  hardcode_libdir_separator_F77=:
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec_F77='-L$libdir'
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_F77=:
+	  hardcode_direct_F77=yes
+	  export_dynamic_flag_spec_F77='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      link_all_deplibs_F77=yes
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    newsos6)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_F77='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec_F77='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      allow_undefined_flag_F77=unsupported
+      archive_cmds_F77='$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'
+      old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag_F77=' -z text'
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds_F77='$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'
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_shlibpath_var_F77=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+      esac
+      link_all_deplibs_F77=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.
+	archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_F77='$CC -r -o $output$reload_objs'
+	  hardcode_direct_F77=no
+        ;;
+	motorola)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_F77=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_F77=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_F77='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag_F77=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_F77='$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'
+      hardcode_libdir_flag_spec_F77=
+      hardcode_shlibpath_var_F77=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      ld_shlibs_F77=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+echo "${ECHO_T}$ld_shlibs_F77" >&6
+test "$ld_shlibs_F77" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_F77=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_F77 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.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_F77
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+        allow_undefined_flag_F77=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_F77=no
+        else
+	  archive_cmds_need_lc_F77=yes
+        fi
+        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | 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'
+  ;;
+
+netbsdelf*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=yes
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" || \
+   test -n "$runpath_var F77" || \
+   test "X$hardcode_automatic_F77"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_F77" != 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_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+     test "$hardcode_minus_L_F77" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_F77=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_F77=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_F77=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+echo "${ECHO_T}$hardcode_action_F77" >&6
+
+if test "$hardcode_action_F77" = relink; 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
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+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"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+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"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    ;;
+  esac
+fi
+
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_F77 \
+    CC_F77 \
+    LD_F77 \
+    lt_prog_compiler_wl_F77 \
+    lt_prog_compiler_pic_F77 \
+    lt_prog_compiler_static_F77 \
+    lt_prog_compiler_no_builtin_flag_F77 \
+    export_dynamic_flag_spec_F77 \
+    thread_safe_flag_spec_F77 \
+    whole_archive_flag_spec_F77 \
+    enable_shared_with_static_runtimes_F77 \
+    old_archive_cmds_F77 \
+    old_archive_from_new_cmds_F77 \
+    predep_objects_F77 \
+    postdep_objects_F77 \
+    predeps_F77 \
+    postdeps_F77 \
+    compiler_lib_search_path_F77 \
+    archive_cmds_F77 \
+    archive_expsym_cmds_F77 \
+    postinstall_cmds_F77 \
+    postuninstall_cmds_F77 \
+    old_archive_from_expsyms_cmds_F77 \
+    allow_undefined_flag_F77 \
+    no_undefined_flag_F77 \
+    export_symbols_cmds_F77 \
+    hardcode_libdir_flag_spec_F77 \
+    hardcode_libdir_flag_spec_ld_F77 \
+    hardcode_libdir_separator_F77 \
+    hardcode_automatic_F77 \
+    module_cmds_F77 \
+    module_expsym_cmds_F77 \
+    lt_cv_prog_compiler_c_o_F77 \
+    exclude_expsyms_F77 \
+    include_expsyms_F77; do
+
+    case $var in
+    old_archive_cmds_F77 | \
+    old_archive_from_new_cmds_F77 | \
+    archive_cmds_F77 | \
+    archive_expsym_cmds_F77 | \
+    module_cmds_F77 | \
+    module_expsym_cmds_F77 | \
+    old_archive_from_expsyms_cmds_F77 | \
+    export_symbols_cmds_F77 | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_F77
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_F77
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_F77
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_F77"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      GCJ)
+	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+	  
+
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+objext_GCJ=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+compiler_GCJ=$CC
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+archive_cmds_need_lc_GCJ=no
+
+
+lt_prog_compiler_no_builtin_flag_GCJ=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+
+  
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl_GCJ=
+lt_prog_compiler_pic_GCJ=
+lt_prog_compiler_static_GCJ=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+ 
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_GCJ='-Wl,'
+    lt_prog_compiler_static_GCJ='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_GCJ='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_GCJ=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_GCJ=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic_GCJ='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_GCJ='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      else
+	lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_GCJ='-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_prog_compiler_pic_GCJ='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    linux*)
+      case $CC in
+      icc* | ecc*)
+	lt_prog_compiler_wl_GCJ='-Wl,'
+	lt_prog_compiler_pic_GCJ='-KPIC'
+	lt_prog_compiler_static_GCJ='-static'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_GCJ='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_GCJ='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic_GCJ='-Kpic'
+      lt_prog_compiler_static_GCJ='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_GCJ='-Qoption ld '
+      lt_prog_compiler_pic_GCJ='-PIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_GCJ='-Kconform_pic'
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_GCJ='-pic'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_GCJ"; then
+  
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_GCJ=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works_GCJ=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
+
+if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+    case $lt_prog_compiler_pic_GCJ in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
+     esac
+else
+    lt_prog_compiler_pic_GCJ=
+     lt_prog_compiler_can_build_shared_GCJ=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_GCJ=
+    ;;
+  *)
+    lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_GCJ=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o_GCJ=yes
+     fi
+   fi
+   chmod u+w .
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag_GCJ=
+  enable_shared_with_static_runtimes_GCJ=no
+  archive_cmds_GCJ=
+  archive_expsym_cmds_GCJ=
+  old_archive_From_new_cmds_GCJ=
+  old_archive_from_expsyms_cmds_GCJ=
+  export_dynamic_flag_spec_GCJ=
+  whole_archive_flag_spec_GCJ=
+  thread_safe_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_ld_GCJ=
+  hardcode_libdir_separator_GCJ=
+  hardcode_direct_GCJ=no
+  hardcode_minus_L_GCJ=no
+  hardcode_shlibpath_var_GCJ=unsupported
+  link_all_deplibs_GCJ=unknown
+  hardcode_automatic_GCJ=no
+  module_cmds_GCJ=
+  module_expsym_cmds_GCJ=
+  always_export_symbols_GCJ=no
+  export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_GCJ=
+  # 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'.
+  exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_GCJ=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_GCJ=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$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)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_GCJ=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_GCJ=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=no
+      enable_shared_with_static_runtimes_GCJ=yes
+      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_GCJ='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_GCJ=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds_GCJ="$tmp_archive_cmds"
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` 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
+      if test $supports_anon_versioning = yes; then
+        archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        archive_expsym_cmds_GCJ="$tmp_archive_cmds"
+      fi
+      link_all_deplibs_GCJ=no
+    else
+      ld_shlibs_GCJ=no
+    fi
+    ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_GCJ" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec_GCJ='${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
+ 	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_GCJ=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=yes
+      archive_expsym_cmds_GCJ='$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.
+      hardcode_minus_L_GCJ=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_GCJ=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_GCJ='$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].*|aix5*)
+	  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.
+
+      archive_cmds_GCJ=''
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_separator_GCJ=':'
+      link_all_deplibs_GCJ=yes
+
+      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
+  	  hardcode_direct_GCJ=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct_GCJ=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
+  	  hardcode_minus_L_GCJ=yes
+  	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
+  	  hardcode_libdir_separator_GCJ=
+	  fi
+	esac
+	shared_flag='-shared'
+      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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_GCJ=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.
+	allow_undefined_flag_GCJ='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_GCJ="-z nodefs"
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec_GCJ='${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.
+	  no_undefined_flag_GCJ=' ${wl}-bernotok'
+	  allow_undefined_flag_GCJ=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols_GCJ=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec_GCJ=' '
+	  archive_cmds_need_lc_GCJ=yes
+	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$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)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_GCJ=no
+      ;;
+
+    bsdi4*)
+      export_dynamic_flag_spec_GCJ=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec_GCJ=' '
+      allow_undefined_flag_GCJ=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.
+      archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_GCJ='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_GCJ=yes
+      ;;
+
+    darwin* | rhapsody*)
+    if test "$GXX" = yes ; then
+      archive_cmds_need_lc_GCJ=no
+      case "$host_os" in
+      rhapsody* | darwin1.[012])
+	allow_undefined_flag_GCJ='-undefined suppress'
+	;;
+      *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	allow_undefined_flag_GCJ='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[012])
+            allow_undefined_flag_GCJ='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            allow_undefined_flag_GCJ='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+	;;
+      esac
+    	lt_int_apple_cc_single_mod=no
+    	output_verbose_link_cmd='echo'
+    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+    	  lt_int_apple_cc_single_mod=yes
+    	fi
+    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+    	  archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+    	else
+        archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -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'
+      fi
+      module_cmds_GCJ='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+          archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        else
+          archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        fi
+          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      hardcode_direct_GCJ=no
+      hardcode_automatic_GCJ=yes
+      hardcode_shlibpath_var_GCJ=unsupported
+      whole_archive_flag_spec_GCJ='-all_load $convenience'
+      link_all_deplibs_GCJ=yes
+    else
+      ld_shlibs_GCJ=no
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_GCJ=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*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu)
+      archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$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
+	archive_cmds_GCJ='$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
+      hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_direct_GCJ=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_GCJ=yes
+      export_dynamic_flag_spec_GCJ='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_GCJ='$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*|ia64*)
+	  archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*)
+	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
+	  hardcode_libdir_separator_GCJ=:
+	  hardcode_direct_GCJ=no
+	  hardcode_shlibpath_var_GCJ=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
+	  hardcode_direct_GCJ=no
+	  hardcode_shlibpath_var_GCJ=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_GCJ=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_GCJ=:
+	  hardcode_direct_GCJ=yes
+	  export_dynamic_flag_spec_GCJ='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_GCJ=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      link_all_deplibs_GCJ=yes
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    newsos6)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_GCJ='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec_GCJ='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      allow_undefined_flag_GCJ=unsupported
+      archive_cmds_GCJ='$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'
+      old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_GCJ=' -expect_unresolved \*'
+	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_GCJ=' -expect_unresolved \*'
+	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag_GCJ=' -z text'
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds_GCJ='$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'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+      esac
+      link_all_deplibs_GCJ=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.
+	archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_GCJ=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_GCJ='$CC -r -o $output$reload_objs'
+	  hardcode_direct_GCJ=no
+        ;;
+	motorola)
+	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_GCJ=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_GCJ=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=no
+      hardcode_shlibpath_var_GCJ=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_GCJ='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag_GCJ=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_GCJ='$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'
+      hardcode_libdir_flag_spec_GCJ=
+      hardcode_shlibpath_var_GCJ=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    *)
+      ld_shlibs_GCJ=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+echo "${ECHO_T}$ld_shlibs_GCJ" >&6
+test "$ld_shlibs_GCJ" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_GCJ" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_GCJ=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_GCJ 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.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_GCJ
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
+        allow_undefined_flag_GCJ=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_GCJ=no
+        else
+	  archive_cmds_need_lc_GCJ=yes
+        fi
+        allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | 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'
+  ;;
+
+netbsdelf*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=yes
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_GCJ=
+if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+   test -n "$runpath_var GCJ" || \
+   test "X$hardcode_automatic_GCJ"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_GCJ" != 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_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
+     test "$hardcode_minus_L_GCJ" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_GCJ=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_GCJ=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_GCJ=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+echo "${ECHO_T}$hardcode_action_GCJ" >&6
+
+if test "$hardcode_action_GCJ" = relink; 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
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+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"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+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"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    ;;
+  esac
+fi
+
+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*)
+    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
+    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    
+fi
+
+   ;;
+
+  *)
+    echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+	      
+fi
+
+	    
+fi
+
+	  
+fi
+
+	
+fi
+
+      
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+    
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+      
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+    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
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_GCJ \
+    CC_GCJ \
+    LD_GCJ \
+    lt_prog_compiler_wl_GCJ \
+    lt_prog_compiler_pic_GCJ \
+    lt_prog_compiler_static_GCJ \
+    lt_prog_compiler_no_builtin_flag_GCJ \
+    export_dynamic_flag_spec_GCJ \
+    thread_safe_flag_spec_GCJ \
+    whole_archive_flag_spec_GCJ \
+    enable_shared_with_static_runtimes_GCJ \
+    old_archive_cmds_GCJ \
+    old_archive_from_new_cmds_GCJ \
+    predep_objects_GCJ \
+    postdep_objects_GCJ \
+    predeps_GCJ \
+    postdeps_GCJ \
+    compiler_lib_search_path_GCJ \
+    archive_cmds_GCJ \
+    archive_expsym_cmds_GCJ \
+    postinstall_cmds_GCJ \
+    postuninstall_cmds_GCJ \
+    old_archive_from_expsyms_cmds_GCJ \
+    allow_undefined_flag_GCJ \
+    no_undefined_flag_GCJ \
+    export_symbols_cmds_GCJ \
+    hardcode_libdir_flag_spec_GCJ \
+    hardcode_libdir_flag_spec_ld_GCJ \
+    hardcode_libdir_separator_GCJ \
+    hardcode_automatic_GCJ \
+    module_cmds_GCJ \
+    module_expsym_cmds_GCJ \
+    lt_cv_prog_compiler_c_o_GCJ \
+    exclude_expsyms_GCJ \
+    include_expsyms_GCJ; do
+
+    case $var in
+    old_archive_cmds_GCJ | \
+    old_archive_from_new_cmds_GCJ | \
+    archive_cmds_GCJ | \
+    archive_expsym_cmds_GCJ | \
+    module_cmds_GCJ | \
+    module_expsym_cmds_GCJ | \
+    old_archive_from_expsyms_cmds_GCJ | \
+    export_symbols_cmds_GCJ | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_GCJ
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_GCJ
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_GCJ
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_GCJ
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_GCJ
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_GCJ
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_GCJ
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_GCJ
+archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_GCJ
+module_expsym_cmds=$lt_module_expsym_cmds_GCJ
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_GCJ
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_GCJ
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_GCJ
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_GCJ
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_GCJ
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_GCJ
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_GCJ
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_GCJ
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_GCJ
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_GCJ"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_GCJ
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_GCJ
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_GCJ
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_GCJ
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      RC)
+	
+
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+objext_RC=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# 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.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+compiler_RC=$CC
+lt_cv_prog_compiler_c_o_RC=yes
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_RC \
+    CC_RC \
+    LD_RC \
+    lt_prog_compiler_wl_RC \
+    lt_prog_compiler_pic_RC \
+    lt_prog_compiler_static_RC \
+    lt_prog_compiler_no_builtin_flag_RC \
+    export_dynamic_flag_spec_RC \
+    thread_safe_flag_spec_RC \
+    whole_archive_flag_spec_RC \
+    enable_shared_with_static_runtimes_RC \
+    old_archive_cmds_RC \
+    old_archive_from_new_cmds_RC \
+    predep_objects_RC \
+    postdep_objects_RC \
+    predeps_RC \
+    postdeps_RC \
+    compiler_lib_search_path_RC \
+    archive_cmds_RC \
+    archive_expsym_cmds_RC \
+    postinstall_cmds_RC \
+    postuninstall_cmds_RC \
+    old_archive_from_expsyms_cmds_RC \
+    allow_undefined_flag_RC \
+    no_undefined_flag_RC \
+    export_symbols_cmds_RC \
+    hardcode_libdir_flag_spec_RC \
+    hardcode_libdir_flag_spec_ld_RC \
+    hardcode_libdir_separator_RC \
+    hardcode_automatic_RC \
+    module_cmds_RC \
+    module_expsym_cmds_RC \
+    lt_cv_prog_compiler_c_o_RC \
+    exclude_expsyms_RC \
+    include_expsyms_RC; do
+
+    case $var in
+    old_archive_cmds_RC | \
+    old_archive_from_new_cmds_RC | \
+    archive_cmds_RC | \
+    archive_expsym_cmds_RC | \
+    module_cmds_RC | \
+    module_expsym_cmds_RC | \
+    old_archive_from_expsyms_cmds_RC | \
+    export_symbols_cmds_RC | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_RC
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_RC
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_RC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_RC
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_RC
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_RC
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_RC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_RC
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_RC
+archive_expsym_cmds=$lt_archive_expsym_cmds_RC
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_RC
+module_expsym_cmds=$lt_module_expsym_cmds_RC
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_RC
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_RC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_RC
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_RC
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_RC
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_RC
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_RC
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_RC
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_RC
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_RC
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_RC"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_RC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_RC
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_RC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_RC
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	;;
+
+      *)
+	{ { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
+echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+	;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
+echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Prevent multiple expansion
+
+
+
+
+
+
+
+
+
+
+
+  
+
+  
+
+
+  
+       
+       
+
+
+if test x$GCC = xyes; then
+    echo "$as_me:$LINENO: checking version 3.x of gcc" >&5
+echo $ECHO_N "checking version 3.x of gcc... $ECHO_C" >&6
+    if test -n "`$CC --version 2>&1|grep '3.'`"; then
+        
+cat >>confdefs.h <<\_ACEOF
+@%:@define EXT_HASH 
+_ACEOF
+
+        echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6;
+    else
+        echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6!
+    fi
+fi
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+
+if test -n "$ac_pt_PKG_CONFIG"; then
+  echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  PKG_CONFIG=$ac_pt_PKG_CONFIG
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.9.0
+	echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+	else
+		echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+		PKG_CONFIG=""
+	fi
+		
+fi
+
+pkg_failed=no
+echo "$as_me:$LINENO: checking for OGRE_CFLAGS" >&5
+echo $ECHO_N "checking for OGRE_CFLAGS... $ECHO_C" >&6
+if test "${pkg_cv_OGRE_CFLAGS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "x$ac_cv_env_OGRE_CFLAGS_set" = "xset"; then
+	pkg_cv_OGRE_CFLAGS=$ac_cv_env_OGRE_CFLAGS_value
+elif test -n "$PKG_CONFIG"; then
+	if { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists \"OGRE\" >/dev/null 2>&1") >&5
+  ($PKG_CONFIG --exists "OGRE" >/dev/null 2>&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+		pkg_cv_OGRE_CFLAGS=`$PKG_CONFIG --cflags "OGRE" 2>/dev/null`
+	else
+		pkg_failed=yes
+	fi
+else
+	pkg_failed=untried
+fi
+fi
+echo "$as_me:$LINENO: result: $pkg_cv_OGRE_CFLAGS" >&5
+echo "${ECHO_T}$pkg_cv_OGRE_CFLAGS" >&6
+echo "$as_me:$LINENO: checking for OGRE_LIBS" >&5
+echo $ECHO_N "checking for OGRE_LIBS... $ECHO_C" >&6
+if test "${pkg_cv_OGRE_LIBS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "x$ac_cv_env_OGRE_LIBS_set" = "xset"; then
+	pkg_cv_OGRE_LIBS=$ac_cv_env_OGRE_LIBS_value
+elif test -n "$PKG_CONFIG"; then
+	if { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists \"OGRE\" >/dev/null 2>&1") >&5
+  ($PKG_CONFIG --exists "OGRE" >/dev/null 2>&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+		pkg_cv_OGRE_LIBS=`$PKG_CONFIG --libs "OGRE" 2>/dev/null`
+	else
+		pkg_failed=yes
+	fi
+else
+	pkg_failed=untried
+fi
+fi
+echo "$as_me:$LINENO: result: $pkg_cv_OGRE_LIBS" >&5
+echo "${ECHO_T}$pkg_cv_OGRE_LIBS" >&6
+
+if test $pkg_failed = yes; then
+	OGRE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "OGRE"`
+	# Put the nasty error message in config.log where it belongs
+	echo "$OGRE_PKG_ERRORS" 1>&5
+
+	{ { echo "$as_me:$LINENO: error: Package requirements (OGRE) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the OGRE_CFLAGS and OGRE_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details." >&5
+echo "$as_me: error: Package requirements (OGRE) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the OGRE_CFLAGS and OGRE_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details." >&2;}
+   { (exit 1); exit 1; }; }
+elif test $pkg_failed = untried; then
+	{ { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively you may set the OGRE_CFLAGS and OGRE_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&5
+echo "$as_me: error: The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively you may set the OGRE_CFLAGS and OGRE_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+	OGRE_CFLAGS=$pkg_cv_OGRE_CFLAGS
+	OGRE_LIBS=$pkg_cv_OGRE_LIBS
+	:
+fi
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for main in -lode" >&5
+echo $ECHO_N "checking for main in -lode... $ECHO_C" >&6
+if test "${ac_cv_lib_ode_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lode  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_ode_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_ode_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ode_main" >&5
+echo "${ECHO_T}$ac_cv_lib_ode_main" >&6
+if test $ac_cv_lib_ode_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBODE 1
+_ACEOF
+
+  LIBS="-lode $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: Can't find libode" >&5
+echo "$as_me: error: Can't find libode" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for pow in -lm" >&5
+echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_pow+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char pow ();
+int
+main ()
+{
+pow ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_pow=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_pow=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5
+echo "${ECHO_T}$ac_cv_lib_m_pow" >&6
+if test $ac_cv_lib_m_pow = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+
+
+echo "$as_me:$LINENO: checking for gzopen in -lz" >&5
+echo $ECHO_N "checking for gzopen in -lz... $ECHO_C" >&6
+if test "${ac_cv_lib_z_gzopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char gzopen ();
+int
+main ()
+{
+gzopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_z_gzopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_z_gzopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzopen" >&5
+echo "${ECHO_T}$ac_cv_lib_z_gzopen" >&6
+if test $ac_cv_lib_z_gzopen = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBZ 1
+_ACEOF
+
+  LIBS="-lz $LIBS"
+
+fi
+
+echo "$as_me:$LINENO: checking for snprintf" >&5
+echo $ECHO_N "checking for snprintf... $ECHO_C" >&6
+if test "${ac_cv_func_snprintf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define snprintf to an innocuous variant, in case <limits.h> declares snprintf.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define snprintf innocuous_snprintf
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char snprintf (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef snprintf
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char snprintf ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_snprintf) || defined (__stub___snprintf)
+choke me
+#else
+char (*f) () = snprintf;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != snprintf;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_snprintf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_snprintf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_snprintf" >&5
+echo "${ECHO_T}$ac_cv_func_snprintf" >&6
+if test $ac_cv_func_snprintf = yes; then
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_SNPRINTF 
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for vsnprintf" >&5
+echo $ECHO_N "checking for vsnprintf... $ECHO_C" >&6
+if test "${ac_cv_func_vsnprintf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define vsnprintf to an innocuous variant, in case <limits.h> declares vsnprintf.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define vsnprintf innocuous_vsnprintf
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char vsnprintf (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef vsnprintf
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char vsnprintf ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_vsnprintf) || defined (__stub___vsnprintf)
+choke me
+#else
+char (*f) () = vsnprintf;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != vsnprintf;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_vsnprintf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_vsnprintf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_vsnprintf" >&5
+echo "${ECHO_T}$ac_cv_func_vsnprintf" >&6
+if test $ac_cv_func_vsnprintf = yes; then
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_VSNPRINTF 
+_ACEOF
+
+fi
+
+
+                                                            ac_config_files="$ac_config_files Makefile ReferenceAppLayer/Makefile ReferenceAppLayer/src/Makefile ReferenceAppLayer/include/Makefile BspCollision/Makefile BspCollision/src/Makefile"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+  (set) 2>&1 |
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+  if test -w $cache_file; then
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[	 ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[	 ]*$//;
+}'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_i=`echo "$ac_i" |
+	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIB@&t@OBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# 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+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.  Logging --version etc. is OK.
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX
+@%:@@%:@ Running $as_me. @%:@@%:@
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by OGRE_REFAPP $as_me 0.10.0, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -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
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+		   instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+		   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+OGRE_REFAPP config.status 0.10.0
+configured by $0, generated by GNU Autoconf 2.59,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  -*)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_option=$1
+     ac_need_defaults=false;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1" ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "ReferenceAppLayer/Makefile" ) CONFIG_FILES="$CONFIG_FILES ReferenceAppLayer/Makefile" ;;
+  "ReferenceAppLayer/src/Makefile" ) CONFIG_FILES="$CONFIG_FILES ReferenceAppLayer/src/Makefile" ;;
+  "ReferenceAppLayer/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES ReferenceAppLayer/include/Makefile" ;;
+  "BspCollision/Makefile" ) CONFIG_FILES="$CONFIG_FILES BspCollision/Makefile" ;;
+  "BspCollision/src/Makefile" ) CONFIG_FILES="$CONFIG_FILES BspCollision/src/Makefile" ;;
+  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+  "ReferenceAppLayer/include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ReferenceAppLayer/include/config.h" ;;
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./confstat$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@CYGPATH_W@,$CYGPATH_W,;t t
+s,@PACKAGE@,$PACKAGE,;t t
+s,@VERSION@,$VERSION,;t t
+s,@ACLOCAL@,$ACLOCAL,;t t
+s,@AUTOCONF@,$AUTOCONF,;t t
+s,@AUTOMAKE@,$AUTOMAKE,;t t
+s,@AUTOHEADER@,$AUTOHEADER,;t t
+s,@MAKEINFO@,$MAKEINFO,;t t
+s,@install_sh@,$install_sh,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s,@mkdir_p@,$mkdir_p,;t t
+s,@AWK@,$AWK,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@am__leading_dot@,$am__leading_dot,;t t
+s,@AMTAR@,$AMTAR,;t t
+s,@am__tar@,$am__tar,;t t
+s,@am__untar@,$am__untar,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@target@,$target,;t t
+s,@target_cpu@,$target_cpu,;t t
+s,@target_vendor@,$target_vendor,;t t
+s,@target_os@,$target_os,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@DEPDIR@,$DEPDIR,;t t
+s,@am__include@,$am__include,;t t
+s,@am__quote@,$am__quote,;t t
+s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s,@CCDEPMODE@,$CCDEPMODE,;t t
+s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@CXX@,$CXX,;t t
+s,@CXXFLAGS@,$CXXFLAGS,;t t
+s,@ac_ct_CXX@,$ac_ct_CXX,;t t
+s,@CXXDEPMODE@,$CXXDEPMODE,;t t
+s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t
+s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t
+s,@EGREP@,$EGREP,;t t
+s,@LN_S@,$LN_S,;t t
+s,@ECHO@,$ECHO,;t t
+s,@AR@,$AR,;t t
+s,@ac_ct_AR@,$ac_ct_AR,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@CPP@,$CPP,;t t
+s,@CXXCPP@,$CXXCPP,;t t
+s,@F77@,$F77,;t t
+s,@FFLAGS@,$FFLAGS,;t t
+s,@ac_ct_F77@,$ac_ct_F77,;t t
+s,@LIBTOOL@,$LIBTOOL,;t t
+s,@PKG_CONFIG@,$PKG_CONFIG,;t t
+s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
+s,@OGRE_CFLAGS@,$OGRE_CFLAGS,;t t
+s,@OGRE_LIBS@,$OGRE_LIBS,;t t
+s,@LIB@&t@OBJS@,$LIB@&t@OBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+  cat >>$CONFIG_STATUS <<\_ACEOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+  esac
+
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    configure_input=
+  else
+    configure_input="$ac_file.  "
+  fi
+  configure_input=$configure_input"Generated from `echo $ac_file_in |
+				     sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
+ac_dB='[	 ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 # Do quote $f, to prevent DOS paths from being IFS'd.
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+  # Remove the trailing spaces.
+  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h.  The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status.  Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless.  Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo '  :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+  # Write a limited-size here document to $tmp/defines.sed.
+  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#define' lines.
+  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/defines.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo '  fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+  # Write a limited-size here document to $tmp/undefs.sed.
+  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#undef'
+  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+  rm -f conftest.undefs
+  mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    echo "/* Generated by configure.  */" >$tmp/config.h
+  else
+    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
+  fi
+  cat $tmp/in >>$tmp/config.h
+  rm -f $tmp/in
+  if test x"$ac_file" != x-; then
+    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+      { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+      rm -f $ac_file
+      mv $tmp/config.h $ac_file
+    fi
+  else
+    cat $tmp/config.h
+    rm -f $tmp/config.h
+  fi
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $ac_file | $ac_file:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X$ac_file : 'X\(//\)[^/]' \| \
+	 X$ac_file : 'X\(//\)$' \| \
+	 X$ac_file : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`/stamp-h$_am_stamp_count
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_dest" : 'X\(//\)[^/]' \| \
+	 X"$ac_dest" : 'X\(//\)$' \| \
+	 X"$ac_dest" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+  case $ac_dest in
+    depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    { if $as_mkdir_p; then
+    mkdir -p $dirpart/$fdir
+  else
+    as_dir=$dirpart/$fdir
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+  esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+
Index: /ReferenceApplication/autom4te.cache/requests
===================================================================
--- /ReferenceApplication/autom4te.cache/requests	(revision 5)
+++ /ReferenceApplication/autom4te.cache/requests	(revision 5)
@@ -0,0 +1,351 @@
+# This file was generated by Autom4te Sat Jan  8 16:59:54 PST 2005.
+# It contains the lists of macros which have been traced.
+# It can be safely removed.
+
+@request = (
+             bless( [
+                      '0',
+                      1,
+                      [
+                        '/usr/share/autoconf'
+                      ],
+                      [
+                        '/usr/share/autoconf/autoconf/autoconf.m4f',
+                        '/usr/share/aclocal/libtool.m4',
+                        '/usr/share/aclocal/pkg.m4',
+                        '/usr/share/aclocal-1.9/amversion.m4',
+                        '/usr/share/aclocal-1.9/auxdir.m4',
+                        '/usr/share/aclocal-1.9/cond.m4',
+                        '/usr/share/aclocal-1.9/depend.m4',
+                        '/usr/share/aclocal-1.9/depout.m4',
+                        '/usr/share/aclocal-1.9/header.m4',
+                        '/usr/share/aclocal-1.9/init.m4',
+                        '/usr/share/aclocal-1.9/install-sh.m4',
+                        '/usr/share/aclocal-1.9/lead-dot.m4',
+                        '/usr/share/aclocal-1.9/make.m4',
+                        '/usr/share/aclocal-1.9/missing.m4',
+                        '/usr/share/aclocal-1.9/mkdirp.m4',
+                        '/usr/share/aclocal-1.9/options.m4',
+                        '/usr/share/aclocal-1.9/runlog.m4',
+                        '/usr/share/aclocal-1.9/sanity.m4',
+                        '/usr/share/aclocal-1.9/strip.m4',
+                        '/usr/share/aclocal-1.9/tar.m4',
+                        'configure.in'
+                      ],
+                      {
+                        'AM_ENABLE_STATIC' => 1,
+                        'AC_LIBTOOL_LANG_RC_CONFIG' => 1,
+                        'AC_C_VOLATILE' => 1,
+                        'AC_TYPE_OFF_T' => 1,
+                        '_LT_AC_SHELL_INIT' => 1,
+                        'AC_FUNC_CLOSEDIR_VOID' => 1,
+                        'AC_REPLACE_FNMATCH' => 1,
+                        'AC_DEFUN' => 1,
+                        'AC_PROG_LIBTOOL' => 1,
+                        '_LT_AC_LANG_CXX_CONFIG' => 1,
+                        'AM_PROG_MKDIR_P' => 1,
+                        'AC_FUNC_STAT' => 1,
+                        'AC_FUNC_WAIT3' => 1,
+                        'AM_AUTOMAKE_VERSION' => 1,
+                        'AC_FUNC_LSTAT' => 1,
+                        'AC_STRUCT_TM' => 1,
+                        'AC_CHECK_HEADERS' => 1,
+                        'AC_FUNC_STRTOD' => 1,
+                        'AM_MISSING_PROG' => 1,
+                        'AC_FUNC_STRNLEN' => 1,
+                        'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1,
+                        'AC_PROG_CXX' => 1,
+                        '_LT_AC_LANG_C_CONFIG' => 1,
+                        'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1,
+                        'AM_PROG_INSTALL_STRIP' => 1,
+                        'AC_PROG_AWK' => 1,
+                        '_m4_warn' => 1,
+                        'AC_LIBTOOL_OBJDIR' => 1,
+                        'AC_HEADER_MAJOR' => 1,
+                        'AM_SANITY_CHECK' => 1,
+                        'AC_LIBTOOL_PROG_COMPILER_PIC' => 1,
+                        'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1,
+                        'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1,
+                        '_LT_AC_CHECK_DLFCN' => 1,
+                        '_AM_PROG_TAR' => 1,
+                        'AC_LIBTOOL_GCJ' => 1,
+                        'AC_PROG_GCC_TRADITIONAL' => 1,
+                        'AC_LIBSOURCE' => 1,
+                        'AC_STRUCT_ST_BLOCKS' => 1,
+                        '_LT_AC_LANG_F77' => 1,
+                        'AC_LIBTOOL_CONFIG' => 1,
+                        'AC_PROG_MAKE_SET' => 1,
+                        'AC_CONFIG_AUX_DIR' => 1,
+                        'sinclude' => 1,
+                        'AM_DISABLE_SHARED' => 1,
+                        'AM_PROG_LIBTOOL' => 1,
+                        '_LT_AC_LANG_CXX' => 1,
+                        '_LT_AC_FILE_LTDLL_C' => 1,
+                        'AM_PROG_LD' => 1,
+                        'AC_FUNC_STRERROR_R' => 1,
+                        'AC_DECL_SYS_SIGLIST' => 1,
+                        'AC_FUNC_FORK' => 1,
+                        'AU_DEFUN' => 1,
+                        'AC_FUNC_VPRINTF' => 1,
+                        'AC_PROG_NM' => 1,
+                        'AC_LIBTOOL_DLOPEN' => 1,
+                        'AC_PROG_LD' => 1,
+                        'AC_PROG_LD_GNU' => 1,
+                        'AC_ENABLE_FAST_INSTALL' => 1,
+                        'AC_INIT' => 1,
+                        'AC_STRUCT_TIMEZONE' => 1,
+                        'AC_SUBST' => 1,
+                        'AC_FUNC_ALLOCA' => 1,
+                        '_AM_SET_OPTION' => 1,
+                        'AC_CANONICAL_HOST' => 1,
+                        'AC_LIBTOOL_PROG_CC_C_O' => 1,
+                        'AC_LIBTOOL_LANG_CXX_CONFIG' => 1,
+                        'AC_PROG_RANLIB' => 1,
+                        'AC_FUNC_SETPGRP' => 1,
+                        'AC_CONFIG_SUBDIRS' => 1,
+                        'AC_FUNC_MMAP' => 1,
+                        'AC_TYPE_SIZE_T' => 1,
+                        'AC_CHECK_TYPES' => 1,
+                        'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
+                        'AC_CHECK_MEMBERS' => 1,
+                        'AC_DEFUN_ONCE' => 1,
+                        'AC_FUNC_UTIME_NULL' => 1,
+                        'AC_FUNC_SELECT_ARGTYPES' => 1,
+                        '_LT_AC_LANG_GCJ' => 1,
+                        'AC_FUNC_STRFTIME' => 1,
+                        'AC_HEADER_STAT' => 1,
+                        'AC_C_INLINE' => 1,
+                        'AC_LIBTOOL_RC' => 1,
+                        '_LT_AC_PROG_ECHO_BACKSLASH' => 1,
+                        'AC_DISABLE_FAST_INSTALL' => 1,
+                        'AC_CONFIG_FILES' => 1,
+                        '_LT_AC_TRY_DLOPEN_SELF' => 1,
+                        '_LT_AC_SYS_LIBPATH_AIX' => 1,
+                        'include' => 1,
+                        'LT_AC_PROG_SED' => 1,
+                        'AM_ENABLE_SHARED' => 1,
+                        'AM_GNU_GETTEXT' => 1,
+                        '_LT_AC_LANG_GCJ_CONFIG' => 1,
+                        'AC_ENABLE_SHARED' => 1,
+                        'AC_CHECK_LIB' => 1,
+                        'AC_FUNC_OBSTACK' => 1,
+                        'AC_FUNC_MALLOC' => 1,
+                        'AC_FUNC_GETGROUPS' => 1,
+                        'AC_FUNC_GETLOADAVG' => 1,
+                        'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1,
+                        'AC_ENABLE_STATIC' => 1,
+                        'AC_FUNC_FSEEKO' => 1,
+                        '_LT_AC_TAGVAR' => 1,
+                        'AM_PROG_CC_C_O' => 1,
+                        'AC_LIBTOOL_LANG_F77_CONFIG' => 1,
+                        'AM_CONDITIONAL' => 1,
+                        'AC_FUNC_MKTIME' => 1,
+                        'AC_HEADER_SYS_WAIT' => 1,
+                        'AC_FUNC_MEMCMP' => 1,
+                        'AC_PROG_LN_S' => 1,
+                        'AM_PROG_INSTALL_SH' => 1,
+                        'm4_include' => 1,
+                        'AC_PROG_EGREP' => 1,
+                        'AC_HEADER_DIRENT' => 1,
+                        'AC_PATH_MAGIC' => 1,
+                        '_AC_AM_CONFIG_HEADER_HOOK' => 1,
+                        'AM_MAKE_INCLUDE' => 1,
+                        '_LT_AC_TAGCONFIG' => 1,
+                        'm4_pattern_forbid' => 1,
+                        'AC_CONFIG_LIBOBJ_DIR' => 1,
+                        'AC_LIBTOOL_COMPILER_OPTION' => 1,
+                        'AC_DISABLE_SHARED' => 1,
+                        'AC_LIBTOOL_SETUP' => 1,
+                        'AC_LIBTOOL_WIN32_DLL' => 1,
+                        'AC_PROG_LD_RELOAD_FLAG' => 1,
+                        'AC_HEADER_TIME' => 1,
+                        'AC_TYPE_MODE_T' => 1,
+                        'AM_MISSING_HAS_RUN' => 1,
+                        'AC_FUNC_GETMNTENT' => 1,
+                        'AC_LIBTOOL_DLOPEN_SELF' => 1,
+                        'm4_sinclude' => 1,
+                        'AC_PATH_X' => 1,
+                        'AC_LIBTOOL_PROG_LD_SHLIBS' => 1,
+                        'AC_HEADER_STDC' => 1,
+                        'AC_LIBTOOL_LINKER_OPTION' => 1,
+                        'LT_AC_PROG_RC' => 1,
+                        'AC_LIBTOOL_CXX' => 1,
+                        'LT_AC_PROG_GCJ' => 1,
+                        'AC_FUNC_ERROR_AT_LINE' => 1,
+                        'AM_DISABLE_STATIC' => 1,
+                        'AM_DEP_TRACK' => 1,
+                        'AM_CONFIG_HEADER' => 1,
+                        '_AC_PROG_LIBTOOL' => 1,
+                        'AC_FUNC_MBRTOWC' => 1,
+                        'AC_TYPE_SIGNAL' => 1,
+                        '_AM_IF_OPTION' => 1,
+                        'AC_TYPE_UID_T' => 1,
+                        'AC_PATH_TOOL_PREFIX' => 1,
+                        'm4_pattern_allow' => 1,
+                        'AC_LIBTOOL_F77' => 1,
+                        'AM_SET_LEADING_DOT' => 1,
+                        'AC_DEFINE_TRACE_LITERAL' => 1,
+                        '_AM_DEPENDENCIES' => 1,
+                        'AC_LIBTOOL_LANG_C_CONFIG' => 1,
+                        '_LT_AC_SYS_COMPILER' => 1,
+                        'AC_PROG_CC' => 1,
+                        'AM_PROG_NM' => 1,
+                        'PKG_CHECK_MODULES' => 1,
+                        'AC_FUNC_STRCOLL' => 1,
+                        'AC_PROG_YACC' => 1,
+                        'AC_LIBLTDL_CONVENIENCE' => 1,
+                        'AC_DEPLIBS_CHECK_METHOD' => 1,
+                        'AC_FUNC_CHOWN' => 1,
+                        'AC_LIBLTDL_INSTALLABLE' => 1,
+                        'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
+                        'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1,
+                        'AC_FUNC_GETPGRP' => 1,
+                        'AM_INIT_AUTOMAKE' => 1,
+                        'AC_FUNC_REALLOC' => 1,
+                        'AC_DISABLE_STATIC' => 1,
+                        'AC_CONFIG_LINKS' => 1,
+                        'AM_MAINTAINER_MODE' => 1,
+                        '_LT_AC_LOCK' => 1,
+                        '_LT_AC_LANG_RC_CONFIG' => 1,
+                        'AC_PROG_CPP' => 1,
+                        'AC_C_CONST' => 1,
+                        'AC_PROG_LEX' => 1,
+                        'AC_TYPE_PID_T' => 1,
+                        'AC_LIBTOOL_POSTDEP_PREDEP' => 1,
+                        'AC_FUNC_SETVBUF_REVERSED' => 1,
+                        'AM_AUX_DIR_EXPAND' => 1,
+                        'AC_PROG_INSTALL' => 1,
+                        '_LT_AC_LANG_F77_CONFIG' => 1,
+                        'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1,
+                        '_AM_SET_OPTIONS' => 1,
+                        '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
+                        'AM_RUN_LOG' => 1,
+                        'AC_LIBTOOL_PICMODE' => 1,
+                        'AH_OUTPUT' => 1,
+                        'AC_CHECK_LIBM' => 1,
+                        'AC_LIBTOOL_SYS_LIB_STRIP' => 1,
+                        '_AM_MANGLE_OPTION' => 1,
+                        'AC_CANONICAL_SYSTEM' => 1,
+                        'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1,
+                        'AC_CONFIG_HEADERS' => 1,
+                        'AM_SET_DEPDIR' => 1,
+                        'PKG_PROG_PKG_CONFIG' => 1,
+                        'AC_CHECK_FUNCS' => 1
+                      }
+                    ], 'Autom4te::Request' ),
+             bless( [
+                      '1',
+                      1,
+                      [
+                        '/usr/share/autoconf'
+                      ],
+                      [
+                        '/usr/share/autoconf/autoconf/autoconf.m4f',
+                        'aclocal.m4',
+                        'configure.in'
+                      ],
+                      {
+                        '_LT_AC_TAGCONFIG' => 1,
+                        'm4_pattern_forbid' => 1,
+                        'AC_CANONICAL_TARGET' => 1,
+                        'AC_CONFIG_LIBOBJ_DIR' => 1,
+                        'AC_TYPE_OFF_T' => 1,
+                        'AC_C_VOLATILE' => 1,
+                        'AC_FUNC_CLOSEDIR_VOID' => 1,
+                        'AC_REPLACE_FNMATCH' => 1,
+                        'AC_PROG_LIBTOOL' => 1,
+                        'AC_FUNC_STAT' => 1,
+                        'AC_HEADER_TIME' => 1,
+                        'AC_FUNC_WAIT3' => 1,
+                        'AM_AUTOMAKE_VERSION' => 1,
+                        'AC_STRUCT_TM' => 1,
+                        'AC_FUNC_LSTAT' => 1,
+                        'AC_TYPE_MODE_T' => 1,
+                        'AC_FUNC_GETMNTENT' => 1,
+                        'AC_CHECK_HEADERS' => 1,
+                        'AC_FUNC_STRTOD' => 1,
+                        'AC_FUNC_STRNLEN' => 1,
+                        'm4_sinclude' => 1,
+                        'AC_PROG_CXX' => 1,
+                        'AC_PATH_X' => 1,
+                        'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1,
+                        'AC_PROG_AWK' => 1,
+                        '_m4_warn' => 1,
+                        'AC_HEADER_STDC' => 1,
+                        'AC_HEADER_MAJOR' => 1,
+                        'AC_FUNC_ERROR_AT_LINE' => 1,
+                        'AC_PROG_GCC_TRADITIONAL' => 1,
+                        'AC_LIBSOURCE' => 1,
+                        'AC_FUNC_MBRTOWC' => 1,
+                        'AC_STRUCT_ST_BLOCKS' => 1,
+                        'AC_TYPE_SIGNAL' => 1,
+                        'AC_CANONICAL_BUILD' => 1,
+                        'AC_TYPE_UID_T' => 1,
+                        'AC_CONFIG_AUX_DIR' => 1,
+                        'AC_PROG_MAKE_SET' => 1,
+                        'sinclude' => 1,
+                        'm4_pattern_allow' => 1,
+                        'AC_DEFINE_TRACE_LITERAL' => 1,
+                        'AC_FUNC_STRERROR_R' => 1,
+                        'AC_PROG_CC' => 1,
+                        'AC_DECL_SYS_SIGLIST' => 1,
+                        'AC_FUNC_FORK' => 1,
+                        'AC_FUNC_VPRINTF' => 1,
+                        'AC_FUNC_STRCOLL' => 1,
+                        'AC_PROG_YACC' => 1,
+                        'AC_INIT' => 1,
+                        'AC_STRUCT_TIMEZONE' => 1,
+                        'AC_FUNC_CHOWN' => 1,
+                        'AC_SUBST' => 1,
+                        'AC_FUNC_ALLOCA' => 1,
+                        'AC_CANONICAL_HOST' => 1,
+                        'AC_FUNC_GETPGRP' => 1,
+                        'AC_PROG_RANLIB' => 1,
+                        'AM_INIT_AUTOMAKE' => 1,
+                        'AC_FUNC_SETPGRP' => 1,
+                        'AC_CONFIG_SUBDIRS' => 1,
+                        'AC_FUNC_MMAP' => 1,
+                        'AC_FUNC_REALLOC' => 1,
+                        'AC_TYPE_SIZE_T' => 1,
+                        'AC_CONFIG_LINKS' => 1,
+                        'AC_CHECK_TYPES' => 1,
+                        'LT_SUPPORTED_TAG' => 1,
+                        'AC_CHECK_MEMBERS' => 1,
+                        'AM_MAINTAINER_MODE' => 1,
+                        'AC_FUNC_UTIME_NULL' => 1,
+                        'AC_FUNC_SELECT_ARGTYPES' => 1,
+                        'AC_FUNC_STRFTIME' => 1,
+                        'AC_HEADER_STAT' => 1,
+                        'AC_C_INLINE' => 1,
+                        'AC_PROG_CPP' => 1,
+                        'AC_TYPE_PID_T' => 1,
+                        'AC_C_CONST' => 1,
+                        'AC_PROG_LEX' => 1,
+                        'AM_ENABLE_MULTILIB' => 1,
+                        'AC_CONFIG_FILES' => 1,
+                        'include' => 1,
+                        'AC_FUNC_SETVBUF_REVERSED' => 1,
+                        'AC_PROG_INSTALL' => 1,
+                        'AM_GNU_GETTEXT' => 1,
+                        'AC_CHECK_LIB' => 1,
+                        'AC_FUNC_OBSTACK' => 1,
+                        'AC_FUNC_MALLOC' => 1,
+                        'AC_FUNC_GETGROUPS' => 1,
+                        'AC_FUNC_GETLOADAVG' => 1,
+                        'AH_OUTPUT' => 1,
+                        'AC_FUNC_FSEEKO' => 1,
+                        'AM_PROG_CC_C_O' => 1,
+                        'AM_CONDITIONAL' => 1,
+                        'AC_CANONICAL_SYSTEM' => 1,
+                        'AC_FUNC_MKTIME' => 1,
+                        'AC_CONFIG_HEADERS' => 1,
+                        'AC_HEADER_SYS_WAIT' => 1,
+                        'AC_FUNC_MEMCMP' => 1,
+                        'AC_PROG_LN_S' => 1,
+                        'm4_include' => 1,
+                        'AC_HEADER_DIRENT' => 1,
+                        'AC_CHECK_FUNCS' => 1
+                      }
+                    ], 'Autom4te::Request' )
+           );
+
Index: /ReferenceApplication/autom4te.cache/traces.0
===================================================================
--- /ReferenceApplication/autom4te.cache/traces.0	(revision 5)
+++ /ReferenceApplication/autom4te.cache/traces.0	(revision 5)
@@ -0,0 +1,8741 @@
+m4trace:/usr/share/aclocal/libtool.m4:71: -1- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+  AC_PROVIDE_IFELSE([AC_PROG_CXX],
+    [AC_LIBTOOL_CXX],
+    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+  ])])
+dnl And a similar setup for Fortran 77 support
+  AC_PROVIDE_IFELSE([AC_PROG_F77],
+    [AC_LIBTOOL_F77],
+    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])
+
+dnl Quote AM_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or AM_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+    [AC_LIBTOOL_GCJ],
+    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+      [AC_LIBTOOL_GCJ],
+      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+	[AC_LIBTOOL_GCJ],
+      [ifdef([AC_PROG_GCJ],
+	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([A][M_PROG_GCJ],
+	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([LT_AC_PROG_GCJ],
+	     [define([LT_AC_PROG_GCJ],
+		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])
+m4trace:/usr/share/aclocal/libtool.m4:91: -1- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])
+m4trace:/usr/share/aclocal/libtool.m4:233: -1- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
+
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_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.
+Xsed='sed -e s/^X//'
+[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 avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    AC_PATH_MAGIC
+  fi
+  ;;
+esac
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE([libtool-lock],
+    [AC_HELP_STRING([--disable-libtool-lock],
+	[avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+AC_ARG_WITH([pic],
+    [AC_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=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])
+m4trace:/usr/share/aclocal/libtool.m4:246: -1- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])
+m4trace:/usr/share/aclocal/libtool.m4:265: -1- AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])
+m4trace:/usr/share/aclocal/libtool.m4:276: -1- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE],
+	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+	 [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])
+m4trace:/usr/share/aclocal/libtool.m4:432: -1- AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
+
+echo=${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 <<EOF
+[$]*
+EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$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 &&
+       echo_test_string="`eval $cmd`" &&
+       (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.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])])
+m4trace:/usr/share/aclocal/libtool.m4:560: -1- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock],
+    [AC_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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|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-*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-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          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_TRY_LINK([],[],[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
+  ;;
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+  ])
+esac
+
+need_locks="$enable_libtool_lock"
+
+])
+m4trace:/usr/share/aclocal/libtool.m4:603: -1- AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED])
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   printf "$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}? :&$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
+     if test ! -s conftest.err; then
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$5], , :, [$5])
+else
+    ifelse([$6], , :, [$6])
+fi
+])
+m4trace:/usr/share/aclocal/libtool.m4:635: -1- AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The compiler 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
+     else
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$4], , :, [$4])
+else
+    ifelse([$5], , :, [$5])
+fi
+])
+m4trace:/usr/share/aclocal/libtool.m4:706: -1- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# 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*)
+    # 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;
+    ;;
+
+  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;
+    ;;
+
+ *)
+    # 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"`$CONFIG_SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+	       = "XX$teststring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
+	    lt_cv_sys_max_cmd_len=$new_result &&
+	    test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    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`
+    ;;
+  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
+])
+m4trace:/usr/share/aclocal/libtool.m4:713: -1- AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl
+])
+m4trace:/usr/share/aclocal/libtool.m4:802: -1- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_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 <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}]
+EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_unknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])
+m4trace:/usr/share/aclocal/libtool.m4:915: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_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*)
+    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="-dld"],
+	[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="-dld"])
+	      ])
+	    ])
+	  ])
+	])
+      ])
+    ;;
+  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"
+    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_AC_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
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+    	  lt_cv_dlopen_self_static, [dnl
+	  _LT_AC_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
+])
+m4trace:/usr/share/aclocal/libtool.m4:964: -1- AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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}? :&$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
+     if test ! -s out/conftest.err; then
+       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w .
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+])
+])
+m4trace:/usr/share/aclocal/libtool.m4:991: -1- AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl
+
+hard_links="nottested"
+if test "$_LT_AC_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
+])
+m4trace:/usr/share/aclocal/libtool.m4:1008: -1- AC_DEFUN([AC_LIBTOOL_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
+])
+m4trace:/usr/share/aclocal/libtool.m4:1049: -1- AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+   test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
+   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$_LT_AC_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_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_AC_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; 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
+])
+m4trace:/usr/share/aclocal/libtool.m4:1078: -1- AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [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"
+         AC_MSG_RESULT([yes])
+       else
+  AC_MSG_RESULT([no])
+fi
+       ;;
+   *)
+  AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+])
+m4trace:/usr/share/aclocal/libtool.m4:1638: -1- AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics])
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | 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'
+  ;;
+
+netbsdelf*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=yes
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+])
+m4trace:/usr/share/aclocal/libtool.m4:1737: -1- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags],
+    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+        [include additional configurations @<:@automatic@:>@])],
+    [tagnames="$withval"])
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    AC_MSG_WARN([output file `$ofile' does not exist])
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
+    else
+      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+    fi
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+    "") ;;
+    *)  AC_MSG_ERROR([invalid tag name: $tagname])
+	;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      AC_MSG_ERROR([tag name \"$tagname\" already exists])
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      CXX)
+	if test -n "$CXX" && test "X$CXX" != "Xno"; then
+	  AC_LIBTOOL_LANG_CXX_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      F77)
+	if test -n "$F77" && test "X$F77" != "Xno"; then
+	  AC_LIBTOOL_LANG_F77_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      GCJ)
+	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+	  AC_LIBTOOL_LANG_GCJ_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      RC)
+	AC_LIBTOOL_LANG_RC_CONFIG
+	;;
+
+      *)
+	AC_MSG_ERROR([Unsupported tag name: $tagname])
+	;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    AC_MSG_ERROR([unable to update list of available tagged configurations.])
+  fi
+fi
+])
+m4trace:/usr/share/aclocal/libtool.m4:1745: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])
+m4trace:/usr/share/aclocal/libtool.m4:1753: -1- AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
+])
+m4trace:/usr/share/aclocal/libtool.m4:1783: -1- AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([shared],
+    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+	[build shared libraries @<:@default=]AC_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=]AC_ENABLE_SHARED_DEFAULT)
+])
+m4trace:/usr/share/aclocal/libtool.m4:1792: -1- AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])
+m4trace:/usr/share/aclocal/libtool.m4:1822: -1- AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([static],
+    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+	[build static libraries @<:@default=]AC_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=]AC_ENABLE_STATIC_DEFAULT)
+])
+m4trace:/usr/share/aclocal/libtool.m4:1831: -1- AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])
+m4trace:/usr/share/aclocal/libtool.m4:1861: -1- AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([fast-install],
+    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]AC_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=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])
+m4trace:/usr/share/aclocal/libtool.m4:1870: -1- AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)
+])
+m4trace:/usr/share/aclocal/libtool.m4:1880: -1- AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])
+m4trace:/usr/share/aclocal/libtool.m4:1958: -1- AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_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="ifelse([$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 <<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
+
+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
+])
+m4trace:/usr/share/aclocal/libtool.m4:1973: -1- AC_DEFUN([AC_PATH_MAGIC], [AC_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
+    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])
+m4trace:/usr/share/aclocal/libtool.m4:2058: -1- AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld],
+    [AC_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])
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])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 GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])
+m4trace:/usr/share/aclocal/libtool.m4:2076: -1- AC_DEFUN([AC_PROG_LD_GNU], [AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])
+m4trace:/usr/share/aclocal/libtool.m4:2093: -1- AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], [AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+])
+m4trace:/usr/share/aclocal/libtool.m4:2274: -1- AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], [AC_CACHE_CHECK([how to recognise dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi4*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu)
+  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)/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
+  ;;
+
+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*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+  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=unknown
+  ;;
+
+openbsd*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
+  else
+    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  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
+    ;;
+  esac
+  ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+  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
+])
+m4trace:/usr/share/aclocal/libtool.m4:2319: -1- AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm="$ac_dir/${ac_tool_prefix}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"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+])
+m4trace:/usr/share/aclocal/libtool.m4:2340: -1- AC_DEFUN([AC_CHECK_LIBM], [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
+])
+m4trace:/usr/share/aclocal/libtool.m4:2365: -1- AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  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='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])
+m4trace:/usr/share/aclocal/libtool.m4:2401: -1- AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  AC_CHECK_LIB(ltdl, lt_dlinit,
+  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+  [if test x"$enable_ltdl_install" = xno; then
+     AC_MSG_WARN([libltdl not installed, but installation disabled])
+   else
+     enable_ltdl_install=yes
+   fi
+  ])
+  if test x"$enable_ltdl_install" = x"yes"; then
+    ac_configure_args="$ac_configure_args --enable-ltdl-install"
+    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  else
+    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+    LIBLTDL="-lltdl"
+    LTDLINCL=
+  fi
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])
+m4trace:/usr/share/aclocal/libtool.m4:2409: -1- AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX])
+])
+m4trace:/usr/share/aclocal/libtool.m4:2418: -1- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+])
+m4trace:/usr/share/aclocal/libtool.m4:2426: -1- AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77])
+])
+m4trace:/usr/share/aclocal/libtool.m4:2434: -1- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+])
+m4trace:/usr/share/aclocal/libtool.m4:2442: -1- AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ])
+])
+m4trace:/usr/share/aclocal/libtool.m4:2455: -1- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
+])
+m4trace:/usr/share/aclocal/libtool.m4:2464: -1- AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
+])
+m4trace:/usr/share/aclocal/libtool.m4:2472: -1- AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+m4trace:/usr/share/aclocal/libtool.m4:2609: -1- AC_DEFUN([_LT_AC_LANG_C_CONFIG], [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_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+_LT_AC_SYS_COMPILER
+
+#
+# Check for any special shared library compilation flags.
+#
+_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
+    ;;
+  esac
+fi
+if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
+  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
+  if echo "$old_CC $old_CFLAGS " | grep "[[ 	]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ 	]]" >/dev/null; then :
+  else
+    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
+    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
+  fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
+  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
+  [],
+  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+
+
+## 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...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+# Report which librarie types wil 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
+  ;;
+
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+  darwin* | rhapsody*)
+  if test "$GCC" = yes; then
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    case "$host_os" in
+    rhapsody* | darwin1.[[012]])
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+      ;;
+    *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[[012]])
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+      ;;
+    esac
+    output_verbose_link_cmd='echo'
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
+    _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=no
+    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+  else
+    _LT_AC_TAGVAR(ld_shlibs, $1)=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])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])
+m4trace:/usr/share/aclocal/libtool.m4:2617: -1- AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+m4trace:/usr/share/aclocal/libtool.m4:3504: -1- AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# 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
+  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
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+  AC_PROG_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_AC_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_AC_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_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  aix4* | aix5*)
+    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]].*|aix5*)
+	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_AC_TAGVAR(archive_cmds, $1)=''
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+    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
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	else
+	  # We have old collect2
+	  _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+	fi
+      esac
+      shared_flag='-shared'
+    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
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      _LT_AC_SYS_LIBPATH_AIX
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	_LT_AC_SYS_LIBPATH_AIX
+	_LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	# -bexpall does not export symbols beginning with underscore (_)
+	_LT_AC_TAGVAR(always_export_symbols, $1)=yes
+	# Exported symbols can be pulled into shared objects from archives
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+	# This is similar to how AIX traditionally builds it's shared libraries.
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+    # as there is no search path for DLLs.
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+    _LT_AC_TAGVAR(always_export_symbols, $1)=no
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      _LT_AC_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}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+  ;;
+
+  darwin* | rhapsody*)
+  if test "$GXX" = yes; then
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    case "$host_os" in
+    rhapsody* | darwin1.[[012]])
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+      ;;
+    *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[[012]])
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+      ;;
+    esac
+    lt_int_apple_cc_single_mod=no
+    output_verbose_link_cmd='echo'
+    if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+      lt_int_apple_cc_single_mod=yes
+    fi
+    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+    else
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -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'
+    fi
+    _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+
+    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=no
+    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+  else
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+  fi
+    ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      ghcx)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  freebsd[12]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  freebsd-elf*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  freebsd* | kfreebsd*-gnu)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    aCC)
+      _LT_AC_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) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case "$host_cpu" in
+      hppa*64*)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+        ;;
+      ia64*)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+        ;;
+      *)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        ;;
+      esac
+    fi
+    case "$host_cpu" in
+    hppa*64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+    ia64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    *)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      aCC)
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  _LT_AC_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 $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case "$host_cpu" in
+	    ia64*|hppa*64*)
+	      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	      ;;
+	    *)
+	      _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC)
+	# SGI C++
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${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_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+	  else
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+	;;
+    esac
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    ;;
+  linux*)
+    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_AC_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_AC_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 $list'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+	_LT_AC_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_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc)
+	# Intel C++
+	with_gnu_ld=yes
+	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      cxx)
+	# Compaq C++
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	_LT_AC_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 $templist | $SED "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 $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_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::"'
+    ;;
+  osf3*)
+    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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      cxx)
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	_LT_AC_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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	  _LT_AC_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 ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+	;;
+      RCC)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      cxx)
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+	_LT_AC_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 -set_version	$verstring` -update_registry $objdir/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	_LT_AC_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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	 _LT_AC_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` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  sco*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    case $cc_basename in
+      CC)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      lcc)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC)
+	# Sun C++ 4.2, 5.x and Centerline C++
+	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	_LT_AC_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} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	case $host_os in
+	  solaris2.[0-5] | solaris2.[0-5].*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+	# 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 -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+	# 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_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx)
+	# Green Hills C++ Compiler
+	_LT_AC_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_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_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...
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+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
+])
+m4trace:/usr/share/aclocal/libtool.m4:3640: -1- AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP], [
+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...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+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
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+  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_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	   else
+	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_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_AC_TAGVAR(postdeps, $1)"; then
+	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+	 else
+	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_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_AC_TAGVAR(predep_objects, $1)"; then
+	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
+	 else
+	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+	 fi
+       else
+	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+	 else
+	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_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
+
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])
+m4trace:/usr/share/aclocal/libtool.m4:3647: -1- AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+m4trace:/usr/share/aclocal/libtool.m4:3739: -1- AC_DEFUN([_LT_AC_LANG_F77_CONFIG], [AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_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_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+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
+  ;;
+aix4* | aix5*)
+  test "$enable_shared" = yes && enable_static=no
+  ;;
+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])
+
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])
+m4trace:/usr/share/aclocal/libtool.m4:3747: -1- AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+m4trace:/usr/share/aclocal/libtool.m4:3794: -1- AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], [AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+
+## 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...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])
+m4trace:/usr/share/aclocal/libtool.m4:3802: -1- AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+m4trace:/usr/share/aclocal/libtool.m4:3833: -1- AC_DEFUN([_LT_AC_LANG_RC_CONFIG], [AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# 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_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])
+m4trace:/usr/share/aclocal/libtool.m4:4318: -1- AC_DEFUN([AC_LIBTOOL_CONFIG], [# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    _LT_AC_TAGVAR(compiler, $1) \
+    _LT_AC_TAGVAR(CC, $1) \
+    _LT_AC_TAGVAR(LD, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+    _LT_AC_TAGVAR(old_archive_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+    _LT_AC_TAGVAR(predep_objects, $1) \
+    _LT_AC_TAGVAR(postdep_objects, $1) \
+    _LT_AC_TAGVAR(predeps, $1) \
+    _LT_AC_TAGVAR(postdeps, $1) \
+    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+    _LT_AC_TAGVAR(archive_cmds, $1) \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(postinstall_cmds, $1) \
+    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+    _LT_AC_TAGVAR(no_undefined_flag, $1) \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+    _LT_AC_TAGVAR(hardcode_automatic, $1) \
+    _LT_AC_TAGVAR(module_cmds, $1) \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+    _LT_AC_TAGVAR(exclude_expsyms, $1) \
+    _LT_AC_TAGVAR(include_expsyms, $1); do
+
+    case $var in
+    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(module_cmds, $1) | \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\[$]0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+    ;;
+  esac
+
+ifelse([$1], [],
+  [cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  AC_MSG_NOTICE([creating $ofile])],
+  [cfgfile="$ofile"])
+
+  cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $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.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
+
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+  case $host_os in
+  aix3*)
+    cat <<\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
+EOF
+    ;;
+  esac
+
+  # 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 '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+])
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+])
+m4trace:/usr/share/aclocal/libtool.m4:4336: -1- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+])
+m4trace:/usr/share/aclocal/libtool.m4:4522: -1- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
+# 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]]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris* | sysv5*)
+  symcode='[[BDRT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# 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
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Write the raw and C identifiers.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+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 <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+	  cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[[]] =
+{
+EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+	  cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+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_AC_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 -f 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
+])
+m4trace:/usr/share/aclocal/libtool.m4:4983: -1- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # 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).
+      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # 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*)
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	else
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  ghcx)
+	    # Green Hills C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    if test "$host_cpu" != ia64; then
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	    fi
+	    ;;
+	  aCC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    case "$host_cpu" in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC)
+	    # KAI C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  icpc)
+	    # Intel C++
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  cxx)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    ;;
+	  RCC)
+	    # Rational C++ 2.4.1
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  cxx)
+	    # Digital/Compaq C++
+	    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      sco*)
+	case $cc_basename in
+	  CC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	    ;;
+	  gcx)
+	    # Green Hills C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC)
+	    # Sun C++ 4.x
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  lcc)
+	    # Lucid
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC)
+	    # NonStop-UX NCC 3.20
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      unixware*)
+	;;
+      vxworks*)
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+	;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    linux*)
+      case $CC in
+      icc* | ecc*)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      ccc*)
+        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+])
+m4trace:/usr/share/aclocal/libtool.m4:5820: -1- AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # 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_AC_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_AC_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_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  linux*)
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=no
+  ;;
+  *)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+],[
+  runpath_var=
+  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_AC_TAGVAR(archive_cmds, $1)=
+  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+  _LT_AC_TAGVAR(module_cmds, $1)=
+  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(always_export_symbols, $1)=no
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_AC_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_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_AC_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}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=no
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	_LT_AC_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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds"
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` 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
+      if test $supports_anon_versioning = yes; then
+        _LT_AC_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 -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds"
+      fi
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=no
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+    ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
+      runpath_var=LD_RUN_PATH
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+      _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+      _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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_AC_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_AC_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]].*|aix5*)
+	  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_AC_TAGVAR(archive_cmds, $1)=''
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+      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
+  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	  else
+  	  # We have old collect2
+  	  _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+	esac
+	shared_flag='-shared'
+      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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       _LT_AC_SYS_LIBPATH_AIX
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 _LT_AC_SYS_LIBPATH_AIX
+	 _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      # see comment about different semantics on the GNU ld section
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    bsdi4*)
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+      # FIXME: Should let the user specify the lib program.
+      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    darwin* | rhapsody*)
+    if test "$GXX" = yes ; then
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      case "$host_os" in
+      rhapsody* | darwin1.[[012]])
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+	;;
+      *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[[012]])
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+	;;
+      esac
+    	lt_int_apple_cc_single_mod=no
+    	output_verbose_link_cmd='echo'
+    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+    	  lt_int_apple_cc_single_mod=yes
+    	fi
+    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+    	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+    	else
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -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'
+      fi
+      _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        else
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        fi
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+      ;;
+
+    dgux*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    freebsd1*)
+      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	_LT_AC_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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_AC_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*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  ;;
+	ia64*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    openbsd*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	   ;;
+	 *)
+	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_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_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_AC_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~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    sco3.2v5*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_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}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_AC_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'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+      esac
+      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+        ;;
+	motorola)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv5*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_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'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_AC_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*
+      printf "$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_AC_TAGVAR(lt_prog_compiler_wl, $1)
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+        then
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+        else
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+        fi
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+      ;;
+    esac
+  fi
+  ;;
+esac
+])
+m4trace:/usr/share/aclocal/libtool.m4:5860: -1- AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# #  ifdef __CYGWIN32__
+# #    define __CYGWIN__ __CYGWIN32__
+# #  endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+#   __hDllInstance_base = hInst;
+#   return TRUE;
+# }
+# /* ltdll.c ends here */
+])
+m4trace:/usr/share/aclocal/libtool.m4:5865: -1- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+m4trace:/usr/share/aclocal/libtool.m4:5869: -1- AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
+m4trace:/usr/share/aclocal/libtool.m4:5870: -1- AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+m4trace:/usr/share/aclocal/libtool.m4:5871: -1- AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+m4trace:/usr/share/aclocal/libtool.m4:5872: -1- AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+m4trace:/usr/share/aclocal/libtool.m4:5873: -1- AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+m4trace:/usr/share/aclocal/libtool.m4:5874: -1- AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
+m4trace:/usr/share/aclocal/libtool.m4:5875: -1- AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
+m4trace:/usr/share/aclocal/libtool.m4:5884: -1- AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no)
+  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+  AC_SUBST(GCJFLAGS)
+])
+m4trace:/usr/share/aclocal/libtool.m4:5888: -1- AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no)
+])
+m4trace:/usr/share/aclocal/libtool.m4:5951: -1- AC_DEFUN([LT_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
+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 && break
+  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_MSG_RESULT([$SED])
+])
+m4trace:/usr/share/aclocal/pkg.m4:44: -1- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
+	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		AC_MSG_RESULT([yes])
+	else
+		AC_MSG_RESULT([no])
+		PKG_CONFIG=""
+	fi
+		
+fi[]dnl
+])
+m4trace:/usr/share/aclocal/pkg.m4:114: -1- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_CACHE_CHECK([for $1][_CFLAGS], [pkg_cv_][$1][_CFLAGS],
+	[_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])])
+AC_CACHE_CHECK([for $1][_LIBS], [pkg_cv_][$1][_LIBS],
+	[_PKG_CONFIG([$1][_LIBS], [libs], [$2])])
+
+if test $pkg_failed = yes; then
+	$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+	# Put the nasty error message in config.log where it belongs
+	echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
+
+	ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.])],
+		[$4])
+elif test $pkg_failed = untried; then
+	ifelse([$4], , [AC_MSG_FAILURE(dnl
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
+		[$4])
+else
+	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+	ifelse([$3], , :, [$3])
+fi[]dnl
+])
+m4trace:/usr/share/aclocal-1.9/amversion.m4:13: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+m4trace:/usr/share/aclocal-1.9/amversion.m4:20: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.5])])
+m4trace:/usr/share/aclocal-1.9/auxdir.m4:52: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+m4trace:/usr/share/aclocal-1.9/cond.m4:32: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+m4trace:/usr/share/aclocal-1.9/depend.m4:131: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+m4trace:/usr/share/aclocal-1.9/depend.m4:141: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+m4trace:/usr/share/aclocal-1.9/depend.m4:156: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+m4trace:/usr/share/aclocal-1.9/depout.m4:53: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`AS_DIRNAME("$mf")`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`AS_DIRNAME(["$file"])`
+    AS_MKDIR_P([$dirpart/$fdir])
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+])
+m4trace:/usr/share/aclocal-1.9/depout.m4:67: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+m4trace:/usr/share/aclocal-1.9/header.m4:12: -1- AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+m4trace:/usr/share/aclocal-1.9/header.m4:12: -1- AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete.
+You should run autoupdate.])dnl
+AC_CONFIG_HEADERS($@)])
+m4trace:/usr/share/aclocal-1.9/init.m4:92: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+	      		     [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+m4trace:/usr/share/aclocal-1.9/init.m4:113: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $1 | $1:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+m4trace:/usr/share/aclocal-1.9/install-sh.m4:14: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+m4trace:/usr/share/aclocal-1.9/lead-dot.m4:21: -1- AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+m4trace:/usr/share/aclocal-1.9/make.m4:51: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+m4trace:/usr/share/aclocal-1.9/missing.m4:17: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+m4trace:/usr/share/aclocal-1.9/missing.m4:34: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+m4trace:/usr/share/aclocal-1.9/mkdirp.m4:63: -1- AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+AC_SUBST([mkdir_p])])
+m4trace:/usr/share/aclocal-1.9/options.m4:14: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+m4trace:/usr/share/aclocal-1.9/options.m4:20: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+m4trace:/usr/share/aclocal-1.9/options.m4:26: -1- AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+m4trace:/usr/share/aclocal-1.9/options.m4:32: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+m4trace:/usr/share/aclocal-1.9/runlog.m4:17: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+m4trace:/usr/share/aclocal-1.9/sanity.m4:51: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+m4trace:/usr/share/aclocal-1.9/strip.m4:28: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+m4trace:/usr/share/aclocal-1.9/tar.m4:95: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+])
+m4trace:configure.in:3: -1- AC_INIT([OGRE_REFAPP], [0.10.0])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^_?A[CHUM]_])
+m4trace:configure.in:3: -1- m4_pattern_forbid([_AC_])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
+m4trace:configure.in:3: -1- m4_pattern_allow([^AS_FLAGS$])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^_?m4_])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^dnl$])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^_?AS_])
+m4trace:configure.in:3: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}])
+m4trace:configure.in:3: -1- AC_SUBST([PATH_SEPARATOR])
+m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME],      ['AC_PACKAGE_NAME'])])
+m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME],   ['AC_PACKAGE_TARNAME'])])
+m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION],   ['AC_PACKAGE_VERSION'])])
+m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING],    ['AC_PACKAGE_STRING'])])
+m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
+m4trace:configure.in:3: -1- AC_SUBST([exec_prefix], [NONE])
+m4trace:configure.in:3: -1- AC_SUBST([prefix], [NONE])
+m4trace:configure.in:3: -1- AC_SUBST([program_transform_name], [s,x,x,])
+m4trace:configure.in:3: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
+m4trace:configure.in:3: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
+m4trace:configure.in:3: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
+m4trace:configure.in:3: -1- AC_SUBST([datadir], ['${prefix}/share'])
+m4trace:configure.in:3: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
+m4trace:configure.in:3: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
+m4trace:configure.in:3: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
+m4trace:configure.in:3: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
+m4trace:configure.in:3: -1- AC_SUBST([includedir], ['${prefix}/include'])
+m4trace:configure.in:3: -1- AC_SUBST([oldincludedir], ['/usr/include'])
+m4trace:configure.in:3: -1- AC_SUBST([infodir], ['${prefix}/info'])
+m4trace:configure.in:3: -1- AC_SUBST([mandir], ['${prefix}/man'])
+m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
+m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
+#undef PACKAGE_NAME])
+m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
+m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME])
+m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
+m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
+#undef PACKAGE_VERSION])
+m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
+m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING])
+m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
+m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT])
+m4trace:configure.in:3: -1- AC_SUBST([build_alias])
+m4trace:configure.in:3: -1- AC_SUBST([host_alias])
+m4trace:configure.in:3: -1- AC_SUBST([target_alias])
+m4trace:configure.in:3: -1- AC_SUBST([DEFS])
+m4trace:configure.in:3: -1- AC_SUBST([ECHO_C])
+m4trace:configure.in:3: -1- AC_SUBST([ECHO_N])
+m4trace:configure.in:3: -1- AC_SUBST([ECHO_T])
+m4trace:configure.in:3: -1- AC_SUBST([LIBS])
+m4trace:configure.in:4: -1- AM_INIT_AUTOMAKE([1.6.1 foreign no-installinfo no-installman subdir-objects])
+m4trace:configure.in:4: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
+m4trace:configure.in:4: -1- AM_SET_CURRENT_AUTOMAKE_VERSION
+m4trace:configure.in:4: -1- AM_AUTOMAKE_VERSION([1.9.5])
+m4trace:configure.in:4: -1- AC_PROG_INSTALL
+m4trace:configure.in:4: -1- AC_SUBST([INSTALL_PROGRAM])
+m4trace:configure.in:4: -1- AC_SUBST([INSTALL_SCRIPT])
+m4trace:configure.in:4: -1- AC_SUBST([INSTALL_DATA])
+m4trace:configure.in:4: -1- AC_SUBST([CYGPATH_W])
+m4trace:configure.in:4: -1- _AM_SET_OPTIONS([1.6.1 foreign no-installinfo no-installman subdir-objects])
+m4trace:configure.in:4: -1- _AM_SET_OPTION([1.6.1])
+m4trace:configure.in:4: -2- _AM_MANGLE_OPTION([1.6.1])
+m4trace:configure.in:4: -1- _AM_SET_OPTION([foreign])
+m4trace:configure.in:4: -2- _AM_MANGLE_OPTION([foreign])
+m4trace:configure.in:4: -1- _AM_SET_OPTION([no-installinfo])
+m4trace:configure.in:4: -2- _AM_MANGLE_OPTION([no-installinfo])
+m4trace:configure.in:4: -1- _AM_SET_OPTION([no-installman])
+m4trace:configure.in:4: -2- _AM_MANGLE_OPTION([no-installman])
+m4trace:configure.in:4: -1- _AM_SET_OPTION([subdir-objects])
+m4trace:configure.in:4: -2- _AM_MANGLE_OPTION([subdir-objects])
+m4trace:configure.in:4: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])
+m4trace:configure.in:4: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])
+m4trace:configure.in:4: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
+m4trace:configure.in:4: -2- _AM_MANGLE_OPTION([no-define])
+m4trace:configure.in:4: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE])
+m4trace:configure.in:4: -1- AH_OUTPUT([PACKAGE], [/* Name of package */
+#undef PACKAGE])
+m4trace:configure.in:4: -1- AC_DEFINE_TRACE_LITERAL([VERSION])
+m4trace:configure.in:4: -1- AH_OUTPUT([VERSION], [/* Version number of package */
+#undef VERSION])
+m4trace:configure.in:4: -1- AM_SANITY_CHECK
+m4trace:configure.in:4: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+m4trace:configure.in:4: -1- AM_MISSING_HAS_RUN
+m4trace:configure.in:4: -1- AM_AUX_DIR_EXPAND
+m4trace:configure.in:4: -1- AC_SUBST([ACLOCAL])
+m4trace:configure.in:4: -1- AM_MISSING_PROG([AUTOCONF], [autoconf])
+m4trace:configure.in:4: -1- AC_SUBST([AUTOCONF])
+m4trace:configure.in:4: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+m4trace:configure.in:4: -1- AC_SUBST([AUTOMAKE])
+m4trace:configure.in:4: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader])
+m4trace:configure.in:4: -1- AC_SUBST([AUTOHEADER])
+m4trace:configure.in:4: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo])
+m4trace:configure.in:4: -1- AC_SUBST([MAKEINFO])
+m4trace:configure.in:4: -1- AM_PROG_INSTALL_SH
+m4trace:configure.in:4: -1- AC_SUBST([install_sh])
+m4trace:configure.in:4: -1- AM_PROG_INSTALL_STRIP
+m4trace:configure.in:4: -1- AC_SUBST([STRIP])
+m4trace:configure.in:4: -1- AC_SUBST([ac_ct_STRIP])
+m4trace:configure.in:4: -1- AC_SUBST([INSTALL_STRIP_PROGRAM])
+m4trace:configure.in:4: -1- AM_PROG_MKDIR_P
+m4trace:configure.in:4: -1- AC_SUBST([mkdir_p])
+m4trace:configure.in:4: -1- AC_PROG_AWK
+m4trace:configure.in:4: -1- AC_SUBST([AWK])
+m4trace:configure.in:4: -1- AC_PROG_MAKE_SET
+m4trace:configure.in:4: -1- AC_SUBST([SET_MAKE])
+m4trace:configure.in:4: -1- AM_SET_LEADING_DOT
+m4trace:configure.in:4: -1- AC_SUBST([am__leading_dot])
+m4trace:configure.in:4: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+	      		     [_AM_PROG_TAR([v7])])])
+m4trace:configure.in:4: -2- _AM_MANGLE_OPTION([tar-ustar])
+m4trace:configure.in:4: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])
+m4trace:configure.in:4: -2- _AM_MANGLE_OPTION([tar-pax])
+m4trace:configure.in:4: -1- _AM_PROG_TAR([v7])
+m4trace:configure.in:4: -1- AM_MISSING_PROG([AMTAR], [tar])
+m4trace:configure.in:4: -1- AC_SUBST([AMTAR])
+m4trace:configure.in:4: -1- AC_SUBST([am__tar])
+m4trace:configure.in:4: -1- AC_SUBST([am__untar])
+m4trace:configure.in:4: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+m4trace:configure.in:4: -2- _AM_MANGLE_OPTION([no-dependencies])
+m4trace:configure.in:5: -1- AM_CONFIG_HEADER([ReferenceAppLayer/include/config.h])
+m4trace:configure.in:5: -1- _m4_warn([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete.
+You should run autoupdate.], [/usr/share/aclocal-1.9/header.m4:12: AM_CONFIG_HEADER is expanded from...
+configure.in:5: the top level])
+m4trace:configure.in:5: -1- AC_CONFIG_HEADERS([ReferenceAppLayer/include/config.h])
+m4trace:configure.in:7: -1- AC_CANONICAL_HOST
+m4trace:configure.in:7: -1- AC_SUBST([build], [$ac_cv_build])
+m4trace:configure.in:7: -1- AC_SUBST([build_cpu], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`])
+m4trace:configure.in:7: -1- AC_SUBST([build_vendor], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`])
+m4trace:configure.in:7: -1- AC_SUBST([build_os], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`])
+m4trace:configure.in:7: -1- AC_SUBST([host], [$ac_cv_host])
+m4trace:configure.in:7: -1- AC_SUBST([host_cpu], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`])
+m4trace:configure.in:7: -1- AC_SUBST([host_vendor], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`])
+m4trace:configure.in:7: -1- AC_SUBST([host_os], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`])
+m4trace:configure.in:7: -1- _m4_warn([syntax], [AC_ARG_PROGRAM was called before AC_CANONICAL_TARGET], [autoconf/general.m4:1657: AC_CANONICAL_TARGET is expanded from...
+configure.in:7: the top level])
+m4trace:configure.in:7: -1- AC_SUBST([target], [$ac_cv_target])
+m4trace:configure.in:7: -1- AC_SUBST([target_cpu], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`])
+m4trace:configure.in:7: -1- AC_SUBST([target_vendor], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`])
+m4trace:configure.in:7: -1- AC_SUBST([target_os], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`])
+m4trace:configure.in:10: -1- AC_PROG_CC
+m4trace:configure.in:10: -1- AC_SUBST([CC])
+m4trace:configure.in:10: -1- AC_SUBST([CFLAGS])
+m4trace:configure.in:10: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.in:10: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.in:10: -1- AC_SUBST([CC])
+m4trace:configure.in:10: -1- AC_SUBST([ac_ct_CC])
+m4trace:configure.in:10: -1- AC_SUBST([CC])
+m4trace:configure.in:10: -1- AC_SUBST([ac_ct_CC])
+m4trace:configure.in:10: -1- AC_SUBST([CC])
+m4trace:configure.in:10: -1- AC_SUBST([CC])
+m4trace:configure.in:10: -1- AC_SUBST([ac_ct_CC])
+m4trace:configure.in:10: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
+m4trace:configure.in:10: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
+m4trace:configure.in:10: -1- _AM_DEPENDENCIES([CC])
+m4trace:configure.in:10: -1- AM_SET_DEPDIR
+m4trace:configure.in:10: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])
+m4trace:configure.in:10: -1- AM_OUTPUT_DEPENDENCY_COMMANDS
+m4trace:configure.in:10: -1- AM_MAKE_INCLUDE
+m4trace:configure.in:10: -1- AC_SUBST([am__include])
+m4trace:configure.in:10: -1- AC_SUBST([am__quote])
+m4trace:configure.in:10: -1- AM_DEP_TRACK
+m4trace:configure.in:10: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+m4trace:configure.in:10: -1- AC_SUBST([AMDEP_TRUE])
+m4trace:configure.in:10: -1- AC_SUBST([AMDEP_FALSE])
+m4trace:configure.in:10: -1- AC_SUBST([AMDEPBACKSLASH])
+m4trace:configure.in:10: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type])
+m4trace:configure.in:10: -1- AM_CONDITIONAL([am__fastdepCC], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3])
+m4trace:configure.in:10: -1- AC_SUBST([am__fastdepCC_TRUE])
+m4trace:configure.in:10: -1- AC_SUBST([am__fastdepCC_FALSE])
+m4trace:configure.in:11: -1- AC_PROG_CXX
+m4trace:configure.in:11: -1- AC_SUBST([CXX])
+m4trace:configure.in:11: -1- AC_SUBST([CXXFLAGS])
+m4trace:configure.in:11: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.in:11: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.in:11: -1- AC_SUBST([CXX])
+m4trace:configure.in:11: -1- AC_SUBST([ac_ct_CXX])
+m4trace:configure.in:11: -1- _AM_DEPENDENCIES([CXX])
+m4trace:configure.in:11: -1- AC_SUBST([CXXDEPMODE], [depmode=$am_cv_CXX_dependencies_compiler_type])
+m4trace:configure.in:11: -1- AM_CONDITIONAL([am__fastdepCXX], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3])
+m4trace:configure.in:11: -1- AC_SUBST([am__fastdepCXX_TRUE])
+m4trace:configure.in:11: -1- AC_SUBST([am__fastdepCXX_FALSE])
+m4trace:configure.in:12: -1- AC_PROG_INSTALL
+m4trace:configure.in:12: -1- AC_SUBST([INSTALL_PROGRAM])
+m4trace:configure.in:12: -1- AC_SUBST([INSTALL_SCRIPT])
+m4trace:configure.in:12: -1- AC_SUBST([INSTALL_DATA])
+m4trace:configure.in:14: -1- AM_PROG_LIBTOOL
+m4trace:configure.in:14: -1- AC_PROG_LIBTOOL
+m4trace:configure.in:14: -1- _AC_PROG_LIBTOOL
+m4trace:configure.in:14: -1- AC_LIBTOOL_SETUP
+m4trace:configure.in:14: -1- AC_ENABLE_SHARED
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:219: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
+/usr/share/aclocal/libtool.m4:1783: AC_ENABLE_SHARED is expanded from...
+configure.in:14: AC_ENABLE_SHARED is required by...
+/usr/share/aclocal/libtool.m4:233: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+/usr/share/aclocal/libtool.m4:91: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+/usr/share/aclocal/libtool.m4:71: AC_PROG_LIBTOOL is expanded from...
+/usr/share/aclocal/libtool.m4:5869: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- AC_ENABLE_STATIC
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:219: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
+/usr/share/aclocal/libtool.m4:1822: AC_ENABLE_STATIC is expanded from...
+configure.in:14: AC_ENABLE_STATIC is required by...
+/usr/share/aclocal/libtool.m4:233: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+/usr/share/aclocal/libtool.m4:91: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+/usr/share/aclocal/libtool.m4:71: AC_PROG_LIBTOOL is expanded from...
+/usr/share/aclocal/libtool.m4:5869: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- AC_ENABLE_FAST_INSTALL
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:219: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
+/usr/share/aclocal/libtool.m4:1861: AC_ENABLE_FAST_INSTALL is expanded from...
+configure.in:14: AC_ENABLE_FAST_INSTALL is required by...
+/usr/share/aclocal/libtool.m4:233: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+/usr/share/aclocal/libtool.m4:91: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+/usr/share/aclocal/libtool.m4:71: AC_PROG_LIBTOOL is expanded from...
+/usr/share/aclocal/libtool.m4:5869: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- AC_PROG_LD
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:219: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1331: AC_ARG_WITH is expanded from...
+/usr/share/aclocal/libtool.m4:2058: AC_PROG_LD is expanded from...
+configure.in:14: AC_PROG_LD is required by...
+/usr/share/aclocal/libtool.m4:233: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+/usr/share/aclocal/libtool.m4:91: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+/usr/share/aclocal/libtool.m4:71: AC_PROG_LIBTOOL is expanded from...
+/usr/share/aclocal/libtool.m4:5869: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- LT_AC_PROG_SED
+m4trace:configure.in:14: -1- AC_PROG_LD_GNU
+m4trace:configure.in:14: -1- AC_PROG_EGREP
+m4trace:configure.in:14: -1- AC_SUBST([EGREP])
+m4trace:configure.in:14: -1- AC_PROG_LD_RELOAD_FLAG
+m4trace:configure.in:14: -1- AC_PROG_NM
+m4trace:configure.in:14: -1- AC_PROG_LN_S
+m4trace:configure.in:14: -1- AC_SUBST([LN_S], [$as_ln_s])
+m4trace:configure.in:14: -1- AC_DEPLIBS_CHECK_METHOD
+m4trace:configure.in:14: -1- AC_LIBTOOL_SYS_MAX_CMD_LEN
+m4trace:configure.in:14: -1- AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [])
+m4trace:configure.in:14: -1- AC_LIBTOOL_OBJDIR
+m4trace:configure.in:14: -1- _LT_AC_SYS_COMPILER
+m4trace:configure.in:14: -1- _LT_AC_PROG_ECHO_BACKSLASH
+m4trace:configure.in:14: -1- _LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
+
+echo=${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 <<EOF
+[$]*
+EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$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 &&
+       echo_test_string="`eval $cmd`" &&
+       (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.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])
+m4trace:configure.in:14: -1- AC_SUBST([ECHO])
+m4trace:configure.in:14: -1- AC_SUBST([AR])
+m4trace:configure.in:14: -1- AC_SUBST([ac_ct_AR])
+m4trace:configure.in:14: -1- AC_SUBST([RANLIB])
+m4trace:configure.in:14: -1- AC_SUBST([ac_ct_RANLIB])
+m4trace:configure.in:14: -1- AC_SUBST([STRIP])
+m4trace:configure.in:14: -1- AC_SUBST([ac_ct_STRIP])
+m4trace:configure.in:14: -1- AC_PATH_MAGIC
+m4trace:configure.in:14: -1- AC_PATH_TOOL_PREFIX([${ac_tool_prefix}file], [/usr/bin$PATH_SEPARATOR$PATH])
+m4trace:configure.in:14: -1- AC_PATH_TOOL_PREFIX([file], [/usr/bin$PATH_SEPARATOR$PATH])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:219: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
+/usr/share/aclocal/libtool.m4:233: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+/usr/share/aclocal/libtool.m4:91: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+/usr/share/aclocal/libtool.m4:71: AC_PROG_LIBTOOL is expanded from...
+/usr/share/aclocal/libtool.m4:5869: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:219: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1331: AC_ARG_WITH is expanded from...
+/usr/share/aclocal/libtool.m4:233: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+/usr/share/aclocal/libtool.m4:91: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+/usr/share/aclocal/libtool.m4:71: AC_PROG_LIBTOOL is expanded from...
+/usr/share/aclocal/libtool.m4:5869: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- AC_LIBTOOL_LANG_C_CONFIG
+m4trace:configure.in:14: -1- _LT_AC_LANG_C_CONFIG
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([objext], [])
+m4trace:configure.in:14: -1- _LT_AC_SYS_COMPILER
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_cc_shlib], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_cc_shlib], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_cc_shlib], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_cc_shlib], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_cc_shlib], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_cc_shlib], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_cc_shlib], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_cc_shlib], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_cc_can_build_shared], [])
+m4trace:configure.in:14: -2- _LT_AC_TAGVAR([lt_prog_compiler_static_works], [])
+m4trace:configure.in:14: -2- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, ) works], [lt_prog_compiler_static_works], [$lt_prog_compiler_static], [], [_LT_AC_TAGVAR(lt_prog_compiler_static, )=])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_COMPILER_NO_RTTI([])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [])
+m4trace:configure.in:14: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], [lt_cv_prog_compiler_rtti_exceptions], [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, )="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, ) -fno-rtti -fno-exceptions"])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_COMPILER_PIC([])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -2- _LT_AC_TAGVAR([lt_prog_compiler_pic_works], [])
+m4trace:configure.in:14: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, ) works], [lt_prog_compiler_pic_works], [$_LT_AC_TAGVAR(lt_prog_compiler_pic, )ifelse([],[],[ -DPIC],[ifelse([],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, ) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, )=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, )" ;;
+     esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, )=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, )=no])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_CC_C_O([])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:14: -1- AC_LIBTOOL_SYS_HARD_LINK_LOCKS([])
+m4trace:configure.in:14: -1- _LT_AC_LOCK
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
+autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
+autoconf/general.m4:1808: AC_CACHE_CHECK is expanded from...
+/usr/share/aclocal/libtool.m4:560: _LT_AC_LOCK is expanded from...
+configure.in:14: _LT_AC_LOCK is required by...
+/usr/share/aclocal/libtool.m4:991: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
+/usr/share/aclocal/libtool.m4:2609: _LT_AC_LANG_C_CONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:2472: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:233: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+/usr/share/aclocal/libtool.m4:91: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+/usr/share/aclocal/libtool.m4:71: AC_PROG_LIBTOOL is expanded from...
+/usr/share/aclocal/libtool.m4:5869: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_LD_SHLIBS([])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([include_expsyms], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([exclude_expsyms], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([reload_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -2- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:14: -1- AC_LIBTOOL_SYS_DYNAMIC_LINKER([])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([runpath_var ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [])
+m4trace:configure.in:14: -1- AC_LIBTOOL_SYS_LIB_STRIP
+m4trace:configure.in:14: -1- AC_LIBTOOL_DLOPEN_SELF([])
+m4trace:configure.in:14: -1- _LT_AC_CHECK_DLFCN
+m4trace:configure.in:14: -1- AC_CHECK_HEADERS([dlfcn.h])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H])
+m4trace:configure.in:14: -1- AC_HEADER_STDC
+m4trace:configure.in:14: -1- AC_PROG_CPP
+m4trace:configure.in:14: -1- AC_SUBST([CPP])
+m4trace:configure.in:14: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.in:14: -1- AC_SUBST([CPP])
+m4trace:configure.in:14: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
+m4trace:configure.in:14: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS])
+m4trace:configure.in:14: -1- AC_CHECK_HEADERS([sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h], [], [], [$ac_includes_default])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H])
+m4trace:configure.in:14: -1- 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
+    ])
+m4trace:configure.in:14: -1- AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [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="-dld"])
+	      ])
+	    ])
+	  ])
+	])
+m4trace:configure.in:14: -1- 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="-dld"])
+	      ])
+	    ])
+m4trace:configure.in:14: -1- 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="-dld"])
+	      ])
+m4trace:configure.in:14: -1- AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+m4trace:configure.in:14: -1- _LT_AC_TRY_DLOPEN_SELF([lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=no], [lt_cv_dlopen_self=cross])
+m4trace:configure.in:14: -1- _LT_AC_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])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:14: -1- AC_LIBTOOL_CONFIG([])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([CC], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([LD], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predep_objects], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdep_objects], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predeps], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdeps], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postinstall_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postuninstall_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([exclude_expsyms], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([include_expsyms], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([GCC], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([LD], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predep_objects], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdep_objects], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predeps], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdeps], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([fix_srcfile_path], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([exclude_expsyms], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([include_expsyms], [])
+m4trace:configure.in:14: -1- _LT_AC_TAGCONFIG
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:219: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1331: AC_ARG_WITH is expanded from...
+/usr/share/aclocal/libtool.m4:1737: _LT_AC_TAGCONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:233: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+/usr/share/aclocal/libtool.m4:91: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+/usr/share/aclocal/libtool.m4:71: AC_PROG_LIBTOOL is expanded from...
+/usr/share/aclocal/libtool.m4:5869: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me:$LINENO: error: tag name \"$tagname\" already exists], [/usr/share/aclocal/libtool.m4:1737: _LT_AC_TAGCONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:233: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+/usr/share/aclocal/libtool.m4:91: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+/usr/share/aclocal/libtool.m4:71: AC_PROG_LIBTOOL is expanded from...
+/usr/share/aclocal/libtool.m4:5869: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me: error: tag name \"$tagname\" already exists], [/usr/share/aclocal/libtool.m4:1737: _LT_AC_TAGCONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:233: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+/usr/share/aclocal/libtool.m4:91: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+/usr/share/aclocal/libtool.m4:71: AC_PROG_LIBTOOL is expanded from...
+/usr/share/aclocal/libtool.m4:5869: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- AC_LIBTOOL_LANG_CXX_CONFIG
+m4trace:configure.in:14: -1- _LT_AC_LANG_CXX_CONFIG([CXX])
+m4trace:configure.in:14: -1- AC_SUBST([CXXCPP])
+m4trace:configure.in:14: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.in:14: -1- AC_SUBST([CXXCPP])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predeps], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([objext], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_SYS_COMPILER
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX])
+m4trace:configure.in:14: -1- AC_PROG_LD
+m4trace:configure.in:14: -1- AC_PROG_LD_GNU
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([GCC], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([LD], [CXX])
+m4trace:configure.in:14: -1- AC_LIBTOOL_POSTDEP_PREDEP([CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_COMPILER_PIC([CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -2- _LT_AC_TAGVAR([lt_prog_compiler_pic_works], [CXX])
+m4trace:configure.in:14: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX) works], [lt_prog_compiler_pic_works_CXX], [$_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)ifelse([CXX],[],[ -DPIC],[ifelse([CXX],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)" ;;
+     esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, CXX)=no])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_CC_C_O([CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:14: -1- AC_LIBTOOL_SYS_HARD_LINK_LOCKS([CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_LD_SHLIBS([CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -2- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:14: -1- AC_LIBTOOL_SYS_DYNAMIC_LINKER([CXX])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([runpath_var CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:14: -1- AC_LIBTOOL_SYS_LIB_STRIP
+m4trace:configure.in:14: -1- AC_LIBTOOL_DLOPEN_SELF([CXX])
+m4trace:configure.in:14: -1- 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
+    ])
+m4trace:configure.in:14: -1- AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [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="-dld"])
+	      ])
+	    ])
+	  ])
+	])
+m4trace:configure.in:14: -1- 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="-dld"])
+	      ])
+	    ])
+m4trace:configure.in:14: -1- 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="-dld"])
+	      ])
+m4trace:configure.in:14: -1- AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+m4trace:configure.in:14: -1- _LT_AC_TRY_DLOPEN_SELF([lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=no], [lt_cv_dlopen_self=cross])
+m4trace:configure.in:14: -1- _LT_AC_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])
+m4trace:configure.in:14: -1- AC_LIBTOOL_CONFIG([CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([CC], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([LD], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predeps], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postinstall_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postuninstall_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([exclude_expsyms], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([include_expsyms], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([GCC], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([LD], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predeps], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([fix_srcfile_path], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([exclude_expsyms], [CXX])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([include_expsyms], [CXX])
+m4trace:configure.in:14: -1- AC_LIBTOOL_LANG_F77_CONFIG
+m4trace:configure.in:14: -1- _LT_AC_LANG_F77_CONFIG([F77])
+m4trace:configure.in:14: -1- AC_SUBST([F77])
+m4trace:configure.in:14: -1- AC_SUBST([FFLAGS])
+m4trace:configure.in:14: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.in:14: -1- AC_SUBST([F77])
+m4trace:configure.in:14: -1- AC_SUBST([ac_ct_F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([objext], [F77])
+m4trace:configure.in:14: -1- _LT_AC_SYS_COMPILER
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([GCC], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([LD], [F77])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_COMPILER_PIC([F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -2- _LT_AC_TAGVAR([lt_prog_compiler_pic_works], [F77])
+m4trace:configure.in:14: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, F77) works], [lt_prog_compiler_pic_works_F77], [$_LT_AC_TAGVAR(lt_prog_compiler_pic, F77)ifelse([F77],[],[ -DPIC],[ifelse([F77],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, F77) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, F77)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, F77)" ;;
+     esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, F77)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, F77)=no])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_CC_C_O([F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:14: -1- AC_LIBTOOL_SYS_HARD_LINK_LOCKS([F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_LD_SHLIBS([F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([include_expsyms], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([exclude_expsyms], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([reload_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -2- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:14: -1- AC_LIBTOOL_SYS_DYNAMIC_LINKER([F77])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([runpath_var F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [F77])
+m4trace:configure.in:14: -1- AC_LIBTOOL_SYS_LIB_STRIP
+m4trace:configure.in:14: -1- AC_LIBTOOL_CONFIG([F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([CC], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([LD], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predep_objects], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdep_objects], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predeps], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdeps], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postinstall_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postuninstall_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([exclude_expsyms], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([include_expsyms], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([GCC], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([LD], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predep_objects], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdep_objects], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predeps], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdeps], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([fix_srcfile_path], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([exclude_expsyms], [F77])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([include_expsyms], [F77])
+m4trace:configure.in:14: -1- AC_LIBTOOL_LANG_GCJ_CONFIG
+m4trace:configure.in:14: -1- _LT_AC_LANG_GCJ_CONFIG([GCJ])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete.
+You should run autoupdate.], [autoconf/lang.m4:166: AC_LANG_SAVE is expanded from...
+/usr/share/aclocal/libtool.m4:3794: _LT_AC_LANG_GCJ_CONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:3747: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:1737: _LT_AC_TAGCONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:233: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+/usr/share/aclocal/libtool.m4:91: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+/usr/share/aclocal/libtool.m4:71: AC_PROG_LIBTOOL is expanded from...
+/usr/share/aclocal/libtool.m4:5869: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [instead of using `AC_LANG', `AC_LANG_SAVE',
+and `AC_LANG_RESTORE', you should use `AC_LANG_PUSH' and `AC_LANG_POP'.], [autoconf/lang.m4:166: AC_LANG_SAVE is expanded from...
+/usr/share/aclocal/libtool.m4:3794: _LT_AC_LANG_GCJ_CONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:3747: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:1737: _LT_AC_TAGCONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:233: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+/usr/share/aclocal/libtool.m4:91: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+/usr/share/aclocal/libtool.m4:71: AC_PROG_LIBTOOL is expanded from...
+/usr/share/aclocal/libtool.m4:5869: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([objext], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_SYS_COMPILER
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_COMPILER_NO_RTTI([GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ])
+m4trace:configure.in:14: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], [lt_cv_prog_compiler_rtti_exceptions], [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, GCJ)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, GCJ) -fno-rtti -fno-exceptions"])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_COMPILER_PIC([GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -2- _LT_AC_TAGVAR([lt_prog_compiler_pic_works], [GCJ])
+m4trace:configure.in:14: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ) works], [lt_prog_compiler_pic_works_GCJ], [$_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ)ifelse([GCJ],[],[ -DPIC],[ifelse([GCJ],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ)" ;;
+     esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, GCJ)=no])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_CC_C_O([GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:14: -1- AC_LIBTOOL_SYS_HARD_LINK_LOCKS([GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_LD_SHLIBS([GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([include_expsyms], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([exclude_expsyms], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([reload_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -2- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:14: -1- AC_LIBTOOL_SYS_DYNAMIC_LINKER([GCJ])
+m4trace:configure.in:14: -1- AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([runpath_var GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ])
+m4trace:configure.in:14: -1- AC_LIBTOOL_SYS_LIB_STRIP
+m4trace:configure.in:14: -1- AC_LIBTOOL_DLOPEN_SELF([GCJ])
+m4trace:configure.in:14: -1- 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
+    ])
+m4trace:configure.in:14: -1- AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [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="-dld"])
+	      ])
+	    ])
+	  ])
+	])
+m4trace:configure.in:14: -1- 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="-dld"])
+	      ])
+	    ])
+m4trace:configure.in:14: -1- 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="-dld"])
+	      ])
+m4trace:configure.in:14: -1- AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+m4trace:configure.in:14: -1- _LT_AC_TRY_DLOPEN_SELF([lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=no], [lt_cv_dlopen_self=cross])
+m4trace:configure.in:14: -1- _LT_AC_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])
+m4trace:configure.in:14: -1- AC_LIBTOOL_CONFIG([GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([CC], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([LD], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predep_objects], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdep_objects], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predeps], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdeps], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postinstall_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postuninstall_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([exclude_expsyms], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([include_expsyms], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([GCC], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([LD], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predep_objects], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdep_objects], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predeps], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdeps], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([fix_srcfile_path], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([exclude_expsyms], [GCJ])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([include_expsyms], [GCJ])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete.
+You should run autoupdate.], [autoconf/lang.m4:172: AC_LANG_RESTORE is expanded from...
+/usr/share/aclocal/libtool.m4:3794: _LT_AC_LANG_GCJ_CONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:3747: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:1737: _LT_AC_TAGCONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:233: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+/usr/share/aclocal/libtool.m4:91: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+/usr/share/aclocal/libtool.m4:71: AC_PROG_LIBTOOL is expanded from...
+/usr/share/aclocal/libtool.m4:5869: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- AC_LIBTOOL_LANG_RC_CONFIG
+m4trace:configure.in:14: -1- _LT_AC_LANG_RC_CONFIG([RC])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete.
+You should run autoupdate.], [autoconf/lang.m4:166: AC_LANG_SAVE is expanded from...
+/usr/share/aclocal/libtool.m4:3833: _LT_AC_LANG_RC_CONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:3802: AC_LIBTOOL_LANG_RC_CONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:1737: _LT_AC_TAGCONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:233: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+/usr/share/aclocal/libtool.m4:91: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+/usr/share/aclocal/libtool.m4:71: AC_PROG_LIBTOOL is expanded from...
+/usr/share/aclocal/libtool.m4:5869: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [instead of using `AC_LANG', `AC_LANG_SAVE',
+and `AC_LANG_RESTORE', you should use `AC_LANG_PUSH' and `AC_LANG_POP'.], [autoconf/lang.m4:166: AC_LANG_SAVE is expanded from...
+/usr/share/aclocal/libtool.m4:3833: _LT_AC_LANG_RC_CONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:3802: AC_LIBTOOL_LANG_RC_CONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:1737: _LT_AC_TAGCONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:233: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+/usr/share/aclocal/libtool.m4:91: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+/usr/share/aclocal/libtool.m4:71: AC_PROG_LIBTOOL is expanded from...
+/usr/share/aclocal/libtool.m4:5869: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([objext], [RC])
+m4trace:configure.in:14: -1- _LT_AC_SYS_COMPILER
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [RC])
+m4trace:configure.in:14: -1- AC_LIBTOOL_CONFIG([RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([CC], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([LD], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predep_objects], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdep_objects], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predeps], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdeps], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postinstall_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postuninstall_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([exclude_expsyms], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([include_expsyms], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([GCC], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([LD], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([module_expsym_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predep_objects], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdep_objects], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([predeps], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([postdeps], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([allow_undefined_flag], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([no_undefined_flag], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_action], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_direct], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_minus_L], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([hardcode_automatic], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([link_all_deplibs], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([fix_srcfile_path], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([always_export_symbols], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([export_symbols_cmds], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([exclude_expsyms], [RC])
+m4trace:configure.in:14: -1- _LT_AC_TAGVAR([include_expsyms], [RC])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete.
+You should run autoupdate.], [autoconf/lang.m4:172: AC_LANG_RESTORE is expanded from...
+/usr/share/aclocal/libtool.m4:3833: _LT_AC_LANG_RC_CONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:3802: AC_LIBTOOL_LANG_RC_CONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:1737: _LT_AC_TAGCONFIG is expanded from...
+/usr/share/aclocal/libtool.m4:233: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+/usr/share/aclocal/libtool.m4:91: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+/usr/share/aclocal/libtool.m4:71: AC_PROG_LIBTOOL is expanded from...
+/usr/share/aclocal/libtool.m4:5869: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- AC_SUBST([LIBTOOL])
+m4trace:configure.in:14: -1- AC_LIBTOOL_CXX
+m4trace:configure.in:14: -1- _LT_AC_LANG_CXX
+m4trace:configure.in:14: -1- _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+m4trace:configure.in:14: -1- AC_LIBTOOL_F77
+m4trace:configure.in:14: -1- _LT_AC_LANG_F77
+m4trace:configure.in:14: -1- _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+m4trace:configure.in:20: -1- AC_DEFINE_TRACE_LITERAL([EXT_HASH])
+m4trace:configure.in:20: -1- AH_OUTPUT([EXT_HASH], [/* Use old STL hash options */
+#undef EXT_HASH])
+m4trace:configure.in:28: -1- PKG_CHECK_MODULES([OGRE], [OGRE])
+m4trace:configure.in:28: -1- PKG_PROG_PKG_CONFIG
+m4trace:configure.in:28: -1- m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4trace:configure.in:28: -1- m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+m4trace:configure.in:28: -1- AC_SUBST([PKG_CONFIG])
+m4trace:configure.in:28: -1- AC_SUBST([PKG_CONFIG], [$ac_cv_path_PKG_CONFIG])
+m4trace:configure.in:28: -1- AC_SUBST([ac_pt_PKG_CONFIG], [$ac_cv_path_ac_pt_PKG_CONFIG])
+m4trace:configure.in:28: -1- AC_SUBST([OGRE_CFLAGS])
+m4trace:configure.in:28: -1- AC_SUBST([OGRE_LIBS])
+m4trace:configure.in:30: -1- AC_CHECK_LIB([ode], [main], [], [{ { echo "$as_me:$LINENO: error: Can't find libode" >&5
+echo "$as_me: error: Can't find libode" >&2;}
+   { (exit 1); exit 1; }; }])
+m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_LIBODE], [/* Define to 1 if you have the `ode\' library (-lode). */
+#undef HAVE_LIBODE])
+m4trace:configure.in:30: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBODE])
+m4trace:configure.in:32: -1- AC_CHECK_LIB([m], [pow])
+m4trace:configure.in:32: -1- AH_OUTPUT([HAVE_LIBM], [/* Define to 1 if you have the `m\' library (-lm). */
+#undef HAVE_LIBM])
+m4trace:configure.in:32: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBM])
+m4trace:configure.in:33: -1- AC_CHECK_LIB([z], [gzopen])
+m4trace:configure.in:33: -1- AH_OUTPUT([HAVE_LIBZ], [/* Define to 1 if you have the `z\' library (-lz). */
+#undef HAVE_LIBZ])
+m4trace:configure.in:33: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBZ])
+m4trace:configure.in:34: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SNPRINTF])
+m4trace:configure.in:34: -2- AH_OUTPUT([HAVE_SNPRINTF], [/* snprintf */
+#undef HAVE_SNPRINTF])
+m4trace:configure.in:35: -2- AC_DEFINE_TRACE_LITERAL([HAVE_VSNPRINTF])
+m4trace:configure.in:35: -2- AH_OUTPUT([HAVE_VSNPRINTF], [/* vsnprintf */
+#undef HAVE_VSNPRINTF])
+m4trace:configure.in:45: -1- AC_CONFIG_FILES([Makefile \
+    ReferenceAppLayer/Makefile \
+    ReferenceAppLayer/src/Makefile \
+    ReferenceAppLayer/include/Makefile \
+	BspCollision/Makefile \
+	BspCollision/src/Makefile 
+	
+    ])
+m4trace:configure.in:47: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
+m4trace:configure.in:47: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
+m4trace:configure.in:47: -1- _AC_AM_CONFIG_HEADER_HOOK([$ac_file])
+m4trace:configure.in:47: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS
Index: /ReferenceApplication/autom4te.cache/traces.1
===================================================================
--- /ReferenceApplication/autom4te.cache/traces.1	(revision 5)
+++ /ReferenceApplication/autom4te.cache/traces.1	(revision 5)
@@ -0,0 +1,508 @@
+m4trace:configure.in:3: -1- AC_INIT([OGRE_REFAPP], [0.10.0])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^_?A[CHUM]_])
+m4trace:configure.in:3: -1- m4_pattern_forbid([_AC_])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
+m4trace:configure.in:3: -1- m4_pattern_allow([^AS_FLAGS$])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^_?m4_])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^dnl$])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^_?AS_])
+m4trace:configure.in:3: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}])
+m4trace:configure.in:3: -1- AC_SUBST([PATH_SEPARATOR])
+m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME],      ['AC_PACKAGE_NAME'])])
+m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME],   ['AC_PACKAGE_TARNAME'])])
+m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION],   ['AC_PACKAGE_VERSION'])])
+m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING],    ['AC_PACKAGE_STRING'])])
+m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
+m4trace:configure.in:3: -1- AC_SUBST([exec_prefix], [NONE])
+m4trace:configure.in:3: -1- AC_SUBST([prefix], [NONE])
+m4trace:configure.in:3: -1- AC_SUBST([program_transform_name], [s,x,x,])
+m4trace:configure.in:3: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
+m4trace:configure.in:3: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
+m4trace:configure.in:3: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
+m4trace:configure.in:3: -1- AC_SUBST([datadir], ['${prefix}/share'])
+m4trace:configure.in:3: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
+m4trace:configure.in:3: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
+m4trace:configure.in:3: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
+m4trace:configure.in:3: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
+m4trace:configure.in:3: -1- AC_SUBST([includedir], ['${prefix}/include'])
+m4trace:configure.in:3: -1- AC_SUBST([oldincludedir], ['/usr/include'])
+m4trace:configure.in:3: -1- AC_SUBST([infodir], ['${prefix}/info'])
+m4trace:configure.in:3: -1- AC_SUBST([mandir], ['${prefix}/man'])
+m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
+m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
+#undef PACKAGE_NAME])
+m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
+m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME])
+m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
+m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
+#undef PACKAGE_VERSION])
+m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
+m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING])
+m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
+m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT])
+m4trace:configure.in:3: -1- AC_SUBST([build_alias])
+m4trace:configure.in:3: -1- AC_SUBST([host_alias])
+m4trace:configure.in:3: -1- AC_SUBST([target_alias])
+m4trace:configure.in:3: -1- AC_SUBST([DEFS])
+m4trace:configure.in:3: -1- AC_SUBST([ECHO_C])
+m4trace:configure.in:3: -1- AC_SUBST([ECHO_N])
+m4trace:configure.in:3: -1- AC_SUBST([ECHO_T])
+m4trace:configure.in:3: -1- AC_SUBST([LIBS])
+m4trace:configure.in:4: -1- AM_INIT_AUTOMAKE([1.6.1 foreign no-installinfo no-installman subdir-objects])
+m4trace:configure.in:4: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
+m4trace:configure.in:4: -1- AM_AUTOMAKE_VERSION([1.9.5])
+m4trace:configure.in:4: -1- AC_PROG_INSTALL
+m4trace:configure.in:4: -1- AC_SUBST([INSTALL_PROGRAM])
+m4trace:configure.in:4: -1- AC_SUBST([INSTALL_SCRIPT])
+m4trace:configure.in:4: -1- AC_SUBST([INSTALL_DATA])
+m4trace:configure.in:4: -1- AC_SUBST([CYGPATH_W])
+m4trace:configure.in:4: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])
+m4trace:configure.in:4: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])
+m4trace:configure.in:4: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE])
+m4trace:configure.in:4: -1- AH_OUTPUT([PACKAGE], [/* Name of package */
+#undef PACKAGE])
+m4trace:configure.in:4: -1- AC_DEFINE_TRACE_LITERAL([VERSION])
+m4trace:configure.in:4: -1- AH_OUTPUT([VERSION], [/* Version number of package */
+#undef VERSION])
+m4trace:configure.in:4: -1- AC_SUBST([ACLOCAL])
+m4trace:configure.in:4: -1- AC_SUBST([AUTOCONF])
+m4trace:configure.in:4: -1- AC_SUBST([AUTOMAKE])
+m4trace:configure.in:4: -1- AC_SUBST([AUTOHEADER])
+m4trace:configure.in:4: -1- AC_SUBST([MAKEINFO])
+m4trace:configure.in:4: -1- AC_SUBST([install_sh])
+m4trace:configure.in:4: -1- AC_SUBST([STRIP])
+m4trace:configure.in:4: -1- AC_SUBST([ac_ct_STRIP])
+m4trace:configure.in:4: -1- AC_SUBST([INSTALL_STRIP_PROGRAM])
+m4trace:configure.in:4: -1- AC_SUBST([mkdir_p])
+m4trace:configure.in:4: -1- AC_PROG_AWK
+m4trace:configure.in:4: -1- AC_SUBST([AWK])
+m4trace:configure.in:4: -1- AC_PROG_MAKE_SET
+m4trace:configure.in:4: -1- AC_SUBST([SET_MAKE])
+m4trace:configure.in:4: -1- AC_SUBST([am__leading_dot])
+m4trace:configure.in:4: -1- AC_SUBST([AMTAR])
+m4trace:configure.in:4: -1- AC_SUBST([am__tar])
+m4trace:configure.in:4: -1- AC_SUBST([am__untar])
+m4trace:configure.in:5: -1- _m4_warn([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete.
+You should run autoupdate.], [aclocal.m4:6384: AM_CONFIG_HEADER is expanded from...
+configure.in:5: the top level])
+m4trace:configure.in:5: -1- AC_CONFIG_HEADERS([ReferenceAppLayer/include/config.h])
+m4trace:configure.in:7: -1- AC_CANONICAL_TARGET
+m4trace:configure.in:7: -1- AC_CANONICAL_HOST
+m4trace:configure.in:7: -1- AC_CANONICAL_BUILD
+m4trace:configure.in:7: -1- AC_SUBST([build], [$ac_cv_build])
+m4trace:configure.in:7: -1- AC_SUBST([build_cpu], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`])
+m4trace:configure.in:7: -1- AC_SUBST([build_vendor], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`])
+m4trace:configure.in:7: -1- AC_SUBST([build_os], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`])
+m4trace:configure.in:7: -1- AC_SUBST([host], [$ac_cv_host])
+m4trace:configure.in:7: -1- AC_SUBST([host_cpu], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`])
+m4trace:configure.in:7: -1- AC_SUBST([host_vendor], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`])
+m4trace:configure.in:7: -1- AC_SUBST([host_os], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`])
+m4trace:configure.in:7: -1- _m4_warn([syntax], [AC_ARG_PROGRAM was called before AC_CANONICAL_TARGET], [autoconf/general.m4:1657: AC_CANONICAL_TARGET is expanded from...
+configure.in:7: the top level])
+m4trace:configure.in:7: -1- AC_SUBST([target], [$ac_cv_target])
+m4trace:configure.in:7: -1- AC_SUBST([target_cpu], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`])
+m4trace:configure.in:7: -1- AC_SUBST([target_vendor], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`])
+m4trace:configure.in:7: -1- AC_SUBST([target_os], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`])
+m4trace:configure.in:10: -1- AC_PROG_CC
+m4trace:configure.in:10: -1- AC_SUBST([CC])
+m4trace:configure.in:10: -1- AC_SUBST([CFLAGS])
+m4trace:configure.in:10: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.in:10: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.in:10: -1- AC_SUBST([CC])
+m4trace:configure.in:10: -1- AC_SUBST([ac_ct_CC])
+m4trace:configure.in:10: -1- AC_SUBST([CC])
+m4trace:configure.in:10: -1- AC_SUBST([ac_ct_CC])
+m4trace:configure.in:10: -1- AC_SUBST([CC])
+m4trace:configure.in:10: -1- AC_SUBST([CC])
+m4trace:configure.in:10: -1- AC_SUBST([ac_ct_CC])
+m4trace:configure.in:10: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
+m4trace:configure.in:10: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
+m4trace:configure.in:10: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])
+m4trace:configure.in:10: -1- AC_SUBST([am__include])
+m4trace:configure.in:10: -1- AC_SUBST([am__quote])
+m4trace:configure.in:10: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+m4trace:configure.in:10: -1- AC_SUBST([AMDEP_TRUE])
+m4trace:configure.in:10: -1- AC_SUBST([AMDEP_FALSE])
+m4trace:configure.in:10: -1- AC_SUBST([AMDEPBACKSLASH])
+m4trace:configure.in:10: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type])
+m4trace:configure.in:10: -1- AM_CONDITIONAL([am__fastdepCC], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3])
+m4trace:configure.in:10: -1- AC_SUBST([am__fastdepCC_TRUE])
+m4trace:configure.in:10: -1- AC_SUBST([am__fastdepCC_FALSE])
+m4trace:configure.in:11: -1- AC_PROG_CXX
+m4trace:configure.in:11: -1- AC_SUBST([CXX])
+m4trace:configure.in:11: -1- AC_SUBST([CXXFLAGS])
+m4trace:configure.in:11: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.in:11: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.in:11: -1- AC_SUBST([CXX])
+m4trace:configure.in:11: -1- AC_SUBST([ac_ct_CXX])
+m4trace:configure.in:11: -1- AC_SUBST([CXXDEPMODE], [depmode=$am_cv_CXX_dependencies_compiler_type])
+m4trace:configure.in:11: -1- AM_CONDITIONAL([am__fastdepCXX], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3])
+m4trace:configure.in:11: -1- AC_SUBST([am__fastdepCXX_TRUE])
+m4trace:configure.in:11: -1- AC_SUBST([am__fastdepCXX_FALSE])
+m4trace:configure.in:12: -1- AC_PROG_INSTALL
+m4trace:configure.in:12: -1- AC_SUBST([INSTALL_PROGRAM])
+m4trace:configure.in:12: -1- AC_SUBST([INSTALL_SCRIPT])
+m4trace:configure.in:12: -1- AC_SUBST([INSTALL_DATA])
+m4trace:configure.in:14: -1- AC_PROG_LIBTOOL
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:219: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
+aclocal.m4:1774: AC_ENABLE_SHARED is expanded from...
+configure.in:14: AC_ENABLE_SHARED is required by...
+aclocal.m4:224: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+aclocal.m4:82: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+aclocal.m4:62: AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:5848: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:219: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
+aclocal.m4:1813: AC_ENABLE_STATIC is expanded from...
+configure.in:14: AC_ENABLE_STATIC is required by...
+aclocal.m4:224: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+aclocal.m4:82: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+aclocal.m4:62: AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:5848: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:219: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
+aclocal.m4:1852: AC_ENABLE_FAST_INSTALL is expanded from...
+configure.in:14: AC_ENABLE_FAST_INSTALL is required by...
+aclocal.m4:224: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+aclocal.m4:82: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+aclocal.m4:62: AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:5848: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:219: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1331: AC_ARG_WITH is expanded from...
+aclocal.m4:2049: AC_PROG_LD is expanded from...
+configure.in:14: AC_PROG_LD is required by...
+aclocal.m4:224: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+aclocal.m4:82: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+aclocal.m4:62: AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:5848: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- AC_SUBST([EGREP])
+m4trace:configure.in:14: -1- AC_PROG_LN_S
+m4trace:configure.in:14: -1- AC_SUBST([LN_S], [$as_ln_s])
+m4trace:configure.in:14: -1- AC_SUBST([ECHO])
+m4trace:configure.in:14: -1- AC_SUBST([AR])
+m4trace:configure.in:14: -1- AC_SUBST([ac_ct_AR])
+m4trace:configure.in:14: -1- AC_SUBST([RANLIB])
+m4trace:configure.in:14: -1- AC_SUBST([ac_ct_RANLIB])
+m4trace:configure.in:14: -1- AC_SUBST([STRIP])
+m4trace:configure.in:14: -1- AC_SUBST([ac_ct_STRIP])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:219: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1303: AC_ARG_ENABLE is expanded from...
+aclocal.m4:224: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+aclocal.m4:82: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+aclocal.m4:62: AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:5848: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:219: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1331: AC_ARG_WITH is expanded from...
+aclocal.m4:224: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+aclocal.m4:82: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+aclocal.m4:62: AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:5848: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
+autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
+autoconf/general.m4:1808: AC_CACHE_CHECK is expanded from...
+aclocal.m4:551: _LT_AC_LOCK is expanded from...
+configure.in:14: _LT_AC_LOCK is required by...
+aclocal.m4:982: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
+aclocal.m4:2596: _LT_AC_LANG_C_CONFIG is expanded from...
+aclocal.m4:2463: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
+aclocal.m4:224: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+aclocal.m4:82: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+aclocal.m4:62: AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:5848: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- AC_CHECK_HEADERS([dlfcn.h])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H])
+m4trace:configure.in:14: -1- AC_HEADER_STDC
+m4trace:configure.in:14: -1- AC_PROG_CPP
+m4trace:configure.in:14: -1- AC_SUBST([CPP])
+m4trace:configure.in:14: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.in:14: -1- AC_SUBST([CPP])
+m4trace:configure.in:14: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
+m4trace:configure.in:14: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS])
+m4trace:configure.in:14: -1- AC_CHECK_HEADERS([sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h], [], [], [$ac_includes_default])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H])
+m4trace:configure.in:14: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H])
+m4trace:configure.in:14: -1- 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
+    ])
+m4trace:configure.in:14: -1- AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [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="-dld"])
+	      ])
+	    ])
+	  ])
+	])
+m4trace:configure.in:14: -1- 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="-dld"])
+	      ])
+	    ])
+m4trace:configure.in:14: -1- 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="-dld"])
+	      ])
+m4trace:configure.in:14: -1- AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+m4trace:configure.in:14: -1- _LT_AC_TAGCONFIG
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:219: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1331: AC_ARG_WITH is expanded from...
+aclocal.m4:1728: _LT_AC_TAGCONFIG is expanded from...
+aclocal.m4:224: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+aclocal.m4:82: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+aclocal.m4:62: AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:5848: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me:$LINENO: error: tag name \"$tagname\" already exists], [aclocal.m4:1728: _LT_AC_TAGCONFIG is expanded from...
+aclocal.m4:224: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+aclocal.m4:82: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+aclocal.m4:62: AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:5848: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me: error: tag name \"$tagname\" already exists], [aclocal.m4:1728: _LT_AC_TAGCONFIG is expanded from...
+aclocal.m4:224: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+aclocal.m4:82: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+aclocal.m4:62: AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:5848: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- AC_SUBST([CXXCPP])
+m4trace:configure.in:14: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.in:14: -1- AC_SUBST([CXXCPP])
+m4trace:configure.in:14: -1- 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
+    ])
+m4trace:configure.in:14: -1- AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [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="-dld"])
+	      ])
+	    ])
+	  ])
+	])
+m4trace:configure.in:14: -1- 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="-dld"])
+	      ])
+	    ])
+m4trace:configure.in:14: -1- 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="-dld"])
+	      ])
+m4trace:configure.in:14: -1- AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+m4trace:configure.in:14: -1- AC_SUBST([F77])
+m4trace:configure.in:14: -1- AC_SUBST([FFLAGS])
+m4trace:configure.in:14: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.in:14: -1- AC_SUBST([F77])
+m4trace:configure.in:14: -1- AC_SUBST([ac_ct_F77])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete.
+You should run autoupdate.], [autoconf/lang.m4:166: AC_LANG_SAVE is expanded from...
+aclocal.m4:3773: _LT_AC_LANG_GCJ_CONFIG is expanded from...
+aclocal.m4:3730: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
+aclocal.m4:1728: _LT_AC_TAGCONFIG is expanded from...
+aclocal.m4:224: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+aclocal.m4:82: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+aclocal.m4:62: AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:5848: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [instead of using `AC_LANG', `AC_LANG_SAVE',
+and `AC_LANG_RESTORE', you should use `AC_LANG_PUSH' and `AC_LANG_POP'.], [autoconf/lang.m4:166: AC_LANG_SAVE is expanded from...
+aclocal.m4:3773: _LT_AC_LANG_GCJ_CONFIG is expanded from...
+aclocal.m4:3730: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
+aclocal.m4:1728: _LT_AC_TAGCONFIG is expanded from...
+aclocal.m4:224: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+aclocal.m4:82: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+aclocal.m4:62: AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:5848: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- 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
+    ])
+m4trace:configure.in:14: -1- AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [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="-dld"])
+	      ])
+	    ])
+	  ])
+	])
+m4trace:configure.in:14: -1- 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="-dld"])
+	      ])
+	    ])
+m4trace:configure.in:14: -1- 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="-dld"])
+	      ])
+m4trace:configure.in:14: -1- AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete.
+You should run autoupdate.], [autoconf/lang.m4:172: AC_LANG_RESTORE is expanded from...
+aclocal.m4:3773: _LT_AC_LANG_GCJ_CONFIG is expanded from...
+aclocal.m4:3730: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
+aclocal.m4:1728: _LT_AC_TAGCONFIG is expanded from...
+aclocal.m4:224: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+aclocal.m4:82: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+aclocal.m4:62: AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:5848: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete.
+You should run autoupdate.], [autoconf/lang.m4:166: AC_LANG_SAVE is expanded from...
+aclocal.m4:3812: _LT_AC_LANG_RC_CONFIG is expanded from...
+aclocal.m4:3781: AC_LIBTOOL_LANG_RC_CONFIG is expanded from...
+aclocal.m4:1728: _LT_AC_TAGCONFIG is expanded from...
+aclocal.m4:224: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+aclocal.m4:82: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+aclocal.m4:62: AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:5848: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [instead of using `AC_LANG', `AC_LANG_SAVE',
+and `AC_LANG_RESTORE', you should use `AC_LANG_PUSH' and `AC_LANG_POP'.], [autoconf/lang.m4:166: AC_LANG_SAVE is expanded from...
+aclocal.m4:3812: _LT_AC_LANG_RC_CONFIG is expanded from...
+aclocal.m4:3781: AC_LIBTOOL_LANG_RC_CONFIG is expanded from...
+aclocal.m4:1728: _LT_AC_TAGCONFIG is expanded from...
+aclocal.m4:224: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+aclocal.m4:82: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+aclocal.m4:62: AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:5848: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete.
+You should run autoupdate.], [autoconf/lang.m4:172: AC_LANG_RESTORE is expanded from...
+aclocal.m4:3812: _LT_AC_LANG_RC_CONFIG is expanded from...
+aclocal.m4:3781: AC_LIBTOOL_LANG_RC_CONFIG is expanded from...
+aclocal.m4:1728: _LT_AC_TAGCONFIG is expanded from...
+aclocal.m4:224: AC_LIBTOOL_SETUP is expanded from...
+configure.in:14: AC_LIBTOOL_SETUP is required by...
+aclocal.m4:82: _AC_PROG_LIBTOOL is expanded from...
+configure.in:14: _AC_PROG_LIBTOOL is required by...
+aclocal.m4:62: AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:5848: AM_PROG_LIBTOOL is expanded from...
+configure.in:14: the top level])
+m4trace:configure.in:14: -1- AC_SUBST([LIBTOOL])
+m4trace:configure.in:20: -1- AC_DEFINE_TRACE_LITERAL([EXT_HASH])
+m4trace:configure.in:20: -1- AH_OUTPUT([EXT_HASH], [/* Use old STL hash options */
+#undef EXT_HASH])
+m4trace:configure.in:28: -1- m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4trace:configure.in:28: -1- m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+m4trace:configure.in:28: -1- AC_SUBST([PKG_CONFIG])
+m4trace:configure.in:28: -1- AC_SUBST([PKG_CONFIG], [$ac_cv_path_PKG_CONFIG])
+m4trace:configure.in:28: -1- AC_SUBST([ac_pt_PKG_CONFIG], [$ac_cv_path_ac_pt_PKG_CONFIG])
+m4trace:configure.in:28: -1- AC_SUBST([OGRE_CFLAGS])
+m4trace:configure.in:28: -1- AC_SUBST([OGRE_LIBS])
+m4trace:configure.in:30: -1- AC_CHECK_LIB([ode], [main], [], [{ { echo "$as_me:$LINENO: error: Can't find libode" >&5
+echo "$as_me: error: Can't find libode" >&2;}
+   { (exit 1); exit 1; }; }])
+m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_LIBODE], [/* Define to 1 if you have the `ode\' library (-lode). */
+#undef HAVE_LIBODE])
+m4trace:configure.in:30: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBODE])
+m4trace:configure.in:32: -1- AC_CHECK_LIB([m], [pow])
+m4trace:configure.in:32: -1- AH_OUTPUT([HAVE_LIBM], [/* Define to 1 if you have the `m\' library (-lm). */
+#undef HAVE_LIBM])
+m4trace:configure.in:32: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBM])
+m4trace:configure.in:33: -1- AC_CHECK_LIB([z], [gzopen])
+m4trace:configure.in:33: -1- AH_OUTPUT([HAVE_LIBZ], [/* Define to 1 if you have the `z\' library (-lz). */
+#undef HAVE_LIBZ])
+m4trace:configure.in:33: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBZ])
+m4trace:configure.in:34: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SNPRINTF])
+m4trace:configure.in:34: -2- AH_OUTPUT([HAVE_SNPRINTF], [/* snprintf */
+#undef HAVE_SNPRINTF])
+m4trace:configure.in:35: -2- AC_DEFINE_TRACE_LITERAL([HAVE_VSNPRINTF])
+m4trace:configure.in:35: -2- AH_OUTPUT([HAVE_VSNPRINTF], [/* vsnprintf */
+#undef HAVE_VSNPRINTF])
+m4trace:configure.in:45: -1- AC_CONFIG_FILES([Makefile \
+    ReferenceAppLayer/Makefile \
+    ReferenceAppLayer/src/Makefile \
+    ReferenceAppLayer/include/Makefile \
+	BspCollision/Makefile \
+	BspCollision/src/Makefile 
+	
+    ])
+m4trace:configure.in:47: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
+m4trace:configure.in:47: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
Index: /ReferenceApplication/bootstrap
===================================================================
--- /ReferenceApplication/bootstrap	(revision 5)
+++ /ReferenceApplication/bootstrap	(revision 5)
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# Check for proper versions of autotools
+# We require:
+#  - autoconf 2.50+
+#  - automake 1.6+
+#  - libtool 1.4+
+
+# Deal with some gentoo-specific issues
+export WANT_AUTOMAKE='1.7'
+export WANT_AUTOCONF_2_5=1
+
+## Using prereq in autoconf rather than here, mostly for the debian systems at
+## this point
+if test -z "`autoconf --version 2>&1|head -n 1|egrep '2.5'`"; then
+	echo "Autoconf 2.50 or above is required. Aborting build...";
+    exit 1;
+fi
+
+if test -z "`automake --version 2>&1|head -n 1|egrep '1.[6-9]'`"; then
+	echo "Automake 1.6 or above is required. Aborting build...";
+	exit 1;
+fi
+
+if test -z "`libtool --version 2>&1|head -n 1|egrep '1.[4-5]'`"; then
+	echo "Libtool 1.4 or above is required. Aborting build...";
+	exit 1;
+fi
+
+# clean up files which cause confusion when switch versions of auto*
+rm -rf autom4te.cache
+
+# Fire up autotools
+libtoolize --force && aclocal $ACLOCAL_FLAGS && autoheader && automake --include-deps --add-missing --foreign && autoconf 
Index: /ReferenceApplication/configure
===================================================================
--- /ReferenceApplication/configure	(revision 5)
+++ /ReferenceApplication/configure	(revision 5)
@@ -0,0 +1,21259 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.59 for OGRE_REFAPP 0.10.0.
+#
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be 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+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+  ;;
+esac
+
+echo=${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 <<EOF
+$*
+EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$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 &&
+       echo_test_string="`eval $cmd`" &&
+       (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.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+tagnames=${tagnames+${tagnames},}CXX
+
+tagnames=${tagnames+${tagnames},}F77
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME='OGRE_REFAPP'
+PACKAGE_TARNAME='ogre_refapp'
+PACKAGE_VERSION='0.10.0'
+PACKAGE_STRING='OGRE_REFAPP 0.10.0'
+PACKAGE_BUGREPORT=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+#  include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PKG_CONFIG ac_pt_PKG_CONFIG OGRE_CFLAGS OGRE_LIBS LIBOBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_option in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_$ac_feature='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_$ac_package='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+	      localstatedir libdir includedir oldincludedir infodir mandir
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
+  else
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+  fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CXX_set=${CXX+set}
+ac_env_CXX_value=$CXX
+ac_cv_env_CXX_set=${CXX+set}
+ac_cv_env_CXX_value=$CXX
+ac_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_env_CXXFLAGS_value=$CXXFLAGS
+ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_cv_env_CXXFLAGS_value=$CXXFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+ac_env_CXXCPP_set=${CXXCPP+set}
+ac_env_CXXCPP_value=$CXXCPP
+ac_cv_env_CXXCPP_set=${CXXCPP+set}
+ac_cv_env_CXXCPP_value=$CXXCPP
+ac_env_F77_set=${F77+set}
+ac_env_F77_value=$F77
+ac_cv_env_F77_set=${F77+set}
+ac_cv_env_F77_value=$F77
+ac_env_FFLAGS_set=${FFLAGS+set}
+ac_env_FFLAGS_value=$FFLAGS
+ac_cv_env_FFLAGS_set=${FFLAGS+set}
+ac_cv_env_FFLAGS_value=$FFLAGS
+ac_env_PKG_CONFIG_set=${PKG_CONFIG+set}
+ac_env_PKG_CONFIG_value=$PKG_CONFIG
+ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set}
+ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG
+ac_env_OGRE_CFLAGS_set=${OGRE_CFLAGS+set}
+ac_env_OGRE_CFLAGS_value=$OGRE_CFLAGS
+ac_cv_env_OGRE_CFLAGS_set=${OGRE_CFLAGS+set}
+ac_cv_env_OGRE_CFLAGS_value=$OGRE_CFLAGS
+ac_env_OGRE_LIBS_set=${OGRE_LIBS+set}
+ac_env_OGRE_LIBS_value=$OGRE_LIBS
+ac_cv_env_OGRE_LIBS_set=${OGRE_LIBS+set}
+ac_cv_env_OGRE_LIBS_value=$OGRE_LIBS
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures OGRE_REFAPP 0.10.0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+			  [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+			  [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --infodir=DIR          info documentation [PREFIX/info]
+  --mandir=DIR           man documentation [PREFIX/man]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of OGRE_REFAPP 0.10.0:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-shared[=PKGS]
+                          build shared libraries [default=yes]
+  --enable-static[=PKGS]
+                          build static libraries [default=yes]
+  --enable-fast-install[=PKGS]
+                          optimize for fast installation [default=yes]
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-pic              try to use only PIC/non-PIC objects [default=use
+                          both]
+  --with-tags[=TAGS]
+                          include additional configurations [automatic]
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  CPP         C preprocessor
+  CXXCPP      C++ preprocessor
+  F77         Fortran 77 compiler command
+  FFLAGS      Fortran 77 compiler flags
+  PKG_CONFIG  path to pkg-config utility
+  OGRE_CFLAGS C compiler flags for OGRE, overriding pkg-config
+  OGRE_LIBS   linker flags for OGRE, overriding pkg-config
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+	   test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi
+    cd "$ac_popdir"
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\_ACEOF
+OGRE_REFAPP configure 0.10.0
+generated by GNU Autoconf 2.59
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by OGRE_REFAPP $as_me 0.10.0, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+}
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=$`echo $ac_var`
+	echo "$ac_var='"'"'$ac_val'"'"'"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      sed "/^$/d" confdefs.h | sort
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core &&
+  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
+    esac
+  fi
+else
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+am__api_version="1.9"
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $.  echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AWK="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+all:
+	@echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+  SET_MAKE=
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='ogre_refapp'
+ VERSION='0.10.0'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  STRIP=$ac_ct_STRIP
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+          ac_config_headers="$ac_config_headers ReferenceAppLayer/include/config.h"
+
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+  ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+  ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+  ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CC" && break
+done
+
+  CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Find the output, starting from the most likely.  This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+	;;
+    conftest.$ac_ext )
+	# This is the source file.
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	# FIXME: I believe we export ac_cv_exeext for Libtool,
+	# but it would be cool to find out if it's true.  Does anybody
+	# maintain Libtool? --akim.
+	export ac_cv_exeext
+	break;;
+    * )
+	break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  export ac_cv_exeext
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std1 is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std1.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+  choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+          ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC"   am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CXX" && break
+done
+test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
+
+  CXX=$ac_ct_CXX
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cxx_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX"  am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+
+
+if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval="$enable_shared"
+  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
+else
+  enable_shared=yes
+fi;
+
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval="$enable_static"
+  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
+else
+  enable_static=yes
+fi;
+
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval="$enable_fast_install"
+  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
+else
+  enable_fast_install=yes
+fi;
+
+echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
+if test "${lt_cv_path_SED+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # 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
+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 && break
+  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
+
+fi
+
+echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval="$with_gnu_ld"
+  test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi;
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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 GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+
+echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
+if test "${lt_cv_path_NM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm="$ac_dir/${ac_tool_prefix}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"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+echo "${ECHO_T}$lt_cv_path_NM" >&6
+NM="$lt_cv_path_NM"
+
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
+echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
+echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi4*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu)
+  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)/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
+  ;;
+
+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*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+  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=unknown
+  ;;
+
+openbsd*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+  else
+    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  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
+    ;;
+  esac
+  ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
+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
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+
+fi;
+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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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 4230 "configure"' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case "`/usr/bin/file conftest.o`" in
+    *32-bit*)
+      case $host in
+        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-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          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"
+  echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  lt_cv_cc_needs_belf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+lt_cv_cc_needs_belf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
+  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
+  ;;
+
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## -------------------------------------- ##
+## Report this to the OGRE_REFAPP lists.  ##
+## -------------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
+if test -z "$CXXCPP"; then
+  if test "${ac_cv_prog_CXXCPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  echo "$as_me:$LINENO: result: $F77" >&5
+echo "${ECHO_T}$F77" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$F77" && break
+  done
+fi
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_F77="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+echo "${ECHO_T}$ac_ct_F77" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_F77" && break
+done
+
+  F77=$ac_ct_F77
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:5334:" \
+     "checking for Fortran 77 compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_f77_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_f77_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_f77_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+echo "${ECHO_T}$ac_cv_prog_f77_g" >&6
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
+
+G77=`test $ac_compiler_gnu = yes && echo yes`
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+
+# find the maximum length of command line arguments
+echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    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*)
+    # 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;
+    ;;
+
+  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;
+    ;;
+
+ *)
+    # 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"`$CONFIG_SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+	       = "XX$teststring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
+	    lt_cv_sys_max_cmd_len=$new_result &&
+	    test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    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`
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
+else
+  echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6
+fi
+
+
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+# 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]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris* | sysv5*)
+  symcode='[BDRT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# 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
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Write the raw and C identifiers.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && 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 <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+	  cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+	  cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+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_prog_compiler_no_builtin_flag"
+	  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && 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" >&5
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -f 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
+
+fi
+
+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
+  echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+else
+  echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+fi
+
+echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6
+if test "${lt_cv_objdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+fi
+echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+echo "${ECHO_T}$lt_cv_objdir" >&6
+objdir=$lt_cv_objdir
+
+
+
+
+
+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.
+Xsed='sed -e s/^X//'
+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 avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false"
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  AR=$ac_ct_AR
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  RANLIB=$ac_ct_RANLIB
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  STRIP=$ac_ct_STRIP
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      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 <<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
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      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 <<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
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+enable_dlopen=no
+enable_win32_dll=no
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+
+fi;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+  withval="$with_pic"
+  pic_mode="$withval"
+else
+  pic_mode=default
+fi;
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+#
+# Check for any special shared library compilation flags.
+#
+lt_prog_cc_shlib=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    lt_prog_cc_shlib='-belf'
+    ;;
+  esac
+fi
+if test -n "$lt_prog_cc_shlib"; then
+  { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5
+echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;}
+  if echo "$old_CC $old_CFLAGS " | grep "[ 	]$lt_prog_cc_shlib[ 	]" >/dev/null; then :
+  else
+    { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
+echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
+    lt_cv_prog_cc_can_build_shared=no
+  fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The compiler 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>&5
+     else
+       lt_prog_compiler_static_works=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
+
+if test x"$lt_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:6366: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:6370: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      else
+	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-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_prog_compiler_pic='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    linux*)
+      case $CC in
+      icc* | ecc*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-KPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic='-Kpic'
+      lt_prog_compiler_static='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic='-Kconform_pic'
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:6599: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:6603: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
+
+if test x"$lt_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:6659: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:6663: \$? = $ac_status" >&5
+   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
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w .
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag=
+  enable_shared_with_static_runtimes=no
+  archive_cmds=
+  archive_expsym_cmds=
+  old_archive_From_new_cmds=
+  old_archive_from_expsyms_cmds=
+  export_dynamic_flag_spec=
+  whole_archive_flag_spec=
+  thread_safe_flag_spec=
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_flag_spec_ld=
+  hardcode_libdir_separator=
+  hardcode_direct=no
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  link_all_deplibs=unknown
+  hardcode_automatic=no
+  module_cmds=
+  module_expsym_cmds=
+  always_export_symbols=no
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # 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'.
+  exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$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)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds="$tmp_archive_cmds"
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` 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
+      if test $supports_anon_versioning = yes; then
+        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        archive_expsym_cmds="$tmp_archive_cmds"
+      fi
+      link_all_deplibs=no
+    else
+      ld_shlibs=no
+    fi
+    ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec='${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
+ 	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$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.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds='$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].*|aix5*)
+	  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.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+
+      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
+  	  hardcode_direct=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct=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
+  	  hardcode_minus_L=yes
+  	  hardcode_libdir_flag_spec='-L$libdir'
+  	  hardcode_libdir_separator=
+	  fi
+	esac
+	shared_flag='-shared'
+      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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=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.
+	allow_undefined_flag='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag="-z nodefs"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec='${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.
+	  no_undefined_flag=' ${wl}-bernotok'
+	  allow_undefined_flag=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec=' '
+	  archive_cmds_need_lc=yes
+	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$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)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs=no
+      ;;
+
+    bsdi4*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec=' '
+      allow_undefined_flag=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.
+      archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    darwin* | rhapsody*)
+    if test "$GXX" = yes ; then
+      archive_cmds_need_lc=no
+      case "$host_os" in
+      rhapsody* | darwin1.[012])
+	allow_undefined_flag='-undefined suppress'
+	;;
+      *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	allow_undefined_flag='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[012])
+            allow_undefined_flag='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            allow_undefined_flag='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+	;;
+      esac
+    	lt_int_apple_cc_single_mod=no
+    	output_verbose_link_cmd='echo'
+    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+    	  lt_int_apple_cc_single_mod=yes
+    	fi
+    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+    	  archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+    	else
+        archive_cmds='$CC -r ${wl}-bind_at_load -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'
+      fi
+      module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+          archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        else
+          archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        fi
+          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      hardcode_direct=no
+      hardcode_automatic=yes
+      hardcode_shlibpath_var=unsupported
+      whole_archive_flag_spec='-all_load $convenience'
+      link_all_deplibs=yes
+    else
+      ld_shlibs=no
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs=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*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu)
+      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds='$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
+	archive_cmds='$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
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds='$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*|ia64*)
+	  archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*)
+	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld='+b $libdir'
+	  hardcode_libdir_separator=:
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec='-L$libdir'
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator=:
+	  hardcode_direct=yes
+	  export_dynamic_flag_spec='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      link_all_deplibs=yes
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    openbsd*)
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$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'
+      old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      hardcode_libdir_separator=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z text'
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds='$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'
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+      esac
+      link_all_deplibs=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.
+	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds='$CC -r -o $output$reload_objs'
+	  hardcode_direct=no
+        ;;
+	motorola)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=no
+      hardcode_shlibpath_var=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds='$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'
+      hardcode_libdir_flag_spec=
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+echo "${ECHO_T}$ld_shlibs" >&6
+test "$ld_shlibs" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds 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.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag
+        allow_undefined_flag=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc=no
+        else
+	  archive_cmds_need_lc=yes
+        fi
+        allow_undefined_flag=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+echo "${ECHO_T}$archive_cmds_need_lc" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | 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'
+  ;;
+
+netbsdelf*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=yes
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+   test -n "$runpath_var " || \
+   test "X$hardcode_automatic"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct" != 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_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action" >&5
+echo "${ECHO_T}$hardcode_action" >&6
+
+if test "$hardcode_action" = relink; 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
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+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"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+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"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    ;;
+  esac
+fi
+
+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*)
+    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
+    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+   ;;
+
+  *)
+    echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 8847 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 8945 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+    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
+
+
+# Report which librarie types wil actually be built
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+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
+  ;;
+
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+  darwin* | rhapsody*)
+  if test "$GCC" = yes; then
+    archive_cmds_need_lc=no
+    case "$host_os" in
+    rhapsody* | darwin1.[012])
+      allow_undefined_flag='-undefined suppress'
+      ;;
+    *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	allow_undefined_flag='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[012])
+            allow_undefined_flag='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            allow_undefined_flag='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+      ;;
+    esac
+    output_verbose_link_cmd='echo'
+    archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
+    module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+    archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    hardcode_direct=no
+    hardcode_automatic=yes
+    hardcode_shlibpath_var=unsupported
+    whole_archive_flag_spec='-all_load $convenience'
+    link_all_deplibs=yes
+  else
+    ld_shlibs=no
+  fi
+    ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler \
+    CC \
+    LD \
+    lt_prog_compiler_wl \
+    lt_prog_compiler_pic \
+    lt_prog_compiler_static \
+    lt_prog_compiler_no_builtin_flag \
+    export_dynamic_flag_spec \
+    thread_safe_flag_spec \
+    whole_archive_flag_spec \
+    enable_shared_with_static_runtimes \
+    old_archive_cmds \
+    old_archive_from_new_cmds \
+    predep_objects \
+    postdep_objects \
+    predeps \
+    postdeps \
+    compiler_lib_search_path \
+    archive_cmds \
+    archive_expsym_cmds \
+    postinstall_cmds \
+    postuninstall_cmds \
+    old_archive_from_expsyms_cmds \
+    allow_undefined_flag \
+    no_undefined_flag \
+    export_symbols_cmds \
+    hardcode_libdir_flag_spec \
+    hardcode_libdir_flag_spec_ld \
+    hardcode_libdir_separator \
+    hardcode_automatic \
+    module_cmds \
+    module_expsym_cmds \
+    lt_cv_prog_compiler_c_o \
+    exclude_expsyms \
+    include_expsyms; do
+
+    case $var in
+    old_archive_cmds | \
+    old_archive_from_new_cmds | \
+    archive_cmds | \
+    archive_expsym_cmds | \
+    module_cmds | \
+    module_expsym_cmds | \
+    old_archive_from_expsyms_cmds | \
+    export_symbols_cmds | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  { echo "$as_me:$LINENO: creating $ofile" >&5
+echo "$as_me: creating $ofile" >&6;}
+
+  cat <<__EOF__ >> "$cfgfile"
+#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+
+  case $host_os in
+  aix3*)
+    cat <<\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
+EOF
+    ;;
+  esac
+
+  # 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 '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+# Check whether --with-tags or --without-tags was given.
+if test "${with_tags+set}" = set; then
+  withval="$with_tags"
+  tagnames="$withval"
+fi;
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
+    else
+      { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
+echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
+    fi
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
+    "") ;;
+    *)  { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
+echo "$as_me: error: invalid tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+	;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
+echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      CXX)
+	if test -n "$CXX" && test "X$CXX" != "Xno"; then
+	  ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# 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
+  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
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+  lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval="$with_gnu_ld"
+  test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi;
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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 GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_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
+    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_CXX='${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
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_CXX=
+    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.
+    archive_cmds_CXX='$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
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+ld_shlibs_CXX=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  aix4* | aix5*)
+    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].*|aix5*)
+	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.
+
+    archive_cmds_CXX=''
+    hardcode_direct_CXX=yes
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+
+    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
+	  hardcode_direct_CXX=yes
+	else
+	  # We have old collect2
+	  hardcode_direct_CXX=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
+	  hardcode_minus_L_CXX=yes
+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
+	  hardcode_libdir_separator_CXX=
+	fi
+      esac
+      shared_flag='-shared'
+    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
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    always_export_symbols_CXX=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.
+      allow_undefined_flag_CXX='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+	allow_undefined_flag_CXX="-z nodefs"
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	hardcode_libdir_flag_spec_CXX='${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.
+	no_undefined_flag_CXX=' ${wl}-bernotok'
+	allow_undefined_flag_CXX=' ${wl}-berok'
+	# -bexpall does not export symbols beginning with underscore (_)
+	always_export_symbols_CXX=yes
+	# Exported symbols can be pulled into shared objects from archives
+	whole_archive_flag_spec_CXX=' '
+	archive_cmds_need_lc_CXX=yes
+	# This is similar to how AIX traditionally builds it's shared libraries.
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+    # as there is no search path for DLLs.
+    hardcode_libdir_flag_spec_CXX='-L$libdir'
+    allow_undefined_flag_CXX=unsupported
+    always_export_symbols_CXX=no
+    enable_shared_with_static_runtimes_CXX=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      archive_expsym_cmds_CXX='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}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+  ;;
+
+  darwin* | rhapsody*)
+  if test "$GXX" = yes; then
+    archive_cmds_need_lc_CXX=no
+    case "$host_os" in
+    rhapsody* | darwin1.[012])
+      allow_undefined_flag_CXX='-undefined suppress'
+      ;;
+    *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	allow_undefined_flag_CXX='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[012])
+            allow_undefined_flag_CXX='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            allow_undefined_flag_CXX='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+      ;;
+    esac
+    lt_int_apple_cc_single_mod=no
+    output_verbose_link_cmd='echo'
+    if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+      lt_int_apple_cc_single_mod=yes
+    fi
+    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+      archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+    else
+      archive_cmds_CXX='$CC -r ${wl}-bind_at_load -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'
+    fi
+    module_cmds_CXX='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+
+    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+      archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    hardcode_direct_CXX=no
+    hardcode_automatic_CXX=yes
+    hardcode_shlibpath_var_CXX=unsupported
+    whole_archive_flag_spec_CXX='-all_load $convenience'
+    link_all_deplibs_CXX=yes
+  else
+    ld_shlibs_CXX=no
+  fi
+    ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      ghcx)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  freebsd12*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    ld_shlibs_CXX=no
+    ;;
+  freebsd-elf*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  freebsd* | kfreebsd*-gnu)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    ld_shlibs_CXX=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    hardcode_direct_CXX=yes
+    hardcode_minus_L_CXX=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
+      ld_shlibs_CXX=no
+      ;;
+    aCC)
+      archive_cmds_CXX='$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) | grep "-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        archive_cmds_CXX='$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
+        ld_shlibs_CXX=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case "$host_cpu" in
+      hppa*64*)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+	hardcode_libdir_separator_CXX=:
+        ;;
+      ia64*)
+	hardcode_libdir_flag_spec_CXX='-L$libdir'
+        ;;
+      *)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+	export_dynamic_flag_spec_CXX='${wl}-E'
+        ;;
+      esac
+    fi
+    case "$host_cpu" in
+    hppa*64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      ;;
+    ia64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      hardcode_minus_L_CXX=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    *)
+      hardcode_direct_CXX=yes
+      hardcode_minus_L_CXX=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
+	ld_shlibs_CXX=no
+	;;
+      aCC)
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  archive_cmds_CXX='$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 $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case "$host_cpu" in
+	    ia64*|hppa*64*)
+	      archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	      ;;
+	    *)
+	      archive_cmds_CXX='$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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC)
+	# SGI C++
+	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${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.
+	old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test "$with_gnu_ld" = no; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+	  else
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	link_all_deplibs_CXX=yes
+	;;
+    esac
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    ;;
+  linux*)
+    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.
+	archive_cmds_CXX='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'
+	archive_expsym_cmds_CXX='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 $list'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc)
+	# Intel C++
+	with_gnu_ld=yes
+	archive_cmds_need_lc_CXX=no
+	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      cxx)
+	# Compaq C++
+	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_CXX='$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
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      hardcode_libdir_flag_spec_CXX='-R$libdir'
+      hardcode_direct_CXX=yes
+      hardcode_shlibpath_var_CXX=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::"'
+    ;;
+  osf3*)
+    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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx)
+	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+	;;
+      RCC)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx)
+	allow_undefined_flag_CXX=' -expect_unresolved \*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+	archive_expsym_cmds_CXX='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 -set_version	$verstring` -update_registry $objdir/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	 archive_cmds_CXX='$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` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  sco*)
+    archive_cmds_need_lc_CXX=no
+    case $cc_basename in
+      CC)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      lcc)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC)
+	# Sun C++ 4.2, 5.x and Centerline C++
+	no_undefined_flag_CXX=' -zdefs'
+	archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+	hardcode_libdir_flag_spec_CXX='-R$libdir'
+	hardcode_shlibpath_var_CXX=no
+	case $host_os in
+	  solaris2.0-5 | solaris2.0-5.*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	link_all_deplibs_CXX=yes
+
+	# 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 -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+	# 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.
+	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx)
+	# Green Hills C++ Compiler
+	archive_cmds_CXX='$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.
+	old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	;;
+      *)
+	# GNU C++ compiler with Solaris linker
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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.
+	    archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+esac
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$LD"
+
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+  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 "$compiler_lib_search_path_CXX"; then
+	     compiler_lib_search_path_CXX="${prev}${p}"
+	   else
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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 "$postdeps_CXX"; then
+	   postdeps_CXX="${prev}${p}"
+	 else
+	   postdeps_CXX="${postdeps_CXX} ${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 "$predep_objects_CXX"; then
+	   predep_objects_CXX="$p"
+	 else
+	   predep_objects_CXX="$predep_objects_CXX $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_CXX"; then
+	   postdep_objects_CXX="$p"
+	 else
+	   postdep_objects_CXX="$postdep_objects_CXX $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # 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_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # 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).
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # 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*)
+	;;
+      *)
+	lt_prog_compiler_pic_CXX='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  lt_prog_compiler_static_CXX='-Bstatic'
+	else
+	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  ghcx)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    if test "$host_cpu" != ia64; then
+	      lt_prog_compiler_pic_CXX='+Z'
+	    fi
+	    ;;
+	  aCC)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    case "$host_cpu" in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      lt_prog_compiler_pic_CXX='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC)
+	    # KAI C++ Compiler
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  icpc)
+	    # Intel C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  cxx)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx)
+	    lt_prog_compiler_pic_CXX='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC)
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    ;;
+	  RCC)
+	    # Rational C++ 2.4.1
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  cxx)
+	    # Digital/Compaq C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      sco*)
+	case $cc_basename in
+	  CC)
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    lt_prog_compiler_wl_CXX='-Qoption ld '
+	    ;;
+	  gcx)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC)
+	    # Sun C++ 4.x
+	    lt_prog_compiler_pic_CXX='-pic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  lcc)
+	    # Lucid
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC)
+	    # NonStop-UX NCC 3.20
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      unixware*)
+	;;
+      vxworks*)
+	;;
+      *)
+	lt_prog_compiler_can_build_shared_CXX=no
+	;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_CXX=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:11122: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:11126: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:11182: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:11186: \$? = $ac_status" >&5
+   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
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w .
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # 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
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  linux*)
+    link_all_deplibs_CXX=no
+  ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX 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.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_CXX
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+        allow_undefined_flag_CXX=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_CXX=no
+        else
+	  archive_cmds_need_lc_CXX=yes
+        fi
+        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | 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'
+  ;;
+
+netbsdelf*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=yes
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+   test -n "$runpath_var CXX" || \
+   test "X$hardcode_automatic_CXX"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_CXX" != 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_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6
+
+if test "$hardcode_action_CXX" = relink; 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
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+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"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+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"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    ;;
+  esac
+fi
+
+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*)
+    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
+    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+   ;;
+
+  *)
+    echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 12551 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 12649 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+    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
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_CXX \
+    CC_CXX \
+    LD_CXX \
+    lt_prog_compiler_wl_CXX \
+    lt_prog_compiler_pic_CXX \
+    lt_prog_compiler_static_CXX \
+    lt_prog_compiler_no_builtin_flag_CXX \
+    export_dynamic_flag_spec_CXX \
+    thread_safe_flag_spec_CXX \
+    whole_archive_flag_spec_CXX \
+    enable_shared_with_static_runtimes_CXX \
+    old_archive_cmds_CXX \
+    old_archive_from_new_cmds_CXX \
+    predep_objects_CXX \
+    postdep_objects_CXX \
+    predeps_CXX \
+    postdeps_CXX \
+    compiler_lib_search_path_CXX \
+    archive_cmds_CXX \
+    archive_expsym_cmds_CXX \
+    postinstall_cmds_CXX \
+    postuninstall_cmds_CXX \
+    old_archive_from_expsyms_cmds_CXX \
+    allow_undefined_flag_CXX \
+    no_undefined_flag_CXX \
+    export_symbols_cmds_CXX \
+    hardcode_libdir_flag_spec_CXX \
+    hardcode_libdir_flag_spec_ld_CXX \
+    hardcode_libdir_separator_CXX \
+    hardcode_automatic_CXX \
+    module_cmds_CXX \
+    module_expsym_cmds_CXX \
+    lt_cv_prog_compiler_c_o_CXX \
+    exclude_expsyms_CXX \
+    include_expsyms_CXX; do
+
+    case $var in
+    old_archive_cmds_CXX | \
+    old_archive_from_new_cmds_CXX | \
+    archive_cmds_CXX | \
+    archive_expsym_cmds_CXX | \
+    module_cmds_CXX | \
+    module_expsym_cmds_CXX | \
+    old_archive_from_expsyms_cmds_CXX | \
+    export_symbols_cmds_CXX | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+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
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      F77)
+	if test -n "$F77" && test "X$F77" != "Xno"; then
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+compiler_F77=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+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
+  ;;
+aix4* | aix5*)
+  test "$enable_shared" = yes && enable_static=no
+  ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+GCC_F77="$G77"
+LD_F77="$LD"
+
+lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_F77='-Wl,'
+    lt_prog_compiler_static_F77='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_F77='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_F77=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_F77=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic_F77='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_F77='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      else
+	lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_F77='-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_prog_compiler_pic_F77='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    linux*)
+      case $CC in
+      icc* | ecc*)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-KPIC'
+	lt_prog_compiler_static_F77='-static'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_F77='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_F77='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic_F77='-Kpic'
+      lt_prog_compiler_static_F77='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_F77='-Qoption ld '
+      lt_prog_compiler_pic_F77='-PIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_F77='-Kconform_pic'
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_F77='-pic'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_F77=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_F77"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:13476: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:13480: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works_F77=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
+
+if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+    case $lt_prog_compiler_pic_F77 in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+     esac
+else
+    lt_prog_compiler_pic_F77=
+     lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_F77=
+    ;;
+  *)
+    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_F77=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:13536: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:13540: \$? = $ac_status" >&5
+   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
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o_F77=yes
+     fi
+   fi
+   chmod u+w .
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag_F77=
+  enable_shared_with_static_runtimes_F77=no
+  archive_cmds_F77=
+  archive_expsym_cmds_F77=
+  old_archive_From_new_cmds_F77=
+  old_archive_from_expsyms_cmds_F77=
+  export_dynamic_flag_spec_F77=
+  whole_archive_flag_spec_F77=
+  thread_safe_flag_spec_F77=
+  hardcode_libdir_flag_spec_F77=
+  hardcode_libdir_flag_spec_ld_F77=
+  hardcode_libdir_separator_F77=
+  hardcode_direct_F77=no
+  hardcode_minus_L_F77=no
+  hardcode_shlibpath_var_F77=unsupported
+  link_all_deplibs_F77=unknown
+  hardcode_automatic_F77=no
+  module_cmds_F77=
+  module_expsym_cmds_F77=
+  always_export_symbols_F77=no
+  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_F77=
+  # 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'.
+  exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_F77=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_F77=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$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)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_F77=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_F77=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=no
+      enable_shared_with_static_runtimes_F77=yes
+      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_F77='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_F77=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds_F77="$tmp_archive_cmds"
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` 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
+      if test $supports_anon_versioning = yes; then
+        archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        archive_expsym_cmds_F77="$tmp_archive_cmds"
+      fi
+      link_all_deplibs_F77=no
+    else
+      ld_shlibs_F77=no
+    fi
+    ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_F77" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec_F77='${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
+ 	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_F77=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=yes
+      archive_expsym_cmds_F77='$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.
+      hardcode_minus_L_F77=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_F77=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_F77='$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].*|aix5*)
+	  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.
+
+      archive_cmds_F77=''
+      hardcode_direct_F77=yes
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+
+      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
+  	  hardcode_direct_F77=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct_F77=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
+  	  hardcode_minus_L_F77=yes
+  	  hardcode_libdir_flag_spec_F77='-L$libdir'
+  	  hardcode_libdir_separator_F77=
+	  fi
+	esac
+	shared_flag='-shared'
+      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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_F77=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.
+	allow_undefined_flag_F77='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_F77="-z nodefs"
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec_F77='${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.
+	  no_undefined_flag_F77=' ${wl}-bernotok'
+	  allow_undefined_flag_F77=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols_F77=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec_F77=' '
+	  archive_cmds_need_lc_F77=yes
+	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$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)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_F77=no
+      ;;
+
+    bsdi4*)
+      export_dynamic_flag_spec_F77=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec_F77=' '
+      allow_undefined_flag_F77=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.
+      archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_F77='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_F77=yes
+      ;;
+
+    darwin* | rhapsody*)
+    if test "$GXX" = yes ; then
+      archive_cmds_need_lc_F77=no
+      case "$host_os" in
+      rhapsody* | darwin1.[012])
+	allow_undefined_flag_F77='-undefined suppress'
+	;;
+      *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	allow_undefined_flag_F77='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[012])
+            allow_undefined_flag_F77='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            allow_undefined_flag_F77='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+	;;
+      esac
+    	lt_int_apple_cc_single_mod=no
+    	output_verbose_link_cmd='echo'
+    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+    	  lt_int_apple_cc_single_mod=yes
+    	fi
+    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+    	  archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+    	else
+        archive_cmds_F77='$CC -r ${wl}-bind_at_load -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'
+      fi
+      module_cmds_F77='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+          archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        else
+          archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        fi
+          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      hardcode_direct_F77=no
+      hardcode_automatic_F77=yes
+      hardcode_shlibpath_var_F77=unsupported
+      whole_archive_flag_spec_F77='-all_load $convenience'
+      link_all_deplibs_F77=yes
+    else
+      ld_shlibs_F77=no
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_F77=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*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu)
+      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$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
+	archive_cmds_F77='$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
+      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_direct_F77=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_F77=yes
+      export_dynamic_flag_spec_F77='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$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*|ia64*)
+	  archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*)
+	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+	  hardcode_libdir_separator_F77=:
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec_F77='-L$libdir'
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_F77=:
+	  hardcode_direct_F77=yes
+	  export_dynamic_flag_spec_F77='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      link_all_deplibs_F77=yes
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    newsos6)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_F77='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec_F77='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      allow_undefined_flag_F77=unsupported
+      archive_cmds_F77='$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'
+      old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag_F77=' -z text'
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds_F77='$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'
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_shlibpath_var_F77=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+      esac
+      link_all_deplibs_F77=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.
+	archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_F77='$CC -r -o $output$reload_objs'
+	  hardcode_direct_F77=no
+        ;;
+	motorola)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_F77=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_F77=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_F77='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag_F77=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_F77='$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'
+      hardcode_libdir_flag_spec_F77=
+      hardcode_shlibpath_var_F77=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      ld_shlibs_F77=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+echo "${ECHO_T}$ld_shlibs_F77" >&6
+test "$ld_shlibs_F77" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_F77=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_F77 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.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_F77
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+        allow_undefined_flag_F77=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_F77=no
+        else
+	  archive_cmds_need_lc_F77=yes
+        fi
+        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | 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'
+  ;;
+
+netbsdelf*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=yes
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" || \
+   test -n "$runpath_var F77" || \
+   test "X$hardcode_automatic_F77"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_F77" != 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_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+     test "$hardcode_minus_L_F77" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_F77=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_F77=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_F77=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+echo "${ECHO_T}$hardcode_action_F77" >&6
+
+if test "$hardcode_action_F77" = relink; 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
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+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"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+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"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    ;;
+  esac
+fi
+
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_F77 \
+    CC_F77 \
+    LD_F77 \
+    lt_prog_compiler_wl_F77 \
+    lt_prog_compiler_pic_F77 \
+    lt_prog_compiler_static_F77 \
+    lt_prog_compiler_no_builtin_flag_F77 \
+    export_dynamic_flag_spec_F77 \
+    thread_safe_flag_spec_F77 \
+    whole_archive_flag_spec_F77 \
+    enable_shared_with_static_runtimes_F77 \
+    old_archive_cmds_F77 \
+    old_archive_from_new_cmds_F77 \
+    predep_objects_F77 \
+    postdep_objects_F77 \
+    predeps_F77 \
+    postdeps_F77 \
+    compiler_lib_search_path_F77 \
+    archive_cmds_F77 \
+    archive_expsym_cmds_F77 \
+    postinstall_cmds_F77 \
+    postuninstall_cmds_F77 \
+    old_archive_from_expsyms_cmds_F77 \
+    allow_undefined_flag_F77 \
+    no_undefined_flag_F77 \
+    export_symbols_cmds_F77 \
+    hardcode_libdir_flag_spec_F77 \
+    hardcode_libdir_flag_spec_ld_F77 \
+    hardcode_libdir_separator_F77 \
+    hardcode_automatic_F77 \
+    module_cmds_F77 \
+    module_expsym_cmds_F77 \
+    lt_cv_prog_compiler_c_o_F77 \
+    exclude_expsyms_F77 \
+    include_expsyms_F77; do
+
+    case $var in
+    old_archive_cmds_F77 | \
+    old_archive_from_new_cmds_F77 | \
+    archive_cmds_F77 | \
+    archive_expsym_cmds_F77 | \
+    module_cmds_F77 | \
+    module_expsym_cmds_F77 | \
+    old_archive_from_expsyms_cmds_F77 | \
+    export_symbols_cmds_F77 | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_F77
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_F77
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_F77
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_F77"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      GCJ)
+	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+
+
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+objext_GCJ=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+compiler_GCJ=$CC
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+archive_cmds_need_lc_GCJ=no
+
+
+lt_prog_compiler_no_builtin_flag_GCJ=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:15581: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:15585: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl_GCJ=
+lt_prog_compiler_pic_GCJ=
+lt_prog_compiler_static_GCJ=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_GCJ='-Wl,'
+    lt_prog_compiler_static_GCJ='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_GCJ='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_GCJ=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_GCJ=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic_GCJ='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_GCJ='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      else
+	lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_GCJ='-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_prog_compiler_pic_GCJ='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    linux*)
+      case $CC in
+      icc* | ecc*)
+	lt_prog_compiler_wl_GCJ='-Wl,'
+	lt_prog_compiler_pic_GCJ='-KPIC'
+	lt_prog_compiler_static_GCJ='-static'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_GCJ='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_GCJ='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic_GCJ='-Kpic'
+      lt_prog_compiler_static_GCJ='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_GCJ='-Qoption ld '
+      lt_prog_compiler_pic_GCJ='-PIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_GCJ='-Kconform_pic'
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_GCJ='-pic'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_GCJ"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_GCJ=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
+   # 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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:15814: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:15818: \$? = $ac_status" >&5
+   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
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works_GCJ=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
+
+if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+    case $lt_prog_compiler_pic_GCJ in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
+     esac
+else
+    lt_prog_compiler_pic_GCJ=
+     lt_prog_compiler_can_build_shared_GCJ=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_GCJ=
+    ;;
+  *)
+    lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_GCJ=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:15874: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:15878: \$? = $ac_status" >&5
+   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
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o_GCJ=yes
+     fi
+   fi
+   chmod u+w .
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  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
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag_GCJ=
+  enable_shared_with_static_runtimes_GCJ=no
+  archive_cmds_GCJ=
+  archive_expsym_cmds_GCJ=
+  old_archive_From_new_cmds_GCJ=
+  old_archive_from_expsyms_cmds_GCJ=
+  export_dynamic_flag_spec_GCJ=
+  whole_archive_flag_spec_GCJ=
+  thread_safe_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_ld_GCJ=
+  hardcode_libdir_separator_GCJ=
+  hardcode_direct_GCJ=no
+  hardcode_minus_L_GCJ=no
+  hardcode_shlibpath_var_GCJ=unsupported
+  link_all_deplibs_GCJ=unknown
+  hardcode_automatic_GCJ=no
+  module_cmds_GCJ=
+  module_expsym_cmds_GCJ=
+  always_export_symbols_GCJ=no
+  export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_GCJ=
+  # 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'.
+  exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_GCJ=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_GCJ=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$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)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_GCJ=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_GCJ=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=no
+      enable_shared_with_static_runtimes_GCJ=yes
+      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_GCJ='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_GCJ=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds_GCJ="$tmp_archive_cmds"
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` 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
+      if test $supports_anon_versioning = yes; then
+        archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        archive_expsym_cmds_GCJ="$tmp_archive_cmds"
+      fi
+      link_all_deplibs_GCJ=no
+    else
+      ld_shlibs_GCJ=no
+    fi
+    ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_GCJ" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec_GCJ='${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
+ 	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_GCJ=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=yes
+      archive_expsym_cmds_GCJ='$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.
+      hardcode_minus_L_GCJ=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_GCJ=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_GCJ='$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].*|aix5*)
+	  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.
+
+      archive_cmds_GCJ=''
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_separator_GCJ=':'
+      link_all_deplibs_GCJ=yes
+
+      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
+  	  hardcode_direct_GCJ=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct_GCJ=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
+  	  hardcode_minus_L_GCJ=yes
+  	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
+  	  hardcode_libdir_separator_GCJ=
+	  fi
+	esac
+	shared_flag='-shared'
+      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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_GCJ=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.
+	allow_undefined_flag_GCJ='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_GCJ="-z nodefs"
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec_GCJ='${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.
+	  no_undefined_flag_GCJ=' ${wl}-bernotok'
+	  allow_undefined_flag_GCJ=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols_GCJ=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec_GCJ=' '
+	  archive_cmds_need_lc_GCJ=yes
+	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$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)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_GCJ=no
+      ;;
+
+    bsdi4*)
+      export_dynamic_flag_spec_GCJ=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec_GCJ=' '
+      allow_undefined_flag_GCJ=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.
+      archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_GCJ='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_GCJ=yes
+      ;;
+
+    darwin* | rhapsody*)
+    if test "$GXX" = yes ; then
+      archive_cmds_need_lc_GCJ=no
+      case "$host_os" in
+      rhapsody* | darwin1.[012])
+	allow_undefined_flag_GCJ='-undefined suppress'
+	;;
+      *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+      	allow_undefined_flag_GCJ='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[012])
+            allow_undefined_flag_GCJ='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            allow_undefined_flag_GCJ='-undefined dynamic_lookup'
+            ;;
+        esac
+      fi
+	;;
+      esac
+    	lt_int_apple_cc_single_mod=no
+    	output_verbose_link_cmd='echo'
+    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+    	  lt_int_apple_cc_single_mod=yes
+    	fi
+    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+    	  archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+    	else
+        archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -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'
+      fi
+      module_cmds_GCJ='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+          archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        else
+          archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        fi
+          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      hardcode_direct_GCJ=no
+      hardcode_automatic_GCJ=yes
+      hardcode_shlibpath_var_GCJ=unsupported
+      whole_archive_flag_spec_GCJ='-all_load $convenience'
+      link_all_deplibs_GCJ=yes
+    else
+      ld_shlibs_GCJ=no
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_GCJ=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*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu)
+      archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$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
+	archive_cmds_GCJ='$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
+      hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_direct_GCJ=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_GCJ=yes
+      export_dynamic_flag_spec_GCJ='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_GCJ='$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*|ia64*)
+	  archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*)
+	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
+	  hardcode_libdir_separator_GCJ=:
+	  hardcode_direct_GCJ=no
+	  hardcode_shlibpath_var_GCJ=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
+	  hardcode_direct_GCJ=no
+	  hardcode_shlibpath_var_GCJ=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_GCJ=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_GCJ=:
+	  hardcode_direct_GCJ=yes
+	  export_dynamic_flag_spec_GCJ='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_GCJ=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      link_all_deplibs_GCJ=yes
+      ;;
+
+    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    newsos6)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_GCJ='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec_GCJ='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      allow_undefined_flag_GCJ=unsupported
+      archive_cmds_GCJ='$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'
+      old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_GCJ=' -expect_unresolved \*'
+	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_GCJ=' -expect_unresolved \*'
+	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag_GCJ=' -z text'
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds_GCJ='$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'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+      esac
+      link_all_deplibs_GCJ=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.
+	archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_GCJ=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_GCJ='$CC -r -o $output$reload_objs'
+	  hardcode_direct_GCJ=no
+        ;;
+	motorola)
+	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_GCJ=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_GCJ=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=no
+      hardcode_shlibpath_var_GCJ=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_GCJ='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag_GCJ=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_GCJ='$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'
+      hardcode_libdir_flag_spec_GCJ=
+      hardcode_shlibpath_var_GCJ=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    *)
+      ld_shlibs_GCJ=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+echo "${ECHO_T}$ld_shlibs_GCJ" >&6
+test "$ld_shlibs_GCJ" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_GCJ" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_GCJ=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_GCJ 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.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_GCJ
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
+        allow_undefined_flag_GCJ=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_GCJ=no
+        else
+	  archive_cmds_need_lc_GCJ=yes
+        fi
+        allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | 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'
+  ;;
+
+netbsdelf*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=yes
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_GCJ=
+if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+   test -n "$runpath_var GCJ" || \
+   test "X$hardcode_automatic_GCJ"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_GCJ" != 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_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
+     test "$hardcode_minus_L_GCJ" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_GCJ=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_GCJ=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_GCJ=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+echo "${ECHO_T}$hardcode_action_GCJ" >&6
+
+if test "$hardcode_action_GCJ" = relink; 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
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+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"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+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"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    ;;
+  esac
+fi
+
+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*)
+    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
+    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+   ;;
+
+  *)
+    echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 18062 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 18160 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+    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
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_GCJ \
+    CC_GCJ \
+    LD_GCJ \
+    lt_prog_compiler_wl_GCJ \
+    lt_prog_compiler_pic_GCJ \
+    lt_prog_compiler_static_GCJ \
+    lt_prog_compiler_no_builtin_flag_GCJ \
+    export_dynamic_flag_spec_GCJ \
+    thread_safe_flag_spec_GCJ \
+    whole_archive_flag_spec_GCJ \
+    enable_shared_with_static_runtimes_GCJ \
+    old_archive_cmds_GCJ \
+    old_archive_from_new_cmds_GCJ \
+    predep_objects_GCJ \
+    postdep_objects_GCJ \
+    predeps_GCJ \
+    postdeps_GCJ \
+    compiler_lib_search_path_GCJ \
+    archive_cmds_GCJ \
+    archive_expsym_cmds_GCJ \
+    postinstall_cmds_GCJ \
+    postuninstall_cmds_GCJ \
+    old_archive_from_expsyms_cmds_GCJ \
+    allow_undefined_flag_GCJ \
+    no_undefined_flag_GCJ \
+    export_symbols_cmds_GCJ \
+    hardcode_libdir_flag_spec_GCJ \
+    hardcode_libdir_flag_spec_ld_GCJ \
+    hardcode_libdir_separator_GCJ \
+    hardcode_automatic_GCJ \
+    module_cmds_GCJ \
+    module_expsym_cmds_GCJ \
+    lt_cv_prog_compiler_c_o_GCJ \
+    exclude_expsyms_GCJ \
+    include_expsyms_GCJ; do
+
+    case $var in
+    old_archive_cmds_GCJ | \
+    old_archive_from_new_cmds_GCJ | \
+    archive_cmds_GCJ | \
+    archive_expsym_cmds_GCJ | \
+    module_cmds_GCJ | \
+    module_expsym_cmds_GCJ | \
+    old_archive_from_expsyms_cmds_GCJ | \
+    export_symbols_cmds_GCJ | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_GCJ
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_GCJ
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_GCJ
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_GCJ
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_GCJ
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_GCJ
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_GCJ
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_GCJ
+archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_GCJ
+module_expsym_cmds=$lt_module_expsym_cmds_GCJ
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_GCJ
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_GCJ
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_GCJ
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_GCJ
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_GCJ
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_GCJ
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_GCJ
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_GCJ
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_GCJ
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_GCJ"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_GCJ
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_GCJ
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_GCJ
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_GCJ
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      RC)
+
+
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+objext_RC=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# 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.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+compiler_RC=$CC
+lt_cv_prog_compiler_c_o_RC=yes
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_RC \
+    CC_RC \
+    LD_RC \
+    lt_prog_compiler_wl_RC \
+    lt_prog_compiler_pic_RC \
+    lt_prog_compiler_static_RC \
+    lt_prog_compiler_no_builtin_flag_RC \
+    export_dynamic_flag_spec_RC \
+    thread_safe_flag_spec_RC \
+    whole_archive_flag_spec_RC \
+    enable_shared_with_static_runtimes_RC \
+    old_archive_cmds_RC \
+    old_archive_from_new_cmds_RC \
+    predep_objects_RC \
+    postdep_objects_RC \
+    predeps_RC \
+    postdeps_RC \
+    compiler_lib_search_path_RC \
+    archive_cmds_RC \
+    archive_expsym_cmds_RC \
+    postinstall_cmds_RC \
+    postuninstall_cmds_RC \
+    old_archive_from_expsyms_cmds_RC \
+    allow_undefined_flag_RC \
+    no_undefined_flag_RC \
+    export_symbols_cmds_RC \
+    hardcode_libdir_flag_spec_RC \
+    hardcode_libdir_flag_spec_ld_RC \
+    hardcode_libdir_separator_RC \
+    hardcode_automatic_RC \
+    module_cmds_RC \
+    module_expsym_cmds_RC \
+    lt_cv_prog_compiler_c_o_RC \
+    exclude_expsyms_RC \
+    include_expsyms_RC; do
+
+    case $var in
+    old_archive_cmds_RC | \
+    old_archive_from_new_cmds_RC | \
+    archive_cmds_RC | \
+    archive_expsym_cmds_RC | \
+    module_cmds_RC | \
+    module_expsym_cmds_RC | \
+    old_archive_from_expsyms_cmds_RC | \
+    export_symbols_cmds_RC | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_RC
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_RC
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_RC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_RC
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_RC
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_RC
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_RC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_RC
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_RC
+archive_expsym_cmds=$lt_archive_expsym_cmds_RC
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_RC
+module_expsym_cmds=$lt_module_expsym_cmds_RC
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_RC
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_RC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_RC
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_RC
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_RC
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_RC
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_RC
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_RC
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_RC
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_RC
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_RC"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_RC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_RC
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_RC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_RC
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	;;
+
+      *)
+	{ { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
+echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+	;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
+echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Prevent multiple expansion
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test x$GCC = xyes; then
+    echo "$as_me:$LINENO: checking version 3.x of gcc" >&5
+echo $ECHO_N "checking version 3.x of gcc... $ECHO_C" >&6
+    if test -n "`$CC --version 2>&1|grep '3.'`"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define EXT_HASH
+_ACEOF
+
+        echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6;
+    else
+        echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6!
+    fi
+fi
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+
+if test -n "$ac_pt_PKG_CONFIG"; then
+  echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  PKG_CONFIG=$ac_pt_PKG_CONFIG
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.9.0
+	echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+	else
+		echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+		PKG_CONFIG=""
+	fi
+
+fi
+
+pkg_failed=no
+echo "$as_me:$LINENO: checking for OGRE_CFLAGS" >&5
+echo $ECHO_N "checking for OGRE_CFLAGS... $ECHO_C" >&6
+if test "${pkg_cv_OGRE_CFLAGS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "x$ac_cv_env_OGRE_CFLAGS_set" = "xset"; then
+	pkg_cv_OGRE_CFLAGS=$ac_cv_env_OGRE_CFLAGS_value
+elif test -n "$PKG_CONFIG"; then
+	if { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists \"OGRE\" >/dev/null 2>&1") >&5
+  ($PKG_CONFIG --exists "OGRE" >/dev/null 2>&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+		pkg_cv_OGRE_CFLAGS=`$PKG_CONFIG --cflags "OGRE" 2>/dev/null`
+	else
+		pkg_failed=yes
+	fi
+else
+	pkg_failed=untried
+fi
+fi
+echo "$as_me:$LINENO: result: $pkg_cv_OGRE_CFLAGS" >&5
+echo "${ECHO_T}$pkg_cv_OGRE_CFLAGS" >&6
+echo "$as_me:$LINENO: checking for OGRE_LIBS" >&5
+echo $ECHO_N "checking for OGRE_LIBS... $ECHO_C" >&6
+if test "${pkg_cv_OGRE_LIBS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "x$ac_cv_env_OGRE_LIBS_set" = "xset"; then
+	pkg_cv_OGRE_LIBS=$ac_cv_env_OGRE_LIBS_value
+elif test -n "$PKG_CONFIG"; then
+	if { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists \"OGRE\" >/dev/null 2>&1") >&5
+  ($PKG_CONFIG --exists "OGRE" >/dev/null 2>&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+		pkg_cv_OGRE_LIBS=`$PKG_CONFIG --libs "OGRE" 2>/dev/null`
+	else
+		pkg_failed=yes
+	fi
+else
+	pkg_failed=untried
+fi
+fi
+echo "$as_me:$LINENO: result: $pkg_cv_OGRE_LIBS" >&5
+echo "${ECHO_T}$pkg_cv_OGRE_LIBS" >&6
+
+if test $pkg_failed = yes; then
+	OGRE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "OGRE"`
+	# Put the nasty error message in config.log where it belongs
+	echo "$OGRE_PKG_ERRORS" 1>&5
+
+	{ { echo "$as_me:$LINENO: error: Package requirements (OGRE) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the OGRE_CFLAGS and OGRE_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details." >&5
+echo "$as_me: error: Package requirements (OGRE) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the OGRE_CFLAGS and OGRE_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details." >&2;}
+   { (exit 1); exit 1; }; }
+elif test $pkg_failed = untried; then
+	{ { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively you may set the OGRE_CFLAGS and OGRE_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&5
+echo "$as_me: error: The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively you may set the OGRE_CFLAGS and OGRE_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+	OGRE_CFLAGS=$pkg_cv_OGRE_CFLAGS
+	OGRE_LIBS=$pkg_cv_OGRE_LIBS
+	:
+fi
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for main in -lode" >&5
+echo $ECHO_N "checking for main in -lode... $ECHO_C" >&6
+if test "${ac_cv_lib_ode_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lode  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_ode_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_ode_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ode_main" >&5
+echo "${ECHO_T}$ac_cv_lib_ode_main" >&6
+if test $ac_cv_lib_ode_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBODE 1
+_ACEOF
+
+  LIBS="-lode $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: Can't find libode" >&5
+echo "$as_me: error: Can't find libode" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for pow in -lm" >&5
+echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_pow+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char pow ();
+int
+main ()
+{
+pow ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_pow=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_pow=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5
+echo "${ECHO_T}$ac_cv_lib_m_pow" >&6
+if test $ac_cv_lib_m_pow = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+
+
+echo "$as_me:$LINENO: checking for gzopen in -lz" >&5
+echo $ECHO_N "checking for gzopen in -lz... $ECHO_C" >&6
+if test "${ac_cv_lib_z_gzopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char gzopen ();
+int
+main ()
+{
+gzopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_z_gzopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_z_gzopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzopen" >&5
+echo "${ECHO_T}$ac_cv_lib_z_gzopen" >&6
+if test $ac_cv_lib_z_gzopen = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBZ 1
+_ACEOF
+
+  LIBS="-lz $LIBS"
+
+fi
+
+echo "$as_me:$LINENO: checking for snprintf" >&5
+echo $ECHO_N "checking for snprintf... $ECHO_C" >&6
+if test "${ac_cv_func_snprintf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define snprintf to an innocuous variant, in case <limits.h> declares snprintf.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define snprintf innocuous_snprintf
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char snprintf (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef snprintf
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char snprintf ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_snprintf) || defined (__stub___snprintf)
+choke me
+#else
+char (*f) () = snprintf;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != snprintf;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_snprintf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_snprintf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_snprintf" >&5
+echo "${ECHO_T}$ac_cv_func_snprintf" >&6
+if test $ac_cv_func_snprintf = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SNPRINTF
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for vsnprintf" >&5
+echo $ECHO_N "checking for vsnprintf... $ECHO_C" >&6
+if test "${ac_cv_func_vsnprintf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define vsnprintf to an innocuous variant, in case <limits.h> declares vsnprintf.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define vsnprintf innocuous_vsnprintf
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char vsnprintf (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef vsnprintf
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char vsnprintf ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_vsnprintf) || defined (__stub___vsnprintf)
+choke me
+#else
+char (*f) () = vsnprintf;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != vsnprintf;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_vsnprintf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_vsnprintf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_vsnprintf" >&5
+echo "${ECHO_T}$ac_cv_func_vsnprintf" >&6
+if test $ac_cv_func_vsnprintf = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_VSNPRINTF
+_ACEOF
+
+fi
+
+
+                                                            ac_config_files="$ac_config_files Makefile ReferenceAppLayer/Makefile ReferenceAppLayer/src/Makefile ReferenceAppLayer/include/Makefile BspCollision/Makefile BspCollision/src/Makefile"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+  (set) 2>&1 |
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+  if test -w $cache_file; then
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[	 ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[	 ]*$//;
+}'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_i=`echo "$ac_i" |
+	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# 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+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.  Logging --version etc. is OK.
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by OGRE_REFAPP $as_me 0.10.0, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -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
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+		   instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+		   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+OGRE_REFAPP config.status 0.10.0
+configured by $0, generated by GNU Autoconf 2.59,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  -*)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_option=$1
+     ac_need_defaults=false;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1" ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "ReferenceAppLayer/Makefile" ) CONFIG_FILES="$CONFIG_FILES ReferenceAppLayer/Makefile" ;;
+  "ReferenceAppLayer/src/Makefile" ) CONFIG_FILES="$CONFIG_FILES ReferenceAppLayer/src/Makefile" ;;
+  "ReferenceAppLayer/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES ReferenceAppLayer/include/Makefile" ;;
+  "BspCollision/Makefile" ) CONFIG_FILES="$CONFIG_FILES BspCollision/Makefile" ;;
+  "BspCollision/src/Makefile" ) CONFIG_FILES="$CONFIG_FILES BspCollision/src/Makefile" ;;
+  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+  "ReferenceAppLayer/include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ReferenceAppLayer/include/config.h" ;;
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./confstat$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@CYGPATH_W@,$CYGPATH_W,;t t
+s,@PACKAGE@,$PACKAGE,;t t
+s,@VERSION@,$VERSION,;t t
+s,@ACLOCAL@,$ACLOCAL,;t t
+s,@AUTOCONF@,$AUTOCONF,;t t
+s,@AUTOMAKE@,$AUTOMAKE,;t t
+s,@AUTOHEADER@,$AUTOHEADER,;t t
+s,@MAKEINFO@,$MAKEINFO,;t t
+s,@install_sh@,$install_sh,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s,@mkdir_p@,$mkdir_p,;t t
+s,@AWK@,$AWK,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@am__leading_dot@,$am__leading_dot,;t t
+s,@AMTAR@,$AMTAR,;t t
+s,@am__tar@,$am__tar,;t t
+s,@am__untar@,$am__untar,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@target@,$target,;t t
+s,@target_cpu@,$target_cpu,;t t
+s,@target_vendor@,$target_vendor,;t t
+s,@target_os@,$target_os,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@DEPDIR@,$DEPDIR,;t t
+s,@am__include@,$am__include,;t t
+s,@am__quote@,$am__quote,;t t
+s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s,@CCDEPMODE@,$CCDEPMODE,;t t
+s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@CXX@,$CXX,;t t
+s,@CXXFLAGS@,$CXXFLAGS,;t t
+s,@ac_ct_CXX@,$ac_ct_CXX,;t t
+s,@CXXDEPMODE@,$CXXDEPMODE,;t t
+s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t
+s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t
+s,@EGREP@,$EGREP,;t t
+s,@LN_S@,$LN_S,;t t
+s,@ECHO@,$ECHO,;t t
+s,@AR@,$AR,;t t
+s,@ac_ct_AR@,$ac_ct_AR,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@CPP@,$CPP,;t t
+s,@CXXCPP@,$CXXCPP,;t t
+s,@F77@,$F77,;t t
+s,@FFLAGS@,$FFLAGS,;t t
+s,@ac_ct_F77@,$ac_ct_F77,;t t
+s,@LIBTOOL@,$LIBTOOL,;t t
+s,@PKG_CONFIG@,$PKG_CONFIG,;t t
+s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
+s,@OGRE_CFLAGS@,$OGRE_CFLAGS,;t t
+s,@OGRE_LIBS@,$OGRE_LIBS,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+  cat >>$CONFIG_STATUS <<\_ACEOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+  esac
+
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    configure_input=
+  else
+    configure_input="$ac_file.  "
+  fi
+  configure_input=$configure_input"Generated from `echo $ac_file_in |
+				     sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
+ac_dB='[	 ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 # Do quote $f, to prevent DOS paths from being IFS'd.
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+  # Remove the trailing spaces.
+  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h.  The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status.  Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless.  Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo '  :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+  # Write a limited-size here document to $tmp/defines.sed.
+  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#define' lines.
+  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/defines.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo '  fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+  # Write a limited-size here document to $tmp/undefs.sed.
+  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#undef'
+  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+  rm -f conftest.undefs
+  mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    echo "/* Generated by configure.  */" >$tmp/config.h
+  else
+    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
+  fi
+  cat $tmp/in >>$tmp/config.h
+  rm -f $tmp/in
+  if test x"$ac_file" != x-; then
+    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+      { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+      rm -f $ac_file
+      mv $tmp/config.h $ac_file
+    fi
+  else
+    cat $tmp/config.h
+    rm -f $tmp/config.h
+  fi
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $ac_file | $ac_file:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X$ac_file : 'X\(//\)[^/]' \| \
+	 X$ac_file : 'X\(//\)$' \| \
+	 X$ac_file : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`/stamp-h$_am_stamp_count
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_dest" : 'X\(//\)[^/]' \| \
+	 X"$ac_dest" : 'X\(//\)$' \| \
+	 X"$ac_dest" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+  case $ac_dest in
+    depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    { if $as_mkdir_p; then
+    mkdir -p $dirpart/$fdir
+  else
+    as_dir=$dirpart/$fdir
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+  esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+
Index: /ReferenceApplication/configure.in
===================================================================
--- /ReferenceApplication/configure.in	(revision 5)
+++ /ReferenceApplication/configure.in	(revision 5)
@@ -0,0 +1,47 @@
+AC_PREREQ(2.50)
+
+AC_INIT(OGRE_REFAPP, 0.10.0)
+AM_INIT_AUTOMAKE([1.6.1 foreign no-installinfo no-installman subdir-objects])
+AM_CONFIG_HEADER(ReferenceAppLayer/include/config.h)
+
+AC_CANONICAL_TARGET
+
+dnl Check for programs
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_INSTALL
+
+AM_PROG_LIBTOOL
+
+dnl GCC ersion check
+if test x$GCC = xyes; then
+    AC_MSG_CHECKING([version 3.x of gcc])
+    if test -n "`$CC --version 2>&1|grep '3.'`"; then
+        AC_DEFINE(EXT_HASH,, Use old STL hash options)
+        AC_MSG_RESULT(yes);
+    else
+        AC_MSG_RESULT(no)!
+    fi
+fi
+
+dnl Other stuff we need
+PKG_CHECK_MODULES(OGRE, OGRE)
+AC_LANG_PUSH([C++])
+AC_CHECK_LIB([ode], [main], [], AC_MSG_ERROR([Can't find libode]))
+AC_LANG_POP([C++])
+AC_CHECK_LIB(m, pow)
+AC_CHECK_LIB(z, gzopen)
+AC_CHECK_FUNC(snprintf, AC_DEFINE(HAVE_SNPRINTF,,snprintf))
+AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF,,vsnprintf))
+
+dnl Create the makefiles
+AC_CONFIG_FILES([Makefile \
+    ReferenceAppLayer/Makefile \
+    ReferenceAppLayer/src/Makefile \
+    ReferenceAppLayer/include/Makefile \
+	BspCollision/Makefile \
+	BspCollision/src/Makefile 
+	
+    ])
+
+AC_OUTPUT
Index: /RenderSystems/Direct3D9/Makefile.am
===================================================================
--- /RenderSystems/Direct3D9/Makefile.am	(revision 5)
+++ /RenderSystems/Direct3D9/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /RenderSystems/Direct3D9/Makefile.in
===================================================================
--- /RenderSystems/Direct3D9/Makefile.in	(revision 5)
+++ /RenderSystems/Direct3D9/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = RenderSystems/Direct3D9
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  RenderSystems/Direct3D9/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  RenderSystems/Direct3D9/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /RenderSystems/Direct3D9/include/Makefile.am
===================================================================
--- /RenderSystems/Direct3D9/include/Makefile.am	(revision 5)
+++ /RenderSystems/Direct3D9/include/Makefile.am	(revision 5)
@@ -0,0 +1,21 @@
+noinst_HEADERS = \
+OgreD3D9Driver.h \
+OgreD3D9DriverList.h \
+OgreD3D9GpuProgram.h \
+OgreD3D9GpuProgramManager.h \
+OgreD3D9HLSLProgram.h \
+OgreD3D9HLSLProgramFactory.h \
+OgreD3D9HardwareBufferManager.h \
+OgreD3D9HardwareIndexBuffer.h \
+OgreD3D9HardwareOcclusionQuery.h \
+OgreD3D9HardwareVertexBuffer.h \
+OgreD3D9Mappings.h \
+OgreD3D9Plugin.h \
+OgreD3D9Prerequisites.h \
+OgreD3D9RenderSystem.h \
+OgreD3D9RenderWindow.h \
+OgreD3D9Texture.h \
+OgreD3D9TextureManager.h \
+OgreD3D9VertexDeclaration.h \
+OgreD3D9VideoMode.h \
+OgreD3D9VideoModeList.h
Index: /RenderSystems/Direct3D9/include/Makefile.in
===================================================================
--- /RenderSystems/Direct3D9/include/Makefile.in	(revision 5)
+++ /RenderSystems/Direct3D9/include/Makefile.in	(revision 5)
@@ -0,0 +1,457 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = RenderSystems/Direct3D9/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = \
+OgreD3D9Driver.h \
+OgreD3D9DriverList.h \
+OgreD3D9GpuProgram.h \
+OgreD3D9GpuProgramManager.h \
+OgreD3D9HLSLProgram.h \
+OgreD3D9HLSLProgramFactory.h \
+OgreD3D9HardwareBufferManager.h \
+OgreD3D9HardwareIndexBuffer.h \
+OgreD3D9HardwareOcclusionQuery.h \
+OgreD3D9HardwareVertexBuffer.h \
+OgreD3D9Mappings.h \
+OgreD3D9Plugin.h \
+OgreD3D9Prerequisites.h \
+OgreD3D9RenderSystem.h \
+OgreD3D9RenderWindow.h \
+OgreD3D9Texture.h \
+OgreD3D9TextureManager.h \
+OgreD3D9VertexDeclaration.h \
+OgreD3D9VideoMode.h \
+OgreD3D9VideoModeList.h
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  RenderSystems/Direct3D9/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  RenderSystems/Direct3D9/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /RenderSystems/Direct3D9/include/OgreD3D9Driver.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9Driver.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9Driver.h	(revision 5)
@@ -0,0 +1,84 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9DRIVER_H__
+#define __D3D9DRIVER_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreString.h"
+
+#include "OgreNoMemoryMacros.h"
+#include <d3d9.h>
+#include <d3dx9.h>
+#include <dxerr9.h>
+#include "OgreMemoryMacros.h"
+
+namespace Ogre
+{
+
+	class D3D9VideoModeList;
+	class D3D9VideoMode;
+
+	class D3D9Driver
+	{
+	private:
+		LPDIRECT3D9 mpD3D;
+		// D3D only allows one device per adapter, so it can safely be stored
+		// here as well.
+		LPDIRECT3DDEVICE9 mpD3DDevice;
+		unsigned int mAdapterNumber;
+		D3DADAPTER_IDENTIFIER9 mAdapterIdentifier;
+		D3DDISPLAYMODE mDesktopDisplayMode;
+		D3D9VideoModeList* mpVideoModeList;
+		unsigned int tempNo;
+        static unsigned int driverCount;
+
+	public:
+		// Constructors
+		D3D9Driver();						// Default
+		D3D9Driver( const D3D9Driver &ob );	// Copy
+		D3D9Driver( LPDIRECT3D9 pD3D, unsigned int adapterNumber, const D3DADAPTER_IDENTIFIER9& adapterIdentifer, const D3DDISPLAYMODE& desktopDisplayMode );
+		~D3D9Driver();
+
+		// Information accessors
+		String DriverName() const;
+		String DriverDescription() const;
+
+		LPDIRECT3D9 getD3D() { return mpD3D; }
+		// return the device
+		LPDIRECT3DDEVICE9 getD3DDevice() { return mpD3DDevice; }
+		// change the device
+		void setD3DDevice(LPDIRECT3DDEVICE9 pD3DDevice) { mpD3DDevice = pD3DDevice; }
+		unsigned int getAdapterNumber() const { return mAdapterNumber; }
+		const D3DADAPTER_IDENTIFIER9& getAdapterIdentifier() const { return mAdapterIdentifier; }
+		const D3DDISPLAYMODE& getDesktopMode() const { return mDesktopDisplayMode; }
+
+		D3D9VideoModeList* getVideoModeList();
+	};
+}
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9DriverList.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9DriverList.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9DriverList.h	(revision 5)
@@ -0,0 +1,58 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9DRIVERLIST_H__
+#define __D3D9DRIVERLIST_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreD3D9Driver.h"
+
+#include "OgreNoMemoryMacros.h"
+#include <d3d9.h>
+#include "OgreMemoryMacros.h"
+
+namespace Ogre 
+{
+	class D3D9DriverList
+	{
+	private:
+		std::vector<D3D9Driver> mDriverList;
+		LPDIRECT3D9 mpD3D;
+
+	public:
+		D3D9DriverList( LPDIRECT3D9 pD3D );
+		~D3D9DriverList();
+
+		BOOL enumerate();
+		size_t count() const;
+		D3D9Driver* item( size_t index );
+
+		D3D9Driver* item( const String &name );
+	};
+}
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9GpuProgram.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9GpuProgram.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9GpuProgram.h	(revision 5)
@@ -0,0 +1,147 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9GpuProgram_H_
+#define __D3D9GpuProgram_H_
+
+// Precompiler options
+#include "OgreD3D9Prerequisites.h"
+#include "OgreGpuProgram.h"
+
+namespace Ogre {
+
+    /** Direct3D implementation of a few things common to low-level vertex & fragment programs. */
+    class D3D9GpuProgram : public GpuProgram
+    {
+    protected:
+        LPDIRECT3DDEVICE9 mpDevice;
+        LPD3DXBUFFER mpExternalMicrocode; // microcode from elsewhere, we do NOT delete this ourselves
+    public:
+        D3D9GpuProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
+            const String& group, bool isManual, ManualResourceLoader* loader, LPDIRECT3DDEVICE9 pDev);
+        
+
+        /** Tells the program to load from some externally created microcode instead of a file or source. 
+        @remarks
+            It is the callers responsibility to delete the microcode buffer.
+        */ 
+        void setExternalMicrocode(LPD3DXBUFFER pMicrocode) { mpExternalMicrocode = pMicrocode; }
+        /** Gets the external microcode buffer, if any. */
+        LPD3DXBUFFER getExternalMicrocode(void) { return mpExternalMicrocode; }
+    protected:
+        /** @copydoc Resource::loadImpl */
+        void loadImpl(void);
+        /** Overridden from GpuProgram */
+        void loadFromSource(void);
+        /** Internal method to load from microcode, must be overridden by subclasses. */
+        virtual void loadFromMicrocode(LPD3DXBUFFER microcode) = 0;
+
+
+    };
+
+    /** Direct3D implementation of low-level vertex programs. */
+    class D3D9GpuVertexProgram : public D3D9GpuProgram
+    {
+    protected:
+        LPDIRECT3DVERTEXSHADER9 mpVertexShader;
+    public:
+        D3D9GpuVertexProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
+            const String& group, bool isManual, ManualResourceLoader* loader, LPDIRECT3DDEVICE9 pDev);
+		~D3D9GpuVertexProgram();
+        /// Gets the vertex shader
+        LPDIRECT3DVERTEXSHADER9 getVertexShader(void) const { return mpVertexShader; }
+    protected:
+        /** @copydoc Resource::unloadImpl */
+        void unloadImpl(void);
+        void loadFromMicrocode(LPD3DXBUFFER microcode);
+    };
+
+    /** Direct3D implementation of low-level fragment programs. */
+    class D3D9GpuFragmentProgram : public D3D9GpuProgram
+    {
+    protected:
+        LPDIRECT3DPIXELSHADER9 mpPixelShader;
+    public:
+        D3D9GpuFragmentProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
+            const String& group, bool isManual, ManualResourceLoader* loader, LPDIRECT3DDEVICE9 pDev);
+		~D3D9GpuFragmentProgram();
+        /// Gets the pixel shader
+        LPDIRECT3DPIXELSHADER9 getPixelShader(void) const { return mpPixelShader; }
+    protected:
+        /** @copydoc Resource::unloadImpl */
+        void unloadImpl(void);
+        void loadFromMicrocode(LPD3DXBUFFER microcode);
+    };
+    /** Specialisation of SharedPtr to allow SharedPtr to be assigned to D3D9GpuProgramPtr 
+    @note Has to be a subclass since we need operator=.
+    We could templatise this instead of repeating per Resource subclass, 
+    except to do so requires a form VC6 does not support i.e.
+    ResourceSubclassPtr<T> : public SharedPtr<T>
+    */
+    class _OgreExport D3D9GpuProgramPtr : public SharedPtr<D3D9GpuProgram> 
+    {
+    public:
+        D3D9GpuProgramPtr() : SharedPtr<D3D9GpuProgram>() {}
+        explicit D3D9GpuProgramPtr(D3D9GpuProgram* rep) : SharedPtr<D3D9GpuProgram>(rep) {}
+        D3D9GpuProgramPtr(const D3D9GpuProgramPtr& r) : SharedPtr<D3D9GpuProgram>(r) {} 
+        D3D9GpuProgramPtr(const ResourcePtr& r) : SharedPtr<D3D9GpuProgram>()
+        {
+			// lock & copy other mutex pointer
+			OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+            pRep = static_cast<D3D9GpuProgram*>(r.getPointer());
+            pUseCount = r.useCountPointer();
+            if (pUseCount)
+            {
+                ++(*pUseCount);
+            }
+        }
+
+        /// Operator used to convert a ResourcePtr to a D3D9GpuProgramPtr
+        D3D9GpuProgramPtr& operator=(const ResourcePtr& r)
+        {
+            if (pRep == static_cast<D3D9GpuProgram*>(r.getPointer()))
+                return *this;
+            release();
+			// lock & copy other mutex pointer
+			OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+            pRep = static_cast<D3D9GpuProgram*>(r.getPointer());
+            pUseCount = r.useCountPointer();
+            if (pUseCount)
+            {
+                ++(*pUseCount);
+            }
+            return *this;
+        }
+    };
+
+}
+
+
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9GpuProgramManager.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9GpuProgramManager.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9GpuProgramManager.h	(revision 5)
@@ -0,0 +1,56 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9GpuProgramManager_H__
+#define __D3D9GpuProgramManager_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreGpuProgramManager.h"
+
+namespace Ogre {
+
+    class D3D9GpuProgramManager : public GpuProgramManager
+    {
+    protected:
+        LPDIRECT3DDEVICE9 mpDevice;
+        /// @copydoc ResourceManager::createImpl
+        Resource* createImpl(const String& name, ResourceHandle handle, 
+            const String& group, bool isManual, ManualResourceLoader* loader,
+            const NameValuePairList* params);
+        /// Specialised create method with specific parameters
+        Resource* createImpl(const String& name, ResourceHandle handle, 
+            const String& group, bool isManual, ManualResourceLoader* loader,
+            GpuProgramType gptype, const String& syntaxCode);
+    public:
+        D3D9GpuProgramManager(LPDIRECT3DDEVICE9 device);
+		~D3D9GpuProgramManager();
+    };
+
+}
+
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9HLSLProgram.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9HLSLProgram.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9HLSLProgram.h	(revision 5)
@@ -0,0 +1,136 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9HLSLProgram_H__
+#define __D3D9HLSLProgram_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreHighLevelGpuProgram.h"
+
+namespace Ogre {
+    /** Specialisation of HighLevelGpuProgram to provide support for D3D9 
+        High-Level Shader Language (HLSL).
+    @remarks
+        Note that the syntax of D3D9 HLSL is identical to nVidia's Cg language, therefore
+        unless you know you will only ever be deploying on Direct3D, or you have some specific
+        reason for not wanting to use the Cg plugin, I suggest you use Cg instead since that
+        can produce programs for OpenGL too.
+    */
+    class D3D9HLSLProgram : public HighLevelGpuProgram
+    {
+    public:
+        /// Command object for setting entry point
+        class CmdEntryPoint : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for setting target assembler
+        class CmdTarget : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for setting macro defines
+        class CmdPreprocessorDefines : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+        /// Command object for setting matrix packing in column-major order
+        class CmdColumnMajorMatrices : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& val);
+        };
+
+    protected:
+
+        static CmdEntryPoint msCmdEntryPoint;
+        static CmdTarget msCmdTarget;
+        static CmdPreprocessorDefines msCmdPreprocessorDefines;
+        static CmdColumnMajorMatrices msCmdColumnMajorMatrices;
+
+        /** Internal load implementation, must be implemented by subclasses.
+        */
+        void loadFromSource(void);
+        /** Internal method for creating an appropriate low-level program from this
+        high-level program, must be implemented by subclasses. */
+        void createLowLevelImpl(void);
+        /// Internal unload implementation, must be implemented by subclasses
+        void unloadHighLevelImpl(void);
+        /// Populate the passed parameters with name->index map, must be overridden
+        void buildConstantDefinitions() const;
+
+        // Recursive utility method for buildParamNameMap
+        void processParamElement(D3DXHANDLE parent, String prefix, unsigned int index) const;
+		void populateDef(D3DXCONSTANT_DESC& d3dDesc, GpuConstantDefinition& def) const;
+
+        String mTarget;
+        String mEntryPoint;
+        String mPreprocessorDefines;
+        bool mColumnMajorMatrices;
+
+        LPD3DXBUFFER mpMicroCode;
+        LPD3DXCONSTANTTABLE mpConstTable;
+
+    public:
+        D3D9HLSLProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
+            const String& group, bool isManual, ManualResourceLoader* loader);
+        ~D3D9HLSLProgram();
+
+        /** Sets the entry point for this program ie the first method called. */
+        void setEntryPoint(const String& entryPoint) { mEntryPoint = entryPoint; }
+        /** Gets the entry point defined for this program. */
+        const String& getEntryPoint(void) const { return mEntryPoint; }
+        /** Sets the shader target to compile down to, e.g. 'vs_1_1'. */
+        void setTarget(const String& target);
+        /** Gets the shader target to compile down to, e.g. 'vs_1_1'. */
+        const String& getTarget(void) const { return mTarget; }
+        /** Sets the preprocessor defines use to compile the program. */
+        void setPreprocessorDefines(const String& defines) { mPreprocessorDefines = defines; }
+        /** Sets the preprocessor defines use to compile the program. */
+        const String& getPreprocessorDefines(void) const { return mPreprocessorDefines; }
+        /** Sets whether matrix packing in column-major order. */ 
+        void setColumnMajorMatrices(bool columnMajor) { mColumnMajorMatrices = columnMajor; }
+        /** Gets whether matrix packed in column-major order. */
+        bool getColumnMajorMatrices(void) const { return mColumnMajorMatrices; }
+        /// Overridden from GpuProgram
+        bool isSupported(void) const;
+        /// Overridden from GpuProgram
+        GpuProgramParametersSharedPtr createParameters(void);
+        /// Overridden from GpuProgram
+        const String& getLanguage(void) const;
+    };
+}
+
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9HLSLProgramFactory.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9HLSLProgramFactory.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9HLSLProgramFactory.h	(revision 5)
@@ -0,0 +1,55 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9HLSLProgramFactory_H__
+#define __D3D9HLSLProgramFactory_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreHighLevelGpuProgramManager.h"
+
+namespace Ogre
+{
+    /** Factory class for D3D9 HLSL programs. */
+    class D3D9HLSLProgramFactory : public HighLevelGpuProgramFactory
+    {
+    protected:
+		static String sLanguageName;
+    public:
+        D3D9HLSLProgramFactory();
+        ~D3D9HLSLProgramFactory();
+		/// Get the name of the language this factory creates programs for
+		const String& getLanguage(void) const;
+        HighLevelGpuProgram* create(ResourceManager* creator, 
+            const String& name, ResourceHandle handle,
+            const String& group, bool isManual, ManualResourceLoader* loader);
+		void destroy(HighLevelGpuProgram* prog);
+
+    };
+}
+
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9HardwareBufferManager.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9HardwareBufferManager.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9HardwareBufferManager.h	(revision 5)
@@ -0,0 +1,75 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9HARWAREBUFFERMANAGER_H__
+#define __D3D9HARWAREBUFFERMANAGER_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreHardwareBufferManager.h"
+
+namespace Ogre {
+
+    /** Implementation of HardwareBufferManager for D3D9. */
+    class D3D9HardwareBufferManager : public HardwareBufferManager
+    {
+    protected:
+        LPDIRECT3DDEVICE9 mlpD3DDevice;
+
+        /// Internal method for creates a new vertex declaration, may be overridden by certain rendering APIs
+        VertexDeclaration* createVertexDeclarationImpl(void);
+        /// Internal method for destroys a vertex declaration, may be overridden by certain rendering APIs
+        void destroyVertexDeclarationImpl(VertexDeclaration* decl);
+
+    public:
+        D3D9HardwareBufferManager(LPDIRECT3DDEVICE9 device);
+        ~D3D9HardwareBufferManager();
+        /// Creates a vertex buffer
+		HardwareVertexBufferSharedPtr 
+            createVertexBuffer(size_t vertexSize, size_t numVerts, HardwareBuffer::Usage usage, bool useShadowBuffer = false);
+		/// Create a hardware vertex buffer
+		HardwareIndexBufferSharedPtr 
+            createIndexBuffer(HardwareIndexBuffer::IndexType itype, size_t numIndexes, HardwareBuffer::Usage usage, bool useShadowBuffer = false);
+
+		/** Release all buffers in the default memory pool. 
+		@remarks
+			Method for dealing with lost devices.
+		*/
+		void releaseDefaultPoolResources(void);
+		/** Recreate all buffers in the default memory pool. 
+		@remarks
+			Method for dealing with lost devices.
+		*/
+		void recreateDefaultPoolResources(void);
+
+
+    };
+
+}
+
+
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9HardwareIndexBuffer.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9HardwareIndexBuffer.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9HardwareIndexBuffer.h	(revision 5)
@@ -0,0 +1,75 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9HARDWAREINDEXBUFFER_H__
+#define __D3D9HARDWAREINDEXBUFFER_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreHardwareIndexBuffer.h"
+
+namespace Ogre { 
+
+
+    class D3D9HardwareIndexBuffer : public HardwareIndexBuffer
+    {
+    protected:
+        LPDIRECT3DINDEXBUFFER9 mlpD3DBuffer;
+		D3DPOOL mD3DPool;
+        /** See HardwareBuffer. */
+        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        /** See HardwareBuffer. */
+		void unlockImpl(void);
+    public:
+		D3D9HardwareIndexBuffer(IndexType idxType, size_t numIndexes, 
+			HardwareBuffer::Usage usage, LPDIRECT3DDEVICE9 pDev, bool useSystemMem, bool useShadowBuffer);
+        ~D3D9HardwareIndexBuffer();
+        /** See HardwareBuffer. */
+        void readData(size_t offset, size_t length, void* pDest);
+        /** See HardwareBuffer. */
+        void writeData(size_t offset, size_t length, const void* pSource,
+				bool discardWholeBuffer = false);
+
+		/// For dealing with lost devices - release the resource if in the default pool
+		bool releaseIfDefaultPool(void);
+		/// For dealing with lost devices - recreate the resource if in the default pool
+		bool recreateIfDefaultPool(LPDIRECT3DDEVICE9 pDev);
+
+		/// Get the D3D-specific index buffer
+        LPDIRECT3DINDEXBUFFER9 getD3DIndexBuffer(void) { return mlpD3DBuffer; }
+
+
+
+    };
+
+
+}
+
+
+
+#endif
+
Index: /RenderSystems/Direct3D9/include/OgreD3D9HardwareOcclusionQuery.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9HardwareOcclusionQuery.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9HardwareOcclusionQuery.h	(revision 5)
@@ -0,0 +1,96 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef _D3D9HARWAREOCCLUSIONQUERY_H__
+#define _D3D9HARWAREOCCLUSIONQUERY_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreHardwareOcclusionQuery.h"
+
+
+namespace Ogre {
+
+	// If you use multiple rendering passes you can test only the first pass and all other passes don't have to be rendered 
+	// if the first pass results has too few pixels visible.
+
+	// Be sure to render all occluder first and whats out so the RenderQue don't switch places on 
+	// the occluding objects and the tested objects because it thinks it's more effective..
+
+	/**
+	* This is a class that is the DirectX9 implementation of 
+	* hardware occlusion testing.
+	*
+	* @author Lee Sandberg, email lee@abcmedia.se
+	*
+	* Updated on 12/7/2004 by Chris McGuirk
+	* Updated on 4/8/2005 by Tuan Kuranes email: tuan.kuranes@free.fr
+	*/
+	class D3D9HardwareOcclusionQuery : public HardwareOcclusionQuery
+	{
+		//----------------------------------------------------------------------
+		// Public methods
+		//--
+	public:
+
+		/**
+		* Default object constructor
+		* 
+		*/
+		D3D9HardwareOcclusionQuery( IDirect3DDevice9* pD3DDevice );
+
+		/**
+		* Object destructor
+		*/
+		~D3D9HardwareOcclusionQuery();
+
+		//------------------------------------------------------------------
+		// Occlusion query functions (see base class documentation for this)
+		//--
+
+		void beginOcclusionQuery();	
+		void endOcclusionQuery();
+		bool pullOcclusionQuery( unsigned int* NumOfFragments);
+		unsigned int getLastQuerysPixelcount() { return mPixelCount; }
+        bool isStillOutstanding(void);
+
+	
+
+		//----------------------------------------------------------------------
+		// private members
+		//--
+	private:	
+		IDirect3DQuery9*	mpQuery;
+		IDirect3DDevice9*   mpDevice;
+	};
+
+
+}
+
+
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9HardwarePixelBuffer.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9HardwarePixelBuffer.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9HardwarePixelBuffer.h	(revision 5)
@@ -0,0 +1,110 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9PIXELBUFFER_H__
+#define __D3D9PIXELBUFFER_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreHardwarePixelBuffer.h"
+
+#include <d3d9.h>
+#include <d3dx9.h>
+namespace Ogre {
+
+	class D3D9HardwarePixelBuffer: public HardwarePixelBuffer
+	{
+	protected:
+		/// Lock a box
+		PixelBox lockImpl(const Image::Box lockBox,  LockOptions options);
+
+		/// Unlock a box
+		void unlockImpl(void);
+
+		/// Create (or update) render textures for slices
+		void createRenderTextures(bool update);
+		/// Destroy render textures for slices
+		void destroyRenderTextures();
+		
+		/// D3DDevice pointer
+		IDirect3DDevice9 *mpDev;
+		
+		/// Surface abstracted by this buffer
+		IDirect3DSurface9 *mSurface;
+		/// Volume abstracted by this buffer
+		IDirect3DVolume9 *mVolume;
+		/// Temporary surface in main memory if direct locking of mSurface is not possible
+		IDirect3DSurface9 *mTempSurface;
+		/// Temporary volume in main memory if direct locking of mVolume is not possible
+		IDirect3DVolume9 *mTempVolume;
+		
+		/// Mipmapping
+		bool mDoMipmapGen;
+		bool mHWMipmaps;
+		IDirect3DBaseTexture9 *mMipTex;
+
+		/// Render targets
+		typedef std::vector<RenderTexture*> SliceTRT;
+        SliceTRT mSliceTRT;
+	public:
+		D3D9HardwarePixelBuffer(HardwareBuffer::Usage usage);
+		
+		/// Call this to associate a D3D surface or volume with this pixel buffer
+		void bind(IDirect3DDevice9 *dev, IDirect3DSurface9 *mSurface, bool update);
+		void bind(IDirect3DDevice9 *dev, IDirect3DVolume9 *mVolume, bool update);
+		
+		/// @copydoc HardwarePixelBuffer::blit
+        void blit(const HardwarePixelBufferSharedPtr &src, const Image::Box &srcBox, const Image::Box &dstBox);
+		
+		/// @copydoc HardwarePixelBuffer::blitFromMemory
+		void blitFromMemory(const PixelBox &src, const Image::Box &dstBox);
+		
+		/// @copydoc HardwarePixelBuffer::blitToMemory
+		void blitToMemory(const Image::Box &srcBox, const PixelBox &dst);
+		
+		/// Internal function to update mipmaps on update of level 0
+		void _genMipmaps();
+		
+		/// Function to set mipmap generation
+		void _setMipmapping(bool doMipmapGen, bool HWMipmaps, IDirect3DBaseTexture9 *mipTex);
+		
+		~D3D9HardwarePixelBuffer();
+
+		/// Get rendertarget for z slice
+		RenderTexture *getRenderTarget(size_t zoffset);
+
+		/// Accessor for surface
+		IDirect3DSurface9 *getSurface() { return mSurface; }
+
+		/// Notify TextureBuffer of destruction of render target
+        virtual void _clearSliceRTT(size_t zoffset)
+        {
+            mSliceTRT[zoffset] = 0;
+        }
+	};
+};
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9HardwareVertexBuffer.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9HardwareVertexBuffer.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9HardwareVertexBuffer.h	(revision 5)
@@ -0,0 +1,73 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9HARDWAREVERTEXBUFFER_H__
+#define __D3D9HARDWAREVERTEXBUFFER_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreHardwareVertexBuffer.h"
+#include <d3d9.h>
+#include <d3dx9.h>
+#include <dxerr9.h>
+
+
+namespace Ogre {
+
+    /// Specialisation of HardwareVertexBuffer for D3D9
+    class D3D9HardwareVertexBuffer : public HardwareVertexBuffer 
+    {
+    protected:
+        LPDIRECT3DVERTEXBUFFER9 mlpD3DBuffer;
+		D3DPOOL mD3DPool;
+        /** See HardwareBuffer. */
+        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        /** See HardwareBuffer. */
+		void unlockImpl(void);
+    public:
+		D3D9HardwareVertexBuffer(size_t vertexSize, size_t numVertices, 
+            HardwareBuffer::Usage usage, LPDIRECT3DDEVICE9 pDev, bool useSystemMem, bool useShadowBuffer);
+        ~D3D9HardwareVertexBuffer();
+        /** See HardwareBuffer. */
+        void readData(size_t offset, size_t length, void* pDest);
+        /** See HardwareBuffer. */
+        void writeData(size_t offset, size_t length, const void* pSource,
+				bool discardWholeBuffer = false);
+		/// For dealing with lost devices - release the resource if in the default pool
+		bool releaseIfDefaultPool(void);
+		/// For dealing with lost devices - recreate the resource if in the default pool
+		bool recreateIfDefaultPool(LPDIRECT3DDEVICE9 pDev);
+
+        /// Get D3D9-specific vertex buffer
+        LPDIRECT3DVERTEXBUFFER9 getD3D9VertexBuffer(void) const { return mlpD3DBuffer; }
+
+
+    };
+
+}
+#endif
+
Index: /RenderSystems/Direct3D9/include/OgreD3D9Mappings.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9Mappings.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9Mappings.h	(revision 5)
@@ -0,0 +1,130 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9MAPPINGS_H__
+#define __D3D9MAPPINGS_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreCommon.h"
+#include "OgreLight.h"
+#include "OgreMaterial.h"
+#include "OgreRenderSystem.h"
+#include "OgreHardwareBuffer.h"
+#include "OgreHardwareIndexBuffer.h"
+
+#include "OgreNoMemoryMacros.h"
+#include <d3d9.h>
+#include <d3dx9.h>
+#include <dxerr9.h>
+#include "OgreMemoryMacros.h"
+
+namespace Ogre 
+{
+	class D3D9Mappings
+	{
+	public:
+		/// enum identifying D3D9 tex. types
+		enum eD3DTexType
+		{
+			/// standard texture
+			D3D_TEX_TYPE_NORMAL,
+			/// cube texture
+			D3D_TEX_TYPE_CUBE,
+			/// volume texture
+			D3D_TEX_TYPE_VOLUME,
+			/// just to have it...
+			D3D_TEX_TYPE_NONE
+		};
+
+		/// enum identifying D3D9 filter usage type
+		enum eD3DFilterUsage
+		{
+			/// min filter
+			D3D_FUSAGE_MIN,
+			/// mag filter
+			D3D_FUSAGE_MAG,
+			/// mip filter
+			D3D_FUSAGE_MIP
+		};
+
+		/// return a D3D9 equivalent for a Ogre ShadeOptions value
+		static DWORD get(ShadeOptions so);
+		/// return a D3D9 equivalent for a Ogre LightTypes value
+		static D3DLIGHTTYPE get(Ogre::Light::LightTypes lightType);
+		/// return a D3D9 equivalent for a Ogre TexCoordCalsMethod value
+		static DWORD get(TexCoordCalcMethod m, const D3DCAPS9& caps);
+		/// return a D3D9 equivalent for a Ogre TextureAddressingMode value
+		static D3DTEXTUREADDRESS get(TextureUnitState::TextureAddressingMode tam, const D3DCAPS9& devCaps);
+		/// return a D3D9 equivalent for a Ogre LayerBlendType value
+		static D3DTEXTURESTAGESTATETYPE get(LayerBlendType lbt);
+		/// return a D3D9 equivalent for a Ogre LayerBlendOperationEx value
+		static DWORD get(LayerBlendOperationEx lbo, const D3DCAPS9& devCaps);
+		/// return a D3D9 equivalent for a Ogre LayerBlendSource value
+		static DWORD get(LayerBlendSource lbs, bool perStageConstants);
+		/// return a D3D9 equivalent for a Ogre SceneBlendFactor value
+		static D3DBLEND get(SceneBlendFactor sbf);
+		/// return a D3D9 equivalent for a Ogre CompareFunction value
+		static DWORD get(CompareFunction cf);
+		/// return a D3D9 equivalent for a Ogre CillingMode value
+		static DWORD get(CullingMode cm, bool flip);
+		/// return a D3D9 equivalent for a Ogre FogMode value
+		static D3DFOGMODE get(FogMode fm);
+		/// return a D3D9 equivalent for a Ogre PolygonMode value
+		static D3DFILLMODE get(PolygonMode level);
+		/// return a D3D9 equivalent for a Ogre StencilOperation value
+		static DWORD get(StencilOperation op, bool invert = false);
+		/// return a D3D9 state type for Ogre FilterType value
+		static D3DSAMPLERSTATETYPE get(FilterType ft);
+		/// return a D3D9 filter option for Ogre FilterType & FilterOption value
+		static DWORD get(FilterType ft, FilterOptions fo, const D3DCAPS9& devCaps, eD3DTexType texType);
+		/// return the D3DtexType equivalent of a Ogre tex. type
+		static eD3DTexType get(TextureType ogreTexType);
+        /// return the combination of D3DUSAGE values for Ogre buffer usage
+        static DWORD get(HardwareBuffer::Usage usage);
+        /// Get lock options
+        static DWORD get(HardwareBuffer::LockOptions options, HardwareBuffer::Usage usage);
+        /// Get index type
+        static D3DFORMAT get(HardwareIndexBuffer::IndexType itype);
+		/// Get vertex data type
+		static D3DDECLTYPE get(VertexElementType vType);
+		/// Get vertex semantic
+		static D3DDECLUSAGE get(VertexElementSemantic sem);
+        // Convert matrix to D3D style
+        static 	D3DXMATRIX makeD3DXMatrix( const Matrix4& mat );
+        // Convert matrix from D3D style
+        static Matrix4 convertD3DXMatrix( const D3DXMATRIX& mat );
+
+		/// utility method, convert D3D9 pixel format to Ogre pixel format
+		static PixelFormat _getPF(D3DFORMAT d3dPF);
+		/// utility method, convert Ogre pixel format to D3D9 pixel format
+		static D3DFORMAT _getPF(PixelFormat ogrePF);
+		/// utility method, find closest Ogre pixel format that D3D9 can support
+		static PixelFormat _getClosestSupportedPF(PixelFormat ogrePF);
+	};
+}
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9MultiRenderTarget.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9MultiRenderTarget.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9MultiRenderTarget.h	(revision 5)
@@ -0,0 +1,74 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9MULTIRENDERTARGET_H__
+#define __D3D9MULTIRENDERTARGET_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreTexture.h"
+#include "OgreRenderTexture.h"
+#include "OgreImage.h"
+#include "OgreException.h"
+#include "OgreD3D9HardwarePixelBuffer.h"
+
+#include "OgreNoMemoryMacros.h"
+#include <d3d9.h>
+#include <d3dx9.h>
+#include <dxerr9.h>
+#include "OgreMemoryMacros.h"
+
+namespace Ogre {
+	class D3D9MultiRenderTarget : public MultiRenderTarget
+	{
+	public:
+		D3D9MultiRenderTarget(const String &name);
+		~D3D9MultiRenderTarget();
+
+		/** @copydoc MultiRenderTarget::bindSurface */
+		virtual void bindSurface(size_t attachment, RenderTexture *target);
+
+
+
+		/** @copydoc MultiRenderTarget::unbindSurface */
+
+		virtual void unbindSurface(size_t attachment);
+
+        virtual void update(void);
+
+		virtual void getCustomAttribute( const String& name, void *pData );
+
+		bool requiresTextureFlipping() const { return false; }
+	private:
+		D3D9HardwarePixelBuffer *targets[OGRE_MAX_MULTIPLE_RENDER_TARGETS];
+
+		/** Check surfaces and update RenderTarget extent */
+		void checkAndUpdate();
+	};
+};
+
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9Plugin.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9Plugin.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9Plugin.h	(revision 5)
@@ -0,0 +1,64 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9Plugin_H__
+#define __D3D9Plugin_H__
+
+#include "OgrePlugin.h"
+#include "OgreD3D9RenderSystem.h"
+
+namespace Ogre
+{
+
+	/** Plugin instance for D3D9 Manager */
+	class D3D9Plugin : public Plugin
+	{
+	public:
+		D3D9Plugin();
+
+
+		/// @copydoc Plugin::getName
+		const String& getName() const;
+
+		/// @copydoc Plugin::install
+		void install();
+
+		/// @copydoc Plugin::initialise
+		void initialise();
+
+		/// @copydoc Plugin::shutdown
+		void shutdown();
+
+		/// @copydoc Plugin::uninstall
+		void uninstall();
+	protected:
+		D3D9RenderSystem* mRenderSystem;
+	};
+}
+
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9Prerequisites.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9Prerequisites.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9Prerequisites.h	(revision 5)
@@ -0,0 +1,93 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9PREREQUISITES_H__
+#define __D3D9PREREQUISITES_H__
+
+#include "OgrePrerequisites.h"
+
+// Define versions for if DirectX is in use (Win32 only)
+#define DIRECT3D_VERSION 0x0900
+
+// some D3D commonly used macros
+#define SAFE_DELETE(p)       { if(p) { delete (p);     (p)=NULL; } }
+#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p);   (p)=NULL; } }
+#define SAFE_RELEASE(p)      { if(p) { (p)->Release(); (p)=NULL; } }
+
+
+#include "OgreNoMemoryMacros.h"
+#undef NOMINMAX
+#define NOMINMAX // required to stop windows.h screwing up std::min definition
+#include <d3d9.h>
+#include <d3dx9.h>
+#include <dxerr9.h>
+#include "OgreMemoryMacros.h"
+
+
+namespace Ogre
+{
+	// Predefine classes
+	class D3D9RenderSystem;
+	class D3D9RenderWindow;
+	class D3D9Texture;
+	class D3D9TextureManager;
+	class D3D9Driver;
+	class D3D9DriverList;
+	class D3D9VideoMode;
+	class D3D9VideoModeList;
+	class D3D9GpuProgram;
+	class D3D9GpuProgramManager;
+    class D3D9HardwareBufferManager;
+    class D3D9HardwareIndexBuffer;
+    class D3D9HLSLProgramFactory;
+    class D3D9HLSLProgram;
+    class D3D9VertexDeclaration;
+
+// Should we ask D3D to manage vertex/index buffers automatically?
+// Doing so avoids lost devices, but also has a performance impact
+// which is unacceptably bad when using very large buffers
+#define OGRE_D3D_MANAGE_BUFFERS 1
+
+    //-------------------------------------------
+	// Windows setttings
+	//-------------------------------------------
+#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) && !defined(OGRE_STATIC_LIB)
+#	ifdef OGRED3DENGINEDLL_EXPORTS
+#		define _OgreD3D9Export __declspec(dllexport)
+#	else
+#       if defined( __MINGW32__ )
+#           define _OgreD3D9Export
+#       else
+#    		define _OgreD3D9Export __declspec(dllimport)
+#       endif
+#	endif
+#else
+#	define _OgreD3D9Export
+#endif	// OGRE_WIN32
+}
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9RenderSystem.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9RenderSystem.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9RenderSystem.h	(revision 5)
@@ -0,0 +1,346 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9RENDERSYSTEM_H__
+#define __D3D9RENDERSYSTEM_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreString.h"
+#include "OgreStringConverter.h"
+#include "OgreRenderSystem.h"
+#include "OgreD3D9Mappings.h"
+
+#include "OgreNoMemoryMacros.h"
+#include <d3d9.h>
+#include <d3dx9.h>
+#include <dxerr9.h>
+#include "OgreMemoryMacros.h"
+
+namespace Ogre 
+{
+#define MAX_LIGHTS 8
+
+	class D3D9DriverList;
+	class D3D9Driver;
+
+	/**
+	Implementation of DirectX9 as a rendering system.
+	*/
+	class D3D9RenderSystem : public RenderSystem
+	{
+	private:
+		/// Direct3D
+		LPDIRECT3D9			mpD3D;
+		/// Direct3D rendering device
+		LPDIRECT3DDEVICE9	mpD3DDevice;
+		
+		// Stored options
+		ConfigOptionMap mOptions;
+		/// full-screen multisampling antialiasing type
+		D3DMULTISAMPLE_TYPE mFSAAType;
+		/// full-screen multisampling antialiasing level
+		DWORD mFSAAQuality;
+
+		/// instance
+		HINSTANCE mhInstance;
+
+		/// List of D3D drivers installed (video cards)
+		D3D9DriverList* mDriverList;
+		/// Currently active driver
+		D3D9Driver* mActiveD3DDriver;
+		/// Device caps.
+		D3DCAPS9 mCaps;
+		/// NVPerfHUD allowed?
+		bool mUseNVPerfHUD;
+		/// Per-stage constant support? (not in main caps since D3D specific & minor)
+		bool mPerStageConstantSupport;
+
+		/// structure holding texture unit settings for every stage
+		struct sD3DTextureStageDesc
+		{
+			/// the type of the texture
+			D3D9Mappings::eD3DTexType texType;
+			/// wich texCoordIndex to use
+			size_t coordIndex;
+			/// type of auto tex. calc. used
+			TexCoordCalcMethod autoTexCoordType;
+            /// Frustum, used if the above is projection
+            const Frustum *frustum;
+			/// texture 
+			IDirect3DBaseTexture9 *pTex;
+			/// vertex texture 
+			IDirect3DBaseTexture9 *pVertexTex;
+		} mTexStageDesc[OGRE_MAX_TEXTURE_LAYERS];
+
+		// Array of up to 8 lights, indexed as per API
+		// Note that a null value indeicates a free slot
+		Light* mLights[MAX_LIGHTS];
+
+		D3D9DriverList* getDirect3DDrivers(void);
+		void refreshD3DSettings(void);
+        void refreshFSAAOptions(void);
+		void freeDevice(void);
+
+		inline bool compareDecls( D3DVERTEXELEMENT9* pDecl1, D3DVERTEXELEMENT9* pDecl2, size_t size );
+
+
+		void initInputDevices(void);
+		void processInputDevices(void);
+		void setD3D9Light( size_t index, Light* light );
+		
+		// state management methods, very primitive !!!
+		HRESULT __SetRenderState(D3DRENDERSTATETYPE state, DWORD value);
+		HRESULT __SetSamplerState(DWORD sampler, D3DSAMPLERSTATETYPE type, DWORD value);
+		HRESULT __SetTextureStageState(DWORD stage, D3DTEXTURESTAGESTATETYPE type, DWORD value);
+
+		HRESULT __SetFloatRenderState(D3DRENDERSTATETYPE state, Real value)
+		{
+#if OGRE_DOUBLE_PRECISION == 1
+			float temp = static_cast<float>(value);
+			return __SetRenderState(state, *((LPDWORD)(&temp)));
+#else
+			return __SetRenderState(state, *((LPDWORD)(&value)));
+#endif
+		}
+
+		/// return anisotropy level
+		DWORD _getCurrentAnisotropy(size_t unit);
+		/// check if a FSAA is supported
+		bool _checkMultiSampleQuality(D3DMULTISAMPLE_TYPE type, DWORD *outQuality, D3DFORMAT format, UINT adapterNum, D3DDEVTYPE deviceType, BOOL fullScreen);
+		/// set FSAA
+		void _setFSAA(D3DMULTISAMPLE_TYPE type, DWORD qualityLevel);
+		
+		D3D9HardwareBufferManager* mHardwareBufferManager;
+		D3D9GpuProgramManager* mGpuProgramManager;
+        D3D9HLSLProgramFactory* mHLSLProgramFactory;
+
+		size_t mLastVertexSourceCount;
+
+
+        /// Internal method for populating the capabilities structure
+        void initCapabilities(void);
+
+        void convertVertexShaderCaps(void);
+        void convertPixelShaderCaps(void);
+		bool checkVertexTextureFormats(void);
+
+        unsigned short mCurrentLights;
+        /// Saved last view matrix
+        Matrix4 mViewMatrix;
+
+		// What follows is a set of duplicated lists just to make it
+		// easier to deal with lost devices
+		
+		/// Primary window, the one used to create the device
+		D3D9RenderWindow* mPrimaryWindow;
+
+		typedef std::vector<D3D9RenderWindow*> SecondaryWindowList;
+		// List of additional windows after the first (swap chains)
+		SecondaryWindowList mSecondaryWindows;
+
+		bool mDeviceLost;
+		bool mBasicStatesInitialised;
+
+		/** Mapping of texture format -> DepthStencil. Used as cache by _getDepthStencilFormatFor
+		*/
+		typedef HashMap<unsigned int, D3DFORMAT> DepthStencilHash;
+		DepthStencilHash mDepthStencilHash;
+
+		/** Mapping of depthstencil format -> depthstencil buffer
+			Keep one depthstencil buffer around for every format that is used, it must be large
+			enough to hold the largest rendering target.
+			This is used as cache by _getDepthStencilFor.
+		*/
+		typedef std::pair<D3DFORMAT, D3DMULTISAMPLE_TYPE> ZBufferFormat;
+		struct ZBufferRef
+		{
+			IDirect3DSurface9 *surface;
+			size_t width, height;
+		};
+		typedef std::map<ZBufferFormat, ZBufferRef> ZBufferHash;
+		ZBufferHash mZBufferHash;
+	public:
+		// constructor
+		D3D9RenderSystem( HINSTANCE hInstance );
+		// destructor
+		~D3D9RenderSystem();
+
+		virtual void initConfigOptions(void);
+
+		// Overridden RenderSystem functions
+		ConfigOptionMap& getConfigOptions(void);
+		String validateConfigOptions(void);
+		RenderWindow* initialise( bool autoCreateWindow, const String& windowTitle = "OGRE Render Window"  );
+		/// @copydoc RenderSystem::createRenderWindow
+		RenderWindow* createRenderWindow(const String &name, unsigned int width, unsigned int height, 
+			bool fullScreen, const NameValuePairList *miscParams = 0);
+
+		/// @copydoc RenderSystem::createRenderTexture
+		RenderTexture * createRenderTexture( const String & name, unsigned int width, unsigned int height,
+		 	TextureType texType = TEX_TYPE_2D, PixelFormat internalFormat = PF_X8R8G8B8, 
+			const NameValuePairList *miscParams = 0 ); 
+
+		/// @copydoc RenderSystem::createMultiRenderTarget
+		virtual MultiRenderTarget * createMultiRenderTarget(const String & name);
+
+		String getErrorDescription( long errorNumber ) const;
+		const String& getName(void) const;
+		// Low-level overridden members
+		void setConfigOption( const String &name, const String &value );
+		void reinitialise();
+		void shutdown();
+		void setAmbientLight( float r, float g, float b );
+		void setShadingType( ShadeOptions so );
+		void setLightingEnabled( bool enabled );
+		void destroyRenderTarget(const String& name);
+		VertexElementType getColourVertexElementType(void) const;
+		void setStencilCheckEnabled(bool enabled);
+        void setStencilBufferParams(CompareFunction func = CMPF_ALWAYS_PASS, 
+            uint32 refValue = 0, uint32 mask = 0xFFFFFFFF, 
+            StencilOperation stencilFailOp = SOP_KEEP, 
+            StencilOperation depthFailOp = SOP_KEEP,
+            StencilOperation passOp = SOP_KEEP, 
+            bool twoSidedOperation = false);
+        void setNormaliseNormals(bool normalise);
+
+		// Low-level overridden members, mainly for internal use
+        void _useLights(const LightList& lights, unsigned short limit);
+		void _setWorldMatrix( const Matrix4 &m );
+		void _setViewMatrix( const Matrix4 &m );
+		void _setProjectionMatrix( const Matrix4 &m );
+		void _setSurfaceParams( const ColourValue &ambient, const ColourValue &diffuse, const ColourValue &specular, const ColourValue &emissive, Real shininess, TrackVertexColourType tracking );
+		void _setPointSpritesEnabled(bool enabled);
+		void _setPointParameters(Real size, bool attenuationEnabled, 
+			Real constant, Real linear, Real quadratic, Real minSize, Real maxSize);
+		void _setTexture(size_t unit, bool enabled, const TexturePtr &texPtr);
+		void _setVertexTexture(size_t unit, const TexturePtr& tex);
+		void _disableTextureUnit(size_t texUnit);
+		void _setTextureCoordSet( size_t unit, size_t index );
+        void _setTextureCoordCalculation(size_t unit, TexCoordCalcMethod m, 
+            const Frustum* frustum = 0);
+		void _setTextureBlendMode( size_t unit, const LayerBlendModeEx& bm );
+        void _setTextureAddressingMode(size_t stage, const TextureUnitState::UVWAddressingMode& uvw);
+        void _setTextureBorderColour(size_t stage, const ColourValue& colour);
+		void _setTextureMipmapBias(size_t unit, float bias);
+		void _setTextureMatrix( size_t unit, const Matrix4 &xform );
+		void _setSceneBlending( SceneBlendFactor sourceFactor, SceneBlendFactor destFactor );
+		void _setAlphaRejectSettings( CompareFunction func, unsigned char value );
+		void _setViewport( Viewport *vp );
+		void _beginFrame(void);
+		void _endFrame(void);
+		void _setCullingMode( CullingMode mode );
+		void _setDepthBufferParams( bool depthTest = true, bool depthWrite = true, CompareFunction depthFunction = CMPF_LESS_EQUAL );
+		void _setDepthBufferCheckEnabled( bool enabled = true );
+		void _setColourBufferWriteEnabled(bool red, bool green, bool blue, bool alpha);
+		void _setDepthBufferWriteEnabled(bool enabled = true);
+		void _setDepthBufferFunction( CompareFunction func = CMPF_LESS_EQUAL );
+		void _setDepthBias(float constantBias, float slopeScaleBias);
+		void _setFog( FogMode mode = FOG_NONE, const ColourValue& colour = ColourValue::White, Real expDensity = 1.0, Real linearStart = 0.0, Real linearEnd = 1.0 );
+		void _convertProjectionMatrix(const Matrix4& matrix,
+            Matrix4& dest, bool forGpuProgram = false);
+		void _makeProjectionMatrix(const Radian& fovy, Real aspect, Real nearPlane, Real farPlane, 
+            Matrix4& dest, bool forGpuProgram = false);
+		void _makeProjectionMatrix(Real left, Real right, Real bottom, Real top, Real nearPlane, 
+            Real farPlane, Matrix4& dest, bool forGpuProgram = false);
+		void _makeOrthoMatrix(const Radian& fovy, Real aspect, Real nearPlane, Real farPlane, 
+            Matrix4& dest, bool forGpuProgram = false);
+        void _applyObliqueDepthProjection(Matrix4& matrix, const Plane& plane, 
+            bool forGpuProgram);
+		void _setPolygonMode(PolygonMode level);
+        void _setTextureUnitFiltering(size_t unit, FilterType ftype, FilterOptions filter);
+		void _setTextureLayerAnisotropy(size_t unit, unsigned int maxAnisotropy);
+		void setVertexDeclaration(VertexDeclaration* decl);
+		void setVertexBufferBinding(VertexBufferBinding* binding);
+        void _render(const RenderOperation& op);
+        /** See
+          RenderSystem
+         */
+        void bindGpuProgram(GpuProgram* prg);
+        /** See
+          RenderSystem
+         */
+        void unbindGpuProgram(GpuProgramType gptype);
+        /** See
+          RenderSystem
+         */
+        void bindGpuProgramParameters(GpuProgramType gptype, GpuProgramParametersSharedPtr params);
+        /** See
+          RenderSystem
+         */
+        void bindGpuProgramPassIterationParameters(GpuProgramType gptype);
+        /** See
+          RenderSystem
+         */
+        void setClipPlanes(const PlaneList& clipPlanes);
+
+        void setScissorTest(bool enabled, size_t left = 0, size_t top = 0, size_t right = 800, size_t bottom = 600);
+        void clearFrameBuffer(unsigned int buffers, 
+            const ColourValue& colour = ColourValue::Black, 
+            Real depth = 1.0f, unsigned short stencil = 0);
+		void setClipPlane (ushort index, Real A, Real B, Real C, Real D);
+		void enableClipPlane (ushort index, bool enable);
+        HardwareOcclusionQuery* createHardwareOcclusionQuery(void);
+        Real getHorizontalTexelOffset(void);
+        Real getVerticalTexelOffset(void);
+        Real getMinimumDepthInputValue(void);
+        Real getMaximumDepthInputValue(void);
+		void registerThread();
+		void unregisterThread();
+		void preExtraThreadsStarted();
+		void postExtraThreadsStarted();
+
+		/** D3D specific method to restore a lost device. */
+		void restoreLostDevice(void);
+		/** D3D specific method to return whether the device has been lost. */
+		bool isDeviceLost(void);
+		/** Notify that a device has been lost */
+		void _notifyDeviceLost(void);
+
+		/** Check which depthStencil formats can be used with a certain pixel format,
+			and return the best suited.
+		*/
+		D3DFORMAT _getDepthStencilFormatFor(D3DFORMAT fmt);
+
+		/** Get a depth stencil surface that is compatible with an internal pixel format and
+			multisample type.
+			@returns A directx surface, or 0 if there is no compatible depthstencil possible.
+		*/
+		IDirect3DSurface9* _getDepthStencilFor(D3DFORMAT fmt, D3DMULTISAMPLE_TYPE multisample, size_t width, size_t height);
+
+		/** Clear all cached depth stencil surfaces
+		*/
+		void _cleanupDepthStencils();
+
+        /** Check whether or not filtering is supported for the precise texture format requested
+        with the given usage options.
+        */
+        bool _checkTextureFilteringSupported(TextureType ttype, PixelFormat format, int usage);
+
+	};
+}
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9RenderWindow.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9RenderWindow.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9RenderWindow.h	(revision 5)
@@ -0,0 +1,125 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9RENDERWINDOW_H__
+#define __D3D9RENDERWINDOW_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreRenderWindow.h"
+#include "OgreD3D9Driver.h"
+
+namespace Ogre 
+{
+	class D3D9RenderWindow : public RenderWindow
+	{
+	public:
+		/** Constructor.
+		@param instance The application instance
+		@param driver The root driver
+		@param deviceIfSwapChain The existing D3D device to create an additional swap chain from, if this is not
+			the first window.
+		*/
+		D3D9RenderWindow(HINSTANCE instance, D3D9Driver *driver, LPDIRECT3DDEVICE9 deviceIfSwapChain = 0);
+		~D3D9RenderWindow();
+		void create(const String& name, unsigned int width, unsigned int height,
+	            bool fullScreen, const NameValuePairList *miscParams);
+		void setFullscreen(bool fullScreen, unsigned int width, unsigned int height);
+		void destroy(void);
+		bool isVisible() const;
+		bool isClosed() const { return mClosed; }
+		void reposition(int left, int top);
+		void resize(unsigned int width, unsigned int height);
+		void swapBuffers( bool waitForVSync = true );
+		HWND getWindowHandle() const { return mHWnd; }
+
+		D3D9Driver* getDirectD3DDriver() { return mDriver; }
+		// changed to access driver member
+		LPDIRECT3DDEVICE9 getD3DDevice() { return mDriver->getD3DDevice(); }
+
+		void getCustomAttribute( const String& name, void* pData );
+		/** Overridden - see RenderTarget.
+		*/
+		void writeContentsToFile(const String& filename);
+		bool requiresTextureFlipping() const { return false; }
+
+		// Method for dealing with resize / move & 3d library
+		void windowMovedOrResized();
+
+		/// Get the presentation parameters used with this window
+		D3DPRESENT_PARAMETERS* getPresentationParameters(void) 
+		{ return &md3dpp; }
+
+		/// @copydoc RenderTarget::update
+		void update(bool swap);
+		
+		/** Create (or recreate) the D3D device or SwapChain for this window.
+		*/
+		void createD3DResources();
+	
+		/** Destroy the D3D device or SwapChain for this window.
+		*/
+		void destroyD3DResources();
+	
+		/// Accessor for render surface
+		LPDIRECT3DSURFACE9 getRenderSurface() { return mpRenderSurface; }
+
+		/// Are we in the middle of switching between fullscreen and windowed
+		bool _getSwitchingFullscreen() const { return mSwitchingFullscreen; }
+		/// Indicate that fullscreen / windowed switching has finished
+		void _finishSwitchingFullscreen();
+	protected:
+		HINSTANCE mInstance;			// Process instance
+		D3D9Driver *mDriver;			// D3D9 driver
+		HWND	mHWnd;					// Win32 Window handle
+		bool	mIsExternal;			// window not created by Ogre
+		bool	mSizing;
+		bool	mClosed;
+		bool	mIsSwapChain;			// Is this a secondary window?
+		bool	mSwitchingFullscreen;	// Are we switching from fullscreen to windowed or vice versa
+
+		// -------------------------------------------------------
+		// DirectX-specific
+		// -------------------------------------------------------
+
+		// Pointer to swap chain, only valid if mIsSwapChain
+		LPDIRECT3DSWAPCHAIN9 mpSwapChain;
+		D3DPRESENT_PARAMETERS md3dpp;
+		LPDIRECT3DSURFACE9 mpRenderSurface;
+		LPDIRECT3DSURFACE9 mpRenderZBuffer;
+		D3DMULTISAMPLE_TYPE mFSAAType;
+		DWORD mFSAAQuality;
+		UINT mDisplayFrequency;
+		bool mVSync;
+		bool mUseNVPerfHUD;
+
+		// just check if the multisampling requested is supported by the device
+		bool _checkMultiSampleQuality(D3DMULTISAMPLE_TYPE type, DWORD *outQuality, D3DFORMAT format, UINT adapterNum, D3DDEVTYPE deviceType, BOOL fullScreen);
+
+	};
+}
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9Texture.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9Texture.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9Texture.h	(revision 5)
@@ -0,0 +1,289 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D8TEXTURE_H__
+#define __D3D8TEXTURE_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreTexture.h"
+#include "OgreRenderTexture.h"
+#include "OgreImage.h"
+#include "OgreException.h"
+#include "OgreD3D9HardwarePixelBuffer.h"
+
+#include "OgreNoMemoryMacros.h"
+#include <d3d9.h>
+#include <d3dx9.h>
+#include <dxerr9.h>
+#include "OgreMemoryMacros.h"
+
+namespace Ogre {
+	class D3D9Texture : public Texture
+	{
+	protected:
+		/// D3DDevice pointer
+		IDirect3DDevice9		*mpDev;		
+		/// D3D9 pointer
+		IDirect3D9				*mpD3D;
+		/// 1D/2D normal texture pointer
+		IDirect3DTexture9		*mpNormTex;	
+		/// cubic texture pointer
+		IDirect3DCubeTexture9	*mpCubeTex;	
+        /// Volume texture
+        IDirect3DVolumeTexture9 *mpVolumeTex;
+        /// actual texture pointer
+		IDirect3DBaseTexture9	*mpTex;		
+
+		/// cube texture individual face names
+		String							mCubeFaceNames[6];
+		/// device creation parameters
+		D3DDEVICE_CREATION_PARAMETERS	mDevCreParams;
+		/// back buffer pixel format
+		D3DFORMAT						mBBPixelFormat;
+		/// The memory pool being used
+		D3DPOOL							mD3DPool;
+		/// device capabilities pointer
+		D3DCAPS9						mDevCaps;
+		// Dynamic textures?
+		bool                            mDynamicTextures;
+		/// Vector of pointers to subsurfaces
+		typedef std::vector<HardwarePixelBufferSharedPtr> SurfaceList;
+		SurfaceList						mSurfaceList;
+	
+        /// Initialise the device and get formats
+        void _initDevice(void);
+		/// internal method, load a cube texture
+		void _loadCubeTex();
+		/// internal method, load a normal texture
+		void _loadNormTex();
+		/// internal method, load a volume texture
+		void _loadVolumeTex();
+
+		/// internal method, create a blank normal 1D/2D texture
+		void _createNormTex();
+		/// internal method, create a blank cube texture
+		void _createCubeTex();
+		/// internal method, create a blank cube texture
+		void _createVolumeTex();
+
+		/// internal method, return a D3D pixel format for texture creation
+		D3DFORMAT _chooseD3DFormat();
+
+		/// @copydoc Texture::createInternalResourcesImpl
+		void createInternalResourcesImpl(void);
+		/// free internal resources
+		void freeInternalResourcesImpl(void);
+		/// internal method, set Texture class source image protected attributes
+		void _setSrcAttributes(unsigned long width, unsigned long height, unsigned long depth, PixelFormat format);
+		/// internal method, set Texture class final texture protected attributes
+		void _setFinalAttributes(unsigned long width, unsigned long height, unsigned long depth, PixelFormat format);
+		/// internal method, return the best by hardware supported filter method
+		D3DTEXTUREFILTERTYPE _getBestFilterMethod();
+		/// internal method, return true if the device/texture combination can use dynamic textures
+		bool _canUseDynamicTextures(DWORD srcUsage, D3DRESOURCETYPE srcType, D3DFORMAT srcFormat);
+		/// internal method, return true if the device/texture combination can auto gen. mip maps
+		bool _canAutoGenMipmaps(DWORD srcUsage, D3DRESOURCETYPE srcType, D3DFORMAT srcFormat);
+		
+		/// internal method, the cube map face name for the spec. face index
+		String _getCubeFaceName(unsigned char face) const
+		{ assert(face < 6); return mCubeFaceNames[face]; }
+		
+		/// internal method, create D3D9HardwarePixelBuffers for every face and
+		/// mipmap level. This method must be called after the D3D texture object was created
+		void _createSurfaceList(void);
+
+        /// overriden from Resource
+        void loadImpl();
+	public:
+		/// constructor 
+        D3D9Texture(ResourceManager* creator, const String& name, ResourceHandle handle,
+            const String& group, bool isManual, ManualResourceLoader* loader, 
+            IDirect3DDevice9 *pD3DDevice);
+		/// destructor
+		~D3D9Texture();
+
+		/// overriden from Texture
+		void copyToTexture( TexturePtr& target );
+
+
+		/// @copydoc Texture::getBuffer
+		HardwarePixelBufferSharedPtr getBuffer(size_t face, size_t mipmap);
+		
+		/// retrieves a pointer to the actual texture
+		IDirect3DBaseTexture9 *getTexture() 
+		{ assert(mpTex); return mpTex; }
+		/// retrieves a pointer to the normal 1D/2D texture
+		IDirect3DTexture9 *getNormTexture()
+		{ assert(mpNormTex); return mpNormTex; }
+		/// retrieves a pointer to the cube texture
+		IDirect3DCubeTexture9 *getCubeTexture()
+		{ assert(mpCubeTex); return mpCubeTex; }
+		
+		
+
+		/// For dealing with lost devices - release the resource if in the default pool (and return true)
+		bool releaseIfDefaultPool(void);
+		/// For dealing with lost devices - recreate the resource if in the default pool (and return true)
+		bool recreateIfDefaultPool(LPDIRECT3DDEVICE9 pDev);
+
+    };
+
+    /** Specialisation of SharedPtr to allow SharedPtr to be assigned to D3D9TexturePtr 
+    @note Has to be a subclass since we need operator=.
+    We could templatise this instead of repeating per Resource subclass, 
+    except to do so requires a form VC6 does not support i.e.
+    ResourceSubclassPtr<T> : public SharedPtr<T>
+    */
+    class D3D9TexturePtr : public SharedPtr<D3D9Texture> 
+    {
+    public:
+        D3D9TexturePtr() : SharedPtr<D3D9Texture>() {}
+        explicit D3D9TexturePtr(D3D9Texture* rep) : SharedPtr<D3D9Texture>(rep) {}
+        D3D9TexturePtr(const D3D9TexturePtr& r) : SharedPtr<D3D9Texture>(r) {} 
+        D3D9TexturePtr(const ResourcePtr& r) : SharedPtr<D3D9Texture>()
+        {
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+                pRep = static_cast<D3D9Texture*>(r.getPointer());
+                pUseCount = r.useCountPointer();
+                if (pUseCount)
+                {
+                    ++(*pUseCount);
+                }
+            }
+        }
+		D3D9TexturePtr(const TexturePtr& r) : SharedPtr<D3D9Texture>()
+		{
+			*this = r;
+		}
+
+        /// Operator used to convert a ResourcePtr to a D3D9TexturePtr
+        D3D9TexturePtr& operator=(const ResourcePtr& r)
+        {
+            if (pRep == static_cast<D3D9Texture*>(r.getPointer()))
+                return *this;
+            release();
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+                pRep = static_cast<D3D9Texture*>(r.getPointer());
+                pUseCount = r.useCountPointer();
+                if (pUseCount)
+                {
+                    ++(*pUseCount);
+                }
+            }
+			else
+			{
+				// RHS must be a null pointer
+				assert(r.isNull() && "RHS must be null if it has no mutex!");
+				setNull();
+			}
+            return *this;
+        }
+        /// Operator used to convert a TexturePtr to a D3D9TexturePtr
+        D3D9TexturePtr& operator=(const TexturePtr& r)
+        {
+            if (pRep == static_cast<D3D9Texture*>(r.getPointer()))
+                return *this;
+            release();
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+                pRep = static_cast<D3D9Texture*>(r.getPointer());
+                pUseCount = r.useCountPointer();
+                if (pUseCount)
+                {
+                    ++(*pUseCount);
+                }
+            }
+			else
+			{
+				// RHS must be a null pointer
+				assert(r.isNull() && "RHS must be null if it has no mutex!");
+				setNull();
+			}
+            return *this;
+        }
+    };
+
+    /// RenderTexture implementation for D3D9
+    class D3D9RenderTexture : public RenderTexture
+    {
+    public:
+		D3D9RenderTexture(const String &name, D3D9HardwarePixelBuffer *buffer):
+			RenderTexture(buffer, 0)
+		{ 
+			mName = name;
+		}
+        ~D3D9RenderTexture() {}
+
+        void rebind(D3D9HardwarePixelBuffer *buffer)
+        {
+            mBuffer = buffer;
+            mWidth = mBuffer->getWidth();
+            mHeight = mBuffer->getHeight();
+            mColourDepth = Ogre::PixelUtil::getNumElemBits(mBuffer->getFormat());
+        }
+
+        virtual void update(void);
+
+		virtual void getCustomAttribute( const String& name, void *pData )
+        {
+			if(name == "DDBACKBUFFER")
+            {
+                IDirect3DSurface9 ** pSurf = (IDirect3DSurface9 **)pData;
+				*pSurf = static_cast<D3D9HardwarePixelBuffer*>(mBuffer)->getSurface();
+				return;
+            }
+            else if(name == "HWND")
+            {
+                HWND *pHwnd = (HWND*)pData;
+                *pHwnd = NULL;
+                return;
+            }
+			else if(name == "BUFFER")
+			{
+				*static_cast<HardwarePixelBuffer**>(pData) = mBuffer;
+				return;
+			}
+		}
+
+		bool requiresTextureFlipping() const { return false; }
+	};
+
+}
+
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9TextureManager.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9TextureManager.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9TextureManager.h	(revision 5)
@@ -0,0 +1,74 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9TEXTUREMANAGER_H__
+#define __D3D9TEXTUREMANAGER_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreTextureManager.h"
+
+#include "OgreNoMemoryMacros.h"
+#include <d3d9.h>
+#include "OgreMemoryMacros.h"
+
+namespace Ogre 
+{
+	class D3D9TextureManager : public TextureManager
+	{
+	protected:
+		LPDIRECT3DDEVICE9 mpD3DDevice;
+        /// @copydoc ResourceManager::createImpl
+        Resource* createImpl(const String& name, ResourceHandle handle, 
+            const String& group, bool isManual, ManualResourceLoader* loader, 
+            const NameValuePairList* createParams);
+
+	public:
+		D3D9TextureManager( LPDIRECT3DDEVICE9 pD3DDevice );
+		~D3D9TextureManager();
+
+		/** Release all textures in the default memory pool. 
+		@remarks
+			Method for dealing with lost devices.
+		*/
+		void releaseDefaultPoolResources(void);
+		/** Recreate all textures in the default memory pool. 
+		@remarks
+			Method for dealing with lost devices.
+		*/
+		void recreateDefaultPoolResources(void);
+
+		/// @copydoc TextureManager::getNativeFormat
+		PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage);
+
+        /// @copydoc TextureManager::isHardwareFilteringSupported
+        bool isHardwareFilteringSupported(TextureType ttype, PixelFormat format, int usage,
+            bool preciseFormatOnly = false);
+
+	};
+}
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9VertexDeclaration.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9VertexDeclaration.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9VertexDeclaration.h	(revision 5)
@@ -0,0 +1,79 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9VERTEXDECLARATION_H__
+#define __D3D9VERTEXDECLARATION_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreHardwareVertexBuffer.h"
+
+namespace Ogre { 
+
+    /** Specialisation of VertexDeclaration for D3D9 */
+    class D3D9VertexDeclaration : public VertexDeclaration
+    {
+    protected:
+        LPDIRECT3DDEVICE9 mlpD3DDevice;
+        LPDIRECT3DVERTEXDECLARATION9 mlpD3DDecl;
+        bool mNeedsRebuild;
+    public:
+        D3D9VertexDeclaration(LPDIRECT3DDEVICE9 device);
+        ~D3D9VertexDeclaration();
+        
+        /** See VertexDeclaration */
+        const VertexElement& addElement(unsigned short source, size_t offset, VertexElementType theType,
+            VertexElementSemantic semantic, unsigned short index = 0);
+
+        /** See VertexDeclaration */
+        const VertexElement& insertElement(unsigned short atPosition,
+            unsigned short source, size_t offset, VertexElementType theType,
+            VertexElementSemantic semantic, unsigned short index = 0);
+
+        /** See VertexDeclaration */
+        void removeElement(unsigned short elem_index);
+		
+		/** See VertexDeclaration */
+		void removeElement(VertexElementSemantic semantic, unsigned short index = 0);
+
+		/** See VertexDeclaration */
+		void removeAllElements(void);
+
+
+        /** See VertexDeclaration */
+        void modifyElement(unsigned short elem_index, unsigned short source, size_t offset, VertexElementType theType,
+            VertexElementSemantic semantic, unsigned short index = 0);
+
+        /** Gets the D3D9-specific vertex declaration. */
+        LPDIRECT3DVERTEXDECLARATION9 getD3DVertexDeclaration(void);
+
+
+    };
+
+}
+
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9VideoMode.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9VideoMode.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9VideoMode.h	(revision 5)
@@ -0,0 +1,68 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9VIDEOMODE_H__
+#define __D3D9VIDEOMODE_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreString.h"
+
+#include "OgreNoMemoryMacros.h"
+#include <d3d9.h>
+#include "OgreMemoryMacros.h"
+
+namespace Ogre 
+{
+	static unsigned int modeCount = 0;
+
+	class D3D9VideoMode
+	{
+	private:
+		D3DDISPLAYMODE mDisplayMode;
+		unsigned int modeNumber;
+
+	public:
+		D3D9VideoMode() { modeNumber = ++modeCount; ZeroMemory( &mDisplayMode, sizeof(D3DDISPLAYMODE) ); }
+		D3D9VideoMode( const D3D9VideoMode &ob ) { modeNumber = ++modeCount; mDisplayMode = ob.mDisplayMode; }
+		D3D9VideoMode( D3DDISPLAYMODE d3ddm ) { modeNumber = ++modeCount; mDisplayMode = d3ddm; }
+		~D3D9VideoMode()
+		{
+			modeCount--;
+		}
+
+		unsigned int getWidth() const { return mDisplayMode.Width; }
+		unsigned int getHeight() const { return mDisplayMode.Height; }
+		D3DFORMAT getFormat() const { return mDisplayMode.Format; }
+		unsigned int getRefreshRate() const { return mDisplayMode.RefreshRate; }
+		unsigned int getColourDepth() const;
+		D3DDISPLAYMODE getDisplayMode() const { return mDisplayMode; }
+		void increaseRefreshRate(unsigned int rr) { mDisplayMode.RefreshRate = rr; } 
+		String getDescription() const;
+	};
+}
+#endif
Index: /RenderSystems/Direct3D9/include/OgreD3D9VideoModeList.h
===================================================================
--- /RenderSystems/Direct3D9/include/OgreD3D9VideoModeList.h	(revision 5)
+++ /RenderSystems/Direct3D9/include/OgreD3D9VideoModeList.h	(revision 5)
@@ -0,0 +1,56 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __D3D9VIDEOMODELIST_H__
+#define __D3D9VIDEOMODELIST_H__
+
+#include "OgreD3D9Prerequisites.h"
+#include "OgreD3D9Driver.h"
+#include "OgreD3D9VideoMode.h"
+
+namespace Ogre 
+{
+	class D3D9VideoModeList
+	{
+	private:
+		D3D9Driver* mpDriver;
+		std::vector<D3D9VideoMode> mModeList;
+
+	public:
+		D3D9VideoModeList( D3D9Driver* pDriver );
+		~D3D9VideoModeList();
+
+		BOOL enumerate();
+
+		D3D9VideoMode* item( size_t index );
+		size_t count();
+
+		D3D9VideoMode* item( const String &name );
+	};
+}
+#endif
Index: /RenderSystems/Direct3D9/scripts/RenderSystem_Direct3D9.cbp
===================================================================
--- /RenderSystems/Direct3D9/scripts/RenderSystem_Direct3D9.cbp	(revision 5)
+++ /RenderSystems/Direct3D9/scripts/RenderSystem_Direct3D9.cbp	(revision 5)
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="RenderSystem_Direct3D9" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\lib\RenderSystem_Direct3D9_d.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+					<Add option="-DDEBUG_SAVE_TEXTURE" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="gdi32" />
+					<Add library="d3d9" />
+					<Add library="d3dx9d_30" />
+					<Add library="dxerr9" />
+					<Add library="dxguid" />
+					<Add directory="..\..\..\Dependencies\lib\Debug" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\lib\RenderSystem_Direct3D9.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="gdi32" />
+					<Add library="d3d9" />
+					<Add library="d3dx9_30" />
+					<Add library="dxerr9" />
+					<Add library="dxguid" />
+					<Add directory="..\..\..\Dependencies\lib\Release" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add option="-D_USRDLL" />
+			<Add option="-DOGRED3DENGINEDLL_EXPORTS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\OgreD3D9Driver.h" />
+		<Unit filename="..\include\OgreD3D9DriverList.h" />
+		<Unit filename="..\include\OgreD3D9GpuProgram.h" />
+		<Unit filename="..\include\OgreD3D9GpuProgramManager.h" />
+		<Unit filename="..\include\OgreD3D9HLSLProgram.h" />
+		<Unit filename="..\include\OgreD3D9HLSLProgramFactory.h" />
+		<Unit filename="..\include\OgreD3D9HardwareBufferManager.h" />
+		<Unit filename="..\include\OgreD3D9HardwareIndexBuffer.h" />
+		<Unit filename="..\include\OgreD3D9HardwareOcclusionQuery.h" />
+		<Unit filename="..\include\OgreD3D9HardwarePixelBuffer.h" />
+		<Unit filename="..\include\OgreD3D9HardwareVertexBuffer.h" />
+		<Unit filename="..\include\OgreD3D9Mappings.h" />
+		<Unit filename="..\include\OgreD3D9MultiRenderTarget.h" />
+		<Unit filename="..\include\OgreD3D9Plugin.h" />
+		<Unit filename="..\include\OgreD3D9Prerequisites.h" />
+		<Unit filename="..\include\OgreD3D9RenderSystem.h" />
+		<Unit filename="..\include\OgreD3D9RenderWindow.h" />
+		<Unit filename="..\include\OgreD3D9Texture.h" />
+		<Unit filename="..\include\OgreD3D9TextureManager.h" />
+		<Unit filename="..\include\OgreD3D9VertexDeclaration.h" />
+		<Unit filename="..\include\OgreD3D9VideoMode.h" />
+		<Unit filename="..\include\OgreD3D9VideoModeList.h" />
+		<Unit filename="..\src\OgreD3D9Driver.cpp" />
+		<Unit filename="..\src\OgreD3D9DriverList.cpp" />
+		<Unit filename="..\src\OgreD3D9EngineDll.cpp" />
+		<Unit filename="..\src\OgreD3D9GpuProgram.cpp" />
+		<Unit filename="..\src\OgreD3D9GpuProgramManager.cpp" />
+		<Unit filename="..\src\OgreD3D9HLSLProgram.cpp" />
+		<Unit filename="..\src\OgreD3D9HLSLProgramFactory.cpp" />
+		<Unit filename="..\src\OgreD3D9HardwareBufferManager.cpp" />
+		<Unit filename="..\src\OgreD3D9HardwareIndexBuffer.cpp" />
+		<Unit filename="..\src\OgreD3D9HardwareOcclusionQuery.cpp" />
+		<Unit filename="..\src\OgreD3D9HardwarePixelBuffer.cpp" />
+		<Unit filename="..\src\OgreD3D9HardwareVertexBuffer.cpp" />
+		<Unit filename="..\src\OgreD3D9Mappings.cpp" />
+		<Unit filename="..\src\OgreD3D9MultiRenderTarget.cpp" />
+		<Unit filename="..\src\OgreD3D9Plugin.cpp" />
+		<Unit filename="..\src\OgreD3D9RenderSystem.cpp" />
+		<Unit filename="..\src\OgreD3D9RenderWindow.cpp" />
+		<Unit filename="..\src\OgreD3D9Texture.cpp" />
+		<Unit filename="..\src\OgreD3D9TextureManager.cpp" />
+		<Unit filename="..\src\OgreD3D9VertexDeclaration.cpp" />
+		<Unit filename="..\src\OgreD3D9VideoMode.cpp" />
+		<Unit filename="..\src\OgreD3D9VideoModeList.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /RenderSystems/Direct3D9/scripts/RenderSystem_Direct3D9.vcproj
===================================================================
--- /RenderSystems/Direct3D9/scripts/RenderSystem_Direct3D9.vcproj	(revision 5)
+++ /RenderSystems/Direct3D9/scripts/RenderSystem_Direct3D9.vcproj	(revision 5)
@@ -0,0 +1,392 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="RenderSystem_Direct3D9"
+	ProjectGUID="{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRED3DENGINEDLL_EXPORTS;DEBUG_SAVE_TEXTURE;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="2"
+				BrowseInformation="1"
+				BrowseInformationFile="$(IntDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain_d.lib d3d9.lib d3dx9.lib dxerr9.lib dxguid.lib"
+				OutputFile="$(OutDir)/$(ProjectName)_d.dll"
+				Version="0.99"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName)_d.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRED3DENGINEDLL_EXPORTS"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain.lib d3d9.lib d3dx9.lib dxerr9.lib dxguid.lib"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRED3DENGINEDLL_EXPORTS;OGRE_STATIC_LIB;DEBUG_SAVE_TEXTURE"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="2"
+				BrowseInformation="1"
+				BrowseInformationFile="$(IntDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)/$(ProjectName)Static_d.lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRED3DENGINEDLL_EXPORTS;OGRE_STATIC_LIB"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)/$(ProjectName)Static.lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\OgreD3D9Driver.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9DriverList.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9EngineDll.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9GpuProgram.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9GpuProgramManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9HardwareBufferManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9HardwareIndexBuffer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9HardwareOcclusionQuery.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9HardwarePixelBuffer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9HardwareVertexBuffer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9HLSLProgram.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9HLSLProgramFactory.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9Mappings.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9MultiRenderTarget.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9Plugin.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9RenderSystem.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9RenderWindow.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9Texture.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9TextureManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9VertexDeclaration.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9VideoMode.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9VideoModeList.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\OgreD3D9Driver.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9DriverList.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9GpuProgram.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9GpuProgramManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9HardwareBufferManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9HardwareIndexBuffer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9HardwareOcclusionQuery.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9HardwarePixelBuffer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9HardwareVertexBuffer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9HLSLProgram.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9HLSLProgramFactory.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9Mappings.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9MultiRenderTarget.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9Plugin.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9Prerequisites.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9RenderSystem.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9RenderWindow.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9Texture.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9TextureManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9VertexDeclaration.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9VideoMode.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9VideoModeList.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /RenderSystems/Direct3D9/scripts/RenderSystem_Direct3D9_stlp.cbp
===================================================================
--- /RenderSystems/Direct3D9/scripts/RenderSystem_Direct3D9_stlp.cbp	(revision 5)
+++ /RenderSystems/Direct3D9/scripts/RenderSystem_Direct3D9_stlp.cbp	(revision 5)
@@ -0,0 +1,352 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="RenderSystem_Direct3D9" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\lib\RenderSystem_Direct3D9_d.dll" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+					<Add option="-DDEBUG_SAVE_TEXTURE" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="gdi32" />
+					<Add library="d3d9" />
+					<Add library="d3dx9d_30" />
+					<Add library="dxerr9" />
+					<Add library="dxguid" />
+					<Add library="stlportstlg.5.1" />
+					<Add directory="..\..\..\Dependencies\lib\Debug" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\lib\RenderSystem_Direct3D9.dll" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="gdi32" />
+					<Add library="d3d9" />
+					<Add library="dxerr9" />
+					<Add library="dxguid" />
+					<Add library="d3dx9_30" />
+					<Add library="stlport.5.1" />
+					<Add directory="..\..\..\Dependencies\lib\Release" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add option="-D_USRDLL" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\OgreD3D9Driver.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9DriverList.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9GpuProgram.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9GpuProgramManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9HLSLProgram.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9HLSLProgramFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9HardwareBufferManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9HardwareIndexBuffer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9HardwareOcclusionQuery.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9HardwarePixelBuffer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9HardwareVertexBuffer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9Mappings.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9Plugin.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9MultiRenderTarget.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9Prerequisites.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9RenderSystem.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9RenderWindow.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9Texture.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9TextureManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9VertexDeclaration.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9VideoMode.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreD3D9VideoModeList.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9Driver.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9DriverList.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9EngineDll.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9GpuProgram.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9GpuProgramManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9HLSLProgram.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9HLSLProgramFactory.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9HardwareBufferManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9HardwareIndexBuffer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9HardwareOcclusionQuery.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9HardwarePixelBuffer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9HardwareVertexBuffer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9Mappings.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9Plugin.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9MultiRenderTarget.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9RenderSystem.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9RenderWindow.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9Texture.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9TextureManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9VertexDeclaration.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9VideoMode.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreD3D9VideoModeList.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /RenderSystems/Direct3D9/scripts/RenderSystem_Direct3D9_vc8.vcproj
===================================================================
--- /RenderSystems/Direct3D9/scripts/RenderSystem_Direct3D9_vc8.vcproj	(revision 5)
+++ /RenderSystems/Direct3D9/scripts/RenderSystem_Direct3D9_vc8.vcproj	(revision 5)
@@ -0,0 +1,550 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="RenderSystem_Direct3D9"
+	ProjectGUID="{0F172B9C-E5D5-4EB1-BFDB-93D787A37461}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRED3DENGINEDLL_EXPORTS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				BrowseInformation="0"
+				BrowseInformationFile="$(IntDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain_d.lib d3d9.lib d3dx9.lib dxerr9.lib dxguid.lib"
+				OutputFile="$(OutDir)/RenderSystem_Direct3D9_d.dll"
+				Version=""
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName)_d.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/RenderSystem_Direct3D9_d.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				EnableFiberSafeOptimizations="true"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRED3DENGINEDLL_EXPORTS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain.lib d3d9.lib d3dx9.lib dxerr9.lib dxguid.lib"
+				OutputFile="$(OutDir)/RenderSystem_Direct3D9.dll"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/RenderSystem_Direct3D9.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				EnableFiberSafeOptimizations="true"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_STATIC_LIB"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				AdditionalDependencies="d3d9.lib d3dx9.lib dxerr9.lib dxguid.lib"
+				OutputFile="$(OutDir)\$(ProjectName)Static.lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DEBUG_SAVE_TEXTURE;OGRE_STATIC_LIB"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				BrowseInformation="0"
+				BrowseInformationFile="$(IntDir)\"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				AdditionalDependencies="d3d9.lib d3dx9.lib dxerr9.lib dxguid.lib"
+				OutputFile="$(OutDir)\$(ProjectName)Static_d.lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine=""
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\OgreD3D9Driver.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9DriverList.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9EngineDll.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9GpuProgram.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9GpuProgramManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9HardwareBufferManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9HardwareIndexBuffer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9HardwareOcclusionQuery.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9HardwarePixelBuffer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9HardwareVertexBuffer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9HLSLProgram.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9HLSLProgramFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9Mappings.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9MultiRenderTarget.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9Plugin.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9RenderSystem.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9RenderWindow.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9Texture.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9TextureManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9VertexDeclaration.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9VideoMode.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreD3D9VideoModeList.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\OgreD3D9Driver.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9DriverList.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9GpuProgram.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9GpuProgramManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9HardwareBufferManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9HardwareIndexBuffer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9HardwareOcclusionQuery.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9HardwarePixelBuffer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9HardwareVertexBuffer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9HLSLProgram.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9HLSLProgramFactory.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9Mappings.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9MultiRenderTarget.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9Plugin.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9Prerequisites.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9RenderSystem.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9RenderWindow.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9Texture.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9TextureManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9VertexDeclaration.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9VideoMode.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreD3D9VideoModeList.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /RenderSystems/Direct3D9/src/Makefile.am
===================================================================
--- /RenderSystems/Direct3D9/src/Makefile.am	(revision 5)
+++ /RenderSystems/Direct3D9/src/Makefile.am	(revision 5)
@@ -0,0 +1,33 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/RenderSystems/Direct3D9/include \
+           -I$(top_srcdir)/OgreMain/include \
+           -I$(top_srcdir)/PlatformManagers/$(OGRE_PLATFORM)/include
+
+
+pkglib_LTLIBRARIES = RenderSystem_Direct3D9.la
+
+RenderSystem_Direct3D9_la_SOURCES = \
+OgreD3D9Driver.cpp \
+OgreD3D9DriverList.cpp \
+OgreD3D9EngineDll.cpp \
+OgreD3D9GpuProgram.cpp \
+OgreD3D9GpuProgramManager.cpp \
+OgreD3D9HLSLProgram.cpp \
+OgreD3D9HLSLProgramFactory.cpp \
+OgreD3D9HardwareBufferManager.cpp \
+OgreD3D9HardwareIndexBuffer.cpp \
+OgreD3D9HardwareOcclusionQuery.cpp \
+OgreD3D9HardwareVertexBuffer.cpp \
+OgreD3D9Mappings.cpp \
+OgreD3D9Plugin.cpp \
+OgreD3D9RenderSystem.cpp \
+OgreD3D9RenderWindow.cpp \
+OgreD3D9Texture.cpp \
+OgreD3D9TextureManager.cpp \
+OgreD3D9VertexDeclaration.cpp \
+OgreD3D9VideoMode.cpp \
+OgreD3D9VideoModeList.cpp \
+OgreD3D9HardwarePixelBuffer.cpp
+
+RenderSystem_Direct3D9_la_LDFLAGS = -module $(PLUGIN_FLAGS) -L$(top_builddir)/OgreMain/src
+RenderSystem_Direct3D9_la_LIBADD =  -lOgreMain -ld3d9 -ld3dx9d -lDxErr9 -lgdi32 -ldxguid
+
Index: /RenderSystems/Direct3D9/src/Makefile.in
===================================================================
--- /RenderSystems/Direct3D9/src/Makefile.in	(revision 5)
+++ /RenderSystems/Direct3D9/src/Makefile.in	(revision 5)
@@ -0,0 +1,587 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = RenderSystems/Direct3D9/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+pkglibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+RenderSystem_Direct3D9_la_DEPENDENCIES =
+am_RenderSystem_Direct3D9_la_OBJECTS = OgreD3D9Driver.lo \
+	OgreD3D9DriverList.lo OgreD3D9EngineDll.lo \
+	OgreD3D9GpuProgram.lo OgreD3D9GpuProgramManager.lo \
+	OgreD3D9HLSLProgram.lo OgreD3D9HLSLProgramFactory.lo \
+	OgreD3D9HardwareBufferManager.lo \
+	OgreD3D9HardwareIndexBuffer.lo \
+	OgreD3D9HardwareOcclusionQuery.lo \
+	OgreD3D9HardwareVertexBuffer.lo OgreD3D9Mappings.lo \
+	OgreD3D9Plugin.lo OgreD3D9RenderSystem.lo \
+	OgreD3D9RenderWindow.lo OgreD3D9Texture.lo \
+	OgreD3D9TextureManager.lo OgreD3D9VertexDeclaration.lo \
+	OgreD3D9VideoMode.lo OgreD3D9VideoModeList.lo \
+	OgreD3D9HardwarePixelBuffer.lo
+RenderSystem_Direct3D9_la_OBJECTS =  \
+	$(am_RenderSystem_Direct3D9_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(RenderSystem_Direct3D9_la_SOURCES)
+DIST_SOURCES = $(RenderSystem_Direct3D9_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/RenderSystems/Direct3D9/include \
+           -I$(top_srcdir)/OgreMain/include \
+           -I$(top_srcdir)/PlatformManagers/$(OGRE_PLATFORM)/include
+
+pkglib_LTLIBRARIES = RenderSystem_Direct3D9.la
+RenderSystem_Direct3D9_la_SOURCES = \
+OgreD3D9Driver.cpp \
+OgreD3D9DriverList.cpp \
+OgreD3D9EngineDll.cpp \
+OgreD3D9GpuProgram.cpp \
+OgreD3D9GpuProgramManager.cpp \
+OgreD3D9HLSLProgram.cpp \
+OgreD3D9HLSLProgramFactory.cpp \
+OgreD3D9HardwareBufferManager.cpp \
+OgreD3D9HardwareIndexBuffer.cpp \
+OgreD3D9HardwareOcclusionQuery.cpp \
+OgreD3D9HardwareVertexBuffer.cpp \
+OgreD3D9Mappings.cpp \
+OgreD3D9Plugin.cpp \
+OgreD3D9RenderSystem.cpp \
+OgreD3D9RenderWindow.cpp \
+OgreD3D9Texture.cpp \
+OgreD3D9TextureManager.cpp \
+OgreD3D9VertexDeclaration.cpp \
+OgreD3D9VideoMode.cpp \
+OgreD3D9VideoModeList.cpp \
+OgreD3D9HardwarePixelBuffer.cpp
+
+RenderSystem_Direct3D9_la_LDFLAGS = -module $(PLUGIN_FLAGS) -L$(top_builddir)/OgreMain/src
+RenderSystem_Direct3D9_la_LIBADD = -lOgreMain -ld3d9 -ld3dx9d -lDxErr9 -lgdi32 -ldxguid
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  RenderSystems/Direct3D9/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  RenderSystems/Direct3D9/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)"
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    f=$(am__strip_dir) \
+	    echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	    $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  p=$(am__strip_dir) \
+	  echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \
+	  $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+RenderSystem_Direct3D9.la: $(RenderSystem_Direct3D9_la_OBJECTS) $(RenderSystem_Direct3D9_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(RenderSystem_Direct3D9_la_LDFLAGS) $(RenderSystem_Direct3D9_la_OBJECTS) $(RenderSystem_Direct3D9_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9Driver.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9DriverList.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9EngineDll.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9GpuProgram.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9GpuProgramManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9HLSLProgram.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9HLSLProgramFactory.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9HardwareBufferManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9HardwareIndexBuffer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9HardwareOcclusionQuery.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9HardwarePixelBuffer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9HardwareVertexBuffer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9Mappings.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9Plugin.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9RenderSystem.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9RenderWindow.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9Texture.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9TextureManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9VertexDeclaration.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9VideoMode.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreD3D9VideoModeList.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-pkglibLTLIBRARIES install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-pkglibLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /RenderSystems/Direct3D9/src/OgreD3D9Driver.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9Driver.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9Driver.cpp	(revision 5)
@@ -0,0 +1,98 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9Driver.h"
+#include "OgreD3D9VideoModeList.h"
+#include "OgreD3D9VideoMode.h"
+
+namespace Ogre
+{
+    unsigned int D3D9Driver::driverCount = 0;
+
+	D3D9Driver::D3D9Driver()
+	{
+		tempNo = ++driverCount;
+		mpD3D = NULL;
+		// initialise device member
+		mpD3DDevice = NULL;
+		ZeroMemory( &mAdapterIdentifier, sizeof(mAdapterIdentifier) );
+		ZeroMemory( &mDesktopDisplayMode, sizeof(mDesktopDisplayMode) );
+		mpVideoModeList = NULL;
+	}
+
+	D3D9Driver::D3D9Driver( const D3D9Driver &ob )
+	{
+		tempNo = ++driverCount;
+		mpD3D = ob.mpD3D;
+		// copy device member
+		mpD3DDevice = ob.mpD3DDevice;
+		mAdapterNumber = ob.mAdapterNumber;
+		mAdapterIdentifier = ob.mAdapterIdentifier;
+		mDesktopDisplayMode = ob.mDesktopDisplayMode;
+		mpVideoModeList = NULL;
+	}
+
+	D3D9Driver::D3D9Driver( LPDIRECT3D9 pD3D, unsigned int adapterNumber, const D3DADAPTER_IDENTIFIER9& adapterIdentifier, const D3DDISPLAYMODE& desktopDisplayMode )
+	{
+		tempNo = ++driverCount;
+		mpD3D = pD3D;
+		// initialise device member
+		mpD3DDevice = NULL;
+		mAdapterNumber = adapterNumber;
+		mAdapterIdentifier = adapterIdentifier;
+		mDesktopDisplayMode = desktopDisplayMode;
+		mpVideoModeList = NULL;
+	}
+
+	D3D9Driver::~D3D9Driver()
+	{
+		SAFE_DELETE( mpVideoModeList );
+		driverCount--;
+	}
+
+	String D3D9Driver::DriverName() const
+	{
+		return String(mAdapterIdentifier.Driver);
+	}
+
+	String D3D9Driver::DriverDescription() const
+	{
+        String driverDescription(mAdapterIdentifier.Description);
+        StringUtil::trim(driverDescription);
+
+        return  driverDescription;
+	}
+
+	D3D9VideoModeList* D3D9Driver::getVideoModeList()
+	{
+		if( !mpVideoModeList )
+			mpVideoModeList = new D3D9VideoModeList( this );
+
+		return mpVideoModeList;
+	}
+}
Index: /RenderSystems/Direct3D9/src/OgreD3D9DriverList.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9DriverList.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9DriverList.cpp	(revision 5)
@@ -0,0 +1,89 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9DriverList.h"
+#include "OgreLogManager.h"
+#include "OgreException.h"
+
+namespace Ogre 
+{
+	D3D9DriverList::D3D9DriverList( LPDIRECT3D9 pD3D ) : mpD3D(pD3D)
+	{
+		if( !mpD3D )
+			OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, "Direct3D9 interface pointer is NULL", "D3D9DriverList::D3D9DriverList" );
+		enumerate();
+	}
+
+	D3D9DriverList::~D3D9DriverList(void)
+	{
+		mDriverList.clear();
+	}
+
+	BOOL D3D9DriverList::enumerate()
+	{
+		LogManager::getSingleton().logMessage( "D3D9: Driver Detection Starts" );
+		for( UINT iAdapter=0; iAdapter < mpD3D->GetAdapterCount(); ++iAdapter )
+		{
+			D3DADAPTER_IDENTIFIER9 adapterIdentifier;
+			D3DDISPLAYMODE d3ddm;
+			mpD3D->GetAdapterIdentifier( iAdapter, 0, &adapterIdentifier );
+			mpD3D->GetAdapterDisplayMode( iAdapter, &d3ddm );
+
+			mDriverList.push_back( D3D9Driver( mpD3D, iAdapter, adapterIdentifier, d3ddm ) );
+		}
+
+		LogManager::getSingleton().logMessage( "D3D9: Driver Detection Ends" );
+
+		return TRUE;
+	}
+
+	size_t D3D9DriverList::count() const 
+	{
+		return mDriverList.size();
+	}
+
+	D3D9Driver* D3D9DriverList::item( size_t index )
+	{
+		return &mDriverList.at( index );
+	}
+
+	D3D9Driver* D3D9DriverList::item( const String &name )
+	{
+		std::vector<D3D9Driver>::iterator it = mDriverList.begin();
+		if (it == mDriverList.end())
+			return NULL;
+
+		for (;it != mDriverList.end(); ++it)
+		{
+			if (it->DriverDescription() == name)
+				return &(*it);
+		}
+
+		return NULL;
+	}
+}
Index: /RenderSystems/Direct3D9/src/OgreD3D9EngineDll.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9EngineDll.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9EngineDll.cpp	(revision 5)
@@ -0,0 +1,46 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreRoot.h"
+#include "OgreD3D9Plugin.h"
+namespace Ogre 
+{
+	D3D9Plugin* plugin;
+
+	extern "C" void _OgreD3D9Export dllStartPlugin(void) throw()
+	{
+		plugin = new D3D9Plugin();
+		Root::getSingleton().installPlugin(plugin);
+	}
+
+	extern "C" void _OgreD3D9Export dllStopPlugin(void)
+	{
+		Root::getSingleton().uninstallPlugin(plugin);
+		delete plugin;
+	}
+}
Index: /RenderSystems/Direct3D9/src/OgreD3D9GpuProgram.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9GpuProgram.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9GpuProgram.cpp	(revision 5)
@@ -0,0 +1,198 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9GpuProgram.h"
+#include "OgreMatrix4.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreD3D9Mappings.h"
+#include "OgreResourceGroupManager.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------------
+    D3D9GpuProgram::D3D9GpuProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
+        const String& group, bool isManual, ManualResourceLoader* loader, LPDIRECT3DDEVICE9 pDev) 
+        : GpuProgram(creator, name, handle, group, isManual, loader), 
+        mpDevice(pDev), mpExternalMicrocode(NULL)
+    {
+        if (createParamDictionary("D3D9GpuProgram"))
+        {
+            setupBaseParamDictionary();
+        }
+    }
+	//-----------------------------------------------------------------------------
+    void D3D9GpuProgram::loadImpl(void)
+    {
+        if (mpExternalMicrocode)
+        {
+            loadFromMicrocode(mpExternalMicrocode);
+        }
+        else
+        {
+            // Normal load-from-source approach
+            if (mLoadFromFile)
+            {
+                // find & load source code
+                DataStreamPtr stream = 
+                    ResourceGroupManager::getSingleton().openResource(
+						mFilename, mGroup, true, this);
+                mSource = stream->getAsString();
+            }
+
+            // Call polymorphic load
+            loadFromSource();
+        }
+
+    }
+	//-----------------------------------------------------------------------------
+    void D3D9GpuProgram::loadFromSource(void)
+    {
+        // Create the shader
+        // Assemble source into microcode
+        LPD3DXBUFFER microcode;
+        LPD3DXBUFFER errors;
+        HRESULT hr = D3DXAssembleShader(
+            mSource.c_str(),
+            static_cast<UINT>(mSource.length()),
+            NULL,               // no #define support
+            NULL,               // no #include support
+            0,                  // standard compile options
+            &microcode,
+            &errors);
+
+        if (FAILED(hr))
+        {
+            String message = "Cannot assemble D3D9 shader " + mName + " Errors:\n" +
+                static_cast<const char*>(errors->GetBufferPointer());
+            errors->Release();
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, message,
+                "D3D9GpuProgram::loadFromSource");
+            
+        }
+
+        loadFromMicrocode(microcode);
+
+        SAFE_RELEASE(microcode);
+        SAFE_RELEASE(errors);
+    }
+	//-----------------------------------------------------------------------------
+    D3D9GpuVertexProgram::D3D9GpuVertexProgram(ResourceManager* creator, 
+        const String& name, ResourceHandle handle, const String& group, 
+        bool isManual, ManualResourceLoader* loader, LPDIRECT3DDEVICE9 pDev) 
+        : D3D9GpuProgram(creator, name, handle, group, isManual, loader, pDev)
+        , mpVertexShader(NULL)
+    {
+        mType = GPT_VERTEX_PROGRAM;
+    }
+	//-----------------------------------------------------------------------------
+	D3D9GpuVertexProgram::~D3D9GpuVertexProgram()
+	{
+		// have to call this here reather than in Resource destructor
+		// since calling virtual methods in base destructors causes crash
+		unload(); 
+	}
+	//-----------------------------------------------------------------------------
+    void D3D9GpuVertexProgram::loadFromMicrocode(LPD3DXBUFFER microcode)
+    {
+		if (isSupported())
+		{
+			// Create the shader
+			HRESULT hr = mpDevice->CreateVertexShader( 
+				static_cast<DWORD*>(microcode->GetBufferPointer()), 
+				&mpVertexShader);
+
+			if (FAILED(hr))
+			{
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+					"Cannot create D3D9 vertex shader " + mName + " from microcode",
+					"D3D9GpuVertexProgram::loadFromMicrocode");
+	            
+			}
+		}
+		else
+		{
+			LogManager::getSingleton().logMessage(
+				"Unsupported D3D9 vertex shader '" + mName + "' was not loaded.");
+		}
+    }
+	//-----------------------------------------------------------------------------
+    void D3D9GpuVertexProgram::unloadImpl(void)
+    {
+        SAFE_RELEASE(mpVertexShader);
+    }
+	//-----------------------------------------------------------------------------
+	//-----------------------------------------------------------------------------
+    D3D9GpuFragmentProgram::D3D9GpuFragmentProgram(ResourceManager* creator, 
+        const String& name, ResourceHandle handle, const String& group, 
+        bool isManual, ManualResourceLoader* loader, LPDIRECT3DDEVICE9 pDev) 
+        : D3D9GpuProgram(creator, name, handle, group, isManual, loader, pDev)
+        , mpPixelShader(NULL)
+    {
+        mType = GPT_FRAGMENT_PROGRAM;
+    }
+	//-----------------------------------------------------------------------------
+	D3D9GpuFragmentProgram::~D3D9GpuFragmentProgram()
+	{
+		// have to call this here reather than in Resource destructor
+		// since calling virtual methods in base destructors causes crash
+		unload(); 
+	}
+	//-----------------------------------------------------------------------------
+    void D3D9GpuFragmentProgram::loadFromMicrocode(LPD3DXBUFFER microcode)
+    {
+		if (isSupported())
+		{
+			// Create the shader
+			HRESULT hr = mpDevice->CreatePixelShader(
+				static_cast<DWORD*>(microcode->GetBufferPointer()), 
+				&mpPixelShader);
+
+			if (FAILED(hr))
+			{
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+					"Cannot create D3D9 pixel shader " + mName + " from microcode.",
+					"D3D9GpuFragmentProgram::loadFromMicrocode");
+	            
+			}
+		}
+		else
+		{
+			LogManager::getSingleton().logMessage(
+				"Unsupported D3D9 pixel shader '" + mName + "' was not loaded.");
+		}
+    }
+	//-----------------------------------------------------------------------------
+    void D3D9GpuFragmentProgram::unloadImpl(void)
+    {
+        SAFE_RELEASE(mpPixelShader);
+    }
+	//-----------------------------------------------------------------------------
+
+}
+
Index: /RenderSystems/Direct3D9/src/OgreD3D9GpuProgramManager.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9GpuProgramManager.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9GpuProgramManager.cpp	(revision 5)
@@ -0,0 +1,92 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9GpuProgramManager.h"
+#include "OgreD3D9GpuProgram.h"
+#include "OgreException.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------------
+    D3D9GpuProgramManager::D3D9GpuProgramManager(LPDIRECT3DDEVICE9 device)
+        :GpuProgramManager(), mpDevice(device)
+    {
+        // Superclass sets up members 
+
+        // Register with resource group manager
+        ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
+
+    }
+    //-----------------------------------------------------------------------------
+    D3D9GpuProgramManager::~D3D9GpuProgramManager()
+    {
+        // Unregister with resource group manager
+        ResourceGroupManager::getSingleton()._unregisterResourceManager(mResourceType);
+
+    }
+    //-----------------------------------------------------------------------------
+    Resource* D3D9GpuProgramManager::createImpl(const String& name, ResourceHandle handle, 
+        const String& group, bool isManual, ManualResourceLoader* loader,
+        const NameValuePairList* params)
+    {
+        NameValuePairList::const_iterator paramIt;
+
+        if (!params || (paramIt = params->find("type")) == params->end())
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+                "You must supply a 'type' parameter",
+                "D3D9GpuProgramManager::createImpl");
+        }
+
+        if (paramIt->second == "vertex_program")
+        {
+            return new D3D9GpuVertexProgram(this, name, handle, group, 
+                isManual, loader, mpDevice);
+        }
+        else
+        {
+            return new D3D9GpuFragmentProgram(this, name, handle, group, 
+                isManual, loader, mpDevice);
+        }
+    }
+    //-----------------------------------------------------------------------------
+    Resource* D3D9GpuProgramManager::createImpl(const String& name, ResourceHandle handle, 
+        const String& group, bool isManual, ManualResourceLoader* loader,
+        GpuProgramType gptype, const String& syntaxCode)
+    {
+        if (gptype == GPT_VERTEX_PROGRAM)
+        {
+            return new D3D9GpuVertexProgram(this, name, handle, group, 
+                isManual, loader, mpDevice);
+        }
+        else
+        {
+            return new D3D9GpuFragmentProgram(this, name, handle, group, 
+                isManual, loader, mpDevice);
+        }
+    }
+}
Index: /RenderSystems/Direct3D9/src/OgreD3D9HLSLProgram.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9HLSLProgram.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9HLSLProgram.cpp	(revision 5)
@@ -0,0 +1,512 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9HLSLProgram.h"
+#include "OgreGpuProgramManager.h"
+#include "OgreStringConverter.h"
+#include "OgreD3D9GpuProgram.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    D3D9HLSLProgram::CmdEntryPoint D3D9HLSLProgram::msCmdEntryPoint;
+    D3D9HLSLProgram::CmdTarget D3D9HLSLProgram::msCmdTarget;
+    D3D9HLSLProgram::CmdPreprocessorDefines D3D9HLSLProgram::msCmdPreprocessorDefines;
+    D3D9HLSLProgram::CmdColumnMajorMatrices D3D9HLSLProgram::msCmdColumnMajorMatrices;
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    void D3D9HLSLProgram::loadFromSource(void)
+    {
+        // Populate preprocessor defines
+        String stringBuffer;
+
+        std::vector<D3DXMACRO> defines;
+        const D3DXMACRO* pDefines = 0;
+        if (!mPreprocessorDefines.empty())
+        {
+            stringBuffer = mPreprocessorDefines;
+
+            // Split preprocessor defines and build up macro array
+            D3DXMACRO macro;
+            String::size_type pos = 0;
+            while (pos != String::npos)
+            {
+                macro.Name = &stringBuffer[pos];
+                macro.Definition = 0;
+
+				String::size_type start_pos=pos;
+
+                // Find delims
+                pos = stringBuffer.find_first_of(";,=", pos);
+
+				if(start_pos==pos)
+				{
+					if(pos==stringBuffer.length())
+					{
+						break;
+					}
+					pos++;
+					continue;
+				}
+
+                if (pos != String::npos)
+                {
+                    // Check definition part
+                    if (stringBuffer[pos] == '=')
+                    {
+                        // Setup null character for macro name
+                        stringBuffer[pos++] = '\0';
+                        macro.Definition = &stringBuffer[pos];
+                        pos = stringBuffer.find_first_of(";,", pos);
+                    }
+                    else
+                    {
+                        // No definition part, define as "1"
+                        macro.Definition = "1";
+                    }
+
+                    if (pos != String::npos)
+                    {
+                        // Setup null character for macro name or definition
+                        stringBuffer[pos++] = '\0';
+                    }
+                }
+				else
+				{
+					macro.Definition = "1";
+				}
+				if(strlen(macro.Name)>0)
+				{
+					defines.push_back(macro);
+				}
+				else
+				{
+					break;
+				}
+            }
+
+            // Add NULL terminator
+            macro.Name = 0;
+            macro.Definition = 0;
+            defines.push_back(macro);
+
+            pDefines = &defines[0];
+        }
+
+        // Populate compile flags
+        DWORD compileFlags = 0;
+        if (mColumnMajorMatrices)
+            compileFlags |= D3DXSHADER_PACKMATRIX_COLUMNMAJOR;
+        else
+            compileFlags |= D3DXSHADER_PACKMATRIX_ROWMAJOR;
+
+        LPD3DXBUFFER errors = 0;
+
+        // Compile & assemble into microcode
+        HRESULT hr = D3DXCompileShader(
+            mSource.c_str(),
+            static_cast<UINT>(mSource.length()),
+            pDefines,
+            NULL, //no includes
+            mEntryPoint.c_str(),
+            mTarget.c_str(),
+            compileFlags,
+            &mpMicroCode,
+            &errors,
+            &mpConstTable);
+
+        if (FAILED(hr))
+        {
+            String message = "Cannot assemble D3D9 high-level shader " + mName + " Errors:\n" +
+                static_cast<const char*>(errors->GetBufferPointer());
+            errors->Release();
+            OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, message,
+                "D3D9HLSLProgram::loadFromSource");
+        }
+
+
+    }
+    //-----------------------------------------------------------------------
+    void D3D9HLSLProgram::createLowLevelImpl(void)
+    {
+        // Create a low-level program, give it the same name as us
+        mAssemblerProgram = 
+            GpuProgramManager::getSingleton().createProgramFromString(
+                mName, 
+                mGroup,
+                "",// dummy source, since we'll be using microcode
+                mType, 
+                mTarget);
+        static_cast<D3D9GpuProgram*>(mAssemblerProgram.get())->setExternalMicrocode(mpMicroCode);
+
+    }
+    //-----------------------------------------------------------------------
+    void D3D9HLSLProgram::unloadHighLevelImpl(void)
+    {
+        SAFE_RELEASE(mpMicroCode);
+        SAFE_RELEASE(mpConstTable);
+
+    }
+    //-----------------------------------------------------------------------
+    void D3D9HLSLProgram::buildConstantDefinitions() const
+    {
+        // Derive parameter names from const table
+        assert(mpConstTable && "Program not loaded!");
+        // Get contents of the constant table
+        D3DXCONSTANTTABLE_DESC desc;
+        HRESULT hr = mpConstTable->GetDesc(&desc);
+
+		mFloatLogicalToPhysical.bufferSize = 0;
+		mIntLogicalToPhysical.bufferSize = 0;
+		mConstantDefs.floatBufferSize = 0;
+		mConstantDefs.intBufferSize = 0;
+
+        if (FAILED(hr))
+        {
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+                "Cannot retrieve constant descriptions from HLSL program.", 
+                "D3D9HLSLProgram::buildParameterNameMap");
+        }
+        // Iterate over the constants
+        for (unsigned int i = 0; i < desc.Constants; ++i)
+        {
+            // Recursively descend through the structure levels
+            processParamElement(NULL, "", i);
+        }
+
+        
+    }
+    //-----------------------------------------------------------------------
+    void D3D9HLSLProgram::processParamElement(D3DXHANDLE parent, String prefix, 
+        unsigned int index) const
+    {
+        D3DXHANDLE hConstant = mpConstTable->GetConstant(parent, index);
+
+        // Since D3D HLSL doesn't deal with naming of array and struct parameters
+        // automatically, we have to do it by hand
+
+        D3DXCONSTANT_DESC desc;
+        unsigned int numParams = 1;
+        HRESULT hr = mpConstTable->GetConstantDesc(hConstant, &desc, &numParams);
+        if (FAILED(hr))
+        {
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+                "Cannot retrieve constant description from HLSL program.", 
+                "D3D9HLSLProgram::processParamElement");
+        }
+
+        String paramName = desc.Name;
+        // trim the odd '$' which appears at the start of the names in HLSL
+        if (paramName.at(0) == '$')
+            paramName.erase(paramName.begin());
+
+		// Also trim the '[0]' suffix if it exists, we will add our own indexing later
+		if (StringUtil::endsWith(paramName, "[0]", false))
+		{
+			paramName.erase(paramName.size() - 3);
+		}
+
+
+        if (desc.Class == D3DXPC_STRUCT)
+        {
+            // work out a new prefix for nested members, if it's an array, we need an index
+            prefix = prefix + paramName + ".";
+            // Cascade into struct
+            for (unsigned int i = 0; i < desc.StructMembers; ++i)
+            {
+                processParamElement(hConstant, prefix, i);
+            }
+        }
+        else
+        {
+            // Process params
+            if (desc.Type == D3DXPT_FLOAT || desc.Type == D3DXPT_INT || desc.Type == D3DXPT_BOOL)
+            {
+                size_t paramIndex = desc.RegisterIndex;
+                String name = prefix + paramName;
+                
+				GpuConstantDefinition def;
+				// populate type, array size & element size
+				populateDef(desc, def);
+				if (def.isFloat())
+				{
+					def.physicalIndex = mFloatLogicalToPhysical.bufferSize;
+					OGRE_LOCK_MUTEX(mFloatLogicalToPhysical.mutex)
+					mFloatLogicalToPhysical.map.insert(
+						GpuLogicalIndexUseMap::value_type(paramIndex, 
+						GpuLogicalIndexUse(def.physicalIndex, def.arraySize * def.elementSize)));
+					mFloatLogicalToPhysical.bufferSize += def.arraySize * def.elementSize;
+					mConstantDefs.floatBufferSize = mFloatLogicalToPhysical.bufferSize;
+				}
+				else
+				{
+					def.physicalIndex = mIntLogicalToPhysical.bufferSize;
+					OGRE_LOCK_MUTEX(mIntLogicalToPhysical.mutex)
+					mIntLogicalToPhysical.map.insert(
+						GpuLogicalIndexUseMap::value_type(paramIndex, 
+						GpuLogicalIndexUse(def.physicalIndex, def.arraySize * def.elementSize)));
+					mIntLogicalToPhysical.bufferSize += def.arraySize * def.elementSize;
+					mConstantDefs.intBufferSize = mIntLogicalToPhysical.bufferSize;
+				}
+
+                mConstantDefs.map.insert(GpuConstantDefinitionMap::value_type(name, def));
+
+				// Now deal with arrays
+				mConstantDefs.generateConstantDefinitionArrayEntries(name, def);
+            }
+        }
+            
+    }
+	//-----------------------------------------------------------------------
+	void D3D9HLSLProgram::populateDef(D3DXCONSTANT_DESC& d3dDesc, GpuConstantDefinition& def) const
+	{
+		def.arraySize = d3dDesc.Elements;
+		switch(d3dDesc.Type)
+		{
+		case D3DXPT_INT:
+			switch(d3dDesc.Columns)
+			{
+			case 1:
+				def.constType = GCT_INT1;
+				def.elementSize = 4; // HLSL always packs
+				break;
+			case 2:
+				def.constType = GCT_INT2;
+				def.elementSize = 4; // HLSL always packs
+				break;
+			case 3:
+				def.constType = GCT_INT3;
+				def.elementSize = 4; // HLSL always packs
+				break;
+			case 4:
+				def.constType = GCT_INT4;
+				def.elementSize = 4; 
+				break;
+			} // columns
+			break;
+		case D3DXPT_FLOAT:
+			switch(d3dDesc.Rows)
+			{
+			case 1:
+				switch(d3dDesc.Columns)
+				{
+				case 1:
+					def.constType = GCT_FLOAT1;
+					def.elementSize = 4; // HLSL always packs
+					break;
+				case 2:
+					def.constType = GCT_FLOAT2;
+					def.elementSize = 4; // HLSL always packs
+					break;
+				case 3:
+					def.constType = GCT_FLOAT3;
+					def.elementSize = 4; // HLSL always packs
+					break;
+				case 4:
+					def.constType = GCT_FLOAT4;
+					def.elementSize = 4; 
+					break;
+				} // columns
+				break;
+			case 2:
+				switch(d3dDesc.Columns)
+				{
+				case 2:
+					def.constType = GCT_MATRIX_2X2;
+					def.elementSize = 8; // HLSL always packs
+					break;
+				case 3:
+					def.constType = GCT_MATRIX_2X3;
+					def.elementSize = 8; // HLSL always packs
+					break;
+				case 4:
+					def.constType = GCT_MATRIX_2X4;
+					def.elementSize = 8; 
+					break;
+				} // columns
+				break;
+			case 3:
+				switch(d3dDesc.Columns)
+				{
+				case 2:
+					def.constType = GCT_MATRIX_3X2;
+					def.elementSize = 12; // HLSL always packs
+					break;
+				case 3:
+					def.constType = GCT_MATRIX_3X3;
+					def.elementSize = 12; // HLSL always packs
+					break;
+				case 4:
+					def.constType = GCT_MATRIX_3X4;
+					def.elementSize = 12; 
+					break;
+				} // columns
+				break;
+			case 4:
+				switch(d3dDesc.Columns)
+				{
+				case 2:
+					def.constType = GCT_MATRIX_4X2;
+					def.elementSize = 16; // HLSL always packs
+					break;
+				case 3:
+					def.constType = GCT_MATRIX_4X3;
+					def.elementSize = 16; // HLSL always packs
+					break;
+				case 4:
+					def.constType = GCT_MATRIX_4X4;
+					def.elementSize = 16; 
+					break;
+				} // columns
+				break;
+
+			} // rows
+			break;
+			
+		default:
+			// not mapping samplers, don't need to take the space 
+			break;
+		};
+
+	}
+    //-----------------------------------------------------------------------
+    D3D9HLSLProgram::D3D9HLSLProgram(ResourceManager* creator, const String& name, 
+        ResourceHandle handle, const String& group, bool isManual, 
+        ManualResourceLoader* loader)
+        : HighLevelGpuProgram(creator, name, handle, group, isManual, loader)
+        , mTarget()
+        , mEntryPoint()
+        , mPreprocessorDefines()
+        , mColumnMajorMatrices(true)
+        , mpMicroCode(NULL), mpConstTable(NULL)
+    {
+        if (createParamDictionary("D3D9HLSLProgram"))
+        {
+            setupBaseParamDictionary();
+            ParamDictionary* dict = getParamDictionary();
+
+            dict->addParameter(ParameterDef("entry_point", 
+                "The entry point for the HLSL program.",
+                PT_STRING),&msCmdEntryPoint);
+            dict->addParameter(ParameterDef("target", 
+                "Name of the assembler target to compile down to.",
+                PT_STRING),&msCmdTarget);
+            dict->addParameter(ParameterDef("preprocessor_defines", 
+                "Preprocessor defines use to compile the program.",
+                PT_STRING),&msCmdPreprocessorDefines);
+            dict->addParameter(ParameterDef("column_major_matrices", 
+                "Whether matrix packing in column-major order.",
+                PT_BOOL),&msCmdColumnMajorMatrices);
+        }
+        
+    }
+    //-----------------------------------------------------------------------
+    D3D9HLSLProgram::~D3D9HLSLProgram()
+    {
+        // have to call this here reather than in Resource destructor
+        // since calling virtual methods in base destructors causes crash
+        if (isLoaded())
+        {
+            unload();
+        }
+        else
+        {
+            unloadHighLevel();
+        }
+    }
+    //-----------------------------------------------------------------------
+    bool D3D9HLSLProgram::isSupported(void) const
+    {
+        if (mCompileError || !isRequiredCapabilitiesSupported())
+            return false;
+
+        return GpuProgramManager::getSingleton().isSyntaxSupported(mTarget);
+    }
+    //-----------------------------------------------------------------------
+    GpuProgramParametersSharedPtr D3D9HLSLProgram::createParameters(void)
+    {
+        // Call superclass
+        GpuProgramParametersSharedPtr params = HighLevelGpuProgram::createParameters();
+
+        // Need to transpose matrices if compiled with column-major matrices
+        params->setTransposeMatrices(mColumnMajorMatrices);
+
+        return params;
+    }
+    //-----------------------------------------------------------------------
+    void D3D9HLSLProgram::setTarget(const String& target)
+    {
+        mTarget = target;
+    }
+
+    //-----------------------------------------------------------------------
+    const String& D3D9HLSLProgram::getLanguage(void) const
+    {
+        static const String language = "hlsl";
+
+        return language;
+    }
+
+    //-----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
+    String D3D9HLSLProgram::CmdEntryPoint::doGet(const void *target) const
+    {
+        return static_cast<const D3D9HLSLProgram*>(target)->getEntryPoint();
+    }
+    void D3D9HLSLProgram::CmdEntryPoint::doSet(void *target, const String& val)
+    {
+        static_cast<D3D9HLSLProgram*>(target)->setEntryPoint(val);
+    }
+    //-----------------------------------------------------------------------
+    String D3D9HLSLProgram::CmdTarget::doGet(const void *target) const
+    {
+        return static_cast<const D3D9HLSLProgram*>(target)->getTarget();
+    }
+    void D3D9HLSLProgram::CmdTarget::doSet(void *target, const String& val)
+    {
+        static_cast<D3D9HLSLProgram*>(target)->setTarget(val);
+    }
+    //-----------------------------------------------------------------------
+    String D3D9HLSLProgram::CmdPreprocessorDefines::doGet(const void *target) const
+    {
+        return static_cast<const D3D9HLSLProgram*>(target)->getPreprocessorDefines();
+    }
+    void D3D9HLSLProgram::CmdPreprocessorDefines::doSet(void *target, const String& val)
+    {
+        static_cast<D3D9HLSLProgram*>(target)->setPreprocessorDefines(val);
+    }
+    //-----------------------------------------------------------------------
+    String D3D9HLSLProgram::CmdColumnMajorMatrices::doGet(const void *target) const
+    {
+        return StringConverter::toString(static_cast<const D3D9HLSLProgram*>(target)->getColumnMajorMatrices());
+    }
+    void D3D9HLSLProgram::CmdColumnMajorMatrices::doSet(void *target, const String& val)
+    {
+        static_cast<D3D9HLSLProgram*>(target)->setColumnMajorMatrices(StringConverter::parseBool(val));
+    }
+
+}
Index: /RenderSystems/Direct3D9/src/OgreD3D9HLSLProgramFactory.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9HLSLProgramFactory.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9HLSLProgramFactory.cpp	(revision 5)
@@ -0,0 +1,64 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreD3D9HLSLProgramFactory.h"
+#include "OgreString.h"
+#include "OgreD3D9HLSLProgram.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    String D3D9HLSLProgramFactory::sLanguageName = "hlsl";
+    //-----------------------------------------------------------------------
+    D3D9HLSLProgramFactory::D3D9HLSLProgramFactory()
+    {
+    }
+    //-----------------------------------------------------------------------
+    D3D9HLSLProgramFactory::~D3D9HLSLProgramFactory()
+    {
+    }
+    //-----------------------------------------------------------------------
+    const String& D3D9HLSLProgramFactory::getLanguage(void) const
+    {
+        return sLanguageName;
+    }
+    //-----------------------------------------------------------------------
+    HighLevelGpuProgram* D3D9HLSLProgramFactory::create(ResourceManager* creator, 
+        const String& name, ResourceHandle handle,
+        const String& group, bool isManual, ManualResourceLoader* loader)
+    {
+        return new D3D9HLSLProgram(creator, name, handle, group, isManual, loader);
+    }
+    //-----------------------------------------------------------------------
+	void D3D9HLSLProgramFactory::destroy(HighLevelGpuProgram* prog)
+    {
+        delete prog;
+    }
+    //-----------------------------------------------------------------------
+
+}
Index: /RenderSystems/Direct3D9/src/OgreD3D9HardwareBufferManager.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9HardwareBufferManager.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9HardwareBufferManager.cpp	(revision 5)
@@ -0,0 +1,207 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9HardwareBufferManager.h"
+#include "OgreD3D9HardwareVertexBuffer.h"
+#include "OgreD3D9HardwareIndexBuffer.h"
+#include "OgreD3D9VertexDeclaration.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    D3D9HardwareBufferManager::D3D9HardwareBufferManager(LPDIRECT3DDEVICE9 device)
+        : mlpD3DDevice(device)
+    {
+    }
+    //-----------------------------------------------------------------------
+    D3D9HardwareBufferManager::~D3D9HardwareBufferManager()
+    {
+        destroyAllDeclarations();
+        destroyAllBindings();
+    }
+    //-----------------------------------------------------------------------
+    HardwareVertexBufferSharedPtr 
+    D3D9HardwareBufferManager::
+    createVertexBuffer(size_t vertexSize, size_t numVerts, HardwareBuffer::Usage usage,
+		bool useShadowBuffer)
+    {
+		assert (numVerts > 0);
+#if OGRE_D3D_MANAGE_BUFFERS
+        // Override shadow buffer setting; managed buffers are automatically
+        // backed by system memory
+        // Don't override shadow buffer if discardable, since then we use
+        // unmanaged buffers for speed (avoids write-through overhead)
+        if (useShadowBuffer && !(usage & HardwareBuffer::HBU_DISCARDABLE))
+        {
+            useShadowBuffer = false;
+            // Also drop any WRITE_ONLY so we can read direct
+            if (usage == HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY)
+            {
+                usage = HardwareBuffer::HBU_DYNAMIC;
+            }
+            else if (usage == HardwareBuffer::HBU_STATIC_WRITE_ONLY)
+            {
+                usage = HardwareBuffer::HBU_STATIC;
+            }
+        }
+#endif
+		D3D9HardwareVertexBuffer* vbuf = new D3D9HardwareVertexBuffer(
+			vertexSize, numVerts, usage, mlpD3DDevice, false, useShadowBuffer);
+		{
+			OGRE_LOCK_MUTEX(mVertexBuffersMutex)
+			mVertexBuffers.insert(vbuf);
+		}
+        return HardwareVertexBufferSharedPtr(vbuf);
+    }
+    //-----------------------------------------------------------------------
+	HardwareIndexBufferSharedPtr 
+    D3D9HardwareBufferManager::
+    createIndexBuffer(HardwareIndexBuffer::IndexType itype, size_t numIndexes, 
+        HardwareBuffer::Usage usage, bool useShadowBuffer)
+    {
+		assert (numIndexes > 0);
+#if OGRE_D3D_MANAGE_BUFFERS
+        // Override shadow buffer setting; managed buffers are automatically
+        // backed by system memory
+        if (useShadowBuffer)
+        {
+            useShadowBuffer = false;
+            // Also drop any WRITE_ONLY so we can read direct
+            if (usage == HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY)
+            {
+                usage = HardwareBuffer::HBU_DYNAMIC;
+            }
+            else if (usage == HardwareBuffer::HBU_STATIC_WRITE_ONLY)
+            {
+                usage = HardwareBuffer::HBU_STATIC;
+            }
+        }
+#endif
+		D3D9HardwareIndexBuffer* idx = new D3D9HardwareIndexBuffer(
+			itype, numIndexes, usage, mlpD3DDevice, false, useShadowBuffer);
+		{
+			OGRE_LOCK_MUTEX(mIndexBuffersMutex)
+			mIndexBuffers.insert(idx);
+		}
+		return HardwareIndexBufferSharedPtr(idx);
+            
+    }
+    //-----------------------------------------------------------------------
+    VertexDeclaration* D3D9HardwareBufferManager::createVertexDeclarationImpl(void)
+    {
+        return new D3D9VertexDeclaration(mlpD3DDevice);
+    }
+    //-----------------------------------------------------------------------
+    void D3D9HardwareBufferManager::destroyVertexDeclarationImpl(VertexDeclaration* decl)
+    {
+        delete decl;
+    }
+	//-----------------------------------------------------------------------
+	void D3D9HardwareBufferManager::releaseDefaultPoolResources(void)
+	{
+		size_t iCount = 0;
+		size_t vCount = 0;
+
+		
+		{
+			OGRE_LOCK_MUTEX(mVertexBuffersMutex)
+			VertexBufferList::iterator v, vend;
+			vend = mVertexBuffers.end();
+			for (v = mVertexBuffers.begin(); v != vend; ++v)
+			{
+				D3D9HardwareVertexBuffer* vbuf = 
+					static_cast<D3D9HardwareVertexBuffer*>(*v);
+				if (vbuf->releaseIfDefaultPool())
+					vCount++;
+			}
+		}
+
+		{
+			OGRE_LOCK_MUTEX(mIndexBuffersMutex)
+			IndexBufferList::iterator i, iend;
+			iend = mIndexBuffers.end();
+			for (i = mIndexBuffers.begin(); i != iend; ++i)
+			{
+				D3D9HardwareIndexBuffer* ibuf = 
+					static_cast<D3D9HardwareIndexBuffer*>(*i);
+				if (ibuf->releaseIfDefaultPool())
+					iCount++;
+
+			}
+		}
+
+		LogManager::getSingleton().logMessage("D3D9HardwareBufferManager released:");
+		LogManager::getSingleton().logMessage(
+			StringConverter::toString(vCount) + " unmanaged vertex buffers");
+		LogManager::getSingleton().logMessage(
+			StringConverter::toString(iCount) + " unmanaged index buffers");
+	}
+	//-----------------------------------------------------------------------
+	void D3D9HardwareBufferManager::recreateDefaultPoolResources(void)
+	{
+		size_t iCount = 0;
+		size_t vCount = 0;
+
+		{
+			OGRE_LOCK_MUTEX(mVertexBuffersMutex)
+			VertexBufferList::iterator v, vend;
+			vend = mVertexBuffers.end();
+			for (v = mVertexBuffers.begin(); v != vend; ++v)
+			{
+				D3D9HardwareVertexBuffer* vbuf = 
+					static_cast<D3D9HardwareVertexBuffer*>(*v);
+				if (vbuf->recreateIfDefaultPool(mlpD3DDevice))
+					vCount++;
+			}
+		}
+
+		{
+			OGRE_LOCK_MUTEX(mIndexBuffersMutex)
+			IndexBufferList::iterator i, iend;
+			iend = mIndexBuffers.end();
+			for (i = mIndexBuffers.begin(); i != iend; ++i)
+			{
+				D3D9HardwareIndexBuffer* ibuf = 
+					static_cast<D3D9HardwareIndexBuffer*>(*i);
+				if (ibuf->recreateIfDefaultPool(mlpD3DDevice))
+					iCount++;
+
+			}
+		}
+
+		LogManager::getSingleton().logMessage("D3D9HardwareBufferManager recreated:");
+		LogManager::getSingleton().logMessage(
+			StringConverter::toString(vCount) + " unmanaged vertex buffers");
+		LogManager::getSingleton().logMessage(
+			StringConverter::toString(iCount) + " unmanaged index buffers");
+	}
+	//-----------------------------------------------------------------------
+
+}
Index: /RenderSystems/Direct3D9/src/OgreD3D9HardwareIndexBuffer.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9HardwareIndexBuffer.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9HardwareIndexBuffer.cpp	(revision 5)
@@ -0,0 +1,165 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9HardwareIndexBuffer.h"
+#include "OgreD3D9Mappings.h"
+#include "OgreException.h"
+#include "OgreD3D9HardwareBufferManager.h"
+
+namespace Ogre {
+
+	//---------------------------------------------------------------------
+    D3D9HardwareIndexBuffer::D3D9HardwareIndexBuffer(HardwareIndexBuffer::IndexType idxType, 
+        size_t numIndexes, HardwareBuffer::Usage usage, LPDIRECT3DDEVICE9 pDev, 
+        bool useSystemMemory, bool useShadowBuffer)
+        : HardwareIndexBuffer(idxType, numIndexes, usage, useSystemMemory, useShadowBuffer)
+    {
+#if OGRE_D3D_MANAGE_BUFFERS
+		mD3DPool = useSystemMemory? D3DPOOL_SYSTEMMEM : 
+			// If not system mem, use managed pool UNLESS buffer is discardable
+			// if discardable, keeping the software backing is expensive
+			(usage & HardwareBuffer::HBU_DISCARDABLE)? D3DPOOL_DEFAULT : D3DPOOL_MANAGED;
+#else
+		mD3DPool = useSystemMemory? D3DPOOL_SYSTEMMEM : D3DPOOL_DEFAULT;
+#endif
+        // Create the Index buffer
+        HRESULT hr = pDev->CreateIndexBuffer(
+            static_cast<UINT>(mSizeInBytes),
+            D3D9Mappings::get(mUsage),
+            D3D9Mappings::get(mIndexType),
+			mD3DPool,
+            &mlpD3DBuffer,
+            NULL
+            );
+            
+        if (FAILED(hr))
+        {
+			String msg = DXGetErrorDescription9(hr);
+            OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+				"Cannot create D3D9 Index buffer: " + msg, 
+                "D3D9HardwareIndexBuffer::D3D9HardwareIndexBuffer");
+        }
+
+    }
+	//---------------------------------------------------------------------
+    D3D9HardwareIndexBuffer::~D3D9HardwareIndexBuffer()
+    {
+        SAFE_RELEASE(mlpD3DBuffer);
+    }
+	//---------------------------------------------------------------------
+    void* D3D9HardwareIndexBuffer::lockImpl(size_t offset, 
+        size_t length, LockOptions options)
+    {
+        void* pBuf;
+        HRESULT hr = mlpD3DBuffer->Lock(
+            static_cast<UINT>(offset), 
+            static_cast<UINT>(length), 
+            &pBuf,
+            D3D9Mappings::get(options, mUsage));
+
+        if (FAILED(hr))
+        {
+			String msg = DXGetErrorDescription9(hr);
+            OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+				"Cannot lock D3D9 Index buffer: " + msg, 
+                "D3D9HardwareIndexBuffer::lock");
+        }
+
+
+        return pBuf;
+
+
+    }
+	//---------------------------------------------------------------------
+	void D3D9HardwareIndexBuffer::unlockImpl(void)
+    {
+        HRESULT hr = mlpD3DBuffer->Unlock();
+    }
+	//---------------------------------------------------------------------
+    void D3D9HardwareIndexBuffer::readData(size_t offset, size_t length, 
+        void* pDest)
+    {
+       // There is no functional interface in D3D, just do via manual 
+        // lock, copy & unlock
+        void* pSrc = this->lock(offset, length, HardwareBuffer::HBL_READ_ONLY);
+        memcpy(pDest, pSrc, length);
+        this->unlock();
+
+    }
+	//---------------------------------------------------------------------
+    void D3D9HardwareIndexBuffer::writeData(size_t offset, size_t length, 
+            const void* pSource,
+			bool discardWholeBuffer)
+    {
+       // There is no functional interface in D3D, just do via manual 
+        // lock, copy & unlock
+        void* pDst = this->lock(offset, length, 
+            discardWholeBuffer ? HardwareBuffer::HBL_DISCARD : HardwareBuffer::HBL_NORMAL);
+        memcpy(pDst, pSource, length);
+        this->unlock();    }
+	//---------------------------------------------------------------------
+	bool D3D9HardwareIndexBuffer::releaseIfDefaultPool(void)
+	{
+		if (mD3DPool == D3DPOOL_DEFAULT)
+		{
+			SAFE_RELEASE(mlpD3DBuffer);
+			return true;
+		}
+		return false;
+
+	}
+	//---------------------------------------------------------------------
+	bool D3D9HardwareIndexBuffer::recreateIfDefaultPool(LPDIRECT3DDEVICE9 pDev)
+	{
+		if (mD3DPool == D3DPOOL_DEFAULT)
+		{
+			// Create the Index buffer
+			HRESULT hr = pDev->CreateIndexBuffer(
+				static_cast<UINT>(mSizeInBytes),
+				D3D9Mappings::get(mUsage),
+				D3D9Mappings::get(mIndexType),
+				mD3DPool,
+				&mlpD3DBuffer,
+				NULL
+				);
+
+			if (FAILED(hr))
+			{
+				String msg = DXGetErrorDescription9(hr);
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+					"Cannot create D3D9 Index buffer: " + msg, 
+					"D3D9HardwareIndexBuffer::D3D9HardwareIndexBuffer");
+			}
+
+			return true;
+		}
+		return false;
+	}
+	//---------------------------------------------------------------------
+
+}
Index: /RenderSystems/Direct3D9/src/OgreD3D9HardwareOcclusionQuery.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9HardwareOcclusionQuery.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9HardwareOcclusionQuery.cpp	(revision 5)
@@ -0,0 +1,149 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9HardwareOcclusionQuery.h"
+#include "OgreRenderSystemCapabilities.h"
+#include "OgreException.h"
+
+namespace Ogre {
+
+	/**
+	* This is a class that is the DirectX9 implementation of 
+	* hardware occlusion testing.
+	*
+	* @author Lee Sandberg
+	*
+	* Updated on 12/7/2004 by Chris McGuirk
+	* Updated on 4/8/2005 by Tuan Kuranes email: tuan.kuranes@free.fr
+	*/
+
+	/**
+	* Default object constructor
+	*/
+    D3D9HardwareOcclusionQuery::D3D9HardwareOcclusionQuery( IDirect3DDevice9* pD3DDevice ) :
+        mpDevice(pD3DDevice)
+	{ 
+		// create the occlusion query
+		const HRESULT hr = mpDevice->CreateQuery(D3DQUERYTYPE_OCCLUSION, &mpQuery);
+
+		if ( hr != D3D_OK ) 
+		{	
+            if( D3DERR_NOTAVAILABLE == hr)
+	        {
+                OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR, 
+                    "Cannot allocate a Hardware query. This video card doesn't supports it, sorry.", 
+                    "D3D9HardwareOcclusionQuery::D3D9HardwareOcclusionQuery" );
+            }			
+		}
+	}
+
+	/**
+	* Object destructor
+	*/
+	D3D9HardwareOcclusionQuery::~D3D9HardwareOcclusionQuery() 
+	{ 
+		SAFE_RELEASE(mpQuery); 
+	}
+
+	//------------------------------------------------------------------
+	// Occlusion query functions (see base class documentation for this)
+	//--
+	void D3D9HardwareOcclusionQuery::beginOcclusionQuery() 
+	{	    	
+		mpQuery->Issue(D3DISSUE_BEGIN); 
+        mIsQueryResultStillOutstanding = true;
+        mPixelCount = 0;
+	}
+
+	void D3D9HardwareOcclusionQuery::endOcclusionQuery() 
+	{ 
+		mpQuery->Issue(D3DISSUE_END); 
+	}
+
+	//------------------------------------------------------------------
+	bool D3D9HardwareOcclusionQuery::pullOcclusionQuery( unsigned int* NumOfFragments ) 
+	{
+        // in case you didn't check if query arrived and want the result now.
+        if (mIsQueryResultStillOutstanding)
+        {
+            // Loop until the data becomes available
+            DWORD pixels;
+            const size_t dataSize = sizeof( DWORD );
+			while (1)
+            {
+                const HRESULT hr = mpQuery->GetData((void *)&pixels, dataSize, D3DGETDATA_FLUSH);
+
+                if  (hr == S_FALSE)
+                    continue;
+                if  (hr == S_OK)
+                {
+                    mPixelCount = pixels;
+                    *NumOfFragments = pixels;
+                    break;
+                }
+                if (hr == D3DERR_DEVICELOST)
+                {
+                    *NumOfFragments = 100000;
+                    mPixelCount = 100000;
+                    mpDevice->CreateQuery(D3DQUERYTYPE_OCCLUSION, &mpQuery);
+                    break;
+                }
+            } 
+            mIsQueryResultStillOutstanding = false;
+        }
+        else
+        {
+            // we already stored result from last frames.
+            *NumOfFragments = mPixelCount;
+        }		
+		return true;
+	}
+    //------------------------------------------------------------------
+    bool D3D9HardwareOcclusionQuery::isStillOutstanding(void)
+    {       
+        // in case you already asked for this query
+        if (!mIsQueryResultStillOutstanding)
+            return false;
+
+        DWORD pixels;
+        const HRESULT hr = mpQuery->GetData( (void *) &pixels, sizeof( DWORD ), 0);
+
+        if (hr  == S_FALSE)
+            return true;
+
+        if (hr == D3DERR_DEVICELOST)
+        {
+            mPixelCount = 100000;
+            mpDevice->CreateQuery(D3DQUERYTYPE_OCCLUSION, &mpQuery);
+        }
+        mPixelCount = pixels;
+        mIsQueryResultStillOutstanding = false;
+        return false;
+    
+    } 
+}
Index: /RenderSystems/Direct3D9/src/OgreD3D9HardwarePixelBuffer.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9HardwarePixelBuffer.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9HardwarePixelBuffer.cpp	(revision 5)
@@ -0,0 +1,647 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9HardwarePixelBuffer.h"
+#include "OgreD3D9Texture.h"
+#include "OgreD3D9Mappings.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreBitwise.h"
+
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+
+#include "OgreNoMemoryMacros.h"
+#include <d3dx9.h>
+#include <dxerr9.h>
+#include "OgreMemoryMacros.h"
+
+namespace Ogre {
+
+//-----------------------------------------------------------------------------  
+
+D3D9HardwarePixelBuffer::D3D9HardwarePixelBuffer(HardwareBuffer::Usage usage):
+	HardwarePixelBuffer(0, 0, 0, PF_UNKNOWN, usage, false, false),
+	mpDev(0),
+	mSurface(0), mVolume(0), mTempSurface(0), mTempVolume(0),
+	mDoMipmapGen(0), mHWMipmaps(0), mMipTex(0)
+{
+}
+D3D9HardwarePixelBuffer::~D3D9HardwarePixelBuffer()
+{
+	destroyRenderTextures();
+}
+//-----------------------------------------------------------------------------  
+void D3D9HardwarePixelBuffer::bind(IDirect3DDevice9 *dev, IDirect3DSurface9 *surface, bool update)
+{
+	mpDev = dev;
+	mSurface = surface;
+	
+	D3DSURFACE_DESC desc;
+	if(mSurface->GetDesc(&desc) != D3D_OK)
+		OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Could not get surface information",
+		 "D3D9HardwarePixelBuffer::D3D9HardwarePixelBuffer");
+	mWidth = desc.Width;
+	mHeight = desc.Height;
+	mDepth = 1;
+	mFormat = D3D9Mappings::_getPF(desc.Format);
+	// Default
+	mRowPitch = mWidth;
+	mSlicePitch = mHeight*mWidth;
+	mSizeInBytes = PixelUtil::getMemorySize(mWidth, mHeight, mDepth, mFormat);
+
+	if(mUsage & TU_RENDERTARGET)
+		createRenderTextures(update);
+}
+//-----------------------------------------------------------------------------
+void D3D9HardwarePixelBuffer::bind(IDirect3DDevice9 *dev, IDirect3DVolume9 *volume, bool update)
+{
+	mpDev = dev;
+	mVolume = volume;
+	
+	D3DVOLUME_DESC desc;
+	if(mVolume->GetDesc(&desc) != D3D_OK)
+		OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Could not get volume information",
+		 "D3D9HardwarePixelBuffer::D3D9HardwarePixelBuffer");
+	mWidth = desc.Width;
+	mHeight = desc.Height;
+	mDepth = desc.Depth;
+	mFormat = D3D9Mappings::_getPF(desc.Format);
+	// Default
+	mRowPitch = mWidth;
+	mSlicePitch = mHeight*mWidth;
+	mSizeInBytes = PixelUtil::getMemorySize(mWidth, mHeight, mDepth, mFormat);
+
+	if(mUsage & TU_RENDERTARGET)
+		createRenderTextures(update);
+}
+//-----------------------------------------------------------------------------  
+// Util functions to convert a D3D locked box to a pixel box
+void fromD3DLock(PixelBox &rval, const D3DLOCKED_RECT &lrect)
+{
+	size_t bpp = PixelUtil::getNumElemBytes(rval.format);
+	if (bpp != 0)
+	{
+		rval.rowPitch = lrect.Pitch / bpp;
+		rval.slicePitch = rval.rowPitch * rval.getHeight();
+		assert((lrect.Pitch % bpp)==0);
+	}
+	else if (PixelUtil::isCompressed(rval.format))
+	{
+		rval.rowPitch = rval.getWidth();
+		rval.slicePitch = rval.getWidth() * rval.getHeight();
+	}
+	else
+	{
+		OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+			"Invalid pixel format", "fromD3DLock");
+	}
+
+	rval.data = lrect.pBits;
+}
+void fromD3DLock(PixelBox &rval, const D3DLOCKED_BOX &lbox)
+{
+	size_t bpp = PixelUtil::getNumElemBytes(rval.format);
+	if (bpp != 0)
+	{
+		rval.rowPitch = lbox.RowPitch / bpp;
+		rval.slicePitch = lbox.SlicePitch / bpp;
+		assert((lbox.RowPitch % bpp)==0);
+		assert((lbox.SlicePitch % bpp)==0);
+	}
+	else if (PixelUtil::isCompressed(rval.format))
+	{
+		rval.rowPitch = rval.getWidth();
+		rval.slicePitch = rval.getWidth() * rval.getHeight();
+	}
+	else
+	{
+		OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+			"Invalid pixel format", "fromD3DLock");
+	}
+	rval.data = lbox.pBits;
+}
+// Convert Ogre integer Box to D3D rectangle
+RECT toD3DRECT(const Box &lockBox)
+{
+	RECT prect;
+	assert(lockBox.getDepth() == 1);
+	prect.left = lockBox.left;
+	prect.right = lockBox.right;
+	prect.top = lockBox.top;
+	prect.bottom = lockBox.bottom;
+	return prect;
+}
+// Convert Ogre integer Box to D3D box
+D3DBOX toD3DBOX(const Box &lockBox)
+{
+	D3DBOX pbox;
+	pbox.Left = lockBox.left;
+	pbox.Right = lockBox.right;
+	pbox.Top = lockBox.top;
+	pbox.Bottom = lockBox.bottom;
+	pbox.Front = lockBox.front;
+	pbox.Back = lockBox.back;
+	return pbox;
+}
+// Convert Ogre pixelbox extent to D3D rectangle
+RECT toD3DRECTExtent(const PixelBox &lockBox)
+{
+	RECT prect;
+	assert(lockBox.getDepth() == 1);
+	prect.left = 0;
+	prect.right = lockBox.getWidth();
+	prect.top = 0;
+	prect.bottom = lockBox.getHeight();
+	return prect;
+}
+// Convert Ogre pixelbox extent to D3D box
+D3DBOX toD3DBOXExtent(const PixelBox &lockBox)
+{
+	D3DBOX pbox;
+	pbox.Left = 0;
+	pbox.Right = lockBox.getWidth();
+	pbox.Top = 0;
+	pbox.Bottom = lockBox.getHeight();
+	pbox.Front = 0;
+	pbox.Back = lockBox.getDepth();
+	return pbox;
+}
+//-----------------------------------------------------------------------------  
+PixelBox D3D9HardwarePixelBuffer::lockImpl(const Image::Box lockBox,  LockOptions options)
+{
+	// Check for misuse
+	if(mUsage & TU_RENDERTARGET)
+		OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "DirectX does not allow locking of or directly writing to RenderTargets. Use blitFromMemory if you need the contents.",
+		 	"D3D9HardwarePixelBuffer::lockImpl");	
+	// Set extents and format
+	PixelBox rval(lockBox, mFormat);
+	// Set locking flags according to options
+	DWORD flags = 0;
+	switch(options)
+	{
+	case HBL_DISCARD:
+		// D3D only likes D3DLOCK_DISCARD if you created the texture with D3DUSAGE_DYNAMIC
+		// debug runtime flags this up, could cause problems on some drivers
+		if (mUsage & HBU_DYNAMIC)
+			flags |= D3DLOCK_DISCARD;
+		break;
+	case HBL_READ_ONLY:
+		flags |= D3DLOCK_READONLY;
+		break;
+	default: 
+		break;
+	};
+	
+	if(mSurface) 
+	{
+		// Surface
+		D3DLOCKED_RECT lrect; // Filled in by D3D
+		HRESULT hr;
+
+		if (lockBox.left == 0 && lockBox.top == 0 
+			&& lockBox.right == mWidth && lockBox.bottom == mHeight)
+		{
+			// Lock whole surface
+			hr = mSurface->LockRect(&lrect, NULL, flags);
+		}
+		else
+		{
+			RECT prect = toD3DRECT(lockBox); // specify range to lock
+			hr = mSurface->LockRect(&lrect, &prect, flags);
+		}
+		if (FAILED(hr))		
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Surface locking failed",
+		 		"D3D9HardwarePixelBuffer::lockImpl");
+		fromD3DLock(rval, lrect);
+	} 
+	else 
+	{
+		// Volume
+		D3DBOX pbox = toD3DBOX(lockBox); // specify range to lock
+		D3DLOCKED_BOX lbox; // Filled in by D3D
+		
+		if(mVolume->LockBox(&lbox, &pbox, flags) != D3D_OK)
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Volume locking failed",
+		 		"D3D9HardwarePixelBuffer::lockImpl");
+		fromD3DLock(rval, lbox);
+	}
+
+	return rval;
+}
+//-----------------------------------------------------------------------------  
+void D3D9HardwarePixelBuffer::unlockImpl(void)
+{
+	if(mSurface) 
+	{
+		// Surface
+		mSurface->UnlockRect();
+	} else {
+		// Volume
+		mVolume->UnlockBox();
+	}
+	if(mDoMipmapGen)
+		_genMipmaps();
+}
+//-----------------------------------------------------------------------------  
+void D3D9HardwarePixelBuffer::blit(const HardwarePixelBufferSharedPtr &rsrc, const Image::Box &srcBox, const Image::Box &dstBox)
+{
+	D3D9HardwarePixelBuffer *src = static_cast<D3D9HardwarePixelBuffer*>(rsrc.getPointer());
+	if(mSurface && src->mSurface)
+	{
+		// Surface-to-surface
+		RECT dsrcRect = toD3DRECT(srcBox);
+		RECT ddestRect = toD3DRECT(dstBox);
+		// D3DXLoadSurfaceFromSurface
+		if(D3DXLoadSurfaceFromSurface(
+			mSurface, NULL, &ddestRect, 
+			src->mSurface, NULL, &dsrcRect,
+			 D3DX_DEFAULT, 0) != D3D_OK)
+		{
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "D3DXLoadSurfaceFromSurface failed",
+		 		"D3D9HardwarePixelBuffer::blit");
+		}
+	}
+	else if(mVolume && src->mVolume)
+	{
+		// Volume-to-volume
+		D3DBOX dsrcBox = toD3DBOX(srcBox);
+		D3DBOX ddestBox = toD3DBOX(dstBox);
+		
+		// D3DXLoadVolumeFromVolume
+		if(D3DXLoadVolumeFromVolume(
+			mVolume, NULL, &ddestBox, 
+			src->mVolume, NULL, &dsrcBox,
+			 D3DX_DEFAULT, 0) != D3D_OK)
+		{
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "D3DXLoadVolumeFromVolume failed",
+		 		"D3D9HardwarePixelBuffer::blit");
+		}
+	}
+	else
+	{
+        // Software fallback   
+		HardwarePixelBuffer::blit(rsrc, srcBox, dstBox);
+	}
+}
+//-----------------------------------------------------------------------------  
+void D3D9HardwarePixelBuffer::blitFromMemory(const PixelBox &src, const Image::Box &dstBox)
+{
+	// for scoped deletion of conversion buffer
+	MemoryDataStreamPtr buf;
+	PixelBox converted = src;
+
+	// convert to pixelbuffer's native format if necessary
+	if (D3D9Mappings::_getPF(src.format) == D3DFMT_UNKNOWN)
+	{
+		buf.bind(new MemoryDataStream(
+			PixelUtil::getMemorySize(src.getWidth(), src.getHeight(), src.getDepth(),
+										mFormat)));
+		converted = PixelBox(src.getWidth(), src.getHeight(), src.getDepth(), mFormat, buf->getPtr());
+		PixelUtil::bulkPixelConversion(src, converted);
+	}
+
+	size_t rowWidth;
+	if (PixelUtil::isCompressed(converted.format))
+	{
+		// D3D wants the width of one row of cells in bytes
+		if (converted.format == PF_DXT1)
+		{
+			// 64 bits (8 bytes) per 4x4 block
+			rowWidth = (converted.rowPitch / 4) * 8;
+		}
+		else
+		{
+			// 128 bits (16 bytes) per 4x4 block
+			rowWidth = (converted.rowPitch / 4) * 16;
+		}
+
+	}
+	else
+	{
+		rowWidth = converted.rowPitch * PixelUtil::getNumElemBytes(converted.format);
+	}
+	if(mSurface)
+	{
+		RECT destRect, srcRect;
+		srcRect = toD3DRECTExtent(converted);
+		destRect = toD3DRECT(dstBox);
+		
+		if(D3DXLoadSurfaceFromMemory(mSurface, NULL, &destRect, 
+			converted.data, D3D9Mappings::_getPF(converted.format),
+			rowWidth,
+			NULL, &srcRect, D3DX_DEFAULT, 0) != D3D_OK)
+		{
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "D3DXLoadSurfaceFromMemory failed",
+		 		"D3D9HardwarePixelBuffer::blitFromMemory");
+		}
+	}
+	else
+	{
+		D3DBOX destBox, srcBox;
+		srcBox = toD3DBOXExtent(converted);
+		destBox = toD3DBOX(dstBox);
+		size_t sliceWidth;
+		if (PixelUtil::isCompressed(converted.format))
+		{
+			// D3D wants the width of one slice of cells in bytes
+			if (converted.format == PF_DXT1)
+			{
+				// 64 bits (8 bytes) per 4x4 block
+				sliceWidth = (converted.slicePitch / 16) * 8;
+			}
+			else
+			{
+				// 128 bits (16 bytes) per 4x4 block
+				sliceWidth = (converted.slicePitch / 16) * 16;
+			}
+
+		}
+		else
+		{
+			sliceWidth = converted.slicePitch * PixelUtil::getNumElemBytes(converted.format);
+		}
+		
+		if(D3DXLoadVolumeFromMemory(mVolume, NULL, &destBox, 
+			converted.data, D3D9Mappings::_getPF(converted.format),
+			rowWidth, sliceWidth,
+			NULL, &srcBox, D3DX_DEFAULT, 0) != D3D_OK)
+		{
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "D3DXLoadSurfaceFromMemory failed",
+		 		"D3D9HardwarePixelBuffer::blitFromMemory");
+		}
+	}
+	if(mDoMipmapGen)
+		_genMipmaps();
+}
+//-----------------------------------------------------------------------------  
+void D3D9HardwarePixelBuffer::blitToMemory(const Image::Box &srcBox, const PixelBox &dst)
+{
+	// Decide on pixel format of temp surface
+	PixelFormat tmpFormat = mFormat; 
+	if(D3D9Mappings::_getPF(dst.format) != D3DFMT_UNKNOWN)
+	{
+		tmpFormat = dst.format;
+	}
+
+
+	if(mSurface)
+	{
+		assert(srcBox.getDepth() == 1 && dst.getDepth() == 1);
+		// Create temp texture
+		IDirect3DTexture9 *tmp;
+		IDirect3DSurface9 *surface;
+
+		D3DSURFACE_DESC srcDesc;
+		if(mSurface->GetDesc(&srcDesc) != D3D_OK)
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Could not get surface information",
+			"D3D9HardwarePixelBuffer::blitToMemory");
+	
+		D3DPOOL temppool = D3DPOOL_SCRATCH;
+		// if we're going to try to use GetRenderTargetData, need to use system mem pool
+		bool tryGetRenderTargetData = false;
+		if (((srcDesc.Usage & D3DUSAGE_RENDERTARGET) != 0) &&
+			(srcBox.getWidth() == dst.getWidth()) && (srcBox.getHeight() == dst.getHeight()) &&
+			(srcBox.getWidth() == getWidth()) && (srcBox.getHeight() == getHeight()) &&
+			(mFormat == tmpFormat))
+		{
+			tryGetRenderTargetData = true;
+			temppool = D3DPOOL_SYSTEMMEM;
+		}
+
+		if(D3DXCreateTexture(
+			mpDev,
+			dst.getWidth(), dst.getHeight(), 
+			1, // 1 mip level ie topmost, generate no mipmaps
+			0, D3D9Mappings::_getPF(tmpFormat), temppool,
+			&tmp
+			) != D3D_OK)
+		{
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Create temporary texture failed",
+		 		"D3D9HardwarePixelBuffer::blitToMemory");
+		}
+		if(tmp->GetSurfaceLevel(0, &surface) != D3D_OK)
+		{
+			tmp->Release();
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Get surface level failed",
+				"D3D9HardwarePixelBuffer::blitToMemory");
+		}
+		// Copy texture to this temp surface
+		RECT destRect, srcRect;
+		srcRect = toD3DRECT(srcBox);
+		destRect = toD3DRECTExtent(dst);
+		
+        // Get the real temp surface format
+        D3DSURFACE_DESC dstDesc;
+        if(surface->GetDesc(&dstDesc) != D3D_OK)
+            OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Could not get surface information",
+            "D3D9HardwarePixelBuffer::blitToMemory");
+        tmpFormat = D3D9Mappings::_getPF(dstDesc.Format);
+
+        // Use fast GetRenderTargetData if we are in its usage conditions
+		bool fastLoadSuccess = false;
+        if (tryGetRenderTargetData)
+        {
+            if(mpDev->GetRenderTargetData(mSurface, surface) == D3D_OK)
+			{
+				fastLoadSuccess = true;
+			}
+        }
+		if (!fastLoadSuccess)
+        {
+            if(D3DXLoadSurfaceFromSurface(
+                surface, NULL, &destRect, 
+                mSurface, NULL, &srcRect,
+                D3DX_DEFAULT, 0) != D3D_OK)
+            {
+                surface->Release();
+                tmp->Release();
+                OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "D3DXLoadSurfaceFromSurface failed",
+                    "D3D9HardwarePixelBuffer::blitToMemory");
+            }
+        }
+
+        // Lock temp surface and copy it to memory
+		D3DLOCKED_RECT lrect; // Filled in by D3D
+		if(surface->LockRect(&lrect, NULL,  D3DLOCK_READONLY) != D3D_OK)
+		{
+			surface->Release();
+			tmp->Release();
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "surface->LockRect",
+		 		"D3D9HardwarePixelBuffer::blitToMemory");
+		}
+		// Copy it
+		PixelBox locked(dst.getWidth(), dst.getHeight(), dst.getDepth(), tmpFormat);
+		fromD3DLock(locked, lrect);
+		PixelUtil::bulkPixelConversion(locked, dst);
+		surface->UnlockRect();
+		// Release temporary surface and texture
+		surface->Release();
+		tmp->Release();
+	}
+	else
+	{
+		// Create temp texture
+		IDirect3DVolumeTexture9 *tmp;
+		IDirect3DVolume9 *surface;
+	
+		if(D3DXCreateVolumeTexture(
+			mpDev,
+			dst.getWidth(), dst.getHeight(), dst.getDepth(), 0,
+			0, D3D9Mappings::_getPF(tmpFormat), D3DPOOL_SCRATCH,
+			&tmp
+			) != D3D_OK)
+		{
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Create temporary texture failed",
+		 		"D3D9HardwarePixelBuffer::blitToMemory");
+		}
+		if(tmp->GetVolumeLevel(0, &surface) != D3D_OK)
+		{
+			tmp->Release();
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Get volume level failed",
+				"D3D9HardwarePixelBuffer::blitToMemory");
+		}
+		// Volume
+		D3DBOX ddestBox, dsrcBox;
+		ddestBox = toD3DBOXExtent(dst);
+		dsrcBox = toD3DBOX(srcBox);
+		
+		if(D3DXLoadVolumeFromVolume(
+			surface, NULL, &ddestBox, 
+			mVolume, NULL, &dsrcBox,
+			 D3DX_DEFAULT, 0) != D3D_OK)
+		{
+			surface->Release();
+			tmp->Release();
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "D3DXLoadVolumeFromVolume failed",
+		 		"D3D9HardwarePixelBuffer::blitToMemory");
+		}
+		// Lock temp surface and copy it to memory
+		D3DLOCKED_BOX lbox; // Filled in by D3D
+		if(surface->LockBox(&lbox, NULL,  D3DLOCK_READONLY) != D3D_OK)
+		{
+			surface->Release();
+			tmp->Release();
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "surface->LockBox",
+		 		"D3D9HardwarePixelBuffer::blitToMemory");
+		}
+		// Copy it
+		PixelBox locked(dst.getWidth(), dst.getHeight(), dst.getDepth(), tmpFormat);
+		fromD3DLock(locked, lbox);
+		PixelUtil::bulkPixelConversion(locked, dst);
+		surface->UnlockBox();
+		// Release temporary surface and texture
+		surface->Release();
+		tmp->Release();
+	}
+}
+//-----------------------------------------------------------------------------  
+void D3D9HardwarePixelBuffer::_genMipmaps()
+{
+	assert(mMipTex);
+	// Mipmapping
+	if (mHWMipmaps)
+	{
+		// Hardware mipmaps
+		mMipTex->GenerateMipSubLevels();
+	}
+	else
+	{
+		// Software mipmaps
+		if( D3DXFilterTexture( mMipTex, NULL, D3DX_DEFAULT, D3DX_DEFAULT ) != D3D_OK )
+		{
+			OGRE_EXCEPT( Exception::ERR_RENDERINGAPI_ERROR, 
+			"Failed to filter texture (generate mipmaps)",
+			 "D3D9HardwarePixelBuffer::_genMipmaps" );
+		}
+	}
+
+}
+//----------------------------------------------------------------------------- 
+void D3D9HardwarePixelBuffer::_setMipmapping(bool doMipmapGen, bool HWMipmaps, IDirect3DBaseTexture9 *mipTex)
+{
+	mDoMipmapGen = doMipmapGen;
+	mHWMipmaps = HWMipmaps;
+	mMipTex = mipTex;
+}
+//-----------------------------------------------------------------------------    
+RenderTexture *D3D9HardwarePixelBuffer::getRenderTarget(size_t zoffset)
+{
+    assert(mUsage & TU_RENDERTARGET);
+    assert(zoffset < mDepth);
+    return mSliceTRT[zoffset];
+}
+//-----------------------------------------------------------------------------    
+void D3D9HardwarePixelBuffer::createRenderTextures(bool update)
+{
+    if (update)
+    {
+        assert(mSliceTRT.size() == mDepth);
+        for (SliceTRT::const_iterator it = mSliceTRT.begin(); it != mSliceTRT.end(); ++it)
+        {
+            D3D9RenderTexture *trt = static_cast<D3D9RenderTexture*>(*it);
+            trt->rebind(this);
+        }
+        return;
+    }
+
+	destroyRenderTextures();
+	if(!mSurface)
+	{
+		OGRE_EXCEPT( Exception::ERR_RENDERINGAPI_ERROR, 
+			"Rendering to 3D slices not supported yet for Direct3D",
+			 "D3D9HardwarePixelBuffer::createRenderTexture");
+	}
+	// Create render target for each slice
+    mSliceTRT.reserve(mDepth);
+	assert(mDepth==1);
+    for(size_t zoffset=0; zoffset<mDepth; ++zoffset)
+    {
+        String name;
+		name = "rtt/"+Ogre::StringConverter::toString((size_t)mSurface);
+		
+        RenderTexture *trt = new D3D9RenderTexture(name, this);
+        mSliceTRT.push_back(trt);
+        Root::getSingleton().getRenderSystem()->attachRenderTarget(*trt);
+    }
+}
+//-----------------------------------------------------------------------------    
+void D3D9HardwarePixelBuffer::destroyRenderTextures()
+{
+	if(mSliceTRT.empty())
+		return;
+	// Delete all render targets that are not yet deleted via _clearSliceRTT
+    for(size_t zoffset=0; zoffset<mDepth; ++zoffset)
+    {
+        if(mSliceTRT[zoffset])
+            Root::getSingleton().getRenderSystem()->destroyRenderTarget(mSliceTRT[zoffset]->getName());
+    }
+}
+
+};
Index: /RenderSystems/Direct3D9/src/OgreD3D9HardwareVertexBuffer.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9HardwareVertexBuffer.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9HardwareVertexBuffer.cpp	(revision 5)
@@ -0,0 +1,155 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9HardwareVertexBuffer.h"
+#include "OgreD3D9Mappings.h"
+#include "OgreException.h"
+#include "OgreD3D9HardwareBufferManager.h"
+
+namespace Ogre {
+
+	//---------------------------------------------------------------------
+    D3D9HardwareVertexBuffer::D3D9HardwareVertexBuffer(size_t vertexSize, 
+        size_t numVertices, HardwareBuffer::Usage usage, LPDIRECT3DDEVICE9 pDev, 
+        bool useSystemMemory, bool useShadowBuffer)
+        : HardwareVertexBuffer(vertexSize, numVertices, usage, useSystemMemory, useShadowBuffer)
+    {
+        // Create the vertex buffer
+#if OGRE_D3D_MANAGE_BUFFERS
+		mD3DPool = useSystemMemory? D3DPOOL_SYSTEMMEM : 
+			// If not system mem, use managed pool UNLESS buffer is discardable
+			// if discardable, keeping the software backing is expensive
+			(usage & HardwareBuffer::HBU_DISCARDABLE)? D3DPOOL_DEFAULT : D3DPOOL_MANAGED;
+#else
+		mD3DPool = useSystemMemory? D3DPOOL_SYSTEMMEM : D3DPOOL_DEFAULT;
+#endif
+        HRESULT hr = pDev->CreateVertexBuffer(
+            static_cast<UINT>(mSizeInBytes), 
+            D3D9Mappings::get(usage), 
+            0, // No FVF here, thankyou
+			mD3DPool,
+            &mlpD3DBuffer,
+            NULL);
+        if (FAILED(hr))
+        {
+			String msg = DXGetErrorDescription9(hr);
+            OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+				"Cannot create D3D9 vertex buffer: " + msg, 
+                "D3D9HardwareVertexBuffer::D3D9HardwareVertexBuffer");
+        }
+
+    }
+	//---------------------------------------------------------------------
+    D3D9HardwareVertexBuffer::~D3D9HardwareVertexBuffer()
+    {
+        SAFE_RELEASE(mlpD3DBuffer);
+    }
+	//---------------------------------------------------------------------
+    void* D3D9HardwareVertexBuffer::lockImpl(size_t offset, 
+        size_t length, LockOptions options)
+    {
+        void* pBuf;
+        HRESULT hr = mlpD3DBuffer->Lock(
+            static_cast<UINT>(offset), 
+            static_cast<UINT>(length), 
+            &pBuf,
+            D3D9Mappings::get(options, mUsage));
+
+        if (FAILED(hr))
+        {
+			String msg = DXGetErrorDescription9(hr);
+            OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+				"Cannot lock D3D9 vertex buffer: " + msg, 
+                "D3D9HardwareVertexBuffer::lock");
+        }
+
+        return pBuf;
+    }
+	//---------------------------------------------------------------------
+	void D3D9HardwareVertexBuffer::unlockImpl(void)
+    {
+        HRESULT hr = mlpD3DBuffer->Unlock();
+    }
+	//---------------------------------------------------------------------
+    void D3D9HardwareVertexBuffer::readData(size_t offset, size_t length, 
+        void* pDest)
+    {
+        // There is no functional interface in D3D, just do via manual 
+        // lock, copy & unlock
+        void* pSrc = this->lock(offset, length, HardwareBuffer::HBL_READ_ONLY);
+        memcpy(pDest, pSrc, length);
+        this->unlock();
+
+    }
+	//---------------------------------------------------------------------
+    void D3D9HardwareVertexBuffer::writeData(size_t offset, size_t length, 
+            const void* pSource,
+			bool discardWholeBuffer)
+    {
+        // There is no functional interface in D3D, just do via manual 
+        // lock, copy & unlock
+        void* pDst = this->lock(offset, length, 
+            discardWholeBuffer ? HardwareBuffer::HBL_DISCARD : HardwareBuffer::HBL_NORMAL);
+        memcpy(pDst, pSource, length);
+        this->unlock();
+    }
+	//---------------------------------------------------------------------
+	bool D3D9HardwareVertexBuffer::releaseIfDefaultPool(void)
+	{
+		if (mD3DPool == D3DPOOL_DEFAULT)
+		{
+			SAFE_RELEASE(mlpD3DBuffer);
+			return true;
+		}
+		return false;
+	}
+	//---------------------------------------------------------------------
+	bool D3D9HardwareVertexBuffer::recreateIfDefaultPool(LPDIRECT3DDEVICE9 pDev)
+	{
+		if (mD3DPool == D3DPOOL_DEFAULT)
+		{
+			HRESULT hr = pDev->CreateVertexBuffer(
+				static_cast<UINT>(mSizeInBytes), 
+				D3D9Mappings::get(mUsage), 
+				0, // No FVF here, thankyou
+				mD3DPool,
+				&mlpD3DBuffer,
+				NULL);
+			if (FAILED(hr))
+			{
+				String msg = DXGetErrorDescription9(hr);
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+					"Cannot restore D3D9 vertex buffer: " + msg, 
+					"D3D9HardwareVertexBuffer::recreateIfDefaultPool");
+			}
+			return true;
+		}
+		return false;
+	}
+	//---------------------------------------------------------------------
+}
Index: /RenderSystems/Direct3D9/src/OgreD3D9Mappings.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9Mappings.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9Mappings.cpp	(revision 5)
@@ -0,0 +1,776 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9Mappings.h"
+#include "OgreString.h"
+#include "OgreStringConverter.h"
+#include "OgreLogManager.h"
+#include "OgreException.h"
+
+namespace Ogre 
+{
+	//---------------------------------------------------------------------
+	DWORD D3D9Mappings::get(ShadeOptions so)
+	{
+		switch( so )
+		{
+		case SO_FLAT:
+			return D3DSHADE_FLAT;
+		case SO_GOURAUD:
+			return D3DSHADE_GOURAUD;
+		case SO_PHONG:
+			return D3DSHADE_PHONG;
+		}
+		return 0;
+	}
+	//---------------------------------------------------------------------
+	D3DLIGHTTYPE D3D9Mappings::get(Ogre::Light::LightTypes lightType)
+	{
+		switch( lightType )
+		{
+		case Light::LT_POINT:
+			return D3DLIGHT_POINT;
+		case Light::LT_DIRECTIONAL:
+			return D3DLIGHT_DIRECTIONAL;
+		case Light::LT_SPOTLIGHT:
+			return D3DLIGHT_SPOT;
+		}
+		return D3DLIGHT_FORCE_DWORD;
+	}
+	//---------------------------------------------------------------------
+	DWORD D3D9Mappings::get(TexCoordCalcMethod m, const D3DCAPS9& caps)
+	{
+		switch( m )
+		{
+		case TEXCALC_NONE:
+			return D3DTSS_TCI_PASSTHRU;
+		case TEXCALC_ENVIRONMENT_MAP_REFLECTION:
+			return D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR;
+		case TEXCALC_ENVIRONMENT_MAP_PLANAR:
+			if (caps.VertexProcessingCaps & D3DVTXPCAPS_TEXGEN_SPHEREMAP)
+			{
+				// Use sphere map if available
+				return D3DTSS_TCI_SPHEREMAP;
+			}
+			else
+			{
+				// If not, fall back on camera space reflection vector which isn't as good
+                return D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR;
+			}
+		case TEXCALC_ENVIRONMENT_MAP_NORMAL:
+			return D3DTSS_TCI_CAMERASPACENORMAL;
+		case TEXCALC_ENVIRONMENT_MAP:
+			if (caps.VertexProcessingCaps & D3DVTXPCAPS_TEXGEN_SPHEREMAP)
+			{
+				// Use sphere map if available
+				return D3DTSS_TCI_SPHEREMAP;
+			}
+			else
+			{
+				// If not, fall back on camera space normal which isn't as good
+				return D3DTSS_TCI_CAMERASPACENORMAL;
+			}
+        case TEXCALC_PROJECTIVE_TEXTURE:
+            return D3DTSS_TCI_CAMERASPACEPOSITION;
+		}
+		return 0;
+	}
+	//---------------------------------------------------------------------
+	D3DTEXTUREADDRESS D3D9Mappings::get(TextureUnitState::TextureAddressingMode tam, const D3DCAPS9& devCaps)
+	{
+		switch( tam )
+		{
+		case TextureUnitState::TAM_WRAP:
+			return D3DTADDRESS_WRAP;
+		case TextureUnitState::TAM_MIRROR:
+			return D3DTADDRESS_MIRROR;
+		case TextureUnitState::TAM_CLAMP:
+			return D3DTADDRESS_CLAMP;
+        case TextureUnitState::TAM_BORDER:
+            if (devCaps.TextureAddressCaps & D3DPTADDRESSCAPS_BORDER)
+                return D3DTADDRESS_BORDER;
+            else
+                return D3DTADDRESS_CLAMP;
+		}
+		return D3DTADDRESS_FORCE_DWORD;
+	}
+	//---------------------------------------------------------------------
+	D3DTEXTURESTAGESTATETYPE D3D9Mappings::get(LayerBlendType lbt)
+	{
+		switch( lbt )
+		{
+		case LBT_COLOUR:
+			return D3DTSS_COLOROP;
+		case LBT_ALPHA:
+			return D3DTSS_ALPHAOP;
+		}
+		return  D3DTSS_FORCE_DWORD;
+	}
+	//---------------------------------------------------------------------
+	DWORD D3D9Mappings::get(LayerBlendSource lbs, bool perStageConstants)
+	{
+		switch( lbs )
+		{
+		case LBS_CURRENT:
+			return D3DTA_CURRENT;
+		case LBS_TEXTURE:
+			return D3DTA_TEXTURE;
+		case LBS_DIFFUSE:
+			return D3DTA_DIFFUSE;
+		case LBS_SPECULAR:
+			return D3DTA_SPECULAR;
+		case LBS_MANUAL:
+			return perStageConstants ? D3DTA_CONSTANT : D3DTA_TFACTOR;
+		}
+		return 0;
+	}
+	//---------------------------------------------------------------------
+	DWORD D3D9Mappings::get(LayerBlendOperationEx lbo, const D3DCAPS9& devCaps)
+	{
+		switch( lbo )
+		{
+		case LBX_SOURCE1:
+			return D3DTOP_SELECTARG1;
+		case LBX_SOURCE2:
+			return D3DTOP_SELECTARG2;
+		case LBX_MODULATE:
+			return D3DTOP_MODULATE;
+		case LBX_MODULATE_X2:
+			return D3DTOP_MODULATE2X;
+		case LBX_MODULATE_X4:
+			return D3DTOP_MODULATE4X;
+		case LBX_ADD:
+			return D3DTOP_ADD;
+		case LBX_ADD_SIGNED:
+			return D3DTOP_ADDSIGNED;
+		case LBX_ADD_SMOOTH:
+			return D3DTOP_ADDSMOOTH;
+		case LBX_SUBTRACT:
+			return D3DTOP_SUBTRACT;
+		case LBX_BLEND_DIFFUSE_ALPHA:
+			return D3DTOP_BLENDDIFFUSEALPHA;
+		case LBX_BLEND_TEXTURE_ALPHA:
+			return D3DTOP_BLENDTEXTUREALPHA;
+		case LBX_BLEND_CURRENT_ALPHA:
+			return D3DTOP_BLENDCURRENTALPHA;
+		case LBX_BLEND_MANUAL:
+			return D3DTOP_BLENDFACTORALPHA;
+		case LBX_DOTPRODUCT:
+			if (devCaps.TextureOpCaps & D3DTEXOPCAPS_DOTPRODUCT3)
+				return D3DTOP_DOTPRODUCT3;
+			else
+				return D3DTOP_MODULATE;
+		case LBX_BLEND_DIFFUSE_COLOUR:
+			if (devCaps.TextureOpCaps & D3DTEXOPCAPS_LERP)
+				return D3DTOP_LERP;
+			else
+				return D3DTOP_MODULATE;
+		}
+		return 0;
+	}
+	//---------------------------------------------------------------------
+	D3DBLEND D3D9Mappings::get(SceneBlendFactor sbf)
+	{
+		switch( sbf )
+		{
+		case SBF_ONE:
+			return D3DBLEND_ONE;
+		case SBF_ZERO:
+			return D3DBLEND_ZERO;
+		case SBF_DEST_COLOUR:
+			return D3DBLEND_DESTCOLOR;
+		case SBF_SOURCE_COLOUR:
+			return D3DBLEND_SRCCOLOR;
+		case SBF_ONE_MINUS_DEST_COLOUR:
+			return D3DBLEND_INVDESTCOLOR;
+		case SBF_ONE_MINUS_SOURCE_COLOUR:
+			return D3DBLEND_INVSRCCOLOR;
+		case SBF_DEST_ALPHA:
+			return D3DBLEND_DESTALPHA;
+		case SBF_SOURCE_ALPHA:
+			return D3DBLEND_SRCALPHA;
+		case SBF_ONE_MINUS_DEST_ALPHA:
+			return D3DBLEND_INVDESTALPHA;
+		case SBF_ONE_MINUS_SOURCE_ALPHA:
+			return D3DBLEND_INVSRCALPHA;
+		}
+		return D3DBLEND_FORCE_DWORD;
+	}
+	//---------------------------------------------------------------------
+	DWORD D3D9Mappings::get(CompareFunction cf)
+	{
+		switch( cf )
+		{
+		case CMPF_ALWAYS_FAIL:
+			return D3DCMP_NEVER;
+		case CMPF_ALWAYS_PASS:
+			return D3DCMP_ALWAYS;
+		case CMPF_LESS:
+			return D3DCMP_LESS;
+		case CMPF_LESS_EQUAL:
+			return D3DCMP_LESSEQUAL;
+		case CMPF_EQUAL:
+			return D3DCMP_EQUAL;
+		case CMPF_NOT_EQUAL:
+			return D3DCMP_NOTEQUAL;
+		case CMPF_GREATER_EQUAL:
+			return D3DCMP_GREATEREQUAL;
+		case CMPF_GREATER:
+			return D3DCMP_GREATER;
+		};
+		return 0;
+	}
+	//---------------------------------------------------------------------
+	DWORD D3D9Mappings::get(CullingMode cm, bool flip)
+	{
+		switch( cm )
+		{
+		case CULL_NONE:
+			return D3DCULL_NONE;
+		case CULL_CLOCKWISE:
+			if( flip )
+				return D3DCULL_CCW;
+			else
+				return D3DCULL_CW;
+		case CULL_ANTICLOCKWISE:
+			if( flip )
+				return D3DCULL_CW;
+			else
+				return D3DCULL_CCW;
+		}
+		return 0;
+	}
+	//---------------------------------------------------------------------
+	D3DFOGMODE D3D9Mappings::get(FogMode fm)
+	{
+		switch( fm )
+		{
+		case FOG_EXP:
+			return D3DFOG_EXP;
+		case FOG_EXP2:
+			return D3DFOG_EXP2;
+		case FOG_LINEAR:
+			return D3DFOG_LINEAR;
+		}
+		return D3DFOG_FORCE_DWORD;
+	}
+	//---------------------------------------------------------------------
+	D3DFILLMODE D3D9Mappings::get(PolygonMode level)
+	{
+		switch(level)
+		{
+		case PM_POINTS:
+			return D3DFILL_POINT;
+		case PM_WIREFRAME:
+			return D3DFILL_WIREFRAME;
+		case PM_SOLID:
+			return D3DFILL_SOLID;
+		}
+		return D3DFILL_FORCE_DWORD;
+	}
+	//---------------------------------------------------------------------
+	DWORD D3D9Mappings::get(StencilOperation op, bool invert)
+	{
+		switch(op)
+		{
+		case SOP_KEEP:
+			return D3DSTENCILOP_KEEP;
+		case SOP_ZERO:
+			return D3DSTENCILOP_ZERO;
+		case SOP_REPLACE:
+			return D3DSTENCILOP_REPLACE;
+		case SOP_INCREMENT:
+            return invert? D3DSTENCILOP_DECRSAT : D3DSTENCILOP_INCRSAT;
+		case SOP_DECREMENT:
+            return invert? D3DSTENCILOP_INCRSAT : D3DSTENCILOP_DECRSAT;
+		case SOP_INCREMENT_WRAP:
+            return invert? D3DSTENCILOP_DECR : D3DSTENCILOP_INCR;
+		case SOP_DECREMENT_WRAP:
+            return invert? D3DSTENCILOP_INCR : D3DSTENCILOP_DECR;
+		case SOP_INVERT:
+			return D3DSTENCILOP_INVERT;
+		}
+		return 0;
+	}
+	//---------------------------------------------------------------------
+	D3DSAMPLERSTATETYPE D3D9Mappings::get(FilterType ft)
+    {
+        switch (ft)
+        {
+        case FT_MIN:
+            return D3DSAMP_MINFILTER;
+            break;
+        case FT_MAG:
+            return D3DSAMP_MAGFILTER;
+            break;
+        case FT_MIP:
+            return D3DSAMP_MIPFILTER;
+            break;
+        }
+
+        // to keep compiler happy
+        return D3DSAMP_MINFILTER;
+    }
+	//---------------------------------------------------------------------
+	DWORD D3D9Mappings::get(FilterType ft, FilterOptions fo, const D3DCAPS9& devCaps, 
+        eD3DTexType texType)
+	{
+		// Assume normal
+		DWORD capsType = devCaps.TextureFilterCaps;
+
+		switch( texType )
+		{
+		case D3D_TEX_TYPE_NORMAL:
+			capsType = devCaps.TextureFilterCaps;
+			break;
+		case D3D_TEX_TYPE_CUBE:
+			capsType = devCaps.CubeTextureFilterCaps;
+			break;
+		case D3D_TEX_TYPE_VOLUME:
+			capsType = devCaps.VolumeTextureFilterCaps;
+			break;
+		}
+
+        switch (ft)
+        {
+        case FT_MIN:
+            switch( fo )
+            {
+                // NOTE: Fall through if device doesn't support requested type
+            case FO_ANISOTROPIC:
+                if( capsType & D3DPTFILTERCAPS_MINFANISOTROPIC )
+                {
+                    return D3DTEXF_ANISOTROPIC;
+                    break;
+                }
+            case FO_LINEAR:
+                if( capsType & D3DPTFILTERCAPS_MINFLINEAR )
+                {
+                    return D3DTEXF_LINEAR;
+                    break;
+                }
+            case FO_POINT:
+            case FO_NONE:
+                return D3DTEXF_POINT;
+                break;
+            }
+            break;
+        case FT_MAG:
+            switch( fo )
+            {
+            // NOTE: Fall through if device doesn't support requested type
+            case FO_ANISOTROPIC:
+                if( capsType & D3DPTFILTERCAPS_MAGFANISOTROPIC )
+                {
+                    return D3DTEXF_ANISOTROPIC;
+                    break;
+                }
+            case FO_LINEAR:
+                if( capsType & D3DPTFILTERCAPS_MAGFLINEAR )
+                {
+                    return D3DTEXF_LINEAR;
+                    break;
+                }
+            case FO_POINT:
+            case FO_NONE:
+                return D3DTEXF_POINT;
+                break;
+            }
+            break;
+        case FT_MIP:
+            switch( fo )
+            {
+            case FO_ANISOTROPIC:
+            case FO_LINEAR:
+                if( capsType & D3DPTFILTERCAPS_MIPFLINEAR )
+                {
+                    return D3DTEXF_LINEAR;
+                    break;
+                }
+            case FO_POINT:
+                if( capsType & D3DPTFILTERCAPS_MIPFPOINT )
+                {
+                    return D3DTEXF_POINT;
+                    break;
+                }
+            case FO_NONE:
+                return D3DTEXF_NONE;
+                break;
+            }
+            break;
+        }
+
+        // should never get here
+        return 0;
+
+	}
+	//---------------------------------------------------------------------
+	D3D9Mappings::eD3DTexType D3D9Mappings::get(TextureType ogreTexType)
+	{
+		switch( ogreTexType )
+		{
+		case TEX_TYPE_1D :
+		case TEX_TYPE_2D :
+			return D3D9Mappings::D3D_TEX_TYPE_NORMAL;
+		case TEX_TYPE_CUBE_MAP :
+			return D3D9Mappings::D3D_TEX_TYPE_CUBE;
+		case TEX_TYPE_3D :
+            return D3D9Mappings::D3D_TEX_TYPE_VOLUME;
+		}
+		return D3D9Mappings::D3D_TEX_TYPE_NONE;
+	}
+	//---------------------------------------------------------------------
+    DWORD D3D9Mappings::get(HardwareBuffer::Usage usage)
+    {
+        DWORD ret = 0;
+        if (usage & HardwareBuffer::HBU_DYNAMIC)
+        {
+#if OGRE_D3D_MANAGE_BUFFERS
+            // Only add the dynamic flag for default pool, and
+            // we use default pool when buffer is discardable
+            if (usage & HardwareBuffer::HBU_DISCARDABLE)
+                ret |= D3DUSAGE_DYNAMIC;
+#else
+            ret |= D3DUSAGE_DYNAMIC;
+#endif
+        }
+        if (usage & HardwareBuffer::HBU_WRITE_ONLY)
+        {
+            ret |= D3DUSAGE_WRITEONLY;
+        }
+        return ret;
+    }
+	//---------------------------------------------------------------------
+    DWORD D3D9Mappings::get(HardwareBuffer::LockOptions options, HardwareBuffer::Usage usage)
+    {
+        DWORD ret = 0;
+        if (options == HardwareBuffer::HBL_DISCARD)
+        {
+#if OGRE_D3D_MANAGE_BUFFERS
+            // Only add the discard flag for dynamic usgae and default pool
+            if ((usage & HardwareBuffer::HBU_DYNAMIC) &&
+                (usage & HardwareBuffer::HBU_DISCARDABLE))
+                ret |= D3DLOCK_DISCARD;
+#else
+            // D3D doesn't like discard or no_overwrite on non-dynamic buffers
+            if (usage & HardwareBuffer::HBU_DYNAMIC)
+                ret |= D3DLOCK_DISCARD;
+#endif
+        }
+        if (options == HardwareBuffer::HBL_READ_ONLY)
+        {
+			// D3D debug runtime doesn't like you locking managed buffers readonly
+			// when they were created with write-only (even though you CAN read
+			// from the software backed version)
+			if (!(usage & HardwareBuffer::HBU_WRITE_ONLY))
+				ret |= D3DLOCK_READONLY;
+
+        }
+        if (options == HardwareBuffer::HBL_NO_OVERWRITE)
+        {
+#if OGRE_D3D_MANAGE_BUFFERS
+            // Only add the nooverwrite flag for dynamic usgae and default pool
+            if ((usage & HardwareBuffer::HBU_DYNAMIC) &&
+                (usage & HardwareBuffer::HBU_DISCARDABLE))
+                ret |= D3DLOCK_NOOVERWRITE;
+#else
+            // D3D doesn't like discard or no_overwrite on non-dynamic buffers
+            if (usage & HardwareBuffer::HBU_DYNAMIC)
+                ret |= D3DLOCK_NOOVERWRITE;
+#endif 
+        }
+
+        return ret;
+    }
+	//---------------------------------------------------------------------
+    D3DFORMAT D3D9Mappings::get(HardwareIndexBuffer::IndexType itype)
+    {
+        if (itype == HardwareIndexBuffer::IT_32BIT)
+        {
+            return D3DFMT_INDEX32;
+        }
+        else
+        {
+            return D3DFMT_INDEX16;
+        }
+    }
+	//---------------------------------------------------------------------
+	D3DDECLTYPE D3D9Mappings::get(VertexElementType vType)
+	{
+		switch (vType)
+		{
+		case VET_COLOUR:
+		case VET_COLOUR_ABGR:
+		case VET_COLOUR_ARGB:
+			return D3DDECLTYPE_D3DCOLOR;
+			break;
+		case VET_FLOAT1:
+			return D3DDECLTYPE_FLOAT1;
+			break;
+		case VET_FLOAT2:
+			return D3DDECLTYPE_FLOAT2;
+			break;
+		case VET_FLOAT3:
+			return D3DDECLTYPE_FLOAT3;
+			break;
+		case VET_FLOAT4:
+			return D3DDECLTYPE_FLOAT4;
+			break;
+        case VET_SHORT2:
+			return D3DDECLTYPE_SHORT2;
+			break;
+        case VET_SHORT4:
+			return D3DDECLTYPE_SHORT4;
+			break;
+        case VET_UBYTE4:
+            return D3DDECLTYPE_UBYTE4;
+            break;
+		}
+		// to keep compiler happy
+		return D3DDECLTYPE_FLOAT3;
+	}
+	//---------------------------------------------------------------------
+	D3DDECLUSAGE D3D9Mappings::get(VertexElementSemantic sem)
+	{
+		switch (sem)
+		{
+		case VES_BLEND_INDICES:
+			return D3DDECLUSAGE_BLENDINDICES;
+			break;
+		case VES_BLEND_WEIGHTS:
+			return D3DDECLUSAGE_BLENDWEIGHT;
+			break;
+		case VES_DIFFUSE:
+			return D3DDECLUSAGE_COLOR; // NB index will differentiate
+			break;
+		case VES_SPECULAR:
+			return D3DDECLUSAGE_COLOR; // NB index will differentiate
+			break;
+		case VES_NORMAL:
+			return D3DDECLUSAGE_NORMAL;
+			break;
+		case VES_POSITION:
+			return D3DDECLUSAGE_POSITION;
+			break;
+		case VES_TEXTURE_COORDINATES:
+			return D3DDECLUSAGE_TEXCOORD;
+			break;
+		case VES_BINORMAL:
+			return D3DDECLUSAGE_BINORMAL;
+			break;
+		case VES_TANGENT:
+			return D3DDECLUSAGE_TANGENT;
+			break;
+		}
+		// to keep compiler happy
+		return D3DDECLUSAGE_POSITION;
+	}
+	//---------------------------------------------------------------------
+	D3DXMATRIX D3D9Mappings::makeD3DXMatrix( const Matrix4& mat )
+	{
+		// Transpose matrix
+		// D3D9 uses row vectors i.e. V*M
+		// Ogre, OpenGL and everything else uses column vectors i.e. M*V
+		return D3DXMATRIX(
+            mat[0][0], mat[1][0], mat[2][0], mat[3][0],
+            mat[0][1], mat[1][1], mat[2][1], mat[3][1],
+            mat[0][2], mat[1][2], mat[2][2], mat[3][2],
+            mat[0][3], mat[1][3], mat[2][3], mat[3][3]);
+	}
+	//---------------------------------------------------------------------
+	Matrix4 D3D9Mappings::convertD3DXMatrix( const D3DXMATRIX& mat )
+	{
+		return Matrix4(
+            mat.m[0][0], mat.m[1][0], mat.m[2][0], mat.m[3][0],
+            mat.m[0][1], mat.m[1][1], mat.m[2][1], mat.m[3][1],
+            mat.m[0][2], mat.m[1][2], mat.m[2][2], mat.m[3][2],
+            mat.m[0][3], mat.m[1][3], mat.m[2][3], mat.m[3][3]);
+	}
+	/****************************************************************************************/
+	PixelFormat D3D9Mappings::_getPF(D3DFORMAT d3dPF)
+	{
+		switch(d3dPF)
+		{
+		case D3DFMT_A8:
+			return PF_A8;
+		case D3DFMT_L8:
+			return PF_L8;
+		case D3DFMT_L16:
+			return PF_L16;
+		case D3DFMT_A4L4:
+			return PF_A4L4;
+		case D3DFMT_A8L8:
+			return PF_BYTE_LA;	// Assume little endian here
+		case D3DFMT_R3G3B2:
+			return PF_R3G3B2;
+		case D3DFMT_A1R5G5B5:
+			return PF_A1R5G5B5;
+		case D3DFMT_A4R4G4B4:
+			return PF_A4R4G4B4;
+		case D3DFMT_R5G6B5:
+			return PF_R5G6B5;
+		case D3DFMT_R8G8B8:
+			return PF_R8G8B8;
+		case D3DFMT_X8R8G8B8:
+			return PF_X8R8G8B8;
+		case D3DFMT_A8R8G8B8:
+			return PF_A8R8G8B8;
+		case D3DFMT_X8B8G8R8:
+			return PF_X8B8G8R8;
+		case D3DFMT_A8B8G8R8:
+			return PF_A8B8G8R8;
+		case D3DFMT_A2R10G10B10:
+			return PF_A2R10G10B10;
+        case D3DFMT_A2B10G10R10:
+           return PF_A2B10G10R10;
+		case D3DFMT_R16F:
+			return PF_FLOAT16_R;
+		case D3DFMT_A16B16G16R16F:
+			return PF_FLOAT16_RGBA;
+		case D3DFMT_R32F:
+			return PF_FLOAT32_R;
+		case D3DFMT_G32R32F:
+			return PF_FLOAT32_GR;
+		case D3DFMT_A32B32G32R32F:
+			return PF_FLOAT32_RGBA;
+		case D3DFMT_G16R16F:
+			return PF_FLOAT16_GR;
+		case D3DFMT_A16B16G16R16:
+			return PF_SHORT_RGBA;
+		case D3DFMT_G16R16:
+			return PF_SHORT_GR;
+		case D3DFMT_DXT1:
+			return PF_DXT1;
+		case D3DFMT_DXT2:
+			return PF_DXT2;
+		case D3DFMT_DXT3:
+			return PF_DXT3;
+		case D3DFMT_DXT4:
+			return PF_DXT4;
+		case D3DFMT_DXT5:
+			return PF_DXT5;
+		default:
+			return PF_UNKNOWN;
+		}
+	}
+	/****************************************************************************************/
+	D3DFORMAT D3D9Mappings::_getPF(PixelFormat ogrePF)
+	{
+		switch(ogrePF)
+		{
+		case PF_L8:
+			return D3DFMT_L8;
+		case PF_L16:
+			return D3DFMT_L16;
+		case PF_A8:
+			return D3DFMT_A8;
+		case PF_A4L4:
+			return D3DFMT_A4L4;
+		case PF_BYTE_LA:
+			return D3DFMT_A8L8; // Assume little endian here
+		case PF_R3G3B2:
+			return D3DFMT_R3G3B2;
+		case PF_A1R5G5B5:
+			return D3DFMT_A1R5G5B5;
+		case PF_R5G6B5:
+			return D3DFMT_R5G6B5;
+		case PF_A4R4G4B4:
+			return D3DFMT_A4R4G4B4;
+		case PF_R8G8B8:
+			return D3DFMT_R8G8B8;
+		case PF_A8R8G8B8:
+			return D3DFMT_A8R8G8B8;
+		case PF_A8B8G8R8:
+			return D3DFMT_A8B8G8R8;
+		case PF_X8R8G8B8:
+			return D3DFMT_X8R8G8B8;
+		case PF_X8B8G8R8:
+			return D3DFMT_X8B8G8R8;
+		case PF_A2B10G10R10:
+            return D3DFMT_A2B10G10R10;
+		case PF_A2R10G10B10:
+			return D3DFMT_A2R10G10B10;
+		case PF_FLOAT16_R:
+			return D3DFMT_R16F;
+		case PF_FLOAT16_GR:
+			return D3DFMT_G16R16F;
+		case PF_FLOAT16_RGBA:
+			return D3DFMT_A16B16G16R16F;
+		case PF_FLOAT32_R:
+			return D3DFMT_R32F;
+		case PF_FLOAT32_GR:
+			return D3DFMT_G32R32F;
+		case PF_FLOAT32_RGBA:
+			return D3DFMT_A32B32G32R32F;
+		case PF_SHORT_RGBA:
+			return D3DFMT_A16B16G16R16;
+		case PF_SHORT_GR:
+			return D3DFMT_G16R16;
+		case PF_DXT1:
+			return D3DFMT_DXT1;
+		case PF_DXT2:
+			return D3DFMT_DXT2;
+		case PF_DXT3:
+			return D3DFMT_DXT3;
+		case PF_DXT4:
+			return D3DFMT_DXT4;
+		case PF_DXT5:
+			return D3DFMT_DXT5;
+		case PF_UNKNOWN:
+		default:
+			return D3DFMT_UNKNOWN;
+		}
+	}
+	/****************************************************************************************/
+	PixelFormat D3D9Mappings::_getClosestSupportedPF(PixelFormat ogrePF)
+	{
+		if (_getPF(ogrePF) != D3DFMT_UNKNOWN)
+		{
+			return ogrePF;
+		}
+		switch(ogrePF)
+		{
+		case PF_B5G6R5:
+			return PF_R5G6B5;
+		case PF_B8G8R8:
+			return PF_R8G8B8;
+		case PF_B8G8R8A8:
+			return PF_A8R8G8B8;
+        case PF_SHORT_RGB:
+            return PF_SHORT_RGBA;
+		case PF_FLOAT16_RGB:
+			return PF_FLOAT16_RGBA;
+		case PF_FLOAT32_RGB:
+			return PF_FLOAT32_RGBA;
+		case PF_UNKNOWN:
+		default:
+			return PF_A8R8G8B8;
+		}
+	}
+
+}
Index: /RenderSystems/Direct3D9/src/OgreD3D9MultiRenderTarget.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9MultiRenderTarget.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9MultiRenderTarget.cpp	(revision 5)
@@ -0,0 +1,133 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9MultiRenderTarget.h"
+#include "OgreD3D9HardwarePixelBuffer.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreBitwise.h"
+#include "OgreD3D9RenderSystem.h"
+#include "OgreRoot.h"
+
+namespace Ogre 
+{
+	D3D9MultiRenderTarget::D3D9MultiRenderTarget(const String &name):
+		MultiRenderTarget(name)
+	{
+		/// Clear targets
+		for(size_t x=0; x<OGRE_MAX_MULTIPLE_RENDER_TARGETS; ++x)
+		{
+			targets[x] = 0;
+		}
+	}
+	D3D9MultiRenderTarget::~D3D9MultiRenderTarget()
+	{
+	}
+
+	void D3D9MultiRenderTarget::bindSurface(size_t attachment, RenderTexture *target)
+	{
+		assert(attachment<OGRE_MAX_MULTIPLE_RENDER_TARGETS);
+		/// Get buffer and surface to bind to
+		D3D9HardwarePixelBuffer *buffer = 0;
+		target->getCustomAttribute("BUFFER", &buffer);
+		assert(buffer);
+
+		/// Find first non-null target
+		int y;
+		for(y=0; y<OGRE_MAX_MULTIPLE_RENDER_TARGETS && !targets[y]; ++y) ;
+		
+		if(y!=OGRE_MAX_MULTIPLE_RENDER_TARGETS)
+		{
+			/// If there is another target bound, compare sizes
+			if(targets[y]->getWidth() != buffer->getWidth() ||
+				targets[y]->getHeight() != buffer->getHeight() ||
+				PixelUtil::getNumElemBits(targets[y]->getFormat()) != 
+					PixelUtil::getNumElemBits(buffer->getFormat()))
+			{
+				OGRE_EXCEPT(
+					Exception::ERR_INVALIDPARAMS, 
+					"MultiRenderTarget surfaces are not of same size or bit depth", 
+					"D3D9MultiRenderTarget::bindSurface"
+				);
+			}
+		}
+
+		targets[attachment] = buffer;
+		checkAndUpdate();
+	}
+
+	void D3D9MultiRenderTarget::unbindSurface(size_t attachment)
+	{
+		assert(attachment<OGRE_MAX_MULTIPLE_RENDER_TARGETS);
+		targets[attachment] = 0;
+		checkAndUpdate();
+	}
+
+    void D3D9MultiRenderTarget::update(void)
+    {
+        D3D9RenderSystem* rs = static_cast<D3D9RenderSystem*>(
+            Root::getSingleton().getRenderSystem());
+        if (rs->isDeviceLost())
+            return;
+
+        MultiRenderTarget::update();
+    }
+
+	void D3D9MultiRenderTarget::getCustomAttribute(const String& name, void *pData)
+    {
+		if(name == "DDBACKBUFFER")
+        {
+            IDirect3DSurface9 ** pSurf = (IDirect3DSurface9 **)pData;
+			/// Transfer surfaces
+			for(size_t x=0; x<OGRE_MAX_MULTIPLE_RENDER_TARGETS; ++x)
+			{
+				if(targets[x])
+					pSurf[x] = targets[x]->getSurface();
+			}
+			return;
+        }
+	}
+
+	void D3D9MultiRenderTarget::checkAndUpdate()
+	{
+		if(targets[0])
+		{
+			mWidth = targets[0]->getWidth();
+			mHeight = targets[0]->getHeight();
+		}
+		else
+		{
+			mWidth = 0;
+			mHeight = 0;
+		}
+	}
+
+
+}
+
Index: /RenderSystems/Direct3D9/src/OgreD3D9Plugin.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9Plugin.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9Plugin.cpp	(revision 5)
@@ -0,0 +1,78 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreD3D9Plugin.h"
+#include "OgreRoot.h"
+
+namespace Ogre 
+{
+	const String sPluginName = "D3D9 RenderSystem";
+	//---------------------------------------------------------------------
+	D3D9Plugin::D3D9Plugin()
+		: mRenderSystem(0)
+	{
+
+	}
+	//---------------------------------------------------------------------
+	const String& D3D9Plugin::getName() const
+	{
+		return sPluginName;
+	}
+	//---------------------------------------------------------------------
+	void D3D9Plugin::install()
+	{
+		// Create the DirectX 9 rendering api
+#ifdef OGRE_STATIC_LIB
+		HINSTANCE hInst = GetModuleHandle( NULL );
+#else
+		HINSTANCE hInst = GetModuleHandle( "RenderSystem_Direct3D9.dll" );
+#endif
+		mRenderSystem = new D3D9RenderSystem( hInst );
+		// Register the render system
+		Root::getSingleton().addRenderSystem( mRenderSystem );
+	}
+	//---------------------------------------------------------------------
+	void D3D9Plugin::initialise()
+	{
+		// nothing to do
+	}
+	//---------------------------------------------------------------------
+	void D3D9Plugin::shutdown()
+	{
+		// nothing to do
+	}
+	//---------------------------------------------------------------------
+	void D3D9Plugin::uninstall()
+	{
+		delete mRenderSystem;
+		mRenderSystem = 0;
+	}
+
+
+}
Index: /RenderSystems/Direct3D9/src/OgreD3D9RenderSystem.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9RenderSystem.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9RenderSystem.cpp	(revision 5)
@@ -0,0 +1,3425 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9RenderSystem.h"
+#include "OgreD3D9Prerequisites.h"
+#include "OgreD3D9DriverList.h"
+#include "OgreD3D9Driver.h"
+#include "OgreD3D9VideoModeList.h"
+#include "OgreD3D9VideoMode.h"
+#include "OgreD3D9RenderWindow.h"
+#include "OgreD3D9TextureManager.h"
+#include "OgreD3D9Texture.h"
+#include "OgreLogManager.h"
+#include "OgreLight.h"
+#include "OgreMath.h"
+#include "OgreD3D9HardwareBufferManager.h"
+#include "OgreD3D9HardwareIndexBuffer.h"
+#include "OgreD3D9HardwareVertexBuffer.h"
+#include "OgreD3D9VertexDeclaration.h"
+#include "OgreD3D9GpuProgram.h"
+#include "OgreD3D9GpuProgramManager.h"
+#include "OgreD3D9HLSLProgramFactory.h"
+#include "OgreHighLevelGpuProgramManager.h"
+#include "OgreD3D9HardwareOcclusionQuery.h"
+#include "OgreFrustum.h"
+#include "OgreD3D9MultiRenderTarget.h"
+
+#define FLOAT2DWORD(f) *((DWORD*)&f)
+
+namespace Ogre 
+{
+
+	//---------------------------------------------------------------------
+	D3D9RenderSystem::D3D9RenderSystem( HINSTANCE hInstance )
+	{
+		LogManager::getSingleton().logMessage( "D3D9 : " + getName() + " created." );
+
+		// set the instance being passed 
+		mhInstance = hInstance;
+
+		// set pointers to NULL
+		mpD3D = NULL;
+		mpD3DDevice = NULL;
+		mDriverList = NULL;
+		mActiveD3DDriver = NULL;
+        mTextureManager = NULL;
+        mHardwareBufferManager = NULL;
+		mGpuProgramManager = NULL;
+		mPrimaryWindow = NULL;
+		mDeviceLost = false;
+		mBasicStatesInitialised = false;
+		mUseNVPerfHUD = false;
+        mHLSLProgramFactory = NULL;
+
+		// init lights
+		for(int i = 0; i < MAX_LIGHTS; i++ )
+			mLights[i] = 0;
+
+		// Create our Direct3D object
+		if( NULL == (mpD3D = Direct3DCreate9(D3D_SDK_VERSION)) )
+			OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR, "Failed to create Direct3D9 object", "D3D9RenderSystem::D3D9RenderSystem" );
+
+		// set config options defaults
+		initConfigOptions();
+
+		// fsaa options
+		mFSAAType = D3DMULTISAMPLE_NONE;
+		mFSAAQuality = 0;
+
+		// set stages desc. to defaults
+		for (size_t n = 0; n < OGRE_MAX_TEXTURE_LAYERS; n++)
+		{
+			mTexStageDesc[n].autoTexCoordType = TEXCALC_NONE;
+			mTexStageDesc[n].coordIndex = 0;
+			mTexStageDesc[n].texType = D3D9Mappings::D3D_TEX_TYPE_NORMAL;
+			mTexStageDesc[n].pTex = 0;
+			mTexStageDesc[n].pVertexTex = 0;
+		}
+
+		mLastVertexSourceCount = 0;
+
+        mCurrentLights = 0;
+
+		// Enumerate events
+		mEventNames.push_back("DeviceLost");
+		mEventNames.push_back("DeviceRestored");
+
+
+	}
+	//---------------------------------------------------------------------
+	D3D9RenderSystem::~D3D9RenderSystem()
+	{
+        shutdown();
+
+        // Deleting the HLSL program factory
+        if (mHLSLProgramFactory)
+        {
+            // Remove from manager safely
+            if (HighLevelGpuProgramManager::getSingletonPtr())
+                HighLevelGpuProgramManager::getSingleton().removeFactory(mHLSLProgramFactory);
+            delete mHLSLProgramFactory;
+            mHLSLProgramFactory = 0;
+        }
+
+		SAFE_RELEASE( mpD3D );
+
+		LogManager::getSingleton().logMessage( "D3D9 : " + getName() + " destroyed." );
+	}
+	//---------------------------------------------------------------------
+	const String& D3D9RenderSystem::getName() const
+	{
+		static String strName( "Direct3D9 Rendering Subsystem");
+		return strName;
+	}
+	//---------------------------------------------------------------------
+	D3D9DriverList* D3D9RenderSystem::getDirect3DDrivers()
+	{
+		if( !mDriverList )
+			mDriverList = new D3D9DriverList( mpD3D );
+
+		return mDriverList;
+	}
+	//---------------------------------------------------------------------
+	bool D3D9RenderSystem::_checkMultiSampleQuality(D3DMULTISAMPLE_TYPE type, DWORD *outQuality, D3DFORMAT format, UINT adapterNum, D3DDEVTYPE deviceType, BOOL fullScreen)
+	{
+		HRESULT hr;
+		hr = mpD3D->CheckDeviceMultiSampleType( 
+				adapterNum, 
+				deviceType, 
+				format, 
+				fullScreen, 
+				type, 
+				outQuality);
+
+		if (SUCCEEDED(hr))
+			return true;
+		else
+			return false;
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::initConfigOptions()
+	{
+		D3D9DriverList* driverList;
+		D3D9Driver* driver;
+
+		ConfigOption optDevice;
+		ConfigOption optVideoMode;
+		ConfigOption optFullScreen;
+		ConfigOption optVSync;
+		ConfigOption optAA;
+		ConfigOption optFPUMode;
+		ConfigOption optNVPerfHUD;
+
+		driverList = this->getDirect3DDrivers();
+
+		optDevice.name = "Rendering Device";
+		optDevice.currentValue.clear();
+		optDevice.possibleValues.clear();
+		optDevice.immutable = false;
+
+		optVideoMode.name = "Video Mode";
+		optVideoMode.currentValue = "800 x 600 @ 32-bit colour";
+		optVideoMode.immutable = false;
+
+		optFullScreen.name = "Full Screen";
+		optFullScreen.possibleValues.push_back( "Yes" );
+		optFullScreen.possibleValues.push_back( "No" );
+		optFullScreen.currentValue = "Yes";
+		optFullScreen.immutable = false;
+
+		for( unsigned j=0; j < driverList->count(); j++ )
+		{
+			driver = driverList->item(j);
+			optDevice.possibleValues.push_back( driver->DriverDescription() );
+			// Make first one default
+			if( j==0 )
+				optDevice.currentValue = driver->DriverDescription();
+		}
+
+		optVSync.name = "VSync";
+		optVSync.immutable = false;
+		optVSync.possibleValues.push_back( "Yes" );
+		optVSync.possibleValues.push_back( "No" );
+		optVSync.currentValue = "No";
+
+		optAA.name = "Anti aliasing";
+		optAA.immutable = false;
+		optAA.possibleValues.push_back( "None" );
+		optAA.currentValue = "None";
+
+		optFPUMode.name = "Floating-point mode";
+#if OGRE_DOUBLE_PRECISION
+		optFPUMode.currentValue = "Consistent";
+#else
+		optFPUMode.currentValue = "Fastest";
+#endif
+		optFPUMode.possibleValues.clear();
+		optFPUMode.possibleValues.push_back("Fastest");
+		optFPUMode.possibleValues.push_back("Consistent");
+		optFPUMode.immutable = false;
+
+		optNVPerfHUD.currentValue = "No";
+		optNVPerfHUD.immutable = false;
+		optNVPerfHUD.name = "Allow NVPerfHUD";
+		optNVPerfHUD.possibleValues.push_back( "Yes" );
+		optNVPerfHUD.possibleValues.push_back( "No" );
+
+		mOptions[optDevice.name] = optDevice;
+		mOptions[optVideoMode.name] = optVideoMode;
+		mOptions[optFullScreen.name] = optFullScreen;
+		mOptions[optVSync.name] = optVSync;
+		mOptions[optAA.name] = optAA;
+		mOptions[optFPUMode.name] = optFPUMode;
+		mOptions[optNVPerfHUD.name] = optNVPerfHUD;
+
+		refreshD3DSettings();
+
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::refreshD3DSettings()
+	{
+		ConfigOption* optVideoMode;
+		D3D9Driver* driver = 0;
+		D3D9VideoMode* videoMode;
+
+		ConfigOptionMap::iterator opt = mOptions.find( "Rendering Device" );
+		if( opt != mOptions.end() )
+		{
+			for( unsigned j=0; j < getDirect3DDrivers()->count(); j++ )
+			{
+				driver = getDirect3DDrivers()->item(j);
+				if( driver->DriverDescription() == opt->second.currentValue )
+					break;
+			}
+
+			if (driver)
+			{
+				opt = mOptions.find( "Video Mode" );
+				optVideoMode = &opt->second;
+				optVideoMode->possibleValues.clear();
+				// get vide modes for this device
+				for( unsigned k=0; k < driver->getVideoModeList()->count(); k++ )
+				{
+					videoMode = driver->getVideoModeList()->item( k );
+					optVideoMode->possibleValues.push_back( videoMode->getDescription() );
+				}
+
+                // Reset video mode to default if previous doesn't avail in new possible values
+                StringVector::const_iterator itValue =
+                    std::find(optVideoMode->possibleValues.begin(),
+                              optVideoMode->possibleValues.end(),
+                              optVideoMode->currentValue);
+                if (itValue == optVideoMode->possibleValues.end())
+                {
+                    optVideoMode->currentValue = "800 x 600 @ 32-bit colour";
+                }
+
+                // Also refresh FSAA options
+                refreshFSAAOptions();
+			}
+		}
+
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::setConfigOption( const String &name, const String &value )
+	{
+
+        StringUtil::StrStreamType str;
+        str << "D3D9 : RenderSystem Option: " << name << " = " << value;
+		LogManager::getSingleton().logMessage(str.str());
+
+        bool viewModeChanged = false;
+
+		// Find option
+		ConfigOptionMap::iterator it = mOptions.find( name );
+
+		// Update
+		if( it != mOptions.end() )
+			it->second.currentValue = value;
+		else
+		{
+            str.str(StringUtil::BLANK);
+            str << "Option named '" << name << "' does not exist.";
+			OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, str.str(), "D3D9RenderSystem::setConfigOption" );
+		}
+
+		// Refresh other options if D3DDriver changed
+		if( name == "Rendering Device" )
+			refreshD3DSettings();
+
+		if( name == "Full Screen" )
+		{
+			// Video mode is applicable
+			it = mOptions.find( "Video Mode" );
+			if (it->second.currentValue.empty())
+            {
+				it->second.currentValue = "800 x 600 @ 32-bit colour";
+                viewModeChanged = true;
+            }
+		}
+
+		if( name == "Anti aliasing" )
+		{
+			if (value == "None")
+				_setFSAA(D3DMULTISAMPLE_NONE, 0);
+			else 
+			{
+				D3DMULTISAMPLE_TYPE fsaa = D3DMULTISAMPLE_NONE;
+				DWORD level = 0;
+
+				if (StringUtil::startsWith(value, "NonMaskable", false))
+				{
+					fsaa = D3DMULTISAMPLE_NONMASKABLE;
+					size_t pos = value.find_last_of(" ");
+					String sNum = value.substr(pos + 1);
+					level = StringConverter::parseInt(sNum);
+					level -= 1;
+				}
+				else if (StringUtil::startsWith(value, "Level", false))
+				{
+					size_t pos = value.find_last_of(" ");
+					String sNum = value.substr(pos + 1);
+					fsaa = (D3DMULTISAMPLE_TYPE)StringConverter::parseInt(sNum);
+				}
+
+				_setFSAA(fsaa, level);
+			}
+		}
+
+		if( name == "VSync" )
+		{
+			if (value == "Yes")
+				mVSync = true;
+			else
+				mVSync = false;
+		}
+
+		if( name == "Allow NVPerfHUD" )
+		{
+			if (value == "Yes")
+				mUseNVPerfHUD = true;
+			else
+				mUseNVPerfHUD = false;
+		}
+
+		if (viewModeChanged || name == "Video Mode")
+		{
+            refreshFSAAOptions();
+		}
+
+	}
+	//---------------------------------------------------------------------
+    void D3D9RenderSystem::refreshFSAAOptions(void)
+    {
+
+        ConfigOptionMap::iterator it = mOptions.find( "Anti aliasing" );
+        ConfigOption* optFSAA = &it->second;
+        optFSAA->possibleValues.clear();
+        optFSAA->possibleValues.push_back("None");
+
+        it = mOptions.find("Rendering Device");
+        D3D9Driver *driver = getDirect3DDrivers()->item(it->second.currentValue);
+        if (driver)
+        {
+            it = mOptions.find("Video Mode");
+            D3D9VideoMode *videoMode = driver->getVideoModeList()->item(it->second.currentValue);
+            if (videoMode)
+            {
+                // get non maskable FSAA for this VMODE
+                DWORD numLevels = 0;
+                bool bOK = this->_checkMultiSampleQuality(
+                    D3DMULTISAMPLE_NONMASKABLE, 
+                    &numLevels, 
+                    videoMode->getFormat(), 
+                    driver->getAdapterNumber(),
+                    D3DDEVTYPE_HAL,
+                    TRUE);
+                if (bOK && numLevels > 0)
+                {
+                    for (DWORD n = 0; n < numLevels; n++)
+                        optFSAA->possibleValues.push_back("NonMaskable " + StringConverter::toString(n + 1));
+                }
+
+                // set maskable levels supported
+                for (unsigned int n = 2; n < 17; n++)
+                {
+                    bOK = this->_checkMultiSampleQuality(
+                        (D3DMULTISAMPLE_TYPE)n, 
+                        &numLevels, 
+                        videoMode->getFormat(), 
+                        driver->getAdapterNumber(),
+                        D3DDEVTYPE_HAL,
+                        TRUE);
+                    if (bOK)
+                        optFSAA->possibleValues.push_back("Level " + StringConverter::toString(n));
+                }
+            }
+        }
+
+        // Reset FSAA to none if previous doesn't avail in new possible values
+        StringVector::const_iterator itValue =
+            std::find(optFSAA->possibleValues.begin(),
+                      optFSAA->possibleValues.end(),
+                      optFSAA->currentValue);
+        if (itValue == optFSAA->possibleValues.end())
+        {
+            optFSAA->currentValue = "None";
+        }
+
+    }
+	//---------------------------------------------------------------------
+	String D3D9RenderSystem::validateConfigOptions()
+	{
+		ConfigOptionMap::iterator it;
+		
+		// check if video mode is selected
+		it = mOptions.find( "Video Mode" );
+		if (it->second.currentValue.empty())
+			return "A video mode must be selected.";
+
+		it = mOptions.find( "Rendering Device" );
+		bool foundDriver = false;
+		D3D9DriverList* driverList = getDirect3DDrivers();
+		for( ushort j=0; j < driverList->count(); j++ )
+		{
+			if( driverList->item(j)->DriverDescription() == it->second.currentValue )
+			{
+				foundDriver = true;
+				break;
+			}
+		}
+
+		if (!foundDriver)
+		{
+			// Just pick the first driver
+			setConfigOption("Rendering Device", driverList->item(0)->DriverDescription());
+			return "Your DirectX driver name has changed since the last time you ran OGRE; "
+				"the 'Rendering Device' has been changed.";
+		}
+
+        it = mOptions.find( "VSync" );
+		if( it->second.currentValue == "Yes" )
+			mVSync = true;
+		else
+			mVSync = false;
+
+        return StringUtil::BLANK;
+	}
+	//---------------------------------------------------------------------
+	ConfigOptionMap& D3D9RenderSystem::getConfigOptions()
+	{
+		// return a COPY of the current config options
+		return mOptions;
+	}
+	//---------------------------------------------------------------------
+	RenderWindow* D3D9RenderSystem::initialise( bool autoCreateWindow, const String& windowTitle )
+	{
+		RenderWindow* autoWindow = NULL;
+		LogManager::getSingleton().logMessage( "D3D9 : Subsystem Initialising" );
+
+		// Init using current settings
+		mActiveD3DDriver = NULL;
+		ConfigOptionMap::iterator opt = mOptions.find( "Rendering Device" );
+		for( unsigned j=0; j < getDirect3DDrivers()->count(); j++ )
+		{
+			if( getDirect3DDrivers()->item(j)->DriverDescription() == opt->second.currentValue )
+			{
+				mActiveD3DDriver = getDirect3DDrivers()->item(j);
+				break;
+			}
+		}
+
+		if( !mActiveD3DDriver )
+			OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, "Problems finding requested Direct3D driver!", "D3D9RenderSystem::initialise" );
+
+		if( autoCreateWindow )
+		{
+			bool fullScreen;
+			opt = mOptions.find( "Full Screen" );
+			if( opt == mOptions.end() )
+				OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR, "Can't find full screen option!", "D3D9RenderSystem::initialise" );
+			fullScreen = opt->second.currentValue == "Yes";
+
+			D3D9VideoMode* videoMode = NULL;
+			unsigned int width, height;
+			String temp;
+
+			opt = mOptions.find( "Video Mode" );
+			if( opt == mOptions.end() )
+				OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR, "Can't find Video Mode option!", "D3D9RenderSystem::initialise" );
+
+			// The string we are manipulating looks like this :width x height @ colourDepth
+			// Pull out the colour depth by getting what comes after the @ and a space
+			String colourDepth = opt->second.currentValue.substr(opt->second.currentValue.rfind('@')+1);
+			// Now we know that the width starts a 0, so if we can find the end we can parse that out
+			String::size_type widthEnd = opt->second.currentValue.find(' ');
+			// we know that the height starts 3 characters after the width and goes until the next space
+			String::size_type heightEnd = opt->second.currentValue.find(' ', widthEnd+3);
+			// Now we can parse out the values
+			width = StringConverter::parseInt(opt->second.currentValue.substr(0, widthEnd));
+			height = StringConverter::parseInt(opt->second.currentValue.substr(widthEnd+3, heightEnd));
+
+			for( unsigned j=0; j < mActiveD3DDriver->getVideoModeList()->count(); j++ )
+			{
+				temp = mActiveD3DDriver->getVideoModeList()->item(j)->getDescription();
+
+				// In full screen we only want to allow supported resolutions, so temp and opt->second.currentValue need to 
+				// match exacly, but in windowed mode we can allow for arbitrary window sized, so we only need
+				// to match the colour values
+				if(fullScreen && (temp == opt->second.currentValue) ||
+				  !fullScreen && (temp.substr(temp.rfind('@')+1) == colourDepth))
+				{
+					videoMode = mActiveD3DDriver->getVideoModeList()->item(j);
+					break;
+				}
+			}
+
+			if( !videoMode )
+				OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR, "Can't find requested video mode.", "D3D9RenderSystem::initialise" );
+			
+			NameValuePairList miscParams;
+			miscParams["colourDepth"] = StringConverter::toString(videoMode->getColourDepth());
+			miscParams["FSAA"] = StringConverter::toString(mFSAAType);
+			miscParams["FSAAQuality"] = StringConverter::toString(mFSAAQuality);
+			miscParams["vsync"] = StringConverter::toString(mVSync);
+			miscParams["useNVPerfHUD"] = StringConverter::toString(mUseNVPerfHUD);
+
+			autoWindow = this->createRenderWindow( windowTitle, width, height, 
+				fullScreen, &miscParams );
+
+            // If we have 16bit depth buffer enable w-buffering.
+            assert( autoWindow );
+            if ( autoWindow->getColourDepth() == 16 ) 
+            { 
+                mWBuffer = true;
+            } 
+            else 
+            {
+                mWBuffer = false;
+            }
+		}
+
+		LogManager::getSingleton().logMessage("***************************************");
+		LogManager::getSingleton().logMessage("*** D3D9 : Subsystem Initialised OK ***");
+		LogManager::getSingleton().logMessage("***************************************");
+
+		// call superclass method
+		RenderSystem::initialise( autoCreateWindow );
+
+
+		return autoWindow;
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setFSAA(D3DMULTISAMPLE_TYPE type, DWORD qualityLevel)
+	{
+		if (!mpD3DDevice)
+		{
+			mFSAAType = type;
+			mFSAAQuality = qualityLevel;
+		}
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::reinitialise()
+	{
+		LogManager::getSingleton().logMessage( "D3D9 : Reinitialising" );
+		this->shutdown();
+		this->initialise( true );
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::shutdown()
+	{
+		RenderSystem::shutdown();
+		mPrimaryWindow = NULL; // primary window deleted by base class.
+		freeDevice();
+		SAFE_DELETE( mDriverList );
+		mActiveD3DDriver = NULL;
+		mpD3DDevice = NULL;
+		mBasicStatesInitialised = false;
+		LogManager::getSingleton().logMessage("D3D9 : Shutting down cleanly.");
+		SAFE_DELETE( mTextureManager );
+		SAFE_DELETE( mHardwareBufferManager );
+		SAFE_DELETE( mGpuProgramManager );
+	}
+	//---------------------------------------------------------------------
+	RenderWindow* D3D9RenderSystem::createRenderWindow(const String &name, 
+		unsigned int width, unsigned int height, bool fullScreen,
+		const NameValuePairList *miscParams)
+	{
+
+		// Check we're not creating a secondary window when the primary
+		// was fullscreen
+		if (mPrimaryWindow && mPrimaryWindow->isFullScreen())
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"Cannot create secondary windows when the primary is full screen",
+				"D3D9RenderSystem::createRenderWindow");
+		}
+		if (mPrimaryWindow && fullScreen)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"Cannot create full screen secondary windows",
+				"D3D9RenderSystem::createRenderWindow");
+		}
+		
+		// Log a message
+		std::stringstream ss;
+		ss << "D3D9RenderSystem::createRenderWindow \"" << name << "\", " <<
+			width << "x" << height << " ";
+		if(fullScreen)
+			ss << "fullscreen ";
+		else
+			ss << "windowed ";
+		if(miscParams)
+		{
+			ss << " miscParams: ";
+			NameValuePairList::const_iterator it;
+			for(it=miscParams->begin(); it!=miscParams->end(); ++it)
+			{
+				ss << it->first << "=" << it->second << " ";
+			}
+			LogManager::getSingleton().logMessage(ss.str());
+		}
+		
+		String msg;
+
+		// Make sure we don't already have a render target of the 
+		// sam name as the one supplied
+		if( mRenderTargets.find( name ) != mRenderTargets.end() )
+		{
+			msg = "A render target of the same name '" + name + "' already "
+				"exists.  You cannot create a new window with this name.";
+			OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR, msg, "D3D9RenderSystem::createRenderWindow" );
+		}
+
+		RenderWindow* win = new D3D9RenderWindow(mhInstance, mActiveD3DDriver, 
+			mPrimaryWindow ? mpD3DDevice : 0);
+
+		win->create( name, width, height, fullScreen, miscParams);
+
+		attachRenderTarget( *win );
+
+		// If this is the first window, get the D3D device and create the texture manager
+		if( !mPrimaryWindow )
+		{
+			mPrimaryWindow = (D3D9RenderWindow *)win;
+			win->getCustomAttribute( "D3DDEVICE", &mpD3DDevice );
+
+			// Create the texture manager for use by others
+			mTextureManager = new D3D9TextureManager( mpD3DDevice );
+            // Also create hardware buffer manager
+            mHardwareBufferManager = new D3D9HardwareBufferManager(mpD3DDevice);
+
+			// Create the GPU program manager
+			mGpuProgramManager = new D3D9GpuProgramManager(mpD3DDevice);
+            // create & register HLSL factory
+			if (mHLSLProgramFactory == NULL)
+				mHLSLProgramFactory = new D3D9HLSLProgramFactory();
+            HighLevelGpuProgramManager::getSingleton().addFactory(mHLSLProgramFactory);
+            mGpuProgramManager->_pushSyntaxCode("hlsl");
+
+
+            // Initialise the capabilities structures
+            initCapabilities();
+
+		}
+		else
+		{
+			mSecondaryWindows.push_back(static_cast<D3D9RenderWindow *>(win));
+		}
+
+		return win;
+
+	}
+    //---------------------------------------------------------------------
+    void D3D9RenderSystem::initCapabilities(void)
+    {
+		// get caps
+		mpD3DDevice->GetDeviceCaps( &mCaps );
+
+        // Check for hardware stencil support
+		LPDIRECT3DSURFACE9 pSurf;
+		D3DSURFACE_DESC surfDesc;
+		mpD3DDevice->GetDepthStencilSurface(&pSurf);
+		pSurf->GetDesc(&surfDesc);
+		pSurf->Release();
+
+		if (surfDesc.Format == D3DFMT_D24S8 || surfDesc.Format == D3DFMT_D24X8)
+		{
+			mCapabilities->setCapability(RSC_HWSTENCIL);
+			// Actually, it's always 8-bit
+			mCapabilities->setStencilBufferBitDepth(8);
+
+		}
+
+		// Set number of texture units
+		mCapabilities->setNumTextureUnits(mCaps.MaxSimultaneousTextures);
+        // Anisotropy?
+        if (mCaps.MaxAnisotropy > 1)
+            mCapabilities->setCapability(RSC_ANISOTROPY);
+        // Automatic mipmap generation?
+        if (mCaps.Caps2 & D3DCAPS2_CANAUTOGENMIPMAP)
+            mCapabilities->setCapability(RSC_AUTOMIPMAP);
+        // Blending between stages supported
+        mCapabilities->setCapability(RSC_BLENDING);
+        // Dot 3
+        if (mCaps.TextureOpCaps & D3DTEXOPCAPS_DOTPRODUCT3)
+            mCapabilities->setCapability(RSC_DOT3);
+        // Cube map
+        if (mCaps.TextureCaps & D3DPTEXTURECAPS_CUBEMAP)
+            mCapabilities->setCapability(RSC_CUBEMAPPING);
+
+        // We always support compression, D3DX will decompress if device does not support
+        mCapabilities->setCapability(RSC_TEXTURE_COMPRESSION);
+        mCapabilities->setCapability(RSC_TEXTURE_COMPRESSION_DXT);
+
+        // We always support VBOs
+        mCapabilities->setCapability(RSC_VBO);
+
+        // Scissor test
+        if (mCaps.RasterCaps & D3DPRASTERCAPS_SCISSORTEST)
+            mCapabilities->setCapability(RSC_SCISSOR_TEST);
+
+        // Two-sided stencil
+        if (mCaps.StencilCaps & D3DSTENCILCAPS_TWOSIDED)
+            mCapabilities->setCapability(RSC_TWO_SIDED_STENCIL);
+
+        // stencil wrap
+        if ((mCaps.StencilCaps & D3DSTENCILCAPS_INCR) && 
+            (mCaps.StencilCaps & D3DSTENCILCAPS_DECR))
+            mCapabilities->setCapability(RSC_STENCIL_WRAP);
+
+        // Check for hardware occlusion support
+        if ( ( mpD3DDevice->CreateQuery(D3DQUERYTYPE_OCCLUSION,  NULL ) ) == D3D_OK )	
+        {
+            mCapabilities->setCapability(RSC_HWOCCLUSION);
+        }
+        convertVertexShaderCaps();
+        convertPixelShaderCaps();
+
+		// User clip planes
+        if (mCaps.MaxUserClipPlanes > 0)
+		{
+			mCapabilities->setCapability(RSC_USER_CLIP_PLANES);
+		}
+
+		// UBYTE4 type?
+		if (mCaps.DeclTypes & D3DDTCAPS_UBYTE4)
+		{
+			mCapabilities->setCapability(RSC_VERTEX_FORMAT_UBYTE4);
+		}
+
+		// Adapter details
+		const D3DADAPTER_IDENTIFIER9& adapterID = mActiveD3DDriver->getAdapterIdentifier();
+
+		// Infinite projection?
+		// We have no capability for this, so we have to base this on our
+		// experience and reports from users
+		// Non-vertex program capable hardware does not appear to support it
+		if (mCapabilities->hasCapability(RSC_VERTEX_PROGRAM))
+		{
+			// GeForce4 Ti (and presumably GeForce3) does not
+			// render infinite projection properly, even though it does in GL
+            // So exclude all cards prior to the FX range from doing infinite
+			if (adapterID.VendorId != 0x10DE || // not nVidia
+				!((adapterID.DeviceId >= 0x200 && adapterID.DeviceId <= 0x20F) || //gf3
+				  (adapterID.DeviceId >= 0x250 && adapterID.DeviceId <= 0x25F) || //gf4ti
+				  (adapterID.DeviceId >= 0x280 && adapterID.DeviceId <= 0x28F) || //gf4ti
+				  (adapterID.DeviceId >= 0x170 && adapterID.DeviceId <= 0x18F) || //gf4 go
+				  (adapterID.DeviceId >= 0x280 && adapterID.DeviceId <= 0x28F)))  //gf4ti go
+			{
+				mCapabilities->setCapability(RSC_INFINITE_FAR_PLANE);
+			}
+			
+		}
+		
+		// 3D textures?
+		if (mCaps.TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP)
+		{
+			mCapabilities->setCapability(RSC_TEXTURE_3D);
+		}
+		
+        if ((mCaps.TextureCaps & D3DPTEXTURECAPS_POW2) == 0)
+		{
+			// unrestricted non POW2
+			mCapabilities->setCapability(RSC_NON_POWER_OF_2_TEXTURES);
+		}
+		else if (mCaps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL)
+		{
+			// Conditional support for non POW2
+			mCapabilities->setCapability(RSC_NON_POWER_OF_2_TEXTURES);
+			mCapabilities->setNonPOW2TexturesLimited(true);
+
+		}
+
+		// We always support rendertextures bigger than the frame buffer
+        mCapabilities->setCapability(RSC_HWRENDER_TO_TEXTURE);
+
+		// Determine if any floating point texture format is supported
+		D3DFORMAT floatFormats[6] = {D3DFMT_R16F, D3DFMT_G16R16F, 
+			D3DFMT_A16B16G16R16F, D3DFMT_R32F, D3DFMT_G32R32F, 
+			D3DFMT_A32B32G32R32F};
+		LPDIRECT3DSURFACE9 bbSurf;
+		mPrimaryWindow->getCustomAttribute("DDBACKBUFFER", &bbSurf);
+		D3DSURFACE_DESC bbSurfDesc;
+		bbSurf->GetDesc(&bbSurfDesc);
+		
+		for (int i = 0; i < 6; ++i)
+		{
+			if (SUCCEEDED(mpD3D->CheckDeviceFormat(mActiveD3DDriver->getAdapterNumber(), 
+				D3DDEVTYPE_HAL, bbSurfDesc.Format, 
+				0, D3DRTYPE_TEXTURE, floatFormats[i])))
+			{
+				mCapabilities->setCapability(RSC_TEXTURE_FLOAT);
+				break;
+			}
+			
+		}
+		
+		// Number of render targets
+		mCapabilities->setNumMultiRenderTargets(std::min((ushort)mCaps.NumSimultaneousRTs, (ushort)OGRE_MAX_MULTIPLE_RENDER_TARGETS));
+
+		//
+		if(mCaps.PrimitiveMiscCaps & D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS)
+		{
+			LogManager::getSingleton().logMessage("Multiple render targets with independent bit depths supported");
+		}
+
+		// Point sprites 
+		if (mCaps.MaxPointSize > 1.0f)
+		{
+			mCapabilities->setCapability(RSC_POINT_SPRITES);
+			// sprites and extended parameters go together in D3D
+			mCapabilities->setCapability(RSC_POINT_EXTENDED_PARAMETERS);
+			mCapabilities->setMaxPointSize(mCaps.MaxPointSize);
+		}
+
+		// Vertex textures
+		if (mGpuProgramManager->isSyntaxSupported("vs_3_0"))
+		{
+			// Run through all the texture formats looking for any which support
+			// vertex texture fetching. Must have at least one!
+			// All ATI Radeon up to X1n00 say they support vs_3_0, 
+			// but they support no texture formats for vertex texture fetch (cheaters!)
+			if (checkVertexTextureFormats())
+			{
+				mCapabilities->setCapability(RSC_VERTEX_TEXTURE_FETCH);
+				// always 4 vertex texture units in vs_3_0, and never shared
+				mCapabilities->setNumVertexTextureUnits(4);
+				mCapabilities->setVertexTextureUnitsShared(false);
+
+			}
+		}
+
+		// Mipmap LOD biasing?
+		if (mCaps.RasterCaps & D3DPRASTERCAPS_MIPMAPLODBIAS)
+		{
+			mCapabilities->setCapability(RSC_MIPMAP_LOD_BIAS);
+		}
+		
+
+		Log* defaultLog = LogManager::getSingleton().getDefaultLog();
+		if (defaultLog)
+		{
+			mCapabilities->log(defaultLog);
+		}
+
+		// Do we support per-stage src_manual constants?
+		// HACK - ATI drivers seem to be buggy and don't support per-stage constants properly?
+		mPerStageConstantSupport = (mCaps.PrimitiveMiscCaps & D3DPMISCCAPS_PERSTAGECONSTANT) != 0;
+
+    }
+    //---------------------------------------------------------------------
+    void D3D9RenderSystem::convertVertexShaderCaps(void)
+    {
+        ushort major, minor;
+        major = static_cast<ushort>((mCaps.VertexShaderVersion & 0x0000FF00) >> 8);
+        minor = static_cast<ushort>(mCaps.VertexShaderVersion & 0x000000FF);
+
+        bool vs2x = false;
+        bool vs2a = false;
+
+        // Special case detection for vs_2_x/a support
+        if (major >= 2)
+        {
+            if ((mCaps.VS20Caps.Caps & D3DVS20CAPS_PREDICATION) &&
+                (mCaps.VS20Caps.DynamicFlowControlDepth > 0) &&
+                (mCaps.VS20Caps.NumTemps >= 12))
+            {
+                vs2x = true;
+            }
+
+            if ((mCaps.VS20Caps.Caps & D3DVS20CAPS_PREDICATION) &&
+                (mCaps.VS20Caps.DynamicFlowControlDepth > 0) &&
+                (mCaps.VS20Caps.NumTemps >= 13))
+            {
+                vs2a = true;
+            }
+        }
+
+        // Populate max version & params
+        switch (major)
+        {
+        case 1:
+            mCapabilities->setMaxVertexProgramVersion("vs_1_1");
+            // No boolean params allowed
+            mCapabilities->setVertexProgramConstantBoolCount(0);
+            // No integer params allowed
+            mCapabilities->setVertexProgramConstantIntCount(0);
+            // float params, always 4D
+            mCapabilities->setVertexProgramConstantFloatCount(mCaps.MaxVertexShaderConst);
+           
+            break;
+        case 2:
+            if (vs2a)
+            {
+                mCapabilities->setMaxVertexProgramVersion("vs_2_a");
+            }
+            else if (vs2x)
+            {
+                mCapabilities->setMaxVertexProgramVersion("vs_2_x");
+            }
+            else
+            {
+                mCapabilities->setMaxVertexProgramVersion("vs_2_0");
+            }
+            // 16 boolean params allowed
+            mCapabilities->setVertexProgramConstantBoolCount(16);
+            // 16 integer params allowed, 4D
+            mCapabilities->setVertexProgramConstantIntCount(16);
+            // float params, always 4D
+            mCapabilities->setVertexProgramConstantFloatCount(mCaps.MaxVertexShaderConst);
+            break;
+        case 3:
+            mCapabilities->setMaxVertexProgramVersion("vs_3_0");
+            // 16 boolean params allowed
+            mCapabilities->setVertexProgramConstantBoolCount(16);
+            // 16 integer params allowed, 4D
+            mCapabilities->setVertexProgramConstantIntCount(16);
+            // float params, always 4D
+            mCapabilities->setVertexProgramConstantFloatCount(mCaps.MaxVertexShaderConst);
+            break;
+        default:
+            mCapabilities->setMaxVertexProgramVersion(StringUtil::BLANK);
+            break;
+        }
+
+        // populate syntax codes in program manager (no breaks in this one so it falls through)
+        switch(major)
+        {
+        case 3:
+            mGpuProgramManager->_pushSyntaxCode("vs_3_0");
+        case 2:
+            if (vs2x)
+                mGpuProgramManager->_pushSyntaxCode("vs_2_x");
+            if (vs2a)
+                mGpuProgramManager->_pushSyntaxCode("vs_2_a");
+
+            mGpuProgramManager->_pushSyntaxCode("vs_2_0");
+        case 1:
+            mGpuProgramManager->_pushSyntaxCode("vs_1_1");
+            mCapabilities->setCapability(RSC_VERTEX_PROGRAM);
+        }
+    }
+    //---------------------------------------------------------------------
+    void D3D9RenderSystem::convertPixelShaderCaps(void)
+    {
+        ushort major, minor;
+        major = static_cast<ushort>((mCaps.PixelShaderVersion & 0x0000FF00) >> 8);
+        minor = static_cast<ushort>(mCaps.PixelShaderVersion & 0x000000FF);
+
+		bool ps2a = false;
+        bool ps2b = false;
+        bool ps2x = false;
+
+        // Special case detection for ps_2_x/a/b support
+        if (major >= 2)
+        {
+			if ((mCaps.PS20Caps.Caps & D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT) &&
+                (mCaps.PS20Caps.NumTemps >= 32))
+            {
+                ps2b = true;
+            }
+
+	        if ((mCaps.PS20Caps.Caps & D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT) &&
+                (mCaps.PS20Caps.Caps & D3DPS20CAPS_NODEPENDENTREADLIMIT) &&
+                (mCaps.PS20Caps.Caps & D3DPS20CAPS_ARBITRARYSWIZZLE) &&
+				(mCaps.PS20Caps.Caps & D3DPS20CAPS_GRADIENTINSTRUCTIONS) &&
+				(mCaps.PS20Caps.Caps & D3DPS20CAPS_PREDICATION) &&
+                (mCaps.PS20Caps.NumTemps >= 22))
+	        {
+                ps2a = true;
+			}
+
+            // Does this enough?
+            if (ps2a || ps2b)
+            {
+                ps2x = true;
+            }
+        }
+
+        switch (major)
+        {
+        case 1:
+            switch(minor)
+            {
+            case 1:
+                mCapabilities->setMaxFragmentProgramVersion("ps_1_1");
+                break;
+            case 2:
+                mCapabilities->setMaxFragmentProgramVersion("ps_1_2");
+                break;
+            case 3:
+                mCapabilities->setMaxFragmentProgramVersion("ps_1_3");
+                break;
+            case 4:
+                mCapabilities->setMaxFragmentProgramVersion("ps_1_4");
+                break;
+            }
+            // no boolean params allowed
+            mCapabilities->setFragmentProgramConstantBoolCount(0);
+            // no integer params allowed
+            mCapabilities->setFragmentProgramConstantIntCount(0);
+            // float params, always 4D
+            // NB in ps_1_x these are actually stored as fixed point values,
+            // but they are entered as floats
+            mCapabilities->setFragmentProgramConstantFloatCount(8);
+            break;
+        case 2:
+			if (ps2a)
+            {
+                mCapabilities->setMaxFragmentProgramVersion("ps_2_a");
+            }
+			else if (ps2b)
+            {
+                mCapabilities->setMaxFragmentProgramVersion("ps_2_b");
+            }
+			else if (ps2x)
+            {
+                mCapabilities->setMaxFragmentProgramVersion("ps_2_x");
+            }
+            else
+            {
+                mCapabilities->setMaxFragmentProgramVersion("ps_2_0");
+            }
+            // 16 boolean params allowed
+            mCapabilities->setFragmentProgramConstantBoolCount(16);
+            // 16 integer params allowed, 4D
+            mCapabilities->setFragmentProgramConstantIntCount(16);
+            // float params, always 4D
+            mCapabilities->setFragmentProgramConstantFloatCount(32);
+            break;
+        case 3:
+            if (minor > 0)
+            {
+                mCapabilities->setMaxFragmentProgramVersion("ps_3_x");
+            }
+            else
+            {
+                mCapabilities->setMaxFragmentProgramVersion("ps_3_0");
+            }
+            // 16 boolean params allowed
+            mCapabilities->setFragmentProgramConstantBoolCount(16);
+            // 16 integer params allowed, 4D
+            mCapabilities->setFragmentProgramConstantIntCount(16);
+            // float params, always 4D
+            mCapabilities->setFragmentProgramConstantFloatCount(224);
+            break;
+        default:
+            mCapabilities->setMaxFragmentProgramVersion(StringUtil::BLANK);
+            break;
+        }
+
+        // populate syntax codes in program manager (no breaks in this one so it falls through)
+        switch(major)
+        {
+        case 3:
+            if (minor > 0)
+                mGpuProgramManager->_pushSyntaxCode("ps_3_x");
+
+            mGpuProgramManager->_pushSyntaxCode("ps_3_0");
+        case 2:
+            if (ps2x)
+                mGpuProgramManager->_pushSyntaxCode("ps_2_x");
+            if (ps2a)
+                mGpuProgramManager->_pushSyntaxCode("ps_2_a");
+            if (ps2b)
+                mGpuProgramManager->_pushSyntaxCode("ps_2_b");
+
+            mGpuProgramManager->_pushSyntaxCode("ps_2_0");
+        case 1:
+            if (major > 1 || minor >= 4)
+                mGpuProgramManager->_pushSyntaxCode("ps_1_4");
+            if (major > 1 || minor >= 3)
+                mGpuProgramManager->_pushSyntaxCode("ps_1_3");
+            if (major > 1 || minor >= 2)
+                mGpuProgramManager->_pushSyntaxCode("ps_1_2");
+            
+            mGpuProgramManager->_pushSyntaxCode("ps_1_1");
+            mCapabilities->setCapability(RSC_FRAGMENT_PROGRAM);
+        }
+    }
+	//-----------------------------------------------------------------------
+	bool D3D9RenderSystem::checkVertexTextureFormats(void)
+	{
+		bool anySupported = false;
+
+		LPDIRECT3DSURFACE9 bbSurf;
+		mPrimaryWindow->getCustomAttribute("DDBACKBUFFER", &bbSurf);
+		D3DSURFACE_DESC bbSurfDesc;
+		bbSurf->GetDesc(&bbSurfDesc);
+
+		for (uint ipf = (uint)PF_L8; ipf < (uint)PF_COUNT; ++ipf)
+		{
+			PixelFormat pf = (PixelFormat)ipf;
+
+			D3DFORMAT fmt = 
+				D3D9Mappings::_getPF(D3D9Mappings::_getClosestSupportedPF(pf));
+
+			if (SUCCEEDED(mpD3D->CheckDeviceFormat(
+				mActiveD3DDriver->getAdapterNumber(), D3DDEVTYPE_HAL, bbSurfDesc.Format, 
+				D3DUSAGE_QUERY_VERTEXTEXTURE, D3DRTYPE_TEXTURE, fmt)))
+			{
+				// cool, at least one supported
+				anySupported = true;
+				StringUtil::StrStreamType str;
+				str << "D3D9: Vertex texture format supported - "
+					<< PixelUtil::getFormatName(pf);
+				LogManager::getSingleton().logMessage(str.str());
+			}
+		}
+
+		return anySupported;
+
+
+	}
+	//-----------------------------------------------------------------------
+    bool D3D9RenderSystem::_checkTextureFilteringSupported(TextureType ttype, PixelFormat format, int usage)
+    {
+		// Gets D3D format
+		D3DFORMAT d3dPF = D3D9Mappings::_getPF(format);
+        if (d3dPF == D3DFMT_UNKNOWN)
+            return false;
+
+		LPDIRECT3DSURFACE9 pSurface = mPrimaryWindow->getRenderSurface();
+		D3DSURFACE_DESC srfDesc;
+		if (FAILED(pSurface->GetDesc(&srfDesc)))
+            return false;
+
+		// Calculate usage
+		DWORD d3dusage = D3DUSAGE_QUERY_FILTER;
+		if (usage & TU_RENDERTARGET) 
+			d3dusage |= D3DUSAGE_RENDERTARGET;
+		if (usage & TU_DYNAMIC)
+			d3dusage |= D3DUSAGE_DYNAMIC;
+
+        // Detect resource type
+        D3DRESOURCETYPE rtype;
+		switch(ttype)
+		{
+		case TEX_TYPE_1D:
+		case TEX_TYPE_2D:
+            rtype = D3DRTYPE_TEXTURE;
+            break;
+        case TEX_TYPE_3D:
+            rtype = D3DRTYPE_VOLUMETEXTURE;
+            break;
+        case TEX_TYPE_CUBE_MAP:
+            rtype = D3DRTYPE_CUBETEXTURE;
+            break;
+        default:
+            return false;
+        }
+
+        HRESULT hr = mpD3D->CheckDeviceFormat(
+            mActiveD3DDriver->getAdapterNumber(),
+            D3DDEVTYPE_HAL,
+            srfDesc.Format,
+            d3dusage,
+            rtype,
+            d3dPF);
+
+        return SUCCEEDED(hr);
+    }
+	//-----------------------------------------------------------------------
+	MultiRenderTarget * D3D9RenderSystem::createMultiRenderTarget(const String & name)
+	{
+		MultiRenderTarget *retval;
+		retval = new D3D9MultiRenderTarget(name);
+		attachRenderTarget(*retval);
+
+		return retval;
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::destroyRenderTarget(const String& name)
+	{
+		// Check in specialised lists
+		if (mPrimaryWindow->getName() == name)
+		{
+			// We're destroying the primary window, so reset device and window
+			mPrimaryWindow = 0;
+		}
+		else
+		{
+			// Check secondary windows
+			SecondaryWindowList::iterator sw;
+			for (sw = mSecondaryWindows.begin(); sw != mSecondaryWindows.end(); ++sw)
+			{
+				if ((*sw)->getName() == name)
+				{
+					mSecondaryWindows.erase(sw);
+					break;
+				}
+			}
+		}
+		// Do the real removal
+		RenderSystem::destroyRenderTarget(name);
+
+		// Did we destroy the primary?
+		if (!mPrimaryWindow)
+		{
+			// device is no longer valid, so free it all up
+			freeDevice();
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	void D3D9RenderSystem::freeDevice(void)
+	{
+		if (mpD3DDevice)
+		{
+			// Set all texture units to nothing to release texture surfaces
+			_disableTextureUnitsFrom(0);
+			// Unbind any vertex streams to avoid memory leaks
+			for (unsigned int i = 0; i < mLastVertexSourceCount; ++i)
+			{
+				HRESULT hr = mpD3DDevice->SetStreamSource(i, NULL, 0, 0);
+			}
+			// Clean up depth stencil surfaces
+			_cleanupDepthStencils();
+			SAFE_RELEASE(mpD3DDevice);
+			mActiveD3DDriver->setD3DDevice(NULL);
+			mpD3DDevice = 0;
+
+		}
+
+
+	}
+	//---------------------------------------------------------------------
+	String D3D9RenderSystem::getErrorDescription( long errorNumber ) const
+	{
+		const String errMsg = DXGetErrorDescription9( errorNumber );
+		return errMsg;
+	}
+    //---------------------------------------------------------------------
+	VertexElementType D3D9RenderSystem::getColourVertexElementType(void) const
+	{
+		return VET_COLOUR_ARGB;
+	}
+   	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_convertProjectionMatrix(const Matrix4& matrix,
+        Matrix4& dest, bool forGpuProgram)
+    {
+        dest = matrix;
+
+        // Convert depth range from [-1,+1] to [0,1]
+        dest[2][0] = (dest[2][0] + dest[3][0]) / 2;
+        dest[2][1] = (dest[2][1] + dest[3][1]) / 2;
+        dest[2][2] = (dest[2][2] + dest[3][2]) / 2;
+        dest[2][3] = (dest[2][3] + dest[3][3]) / 2;
+
+        if (!forGpuProgram)
+        {
+            // Convert right-handed to left-handed
+            dest[0][2] = -dest[0][2];
+            dest[1][2] = -dest[1][2];
+            dest[2][2] = -dest[2][2];
+            dest[3][2] = -dest[3][2];
+        }
+    }
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_makeProjectionMatrix(const Radian& fovy, Real aspect, Real nearPlane, 
+        Real farPlane, Matrix4& dest, bool forGpuProgram)
+	{
+        Radian theta ( fovy * 0.5 );
+		Real h = 1 / Math::Tan(theta);
+		Real w = h / aspect;
+		Real q, qn;
+        if (farPlane == 0)
+        {
+            q = 1 - Frustum::INFINITE_FAR_PLANE_ADJUST;
+            qn = nearPlane * (Frustum::INFINITE_FAR_PLANE_ADJUST - 1);
+        }
+        else
+        {
+            q = farPlane / ( farPlane - nearPlane );
+            qn = -q * nearPlane;
+        }
+
+		dest = Matrix4::ZERO;
+		dest[0][0] = w;
+		dest[1][1] = h;
+
+        if (forGpuProgram)
+        {
+            dest[2][2] = -q;
+		    dest[3][2] = -1.0f;
+        }
+        else
+        {
+            dest[2][2] = q;
+            dest[3][2] = 1.0f;
+        }
+
+        dest[2][3] = qn;
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_makeOrthoMatrix(const Radian& fovy, Real aspect, Real nearPlane, Real farPlane, 
+		Matrix4& dest, bool forGpuProgram )
+	{
+        Radian thetaY (fovy / 2.0f);
+        Real tanThetaY = Math::Tan(thetaY);
+
+        //Real thetaX = thetaY * aspect;
+        Real tanThetaX = tanThetaY * aspect; //Math::Tan(thetaX);
+        Real half_w = tanThetaX * nearPlane;
+        Real half_h = tanThetaY * nearPlane;
+        Real iw = 1.0 / half_w;
+        Real ih = 1.0 / half_h;
+        Real q;
+        if (farPlane == 0)
+        {
+            q = 0;
+        }
+        else
+        {
+            q = 1.0 / (farPlane - nearPlane);
+        }
+
+        dest = Matrix4::ZERO;
+        dest[0][0] = iw;
+        dest[1][1] = ih;
+        dest[2][2] = q;
+        dest[2][3] = -nearPlane / (farPlane - nearPlane);
+        dest[3][3] = 1;
+
+        if (forGpuProgram)
+        {
+            dest[2][2] = -dest[2][2];
+        }
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::setAmbientLight( float r, float g, float b )
+	{
+		HRESULT hr = __SetRenderState( D3DRS_AMBIENT, D3DCOLOR_COLORVALUE( r, g, b, 1.0f ) );
+		if( FAILED( hr ) )
+			OGRE_EXCEPT( Exception::ERR_RENDERINGAPI_ERROR, 
+			"Failed to set render stat D3DRS_AMBIENT", "D3D9RenderSystem::setAmbientLight" );
+	}
+	//---------------------------------------------------------------------
+    void D3D9RenderSystem::_useLights(const LightList& lights, unsigned short limit)
+    {
+        LightList::const_iterator i, iend;
+        iend = lights.end();
+        unsigned short num = 0;
+        for (i = lights.begin(); i != iend && num < limit; ++i, ++num)
+        {
+            setD3D9Light(num, *i);
+        }
+        // Disable extra lights
+        for (; num < mCurrentLights; ++num)
+        {
+            setD3D9Light(num, NULL);
+        }
+        mCurrentLights = std::min(limit, static_cast<unsigned short>(lights.size()));
+
+    }
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::setShadingType( ShadeOptions so )
+	{
+		HRESULT hr = __SetRenderState( D3DRS_SHADEMODE, D3D9Mappings::get(so) );
+		if( FAILED( hr ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+			"Failed to set render stat D3DRS_SHADEMODE", "D3D9RenderSystem::setShadingType" );
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::setLightingEnabled( bool enabled )
+	{
+		HRESULT hr;
+		if( FAILED( hr = __SetRenderState( D3DRS_LIGHTING, enabled ) ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+			"Failed to set render state D3DRS_LIGHTING", "D3D9RenderSystem::setLightingEnabled" );
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::setD3D9Light( size_t index, Light* lt )
+	{
+		HRESULT hr;
+
+		D3DLIGHT9 d3dLight;
+		ZeroMemory( &d3dLight, sizeof(d3dLight) );
+
+        if (!lt)
+        {
+            if( FAILED( hr = mpD3DDevice->LightEnable( index, FALSE) ) )
+			    OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+				"Unable to disable light", "D3D9RenderSystem::setD3D9Light" );
+        }
+        else
+        {
+			switch( lt->getType() )
+			{
+			case Light::LT_POINT:
+				d3dLight.Type = D3DLIGHT_POINT;
+				break;
+
+			case Light::LT_DIRECTIONAL:
+				d3dLight.Type = D3DLIGHT_DIRECTIONAL;
+				break;
+
+			case Light::LT_SPOTLIGHT:
+				d3dLight.Type = D3DLIGHT_SPOT;
+				d3dLight.Falloff = lt->getSpotlightFalloff();
+				d3dLight.Theta = lt->getSpotlightInnerAngle().valueRadians();
+				d3dLight.Phi = lt->getSpotlightOuterAngle().valueRadians();
+				break;
+			}
+
+			ColourValue col;
+			col = lt->getDiffuseColour();
+			d3dLight.Diffuse = D3DXCOLOR( col.r, col.g, col.b, col.a );
+
+			col = lt->getSpecularColour();
+			d3dLight.Specular = D3DXCOLOR( col.r, col.g, col.b, col.a );
+
+			Vector3 vec;
+			if( lt->getType() != Light::LT_DIRECTIONAL )
+			{
+				vec = lt->getDerivedPosition();
+				d3dLight.Position = D3DXVECTOR3( vec.x, vec.y, vec.z );
+			}
+			if( lt->getType() != Light::LT_POINT )
+			{
+				vec = lt->getDerivedDirection();
+				d3dLight.Direction = D3DXVECTOR3( vec.x, vec.y, vec.z );
+			}
+
+			d3dLight.Range = lt->getAttenuationRange();
+			d3dLight.Attenuation0 = lt->getAttenuationConstant();
+			d3dLight.Attenuation1 = lt->getAttenuationLinear();
+			d3dLight.Attenuation2 = lt->getAttenuationQuadric();
+
+			if( FAILED( hr = mpD3DDevice->SetLight( index, &d3dLight ) ) )
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to set light details", "D3D9RenderSystem::setD3D9Light" );
+
+            if( FAILED( hr = mpD3DDevice->LightEnable( index, TRUE ) ) )
+			    OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to enable light", "D3D9RenderSystem::setD3D9Light" );
+        }
+
+
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setViewMatrix( const Matrix4 &m )
+	{
+        // save latest view matrix
+        mViewMatrix = m;
+        mViewMatrix[2][0] = -mViewMatrix[2][0];
+        mViewMatrix[2][1] = -mViewMatrix[2][1];
+        mViewMatrix[2][2] = -mViewMatrix[2][2];
+        mViewMatrix[2][3] = -mViewMatrix[2][3];
+
+        D3DXMATRIX d3dmat = D3D9Mappings::makeD3DXMatrix( mViewMatrix );
+
+		HRESULT hr;
+		if( FAILED( hr = mpD3DDevice->SetTransform( D3DTS_VIEW, &d3dmat ) ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Cannot set D3D9 view matrix", "D3D9RenderSystem::_setViewMatrix" );
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setProjectionMatrix( const Matrix4 &m )
+	{
+		D3DXMATRIX d3dMat = D3D9Mappings::makeD3DXMatrix( m );
+
+		if( mActiveRenderTarget->requiresTextureFlipping() )
+        {
+            // Invert transformed y
+            d3dMat._12 = - d3dMat._12;
+			d3dMat._22 = - d3dMat._22;
+            d3dMat._32 = - d3dMat._32;
+            d3dMat._42 = - d3dMat._42;
+        }
+
+		HRESULT hr;
+		if( FAILED( hr = mpD3DDevice->SetTransform( D3DTS_PROJECTION, &d3dMat ) ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Cannot set D3D9 projection matrix", "D3D9RenderSystem::_setProjectionMatrix" );
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setWorldMatrix( const Matrix4 &m )
+	{
+		D3DXMATRIX d3dMat = D3D9Mappings::makeD3DXMatrix( m );
+
+		HRESULT hr;
+		if( FAILED( hr = mpD3DDevice->SetTransform( D3DTS_WORLD, &d3dMat ) ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Cannot set D3D9 world matrix", "D3D9RenderSystem::_setWorldMatrix" );
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setSurfaceParams( const ColourValue &ambient, const ColourValue &diffuse,
+		const ColourValue &specular, const ColourValue &emissive, Real shininess,
+        TrackVertexColourType tracking )
+	{
+		
+		D3DMATERIAL9 material;
+		material.Diffuse = D3DXCOLOR( diffuse.r, diffuse.g, diffuse.b, diffuse.a );
+		material.Ambient = D3DXCOLOR( ambient.r, ambient.g, ambient.b, ambient.a );
+		material.Specular = D3DXCOLOR( specular.r, specular.g, specular.b, specular.a );
+		material.Emissive = D3DXCOLOR( emissive.r, emissive.g, emissive.b, emissive.a );
+		material.Power = shininess;
+
+		HRESULT hr = mpD3DDevice->SetMaterial( &material );
+		if( FAILED( hr ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting D3D material", "D3D9RenderSystem::_setSurfaceParams" );
+
+
+		if(tracking != TVC_NONE) 
+        {
+            __SetRenderState(D3DRS_COLORVERTEX, TRUE);
+            __SetRenderState(D3DRS_AMBIENTMATERIALSOURCE, (tracking&TVC_AMBIENT)?D3DMCS_COLOR1:D3DMCS_MATERIAL);
+            __SetRenderState(D3DRS_DIFFUSEMATERIALSOURCE, (tracking&TVC_DIFFUSE)?D3DMCS_COLOR1:D3DMCS_MATERIAL);
+            __SetRenderState(D3DRS_SPECULARMATERIALSOURCE, (tracking&TVC_SPECULAR)?D3DMCS_COLOR1:D3DMCS_MATERIAL);
+            __SetRenderState(D3DRS_EMISSIVEMATERIALSOURCE, (tracking&TVC_EMISSIVE)?D3DMCS_COLOR1:D3DMCS_MATERIAL);
+        } 
+        else 
+        {
+            __SetRenderState(D3DRS_COLORVERTEX, FALSE);               
+        }
+        
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setPointParameters(Real size, 
+		bool attenuationEnabled, Real constant, Real linear, Real quadratic,
+		Real minSize, Real maxSize)
+    {
+		if(attenuationEnabled)
+		{
+			// scaling required
+			__SetRenderState(D3DRS_POINTSCALEENABLE, TRUE);
+			__SetFloatRenderState(D3DRS_POINTSCALE_A, constant);
+			__SetFloatRenderState(D3DRS_POINTSCALE_B, linear);
+			__SetFloatRenderState(D3DRS_POINTSCALE_C, quadratic);
+		}
+		else
+		{
+			// no scaling required
+			__SetRenderState(D3DRS_POINTSCALEENABLE, FALSE);
+		}
+		__SetFloatRenderState(D3DRS_POINTSIZE, size);
+		__SetFloatRenderState(D3DRS_POINTSIZE_MIN, minSize);
+		if (maxSize == 0.0f)
+			maxSize = mCapabilities->getMaxPointSize();
+		__SetFloatRenderState(D3DRS_POINTSIZE_MAX, maxSize);
+
+
+    }
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setPointSpritesEnabled(bool enabled)
+	{
+		if (enabled)
+		{
+			__SetRenderState(D3DRS_POINTSPRITEENABLE, TRUE);
+		}
+		else
+		{
+			__SetRenderState(D3DRS_POINTSPRITEENABLE, FALSE);
+		}
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setTexture( size_t stage, bool enabled, const TexturePtr& tex )
+	{
+		HRESULT hr;
+		D3D9TexturePtr dt = tex;
+		if (enabled && !dt.isNull())
+		{
+            // note used
+            dt->touch();
+
+			IDirect3DBaseTexture9 *pTex = dt->getTexture();
+			if (mTexStageDesc[stage].pTex != pTex)
+			{
+				hr = mpD3DDevice->SetTexture(stage, pTex);
+				if( hr != S_OK )
+				{
+					String str = "Unable to set texture '" + tex->getName() + "' in D3D9";
+					OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, str, "D3D9RenderSystem::_setTexture" );
+				}
+				
+				// set stage desc.
+				mTexStageDesc[stage].pTex = pTex;
+				mTexStageDesc[stage].texType = D3D9Mappings::get(dt->getTextureType());
+			}
+		}
+		else
+		{
+			if (mTexStageDesc[stage].pTex != 0)
+			{
+				hr = mpD3DDevice->SetTexture(stage, 0);
+				if( hr != S_OK )
+				{
+					String str = "Unable to disable texture '" + StringConverter::toString(stage) + "' in D3D9";
+					OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, str, "D3D9RenderSystem::_setTexture" );
+				}
+			}
+
+			hr = this->__SetTextureStageState(stage, D3DTSS_COLOROP, D3DTOP_DISABLE);
+			if( hr != S_OK )
+			{
+				String str = "Unable to disable texture '" + StringConverter::toString(stage) + "' in D3D9";
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, str, "D3D9RenderSystem::_setTexture" );
+			}
+
+			// set stage desc. to defaults
+			mTexStageDesc[stage].pTex = 0;
+			mTexStageDesc[stage].autoTexCoordType = TEXCALC_NONE;
+			mTexStageDesc[stage].coordIndex = 0;
+			mTexStageDesc[stage].texType = D3D9Mappings::D3D_TEX_TYPE_NORMAL;
+		}
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setVertexTexture(size_t stage, const TexturePtr& tex)
+	{
+		if (tex.isNull())
+		{
+
+			if (mTexStageDesc[stage].pVertexTex != 0)
+			{
+				HRESULT hr = mpD3DDevice->SetTexture(D3DVERTEXTEXTURESAMPLER0 + stage, 0);
+				if( hr != S_OK )
+				{
+					String str = "Unable to disable vertex texture '" 
+						+ StringConverter::toString(stage) + "' in D3D9";
+					OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, str, "D3D9RenderSystem::_setVertexTexture" );
+				}
+			}
+
+			// set stage desc. to defaults
+			mTexStageDesc[stage].pVertexTex = 0;
+		}
+		else
+		{
+			D3D9TexturePtr dt = tex;
+			// note used
+			dt->touch();
+
+			IDirect3DBaseTexture9 *pTex = dt->getTexture();
+			if (mTexStageDesc[stage].pVertexTex != pTex)
+			{
+				HRESULT hr = mpD3DDevice->SetTexture(D3DVERTEXTEXTURESAMPLER0 + stage, pTex);
+				if( hr != S_OK )
+				{
+					String str = "Unable to set vertex texture '" + tex->getName() + "' in D3D9";
+					OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, str, "D3D9RenderSystem::_setVertexTexture" );
+				}
+
+				// set stage desc.
+				mTexStageDesc[stage].pVertexTex = pTex;
+			}
+
+		}
+
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_disableTextureUnit(size_t texUnit)
+	{
+		RenderSystem::_disableTextureUnit(texUnit);
+		// also disable vertex texture unit
+		static TexturePtr nullPtr;
+		_setVertexTexture(texUnit, nullPtr);
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setTextureCoordSet( size_t stage, size_t index )
+	{
+		HRESULT hr;
+        // Record settings
+        mTexStageDesc[stage].coordIndex = index;
+
+		hr = __SetTextureStageState( stage, D3DTSS_TEXCOORDINDEX, D3D9Mappings::get(mTexStageDesc[stage].autoTexCoordType, mCaps) | index );
+		if( FAILED( hr ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to set texture coord. set index", "D3D9RenderSystem::_setTextureCoordSet" );
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setTextureCoordCalculation( size_t stage, TexCoordCalcMethod m,
+        const Frustum* frustum)
+	{
+		HRESULT hr;
+		// record the stage state
+		mTexStageDesc[stage].autoTexCoordType = m;
+        mTexStageDesc[stage].frustum = frustum;
+
+		hr = __SetTextureStageState( stage, D3DTSS_TEXCOORDINDEX, D3D9Mappings::get(m, mCaps) | mTexStageDesc[stage].coordIndex );
+		if(FAILED(hr))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to set texture auto tex.coord. generation mode", "D3D9RenderSystem::_setTextureCoordCalculation" );
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setTextureMipmapBias(size_t unit, float bias)
+	{
+		if (mCapabilities->hasCapability(RSC_MIPMAP_LOD_BIAS))
+		{
+			// ugh - have to pass float data through DWORD with no conversion
+			HRESULT hr = __SetSamplerState(unit, D3DSAMP_MIPMAPLODBIAS, 
+				*(DWORD*)&bias);
+			if(FAILED(hr))
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to set texture mipmap bias", 
+				"D3D9RenderSystem::_setTextureMipmapBias" );
+
+		}
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setTextureMatrix( size_t stage, const Matrix4& xForm )
+	{
+		HRESULT hr;
+		D3DXMATRIX d3dMat; // the matrix we'll maybe apply
+		Matrix4 newMat = xForm; // the matrix we'll apply after conv. to D3D format
+		// Cache texcoord calc method to register
+		TexCoordCalcMethod autoTexCoordType = mTexStageDesc[stage].autoTexCoordType;
+
+		if (autoTexCoordType == TEXCALC_ENVIRONMENT_MAP)
+        {
+            if (mCaps.VertexProcessingCaps & D3DVTXPCAPS_TEXGEN_SPHEREMAP)
+            {
+                /** Invert the texture for the spheremap */
+                Matrix4 ogreMatEnvMap = Matrix4::IDENTITY;
+			    // set env_map values
+			    ogreMatEnvMap[1][1] = -1.0f;
+			    // concatenate with the xForm
+			    newMat = newMat.concatenate(ogreMatEnvMap);
+            }
+            else
+            {
+		        /* If envmap is applied, but device doesn't support spheremap,
+		        then we have to use texture transform to make the camera space normal
+		        reference the envmap properly. This isn't exactly the same as spheremap
+		        (it looks nasty on flat areas because the camera space normals are the same)
+		        but it's the best approximation we have in the absence of a proper spheremap */
+			    // concatenate with the xForm
+                newMat = newMat.concatenate(Matrix4::CLIPSPACE2DTOIMAGESPACE);
+            }
+		}
+
+        // If this is a cubic reflection, we need to modify using the view matrix
+        if (autoTexCoordType == TEXCALC_ENVIRONMENT_MAP_REFLECTION)
+        {
+            // Get transposed 3x3
+            // We want to transpose since that will invert an orthonormal matrix ie rotation
+            Matrix4 ogreViewTransposed;
+            ogreViewTransposed[0][0] = mViewMatrix[0][0];
+            ogreViewTransposed[0][1] = mViewMatrix[1][0];
+            ogreViewTransposed[0][2] = mViewMatrix[2][0];
+            ogreViewTransposed[0][3] = 0.0f;
+
+            ogreViewTransposed[1][0] = mViewMatrix[0][1];
+            ogreViewTransposed[1][1] = mViewMatrix[1][1];
+            ogreViewTransposed[1][2] = mViewMatrix[2][1];
+            ogreViewTransposed[1][3] = 0.0f;
+
+            ogreViewTransposed[2][0] = mViewMatrix[0][2];
+            ogreViewTransposed[2][1] = mViewMatrix[1][2];
+            ogreViewTransposed[2][2] = mViewMatrix[2][2];
+            ogreViewTransposed[2][3] = 0.0f;
+
+            ogreViewTransposed[3][0] = 0.0f;
+            ogreViewTransposed[3][1] = 0.0f;
+            ogreViewTransposed[3][2] = 0.0f;
+            ogreViewTransposed[3][3] = 1.0f;
+            
+            newMat = newMat.concatenate(ogreViewTransposed);
+        }
+
+        if (autoTexCoordType == TEXCALC_PROJECTIVE_TEXTURE)
+        {
+            // Derive camera space to projector space transform
+            // To do this, we need to undo the camera view matrix, then 
+            // apply the projector view & projection matrices
+            newMat = mViewMatrix.inverse();
+            newMat = mTexStageDesc[stage].frustum->getViewMatrix() * newMat;
+            newMat = mTexStageDesc[stage].frustum->getProjectionMatrix() * newMat;
+            newMat = Matrix4::CLIPSPACE2DTOIMAGESPACE * newMat;
+            newMat = xForm * newMat;
+        }
+
+		// need this if texture is a cube map, to invert D3D's z coord
+		if (autoTexCoordType != TEXCALC_NONE &&
+            autoTexCoordType != TEXCALC_PROJECTIVE_TEXTURE)
+		{
+            newMat[2][0] = -newMat[2][0];
+            newMat[2][1] = -newMat[2][1];
+            newMat[2][2] = -newMat[2][2];
+            newMat[2][3] = -newMat[2][3];
+		}
+
+        // convert our matrix to D3D format
+		d3dMat = D3D9Mappings::makeD3DXMatrix(newMat);
+
+		// set the matrix if it's not the identity
+		if (!D3DXMatrixIsIdentity(&d3dMat))
+		{
+            /* It's seems D3D automatically add a texture coordinate with value 1,
+            and fill up the remaining texture coordinates with 0 for the input
+            texture coordinates before pass to texture coordinate transformation.
+
+               NOTE: It's difference with D3DDECLTYPE enumerated type expand in
+            DirectX SDK documentation!
+
+               So we should prepare the texcoord transform, make the transformation
+            just like standardized vector expand, thus, fill w with value 1 and
+            others with 0.
+            */
+            if (autoTexCoordType == TEXCALC_NONE)
+            {
+                /* FIXME: The actually input texture coordinate dimensions should
+                be determine by texture coordinate vertex element. Now, just trust
+                user supplied texture type matchs texture coordinate vertex element.
+                */
+                if (mTexStageDesc[stage].texType == D3D9Mappings::D3D_TEX_TYPE_NORMAL)
+                {
+                    /* It's 2D input texture coordinate:
+
+                      texcoord in vertex buffer     D3D expanded to     We are adjusted to
+                                                -->                 -->
+                                (u, v)               (u, v, 1, 0)          (u, v, 0, 1)
+                    */
+                    std::swap(d3dMat._31, d3dMat._41);
+                    std::swap(d3dMat._32, d3dMat._42);
+                    std::swap(d3dMat._33, d3dMat._43);
+                    std::swap(d3dMat._34, d3dMat._44);
+                }
+            }
+            else
+            {
+                // All texgen generate 3D input texture coordinates.
+            }
+
+			// tell D3D the dimension of tex. coord.
+			int texCoordDim = D3DTTFF_COUNT2;
+            if (mTexStageDesc[stage].autoTexCoordType == TEXCALC_PROJECTIVE_TEXTURE)
+            {
+                /* We want texcoords (u, v, w, q) always get divided by q, but D3D
+                projected texcoords is divided by the last element (in the case of
+                2D texcoord, is w). So we tweak the transform matrix, transform the
+                texcoords with w and q swapped: (u, v, q, w), and then D3D will
+                divide u, v by q. The w and q just ignored as it wasn't used by
+                rasterizer.
+                */
+			    switch (mTexStageDesc[stage].texType)
+			    {
+			    case D3D9Mappings::D3D_TEX_TYPE_NORMAL:
+                    std::swap(d3dMat._13, d3dMat._14);
+                    std::swap(d3dMat._23, d3dMat._24);
+                    std::swap(d3dMat._33, d3dMat._34);
+                    std::swap(d3dMat._43, d3dMat._44);
+
+                    texCoordDim = D3DTTFF_PROJECTED | D3DTTFF_COUNT3;
+                    break;
+
+			    case D3D9Mappings::D3D_TEX_TYPE_CUBE:
+			    case D3D9Mappings::D3D_TEX_TYPE_VOLUME:
+                    // Yes, we support 3D projective texture.
+				    texCoordDim = D3DTTFF_PROJECTED | D3DTTFF_COUNT4;
+                    break;
+                }
+            }
+            else
+            {
+			    switch (mTexStageDesc[stage].texType)
+			    {
+			    case D3D9Mappings::D3D_TEX_TYPE_NORMAL:
+				    texCoordDim = D3DTTFF_COUNT2;
+				    break;
+			    case D3D9Mappings::D3D_TEX_TYPE_CUBE:
+			    case D3D9Mappings::D3D_TEX_TYPE_VOLUME:
+				    texCoordDim = D3DTTFF_COUNT3;
+                    break;
+			    }
+            }
+
+			hr = __SetTextureStageState( stage, D3DTSS_TEXTURETRANSFORMFLAGS, texCoordDim );
+			if (FAILED(hr))
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to set texture coord. dimension", "D3D9RenderSystem::_setTextureMatrix" );
+
+			hr = mpD3DDevice->SetTransform( (D3DTRANSFORMSTATETYPE)(D3DTS_TEXTURE0 + stage), &d3dMat );
+			if (FAILED(hr))
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to set texture matrix", "D3D9RenderSystem::_setTextureMatrix" );
+		}
+		else
+		{
+			// disable all of this
+			hr = __SetTextureStageState( stage, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE );
+			if( FAILED( hr ) )
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to disable texture coordinate transform", "D3D9RenderSystem::_setTextureMatrix" );
+
+			// Needless to sets texture transform here, it's never used at all
+		}
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setTextureAddressingMode( size_t stage, 
+		const TextureUnitState::UVWAddressingMode& uvw )
+	{
+		HRESULT hr;
+		if( FAILED( hr = __SetSamplerState( stage, D3DSAMP_ADDRESSU, D3D9Mappings::get(uvw.u, mCaps) ) ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set texture addressing mode for U", "D3D9RenderSystem::_setTextureAddressingMode" );
+		if( FAILED( hr = __SetSamplerState( stage, D3DSAMP_ADDRESSV, D3D9Mappings::get(uvw.v, mCaps) ) ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set texture addressing mode for V", "D3D9RenderSystem::_setTextureAddressingMode" );
+		if( FAILED( hr = __SetSamplerState( stage, D3DSAMP_ADDRESSW, D3D9Mappings::get(uvw.w, mCaps) ) ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set texture addressing mode for W", "D3D9RenderSystem::_setTextureAddressingMode" );
+	}
+    //-----------------------------------------------------------------------------
+    void D3D9RenderSystem::_setTextureBorderColour(size_t stage,
+        const ColourValue& colour)
+    {
+		HRESULT hr;
+		if( FAILED( hr = __SetSamplerState( stage, D3DSAMP_BORDERCOLOR, colour.getAsARGB()) ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set texture border colour", "D3D9RenderSystem::_setTextureBorderColour" );
+    }
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setTextureBlendMode( size_t stage, const LayerBlendModeEx& bm )
+	{
+		HRESULT hr = S_OK;
+		D3DTEXTURESTAGESTATETYPE tss;
+		D3DCOLOR manualD3D;
+
+		// choose type of blend.
+		if( bm.blendType == LBT_COLOUR )
+			tss = D3DTSS_COLOROP;
+		else if( bm.blendType == LBT_ALPHA )
+			tss = D3DTSS_ALPHAOP;
+		else
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+			"Invalid blend type", "D3D9RenderSystem::_setTextureBlendMode");
+
+		// set manual factor if required by operation
+		if (bm.operation == LBX_BLEND_MANUAL)
+		{
+			hr = __SetRenderState( D3DRS_TEXTUREFACTOR, D3DXCOLOR(0.0, 0.0, 0.0,  bm.factor) );
+			if (FAILED(hr))
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set manual factor", "D3D9RenderSystem::_setTextureBlendMode" );
+		}
+		// set operation
+		hr = __SetTextureStageState( stage, tss, D3D9Mappings::get(bm.operation, mCaps) );
+		if (FAILED(hr))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set operation", "D3D9RenderSystem::_setTextureBlendMode" );
+
+		// choose source 1
+		if( bm.blendType == LBT_COLOUR )
+		{
+			tss = D3DTSS_COLORARG1;
+			manualD3D = D3DXCOLOR( bm.colourArg1.r, bm.colourArg1.g, bm.colourArg1.b, bm.colourArg1.a );
+			mManualBlendColours[stage][0] = bm.colourArg1;
+		}
+		else if( bm.blendType == LBT_ALPHA )
+		{
+			tss = D3DTSS_ALPHAARG1;
+			manualD3D = D3DXCOLOR( mManualBlendColours[stage][0].r, 
+				mManualBlendColours[stage][0].g, 
+				mManualBlendColours[stage][0].b, bm.alphaArg1 );
+		}
+		else
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"Invalid blend type", "D3D9RenderSystem::_setTextureBlendMode");
+		}
+		// Set manual factor if required
+		if (bm.source1 == LBS_MANUAL)
+		{
+			if (mPerStageConstantSupport)
+			{
+				// Per-stage state
+				hr = __SetTextureStageState(stage, D3DTSS_CONSTANT, manualD3D);
+			}
+			else
+			{
+				// Global state
+				hr = __SetRenderState( D3DRS_TEXTUREFACTOR, manualD3D );
+			}
+			if (FAILED(hr))
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set manual factor", "D3D9RenderSystem::_setTextureBlendMode" );
+		}
+		// set source 1
+		hr = __SetTextureStageState( stage, tss, D3D9Mappings::get(bm.source1, mPerStageConstantSupport) );
+		if (FAILED(hr))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set source1", "D3D9RenderSystem::_setTextureBlendMode" );
+		
+		// choose source 2
+		if( bm.blendType == LBT_COLOUR )
+		{
+			tss = D3DTSS_COLORARG2;
+			manualD3D = D3DXCOLOR( bm.colourArg2.r, bm.colourArg2.g, bm.colourArg2.b, bm.colourArg2.a );
+			mManualBlendColours[stage][1] = bm.colourArg1;
+		}
+		else if( bm.blendType == LBT_ALPHA )
+		{
+			tss = D3DTSS_ALPHAARG2;
+			manualD3D = D3DXCOLOR( mManualBlendColours[stage][1].r, 
+				mManualBlendColours[stage][1].g, 
+				mManualBlendColours[stage][1].b, 
+				bm.alphaArg2 );
+		}
+		// Set manual factor if required
+		if (bm.source2 == LBS_MANUAL)
+		{
+			if (mPerStageConstantSupport)
+			{
+				// Per-stage state
+				hr = __SetTextureStageState(stage, D3DTSS_CONSTANT, manualD3D);
+			}
+			else
+			{
+				hr = __SetRenderState( D3DRS_TEXTUREFACTOR, manualD3D );
+			}
+			if (FAILED(hr))
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set manual factor", "D3D9RenderSystem::_setTextureBlendMode" );
+		}
+		// Now set source 2
+		hr = __SetTextureStageState( stage, tss, D3D9Mappings::get(bm.source2, mPerStageConstantSupport) );
+		if (FAILED(hr))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set source 2", "D3D9RenderSystem::_setTextureBlendMode" );
+
+		// Set interpolation factor if lerping
+		if (bm.operation == LBX_BLEND_DIFFUSE_COLOUR && 
+			mCaps.TextureOpCaps & D3DTEXOPCAPS_LERP)
+		{
+			// choose source 0 (lerp factor)
+			if( bm.blendType == LBT_COLOUR )
+			{
+				tss = D3DTSS_COLORARG0;
+			}
+			else if( bm.blendType == LBT_ALPHA )
+			{
+				tss = D3DTSS_ALPHAARG0;
+			}
+			hr = __SetTextureStageState(stage, tss, D3DTA_DIFFUSE);
+
+			if (FAILED(hr))
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set lerp source 0", 
+					"D3D9RenderSystem::_setTextureBlendMode" );
+
+		}
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setSceneBlending( SceneBlendFactor sourceFactor, SceneBlendFactor destFactor )
+	{
+		HRESULT hr;
+		if( sourceFactor == SBF_ONE && destFactor == SBF_ZERO)
+		{
+			if (FAILED(hr = __SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE)))
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set alpha blending option", "D3D9RenderSystem::_setSceneBlending" );
+		}
+		else
+		{
+			if (FAILED(hr = __SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE)))
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set alpha blending option", "D3D9RenderSystem::_setSceneBlending" );
+			if( FAILED( hr = __SetRenderState( D3DRS_SRCBLEND, D3D9Mappings::get(sourceFactor) ) ) )
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set source blend", "D3D9RenderSystem::_setSceneBlending" );
+			if( FAILED( hr = __SetRenderState( D3DRS_DESTBLEND, D3D9Mappings::get(destFactor) ) ) )
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set destination blend", "D3D9RenderSystem::_setSceneBlending" );
+		}
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setAlphaRejectSettings( CompareFunction func, unsigned char value )
+	{
+		HRESULT hr;
+        if (func != CMPF_ALWAYS_PASS)
+        {
+            if( FAILED( hr = __SetRenderState( D3DRS_ALPHATESTENABLE,  TRUE ) ) )
+    			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to enable alpha testing", 
+                "D3D9RenderSystem::_setAlphaRejectSettings" );
+        }
+        else
+        {
+            if( FAILED( hr = __SetRenderState( D3DRS_ALPHATESTENABLE,  FALSE ) ) )
+    			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to disable alpha testing", 
+                "D3D9RenderSystem::_setAlphaRejectSettings" );
+        }
+        // Set always just be sure
+		if( FAILED( hr = __SetRenderState( D3DRS_ALPHAFUNC, D3D9Mappings::get(func) ) ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set alpha reject function", "D3D9RenderSystem::_setAlphaRejectSettings" );
+		if( FAILED( hr = __SetRenderState( D3DRS_ALPHAREF, value ) ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set render state D3DRS_ALPHAREF", "D3D9RenderSystem::_setAlphaRejectSettings" );
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setCullingMode( CullingMode mode )
+	{
+		HRESULT hr;
+        bool flip = ((mActiveRenderTarget->requiresTextureFlipping() && !mInvertVertexWinding) ||
+                (!mActiveRenderTarget->requiresTextureFlipping() && mInvertVertexWinding));
+
+		if( FAILED (hr = __SetRenderState(D3DRS_CULLMODE, 
+            D3D9Mappings::get(mode, flip))) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set culling mode", "D3D9RenderSystem::_setCullingMode" );
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setDepthBufferParams( bool depthTest, bool depthWrite, CompareFunction depthFunction )
+	{
+		_setDepthBufferCheckEnabled( depthTest );
+		_setDepthBufferWriteEnabled( depthWrite );
+		_setDepthBufferFunction( depthFunction );
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setDepthBufferCheckEnabled( bool enabled )
+	{
+		HRESULT hr;
+
+		if( enabled )
+		{
+			// Use w-buffer if available and enabled
+			if( mWBuffer && mCaps.RasterCaps & D3DPRASTERCAPS_WBUFFER )
+				hr = __SetRenderState( D3DRS_ZENABLE, D3DZB_USEW );
+			else
+				hr = __SetRenderState( D3DRS_ZENABLE, D3DZB_TRUE );
+		}
+		else
+			hr = __SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
+
+		if( FAILED( hr ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting depth buffer test state", "D3D9RenderSystem::_setDepthBufferCheckEnabled" );
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setDepthBufferWriteEnabled( bool enabled )
+	{
+		HRESULT hr;
+
+		if( FAILED( hr = __SetRenderState( D3DRS_ZWRITEENABLE, enabled ) ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting depth buffer write state", "D3D9RenderSystem::_setDepthBufferWriteEnabled" );
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setDepthBufferFunction( CompareFunction func )
+	{
+		HRESULT hr;
+		if( FAILED( hr = __SetRenderState( D3DRS_ZFUNC, D3D9Mappings::get(func) ) ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting depth buffer test function", "D3D9RenderSystem::_setDepthBufferFunction" );
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setDepthBias(float constantBias, float slopeScaleBias)
+	{
+	
+		if ((mCaps.RasterCaps & D3DPRASTERCAPS_DEPTHBIAS) != 0)
+		{
+			// Negate bias since D3D is backward
+			// D3D also expresses the constant bias as an absolute value, rather than 
+			// relative to minimum depth unit, so scale to fit
+			constantBias = -constantBias / 250000.0f;
+			HRESULT hr = __SetRenderState(D3DRS_DEPTHBIAS, FLOAT2DWORD(constantBias));
+			if (FAILED(hr))
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting constant depth bias", 
+				"D3D9RenderSystem::_setDepthBias");
+		}
+
+		if ((mCaps.RasterCaps & D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS) != 0)
+		{
+			// Negate bias since D3D is backward
+			slopeScaleBias = -slopeScaleBias;
+			HRESULT hr = __SetRenderState(D3DRS_SLOPESCALEDEPTHBIAS, FLOAT2DWORD(slopeScaleBias));
+			if (FAILED(hr))
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting slope scale depth bias", 
+				"D3D9RenderSystem::_setDepthBias");
+		}
+
+
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setColourBufferWriteEnabled(bool red, bool green, 
+		bool blue, bool alpha)
+	{
+		DWORD val = 0;
+		if (red) 
+			val |= D3DCOLORWRITEENABLE_RED;
+		if (green)
+			val |= D3DCOLORWRITEENABLE_GREEN;
+		if (blue)
+			val |= D3DCOLORWRITEENABLE_BLUE;
+		if (alpha)
+			val |= D3DCOLORWRITEENABLE_ALPHA;
+		HRESULT hr = __SetRenderState(D3DRS_COLORWRITEENABLE, val); 
+		if (FAILED(hr))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting colour write enable flags", 
+			"D3D9RenderSystem::_setColourBufferWriteEnabled");
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setFog( FogMode mode, const ColourValue& colour, Real densitiy, Real start, Real end )
+	{
+		HRESULT hr;
+
+		D3DRENDERSTATETYPE fogType, fogTypeNot;
+
+		if (mCaps.RasterCaps & D3DPRASTERCAPS_FOGTABLE)
+		{
+			fogType = D3DRS_FOGTABLEMODE;
+			fogTypeNot = D3DRS_FOGVERTEXMODE;
+		}
+		else
+		{
+			fogType = D3DRS_FOGVERTEXMODE;
+			fogTypeNot = D3DRS_FOGTABLEMODE;
+		}
+
+		if( mode == FOG_NONE)
+		{
+			// just disable
+			hr = __SetRenderState(fogType, D3DFOG_NONE );
+			hr = __SetRenderState(D3DRS_FOGENABLE, FALSE);
+		}
+		else
+		{
+			// Allow fog
+			hr = __SetRenderState( D3DRS_FOGENABLE, TRUE );
+			hr = __SetRenderState( fogTypeNot, D3DFOG_NONE );
+			hr = __SetRenderState( fogType, D3D9Mappings::get(mode) );
+
+			hr = __SetRenderState( D3DRS_FOGCOLOR, colour.getAsARGB() );
+			hr = __SetFloatRenderState( D3DRS_FOGSTART, start );
+			hr = __SetFloatRenderState( D3DRS_FOGEND, end );
+			hr = __SetFloatRenderState( D3DRS_FOGDENSITY, densitiy );
+		}
+
+		if( FAILED( hr ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting render state", "D3D9RenderSystem::_setFog" );
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setPolygonMode(PolygonMode level)
+	{
+		HRESULT hr = __SetRenderState(D3DRS_FILLMODE, D3D9Mappings::get(level));
+		if (FAILED(hr))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting polygon mode.", "D3D9RenderSystem::setPolygonMode");
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::setStencilCheckEnabled(bool enabled)
+	{
+		// Allow stencilling
+		HRESULT hr = __SetRenderState(D3DRS_STENCILENABLE, enabled);
+		if (FAILED(hr))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error enabling / disabling stencilling.",
+			"D3D9RenderSystem::setStencilCheckEnabled");
+	}
+    //---------------------------------------------------------------------
+    void D3D9RenderSystem::setStencilBufferParams(CompareFunction func, 
+        uint32 refValue, uint32 mask, StencilOperation stencilFailOp, 
+        StencilOperation depthFailOp, StencilOperation passOp, 
+        bool twoSidedOperation)
+    {
+        HRESULT hr;
+        bool flip;
+
+        // 2-sided operation
+        if (twoSidedOperation)
+        {
+            if (!mCapabilities->hasCapability(RSC_TWO_SIDED_STENCIL))
+                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "2-sided stencils are not supported",
+                    "D3D9RenderSystem::setStencilBufferParams");
+            hr = __SetRenderState(D3DRS_TWOSIDEDSTENCILMODE, TRUE);
+		    if (FAILED(hr))
+			    OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting 2-sided stencil mode.",
+			    "D3D9RenderSystem::setStencilBufferParams");
+            // NB: We should always treat CCW as front face for consistent with default
+            // culling mode. Therefore, we must take care with two-sided stencil settings.
+            flip = (mInvertVertexWinding && mActiveRenderTarget->requiresTextureFlipping()) ||
+                   (!mInvertVertexWinding && !mActiveRenderTarget->requiresTextureFlipping());
+
+            // Set alternative versions of ops
+            // fail op
+            hr = __SetRenderState(D3DRS_CCW_STENCILFAIL, D3D9Mappings::get(stencilFailOp, !flip));
+            if (FAILED(hr))
+                OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting stencil fail operation (2-sided).",
+                "D3D9RenderSystem::setStencilBufferParams");
+
+            // depth fail op
+            hr = __SetRenderState(D3DRS_CCW_STENCILZFAIL, D3D9Mappings::get(depthFailOp, !flip));
+            if (FAILED(hr))
+                OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting stencil depth fail operation (2-sided).",
+                "D3D9RenderSystem::setStencilBufferParams");
+
+            // pass op
+            hr = __SetRenderState(D3DRS_CCW_STENCILPASS, D3D9Mappings::get(passOp, !flip));
+            if (FAILED(hr))
+                OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting stencil pass operation (2-sided).",
+                "D3D9RenderSystem::setStencilBufferParams");
+        }
+        else
+        {
+            hr = __SetRenderState(D3DRS_TWOSIDEDSTENCILMODE, FALSE);
+		    if (FAILED(hr))
+			    OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting 1-sided stencil mode.",
+			    "D3D9RenderSystem::setStencilBufferParams");
+            flip = false;
+        }
+
+        // func
+        hr = __SetRenderState(D3DRS_STENCILFUNC, D3D9Mappings::get(func));
+		if (FAILED(hr))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting stencil buffer test function.",
+			"D3D9RenderSystem::setStencilBufferParams");
+
+        // reference value
+        hr = __SetRenderState(D3DRS_STENCILREF, refValue);
+		if (FAILED(hr))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting stencil buffer reference value.",
+			"D3D9RenderSystem::setStencilBufferParams");
+
+        // mask
+        hr = __SetRenderState(D3DRS_STENCILMASK, mask);
+		if (FAILED(hr))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting stencil buffer mask.",
+			"D3D9RenderSystem::setStencilBufferParams");
+
+		// fail op
+        hr = __SetRenderState(D3DRS_STENCILFAIL, D3D9Mappings::get(stencilFailOp, flip));
+		if (FAILED(hr))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting stencil fail operation.",
+			"D3D9RenderSystem::setStencilBufferParams");
+
+        // depth fail op
+        hr = __SetRenderState(D3DRS_STENCILZFAIL, D3D9Mappings::get(depthFailOp, flip));
+		if (FAILED(hr))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting stencil depth fail operation.",
+			"D3D9RenderSystem::setStencilBufferParams");
+
+        // pass op
+        hr = __SetRenderState(D3DRS_STENCILPASS, D3D9Mappings::get(passOp, flip));
+		if (FAILED(hr))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error setting stencil pass operation.",
+			"D3D9RenderSystem::setStencilBufferParams");
+	}
+	//---------------------------------------------------------------------
+    void D3D9RenderSystem::_setTextureUnitFiltering(size_t unit, FilterType ftype, 
+        FilterOptions filter)
+	{
+		HRESULT hr;
+		D3D9Mappings::eD3DTexType texType = mTexStageDesc[unit].texType;
+        hr = __SetSamplerState( unit, D3D9Mappings::get(ftype), 
+            D3D9Mappings::get(ftype, filter, mCaps, texType));
+		if (FAILED(hr))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set texture filter ", "D3D9RenderSystem::_setTextureUnitFiltering");
+	}
+    //---------------------------------------------------------------------
+	DWORD D3D9RenderSystem::_getCurrentAnisotropy(size_t unit)
+	{
+		DWORD oldVal;
+		mpD3DDevice->GetSamplerState(unit, D3DSAMP_MAXANISOTROPY, &oldVal);
+			return oldVal;
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setTextureLayerAnisotropy(size_t unit, unsigned int maxAnisotropy)
+	{
+		if ((DWORD)maxAnisotropy > mCaps.MaxAnisotropy)
+			maxAnisotropy = mCaps.MaxAnisotropy;
+
+		if (_getCurrentAnisotropy(unit) != maxAnisotropy)
+			__SetSamplerState( unit, D3DSAMP_MAXANISOTROPY, maxAnisotropy );
+	}
+	//---------------------------------------------------------------------
+	HRESULT D3D9RenderSystem::__SetRenderState(D3DRENDERSTATETYPE state, DWORD value)
+	{
+		HRESULT hr;
+		DWORD oldVal;
+
+		if ( FAILED( hr = mpD3DDevice->GetRenderState(state, &oldVal) ) )
+			return hr;
+		if ( oldVal == value )
+			return D3D_OK;
+		else
+			return mpD3DDevice->SetRenderState(state, value);
+	}
+	//---------------------------------------------------------------------
+	HRESULT D3D9RenderSystem::__SetSamplerState(DWORD sampler, D3DSAMPLERSTATETYPE type, DWORD value)
+	{
+		HRESULT hr;
+		DWORD oldVal;
+
+		if ( FAILED( hr = mpD3DDevice->GetSamplerState(sampler, type, &oldVal) ) )
+			return hr;
+		if ( oldVal == value )
+			return D3D_OK;
+		else
+			return mpD3DDevice->SetSamplerState(sampler, type, value);
+	}
+	//---------------------------------------------------------------------
+	HRESULT D3D9RenderSystem::__SetTextureStageState(DWORD stage, D3DTEXTURESTAGESTATETYPE type, DWORD value)
+	{
+		HRESULT hr;
+		DWORD oldVal;
+		
+		if ( FAILED( hr = mpD3DDevice->GetTextureStageState(stage, type, &oldVal) ) )
+			return hr;
+		if ( oldVal == value )
+			return D3D_OK;
+		else
+			return mpD3DDevice->SetTextureStageState(stage, type, value);
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_setViewport( Viewport *vp )
+	{
+		if( vp != mActiveViewport || vp->_isUpdated() )
+		{
+			mActiveViewport = vp;
+			mActiveRenderTarget = vp->getTarget();
+
+			// ok, it's different, time to set render target and viewport params
+			D3DVIEWPORT9 d3dvp;
+			HRESULT hr;
+
+			// Set render target
+			RenderTarget* target;
+			target = vp->getTarget();
+
+			// Retrieve render surfaces (up to OGRE_MAX_MULTIPLE_RENDER_TARGETS)
+			LPDIRECT3DSURFACE9 pBack[OGRE_MAX_MULTIPLE_RENDER_TARGETS];
+			memset(pBack, 0, sizeof(pBack));
+			target->getCustomAttribute( "DDBACKBUFFER", &pBack );
+			if (!pBack[0])
+				return;
+
+			LPDIRECT3DSURFACE9 pDepth = NULL;
+			target->getCustomAttribute( "D3DZBUFFER", &pDepth );
+			if (!pDepth)
+			{
+				/// No depth buffer provided, use our own
+				/// Request a depth stencil that is compatible with the format, multisample type and
+				/// dimensions of the render target.
+				D3DSURFACE_DESC srfDesc;
+				if(FAILED(pBack[0]->GetDesc(&srfDesc)))
+					return; // ?
+				pDepth = _getDepthStencilFor(srfDesc.Format, srfDesc.MultiSampleType, srfDesc.Width, srfDesc.Height);
+			}
+			// Bind render targets
+			uint count = mCapabilities->numMultiRenderTargets();
+			for(uint x=0; x<count; ++x)
+			{
+				hr = mpD3DDevice->SetRenderTarget(x, pBack[x]);
+				if (FAILED(hr))
+				{
+					String msg = DXGetErrorDescription9(hr);
+					OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to setRenderTarget : " + msg, "D3D9RenderSystem::_setViewport" );
+				}
+			}
+			hr = mpD3DDevice->SetDepthStencilSurface(pDepth);
+			if (FAILED(hr))
+			{
+				String msg = DXGetErrorDescription9(hr);
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to setDepthStencil : " + msg, "D3D9RenderSystem::_setViewport" );
+			}
+
+			_setCullingMode( mCullingMode );
+
+			// set viewport dimensions
+			d3dvp.X = vp->getActualLeft();
+			d3dvp.Y = vp->getActualTop();
+			d3dvp.Width = vp->getActualWidth();
+			d3dvp.Height = vp->getActualHeight();
+            if (target->requiresTextureFlipping())
+            {
+                // Convert "top-left" to "bottom-left"
+                d3dvp.Y = target->getHeight() - d3dvp.Height - d3dvp.Y;
+            }
+
+			// Z-values from 0.0 to 1.0 (TODO: standardise with OpenGL)
+			d3dvp.MinZ = 0.0f;
+			d3dvp.MaxZ = 1.0f;
+
+			if( FAILED( hr = mpD3DDevice->SetViewport( &d3dvp ) ) )
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set viewport.", "D3D9RenderSystem::_setViewport" );
+
+			vp->_clearUpdatedFlag();
+		}
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_beginFrame()
+	{
+		HRESULT hr;
+
+		if( !mActiveViewport )
+			OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR, "Cannot begin frame - no viewport selected.", "D3D9RenderSystem::_beginFrame" );
+
+		if( FAILED( hr = mpD3DDevice->BeginScene() ) )
+		{
+			String msg = DXGetErrorDescription9(hr);
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error beginning frame :" + msg, "D3D9RenderSystem::_beginFrame" );
+		}
+
+		if(!mBasicStatesInitialised)
+		{
+			// First-time 
+			// setup some defaults
+			// Allow specular
+			hr = __SetRenderState(D3DRS_SPECULARENABLE, TRUE);
+			if (FAILED(hr))
+			{
+				String msg = DXGetErrorDescription9(hr);
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error enabling alpha blending option : " + msg, "D3D9RenderSystem::_beginFrame");
+			}
+			mBasicStatesInitialised = true;
+		}
+
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_endFrame()
+	{
+
+		HRESULT hr;
+		if( FAILED( hr = mpD3DDevice->EndScene() ) )
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error ending frame", "D3D9RenderSystem::_endFrame" );
+
+	}
+	//---------------------------------------------------------------------
+	inline bool D3D9RenderSystem::compareDecls( D3DVERTEXELEMENT9* pDecl1, D3DVERTEXELEMENT9* pDecl2, size_t size )
+	{
+		for( size_t i=0; i < size; i++ )
+		{
+			if( pDecl1[i].Method != pDecl2[i].Method ||
+				pDecl1[i].Offset != pDecl2[i].Offset ||
+				pDecl1[i].Stream != pDecl2[i].Stream ||
+				pDecl1[i].Type != pDecl2[i].Type ||
+				pDecl1[i].Usage != pDecl2[i].Usage ||
+				pDecl1[i].UsageIndex != pDecl2[i].UsageIndex)
+			{
+				return false;
+			}
+		}
+
+		return true;
+	}
+    //---------------------------------------------------------------------
+	void D3D9RenderSystem::setVertexDeclaration(VertexDeclaration* decl)
+	{
+        HRESULT hr;
+
+        D3D9VertexDeclaration* d3ddecl = 
+            static_cast<D3D9VertexDeclaration*>(decl);
+
+        if (FAILED(hr = mpD3DDevice->SetVertexDeclaration(d3ddecl->getD3DVertexDeclaration())))
+        {
+            OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to set D3D9 vertex declaration", 
+                "D3D9RenderSystem::setVertexDeclaration");
+        }
+
+	}
+    //---------------------------------------------------------------------
+	void D3D9RenderSystem::setVertexBufferBinding(VertexBufferBinding* binding)
+	{
+        HRESULT hr;
+
+        // TODO: attempt to detect duplicates
+        const VertexBufferBinding::VertexBufferBindingMap& binds = binding->getBindings();
+        VertexBufferBinding::VertexBufferBindingMap::const_iterator i, iend;
+        size_t source = 0;
+        iend = binds.end();
+        for (i = binds.begin(); i != iend; ++i, ++source)
+        {
+            // Unbind gap sources
+            for ( ; source < i->first; ++source)
+            {
+                hr = mpD3DDevice->SetStreamSource(static_cast<UINT>(source), NULL, 0, 0);
+                if (FAILED(hr))
+                {
+                    OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to reset unused D3D9 stream source", 
+                        "D3D9RenderSystem::setVertexBufferBinding");
+                }
+            }
+
+            const D3D9HardwareVertexBuffer* d3d9buf = 
+                static_cast<const D3D9HardwareVertexBuffer*>(i->second.get());
+            hr = mpD3DDevice->SetStreamSource(
+                static_cast<UINT>(source),
+                d3d9buf->getD3D9VertexBuffer(),
+                0, // no stream offset, this is handled in _render instead
+                static_cast<UINT>(d3d9buf->getVertexSize()) // stride
+                );
+            if (FAILED(hr))
+            {
+                OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to set D3D9 stream source for buffer binding", 
+                    "D3D9RenderSystem::setVertexBufferBinding");
+            }
+
+
+        }
+
+		// Unbind any unused sources
+		for (size_t unused = source; unused < mLastVertexSourceCount; ++unused)
+		{
+			
+            hr = mpD3DDevice->SetStreamSource(static_cast<UINT>(unused), NULL, 0, 0);
+            if (FAILED(hr))
+            {
+                OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to reset unused D3D9 stream source", 
+                    "D3D9RenderSystem::setVertexBufferBinding");
+            }
+			
+		}
+		mLastVertexSourceCount = source;
+		
+	}
+    //---------------------------------------------------------------------
+    void D3D9RenderSystem::_render(const RenderOperation& op)
+	{
+        // Exit immediately if there is nothing to render
+        // This caused a problem on FireGL 8800
+        if (op.vertexData->vertexCount == 0)
+            return;
+
+        // Call super class
+		RenderSystem::_render(op);
+
+        // To think about: possibly remove setVertexDeclaration and 
+        // setVertexBufferBinding from RenderSystem since the sequence is
+        // a bit too D3D9-specific?
+		setVertexDeclaration(op.vertexData->vertexDeclaration);
+        setVertexBufferBinding(op.vertexData->vertexBufferBinding);
+
+		// Determine rendering operation
+		D3DPRIMITIVETYPE primType = D3DPT_TRIANGLELIST;
+		DWORD primCount = 0;
+        switch( op.operationType )
+		{
+        case RenderOperation::OT_POINT_LIST:
+			primType = D3DPT_POINTLIST;
+			primCount = (DWORD)(op.useIndexes ? op.indexData->indexCount : op.vertexData->vertexCount);
+			break;
+
+		case RenderOperation::OT_LINE_LIST:
+			primType = D3DPT_LINELIST;
+			primCount = (DWORD)(op.useIndexes ? op.indexData->indexCount : op.vertexData->vertexCount) / 2;
+			break;
+
+		case RenderOperation::OT_LINE_STRIP:
+			primType = D3DPT_LINESTRIP;
+			primCount = (DWORD)(op.useIndexes ? op.indexData->indexCount : op.vertexData->vertexCount) - 1;
+			break;
+
+		case RenderOperation::OT_TRIANGLE_LIST:
+			primType = D3DPT_TRIANGLELIST;
+			primCount = (DWORD)(op.useIndexes ? op.indexData->indexCount : op.vertexData->vertexCount) / 3;
+			break;
+
+		case RenderOperation::OT_TRIANGLE_STRIP:
+			primType = D3DPT_TRIANGLESTRIP;
+			primCount = (DWORD)(op.useIndexes ? op.indexData->indexCount : op.vertexData->vertexCount) - 2;
+			break;
+
+		case RenderOperation::OT_TRIANGLE_FAN:
+			primType = D3DPT_TRIANGLEFAN;
+			primCount = (DWORD)(op.useIndexes ? op.indexData->indexCount : op.vertexData->vertexCount) - 2;
+			break;
+		}
+
+        if (!primCount)
+			return;
+
+		// Issue the op
+        HRESULT hr;
+		if( op.useIndexes )
+		{
+            D3D9HardwareIndexBuffer* d3dIdxBuf = 
+                static_cast<D3D9HardwareIndexBuffer*>(op.indexData->indexBuffer.get());
+			hr = mpD3DDevice->SetIndices( d3dIdxBuf->getD3DIndexBuffer() );
+			if (FAILED(hr))
+            {
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set index buffer", "D3D9RenderSystem::_render" );
+            }
+
+            do
+            {
+                // do indexed draw operation
+			    hr = mpD3DDevice->DrawIndexedPrimitive(
+                    primType, 
+                    static_cast<INT>(op.vertexData->vertexStart), 
+                    0, // Min vertex index - assume we can go right down to 0 
+                    static_cast<UINT>(op.vertexData->vertexCount), 
+                    static_cast<UINT>(op.indexData->indexStart), 
+                    static_cast<UINT>(primCount)
+                    );
+
+            } while (updatePassIterationRenderState());
+		}
+		else
+        {
+            // nfz: gpu_iterate
+            do
+            {
+                // Unindexed, a little simpler!
+			    hr = mpD3DDevice->DrawPrimitive(
+                    primType, 
+                    static_cast<UINT>(op.vertexData->vertexStart), 
+                    static_cast<UINT>(primCount)
+                    ); 
+
+            } while (updatePassIterationRenderState());
+        } 
+
+		if( FAILED( hr ) )
+		{
+			String msg = DXGetErrorDescription9(hr);
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to DrawPrimitive : " + msg, "D3D9RenderSystem::_render" );
+		}
+        
+	}
+    //---------------------------------------------------------------------
+    void D3D9RenderSystem::setNormaliseNormals(bool normalise)
+    {
+        __SetRenderState(D3DRS_NORMALIZENORMALS, 
+            normalise ? TRUE : FALSE);
+    }
+	//---------------------------------------------------------------------
+    void D3D9RenderSystem::bindGpuProgram(GpuProgram* prg)
+    {
+        HRESULT hr;
+        switch (prg->getType())
+        {
+        case GPT_VERTEX_PROGRAM:
+            hr = mpD3DDevice->SetVertexShader(
+                static_cast<D3D9GpuVertexProgram*>(prg)->getVertexShader());
+            if (FAILED(hr))
+            {
+                OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error calling SetVertexShader", "D3D9RenderSystem::bindGpuProgram");
+            }
+            break;
+        case GPT_FRAGMENT_PROGRAM:
+            hr = mpD3DDevice->SetPixelShader(
+                static_cast<D3D9GpuFragmentProgram*>(prg)->getPixelShader());
+            if (FAILED(hr))
+            {
+                OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error calling SetPixelShader", "D3D9RenderSystem::bindGpuProgram");
+            }
+            break;
+        };
+        
+        RenderSystem::bindGpuProgram(prg);
+
+    }
+	//---------------------------------------------------------------------
+    void D3D9RenderSystem::unbindGpuProgram(GpuProgramType gptype)
+    {
+        HRESULT hr;
+        switch(gptype)
+        {
+        case GPT_VERTEX_PROGRAM:
+            mActiveVertexGpuProgramParameters.setNull();
+            hr = mpD3DDevice->SetVertexShader(NULL);
+            if (FAILED(hr))
+            {
+                OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error resetting SetVertexShader to NULL", 
+                    "D3D9RenderSystem::unbindGpuProgram");
+            }
+            break;
+        case GPT_FRAGMENT_PROGRAM:
+            mActiveFragmentGpuProgramParameters.setNull();
+            hr = mpD3DDevice->SetPixelShader(NULL);
+            if (FAILED(hr))
+            {
+                OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error resetting SetPixelShader to NULL", 
+                    "D3D9RenderSystem::unbindGpuProgram");
+            }
+            break;
+        };
+        RenderSystem::unbindGpuProgram(gptype);
+    }
+	//---------------------------------------------------------------------
+    void D3D9RenderSystem::bindGpuProgramParameters(GpuProgramType gptype, 
+        GpuProgramParametersSharedPtr params)
+    {
+        HRESULT hr;
+		const GpuLogicalBufferStruct* floatLogical = params->getFloatLogicalBufferStruct();
+		const GpuLogicalBufferStruct* intLogical = params->getIntLogicalBufferStruct();
+
+        switch(gptype)
+        {
+        case GPT_VERTEX_PROGRAM:
+            mActiveVertexGpuProgramParameters = params;
+			{
+				OGRE_LOCK_MUTEX(floatLogical->mutex)
+
+				for (GpuLogicalIndexUseMap::const_iterator i = floatLogical->map.begin();
+					i != floatLogical->map.end(); ++i)
+				{
+					size_t logicalIndex = i->first;
+					const float* pFloat = params->getFloatPointer(i->second.physicalIndex);
+					size_t slotCount = i->second.currentSize / 4;
+					assert (i->second.currentSize % 4 == 0 && "Should not have any "
+						"elements less than 4 wide for D3D9");
+
+					if (FAILED(hr = mpD3DDevice->SetVertexShaderConstantF(
+						logicalIndex, pFloat, slotCount)))
+					{
+						OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+							"Unable to upload vertex shader float parameters", 
+							"D3D9RenderSystem::bindGpuProgramParameters");
+					}
+
+				}
+
+			}
+			// bind ints
+			{
+				OGRE_LOCK_MUTEX(intLogical->mutex)
+
+				for (GpuLogicalIndexUseMap::const_iterator i = intLogical->map.begin();
+					i != intLogical->map.end(); ++i)
+				{
+					size_t logicalIndex = i->first;
+					const int* pInt = params->getIntPointer(i->second.physicalIndex);
+					size_t slotCount = i->second.currentSize / 4;
+					assert (i->second.currentSize % 4 == 0 && "Should not have any "
+						"elements less than 4 wide for D3D9");
+
+					if (FAILED(hr = mpD3DDevice->SetVertexShaderConstantI(
+						logicalIndex, pInt, slotCount)))
+					{
+						OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+							"Unable to upload vertex shader int parameters", 
+							"D3D9RenderSystem::bindGpuProgramParameters");
+					}
+
+				}
+
+			}
+
+            break;
+        case GPT_FRAGMENT_PROGRAM:
+            mActiveFragmentGpuProgramParameters = params;
+			{
+				OGRE_LOCK_MUTEX(floatLogical->mutex)
+
+				for (GpuLogicalIndexUseMap::const_iterator i = floatLogical->map.begin();
+					i != floatLogical->map.end(); ++i)
+				{
+					size_t logicalIndex = i->first;
+					const float* pFloat = params->getFloatPointer(i->second.physicalIndex);
+					size_t slotCount = i->second.currentSize / 4;
+					assert (i->second.currentSize % 4 == 0 && "Should not have any "
+						"elements less than 4 wide for D3D9");
+
+					if (FAILED(hr = mpD3DDevice->SetPixelShaderConstantF(
+						logicalIndex, pFloat, slotCount)))
+					{
+						OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+							"Unable to upload pixel shader float parameters", 
+							"D3D9RenderSystem::bindGpuProgramParameters");
+					}
+
+				}
+
+			}
+			// bind ints
+			{
+				OGRE_LOCK_MUTEX(intLogical->mutex)
+
+				for (GpuLogicalIndexUseMap::const_iterator i = intLogical->map.begin();
+					i != intLogical->map.end(); ++i)
+				{
+					size_t logicalIndex = i->first;
+					const int* pInt = params->getIntPointer(i->second.physicalIndex);
+					size_t slotCount = i->second.currentSize / 4;
+					assert (i->second.currentSize % 4 == 0 && "Should not have any "
+						"elements less than 4 wide for D3D9");
+
+					if (FAILED(hr = mpD3DDevice->SetPixelShaderConstantI(
+						logicalIndex, pInt, slotCount)))
+					{
+						OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+							"Unable to upload pixel shader int parameters", 
+							"D3D9RenderSystem::bindGpuProgramParameters");
+					}
+
+				}
+
+			}
+            break;
+        };
+    }
+	//---------------------------------------------------------------------
+    void D3D9RenderSystem::bindGpuProgramPassIterationParameters(GpuProgramType gptype)
+    {
+
+        HRESULT hr;
+		size_t physicalIndex = 0;
+		size_t logicalIndex = 0;
+		const float* pFloat;
+
+        switch(gptype)
+        {
+        case GPT_VERTEX_PROGRAM:
+			if (mActiveVertexGpuProgramParameters->hasPassIterationNumber())
+			{
+	            physicalIndex = mActiveVertexGpuProgramParameters->getPassIterationNumberIndex();
+				logicalIndex = mActiveVertexGpuProgramParameters->getFloatLogicalIndexForPhysicalIndex(physicalIndex);
+				pFloat = mActiveVertexGpuProgramParameters->getFloatPointer(physicalIndex);
+				
+                if (FAILED(hr = mpD3DDevice->SetVertexShaderConstantF(
+                        logicalIndex, pFloat, 1)))
+				{
+                    OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+						"Unable to upload vertex shader multi pass parameters", 
+						"D3D9RenderSystem::bindGpuProgramMultiPassParameters");
+                }
+            }
+            break;
+
+        case GPT_FRAGMENT_PROGRAM:
+            if (mActiveFragmentGpuProgramParameters->hasPassIterationNumber())
+            {
+				physicalIndex = mActiveFragmentGpuProgramParameters->getPassIterationNumberIndex();
+				logicalIndex = mActiveFragmentGpuProgramParameters->getFloatLogicalIndexForPhysicalIndex(physicalIndex);
+				pFloat = mActiveFragmentGpuProgramParameters->getFloatPointer(physicalIndex);
+                if (FAILED(hr = mpD3DDevice->SetPixelShaderConstantF(
+                        logicalIndex, pFloat, 1)))
+                {
+                    OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+						"Unable to upload pixel shader multi pass parameters", 
+						"D3D9RenderSystem::bindGpuProgramMultiPassParameters");
+                }
+            }
+            break;
+
+        }
+    }
+    //---------------------------------------------------------------------
+    void D3D9RenderSystem::setClipPlanes(const PlaneList& clipPlanes)
+    {
+        size_t i;
+        size_t numClipPlanes;
+        float dx9ClipPlane[4];
+        DWORD mask = 0;
+        HRESULT hr;
+
+        numClipPlanes = clipPlanes.size();
+        for (i = 0; i < numClipPlanes; ++i)
+        {
+            const Plane& plane = clipPlanes[i];
+
+            dx9ClipPlane[0] = plane.normal.x;
+            dx9ClipPlane[1] = plane.normal.y;
+            dx9ClipPlane[2] = plane.normal.z;
+            dx9ClipPlane[3] = plane.d;
+
+            hr = mpD3DDevice->SetClipPlane(i, dx9ClipPlane);
+            if (FAILED(hr))
+            {
+                OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to set clip plane", 
+                    "D3D9RenderSystem::setClipPlanes");
+            }
+
+            mask |= (1 << i);
+        }
+
+        hr = __SetRenderState(D3DRS_CLIPPLANEENABLE, mask);
+        if (FAILED(hr))
+        {
+            OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to set render state for clip planes", 
+                "D3D9RenderSystem::setClipPlanes");
+        }
+    }
+	//---------------------------------------------------------------------
+    void D3D9RenderSystem::setScissorTest(bool enabled, size_t left, size_t top, size_t right,
+        size_t bottom)
+    {
+        HRESULT hr;
+        if (enabled)
+        {
+            if (FAILED(hr = __SetRenderState(D3DRS_SCISSORTESTENABLE, TRUE)))
+            {
+                OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to enable scissor rendering state; " + getErrorDescription(hr), 
+                    "D3D9RenderSystem::setScissorTest");
+            }
+            RECT rect;
+            rect.left = left;
+            rect.top = top;
+            rect.bottom = bottom;
+            rect.right = right;
+            if (FAILED(hr = mpD3DDevice->SetScissorRect(&rect)))
+            {
+                OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to set scissor rectangle; " + getErrorDescription(hr), 
+                    "D3D9RenderSystem::setScissorTest");
+            }
+        }
+        else
+        {
+            if (FAILED(hr = __SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE)))
+            {
+                OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to disable scissor rendering state; " + getErrorDescription(hr), 
+                    "D3D9RenderSystem::setScissorTest");
+            }
+        }
+    }
+    //---------------------------------------------------------------------
+    void D3D9RenderSystem::clearFrameBuffer(unsigned int buffers, 
+        const ColourValue& colour, Real depth, unsigned short stencil)
+    {
+        DWORD flags = 0;
+        if (buffers & FBT_COLOUR)
+        {
+            flags |= D3DCLEAR_TARGET;
+        }
+        if (buffers & FBT_DEPTH)
+        {
+            flags |= D3DCLEAR_ZBUFFER;
+        }
+        // Only try to clear the stencil buffer if supported
+        if (buffers & FBT_STENCIL && mCapabilities->hasCapability(RSC_HWSTENCIL))
+        {
+            flags |= D3DCLEAR_STENCIL;
+        }
+        HRESULT hr;
+        if( FAILED( hr = mpD3DDevice->Clear( 
+            0, 
+            NULL, 
+            flags,
+            colour.getAsARGB(), 
+            depth, 
+            stencil ) ) )
+        {
+            String msg = DXGetErrorDescription9(hr);
+            OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error clearing frame buffer : " 
+                + msg, "D3D9RenderSystem::clearFrameBuffer" );
+        }
+    }
+    //---------------------------------------------------------------------
+    void D3D9RenderSystem::_makeProjectionMatrix(Real left, Real right, 
+        Real bottom, Real top, Real nearPlane, Real farPlane, Matrix4& dest,
+        bool forGpuProgram)
+    {
+        // Correct position for off-axis projection matrix
+        if (!forGpuProgram)
+        {
+            Real offsetX = left + right;
+            Real offsetY = top + bottom;
+
+            left -= offsetX;
+            right -= offsetX;
+            top -= offsetY;
+            bottom -= offsetY;
+        }
+
+        Real width = right - left;
+        Real height = top - bottom;
+        Real q, qn;
+        if (farPlane == 0)
+        {
+            q = 1 - Frustum::INFINITE_FAR_PLANE_ADJUST;
+            qn = nearPlane * (Frustum::INFINITE_FAR_PLANE_ADJUST - 1);
+        }
+        else
+        {
+            q = farPlane / ( farPlane - nearPlane );
+            qn = -q * nearPlane;
+        }
+        dest = Matrix4::ZERO;
+        dest[0][0] = 2 * nearPlane / width;
+        dest[0][2] = (right+left) / width;
+        dest[1][1] = 2 * nearPlane / height;
+        dest[1][2] = (top+bottom) / height;
+        if (forGpuProgram)
+        {
+            dest[2][2] = -q;
+            dest[3][2] = -1.0f;
+        }
+        else
+        {
+            dest[2][2] = q;
+            dest[3][2] = 1.0f;
+        }
+        dest[2][3] = qn;
+    }
+
+    // ------------------------------------------------------------------
+    void D3D9RenderSystem::setClipPlane (ushort index, Real A, Real B, Real C, Real D)
+    {
+        float plane[4] = { A, B, C, D };
+        mpD3DDevice->SetClipPlane (index, plane);
+    }
+
+    // ------------------------------------------------------------------
+    void D3D9RenderSystem::enableClipPlane (ushort index, bool enable)
+    {
+        DWORD prev;
+        mpD3DDevice->GetRenderState(D3DRS_CLIPPLANEENABLE, &prev);
+        __SetRenderState(D3DRS_CLIPPLANEENABLE, enable?
+			(prev | (1 << index)) : (prev & ~(1 << index)));
+    }
+    //---------------------------------------------------------------------
+    HardwareOcclusionQuery* D3D9RenderSystem::createHardwareOcclusionQuery(void)
+    {
+		D3D9HardwareOcclusionQuery* ret = new D3D9HardwareOcclusionQuery (mpD3DDevice); 
+		mHwOcclusionQueries.push_back(ret);
+		return ret;
+    }
+    //---------------------------------------------------------------------
+    Real D3D9RenderSystem::getHorizontalTexelOffset(void)
+    {
+        // D3D considers the origin to be in the center of a pixel
+        return -0.5f;
+    }
+    //---------------------------------------------------------------------
+    Real D3D9RenderSystem::getVerticalTexelOffset(void)
+    {
+        // D3D considers the origin to be in the center of a pixel
+        return -0.5f;
+    }
+    //---------------------------------------------------------------------
+    void D3D9RenderSystem::_applyObliqueDepthProjection(Matrix4& matrix, const Plane& plane, 
+        bool forGpuProgram)
+    {
+        // Thanks to Eric Lenyel for posting this calculation at www.terathon.com
+
+        // Calculate the clip-space corner point opposite the clipping plane
+        // as (sgn(clipPlane.x), sgn(clipPlane.y), 1, 1) and
+        // transform it into camera space by multiplying it
+        // by the inverse of the projection matrix
+
+        /* generalised version
+        Vector4 q = matrix.inverse() * 
+            Vector4(Math::Sign(plane.normal.x), Math::Sign(plane.normal.y), 1.0f, 1.0f);
+        */
+        Vector4 q;
+        q.x = Math::Sign(plane.normal.x) / matrix[0][0];
+        q.y = Math::Sign(plane.normal.y) / matrix[1][1];
+        q.z = 1.0F; 
+        // flip the next bit from Lengyel since we're right-handed
+        if (forGpuProgram)
+        {
+            q.w = (1.0F - matrix[2][2]) / matrix[2][3];
+        }
+        else
+        {
+            q.w = (1.0F + matrix[2][2]) / matrix[2][3];
+        }
+
+        // Calculate the scaled plane vector
+        Vector4 clipPlane4d(plane.normal.x, plane.normal.y, plane.normal.z, plane.d);
+        Vector4 c = clipPlane4d * (1.0F / (clipPlane4d.dotProduct(q)));
+
+        // Replace the third row of the projection matrix
+        matrix[2][0] = c.x;
+        matrix[2][1] = c.y;
+        // flip the next bit from Lengyel since we're right-handed
+        if (forGpuProgram)
+        {
+            matrix[2][2] = c.z; 
+        }
+        else
+        {
+            matrix[2][2] = -c.z; 
+        }
+        matrix[2][3] = c.w;        
+    }
+    //---------------------------------------------------------------------
+    Real D3D9RenderSystem::getMinimumDepthInputValue(void)
+    {
+        // Range [0.0f, 1.0f]
+        return 0.0f;
+    }
+    //---------------------------------------------------------------------
+    Real D3D9RenderSystem::getMaximumDepthInputValue(void)
+    {
+        // Range [0.0f, 1.0f]
+        // D3D inverts even identity view matrices, so maximum INPUT is -1.0
+        return -1.0f;
+    }
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::restoreLostDevice(void)
+	{
+		// Release all non-managed resources
+
+		// Cleanup depth stencils
+		_cleanupDepthStencils();
+
+		// Set all texture units to nothing
+		_disableTextureUnitsFrom(0);
+
+		// Unbind any vertex streams
+		for (size_t i = 0; i < mLastVertexSourceCount; ++i)
+		{
+			mpD3DDevice->SetStreamSource(i, NULL, 0, 0);
+		}
+        mLastVertexSourceCount = 0;
+
+        // Release all automatic temporary buffers and free unused
+        // temporary buffers, so we doesn't need to recreate them,
+        // and they will reallocate on demand. This save a lot of
+        // release/recreate of non-managed vertex buffers which
+        // wasn't need at all.
+        mHardwareBufferManager->_releaseBufferCopies(true);
+
+		// We have to deal with non-managed textures and vertex buffers
+		// GPU programs don't have to be restored
+		static_cast<D3D9TextureManager*>(mTextureManager)->releaseDefaultPoolResources();
+		static_cast<D3D9HardwareBufferManager*>(mHardwareBufferManager)
+			->releaseDefaultPoolResources();
+
+		// release additional swap chains (secondary windows)
+		SecondaryWindowList::iterator sw;
+		for (sw = mSecondaryWindows.begin(); sw != mSecondaryWindows.end(); ++sw)
+		{
+			(*sw)->destroyD3DResources();
+		}
+
+		D3DPRESENT_PARAMETERS* presParams = mPrimaryWindow->getPresentationParameters();
+		// Reset the device, using the primary window presentation params
+		HRESULT hr = mpD3DDevice->Reset(presParams);
+
+		if (hr == D3DERR_DEVICELOST)
+		{
+			// Don't continue
+			return;
+		}
+		else if (FAILED(hr))
+		{
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+				"Cannot reset device! " + getErrorDescription(hr), 
+				"D3D9RenderWindow::restoreLostDevice" );
+		}
+
+		StringUtil::StrStreamType str;
+		str << "Reset device ok w:" << presParams->BackBufferWidth
+			<< " h:" << presParams->BackBufferHeight;
+		LogManager::getSingleton().logMessage(str.str());
+		// If windowed, we have to reset the size here
+		// since a fullscreen switch may have occurred
+		if (mPrimaryWindow->_getSwitchingFullscreen())
+		{
+			mPrimaryWindow->_finishSwitchingFullscreen();
+		}
+
+
+		// will have lost basic states
+		mBasicStatesInitialised = false;
+        mVertexProgramBound = false;
+        mFragmentProgramBound = false;
+
+
+		// recreate additional swap chains
+		for (sw = mSecondaryWindows.begin(); sw != mSecondaryWindows.end(); ++sw)
+		{
+			(*sw)->createD3DResources();
+		}
+
+		// Recreate all non-managed resources
+		static_cast<D3D9TextureManager*>(mTextureManager)
+			->recreateDefaultPoolResources();
+		static_cast<D3D9HardwareBufferManager*>(mHardwareBufferManager)
+			->recreateDefaultPoolResources();
+			
+		LogManager::getSingleton().logMessage("!!! Direct3D Device successfully restored.");
+
+		mDeviceLost = false;
+
+		fireEvent("DeviceRestored");
+
+	}
+	//---------------------------------------------------------------------
+	bool D3D9RenderSystem::isDeviceLost(void)
+	{
+		return mDeviceLost;
+	}
+	//---------------------------------------------------------------------
+	void D3D9RenderSystem::_notifyDeviceLost(void)
+	{
+		LogManager::getSingleton().logMessage("!!! Direct3D Device Lost!");
+		mDeviceLost = true;
+		// will have lost basic states
+		mBasicStatesInitialised = false;
+
+		fireEvent("DeviceLost");
+	}
+
+	//---------------------------------------------------------------------
+	// Formats to try, in decreasing order of preference
+	D3DFORMAT ddDepthStencilFormats[]={
+		D3DFMT_D24FS8,
+		D3DFMT_D24S8,
+		D3DFMT_D24X4S4,
+		D3DFMT_D24X8,
+		D3DFMT_D15S1,
+		D3DFMT_D16,
+		D3DFMT_D32
+	};
+#define NDSFORMATS (sizeof(ddDepthStencilFormats)/sizeof(D3DFORMAT))
+	
+	D3DFORMAT D3D9RenderSystem::_getDepthStencilFormatFor(D3DFORMAT fmt)
+	{
+		/// Check if result is cached
+		DepthStencilHash::iterator i = mDepthStencilHash.find((unsigned int)fmt);
+		if(i != mDepthStencilHash.end())
+			return i->second;
+		/// If not, probe with CheckDepthStencilMatch
+		D3DFORMAT dsfmt = D3DFMT_UNKNOWN;
+
+		/// Get description of primary render target
+		LPDIRECT3DSURFACE9 mSurface = mPrimaryWindow->getRenderSurface();
+		D3DSURFACE_DESC srfDesc;
+
+		if(!FAILED(mSurface->GetDesc(&srfDesc)))
+		{
+			/// Probe all depth stencil formats
+			/// Break on first one that matches
+			for(size_t x=0; x<NDSFORMATS; ++x)
+			{
+                // Verify that the depth format exists
+                if (mpD3D->CheckDeviceFormat(
+                    mActiveD3DDriver->getAdapterNumber(),
+                    D3DDEVTYPE_HAL,
+                    srfDesc.Format,
+                    D3DUSAGE_DEPTHSTENCIL,
+                    D3DRTYPE_SURFACE,
+                    ddDepthStencilFormats[x]) != D3D_OK)
+                {
+                    continue;
+                }
+                // Verify that the depth format is compatible
+				if(mpD3D->CheckDepthStencilMatch(
+					mActiveD3DDriver->getAdapterNumber(),
+					D3DDEVTYPE_HAL, srfDesc.Format,
+					fmt, ddDepthStencilFormats[x]) == D3D_OK)
+				{
+					dsfmt = ddDepthStencilFormats[x];
+					break;
+				}
+			}
+		}
+		/// Cache result
+		mDepthStencilHash[(unsigned int)fmt] = dsfmt;
+		return dsfmt;
+	}
+	IDirect3DSurface9* D3D9RenderSystem::_getDepthStencilFor(D3DFORMAT fmt, D3DMULTISAMPLE_TYPE multisample, size_t width, size_t height)
+	{
+		D3DFORMAT dsfmt = _getDepthStencilFormatFor(fmt);
+		if(dsfmt == D3DFMT_UNKNOWN)
+			return 0;
+		IDirect3DSurface9 *surface = 0;
+
+		/// Check if result is cached
+		ZBufferFormat zbfmt(dsfmt, multisample);
+		ZBufferHash::iterator i = mZBufferHash.find(zbfmt);
+		if(i != mZBufferHash.end())
+		{
+			/// Check if size is larger or equal
+			if(i->second.width >= width && i->second.height >= height)
+			{
+				surface = i->second.surface;
+			} 
+			else
+			{
+				/// If not, destroy current buffer
+				i->second.surface->Release();
+				mZBufferHash.erase(i);
+			}
+		}
+		if(!surface)
+		{
+			/// If not, create the depthstencil surface
+			HRESULT hr = mpD3DDevice->CreateDepthStencilSurface( 
+				width, 
+				height, 
+				dsfmt, 
+				multisample, 
+				NULL, 
+				TRUE,  // discard true or false?
+				&surface, 
+				NULL);
+			if(FAILED(hr))
+			{
+				String msg = DXGetErrorDescription9(hr);
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error CreateDepthStencilSurface : " + msg, "D3D9RenderSystem::_getDepthStencilFor" );
+			}
+			/// And cache it
+			ZBufferRef zb;
+			zb.surface = surface;
+			zb.width = width;
+			zb.height = height;
+			mZBufferHash[zbfmt] = zb;
+		}
+		return surface;
+	}
+	void D3D9RenderSystem::_cleanupDepthStencils()
+	{
+		for(ZBufferHash::iterator i = mZBufferHash.begin(); i != mZBufferHash.end(); ++i)
+		{
+			/// Release buffer
+			i->second.surface->Release();
+		}
+		mZBufferHash.clear();
+	}
+	void D3D9RenderSystem::registerThread()
+	{
+		// nothing to do - D3D9 shares rendering context already
+	}
+	void D3D9RenderSystem::unregisterThread()
+	{
+		// nothing to do - D3D9 shares rendering context already
+	}
+	void D3D9RenderSystem::preExtraThreadsStarted()
+	{
+		// nothing to do - D3D9 shares rendering context already
+	}
+	void D3D9RenderSystem::postExtraThreadsStarted()
+	{
+		// nothing to do - D3D9 shares rendering context already
+	}
+
+}
Index: /RenderSystems/Direct3D9/src/OgreD3D9RenderWindow.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9RenderWindow.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9RenderWindow.cpp	(revision 5)
@@ -0,0 +1,1021 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9RenderWindow.h"
+#include "OgreLogManager.h"
+#include "OgreViewport.h"
+#include "OgreException.h"
+#include "OgreD3D9RenderSystem.h"
+#include "OgreRenderSystem.h"
+#include "OgreBitwise.h"
+#include "OgreImageCodec.h"
+#include "OgreStringConverter.h"
+
+#include "OgreNoMemoryMacros.h"
+#include <d3d9.h>
+#include "OgreMemoryMacros.h"
+#include "OgreRoot.h"
+#include "OgreWindowEventUtilities.h"
+
+namespace Ogre
+{
+	D3D9RenderWindow::D3D9RenderWindow(HINSTANCE instance, D3D9Driver *driver, LPDIRECT3DDEVICE9 deviceIfSwapChain)
+        : mInstance(instance)
+        , mDriver(driver)
+        , mpRenderSurface(0)
+	{
+		mIsFullScreen = false;
+		mIsSwapChain = (deviceIfSwapChain != NULL);
+		mIsExternal = false;
+		mHWnd = 0;
+		mActive = false;
+		mSizing = false;
+		mClosed = false;
+		mSwitchingFullscreen = false;
+		mDisplayFrequency = 0;
+	}
+
+	D3D9RenderWindow::~D3D9RenderWindow()
+	{
+		destroy();
+	}
+
+	bool D3D9RenderWindow::_checkMultiSampleQuality(D3DMULTISAMPLE_TYPE type, DWORD *outQuality, D3DFORMAT format, UINT adapterNum, D3DDEVTYPE deviceType, BOOL fullScreen)
+	{
+		LPDIRECT3D9 pD3D = mDriver->getD3D();
+
+		if (SUCCEEDED(pD3D->CheckDeviceMultiSampleType(
+			adapterNum, 
+			deviceType, format, 
+			fullScreen, type, outQuality)))
+			return true;
+		else
+			return false;
+	}
+
+	void D3D9RenderWindow::create(const String& name, unsigned int width, unsigned int height,
+		bool fullScreen, const NameValuePairList *miscParams)
+	{
+		HINSTANCE hInst = mInstance;
+		D3D9Driver* driver = mDriver;
+
+		HWND parentHWnd = 0;
+		HWND externalHandle = 0;
+		mFSAAType = D3DMULTISAMPLE_NONE;
+		mFSAAQuality = 0;
+		mVSync = false;
+		String title = name;
+		unsigned int colourDepth = 32;
+		int left = -1; // Defaults to screen center
+		int top = -1; // Defaults to screen center
+		bool depthBuffer = true;
+		String border = "";
+		bool outerSize = false;
+		mUseNVPerfHUD = false;
+
+		if(miscParams)
+		{
+			// Get variable-length params
+			NameValuePairList::const_iterator opt;
+			// left (x)
+			opt = miscParams->find("left");
+			if(opt != miscParams->end())
+				left = StringConverter::parseInt(opt->second);
+			// top (y)
+			opt = miscParams->find("top");
+			if(opt != miscParams->end())
+				top = StringConverter::parseInt(opt->second);
+			// Window title
+			opt = miscParams->find("title");
+			if(opt != miscParams->end())
+				title = opt->second;
+			// parentWindowHandle		-> parentHWnd
+			opt = miscParams->find("parentWindowHandle");
+			if(opt != miscParams->end())
+				parentHWnd = (HWND)StringConverter::parseUnsignedInt(opt->second);
+			// externalWindowHandle		-> externalHandle
+			opt = miscParams->find("externalWindowHandle");
+			if(opt != miscParams->end())
+				externalHandle = (HWND)StringConverter::parseUnsignedInt(opt->second);
+			// vsync	[parseBool]
+			opt = miscParams->find("vsync");
+			if(opt != miscParams->end())
+				mVSync = StringConverter::parseBool(opt->second);
+			// displayFrequency
+			opt = miscParams->find("displayFrequency");
+			if(opt != miscParams->end())
+				mDisplayFrequency = StringConverter::parseUnsignedInt(opt->second);
+			// colourDepth
+			opt = miscParams->find("colourDepth");
+			if(opt != miscParams->end())
+				colourDepth = StringConverter::parseUnsignedInt(opt->second);
+			// depthBuffer [parseBool]
+			opt = miscParams->find("depthBuffer");
+			if(opt != miscParams->end())
+				depthBuffer = StringConverter::parseBool(opt->second);
+			// FSAA type
+			opt = miscParams->find("FSAA");
+			if(opt != miscParams->end())
+				mFSAAType = (D3DMULTISAMPLE_TYPE)StringConverter::parseUnsignedInt(opt->second);
+			// FSAA quality
+			opt = miscParams->find("FSAAQuality");
+			if(opt != miscParams->end())
+				mFSAAQuality = StringConverter::parseUnsignedInt(opt->second);
+			// window border style
+			opt = miscParams->find("border");
+			if(opt != miscParams->end())
+				border = opt->second;
+			// set outer dimensions?
+			opt = miscParams->find("outerDimensions");
+			if(opt != miscParams->end())
+				outerSize = StringConverter::parseBool(opt->second);
+			// NV perf HUD?
+			opt = miscParams->find("useNVPerfHUD");
+			if(opt != miscParams->end())
+				mUseNVPerfHUD = StringConverter::parseBool(opt->second);
+			 
+		}
+
+		// Destroy current window if any
+		if( mHWnd )
+			destroy();
+
+		if (!externalHandle)
+		{
+			DWORD dwStyle = WS_VISIBLE | WS_CLIPCHILDREN;
+			RECT rc;
+
+			mWidth = width;
+			mHeight = height;
+			mTop = top;
+			mLeft = left;
+
+			if (!fullScreen)
+			{
+				if (parentHWnd)
+				{
+					dwStyle |= WS_CHILD;
+				}
+				else
+				{
+					if (border == "none")
+						dwStyle |= WS_POPUP;
+					else if (border == "fixed")
+						dwStyle |= WS_OVERLAPPED | WS_BORDER | WS_CAPTION |
+						WS_SYSMENU | WS_MINIMIZEBOX;
+					else
+						dwStyle |= WS_OVERLAPPEDWINDOW;
+				}
+
+				if (!outerSize)
+				{
+					// Calculate window dimensions required
+					// to get the requested client area
+					SetRect(&rc, 0, 0, mWidth, mHeight);
+					AdjustWindowRect(&rc, dwStyle, false);
+					mWidth = rc.right - rc.left;
+					mHeight = rc.bottom - rc.top;
+
+					// Clamp width and height to the desktop dimensions
+					int screenw = GetSystemMetrics(SM_CXSCREEN);
+					int screenh = GetSystemMetrics(SM_CYSCREEN);
+					if ((int)mWidth > screenw)
+						mWidth = screenw;
+					if ((int)mHeight > screenh)
+						mHeight = screenh;
+					if (mLeft < 0)
+						mLeft = (screenw - mWidth) / 2;
+					if (mTop < 0)
+						mTop = (screenh - mHeight) / 2;
+				}
+			}
+			else
+			{
+				dwStyle |= WS_POPUP;
+				mTop = mLeft = 0;
+			}
+
+			// Register the window class
+			// NB allow 4 bytes of window data for D3D9RenderWindow pointer
+			WNDCLASS wc = { 0, WindowEventUtilities::_WndProc, 0, 0, hInst,
+				LoadIcon(0, IDI_APPLICATION), LoadCursor(NULL, IDC_ARROW),
+				(HBRUSH)GetStockObject(BLACK_BRUSH), 0, "OgreD3D9Wnd" };
+			RegisterClass(&wc);
+
+			// Create our main window
+			// Pass pointer to self
+			mIsExternal = false;
+			mHWnd = CreateWindow("OgreD3D9Wnd", title.c_str(), dwStyle,
+				mLeft, mTop, mWidth, mHeight, parentHWnd, 0, hInst, this);
+			
+			WindowEventUtilities::_addRenderWindow(this);
+		}
+		else
+		{
+			mHWnd = externalHandle;
+			mIsExternal = true;
+		}
+
+		RECT rc;
+		// top and left represent outer window coordinates
+		GetWindowRect(mHWnd, &rc);
+		mTop = rc.top;
+		mLeft = rc.left;
+		// width and height represent interior drawable area
+		GetClientRect(mHWnd, &rc);
+		mWidth = rc.right;
+		mHeight = rc.bottom;
+
+		mName = name;
+		mIsDepthBuffered = depthBuffer;
+		mIsFullScreen = fullScreen;
+		mColourDepth = colourDepth;
+
+		StringUtil::StrStreamType str;
+		str << "D3D9 : Created D3D9 Rendering Window '"
+			<< mName << "' : " << mWidth << "x" << mHeight 
+			<< ", " << mColourDepth << "bpp";
+		LogManager::getSingleton().logMessage(
+			LML_NORMAL, str.str());
+
+		createD3DResources();
+
+		mActive = true;
+		mClosed = false;
+	}
+
+	void D3D9RenderWindow::setFullscreen(bool fullScreen, unsigned int width, unsigned int height)
+	{
+		if (fullScreen != mIsFullScreen || width != mWidth || height != mHeight)
+		{
+
+			if (fullScreen != mIsFullScreen)
+				mSwitchingFullscreen = true;
+
+			DWORD dwStyle = WS_VISIBLE | WS_CLIPCHILDREN;
+
+			bool oldFullscreen = mIsFullScreen;
+			mIsFullScreen = fullScreen;
+
+			if (fullScreen)
+			{
+				dwStyle |= WS_POPUP;
+				mTop = mLeft = 0;
+				mWidth = width;
+				mHeight = height;
+				// need different ordering here
+
+				if (oldFullscreen)
+				{
+					// was previously fullscreen, just changing the resolution
+					SetWindowPos(mHWnd, HWND_TOPMOST, 0, 0, width, height, SWP_NOACTIVATE);
+				}
+				else
+				{
+					SetWindowPos(mHWnd, HWND_TOPMOST, 0, 0, width, height, SWP_NOACTIVATE);
+					//MoveWindow(mHWnd, mLeft, mTop, mWidth, mHeight, FALSE);
+					SetWindowLong(mHWnd, GWL_STYLE, dwStyle);
+					SetWindowPos(mHWnd, 0, 0,0, 0,0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
+				}
+			}
+			else
+			{
+				dwStyle |= WS_OVERLAPPEDWINDOW;
+				// Calculate window dimensions required
+				// to get the requested client area
+				RECT rc;
+				SetRect(&rc, 0, 0, width, height);
+				AdjustWindowRect(&rc, dwStyle, false);
+				unsigned int winWidth = rc.right - rc.left;
+				unsigned int winHeight = rc.bottom - rc.top;
+
+				SetWindowLong(mHWnd, GWL_STYLE, dwStyle);
+				SetWindowPos(mHWnd, HWND_NOTOPMOST, 0, 0, winWidth, winHeight,
+					SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOACTIVATE);
+				// Note that we also set the position in the restoreLostDevice method
+				// via _finishSwitchingFullScreen
+			}
+
+			md3dpp.Windowed = !fullScreen;
+			md3dpp.FullScreen_RefreshRateInHz = mIsFullScreen ? mDisplayFrequency : 0;
+			md3dpp.BackBufferHeight = height;
+			md3dpp.BackBufferWidth = width;
+
+			if ((oldFullscreen && fullScreen) || mIsExternal)
+			{
+				// Have to release & trigger device reset
+				// NB don't use windowMovedOrResized since Win32 doesn't know
+				// about the size change yet
+				SAFE_RELEASE(mpRenderSurface);
+				static_cast<D3D9RenderSystem*>(Root::getSingleton().getRenderSystem())->_notifyDeviceLost();
+				// Notify viewports of resize
+				ViewportList::iterator it = mViewportList.begin();
+				while(it != mViewportList.end()) (*it++).second->_updateDimensions();
+			}
+		}
+	} 
+
+	void D3D9RenderWindow::_finishSwitchingFullscreen()
+	{
+		if(mIsFullScreen)
+		{
+			// Need to reset the region on the window sometimes, when the 
+			// windowed mode was constrained by desktop 
+			HRGN hRgn = CreateRectRgn(0,0,md3dpp.BackBufferWidth, md3dpp.BackBufferHeight);
+			SetWindowRgn(mHWnd, hRgn, FALSE);
+		}
+		else
+		{
+			// When switching back to windowed mode, need to reset window size 
+			// after device has been restored
+			RECT rc;
+			SetRect(&rc, 0, 0, md3dpp.BackBufferWidth, md3dpp.BackBufferHeight);
+			AdjustWindowRect(&rc, GetWindowLong(mHWnd, GWL_STYLE), false);
+			unsigned int winWidth = rc.right - rc.left;
+			unsigned int winHeight = rc.bottom - rc.top;
+			int screenw = GetSystemMetrics(SM_CXSCREEN);
+			int screenh = GetSystemMetrics(SM_CYSCREEN);
+			int left = (screenw - winWidth) / 2;
+			int top = (screenh - winHeight) / 2;
+			SetWindowPos(mHWnd, HWND_NOTOPMOST, left, top, winWidth, winHeight,
+				SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOACTIVATE);
+
+		}
+		mSwitchingFullscreen = false;
+	}
+
+	void D3D9RenderWindow::createD3DResources(void)
+	{
+		// access device via driver
+		LPDIRECT3DDEVICE9 mpD3DDevice = mDriver->getD3DDevice();
+
+		if (mIsSwapChain && !mpD3DDevice)
+		{
+			OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+				"Secondary window has not been given the device from the primary!",
+				"D3D9RenderWindow::createD3DResources");
+		}
+
+		SAFE_RELEASE(mpRenderSurface);
+
+		// Set up the presentation parameters
+		HRESULT hr;
+		LPDIRECT3D9 pD3D = mDriver->getD3D();
+		D3DDEVTYPE devType = D3DDEVTYPE_HAL;
+
+		ZeroMemory( &md3dpp, sizeof(D3DPRESENT_PARAMETERS) );
+		md3dpp.Windowed					= !mIsFullScreen;
+		md3dpp.SwapEffect				= D3DSWAPEFFECT_DISCARD;
+		// triple buffer if VSync is on
+		md3dpp.BackBufferCount			= mVSync ? 2 : 1;
+		md3dpp.EnableAutoDepthStencil	= mIsDepthBuffered;
+		md3dpp.hDeviceWindow			= mHWnd;
+		md3dpp.BackBufferWidth			= mWidth;
+		md3dpp.BackBufferHeight			= mHeight;
+		md3dpp.FullScreen_RefreshRateInHz = mIsFullScreen ? mDisplayFrequency : 0;
+		
+
+		if (mVSync)
+		{
+			md3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
+		}
+		else
+		{
+			// NB not using vsync in windowed mode in D3D9 can cause jerking at low 
+			// frame rates no matter what buffering modes are used (odd - perhaps a
+			// timer issue in D3D9 since GL doesn't suffer from this) 
+			// low is < 200fps in this context
+			if (!mIsFullScreen)
+			{
+				LogManager::getSingleton().logMessage("D3D9 : WARNING - "
+					"disabling VSync in windowed mode can cause timing issues at lower "
+					"frame rates, turn VSync on if you observe this problem.");
+			}
+			md3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
+		}
+
+		md3dpp.BackBufferFormat		= D3DFMT_R5G6B5;
+		if( mColourDepth > 16 )
+			md3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
+
+		if (mColourDepth > 16 )
+		{
+			// Try to create a 32-bit depth, 8-bit stencil
+			if( FAILED( pD3D->CheckDeviceFormat(mDriver->getAdapterNumber(),
+				devType,  md3dpp.BackBufferFormat,  D3DUSAGE_DEPTHSTENCIL, 
+				D3DRTYPE_SURFACE, D3DFMT_D24S8 )))
+			{
+				// Bugger, no 8-bit hardware stencil, just try 32-bit zbuffer 
+				if( FAILED( pD3D->CheckDeviceFormat(mDriver->getAdapterNumber(),
+					devType,  md3dpp.BackBufferFormat,  D3DUSAGE_DEPTHSTENCIL, 
+					D3DRTYPE_SURFACE, D3DFMT_D32 )))
+				{
+					// Jeez, what a naff card. Fall back on 16-bit depth buffering
+					md3dpp.AutoDepthStencilFormat = D3DFMT_D16;
+				}
+				else
+					md3dpp.AutoDepthStencilFormat = D3DFMT_D32;
+			}
+			else
+			{
+				// Woohoo!
+				if( SUCCEEDED( pD3D->CheckDepthStencilMatch( mDriver->getAdapterNumber(), devType,
+					md3dpp.BackBufferFormat, md3dpp.BackBufferFormat, D3DFMT_D24S8 ) ) )
+				{
+					md3dpp.AutoDepthStencilFormat = D3DFMT_D24S8; 
+				} 
+				else 
+					md3dpp.AutoDepthStencilFormat = D3DFMT_D24X8; 
+			}
+		}
+		else
+			// 16-bit depth, software stencil
+			md3dpp.AutoDepthStencilFormat	= D3DFMT_D16;
+
+		md3dpp.MultiSampleType = mFSAAType;
+		md3dpp.MultiSampleQuality = (mFSAAQuality == 0) ? 0 : mFSAAQuality;
+
+		if (mIsSwapChain)
+		{
+			// Create swap chain			
+			hr = mpD3DDevice->CreateAdditionalSwapChain(
+				&md3dpp, &mpSwapChain);
+			if (FAILED(hr))
+			{
+				// Try a second time, may fail the first time due to back buffer count,
+				// which will be corrected by the runtime
+				hr = mpD3DDevice->CreateAdditionalSwapChain(
+					&md3dpp, &mpSwapChain);
+			}
+			if (FAILED(hr))
+			{
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+					"Unable to create an additional swap chain",
+					"D3D9RenderWindow::createD3DResources");
+			}
+			// Store references to buffers for convenience
+			mpSwapChain->GetBackBuffer( 0, D3DBACKBUFFER_TYPE_MONO, &mpRenderSurface );
+			// Additional swap chains need their own depth buffer
+			// to support resizing them
+			if (mIsDepthBuffered) 
+			{
+				hr = mpD3DDevice->CreateDepthStencilSurface(
+					mWidth, mHeight,
+					md3dpp.AutoDepthStencilFormat,
+					md3dpp.MultiSampleType,
+					md3dpp.MultiSampleQuality, 
+					(md3dpp.Flags & D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL),
+					&mpRenderZBuffer, NULL
+					);
+
+				if (FAILED(hr)) 
+				{
+					OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+						"Unable to create a depth buffer for the swap chain",
+						"D3D9RenderWindow::createD3DResources");
+
+				}
+			} 
+			else 
+			{
+				mpRenderZBuffer = 0;
+			}
+		}
+		else
+		{
+			if (!mpD3DDevice)
+			{
+				// We haven't created the device yet, this must be the first time
+
+				// Do we want to preserve the FPU mode? Might be useful for scientific apps
+				DWORD extraFlags = 0;
+				ConfigOptionMap& options = Root::getSingleton().getRenderSystem()->getConfigOptions();
+				ConfigOptionMap::iterator opti = options.find("Floating-point mode");
+				if (opti != options.end() && opti->second.currentValue == "Consistent")
+					extraFlags |= D3DCREATE_FPU_PRESERVE;
+
+#if OGRE_THREAD_SUPPORT
+				extraFlags |= D3DCREATE_MULTITHREADED;
+#endif
+				// Set default settings (use the one Ogre discovered as a default)
+				UINT adapterToUse = mDriver->getAdapterNumber();
+
+				if (mUseNVPerfHUD)
+				{
+					// Look for 'NVIDIA NVPerfHUD' adapter (<= v4)
+					// or 'NVIDIA PerfHUD' (v5)
+					// If it is present, override default settings
+					for (UINT adapter=0; adapter < mDriver->getD3D()->GetAdapterCount(); ++adapter)
+					{
+						D3DADAPTER_IDENTIFIER9 identifier;
+						HRESULT res;
+						res = mDriver->getD3D()->GetAdapterIdentifier(adapter,0,&identifier);
+						if (strstr(identifier.Description,"PerfHUD") != 0)
+						{
+							adapterToUse = adapter;
+							devType = D3DDEVTYPE_REF;
+							break;
+						}
+					}
+				}
+
+				hr = pD3D->CreateDevice(adapterToUse, devType, mHWnd,
+					D3DCREATE_HARDWARE_VERTEXPROCESSING | extraFlags, &md3dpp, &mpD3DDevice );
+				if (FAILED(hr))
+				{
+					// Try a second time, may fail the first time due to back buffer count,
+					// which will be corrected down to 1 by the runtime
+					hr = pD3D->CreateDevice( adapterToUse, devType, mHWnd,
+						D3DCREATE_HARDWARE_VERTEXPROCESSING | extraFlags, &md3dpp, &mpD3DDevice );
+				}
+				if( FAILED( hr ) )
+				{
+					hr = pD3D->CreateDevice( adapterToUse, devType, mHWnd,
+						D3DCREATE_MIXED_VERTEXPROCESSING | extraFlags, &md3dpp, &mpD3DDevice );
+					if( FAILED( hr ) )
+					{
+						hr = pD3D->CreateDevice( adapterToUse, devType, mHWnd,
+							D3DCREATE_SOFTWARE_VERTEXPROCESSING | extraFlags, &md3dpp, &mpD3DDevice );
+					}
+				}
+				// TODO: make this a bit better e.g. go from pure vertex processing to software
+				if( FAILED( hr ) )
+				{
+					destroy();
+					OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+						"Failed to create Direct3D9 Device: " + 
+						Root::getSingleton().getErrorDescription(hr), 
+						"D3D9RenderWindow::createD3DResources" );
+				}
+			}
+			// update device in driver
+			mDriver->setD3DDevice( mpD3DDevice );
+			// Store references to buffers for convenience
+			mpD3DDevice->GetRenderTarget( 0, &mpRenderSurface );
+			mpD3DDevice->GetDepthStencilSurface( &mpRenderZBuffer );
+			// release immediately so we don't hog them
+			mpRenderZBuffer->Release();
+		}
+
+	}
+
+	void D3D9RenderWindow::destroyD3DResources()
+	{
+		if (mIsSwapChain)
+		{
+			SAFE_RELEASE(mpRenderZBuffer);
+			SAFE_RELEASE(mpSwapChain);
+		}
+		else
+		{
+			// ignore depth buffer, access device through driver
+			mpRenderZBuffer = 0;
+		}
+		SAFE_RELEASE(mpRenderSurface);
+	}
+
+	void D3D9RenderWindow::destroy()
+	{
+		destroyD3DResources();
+
+		if (mHWnd && !mIsExternal)
+		{
+			WindowEventUtilities::_removeRenderWindow(this);
+			DestroyWindow(mHWnd);
+		}
+
+		mHWnd = 0;
+		mActive = false;
+		mClosed = true;
+	}
+
+	bool D3D9RenderWindow::isVisible() const
+	{
+		return (mHWnd && !IsIconic(mHWnd));
+	}
+
+	void D3D9RenderWindow::reposition(int top, int left)
+	{
+		if (mHWnd && !mIsFullScreen)
+		{
+			SetWindowPos(mHWnd, 0, top, left, 0, 0,
+				SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
+		}
+	}
+
+	void D3D9RenderWindow::resize(unsigned int width, unsigned int height)
+	{
+		if (mHWnd && !mIsFullScreen)
+		{
+			RECT rc = { 0, 0, width, height };
+			AdjustWindowRect(&rc, GetWindowLong(mHWnd, GWL_STYLE), false);
+			width = rc.right - rc.left;
+			height = rc.bottom - rc.top;
+			SetWindowPos(mHWnd, 0, 0, 0, width, height,
+				SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
+		}
+	}
+
+	void D3D9RenderWindow::windowMovedOrResized()
+	{
+		if (!mHWnd || IsIconic(mHWnd))
+			return;
+
+		RECT rc;
+		// top and left represent outer window position
+		GetWindowRect(mHWnd, &rc);
+		mTop = rc.top;
+		mLeft = rc.left;
+		// width and height represent drawable area only
+		GetClientRect(mHWnd, &rc);
+		unsigned int width = rc.right;
+		unsigned int height = rc.bottom;
+		if (mWidth == width && mHeight == height)
+			return;
+
+		SAFE_RELEASE( mpRenderSurface );
+
+		if (mIsSwapChain) 
+		{
+
+			D3DPRESENT_PARAMETERS pp = md3dpp;
+
+			pp.BackBufferWidth = width;
+			pp.BackBufferHeight = height;
+
+			SAFE_RELEASE( mpRenderZBuffer );
+			SAFE_RELEASE( mpSwapChain );
+
+			HRESULT hr = mDriver->getD3DDevice()->CreateAdditionalSwapChain(
+				&pp,
+				&mpSwapChain);
+
+			if (FAILED(hr)) 
+			{
+				StringUtil::StrStreamType str;
+				str << "D3D9RenderWindow: failed to reset device to new dimensions << "
+					<< width << " x " << height << ". Trying to recover.";
+				LogManager::getSingleton().logMessage(LML_CRITICAL, str.str());
+
+				// try to recover
+				hr = mDriver->getD3DDevice()->CreateAdditionalSwapChain(
+					&md3dpp,
+					&mpSwapChain);
+
+				if (FAILED(hr))
+					OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Reset window to last size failed", "D3D9RenderWindow::resize" );
+
+			}		
+			else 
+			{
+				md3dpp = pp;
+
+				mWidth = width;
+				mHeight = height;
+
+				hr = mpSwapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &mpRenderSurface);
+				hr = mDriver->getD3DDevice()->CreateDepthStencilSurface(
+					mWidth, mHeight,
+					md3dpp.AutoDepthStencilFormat,
+					md3dpp.MultiSampleType,
+					md3dpp.MultiSampleQuality, 
+					(md3dpp.Flags & D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL),
+					&mpRenderZBuffer, NULL
+					);
+
+				if (FAILED(hr)) 
+				{
+					OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to create depth stencil surface for Swap Chain", "D3D9RenderWindow::resize" );
+				}
+
+			}
+		}
+		// primary windows must reset the device
+		else 
+		{
+			md3dpp.BackBufferWidth = mWidth = width;
+			md3dpp.BackBufferHeight = mHeight = height;
+			static_cast<D3D9RenderSystem*>(
+				Root::getSingleton().getRenderSystem())->_notifyDeviceLost();
+		}
+
+		// Notify viewports of resize
+		ViewportList::iterator it = mViewportList.begin();
+		while( it != mViewportList.end() )
+			(*it++).second->_updateDimensions();
+	}
+
+	void D3D9RenderWindow::swapBuffers( bool waitForVSync )
+	{
+		// access device through driver
+		LPDIRECT3DDEVICE9 mpD3DDevice = mDriver->getD3DDevice();
+		if( mpD3DDevice )
+		{
+			HRESULT hr;
+			if (mIsSwapChain)
+			{
+				hr = mpSwapChain->Present(NULL, NULL, NULL, NULL, 0);
+			}
+			else
+			{
+				hr = mpD3DDevice->Present( NULL, NULL, 0, NULL );
+			}
+			if( D3DERR_DEVICELOST == hr )
+			{
+				SAFE_RELEASE(mpRenderSurface);
+
+				static_cast<D3D9RenderSystem*>(
+					Root::getSingleton().getRenderSystem())->_notifyDeviceLost();
+			}
+			else if( FAILED(hr) )
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error Presenting surfaces", "D3D9RenderWindow::swapBuffers" );
+		}
+	}
+
+	void D3D9RenderWindow::getCustomAttribute( const String& name, void* pData )
+	{
+		// Valid attributes and their equvalent native functions:
+		// D3DDEVICE			: getD3DDevice
+		// WINDOW				: getWindowHandle
+
+		if( name == "D3DDEVICE" )
+		{
+			LPDIRECT3DDEVICE9 *pDev = (LPDIRECT3DDEVICE9*)pData;
+			*pDev = getD3DDevice();
+			return;
+		}
+		else if( name == "WINDOW" )
+		{
+			HWND *pHwnd = (HWND*)pData;
+			*pHwnd = getWindowHandle();
+			return;
+		}
+		else if( name == "isTexture" )
+		{
+			bool *b = reinterpret_cast< bool * >( pData );
+			*b = false;
+
+			return;
+		}
+		else if( name == "D3DZBUFFER" )
+		{
+			LPDIRECT3DSURFACE9 *pSurf = (LPDIRECT3DSURFACE9*)pData;
+			*pSurf = mpRenderZBuffer;
+			return;
+		}
+		else if( name == "DDBACKBUFFER" )
+		{
+			LPDIRECT3DSURFACE9 *pSurf = (LPDIRECT3DSURFACE9*)pData;
+			*pSurf = mpRenderSurface;
+			return;
+		}
+		else if( name == "DDFRONTBUFFER" )
+		{
+			LPDIRECT3DSURFACE9 *pSurf = (LPDIRECT3DSURFACE9*)pData;
+			*pSurf = mpRenderSurface;
+			return;
+		}
+	}
+
+	void D3D9RenderWindow::writeContentsToFile(const String& filename)
+	{
+		HRESULT hr;
+		LPDIRECT3DSURFACE9 pSurf=NULL, pTempSurf=NULL;
+		D3DSURFACE_DESC desc;
+		D3DDISPLAYMODE dm;
+
+		// access device through driver
+		LPDIRECT3DDEVICE9 mpD3DDevice = mDriver->getD3DDevice();
+
+		// get display dimensions
+		// this will be the dimensions of the front buffer
+		if (FAILED(hr = mpD3DDevice->GetDisplayMode(0, &dm)))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't get display mode!", "D3D9RenderWindow::writeContentsToFile");
+
+		desc.Width = dm.Width;
+		desc.Height = dm.Height;
+		desc.Format = D3DFMT_A8R8G8B8;
+		if (FAILED(hr = mpD3DDevice->CreateOffscreenPlainSurface(
+			desc.Width, 
+			desc.Height, 
+			desc.Format, 
+			D3DPOOL_SYSTEMMEM, 
+			&pTempSurf, 
+			NULL)))
+		{
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Cannot create offscreen buffer 1!", "D3D9RenderWindow::writeContentsToFile");
+		}
+
+		if (FAILED(hr = mpD3DDevice->GetFrontBufferData(0, pTempSurf)))
+		{
+			SAFE_RELEASE(pTempSurf);
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't get front buffer!", "D3D9RenderWindow::writeContentsToFile");
+		}
+		
+		D3DLOCKED_RECT lockedRect;
+		if(mIsFullScreen)
+		{
+			if (FAILED(hr = pTempSurf->LockRect(&lockedRect, NULL, 
+			D3DLOCK_READONLY | D3DLOCK_NOSYSLOCK)))
+			{
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "can't lock rect!", "D3D9RenderWindow::writeContentsToFile");
+			} 
+		}
+		else
+		{
+			RECT srcRect;
+			GetClientRect(mHWnd, &srcRect);
+			POINT point;
+			point.x = srcRect.left;
+			point.y = srcRect.top;
+			ClientToScreen(mHWnd, &point);
+			srcRect.top = point.y;
+			srcRect.left = point.x;
+			srcRect.bottom += point.y;
+			srcRect.right += point.x;
+
+			desc.Width = srcRect.right - srcRect.left;
+			desc.Height = srcRect.bottom - srcRect.top;
+
+			if (FAILED(hr = pTempSurf->LockRect(&lockedRect, &srcRect, 
+
+			D3DLOCK_READONLY | D3DLOCK_NOSYSLOCK)))
+			{
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "can't lock rect!", "D3D9RenderWindow::writeContentsToFile");
+			} 
+		}
+  
+		ImageCodec::ImageData *imgData = new ImageCodec::ImageData();
+		imgData->width = desc.Width;
+		imgData->height = desc.Height;
+		imgData->format = PF_BYTE_RGB;
+
+		// Allocate contiguous buffer (surfaces aren't necessarily contiguous)
+		uchar* pBuffer = new uchar[desc.Width * desc.Height * 3];
+
+		uint x, y;
+		uchar *pData, *pDest;
+
+		pData = (uchar*)lockedRect.pBits;
+		pDest = pBuffer;
+		for (y = 0; y < desc.Height; ++y)
+		{
+			uchar *pRow = pData;
+
+			for (x = 0; x < desc.Width; ++x)
+			{
+				switch(desc.Format)
+				{
+				case D3DFMT_R5G6B5:
+					WORD val;
+
+					val = *((WORD*)pRow);
+					pRow += 2;
+
+					*pDest++ = Bitwise::convertBitPattern((WORD)val, (WORD)0xF800, (BYTE)0xFF);
+					*pDest++ = Bitwise::convertBitPattern((WORD)val, (WORD)0x07E0, (BYTE)0xFF);
+					*pDest++ = Bitwise::convertBitPattern((WORD)val, (WORD)0x001F, (BYTE)0xFF);
+					break;
+				case D3DFMT_A8R8G8B8:
+				case D3DFMT_X8R8G8B8:
+					// Actual format is BRGA for some reason
+					*pDest++ = pRow[2]; // R
+					*pDest++ = pRow[1]; // G
+					*pDest++ = pRow[0]; // B
+					pRow += 4; // skip alpha / dummy
+					break;
+				case D3DFMT_R8G8B8:
+					// Actual format is BRGA for some reason
+					*pDest++ = pRow[2]; // R
+					*pDest++ = pRow[1]; // G
+					*pDest++ = pRow[0]; // B
+					pRow += 3; 
+					break;
+				}
+
+
+			}
+			// increase by one line
+			pData += lockedRect.Pitch;
+		}
+
+		// Wrap buffer in a chunk
+		MemoryDataStreamPtr stream(new MemoryDataStream(pBuffer, desc.Width * desc.Height * 3, false));
+
+		// Get codec 
+		size_t pos = filename.find_last_of(".");
+		String extension;
+		if( pos == String::npos )
+			OGRE_EXCEPT(
+			Exception::ERR_INVALIDPARAMS, 
+			"Unable to determine image type for '" + filename + "' - invalid extension.",
+			"D3D9RenderWindow::writeContentsToFile" );
+
+		while( pos != filename.length() - 1 )
+			extension += filename[++pos];
+
+		// Get the codec
+		Codec * pCodec = Codec::getCodec(extension);
+
+		// Write out
+		{
+			Codec::CodecDataPtr ptr(imgData);
+			pCodec->codeToFile(stream, filename, ptr);
+		}
+
+		delete [] pBuffer;
+
+		SAFE_RELEASE(pTempSurf);
+		SAFE_RELEASE(pSurf);
+	}
+	//-----------------------------------------------------------------------------
+	void D3D9RenderWindow::update(bool swap)
+	{
+
+		D3D9RenderSystem* rs = static_cast<D3D9RenderSystem*>(
+			Root::getSingleton().getRenderSystem());
+
+		// access device through driver
+		LPDIRECT3DDEVICE9 mpD3DDevice = mDriver->getD3DDevice();
+
+		if (rs->isDeviceLost())
+		{
+			// Test the cooperative mode first
+			HRESULT hr = mpD3DDevice->TestCooperativeLevel();
+			if (hr == D3DERR_DEVICELOST)
+			{
+				// device lost, and we can't reset
+				// can't do anything about it here, wait until we get 
+				// D3DERR_DEVICENOTRESET; rendering calls will silently fail until 
+				// then (except Present, but we ignore device lost there too)
+				SAFE_RELEASE(mpRenderSurface);
+				// need to release if swap chain
+				if (!mIsSwapChain)
+					mpRenderZBuffer = 0;
+				else
+					SAFE_RELEASE (mpRenderZBuffer);
+				Sleep(50);
+				return;
+			}
+			else
+			{
+				// device lost, and we can reset
+				rs->restoreLostDevice();
+
+				// Still lost?
+				if (rs->isDeviceLost())
+				{
+					// Wait a while
+					Sleep(50);
+					return;
+				}
+
+				if (!mIsSwapChain) 
+				{
+					// re-qeuery buffers
+					mpD3DDevice->GetRenderTarget( 0, &mpRenderSurface );
+					mpD3DDevice->GetDepthStencilSurface( &mpRenderZBuffer );
+					// release immediately so we don't hog them
+					mpRenderZBuffer->Release();
+				}
+				else 
+				{
+				    // Update dimensions incase changed
+		            ViewportList::iterator it = mViewportList.begin();
+		            while( it != mViewportList.end() )
+			            (*it++).second->_updateDimensions();
+					// Actual restoration of surfaces will happen in 
+					// D3D9RenderSystem::restoreLostDevice when it calls
+					// createD3DResources for each secondary window
+				}
+			}
+
+		}
+		RenderWindow::update(swap);
+	}
+}
Index: /RenderSystems/Direct3D9/src/OgreD3D9Texture.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9Texture.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9Texture.cpp	(revision 5)
@@ -0,0 +1,1238 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9Texture.h"
+#include "OgreD3D9HardwarePixelBuffer.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreBitwise.h"
+#include "OgreD3D9Mappings.h"
+#include "OgreD3D9RenderSystem.h"
+#include "OgreRoot.h"
+
+#include "OgreNoMemoryMacros.h"
+#include <d3dx9.h>
+#include <dxerr9.h>
+#include "OgreMemoryMacros.h"
+
+namespace Ogre 
+{
+	/****************************************************************************************/
+    D3D9Texture::D3D9Texture(ResourceManager* creator, const String& name, 
+        ResourceHandle handle, const String& group, bool isManual, 
+        ManualResourceLoader* loader, IDirect3DDevice9 *pD3DDevice)
+        :Texture(creator, name, handle, group, isManual, loader),
+        mpDev(pD3DDevice), 
+        mpD3D(NULL), 
+        mpNormTex(NULL),
+        mpCubeTex(NULL),
+		mpVolumeTex(NULL),
+        mpTex(NULL),
+        mD3DPool(D3DPOOL_MANAGED),
+		mDynamicTextures(false)
+	{
+        _initDevice();
+	}
+	/****************************************************************************************/
+	D3D9Texture::~D3D9Texture()
+	{
+        // have to call this here reather than in Resource destructor
+        // since calling virtual methods in base destructors causes crash
+		if (isLoaded())
+		{
+			unload(); 
+		}
+		else
+		{
+			freeInternalResources();
+		}
+	}
+	/****************************************************************************************/
+	void D3D9Texture::copyToTexture(TexturePtr& target)
+	{
+        // check if this & target are the same format and type
+		// blitting from or to cube textures is not supported yet
+		if (target->getUsage() != this->getUsage() ||
+			target->getTextureType() != this->getTextureType())
+		{
+			OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, 
+					"Src. and dest. textures must be of same type and must have the same usage !!!", 
+					"D3D9Texture::copyToTexture" );
+		}
+
+        HRESULT hr;
+        D3D9Texture *other;
+		// get the target
+		other = reinterpret_cast< D3D9Texture * >( target.get() );
+		// target rectangle (whole surface)
+		RECT dstRC = {0, 0, other->getWidth(), other->getHeight()};
+
+		// do it plain for normal texture
+		if (this->getTextureType() == TEX_TYPE_2D)
+		{
+			// get our source surface
+			IDirect3DSurface9 *pSrcSurface = 0;
+			if( FAILED( hr = mpNormTex->GetSurfaceLevel(0, &pSrcSurface) ) )
+			{
+				String msg = DXGetErrorDescription9(hr);
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Couldn't blit : " + msg, "D3D9Texture::copyToTexture" );
+			}
+
+			// get our target surface
+			IDirect3DSurface9 *pDstSurface = 0;
+			IDirect3DTexture9 *pOthTex = other->getNormTexture();
+			if( FAILED( hr = pOthTex->GetSurfaceLevel(0, &pDstSurface) ) )
+			{
+				String msg = DXGetErrorDescription9(hr);
+				SAFE_RELEASE(pSrcSurface);
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Couldn't blit : " + msg, "D3D9Texture::copyToTexture" );
+			}
+
+			// do the blit, it's called StretchRect in D3D9 :)
+			if( FAILED( hr = mpDev->StretchRect( pSrcSurface, NULL, pDstSurface, &dstRC, D3DTEXF_NONE) ) )
+			{
+				String msg = DXGetErrorDescription9(hr);
+				SAFE_RELEASE(pSrcSurface);
+				SAFE_RELEASE(pDstSurface);
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Couldn't blit : " + msg, "D3D9Texture::copyToTexture" );
+			}
+
+			// release temp. surfaces
+			SAFE_RELEASE(pSrcSurface);
+			SAFE_RELEASE(pDstSurface);
+		}
+		else if (this->getTextureType() == TEX_TYPE_CUBE_MAP)
+		{
+			// get the target cube texture
+			IDirect3DCubeTexture9 *pOthTex = other->getCubeTexture();
+			// blit to 6 cube faces
+			for (size_t face = 0; face < 6; face++)
+			{
+				// get our source surface
+				IDirect3DSurface9 *pSrcSurface = 0;
+				if( FAILED( hr = mpCubeTex->GetCubeMapSurface((D3DCUBEMAP_FACES)face, 0, &pSrcSurface) ) )
+				{
+					String msg = DXGetErrorDescription9(hr);
+					OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Couldn't blit : " + msg, "D3D9Texture::copyToTexture" );
+				}
+
+				// get our target surface
+				IDirect3DSurface9 *pDstSurface = 0;
+				if( FAILED( hr = pOthTex->GetCubeMapSurface((D3DCUBEMAP_FACES)face, 0, &pDstSurface) ) )
+				{
+					String msg = DXGetErrorDescription9(hr);
+					SAFE_RELEASE(pSrcSurface);
+					OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Couldn't blit : " + msg, "D3D9Texture::copyToTexture" );
+				}
+
+				// do the blit, it's called StretchRect in D3D9 :)
+				if( FAILED( hr = mpDev->StretchRect( pSrcSurface, NULL, pDstSurface, &dstRC, D3DTEXF_NONE) ) )
+				{
+					String msg = DXGetErrorDescription9(hr);
+					SAFE_RELEASE(pSrcSurface);
+					SAFE_RELEASE(pDstSurface);
+					OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Couldn't blit : " + msg, "D3D9Texture::copyToTexture" );
+				}
+
+				// release temp. surfaces
+				SAFE_RELEASE(pSrcSurface);
+				SAFE_RELEASE(pDstSurface);
+			}
+		}
+		else
+		{
+			OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED, 
+					"Copy to texture is implemented only for 2D and cube textures !!!", 
+					"D3D9Texture::copyToTexture" );
+		}
+	}
+	/****************************************************************************************/
+	void D3D9Texture::loadImpl()
+	{
+		if (mUsage & TU_RENDERTARGET)
+		{
+			createInternalResources();
+			return;
+		}
+
+        if (!mInternalResourcesCreated)
+        {
+            // NB: Need to initialise pool to some value other than D3DPOOL_DEFAULT,
+            // otherwise, if the texture loading failed, it might re-create as empty
+            // texture when device lost/restore. The actual pool will determine later.
+            mD3DPool = D3DPOOL_MANAGED;
+        }
+
+		// load based on tex.type
+		switch (this->getTextureType())
+		{
+		case TEX_TYPE_1D:
+		case TEX_TYPE_2D:
+			this->_loadNormTex();
+			break;
+		case TEX_TYPE_3D:
+            this->_loadVolumeTex();
+            break;
+		case TEX_TYPE_CUBE_MAP:
+			this->_loadCubeTex();
+			break;
+		default:
+			OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR, "Unknown texture type", "D3D9Texture::loadImpl" );
+		}
+
+	}
+	/****************************************************************************************/
+	void D3D9Texture::freeInternalResourcesImpl()
+	{
+		SAFE_RELEASE(mpTex);
+		SAFE_RELEASE(mpNormTex);
+		SAFE_RELEASE(mpCubeTex);
+		SAFE_RELEASE(mpVolumeTex);
+	}
+	/****************************************************************************************/
+	void D3D9Texture::_loadCubeTex()
+	{
+		assert(this->getTextureType() == TEX_TYPE_CUBE_MAP);
+
+        // DDS load?
+		if (StringUtil::endsWith(getName(), ".dds"))
+        {
+            // find & load resource data
+			DataStreamPtr dstream = 
+				ResourceGroupManager::getSingleton().openResource(
+					mName, mGroup, true, this);
+            MemoryDataStream stream( dstream );
+
+			DWORD usage = 0;
+			UINT numMips = (mNumRequestedMipmaps == MIP_UNLIMITED) ?
+				D3DX_DEFAULT : mNumRequestedMipmaps + 1;
+			// check if mip map volume textures are supported
+			if (!(mDevCaps.TextureCaps & D3DPTEXTURECAPS_MIPCUBEMAP))
+			{
+				// no mip map support for this kind of textures :(
+				mNumMipmaps = 0;
+				numMips = 1;
+			}
+
+            // Determine D3D pool to use
+            D3DPOOL pool;
+            if (mUsage & TU_DYNAMIC)
+            {
+                pool = D3DPOOL_DEFAULT;
+            }
+            else
+            {
+                pool = D3DPOOL_MANAGED;
+            }
+
+			HRESULT hr = D3DXCreateCubeTextureFromFileInMemoryEx(
+				mpDev,
+				stream.getPtr(),
+				stream.size(),
+				D3DX_DEFAULT, // dims (square)
+				numMips,
+				usage,
+				D3DFMT_UNKNOWN,
+				pool,
+				D3DX_DEFAULT,
+				D3DX_DEFAULT,
+				0,  // colour key
+				NULL, // src box
+				NULL, // palette
+				&mpCubeTex); 
+
+            if (FAILED(hr))
+		    {
+				this->freeInternalResources();
+			    OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't create cube texture", "D3D9Texture::_loadCubeTex" );
+		    }
+
+            hr = mpCubeTex->QueryInterface(IID_IDirect3DBaseTexture9, (void **)&mpTex);
+
+            if (FAILED(hr))
+		    {
+				this->freeInternalResources();
+			    OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't get base texture", "D3D9Texture::_loadCubeTex" );
+		    }
+
+            D3DSURFACE_DESC texDesc;
+            mpCubeTex->GetLevelDesc(0, &texDesc);
+            mD3DPool = texDesc.Pool;
+            // set src and dest attributes to the same, we can't know
+            _setSrcAttributes(texDesc.Width, texDesc.Height, 1, D3D9Mappings::_getPF(texDesc.Format));
+            _setFinalAttributes(texDesc.Width, texDesc.Height, 1,  D3D9Mappings::_getPF(texDesc.Format));
+			mInternalResourcesCreated = true;
+        }
+        else
+        {
+			// Load from 6 separate files
+			// Use OGRE its own codecs
+			String baseName, ext;
+			size_t pos = mName.find_last_of(".");
+			baseName = mName.substr(0, pos);
+			ext = mName.substr(pos+1);
+			std::vector<Image> images(6);
+			ConstImagePtrList imagePtrs;
+			static const String suffixes[6] = {"_rt", "_lf", "_up", "_dn", "_fr", "_bk"};
+
+			for(size_t i = 0; i < 6; i++)
+			{
+				String fullName = baseName + suffixes[i] + "." + ext;
+
+            	// find & load resource data intro stream to allow resource
+				// group changes if required
+				DataStreamPtr dstream = 
+					ResourceGroupManager::getSingleton().openResource(
+						fullName, mGroup, true, this);
+	
+				images[i].load(dstream, ext);
+
+				imagePtrs.push_back(&images[i]);
+			}
+
+            _loadImages( imagePtrs );
+        }
+	}
+	/****************************************************************************************/
+	void D3D9Texture::_loadVolumeTex()
+	{
+		assert(this->getTextureType() == TEX_TYPE_3D);
+		// DDS load?
+		if (StringUtil::endsWith(getName(), ".dds"))
+		{
+			// find & load resource data
+			DataStreamPtr dstream = 
+				ResourceGroupManager::getSingleton().openResource(
+					mName, mGroup, true, this);
+			MemoryDataStream stream(dstream);
+	
+			DWORD usage = 0;
+			UINT numMips = (mNumRequestedMipmaps == MIP_UNLIMITED) ?
+				D3DX_DEFAULT : mNumRequestedMipmaps + 1;
+			// check if mip map volume textures are supported
+			if (!(mDevCaps.TextureCaps & D3DPTEXTURECAPS_MIPVOLUMEMAP))
+			{
+				// no mip map support for this kind of textures :(
+				mNumMipmaps = 0;
+				numMips = 1;
+			}
+
+            // Determine D3D pool to use
+            D3DPOOL pool;
+            if (mUsage & TU_DYNAMIC)
+            {
+                pool = D3DPOOL_DEFAULT;
+            }
+            else
+            {
+                pool = D3DPOOL_MANAGED;
+            }
+
+			HRESULT hr = D3DXCreateVolumeTextureFromFileInMemoryEx(
+				mpDev,
+				stream.getPtr(),
+				stream.size(),
+				D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, // dims
+				numMips,
+				usage,
+				D3DFMT_UNKNOWN,
+				pool,
+				D3DX_DEFAULT,
+				D3DX_DEFAULT,
+				0,  // colour key
+				NULL, // src box
+				NULL, // palette
+				&mpVolumeTex); 
+	
+			if (FAILED(hr))
+			{
+				OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+					"Unable to load volume texture from " + this->getName(),
+					"D3D9Texture::_loadVolumeTex");
+			}
+	
+			hr = mpVolumeTex->QueryInterface(IID_IDirect3DBaseTexture9, (void **)&mpTex);
+	
+			if (FAILED(hr))
+			{
+				this->freeInternalResources();
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't get base texture", "D3D9Texture::_loadVolumeTex" );
+			}
+	
+			D3DVOLUME_DESC texDesc;
+			hr = mpVolumeTex->GetLevelDesc(0, &texDesc);
+            mD3DPool = texDesc.Pool;
+			// set src and dest attributes to the same, we can't know
+			_setSrcAttributes(texDesc.Width, texDesc.Height, texDesc.Depth, D3D9Mappings::_getPF(texDesc.Format));
+			_setFinalAttributes(texDesc.Width, texDesc.Height, texDesc.Depth, D3D9Mappings::_getPF(texDesc.Format));
+			mInternalResourcesCreated = true;
+        }
+		else
+		{
+			Image img;
+           	// find & load resource data intro stream to allow resource
+			// group changes if required
+			DataStreamPtr dstream = 
+				ResourceGroupManager::getSingleton().openResource(
+					mName, mGroup, true, this);
+			size_t pos = mName.find_last_of(".");
+			String ext = mName.substr(pos+1);
+	
+			img.load(dstream, ext);
+			// Call internal _loadImages, not loadImage since that's external and 
+			// will determine load status etc again
+			ConstImagePtrList imagePtrs;
+			imagePtrs.push_back(&img);
+			_loadImages( imagePtrs );
+		}
+    }
+	/****************************************************************************************/
+	void D3D9Texture::_loadNormTex()
+	{
+		assert(this->getTextureType() == TEX_TYPE_1D || this->getTextureType() == TEX_TYPE_2D);
+		// DDS load?
+		if (StringUtil::endsWith(getName(), ".dds"))
+		{
+			// Use D3DX
+			// find & load resource data
+			DataStreamPtr dstream = 
+				ResourceGroupManager::getSingleton().openResource(
+					mName, mGroup, true, this);
+			MemoryDataStream stream(dstream);
+	
+			DWORD usage = 0;
+			UINT numMips = (mNumRequestedMipmaps == MIP_UNLIMITED) ?
+				D3DX_DEFAULT : mNumRequestedMipmaps + 1;
+			// check if mip map volume textures are supported
+			if (!(mDevCaps.TextureCaps & D3DPTEXTURECAPS_MIPMAP))
+			{
+				// no mip map support for this kind of textures :(
+				mNumMipmaps = 0;
+				numMips = 1;
+			}
+
+            // Determine D3D pool to use
+            D3DPOOL pool;
+            if (mUsage & TU_DYNAMIC)
+            {
+                pool = D3DPOOL_DEFAULT;
+            }
+            else
+            {
+                pool = D3DPOOL_MANAGED;
+            }
+
+			HRESULT hr = D3DXCreateTextureFromFileInMemoryEx(
+				mpDev,
+				stream.getPtr(),
+				stream.size(),
+				D3DX_DEFAULT, D3DX_DEFAULT, // dims
+				numMips,
+				usage,
+				D3DFMT_UNKNOWN,
+				pool,
+				D3DX_DEFAULT,
+				D3DX_DEFAULT,
+				0,  // colour key
+				NULL, // src box
+				NULL, // palette
+				&mpNormTex); 
+	
+			if (FAILED(hr))
+			{
+				OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+					"Unable to load texture from " + this->getName(),
+					"D3D9Texture::_loadNormTex");
+			}
+	
+			hr = mpNormTex->QueryInterface(IID_IDirect3DBaseTexture9, (void **)&mpTex);
+	
+			if (FAILED(hr))
+			{
+				this->freeInternalResources();
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't get base texture", "D3D9Texture::_loadNormTex" );
+			}
+	
+			D3DSURFACE_DESC texDesc;
+			mpNormTex->GetLevelDesc(0, &texDesc);
+            mD3DPool = texDesc.Pool;
+			// set src and dest attributes to the same, we can't know
+			_setSrcAttributes(texDesc.Width, texDesc.Height, 1, D3D9Mappings::_getPF(texDesc.Format));
+			_setFinalAttributes(texDesc.Width, texDesc.Height, 1, D3D9Mappings::_getPF(texDesc.Format));
+			mInternalResourcesCreated = true;
+        }
+		else
+		{
+			Image img;
+           	// find & load resource data intro stream to allow resource
+			// group changes if required
+			DataStreamPtr dstream = 
+				ResourceGroupManager::getSingleton().openResource(
+					mName, mGroup, true, this);
+	
+			size_t pos = mName.find_last_of(".");
+			String ext = mName.substr(pos+1);
+			
+			img.load(dstream, ext);
+			// Call internal _loadImages, not loadImage since that's external and 
+			// will determine load status etc again
+			ConstImagePtrList imagePtrs;
+			imagePtrs.push_back(&img);
+			_loadImages( imagePtrs );
+		}
+	}
+	/****************************************************************************************/
+    void D3D9Texture::createInternalResourcesImpl(void)
+	{
+		// If mSrcWidth and mSrcHeight are zero, the requested extents have probably been set
+		// through setWidth and setHeight, which set mWidth and mHeight. Take those values.
+		if(mSrcWidth == 0 || mSrcHeight == 0) {
+			mSrcWidth = mWidth;
+			mSrcHeight = mHeight;
+		}
+		
+		// Determine D3D pool to use
+		// Use managed unless we're a render target or user has asked for 
+		// a dynamic texture
+		if ((mUsage & TU_RENDERTARGET) ||
+			(mUsage & TU_DYNAMIC))
+		{
+			mD3DPool = D3DPOOL_DEFAULT;
+		}
+		else
+		{
+			mD3DPool = D3DPOOL_MANAGED;
+		}
+		// load based on tex.type
+		switch (this->getTextureType())
+		{
+		case TEX_TYPE_1D:
+		case TEX_TYPE_2D:
+			this->_createNormTex();
+			break;
+		case TEX_TYPE_CUBE_MAP:
+			this->_createCubeTex();
+			break;
+		case TEX_TYPE_3D:
+			this->_createVolumeTex();
+			break;
+		default:
+			this->freeInternalResources();
+			OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR, "Unknown texture type", "D3D9Texture::createInternalResources" );
+		}
+	}
+	/****************************************************************************************/
+	void D3D9Texture::_createNormTex()
+	{
+		// we must have those defined here
+		assert(mSrcWidth > 0 || mSrcHeight > 0);
+
+		// determine wich D3D9 pixel format we'll use
+		HRESULT hr;
+		D3DFORMAT d3dPF = this->_chooseD3DFormat();
+		// let's D3DX check the corrected pixel format
+		hr = D3DXCheckTextureRequirements(mpDev, NULL, NULL, NULL, 0, &d3dPF, mD3DPool);
+
+		// Use D3DX to help us create the texture, this way it can adjust any relevant sizes
+		DWORD usage = (mUsage & TU_RENDERTARGET) ? D3DUSAGE_RENDERTARGET : 0;
+		UINT numMips = (mNumRequestedMipmaps == MIP_UNLIMITED) ? 
+				D3DX_DEFAULT : mNumRequestedMipmaps + 1;
+		// Check dynamic textures
+		if (mUsage & TU_DYNAMIC)
+		{
+			if (_canUseDynamicTextures(usage, D3DRTYPE_TEXTURE, d3dPF))
+			{
+				usage |= D3DUSAGE_DYNAMIC;
+				mDynamicTextures = true;
+			}
+			else
+			{
+				mDynamicTextures = false;
+			}
+		}
+		// check if mip maps are supported on hardware
+		mMipmapsHardwareGenerated = false;
+		if (mDevCaps.TextureCaps & D3DPTEXTURECAPS_MIPMAP)
+		{
+			if (mUsage & TU_AUTOMIPMAP && mNumRequestedMipmaps != 0)
+			{
+				// use auto.gen. if available, and if desired
+				mMipmapsHardwareGenerated = this->_canAutoGenMipmaps(usage, D3DRTYPE_TEXTURE, d3dPF);
+				if (mMipmapsHardwareGenerated)
+				{
+					usage |= D3DUSAGE_AUTOGENMIPMAP;
+					numMips = 0;
+				}
+			}
+		}
+		else
+		{
+			// no mip map support for this kind of textures :(
+			mNumMipmaps = 0;
+			numMips = 1;
+		}
+
+		// create the texture
+		hr = D3DXCreateTexture(	
+				mpDev,								// device
+				mSrcWidth,							// width
+				mSrcHeight,							// height
+				numMips,							// number of mip map levels
+				usage,								// usage
+				d3dPF,								// pixel format
+				mD3DPool,
+				&mpNormTex);						// data pointer
+		// check result and except if failed
+		if (FAILED(hr))
+		{
+			this->freeInternalResources();
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error creating texture", "D3D9Texture::_createNormTex" );
+		}
+		
+		// set the base texture we'll use in the render system
+		hr = mpNormTex->QueryInterface(IID_IDirect3DBaseTexture9, (void **)&mpTex);
+		if (FAILED(hr))
+		{
+			this->freeInternalResources();
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't get base texture", "D3D9Texture::_createNormTex" );
+		}
+		
+		// set final tex. attributes from tex. description
+		// they may differ from the source image !!!
+		D3DSURFACE_DESC desc;
+		hr = mpNormTex->GetLevelDesc(0, &desc);
+		if (FAILED(hr))
+		{
+			this->freeInternalResources();
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't get texture description", "D3D9Texture::_createNormTex" );
+		}
+		this->_setFinalAttributes(desc.Width, desc.Height, 1, D3D9Mappings::_getPF(desc.Format));
+		
+		// Set best filter type
+		if(mMipmapsHardwareGenerated)
+		{
+			hr = mpTex->SetAutoGenFilterType(_getBestFilterMethod());
+			if(FAILED(hr))
+			{
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Could not set best autogen filter type", "D3D9Texture::_createNormTex" );
+			}
+		}
+	}
+	/****************************************************************************************/
+	void D3D9Texture::_createCubeTex()
+	{
+		// we must have those defined here
+		assert(mSrcWidth > 0 || mSrcHeight > 0);
+
+		// determine wich D3D9 pixel format we'll use
+		HRESULT hr;
+		D3DFORMAT d3dPF = this->_chooseD3DFormat();
+		// let's D3DX check the corrected pixel format
+		hr = D3DXCheckCubeTextureRequirements(mpDev, NULL, NULL, 0, &d3dPF, mD3DPool);
+
+		// Use D3DX to help us create the texture, this way it can adjust any relevant sizes
+		DWORD usage = (mUsage & TU_RENDERTARGET) ? D3DUSAGE_RENDERTARGET : 0;
+		UINT numMips = (mNumRequestedMipmaps == MIP_UNLIMITED) ? 
+			D3DX_DEFAULT : mNumRequestedMipmaps + 1;
+		// Check dynamic textures
+		if (mUsage & TU_DYNAMIC)
+		{
+			if (_canUseDynamicTextures(usage, D3DRTYPE_CUBETEXTURE, d3dPF))
+			{
+				usage |= D3DUSAGE_DYNAMIC;
+				mDynamicTextures = true;
+			}
+			else
+			{
+				mDynamicTextures = false;
+			}
+		}
+		// check if mip map cube textures are supported
+		mMipmapsHardwareGenerated = false;
+		if (mDevCaps.TextureCaps & D3DPTEXTURECAPS_MIPCUBEMAP)
+		{
+			if (mUsage & TU_AUTOMIPMAP && mNumRequestedMipmaps != 0)
+			{
+				// use auto.gen. if available
+				mMipmapsHardwareGenerated = this->_canAutoGenMipmaps(usage, D3DRTYPE_CUBETEXTURE, d3dPF);
+				if (mMipmapsHardwareGenerated)
+				{
+					usage |= D3DUSAGE_AUTOGENMIPMAP;
+					numMips = 0;
+				}
+			}
+		}
+		else
+		{
+			// no mip map support for this kind of textures :(
+			mNumMipmaps = 0;
+			numMips = 1;
+		}
+
+		// create the texture
+		hr = D3DXCreateCubeTexture(	
+				mpDev,								// device
+				mSrcWidth,							// dimension
+				numMips,							// number of mip map levels
+				usage,								// usage
+				d3dPF,								// pixel format
+				mD3DPool,
+				&mpCubeTex);						// data pointer
+		// check result and except if failed
+		if (FAILED(hr))
+		{
+			this->freeInternalResources();
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error creating texture", "D3D9Texture::_createCubeTex" );
+		}
+
+		// set the base texture we'll use in the render system
+		hr = mpCubeTex->QueryInterface(IID_IDirect3DBaseTexture9, (void **)&mpTex);
+		if (FAILED(hr))
+		{
+			this->freeInternalResources();
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't get base texture", "D3D9Texture::_createCubeTex" );
+		}
+		
+		// set final tex. attributes from tex. description
+		// they may differ from the source image !!!
+		D3DSURFACE_DESC desc;
+		hr = mpCubeTex->GetLevelDesc(0, &desc);
+		if (FAILED(hr))
+		{
+			this->freeInternalResources();
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't get texture description", "D3D9Texture::_createCubeTex" );
+		}
+		this->_setFinalAttributes(desc.Width, desc.Height, 1, D3D9Mappings::_getPF(desc.Format));
+
+		// Set best filter type
+		if(mMipmapsHardwareGenerated)
+		{
+			hr = mpTex->SetAutoGenFilterType(_getBestFilterMethod());
+			if(FAILED(hr))
+			{
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Could not set best autogen filter type", "D3D9Texture::_createCubeTex" );
+			}
+		}
+	}
+	/****************************************************************************************/
+	void D3D9Texture::_createVolumeTex()
+	{
+		// we must have those defined here
+		assert(mWidth > 0 && mHeight > 0 && mDepth>0);
+
+		// determine wich D3D9 pixel format we'll use
+		HRESULT hr;
+		D3DFORMAT d3dPF = this->_chooseD3DFormat();
+		// let's D3DX check the corrected pixel format
+		hr = D3DXCheckVolumeTextureRequirements(mpDev, NULL, NULL, NULL, NULL, 0, &d3dPF, mD3DPool);
+
+		// Use D3DX to help us create the texture, this way it can adjust any relevant sizes
+		DWORD usage = (mUsage & TU_RENDERTARGET) ? D3DUSAGE_RENDERTARGET : 0;
+		UINT numMips = (mNumRequestedMipmaps == MIP_UNLIMITED) ? 
+			D3DX_DEFAULT : mNumRequestedMipmaps + 1;
+		// Check dynamic textures
+		if (mUsage & TU_DYNAMIC)
+		{
+			if (_canUseDynamicTextures(usage, D3DRTYPE_VOLUMETEXTURE, d3dPF))
+			{
+				usage |= D3DUSAGE_DYNAMIC;
+				mDynamicTextures = true;
+			}
+			else
+			{
+				mDynamicTextures = false;
+			}
+		}
+		// check if mip map volume textures are supported
+		mMipmapsHardwareGenerated = false;
+		if (mDevCaps.TextureCaps & D3DPTEXTURECAPS_MIPVOLUMEMAP)
+		{
+			if (mUsage & TU_AUTOMIPMAP && mNumRequestedMipmaps != 0)
+			{
+				// use auto.gen. if available
+				mMipmapsHardwareGenerated = this->_canAutoGenMipmaps(usage, D3DRTYPE_VOLUMETEXTURE, d3dPF);
+				if (mMipmapsHardwareGenerated)
+				{
+					usage |= D3DUSAGE_AUTOGENMIPMAP;
+					numMips = 0;
+				}
+			}
+		}
+		else
+		{
+			// no mip map support for this kind of textures :(
+			mNumMipmaps = 0;
+			numMips = 1;
+		}
+
+		// create the texture
+		hr = D3DXCreateVolumeTexture(	
+				mpDev,								// device
+				mWidth,								// dimension
+				mHeight,
+				mDepth,
+				numMips,							// number of mip map levels
+				usage,								// usage
+				d3dPF,								// pixel format
+				mD3DPool,
+				&mpVolumeTex);						// data pointer
+		// check result and except if failed
+		if (FAILED(hr))
+		{
+			this->freeInternalResources();
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Error creating texture", "D3D9Texture::_createVolumeTex" );
+		}
+
+		// set the base texture we'll use in the render system
+		hr = mpVolumeTex->QueryInterface(IID_IDirect3DBaseTexture9, (void **)&mpTex);
+		if (FAILED(hr))
+		{
+			this->freeInternalResources();
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't get base texture", "D3D9Texture::_createVolumeTex" );
+		}
+		
+		// set final tex. attributes from tex. description
+		// they may differ from the source image !!!
+		D3DVOLUME_DESC desc;
+		hr = mpVolumeTex->GetLevelDesc(0, &desc);
+		if (FAILED(hr))
+		{
+			this->freeInternalResources();
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't get texture description", "D3D9Texture::_createVolumeTex" );
+		}
+		this->_setFinalAttributes(desc.Width, desc.Height, desc.Depth, D3D9Mappings::_getPF(desc.Format));
+		
+		// Set best filter type
+		if(mMipmapsHardwareGenerated)
+		{
+			hr = mpTex->SetAutoGenFilterType(_getBestFilterMethod());
+			if(FAILED(hr))
+			{
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Could not set best autogen filter type", "D3D9Texture::_createCubeTex" );
+			}
+		}
+	}
+	/****************************************************************************************/
+	void D3D9Texture::_initDevice(void)
+	{ 
+		assert(mpDev);
+		HRESULT hr;
+
+		// get device caps
+		hr = mpDev->GetDeviceCaps(&mDevCaps);
+		if (FAILED(hr))
+			OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR, "Can't get device description", "D3D9Texture::_setDevice" );
+
+		// get D3D pointer
+		hr = mpDev->GetDirect3D(&mpD3D);
+		// decrement reference count
+		mpD3D->Release();
+		if (FAILED(hr))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to get D3D9 pointer", "D3D9Texture::_setDevice" );
+
+		// get our device creation parameters
+		hr = mpDev->GetCreationParameters(&mDevCreParams);
+		if (FAILED(hr))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to get D3D9 device creation parameters", "D3D9Texture::_setDevice" );
+
+		// get our back buffer pixel format
+		IDirect3DSurface9 *pSrf;
+		D3DSURFACE_DESC srfDesc;
+		hr = mpDev->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pSrf);
+		// decrement reference count
+		pSrf->Release();
+		if (FAILED(hr))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to get D3D9 device pixel format", "D3D9Texture::_setDevice" );
+
+		hr = pSrf->GetDesc(&srfDesc);
+		if (FAILED(hr))
+		{
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to get D3D9 device pixel format", "D3D9Texture::_setDevice" );
+		}
+
+		mBBPixelFormat = srfDesc.Format;
+	}
+	/****************************************************************************************/
+	void D3D9Texture::_setFinalAttributes(unsigned long width, unsigned long height, 
+        unsigned long depth, PixelFormat format)
+	{ 
+		// set target texture attributes
+		mHeight = height; 
+		mWidth = width; 
+        mDepth = depth;
+		mFormat = format; 
+
+		// Update size (the final size, including temp space because in consumed memory)
+		// this is needed in Resource class
+		mSize = calculateSize();
+
+		// say to the world what we are doing
+		if (mWidth != mSrcWidth ||
+			mHeight != mSrcHeight)
+		{
+			LogManager::getSingleton().logMessage("D3D9 : ***** Dimensions altered by the render system");
+			LogManager::getSingleton().logMessage("D3D9 : ***** Source image dimensions : " + StringConverter::toString(mSrcWidth) + "x" + StringConverter::toString(mSrcHeight));
+			LogManager::getSingleton().logMessage("D3D9 : ***** Texture dimensions : " + StringConverter::toString(mWidth) + "x" + StringConverter::toString(mHeight));
+		}
+		
+		// Create list of subsurfaces for getBuffer()
+		_createSurfaceList();
+	}
+	/****************************************************************************************/
+	void D3D9Texture::_setSrcAttributes(unsigned long width, unsigned long height, 
+        unsigned long depth, PixelFormat format)
+	{ 
+		// set source image attributes
+		mSrcWidth = width; 
+		mSrcHeight = height; 
+		mSrcDepth = depth;
+        mSrcFormat = format;
+		// say to the world what we are doing
+		switch (this->getTextureType())
+		{
+		case TEX_TYPE_1D:
+			if (mUsage & TU_RENDERTARGET)
+				LogManager::getSingleton().logMessage("D3D9 : Creating 1D RenderTarget, name : '" + this->getName() + "' with " + StringConverter::toString(mNumMipmaps) + " mip map levels");
+			else
+				LogManager::getSingleton().logMessage("D3D9 : Loading 1D Texture, image name : '" + this->getName() + "' with " + StringConverter::toString(mNumMipmaps) + " mip map levels");
+			break;
+		case TEX_TYPE_2D:
+			if (mUsage & TU_RENDERTARGET)
+				LogManager::getSingleton().logMessage("D3D9 : Creating 2D RenderTarget, name : '" + this->getName() + "' with " + StringConverter::toString(mNumMipmaps) + " mip map levels");
+			else
+				LogManager::getSingleton().logMessage("D3D9 : Loading 2D Texture, image name : '" + this->getName() + "' with " + StringConverter::toString(mNumMipmaps) + " mip map levels");
+			break;
+		case TEX_TYPE_3D:
+			if (mUsage & TU_RENDERTARGET)
+				LogManager::getSingleton().logMessage("D3D9 : Creating 3D RenderTarget, name : '" + this->getName() + "' with " + StringConverter::toString(mNumMipmaps) + " mip map levels");
+			else
+				LogManager::getSingleton().logMessage("D3D9 : Loading 3D Texture, image name : '" + this->getName() + "' with " + StringConverter::toString(mNumMipmaps) + " mip map levels");
+			break;
+		case TEX_TYPE_CUBE_MAP:
+			if (mUsage & TU_RENDERTARGET)
+				LogManager::getSingleton().logMessage("D3D9 : Creating Cube map RenderTarget, name : '" + this->getName() + "' with " + StringConverter::toString(mNumMipmaps) + " mip map levels");
+			else
+				LogManager::getSingleton().logMessage("D3D9 : Loading Cube Texture, base image name : '" + this->getName() + "' with " + StringConverter::toString(mNumMipmaps) + " mip map levels");
+			break;
+		default:
+			this->freeInternalResources();
+			OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR, "Unknown texture type", "D3D9Texture::_setSrcAttributes" );
+		}
+	}
+	/****************************************************************************************/
+	D3DTEXTUREFILTERTYPE D3D9Texture::_getBestFilterMethod()
+	{
+		// those MUST be initialized !!!
+		assert(mpDev);
+		assert(mpD3D);
+		assert(mpTex);
+		
+		DWORD filterCaps = 0;
+		// Minification filter is used for mipmap generation
+		// Pick the best one supported for this tex type
+		switch (this->getTextureType())
+		{
+		case TEX_TYPE_1D:		// Same as 2D
+		case TEX_TYPE_2D:		filterCaps = mDevCaps.TextureFilterCaps;	break;
+		case TEX_TYPE_3D:		filterCaps = mDevCaps.VolumeTextureFilterCaps;	break;
+		case TEX_TYPE_CUBE_MAP:	filterCaps = mDevCaps.CubeTextureFilterCaps;	break;
+		}
+		if(filterCaps & D3DPTFILTERCAPS_MINFGAUSSIANQUAD)
+			return D3DTEXF_GAUSSIANQUAD;
+		
+		if(filterCaps & D3DPTFILTERCAPS_MINFPYRAMIDALQUAD)
+			return D3DTEXF_PYRAMIDALQUAD;
+		
+		if(filterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC)
+			return D3DTEXF_ANISOTROPIC;
+		
+		if(filterCaps & D3DPTFILTERCAPS_MINFLINEAR)
+			return D3DTEXF_LINEAR;
+		
+		if(filterCaps & D3DPTFILTERCAPS_MINFPOINT)
+			return D3DTEXF_POINT;
+		
+		return D3DTEXF_POINT;
+	}
+	/****************************************************************************************/
+	bool D3D9Texture::_canUseDynamicTextures(DWORD srcUsage, D3DRESOURCETYPE srcType, D3DFORMAT srcFormat)
+	{
+		// those MUST be initialized !!!
+		assert(mpDev);
+		assert(mpD3D);
+
+		// Check for dynamic texture support
+		HRESULT hr;
+		// check for auto gen. mip maps support
+		hr = mpD3D->CheckDeviceFormat(
+			mDevCreParams.AdapterOrdinal, 
+			mDevCreParams.DeviceType, 
+			mBBPixelFormat, 
+			srcUsage | D3DUSAGE_DYNAMIC,
+			srcType,
+			srcFormat);
+		if (hr == D3D_OK)
+			return true;
+		else
+			return false;
+	}
+	/****************************************************************************************/
+	bool D3D9Texture::_canAutoGenMipmaps(DWORD srcUsage, D3DRESOURCETYPE srcType, D3DFORMAT srcFormat)
+	{
+		// those MUST be initialized !!!
+		assert(mpDev);
+		assert(mpD3D);
+
+		// Hacky override - many (all?) cards seem to not be able to autogen on 
+		// textures which are not a power of two
+		// Can we even mipmap on 3D textures? Well
+		if ((mWidth & mWidth-1) || (mHeight & mHeight-1) || (mDepth & mDepth-1))
+			return false;
+
+		if (mDevCaps.Caps2 & D3DCAPS2_CANAUTOGENMIPMAP)
+		{
+			HRESULT hr;
+			// check for auto gen. mip maps support
+			hr = mpD3D->CheckDeviceFormat(
+					mDevCreParams.AdapterOrdinal, 
+					mDevCreParams.DeviceType, 
+					mBBPixelFormat, 
+					srcUsage | D3DUSAGE_AUTOGENMIPMAP,
+					srcType,
+					srcFormat);
+			// this HR could a SUCCES
+			// but mip maps will not be generated
+			if (hr == D3D_OK)
+				return true;
+			else
+				return false;
+		}
+		else
+			return false;
+	}
+	/****************************************************************************************/
+	D3DFORMAT D3D9Texture::_chooseD3DFormat()
+	{
+		// Choose frame buffer pixel format in case PF_UNKNOWN was requested
+		if(mFormat == PF_UNKNOWN)
+			return mBBPixelFormat;
+		// Choose closest supported D3D format as a D3D format
+		return D3D9Mappings::_getPF(D3D9Mappings::_getClosestSupportedPF(mFormat));
+
+	}
+	/****************************************************************************************/
+	// Macro to hide ugly cast
+	#define GETLEVEL(face,mip) \
+	 	static_cast<D3D9HardwarePixelBuffer*>(mSurfaceList[face*(mNumMipmaps+1)+mip].get())
+	void D3D9Texture::_createSurfaceList(void)
+	{
+		IDirect3DSurface9 *surface;
+		IDirect3DVolume9 *volume;
+		D3D9HardwarePixelBuffer *buffer;
+		size_t mip, face;
+		assert(mpTex);
+		// Make sure number of mips is right
+		mNumMipmaps = mpTex->GetLevelCount() - 1;
+		// Need to know static / dynamic
+		unsigned int bufusage;
+		if ((mUsage & TU_DYNAMIC) && mDynamicTextures)
+		{
+			bufusage = HardwareBuffer::HBU_DYNAMIC;
+		}
+		else
+		{
+			bufusage = HardwareBuffer::HBU_STATIC;
+		}
+		if (mUsage & TU_RENDERTARGET)
+		{
+			bufusage |= TU_RENDERTARGET;
+		}
+		
+		bool updateOldList = mSurfaceList.size() == (getNumFaces() * (mNumMipmaps + 1));
+		if(!updateOldList)
+		{
+			// Create new list of surfaces
+			mSurfaceList.clear();
+			for(size_t face=0; face<getNumFaces(); ++face)
+			{
+				for(size_t mip=0; mip<=mNumMipmaps; ++mip)
+				{
+					buffer = new D3D9HardwarePixelBuffer((HardwareBuffer::Usage)bufusage);
+					mSurfaceList.push_back(
+						HardwarePixelBufferSharedPtr(buffer)
+					);
+				}
+			}
+		}
+
+		switch(getTextureType()) {
+		case TEX_TYPE_2D:
+		case TEX_TYPE_1D:
+			assert(mpNormTex);
+			// For all mipmaps, store surfaces as HardwarePixelBufferSharedPtr
+			for(mip=0; mip<=mNumMipmaps; ++mip)
+			{
+				if(mpNormTex->GetSurfaceLevel(mip, &surface) != D3D_OK)
+					OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Get surface level failed",
+		 				"D3D9Texture::_createSurfaceList");
+				// decrement reference count, the GetSurfaceLevel call increments this
+				// this is safe because the texture keeps a reference as well
+				surface->Release();
+
+				GETLEVEL(0, mip)->bind(mpDev, surface, updateOldList);
+			}
+			break;
+		case TEX_TYPE_CUBE_MAP:
+			assert(mpCubeTex);
+			// For all faces and mipmaps, store surfaces as HardwarePixelBufferSharedPtr
+			for(face=0; face<6; ++face)
+			{
+				for(mip=0; mip<=mNumMipmaps; ++mip)
+				{
+					if(mpCubeTex->GetCubeMapSurface((D3DCUBEMAP_FACES)face, mip, &surface) != D3D_OK)
+						OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Get cubemap surface failed",
+		 				"D3D9Texture::getBuffer");
+					// decrement reference count, the GetSurfaceLevel call increments this
+					// this is safe because the texture keeps a reference as well
+					surface->Release();
+					
+					GETLEVEL(face, mip)->bind(mpDev, surface, updateOldList);
+				}
+			}
+			break;
+		case TEX_TYPE_3D:
+			assert(mpVolumeTex);
+			// For all mipmaps, store surfaces as HardwarePixelBufferSharedPtr
+			for(mip=0; mip<=mNumMipmaps; ++mip)
+			{
+				if(mpVolumeTex->GetVolumeLevel(mip, &volume) != D3D_OK)
+					OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Get volume level failed",
+		 				"D3D9Texture::getBuffer");	
+				// decrement reference count, the GetSurfaceLevel call increments this
+				// this is safe because the texture keeps a reference as well
+				volume->Release();
+						
+				GETLEVEL(0, mip)->bind(mpDev, volume, updateOldList);
+			}
+			break;
+		};
+		
+		// Set autogeneration of mipmaps for each face of the texture, if it is enabled
+		if(mNumRequestedMipmaps != 0 && (mUsage & TU_AUTOMIPMAP)) 
+		{
+			for(face=0; face<getNumFaces(); ++face)
+			{
+				GETLEVEL(face, 0)->_setMipmapping(true, mMipmapsHardwareGenerated, mpTex);
+			}
+		}
+	}
+	#undef GETLEVEL
+	/****************************************************************************************/
+	HardwarePixelBufferSharedPtr D3D9Texture::getBuffer(size_t face, size_t mipmap) 
+	{
+		if(face >= getNumFaces())
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "A three dimensional cube has six faces",
+					"D3D9Texture::getBuffer");
+		if(mipmap > mNumMipmaps)
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Mipmap index out of range",
+					"D3D9Texture::getBuffer");
+		size_t idx = face*(mNumMipmaps+1) + mipmap;
+		assert(idx < mSurfaceList.size());
+		return mSurfaceList[idx];
+	}
+	
+	
+	/****************************************************************************************/
+	bool D3D9Texture::releaseIfDefaultPool(void)
+	{
+		if(mD3DPool == D3DPOOL_DEFAULT)
+		{
+			LogManager::getSingleton().logMessage(
+				"Releasing D3D9 default pool texture: " + mName);
+			// Just free any internal resources, don't call unload() here
+			// because we want the un-touched resource to keep its unloaded status
+			// after device reset.
+			freeInternalResources();
+			LogManager::getSingleton().logMessage(
+				"Released D3D9 default pool texture: " + mName);
+			return true;
+		}
+		return false;
+	}
+	/****************************************************************************************/
+	bool D3D9Texture::recreateIfDefaultPool(LPDIRECT3DDEVICE9 pDev)
+	{
+		bool ret = false;
+		if(mD3DPool == D3DPOOL_DEFAULT)
+		{
+			ret = true;
+			LogManager::getSingleton().logMessage(
+				"Recreating D3D9 default pool texture: " + mName);
+			// We just want to create the texture resources if:
+			// 1. This is a render texture, or
+			// 2. This is a manual texture with no loader, or
+			// 3. This was an unloaded regular texture (preserve unloaded state)
+			if ((mIsManual && !mLoader) || (mUsage & TU_RENDERTARGET) || !isLoaded())
+			{
+				// just recreate any internal resources
+				createInternalResources();
+			}
+			// Otherwise, this is a regular loaded texture, or a manual texture with a loader
+			else
+			{
+				// The internal resources already freed, need unload/load here:
+				// 1. Make sure resource memory usage statistic correction.
+				// 2. Don't call unload() in releaseIfDefaultPool() because we want
+				//    the un-touched resource keep unload status after device reset.
+				unload();
+				// if manual, we need to recreate internal resources since load() won't do that
+				if (mIsManual)
+					createInternalResources();
+				load();
+			}
+			LogManager::getSingleton().logMessage(
+				"Recreated D3D9 default pool texture: " + mName);
+		}
+
+		return ret;
+
+	}
+
+
+	/****************************************************************************************/
+    void D3D9RenderTexture::update(void)
+    {
+        D3D9RenderSystem* rs = static_cast<D3D9RenderSystem*>(
+            Root::getSingleton().getRenderSystem());
+        if (rs->isDeviceLost())
+            return;
+
+        RenderTexture::update();
+    }
+}
Index: /RenderSystems/Direct3D9/src/OgreD3D9TextureManager.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9TextureManager.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9TextureManager.cpp	(revision 5)
@@ -0,0 +1,149 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9TextureManager.h"
+#include "OgreD3D9Texture.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreD3D9Mappings.h"
+#include "OgreRoot.h"
+#include "OgreD3D9RenderSystem.h"
+
+namespace Ogre 
+{
+	D3D9TextureManager::D3D9TextureManager( LPDIRECT3DDEVICE9 pD3DDevice ) : TextureManager()
+	{
+		mpD3DDevice = pD3DDevice;
+		if( !mpD3DDevice )
+			OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, "Invalid Direct3DDevice passed", "D3D9TextureManager::D3D9TextureManager" );
+        // register with group manager
+        ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
+	}
+
+	D3D9TextureManager::~D3D9TextureManager()
+	{
+        // unregister with group manager
+        ResourceGroupManager::getSingleton()._unregisterResourceManager(mResourceType);
+
+	}
+
+    Resource* D3D9TextureManager::createImpl(const String& name, 
+        ResourceHandle handle, const String& group, bool isManual, 
+        ManualResourceLoader* loader, const NameValuePairList* createParams)
+    {
+        return new D3D9Texture(this, name, handle, group, isManual, loader, mpD3DDevice); 
+    }
+
+	void D3D9TextureManager::releaseDefaultPoolResources(void)
+	{
+		size_t count = 0;
+
+		ResourceMap::iterator r, rend;
+		rend = mResources.end();
+		for (r = mResources.begin(); r != rend; ++r)
+		{
+			D3D9TexturePtr t = r->second;
+			if (t->releaseIfDefaultPool())
+				count++;
+		}
+		LogManager::getSingleton().logMessage("D3D9TextureManager released:");
+		LogManager::getSingleton().logMessage(
+			StringConverter::toString(count) + " unmanaged textures");
+	}
+
+	void D3D9TextureManager::recreateDefaultPoolResources(void)
+	{
+		size_t count = 0;
+
+		ResourceMap::iterator r, rend;
+		rend = mResources.end();
+		for (r = mResources.begin(); r != rend; ++r)
+		{
+			D3D9TexturePtr t = r->second;
+			if(t->recreateIfDefaultPool(mpD3DDevice))
+				count++;
+		}
+		LogManager::getSingleton().logMessage("D3D9TextureManager recreated:");
+		LogManager::getSingleton().logMessage(
+			StringConverter::toString(count) + " unmanaged textures");
+	}
+
+
+	PixelFormat D3D9TextureManager::getNativeFormat(TextureType ttype, PixelFormat format, int usage)
+	{
+		// Basic filtering
+		D3DFORMAT d3dPF = D3D9Mappings::_getPF(D3D9Mappings::_getClosestSupportedPF(format));
+
+		// Calculate usage
+		DWORD d3dusage = 0;
+		D3DPOOL pool = D3DPOOL_MANAGED;
+		if (usage & TU_RENDERTARGET) 
+		{
+			d3dusage |= D3DUSAGE_RENDERTARGET;
+			pool = D3DPOOL_DEFAULT;
+		}
+		if (usage & TU_DYNAMIC)
+		{
+			d3dusage |= D3DUSAGE_DYNAMIC;
+			pool = D3DPOOL_DEFAULT;
+		}
+
+		// Use D3DX to adjust pixel format
+		switch(ttype)
+		{
+		case TEX_TYPE_1D:
+		case TEX_TYPE_2D:
+			D3DXCheckTextureRequirements(mpD3DDevice, NULL, NULL, NULL, d3dusage, &d3dPF, pool);
+			break;
+		case TEX_TYPE_3D:
+			D3DXCheckVolumeTextureRequirements(mpD3DDevice, NULL, NULL, NULL, NULL, d3dusage, &d3dPF, pool);
+			break;
+		case TEX_TYPE_CUBE_MAP:
+			D3DXCheckCubeTextureRequirements(mpD3DDevice, NULL, NULL, d3dusage, &d3dPF, pool);
+			break;
+		};
+
+		return D3D9Mappings::_getPF(d3dPF);
+
+
+	}
+
+    bool D3D9TextureManager::isHardwareFilteringSupported(TextureType ttype, PixelFormat format, int usage,
+        bool preciseFormatOnly)
+    {
+        if (!preciseFormatOnly)
+            format = getNativeFormat(ttype, format, usage);
+
+        D3D9RenderSystem* rs = static_cast<D3D9RenderSystem*>(
+            Root::getSingleton().getRenderSystem());
+
+        return rs->_checkTextureFilteringSupported(ttype, format, usage);
+    }
+
+}
Index: /RenderSystems/Direct3D9/src/OgreD3D9VertexDeclaration.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9VertexDeclaration.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9VertexDeclaration.cpp	(revision 5)
@@ -0,0 +1,151 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9VertexDeclaration.h"
+#include "OgreD3D9Mappings.h"
+#include "OgreException.h"
+#include "OgreRoot.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+    D3D9VertexDeclaration::D3D9VertexDeclaration(LPDIRECT3DDEVICE9 device) 
+        : mlpD3DDevice(device), mlpD3DDecl(NULL), mNeedsRebuild(true)
+    {
+    }
+    //-----------------------------------------------------------------------
+    D3D9VertexDeclaration::~D3D9VertexDeclaration()
+    {
+        SAFE_RELEASE(mlpD3DDecl);
+    }
+    //-----------------------------------------------------------------------
+    const VertexElement& D3D9VertexDeclaration::addElement(unsigned short source, 
+        size_t offset, VertexElementType theType,
+        VertexElementSemantic semantic, unsigned short index)
+    {
+        mNeedsRebuild = true;
+        return VertexDeclaration::addElement(source, offset, theType, semantic, index);
+    }
+    //-----------------------------------------------------------------------------
+    const VertexElement& D3D9VertexDeclaration::insertElement(unsigned short atPosition,
+        unsigned short source, size_t offset, VertexElementType theType,
+        VertexElementSemantic semantic, unsigned short index)
+    {
+        mNeedsRebuild = true;
+        return VertexDeclaration::insertElement(atPosition, source, offset, theType, semantic, index);
+    }
+    //-----------------------------------------------------------------------
+    void D3D9VertexDeclaration::removeElement(unsigned short elem_index)
+    {
+        VertexDeclaration::removeElement(elem_index);
+        mNeedsRebuild = true;
+    }
+	//-----------------------------------------------------------------------
+	void D3D9VertexDeclaration::removeElement(VertexElementSemantic semantic, unsigned short index)
+	{
+		VertexDeclaration::removeElement(semantic, index);
+		mNeedsRebuild = true;
+	}
+	//-----------------------------------------------------------------------
+	void D3D9VertexDeclaration::removeAllElements(void)
+	{
+		VertexDeclaration::removeAllElements();
+		mNeedsRebuild = true;
+	}
+    //-----------------------------------------------------------------------
+    void D3D9VertexDeclaration::modifyElement(unsigned short elem_index, 
+        unsigned short source, size_t offset, VertexElementType theType,
+        VertexElementSemantic semantic, unsigned short index)
+    {
+        VertexDeclaration::modifyElement(elem_index, source, offset, theType, semantic, index);
+        mNeedsRebuild = true;
+    }
+    //-----------------------------------------------------------------------
+    LPDIRECT3DVERTEXDECLARATION9 D3D9VertexDeclaration::getD3DVertexDeclaration(void)
+    {
+        if (mNeedsRebuild)
+        {
+            SAFE_RELEASE(mlpD3DDecl);
+            // Create D3D elements
+            D3DVERTEXELEMENT9* d3delems = new D3DVERTEXELEMENT9[mElementList.size() + 1];
+
+            VertexElementList::const_iterator i, iend;
+            unsigned int idx;
+            iend = mElementList.end();
+            for (idx = 0, i = mElementList.begin(); i != iend; ++i, ++idx)
+            {
+                d3delems[idx].Method = D3DDECLMETHOD_DEFAULT;
+                d3delems[idx].Offset = static_cast<WORD>(i->getOffset());
+                d3delems[idx].Stream = i->getSource();
+				d3delems[idx].Type = D3D9Mappings::get(i->getType());
+				d3delems[idx].Usage = D3D9Mappings::get(i->getSemantic());
+				// NB force index if colours since D3D uses the same usage for 
+				// diffuse & specular
+				if (i->getSemantic() == VES_SPECULAR)
+				{
+					d3delems[idx].UsageIndex = 1;
+				}
+				else if (i->getSemantic() == VES_DIFFUSE)
+				{
+					d3delems[idx].UsageIndex = 0;
+				}
+				else
+				{
+					d3delems[idx].UsageIndex = i->getIndex();
+				}
+            }
+            // Add terminator
+		    d3delems[idx].Stream = 0xff;
+		    d3delems[idx].Offset = 0;
+		    d3delems[idx].Type = D3DDECLTYPE_UNUSED;
+		    d3delems[idx].Method = 0;
+		    d3delems[idx].Usage = 0;
+		    d3delems[idx].UsageIndex = 0;
+            
+            HRESULT hr = mlpD3DDevice->CreateVertexDeclaration(d3delems, &mlpD3DDecl);
+
+            if (FAILED(hr))
+            {
+                OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+                    "Cannot create D3D9 vertex declaration: " + 
+                    Root::getSingleton().getErrorDescription(hr), 
+                    "Direct3D9VertexDeclaration::getD3DVertexDeclaration");
+            }
+
+            delete [] d3delems;
+
+			mNeedsRebuild = false;
+
+        }
+        return mlpD3DDecl;
+    }
+    //-----------------------------------------------------------------------
+
+
+}
+
Index: /RenderSystems/Direct3D9/src/OgreD3D9VideoMode.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9VideoMode.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9VideoMode.cpp	(revision 5)
@@ -0,0 +1,56 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9VideoMode.h"
+
+namespace Ogre 
+{
+	String D3D9VideoMode::getDescription() const
+	{
+		char tmp[128];
+		unsigned int colourDepth = 16;
+		if( mDisplayMode.Format == D3DFMT_X8R8G8B8 ||
+			mDisplayMode.Format == D3DFMT_A8R8G8B8 ||
+			mDisplayMode.Format == D3DFMT_R8G8B8 )
+			colourDepth = 32;
+
+		sprintf( tmp, "%d x %d @ %d-bit colour", mDisplayMode.Width, mDisplayMode.Height, colourDepth );
+		return String(tmp);
+	}
+
+	unsigned int D3D9VideoMode::getColourDepth() const
+	{
+		unsigned int colourDepth = 16;
+		if( mDisplayMode.Format == D3DFMT_X8R8G8B8 ||
+			mDisplayMode.Format == D3DFMT_A8R8G8B8 ||
+			mDisplayMode.Format == D3DFMT_R8G8B8 )
+			colourDepth = 32;
+
+		return colourDepth;
+	}
+}
Index: /RenderSystems/Direct3D9/src/OgreD3D9VideoModeList.cpp
===================================================================
--- /RenderSystems/Direct3D9/src/OgreD3D9VideoModeList.cpp	(revision 5)
+++ /RenderSystems/Direct3D9/src/OgreD3D9VideoModeList.cpp	(revision 5)
@@ -0,0 +1,146 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreD3D9VideoModeList.h"
+#include "OgreException.h"
+
+namespace Ogre 
+{
+	D3D9VideoModeList::D3D9VideoModeList( D3D9Driver* pDriver )
+	{
+		if( NULL == pDriver )
+			OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, "pDriver parameter is NULL", "D3D9VideoModeList::D3D9VideoModeList" );
+
+		mpDriver = pDriver;
+		enumerate();
+	}
+
+	D3D9VideoModeList::~D3D9VideoModeList()
+	{
+		mpDriver = NULL;
+		mModeList.clear();
+	}
+
+	BOOL D3D9VideoModeList::enumerate()
+	{
+		UINT iMode;
+		LPDIRECT3D9 pD3D = mpDriver->getD3D();
+		UINT adapter = mpDriver->getAdapterNumber();
+
+		for( iMode=0; iMode < pD3D->GetAdapterModeCount( adapter, D3DFMT_R5G6B5 ); iMode++ )
+		{
+			D3DDISPLAYMODE displayMode;
+			pD3D->EnumAdapterModes( adapter, D3DFMT_R5G6B5, iMode, &displayMode );
+
+			// Filter out low-resolutions
+			if( displayMode.Width < 640 || displayMode.Height < 400 )
+				continue;
+
+			// Check to see if it is already in the list (to filter out refresh rates)
+			BOOL found = FALSE;
+			std::vector<D3D9VideoMode>::iterator it;
+			for( it = mModeList.begin(); it != mModeList.end(); it++ )
+			{
+				D3DDISPLAYMODE oldDisp = it->getDisplayMode();
+				if( oldDisp.Width == displayMode.Width &&
+					oldDisp.Height == displayMode.Height &&
+					oldDisp.Format == displayMode.Format )
+				{
+					// Check refresh rate and favour higher if poss
+					if (oldDisp.RefreshRate < displayMode.RefreshRate)
+						it->increaseRefreshRate(displayMode.RefreshRate);
+					found = TRUE;
+					break;
+				}
+			}
+
+			if( !found )
+				mModeList.push_back( D3D9VideoMode( displayMode ) );
+		}
+
+		for( iMode=0; iMode < pD3D->GetAdapterModeCount( adapter, D3DFMT_X8R8G8B8 ); iMode++ )
+		{
+			D3DDISPLAYMODE displayMode;
+			pD3D->EnumAdapterModes( adapter, D3DFMT_X8R8G8B8, iMode, &displayMode );
+
+			// Filter out low-resolutions
+			if( displayMode.Width < 640 || displayMode.Height < 400 )
+				continue;
+
+			// Check to see if it is already in the list (to filter out refresh rates)
+			BOOL found = FALSE;
+			std::vector<D3D9VideoMode>::iterator it;
+			for( it = mModeList.begin(); it != mModeList.end(); it++ )
+			{
+				D3DDISPLAYMODE oldDisp = it->getDisplayMode();
+				if( oldDisp.Width == displayMode.Width &&
+					oldDisp.Height == displayMode.Height &&
+					oldDisp.Format == displayMode.Format )
+				{
+					// Check refresh rate and favour higher if poss
+					if (oldDisp.RefreshRate < displayMode.RefreshRate)
+						it->increaseRefreshRate(displayMode.RefreshRate);
+					found = TRUE;
+					break;
+				}
+			}
+
+			if( !found )
+				mModeList.push_back( D3D9VideoMode( displayMode ) );
+		}
+
+		return TRUE;
+	}
+
+	size_t D3D9VideoModeList::count()
+	{
+		return mModeList.size();
+	}
+
+	D3D9VideoMode* D3D9VideoModeList::item( size_t index )
+	{
+		std::vector<D3D9VideoMode>::iterator p = mModeList.begin();
+
+		return &p[index];
+	}
+
+	D3D9VideoMode* D3D9VideoModeList::item( const String &name )
+	{
+		std::vector<D3D9VideoMode>::iterator it = mModeList.begin();
+		if (it == mModeList.end())
+			return NULL;
+
+		for (;it != mModeList.end(); ++it)
+		{
+			if (it->getDescription() == name)
+				return &(*it);
+		}
+
+		return NULL;
+	}
+}
Index: /RenderSystems/GL/Makefile.am
===================================================================
--- /RenderSystems/GL/Makefile.am	(revision 5)
+++ /RenderSystems/GL/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /RenderSystems/GL/Makefile.in
===================================================================
--- /RenderSystems/GL/Makefile.in	(revision 5)
+++ /RenderSystems/GL/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = RenderSystems/GL
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  RenderSystems/GL/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  RenderSystems/GL/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /RenderSystems/GL/include/GL/gl.h
===================================================================
--- /RenderSystems/GL/include/GL/gl.h	(revision 5)
+++ /RenderSystems/GL/include/GL/gl.h	(revision 5)
@@ -0,0 +1,1918 @@
+#ifndef __gl_h_
+#define __gl_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** The contents of this file are subject to the GLX Public License Version 1.0
+** (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, 2011 N. Shoreline Blvd., Mountain View, CA 94043
+** or at http://www.sgi.com/software/opensource/glx/license.html.
+** 
+** Software distributed under the License is distributed on an "AS IS"
+** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY
+** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR
+** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific
+** language governing rights and limitations under the License.
+** 
+** The Original Software is GLX version 1.2 source code, released February,
+** 1999. The developer of the Original Software is Silicon Graphics, Inc.
+** Those portions of the Subject Software created by Silicon Graphics, Inc.
+** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved.
+*/
+
+#ifndef _WIN32
+#define WINGDIAPI
+#define APIENTRY
+#endif
+#define GLAPI WINGDIAPI
+
+
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef signed char GLbyte;
+typedef short GLshort;
+typedef int GLint;
+typedef int GLsizei;
+typedef unsigned char GLubyte;
+typedef unsigned short GLushort;
+typedef unsigned int GLuint;
+typedef float GLfloat;
+typedef float GLclampf;
+typedef double GLdouble;
+typedef double GLclampd;
+typedef void GLvoid;
+
+/*************************************************************/
+
+/* Version */
+#define GL_VERSION_1_1                    1
+#define GL_VERSION_1_2                    1
+
+/* Extensions */
+#define GL_ARB_imaging                    1
+#define GL_ARB_multitexture               1
+
+/* AccumOp */
+#define GL_ACCUM                          0x0100
+#define GL_LOAD                           0x0101
+#define GL_RETURN                         0x0102
+#define GL_MULT                           0x0103
+#define GL_ADD                            0x0104
+
+/* AlphaFunction */
+#define GL_NEVER                          0x0200
+#define GL_LESS                           0x0201
+#define GL_EQUAL                          0x0202
+#define GL_LEQUAL                         0x0203
+#define GL_GREATER                        0x0204
+#define GL_NOTEQUAL                       0x0205
+#define GL_GEQUAL                         0x0206
+#define GL_ALWAYS                         0x0207
+
+/* AttribMask */
+#define GL_CURRENT_BIT                    0x00000001
+#define GL_POINT_BIT                      0x00000002
+#define GL_LINE_BIT                       0x00000004
+#define GL_POLYGON_BIT                    0x00000008
+#define GL_POLYGON_STIPPLE_BIT            0x00000010
+#define GL_PIXEL_MODE_BIT                 0x00000020
+#define GL_LIGHTING_BIT                   0x00000040
+#define GL_FOG_BIT                        0x00000080
+#define GL_DEPTH_BUFFER_BIT               0x00000100
+#define GL_ACCUM_BUFFER_BIT               0x00000200
+#define GL_STENCIL_BUFFER_BIT             0x00000400
+#define GL_VIEWPORT_BIT                   0x00000800
+#define GL_TRANSFORM_BIT                  0x00001000
+#define GL_ENABLE_BIT                     0x00002000
+#define GL_COLOR_BUFFER_BIT               0x00004000
+#define GL_HINT_BIT                       0x00008000
+#define GL_EVAL_BIT                       0x00010000
+#define GL_LIST_BIT                       0x00020000
+#define GL_TEXTURE_BIT                    0x00040000
+#define GL_SCISSOR_BIT                    0x00080000
+#define GL_ALL_ATTRIB_BITS                0x000fffff
+
+/* BeginMode */
+#define GL_POINTS                         0x0000
+#define GL_LINES                          0x0001
+#define GL_LINE_LOOP                      0x0002
+#define GL_LINE_STRIP                     0x0003
+#define GL_TRIANGLES                      0x0004
+#define GL_TRIANGLE_STRIP                 0x0005
+#define GL_TRIANGLE_FAN                   0x0006
+#define GL_QUADS                          0x0007
+#define GL_QUAD_STRIP                     0x0008
+#define GL_POLYGON                        0x0009
+
+/* BlendEquationMode */
+/*      GL_LOGIC_OP */
+/*      GL_FUNC_ADD */
+/*      GL_MIN */
+/*      GL_MAX */
+/*      GL_FUNC_SUBTRACT */
+/*      GL_FUNC_REVERSE_SUBTRACT */
+
+/* BlendingFactorDest */
+#define GL_ZERO                           0
+#define GL_ONE                            1
+#define GL_SRC_COLOR                      0x0300
+#define GL_ONE_MINUS_SRC_COLOR            0x0301
+#define GL_SRC_ALPHA                      0x0302
+#define GL_ONE_MINUS_SRC_ALPHA            0x0303
+#define GL_DST_ALPHA                      0x0304
+#define GL_ONE_MINUS_DST_ALPHA            0x0305
+/*      GL_CONSTANT_COLOR */
+/*      GL_ONE_MINUS_CONSTANT_COLOR */
+/*      GL_CONSTANT_ALPHA */
+/*      GL_ONE_MINUS_CONSTANT_ALPHA */
+
+/* BlendingFactorSrc */
+/*      GL_ZERO */
+/*      GL_ONE */
+#define GL_DST_COLOR                      0x0306
+#define GL_ONE_MINUS_DST_COLOR            0x0307
+#define GL_SRC_ALPHA_SATURATE             0x0308
+/*      GL_SRC_ALPHA */
+/*      GL_ONE_MINUS_SRC_ALPHA */
+/*      GL_DST_ALPHA */
+/*      GL_ONE_MINUS_DST_ALPHA */
+/*      GL_CONSTANT_COLOR */
+/*      GL_ONE_MINUS_CONSTANT_COLOR */
+/*      GL_CONSTANT_ALPHA */
+/*      GL_ONE_MINUS_CONSTANT_ALPHA */
+
+/* Boolean */
+#define GL_TRUE                           1
+#define GL_FALSE                          0
+
+/* ClearBufferMask */
+/*      GL_COLOR_BUFFER_BIT */
+/*      GL_ACCUM_BUFFER_BIT */
+/*      GL_STENCIL_BUFFER_BIT */
+/*      GL_DEPTH_BUFFER_BIT */
+
+/* ClientArrayType */
+/*      GL_VERTEX_ARRAY */
+/*      GL_NORMAL_ARRAY */
+/*      GL_COLOR_ARRAY */
+/*      GL_INDEX_ARRAY */
+/*      GL_TEXTURE_COORD_ARRAY */
+/*      GL_EDGE_FLAG_ARRAY */
+
+/* ClipPlaneName */
+#define GL_CLIP_PLANE0                    0x3000
+#define GL_CLIP_PLANE1                    0x3001
+#define GL_CLIP_PLANE2                    0x3002
+#define GL_CLIP_PLANE3                    0x3003
+#define GL_CLIP_PLANE4                    0x3004
+#define GL_CLIP_PLANE5                    0x3005
+
+/* ColorMaterialFace */
+/*      GL_FRONT */
+/*      GL_BACK */
+/*      GL_FRONT_AND_BACK */
+
+/* ColorMaterialParameter */
+/*      GL_AMBIENT */
+/*      GL_DIFFUSE */
+/*      GL_SPECULAR */
+/*      GL_EMISSION */
+/*      GL_AMBIENT_AND_DIFFUSE */
+
+/* ColorPointerType */
+/*      GL_BYTE */
+/*      GL_UNSIGNED_BYTE */
+/*      GL_SHORT */
+/*      GL_UNSIGNED_SHORT */
+/*      GL_INT */
+/*      GL_UNSIGNED_INT */
+/*      GL_FLOAT */
+/*      GL_DOUBLE */
+
+/* ColorTableParameterPName */
+/*      GL_COLOR_TABLE_SCALE */
+/*      GL_COLOR_TABLE_BIAS */
+
+/* ColorTableTarget */
+/*      GL_COLOR_TABLE */
+/*      GL_POST_CONVOLUTION_COLOR_TABLE */
+/*      GL_POST_COLOR_MATRIX_COLOR_TABLE */
+/*      GL_PROXY_COLOR_TABLE */
+/*      GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
+/*      GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
+
+/* ConvolutionBorderMode */
+/*      GL_REDUCE */
+/*      GL_IGNORE_BORDER */
+/*      GL_CONSTANT_BORDER */
+
+/* ConvolutionParameter */
+/*      GL_CONVOLUTION_BORDER_MODE */
+/*      GL_CONVOLUTION_FILTER_SCALE */
+/*      GL_CONVOLUTION_FILTER_BIAS */
+
+/* ConvolutionTarget */
+/*      GL_CONVOLUTION_1D */
+/*      GL_CONVOLUTION_2D */
+
+/* CullFaceMode */
+/*      GL_FRONT */
+/*      GL_BACK */
+/*      GL_FRONT_AND_BACK */
+
+/* DataType */
+#define GL_BYTE                           0x1400
+#define GL_UNSIGNED_BYTE                  0x1401
+#define GL_SHORT                          0x1402
+#define GL_UNSIGNED_SHORT                 0x1403
+#define GL_INT                            0x1404
+#define GL_UNSIGNED_INT                   0x1405
+#define GL_FLOAT                          0x1406
+#define GL_2_BYTES                        0x1407
+#define GL_3_BYTES                        0x1408
+#define GL_4_BYTES                        0x1409
+#define GL_DOUBLE                         0x140A
+
+/* DepthFunction */
+/*      GL_NEVER */
+/*      GL_LESS */
+/*      GL_EQUAL */
+/*      GL_LEQUAL */
+/*      GL_GREATER */
+/*      GL_NOTEQUAL */
+/*      GL_GEQUAL */
+/*      GL_ALWAYS */
+
+/* DrawBufferMode */
+#define GL_NONE                           0
+#define GL_FRONT_LEFT                     0x0400
+#define GL_FRONT_RIGHT                    0x0401
+#define GL_BACK_LEFT                      0x0402
+#define GL_BACK_RIGHT                     0x0403
+#define GL_FRONT                          0x0404
+#define GL_BACK                           0x0405
+#define GL_LEFT                           0x0406
+#define GL_RIGHT                          0x0407
+#define GL_FRONT_AND_BACK                 0x0408
+#define GL_AUX0                           0x0409
+#define GL_AUX1                           0x040A
+#define GL_AUX2                           0x040B
+#define GL_AUX3                           0x040C
+
+/* Enable */
+/*      GL_FOG */
+/*      GL_LIGHTING */
+/*      GL_TEXTURE_1D */
+/*      GL_TEXTURE_2D */
+/*      GL_LINE_STIPPLE */
+/*      GL_POLYGON_STIPPLE */
+/*      GL_CULL_FACE */
+/*      GL_ALPHA_TEST */
+/*      GL_BLEND */
+/*      GL_INDEX_LOGIC_OP */
+/*      GL_COLOR_LOGIC_OP */
+/*      GL_DITHER */
+/*      GL_STENCIL_TEST */
+/*      GL_DEPTH_TEST */
+/*      GL_CLIP_PLANE0 */
+/*      GL_CLIP_PLANE1 */
+/*      GL_CLIP_PLANE2 */
+/*      GL_CLIP_PLANE3 */
+/*      GL_CLIP_PLANE4 */
+/*      GL_CLIP_PLANE5 */
+/*      GL_LIGHT0 */
+/*      GL_LIGHT1 */
+/*      GL_LIGHT2 */
+/*      GL_LIGHT3 */
+/*      GL_LIGHT4 */
+/*      GL_LIGHT5 */
+/*      GL_LIGHT6 */
+/*      GL_LIGHT7 */
+/*      GL_TEXTURE_GEN_S */
+/*      GL_TEXTURE_GEN_T */
+/*      GL_TEXTURE_GEN_R */
+/*      GL_TEXTURE_GEN_Q */
+/*      GL_MAP1_VERTEX_3 */
+/*      GL_MAP1_VERTEX_4 */
+/*      GL_MAP1_COLOR_4 */
+/*      GL_MAP1_INDEX */
+/*      GL_MAP1_NORMAL */
+/*      GL_MAP1_TEXTURE_COORD_1 */
+/*      GL_MAP1_TEXTURE_COORD_2 */
+/*      GL_MAP1_TEXTURE_COORD_3 */
+/*      GL_MAP1_TEXTURE_COORD_4 */
+/*      GL_MAP2_VERTEX_3 */
+/*      GL_MAP2_VERTEX_4 */
+/*      GL_MAP2_COLOR_4 */
+/*      GL_MAP2_INDEX */
+/*      GL_MAP2_NORMAL */
+/*      GL_MAP2_TEXTURE_COORD_1 */
+/*      GL_MAP2_TEXTURE_COORD_2 */
+/*      GL_MAP2_TEXTURE_COORD_3 */
+/*      GL_MAP2_TEXTURE_COORD_4 */
+/*      GL_POINT_SMOOTH */
+/*      GL_LINE_SMOOTH */
+/*      GL_POLYGON_SMOOTH */
+/*      GL_SCISSOR_TEST */
+/*      GL_COLOR_MATERIAL */
+/*      GL_NORMALIZE */
+/*      GL_AUTO_NORMAL */
+/*      GL_VERTEX_ARRAY */
+/*      GL_NORMAL_ARRAY */
+/*      GL_COLOR_ARRAY */
+/*      GL_INDEX_ARRAY */
+/*      GL_TEXTURE_COORD_ARRAY */
+/*      GL_EDGE_FLAG_ARRAY */
+/*      GL_POLYGON_OFFSET_POINT */
+/*      GL_POLYGON_OFFSET_LINE */
+/*      GL_POLYGON_OFFSET_FILL */
+/*      GL_COLOR_TABLE */
+/*      GL_POST_CONVOLUTION_COLOR_TABLE */
+/*      GL_POST_COLOR_MATRIX_COLOR_TABLE */
+/*      GL_CONVOLUTION_1D */
+/*      GL_CONVOLUTION_2D */
+/*      GL_SEPARABLE_2D */
+/*      GL_HISTOGRAM */
+/*      GL_MINMAX */
+/*      GL_RESCALE_NORMAL */
+/*      GL_TEXTURE_3D */
+
+/* ErrorCode */
+#define GL_NO_ERROR                       0
+#define GL_INVALID_ENUM                   0x0500
+#define GL_INVALID_VALUE                  0x0501
+#define GL_INVALID_OPERATION              0x0502
+#define GL_STACK_OVERFLOW                 0x0503
+#define GL_STACK_UNDERFLOW                0x0504
+#define GL_OUT_OF_MEMORY                  0x0505
+/*      GL_TABLE_TOO_LARGE */
+
+/* FeedBackMode */
+#define GL_2D                             0x0600
+#define GL_3D                             0x0601
+#define GL_3D_COLOR                       0x0602
+#define GL_3D_COLOR_TEXTURE               0x0603
+#define GL_4D_COLOR_TEXTURE               0x0604
+
+/* FeedBackToken */
+#define GL_PASS_THROUGH_TOKEN             0x0700
+#define GL_POINT_TOKEN                    0x0701
+#define GL_LINE_TOKEN                     0x0702
+#define GL_POLYGON_TOKEN                  0x0703
+#define GL_BITMAP_TOKEN                   0x0704
+#define GL_DRAW_PIXEL_TOKEN               0x0705
+#define GL_COPY_PIXEL_TOKEN               0x0706
+#define GL_LINE_RESET_TOKEN               0x0707
+
+/* FogMode */
+/*      GL_LINEAR */
+#define GL_EXP                            0x0800
+#define GL_EXP2                           0x0801
+
+/* FogParameter */
+/*      GL_FOG_COLOR */
+/*      GL_FOG_DENSITY */
+/*      GL_FOG_END */
+/*      GL_FOG_INDEX */
+/*      GL_FOG_MODE */
+/*      GL_FOG_START */
+
+/* FrontFaceDirection */
+#define GL_CW                             0x0900
+#define GL_CCW                            0x0901
+
+/* GetColorTableParameterPName */
+/*      GL_COLOR_TABLE_SCALE */
+/*      GL_COLOR_TABLE_BIAS */
+/*      GL_COLOR_TABLE_FORMAT */
+/*      GL_COLOR_TABLE_WIDTH */
+/*      GL_COLOR_TABLE_RED_SIZE */
+/*      GL_COLOR_TABLE_GREEN_SIZE */
+/*      GL_COLOR_TABLE_BLUE_SIZE */
+/*      GL_COLOR_TABLE_ALPHA_SIZE */
+/*      GL_COLOR_TABLE_LUMINANCE_SIZE */
+/*      GL_COLOR_TABLE_INTENSITY_SIZE */
+
+/* GetConvolutionParameterPName */
+/*      GL_CONVOLUTION_BORDER_COLOR */
+/*      GL_CONVOLUTION_BORDER_MODE */
+/*      GL_CONVOLUTION_FILTER_SCALE */
+/*      GL_CONVOLUTION_FILTER_BIAS */
+/*      GL_CONVOLUTION_FORMAT */
+/*      GL_CONVOLUTION_WIDTH */
+/*      GL_CONVOLUTION_HEIGHT */
+/*      GL_MAX_CONVOLUTION_WIDTH */
+/*      GL_MAX_CONVOLUTION_HEIGHT */
+
+/* GetHistogramParameterPName */
+/*      GL_HISTOGRAM_WIDTH */
+/*      GL_HISTOGRAM_FORMAT */
+/*      GL_HISTOGRAM_RED_SIZE */
+/*      GL_HISTOGRAM_GREEN_SIZE */
+/*      GL_HISTOGRAM_BLUE_SIZE */
+/*      GL_HISTOGRAM_ALPHA_SIZE */
+/*      GL_HISTOGRAM_LUMINANCE_SIZE */
+/*      GL_HISTOGRAM_SINK */
+
+/* GetMapTarget */
+#define GL_COEFF                          0x0A00
+#define GL_ORDER                          0x0A01
+#define GL_DOMAIN                         0x0A02
+
+/* GetMinmaxParameterPName */
+/*      GL_MINMAX_FORMAT */
+/*      GL_MINMAX_SINK */
+
+/* GetPixelMap */
+/*      GL_PIXEL_MAP_I_TO_I */
+/*      GL_PIXEL_MAP_S_TO_S */
+/*      GL_PIXEL_MAP_I_TO_R */
+/*      GL_PIXEL_MAP_I_TO_G */
+/*      GL_PIXEL_MAP_I_TO_B */
+/*      GL_PIXEL_MAP_I_TO_A */
+/*      GL_PIXEL_MAP_R_TO_R */
+/*      GL_PIXEL_MAP_G_TO_G */
+/*      GL_PIXEL_MAP_B_TO_B */
+/*      GL_PIXEL_MAP_A_TO_A */
+
+/* GetPointerTarget */
+/*      GL_VERTEX_ARRAY_POINTER */
+/*      GL_NORMAL_ARRAY_POINTER */
+/*      GL_COLOR_ARRAY_POINTER */
+/*      GL_INDEX_ARRAY_POINTER */
+/*      GL_TEXTURE_COORD_ARRAY_POINTER */
+/*      GL_EDGE_FLAG_ARRAY_POINTER */
+
+/* GetTarget */
+#define GL_CURRENT_COLOR                  0x0B00
+#define GL_CURRENT_INDEX                  0x0B01
+#define GL_CURRENT_NORMAL                 0x0B02
+#define GL_CURRENT_TEXTURE_COORDS         0x0B03
+#define GL_CURRENT_RASTER_COLOR           0x0B04
+#define GL_CURRENT_RASTER_INDEX           0x0B05
+#define GL_CURRENT_RASTER_TEXTURE_COORDS  0x0B06
+#define GL_CURRENT_RASTER_POSITION        0x0B07
+#define GL_CURRENT_RASTER_POSITION_VALID  0x0B08
+#define GL_CURRENT_RASTER_DISTANCE        0x0B09
+#define GL_POINT_SMOOTH                   0x0B10
+#define GL_POINT_SIZE                     0x0B11
+#define GL_POINT_SIZE_RANGE               0x0B12
+#define GL_POINT_SIZE_GRANULARITY         0x0B13
+#define GL_LINE_SMOOTH                    0x0B20
+#define GL_LINE_WIDTH                     0x0B21
+#define GL_LINE_WIDTH_RANGE               0x0B22
+#define GL_LINE_WIDTH_GRANULARITY         0x0B23
+#define GL_LINE_STIPPLE                   0x0B24
+#define GL_LINE_STIPPLE_PATTERN           0x0B25
+#define GL_LINE_STIPPLE_REPEAT            0x0B26
+/*      GL_SMOOTH_POINT_SIZE_RANGE */
+/*      GL_SMOOTH_POINT_SIZE_GRANULARITY */
+/*      GL_SMOOTH_LINE_WIDTH_RANGE */
+/*      GL_SMOOTH_LINE_WIDTH_GRANULARITY */
+/*      GL_ALIASED_POINT_SIZE_RANGE */
+/*      GL_ALIASED_LINE_WIDTH_RANGE */
+#define GL_LIST_MODE                      0x0B30
+#define GL_MAX_LIST_NESTING               0x0B31
+#define GL_LIST_BASE                      0x0B32
+#define GL_LIST_INDEX                     0x0B33
+#define GL_POLYGON_MODE                   0x0B40
+#define GL_POLYGON_SMOOTH                 0x0B41
+#define GL_POLYGON_STIPPLE                0x0B42
+#define GL_EDGE_FLAG                      0x0B43
+#define GL_CULL_FACE                      0x0B44
+#define GL_CULL_FACE_MODE                 0x0B45
+#define GL_FRONT_FACE                     0x0B46
+#define GL_LIGHTING                       0x0B50
+#define GL_LIGHT_MODEL_LOCAL_VIEWER       0x0B51
+#define GL_LIGHT_MODEL_TWO_SIDE           0x0B52
+#define GL_LIGHT_MODEL_AMBIENT            0x0B53
+#define GL_SHADE_MODEL                    0x0B54
+#define GL_COLOR_MATERIAL_FACE            0x0B55
+#define GL_COLOR_MATERIAL_PARAMETER       0x0B56
+#define GL_COLOR_MATERIAL                 0x0B57
+#define GL_FOG                            0x0B60
+#define GL_FOG_INDEX                      0x0B61
+#define GL_FOG_DENSITY                    0x0B62
+#define GL_FOG_START                      0x0B63
+#define GL_FOG_END                        0x0B64
+#define GL_FOG_MODE                       0x0B65
+#define GL_FOG_COLOR                      0x0B66
+#define GL_DEPTH_RANGE                    0x0B70
+#define GL_DEPTH_TEST                     0x0B71
+#define GL_DEPTH_WRITEMASK                0x0B72
+#define GL_DEPTH_CLEAR_VALUE              0x0B73
+#define GL_DEPTH_FUNC                     0x0B74
+#define GL_ACCUM_CLEAR_VALUE              0x0B80
+#define GL_STENCIL_TEST                   0x0B90
+#define GL_STENCIL_CLEAR_VALUE            0x0B91
+#define GL_STENCIL_FUNC                   0x0B92
+#define GL_STENCIL_VALUE_MASK             0x0B93
+#define GL_STENCIL_FAIL                   0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL        0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS        0x0B96
+#define GL_STENCIL_REF                    0x0B97
+#define GL_STENCIL_WRITEMASK              0x0B98
+#define GL_MATRIX_MODE                    0x0BA0
+#define GL_NORMALIZE                      0x0BA1
+#define GL_VIEWPORT                       0x0BA2
+#define GL_MODELVIEW_STACK_DEPTH          0x0BA3
+#define GL_PROJECTION_STACK_DEPTH         0x0BA4
+#define GL_TEXTURE_STACK_DEPTH            0x0BA5
+#define GL_MODELVIEW_MATRIX               0x0BA6
+#define GL_PROJECTION_MATRIX              0x0BA7
+#define GL_TEXTURE_MATRIX                 0x0BA8
+#define GL_ATTRIB_STACK_DEPTH             0x0BB0
+#define GL_CLIENT_ATTRIB_STACK_DEPTH      0x0BB1
+#define GL_ALPHA_TEST                     0x0BC0
+#define GL_ALPHA_TEST_FUNC                0x0BC1
+#define GL_ALPHA_TEST_REF                 0x0BC2
+#define GL_DITHER                         0x0BD0
+#define GL_BLEND_DST                      0x0BE0
+#define GL_BLEND_SRC                      0x0BE1
+#define GL_BLEND                          0x0BE2
+#define GL_LOGIC_OP_MODE                  0x0BF0
+#define GL_INDEX_LOGIC_OP                 0x0BF1
+#define GL_COLOR_LOGIC_OP                 0x0BF2
+#define GL_AUX_BUFFERS                    0x0C00
+#define GL_DRAW_BUFFER                    0x0C01
+#define GL_READ_BUFFER                    0x0C02
+#define GL_SCISSOR_BOX                    0x0C10
+#define GL_SCISSOR_TEST                   0x0C11
+#define GL_INDEX_CLEAR_VALUE              0x0C20
+#define GL_INDEX_WRITEMASK                0x0C21
+#define GL_COLOR_CLEAR_VALUE              0x0C22
+#define GL_COLOR_WRITEMASK                0x0C23
+#define GL_INDEX_MODE                     0x0C30
+#define GL_RGBA_MODE                      0x0C31
+#define GL_DOUBLEBUFFER                   0x0C32
+#define GL_STEREO                         0x0C33
+#define GL_RENDER_MODE                    0x0C40
+#define GL_PERSPECTIVE_CORRECTION_HINT    0x0C50
+#define GL_POINT_SMOOTH_HINT              0x0C51
+#define GL_LINE_SMOOTH_HINT               0x0C52
+#define GL_POLYGON_SMOOTH_HINT            0x0C53
+#define GL_FOG_HINT                       0x0C54
+#define GL_TEXTURE_GEN_S                  0x0C60
+#define GL_TEXTURE_GEN_T                  0x0C61
+#define GL_TEXTURE_GEN_R                  0x0C62
+#define GL_TEXTURE_GEN_Q                  0x0C63
+#define GL_PIXEL_MAP_I_TO_I               0x0C70
+#define GL_PIXEL_MAP_S_TO_S               0x0C71
+#define GL_PIXEL_MAP_I_TO_R               0x0C72
+#define GL_PIXEL_MAP_I_TO_G               0x0C73
+#define GL_PIXEL_MAP_I_TO_B               0x0C74
+#define GL_PIXEL_MAP_I_TO_A               0x0C75
+#define GL_PIXEL_MAP_R_TO_R               0x0C76
+#define GL_PIXEL_MAP_G_TO_G               0x0C77
+#define GL_PIXEL_MAP_B_TO_B               0x0C78
+#define GL_PIXEL_MAP_A_TO_A               0x0C79
+#define GL_PIXEL_MAP_I_TO_I_SIZE          0x0CB0
+#define GL_PIXEL_MAP_S_TO_S_SIZE          0x0CB1
+#define GL_PIXEL_MAP_I_TO_R_SIZE          0x0CB2
+#define GL_PIXEL_MAP_I_TO_G_SIZE          0x0CB3
+#define GL_PIXEL_MAP_I_TO_B_SIZE          0x0CB4
+#define GL_PIXEL_MAP_I_TO_A_SIZE          0x0CB5
+#define GL_PIXEL_MAP_R_TO_R_SIZE          0x0CB6
+#define GL_PIXEL_MAP_G_TO_G_SIZE          0x0CB7
+#define GL_PIXEL_MAP_B_TO_B_SIZE          0x0CB8
+#define GL_PIXEL_MAP_A_TO_A_SIZE          0x0CB9
+#define GL_UNPACK_SWAP_BYTES              0x0CF0
+#define GL_UNPACK_LSB_FIRST               0x0CF1
+#define GL_UNPACK_ROW_LENGTH              0x0CF2
+#define GL_UNPACK_SKIP_ROWS               0x0CF3
+#define GL_UNPACK_SKIP_PIXELS             0x0CF4
+#define GL_UNPACK_ALIGNMENT               0x0CF5
+#define GL_PACK_SWAP_BYTES                0x0D00
+#define GL_PACK_LSB_FIRST                 0x0D01
+#define GL_PACK_ROW_LENGTH                0x0D02
+#define GL_PACK_SKIP_ROWS                 0x0D03
+#define GL_PACK_SKIP_PIXELS               0x0D04
+#define GL_PACK_ALIGNMENT                 0x0D05
+#define GL_MAP_COLOR                      0x0D10
+#define GL_MAP_STENCIL                    0x0D11
+#define GL_INDEX_SHIFT                    0x0D12
+#define GL_INDEX_OFFSET                   0x0D13
+#define GL_RED_SCALE                      0x0D14
+#define GL_RED_BIAS                       0x0D15
+#define GL_ZOOM_X                         0x0D16
+#define GL_ZOOM_Y                         0x0D17
+#define GL_GREEN_SCALE                    0x0D18
+#define GL_GREEN_BIAS                     0x0D19
+#define GL_BLUE_SCALE                     0x0D1A
+#define GL_BLUE_BIAS                      0x0D1B
+#define GL_ALPHA_SCALE                    0x0D1C
+#define GL_ALPHA_BIAS                     0x0D1D
+#define GL_DEPTH_SCALE                    0x0D1E
+#define GL_DEPTH_BIAS                     0x0D1F
+#define GL_MAX_EVAL_ORDER                 0x0D30
+#define GL_MAX_LIGHTS                     0x0D31
+#define GL_MAX_CLIP_PLANES                0x0D32
+#define GL_MAX_TEXTURE_SIZE               0x0D33
+#define GL_MAX_PIXEL_MAP_TABLE            0x0D34
+#define GL_MAX_ATTRIB_STACK_DEPTH         0x0D35
+#define GL_MAX_MODELVIEW_STACK_DEPTH      0x0D36
+#define GL_MAX_NAME_STACK_DEPTH           0x0D37
+#define GL_MAX_PROJECTION_STACK_DEPTH     0x0D38
+#define GL_MAX_TEXTURE_STACK_DEPTH        0x0D39
+#define GL_MAX_VIEWPORT_DIMS              0x0D3A
+#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH  0x0D3B
+#define GL_SUBPIXEL_BITS                  0x0D50
+#define GL_INDEX_BITS                     0x0D51
+#define GL_RED_BITS                       0x0D52
+#define GL_GREEN_BITS                     0x0D53
+#define GL_BLUE_BITS                      0x0D54
+#define GL_ALPHA_BITS                     0x0D55
+#define GL_DEPTH_BITS                     0x0D56
+#define GL_STENCIL_BITS                   0x0D57
+#define GL_ACCUM_RED_BITS                 0x0D58
+#define GL_ACCUM_GREEN_BITS               0x0D59
+#define GL_ACCUM_BLUE_BITS                0x0D5A
+#define GL_ACCUM_ALPHA_BITS               0x0D5B
+#define GL_NAME_STACK_DEPTH               0x0D70
+#define GL_AUTO_NORMAL                    0x0D80
+#define GL_MAP1_COLOR_4                   0x0D90
+#define GL_MAP1_INDEX                     0x0D91
+#define GL_MAP1_NORMAL                    0x0D92
+#define GL_MAP1_TEXTURE_COORD_1           0x0D93
+#define GL_MAP1_TEXTURE_COORD_2           0x0D94
+#define GL_MAP1_TEXTURE_COORD_3           0x0D95
+#define GL_MAP1_TEXTURE_COORD_4           0x0D96
+#define GL_MAP1_VERTEX_3                  0x0D97
+#define GL_MAP1_VERTEX_4                  0x0D98
+#define GL_MAP2_COLOR_4                   0x0DB0
+#define GL_MAP2_INDEX                     0x0DB1
+#define GL_MAP2_NORMAL                    0x0DB2
+#define GL_MAP2_TEXTURE_COORD_1           0x0DB3
+#define GL_MAP2_TEXTURE_COORD_2           0x0DB4
+#define GL_MAP2_TEXTURE_COORD_3           0x0DB5
+#define GL_MAP2_TEXTURE_COORD_4           0x0DB6
+#define GL_MAP2_VERTEX_3                  0x0DB7
+#define GL_MAP2_VERTEX_4                  0x0DB8
+#define GL_MAP1_GRID_DOMAIN               0x0DD0
+#define GL_MAP1_GRID_SEGMENTS             0x0DD1
+#define GL_MAP2_GRID_DOMAIN               0x0DD2
+#define GL_MAP2_GRID_SEGMENTS             0x0DD3
+#define GL_TEXTURE_1D                     0x0DE0
+#define GL_TEXTURE_2D                     0x0DE1
+#define GL_FEEDBACK_BUFFER_POINTER        0x0DF0
+#define GL_FEEDBACK_BUFFER_SIZE           0x0DF1
+#define GL_FEEDBACK_BUFFER_TYPE           0x0DF2
+#define GL_SELECTION_BUFFER_POINTER       0x0DF3
+#define GL_SELECTION_BUFFER_SIZE          0x0DF4
+/*      GL_TEXTURE_BINDING_1D */
+/*      GL_TEXTURE_BINDING_2D */
+/*      GL_TEXTURE_BINDING_3D */
+/*      GL_VERTEX_ARRAY */
+/*      GL_NORMAL_ARRAY */
+/*      GL_COLOR_ARRAY */
+/*      GL_INDEX_ARRAY */
+/*      GL_TEXTURE_COORD_ARRAY */
+/*      GL_EDGE_FLAG_ARRAY */
+/*      GL_VERTEX_ARRAY_SIZE */
+/*      GL_VERTEX_ARRAY_TYPE */
+/*      GL_VERTEX_ARRAY_STRIDE */
+/*      GL_NORMAL_ARRAY_TYPE */
+/*      GL_NORMAL_ARRAY_STRIDE */
+/*      GL_COLOR_ARRAY_SIZE */
+/*      GL_COLOR_ARRAY_TYPE */
+/*      GL_COLOR_ARRAY_STRIDE */
+/*      GL_INDEX_ARRAY_TYPE */
+/*      GL_INDEX_ARRAY_STRIDE */
+/*      GL_TEXTURE_COORD_ARRAY_SIZE */
+/*      GL_TEXTURE_COORD_ARRAY_TYPE */
+/*      GL_TEXTURE_COORD_ARRAY_STRIDE */
+/*      GL_EDGE_FLAG_ARRAY_STRIDE */
+/*      GL_POLYGON_OFFSET_FACTOR */
+/*      GL_POLYGON_OFFSET_UNITS */
+/*      GL_COLOR_TABLE */
+/*      GL_POST_CONVOLUTION_COLOR_TABLE */
+/*      GL_POST_COLOR_MATRIX_COLOR_TABLE */
+/*      GL_CONVOLUTION_1D */
+/*      GL_CONVOLUTION_2D */
+/*      GL_SEPARABLE_2D */
+/*      GL_POST_CONVOLUTION_RED_SCALE */
+/*      GL_POST_CONVOLUTION_GREEN_SCALE */
+/*      GL_POST_CONVOLUTION_BLUE_SCALE */
+/*      GL_POST_CONVOLUTION_ALPHA_SCALE */
+/*      GL_POST_CONVOLUTION_RED_BIAS */
+/*      GL_POST_CONVOLUTION_GREEN_BIAS */
+/*      GL_POST_CONVOLUTION_BLUE_BIAS */
+/*      GL_POST_CONVOLUTION_ALPHA_BIAS */
+/*      GL_COLOR_MATRIX */
+/*      GL_COLOR_MATRIX_STACK_DEPTH */
+/*      GL_MAX_COLOR_MATRIX_STACK_DEPTH */
+/*      GL_POST_COLOR_MATRIX_RED_SCALE */
+/*      GL_POST_COLOR_MATRIX_GREEN_SCALE */
+/*      GL_POST_COLOR_MATRIX_BLUE_SCALE */
+/*      GL_POST_COLOR_MATRIX_ALPHA_SCALE */
+/*      GL_POST_COLOR_MATRIX_RED_BIAS */
+/*      GL_POST_COLOR_MATRIX_GREEN_BIAS */
+/*      GL_POST_COLOR_MATRIX_BLUE_BIAS */
+/*      GL_POST_COLOR_MATRIX_ALPHA_BIAS */
+/*      GL_HISTOGRAM */
+/*      GL_MINMAX */
+/*      GL_MAX_ELEMENTS_VERTICES */
+/*      GL_MAX_ELEMENTS_INDICES */
+/*      GL_RESCALE_NORMAL */
+/*      GL_LIGHT_MODEL_COLOR_CONTROL */
+/*      GL_PACK_SKIP_IMAGES */
+/*      GL_PACK_IMAGE_HEIGHT */
+/*      GL_UNPACK_SKIP_IMAGES */
+/*      GL_UNPACK_IMAGE_HEIGHT */
+/*      GL_TEXTURE_3D */
+/*      GL_MAX_3D_TEXTURE_SIZE */
+/*      GL_BLEND_COLOR */
+/*      GL_BLEND_EQUATION */
+/*      GL_ACTIVE_TEXTURE_ARB */
+/*      GL_CLIENT_ACTIVE_TEXTURE_ARB */
+/*      GL_MAX_TEXTURE_UNITS_ARB */
+
+/* GetTextureParameter */
+/*      GL_TEXTURE_MAG_FILTER */
+/*      GL_TEXTURE_MIN_FILTER */
+/*      GL_TEXTURE_WRAP_S */
+/*      GL_TEXTURE_WRAP_T */
+#define GL_TEXTURE_WIDTH                  0x1000
+#define GL_TEXTURE_HEIGHT                 0x1001
+#define GL_TEXTURE_INTERNAL_FORMAT        0x1003
+#define GL_TEXTURE_BORDER_COLOR           0x1004
+#define GL_TEXTURE_BORDER                 0x1005
+/*      GL_TEXTURE_RED_SIZE */
+/*      GL_TEXTURE_GREEN_SIZE */
+/*      GL_TEXTURE_BLUE_SIZE */
+/*      GL_TEXTURE_ALPHA_SIZE */
+/*      GL_TEXTURE_LUMINANCE_SIZE */
+/*      GL_TEXTURE_INTENSITY_SIZE */
+/*      GL_TEXTURE_PRIORITY */
+/*      GL_TEXTURE_RESIDENT */
+/*      GL_TEXTURE_DEPTH */
+/*      GL_TEXTURE_WRAP_R */
+/*      GL_TEXTURE_MIN_LOD */
+/*      GL_TEXTURE_MAX_LOD */
+/*      GL_TEXTURE_BASE_LEVEL */
+/*      GL_TEXTURE_MAX_LEVEL */
+
+/* HintMode */
+#define GL_DONT_CARE                      0x1100
+#define GL_FASTEST                        0x1101
+#define GL_NICEST                         0x1102
+
+/* HintTarget */
+/*      GL_PERSPECTIVE_CORRECTION_HINT */
+/*      GL_POINT_SMOOTH_HINT */
+/*      GL_LINE_SMOOTH_HINT */
+/*      GL_POLYGON_SMOOTH_HINT */
+/*      GL_FOG_HINT */
+
+/* HistogramTarget */
+/*      GL_HISTOGRAM */
+/*      GL_PROXY_HISTOGRAM */
+
+/* IndexPointerType */
+/*      GL_SHORT */
+/*      GL_INT */
+/*      GL_FLOAT */
+/*      GL_DOUBLE */
+
+/* LightModelColorControl */
+/*      GL_SINGLE_COLOR */
+/*      GL_SEPARATE_SPECULAR_COLOR */
+
+/* LightModelParameter */
+/*      GL_LIGHT_MODEL_AMBIENT */
+/*      GL_LIGHT_MODEL_LOCAL_VIEWER */
+/*      GL_LIGHT_MODEL_TWO_SIDE */
+/*      GL_LIGHT_MODEL_COLOR_CONTROL */
+
+/* LightName */
+#define GL_LIGHT0                         0x4000
+#define GL_LIGHT1                         0x4001
+#define GL_LIGHT2                         0x4002
+#define GL_LIGHT3                         0x4003
+#define GL_LIGHT4                         0x4004
+#define GL_LIGHT5                         0x4005
+#define GL_LIGHT6                         0x4006
+#define GL_LIGHT7                         0x4007
+
+/* LightParameter */
+#define GL_AMBIENT                        0x1200
+#define GL_DIFFUSE                        0x1201
+#define GL_SPECULAR                       0x1202
+#define GL_POSITION                       0x1203
+#define GL_SPOT_DIRECTION                 0x1204
+#define GL_SPOT_EXPONENT                  0x1205
+#define GL_SPOT_CUTOFF                    0x1206
+#define GL_CONSTANT_ATTENUATION           0x1207
+#define GL_LINEAR_ATTENUATION             0x1208
+#define GL_QUADRATIC_ATTENUATION          0x1209
+
+/* InterleavedArrays */
+/*      GL_V2F */
+/*      GL_V3F */
+/*      GL_C4UB_V2F */
+/*      GL_C4UB_V3F */
+/*      GL_C3F_V3F */
+/*      GL_N3F_V3F */
+/*      GL_C4F_N3F_V3F */
+/*      GL_T2F_V3F */
+/*      GL_T4F_V4F */
+/*      GL_T2F_C4UB_V3F */
+/*      GL_T2F_C3F_V3F */
+/*      GL_T2F_N3F_V3F */
+/*      GL_T2F_C4F_N3F_V3F */
+/*      GL_T4F_C4F_N3F_V4F */
+
+/* ListMode */
+#define GL_COMPILE                        0x1300
+#define GL_COMPILE_AND_EXECUTE            0x1301
+
+/* ListNameType */
+/*      GL_BYTE */
+/*      GL_UNSIGNED_BYTE */
+/*      GL_SHORT */
+/*      GL_UNSIGNED_SHORT */
+/*      GL_INT */
+/*      GL_UNSIGNED_INT */
+/*      GL_FLOAT */
+/*      GL_2_BYTES */
+/*      GL_3_BYTES */
+/*      GL_4_BYTES */
+
+/* LogicOp */
+#define GL_CLEAR                          0x1500
+#define GL_AND                            0x1501
+#define GL_AND_REVERSE                    0x1502
+#define GL_COPY                           0x1503
+#define GL_AND_INVERTED                   0x1504
+#define GL_NOOP                           0x1505
+#define GL_XOR                            0x1506
+#define GL_OR                             0x1507
+#define GL_NOR                            0x1508
+#define GL_EQUIV                          0x1509
+#define GL_INVERT                         0x150A
+#define GL_OR_REVERSE                     0x150B
+#define GL_COPY_INVERTED                  0x150C
+#define GL_OR_INVERTED                    0x150D
+#define GL_NAND                           0x150E
+#define GL_SET                            0x150F
+
+/* MapTarget */
+/*      GL_MAP1_COLOR_4 */
+/*      GL_MAP1_INDEX */
+/*      GL_MAP1_NORMAL */
+/*      GL_MAP1_TEXTURE_COORD_1 */
+/*      GL_MAP1_TEXTURE_COORD_2 */
+/*      GL_MAP1_TEXTURE_COORD_3 */
+/*      GL_MAP1_TEXTURE_COORD_4 */
+/*      GL_MAP1_VERTEX_3 */
+/*      GL_MAP1_VERTEX_4 */
+/*      GL_MAP2_COLOR_4 */
+/*      GL_MAP2_INDEX */
+/*      GL_MAP2_NORMAL */
+/*      GL_MAP2_TEXTURE_COORD_1 */
+/*      GL_MAP2_TEXTURE_COORD_2 */
+/*      GL_MAP2_TEXTURE_COORD_3 */
+/*      GL_MAP2_TEXTURE_COORD_4 */
+/*      GL_MAP2_VERTEX_3 */
+/*      GL_MAP2_VERTEX_4 */
+
+/* MaterialFace */
+/*      GL_FRONT */
+/*      GL_BACK */
+/*      GL_FRONT_AND_BACK */
+
+/* MaterialParameter */
+#define GL_EMISSION                       0x1600
+#define GL_SHININESS                      0x1601
+#define GL_AMBIENT_AND_DIFFUSE            0x1602
+#define GL_COLOR_INDEXES                  0x1603
+/*      GL_AMBIENT */
+/*      GL_DIFFUSE */
+/*      GL_SPECULAR */
+
+/* MatrixMode */
+#define GL_MODELVIEW                      0x1700
+#define GL_PROJECTION                     0x1701
+#define GL_TEXTURE                        0x1702
+
+/* MeshMode1 */
+/*      GL_POINT */
+/*      GL_LINE */
+
+/* MeshMode2 */
+/*      GL_POINT */
+/*      GL_LINE */
+/*      GL_FILL */
+
+/* MinmaxTarget */
+/*      GL_MINMAX */
+
+/* NormalPointerType */
+/*      GL_BYTE */
+/*      GL_SHORT */
+/*      GL_INT */
+/*      GL_FLOAT */
+/*      GL_DOUBLE */
+
+/* PixelCopyType */
+#define GL_COLOR                          0x1800
+#define GL_DEPTH                          0x1801
+#define GL_STENCIL                        0x1802
+
+/* PixelFormat */
+#define GL_COLOR_INDEX                    0x1900
+#define GL_STENCIL_INDEX                  0x1901
+#define GL_DEPTH_COMPONENT                0x1902
+#define GL_RED                            0x1903
+#define GL_GREEN                          0x1904
+#define GL_BLUE                           0x1905
+#define GL_ALPHA                          0x1906
+#define GL_RGB                            0x1907
+#define GL_RGBA                           0x1908
+#define GL_LUMINANCE                      0x1909
+#define GL_LUMINANCE_ALPHA                0x190A
+/*      GL_ABGR */
+
+/* PixelInternalFormat */
+/*      GL_ALPHA4 */
+/*      GL_ALPHA8 */
+/*      GL_ALPHA12 */
+/*      GL_ALPHA16 */
+/*      GL_LUMINANCE4 */
+/*      GL_LUMINANCE8 */
+/*      GL_LUMINANCE12 */
+/*      GL_LUMINANCE16 */
+/*      GL_LUMINANCE4_ALPHA4 */
+/*      GL_LUMINANCE6_ALPHA2 */
+/*      GL_LUMINANCE8_ALPHA8 */
+/*      GL_LUMINANCE12_ALPHA4 */
+/*      GL_LUMINANCE12_ALPHA12 */
+/*      GL_LUMINANCE16_ALPHA16 */
+/*      GL_INTENSITY */
+/*      GL_INTENSITY4 */
+/*      GL_INTENSITY8 */
+/*      GL_INTENSITY12 */
+/*      GL_INTENSITY16 */
+/*      GL_R3_G3_B2 */
+/*      GL_RGB4 */
+/*      GL_RGB5 */
+/*      GL_RGB8 */
+/*      GL_RGB10 */
+/*      GL_RGB12 */
+/*      GL_RGB16 */
+/*      GL_RGBA2 */
+/*      GL_RGBA4 */
+/*      GL_RGB5_A1 */
+/*      GL_RGBA8 */
+/*      GL_RGB10_A2 */
+/*      GL_RGBA12 */
+/*      GL_RGBA16 */
+
+/* PixelMap */
+/*      GL_PIXEL_MAP_I_TO_I */
+/*      GL_PIXEL_MAP_S_TO_S */
+/*      GL_PIXEL_MAP_I_TO_R */
+/*      GL_PIXEL_MAP_I_TO_G */
+/*      GL_PIXEL_MAP_I_TO_B */
+/*      GL_PIXEL_MAP_I_TO_A */
+/*      GL_PIXEL_MAP_R_TO_R */
+/*      GL_PIXEL_MAP_G_TO_G */
+/*      GL_PIXEL_MAP_B_TO_B */
+/*      GL_PIXEL_MAP_A_TO_A */
+
+/* PixelStore */
+/*      GL_UNPACK_SWAP_BYTES */
+/*      GL_UNPACK_LSB_FIRST */
+/*      GL_UNPACK_ROW_LENGTH */
+/*      GL_UNPACK_SKIP_ROWS */
+/*      GL_UNPACK_SKIP_PIXELS */
+/*      GL_UNPACK_ALIGNMENT */
+/*      GL_PACK_SWAP_BYTES */
+/*      GL_PACK_LSB_FIRST */
+/*      GL_PACK_ROW_LENGTH */
+/*      GL_PACK_SKIP_ROWS */
+/*      GL_PACK_SKIP_PIXELS */
+/*      GL_PACK_ALIGNMENT */
+/*      GL_PACK_SKIP_IMAGES */
+/*      GL_PACK_IMAGE_HEIGHT */
+/*      GL_UNPACK_SKIP_IMAGES */
+/*      GL_UNPACK_IMAGE_HEIGHT */
+
+/* PixelTransfer */
+/*      GL_MAP_COLOR */
+/*      GL_MAP_STENCIL */
+/*      GL_INDEX_SHIFT */
+/*      GL_INDEX_OFFSET */
+/*      GL_RED_SCALE */
+/*      GL_RED_BIAS */
+/*      GL_GREEN_SCALE */
+/*      GL_GREEN_BIAS */
+/*      GL_BLUE_SCALE */
+/*      GL_BLUE_BIAS */
+/*      GL_ALPHA_SCALE */
+/*      GL_ALPHA_BIAS */
+/*      GL_DEPTH_SCALE */
+/*      GL_DEPTH_BIAS */
+/*      GL_POST_CONVOLUTION_RED_SCALE */
+/*      GL_POST_CONVOLUTION_GREEN_SCALE */
+/*      GL_POST_CONVOLUTION_BLUE_SCALE */
+/*      GL_POST_CONVOLUTION_ALPHA_SCALE */
+/*      GL_POST_CONVOLUTION_RED_BIAS */
+/*      GL_POST_CONVOLUTION_GREEN_BIAS */
+/*      GL_POST_CONVOLUTION_BLUE_BIAS */
+/*      GL_POST_CONVOLUTION_ALPHA_BIAS */
+/*      GL_POST_COLOR_MATRIX_RED_SCALE */
+/*      GL_POST_COLOR_MATRIX_GREEN_SCALE */
+/*      GL_POST_COLOR_MATRIX_BLUE_SCALE */
+/*      GL_POST_COLOR_MATRIX_ALPHA_SCALE */
+/*      GL_POST_COLOR_MATRIX_RED_BIAS */
+/*      GL_POST_COLOR_MATRIX_GREEN_BIAS */
+/*      GL_POST_COLOR_MATRIX_BLUE_BIAS */
+/*      GL_POST_COLOR_MATRIX_ALPHA_BIAS */
+
+/* PixelType */
+#define GL_BITMAP                         0x1A00
+/*      GL_BYTE */
+/*      GL_UNSIGNED_BYTE */
+/*      GL_SHORT */
+/*      GL_UNSIGNED_SHORT */
+/*      GL_INT */
+/*      GL_UNSIGNED_INT */
+/*      GL_FLOAT */
+/*      GL_BGR */
+/*      GL_BGRA */
+/*      GL_UNSIGNED_BYTE_3_3_2 */
+/*      GL_UNSIGNED_SHORT_4_4_4_4 */
+/*      GL_UNSIGNED_SHORT_5_5_5_1 */
+/*      GL_UNSIGNED_INT_8_8_8_8 */
+/*      GL_UNSIGNED_INT_10_10_10_2 */
+/*      GL_UNSIGNED_SHORT_5_6_5 */
+/*      GL_UNSIGNED_BYTE_2_3_3_REV */
+/*      GL_UNSIGNED_SHORT_5_6_5_REV */
+/*      GL_UNSIGNED_SHORT_4_4_4_4_REV */
+/*      GL_UNSIGNED_SHORT_1_5_5_5_REV */
+/*      GL_UNSIGNED_INT_8_8_8_8_REV */
+/*      GL_UNSIGNED_INT_2_10_10_10_REV */
+
+/* PolygonMode */
+#define GL_POINT                          0x1B00
+#define GL_LINE                           0x1B01
+#define GL_FILL                           0x1B02
+
+/* ReadBufferMode */
+/*      GL_FRONT_LEFT */
+/*      GL_FRONT_RIGHT */
+/*      GL_BACK_LEFT */
+/*      GL_BACK_RIGHT */
+/*      GL_FRONT */
+/*      GL_BACK */
+/*      GL_LEFT */
+/*      GL_RIGHT */
+/*      GL_AUX0 */
+/*      GL_AUX1 */
+/*      GL_AUX2 */
+/*      GL_AUX3 */
+
+/* RenderingMode */
+#define GL_RENDER                         0x1C00
+#define GL_FEEDBACK                       0x1C01
+#define GL_SELECT                         0x1C02
+
+/* SeparableTarget */
+/*      GL_SEPARABLE_2D */
+
+/* ShadingModel */
+#define GL_FLAT                           0x1D00
+#define GL_SMOOTH                         0x1D01
+
+/* StencilFunction */
+/*      GL_NEVER */
+/*      GL_LESS */
+/*      GL_EQUAL */
+/*      GL_LEQUAL */
+/*      GL_GREATER */
+/*      GL_NOTEQUAL */
+/*      GL_GEQUAL */
+/*      GL_ALWAYS */
+
+/* StencilOp */
+/*      GL_ZERO */
+#define GL_KEEP                           0x1E00
+#define GL_REPLACE                        0x1E01
+#define GL_INCR                           0x1E02
+#define GL_DECR                           0x1E03
+/*      GL_INVERT */
+
+/* StringName */
+#define GL_VENDOR                         0x1F00
+#define GL_RENDERER                       0x1F01
+#define GL_VERSION                        0x1F02
+#define GL_EXTENSIONS                     0x1F03
+
+/* TextureCoordName */
+#define GL_S                              0x2000
+#define GL_T                              0x2001
+#define GL_R                              0x2002
+#define GL_Q                              0x2003
+
+/* TexCoordPointerType */
+/*      GL_SHORT */
+/*      GL_INT */
+/*      GL_FLOAT */
+/*      GL_DOUBLE */
+
+/* TextureEnvMode */
+#define GL_MODULATE                       0x2100
+#define GL_DECAL                          0x2101
+/*      GL_BLEND */
+/*      GL_REPLACE */
+
+/* TextureEnvParameter */
+#define GL_TEXTURE_ENV_MODE               0x2200
+#define GL_TEXTURE_ENV_COLOR              0x2201
+
+/* TextureEnvTarget */
+#define GL_TEXTURE_ENV                    0x2300
+
+/* TextureGenMode */
+#define GL_EYE_LINEAR                     0x2400
+#define GL_OBJECT_LINEAR                  0x2401
+#define GL_SPHERE_MAP                     0x2402
+
+/* TextureGenParameter */
+#define GL_TEXTURE_GEN_MODE               0x2500
+#define GL_OBJECT_PLANE                   0x2501
+#define GL_EYE_PLANE                      0x2502
+
+/* TextureMagFilter */
+#define GL_NEAREST                        0x2600
+#define GL_LINEAR                         0x2601
+
+/* TextureMinFilter */
+/*      GL_NEAREST */
+/*      GL_LINEAR */
+#define GL_NEAREST_MIPMAP_NEAREST         0x2700
+#define GL_LINEAR_MIPMAP_NEAREST          0x2701
+#define GL_NEAREST_MIPMAP_LINEAR          0x2702
+#define GL_LINEAR_MIPMAP_LINEAR           0x2703
+
+/* TextureParameterName */
+#define GL_TEXTURE_MAG_FILTER             0x2800
+#define GL_TEXTURE_MIN_FILTER             0x2801
+#define GL_TEXTURE_WRAP_S                 0x2802
+#define GL_TEXTURE_WRAP_T                 0x2803
+/*      GL_TEXTURE_BORDER_COLOR */
+/*      GL_TEXTURE_PRIORITY */
+/*      GL_TEXTURE_WRAP_R */
+/*      GL_TEXTURE_MIN_LOD */
+/*      GL_TEXTURE_MAX_LOD */
+/*      GL_TEXTURE_BASE_LEVEL */
+/*      GL_TEXTURE_MAX_LEVEL */
+
+/* TextureTarget */
+/*      GL_TEXTURE_1D */
+/*      GL_TEXTURE_2D */
+/*      GL_PROXY_TEXTURE_1D */
+/*      GL_PROXY_TEXTURE_2D */
+/*      GL_TEXTURE_3D */
+/*      GL_PROXY_TEXTURE_3D */
+
+/* TextureUnit */
+/*      GL_TEXTURE0_ARB */
+/*      GL_TEXTURE1_ARB */
+/*      GL_TEXTURE2_ARB */
+/*      GL_TEXTURE3_ARB */
+/*      GL_TEXTURE4_ARB */
+/*      GL_TEXTURE5_ARB */
+/*      GL_TEXTURE6_ARB */
+/*      GL_TEXTURE7_ARB */
+/*      GL_TEXTURE8_ARB */
+/*      GL_TEXTURE9_ARB */
+/*      GL_TEXTURE10_ARB */
+/*      GL_TEXTURE11_ARB */
+/*      GL_TEXTURE12_ARB */
+/*      GL_TEXTURE13_ARB */
+/*      GL_TEXTURE14_ARB */
+/*      GL_TEXTURE15_ARB */
+/*      GL_TEXTURE16_ARB */
+/*      GL_TEXTURE17_ARB */
+/*      GL_TEXTURE18_ARB */
+/*      GL_TEXTURE19_ARB */
+/*      GL_TEXTURE20_ARB */
+/*      GL_TEXTURE21_ARB */
+/*      GL_TEXTURE22_ARB */
+/*      GL_TEXTURE23_ARB */
+/*      GL_TEXTURE24_ARB */
+/*      GL_TEXTURE25_ARB */
+/*      GL_TEXTURE26_ARB */
+/*      GL_TEXTURE27_ARB */
+/*      GL_TEXTURE28_ARB */
+/*      GL_TEXTURE29_ARB */
+/*      GL_TEXTURE30_ARB */
+/*      GL_TEXTURE31_ARB */
+
+/* TextureWrapMode */
+#define GL_CLAMP                          0x2900
+#define GL_REPEAT                         0x2901
+/*      GL_CLAMP_TO_EDGE */
+
+/* VertexPointerType */
+/*      GL_SHORT */
+/*      GL_INT */
+/*      GL_FLOAT */
+/*      GL_DOUBLE */
+
+/* ClientAttribMask */
+#define GL_CLIENT_PIXEL_STORE_BIT         0x00000001
+#define GL_CLIENT_VERTEX_ARRAY_BIT        0x00000002
+#define GL_CLIENT_ALL_ATTRIB_BITS         0xffffffff
+
+/* polygon_offset */
+#define GL_POLYGON_OFFSET_FACTOR          0x8038
+#define GL_POLYGON_OFFSET_UNITS           0x2A00
+#define GL_POLYGON_OFFSET_POINT           0x2A01
+#define GL_POLYGON_OFFSET_LINE            0x2A02
+#define GL_POLYGON_OFFSET_FILL            0x8037
+
+/* texture */
+#define GL_ALPHA4                         0x803B
+#define GL_ALPHA8                         0x803C
+#define GL_ALPHA12                        0x803D
+#define GL_ALPHA16                        0x803E
+#define GL_LUMINANCE4                     0x803F
+#define GL_LUMINANCE8                     0x8040
+#define GL_LUMINANCE12                    0x8041
+#define GL_LUMINANCE16                    0x8042
+#define GL_LUMINANCE4_ALPHA4              0x8043
+#define GL_LUMINANCE6_ALPHA2              0x8044
+#define GL_LUMINANCE8_ALPHA8              0x8045
+#define GL_LUMINANCE12_ALPHA4             0x8046
+#define GL_LUMINANCE12_ALPHA12            0x8047
+#define GL_LUMINANCE16_ALPHA16            0x8048
+#define GL_INTENSITY                      0x8049
+#define GL_INTENSITY4                     0x804A
+#define GL_INTENSITY8                     0x804B
+#define GL_INTENSITY12                    0x804C
+#define GL_INTENSITY16                    0x804D
+#define GL_R3_G3_B2                       0x2A10
+#define GL_RGB4                           0x804F
+#define GL_RGB5                           0x8050
+#define GL_RGB8                           0x8051
+#define GL_RGB10                          0x8052
+#define GL_RGB12                          0x8053
+#define GL_RGB16                          0x8054
+#define GL_RGBA2                          0x8055
+#define GL_RGBA4                          0x8056
+#define GL_RGB5_A1                        0x8057
+#define GL_RGBA8                          0x8058
+#define GL_RGB10_A2                       0x8059
+#define GL_RGBA12                         0x805A
+#define GL_RGBA16                         0x805B
+#define GL_TEXTURE_RED_SIZE               0x805C
+#define GL_TEXTURE_GREEN_SIZE             0x805D
+#define GL_TEXTURE_BLUE_SIZE              0x805E
+#define GL_TEXTURE_ALPHA_SIZE             0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE         0x8060
+#define GL_TEXTURE_INTENSITY_SIZE         0x8061
+#define GL_PROXY_TEXTURE_1D               0x8063
+#define GL_PROXY_TEXTURE_2D               0x8064
+
+/* texture_object */
+#define GL_TEXTURE_PRIORITY               0x8066
+#define GL_TEXTURE_RESIDENT               0x8067
+#define GL_TEXTURE_BINDING_1D             0x8068
+#define GL_TEXTURE_BINDING_2D             0x8069
+#define GL_TEXTURE_BINDING_3D             0x806A
+
+/* vertex_array */
+#define GL_VERTEX_ARRAY                   0x8074
+#define GL_NORMAL_ARRAY                   0x8075
+#define GL_COLOR_ARRAY                    0x8076
+#define GL_INDEX_ARRAY                    0x8077
+#define GL_TEXTURE_COORD_ARRAY            0x8078
+#define GL_EDGE_FLAG_ARRAY                0x8079
+#define GL_VERTEX_ARRAY_SIZE              0x807A
+#define GL_VERTEX_ARRAY_TYPE              0x807B
+#define GL_VERTEX_ARRAY_STRIDE            0x807C
+#define GL_NORMAL_ARRAY_TYPE              0x807E
+#define GL_NORMAL_ARRAY_STRIDE            0x807F
+#define GL_COLOR_ARRAY_SIZE               0x8081
+#define GL_COLOR_ARRAY_TYPE               0x8082
+#define GL_COLOR_ARRAY_STRIDE             0x8083
+#define GL_INDEX_ARRAY_TYPE               0x8085
+#define GL_INDEX_ARRAY_STRIDE             0x8086
+#define GL_TEXTURE_COORD_ARRAY_SIZE       0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE       0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE     0x808A
+#define GL_EDGE_FLAG_ARRAY_STRIDE         0x808C
+#define GL_VERTEX_ARRAY_POINTER           0x808E
+#define GL_NORMAL_ARRAY_POINTER           0x808F
+#define GL_COLOR_ARRAY_POINTER            0x8090
+#define GL_INDEX_ARRAY_POINTER            0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER    0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER        0x8093
+#define GL_V2F                            0x2A20
+#define GL_V3F                            0x2A21
+#define GL_C4UB_V2F                       0x2A22
+#define GL_C4UB_V3F                       0x2A23
+#define GL_C3F_V3F                        0x2A24
+#define GL_N3F_V3F                        0x2A25
+#define GL_C4F_N3F_V3F                    0x2A26
+#define GL_T2F_V3F                        0x2A27
+#define GL_T4F_V4F                        0x2A28
+#define GL_T2F_C4UB_V3F                   0x2A29
+#define GL_T2F_C3F_V3F                    0x2A2A
+#define GL_T2F_N3F_V3F                    0x2A2B
+#define GL_T2F_C4F_N3F_V3F                0x2A2C
+#define GL_T4F_C4F_N3F_V4F                0x2A2D
+
+/* bgra */
+#define GL_BGR                            0x80E0
+#define GL_BGRA                           0x80E1
+
+/* blend_color */
+#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
+
+/* blend_minmax */
+#define GL_FUNC_ADD                       0x8006
+#define GL_MIN                            0x8007
+#define GL_MAX                            0x8008
+#define GL_BLEND_EQUATION                 0x8009
+
+/* blend_subtract */
+#define GL_FUNC_SUBTRACT                  0x800A
+#define GL_FUNC_REVERSE_SUBTRACT          0x800B
+
+/* color_matrix */
+#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
+
+/* color_table */
+#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
+
+/* convolution */
+#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_CONSTANT_BORDER                0x8151
+#define GL_REPLICATE_BORDER               0x8153
+#define GL_CONVOLUTION_BORDER_COLOR       0x8154
+
+/* draw_range_elements */
+#define GL_MAX_ELEMENTS_VERTICES          0x80E8
+#define GL_MAX_ELEMENTS_INDICES           0x80E9
+
+/* histogram */
+#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
+
+/* packed_pixels */
+#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_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
+
+/* rescale_normal */
+#define GL_RESCALE_NORMAL                 0x803A
+
+/* separate_specular_color */
+#define GL_LIGHT_MODEL_COLOR_CONTROL      0x81F8
+#define GL_SINGLE_COLOR                   0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR        0x81FA
+
+/* texture3D */
+#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
+
+/* texture_edge_clamp */
+#define GL_CLAMP_TO_EDGE                  0x812F
+
+/* texture_lod */
+#define GL_TEXTURE_MIN_LOD                0x813A
+#define GL_TEXTURE_MAX_LOD                0x813B
+#define GL_TEXTURE_BASE_LEVEL             0x813C
+#define GL_TEXTURE_MAX_LEVEL              0x813D
+
+/* GetTarget1_2 */
+#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
+
+/* 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
+
+/* Extensions */
+#define GL_EXT_abgr                       1
+#define GL_EXT_blend_color                1
+#define GL_EXT_blend_minmax               1
+#define GL_EXT_blend_subtract             1
+#define GL_EXT_texture_env_combine        1
+#define GL_EXT_texture_env_add            1
+
+/* EXT_abgr */
+#define GL_ABGR_EXT                       0x8000
+
+/* 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
+
+/* 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
+
+/* EXT_blend_subtract */
+#define GL_FUNC_SUBTRACT_EXT              0x800A
+#define GL_FUNC_REVERSE_SUBTRACT_EXT      0x800B
+
+/* 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
+
+/* For compatibility with OpenGL v1.0 */
+#define GL_LOGIC_OP GL_INDEX_LOGIC_OP
+#define GL_TEXTURE_COMPONENTS GL_TEXTURE_INTERNAL_FORMAT
+
+/*************************************************************/
+
+WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value);
+WINGDIAPI void APIENTRY glAlphaFunc (GLenum func, GLclampf ref);
+WINGDIAPI GLboolean APIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences);
+WINGDIAPI void APIENTRY glArrayElement (GLint i);
+WINGDIAPI void APIENTRY glBegin (GLenum mode);
+WINGDIAPI void APIENTRY glBindTexture (GLenum target, GLuint texture);
+WINGDIAPI void APIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
+WINGDIAPI void APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
+WINGDIAPI void APIENTRY glCallList (GLuint list);
+WINGDIAPI void APIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists);
+WINGDIAPI void APIENTRY glClear (GLbitfield mask);
+WINGDIAPI void APIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+WINGDIAPI void APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+WINGDIAPI void APIENTRY glClearDepth (GLclampd depth);
+WINGDIAPI void APIENTRY glClearIndex (GLfloat c);
+WINGDIAPI void APIENTRY glClearStencil (GLint s);
+WINGDIAPI void APIENTRY glClipPlane (GLenum plane, const GLdouble *equation);
+WINGDIAPI void APIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue);
+WINGDIAPI void APIENTRY glColor3bv (const GLbyte *v);
+WINGDIAPI void APIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue);
+WINGDIAPI void APIENTRY glColor3dv (const GLdouble *v);
+WINGDIAPI void APIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue);
+WINGDIAPI void APIENTRY glColor3fv (const GLfloat *v);
+WINGDIAPI void APIENTRY glColor3i (GLint red, GLint green, GLint blue);
+WINGDIAPI void APIENTRY glColor3iv (const GLint *v);
+WINGDIAPI void APIENTRY glColor3s (GLshort red, GLshort green, GLshort blue);
+WINGDIAPI void APIENTRY glColor3sv (const GLshort *v);
+WINGDIAPI void APIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue);
+WINGDIAPI void APIENTRY glColor3ubv (const GLubyte *v);
+WINGDIAPI void APIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue);
+WINGDIAPI void APIENTRY glColor3uiv (const GLuint *v);
+WINGDIAPI void APIENTRY glColor3us (GLushort red, GLushort green, GLushort blue);
+WINGDIAPI void APIENTRY glColor3usv (const GLushort *v);
+WINGDIAPI void APIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
+WINGDIAPI void APIENTRY glColor4bv (const GLbyte *v);
+WINGDIAPI void APIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
+WINGDIAPI void APIENTRY glColor4dv (const GLdouble *v);
+WINGDIAPI void APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+WINGDIAPI void APIENTRY glColor4fv (const GLfloat *v);
+WINGDIAPI void APIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha);
+WINGDIAPI void APIENTRY glColor4iv (const GLint *v);
+WINGDIAPI void APIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha);
+WINGDIAPI void APIENTRY glColor4sv (const GLshort *v);
+WINGDIAPI void APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+WINGDIAPI void APIENTRY glColor4ubv (const GLubyte *v);
+WINGDIAPI void APIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha);
+WINGDIAPI void APIENTRY glColor4uiv (const GLuint *v);
+WINGDIAPI void APIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha);
+WINGDIAPI void APIENTRY glColor4usv (const GLushort *v);
+WINGDIAPI void APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+WINGDIAPI void APIENTRY glColorMaterial (GLenum face, GLenum mode);
+WINGDIAPI void APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+WINGDIAPI void APIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
+WINGDIAPI void APIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+WINGDIAPI void APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+WINGDIAPI void APIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+WINGDIAPI void APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+WINGDIAPI void APIENTRY glCullFace (GLenum mode);
+WINGDIAPI void APIENTRY glDeleteLists (GLuint list, GLsizei range);
+WINGDIAPI void APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
+WINGDIAPI void APIENTRY glDepthFunc (GLenum func);
+WINGDIAPI void APIENTRY glDepthMask (GLboolean flag);
+WINGDIAPI void APIENTRY glDepthRange (GLclampd zNear, GLclampd zFar);
+WINGDIAPI void APIENTRY glDisable (GLenum cap);
+WINGDIAPI void APIENTRY glDisableClientState (GLenum array);
+WINGDIAPI void APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
+WINGDIAPI void APIENTRY glDrawBuffer (GLenum mode);
+WINGDIAPI void APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
+WINGDIAPI void APIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+WINGDIAPI void APIENTRY glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices );
+WINGDIAPI void APIENTRY glEdgeFlag (GLboolean flag);
+WINGDIAPI void APIENTRY glEdgeFlagPointer (GLsizei stride, const GLboolean *pointer);
+WINGDIAPI void APIENTRY glEdgeFlagv (const GLboolean *flag);
+WINGDIAPI void APIENTRY glEnable (GLenum cap);
+WINGDIAPI void APIENTRY glEnableClientState (GLenum array);
+WINGDIAPI void APIENTRY glEnd (void);
+WINGDIAPI void APIENTRY glEndList (void);
+WINGDIAPI void APIENTRY glEvalCoord1d (GLdouble u);
+WINGDIAPI void APIENTRY glEvalCoord1dv (const GLdouble *u);
+WINGDIAPI void APIENTRY glEvalCoord1f (GLfloat u);
+WINGDIAPI void APIENTRY glEvalCoord1fv (const GLfloat *u);
+WINGDIAPI void APIENTRY glEvalCoord2d (GLdouble u, GLdouble v);
+WINGDIAPI void APIENTRY glEvalCoord2dv (const GLdouble *u);
+WINGDIAPI void APIENTRY glEvalCoord2f (GLfloat u, GLfloat v);
+WINGDIAPI void APIENTRY glEvalCoord2fv (const GLfloat *u);
+WINGDIAPI void APIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2);
+WINGDIAPI void APIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
+WINGDIAPI void APIENTRY glEvalPoint1 (GLint i);
+WINGDIAPI void APIENTRY glEvalPoint2 (GLint i, GLint j);
+WINGDIAPI void APIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer);
+WINGDIAPI void APIENTRY glFinish (void);
+WINGDIAPI void APIENTRY glFlush (void);
+WINGDIAPI void APIENTRY glFogf (GLenum pname, GLfloat param);
+WINGDIAPI void APIENTRY glFogfv (GLenum pname, const GLfloat *params);
+WINGDIAPI void APIENTRY glFogi (GLenum pname, GLint param);
+WINGDIAPI void APIENTRY glFogiv (GLenum pname, const GLint *params);
+WINGDIAPI void APIENTRY glFrontFace (GLenum mode);
+WINGDIAPI void APIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+WINGDIAPI GLuint APIENTRY glGenLists (GLsizei range);
+WINGDIAPI void APIENTRY glGenTextures (GLsizei n, GLuint *textures);
+WINGDIAPI void APIENTRY glGetBooleanv (GLenum pname, GLboolean *params);
+WINGDIAPI void APIENTRY glGetClipPlane (GLenum plane, GLdouble *equation);
+WINGDIAPI void APIENTRY glGetDoublev (GLenum pname, GLdouble *params);
+WINGDIAPI GLenum APIENTRY glGetError (void);
+WINGDIAPI void APIENTRY glGetFloatv (GLenum pname, GLfloat *params);
+WINGDIAPI void APIENTRY glGetIntegerv (GLenum pname, GLint *params);
+WINGDIAPI void APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
+WINGDIAPI void APIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params);
+WINGDIAPI void APIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v);
+WINGDIAPI void APIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v);
+WINGDIAPI void APIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v);
+WINGDIAPI void APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);
+WINGDIAPI void APIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params);
+WINGDIAPI void APIENTRY glGetPixelMapfv (GLenum map, GLfloat *values);
+WINGDIAPI void APIENTRY glGetPixelMapuiv (GLenum map, GLuint *values);
+WINGDIAPI void APIENTRY glGetPixelMapusv (GLenum map, GLushort *values);
+WINGDIAPI void APIENTRY glGetPointerv (GLenum pname, GLvoid* *params);
+WINGDIAPI void APIENTRY glGetPolygonStipple (GLubyte *mask);
+WINGDIAPI const GLubyte * APIENTRY glGetString (GLenum name);
+WINGDIAPI void APIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params);
+WINGDIAPI void APIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params);
+WINGDIAPI void APIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params);
+WINGDIAPI void APIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params);
+WINGDIAPI void APIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params);
+WINGDIAPI void APIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
+WINGDIAPI void APIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params);
+WINGDIAPI void APIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params);
+WINGDIAPI void APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
+WINGDIAPI void APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
+WINGDIAPI void APIENTRY glHint (GLenum target, GLenum mode);
+WINGDIAPI void APIENTRY glIndexMask (GLuint mask);
+WINGDIAPI void APIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
+WINGDIAPI void APIENTRY glIndexd (GLdouble c);
+WINGDIAPI void APIENTRY glIndexdv (const GLdouble *c);
+WINGDIAPI void APIENTRY glIndexf (GLfloat c);
+WINGDIAPI void APIENTRY glIndexfv (const GLfloat *c);
+WINGDIAPI void APIENTRY glIndexi (GLint c);
+WINGDIAPI void APIENTRY glIndexiv (const GLint *c);
+WINGDIAPI void APIENTRY glIndexs (GLshort c);
+WINGDIAPI void APIENTRY glIndexsv (const GLshort *c);
+WINGDIAPI void APIENTRY glIndexub (GLubyte c);
+WINGDIAPI void APIENTRY glIndexubv (const GLubyte *c);
+WINGDIAPI void APIENTRY glInitNames (void);
+WINGDIAPI void APIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer);
+WINGDIAPI GLboolean APIENTRY glIsEnabled (GLenum cap);
+WINGDIAPI GLboolean APIENTRY glIsList (GLuint list);
+WINGDIAPI GLboolean APIENTRY glIsTexture (GLuint texture);
+WINGDIAPI void APIENTRY glLightModelf (GLenum pname, GLfloat param);
+WINGDIAPI void APIENTRY glLightModelfv (GLenum pname, const GLfloat *params);
+WINGDIAPI void APIENTRY glLightModeli (GLenum pname, GLint param);
+WINGDIAPI void APIENTRY glLightModeliv (GLenum pname, const GLint *params);
+WINGDIAPI void APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param);
+WINGDIAPI void APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params);
+WINGDIAPI void APIENTRY glLighti (GLenum light, GLenum pname, GLint param);
+WINGDIAPI void APIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params);
+WINGDIAPI void APIENTRY glLineStipple (GLint factor, GLushort pattern);
+WINGDIAPI void APIENTRY glLineWidth (GLfloat width);
+WINGDIAPI void APIENTRY glListBase (GLuint base);
+WINGDIAPI void APIENTRY glLoadIdentity (void);
+WINGDIAPI void APIENTRY glLoadMatrixd (const GLdouble *m);
+WINGDIAPI void APIENTRY glLoadMatrixf (const GLfloat *m);
+WINGDIAPI void APIENTRY glLoadName (GLuint name);
+WINGDIAPI void APIENTRY glLogicOp (GLenum opcode);
+WINGDIAPI void APIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
+WINGDIAPI void APIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
+WINGDIAPI void APIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
+WINGDIAPI void APIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
+WINGDIAPI void APIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2);
+WINGDIAPI void APIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2);
+WINGDIAPI void APIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
+WINGDIAPI void APIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
+WINGDIAPI void APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param);
+WINGDIAPI void APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
+WINGDIAPI void APIENTRY glMateriali (GLenum face, GLenum pname, GLint param);
+WINGDIAPI void APIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params);
+WINGDIAPI void APIENTRY glMatrixMode (GLenum mode);
+WINGDIAPI void APIENTRY glMultMatrixd (const GLdouble *m);
+WINGDIAPI void APIENTRY glMultMatrixf (const GLfloat *m);
+WINGDIAPI void APIENTRY glNewList (GLuint list, GLenum mode);
+WINGDIAPI void APIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz);
+WINGDIAPI void APIENTRY glNormal3bv (const GLbyte *v);
+WINGDIAPI void APIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz);
+WINGDIAPI void APIENTRY glNormal3dv (const GLdouble *v);
+WINGDIAPI void APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
+WINGDIAPI void APIENTRY glNormal3fv (const GLfloat *v);
+WINGDIAPI void APIENTRY glNormal3i (GLint nx, GLint ny, GLint nz);
+WINGDIAPI void APIENTRY glNormal3iv (const GLint *v);
+WINGDIAPI void APIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz);
+WINGDIAPI void APIENTRY glNormal3sv (const GLshort *v);
+WINGDIAPI void APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
+WINGDIAPI void APIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+WINGDIAPI void APIENTRY glPassThrough (GLfloat token);
+WINGDIAPI void APIENTRY glPixelMapfv (GLenum map, GLint mapsize, const GLfloat *values);
+WINGDIAPI void APIENTRY glPixelMapuiv (GLenum map, GLint mapsize, const GLuint *values);
+WINGDIAPI void APIENTRY glPixelMapusv (GLenum map, GLint mapsize, const GLushort *values);
+WINGDIAPI void APIENTRY glPixelStoref (GLenum pname, GLfloat param);
+WINGDIAPI void APIENTRY glPixelStorei (GLenum pname, GLint param);
+WINGDIAPI void APIENTRY glPixelTransferf (GLenum pname, GLfloat param);
+WINGDIAPI void APIENTRY glPixelTransferi (GLenum pname, GLint param);
+WINGDIAPI void APIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor);
+WINGDIAPI void APIENTRY glPointSize (GLfloat size);
+WINGDIAPI void APIENTRY glPolygonMode (GLenum face, GLenum mode);
+WINGDIAPI void APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
+WINGDIAPI void APIENTRY glPolygonStipple (const GLubyte *mask);
+WINGDIAPI void APIENTRY glPopAttrib (void);
+WINGDIAPI void APIENTRY glPopClientAttrib (void);
+WINGDIAPI void APIENTRY glPopMatrix (void);
+WINGDIAPI void APIENTRY glPopName (void);
+WINGDIAPI void APIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities);
+WINGDIAPI void APIENTRY glPushAttrib (GLbitfield mask);
+WINGDIAPI void APIENTRY glPushClientAttrib (GLbitfield mask);
+WINGDIAPI void APIENTRY glPushMatrix (void);
+WINGDIAPI void APIENTRY glPushName (GLuint name);
+WINGDIAPI void APIENTRY glRasterPos2d (GLdouble x, GLdouble y);
+WINGDIAPI void APIENTRY glRasterPos2dv (const GLdouble *v);
+WINGDIAPI void APIENTRY glRasterPos2f (GLfloat x, GLfloat y);
+WINGDIAPI void APIENTRY glRasterPos2fv (const GLfloat *v);
+WINGDIAPI void APIENTRY glRasterPos2i (GLint x, GLint y);
+WINGDIAPI void APIENTRY glRasterPos2iv (const GLint *v);
+WINGDIAPI void APIENTRY glRasterPos2s (GLshort x, GLshort y);
+WINGDIAPI void APIENTRY glRasterPos2sv (const GLshort *v);
+WINGDIAPI void APIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z);
+WINGDIAPI void APIENTRY glRasterPos3dv (const GLdouble *v);
+WINGDIAPI void APIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z);
+WINGDIAPI void APIENTRY glRasterPos3fv (const GLfloat *v);
+WINGDIAPI void APIENTRY glRasterPos3i (GLint x, GLint y, GLint z);
+WINGDIAPI void APIENTRY glRasterPos3iv (const GLint *v);
+WINGDIAPI void APIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z);
+WINGDIAPI void APIENTRY glRasterPos3sv (const GLshort *v);
+WINGDIAPI void APIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+WINGDIAPI void APIENTRY glRasterPos4dv (const GLdouble *v);
+WINGDIAPI void APIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+WINGDIAPI void APIENTRY glRasterPos4fv (const GLfloat *v);
+WINGDIAPI void APIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w);
+WINGDIAPI void APIENTRY glRasterPos4iv (const GLint *v);
+WINGDIAPI void APIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w);
+WINGDIAPI void APIENTRY glRasterPos4sv (const GLshort *v);
+WINGDIAPI void APIENTRY glReadBuffer (GLenum mode);
+WINGDIAPI void APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
+WINGDIAPI void APIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
+WINGDIAPI void APIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2);
+WINGDIAPI void APIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
+WINGDIAPI void APIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2);
+WINGDIAPI void APIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2);
+WINGDIAPI void APIENTRY glRectiv (const GLint *v1, const GLint *v2);
+WINGDIAPI void APIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2);
+WINGDIAPI void APIENTRY glRectsv (const GLshort *v1, const GLshort *v2);
+WINGDIAPI GLint APIENTRY glRenderMode (GLenum mode);
+WINGDIAPI void APIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+WINGDIAPI void APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+WINGDIAPI void APIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z);
+WINGDIAPI void APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z);
+WINGDIAPI void APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+WINGDIAPI void APIENTRY glSelectBuffer (GLsizei size, GLuint *buffer);
+WINGDIAPI void APIENTRY glShadeModel (GLenum mode);
+WINGDIAPI void APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
+WINGDIAPI void APIENTRY glStencilMask (GLuint mask);
+WINGDIAPI void APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+WINGDIAPI void APIENTRY glTexCoord1d (GLdouble s);
+WINGDIAPI void APIENTRY glTexCoord1dv (const GLdouble *v);
+WINGDIAPI void APIENTRY glTexCoord1f (GLfloat s);
+WINGDIAPI void APIENTRY glTexCoord1fv (const GLfloat *v);
+WINGDIAPI void APIENTRY glTexCoord1i (GLint s);
+WINGDIAPI void APIENTRY glTexCoord1iv (const GLint *v);
+WINGDIAPI void APIENTRY glTexCoord1s (GLshort s);
+WINGDIAPI void APIENTRY glTexCoord1sv (const GLshort *v);
+WINGDIAPI void APIENTRY glTexCoord2d (GLdouble s, GLdouble t);
+WINGDIAPI void APIENTRY glTexCoord2dv (const GLdouble *v);
+WINGDIAPI void APIENTRY glTexCoord2f (GLfloat s, GLfloat t);
+WINGDIAPI void APIENTRY glTexCoord2fv (const GLfloat *v);
+WINGDIAPI void APIENTRY glTexCoord2i (GLint s, GLint t);
+WINGDIAPI void APIENTRY glTexCoord2iv (const GLint *v);
+WINGDIAPI void APIENTRY glTexCoord2s (GLshort s, GLshort t);
+WINGDIAPI void APIENTRY glTexCoord2sv (const GLshort *v);
+WINGDIAPI void APIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r);
+WINGDIAPI void APIENTRY glTexCoord3dv (const GLdouble *v);
+WINGDIAPI void APIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r);
+WINGDIAPI void APIENTRY glTexCoord3fv (const GLfloat *v);
+WINGDIAPI void APIENTRY glTexCoord3i (GLint s, GLint t, GLint r);
+WINGDIAPI void APIENTRY glTexCoord3iv (const GLint *v);
+WINGDIAPI void APIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r);
+WINGDIAPI void APIENTRY glTexCoord3sv (const GLshort *v);
+WINGDIAPI void APIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+WINGDIAPI void APIENTRY glTexCoord4dv (const GLdouble *v);
+WINGDIAPI void APIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+WINGDIAPI void APIENTRY glTexCoord4fv (const GLfloat *v);
+WINGDIAPI void APIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q);
+WINGDIAPI void APIENTRY glTexCoord4iv (const GLint *v);
+WINGDIAPI void APIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q);
+WINGDIAPI void APIENTRY glTexCoord4sv (const GLshort *v);
+WINGDIAPI void APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+WINGDIAPI void APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param);
+WINGDIAPI void APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
+WINGDIAPI void APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param);
+WINGDIAPI void APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params);
+WINGDIAPI void APIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param);
+WINGDIAPI void APIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params);
+WINGDIAPI void APIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param);
+WINGDIAPI void APIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params);
+WINGDIAPI void APIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param);
+WINGDIAPI void APIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params);
+WINGDIAPI void APIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+WINGDIAPI void APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+WINGDIAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+WINGDIAPI void APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+WINGDIAPI void APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+WINGDIAPI void APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
+WINGDIAPI void APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
+WINGDIAPI void APIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+WINGDIAPI void APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+WINGDIAPI void APIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z);
+WINGDIAPI void APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z);
+WINGDIAPI void APIENTRY glVertex2d (GLdouble x, GLdouble y);
+WINGDIAPI void APIENTRY glVertex2dv (const GLdouble *v);
+WINGDIAPI void APIENTRY glVertex2f (GLfloat x, GLfloat y);
+WINGDIAPI void APIENTRY glVertex2fv (const GLfloat *v);
+WINGDIAPI void APIENTRY glVertex2i (GLint x, GLint y);
+WINGDIAPI void APIENTRY glVertex2iv (const GLint *v);
+WINGDIAPI void APIENTRY glVertex2s (GLshort x, GLshort y);
+WINGDIAPI void APIENTRY glVertex2sv (const GLshort *v);
+WINGDIAPI void APIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z);
+WINGDIAPI void APIENTRY glVertex3dv (const GLdouble *v);
+WINGDIAPI void APIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z);
+WINGDIAPI void APIENTRY glVertex3fv (const GLfloat *v);
+WINGDIAPI void APIENTRY glVertex3i (GLint x, GLint y, GLint z);
+WINGDIAPI void APIENTRY glVertex3iv (const GLint *v);
+WINGDIAPI void APIENTRY glVertex3s (GLshort x, GLshort y, GLshort z);
+WINGDIAPI void APIENTRY glVertex3sv (const GLshort *v);
+WINGDIAPI void APIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+WINGDIAPI void APIENTRY glVertex4dv (const GLdouble *v);
+WINGDIAPI void APIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+WINGDIAPI void APIENTRY glVertex4fv (const GLfloat *v);
+WINGDIAPI void APIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w);
+WINGDIAPI void APIENTRY glVertex4iv (const GLint *v);
+WINGDIAPI void APIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w);
+WINGDIAPI void APIENTRY glVertex4sv (const GLshort *v);
+WINGDIAPI void APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+WINGDIAPI void APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gl_h_ */
Index: /RenderSystems/GL/include/GL/glew.h
===================================================================
--- /RenderSystems/GL/include/GL/glew.h	(revision 5)
+++ /RenderSystems/GL/include/GL/glew.h	(revision 5)
@@ -0,0 +1,4529 @@
+/*
+** The OpenGL Extension Wrangler Library
+** Copyright (C) 2002-2005, Milan Ikits <milan ikits[]ieee org>
+** Copyright (C) 2002-2005, Marcelo E. Magallon <mmagallo[]debian org>
+** Copyright (C) 2002, Lev Povalahev
+** All rights reserved.
+** 
+** Redistribution and use in source and binary forms, with or without 
+** modification, are permitted provided that the following conditions are met:
+** 
+** * Redistributions of source code must retain the above copyright notice, 
+**   this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright notice, 
+**   this list of conditions and the following disclaimer in the documentation 
+**   and/or other materials provided with the distribution.
+** * The name of the author may be used to endorse or promote products 
+**   derived from this software without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
+** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+** THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*
+** 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-2000 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.
+*/
+
+#ifndef __glew_h__
+#define __glew_h__
+#define __GLEW_H__
+
+#if defined(__gl_h_) || defined(__GL_H__)
+#error gl.h included before glew.h
+#endif
+#if defined(__glext_h_) || defined(__GLEXT_H_)
+#error glext.h included before glew.h
+#endif
+#if defined(__gl_ATI_h_)
+#error glATI.h included before glew.h
+#endif
+
+#define __gl_h_
+#define __GL_H__
+#define __glext_h_
+#define __GLEXT_H_
+#define __gl_ATI_h_
+
+// Build statically
+#define GLEW_STATIC
+
+#if defined(_WIN32)
+
+/*
+ * GLEW does not include <windows.h> to avoid name space pollution.
+ * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t
+ * defined properly.
+ */
+/* <windef.h> */
+#ifndef APIENTRY
+#define GLEW_APIENTRY_DEFINED
+#  if defined(__CYGWIN__) || defined(__MINGW32__)
+#    define APIENTRY __stdcall
+#  elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__)
+#    define APIENTRY __stdcall
+#  else
+#    define APIENTRY
+#  endif
+#endif
+#ifndef GLAPI
+#  if defined(__CYGWIN__) || defined(__MINGW32__)
+#    define GLAPI extern
+#  endif
+#endif
+/* <winnt.h> */
+#ifndef CALLBACK
+#define GLEW_CALLBACK_DEFINED
+#  if defined(__CYGWIN__) || defined(__MINGW32__)
+#    define CALLBACK __attribute__ ((__stdcall__))
+#  elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
+#    define CALLBACK __stdcall
+#  else
+#    define CALLBACK
+#  endif
+#endif
+/* <wingdi.h> and <winnt.h> */
+#ifndef WINGDIAPI
+#define GLEW_WINGDIAPI_DEFINED
+#define WINGDIAPI __declspec(dllimport)
+#endif
+/* <ctype.h> */
+#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED)
+typedef unsigned short wchar_t;
+#  define _WCHAR_T_DEFINED
+#endif
+/* <stddef.h> */
+#if !defined(_W64)
+#  if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
+#    define _W64 __w64
+#  else
+#    define _W64
+#  endif
+#endif
+#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_)
+#  ifdef _WIN64
+typedef __int64 ptrdiff_t;
+#  else
+typedef _W64 int ptrdiff_t;
+#  endif
+#  define _PTRDIFF_T_DEFINED
+#  define _PTRDIFF_T_
+#endif
+
+#ifndef GLAPI
+#  if defined(__CYGWIN__) || defined(__MINGW32__)
+#    define GLAPI extern
+#  else
+#    define GLAPI WINGDIAPI
+#  endif
+#endif
+
+#ifndef GLAPIENTRY
+#define GLAPIENTRY APIENTRY
+#endif
+
+/*
+ * GLEW_STATIC needs to be set when using the static version.
+ * GLEW_BUILD is set when building the DLL version.
+ */
+#ifdef GLEW_STATIC
+#  define GLEWAPI extern
+#else
+#  ifdef GLEW_BUILD
+#    define GLEWAPI extern __declspec(dllexport)
+#  else
+#    define GLEWAPI extern __declspec(dllimport)
+#  endif
+#endif
+
+#else /* _UNIX */
+
+/*
+ * Needed for ptrdiff_t in turn needed by VBO.  This is defined by ISO
+ * C.  On my system, this amounts to _3 lines_ of included code, all of
+ * them pretty much harmless.  If you know of a way of detecting 32 vs
+ * 64 _targets_ at compile time you are free to replace this with
+ * something that's portable.  For now, _this_ is the portable solution.
+ * (mem, 2004-01-04)
+ */
+
+#include <stddef.h>
+
+#define GLEW_APIENTRY_DEFINED
+#define APIENTRY
+#define GLEWAPI extern
+
+/* <glu.h> */
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+#ifndef GLAPIENTRY
+#define GLAPIENTRY
+#endif
+
+#endif /* _WIN32 */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ----------------------------- GL_VERSION_1_1 ---------------------------- */
+
+#ifndef GL_VERSION_1_1
+#define GL_VERSION_1_1 1
+
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef signed char GLbyte;
+typedef short GLshort;
+typedef int GLint;
+typedef int GLsizei;
+typedef unsigned char GLubyte;
+typedef unsigned short GLushort;
+typedef unsigned int GLuint;
+typedef float GLfloat;
+typedef float GLclampf;
+typedef double GLdouble;
+typedef double GLclampd;
+typedef void GLvoid;
+
+#define GL_ACCUM 0x0100
+#define GL_LOAD 0x0101
+#define GL_RETURN 0x0102
+#define GL_MULT 0x0103
+#define GL_ADD 0x0104
+#define GL_NEVER 0x0200
+#define GL_LESS 0x0201
+#define GL_EQUAL 0x0202
+#define GL_LEQUAL 0x0203
+#define GL_GREATER 0x0204
+#define GL_NOTEQUAL 0x0205
+#define GL_GEQUAL 0x0206
+#define GL_ALWAYS 0x0207
+#define GL_CURRENT_BIT 0x00000001
+#define GL_POINT_BIT 0x00000002
+#define GL_LINE_BIT 0x00000004
+#define GL_POLYGON_BIT 0x00000008
+#define GL_POLYGON_STIPPLE_BIT 0x00000010
+#define GL_PIXEL_MODE_BIT 0x00000020
+#define GL_LIGHTING_BIT 0x00000040
+#define GL_FOG_BIT 0x00000080
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_ACCUM_BUFFER_BIT 0x00000200
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_VIEWPORT_BIT 0x00000800
+#define GL_TRANSFORM_BIT 0x00001000
+#define GL_ENABLE_BIT 0x00002000
+#define GL_COLOR_BUFFER_BIT 0x00004000
+#define GL_HINT_BIT 0x00008000
+#define GL_EVAL_BIT 0x00010000
+#define GL_LIST_BIT 0x00020000
+#define GL_TEXTURE_BIT 0x00040000
+#define GL_SCISSOR_BIT 0x00080000
+#define GL_ALL_ATTRIB_BITS 0x000fffff
+#define GL_POINTS 0x0000
+#define GL_LINES 0x0001
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_STRIP 0x0003
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRIANGLE_FAN 0x0006
+#define GL_QUADS 0x0007
+#define GL_QUAD_STRIP 0x0008
+#define GL_POLYGON 0x0009
+#define GL_ZERO 0
+#define GL_ONE 1
+#define GL_SRC_COLOR 0x0300
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_SRC_ALPHA 0x0302
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_DST_ALPHA 0x0304
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+#define GL_DST_COLOR 0x0306
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_SRC_ALPHA_SATURATE 0x0308
+#define GL_TRUE 1
+#define GL_FALSE 0
+#define GL_CLIP_PLANE0 0x3000
+#define GL_CLIP_PLANE1 0x3001
+#define GL_CLIP_PLANE2 0x3002
+#define GL_CLIP_PLANE3 0x3003
+#define GL_CLIP_PLANE4 0x3004
+#define GL_CLIP_PLANE5 0x3005
+#define GL_BYTE 0x1400
+#define GL_UNSIGNED_BYTE 0x1401
+#define GL_SHORT 0x1402
+#define GL_UNSIGNED_SHORT 0x1403
+#define GL_INT 0x1404
+#define GL_UNSIGNED_INT 0x1405
+#define GL_FLOAT 0x1406
+#define GL_2_BYTES 0x1407
+#define GL_3_BYTES 0x1408
+#define GL_4_BYTES 0x1409
+#define GL_DOUBLE 0x140A
+#define GL_NONE 0
+#define GL_FRONT_LEFT 0x0400
+#define GL_FRONT_RIGHT 0x0401
+#define GL_BACK_LEFT 0x0402
+#define GL_BACK_RIGHT 0x0403
+#define GL_FRONT 0x0404
+#define GL_BACK 0x0405
+#define GL_LEFT 0x0406
+#define GL_RIGHT 0x0407
+#define GL_FRONT_AND_BACK 0x0408
+#define GL_AUX0 0x0409
+#define GL_AUX1 0x040A
+#define GL_AUX2 0x040B
+#define GL_AUX3 0x040C
+#define GL_NO_ERROR 0
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVALID_OPERATION 0x0502
+#define GL_STACK_OVERFLOW 0x0503
+#define GL_STACK_UNDERFLOW 0x0504
+#define GL_OUT_OF_MEMORY 0x0505
+#define GL_2D 0x0600
+#define GL_3D 0x0601
+#define GL_3D_COLOR 0x0602
+#define GL_3D_COLOR_TEXTURE 0x0603
+#define GL_4D_COLOR_TEXTURE 0x0604
+#define GL_PASS_THROUGH_TOKEN 0x0700
+#define GL_POINT_TOKEN 0x0701
+#define GL_LINE_TOKEN 0x0702
+#define GL_POLYGON_TOKEN 0x0703
+#define GL_BITMAP_TOKEN 0x0704
+#define GL_DRAW_PIXEL_TOKEN 0x0705
+#define GL_COPY_PIXEL_TOKEN 0x0706
+#define GL_LINE_RESET_TOKEN 0x0707
+#define GL_EXP 0x0800
+#define GL_EXP2 0x0801
+#define GL_CW 0x0900
+#define GL_CCW 0x0901
+#define GL_COEFF 0x0A00
+#define GL_ORDER 0x0A01
+#define GL_DOMAIN 0x0A02
+#define GL_CURRENT_COLOR 0x0B00
+#define GL_CURRENT_INDEX 0x0B01
+#define GL_CURRENT_NORMAL 0x0B02
+#define GL_CURRENT_TEXTURE_COORDS 0x0B03
+#define GL_CURRENT_RASTER_COLOR 0x0B04
+#define GL_CURRENT_RASTER_INDEX 0x0B05
+#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
+#define GL_CURRENT_RASTER_POSITION 0x0B07
+#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
+#define GL_CURRENT_RASTER_DISTANCE 0x0B09
+#define GL_POINT_SMOOTH 0x0B10
+#define GL_POINT_SIZE 0x0B11
+#define GL_POINT_SIZE_RANGE 0x0B12
+#define GL_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_LINE_SMOOTH 0x0B20
+#define GL_LINE_WIDTH 0x0B21
+#define GL_LINE_WIDTH_RANGE 0x0B22
+#define GL_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_LINE_STIPPLE 0x0B24
+#define GL_LINE_STIPPLE_PATTERN 0x0B25
+#define GL_LINE_STIPPLE_REPEAT 0x0B26
+#define GL_LIST_MODE 0x0B30
+#define GL_MAX_LIST_NESTING 0x0B31
+#define GL_LIST_BASE 0x0B32
+#define GL_LIST_INDEX 0x0B33
+#define GL_POLYGON_MODE 0x0B40
+#define GL_POLYGON_SMOOTH 0x0B41
+#define GL_POLYGON_STIPPLE 0x0B42
+#define GL_EDGE_FLAG 0x0B43
+#define GL_CULL_FACE 0x0B44
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_FRONT_FACE 0x0B46
+#define GL_LIGHTING 0x0B50
+#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
+#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
+#define GL_LIGHT_MODEL_AMBIENT 0x0B53
+#define GL_SHADE_MODEL 0x0B54
+#define GL_COLOR_MATERIAL_FACE 0x0B55
+#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
+#define GL_COLOR_MATERIAL 0x0B57
+#define GL_FOG 0x0B60
+#define GL_FOG_INDEX 0x0B61
+#define GL_FOG_DENSITY 0x0B62
+#define GL_FOG_START 0x0B63
+#define GL_FOG_END 0x0B64
+#define GL_FOG_MODE 0x0B65
+#define GL_FOG_COLOR 0x0B66
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_TEST 0x0B71
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_ACCUM_CLEAR_VALUE 0x0B80
+#define GL_STENCIL_TEST 0x0B90
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_MATRIX_MODE 0x0BA0
+#define GL_NORMALIZE 0x0BA1
+#define GL_VIEWPORT 0x0BA2
+#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
+#define GL_PROJECTION_STACK_DEPTH 0x0BA4
+#define GL_TEXTURE_STACK_DEPTH 0x0BA5
+#define GL_MODELVIEW_MATRIX 0x0BA6
+#define GL_PROJECTION_MATRIX 0x0BA7
+#define GL_TEXTURE_MATRIX 0x0BA8
+#define GL_ATTRIB_STACK_DEPTH 0x0BB0
+#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
+#define GL_ALPHA_TEST 0x0BC0
+#define GL_ALPHA_TEST_FUNC 0x0BC1
+#define GL_ALPHA_TEST_REF 0x0BC2
+#define GL_DITHER 0x0BD0
+#define GL_BLEND_DST 0x0BE0
+#define GL_BLEND_SRC 0x0BE1
+#define GL_BLEND 0x0BE2
+#define GL_LOGIC_OP_MODE 0x0BF0
+#define GL_INDEX_LOGIC_OP 0x0BF1
+#define GL_COLOR_LOGIC_OP 0x0BF2
+#define GL_AUX_BUFFERS 0x0C00
+#define GL_DRAW_BUFFER 0x0C01
+#define GL_READ_BUFFER 0x0C02
+#define GL_SCISSOR_BOX 0x0C10
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_INDEX_CLEAR_VALUE 0x0C20
+#define GL_INDEX_WRITEMASK 0x0C21
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_INDEX_MODE 0x0C30
+#define GL_RGBA_MODE 0x0C31
+#define GL_DOUBLEBUFFER 0x0C32
+#define GL_STEREO 0x0C33
+#define GL_RENDER_MODE 0x0C40
+#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
+#define GL_POINT_SMOOTH_HINT 0x0C51
+#define GL_LINE_SMOOTH_HINT 0x0C52
+#define GL_POLYGON_SMOOTH_HINT 0x0C53
+#define GL_FOG_HINT 0x0C54
+#define GL_TEXTURE_GEN_S 0x0C60
+#define GL_TEXTURE_GEN_T 0x0C61
+#define GL_TEXTURE_GEN_R 0x0C62
+#define GL_TEXTURE_GEN_Q 0x0C63
+#define GL_PIXEL_MAP_I_TO_I 0x0C70
+#define GL_PIXEL_MAP_S_TO_S 0x0C71
+#define GL_PIXEL_MAP_I_TO_R 0x0C72
+#define GL_PIXEL_MAP_I_TO_G 0x0C73
+#define GL_PIXEL_MAP_I_TO_B 0x0C74
+#define GL_PIXEL_MAP_I_TO_A 0x0C75
+#define GL_PIXEL_MAP_R_TO_R 0x0C76
+#define GL_PIXEL_MAP_G_TO_G 0x0C77
+#define GL_PIXEL_MAP_B_TO_B 0x0C78
+#define GL_PIXEL_MAP_A_TO_A 0x0C79
+#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0
+#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1
+#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2
+#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3
+#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4
+#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5
+#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6
+#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7
+#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8
+#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9
+#define GL_UNPACK_SWAP_BYTES 0x0CF0
+#define GL_UNPACK_LSB_FIRST 0x0CF1
+#define GL_UNPACK_ROW_LENGTH 0x0CF2
+#define GL_UNPACK_SKIP_ROWS 0x0CF3
+#define GL_UNPACK_SKIP_PIXELS 0x0CF4
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_PACK_SWAP_BYTES 0x0D00
+#define GL_PACK_LSB_FIRST 0x0D01
+#define GL_PACK_ROW_LENGTH 0x0D02
+#define GL_PACK_SKIP_ROWS 0x0D03
+#define GL_PACK_SKIP_PIXELS 0x0D04
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_MAP_COLOR 0x0D10
+#define GL_MAP_STENCIL 0x0D11
+#define GL_INDEX_SHIFT 0x0D12
+#define GL_INDEX_OFFSET 0x0D13
+#define GL_RED_SCALE 0x0D14
+#define GL_RED_BIAS 0x0D15
+#define GL_ZOOM_X 0x0D16
+#define GL_ZOOM_Y 0x0D17
+#define GL_GREEN_SCALE 0x0D18
+#define GL_GREEN_BIAS 0x0D19
+#define GL_BLUE_SCALE 0x0D1A
+#define GL_BLUE_BIAS 0x0D1B
+#define GL_ALPHA_SCALE 0x0D1C
+#define GL_ALPHA_BIAS 0x0D1D
+#define GL_DEPTH_SCALE 0x0D1E
+#define GL_DEPTH_BIAS 0x0D1F
+#define GL_MAX_EVAL_ORDER 0x0D30
+#define GL_MAX_LIGHTS 0x0D31
+#define GL_MAX_CLIP_PLANES 0x0D32
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_PIXEL_MAP_TABLE 0x0D34
+#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
+#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
+#define GL_MAX_NAME_STACK_DEPTH 0x0D37
+#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
+#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_INDEX_BITS 0x0D51
+#define GL_RED_BITS 0x0D52
+#define GL_GREEN_BITS 0x0D53
+#define GL_BLUE_BITS 0x0D54
+#define GL_ALPHA_BITS 0x0D55
+#define GL_DEPTH_BITS 0x0D56
+#define GL_STENCIL_BITS 0x0D57
+#define GL_ACCUM_RED_BITS 0x0D58
+#define GL_ACCUM_GREEN_BITS 0x0D59
+#define GL_ACCUM_BLUE_BITS 0x0D5A
+#define GL_ACCUM_ALPHA_BITS 0x0D5B
+#define GL_NAME_STACK_DEPTH 0x0D70
+#define GL_AUTO_NORMAL 0x0D80
+#define GL_MAP1_COLOR_4 0x0D90
+#define GL_MAP1_INDEX 0x0D91
+#define GL_MAP1_NORMAL 0x0D92
+#define GL_MAP1_TEXTURE_COORD_1 0x0D93
+#define GL_MAP1_TEXTURE_COORD_2 0x0D94
+#define GL_MAP1_TEXTURE_COORD_3 0x0D95
+#define GL_MAP1_TEXTURE_COORD_4 0x0D96
+#define GL_MAP1_VERTEX_3 0x0D97
+#define GL_MAP1_VERTEX_4 0x0D98
+#define GL_MAP2_COLOR_4 0x0DB0
+#define GL_MAP2_INDEX 0x0DB1
+#define GL_MAP2_NORMAL 0x0DB2
+#define GL_MAP2_TEXTURE_COORD_1 0x0DB3
+#define GL_MAP2_TEXTURE_COORD_2 0x0DB4
+#define GL_MAP2_TEXTURE_COORD_3 0x0DB5
+#define GL_MAP2_TEXTURE_COORD_4 0x0DB6
+#define GL_MAP2_VERTEX_3 0x0DB7
+#define GL_MAP2_VERTEX_4 0x0DB8
+#define GL_MAP1_GRID_DOMAIN 0x0DD0
+#define GL_MAP1_GRID_SEGMENTS 0x0DD1
+#define GL_MAP2_GRID_DOMAIN 0x0DD2
+#define GL_MAP2_GRID_SEGMENTS 0x0DD3
+#define GL_TEXTURE_1D 0x0DE0
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
+#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
+#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
+#define GL_SELECTION_BUFFER_POINTER 0x0DF3
+#define GL_SELECTION_BUFFER_SIZE 0x0DF4
+#define GL_TEXTURE_WIDTH 0x1000
+#define GL_TEXTURE_HEIGHT 0x1001
+#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
+#define GL_TEXTURE_BORDER_COLOR 0x1004
+#define GL_TEXTURE_BORDER 0x1005
+#define GL_DONT_CARE 0x1100
+#define GL_FASTEST 0x1101
+#define GL_NICEST 0x1102
+#define GL_LIGHT0 0x4000
+#define GL_LIGHT1 0x4001
+#define GL_LIGHT2 0x4002
+#define GL_LIGHT3 0x4003
+#define GL_LIGHT4 0x4004
+#define GL_LIGHT5 0x4005
+#define GL_LIGHT6 0x4006
+#define GL_LIGHT7 0x4007
+#define GL_AMBIENT 0x1200
+#define GL_DIFFUSE 0x1201
+#define GL_SPECULAR 0x1202
+#define GL_POSITION 0x1203
+#define GL_SPOT_DIRECTION 0x1204
+#define GL_SPOT_EXPONENT 0x1205
+#define GL_SPOT_CUTOFF 0x1206
+#define GL_CONSTANT_ATTENUATION 0x1207
+#define GL_LINEAR_ATTENUATION 0x1208
+#define GL_QUADRATIC_ATTENUATION 0x1209
+#define GL_COMPILE 0x1300
+#define GL_COMPILE_AND_EXECUTE 0x1301
+#define GL_CLEAR 0x1500
+#define GL_AND 0x1501
+#define GL_AND_REVERSE 0x1502
+#define GL_COPY 0x1503
+#define GL_AND_INVERTED 0x1504
+#define GL_NOOP 0x1505
+#define GL_XOR 0x1506
+#define GL_OR 0x1507
+#define GL_NOR 0x1508
+#define GL_EQUIV 0x1509
+#define GL_INVERT 0x150A
+#define GL_OR_REVERSE 0x150B
+#define GL_COPY_INVERTED 0x150C
+#define GL_OR_INVERTED 0x150D
+#define GL_NAND 0x150E
+#define GL_SET 0x150F
+#define GL_EMISSION 0x1600
+#define GL_SHININESS 0x1601
+#define GL_AMBIENT_AND_DIFFUSE 0x1602
+#define GL_COLOR_INDEXES 0x1603
+#define GL_MODELVIEW 0x1700
+#define GL_PROJECTION 0x1701
+#define GL_TEXTURE 0x1702
+#define GL_COLOR 0x1800
+#define GL_DEPTH 0x1801
+#define GL_STENCIL 0x1802
+#define GL_COLOR_INDEX 0x1900
+#define GL_STENCIL_INDEX 0x1901
+#define GL_DEPTH_COMPONENT 0x1902
+#define GL_RED 0x1903
+#define GL_GREEN 0x1904
+#define GL_BLUE 0x1905
+#define GL_ALPHA 0x1906
+#define GL_RGB 0x1907
+#define GL_RGBA 0x1908
+#define GL_LUMINANCE 0x1909
+#define GL_LUMINANCE_ALPHA 0x190A
+#define GL_BITMAP 0x1A00
+#define GL_POINT 0x1B00
+#define GL_LINE 0x1B01
+#define GL_FILL 0x1B02
+#define GL_RENDER 0x1C00
+#define GL_FEEDBACK 0x1C01
+#define GL_SELECT 0x1C02
+#define GL_FLAT 0x1D00
+#define GL_SMOOTH 0x1D01
+#define GL_KEEP 0x1E00
+#define GL_REPLACE 0x1E01
+#define GL_INCR 0x1E02
+#define GL_DECR 0x1E03
+#define GL_VENDOR 0x1F00
+#define GL_RENDERER 0x1F01
+#define GL_VERSION 0x1F02
+#define GL_EXTENSIONS 0x1F03
+#define GL_S 0x2000
+#define GL_T 0x2001
+#define GL_R 0x2002
+#define GL_Q 0x2003
+#define GL_MODULATE 0x2100
+#define GL_DECAL 0x2101
+#define GL_TEXTURE_ENV_MODE 0x2200
+#define GL_TEXTURE_ENV_COLOR 0x2201
+#define GL_TEXTURE_ENV 0x2300
+#define GL_EYE_LINEAR 0x2400
+#define GL_OBJECT_LINEAR 0x2401
+#define GL_SPHERE_MAP 0x2402
+#define GL_TEXTURE_GEN_MODE 0x2500
+#define GL_OBJECT_PLANE 0x2501
+#define GL_EYE_PLANE 0x2502
+#define GL_NEAREST 0x2600
+#define GL_LINEAR 0x2601
+#define GL_NEAREST_MIPMAP_NEAREST 0x2700
+#define GL_LINEAR_MIPMAP_NEAREST 0x2701
+#define GL_NEAREST_MIPMAP_LINEAR 0x2702
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+#define GL_TEXTURE_MAG_FILTER 0x2800
+#define GL_TEXTURE_MIN_FILTER 0x2801
+#define GL_TEXTURE_WRAP_S 0x2802
+#define GL_TEXTURE_WRAP_T 0x2803
+#define GL_CLAMP 0x2900
+#define GL_REPEAT 0x2901
+#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
+#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
+#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_OFFSET_POINT 0x2A01
+#define GL_POLYGON_OFFSET_LINE 0x2A02
+#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_ALPHA4 0x803B
+#define GL_ALPHA8 0x803C
+#define GL_ALPHA12 0x803D
+#define GL_ALPHA16 0x803E
+#define GL_LUMINANCE4 0x803F
+#define GL_LUMINANCE8 0x8040
+#define GL_LUMINANCE12 0x8041
+#define GL_LUMINANCE16 0x8042
+#define GL_LUMINANCE4_ALPHA4 0x8043
+#define GL_LUMINANCE6_ALPHA2 0x8044
+#define GL_LUMINANCE8_ALPHA8 0x8045
+#define GL_LUMINANCE12_ALPHA4 0x8046
+#define GL_LUMINANCE12_ALPHA12 0x8047
+#define GL_LUMINANCE16_ALPHA16 0x8048
+#define GL_INTENSITY 0x8049
+#define GL_INTENSITY4 0x804A
+#define GL_INTENSITY8 0x804B
+#define GL_INTENSITY12 0x804C
+#define GL_INTENSITY16 0x804D
+#define GL_R3_G3_B2 0x2A10
+#define GL_RGB4 0x804F
+#define GL_RGB5 0x8050
+#define GL_RGB8 0x8051
+#define GL_RGB10 0x8052
+#define GL_RGB12 0x8053
+#define GL_RGB16 0x8054
+#define GL_RGBA2 0x8055
+#define GL_RGBA4 0x8056
+#define GL_RGB5_A1 0x8057
+#define GL_RGBA8 0x8058
+#define GL_RGB10_A2 0x8059
+#define GL_RGBA12 0x805A
+#define GL_RGBA16 0x805B
+#define GL_TEXTURE_RED_SIZE 0x805C
+#define GL_TEXTURE_GREEN_SIZE 0x805D
+#define GL_TEXTURE_BLUE_SIZE 0x805E
+#define GL_TEXTURE_ALPHA_SIZE 0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
+#define GL_TEXTURE_INTENSITY_SIZE 0x8061
+#define GL_PROXY_TEXTURE_1D 0x8063
+#define GL_PROXY_TEXTURE_2D 0x8064
+#define GL_TEXTURE_PRIORITY 0x8066
+#define GL_TEXTURE_RESIDENT 0x8067
+#define GL_TEXTURE_BINDING_1D 0x8068
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_VERTEX_ARRAY 0x8074
+#define GL_NORMAL_ARRAY 0x8075
+#define GL_COLOR_ARRAY 0x8076
+#define GL_INDEX_ARRAY 0x8077
+#define GL_TEXTURE_COORD_ARRAY 0x8078
+#define GL_EDGE_FLAG_ARRAY 0x8079
+#define GL_VERTEX_ARRAY_SIZE 0x807A
+#define GL_VERTEX_ARRAY_TYPE 0x807B
+#define GL_VERTEX_ARRAY_STRIDE 0x807C
+#define GL_NORMAL_ARRAY_TYPE 0x807E
+#define GL_NORMAL_ARRAY_STRIDE 0x807F
+#define GL_COLOR_ARRAY_SIZE 0x8081
+#define GL_COLOR_ARRAY_TYPE 0x8082
+#define GL_COLOR_ARRAY_STRIDE 0x8083
+#define GL_INDEX_ARRAY_TYPE 0x8085
+#define GL_INDEX_ARRAY_STRIDE 0x8086
+#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
+#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
+#define GL_VERTEX_ARRAY_POINTER 0x808E
+#define GL_NORMAL_ARRAY_POINTER 0x808F
+#define GL_COLOR_ARRAY_POINTER 0x8090
+#define GL_INDEX_ARRAY_POINTER 0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
+#define GL_V2F 0x2A20
+#define GL_V3F 0x2A21
+#define GL_C4UB_V2F 0x2A22
+#define GL_C4UB_V3F 0x2A23
+#define GL_C3F_V3F 0x2A24
+#define GL_N3F_V3F 0x2A25
+#define GL_C4F_N3F_V3F 0x2A26
+#define GL_T2F_V3F 0x2A27
+#define GL_T4F_V4F 0x2A28
+#define GL_T2F_C4UB_V3F 0x2A29
+#define GL_T2F_C3F_V3F 0x2A2A
+#define GL_T2F_N3F_V3F 0x2A2B
+#define GL_T2F_C4F_N3F_V3F 0x2A2C
+#define GL_T4F_C4F_N3F_V4F 0x2A2D
+#define GL_LOGIC_OP GL_INDEX_LOGIC_OP
+#define GL_TEXTURE_COMPONENTS GL_TEXTURE_INTERNAL_FORMAT
+#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
+
+GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value);
+GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref);
+GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences);
+GLAPI void GLAPIENTRY glArrayElement (GLint i);
+GLAPI void GLAPIENTRY glBegin (GLenum mode);
+GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture);
+GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
+GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
+GLAPI void GLAPIENTRY glCallList (GLuint list);
+GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists);
+GLAPI void GLAPIENTRY glClear (GLbitfield mask);
+GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GLAPI void GLAPIENTRY glClearDepth (GLclampd depth);
+GLAPI void GLAPIENTRY glClearIndex (GLfloat c);
+GLAPI void GLAPIENTRY glClearStencil (GLint s);
+GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation);
+GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue);
+GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v);
+GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue);
+GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v);
+GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue);
+GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v);
+GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue);
+GLAPI void GLAPIENTRY glColor3iv (const GLint *v);
+GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue);
+GLAPI void GLAPIENTRY glColor3sv (const GLshort *v);
+GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue);
+GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v);
+GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue);
+GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v);
+GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue);
+GLAPI void GLAPIENTRY glColor3usv (const GLushort *v);
+GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
+GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v);
+GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
+GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v);
+GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v);
+GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha);
+GLAPI void GLAPIENTRY glColor4iv (const GLint *v);
+GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha);
+GLAPI void GLAPIENTRY glColor4sv (const GLshort *v);
+GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v);
+GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha);
+GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v);
+GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha);
+GLAPI void GLAPIENTRY glColor4usv (const GLushort *v);
+GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode);
+GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
+GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
+GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void GLAPIENTRY glCullFace (GLenum mode);
+GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range);
+GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
+GLAPI void GLAPIENTRY glDepthFunc (GLenum func);
+GLAPI void GLAPIENTRY glDepthMask (GLboolean flag);
+GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar);
+GLAPI void GLAPIENTRY glDisable (GLenum cap);
+GLAPI void GLAPIENTRY glDisableClientState (GLenum array);
+GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
+GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode);
+GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
+GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag);
+GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer);
+GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag);
+GLAPI void GLAPIENTRY glEnable (GLenum cap);
+GLAPI void GLAPIENTRY glEnableClientState (GLenum array);
+GLAPI void GLAPIENTRY glEnd (void);
+GLAPI void GLAPIENTRY glEndList (void);
+GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u);
+GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u);
+GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u);
+GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u);
+GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v);
+GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u);
+GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v);
+GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u);
+GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2);
+GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
+GLAPI void GLAPIENTRY glEvalPoint1 (GLint i);
+GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j);
+GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer);
+GLAPI void GLAPIENTRY glFinish (void);
+GLAPI void GLAPIENTRY glFlush (void);
+GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param);
+GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params);
+GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param);
+GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params);
+GLAPI void GLAPIENTRY glFrontFace (GLenum mode);
+GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range);
+GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures);
+GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params);
+GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation);
+GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params);
+GLAPI GLenum GLAPIENTRY glGetError (void);
+GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params);
+GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params);
+GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
+GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params);
+GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v);
+GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v);
+GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v);
+GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);
+GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params);
+GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values);
+GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values);
+GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values);
+GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, GLvoid* *params);
+GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask);
+GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name);
+GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params);
+GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params);
+GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params);
+GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params);
+GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
+GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params);
+GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params);
+GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode);
+GLAPI void GLAPIENTRY glIndexMask (GLuint mask);
+GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void GLAPIENTRY glIndexd (GLdouble c);
+GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c);
+GLAPI void GLAPIENTRY glIndexf (GLfloat c);
+GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c);
+GLAPI void GLAPIENTRY glIndexi (GLint c);
+GLAPI void GLAPIENTRY glIndexiv (const GLint *c);
+GLAPI void GLAPIENTRY glIndexs (GLshort c);
+GLAPI void GLAPIENTRY glIndexsv (const GLshort *c);
+GLAPI void GLAPIENTRY glIndexub (GLubyte c);
+GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c);
+GLAPI void GLAPIENTRY glInitNames (void);
+GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer);
+GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap);
+GLAPI GLboolean GLAPIENTRY glIsList (GLuint list);
+GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture);
+GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param);
+GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params);
+GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param);
+GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params);
+GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param);
+GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params);
+GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param);
+GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params);
+GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern);
+GLAPI void GLAPIENTRY glLineWidth (GLfloat width);
+GLAPI void GLAPIENTRY glListBase (GLuint base);
+GLAPI void GLAPIENTRY glLoadIdentity (void);
+GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m);
+GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m);
+GLAPI void GLAPIENTRY glLoadName (GLuint name);
+GLAPI void GLAPIENTRY glLogicOp (GLenum opcode);
+GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
+GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
+GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
+GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
+GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2);
+GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2);
+GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
+GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
+GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param);
+GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
+GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param);
+GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params);
+GLAPI void GLAPIENTRY glMatrixMode (GLenum mode);
+GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m);
+GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m);
+GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode);
+GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz);
+GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v);
+GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz);
+GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v);
+GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
+GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v);
+GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz);
+GLAPI void GLAPIENTRY glNormal3iv (const GLint *v);
+GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz);
+GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v);
+GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GLAPI void GLAPIENTRY glPassThrough (GLfloat token);
+GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values);
+GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values);
+GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values);
+GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param);
+GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param);
+GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param);
+GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param);
+GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor);
+GLAPI void GLAPIENTRY glPointSize (GLfloat size);
+GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode);
+GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
+GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask);
+GLAPI void GLAPIENTRY glPopAttrib (void);
+GLAPI void GLAPIENTRY glPopClientAttrib (void);
+GLAPI void GLAPIENTRY glPopMatrix (void);
+GLAPI void GLAPIENTRY glPopName (void);
+GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities);
+GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask);
+GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask);
+GLAPI void GLAPIENTRY glPushMatrix (void);
+GLAPI void GLAPIENTRY glPushName (GLuint name);
+GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y);
+GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v);
+GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y);
+GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v);
+GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y);
+GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v);
+GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y);
+GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v);
+GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z);
+GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v);
+GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z);
+GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v);
+GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z);
+GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v);
+GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z);
+GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v);
+GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v);
+GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v);
+GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w);
+GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v);
+GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v);
+GLAPI void GLAPIENTRY glReadBuffer (GLenum mode);
+GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
+GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
+GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2);
+GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
+GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2);
+GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2);
+GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2);
+GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2);
+GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2);
+GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode);
+GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z);
+GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z);
+GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer);
+GLAPI void GLAPIENTRY glShadeModel (GLenum mode);
+GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
+GLAPI void GLAPIENTRY glStencilMask (GLuint mask);
+GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s);
+GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v);
+GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s);
+GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v);
+GLAPI void GLAPIENTRY glTexCoord1i (GLint s);
+GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v);
+GLAPI void GLAPIENTRY glTexCoord1s (GLshort s);
+GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v);
+GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t);
+GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v);
+GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t);
+GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v);
+GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t);
+GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v);
+GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t);
+GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v);
+GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r);
+GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v);
+GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r);
+GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v);
+GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r);
+GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v);
+GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r);
+GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v);
+GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v);
+GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v);
+GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q);
+GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v);
+GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v);
+GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param);
+GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param);
+GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params);
+GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param);
+GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params);
+GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param);
+GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params);
+GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param);
+GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params);
+GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
+GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
+GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z);
+GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z);
+GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y);
+GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v);
+GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y);
+GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v);
+GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y);
+GLAPI void GLAPIENTRY glVertex2iv (const GLint *v);
+GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y);
+GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v);
+GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z);
+GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v);
+GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z);
+GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v);
+GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z);
+GLAPI void GLAPIENTRY glVertex3iv (const GLint *v);
+GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z);
+GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v);
+GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v);
+GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v);
+GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w);
+GLAPI void GLAPIENTRY glVertex4iv (const GLint *v);
+GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v);
+GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+
+#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1)
+
+#endif /* GL_VERSION_1_1 */
+
+/* ---------------------------------- GLU ---------------------------------- */
+
+/* this is where we can safely include GLU */
+#if defined(__APPLE__) && defined(__MACH__)
+#include <OpenGL/glu.h>
+#else
+#include <GL/glu.h>
+#endif
+
+/* ----------------------------- GL_VERSION_1_2 ---------------------------- */
+
+#ifndef GL_VERSION_1_2
+#define GL_VERSION_1_2 1
+
+#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_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_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_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_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+
+typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+
+#define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D)
+#define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements)
+#define glTexImage3D GLEW_GET_FUN(__glewTexImage3D)
+#define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D)
+
+#define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2)
+
+#endif /* GL_VERSION_1_2 */
+
+/* ----------------------------- GL_VERSION_1_3 ---------------------------- */
+
+#ifndef GL_VERSION_1_3
+#define GL_VERSION_1_3 1
+
+#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_CLAMP_TO_BORDER 0x812D
+#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_SUBTRACT 0x84E7
+#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_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_COMBINE 0x8570
+#define GL_COMBINE_RGB 0x8571
+#define GL_COMBINE_ALPHA 0x8572
+#define GL_RGB_SCALE 0x8573
+#define GL_ADD_SIGNED 0x8574
+#define GL_INTERPOLATE 0x8575
+#define GL_CONSTANT 0x8576
+#define GL_PRIMARY_COLOR 0x8577
+#define GL_PREVIOUS 0x8578
+#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_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_DOT3_RGB 0x86AE
+#define GL_DOT3_RGBA 0x86AF
+#define GL_MULTISAMPLE_BIT 0x20000000
+
+typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLvoid *img);
+typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]);
+typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]);
+typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]);
+typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
+typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
+
+#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture)
+#define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture)
+#define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D)
+#define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D)
+#define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D)
+#define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D)
+#define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D)
+#define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D)
+#define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage)
+#define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd)
+#define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf)
+#define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd)
+#define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf)
+#define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d)
+#define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv)
+#define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f)
+#define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv)
+#define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i)
+#define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv)
+#define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s)
+#define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv)
+#define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d)
+#define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv)
+#define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f)
+#define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv)
+#define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i)
+#define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv)
+#define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s)
+#define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv)
+#define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d)
+#define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv)
+#define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f)
+#define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv)
+#define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i)
+#define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv)
+#define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s)
+#define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv)
+#define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d)
+#define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv)
+#define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f)
+#define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv)
+#define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i)
+#define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv)
+#define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s)
+#define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv)
+#define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage)
+
+#define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3)
+
+#endif /* GL_VERSION_1_3 */
+
+/* ----------------------------- GL_VERSION_1_4 ---------------------------- */
+
+#ifndef GL_VERSION_1_4
+#define GL_VERSION_1_4 1
+
+#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
+
+typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode);
+typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord);
+typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
+typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord);
+typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
+typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount);
+typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
+typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, GLfloat *params);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer);
+typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
+typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p);
+typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
+typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p);
+typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
+typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p);
+typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
+typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p);
+typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p);
+typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p);
+typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
+typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p);
+typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p);
+
+#define glBlendColor GLEW_GET_FUN(__glewBlendColor)
+#define glBlendEquation GLEW_GET_FUN(__glewBlendEquation)
+#define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate)
+#define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer)
+#define glFogCoordd GLEW_GET_FUN(__glewFogCoordd)
+#define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv)
+#define glFogCoordf GLEW_GET_FUN(__glewFogCoordf)
+#define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv)
+#define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays)
+#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements)
+#define glPointParameterf GLEW_GET_FUN(__glewPointParameterf)
+#define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv)
+#define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b)
+#define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv)
+#define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d)
+#define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv)
+#define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f)
+#define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv)
+#define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i)
+#define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv)
+#define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s)
+#define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv)
+#define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub)
+#define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv)
+#define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui)
+#define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv)
+#define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us)
+#define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv)
+#define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer)
+#define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d)
+#define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv)
+#define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f)
+#define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv)
+#define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i)
+#define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv)
+#define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s)
+#define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv)
+#define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d)
+#define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv)
+#define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f)
+#define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv)
+#define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i)
+#define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv)
+#define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s)
+#define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv)
+
+#define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4)
+
+#endif /* GL_VERSION_1_4 */
+
+/* ----------------------------- GL_VERSION_1_5 ---------------------------- */
+
+#ifndef GL_VERSION_1_5
+#define GL_VERSION_1_5 1
+
+#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE
+#define GL_FOG_COORD GL_FOG_COORDINATE
+#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY
+#define GL_SRC0_RGB GL_SOURCE0_RGB
+#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER
+#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE
+#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA
+#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE
+#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE
+#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA
+#define GL_SRC1_RGB GL_SOURCE1_RGB
+#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING
+#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA
+#define GL_SRC2_RGB GL_SOURCE2_RGB
+#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
+
+typedef ptrdiff_t GLsizeiptr;
+typedef ptrdiff_t GLintptr;
+
+typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
+typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
+typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
+typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
+typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers);
+typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids);
+typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target);
+typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers);
+typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids);
+typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid** params);
+typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data);
+typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params);
+typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params);
+typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer);
+typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id);
+typedef GLvoid* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
+typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target);
+
+#define glBeginQuery GLEW_GET_FUN(__glewBeginQuery)
+#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer)
+#define glBufferData GLEW_GET_FUN(__glewBufferData)
+#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData)
+#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers)
+#define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries)
+#define glEndQuery GLEW_GET_FUN(__glewEndQuery)
+#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers)
+#define glGenQueries GLEW_GET_FUN(__glewGenQueries)
+#define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv)
+#define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv)
+#define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData)
+#define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv)
+#define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv)
+#define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv)
+#define glIsBuffer GLEW_GET_FUN(__glewIsBuffer)
+#define glIsQuery GLEW_GET_FUN(__glewIsQuery)
+#define glMapBuffer GLEW_GET_FUN(__glewMapBuffer)
+#define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer)
+
+#define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5)
+
+#endif /* GL_VERSION_1_5 */
+
+/* ----------------------------- GL_VERSION_2_0 ---------------------------- */
+
+#ifndef GL_VERSION_2_0
+#define GL_VERSION_2_0 1
+
+#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 0x8B4E
+#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
+
+typedef char GLchar;
+
+typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name);
+typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum, GLenum);
+typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader);
+typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void);
+typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type);
+typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program);
+typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader);
+typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint);
+typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs);
+typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint);
+typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
+typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
+typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders);
+typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name);
+typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog);
+typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param);
+typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog);
+typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLint obj, GLsizei maxLength, GLsizei* length, GLchar* source);
+typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param);
+typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLint programObj, const GLchar* name);
+typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint, GLenum, GLvoid*);
+typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint, GLenum, GLdouble*);
+typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint, GLenum, GLfloat*);
+typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint, GLenum, GLint*);
+typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program);
+typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader);
+typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program);
+typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar** strings, const GLint* lengths);
+typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum, GLuint);
+typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
+typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
+typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
+typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program);
+typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer);
+
+#define glAttachShader GLEW_GET_FUN(__glewAttachShader)
+#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation)
+#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate)
+#define glCompileShader GLEW_GET_FUN(__glewCompileShader)
+#define glCreateProgram GLEW_GET_FUN(__glewCreateProgram)
+#define glCreateShader GLEW_GET_FUN(__glewCreateShader)
+#define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram)
+#define glDeleteShader GLEW_GET_FUN(__glewDeleteShader)
+#define glDetachShader GLEW_GET_FUN(__glewDetachShader)
+#define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray)
+#define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers)
+#define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray)
+#define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib)
+#define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform)
+#define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders)
+#define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation)
+#define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog)
+#define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv)
+#define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog)
+#define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource)
+#define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv)
+#define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation)
+#define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv)
+#define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv)
+#define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv)
+#define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv)
+#define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv)
+#define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv)
+#define glIsProgram GLEW_GET_FUN(__glewIsProgram)
+#define glIsShader GLEW_GET_FUN(__glewIsShader)
+#define glLinkProgram GLEW_GET_FUN(__glewLinkProgram)
+#define glShaderSource GLEW_GET_FUN(__glewShaderSource)
+#define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate)
+#define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate)
+#define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate)
+#define glUniform1f GLEW_GET_FUN(__glewUniform1f)
+#define glUniform1fv GLEW_GET_FUN(__glewUniform1fv)
+#define glUniform1i GLEW_GET_FUN(__glewUniform1i)
+#define glUniform1iv GLEW_GET_FUN(__glewUniform1iv)
+#define glUniform2f GLEW_GET_FUN(__glewUniform2f)
+#define glUniform2fv GLEW_GET_FUN(__glewUniform2fv)
+#define glUniform2i GLEW_GET_FUN(__glewUniform2i)
+#define glUniform2iv GLEW_GET_FUN(__glewUniform2iv)
+#define glUniform3f GLEW_GET_FUN(__glewUniform3f)
+#define glUniform3fv GLEW_GET_FUN(__glewUniform3fv)
+#define glUniform3i GLEW_GET_FUN(__glewUniform3i)
+#define glUniform3iv GLEW_GET_FUN(__glewUniform3iv)
+#define glUniform4f GLEW_GET_FUN(__glewUniform4f)
+#define glUniform4fv GLEW_GET_FUN(__glewUniform4fv)
+#define glUniform4i GLEW_GET_FUN(__glewUniform4i)
+#define glUniform4iv GLEW_GET_FUN(__glewUniform4iv)
+#define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv)
+#define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv)
+#define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv)
+#define glUseProgram GLEW_GET_FUN(__glewUseProgram)
+#define glValidateProgram GLEW_GET_FUN(__glewValidateProgram)
+#define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d)
+#define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv)
+#define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f)
+#define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv)
+#define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s)
+#define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv)
+#define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d)
+#define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv)
+#define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f)
+#define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv)
+#define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s)
+#define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv)
+#define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d)
+#define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv)
+#define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f)
+#define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv)
+#define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s)
+#define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv)
+#define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv)
+#define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv)
+#define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv)
+#define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub)
+#define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv)
+#define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv)
+#define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv)
+#define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv)
+#define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d)
+#define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv)
+#define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f)
+#define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv)
+#define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv)
+#define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s)
+#define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv)
+#define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv)
+#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv)
+#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv)
+#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer)
+
+#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0)
+
+#endif /* GL_VERSION_2_0 */
+
+/* ----------------------------- GL_VERSION_2_1 ---------------------------- */
+
+#ifndef GL_VERSION_2_1
+#define GL_VERSION_2_1 1
+
+#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
+#define GL_PIXEL_PACK_BUFFER 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
+#define GL_FLOAT_MAT2x3 0x8B65
+#define GL_FLOAT_MAT2x4 0x8B66
+#define GL_FLOAT_MAT3x2 0x8B67
+#define GL_FLOAT_MAT3x4 0x8B68
+#define GL_FLOAT_MAT4x2 0x8B69
+#define GL_FLOAT_MAT4x3 0x8B6A
+#define GL_SRGB 0x8C40
+#define GL_SRGB8 0x8C41
+#define GL_SRGB_ALPHA 0x8C42
+#define GL_SRGB8_ALPHA8 0x8C43
+#define GL_SLUMINANCE_ALPHA 0x8C44
+#define GL_SLUMINANCE8_ALPHA8 0x8C45
+#define GL_SLUMINANCE 0x8C46
+#define GL_SLUMINANCE8 0x8C47
+#define GL_COMPRESSED_SRGB 0x8C48
+#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
+#define GL_COMPRESSED_SLUMINANCE 0x8C4A
+#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
+
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+#define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv)
+#define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv)
+#define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv)
+#define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv)
+#define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv)
+#define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv)
+
+#define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1)
+
+#endif /* GL_VERSION_2_1 */
+
+/* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */
+
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_ARB_pixel_buffer_object 1
+
+#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
+#define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object)
+
+#endif /* GL_ARB_pixel_buffer_object */
+
+/* -------------------------- GL_ARB_draw_buffers -------------------------- */
+
+#ifndef GL_ARB_draw_buffers
+#define GL_ARB_draw_buffers 1
+
+#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
+
+typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs);
+
+#define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB)
+
+#define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers)
+
+#endif /* GL_ARB_draw_buffers */
+
+/* ------------------------ GL_ARB_fragment_program ------------------------ */
+
+#ifndef GL_ARB_fragment_program
+#define GL_ARB_fragment_program 1
+
+#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
+
+#define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program)
+
+#endif /* GL_ARB_fragment_program */
+
+/* ------------------------- GL_ARB_fragment_shader ------------------------ */
+
+#ifndef GL_ARB_fragment_shader
+#define GL_ARB_fragment_shader 1
+
+#define GL_FRAGMENT_SHADER_ARB 0x8B30
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
+
+#define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader)
+
+#endif /* GL_ARB_fragment_shader */
+
+/* ------------------------ GL_ARB_half_float_pixel ------------------------ */
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_ARB_half_float_pixel 1
+
+#define GL_HALF_FLOAT_ARB 0x140B
+
+#define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel)
+
+#endif /* GL_ARB_half_float_pixel */
+
+/* --------------------------- GL_ARB_multisample -------------------------- */
+
+#ifndef GL_ARB_multisample
+#define GL_ARB_multisample 1
+
+#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
+
+typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
+
+#define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB)
+
+#define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample)
+
+#endif /* GL_ARB_multisample */
+
+/* -------------------------- GL_ARB_multitexture -------------------------- */
+
+#ifndef GL_ARB_multitexture
+#define GL_ARB_multitexture 1
+
+#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
+
+typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
+
+#define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB)
+#define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB)
+#define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB)
+#define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB)
+#define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB)
+#define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB)
+#define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB)
+#define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB)
+#define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB)
+#define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB)
+#define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB)
+#define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB)
+#define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB)
+#define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB)
+#define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB)
+#define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB)
+#define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB)
+#define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB)
+#define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB)
+#define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB)
+#define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB)
+#define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB)
+#define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB)
+#define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB)
+#define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB)
+#define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB)
+#define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB)
+#define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB)
+#define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB)
+#define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB)
+#define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB)
+#define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB)
+#define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB)
+#define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB)
+
+#define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture)
+
+#endif /* GL_ARB_multitexture */
+
+/* ------------------------- GL_ARB_occlusion_query ------------------------ */
+
+#ifndef GL_ARB_occlusion_query
+#define GL_ARB_occlusion_query 1
+
+#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
+
+typedef void (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
+typedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids);
+typedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target);
+typedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids);
+typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params);
+typedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params);
+typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id);
+
+#define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB)
+#define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB)
+#define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB)
+#define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB)
+#define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB)
+#define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB)
+#define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB)
+#define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB)
+
+#define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query)
+
+#endif /* GL_ARB_occlusion_query */
+
+/* ------------------------- GL_ARB_shader_objects ------------------------- */
+
+#ifndef GL_ARB_shader_objects
+#define GL_ARB_shader_objects 1
+
+#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
+
+typedef char GLcharARB;
+typedef unsigned int GLhandleARB;
+
+typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
+typedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
+typedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
+typedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
+typedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
+typedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
+typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name);
+typedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj);
+typedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname);
+typedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog);
+typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source);
+typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name);
+typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params);
+typedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length);
+typedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
+typedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
+typedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
+typedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
+typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
+
+#define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB)
+#define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB)
+#define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB)
+#define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB)
+#define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB)
+#define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB)
+#define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB)
+#define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB)
+#define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB)
+#define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB)
+#define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB)
+#define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB)
+#define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB)
+#define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB)
+#define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB)
+#define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB)
+#define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB)
+#define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB)
+#define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB)
+#define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB)
+#define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB)
+#define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB)
+#define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB)
+#define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB)
+#define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB)
+#define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB)
+#define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB)
+#define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB)
+#define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB)
+#define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB)
+#define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB)
+#define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB)
+#define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB)
+#define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB)
+#define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB)
+#define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB)
+#define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB)
+#define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB)
+#define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB)
+
+#define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects)
+
+#endif /* GL_ARB_shader_objects */
+
+/* ---------------------- GL_ARB_shading_language_100 ---------------------- */
+
+#ifndef GL_ARB_shading_language_100
+#define GL_ARB_shading_language_100 1
+
+#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C
+
+#define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100)
+
+#endif /* GL_ARB_shading_language_100 */
+
+/* ----------------------- GL_ARB_texture_compression ---------------------- */
+
+#ifndef GL_ARB_texture_compression
+#define GL_ARB_texture_compression 1
+
+#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
+
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, void* img);
+
+#define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB)
+#define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB)
+#define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB)
+#define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB)
+#define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB)
+#define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB)
+#define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB)
+
+#define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression)
+
+#endif /* GL_ARB_texture_compression */
+
+/* ------------------------ GL_ARB_texture_cube_map ------------------------ */
+
+#ifndef GL_ARB_texture_cube_map
+#define GL_ARB_texture_cube_map 1
+
+#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
+
+#define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map)
+
+#endif /* GL_ARB_texture_cube_map */
+
+/* ----------------------- GL_ARB_texture_env_combine ---------------------- */
+
+#ifndef GL_ARB_texture_env_combine
+#define GL_ARB_texture_env_combine 1
+
+#define GL_SUBTRACT_ARB 0x84E7
+#define GL_COMBINE_ARB 0x8570
+#define GL_COMBINE_RGB_ARB 0x8571
+#define GL_COMBINE_ALPHA_ARB 0x8572
+#define GL_RGB_SCALE_ARB 0x8573
+#define GL_ADD_SIGNED_ARB 0x8574
+#define GL_INTERPOLATE_ARB 0x8575
+#define GL_CONSTANT_ARB 0x8576
+#define GL_PRIMARY_COLOR_ARB 0x8577
+#define GL_PREVIOUS_ARB 0x8578
+#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 GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine)
+
+#endif /* GL_ARB_texture_env_combine */
+
+/* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */
+
+#ifndef GL_ARB_texture_env_dot3
+#define GL_ARB_texture_env_dot3 1
+
+#define GL_DOT3_RGB_ARB 0x86AE
+#define GL_DOT3_RGBA_ARB 0x86AF
+
+#define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3)
+
+#endif /* GL_ARB_texture_env_dot3 */
+
+/* -------------------------- GL_ARB_texture_float ------------------------- */
+
+#ifndef GL_ARB_texture_float
+#define GL_ARB_texture_float 1
+
+#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
+#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 GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float)
+
+#endif /* GL_ARB_texture_float */
+
+/* -------------------- GL_ARB_texture_non_power_of_two -------------------- */
+
+#ifndef GL_ARB_texture_non_power_of_two
+#define GL_ARB_texture_non_power_of_two 1
+
+#define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two)
+
+#endif /* GL_ARB_texture_non_power_of_two */
+
+/* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */
+
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_ARB_vertex_buffer_object 1
+
+#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
+
+typedef ptrdiff_t GLsizeiptrARB;
+typedef ptrdiff_t GLintptrARB;
+
+typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
+typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid* data, GLenum usage);
+typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid* data);
+typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers);
+typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers);
+typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid** params);
+typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid* data);
+typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer);
+typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
+typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target);
+
+#define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB)
+#define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB)
+#define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB)
+#define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB)
+#define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB)
+#define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB)
+#define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB)
+#define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB)
+#define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB)
+#define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB)
+#define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB)
+
+#define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object)
+
+#endif /* GL_ARB_vertex_buffer_object */
+
+/* ------------------------- GL_ARB_vertex_program ------------------------- */
+
+#ifndef GL_ARB_vertex_program
+#define GL_ARB_vertex_program 1
+
+#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
+
+typedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
+typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs);
+typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs);
+typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params);
+typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params);
+typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void* string);
+typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid** pointer);
+typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params);
+typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params);
+typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program);
+typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void* string);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer);
+
+#define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB)
+#define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB)
+#define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB)
+#define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB)
+#define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB)
+#define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB)
+#define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB)
+#define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB)
+#define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB)
+#define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB)
+#define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB)
+#define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB)
+#define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB)
+#define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB)
+#define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB)
+#define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB)
+#define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB)
+#define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB)
+#define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB)
+#define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB)
+#define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB)
+#define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB)
+#define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB)
+#define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB)
+#define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB)
+#define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB)
+#define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB)
+#define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB)
+#define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB)
+#define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB)
+#define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB)
+#define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB)
+#define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB)
+#define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB)
+#define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB)
+#define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB)
+#define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB)
+#define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB)
+#define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB)
+#define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB)
+#define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB)
+#define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB)
+#define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB)
+#define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB)
+#define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB)
+#define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB)
+#define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB)
+#define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB)
+#define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB)
+#define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB)
+#define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB)
+#define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB)
+#define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB)
+#define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB)
+#define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB)
+#define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB)
+#define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB)
+#define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB)
+#define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB)
+#define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB)
+#define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB)
+#define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB)
+
+#define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program)
+
+#endif /* GL_ARB_vertex_program */
+
+/* -------------------------- GL_ARB_vertex_shader ------------------------- */
+
+#ifndef GL_ARB_vertex_shader
+#define GL_ARB_vertex_shader 1
+
+#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
+
+typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name);
+typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name);
+typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name);
+
+#define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB)
+#define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB)
+#define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB)
+
+#define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader)
+
+#endif /* GL_ARB_vertex_shader */
+
+/* -------------------------- GL_ATI_draw_buffers -------------------------- */
+
+#ifndef GL_ATI_draw_buffers
+#define GL_ATI_draw_buffers 1
+
+#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
+
+typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs);
+
+#define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI)
+
+#define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers)
+
+#endif /* GL_ATI_draw_buffers */
+
+/* ------------------------- GL_ATI_fragment_shader ------------------------ */
+
+#ifndef GL_ATI_fragment_shader
+#define GL_ATI_fragment_shader 1
+
+#define GL_RED_BIT_ATI 0x00000001
+#define GL_2X_BIT_ATI 0x00000001
+#define GL_4X_BIT_ATI 0x00000002
+#define GL_GREEN_BIT_ATI 0x00000002
+#define GL_COMP_BIT_ATI 0x00000002
+#define GL_BLUE_BIT_ATI 0x00000004
+#define GL_8X_BIT_ATI 0x00000004
+#define GL_NEGATE_BIT_ATI 0x00000004
+#define GL_BIAS_BIT_ATI 0x00000008
+#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_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_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_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
+
+typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
+typedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void);
+typedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
+typedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
+typedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
+typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value);
+
+#define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI)
+#define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI)
+#define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI)
+#define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI)
+#define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI)
+#define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI)
+#define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI)
+#define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI)
+#define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI)
+#define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI)
+#define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI)
+#define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI)
+#define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI)
+#define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI)
+
+#define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader)
+
+#endif /* GL_ATI_fragment_shader */
+
+/* -------------------------- GL_ATI_texture_float ------------------------- */
+
+#ifndef GL_ATI_texture_float
+#define GL_ATI_texture_float 1
+
+#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
+
+#define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float)
+
+#endif /* GL_ATI_texture_float */
+
+/* -------------------------- GL_EXT_texture_sRGB -------------------------- */
+
+#ifndef GL_EXT_texture_sRGB
+#define GL_EXT_texture_sRGB 1
+
+#define GL_SRGB_EXT                       0x8C40
+#define GL_SRGB8_EXT                      0x8C41
+#define GL_SRGB_ALPHA_EXT                 0x8C42
+#define GL_SRGB8_ALPHA8_EXT               0x8C43
+#define GL_SLUMINANCE_ALPHA_EXT           0x8C44
+#define GL_SLUMINANCE8_ALPHA8_EXT         0x8C45
+#define GL_SLUMINANCE_EXT                 0x8C46
+#define GL_SLUMINANCE8_EXT                0x8C47
+#define GL_COMPRESSED_SRGB_EXT            0x8C48
+#define GL_COMPRESSED_SRGB_ALPHA_EXT      0x8C49
+#define GL_COMPRESSED_SLUMINANCE_EXT      0x8C4A
+#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B
+#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT  0x8C4C
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
+
+#endif /* GL_EXT_texture_sRGB */
+
+/* ----------------------- GL_EXT_framebuffer_object ----------------------- */
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_EXT_framebuffer_object 1
+
+#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_FRAMEBUFFER_STATUS_ERROR_EXT 0x8CDE
+#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_INDEX_EXT 0x8D45
+#define GL_STENCIL_INDEX1_EXT 0x8D46
+#define GL_STENCIL_INDEX4_EXT 0x8D47
+#define GL_STENCIL_INDEX8_EXT 0x8D48
+#define GL_STENCIL_INDEX16_EXT 0x8D49
+
+typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
+typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
+typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
+typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers);
+typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers);
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers);
+typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers);
+typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
+typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params);
+typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
+typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
+typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+
+#define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT)
+#define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT)
+#define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT)
+#define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT)
+#define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT)
+#define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT)
+#define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT)
+#define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT)
+#define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT)
+#define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT)
+#define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT)
+#define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT)
+#define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT)
+#define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT)
+#define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT)
+#define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT)
+#define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT)
+
+#define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object)
+
+#endif /* GL_EXT_framebuffer_object */
+
+/* ----------------------- GL_EXT_pixel_buffer_object ----------------------- */
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_EXT_pixel_buffer_object 1
+#define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object)
+#endif /* GL_EXT_pixel_buffer_object */
+
+
+#ifndef GL_EXT_secondary_color
+#define GL_EXT_secondary_color 1
+
+#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
+
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
+typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer);
+
+#define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT)
+#define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT)
+#define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT)
+#define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT)
+#define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT)
+#define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT)
+#define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT)
+#define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT)
+#define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT)
+#define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT)
+#define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT)
+#define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT)
+#define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT)
+#define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT)
+#define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT)
+#define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT)
+#define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT)
+
+#define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color)
+
+#endif /* GL_EXT_secondary_color */
+
+/* ------------------------ GL_EXT_stencil_two_side ------------------------ */
+
+#ifndef GL_EXT_stencil_two_side
+#define GL_EXT_stencil_two_side 1
+
+#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910
+#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911
+
+typedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
+
+#define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT)
+
+#define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side)
+
+#endif /* GL_EXT_stencil_two_side */
+
+/* -------------------------- GL_EXT_stencil_wrap -------------------------- */
+
+#ifndef GL_EXT_stencil_wrap
+#define GL_EXT_stencil_wrap 1
+
+#define GL_INCR_WRAP_EXT 0x8507
+#define GL_DECR_WRAP_EXT 0x8508
+
+#define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap)
+
+#endif /* GL_EXT_stencil_wrap */
+
+/* -------------------- GL_EXT_texture_compression_s3tc -------------------- */
+
+#ifndef GL_EXT_texture_compression_s3tc
+#define GL_EXT_texture_compression_s3tc 1
+
+#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
+
+#define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc)
+
+#endif /* GL_EXT_texture_compression_s3tc */
+
+/* ------------------------ GL_EXT_texture_cube_map ------------------------ */
+
+#ifndef GL_EXT_texture_cube_map
+#define GL_EXT_texture_cube_map 1
+
+#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
+
+#define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map)
+
+#endif /* GL_EXT_texture_cube_map */
+
+/* ----------------------- GL_EXT_texture_env_combine ---------------------- */
+
+#ifndef GL_EXT_texture_env_combine
+#define GL_EXT_texture_env_combine 1
+
+#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
+
+#define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine)
+
+#endif /* GL_EXT_texture_env_combine */
+
+/* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */
+
+#ifndef GL_EXT_texture_env_dot3
+#define GL_EXT_texture_env_dot3 1
+
+#define GL_DOT3_RGB_EXT 0x8740
+#define GL_DOT3_RGBA_EXT 0x8741
+
+#define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3)
+
+#endif /* GL_EXT_texture_env_dot3 */
+
+/* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+
+#define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic)
+
+#endif /* GL_EXT_texture_filter_anisotropic */
+
+/* ------------------------- GL_NV_fragment_program ------------------------ */
+
+#ifndef GL_NV_fragment_program
+#define GL_NV_fragment_program 1
+
+#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
+
+typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params);
+typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]);
+typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]);
+
+#define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV)
+#define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV)
+#define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV)
+#define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV)
+#define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV)
+#define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV)
+
+#define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program)
+
+#endif /* GL_NV_fragment_program */
+
+/* ------------------------ GL_NV_fragment_program2 ------------------------ */
+
+#ifndef GL_NV_fragment_program2
+#define GL_NV_fragment_program2 1
+
+#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
+
+#define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2)
+
+#endif /* GL_NV_fragment_program2 */
+
+/* --------------------- GL_NV_fragment_program_option --------------------- */
+
+#ifndef GL_NV_fragment_program_option
+#define GL_NV_fragment_program_option 1
+
+#define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option)
+
+#endif /* GL_NV_fragment_program_option */
+
+/* ------------------------- GL_NV_occlusion_query ------------------------- */
+
+#ifndef GL_NV_occlusion_query
+#define GL_NV_occlusion_query 1
+
+#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
+
+typedef void (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids);
+typedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void);
+typedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids);
+typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params);
+typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
+
+#define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV)
+#define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV)
+#define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV)
+#define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV)
+#define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV)
+#define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV)
+#define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV)
+
+#define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query)
+
+#endif /* GL_NV_occlusion_query */
+
+/* ------------------------ GL_NV_register_combiners ----------------------- */
+
+#ifndef GL_NV_register_combiners
+#define GL_NV_register_combiners 1
+
+#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
+
+typedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
+typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
+typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params);
+typedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params);
+
+#define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV)
+#define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV)
+#define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV)
+#define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV)
+#define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV)
+#define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV)
+#define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV)
+#define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV)
+#define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV)
+#define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV)
+#define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV)
+#define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV)
+#define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV)
+
+#define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners)
+
+#endif /* GL_NV_register_combiners */
+
+/* ----------------------- GL_NV_register_combiners2 ----------------------- */
+
+#ifndef GL_NV_register_combiners2
+#define GL_NV_register_combiners2 1
+
+#define GL_PER_STAGE_CONSTANTS_NV 0x8535
+
+typedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params);
+
+#define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV)
+#define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV)
+
+#define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2)
+
+#endif /* GL_NV_register_combiners2 */
+
+/* --------------------- GL_NV_texture_compression_vtc --------------------- */
+
+#ifndef GL_NV_texture_compression_vtc
+#define GL_NV_texture_compression_vtc 1
+
+#define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc)
+
+#endif /* GL_NV_texture_compression_vtc */
+
+/* -------------------------- GL_NV_texture_shader ------------------------- */
+
+#ifndef GL_NV_texture_shader
+#define GL_NV_texture_shader 1
+
+#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_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
+
+#define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader)
+
+#endif /* GL_NV_texture_shader */
+
+/* -------------------------- GL_NV_vertex_program ------------------------- */
+
+#ifndef GL_NV_vertex_program
+#define GL_NV_vertex_program 1
+
+#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
+
+typedef GLboolean (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences);
+typedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
+typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids);
+typedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids);
+typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params);
+typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program);
+typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid** pointer);
+typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params);
+typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params);
+typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id);
+typedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program);
+typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint num, const GLdouble* params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint num, const GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids);
+typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v);
+
+#define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV)
+#define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV)
+#define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV)
+#define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV)
+#define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV)
+#define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV)
+#define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV)
+#define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV)
+#define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV)
+#define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV)
+#define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV)
+#define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV)
+#define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV)
+#define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV)
+#define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV)
+#define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV)
+#define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV)
+#define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV)
+#define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV)
+#define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV)
+#define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV)
+#define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV)
+#define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV)
+#define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV)
+#define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV)
+#define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV)
+#define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV)
+#define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV)
+#define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV)
+#define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV)
+#define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV)
+#define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV)
+#define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV)
+#define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV)
+#define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV)
+#define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV)
+#define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV)
+#define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV)
+#define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV)
+#define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV)
+#define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV)
+#define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV)
+#define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV)
+#define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV)
+#define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV)
+#define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV)
+#define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV)
+#define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV)
+#define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV)
+#define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV)
+#define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV)
+#define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV)
+#define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV)
+#define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV)
+#define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV)
+#define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV)
+#define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV)
+#define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV)
+#define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV)
+#define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV)
+#define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV)
+#define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV)
+#define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV)
+#define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV)
+
+#define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program)
+
+#endif /* GL_NV_vertex_program */
+
+/* ---------------------- GL_NV_vertex_program2_option --------------------- */
+
+#ifndef GL_NV_vertex_program2_option
+#define GL_NV_vertex_program2_option 1
+
+#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
+#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5
+
+#define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option)
+
+#endif /* GL_NV_vertex_program2_option */
+
+/* ------------------------- GL_NV_vertex_program3 ------------------------- */
+
+#ifndef GL_NV_vertex_program3
+#define GL_NV_vertex_program3 1
+
+#define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
+
+#define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3)
+
+#endif /* GL_NV_vertex_program3 */
+
+/* ------------------------ GL_SGIS_generate_mipmap ------------------------ */
+
+#ifndef GL_SGIS_generate_mipmap
+#define GL_SGIS_generate_mipmap 1
+
+#define GL_GENERATE_MIPMAP_SGIS 0x8191
+#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
+
+#define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap)
+
+#endif /* GL_SGIS_generate_mipmap */
+
+/* ------------------------------------------------------------------------- */
+
+// Added for OGRE by SJS
+/* ------------------------ GL_ARB_point_sprite ---------------------------- */
+#ifndef GL_ARB_point_sprite
+#define GL_ARB_point_sprite 1
+// All state enums used are the same as GL 1.4 standard ones
+#define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite)
+
+#endif /* GL_ARB_point_sprite */
+/* ------------------------ GL_ARB_point_parameters ------------------------ */
+#ifndef GL_ARB_point_parameters
+#define GL_ARB_point_parameters 1
+// All state enums used are the same as GL 1.4 standard ones
+typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
+typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, GLfloat *params);
+#define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters)
+#define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB)
+#define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB)
+
+#endif /* GL_ARB_point_parameters */
+/* ------------------------------------------------------------------------- */
+/* ------------------------ GL_EXT_point_parameters ------------------------ */
+#ifndef GL_EXT_point_parameters
+#define GL_EXT_point_parameters 1
+// All state enums used are the same as GL 1.4 standard ones
+typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
+typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
+#define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters)
+#define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT)
+#define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT)
+
+#endif /* GL_EXT_point_parameters */
+/* ------------------------------------------------------------------------- */
+/* ------------------------ GL_EXT_texture_lod_bias ---------------------------- */
+#ifndef GL_EXT_texture_lod_bias
+#define GL_EXT_texture_lod_bias 1
+
+#define GL_MAX_TEXTURE_LOD_BIAS_EXT       0x84FD
+#define GL_TEXTURE_FILTER_CONTROL_EXT     0x8500
+#define GL_TEXTURE_LOD_BIAS_EXT           0x8501
+
+#define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias)
+
+#endif /* GL_EXT_texture_lod_bias */
+
+// End SJS Additions
+
+
+#if defined(GLEW_MX) && defined(_WIN32)
+#define GLEW_FUN_EXPORT
+#else
+#define GLEW_FUN_EXPORT GLEWAPI
+#endif /* GLEW_MX */
+
+#if defined(GLEW_MX)
+#define GLEW_VAR_EXPORT
+#else
+#define GLEW_VAR_EXPORT GLEWAPI
+#endif /* GLEW_MX */
+
+#if defined(GLEW_MX) && defined(_WIN32)
+struct GLEWContextStruct
+{
+#endif /* GLEW_MX */
+
+GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D;
+GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements;
+GLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D;
+GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D;
+
+GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture;
+GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D;
+GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage;
+GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd;
+GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf;
+GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd;
+GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv;
+GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage;
+
+GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor;
+GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation;
+GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate;
+GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer;
+GLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd;
+GLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv;
+GLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf;
+GLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv;
+GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays;
+GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements;
+GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf;
+GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer;
+GLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d;
+GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv;
+GLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f;
+GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv;
+GLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i;
+GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv;
+GLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s;
+GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv;
+GLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d;
+GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv;
+GLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f;
+GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv;
+GLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i;
+GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv;
+GLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s;
+GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv;
+
+GLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery;
+GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer;
+GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData;
+GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData;
+GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers;
+GLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries;
+GLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery;
+GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers;
+GLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries;
+GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv;
+GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv;
+GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData;
+GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv;
+GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv;
+GLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv;
+GLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer;
+GLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery;
+GLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer;
+GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer;
+
+GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader;
+GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation;
+GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate;
+GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader;
+GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram;
+GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader;
+GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram;
+GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader;
+GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader;
+GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray;
+GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers;
+GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray;
+GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib;
+GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform;
+GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders;
+GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation;
+GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog;
+GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv;
+GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog;
+GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource;
+GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv;
+GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation;
+GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv;
+GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv;
+GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv;
+GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv;
+GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv;
+GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv;
+GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram;
+GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader;
+GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram;
+GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource;
+GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate;
+GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate;
+GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate;
+GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f;
+GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv;
+GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i;
+GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv;
+GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f;
+GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv;
+GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i;
+GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv;
+GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f;
+GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv;
+GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i;
+GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv;
+GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f;
+GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv;
+GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i;
+GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv;
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv;
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv;
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv;
+GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram;
+GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer;
+
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv;
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv;
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv;
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv;
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv;
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv;
+
+GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB;
+
+GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB;
+
+GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB;
+GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB;
+
+GLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB;
+GLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB;
+GLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB;
+GLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB;
+GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB;
+GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB;
+GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB;
+GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB;
+
+GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB;
+GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB;
+GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB;
+GLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB;
+GLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB;
+GLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB;
+GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB;
+GLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB;
+GLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB;
+GLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB;
+GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB;
+GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB;
+GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB;
+GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB;
+GLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB;
+GLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB;
+GLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB;
+GLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB;
+GLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB;
+GLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB;
+GLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB;
+GLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB;
+GLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB;
+GLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB;
+GLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB;
+GLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB;
+GLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB;
+GLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB;
+GLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB;
+GLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB;
+GLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB;
+GLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB;
+GLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB;
+GLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB;
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB;
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB;
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB;
+GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB;
+GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB;
+
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB;
+GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB;
+
+GLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB;
+GLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB;
+GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB;
+GLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB;
+GLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB;
+GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB;
+GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB;
+GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB;
+GLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB;
+GLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB;
+GLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB;
+
+GLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB;
+GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB;
+GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB;
+GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB;
+GLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB;
+GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB;
+GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB;
+GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB;
+GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB;
+GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB;
+GLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB;
+GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB;
+GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB;
+GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB;
+GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB;
+GLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB;
+GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB;
+GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB;
+GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB;
+GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB;
+GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB;
+GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB;
+GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB;
+GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB;
+GLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB;
+
+GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB;
+GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB;
+GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB;
+
+GLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI;
+
+GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI;
+GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI;
+GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI;
+GLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI;
+GLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI;
+GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI;
+GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI;
+GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI;
+GLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI;
+GLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI;
+GLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI;
+GLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI;
+GLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI;
+GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI;
+
+GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT;
+GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT;
+GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT;
+GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT;
+GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT;
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT;
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT;
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT;
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT;
+GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT;
+GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT;
+GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT;
+GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT;
+GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT;
+GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT;
+GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT;
+GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT;
+
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT;
+GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT;
+
+GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT;
+
+GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV;
+GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV;
+
+GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV;
+GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV;
+GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV;
+GLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV;
+GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV;
+GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV;
+GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV;
+
+GLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV;
+GLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV;
+GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV;
+GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV;
+GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV;
+GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV;
+GLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV;
+GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV;
+GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV;
+GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV;
+GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV;
+GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV;
+GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV;
+
+GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV;
+GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV;
+
+GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV;
+GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV;
+GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV;
+GLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV;
+GLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV;
+GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV;
+GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV;
+GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV;
+GLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV;
+GLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV;
+GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV;
+GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV;
+GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV;
+GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV;
+GLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV;
+GLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV;
+GLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV;
+GLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV;
+// SJS
+GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT;
+GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT;
+GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB;
+GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB;
+// SJS
+
+#if defined(GLEW_MX) && !defined(_WIN32)
+struct GLEWContextStruct
+{
+#endif /* GLEW_MX */
+
+GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1;
+GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2;
+GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3;
+GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4;
+GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5;
+GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0;
+GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader;
+GLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers;
+GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader;
+GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3;
+GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap;
+// Added for OGRE by SJS
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias;
+// End additions
+#ifdef GLEW_MX
+}; /* GLEWContextStruct */
+#endif /* GLEW_MX */
+
+/* ------------------------------------------------------------------------- */
+
+/* error codes */
+#define GLEW_OK 0
+#define GLEW_NO_ERROR 0
+#define GLEW_ERROR_NO_GL_VERSION 1  /* missing GL version */
+#define GLEW_ERROR_GL_VERSION_10_ONLY 2  /* GL 1.1 and up are not supported */
+#define GLEW_ERROR_GLX_VERSION_11_ONLY 3  /* GLX 1.2 and up are not supported */
+
+/* string codes */
+#define GLEW_VERSION 1
+
+/* API */
+#ifdef GLEW_MX
+
+typedef struct GLEWContextStruct GLEWContext;
+GLEWAPI GLboolean glewContextIsSupported (GLEWContext* ctx, const char* name);
+
+#define glewInit() glewContextInit(glewGetContext())
+#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x)
+#define glewIsExtensionSupported(x) glewIsSupported(x)
+
+#ifdef _WIN32
+#  define GLEW_GET_VAR(x) glewGetContext()->x
+#  define GLEW_GET_FUN(x) glewGetContext()->x
+#else
+#  define GLEW_GET_VAR(x) glewGetContext()->x
+#  define GLEW_GET_FUN(x) x
+#endif
+
+#else /* GLEW_MX */
+
+GLEWAPI GLenum glewInit ();
+GLEWAPI GLboolean glewIsSupported (const char* name);
+#define glewIsExtensionSupported(x) glewIsSupported(x)
+
+#define GLEW_GET_VAR(x) x
+#define GLEW_GET_FUN(x) x
+
+#endif /* GLEW_MX */
+
+/*
+GLEWAPI GLboolean glewExperimental;
+GLEWAPI GLboolean glewGetExtension (const char* name);
+GLEWAPI const GLubyte* glewGetErrorString (GLenum error);
+GLEWAPI const GLubyte* glewGetString (GLenum name);
+*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef GLEW_APIENTRY_DEFINED
+#undef GLEW_APIENTRY_DEFINED
+#undef APIENTRY
+#undef GLAPIENTRY
+#endif
+
+#ifdef GLEW_CALLBACK_DEFINED
+#undef GLEW_CALLBACK_DEFINED
+#undef CALLBACK
+#endif
+
+#ifdef GLEW_WINGDIAPI_DEFINED
+#undef GLEW_WINGDIAPI_DEFINED
+#undef WINGDIAPI
+#endif
+
+#undef GLAPI
+/* #undef GLEWAPI */
+
+#endif /* __glew_h__ */
Index: /RenderSystems/GL/include/GL/glext.h
===================================================================
--- /RenderSystems/GL/include/GL/glext.h	(revision 5)
+++ /RenderSystems/GL/include/GL/glext.h	(revision 5)
@@ -0,0 +1,6030 @@
+#ifndef __glext_h_
+#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 <windows.h>
+#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 2004/7/26 */
+/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
+#define GL_GLEXT_VERSION 24
+
+#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_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_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_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
+
+
+/*************************************************************/
+
+#include <stddef.h>
+#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 characters */
+typedef char GLcharARB;		/* native character */
+typedef unsigned int GLhandleARB;	/* shader object handle */
+#endif
+
+#ifndef GL_NV_half_float
+/* GL type for representing NVIDIA "half" floating point type in host memory */
+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_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_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_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
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
Index: /RenderSystems/GL/include/GL/glxext.h
===================================================================
--- /RenderSystems/GL/include/GL/glxext.h	(revision 5)
+++ /RenderSystems/GL/include/GL/glxext.h	(revision 5)
@@ -0,0 +1,681 @@
+#ifndef __glxext_h_
+#define __glxext_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 <windows.h>
+#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 */
+/* glxext.h last updated 2004/08/24 */
+/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
+#define GLX_GLXEXT_VERSION 7
+
+#ifndef GLX_VERSION_1_3
+#define GLX_WINDOW_BIT                     0x00000001
+#define GLX_PIXMAP_BIT                     0x00000002
+#define GLX_PBUFFER_BIT                    0x00000004
+#define GLX_RGBA_BIT                       0x00000001
+#define GLX_COLOR_INDEX_BIT                0x00000002
+#define GLX_PBUFFER_CLOBBER_MASK           0x08000000
+#define GLX_FRONT_LEFT_BUFFER_BIT          0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT         0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT           0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT          0x00000008
+#define GLX_AUX_BUFFERS_BIT                0x00000010
+#define GLX_DEPTH_BUFFER_BIT               0x00000020
+#define GLX_STENCIL_BUFFER_BIT             0x00000040
+#define GLX_ACCUM_BUFFER_BIT               0x00000080
+#define GLX_CONFIG_CAVEAT                  0x20
+#define GLX_X_VISUAL_TYPE                  0x22
+#define GLX_TRANSPARENT_TYPE               0x23
+#define GLX_TRANSPARENT_INDEX_VALUE        0x24
+#define GLX_TRANSPARENT_RED_VALUE          0x25
+#define GLX_TRANSPARENT_GREEN_VALUE        0x26
+#define GLX_TRANSPARENT_BLUE_VALUE         0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE        0x28
+#define GLX_DONT_CARE                      0xFFFFFFFF
+#define GLX_NONE                           0x8000
+#define GLX_SLOW_CONFIG                    0x8001
+#define GLX_TRUE_COLOR                     0x8002
+#define GLX_DIRECT_COLOR                   0x8003
+#define GLX_PSEUDO_COLOR                   0x8004
+#define GLX_STATIC_COLOR                   0x8005
+#define GLX_GRAY_SCALE                     0x8006
+#define GLX_STATIC_GRAY                    0x8007
+#define GLX_TRANSPARENT_RGB                0x8008
+#define GLX_TRANSPARENT_INDEX              0x8009
+#define GLX_VISUAL_ID                      0x800B
+#define GLX_SCREEN                         0x800C
+#define GLX_NON_CONFORMANT_CONFIG          0x800D
+#define GLX_DRAWABLE_TYPE                  0x8010
+#define GLX_RENDER_TYPE                    0x8011
+#define GLX_X_RENDERABLE                   0x8012
+#define GLX_FBCONFIG_ID                    0x8013
+#define GLX_RGBA_TYPE                      0x8014
+#define GLX_COLOR_INDEX_TYPE               0x8015
+#define GLX_MAX_PBUFFER_WIDTH              0x8016
+#define GLX_MAX_PBUFFER_HEIGHT             0x8017
+#define GLX_MAX_PBUFFER_PIXELS             0x8018
+#define GLX_PRESERVED_CONTENTS             0x801B
+#define GLX_LARGEST_PBUFFER                0x801C
+#define GLX_WIDTH                          0x801D
+#define GLX_HEIGHT                         0x801E
+#define GLX_EVENT_MASK                     0x801F
+#define GLX_DAMAGED                        0x8020
+#define GLX_SAVED                          0x8021
+#define GLX_WINDOW                         0x8022
+#define GLX_PBUFFER                        0x8023
+#define GLX_PBUFFER_HEIGHT                 0x8040
+#define GLX_PBUFFER_WIDTH                  0x8041
+#endif
+
+#ifndef GLX_VERSION_1_4
+#define GLX_SAMPLE_BUFFERS                 100000
+#define GLX_SAMPLES                        100001
+#endif
+
+#ifndef GLX_ARB_get_proc_address
+#endif
+
+#ifndef GLX_ARB_multisample
+#define GLX_SAMPLE_BUFFERS_ARB             100000
+#define GLX_SAMPLES_ARB                    100001
+#endif
+
+#ifndef GLX_SGIS_multisample
+#define GLX_SAMPLE_BUFFERS_SGIS            100000
+#define GLX_SAMPLES_SGIS                   100001
+#endif
+
+#ifndef GLX_EXT_visual_info
+#define GLX_X_VISUAL_TYPE_EXT              0x22
+#define GLX_TRANSPARENT_TYPE_EXT           0x23
+#define GLX_TRANSPARENT_INDEX_VALUE_EXT    0x24
+#define GLX_TRANSPARENT_RED_VALUE_EXT      0x25
+#define GLX_TRANSPARENT_GREEN_VALUE_EXT    0x26
+#define GLX_TRANSPARENT_BLUE_VALUE_EXT     0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE_EXT    0x28
+#define GLX_NONE_EXT                       0x8000
+#define GLX_TRUE_COLOR_EXT                 0x8002
+#define GLX_DIRECT_COLOR_EXT               0x8003
+#define GLX_PSEUDO_COLOR_EXT               0x8004
+#define GLX_STATIC_COLOR_EXT               0x8005
+#define GLX_GRAY_SCALE_EXT                 0x8006
+#define GLX_STATIC_GRAY_EXT                0x8007
+#define GLX_TRANSPARENT_RGB_EXT            0x8008
+#define GLX_TRANSPARENT_INDEX_EXT          0x8009
+#endif
+
+#ifndef GLX_SGI_swap_control
+#endif
+
+#ifndef GLX_SGI_video_sync
+#endif
+
+#ifndef GLX_SGI_make_current_read
+#endif
+
+#ifndef GLX_SGIX_video_source
+#endif
+
+#ifndef GLX_EXT_visual_rating
+#define GLX_VISUAL_CAVEAT_EXT              0x20
+#define GLX_SLOW_VISUAL_EXT                0x8001
+#define GLX_NON_CONFORMANT_VISUAL_EXT      0x800D
+/* reuse GLX_NONE_EXT */
+#endif
+
+#ifndef GLX_EXT_import_context
+#define GLX_SHARE_CONTEXT_EXT              0x800A
+#define GLX_VISUAL_ID_EXT                  0x800B
+#define GLX_SCREEN_EXT                     0x800C
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+#define GLX_WINDOW_BIT_SGIX                0x00000001
+#define GLX_PIXMAP_BIT_SGIX                0x00000002
+#define GLX_RGBA_BIT_SGIX                  0x00000001
+#define GLX_COLOR_INDEX_BIT_SGIX           0x00000002
+#define GLX_DRAWABLE_TYPE_SGIX             0x8010
+#define GLX_RENDER_TYPE_SGIX               0x8011
+#define GLX_X_RENDERABLE_SGIX              0x8012
+#define GLX_FBCONFIG_ID_SGIX               0x8013
+#define GLX_RGBA_TYPE_SGIX                 0x8014
+#define GLX_COLOR_INDEX_TYPE_SGIX          0x8015
+/* reuse GLX_SCREEN_EXT */
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+#define GLX_PBUFFER_BIT_SGIX               0x00000004
+#define GLX_BUFFER_CLOBBER_MASK_SGIX       0x08000000
+#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX     0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX    0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT_SGIX      0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX     0x00000008
+#define GLX_AUX_BUFFERS_BIT_SGIX           0x00000010
+#define GLX_DEPTH_BUFFER_BIT_SGIX          0x00000020
+#define GLX_STENCIL_BUFFER_BIT_SGIX        0x00000040
+#define GLX_ACCUM_BUFFER_BIT_SGIX          0x00000080
+#define GLX_SAMPLE_BUFFERS_BIT_SGIX        0x00000100
+#define GLX_MAX_PBUFFER_WIDTH_SGIX         0x8016
+#define GLX_MAX_PBUFFER_HEIGHT_SGIX        0x8017
+#define GLX_MAX_PBUFFER_PIXELS_SGIX        0x8018
+#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX     0x8019
+#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX    0x801A
+#define GLX_PRESERVED_CONTENTS_SGIX        0x801B
+#define GLX_LARGEST_PBUFFER_SGIX           0x801C
+#define GLX_WIDTH_SGIX                     0x801D
+#define GLX_HEIGHT_SGIX                    0x801E
+#define GLX_EVENT_MASK_SGIX                0x801F
+#define GLX_DAMAGED_SGIX                   0x8020
+#define GLX_SAVED_SGIX                     0x8021
+#define GLX_WINDOW_SGIX                    0x8022
+#define GLX_PBUFFER_SGIX                   0x8023
+#endif
+
+#ifndef GLX_SGI_cushion
+#endif
+
+#ifndef GLX_SGIX_video_resize
+#define GLX_SYNC_FRAME_SGIX                0x00000000
+#define GLX_SYNC_SWAP_SGIX                 0x00000001
+#endif
+
+#ifndef GLX_SGIX_dmbuffer
+#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX     0x8024
+#endif
+
+#ifndef GLX_SGIX_swap_group
+#endif
+
+#ifndef GLX_SGIX_swap_barrier
+#endif
+
+#ifndef GLX_SGIS_blended_overlay
+#define GLX_BLENDED_RGBA_SGIS              0x8025
+#endif
+
+#ifndef GLX_SGIS_shared_multisample
+#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
+#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
+#endif
+
+#ifndef GLX_SUN_get_transparent_index
+#endif
+
+#ifndef GLX_3DFX_multisample
+#define GLX_SAMPLE_BUFFERS_3DFX            0x8050
+#define GLX_SAMPLES_3DFX                   0x8051
+#endif
+
+#ifndef GLX_MESA_copy_sub_buffer
+#endif
+
+#ifndef GLX_MESA_pixmap_colormap
+#endif
+
+#ifndef GLX_MESA_release_buffers
+#endif
+
+#ifndef GLX_MESA_set_3dfx_mode
+#define GLX_3DFX_WINDOW_MODE_MESA          0x1
+#define GLX_3DFX_FULLSCREEN_MODE_MESA      0x2
+#endif
+
+#ifndef GLX_SGIX_visual_select_group
+#define GLX_VISUAL_SELECT_GROUP_SGIX       0x8028
+#endif
+
+#ifndef GLX_OML_swap_method
+#define GLX_SWAP_METHOD_OML                0x8060
+#define GLX_SWAP_EXCHANGE_OML              0x8061
+#define GLX_SWAP_COPY_OML                  0x8062
+#define GLX_SWAP_UNDEFINED_OML             0x8063
+#endif
+
+#ifndef GLX_OML_sync_control
+#endif
+
+#ifndef GLX_SGIX_hyperpipe
+#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
+#define GLX_BAD_HYPERPIPE_CONFIG_SGIX      91
+#define GLX_BAD_HYPERPIPE_SGIX             92
+#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX    0x00000001
+#define GLX_HYPERPIPE_RENDER_PIPE_SGIX     0x00000002
+#define GLX_PIPE_RECT_SGIX                 0x00000001
+#define GLX_PIPE_RECT_LIMITS_SGIX          0x00000002
+#define GLX_HYPERPIPE_STEREO_SGIX          0x00000003
+#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX   0x00000004
+#define GLX_HYPERPIPE_ID_SGIX              0x8030
+#endif
+
+#ifndef GLX_MESA_agp_offset
+#endif
+
+
+/*************************************************************/
+
+#ifndef GLX_ARB_get_proc_address
+typedef void (*__GLXextFuncPtr)(void);
+#endif
+
+#ifndef GLX_SGIX_video_source
+typedef XID GLXVideoSourceSGIX;
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+typedef XID GLXFBConfigIDSGIX;
+typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+typedef XID GLXPbufferSGIX;
+typedef struct {
+    int type;
+    unsigned long serial;	  /* # of last request processed by server */
+    Bool send_event;		  /* true if this came for SendEvent request */
+    Display *display;		  /* display the event was read from */
+    GLXDrawable drawable;	  /* i.d. of Drawable */
+    int event_type;		  /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
+    int draw_type;		  /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
+    unsigned int mask;	  /* mask indicating which buffers are affected*/
+    int x, y;
+    int width, height;
+    int count;		  /* if nonzero, at least this many more */
+} GLXBufferClobberEventSGIX;
+#endif
+
+#ifndef GLX_VERSION_1_3
+#define GLX_VERSION_1_3 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXFBConfig * glXGetFBConfigs (Display *, int, int *);
+extern GLXFBConfig * glXChooseFBConfig (Display *, int, const int *, int *);
+extern int glXGetFBConfigAttrib (Display *, GLXFBConfig, int, int *);
+extern XVisualInfo * glXGetVisualFromFBConfig (Display *, GLXFBConfig);
+extern GLXWindow glXCreateWindow (Display *, GLXFBConfig, Window, const int *);
+extern void glXDestroyWindow (Display *, GLXWindow);
+extern GLXPixmap glXCreatePixmap (Display *, GLXFBConfig, Pixmap, const int *);
+extern void glXDestroyPixmap (Display *, GLXPixmap);
+extern GLXPbuffer glXCreatePbuffer (Display *, GLXFBConfig, const int *);
+extern void glXDestroyPbuffer (Display *, GLXPbuffer);
+extern void glXQueryDrawable (Display *, GLXDrawable, int, unsigned int *);
+extern GLXContext glXCreateNewContext (Display *, GLXFBConfig, int, GLXContext, Bool);
+extern Bool glXMakeContextCurrent (Display *, GLXDrawable, GLXDrawable, GLXContext);
+extern GLXDrawable glXGetCurrentReadDrawable (void);
+extern Display * glXGetCurrentDisplay (void);
+extern int glXQueryContext (Display *, GLXContext, int, int *);
+extern void glXSelectEvent (Display *, GLXDrawable, unsigned long);
+extern void glXGetSelectedEvent (Display *, GLXDrawable, unsigned long *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
+typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
+typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
+typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
+typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
+typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
+typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
+typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
+typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
+typedef Display * ( * PFNGLXGETCURRENTDISPLAYPROC) (void);
+typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
+typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
+typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
+#endif
+
+#ifndef GLX_VERSION_1_4
+#define GLX_VERSION_1_4 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
+#endif
+
+#ifndef GLX_ARB_get_proc_address
+#define GLX_ARB_get_proc_address 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
+#endif
+
+#ifndef GLX_ARB_multisample
+#define GLX_ARB_multisample 1
+#endif
+
+#ifndef GLX_SGIS_multisample
+#define GLX_SGIS_multisample 1
+#endif
+
+#ifndef GLX_EXT_visual_info
+#define GLX_EXT_visual_info 1
+#endif
+
+#ifndef GLX_SGI_swap_control
+#define GLX_SGI_swap_control 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXSwapIntervalSGI (int);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
+#endif
+
+#ifndef GLX_SGI_video_sync
+#define GLX_SGI_video_sync 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXGetVideoSyncSGI (unsigned int *);
+extern int glXWaitVideoSyncSGI (int, int, unsigned int *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);
+typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);
+#endif
+
+#ifndef GLX_SGI_make_current_read
+#define GLX_SGI_make_current_read 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXMakeCurrentReadSGI (Display *, GLXDrawable, GLXDrawable, GLXContext);
+extern GLXDrawable glXGetCurrentReadDrawableSGI (void);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
+#endif
+
+#ifndef GLX_SGIX_video_source
+#define GLX_SGIX_video_source 1
+#ifdef _VL_H
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *, int, VLServer, VLPath, int, VLNode);
+extern void glXDestroyGLXVideoSourceSGIX (Display *, GLXVideoSourceSGIX);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
+typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource);
+#endif /* _VL_H */
+#endif
+
+#ifndef GLX_EXT_visual_rating
+#define GLX_EXT_visual_rating 1
+#endif
+
+#ifndef GLX_EXT_import_context
+#define GLX_EXT_import_context 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Display * glXGetCurrentDisplayEXT (void);
+extern int glXQueryContextInfoEXT (Display *, GLXContext, int, int *);
+extern GLXContextID glXGetContextIDEXT (const GLXContext);
+extern GLXContext glXImportContextEXT (Display *, GLXContextID);
+extern void glXFreeContextEXT (Display *, GLXContext);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void);
+typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);
+typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
+typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
+typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+#define GLX_SGIX_fbconfig 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXGetFBConfigAttribSGIX (Display *, GLXFBConfigSGIX, int, int *);
+extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *, int, int *, int *);
+extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *, GLXFBConfigSGIX, Pixmap);
+extern GLXContext glXCreateContextWithConfigSGIX (Display *, GLXFBConfigSGIX, int, GLXContext, Bool);
+extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *, GLXFBConfigSGIX);
+extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *, XVisualInfo *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
+typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);
+typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
+typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
+typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config);
+typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis);
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+#define GLX_SGIX_pbuffer 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *);
+extern void glXDestroyGLXPbufferSGIX (Display *, GLXPbufferSGIX);
+extern int glXQueryGLXPbufferSGIX (Display *, GLXPbufferSGIX, int, unsigned int *);
+extern void glXSelectEventSGIX (Display *, GLXDrawable, unsigned long);
+extern void glXGetSelectedEventSGIX (Display *, GLXDrawable, unsigned long *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
+typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf);
+typedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
+typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask);
+typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask);
+#endif
+
+#ifndef GLX_SGI_cushion
+#define GLX_SGI_cushion 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXCushionSGI (Display *, Window, float);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion);
+#endif
+
+#ifndef GLX_SGIX_video_resize
+#define GLX_SGIX_video_resize 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXBindChannelToWindowSGIX (Display *, int, int, Window);
+extern int glXChannelRectSGIX (Display *, int, int, int, int, int, int);
+extern int glXQueryChannelRectSGIX (Display *, int, int, int *, int *, int *, int *);
+extern int glXQueryChannelDeltasSGIX (Display *, int, int, int *, int *, int *, int *);
+extern int glXChannelRectSyncSGIX (Display *, int, int, GLenum);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window);
+typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h);
+typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
+typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
+typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype);
+#endif
+
+#ifndef GLX_SGIX_dmbuffer
+#define GLX_SGIX_dmbuffer 1
+#ifdef _DM_BUFFER_H_
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXAssociateDMPbufferSGIX (Display *, GLXPbufferSGIX, DMparams *, DMbuffer);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
+#endif /* _DM_BUFFER_H_ */
+#endif
+
+#ifndef GLX_SGIX_swap_group
+#define GLX_SGIX_swap_group 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXJoinSwapGroupSGIX (Display *, GLXDrawable, GLXDrawable);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
+#endif
+
+#ifndef GLX_SGIX_swap_barrier
+#define GLX_SGIX_swap_barrier 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXBindSwapBarrierSGIX (Display *, GLXDrawable, int);
+extern Bool glXQueryMaxSwapBarriersSGIX (Display *, int, int *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
+typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
+#endif
+
+#ifndef GLX_SUN_get_transparent_index
+#define GLX_SUN_get_transparent_index 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Status glXGetTransparentIndexSUN (Display *, Window, Window, long *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
+#endif
+
+#ifndef GLX_MESA_copy_sub_buffer
+#define GLX_MESA_copy_sub_buffer 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXCopySubBufferMESA (Display *, GLXDrawable, int, int, int, int);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
+#endif
+
+#ifndef GLX_MESA_pixmap_colormap
+#define GLX_MESA_pixmap_colormap 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXPixmap glXCreateGLXPixmapMESA (Display *, XVisualInfo *, Pixmap, Colormap);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
+#endif
+
+#ifndef GLX_MESA_release_buffers
+#define GLX_MESA_release_buffers 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXReleaseBuffersMESA (Display *, GLXDrawable);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
+#endif
+
+#ifndef GLX_MESA_set_3dfx_mode
+#define GLX_MESA_set_3dfx_mode 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXSet3DfxModeMESA (int);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
+#endif
+
+#ifndef GLX_SGIX_visual_select_group
+#define GLX_SGIX_visual_select_group 1
+#endif
+
+#ifndef GLX_OML_swap_method
+#define GLX_OML_swap_method 1
+#endif
+
+#ifndef GLX_OML_sync_control
+#define GLX_OML_sync_control 1
+#if defined(__STDC_VERSION__)
+#if __STDC_VERSION__ >= 199901L
+/* Include ISO C99 integer types for OML_sync_control; need a better test */
+#include <inttypes.h>
+
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *);
+extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *);
+extern int64_t glXSwapBuffersMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t);
+extern Bool glXWaitForMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t, int64_t *, int64_t *, int64_t *);
+extern Bool glXWaitForSbcOML (Display *, GLXDrawable, int64_t, int64_t *, int64_t *, int64_t *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
+typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
+typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
+typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
+typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
+#endif /* C99 version test */
+#endif /* STDC test */
+#endif
+
+#ifndef GLX_SGIX_hyperpipe
+#define GLX_SGIX_hyperpipe 1
+
+typedef struct {
+    char    pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+    int     networkId;
+} GLXHyperpipeNetworkSGIX;
+
+typedef struct {
+    char    pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+    int     channel;
+    unsigned int
+      participationType;
+    int     timeSlice;
+} GLXHyperpipeConfigSGIX;
+
+typedef struct {
+    char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+    int srcXOrigin, srcYOrigin, srcWidth, srcHeight;
+    int destXOrigin, destYOrigin, destWidth, destHeight;
+} GLXPipeRect;
+
+typedef struct {
+    char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+    int XOrigin, YOrigin, maxHeight, maxWidth;
+} GLXPipeRectLimits;
+
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *, int *);
+extern int glXHyperpipeConfigSGIX (Display *, int, int, GLXHyperpipeConfigSGIX *, int *);
+extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *, int, int *);
+extern int glXDestroyHyperpipeConfigSGIX (Display *, int);
+extern int glXBindHyperpipeSGIX (Display *, int);
+extern int glXQueryHyperpipeBestAttribSGIX (Display *, int, int, int, void *, void *);
+extern int glXHyperpipeAttribSGIX (Display *, int, int, int, void *);
+extern int glXQueryHyperpipeAttribSGIX (Display *, int, int, int, void *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
+typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
+typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);
+typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);
+typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);
+typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
+typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
+typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
+#endif
+
+#ifndef GLX_MESA_agp_offset
+#define GLX_MESA_agp_offset 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern unsigned int glXGetAGPOffsetMESA (const void *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
Index: /RenderSystems/GL/include/GL/glxtokens.h
===================================================================
--- /RenderSystems/GL/include/GL/glxtokens.h	(revision 5)
+++ /RenderSystems/GL/include/GL/glxtokens.h	(revision 5)
@@ -0,0 +1,231 @@
+#ifndef __GLX_glxtokens_h__
+#define __GLX_glxtokens_h__
+
+/* $XFree86: xc/include/GL/glxtokens.h,v 1.5 2001/03/21 15:51:38 dawes Exp $ */
+/*
+** 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-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+** 
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. 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.
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define GLX_VERSION_1_1 1
+#define GLX_VERSION_1_2 1
+#define GLX_VERSION_1_3 1
+#define GLX_VERSION_1_4 1
+
+/*
+** Visual Config Attributes (glXGetConfig, glXGetFBConfigAttrib)
+*/
+#define GLX_USE_GL		1	/* support GLX rendering */
+#define GLX_BUFFER_SIZE		2	/* depth of the color buffer */
+#define GLX_LEVEL		3	/* level in plane stacking */
+#define GLX_RGBA		4	/* true if RGBA mode */
+#define GLX_DOUBLEBUFFER	5	/* double buffering supported */
+#define GLX_STEREO		6	/* stereo buffering supported */
+#define GLX_AUX_BUFFERS		7	/* number of aux buffers */
+#define GLX_RED_SIZE		8	/* number of red component bits */
+#define GLX_GREEN_SIZE		9	/* number of green component bits */
+#define GLX_BLUE_SIZE		10	/* number of blue component bits */
+#define GLX_ALPHA_SIZE		11	/* number of alpha component bits */
+#define GLX_DEPTH_SIZE		12	/* number of depth bits */
+#define GLX_STENCIL_SIZE	13	/* number of stencil bits */
+#define GLX_ACCUM_RED_SIZE	14	/* number of red accum bits */
+#define GLX_ACCUM_GREEN_SIZE	15	/* number of green accum bits */
+#define GLX_ACCUM_BLUE_SIZE	16	/* number of blue accum bits */
+#define GLX_ACCUM_ALPHA_SIZE	17	/* number of alpha accum bits */
+/*
+** FBConfig-specific attributes
+*/
+#define GLX_X_VISUAL_TYPE		0x22
+#define GLX_CONFIG_CAVEAT		0x20	/* Like visual_info VISUAL_CAVEAT_EXT */
+#define GLX_TRANSPARENT_TYPE		0x23
+#define GLX_TRANSPARENT_INDEX_VALUE	0x24
+#define GLX_TRANSPARENT_RED_VALUE	0x25
+#define GLX_TRANSPARENT_GREEN_VALUE	0x26
+#define GLX_TRANSPARENT_BLUE_VALUE	0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE	0x28
+#define GLX_DRAWABLE_TYPE		0x8010
+#define GLX_RENDER_TYPE			0x8011
+#define GLX_X_RENDERABLE		0x8012
+#define GLX_FBCONFIG_ID			0x8013
+#define GLX_MAX_PBUFFER_WIDTH		0x8016
+#define GLX_MAX_PBUFFER_HEIGHT		0x8017
+#define GLX_MAX_PBUFFER_PIXELS		0x8018
+#define GLX_VISUAL_ID			0x800B
+
+/*
+** Error return values from glXGetConfig.  Success is indicated by
+** a value of 0.
+*/
+#define GLX_BAD_SCREEN		1	/* screen # is bad */
+#define GLX_BAD_ATTRIBUTE	2	/* attribute to get is bad */
+#define GLX_NO_EXTENSION	3	/* no glx extension on server */
+#define GLX_BAD_VISUAL		4	/* visual # not known by GLX */
+#define GLX_BAD_CONTEXT		5	/* returned only by import_context EXT? */
+#define GLX_BAD_VALUE		6	/* returned only by glXSwapIntervalSGI? */
+#define GLX_BAD_ENUM		7	/* unused? */
+
+/* FBConfig attribute values */
+
+/*
+** Generic "don't care" value for glX ChooseFBConfig attributes (except
+** GLX_LEVEL)
+*/
+#define GLX_DONT_CARE			0xFFFFFFFF
+
+/* GLX_RENDER_TYPE bits */
+#define GLX_RGBA_BIT			0x00000001
+#define GLX_COLOR_INDEX_BIT		0x00000002
+
+/* GLX_DRAWABLE_TYPE bits */
+#define GLX_WINDOW_BIT			0x00000001
+#define GLX_PIXMAP_BIT			0x00000002
+#define GLX_PBUFFER_BIT			0x00000004
+
+/* GLX_CONFIG_CAVEAT attribute values */
+#define GLX_NONE			0x8000
+#define GLX_SLOW_CONFIG			0x8001
+#define GLX_NON_CONFORMANT_CONFIG	0x800D
+
+/* GLX_X_VISUAL_TYPE attribute values */
+#define GLX_TRUE_COLOR			0x8002
+#define GLX_DIRECT_COLOR		0x8003
+#define GLX_PSEUDO_COLOR		0x8004
+#define GLX_STATIC_COLOR		0x8005
+#define GLX_GRAY_SCALE			0x8006
+#define GLX_STATIC_GRAY			0x8007
+
+/* GLX_TRANSPARENT_TYPE attribute values */
+/* #define GLX_NONE			   0x8000 */
+#define GLX_TRANSPARENT_RGB		0x8008
+#define GLX_TRANSPARENT_INDEX		0x8009
+
+/* glXCreateGLXPbuffer attributes */
+#define GLX_PRESERVED_CONTENTS		0x801B
+#define GLX_LARGEST_PBUFFER		0x801C
+#define GLX_PBUFFER_HEIGHT		0x8040	/* New for GLX 1.3 */
+#define GLX_PBUFFER_WIDTH		0x8041	/* New for GLX 1.3 */
+
+/* glXQueryGLXPBuffer attributes */
+#define GLX_WIDTH			0x801D
+#define GLX_HEIGHT			0x801E
+#define GLX_EVENT_MASK			0x801F
+
+/* glXCreateNewContext render_type attribute values */
+#define GLX_RGBA_TYPE			0x8014
+#define GLX_COLOR_INDEX_TYPE		0x8015
+
+/* glXQueryContext attributes */
+/* #define GLX_FBCONFIG_ID		  0x8013 */
+/* #define GLX_RENDER_TYPE		  0x8011 */
+#define GLX_SCREEN			0x800C
+
+/* glXSelectEvent event mask bits */
+#define GLX_PBUFFER_CLOBBER_MASK	0x08000000
+
+/* GLXPbufferClobberEvent event_type values */
+#define GLX_DAMAGED			0x8020
+#define GLX_SAVED			0x8021
+
+/* GLXPbufferClobberEvent draw_type values */
+#define GLX_WINDOW			0x8022
+#define GLX_PBUFFER			0x8023
+
+/* GLXPbufferClobberEvent buffer_mask bits */
+#define GLX_FRONT_LEFT_BUFFER_BIT	0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT	0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT	0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT	0x00000008
+#define GLX_AUX_BUFFERS_BIT		0x00000010
+#define GLX_DEPTH_BUFFER_BIT		0x00000020
+#define GLX_STENCIL_BUFFER_BIT		0x00000040
+#define GLX_ACCUM_BUFFER_BIT		0x00000080
+
+/*
+** Extension return values from glXGetConfig.  These are also
+** accepted as parameter values for glXChooseVisual.
+*/
+
+#define GLX_X_VISUAL_TYPE_EXT	0x22	/* visual_info extension type */
+#define GLX_TRANSPARENT_TYPE_EXT 0x23	/* visual_info extension */
+#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24	/* visual_info extension */
+#define GLX_TRANSPARENT_RED_VALUE_EXT	0x25	/* visual_info extension */
+#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26	/* visual_info extension */
+#define GLX_TRANSPARENT_BLUE_VALUE_EXT	0x27	/* visual_info extension */
+#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28	/* visual_info extension */
+
+/* Property values for visual_type */
+#define GLX_TRUE_COLOR_EXT	0x8002
+#define GLX_DIRECT_COLOR_EXT	0x8003
+#define GLX_PSEUDO_COLOR_EXT	0x8004
+#define GLX_STATIC_COLOR_EXT	0x8005
+#define GLX_GRAY_SCALE_EXT	0x8006
+#define GLX_STATIC_GRAY_EXT	0x8007
+
+/* Property values for transparent pixel */
+#define GLX_NONE_EXT		0x8000
+#define GLX_TRANSPARENT_RGB_EXT		0x8008
+#define GLX_TRANSPARENT_INDEX_EXT	0x8009
+
+/* Property values for visual_rating */
+#define GLX_VISUAL_CAVEAT_EXT		0x20  /* visual_rating extension type */
+#define GLX_SLOW_VISUAL_EXT		0x8001
+#define GLX_NON_CONFORMANT_VISUAL_EXT	0x800D
+
+/*
+** Names for attributes to glXGetClientString.
+*/
+#define GLX_VENDOR		0x1
+#define GLX_VERSION		0x2
+#define GLX_EXTENSIONS		0x3
+
+/*
+** Names for attributes to glXQueryContextInfoEXT.
+*/
+#define GLX_SHARE_CONTEXT_EXT	0x800A	/* id of share context */
+#define GLX_VISUAL_ID_EXT	0x800B	/* id of context's visual */
+#define GLX_SCREEN_EXT		0x800C	/* screen number */
+
+/*
+ * GLX 1.4 and later:
+ */
+#define GLX_SAMPLE_BUFFERS_SGIS            100000
+#define GLX_SAMPLES_SGIS                   100001
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !__GLX_glxtokens_h__ */
Index: /RenderSystems/GL/include/GL/wglew.h
===================================================================
--- /RenderSystems/GL/include/GL/wglew.h	(revision 5)
+++ /RenderSystems/GL/include/GL/wglew.h	(revision 5)
@@ -0,0 +1,911 @@
+/*
+** The OpenGL Extension Wrangler Library
+** Copyright (C) 2002-2005, Milan Ikits <milan ikits[]ieee org>
+** Copyright (C) 2002-2005, Marcelo E. Magallon <mmagallo[]debian org>
+** Copyright (C) 2002, Lev Povalahev
+** All rights reserved.
+** 
+** Redistribution and use in source and binary forms, with or without 
+** modification, are permitted provided that the following conditions are met:
+** 
+** * Redistributions of source code must retain the above copyright notice, 
+**   this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright notice, 
+**   this list of conditions and the following disclaimer in the documentation 
+**   and/or other materials provided with the distribution.
+** * The name of the author may be used to endorse or promote products 
+**   derived from this software without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
+** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+** THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __wglew_h__
+#define __wglew_h__
+#define __WGLEW_H__
+
+#ifdef __wglext_h_
+#error wglext.h included before wglew.h
+#endif
+
+#define __wglext_h_
+
+#if !defined(APIENTRY) && !defined(__CYGWIN__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+/*
+ * GLEW_STATIC needs to be set when using the static version.
+ * GLEW_BUILD is set when building the DLL version.
+ */
+#ifdef GLEW_STATIC
+#  define GLEWAPI extern
+#else
+#  ifdef GLEW_BUILD
+#    define GLEWAPI extern __declspec(dllexport)
+#  else
+#    define GLEWAPI extern __declspec(dllimport)
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* -------------------------- WGL_3DFX_multisample ------------------------- */
+
+#ifndef WGL_3DFX_multisample
+#define WGL_3DFX_multisample 1
+
+#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
+#define WGL_SAMPLES_3DFX 0x2061
+
+#define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample)
+
+#endif /* WGL_3DFX_multisample */
+
+/* ------------------------- WGL_ARB_buffer_region ------------------------- */
+
+#ifndef WGL_ARB_buffer_region
+#define WGL_ARB_buffer_region 1
+
+#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
+#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
+#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
+#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
+
+typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
+typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
+typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
+typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
+
+#define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB)
+#define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB)
+#define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB)
+#define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB)
+
+#define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region)
+
+#endif /* WGL_ARB_buffer_region */
+
+/* ----------------------- WGL_ARB_extensions_string ----------------------- */
+
+#ifndef WGL_ARB_extensions_string
+#define WGL_ARB_extensions_string 1
+
+typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
+
+#define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB)
+
+#define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string)
+
+#endif /* WGL_ARB_extensions_string */
+
+/* ----------------------- WGL_ARB_make_current_read ----------------------- */
+
+#ifndef WGL_ARB_make_current_read
+#define WGL_ARB_make_current_read 1
+
+typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID);
+typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+
+#define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB)
+#define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB)
+
+#define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read)
+
+#endif /* WGL_ARB_make_current_read */
+
+/* -------------------------- WGL_ARB_multisample -------------------------- */
+
+#ifndef WGL_ARB_multisample
+#define WGL_ARB_multisample 1
+
+#define WGL_SAMPLE_BUFFERS_ARB 0x2041
+#define WGL_SAMPLES_ARB 0x2042
+
+#define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample)
+
+#endif /* WGL_ARB_multisample */
+
+/* ---------------------------- WGL_ARB_pbuffer ---------------------------- */
+
+#ifndef WGL_ARB_pbuffer
+#define WGL_ARB_pbuffer 1
+
+#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
+#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
+#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
+#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
+#define WGL_PBUFFER_LARGEST_ARB 0x2033
+#define WGL_PBUFFER_WIDTH_ARB 0x2034
+#define WGL_PBUFFER_HEIGHT_ARB 0x2035
+#define WGL_PBUFFER_LOST_ARB 0x2036
+
+DECLARE_HANDLE(HPBUFFERARB);
+
+typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList);
+typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
+typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
+typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue);
+typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
+
+#define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB)
+#define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB)
+#define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB)
+#define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB)
+#define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB)
+
+#define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer)
+
+#endif /* WGL_ARB_pbuffer */
+
+/* -------------------------- WGL_ARB_pixel_format ------------------------- */
+
+#ifndef WGL_ARB_pixel_format
+#define WGL_ARB_pixel_format 1
+
+#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
+#define WGL_DRAW_TO_WINDOW_ARB 0x2001
+#define WGL_DRAW_TO_BITMAP_ARB 0x2002
+#define WGL_ACCELERATION_ARB 0x2003
+#define WGL_NEED_PALETTE_ARB 0x2004
+#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
+#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
+#define WGL_SWAP_METHOD_ARB 0x2007
+#define WGL_NUMBER_OVERLAYS_ARB 0x2008
+#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
+#define WGL_TRANSPARENT_ARB 0x200A
+#define WGL_SHARE_DEPTH_ARB 0x200C
+#define WGL_SHARE_STENCIL_ARB 0x200D
+#define WGL_SHARE_ACCUM_ARB 0x200E
+#define WGL_SUPPORT_GDI_ARB 0x200F
+#define WGL_SUPPORT_OPENGL_ARB 0x2010
+#define WGL_DOUBLE_BUFFER_ARB 0x2011
+#define WGL_STEREO_ARB 0x2012
+#define WGL_PIXEL_TYPE_ARB 0x2013
+#define WGL_COLOR_BITS_ARB 0x2014
+#define WGL_RED_BITS_ARB 0x2015
+#define WGL_RED_SHIFT_ARB 0x2016
+#define WGL_GREEN_BITS_ARB 0x2017
+#define WGL_GREEN_SHIFT_ARB 0x2018
+#define WGL_BLUE_BITS_ARB 0x2019
+#define WGL_BLUE_SHIFT_ARB 0x201A
+#define WGL_ALPHA_BITS_ARB 0x201B
+#define WGL_ALPHA_SHIFT_ARB 0x201C
+#define WGL_ACCUM_BITS_ARB 0x201D
+#define WGL_ACCUM_RED_BITS_ARB 0x201E
+#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
+#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
+#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
+#define WGL_DEPTH_BITS_ARB 0x2022
+#define WGL_STENCIL_BITS_ARB 0x2023
+#define WGL_AUX_BUFFERS_ARB 0x2024
+#define WGL_NO_ACCELERATION_ARB 0x2025
+#define WGL_GENERIC_ACCELERATION_ARB 0x2026
+#define WGL_FULL_ACCELERATION_ARB 0x2027
+#define WGL_SWAP_EXCHANGE_ARB 0x2028
+#define WGL_SWAP_COPY_ARB 0x2029
+#define WGL_SWAP_UNDEFINED_ARB 0x202A
+#define WGL_TYPE_RGBA_ARB 0x202B
+#define WGL_TYPE_COLORINDEX_ARB 0x202C
+#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
+#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
+#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
+#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
+#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
+
+typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues);
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues);
+
+#define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB)
+#define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB)
+#define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB)
+
+#define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format)
+
+#endif /* WGL_ARB_pixel_format */
+
+/* ----------------------- WGL_ARB_pixel_format_float ---------------------- */
+
+#ifndef WGL_ARB_pixel_format_float
+#define WGL_ARB_pixel_format_float 1
+
+#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
+
+#define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float)
+
+#endif /* WGL_ARB_pixel_format_float */
+
+/* ------------------------- WGL_ARB_render_texture ------------------------ */
+
+#ifndef WGL_ARB_render_texture
+#define WGL_ARB_render_texture 1
+
+#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
+#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
+#define WGL_TEXTURE_FORMAT_ARB 0x2072
+#define WGL_TEXTURE_TARGET_ARB 0x2073
+#define WGL_MIPMAP_TEXTURE_ARB 0x2074
+#define WGL_TEXTURE_RGB_ARB 0x2075
+#define WGL_TEXTURE_RGBA_ARB 0x2076
+#define WGL_NO_TEXTURE_ARB 0x2077
+#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
+#define WGL_TEXTURE_1D_ARB 0x2079
+#define WGL_TEXTURE_2D_ARB 0x207A
+#define WGL_MIPMAP_LEVEL_ARB 0x207B
+#define WGL_CUBE_MAP_FACE_ARB 0x207C
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
+#define WGL_FRONT_LEFT_ARB 0x2083
+#define WGL_FRONT_RIGHT_ARB 0x2084
+#define WGL_BACK_LEFT_ARB 0x2085
+#define WGL_BACK_RIGHT_ARB 0x2086
+#define WGL_AUX0_ARB 0x2087
+#define WGL_AUX1_ARB 0x2088
+#define WGL_AUX2_ARB 0x2089
+#define WGL_AUX3_ARB 0x208A
+#define WGL_AUX4_ARB 0x208B
+#define WGL_AUX5_ARB 0x208C
+#define WGL_AUX6_ARB 0x208D
+#define WGL_AUX7_ARB 0x208E
+#define WGL_AUX8_ARB 0x208F
+#define WGL_AUX9_ARB 0x2090
+
+typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
+typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
+typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList);
+
+#define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB)
+#define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB)
+#define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB)
+
+#define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture)
+
+#endif /* WGL_ARB_render_texture */
+
+/* ----------------------- WGL_ATI_pixel_format_float ---------------------- */
+
+#ifndef WGL_ATI_pixel_format_float
+#define WGL_ATI_pixel_format_float 1
+
+#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
+#define GL_RGBA_FLOAT_MODE_ATI 0x8820
+#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
+
+#define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float)
+
+#endif /* WGL_ATI_pixel_format_float */
+
+/* -------------------- WGL_ATI_render_texture_rectangle ------------------- */
+
+#ifndef WGL_ATI_render_texture_rectangle
+#define WGL_ATI_render_texture_rectangle 1
+
+#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5
+
+#define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle)
+
+#endif /* WGL_ATI_render_texture_rectangle */
+
+/* -------------------------- WGL_EXT_depth_float -------------------------- */
+
+#ifndef WGL_EXT_depth_float
+#define WGL_EXT_depth_float 1
+
+#define WGL_DEPTH_FLOAT_EXT 0x2040
+
+#define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float)
+
+#endif /* WGL_EXT_depth_float */
+
+/* ---------------------- WGL_EXT_display_color_table ---------------------- */
+
+#ifndef WGL_EXT_display_color_table
+#define WGL_EXT_display_color_table 1
+
+typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length);
+
+#define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT)
+#define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT)
+#define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT)
+#define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT)
+
+#define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table)
+
+#endif /* WGL_EXT_display_color_table */
+
+/* ----------------------- WGL_EXT_extensions_string ----------------------- */
+
+#ifndef WGL_EXT_extensions_string
+#define WGL_EXT_extensions_string 1
+
+typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
+
+#define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT)
+
+#define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string)
+
+#endif /* WGL_EXT_extensions_string */
+
+/* ----------------------- WGL_EXT_make_current_read ----------------------- */
+
+#ifndef WGL_EXT_make_current_read
+#define WGL_EXT_make_current_read 1
+
+typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID);
+typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+
+#define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT)
+#define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT)
+
+#define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read)
+
+#endif /* WGL_EXT_make_current_read */
+
+/* -------------------------- WGL_EXT_multisample -------------------------- */
+
+#ifndef WGL_EXT_multisample
+#define WGL_EXT_multisample 1
+
+#define WGL_SAMPLE_BUFFERS_EXT 0x2041
+#define WGL_SAMPLES_EXT 0x2042
+
+#define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample)
+
+#endif /* WGL_EXT_multisample */
+
+/* ---------------------------- WGL_EXT_pbuffer ---------------------------- */
+
+#ifndef WGL_EXT_pbuffer
+#define WGL_EXT_pbuffer 1
+
+#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
+#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
+#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
+#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
+#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
+#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
+#define WGL_PBUFFER_LARGEST_EXT 0x2033
+#define WGL_PBUFFER_WIDTH_EXT 0x2034
+#define WGL_PBUFFER_HEIGHT_EXT 0x2035
+
+DECLARE_HANDLE(HPBUFFEREXT);
+
+typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList);
+typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
+typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
+typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue);
+typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
+
+#define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT)
+#define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT)
+#define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT)
+#define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT)
+#define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT)
+
+#define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer)
+
+#endif /* WGL_EXT_pbuffer */
+
+/* -------------------------- WGL_EXT_pixel_format ------------------------- */
+
+#ifndef WGL_EXT_pixel_format
+#define WGL_EXT_pixel_format 1
+
+#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
+#define WGL_DRAW_TO_WINDOW_EXT 0x2001
+#define WGL_DRAW_TO_BITMAP_EXT 0x2002
+#define WGL_ACCELERATION_EXT 0x2003
+#define WGL_NEED_PALETTE_EXT 0x2004
+#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
+#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
+#define WGL_SWAP_METHOD_EXT 0x2007
+#define WGL_NUMBER_OVERLAYS_EXT 0x2008
+#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
+#define WGL_TRANSPARENT_EXT 0x200A
+#define WGL_TRANSPARENT_VALUE_EXT 0x200B
+#define WGL_SHARE_DEPTH_EXT 0x200C
+#define WGL_SHARE_STENCIL_EXT 0x200D
+#define WGL_SHARE_ACCUM_EXT 0x200E
+#define WGL_SUPPORT_GDI_EXT 0x200F
+#define WGL_SUPPORT_OPENGL_EXT 0x2010
+#define WGL_DOUBLE_BUFFER_EXT 0x2011
+#define WGL_STEREO_EXT 0x2012
+#define WGL_PIXEL_TYPE_EXT 0x2013
+#define WGL_COLOR_BITS_EXT 0x2014
+#define WGL_RED_BITS_EXT 0x2015
+#define WGL_RED_SHIFT_EXT 0x2016
+#define WGL_GREEN_BITS_EXT 0x2017
+#define WGL_GREEN_SHIFT_EXT 0x2018
+#define WGL_BLUE_BITS_EXT 0x2019
+#define WGL_BLUE_SHIFT_EXT 0x201A
+#define WGL_ALPHA_BITS_EXT 0x201B
+#define WGL_ALPHA_SHIFT_EXT 0x201C
+#define WGL_ACCUM_BITS_EXT 0x201D
+#define WGL_ACCUM_RED_BITS_EXT 0x201E
+#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
+#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
+#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
+#define WGL_DEPTH_BITS_EXT 0x2022
+#define WGL_STENCIL_BITS_EXT 0x2023
+#define WGL_AUX_BUFFERS_EXT 0x2024
+#define WGL_NO_ACCELERATION_EXT 0x2025
+#define WGL_GENERIC_ACCELERATION_EXT 0x2026
+#define WGL_FULL_ACCELERATION_EXT 0x2027
+#define WGL_SWAP_EXCHANGE_EXT 0x2028
+#define WGL_SWAP_COPY_EXT 0x2029
+#define WGL_SWAP_UNDEFINED_EXT 0x202A
+#define WGL_TYPE_RGBA_EXT 0x202B
+#define WGL_TYPE_COLORINDEX_EXT 0x202C
+
+typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues);
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues);
+
+#define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT)
+#define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT)
+#define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT)
+
+#define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format)
+
+#endif /* WGL_EXT_pixel_format */
+
+/* -------------------------- WGL_EXT_swap_control ------------------------- */
+
+#ifndef WGL_EXT_swap_control
+#define WGL_EXT_swap_control 1
+
+typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
+typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
+
+#define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT)
+#define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT)
+
+#define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control)
+
+#endif /* WGL_EXT_swap_control */
+
+/* --------------------- WGL_I3D_digital_video_control --------------------- */
+
+#ifndef WGL_I3D_digital_video_control
+#define WGL_I3D_digital_video_control 1
+
+#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
+#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
+#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
+#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
+
+typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue);
+typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue);
+
+#define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D)
+#define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D)
+
+#define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control)
+
+#endif /* WGL_I3D_digital_video_control */
+
+/* ----------------------------- WGL_I3D_gamma ----------------------------- */
+
+#ifndef WGL_I3D_gamma
+#define WGL_I3D_gamma 1
+
+#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
+#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
+
+typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue);
+typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue);
+typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue);
+typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue);
+
+#define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D)
+#define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D)
+#define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D)
+#define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D)
+
+#define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma)
+
+#endif /* WGL_I3D_gamma */
+
+/* ---------------------------- WGL_I3D_genlock ---------------------------- */
+
+#ifndef WGL_I3D_genlock
+#define WGL_I3D_genlock 1
+
+#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
+#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045
+#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046
+#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047
+#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
+#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
+#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
+#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
+#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
+
+typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
+typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource);
+typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag);
+typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay);
+
+#define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D)
+#define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D)
+#define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D)
+#define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D)
+#define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D)
+#define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D)
+#define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D)
+#define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D)
+#define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D)
+#define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D)
+#define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D)
+#define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D)
+
+#define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock)
+
+#endif /* WGL_I3D_genlock */
+
+/* -------------------------- WGL_I3D_image_buffer ------------------------- */
+
+#ifndef WGL_I3D_image_buffer
+#define WGL_I3D_image_buffer 1
+
+#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
+#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
+
+typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count);
+typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
+typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
+typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count);
+
+#define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D)
+#define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D)
+#define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D)
+#define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D)
+
+#define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer)
+
+#endif /* WGL_I3D_image_buffer */
+
+/* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */
+
+#ifndef WGL_I3D_swap_frame_lock
+#define WGL_I3D_swap_frame_lock 1
+
+typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID);
+typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID);
+typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag);
+typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag);
+
+#define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D)
+#define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D)
+#define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D)
+#define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D)
+
+#define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock)
+
+#endif /* WGL_I3D_swap_frame_lock */
+
+/* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */
+
+#ifndef WGL_I3D_swap_frame_usage
+#define WGL_I3D_swap_frame_usage 1
+
+typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage);
+typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
+
+#define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D)
+#define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D)
+#define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D)
+#define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D)
+
+#define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage)
+
+#endif /* WGL_I3D_swap_frame_usage */
+
+/* -------------------------- WGL_NV_float_buffer -------------------------- */
+
+#ifndef WGL_NV_float_buffer
+#define WGL_NV_float_buffer 1
+
+#define WGL_FLOAT_COMPONENTS_NV 0x20B0
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
+#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
+#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
+#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
+#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
+
+#define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer)
+
+#endif /* WGL_NV_float_buffer */
+
+/* ---------------------- WGL_NV_render_depth_texture ---------------------- */
+
+#ifndef WGL_NV_render_depth_texture
+#define WGL_NV_render_depth_texture 1
+
+#define WGL_NO_TEXTURE_ARB 0x2077
+#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
+#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
+#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
+#define WGL_DEPTH_COMPONENT_NV 0x20A7
+
+#define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture)
+
+#endif /* WGL_NV_render_depth_texture */
+
+/* -------------------- WGL_NV_render_texture_rectangle -------------------- */
+
+#ifndef WGL_NV_render_texture_rectangle
+#define WGL_NV_render_texture_rectangle 1
+
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
+#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
+
+#define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle)
+
+#endif /* WGL_NV_render_texture_rectangle */
+
+/* ----------------------- WGL_NV_vertex_array_range ----------------------- */
+
+#ifndef WGL_NV_vertex_array_range
+#define WGL_NV_vertex_array_range 1
+
+typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority);
+typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
+
+#define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV)
+#define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV)
+
+#define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range)
+
+#endif /* WGL_NV_vertex_array_range */
+
+/* -------------------------- WGL_OML_sync_control ------------------------- */
+
+#ifndef WGL_OML_sync_control
+#define WGL_OML_sync_control 1
+
+typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator);
+typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc);
+typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
+typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
+typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc);
+typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc);
+
+#define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML)
+#define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML)
+#define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML)
+#define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML)
+#define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML)
+#define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML)
+
+#define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control)
+
+#endif /* WGL_OML_sync_control */
+
+/* ------------------------------------------------------------------------- */
+
+#ifdef GLEW_MX
+#define WGLEW_EXPORT
+#else
+#define WGLEW_EXPORT GLEWAPI
+#endif /* GLEW_MX */
+
+#ifdef GLEW_MX
+struct WGLEWContextStruct
+{
+#endif /* GLEW_MX */
+
+WGLEW_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB;
+WGLEW_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB;
+WGLEW_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB;
+WGLEW_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB;
+
+WGLEW_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB;
+
+WGLEW_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB;
+WGLEW_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB;
+
+WGLEW_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB;
+WGLEW_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB;
+WGLEW_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB;
+WGLEW_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB;
+WGLEW_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB;
+
+WGLEW_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB;
+WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB;
+WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB;
+
+WGLEW_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB;
+WGLEW_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB;
+WGLEW_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB;
+
+WGLEW_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT;
+WGLEW_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT;
+WGLEW_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT;
+WGLEW_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT;
+
+WGLEW_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT;
+
+WGLEW_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT;
+WGLEW_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT;
+
+WGLEW_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT;
+WGLEW_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT;
+WGLEW_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT;
+WGLEW_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT;
+WGLEW_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT;
+
+WGLEW_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT;
+WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT;
+WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT;
+
+WGLEW_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT;
+WGLEW_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT;
+
+WGLEW_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D;
+WGLEW_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D;
+
+WGLEW_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D;
+WGLEW_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D;
+WGLEW_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D;
+WGLEW_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D;
+
+WGLEW_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D;
+WGLEW_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D;
+WGLEW_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D;
+WGLEW_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D;
+WGLEW_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D;
+WGLEW_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D;
+WGLEW_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D;
+WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D;
+WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D;
+WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D;
+WGLEW_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D;
+WGLEW_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D;
+
+WGLEW_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D;
+WGLEW_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D;
+WGLEW_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D;
+WGLEW_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D;
+
+WGLEW_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D;
+WGLEW_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D;
+WGLEW_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D;
+WGLEW_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D;
+
+WGLEW_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D;
+WGLEW_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D;
+WGLEW_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D;
+WGLEW_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D;
+
+WGLEW_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV;
+WGLEW_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV;
+
+WGLEW_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML;
+WGLEW_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML;
+WGLEW_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML;
+WGLEW_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML;
+WGLEW_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML;
+WGLEW_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML;
+WGLEW_EXPORT GLboolean __WGLEW_3DFX_multisample;
+WGLEW_EXPORT GLboolean __WGLEW_ARB_buffer_region;
+WGLEW_EXPORT GLboolean __WGLEW_ARB_extensions_string;
+WGLEW_EXPORT GLboolean __WGLEW_ARB_make_current_read;
+WGLEW_EXPORT GLboolean __WGLEW_ARB_multisample;
+WGLEW_EXPORT GLboolean __WGLEW_ARB_pbuffer;
+WGLEW_EXPORT GLboolean __WGLEW_ARB_pixel_format;
+WGLEW_EXPORT GLboolean __WGLEW_ARB_pixel_format_float;
+WGLEW_EXPORT GLboolean __WGLEW_ARB_render_texture;
+WGLEW_EXPORT GLboolean __WGLEW_ATI_pixel_format_float;
+WGLEW_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle;
+WGLEW_EXPORT GLboolean __WGLEW_EXT_depth_float;
+WGLEW_EXPORT GLboolean __WGLEW_EXT_display_color_table;
+WGLEW_EXPORT GLboolean __WGLEW_EXT_extensions_string;
+WGLEW_EXPORT GLboolean __WGLEW_EXT_make_current_read;
+WGLEW_EXPORT GLboolean __WGLEW_EXT_multisample;
+WGLEW_EXPORT GLboolean __WGLEW_EXT_pbuffer;
+WGLEW_EXPORT GLboolean __WGLEW_EXT_pixel_format;
+WGLEW_EXPORT GLboolean __WGLEW_EXT_swap_control;
+WGLEW_EXPORT GLboolean __WGLEW_I3D_digital_video_control;
+WGLEW_EXPORT GLboolean __WGLEW_I3D_gamma;
+WGLEW_EXPORT GLboolean __WGLEW_I3D_genlock;
+WGLEW_EXPORT GLboolean __WGLEW_I3D_image_buffer;
+WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock;
+WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage;
+WGLEW_EXPORT GLboolean __WGLEW_NV_float_buffer;
+WGLEW_EXPORT GLboolean __WGLEW_NV_render_depth_texture;
+WGLEW_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle;
+WGLEW_EXPORT GLboolean __WGLEW_NV_vertex_array_range;
+WGLEW_EXPORT GLboolean __WGLEW_OML_sync_control;
+
+#ifdef GLEW_MX
+}; /* WGLEWContextStruct */
+#endif /* GLEW_MX */
+
+/* ------------------------------------------------------------------------- */
+
+#ifdef GLEW_MX
+
+typedef struct WGLEWContextStruct WGLEWContext;
+GLEWAPI GLenum wglewContextInit (WGLEWContext* ctx);
+GLEWAPI GLboolean wglewContextIsSupported (WGLEWContext* ctx, const char* name);
+
+#define wglewInit() wglewContextInit(wglewGetContext())
+#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x)
+
+#define WGLEW_GET_VAR(x) wglewGetContext()->x
+#define WGLEW_GET_FUN(x) wglewGetContext()->x
+
+#else /* GLEW_MX */
+
+#define WGLEW_GET_VAR(x) x
+#define WGLEW_GET_FUN(x) x
+
+GLEWAPI GLboolean wglewIsSupported (const char* name);
+
+#endif /* GLEW_MX */
+
+GLEWAPI GLboolean wglewGetExtension (const char* name);
+
+#ifdef __cplusplus
+}
+#endif
+
+#undef GLEWAPI
+
+#endif /* __wglew_h__ */
Index: /RenderSystems/GL/include/GL/wglext.h
===================================================================
--- /RenderSystems/GL/include/GL/wglext.h	(revision 5)
+++ /RenderSystems/GL/include/GL/wglext.h	(revision 5)
@@ -0,0 +1,608 @@
+#ifndef __wglext_h_
+#define __wglext_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-2002 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__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+/* Header file version number */
+/* wglext.h last updated 2002/03/22 */
+/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
+#define WGL_WGLEXT_VERSION 4
+
+#ifndef WGL_ARB_buffer_region
+#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
+#define WGL_BACK_COLOR_BUFFER_BIT_ARB  0x00000002
+#define WGL_DEPTH_BUFFER_BIT_ARB       0x00000004
+#define WGL_STENCIL_BUFFER_BIT_ARB     0x00000008
+#endif
+
+#ifndef WGL_ARB_multisample
+#define WGL_SAMPLE_BUFFERS_ARB         0x2041
+#define WGL_SAMPLES_ARB                0x2042
+#endif
+
+#ifndef WGL_ARB_extensions_string
+#endif
+
+#ifndef WGL_ARB_pixel_format
+#define WGL_NUMBER_PIXEL_FORMATS_ARB   0x2000
+#define WGL_DRAW_TO_WINDOW_ARB         0x2001
+#define WGL_DRAW_TO_BITMAP_ARB         0x2002
+#define WGL_ACCELERATION_ARB           0x2003
+#define WGL_NEED_PALETTE_ARB           0x2004
+#define WGL_NEED_SYSTEM_PALETTE_ARB    0x2005
+#define WGL_SWAP_LAYER_BUFFERS_ARB     0x2006
+#define WGL_SWAP_METHOD_ARB            0x2007
+#define WGL_NUMBER_OVERLAYS_ARB        0x2008
+#define WGL_NUMBER_UNDERLAYS_ARB       0x2009
+#define WGL_TRANSPARENT_ARB            0x200A
+#define WGL_TRANSPARENT_RED_VALUE_ARB  0x2037
+#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
+#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
+#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
+#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
+#define WGL_SHARE_DEPTH_ARB            0x200C
+#define WGL_SHARE_STENCIL_ARB          0x200D
+#define WGL_SHARE_ACCUM_ARB            0x200E
+#define WGL_SUPPORT_GDI_ARB            0x200F
+#define WGL_SUPPORT_OPENGL_ARB         0x2010
+#define WGL_DOUBLE_BUFFER_ARB          0x2011
+#define WGL_STEREO_ARB                 0x2012
+#define WGL_PIXEL_TYPE_ARB             0x2013
+#define WGL_COLOR_BITS_ARB             0x2014
+#define WGL_RED_BITS_ARB               0x2015
+#define WGL_RED_SHIFT_ARB              0x2016
+#define WGL_GREEN_BITS_ARB             0x2017
+#define WGL_GREEN_SHIFT_ARB            0x2018
+#define WGL_BLUE_BITS_ARB              0x2019
+#define WGL_BLUE_SHIFT_ARB             0x201A
+#define WGL_ALPHA_BITS_ARB             0x201B
+#define WGL_ALPHA_SHIFT_ARB            0x201C
+#define WGL_ACCUM_BITS_ARB             0x201D
+#define WGL_ACCUM_RED_BITS_ARB         0x201E
+#define WGL_ACCUM_GREEN_BITS_ARB       0x201F
+#define WGL_ACCUM_BLUE_BITS_ARB        0x2020
+#define WGL_ACCUM_ALPHA_BITS_ARB       0x2021
+#define WGL_DEPTH_BITS_ARB             0x2022
+#define WGL_STENCIL_BITS_ARB           0x2023
+#define WGL_AUX_BUFFERS_ARB            0x2024
+#define WGL_NO_ACCELERATION_ARB        0x2025
+#define WGL_GENERIC_ACCELERATION_ARB   0x2026
+#define WGL_FULL_ACCELERATION_ARB      0x2027
+#define WGL_SWAP_EXCHANGE_ARB          0x2028
+#define WGL_SWAP_COPY_ARB              0x2029
+#define WGL_SWAP_UNDEFINED_ARB         0x202A
+#define WGL_TYPE_RGBA_ARB              0x202B
+#define WGL_TYPE_COLORINDEX_ARB        0x202C
+#endif
+
+#ifndef WGL_ARB_make_current_read
+#define ERROR_INVALID_PIXEL_TYPE_ARB   0x2043
+#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
+#endif
+
+#ifndef WGL_ARB_pbuffer
+#define WGL_DRAW_TO_PBUFFER_ARB        0x202D
+#define WGL_MAX_PBUFFER_PIXELS_ARB     0x202E
+#define WGL_MAX_PBUFFER_WIDTH_ARB      0x202F
+#define WGL_MAX_PBUFFER_HEIGHT_ARB     0x2030
+#define WGL_PBUFFER_LARGEST_ARB        0x2033
+#define WGL_PBUFFER_WIDTH_ARB          0x2034
+#define WGL_PBUFFER_HEIGHT_ARB         0x2035
+#define WGL_PBUFFER_LOST_ARB           0x2036
+#endif
+
+#ifndef WGL_ARB_render_texture
+#define WGL_BIND_TO_TEXTURE_RGB_ARB    0x2070
+#define WGL_BIND_TO_TEXTURE_RGBA_ARB   0x2071
+#define WGL_TEXTURE_FORMAT_ARB         0x2072
+#define WGL_TEXTURE_TARGET_ARB         0x2073
+#define WGL_MIPMAP_TEXTURE_ARB         0x2074
+#define WGL_TEXTURE_RGB_ARB            0x2075
+#define WGL_TEXTURE_RGBA_ARB           0x2076
+#define WGL_NO_TEXTURE_ARB             0x2077
+#define WGL_TEXTURE_CUBE_MAP_ARB       0x2078
+#define WGL_TEXTURE_1D_ARB             0x2079
+#define WGL_TEXTURE_2D_ARB             0x207A
+#define WGL_MIPMAP_LEVEL_ARB           0x207B
+#define WGL_CUBE_MAP_FACE_ARB          0x207C
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
+#define WGL_FRONT_LEFT_ARB             0x2083
+#define WGL_FRONT_RIGHT_ARB            0x2084
+#define WGL_BACK_LEFT_ARB              0x2085
+#define WGL_BACK_RIGHT_ARB             0x2086
+#define WGL_AUX0_ARB                   0x2087
+#define WGL_AUX1_ARB                   0x2088
+#define WGL_AUX2_ARB                   0x2089
+#define WGL_AUX3_ARB                   0x208A
+#define WGL_AUX4_ARB                   0x208B
+#define WGL_AUX5_ARB                   0x208C
+#define WGL_AUX6_ARB                   0x208D
+#define WGL_AUX7_ARB                   0x208E
+#define WGL_AUX8_ARB                   0x208F
+#define WGL_AUX9_ARB                   0x2090
+#endif
+
+#ifndef WGL_EXT_make_current_read
+#define ERROR_INVALID_PIXEL_TYPE_EXT   0x2043
+#endif
+
+#ifndef WGL_EXT_pixel_format
+#define WGL_NUMBER_PIXEL_FORMATS_EXT   0x2000
+#define WGL_DRAW_TO_WINDOW_EXT         0x2001
+#define WGL_DRAW_TO_BITMAP_EXT         0x2002
+#define WGL_ACCELERATION_EXT           0x2003
+#define WGL_NEED_PALETTE_EXT           0x2004
+#define WGL_NEED_SYSTEM_PALETTE_EXT    0x2005
+#define WGL_SWAP_LAYER_BUFFERS_EXT     0x2006
+#define WGL_SWAP_METHOD_EXT            0x2007
+#define WGL_NUMBER_OVERLAYS_EXT        0x2008
+#define WGL_NUMBER_UNDERLAYS_EXT       0x2009
+#define WGL_TRANSPARENT_EXT            0x200A
+#define WGL_TRANSPARENT_VALUE_EXT      0x200B
+#define WGL_SHARE_DEPTH_EXT            0x200C
+#define WGL_SHARE_STENCIL_EXT          0x200D
+#define WGL_SHARE_ACCUM_EXT            0x200E
+#define WGL_SUPPORT_GDI_EXT            0x200F
+#define WGL_SUPPORT_OPENGL_EXT         0x2010
+#define WGL_DOUBLE_BUFFER_EXT          0x2011
+#define WGL_STEREO_EXT                 0x2012
+#define WGL_PIXEL_TYPE_EXT             0x2013
+#define WGL_COLOR_BITS_EXT             0x2014
+#define WGL_RED_BITS_EXT               0x2015
+#define WGL_RED_SHIFT_EXT              0x2016
+#define WGL_GREEN_BITS_EXT             0x2017
+#define WGL_GREEN_SHIFT_EXT            0x2018
+#define WGL_BLUE_BITS_EXT              0x2019
+#define WGL_BLUE_SHIFT_EXT             0x201A
+#define WGL_ALPHA_BITS_EXT             0x201B
+#define WGL_ALPHA_SHIFT_EXT            0x201C
+#define WGL_ACCUM_BITS_EXT             0x201D
+#define WGL_ACCUM_RED_BITS_EXT         0x201E
+#define WGL_ACCUM_GREEN_BITS_EXT       0x201F
+#define WGL_ACCUM_BLUE_BITS_EXT        0x2020
+#define WGL_ACCUM_ALPHA_BITS_EXT       0x2021
+#define WGL_DEPTH_BITS_EXT             0x2022
+#define WGL_STENCIL_BITS_EXT           0x2023
+#define WGL_AUX_BUFFERS_EXT            0x2024
+#define WGL_NO_ACCELERATION_EXT        0x2025
+#define WGL_GENERIC_ACCELERATION_EXT   0x2026
+#define WGL_FULL_ACCELERATION_EXT      0x2027
+#define WGL_SWAP_EXCHANGE_EXT          0x2028
+#define WGL_SWAP_COPY_EXT              0x2029
+#define WGL_SWAP_UNDEFINED_EXT         0x202A
+#define WGL_TYPE_RGBA_EXT              0x202B
+#define WGL_TYPE_COLORINDEX_EXT        0x202C
+#endif
+
+#ifndef WGL_EXT_pbuffer
+#define WGL_DRAW_TO_PBUFFER_EXT        0x202D
+#define WGL_MAX_PBUFFER_PIXELS_EXT     0x202E
+#define WGL_MAX_PBUFFER_WIDTH_EXT      0x202F
+#define WGL_MAX_PBUFFER_HEIGHT_EXT     0x2030
+#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT  0x2031
+#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
+#define WGL_PBUFFER_LARGEST_EXT        0x2033
+#define WGL_PBUFFER_WIDTH_EXT          0x2034
+#define WGL_PBUFFER_HEIGHT_EXT         0x2035
+#endif
+
+#ifndef WGL_EXT_depth_float
+#define WGL_DEPTH_FLOAT_EXT            0x2040
+#endif
+
+#ifndef WGL_3DFX_multisample
+#define WGL_SAMPLE_BUFFERS_3DFX        0x2060
+#define WGL_SAMPLES_3DFX               0x2061
+#endif
+
+#ifndef WGL_EXT_multisample
+#define WGL_SAMPLE_BUFFERS_EXT         0x2041
+#define WGL_SAMPLES_EXT                0x2042
+#endif
+
+#ifndef WGL_I3D_digital_video_control
+#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
+#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
+#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
+#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
+#endif
+
+#ifndef WGL_I3D_gamma
+#define WGL_GAMMA_TABLE_SIZE_I3D       0x204E
+#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D  0x204F
+#endif
+
+#ifndef WGL_I3D_genlock
+#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
+#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045
+#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046
+#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047
+#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
+#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
+#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
+#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
+#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
+#endif
+
+#ifndef WGL_I3D_image_buffer
+#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
+#define WGL_IMAGE_BUFFER_LOCK_I3D      0x00000002
+#endif
+
+#ifndef WGL_I3D_swap_frame_lock
+#endif
+
+#ifndef WGL_NV_render_depth_texture
+#define WGL_BIND_TO_TEXTURE_DEPTH_NV   0x20A3
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
+#define WGL_DEPTH_TEXTURE_FORMAT_NV    0x20A5
+#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
+#define WGL_DEPTH_COMPONENT_NV         0x20A7
+#endif
+
+#ifndef WGL_NV_render_texture_rectangle
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
+#define WGL_TEXTURE_RECTANGLE_NV       0x20A2
+#endif
+
+#ifndef WGL_NV_float_buffer
+#define WGL_FLOAT_COMPONENTS_NV        0x20B0
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
+#define WGL_TEXTURE_FLOAT_R_NV         0x20B5
+#define WGL_TEXTURE_FLOAT_RG_NV        0x20B6
+#define WGL_TEXTURE_FLOAT_RGB_NV       0x20B7
+#define WGL_TEXTURE_FLOAT_RGBA_NV      0x20B8
+#endif
+
+
+/*************************************************************/
+
+#ifndef WGL_ARB_pbuffer
+DECLARE_HANDLE(HPBUFFERARB);
+#endif
+#ifndef WGL_EXT_pbuffer
+DECLARE_HANDLE(HPBUFFEREXT);
+#endif
+
+#ifndef WGL_ARB_buffer_region
+#define WGL_ARB_buffer_region 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HANDLE WINAPI wglCreateBufferRegionARB (HDC, int, UINT);
+extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE);
+extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE, int, int, int, int);
+extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE, int, int, int, int, int, int);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
+typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
+typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
+typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
+#endif
+
+#ifndef WGL_ARB_multisample
+#define WGL_ARB_multisample 1
+#endif
+
+#ifndef WGL_ARB_extensions_string
+#define WGL_ARB_extensions_string 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern const char * WINAPI wglGetExtensionsStringARB (HDC);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
+#endif
+
+#ifndef WGL_ARB_pixel_format
+#define WGL_ARB_pixel_format 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC, int, int, UINT, const int *, int *);
+extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC, int, int, UINT, const int *, FLOAT *);
+extern BOOL WINAPI wglChoosePixelFormatARB (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
+typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+#endif
+
+#ifndef WGL_ARB_make_current_read
+#define WGL_ARB_make_current_read 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglMakeContextCurrentARB (HDC, HDC, HGLRC);
+extern HDC WINAPI wglGetCurrentReadDCARB (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
+#endif
+
+#ifndef WGL_ARB_pbuffer
+#define WGL_ARB_pbuffer 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC, int, int, int, const int *);
+extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB);
+extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB, HDC);
+extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB);
+extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB, int, int *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
+typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
+typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
+typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
+typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
+#endif
+
+#ifndef WGL_ARB_render_texture
+#define WGL_ARB_render_texture 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB, int);
+extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB, int);
+extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB, const int *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
+typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
+typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
+#endif
+
+#ifndef WGL_EXT_display_color_table
+#define WGL_EXT_display_color_table 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort);
+extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *, GLuint);
+extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort);
+extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
+typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+#endif
+
+#ifndef WGL_EXT_extensions_string
+#define WGL_EXT_extensions_string 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern const char * WINAPI wglGetExtensionsStringEXT (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
+#endif
+
+#ifndef WGL_EXT_make_current_read
+#define WGL_EXT_make_current_read 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglMakeContextCurrentEXT (HDC, HDC, HGLRC);
+extern HDC WINAPI wglGetCurrentReadDCEXT (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
+#endif
+
+#ifndef WGL_EXT_pbuffer
+#define WGL_EXT_pbuffer 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC, int, int, int, const int *);
+extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT);
+extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT, HDC);
+extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT);
+extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT, int, int *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
+typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
+typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
+typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
+typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
+#endif
+
+#ifndef WGL_EXT_pixel_format
+#define WGL_EXT_pixel_format 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC, int, int, UINT, int *, int *);
+extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC, int, int, UINT, int *, FLOAT *);
+extern BOOL WINAPI wglChoosePixelFormatEXT (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
+typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+#endif
+
+#ifndef WGL_EXT_swap_control
+#define WGL_EXT_swap_control 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglSwapIntervalEXT (int);
+extern int WINAPI wglGetSwapIntervalEXT (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
+typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
+#endif
+
+#ifndef WGL_EXT_depth_float
+#define WGL_EXT_depth_float 1
+#endif
+
+#ifndef WGL_NV_vertex_array_range
+#define WGL_NV_vertex_array_range 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern void* WINAPI wglAllocateMemoryNV (GLsizei, GLfloat, GLfloat, GLfloat);
+extern void WINAPI wglFreeMemoryNV (void *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
+#endif
+
+#ifndef WGL_3DFX_multisample
+#define WGL_3DFX_multisample 1
+#endif
+
+#ifndef WGL_EXT_multisample
+#define WGL_EXT_multisample 1
+#endif
+
+#ifndef WGL_OML_sync_control
+#define WGL_OML_sync_control 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetSyncValuesOML (HDC, INT64 *, INT64 *, INT64 *);
+extern BOOL WINAPI wglGetMscRateOML (HDC, INT32 *, INT32 *);
+extern INT64 WINAPI wglSwapBuffersMscOML (HDC, INT64, INT64, INT64);
+extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC, int, INT64, INT64, INT64);
+extern BOOL WINAPI wglWaitForMscOML (HDC, INT64, INT64, INT64, INT64 *, INT64 *, INT64 *);
+extern BOOL WINAPI wglWaitForSbcOML (HDC, INT64, INT64 *, INT64 *, INT64 *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
+typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
+typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
+typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
+typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
+typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
+#endif
+
+#ifndef WGL_I3D_digital_video_control
+#define WGL_I3D_digital_video_control 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC, int, int *);
+extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC, int, const int *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
+typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
+#endif
+
+#ifndef WGL_I3D_gamma
+#define WGL_I3D_gamma 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC, int, int *);
+extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC, int, const int *);
+extern BOOL WINAPI wglGetGammaTableI3D (HDC, int, USHORT *, USHORT *, USHORT *);
+extern BOOL WINAPI wglSetGammaTableI3D (HDC, int, const USHORT *, const USHORT *, const USHORT *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
+typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
+typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
+typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
+#endif
+
+#ifndef WGL_I3D_genlock
+#define WGL_I3D_genlock 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglEnableGenlockI3D (HDC);
+extern BOOL WINAPI wglDisableGenlockI3D (HDC);
+extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC, BOOL *);
+extern BOOL WINAPI wglGenlockSourceI3D (HDC, UINT);
+extern BOOL WINAPI wglGetGenlockSourceI3D (HDC, UINT *);
+extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC, UINT);
+extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC, UINT *);
+extern BOOL WINAPI wglGenlockSampleRateI3D (HDC, UINT);
+extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC, UINT *);
+extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC, UINT);
+extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC, UINT *);
+extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC, UINT *, UINT *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
+typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
+typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
+typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
+#endif
+
+#ifndef WGL_I3D_image_buffer
+#define WGL_I3D_image_buffer 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern LPVOID WINAPI wglCreateImageBufferI3D (HDC, DWORD, UINT);
+extern BOOL WINAPI wglDestroyImageBufferI3D (HDC, LPVOID);
+extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC, const HANDLE *, const LPVOID *, const DWORD *, UINT);
+extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC, const LPVOID *, UINT);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
+typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
+typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
+typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
+#endif
+
+#ifndef WGL_I3D_swap_frame_lock
+#define WGL_I3D_swap_frame_lock 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglEnableFrameLockI3D (void);
+extern BOOL WINAPI wglDisableFrameLockI3D (void);
+extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *);
+extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
+typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
+#endif
+
+#ifndef WGL_I3D_swap_frame_usage
+#define WGL_I3D_swap_frame_usage 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetFrameUsageI3D (float *);
+extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
+extern BOOL WINAPI wglEndFrameTrackingI3D (void);
+extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *, DWORD *, float *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
+typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
Index: /RenderSystems/GL/include/GLX/OgreGLXContext.h
===================================================================
--- /RenderSystems/GL/include/GLX/OgreGLXContext.h	(revision 5)
+++ /RenderSystems/GL/include/GLX/OgreGLXContext.h	(revision 5)
@@ -0,0 +1,73 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OgreGLXContext_H__
+#define __OgreGLXContext_H__
+
+#include "OgreGLContext.h"
+
+#include <X11/Xlib.h>
+#include <GL/glx.h>
+#include <GL/glxext.h>
+
+namespace Ogre {
+
+    class _OgrePrivate GLXContext: public GLContext
+    {
+    public:
+        GLXContext(::Display *dpy,
+                    ::GLXDrawable drawable,
+                    ::GLXContext ctx, 
+					::XVisualInfo* visualInfo);
+        GLXContext(::Display *dpy,
+                    ::GLXDrawable drawable,
+                    ::GLXContext ctx, 
+					::GLXFBConfig fbconfig);
+
+
+        virtual ~GLXContext();
+
+        /** See GLContext */
+        virtual void setCurrent();
+		/** See GLContext */
+		virtual void endCurrent();
+
+		/// @copydoc GLContext::clone
+		GLContext* clone() const;
+
+		::Display *mDpy;
+        ::GLXDrawable mDrawable;
+        ::GLXContext mCtx;
+		// only valid for window contexts
+		::XVisualInfo* mVisualInfo;
+		// only valid for PBuffer contexts
+		::GLXFBConfig mFBConfig;
+    };
+}
+
+#endif
Index: /RenderSystems/GL/include/GLX/OgreGLXGLSupport.h
===================================================================
--- /RenderSystems/GL/include/GLX/OgreGLXGLSupport.h	(revision 5)
+++ /RenderSystems/GL/include/GLX/OgreGLXGLSupport.h	(revision 5)
@@ -0,0 +1,64 @@
+#ifndef OGRE_GLXGLSupport_H
+#define OGRE_GLXGLSupport_H
+
+#include "OgreGLSupport.h"
+
+#include <X11/Xlib.h>
+#include <X11/keysym.h>
+#include <X11/extensions/xf86vmode.h>
+#include <GL/gl.h>
+#include <GL/glu.h>
+#include <GL/glx.h>
+
+namespace Ogre {
+
+class _OgrePrivate GLXGLSupport : public GLSupport
+{
+public:
+	GLXGLSupport();
+	~GLXGLSupport();
+
+	/**
+	* Add any special config values to the system.
+	* Must have a "Full Screen" value that is a bool and a "Video Mode" value
+	* that is a string in the form of wxh
+	*/
+	void addConfig(void);
+	/**
+	* Make sure all the extra options are valid
+	*/
+	String validateConfig(void);
+
+	/// @copydoc GLSupport::createWindow
+	RenderWindow* createWindow(bool autoCreateWindow, GLRenderSystem* renderSystem, const String& windowTitle);
+	
+	/// @copydoc RenderSystem::createRenderWindow
+	virtual RenderWindow* newWindow(const String &name, unsigned int width, unsigned int height, 
+		bool fullScreen, const NameValuePairList *miscParams = 0);
+
+	
+	/**
+	* Start anything special
+	*/
+	void start();
+	/**
+	* Stop anything special
+	*/
+	void stop();
+
+	/**
+	* Get the address of a function
+	*/
+	void* getProcAddress(const String& procname);
+ 
+    virtual GLPBuffer *createPBuffer(PixelComponentType format, size_t width, size_t height);
+private:
+	// X display
+	Display *mDisplay;
+}
+; // class GLXGLSupport
+
+}
+; // namespace Ogre
+
+#endif // OGRE_GLXGLSupport_H
Index: /RenderSystems/GL/include/GLX/OgreGLXRenderTexture.h
===================================================================
--- /RenderSystems/GL/include/GLX/OgreGLXRenderTexture.h	(revision 5)
+++ /RenderSystems/GL/include/GLX/OgreGLXRenderTexture.h	(revision 5)
@@ -0,0 +1,70 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __GLXRenderTexture_H__
+#define __GLXRenderTexture_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreGLPBuffer.h"
+#include "OgreGLXContext.h"
+
+#include <X11/Xlib.h>
+#include <GL/glx.h>
+namespace Ogre
+{
+
+    class _OgrePrivate GLXPBuffer : public GLPBuffer
+    {
+    public:
+        GLXPBuffer(PixelComponentType format, size_t width, size_t height);
+        ~GLXPBuffer();
+        
+        virtual GLContext *getContext();
+    protected:
+        void createPBuffer();
+
+        ::Display      *_pDpy;
+        ::GLXContext   _hGLContext;
+        ::GLXPbuffer   _hPBuffer;
+		::GLXFBConfig  mFBConfig; 
+        Ogre::GLXContext   *mContext;
+        
+        /// Find out which extension to use for floating point
+        /// Possible floating point extensions, in order of preference (ARB is best)
+        enum RTFType {
+            RTF_NONE=0,
+            RTF_NV=1,    /** GLX_NV_float_buffer */
+            RTF_ATI=2,   /** GLX_ATI_pixel_format_float */
+            RTF_ARB=3    /** GLX_ARB_fbconfig_float */
+        };
+        
+        RTFType detectRTFType();
+    };
+}
+#endif
Index: /RenderSystems/GL/include/GLX/OgreGLXUtils.h
===================================================================
--- /RenderSystems/GL/include/GLX/OgreGLXUtils.h	(revision 5)
+++ /RenderSystems/GL/include/GLX/OgreGLXUtils.h	(revision 5)
@@ -0,0 +1,105 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __GLXUtils_H__
+#define __GLXUtils_H__
+
+#include "OgrePrerequisites.h"
+#include <X11/Xlib.h>
+#include <GL/glx.h>
+
+namespace Ogre {
+   /**
+     * Class that acquires and stores properties of a frame buffer configuration
+     */
+    class _OgrePrivate FBConfigData 
+    {
+    public:
+        FBConfigData();
+        FBConfigData(Display *dpy, GLXFBConfig config);
+        String toString() const;
+        
+        int configID;
+        int visualID;
+        int bufferSize;
+        int level;
+        int doubleBuffer;
+        int stereo;
+        int auxBuffers;
+        int renderType;
+        int redSize;
+        int greenSize;
+        int blueSize;
+        int alphaSize;
+        int depthSize;
+        int stencilSize;
+        int accumRedSize;
+        int accumGreenSize;        
+        int accumBlueSize;
+        int accumAlphaSize;        
+        int drawableType;
+        int caveat;
+        int maxPBufferWidth;
+        int maxPBufferHeight;
+        int maxPBufferPixels;        
+    };
+
+    class _OgrePrivate GLXUtils
+    {
+    public:
+        /**
+         * Loads an icon from an Ogre resource into the X Server. This currently only
+         * works for 24 and 32 bit displays. The image must be findable by the Ogre
+         * resource system, and of format PF_A8R8G8B8.
+         *
+         * @param mDisplay,rootWindow   X resources to use
+         * @param name           Name of image to load
+         * @param pix         Receiver for the output pixmap
+         * @param mask           Receiver for the output mask (alpha bitmap)
+         * @returns true on success
+         */        
+        static bool LoadIcon(Display *mDisplay, Window rootWindow, const std::string &name, Pixmap *pix, Pixmap *mask);
+        /*
+         * Examine all visuals to find the so-called best one.
+         * We prefer deepest RGBA buffer with depth, stencil and accum
+         * that has no caveats. This will only choose formats with a multisample
+		 * that equals multisample
+		 * @returns -1 in case of failure, otherwise a valid visual ID
+         * @author Brian Paul (from the glxinfo source)
+         */
+        static int findBestVisual(Display *dpy, int scrnum, int multisample = -1);
+        /**
+         * Find best FBConfig given a list required and a list of desired properties
+         */
+        static GLXFBConfig findBestMatch(Display *dpy, int scrnum, const int *attribs, const int *ideal);
+        
+    };
+   
+};
+
+#endif
Index: /RenderSystems/GL/include/GLX/OgreGLXWindow.h
===================================================================
--- /RenderSystems/GL/include/GLX/OgreGLXWindow.h	(revision 5)
+++ /RenderSystems/GL/include/GLX/OgreGLXWindow.h	(revision 5)
@@ -0,0 +1,111 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+ 
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+ 
+This program 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 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 Lesser General Public License for more details.
+ 
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __GLXWindow_H__
+#define __GLXWindow_H__
+
+#include "OgreRenderWindow.h"
+#include "OgreGLXContext.h"
+
+#include <X11/Xlib.h>
+#include <X11/keysym.h>
+#include <GL/glx.h>
+#include <GL/glxext.h>
+
+namespace Ogre 
+{
+	class _OgrePrivate GLXWindow : public RenderWindow
+	{
+	private:
+		::Display *mDisplay;		//Pointer to X connection
+		::Window mWindow;		//X Window
+		::Atom mAtomDeleteWindow;	//Used for handling X window closing
+		::GLXContext mGlxContext;
+		::XVisualInfo* mVisualInfo;
+		bool mDelVisualInfo;
+		bool mDelWindow;
+
+		bool mClosed;			//Window has been closed
+		bool mVisible;			//Window is visible
+		bool mTopLevel;			//This is false if the Ogre window is embedded
+		int mOldMode;			//Mode before switching to fullscreen
+
+		GLXContext   *mContext;
+	public:
+		// Pass X display to create this window on
+		GLXWindow(Display *display);
+		~GLXWindow();
+
+		void create(const String& name, unsigned int width, unsigned int height,
+			    bool fullScreen, const NameValuePairList *miscParams);
+
+		/** @copydoc see RenderWindow::destroy */
+		void destroy(void);
+
+		/** @copydoc see RenderWindow::isActive */
+		bool isActive(void) const;
+
+		/** @copydoc see RenderWindow::isClosed */
+		bool isClosed(void) const;
+
+		/** @copydoc see RenderWindow::isVisible */
+		bool isVisible(void) const;
+
+		/** @copydoc see RenderWindow::setVisible */
+		void setVisible(bool visible);
+
+		/** @copydoc see RenderWindow::reposition */
+		void reposition(int left, int top);
+
+		/** @copydoc see RenderWindow::resize */
+		void resize(unsigned int width, unsigned int height);
+
+		/** @copydoc see RenderWindow::windowMovedOrResized */
+		void windowMovedOrResized();
+
+		/** @copydoc see RenderWindow::swapBuffers */
+		void swapBuffers(bool waitForVSync);
+	
+		/** @copydoc see RenderTarget::writeContentsToFile */
+		void writeContentsToFile(const String& filename);
+
+		/**
+		@remarks
+			* Get custom attribute; the following attributes are valid:
+			* WINDOW	The X Window associated with this
+			* DISPLAY	The X Display associated with this
+			* ATOM		The Delete Window signal
+		*/
+		void getCustomAttribute(const String& name, void* pData);
+
+		bool requiresTextureFlipping() const { return false; }
+	};
+}
+
+#endif
Index: /RenderSystems/GL/include/Makefile.am
===================================================================
--- /RenderSystems/GL/include/Makefile.am	(revision 5)
+++ /RenderSystems/GL/include/Makefile.am	(revision 5)
@@ -0,0 +1,13 @@
+noinst_HEADERS = OgreGLPrerequisites.h \
+				 OgreGLPlugin.h \
+                 OgreGLGpuProgram.h \
+                 OgreGLGpuNvparseProgram.h \
+                 OgreGLGpuProgramManager.h \
+                 OgreGLRenderSystem.h \
+                 OgreGLSupport.h \
+                 OgreGLTexture.h \
+                 OgreGLTextureManager.h \
+                 OgreSDLGLSupport.h \
+                 OgreSDLPrerequisites.h \
+                 OgreSDLWindow.h \
+                 OgreGLContext.h
Index: /RenderSystems/GL/include/Makefile.in
===================================================================
--- /RenderSystems/GL/include/Makefile.in	(revision 5)
+++ /RenderSystems/GL/include/Makefile.in	(revision 5)
@@ -0,0 +1,449 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = RenderSystems/GL/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = OgreGLPrerequisites.h \
+				 OgreGLPlugin.h \
+                 OgreGLGpuProgram.h \
+                 OgreGLGpuNvparseProgram.h \
+                 OgreGLGpuProgramManager.h \
+                 OgreGLRenderSystem.h \
+                 OgreGLSupport.h \
+                 OgreGLTexture.h \
+                 OgreGLTextureManager.h \
+                 OgreSDLGLSupport.h \
+                 OgreSDLPrerequisites.h \
+                 OgreSDLWindow.h \
+                 OgreGLContext.h
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  RenderSystems/GL/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  RenderSystems/GL/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /RenderSystems/GL/include/OSX/OgreOSXCGLContext.h
===================================================================
--- /RenderSystems/GL/include/OSX/OgreOSXCGLContext.h	(revision 5)
+++ /RenderSystems/GL/include/OSX/OgreOSXCGLContext.h	(revision 5)
@@ -0,0 +1,69 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OgreOSXCGLContext_H__
+#define __OgreOSXCGLContext_H__
+
+#include "OgreOSXContext.h"
+#include <OpenGL/OpenGL.h>
+#include <OpenGL/CGLTypes.h>
+
+namespace Ogre {
+
+    class OSXCGLContext: public OSXContext
+    {
+    public:
+		OSXCGLContext(CGLContextObj cglContext);
+        virtual ~OSXCGLContext();
+
+        /** See GLContext */
+        virtual void setCurrent();
+		/**
+         * This is called before another context is made current. By default,
+         * nothing is done here.
+         */
+        virtual void endCurrent();
+		/** Create a new context based on the same window/pbuffer as this
+			context - mostly useful for additional threads.
+		@note The caller is responsible for deleting the returned context.
+		*/
+		virtual GLContext* clone() const;
+		/**
+		 * Return value will be "CGL"
+		 */
+		virtual String getContextType();
+
+		/** Grab the CGLContext if it exists */
+		CGLContextObj getContext();
+
+	private:
+		CGLContextObj mCGLContext;
+    };
+}
+
+#endif
Index: /RenderSystems/GL/include/OSX/OgreOSXCarbonContext.h
===================================================================
--- /RenderSystems/GL/include/OSX/OgreOSXCarbonContext.h	(revision 5)
+++ /RenderSystems/GL/include/OSX/OgreOSXCarbonContext.h	(revision 5)
@@ -0,0 +1,70 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OgreOSXCarbonContext_H__
+#define __OgreOSXCarbonContext_H__
+
+#include "OgreOSXContext.h"
+#include <AGL/agl.h>
+#include <OpenGL/OpenGL.h>
+
+namespace Ogre {
+
+    class OSXCarbonContext: public OSXContext
+    {
+    public:
+        OSXCarbonContext(AGLContext aglContext);
+
+        virtual ~OSXCarbonContext();
+
+        /** See GLContext */
+        virtual void setCurrent();
+		/**
+         * This is called before another context is made current. By default,
+         * nothing is done here.
+         */
+        virtual void endCurrent();
+		/** Create a new context based on the same window/pbuffer as this
+			context - mostly useful for additional threads.
+		@note The caller is responsible for deleting the returned context.
+		*/
+		virtual GLContext* clone() const;
+		/**
+		 * Return value will be "AGL"
+		 */
+		virtual String getContextType();
+
+		/** Grab the CGLContext if it exists */
+		AGLContext getContext();
+
+	private:
+		AGLContext mAGLContext;
+    };
+}
+
+#endif
Index: /RenderSystems/GL/include/OSX/OgreOSXCarbonWindow.h
===================================================================
--- /RenderSystems/GL/include/OSX/OgreOSXCarbonWindow.h	(revision 5)
+++ /RenderSystems/GL/include/OSX/OgreOSXCarbonWindow.h	(revision 5)
@@ -0,0 +1,85 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+ 
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+ 
+This program 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 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 Lesser General Public License for more details.
+ 
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __OSXCarbonWindow_H__
+#define __OSXCarbonWindow_H__
+
+#include "OgreOSXWindow.h"
+#include "OgreOSXCarbonContext.h"
+#include "OgreOSXCGLContext.h"
+#include <OpenGL/OpenGL.h>
+#include <OpenGL/CGLTypes.h>
+
+namespace Ogre 
+{
+	class OSXCarbonWindow : public OSXWindow
+	{
+	public:
+		OSXCarbonWindow();
+		virtual ~OSXCarbonWindow();
+		
+		virtual void create( const String& name, unsigned int width, unsigned int height,
+	            bool fullScreen, const NameValuePairList *miscParams );
+        /** Overridden - see RenderWindow */
+		virtual void destroy( void );
+        /** Overridden - see RenderWindow */
+		virtual bool isActive( void ) const;
+        /** Overridden - see RenderWindow */
+		virtual bool isClosed( void ) const;
+        /** Overridden - see RenderWindow */
+		virtual void reposition( int left, int top );
+        /** Overridden - see RenderWindow */
+		virtual void resize( unsigned int width, unsigned int height );
+        /** Overridden - see RenderWindow */
+		virtual void swapBuffers( bool waitForVSync );
+		/** Overridden - see RenderTarget */
+		virtual void windowMovedOrResized();
+
+		bool requiresTextureFlipping() const { return false; }
+		
+		void windowResized();
+		void windowHasResized();
+		
+		void getCustomAttribute( const String& name, void* pData );
+
+	private:
+		void processEvents();
+		
+	private:
+		WindowRef mWindow;
+		HIViewRef mView;
+		AGLContext mAGLContext;
+		
+		bool mActive;
+		bool mClosed;
+		bool mHasResized;
+	};
+}
+
+#endif
Index: /RenderSystems/GL/include/OSX/OgreOSXCocoaContext.h
===================================================================
--- /RenderSystems/GL/include/OSX/OgreOSXCocoaContext.h	(revision 5)
+++ /RenderSystems/GL/include/OSX/OgreOSXCocoaContext.h	(revision 5)
@@ -0,0 +1,69 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OgreOSXCocoaContext_H__
+#define __OgreOSXCocoaContext_H__
+
+#include "OgreOSXContext.h"
+#import <Cocoa/Cocoa.h>
+
+namespace Ogre {
+
+    class OSXCocoaContext: public OSXContext
+    {
+    public:
+        OSXCocoaContext(NSOpenGLContext *context);
+
+        virtual ~OSXCocoaContext();
+
+        /** See GLContext */
+        virtual void setCurrent();
+		/**
+         * This is called before another context is made current. By default,
+         * nothing is done here.
+         */
+        virtual void endCurrent();
+		/** Create a new context based on the same window/pbuffer as this
+			context - mostly useful for additional threads.
+		@note The caller is responsible for deleting the returned context.
+		*/
+		virtual GLContext* clone() const;
+		/**
+		 * Return value will be "NSOpenGL"
+		 */
+		virtual String getContextType();
+		
+		/** Grab the NSOpenGLContext if it exists */
+		NSOpenGLContext* getContext();
+		
+	private:
+		NSOpenGLContext* mNSGLContext;
+    };
+}
+
+#endif
Index: /RenderSystems/GL/include/OSX/OgreOSXCocoaWindow.h
===================================================================
--- /RenderSystems/GL/include/OSX/OgreOSXCocoaWindow.h	(revision 5)
+++ /RenderSystems/GL/include/OSX/OgreOSXCocoaWindow.h	(revision 5)
@@ -0,0 +1,80 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2005 The OGRE Team
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __OSXCocoaWindow_H__
+#define __OSXCocoaWindow_H__
+
+#include "OgreOSXWindow.h"
+#include "OgreOSXCocoaContext.h"
+
+#include <Cocoa/Cocoa.h>
+#include "OgreOSXCocoaView.h"
+
+namespace Ogre {
+    class OSXCocoaWindow : public OSXWindow
+    {
+    private:
+		NSWindow *mWindow;
+		OgreView *mView;
+		NSOpenGLContext *glContext;
+		
+        bool mActive;
+        bool mClosed;
+		bool mHasResized;
+            
+        // Process pending events
+        void processEvents(void);
+    public:
+        OSXCocoaWindow();
+        ~OSXCocoaWindow();
+		
+		OgreView* ogreView() const { return mView; };
+		NSOpenGLContext* nsopenGLContext() const { return glContext; };
+		void createWithView(OgreView *view);
+
+		void create(const String& name, unsigned int width, unsigned int height,
+	            bool fullScreen, const NameValuePairList *miscParams);
+        /** Overridden - see RenderWindow */
+        void destroy(void);
+        /** Overridden - see RenderWindow */
+        bool isActive(void) const;
+        /** Overridden - see RenderWindow */
+        bool isClosed(void) const;
+        /** Overridden - see RenderWindow */
+        void reposition(int left, int top);
+        /** Overridden - see RenderWindow */
+        void resize(unsigned int width, unsigned int height);
+        /** Overridden - see RenderWindow */
+        void swapBuffers(bool waitForVSync);
+        /** Overridden - see RenderWindow */
+		void windowMovedOrResized();
+
+		bool requiresTextureFlipping() const { return false; }		
+		void getCustomAttribute( const String& name, void* pData );
+    };
+}
+
+#endif
+
Index: /RenderSystems/GL/include/OSX/OgreOSXContext.h
===================================================================
--- /RenderSystems/GL/include/OSX/OgreOSXContext.h	(revision 5)
+++ /RenderSystems/GL/include/OSX/OgreOSXContext.h	(revision 5)
@@ -0,0 +1,70 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OgreOSXContext_H__
+#define __OgreOSXContext_H__
+
+#include "OgreGLContext.h"
+
+namespace Ogre
+{
+	/**
+     * Class that encapsulates an GL context. (IE a window/pbuffer). This is a 
+     * virtual base class which should be implemented in a GLSupport.
+     * This object can also be used to cache renderstate if we decide to do so
+     * in the future.
+     */
+    class OSXContext: public GLContext
+    {
+    public:
+        OSXContext();
+        virtual ~OSXContext();
+
+        /** See GLContext */
+        virtual void setCurrent() = 0;
+		/**
+         * This is called before another context is made current. By default,
+         * nothing is done here.
+         */
+        virtual void endCurrent() = 0;
+		/** Create a new context based on the same window/pbuffer as this
+			context - mostly useful for additional threads.
+		@note The caller is responsible for deleting the returned context.
+		*/
+		virtual GLContext* clone() const = 0;
+		/**
+		 * Return the type of context currently assoiciated with this OSXContext,
+		 * this is needed because OSX has several different types of contexts
+		 * depending on the application needs.
+		 @note Return value will be "AGL", "CGL", or "NSOpenGL" accordingly.
+		 */
+		virtual String getContextType() = 0;
+    };
+}
+
+#endif
Index: /RenderSystems/GL/include/OSX/OgreOSXGLSupport.h
===================================================================
--- /RenderSystems/GL/include/OSX/OgreOSXGLSupport.h	(revision 5)
+++ /RenderSystems/GL/include/OSX/OgreOSXGLSupport.h	(revision 5)
@@ -0,0 +1,67 @@
+#ifndef OGRE_OSXGLSupport_H
+#define OGRE_OSXGLSupport_H
+
+#include "OgreGLSupport.h"
+
+namespace Ogre
+{
+
+class OSXGLSupport : public GLSupport
+{
+public:
+	OSXGLSupport();
+	~OSXGLSupport();
+
+	/**
+	* Add any special config values to the system.
+	* Must have a "Full Screen" value that is a bool and a "Video Mode" value
+	* that is a string in the form of wxh
+	*/
+	void addConfig( void );
+
+	/**
+	* Make sure all the extra options are valid
+	*/
+	String validateConfig( void );
+
+	/// @copydoc GLSupport::createWindow
+	RenderWindow* createWindow( bool autoCreateWindow, GLRenderSystem* renderSystem, const String& windowTitle );
+	
+	/// @copydoc RenderSystem::createRenderWindow
+	virtual RenderWindow* newWindow( const String &name, unsigned int width, unsigned int height, 
+		bool fullScreen, const NameValuePairList *miscParams = 0 );
+	
+	/**
+	* Start anything special
+	*/
+	void start();
+
+	/**
+	* Stop anything special
+	*/
+	void stop();
+
+	/**
+	* Get the address of a function
+	*/
+	void* getProcAddress( const char *name );
+	void* getProcAddress( const String& procname );
+
+	virtual bool supportsPBuffers();
+	virtual GLPBuffer* createPBuffer( PixelComponentType format, size_t width, size_t height );
+	
+	// Core Foundation Array callback function for sorting, must be static for the function ptr
+	static CFComparisonResult _compareModes (const void *val1, const void *val2, void *context);
+	// Core Fondation Dictionary helper functions, also static for ease of use in above static
+	static Boolean _getDictionaryBoolean(CFDictionaryRef dict, const void* key);
+	static long _getDictionaryLong(CFDictionaryRef dict, const void* key);
+	
+protected:
+	String mAPI;
+	String mContextType;
+	
+}; // class OSXGLSupport
+
+}; // namespace Ogre
+
+#endif // OGRE_OSXGLSupport_H
Index: /RenderSystems/GL/include/OSX/OgreOSXRenderTexture.h
===================================================================
--- /RenderSystems/GL/include/OSX/OgreOSXRenderTexture.h	(revision 5)
+++ /RenderSystems/GL/include/OSX/OgreOSXRenderTexture.h	(revision 5)
@@ -0,0 +1,30 @@
+#ifndef __OSXRenderTexture_H__
+#define __OSXRenderTexture_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreGLPBuffer.h"
+#include "OgreOSXCarbonContext.h"
+
+namespace Ogre
+{
+    class OSXPBuffer : public GLPBuffer
+    {
+    public:
+        OSXPBuffer(PixelComponentType format, size_t width, size_t height );
+        ~OSXPBuffer();
+        
+        virtual GLContext *getContext();
+
+    protected:
+        void createPBuffer();
+		void destroyPBuffer();
+
+	private:
+		AGLPbuffer mPBuffer;
+		AGLContext mAGLContext;
+		OSXCarbonContext* mContext;
+    };
+}
+#endif
+
Index: /RenderSystems/GL/include/OSX/OgreOSXWindow.h
===================================================================
--- /RenderSystems/GL/include/OSX/OgreOSXWindow.h	(revision 5)
+++ /RenderSystems/GL/include/OSX/OgreOSXWindow.h	(revision 5)
@@ -0,0 +1,78 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+ 
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+ 
+This program 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 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 Lesser General Public License for more details.
+ 
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __OSXWindow_H__
+#define __OSXWindow_H__
+
+#include "OgreRenderWindow.h"
+#include "OgreOSXContext.h"
+#include <OpenGL/OpenGL.h>
+#include <OpenGL/CGLTypes.h>
+
+namespace Ogre 
+{
+	class OSXWindow : public RenderWindow
+	{
+	public:
+		OSXWindow();
+		virtual ~OSXWindow();
+		
+		/** Overridden - see RenderWindow */
+		void create( const String& name, unsigned int width, unsigned int height,
+	            bool fullScreen, const NameValuePairList *miscParams ) = 0;
+        /** Overridden - see RenderWindow */
+        virtual void destroy( void ) = 0;
+        /** Overridden - see RenderWindow */
+        virtual bool isActive( void ) const = 0;
+        /** Overridden - see RenderWindow */
+        virtual bool isClosed( void ) const = 0;
+        /** Overridden - see RenderWindow */
+        virtual void reposition( int left, int top ) = 0;
+        /** Overridden - see RenderWindow */
+        virtual void resize( unsigned int width, unsigned int height ) = 0;
+        /** Overridden - see RenderWindow */
+        virtual void swapBuffers( bool waitForVSync ) = 0;
+        /** Overridden - see RenderTarget */
+        virtual void writeContentsToFile( const String& filename );
+		/** Overridden - see RenderTarget */
+		virtual void windowMovedOrResized() {};
+
+	protected:
+		OSXContext* mContext;
+		CGLContextObj mCGLContext;
+		/** Switch to full screen mode using CGL */
+		void createCGLFullscreen(unsigned int width, unsigned int height, unsigned int depth, unsigned int fsaa, CGLContextObj sharedContext);
+		/** Kill full screen mode, and return to default windowed mode */
+		void destroyCGLFullscreen(void);
+		/** Update the full screen context */
+		void swapCGLBuffers(void);
+	};
+}
+
+#endif
Index: /RenderSystems/GL/include/OgreGLATIFSInit.h
===================================================================
--- /RenderSystems/GL/include/OgreGLATIFSInit.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLATIFSInit.h	(revision 5)
@@ -0,0 +1,41 @@
+/*
+	ATI fragment shader Extension header file.
+	setup by NFZ
+	extracted from ATI 8500 SDK
+
+** GL_ATI_fragment_shader
+**
+** Support:
+**   Rage 128 * based  : Not Supported
+**   Radeon   * based  : Not Supported
+**   R200     * based  : Supported
+**   R200 : 8500, 9000, 9100, 9200
+**   also works on R300 but pointless since ARBFP1.0 supported
+*/
+
+
+#ifndef _GL_ATI_FRAGMENT_SHADER_H_
+#define _GL_ATI_FRAGMENT_SHADER_H_
+
+#include "OgreGLSupport.h"
+
+// ATI_fragment_program functions
+extern PFNGLGENFRAGMENTSHADERSATIPROC        glGenFragmentShadersATI_ptr;
+extern PFNGLBINDFRAGMENTSHADERATIPROC        glBindFragmentShaderATI_ptr;
+extern PFNGLDELETEFRAGMENTSHADERATIPROC      glDeleteFragmentShaderATI_ptr;
+extern PFNGLBEGINFRAGMENTSHADERATIPROC       glBeginFragmentShaderATI_ptr;
+extern PFNGLENDFRAGMENTSHADERATIPROC         glEndFragmentShaderATI_ptr;
+extern PFNGLPASSTEXCOORDATIPROC              glPassTexCoordATI_ptr;
+extern PFNGLSAMPLEMAPATIPROC                 glSampleMapATI_ptr;
+extern PFNGLCOLORFRAGMENTOP1ATIPROC          glColorFragmentOp1ATI_ptr;
+extern PFNGLCOLORFRAGMENTOP2ATIPROC          glColorFragmentOp2ATI_ptr;
+extern PFNGLCOLORFRAGMENTOP3ATIPROC          glColorFragmentOp3ATI_ptr;
+extern PFNGLALPHAFRAGMENTOP1ATIPROC          glAlphaFragmentOp1ATI_ptr;
+extern PFNGLALPHAFRAGMENTOP2ATIPROC          glAlphaFragmentOp2ATI_ptr;
+extern PFNGLALPHAFRAGMENTOP3ATIPROC          glAlphaFragmentOp3ATI_ptr;
+extern PFNGLSETFRAGMENTSHADERCONSTANTATIPROC glSetFragmentShaderConstantATI_ptr;
+
+bool InitATIFragmentShaderExtensions(Ogre::GLSupport& glSupport);
+
+#endif	//_GL_ATI_FRAGMENT_SHADER_H_
+
Index: /RenderSystems/GL/include/OgreGLContext.h
===================================================================
--- /RenderSystems/GL/include/OgreGLContext.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLContext.h	(revision 5)
@@ -0,0 +1,71 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OgreGLContext_H__
+#define __OgreGLContext_H__
+
+#include "OgreGLPrerequisites.h"
+
+namespace Ogre {
+
+    /**
+     * Class that encapsulates an GL context. (IE a window/pbuffer). This is a 
+     * virtual base class which should be implemented in a GLSupport.
+     * This object can also be used to cache renderstate if we decide to do so
+     * in the future.
+     */
+    class _OgrePrivate GLContext
+    {
+    public:
+        GLContext();
+        virtual ~GLContext();
+
+        /**
+         * Enable the context. All subsequent rendering commands will go here.
+         */
+        virtual void setCurrent() = 0;
+        /**
+         * This is called before another context is made current. By default,
+         * nothing is done here.
+         */
+        virtual void endCurrent() = 0;
+        
+        bool getInitialized() { return initialized; };
+        void setInitialized() { initialized = true; };
+
+		/** Create a new context based on the same window/pbuffer as this
+			context - mostly useful for additional threads.
+		@note The caller is responsible for deleting the returned context.
+		*/
+		virtual GLContext* clone() const = 0;
+    protected:
+        bool initialized;
+    };
+}
+
+#endif
Index: /RenderSystems/GL/include/OgreGLDefaultHardwareBufferManager.h
===================================================================
--- /RenderSystems/GL/include/OgreGLDefaultHardwareBufferManager.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLDefaultHardwareBufferManager.h	(revision 5)
@@ -0,0 +1,119 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __GLDefaultHardwareBufferManager_H__
+#define __GLDefaultHardwareBufferManager_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreHardwareBufferManager.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreHardwareIndexBuffer.h"
+
+namespace Ogre {
+
+    /// Specialisation of HardwareVertexBuffer for emulation
+    class _OgrePrivate GLDefaultHardwareVertexBuffer : public HardwareVertexBuffer 
+    {
+	protected:
+		unsigned char* mpData;
+        /** See HardwareBuffer. */
+        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        /** See HardwareBuffer. */
+		void unlockImpl(void);
+
+    public:
+		GLDefaultHardwareVertexBuffer(size_t vertexSize, size_t numVertices, 
+            HardwareBuffer::Usage usage);
+        ~GLDefaultHardwareVertexBuffer();
+        /** See HardwareBuffer. */
+        void readData(size_t offset, size_t length, void* pDest);
+        /** See HardwareBuffer. */
+        void writeData(size_t offset, size_t length, const void* pSource,
+				bool discardWholeBuffer = false);
+        /** Override HardwareBuffer to turn off all shadowing. */
+        void* lock(size_t offset, size_t length, LockOptions options);
+        /** Override HardwareBuffer to turn off all shadowing. */
+		void unlock(void);
+
+        //void* getDataPtr(void) const { return (void*)mpData; }
+        void* getDataPtr(size_t offset) const { return (void*)(mpData + offset); }
+    };
+
+	/// Specialisation of HardwareIndexBuffer for emulation
+    class _OgrePrivate GLDefaultHardwareIndexBuffer : public HardwareIndexBuffer
+    {
+	protected:
+		unsigned char* mpData;
+        /** See HardwareBuffer. */
+        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        /** See HardwareBuffer. */
+		void unlockImpl(void);
+    public:
+		GLDefaultHardwareIndexBuffer(IndexType idxType, size_t numIndexes, HardwareBuffer::Usage usage);
+        ~GLDefaultHardwareIndexBuffer();
+        /** See HardwareBuffer. */
+        void readData(size_t offset, size_t length, void* pDest);
+        /** See HardwareBuffer. */
+        void writeData(size_t offset, size_t length, const void* pSource,
+				bool discardWholeBuffer = false);
+        /** Override HardwareBuffer to turn off all shadowing. */
+        void* lock(size_t offset, size_t length, LockOptions options);
+        /** Override HardwareBuffer to turn off all shadowing. */
+		void unlock(void);
+
+        void* getDataPtr(size_t offset) const { return (void*)(mpData + offset); }
+    };
+
+	/** Specialisation of HardwareBufferManager to emulate hardware buffers.
+	@remarks
+		You might want to instantiate this class if you want to utilise
+		classes like MeshSerializer without having initialised the 
+		rendering system (which is required to create a 'real' hardware
+		buffer manager.
+	*/
+	class _OgrePrivate GLDefaultHardwareBufferManager : public HardwareBufferManager
+	{
+    public:
+        GLDefaultHardwareBufferManager();
+        ~GLDefaultHardwareBufferManager();
+        /// Creates a vertex buffer
+		HardwareVertexBufferSharedPtr 
+            createVertexBuffer(size_t vertexSize, size_t numVerts, 
+				HardwareBuffer::Usage usage, bool useShadowBuffer = false);
+		/// Create a hardware vertex buffer
+		HardwareIndexBufferSharedPtr 
+            createIndexBuffer(HardwareIndexBuffer::IndexType itype, size_t numIndexes, 
+				HardwareBuffer::Usage usage, bool useShadowBuffer = false);
+
+    };
+
+
+}
+
+#endif
Index: /RenderSystems/GL/include/OgreGLFBOMultiRenderTarget.h
===================================================================
--- /RenderSystems/GL/include/OgreGLFBOMultiRenderTarget.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLFBOMultiRenderTarget.h	(revision 5)
@@ -0,0 +1,62 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __GLMULTIRENDERTARGET_H__
+#define __GLMULTIRENDERTARGET_H__
+
+#include "OgreGLFrameBufferObject.h"
+
+namespace Ogre {
+	/** MultiRenderTarget for GL. Requires the FBO extension.
+	*/
+	class _OgrePrivate GLFBOMultiRenderTarget : public MultiRenderTarget
+	{
+	public:
+		GLFBOMultiRenderTarget(GLFBOManager *manager, const String &name);
+		~GLFBOMultiRenderTarget();
+
+		/** @copydoc MultiRenderTarget::bindSurface */
+		virtual void bindSurface(size_t attachment, RenderTexture *target);
+
+
+
+		/** @copydoc MultiRenderTarget::unbindSurface */
+
+		virtual void unbindSurface(size_t attachment); 
+
+		virtual void getCustomAttribute( const String& name, void *pData );
+
+		bool requiresTextureFlipping() const { return true; }
+	private:
+		GLFrameBufferObject fbo;
+	};
+
+}
+
+#endif // __GLTEXTURE_H__
Index: /RenderSystems/GL/include/OgreGLFBORenderTexture.h
===================================================================
--- /RenderSystems/GL/include/OgreGLFBORenderTexture.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLFBORenderTexture.h	(revision 5)
@@ -0,0 +1,194 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OgreGLFBORTT_H__
+#define __OgreGLFBORTT_H__
+
+#include "OgreGLRenderTexture.h"
+#include "OgreGLContext.h"
+#include "OgreGLFrameBufferObject.h"
+
+/// Extra GL constants
+#define GL_DEPTH24_STENCIL8_EXT                           0x88F0
+
+
+namespace Ogre {
+    class GLFBOManager;
+
+    /** RenderTexture for GL FBO
+    */
+    class _OgrePrivate GLFBORenderTexture: public GLRenderTexture
+    {
+    public:
+        GLFBORenderTexture(GLFBOManager *manager, const String &name, const GLSurfaceDesc &target);
+
+        virtual void getCustomAttribute(const String& name, void* pData);
+    protected:
+        GLFrameBufferObject mFB;
+    };
+    
+    /** Factory for GL Frame Buffer Objects, and related things.
+    */
+    class _OgrePrivate GLFBOManager: public GLRTTManager
+    {
+    public:
+        GLFBOManager(bool atimode);
+		~GLFBOManager();
+        
+        /** Bind a certain render target if it is a FBO. If it is not a FBO, bind the
+            main frame buffer.
+        */
+        void bind(RenderTarget *target);
+        
+        /** Unbind a certain render target. No-op for FBOs.
+        */
+        void unbind(RenderTarget *target) {};
+        
+        /** Get best depth and stencil supported for given internalFormat
+        */
+        void getBestDepthStencil(GLenum internalFormat, GLenum *depthFormat, GLenum *stencilFormat);
+        
+        /** Create a texture rendertarget object
+        */
+        virtual GLFBORenderTexture *createRenderTexture(const String &name, const GLSurfaceDesc &target);
+
+		/** Create a multi render target 
+		*/
+		virtual MultiRenderTarget* createMultiRenderTarget(const String & name);
+        
+        /** Create a framebuffer object
+        */
+        GLFrameBufferObject *createFrameBufferObject();
+        
+        /** Destroy a framebuffer object
+        */
+        void destroyFrameBufferObject(GLFrameBufferObject *);
+        
+        /** Request a render buffer. If format is GL_NONE, return a zero buffer.
+        */
+        GLSurfaceDesc requestRenderBuffer(GLenum format, size_t width, size_t height);
+        /** Request the specify render buffer in case shared somewhere. Ignore
+            silently if surface.buffer is 0.
+        */
+        void requestRenderBuffer(const GLSurfaceDesc &surface);
+        /** Release a render buffer. Ignore silently if surface.buffer is 0.
+        */
+        void releaseRenderBuffer(const GLSurfaceDesc &surface);
+        
+        /** Check if a certain format is usable as FBO rendertarget format
+        */
+        bool checkFormat(PixelFormat format) { return mProps[format].valid; }
+        
+        /** Get a FBO without depth/stencil for temporary use, like blitting between textures.
+        */
+        GLuint getTemporaryFBO() { return mTempFBO; }
+    private:
+        /** Frame Buffer Object properties for a certain texture format.
+        */
+        struct FormatProperties
+        {
+            bool valid; // This format can be used as RTT (FBO)
+            
+            /** Allowed modes/properties for this pixel format
+            */
+            struct Mode
+            {
+                size_t depth;     // Depth format (0=no depth)
+                size_t stencil;   // Stencil format (0=no stencil)
+            };
+            
+            std::vector<Mode> modes;
+        };
+        /** Properties for all internal formats defined by OGRE
+        */
+        FormatProperties mProps[PF_COUNT];
+        
+        /** Stencil and depth renderbuffers of the same format are re-used between surfaces of the 
+            same size and format. This can save a lot of memory when a large amount of rendertargets
+            are used.
+        */
+        struct RBFormat
+        {
+            RBFormat(GLenum format, size_t width, size_t height):
+                format(format), width(width), height(height)
+            {}
+            GLenum format;
+            size_t width;
+            size_t height;
+            // Overloaded comparison operator for usage in map
+            bool operator < (const RBFormat &other) const
+            {
+                if(format < other.format)
+                {
+                    return true;
+                }
+                else if(format == other.format)
+                {
+                    if(width < other.width)
+                    {
+                        return true;
+                    }
+                    else if(width == other.width)
+                    {
+                        if(height < other.height)
+                            return true;
+                    }
+                }
+                return false;
+            }
+        };
+        struct RBRef
+        {
+            RBRef(){}
+            RBRef(GLRenderBuffer *buffer):
+                buffer(buffer), refcount(1)
+            { }
+            GLRenderBuffer *buffer;
+            size_t refcount;
+        };
+        typedef std::map<RBFormat, RBRef> RenderBufferMap;
+        RenderBufferMap mRenderBufferMap;
+        // map(format, sizex, sizey) -> [GLSurface*,refcount]
+        
+        /** Temporary FBO identifier
+         */
+        GLuint mTempFBO;
+        
+		/// Buggy ATI driver?
+		bool mATIMode;
+        
+        /** Detect allowed FBO formats */
+        void detectFBOFormats();
+        GLuint _tryFormat(GLenum depthFormat, GLenum stencilFormat);
+        bool _tryPackedFormat(GLenum packedFormat);
+    };
+    
+
+}
+
+#endif
Index: /RenderSystems/GL/include/OgreGLFrameBufferObject.h
===================================================================
--- /RenderSystems/GL/include/OgreGLFrameBufferObject.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLFrameBufferObject.h	(revision 5)
@@ -0,0 +1,84 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OgreGLFBO_H__
+#define __OgreGLFBO_H__
+
+#include "OgreGLRenderTexture.h"
+#include "OgreGLContext.h"
+
+namespace Ogre {
+    
+    /** Frame Buffer Object abstraction.
+    */
+    class _OgrePrivate GLFrameBufferObject
+    {
+    public:
+        GLFrameBufferObject(GLFBOManager *manager);
+        ~GLFrameBufferObject();
+        //void bindSurface(size_t attachment, RenderTarget *target);
+        /** Bind a surface to a certain attachment point.
+            attachment: 0..OGRE_MAX_MULTIPLE_RENDER_TARGETS-1
+        */
+        void bindSurface(size_t attachment, const GLSurfaceDesc &target);
+        /** Unbind attachment
+        */
+        void unbindSurface(size_t attachment);
+        
+        /** Bind FrameBufferObject
+        */
+        void bind();
+        
+        /// Accessors
+        size_t getWidth();
+        size_t getHeight();
+        PixelFormat getFormat();
+        
+        GLFBOManager *getManager() { return mManager; }
+		const GLSurfaceDesc &getSurface(size_t attachment) { return mColour[attachment]; }
+    private:
+        GLFBOManager *mManager;
+        GLuint mFB;
+        GLSurfaceDesc mDepth;
+        GLSurfaceDesc mStencil;
+        // Arbitrary number of texture surfaces
+        GLSurfaceDesc mColour[OGRE_MAX_MULTIPLE_RENDER_TARGETS];
+
+		/** Initialise object (find suitable depth and stencil format).
+            Must be called every time the bindings change.
+            It fails with an exception (ERR_INVALIDPARAMS) if:
+            - Attachment point 0 has no binding
+            - Not all bound surfaces have the same size
+            - Not all bound surfaces have the same internal format
+        */
+        void initialise();
+    };
+
+}
+
+#endif
Index: /RenderSystems/GL/include/OgreGLGpuNvparseProgram.h
===================================================================
--- /RenderSystems/GL/include/OgreGLGpuNvparseProgram.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLGpuNvparseProgram.h	(revision 5)
@@ -0,0 +1,70 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __GLGpuNvparseProgram_H__
+#define __GLGpuNvparseProgram_H__
+
+#include "OgreGLPrerequisites.h"
+#include "OgreGLGpuProgram.h"
+
+namespace Ogre {
+
+class _OgrePrivate GLGpuNvparseProgram : public GLGpuProgram
+{
+public:
+    GLGpuNvparseProgram(ResourceManager* creator, 
+        const String& name, ResourceHandle handle, 
+        const String& group, bool isManual, ManualResourceLoader* loader);
+    virtual ~GLGpuNvparseProgram();
+
+
+    /// Execute the binding functions for this program
+    void bindProgram(void);
+    /// Execute the unbinding functions for this program
+    void unbindProgram(void);
+    /// Execute the param binding functions for this program
+    void bindProgramParameters(GpuProgramParametersSharedPtr params);
+
+    /// Get the assigned GL program id
+    const GLuint getProgramID(void) const
+    { return mProgramID; }
+
+protected:
+    /// @copydoc Resource::unload
+    void unloadImpl(void);
+    void loadFromSource(void);
+
+private:
+    GLuint mProgramID;
+    GLenum mProgramType;
+};
+
+}; // namespace Ogre
+
+#endif // __GLGpuNvparseProgram_H__
Index: /RenderSystems/GL/include/OgreGLGpuProgram.h
===================================================================
--- /RenderSystems/GL/include/OgreGLGpuProgram.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLGpuProgram.h	(revision 5)
@@ -0,0 +1,118 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __GLGpuProgram_H__
+#define __GLGpuProgram_H__
+
+#include "OgreGLPrerequisites.h"
+#include "OgreGpuProgram.h"
+#include "OgreHardwareVertexBuffer.h"
+
+namespace Ogre {
+
+    /** Generalised low-level GL program, can be applied to multiple types (eg ARB and NV) */
+    class _OgrePrivate GLGpuProgram : public GpuProgram
+    {
+    public:
+        GLGpuProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
+            const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
+        virtual ~GLGpuProgram();
+
+        /// Execute the binding functions for this program
+        virtual void bindProgram(void) {}
+        /// Execute the binding functions for this program
+        virtual void unbindProgram(void) {}
+
+        /// Execute the param binding functions for this program
+        virtual void bindProgramParameters(GpuProgramParametersSharedPtr params) {}
+		/// Bind just the pass iteration parameters
+		virtual void bindProgramPassIterationParameters(GpuProgramParametersSharedPtr params) {}
+
+
+        /// Get the assigned GL program id
+        const GLuint getProgramID(void) const
+        { return mProgramID; }
+
+		/** Get the attribute index for a given semantic. 
+		@remarks
+			This can be used to identify the attribute index to bind non-builtin
+			attributes like tangent and binormal.
+		*/
+		virtual GLuint getAttributeIndex(VertexElementSemantic semantic);
+		/** Test whether attribute index for a given semantic is valid. 
+		*/
+		virtual bool isAttributeValid(VertexElementSemantic semantic);
+
+    protected:
+		/** Overridden from GpuProgram, do nothing */
+		void loadFromSource(void) {}
+        /// @copydoc Resource::unloadImpl
+        void unloadImpl(void) {}
+
+        GLuint mProgramID;
+        GLenum mProgramType;
+    };
+
+    /** Specialisation of the GL low-level program for ARB programs. */
+    class _OgrePrivate GLArbGpuProgram : public GLGpuProgram
+    {
+    public:
+        GLArbGpuProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
+            const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
+        virtual ~GLArbGpuProgram();
+
+        /// @copydoc GpuProgram::setType
+        void setType(GpuProgramType t);
+
+
+        /// Execute the binding functions for this program
+        void bindProgram(void);
+        /// Execute the unbinding functions for this program
+        void unbindProgram(void);
+        /// Execute the param binding functions for this program
+        void bindProgramParameters(GpuProgramParametersSharedPtr params);
+		/// Bind just the pass iteration parameters
+		void bindProgramPassIterationParameters(GpuProgramParametersSharedPtr params);
+
+        /// Get the GL type for the program
+        const GLuint getProgramType(void) const
+        { return mProgramType; }
+
+    protected:
+        void loadFromSource(void);
+        /// @copydoc Resource::unloadImpl
+        void unloadImpl(void);
+
+    };
+
+
+
+}; // namespace Ogre
+
+#endif // __GLGpuProgram_H__
Index: /RenderSystems/GL/include/OgreGLGpuProgramManager.h
===================================================================
--- /RenderSystems/GL/include/OgreGLGpuProgramManager.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLGpuProgramManager.h	(revision 5)
@@ -0,0 +1,68 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __GLGpuProgramManager_H__
+#define __GLGpuProgramManager_H__
+
+#include "OgreGpuProgramManager.h"
+
+namespace Ogre {
+
+class _OgrePrivate GLGpuProgramManager : public GpuProgramManager
+{
+public:
+    typedef GpuProgram* (*CreateGpuProgramCallback)(ResourceManager* creator, 
+        const String& name, ResourceHandle handle, 
+        const String& group, bool isManual, ManualResourceLoader* loader,
+        GpuProgramType gptype, const String& syntaxCode);
+
+private:
+    typedef std::map<String, CreateGpuProgramCallback> ProgramMap;
+    ProgramMap mProgramMap;
+
+protected:
+    /// @copydoc ResourceManager::createImpl
+    Resource* createImpl(const String& name, ResourceHandle handle, 
+        const String& group, bool isManual, ManualResourceLoader* loader,
+        const NameValuePairList* params);
+    /// Specialised create method with specific parameters
+    Resource* createImpl(const String& name, ResourceHandle handle, 
+        const String& group, bool isManual, ManualResourceLoader* loader,
+        GpuProgramType gptype, const String& syntaxCode);
+
+public:
+    GLGpuProgramManager();
+    ~GLGpuProgramManager();
+    bool registerProgramFactory(const String& syntaxCode, CreateGpuProgramCallback createFn);
+    bool unregisterProgramFactory(const String& syntaxCode);
+};
+
+}; //namespace Ogre
+
+#endif //__GLGpuProgramManager_H__
Index: /RenderSystems/GL/include/OgreGLHardwareBufferManager.h
===================================================================
--- /RenderSystems/GL/include/OgreGLHardwareBufferManager.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLHardwareBufferManager.h	(revision 5)
@@ -0,0 +1,85 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __GLHARWAREBUFFERMANAGER_H__
+#define __GLHARWAREBUFFERMANAGER_H__
+
+#include "OgreGLPrerequisites.h"
+#include "OgreHardwareBufferManager.h"
+
+namespace Ogre {
+
+// Threshold at which glMapBuffer becomes more efficient than glBufferSubData (32k?)
+// non-Win32 machines are having issues with this, looks like buffer corruption
+// disable for now until we figure out where the problem lies
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#	define OGRE_GL_MAP_BUFFER_THRESHOLD (1024 * 32)
+#else
+#	define OGRE_GL_MAP_BUFFER_THRESHOLD 0
+#endif
+
+    /** Implementation of HardwareBufferManager for OpenGL. */
+    class _OgrePrivate GLHardwareBufferManager : public HardwareBufferManager
+    {
+	protected:
+		char* mScratchBufferPool;
+		OGRE_MUTEX(mScratchMutex)
+
+    public:
+        GLHardwareBufferManager();
+        ~GLHardwareBufferManager();
+        /// Creates a vertex buffer
+        HardwareVertexBufferSharedPtr createVertexBuffer(size_t vertexSize, 
+            size_t numVerts, HardwareBuffer::Usage usage, bool useShadowBuffer = false);
+        /// Create a hardware vertex buffer
+        HardwareIndexBufferSharedPtr createIndexBuffer(
+            HardwareIndexBuffer::IndexType itype, size_t numIndexes, 
+            HardwareBuffer::Usage usage, bool useShadowBuffer = false);
+
+        /// Utility function to get the correct GL usage based on HBU's
+        static GLenum getGLUsage(unsigned int usage);
+
+        /// Utility function to get the correct GL type based on VET's
+        static GLenum getGLType(unsigned int type);
+
+		/** Allocator method to allow us to use a pool of memory as a scratch
+			area for hardware buffers. This is because glMapBuffer is incredibly
+			inefficient, seemingly no matter what options we give it. So for the
+			period of lock/unlock, we will instead allocate a section of a local
+			memory pool, and use glBufferSubDataARB / glGetBufferSubDataARB
+			instead.
+		*/
+		void* allocateScratch(uint32 size);
+
+		/// @see allocateScratch
+		void deallocateScratch(void* ptr);
+    };
+
+}
+
+#endif // __GLHARWAREBUFFERMANAGER_H__
Index: /RenderSystems/GL/include/OgreGLHardwareIndexBuffer.h
===================================================================
--- /RenderSystems/GL/include/OgreGLHardwareIndexBuffer.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLHardwareIndexBuffer.h	(revision 5)
@@ -0,0 +1,71 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __GLHARDWAREINDEXBUFFER_H__
+#define __GLHARDWAREINDEXBUFFER_H__
+
+#include "OgreGLPrerequisites.h"
+#include "OgreHardwareIndexBuffer.h"
+
+namespace Ogre { 
+
+
+    class _OgrePrivate GLHardwareIndexBuffer : public HardwareIndexBuffer
+    {
+    private:
+        GLuint mBufferId;
+		// Scratch buffer handling
+		bool mLockedToScratch;
+		size_t mScratchOffset;
+		size_t mScratchSize;
+		void* mScratchPtr;
+		bool mScratchUploadOnUnlock;
+    protected:
+        /** See HardwareBuffer. */
+        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        /** See HardwareBuffer. */
+        void unlockImpl(void);
+    public:
+        GLHardwareIndexBuffer(IndexType idxType, size_t numIndexes, 
+            HardwareBuffer::Usage usage, bool useShadowBuffer); 
+        ~GLHardwareIndexBuffer();
+        /** See HardwareBuffer. */
+        void readData(size_t offset, size_t length, void* pDest);
+        /** See HardwareBuffer. */
+        void writeData(size_t offset, size_t length, 
+            const void* pSource, bool discardWholeBuffer = false);
+        /** See HardwareBuffer. */
+        void _updateFromShadow(void);
+
+        GLuint getGLBufferId(void) const { return mBufferId; }
+    };
+
+}
+
+#endif // __GLHARDWAREINDEXBUFFER_H__
+
Index: /RenderSystems/GL/include/OgreGLHardwareOcclusionQuery.h
===================================================================
--- /RenderSystems/GL/include/OgreGLHardwareOcclusionQuery.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLHardwareOcclusionQuery.h	(revision 5)
@@ -0,0 +1,109 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+/*
+The nVidia occlusion query extension is defined in glext.h so you don't 
+need anything else. You do need to look up the function, we provide a 
+GLSupport class to do this, which has platform implementations for 
+getProcAddress. Check the way that extensions like glActiveTextureARB are 
+initialised and used in glRenderSystem and copy what is done there.
+
+
+
+  To do: fix so dx7 and DX9 checks and flags if HW Occlusion is supported
+  See the openGl dito for ideas what to do.
+
+*/
+
+
+
+//GL_ActiveTextureARB_Func* glActiveTextureARB_ptr = (GL_ActiveTextureARB_Func)mGLSupport->getProcAddress("glActiveTextureARB");
+
+#ifndef __GLHARDWAREOCCLUSIONQUERY_H__
+#define __GLHARDWAREOCCLUSIONQUERY_H__
+
+#include "OgreGLPrerequisites.h"
+#include "OgreHardwareOcclusionQuery.h"
+
+
+namespace Ogre { 
+
+
+// If you use multiple rendering passes you can test only the first pass and all other passes don't have to be rendered 
+// if the first pass result has too few pixels visible.
+
+// Be sure to render all occluder first and whats out so the RenderQue don't switch places on 
+// the occluding objects and the tested objects because it thinks it's more effective..
+
+
+/**
+  * This is a class that is the base class of the query class for 
+  * hardware occlusion.
+  *
+  * @author Lee Sandberg email: lee@abcmedia.se
+  * Updated on 13/9/2005 by Tuan Kuranes email: tuan.kuranes@free.fr
+  */
+
+class _OgrePrivate GLHardwareOcclusionQuery : public HardwareOcclusionQuery
+{
+//----------------------------------------------------------------------
+// Public methods
+//--
+public:
+	/**
+	  * Default object constructor
+	  * 
+	  */
+	GLHardwareOcclusionQuery();
+	/**
+	  * Object destructor
+	  */
+	~GLHardwareOcclusionQuery();
+
+	//------------------------------------------------------------------
+	// Occlusion query functions (see base class documentation for this)
+	//--
+	void beginOcclusionQuery();
+	void endOcclusionQuery();
+	bool pullOcclusionQuery( unsigned int* NumOfFragments); 
+	bool isStillOutstanding(void);
+
+
+    //----------------------------------------------------------------------
+    // private members
+    //--
+    private:
+
+	    GLuint			mQueryID;
+};
+
+}
+
+#endif 
+
Index: /RenderSystems/GL/include/OgreGLHardwarePixelBuffer.h
===================================================================
--- /RenderSystems/GL/include/OgreGLHardwarePixelBuffer.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLHardwarePixelBuffer.h	(revision 5)
@@ -0,0 +1,139 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __GLPIXELBUFFER_H__
+#define __GLPIXELBUFFER_H__
+
+#include "OgreGLPrerequisites.h"
+#include "OgreHardwarePixelBuffer.h"
+
+namespace Ogre {
+	class _OgrePrivate GLHardwarePixelBuffer: public HardwarePixelBuffer
+	{
+	protected:  
+		/// Lock a box
+		PixelBox lockImpl(const Image::Box lockBox,  LockOptions options);
+
+		/// Unlock a box
+		void unlockImpl(void);
+        
+		// Internal buffer; either on-card or in system memory, freed/allocated on demand
+		// depending on buffer usage
+		PixelBox mBuffer;
+        GLenum mGLInternalFormat; // GL internal format
+		LockOptions mCurrentLockOptions;
+		
+		// Buffer allocation/freeage
+		void allocateBuffer();
+		void freeBuffer();
+		// Upload a box of pixels to this buffer on the card
+		virtual void upload(const PixelBox &data);
+		// Download a box of pixels from the card
+		virtual void download(const PixelBox &data);
+	public:
+        /// Should be called by HardwareBufferManager
+        GLHardwarePixelBuffer(size_t mWidth, size_t mHeight, size_t mDepth,
+                PixelFormat mFormat,
+                HardwareBuffer::Usage usage);
+		
+		/// @copydoc HardwarePixelBuffer::blitFromMemory
+		void blitFromMemory(const PixelBox &src, const Image::Box &dstBox);
+		
+		/// @copydoc HardwarePixelBuffer::blitToMemory
+		void blitToMemory(const Image::Box &srcBox, const PixelBox &dst);
+		
+		~GLHardwarePixelBuffer();
+        
+        /** Bind surface to frame buffer. Needs FBO extension.
+        */
+        virtual void bindToFramebuffer(GLenum attachment, size_t zoffset);
+        GLenum getGLFormat() { return mGLInternalFormat; }
+	};
+
+    /** Texture surface.
+    */
+    class _OgrePrivate GLTextureBuffer: public GLHardwarePixelBuffer
+	{
+    public:
+        /** Texture constructor */
+		GLTextureBuffer(const String &baseName, GLenum target, GLuint id, GLint face, GLint level, Usage usage, 
+			bool softwareMipmap);
+        ~GLTextureBuffer();
+        
+        /// @copydoc GLHardwarePixelBuffer::bindToFramebuffer
+        virtual void bindToFramebuffer(GLenum attachment, size_t zoffset);
+        /// @copydoc ardwarePixelBuffer::getRenderTarget
+        RenderTexture* getRenderTarget(size_t);
+        // Upload a box of pixels to this buffer on the card
+		virtual void upload(const PixelBox &data);
+		// Download a box of pixels from the card
+		virtual void download(const PixelBox &data);
+  
+        // Hardware implementation of blitFromMemory
+        virtual void blitFromMemory(const PixelBox &src_orig, const Image::Box &dstBox);
+        
+        // Notify TextureBuffer of destruction of render target
+        void _clearSliceRTT(size_t zoffset)
+        {
+            mSliceTRT[zoffset] = 0;
+        }
+        // Copy from framebuffer
+        void copyFromFramebuffer(size_t zoffset);
+        /// @copydoc HardwarePixelBuffer::blit
+        void blit(const HardwarePixelBufferSharedPtr &src, const Image::Box &srcBox, const Image::Box &dstBox);
+        // Blitting implementation
+        void blitFromTexture(GLTextureBuffer *src, const Image::Box &srcBox, const Image::Box &dstBox);
+    protected:
+        // In case this is a texture level
+		GLenum mTarget;
+		GLenum mFaceTarget; // same as mTarget in case of GL_TEXTURE_xD, but cubemap face for cubemaps
+		GLuint mTextureID;
+		GLint mFace;
+		GLint mLevel;
+		bool mSoftwareMipmap;		// Use GLU for mip mapping
+        
+        typedef std::vector<RenderTexture*> SliceTRT;
+        SliceTRT mSliceTRT;
+    };
+     /** Renderbuffer surface.  Needs FBO extension.
+     */
+    class _OgrePrivate GLRenderBuffer: public GLHardwarePixelBuffer
+	{
+    public:
+        GLRenderBuffer(GLenum format, size_t width, size_t height);
+        ~GLRenderBuffer();
+        
+        /// @copydoc GLHardwarePixelBuffer::bindToFramebuffer
+        virtual void bindToFramebuffer(GLenum attachment, size_t zoffset);
+    protected:
+        // In case this is a  render buffer
+        GLuint mRenderbufferID;
+    };
+};
+
+#endif
Index: /RenderSystems/GL/include/OgreGLHardwareVertexBuffer.h
===================================================================
--- /RenderSystems/GL/include/OgreGLHardwareVertexBuffer.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLHardwareVertexBuffer.h	(revision 5)
@@ -0,0 +1,70 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __GLHARDWAREVERTEXBUFFER_H__
+#define __GLHARDWAREVERTEXBUFFER_H__
+
+#include "OgreGLPrerequisites.h"
+#include "OgreHardwareVertexBuffer.h"
+
+namespace Ogre {
+
+    /// Specialisation of HardwareVertexBuffer for OpenGL
+    class _OgrePrivate GLHardwareVertexBuffer : public HardwareVertexBuffer 
+    {
+    private:
+        GLuint mBufferId;
+		// Scratch buffer handling
+		bool mLockedToScratch;
+		size_t mScratchOffset;
+		size_t mScratchSize;
+		void* mScratchPtr;
+		bool mScratchUploadOnUnlock;
+
+    protected:
+        /** See HardwareBuffer. */
+        void* lockImpl(size_t offset, size_t length, LockOptions options);
+        /** See HardwareBuffer. */
+        void unlockImpl(void);
+    public:
+        GLHardwareVertexBuffer(size_t vertexSize, size_t numVertices, 
+            HardwareBuffer::Usage usage, bool useShadowBuffer); 
+        ~GLHardwareVertexBuffer();
+        /** See HardwareBuffer. */
+        void readData(size_t offset, size_t length, void* pDest);
+        /** See HardwareBuffer. */
+        void writeData(size_t offset, size_t length, 
+            const void* pSource, bool discardWholeBuffer = false);
+        /** See HardwareBuffer. */
+        void _updateFromShadow(void);
+
+        GLuint getGLBufferId(void) const { return mBufferId; }
+    };
+
+}
+#endif // __GLHARDWAREVERTEXBUFFER_H__
Index: /RenderSystems/GL/include/OgreGLPBRenderTexture.h
===================================================================
--- /RenderSystems/GL/include/OgreGLPBRenderTexture.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLPBRenderTexture.h	(revision 5)
@@ -0,0 +1,106 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __GLPBRENDERTEXTURE_H__
+#define __GLPBRENDERTEXTURE_H__
+
+#include "OgreGLRenderTexture.h"
+#include "OgreGLPBuffer.h"
+namespace Ogre {
+    
+    /** RenderTexture that uses a PBuffer (offscreen rendering context) for rendering.
+    */
+    class GLPBRTTManager;
+    class _OgrePrivate GLPBRenderTexture: public GLRenderTexture
+    {
+    public:
+        GLPBRenderTexture(GLPBRTTManager *manager, const String &name, const GLSurfaceDesc &target);
+        virtual ~GLPBRenderTexture();
+        
+        virtual void getCustomAttribute(const String& name, void* pData);
+    protected:
+        GLPBRTTManager *mManager;
+        PixelComponentType mPBFormat;
+    };
+        
+    /** Manager for rendertextures and PBuffers (offscreen rendering contexts)
+    */
+    class _OgrePrivate GLPBRTTManager: public GLRTTManager
+    {
+    public:
+        GLPBRTTManager(GLSupport *support, RenderTarget *mainwindow);
+        virtual ~GLPBRTTManager();
+        
+        /** @copydoc GLRTTManager::createRenderTexture
+        */
+        virtual RenderTexture *createRenderTexture(const String &name, const GLSurfaceDesc &target);
+        
+         /** @copydoc GLRTTManager::checkFormat
+        */
+        virtual bool checkFormat(PixelFormat format);
+        
+        /** @copydoc GLRTTManager::bind
+        */
+        virtual void bind(RenderTarget *target);
+        
+        /** @copydoc GLRTTManager::unbind
+        */
+        virtual void unbind(RenderTarget *target);
+        
+        /** Create PBuffer for a certain pixel format and size
+        */
+        void requestPBuffer(PixelComponentType ctype, size_t width, size_t height);
+        
+        /** Release PBuffer for a certain pixel format
+        */
+        void releasePBuffer(PixelComponentType ctype);
+        
+        /** Get GL rendering context for a certain component type and size.
+        */
+        GLContext *getContextFor(PixelComponentType ctype, size_t width, size_t height);
+    protected:
+        /** GLSupport reference, used to create PBuffers */
+        GLSupport *mSupport;
+		/** Primary window reference */
+		RenderTarget *mMainWindow;
+		/** Primary window context */
+		GLContext *mMainContext;
+        /** Reference to a PBuffer, with refcount */
+        struct PBRef
+        {
+            PBRef(): pb(0),refcount(0) {}
+            GLPBuffer* pb;
+            size_t refcount;
+        };
+        /** Type to map each component type to a PBuffer */
+        PBRef mPBuffers[PCT_COUNT];
+    };
+}
+
+#endif // __GLPBRENDERTEXTURE_H__
Index: /RenderSystems/GL/include/OgreGLPBuffer.h
===================================================================
--- /RenderSystems/GL/include/OgreGLPBuffer.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLPBuffer.h	(revision 5)
@@ -0,0 +1,63 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __GLPBUFFER_H__
+#define __GLPBUFFER_H__
+
+#include "OgreGLPrerequisites.h"
+
+namespace Ogre {
+    /** An off-screen rendering context. These contexts are always RGBA for simplicity, speed and
+        convience, but the component format is configurable.
+    */
+    class _OgrePrivate GLPBuffer
+    {
+    public:
+        GLPBuffer(PixelComponentType format, size_t width, size_t height);
+        virtual ~GLPBuffer();
+        
+        /** Get the GL context that needs to be active to render to this PBuffer.
+        */
+        virtual GLContext *getContext() = 0;
+        
+        PixelComponentType getFormat() { return mFormat; }
+        size_t getWidth() { return mWidth; }
+        size_t getHeight() { return mHeight; }
+        
+        /** Get PBuffer component format for an OGRE pixel format.
+         */
+        static PixelComponentType getPixelComponentType(PixelFormat fmt);
+    protected:
+        PixelComponentType mFormat;
+        size_t mWidth, mHeight;
+    };
+    
+}
+
+#endif // __GLPBRENDERTEXTURE_H__
Index: /RenderSystems/GL/include/OgreGLPixelFormat.h
===================================================================
--- /RenderSystems/GL/include/OgreGLPixelFormat.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLPixelFormat.h	(revision 5)
@@ -0,0 +1,97 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __GLPIXELFORMAT_H__
+#define __GLPIXELFORMAT_H__
+
+#include "OgreGLPrerequisites.h"
+#include "OgrePixelFormat.h"
+namespace Ogre {
+    
+	/**
+	* Class to do pixel format mapping between GL and OGRE
+	*/
+	class _OgrePrivate GLPixelUtil
+	{
+	public:
+		/** Takes the OGRE pixel format and returns the appropriate GL one
+			@returns a GLenum describing the format, or 0 if there is no exactly matching 
+			one (and conversion is needed)
+		*/
+		static GLenum getGLOriginFormat(PixelFormat mFormat);
+	
+		/** Takes the OGRE pixel format and returns type that must be provided
+			to GL as data type for reading it into the GPU
+			@returns a GLenum describing the data type, or 0 if there is no exactly matching 
+			one (and conversion is needed)
+		*/
+		static GLenum getGLOriginDataType(PixelFormat mFormat);
+        
+        /**	Takes the OGRE pixel format and returns the type that must be provided
+			to GL as internal format. GL_NONE if no match exists.
+		*/
+		static GLenum getGLInternalFormat(PixelFormat mFormat);
+	
+		/**	Takes the OGRE pixel format and returns the type that must be provided
+			to GL as internal format. If no match exists, returns the closest match.
+		*/
+		static GLenum getClosestGLInternalFormat(PixelFormat mFormat);
+		
+		/**	Function to get the closest matching OGRE format to an internal GL format. To be
+			precise, the format will be chosen that is most efficient to transfer to the card 
+			without losing precision.
+			@remarks It is valid for this function to always return PF_A8R8G8B8.
+		*/
+		static PixelFormat getClosestOGREFormat(GLenum fmt);
+	
+		/** Returns the maximum number of Mipmaps that can be generated until we reach
+			the mininum format possible. This does not count the base level.
+			@param width
+				The width of the area
+			@param height
+				The height of the area
+			@param depth
+				The depth of the area
+			@param format
+				The format of the area
+			@remarks
+				In case that the format is non-compressed, this simply returns
+				how many times we can divide this texture in 2 until we reach 1x1.
+				For compressed formats, constraints apply on minimum size and alignment
+				so this might differ.
+		*/
+		static size_t getMaxMipmaps(size_t width, size_t height, size_t depth, PixelFormat format);
+        
+        /** Returns next power-of-two size if required by render system, in case
+            RSC_NON_POWER_OF_2_TEXTURES is supported it returns value as-is.
+        */
+        static size_t optionalPO2(size_t value);
+	};
+};
+
+#endif
Index: /RenderSystems/GL/include/OgreGLPlugin.h
===================================================================
--- /RenderSystems/GL/include/OgreGLPlugin.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLPlugin.h	(revision 5)
@@ -0,0 +1,64 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __GLPlugin_H__
+#define __GLPlugin_H__
+
+#include "OgrePlugin.h"
+#include "OgreGLRenderSystem.h"
+
+namespace Ogre
+{
+
+	/** Plugin instance for GL Manager */
+	class GLPlugin : public Plugin
+	{
+	public:
+		GLPlugin();
+
+
+		/// @copydoc Plugin::getName
+		const String& getName() const;
+
+		/// @copydoc Plugin::install
+		void install();
+
+		/// @copydoc Plugin::initialise
+		void initialise();
+
+		/// @copydoc Plugin::shutdown
+		void shutdown();
+
+		/// @copydoc Plugin::uninstall
+		void uninstall();
+	protected:
+		GLRenderSystem* mRenderSystem;
+	};
+}
+
+#endif
Index: /RenderSystems/GL/include/OgreGLPrerequisites.h
===================================================================
--- /RenderSystems/GL/include/OgreGLPrerequisites.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLPrerequisites.h	(revision 5)
@@ -0,0 +1,120 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __GLPrerequisites_H__
+#define __GLPrerequisites_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+    // Forward declarations
+    class GLSupport;
+    class GLRenderSystem;
+    class GLTexture;
+    class GLTextureManager;
+    class GLGpuProgram;
+    class GLContext;
+    class GLRTTManager;
+    class GLFBOManager;
+    class GLHardwarePixelBuffer;
+    class GLRenderBuffer;
+}
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#if !defined( __MINGW32__ )
+#   define NOMINMAX // required to stop windows.h messing up std::min
+#endif
+#   include <windows.h>
+#   include <wingdi.h>
+#   include <GL/glew.h>
+#   include <GL/wglew.h>
+#   include <GL/glu.h>
+#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
+#   include <GL/glew.h>
+#   include <GL/glu.h>
+#   define GL_GLEXT_PROTOTYPES
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#   include <GL/glew.h>
+#   include <OpenGL/glu.h>
+#endif
+
+/// Lots of generated code in here which triggers the new VC CRT security warnings
+#if !defined( _CRT_SECURE_NO_DEPRECATE )
+#define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+#ifdef  OGRE_DEBUG_MODE
+
+#ifndef GL_ERROR_EXCEPT
+
+#define OGRE_GL_GETERROR(ERROR_MSG) {const GLubyte *errString; \
+    GLenum errCode = glGetError(); \
+    if (errCode != GL_NO_ERROR) {  \
+    errString = gluErrorString (errCode);  \
+    LogManager::getSingleton().logMessage  ("[GL] :" + Ogre::String(ERROR_MSG) +  \
+    " : " + Ogre::String( (const char*) errString)); \
+        } \
+    }
+
+#else //GL_ERROR_EXCEPT
+
+#define OGRE_GL_GETERROR(ERROR_MSG) {const GLubyte *errString; \
+    GLenum errCode = glGetError(); \
+    if (errCode != GL_NO_ERROR) {  \
+    errString = gluErrorString (errCode);  \
+    OGRE_EXCEPT (Exception::ERR_INTERNAL_ERROR,  \
+    Ogre::String(ERROR_MSG) +  \
+    " : " + Ogre::String( (const char*) errString), String("")); \
+        } \
+    }
+
+#endif //GL_ERROR_EXCEPT
+
+#else //OGRE_DEBUG_MODE
+
+#define OGRE_GL_GETERROR()
+
+#endif //OGRE_DEBUG_MODE
+
+#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) && !defined(__MINGW32__) && !defined(OGRE_STATIC_LIB)
+#	ifdef OGRE_GLPLUGIN_EXPORTS
+#		define _OgreGLExport __declspec(dllexport)
+#	else
+#       if defined( __MINGW32__ )
+#           define _OgreGLExport
+#       else
+#    		define _OgreGLExport __declspec(dllimport)
+#       endif
+#	endif
+#elif defined ( OGRE_GCC_VISIBILITY )
+#    define _OgreGLExport  __attribute__ ((visibility("default")))
+#else
+#    define _OgreGLExport
+#endif
+
+#endif //#ifndef __GLPrerequisites_H__
Index: /RenderSystems/GL/include/OgreGLRenderSystem.h
===================================================================
--- /RenderSystems/GL/include/OgreGLRenderSystem.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLRenderSystem.h	(revision 5)
@@ -0,0 +1,472 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __GLRenderSystem_H__
+#define __GLRenderSystem_H__
+
+#include "OgreGLPrerequisites.h"
+#include "OgrePlatform.h"
+#include "OgreRenderSystem.h"
+#include "OgreGLHardwareBufferManager.h"
+#include "OgreGLGpuProgramManager.h"
+#include "OgreGLSLProgramFactory.h"
+#include "OgreVector4.h"
+
+
+namespace Ogre {
+    /**
+      Implementation of GL as a rendering system.
+     */
+    class _OgrePrivate GLRenderSystem : public RenderSystem
+    {
+    private:
+        // Rendering loop control
+        bool mStopRendering;
+
+        // Array of up to 8 lights, indexed as per API
+        // Note that a null value indicates a free slot
+        #define MAX_LIGHTS 8
+        Light* mLights[MAX_LIGHTS];
+
+        // clip planes
+        typedef std::vector<Vector4> PlaneList2;
+        PlaneList2 mClipPlanes;
+        void setGLClipPlanes() const;
+
+
+        // view matrix to set world against
+        Matrix4 mViewMatrix;
+        Matrix4 mWorldMatrix;
+        Matrix4 mTextureMatrix;
+
+        // Last min & mip filtering options, so we can combine them
+        FilterOptions mMinFilter;
+        FilterOptions mMipFilter;
+
+        // What texture coord set each texture unit is using
+        size_t mTextureCoordIndex[OGRE_MAX_TEXTURE_LAYERS];
+
+        /// holds texture type settings for every stage
+        GLenum mTextureTypes[OGRE_MAX_TEXTURE_LAYERS];
+
+		/// Number of fixed-function texture units
+		unsigned short mFixedFunctionTextureUnits;
+
+        void initConfigOptions(void);
+        void initInputDevices(void);
+        void processInputDevices(void);
+
+        void setGLLight(size_t index, Light* lt);
+        void makeGLMatrix(GLfloat gl_matrix[16], const Matrix4& m);
+ 
+        GLint getBlendMode(SceneBlendFactor ogreBlend) const;
+		GLint getTextureAddressingMode(TextureUnitState::TextureAddressingMode tam) const;
+
+        void setLights();
+
+        // Store last depth write state
+        bool mDepthWrite;
+		// Store last stencil mask state
+		uint32 mStencilMask;
+		// Store last colour write state
+		bool mColourWrite[4];
+
+        GLint convertCompareFunction(CompareFunction func) const;
+        GLint convertStencilOp(StencilOperation op, bool invert = false) const;
+
+		// internal method for anisotrophy validation
+		GLfloat _getCurrentAnisotropy(size_t unit);
+		
+        /// GL support class, used for creating windows etc
+        GLSupport* mGLSupport;
+        
+        /// Internal method to set pos / direction of a light
+        void setGLLightPositionDirection(Light* lt, GLenum lightindex);
+
+        bool mUseAutoTextureMatrix;
+        GLfloat mAutoTextureMatrix[16];
+
+        // check if the GL system has already been initialized
+        bool mGLInitialized;
+        // Initialise GL system and capabilities
+        void initGL(RenderTarget *primary);
+
+        HardwareBufferManager* mHardwareBufferManager;
+        GLGpuProgramManager* mGpuProgramManager;
+		GLSLProgramFactory* mGLSLProgramFactory;
+
+        unsigned short mCurrentLights;
+
+        GLuint getCombinedMinMipFilter(void) const;
+
+        GLGpuProgram* mCurrentVertexProgram;
+        GLGpuProgram* mCurrentFragmentProgram;
+
+		/* The main GL context - main thread only */
+        GLContext *mMainContext;
+        /* The current GL context  - main thread only*/
+        GLContext *mCurrentContext;
+		typedef std::list<GLContext*> GLContextList;
+		/// List of background thread contexts
+		GLContextList mBackgroundContextList;
+
+        /** Manager object for creating render textures.
+            Direct render to texture via GL_EXT_framebuffer_object is preferable 
+			to pbuffers, which depend on the GL support used and are generally 
+			unwieldy and slow. However, FBO support for stencil buffers is poor.
+        */
+        GLRTTManager *mRTTManager;
+    public:
+        // Default constructor / destructor
+        GLRenderSystem();
+        ~GLRenderSystem();
+
+        // ----------------------------------
+        // Overridden RenderSystem functions
+        // ----------------------------------
+        /** See
+          RenderSystem
+         */
+        const String& getName(void) const;
+        /** See
+          RenderSystem
+         */
+        ConfigOptionMap& getConfigOptions(void);
+        /** See
+          RenderSystem
+         */
+        void setConfigOption(const String &name, const String &value);
+        /** See
+          RenderSystem
+         */
+        String validateConfigOptions(void);
+        /** See
+          RenderSystem
+         */
+        RenderWindow* initialise(bool autoCreateWindow, const String& windowTitle = "OGRE Render Window");
+        /** See
+          RenderSystem
+         */
+        void reinitialise(void); // Used if settings changed mid-rendering
+        /** See
+          RenderSystem
+         */
+        void shutdown(void);
+
+        /** See
+          RenderSystem
+         */
+        void setAmbientLight(float r, float g, float b);
+        /** See
+          RenderSystem
+         */
+        void setShadingType(ShadeOptions so);
+        /** See
+          RenderSystem
+         */
+        void setLightingEnabled(bool enabled);
+        
+		/// @copydoc RenderSystem::createRenderWindow
+		RenderWindow* createRenderWindow(const String &name, unsigned int width, unsigned int height, 
+			bool fullScreen, const NameValuePairList *miscParams = 0);
+
+		/// @copydoc RenderSystem::createMultiRenderTarget
+		virtual MultiRenderTarget * createMultiRenderTarget(const String & name); 
+		
+        /** See
+          RenderSystem
+         */
+        void destroyRenderWindow(RenderWindow* pWin);
+        /** See
+          RenderSystem
+         */
+        String getErrorDescription(long errorNumber) const;
+
+        /** See
+          RenderSystem
+         */
+        VertexElementType getColourVertexElementType(void) const;
+        /** See
+          RenderSystem
+         */
+        void setNormaliseNormals(bool normalise);
+
+        // -----------------------------
+        // Low-level overridden members
+        // -----------------------------
+        /** See
+          RenderSystem
+         */
+        void _useLights(const LightList& lights, unsigned short limit);
+        /** See
+          RenderSystem
+         */
+        void _setWorldMatrix(const Matrix4 &m);
+        /** See
+          RenderSystem
+         */
+        void _setViewMatrix(const Matrix4 &m);
+        /** See
+          RenderSystem
+         */
+        void _setProjectionMatrix(const Matrix4 &m);
+        /** See
+          RenderSystem
+         */
+        void _setSurfaceParams(const ColourValue &ambient,
+            const ColourValue &diffuse, const ColourValue &specular,
+            const ColourValue &emissive, Real shininess,
+            TrackVertexColourType tracking);
+        /** See
+          RenderSystem
+         */
+		void _setPointParameters(Real size, bool attenuationEnabled, 
+			Real constant, Real linear, Real quadratic, Real minSize, Real maxSize);
+        /** See
+          RenderSystem
+         */
+		void _setPointSpritesEnabled(bool enabled);
+		/** See
+          RenderSystem
+         */
+        void _setTexture(size_t unit, bool enabled, const TexturePtr &tex);
+        /** See
+          RenderSystem
+         */
+        void _setTextureCoordSet(size_t stage, size_t index);
+        /** See
+          RenderSystem
+         */
+        void _setTextureCoordCalculation(size_t stage, TexCoordCalcMethod m, 
+            const Frustum* frustum = 0);
+        /** See
+          RenderSystem
+         */
+        void _setTextureBlendMode(size_t stage, const LayerBlendModeEx& bm);
+        /** See
+          RenderSystem
+         */
+        void _setTextureAddressingMode(size_t stage, const TextureUnitState::UVWAddressingMode& uvw);
+        /** See
+          RenderSystem
+         */
+        void _setTextureBorderColour(size_t stage, const ColourValue& colour);
+		/** See
+		RenderSystem
+		*/
+		void _setTextureMipmapBias(size_t unit, float bias);
+        /** See
+          RenderSystem
+         */
+        void _setTextureMatrix(size_t stage, const Matrix4& xform);
+        /** See
+          RenderSystem
+         */
+        void _setSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor);
+        /** See
+          RenderSystem
+         */
+        void _setAlphaRejectSettings(CompareFunction func, unsigned char value);
+        /** See
+          RenderSystem
+         */
+        void _setViewport(Viewport *vp);
+        /** See
+          RenderSystem
+         */
+        void _beginFrame(void);
+        /** See
+          RenderSystem
+         */
+        void _endFrame(void);
+        /** See
+          RenderSystem
+         */
+        void _setCullingMode(CullingMode mode);
+        /** See
+          RenderSystem
+         */
+        void _setDepthBufferParams(bool depthTest = true, bool depthWrite = true, CompareFunction depthFunction = CMPF_LESS_EQUAL);
+        /** See
+          RenderSystem
+         */
+        void _setDepthBufferCheckEnabled(bool enabled = true);
+        /** See
+          RenderSystem
+         */
+        void _setDepthBufferWriteEnabled(bool enabled = true);
+        /** See
+          RenderSystem
+         */
+        void _setDepthBufferFunction(CompareFunction func = CMPF_LESS_EQUAL);
+        /** See
+          RenderSystem
+         */
+        void _setDepthBias(float constantBias, float slopeScaleBias);
+        /** See
+          RenderSystem
+         */
+        void _setColourBufferWriteEnabled(bool red, bool green, bool blue, bool alpha);
+		/** See
+          RenderSystem
+         */
+        void _setFog(FogMode mode, const ColourValue& colour, Real density, Real start, Real end);
+        /** See
+          RenderSystem
+         */
+        void _convertProjectionMatrix(const Matrix4& matrix,
+            Matrix4& dest, bool forGpuProgram = false);
+        /** See
+          RenderSystem
+         */
+        void _makeProjectionMatrix(const Radian& fovy, Real aspect, Real nearPlane, Real farPlane, 
+            Matrix4& dest, bool forGpuProgram = false);
+        /** See
+        RenderSystem
+        */
+        void _makeProjectionMatrix(Real left, Real right, Real bottom, Real top, 
+            Real nearPlane, Real farPlane, Matrix4& dest, bool forGpuProgram = false);
+        /** See
+          RenderSystem
+         */
+		void _makeOrthoMatrix(const Radian& fovy, Real aspect, Real nearPlane, Real farPlane, 
+            Matrix4& dest, bool forGpuProgram = false);
+        /** See
+        RenderSystem
+        */
+        void _applyObliqueDepthProjection(Matrix4& matrix, const Plane& plane, 
+            bool forGpuProgram);
+        /** See
+        RenderSystem
+        */
+        void setClipPlane (ushort index, Real A, Real B, Real C, Real D);
+        /** See
+        RenderSystem
+        */
+        void enableClipPlane (ushort index, bool enable);
+        /** See
+          RenderSystem
+         */
+        void _setPolygonMode(PolygonMode level);
+        /** See
+          RenderSystem
+         */
+        void setStencilCheckEnabled(bool enabled);
+        /** See RenderSystem.
+         */
+        void setStencilBufferParams(CompareFunction func = CMPF_ALWAYS_PASS, 
+            uint32 refValue = 0, uint32 mask = 0xFFFFFFFF, 
+            StencilOperation stencilFailOp = SOP_KEEP, 
+            StencilOperation depthFailOp = SOP_KEEP,
+            StencilOperation passOp = SOP_KEEP, 
+            bool twoSidedOperation = false);
+        /** See
+          RenderSystem
+         */
+        void _setTextureUnitFiltering(size_t unit, FilterType ftype, FilterOptions filter);
+        /** See
+          RenderSystem
+         */
+		void _setTextureLayerAnisotropy(size_t unit, unsigned int maxAnisotropy);
+        /** See
+          RenderSystem
+         */
+		void setVertexDeclaration(VertexDeclaration* decl);
+        /** See
+          RenderSystem
+         */
+		void setVertexBufferBinding(VertexBufferBinding* binding);
+        /** See
+          RenderSystem
+         */
+        void _render(const RenderOperation& op);
+        /** See
+          RenderSystem
+         */
+        void bindGpuProgram(GpuProgram* prg);
+        /** See
+          RenderSystem
+         */
+        void unbindGpuProgram(GpuProgramType gptype);
+        /** See
+          RenderSystem
+         */
+        void bindGpuProgramParameters(GpuProgramType gptype, GpuProgramParametersSharedPtr params);
+		/** See
+		RenderSystem
+		*/
+		void bindGpuProgramPassIterationParameters(GpuProgramType gptype);
+        /** See
+          RenderSystem
+         */
+        void setClipPlanes(const PlaneList& clipPlanes);
+        /** See
+          RenderSystem
+         */
+        void setScissorTest(bool enabled, size_t left = 0, size_t top = 0, size_t right = 800, size_t bottom = 600) ;
+        void clearFrameBuffer(unsigned int buffers, 
+            const ColourValue& colour = ColourValue::Black, 
+            Real depth = 1.0f, unsigned short stencil = 0);
+        HardwareOcclusionQuery* createHardwareOcclusionQuery(void);
+        Real getHorizontalTexelOffset(void);
+        Real getVerticalTexelOffset(void);
+        Real getMinimumDepthInputValue(void);
+        Real getMaximumDepthInputValue(void);
+		void registerThread();
+		void unregisterThread();
+		void preExtraThreadsStarted();
+		void postExtraThreadsStarted();
+
+        // ----------------------------------
+        // GLRenderSystem specific members
+        // ----------------------------------
+        /** One time initialization for the RenderState of a context. Things that
+            only need to be set once, like the LightingModel can be defined here.
+         */
+        void _oneTimeContextInitialization();
+        /** Switch GL context, dealing with involved internal cached states too
+        */
+        void _switchContext(GLContext *context);
+        /**
+         * Set current render target to target, enabling its GL context if needed
+         */
+        void _setRenderTarget(RenderTarget *target);
+        /** Unregister a render target->context mapping. If the context of target 
+            is the current context, change the context to the main context so it
+            can be destroyed safely. 
+            
+            @note This is automatically called by the destructor of 
+            GLContext.
+         */
+        void _unregisterContext(GLContext *context);
+		/** Returns the main context */
+		GLContext* _getMainContext() {return mMainContext;} 
+    };
+}
+#endif
+
Index: /RenderSystems/GL/include/OgreGLRenderTexture.h
===================================================================
--- /RenderSystems/GL/include/OgreGLRenderTexture.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLRenderTexture.h	(revision 5)
@@ -0,0 +1,128 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __GLRENDERTEXTURE_H__
+#define __GLRENDERTEXTURE_H__
+
+#include "OgreGLTexture.h"
+
+namespace Ogre {
+    /** GL surface descriptor. Points to a 2D surface that can be rendered to. 
+    */
+    struct _OgrePrivate GLSurfaceDesc
+    {
+    public:
+        GLHardwarePixelBuffer *buffer;
+        size_t zoffset;
+    };
+    
+    /** Base class for GL Render Textures
+    */
+    class _OgrePrivate GLRenderTexture: public RenderTexture
+    {
+    public:
+        GLRenderTexture(const String &name, const GLSurfaceDesc &target);
+        virtual ~GLRenderTexture();
+        
+        bool requiresTextureFlipping() const { return true; }
+    };
+    
+    /** Manager/factory for RenderTextures.
+    */
+    class _OgrePrivate GLRTTManager: public Singleton<GLRTTManager>
+    {
+    public:
+        virtual ~GLRTTManager();
+        
+        /** Create a texture rendertarget object
+        */
+        virtual RenderTexture *createRenderTexture(const String &name, const GLSurfaceDesc &target) = 0;
+        
+         /** Check if a certain format is usable as rendertexture format
+        */
+        virtual bool checkFormat(PixelFormat format) = 0;
+        
+        /** Bind a certain render target.
+        */
+        virtual void bind(RenderTarget *target) = 0;
+        
+        /** Unbind a certain render target. This is called before binding another RenderTarget, and
+            before the context is switched. It can be used to do a copy, or just be a noop if direct
+            binding is used.
+        */
+        virtual void unbind(RenderTarget *target) = 0;
+
+		/** Create a multi render target 
+		*/
+		virtual MultiRenderTarget* createMultiRenderTarget(const String & name);
+        
+        /** Get the closest supported alternative format. If format is supported, returns format.
+        */
+        virtual PixelFormat getSupportedAlternative(PixelFormat format);
+    };
+    
+    /** RenderTexture for simple copying from frame buffer
+    */
+    class GLCopyingRTTManager;
+    class _OgrePrivate GLCopyingRenderTexture: public GLRenderTexture
+    {
+    public:
+        GLCopyingRenderTexture(GLCopyingRTTManager *manager, const String &name, const GLSurfaceDesc &target);
+        
+        virtual void getCustomAttribute(const String& name, void* pData);
+    };
+    
+    /** Simple, copying manager/factory for RenderTextures. This is only used as the last fallback if
+        both PBuffers and FBOs aren't supported.
+    */
+    class _OgrePrivate GLCopyingRTTManager: public GLRTTManager
+    {
+    public:
+        GLCopyingRTTManager();
+        virtual ~GLCopyingRTTManager();
+        
+        /** @copydoc GLRTTManager::createRenderTexture
+        */
+        virtual RenderTexture *createRenderTexture(const String &name, const GLSurfaceDesc &target);
+        
+         /** @copydoc GLRTTManager::checkFormat
+        */
+        virtual bool checkFormat(PixelFormat format);
+        
+        /** @copydoc GLRTTManager::bind
+        */
+        virtual void bind(RenderTarget *target);
+        
+        /** @copydoc GLRTTManager::unbind
+        */
+        virtual void unbind(RenderTarget *target);
+    };
+}
+
+#endif // __GLTEXTURE_H__
Index: /RenderSystems/GL/include/OgreGLSupport.h
===================================================================
--- /RenderSystems/GL/include/OgreGLSupport.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLSupport.h	(revision 5)
@@ -0,0 +1,104 @@
+#ifndef OGRE_GLSUPPORT_H
+#define OGRE_GLSUPPORT_H
+
+#include "OgreGLPrerequisites.h"
+#include "OgreGLRenderSystem.h"
+
+#include "OgreRenderWindow.h"
+#include "OgreConfigOptionMap.h"
+#include "OgreGLPBuffer.h"
+
+namespace Ogre
+{
+    
+class _OgreGLExport GLSupport
+{
+public:
+    GLSupport() { }
+    virtual ~GLSupport() { }
+
+    /**
+    * Add any special config values to the system.
+    * Must have a "Full Screen" value that is a bool and a "Video Mode" value
+    * that is a string in the form of wxh
+    */
+    virtual void addConfig() = 0;
+
+	virtual void setConfigOption(const String &name, const String &value);
+
+    /**
+    * Make sure all the extra options are valid
+    * @return string with error message
+    */
+    virtual String validateConfig() = 0;
+
+	virtual ConfigOptionMap& getConfigOptions(void);
+
+	virtual RenderWindow* createWindow(bool autoCreateWindow, GLRenderSystem* renderSystem, const String& windowTitle) = 0;
+
+	/// @copydoc RenderSystem::createRenderWindow
+	virtual RenderWindow* newWindow(const String &name, unsigned int width, unsigned int height, 
+		bool fullScreen, const NameValuePairList *miscParams = 0) = 0;
+
+    virtual bool supportsPBuffers();
+    virtual GLPBuffer *createPBuffer(PixelComponentType format, size_t width, size_t height);
+
+    /**
+    * Start anything special
+    */
+    virtual void start() = 0;
+    /**
+    * Stop anything special
+    */
+    virtual void stop() = 0;
+
+    /**
+    * get vendor information
+    */
+    const String& getGLVendor(void) const
+    {
+        return mVendor;
+    }
+
+    /**
+    * get version information
+    */
+    const String& getGLVersion(void) const
+    {
+        return mVersion;
+    }
+
+    /**
+    * compare GL version numbers
+    */
+    bool checkMinGLVersion(const String& v) const;
+
+    /**
+    * Check if an extension is available
+    */
+    virtual bool checkExtension(const String& ext) const;
+    /**
+    * Get the address of a function
+    */
+    virtual void* getProcAddress(const String& procname) = 0;
+
+    /** Intialises GL extensions, must be done AFTER the GL context has been
+        established.
+    */
+    virtual void initialiseExtensions();
+
+protected:
+	// Stored options
+    ConfigOptionMap mOptions;
+
+	// This contains the complete list of supported extensions
+    std::set<String> extensionList;
+private:
+    String mVersion;
+    String mVendor;
+
+}; // class GLSupport
+
+}; // namespace Ogre
+
+#endif // OGRE_GLSUPPORT_H
Index: /RenderSystems/GL/include/OgreGLTexture.h
===================================================================
--- /RenderSystems/GL/include/OgreGLTexture.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLTexture.h	(revision 5)
@@ -0,0 +1,173 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __GLTEXTURE_H__
+#define __GLTEXTURE_H__
+
+#include "OgreGLPrerequisites.h"
+#include "OgrePlatform.h"
+#include "OgreRenderTexture.h"
+#include "OgreTexture.h"
+#include "OgreGLSupport.h"
+#include "OgreHardwarePixelBuffer.h"
+
+namespace Ogre {
+
+    class _OgrePrivate GLTexture : public Texture
+    {
+    public:
+        // Constructor
+        GLTexture(ResourceManager* creator, const String& name, ResourceHandle handle,
+            const String& group, bool isManual, ManualResourceLoader* loader, 
+            GLSupport& support);
+
+        virtual ~GLTexture();      
+
+        void createRenderTexture();
+			
+		/// @copydoc Texture::getBuffer
+		HardwarePixelBufferSharedPtr getBuffer(size_t face, size_t mipmap);
+
+        // Takes the OGRE texture type (1d/2d/3d/cube) and returns the appropriate GL one
+        GLenum getGLTextureTarget(void) const;
+
+        GLuint getGLID() const
+        { return mTextureID; }
+
+    protected:
+		/// @copydoc Texture::createInternalResourcesImpl
+		void createInternalResourcesImpl(void);
+        /// @copydoc Resource::loadImpl
+        void loadImpl(void);
+        /// @copydoc Resource::freeInternalResourcesImpl
+        void freeInternalResourcesImpl(void);
+
+		/** internal method, create GLHardwarePixelBuffers for every face and
+			 mipmap level. This method must be called after the GL texture object was created,
+			the number of mipmaps was set (GL_TEXTURE_MAX_LEVEL) and glTexImageXD was called to
+			actually allocate the buffer
+		*/
+		void _createSurfaceList();
+    private:
+        GLuint mTextureID;
+        GLSupport& mGLSupport;
+		
+		/// Vector of pointers to subsurfaces
+		typedef std::vector<HardwarePixelBufferSharedPtr> SurfaceList;
+		SurfaceList	mSurfaceList;
+    };
+
+    /** Specialisation of SharedPtr to allow SharedPtr to be assigned to GLTexturePtr 
+    @note Has to be a subclass since we need operator=.
+    We could templatise this instead of repeating per Resource subclass, 
+    except to do so requires a form VC6 does not support i.e.
+    ResourceSubclassPtr<T> : public SharedPtr<T>
+    */
+    class _OgrePrivate GLTexturePtr : public SharedPtr<GLTexture> 
+    {
+    public:
+        GLTexturePtr() : SharedPtr<GLTexture>() {}
+        explicit GLTexturePtr(GLTexture* rep) : SharedPtr<GLTexture>(rep) {}
+        GLTexturePtr(const GLTexturePtr& r) : SharedPtr<GLTexture>(r) {} 
+        GLTexturePtr(const ResourcePtr& r) : SharedPtr<GLTexture>()
+        {
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+                pRep = static_cast<GLTexture*>(r.getPointer());
+                pUseCount = r.useCountPointer();
+                if (pUseCount)
+                {
+                    ++(*pUseCount);
+                }
+            }
+        }
+		GLTexturePtr(const TexturePtr& r) : SharedPtr<GLTexture>()
+		{
+			*this = r;
+		}
+
+        /// Operator used to convert a ResourcePtr to a GLTexturePtr
+        GLTexturePtr& operator=(const ResourcePtr& r)
+        {
+            if (pRep == static_cast<GLTexture*>(r.getPointer()))
+                return *this;
+            release();
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+                pRep = static_cast<GLTexture*>(r.getPointer());
+                pUseCount = r.useCountPointer();
+                if (pUseCount)
+                {
+                    ++(*pUseCount);
+                }
+            }
+			else
+			{
+				// RHS must be a null pointer
+				assert(r.isNull() && "RHS must be null if it has no mutex!");
+				setNull();
+			}
+            return *this;
+        }
+        /// Operator used to convert a TexturePtr to a GLTexturePtr
+        GLTexturePtr& operator=(const TexturePtr& r)
+        {
+            if (pRep == static_cast<GLTexture*>(r.getPointer()))
+                return *this;
+            release();
+			// lock & copy other mutex pointer
+            OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+            {
+			    OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+			    OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+                pRep = static_cast<GLTexture*>(r.getPointer());
+                pUseCount = r.useCountPointer();
+                if (pUseCount)
+                {
+                    ++(*pUseCount);
+                }
+            }
+			else
+			{
+				// RHS must be a null pointer
+				assert(r.isNull() && "RHS must be null if it has no mutex!");
+				setNull();
+			}
+            return *this;
+        }
+    };
+}
+
+#endif // __GLTEXTURE_H__
Index: /RenderSystems/GL/include/OgreGLTextureManager.h
===================================================================
--- /RenderSystems/GL/include/OgreGLTextureManager.h	(revision 5)
+++ /RenderSystems/GL/include/OgreGLTextureManager.h	(revision 5)
@@ -0,0 +1,68 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __GLTextureManager_H__
+#define __GLTextureManager_H__
+
+#include "OgreGLPrerequisites.h"
+#include "OgreTextureManager.h"
+#include "OgreGLTexture.h"
+#include "OgreGLSupport.h"
+
+namespace Ogre {
+    /** GL-specific implementation of a TextureManager */
+    class _OgrePrivate GLTextureManager : public TextureManager
+    {
+    public:
+        GLTextureManager(GLSupport& support);
+        virtual ~GLTextureManager();
+
+		GLuint getWarningTextureID() { return mWarningTextureID; }
+
+		/// @copydoc TextureManager::getNativeFormat
+		PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage);
+
+        /// @copydoc TextureManager::isHardwareFilteringSupported
+        bool isHardwareFilteringSupported(TextureType ttype, PixelFormat format, int usage,
+            bool preciseFormatOnly = false);
+
+    protected:
+        /// @copydoc ResourceManager::createImpl
+        Resource* createImpl(const String& name, ResourceHandle handle, 
+            const String& group, bool isManual, ManualResourceLoader* loader, 
+            const NameValuePairList* createParams);
+
+		/// Internal method to create a warning texture (bound when a texture unit is blank)
+		void createWarningTexture();
+
+        GLSupport& mGLSupport;
+		GLuint mWarningTextureID;
+    };
+}
+#endif
Index: /RenderSystems/GL/include/OgreSDLGLSupport.h
===================================================================
--- /RenderSystems/GL/include/OgreSDLGLSupport.h	(revision 5)
+++ /RenderSystems/GL/include/OgreSDLGLSupport.h	(revision 5)
@@ -0,0 +1,55 @@
+#ifndef OGRE_SDLGLSUPPORT_H
+#define OGRE_SDLGLSUPPORT_H
+
+#include "OgreSDLPrerequisites.h"
+#include "OgreGLSupport.h"
+
+namespace Ogre
+{
+    
+class _OgrePrivate SDLGLSupport : public GLSupport
+{
+public:
+    SDLGLSupport();
+    ~SDLGLSupport();
+
+    /**
+    * Add any special config values to the system.
+    * Must have a "Full Screen" value that is a bool and a "Video Mode" value
+    * that is a string in the form of wxh
+    */
+    void addConfig(void);
+    /**
+    * Make sure all the extra options are valid
+    */
+    String validateConfig(void);
+
+    virtual RenderWindow* createWindow(bool autoCreateWindow, GLRenderSystem* renderSystem, const String& windowTitle);
+
+	/// @copydoc RenderSystem::createRenderWindow
+	virtual RenderWindow* newWindow(const String &name, unsigned int width, unsigned int height, 
+		bool fullScreen, const NameValuePairList *miscParams = 0);
+
+    /**
+    * Start anything special
+    */
+    void start();
+    /**
+    * Stop anything special
+    */
+    void stop();
+
+    /**
+    * Get the address of a function
+    */
+    void* getProcAddress(const String& procname);
+private:
+    // Allowed video modes
+    SDL_Rect** mVideoModes;
+
+
+}; // class SDLGLSupport
+
+}; // namespace Ogre
+
+#endif // OGRE_SDLGLSUPPORT_H
Index: /RenderSystems/GL/include/OgreSDLPrerequisites.h
===================================================================
--- /RenderSystems/GL/include/OgreSDLPrerequisites.h	(revision 5)
+++ /RenderSystems/GL/include/OgreSDLPrerequisites.h	(revision 5)
@@ -0,0 +1,53 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __SDLPrerequisites_H__
+#define __SDLPrerequisites_H__
+
+#include "OgrePlatform.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#	include <SDL/sdl.h>
+#else
+#	include <SDL.h>
+#endif
+
+#include <OgreGLPrerequisites.h>
+
+
+namespace Ogre {
+    // Forward declarations
+    class SDLGLSupport;
+    class SDLWindow;
+
+
+}
+
+
+#endif
+
Index: /RenderSystems/GL/include/OgreSDLWindow.h
===================================================================
--- /RenderSystems/GL/include/OgreSDLWindow.h	(revision 5)
+++ /RenderSystems/GL/include/OgreSDLWindow.h	(revision 5)
@@ -0,0 +1,90 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __SDLWindow_H__
+#define __SDLWindow_H__
+
+#include "OgreSDLPrerequisites.h"
+#include "OgreRenderWindow.h"
+
+namespace Ogre {
+    class _OgrePrivate SDLWindow : public RenderWindow
+    {
+    private:
+        SDL_Surface* mScreen;
+        bool mActive;
+        bool mClosed;
+            
+        // Process pending events
+        void processEvents(void);
+
+        int (*glXGetVideoSyncSGI) (unsigned int *);
+        int (*glXWaitVideoSyncSGI) (int, int, unsigned int *);
+
+    public:
+        SDLWindow();
+        ~SDLWindow();
+
+		void create(const String& name, unsigned int width, unsigned int height,
+	            bool fullScreen, const NameValuePairList *miscParams);
+        /** Overridden - see RenderWindow */
+        void destroy(void);
+        /** Overridden - see RenderWindow */
+        bool isActive(void) const;
+        /** Overridden - see RenderWindow */
+        bool isClosed(void) const;
+        /** Overridden - see RenderWindow */
+        void reposition(int left, int top);
+        /** Overridden - see RenderWindow */
+        void resize(unsigned int width, unsigned int height);
+        /** Overridden - see RenderWindow */
+        void swapBuffers(bool waitForVSync);
+
+        /** Overridden - see RenderTarget.
+        */
+        void writeContentsToFile(const String& filename);
+        
+        /** Overridden - see RenderTarget.
+        */
+        void getCustomAttribute( const String& name, void* pData )
+        {
+            // NOOP
+        }
+
+        bool requiresTextureFlipping() const { return false; }
+
+        bool isFullScreen(void) const
+        {
+            return ( mScreen->flags & SDL_FULLSCREEN ) == SDL_FULLSCREEN;
+        }
+    };
+}
+
+#endif
+
Index: /RenderSystems/GL/include/OgreWin32Context.h
===================================================================
--- /RenderSystems/GL/include/OgreWin32Context.h	(revision 5)
+++ /RenderSystems/GL/include/OgreWin32Context.h	(revision 5)
@@ -0,0 +1,57 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OgreW32Context_H__
+#define __OgreW32Context_H__
+
+#include "OgreWin32Prerequisites.h"
+#include "OgreGLContext.h"
+
+namespace Ogre {
+
+    class _OgrePrivate Win32Context: public GLContext
+    {
+    public:
+        Win32Context(HDC     HDC,
+                     HGLRC   Glrc);
+        virtual ~Win32Context();
+
+        /** See GLContext */
+        virtual void setCurrent();
+		/** See GLContext */
+		virtual void endCurrent();
+		/// @copydoc GLContext::clone
+		GLContext* clone() const;
+
+	protected:
+        HDC     mHDC;
+        HGLRC   mGlrc;
+    };
+}
+
+#endif
Index: /RenderSystems/GL/include/OgreWin32GLSupport.h
===================================================================
--- /RenderSystems/GL/include/OgreWin32GLSupport.h	(revision 5)
+++ /RenderSystems/GL/include/OgreWin32GLSupport.h	(revision 5)
@@ -0,0 +1,75 @@
+#ifndef __OgreWin32GLSupport_H__
+#define __OgreWin32GLSupport_H__
+
+#include "OgreWin32Prerequisites.h"
+#include "OgreGLSupport.h"
+#include "OgreGLRenderSystem.h"
+
+namespace Ogre
+{
+    
+	class _OgrePrivate Win32GLSupport : public GLSupport
+	{
+	public:
+        Win32GLSupport();
+		/**
+		* Add any special config values to the system.
+		* Must have a "Full Screen" value that is a bool and a "Video Mode" value
+		* that is a string in the form of wxhxb
+		*/
+		void addConfig();
+
+		void setConfigOption(const String &name, const String &value);
+
+		/**
+		* Make sure all the extra options are valid
+		*/
+		String validateConfig();
+
+		virtual RenderWindow* createWindow(bool autoCreateWindow, GLRenderSystem* renderSystem, const String& windowTitle = "OGRE Render Window");
+
+		/// @copydoc RenderSystem::createRenderWindow
+		virtual RenderWindow* newWindow(const String &name, unsigned int width, unsigned int height, 
+			bool fullScreen, const NameValuePairList *miscParams = 0);
+
+		
+		/**
+		* Start anything special
+		*/
+		void start();
+		/**
+		* Stop anything special
+		*/
+		void stop();
+
+		/**
+		* Get the address of a function
+		*/
+		void* getProcAddress(const String& procname);
+
+		/**
+		 * Initialise extensions
+		 */
+		virtual void initialiseExtensions();
+		
+
+		bool selectPixelFormat(HDC hdc, int colourDepth, int multisample = 0);
+
+		virtual bool supportsPBuffers();
+		virtual GLPBuffer *createPBuffer(PixelComponentType format, size_t width, size_t height);
+	private:
+		// Allowed video modes
+		std::vector<DEVMODE> mDevModes;
+		Win32Window *mInitialWindow;
+		std::vector<int> mFSAALevels;
+		bool mHasPixelFormatARB;
+        bool mHasMultisample;
+
+		void refreshConfig();
+		void initialiseWGL();
+		static LRESULT CALLBACK dummyWndProc(HWND hwnd, UINT umsg, WPARAM wp, LPARAM lp);
+	};
+
+}
+
+#endif
Index: /RenderSystems/GL/include/OgreWin32Prerequisites.h
===================================================================
--- /RenderSystems/GL/include/OgreWin32Prerequisites.h	(revision 5)
+++ /RenderSystems/GL/include/OgreWin32Prerequisites.h	(revision 5)
@@ -0,0 +1,45 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OgreWin32Prerequisites_H__
+#define __OgreWin32Prerequisites_H__
+
+#include <windows.h>
+
+#include <OgreGLPrerequisites.h>
+
+
+namespace Ogre {
+    // Forward declarations
+    class Win32GLSupport;
+    class Win32Window;
+    class Win32Context;
+}
+
+
+#endif
Index: /RenderSystems/GL/include/OgreWin32RenderTexture.h
===================================================================
--- /RenderSystems/GL/include/OgreWin32RenderTexture.h	(revision 5)
+++ /RenderSystems/GL/include/OgreWin32RenderTexture.h	(revision 5)
@@ -0,0 +1,56 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __Win32RT_H__
+#define __Win32RT_H__
+
+#include "OgreWin32Prerequisites.h"
+#include "OgreWin32Context.h"
+#include "OgreGLPBuffer.h"
+
+namespace Ogre {
+    class _OgrePrivate Win32PBuffer : public GLPBuffer
+    {
+	public:
+		Win32PBuffer(PixelComponentType format, size_t width, size_t height);
+		~Win32PBuffer();
+	    
+		virtual GLContext *getContext() { return mContext; }
+    protected:
+        void createPBuffer();
+		void destroyPBuffer();
+
+		HDC		mHDC;
+		HGLRC	mGlrc;
+		HPBUFFERARB mPBuffer;
+        Win32Context *mContext;
+    };
+}
+
+#endif
Index: /RenderSystems/GL/include/OgreWin32Window.h
===================================================================
--- /RenderSystems/GL/include/OgreWin32Window.h	(revision 5)
+++ /RenderSystems/GL/include/OgreWin32Window.h	(revision 5)
@@ -0,0 +1,86 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __Win32Window_H__
+#define __Win32Window_H__
+
+#include "OgreWin32Prerequisites.h"
+#include "OgreRenderWindow.h"
+
+namespace Ogre {
+    class _OgrePrivate Win32Window : public RenderWindow
+    {
+    public:
+        Win32Window(Win32GLSupport &glsupport);
+        ~Win32Window();
+
+       void create(const String& name, unsigned int width, unsigned int height,
+	            bool fullScreen, const NameValuePairList *miscParams);
+	   void setFullscreen(bool fullScreen, unsigned int width, unsigned int height);
+        void destroy(void);
+        bool isVisible() const;
+        bool isClosed(void) const;
+        void reposition(int left, int top);
+        void resize(unsigned int width, unsigned int height);
+        void swapBuffers(bool waitForVSync);
+
+        /** Overridden - see RenderTarget.
+        */
+        void writeContentsToFile(const String& filename);
+
+		bool requiresTextureFlipping() const { return false; }
+
+		HWND getWindowHandle() const { return mHWnd; }
+		HDC getHDC() const { return mHDC; }
+		
+		// Method for dealing with resize / move & 3d library
+		virtual void windowMovedOrResized(void);
+
+		void getCustomAttribute( const String& name, void* pData );
+
+        /** Used to set the active state of the render target.
+        */
+        virtual void setActive( bool state );
+
+	protected:
+		Win32GLSupport &mGLSupport;
+		HWND	mHWnd;					// Win32 Window handle
+		HDC		mHDC;
+		HGLRC	mGlrc;
+        bool    mIsExternal;
+	bool    mIsExternalGLControl;
+	bool	mIsExternalGLContext;
+        bool    mSizing;
+		bool	mClosed;
+        int     mDisplayFrequency;      // fullscreen only, to restore display
+        Win32Context *mContext;
+    };
+}
+
+#endif
Index: /RenderSystems/GL/include/gtk/OgreGTKGLSupport.h
===================================================================
--- /RenderSystems/GL/include/gtk/OgreGTKGLSupport.h	(revision 5)
+++ /RenderSystems/GL/include/gtk/OgreGTKGLSupport.h	(revision 5)
@@ -0,0 +1,115 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef INCL_OGRE_GTKGLSUPPORT_H
+#define INCL_OGRE_GTKGLSUPPORT_H
+
+#include "OgreGLSupport.h"
+
+#include <gtkmm/main.h>
+#include <gtkglmm.h>
+
+namespace Ogre {
+
+class OGREWidget;
+
+/**
+ * GL support in a GTK window.
+ *
+ * I made this a Singleton, so that the main context can be queried by
+ * GTKWindows.
+ */
+class GTKGLSupport : public GLSupport, public Singleton<GTKGLSupport>
+{
+public:
+    GTKGLSupport();
+    void addConfig();
+    void setConfigOptions(const String& name, const String& value);
+    String validateConfig();
+    RenderWindow* createWindow(bool autoCreateWindow, 
+                               GLRenderSystem* renderSystem, const String& windowTitle);
+    RenderWindow* newWindow(const String& name, unsigned int width, unsigned int height, 
+                            unsigned int colourDepth, bool fullScreen, int left, int top,
+                            bool depthBuffer, RenderWindow* parentWindowHandle,
+                            bool vsync);
+    void start();
+    void stop();
+    void begin_context(RenderTarget *_target = 0);
+    void end_context();
+    void initialiseExtensions(void);
+    bool checkMinGLVersion(const String& v) const;
+    bool checkExtension(const String& ext) const;
+    void* getProcAddress(const String& procname);
+
+    Glib::RefPtr<const Gdk::GL::Context> getMainContext() const; 
+
+    /** Override standard Singleton retrieval.
+    @remarks
+    Why do we do this? Well, it's because the Singleton
+    implementation is in a .h file, which means it gets compiled
+    into anybody who includes it. This is needed for the
+    Singleton template to work, but we actually only want it
+    compiled into the implementation of the class based on the
+    Singleton, not all of them. If we don't change this, we get
+    link errors when trying to use the Singleton-based class from
+    an outside dll.
+    @par
+    This method just delegates to the template version anyway,
+    but the implementation stays in this single compilation unit,
+    preventing link errors.
+    */
+    static GTKGLSupport& getSingleton(void);
+    /** Override standard Singleton retrieval.
+    @remarks
+    Why do we do this? Well, it's because the Singleton
+    implementation is in a .h file, which means it gets compiled
+    into anybody who includes it. This is needed for the
+    Singleton template to work, but we actually only want it
+    compiled into the implementation of the class based on the
+    Singleton, not all of them. If we don't change this, we get
+    link errors when trying to use the Singleton-based class from
+    an outside dll.
+    @par
+    This method just delegates to the template version anyway,
+    but the implementation stays in this single compilation unit,
+    preventing link errors.
+    */
+    static GTKGLSupport* getSingletonPtr(void);
+private:
+    int _context_ref;
+    Gtk::Main _kit;
+    //OGREWidget* _ogre_widget;
+
+    Glib::RefPtr<Gdk::GL::Context> _main_context;
+    Glib::RefPtr<Gdk::GL::Window> _main_window;
+}; // class GTKGLSupport
+
+}; // namespace Ogre
+
+#endif // INCL_OGRE_GTKGLSUPPORT_H
Index: /RenderSystems/GL/include/gtk/OgreGTKWindow.h
===================================================================
--- /RenderSystems/GL/include/gtk/OgreGTKWindow.h	(revision 5)
+++ /RenderSystems/GL/include/gtk/OgreGTKWindow.h	(revision 5)
@@ -0,0 +1,100 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef INCL_OGRE_GTKWINDOW_H
+#define INCL_OGRE_GTKWINDOW_H
+
+#include "OgreRenderWindow.h"
+
+#include <gtkmm/main.h>
+#include <gtkmm/window.h>
+#include <gtkglmm.h>
+
+#include <GL/gl.h>
+
+namespace Ogre {
+
+class OGREWidget : public Gtk::GL::DrawingArea
+{
+public:
+    OGREWidget(bool useDepthBuffer);
+};
+    
+class GTKWindow : public RenderWindow, public SigC::Object
+{
+public:
+    GTKWindow();
+    ~GTKWindow();
+
+    /**
+    * Pump the main loop to actually generate events
+    * @returns false when there are no events left to pump
+    */
+    bool pump_events();
+
+    /**
+    * Get the actual widget that is housing OGRE's GL view.
+    */
+    OGREWidget* get_ogre_widget();
+
+    void create(const String& name, unsigned int width, unsigned int height, unsigned int colourDepth,
+                bool fullScreen, int left, int top, bool depthBuffer, 
+                void* miscParam, ...);
+
+    void destroy(void);
+    bool isActive(void) const;
+    bool isClosed(void) const;
+    void reposition(int left, int top);
+    void resize(unsigned int width, unsigned int height);
+    void swapBuffers(bool waitForVSync);
+    void writeContentsToFile(const String& filename);
+
+    bool requiresTextureFlipping() const { return false; }
+
+	/**
+	 * Get a custom, GTK specific attribute. The specific attributes
+	 * are:
+	 * GTKMMWINDOW		The Gtk::Window instance (Rendering window)
+	 * GTKGLMMWIDGET	The Gtk::GL::DrawingArea instance (Ogre widget)
+	 */
+    void getCustomAttribute( const String& name, void* pData );
+protected:
+    // Signal handlers
+    bool on_delete_event(GdkEventAny* event);
+    bool on_expose_event(GdkEventExpose* event);
+    // bool SimpleGLScene::on_configure_event(GdkEventConfigure* event) 
+private:
+    //Gtk::Main* kit;
+    Gtk::Window *mGtkWindow;
+    OGREWidget* ogre;
+}; // class GTKWindow
+
+}; // namespace Ogre
+
+#endif // INCL_OGRE_GTKWINDOW_H
Index: /RenderSystems/GL/scripts/RenderSystem_GL.cbp
===================================================================
--- /RenderSystems/GL/scripts/RenderSystem_GL.cbp	(revision 5)
+++ /RenderSystems/GL/scripts/RenderSystem_GL.cbp	(revision 5)
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="RenderSystem_GL" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\lib\RenderSystem_GL_d.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OPENGL32" />
+					<Add library="GLU32" />
+					<Add library="GDI32" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\lib\RenderSystem_GL.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O2" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OPENGL32" />
+					<Add library="GLU32" />
+					<Add library="GDI32" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add option="-D_USRDLL" />
+			<Add option="-DOGRE_GL_USE_MULTITEXTURING" />
+			<Add option="-DOGRE_GLPLUGIN_EXPORTS" />
+			<Add directory="..\include" />
+			<Add directory="..\src\win32" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\src\nvparse" />
+			<Add directory="..\src\nvparse\winheaders" />
+			<Add directory="..\src\atifs\include" />
+			<Add directory="..\src\glsl\include" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\..\..\Dependencies\include\GL\gl.h" />
+		<Unit filename="..\..\..\Dependencies\include\GL\glext.h" />
+		<Unit filename="..\..\..\Dependencies\include\GL\glxext.h" />
+		<Unit filename="..\include\GL\glew.h" />
+		<Unit filename="..\include\GL\wglew.h" />
+		<Unit filename="..\include\OgreGLContext.h" />
+		<Unit filename="..\include\OgreGLDefaultHardwareBufferManager.h" />
+		<Unit filename="..\include\OgreGLFBOMultiRenderTarget.h" />
+		<Unit filename="..\include\OgreGLFBORenderTexture.h" />
+		<Unit filename="..\include\OgreGLFrameBufferObject.h" />
+		<Unit filename="..\include\OgreGLGpuNvparseProgram.h" />
+		<Unit filename="..\include\OgreGLGpuProgram.h" />
+		<Unit filename="..\include\OgreGLGpuProgramManager.h" />
+		<Unit filename="..\include\OgreGLHardwareBufferManager.h" />
+		<Unit filename="..\include\OgreGLHardwareIndexBuffer.h" />
+		<Unit filename="..\include\OgreGLHardwareOcclusionQuery.h" />
+		<Unit filename="..\include\OgreGLHardwarePixelBuffer.h" />
+		<Unit filename="..\include\OgreGLHardwareVertexBuffer.h" />
+		<Unit filename="..\include\OgreGLPBRenderTexture.h" />
+		<Unit filename="..\include\OgreGLPBuffer.h" />
+		<Unit filename="..\include\OgreGLPixelFormat.h" />
+		<Unit filename="..\include\OgreGLPlugin.h" />
+		<Unit filename="..\include\OgreGLPrerequisites.h" />
+		<Unit filename="..\include\OgreGLRenderSystem.h" />
+		<Unit filename="..\include\OgreGLRenderTexture.h" />
+		<Unit filename="..\include\OgreGLSupport.h" />
+		<Unit filename="..\include\OgreGLTexture.h" />
+		<Unit filename="..\include\OgreGLTextureManager.h" />
+		<Unit filename="..\include\OgreSDLGLSupport.h" />
+		<Unit filename="..\include\OgreSDLPrerequisites.h" />
+		<Unit filename="..\include\OgreSDLWindow.h" />
+		<Unit filename="..\include\OgreWin32Context.h" />
+		<Unit filename="..\include\OgreWin32GLSupport.h" />
+		<Unit filename="..\include\OgreWin32Prerequisites.h" />
+		<Unit filename="..\include\OgreWin32RenderTexture.h" />
+		<Unit filename="..\include\OgreWin32Window.h" />
+		<Unit filename="..\misc\OgreGLEngine.def" />
+		<Unit filename="..\src\GLSL\include\OgreGLSLExtSupport.h" />
+		<Unit filename="..\src\GLSL\include\OgreGLSLGpuProgram.h" />
+		<Unit filename="..\src\GLSL\include\OgreGLSLLinkProgram.h" />
+		<Unit filename="..\src\GLSL\include\OgreGLSLLinkProgramManager.h" />
+		<Unit filename="..\src\GLSL\include\OgreGLSLProgram.h" />
+		<Unit filename="..\src\GLSL\include\OgreGLSLProgramFactory.h" />
+		<Unit filename="..\src\GLSL\src\OgreGLSLExtSupport.cpp" />
+		<Unit filename="..\src\GLSL\src\OgreGLSLGpuProgram.cpp" />
+		<Unit filename="..\src\GLSL\src\OgreGLSLLinkProgram.cpp" />
+		<Unit filename="..\src\GLSL\src\OgreGLSLLinkProgramManager.cpp" />
+		<Unit filename="..\src\GLSL\src\OgreGLSLProgram.cpp" />
+		<Unit filename="..\src\GLSL\src\OgreGLSLProgramFactory.cpp" />
+		<Unit filename="..\src\OgreGLATIFSInit.cpp" />
+		<Unit filename="..\src\OgreGLContext.cpp" />
+		<Unit filename="..\src\OgreGLDefaultHardwareBufferManager.cpp" />
+		<Unit filename="..\src\OgreGLEngineDll.cpp" />
+		<Unit filename="..\src\OgreGLFBOMultiRenderTarget.cpp" />
+		<Unit filename="..\src\OgreGLFBORenderTexture.cpp" />
+		<Unit filename="..\src\OgreGLFrameBufferObject.cpp" />
+		<Unit filename="..\src\OgreGLGpuNvparseProgram.cpp" />
+		<Unit filename="..\src\OgreGLGpuProgram.cpp" />
+		<Unit filename="..\src\OgreGLGpuProgramManager.cpp" />
+		<Unit filename="..\src\OgreGLHardwareBufferManager.cpp" />
+		<Unit filename="..\src\OgreGLHardwareIndexBuffer.cpp" />
+		<Unit filename="..\src\OgreGLHardwareOcclusionQuery.cpp" />
+		<Unit filename="..\src\OgreGLHardwarePixelBuffer.cpp" />
+		<Unit filename="..\src\OgreGLHardwareVertexBuffer.cpp" />
+		<Unit filename="..\src\OgreGLPBRenderTexture.cpp" />
+		<Unit filename="..\src\OgreGLPixelFormat.cpp" />
+		<Unit filename="..\src\OgreGLPlugin.cpp" />
+		<Unit filename="..\src\OgreGLRenderSystem.cpp" />
+		<Unit filename="..\src\OgreGLRenderTexture.cpp" />
+		<Unit filename="..\src\OgreGLSupport.cpp" />
+		<Unit filename="..\src\OgreGLTexture.cpp" />
+		<Unit filename="..\src\OgreGLTextureManager.cpp" />
+		<Unit filename="..\src\OgreWin32GLSupport.cpp" />
+		<Unit filename="..\src\OgreWin32RenderTexture.cpp" />
+		<Unit filename="..\src\OgreWin32Window.cpp" />
+		<Unit filename="..\src\atifs\include\ATI_FS_GLGpuProgram.h" />
+		<Unit filename="..\src\atifs\include\Compiler2Pass.h" />
+		<Unit filename="..\src\atifs\include\ps_1_4.h" />
+		<Unit filename="..\src\atifs\src\ATI_FS_GLGpuProgram.cpp" />
+		<Unit filename="..\src\atifs\src\Compiler2Pass.cpp" />
+		<Unit filename="..\src\atifs\src\ps_1_4.cpp" />
+		<Unit filename="..\src\glew.cpp" />
+		<Unit filename="..\src\nvparse\_ps1.0_lexer.cpp" />
+		<Unit filename="..\src\nvparse\_ps1.0_parser.cpp" />
+		<Unit filename="..\src\nvparse\_ps1.0_parser.h" />
+		<Unit filename="..\src\nvparse\_rc1.0_lexer.cpp" />
+		<Unit filename="..\src\nvparse\_rc1.0_parser.cpp" />
+		<Unit filename="..\src\nvparse\_rc1.0_parser.h" />
+		<Unit filename="..\src\nvparse\_ts1.0_lexer.cpp" />
+		<Unit filename="..\src\nvparse\_ts1.0_parser.cpp" />
+		<Unit filename="..\src\nvparse\_ts1.0_parser.h" />
+		<Unit filename="..\src\nvparse\_vs1.0_lexer.cpp" />
+		<Unit filename="..\src\nvparse\_vs1.0_parser.cpp" />
+		<Unit filename="..\src\nvparse\_vs1.0_parser.h" />
+		<Unit filename="..\src\nvparse\avp1.0_impl.cpp" />
+		<Unit filename="..\src\nvparse\macro.h" />
+		<Unit filename="..\src\nvparse\nvparse.cpp" />
+		<Unit filename="..\src\nvparse\nvparse.h" />
+		<Unit filename="..\src\nvparse\nvparse_errors.cpp" />
+		<Unit filename="..\src\nvparse\nvparse_errors.h" />
+		<Unit filename="..\src\nvparse\nvparse_externs.h" />
+		<Unit filename="..\src\nvparse\ps1.0_program.cpp" />
+		<Unit filename="..\src\nvparse\ps1.0_program.h" />
+		<Unit filename="..\src\nvparse\rc1.0_combiners.cpp" />
+		<Unit filename="..\src\nvparse\rc1.0_combiners.h" />
+		<Unit filename="..\src\nvparse\rc1.0_final.cpp" />
+		<Unit filename="..\src\nvparse\rc1.0_final.h" />
+		<Unit filename="..\src\nvparse\rc1.0_general.cpp" />
+		<Unit filename="..\src\nvparse\rc1.0_general.h" />
+		<Unit filename="..\src\nvparse\rc1.0_register.h" />
+		<Unit filename="..\src\nvparse\ts1.0_inst.cpp" />
+		<Unit filename="..\src\nvparse\ts1.0_inst.h" />
+		<Unit filename="..\src\nvparse\ts1.0_inst_list.cpp" />
+		<Unit filename="..\src\nvparse\ts1.0_inst_list.h" />
+		<Unit filename="..\src\nvparse\vcp1.0_impl.cpp" />
+		<Unit filename="..\src\nvparse\vp1.0_impl.cpp" />
+		<Unit filename="..\src\nvparse\vs1.0_inst.cpp" />
+		<Unit filename="..\src\nvparse\vs1.0_inst.h" />
+		<Unit filename="..\src\nvparse\vs1.0_inst_list.cpp" />
+		<Unit filename="..\src\nvparse\vs1.0_inst_list.h" />
+		<Unit filename="..\src\nvparse\vsp1.0_impl.cpp" />
+		<Unit filename="..\src\nvparse\winheaders\unistd.h" />
+		<Unit filename="..\src\win32\OgreWin32Context.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /RenderSystems/GL/scripts/RenderSystem_GL.vcproj
===================================================================
--- /RenderSystems/GL/scripts/RenderSystem_GL.vcproj	(revision 5)
+++ /RenderSystems/GL/scripts/RenderSystem_GL.vcproj	(revision 5)
@@ -0,0 +1,638 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="RenderSystem_GL"
+	ProjectGUID="{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\src\win32;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\src\nvparse;..\src\nvparse\winheaders;..\src\atifs\include;..\src\glsl\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_GLPLUGIN_EXPORTS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="2"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain_d.lib OPENGL32.lib GLU32.lib"
+				OutputFile="$(OutDir)/$(ProjectName)_d.dll"
+				Version="0.99"
+				LinkIncremental="2"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName)_d.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="..\include;..\src\win32;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\src\nvparse;..\src\nvparse\winheaders;..\src\atifs\include;..\src\glsl\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_GLPLUGIN_EXPORTS;"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="TRUE"
+				AdditionalDependencies="OgreMain.lib OPENGL32.lib GLU32.lib"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\src\win32;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\src\nvparse;..\src\nvparse\winheaders;..\src\atifs\include;..\src\glsl\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_GLPLUGIN_EXPORTS;OGRE_STATIC_LIB"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="2"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)/$(ProjectName)Static_d.lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="2"
+				AdditionalIncludeDirectories="..\include;..\src\win32;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\src\nvparse;..\src\nvparse\winheaders;..\src\atifs\include;..\src\glsl\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_GLPLUGIN_EXPORTS;OGRE_STATIC_LIB"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)/$(ProjectName)Static.lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\glew.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLATIFSInit.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLContext.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLDefaultHardwareBufferManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLEngineDll.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLFBOMultiRenderTarget.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLFBORenderTexture.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLFrameBufferObject.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLGpuNvparseProgram.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLGpuProgram.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLGpuProgramManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLHardwareBufferManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLHardwareIndexBuffer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLHardwareOcclusionQuery.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLHardwarePixelBuffer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLHardwareVertexBuffer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLPBRenderTexture.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLPixelFormat.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLPlugin.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLRenderSystem.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLRenderTexture.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLSupport.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLTexture.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreGLTextureManager.cpp">
+			</File>
+			<File
+				RelativePath="..\src\win32\OgreWin32Context.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreWin32GLSupport.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreWin32RenderTexture.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreWin32Window.cpp">
+			</File>
+			<Filter
+				Name="nvparse"
+				Filter="">
+				<File
+					RelativePath="..\src\nvparse\_ps1.0_lexer.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_ps1.0_parser.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_ps1.0_parser.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_rc1.0_lexer.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_rc1.0_parser.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_rc1.0_parser.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_ts1.0_lexer.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_ts1.0_parser.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_ts1.0_parser.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_vs1.0_lexer.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_vs1.0_parser.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_vs1.0_parser.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\avp1.0_impl.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\macro.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\nvparse.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\nvparse.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\nvparse_errors.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\nvparse_errors.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\nvparse_externs.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\ps1.0_program.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\ps1.0_program.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\rc1.0_combiners.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\rc1.0_combiners.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\rc1.0_final.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\rc1.0_final.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\rc1.0_general.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\rc1.0_general.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\rc1.0_register.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\ts1.0_inst.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\ts1.0_inst.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\ts1.0_inst_list.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\ts1.0_inst_list.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\winheaders\unistd.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\vcp1.0_impl.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\vp1.0_impl.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\vs1.0_inst.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\vs1.0_inst.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\vs1.0_inst_list.cpp">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\vs1.0_inst_list.h">
+				</File>
+				<File
+					RelativePath="..\src\nvparse\vsp1.0_impl.cpp">
+				</File>
+			</Filter>
+			<Filter
+				Name="atifs"
+				Filter="">
+				<File
+					RelativePath="..\src\atifs\src\ATI_FS_GLGpuProgram.cpp">
+				</File>
+				<File
+					RelativePath="..\src\atifs\include\ATI_FS_GLGpuProgram.h">
+				</File>
+				<File
+					RelativePath="..\src\atifs\src\Compiler2Pass.cpp">
+				</File>
+				<File
+					RelativePath="..\src\atifs\include\Compiler2Pass.h">
+				</File>
+				<File
+					RelativePath="..\src\atifs\src\ps_1_4.cpp">
+				</File>
+				<File
+					RelativePath="..\src\atifs\include\ps_1_4.h">
+				</File>
+			</Filter>
+			<Filter
+				Name="glsl"
+				Filter="">
+				<File
+					RelativePath="..\src\GLSL\src\OgreGLSLExtSupport.cpp">
+				</File>
+				<File
+					RelativePath="..\src\GLSL\src\OgreGLSLGpuProgram.cpp">
+				</File>
+				<File
+					RelativePath="..\src\GLSL\src\OgreGLSLLinkProgram.cpp">
+				</File>
+				<File
+					RelativePath="..\src\GLSL\src\OgreGLSLLinkProgramManager.cpp">
+				</File>
+				<File
+					RelativePath="..\src\GLSL\src\OgreGLSLProgram.cpp">
+				</File>
+				<File
+					RelativePath="..\src\GLSL\src\OgreGLSLProgramFactory.cpp">
+				</File>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\..\..\Dependencies\include\GL\gl.h">
+			</File>
+			<File
+				RelativePath="..\include\GL\glew.h">
+			</File>
+			<File
+				RelativePath="..\..\..\Dependencies\include\GL\glext.h">
+			</File>
+			<File
+				RelativePath="..\..\..\Dependencies\include\GL\glxext.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLContext.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLDefaultHardwareBufferManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLFBOMultiRenderTarget.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLFBORenderTexture.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLFrameBufferObject.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLGpuNvparseProgram.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLGpuProgram.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLGpuProgramManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLHardwareBufferManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLHardwareIndexBuffer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLHardwareOcclusionQuery.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLHardwarePixelBuffer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLHardwareVertexBuffer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLPBRenderTexture.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLPBuffer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLPixelFormat.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLPlugin.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLPrerequisites.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLRenderSystem.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLRenderTexture.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLSupport.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLTexture.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreGLTextureManager.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSDLGLSupport.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSDLPrerequisites.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreSDLWindow.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreWin32Context.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreWin32GLSupport.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreWin32Prerequisites.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreWin32RenderTexture.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreWin32Window.h">
+			</File>
+			<File
+				RelativePath="..\include\GL\wglew.h">
+			</File>
+			<Filter
+				Name="glsl"
+				Filter="">
+				<File
+					RelativePath="..\src\GLSL\include\OgreGLSLExtSupport.h">
+				</File>
+				<File
+					RelativePath="..\src\GLSL\include\OgreGLSLGpuProgram.h">
+				</File>
+				<File
+					RelativePath="..\src\GLSL\include\OgreGLSLLinkProgram.h">
+				</File>
+				<File
+					RelativePath="..\src\GLSL\include\OgreGLSLLinkProgramManager.h">
+				</File>
+				<File
+					RelativePath="..\src\GLSL\include\OgreGLSLProgram.h">
+				</File>
+				<File
+					RelativePath="..\src\GLSL\include\OgreGLSLProgramFactory.h">
+				</File>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp
===================================================================
--- /RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp	(revision 5)
+++ /RenderSystems/GL/scripts/RenderSystem_GL_linux.cbp	(revision 5)
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="RenderSystem_GL" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../../lib/RenderSystem_GL_d.so" prefix_auto="0" extension_auto="0" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cp $($(TARGET_NAME)_OUTPUT_FILE) ../../../Samples/Common/bin/$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../../lib/RenderSystem_GL.so" prefix_auto="0" extension_auto="0" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O2" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cp $($(TARGET_NAME)_OUTPUT_FILE) ../../../Samples/Common/bin/$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-fvisibility=hidden" />
+			<Add option="-fvisibility-inlines-hidden" />
+			<Add option="-fPIC" />
+			<Add option="-DOGRE_GL_USE_MULTITEXTURING" />
+			<Add option="-DOGRE_GLPLUGIN_EXPORTS" />
+			<Add option="-DOGRE_GCC_VISIBILITY" />
+			<Add option="-DPIC" />
+			<Add option="-DYY_NEVER_INTERACTIVE" />
+			<Add option="-DYY_NO_UNPUT" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../../OgreMain/include" />
+			<Add directory="../src/nvparse" />
+			<Add directory="../src/atifs/include" />
+			<Add directory="../src/GLSL/include" />
+			<Add directory="../include/GLX" />
+			<Add directory="../src/GLX" />
+		</Compiler>
+		<Linker>
+			<Add library="X11" />
+			<Add library="Xext" />
+			<Add library="GL" />
+			<Add library="Xrandr" />
+			<Add library="Xxf86vm" />
+			<Add library="GLU" />
+			<Add directory="../../../Samples/Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/X11R6/lib" />
+		</Linker>
+		<Unit filename="../include/GL/glew.h" />
+		<Unit filename="../include/GL/wglew.h" />
+		<Unit filename="../include/GLX/OgreGLXContext.h" />
+		<Unit filename="../include/GLX/OgreGLXGLSupport.h" />
+		<Unit filename="../include/GLX/OgreGLXRenderTexture.h" />
+		<Unit filename="../include/GLX/OgreGLXUtils.h" />
+		<Unit filename="../include/GLX/OgreGLXWindow.h" />
+		<Unit filename="../include/OgreGLContext.h" />
+		<Unit filename="../include/OgreGLDefaultHardwareBufferManager.h" />
+		<Unit filename="../include/OgreGLFBOMultiRenderTarget.h" />
+		<Unit filename="../include/OgreGLFBORenderTexture.h" />
+		<Unit filename="../include/OgreGLFrameBufferObject.h" />
+		<Unit filename="../include/OgreGLGpuNvparseProgram.h" />
+		<Unit filename="../include/OgreGLGpuProgram.h" />
+		<Unit filename="../include/OgreGLGpuProgramManager.h" />
+		<Unit filename="../include/OgreGLHardwareBufferManager.h" />
+		<Unit filename="../include/OgreGLHardwareIndexBuffer.h" />
+		<Unit filename="../include/OgreGLHardwareOcclusionQuery.h" />
+		<Unit filename="../include/OgreGLHardwarePixelBuffer.h" />
+		<Unit filename="../include/OgreGLHardwareVertexBuffer.h" />
+		<Unit filename="../include/OgreGLPBRenderTexture.h" />
+		<Unit filename="../include/OgreGLPBuffer.h" />
+		<Unit filename="../include/OgreGLPixelFormat.h" />
+		<Unit filename="../include/OgreGLPlugin.h" />
+		<Unit filename="../include/OgreGLPrerequisites.h" />
+		<Unit filename="../include/OgreGLRenderSystem.h" />
+		<Unit filename="../include/OgreGLRenderTexture.h" />
+		<Unit filename="../include/OgreGLSupport.h" />
+		<Unit filename="../include/OgreGLTexture.h" />
+		<Unit filename="../include/OgreGLTextureManager.h" />
+		<Unit filename="../misc/OgreGLEngine.def" />
+		<Unit filename="../src/GLSL/include/OgreGLSLExtSupport.h" />
+		<Unit filename="../src/GLSL/include/OgreGLSLGpuProgram.h" />
+		<Unit filename="../src/GLSL/include/OgreGLSLLinkProgram.h" />
+		<Unit filename="../src/GLSL/include/OgreGLSLLinkProgramManager.h" />
+		<Unit filename="../src/GLSL/include/OgreGLSLProgram.h" />
+		<Unit filename="../src/GLSL/include/OgreGLSLProgramFactory.h" />
+		<Unit filename="../src/GLSL/src/OgreGLSLExtSupport.cpp" />
+		<Unit filename="../src/GLSL/src/OgreGLSLGpuProgram.cpp" />
+		<Unit filename="../src/GLSL/src/OgreGLSLLinkProgram.cpp" />
+		<Unit filename="../src/GLSL/src/OgreGLSLLinkProgramManager.cpp" />
+		<Unit filename="../src/GLSL/src/OgreGLSLProgram.cpp" />
+		<Unit filename="../src/GLSL/src/OgreGLSLProgramFactory.cpp" />
+		<Unit filename="../src/GLX/OgreGLUtil.h" />
+		<Unit filename="../src/GLX/OgreGLXContext.cpp" />
+		<Unit filename="../src/GLX/OgreGLXGLSupport.cpp" />
+		<Unit filename="../src/GLX/OgreGLXRenderTexture.cpp" />
+		<Unit filename="../src/GLX/OgreGLXUtils.cpp" />
+		<Unit filename="../src/GLX/OgreGLXWindow.cpp" />
+		<Unit filename="../src/OgreGLATIFSInit.cpp" />
+		<Unit filename="../src/OgreGLContext.cpp" />
+		<Unit filename="../src/OgreGLDefaultHardwareBufferManager.cpp" />
+		<Unit filename="../src/OgreGLEngineDll.cpp" />
+		<Unit filename="../src/OgreGLFBOMultiRenderTarget.cpp" />
+		<Unit filename="../src/OgreGLFBORenderTexture.cpp" />
+		<Unit filename="../src/OgreGLFrameBufferObject.cpp" />
+		<Unit filename="../src/OgreGLGpuNvparseProgram.cpp" />
+		<Unit filename="../src/OgreGLGpuProgram.cpp" />
+		<Unit filename="../src/OgreGLGpuProgramManager.cpp" />
+		<Unit filename="../src/OgreGLHardwareBufferManager.cpp" />
+		<Unit filename="../src/OgreGLHardwareIndexBuffer.cpp" />
+		<Unit filename="../src/OgreGLHardwareOcclusionQuery.cpp" />
+		<Unit filename="../src/OgreGLHardwarePixelBuffer.cpp" />
+		<Unit filename="../src/OgreGLHardwareVertexBuffer.cpp" />
+		<Unit filename="../src/OgreGLPBRenderTexture.cpp" />
+		<Unit filename="../src/OgreGLPixelFormat.cpp" />
+		<Unit filename="../src/OgreGLPlugin.cpp" />
+		<Unit filename="../src/OgreGLRenderSystem.cpp" />
+		<Unit filename="../src/OgreGLRenderTexture.cpp" />
+		<Unit filename="../src/OgreGLSupport.cpp" />
+		<Unit filename="../src/OgreGLTexture.cpp" />
+		<Unit filename="../src/OgreGLTextureManager.cpp" />
+		<Unit filename="../src/atifs/include/ATI_FS_GLGpuProgram.h" />
+		<Unit filename="../src/atifs/include/Compiler2Pass.h" />
+		<Unit filename="../src/atifs/include/ps_1_4.h" />
+		<Unit filename="../src/atifs/src/ATI_FS_GLGpuProgram.cpp" />
+		<Unit filename="../src/atifs/src/Compiler2Pass.cpp" />
+		<Unit filename="../src/atifs/src/ps_1_4.cpp" />
+		<Unit filename="../src/glew.cpp" />
+		<Unit filename="../src/nvparse/_ps1.0_lexer.cpp" />
+		<Unit filename="../src/nvparse/_ps1.0_parser.cpp" />
+		<Unit filename="../src/nvparse/_ps1.0_parser.h" />
+		<Unit filename="../src/nvparse/_rc1.0_lexer.cpp" />
+		<Unit filename="../src/nvparse/_rc1.0_parser.cpp" />
+		<Unit filename="../src/nvparse/_rc1.0_parser.h" />
+		<Unit filename="../src/nvparse/_ts1.0_lexer.cpp" />
+		<Unit filename="../src/nvparse/_ts1.0_parser.cpp" />
+		<Unit filename="../src/nvparse/_ts1.0_parser.h" />
+		<Unit filename="../src/nvparse/_vs1.0_lexer.cpp" />
+		<Unit filename="../src/nvparse/_vs1.0_parser.cpp" />
+		<Unit filename="../src/nvparse/_vs1.0_parser.h" />
+		<Unit filename="../src/nvparse/avp1.0_impl.cpp" />
+		<Unit filename="../src/nvparse/macro.h" />
+		<Unit filename="../src/nvparse/nvparse.cpp" />
+		<Unit filename="../src/nvparse/nvparse.h" />
+		<Unit filename="../src/nvparse/nvparse_errors.cpp" />
+		<Unit filename="../src/nvparse/nvparse_errors.h" />
+		<Unit filename="../src/nvparse/nvparse_externs.h" />
+		<Unit filename="../src/nvparse/ps1.0_program.cpp" />
+		<Unit filename="../src/nvparse/ps1.0_program.h" />
+		<Unit filename="../src/nvparse/rc1.0_combiners.cpp" />
+		<Unit filename="../src/nvparse/rc1.0_combiners.h" />
+		<Unit filename="../src/nvparse/rc1.0_final.cpp" />
+		<Unit filename="../src/nvparse/rc1.0_final.h" />
+		<Unit filename="../src/nvparse/rc1.0_general.cpp" />
+		<Unit filename="../src/nvparse/rc1.0_general.h" />
+		<Unit filename="../src/nvparse/rc1.0_register.h" />
+		<Unit filename="../src/nvparse/ts1.0_inst.cpp" />
+		<Unit filename="../src/nvparse/ts1.0_inst.h" />
+		<Unit filename="../src/nvparse/ts1.0_inst_list.cpp" />
+		<Unit filename="../src/nvparse/ts1.0_inst_list.h" />
+		<Unit filename="../src/nvparse/vcp1.0_impl.cpp" />
+		<Unit filename="../src/nvparse/vp1.0_impl.cpp" />
+		<Unit filename="../src/nvparse/vs1.0_inst.cpp" />
+		<Unit filename="../src/nvparse/vs1.0_inst.h" />
+		<Unit filename="../src/nvparse/vs1.0_inst_list.cpp" />
+		<Unit filename="../src/nvparse/vs1.0_inst_list.h" />
+		<Unit filename="../src/nvparse/vsp1.0_impl.cpp" />
+		<Unit filename="../src/nvparse/winheaders/unistd.h" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /RenderSystems/GL/scripts/RenderSystem_GL_stlp.cbp
===================================================================
--- /RenderSystems/GL/scripts/RenderSystem_GL_stlp.cbp	(revision 5)
+++ /RenderSystems/GL/scripts/RenderSystem_GL_stlp.cbp	(revision 5)
@@ -0,0 +1,831 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="RenderSystem_GL" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\lib\RenderSystem_GL_d.dll" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OPENGL32" />
+					<Add library="GLU32" />
+					<Add library="GDI32" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\lib\RenderSystem_GL.dll" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O2" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OPENGL32" />
+					<Add library="GLU32" />
+					<Add library="GDI32" />
+					<Add library="stlport.5.1" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add option="-D_USRDLL" />
+			<Add option="-DOGRE_GL_USE_MULTITEXTURING" />
+			<Add option="-DRenderSystem_GL_EXPORTS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\src\win32" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\src\nvparse" />
+			<Add directory="..\src\nvparse\winheaders" />
+			<Add directory="..\src\atifs\include" />
+			<Add directory="..\src\glsl\include" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\..\..\Dependencies\include\GL\gl.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\..\Dependencies\include\GL\glext.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\..\Dependencies\include\GL\glxext.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\GL\glew.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\GL\wglew.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLContext.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLDefaultHardwareBufferManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLFBOMultiRenderTarget.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLFBORenderTexture.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLFrameBufferObject.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLGpuNvparseProgram.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLGpuProgram.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLGpuProgramManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLHardwareBufferManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLHardwareIndexBuffer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLHardwareOcclusionQuery.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLHardwarePixelBuffer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLHardwareVertexBuffer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLPBRenderTexture.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLPBuffer.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLPixelFormat.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLPlugin.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLPrerequisites.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLRenderSystem.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLRenderTexture.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLSupport.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLTexture.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreGLTextureManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSDLGLSupport.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSDLPrerequisites.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreSDLWindow.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreWin32Context.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreWin32GLSupport.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreWin32Prerequisites.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreWin32RenderTexture.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreWin32Window.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\misc\OgreGLEngine.def">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\GLSL\include\OgreGLSLExtSupport.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\GLSL\include\OgreGLSLGpuProgram.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\GLSL\include\OgreGLSLLinkProgram.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\GLSL\include\OgreGLSLLinkProgramManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\GLSL\include\OgreGLSLProgram.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\GLSL\include\OgreGLSLProgramFactory.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\GLSL\src\OgreGLSLExtSupport.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\GLSL\src\OgreGLSLGpuProgram.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\GLSL\src\OgreGLSLLinkProgram.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\GLSL\src\OgreGLSLLinkProgramManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\GLSL\src\OgreGLSLProgram.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\GLSL\src\OgreGLSLProgramFactory.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLATIFSInit.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLContext.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLDefaultHardwareBufferManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLEngineDll.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLFBOMultiRenderTarget.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLFBORenderTexture.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLFrameBufferObject.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLGpuNvparseProgram.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLGpuProgram.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLGpuProgramManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLHardwareBufferManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLHardwareIndexBuffer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLHardwareOcclusionQuery.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLHardwarePixelBuffer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLHardwareVertexBuffer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLPBRenderTexture.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLPixelFormat.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLPlugin.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLRenderSystem.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLRenderTexture.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLSupport.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLTexture.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreGLTextureManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreWin32GLSupport.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreWin32RenderTexture.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreWin32Window.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\atifs\include\ATI_FS_GLGpuProgram.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\atifs\include\Compiler2Pass.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\atifs\include\ps_1_4.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\atifs\src\ATI_FS_GLGpuProgram.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\atifs\src\Compiler2Pass.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\atifs\src\ps_1_4.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\glew.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\_ps1.0_lexer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\_ps1.0_parser.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\_ps1.0_parser.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\_rc1.0_lexer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\_rc1.0_parser.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\_rc1.0_parser.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\_ts1.0_lexer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\_ts1.0_parser.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\_ts1.0_parser.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\_vs1.0_lexer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\_vs1.0_parser.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\_vs1.0_parser.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\avp1.0_impl.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\macro.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\nvparse.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\nvparse.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\nvparse_errors.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\nvparse_errors.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\nvparse_externs.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\ps1.0_program.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\ps1.0_program.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\rc1.0_combiners.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\rc1.0_combiners.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\rc1.0_final.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\rc1.0_final.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\rc1.0_general.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\rc1.0_general.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\rc1.0_register.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\ts1.0_inst.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\ts1.0_inst.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\ts1.0_inst_list.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\ts1.0_inst_list.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\vcp1.0_impl.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\vp1.0_impl.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\vs1.0_inst.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\vs1.0_inst.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\vs1.0_inst_list.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\vs1.0_inst_list.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\vsp1.0_impl.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\nvparse\winheaders\unistd.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\win32\OgreWin32Context.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /RenderSystems/GL/scripts/RenderSystem_GL_vc8.vcproj
===================================================================
--- /RenderSystems/GL/scripts/RenderSystem_GL_vc8.vcproj	(revision 5)
+++ /RenderSystems/GL/scripts/RenderSystem_GL_vc8.vcproj	(revision 5)
@@ -0,0 +1,866 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="RenderSystem_GL"
+	ProjectGUID="{7D0A20FE-40A6-4E64-AD26-5E34AE391DF4}"
+	RootNamespace="RenderSystem_GL"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\src\win32;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\src\nvparse;..\src\nvparse\winheaders;..\src\atifs\include;..\src\glsl\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_GLPLUGIN_EXPORTS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain_d.lib OPENGL32.lib GLU32.lib"
+				OutputFile="$(OutDir)/RenderSystem_GL_d.dll"
+				Version=""
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName)_d.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/RenderSystem_GL_d.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				EnableFiberSafeOptimizations="true"
+				AdditionalIncludeDirectories="..\include;..\src\win32;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\src\nvparse;..\src\nvparse\winheaders;..\src\atifs\include;..\src\glsl\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_GLPLUGIN_EXPORTS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain.lib OPENGL32.lib GLU32.lib"
+				OutputFile="$(OutDir)/RenderSystem_GL.dll"
+				Version="0.99"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/RenderSystem_GL.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\src\win32;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\src\nvparse;..\src\nvparse\winheaders;..\src\atifs\include;..\src\glsl\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;OGRE_GL_USE_MULTITEXTURING;OGRE_STATIC_LIB"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				AdditionalDependencies="OPENGL32.lib GLU32.lib"
+				OutputFile="$(OutDir)\$(ProjectName)Static_d.lib"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				EnableFiberSafeOptimizations="true"
+				AdditionalIncludeDirectories="..\include;..\src\win32;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\src\nvparse;..\src\nvparse\winheaders;..\src\atifs\include;..\src\glsl\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_STATIC_LIB"
+				IgnoreStandardIncludePath="false"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				AdditionalDependencies="OPENGL32.lib GLU32.lib"
+				OutputFile="$(OutDir)\$(ProjectName)Static.lib"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine=""
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\glew.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLATIFSInit.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLContext.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLDefaultHardwareBufferManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLEngineDll.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLFBOMultiRenderTarget.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLFBORenderTexture.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLFrameBufferObject.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLGpuNvparseProgram.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLGpuProgram.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLGpuProgramManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLHardwareBufferManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLHardwareIndexBuffer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLHardwareOcclusionQuery.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLHardwarePixelBuffer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLHardwareVertexBuffer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLPBRenderTexture.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLPixelFormat.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLPlugin.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLRenderSystem.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLRenderTexture.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLSupport.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLTexture.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreGLTextureManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\win32\OgreWin32Context.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreWin32GLSupport.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreWin32RenderTexture.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreWin32Window.cpp"
+				>
+			</File>
+			<Filter
+				Name="nvparse"
+				>
+				<File
+					RelativePath="..\src\nvparse\_ps1.0_lexer.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_ps1.0_parser.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_ps1.0_parser.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_rc1.0_lexer.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_rc1.0_parser.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_rc1.0_parser.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_ts1.0_lexer.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_ts1.0_parser.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_ts1.0_parser.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_vs1.0_lexer.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_vs1.0_parser.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\_vs1.0_parser.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\avp1.0_impl.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\macro.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\nvparse.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\nvparse.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\nvparse_errors.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\nvparse_errors.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\nvparse_externs.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\ps1.0_program.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\ps1.0_program.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\rc1.0_combiners.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\rc1.0_combiners.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\rc1.0_final.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\rc1.0_final.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\rc1.0_general.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\rc1.0_general.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\rc1.0_register.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\ts1.0_inst.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\ts1.0_inst.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\ts1.0_inst_list.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\ts1.0_inst_list.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\winheaders\unistd.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\vcp1.0_impl.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\vp1.0_impl.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\vs1.0_inst.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\vs1.0_inst.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\vs1.0_inst_list.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\vs1.0_inst_list.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\nvparse\vsp1.0_impl.cpp"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="atifs"
+				>
+				<File
+					RelativePath="..\src\atifs\src\ATI_FS_GLGpuProgram.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\atifs\include\ATI_FS_GLGpuProgram.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\atifs\src\Compiler2Pass.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\atifs\include\Compiler2Pass.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\atifs\src\ps_1_4.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\atifs\include\ps_1_4.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="glsl"
+				>
+				<File
+					RelativePath="..\src\GLSL\src\OgreGLSLExtSupport.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\GLSL\src\OgreGLSLGpuProgram.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\GLSL\src\OgreGLSLLinkProgram.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\GLSL\src\OgreGLSLLinkProgramManager.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\GLSL\src\OgreGLSLProgram.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\src\GLSL\src\OgreGLSLProgramFactory.cpp"
+					>
+				</File>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\..\..\Dependencies\include\GL\gl.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\GL\glew.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\Dependencies\include\GL\glext.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\Dependencies\include\GL\glxext.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLContext.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLDefaultHardwareBufferManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLFBOMultiRenderTarget.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLFBORenderTexture.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLFrameBufferObject.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLGpuNvparseProgram.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLGpuProgram.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLGpuProgramManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLHardwareBufferManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLHardwareIndexBuffer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLHardwareOcclusionQuery.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLHardwarePixelBuffer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLHardwareVertexBuffer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLPBRenderTexture.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLPBuffer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLPixelFormat.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLPlugin.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLPrerequisites.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLRenderSystem.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLRenderTexture.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLSupport.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLTexture.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreGLTextureManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreWin32Context.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreWin32GLSupport.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreWin32Prerequisites.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreWin32RenderTexture.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreWin32Window.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\GL\wglew.h"
+				>
+			</File>
+			<Filter
+				Name="glsl"
+				>
+				<File
+					RelativePath="..\src\GLSL\include\OgreGLSLExtSupport.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\GLSL\include\OgreGLSLGpuProgram.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\GLSL\include\OgreGLSLLinkProgram.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\GLSL\include\OgreGLSLLinkProgramManager.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\GLSL\include\OgreGLSLProgram.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\GLSL\include\OgreGLSLProgramFactory.h"
+					>
+				</File>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /RenderSystems/GL/src/GLSL/Makefile.am
===================================================================
--- /RenderSystems/GL/src/GLSL/Makefile.am	(revision 5)
+++ /RenderSystems/GL/src/GLSL/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS=include src
Index: /RenderSystems/GL/src/GLSL/Makefile.in
===================================================================
--- /RenderSystems/GL/src/GLSL/Makefile.in	(revision 5)
+++ /RenderSystems/GL/src/GLSL/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = RenderSystems/GL/src/GLSL
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = include src
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  RenderSystems/GL/src/GLSL/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  RenderSystems/GL/src/GLSL/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /RenderSystems/GL/src/GLSL/include/Makefile.am
===================================================================
--- /RenderSystems/GL/src/GLSL/include/Makefile.am	(revision 5)
+++ /RenderSystems/GL/src/GLSL/include/Makefile.am	(revision 5)
@@ -0,0 +1,6 @@
+noinst_HEADERS = OgreGLSLExtSupport.h \
+                 OgreGLSLLinkProgram.h \
+                 OgreGLSLProgram.h \
+                 OgreGLSLGpuProgram.h \
+                 OgreGLSLLinkProgramManager.h \
+                 OgreGLSLProgramFactory.h
Index: /RenderSystems/GL/src/GLSL/include/Makefile.in
===================================================================
--- /RenderSystems/GL/src/GLSL/include/Makefile.in	(revision 5)
+++ /RenderSystems/GL/src/GLSL/include/Makefile.in	(revision 5)
@@ -0,0 +1,442 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = RenderSystems/GL/src/GLSL/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = OgreGLSLExtSupport.h \
+                 OgreGLSLLinkProgram.h \
+                 OgreGLSLProgram.h \
+                 OgreGLSLGpuProgram.h \
+                 OgreGLSLLinkProgramManager.h \
+                 OgreGLSLProgramFactory.h
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  RenderSystems/GL/src/GLSL/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  RenderSystems/GL/src/GLSL/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /RenderSystems/GL/src/GLSL/include/OgreGLSLExtSupport.h
===================================================================
--- /RenderSystems/GL/src/GLSL/include/OgreGLSLExtSupport.h	(revision 5)
+++ /RenderSystems/GL/src/GLSL/include/OgreGLSLExtSupport.h	(revision 5)
@@ -0,0 +1,67 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+
+
+#ifndef __GLSLExtSupport_H__
+#define __GLSLExtSupport_H__
+
+#include "OgreGLPrerequisites.h"
+
+//
+// OpenGL Shading Language entry points
+//
+namespace Ogre
+{
+
+	// forward declarations
+	class GLSLProgram;
+	class GLSLGpuProgram;
+	class GLSLLinkProgram;
+	class GLSLLinkProgramManager;
+	class GLSLProgramFactory;
+
+
+	/** Check for GL errors and report them in the Ogre Log.
+
+	@param forceInfoLog if true then message from GL info log is obtained
+	@param forceException if true then exception is generated if a GL error found
+	*/
+    void checkForGLSLError(const String& ogreMethod, const String& errorTextPrefix, const GLhandleARB obj, const bool forceInfoLog = false, const bool forceException = false);
+
+	/** if there is a message in GL info log then post it in the Ogre Log
+	@param msg the info log message string is appended to this string
+	@param obj the GL object that is used to retrieve the info log
+	*/
+	String logObjectInfo(const String& msg, const GLhandleARB obj);
+
+
+} // namespace Ogre
+
+#endif // __GLSLExtSupport_H__
Index: /RenderSystems/GL/src/GLSL/include/OgreGLSLGpuProgram.h
===================================================================
--- /RenderSystems/GL/src/GLSL/include/OgreGLSLGpuProgram.h	(revision 5)
+++ /RenderSystems/GL/src/GLSL/include/OgreGLSLGpuProgram.h	(revision 5)
@@ -0,0 +1,103 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __GLSLGpuProgram_H__
+#define __GLSLGpuProgram_H__
+
+// Precompiler options
+#include "OgreGLSLExtSupport.h"
+#include "OgreGLGpuProgram.h"
+
+
+namespace Ogre {
+
+    /** GLSL low level compiled shader object - this class is used to get at the linked program object 
+		and provide an interface for GLRenderSystem calls.  GLSL does not provide access to the
+		low level code of the shader so this class is really just a dummy place holder.
+		GLSL uses a program object to represent the active vertex and fragment programs used
+		but Ogre materials maintain seperate instances of the active vertex and fragment programs
+		which creates a small problem for GLSL integration.  The GLSLGpuProgram class provides the
+		interface between the GLSLLinkProgramManager , GLRenderSystem, and the active GLSLProgram
+		instances.
+	*/
+    class _OgrePrivate GLSLGpuProgram : public GLGpuProgram
+    {
+    private:
+		/// GL Handle for the shader object
+		GLSLProgram* mGLSLProgram;
+
+		/// keep track of the number of vertex shaders created
+		static GLuint mVertexShaderCount;
+		/// keep track of the number of fragment shaders created
+		static GLuint mFragmentShaderCount;
+
+	public:
+        GLSLGpuProgram(GLSLProgram* parent);
+		~GLSLGpuProgram();
+
+
+		/// Execute the binding functions for this program
+		void bindProgram(void);
+		/// Execute the unbinding functions for this program
+		void unbindProgram(void);
+		/// Execute the param binding functions for this program
+		void bindProgramParameters(GpuProgramParametersSharedPtr params);
+		/// Execute the pass iteration param binding functions for this program
+		void bindProgramPassIterationParameters(GpuProgramParametersSharedPtr params);
+
+		/// Get the assigned GL program id
+		const GLuint getProgramID(void) const
+		{ return mProgramID; }
+
+		/// get the GLSLProgram for the shader object
+		GLSLProgram* getGLSLProgram(void) const { return mGLSLProgram; }
+
+		/// @copydoc GLGpuProgram::getAttributeIndex
+		GLuint getAttributeIndex(VertexElementSemantic semantic);
+		
+		/// @copydoc GLGpuProgram::isAttributeValid
+		bool isAttributeValid(VertexElementSemantic semantic);
+		
+
+    protected:
+        /// Overridden from GpuProgram
+        void loadFromSource(void);
+		/// @copydoc Resource::unloadImpl
+		void unloadImpl(void);
+		/// @copydoc Resource::loadImpl
+		void loadImpl(void);
+
+
+    };
+
+
+}
+
+
+#endif // __GLSLGpuProgram_H__
Index: /RenderSystems/GL/src/GLSL/include/OgreGLSLLinkProgram.h
===================================================================
--- /RenderSystems/GL/src/GLSL/include/OgreGLSLLinkProgram.h	(revision 5)
+++ /RenderSystems/GL/src/GLSL/include/OgreGLSLLinkProgram.h	(revision 5)
@@ -0,0 +1,136 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __GLSLLinkProgram_H__
+#define __GLSLLinkProgram_H__
+
+#include "OgreGLPrerequisites.h"
+#include "OgreGpuProgram.h"
+#include "OgreHardwareVertexBuffer.h"
+
+namespace Ogre {
+	/// structure used to keep track of named uniforms in the linked program object
+	struct GLUniformReference
+	{
+		/// GL location handle
+		GLint  mLocation;
+		/// Which type of program params will this value come from?
+		GpuProgramType mSourceProgType;
+		/// The constant definition it relates to
+		const GpuConstantDefinition* mConstantDef;
+	};
+
+	typedef std::vector<GLUniformReference> GLUniformReferenceList;
+	typedef GLUniformReferenceList::iterator GLUniformReferenceIterator;
+
+	/** C++ encapsulation of GLSL Program Object
+
+	*/
+
+	class _OgrePrivate GLSLLinkProgram
+	{
+	private:
+		/// container of uniform references that are active in the program object
+		GLUniformReferenceList mGLUniformReferences;
+
+		/// Linked vertex program
+		GLSLGpuProgram* mVertexProgram;
+		/// Linked fragment program
+		GLSLGpuProgram* mFragmentProgram;
+
+		/// flag to indicate that uniform references have already been built
+		bool		mUniformRefsBuilt;
+		/// GL handle for the program object
+		GLhandleARB mGLHandle;
+		/// flag indicating that the program object has been successfully linked
+		GLint		mLinked;
+		// Custom attribute bindings
+		/// 'tangent' attribute
+		GLuint mTangentAttrib;
+		/// 'binormal' attribute
+		GLuint mBinormalAttrib;
+		/// 'blendIndices' attribute
+		GLuint mBlendIndicesAttrib;
+		/// 'blendWeights' attribute
+		GLuint mBlendWeightsAttrib;
+        /// flag indicating skeletal animation is being performed
+        bool mSkeletalAnimation;
+
+		/// build uniform references from active named uniforms
+		void buildGLUniformReferences(void);
+		/// extract attributes
+		void extractAttributes(void);
+
+		
+
+	public:
+		/// constructor should only be used by GLSLLinkProgramManager
+		GLSLLinkProgram(GLSLGpuProgram* vertexProgram, GLSLGpuProgram* fragmentProgram);
+		~GLSLLinkProgram(void);
+
+		/** Makes a program object active by making sure it is linked and then putting it in use.
+
+		*/
+		void activate(void);
+		/** updates program object uniforms using data from GpuProgramParamters.
+		normally called by GLSLGpuProgram::bindParameters() just before rendering occurs.
+		*/
+		void updateUniforms(GpuProgramParametersSharedPtr params, GpuProgramType fromProgType);
+		/** updates program object uniforms using data from pass iteration GpuProgramParamters.
+		normally called by GLSLGpuProgram::bindMultiPassParameters() just before multi pass rendering occurs.
+		*/
+		void updatePassIterationUniforms(GpuProgramParametersSharedPtr params);
+		/// get the GL Handle for the program object
+		GLhandleARB getGLHandle(void) const { return mGLHandle; }
+        /** Sets whether the linked program includes the required instructions
+        to perform skeletal animation. 
+        @remarks
+        If this is set to true, OGRE will not blend the geometry according to 
+        skeletal animation, it will expect the vertex program to do it.
+        */
+        void setSkeletalAnimationIncluded(bool included) 
+        { mSkeletalAnimation = included; }
+
+        /** Returns whether the linked program includes the required instructions
+            to perform skeletal animation. 
+        @remarks
+            If this returns true, OGRE will not blend the geometry according to 
+            skeletal animation, it will expect the vertex program to do it.
+        */
+        bool isSkeletalAnimationIncluded(void) const { return mSkeletalAnimation; }
+
+		/// Get the index of a non-standard attribute bound in the linked code
+		GLuint getAttributeIndex(VertexElementSemantic semantic);
+		/// Is a non-standard attribute bound in the linked code?
+		bool isAttributeValid(VertexElementSemantic semantic);
+
+	};
+
+}
+
+#endif // __GLSLLinkProgram_H__
Index: /RenderSystems/GL/src/GLSL/include/OgreGLSLLinkProgramManager.h
===================================================================
--- /RenderSystems/GL/src/GLSL/include/OgreGLSLLinkProgramManager.h	(revision 5)
+++ /RenderSystems/GL/src/GLSL/include/OgreGLSLLinkProgramManager.h	(revision 5)
@@ -0,0 +1,133 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __GLSLLinkProgramManager_H__
+#define __GLSLLinkProgramManager_H__
+
+#include "OgreGLPrerequisites.h"
+#include "OgreSingleton.h"
+
+#include "OgreGLSLExtSupport.h"
+#include "OgreGLSLLinkProgram.h"
+
+namespace Ogre {
+
+	/** Ogre assumes that there are seperate vertex and fragment programs to deal with but
+		GLSL has one program object that represents the active vertex and fragment shader objects
+		during a rendering state.  GLSL Vertex and fragment 
+		shader objects are compiled seperately and then attached to a program object and then the
+		program object is linked.  Since Ogre can only handle one vertex program and one fragment
+		program being active in a pass, the GLSL Link Program Manager does the same.  The GLSL Link
+		program manager acts as a state machine and activates a program object based on the active
+		vertex and fragment program.  Previously created program objects are stored along with a unique
+		key in a hash_map for quick retrieval the next time the program object is required.
+
+	*/
+
+	class _OgrePrivate GLSLLinkProgramManager : public Singleton<GLSLLinkProgramManager>
+	{
+
+	private:
+	
+		typedef HashMap<GLuint, GLSLLinkProgram*> LinkProgramMap;
+		typedef LinkProgramMap::iterator LinkProgramIterator;
+
+		/// container holding previously created program objects 
+		LinkProgramMap LinkPrograms; 
+
+		/// active objects defining the active rendering gpu state
+		GLSLGpuProgram* mActiveVertexGpuProgram;
+		GLSLGpuProgram* mActiveFragmentGpuProgram;
+		GLSLLinkProgram* mActiveLinkProgram;
+
+		typedef std::map<String, GLenum> StringToEnumMap;
+		StringToEnumMap mTypeEnumMap;
+
+		/// Use type to complete other information
+		void completeDefInfo(GLenum gltype, GpuConstantDefinition& defToUpdate);
+		/// Find where the data for a specific uniform should come from, populate
+		bool completeParamSource(const String& paramName,
+			const GpuConstantDefinitionMap* vertexConstantDefs, 
+			const GpuConstantDefinitionMap* fragmentConstantDefs, 
+			GLUniformReference& refToUpdate);
+
+	public:
+
+		GLSLLinkProgramManager(void);
+
+		~GLSLLinkProgramManager(void);
+
+		/**
+			Get the program object that links the two active shader objects together
+			if a program object was not already created and linked a new one is created and linked
+		*/
+		GLSLLinkProgram* getActiveLinkProgram(void);
+
+		/** Set the active fragment shader for the next rendering state.
+			The active program object will be cleared.
+			Normally called from the GLSLGpuProgram::bindProgram and unbindProgram methods
+		*/
+		void setActiveFragmentShader(GLSLGpuProgram* fragmentGpuProgram);
+		/** Set the active vertex shader for the next rendering state.
+			The active program object will be cleared.
+			Normally called from the GLSLGpuProgram::bindProgram and unbindProgram methods
+		*/
+		void setActiveVertexShader(GLSLGpuProgram* vertexGpuProgram);
+
+		/** Populate a list of uniforms based on a program object.
+		@param programObject Handle to the program object to query
+		@param vertexConstantDefs Definition of the constants extracted from the
+			vertex program, used to match up physical buffer indexes with program
+			uniforms. May be null if there is no vertex program.
+		@param fragmentConstantDefs Definition of the constants extracted from the
+			fragment program, used to match up physical buffer indexes with program
+			uniforms. May be null if there is no fragment program.
+		@param list The list to populate (will not be cleared before adding, clear
+		it yourself before calling this if that's what you want).
+		*/
+		void extractUniforms(GLhandleARB programObject, 
+			const GpuConstantDefinitionMap* vertexConstantDefs, 
+			const GpuConstantDefinitionMap* fragmentConstantDefs, 
+			GLUniformReferenceList& list);
+		/** Populate a list of uniforms based on GLSL source.
+		@param src Reference to the source code
+		@param list The defs to populate (will not be cleared before adding, clear
+		it yourself before calling this if that's what you want).
+		@param filename The file name this came from, for logging errors.
+		*/
+		void extractConstantDefs(const String& src, GpuNamedConstants& constantDefs, 
+			const String& filename);
+
+		static GLSLLinkProgramManager& getSingleton(void);
+        static GLSLLinkProgramManager* getSingletonPtr(void);
+
+	};
+
+}
+
+#endif // __GLSLLinkProgramManager_H__
Index: /RenderSystems/GL/src/GLSL/include/OgreGLSLProgram.h
===================================================================
--- /RenderSystems/GL/src/GLSL/include/OgreGLSLProgram.h	(revision 5)
+++ /RenderSystems/GL/src/GLSL/include/OgreGLSLProgram.h	(revision 5)
@@ -0,0 +1,138 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __GLSLProgram_H__
+#define __GLSLProgram_H__
+
+#include "OgreGLPrerequisites.h"
+#include "OgreHighLevelGpuProgram.h"
+
+namespace Ogre {
+    /** Specialisation of HighLevelGpuProgram to provide support for OpenGL 
+        Shader Language (GLSL).
+    @remarks
+		GLSL has no target assembler or entry point specification like DirectX 9 HLSL.
+		Vertex and Fragment shaders only have one entry point called "main".  
+		When a shader is compiled, microcode is generated but can not be accessed by
+		the application.
+		GLSL also does not provide assembler low level output after compiling.  The GL Render
+		system assumes that the Gpu program is a GL Gpu program so GLSLProgram will create a 
+		GLSLGpuProgram that is subclassed from GLGpuProgram for the low level implementation.
+		The GLSLProgram class will create a shader object and compile the source but will
+		not create a program object.  It's up to GLSLGpuProgram class to request a program object
+		to link the shader object to.
+
+	@note
+		GLSL supports multiple modular shader objects that can be attached to one program
+		object to form a single shader.  This is supported through the "attach" material script
+		command.  All the modules to be attached are listed on the same line as the attach command
+		seperated by white space.
+        
+    */
+    class _OgrePrivate GLSLProgram : public HighLevelGpuProgram
+    {
+    public:
+        /// Command object for attaching another GLSL Program 
+        class CmdAttach : public ParamCommand
+        {
+        public:
+            String doGet(const void* target) const;
+            void doSet(void* target, const String& shaderNames);
+        };
+
+        GLSLProgram(ResourceManager* creator, 
+            const String& name, ResourceHandle handle,
+            const String& group, bool isManual, ManualResourceLoader* loader);
+		~GLSLProgram();
+
+		const GLhandleARB getGLHandle() const { return mGLHandle; }
+		void attachToProgramObject( const GLhandleARB programObject );
+		void detachFromProgramObject( const GLhandleARB programObject );
+		String getAttachedShaderNames() const { return mAttachedShaderNames; }
+
+        /** Attach another GLSL Shader to this one. */
+        void attachChildShader(const String& name);
+
+		/** Sets the preprocessor defines use to compile the program. */
+		void setPreprocessorDefines(const String& defines) { mPreprocessorDefines = defines; }
+		/** Sets the preprocessor defines use to compile the program. */
+		const String& getPreprocessorDefines(void) const { return mPreprocessorDefines; }
+
+        /// Overridden from GpuProgram
+        const String& getLanguage(void) const;
+
+		/// Command object for setting macro defines
+		class CmdPreprocessorDefines : public ParamCommand
+		{
+		public:
+			String doGet(const void* target) const;
+			void doSet(void* target, const String& val);
+		};
+	protected:
+		static CmdPreprocessorDefines msCmdPreprocessorDefines;
+        static CmdAttach msCmdAttach;
+
+        /** Internal load implementation, must be implemented by subclasses.
+        */
+        void loadFromSource(void);
+        /** Internal method for creating a dummy low-level program for this
+        high-level program.	GLSL does not give access to the low level implementation of the
+		shader so this method creates an object sub-classed from GLGpuProgram just to be
+		compatible with	GLRenderSystem.
+		*/
+		void createLowLevelImpl(void);
+        /// Internal unload implementation, must be implemented by subclasses
+        void unloadHighLevelImpl(void);
+		/// Overridden from HighLevelGpuProgram
+		void unloadImpl(void);
+
+        /// Populate the passed parameters with name->index map
+        void populateParameterNames(GpuProgramParametersSharedPtr params);
+        /// Populate the passed parameters with name->index map, must be overridden
+        void buildConstantDefinitions() const;
+		/// compile source into shader object
+		bool compile( const bool checkErrors = true);
+
+	private:
+		/// GL handle for shader object
+		GLhandleARB mGLHandle;
+		/// flag indicating if shader object successfully compiled
+		GLint mCompiled;
+		/// attached Shader names
+		String mAttachedShaderNames;
+		/// Preprocessor options
+		String mPreprocessorDefines;
+		/// container of attached programs
+		typedef std::vector< GLSLProgram* > GLSLProgramContainer;
+		typedef GLSLProgramContainer::iterator GLSLProgramContainerIterator;
+		GLSLProgramContainer mAttachedGLSLPrograms;
+
+    };
+}
+
+#endif // __GLSLProgram_H__
Index: /RenderSystems/GL/src/GLSL/include/OgreGLSLProgramFactory.h
===================================================================
--- /RenderSystems/GL/src/GLSL/include/OgreGLSLProgramFactory.h	(revision 5)
+++ /RenderSystems/GL/src/GLSL/include/OgreGLSLProgramFactory.h	(revision 5)
@@ -0,0 +1,61 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+
+#ifndef __GLSLProgramFactory_H__
+#define __GLSLProgramFactory_H__
+
+#include "OgreHighLevelGpuProgramManager.h"
+#include "OgreGLSLExtSupport.h"
+
+namespace Ogre
+{
+    /** Factory class for GLSL programs. */
+    class _OgrePrivate GLSLProgramFactory : public HighLevelGpuProgramFactory
+    {
+    protected:
+		static String sLanguageName;
+    public:
+        GLSLProgramFactory(void);
+        ~GLSLProgramFactory(void);
+		/// Get the name of the language this factory creates programs for
+		const String& getLanguage(void) const;
+		/// create an instance of GLSLProgram
+        HighLevelGpuProgram* create(ResourceManager* creator, 
+            const String& name, ResourceHandle handle,
+            const String& group, bool isManual, ManualResourceLoader* loader);
+		void destroy(HighLevelGpuProgram* prog);
+
+	private:
+		GLSLLinkProgramManager* mLinkProgramManager;
+
+    };
+}
+
+#endif // __GLSLProgramFactory_H__
Index: /RenderSystems/GL/src/GLSL/src/Makefile.am
===================================================================
--- /RenderSystems/GL/src/GLSL/src/Makefile.am	(revision 5)
+++ /RenderSystems/GL/src/GLSL/src/Makefile.am	(revision 5)
@@ -0,0 +1,15 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/RenderSystems/GL/include \
+           -I$(top_srcdir)/OgreMain/include $(GLSUPPORT_CFLAGS) \
+           -I$(top_srcdir)/PlatformManagers/$(OGRE_PLATFORM)/include \
+           -I$(top_srcdir)/RenderSystems/GL/src/$(OGRE_GLSUPPORT) \
+           -I$(top_srcdir)/RenderSystems/GL/src/GLSL/include \
+           $(CFLAGS_VISIBILITY)
+
+noinst_LTLIBRARIES=libGLSL.la
+libGLSL_la_SOURCES = OgreGLSLExtSupport.cpp \
+                    OgreGLSLLinkProgramManager.cpp \
+                    OgreGLSLGpuProgram.cpp \
+                    OgreGLSLProgram.cpp \
+                    OgreGLSLLinkProgram.cpp \
+                    OgreGLSLProgramFactory.cpp
+libGLSL_la_LDFLAGS =
Index: /RenderSystems/GL/src/GLSL/src/Makefile.in
===================================================================
--- /RenderSystems/GL/src/GLSL/src/Makefile.in	(revision 5)
+++ /RenderSystems/GL/src/GLSL/src/Makefile.in	(revision 5)
@@ -0,0 +1,518 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = RenderSystems/GL/src/GLSL/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libGLSL_la_LIBADD =
+am_libGLSL_la_OBJECTS = OgreGLSLExtSupport.lo \
+	OgreGLSLLinkProgramManager.lo OgreGLSLGpuProgram.lo \
+	OgreGLSLProgram.lo OgreGLSLLinkProgram.lo \
+	OgreGLSLProgramFactory.lo
+libGLSL_la_OBJECTS = $(am_libGLSL_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libGLSL_la_SOURCES)
+DIST_SOURCES = $(libGLSL_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/RenderSystems/GL/include \
+           -I$(top_srcdir)/OgreMain/include $(GLSUPPORT_CFLAGS) \
+           -I$(top_srcdir)/PlatformManagers/$(OGRE_PLATFORM)/include \
+           -I$(top_srcdir)/RenderSystems/GL/src/$(OGRE_GLSUPPORT) \
+           -I$(top_srcdir)/RenderSystems/GL/src/GLSL/include \
+           $(CFLAGS_VISIBILITY)
+
+noinst_LTLIBRARIES = libGLSL.la
+libGLSL_la_SOURCES = OgreGLSLExtSupport.cpp \
+                    OgreGLSLLinkProgramManager.cpp \
+                    OgreGLSLGpuProgram.cpp \
+                    OgreGLSLProgram.cpp \
+                    OgreGLSLLinkProgram.cpp \
+                    OgreGLSLProgramFactory.cpp
+
+libGLSL_la_LDFLAGS = 
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  RenderSystems/GL/src/GLSL/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  RenderSystems/GL/src/GLSL/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libGLSL.la: $(libGLSL_la_OBJECTS) $(libGLSL_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libGLSL_la_LDFLAGS) $(libGLSL_la_OBJECTS) $(libGLSL_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLSLExtSupport.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLSLGpuProgram.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLSLLinkProgram.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLSLLinkProgramManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLSLProgram.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLSLProgramFactory.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /RenderSystems/GL/src/GLSL/src/OgreGLSLExtSupport.cpp
===================================================================
--- /RenderSystems/GL/src/GLSL/src/OgreGLSLExtSupport.cpp	(revision 5)
+++ /RenderSystems/GL/src/GLSL/src/OgreGLSLExtSupport.cpp	(revision 5)
@@ -0,0 +1,97 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreLogManager.h"
+#include "OgreGLSLExtSupport.h"
+#include "OgreGLSupport.h"
+
+namespace Ogre
+{
+
+    //-----------------------------------------------------------------------------
+    void checkForGLSLError(const String& ogreMethod, const String& errorTextPrefix, const GLhandleARB obj, const bool forceInfoLog, const bool forceException)
+    {
+		GLenum glErr;
+		bool errorsFound = false;
+		String msg = errorTextPrefix;
+
+		// get all the GL errors
+		glErr = glGetError();
+		while (glErr != GL_NO_ERROR)
+        {
+			msg += "\n" + String((char*)gluErrorString(glErr)); 
+			glErr = glGetError();
+			errorsFound = true;
+        }
+
+
+		// if errors were found then put them in the Log and raise and exception
+		if (errorsFound || forceInfoLog)
+		{
+			// if shader or program object then get the log message and send to the log manager
+			msg += logObjectInfo( msg, obj );
+
+            if (forceException) 
+			{
+				OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, msg, ogreMethod);
+			}
+		}
+    }
+
+    //-----------------------------------------------------------------------------
+	String logObjectInfo(const String& msg, const GLhandleARB obj)
+	{
+		String logMessage = msg;
+
+		if (obj > 0)
+		{
+			GLint infologLength = 0;
+
+			glGetObjectParameterivARB(obj, GL_OBJECT_INFO_LOG_LENGTH_ARB, &infologLength);
+
+			if (infologLength > 0)
+			{
+				GLint charsWritten  = 0;
+
+				GLcharARB * infoLog = new GLcharARB[infologLength];
+
+				glGetInfoLogARB(obj, infologLength, &charsWritten, infoLog);
+				logMessage += String(infoLog);
+				LogManager::getSingleton().logMessage(logMessage);
+
+				delete [] infoLog;
+			}
+		}
+
+		return logMessage;
+
+	}
+
+
+} // namespace Ogre
Index: /RenderSystems/GL/src/GLSL/src/OgreGLSLGpuProgram.cpp
===================================================================
--- /RenderSystems/GL/src/GLSL/src/OgreGLSLGpuProgram.cpp	(revision 5)
+++ /RenderSystems/GL/src/GLSL/src/OgreGLSLGpuProgram.cpp	(revision 5)
@@ -0,0 +1,174 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLSLExtSupport.h"
+#include "OgreGLSLGpuProgram.h"
+#include "OgreGLSLLinkProgramManager.h"
+#include "OgreGLSLLinkProgram.h"
+#include "OgreGLSLProgram.h"
+
+namespace Ogre {
+
+	GLuint GLSLGpuProgram::mVertexShaderCount = 0;
+	GLuint GLSLGpuProgram::mFragmentShaderCount = 0;
+
+    //-----------------------------------------------------------------------------
+	GLSLGpuProgram::GLSLGpuProgram(GLSLProgram* parent) : 
+        GLGpuProgram(parent->getCreator(), parent->getName(), parent->getHandle(), 
+            parent->getGroup(), false, 0), mGLSLProgram(parent)
+    {
+        mType = parent->getType();
+        mSyntaxCode = "glsl";
+
+		if (parent->getType() == GPT_VERTEX_PROGRAM)
+		{
+			mProgramID = ++mVertexShaderCount;
+		}
+		else
+		{
+			mProgramID = ++mFragmentShaderCount;
+		}
+
+        // transfer skeletal animation status from parent
+        mSkeletalAnimation = mGLSLProgram->isSkeletalAnimationIncluded();
+		// there is nothing to load
+		mLoadFromFile = false;
+
+    }
+    //-----------------------------------------------------------------------
+    GLSLGpuProgram::~GLSLGpuProgram()
+    {
+        // have to call this here reather than in Resource destructor
+        // since calling virtual methods in base destructors causes crash
+        unload(); 
+    }
+	//-----------------------------------------------------------------------------
+    void GLSLGpuProgram::loadImpl(void)
+    {
+		// nothing to load
+    }
+
+	//-----------------------------------------------------------------------------
+	void GLSLGpuProgram::unloadImpl(void)
+	{
+		// nothing to unload
+	}
+
+	//-----------------------------------------------------------------------------
+    void GLSLGpuProgram::loadFromSource(void)
+    {
+		// nothing to load
+	}
+
+	//-----------------------------------------------------------------------------
+	void GLSLGpuProgram::bindProgram(void)
+	{
+		// tell the Link Program Manager what shader is to become active
+		if (mType == GPT_VERTEX_PROGRAM)
+		{
+			GLSLLinkProgramManager::getSingleton().setActiveVertexShader( this );
+		}
+		else // its a fragment shader
+		{
+			GLSLLinkProgramManager::getSingleton().setActiveFragmentShader( this );
+		}
+	}
+
+	//-----------------------------------------------------------------------------
+	void GLSLGpuProgram::unbindProgram(void)
+	{
+		// tell the Link Program Manager what shader is to become inactive
+		if (mType == GPT_VERTEX_PROGRAM)
+		{
+			GLSLLinkProgramManager::getSingleton().setActiveVertexShader( NULL );
+		}
+		else // its a fragment shader
+		{
+			GLSLLinkProgramManager::getSingleton().setActiveFragmentShader( NULL );
+		}
+
+	}
+
+	//-----------------------------------------------------------------------------
+	void GLSLGpuProgram::bindProgramParameters(GpuProgramParametersSharedPtr params)
+	{
+		// activate the link program object
+		GLSLLinkProgram* linkProgram = GLSLLinkProgramManager::getSingleton().getActiveLinkProgram();
+		// pass on parameters from params to program object uniforms
+		linkProgram->updateUniforms(params, mType);
+		
+	}
+
+	//-----------------------------------------------------------------------------
+	void GLSLGpuProgram::bindProgramPassIterationParameters(GpuProgramParametersSharedPtr params)
+	{
+		// activate the link program object
+		GLSLLinkProgram* linkProgram = GLSLLinkProgramManager::getSingleton().getActiveLinkProgram();
+		// pass on parameters from params to program object uniforms
+		linkProgram->updatePassIterationUniforms( params );
+		
+	}
+	//-----------------------------------------------------------------------------
+	GLuint GLSLGpuProgram::getAttributeIndex(VertexElementSemantic semantic)
+	{
+		// get link program - only call this in the context of bound program
+		GLSLLinkProgram* linkProgram = GLSLLinkProgramManager::getSingleton().getActiveLinkProgram();
+
+		if (linkProgram->isAttributeValid(semantic))
+		{
+			return linkProgram->getAttributeIndex(semantic);
+		}
+		else
+		{
+			// fall back to default implementation, allow default bindings
+			return GLGpuProgram::getAttributeIndex(semantic);
+		}
+		
+	}
+	//-----------------------------------------------------------------------------
+	bool GLSLGpuProgram::isAttributeValid(VertexElementSemantic semantic)
+	{
+		// get link program - only call this in the context of bound program
+		GLSLLinkProgram* linkProgram = GLSLLinkProgramManager::getSingleton().getActiveLinkProgram();
+
+		if (linkProgram->isAttributeValid(semantic))
+		{
+			return true;
+		}
+		else
+		{
+			// fall back to default implementation, allow default bindings
+			return GLGpuProgram::isAttributeValid(semantic);
+		}
+	}
+
+
+
+}
+
Index: /RenderSystems/GL/src/GLSL/src/OgreGLSLLinkProgram.cpp
===================================================================
--- /RenderSystems/GL/src/GLSL/src/OgreGLSLLinkProgram.cpp	(revision 5)
+++ /RenderSystems/GL/src/GLSL/src/OgreGLSLLinkProgram.cpp	(revision 5)
@@ -0,0 +1,332 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLSLExtSupport.h"
+#include "OgreGLSLLinkProgram.h"
+#include "OgreStringConverter.h"
+#include "OgreGLSLGpuProgram.h"
+#include "OgreGLSLProgram.h"
+#include "OgreGLSLLinkProgramManager.h"
+
+namespace Ogre {
+
+	//-----------------------------------------------------------------------
+#define NO_ATTRIB 0xFFFF
+	GLSLLinkProgram::GLSLLinkProgram(GLSLGpuProgram* vertexProgram, GLSLGpuProgram* fragmentProgram)
+        : mVertexProgram(vertexProgram)
+		, mFragmentProgram(fragmentProgram)
+		, mUniformRefsBuilt(false)
+        , mLinked(false)
+		, mTangentAttrib(NO_ATTRIB)
+		, mBinormalAttrib(NO_ATTRIB)
+		, mBlendIndicesAttrib(NO_ATTRIB)
+		, mBlendWeightsAttrib(NO_ATTRIB)
+
+	{
+			checkForGLSLError( "GLSLLinkProgram::GLSLLinkProgram", "Error prior to Creating GLSL Program Object", 0 );
+		    mGLHandle = glCreateProgramObjectARB();
+			checkForGLSLError( "GLSLLinkProgram::GLSLLinkProgram", "Error Creating GLSL Program Object", 0 );
+
+
+			// tell shaders to attach themselves to the LinkProgram
+			// let the shaders do the attaching since they may have several children to attach
+			if (mVertexProgram)
+			{
+				mVertexProgram->getGLSLProgram()->attachToProgramObject(mGLHandle);
+				setSkeletalAnimationIncluded(mVertexProgram->isSkeletalAnimationIncluded());
+			}
+
+			if (mFragmentProgram)
+			{
+				mFragmentProgram->getGLSLProgram()->attachToProgramObject(mGLHandle);
+			}
+
+	}
+
+	//-----------------------------------------------------------------------
+	GLSLLinkProgram::~GLSLLinkProgram(void)
+	{
+		glDeleteObjectARB(mGLHandle);
+
+	}
+
+	//-----------------------------------------------------------------------
+	void GLSLLinkProgram::activate(void)
+	{
+		if (!mLinked)
+		{
+			glLinkProgramARB( mGLHandle );
+			glGetObjectParameterivARB( mGLHandle, GL_OBJECT_LINK_STATUS_ARB, &mLinked );
+			// force logging and raise exception if not linked
+			checkForGLSLError( "GLSLLinkProgram::Activate",
+				"Error linking GLSL Program Object", mGLHandle, !mLinked, !mLinked );
+			if(mLinked)
+			{
+				logObjectInfo( String("GLSL link result : "), mGLHandle );
+				buildGLUniformReferences();
+				extractAttributes();
+			}
+
+		}
+
+		if (mLinked)
+		{
+		    glUseProgramObjectARB( mGLHandle );
+		}
+	}
+
+	//-----------------------------------------------------------------------
+	void GLSLLinkProgram::extractAttributes(void)
+	{
+		GLint attrib = glGetAttribLocationARB(mGLHandle, "tangent");
+		mTangentAttrib = (attrib == -1)? NO_ATTRIB : (GLuint)attrib;
+		
+		attrib = glGetAttribLocationARB(mGLHandle, "binormal");
+		mBinormalAttrib = (attrib == -1)? NO_ATTRIB : (GLuint)attrib;
+
+		attrib = glGetAttribLocationARB(mGLHandle, "blendIndices");
+		mBlendIndicesAttrib = (attrib == -1)? NO_ATTRIB : (GLuint)attrib;
+
+		attrib = glGetAttribLocationARB(mGLHandle, "blendWeights");
+		mBlendWeightsAttrib = (attrib == -1)? NO_ATTRIB : (GLuint)attrib;
+
+	}
+	//-----------------------------------------------------------------------
+	GLuint GLSLLinkProgram::getAttributeIndex(VertexElementSemantic semantic)
+	{
+		switch(semantic)
+		{
+		case VES_TANGENT:
+			return mTangentAttrib;
+		case VES_BINORMAL:
+			return mBinormalAttrib;
+		case VES_BLEND_WEIGHTS:
+			return mBlendWeightsAttrib;
+		case VES_BLEND_INDICES:
+			return mBlendIndicesAttrib;
+		default:
+			assert(false && "Shouldn't be calling this with standard attribs!");
+			return 0;
+		};
+	}
+	//-----------------------------------------------------------------------
+	bool GLSLLinkProgram::isAttributeValid(VertexElementSemantic semantic)
+	{
+		switch(semantic)
+		{
+		case VES_TANGENT:
+			return mTangentAttrib != NO_ATTRIB;
+		case VES_BINORMAL:
+			return mBinormalAttrib != NO_ATTRIB;
+		case VES_BLEND_WEIGHTS:
+			return mBlendWeightsAttrib != NO_ATTRIB;
+		case VES_BLEND_INDICES:
+			return mBlendIndicesAttrib != NO_ATTRIB;
+		default:
+			return false;
+		};
+	}
+	//-----------------------------------------------------------------------
+	void GLSLLinkProgram::buildGLUniformReferences(void)
+	{
+		if (!mUniformRefsBuilt)
+		{
+			const GpuConstantDefinitionMap* vertParams = 0;
+			const GpuConstantDefinitionMap* fragParams = 0;
+
+			if (mVertexProgram)
+			{
+				vertParams = &(mVertexProgram->getGLSLProgram()->getConstantDefinitions().map);
+			}
+			if (mFragmentProgram)
+			{
+				fragParams = &(mFragmentProgram->getGLSLProgram()->getConstantDefinitions().map);
+			}
+
+			GLSLLinkProgramManager::getSingleton().extractUniforms(
+				mGLHandle, vertParams, fragParams, mGLUniformReferences);
+
+			mUniformRefsBuilt = true;
+		}
+	}
+
+	//-----------------------------------------------------------------------
+	void GLSLLinkProgram::updateUniforms(GpuProgramParametersSharedPtr params, 
+		GpuProgramType fromProgType)
+	{
+		// iterate through uniform reference list and update uniform values
+		GLUniformReferenceIterator currentUniform = mGLUniformReferences.begin();
+		GLUniformReferenceIterator endUniform = mGLUniformReferences.end();
+
+		for (;currentUniform != endUniform; ++currentUniform)
+		{
+			// Only pull values from buffer it's supposed to be in (vertex or fragment)
+			// This method will be called twice, once for vertex program params, 
+			// and once for fragment program params.
+			if (fromProgType == currentUniform->mSourceProgType)
+			{
+				const GpuConstantDefinition* def = currentUniform->mConstantDef;
+				GLsizei glArraySize = (GLsizei)def->arraySize;
+
+				// get the index in the parameter real list
+				switch (def->constType)
+				{
+				case GCT_FLOAT1:
+					glUniform1fvARB(currentUniform->mLocation, glArraySize, 
+						params->getFloatPointer(def->physicalIndex));
+					break;
+				case GCT_FLOAT2:
+					glUniform2fvARB(currentUniform->mLocation, glArraySize, 
+						params->getFloatPointer(def->physicalIndex));
+					break;
+				case GCT_FLOAT3:
+					glUniform3fvARB(currentUniform->mLocation, glArraySize, 
+						params->getFloatPointer(def->physicalIndex));
+					break;
+				case GCT_FLOAT4:
+					glUniform4fvARB(currentUniform->mLocation, glArraySize, 
+						params->getFloatPointer(def->physicalIndex));
+					break;
+				case GCT_MATRIX_2X2:
+					glUniformMatrix2fvARB(currentUniform->mLocation, glArraySize, 
+						GL_TRUE, params->getFloatPointer(def->physicalIndex));
+					break;
+				case GCT_MATRIX_2X3:
+					if (GLEW_VERSION_2_1)
+					{
+						glUniformMatrix2x3fv(currentUniform->mLocation, glArraySize, 
+							GL_TRUE, params->getFloatPointer(def->physicalIndex));
+					}
+					break;
+				case GCT_MATRIX_2X4:
+					if (GLEW_VERSION_2_1)
+					{
+						glUniformMatrix2x4fv(currentUniform->mLocation, glArraySize, 
+							GL_TRUE, params->getFloatPointer(def->physicalIndex));
+					}
+					break;
+				case GCT_MATRIX_3X2:
+					if (GLEW_VERSION_2_1)
+					{
+						glUniformMatrix3x2fv(currentUniform->mLocation, glArraySize, 
+							GL_TRUE, params->getFloatPointer(def->physicalIndex));
+					}
+					break;
+				case GCT_MATRIX_3X3:
+					glUniformMatrix3fvARB(currentUniform->mLocation, glArraySize, 
+						GL_TRUE, params->getFloatPointer(def->physicalIndex));
+					break;
+				case GCT_MATRIX_3X4:
+					if (GLEW_VERSION_2_1)
+					{
+						glUniformMatrix3x4fv(currentUniform->mLocation, glArraySize, 
+							GL_TRUE, params->getFloatPointer(def->physicalIndex));
+					}
+					break;
+				case GCT_MATRIX_4X2:
+					if (GLEW_VERSION_2_1)
+					{
+						glUniformMatrix4x2fv(currentUniform->mLocation, glArraySize, 
+							GL_TRUE, params->getFloatPointer(def->physicalIndex));
+					}
+					break;
+				case GCT_MATRIX_4X3:
+					if (GLEW_VERSION_2_1)
+					{
+						glUniformMatrix4x3fv(currentUniform->mLocation, glArraySize, 
+							GL_TRUE, params->getFloatPointer(def->physicalIndex));
+					}
+					break;
+				case GCT_MATRIX_4X4:
+					glUniformMatrix4fvARB(currentUniform->mLocation, glArraySize, 
+						GL_TRUE, params->getFloatPointer(def->physicalIndex));
+					break;
+				case GCT_INT1:
+					glUniform1ivARB(currentUniform->mLocation, glArraySize, 
+						params->getIntPointer(def->physicalIndex));
+					break;
+				case GCT_INT2:
+					glUniform2ivARB(currentUniform->mLocation, glArraySize, 
+						params->getIntPointer(def->physicalIndex));
+					break;
+				case GCT_INT3:
+					glUniform3ivARB(currentUniform->mLocation, glArraySize, 
+						params->getIntPointer(def->physicalIndex));
+					break;
+				case GCT_INT4:
+					glUniform4ivARB(currentUniform->mLocation, glArraySize, 
+						params->getIntPointer(def->physicalIndex));
+					break;
+				case GCT_SAMPLER1D:
+				case GCT_SAMPLER1DSHADOW:
+				case GCT_SAMPLER2D:
+				case GCT_SAMPLER2DSHADOW:
+				case GCT_SAMPLER3D:
+				case GCT_SAMPLERCUBE:
+					// samplers handled like 1-element ints
+					glUniform1ivARB(currentUniform->mLocation, 1, 
+						params->getIntPointer(def->physicalIndex));
+					break;
+
+				} // end switch
+#if OGRE_DEBUG_MODE
+				checkForGLSLError( "GLSLLinkProgram::updateUniforms", "Error updating uniform", 0 );
+#endif
+
+			}
+  
+  		} // end for
+	}
+
+
+	//-----------------------------------------------------------------------
+	void GLSLLinkProgram::updatePassIterationUniforms(GpuProgramParametersSharedPtr params)
+	{
+		if (params->hasPassIterationNumber())
+		{
+			size_t index = params->getPassIterationNumberIndex();
+
+			GLUniformReferenceIterator currentUniform = mGLUniformReferences.begin();
+			GLUniformReferenceIterator endUniform = mGLUniformReferences.end();
+
+			// need to find the uniform that matches the multi pass entry
+			for (;currentUniform != endUniform; ++currentUniform)
+			{
+				// get the index in the parameter real list
+				if (index == currentUniform->mConstantDef->physicalIndex)
+				{
+					glUniform1fvARB( currentUniform->mLocation, 1, params->getFloatPointer(index));
+					// there will only be one multipass entry
+					return;
+				}
+			}
+		}
+
+    }
+} // namespace Ogre
Index: /RenderSystems/GL/src/GLSL/src/OgreGLSLLinkProgramManager.cpp
===================================================================
--- /RenderSystems/GL/src/GLSL/src/OgreGLSLLinkProgramManager.cpp	(revision 5)
+++ /RenderSystems/GL/src/GLSL/src/OgreGLSLLinkProgramManager.cpp	(revision 5)
@@ -0,0 +1,548 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLSLLinkProgramManager.h"
+#include "OgreGLSLGpuProgram.h"
+#include "OgreGLSLProgram.h"
+#include "OgreStringConverter.h"
+#include "OgreLogManager.h"
+
+namespace Ogre {
+
+	//-----------------------------------------------------------------------
+	template<> GLSLLinkProgramManager* Singleton<GLSLLinkProgramManager>::ms_Singleton = 0;
+
+	//-----------------------------------------------------------------------
+    GLSLLinkProgramManager* GLSLLinkProgramManager::getSingletonPtr(void)
+    {
+        return ms_Singleton;
+    }
+
+	//-----------------------------------------------------------------------
+    GLSLLinkProgramManager& GLSLLinkProgramManager::getSingleton(void)
+    {  
+        assert( ms_Singleton );  return ( *ms_Singleton );  
+    }
+
+	//-----------------------------------------------------------------------
+	GLSLLinkProgramManager::GLSLLinkProgramManager(void) : mActiveVertexGpuProgram(NULL),
+		mActiveFragmentGpuProgram(NULL), mActiveLinkProgram(NULL)
+	{
+		// Fill in the relationship between type names and enums
+		mTypeEnumMap.insert(StringToEnumMap::value_type("float", GL_FLOAT));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("vec2", GL_FLOAT_VEC2));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("vec3", GL_FLOAT_VEC3));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("vec4", GL_FLOAT_VEC4));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("sampler1D", GL_SAMPLER_1D));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("sampler2D", GL_SAMPLER_2D));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("sampler3D", GL_SAMPLER_3D));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("samplerCube", GL_SAMPLER_CUBE));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("sampler1DShadow", GL_SAMPLER_1D_SHADOW));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("sampler2DShadow", GL_SAMPLER_2D_SHADOW));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("int", GL_INT));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("ivec2", GL_INT_VEC2));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("ivec3", GL_INT_VEC3));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("ivec4", GL_INT_VEC4));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("mat2", GL_FLOAT_MAT2));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("mat3", GL_FLOAT_MAT3));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("mat4", GL_FLOAT_MAT4));
+		// GL 2.1
+		mTypeEnumMap.insert(StringToEnumMap::value_type("mat2x2", GL_FLOAT_MAT2));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("mat3x3", GL_FLOAT_MAT3));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("mat4x4", GL_FLOAT_MAT4));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("mat2x3", GL_FLOAT_MAT2x3));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("mat3x2", GL_FLOAT_MAT3x2));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("mat3x4", GL_FLOAT_MAT3x4));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("mat4x3", GL_FLOAT_MAT4x3));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("mat2x4", GL_FLOAT_MAT2x4));
+		mTypeEnumMap.insert(StringToEnumMap::value_type("mat4x2", GL_FLOAT_MAT4x2));
+
+	}
+
+	//-----------------------------------------------------------------------
+	GLSLLinkProgramManager::~GLSLLinkProgramManager(void)
+	{
+		// iterate through map container and delete link programs
+		for (LinkProgramIterator currentProgram = LinkPrograms.begin();
+			currentProgram != LinkPrograms.end(); ++currentProgram)
+		{
+			delete currentProgram->second;
+		}
+
+	}
+
+	//-----------------------------------------------------------------------
+	GLSLLinkProgram* GLSLLinkProgramManager::getActiveLinkProgram(void)
+	{
+		// if there is an active link program then return it
+		if (mActiveLinkProgram)
+			return mActiveLinkProgram;
+
+		// no active link program so find one or make a new one
+		// is there an active key?
+		GLuint activeKey = 0;
+
+		if (mActiveVertexGpuProgram)
+		{
+			activeKey = mActiveVertexGpuProgram->getProgramID() << 16;
+		}
+
+		if (mActiveFragmentGpuProgram)
+		{
+			activeKey += mActiveFragmentGpuProgram->getProgramID();
+		}
+
+		// only return a link program object if a vertex or fragment program exist
+		if (activeKey > 0)
+		{
+			// find the key in the hash map
+			LinkProgramIterator programFound = LinkPrograms.find(activeKey);
+			// program object not found for key so need to create it
+			if (programFound == LinkPrograms.end())
+			{
+				mActiveLinkProgram = new GLSLLinkProgram(mActiveVertexGpuProgram, mActiveFragmentGpuProgram);
+				LinkPrograms[activeKey] = mActiveLinkProgram;
+			}
+			else
+			{
+				// found a link program in map container so make it active
+				mActiveLinkProgram = programFound->second;
+			}
+
+		}
+		// make the program object active
+		if (mActiveLinkProgram) mActiveLinkProgram->activate();
+
+		return mActiveLinkProgram;
+
+	}
+
+	//-----------------------------------------------------------------------
+	void GLSLLinkProgramManager::setActiveFragmentShader(GLSLGpuProgram* fragmentGpuProgram)
+	{
+		if (fragmentGpuProgram != mActiveFragmentGpuProgram)
+		{
+			mActiveFragmentGpuProgram = fragmentGpuProgram;
+			// ActiveLinkProgram is no longer valid
+			mActiveLinkProgram = NULL;
+			// change back to fixed pipeline
+			glUseProgramObjectARB(0);
+		}
+	}
+
+	//-----------------------------------------------------------------------
+	void GLSLLinkProgramManager::setActiveVertexShader(GLSLGpuProgram* vertexGpuProgram)
+	{
+		if (vertexGpuProgram != mActiveVertexGpuProgram)
+		{
+			mActiveVertexGpuProgram = vertexGpuProgram;
+			// ActiveLinkProgram is no longer valid
+			mActiveLinkProgram = NULL;
+			// change back to fixed pipeline
+			glUseProgramObjectARB(0);
+		}
+	}
+	//---------------------------------------------------------------------
+	void GLSLLinkProgramManager::completeDefInfo(GLenum gltype, 
+		GpuConstantDefinition& defToUpdate)
+	{
+		// decode uniform size and type
+		// Note GLSL never packs rows into float4's(from an API perspective anyway)
+		// therefore all values are tight in the buffer
+		switch (gltype)
+		{
+		case GL_FLOAT:
+			defToUpdate.constType = GCT_FLOAT1;
+			defToUpdate.elementSize = 1;
+			break;
+		case GL_FLOAT_VEC2:
+			defToUpdate.constType = GCT_FLOAT2;
+			defToUpdate.elementSize = 2;
+			break;
+
+		case GL_FLOAT_VEC3:
+			defToUpdate.constType = GCT_FLOAT3;
+			defToUpdate.elementSize = 3;
+			break;
+
+		case GL_FLOAT_VEC4:
+			defToUpdate.constType = GCT_FLOAT4;
+			defToUpdate.elementSize = 4;
+			break;
+		case GL_SAMPLER_1D:
+			// need to record samplers for GLSL
+			defToUpdate.constType = GCT_SAMPLER1D;
+			defToUpdate.elementSize = 1;
+			break;
+		case GL_SAMPLER_2D:
+		case GL_SAMPLER_2D_RECT_ARB:
+			defToUpdate.constType = GCT_SAMPLER2D;
+			defToUpdate.elementSize = 1;
+			break;
+		case GL_SAMPLER_3D:
+			defToUpdate.constType = GCT_SAMPLER3D;
+			defToUpdate.elementSize = 1;
+			break;
+		case GL_SAMPLER_CUBE:
+			defToUpdate.constType = GCT_SAMPLERCUBE;
+			defToUpdate.elementSize = 1;
+			break;
+		case GL_SAMPLER_1D_SHADOW:
+			defToUpdate.constType = GCT_SAMPLER1DSHADOW;
+			defToUpdate.elementSize = 1;
+			break;
+		case GL_SAMPLER_2D_SHADOW:
+		case GL_SAMPLER_2D_RECT_SHADOW_ARB:
+			defToUpdate.constType = GCT_SAMPLER2DSHADOW;
+			defToUpdate.elementSize = 1;
+			break;
+		case GL_INT:
+			defToUpdate.constType = GCT_INT1;
+			defToUpdate.elementSize = 1;
+			break;
+		case GL_INT_VEC2:
+			defToUpdate.constType = GCT_INT2;
+			defToUpdate.elementSize = 2;
+			break;
+		case GL_INT_VEC3:
+			defToUpdate.constType = GCT_INT3;
+			defToUpdate.elementSize = 3;
+			break;
+		case GL_INT_VEC4:
+			defToUpdate.constType = GCT_INT4;
+			defToUpdate.elementSize = 4;
+			break;
+		case GL_FLOAT_MAT2:
+			defToUpdate.constType = GCT_MATRIX_2X2;
+			defToUpdate.elementSize = 4;
+			break;
+		case GL_FLOAT_MAT3:
+			defToUpdate.constType = GCT_MATRIX_3X3;
+			defToUpdate.elementSize = 9;
+			break;
+		case GL_FLOAT_MAT4:
+			defToUpdate.constType = GCT_MATRIX_4X4;
+			defToUpdate.elementSize = 16;
+			break;
+		case GL_FLOAT_MAT2x3:
+			defToUpdate.constType = GCT_MATRIX_2X3;
+			defToUpdate.elementSize = 6;
+			break;
+		case GL_FLOAT_MAT3x2:
+			defToUpdate.constType = GCT_MATRIX_3X2;
+			defToUpdate.elementSize = 6;
+			break;
+		case GL_FLOAT_MAT2x4:
+			defToUpdate.constType = GCT_MATRIX_2X4;
+			defToUpdate.elementSize = 8;
+			break;
+		case GL_FLOAT_MAT4x2:
+			defToUpdate.constType = GCT_MATRIX_4X2;
+			defToUpdate.elementSize = 8;
+			break;
+		case GL_FLOAT_MAT3x4:
+			defToUpdate.constType = GCT_MATRIX_3X4;
+			defToUpdate.elementSize = 12;
+			break;
+		case GL_FLOAT_MAT4x3:
+			defToUpdate.constType = GCT_MATRIX_4X3;
+			defToUpdate.elementSize = 12;
+			break;
+		default:
+			defToUpdate.constType = GCT_UNKNOWN;
+			break;
+
+		}
+
+	}
+	//---------------------------------------------------------------------
+	bool GLSLLinkProgramManager::completeParamSource(
+		const String& paramName,
+		const GpuConstantDefinitionMap* vertexConstantDefs, 
+		const GpuConstantDefinitionMap* fragmentConstantDefs, 
+		GLUniformReference& refToUpdate)
+	{
+		if (vertexConstantDefs)
+		{
+			GpuConstantDefinitionMap::const_iterator parami = 
+				vertexConstantDefs->find(paramName);
+			if (parami != vertexConstantDefs->end())
+			{
+				refToUpdate.mSourceProgType = GPT_VERTEX_PROGRAM;
+				refToUpdate.mConstantDef = &(parami->second);
+				return true;
+			}
+
+		}
+		if (fragmentConstantDefs)
+		{
+			GpuConstantDefinitionMap::const_iterator parami = 
+				fragmentConstantDefs->find(paramName);
+			if (parami != fragmentConstantDefs->end())
+			{
+				refToUpdate.mSourceProgType = GPT_FRAGMENT_PROGRAM;
+				refToUpdate.mConstantDef = &(parami->second);
+				return true;
+			}
+		}
+		return false;
+
+
+	}
+	//---------------------------------------------------------------------
+	void GLSLLinkProgramManager::extractUniforms(GLhandleARB programObject, 
+		const GpuConstantDefinitionMap* vertexConstantDefs, 
+		const GpuConstantDefinitionMap* fragmentConstantDefs, 
+		GLUniformReferenceList& list)
+	{
+		// scan through the active uniforms and add them to the reference list
+		GLint uniformCount;
+
+		#define BUFFERSIZE 200
+		char   uniformName[BUFFERSIZE];
+		//GLint location;
+		GLUniformReference newGLUniformReference;
+
+		// get the number of active uniforms
+		glGetObjectParameterivARB(programObject, GL_OBJECT_ACTIVE_UNIFORMS_ARB,
+			&uniformCount);
+
+		// Loop over each of the active uniforms, and add them to the reference container
+		// only do this for user defined uniforms, ignore built in gl state uniforms
+		for (int index = 0; index < uniformCount; index++)
+		{
+			GLint arraySize;
+			GLenum glType;
+			glGetActiveUniformARB(programObject, index, BUFFERSIZE, NULL, 
+				&arraySize, &glType, uniformName);
+			// don't add built in uniforms
+			newGLUniformReference.mLocation = glGetUniformLocationARB(programObject, uniformName);
+			if (newGLUniformReference.mLocation >= 0)
+			{
+				// user defined uniform found, add it to the reference list
+				String paramName = String( uniformName );
+				
+                // currant ATI drivers (Catalyst 7.2 and earlier) and older NVidia drivers will include all array elements as uniforms but we only want the root array name and location
+                // Also note that ATI Catalyst 6.8 to 7.2 there is a bug with glUniform that does not allow you to update a uniform array past the first uniform array element
+                // ie you can't start updating an array starting at element 1, must always be element 0.
+                
+                // if the uniform name has a "[" in it then its an array element uniform.
+                String::size_type arrayStart = paramName.find("[");
+                if (arrayStart != String::npos)
+                {
+                    // if not the first array element then skip it and continue to the next uniform
+                    if (paramName.compare(arrayStart, paramName.size() - 1, "[0]") != 0) continue;
+                    paramName = paramName.substr(0, arrayStart);
+                }
+                
+				// find out which params object this comes from
+				bool foundSource = completeParamSource(paramName, 
+					vertexConstantDefs, 
+					fragmentConstantDefs, newGLUniformReference);
+
+				// only add this parameter if we found the source
+				if (foundSource)
+				{
+					assert(arraySize == newGLUniformReference.mConstantDef->arraySize
+						&& "GL doesn't agree with our array size!");
+					list.push_back(newGLUniformReference);
+				}
+
+				// Don't bother adding individual array params, they will be
+				// picked up in the 'parent' parameter can copied all at once
+				// anyway, individual indexes are only needed for lookup from 
+				// user params
+			} // end if
+		} // end for
+
+	}
+	//---------------------------------------------------------------------
+	void GLSLLinkProgramManager::extractConstantDefs(const String& src, 
+		GpuNamedConstants& defs, const String& filename)
+	{
+		// Could have done this as a compiler but we don't want to have to 
+		// create a BNF for the whole GLSL syntax, so use a simpler method
+		String::size_type currPos = 0;
+		String line;
+		currPos = src.find("uniform", currPos);
+		while (currPos != String::npos)
+		{
+			GpuConstantDefinition def;
+			String paramName;
+
+			// Check that this is not in a comment block
+			bool inComment = false;
+			
+			// block-comments
+			size_t commentStart = src.rfind("/*", currPos);
+			if (commentStart != String::npos)
+			{
+				size_t commentEnd = src.rfind("*/", currPos);
+				if (commentEnd == String::npos || commentEnd < commentStart)
+				{
+					// no ending comment, or ending comment was from a previous batch
+					inComment = true;
+				}
+			}
+			// line-comments
+			if (!inComment)
+			{
+				commentStart = src.rfind("//", currPos);
+				if (commentStart != String::npos)
+				{
+					size_t lineEnd = src.rfind("\n", currPos);
+
+					// On same line as comment? Either no newline or nearest is before comment start
+					if (lineEnd == String::npos || lineEnd < commentStart)
+					{
+						inComment = true;
+					}
+				}
+			}
+
+			// Now check for using the word 'uniform' in a larger string & ignore
+			bool inLargerString = false;
+			if (!inComment)
+			{	
+				if (currPos != 0)
+				{
+					char prev = src.at(currPos - 1);
+					if (prev != ' ' && prev != '\t' && prev != '\r' && prev != '\n'
+						&& prev != ';')
+						inLargerString = true;
+				}
+				if (!inLargerString && currPos + 7 < src.size())
+				{
+					char next = src.at(currPos + 7);
+					if (next != ' ' && next != '\t' && next != '\r' && next != '\n')
+						inLargerString = true;
+				}
+
+			}
+
+			// skip 'uniform'
+			currPos += 7;
+
+			if (!inComment && !inLargerString)
+			{
+				// find terminating semicolon
+				String::size_type endPos = src.find(";", currPos);
+				if (endPos == String::npos)
+				{
+					// problem, missing semicolon, abort
+					break;
+				}
+				line = src.substr(currPos, endPos - currPos);
+
+				// Split into tokens
+				StringVector parts = StringUtil::split(line, ", \t\r\n");
+
+				for (StringVector::iterator i = parts.begin(); i != parts.end(); ++i)
+				{
+					// Is this a type?
+					StringToEnumMap::iterator typei = mTypeEnumMap.find(*i);
+					if (typei != mTypeEnumMap.end())
+					{
+						completeDefInfo(typei->second, def);
+					}
+					else
+					{
+						// if this is not a type, and not empty, it should be a name
+						StringUtil::trim(*i);
+						if (i->empty()) continue;
+
+						String::size_type arrayStart = i->find("[", 0);
+						if (arrayStart != String::npos)
+						{
+							// potential name (if butted up to array)
+							String name = i->substr(0, arrayStart);
+							StringUtil::trim(name);
+							if (!name.empty())
+								paramName = name;
+
+							String::size_type arrayEnd = i->find("]", arrayStart);
+							String arrayDimTerm = i->substr(arrayStart + 1, arrayEnd - arrayStart - 1);
+							StringUtil::trim(arrayDimTerm);
+							// the array term might be a simple number or it might be
+							// an expression (e.g. 24*3) or refer to a constant expression
+							// we'd have to evaluate the expression which could get nasty
+							// TODO
+							def.arraySize = StringConverter::parseInt(arrayDimTerm);
+
+						}
+						else
+						{
+							paramName = *i;
+							def.arraySize = 1;
+						}
+
+						// Name should be after the type, so complete def and add
+						// We do this now so that comma-separated params will do
+						// this part once for each name mentioned 
+						if (def.constType == GCT_UNKNOWN)
+						{
+							LogManager::getSingleton().logMessage(
+								"Problem parsing the following GLSL Uniform: '"
+								+ line + "' in file " + filename);
+							// next uniform
+							break;
+						}
+
+						// Complete def and add
+						// increment physical buffer location
+						if (def.isFloat())
+						{
+							def.physicalIndex = defs.floatBufferSize;
+							defs.floatBufferSize += def.arraySize * def.elementSize;
+						}
+						else
+						{
+							def.physicalIndex = defs.intBufferSize;
+							defs.intBufferSize += def.arraySize * def.elementSize;
+						}
+						defs.map.insert(GpuConstantDefinitionMap::value_type(paramName, def));
+
+						// Generate array accessors
+						defs.generateConstantDefinitionArrayEntries(paramName, def);
+
+
+					}
+
+				}
+
+			} // not commented or a larger symbol
+
+			// Find next one
+			currPos = src.find("uniform", currPos);
+
+		}
+		
+	}
+
+}
Index: /RenderSystems/GL/src/GLSL/src/OgreGLSLProgram.cpp
===================================================================
--- /RenderSystems/GL/src/GLSL/src/OgreGLSLProgram.cpp	(revision 5)
+++ /RenderSystems/GL/src/GLSL/src/OgreGLSLProgram.cpp	(revision 5)
@@ -0,0 +1,364 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreGpuProgram.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreRenderSystemCapabilities.h"
+#include "OgreStringConverter.h"
+#include "OgreGpuProgramManager.h"
+#include "OgreHighLevelGpuProgramManager.h"
+#include "OgreLogManager.h"
+
+#include "OgreGLSLProgram.h"
+#include "OgreGLSLGpuProgram.h"
+#include "OgreGLSLExtSupport.h"
+#include "OgreGLSLLinkProgramManager.h"
+
+namespace Ogre {
+
+    //-----------------------------------------------------------------------
+	GLSLProgram::CmdPreprocessorDefines GLSLProgram::msCmdPreprocessorDefines;
+    GLSLProgram::CmdAttach GLSLProgram::msCmdAttach;
+    //-----------------------------------------------------------------------
+    //---------------------------------------------------------------------------
+    GLSLProgram::~GLSLProgram()
+    {
+        // have to call this here reather than in Resource destructor
+        // since calling virtual methods in base destructors causes crash
+        if (isLoaded())
+        {
+            unload();
+        }
+        else
+        {
+            unloadHighLevel();
+        }
+    }
+    //-----------------------------------------------------------------------
+    void GLSLProgram::loadFromSource(void)
+    {
+        // only create a shader object if glsl is supported
+        if (isSupported())
+        {
+            checkForGLSLError( "GLSLProgram::GLSLProgram", "GL Errors before creating shader object", 0 );
+            // create shader object
+            mGLHandle = glCreateShaderObjectARB(
+                (mType == GPT_VERTEX_PROGRAM) ? GL_VERTEX_SHADER_ARB : GL_FRAGMENT_SHADER_ARB );
+
+            checkForGLSLError( "GLSLProgram::GLSLProgram", "Error creating GLSL shader Object", 0 );
+        }
+
+		// build preprocessor defines
+		// GLSL has no explicit interface for defining preprocessor flags outside
+		// of the source code, so we'll prepend some extra source code
+		String preprocessorSource;
+		if (!mPreprocessorDefines.empty())
+		{
+			StringUtil::StrStreamType tempStr;
+			// Split preprocessor defines and build up macro array
+			String::size_type pos = 0;
+			while (pos != String::npos)
+			{
+				// Find delims
+				String::size_type endPos = mPreprocessorDefines.find_first_of(";,=", pos);
+				if (endPos != String::npos)
+				{
+					// ok, we have a definition
+					tempStr << "#define ";
+					// name
+					tempStr << mPreprocessorDefines.substr(pos, endPos - pos) << " ";
+					pos = endPos;
+					
+					// Check definition part
+					if (mPreprocessorDefines[pos] == '=')
+					{
+						// set up a definition, skip delim
+						++pos;
+						endPos = mPreprocessorDefines.find_first_of(";,", pos);
+						if (endPos == String::npos)
+						{
+							tempStr << mPreprocessorDefines.substr(pos, String::npos);
+							pos = endPos;
+						}
+						else
+						{
+							tempStr << mPreprocessorDefines.substr(pos, endPos - pos);
+							pos = endPos+1;
+						}
+					}
+					else
+					{
+						// No definition part, define as "1"
+						++pos;
+						tempStr << "1";
+					}
+
+					tempStr << std::endl;
+				}
+				else
+				{
+					pos = endPos;
+				}
+			}
+
+			preprocessorSource = tempStr.str();
+		}
+
+		// Add preprocessor extras and main source
+		const char* sources[2];
+		sources[0] = preprocessorSource.c_str();
+		sources[1] = mSource.c_str();
+		glShaderSourceARB(mGLHandle, 2, sources, NULL);
+		// check for load errors
+		checkForGLSLError( "GLSLProgram::loadFromSource", "Cannot load GLSL high-level shader source : " + mName, 0 );
+
+		compile();
+    }
+    
+    //---------------------------------------------------------------------------
+	bool GLSLProgram::compile(const bool checkErrors)
+	{
+        if (checkErrors)
+        {
+            logObjectInfo("GLSL compiling: " + mName, mGLHandle);
+        }
+
+		glCompileShaderARB(mGLHandle);
+		// check for compile errors
+		glGetObjectParameterivARB(mGLHandle, GL_OBJECT_COMPILE_STATUS_ARB, &mCompiled);
+		// force exception if not compiled
+		if (checkErrors)
+		{
+			checkForGLSLError( "GLSLProgram::loadFromSource", "Cannot compile GLSL high-level shader : " + mName + " ", mGLHandle, !mCompiled, !mCompiled );
+			
+			if (mCompiled)
+			{
+				logObjectInfo("GLSL compiled : " + mName, mGLHandle);
+			}
+		}
+		return (mCompiled == 1);
+
+	}
+
+	//-----------------------------------------------------------------------
+	void GLSLProgram::createLowLevelImpl(void)
+	{
+		mAssemblerProgram = GpuProgramPtr(new GLSLGpuProgram( this ));
+	}
+	//---------------------------------------------------------------------------
+	void GLSLProgram::unloadImpl()
+	{   
+		// We didn't create mAssemblerProgram through a manager, so override this
+		// implementation so that we don't try to remove it from one. Since getCreator()
+		// is used, it might target a different matching handle!
+		mAssemblerProgram.setNull();
+
+		unloadHighLevel();
+	}
+	//-----------------------------------------------------------------------
+    void GLSLProgram::unloadHighLevelImpl(void)
+    {
+		if (isSupported())
+		{
+			glDeleteObjectARB(mGLHandle);
+		}
+
+
+    }
+
+	//-----------------------------------------------------------------------
+    void GLSLProgram::populateParameterNames(GpuProgramParametersSharedPtr params)
+    {
+		params->_setNamedConstants(&getConstantDefinitions());
+		// Don't set logical / physical maps here, as we can't access parameters by logical index in GLHL.
+    }
+	//-----------------------------------------------------------------------
+    void GLSLProgram::buildConstantDefinitions() const
+    {
+		// We need an accurate list of all the uniforms in the shader, but we
+		// can't get at them until we link all the shaders into a program object.
+
+
+		// Therefore instead, parse the source code manually and extract the uniforms
+		mConstantDefs.floatBufferSize = 0;
+		mConstantDefs.intBufferSize = 0;
+		GLSLLinkProgramManager::getSingleton().extractConstantDefs(mSource, mConstantDefs, mName);
+
+		// Also parse any attached sources
+		for (GLSLProgramContainer::const_iterator i = mAttachedGLSLPrograms.begin();
+			i != mAttachedGLSLPrograms.end(); ++i)
+		{
+			GLSLProgram* childShader = *i;
+
+			GLSLLinkProgramManager::getSingleton().extractConstantDefs(
+				childShader->getSource(), mConstantDefs, childShader->getName());
+
+		}
+
+
+
+    }
+
+	//-----------------------------------------------------------------------
+    GLSLProgram::GLSLProgram(ResourceManager* creator, 
+        const String& name, ResourceHandle handle,
+        const String& group, bool isManual, ManualResourceLoader* loader)
+        : HighLevelGpuProgram(creator, name, handle, group, isManual, loader)
+    {
+		// add parameter command "attach" to the material serializer dictionary
+        if (createParamDictionary("GLSLProgram"))
+        {
+            setupBaseParamDictionary();
+            ParamDictionary* dict = getParamDictionary();
+
+			dict->addParameter(ParameterDef("preprocessor_defines", 
+				"Preprocessor defines use to compile the program.",
+				PT_STRING),&msCmdPreprocessorDefines);
+            dict->addParameter(ParameterDef("attach", 
+                "name of another GLSL program needed by this program",
+                PT_STRING),&msCmdAttach);
+        }
+        // Manually assign language now since we use it immediately
+        mSyntaxCode = "glsl";
+
+		// want scenemanager to pass on surface and light states to the rendersystem
+		mPassSurfaceAndLightStates = true;
+
+        
+    }
+
+	//-----------------------------------------------------------------------
+    String GLSLProgram::CmdAttach::doGet(const void *target) const
+    {
+        return (static_cast<const GLSLProgram*>(target))->getAttachedShaderNames();
+    }
+	//-----------------------------------------------------------------------
+    void GLSLProgram::CmdAttach::doSet(void *target, const String& shaderNames)
+    {
+		//get all the shader program names: there could be more than one
+		StringVector vecShaderNames = StringUtil::split(shaderNames, " \t", 0);
+
+		size_t programNameCount = vecShaderNames.size();
+		for ( size_t i = 0; i < programNameCount; ++i )
+		{
+	        static_cast<GLSLProgram*>(target)->attachChildShader(vecShaderNames[i]);
+		}
+    }
+	//-----------------------------------------------------------------------
+	String GLSLProgram::CmdPreprocessorDefines::doGet(const void *target) const
+	{
+		return static_cast<const GLSLProgram*>(target)->getPreprocessorDefines();
+	}
+	void GLSLProgram::CmdPreprocessorDefines::doSet(void *target, const String& val)
+	{
+		static_cast<GLSLProgram*>(target)->setPreprocessorDefines(val);
+	}
+
+	//-----------------------------------------------------------------------
+    void GLSLProgram::attachChildShader(const String& name)
+	{
+		// is the name valid and already loaded?
+		// check with the high level program manager to see if it was loaded
+		HighLevelGpuProgramPtr hlProgram = HighLevelGpuProgramManager::getSingleton().getByName(name);
+		if (!hlProgram.isNull())
+		{
+			if (hlProgram->getSyntaxCode() == "glsl")
+			{
+				// make sure attached program source gets loaded and compiled
+				// don't need a low level implementation for attached shader objects
+				// loadHighLevelImpl will only load the source and compile once
+				// so don't worry about calling it several times
+				GLSLProgram* childShader = static_cast<GLSLProgram*>(hlProgram.getPointer());
+				// load the source and attach the child shader only if supported
+				if (isSupported())
+				{
+					childShader->loadHighLevelImpl();
+					// add to the container
+					mAttachedGLSLPrograms.push_back( childShader );
+					mAttachedShaderNames += name + " ";
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------------------------
+	void GLSLProgram::attachToProgramObject( const GLhandleARB programObject )
+	{
+		glAttachObjectARB( programObject, mGLHandle );
+		checkForGLSLError( "GLSLLinkProgram::GLSLLinkProgram",
+			"Error attaching " + mName + " shader object to GLSL Program Object", programObject );
+		// attach child objects
+		GLSLProgramContainerIterator childprogramcurrent = mAttachedGLSLPrograms.begin();
+		GLSLProgramContainerIterator childprogramend = mAttachedGLSLPrograms.end();
+
+ 		while (childprogramcurrent != childprogramend)
+		{
+
+			GLSLProgram* childShader = *childprogramcurrent;
+			// bug in ATI GLSL linker : modules without main function must be recompiled each time 
+			// they are linked to a different program object
+			// don't check for compile errors since there won't be any
+			// *** minor inconvenience until ATI fixes there driver
+			childShader->compile(false);
+
+			childShader->attachToProgramObject( programObject );
+
+			++childprogramcurrent;
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	void GLSLProgram::detachFromProgramObject( const GLhandleARB programObject )
+	{
+		glDetachObjectARB(programObject, mGLHandle);
+		checkForGLSLError( "GLSLLinkProgram::GLSLLinkProgram",
+			"Error detaching " + mName + " shader object from GLSL Program Object", programObject );
+		// attach child objects
+		GLSLProgramContainerIterator childprogramcurrent = mAttachedGLSLPrograms.begin();
+		GLSLProgramContainerIterator childprogramend = mAttachedGLSLPrograms.end();
+
+		while (childprogramcurrent != childprogramend)
+		{
+			GLSLProgram* childShader = *childprogramcurrent;
+			childShader->detachFromProgramObject( programObject );
+			++childprogramcurrent;
+		}
+
+	}
+
+    //-----------------------------------------------------------------------
+    const String& GLSLProgram::getLanguage(void) const
+    {
+        static const String language = "glsl";
+
+        return language;
+    }
+
+  
+}
Index: /RenderSystems/GL/src/GLSL/src/OgreGLSLProgramFactory.cpp
===================================================================
--- /RenderSystems/GL/src/GLSL/src/OgreGLSLProgramFactory.cpp	(revision 5)
+++ /RenderSystems/GL/src/GLSL/src/OgreGLSLProgramFactory.cpp	(revision 5)
@@ -0,0 +1,67 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLSLProgramFactory.h"
+#include "OgreGLSLLinkProgramManager.h"
+#include "OgreGLSLProgram.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+    String GLSLProgramFactory::sLanguageName = "glsl";
+    //-----------------------------------------------------------------------
+	GLSLProgramFactory::GLSLProgramFactory(void)
+    {
+		mLinkProgramManager = new GLSLLinkProgramManager();
+    }
+    //-----------------------------------------------------------------------
+    GLSLProgramFactory::~GLSLProgramFactory(void)
+    {
+		if (mLinkProgramManager)
+			delete mLinkProgramManager;
+    }
+    //-----------------------------------------------------------------------
+    const String& GLSLProgramFactory::getLanguage(void) const
+    {
+        return sLanguageName;
+    }
+    //-----------------------------------------------------------------------
+    HighLevelGpuProgram* GLSLProgramFactory::create(ResourceManager* creator, 
+        const String& name, ResourceHandle handle,
+        const String& group, bool isManual, ManualResourceLoader* loader)
+    {
+        return new GLSLProgram(creator, name, handle, group, isManual, loader);
+    }
+    //-----------------------------------------------------------------------
+	void GLSLProgramFactory::destroy(HighLevelGpuProgram* prog)
+    {
+        delete prog;
+    }
+    //-----------------------------------------------------------------------
+
+}
Index: /RenderSystems/GL/src/GLX/Makefile.am
===================================================================
--- /RenderSystems/GL/src/GLX/Makefile.am	(revision 5)
+++ /RenderSystems/GL/src/GLX/Makefile.am	(revision 5)
@@ -0,0 +1,14 @@
+INCLUDES = $(STLPORT_CFLAGS) \
+	   -I$(top_srcdir)/RenderSystems/GL/include \
+	   -I$(top_srcdir)/RenderSystems/GL/include/GLX \
+           -I$(top_srcdir)/RenderSystems/GL/src/GLSL/include \
+	   -I$(top_srcdir)/OgreMain/include $(GLSUPPORT_CFLAGS) \
+	   $(CFLAGS_VISIBILITY)
+
+noinst_LTLIBRARIES = libsupport.la
+
+libsupport_la_SOURCES = OgreGLXGLSupport.cpp \
+			OgreGLXWindow.cpp \
+			OgreGLXRenderTexture.cpp \
+			OgreGLXContext.cpp \
+			OgreGLXUtils.cpp
Index: /RenderSystems/GL/src/GLX/Makefile.in
===================================================================
--- /RenderSystems/GL/src/GLX/Makefile.in	(revision 5)
+++ /RenderSystems/GL/src/GLX/Makefile.in	(revision 5)
@@ -0,0 +1,513 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = RenderSystems/GL/src/GLX
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libsupport_la_LIBADD =
+am_libsupport_la_OBJECTS = OgreGLXGLSupport.lo OgreGLXWindow.lo \
+	OgreGLXRenderTexture.lo OgreGLXContext.lo OgreGLXUtils.lo
+libsupport_la_OBJECTS = $(am_libsupport_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libsupport_la_SOURCES)
+DIST_SOURCES = $(libsupport_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) \
+	   -I$(top_srcdir)/RenderSystems/GL/include \
+	   -I$(top_srcdir)/RenderSystems/GL/include/GLX \
+           -I$(top_srcdir)/RenderSystems/GL/src/GLSL/include \
+	   -I$(top_srcdir)/OgreMain/include $(GLSUPPORT_CFLAGS) \
+	   $(CFLAGS_VISIBILITY)
+
+noinst_LTLIBRARIES = libsupport.la
+libsupport_la_SOURCES = OgreGLXGLSupport.cpp \
+			OgreGLXWindow.cpp \
+			OgreGLXRenderTexture.cpp \
+			OgreGLXContext.cpp \
+			OgreGLXUtils.cpp
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  RenderSystems/GL/src/GLX/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  RenderSystems/GL/src/GLX/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libsupport.la: $(libsupport_la_OBJECTS) $(libsupport_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libsupport_la_LDFLAGS) $(libsupport_la_OBJECTS) $(libsupport_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLXContext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLXGLSupport.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLXRenderTexture.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLXUtils.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLXWindow.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /RenderSystems/GL/src/GLX/OgreGLUtil.h
===================================================================
--- /RenderSystems/GL/src/GLX/OgreGLUtil.h	(revision 5)
+++ /RenderSystems/GL/src/GLX/OgreGLUtil.h	(revision 5)
@@ -0,0 +1,40 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://ogre.sourgeforge.net/
+
+Copyright © 2000-2003 Steven J. Streeting
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/gpl.html.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef INCL_OGRE_GLUTIL_H
+#define INCL_OGRE_GLUTIL_H
+
+#include "GLX/OgreGLXGLSupport.h"
+
+namespace Ogre {
+    
+inline GLSupport* getGLSupport()
+{
+    return new GLXGLSupport();
+}
+
+};
+
+#endif // INCL_OGRE_GLUTIL_H
Index: /RenderSystems/GL/src/GLX/OgreGLXContext.cpp
===================================================================
--- /RenderSystems/GL/src/GLX/OgreGLXContext.cpp	(revision 5)
+++ /RenderSystems/GL/src/GLX/OgreGLXContext.cpp	(revision 5)
@@ -0,0 +1,84 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLRenderSystem.h"
+#include "OgreRoot.h"
+#include "OgreGLXContext.h"
+
+namespace Ogre {
+
+    GLXContext::GLXContext(::Display *dpy,
+                ::GLXDrawable drawable,
+                ::GLXContext ctx, 
+				::XVisualInfo* visualInfo) :
+        mDpy(dpy), mDrawable(drawable), mCtx(ctx), mVisualInfo(visualInfo)
+	{
+                  
+    }
+    GLXContext::GLXContext(::Display *dpy,
+                ::GLXDrawable drawable,
+                ::GLXContext ctx, 
+				::GLXFBConfig fbconfig) :
+        mDpy(dpy), mDrawable(drawable), mCtx(ctx), mVisualInfo(0), mFBConfig(fbconfig)
+	{
+                  
+    }
+    GLXContext::~GLXContext() {
+		// Unregister and destroy this context
+		// This will disable it if it was still active
+		// NB have to do this is subclass to ensure any methods called back
+		// are on this subclass and not half-destructed superclass
+		GLRenderSystem *rs = static_cast<GLRenderSystem*>(Root::getSingleton().getRenderSystem());
+		rs->_unregisterContext(this);
+    }
+
+    void GLXContext::setCurrent() {
+        glXMakeCurrent(mDpy, mDrawable, mCtx);
+    }
+	void GLXContext::endCurrent() {
+		glXMakeCurrent(mDpy, None, NULL);
+	}
+
+	GLContext* GLXContext::clone() const
+	{
+		// Create a new context, share lists with existing
+
+		if (mVisualInfo) // window context clone
+		{
+			::GLXContext newCtx = glXCreateContext(mDpy, mVisualInfo, mCtx,True);
+			return new GLXContext(mDpy, mDrawable, newCtx, mVisualInfo);
+		}
+		else // non-window
+		{
+			::GLXContext newCtx = glXCreateNewContext(mDpy, mFBConfig, GLX_RGBA_TYPE, mCtx, True);
+			return new GLXContext(mDpy, mDrawable, newCtx, mFBConfig);
+		}      
+	} 
+
+}
Index: /RenderSystems/GL/src/GLX/OgreGLXGLSupport.cpp
===================================================================
--- /RenderSystems/GL/src/GLX/OgreGLXGLSupport.cpp	(revision 5)
+++ /RenderSystems/GL/src/GLX/OgreGLXGLSupport.cpp	(revision 5)
@@ -0,0 +1,186 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+ 
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+ 
+This program 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 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 Lesser General Public License for more details.
+ 
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreRoot.h"
+
+#include "OgreGLXGLSupport.h"
+
+#include "OgreGLXWindow.h"
+#include "OgreGLTexture.h"
+
+#include "OgreGLXRenderTexture.h"
+
+namespace Ogre {
+
+GLXGLSupport::GLXGLSupport():
+mDisplay(0) {}
+
+GLXGLSupport::~GLXGLSupport() {}
+
+void GLXGLSupport::addConfig(void) {
+	ConfigOption optFullScreen;
+	ConfigOption optVideoMode;
+	ConfigOption optBitDepth;
+    ConfigOption optFSAA;
+	ConfigOption optRTTMode;
+
+	// FS setting possiblities
+	optFullScreen.name = "Full Screen";
+	optFullScreen.possibleValues.push_back("Yes");
+	optFullScreen.possibleValues.push_back("No");
+	optFullScreen.currentValue = "Yes";
+	optFullScreen.immutable = false;
+
+	// Video mode possiblities
+	optVideoMode.name = "Video Mode";
+	optVideoMode.immutable = false;
+
+	// We could query Xrandr here, but that wouldn't work in the non-fullscreen case
+	// or when that extension is disabled. Anyway, this list of modes is fairly
+	// complete.
+	optVideoMode.possibleValues.push_back("640 x 480");
+	optVideoMode.possibleValues.push_back("800 x 600");
+	optVideoMode.possibleValues.push_back("1024 x 768");
+	optVideoMode.possibleValues.push_back("1280 x 960");
+	optVideoMode.possibleValues.push_back("1280 x 1024");
+	optVideoMode.possibleValues.push_back("1600 x 1200");
+
+	optVideoMode.currentValue = "800 x 600";
+
+    //FSAA possibilities
+    optFSAA.name = "FSAA";
+    optFSAA.possibleValues.push_back("0");
+    optFSAA.possibleValues.push_back("2");
+    optFSAA.possibleValues.push_back("4");
+    optFSAA.possibleValues.push_back("6");
+    optFSAA.currentValue = "0";
+    optFSAA.immutable = false;
+
+	optRTTMode.name = "RTT Preferred Mode";
+	optRTTMode.possibleValues.push_back("FBO");
+	optRTTMode.possibleValues.push_back("PBuffer");
+	optRTTMode.possibleValues.push_back("Copy");
+	optRTTMode.currentValue = "FBO";
+	optRTTMode.immutable = false;
+
+
+	mOptions[optFullScreen.name] = optFullScreen;
+	mOptions[optVideoMode.name] = optVideoMode;
+    mOptions[optFSAA.name] = optFSAA;
+	mOptions[optRTTMode.name] = optRTTMode;
+}
+
+String GLXGLSupport::validateConfig(void) {
+	return String("");
+}
+
+RenderWindow* GLXGLSupport::createWindow(bool autoCreateWindow, GLRenderSystem* renderSystem, const String& windowTitle) 
+{
+	if (autoCreateWindow) {
+		ConfigOptionMap::iterator opt = mOptions.find("Full Screen");
+		if (opt == mOptions.end())
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't find full screen options!", "GLXGLSupport::createWindow");
+		bool fullscreen = (opt->second.currentValue == "Yes");
+
+		opt = mOptions.find("Video Mode");
+		if (opt == mOptions.end())
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't find video mode options!", "GLXGLSupport::createWindow");
+		String val = opt->second.currentValue;
+		String::size_type pos = val.find('x');
+		if (pos == String::npos)
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Invalid Video Mode provided", "GLXGLSupport::createWindow");
+
+		unsigned int w = StringConverter::parseUnsignedInt(val.substr(0, pos));
+		unsigned int h = StringConverter::parseUnsignedInt(val.substr(pos + 1));
+
+        // Parse FSAA config
+		NameValuePairList winOptions;
+		winOptions["title"] = windowTitle;
+        int fsaa_x_samples = 0;
+        opt = mOptions.find("FSAA");
+        if(opt != mOptions.end())
+        {
+			winOptions["FSAA"] = opt->second.currentValue;
+        }
+
+		return renderSystem->createRenderWindow(windowTitle, w, h, fullscreen, &winOptions);
+	} else {
+		// XXX What is the else?
+		return NULL;
+	}
+}
+
+RenderWindow* GLXGLSupport::newWindow(const String &name, unsigned int width, unsigned int height, 
+	bool fullScreen, const NameValuePairList *miscParams)
+{
+	GLXWindow* window = new GLXWindow(mDisplay);
+	window->create(name, width, height, fullScreen, miscParams);
+	return window;
+}
+
+void GLXGLSupport::start() {
+	LogManager::getSingleton().logMessage(
+	        "******************************\n"
+	        "*** Starting GLX Subsystem ***\n"
+	        "******************************");
+	mDisplay = XOpenDisplay(NULL);
+	if(!mDisplay) {
+		OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Couldn`t open X display", "GLXGLSupport::start");
+	}
+
+}
+
+void GLXGLSupport::stop() {
+	LogManager::getSingleton().logMessage(
+	        "******************************\n"
+	        "*** Stopping GLX Subsystem ***\n"
+	        "******************************");
+	if(mDisplay)
+		XCloseDisplay(mDisplay);
+	mDisplay = 0;
+}
+
+extern "C" {
+extern void (*glXGetProcAddressARB(const GLubyte *procName))( void );
+};
+
+void* GLXGLSupport::getProcAddress(const String& procname) {
+	return (void*)glXGetProcAddressARB((const GLubyte*)procname.c_str());
+}
+
+
+GLPBuffer *GLXGLSupport::createPBuffer(PixelComponentType format, size_t width, size_t height)
+{
+    return new GLXPBuffer(format, width, height);
+}
+
+}
Index: /RenderSystems/GL/src/GLX/OgreGLXRenderTexture.cpp
===================================================================
--- /RenderSystems/GL/src/GLX/OgreGLXRenderTexture.cpp	(revision 5)
+++ /RenderSystems/GL/src/GLX/OgreGLXRenderTexture.cpp	(revision 5)
@@ -0,0 +1,245 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreRoot.h"
+#include "OgreStringConverter.h"
+
+#include "OgreGLRenderSystem.h"
+
+#include "OgreGLXRenderTexture.h"
+#include "OgreGLXContext.h"
+#include "OgreGLXUtils.h"
+
+#include <iostream>
+
+/// ATI: GLX_ATI_pixel_format_float
+#ifndef GLX_RGBA_FLOAT_ATI_BIT
+#define GLX_RGBA_FLOAT_ATI_BIT 0x00000100
+#endif
+
+/// ARB: GLX_ARB_fbconfig_float
+#ifndef GLX_RGBA_FLOAT_BIT
+#define GLX_RGBA_FLOAT_BIT 0x00000004
+#endif
+
+#ifndef GLX_RGBA_FLOAT_TYPE
+#define GLX_RGBA_FLOAT_TYPE 0x20B9
+#endif
+
+
+namespace Ogre
+{
+    GLXPBuffer::GLXPBuffer(PixelComponentType format, size_t width, size_t height):
+        GLPBuffer(format, width, height),
+        _hPBuffer(0),
+        mContext(0)
+    {
+        createPBuffer();
+        // Create context
+        mContext = new GLXContext(_pDpy, _hPBuffer, _hGLContext, mFBConfig);
+    }
+        
+    GLContext *GLXPBuffer::getContext()
+    {
+        return mContext;
+    }
+
+    void GLXPBuffer::createPBuffer() {        
+        //LogManager::getSingleton().logMessage(
+        //"GLXPBuffer::Creating PBuffer"
+        //); 
+        _pDpy = glXGetCurrentDisplay();
+        ::GLXContext context = glXGetCurrentContext();
+        int screen = DefaultScreen(_pDpy);
+        int attribs[50], ideal[50];
+        int attrib;
+        
+        // Process format
+        int bits=0;
+        bool isFloat=false;
+        switch(mFormat)
+        {
+            case PCT_BYTE:
+                bits=8; isFloat=false;
+                break;
+            case PCT_SHORT:
+                bits=16; isFloat=false;
+                break;
+            case PCT_FLOAT16:
+                bits=16; isFloat=true;
+                break;
+            case PCT_FLOAT32:
+                bits=32; isFloat=true;
+                break;
+            default: break;
+        };
+        RTFType floatBuffer = RTF_NONE;
+        if(isFloat)
+        {
+            floatBuffer = detectRTFType();
+            if(floatBuffer == RTF_NONE || floatBuffer == RTF_NV)
+            {
+                OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "Floating point PBuffers not supported on this hardware",  "GLRenderTexture::createPBuffer");
+            }
+        }
+
+        // Create base required format description
+        attrib = 0;
+        if (floatBuffer == RTF_ATI) {
+            attribs[attrib++] = GLX_RENDER_TYPE;
+            attribs[attrib++] = GLX_RGBA_FLOAT_ATI_BIT;
+        } 
+        else if (floatBuffer == RTF_ARB) 
+        {
+            attribs[attrib++] = GLX_RENDER_TYPE;
+            attribs[attrib++] = GLX_RGBA_FLOAT_BIT;
+        }
+        else
+        {
+            attribs[attrib++] = GLX_RENDER_TYPE;
+            attribs[attrib++] = GLX_RGBA_BIT;
+        }     
+        attribs[attrib++] = GLX_DRAWABLE_TYPE;
+        attribs[attrib++] = GLX_PBUFFER_BIT;
+        attribs[attrib++] = GLX_DOUBLEBUFFER;
+        attribs[attrib++] = 0;
+        /*
+        if (floatBuffer == RTF_NV) {
+		    attribs[attrib++] = GLX_FLOAT_COMPONENTS_NV;
+		    attribs[attrib++] = 1;
+	    }
+        */
+        attribs[attrib++] = None;
+        
+        // Create "ideal" format description
+        attrib = 0;
+        ideal[attrib++] = GLX_RED_SIZE;
+        ideal[attrib++] = bits;        
+        ideal[attrib++] = GLX_GREEN_SIZE;
+        ideal[attrib++] = bits;
+        ideal[attrib++] = GLX_BLUE_SIZE;
+        ideal[attrib++] = bits;        
+        ideal[attrib++] = GLX_ALPHA_SIZE;
+        ideal[attrib++] = bits;
+        ideal[attrib++] = GLX_DEPTH_SIZE;
+        ideal[attrib++] = 24;
+        ideal[attrib++] = GLX_STENCIL_SIZE;
+        ideal[attrib++] = 8;
+        ideal[attrib++] = GLX_ACCUM_RED_SIZE;
+        ideal[attrib++] = 0;    // Accumulation buffer not used
+        ideal[attrib++] = GLX_ACCUM_GREEN_SIZE;
+        ideal[attrib++] = 0;    // Accumulation buffer not used
+        ideal[attrib++] = GLX_ACCUM_BLUE_SIZE;
+        ideal[attrib++] = 0;    // Accumulation buffer not used
+        ideal[attrib++] = GLX_ACCUM_ALPHA_SIZE;
+        ideal[attrib++] = 0;    // Accumulation buffer not used
+        ideal[attrib++] = None;
+
+        // Create vector of existing config data formats        
+        mFBConfig = GLXUtils::findBestMatch(_pDpy, screen, attribs, ideal);
+
+        // Create the pbuffer in the best matching format
+        attrib = 0;
+        attribs[attrib++] = GLX_PBUFFER_WIDTH;
+        attribs[attrib++] = mWidth; // Get from texture?
+        attribs[attrib++] = GLX_PBUFFER_HEIGHT;
+        attribs[attrib++] = mHeight; // Get from texture?
+        attribs[attrib++] = GLX_PRESERVED_CONTENTS;
+        attribs[attrib++] = 1;
+        attribs[attrib++] = None;
+
+        FBConfigData configData(_pDpy, mFBConfig);
+        LogManager::getSingleton().logMessage(
+                LML_NORMAL,
+                "GLXPBuffer::PBuffer chose format "+configData.toString());                   
+
+        _hPBuffer = glXCreatePbuffer(_pDpy, mFBConfig, attribs);
+        if (!_hPBuffer) 
+            OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "glXCreatePbuffer() failed", "GLRenderTexture::createPBuffer");
+
+        _hGLContext = glXCreateNewContext(_pDpy, mFBConfig, GLX_RGBA_TYPE, context, True);
+        if (!_hGLContext) 
+            OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "glXCreateContext() failed", "GLRenderTexture::createPBuffer");        
+
+        // Query real width and height
+        GLuint iWidth, iHeight;
+        glXQueryDrawable(_pDpy, _hPBuffer, GLX_WIDTH, &iWidth);
+        glXQueryDrawable(_pDpy, _hPBuffer, GLX_HEIGHT, &iHeight);
+
+        LogManager::getSingleton().logMessage(
+             LML_NORMAL,
+                "GLXPBuffer::PBuffer created -- Real dimensions "+
+                StringConverter::toString(iWidth)+"x"+StringConverter::toString(iHeight)+
+                ", number of bits is "+
+                StringConverter::toString(bits)+
+                ", floating point is "+
+                StringConverter::toString(isFloat)
+        );
+        mWidth = iWidth;  
+        mHeight = iHeight;
+    }
+
+    GLXPBuffer::~GLXPBuffer()
+    {
+        // Destroy and unregister context
+        delete mContext;
+        // Destroy GL context
+        glXDestroyContext(_pDpy, _hGLContext);
+        _hGLContext = 0;
+        glXDestroyPbuffer(_pDpy, _hPBuffer);
+        _hPBuffer = 0;
+        LogManager::getSingleton().logMessage(
+             LML_NORMAL,
+                "GLXPBuffer::PBuffer destroyed");
+    }
+    
+    GLXPBuffer::RTFType GLXPBuffer::detectRTFType()
+    {
+        RTFType floatBuffer = RTF_NONE;
+        /// Query supported float buffer extensions
+        /// Choose the best one
+        std::stringstream ext;
+        std::string instr;
+        ext << glXQueryExtensionsString(_pDpy, DefaultScreen(_pDpy)) << " " << glXGetClientString(_pDpy, GLX_EXTENSIONS);
+        while(ext >> instr)
+        {
+            if(instr == "GLX_NV_float_buffer" && floatBuffer<RTF_NV)
+                floatBuffer = RTF_NV;
+            if(instr == "GLX_ATI_pixel_format_float" && floatBuffer<RTF_ATI)
+                floatBuffer = RTF_ATI;
+            if(instr == "GLX_ARB_fbconfig_float" && floatBuffer<RTF_ARB)
+                floatBuffer = RTF_ARB;
+        }
+        return floatBuffer;
+    }
+  
+}
Index: /RenderSystems/GL/src/GLX/OgreGLXUtils.cpp
===================================================================
--- /RenderSystems/GL/src/GLX/OgreGLXUtils.cpp	(revision 5)
+++ /RenderSystems/GL/src/GLX/OgreGLXUtils.cpp	(revision 5)
@@ -0,0 +1,403 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreStableHeaders.h"
+
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreRoot.h"
+#include "OgreStringConverter.h"
+
+#include "OgreGLRenderSystem.h"
+#include "OgreGLXUtils.h"
+
+#include "OgreNoMemoryMacros.h"
+#include <GL/glxext.h>
+
+namespace Ogre {
+    struct visual_attribs
+    {
+       /* X visual attribs */
+       int id;
+       int klass;
+       int depth;
+       int redMask, greenMask, blueMask;
+       int colormapSize;
+       int bitsPerRGB;
+
+       /* GL visual attribs */
+       int supportsGL;
+       int transparentType;
+       int transparentRedValue;
+       int transparentGreenValue;
+       int transparentBlueValue;
+       int transparentAlphaValue;
+       int transparentIndexValue;
+       int bufferSize;
+       int level;
+       int rgba;
+       int doubleBuffer;
+       int stereo;
+       int auxBuffers;
+       int redSize, greenSize, blueSize, alphaSize;
+       int depthSize;
+       int stencilSize;
+       int accumRedSize, accumGreenSize, accumBlueSize, accumAlphaSize;
+       int numSamples, numMultisample;
+       int visualCaveat;
+    };
+
+
+
+    FBConfigData::FBConfigData():
+        configID(0), visualID(0), bufferSize(0), level(0), doubleBuffer(0), stereo(0),
+        auxBuffers(0), renderType(0),
+        redSize(0), greenSize(0), blueSize(0), alphaSize(0),
+        depthSize(0), stencilSize(0),
+        accumRedSize(0), accumGreenSize(0), accumBlueSize(0), accumAlphaSize(0),
+        drawableType(0), caveat(0),
+        maxPBufferWidth(0), maxPBufferHeight(0), maxPBufferPixels(0)
+    {
+        memset(this, 0, sizeof(FBConfigData));
+    }
+    FBConfigData::FBConfigData(Display *dpy, GLXFBConfig config)
+    {
+        memset(this, 0, sizeof(FBConfigData));
+
+        glXGetFBConfigAttrib(dpy, config, GLX_FBCONFIG_ID, &configID);
+        glXGetFBConfigAttrib(dpy, config, GLX_VISUAL_ID, &visualID);
+        glXGetFBConfigAttrib(dpy, config, GLX_BUFFER_SIZE, &bufferSize);
+        glXGetFBConfigAttrib(dpy, config, GLX_LEVEL, &level);
+        glXGetFBConfigAttrib(dpy, config, GLX_DOUBLEBUFFER, &doubleBuffer);
+        glXGetFBConfigAttrib(dpy, config, GLX_STEREO, &stereo);
+        glXGetFBConfigAttrib(dpy, config, GLX_AUX_BUFFERS, &auxBuffers);
+        glXGetFBConfigAttrib(dpy, config, GLX_RENDER_TYPE, &renderType);
+        glXGetFBConfigAttrib(dpy, config, GLX_RED_SIZE, &redSize);
+        glXGetFBConfigAttrib(dpy, config, GLX_GREEN_SIZE, &greenSize);
+        glXGetFBConfigAttrib(dpy, config, GLX_BLUE_SIZE, &blueSize);
+        glXGetFBConfigAttrib(dpy, config, GLX_ALPHA_SIZE, &alphaSize);
+        glXGetFBConfigAttrib(dpy, config, GLX_DEPTH_SIZE, &depthSize);
+        glXGetFBConfigAttrib(dpy, config, GLX_STENCIL_SIZE, &stencilSize);
+        glXGetFBConfigAttrib(dpy, config, GLX_ACCUM_RED_SIZE, &accumRedSize);
+        glXGetFBConfigAttrib(dpy, config, GLX_ACCUM_GREEN_SIZE, &accumGreenSize);
+        glXGetFBConfigAttrib(dpy, config, GLX_ACCUM_BLUE_SIZE, &accumBlueSize);
+        glXGetFBConfigAttrib(dpy, config, GLX_ACCUM_ALPHA_SIZE, &accumAlphaSize);
+        glXGetFBConfigAttrib(dpy, config, GLX_DRAWABLE_TYPE, &drawableType);
+        glXGetFBConfigAttrib(dpy, config, GLX_CONFIG_CAVEAT, &caveat);
+        glXGetFBConfigAttrib(dpy, config, GLX_MAX_PBUFFER_WIDTH, &maxPBufferWidth);
+        glXGetFBConfigAttrib(dpy, config, GLX_MAX_PBUFFER_HEIGHT, &maxPBufferHeight);
+        glXGetFBConfigAttrib(dpy, config, GLX_MAX_PBUFFER_PIXELS, &maxPBufferPixels);
+    }
+    String FBConfigData::toString() const
+    {
+        std::stringstream ss;
+        ss << "configID=" << configID;
+        ss << " visualID=" << visualID;
+        ss << " bufferSize=" << bufferSize;
+        ss << " level=" << level;
+        ss << " doubleBuffer=" << doubleBuffer;
+        ss << " stereo=" << stereo;
+        ss << " auxBuffers=" << auxBuffers;
+        ss << " renderType=" << renderType;
+        ss << " redSize=" << redSize;
+        ss << " greenSize=" << greenSize;
+        ss << " blueSize=" << blueSize;
+        ss << " alphaSize=" << alphaSize;
+        ss << " depthSize=" << depthSize;
+        ss << " stencilSize=" << stencilSize;
+        ss << " accumRedSize=" << accumRedSize;
+        ss << " accumGreenSize=" << accumGreenSize;
+        ss << " accumBlueSize=" << accumBlueSize;
+        ss << " accumAlphaSize=" << accumAlphaSize;
+        ss << " drawableType=" << drawableType;
+        ss << " caveat=" << caveat;
+        ss << " maxPBufferWidth=" << maxPBufferWidth;
+        ss << " maxPBufferHeight=" << maxPBufferHeight;
+        ss << " maxPBufferPixels=" << maxPBufferPixels;
+        return ss.str();
+    }
+
+    bool GLXUtils::LoadIcon(Display *mDisplay, Window rootWindow, const std::string &name, Pixmap *pix, Pixmap *mask)
+    {
+     Image img;
+     int mWidth, mHeight;
+       char *data, *bitmap;
+       try {
+          // Try to load image
+           img.load(name, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+         mWidth = img.getWidth();
+           mHeight = img.getHeight();
+         if(img.getFormat() != PF_A8R8G8B8)
+             // Image format must be RGBA
+               return 0;
+      } catch(Exception &e) {
+            // Could not find image; never mind
+            return false;
+      }
+
+     // Allocate space for image data
+       data = (char*)malloc(mWidth * mHeight * 4); // Must be allocated with malloc
+       // Allocate space for transparency bitmap
+      int wbits = (mWidth+7)/8;
+      bitmap = (char*)malloc(wbits * mHeight);
+
+      // Convert and copy image
+      const char *imgdata = (const char*)img.getData();
+      int sptr = 0, dptr = 0;
+        for(int y=0; y<mHeight; y++) {
+         for(int x=0; x<mWidth; x++) {
+              data[dptr + 0] = 0;
+                data[dptr + 1] = imgdata[sptr + 0];
+                data[dptr + 2] = imgdata[sptr + 1];
+                data[dptr + 3] = imgdata[sptr + 2];
+                // Alpha threshold
+             if(((unsigned char)imgdata[sptr + 3])<128) {
+                   bitmap[y*wbits+(x>>3)] &= ~(1<<(x&7));
+             } else {
+                   bitmap[y*wbits+(x>>3)] |= 1<<(x&7);
+                }
+              sptr += 4;
+             dptr += 4;
+         }
+      }
+
+     /* put my pixmap data into the client side X image data structure */
+       XImage *image = XCreateImage (mDisplay, NULL, 24, ZPixmap, 0,
+                                    data,
+                                      mWidth, mHeight, 8,
+                                    mWidth*4);
+       image->byte_order = MSBFirst; // 0RGB format
+
+      /* tell server to start managing my pixmap */
+      Pixmap retval = XCreatePixmap(mDisplay, rootWindow, mWidth,
+                                      mHeight, 24);
+
+       /* copy from client to server */
+       GC context = XCreateGC (mDisplay, rootWindow, 0, NULL);
+        XPutImage(mDisplay, retval, context, image, 0, 0, 0, 0,
+                  mWidth, mHeight);
+
+       /* free up the client side pixmap data area */
+     XDestroyImage(image); // also cleans data
+      XFreeGC(mDisplay, context);
+
+       *pix = retval;
+     *mask = XCreateBitmapFromData(mDisplay, rootWindow, bitmap, mWidth, mHeight);
+      free(bitmap);
+      return true;
+    }
+
+
+
+    static void
+    get_visual_attribs(Display *dpy, XVisualInfo *vInfo,
+                       struct visual_attribs *attribs)
+    {
+     const char *ext = glXQueryExtensionsString(dpy, vInfo->screen);
+
+       memset(attribs, 0, sizeof(struct visual_attribs));
+
+        attribs->id = vInfo->visualid;
+    #if defined(__cplusplus) || defined(c_plusplus)
+
+        attribs->klass = vInfo->c_class;
+    #else
+
+        attribs->klass = vInfo->class;
+    #endif
+
+     attribs->depth = vInfo->depth;
+     attribs->redMask = vInfo->red_mask;
+        attribs->greenMask = vInfo->green_mask;
+        attribs->blueMask = vInfo->blue_mask;
+      attribs->colormapSize = vInfo->colormap_size;
+      attribs->bitsPerRGB = vInfo->bits_per_rgb;
+
+        if (glXGetConfig(dpy, vInfo, GLX_USE_GL, &attribs->supportsGL) != 0)
+           return;
+        glXGetConfig(dpy, vInfo, GLX_BUFFER_SIZE, &attribs->bufferSize);
+       glXGetConfig(dpy, vInfo, GLX_LEVEL, &attribs->level);
+      glXGetConfig(dpy, vInfo, GLX_RGBA, &attribs->rgba);
+        glXGetConfig(dpy, vInfo, GLX_DOUBLEBUFFER, &attribs->doubleBuffer);
+        glXGetConfig(dpy, vInfo, GLX_STEREO, &attribs->stereo);
+        glXGetConfig(dpy, vInfo, GLX_AUX_BUFFERS, &attribs->auxBuffers);
+       glXGetConfig(dpy, vInfo, GLX_RED_SIZE, &attribs->redSize);
+     glXGetConfig(dpy, vInfo, GLX_GREEN_SIZE, &attribs->greenSize);
+     glXGetConfig(dpy, vInfo, GLX_BLUE_SIZE, &attribs->blueSize);
+       glXGetConfig(dpy, vInfo, GLX_ALPHA_SIZE, &attribs->alphaSize);
+     glXGetConfig(dpy, vInfo, GLX_DEPTH_SIZE, &attribs->depthSize);
+     glXGetConfig(dpy, vInfo, GLX_STENCIL_SIZE, &attribs->stencilSize);
+     glXGetConfig(dpy, vInfo, GLX_ACCUM_RED_SIZE, &attribs->accumRedSize);
+      glXGetConfig(dpy, vInfo, GLX_ACCUM_GREEN_SIZE, &attribs->accumGreenSize);
+      glXGetConfig(dpy, vInfo, GLX_ACCUM_BLUE_SIZE, &attribs->accumBlueSize);
+        glXGetConfig(dpy, vInfo, GLX_ACCUM_ALPHA_SIZE, &attribs->accumAlphaSize);
+
+     /* get transparent pixel stuff */
+      glXGetConfig(dpy, vInfo,GLX_TRANSPARENT_TYPE, &attribs->transparentType);
+      if (attribs->transparentType == GLX_TRANSPARENT_RGB) {
+         glXGetConfig(dpy, vInfo, GLX_TRANSPARENT_RED_VALUE, &attribs->transparentRedValue);
+            glXGetConfig(dpy, vInfo, GLX_TRANSPARENT_GREEN_VALUE, &attribs->transparentGreenValue);
+            glXGetConfig(dpy, vInfo, GLX_TRANSPARENT_BLUE_VALUE, &attribs->transparentBlueValue);
+          glXGetConfig(dpy, vInfo, GLX_TRANSPARENT_ALPHA_VALUE, &attribs->transparentAlphaValue);
+        } else if (attribs->transparentType == GLX_TRANSPARENT_INDEX) {
+            glXGetConfig(dpy, vInfo, GLX_TRANSPARENT_INDEX_VALUE, &attribs->transparentIndexValue);
+        }
+
+     /* multisample attribs */
+       if (ext && strstr("GLX_ARB_multisample", ext) == 0) {
+          	glXGetConfig(dpy, vInfo, GLX_SAMPLE_BUFFERS_ARB, &attribs->numMultisample);
+            glXGetConfig(dpy, vInfo, GLX_SAMPLES_ARB, &attribs->numSamples);
+       }
+       else {
+         attribs->numSamples = 0;
+           attribs->numMultisample = 0;
+       }
+
+      if (ext && strstr(ext, "GLX_EXT_visual_rating")) {
+         glXGetConfig(dpy, vInfo, GLX_VISUAL_CAVEAT_EXT, &attribs->visualCaveat);
+       } else {
+           attribs->visualCaveat = GLX_NONE_EXT;
+      }
+    }
+
+    /*
+     * Examine all visuals to find the so-called best one.
+     * We prefer deepest RGBA buffer with depth, stencil and accum
+     * that has no caveats.
+     * @author Brian Paul (from the glxinfo source)
+     */
+    int GLXUtils::findBestVisual(Display *dpy, int scrnum, int multiSample)
+    {
+        XVisualInfo theTemplate;
+       XVisualInfo *visuals;
+      int numVisuals;
+        long mask;
+     int i;
+     struct visual_attribs bestVis;
+	 int msDiff;
+
+        /* get list of all visuals on this screen */
+       theTemplate.screen = scrnum;
+       mask = VisualScreenMask;
+       visuals = XGetVisualInfo(dpy, mask, &theTemplate, &numVisuals);
+        if(numVisuals == 0 || visuals == 0) {
+          /* something went wrong */
+         if(visuals)
+                XFree(visuals);
+            return -1;
+     }
+
+     /* init bestVis with first visual info */
+      get_visual_attribs(dpy, &visuals[0], &bestVis);
+
+       /* try to find a "better" visual */
+        for (i = 1; i < numVisuals; i++) {
+         struct visual_attribs vis;
+
+            get_visual_attribs(dpy, &visuals[i], &vis);
+
+           	/* always skip visuals that are slow */
+         	if (vis.visualCaveat == GLX_SLOW_VISUAL_EXT)
+         	    continue;
+		 	/* skip visual if it doesn't have the desired number of multisamples */
+			if (multiSample != -1 && vis.numSamples != multiSample)
+			   continue;
+
+         /* see if this vis is better than bestVis */
+
+           if ((!bestVis.supportsGL && vis.supportsGL) ||
+                         (bestVis.visualCaveat != GLX_NONE_EXT) ||
+                          (!bestVis.rgba && vis.rgba) ||
+                         (!bestVis.doubleBuffer && vis.doubleBuffer) ||
+                         (bestVis.redSize < vis.redSize) ||
+                         (bestVis.greenSize < vis.greenSize) ||
+                         (bestVis.blueSize < vis.blueSize) ||
+                           (bestVis.alphaSize < vis.alphaSize) ||
+                         (bestVis.depthSize < vis.depthSize) ||
+                         (bestVis.stencilSize < vis.stencilSize) ||
+                         (bestVis.accumRedSize < vis.accumRedSize))
+			{
+               /* found a better visual */
+                bestVis = vis;
+			}
+
+      }
+
+     XFree(visuals);
+    	if (multiSample != -1 && bestVis.numSamples != multiSample)
+			// We found no visual with the desired FSAA
+			return -1;
+       return bestVis.id;
+    }
+
+    /**
+     * Class to sort FBConfig records by best match
+     */
+    class FBConfigMatchSort
+    {
+    public:
+        FBConfigMatchSort(Display *dpy, const int *idealattribs): dpy(dpy), mIdeal(idealattribs) { }
+
+        Display *dpy;
+        const int *mIdeal;
+        bool operator()(const GLXFBConfig & a, const GLXFBConfig & b)
+        {
+            for(int idx = 0; mIdeal[idx] != None; idx += 2)
+            {
+                int valuea, valueb;
+                int valueideal = mIdeal[idx+1];
+                glXGetFBConfigAttrib(dpy, a, mIdeal[idx], &valuea);
+                glXGetFBConfigAttrib(dpy, b, mIdeal[idx], &valueb);
+                // Distance to a smaller than distance to b?
+                if(std::abs(valuea - valueideal) < std::abs(valueb - valueideal))
+                    return true;
+            }
+            return false;
+        }
+    };
+
+
+    GLXFBConfig GLXUtils::findBestMatch(Display *dpy, int scrnum, const int *attribs, const int *idealattribs)
+    {
+        // Create vector of existing config data formats
+        GLXFBConfig * fbConfigs;
+        int nConfigs;
+        fbConfigs = glXChooseFBConfig(dpy, scrnum, attribs, &nConfigs);
+        if (nConfigs == 0 || !fbConfigs)
+            OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "glXChooseFBConfig() failed: Couldn't find a suitable pixel format", "GLRenderTexture::createPBuffer");
+
+        // Sort by best match
+        std::sort(fbConfigs, fbConfigs+nConfigs, FBConfigMatchSort(dpy, idealattribs));
+
+        GLXFBConfig retval = fbConfigs[0];
+        XFree(fbConfigs);
+
+        return retval;
+    }
+
+};
Index: /RenderSystems/GL/src/GLX/OgreGLXWindow.cpp
===================================================================
--- /RenderSystems/GL/src/GLX/OgreGLXWindow.cpp	(revision 5)
+++ /RenderSystems/GL/src/GLX/OgreGLXWindow.cpp	(revision 5)
@@ -0,0 +1,570 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLXWindow.h"
+#include "OgreRoot.h"
+#include "OgreGLRenderSystem.h"
+#include "OgreImageCodec.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreGLXUtils.h"
+#include "OgreWindowEventUtilities.h"
+
+#include <iostream>
+#include <algorithm>
+#include <sys/time.h>
+#include <climits>
+
+#include <X11/Xlib.h>
+#include <X11/keysym.h>
+
+#ifndef NO_XRANDR
+#include <X11/extensions/Xrandr.h>
+#endif
+
+#include <GL/gl.h>
+#include <GL/glu.h>
+#include <GL/glx.h>
+
+
+namespace Ogre
+{
+
+//-------------------------------------------------------------------------------------------------//
+GLXWindow::GLXWindow(Display *display) :
+	mDisplay(display), mWindow(0), mGlxContext(0), mVisualInfo(0), mDelVisualInfo(false), 
+	mDelWindow(false), mClosed(false), mVisible(true), mOldMode(-1),
+	mContext(0)
+{
+	mActive = false;
+	mIsFullScreen = false;
+}
+
+//-------------------------------------------------------------------------------------------------//
+GLXWindow::~GLXWindow() 
+{
+	if (mDelVisualInfo && mVisualInfo)
+		XFree(mVisualInfo);
+
+	if(mGlxContext)
+		glXDestroyContext(mDisplay, mGlxContext);
+	
+	if(mDelWindow && mWindow)
+		XDestroyWindow(mDisplay, mWindow);
+
+#ifndef NO_XRANDR
+	if(mIsFullScreen) 
+	{
+		// Restore original video mode.
+		Window rootWindow = DefaultRootWindow(mDisplay);
+		XRRScreenConfiguration *config;
+
+		// Get current screen info
+		config = XRRGetScreenInfo(mDisplay, rootWindow);
+		if(config) 
+		{
+			Rotation current_rotation;
+			XRRConfigCurrentConfiguration (config, &current_rotation);
+			//std::cerr << "Restore mode " << mOldMode << std::endl;
+			LogManager::getSingleton().logMessage("GLXWindow::~GLXWindow -- Leaving full screen mode");
+			XRRSetScreenConfig(mDisplay, config, rootWindow, mOldMode, current_rotation, CurrentTime);
+			XRRFreeScreenConfigInfo(config);
+		} 
+		else 
+		{
+			LogManager::getSingleton().logMessage("GLXWindow::~GLXWindow -- Could not switch from full screen mode: XRRGetScreenInfo failed");
+		}
+	}
+#endif
+}
+
+//-------------------------------------------------------------------------------------------------//
+void GLXWindow::create(const String& name, unsigned int width, unsigned int height,
+	            bool fullScreen, const NameValuePairList *miscParams)
+{
+	LogManager::getSingleton().logMessage("GLXWindow::create");
+
+	String title = name;
+	size_t fsaa_samples = 0;
+
+	// We will attempt to create new window on default screen op display 0
+	// unless external window handle passed below
+	int screen = DefaultScreen(mDisplay);
+	int depth = DisplayPlanes(mDisplay, screen);
+	Window rootWindow = RootWindow(mDisplay,screen);
+	Window parentWindow = rootWindow;
+
+	// Make sure the window is centered if no left and top in parameters
+	size_t left = (int)DisplayWidth(mDisplay, screen)/2 - width/2;
+	size_t top = (int)DisplayHeight(mDisplay, screen)/2 - height/2;
+	
+	// Maybe user already created the window and passed its visualinfo in miscParams
+	XVisualInfo *	extVisualHandler = NULL;
+
+        // Unless parentWindowHandle is given in miscParams we're top-level
+	mTopLevel = true;
+   
+	LogManager::getSingleton().logMessage("Parsing miscParams");
+	if(miscParams)
+	{
+		// Parse miscellenous parameters
+		NameValuePairList::const_iterator opt;
+		// Full screen anti aliasing
+		opt = miscParams->find("FSAA");
+		if(opt != miscParams->end()) //check for FSAA parameter, if not ignore it...
+			fsaa_samples = StringConverter::parseUnsignedInt(opt->second);
+		// left (x)
+		opt = miscParams->find("left");
+		if(opt != miscParams->end())
+			left = StringConverter::parseUnsignedInt(opt->second);
+		// top (y)
+		opt = miscParams->find("top");
+		if(opt != miscParams->end())
+			top = StringConverter::parseUnsignedInt(opt->second);
+		// Window title
+		opt = miscParams->find("title");
+		if(opt != miscParams->end()) //check for FSAA parameter, if not ignore it...
+			title = opt->second;
+		opt = miscParams->find("parentWindowHandle");
+		if(opt != miscParams->end()) {  // embedding OGRE
+			std::vector<String> tokens = StringUtil::split(opt->second, " :");
+			String new_display = tokens[0];
+			String new_screen = tokens[1];
+			String wid = tokens[2];
+
+			// Now set things to their correct values
+			// This must be the ugliest line of code I have ever written :P
+			mDisplay = reinterpret_cast<Display*>(StringConverter::parseUnsignedLong(new_display));
+			screen = StringConverter::parseUnsignedInt(new_screen);
+			parentWindow = StringConverter::parseUnsignedLong(wid);
+
+			depth = DisplayPlanes(mDisplay, screen);
+			rootWindow = RootWindow(mDisplay, screen);
+
+			left = top = 0;
+			fullScreen = false; // Can't be full screen if embedded in an app!
+		}
+		
+		opt = miscParams->find("externalWindowHandle");
+		if(opt != miscParams->end()) // embedding OGRE in already created window
+		{
+			std::vector<String> tokens = StringUtil::split(opt->second, " :");
+			String new_display = tokens[0];
+			String new_screen = tokens[1];
+			String wid = tokens[2];
+			
+			mDisplay = reinterpret_cast<Display*>(StringConverter::parseUnsignedLong(new_display)); 
+			screen = StringConverter::parseUnsignedInt(new_screen); 
+			mWindow = StringConverter::parseUnsignedLong(wid);
+			
+			if(tokens.size() > 3) // external visual was already setup
+			{
+				extVisualHandler = reinterpret_cast<XVisualInfo*>(StringConverter::parseUnsignedLong(tokens[3]));
+			}
+			
+			depth = DisplayPlanes(mDisplay, screen);
+			rootWindow = RootWindow(mDisplay, screen);
+			
+			left = top = 0;
+			fullScreen = false; // Can't be full screen if embedded in an app!
+			mTopLevel = false;  // Can't be top-level if embedded         
+		}
+
+	}
+
+	// Check for full screen mode if FSAA was asked for
+	if(!fullScreen && fsaa_samples>0)
+	{
+		LogManager::getSingleton().logMessage("GLXWindow::create -- FSAA only supported in fullscreen mode");
+		fsaa_samples = 0;
+	}
+	// Disable FSAA for now -- it doesn't work on NVIDIA
+	fsaa_samples = 0;
+
+#ifndef NO_XRANDR
+	// Attempt mode switch for fullscreen -- only if RANDR extension is there
+	int dummy;
+	if(fullScreen && ! XQueryExtension(mDisplay, "RANDR", &dummy, &dummy, &dummy)) 
+	{
+		LogManager::getSingleton().logMessage("GLXWindow::create -- Could not switch to full screen mode: No XRANDR extension found");
+	} 
+	else if(fullScreen) 
+	{
+		// Use Xrandr extension to switch video modes. This is much better than
+		// XVidMode as you can't scroll away from the full-screen applications.
+		XRRScreenConfiguration *config;
+		XRRScreenSize *sizes;
+		Rotation current_rotation;
+		int nsizes;
+
+		// Get current screen info
+		config = XRRGetScreenInfo(mDisplay, rootWindow);
+		// Get available sizes
+		if(config)
+			sizes = XRRConfigSizes (config, &nsizes);
+
+		if(config && nsizes > 0) {
+			// Get current size and rotation
+			mOldMode = XRRConfigCurrentConfiguration (config, &current_rotation);
+			// Find smallest matching mode
+			int mode = -1;
+			int mode_width = INT_MAX;
+			int mode_height = INT_MAX;
+			for(size_t i=0; i<nsizes; i++) 
+			{
+				if(sizes[i].width >= static_cast<int>(width) && 
+					sizes[i].height >= static_cast<int>(height) &&
+				    sizes[i].width < mode_width && 
+					sizes[i].height < mode_height) 
+				{
+					mode = i;
+					mode_width = sizes[i].width;
+					mode_height = sizes[i].height;
+				}
+			}
+			if(mode >= 0) {
+				// Finally, set the screen configuration
+				LogManager::getSingleton().logMessage("GLXWindow::create -- Entering full screen mode");
+				XRRSetScreenConfig(mDisplay, config, rootWindow, mode, current_rotation, CurrentTime);
+			} else {
+				LogManager::getSingleton().logMessage("GLXWindow::create -- Could not switch to full screen mode: No conforming mode was found");
+			}
+			// Free configuration data
+			XRRFreeScreenConfigInfo(config);
+		} else {
+			LogManager::getSingleton().logMessage("GLXWindow::create -- Could not switch to full screen mode: XRRGetScreenInfo failed");
+		}
+	}
+#endif
+
+	if(extVisualHandler == NULL) // user didn't create visual ( and window ) himself 
+	{
+		// Apply some magic algorithm to get the best visual
+		int best_visual = GLXUtils::findBestVisual(mDisplay, screen, fsaa_samples);
+		if(best_visual == -1)
+		{
+			best_visual = GLXUtils::findBestVisual(mDisplay, screen);
+			LogManager::getSingleton().logMessage("GLXWindow::create -- Requested FSAA of "+
+					StringConverter::toString(fsaa_samples)+" was not acquirable, defaulting to first suitable visual");
+		}
+		LogManager::getSingleton().logMessage("GLXWindow::create -- Best visual is "+StringConverter::toString(best_visual));
+
+		// Get information about this so-called-best visual
+		XVisualInfo templ;
+		int nmatch;
+		templ.visualid = best_visual;
+		mVisualInfo = XGetVisualInfo(mDisplay, VisualIDMask, &templ, &nmatch);
+		mDelVisualInfo = true;
+		if(mVisualInfo==0 || nmatch==0) {
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "GLXWindow: error choosing visual", "GLXWindow::create");
+		}
+
+		XSetWindowAttributes attr;
+		unsigned long mask;
+		attr.background_pixel = 0;
+		attr.border_pixel = 0;
+		attr.colormap = XCreateColormap(mDisplay,rootWindow,mVisualInfo->visual,AllocNone);
+		attr.event_mask = StructureNotifyMask | VisibilityChangeMask;
+		if(fullScreen) {
+			mask = CWBackPixel | CWColormap | CWOverrideRedirect | CWSaveUnder | CWBackingStore | CWEventMask;
+			attr.override_redirect = True;
+			attr.backing_store = NotUseful;
+			attr.save_under = False;
+			// Fullscreen windows are always in the top left origin
+			left = top = 0;
+		} else
+			mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
+	
+		// Create window on server
+		mWindow = XCreateWindow(mDisplay,parentWindow,left,top,width,height,0,mVisualInfo->depth,InputOutput,mVisualInfo->visual,mask,&attr);
+		mDelWindow = true;
+		if(!mWindow) {
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "GLXWindow: XCreateWindow failed", "GLXWindow::create");
+		}
+	
+		// Make sure the window is in normal state
+		XWMHints *wm_hints;
+		if ((wm_hints = XAllocWMHints()) != NULL) {
+			wm_hints->initial_state = NormalState;
+			wm_hints->input = True;
+			wm_hints->flags = StateHint | InputHint;
+	
+			// Check if we can give it an icon
+			if(depth == 24 || depth == 32) {
+				// Woot! The right bit depth, we can load an icon
+				if(GLXUtils::LoadIcon(mDisplay, rootWindow, "GLX_icon.png", &wm_hints->icon_pixmap, &wm_hints->icon_mask))
+					wm_hints->flags |= IconPixmapHint | IconMaskHint;
+			}
+		}
+	
+		// Set size and location hints
+		XSizeHints *size_hints;
+		if ((size_hints = XAllocSizeHints()) != NULL) {
+			// Otherwise some window managers ignore our position request
+			size_hints->flags = USPosition;
+		}
+	
+		// Make text property from title
+		XTextProperty titleprop;
+		char *lst = (char*)title.c_str();
+		XStringListToTextProperty((char **)&lst, 1, &titleprop);
+	
+		XSetWMProperties(mDisplay, mWindow, &titleprop, NULL, NULL, 0, size_hints, wm_hints, NULL);
+	
+		// We don't like memory leaks. Free the clientside storage, but not the
+		// pixmaps as they're still being used by the server.
+		XFree(titleprop.value);
+		XFree(wm_hints);
+		XFree(size_hints);
+	
+		// Acquire atom to recognize window close events
+		mAtomDeleteWindow = XInternAtom(mDisplay,"WM_DELETE_WINDOW",False);
+		XSetWMProtocols(mDisplay,mWindow,&mAtomDeleteWindow,1);
+	
+		// Map window unto screen and focus it.
+		XMapWindow(mDisplay,mWindow);
+	
+		// Make sure the server is up to date and focus the window
+		XFlush(mDisplay);
+
+		//Register only Ogre created windows (users can register their own)
+		WindowEventUtilities::_addRenderWindow(this);
+	}
+	else
+	{
+		LogManager::getSingleton().logMessage("GLXWindow::create -- using external window handle");
+		mVisualInfo = extVisualHandler;
+		mDelVisualInfo = false;
+	}
+
+	GLRenderSystem *rs = static_cast<GLRenderSystem*>(Root::getSingleton().getRenderSystem());
+	GLXContext* mainContext = static_cast<GLXContext*>( rs->_getMainContext() );
+	if ( mainContext == 0 )
+	{
+		// Finally, create a GL context
+		// we want to share it with main
+		mGlxContext = glXCreateContext(mDisplay,mVisualInfo,NULL,True);
+	}
+		else
+			mGlxContext = glXCreateContext(mDisplay,mVisualInfo,mainContext->mCtx,True);
+	
+	if(!mGlxContext)
+		OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "glXCreateContext failed", "GLXWindow::create");
+
+	mName = name;
+	mWidth = width;
+	mHeight = height;
+	mIsFullScreen = fullScreen;
+
+	//Get the attributes of the screen
+	XWindowAttributes temp;
+	XGetWindowAttributes(mDisplay, mWindow, &temp);
+	mLeft = temp.x;
+	mTop = temp.y;
+
+	// Create OGRE GL context
+	mContext = new GLXContext(mDisplay, mWindow, mGlxContext, mVisualInfo);
+}
+
+//-------------------------------------------------------------------------------------------------//
+void GLXWindow::destroy(void)
+{
+	WindowEventUtilities::_removeRenderWindow(this);
+
+	// Unregister and destroy OGRE GLContext
+	delete mContext;
+
+	// Destroy GL context
+	if(mGlxContext)
+		glXDestroyContext(mDisplay, mGlxContext);
+
+	if(mDelWindow && mWindow)
+		XDestroyWindow(mDisplay, mWindow);
+
+	mContext = 0;
+	mWindow = 0;
+	mGlxContext = 0;
+	mActive = false;
+	mVisible = false;
+	mClosed = true;
+
+	Root::getSingleton().getRenderSystem()->detachRenderTarget( this->getName() );
+}
+
+//-------------------------------------------------------------------------------------------------//
+bool GLXWindow::isActive() const
+{
+	return mActive;
+}
+
+//-------------------------------------------------------------------------------------------------//
+bool GLXWindow::isClosed() const
+{
+	return mClosed;
+}
+
+//-------------------------------------------------------------------------------------------------//
+bool GLXWindow::isVisible() const
+{
+	return mVisible;
+}
+
+//-------------------------------------------------------------------------------------------------//
+void GLXWindow::setVisible(bool visible)
+{
+	mVisible = visible;
+}
+
+//-------------------------------------------------------------------------------------------------//
+void GLXWindow::reposition(int left, int top)
+{
+	XMoveWindow(mDisplay,mWindow,left,top);
+}
+
+//-------------------------------------------------------------------------------------------------//
+void GLXWindow::resize(unsigned int width, unsigned int height)
+{
+	// Check if the window size really changed
+	if(mWidth == width && mHeight == height)
+		return;
+
+	mWidth = width;
+	mHeight = height;
+
+	if (!mTopLevel)
+	{
+		for (ViewportList::iterator it = mViewportList.begin();	it != mViewportList.end(); ++it)
+			(*it).second->_updateDimensions();
+	}
+	else
+	{
+		XResizeWindow(mDisplay, mWindow, width, height); /// Ogre handles window
+	}
+}
+
+//-------------------------------------------------------------------------------------------------//
+void GLXWindow::windowMovedOrResized()
+{
+	//Get the new attributes of the screen
+	XWindowAttributes temp;
+	XGetWindowAttributes(mDisplay, mWindow, &temp);
+	mLeft = temp.x;
+	mTop  = temp.y;
+
+	//Only update viewport dimensions if they did actually change
+	if (static_cast<int>(mWidth) == temp.width && static_cast<int>(mHeight) == temp.height)
+		return;
+
+	mWidth = temp.width;
+	mHeight = temp.height;
+
+	// Notify viewports of resize
+	ViewportList::iterator it, itend;
+	itend = mViewportList.end();
+	for( it = mViewportList.begin(); it != itend; ++it )
+		(*it).second->_updateDimensions();
+}
+
+//-------------------------------------------------------------------------------------------------//
+void GLXWindow::swapBuffers(bool waitForVSync)
+{
+	glXSwapBuffers(mDisplay,mWindow);
+}
+
+//-------------------------------------------------------------------------------------------------//
+void GLXWindow::getCustomAttribute( const String& name, void* pData )
+{
+	if( name == "DISPLAY" ) 
+	{
+		*static_cast<Display**>(pData) = mDisplay;
+		return;
+	}
+	else if( name == "ATOM" ) 
+	{
+		*static_cast< ::Atom* >(pData) = mAtomDeleteWindow;
+		return;
+	} 
+	else if( name == "WINDOW" ) 
+	{
+		*static_cast<Window*>(pData) = mWindow;
+		return;
+	} 
+	else if( name == "GLCONTEXT" ) 
+	{
+		*static_cast<GLXContext**>(pData) = mContext;
+		return;
+	} 
+}
+
+//-------------------------------------------------------------------------------------------------//
+void GLXWindow::writeContentsToFile(const String& filename)
+{
+	ImageCodec::ImageData* imgData = new ImageCodec::ImageData;
+	imgData->width = mWidth;
+	imgData->height = mHeight;
+	imgData->format = PF_BYTE_RGB;
+
+	// Allocate buffer
+	uchar* pBuffer = new uchar[mWidth * mHeight * 3];
+
+	// Read pixels
+	// I love GL: it does all the locking & colour conversion for us
+	glReadPixels(0,0, mWidth, mHeight, GL_RGB, GL_UNSIGNED_BYTE, pBuffer);
+
+	// Wrap buffer in a memory stream
+	DataStreamPtr stream(new MemoryDataStream(pBuffer, mWidth * mHeight * 3, false));
+
+	// Need to flip the read data over in Y though
+	Image img;
+	img.loadRawData(stream, mWidth, mHeight, PF_BYTE_RGB );
+	img.flipAroundX();
+
+	MemoryDataStreamPtr streamFlipped(new MemoryDataStream(img.getData(), stream->size(), false));
+
+	// Get codec
+	size_t pos = filename.find_last_of(".");
+	String extension;
+	if( pos == String::npos )
+		OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, "Unable to determine image type for '" 
+			+ filename + "' - invalid extension.", "SDLWindow::writeContentsToFile" );
+
+	while( pos != filename.length() - 1 )
+		extension += filename[++pos];
+
+	// Get the codec
+	Codec * pCodec = Codec::getCodec(extension);
+
+	// Write out
+	Codec::CodecDataPtr codecDataPtr(imgData);
+	pCodec->codeToFile(streamFlipped, filename, codecDataPtr);
+
+	delete [] pBuffer;
+}
+}
Index: /RenderSystems/GL/src/Makefile.am
===================================================================
--- /RenderSystems/GL/src/Makefile.am	(revision 5)
+++ /RenderSystems/GL/src/Makefile.am	(revision 5)
@@ -0,0 +1,44 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/RenderSystems/GL/include \
+           -I$(top_srcdir)/OgreMain/include $(GLSUPPORT_CFLAGS) \
+           -I$(top_srcdir)/RenderSystems/GL/src/$(OGRE_GLSUPPORT) \
+           -I$(top_srcdir)/RenderSystems/GL/src/nvparse \
+           -I$(top_srcdir)/RenderSystems/GL/src/atifs/include \
+           -I$(top_srcdir)/RenderSystems/GL/src/GLSL/include \
+           $(CFLAGS_VISIBILITY)
+
+DIST_SUBDIRS = win32 GLX
+SUBDIRS = $(OGRE_GLSUPPORT) nvparse atifs GLSL
+
+pkglib_LTLIBRARIES = RenderSystem_GL.la
+
+RenderSystem_GL_la_SOURCES = OgreGLEngineDll.cpp \
+                             OgreGLPlugin.cpp \
+                             OgreGLGpuProgram.cpp \
+                             OgreGLGpuNvparseProgram.cpp \
+                             OgreGLGpuProgramManager.cpp \
+                             OgreGLRenderSystem.cpp \
+                             OgreGLSupport.cpp \
+                             OgreGLTexture.cpp \
+                             OgreGLTextureManager.cpp \
+                             OgreGLHardwareBufferManager.cpp \
+                             OgreGLHardwareIndexBuffer.cpp \
+                             OgreGLHardwareOcclusionQuery.cpp \
+                             OgreGLHardwareVertexBuffer.cpp \
+                             OgreGLHardwarePixelBuffer.cpp \
+                             OgreGLDefaultHardwareBufferManager.cpp \
+                             OgreGLContext.cpp \
+                             OgreGLPixelFormat.cpp \
+                             OgreGLRenderTexture.cpp \
+                             OgreGLFBORenderTexture.cpp \
+                             OgreGLPBRenderTexture.cpp \
+                             OgreGLFBOMultiRenderTarget.cpp \
+                             OgreGLFrameBufferObject.cpp \
+                             glew.cpp
+
+RenderSystem_GL_la_LDFLAGS = -module $(PLUGIN_FLAGS) -L$(top_builddir)/OgreMain/src -Wl,-z,defs
+RenderSystem_GL_la_LIBADD = \
+    $(top_builddir)/RenderSystems/GL/src/$(OGRE_GLSUPPORT)/libsupport.la \
+    $(top_builddir)/RenderSystems/GL/src/GLSL/src/libGLSL.la \
+    $(top_builddir)/RenderSystems/GL/src/nvparse/libnvparse.la \
+    $(top_builddir)/RenderSystems/GL/src/atifs/src/libatifs.la \
+    $(GL_LIBS) $(GLSUPPORT_LIBS) -lOgreMain $(OGRE_THREAD_LIBS)
Index: /RenderSystems/GL/src/Makefile.in
===================================================================
--- /RenderSystems/GL/src/Makefile.in	(revision 5)
+++ /RenderSystems/GL/src/Makefile.in	(revision 5)
@@ -0,0 +1,716 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = RenderSystems/GL/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+pkglibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+RenderSystem_GL_la_DEPENDENCIES = $(top_builddir)/RenderSystems/GL/src/$(OGRE_GLSUPPORT)/libsupport.la \
+	$(top_builddir)/RenderSystems/GL/src/GLSL/src/libGLSL.la \
+	$(top_builddir)/RenderSystems/GL/src/nvparse/libnvparse.la \
+	$(top_builddir)/RenderSystems/GL/src/atifs/src/libatifs.la \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
+am_RenderSystem_GL_la_OBJECTS = OgreGLEngineDll.lo OgreGLPlugin.lo \
+	OgreGLGpuProgram.lo OgreGLGpuNvparseProgram.lo \
+	OgreGLGpuProgramManager.lo OgreGLRenderSystem.lo \
+	OgreGLSupport.lo OgreGLTexture.lo OgreGLTextureManager.lo \
+	OgreGLHardwareBufferManager.lo OgreGLHardwareIndexBuffer.lo \
+	OgreGLHardwareOcclusionQuery.lo OgreGLHardwareVertexBuffer.lo \
+	OgreGLHardwarePixelBuffer.lo \
+	OgreGLDefaultHardwareBufferManager.lo OgreGLContext.lo \
+	OgreGLPixelFormat.lo OgreGLRenderTexture.lo \
+	OgreGLFBORenderTexture.lo OgreGLPBRenderTexture.lo \
+	OgreGLFBOMultiRenderTarget.lo OgreGLFrameBufferObject.lo \
+	glew.lo
+RenderSystem_GL_la_OBJECTS = $(am_RenderSystem_GL_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(RenderSystem_GL_la_SOURCES)
+DIST_SOURCES = $(RenderSystem_GL_la_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/RenderSystems/GL/include \
+           -I$(top_srcdir)/OgreMain/include $(GLSUPPORT_CFLAGS) \
+           -I$(top_srcdir)/RenderSystems/GL/src/$(OGRE_GLSUPPORT) \
+           -I$(top_srcdir)/RenderSystems/GL/src/nvparse \
+           -I$(top_srcdir)/RenderSystems/GL/src/atifs/include \
+           -I$(top_srcdir)/RenderSystems/GL/src/GLSL/include \
+           $(CFLAGS_VISIBILITY)
+
+DIST_SUBDIRS = win32 GLX
+SUBDIRS = $(OGRE_GLSUPPORT) nvparse atifs GLSL
+pkglib_LTLIBRARIES = RenderSystem_GL.la
+RenderSystem_GL_la_SOURCES = OgreGLEngineDll.cpp \
+                             OgreGLPlugin.cpp \
+                             OgreGLGpuProgram.cpp \
+                             OgreGLGpuNvparseProgram.cpp \
+                             OgreGLGpuProgramManager.cpp \
+                             OgreGLRenderSystem.cpp \
+                             OgreGLSupport.cpp \
+                             OgreGLTexture.cpp \
+                             OgreGLTextureManager.cpp \
+                             OgreGLHardwareBufferManager.cpp \
+                             OgreGLHardwareIndexBuffer.cpp \
+                             OgreGLHardwareOcclusionQuery.cpp \
+                             OgreGLHardwareVertexBuffer.cpp \
+                             OgreGLHardwarePixelBuffer.cpp \
+                             OgreGLDefaultHardwareBufferManager.cpp \
+                             OgreGLContext.cpp \
+                             OgreGLPixelFormat.cpp \
+                             OgreGLRenderTexture.cpp \
+                             OgreGLFBORenderTexture.cpp \
+                             OgreGLPBRenderTexture.cpp \
+                             OgreGLFBOMultiRenderTarget.cpp \
+                             OgreGLFrameBufferObject.cpp \
+                             glew.cpp
+
+RenderSystem_GL_la_LDFLAGS = -module $(PLUGIN_FLAGS) -L$(top_builddir)/OgreMain/src -Wl,-z,defs
+RenderSystem_GL_la_LIBADD = \
+    $(top_builddir)/RenderSystems/GL/src/$(OGRE_GLSUPPORT)/libsupport.la \
+    $(top_builddir)/RenderSystems/GL/src/GLSL/src/libGLSL.la \
+    $(top_builddir)/RenderSystems/GL/src/nvparse/libnvparse.la \
+    $(top_builddir)/RenderSystems/GL/src/atifs/src/libatifs.la \
+    $(GL_LIBS) $(GLSUPPORT_LIBS) -lOgreMain $(OGRE_THREAD_LIBS)
+
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  RenderSystems/GL/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  RenderSystems/GL/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)"
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    f=$(am__strip_dir) \
+	    echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	    $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  p=$(am__strip_dir) \
+	  echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \
+	  $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+RenderSystem_GL.la: $(RenderSystem_GL_la_OBJECTS) $(RenderSystem_GL_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(RenderSystem_GL_la_LDFLAGS) $(RenderSystem_GL_la_OBJECTS) $(RenderSystem_GL_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLContext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLDefaultHardwareBufferManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLEngineDll.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLFBOMultiRenderTarget.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLFBORenderTexture.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLFrameBufferObject.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLGpuNvparseProgram.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLGpuProgram.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLGpuProgramManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLHardwareBufferManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLHardwareIndexBuffer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLHardwareOcclusionQuery.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLHardwarePixelBuffer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLHardwareVertexBuffer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLPBRenderTexture.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLPixelFormat.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLPlugin.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLRenderSystem.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLRenderTexture.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLSupport.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLTexture.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreGLTextureManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glew.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	clean-recursive ctags ctags-recursive distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-pkglibLTLIBRARIES \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	maintainer-clean-recursive mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
+	pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+	uninstall-info-am uninstall-pkglibLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /RenderSystems/GL/src/OSX/OgreGLUtil.h
===================================================================
--- /RenderSystems/GL/src/OSX/OgreGLUtil.h	(revision 5)
+++ /RenderSystems/GL/src/OSX/OgreGLUtil.h	(revision 5)
@@ -0,0 +1,40 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://ogre.sourgeforge.net/
+
+Copyright © 2000-2003 Steven J. Streeting
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/gpl.html.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef INCL_OGRE_GLUTIL_H
+#define INCL_OGRE_GLUTIL_H
+
+#include "OgreOSXGLSupport.h"
+
+namespace Ogre {
+    
+inline GLSupport* getGLSupport()
+{
+    return new OSXGLSupport();
+}
+
+};
+
+#endif // INCL_OGRE_GLUTIL_H
Index: /RenderSystems/GL/src/OSX/OgreOSXCGLContext.cpp
===================================================================
--- /RenderSystems/GL/src/OSX/OgreOSXCGLContext.cpp	(revision 5)
+++ /RenderSystems/GL/src/OSX/OgreOSXCGLContext.cpp	(revision 5)
@@ -0,0 +1,71 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreOSXCGLContext.h"
+#include "OgreLogManager.h"
+
+namespace Ogre
+{
+	
+	OSXCGLContext::OSXCGLContext(CGLContextObj cglContext): mCGLContext(cglContext)
+	{
+	}
+    
+	OSXCGLContext::~OSXCGLContext()
+	{
+    }
+
+    void OSXCGLContext::setCurrent()
+	{
+		CGLSetCurrentContext(mCGLContext);
+    }
+		
+	void OSXCGLContext::endCurrent()
+	{
+		CGLClearDrawable(mCGLContext); 
+		CGLDestroyContext(mCGLContext);
+	}
+	
+	GLContext* OSXCGLContext::clone() const
+	{
+		CGLContextObj cglCtxCopy;
+		CGLCopyContext(mCGLContext, cglCtxCopy, NULL);
+		return new OSXCGLContext(cglCtxCopy);
+	}
+	
+	String OSXCGLContext::getContextType()
+	{
+		return "CGL";
+	}
+		
+	CGLContextObj OSXCGLContext::getContext()
+	{
+		return mCGLContext;
+	}
+}
Index: /RenderSystems/GL/src/OSX/OgreOSXCarbonContext.cpp
===================================================================
--- /RenderSystems/GL/src/OSX/OgreOSXCarbonContext.cpp	(revision 5)
+++ /RenderSystems/GL/src/OSX/OgreOSXCarbonContext.cpp	(revision 5)
@@ -0,0 +1,72 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreOSXCarbonContext.h"
+
+namespace Ogre
+{
+
+    OSXCarbonContext::OSXCarbonContext(AGLContext aglContext): mAGLContext(aglContext)
+	{
+	}
+	
+	OSXCarbonContext::~OSXCarbonContext()
+	{
+    }
+
+    void OSXCarbonContext::setCurrent()
+	{
+		// apple's docs claim that you may need to force the context to null
+		// before setting current, especially when using pBuffers.
+		aglSetCurrentContext(NULL);
+		aglSetCurrentContext(mAGLContext);
+    }
+		
+	void OSXCarbonContext::endCurrent()
+	{
+		aglDestroyContext(mAGLContext);
+	}
+	
+	GLContext* OSXCarbonContext::clone() const
+	{
+		AGLContext aglCtxCopy;
+		aglCopyContext(mAGLContext, aglCtxCopy, NULL);
+		return new OSXCarbonContext(aglCtxCopy);
+	}
+	
+	String OSXCarbonContext::getContextType()
+	{
+		return "AGL";
+	}
+	
+	AGLContext OSXCarbonContext::getContext()
+	{
+		return mAGLContext;
+	}	
+}
Index: /RenderSystems/GL/src/OSX/OgreOSXCarbonWindow.cpp
===================================================================
--- /RenderSystems/GL/src/OSX/OgreOSXCarbonWindow.cpp	(revision 5)
+++ /RenderSystems/GL/src/OSX/OgreOSXCarbonWindow.cpp	(revision 5)
@@ -0,0 +1,431 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreOSXCarbonWindow.h"
+#include "OgreRoot.h"
+#include "OgreGLRenderSystem.h"
+#include "OgreImageCodec.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreWindowEventUtilities.h"
+
+#include <OpenGL/gl.h>
+#define GL_EXT_texture_env_combine 1
+#include <OpenGL/glext.h>
+#include <OpenGL/glu.h>
+#include <AGL/agl.h>
+
+namespace Ogre
+{
+
+//-------------------------------------------------------------------------------------------------//
+OSXCarbonWindow::OSXCarbonWindow()
+{
+	mActive = mClosed = mHasResized = mIsFullScreen = false;
+	mAGLContext = NULL;
+	mContext = NULL;
+	mWindow = NULL;
+	mView = NULL;
+}
+
+//-------------------------------------------------------------------------------------------------//
+OSXCarbonWindow::~OSXCarbonWindow()
+{
+}
+
+//-------------------------------------------------------------------------------------------------//
+void OSXCarbonWindow::create( const String& name, unsigned int width, unsigned int height,
+	            bool fullScreen, const NameValuePairList *miscParams )
+{
+	bool hasDepthBuffer;
+	String title = name;
+	size_t fsaa_samples = 0;
+	int left = 0;
+	int top = 0;
+	int depth = 32;
+	
+	if( miscParams )
+	{
+		
+		NameValuePairList::const_iterator opt = NULL;
+		
+		// Full screen anti aliasing
+		opt = miscParams->find( "FSAA" );
+		if( opt != miscParams->end() )
+			fsaa_samples = StringConverter::parseUnsignedInt( opt->second );
+
+		opt = miscParams->find( "left" );
+		if( opt != miscParams->end() )
+			left = StringConverter::parseUnsignedInt( opt->second );
+
+		opt = miscParams->find( "top" );
+		if( opt != miscParams->end() )
+			top = StringConverter::parseUnsignedInt( opt->second );
+
+		opt = miscParams->find( "title" );
+		if( opt != miscParams->end() )
+			title = opt->second;
+
+		opt = miscParams->find( "depthBuffer" );
+		if( opt != miscParams->end() )
+			hasDepthBuffer = StringConverter::parseBool( opt->second );
+		
+		opt = miscParams->find( "colourDepth" );
+		if( opt != miscParams->end() )
+			depth = StringConverter::parseUnsignedInt( opt->second );
+	}
+	
+	if(fullScreen)
+	{
+		GLRenderSystem *rs = static_cast<GLRenderSystem*>(Root::getSingleton().getRenderSystem());
+		OSXContext *mainContext = (OSXContext*)rs->_getMainContext();
+		
+		CGLContextObj share = NULL;
+		if(mainContext == 0)
+		{
+			share = NULL;
+		}
+		else if(mainContext->getContextType() == "AGL")
+		{
+			OSXCarbonContext* aglShare = static_cast<OSXCarbonContext*>(mainContext);
+			aglGetCGLContext(aglShare->getContext(), &((void*)share));
+		}
+		else if(mainContext->getContextType() == "CGL")
+		{
+			OSXCGLContext* cglShare = static_cast<OSXCGLContext*>(mainContext);
+			share = cglShare->getContext();
+		}
+		
+		// create the context
+		createCGLFullscreen(width, height, depth, fsaa_samples, share);		
+	}
+	else
+	{
+		int i = 0;
+		AGLPixelFormat pixelFormat;
+		GLint attribs[ 20 ];
+		
+		attribs[ i++ ] = AGL_NO_RECOVERY;
+		attribs[ i++ ] = GL_TRUE;
+		attribs[ i++ ] = AGL_ACCELERATED;
+		attribs[ i++ ] = GL_TRUE;
+		attribs[ i++ ] = AGL_RGBA;
+		attribs[ i++ ] = AGL_DOUBLEBUFFER;
+		attribs[ i++ ] = AGL_ALPHA_SIZE;
+		attribs[ i++ ] = 8;
+		attribs[ i++ ] = AGL_STENCIL_SIZE;
+		attribs[ i++ ] = 8;
+		attribs[ i++ ] = AGL_DEPTH_SIZE;
+		attribs[ i++ ] = depth;
+	
+		if(fsaa_samples > 1)
+		{
+			attribs[ i++ ] = AGL_MULTISAMPLE;
+			attribs[ i++ ] = 1;
+			attribs[ i++ ] = AGL_SAMPLE_BUFFERS_ARB;
+			attribs[ i++ ] = fsaa_samples;
+		}
+	
+		attribs[ i++ ] = AGL_NONE;
+	
+		pixelFormat = aglChoosePixelFormat( NULL, 0, attribs );
+	
+		// Create the AGLContext from our pixel format
+		// Share it with main
+		GLRenderSystem *rs = static_cast<GLRenderSystem*>(Root::getSingleton().getRenderSystem());
+		OSXContext* mainContext = static_cast<OSXContext*>( rs->_getMainContext() );
+		if(mainContext == 0)
+		{
+			mAGLContext = aglCreateContext(pixelFormat, NULL);
+		}
+		else if(mainContext->getContextType() == "AGL")
+		{
+			OSXCarbonContext* context = static_cast<OSXCarbonContext*>( rs->_getMainContext() );
+			AGLContext shared = context->getContext();
+			mAGLContext = aglCreateContext(pixelFormat, context->getContext());
+		}
+		else
+		{
+			// If we do not have an AGL, we can not clone it using this window
+			LogManager::getSingleton().logMessage( "Warning: You asked to create a second window, "
+				"when the previous window was not of this type.  OgreOSXCarbonWindow can only share "
+				"with an AGL context.");
+		}
+		
+		NameValuePairList::const_iterator opt = 0;
+		if(miscParams)
+			opt = miscParams->find("externalWindowHandle");
+		if(!miscParams || opt == miscParams->end())
+		{
+			// create the window rect in global coords
+			::Rect windowRect;
+			windowRect.left = 0;
+			windowRect.top = 0;
+			windowRect.right = width;
+			windowRect.bottom = height;
+			
+			// set the default attributes for the window
+			WindowAttributes windowAttrs = kWindowStandardDocumentAttributes
+				| kWindowStandardHandlerAttribute 
+				| kWindowInWindowMenuAttribute
+				| kWindowHideOnFullScreenAttribute;
+			
+			// Create the window
+			CreateNewWindow(kDocumentWindowClass, windowAttrs, &windowRect, &mWindow);
+			
+			// Color the window background black
+			SetThemeWindowBackground (mWindow, kThemeBrushBlack, true);
+			
+			// Set the title of our window
+			CFStringRef titleRef = CFStringCreateWithCString( kCFAllocatorDefault, title.c_str(), kCFStringEncodingASCII );
+			SetWindowTitleWithCFString( mWindow, titleRef );
+			
+			// Center our window on the screen
+			RepositionWindow( mWindow, NULL, kWindowCenterOnMainScreen );
+			
+			// Install the event handler for the window
+			InstallStandardEventHandler(GetWindowEventTarget(mWindow));
+			
+			// Display and select our window
+			ShowWindow(mWindow);
+			SelectWindow(mWindow);
+		}
+		else
+		{
+			// TODO: The Contol is going to report the incorrect location with a
+			// Metalic / Textured window.  The default windows work just fine.
+			
+			// First get the HIViewRef / ControlRef
+			mView = (HIViewRef)StringConverter::parseUnsignedLong(opt->second);
+			mWindow = GetControlOwner(mView);
+			
+			// Lets try hiding the HIView
+			//HIViewSetVisible(mView, false);
+					
+			// Get the rect bounds
+			::Rect ctrlBounds;
+			GetControlBounds(mView, &ctrlBounds);
+			GLint bufferRect[4];
+
+			bufferRect[0] = ctrlBounds.left;					// left edge
+			bufferRect[1] = ctrlBounds.bottom;					// bottom edge
+			bufferRect[2] =	ctrlBounds.right - ctrlBounds.left; // width of buffer rect
+			bufferRect[3] = ctrlBounds.bottom - ctrlBounds.top; // height of buffer rect
+			aglSetInteger(mAGLContext, AGL_BUFFER_RECT, bufferRect);
+			aglEnable (mAGLContext, AGL_BUFFER_RECT);
+		}
+		
+		// Set the drawable, and current context
+		// If you do this last, there is a moment before the rendering window pops-up
+		// This could go once inside each case above, before the window is displayed,
+		// if desired.
+		aglSetDrawable(mAGLContext, GetWindowPort(mWindow));
+		aglSetCurrentContext(mAGLContext);
+
+		// Give a copy of our context to the render system
+		mContext = new OSXCarbonContext(mAGLContext);
+	}
+	
+	WindowEventUtilities::_addRenderWindow(this);
+	mName = name;
+	mWidth = width;
+	mHeight = height;
+	mActive = true;
+	mIsFullScreen = fullScreen;
+}
+
+//-------------------------------------------------------------------------------------------------//
+void OSXCarbonWindow::destroy(void)
+{
+	LogManager::getSingleton().logMessage( "OSXCarbonWindow::destroy()" );
+	
+	if(mIsFullScreen)
+		destroyCGLFullscreen();
+		
+	WindowEventUtilities::_removeRenderWindow( this );
+
+	if(mWindow)
+		DisposeWindow(mWindow);
+
+	mActive = false;
+
+	Root::getSingleton().getRenderSystem()->detachRenderTarget(this->getName());
+}
+
+//-------------------------------------------------------------------------------------------------//
+bool OSXCarbonWindow::isActive() const
+{
+	return mActive;
+}
+
+//-------------------------------------------------------------------------------------------------//
+bool OSXCarbonWindow::isClosed() const
+{
+	return false;
+}
+
+//-------------------------------------------------------------------------------------------------//
+void OSXCarbonWindow::reposition(int left, int top)
+{
+	//LogManager::getSingleton().logMessage( "OSXCarbonWindow::reposition()" );
+	if(mWindow)
+		MoveWindow(mWindow, left, top, true);
+}
+
+//-------------------------------------------------------------------------------------------------//
+void OSXCarbonWindow::resize(unsigned int width, unsigned int height)
+{
+	//LogManager::getSingleton().logMessage( "OSXCarbonWindow::resize()" );
+	if(!mWindow)
+		return;
+
+	// Check if the window size really changed
+	if(mWidth == width && mHeight == height)
+		return;
+
+	mWidth = width;
+	mHeight = height;
+
+	SizeWindow(mWindow, width, height, true);
+}
+
+//-------------------------------------------------------------------------------------------------//
+void OSXCarbonWindow::windowHasResized()
+{
+	mHasResized = true;
+	
+	// Ensure the context is current
+	if(!mIsFullScreen)
+		aglSwapBuffers(mAGLContext);
+	else
+		swapCGLBuffers();
+}
+
+//-------------------------------------------------------------------------------------------------//
+void OSXCarbonWindow::windowResized()
+{
+	LogManager::getSingleton().logMessage( "OSXCarbonWindow::windowResized()" );
+	
+	// Ensure the context is current
+	if(!mIsFullScreen)
+	{
+		aglUpdateContext(mAGLContext);
+		::Rect rect;
+		GetWindowBounds( mWindow, kWindowContentRgn, &rect );
+		mWidth = rect.left + rect.right;
+		mHeight = rect.top + rect.bottom;
+		mLeft = rect.left;
+		mTop = rect.top;
+	}
+	else
+		swapCGLBuffers();
+	
+	for( ViewportList::iterator it = mViewportList.begin(); it != mViewportList.end(); ++it )
+	{
+		( *it ).second->_updateDimensions();
+	}
+}
+
+//-------------------------------------------------------------------------------------------------//
+void OSXCarbonWindow::windowMovedOrResized()
+{
+	// External windows will call this method.
+	if(mView != NULL)
+	{
+		//update our drawing region
+		::Rect ctrlBounds;
+		GetControlBounds(mView, &ctrlBounds);
+		GLint bufferRect[4];
+
+		bufferRect[0] = ctrlBounds.left; // 0 = left edge
+		bufferRect[1] = ctrlBounds.bottom; // 0 = bottom edge
+		bufferRect[2] =	ctrlBounds.right - ctrlBounds.left; // width of buffer rect
+		bufferRect[3] = ctrlBounds.bottom - ctrlBounds.top; // height of buffer rect
+		aglSetInteger(mAGLContext, AGL_BUFFER_RECT, bufferRect);
+		aglEnable (mAGLContext, AGL_BUFFER_RECT);
+		swapBuffers(true);
+		
+		mWidth = ctrlBounds.right - ctrlBounds.left;
+		mHeight = ctrlBounds.bottom - ctrlBounds.top;
+		mLeft = ctrlBounds.left;
+		mTop = ctrlBounds.top;
+		
+	}
+	
+	for (ViewportList::iterator it = mViewportList.begin(); it != mViewportList.end(); ++it)
+	{
+	(*it).second->_updateDimensions();
+	}
+}
+
+//-------------------------------------------------------------------------------------------------//
+void OSXCarbonWindow::swapBuffers( bool waitForVSync )
+{
+	if(!mIsFullScreen)
+	{
+		if(mAGLContext != aglGetCurrentContext())
+			aglSetCurrentContext(mAGLContext);
+			
+		aglSwapBuffers(mAGLContext);
+	}
+	else
+		swapCGLBuffers();
+		
+	if(mHasResized)
+	{
+		windowResized();
+		mHasResized = false;
+	}
+}
+
+//-------------------------------------------------------------------------------------------------//
+void OSXCarbonWindow::getCustomAttribute( const String& name, void* pData )
+{
+	if( name == "GLCONTEXT" ) 
+	{
+		*static_cast<OSXContext**>(pData) = mContext;
+		return;
+	}
+	else if( name == "WINDOW" )
+	{
+		if(mIsFullScreen)
+		{
+			// A fullscreen application uses CGL and thus has no window.
+			pData = 0;
+			return;
+		}
+		else
+		{
+				*static_cast<WindowRef*>(pData) = mWindow;
+		}
+		return;
+	}
+}
+}
Index: /RenderSystems/GL/src/OSX/OgreOSXCocoaContext.mm
===================================================================
--- /RenderSystems/GL/src/OSX/OgreOSXCocoaContext.mm	(revision 5)
+++ /RenderSystems/GL/src/OSX/OgreOSXCocoaContext.mm	(revision 5)
@@ -0,0 +1,66 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreOSXCocoaContext.h"
+
+namespace Ogre
+{
+
+    OSXCocoaContext::OSXCocoaContext(NSOpenGLContext *context) : mNSGLContext(context)
+	{
+	}
+	    
+	OSXCocoaContext::~OSXCocoaContext()
+	{
+    }
+
+    void OSXCocoaContext::setCurrent()
+	{
+		[mNSGLContext makeCurrentContext];
+    }
+		
+	void OSXCocoaContext::endCurrent()
+	{
+	}
+	
+	GLContext* OSXCocoaContext::clone() const
+	{
+		NSLog(@"ERROR: OgreGLOSXContext doesn't implement clone.");
+	}
+	
+	String OSXCocoaContext::getContextType()
+	{
+		return "NSOpenGL";
+	}
+	
+	NSOpenGLContext* OSXCocoaContext::getContext()
+	{
+		return mNSGLContext;
+    }
+}
Index: /RenderSystems/GL/src/OSX/OgreOSXCocoaWindow.mm
===================================================================
--- /RenderSystems/GL/src/OSX/OgreOSXCocoaWindow.mm	(revision 5)
+++ /RenderSystems/GL/src/OSX/OgreOSXCocoaWindow.mm	(revision 5)
@@ -0,0 +1,345 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2005 The OGRE Team
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreOSXCocoaWindow.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreImageCodec.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+
+#include "OgreGLRenderSystem.h"
+#include "OgreOSXCocoaContext.h"
+#include "OgreOSXCGLContext.h"
+
+#include <OpenGL/gl.h>
+#define GL_EXT_texture_env_combine 1
+#include <OpenGL/glext.h>
+#include <OpenGL/glu.h>
+
+namespace Ogre {
+
+    OSXCocoaWindow::OSXCocoaWindow()
+    {
+		mActive = false;
+		mContext = 0;
+		mWindow = 0;
+    }
+
+    OSXCocoaWindow::~OSXCocoaWindow()
+    {
+		[glContext clearDrawable];
+		CGReleaseAllDisplays();
+        //[mWindow close];
+		//[mWindow release];
+    }
+	
+	void OSXCocoaWindow::create(const String& name, unsigned int width, unsigned int height,
+	            bool fullScreen, const NameValuePairList *miscParams)
+    {
+		NSAutoreleasePool *arp = [[NSAutoreleasePool alloc] init];
+		NSApplicationLoad();
+		//OgreWindowDelegate *delegate = [[OgreWindowDelegate alloc] initWithGLOSXCocoaWindow:this];
+		//[window setDelegate:delegate];
+		/*
+***Key: "title" Description: The title of the window that will appear in the title bar Values: string Default: RenderTarget name
+
+Key: "colourDepth" Description: Colour depth of the resulting rendering window; only applies if fullScreen is set. Values: 16 or 32 Default: desktop depth Notes: [W32 specific]
+
+***Key: "left" Description: screen x coordinate from left Values: positive integers Default: 'center window on screen' Notes: Ignored in case of full screen
+
+***Key: "top" Description: screen y coordinate from top Values: positive integers Default: 'center window on screen' Notes: Ignored in case of full screen
+
+***Key: "depthBuffer" [DX9 specific] Description: Use depth buffer Values: false or true Default: true
+
+***Key: "externalWindowHandle" [API specific] Description: External window handle, for embedding the OGRE context Values: positive integer for W32 (HWND handle) poslong:posint:poslong (display*:screen:windowHandle) or poslong:posint:poslong:poslong (display*:screen:windowHandle:XVisualInfo*) for GLX Default: 0 (None)
+
+***Key: "FSAA" Description: Full screen antialiasing factor Values: 0,2,4,6,... Default: 0
+
+Key: "displayFrequency" Description: Display frequency rate, for fullscreen mode Values: 60...? Default: Desktop vsync rate
+
+Key: "vsync" Description: Synchronize buffer swaps to vsync Values: true, false Default: 0
+*/
+
+		BOOL hasDepthBuffer = YES;
+		int fsaa_samples = 0;
+		NSString *windowTitle = [NSString stringWithCString:name.c_str()];
+		int winx = 0, winy = 0;
+		int depth = 32;
+		
+		if(miscParams)
+		{
+			NameValuePairList::const_iterator opt = 0;
+			
+			opt = miscParams->find("title");
+			if(opt != miscParams->end())
+				windowTitle = [NSString stringWithCString:opt->second.c_str()];
+				
+			opt = miscParams->find("left");
+			if(opt != miscParams->end())
+				winx = StringConverter::parseUnsignedInt(opt->second);
+				
+			opt = miscParams->find("top");
+			if(opt != miscParams->end())
+				winy = NSHeight([[NSScreen mainScreen] frame]) - StringConverter::parseUnsignedInt(opt->second) - height;
+				
+				
+			opt = miscParams->find("depthBuffer");
+			if(opt != miscParams->end())
+				hasDepthBuffer = StringConverter::parseBool(opt->second);
+				
+			opt = miscParams->find("FSAA");
+			if(opt != miscParams->end())
+				fsaa_samples = StringConverter::parseUnsignedInt(opt->second);
+			
+			opt = miscParams->find( "colourDepth" );
+			if( opt != miscParams->end() )
+				depth = StringConverter::parseUnsignedInt( opt->second );
+		}		
+		
+
+		NSOpenGLPixelFormat* openglFormat;
+		{
+			NSOpenGLPixelFormatAttribute attribs[30];
+			int i=0;
+			
+			if(fullScreen)
+			{
+				GLRenderSystem *rs = static_cast<GLRenderSystem*>(Root::getSingleton().getRenderSystem());
+				OSXContext *mainContext = (OSXContext*)rs->_getMainContext();
+		
+				CGLContextObj share = NULL;
+				if(mainContext == 0)
+				{
+					share = NULL;
+				}
+				else if(mainContext->getContextType() == "NSOpenGL")
+				{
+					OSXCocoaContext* cocoaContext = static_cast<OSXCocoaContext*>(mainContext);
+					NSOpenGLContext* nsShare = cocoaContext->getContext();
+					share = (CGLContextObj)[nsShare CGLContextObj];
+				}
+				else if(mainContext->getContextType() == "CGL")
+				{
+					OSXCGLContext* cglShare = static_cast<OSXCGLContext*>(mainContext);
+					share = cglShare->getContext();
+				}
+		
+				// create the context
+				createCGLFullscreen(width, height, depth, fsaa_samples, share);	
+			}
+			else
+			{
+				// Specifying "NoRecovery" gives us a context that cannot fall back to the software renderer.  This makes the View-based context a compatible with the fullscreen context, enabling us to use the "shareContext" feature to share textures, display lists, and other OpenGL objects between the two.
+				attribs[i++] = NSOpenGLPFANoRecovery;
+			
+				attribs[i++] = NSOpenGLPFAAccelerated;
+				attribs[i++] = NSOpenGLPFADoubleBuffer;
+				
+				attribs[i++] = NSOpenGLPFAAlphaSize;
+				attribs[i++] = (NSOpenGLPixelFormatAttribute) 0;
+				
+				attribs[i++] = NSOpenGLPFAStencilSize;
+				attribs[i++] = (NSOpenGLPixelFormatAttribute) 1;
+				
+				attribs[i++] = NSOpenGLPFAAccumSize;
+				attribs[i++] = (NSOpenGLPixelFormatAttribute) 0;
+
+				attribs[i++] = NSOpenGLPFADepthSize;
+				attribs[i++] = (NSOpenGLPixelFormatAttribute) (hasDepthBuffer? 16 : 0);
+				
+				if(fsaa_samples > 0)
+				{
+					attribs[i++] = NSOpenGLPFASampleBuffers;
+					attribs[i++] = (NSOpenGLPixelFormatAttribute) 1;
+					
+					attribs[i++] = NSOpenGLPFASamples;
+					attribs[i++] = (NSOpenGLPixelFormatAttribute) fsaa_samples;
+				}
+				
+				attribs[i++] = (NSOpenGLPixelFormatAttribute) 0;
+
+				openglFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes: attribs] autorelease];
+			}
+			
+			NameValuePairList::const_iterator opt2 = 0;
+			if(miscParams)
+			{
+				opt2 = miscParams->find("pixelFormat");
+				if(opt2 != miscParams->end())
+					openglFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes: (NSOpenGLPixelFormatAttribute*)StringConverter::parseUnsignedLong(opt2->second)] autorelease];
+			}
+			GLRenderSystem *rs = static_cast<GLRenderSystem*>(Root::getSingleton().getRenderSystem());
+			OSXCocoaContext *mainContext = (OSXCocoaContext*)rs->_getMainContext();
+			NSOpenGLContext *shareContext = mainContext == 0? nil : mainContext->getContext();
+
+			glContext = [[NSOpenGLContext alloc] initWithFormat: openglFormat shareContext:shareContext];
+			
+			NameValuePairList::const_iterator opt = 0;
+			if(miscParams)
+				opt = miscParams->find("externalWindowHandle");
+			if(!miscParams || opt == miscParams->end())
+			{
+				//Not sure why this should be but it is required for the window to work at fullscreen.
+				int styleMask = fullScreen? NSBorderlessWindowMask : NSResizableWindowMask;
+			
+				mWindow = [[OgreWindow alloc] initWithContentRect:NSMakeRect(winx, winy, width, height) styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
+				[mWindow setTitle:windowTitle];
+				
+				if(winx == 0 && winy == 0) [mWindow center];
+				
+				mView = [[OgreView alloc] initWithGLOSXWindow:this];
+				[mWindow setContentView:mView];
+			}
+			else
+			{
+				mView = (OgreView*)StringConverter::parseUnsignedLong(opt->second);
+				[mView setOgreWindow:this];
+				
+				NSRect b = [mView bounds];
+				width = b.size.width;
+				height = b.size.height;
+			}
+			
+			[glContext setView:mView];
+
+			mName = name;
+			mWidth = width;
+			mHeight = height;
+			
+			// Create register the context with the rendersystem and associate it with this window
+			mContext = new OSXCocoaContext(glContext);
+			/*rs->_registerContext(this, newContext);
+			
+			if (rs->_getMainContext() == 0)
+				[glContext makeCurrentContext];
+			*/
+			//show window
+			if(mWindow)
+				[mWindow performSelectorOnMainThread:@selector(makeKeyAndOrderFront:) withObject:NULL waitUntilDone:NO];
+				
+			[arp release];
+		}
+		
+		// make active
+		mActive = true;
+    }
+
+    void OSXCocoaWindow::destroy(void)
+    {
+		if(mIsFullScreen)
+			destroyCGLFullscreen();
+		
+		// Unregister and destroy OGRE GLContext
+		delete mContext;
+		
+		if(mWindow) [mWindow close];
+		
+        mActive = false;
+
+        Root::getSingleton().getRenderSystem()->detachRenderTarget( this->getName() );
+    }
+
+	/*OgreView* OSXCocoaWindow::ogreView() const
+	{
+		return [window contentView];
+	}*/
+
+    bool OSXCocoaWindow::isActive() const
+    {
+        return mActive;
+    }
+
+    bool OSXCocoaWindow::isClosed() const
+    {
+        return false;
+    }
+
+    void OSXCocoaWindow::reposition(int left, int top)
+    {
+		if(!mWindow) return;
+		
+		NSRect frame = [mWindow frame];
+		frame.origin.x = left;
+		frame.origin.y = top-frame.size.height;
+		[mWindow setFrame:frame display:YES];
+    }
+
+    void OSXCocoaWindow::resize(unsigned int width, unsigned int height)
+    {
+		if(!mWindow) return;
+		
+		NSRect frame = [mWindow frame];
+		frame.size.width = width;
+		frame.size.height = height;
+		[mWindow setFrame:frame display:YES];
+	/*SHOULD be called from delegate
+        for (ViewportList::iterator it = mViewportList.begin(); it != mViewportList.end(); ++it)
+        {
+            (*it).second->_updateDimensions();
+        }*/
+    }
+
+    void OSXCocoaWindow::windowMovedOrResized()
+    {
+		[glContext update];
+		NSRect frame = [mView frame];
+		mWidth = (unsigned int)frame.size.width;
+		mHeight = (unsigned int)frame.size.height;
+        mLeft = (int)frame.origin.x;
+        mTop = (int)frame.origin.y+(unsigned int)frame.size.height;
+		
+        for (ViewportList::iterator it = mViewportList.begin(); it != mViewportList.end(); ++it)
+        {
+            (*it).second->_updateDimensions();
+        }
+    }
+
+    void OSXCocoaWindow::swapBuffers(bool waitForVSync)
+    {
+		if(!mIsFullScreen)
+			[glContext flushBuffer];
+		else
+			swapCGLBuffers();
+			
+		/*if(![[[NSRunLoop currentRunLoop] currentMode] isEqualTo:NSEventTrackingRunLoopMode])
+		{
+			NSEvent *e = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES];
+			if(e)
+				[NSApp sendEvent:e];
+		}*/
+    }
+	
+	//-------------------------------------------------------------------------------------------------//
+	void OSXCocoaWindow::getCustomAttribute( const String& name, void* pData )
+	{
+		if( name == "GLCONTEXT" ) 
+		{
+			*static_cast<OSXContext**>(pData) = mContext;
+			return;
+		} 
+	}
+}
Index: /RenderSystems/GL/src/OSX/OgreOSXContext.cpp
===================================================================
--- /RenderSystems/GL/src/OSX/OgreOSXContext.cpp	(revision 5)
+++ /RenderSystems/GL/src/OSX/OgreOSXContext.cpp	(revision 5)
@@ -0,0 +1,41 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreOSXContext.h"
+
+namespace Ogre
+{
+	OSXContext::OSXContext()
+	{
+	}
+	
+	OSXContext::~OSXContext()
+	{        
+    }
+}
Index: /RenderSystems/GL/src/OSX/OgreOSXGLSupport.mm
===================================================================
--- /RenderSystems/GL/src/OSX/OgreOSXGLSupport.mm	(revision 5)
+++ /RenderSystems/GL/src/OSX/OgreOSXGLSupport.mm	(revision 5)
@@ -0,0 +1,407 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+ 
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+ 
+This program 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 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 Lesser General Public License for more details.
+ 
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreRoot.h"
+
+#include "OgreOSXGLSupport.h"
+#include "OgreOSXCarbonWindow.h"
+#include "OgreOSXCocoaWindow.h"
+
+#include "OgreGLTexture.h"
+#include "OgreOSXRenderTexture.h"
+
+#include <OpenGL/OpenGL.h>
+#include <mach-o/dyld.h>
+
+namespace Ogre {
+
+OSXGLSupport::OSXGLSupport() : mAPI(""), mContextType("")
+{
+}
+
+OSXGLSupport::~OSXGLSupport()
+{
+}
+
+void OSXGLSupport::addConfig( void )
+{
+	ConfigOption optFullScreen;
+	ConfigOption optVideoMode;
+	ConfigOption optBitDepth;
+    ConfigOption optFSAA;
+	ConfigOption optRTTMode;
+
+	// FS setting possiblities
+	optFullScreen.name = "Full Screen";
+	optFullScreen.possibleValues.push_back( "Yes" );
+	optFullScreen.possibleValues.push_back( "No" );
+	optFullScreen.currentValue = "No";
+	optFullScreen.immutable = false;
+
+	optBitDepth.name = "Colour Depth";
+	optBitDepth.possibleValues.push_back( "32" );
+	optBitDepth.possibleValues.push_back( "16" );
+	optBitDepth.currentValue = "32";
+	optBitDepth.immutable = false;
+
+    mOptions[ optFullScreen.name ] = optFullScreen;
+	mOptions[ optBitDepth.name ] = optBitDepth;
+
+	CGLRendererInfoObj rend;
+	long nrend;
+	CGLQueryRendererInfo(CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay), &rend, &nrend);
+
+	long maxSamples;
+	CGLDescribeRenderer(rend, 0, kCGLRPMaxSamples, &maxSamples);
+
+    //FSAA possibilities
+    optFSAA.name = "FSAA";
+    optFSAA.possibleValues.push_back( "0" );
+
+	switch( maxSamples )
+	{
+		case 6:
+			optFSAA.possibleValues.push_back( "2" );
+			optFSAA.possibleValues.push_back( "4" );
+			optFSAA.possibleValues.push_back( "6" );
+			break;
+		case 4:
+			optFSAA.possibleValues.push_back( "2" );
+			optFSAA.possibleValues.push_back( "4" );
+			break;
+		case 2:
+			optFSAA.possibleValues.push_back( "2" );
+			break;
+		default: break;
+	}
+
+    optFSAA.currentValue = "0";
+    optFSAA.immutable = false;
+
+    mOptions[ optFSAA.name ] = optFSAA;
+
+	// Video mode possiblities
+	optVideoMode.name = "Video Mode";
+	optVideoMode.immutable = false;
+
+	CFArrayRef displayModes = CGDisplayAvailableModes(CGMainDisplayID());
+	CFIndex numModes = CFArrayGetCount(displayModes);
+	CFMutableArrayRef goodModes = NULL;
+	goodModes = CFArrayCreateMutable(kCFAllocatorDefault, numModes, NULL);
+	
+	// Grab all the available display modes, then weed out duplicates...
+	for(int i = 0; i < numModes; ++i)
+	{
+		CFDictionaryRef modeInfo = (CFDictionaryRef)CFArrayGetValueAtIndex(displayModes, i);
+		
+		Boolean safeForHardware = _getDictionaryBoolean(modeInfo, kCGDisplayModeIsSafeForHardware);
+		Boolean stretched = _getDictionaryBoolean(modeInfo, kCGDisplayModeIsStretched);
+		Boolean skipped = false;
+		
+		if((safeForHardware) || (!stretched))
+		{
+			long width  = _getDictionaryLong(modeInfo, kCGDisplayWidth);
+			long height = _getDictionaryLong(modeInfo, kCGDisplayHeight); 
+			
+			for(int j = 0; j < CFArrayGetCount(goodModes); ++j)
+			{
+				CFDictionaryRef otherMode = (CFDictionaryRef)CFArrayGetValueAtIndex(goodModes, j);
+
+				long otherWidth  = _getDictionaryLong(otherMode, kCGDisplayWidth);
+				long otherHeight = _getDictionaryLong(otherMode, kCGDisplayHeight);
+				
+				// If we find a duplicate then skip this mode
+				if((otherWidth == width) && (otherHeight == height))
+					skipped = true;
+			}
+			
+			// This is a new mode, so add it to our goodModes array
+			if(!skipped)
+				CFArrayAppendValue(goodModes, modeInfo);
+		}
+	}
+	
+	// Sort the modes...
+	CFArraySortValues(goodModes, CFRangeMake(0, CFArrayGetCount(goodModes)), 
+					  (CFComparatorFunction)_compareModes, NULL);
+					  
+	// Now pull the modes out and put them into optVideoModes
+	for(int i = 0; i < CFArrayGetCount(goodModes); ++i)
+	{
+		CFDictionaryRef resolution = (CFDictionaryRef)CFArrayGetValueAtIndex(goodModes, i);
+		
+		long fWidth  = _getDictionaryLong(resolution, kCGDisplayWidth);
+		long fHeight = _getDictionaryLong(resolution, kCGDisplayHeight);
+		
+		String resoString = StringConverter::toString(fWidth) + " x " + StringConverter::toString(fHeight);
+		optVideoMode.possibleValues.push_back(resoString);
+		
+		//LogManager::getSingleton().logMessage( "Added resolution: " + resoString);
+	}
+	
+	optRTTMode.name = "RTT Preferred Mode";
+	optRTTMode.possibleValues.push_back( "FBO" );
+	optRTTMode.possibleValues.push_back( "PBuffer" );
+	optRTTMode.possibleValues.push_back( "Copy" );
+	optRTTMode.currentValue = "PBuffer";
+	optRTTMode.immutable = false;
+
+
+	mOptions[optFullScreen.name] = optFullScreen;
+	mOptions[optVideoMode.name] = optVideoMode;
+    mOptions[optFSAA.name] = optFSAA;
+	mOptions[optRTTMode.name] = optRTTMode;
+
+}
+
+String OSXGLSupport::validateConfig( void )
+{
+	return String( "" );
+}
+
+RenderWindow* OSXGLSupport::createWindow( bool autoCreateWindow, GLRenderSystem* renderSystem, const String& windowTitle ) 
+{
+	if( autoCreateWindow )
+	{
+		ConfigOptionMap::iterator opt = mOptions.find( "Full Screen" );
+		if( opt == mOptions.end() )
+			OGRE_EXCEPT( Exception::ERR_RENDERINGAPI_ERROR, "Can't find full screen options!", "OSXGLSupport::createWindow" );
+		bool fullscreen = ( opt->second.currentValue == "Yes" );
+
+		opt = mOptions.find( "Video Mode" );
+		if( opt == mOptions.end() )
+			OGRE_EXCEPT( Exception::ERR_RENDERINGAPI_ERROR, "Can't find video mode options!", "OSXGLSupport::createWindow" );
+		String val = opt->second.currentValue;
+		String::size_type pos = val.find( 'x' );
+		if( pos == String::npos )
+			OGRE_EXCEPT( Exception::ERR_RENDERINGAPI_ERROR, "Invalid Video Mode provided", "OSXGLSupport::createWindow" );
+
+		unsigned int w = StringConverter::parseUnsignedInt( val.substr( 0, pos ) );
+		unsigned int h = StringConverter::parseUnsignedInt( val.substr( pos + 1 ) );
+
+        // Parse FSAA config
+		NameValuePairList winOptions;
+		winOptions[ "title" ] = windowTitle;
+        int fsaa_x_samples = 0;
+        opt = mOptions.find( "FSAA" );
+        if( opt != mOptions.end() )
+        {
+			winOptions[ "FSAA" ] = opt->second.currentValue;
+        }
+
+		return renderSystem->createRenderWindow( windowTitle, w, h, fullscreen, &winOptions );
+	}
+	else
+	{
+		// XXX What is the else?
+		return NULL;
+	}
+}
+
+RenderWindow* OSXGLSupport::newWindow( const String &name, unsigned int width, unsigned int height, 
+	bool fullScreen, const NameValuePairList *miscParams )
+{
+	//  Does the user want Cocoa or Carbon, default to carbon...
+	mAPI = "carbon";
+	mContextType = "AGL";
+	
+	if(miscParams)
+	{
+		NameValuePairList::const_iterator opt = NULL;
+		
+		// First we must determine if this is a carbon or a cocoa window
+		// that we wish to create
+		opt = miscParams->find("macAPI");
+		if(opt != miscParams->end() && opt->second == "cocoa")
+		{
+			// Our user wants a cocoa compatable system
+			mAPI = "cocoa";
+			mContextType = "NSOpenGL";
+		}
+	}
+	
+	// Create the window, if cocoa return a cocoa window
+	if(mAPI == "cocoa")
+	{
+		LogManager::getSingleton().logMessage("Creating a Cocoa Compatible Render System");
+		OSXCocoaWindow* window = new OSXCocoaWindow();
+		window->create(name, width, height, fullScreen, miscParams);
+		return window;
+	}
+	
+	// Otherwise default to carbon
+	LogManager::getSingleton().logMessage("Creating a Carbon Compatible Render System");
+	OSXCarbonWindow* window = new OSXCarbonWindow();
+	window->create(name, width, height, fullScreen, miscParams);
+	return window;
+}
+
+void OSXGLSupport::start()
+{
+	LogManager::getSingleton().logMessage(
+			"*******************************************\n"
+			"***    Starting OSX OpenGL Subsystem    ***\n"
+			"*******************************************");
+}
+
+void OSXGLSupport::stop()
+{
+	LogManager::getSingleton().logMessage(
+			"*******************************************\n"
+			"***    Stopping OSX OpenGL Subsystem    ***\n"
+			"*******************************************");
+}
+
+void* OSXGLSupport::getProcAddress( const char* name )
+{
+	NSSymbol symbol;
+    char *symbolName;
+    // Prepend a '_' for the Unix C symbol mangling convention
+    symbolName = (char*)malloc (strlen (name) + 2);
+    strcpy(symbolName + 1, name);
+    symbolName[0] = '_';
+    symbol = NULL;
+	// TODO:  dlopen calls, dyld
+    if (NSIsSymbolNameDefined (symbolName))
+        symbol = NSLookupAndBindSymbol (symbolName);
+    free (symbolName);
+    return symbol ? NSAddressOfSymbol (symbol) : NULL;
+}
+
+void* OSXGLSupport::getProcAddress( const String& procname )
+{
+	return getProcAddress( procname.c_str() );
+}
+
+bool OSXGLSupport::supportsPBuffers()
+{
+	return true;
+}
+
+GLPBuffer* OSXGLSupport::createPBuffer(PixelComponentType format, size_t width, size_t height)
+{
+//	if(mContextType == "NSOpenGL")
+//		return new OSXCocoaPBuffer(format, width, height);
+//	if(mContextType == "CGL")
+//		return new OSXCGLPBuffer(format, width, height);
+//	else
+		return new OSXPBuffer(format, width, height);
+}
+
+CFComparisonResult OSXGLSupport::_compareModes (const void *val1, const void *val2, void *context)
+{
+	// These are the values we will be interested in...
+	/*
+	_getDictionaryLong((mode), kCGDisplayWidth)
+	_getDictionaryLong((mode), kCGDisplayHeight)
+	_getDictionaryLong((mode), kCGDisplayRefreshRate)
+	_getDictionaryLong((mode), kCGDisplayBitsPerPixel)
+	_getDictionaryBoolean((mode), kCGDisplayModeIsSafeForHardware)
+	_getDictionaryBoolean((mode), kCGDisplayModeIsStretched)
+	*/
+	
+	// CFArray comparison callback for sorting display modes.
+	#pragma unused(context)
+	CFDictionaryRef thisMode = (CFDictionaryRef)val1;
+	CFDictionaryRef otherMode = (CFDictionaryRef)val2;
+	
+	long width = _getDictionaryLong(thisMode, kCGDisplayWidth);
+	long otherWidth = _getDictionaryLong(otherMode, kCGDisplayWidth);
+	
+	long height = _getDictionaryLong(thisMode, kCGDisplayHeight);
+	long otherHeight = _getDictionaryLong(otherMode, kCGDisplayHeight);
+
+	// sort modes in screen size order
+	if (width * height < otherWidth * otherHeight)
+	{
+		return kCFCompareLessThan;
+	}
+	else if (width * height > otherWidth * otherHeight)
+	{
+		return kCFCompareGreaterThan;
+	}
+
+	// sort modes by bits per pixel
+	long bitsPerPixel = _getDictionaryLong(thisMode, kCGDisplayBitsPerPixel);
+	long otherBitsPerPixel = _getDictionaryLong(otherMode, kCGDisplayBitsPerPixel);
+
+	if (bitsPerPixel < otherBitsPerPixel)
+	{
+		return kCFCompareLessThan;
+	}
+	else if (bitsPerPixel > otherBitsPerPixel)
+	{
+		return kCFCompareGreaterThan;
+	}
+
+	// sort modes by refresh rate.
+	long refreshRate = _getDictionaryLong(thisMode, kCGDisplayRefreshRate);
+	long otherRefreshRate = _getDictionaryLong(otherMode, kCGDisplayRefreshRate);
+
+	if (refreshRate < otherRefreshRate)
+	{
+		return kCFCompareLessThan;
+	}
+	else if (refreshRate > otherRefreshRate)
+	{
+		return kCFCompareGreaterThan;
+	}
+
+	return kCFCompareEqualTo;
+}
+
+Boolean OSXGLSupport::_getDictionaryBoolean(CFDictionaryRef dict, const void* key)
+{
+	Boolean value = false;
+	CFBooleanRef boolRef;
+	boolRef = (CFBooleanRef)CFDictionaryGetValue(dict, key);
+	
+	if (boolRef != NULL)
+		value = CFBooleanGetValue(boolRef); 	
+		
+	return value;
+}
+
+long OSXGLSupport::_getDictionaryLong(CFDictionaryRef dict, const void* key)
+{
+	long value = 0;
+	CFNumberRef numRef;
+	numRef = (CFNumberRef)CFDictionaryGetValue(dict, key);
+	
+	if (numRef != NULL)
+		CFNumberGetValue(numRef, kCFNumberLongType, &value);	
+		
+	return value;
+}
+
+
+}
Index: /RenderSystems/GL/src/OSX/OgreOSXRenderTexture.cpp
===================================================================
--- /RenderSystems/GL/src/OSX/OgreOSXRenderTexture.cpp	(revision 5)
+++ /RenderSystems/GL/src/OSX/OgreOSXRenderTexture.cpp	(revision 5)
@@ -0,0 +1,63 @@
+#include "OgreStableHeaders.h"
+
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreRoot.h"
+#include "OgreStringConverter.h"
+
+#include "OgreGLRenderSystem.h"
+
+#include "OgreOSXRenderTexture.h"
+#include "OgreOSXCarbonContext.h"
+
+#include <OpenGL/gl.h>
+#define GL_EXT_texture_env_combine 1
+#include <OpenGL/glext.h>
+#include <OpenGL/glu.h>
+#include <AGL/agl.h>
+
+namespace Ogre
+{
+	OSXPBuffer::OSXPBuffer( PixelComponentType format, size_t width, size_t height ) : GLPBuffer( format, width, height ), mContext( NULL )
+	{
+		LogManager::getSingleton().logMessage( "OSXPBuffer::OSXPBuffer()" );
+		createPBuffer();
+		// Create context
+		mContext = new OSXCarbonContext( mAGLContext );
+    }
+	
+	OSXPBuffer::~OSXPBuffer()
+	{
+		LogManager::getSingleton().logMessage( "OSXPBuffer::~OSXPBuffer()" );
+		delete mContext;
+		destroyPBuffer();
+	}
+
+	GLContext* OSXPBuffer::getContext()
+	{
+		LogManager::getSingleton().logMessage( "OSXPBuffer::getContext()" );
+		return mContext;
+	}
+	
+	void OSXPBuffer::createPBuffer()
+	{
+		LogManager::getSingleton().logMessage( "OSXPBuffer::createPBuffer()" );
+		
+		GLint attrib[] = { AGL_NO_RECOVERY, GL_TRUE, AGL_ACCELERATED, GL_TRUE, AGL_RGBA, AGL_NONE };
+		AGLPixelFormat pixelFormat = aglChoosePixelFormat(NULL, 0, attrib);
+		mAGLContext = aglCreateContext(pixelFormat, NULL);
+		
+		//mAGLContext = aglGetCurrentContext();
+		aglCreatePBuffer( mWidth, mHeight, GL_TEXTURE_2D, GL_RGBA, 0, &mPBuffer );
+		
+		GLint vs = aglGetVirtualScreen( mAGLContext );
+		aglSetPBuffer( mAGLContext, mPBuffer, 0, 0, vs ); 
+	}
+	
+	void OSXPBuffer::destroyPBuffer()
+	{
+		LogManager::getSingleton().logMessage( "OSXPBuffer::destroyPBuffer()" );
+		aglDestroyPBuffer( mPBuffer );
+	}
+}
+
Index: /RenderSystems/GL/src/OSX/OgreOSXWindow.cpp
===================================================================
--- /RenderSystems/GL/src/OSX/OgreOSXWindow.cpp	(revision 5)
+++ /RenderSystems/GL/src/OSX/OgreOSXWindow.cpp	(revision 5)
@@ -0,0 +1,235 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreOSXWindow.h"
+#include "OgreOSXCGLContext.h"
+#include "OgreRoot.h"
+#include "OgreGLRenderSystem.h"
+#include "OgreImageCodec.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+
+#include <OpenGL/gl.h>
+#define GL_EXT_texture_env_combine 1
+#include <OpenGL/glext.h>
+#include <OpenGL/glu.h>
+
+namespace Ogre
+{
+
+//-------------------------------------------------------------------------------------------------//
+OSXWindow::OSXWindow() : mCGLContext(NULL)
+{
+}
+
+//-------------------------------------------------------------------------------------------------//
+OSXWindow::~OSXWindow()
+{
+}
+
+//-------------------------------------------------------------------------------------------------//
+void OSXWindow::writeContentsToFile(const String& filename)
+{
+	ImageCodec::ImageData* imgData = new ImageCodec::ImageData;
+	imgData->width = mWidth;
+	imgData->height = mHeight;
+	imgData->format = PF_BYTE_RGB;
+
+	// Allocate buffer
+	uchar* pBuffer = new uchar[mWidth * mHeight * 3];
+
+	// Read pixels
+	// I love GL: it does all the locking & colour conversion for us
+	glReadPixels(0,0, mWidth-1, mHeight-1, GL_RGB, GL_UNSIGNED_BYTE, pBuffer);
+
+	// Wrap buffer in a memory stream
+	DataStreamPtr stream(new MemoryDataStream(pBuffer, mWidth * mHeight * 3, false));
+
+	// Need to flip the read data over in Y though
+	Image img;
+	img.loadRawData(stream, mWidth, mHeight, PF_BYTE_RGB );
+	img.flipAroundX();
+
+	MemoryDataStreamPtr streamFlipped(new MemoryDataStream(img.getData(), stream->size(), false));
+
+	// Get codec
+	size_t pos = filename.find_last_of(".");
+	String extension;
+	if( pos == String::npos )
+		OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, "Unable to determine image type for '" 
+			+ filename + "' - invalid extension.", "OSXCarbonWindow::writeContentsToFile" );
+
+	while( pos != filename.length() - 1 )
+		extension += filename[++pos];
+
+	// Get the codec
+	Codec * pCodec = Codec::getCodec(extension);
+
+	// Write out
+	Codec::CodecDataPtr codecDataPtr(imgData);
+	pCodec->codeToFile(streamFlipped, filename, codecDataPtr);
+
+	delete [] pBuffer;
+}
+
+//-------------------------------------------------------------------------------------------------//
+void OSXWindow::createCGLFullscreen(unsigned int width, unsigned int height, unsigned int depth, unsigned int fsaa, CGLContextObj sharedContext)
+{
+		// Find the best match to what was requested
+		boolean_t exactMatch;
+		CFDictionaryRef displayMode = CGDisplayBestModeForParameters(kCGDirectMainDisplay, depth, width, height, &exactMatch);
+		
+		if(!exactMatch)
+		{
+			// TODO: Report the size difference
+			// That mode is not available, using the closest match
+			String request = StringConverter::toString(width) + String(" x ") + StringConverter::toString(height) + String(" @ ") + 
+				StringConverter::toString(depth) + "bpp. ";
+				
+			String recieved = StringConverter::toString(width) + String(" x ") + StringConverter::toString(height) + String(" @ ") + 
+				StringConverter::toString(depth) + "bpp. "; 
+				
+			LogManager::getSingleton().logMessage(String("RenderSystem Warning:  You requested a fullscreen mode of ") + request +
+				String(" This mode is not available and you will recieve the closest match."));
+		}
+		
+		// Do the fancy display fading
+		CGDisplayFadeReservationToken reservationToken;
+		CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval,
+											&reservationToken);
+		CGDisplayFade(reservationToken,
+					  0.5,
+					  kCGDisplayBlendNormal,
+					  kCGDisplayBlendSolidColor,
+					  0.0, 0.0, 0.0,
+					  true);
+		
+		// Grab the main display and save it for later.
+		// You could render to any display, but picking what display
+		// to render to could be interesting.
+		CGDisplayCapture(kCGDirectMainDisplay);
+		
+		// Switch to the correct resolution
+		CGDisplaySwitchToMode(kCGDirectMainDisplay, displayMode);
+		
+		// Get a pixel format that best matches what we are looking for
+		CGLPixelFormatAttribute attribs[] = { 
+			kCGLPFADoubleBuffer,
+			kCGLPFAAlphaSize,     (CGLPixelFormatAttribute)8,
+			kCGLPFADepthSize,     (CGLPixelFormatAttribute)depth,
+			kCGLPFAStencilSize,   (CGLPixelFormatAttribute)8,
+			kCGLPFASampleBuffers, (CGLPixelFormatAttribute)0,
+			kCGLPFASamples,       (CGLPixelFormatAttribute)0,
+			kCGLPFAFullScreen,
+			kCGLPFASingleRenderer,
+			kCGLPFAAccelerated,
+			kCGLPFADisplayMask,   (CGLPixelFormatAttribute)CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay),
+			(CGLPixelFormatAttribute)0
+		};
+		
+		// Set up FSAA if it was requested
+		if(fsaa > 1)
+		{
+				// turn on kCGLPFASampleBuffers
+				attribs[8] = (CGLPixelFormatAttribute)1;
+				// set the samples for kCGLPFASamples
+				attribs[10] = (CGLPixelFormatAttribute)fsaa;
+		}
+		
+		// Storage for our pixel format
+		CGLPixelFormatObj pixelFormatObj;
+		long numPixelFormats = 0;
+		
+		// Get a pixelFormatObj from our atributes
+		CGLError err;
+		err = CGLChoosePixelFormat(attribs, &pixelFormatObj, &numPixelFormats); 
+		if(err != 0)
+		{
+			CGReleaseAllDisplays();
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, String("CGL Error: " + String(CGLErrorString(err))), "OSXCarbonWindow::create");
+		}
+
+		// Create the CGLcontext from our pixel format, share it with the sharedContext passed in
+		err = CGLCreateContext(pixelFormatObj, sharedContext, &mCGLContext);
+		if(err != 0)
+		{
+			CGReleaseAllDisplays();
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, String("CGL Error: " + String(CGLErrorString(err))), "OSXCarbonWindow::create");
+		}
+				
+		// Once we have the context we can destroy the pixel format
+		CGLDestroyPixelFormat(pixelFormatObj); 
+				
+		// Set the context to drawable
+		CGLSetFullScreen(mCGLContext);
+		
+		// Set the context as current
+		CGLSetCurrentContext(mCGLContext);
+		
+		// This synchronizes CGL with the vertical retrace
+		// Apple docs suggest that OpenGL blocks rendering calls when waiting for
+		// a vertical retrace anyhow.
+		long swapInterval = 1;
+		CGLSetParameter(mCGLContext, kCGLCPSwapInterval, &swapInterval);
+		
+		// Give a copy of our context to the rendersystem
+		mContext = new OSXCGLContext(mCGLContext);
+		
+		// Let everyone know we are fullscreen now
+		mIsFullScreen = true;
+		
+		CGDisplayFade(reservationToken,
+                  2.0,
+                  kCGDisplayBlendSolidColor,
+                  kCGDisplayBlendNormal,
+                  0.0, 0.0, 0.0,
+                  false);
+		CGReleaseDisplayFadeReservation(reservationToken);
+}
+
+//-------------------------------------------------------------------------------------------------//
+void OSXWindow::destroyCGLFullscreen(void)
+{
+	CGReleaseAllDisplays();
+}
+
+//-------------------------------------------------------------------------------------------------//
+void OSXWindow::swapCGLBuffers(void)
+{
+	CGLFlushDrawable(mCGLContext);
+	CGLContextObj curCtx = CGLGetCurrentContext();
+	if(curCtx != mCGLContext)
+	{
+		CGLSetCurrentContext(mCGLContext);
+		CGLSetFullScreen(mCGLContext);
+	}
+}
+
+}
Index: /RenderSystems/GL/src/OgreGLATIFSInit.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLATIFSInit.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLATIFSInit.cpp	(revision 5)
@@ -0,0 +1,104 @@
+/*
+	ATI fragment shader Extension program file.
+	setup by NFZ
+	extracted from ATI 8500 SDK
+
+** GL_ATI_fragment_shader
+**
+** Support:
+**   Rage 128 * based  : Not Supported
+**   Radeon   * based  : Not Supported
+**   R200     * based  : Supported
+**   R200 : 8500, 9000, 9100, 9200
+**   also works on R300 but pointless since ARBFP1.0 supported
+*/
+
+#include "OgreGLATIFSInit.h"
+#include "OgreGLPrerequisites.h"
+
+// ATI_fragment_program functions
+PFNGLGENFRAGMENTSHADERSATIPROC        glGenFragmentShadersATI_ptr=NULL;
+PFNGLBINDFRAGMENTSHADERATIPROC        glBindFragmentShaderATI_ptr=NULL;
+PFNGLDELETEFRAGMENTSHADERATIPROC      glDeleteFragmentShaderATI_ptr=NULL;
+PFNGLBEGINFRAGMENTSHADERATIPROC       glBeginFragmentShaderATI_ptr=NULL;
+PFNGLENDFRAGMENTSHADERATIPROC         glEndFragmentShaderATI_ptr=NULL;
+PFNGLPASSTEXCOORDATIPROC              glPassTexCoordATI_ptr=NULL;
+PFNGLSAMPLEMAPATIPROC                 glSampleMapATI_ptr=NULL;
+PFNGLCOLORFRAGMENTOP1ATIPROC          glColorFragmentOp1ATI_ptr=NULL;
+PFNGLCOLORFRAGMENTOP2ATIPROC          glColorFragmentOp2ATI_ptr=NULL;
+PFNGLCOLORFRAGMENTOP3ATIPROC          glColorFragmentOp3ATI_ptr=NULL;
+PFNGLALPHAFRAGMENTOP1ATIPROC          glAlphaFragmentOp1ATI_ptr=NULL;
+PFNGLALPHAFRAGMENTOP2ATIPROC          glAlphaFragmentOp2ATI_ptr=NULL;
+PFNGLALPHAFRAGMENTOP3ATIPROC          glAlphaFragmentOp3ATI_ptr=NULL;
+PFNGLSETFRAGMENTSHADERCONSTANTATIPROC glSetFragmentShaderConstantATI_ptr=NULL;
+
+bool InitATIFragmentShaderExtensions(Ogre::GLSupport& glSupport)
+{
+    static bool init = false;
+    //char *extList;
+
+    if(init) return init;
+
+	
+	/* confirm that the version of OpenGL supports ATI fragment shader */
+	/* done in GLRenderSystem
+    extList = (char *)glGetString(GL_EXTENSIONS);
+
+    if (strstr(extList, "GL_ATI_fragment_shader") == NULL)  {
+		//MessageBox(NULL, "GL_ATI_fragment_shader extension not supported", "GL Extension error", MB_OK);
+		// ** should raise exception
+		init = false;
+		return false;
+    }
+
+	*/
+
+
+	glGenFragmentShadersATI_ptr    = (PFNGLGENFRAGMENTSHADERSATIPROC) glSupport.getProcAddress("glGenFragmentShadersATI");
+	glBindFragmentShaderATI_ptr    = (PFNGLBINDFRAGMENTSHADERATIPROC) glSupport.getProcAddress("glBindFragmentShaderATI");
+	glDeleteFragmentShaderATI_ptr  = (PFNGLDELETEFRAGMENTSHADERATIPROC) glSupport.getProcAddress("glDeleteFragmentShaderATI");
+	glBeginFragmentShaderATI_ptr   = (PFNGLBEGINFRAGMENTSHADERATIPROC) glSupport.getProcAddress("glBeginFragmentShaderATI");
+	glEndFragmentShaderATI_ptr     = (PFNGLENDFRAGMENTSHADERATIPROC) glSupport.getProcAddress("glEndFragmentShaderATI");
+	glPassTexCoordATI_ptr          = (PFNGLPASSTEXCOORDATIPROC) glSupport.getProcAddress("glPassTexCoordATI");
+	glSampleMapATI_ptr             = (PFNGLSAMPLEMAPATIPROC) glSupport.getProcAddress("glSampleMapATI");
+	glColorFragmentOp1ATI_ptr      = (PFNGLCOLORFRAGMENTOP1ATIPROC) glSupport.getProcAddress("glColorFragmentOp1ATI");
+	glColorFragmentOp2ATI_ptr      = (PFNGLCOLORFRAGMENTOP2ATIPROC) glSupport.getProcAddress("glColorFragmentOp2ATI");
+	glColorFragmentOp3ATI_ptr      = (PFNGLCOLORFRAGMENTOP3ATIPROC) glSupport.getProcAddress("glColorFragmentOp3ATI");
+	glAlphaFragmentOp1ATI_ptr      = (PFNGLALPHAFRAGMENTOP1ATIPROC) glSupport.getProcAddress("glAlphaFragmentOp1ATI");
+	glAlphaFragmentOp2ATI_ptr      = (PFNGLALPHAFRAGMENTOP2ATIPROC) glSupport.getProcAddress("glAlphaFragmentOp2ATI");
+	glAlphaFragmentOp3ATI_ptr      = (PFNGLALPHAFRAGMENTOP3ATIPROC) glSupport.getProcAddress("glAlphaFragmentOp3ATI");
+	glSetFragmentShaderConstantATI_ptr = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) glSupport.getProcAddress("glSetFragmentShaderConstantATI");
+
+	if (glGenFragmentShadersATI_ptr == NULL) return false;
+
+	if (glBindFragmentShaderATI_ptr == NULL) return false;
+
+	if (glDeleteFragmentShaderATI_ptr == NULL) return false;
+
+	if (glBeginFragmentShaderATI_ptr == NULL) return false;
+
+	if (glEndFragmentShaderATI_ptr == NULL) return false;
+
+	if (glPassTexCoordATI_ptr == NULL) return false;
+
+	if (glColorFragmentOp1ATI_ptr == NULL) return false;
+
+	if (glColorFragmentOp2ATI_ptr == NULL) return false;
+
+	if (glColorFragmentOp3ATI_ptr == NULL) return false;
+
+	if (glAlphaFragmentOp1ATI_ptr == NULL) return false;
+
+	if (glAlphaFragmentOp2ATI_ptr == NULL) return false;
+
+	if (glAlphaFragmentOp2ATI_ptr == NULL) return false;
+
+	if (glAlphaFragmentOp3ATI_ptr == NULL) return false;
+
+	if (glSetFragmentShaderConstantATI_ptr == NULL) return false;
+
+    init = true;
+
+	return true;
+}
+
Index: /RenderSystems/GL/src/OgreGLContext.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLContext.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLContext.cpp	(revision 5)
@@ -0,0 +1,44 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLContext.h"
+
+namespace Ogre {
+    // Empty base class
+    GLContext::GLContext():
+        initialized(false) {
+    }
+    
+    GLContext::~GLContext() {        
+    }
+    
+    void GLContext::endCurrent() {
+    }
+    
+}
Index: /RenderSystems/GL/src/OgreGLDefaultHardwareBufferManager.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLDefaultHardwareBufferManager.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLDefaultHardwareBufferManager.cpp	(revision 5)
@@ -0,0 +1,163 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreGLDefaultHardwareBufferManager.h"
+#include "OgreAlignedAllocator.h"
+
+namespace Ogre {
+
+	GLDefaultHardwareVertexBuffer::GLDefaultHardwareVertexBuffer(size_t vertexSize, size_t numVertices, 
+		HardwareBuffer::Usage usage)
+        : HardwareVertexBuffer(vertexSize, numVertices, usage, true, false) // always software, never shadowed
+	{
+        mpData = static_cast<unsigned char*>(AlignedMemory::allocate(mSizeInBytes));
+	}
+	//-----------------------------------------------------------------------
+    GLDefaultHardwareVertexBuffer::~GLDefaultHardwareVertexBuffer()
+	{
+		AlignedMemory::deallocate(mpData);
+	}
+	//-----------------------------------------------------------------------
+    void* GLDefaultHardwareVertexBuffer::lockImpl(size_t offset, size_t length, LockOptions options)
+	{
+        // Only for use internally, no 'locking' as such
+		return mpData + offset;
+	}
+	//-----------------------------------------------------------------------
+	void GLDefaultHardwareVertexBuffer::unlockImpl(void)
+	{
+        // Nothing to do
+	}
+	//-----------------------------------------------------------------------
+    void* GLDefaultHardwareVertexBuffer::lock(size_t offset, size_t length, LockOptions options)
+	{
+        mIsLocked = true;
+		return mpData + offset;
+	}
+	//-----------------------------------------------------------------------
+	void GLDefaultHardwareVertexBuffer::unlock(void)
+	{
+        mIsLocked = false;
+        // Nothing to do
+	}
+	//-----------------------------------------------------------------------
+    void GLDefaultHardwareVertexBuffer::readData(size_t offset, size_t length, void* pDest)
+	{
+		assert((offset + length) <= mSizeInBytes);
+		memcpy(pDest, mpData + offset, length);
+	}
+	//-----------------------------------------------------------------------
+    void GLDefaultHardwareVertexBuffer::writeData(size_t offset, size_t length, const void* pSource,
+			bool discardWholeBuffer)
+	{
+		assert((offset + length) <= mSizeInBytes);
+		// ignore discard, memory is not guaranteed to be zeroised
+		memcpy(mpData + offset, pSource, length);
+
+	}
+	//-----------------------------------------------------------------------
+
+	GLDefaultHardwareIndexBuffer::GLDefaultHardwareIndexBuffer(IndexType idxType, 
+		size_t numIndexes, HardwareBuffer::Usage usage) 
+		: HardwareIndexBuffer(idxType, numIndexes, usage, true, false) // always software, never shadowed
+	{
+		mpData = new unsigned char[mSizeInBytes];
+	}
+	//-----------------------------------------------------------------------
+    GLDefaultHardwareIndexBuffer::~GLDefaultHardwareIndexBuffer()
+	{
+		delete [] mpData;
+	}
+	//-----------------------------------------------------------------------
+    void* GLDefaultHardwareIndexBuffer::lockImpl(size_t offset, size_t length, LockOptions options)
+	{
+        // Only for use internally, no 'locking' as such
+		return mpData + offset;
+	}
+	//-----------------------------------------------------------------------
+	void GLDefaultHardwareIndexBuffer::unlockImpl(void)
+	{
+        // Nothing to do
+	}
+	//-----------------------------------------------------------------------
+    void* GLDefaultHardwareIndexBuffer::lock(size_t offset, size_t length, LockOptions options)
+	{
+        mIsLocked = true;
+		return mpData + offset;
+	}
+	//-----------------------------------------------------------------------
+	void GLDefaultHardwareIndexBuffer::unlock(void)
+	{
+        mIsLocked = false;
+        // Nothing to do
+	}
+	//-----------------------------------------------------------------------
+    void GLDefaultHardwareIndexBuffer::readData(size_t offset, size_t length, void* pDest)
+	{
+		assert((offset + length) <= mSizeInBytes);
+		memcpy(pDest, mpData + offset, length);
+	}
+	//-----------------------------------------------------------------------
+    void GLDefaultHardwareIndexBuffer::writeData(size_t offset, size_t length, const void* pSource,
+			bool discardWholeBuffer)
+	{
+		assert((offset + length) <= mSizeInBytes);
+		// ignore discard, memory is not guaranteed to be zeroised
+		memcpy(mpData + offset, pSource, length);
+
+	}
+	//-----------------------------------------------------------------------
+	
+	
+    //-----------------------------------------------------------------------
+    GLDefaultHardwareBufferManager::GLDefaultHardwareBufferManager()
+	{
+	}
+    //-----------------------------------------------------------------------
+    GLDefaultHardwareBufferManager::~GLDefaultHardwareBufferManager()
+	{
+        destroyAllDeclarations();
+        destroyAllBindings();
+	}
+    //-----------------------------------------------------------------------
+	HardwareVertexBufferSharedPtr 
+        GLDefaultHardwareBufferManager::createVertexBuffer(size_t vertexSize, 
+		size_t numVerts, HardwareBuffer::Usage usage, bool useShadowBuffer)
+	{
+		return HardwareVertexBufferSharedPtr(
+			new GLDefaultHardwareVertexBuffer(vertexSize, numVerts, usage));
+	}
+    //-----------------------------------------------------------------------
+	HardwareIndexBufferSharedPtr 
+        GLDefaultHardwareBufferManager::createIndexBuffer(HardwareIndexBuffer::IndexType itype, 
+		size_t numIndexes, HardwareBuffer::Usage usage, bool useShadowBuffer)
+	{
+		return HardwareIndexBufferSharedPtr(
+			new GLDefaultHardwareIndexBuffer(itype, numIndexes, usage) );
+	}
+}
Index: /RenderSystems/GL/src/OgreGLEngineDll.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLEngineDll.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLEngineDll.cpp	(revision 5)
@@ -0,0 +1,50 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreRoot.h"
+#include "OgreGLPlugin.h"
+
+
+namespace Ogre {
+
+	static GLPlugin* plugin;
+
+    extern "C" void _OgreGLExport dllStartPlugin(void) throw()
+    {
+		plugin = new GLPlugin();
+		Root::getSingleton().installPlugin(plugin);
+
+    }
+
+    extern "C" void _OgreGLExport dllStopPlugin(void)
+    {
+		Root::getSingleton().uninstallPlugin(plugin);
+		delete plugin;
+    }
+}
Index: /RenderSystems/GL/src/OgreGLFBOMultiRenderTarget.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLFBOMultiRenderTarget.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLFBOMultiRenderTarget.cpp	(revision 5)
@@ -0,0 +1,93 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLFBOMultiRenderTarget.h"
+#include "OgreGLPixelFormat.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreRoot.h"
+#include "OgreGLHardwarePixelBuffer.h"
+
+namespace Ogre {
+
+	GLFBOMultiRenderTarget::GLFBOMultiRenderTarget(GLFBOManager *manager, const String &name):
+		MultiRenderTarget(name),
+		fbo(manager)
+	{
+	}
+	GLFBOMultiRenderTarget::~GLFBOMultiRenderTarget()
+	{
+	}
+
+
+	void GLFBOMultiRenderTarget::bindSurface(size_t attachment, RenderTexture *target)
+
+	{
+
+		/// Check if the render target is in the rendertarget->FBO map
+        GLFrameBufferObject *fbobj = 0;
+        target->getCustomAttribute("FBO", &fbobj);
+		assert(fbobj);
+		fbo.bindSurface(attachment, fbobj->getSurface(0));
+
+
+
+		// Initialise?
+
+		
+
+		// Set width and height
+
+		mWidth = fbo.getWidth();
+
+		mHeight = fbo.getHeight();
+
+	}
+
+
+
+	void GLFBOMultiRenderTarget::unbindSurface(size_t attachment)
+	{
+		fbo.unbindSurface(attachment);
+
+		// Set width and height
+
+		mWidth = fbo.getWidth();
+
+		mHeight = fbo.getHeight();
+	}
+
+	void GLFBOMultiRenderTarget::getCustomAttribute( const String& name, void *pData )
+	{
+		if(name=="FBO")
+        {
+            *static_cast<GLFrameBufferObject **>(pData) = &fbo;
+        }
+	}
+}
Index: /RenderSystems/GL/src/OgreGLFBORenderTexture.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLFBORenderTexture.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLFBORenderTexture.cpp	(revision 5)
@@ -0,0 +1,496 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLFBORenderTexture.h"
+#include "OgreGLPixelFormat.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreRoot.h"
+#include "OgreGLHardwarePixelBuffer.h"
+#include "OgreGLFBOMultiRenderTarget.h"
+
+namespace Ogre {
+
+//-----------------------------------------------------------------------------    
+    GLFBORenderTexture::GLFBORenderTexture(GLFBOManager *manager, const String &name,
+        const GLSurfaceDesc &target):
+        GLRenderTexture(name, target),
+        mFB(manager)
+    {
+        // Bind target to surface 0 and initialise
+        mFB.bindSurface(0, target);
+        // Get attributes
+        mWidth = mFB.getWidth();
+        mHeight = mFB.getHeight();
+    }
+
+    void GLFBORenderTexture::getCustomAttribute(const String& name, void* pData)
+    {
+        if(name=="FBO")
+        {
+            *static_cast<GLFrameBufferObject **>(pData) = &mFB;
+        }
+    }
+   
+/// Size of probe texture
+#define PROBE_SIZE 16
+
+/// Stencil and depth formats to be tried
+static const GLenum stencilFormats[] =
+{
+    GL_NONE,                    // No stencil
+    GL_STENCIL_INDEX1_EXT,
+    GL_STENCIL_INDEX4_EXT,
+    GL_STENCIL_INDEX8_EXT,
+    GL_STENCIL_INDEX16_EXT
+};
+static const size_t stencilBits[] =
+{
+    0, 1, 4, 8, 16
+};
+#define STENCILFORMAT_COUNT (sizeof(stencilFormats)/sizeof(GLenum))
+
+static const GLenum depthFormats[] =
+{
+    GL_NONE,
+    GL_DEPTH_COMPONENT16,
+    GL_DEPTH_COMPONENT24,    // Prefer 24 bit depth
+    GL_DEPTH_COMPONENT32,
+    GL_DEPTH24_STENCIL8_EXT // packed depth / stencil
+};
+static const size_t depthBits[] =
+{
+    0,16,24,32,24
+};
+#define DEPTHFORMAT_COUNT (sizeof(depthFormats)/sizeof(GLenum))
+
+	GLFBOManager::GLFBOManager(bool atimode):
+		mATIMode(atimode)
+    {
+        detectFBOFormats();
+        
+        glGenFramebuffersEXT(1, &mTempFBO);
+    }
+
+	GLFBOManager::~GLFBOManager()
+	{
+		if(!mRenderBufferMap.empty())
+		{
+			LogManager::getSingleton().logMessage("GL: Warning! GLFBOManager destructor called, but not all renderbuffers were released.");
+		}
+        
+        glDeleteFramebuffersEXT(1, &mTempFBO);      
+	}
+
+    /** Try a certain FBO format, and return the status. Also sets mDepthRB and mStencilRB.
+        @returns true    if this combo is supported
+                 false   if this combo is not supported
+    */
+    GLuint GLFBOManager::_tryFormat(GLenum depthFormat, GLenum stencilFormat)
+    {
+        GLuint status, depthRB = 0, stencilRB = 0;
+        bool failed = false; // flag on GL errors
+
+        if(depthFormat != GL_NONE)
+        {
+            /// Generate depth renderbuffer
+            glGenRenderbuffersEXT(1, &depthRB);
+            /// Bind it to FBO
+            glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depthRB);
+            
+            /// Allocate storage for depth buffer
+            glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, depthFormat,
+                                PROBE_SIZE, PROBE_SIZE);
+            
+            /// Attach depth
+            glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
+                                    GL_RENDERBUFFER_EXT, depthRB);
+        }
+
+        if(stencilFormat != GL_NONE)
+        {
+            /// Generate stencil renderbuffer
+            glGenRenderbuffersEXT(1, &stencilRB);
+            /// Bind it to FBO
+            glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, stencilRB);
+            glGetError(); // NV hack
+            /// Allocate storage for stencil buffer
+            glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, stencilFormat,
+                                PROBE_SIZE, PROBE_SIZE); 
+            if(glGetError() != GL_NO_ERROR) // NV hack
+                failed = true;
+            /// Attach stencil
+            glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
+                            GL_RENDERBUFFER_EXT, stencilRB);
+            if(glGetError() != GL_NO_ERROR) // NV hack
+                failed = true;
+        }
+        
+        status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+        /// If status is negative, clean up
+        // Detach and destroy
+        glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0);
+        glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0);
+        if (depthRB)
+            glDeleteRenderbuffersEXT(1, &depthRB);
+        if (stencilRB)
+            glDeleteRenderbuffersEXT(1, &stencilRB);
+        
+        return status == GL_FRAMEBUFFER_COMPLETE_EXT && !failed;
+    }
+    
+    /** Try a certain packed depth/stencil format, and return the status.
+        @returns true    if this combo is supported
+                 false   if this combo is not supported
+    */
+    bool GLFBOManager::_tryPackedFormat(GLenum packedFormat)
+    {
+        GLuint packedRB;
+        bool failed = false; // flag on GL errors
+
+        /// Generate renderbuffer
+        glGenRenderbuffersEXT(1, &packedRB);
+
+        /// Bind it to FBO
+        glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, packedRB);
+
+        /// Allocate storage for buffer
+        glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, packedFormat, PROBE_SIZE, PROBE_SIZE);
+        glGetError(); // NV hack
+
+        /// Attach depth
+        glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
+            GL_RENDERBUFFER_EXT, packedRB);
+        if(glGetError() != GL_NO_ERROR) // NV hack
+            failed = true;
+
+        /// Attach stencil
+        glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
+            GL_RENDERBUFFER_EXT, packedRB);
+        if(glGetError() != GL_NO_ERROR) // NV hack
+            failed = true;
+
+        GLuint status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+
+        /// Detach and destroy
+        glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0);
+        glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0);
+        glDeleteRenderbuffersEXT(1, &packedRB);
+
+        return status == GL_FRAMEBUFFER_COMPLETE_EXT && !failed;
+    }
+
+    /** Detect which internal formats are allowed as RTT
+        Also detect what combinations of stencil and depth are allowed with this internal
+        format.
+    */
+    void GLFBOManager::detectFBOFormats()
+    {
+        // Try all formats, and report which ones work as target
+        GLuint fb, tid;
+        GLint old_drawbuffer, old_readbuffer;
+        GLenum target = GL_TEXTURE_2D;
+
+        glGetIntegerv (GL_DRAW_BUFFER, &old_drawbuffer);
+        glGetIntegerv (GL_READ_BUFFER, &old_readbuffer);
+
+        for(size_t x=0; x<PF_COUNT; ++x)
+        {
+            mProps[x].valid = false;
+
+			// Fetch GL format token
+			GLenum fmt = GLPixelUtil::getGLInternalFormat((PixelFormat)x);
+            if(fmt == GL_NONE && x!=0)
+                continue;
+
+			// No test for compressed formats
+			if(PixelUtil::isCompressed((PixelFormat)x))
+				continue;
+
+			// Buggy ATI cards *crash* on non-RGB(A) formats
+			int depths[4];
+			PixelUtil::getBitDepths((PixelFormat)x, depths);
+			if(fmt!=GL_NONE && mATIMode && (!depths[0] || !depths[1] || !depths[2]))
+				continue;
+
+            // Create and attach framebuffer
+            glGenFramebuffersEXT(1, &fb);
+            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
+            if (fmt!=GL_NONE)
+            {
+				// Create and attach texture
+				glGenTextures(1, &tid);
+				glBindTexture(target, tid);
+				
+                // Set some default parameters so it won't fail on NVidia cards         
+                glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, 0);
+                glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+                glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+                glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+                glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+                            
+				glTexImage2D(target, 0, fmt, PROBE_SIZE, PROBE_SIZE, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
+				glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
+                                target, tid, 0);
+            }
+			else
+			{
+				// Draw to nowhere -- stencil/depth only
+				glDrawBuffer(GL_NONE);
+				glReadBuffer(GL_NONE);
+			}
+            // Check status
+            GLuint status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+
+			// Ignore status in case of fmt==GL_NONE, because no implementation will accept
+			// a buffer without *any* attachment. Buffers with only stencil and depth attachment
+			// might still be supported, so we must continue probing.
+            if(fmt == GL_NONE || status == GL_FRAMEBUFFER_COMPLETE_EXT)
+            {
+                mProps[x].valid = true;
+				StringUtil::StrStreamType str;
+				str << "FBO " << PixelUtil::getFormatName((PixelFormat)x) 
+					<< " depth/stencil support: ";
+
+                // For each depth/stencil formats
+                for (size_t depth = 0; depth < DEPTHFORMAT_COUNT; ++depth)
+                {
+                    if (depthFormats[depth] != GL_DEPTH24_STENCIL8_EXT)
+                    {
+                        // General depth/stencil combination
+
+                        for (size_t stencil = 0; stencil < STENCILFORMAT_COUNT; ++stencil)
+                        {
+                            //StringUtil::StrStreamType l;
+                            //l << "Trying " << PixelUtil::getFormatName((PixelFormat)x) 
+                            //	<< " D" << depthBits[depth] 
+                            //	<< "S" << stencilBits[stencil];
+                            //LogManager::getSingleton().logMessage(l.str());
+
+                            if (_tryFormat(depthFormats[depth], stencilFormats[stencil]))
+                            {
+                                /// Add mode to allowed modes
+                                str << "D" << depthBits[depth] << "S" << stencilBits[stencil] << " ";
+                                FormatProperties::Mode mode;
+                                mode.depth = depth;
+                                mode.stencil = stencil;
+                                mProps[x].modes.push_back(mode);
+                            }
+                        }
+                    }
+                    else
+                    {
+                        // Packed depth/stencil format
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
+                        // Only query packed depth/stencil formats for 32-bit
+                        // non-floating point formats (ie not R32!) 
+                        // Linux nVidia driver segfaults if you query others
+                        if (PixelUtil::getNumElemBits((PixelFormat)x) != 32 ||
+                            PixelUtil::isFloatingPoint((PixelFormat)x))
+                        {
+                            continue;
+                        }
+#endif
+
+                        if (_tryPackedFormat(depthFormats[depth]))
+                        {
+                            /// Add mode to allowed modes
+                            str << "Packed-D" << depthBits[depth] << "S" << 8 << " ";
+                            FormatProperties::Mode mode;
+                            mode.depth = depth;
+                            mode.stencil = 0;   // unuse
+                            mProps[x].modes.push_back(mode);
+                        }
+                    }
+                }
+
+                LogManager::getSingleton().logMessage(str.str());
+
+            }
+            // Delete texture and framebuffer
+            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+            glDeleteFramebuffersEXT(1, &fb);
+            if (fmt!=GL_NONE)
+                glDeleteTextures(1, &tid);
+        }
+
+        // It seems a bug in nVidia driver: glBindFramebufferEXT should restore
+        // draw and read buffers, but in some unclear circumstances it won't.
+        glDrawBuffer(old_drawbuffer);
+        glReadBuffer(old_readbuffer);
+
+        std::string fmtstring;
+        for(size_t x=0; x<PF_COUNT; ++x)
+        {
+            if(mProps[x].valid)
+                fmtstring += PixelUtil::getFormatName((PixelFormat)x)+" ";
+        }
+        LogManager::getSingleton().logMessage("[GL] : Valid FBO targets " + fmtstring);
+    }
+    void GLFBOManager::getBestDepthStencil(GLenum internalFormat, GLenum *depthFormat, GLenum *stencilFormat)
+    {
+        const FormatProperties &props = mProps[internalFormat];
+        /// Decide what stencil and depth formats to use
+        /// [best supported for internal format]
+        size_t bestmode=0;
+        int bestscore=-1;
+        for(size_t mode=0; mode<props.modes.size(); mode++)
+        {
+#if 0
+            /// Always prefer D24S8
+            if(stencilBits[props.modes[mode].stencil]==8 &&
+                depthBits[props.modes[mode].depth]==24)
+            {
+                bestmode = mode;
+                break;
+            }
+#endif
+            int desirability = 0;
+            /// Find most desirable mode
+            /// desirability == 0            if no depth, no stencil
+            /// desirability == 1000...2000  if no depth, stencil
+            /// desirability == 2000...3000  if depth, no stencil
+            /// desirability == 3000+        if depth and stencil
+            /// beyond this, the total numer of bits (stencil+depth) is maximised
+            if(props.modes[mode].stencil)
+                desirability += 1000;
+            if(props.modes[mode].depth)
+                desirability += 2000;
+            if(depthBits[props.modes[mode].depth]==24) // Prefer 24 bit for now
+                desirability += 500;
+			if(depthFormats[props.modes[mode].depth]==GL_DEPTH24_STENCIL8_EXT) // Prefer 24/8 packed 
+				desirability += 5000;
+            desirability += stencilBits[props.modes[mode].stencil] + depthBits[props.modes[mode].depth];
+            
+            if(desirability>bestscore)
+            {
+                bestscore = desirability;
+                bestmode = mode;
+            }
+        }
+        *depthFormat = depthFormats[props.modes[bestmode].depth];
+        *stencilFormat = stencilFormats[props.modes[bestmode].stencil];
+    }
+
+    GLFBORenderTexture *GLFBOManager::createRenderTexture(const String &name, const GLSurfaceDesc &target)
+    {
+        GLFBORenderTexture *retval = new GLFBORenderTexture(this, name, target);
+        return retval;
+    }
+	MultiRenderTarget *GLFBOManager::createMultiRenderTarget(const String & name)
+	{
+		return new GLFBOMultiRenderTarget(this, name);
+	}
+
+    GLFrameBufferObject *GLFBOManager::createFrameBufferObject()
+    {
+        return new GLFrameBufferObject(this);
+    }
+
+    void GLFBOManager::destroyFrameBufferObject(GLFrameBufferObject * x)
+    {
+        delete x;
+    }
+    void GLFBOManager::bind(RenderTarget *target)
+    {
+        /// Check if the render target is in the rendertarget->FBO map
+        GLFrameBufferObject *fbo = 0;
+        target->getCustomAttribute("FBO", &fbo);
+        if(fbo)
+            fbo->bind();
+        else
+            // Old style context (window/pbuffer) or copying render texture
+            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+    }
+    
+    GLSurfaceDesc GLFBOManager::requestRenderBuffer(GLenum format, size_t width, size_t height)
+    {
+        GLSurfaceDesc retval;
+        retval.buffer = 0; // Return 0 buffer if GL_NONE is requested
+        if(format != GL_NONE)
+        {
+            RBFormat key(format, width, height);
+            RenderBufferMap::iterator it = mRenderBufferMap.find(key);
+            if(it != mRenderBufferMap.end())
+            {
+                retval.buffer = it->second.buffer;
+                retval.zoffset = 0;
+                // Increase refcount
+                ++it->second.refcount;
+            }
+            else
+            {
+                // New one
+                GLRenderBuffer *rb = new GLRenderBuffer(format, width, height);
+                mRenderBufferMap[key] = RBRef(rb);
+                retval.buffer = rb;
+                retval.zoffset = 0;
+            }
+        }
+        //std::cerr << "Requested renderbuffer with format " << std::hex << format << std::dec << " of " << width << "x" << height << " :" << retval.buffer << std::endl;
+        return retval;
+    }
+    //-----------------------------------------------------------------------
+    void GLFBOManager::requestRenderBuffer(const GLSurfaceDesc &surface)
+    {
+        if(surface.buffer == 0)
+            return;
+        RBFormat key(surface.buffer->getGLFormat(), surface.buffer->getWidth(), surface.buffer->getHeight());
+        RenderBufferMap::iterator it = mRenderBufferMap.find(key);
+        assert(it != mRenderBufferMap.end());
+        if (it != mRenderBufferMap.end())   // Just in case
+        {
+            assert(it->second.buffer == surface.buffer);
+            // Increase refcount
+            ++it->second.refcount;
+        }
+    }
+    //-----------------------------------------------------------------------
+    void GLFBOManager::releaseRenderBuffer(const GLSurfaceDesc &surface)
+    {
+        if(surface.buffer == 0)
+            return;
+        RBFormat key(surface.buffer->getGLFormat(), surface.buffer->getWidth(), surface.buffer->getHeight());
+        RenderBufferMap::iterator it = mRenderBufferMap.find(key);
+        if(it != mRenderBufferMap.end())
+		{
+			// Decrease refcount
+			--it->second.refcount;
+			if(it->second.refcount==0)
+			{
+				// If refcount reaches zero, delete buffer and remove from map
+				delete it->second.buffer;
+				mRenderBufferMap.erase(it);
+				//std::cerr << "Destroyed renderbuffer of format " << std::hex << key.format << std::dec
+				//        << " of " << key.width << "x" << key.height << std::endl;
+			}
+		}
+    }
+}
Index: /RenderSystems/GL/src/OgreGLFrameBufferObject.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLFrameBufferObject.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLFrameBufferObject.cpp	(revision 5)
@@ -0,0 +1,240 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLFrameBufferObject.h"
+#include "OgreGLPixelFormat.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreRoot.h"
+#include "OgreGLHardwarePixelBuffer.h"
+#include "OgreGLFBORenderTexture.h"
+
+namespace Ogre {
+
+//-----------------------------------------------------------------------------
+    GLFrameBufferObject::GLFrameBufferObject(GLFBOManager *manager):
+        mManager(manager)
+    {
+        /// Generate framebuffer object
+        glGenFramebuffersEXT(1, &mFB);
+        /// Initialise state
+        mDepth.buffer=0;
+        mStencil.buffer=0;
+        for(size_t x=0; x<OGRE_MAX_MULTIPLE_RENDER_TARGETS; ++x)
+        {
+            mColour[x].buffer=0;
+        }
+    }
+    GLFrameBufferObject::~GLFrameBufferObject()
+    {
+        mManager->releaseRenderBuffer(mDepth);
+        mManager->releaseRenderBuffer(mStencil);
+        /// Delete framebuffer object
+        glDeleteFramebuffersEXT(1, &mFB);        
+    }
+    void GLFrameBufferObject::bindSurface(size_t attachment, const GLSurfaceDesc &target)
+    {
+        assert(attachment < OGRE_MAX_MULTIPLE_RENDER_TARGETS);
+        mColour[attachment] = target;
+		// Re-initialise
+		if(mColour[0].buffer)
+			initialise();
+    }
+    void GLFrameBufferObject::unbindSurface(size_t attachment)
+    {
+        assert(attachment < OGRE_MAX_MULTIPLE_RENDER_TARGETS);
+        mColour[attachment].buffer = 0;
+		// Re-initialise if buffer 0 still bound
+		if(mColour[0].buffer)
+		{
+			initialise();
+		}
+    }
+    void GLFrameBufferObject::initialise()
+    {
+		// Release depth and stencil, if they were bound
+        mManager->releaseRenderBuffer(mDepth);
+        mManager->releaseRenderBuffer(mStencil);
+        /// First buffer must be bound
+        if(!mColour[0].buffer)
+        {
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+            "Attachment 0 must have surface attached",
+		 	"GLFrameBufferObject::initialise");
+        }
+        /// Bind FBO to frame buffer
+        bind();
+        /// Store basic stats
+        size_t width = mColour[0].buffer->getWidth();
+        size_t height = mColour[0].buffer->getHeight();
+        GLuint format = mColour[0].buffer->getGLFormat();
+        PixelFormat ogreFormat = mColour[0].buffer->getFormat();
+        /// Bind all attachment points to frame buffer
+        for(size_t x=0; x<OGRE_MAX_MULTIPLE_RENDER_TARGETS; ++x)
+        {
+            if(mColour[x].buffer)
+            {
+                if(mColour[x].buffer->getWidth() != width || mColour[x].buffer->getHeight() != height)
+                {
+                    std::stringstream ss;
+                    ss << "Attachment " << x << " has incompatible size ";
+                    ss << mColour[x].buffer->getWidth() << "x" << mColour[x].buffer->getHeight();
+                    ss << ". It must be of the same as the size of surface 0, ";
+                    ss << width << "x" << height;
+                    ss << ".";
+                    OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, ss.str(), "GLFrameBufferObject::initialise");
+                }
+                if(mColour[x].buffer->getGLFormat() != format)
+                {
+                    std::stringstream ss;
+                    ss << "Attachment " << x << " has incompatible format.";
+                    OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, ss.str(), "GLFrameBufferObject::initialise");
+                }
+	            mColour[x].buffer->bindToFramebuffer(GL_COLOR_ATTACHMENT0_EXT+x, mColour[x].zoffset);
+            }
+            else
+            {
+                // Detach
+                glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT+x,
+                    GL_RENDERBUFFER_EXT, 0);
+            }
+        }
+        /// Find suitable depth and stencil format that is compatible with colour format
+        GLenum depthFormat, stencilFormat;
+        mManager->getBestDepthStencil(ogreFormat, &depthFormat, &stencilFormat);
+        
+        /// Request surfaces
+        mDepth = mManager->requestRenderBuffer(depthFormat, width, height);
+		if (depthFormat == GL_DEPTH24_STENCIL8_EXT)
+		{
+			// bind same buffer to depth and stencil attachments
+            mManager->requestRenderBuffer(mDepth);
+			mStencil = mDepth;
+		}
+		else
+		{
+			// separate stencil
+			mStencil = mManager->requestRenderBuffer(stencilFormat, width, height);
+		}
+        
+        /// Attach/detach surfaces
+        if(mDepth.buffer)
+        {
+            mDepth.buffer->bindToFramebuffer(GL_DEPTH_ATTACHMENT_EXT, mDepth.zoffset);
+        }
+        else
+        {
+            glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
+                GL_RENDERBUFFER_EXT, 0);
+        }
+        if(mStencil.buffer)
+        {
+            mStencil.buffer->bindToFramebuffer(GL_STENCIL_ATTACHMENT_EXT, mStencil.zoffset);
+        }
+        else
+        {
+            glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
+                GL_RENDERBUFFER_EXT, 0);
+        }
+
+		/// Do glDrawBuffer calls
+		GLenum bufs[OGRE_MAX_MULTIPLE_RENDER_TARGETS];
+		GLsizei n=0;
+		for(size_t x=0; x<OGRE_MAX_MULTIPLE_RENDER_TARGETS; ++x)
+		{
+			// Fill attached colour buffers
+			if(mColour[x].buffer)
+			{
+				bufs[x] = GL_COLOR_ATTACHMENT0_EXT + x;
+				// Keep highest used buffer + 1
+				n = x+1;
+			}
+			else
+			{
+				bufs[x] = GL_NONE;
+			}
+		}
+		if(glDrawBuffers)
+		{
+			/// Drawbuffer extension supported, use it
+			glDrawBuffers(n, bufs);
+		}
+		else
+		{
+			/// In this case, the capabilities will not show more than 1 simultaneaous render target.
+			glDrawBuffer(bufs[0]);
+		}
+		/// No read buffer, by default, if we want to read anyway we must not forget to set this.
+		glReadBuffer(GL_NONE);
+        
+        /// Check status
+        GLuint status;
+        status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+        
+        /// Bind main buffer
+        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+        
+        switch(status)
+        {
+        case GL_FRAMEBUFFER_COMPLETE_EXT:
+            // All is good
+            break;
+        case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+            "All framebuffer formats with this texture internal format unsupported",
+		 	"GLFrameBufferObject::initialise");
+        default:
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+            "Framebuffer incomplete or other FBO status error",
+		 	"GLFrameBufferObject::initialise");
+        }
+        
+    }
+    void GLFrameBufferObject::bind()
+    {
+        /// Bind it to FBO
+        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mFB);
+    }
+    size_t GLFrameBufferObject::getWidth()
+    {
+        assert(mColour[0].buffer);
+        return mColour[0].buffer->getWidth();
+    }
+    size_t GLFrameBufferObject::getHeight()
+    {
+        assert(mColour[0].buffer);
+        return mColour[0].buffer->getHeight();
+    }
+    PixelFormat GLFrameBufferObject::getFormat()
+    {
+        assert(mColour[0].buffer);
+        return mColour[0].buffer->getFormat();
+    }
+//-----------------------------------------------------------------------------
+}
Index: /RenderSystems/GL/src/OgreGLGpuNvparseProgram.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLGpuNvparseProgram.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLGpuNvparseProgram.cpp	(revision 5)
@@ -0,0 +1,117 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLGpuNvparseProgram.h"
+#include "OgreException.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreRenderSystemCapabilities.h"
+#include "OgreLogManager.h"
+#include "nvparse.h"
+
+using namespace Ogre;
+
+GLGpuNvparseProgram::GLGpuNvparseProgram(ResourceManager* creator, 
+        const String& name, ResourceHandle handle, 
+        const String& group, bool isManual, ManualResourceLoader* loader) 
+        : GLGpuProgram(creator, name, handle, group, isManual, loader)
+{
+    mProgramID = glGenLists(1);
+}
+
+GLGpuNvparseProgram::~GLGpuNvparseProgram()
+{
+    // have to call this here reather than in Resource destructor
+    // since calling virtual methods in base destructors causes crash
+    unload(); 
+}
+
+void GLGpuNvparseProgram::bindProgram(void)
+{
+     glCallList(mProgramID);
+     glEnable(GL_TEXTURE_SHADER_NV);
+     glEnable(GL_REGISTER_COMBINERS_NV);
+     glEnable(GL_PER_STAGE_CONSTANTS_NV);
+}
+
+void GLGpuNvparseProgram::unbindProgram(void)
+{
+
+    glDisable(GL_TEXTURE_SHADER_NV);
+    glDisable(GL_REGISTER_COMBINERS_NV);
+    glDisable(GL_PER_STAGE_CONSTANTS_NV);
+}
+
+void GLGpuNvparseProgram::bindProgramParameters(GpuProgramParametersSharedPtr params)
+{
+    // NB, register combiners uses 2 constants per texture stage (0 and 1)
+    // We have stored these as (stage * 2) + const_index in the physical buffer
+	// There are no other parameters in a register combiners shader
+	const GpuProgramParameters::FloatConstantList& floatList = 
+		params->getFloatConstantList();
+	size_t index = 0;
+	for (GpuProgramParameters::FloatConstantList::const_iterator i = floatList.begin();
+		i != floatList.end(); ++i, ++index)
+	{
+		GLenum combinerStage = GL_COMBINER0_NV + (unsigned int)(index / 2);
+		GLenum pname = GL_CONSTANT_COLOR0_NV + (index % 2);
+		glCombinerStageParameterfvNV(combinerStage, pname, &(*i));
+		
+	}
+
+}
+void GLGpuNvparseProgram::unloadImpl(void)
+{
+    glDeleteLists(mProgramID,1);
+}
+
+void GLGpuNvparseProgram::loadFromSource(void)
+{
+    glNewList(mProgramID, GL_COMPILE);
+
+    String::size_type pos = mSource.find("!!");
+
+    while (pos != String::npos) {
+        String::size_type newPos = mSource.find("!!", pos + 1);
+
+        String script = mSource.substr(pos, newPos - pos);
+        nvparse(script.c_str(), 0);
+
+        for (char* const * errors= nvparse_get_errors(); *errors; errors++)
+        {
+            LogManager::getSingleton().logMessage("Warning: nvparse reported the following errors:");
+            LogManager::getSingleton().logMessage("\t" + String(*errors));
+        }
+        
+        pos = newPos;
+    }
+
+    glEndList();
+}
+
Index: /RenderSystems/GL/src/OgreGLGpuProgram.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLGpuProgram.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLGpuProgram.cpp	(revision 5)
@@ -0,0 +1,195 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLGpuProgram.h"
+#include "OgreException.h"
+#include "OgreStringConverter.h"
+
+using namespace Ogre;
+
+GLGpuProgram::GLGpuProgram(ResourceManager* creator, const String& name, 
+    ResourceHandle handle, const String& group, bool isManual, 
+    ManualResourceLoader* loader) 
+    : GpuProgram(creator, name, handle, group, isManual, loader)
+{
+    if (createParamDictionary("GLGpuProgram"))
+    {
+        setupBaseParamDictionary();
+    }
+}
+
+GLGpuProgram::~GLGpuProgram()
+{
+    // have to call this here reather than in Resource destructor
+    // since calling virtual methods in base destructors causes crash
+    unload(); 
+}
+
+GLuint GLGpuProgram::getAttributeIndex(VertexElementSemantic semantic)
+{
+	// default implementation
+	switch(semantic)
+	{
+		case VES_POSITION:
+		case VES_NORMAL:
+		case VES_DIFFUSE:
+		case VES_SPECULAR:
+		case VES_TEXTURE_COORDINATES:
+			assert(false && "Shouldn't be calling this for standard attributes!");
+			break;
+		case VES_BLEND_INDICES:
+			return 7; // default binding
+		case VES_BLEND_WEIGHTS:
+			return 1; // default binding
+		case VES_TANGENT:
+			return 14; // default binding
+		case VES_BINORMAL:
+			return 15; // default binding
+	}
+
+	return 0;
+}
+
+bool GLGpuProgram::isAttributeValid(VertexElementSemantic semantic)
+{
+	// default implementation
+	switch(semantic)
+	{
+		case VES_POSITION:
+		case VES_NORMAL:
+		case VES_DIFFUSE:
+		case VES_SPECULAR:
+		case VES_TEXTURE_COORDINATES:
+			assert(false && "Shouldn't be calling this for standard attributes!");
+			break;
+		case VES_BLEND_WEIGHTS:
+		case VES_BLEND_INDICES:
+		case VES_BINORMAL:
+		case VES_TANGENT:
+			return true; // with default binding
+	}
+
+    return false;
+}
+
+GLArbGpuProgram::GLArbGpuProgram(ResourceManager* creator, const String& name, 
+    ResourceHandle handle, const String& group, bool isManual, 
+    ManualResourceLoader* loader) 
+    : GLGpuProgram(creator, name, handle, group, isManual, loader)
+{
+    glGenProgramsARB(1, &mProgramID);
+}
+
+GLArbGpuProgram::~GLArbGpuProgram()
+{
+    // have to call this here reather than in Resource destructor
+    // since calling virtual methods in base destructors causes crash
+    unload(); 
+}
+
+void GLArbGpuProgram::setType(GpuProgramType t)
+{
+    GLGpuProgram::setType(t);
+    mProgramType = (mType == GPT_VERTEX_PROGRAM) ? GL_VERTEX_PROGRAM_ARB : GL_FRAGMENT_PROGRAM_ARB;
+}
+
+void GLArbGpuProgram::bindProgram(void)
+{
+    glEnable(mProgramType);
+    glBindProgramARB(mProgramType, mProgramID);
+}
+
+void GLArbGpuProgram::unbindProgram(void)
+{
+    glBindProgramARB(mProgramType, 0);
+    glDisable(mProgramType);
+}
+
+void GLArbGpuProgram::bindProgramParameters(GpuProgramParametersSharedPtr params)
+{
+    GLenum type = (mType == GPT_VERTEX_PROGRAM) ? 
+        GL_VERTEX_PROGRAM_ARB : GL_FRAGMENT_PROGRAM_ARB;
+    
+	// only supports float constants
+	const GpuLogicalBufferStruct* floatStruct = params->getFloatLogicalBufferStruct();
+
+	for (GpuLogicalIndexUseMap::const_iterator i = floatStruct->map.begin();
+		i != floatStruct->map.end(); ++i)
+	{
+		size_t logicalIndex = i->first;
+		const float* pFloat = params->getFloatPointer(i->second.physicalIndex);
+		// Iterate over the params, set in 4-float chunks (low-level)
+		for (size_t j = 0; j < i->second.currentSize; j+=4)
+		{
+			glProgramLocalParameter4fvARB(type, logicalIndex, pFloat);
+			pFloat += 4;
+			++logicalIndex;
+		}
+	}
+}
+
+void GLArbGpuProgram::bindProgramPassIterationParameters(GpuProgramParametersSharedPtr params)
+{
+    if (params->hasPassIterationNumber())
+    {
+		GLenum type = (mType == GPT_VERTEX_PROGRAM) ? 
+			GL_VERTEX_PROGRAM_ARB : GL_FRAGMENT_PROGRAM_ARB;
+
+		size_t physicalIndex = params->getPassIterationNumberIndex();
+		size_t logicalIndex = params->getFloatLogicalIndexForPhysicalIndex(physicalIndex);
+		const float* pFloat = params->getFloatPointer(physicalIndex);
+        glProgramLocalParameter4fvARB(type, (GLuint)logicalIndex, pFloat);
+    }
+
+}
+
+void GLArbGpuProgram::unloadImpl(void)
+{
+    glDeleteProgramsARB(1, &mProgramID);
+}
+
+void GLArbGpuProgram::loadFromSource(void)
+{
+    glBindProgramARB(mProgramType, mProgramID);
+    glProgramStringARB(mProgramType, GL_PROGRAM_FORMAT_ASCII_ARB, (GLsizei)mSource.length(), mSource.c_str());
+
+    if (GL_INVALID_OPERATION == glGetError())
+    {
+        GLint errPos;
+        glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errPos);
+		String errPosStr = StringConverter::toString(errPos);
+        char* errStr = (char*)glGetString(GL_PROGRAM_ERROR_STRING_ARB);
+        // XXX New exception code?
+        OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+            "Cannot load GL vertex program " + mName + 
+            ".  Line " + errPosStr + ":\n" + errStr, mName);
+    }
+    glBindProgramARB(mProgramType, 0);
+}
+
Index: /RenderSystems/GL/src/OgreGLGpuProgramManager.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLGpuProgramManager.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLGpuProgramManager.cpp	(revision 5)
@@ -0,0 +1,112 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLGpuProgramManager.h"
+#include "OgreGLGpuProgram.h"
+#include "OgreLogManager.h"
+
+using namespace Ogre;
+
+GLGpuProgramManager::GLGpuProgramManager()
+{
+    // Superclass sets up members 
+
+    // Register with resource group manager
+    ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
+}
+
+
+GLGpuProgramManager::~GLGpuProgramManager()
+{
+    // Unregister with resource group manager
+    ResourceGroupManager::getSingleton()._unregisterResourceManager(mResourceType);
+}
+
+bool GLGpuProgramManager::registerProgramFactory(const String& syntaxCode, CreateGpuProgramCallback createFn)
+{
+    return mProgramMap.insert(ProgramMap::value_type(syntaxCode, createFn)).second;
+}
+
+bool GLGpuProgramManager::unregisterProgramFactory(const String& syntaxCode)
+{
+    return mProgramMap.erase(syntaxCode) != 0;
+}
+
+/// @copydoc ResourceManager::createImpl
+Resource* GLGpuProgramManager::createImpl(const String& name, ResourceHandle handle, 
+                     const String& group, bool isManual, ManualResourceLoader* loader,
+                     const NameValuePairList* params)
+{
+    NameValuePairList::const_iterator paramSyntax, paramType;
+
+    if (!params || (paramSyntax = params->find("syntax")) == params->end() ||
+        (paramType = params->find("type")) == params->end())
+    {
+        OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+            "You must supply 'syntax' and 'type' parameters",
+            "GLGpuProgramManager::createImpl");
+    }
+
+    ProgramMap::const_iterator iter = mProgramMap.find(paramSyntax->second);
+    if(iter == mProgramMap.end())
+    {
+        // No factory, this is an unsupported syntax code, probably for another rendersystem
+        // Create a basic one, it doesn't matter what it is since it won't be used
+        return new GLGpuProgram(this, name, handle, group, isManual, loader);
+    }
+
+    GpuProgramType gpt;
+    if (paramType->second == "vertex_program")
+    {
+        gpt = GPT_VERTEX_PROGRAM;
+    }
+    else
+    {
+        gpt = GPT_FRAGMENT_PROGRAM;
+    }
+
+    return (iter->second)(this, name, handle, group, isManual, loader, gpt, paramSyntax->second);
+
+}
+
+Resource* GLGpuProgramManager::createImpl(const String& name, ResourceHandle handle, 
+                     const String& group, bool isManual, ManualResourceLoader* loader,
+                     GpuProgramType gptype, const String& syntaxCode)
+{
+    ProgramMap::const_iterator iter = mProgramMap.find(syntaxCode);
+    if(iter == mProgramMap.end())
+    {
+        // No factory, this is an unsupported syntax code, probably for another rendersystem
+        // Create a basic one, it doesn't matter what it is since it won't be used
+        return new GLGpuProgram(this, name, handle, group, isManual, loader);
+    }
+    
+    return (iter->second)(this, name, handle, group, isManual, loader, gptype, syntaxCode);
+}
+
Index: /RenderSystems/GL/src/OgreGLHardwareBufferManager.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLHardwareBufferManager.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLHardwareBufferManager.cpp	(revision 5)
@@ -0,0 +1,241 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreGLHardwareBufferManager.h"
+#include "OgreGLHardwareVertexBuffer.h"
+#include "OgreGLHardwareIndexBuffer.h"
+#include "OgreHardwareBuffer.h"
+#include "OgreAlignedAllocator.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------
+	// Scratch pool management (32 bit structure)
+	struct GLScratchBufferAlloc
+	{
+		/// Size in bytes
+		uint32 size: 31;
+		/// Free? (pack with size)
+		uint32 free: 1;
+	};
+	#define SCRATCH_POOL_SIZE 1 * 1024 * 1024
+	//---------------------------------------------------------------------
+    GLHardwareBufferManager::GLHardwareBufferManager()
+    {
+		// Init scratch pool
+		// TODO make it a configurable size?
+		// 32-bit aligned buffer
+		mScratchBufferPool = static_cast<char*>(AlignedMemory::allocate(SCRATCH_POOL_SIZE, 32));
+		GLScratchBufferAlloc* ptrAlloc = (GLScratchBufferAlloc*)mScratchBufferPool;
+		ptrAlloc->size = SCRATCH_POOL_SIZE - sizeof(GLScratchBufferAlloc);
+		ptrAlloc->free = 1;
+    }
+    //-----------------------------------------------------------------------
+    GLHardwareBufferManager::~GLHardwareBufferManager()
+    {
+        destroyAllDeclarations();
+        destroyAllBindings();
+
+		AlignedMemory::deallocate(mScratchBufferPool);
+    }
+    //-----------------------------------------------------------------------
+    HardwareVertexBufferSharedPtr GLHardwareBufferManager::createVertexBuffer(
+        size_t vertexSize, size_t numVerts, HardwareBuffer::Usage usage, bool useShadowBuffer)
+    {
+		GLHardwareVertexBuffer* buf = 
+			new GLHardwareVertexBuffer(vertexSize, numVerts, usage, useShadowBuffer);
+		{
+			OGRE_LOCK_MUTEX(mVertexBuffersMutex)
+			mVertexBuffers.insert(buf);
+		}
+		return HardwareVertexBufferSharedPtr(buf);
+    }
+    //-----------------------------------------------------------------------
+    HardwareIndexBufferSharedPtr 
+    GLHardwareBufferManager::createIndexBuffer(
+        HardwareIndexBuffer::IndexType itype, size_t numIndexes, 
+        HardwareBuffer::Usage usage, bool useShadowBuffer)
+    {
+		GLHardwareIndexBuffer* buf = 
+			new GLHardwareIndexBuffer(itype, numIndexes, usage, useShadowBuffer);
+		{
+			OGRE_LOCK_MUTEX(mIndexBuffersMutex)
+			mIndexBuffers.insert(buf);
+		}
+		return HardwareIndexBufferSharedPtr(buf);
+    }
+    //---------------------------------------------------------------------
+    GLenum GLHardwareBufferManager::getGLUsage(unsigned int usage)
+    {
+        switch(usage)
+        {
+        case HardwareBuffer::HBU_STATIC:
+        case HardwareBuffer::HBU_STATIC_WRITE_ONLY:
+            return GL_STATIC_DRAW_ARB;
+        case HardwareBuffer::HBU_DYNAMIC:
+        case HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY:
+            return GL_DYNAMIC_DRAW_ARB;
+        case HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE:
+            return GL_STREAM_DRAW_ARB;
+        default:
+            return GL_DYNAMIC_DRAW_ARB;
+        };
+    }
+    //---------------------------------------------------------------------
+    GLenum GLHardwareBufferManager::getGLType(unsigned int type)
+    {
+        switch(type)
+        {
+            case VET_FLOAT1:
+            case VET_FLOAT2:
+            case VET_FLOAT3:
+            case VET_FLOAT4:
+                return GL_FLOAT;
+            case VET_SHORT1:
+            case VET_SHORT2:
+            case VET_SHORT3:
+            case VET_SHORT4:
+                return GL_SHORT;
+            case VET_COLOUR:
+			case VET_COLOUR_ABGR:
+			case VET_COLOUR_ARGB:
+            case VET_UBYTE4:
+                return GL_UNSIGNED_BYTE;
+            default:
+                return 0;
+        };
+    }
+	//---------------------------------------------------------------------
+	//---------------------------------------------------------------------
+	void* GLHardwareBufferManager::allocateScratch(uint32 size)
+	{
+		// simple forward link search based on alloc sizes
+		// not that fast but the list should never get that long since not many
+		// locks at once (hopefully)
+		OGRE_LOCK_MUTEX(mScratchMutex)
+
+
+		// Alignment - round up the size to 32 bits
+		// control blocks are 32 bits too so this packs nicely
+		if (size % 4 != 0)
+		{
+			size += 4 - (size % 4);
+		}
+
+		uint32 bufferPos = 0;
+		while (bufferPos < SCRATCH_POOL_SIZE)
+		{
+			GLScratchBufferAlloc* pNext = (GLScratchBufferAlloc*)(mScratchBufferPool + bufferPos);
+			// Big enough?
+			if (pNext->free && pNext->size >= size)
+			{
+				// split? And enough space for control block
+				if(pNext->size > size + sizeof(GLScratchBufferAlloc))
+				{
+					uint32 offset = sizeof(GLScratchBufferAlloc) + size;
+
+					GLScratchBufferAlloc* pSplitAlloc = (GLScratchBufferAlloc*)
+						(mScratchBufferPool + bufferPos + offset);
+					pSplitAlloc->free = 1;
+					// split size is remainder minus new control block
+					pSplitAlloc->size = pNext->size - size - sizeof(GLScratchBufferAlloc);
+
+					// New size of current
+					pNext->size = size;
+				}
+				// allocate and return
+				pNext->free = 0;
+
+				// return pointer just after this control block (++ will do that for us)
+				return ++pNext;
+
+			}
+
+			bufferPos += sizeof(GLScratchBufferAlloc) + pNext->size;
+
+		}
+
+		// no available alloc
+		return 0;
+
+	}
+	//---------------------------------------------------------------------
+	void GLHardwareBufferManager::deallocateScratch(void* ptr)
+	{
+		OGRE_LOCK_MUTEX(mScratchMutex)
+
+		// Simple linear search dealloc
+		uint32 bufferPos = 0;
+		GLScratchBufferAlloc* pLast = 0;
+		while (bufferPos < SCRATCH_POOL_SIZE)
+		{
+			GLScratchBufferAlloc* pCurrent = (GLScratchBufferAlloc*)(mScratchBufferPool + bufferPos);
+			
+			// Pointers match?
+			if ((mScratchBufferPool + bufferPos + sizeof(GLScratchBufferAlloc))
+				== ptr)
+			{
+				// dealloc
+				pCurrent->free = 1;
+				
+				// merge with previous
+				if (pLast && pLast->free)
+				{
+					// adjust buffer pos
+					bufferPos -= (pLast->size + sizeof(GLScratchBufferAlloc));
+					// merge free space
+					pLast->size += pCurrent->size + sizeof(GLScratchBufferAlloc);
+					pCurrent = pLast;
+				}
+
+				// merge with next
+				uint32 offset = bufferPos + pCurrent->size + sizeof(GLScratchBufferAlloc);
+				if (offset < SCRATCH_POOL_SIZE)
+				{
+					GLScratchBufferAlloc* pNext = (GLScratchBufferAlloc*)(
+						mScratchBufferPool + offset);
+					if (pNext->free)
+					{
+						pCurrent->size += pNext->size + sizeof(GLScratchBufferAlloc);
+					}
+				}
+
+				// done
+				return;
+			}
+
+			bufferPos += sizeof(GLScratchBufferAlloc) + pCurrent->size;
+			pLast = pCurrent;
+
+		}
+
+		// Should never get here unless there's a corruption
+		assert (false && "Memory deallocation error");
+
+
+	}
+}
Index: /RenderSystems/GL/src/OgreGLHardwareIndexBuffer.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLHardwareIndexBuffer.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLHardwareIndexBuffer.cpp	(revision 5)
@@ -0,0 +1,242 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreGLHardwareIndexBuffer.h"
+#include "OgreGLHardwareBufferManager.h"
+#include "OgreException.h"
+
+namespace Ogre {
+
+	//---------------------------------------------------------------------
+    GLHardwareIndexBuffer::GLHardwareIndexBuffer(IndexType idxType,
+        size_t numIndexes, HardwareBuffer::Usage usage, bool useShadowBuffer)
+        : HardwareIndexBuffer(idxType, numIndexes, usage, false, useShadowBuffer)
+    {
+        glGenBuffersARB( 1, &mBufferId );
+
+        if (!mBufferId)
+        {
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+                "Cannot create GL index buffer", 
+                "GLHardwareIndexBuffer::GLHardwareIndexBuffer");
+        }
+
+        glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mBufferId);
+
+        // Initialise buffer and set usage
+        glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mSizeInBytes, NULL, 
+            GLHardwareBufferManager::getGLUsage(usage));
+
+        //std::cerr << "creating index buffer " << mBufferId << std::endl;
+    }
+	//---------------------------------------------------------------------
+    GLHardwareIndexBuffer::~GLHardwareIndexBuffer()
+    {
+        glDeleteBuffersARB(1, &mBufferId);
+    }
+	//---------------------------------------------------------------------
+    void* GLHardwareIndexBuffer::lockImpl(size_t offset, 
+        size_t length, LockOptions options)
+    {
+        GLenum access = 0;
+
+        if(mIsLocked)
+        {
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+                "Invalid attempt to lock an index buffer that has already been locked",
+                    "GLHardwareIndexBuffer::lock");
+        }
+
+        
+		void* retPtr = 0;
+
+		// Try to use scratch buffers for smaller buffers
+		if(length < OGRE_GL_MAP_BUFFER_THRESHOLD)
+		{
+			retPtr = static_cast<GLHardwareBufferManager*>(
+				HardwareBufferManager::getSingletonPtr())->allocateScratch((uint32)length);
+			if (retPtr)
+			{
+				mLockedToScratch = true;
+				mScratchOffset = offset;
+				mScratchSize = length;
+				mScratchPtr = retPtr;
+				mScratchUploadOnUnlock = (options != HBL_READ_ONLY);
+
+				if (options != HBL_DISCARD)
+				{
+					// have to read back the data before returning the pointer
+					readData(offset, length, retPtr);
+				}
+			}
+		}
+
+		if (!retPtr)
+		{
+			glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, mBufferId );
+			// Use glMapBuffer
+			if(options == HBL_DISCARD)
+			{
+				// Discard the buffer
+				glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mSizeInBytes, NULL, 
+					GLHardwareBufferManager::getGLUsage(mUsage));
+			}
+			if (mUsage & HBU_WRITE_ONLY)
+				access = GL_WRITE_ONLY_ARB;
+			else if (options == HBL_READ_ONLY)
+				access = GL_READ_ONLY_ARB;
+			else
+				access = GL_READ_WRITE_ARB;
+
+			void* pBuffer = glMapBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, access );
+
+			if(pBuffer == 0)
+			{
+				OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+					"Index Buffer: Out of memory", 
+					"GLHardwareIndexBuffer::lock");
+			}
+
+			// return offsetted
+			retPtr = static_cast<void*>(
+				static_cast<unsigned char*>(pBuffer) + offset);
+
+			mLockedToScratch = false;
+
+		}
+		mIsLocked = true;
+		return retPtr;
+    }
+	//---------------------------------------------------------------------
+	void GLHardwareIndexBuffer::unlockImpl(void)
+    {
+		if (mLockedToScratch)
+		{
+			if (mScratchUploadOnUnlock)
+			{
+				// have to write the data back to vertex buffer
+				writeData(mScratchOffset, mScratchSize, mScratchPtr, 
+					mScratchOffset == 0 && mScratchSize == getSizeInBytes());
+			}
+
+			// deallocate from scratch buffer
+			static_cast<GLHardwareBufferManager*>(
+				HardwareBufferManager::getSingletonPtr())->deallocateScratch(mScratchPtr);
+
+			mLockedToScratch = false;
+		}
+		else
+		{
+
+			glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, mBufferId );
+
+			if(!glUnmapBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB ))
+			{
+				OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+					"Buffer data corrupted, please reload", 
+					"GLHardwareIndexBuffer::unlock");
+			}
+		}
+
+        mIsLocked = false;
+    }
+	//---------------------------------------------------------------------
+    void GLHardwareIndexBuffer::readData(size_t offset, size_t length, 
+        void* pDest)
+    {
+        if(mUseShadowBuffer)
+        {
+            // get data from the shadow buffer
+            void* srcData = mpShadowBuffer->lock(offset, length, HBL_READ_ONLY);
+            memcpy(pDest, srcData, length);
+            mpShadowBuffer->unlock();
+        }
+        else
+        {
+            glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, mBufferId );
+            glGetBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length, pDest);
+        }
+    }
+	//---------------------------------------------------------------------
+    void GLHardwareIndexBuffer::writeData(size_t offset, size_t length, 
+            const void* pSource, bool discardWholeBuffer)
+    {
+        glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, mBufferId );
+
+        // Update the shadow buffer
+        if(mUseShadowBuffer)
+        {
+            void* destData = mpShadowBuffer->lock(offset, length, 
+                discardWholeBuffer ? HBL_DISCARD : HBL_NORMAL);
+            memcpy(destData, pSource, length);
+            mpShadowBuffer->unlock();
+        }
+
+        if (offset == 0 && length == mSizeInBytes)
+        {
+            glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mSizeInBytes, pSource,
+                GLHardwareBufferManager::getGLUsage(mUsage));
+        }
+        else
+        {
+            if(discardWholeBuffer)
+            {
+                glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mSizeInBytes, NULL,
+                    GLHardwareBufferManager::getGLUsage(mUsage));
+            }
+
+            // Now update the real buffer
+            glBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length, pSource);
+        }
+    }
+	//---------------------------------------------------------------------
+    void GLHardwareIndexBuffer::_updateFromShadow(void)
+    {
+        if (mUseShadowBuffer && mShadowUpdated && !mSuppressHardwareUpdate)
+        {
+            const void *srcData = mpShadowBuffer->lock(
+                mLockStart, mLockSize, HBL_READ_ONLY);
+
+            glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mBufferId);
+
+            // Update whole buffer if possible, otherwise normal
+            if (mLockStart == 0 && mLockSize == mSizeInBytes)
+            {
+                glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mSizeInBytes, srcData,
+                    GLHardwareBufferManager::getGLUsage(mUsage));
+            }
+            else
+            {
+                glBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mLockStart, mLockSize, srcData);
+            }
+
+            mpShadowBuffer->unlock();
+            mShadowUpdated = false;
+        }
+    }
+}
Index: /RenderSystems/GL/src/OgreGLHardwareOcclusionQuery.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLHardwareOcclusionQuery.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLHardwareOcclusionQuery.cpp	(revision 5)
@@ -0,0 +1,147 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLHardwareOcclusionQuery.h"
+#include "OgreException.h"
+
+namespace Ogre {
+
+/**
+  * This is a class that is the base class of the query class for 
+  * hardware occlusion testing.
+  *
+  * @author Lee Sandberg email: lee@abcmedia.se
+  *
+  * Updated on 12/7/2004 by Chris McGuirk
+  * - Implemented ARB_occlusion_query
+  * Updated on 13/9/2005 by Tuan Kuranes email: tuan.kuranes@free.fr
+  */
+//------------------------------------------------------------------
+/**
+  * Default object constructor
+  * 
+  */
+GLHardwareOcclusionQuery::GLHardwareOcclusionQuery() 
+{ 
+	// Check for hardware occlusion support
+    if(GLEW_VERSION_1_5 || GLEW_ARB_occlusion_query)
+	{
+	    glGenQueriesARB(1, &mQueryID );	
+	}
+	else if (GLEW_NV_occlusion_query)
+	{
+		glGenOcclusionQueriesNV(1, &mQueryID);
+	}
+	else
+    {
+        OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR, 
+                    "Cannot allocate a Hardware query. This video card doesn't supports it, sorry.", 
+                    "GLHardwareOcclusionQuery::GLHardwareOcclusionQuery" );
+    }
+	
+}
+//------------------------------------------------------------------
+/**
+  * Object destructor
+  */
+GLHardwareOcclusionQuery::~GLHardwareOcclusionQuery() 
+{ 
+    if(GLEW_VERSION_1_5 || GLEW_ARB_occlusion_query)
+	{
+		glDeleteQueriesARB(1, &mQueryID);  
+	}
+	else if (GLEW_NV_occlusion_query)
+	{
+		glDeleteOcclusionQueriesNV(1, &mQueryID);  
+	}
+}
+//------------------------------------------------------------------
+void GLHardwareOcclusionQuery::beginOcclusionQuery() 
+{ 
+    if(GLEW_VERSION_1_5 || GLEW_ARB_occlusion_query)
+	{
+		glBeginQueryARB(GL_SAMPLES_PASSED_ARB, mQueryID);
+	}
+	else if (GLEW_NV_occlusion_query)
+	{
+		glBeginOcclusionQueryNV(mQueryID);
+	}
+}
+//------------------------------------------------------------------
+void GLHardwareOcclusionQuery::endOcclusionQuery() 
+{ 
+    if(GLEW_VERSION_1_5 || GLEW_ARB_occlusion_query)
+	{
+	    glEndQueryARB(GL_SAMPLES_PASSED_ARB);
+	}
+	else if (GLEW_NV_occlusion_query)
+	{
+		glEndOcclusionQueryNV();
+	}
+	
+}
+//------------------------------------------------------------------
+bool GLHardwareOcclusionQuery::pullOcclusionQuery( unsigned int* NumOfFragments ) 
+{
+    if(GLEW_VERSION_1_5 || GLEW_ARB_occlusion_query)
+	{
+		glGetQueryObjectuivARB(mQueryID, GL_QUERY_RESULT_ARB, (GLuint*)NumOfFragments);
+		mPixelCount = *NumOfFragments;
+		return true;
+	}
+	else if (GLEW_NV_occlusion_query)
+	{
+		glGetOcclusionQueryuivNV(mQueryID, GL_PIXEL_COUNT_NV, (GLuint*)NumOfFragments);
+		mPixelCount = *NumOfFragments;
+		return true;
+	}
+
+	return false;
+}
+//------------------------------------------------------------------
+bool GLHardwareOcclusionQuery::isStillOutstanding(void)
+{    
+      GLuint available;
+
+    if(GLEW_VERSION_1_5 || GLEW_ARB_occlusion_query)
+	{
+	    glGetQueryObjectuivARB(mQueryID, GL_QUERY_RESULT_AVAILABLE_ARB, &available);
+	}
+	else if (GLEW_NV_occlusion_query)
+	{
+	    glGetOcclusionQueryuivNV(mQueryID, GL_PIXEL_COUNT_AVAILABLE_NV, &available);
+	}
+
+	// GL_TRUE means a wait would occur
+    return !(available == GL_TRUE);  
+} 
+
+}
+
+
Index: /RenderSystems/GL/src/OgreGLHardwarePixelBuffer.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLHardwarePixelBuffer.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLHardwarePixelBuffer.cpp	(revision 5)
@@ -0,0 +1,835 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreGLHardwarePixelBuffer.h"
+#include "OgreGLTexture.h"
+#include "OgreGLSupport.h"
+#include "OgreGLPixelFormat.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreBitwise.h"
+#include "OgreGLFBORenderTexture.h"
+#include "OgreRoot.h"
+
+namespace Ogre {
+//----------------------------------------------------------------------------- 
+GLHardwarePixelBuffer::GLHardwarePixelBuffer(size_t mWidth, size_t mHeight, size_t mDepth,
+                PixelFormat mFormat,
+                HardwareBuffer::Usage usage):
+      HardwarePixelBuffer(mWidth, mHeight, mDepth, mFormat, usage, false, false),
+      mBuffer(mWidth, mHeight, mDepth, mFormat),
+      mGLInternalFormat(GL_NONE)
+{
+}
+
+//-----------------------------------------------------------------------------  
+GLHardwarePixelBuffer::~GLHardwarePixelBuffer()
+{
+	// Force free buffer
+	delete [] (uint8*)mBuffer.data;
+}
+//-----------------------------------------------------------------------------  
+void GLHardwarePixelBuffer::allocateBuffer()
+{
+	if(mBuffer.data)
+		// Already allocated
+		return;
+	mBuffer.data = new uint8[mSizeInBytes];
+	// TODO: use PBO if we're HBU_DYNAMIC
+}
+//-----------------------------------------------------------------------------  
+void GLHardwarePixelBuffer::freeBuffer()
+{
+	// Free buffer if we're STATIC to save memory
+	if(mUsage & HBU_STATIC)
+	{
+		delete [] (uint8*)mBuffer.data;
+		mBuffer.data = 0;
+	}
+}
+//-----------------------------------------------------------------------------  
+PixelBox GLHardwarePixelBuffer::lockImpl(const Image::Box lockBox,  LockOptions options)
+{
+	allocateBuffer();
+	if(options != HardwareBuffer::HBL_DISCARD
+		&& (mUsage & HardwareBuffer::HBU_WRITE_ONLY) == 0) 
+	{
+		// Download the old contents of the texture
+		download(mBuffer);
+	}
+	mCurrentLockOptions = options;
+	return mBuffer.getSubVolume(lockBox);
+}
+//-----------------------------------------------------------------------------  
+void GLHardwarePixelBuffer::unlockImpl(void)
+{
+	if (mCurrentLockOptions != HardwareBuffer::HBL_READ_ONLY)
+	{
+		// From buffer to card, only upload if was locked for writing
+		upload(mCurrentLock);
+	}
+	
+	freeBuffer();
+}
+
+//-----------------------------------------------------------------------------  
+void GLHardwarePixelBuffer::blitFromMemory(const PixelBox &src, const Image::Box &dstBox)
+{
+	if(!mBuffer.contains(dstBox))
+		OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "destination box out of range",
+		 "GLHardwarePixelBuffer::blitFromMemory");
+	PixelBox scaled;
+	
+	if(src.getWidth() != dstBox.getWidth() ||
+		src.getHeight() != dstBox.getHeight() ||
+		src.getDepth() != dstBox.getDepth())
+	{
+		// Scale to destination size. Use DevIL and not iluScale because ILU screws up for 
+		// floating point textures and cannot cope with 3D images.
+		// This also does pixel format conversion if needed
+		allocateBuffer();
+		scaled = mBuffer.getSubVolume(dstBox);
+		Image::scale(src, scaled, Image::FILTER_BILINEAR);
+	}
+	else if(GLPixelUtil::getGLOriginFormat(src.format) == 0)
+	{
+		// Extents match, but format is not accepted as valid source format for GL
+		// do conversion in temporary buffer
+		allocateBuffer();
+		scaled = mBuffer.getSubVolume(dstBox);
+		PixelUtil::bulkPixelConversion(src, scaled);
+	}
+	else
+	{
+		// No scaling or conversion needed
+		scaled = src;
+		// Set extents for upload
+		scaled.left = dstBox.left;
+		scaled.right = dstBox.right;
+		scaled.top = dstBox.top;
+		scaled.bottom = dstBox.bottom;
+		scaled.front = dstBox.front;
+		scaled.back = dstBox.back;
+	}
+	
+	upload(scaled);
+	freeBuffer();
+}
+//-----------------------------------------------------------------------------  
+void GLHardwarePixelBuffer::blitToMemory(const Image::Box &srcBox, const PixelBox &dst)
+{
+	if(!mBuffer.contains(srcBox))
+		OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "source box out of range",
+		 "GLHardwarePixelBuffer::blitToMemory");
+	if(srcBox.left == 0 && srcBox.right == getWidth() &&
+	   srcBox.top == 0 && srcBox.bottom == getHeight() &&
+	   srcBox.front == 0 && srcBox.back == getDepth() &&
+	   dst.getWidth() == getWidth() &&
+	   dst.getHeight() == getHeight() &&
+	   dst.getDepth() == getDepth() &&
+	   GLPixelUtil::getGLOriginFormat(dst.format) != 0)
+	{
+		// The direct case: the user wants the entire texture in a format supported by GL
+		// so we don't need an intermediate buffer
+		download(dst);
+	}
+	else
+	{
+		// Use buffer for intermediate copy
+		allocateBuffer();
+		// Download entire buffer
+		download(mBuffer);
+		if(srcBox.getWidth() != dst.getWidth() ||
+			srcBox.getHeight() != dst.getHeight() ||
+			srcBox.getDepth() != dst.getDepth())
+		{
+			// We need scaling
+			Image::scale(mBuffer.getSubVolume(srcBox), dst, Image::FILTER_BILINEAR);
+		}
+		else
+		{
+			// Just copy the bit that we need
+			PixelUtil::bulkPixelConversion(mBuffer.getSubVolume(srcBox), dst);
+		}
+		freeBuffer();
+	}
+}
+//-----------------------------------------------------------------------------
+void GLHardwarePixelBuffer::upload(const PixelBox &data)
+{
+    OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
+		"Upload not possible for this pixelbuffer type",
+        "GLHardwarePixelBuffer::upload");
+}
+//-----------------------------------------------------------------------------  
+void GLHardwarePixelBuffer::download(const PixelBox &data)
+{
+    OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Download not possible for this pixelbuffer type",
+        "GLHardwarePixelBuffer::download");
+}
+//-----------------------------------------------------------------------------  
+void GLHardwarePixelBuffer::bindToFramebuffer(GLenum attachment, size_t zoffset)
+{
+    OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Framebuffer bind not possible for this pixelbuffer type",
+        "GLHardwarePixelBuffer::bindToFramebuffer");
+}
+//********* GLTextureBuffer
+GLTextureBuffer::GLTextureBuffer(const String &baseName, GLenum target, GLuint id, GLint face, GLint level, Usage usage, bool crappyCard):
+	GLHardwarePixelBuffer(0, 0, 0, PF_UNKNOWN, usage),
+	mTarget(target), mTextureID(id), mFace(face), mLevel(level), mSoftwareMipmap(crappyCard)
+{
+	// devise mWidth, mHeight and mDepth and mFormat
+	GLint value;
+	
+	glBindTexture( mTarget, mTextureID );
+	
+	// Get face identifier
+	mFaceTarget = mTarget;
+	if(mTarget == GL_TEXTURE_CUBE_MAP)
+		mFaceTarget = GL_TEXTURE_CUBE_MAP_POSITIVE_X + face;
+	
+	// Get width
+	glGetTexLevelParameteriv(mFaceTarget, level, GL_TEXTURE_WIDTH, &value);
+	mWidth = value;
+	
+	// Get height
+	if(target == GL_TEXTURE_1D)
+		value = 1;	// Height always 1 for 1D textures
+	else
+		glGetTexLevelParameteriv(mFaceTarget, level, GL_TEXTURE_HEIGHT, &value);
+	mHeight = value;
+	
+	// Get depth
+	if(target != GL_TEXTURE_3D)
+		value = 1; // Depth always 1 for non-3D textures
+	else
+		glGetTexLevelParameteriv(mFaceTarget, level, GL_TEXTURE_DEPTH, &value);
+	mDepth = value;
+
+	// Get format
+	glGetTexLevelParameteriv(mFaceTarget, level, GL_TEXTURE_INTERNAL_FORMAT, &value);
+	mGLInternalFormat = value;
+	mFormat = GLPixelUtil::getClosestOGREFormat(value);
+	
+	// Default
+	mRowPitch = mWidth;
+	mSlicePitch = mHeight*mWidth;
+	mSizeInBytes = PixelUtil::getMemorySize(mWidth, mHeight, mDepth, mFormat);
+	
+	// Log a message
+	/*
+	std::stringstream str;
+	str << "GLHardwarePixelBuffer constructed for texture " << mTextureID 
+		<< " face " << mFace << " level " << mLevel << ": "
+		<< "width=" << mWidth << " height="<< mHeight << " depth=" << mDepth
+		<< "format=" << PixelUtil::getFormatName(mFormat) << "(internal 0x"
+		<< std::hex << value << ")";
+	LogManager::getSingleton().logMessage( 
+                LML_NORMAL, str.str());
+	*/
+	// Set up pixel box
+	mBuffer = PixelBox(mWidth, mHeight, mDepth, mFormat);
+	
+    if(mWidth==0 || mHeight==0 || mDepth==0)
+        /// We are invalid, do not allocate a buffer
+        return;
+	// Allocate buffer
+	//if(mUsage & HBU_STATIC)
+	//	allocateBuffer();
+    // Is this a render target?
+    if(mUsage & TU_RENDERTARGET)
+    {
+        // Create render target for each slice
+        mSliceTRT.reserve(mDepth);
+        for(size_t zoffset=0; zoffset<mDepth; ++zoffset)
+        {
+            String name;
+			name = "rtt/" + baseName + "/" + StringConverter::toString((size_t)this);
+            GLSurfaceDesc target;
+            target.buffer = this;
+            target.zoffset = zoffset;
+            RenderTexture *trt = GLRTTManager::getSingleton().createRenderTexture(name, target);
+            mSliceTRT.push_back(trt);
+            Root::getSingleton().getRenderSystem()->attachRenderTarget(*mSliceTRT[zoffset]);
+        }
+	}
+}
+GLTextureBuffer::~GLTextureBuffer()
+{
+    if(mUsage & TU_RENDERTARGET)
+    {
+        // Delete all render targets that are not yet deleted via _clearSliceRTT because the rendertarget
+        // was deleted by the user.
+        for (SliceTRT::const_iterator it = mSliceTRT.begin(); it != mSliceTRT.end(); ++it)
+        {
+            Root::getSingleton().getRenderSystem()->destroyRenderTarget((*it)->getName());
+        }
+	}
+}
+//-----------------------------------------------------------------------------
+void GLTextureBuffer::upload(const PixelBox &data)
+{
+	glBindTexture( mTarget, mTextureID );
+	if(PixelUtil::isCompressed(data.format))
+	{
+		if(data.format != mFormat || !data.isConsecutive())
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+			"Compressed images must be consecutive, in the source format",
+		 	"GLHardwarePixelBuffer::upload");
+		GLenum format = GLPixelUtil::getClosestGLInternalFormat(mFormat);
+		// Data must be consecutive and at beginning of buffer as PixelStorei not allowed
+		// for compressed formats
+		switch(mTarget) {
+			case GL_TEXTURE_1D:
+				glCompressedTexSubImage1DARB(GL_TEXTURE_1D, mLevel, 
+					data.left,
+					data.getWidth(),
+					format, data.getConsecutiveSize(),
+					data.data);
+				break;
+			case GL_TEXTURE_2D:
+			case GL_TEXTURE_CUBE_MAP:
+				glCompressedTexSubImage2DARB(mFaceTarget, mLevel, 
+					data.left, data.top, 
+					data.getWidth(), data.getHeight(),
+					format, data.getConsecutiveSize(),
+					data.data);
+				break;
+			case GL_TEXTURE_3D:
+				glCompressedTexSubImage3DARB(GL_TEXTURE_3D, mLevel, 
+					data.left, data.top, data.front,
+					data.getWidth(), data.getHeight(), data.getDepth(),
+					format, data.getConsecutiveSize(),
+					data.data);
+				break;
+		}
+		
+	} 
+	else if(mSoftwareMipmap)
+	{
+		GLint internalFormat;
+		glGetTexLevelParameteriv(mTarget, mLevel, GL_TEXTURE_INTERNAL_FORMAT, &internalFormat);
+		if(data.getWidth() != data.rowPitch)
+			glPixelStorei(GL_UNPACK_ROW_LENGTH, data.rowPitch);
+		if(data.getHeight()*data.getWidth() != data.slicePitch)
+			glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, (data.slicePitch/data.getWidth()));
+		glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+		
+		switch(mTarget)
+		{
+		case GL_TEXTURE_1D:
+			gluBuild1DMipmaps(
+				GL_TEXTURE_1D, internalFormat,
+				data.getWidth(),
+				GLPixelUtil::getGLOriginFormat(data.format), GLPixelUtil::getGLOriginDataType(data.format),
+				data.data);
+			break;
+		case GL_TEXTURE_2D:
+		case GL_TEXTURE_CUBE_MAP:
+			gluBuild2DMipmaps(
+				mFaceTarget,
+				internalFormat, data.getWidth(), data.getHeight(), 
+				GLPixelUtil::getGLOriginFormat(data.format), GLPixelUtil::getGLOriginDataType(data.format), 
+				data.data);
+			break;		
+		case GL_TEXTURE_3D:
+			/* Requires GLU 1.3 which is harder to come by than cards doing hardware mipmapping
+				Most 3D textures don't need mipmaps?
+			gluBuild3DMipmaps(
+				GL_TEXTURE_3D, internalFormat, 
+				data.getWidth(), data.getHeight(), data.getDepth(),
+				GLPixelUtil::getGLOriginFormat(data.format), GLPixelUtil::getGLOriginDataType(data.format),
+				data.data);
+			*/
+			glTexImage3D(
+				GL_TEXTURE_3D, 0, internalFormat, 
+				data.getWidth(), data.getHeight(), data.getDepth(), 0, 
+				GLPixelUtil::getGLOriginFormat(data.format), GLPixelUtil::getGLOriginDataType(data.format),
+				data.data );
+			break;
+		}
+	} 
+	else
+	{
+		if(data.getWidth() != data.rowPitch)
+			glPixelStorei(GL_UNPACK_ROW_LENGTH, data.rowPitch);
+		if(data.getHeight()*data.getWidth() != data.slicePitch)
+			glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, (data.slicePitch/data.getWidth()));
+		if((data.getWidth()*PixelUtil::getNumElemBytes(data.format)) & 3) {
+			// Standard alignment of 4 is not right
+			glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+		}
+		switch(mTarget) {
+			case GL_TEXTURE_1D:
+				glTexSubImage1D(GL_TEXTURE_1D, mLevel, 
+					data.left,
+					data.getWidth(),
+					GLPixelUtil::getGLOriginFormat(data.format), GLPixelUtil::getGLOriginDataType(data.format),
+					data.data);
+				break;
+			case GL_TEXTURE_2D:
+			case GL_TEXTURE_CUBE_MAP:
+				glTexSubImage2D(mFaceTarget, mLevel, 
+					data.left, data.top, 
+					data.getWidth(), data.getHeight(),
+					GLPixelUtil::getGLOriginFormat(data.format), GLPixelUtil::getGLOriginDataType(data.format),
+					data.data);
+				break;
+			case GL_TEXTURE_3D:
+				glTexSubImage3D(
+					GL_TEXTURE_3D, mLevel, 
+					data.left, data.top, data.front,
+					data.getWidth(), data.getHeight(), data.getDepth(),
+					GLPixelUtil::getGLOriginFormat(data.format), GLPixelUtil::getGLOriginDataType(data.format),
+					data.data);
+				break;
+		}	
+	}
+	// Restore defaults
+	glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+	glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0);
+	glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+}
+//-----------------------------------------------------------------------------  
+void GLTextureBuffer::download(const PixelBox &data)
+{
+	if(data.getWidth() != getWidth() ||
+		data.getHeight() != getHeight() ||
+		data.getDepth() != getDepth())
+		OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "only download of entire buffer is supported by GL",
+		 	"GLHardwarePixelBuffer::download");
+	glBindTexture( mTarget, mTextureID );
+	if(PixelUtil::isCompressed(data.format))
+	{
+		if(data.format != mFormat || !data.isConsecutive())
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+			"Compressed images must be consecutive, in the source format",
+		 	"GLHardwarePixelBuffer::upload");
+		// Data must be consecutive and at beginning of buffer as PixelStorei not allowed
+		// for compressed formate
+		glGetCompressedTexImageARB(mFaceTarget, mLevel, data.data);
+	} 
+	else
+	{
+		if(data.getWidth() != data.rowPitch)
+			glPixelStorei(GL_PACK_ROW_LENGTH, data.rowPitch);
+		if(data.getHeight()*data.getWidth() != data.slicePitch)
+			glPixelStorei(GL_PACK_IMAGE_HEIGHT, (data.slicePitch/data.getWidth()));
+		if((data.getWidth()*PixelUtil::getNumElemBytes(data.format)) & 3) {
+			// Standard alignment of 4 is not right
+			glPixelStorei(GL_PACK_ALIGNMENT, 1);
+		}
+		// We can only get the entire texture
+		glGetTexImage(mFaceTarget, mLevel, 
+			GLPixelUtil::getGLOriginFormat(data.format), GLPixelUtil::getGLOriginDataType(data.format),
+			data.data);
+		// Restore defaults
+		glPixelStorei(GL_PACK_ROW_LENGTH, 0);
+		glPixelStorei(GL_PACK_IMAGE_HEIGHT, 0);
+		glPixelStorei(GL_PACK_ALIGNMENT, 4);
+	}
+}
+//-----------------------------------------------------------------------------  
+void GLTextureBuffer::bindToFramebuffer(GLenum attachment, size_t zoffset)
+{
+    assert(zoffset < mDepth);
+    switch(mTarget)
+    {
+    case GL_TEXTURE_1D:
+        glFramebufferTexture1DEXT(GL_FRAMEBUFFER_EXT, attachment,
+                            mFaceTarget, mTextureID, mLevel);
+        break;
+    case GL_TEXTURE_2D:
+    case GL_TEXTURE_CUBE_MAP:
+        glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, attachment,
+                            mFaceTarget, mTextureID, mLevel);
+        break;
+    case GL_TEXTURE_3D:
+        glFramebufferTexture3DEXT(GL_FRAMEBUFFER_EXT, attachment,
+                            mFaceTarget, mTextureID, mLevel, zoffset);
+        break;
+    }
+}
+//-----------------------------------------------------------------------------
+void GLTextureBuffer::copyFromFramebuffer(size_t zoffset)
+{
+    glBindTexture(mTarget, mTextureID);
+    switch(mTarget)
+    {
+    case GL_TEXTURE_1D:
+        glCopyTexSubImage1D(mFaceTarget, mLevel, 0, 0, 0, mWidth);
+        break;
+    case GL_TEXTURE_2D:
+    case GL_TEXTURE_CUBE_MAP:
+        glCopyTexSubImage2D(mFaceTarget, mLevel, 0, 0, 0, 0, mWidth, mHeight);
+        break;
+    case GL_TEXTURE_3D:
+        glCopyTexSubImage3D(mFaceTarget, mLevel, 0, 0, zoffset, 0, 0, mWidth, mHeight);
+        break;
+    }
+}
+//-----------------------------------------------------------------------------  
+void GLTextureBuffer::blit(const HardwarePixelBufferSharedPtr &src, const Image::Box &srcBox, const Image::Box &dstBox)
+{
+    GLTextureBuffer *srct = static_cast<GLTextureBuffer *>(src.getPointer());
+    /// Check for FBO support first
+    /// Destination texture must be 1D, 2D, 3D, or Cube
+    /// Source texture must be 1D, 2D or 3D
+    if(GLEW_EXT_framebuffer_object &&
+        (srct->mTarget==GL_TEXTURE_1D||srct->mTarget==GL_TEXTURE_2D||srct->mTarget==GL_TEXTURE_3D))
+    {
+        blitFromTexture(srct, srcBox, dstBox);
+    }
+    else
+    {
+        GLHardwarePixelBuffer::blit(src, srcBox, dstBox);
+    }
+}
+
+//-----------------------------------------------------------------------------  
+/// Very fast texture-to-texture blitter and hardware bi/trilinear scaling implementation using FBO
+/// Destination texture must be 1D, 2D, 3D, or Cube
+/// Source texture must be 1D, 2D or 3D
+/// Supports compressed formats as both source and destination format, it will use the hardware DXT compressor
+/// if available.
+/// @author W.J. van der Laan
+void GLTextureBuffer::blitFromTexture(GLTextureBuffer *src, const Image::Box &srcBox, const Image::Box &dstBox)
+{
+    //std::cerr << "GLTextureBuffer::blitFromTexture " <<
+    //src->mTextureID << ":" << srcBox.left << "," << srcBox.top << "," << srcBox.right << "," << srcBox.bottom << " " << 
+    //mTextureID << ":" << dstBox.left << "," << dstBox.top << "," << dstBox.right << "," << dstBox.bottom << std::endl;
+    /// Store reference to FBO manager
+    GLFBOManager *fboMan = static_cast<GLFBOManager *>(GLRTTManager::getSingletonPtr());
+    
+    /// Save and clear GL state for rendering
+    glPushAttrib(GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT | GL_DEPTH_BUFFER_BIT | GL_ENABLE_BIT | 
+        GL_FOG_BIT | GL_LIGHTING_BIT | GL_POLYGON_BIT | GL_SCISSOR_BIT | GL_STENCIL_BUFFER_BIT |
+        GL_TEXTURE_BIT | GL_VIEWPORT_BIT);
+
+    /// Disable alpha, depth and scissor testing, disable blending, 
+    /// disable culling, disble lighting, disable fog and reset foreground
+    /// colour.
+    glDisable(GL_ALPHA_TEST);
+    glDisable(GL_DEPTH_TEST);
+    glDisable(GL_SCISSOR_TEST);
+    glDisable(GL_BLEND);
+    glDisable(GL_CULL_FACE);
+    glDisable(GL_LIGHTING);
+    glDisable(GL_FOG);
+    glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+    
+    /// Save and reset matrices
+    glMatrixMode(GL_MODELVIEW);
+    glPushMatrix();
+    glLoadIdentity();
+    glMatrixMode(GL_PROJECTION);
+    glPushMatrix();
+    glLoadIdentity();
+    glMatrixMode(GL_TEXTURE);
+    glPushMatrix();
+    glLoadIdentity();
+    
+    /// Set up source texture
+    glBindTexture(src->mTarget, src->mTextureID);
+    
+    /// Set filtering modes depending on the dimensions and source
+    if(srcBox.getWidth()==dstBox.getWidth() &&
+        srcBox.getHeight()==dstBox.getHeight() &&
+        srcBox.getDepth()==dstBox.getDepth())
+    {
+        /// Dimensions match -- use nearest filtering (fastest and pixel correct)
+        glTexParameteri(src->mTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+        glTexParameteri(src->mTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+    }
+    else
+    {
+        /// Dimensions don't match -- use bi or trilinear filtering depending on the
+        /// source texture.
+        if(src->mUsage & TU_AUTOMIPMAP)
+        {
+            /// Automatic mipmaps, we can safely use trilinear filter which
+            /// brings greatly imporoved quality for minimisation.
+            glTexParameteri(src->mTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
+            glTexParameteri(src->mTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR);    
+        }
+        else
+        {
+            /// Manual mipmaps, stay safe with bilinear filtering so that no
+            /// intermipmap leakage occurs.
+            glTexParameteri(src->mTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+            glTexParameteri(src->mTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+        }
+    }
+    /// Clamp to edge (fastest)
+    glTexParameteri(src->mTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+    glTexParameteri(src->mTarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+    glTexParameteri(src->mTarget, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
+    
+    /// Set origin base level mipmap to make sure we source from the right mip
+    /// level.
+    glTexParameteri(src->mTarget, GL_TEXTURE_BASE_LEVEL, src->mLevel);
+    
+    /// Store old binding so it can be restored later
+    GLint oldfb;
+    glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &oldfb);
+    
+    /// Set up temporary FBO
+    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboMan->getTemporaryFBO());
+    
+    GLuint tempTex = 0;
+    if(!fboMan->checkFormat(mFormat))
+    {
+        /// If target format not directly supported, create intermediate texture
+        GLenum tempFormat = GLPixelUtil::getClosestGLInternalFormat(fboMan->getSupportedAlternative(mFormat));
+        glGenTextures(1, &tempTex);
+        glBindTexture(GL_TEXTURE_2D, tempTex);
+        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
+        /// Allocate temporary texture of the size of the destination area
+        glTexImage2D(GL_TEXTURE_2D, 0, tempFormat, 
+            GLPixelUtil::optionalPO2(dstBox.getWidth()), GLPixelUtil::optionalPO2(dstBox.getHeight()), 
+            0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
+        glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
+            GL_TEXTURE_2D, tempTex, 0);
+        /// Set viewport to size of destination slice
+        glViewport(0, 0, dstBox.getWidth(), dstBox.getHeight());
+    }
+    else
+    {
+        /// We are going to bind directly, so set viewport to size and position of destination slice
+        glViewport(dstBox.left, dstBox.top, dstBox.getWidth(), dstBox.getHeight());
+    }
+    
+    /// Process each destination slice
+    for(size_t slice=dstBox.front; slice<dstBox.back; ++slice)
+    {
+        if(!tempTex)
+        {
+            /// Bind directly
+            bindToFramebuffer(GL_COLOR_ATTACHMENT0_EXT, slice);
+        }
+        /// Calculate source texture coordinates
+        float u1 = (float)srcBox.left / (float)src->mWidth;
+        float v1 = (float)srcBox.top / (float)src->mHeight;
+        float u2 = (float)srcBox.right / (float)src->mWidth;
+        float v2 = (float)srcBox.bottom / (float)src->mHeight;
+        /// Calculate source slice for this destination slice
+        float w = (float)(slice - dstBox.front) / (float)dstBox.getDepth();
+        /// Get slice # in source
+        w = w * (float)srcBox.getDepth() + srcBox.front;
+        /// Normalise to texture coordinate in 0.0 .. 1.0
+        w = (w+0.5f) / (float)src->mDepth;
+        
+        /// Finally we're ready to rumble
+        glBindTexture(src->mTarget, src->mTextureID);
+        glEnable(src->mTarget);
+        glBegin(GL_QUADS);
+        glTexCoord3f(u1, v1, w);
+        glVertex2f(-1.0f, -1.0f);
+        glTexCoord3f(u2, v1, w);
+        glVertex2f(1.0f, -1.0f);
+        glTexCoord3f(u2, v2, w);
+        glVertex2f(1.0f, 1.0f);
+        glTexCoord3f(u1, v2, w);
+        glVertex2f(-1.0f, 1.0f);
+        glEnd();
+        glDisable(src->mTarget);
+        
+        if(tempTex)
+        {
+            /// Copy temporary texture
+            glBindTexture(mTarget, mTextureID);
+            switch(mTarget)
+            {
+            case GL_TEXTURE_1D:
+                glCopyTexSubImage1D(mFaceTarget, mLevel, 
+                    dstBox.left, 
+                    0, 0, dstBox.getWidth());
+                break;
+            case GL_TEXTURE_2D:
+            case GL_TEXTURE_CUBE_MAP:
+                glCopyTexSubImage2D(mFaceTarget, mLevel, 
+                    dstBox.left, dstBox.top, 
+                    0, 0, dstBox.getWidth(), dstBox.getHeight());
+                break;
+            case GL_TEXTURE_3D:
+                glCopyTexSubImage3D(mFaceTarget, mLevel, 
+                    dstBox.left, dstBox.top, slice, 
+                    0, 0, dstBox.getWidth(), dstBox.getHeight());
+                break;
+            }
+        }
+    }
+    /// Finish up 
+    if(!tempTex)
+    {
+        /// Generate mipmaps
+        if(mUsage & TU_AUTOMIPMAP)
+        {
+            glBindTexture(mTarget, mTextureID);
+            glGenerateMipmapEXT(mTarget);
+        }
+    }
+
+    /// Reset source texture to sane state
+    glBindTexture(src->mTarget, src->mTextureID);
+    glTexParameteri(src->mTarget, GL_TEXTURE_BASE_LEVEL, 0);
+    
+    /// Detach texture from temporary framebuffer
+    glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
+                    GL_RENDERBUFFER_EXT, 0);
+    /// Restore old framebuffer
+    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, oldfb);
+    /// Restore matrix stacks and render state
+    glMatrixMode(GL_TEXTURE);
+    glPopMatrix();
+    glMatrixMode(GL_PROJECTION);
+    glPopMatrix();
+    glMatrixMode(GL_MODELVIEW);
+    glPopMatrix();
+    glPopAttrib();
+    glDeleteTextures(1, &tempTex);
+}
+//-----------------------------------------------------------------------------  
+/// blitFromMemory doing hardware trilinear scaling
+void GLTextureBuffer::blitFromMemory(const PixelBox &src_orig, const Image::Box &dstBox)
+{
+    /// Fall back to normal GLHardwarePixelBuffer::blitFromMemory in case 
+    /// - FBO is not supported
+    /// - Either source or target is luminance due doesn't looks like supported by hardware
+    /// - the source dimensions match the destination ones, in which case no scaling is needed
+    if(!GLEW_EXT_framebuffer_object ||
+        PixelUtil::isLuminance(src_orig.format) ||
+        PixelUtil::isLuminance(mFormat) ||
+        (src_orig.getWidth() == dstBox.getWidth() &&
+        src_orig.getHeight() == dstBox.getHeight() &&
+        src_orig.getDepth() == dstBox.getDepth()))
+    {
+        GLHardwarePixelBuffer::blitFromMemory(src_orig, dstBox);
+        return;
+    }
+    if(!mBuffer.contains(dstBox))
+        OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "destination box out of range",
+                    "GLHardwarePixelBuffer::blitFromMemory");
+    /// For scoped deletion of conversion buffer
+    MemoryDataStreamPtr buf;
+    PixelBox src;
+    
+    /// First, convert the srcbox to a OpenGL compatible pixel format
+    if(GLPixelUtil::getGLOriginFormat(src_orig.format) == 0)
+    {
+        /// Convert to buffer internal format
+        buf.bind(new MemoryDataStream(
+                PixelUtil::getMemorySize(src_orig.getWidth(), src_orig.getHeight(), src_orig.getDepth(),
+                                         mFormat)));
+        src = PixelBox(src_orig.getWidth(), src_orig.getHeight(), src_orig.getDepth(), mFormat, buf->getPtr());
+        PixelUtil::bulkPixelConversion(src_orig, src);
+    }
+    else
+    {
+        /// No conversion needed
+        src = src_orig;
+    }
+    
+    /// Create temporary texture to store source data
+    GLuint id;
+    GLenum target = (src.getDepth()!=1)?GL_TEXTURE_3D:GL_TEXTURE_2D;
+    GLsizei width = GLPixelUtil::optionalPO2(src.getWidth());
+    GLsizei height = GLPixelUtil::optionalPO2(src.getHeight());
+    GLsizei depth = GLPixelUtil::optionalPO2(src.getDepth());
+    GLenum format = GLPixelUtil::getClosestGLInternalFormat(src.format);
+    
+    /// Generate texture name
+    glGenTextures(1, &id);
+    
+    /// Set texture type
+    glBindTexture(target, id);
+    
+    /// Set automatic mipmap generation; nice for minimisation
+    glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, 1000 );
+    glTexParameteri(target, GL_GENERATE_MIPMAP, GL_TRUE );
+    
+    /// Allocate texture memory
+    if(target == GL_TEXTURE_3D)
+        glTexImage3D(target, 0, format, width, height, depth, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
+    else
+        glTexImage2D(target, 0, format, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
+
+    /// GL texture buffer
+    GLTextureBuffer tex(StringUtil::BLANK, target, id, 0, 0, (Usage)(TU_AUTOMIPMAP|HBU_STATIC_WRITE_ONLY), false);
+    
+    /// Upload data to 0,0,0 in temporary texture
+    PixelBox tempTarget(src.getWidth(), src.getHeight(), src.getDepth(), src.format, src.data);
+    tempTarget.rowPitch = src.rowPitch;
+    tempTarget.slicePitch = src.slicePitch;
+    tex.upload(tempTarget);
+    
+    /// Blit
+    blitFromTexture(&tex, tempTarget, dstBox);
+    
+    /// Delete temp texture
+    glDeleteTextures(1, &id);
+}
+//-----------------------------------------------------------------------------    
+
+RenderTexture *GLTextureBuffer::getRenderTarget(size_t zoffset)
+{
+    assert(mUsage & TU_RENDERTARGET);
+    assert(zoffset < mDepth);
+    return mSliceTRT[zoffset];
+}
+//********* GLRenderBuffer
+//----------------------------------------------------------------------------- 
+GLRenderBuffer::GLRenderBuffer(GLenum format, size_t width, size_t height):
+    GLHardwarePixelBuffer(width, height, 1, GLPixelUtil::getClosestOGREFormat(format),HBU_WRITE_ONLY)
+{
+    mGLInternalFormat = format;
+    /// Generate renderbuffer
+    glGenRenderbuffersEXT(1, &mRenderbufferID);
+    /// Bind it to FBO
+    glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, mRenderbufferID);
+    
+    /// Allocate storage for depth buffer
+    glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, format,
+                        width, height);
+}
+//----------------------------------------------------------------------------- 
+GLRenderBuffer::~GLRenderBuffer()
+{
+    /// Generate renderbuffer
+    glDeleteRenderbuffersEXT(1, &mRenderbufferID);
+}
+//-----------------------------------------------------------------------------  
+void GLRenderBuffer::bindToFramebuffer(GLenum attachment, size_t zoffset)
+{
+    assert(zoffset < mDepth);
+    glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, attachment,
+                        GL_RENDERBUFFER_EXT, mRenderbufferID);
+}
+
+};
Index: /RenderSystems/GL/src/OgreGLHardwareVertexBuffer.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLHardwareVertexBuffer.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLHardwareVertexBuffer.cpp	(revision 5)
@@ -0,0 +1,247 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreGLHardwareBufferManager.h"
+#include "OgreGLHardwareVertexBuffer.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+
+namespace Ogre {
+
+	//---------------------------------------------------------------------
+    GLHardwareVertexBuffer::GLHardwareVertexBuffer(size_t vertexSize, 
+        size_t numVertices, HardwareBuffer::Usage usage, bool useShadowBuffer)
+        : HardwareVertexBuffer(vertexSize, numVertices, usage, false, useShadowBuffer)
+    {
+        glGenBuffersARB( 1, &mBufferId );
+
+        if (!mBufferId)
+        {
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+                "Cannot create GL vertex buffer", 
+                "GLHardwareVertexBuffer::GLHardwareVertexBuffer");
+        }
+
+        glBindBufferARB(GL_ARRAY_BUFFER_ARB, mBufferId);
+
+        // Initialise mapped buffer and set usage
+        glBufferDataARB(GL_ARRAY_BUFFER_ARB, mSizeInBytes, NULL, 
+            GLHardwareBufferManager::getGLUsage(usage));
+
+        //std::cerr << "creating vertex buffer = " << mBufferId << std::endl;
+    }
+	//---------------------------------------------------------------------
+    GLHardwareVertexBuffer::~GLHardwareVertexBuffer()
+    {
+        glDeleteBuffersARB(1, &mBufferId);
+    }
+	//---------------------------------------------------------------------
+    void* GLHardwareVertexBuffer::lockImpl(size_t offset, 
+        size_t length, LockOptions options)
+    {
+        GLenum access = 0;
+
+        if(mIsLocked)
+        {
+            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR,
+                "Invalid attempt to lock an index buffer that has already been locked",
+                "GLHardwareIndexBuffer::lock");
+        }
+
+
+		void* retPtr = 0;
+
+		// Try to use scratch buffers for smaller buffers
+		if(length < OGRE_GL_MAP_BUFFER_THRESHOLD)
+		{
+			// if this fails, we fall back on mapping
+			retPtr = static_cast<GLHardwareBufferManager*>(
+				HardwareBufferManager::getSingletonPtr())->allocateScratch((uint32)length);
+
+			if (retPtr)
+			{
+				mLockedToScratch = true;
+				mScratchOffset = offset;
+				mScratchSize = length;
+				mScratchPtr = retPtr;
+				mScratchUploadOnUnlock = (options != HBL_READ_ONLY);
+
+				if (options != HBL_DISCARD)
+				{
+					// have to read back the data before returning the pointer
+					readData(offset, length, retPtr);
+				}
+			}
+		}
+		
+		if (!retPtr)
+		{
+			// Use glMapBuffer
+			glBindBufferARB( GL_ARRAY_BUFFER_ARB, mBufferId );
+			// Use glMapBuffer
+			if(options == HBL_DISCARD)
+			{
+				// Discard the buffer
+				glBufferDataARB(GL_ARRAY_BUFFER_ARB, mSizeInBytes, NULL, 
+					GLHardwareBufferManager::getGLUsage(mUsage));
+
+			}
+			if (mUsage & HBU_WRITE_ONLY)
+				access = GL_WRITE_ONLY_ARB;
+			else if (options == HBL_READ_ONLY)
+				access = GL_READ_ONLY_ARB;
+			else
+				access = GL_READ_WRITE_ARB;
+
+			void* pBuffer = glMapBufferARB( GL_ARRAY_BUFFER_ARB, access);
+
+			if(pBuffer == 0)
+			{
+				OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+					"Vertex Buffer: Out of memory", "GLHardwareVertexBuffer::lock");
+			}
+
+			// return offsetted
+			retPtr = static_cast<void*>(
+				static_cast<unsigned char*>(pBuffer) + offset);
+
+			mLockedToScratch = false;
+		}
+		mIsLocked = true;
+		return retPtr;
+    }
+	//---------------------------------------------------------------------
+	void GLHardwareVertexBuffer::unlockImpl(void)
+    {
+		if (mLockedToScratch)
+		{
+			if (mScratchUploadOnUnlock)
+			{
+				// have to write the data back to vertex buffer
+				writeData(mScratchOffset, mScratchSize, mScratchPtr, 
+					mScratchOffset == 0 && mScratchSize == getSizeInBytes());
+			}
+
+			// deallocate from scratch buffer
+			static_cast<GLHardwareBufferManager*>(
+				HardwareBufferManager::getSingletonPtr())->deallocateScratch(mScratchPtr);
+
+			mLockedToScratch = false;
+		}
+		else
+		{
+
+			glBindBufferARB(GL_ARRAY_BUFFER_ARB, mBufferId);
+
+			if(!glUnmapBufferARB( GL_ARRAY_BUFFER_ARB ))
+			{
+				OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+					"Buffer data corrupted, please reload", 
+					"GLHardwareVertexBuffer::unlock");
+			}
+		}
+
+        mIsLocked = false;
+    }
+	//---------------------------------------------------------------------
+    void GLHardwareVertexBuffer::readData(size_t offset, size_t length, 
+        void* pDest)
+    {
+        if(mUseShadowBuffer)
+        {
+            // get data from the shadow buffer
+            void* srcData = mpShadowBuffer->lock(offset, length, HBL_READ_ONLY);
+            memcpy(pDest, srcData, length);
+            mpShadowBuffer->unlock();
+        }
+        else
+        {
+            // get data from the real buffer
+            glBindBufferARB(GL_ARRAY_BUFFER_ARB, mBufferId);
+        
+            glGetBufferSubDataARB(GL_ARRAY_BUFFER_ARB, offset, length, pDest);
+        }
+    }
+	//---------------------------------------------------------------------
+    void GLHardwareVertexBuffer::writeData(size_t offset, size_t length, 
+            const void* pSource, bool discardWholeBuffer)
+    {
+        glBindBufferARB(GL_ARRAY_BUFFER_ARB, mBufferId);
+
+        // Update the shadow buffer
+        if(mUseShadowBuffer)
+        {
+            void* destData = mpShadowBuffer->lock(offset, length, 
+                discardWholeBuffer ? HBL_DISCARD : HBL_NORMAL);
+            memcpy(destData, pSource, length);
+            mpShadowBuffer->unlock();
+        }
+
+        if (offset == 0 && length == mSizeInBytes)
+        {
+            glBufferDataARB(GL_ARRAY_BUFFER_ARB, mSizeInBytes, pSource, 
+                GLHardwareBufferManager::getGLUsage(mUsage));
+        }
+        else
+        {
+            if(discardWholeBuffer)
+            {
+                glBufferDataARB(GL_ARRAY_BUFFER_ARB, mSizeInBytes, NULL, 
+                    GLHardwareBufferManager::getGLUsage(mUsage));
+            }
+
+            // Now update the real buffer
+            glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, offset, length, pSource); 
+        }
+    }
+	//---------------------------------------------------------------------
+    void GLHardwareVertexBuffer::_updateFromShadow(void)
+    {
+        if (mUseShadowBuffer && mShadowUpdated && !mSuppressHardwareUpdate)
+        {
+            const void *srcData = mpShadowBuffer->lock(
+                mLockStart, mLockSize, HBL_READ_ONLY);
+
+            glBindBufferARB(GL_ARRAY_BUFFER_ARB, mBufferId);
+
+            // Update whole buffer if possible, otherwise normal
+            if (mLockStart == 0 && mLockSize == mSizeInBytes)
+            {
+                glBufferDataARB(GL_ARRAY_BUFFER_ARB, mSizeInBytes, srcData,
+                    GLHardwareBufferManager::getGLUsage(mUsage));
+            }
+            else
+            {
+                glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, mLockStart, mLockSize, srcData);
+            }
+
+            mpShadowBuffer->unlock();
+            mShadowUpdated = false;
+        }
+    }
+}
Index: /RenderSystems/GL/src/OgreGLPBRenderTexture.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLPBRenderTexture.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLPBRenderTexture.cpp	(revision 5)
@@ -0,0 +1,166 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreGLPBRenderTexture.h"
+#include "OgreGLContext.h"
+#include "OgreGLPixelFormat.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreRoot.h"
+#include "OgreGLHardwarePixelBuffer.h"
+
+namespace Ogre {
+//-----------------------------------------------------------------------------  
+    GLPBuffer::GLPBuffer(PixelComponentType format, size_t width, size_t height):
+        mFormat(format),
+        mWidth(width),
+        mHeight(height)
+    {
+    }
+    GLPBuffer::~GLPBuffer()
+    {
+    }
+
+//-----------------------------------------------------------------------------  
+    GLPBRenderTexture::GLPBRenderTexture(GLPBRTTManager *manager, const String &name, const GLSurfaceDesc &target):
+        GLRenderTexture(name, target),
+        mManager(manager)
+    {
+        mPBFormat = PixelUtil::getComponentType(target.buffer->getFormat());
+        
+        mManager->requestPBuffer(mPBFormat, mWidth, mHeight);
+    }
+    GLPBRenderTexture::~GLPBRenderTexture()
+    {
+        // Release PBuffer
+        mManager->releasePBuffer(mPBFormat);
+    }
+    void GLPBRenderTexture::getCustomAttribute(const String& name, void* pData)
+    {
+        if(name=="TARGET")
+        {
+			GLSurfaceDesc &target = *static_cast<GLSurfaceDesc*>(pData);
+			target.buffer = static_cast<GLHardwarePixelBuffer*>(mBuffer);
+			target.zoffset = mZOffset;
+        }
+        else if(name=="GLCONTEXT")
+        {
+            // Get PBuffer for our internal format
+            *static_cast<GLContext**>(pData) = mManager->getContextFor(mPBFormat, mWidth, mHeight);
+        }
+    }
+//-----------------------------------------------------------------------------  
+    GLPBRTTManager::GLPBRTTManager(GLSupport *support, RenderTarget *mainwindow):
+        mSupport(support),
+		mMainWindow(mainwindow),
+		mMainContext(0)
+    {
+		mMainWindow->getCustomAttribute("GLCONTEXT", &mMainContext);
+    }  
+    GLPBRTTManager::~GLPBRTTManager()
+    {
+        // Delete remaining PBuffers
+        for(size_t x=0; x<PCT_COUNT; ++x)
+        {
+            delete mPBuffers[x].pb;
+        }
+    }
+
+    RenderTexture *GLPBRTTManager::createRenderTexture(const String &name, const GLSurfaceDesc &target)
+    {
+        return new GLPBRenderTexture(this, name, target);
+    }
+    
+    bool GLPBRTTManager::checkFormat(PixelFormat format) 
+    { 
+        return true; 
+    }
+
+    void GLPBRTTManager::bind(RenderTarget *target)
+    {
+        // Nothing to do here
+        // Binding of context is done by GL subsystem, as contexts are also used for RenderWindows
+    }
+
+    void GLPBRTTManager::unbind(RenderTarget *target)
+    { 
+		// Copy on unbind
+        GLSurfaceDesc surface;
+		surface.buffer = 0;
+        target->getCustomAttribute("TARGET", &surface);
+        if(surface.buffer)
+            static_cast<GLTextureBuffer*>(surface.buffer)->copyFromFramebuffer(surface.zoffset);
+    }
+    
+    void GLPBRTTManager::requestPBuffer(PixelComponentType ctype, size_t width, size_t height)
+    {
+        //Check size
+        if(mPBuffers[ctype].pb)
+        {
+            if(mPBuffers[ctype].pb->getWidth()<width || mPBuffers[ctype].pb->getHeight()<height)
+            {
+                // If the current PBuffer is too small, destroy it and create a new one
+                delete mPBuffers[ctype].pb;
+                mPBuffers[ctype].pb = 0;
+            }
+        }
+        if(!mPBuffers[ctype].pb)
+        {
+            // Create pbuffer via rendersystem
+            mPBuffers[ctype].pb = mSupport->createPBuffer(ctype, width, height);
+        }
+        
+        ++mPBuffers[ctype].refcount;
+    }
+    
+    void GLPBRTTManager::releasePBuffer(PixelComponentType ctype)
+    {
+        --mPBuffers[ctype].refcount;
+        if(mPBuffers[ctype].refcount == 0)
+        {
+            delete mPBuffers[ctype].pb;
+            mPBuffers[ctype].pb = 0;
+        }
+    }
+    
+    GLContext *GLPBRTTManager::getContextFor(PixelComponentType ctype, size_t width, size_t height)
+    {
+        // Faster to return main context if the RTT is smaller than the window size
+        // and ctype is PCT_BYTE. This must be checked every time because the window might have been resized
+		if(ctype == PCT_BYTE)
+		{
+			if(width <= mMainWindow->getWidth() && height <= mMainWindow->getHeight())
+				return mMainContext;
+		}
+        assert(mPBuffers[ctype].pb);
+        return mPBuffers[ctype].pb->getContext();
+    }
+//---------------------------------------------------------------------------------------------
+
+}
+
Index: /RenderSystems/GL/src/OgreGLPixelFormat.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLPixelFormat.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLPixelFormat.cpp	(revision 5)
@@ -0,0 +1,357 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLPixelFormat.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreBitwise.h"
+
+namespace Ogre  {
+	//-----------------------------------------------------------------------------
+    GLenum GLPixelUtil::getGLOriginFormat(PixelFormat mFormat)
+    {
+        switch(mFormat)
+        {
+			case PF_A8:
+				return GL_ALPHA;
+            case PF_L8:
+                return GL_LUMINANCE;
+            case PF_L16:
+                return GL_LUMINANCE;
+			case PF_BYTE_LA:
+				return GL_LUMINANCE_ALPHA;
+			case PF_R3G3B2:
+				return GL_RGB;
+			case PF_A1R5G5B5:
+				return GL_BGRA;
+			case PF_R5G6B5:
+				return GL_RGB;
+			case PF_B5G6R5:
+				return GL_BGR;
+			case PF_A4R4G4B4:
+				return GL_BGRA;
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+            // Formats are in native endian, so R8G8B8 on little endian is
+            // BGR, on big endian it is RGB.
+            case PF_R8G8B8:
+                return GL_RGB;
+            case PF_B8G8R8:
+                return GL_BGR;
+#else
+            case PF_R8G8B8:
+                return GL_BGR;
+            case PF_B8G8R8:
+                return GL_RGB;
+#endif
+			case PF_X8R8G8B8:
+			case PF_A8R8G8B8:
+				return GL_BGRA;
+			case PF_X8B8G8R8:
+            case PF_A8B8G8R8:
+                return GL_RGBA;
+            case PF_B8G8R8A8:
+                return GL_BGRA;
+			case PF_R8G8B8A8:
+				return GL_RGBA;
+            case PF_A2R10G10B10:
+                return GL_BGRA;
+            case PF_A2B10G10R10:
+                return GL_RGBA;
+			case PF_FLOAT16_R:
+                return GL_LUMINANCE;
+			case PF_FLOAT16_GR:
+				return GL_LUMINANCE_ALPHA;
+            case PF_FLOAT16_RGB:
+                return GL_RGB;
+            case PF_FLOAT16_RGBA:
+                return GL_RGBA;
+			case PF_FLOAT32_R:
+                return GL_LUMINANCE;
+			case PF_FLOAT32_GR:
+				return GL_LUMINANCE_ALPHA;
+            case PF_FLOAT32_RGB:
+                return GL_RGB;
+            case PF_FLOAT32_RGBA:
+                return GL_RGBA;
+			case PF_SHORT_RGBA:
+				return GL_RGBA;
+            case PF_SHORT_RGB:
+                return GL_RGB;
+			case PF_SHORT_GR:
+				return GL_LUMINANCE_ALPHA;
+            case PF_DXT1:
+                return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
+            case PF_DXT3:
+                 return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
+            case PF_DXT5:
+                 return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
+            default:
+                return 0;
+        }
+    }
+	//----------------------------------------------------------------------------- 
+    GLenum GLPixelUtil::getGLOriginDataType(PixelFormat mFormat)
+    {
+        switch(mFormat)
+        {
+			case PF_A8:
+            case PF_L8:
+            case PF_R8G8B8:
+            case PF_B8G8R8:
+			case PF_BYTE_LA:
+                return GL_UNSIGNED_BYTE;
+			case PF_R3G3B2:
+				return GL_UNSIGNED_BYTE_3_3_2;
+			case PF_A1R5G5B5:
+				return GL_UNSIGNED_SHORT_1_5_5_5_REV;
+			case PF_R5G6B5:
+			case PF_B5G6R5:
+				return GL_UNSIGNED_SHORT_5_6_5;
+			case PF_A4R4G4B4:
+				return GL_UNSIGNED_SHORT_4_4_4_4_REV;
+            case PF_L16:
+                return GL_UNSIGNED_SHORT;
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+			case PF_X8B8G8R8:
+			case PF_A8B8G8R8:
+                return GL_UNSIGNED_INT_8_8_8_8_REV;
+			case PF_X8R8G8B8:
+            case PF_A8R8G8B8:
+				return GL_UNSIGNED_INT_8_8_8_8_REV;
+            case PF_B8G8R8A8:
+                return GL_UNSIGNED_BYTE;
+			case PF_R8G8B8A8:
+				return GL_UNSIGNED_BYTE;
+#else
+			case PF_X8B8G8R8:
+			case PF_A8B8G8R8:
+                return GL_UNSIGNED_BYTE;
+			case PF_X8R8G8B8:
+            case PF_A8R8G8B8:
+				return GL_UNSIGNED_BYTE;
+            case PF_B8G8R8A8:
+                return GL_UNSIGNED_INT_8_8_8_8;
+			case PF_R8G8B8A8:
+				return GL_UNSIGNED_INT_8_8_8_8;
+#endif
+            case PF_A2R10G10B10:
+                return GL_UNSIGNED_INT_2_10_10_10_REV;
+            case PF_A2B10G10R10:
+                return GL_UNSIGNED_INT_2_10_10_10_REV;
+			case PF_FLOAT16_R:
+			case PF_FLOAT16_GR:
+            case PF_FLOAT16_RGB:
+            case PF_FLOAT16_RGBA:
+                return GL_HALF_FLOAT_ARB;
+			case PF_FLOAT32_R:
+			case PF_FLOAT32_GR:
+            case PF_FLOAT32_RGB:
+            case PF_FLOAT32_RGBA:
+                return GL_FLOAT;
+			case PF_SHORT_RGBA:
+            case PF_SHORT_RGB:
+			case PF_SHORT_GR:
+				return GL_UNSIGNED_SHORT;
+            default:
+                return 0;
+        }
+    }
+    
+    GLenum GLPixelUtil::getGLInternalFormat(PixelFormat mFormat)
+    {
+        switch(mFormat) {
+            case PF_L8:
+                return GL_LUMINANCE8;
+            case PF_L16:
+                return GL_LUMINANCE16;
+            case PF_A8:
+                return GL_ALPHA8;
+            case PF_A4L4:
+                return GL_LUMINANCE4_ALPHA4;
+			case PF_BYTE_LA:
+				return GL_LUMINANCE8_ALPHA8;
+			case PF_R3G3B2:
+				return GL_R3_G3_B2;
+			case PF_A1R5G5B5:
+				return GL_RGB5_A1;
+            case PF_R5G6B5:
+			case PF_B5G6R5:
+                return GL_RGB5;
+            case PF_A4R4G4B4:
+                return GL_RGBA4;
+            case PF_R8G8B8:
+            case PF_B8G8R8:
+			case PF_X8B8G8R8:
+			case PF_X8R8G8B8:
+                return GL_RGB8;
+            case PF_A8R8G8B8:
+            case PF_B8G8R8A8:
+                return GL_RGBA8;
+            case PF_A2R10G10B10:
+            case PF_A2B10G10R10:
+                return GL_RGB10_A2;
+			case PF_FLOAT16_R:
+				return GL_LUMINANCE16F_ARB;
+            case PF_FLOAT16_RGB:
+                return GL_RGB16F_ARB;
+			case PF_FLOAT16_GR: 
+				return GL_LUMINANCE_ALPHA16F_ARB;
+            case PF_FLOAT16_RGBA:
+                return GL_RGBA16F_ARB;
+			case PF_FLOAT32_R:
+				return GL_LUMINANCE32F_ARB;
+			case PF_FLOAT32_GR:
+				return GL_LUMINANCE_ALPHA32F_ARB;
+            case PF_FLOAT32_RGB:
+                return GL_RGB32F_ARB;
+            case PF_FLOAT32_RGBA:
+                return GL_RGBA32F_ARB;
+			case PF_SHORT_RGBA:
+				return GL_RGBA16;
+            case PF_SHORT_RGB:
+                return GL_RGB16;
+			case PF_SHORT_GR:
+				return GL_LUMINANCE16_ALPHA16;
+			case PF_DXT1:
+                return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
+            case PF_DXT3:
+                return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
+            case PF_DXT5:
+                return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
+            default:
+                return GL_NONE;
+        }
+    }
+
+    GLenum GLPixelUtil::getClosestGLInternalFormat(PixelFormat mFormat)
+    {
+        GLenum format = getGLInternalFormat(mFormat);
+        if(format==GL_NONE)
+            return GL_RGBA8;
+        else
+            return format;
+    }
+	
+	//----------------------------------------------------------------------------- 	
+	PixelFormat GLPixelUtil::getClosestOGREFormat(GLenum fmt)
+	{
+		switch(fmt) 
+		{
+		case GL_LUMINANCE8:
+			return PF_L8;
+		case GL_LUMINANCE16:
+			return PF_L16;
+		case GL_ALPHA8:
+			return PF_A8;
+		case GL_LUMINANCE4_ALPHA4:
+			// Unsupported by GL as input format, use the byte packed format
+			return PF_BYTE_LA;
+		case GL_LUMINANCE8_ALPHA8:
+			return PF_BYTE_LA;
+		case GL_R3_G3_B2:
+			return PF_R3G3B2;
+		case GL_RGB5_A1:
+			return PF_A1R5G5B5;
+		case GL_RGB5:
+			return PF_R5G6B5;
+		case GL_RGBA4:
+			return PF_A4R4G4B4;
+		case GL_RGB8:
+			return PF_X8R8G8B8;
+		case GL_RGBA8:
+			return PF_A8R8G8B8;
+		case GL_RGB10_A2:
+			return PF_A2R10G10B10;
+		case GL_RGBA16:
+			return PF_SHORT_RGBA;
+        case GL_RGB16:
+            return PF_SHORT_RGB;
+		case GL_LUMINANCE16_ALPHA16:
+			return PF_SHORT_GR;
+		case GL_LUMINANCE_FLOAT16_ATI:
+			return PF_FLOAT16_R;
+		case GL_LUMINANCE_ALPHA_FLOAT16_ATI:
+			return PF_FLOAT16_GR;
+		case GL_LUMINANCE_ALPHA_FLOAT32_ATI:
+			return PF_FLOAT32_GR;
+		case GL_LUMINANCE_FLOAT32_ATI:
+			return PF_FLOAT32_R;
+		case GL_RGB_FLOAT16_ATI: // GL_RGB16F_ARB
+			return PF_FLOAT16_RGB;
+		case GL_RGBA_FLOAT16_ATI:
+			return PF_FLOAT16_RGBA;
+		case GL_RGB_FLOAT32_ATI:
+			return PF_FLOAT32_RGB;
+		case GL_RGBA_FLOAT32_ATI:
+			return PF_FLOAT32_RGBA;
+		case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
+		case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+			return PF_DXT1;
+		case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
+			return PF_DXT3;
+		case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
+			return PF_DXT5;
+		default:
+			return PF_A8R8G8B8;
+		};
+	}
+	//----------------------------------------------------------------------------- 
+
+	size_t GLPixelUtil::getMaxMipmaps(size_t width, size_t height, size_t depth, PixelFormat format)
+	{
+		size_t count = 0;
+		do {
+			if(width>1)		width = width/2;
+			if(height>1)	height = height/2;
+			if(depth>1)		depth = depth/2;
+			/*
+			NOT needed, compressed formats will have mipmaps up to 1x1
+			if(PixelUtil::isValidExtent(width, height, depth, format))
+				count ++;
+			else
+				break;
+			*/
+				
+			count ++;
+		} while(!(width == 1 && height == 1 && depth == 1));
+		
+		return count;
+	}
+    //-----------------------------------------------------------------------------    
+    size_t GLPixelUtil::optionalPO2(size_t value)
+    {
+        const RenderSystemCapabilities *caps = Root::getSingleton().getRenderSystem()->getCapabilities();
+        if(caps->hasCapability(RSC_NON_POWER_OF_2_TEXTURES))
+            return value;
+        else
+            return Bitwise::firstPO2From((uint32)value);
+    }   
+
+	
+};
Index: /RenderSystems/GL/src/OgreGLPlugin.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLPlugin.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLPlugin.cpp	(revision 5)
@@ -0,0 +1,73 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLPlugin.h"
+#include "OgreRoot.h"
+
+namespace Ogre 
+{
+	const String sPluginName = "GL RenderSystem";
+	//---------------------------------------------------------------------
+	GLPlugin::GLPlugin()
+		: mRenderSystem(0)
+	{
+
+	}
+	//---------------------------------------------------------------------
+	const String& GLPlugin::getName() const
+	{
+		return sPluginName;
+	}
+	//---------------------------------------------------------------------
+	void GLPlugin::install()
+	{
+		mRenderSystem = new GLRenderSystem();
+
+		Root::getSingleton().addRenderSystem(mRenderSystem);
+	}
+	//---------------------------------------------------------------------
+	void GLPlugin::initialise()
+	{
+		// nothing to do
+	}
+	//---------------------------------------------------------------------
+	void GLPlugin::shutdown()
+	{
+		// nothing to do
+	}
+	//---------------------------------------------------------------------
+	void GLPlugin::uninstall()
+	{
+		delete mRenderSystem;
+		mRenderSystem = 0;
+
+	}
+
+
+}
Index: /RenderSystems/GL/src/OgreGLRenderSystem.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLRenderSystem.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLRenderSystem.cpp	(revision 5)
@@ -0,0 +1,2973 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.s
+-----------------------------------------------------------------------------
+*/
+
+
+#include "OgreGLRenderSystem.h"
+#include "OgreRenderSystem.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreLight.h"
+#include "OgreCamera.h"
+#include "OgreGLTextureManager.h"
+#include "OgreGLHardwareVertexBuffer.h"
+#include "OgreGLHardwareIndexBuffer.h"
+#include "OgreGLDefaultHardwareBufferManager.h"
+#include "OgreGLUtil.h"
+#include "OgreGLGpuProgram.h"
+#include "OgreGLGpuNvparseProgram.h"
+#include "ATI_FS_GLGpuProgram.h"
+#include "OgreGLGpuProgramManager.h"
+#include "OgreException.h"
+#include "OgreGLSLExtSupport.h"
+#include "OgreGLHardwareOcclusionQuery.h"
+#include "OgreGLContext.h"
+
+#include "OgreGLFBORenderTexture.h"
+#include "OgreGLPBRenderTexture.h"
+#include "OgreConfig.h"
+
+// Convenience macro from ARB_vertex_buffer_object spec
+#define VBO_BUFFER_OFFSET(i) ((char *)NULL + (i))
+GLenum glewContextInit (Ogre::GLSupport *glSupport);
+
+namespace Ogre {
+
+    // Callback function used when registering GLGpuPrograms
+    GpuProgram* createGLArbGpuProgram(ResourceManager* creator, 
+        const String& name, ResourceHandle handle, 
+        const String& group, bool isManual, ManualResourceLoader* loader,
+        GpuProgramType gptype, const String& syntaxCode)
+    {
+        GLArbGpuProgram* ret = new GLArbGpuProgram(
+            creator, name, handle, group, isManual, loader);
+        ret->setType(gptype);
+        ret->setSyntaxCode(syntaxCode);
+        return ret;
+    }
+
+    GpuProgram* createGLGpuNvparseProgram(ResourceManager* creator, 
+        const String& name, ResourceHandle handle, 
+        const String& group, bool isManual, ManualResourceLoader* loader,
+        GpuProgramType gptype, const String& syntaxCode)
+    {
+        GLGpuNvparseProgram* ret = new GLGpuNvparseProgram(
+            creator, name, handle, group, isManual, loader);
+        ret->setType(gptype);
+        ret->setSyntaxCode(syntaxCode);
+        return ret;
+    }
+
+    GpuProgram* createGL_ATI_FS_GpuProgram(ResourceManager* creator, 
+        const String& name, ResourceHandle handle, 
+        const String& group, bool isManual, ManualResourceLoader* loader,
+        GpuProgramType gptype, const String& syntaxCode)
+	{
+
+        ATI_FS_GLGpuProgram* ret = new ATI_FS_GLGpuProgram(
+            creator, name, handle, group, isManual, loader);
+        ret->setType(gptype);
+        ret->setSyntaxCode(syntaxCode);
+        return ret;
+	}
+
+    GLRenderSystem::GLRenderSystem()
+      : mDepthWrite(true), mStencilMask(0xFFFFFFFF), mHardwareBufferManager(0),
+        mGpuProgramManager(0),
+        mGLSLProgramFactory(0),
+        mRTTManager(0)
+    {
+        size_t i;
+
+        LogManager::getSingleton().logMessage(getName() + " created.");
+
+        // Get our GLSupport
+        mGLSupport = getGLSupport();
+
+        for( i=0; i<MAX_LIGHTS; i++ )
+            mLights[i] = NULL;
+
+        mWorldMatrix = Matrix4::IDENTITY;
+        mViewMatrix = Matrix4::IDENTITY;
+        
+        initConfigOptions();
+
+        mColourWrite[0] = mColourWrite[1] = mColourWrite[2] = mColourWrite[3] = true;
+
+        for (i = 0; i < OGRE_MAX_TEXTURE_LAYERS; i++)
+        {
+			// Dummy value
+            mTextureCoordIndex[i] = 99;
+        }
+
+        for (i = 0; i < OGRE_MAX_TEXTURE_LAYERS; i++)
+        {
+            mTextureTypes[i] = 0;
+        }
+
+        mActiveRenderTarget = 0;
+        mCurrentContext = 0;
+        mMainContext = 0;
+
+        mGLInitialized = false;
+
+        mCurrentLights = 0;
+        mMinFilter = FO_LINEAR;
+        mMipFilter = FO_POINT;
+        mCurrentVertexProgram = 0;
+        mCurrentFragmentProgram = 0;
+
+        mClipPlanes.reserve(6);
+
+    }
+
+    GLRenderSystem::~GLRenderSystem()
+    {
+        shutdown();
+
+        // Destroy render windows
+        RenderTargetMap::iterator i;
+        for (i = mRenderTargets.begin(); i != mRenderTargets.end(); ++i)
+        {
+            delete i->second;
+        }
+        mRenderTargets.clear();
+
+        delete mGLSupport;
+    }
+
+    const String& GLRenderSystem::getName(void) const
+    {
+        static String strName("OpenGL Rendering Subsystem");
+        return strName;
+    }
+
+    void GLRenderSystem::initConfigOptions(void)
+    {
+        mGLSupport->addConfig();
+    }
+    
+    ConfigOptionMap& GLRenderSystem::getConfigOptions(void)
+    {
+        return mGLSupport->getConfigOptions();
+    }
+
+    void GLRenderSystem::setConfigOption(const String &name, const String &value)
+    {
+        mGLSupport->setConfigOption(name, value);
+    }
+
+    String GLRenderSystem::validateConfigOptions(void)
+    {
+        // XXX Return an error string if something is invalid
+        return mGLSupport->validateConfig();
+    }
+
+    RenderWindow* GLRenderSystem::initialise(bool autoCreateWindow, const String& windowTitle)
+    {
+        mGLSupport->start();
+        
+		RenderWindow* autoWindow = mGLSupport->createWindow(autoCreateWindow, this, windowTitle);
+
+
+        _setCullingMode( mCullingMode );
+        
+        return autoWindow;
+    }
+
+    void GLRenderSystem::initGL(RenderTarget *primary)
+    {
+        // Set main and current context
+        mMainContext = 0;
+        primary->getCustomAttribute("GLCONTEXT", &mMainContext);
+        mCurrentContext = mMainContext;
+        
+        // Set primary context as active
+        if(mCurrentContext)
+            mCurrentContext->setCurrent();
+            
+        // Setup GLSupport
+        mGLSupport->initialiseExtensions();
+
+        LogManager::getSingleton().logMessage("***************************");
+		LogManager::getSingleton().logMessage("*** GL Renderer Started ***");
+		LogManager::getSingleton().logMessage("***************************");
+
+		// Get extension function pointers
+        glewContextInit(mGLSupport);
+
+        // Check for hardware mipmapping support.
+        if(GLEW_VERSION_1_4 || GLEW_SGIS_generate_mipmap)
+        {
+            mCapabilities->setCapability(RSC_AUTOMIPMAP);
+        }
+
+        // Check for blending support
+        if(GLEW_VERSION_1_3 || 
+            GLEW_ARB_texture_env_combine || 
+            GLEW_EXT_texture_env_combine)
+        {
+            mCapabilities->setCapability(RSC_BLENDING);
+        }
+
+        // Check for Multitexturing support and set number of texture units
+        if(GLEW_VERSION_1_3 || 
+           GLEW_ARB_multitexture)
+        {
+            GLint units;
+            glGetIntegerv( GL_MAX_TEXTURE_UNITS, &units );
+			mFixedFunctionTextureUnits = units;
+
+			if (GLEW_ARB_fragment_program)
+			{
+				// Also check GL_MAX_TEXTURE_IMAGE_UNITS_ARB since NV at least
+				// only increased this on the FX/6x00 series
+				GLint arbUnits;
+				glGetIntegerv( GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &arbUnits );
+				if (arbUnits > units)
+					units = arbUnits;
+			}
+	    
+            mCapabilities->setNumTextureUnits(units);
+
+        }
+        else
+        {
+            // If no multitexture support then set one texture unit
+            mCapabilities->setNumTextureUnits(1);
+        }
+            
+        // Check for Anisotropy support
+        if(GLEW_EXT_texture_filter_anisotropic)
+        {
+            mCapabilities->setCapability(RSC_ANISOTROPY);
+        }
+
+        // Check for DOT3 support
+        if(GLEW_VERSION_1_3 ||
+           GLEW_ARB_texture_env_dot3 ||
+           GLEW_EXT_texture_env_dot3)
+        {
+            mCapabilities->setCapability(RSC_DOT3);
+        }
+
+        // Check for cube mapping
+        if(GLEW_VERSION_1_3 || 
+           GLEW_ARB_texture_cube_map ||
+           GLEW_EXT_texture_cube_map)
+        {
+            mCapabilities->setCapability(RSC_CUBEMAPPING);
+        }
+        
+
+		// Point sprites
+		if (GLEW_VERSION_2_0 ||
+			GLEW_ARB_point_sprite)
+		{
+			mCapabilities->setCapability(RSC_POINT_SPRITES);
+		}
+        // Check for point parameters
+        if(GLEW_VERSION_1_4 ||
+			GLEW_ARB_point_parameters ||
+			GLEW_EXT_point_parameters)
+        {
+            mCapabilities->setCapability(RSC_POINT_EXTENDED_PARAMETERS);
+        }
+		
+        // Check for hardware stencil support and set bit depth
+        GLint stencil;
+        glGetIntegerv(GL_STENCIL_BITS,&stencil);
+
+        if(stencil)
+        {
+            mCapabilities->setCapability(RSC_HWSTENCIL);
+            mCapabilities->setStencilBufferBitDepth(stencil);
+        }
+
+        // Check for VBO support
+        if(GLEW_VERSION_1_5 || GLEW_ARB_vertex_buffer_object)
+        {
+            // Some buggy driver claim that it is GL 1.5 compliant and
+            // not support ARB_vertex_buffer_object
+            if (!GLEW_ARB_vertex_buffer_object)
+            {
+                // Assign ARB functions same to GL 1.5 version since
+                // interface identical
+                glBindBufferARB = glBindBuffer;
+                glBufferDataARB = glBufferData;
+                glBufferSubDataARB = glBufferSubData;
+                glDeleteBuffersARB = glDeleteBuffers;
+                glGenBuffersARB = glGenBuffers;
+                glGetBufferParameterivARB = glGetBufferParameteriv;
+                glGetBufferPointervARB = glGetBufferPointerv;
+                glGetBufferSubDataARB = glGetBufferSubData;
+                glIsBufferARB = glIsBuffer;
+                glMapBufferARB = glMapBuffer;
+                glUnmapBufferARB = glUnmapBuffer;
+            }
+
+            mCapabilities->setCapability(RSC_VBO);
+
+            mHardwareBufferManager = new GLHardwareBufferManager;
+        }
+        else
+        {
+            mHardwareBufferManager = new GLDefaultHardwareBufferManager;
+        }
+
+        // XXX Need to check for nv2 support and make a program manager for it
+        // XXX Probably nv1 as well for older cards
+        // GPU Program Manager setup
+        mGpuProgramManager = new GLGpuProgramManager();
+
+		if(GLEW_ARB_vertex_program)
+        {
+            mCapabilities->setCapability(RSC_VERTEX_PROGRAM);
+
+            // Vertex Program Properties
+            mCapabilities->setMaxVertexProgramVersion("arbvp1");
+            mCapabilities->setVertexProgramConstantBoolCount(0);
+            mCapabilities->setVertexProgramConstantIntCount(0);
+
+            GLint floatConstantCount;
+            glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB, &floatConstantCount);
+            mCapabilities->setVertexProgramConstantFloatCount(floatConstantCount);
+
+            mGpuProgramManager->_pushSyntaxCode("arbvp1");
+            mGpuProgramManager->registerProgramFactory("arbvp1", createGLArbGpuProgram);
+			if (GLEW_NV_vertex_program2_option)
+			{
+				mCapabilities->setMaxVertexProgramVersion("vp30");
+				mGpuProgramManager->_pushSyntaxCode("vp30");
+				mGpuProgramManager->registerProgramFactory("vp30", createGLArbGpuProgram);
+			}
+
+			if (GLEW_NV_vertex_program3)
+			{
+				mCapabilities->setMaxVertexProgramVersion("vp40");
+				mGpuProgramManager->_pushSyntaxCode("vp40");
+				mGpuProgramManager->registerProgramFactory("vp40", createGLArbGpuProgram);
+			}
+		}
+
+        if (GLEW_NV_register_combiners2 &&
+            GLEW_NV_texture_shader)
+        {
+            mCapabilities->setCapability(RSC_FRAGMENT_PROGRAM);
+            mCapabilities->setMaxFragmentProgramVersion("fp20");
+
+            mGpuProgramManager->_pushSyntaxCode("fp20");
+            mGpuProgramManager->registerProgramFactory("fp20", createGLGpuNvparseProgram);
+        }
+
+		// NFZ - check for ATI fragment shader support
+		if (GLEW_ATI_fragment_shader)
+		{
+            mCapabilities->setCapability(RSC_FRAGMENT_PROGRAM);
+            mCapabilities->setMaxFragmentProgramVersion("ps_1_4");
+            // no boolean params allowed
+            mCapabilities->setFragmentProgramConstantBoolCount(0);
+            // no integer params allowed
+            mCapabilities->setFragmentProgramConstantIntCount(0);
+
+			// only 8 Vector4 constant floats supported
+            mCapabilities->setFragmentProgramConstantFloatCount(8);
+
+            mGpuProgramManager->_pushSyntaxCode("ps_1_4");
+            mGpuProgramManager->_pushSyntaxCode("ps_1_3");
+            mGpuProgramManager->_pushSyntaxCode("ps_1_2");
+            mGpuProgramManager->_pushSyntaxCode("ps_1_1");
+
+            mGpuProgramManager->registerProgramFactory("ps_1_4", createGL_ATI_FS_GpuProgram);
+            mGpuProgramManager->registerProgramFactory("ps_1_3", createGL_ATI_FS_GpuProgram);
+            mGpuProgramManager->registerProgramFactory("ps_1_2", createGL_ATI_FS_GpuProgram);
+            mGpuProgramManager->registerProgramFactory("ps_1_1", createGL_ATI_FS_GpuProgram);
+		}
+
+        if (GLEW_ARB_fragment_program)
+        {
+            mCapabilities->setCapability(RSC_FRAGMENT_PROGRAM);
+
+            // Fragment Program Properties
+            mCapabilities->setMaxFragmentProgramVersion("arbfp1");
+            mCapabilities->setFragmentProgramConstantBoolCount(0);
+            mCapabilities->setFragmentProgramConstantIntCount(0);
+
+            GLint floatConstantCount;
+            glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB, &floatConstantCount);
+            mCapabilities->setFragmentProgramConstantFloatCount(floatConstantCount);
+
+            mGpuProgramManager->_pushSyntaxCode("arbfp1");
+            mGpuProgramManager->registerProgramFactory("arbfp1", createGLArbGpuProgram);
+			if (GLEW_NV_fragment_program_option)
+			{
+				mCapabilities->setMaxFragmentProgramVersion("fp30");
+				mGpuProgramManager->_pushSyntaxCode("fp30");
+				mGpuProgramManager->registerProgramFactory("fp30", createGLArbGpuProgram);
+			}
+
+			if (GLEW_NV_fragment_program2)
+			{
+				mCapabilities->setMaxFragmentProgramVersion("fp40");
+				mGpuProgramManager->_pushSyntaxCode("fp40");
+				mGpuProgramManager->registerProgramFactory("fp40", createGLArbGpuProgram);
+			}        
+		}
+
+		// NFZ - Check if GLSL is supported
+		if ( GLEW_VERSION_2_0 || 
+			(GLEW_ARB_shading_language_100 &&
+			 GLEW_ARB_shader_objects &&
+			 GLEW_ARB_fragment_shader &&
+			 GLEW_ARB_vertex_shader) )
+		{
+			// NFZ - check for GLSL vertex and fragment shader support successful
+            mGLSLProgramFactory = new GLSLProgramFactory();
+            HighLevelGpuProgramManager::getSingleton().addFactory(mGLSLProgramFactory);
+            mGpuProgramManager->_pushSyntaxCode("glsl");
+			LogManager::getSingleton().logMessage("GLSL support detected");
+		}
+
+		// Check for texture compression
+        if(GLEW_VERSION_1_3 || GLEW_ARB_texture_compression)
+        {   
+            mCapabilities->setCapability(RSC_TEXTURE_COMPRESSION);
+         
+            // Check for dxt compression
+            if(GLEW_EXT_texture_compression_s3tc)
+            {
+                mCapabilities->setCapability(RSC_TEXTURE_COMPRESSION_DXT);
+            }
+            // Check for vtc compression
+            if(GLEW_NV_texture_compression_vtc)
+            {
+                mCapabilities->setCapability(RSC_TEXTURE_COMPRESSION_VTC);
+            }
+        }
+
+        // Scissor test is standard in GL 1.2 (is it emulated on some cards though?)
+        mCapabilities->setCapability(RSC_SCISSOR_TEST);
+		// As are user clipping planes
+		mCapabilities->setCapability(RSC_USER_CLIP_PLANES);
+
+        // 2-sided stencil?
+        if (GLEW_VERSION_2_0 || GLEW_EXT_stencil_two_side)
+        {
+            mCapabilities->setCapability(RSC_TWO_SIDED_STENCIL);
+        }
+        // stencil wrapping?
+        if (GLEW_VERSION_1_4 || GLEW_EXT_stencil_wrap)
+        {
+            mCapabilities->setCapability(RSC_STENCIL_WRAP);
+        }
+
+        // Check for hardware occlusion support
+        if(GLEW_VERSION_1_5 || GLEW_ARB_occlusion_query)
+        {
+            // Some buggy driver claim that it is GL 1.5 compliant and
+            // not support ARB_occlusion_query
+            if (!GLEW_ARB_occlusion_query)
+            {
+                // Assign ARB functions same to GL 1.5 version since
+                // interface identical
+                glBeginQueryARB = glBeginQuery;
+                glDeleteQueriesARB = glDeleteQueries;
+                glEndQueryARB = glEndQuery;
+                glGenQueriesARB = glGenQueries;
+                glGetQueryObjectivARB = glGetQueryObjectiv;
+                glGetQueryObjectuivARB = glGetQueryObjectuiv;
+                glGetQueryivARB = glGetQueryiv;
+                glIsQueryARB = glIsQuery;
+            }
+
+            mCapabilities->setCapability(RSC_HWOCCLUSION);		
+        }
+		else if (GLEW_NV_occlusion_query)
+		{
+			// Support NV extension too for old hardware
+            mCapabilities->setCapability(RSC_HWOCCLUSION);		
+		}
+
+		// UBYTE4 always supported
+		mCapabilities->setCapability(RSC_VERTEX_FORMAT_UBYTE4);
+
+        // Inifinite far plane always supported
+        mCapabilities->setCapability(RSC_INFINITE_FAR_PLANE);
+
+        // Check for non-power-of-2 texture support
+		if(GLEW_ARB_texture_non_power_of_two)
+        {
+            mCapabilities->setCapability(RSC_NON_POWER_OF_2_TEXTURES);
+        }
+
+        // Check for Float textures
+        if(GLEW_ATI_texture_float || GLEW_ARB_texture_float)
+        {
+            mCapabilities->setCapability(RSC_TEXTURE_FLOAT);
+        }
+        
+		// 3D textures should be supported by GL 1.2, which is our minimum version
+        mCapabilities->setCapability(RSC_TEXTURE_3D);
+        
+        /// Do this after extension function pointers are initialised as the extension
+        /// is used to probe further capabilities.
+		ConfigOptionMap::iterator cfi = getConfigOptions().find("RTT Preferred Mode");
+		// RTT Mode: 0 use whatever available, 1 use PBuffers, 2 force use copying
+		int rttMode = 0;
+		if (cfi != getConfigOptions().end())
+		{
+			if (cfi->second.currentValue == "PBuffer")
+			{
+				rttMode = 1;
+			}
+			else if (cfi->second.currentValue == "Copy")
+			{
+				rttMode = 2;
+			}
+		}
+         // Check for framebuffer object extension
+        if(GLEW_EXT_framebuffer_object && rttMode < 1)
+        {
+			// Probe number of draw buffers
+			// Only makes sense with FBO support, so probe here
+			if(GLEW_VERSION_2_0 || 
+				GLEW_ARB_draw_buffers ||
+				GLEW_ATI_draw_buffers)
+			{
+				GLint buffers;
+				glGetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &buffers);
+				mCapabilities->setNumMultiRenderTargets(std::min(buffers, OGRE_MAX_MULTIPLE_RENDER_TARGETS));
+				if(!GLEW_VERSION_2_0)
+				{
+					// Before GL version 2.0, we need to get one of the extensions
+					if(GLEW_ARB_draw_buffers)
+						__glewDrawBuffers = glDrawBuffersARB;
+					else if(GLEW_ATI_draw_buffers)
+						__glewDrawBuffers = glDrawBuffersATI;
+				}
+			}
+			// Create FBO manager
+            LogManager::getSingleton().logMessage("GL: Using GL_EXT_framebuffer_object for rendering to textures (best)");
+            //mRTTManager = new GLFBOManager(mGLSupport->getGLVendor() == "ATI");
+            mRTTManager = new GLFBOManager(false);
+            mCapabilities->setCapability(RSC_HWRENDER_TO_TEXTURE);
+        }
+        else
+        {
+            // Check GLSupport for PBuffer support
+            if(mGLSupport->supportsPBuffers() && rttMode < 2)
+            {
+                // Use PBuffers
+                mRTTManager = new GLPBRTTManager(mGLSupport, primary);
+                LogManager::getSingleton().logMessage("GL: Using PBuffers for rendering to textures");
+                mCapabilities->setCapability(RSC_HWRENDER_TO_TEXTURE);
+            }
+            else
+            {
+                // No pbuffer support either -- fallback to simplest copying from framebuffer
+                mRTTManager = new GLCopyingRTTManager();
+                LogManager::getSingleton().logMessage("GL: Using framebuffer copy for rendering to textures (worst)");
+                LogManager::getSingleton().logMessage("GL: Warning: RenderTexture size is restricted to size of framebuffer. If you are on Linux, consider using GLX instead of SDL.");
+            }
+        }
+
+		// Point size
+		float ps;
+		glGetFloatv(GL_POINT_SIZE_MAX, &ps);
+		mCapabilities->setMaxPointSize(ps);
+
+		// Vertex texture fetching
+		GLint vUnits;
+		glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB, &vUnits);
+		mCapabilities->setNumVertexTextureUnits(static_cast<ushort>(vUnits));
+		if (vUnits > 0)
+		{
+			mCapabilities->setCapability(RSC_VERTEX_TEXTURE_FETCH);
+		}
+		// GL always shares vertex and fragment texture units (for now?)
+		mCapabilities->setVertexTextureUnitsShared(true);
+
+		// Mipmap LOD biasing?
+		if (GLEW_VERSION_1_4 || GLEW_EXT_texture_lod_bias)
+		{
+			mCapabilities->setCapability(RSC_MIPMAP_LOD_BIAS);
+		}
+
+        
+		Log* defaultLog = LogManager::getSingleton().getDefaultLog();
+		if (defaultLog)
+		{
+			mCapabilities->log(defaultLog);
+		}
+
+        /// Create the texture manager        
+        mTextureManager = new GLTextureManager(*mGLSupport); 
+
+        mGLInitialized = true;
+    }
+
+    void GLRenderSystem::reinitialise(void)
+    {
+        this->shutdown();
+        this->initialise(true);
+    }
+
+    void GLRenderSystem::shutdown(void)
+    {
+        RenderSystem::shutdown();
+
+        // Deleting the GLSL program factory
+        if (mGLSLProgramFactory)
+        {
+            // Remove from manager safely
+            if (HighLevelGpuProgramManager::getSingletonPtr())
+                HighLevelGpuProgramManager::getSingleton().removeFactory(mGLSLProgramFactory);
+		    delete mGLSLProgramFactory;
+		    mGLSLProgramFactory = 0;
+        }
+
+        // Deleting the GPU program manager and hardware buffer manager.  Has to be done before the mGLSupport->stop().
+        delete mGpuProgramManager;
+        mGpuProgramManager = 0;
+        
+        delete mHardwareBufferManager;
+        mHardwareBufferManager = 0;
+        
+        delete mRTTManager;
+        mRTTManager = 0;
+
+		// Delete extra threads contexts
+		for (GLContextList::iterator i = mBackgroundContextList.begin(); 
+			i != mBackgroundContextList.end(); ++i)
+		{
+			delete *i;
+		}
+		mBackgroundContextList.clear();
+
+        mGLSupport->stop();
+        mStopRendering = true;
+
+		delete mTextureManager;
+		mTextureManager = 0;
+
+		// There will be a new initial window and so forth, thus any call to test
+		//  some params will access an invalid pointer, so it is best to reset
+		//  the whole state.
+		mGLInitialized = 0;
+    }
+
+    void GLRenderSystem::setAmbientLight(float r, float g, float b)
+    {
+        GLfloat lmodel_ambient[] = {r, g, b, 1.0};
+        glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+    }
+
+    void GLRenderSystem::setShadingType(ShadeOptions so)
+    {
+        switch(so)
+        {
+        case SO_FLAT:
+            glShadeModel(GL_FLAT);
+            break;
+        default:
+            glShadeModel(GL_SMOOTH);
+            break;
+        }
+    }
+
+	RenderWindow* GLRenderSystem::createRenderWindow(const String &name, 
+		unsigned int width, unsigned int height, bool fullScreen,
+		const NameValuePairList *miscParams)
+    {
+        if (mRenderTargets.find(name) != mRenderTargets.end())
+        {
+            OGRE_EXCEPT(
+                Exception::ERR_INVALIDPARAMS, 
+                "Window with name '" + name + "' already exists",
+                "GLRenderSystem::createRenderWindow" );
+        }
+		// Log a message
+		std::stringstream ss;
+		ss << "GLRenderSystem::createRenderWindow \"" << name << "\", " <<
+			width << "x" << height << " ";
+		if(fullScreen)
+			ss << "fullscreen ";
+		else
+			ss << "windowed ";
+		if(miscParams)
+		{
+			ss << " miscParams: ";
+			NameValuePairList::const_iterator it;
+			for(it=miscParams->begin(); it!=miscParams->end(); ++it)
+			{
+				ss << it->first << "=" << it->second << " ";
+			}
+			LogManager::getSingleton().logMessage(ss.str());
+		}
+
+        // Create the window
+        RenderWindow* win = mGLSupport->newWindow(name, width, height, 
+            fullScreen, miscParams);
+
+        attachRenderTarget( *win );
+
+        if (!mGLInitialized) 
+        {                
+            // Initialise GL after the first window has been created
+            initGL(win);
+            
+            // Initialise the main context
+            _oneTimeContextInitialization();
+            if(mCurrentContext)
+                mCurrentContext->setInitialized();
+        }
+
+        return win;
+    }
+
+	//-----------------------------------------------------------------------
+	MultiRenderTarget * GLRenderSystem::createMultiRenderTarget(const String & name)
+	{
+		MultiRenderTarget *retval = mRTTManager->createMultiRenderTarget(name);
+		attachRenderTarget( *retval );
+		return retval;
+	}
+
+	//-----------------------------------------------------------------------
+    void GLRenderSystem::destroyRenderWindow(RenderWindow* pWin)
+    {
+        // Find it to remove from list
+        RenderTargetMap::iterator i = mRenderTargets.begin();
+
+        while (i != mRenderTargets.end())
+        {
+            if (i->second == pWin)
+            {
+                mRenderTargets.erase(i);
+                delete pWin;
+                break;
+            }
+        }
+    }
+
+	//---------------------------------------------------------------------
+    void GLRenderSystem::_useLights(const LightList& lights, unsigned short limit)
+    {
+        // Save previous modelview
+        glMatrixMode(GL_MODELVIEW);
+        glPushMatrix();
+        // just load view matrix (identity world)
+        GLfloat mat[16];
+        makeGLMatrix(mat, mViewMatrix);
+        glLoadMatrixf(mat);
+
+        LightList::const_iterator i, iend;
+        iend = lights.end();
+        unsigned short num = 0;
+        for (i = lights.begin(); i != iend && num < limit; ++i, ++num)
+        {
+            setGLLight(num, *i);
+            mLights[num] = *i;
+        }
+        // Disable extra lights
+        for (; num < mCurrentLights; ++num)
+        {
+            setGLLight(num, NULL);
+            mLights[num] = NULL;
+        }
+        mCurrentLights = std::min(limit, static_cast<unsigned short>(lights.size()));
+
+        setLights();
+
+        // restore previous
+        glPopMatrix();
+
+    }
+
+    void GLRenderSystem::setGLLight(size_t index, Light* lt)
+    {
+        GLenum gl_index = GL_LIGHT0 + index;
+
+        if (!lt)
+        {
+            // Disable in the scene
+            glDisable(gl_index);
+        }
+        else
+        {
+            switch (lt->getType())
+            {
+            case Light::LT_SPOTLIGHT:
+                glLightf( gl_index, GL_SPOT_CUTOFF, 0.5f * lt->getSpotlightOuterAngle().valueDegrees() );
+                glLightf(gl_index, GL_SPOT_EXPONENT, lt->getSpotlightFalloff());
+                break;
+            default:
+                glLightf( gl_index, GL_SPOT_CUTOFF, 180.0 );
+                break;
+            }
+
+            // Color
+            ColourValue col;
+            col = lt->getDiffuseColour();
+
+
+            GLfloat f4vals[4] = {col.r, col.g, col.b, col.a};
+            glLightfv(gl_index, GL_DIFFUSE, f4vals);
+            
+            col = lt->getSpecularColour();
+            f4vals[0] = col.r;
+            f4vals[1] = col.g;
+            f4vals[2] = col.b;
+            f4vals[3] = col.a;
+            glLightfv(gl_index, GL_SPECULAR, f4vals);
+
+
+            // Disable ambient light for movables;
+            f4vals[0] = 0;
+            f4vals[1] = 0;
+            f4vals[2] = 0;
+            f4vals[3] = 1;
+            glLightfv(gl_index, GL_AMBIENT, f4vals);
+
+            setGLLightPositionDirection(lt, gl_index);
+
+
+            // Attenuation
+            glLightf(gl_index, GL_CONSTANT_ATTENUATION, lt->getAttenuationConstant());
+            glLightf(gl_index, GL_LINEAR_ATTENUATION, lt->getAttenuationLinear());
+            glLightf(gl_index, GL_QUADRATIC_ATTENUATION, lt->getAttenuationQuadric());
+            // Enable in the scene
+            glEnable(gl_index);
+
+        }
+
+    }
+
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::makeGLMatrix(GLfloat gl_matrix[16], const Matrix4& m)
+    {
+        size_t x = 0;
+        for (size_t i = 0; i < 4; i++)
+        {
+            for (size_t j = 0; j < 4; j++)
+            {
+                gl_matrix[x] = m[j][i];
+                x++;
+            }
+        }
+    }
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setWorldMatrix( const Matrix4 &m )
+    {
+        GLfloat mat[16];
+        mWorldMatrix = m;
+        makeGLMatrix( mat, mViewMatrix * mWorldMatrix );
+        glMatrixMode(GL_MODELVIEW);
+        glLoadMatrixf(mat);
+    }
+
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setViewMatrix( const Matrix4 &m )
+    {
+        mViewMatrix = m;
+
+        GLfloat mat[16];
+		makeGLMatrix( mat, mViewMatrix * mWorldMatrix );
+        glMatrixMode(GL_MODELVIEW);
+        glLoadMatrixf(mat);
+
+        setGLClipPlanes();
+    }
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setProjectionMatrix(const Matrix4 &m)
+    {
+        GLfloat mat[16];
+        makeGLMatrix(mat, m);
+        if (mActiveRenderTarget->requiresTextureFlipping())
+        {
+            // Invert transformed y
+            mat[1] = -mat[1];
+            mat[5] = -mat[5];
+            mat[9] = -mat[9];
+            mat[13] = -mat[13];
+        }
+        glMatrixMode(GL_PROJECTION);
+        glLoadMatrixf(mat);
+        glMatrixMode(GL_MODELVIEW);
+    }
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setSurfaceParams(const ColourValue &ambient,
+        const ColourValue &diffuse, const ColourValue &specular,
+        const ColourValue &emissive, Real shininess,
+        TrackVertexColourType tracking)
+    {
+       
+        // Track vertex colour
+        if(tracking != TVC_NONE) 
+        {
+            GLenum gt = GL_DIFFUSE;
+            // There are actually 15 different combinations for tracking, of which
+            // GL only supports the most used 5. This means that we have to do some
+            // magic to find the best match. NOTE: 
+            //  GL_AMBIENT_AND_DIFFUSE != GL_AMBIENT | GL__DIFFUSE
+            if(tracking & TVC_AMBIENT) 
+            {
+                if(tracking & TVC_DIFFUSE)
+                {
+                    gt = GL_AMBIENT_AND_DIFFUSE;
+                } 
+                else 
+                {
+                    gt = GL_AMBIENT;
+                }
+            }
+            else if(tracking & TVC_DIFFUSE) 
+            {
+                gt = GL_DIFFUSE;
+            }
+            else if(tracking & TVC_SPECULAR) 
+            {
+                gt = GL_SPECULAR;              
+            }
+            else if(tracking & TVC_EMISSIVE) 
+            {
+                gt = GL_EMISSION;
+            }
+            glColorMaterial(GL_FRONT_AND_BACK, gt);
+            
+            glEnable(GL_COLOR_MATERIAL);
+        } 
+        else 
+        {
+            glDisable(GL_COLOR_MATERIAL);          
+        }
+
+		// XXX Cache previous values?
+		// XXX Front or Front and Back?
+
+		GLfloat f4val[4] = {diffuse.r, diffuse.g, diffuse.b, diffuse.a};
+		glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, f4val);
+		f4val[0] = ambient.r;
+		f4val[1] = ambient.g;
+		f4val[2] = ambient.b;
+		f4val[3] = ambient.a;
+		glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, f4val);
+		f4val[0] = specular.r;
+		f4val[1] = specular.g;
+		f4val[2] = specular.b;
+		f4val[3] = specular.a;
+		glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, f4val);
+		f4val[0] = emissive.r;
+		f4val[1] = emissive.g;
+		f4val[2] = emissive.b;
+		f4val[3] = emissive.a;
+		glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, f4val);
+		glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, shininess);
+    }
+    //-----------------------------------------------------------------------------
+	void GLRenderSystem::_setPointParameters(Real size, 
+		bool attenuationEnabled, Real constant, Real linear, Real quadratic,
+		Real minSize, Real maxSize)
+    {
+
+		if(attenuationEnabled && 
+			mCapabilities->hasCapability(RSC_POINT_EXTENDED_PARAMETERS))
+		{
+			// Point size is still calculated in pixels even when attenuation is
+			// enabled, which is pretty awkward, since you typically want a viewport
+			// independent size if you're looking for attenuation.
+			// So, scale the point size up by viewport size (this is equivalent to
+			// what D3D does as standard)
+			Real adjSize = size * mActiveViewport->getActualHeight();
+			Real adjMinSize = minSize * mActiveViewport->getActualHeight();
+			Real adjMaxSize;
+			if (maxSize == 0.0f)
+				adjMaxSize = mCapabilities->getMaxPointSize(); // pixels
+			else
+				adjMaxSize = maxSize * mActiveViewport->getActualHeight();
+			glPointSize(adjSize);
+
+			// XXX: why do I need this for results to be consistent with D3D?
+			// Equations are supposedly the same once you factor in vp height
+			Real correction = 0.005;
+			// scaling required
+			float val[4] = {constant, linear*correction, quadratic*correction, 1};
+			glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, val);
+			glPointParameterf(GL_POINT_SIZE_MIN, adjMinSize);
+			glPointParameterf(GL_POINT_SIZE_MAX, adjMaxSize);
+		}
+		else
+		{
+			// no scaling required
+			// GL has no disabled flag for this so just set to constant
+			glPointSize(size);
+
+			if (mCapabilities->hasCapability(RSC_POINT_EXTENDED_PARAMETERS))
+			{
+				float val[4] = {1, 0, 0, 1};
+				glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, val);
+				glPointParameterf(GL_POINT_SIZE_MIN, minSize);
+				if (maxSize == 0.0f)
+					maxSize = mCapabilities->getMaxPointSize();
+				glPointParameterf(GL_POINT_SIZE_MAX, maxSize);
+			}
+		}
+
+
+
+    }
+	//---------------------------------------------------------------------
+	void GLRenderSystem::_setPointSpritesEnabled(bool enabled)
+	{
+		if (enabled)
+		{
+			glEnable(GL_POINT_SPRITE);
+		}
+		else
+		{
+			glDisable(GL_POINT_SPRITE);
+		}
+
+		// Set sprite texture coord generation
+		// Don't offer this as an option since D3D links it to sprite enabled
+		for (ushort i = 0; i < mFixedFunctionTextureUnits; ++i)
+		{
+			glActiveTextureARB(GL_TEXTURE0 + i);
+			glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, 
+				enabled ? GL_TRUE : GL_FALSE);
+		}
+		glActiveTextureARB(GL_TEXTURE0);
+
+	}
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setTexture(size_t stage, bool enabled, const TexturePtr &texPtr)
+    {
+        GLTexturePtr tex = texPtr;
+
+        GLenum lastTextureType = mTextureTypes[stage];
+
+		glActiveTextureARB( GL_TEXTURE0 + stage );
+		if (enabled)
+        {
+            if (!tex.isNull())
+            {
+                // note used
+                tex->touch();
+                mTextureTypes[stage] = tex->getGLTextureTarget();
+            }
+            else
+                // assume 2D
+                mTextureTypes[stage] = GL_TEXTURE_2D;
+
+            if(lastTextureType != mTextureTypes[stage] && lastTextureType != 0)
+            {
+				if (stage < mFixedFunctionTextureUnits)
+				{
+	                glDisable( lastTextureType );
+				}
+            }
+
+			if (stage < mFixedFunctionTextureUnits)
+			{
+				glEnable( mTextureTypes[stage] );
+			}
+
+			if(!tex.isNull())
+				glBindTexture( mTextureTypes[stage], tex->getGLID() );
+			else
+				glBindTexture( mTextureTypes[stage], static_cast<GLTextureManager*>(mTextureManager)->getWarningTextureID() );
+        }
+        else
+        {
+			if (stage < mFixedFunctionTextureUnits)
+			{
+				if (lastTextureType != 0)
+				{
+					glDisable( mTextureTypes[stage] );
+				}
+				glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+			}
+			// bind zero texture
+			glBindTexture (GL_TEXTURE_2D, 0); 
+        }
+
+        glActiveTextureARB( GL_TEXTURE0 );
+    }
+
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setTextureCoordSet(size_t stage, size_t index)
+    {
+        mTextureCoordIndex[stage] = index;
+    }
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setTextureCoordCalculation(size_t stage, TexCoordCalcMethod m, 
+        const Frustum* frustum)
+    {
+		if (stage >= mFixedFunctionTextureUnits)
+		{
+			// Can't do this
+			return;
+		}
+
+		
+		GLfloat M[16];
+        Matrix4 projectionBias;
+
+        // Default to no extra auto texture matrix
+        mUseAutoTextureMatrix = false;
+
+        GLfloat eyePlaneS[] = {1.0, 0.0, 0.0, 0.0};
+        GLfloat eyePlaneT[] = {0.0, 1.0, 0.0, 0.0};
+        GLfloat eyePlaneR[] = {0.0, 0.0, 1.0, 0.0};
+        GLfloat eyePlaneQ[] = {0.0, 0.0, 0.0, 1.0};
+
+        glActiveTextureARB( GL_TEXTURE0 + stage );
+
+		switch( m )
+        {
+        case TEXCALC_NONE:
+            glDisable( GL_TEXTURE_GEN_S );
+            glDisable( GL_TEXTURE_GEN_T );
+            glDisable( GL_TEXTURE_GEN_R );
+            glDisable( GL_TEXTURE_GEN_Q );
+            break;
+
+        case TEXCALC_ENVIRONMENT_MAP:
+            glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP );
+            glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP );
+
+            glEnable( GL_TEXTURE_GEN_S );
+            glEnable( GL_TEXTURE_GEN_T );
+            glDisable( GL_TEXTURE_GEN_R );
+            glDisable( GL_TEXTURE_GEN_Q );
+
+            // Need to use a texture matrix to flip the spheremap
+            mUseAutoTextureMatrix = true;
+            memset(mAutoTextureMatrix, 0, sizeof(GLfloat)*16);
+            mAutoTextureMatrix[0] = mAutoTextureMatrix[10] = mAutoTextureMatrix[15] = 1.0f;
+            mAutoTextureMatrix[5] = -1.0f;
+
+            break;
+
+        case TEXCALC_ENVIRONMENT_MAP_PLANAR:            
+            // XXX This doesn't seem right?!
+#ifdef GL_VERSION_1_3
+            glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP );
+            glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP );
+            glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP );
+
+            glEnable( GL_TEXTURE_GEN_S );
+            glEnable( GL_TEXTURE_GEN_T );
+            glEnable( GL_TEXTURE_GEN_R );
+            glDisable( GL_TEXTURE_GEN_Q );
+#else
+            glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP );
+            glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP );
+
+            glEnable( GL_TEXTURE_GEN_S );
+            glEnable( GL_TEXTURE_GEN_T );
+            glDisable( GL_TEXTURE_GEN_R );
+            glDisable( GL_TEXTURE_GEN_Q );
+#endif
+            break;
+        case TEXCALC_ENVIRONMENT_MAP_REFLECTION:
+            
+            glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP );
+            glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP );
+            glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP );
+
+            glEnable( GL_TEXTURE_GEN_S );
+            glEnable( GL_TEXTURE_GEN_T );
+            glEnable( GL_TEXTURE_GEN_R );
+            glDisable( GL_TEXTURE_GEN_Q );
+
+            // We need an extra texture matrix here
+            // This sets the texture matrix to be the inverse of the view matrix
+            mUseAutoTextureMatrix = true;
+			makeGLMatrix( M, mViewMatrix);
+
+            // Transpose 3x3 in order to invert matrix (rotation)
+            // Note that we need to invert the Z _before_ the rotation
+            // No idea why we have to invert the Z at all, but reflection is wrong without it
+            mAutoTextureMatrix[0] = M[0]; mAutoTextureMatrix[1] = M[4]; mAutoTextureMatrix[2] = -M[8];
+            mAutoTextureMatrix[4] = M[1]; mAutoTextureMatrix[5] = M[5]; mAutoTextureMatrix[6] = -M[9];
+            mAutoTextureMatrix[8] = M[2]; mAutoTextureMatrix[9] = M[6]; mAutoTextureMatrix[10] = -M[10];
+            mAutoTextureMatrix[3] = mAutoTextureMatrix[7] = mAutoTextureMatrix[11] = 0.0f;
+            mAutoTextureMatrix[12] = mAutoTextureMatrix[13] = mAutoTextureMatrix[14] = 0.0f;
+            mAutoTextureMatrix[15] = 1.0f;
+
+            break;
+        case TEXCALC_ENVIRONMENT_MAP_NORMAL:
+            glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP );
+            glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP );
+            glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP );
+
+            glEnable( GL_TEXTURE_GEN_S );
+            glEnable( GL_TEXTURE_GEN_T );
+            glEnable( GL_TEXTURE_GEN_R );
+            glDisable( GL_TEXTURE_GEN_Q );
+            break;
+        case TEXCALC_PROJECTIVE_TEXTURE:
+            glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
+            glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
+            glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
+            glTexGeni(GL_Q, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
+            glTexGenfv(GL_S, GL_EYE_PLANE, eyePlaneS);
+            glTexGenfv(GL_T, GL_EYE_PLANE, eyePlaneT);
+            glTexGenfv(GL_R, GL_EYE_PLANE, eyePlaneR);
+            glTexGenfv(GL_Q, GL_EYE_PLANE, eyePlaneQ);
+            glEnable(GL_TEXTURE_GEN_S);
+            glEnable(GL_TEXTURE_GEN_T);
+            glEnable(GL_TEXTURE_GEN_R);
+            glEnable(GL_TEXTURE_GEN_Q);
+
+            mUseAutoTextureMatrix = true;
+
+            // Set scale and translation matrix for projective textures
+            projectionBias = Matrix4::CLIPSPACE2DTOIMAGESPACE;
+
+            projectionBias = projectionBias * frustum->getProjectionMatrix();
+            projectionBias = projectionBias * frustum->getViewMatrix();
+            projectionBias = projectionBias * mWorldMatrix;
+
+            makeGLMatrix(mAutoTextureMatrix, projectionBias);
+            break;
+        default:
+            break;
+        }
+        glActiveTextureARB( GL_TEXTURE0 );
+    }
+    //-----------------------------------------------------------------------------
+	GLint GLRenderSystem::getTextureAddressingMode(
+		TextureUnitState::TextureAddressingMode tam) const
+	{
+        switch(tam)
+        {
+        default:
+        case TextureUnitState::TAM_WRAP:
+            return GL_REPEAT;
+        case TextureUnitState::TAM_MIRROR:
+            return GL_MIRRORED_REPEAT;
+        case TextureUnitState::TAM_CLAMP:
+            return GL_CLAMP_TO_EDGE;
+        case TextureUnitState::TAM_BORDER:
+            return GL_CLAMP_TO_BORDER;
+        }
+		
+	}
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setTextureAddressingMode(size_t stage, const TextureUnitState::UVWAddressingMode& uvw)
+    {
+        glActiveTextureARB( GL_TEXTURE0 + stage );
+        glTexParameteri( mTextureTypes[stage], GL_TEXTURE_WRAP_S, 
+			getTextureAddressingMode(uvw.u));
+        glTexParameteri( mTextureTypes[stage], GL_TEXTURE_WRAP_T, 
+			getTextureAddressingMode(uvw.v));
+        glTexParameteri( mTextureTypes[stage], GL_TEXTURE_WRAP_R, 
+				getTextureAddressingMode(uvw.w));
+        glActiveTextureARB( GL_TEXTURE0 );
+    }
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setTextureBorderColour(size_t stage, const ColourValue& colour)
+    {
+        GLfloat border[4] = { colour.r, colour.g, colour.b, colour.a };
+        glActiveTextureARB( GL_TEXTURE0 + stage );
+        glTexParameterfv( mTextureTypes[stage], GL_TEXTURE_BORDER_COLOR, border);
+        glActiveTextureARB( GL_TEXTURE0 );
+    }
+	//-----------------------------------------------------------------------------
+	void GLRenderSystem::_setTextureMipmapBias(size_t stage, float bias)
+	{
+		if (mCapabilities->hasCapability(RSC_MIPMAP_LOD_BIAS))
+		{
+			glActiveTextureARB( GL_TEXTURE0 + stage );
+			glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, bias);
+			glActiveTextureARB( GL_TEXTURE0 );
+		}
+
+	}
+	//-----------------------------------------------------------------------------
+    void GLRenderSystem::_setTextureMatrix(size_t stage, const Matrix4& xform)
+    {
+		if (stage >= mFixedFunctionTextureUnits)
+		{
+			// Can't do this
+			return;
+		}
+
+		GLfloat mat[16];
+        makeGLMatrix(mat, xform);
+
+        glActiveTextureARB(GL_TEXTURE0 + stage);
+        glMatrixMode(GL_TEXTURE);
+
+        // Load this matrix in
+        glLoadMatrixf(mat);
+
+        if (mUseAutoTextureMatrix)
+        {
+            // Concat auto matrix
+            glMultMatrixf(mAutoTextureMatrix);
+        }
+
+        glMatrixMode(GL_MODELVIEW);
+        glActiveTextureARB(GL_TEXTURE0);
+    }
+    //-----------------------------------------------------------------------------
+    GLint GLRenderSystem::getBlendMode(SceneBlendFactor ogreBlend) const
+    {
+        switch(ogreBlend)
+        {
+        case SBF_ONE:
+            return GL_ONE;
+        case SBF_ZERO:
+            return GL_ZERO;
+        case SBF_DEST_COLOUR:
+            return GL_DST_COLOR;
+        case SBF_SOURCE_COLOUR:
+            return GL_SRC_COLOR;
+        case SBF_ONE_MINUS_DEST_COLOUR:
+            return GL_ONE_MINUS_DST_COLOR;
+        case SBF_ONE_MINUS_SOURCE_COLOUR:
+            return GL_ONE_MINUS_SRC_COLOR;
+        case SBF_DEST_ALPHA:
+            return GL_DST_ALPHA;
+        case SBF_SOURCE_ALPHA:
+            return GL_SRC_ALPHA;
+        case SBF_ONE_MINUS_DEST_ALPHA:
+            return GL_ONE_MINUS_DST_ALPHA;
+        case SBF_ONE_MINUS_SOURCE_ALPHA:
+            return GL_ONE_MINUS_SRC_ALPHA;
+        };
+		// to keep compiler happy
+		return GL_ONE;
+    }
+
+    void GLRenderSystem::_setSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor)
+    {
+        GLint sourceBlend = getBlendMode(sourceFactor);
+        GLint destBlend = getBlendMode(destFactor);
+        if(sourceFactor == SBF_ONE && destFactor == SBF_ZERO)
+        {
+            glDisable(GL_BLEND);
+        }
+        else
+        {
+            glEnable(GL_BLEND);
+            glBlendFunc(sourceBlend, destBlend);
+        }
+    }
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setAlphaRejectSettings(CompareFunction func, unsigned char value)
+    {
+        if(func == CMPF_ALWAYS_PASS)
+        {
+            glDisable(GL_ALPHA_TEST);
+        }
+        else
+        {
+            glEnable(GL_ALPHA_TEST);
+            glAlphaFunc(convertCompareFunction(func), value / 255.0f);
+        }
+    }
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setViewport(Viewport *vp)
+    {
+        // Check if viewport is different
+        if (vp != mActiveViewport || vp->_isUpdated())
+        {
+            RenderTarget* target;
+            target = vp->getTarget();
+            _setRenderTarget(target);
+            mActiveViewport = vp;
+              
+              GLsizei x, y, w, h;
+ 
+              // Calculate the "lower-left" corner of the viewport
+              w = vp->getActualWidth();
+              h = vp->getActualHeight();
+              x = vp->getActualLeft();
+              y = vp->getActualTop();
+              if (!target->requiresTextureFlipping())
+              {
+                  // Convert "upper-left" corner to "lower-left"
+                  y = target->getHeight() - h - y;
+              }
+              glViewport(x, y, w, h);
+  
+              // Configure the viewport clipping
+              glScissor(x, y, w, h);
+  
+              vp->_clearUpdatedFlag();
+        }
+    }
+
+	void GLRenderSystem::setLights()
+	{
+        for (size_t i = 0; i < MAX_LIGHTS; ++i)
+        {
+            if (mLights[i] != NULL)
+            {
+                Light* lt = mLights[i];
+                setGLLightPositionDirection(lt, GL_LIGHT0 + i);
+            }
+        }
+	}
+
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_beginFrame(void)
+    {
+        if (!mActiveViewport)
+            OGRE_EXCEPT(Exception::ERR_INVALID_STATE, 
+				"Cannot begin frame - no viewport selected.",
+                "GLRenderSystem::_beginFrame");
+
+        // Activate the viewport clipping
+        glEnable(GL_SCISSOR_TEST);
+    }
+   
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_endFrame(void)
+    {
+        // Deactivate the viewport clipping.
+        glDisable(GL_SCISSOR_TEST);
+    }
+
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setCullingMode(CullingMode mode)
+    {
+        // NB: Because two-sided stencil API dependence of the front face, we must
+        // use the same 'winding' for the front face everywhere. As the OGRE default
+        // culling mode is clockwise, we also treat anticlockwise winding as front
+        // face for consistently. On the assumption that, we can't change the front
+        // face by glFrontFace anywhere.
+
+        GLenum cullMode;
+
+        switch( mode )
+        {
+        case CULL_NONE:
+            glDisable( GL_CULL_FACE );
+            return;
+		default:
+        case CULL_CLOCKWISE:
+            if (mActiveRenderTarget && 
+                ((mActiveRenderTarget->requiresTextureFlipping() && !mInvertVertexWinding) ||
+                (!mActiveRenderTarget->requiresTextureFlipping() && mInvertVertexWinding)))
+            {
+                cullMode = GL_FRONT;
+            }
+            else
+            {
+                cullMode = GL_BACK;
+            }
+            break;
+        case CULL_ANTICLOCKWISE:
+            if (mActiveRenderTarget && 
+                ((mActiveRenderTarget->requiresTextureFlipping() && !mInvertVertexWinding) ||
+                (!mActiveRenderTarget->requiresTextureFlipping() && mInvertVertexWinding)))
+            {
+                cullMode = GL_BACK;
+            }
+            else
+            {
+                cullMode = GL_FRONT;
+            }
+            break;
+        }
+
+        glEnable( GL_CULL_FACE );
+        glCullFace( cullMode );
+    }
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setDepthBufferParams(bool depthTest, bool depthWrite, CompareFunction depthFunction)
+    {
+        _setDepthBufferCheckEnabled(depthTest);
+        _setDepthBufferWriteEnabled(depthWrite);
+        _setDepthBufferFunction(depthFunction);
+    }
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setDepthBufferCheckEnabled(bool enabled)
+    {
+        if (enabled)
+        {
+            glClearDepth(1.0f);
+            glEnable(GL_DEPTH_TEST);
+        }
+        else
+        {
+            glDisable(GL_DEPTH_TEST);
+        }
+    }
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setDepthBufferWriteEnabled(bool enabled)
+    {
+        GLboolean flag = enabled ? GL_TRUE : GL_FALSE;
+        glDepthMask( flag );  
+        // Store for reference in _beginFrame
+        mDepthWrite = enabled;
+    }
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setDepthBufferFunction(CompareFunction func)
+    {
+        glDepthFunc(convertCompareFunction(func));
+    }
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setDepthBias(float constantBias, float slopeScaleBias)
+    {
+        if (constantBias != 0 || slopeScaleBias != 0)
+        {
+            glEnable(GL_POLYGON_OFFSET_FILL);
+            glEnable(GL_POLYGON_OFFSET_POINT);
+            glEnable(GL_POLYGON_OFFSET_LINE);
+            glPolygonOffset(-slopeScaleBias, -constantBias);
+        }
+        else
+        {
+            glDisable(GL_POLYGON_OFFSET_FILL);
+            glDisable(GL_POLYGON_OFFSET_POINT);
+            glDisable(GL_POLYGON_OFFSET_LINE);
+        }
+    }
+	//-----------------------------------------------------------------------------
+	void GLRenderSystem::_setColourBufferWriteEnabled(bool red, bool green, bool blue, bool alpha)
+	{
+		glColorMask(red, green, blue, alpha);
+		// record this
+		mColourWrite[0] = red;
+		mColourWrite[1] = blue;
+		mColourWrite[2] = green;
+		mColourWrite[3] = alpha;
+	}
+	//-----------------------------------------------------------------------------
+    String GLRenderSystem::getErrorDescription(long errCode) const
+    {
+        const GLubyte *errString = gluErrorString (errCode);
+        return String((const char*) errString);
+    }
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::setLightingEnabled(bool enabled)
+    {
+        if (enabled) 
+        {      
+            glEnable(GL_LIGHTING);
+        } 
+        else 
+        {
+            glDisable(GL_LIGHTING);
+        }
+    }
+    //-----------------------------------------------------------------------------
+    void GLRenderSystem::_setFog(FogMode mode, const ColourValue& colour, Real density, Real start, Real end)
+    {
+
+        GLint fogMode;
+        switch (mode)
+        {
+        case FOG_EXP:
+            fogMode = GL_EXP;
+            break;
+        case FOG_EXP2:
+            fogMode = GL_EXP2;
+            break;
+        case FOG_LINEAR:
+            fogMode = GL_LINEAR;
+            break;
+        default:
+            // Give up on it
+            glDisable(GL_FOG);
+            return;
+        }
+
+        glEnable(GL_FOG);
+        glFogi(GL_FOG_MODE, fogMode);
+        GLfloat fogColor[4] = {colour.r, colour.g, colour.b, colour.a};
+        glFogfv(GL_FOG_COLOR, fogColor);
+        glFogf(GL_FOG_DENSITY, density);
+        glFogf(GL_FOG_START, start);
+        glFogf(GL_FOG_END, end);
+        // XXX Hint here?
+    }
+
+	VertexElementType GLRenderSystem::getColourVertexElementType(void) const
+    {
+        return VET_COLOUR_ABGR;
+    }
+    
+    void GLRenderSystem::_convertProjectionMatrix(const Matrix4& matrix,
+        Matrix4& dest, bool forGpuProgram)
+    {
+        // no any convertion request for OpenGL
+        dest = matrix;
+    }
+
+    void GLRenderSystem::_makeProjectionMatrix(const Radian& fovy, Real aspect, Real nearPlane, 
+        Real farPlane, Matrix4& dest, bool forGpuProgram)
+    {
+        Radian thetaY ( fovy / 2.0f );
+        Real tanThetaY = Math::Tan(thetaY);
+        //Real thetaX = thetaY * aspect;
+        //Real tanThetaX = Math::Tan(thetaX);
+
+        // Calc matrix elements
+        Real w = (1.0f / tanThetaY) / aspect;
+        Real h = 1.0f / tanThetaY;
+        Real q, qn;
+        if (farPlane == 0)
+        {
+            // Infinite far plane
+            q = Frustum::INFINITE_FAR_PLANE_ADJUST - 1;
+            qn = nearPlane * (Frustum::INFINITE_FAR_PLANE_ADJUST - 2);
+        }
+        else
+        {
+            q = -(farPlane + nearPlane) / (farPlane - nearPlane);
+            qn = -2 * (farPlane * nearPlane) / (farPlane - nearPlane);
+        }
+
+        // NB This creates Z in range [-1,1]
+        //
+        // [ w   0   0   0  ]
+        // [ 0   h   0   0  ]
+        // [ 0   0   q   qn ]
+        // [ 0   0   -1  0  ]
+
+        dest = Matrix4::ZERO;
+        dest[0][0] = w;
+        dest[1][1] = h;
+        dest[2][2] = q;
+        dest[2][3] = qn;
+        dest[3][2] = -1;
+
+    }
+    
+    void GLRenderSystem::_makeOrthoMatrix(const Radian& fovy, Real aspect, Real nearPlane, 
+        Real farPlane, Matrix4& dest, bool forGpuProgram)
+    {
+        Radian thetaY (fovy / 2.0f);
+        Real tanThetaY = Math::Tan(thetaY);
+
+        //Real thetaX = thetaY * aspect;
+        Real tanThetaX = tanThetaY * aspect; //Math::Tan(thetaX);
+        Real half_w = tanThetaX * nearPlane;
+        Real half_h = tanThetaY * nearPlane;
+        Real iw = 1.0 / half_w;
+        Real ih = 1.0 / half_h;
+        Real q;
+        if (farPlane == 0)
+        {
+            q = 0;
+        }
+        else
+        {
+            q = 2.0 / (farPlane - nearPlane);
+        }
+        dest = Matrix4::ZERO;
+        dest[0][0] = iw;
+        dest[1][1] = ih;
+        dest[2][2] = -q;
+        dest[2][3] = - (farPlane + nearPlane)/(farPlane - nearPlane);
+        dest[3][3] = 1;
+	}
+
+    void GLRenderSystem::_setPolygonMode(PolygonMode level)
+    {
+        GLenum glmode;
+        switch(level)
+        {
+        case PM_POINTS:
+            glmode = GL_POINT;
+            break;
+        case PM_WIREFRAME:
+            glmode = GL_LINE;
+            break;
+		default:
+        case PM_SOLID:
+            glmode = GL_FILL;
+            break;
+        }
+        glPolygonMode(GL_FRONT_AND_BACK, glmode);
+    }
+    //---------------------------------------------------------------------
+    void GLRenderSystem::setStencilCheckEnabled(bool enabled)
+    {
+        if (enabled)
+        {
+            glEnable(GL_STENCIL_TEST);
+        }
+        else
+        {
+            glDisable(GL_STENCIL_TEST);
+        }
+    }
+    //---------------------------------------------------------------------
+    void GLRenderSystem::setStencilBufferParams(CompareFunction func, 
+        uint32 refValue, uint32 mask, StencilOperation stencilFailOp, 
+        StencilOperation depthFailOp, StencilOperation passOp, 
+        bool twoSidedOperation)
+    {
+        bool flip;
+		mStencilMask = mask;
+
+        if (twoSidedOperation)
+        {
+            if (!mCapabilities->hasCapability(RSC_TWO_SIDED_STENCIL))
+                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "2-sided stencils are not supported",
+                    "GLRenderSystem::setStencilBufferParams");
+            
+            // NB: We should always treat CCW as front face for consistent with default
+            // culling mode. Therefore, we must take care with two-sided stencil settings.
+            flip = (mInvertVertexWinding && !mActiveRenderTarget->requiresTextureFlipping()) ||
+                   (!mInvertVertexWinding && mActiveRenderTarget->requiresTextureFlipping());
+			if(GLEW_VERSION_2_0) // New GL2 commands
+			{
+				// Back
+				glStencilMaskSeparate(GL_BACK, mask);
+				glStencilFuncSeparate(GL_BACK, convertCompareFunction(func), refValue, mask);
+				glStencilOpSeparate(GL_BACK, 
+					convertStencilOp(stencilFailOp, !flip), 
+					convertStencilOp(depthFailOp, !flip), 
+					convertStencilOp(passOp, !flip));
+				// Front
+				glStencilMaskSeparate(GL_FRONT, mask);
+				glStencilFuncSeparate(GL_FRONT, convertCompareFunction(func), refValue, mask);
+				glStencilOpSeparate(GL_FRONT, 
+					convertStencilOp(stencilFailOp, flip),
+					convertStencilOp(depthFailOp, flip), 
+					convertStencilOp(passOp, flip));
+			}
+			else // EXT_stencil_two_side
+			{
+				glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT);
+				// Back
+				glActiveStencilFaceEXT(GL_BACK);
+				glStencilMask(mask);
+				glStencilFunc(convertCompareFunction(func), refValue, mask);
+				glStencilOp(
+					convertStencilOp(stencilFailOp, !flip), 
+					convertStencilOp(depthFailOp, !flip), 
+					convertStencilOp(passOp, !flip));
+				// Front
+				glActiveStencilFaceEXT(GL_FRONT);
+				glStencilMask(mask);
+				glStencilFunc(convertCompareFunction(func), refValue, mask);
+				glStencilOp(
+					convertStencilOp(stencilFailOp, flip),
+					convertStencilOp(depthFailOp, flip), 
+					convertStencilOp(passOp, flip));
+			}
+        }
+        else
+        {
+            glDisable(GL_STENCIL_TEST_TWO_SIDE_EXT);
+            flip = false;
+			glStencilMask(mask);
+			glStencilFunc(convertCompareFunction(func), refValue, mask);
+			glStencilOp(
+				convertStencilOp(stencilFailOp, flip),
+				convertStencilOp(depthFailOp, flip), 
+				convertStencilOp(passOp, flip));
+        }
+    }
+    //---------------------------------------------------------------------
+    GLint GLRenderSystem::convertCompareFunction(CompareFunction func) const
+    {
+        switch(func)
+        {
+        case CMPF_ALWAYS_FAIL:
+            return GL_NEVER;
+        case CMPF_ALWAYS_PASS:
+            return GL_ALWAYS;
+        case CMPF_LESS:
+            return GL_LESS;
+        case CMPF_LESS_EQUAL:
+            return GL_LEQUAL;
+        case CMPF_EQUAL:
+            return GL_EQUAL;
+        case CMPF_NOT_EQUAL:
+            return GL_NOTEQUAL;
+        case CMPF_GREATER_EQUAL:
+            return GL_GEQUAL;
+        case CMPF_GREATER:
+            return GL_GREATER;
+        };
+        // to keep compiler happy
+        return GL_ALWAYS;
+    }
+    //---------------------------------------------------------------------
+    GLint GLRenderSystem::convertStencilOp(StencilOperation op, bool invert) const
+    {
+        switch(op)
+        {
+        case SOP_KEEP:
+            return GL_KEEP;
+        case SOP_ZERO:
+            return GL_ZERO;
+        case SOP_REPLACE:
+            return GL_REPLACE;
+        case SOP_INCREMENT:
+            return invert ? GL_DECR : GL_INCR;
+        case SOP_DECREMENT:
+            return invert ? GL_INCR : GL_DECR;
+        case SOP_INCREMENT_WRAP:
+            return invert ? GL_DECR_WRAP_EXT : GL_INCR_WRAP_EXT;
+        case SOP_DECREMENT_WRAP:
+            return invert ? GL_INCR_WRAP_EXT : GL_DECR_WRAP_EXT;
+        case SOP_INVERT:
+            return GL_INVERT;
+        };
+        // to keep compiler happy
+        return SOP_KEEP;
+    }
+	//---------------------------------------------------------------------
+    GLuint GLRenderSystem::getCombinedMinMipFilter(void) const
+    {
+        switch(mMinFilter)
+        {
+        case FO_ANISOTROPIC:
+        case FO_LINEAR:
+            switch(mMipFilter)
+            {
+            case FO_ANISOTROPIC:
+            case FO_LINEAR:
+                // linear min, linear mip
+                return GL_LINEAR_MIPMAP_LINEAR;
+            case FO_POINT:
+                // linear min, point mip
+                return GL_LINEAR_MIPMAP_NEAREST;
+            case FO_NONE:
+                // linear min, no mip
+                return GL_LINEAR;
+            }
+            break;
+        case FO_POINT:
+        case FO_NONE:
+            switch(mMipFilter)
+            {
+            case FO_ANISOTROPIC:
+            case FO_LINEAR:
+                // nearest min, linear mip
+                return GL_NEAREST_MIPMAP_LINEAR;
+            case FO_POINT:
+                // nearest min, point mip
+                return GL_NEAREST_MIPMAP_NEAREST;
+            case FO_NONE:
+                // nearest min, no mip
+                return GL_NEAREST;
+            }
+            break;
+        }
+
+        // should never get here
+        return 0;
+
+    }
+	//---------------------------------------------------------------------
+    void GLRenderSystem::_setTextureUnitFiltering(size_t unit, 
+        FilterType ftype, FilterOptions fo)
+	{
+		glActiveTextureARB( GL_TEXTURE0 + unit );
+        switch(ftype)
+        {
+        case FT_MIN:
+            mMinFilter = fo;
+            // Combine with existing mip filter
+			glTexParameteri(
+                mTextureTypes[unit],
+				GL_TEXTURE_MIN_FILTER, 
+				getCombinedMinMipFilter());
+            break;
+        case FT_MAG:
+            switch (fo)
+            {
+            case FO_ANISOTROPIC: // GL treats linear and aniso the same
+            case FO_LINEAR:
+			    glTexParameteri(
+                    mTextureTypes[unit],
+				    GL_TEXTURE_MAG_FILTER, 
+				    GL_LINEAR);
+                break;
+            case FO_POINT:
+            case FO_NONE:
+			    glTexParameteri(
+                    mTextureTypes[unit],
+				    GL_TEXTURE_MAG_FILTER, 
+				    GL_NEAREST);
+                break;
+            }
+            break;
+        case FT_MIP:
+            mMipFilter = fo;
+            // Combine with existing min filter
+			glTexParameteri(
+                mTextureTypes[unit],
+				GL_TEXTURE_MIN_FILTER, 
+				getCombinedMinMipFilter());
+            break;
+		}
+
+        glActiveTextureARB( GL_TEXTURE0 );
+	}
+	//---------------------------------------------------------------------
+	GLfloat GLRenderSystem::_getCurrentAnisotropy(size_t unit)
+	{
+		GLfloat curAniso = 0;
+		glGetTexParameterfv(mTextureTypes[unit], 
+            GL_TEXTURE_MAX_ANISOTROPY_EXT, &curAniso);
+		return curAniso ? curAniso : 1;
+	}
+	//---------------------------------------------------------------------
+	void GLRenderSystem::_setTextureLayerAnisotropy(size_t unit, unsigned int maxAnisotropy)
+	{
+       if (!mCapabilities->hasCapability(RSC_ANISOTROPY))
+			return;
+
+		GLfloat largest_supported_anisotropy = 0;
+		glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &largest_supported_anisotropy);
+		if (maxAnisotropy > largest_supported_anisotropy)
+			maxAnisotropy = largest_supported_anisotropy ? 
+				static_cast<uint>(largest_supported_anisotropy) : 1;
+		if (_getCurrentAnisotropy(unit) != maxAnisotropy)
+			glTexParameterf(mTextureTypes[unit], GL_TEXTURE_MAX_ANISOTROPY_EXT, maxAnisotropy);
+	}
+	//-----------------------------------------------------------------------------
+    void GLRenderSystem::_setTextureBlendMode(size_t stage, const LayerBlendModeEx& bm)
+    {       
+		if (stage >= mFixedFunctionTextureUnits)
+		{
+			// Can't do this
+			return;
+		}
+
+		// Check to see if blending is supported
+        if(!mCapabilities->hasCapability(RSC_BLENDING))
+            return;
+
+        GLenum src1op, src2op, cmd;
+        GLfloat cv1[4], cv2[4];
+
+		if (bm.blendType == LBT_COLOUR)
+        {
+		    cv1[0] = bm.colourArg1.r;
+		    cv1[1] = bm.colourArg1.g;
+		    cv1[2] = bm.colourArg1.b;
+		    cv1[3] = bm.colourArg1.a;
+			mManualBlendColours[stage][0] = bm.colourArg1;
+
+
+		    cv2[0] = bm.colourArg2.r;
+		    cv2[1] = bm.colourArg2.g;
+		    cv2[2] = bm.colourArg2.b;
+		    cv2[3] = bm.colourArg2.a;
+			mManualBlendColours[stage][1] = bm.colourArg2;
+        }
+
+		if (bm.blendType == LBT_ALPHA)
+        {
+		    cv1[0] = mManualBlendColours[stage][0].r;
+		    cv1[1] = mManualBlendColours[stage][0].g;
+		    cv1[2] = mManualBlendColours[stage][0].b;
+		    cv1[3] = bm.alphaArg1;
+
+		    cv2[0] = mManualBlendColours[stage][1].r;
+		    cv2[1] = mManualBlendColours[stage][1].g;
+		    cv2[2] = mManualBlendColours[stage][1].b;
+		    cv2[3] = bm.alphaArg2;
+        }
+
+        switch (bm.source1)
+        {
+        case LBS_CURRENT:
+            src1op = GL_PREVIOUS;
+            break;
+        case LBS_TEXTURE:
+            src1op = GL_TEXTURE;
+            break;
+        case LBS_MANUAL:
+            src1op = GL_CONSTANT;
+			break;
+        case LBS_DIFFUSE:
+            src1op = GL_PRIMARY_COLOR;
+			break;
+        // XXX
+        case LBS_SPECULAR:
+            src1op = GL_PRIMARY_COLOR;
+            break;
+		default:
+            src1op = 0;
+        }
+
+        switch (bm.source2)
+        {
+        case LBS_CURRENT:
+            src2op = GL_PREVIOUS;
+            break;
+        case LBS_TEXTURE:
+            src2op = GL_TEXTURE;
+            break;
+        case LBS_MANUAL:
+			src2op = GL_CONSTANT;
+			break;
+		case LBS_DIFFUSE:
+            src2op = GL_PRIMARY_COLOR;
+			break;
+        // XXX
+        case LBS_SPECULAR:
+            src2op = GL_PRIMARY_COLOR;
+            break;
+		default:
+            src2op = 0;
+        }
+
+        switch (bm.operation)
+        {
+        case LBX_SOURCE1:
+            cmd = GL_REPLACE;
+            break;
+        case LBX_SOURCE2:
+            cmd = GL_REPLACE;
+            break;
+        case LBX_MODULATE:
+            cmd = GL_MODULATE;
+            break;
+        case LBX_MODULATE_X2:
+            cmd = GL_MODULATE;
+            break;
+        case LBX_MODULATE_X4:
+            cmd = GL_MODULATE;
+            break;
+        case LBX_ADD:
+            cmd = GL_ADD;
+            break;
+        case LBX_ADD_SIGNED:
+            cmd = GL_ADD_SIGNED;
+            break;
+		case LBX_ADD_SMOOTH:
+			cmd = GL_INTERPOLATE;
+			break;
+        case LBX_SUBTRACT:
+            cmd = GL_SUBTRACT;
+            break;
+		case LBX_BLEND_DIFFUSE_COLOUR:
+			cmd = GL_INTERPOLATE;
+			break; 
+        case LBX_BLEND_DIFFUSE_ALPHA:
+            cmd = GL_INTERPOLATE;
+            break;
+        case LBX_BLEND_TEXTURE_ALPHA:
+            cmd = GL_INTERPOLATE;
+            break;
+        case LBX_BLEND_CURRENT_ALPHA:
+            cmd = GL_INTERPOLATE;
+            break;
+        case LBX_BLEND_MANUAL:
+            cmd = GL_INTERPOLATE;
+            break;
+        case LBX_DOTPRODUCT:
+            cmd = mCapabilities->hasCapability(RSC_DOT3) 
+                ? GL_DOT3_RGB : GL_MODULATE;
+            break;
+		default:
+            cmd = 0;
+        }
+
+		glActiveTextureARB(GL_TEXTURE0 + stage);
+		glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
+
+	    if (bm.blendType == LBT_COLOUR)
+	    {
+		    glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, cmd);
+		    glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, src1op);
+		    glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB, src2op);
+		    glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB, GL_CONSTANT);
+	    }
+	    else
+	    {
+		    glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, cmd);
+		    glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, src1op);
+		    glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA, src2op);
+		    glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA, GL_CONSTANT);
+	    }
+
+        float blendValue[4] = {0, 0, 0, bm.factor};
+        switch (bm.operation)
+        {
+		case LBX_BLEND_DIFFUSE_COLOUR:
+			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB, GL_PRIMARY_COLOR);
+            glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA, GL_PRIMARY_COLOR);
+            break;
+        case LBX_BLEND_DIFFUSE_ALPHA:
+            glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB, GL_PRIMARY_COLOR);
+            glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA, GL_PRIMARY_COLOR);
+            break;
+        case LBX_BLEND_TEXTURE_ALPHA:
+			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB, GL_TEXTURE);
+			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA, GL_TEXTURE);
+            break;
+        case LBX_BLEND_CURRENT_ALPHA:
+			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB, GL_PREVIOUS);
+			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA, GL_PREVIOUS);
+            break;
+        case LBX_BLEND_MANUAL:
+            glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, blendValue);
+            break;
+        default:
+            break;
+        };
+
+        switch (bm.operation)
+        {
+        case LBX_MODULATE_X2:
+			glTexEnvi(GL_TEXTURE_ENV, bm.blendType == LBT_COLOUR ? 
+                GL_RGB_SCALE : GL_ALPHA_SCALE, 2);
+            break;
+        case LBX_MODULATE_X4:
+			glTexEnvi(GL_TEXTURE_ENV, bm.blendType == LBT_COLOUR ? 
+                GL_RGB_SCALE : GL_ALPHA_SCALE, 4);
+            break;
+        default:
+			glTexEnvi(GL_TEXTURE_ENV, bm.blendType == LBT_COLOUR ? 
+                GL_RGB_SCALE : GL_ALPHA_SCALE, 1);
+            break;
+		}
+
+		if (bm.blendType == LBT_COLOUR){
+			glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR);
+			glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR);
+			if (bm.operation == LBX_BLEND_DIFFUSE_COLOUR){
+				glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_SRC_COLOR);
+			} else {
+				glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_SRC_ALPHA);
+			}
+		} 
+
+		glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA);
+		glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_SRC_ALPHA);
+		glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA, GL_SRC_ALPHA);
+        if(bm.source1 == LBS_MANUAL)
+            glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, cv1);
+        if (bm.source2 == LBS_MANUAL)
+            glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, cv2);
+
+        glActiveTextureARB(GL_TEXTURE0);
+	}
+    //---------------------------------------------------------------------
+    void GLRenderSystem::setGLLightPositionDirection(Light* lt, GLenum lightindex)
+    {
+        // Set position / direction
+        Vector4 vec;
+		// Use general 4D vector which is the same as GL's approach
+		vec = lt->getAs4DVector();
+
+#if OGRE_DOUBLE_PRECISION
+		// Must convert to float*
+		float tmp[4] = {vec.x, vec.y, vec.z, vec.w};
+		glLightfv(lightindex, GL_POSITION, tmp);
+#else
+		glLightfv(lightindex, GL_POSITION, vec.ptr());
+#endif
+		// Set spotlight direction
+        if (lt->getType() == Light::LT_SPOTLIGHT)
+        {
+            vec = lt->getDerivedDirection();
+            vec.w = 0.0; 
+#if OGRE_DOUBLE_PRECISION
+			// Must convert to float*
+			float tmp2[4] = {vec.x, vec.y, vec.z, vec.w};
+			glLightfv(lightindex, GL_SPOT_DIRECTION, tmp2);
+#else
+            glLightfv(lightindex, GL_SPOT_DIRECTION, vec.ptr());
+#endif
+        }
+    }
+    //---------------------------------------------------------------------
+	void GLRenderSystem::setVertexDeclaration(VertexDeclaration* decl)
+	{
+	}
+    //---------------------------------------------------------------------
+	void GLRenderSystem::setVertexBufferBinding(VertexBufferBinding* binding)
+	{
+	}
+    //---------------------------------------------------------------------
+    void GLRenderSystem::_render(const RenderOperation& op)
+	{
+        // Call super class
+        RenderSystem::_render(op);
+
+        void* pBufferData = 0;
+        
+        const VertexDeclaration::VertexElementList& decl = 
+            op.vertexData->vertexDeclaration->getElements();
+        VertexDeclaration::VertexElementList::const_iterator elem, elemEnd;
+        elemEnd = decl.end();
+
+        for (elem = decl.begin(); elem != elemEnd; ++elem)
+        {
+			if (!op.vertexData->vertexBufferBinding->isBufferBound(elem->getSource()))
+				continue; // skip unbound elements
+
+            HardwareVertexBufferSharedPtr vertexBuffer = 
+                op.vertexData->vertexBufferBinding->getBuffer(elem->getSource());
+            if(mCapabilities->hasCapability(RSC_VBO))
+            {
+                glBindBufferARB(GL_ARRAY_BUFFER_ARB, 
+                    static_cast<const GLHardwareVertexBuffer*>(vertexBuffer.get())->getGLBufferId());
+                pBufferData = VBO_BUFFER_OFFSET(elem->getOffset());
+            }
+            else
+            {
+                pBufferData = static_cast<const GLDefaultHardwareVertexBuffer*>(vertexBuffer.get())->getDataPtr(elem->getOffset());
+            }
+            if (op.vertexData->vertexStart)
+            {
+                pBufferData = static_cast<char*>(pBufferData) + op.vertexData->vertexStart * vertexBuffer->getVertexSize();
+            }
+
+            unsigned int i = 0;
+			VertexElementSemantic sem = elem->getSemantic();
+            switch(sem)
+            {
+            case VES_POSITION:
+                glVertexPointer(VertexElement::getTypeCount(
+                    elem->getType()), 
+                    GLHardwareBufferManager::getGLType(elem->getType()), 
+                    static_cast<GLsizei>(vertexBuffer->getVertexSize()), 
+                    pBufferData);
+                glEnableClientState( GL_VERTEX_ARRAY );
+                break;
+            case VES_NORMAL:
+                glNormalPointer(
+                    GLHardwareBufferManager::getGLType(elem->getType()), 
+                    static_cast<GLsizei>(vertexBuffer->getVertexSize()), 
+                    pBufferData);
+                glEnableClientState( GL_NORMAL_ARRAY );
+                break;
+            case VES_DIFFUSE:
+                glColorPointer(4, 
+                    GLHardwareBufferManager::getGLType(elem->getType()), 
+                    static_cast<GLsizei>(vertexBuffer->getVertexSize()), 
+                    pBufferData);
+                glEnableClientState( GL_COLOR_ARRAY );
+                break;
+            case VES_SPECULAR:
+				if (GLEW_EXT_secondary_color)
+				{
+					glSecondaryColorPointerEXT(4, 
+						GLHardwareBufferManager::getGLType(elem->getType()), 
+						static_cast<GLsizei>(vertexBuffer->getVertexSize()), 
+						pBufferData);
+					glEnableClientState( GL_SECONDARY_COLOR_ARRAY );
+				}
+                break;
+            case VES_TEXTURE_COORDINATES:
+
+				if (mCurrentVertexProgram)
+				{
+					// Programmable pipeline - direct UV assignment
+					glClientActiveTextureARB(GL_TEXTURE0 + elem->getIndex());
+					glTexCoordPointer(
+						VertexElement::getTypeCount(elem->getType()), 
+						GLHardwareBufferManager::getGLType(elem->getType()),
+						static_cast<GLsizei>(vertexBuffer->getVertexSize()), 
+						pBufferData);
+					glEnableClientState( GL_TEXTURE_COORD_ARRAY );
+				}
+				else
+				{
+					// fixed function matching to units based on tex_coord_set
+					for (i = 0; i < mDisabledTexUnitsFrom; i++)
+					{
+						// Only set this texture unit's texcoord pointer if it
+						// is supposed to be using this element's index
+						if (mTextureCoordIndex[i] == elem->getIndex())
+						{
+							glClientActiveTextureARB(GL_TEXTURE0 + i);
+							glTexCoordPointer(
+								VertexElement::getTypeCount(elem->getType()), 
+								GLHardwareBufferManager::getGLType(elem->getType()),
+								static_cast<GLsizei>(vertexBuffer->getVertexSize()), 
+									pBufferData);
+							glEnableClientState( GL_TEXTURE_COORD_ARRAY );
+						}
+					}
+				}
+                break;
+            case VES_BLEND_INDICES:
+            case VES_BLEND_WEIGHTS:
+			case VES_TANGENT:
+			case VES_BINORMAL:
+				if (mCurrentVertexProgram)
+				{
+					GLuint attrib = mCurrentVertexProgram->getAttributeIndex(sem);
+	                glVertexAttribPointerARB(
+    	                attrib,
+        	            VertexElement::getTypeCount(elem->getType()), 
+            	        GLHardwareBufferManager::getGLType(elem->getType()), 
+                	    GL_FALSE, // normalisation disabled
+                    	static_cast<GLsizei>(vertexBuffer->getVertexSize()), 
+	                    pBufferData);
+    	            glEnableVertexAttribArrayARB(attrib);
+					
+				}
+                break;
+            default:
+                break;
+            };
+
+        }
+
+        glClientActiveTextureARB(GL_TEXTURE0);
+
+        // Find the correct type to render
+        GLint primType;
+        switch (op.operationType)
+        {
+        case RenderOperation::OT_POINT_LIST:
+            primType = GL_POINTS;
+            break;
+        case RenderOperation::OT_LINE_LIST:
+            primType = GL_LINES;
+            break;
+        case RenderOperation::OT_LINE_STRIP:
+            primType = GL_LINE_STRIP;
+            break;
+		default:
+        case RenderOperation::OT_TRIANGLE_LIST:
+            primType = GL_TRIANGLES;
+            break;
+        case RenderOperation::OT_TRIANGLE_STRIP:
+            primType = GL_TRIANGLE_STRIP;
+            break;
+        case RenderOperation::OT_TRIANGLE_FAN:
+            primType = GL_TRIANGLE_FAN;
+            break;
+        }
+
+        if (op.useIndexes)
+        {
+            if(mCapabilities->hasCapability(RSC_VBO))
+            {
+                glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 
+                    static_cast<GLHardwareIndexBuffer*>(
+                        op.indexData->indexBuffer.get())->getGLBufferId());
+
+                pBufferData = VBO_BUFFER_OFFSET(
+                    op.indexData->indexStart * op.indexData->indexBuffer->getIndexSize());
+            }
+            else
+            {
+                pBufferData = static_cast<GLDefaultHardwareIndexBuffer*>(
+                    op.indexData->indexBuffer.get())->getDataPtr(
+                        op.indexData->indexStart * op.indexData->indexBuffer->getIndexSize());
+            }
+
+            GLenum indexType = (op.indexData->indexBuffer->getType() == HardwareIndexBuffer::IT_16BIT) ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT;
+
+			do
+			{
+				glDrawElements(primType, op.indexData->indexCount, indexType, pBufferData);
+			} while (updatePassIterationRenderState());
+
+        }
+        else
+        {
+			do
+			{
+				glDrawArrays(primType, 0, op.vertexData->vertexCount);
+			} while (updatePassIterationRenderState());
+        }
+
+        glDisableClientState( GL_VERTEX_ARRAY );
+        for (int i = 0; i < OGRE_MAX_TEXTURE_COORD_SETS; i++)
+        {
+            glClientActiveTextureARB(GL_TEXTURE0 + i);
+            glDisableClientState( GL_TEXTURE_COORD_ARRAY );
+        }
+        glClientActiveTextureARB(GL_TEXTURE0);
+        glDisableClientState( GL_NORMAL_ARRAY );
+        glDisableClientState( GL_COLOR_ARRAY );
+		if (GLEW_EXT_secondary_color)
+		{
+			glDisableClientState( GL_SECONDARY_COLOR_ARRAY );
+		}
+        if (mCurrentVertexProgram)
+        {
+			// unbind any custom attributes
+			if (mCurrentVertexProgram->isAttributeValid(VES_BLEND_INDICES))
+			{
+				glDisableVertexAttribArrayARB(
+					mCurrentVertexProgram->getAttributeIndex(
+						VES_BLEND_INDICES)); 
+			}
+			if (mCurrentVertexProgram->isAttributeValid(VES_BLEND_WEIGHTS))
+			{
+				glDisableVertexAttribArrayARB(
+					mCurrentVertexProgram->getAttributeIndex(
+						VES_BLEND_WEIGHTS)); 
+			}
+			if (mCurrentVertexProgram->isAttributeValid(VES_TANGENT))
+			{
+				glDisableVertexAttribArrayARB(
+					mCurrentVertexProgram->getAttributeIndex(
+						VES_TANGENT)); 
+			}
+			if (mCurrentVertexProgram->isAttributeValid(VES_BINORMAL))
+			{
+				glDisableVertexAttribArrayARB(
+					mCurrentVertexProgram->getAttributeIndex(
+						VES_BINORMAL)); 
+			}
+        }
+        glColor4f(1,1,1,1);
+		if (GLEW_EXT_secondary_color)
+		{
+			glSecondaryColor3fEXT(0.0f, 0.0f, 0.0f);
+		}
+
+	}
+    //---------------------------------------------------------------------
+    void GLRenderSystem::setNormaliseNormals(bool normalise)
+    {
+        if (normalise)
+            glEnable(GL_NORMALIZE);
+        else
+            glDisable(GL_NORMALIZE);
+
+    }
+	//---------------------------------------------------------------------
+    void GLRenderSystem::bindGpuProgram(GpuProgram* prg)
+    {
+        GLGpuProgram* glprg = static_cast<GLGpuProgram*>(prg);
+
+        // Unbind previous gpu program first.
+        //
+        // Note:
+        //  1. Even if both previous and current are the same object, we can't
+        //     bypass re-bind completely since the object itself maybe modified.
+        //     But we can bypass unbind based on the assumption that object
+        //     internally GL program type shouldn't be changed after it has
+        //     been created. The behavior of bind to a GL program type twice
+        //     should be same as unbind and rebind that GL program type, even
+        //     for difference objects.
+        //  2. We also assumed that the program's type (vertex or fragment) should
+        //     not be changed during it's in using. If not, the following switch
+        //     statement will confuse GL state completely, and we can't fix it
+        //     here. To fix this case, we must coding the program implementation
+        //     itself, if type is changing (during load/unload, etc), and it's inuse,
+        //     unbind and notify render system to correct for its state.
+        //
+        switch (glprg->getType())
+        {
+        case GPT_VERTEX_PROGRAM:
+            if (mCurrentVertexProgram != glprg)
+            {
+                if (mCurrentVertexProgram)
+                    mCurrentVertexProgram->unbindProgram();
+                mCurrentVertexProgram = glprg;
+            }
+            break;
+
+        case GPT_FRAGMENT_PROGRAM:
+            if (mCurrentFragmentProgram != glprg)
+            {
+                if (mCurrentFragmentProgram)
+                    mCurrentFragmentProgram->unbindProgram();
+                mCurrentFragmentProgram = glprg;
+            }
+            break;
+        }
+
+        // Bind the program
+        glprg->bindProgram();
+
+        RenderSystem::bindGpuProgram(prg);
+    }
+	//---------------------------------------------------------------------
+    void GLRenderSystem::unbindGpuProgram(GpuProgramType gptype)
+    {
+
+        if (gptype == GPT_VERTEX_PROGRAM && mCurrentVertexProgram)
+        {
+            mActiveVertexGpuProgramParameters.setNull();
+            mCurrentVertexProgram->unbindProgram();
+            mCurrentVertexProgram = 0;
+        }
+        else if (gptype == GPT_FRAGMENT_PROGRAM && mCurrentFragmentProgram)
+        {
+            mActiveFragmentGpuProgramParameters.setNull();
+            mCurrentFragmentProgram->unbindProgram();
+            mCurrentFragmentProgram = 0;
+        }
+        RenderSystem::unbindGpuProgram(gptype);
+
+    }
+	//---------------------------------------------------------------------
+    void GLRenderSystem::bindGpuProgramParameters(GpuProgramType gptype, GpuProgramParametersSharedPtr params)
+    {
+        if (gptype == GPT_VERTEX_PROGRAM)
+        {
+            mActiveVertexGpuProgramParameters = params;
+            mCurrentVertexProgram->bindProgramParameters(params);
+        }
+        else
+        {
+            mActiveFragmentGpuProgramParameters = params;
+            mCurrentFragmentProgram->bindProgramParameters(params);
+        }
+    }
+	//---------------------------------------------------------------------
+    void GLRenderSystem::bindGpuProgramPassIterationParameters(GpuProgramType gptype)
+    {
+        if (gptype == GPT_VERTEX_PROGRAM)
+        {
+            mCurrentVertexProgram->bindProgramPassIterationParameters(mActiveVertexGpuProgramParameters);
+        }
+        else
+        {
+            mCurrentFragmentProgram->bindProgramPassIterationParameters(mActiveFragmentGpuProgramParameters);
+        }
+    }
+	//---------------------------------------------------------------------
+    void GLRenderSystem::setClipPlanes(const PlaneList& clipPlanes)
+    {
+        size_t i;
+        size_t numClipPlanes;
+        GLdouble clipPlane[4];
+
+        numClipPlanes = clipPlanes.size();
+        for (i = 0; i < numClipPlanes; ++i)
+        {
+            GLenum clipPlaneId = static_cast<GLenum>(GL_CLIP_PLANE0 + i);
+            const Plane& plane = clipPlanes[i];
+
+            if (i >= 6/*GL_MAX_CLIP_PLANES*/)
+            {
+                OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to set clip plane", 
+                    "GLRenderSystem::setClipPlanes");
+            }
+
+            clipPlane[0] = plane.normal.x;
+            clipPlane[1] = plane.normal.y;
+            clipPlane[2] = plane.normal.z;
+            clipPlane[3] = plane.d;
+
+            glClipPlane(clipPlaneId, clipPlane);
+            glEnable(clipPlaneId);
+        }
+
+            // disable remaining clip planes
+        for ( ; i < 6/*GL_MAX_CLIP_PLANES*/; ++i)
+        {
+            glDisable(static_cast<GLenum>(GL_CLIP_PLANE0 + i));
+        }
+    }
+	//---------------------------------------------------------------------
+    void GLRenderSystem::setScissorTest(bool enabled, size_t left, 
+        size_t top, size_t right, size_t bottom)
+    {
+        // If request texture flipping, use "upper-left", otherwise use "lower-left"
+        bool flipping = mActiveRenderTarget->requiresTextureFlipping();
+        //  GL measures from the bottom, not the top
+        size_t targetHeight = mActiveRenderTarget->getHeight();
+        // Calculate the "lower-left" corner of the viewport
+        GLsizei w, h, x, y;
+
+        if (enabled)
+        {
+            glEnable(GL_SCISSOR_TEST);
+            // NB GL uses width / height rather than right / bottom
+            x = left;
+            if (flipping)
+                y = top;
+            else
+                y = targetHeight - bottom;
+            w = right - left;
+            h = bottom - top;
+            glScissor(x, y, w, h);
+        }
+        else
+        {
+            glDisable(GL_SCISSOR_TEST);
+            // GL requires you to reset the scissor when disabling
+            w = mActiveViewport->getActualWidth();
+            h = mActiveViewport->getActualHeight();
+            x = mActiveViewport->getActualLeft();
+            if (flipping)
+                y = mActiveViewport->getActualTop();
+            else
+                y = targetHeight - mActiveViewport->getActualTop() - h;
+            glScissor(x, y, w, h);
+        }
+    }
+    //---------------------------------------------------------------------
+    void GLRenderSystem::clearFrameBuffer(unsigned int buffers, 
+        const ColourValue& colour, Real depth, unsigned short stencil)
+    {
+
+		bool colourMask = !mColourWrite[0] || !mColourWrite[1] 
+			|| !mColourWrite[2] || !mColourWrite[3]; 
+
+		GLbitfield flags = 0;
+        if (buffers & FBT_COLOUR)
+        {
+            flags |= GL_COLOR_BUFFER_BIT;
+			// Enable buffer for writing if it isn't
+			if (colourMask)
+			{
+				glColorMask(true, true, true, true);
+			}
+			glClearColor(colour.r, colour.g, colour.b, colour.a);
+        }
+        if (buffers & FBT_DEPTH)
+        {
+            flags |= GL_DEPTH_BUFFER_BIT;
+			// Enable buffer for writing if it isn't
+			if (!mDepthWrite)
+			{
+				glDepthMask( GL_TRUE );
+			}
+			glClearDepth(depth);
+        }
+        if (buffers & FBT_STENCIL)
+        {
+            flags |= GL_STENCIL_BUFFER_BIT;
+			// Enable buffer for writing if it isn't
+			glStencilMask(0xFFFFFFFF);
+
+			glClearStencil(stencil);
+        }
+
+        // Should be enable scissor test due the clear region is
+        // relied on scissor box bounds.
+        GLboolean scissorTestEnabled = glIsEnabled(GL_SCISSOR_TEST);
+        if (!scissorTestEnabled)
+        {
+            glEnable(GL_SCISSOR_TEST);
+        }
+
+        // Sets the scissor box as same as viewport
+        GLint viewport[4], scissor[4];
+        glGetIntegerv(GL_VIEWPORT, viewport);
+        glGetIntegerv(GL_SCISSOR_BOX, scissor);
+        bool scissorBoxDifference =
+            viewport[0] != scissor[0] || viewport[1] != scissor[1] ||
+            viewport[2] != scissor[2] || viewport[3] != scissor[3];
+        if (scissorBoxDifference)
+        {
+            glScissor(viewport[0], viewport[1], viewport[2], viewport[3]);
+        }
+
+        // Clear buffers
+        glClear(flags);
+
+        // Restore scissor box
+        if (scissorBoxDifference)
+        {
+            glScissor(scissor[0], scissor[1], scissor[2], scissor[3]);
+        }
+        // Restore scissor test
+        if (!scissorTestEnabled)
+        {
+            glDisable(GL_SCISSOR_TEST);
+        }
+
+        // Reset buffer write state
+        if (!mDepthWrite && (buffers & FBT_DEPTH))
+        {
+            glDepthMask( GL_FALSE );
+        }
+        if (colourMask && (buffers & FBT_COLOUR))
+        {
+            glColorMask(mColourWrite[0], mColourWrite[1], mColourWrite[2], mColourWrite[3]);
+        }
+		if (buffers & FBT_STENCIL)
+		{
+			glStencilMask(mStencilMask);
+		}
+
+    }
+    // ------------------------------------------------------------------
+    void GLRenderSystem::_makeProjectionMatrix(Real left, Real right, 
+        Real bottom, Real top, Real nearPlane, Real farPlane, Matrix4& dest, 
+        bool forGpuProgram)
+    {
+        Real width = right - left;
+        Real height = top - bottom;
+        Real q, qn;
+        if (farPlane == 0)
+        {
+            // Infinite far plane
+            q = Frustum::INFINITE_FAR_PLANE_ADJUST - 1;
+            qn = nearPlane * (Frustum::INFINITE_FAR_PLANE_ADJUST - 2);
+        }
+        else
+        {
+            q = -(farPlane + nearPlane) / (farPlane - nearPlane);
+            qn = -2 * (farPlane * nearPlane) / (farPlane - nearPlane);
+        }
+        dest = Matrix4::ZERO;
+        dest[0][0] = 2 * nearPlane / width;
+        dest[0][2] = (right+left) / width;
+        dest[1][1] = 2 * nearPlane / height;
+        dest[1][2] = (top+bottom) / height;
+        dest[2][2] = q;
+        dest[2][3] = qn;
+        dest[3][2] = -1;
+    }
+
+    // ------------------------------------------------------------------
+    void GLRenderSystem::setClipPlane (ushort index, Real A, Real B, Real C, Real D)
+    {
+        if (ushort(mClipPlanes.size()) < index+1)
+            mClipPlanes.resize(index+1);
+        mClipPlanes[index] = Vector4 (A, B, C, D);
+        GLdouble plane[4] = { A, B, C, D };
+        glClipPlane (GL_CLIP_PLANE0 + index, plane);
+    }
+
+    // ------------------------------------------------------------------
+    void GLRenderSystem::setGLClipPlanes() const
+    {
+        size_t size = mClipPlanes.size();
+        for (size_t i=0; i<size; i++)
+        {
+            const Vector4 &p = mClipPlanes[i];
+            GLdouble plane[4] = { p.x, p.y, p.z, p.w };
+            glClipPlane (GL_CLIP_PLANE0 + i, plane);
+        }
+    }
+
+    // ------------------------------------------------------------------
+    void GLRenderSystem::enableClipPlane (ushort index, bool enable)
+    {
+        glEnable (GL_CLIP_PLANE0 + index);
+    }
+    //---------------------------------------------------------------------
+    HardwareOcclusionQuery* GLRenderSystem::createHardwareOcclusionQuery(void)
+    {
+        GLHardwareOcclusionQuery* ret = new GLHardwareOcclusionQuery(); 
+		mHwOcclusionQueries.push_back(ret);
+		return ret;
+    }
+    //---------------------------------------------------------------------
+    Real GLRenderSystem::getHorizontalTexelOffset(void)
+    {
+        // No offset in GL
+        return 0.0f;
+    }
+    //---------------------------------------------------------------------
+    Real GLRenderSystem::getVerticalTexelOffset(void)
+    {
+        // No offset in GL
+        return 0.0f;
+    }
+ 	//---------------------------------------------------------------------
+    void GLRenderSystem::_applyObliqueDepthProjection(Matrix4& matrix, const Plane& plane, 
+        bool forGpuProgram)
+    {
+        // Thanks to Eric Lenyel for posting this calculation at www.terathon.com
+
+        // Calculate the clip-space corner point opposite the clipping plane
+        // as (sgn(clipPlane.x), sgn(clipPlane.y), 1, 1) and
+        // transform it into camera space by multiplying it
+        // by the inverse of the projection matrix
+
+        Vector4 q;
+        q.x = (Math::Sign(plane.normal.x) + matrix[0][2]) / matrix[0][0];
+        q.y = (Math::Sign(plane.normal.y) + matrix[1][2]) / matrix[1][1];
+        q.z = -1.0F;
+        q.w = (1.0F + matrix[2][2]) / matrix[2][3];
+
+        // Calculate the scaled plane vector
+        Vector4 clipPlane4d(plane.normal.x, plane.normal.y, plane.normal.z, plane.d);
+        Vector4 c = clipPlane4d * (2.0F / (clipPlane4d.dotProduct(q)));
+
+        // Replace the third row of the projection matrix
+        matrix[2][0] = c.x;
+        matrix[2][1] = c.y;
+        matrix[2][2] = c.z + 1.0F;
+        matrix[2][3] = c.w; 
+    }
+    //---------------------------------------------------------------------
+    void GLRenderSystem::_oneTimeContextInitialization()
+    {
+        // Set nicer lighting model -- d3d9 has this by default
+        glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);
+        glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);        
+        glEnable(GL_COLOR_SUM);
+        glDisable(GL_DITHER);
+
+        // Check for FSAA
+        // Enable the extension if it was enabled by the GLSupport
+        if (mGLSupport->checkExtension("GL_ARB_multisample"))
+        {
+            int fsaa_active = false;
+            glGetIntegerv(GL_SAMPLE_BUFFERS_ARB,(GLint*)&fsaa_active);
+            if(fsaa_active)
+            {
+                glEnable(GL_MULTISAMPLE_ARB);
+                LogManager::getSingleton().logMessage("Using FSAA from GL_ARB_multisample extension.");
+            }            
+        }
+    }
+    //---------------------------------------------------------------------
+    void GLRenderSystem::_switchContext(GLContext *context)
+    {
+        // Unbind GPU programs and rebind to new context later, because
+        // scene manager treat render system as ONE 'context' ONLY, and it
+        // cached the GPU programs using state.
+        if (mCurrentVertexProgram)
+            mCurrentVertexProgram->unbindProgram();
+        if (mCurrentFragmentProgram)
+            mCurrentFragmentProgram->unbindProgram();
+
+        // It's ready to switching
+        mCurrentContext->endCurrent();
+        mCurrentContext = context;
+        mCurrentContext->setCurrent();
+        
+        // Check if the context has already done one-time initialisation
+        if(!mCurrentContext->getInitialized()) 
+        {
+            _oneTimeContextInitialization();
+            mCurrentContext->setInitialized();
+        }
+
+        // Rebind GPU programs to new context
+        if (mCurrentVertexProgram)
+            mCurrentVertexProgram->bindProgram();
+        if (mCurrentFragmentProgram)
+            mCurrentFragmentProgram->bindProgram();
+
+        // Must reset depth/colour write mask to according with user desired, otherwise,
+        // clearFrameBuffer would be wrong because the value we are recorded may be
+        // difference with the really state stored in GL context.
+        glDepthMask(mDepthWrite);
+        glColorMask(mColourWrite[0], mColourWrite[1], mColourWrite[2], mColourWrite[3]);
+		glStencilMask(mStencilMask);
+
+    }
+    //---------------------------------------------------------------------
+    void GLRenderSystem::_setRenderTarget(RenderTarget *target)
+    {
+        // Unbind frame buffer object
+        if(mActiveRenderTarget)
+            mRTTManager->unbind(mActiveRenderTarget);
+        
+        mActiveRenderTarget = target;
+        
+        // Switch context if different from current one
+        GLContext *newContext = 0;
+        target->getCustomAttribute("GLCONTEXT", &newContext);
+        if(newContext && mCurrentContext != newContext) 
+        {
+            _switchContext(newContext);
+        }
+        
+        // Bind frame buffer object
+        mRTTManager->bind(target);
+    }
+    //---------------------------------------------------------------------
+    void GLRenderSystem::_unregisterContext(GLContext *context)
+    {
+        if(mCurrentContext == context) {
+            // Change the context to something else so that a valid context
+            // remains active. When this is the main context being unregistered,
+            // we set the main context to 0.
+            if(mCurrentContext != mMainContext) {
+                _switchContext(mMainContext);
+            } else {
+                /// No contexts remain
+                mCurrentContext->endCurrent();
+                mCurrentContext = 0;
+                mMainContext = 0;
+            }
+        }
+    }
+    //---------------------------------------------------------------------
+    Real GLRenderSystem::getMinimumDepthInputValue(void)
+    {
+        // Range [-1.0f, 1.0f]
+        return -1.0f;
+    }
+    //---------------------------------------------------------------------
+    Real GLRenderSystem::getMaximumDepthInputValue(void)
+    {
+        // Range [-1.0f, 1.0f]
+        return 1.0f;
+    }
+    //---------------------------------------------------------------------
+	void GLRenderSystem::registerThread()
+	{
+		// This is only valid once we've created the main context
+		if (!mMainContext)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
+				"Cannot register a background thread before the main context "
+				"has been created.", 
+				"GLRenderSystem::registerThread");
+		}
+
+		// Create a new context for this thread. Cloning from the main context
+		// will ensure that resources are shared with the main context
+		// We want a separate context so that we can safely create GL
+		// objects in parallel with the main thread
+		GLContext* newContext = mMainContext->clone();
+		mBackgroundContextList.push_back(newContext);
+
+		// Bind this new context to this thread. 
+		newContext->setCurrent();
+
+		_oneTimeContextInitialization();
+		newContext->setInitialized();
+
+
+	}
+    //---------------------------------------------------------------------
+	void GLRenderSystem::unregisterThread()
+	{
+		// nothing to do here?
+		// Don't need to worry about active context, just make sure we delete
+		// on shutdown.
+
+	}
+	//---------------------------------------------------------------------
+	void GLRenderSystem::preExtraThreadsStarted()
+	{
+		// free context, we'll need this to share lists
+		mCurrentContext->endCurrent();
+	}
+	//---------------------------------------------------------------------
+	void GLRenderSystem::postExtraThreadsStarted()
+	{
+		// reacquire context
+		mCurrentContext->setCurrent();
+	}
+
+
+}
Index: /RenderSystems/GL/src/OgreGLRenderTexture.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLRenderTexture.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLRenderTexture.cpp	(revision 5)
@@ -0,0 +1,125 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreGLRenderTexture.h"
+#include "OgreGLPixelFormat.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+#include "OgreRoot.h"
+#include "OgreGLHardwarePixelBuffer.h"
+
+namespace Ogre {
+
+
+//-----------------------------------------------------------------------------
+
+template<> GLRTTManager* Singleton<GLRTTManager>::ms_Singleton = 0;
+    GLRTTManager::~GLRTTManager()
+    {
+    }
+    MultiRenderTarget* GLRTTManager::createMultiRenderTarget(const String & name)
+    {
+    	OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "MultiRenderTarget can only be used with GL_EXT_framebuffer_object extension", "GLRTTManager::createMultiRenderTarget");
+    }
+    PixelFormat GLRTTManager::getSupportedAlternative(PixelFormat format)
+    {
+        if(checkFormat(format))
+            return format;
+        /// Find first alternative
+        PixelComponentType pct = PixelUtil::getComponentType(format);
+        switch(pct)
+        {
+        case PCT_BYTE: format = PF_A8R8G8B8; break;
+        case PCT_SHORT: format = PF_SHORT_RGBA; break;
+        case PCT_FLOAT16: format = PF_FLOAT16_RGBA; break;
+        case PCT_FLOAT32: format = PF_FLOAT32_RGBA; break;
+        }
+        if(checkFormat(format))
+            return format;
+        /// If none at all, return to default
+        return PF_A8R8G8B8;
+    }
+//-----------------------------------------------------------------------------  
+    GLRenderTexture::GLRenderTexture(const String &name, const GLSurfaceDesc &target):
+        RenderTexture(target.buffer, target.zoffset)
+    {
+        mName = name;
+    }
+    GLRenderTexture::~GLRenderTexture()
+    {
+    }
+//-----------------------------------------------------------------------------  
+    GLCopyingRenderTexture::GLCopyingRenderTexture(GLCopyingRTTManager *manager, const String &name, const GLSurfaceDesc &target):
+        GLRenderTexture(name, target)
+    {
+    }
+    void GLCopyingRenderTexture::getCustomAttribute(const String& name, void* pData)
+    {
+        if(name=="TARGET")
+        {
+			GLSurfaceDesc &target = *static_cast<GLSurfaceDesc*>(pData);
+			target.buffer = static_cast<GLHardwarePixelBuffer*>(mBuffer);
+			target.zoffset = mZOffset;
+        }
+    }
+//-----------------------------------------------------------------------------  
+    GLCopyingRTTManager::GLCopyingRTTManager()
+    {
+    }  
+    GLCopyingRTTManager::~GLCopyingRTTManager()
+    {
+    }
+
+    RenderTexture *GLCopyingRTTManager::createRenderTexture(const String &name, const GLSurfaceDesc &target)
+    {
+        return new GLCopyingRenderTexture(this, name, target);
+    }
+    
+    bool GLCopyingRTTManager::checkFormat(PixelFormat format) 
+    { 
+        return true; 
+    }
+
+    void GLCopyingRTTManager::bind(RenderTarget *target)
+    {
+        // Nothing to do here
+    }
+
+    void GLCopyingRTTManager::unbind(RenderTarget *target)
+    {
+        // Copy on unbind
+        GLSurfaceDesc surface;
+		surface.buffer = 0;
+        target->getCustomAttribute("TARGET", &surface);
+        if(surface.buffer)
+            static_cast<GLTextureBuffer*>(surface.buffer)->copyFromFramebuffer(surface.zoffset);
+    }
+	//---------------------------------------------------------------------------------------------
+
+}
+
Index: /RenderSystems/GL/src/OgreGLSupport.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLSupport.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLSupport.cpp	(revision 5)
@@ -0,0 +1,146 @@
+
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+
+#include "OgreGLSupport.h"
+#include "OgreGLTexture.h"
+#include "OgreLogManager.h"
+
+namespace Ogre {
+
+	void GLSupport::setConfigOption(const String &name, const String &value)
+	{
+		ConfigOptionMap::iterator it = mOptions.find(name);
+
+        if (it != mOptions.end())
+            it->second.currentValue = value;
+	}
+
+	ConfigOptionMap& GLSupport::getConfigOptions(void)
+	{
+		return mOptions;
+	}
+
+    void GLSupport::initialiseExtensions(void)
+    {
+        // Set version string
+        const GLubyte* pcVer = glGetString(GL_VERSION);
+
+
+        assert(pcVer && "Problems getting GL version string using glGetString");
+       
+        String tmpStr = (const char*)pcVer;
+        LogManager::getSingleton().logMessage("GL_VERSION = " + tmpStr);
+        mVersion = tmpStr.substr(0, tmpStr.find(" "));
+
+        // Get vendor
+        const GLubyte* pcVendor = glGetString(GL_VENDOR);
+        tmpStr = (const char*)pcVendor;
+        LogManager::getSingleton().logMessage("GL_VENDOR = " + tmpStr);
+        mVendor = tmpStr.substr(0, tmpStr.find(" "));
+
+        // Get renderer
+        const GLubyte* pcRenderer = glGetString(GL_RENDERER);
+        tmpStr = (const char*)pcRenderer;
+        LogManager::getSingleton().logMessage("GL_RENDERER = " + tmpStr);
+
+        // Set extension list
+		std::stringstream ext;
+        String str;
+
+        const GLubyte* pcExt = glGetString(GL_EXTENSIONS);
+        LogManager::getSingleton().logMessage("GL_EXTENSIONS = " + String((const char*)pcExt));
+
+        assert(pcExt && "Problems getting GL extension string using glGetString");
+
+        ext << pcExt;
+
+        while(ext >> str)
+        {
+            extensionList.insert(str);
+        }
+    }
+
+    bool GLSupport::checkMinGLVersion(const String& v) const
+    {
+        unsigned int first, second, third;
+        unsigned int cardFirst, cardSecond, cardThird;
+        if(v == mVersion)
+            return true;
+
+        String::size_type pos = v.find(".");
+        if(pos == String::npos)
+            return false;
+
+        String::size_type pos1 = v.rfind(".");
+        if(pos1 == String::npos)
+            return false;
+
+        first = ::atoi(v.substr(0, pos).c_str());
+        second = ::atoi(v.substr(pos + 1, pos1 - (pos + 1)).c_str());
+        third = ::atoi(v.substr(pos1 + 1, v.length()).c_str());
+
+        pos = mVersion.find(".");
+        if(pos == String::npos)
+            return false;
+
+        pos1 = mVersion.rfind(".");
+        if(pos1 == String::npos)
+            return false;
+
+        cardFirst  = ::atoi(mVersion.substr(0, pos).c_str());
+        cardSecond = ::atoi(mVersion.substr(pos + 1, pos1 - (pos + 1)).c_str());
+        cardThird  = ::atoi(mVersion.substr(pos1 + 1, mVersion.length()).c_str());
+
+        if(first <= cardFirst && second <= cardSecond && third <= cardThird)
+          return true;
+
+        return false;
+    }
+
+    bool GLSupport::checkExtension(const String& ext) const
+    {
+        if(extensionList.find(ext) == extensionList.end())
+            return false; 
+        
+        return true;
+    }
+    
+    bool GLSupport::supportsPBuffers()
+    {
+        return (GLEW_ARB_pixel_buffer_object || GLEW_EXT_pixel_buffer_object) != GL_FALSE;
+    }
+
+    GLPBuffer* GLSupport::createPBuffer(PixelComponentType format, size_t width, size_t height)
+    {
+        return 0;
+    }
+
+}
Index: /RenderSystems/GL/src/OgreGLTexture.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLTexture.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLTexture.cpp	(revision 5)
@@ -0,0 +1,393 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLTexture.h"
+#include "OgreGLSupport.h"
+#include "OgreGLPixelFormat.h"
+#include "OgreGLHardwarePixelBuffer.h"
+
+#include "OgreTextureManager.h"
+#include "OgreImage.h"
+#include "OgreLogManager.h"
+#include "OgreCamera.h"
+#include "OgreException.h"
+#include "OgreRoot.h"
+#include "OgreCodec.h"
+#include "OgreImageCodec.h"
+#include "OgreStringConverter.h"
+#include "OgreBitwise.h"
+
+#include "OgreGLFBORenderTexture.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#   include <windows.h>
+#   include <wingdi.h>
+#endif
+
+namespace Ogre {
+
+
+
+    GLTexture::GLTexture(ResourceManager* creator, const String& name, 
+        ResourceHandle handle, const String& group, bool isManual, 
+        ManualResourceLoader* loader, GLSupport& support) 
+        : Texture(creator, name, handle, group, isManual, loader),
+        mTextureID(0), mGLSupport(support)
+    {
+    }
+
+
+    GLTexture::~GLTexture()
+    {
+        // have to call this here reather than in Resource destructor
+        // since calling virtual methods in base destructors causes crash
+		if (isLoaded())
+		{
+			unload(); 
+		}
+		else
+		{
+			freeInternalResources();
+		}
+    }
+
+    GLenum GLTexture::getGLTextureTarget(void) const
+    {
+        switch(mTextureType)
+        {
+            case TEX_TYPE_1D:
+                return GL_TEXTURE_1D;
+            case TEX_TYPE_2D:
+                return GL_TEXTURE_2D;
+            case TEX_TYPE_3D:
+                return GL_TEXTURE_3D;
+            case TEX_TYPE_CUBE_MAP:
+                return GL_TEXTURE_CUBE_MAP;
+            default:
+                return 0;
+        };
+    }
+
+	//* Creation / loading methods ********************************************
+	void GLTexture::createInternalResourcesImpl(void)
+    {
+		// Convert to nearest power-of-two size if required
+        mWidth = GLPixelUtil::optionalPO2(mWidth);      
+        mHeight = GLPixelUtil::optionalPO2(mHeight);
+        mDepth = GLPixelUtil::optionalPO2(mDepth);
+		
+
+		// Adjust format if required
+		mFormat = TextureManager::getSingleton().getNativeFormat(mTextureType, mFormat, mUsage);
+		
+		// Check requested number of mipmaps
+		size_t maxMips = GLPixelUtil::getMaxMipmaps(mWidth, mHeight, mDepth, mFormat);
+		mNumMipmaps = mNumRequestedMipmaps;
+		if(mNumMipmaps>maxMips)
+			mNumMipmaps = maxMips;
+		
+		// Generate texture name
+        glGenTextures( 1, &mTextureID );
+		
+		// Set texture type
+		glBindTexture( getGLTextureTarget(), mTextureID );
+        
+		// This needs to be set otherwise the texture doesn't get rendered
+        glTexParameteri( getGLTextureTarget(), GL_TEXTURE_MAX_LEVEL, mNumMipmaps );
+        
+        // Set some misc default parameters so NVidia won't complain, these can of course be changed later
+        glTexParameteri(getGLTextureTarget(), GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+        glTexParameteri(getGLTextureTarget(), GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+        glTexParameteri(getGLTextureTarget(), GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+        glTexParameteri(getGLTextureTarget(), GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+		
+		// If we can do automip generation and the user desires this, do so
+		mMipmapsHardwareGenerated = 
+			Root::getSingleton().getRenderSystem()->getCapabilities()->hasCapability(RSC_AUTOMIPMAP);
+		if((mUsage & TU_AUTOMIPMAP) &&
+		    mNumRequestedMipmaps && mMipmapsHardwareGenerated)
+        {
+            glTexParameteri( getGLTextureTarget(), GL_GENERATE_MIPMAP, GL_TRUE );
+        }
+		
+		// Allocate internal buffer so that glTexSubImageXD can be used
+		// Internal format
+		GLenum format = GLPixelUtil::getClosestGLInternalFormat(mFormat);
+		size_t width = mWidth;
+		size_t height = mHeight;
+		size_t depth = mDepth;
+#if 0
+        /** Luckily, this hack seems not to be needed; empty compressed textures can very well be created the 
+            conventional way with glTexImageXD.
+        */
+		if(PixelUtil::isCompressed(mFormat))
+		{
+			// Compressed formats
+			size_t size = PixelUtil::getMemorySize(mWidth, mHeight, mDepth, mFormat);
+			// Provide temporary buffer filled with zeroes as glCompressedTexImageXD does not
+			// accept a 0 pointer like normal glTexImageXD
+			// Run through this process for every mipmap to pregenerate mipmap piramid
+			uint8 *tmpdata = new uint8[size];
+			memset(tmpdata, 0, size);
+			
+			for(size_t mip=0; mip<=mNumMipmaps; mip++)
+			{
+				size = PixelUtil::getMemorySize(width, height, depth, mFormat);
+				switch(mTextureType)
+				{
+					case TEX_TYPE_1D:
+						glCompressedTexImage1DARB(GL_TEXTURE_1D, mip, format, 
+							width, 0, 
+							size, tmpdata);
+						break;
+					case TEX_TYPE_2D:
+						glCompressedTexImage2DARB(GL_TEXTURE_2D, mip, format,
+							width, height, 0, 
+							size, tmpdata);
+						break;
+					case TEX_TYPE_3D:
+						glCompressedTexImage3DARB(GL_TEXTURE_3D, mip, format,
+							width, height, depth, 0, 
+							size, tmpdata);
+						break;
+					case TEX_TYPE_CUBE_MAP:
+						for(int face=0; face<6; face++) {
+							glCompressedTexImage2DARB(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, mip, format,
+								width, height, 0, 
+								size, tmpdata);
+						}
+						break;
+				};
+				if(width>1)		width = width/2;
+				if(height>1)	height = height/2;
+				if(depth>1)		depth = depth/2;
+			}
+			delete [] tmpdata;
+		}
+		else
+#endif
+		{
+			// Run through this process to pregenerate mipmap piramid
+			for(size_t mip=0; mip<=mNumMipmaps; mip++)
+			{
+				// Normal formats
+				switch(mTextureType)
+				{
+					case TEX_TYPE_1D:
+						glTexImage1D(GL_TEXTURE_1D, mip, format,
+							width, 0, 
+							GL_RGBA, GL_UNSIGNED_BYTE, 0);
+	
+						break;
+					case TEX_TYPE_2D:
+						glTexImage2D(GL_TEXTURE_2D, mip, format,
+							width, height, 0, 
+							GL_RGBA, GL_UNSIGNED_BYTE, 0);
+						break;
+					case TEX_TYPE_3D:
+						glTexImage3D(GL_TEXTURE_3D, mip, format,
+							width, height, depth, 0, 
+							GL_RGBA, GL_UNSIGNED_BYTE, 0);
+						break;
+					case TEX_TYPE_CUBE_MAP:
+						for(int face=0; face<6; face++) {
+							glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, mip, format,
+								width, height, 0, 
+								GL_RGBA, GL_UNSIGNED_BYTE, 0);
+						}
+						break;
+				};
+				if(width>1)		width = width/2;
+				if(height>1)	height = height/2;
+				if(depth>1)		depth = depth/2;
+			}
+		}
+		_createSurfaceList();
+		// Get final internal format
+		mFormat = getBuffer(0,0)->getFormat();
+	}
+	
+    void GLTexture::createRenderTexture(void)
+    {
+        // Create the GL texture
+		// This already does everything neccessary
+        createInternalResources();
+    }
+	
+    void GLTexture::loadImpl()
+    {
+        if( mUsage & TU_RENDERTARGET )
+        {
+            createRenderTexture();
+        }
+        else
+        {
+			String baseName, ext;
+			size_t pos = mName.find_last_of(".");
+			if( pos == String::npos )
+				OGRE_EXCEPT(
+					Exception::ERR_INVALIDPARAMS, 
+					"Unable to load image file '"+ mName + "' - invalid extension.",
+					"GLTexture::loadImpl" );
+
+			baseName = mName.substr(0, pos);
+			ext = mName.substr(pos+1);
+    
+			if(mTextureType == TEX_TYPE_1D || mTextureType == TEX_TYPE_2D || 
+                mTextureType == TEX_TYPE_3D)
+            {
+                Image img;
+	            // find & load resource data intro stream to allow resource
+				// group changes if required
+				DataStreamPtr dstream = 
+					ResourceGroupManager::getSingleton().openResource(
+						mName, mGroup, true, this);
+
+                img.load(dstream, ext);
+
+				// If this is a cube map, set the texture type flag accordingly.
+                if (img.hasFlag(IF_CUBEMAP))
+					mTextureType = TEX_TYPE_CUBE_MAP;
+				// If this is a volumetric texture set the texture type flag accordingly.
+				if(img.getDepth() > 1)
+					mTextureType = TEX_TYPE_3D;
+
+				// Call internal _loadImages, not loadImage since that's external and 
+				// will determine load status etc again
+				ConstImagePtrList imagePtrs;
+				imagePtrs.push_back(&img);
+				_loadImages( imagePtrs );
+            }
+            else if (mTextureType == TEX_TYPE_CUBE_MAP)
+            {
+				if(StringUtil::endsWith(getName(), ".dds"))
+				{
+					// XX HACK there should be a better way to specify whether 
+					// all faces are in the same file or not
+					Image img;
+	            	// find & load resource data intro stream to allow resource
+					// group changes if required
+					DataStreamPtr dstream = 
+						ResourceGroupManager::getSingleton().openResource(
+							mName, mGroup, true, this);
+
+	                img.load(dstream, ext);
+					// Call internal _loadImages, not loadImage since that's external and 
+					// will determine load status etc again
+					ConstImagePtrList imagePtrs;
+					imagePtrs.push_back(&img);
+					_loadImages( imagePtrs );
+				}
+				else
+				{
+					std::vector<Image> images(6);
+					ConstImagePtrList imagePtrs;
+					static const String suffixes[6] = {"_rt", "_lf", "_up", "_dn", "_fr", "_bk"};
+	
+					for(size_t i = 0; i < 6; i++)
+					{
+						String fullName = baseName + suffixes[i] + "." + ext;
+		            	// find & load resource data intro stream to allow resource
+						// group changes if required
+						DataStreamPtr dstream = 
+							ResourceGroupManager::getSingleton().openResource(
+								fullName, mGroup, true, this);
+	
+						images[i].load(dstream, ext);
+						imagePtrs.push_back(&images[i]);
+					}
+	
+					_loadImages( imagePtrs );
+				}
+            }
+            else
+                OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED, "**** Unknown texture type ****", "GLTexture::load" );
+        }
+    }
+	
+	//*************************************************************************
+    
+    void GLTexture::freeInternalResourcesImpl()
+    {
+		mSurfaceList.clear();
+        glDeleteTextures( 1, &mTextureID );
+    }
+
+	
+	//---------------------------------------------------------------------------------------------
+	void GLTexture::_createSurfaceList()
+	{
+		mSurfaceList.clear();
+		
+		// For all faces and mipmaps, store surfaces as HardwarePixelBufferSharedPtr
+		bool wantGeneratedMips = (mUsage & TU_AUTOMIPMAP)!=0;
+		
+		// Do mipmapping in software? (uses GLU) For some cards, this is still needed. Of course,
+		// only when mipmap generation is desired.
+		bool doSoftware = wantGeneratedMips && !mMipmapsHardwareGenerated && getNumMipmaps(); 
+		
+		for(size_t face=0; face<getNumFaces(); face++)
+		{
+			for(size_t mip=0; mip<=getNumMipmaps(); mip++)
+			{
+                GLHardwarePixelBuffer *buf = new GLTextureBuffer(mName, getGLTextureTarget(), mTextureID, face, mip,
+						static_cast<HardwareBuffer::Usage>(mUsage), doSoftware && mip==0);
+				mSurfaceList.push_back(HardwarePixelBufferSharedPtr(buf));
+                
+                /// Check for error
+                if(buf->getWidth()==0 || buf->getHeight()==0 || buf->getDepth()==0)
+                {
+                    OGRE_EXCEPT(
+                        Exception::ERR_RENDERINGAPI_ERROR, 
+                        "Zero sized texture surface on texture "+getName()+
+                            " face "+StringConverter::toString(face)+
+                            " mipmap "+StringConverter::toString(mip)+
+                            ". Probably, the GL driver refused to create the texture.", 
+                            "GLTexture::_createSurfaceList");
+                }
+			}
+		}
+	}
+	
+	//---------------------------------------------------------------------------------------------
+	HardwarePixelBufferSharedPtr GLTexture::getBuffer(size_t face, size_t mipmap)
+	{
+		if(face >= getNumFaces())
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Face index out of range",
+					"GLTexture::getBuffer");
+		if(mipmap > mNumMipmaps)
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Mipmap index out of range",
+					"GLTexture::getBuffer");
+		unsigned int idx = face*(mNumMipmaps+1) + mipmap;
+		assert(idx < mSurfaceList.size());
+		return mSurfaceList[idx];
+	}
+	
+}
+
Index: /RenderSystems/GL/src/OgreGLTextureManager.cpp
===================================================================
--- /RenderSystems/GL/src/OgreGLTextureManager.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreGLTextureManager.cpp	(revision 5)
@@ -0,0 +1,198 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGLTextureManager.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreGLRenderTexture.h"
+
+namespace Ogre {
+    //-----------------------------------------------------------------------------
+    GLTextureManager::GLTextureManager(GLSupport& support)
+        : TextureManager(), mGLSupport(support), mWarningTextureID(0)
+    {
+        // register with group manager
+        ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
+
+		createWarningTexture();
+    }
+    //-----------------------------------------------------------------------------
+    GLTextureManager::~GLTextureManager()
+    {
+        // unregister with group manager
+        ResourceGroupManager::getSingleton()._unregisterResourceManager(mResourceType);
+		// Delete warning texture
+		glDeleteTextures(1, &mWarningTextureID);
+    }
+    //-----------------------------------------------------------------------------
+    Resource* GLTextureManager::createImpl(const String& name, ResourceHandle handle, 
+        const String& group, bool isManual, ManualResourceLoader* loader, 
+        const NameValuePairList* createParams)
+    {
+        return new GLTexture(this, name, handle, group, isManual, loader, mGLSupport);
+    }
+
+	//-----------------------------------------------------------------------------
+	void GLTextureManager::createWarningTexture()
+	{
+		// Generate warning texture
+		size_t width = 8;
+		size_t height = 8;
+		uint32 *data = new uint32[width*height];		// 0xXXRRGGBB
+		// Yellow/black stripes
+		for(size_t y=0; y<height; ++y)
+		{
+			for(size_t x=0; x<width; ++x)
+			{
+				data[y*width+x] = (((x+y)%8)<4)?0x000000:0xFFFF00;
+			}
+		}
+		// Create GL resource
+        glGenTextures(1, &mWarningTextureID);
+		glBindTexture(GL_TEXTURE_2D, mWarningTextureID);
+        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
+		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, (void*)data);
+		// Free memory
+		delete [] data;
+	}
+	//-----------------------------------------------------------------------------
+	PixelFormat GLTextureManager::getNativeFormat(TextureType ttype, PixelFormat format, int usage)
+	{
+		// Adjust requested parameters to capabilities
+        const RenderSystemCapabilities *caps = Root::getSingleton().getRenderSystem()->getCapabilities();
+
+		// Check compressed texture support
+		// if a compressed format not supported, revert to PF_A8R8G8B8
+		if(PixelUtil::isCompressed(format) &&
+            !caps->hasCapability( RSC_TEXTURE_COMPRESSION_DXT ))
+		{
+			return PF_A8R8G8B8;
+		}
+		// if floating point textures not supported, revert to PF_A8R8G8B8
+		if(PixelUtil::isFloatingPoint(format) &&
+            !caps->hasCapability( RSC_TEXTURE_FLOAT ))
+		{
+			return PF_A8R8G8B8;
+		}
+        
+        // Check if this is a valid rendertarget format
+		if( usage & TU_RENDERTARGET )
+        {
+            /// Get closest supported alternative
+            /// If mFormat is supported it's returned
+            return GLRTTManager::getSingleton().getSupportedAlternative(format);
+        }
+
+		// Supported
+		return format;
+
+		
+	}
+	//-----------------------------------------------------------------------------
+    bool GLTextureManager::isHardwareFilteringSupported(TextureType ttype, PixelFormat format, int usage,
+            bool preciseFormatOnly)
+    {
+        if (format == PF_UNKNOWN)
+            return false;
+
+        // Check natively format
+        PixelFormat nativeFormat = getNativeFormat(ttype, format, usage);
+        if (preciseFormatOnly && format != nativeFormat)
+            return false;
+
+        // Assume non-floating point is supported always
+        if (!PixelUtil::isFloatingPoint(nativeFormat))
+            return true;
+
+        // Hack: there are no elegant GL API to detects texture filtering supported,
+        // just hard code for cards based on vendor specifications.
+
+        // TODO: Add cards that 16 bits floating point flitering supported by
+        // hardware below
+        static const String sFloat16SupportedCards[] =
+        {
+            // GeForce 8 Series
+            "*GeForce*8800*",
+
+            // GeForce 7 Series
+            "*GeForce*7950*",
+            "*GeForce*7900*",
+            "*GeForce*7800*",
+            "*GeForce*7600*",
+            "*GeForce*7500*",
+            "*GeForce*7300*",
+
+            // GeForce 6 Series
+            "*GeForce*6800*",
+            "*GeForce*6700*",
+            "*GeForce*6600*",
+            "*GeForce*6500*",
+
+            ""                      // Empty string means end of list
+        };
+
+        // TODO: Add cards that 32 bits floating point flitering supported by
+        // hardware below
+        static const String sFloat32SupportedCards[] =
+        {
+            // GeForce 8 Series
+            "*GeForce*8800*",
+
+            ""                      // Empty string means end of list
+        };
+
+        PixelComponentType pct = PixelUtil::getComponentType(nativeFormat);
+        const String* supportedCards;
+        switch (pct)
+        {
+        case PCT_FLOAT16:
+            supportedCards = sFloat16SupportedCards;
+            break;
+        case PCT_FLOAT32:
+            supportedCards = sFloat32SupportedCards;
+            break;
+        default:
+            return false;
+        }
+
+        const GLubyte* pcRenderer = glGetString(GL_RENDERER);
+        String str = (const char*)pcRenderer;
+
+        for (; !supportedCards->empty(); ++supportedCards)
+        {
+            if (StringUtil::match(str, *supportedCards))
+            {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+}
Index: /RenderSystems/GL/src/OgreWin32GLSupport.cpp
===================================================================
--- /RenderSystems/GL/src/OgreWin32GLSupport.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreWin32GLSupport.cpp	(revision 5)
@@ -0,0 +1,523 @@
+#include "OgreRoot.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+
+#include <algorithm>
+
+#include "OgreWin32GLSupport.h"
+#include "OgreGLTexture.h"
+#include "OgreWin32Window.h"
+#include <GL/wglext.h>
+#include "OgreWin32RenderTexture.h"
+
+using namespace Ogre;
+
+GLenum wglewContextInit (Ogre::GLSupport *glSupport);
+
+namespace Ogre {
+	Win32GLSupport::Win32GLSupport()
+        : mInitialWindow(0)
+        , mHasPixelFormatARB(false)
+        , mHasMultisample(false)
+    {
+		// immediately test WGL_ARB_pixel_format and FSAA support
+		// so we can set configuration options appropriately
+		initialiseWGL();
+    } 
+
+	template<class C> void remove_duplicates(C& c)
+	{
+		std::sort(c.begin(), c.end());
+		typename C::iterator p = std::unique(c.begin(), c.end());
+		c.erase(p, c.end());
+	}
+
+	void Win32GLSupport::addConfig()
+	{
+		//TODO: EnumDisplayDevices http://msdn.microsoft.com/library/en-us/gdi/devcons_2303.asp
+		/*vector<string> DisplayDevices;
+		DISPLAY_DEVICE DisplayDevice;
+		DisplayDevice.cb = sizeof(DISPLAY_DEVICE);
+		DWORD i=0;
+		while (EnumDisplayDevices(NULL, i++, &DisplayDevice, 0) {
+			DisplayDevices.push_back(DisplayDevice.DeviceName);
+		}*/
+		  
+		ConfigOption optFullScreen;
+		ConfigOption optVideoMode;
+		ConfigOption optColourDepth;
+		ConfigOption optDisplayFrequency;
+		ConfigOption optVSync;
+		ConfigOption optFSAA;
+		ConfigOption optRTTMode;
+
+		// FS setting possiblities
+		optFullScreen.name = "Full Screen";
+		optFullScreen.possibleValues.push_back("Yes");
+		optFullScreen.possibleValues.push_back("No");
+		optFullScreen.currentValue = "Yes";
+		optFullScreen.immutable = false;
+
+		// Video mode possiblities
+		DEVMODE DevMode;
+		DevMode.dmSize = sizeof(DEVMODE);
+		optVideoMode.name = "Video Mode";
+		optVideoMode.immutable = false;
+		for (DWORD i = 0; EnumDisplaySettings(NULL, i, &DevMode); ++i)
+		{
+			if (DevMode.dmBitsPerPel < 16 || DevMode.dmPelsHeight < 480)
+				continue;
+			mDevModes.push_back(DevMode);
+			StringUtil::StrStreamType str;
+			str << DevMode.dmPelsWidth << " x " << DevMode.dmPelsHeight;
+			optVideoMode.possibleValues.push_back(str.str());
+		}
+		remove_duplicates(optVideoMode.possibleValues);
+		optVideoMode.currentValue = optVideoMode.possibleValues.front();
+
+		optColourDepth.name = "Colour Depth";
+		optColourDepth.immutable = false;
+		optColourDepth.currentValue.clear();
+
+		optDisplayFrequency.name = "Display Frequency";
+		optDisplayFrequency.immutable = false;
+        optDisplayFrequency.currentValue.clear();
+
+		optVSync.name = "VSync";
+		optVSync.immutable = false;
+		optVSync.possibleValues.push_back("No");
+		optVSync.possibleValues.push_back("Yes");
+		optVSync.currentValue = "No";
+
+		optFSAA.name = "FSAA";
+		optFSAA.immutable = false;
+		optFSAA.possibleValues.push_back("0");
+		for (std::vector<int>::iterator it = mFSAALevels.begin(); it != mFSAALevels.end(); ++it)
+			optFSAA.possibleValues.push_back(StringConverter::toString(*it));
+		optFSAA.currentValue = "0";
+
+		optRTTMode.name = "RTT Preferred Mode";
+		optRTTMode.possibleValues.push_back("FBO");
+		optRTTMode.possibleValues.push_back("PBuffer");
+		optRTTMode.possibleValues.push_back("Copy");
+		optRTTMode.currentValue = "FBO";
+		optRTTMode.immutable = false;
+
+
+		mOptions[optFullScreen.name] = optFullScreen;
+		mOptions[optVideoMode.name] = optVideoMode;
+		mOptions[optColourDepth.name] = optColourDepth;
+		mOptions[optDisplayFrequency.name] = optDisplayFrequency;
+		mOptions[optVSync.name] = optVSync;
+		mOptions[optFSAA.name] = optFSAA;
+		mOptions[optRTTMode.name] = optRTTMode;
+
+		refreshConfig();
+	}
+
+	void Win32GLSupport::refreshConfig()
+	{
+		ConfigOptionMap::iterator optVideoMode = mOptions.find("Video Mode");
+		ConfigOptionMap::iterator moptColourDepth = mOptions.find("Colour Depth");
+		ConfigOptionMap::iterator moptDisplayFrequency = mOptions.find("Display Frequency");
+		if(optVideoMode == mOptions.end() || moptColourDepth == mOptions.end() || moptDisplayFrequency == mOptions.end())
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Can't find mOptions!", "Win32GLSupport::refreshConfig");
+		ConfigOption* optColourDepth = &moptColourDepth->second;
+		ConfigOption* optDisplayFrequency = &moptDisplayFrequency->second;
+
+		const String& val = optVideoMode->second.currentValue;
+		String::size_type pos = val.find('x');
+		if (pos == String::npos)
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Invalid Video Mode provided", "Win32GLSupport::refreshConfig");
+		DWORD width = StringConverter::parseUnsignedInt(val.substr(0, pos));
+		DWORD height = StringConverter::parseUnsignedInt(val.substr(pos+1, String::npos));
+
+		for(std::vector<DEVMODE>::const_iterator i = mDevModes.begin(); i != mDevModes.end(); ++i)
+		{
+			if (i->dmPelsWidth != width || i->dmPelsHeight != height)
+				continue;
+			optColourDepth->possibleValues.push_back(StringConverter::toString(i->dmBitsPerPel));
+			optDisplayFrequency->possibleValues.push_back(StringConverter::toString(i->dmDisplayFrequency));
+		}
+		remove_duplicates(optColourDepth->possibleValues);
+		remove_duplicates(optDisplayFrequency->possibleValues);
+		optColourDepth->currentValue = optColourDepth->possibleValues.back();
+		if (optDisplayFrequency->currentValue != "N/A")
+			optDisplayFrequency->currentValue = optDisplayFrequency->possibleValues.front();
+	}
+
+	void Win32GLSupport::setConfigOption(const String &name, const String &value)
+	{
+		ConfigOptionMap::iterator it = mOptions.find(name);
+
+		// Update
+		if(it != mOptions.end())
+			it->second.currentValue = value;
+		else
+		{
+            StringUtil::StrStreamType str;
+            str << "Option named '" << name << "' does not exist.";
+			OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, str.str(), "Win32GLSupport::setConfigOption" );
+		}
+
+		if( name == "Video Mode" )
+			refreshConfig();
+
+		if( name == "Full Screen" )
+		{
+			it = mOptions.find( "Display Frequency" );
+			if( value == "No" )
+			{
+				it->second.currentValue = "N/A";
+				it->second.immutable = true;
+			}
+			else
+			{
+				it->second.currentValue = it->second.possibleValues.front();
+				it->second.immutable = false;
+			}
+		}
+	}
+
+	String Win32GLSupport::validateConfig()
+	{
+		// TODO, DX9
+		return StringUtil::BLANK;
+	}
+
+	RenderWindow* Win32GLSupport::createWindow(bool autoCreateWindow, GLRenderSystem* renderSystem, const String& windowTitle)
+	{
+		if (autoCreateWindow)
+        {
+            ConfigOptionMap::iterator opt = mOptions.find("Full Screen");
+            if (opt == mOptions.end())
+                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Can't find full screen options!", "Win32GLSupport::createWindow");
+            bool fullscreen = (opt->second.currentValue == "Yes");
+
+            opt = mOptions.find("Video Mode");
+            if (opt == mOptions.end())
+                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Can't find video mode options!", "Win32GLSupport::createWindow");
+            String val = opt->second.currentValue;
+            String::size_type pos = val.find('x');
+            if (pos == String::npos)
+                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Invalid Video Mode provided", "Win32GLSupport::createWindow");
+
+			unsigned int w = StringConverter::parseUnsignedInt(val.substr(0, pos));
+            unsigned int h = StringConverter::parseUnsignedInt(val.substr(pos + 1));
+
+			// Parse optional parameters
+			NameValuePairList winOptions;
+			opt = mOptions.find("Colour Depth");
+			if (opt == mOptions.end())
+				OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Can't find Colour Depth options!", "Win32GLSupport::createWindow");
+			unsigned int colourDepth =
+				StringConverter::parseUnsignedInt(opt->second.currentValue);
+			winOptions["colourDepth"] = StringConverter::toString(colourDepth);
+
+			opt = mOptions.find("VSync");
+			if (opt == mOptions.end())
+				OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Can't find VSync options!", "Win32GLSupport::createWindow");
+			bool vsync = (opt->second.currentValue == "Yes");
+			winOptions["vsync"] = StringConverter::toString(vsync);
+			renderSystem->setWaitForVerticalBlank(vsync);
+
+			opt = mOptions.find("Display Frequency");
+			if (opt != mOptions.end())
+			{
+				unsigned int displayFrequency =
+					StringConverter::parseUnsignedInt(opt->second.currentValue);
+				winOptions["displayFrequency"] = StringConverter::toString(displayFrequency);
+			}
+
+			opt = mOptions.find("FSAA");
+			if (opt == mOptions.end())
+				OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Can't find FSAA options!", "Win32GLSupport::createWindow");
+			unsigned int multisample =
+				StringConverter::parseUnsignedInt(opt->second.currentValue);
+			winOptions["FSAA"] = StringConverter::toString(multisample);
+
+            return renderSystem->createRenderWindow(windowTitle, w, h, fullscreen, &winOptions);
+        }
+        else
+        {
+            // XXX What is the else?
+			return NULL;
+        }
+	}
+
+	RenderWindow* Win32GLSupport::newWindow(const String &name, unsigned int width, 
+		unsigned int height, bool fullScreen, const NameValuePairList *miscParams)
+	{
+		ConfigOptionMap::iterator opt = mOptions.find("Display Frequency");
+		if (opt == mOptions.end())
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Can't find Display Frequency options!", "Win32GLSupport::newWindow");
+		unsigned int displayFrequency = StringConverter::parseUnsignedInt(opt->second.currentValue);
+
+		Win32Window* window = new Win32Window(*this);
+		window->create(name, width, height, fullScreen, miscParams);
+
+		if(!mInitialWindow)
+			mInitialWindow = window;
+		return window;
+	}
+
+	void Win32GLSupport::start()
+	{
+		LogManager::getSingleton().logMessage("*** Starting Win32GL Subsystem ***");
+	}
+
+	void Win32GLSupport::stop()
+	{
+		LogManager::getSingleton().logMessage("*** Stopping Win32GL Subsystem ***");
+		mInitialWindow = 0; // Since there is no removeWindow, although there should be...
+	}
+
+	void Win32GLSupport::initialiseExtensions()
+	{
+		assert(mInitialWindow);
+		// First, initialise the normal extensions
+		GLSupport::initialiseExtensions();
+		// wglew init
+		wglewContextInit(this);
+
+		// Check for W32 specific extensions probe function
+		PFNWGLGETEXTENSIONSSTRINGARBPROC _wglGetExtensionsStringARB = 
+			(PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB");
+		if(!_wglGetExtensionsStringARB)
+			return;
+		const char *wgl_extensions = _wglGetExtensionsStringARB(mInitialWindow->getHDC());
+        StringUtil::StrStreamType str;
+        str << "Supported WGL extensions: " << wgl_extensions;
+		LogManager::getSingleton().logMessage(
+			LML_NORMAL, str.str());
+		// Parse them, and add them to the main list
+		std::stringstream ext;
+        String instr;
+		ext << wgl_extensions;
+        while(ext >> instr)
+        {
+            extensionList.insert(instr);
+        }
+	}
+
+
+	void* Win32GLSupport::getProcAddress(const String& procname)
+	{
+        	return (void*)wglGetProcAddress( procname.c_str() );
+	}
+/*
+	RenderTexture * Win32GLSupport::createRenderTexture( const String & name, 
+		unsigned int width, unsigned int height,
+		TextureType texType, PixelFormat internalFormat, 
+		const NameValuePairList *miscParams ) 
+	{
+#ifdef HW_RTT
+		bool useBind = checkExtension("WGL_ARB_render_texture");
+
+		if(Root::getSingleton().getRenderSystem()->getCapabilities()->hasCapability(RSC_HWRENDER_TO_TEXTURE))
+			return new Win32RenderTexture(*this, name, width, height, texType, 
+				internalFormat, miscParams, useBind);
+		else
+#endif
+			return new GLRenderTexture(name, width, height, texType, internalFormat, miscParams);
+	}
+
+*/
+	void Win32GLSupport::initialiseWGL()
+	{
+		// wglGetProcAddress does not work without an active OpenGL context,
+		// but we need wglChoosePixelFormatARB's address before we can
+		// create our main window.  Thank you very much, Microsoft!
+		//
+		// The solution is to create a dummy OpenGL window first, and then
+		// test for WGL_ARB_pixel_format support.  If it is not supported,
+		// we make sure to never call the ARB pixel format functions.
+		//
+		// If is is supported, we call the pixel format functions at least once
+		// to initialise them (pointers are stored by glprocs.h).  We can also
+		// take this opportunity to enumerate the valid FSAA modes.
+		
+		LPCSTR dummyText = "OgreWglDummy";
+#ifdef OGRE_STATIC_LIB
+		HINSTANCE hinst = GetModuleHandle( NULL );
+#else
+		HINSTANCE hinst = GetModuleHandle("RenderSystem_GL.dll");
+#endif
+		
+		WNDCLASS dummyClass;
+		memset(&dummyClass, 0, sizeof(WNDCLASS));
+		dummyClass.style = CS_OWNDC;
+		dummyClass.hInstance = hinst;
+		dummyClass.lpfnWndProc = dummyWndProc;
+		dummyClass.lpszClassName = dummyText;
+		RegisterClass(&dummyClass);
+
+		HWND hwnd = CreateWindow(dummyText, dummyText,
+			WS_POPUP | WS_CLIPCHILDREN,
+			0, 0, 32, 32, 0, 0, hinst, 0);
+
+		// if a simple CreateWindow fails, then boy are we in trouble...
+		if (hwnd == NULL)
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "CreateWindow() failed", "Win32GLSupport::initializeWGL");
+
+
+		// no chance of failure and no need to release thanks to CS_OWNDC
+		HDC hdc = GetDC(hwnd); 
+
+		// assign a simple OpenGL pixel format that everyone supports
+		PIXELFORMATDESCRIPTOR pfd;
+		memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
+		pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
+		pfd.nVersion = 1;
+		pfd.cColorBits = 16;
+		pfd.cDepthBits = 15;
+		pfd.dwFlags = PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_DOUBLEBUFFER;
+		pfd.iPixelType = PFD_TYPE_RGBA;
+		
+		// if these fail, wglCreateContext will also quietly fail
+		int format;
+		if ((format = ChoosePixelFormat(hdc, &pfd)) != 0)
+			SetPixelFormat(hdc, format, &pfd);
+
+		HGLRC hrc = wglCreateContext(hdc);
+		if (hrc)
+		{
+			HGLRC oldrc = wglGetCurrentContext();
+			HDC oldhdc = wglGetCurrentDC();
+			// if wglMakeCurrent fails, wglGetProcAddress will return null
+			wglMakeCurrent(hdc, hrc);
+			
+			PFNWGLGETEXTENSIONSSTRINGARBPROC _wglGetExtensionsStringARB =
+				(PFNWGLGETEXTENSIONSSTRINGARBPROC)
+				wglGetProcAddress("wglGetExtensionsStringARB");
+			
+			// check for pixel format and multisampling support
+			if (_wglGetExtensionsStringARB)
+			{
+				std::istringstream wglexts(_wglGetExtensionsStringARB(hdc));
+				std::string ext;
+				while (wglexts >> ext)
+				{
+					if (ext == "WGL_ARB_pixel_format")
+						mHasPixelFormatARB = true;
+					else if (ext == "WGL_ARB_multisample")
+						mHasMultisample = true;
+				}
+			}
+
+			if (mHasPixelFormatARB && mHasMultisample)
+			{
+				// enumerate all formats w/ multisampling
+				static const int iattr[] = {
+					WGL_DRAW_TO_WINDOW_ARB, GL_TRUE,
+					WGL_SUPPORT_OPENGL_ARB, GL_TRUE,
+					WGL_DOUBLE_BUFFER_ARB, GL_TRUE,
+					WGL_SAMPLE_BUFFERS_ARB, GL_TRUE,
+					WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB,
+                    /* We are no matter about the colour, depth and stencil buffers here
+					WGL_COLOR_BITS_ARB, 24,
+					WGL_ALPHA_BITS_ARB, 8,
+					WGL_DEPTH_BITS_ARB, 24,
+					WGL_STENCIL_BITS_ARB, 8,
+                    */
+					WGL_SAMPLES_ARB, 2,
+					0
+				};
+				int formats[256];
+				unsigned int count;
+                // cheating here.  wglChoosePixelFormatARB procc address needed later on
+                // when a valid GL context does not exist and glew is not initialized yet.
+                __wglewChoosePixelFormatARB =
+                    (PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB");
+                if (__wglewChoosePixelFormatARB(hdc, iattr, 0, 256, formats, &count))
+                {
+                    // determine what multisampling levels are offered
+                    int query = WGL_SAMPLES_ARB, samples;
+                    for (unsigned int i = 0; i < count; ++i)
+                    {
+                        PFNWGLGETPIXELFORMATATTRIBIVARBPROC _wglGetPixelFormatAttribivARB =
+                            (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)
+                            wglGetProcAddress("wglGetPixelFormatAttribivARB");
+                        if (_wglGetPixelFormatAttribivARB(hdc, formats[i], 0, 1, &query, &samples))
+                        {
+                            mFSAALevels.push_back(samples);
+                        }
+                    }
+                    remove_duplicates(mFSAALevels);
+                }
+			}
+			
+			wglMakeCurrent(oldhdc, oldrc);
+			wglDeleteContext(hrc);
+		}
+
+		// clean up our dummy window and class
+		DestroyWindow(hwnd);
+		UnregisterClass(dummyText, hinst);
+	}
+
+	LRESULT Win32GLSupport::dummyWndProc(HWND hwnd, UINT umsg, WPARAM wp, LPARAM lp)
+	{
+		return DefWindowProc(hwnd, umsg, wp, lp);
+	}
+
+	bool Win32GLSupport::selectPixelFormat(HDC hdc, int colourDepth, int multisample)
+	{
+		PIXELFORMATDESCRIPTOR pfd;
+		memset(&pfd, 0, sizeof(pfd));
+		pfd.nSize = sizeof(pfd);
+		pfd.nVersion = 1;
+		pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
+		pfd.iPixelType = PFD_TYPE_RGBA;
+		pfd.cColorBits = (colourDepth > 16)? 24 : colourDepth;
+		pfd.cAlphaBits = (colourDepth > 16)? 8 : 0;
+		pfd.cDepthBits = 24;
+		pfd.cStencilBits = 8;
+
+		int format = 0;
+
+		if (multisample)
+		{
+			// only available with driver support
+			if (!mHasMultisample || !mHasPixelFormatARB)
+				return false;
+			
+			int iattr[] = {
+				WGL_DRAW_TO_WINDOW_ARB, GL_TRUE,
+				WGL_SUPPORT_OPENGL_ARB, GL_TRUE,
+				WGL_DOUBLE_BUFFER_ARB, GL_TRUE,
+				WGL_SAMPLE_BUFFERS_ARB, GL_TRUE,
+				WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB,
+				WGL_COLOR_BITS_ARB, pfd.cColorBits,
+				WGL_ALPHA_BITS_ARB, pfd.cAlphaBits,
+				WGL_DEPTH_BITS_ARB, 24,
+				WGL_STENCIL_BITS_ARB, 8,
+				WGL_SAMPLES_ARB, multisample,
+				0
+			};
+
+			UINT nformats;
+            assert(__wglewChoosePixelFormatARB && "failed to get proc address for ChoosePixelFormatARB");
+            // ChoosePixelFormatARB proc address was obtained when setting up a dummy GL context in initialiseWGL()
+            // since glew hasn't been initialized yet, we have to cheat and use the previously obtained address
+			if (!__wglewChoosePixelFormatARB(hdc, iattr, NULL, 1, &format, &nformats) || nformats <= 0)
+                return false;
+		}
+		else
+		{
+			format = ChoosePixelFormat(hdc, &pfd);
+		}
+
+		return (format != 0 && SetPixelFormat(hdc, format, &pfd));
+	}
+
+	bool Win32GLSupport::supportsPBuffers()
+	{
+		return __WGLEW_ARB_pbuffer != GL_FALSE;
+	}
+    GLPBuffer *Win32GLSupport::createPBuffer(PixelComponentType format, size_t width, size_t height)
+	{
+		return new Win32PBuffer(format, width, height);
+	}
+}
Index: /RenderSystems/GL/src/OgreWin32RenderTexture.cpp
===================================================================
--- /RenderSystems/GL/src/OgreWin32RenderTexture.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreWin32RenderTexture.cpp	(revision 5)
@@ -0,0 +1,226 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreRoot.h"
+#include "OgreLogManager.h"
+#include "OgreRenderSystem.h"
+#include "OgreImageCodec.h"
+#include "OgreException.h"
+#include "OgreStringConverter.h"
+#include "OgreWin32RenderTexture.h"
+#include "OgreWin32GLSupport.h"
+#include "OgreWin32Context.h"
+
+namespace Ogre {
+
+	 Win32PBuffer::Win32PBuffer(PixelComponentType format, size_t width, size_t height):
+		GLPBuffer(format, width, height),
+        mContext(0)
+	{
+		createPBuffer();
+
+        // Create context
+        mContext = new Win32Context(mHDC, mGlrc);
+#if 0
+		if(mUseBind)
+		{
+			// Bind texture
+			glBindTexture(GL_TEXTURE_2D, static_cast<GLTexture*>(mTexture.get())->getGLID());
+			wglBindTexImageARB(mPBuffer, WGL_FRONT_LEFT_ARB);
+		}
+#endif
+	}
+	 Win32PBuffer::~Win32PBuffer() 
+	{
+#if 0
+		if(mUseBind)
+		{
+			// Unbind texture
+			glBindTexture(GL_TEXTURE_2D,
+				static_cast<GLTexture*>(mTexture.get())->getGLID());
+			glBindTexture(GL_TEXTURE_2D,
+				static_cast<GLTexture*>(mTexture.get())->getGLID());
+			wglReleaseTexImageARB(mPBuffer, WGL_FRONT_LEFT_ARB);
+		}
+#endif
+        // Unregister and destroy mContext
+        delete mContext;        
+           
+		// Destroy pbuffer
+		destroyPBuffer();
+	}
+	
+	void Win32PBuffer::createPBuffer() 
+	{
+
+        // Process format
+        int bits=0;
+        bool isFloat=false;
+#if 0
+		bool hasAlpha=true;
+#endif
+        switch(mFormat)
+        {
+            case PCT_BYTE:
+                bits=8; isFloat=false;
+                break;
+            case PCT_SHORT:
+                bits=16; isFloat=false;
+                break;
+            case PCT_FLOAT16:
+                bits=16; isFloat=true;
+                break;
+            case PCT_FLOAT32:
+                bits=32; isFloat=true;
+                break;
+            default: break;
+        };
+		LogManager::getSingleton().logMessage(
+			" Win32PBuffer::Creating PBuffer of format bits="+
+			StringConverter::toString(bits)+
+			" float="+StringConverter::toString(isFloat)
+	    );
+
+
+		HDC old_hdc = wglGetCurrentDC();
+		HGLRC old_context = wglGetCurrentContext();
+
+		// Bind to RGB or RGBA texture
+		int bttype = 0;
+#if 0
+		if(mUseBind)
+		{
+			// Only provide bind type when actually binding
+			bttype = PixelUtil::hasAlpha(mInternalFormat)?
+				WGL_BIND_TO_TEXTURE_RGBA_ARB : WGL_BIND_TO_TEXTURE_RGB_ARB;
+		}
+		int texformat = hasAlpha?
+			WGL_TEXTURE_RGBA_ARB : WGL_TEXTURE_RGB_ARB;
+#endif
+		// Make a float buffer?
+        int pixeltype = isFloat?
+			WGL_TYPE_RGBA_FLOAT_ARB: WGL_TYPE_RGBA_ARB;
+		
+		int attrib[] = {
+			WGL_RED_BITS_ARB,bits,
+			WGL_GREEN_BITS_ARB,bits,
+			WGL_BLUE_BITS_ARB,bits,
+			WGL_ALPHA_BITS_ARB,bits,
+			WGL_STENCIL_BITS_ARB,1,
+			WGL_DEPTH_BITS_ARB,15,
+			WGL_DRAW_TO_PBUFFER_ARB,true,
+			WGL_SUPPORT_OPENGL_ARB,true,
+			WGL_PIXEL_TYPE_ARB,pixeltype,
+			//WGL_DOUBLE_BUFFER_ARB,true,
+			//WGL_ACCELERATION_ARB,WGL_FULL_ACCELERATION_ARB, // Make sure it is accelerated
+			bttype,true, // must be last, as bttype can be zero
+			0
+		};
+		int pattrib_default[] = { 
+			0
+		};
+#if 0
+		int pattrib_bind[] = { 
+			WGL_TEXTURE_FORMAT_ARB, texformat, 
+			WGL_TEXTURE_TARGET_ARB, WGL_TEXTURE_2D_ARB,
+			WGL_PBUFFER_LARGEST_ARB, true,
+			0 
+		};
+#endif
+		int format;
+		unsigned int count;
+
+		// Choose suitable pixel format
+		wglChoosePixelFormatARB(old_hdc,attrib,NULL,1,&format,&count);
+		if(count == 0)
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "wglChoosePixelFormatARB() failed", " Win32PBuffer::createPBuffer");
+
+		// Analyse pixel format
+		const int piAttributes[]={
+				WGL_RED_BITS_ARB,WGL_GREEN_BITS_ARB,WGL_BLUE_BITS_ARB,WGL_ALPHA_BITS_ARB,
+				WGL_DEPTH_BITS_ARB,WGL_STENCIL_BITS_ARB
+		};
+		int piValues[sizeof(piAttributes)/sizeof(const int)];
+		wglGetPixelFormatAttribivARB(old_hdc,format,0,sizeof(piAttributes)/sizeof(const int),piAttributes,piValues);
+
+        StringUtil::StrStreamType str;
+        str << " Win32PBuffer::PBuffer -- Chosen pixel format rgba="
+            << piValues[0] << ","  
+            << piValues[1] << ","  
+            << piValues[2] << ","  
+            << piValues[3] 
+            << " depth=" << piValues[4]
+            << " stencil=" << piValues[5];
+		LogManager::getSingleton().logMessage(
+			LML_NORMAL, str.str());
+
+		mPBuffer = wglCreatePbufferARB(old_hdc,format,mWidth,mHeight,pattrib_default);
+		if(!mPBuffer)
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "wglCreatePbufferARB() failed", " Win32PBuffer::createPBuffer");
+
+		mHDC = wglGetPbufferDCARB(mPBuffer);
+		if(!mHDC) {
+			wglDestroyPbufferARB(mPBuffer);
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "wglGetPbufferDCARB() failed", " Win32PBuffer::createPBuffer");
+		}
+			
+		mGlrc = wglCreateContext(mHDC);
+		if(!mGlrc) {
+			wglReleasePbufferDCARB(mPBuffer,mHDC);
+			wglDestroyPbufferARB(mPBuffer);
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "wglCreateContext() failed", " Win32PBuffer::createPBuffer");
+		}
+
+		if(!wglShareLists(old_context,mGlrc)) {
+			wglDeleteContext(mGlrc);
+			wglReleasePbufferDCARB(mPBuffer,mHDC);
+			wglDestroyPbufferARB(mPBuffer);
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "wglShareLists() failed", " Win32PBuffer::createPBuffer");
+		}
+				
+		// Query real width and height
+		int iWidth, iHeight;
+		wglQueryPbufferARB(mPBuffer, WGL_PBUFFER_WIDTH_ARB, &iWidth);
+		wglQueryPbufferARB(mPBuffer, WGL_PBUFFER_HEIGHT_ARB, &iHeight);
+		mWidth = iWidth;  
+		mHeight = iHeight;
+		str.str(StringUtil::BLANK);
+        str << "Win32RenderTexture::PBuffer created -- Real dimensions "
+            << mWidth << "x" << mHeight;
+		LogManager::getSingleton().logMessage(LML_NORMAL, str.str());
+	}
+	void Win32PBuffer::destroyPBuffer() 
+	{
+		wglDeleteContext(mGlrc);
+		wglReleasePbufferDCARB(mPBuffer,mHDC);
+		wglDestroyPbufferARB(mPBuffer);
+	}
+
+
+}
Index: /RenderSystems/GL/src/OgreWin32Window.cpp
===================================================================
--- /RenderSystems/GL/src/OgreWin32Window.cpp	(revision 5)
+++ /RenderSystems/GL/src/OgreWin32Window.cpp	(revision 5)
@@ -0,0 +1,605 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreWin32Window.h"
+#include "OgreRoot.h"
+#include "OgreLogManager.h"
+#include "OgreRenderSystem.h"
+#include "OgreImageCodec.h"
+#include "OgreStringConverter.h"
+#include "OgreException.h"
+#include "OgreWin32GLSupport.h"
+#include "OgreWin32Context.h"
+#include "OgreWindowEventUtilities.h"
+
+namespace Ogre {
+
+	Win32Window::Win32Window(Win32GLSupport &glsupport):
+		mGLSupport(glsupport),
+		mContext(0)
+	{
+		mIsFullScreen = false;
+		mHWnd = 0;
+		mGlrc = 0;
+		mIsExternal = false;
+		mIsExternalGLControl = false;
+		mIsExternalGLContext = false;
+		mSizing = false;
+		mClosed = false;
+		mDisplayFrequency = 0;
+		mActive = false;
+	}
+
+	Win32Window::~Win32Window()
+	{
+		destroy();
+	}
+
+	void Win32Window::create(const String& name, unsigned int width, unsigned int height,
+							bool fullScreen, const NameValuePairList *miscParams)
+	{
+		// destroy current window, if any
+		if (mHWnd)
+			destroy();
+
+#ifdef OGRE_STATIC_LIB
+		HINSTANCE hInst = GetModuleHandle( NULL );
+#else
+		HINSTANCE hInst = GetModuleHandle("RenderSystem_GL.dll");
+#endif
+
+		mHWnd = 0;
+		mName = name;
+		mIsFullScreen = fullScreen;
+		mClosed = false;
+
+		// load window defaults
+		mLeft = mTop = -1; // centered
+		mWidth = width;
+		mHeight = height;
+		mDisplayFrequency = 0;
+		mIsDepthBuffered = true;
+		mColourDepth = mIsFullScreen? 32 : GetDeviceCaps(GetDC(0), BITSPIXEL);
+
+		HWND parent = 0;
+		String title = name;
+		bool vsync = false;
+		int fsaa = 0;
+		String border;
+		bool outerSize = false;
+
+		if(miscParams)
+		{
+			// Get variable-length params
+			NameValuePairList::const_iterator opt;
+			NameValuePairList::const_iterator end = miscParams->end();
+
+			if ((opt = miscParams->find("title")) != end)
+				title = opt->second;
+
+			if ((opt = miscParams->find("left")) != end)
+				mLeft = StringConverter::parseInt(opt->second);
+
+			if ((opt = miscParams->find("top")) != end)
+				mTop = StringConverter::parseInt(opt->second);
+
+			if ((opt = miscParams->find("depthBuffer")) != end)
+				mIsDepthBuffered = StringConverter::parseBool(opt->second);
+
+			if ((opt = miscParams->find("vsync")) != end)
+				vsync = StringConverter::parseBool(opt->second);
+
+			if ((opt = miscParams->find("FSAA")) != end)
+				fsaa = StringConverter::parseUnsignedInt(opt->second);
+
+			if ((opt = miscParams->find("externalWindowHandle")) != end)
+			{
+				mHWnd = (HWND)StringConverter::parseUnsignedInt(opt->second);
+				if (mHWnd)
+				{
+					mIsExternal = true;
+					mIsFullScreen = false;
+				}
+
+				if ((opt = miscParams->find("externalGLControl")) != end) {
+				  mIsExternalGLControl = StringConverter::parseBool(opt->second);
+				}
+			}
+			if ((opt = miscParams->find("externalGLContext")) != end)
+			{
+				mGlrc = (HGLRC)StringConverter::parseUnsignedLong(opt->second);
+				if( mGlrc )
+					mIsExternalGLContext = true;
+			}
+
+			// window border style
+			opt = miscParams->find("border");
+			if(opt != miscParams->end())
+				border = opt->second;
+			// set outer dimensions?
+			opt = miscParams->find("outerDimensions");
+			if(opt != miscParams->end())
+				outerSize = StringConverter::parseBool(opt->second);
+
+			// only available with fullscreen
+			if ((opt = miscParams->find("displayFrequency")) != end)
+				mDisplayFrequency = StringConverter::parseUnsignedInt(opt->second);
+			if ((opt = miscParams->find("colourDepth")) != end)
+				mColourDepth = StringConverter::parseUnsignedInt(opt->second);
+
+			// incompatible with fullscreen
+			if ((opt = miscParams->find("parentWindowHandle")) != end)
+				parent = (HWND)StringConverter::parseUnsignedInt(opt->second);
+		}
+
+		if (!mIsExternal)
+		{
+			DWORD dwStyle = WS_VISIBLE | WS_CLIPCHILDREN;
+			DWORD dwStyleEx = 0;
+			int outerw, outerh;
+
+			if (mIsFullScreen)
+			{
+				dwStyle |= WS_POPUP;
+				dwStyleEx |= WS_EX_TOPMOST;
+				outerw = mWidth;
+				outerh = mHeight;
+				mLeft = mTop = 0;
+			}
+			else
+			{
+				if (parent)
+				{
+					dwStyle |= WS_CHILD;
+				}
+				else
+				{
+					if (border == "none")
+						dwStyle |= WS_POPUP;
+					else if (border == "fixed")
+						dwStyle |= WS_OVERLAPPED | WS_BORDER | WS_CAPTION |
+						WS_SYSMENU | WS_MINIMIZEBOX;
+					else
+						dwStyle |= WS_OVERLAPPEDWINDOW;
+				}
+
+				int screenw = GetSystemMetrics(SM_CXSCREEN);
+				int screenh = GetSystemMetrics(SM_CYSCREEN);
+
+				if (!outerSize)
+				{
+					// calculate overall dimensions for requested client area
+					RECT rc = { 0, 0, mWidth, mHeight };
+					AdjustWindowRect(&rc, dwStyle, false);
+
+					// clamp window dimensions to screen size
+					outerw = (rc.right-rc.left < screenw)? rc.right-rc.left : screenw;
+					outerh = (rc.bottom-rc.top < screenh)? rc.bottom-rc.top : screenh;
+				}
+
+				// center window if given negative coordinates
+				if (mLeft < 0)
+					mLeft = (screenw - outerw) / 2;
+				if (mTop < 0)
+					mTop = (screenh - outerh) / 2;
+
+				// keep window contained in visible screen area
+				if (mLeft > screenw - outerw)
+					mLeft = screenw - outerw;
+				if (mTop > screenh - outerh)
+					mTop = screenh - outerh;
+			}
+
+			// register class and create window
+			WNDCLASS wc = { CS_OWNDC, WindowEventUtilities::_WndProc, 0, 0, hInst,
+				LoadIcon(NULL, IDI_APPLICATION), LoadCursor(NULL, IDC_ARROW),
+				(HBRUSH)GetStockObject(BLACK_BRUSH), NULL, "OgreGLWindow" };
+			RegisterClass(&wc);
+
+			// Pass pointer to self as WM_CREATE parameter
+			mHWnd = CreateWindowEx(dwStyleEx, "OgreGLWindow", title.c_str(),
+				dwStyle, mLeft, mTop, outerw, outerh, parent, 0, hInst, this);
+
+			WindowEventUtilities::_addRenderWindow(this);
+
+			StringUtil::StrStreamType str;
+			str << "Created Win32Window '"
+				<< mName << "' : " << mWidth << "x" << mHeight
+				<< ", " << mColourDepth << "bpp";
+			LogManager::getSingleton().logMessage(LML_NORMAL, str.str());
+
+			if (mIsFullScreen)
+			{
+				DEVMODE dm;
+				dm.dmSize = sizeof(DEVMODE);
+				dm.dmBitsPerPel = mColourDepth;
+				dm.dmPelsWidth = mWidth;
+				dm.dmPelsHeight = mHeight;
+				dm.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
+				if (mDisplayFrequency)
+				{
+					dm.dmDisplayFrequency = mDisplayFrequency;
+					dm.dmFields |= DM_DISPLAYFREQUENCY;
+					if (ChangeDisplaySettings(&dm, CDS_FULLSCREEN | CDS_TEST) != DISP_CHANGE_SUCCESSFUL)
+					{
+						LogManager::getSingleton().logMessage(LML_NORMAL, "ChangeDisplaySettings with user display frequency failed");
+						dm.dmFields ^= DM_DISPLAYFREQUENCY;
+					}
+				}
+				if (ChangeDisplaySettings(&dm, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
+					LogManager::getSingleton().logMessage(LML_CRITICAL, "ChangeDisplaySettings failed");
+			}
+		}
+
+		HDC old_hdc = wglGetCurrentDC();
+		HGLRC old_context = wglGetCurrentContext();
+
+		RECT rc;
+		// top and left represent outer window position
+		GetWindowRect(mHWnd, &rc);
+		mTop = rc.top;
+		mLeft = rc.left;
+		// width and height represent drawable area only
+		GetClientRect(mHWnd, &rc);
+		mWidth = rc.right;
+		mHeight = rc.bottom;
+
+		mHDC = GetDC(mHWnd);
+
+		if (!mIsExternalGLControl)
+		{
+			if (!mGLSupport.selectPixelFormat(mHDC, mColourDepth, fsaa))
+			{
+				if (fsaa == 0)
+					OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "selectPixelFormat failed", "Win32Window::create");
+
+				LogManager::getSingleton().logMessage(LML_NORMAL, "FSAA level not supported, falling back");
+				if (!mGLSupport.selectPixelFormat(mHDC, mColourDepth, 0))
+					OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "selectPixelFormat failed", "Win32Window::create");
+			}
+		}
+		if (!mIsExternalGLContext)
+		{
+			mGlrc = wglCreateContext(mHDC);
+			if (!mGlrc)
+				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "wglCreateContext", "Win32Window::create");
+		}
+		if (!wglMakeCurrent(mHDC, mGlrc))
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "wglMakeCurrent", "Win32Window::create");
+
+		// Do not change vsync if the external window has the OpenGL control
+		if (!mIsExternalGLControl) {
+			// Don't use wglew as if this is the first window, we won't have initialised yet
+			PFNWGLSWAPINTERVALEXTPROC _wglSwapIntervalEXT = 
+				(PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT");
+			if (_wglSwapIntervalEXT)
+				_wglSwapIntervalEXT(vsync? 1 : 0);
+		}
+
+        if (old_context && old_context != mGlrc)
+        {
+            // Restore old context
+		    if (!wglMakeCurrent(old_hdc, old_context))
+			    OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "wglMakeCurrent() failed", "Win32Window::create");
+
+            // Share lists with old context
+		    if (!wglShareLists(old_context, mGlrc))
+			    OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "wglShareLists() failed", " Win32Window::create");
+        }
+
+		// Create RenderSystem context
+		mContext = new Win32Context(mHDC, mGlrc);
+
+		mActive = true;
+	}
+
+	void Win32Window::setFullscreen(bool fullScreen, unsigned int width, unsigned int height)
+	{
+		if (mIsFullScreen != fullScreen || width != mWidth || height != mHeight)
+		{
+			mIsFullScreen = fullScreen;
+			DWORD dwStyle = WS_VISIBLE | WS_CLIPCHILDREN;
+
+			if (mIsFullScreen)
+			{
+				dwStyle |= WS_POPUP;
+
+				DEVMODE dm;
+				dm.dmSize = sizeof(DEVMODE);
+				dm.dmBitsPerPel = mColourDepth;
+				dm.dmPelsWidth = width;
+				dm.dmPelsHeight = height;
+				dm.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
+				if (mDisplayFrequency)
+				{
+					dm.dmDisplayFrequency = mDisplayFrequency;
+					dm.dmFields |= DM_DISPLAYFREQUENCY;
+					if (ChangeDisplaySettings(&dm, CDS_FULLSCREEN | CDS_TEST) != DISP_CHANGE_SUCCESSFUL)
+					{
+						LogManager::getSingleton().logMessage(LML_NORMAL, "ChangeDisplaySettings with user display frequency failed");
+						dm.dmFields ^= DM_DISPLAYFREQUENCY;
+					}
+				}
+				else
+				{
+					// try a few
+					dm.dmDisplayFrequency = 100;
+					dm.dmFields |= DM_DISPLAYFREQUENCY;
+					if (ChangeDisplaySettings(&dm, CDS_FULLSCREEN | CDS_TEST) != DISP_CHANGE_SUCCESSFUL)
+					{
+						dm.dmDisplayFrequency = 75;
+						if (ChangeDisplaySettings(&dm, CDS_FULLSCREEN | CDS_TEST) != DISP_CHANGE_SUCCESSFUL)
+						{
+							dm.dmFields ^= DM_DISPLAYFREQUENCY;
+						}
+					}
+
+				}
+				if (ChangeDisplaySettings(&dm, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
+					LogManager::getSingleton().logMessage(LML_CRITICAL, "ChangeDisplaySettings failed");
+
+				SetWindowLong(mHWnd, GWL_STYLE, dwStyle);
+				SetWindowPos(mHWnd, HWND_TOPMOST, 0, 0, width, height,
+					SWP_NOACTIVATE);
+				mWidth = width;
+				mHeight = height;
+
+
+			}
+			else
+			{
+				dwStyle |= WS_OVERLAPPEDWINDOW;
+
+				// drop out of fullscreen
+				ChangeDisplaySettings(NULL, 0);
+
+				// calculate overall dimensions for requested client area
+				RECT rc = { 0, 0, width, height };
+				AdjustWindowRect(&rc, dwStyle, false);
+				unsigned int winWidth = rc.right - rc.left;
+				unsigned int winHeight = rc.bottom - rc.top;
+
+				int screenw = GetSystemMetrics(SM_CXSCREEN);
+				int screenh = GetSystemMetrics(SM_CYSCREEN);
+				int left = (screenw - winWidth) / 2;
+				int top = (screenh - winHeight) / 2;
+
+
+				SetWindowLong(mHWnd, GWL_STYLE, dwStyle);
+				SetWindowPos(mHWnd, HWND_NOTOPMOST, left, top, winWidth, winHeight,
+					SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOACTIVATE);
+				mWidth = width;
+				mHeight = height;
+
+			}
+
+		}
+	}
+
+	void Win32Window::destroy(void)
+	{
+		if (!mHWnd)
+			return;
+
+		// Unregister and destroy OGRE GLContext
+		delete mContext;
+
+		if (!mIsExternalGLContext && mGlrc)
+		{
+			wglDeleteContext(mGlrc);
+			mGlrc = 0;
+		}
+		if (!mIsExternal)
+		{
+			WindowEventUtilities::_removeRenderWindow(this);
+
+			if (mIsFullScreen)
+				ChangeDisplaySettings(NULL, 0);
+			DestroyWindow(mHWnd);
+		}
+		else
+		{
+			// just release the DC
+			ReleaseDC(mHWnd, mHDC);
+		}
+
+		mActive = false;
+		mClosed = true;
+		mHDC = 0; // no release thanks to CS_OWNDC wndclass style
+		mHWnd = 0;
+	}
+
+	bool Win32Window::isVisible() const
+	{
+		return (mHWnd && !IsIconic(mHWnd));
+	}
+
+	bool Win32Window::isClosed() const
+	{
+		return mClosed;
+	}
+
+	void Win32Window::reposition(int left, int top)
+	{
+		if (mHWnd && !mIsFullScreen)
+		{
+			SetWindowPos(mHWnd, 0, left, top, 0, 0,
+				SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
+		}
+	}
+
+	void Win32Window::resize(unsigned int width, unsigned int height)
+	{
+		if (mHWnd && !mIsFullScreen)
+		{
+			RECT rc = { 0, 0, width, height };
+			AdjustWindowRect(&rc, GetWindowLong(mHWnd, GWL_STYLE), false);
+			width = rc.right - rc.left;
+			height = rc.bottom - rc.top;
+			SetWindowPos(mHWnd, 0, 0, 0, width, height,
+				SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
+		}
+	}
+
+	void Win32Window::windowMovedOrResized()
+	{
+		if (!isVisible())
+			return;
+
+		RECT rc;
+		// top and left represent outer window position
+		GetWindowRect(mHWnd, &rc);
+		mTop = rc.top;
+		mLeft = rc.left;
+		// width and height represent drawable area only
+		GetClientRect(mHWnd, &rc);
+
+		if (mWidth == rc.right && mHeight == rc.bottom)
+			return;
+
+		mWidth = rc.right;
+		mHeight = rc.bottom;
+
+		// Notify viewports of resize
+		ViewportList::iterator it, itend;
+		itend = mViewportList.end();
+		for( it = mViewportList.begin(); it != itend; ++it )
+			(*it).second->_updateDimensions();
+	}
+
+	void Win32Window::swapBuffers(bool waitForVSync)
+	{
+	  if (!mIsExternalGLControl) {
+	  	SwapBuffers(mHDC);
+	  }
+	}
+
+	void Win32Window::writeContentsToFile(const String& filename)
+	{
+		ImageCodec::ImageData *imgData = new ImageCodec::ImageData();
+		imgData->width = mWidth;
+		imgData->height = mHeight;
+		imgData->depth = 1;
+		imgData->format = PF_BYTE_RGB;
+
+		// Allocate buffer 
+		uchar* pBuffer = new uchar[mWidth * mHeight * 3];
+
+		// Switch context if different from current one
+		RenderSystem* rsys = Root::getSingleton().getRenderSystem();
+		rsys->_setViewport(this->getViewport(0));
+
+		// Must change the packing to ensure no overruns!
+		glPixelStorei(GL_PACK_ALIGNMENT, 1);
+
+		// Read pixels
+		// I love GL: it does all the locking & colour conversion for us
+		if (mIsFullScreen)
+			glReadBuffer(GL_FRONT);
+		glReadPixels(0,0, mWidth, mHeight, GL_RGB, GL_UNSIGNED_BYTE, pBuffer);
+
+		// restore default alignment
+		glPixelStorei(GL_PACK_ALIGNMENT, 4);
+
+		// Wrap buffer in a memory stream
+		DataStreamPtr stream(new MemoryDataStream(pBuffer, mWidth * mHeight * 3, false));
+
+		// Need to flip the read data over in Y though
+		Image img;
+		img.loadRawData(stream, mWidth, mHeight, imgData->format );
+		img.flipAroundX();
+
+		MemoryDataStreamPtr streamFlipped(new MemoryDataStream(img.getData(), stream->size(), false));
+
+		// Get codec 
+		size_t pos = filename.find_last_of(".");
+		String extension;
+		if( pos == String::npos )
+			OGRE_EXCEPT(
+			Exception::ERR_INVALIDPARAMS, 
+			"Unable to determine image type for '" + filename + "' - invalid extension.",
+			"Win32Window::writeContentsToFile" );
+
+		while( pos != filename.length() - 1 )
+			extension += filename[++pos];
+
+		// Get the codec
+		Codec * pCodec = Codec::getCodec(extension);
+
+		// Write out
+		Codec::CodecDataPtr ptr(imgData);
+		pCodec->codeToFile(streamFlipped, filename, ptr);
+
+		delete [] pBuffer;
+	}
+
+	void Win32Window::getCustomAttribute( const String& name, void* pData )
+	{
+		if( name == "GLCONTEXT" ) {
+			*static_cast<GLContext**>(pData) = mContext;
+			return;
+		} else if( name == "WINDOW" )
+		{
+			HWND *pHwnd = (HWND*)pData;
+			*pHwnd = getWindowHandle();
+			return;
+		} 
+	}
+
+	void Win32Window::setActive( bool state )
+	{
+		mActive = state;
+
+		if( mIsFullScreen )
+		{
+			if( state == false )
+			{	//Restore Desktop
+				ChangeDisplaySettings(NULL, 0);
+				ShowWindow(mHWnd, SW_SHOWMINNOACTIVE);
+			}
+			else
+			{	//Restore App
+				ShowWindow(mHWnd, SW_SHOWNORMAL);
+
+				DEVMODE dm;
+				dm.dmSize = sizeof(DEVMODE);
+				dm.dmBitsPerPel = mColourDepth;
+				dm.dmPelsWidth = mWidth;
+				dm.dmPelsHeight = mHeight;
+				dm.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
+				if (mDisplayFrequency)
+				{
+					dm.dmDisplayFrequency = mDisplayFrequency;
+					dm.dmFields |= DM_DISPLAYFREQUENCY;
+				}
+				ChangeDisplaySettings(&dm, CDS_FULLSCREEN);
+			}
+		}
+	}
+}
Index: /RenderSystems/GL/src/SDL/Makefile.am
===================================================================
--- /RenderSystems/GL/src/SDL/Makefile.am	(revision 5)
+++ /RenderSystems/GL/src/SDL/Makefile.am	(revision 5)
@@ -0,0 +1,7 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/RenderSystems/GL/include \
+           -I$(top_srcdir)/OgreMain/include $(GLSUPPORT_CFLAGS) \
+           -I$(top_srcdir)/PlatformManagers/$(OGRE_PLATFORM)/include 
+
+noinst_LTLIBRARIES = libsupport.la
+
+libsupport_la_SOURCES = OgreSDLGLSupport.cpp OgreSDLWindow.cpp
Index: /RenderSystems/GL/src/SDL/OgreGLUtil.h
===================================================================
--- /RenderSystems/GL/src/SDL/OgreGLUtil.h	(revision 5)
+++ /RenderSystems/GL/src/SDL/OgreGLUtil.h	(revision 5)
@@ -0,0 +1,40 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://ogre.sourgeforge.net/
+
+Copyright © 2000-2003 Steven J. Streeting
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/gpl.html.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef INCL_OGRE_GLUTIL_H
+#define INCL_OGRE_GLUTIL_H
+
+#include "OgreSDLGLSupport.h"
+
+namespace Ogre {
+    
+inline GLSupport* getGLSupport()
+{
+    return new SDLGLSupport();
+}
+
+};
+
+#endif // INCL_OGRE_GLUTIL_H
Index: /RenderSystems/GL/src/SDL/OgreSDLGLSupport.cpp
===================================================================
--- /RenderSystems/GL/src/SDL/OgreSDLGLSupport.cpp	(revision 5)
+++ /RenderSystems/GL/src/SDL/OgreSDLGLSupport.cpp	(revision 5)
@@ -0,0 +1,160 @@
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+
+#include "OgreSDLGLSupport.h"
+
+#include "OgreSDLWindow.h"
+
+using namespace Ogre;
+
+SDLGLSupport::SDLGLSupport()
+{
+
+    SDL_Init(SDL_INIT_VIDEO);
+}
+
+SDLGLSupport::~SDLGLSupport()
+{
+}
+
+void SDLGLSupport::addConfig(void)
+{
+    mVideoModes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_OPENGL);
+    
+    if (mVideoModes == (SDL_Rect **)0)
+    {
+        OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Unable to load video modes",
+                "SDLRenderSystem::initConfigOptions");
+    }
+
+    ConfigOption optFullScreen;
+    ConfigOption optVideoMode;
+    ConfigOption optFSAA;
+	ConfigOption optRTTMode;
+
+    // FS setting possiblities
+    optFullScreen.name = "Full Screen";
+    optFullScreen.possibleValues.push_back("Yes");
+    optFullScreen.possibleValues.push_back("No");
+    optFullScreen.currentValue = "Yes";
+    optFullScreen.immutable = false;
+
+    // Video mode possiblities
+    optVideoMode.name = "Video Mode";
+    optVideoMode.immutable = false;
+    for (size_t i = 0; mVideoModes[i]; i++)
+    {
+        char szBuf[16];
+		snprintf(szBuf, 16, "%d x %d", mVideoModes[i]->w, mVideoModes[i]->h);
+        optVideoMode.possibleValues.push_back(szBuf);
+        // Make the first one default
+        if (i == 0)
+        {
+            optVideoMode.currentValue = szBuf;
+        }
+    }
+    
+    //FSAA possibilities
+    optFSAA.name = "FSAA";
+    optFSAA.possibleValues.push_back("0");
+    optFSAA.possibleValues.push_back("2");
+    optFSAA.possibleValues.push_back("4");
+    optFSAA.possibleValues.push_back("6");
+    optFSAA.currentValue = "0";
+    optFSAA.immutable = false;
+
+	optRTTMode.name = "RTT Preferred Mode";
+	optRTTMode.possibleValues.push_back("FBO");
+	optRTTMode.possibleValues.push_back("PBuffer");
+	optRTTMode.possibleValues.push_back("Copy");
+	optRTTMode.currentValue = "FBO";
+	optRTTMode.immutable = false;
+
+
+    mOptions[optFullScreen.name] = optFullScreen;
+    mOptions[optVideoMode.name] = optVideoMode;
+    mOptions[optFSAA.name] = optFSAA;
+	mOptions[optRTTMode.name] = optRTTMode;
+
+}
+
+String SDLGLSupport::validateConfig(void)
+{
+    return String("");
+}
+
+RenderWindow* SDLGLSupport::createWindow(bool autoCreateWindow, GLRenderSystem* renderSystem, const String& windowTitle)
+{
+	if (autoCreateWindow)
+    {
+        ConfigOptionMap::iterator opt = mOptions.find("Full Screen");
+        if (opt == mOptions.end())
+            OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't find full screen options!", "SDLGLSupport::createWindow");
+        bool fullscreen = (opt->second.currentValue == "Yes");
+
+        opt = mOptions.find("Video Mode");
+        if (opt == mOptions.end())
+            OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't find video mode options!", "SDLGLSupport::createWindow");
+        String val = opt->second.currentValue;
+        String::size_type pos = val.find('x');
+        if (pos == String::npos)
+            OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Invalid Video Mode provided", "SDLGLSupport::createWindow");
+
+		// Parse FSAA config
+		NameValuePairList winOptions;
+		winOptions["title"] = windowTitle;
+        int fsaa_x_samples = 0;
+        opt = mOptions.find("FSAA");
+        if(opt != mOptions.end())
+        {
+			winOptions["FSAA"] = opt->second.currentValue;
+        }
+
+        unsigned int w = StringConverter::parseUnsignedInt(val.substr(0, pos));
+        unsigned int h = StringConverter::parseUnsignedInt(val.substr(pos + 1));
+
+        const SDL_VideoInfo* videoInfo = SDL_GetVideoInfo();
+        return renderSystem->createRenderWindow(windowTitle, w, h, fullscreen, &winOptions);
+    }
+    else
+    {
+        // XXX What is the else?
+		return NULL;
+    }
+
+}
+
+
+RenderWindow* SDLGLSupport::newWindow(const String &name, unsigned int width, unsigned int height, 
+	bool fullScreen, const NameValuePairList *miscParams)
+{
+	SDLWindow* window = new SDLWindow();
+	window->create(name, width, height, fullScreen, miscParams);
+	return window;
+}
+
+void SDLGLSupport::start()
+{
+    LogManager::getSingleton().logMessage(
+        "******************************\n"
+        "*** Starting SDL Subsystem ***\n"
+        "******************************");
+
+    SDL_Init(SDL_INIT_VIDEO);
+}
+
+void SDLGLSupport::stop()
+{
+    LogManager::getSingleton().logMessage(
+        "******************************\n"
+        "*** Stopping SDL Subsystem ***\n"
+        "******************************");
+
+    SDL_Quit();
+}
+
+void* SDLGLSupport::getProcAddress(const String& procname)
+{
+    return SDL_GL_GetProcAddress(procname.c_str());
+}
Index: /RenderSystems/GL/src/SDL/OgreSDLWindow.cpp
===================================================================
--- /RenderSystems/GL/src/SDL/OgreSDLWindow.cpp	(revision 5)
+++ /RenderSystems/GL/src/SDL/OgreSDLWindow.cpp	(revision 5)
@@ -0,0 +1,254 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreSDLWindow.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreImageCodec.h"
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreStringConverter.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#   include <windows.h>
+#   include <wingdi.h>
+#   include <GL/gl.h>
+#   define GL_GLEXT_PROTOTYPES
+#   include "glprocs.h"
+#   include <GL/glu.h>
+#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
+#   include <GL/gl.h>
+#   include <GL/glu.h>
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#   include <OpenGL/gl.h>
+#   define GL_EXT_texture_env_combine 1
+#   include <OpenGL/glext.h>
+#   include <OpenGL/glu.h>
+#endif
+
+namespace Ogre {
+
+    SDLWindow::SDLWindow() :
+        mScreen(NULL), mActive(false), mClosed(false)
+    {
+    }
+
+    SDLWindow::~SDLWindow()
+    {
+        // according to http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fSetVideoMode
+        // never free the surface returned from SDL_SetVideoMode
+        /*if (mScreen != NULL)
+            SDL_FreeSurface(mScreen);*/
+
+    }
+
+	void SDLWindow::create(const String& name, unsigned int width, unsigned int height,
+	            bool fullScreen, const NameValuePairList *miscParams)
+    {
+		int colourDepth = 32;
+		String title = name;
+		if(miscParams)
+		{
+			// Parse miscellenous parameters
+			NameValuePairList::const_iterator opt;
+			// Bit depth
+			opt = miscParams->find("colourDepth");
+			if(opt != miscParams->end()) //check for FSAA parameter, if not ignore it...
+				colourDepth = StringConverter::parseUnsignedInt(opt->second);
+			// Full screen antialiasing
+			opt = miscParams->find("FSAA");
+			if(opt != miscParams->end()) //check for FSAA parameter, if not ignore it...
+			{
+				size_t fsaa_x_samples = StringConverter::parseUnsignedInt(opt->second);
+				if(fsaa_x_samples>1) {
+					// If FSAA is enabled in the parameters, enable the MULTISAMPLEBUFFERS
+					// and set the number of samples before the render window is created.
+					SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS,1);
+					SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES,fsaa_x_samples);
+				}
+			}
+			// Window title
+			opt = miscParams->find("title");
+			if(opt != miscParams->end()) //check for FSAA parameter, if not ignore it...
+				title = opt->second;
+		}   
+	
+        LogManager::getSingleton().logMessage("SDLWindow::create", LML_TRIVIAL);
+        SDL_Surface* screen;
+        int flags = SDL_OPENGL | SDL_HWPALETTE | SDL_RESIZABLE;
+		
+        SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+        // request good stencil size if 32-bit colour
+        if (colourDepth == 32)
+        {
+            SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 8);
+        }
+		
+        if (fullScreen)
+            flags |= SDL_FULLSCREEN;
+
+        LogManager::getSingleton().logMessage("Create window", LML_TRIVIAL);
+        screen = SDL_SetVideoMode(width, height, colourDepth, flags);
+        if (!screen)
+        {
+            LogManager::getSingleton().logMessage(LML_CRITICAL, 
+                String("Could not make screen: ") + SDL_GetError());
+            exit(1);
+        }
+        LogManager::getSingleton().logMessage("screen is valid", LML_TRIVIAL);
+        mScreen = screen;
+
+        mName = name;
+
+        mWidth = width;
+        mHeight = height;
+
+        mActive = true;
+
+        if (!fullScreen)
+            SDL_WM_SetCaption(title.c_str(), 0);
+
+        glXGetVideoSyncSGI = (int (*)(unsigned int *))SDL_GL_GetProcAddress("glXGetVideoSyncSGI");
+        glXWaitVideoSyncSGI = (int (*)(int, int, unsigned int *))SDL_GL_GetProcAddress("glXWaitVideoSyncSGI");
+    }
+
+    void SDLWindow::destroy(void)
+    {
+        // according to http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fSetVideoMode
+        // never free the surface returned from SDL_SetVideoMode
+        //SDL_FreeSurface(mScreen);
+        mScreen = NULL;
+        mActive = false;
+
+        Root::getSingleton().getRenderSystem()->detachRenderTarget( this->getName() );
+    }
+
+    bool SDLWindow::isActive() const
+    {
+        return mActive;
+    }
+
+    bool SDLWindow::isClosed() const
+    {
+        return mClosed;
+    }
+
+    void SDLWindow::reposition(int left, int top)
+    {
+        // XXX FIXME
+    }
+
+    void SDLWindow::resize(unsigned int width, unsigned int height)
+    {
+        SDL_Surface* screen;
+        int flags = SDL_OPENGL | SDL_HWPALETTE | SDL_RESIZABLE;
+		
+        LogManager::getSingleton().logMessage("Updating window", LML_TRIVIAL);
+        screen = SDL_SetVideoMode(width, height, mScreen->format->BitsPerPixel, flags);
+        if (!screen)
+        {
+            LogManager::getSingleton().logMessage(LML_CRITICAL, 
+                String("Could not make screen: ") + SDL_GetError());
+            exit(1);
+        }
+        LogManager::getSingleton().logMessage("screen is valid", LML_TRIVIAL);
+        mScreen = screen;
+
+
+        mWidth = width;
+        mHeight = height;
+
+        for (ViewportList::iterator it = mViewportList.begin();
+             it != mViewportList.end(); ++it)
+        {
+            (*it).second->_updateDimensions();
+        }
+    }
+
+    void SDLWindow::swapBuffers(bool waitForVSync)
+    {
+        if ( waitForVSync && glXGetVideoSyncSGI && glXWaitVideoSyncSGI )
+        {
+            unsigned int retraceCount;
+            glXGetVideoSyncSGI( &retraceCount );
+            glXWaitVideoSyncSGI( 2, ( retraceCount + 1 ) & 1, &retraceCount);
+        }
+
+        SDL_GL_SwapBuffers();
+        // XXX More?
+    }
+
+	void SDLWindow::writeContentsToFile(const String& filename)
+	{
+		ImageCodec::ImageData* imgData = new ImageCodec::ImageData;
+		imgData->width = mWidth;
+		imgData->height = mHeight;
+		imgData->format = PF_BYTE_RGB;
+
+		// Allocate buffer 
+		uchar* pBuffer = new uchar[mWidth * mHeight * 3];
+
+		// Read pixels
+		// I love GL: it does all the locking & colour conversion for us
+		glReadPixels(0,0, mWidth-1, mHeight-1, GL_RGB, GL_UNSIGNED_BYTE, pBuffer);
+
+		// Wrap buffer in a memory stream
+        DataStreamPtr stream(new MemoryDataStream(pBuffer, mWidth * mHeight * 3, false));
+
+		// Need to flip the read data over in Y though
+		Image img;
+		img.loadRawData(stream, mWidth, mHeight, imgData->format );
+		img.flipAroundX();
+
+        MemoryDataStreamPtr streamFlipped(new MemoryDataStream(img.getData(), stream->size(), false));
+
+		// Get codec 
+		size_t pos = filename.find_last_of(".");
+		String extension;
+		if( pos == String::npos )
+			OGRE_EXCEPT(
+			Exception::ERR_INVALIDPARAMS, 
+			"Unable to determine image type for '" + filename + "' - invalid extension.",
+			"SDLWindow::writeContentsToFile" );
+
+		while( pos != filename.length() - 1 )
+			extension += filename[++pos];
+
+		// Get the codec
+		Codec * pCodec = Codec::getCodec(extension);
+
+		// Write out
+		Codec::CodecDataPtr codecDataPtr(imgData);
+		pCodec->codeToFile(streamFlipped, filename, codecDataPtr);
+
+		delete [] pBuffer;
+
+
+	}
+}
Index: /RenderSystems/GL/src/atifs/Makefile.am
===================================================================
--- /RenderSystems/GL/src/atifs/Makefile.am	(revision 5)
+++ /RenderSystems/GL/src/atifs/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS=include src
Index: /RenderSystems/GL/src/atifs/Makefile.in
===================================================================
--- /RenderSystems/GL/src/atifs/Makefile.in	(revision 5)
+++ /RenderSystems/GL/src/atifs/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = RenderSystems/GL/src/atifs
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = include src
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  RenderSystems/GL/src/atifs/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  RenderSystems/GL/src/atifs/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /RenderSystems/GL/src/atifs/include/ATI_FS_GLGpuProgram.h
===================================================================
--- /RenderSystems/GL/src/atifs/include/ATI_FS_GLGpuProgram.h	(revision 5)
+++ /RenderSystems/GL/src/atifs/include/ATI_FS_GLGpuProgram.h	(revision 5)
@@ -0,0 +1,74 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __ATI_FS_GLGpuProgram_H__
+#define __ATI_FS_GLGpuProgram_H__
+
+#include "OgreGLPrerequisites.h"
+#include "OgreGLGpuProgram.h"
+
+namespace Ogre {
+
+	/** Specialisation of the GL low-level program for ATI Fragment Shader programs. */
+	class _OgrePrivate ATI_FS_GLGpuProgram : public GLGpuProgram
+	{
+	public:
+        ATI_FS_GLGpuProgram(ResourceManager* creator, 
+            const String& name, ResourceHandle handle, 
+            const String& group, bool isManual, ManualResourceLoader* loader);
+		virtual ~ATI_FS_GLGpuProgram();
+
+
+		/// Execute the binding functions for this program
+		void bindProgram(void);
+		/// Execute the unbinding functions for this program
+		void unbindProgram(void);
+		/// Execute the param binding functions for this program
+		void bindProgramParameters(GpuProgramParametersSharedPtr params);
+		/** Execute the pass iteration param binding functions for this program.
+            Only binds those parameters used for multipass rendering
+        */
+        void bindProgramPassIterationParameters(GpuProgramParametersSharedPtr params);
+
+		/// Get the assigned GL program id
+		const GLuint getProgramID(void) const
+		{ return mProgramID; }
+
+	protected:
+		/// @copydoc Resource::unload
+		void unloadImpl(void);
+		void loadFromSource(void);
+
+	}; // class ATI_FS_GLGpuProgram
+
+
+
+}; // namespace Ogre
+
+#endif // __ATI_FS_GLGpuProgram_H__
Index: /RenderSystems/GL/src/atifs/include/Compiler2Pass.h
===================================================================
--- /RenderSystems/GL/src/atifs/include/Compiler2Pass.h	(revision 5)
+++ /RenderSystems/GL/src/atifs/include/Compiler2Pass.h	(revision 5)
@@ -0,0 +1,277 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+
+#ifndef COMPILER2PASS_H
+#define COMPILER2PASS_H
+
+#include <vector>
+
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
+// FIX ME - should not be hard coded
+#define BAD_TOKEN 999
+
+typedef unsigned int uint;
+
+
+
+/** Compiler2Pass is a generic compiler/assembler
+@remarks
+	provides a tokenizer in pass 1 and relies on the subclass to provide the virtual method for pass 2
+
+	PASS 1 - tokenize source: this is a simple brute force lexical scanner/analyzer that also parses
+			 the formed token for proper semantics and context in one pass
+			 it uses Look Ahead Left-Right (LALR) ruling based on Backus - Naur From notation for semantic
+			 checking and also performs	context checking allowing for language dialects
+
+	PASS 2 - generate application specific instructions ie native instructions
+
+@par
+	this class must be subclassed with the subclass providing implementation for Pass 2.  The subclass
+	is responsible for setting up the token libraries along with defining the language syntax.
+
+*/
+class Compiler2Pass {
+
+protected:
+
+	// BNF operation types
+	enum OperationType {otRULE, otAND, otOR, otOPTIONAL, otREPEAT, otEND};
+
+	/** structure used to build rule paths
+
+	*/
+	struct TokenRule {
+		OperationType mOperation;
+		uint mTokenID;
+		char* mSymbol;
+		uint mErrorID;
+
+	};
+
+	/** structure used to build Symbol Type library */
+	struct SymbolDef {
+	  uint mID;					// Token ID which is the index into the Token Type library
+	  uint mPass2Data;			// data used by pass 2 to build native instructions
+
+	  uint mContextKey;			// context key to fit the Active Context
+	  uint mContextPatternSet;	// new pattern to set for Active Context bits
+	  uint mContextPatternClear;// Contexts bits to clear Active Context bits
+
+	  int mDefTextID;			// index into text table for default name : set at runtime
+	  uint mRuleID;				// index into Rule database for non-terminal toke rulepath
+								// if RuleID is zero the token is terminal
+
+	};
+
+
+	/** structure for Token instructions */
+	struct TokenInst {
+	  uint mNTTRuleID;			// Non-Terminal Token Rule ID that generated Token
+	  uint mID;					// Token ID
+	  int mLine;				// line number in source code where Token was found
+	  int mPos;					// Character position in source where Token was found
+
+	};
+
+	typedef std::vector<TokenInst> TokenInstContainer;
+	//typedef TokenInstContainer::iterator TokenInstIterator;
+
+	/// container for Tokens extracted from source
+	TokenInstContainer mTokenInstructions;
+
+	/// pointer to the source to be compiled
+	const char* mSource;
+	int mEndOfSource;
+
+	/// pointers to Text and Token Type libraries setup by subclass
+	SymbolDef* mSymbolTypeLib;
+
+	/// pointer to root rule path - has to be set by subclass constructor
+	TokenRule* mRootRulePath;
+
+	/// number of entries in Text and Token Type libraries
+	int mRulePathLibCnt;
+	int mSymbolTypeLibCnt;
+
+	/// mVauleID needs to be initialized by the subclass before compiling occurs
+	/// it defines the token ID used in the symbol type library
+	uint mValueID;
+
+
+	/// storage container for constants defined in source
+	std::vector<float> mConstants;
+
+	/// Active Contexts pattern used in pass 1 to determine which tokens are valid for a certain context
+	uint mActiveContexts;
+
+	/** check token semantics between ID1 and ID2 using left/right semantic data in Token Type library
+	@param ID1 token ID on the left
+	@param ID2 token ID on the right
+	@return
+		true if both will bind to each other
+		false if either fails the semantic bind test
+
+	*/
+	//bool checkTokenSemantics(uint ID1, uint ID2);
+
+	/** perform pass 1 of compile process
+		scans source for symbols that can be tokenized and then
+		performs general semantic and context verification on each symbol before it is tokenized.
+		A tokenized instruction list is built to be used by Pass 2.
+
+	*/
+	bool doPass1();
+
+	/** pure virtual method that must be set up by subclass to perform Pass 2 of compile process
+	@remark
+		Pass 2 is for the subclass to take the token instructions generated in Pass 1 and
+		build the application specific instructions along with verifying
+		symantic and context rules that could not be checked in Pass 1
+
+	*/
+	virtual bool doPass2() = 0;
+
+	void findEOL();
+
+	/** get the text symbol for this token
+	@remark
+		mainly used for debugging and in test routines
+	@param sid is the token ID
+	@return a pointer to the string text
+	*/
+	char* getTypeDefText(const uint sid);
+
+	/** check to see if the text at the present position in the source is a numerical constant
+	@param fvalue is a reference that will receive the float value that is in the source
+	@param charsize reference to receive number of characters that make of the value in the source
+	@return
+		true if characters form a valid float representation
+		false if a number value could not be extracted
+	*/
+	bool isFloatValue(float & fvalue, int & charsize);
+
+	/** check to see if the text is in the symbol text library
+	@param symbol points to begining of text where a symbol token might exist
+	@param symbolsize reference that will receive the size value of the symbol found
+	@return
+		true if a matching token could be found in the token type library
+		false if could not be tokenized
+	*/
+	bool isSymbol(const char* symbol, int & symbolsize);
+
+
+	/// position to the next possible valid sysmbol
+	bool positionToNextSymbol();
+
+
+	/** process input source text using rulepath to determine allowed tokens
+	@remarks
+		the method is reentrant and recursive
+		if a non-terminal token is encountered in the current rule path then the method is
+		called using the new rule path referenced by the non-terminal token
+		Tokens can have the following operation states which effects the flow path of the rule
+			RULE: defines a rule path for the non-terminal token
+			AND: the token is required for the rule to pass
+			OR: if the previous tokens failed then try these ones
+			OPTIONAL: the token is optional and does not cause the rule to fail if the token is not found
+			REPEAT: the token is required but there can be more than one in a sequence
+			END: end of the rule path - the method returns the succuss of the rule
+
+	@param rulepathIDX index into to array of Token Rules that define a rule path to be processed
+	@return
+		true if rule passed - all required tokens found
+		false if one or more tokens required to complete the rule were not found
+	*/
+	bool processRulePath( uint rulepathIDX);
+
+
+	// setup ActiveContexts - should be called by subclass to setup initial language contexts
+	void setActiveContexts(const uint contexts){ mActiveContexts = contexts; }
+
+
+	/// comment specifiers are hard coded
+	void skipComments();
+
+	/// find end of line marker and move past it
+	void skipEOL();
+
+	/// skip all the white space which includes spaces and tabs
+	void skipWhiteSpace();
+
+
+	/** check if current position in source has the symbol text equivalent to the TokenID
+	@param rulepathIDX index into rule path database of token to validate
+	@param activeRuleID index of non-terminal rule that generated the token
+	@return
+		true if token was found
+		false if token symbol text does not match the source text
+		if token is non-terminal then processRulePath is called
+	*/
+	bool ValidateToken(const uint rulepathIDX, const uint activeRuleID);
+
+
+public:
+	// ** these probably should not be public
+	int mCurrentLine;
+	int mCharPos;
+
+
+	/// constructor
+	Compiler2Pass();
+    virtual ~Compiler2Pass() {}
+	/** compile the source - performs 2 passes
+		first pass is to tokinize, check semantics and context
+		second pass is performed by subclass and converts tokens to application specific instructions
+	@remark
+		Pass 2 only gets executed if Pass 1 has no errors
+	@param source a pointer to the source text to be compiled
+	@return
+		true if Pass 1 and Pass 2 are successfull
+		false if any errors occur in Pass 1 or Pass 2
+	*/
+	bool compile(const char* source);
+
+	/** Initialize the type library with matching symbol text found in symbol text library
+		find a default text for all Symbol Types in library
+
+		scan through all the rules and initialize TypeLib with index to text and index to rules for non-terminal tokens
+
+		must be called by subclass after libraries and rule database setup
+	*/
+
+	void InitSymbolTypeLib();
+
+};
+
+#endif
+
Index: /RenderSystems/GL/src/atifs/include/Makefile.am
===================================================================
--- /RenderSystems/GL/src/atifs/include/Makefile.am	(revision 5)
+++ /RenderSystems/GL/src/atifs/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = ATI_FS_GLGpuProgram.h Compiler2Pass.h ps_1_4.h
Index: /RenderSystems/GL/src/atifs/include/Makefile.in
===================================================================
--- /RenderSystems/GL/src/atifs/include/Makefile.in	(revision 5)
+++ /RenderSystems/GL/src/atifs/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = RenderSystems/GL/src/atifs/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = ATI_FS_GLGpuProgram.h Compiler2Pass.h ps_1_4.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  RenderSystems/GL/src/atifs/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  RenderSystems/GL/src/atifs/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /RenderSystems/GL/src/atifs/include/ps_1_4.h
===================================================================
--- /RenderSystems/GL/src/atifs/include/ps_1_4.h	(revision 5)
+++ /RenderSystems/GL/src/atifs/include/ps_1_4.h	(revision 5)
@@ -0,0 +1,367 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+
+/**
+	A number of invaluable references were used to put together this ps.1.x compiler for ATI_fragment_shader execution
+
+	References:
+		1. MSDN: DirectX 8.1 Reference
+		2. Wolfgang F. Engel "Fundamentals of Pixel Shaders - Introduction to Shader Programming Part III" on gamedev.net
+		3. Martin Ecker - XEngine
+		4. Shawn Kirst - ps14toATIfs
+		5. Jason L. Mitchell "Real-Time 3D Graphics With Pixel Shaders" 
+		6. Jason L. Mitchell "1.4 Pixel Shaders"
+		7. Jason L. Mitchell and Evan Hart "Hardware Shading with EXT_vertex_shader and ATI_fragment_shader"
+		6. ATI 8500 SDK
+		7. GL_ATI_fragment_shader extension reference
+
+*/
+//---------------------------------------------------------------------------
+#ifndef ps_1_4H
+#define ps_1_4H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "OgreGLPrerequisites.h"
+#include "Compiler2Pass.h"
+
+
+//---------------------------------------------------------------------------
+// macro to get the size of a static array
+#define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0]))
+
+#define ALPHA_BIT 0x08
+#define RGB_BITS 0x07
+
+// Context key patterns
+#define ckp_PS_BASE 0x1
+#define ckp_PS_1_1  0x2
+#define ckp_PS_1_2  0x4
+#define ckp_PS_1_3  0x8
+#define ckp_PS_1_4  0x10
+
+#define ckp_PS_1_4_BASE (ckp_PS_BASE + ckp_PS_1_4)
+
+
+
+
+/** Subclasses Compiler2Pass to provide a ps_1_x compiler that takes DirectX pixel shader assembly
+	and converts it to a form that can be used by ATI_fragment_shader OpenGL API
+@remarks
+	all ps_1_1, ps_1_2, ps_1_3, ps_1_4 assembly instructions are recognized but not all are passed
+	on to ATI_fragment_shader.	ATI_fragment_shader does not have an equivelant directive for
+	texkill or texdepth instructions.
+
+	The user must provide the GL binding interfaces.
+
+	A Test method is provided to verify the basic operation of the compiler which outputs the test
+	results to a file.
+
+
+*/
+class PS_1_4 : public Compiler2Pass{
+private:
+	enum RWAflags {rwa_NONE = 0, rwa_READ = 1, rwa_WRITE = 2};
+
+	enum MachineInstID {mi_COLOROP1, mi_COLOROP2, mi_COLOROP3, mi_ALPHAOP1, mi_ALPHAOP2,
+						mi_ALPHAOP3, mi_SETCONSTANTS, mi_PASSTEXCOORD, mi_SAMPLEMAP, mi_TEX,
+						mi_TEXCOORD, mi_TEXREG2RGB, mi_NOP
+	};
+
+	struct  TokenInstType{
+	  char* Name;
+	  GLuint ID;
+
+	};
+
+	struct RegisterUsage {
+		bool Phase1Write;
+		bool Phase2Write;
+	};
+
+	// Token ID enumeration
+	enum SymbolID {
+		// Terminal Tokens section
+
+		// DirectX pixel shader source formats 
+		sid_PS_1_4, sid_PS_1_1, sid_PS_1_2, sid_PS_1_3,
+					
+		// PS_BASE
+		sid_C0, sid_C1, sid_C2, sid_C3, sid_C4, sid_C5, sid_C6, sid_C7,
+		sid_V0, sid_V1,
+		sid_ADD, sid_SUB, sid_MUL, sid_MAD, sid_LRP, sid_MOV, sid_CMP, sid_CND,
+		sid_DP3, sid_DP4, sid_DEF,
+		sid_R, sid_RA, sid_G, sid_GA, sid_B, sid_BA, sid_A, sid_RGBA, sid_RGB,
+		sid_RG, sid_RGA, sid_RB, sid_RBA, sid_GB, sid_GBA,
+		sid_RRRR, sid_GGGG, sid_BBBB, sid_AAAA,
+		sid_X2, sid_X4, sid_D2, sid_SAT,
+		sid_BIAS, sid_INVERT, sid_NEGATE, sid_BX2,
+		sid_COMMA, sid_VALUE,
+
+		//PS_1_4 sid
+		sid_R0, sid_R1, sid_R2, sid_R3, sid_R4, sid_R5,
+		sid_T0, sid_T1, sid_T2, sid_T3, sid_T4, sid_T5,
+		sid_DP2ADD,
+		sid_X8, sid_D8, sid_D4,
+		sid_TEXCRD, sid_TEXLD,
+		sid_STR, sid_STQ,
+		sid_STRDR, sid_STQDQ,
+		sid_BEM,
+		sid_PHASE,
+
+		//PS_1_1 sid
+		sid_1R0, sid_1R1, sid_1T0, sid_1T1, sid_1T2, sid_1T3,
+		sid_TEX, sid_TEXCOORD, sid_TEXM3X2PAD,
+		sid_TEXM3X2TEX, sid_TEXM3X3PAD, sid_TEXM3X3TEX, sid_TEXM3X3SPEC, sid_TEXM3X3VSPEC,
+		sid_TEXREG2AR, sid_TEXREG2GB,
+		
+		//PS_1_2 side
+		sid_TEXREG2RGB, sid_TEXDP3, sid_TEXDP3TEX,
+
+		// common
+		sid_SKIP, sid_PLUS,
+
+		// non-terminal tokens section
+		sid_PROGRAM, sid_PROGRAMTYPE, sid_DECLCONSTS, sid_DEFCONST,
+		sid_CONSTANT, sid_COLOR,
+		sid_TEXSWIZZLE, sid_UNARYOP,
+		sid_NUMVAL, sid_SEPERATOR, sid_ALUOPS, sid_TEXMASK, sid_TEXOP_PS1_1_3,
+		sid_TEXOP_PS1_4,
+		sid_ALU_STATEMENT, sid_DSTMODSAT, sid_UNARYOP_ARGS, sid_REG_PS1_4,
+		sid_TEX_PS1_4, sid_REG_PS1_1_3, sid_TEX_PS1_1_3, sid_DSTINFO,
+		sid_SRCINFO, sid_BINARYOP_ARGS, sid_TERNARYOP_ARGS, sid_TEMPREG,
+		sid_DSTMASK, sid_PRESRCMOD, sid_SRCNAME, sid_SRCREP, sid_POSTSRCMOD,
+		sid_DSTMOD, sid_DSTSAT, sid_BINARYOP,  sid_TERNARYOP,
+		sid_TEXOPS_PHASE1, sid_COISSUE, sid_PHASEMARKER, sid_TEXOPS_PHASE2, 
+		sid_TEXREG_PS1_4, sid_TEXOPS_PS1_4, sid_TEXOPS_PS1_1_3, sid_TEXCISCOP_PS1_1_3,
+
+
+		// last token
+		sid_INVALID = BAD_TOKEN // must be last in enumeration
+	};
+
+	/// structure used to keep track of arguments and instruction parameters
+	struct OpParram {
+	  GLuint Arg;		// type of argument
+	  bool Filled;		// has it been filled yet
+	  GLuint MaskRep;	// Mask/Replicator flags
+	  GLuint Mod;		// argument modifier
+	};
+
+	typedef std::vector<uint> MachineInstContainer;
+	//typedef MachineInstContainer::iterator MachineInstIterator;
+
+
+	// there are 2 phases with 2 subphases each
+	enum PhaseType {ptPHASE1TEX, ptPHASE1ALU, ptPHASE2TEX, ptPHASE2ALU };
+
+	struct RegModOffset {
+		uint MacroOffset;
+		uint RegisterBase;
+		uint OpParramsIndex;
+	};
+
+	struct MacroRegModify {
+		TokenInst *		Macro;
+		uint			MacroSize;
+		RegModOffset *	RegMods;
+		uint			RegModSize;
+
+	};
+
+	#define R_BASE  (sid_R0 - GL_REG_0_ATI)
+	#define C_BASE  (sid_C0 - GL_CON_0_ATI)
+	#define T_BASE  (sid_1T0 - GL_REG_0_ATI)
+
+	// static library database for tokens and BNF rules
+	static SymbolDef PS_1_4_SymbolTypeLib[];
+	static TokenRule PS_1_x_RulePath[];
+	static bool LibInitialized;
+
+	// Static Macro database for ps.1.1 ps.1.2 ps.1.3 instructions
+
+	static TokenInst texreg2ar[];
+	static RegModOffset texreg2xx_RegMods[];
+	static MacroRegModify texreg2ar_MacroMods;
+
+	static TokenInst texreg2gb[];
+	static MacroRegModify texreg2gb_MacroMods;
+
+	static TokenInst texdp3[];
+	static RegModOffset texdp3_RegMods[];
+	static MacroRegModify texdp3_MacroMods;
+
+	static TokenInst texdp3tex[];
+	static RegModOffset texdp3tex_RegMods[];
+	static MacroRegModify texdp3tex_MacroMods;
+
+	static TokenInst texm3x2pad[];
+	static RegModOffset texm3xxpad_RegMods[];
+	static MacroRegModify texm3x2pad_MacroMods;
+
+	static TokenInst texm3x2tex[];
+	static RegModOffset texm3xxtex_RegMods[];
+	static MacroRegModify texm3x2tex_MacroMods;
+
+	static TokenInst texm3x3pad[];
+	static MacroRegModify texm3x3pad_MacroMods;
+
+	static TokenInst texm3x3tex[];
+	static MacroRegModify texm3x3tex_MacroMods;
+
+	static TokenInst texm3x3spec[];
+	static RegModOffset texm3x3spec_RegMods[];
+	static MacroRegModify texm3x3spec_MacroMods;
+
+	static TokenInst texm3x3vspec[];
+	static RegModOffset texm3x3vspec_RegMods[];
+	static MacroRegModify texm3x3vspec_MacroMods;
+
+
+	MachineInstContainer mPhase1TEX_mi; /// machine instructions for phase one texture section
+	MachineInstContainer mPhase1ALU_mi; /// machine instructions for phase one ALU section
+	MachineInstContainer mPhase2TEX_mi; /// machine instructions for phase two texture section
+	MachineInstContainer mPhase2ALU_mi; /// machine instructions for phase two ALU section
+
+	MachineInstContainer* mActivePhaseMachineInstructions;
+	// vars used during pass 2
+	MachineInstID mOpType;
+	uint mOpInst;
+	bool mDo_Alpha;
+	PhaseType mInstructionPhase;
+	int mArgCnt;
+	int mConstantsPos;
+
+	#define MAXOPPARRAMS 5 // max number of parrams bound to an instruction
+	
+	OpParram mOpParrams[MAXOPPARRAMS];
+
+	/// keeps track of which registers are written to in each phase
+	/// if a register is read from but has not been written to in phase 2
+	/// then if it was written to in phase 1 perform a register pass function
+	/// at the begining of phase2 so that the register has something worthwhile in it
+	/// NB: check ALU and TEX section of phase 1 and phase 2
+	/// there are 6 temp registers r0 to r5 to keep track off
+	/// checks are performed in pass 2 when building machine instructions
+	RegisterUsage Phase_RegisterUsage[6];
+
+	bool mMacroOn; // if true then put all ALU instructions in phase 1
+
+	uint mTexm3x3padCount; // keep track of how many texm3x3pad instructions are used so know which mask to use
+
+	size_t mLastInstructionPos; // keep track of last phase 2 ALU instruction to check for R0 setting
+	size_t mSecondLastInstructionPos;
+
+	// keep track if phase marker found: determines which phase the ALU instructions go into
+	bool mPhaseMarkerFound; 
+
+#ifdef _DEBUG
+	FILE* fp;
+	// full compiler test with output results going to a text file
+	void testCompile(char* testname, char* teststr, SymbolID* testresult,
+		uint testresultsize, GLuint* MachinInstResults = NULL, uint MachinInstResultsSize = 0);
+#endif // _DEBUG
+
+
+	/** attempt to build a machine instruction using current tokens
+		determines what phase machine insturction should be in and if an Alpha Op is required
+		calls expandMachineInstruction() to expand the token into machine instructions
+	*/
+	bool BuildMachineInst();
+	
+	void clearMachineInstState();
+
+	bool setOpParram(const SymbolDef* symboldef);
+
+	/** optimizes machine instructions depending on pixel shader context
+		only applies to ps.1.1 ps.1.2 and ps.1.3 since they use CISC instructions
+		that must be transformed into RISC instructions
+	*/
+	void optimize();
+
+	// the method is expected to be recursive to allow for inline expansion of instructions if required
+	bool Pass2scan(const TokenInst * Tokens, const size_t size);
+
+	// supply virtual functions for Compiler2Pass
+	/// Pass 1 is completed so now take tokens generated and build machine instructions
+	bool doPass2();
+
+	/** Build a machine instruction from token and ready it for expansion
+		will expand CISC tokens using macro database
+
+	*/
+	bool bindMachineInstInPassToFragmentShader(const MachineInstContainer & PassMachineInstructions);
+
+	/** Expand CISC tokens into PS1_4 token equivalents
+
+	*/
+	bool expandMacro(const MacroRegModify & MacroMod);
+
+	/** Expand Machine instruction into operation type and arguments and put into proper machine
+		instruction container
+		also expands scaler alpha machine instructions if required
+
+	*/
+	bool expandMachineInstruction();
+
+	// mainly used by tests - too slow for use in binding
+	size_t getMachineInst(size_t Idx);
+
+	size_t getMachineInstCount();
+
+	void addMachineInst(PhaseType phase, const uint inst);
+
+	void clearAllMachineInst();
+
+	void updateRegisterWriteState(const PhaseType phase);
+
+	bool isRegisterReadValid(const PhaseType phase, const int param);
+
+public:
+
+	/// constructor
+	PS_1_4();
+
+	/// binds machine instructions generated in Pass 2 to the ATI GL fragment shader
+	bool bindAllMachineInstToFragmentShader();
+
+#ifdef _DEBUG
+	/// perform compiler tests - only available in _DEBUG mode
+	void test();
+	void testbinder();
+
+#endif
+};
+
+
+#endif
+
Index: /RenderSystems/GL/src/atifs/src/ATI_FS_GLGpuProgram.cpp
===================================================================
--- /RenderSystems/GL/src/atifs/src/ATI_FS_GLGpuProgram.cpp	(revision 5)
+++ /RenderSystems/GL/src/atifs/src/ATI_FS_GLGpuProgram.cpp	(revision 5)
@@ -0,0 +1,150 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "ps_1_4.h"
+#include "OgreException.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreRenderSystemCapabilities.h"
+#include "OgreLogManager.h"
+#include "ATI_FS_GLGpuProgram.h"
+
+using namespace Ogre;
+
+
+ATI_FS_GLGpuProgram::ATI_FS_GLGpuProgram(ResourceManager* creator, 
+        const String& name, ResourceHandle handle, 
+        const String& group, bool isManual, ManualResourceLoader* loader) :
+    GLGpuProgram(creator, name, handle, group, isManual, loader)
+{
+	mProgramType = GL_FRAGMENT_SHADER_ATI;
+    mProgramID = glGenFragmentShadersATI(1);
+}
+
+ATI_FS_GLGpuProgram::~ATI_FS_GLGpuProgram()
+{
+    // have to call this here reather than in Resource destructor
+    // since calling virtual methods in base destructors causes crash
+    unload(); 
+}
+
+void ATI_FS_GLGpuProgram::bindProgram(void)
+{
+	glEnable(mProgramType);
+	glBindFragmentShaderATI(mProgramID);
+}
+
+void ATI_FS_GLGpuProgram::unbindProgram(void)
+{
+	glDisable(mProgramType);
+}
+
+
+void ATI_FS_GLGpuProgram::bindProgramParameters(GpuProgramParametersSharedPtr params)
+{
+
+	// only supports float constants
+	const GpuLogicalBufferStruct* floatStruct = params->getFloatLogicalBufferStruct();
+
+	for (GpuLogicalIndexUseMap::const_iterator i = floatStruct->map.begin();
+		i != floatStruct->map.end(); ++i)
+	{
+		size_t logicalIndex = i->first;
+		const float* pFloat = params->getFloatPointer(i->second.physicalIndex);
+		// Iterate over the params, set in 4-float chunks (low-level)
+		for (size_t j = 0; j < i->second.currentSize; j+=4)
+		{
+			glSetFragmentShaderConstantATI(GL_CON_0_ATI + logicalIndex, pFloat);
+			pFloat += 4;
+			++logicalIndex;
+		}
+	}
+
+}
+
+void ATI_FS_GLGpuProgram::bindProgramPassIterationParameters(GpuProgramParametersSharedPtr params)
+{
+	if (params->hasPassIterationNumber())
+	{
+		size_t physicalIndex = params->getPassIterationNumberIndex();
+		size_t logicalIndex = params->getFloatLogicalIndexForPhysicalIndex(physicalIndex);
+		const float* pFloat = params->getFloatPointer(physicalIndex);
+		glSetFragmentShaderConstantATI( GL_CON_0_ATI + (GLuint)logicalIndex, pFloat);
+	}
+}
+
+
+void ATI_FS_GLGpuProgram::unloadImpl(void)
+{
+	glDeleteFragmentShaderATI(mProgramID);
+}
+
+
+void ATI_FS_GLGpuProgram::loadFromSource(void)
+{
+
+    PS_1_4 PS1_4Assembler;
+	// attempt to compile the source
+#ifdef _DEBUG
+	PS1_4Assembler.test(); // run compiler tests in debug mode
+#endif
+
+    bool Error = !PS1_4Assembler.compile(mSource.c_str());
+
+    if(!Error) { 
+		glBindFragmentShaderATI(mProgramID);
+		glBeginFragmentShaderATI();
+			// compile was successfull so send the machine instructions thru GL to GPU
+			Error = !PS1_4Assembler.bindAllMachineInstToFragmentShader();
+        glEndFragmentShaderATI();
+
+		// check GL for GPU machine instruction bind erros
+		if (Error)
+		{
+			OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+				"Cannot Bind ATI fragment shader :" + mName, mName); 
+		}
+
+    }
+    else
+	{
+		// an error occured when compiling the ps_1_4 source code
+		char buff[50];
+        sprintf(buff,"error on line %d in pixel shader source\n", PS1_4Assembler.mCurrentLine);
+
+		LogManager::getSingleton().logMessage("Warning: atifs compiler reported the following errors:");
+		LogManager::getSingleton().logMessage(buff + mName);
+
+		OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+			"Cannot Compile ATI fragment shader : " + mName + "\n\n" + buff , mName);// + 
+    }
+
+
+}
+
Index: /RenderSystems/GL/src/atifs/src/Compiler2Pass.cpp
===================================================================
--- /RenderSystems/GL/src/atifs/src/Compiler2Pass.cpp	(revision 5)
+++ /RenderSystems/GL/src/atifs/src/Compiler2Pass.cpp	(revision 5)
@@ -0,0 +1,377 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "Compiler2Pass.h"
+
+Compiler2Pass::Compiler2Pass()
+{
+	// reserve some memory space in the containers being used
+	mTokenInstructions.reserve(100);
+	mConstants.reserve(80);
+	// default contexts allows all contexts
+	// subclass should change it to fit the language being compiled
+	mActiveContexts = 0xffffffff;
+
+}
+
+
+
+void Compiler2Pass::InitSymbolTypeLib()
+{
+	uint token_ID;
+	// find a default text for all Symbol Types in library
+
+	// scan through all the rules and initialize TypeLib with index to text and index to rules for non-terminal tokens
+	for(int i = 0; i < mRulePathLibCnt; i++) {
+		token_ID = mRootRulePath[i].mTokenID;
+		// make sure SymbolTypeLib holds valid token
+		assert(mSymbolTypeLib[token_ID].mID == token_ID);
+		switch(mRootRulePath[i].mOperation) {
+			case otRULE:
+				// if operation is a rule then update typelib
+				mSymbolTypeLib[token_ID].mRuleID = i;
+
+			case otAND:
+			case otOR:
+			case otOPTIONAL:
+				// update text index in typelib
+				if (mRootRulePath[i].mSymbol != NULL) mSymbolTypeLib[token_ID].mDefTextID = i;
+				break;
+		}
+	}
+
+}
+
+
+bool Compiler2Pass::compile(const char* source)
+{
+	bool Passed = false;
+
+	mSource = source;
+	// start compiling if there is a rule base to work with
+	if(mRootRulePath != NULL) {
+		 Passed = doPass1();
+
+		if(Passed) {
+			Passed = doPass2();
+		}
+	}
+	return Passed;
+}
+
+
+bool Compiler2Pass::doPass1()
+{
+	// scan through Source string and build a token list using TokenInstructions
+	// this is a simple brute force lexical scanner/analyzer that also parses the formed
+	// token for proper semantics and context in one pass
+
+	mCurrentLine = 1;
+	mCharPos = 0;
+	// reset position in Constants container
+	mConstants.clear();
+	mEndOfSource = strlen(mSource);
+
+	// start with a clean slate
+	mTokenInstructions.clear();
+	// tokenize and check semantics untill an error occurs or end of source is reached
+	// assume RootRulePath has pointer to rules so start at index + 1 for first rule path
+	// first rule token would be a rule definition so skip over it
+	bool passed = processRulePath(0);
+	// if a symbol in source still exists then the end of source was not reached and there was a problem some where
+	if (positionToNextSymbol()) passed = false;
+	return passed;
+
+}
+
+
+bool Compiler2Pass::processRulePath( uint rulepathIDX)
+{
+	// rule path determines what tokens and therefore what symbols are acceptable from the source
+	// it is assumed that the tokens with the longest similar symbols are arranged first so
+	// if a match is found it is accepted and no further searching is done
+
+	// record position of last token in container
+	// to be used as the rollback position if a valid token is not found
+	uint TokenContainerOldSize = mTokenInstructions.size();
+	int OldCharPos = mCharPos;
+	int OldLinePos = mCurrentLine;
+	uint OldConstantsSize = mConstants.size();
+
+	// keep track of what non-terminal token activated the rule
+	uint ActiveNTTRule = mRootRulePath[rulepathIDX].mTokenID;
+	// start rule path at next position for definition
+	rulepathIDX++;
+
+	// assume the rule will pass
+	bool Passed = true;
+	bool EndFound = false;
+
+	// keep following rulepath until the end is reached
+	while (EndFound == false) {
+		switch (mRootRulePath[rulepathIDX].mOperation) {
+
+			case otAND:
+				// only validate if the previous rule passed
+				if(Passed) Passed = ValidateToken(rulepathIDX, ActiveNTTRule); 
+				break;
+
+			case otOR:
+				// only validate if the previous rule failed
+				if ( Passed == false ) {
+					// clear previous tokens from entry and try again
+					mTokenInstructions.resize(TokenContainerOldSize);
+					Passed = ValidateToken(rulepathIDX, ActiveNTTRule);
+				}
+				else { // path passed up to this point therefore finished so pretend end marker found
+					EndFound = true;
+				}
+				break;
+
+			case otOPTIONAL:
+				// if previous passed then try this rule but it does not effect succes of rule since its optional
+				if(Passed) ValidateToken(rulepathIDX, ActiveNTTRule); 
+				break;
+
+			case otREPEAT:
+				// repeat until no tokens of this type found 
+				// at least one must be found
+				if(Passed) {
+					int TokensPassed = 0;
+					// keep calling until failure
+					while ( Passed = ValidateToken(rulepathIDX, ActiveNTTRule)) {
+						// increment count for previous passed token
+						TokensPassed++;
+					}
+					// defaults to Passed = fail
+					// if at least one token found then return passed = true
+					if (TokensPassed > 0) Passed = true;
+				}
+				break;
+
+			case otEND:
+				// end of rule found so time to return
+				EndFound = true;
+				if(Passed == false) {
+					// the rule did not validate so get rid of tokens decoded
+					// roll back the token container end position to what it was when rule started
+					// this will get rid of all tokens that had been pushed on the container while
+					// trying to validating this rule
+					mTokenInstructions.resize(TokenContainerOldSize);
+					mConstants.resize(OldConstantsSize);
+					mCharPos = OldCharPos;
+					mCurrentLine = OldLinePos;
+				}
+				break;
+
+			default:
+				// an exception should be raised since the code should never get here
+				Passed = false;
+				EndFound = true;
+				break;
+
+		}
+
+
+		// move on to the next rule in the path
+		rulepathIDX++;
+	}
+
+	return Passed;
+
+}
+
+
+bool Compiler2Pass::ValidateToken(const uint rulepathIDX, const uint activeRuleID)
+{
+	int tokenlength = 0;
+	// assume the test is going to fail
+	bool Passed = false;
+	uint TokenID = mRootRulePath[rulepathIDX].mTokenID;
+	// only validate token if context is correct
+	if (mSymbolTypeLib[TokenID].mContextKey & mActiveContexts) {
+	
+		// if terminal token then compare text of symbol with what is in source
+		if ( mSymbolTypeLib[TokenID].mRuleID == 0){
+
+			if (positionToNextSymbol()) {
+				// if Token is supposed to be a number then check if its a numerical constant
+				if (TokenID == mValueID) {
+					float constantvalue;
+					if(Passed = isFloatValue(constantvalue, tokenlength)) {
+						mConstants.push_back(constantvalue);
+					}
+					
+				}
+				// compare token symbol text with source text
+				else Passed = isSymbol(mRootRulePath[rulepathIDX].mSymbol, tokenlength);
+					
+				if(Passed) {
+					TokenInst newtoken;
+					// push token onto end of container
+					newtoken.mID = TokenID;
+					newtoken.mNTTRuleID = activeRuleID;
+					newtoken.mLine = mCurrentLine;
+					newtoken.mPos = mCharPos;
+
+					mTokenInstructions.push_back(newtoken);
+					// update source position
+					mCharPos += tokenlength;
+
+					// allow token instruction to change the ActiveContexts
+					// use token contexts pattern to clear ActiveContexts pattern bits
+					mActiveContexts &= ~mSymbolTypeLib[TokenID].mContextPatternClear;
+					// use token contexts pattern to set ActiveContexts pattern bits
+					mActiveContexts |= mSymbolTypeLib[TokenID].mContextPatternSet;
+				}
+			}
+
+		}
+		// else a non terminal token was found
+		else {
+
+			// execute rule for non-terminal
+			// get rule_ID for index into  rulepath to be called
+			Passed = processRulePath(mSymbolTypeLib[TokenID].mRuleID);
+		}
+	}
+
+
+	return Passed;
+
+}
+
+
+char* Compiler2Pass::getTypeDefText(const uint sid)
+{
+	return mRootRulePath[mSymbolTypeLib[sid].mDefTextID].mSymbol;
+}
+
+
+bool Compiler2Pass::isFloatValue(float& fvalue, int& charsize)
+{
+	// check to see if it is a numeric float value
+	bool valuefound = false;
+
+	const char* startptr = mSource + mCharPos;
+	char* endptr = NULL;
+
+	fvalue = (float)strtod(startptr, &endptr);
+	// if a valid float was found then endptr will have the pointer to the first invalid character
+	if(endptr) {
+		if(endptr>startptr) {
+			// a valid value was found so process it
+			charsize = endptr - startptr;
+			valuefound = true;
+		}
+	}
+
+	return valuefound;
+}
+
+
+bool Compiler2Pass::isSymbol(const char* symbol, int& symbolsize)
+{
+	// compare text at source+charpos with the symbol : limit testing to symbolsize
+	bool symbolfound = false;
+	symbolsize = strlen(symbol);
+	if(strncmp(mSource + mCharPos, symbol, symbolsize)==0) {
+		symbolfound = true;
+	}
+
+	return symbolfound;
+}
+
+
+bool Compiler2Pass::positionToNextSymbol()
+{
+	bool validsymbolfound = false;
+	bool endofsource = false;
+	while(!validsymbolfound && !endofsource) {
+		skipWhiteSpace();
+		skipEOL();
+		skipComments();
+		// have we reached the end of the string?
+		if (mCharPos == mEndOfSource) endofsource = true;
+		else {
+			// if ASCII > space then assume valid character is found
+			if (mSource[mCharPos] > ' ') validsymbolfound = true;
+		}
+	}// end of while
+
+	return validsymbolfound;
+}
+
+
+
+void Compiler2Pass::skipComments()
+{
+  // if current char and next are // then search for EOL
+	if(mCharPos < mEndOfSource) {
+		if( ((mSource[mCharPos] == '/') && (mSource[mCharPos + 1] == '/')) ||
+			(mSource[mCharPos] == ';') ||
+			(mSource[mCharPos] == '#') ) findEOL();
+	}
+}
+
+
+void Compiler2Pass::findEOL()
+{
+	// find eol charter and move to this position
+	const char* newpos = strchr(&mSource[mCharPos], '\n');
+	if(newpos) {
+		mCharPos += newpos - &mSource[mCharPos];
+	}
+	// couldn't find end of line so skip to the end
+	else mCharPos = mEndOfSource - 1;
+
+}
+
+
+void Compiler2Pass::skipEOL()
+{
+	if ((mSource[mCharPos] == '\n') || (mSource[mCharPos] == '\r')) {
+		mCurrentLine++;
+		mCharPos++;
+		if ((mSource[mCharPos] == '\n') || (mSource[mCharPos] == '\r')) {
+			mCharPos++;
+		}
+	}
+}
+
+
+void Compiler2Pass::skipWhiteSpace()
+{
+	// FIX - this method kinda slow
+	while((mSource[mCharPos] == ' ') || (mSource[mCharPos] == '\t')) mCharPos++; // find first non white space character
+}
+
Index: /RenderSystems/GL/src/atifs/src/Makefile.am
===================================================================
--- /RenderSystems/GL/src/atifs/src/Makefile.am	(revision 5)
+++ /RenderSystems/GL/src/atifs/src/Makefile.am	(revision 5)
@@ -0,0 +1,11 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/RenderSystems/GL/include \
+           -I$(top_srcdir)/OgreMain/include $(GLSUPPORT_CFLAGS) \
+           -I$(top_srcdir)/PlatformManagers/$(OGRE_PLATFORM)/include \
+           -I$(top_srcdir)/RenderSystems/GL/src/$(OGRE_GLSUPPORT) \
+           -I$(top_srcdir)/RenderSystems/GL/src/atifs/include \
+           $(CFLAGS_VISIBILITY)
+
+noinst_LTLIBRARIES=libatifs.la
+libatifs_la_SOURCES = ATI_FS_GLGpuProgram.cpp \
+                     Compiler2Pass.cpp \
+                     ps_1_4.cpp
Index: /RenderSystems/GL/src/atifs/src/Makefile.in
===================================================================
--- /RenderSystems/GL/src/atifs/src/Makefile.in	(revision 5)
+++ /RenderSystems/GL/src/atifs/src/Makefile.in	(revision 5)
@@ -0,0 +1,509 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = RenderSystems/GL/src/atifs/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libatifs_la_LIBADD =
+am_libatifs_la_OBJECTS = ATI_FS_GLGpuProgram.lo Compiler2Pass.lo \
+	ps_1_4.lo
+libatifs_la_OBJECTS = $(am_libatifs_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libatifs_la_SOURCES)
+DIST_SOURCES = $(libatifs_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/RenderSystems/GL/include \
+           -I$(top_srcdir)/OgreMain/include $(GLSUPPORT_CFLAGS) \
+           -I$(top_srcdir)/PlatformManagers/$(OGRE_PLATFORM)/include \
+           -I$(top_srcdir)/RenderSystems/GL/src/$(OGRE_GLSUPPORT) \
+           -I$(top_srcdir)/RenderSystems/GL/src/atifs/include \
+           $(CFLAGS_VISIBILITY)
+
+noinst_LTLIBRARIES = libatifs.la
+libatifs_la_SOURCES = ATI_FS_GLGpuProgram.cpp \
+                     Compiler2Pass.cpp \
+                     ps_1_4.cpp
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  RenderSystems/GL/src/atifs/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  RenderSystems/GL/src/atifs/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libatifs.la: $(libatifs_la_OBJECTS) $(libatifs_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libatifs_la_LDFLAGS) $(libatifs_la_OBJECTS) $(libatifs_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ATI_FS_GLGpuProgram.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Compiler2Pass.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ps_1_4.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /RenderSystems/GL/src/atifs/src/ps_1_4.cpp
===================================================================
--- /RenderSystems/GL/src/atifs/src/ps_1_4.cpp	(revision 5)
+++ /RenderSystems/GL/src/atifs/src/ps_1_4.cpp	(revision 5)
@@ -0,0 +1,2145 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+ 
+ //---------------------------------------------------------------------------
+#include "ps_1_4.h"
+
+//---------------------------------------------------------------------------
+
+/* ********************* START OF PS_1_4 CLASS STATIC DATA ********************************* */
+
+
+// library of built in symbol types
+
+bool PS_1_4::LibInitialized = false;
+
+#define SYMSTART {
+#define SYMDEF  ,0,0,0,0},{
+#define SYMEND  ,0,0,0,0}
+
+PS_1_4::SymbolDef PS_1_4::PS_1_4_SymbolTypeLib[] = {
+	// pixel shader versions supported
+	{ sid_PS_1_4, GL_NONE, ckp_PS_BASE, ckp_PS_1_4, 0, 0, 0 },
+	{ sid_PS_1_1, GL_NONE, ckp_PS_BASE, ckp_PS_1_1, 0, 0, 0 },
+	{ sid_PS_1_2, GL_NONE, ckp_PS_BASE, ckp_PS_1_2 + ckp_PS_1_1, 0, 0, 0 },
+	{ sid_PS_1_3, GL_NONE, ckp_PS_BASE, ckp_PS_1_3 + ckp_PS_1_2 + ckp_PS_1_1, 0, 0, 0 },
+
+	// PS_BASE
+
+	// constants
+	SYMSTART sid_C0, GL_CON_0_ATI, ckp_PS_BASE
+	SYMDEF sid_C1, GL_CON_1_ATI, ckp_PS_BASE
+	SYMDEF sid_C2, GL_CON_2_ATI, ckp_PS_BASE
+	SYMDEF sid_C3, GL_CON_3_ATI, ckp_PS_BASE
+	SYMDEF sid_C4, GL_CON_4_ATI, ckp_PS_BASE
+	SYMDEF sid_C5, GL_CON_5_ATI, ckp_PS_BASE
+	SYMDEF sid_C6, GL_CON_6_ATI, ckp_PS_BASE
+	SYMDEF sid_C7, GL_CON_7_ATI, ckp_PS_BASE
+
+	// colour
+	SYMDEF sid_V0, GL_PRIMARY_COLOR_ARB,  ckp_PS_BASE
+	SYMDEF sid_V1, GL_SECONDARY_INTERPOLATOR_ATI,  ckp_PS_BASE
+
+	// instruction ops
+	SYMDEF sid_ADD, GL_ADD_ATI, ckp_PS_BASE
+	SYMDEF sid_SUB, GL_SUB_ATI, ckp_PS_BASE
+	SYMDEF sid_MUL, GL_MUL_ATI, ckp_PS_BASE
+	SYMDEF sid_MAD, GL_MAD_ATI, ckp_PS_BASE
+	SYMDEF sid_LRP, GL_LERP_ATI, ckp_PS_BASE
+	SYMDEF sid_MOV, GL_MOV_ATI, ckp_PS_BASE
+	SYMDEF sid_CMP, GL_CND0_ATI, ckp_PS_BASE
+	SYMDEF sid_CND, GL_CND_ATI, ckp_PS_BASE
+	SYMDEF sid_DP3, GL_DOT3_ATI, ckp_PS_BASE
+	SYMDEF sid_DP4, GL_DOT4_ATI, ckp_PS_BASE
+
+	SYMDEF sid_DEF, GL_NONE, ckp_PS_BASE
+
+	// Masks
+	SYMDEF sid_R, GL_RED_BIT_ATI, ckp_PS_1_4
+	SYMDEF sid_RA, GL_RED_BIT_ATI | ALPHA_BIT, ckp_PS_1_4
+	SYMDEF sid_G, GL_GREEN_BIT_ATI, ckp_PS_1_4
+	SYMDEF sid_GA, GL_GREEN_BIT_ATI | ALPHA_BIT, ckp_PS_1_4
+	SYMDEF sid_B, GL_BLUE_BIT_ATI, ckp_PS_1_4
+	SYMDEF sid_BA, GL_BLUE_BIT_ATI | ALPHA_BIT, ckp_PS_1_4
+	SYMDEF sid_A, ALPHA_BIT, ckp_PS_BASE
+	SYMDEF sid_RGBA, RGB_BITS | ALPHA_BIT, ckp_PS_BASE
+	SYMDEF sid_RGB, RGB_BITS,  ckp_PS_BASE
+	SYMDEF sid_RG, GL_RED_BIT_ATI | GL_GREEN_BIT_ATI, ckp_PS_1_4
+	SYMDEF sid_RGA, GL_RED_BIT_ATI | GL_GREEN_BIT_ATI | ALPHA_BIT, ckp_PS_1_4
+	SYMDEF sid_RB, GL_RED_BIT_ATI | GL_BLUE_BIT_ATI, ckp_PS_1_4
+	SYMDEF sid_RBA, GL_RED_BIT_ATI | GL_BLUE_BIT_ATI | ALPHA_BIT, ckp_PS_1_4
+	SYMDEF sid_GB, GL_GREEN_BIT_ATI | GL_BLUE_BIT_ATI, ckp_PS_1_4
+	SYMDEF sid_GBA, GL_GREEN_BIT_ATI | GL_BLUE_BIT_ATI | ALPHA_BIT, ckp_PS_1_4
+
+	// Rep
+	SYMDEF sid_RRRR, GL_RED, ckp_PS_1_4
+	SYMDEF sid_GGGG, GL_GREEN, ckp_PS_1_4
+	SYMDEF sid_BBBB, GL_BLUE, ckp_PS_BASE
+	SYMDEF sid_AAAA, GL_ALPHA, ckp_PS_BASE
+
+
+	// modifiers
+	SYMDEF sid_X2, GL_2X_BIT_ATI, ckp_PS_BASE
+	SYMDEF sid_X4, GL_4X_BIT_ATI, ckp_PS_BASE
+	SYMDEF sid_D2, GL_HALF_BIT_ATI, ckp_PS_BASE
+	SYMDEF sid_SAT, GL_SATURATE_BIT_ATI, ckp_PS_BASE
+
+	// argument modifiers
+	SYMDEF sid_BIAS, GL_BIAS_BIT_ATI, ckp_PS_BASE
+	SYMDEF sid_INVERT, GL_COMP_BIT_ATI, ckp_PS_BASE
+	SYMDEF sid_NEGATE, GL_NEGATE_BIT_ATI, ckp_PS_BASE
+	SYMDEF sid_BX2, GL_2X_BIT_ATI | GL_BIAS_BIT_ATI, ckp_PS_BASE
+	
+	// seperator characters
+	SYMDEF sid_COMMA, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_VALUE, GL_NONE, ckp_PS_BASE
+
+	// PS_1_4
+	// temp R/W registers
+	SYMDEF sid_R0, GL_REG_0_ATI, ckp_PS_1_4
+	SYMDEF sid_R1, GL_REG_1_ATI, ckp_PS_1_4
+	SYMDEF sid_R2, GL_REG_2_ATI, ckp_PS_1_4
+	SYMDEF sid_R3, GL_REG_3_ATI, ckp_PS_1_4
+	SYMDEF sid_R4, GL_REG_4_ATI, ckp_PS_1_4
+	SYMDEF sid_R5, GL_REG_5_ATI, ckp_PS_1_4
+
+	// textures
+	SYMDEF sid_T0, GL_TEXTURE0_ARB, ckp_PS_1_4
+	SYMDEF sid_T1, GL_TEXTURE1_ARB, ckp_PS_1_4
+	SYMDEF sid_T2, GL_TEXTURE2_ARB, ckp_PS_1_4
+	SYMDEF sid_T3, GL_TEXTURE3_ARB, ckp_PS_1_4
+	SYMDEF sid_T4, GL_TEXTURE4_ARB, ckp_PS_1_4
+	SYMDEF sid_T5, GL_TEXTURE5_ARB, ckp_PS_1_4
+	SYMDEF sid_DP2ADD, GL_DOT2_ADD_ATI, ckp_PS_1_4
+
+	// modifiers
+	SYMDEF sid_X8, GL_8X_BIT_ATI, ckp_PS_1_4
+	SYMDEF sid_D8, GL_EIGHTH_BIT_ATI, ckp_PS_1_4
+	SYMDEF sid_D4, GL_QUARTER_BIT_ATI, ckp_PS_1_4
+
+	// instructions
+	SYMDEF sid_TEXCRD, GL_NONE, ckp_PS_1_4
+	SYMDEF sid_TEXLD, GL_NONE, ckp_PS_1_4
+
+	// texture swizzlers
+
+	SYMDEF sid_STR, GL_SWIZZLE_STR_ATI - GL_SWIZZLE_STR_ATI, ckp_PS_1_4
+	SYMDEF sid_STQ, GL_SWIZZLE_STQ_ATI - GL_SWIZZLE_STR_ATI, ckp_PS_1_4
+	SYMDEF sid_STRDR, GL_SWIZZLE_STR_DR_ATI - GL_SWIZZLE_STR_ATI, ckp_PS_1_4
+	SYMDEF sid_STQDQ, GL_SWIZZLE_STQ_DQ_ATI - GL_SWIZZLE_STR_ATI, ckp_PS_1_4 
+
+	SYMDEF sid_BEM, GL_NONE, ckp_PS_1_4
+	SYMDEF sid_PHASE, GL_NONE, ckp_PS_1_4
+
+	// PS_1_1 
+	// temp R/W registers
+	// r0, r1 are mapped to r4, r5
+	// t0 to t3 are mapped to r0 to r3
+	SYMDEF sid_1R0, GL_REG_4_ATI, ckp_PS_1_1
+	SYMDEF sid_1R1, GL_REG_5_ATI, ckp_PS_1_1
+	SYMDEF sid_1T0, GL_REG_0_ATI, ckp_PS_1_1
+	SYMDEF sid_1T1, GL_REG_1_ATI, ckp_PS_1_1
+	SYMDEF sid_1T2, GL_REG_2_ATI, ckp_PS_1_1
+	SYMDEF sid_1T3, GL_REG_3_ATI, ckp_PS_1_1
+
+	// instructions common to PS_1_1, PS_1_2, PS_1_3
+	SYMDEF sid_TEX, GL_NONE, ckp_PS_1_1
+	SYMDEF sid_TEXCOORD, GL_NONE, ckp_PS_1_1
+	SYMDEF sid_TEXM3X2PAD, GL_NONE, ckp_PS_1_1
+	SYMDEF sid_TEXM3X2TEX, GL_NONE, ckp_PS_1_1
+	SYMDEF sid_TEXM3X3PAD, GL_NONE, ckp_PS_1_1
+	SYMDEF sid_TEXM3X3TEX, GL_NONE, ckp_PS_1_1
+	SYMDEF sid_TEXM3X3SPEC, GL_NONE, ckp_PS_1_1
+	SYMDEF sid_TEXM3X3VSPEC, GL_NONE, ckp_PS_1_1
+	SYMDEF sid_TEXREG2AR, GL_NONE, ckp_PS_1_2
+	SYMDEF sid_TEXREG2GB, GL_NONE, ckp_PS_1_2
+
+	// PS_1_2 & PS_1_3
+	SYMDEF sid_TEXREG2RGB, GL_NONE, ckp_PS_1_2
+	SYMDEF sid_TEXDP3, GL_NONE, ckp_PS_1_2
+	SYMDEF sid_TEXDP3TEX, GL_NONE, ckp_PS_1_2
+	
+
+	// Common
+	SYMDEF sid_SKIP, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_PLUS, GL_NONE, ckp_PS_BASE
+
+	// Non-Terminal Tokens
+	SYMDEF sid_PROGRAM, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_PROGRAMTYPE, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_DECLCONSTS, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_DEFCONST, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_CONSTANT, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_COLOR, GL_NONE, ckp_PS_BASE 
+	SYMDEF sid_TEXSWIZZLE, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_UNARYOP, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_NUMVAL, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_SEPERATOR, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_ALUOPS, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_TEXMASK, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_TEXOP_PS1_1_3, GL_NONE, ckp_PS_1_1 
+	SYMDEF sid_TEXOP_PS1_4, GL_NONE, ckp_PS_1_4
+	SYMDEF sid_ALU_STATEMENT, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_DSTMODSAT, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_UNARYOP_ARGS, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_REG_PS1_4, GL_NONE, ckp_PS_1_4
+	SYMDEF sid_TEX_PS1_4, GL_NONE, ckp_PS_1_4
+	SYMDEF sid_REG_PS1_1_3, GL_NONE, ckp_PS_1_1
+	SYMDEF sid_TEX_PS1_1_3, GL_NONE, ckp_PS_1_1
+	SYMDEF sid_DSTINFO, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_SRCINFO, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_BINARYOP_ARGS, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_TERNARYOP_ARGS, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_TEMPREG, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_DSTMASK, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_PRESRCMOD, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_SRCNAME, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_SRCREP, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_POSTSRCMOD, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_DSTMOD, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_DSTSAT, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_BINARYOP, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_TERNARYOP, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_TEXOPS_PHASE1, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_COISSUE, GL_NONE, ckp_PS_BASE
+	SYMDEF sid_PHASEMARKER, GL_NONE, ckp_PS_1_4
+	SYMDEF sid_TEXOPS_PHASE2, GL_NONE, ckp_PS_1_4
+	SYMDEF sid_TEXREG_PS1_4, GL_NONE, ckp_PS_1_4
+	SYMDEF sid_TEXOPS_PS1_4, GL_NONE, ckp_PS_1_4
+	SYMDEF sid_TEXOPS_PS1_1_3, GL_NONE, ckp_PS_1_1
+	SYMDEF sid_TEXCISCOP_PS1_1_3, GL_NONE, ckp_PS_1_1
+	SYMEND
+};
+
+
+// Rule Path Database for ps.1.x code based on extended Backus Naur Form notation
+
+// <>	- non-terminal token
+#define _rule_		{otRULE,		// ::=	- rule definition
+#define _is_		,0},{otAND,
+#define _and_		,0},{otAND,		//      - blank space is an implied "AND" meaning the token is required
+#define _or_		,0},{otOR,		// |	- or
+#define _optional_	,0},{otOPTIONAL,	// []	- optional
+#define _repeat_	,0},{otREPEAT,	// {}	- repeat until fail
+#define _end_		,0},{otEND,0,0,0},
+#define _nt_        ,0
+// " "  - terminal token string
+
+PS_1_4::TokenRule PS_1_4::PS_1_x_RulePath[] = {
+
+	_rule_ sid_PROGRAM, "Program"
+
+		_is_ sid_PROGRAMTYPE _nt_
+		_optional_ sid_DECLCONSTS _nt_
+		_optional_ sid_TEXOPS_PHASE1 _nt_
+		_optional_ sid_ALUOPS _nt_
+		_optional_ sid_PHASEMARKER _nt_
+		_optional_ sid_TEXOPS_PHASE2 _nt_
+		_optional_ sid_ALUOPS _nt_
+		_end_ 
+
+	_rule_ sid_PROGRAMTYPE, "<ProgramType>"
+
+		_is_ sid_PS_1_4, "ps.1.4"
+		_or_ sid_PS_1_1, "ps.1.1"
+		_or_ sid_PS_1_2, "ps.1.2"
+		_or_ sid_PS_1_3, "ps.1.3"
+		_end_
+
+	_rule_ sid_PHASEMARKER, "<PhaseMarker>"
+
+		_is_ sid_PHASE, "phase"
+		_end_
+
+	_rule_ sid_DECLCONSTS, "<DeclareConstants>"
+
+		_repeat_ sid_DEFCONST _nt_
+		_end_
+
+
+	_rule_ sid_TEXOPS_PHASE1, "<TexOps_Phase1>"
+
+		_is_ sid_TEXOPS_PS1_1_3 _nt_
+		_or_ sid_TEXOPS_PS1_4 _nt_
+		_end_
+
+	_rule_ sid_TEXOPS_PHASE2, "<TexOps_Phase2>"
+
+		_is_ sid_TEXOPS_PS1_4 _nt_
+		_end_
+
+	_rule_ sid_NUMVAL, "<NumVal>"
+
+		_is_ sid_VALUE, "Float Value"
+		_end_
+
+	_rule_ sid_TEXOPS_PS1_1_3, "<TexOps_PS1_1_3>"
+
+		_repeat_ sid_TEXOP_PS1_1_3 _nt_
+		_end_
+
+	_rule_ sid_TEXOPS_PS1_4, "<TexOps_PS1_4>"
+
+		_repeat_ sid_TEXOP_PS1_4 _nt_
+		_end_
+
+	_rule_ sid_TEXOP_PS1_1_3, "<TexOp_PS1_1_3>"
+
+		_is_  sid_TEXCISCOP_PS1_1_3 _nt_
+		_and_ sid_TEX_PS1_1_3 _nt_
+		_and_ sid_SEPERATOR _nt_
+		_and_ sid_TEX_PS1_1_3 _nt_
+
+		_or_  sid_TEXCOORD, "texcoord"
+		_and_ sid_TEX_PS1_1_3 _nt_
+
+		_or_  sid_TEX, "tex"
+		_and_ sid_TEX_PS1_1_3 _nt_
+
+
+
+		_end_
+
+	_rule_ sid_TEXOP_PS1_4, "<TexOp_PS1_4>"
+
+		_is_  sid_TEXCRD, "texcrd"
+		_and_ sid_REG_PS1_4 _nt_
+		_optional_ sid_TEXMASK _nt_
+		_and_ sid_SEPERATOR _nt_
+		_and_ sid_TEXREG_PS1_4 _nt_
+
+		_or_  sid_TEXLD, "texld"
+		_and_ sid_REG_PS1_4 _nt_
+		_optional_ sid_TEXMASK _nt_
+		_and_ sid_SEPERATOR _nt_
+		_and_ sid_TEXREG_PS1_4 _nt_
+		_end_
+
+	_rule_ sid_ALUOPS, "<ALUOps>"
+
+		_repeat_ sid_ALU_STATEMENT _nt_
+		_end_
+
+	_rule_ sid_ALU_STATEMENT, "<ALUStatement>"
+
+		_is_ sid_COISSUE _nt_
+		_and_ sid_UNARYOP _nt_
+		_optional_ sid_DSTMODSAT _nt_
+		_and_ sid_UNARYOP_ARGS _nt_ 
+
+		_or_ sid_COISSUE _nt_
+		_and_ sid_BINARYOP _nt_
+		_optional_ sid_DSTMODSAT _nt_
+		_and_ sid_BINARYOP_ARGS _nt_
+		
+		_or_ sid_COISSUE _nt_
+		_and_ sid_TERNARYOP _nt_
+		_optional_ sid_DSTMODSAT _nt_
+		_and_ sid_TERNARYOP_ARGS _nt_
+		_end_
+
+
+	_rule_ sid_TEXREG_PS1_4, "<TexReg_PS1_4>"
+
+		_is_ sid_TEX_PS1_4  _nt_
+		_optional_ sid_TEXSWIZZLE _nt_
+		_or_ sid_REG_PS1_4  _nt_
+		_optional_ sid_TEXSWIZZLE _nt_
+		_end_
+
+	_rule_ sid_UNARYOP_ARGS, "<UnaryOpArgs>"
+
+		_is_  sid_DSTINFO _nt_
+		_and_ sid_SRCINFO _nt_
+		_end_
+
+	_rule_ sid_BINARYOP_ARGS, "<BinaryOpArgs>"
+	
+		_is_  sid_DSTINFO _nt_
+		_and_ sid_SRCINFO _nt_
+		_and_ sid_SRCINFO _nt_
+		_end_
+
+	_rule_ sid_TERNARYOP_ARGS, "<TernaryOpArgs>"
+		
+		_is_  sid_DSTINFO _nt_
+		_and_ sid_SRCINFO _nt_
+		_and_ sid_SRCINFO _nt_
+		_and_ sid_SRCINFO _nt_
+		_end_
+ 
+	_rule_ sid_DSTINFO, "<DstInfo>"
+
+		_is_ sid_TEMPREG _nt_
+		_optional_ sid_DSTMASK _nt_
+		_end_
+
+	_rule_ sid_SRCINFO, "<SrcInfo>"
+	
+		_is_ sid_SEPERATOR _nt_
+		_optional_ sid_PRESRCMOD _nt_
+		_and_ sid_SRCNAME _nt_
+		_optional_ sid_POSTSRCMOD _nt_
+		_optional_ sid_SRCREP _nt_
+		_end_
+
+	_rule_ sid_SRCNAME, "<SrcName>"
+	
+		_is_ sid_TEMPREG _nt_
+		_or_ sid_CONSTANT _nt_
+		_or_ sid_COLOR _nt_
+		_end_
+
+	_rule_ sid_DEFCONST, "<DefineConstant>"
+
+		_is_ sid_DEF, "def"
+		_and_ sid_CONSTANT _nt_
+		_and_ sid_SEPERATOR _nt_
+		_and_ sid_NUMVAL _nt_
+		_and_ sid_SEPERATOR _nt_
+		_and_ sid_NUMVAL _nt_
+		_and_ sid_SEPERATOR _nt_
+		_and_ sid_NUMVAL _nt_
+		_and_ sid_SEPERATOR _nt_
+		_and_ sid_NUMVAL _nt_
+		_end_
+
+	_rule_ sid_CONSTANT, "<Constant>"
+
+		_is_ sid_C0, "c0"
+		_or_ sid_C1, "c1"
+		_or_ sid_C2, "c2"
+		_or_ sid_C3, "c3"
+		_or_ sid_C4, "c4"
+		_or_ sid_C5, "c5"
+		_or_ sid_C6, "c6"
+		_or_ sid_C7, "c7"
+		_end_
+
+
+	_rule_ sid_TEXCISCOP_PS1_1_3, "<TexCISCOp_PS1_1_3>"
+
+		_is_ sid_TEXDP3TEX,		"texdp3tex"
+		_or_ sid_TEXDP3,		"texdp3"
+		_or_ sid_TEXM3X2PAD,	"texm3x2pad"
+		_or_ sid_TEXM3X2TEX,	"texm3x2tex"
+		_or_ sid_TEXM3X3PAD,	"texm3x3pad"
+		_or_ sid_TEXM3X3TEX,	"texm3x3tex"
+		_or_ sid_TEXM3X3SPEC,	"texm3x3spec"
+		_or_ sid_TEXM3X3VSPEC,	"texm3x3vspec"
+		_or_ sid_TEXREG2RGB,	"texreg2rgb"
+		_or_ sid_TEXREG2AR,		"texreg2ar"
+		_or_ sid_TEXREG2GB,		"texreg2gb"
+		_end_
+
+
+	_rule_ sid_TEXSWIZZLE, "<TexSwizzle>"
+
+		_is_ sid_STQDQ,	"_dw.xyw"
+		_or_ sid_STQDQ,	"_dw"
+		_or_ sid_STQDQ,	"_da.rga"
+		_or_ sid_STQDQ,	"_da"
+		_or_ sid_STRDR,	"_dz.xyz"
+		_or_ sid_STRDR,	"_dz"
+		_or_ sid_STRDR,	"_db.rgb"
+		_or_ sid_STRDR,	"_db"
+		_or_ sid_STR,	".xyz"
+		_or_ sid_STR,	".rgb"
+		_or_ sid_STQ,	".xyw"
+		_or_ sid_STQ,	".rga"
+		_end_ 
+
+	_rule_ sid_TEXMASK, "<TexMask>"
+
+		_is_ sid_RGB,	".rgb"
+		_or_ sid_RGB,	".xyz"
+		_or_ sid_RG,	".rg"
+		_or_ sid_RG,	".xy"
+		_end_
+
+	_rule_ sid_SEPERATOR, "<Seperator>"
+
+		_is_ sid_COMMA, ","
+		_end_
+
+	_rule_ sid_REG_PS1_4, "<Reg_PS1_4>"
+
+		_is_ sid_R0, "r0"
+		_or_ sid_R1, "r1"
+		_or_ sid_R2, "r2"
+		_or_ sid_R3, "r3"
+		_or_ sid_R4, "r4"
+		_or_ sid_R5, "r5"
+		_end_
+
+	_rule_ sid_TEX_PS1_4, "<Tex_PS1_4>"
+
+		_is_ sid_T0, "t0"
+		_or_ sid_T1, "t1"
+		_or_ sid_T2, "t2"
+		_or_ sid_T3, "t3"
+		_or_ sid_T4, "t4"
+		_or_ sid_T5, "t5"
+		_end_
+
+	_rule_ sid_REG_PS1_1_3, "<Reg_PS1_1_3>"
+
+		_is_ sid_1R0, "r0"
+		_or_ sid_1R1, "r1"
+		_end_
+
+	_rule_ sid_TEX_PS1_1_3, "<Tex_PS1_1_3>"
+
+		_is_ sid_1T0, "t0"
+		_or_ sid_1T1, "t1"
+		_or_ sid_1T2, "t2"
+		_or_ sid_1T3, "t3"
+		_end_
+
+	_rule_ sid_COLOR, "<Color>"
+
+		_is_ sid_V0, "v0"
+		_or_ sid_V1, "v1"
+		_end_
+
+
+	_rule_ sid_TEMPREG, "<TempReg>"
+
+		_is_ sid_REG_PS1_4 _nt_
+		_or_ sid_REG_PS1_1_3 _nt_
+		_or_ sid_TEX_PS1_1_3 _nt_
+		_end_
+
+	_rule_ sid_DSTMODSAT, "<DstModSat>"
+	
+		_optional_ sid_DSTMOD _nt_
+		_optional_ sid_DSTSAT _nt_
+		_end_
+
+	_rule_  sid_UNARYOP, "<UnaryOp>"
+
+		_is_ sid_MOV, "mov"
+		_end_
+
+	_rule_ sid_BINARYOP, "<BinaryOP>"
+	
+		_is_ sid_ADD, "add"
+		_or_ sid_MUL, "mul"
+		_or_ sid_SUB, "sub"
+		_or_ sid_DP3, "dp3"
+		_or_ sid_DP4, "dp4"
+		_or_ sid_BEM, "bem"
+		_end_
+
+	_rule_ sid_TERNARYOP, "<TernaryOp>"
+	
+		_is_ sid_MAD, "mad"
+		_or_ sid_LRP, "lrp"
+		_or_ sid_CND, "cnd"
+		_or_ sid_CMP, "cmp"
+		_end_
+
+	_rule_ sid_DSTMASK, "<DstMask>"
+
+		_is_ sid_RGBA,	".rgba"
+		_or_ sid_RGBA,	".xyzw"
+		_or_ sid_RGB,	".rgb"
+		_or_ sid_RGB,	".xyz"
+		_or_ sid_RGA,	".xyw"
+		_or_ sid_RGA,	".rga"
+		_or_ sid_RBA,	".rba"
+		_or_ sid_RBA,	".xzw"
+		_or_ sid_GBA,	".gba"
+		_or_ sid_GBA,	".yzw"
+		_or_ sid_RG,	".rg"
+		_or_ sid_RG,	".xy"
+		_or_ sid_RB,	".xz"
+		_or_ sid_RB,	".rb"
+		_or_ sid_RA,	".xw"
+		_or_ sid_RA,	".ra"
+		_or_ sid_GB,	".gb"
+		_or_ sid_GB,	".yz"
+		_or_ sid_GA,	".yw"
+		_or_ sid_GA,	".ga"
+		_or_ sid_BA,	".zw"
+		_or_ sid_BA,	".ba"
+		_or_ sid_R,		".r"
+		_or_ sid_R,		".x"
+		_or_ sid_G,		".g"
+		_or_ sid_G,		".y"
+		_or_ sid_B,		".b"
+		_or_ sid_B,		".z"
+		_or_ sid_A,		".a"
+		_or_ sid_A,		".w"
+		_end_
+
+	_rule_ sid_SRCREP, "<SrcRep>"
+	
+		_is_ sid_RRRR, ".r"
+		_or_ sid_RRRR, ".x"
+		_or_ sid_GGGG, ".g"
+		_or_ sid_GGGG, ".y"
+		_or_ sid_BBBB, ".b"
+		_or_ sid_BBBB, ".z"
+		_or_ sid_AAAA, ".a"
+		_or_ sid_AAAA, ".w"
+		_end_
+
+	_rule_ sid_PRESRCMOD, "<PreSrcMod>"
+
+		_is_ sid_INVERT, "1-"
+		_or_ sid_INVERT, "1 -"
+		_or_ sid_NEGATE, "-"
+		_end_
+
+	_rule_ sid_POSTSRCMOD, "<PostSrcMod>"
+
+		_is_ sid_BX2, "_bx2"
+		_or_ sid_X2, "_x2"
+		_or_ sid_BIAS, "_bias"
+		_end_
+
+	_rule_ sid_DSTMOD, "<DstMod>"
+
+		_is_ sid_X2, "_x2"
+		_or_ sid_X4, "_x4"
+		_or_ sid_D2, "_d2"
+		_or_ sid_X8, "_x8"
+		_or_ sid_D4, "_d4"
+		_or_ sid_D8, "_d8"
+		_end_
+
+	_rule_ sid_DSTSAT, "<DstSat>"
+
+		_is_ sid_SAT, "_sat"
+		_end_
+
+	_rule_ sid_COISSUE, "<CoIssue>"
+
+		_optional_ sid_PLUS, "+"
+		_end_
+
+};
+
+//***************************** MACROs for PS1_1 , PS1_2, PS1_3 CISC instructions **************************************
+
+// macro to make the macro text data easier to read
+#define _token_ ,0,0},{
+#define _token_end_ ,0,0}
+// macro token expansion for ps_1_2 instruction: texreg2ar
+PS_1_4::TokenInst PS_1_4::texreg2ar[] = {
+	// mov r(x).r, r(y).a
+	{		sid_UNARYOP,	sid_MOV
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_ sid_DSTMASK,	sid_R
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R0
+	_token_ sid_SRCREP,		sid_AAAA
+
+	// mov r(x).g, r(y).r
+	_token_ sid_UNARYOP,	sid_MOV
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_ sid_DSTMASK,	sid_G
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R0
+	_token_ sid_SRCREP,		sid_RRRR
+
+	// texld r(x), r(x)
+	_token_ sid_TEXOP_PS1_4, sid_TEXLD
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_end_
+};
+
+PS_1_4::RegModOffset PS_1_4::texreg2xx_RegMods[] = {
+	{1, R_BASE, 0},
+	{7, R_BASE, 0},
+	{13, R_BASE, 0},
+	{15, R_BASE, 0},
+	{4, R_BASE, 1},
+	{10, R_BASE, 1},
+
+};
+
+PS_1_4::MacroRegModify PS_1_4::texreg2ar_MacroMods = {
+	texreg2ar, ARRAYSIZE(texreg2ar),
+	texreg2xx_RegMods, ARRAYSIZE(texreg2xx_RegMods)
+};
+
+// macro token expansion for ps_1_2 instruction: texreg2gb
+PS_1_4::TokenInst PS_1_4::texreg2gb[] = {
+	// mov r(x).r, r(y).g
+	{		sid_UNARYOP,	sid_MOV
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_ sid_DSTMASK,	sid_R
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R0
+	_token_ sid_SRCREP,		sid_GGGG
+
+	// mov r(x).g, r(y).b
+	_token_ sid_UNARYOP,	sid_MOV
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_ sid_DSTMASK,	sid_G
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R0
+	_token_ sid_SRCREP,		sid_BBBB
+
+	// texld r(x), r(x)
+	_token_ sid_TEXOP_PS1_4, sid_TEXLD
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_end_
+};
+
+PS_1_4::MacroRegModify PS_1_4::texreg2gb_MacroMods = {
+	texreg2gb, ARRAYSIZE(texreg2gb),
+	texreg2xx_RegMods, ARRAYSIZE(texreg2xx_RegMods)
+};
+
+
+// macro token expansion for ps_1_1 instruction: texdp3
+PS_1_4::TokenInst PS_1_4::texdp3[] = {
+	// texcoord t(x)
+	{		sid_TEXOP_PS1_1_3, sid_TEXCOORD
+	_token_ sid_TEX_PS1_1_3, sid_1T1
+
+	// dp3 r(x), r(x), r(y)
+	_token_ sid_BINARYOP,	sid_DP3
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R0
+	_token_end_
+};
+
+
+PS_1_4::RegModOffset PS_1_4::texdp3_RegMods[] = {
+	{1, T_BASE, 0},
+	{3, R_BASE, 0},
+	{5, R_BASE, 0},
+	{7, R_BASE, 1},
+
+};
+
+
+PS_1_4::MacroRegModify PS_1_4::texdp3_MacroMods = {
+	texdp3, ARRAYSIZE(texdp3),
+	texdp3_RegMods, ARRAYSIZE(texdp3_RegMods)
+};
+
+
+// macro token expansion for ps_1_1 instruction: texdp3tex
+PS_1_4::TokenInst PS_1_4::texdp3tex[] = {
+	// texcoord t(x)
+	{		sid_TEXOP_PS1_1_3, sid_TEXCOORD
+	_token_ sid_TEX_PS1_1_3, sid_1T1
+
+	// dp3 r1, r(x), r(y)
+	_token_ sid_BINARYOP,	sid_DP3
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R0
+
+	// texld r(x), r(x)
+	_token_ sid_TEXOP_PS1_4, sid_TEXLD
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_end_
+};
+
+
+PS_1_4::RegModOffset PS_1_4::texdp3tex_RegMods[] = {
+	{1, T_BASE, 0},
+	{3, R_BASE, 0},
+	{5, R_BASE, 0},
+	{7, R_BASE, 1},
+	{9, R_BASE, 1},
+	{11, R_BASE, 1},
+
+};
+
+
+PS_1_4::MacroRegModify PS_1_4::texdp3tex_MacroMods = {
+	texdp3tex, ARRAYSIZE(texdp3tex),
+	texdp3tex_RegMods, ARRAYSIZE(texdp3tex_RegMods)
+};
+
+
+// macro token expansion for ps_1_1 instruction: texm3x2pad
+PS_1_4::TokenInst PS_1_4::texm3x2pad[] = {
+	// texcoord t(x)
+	{		sid_TEXOP_PS1_1_3, sid_TEXCOORD
+	_token_ sid_TEX_PS1_1_3, sid_1T0
+
+	// dp3 r4.r, r(x), r(y)
+	_token_ sid_BINARYOP,	sid_DP3
+	_token_ sid_REG_PS1_4,	sid_R4
+	_token_ sid_DSTMASK,	sid_R
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R0
+	_token_end_
+
+};
+
+
+PS_1_4::RegModOffset PS_1_4::texm3xxpad_RegMods[] = {
+	{1, T_BASE, 0},
+	{6, R_BASE, 0},
+	{8, R_BASE, 1},
+};
+
+
+PS_1_4::MacroRegModify PS_1_4::texm3x2pad_MacroMods = {
+	texm3x2pad, ARRAYSIZE(texm3x2pad),
+	texm3xxpad_RegMods, ARRAYSIZE(texm3xxpad_RegMods)
+};
+
+
+// macro token expansion for ps_1_1 instruction: texm3x2tex
+PS_1_4::TokenInst PS_1_4::texm3x2tex[] = {
+	// texcoord t(x)
+	{		sid_TEXOP_PS1_1_3, sid_TEXCOORD
+	_token_ sid_TEX_PS1_1_3, sid_1T1
+
+	// dp3 r4.g, r(x), r(y)
+	_token_ sid_BINARYOP,	sid_DP3
+	_token_ sid_REG_PS1_4,	sid_R4
+	_token_ sid_DSTMASK,	sid_G
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R0
+
+	// texld r(x), r4
+	_token_ sid_TEXOP_PS1_4, sid_TEXLD
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R4
+	_token_end_
+
+};
+
+PS_1_4::RegModOffset PS_1_4::texm3xxtex_RegMods[] = {
+	{1, T_BASE, 0},
+	{6, R_BASE, 0},
+	{8, R_BASE, 1},
+	{10, R_BASE, 0}
+};
+
+PS_1_4::MacroRegModify PS_1_4::texm3x2tex_MacroMods = {
+	texm3x2tex, ARRAYSIZE(texm3x2tex),
+	texm3xxtex_RegMods, ARRAYSIZE(texm3xxtex_RegMods)
+};
+
+// macro token expansion for ps_1_1 instruction: texm3x3tex
+PS_1_4::TokenInst PS_1_4::texm3x3pad[] = {
+	// texcoord t(x)
+	{		sid_TEXOP_PS1_1_3, sid_TEXCOORD
+	_token_ sid_TEX_PS1_1_3, sid_1T0
+
+	// dp3 r4.b, r(x), r(y)
+	_token_ sid_BINARYOP,	sid_DP3
+	_token_ sid_REG_PS1_4,	sid_R4
+	_token_ sid_DSTMASK,	sid_B
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R0
+	_token_end_
+
+};
+
+
+PS_1_4::MacroRegModify PS_1_4::texm3x3pad_MacroMods = {
+	texm3x3pad, ARRAYSIZE(texm3x3pad),
+	texm3xxpad_RegMods, ARRAYSIZE(texm3xxpad_RegMods)
+};
+
+
+// macro token expansion for ps_1_1 instruction: texm3x3pad
+PS_1_4::TokenInst PS_1_4::texm3x3tex[] = {
+	// texcoord t(x)
+	{		sid_TEXOP_PS1_1_3, sid_TEXCOORD
+	_token_ sid_TEX_PS1_1_3, sid_1T1
+
+	// dp3 r4.b, r(x), r(y)
+	_token_ sid_BINARYOP,	sid_DP3
+	_token_ sid_REG_PS1_4,	sid_R4
+	_token_ sid_DSTMASK,	sid_B
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R0
+
+	// texld r1, r4
+	_token_ sid_TEXOP_PS1_4, sid_TEXLD
+	_token_ sid_REG_PS1_4,	sid_R1
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R4
+	_token_end_
+};
+
+
+
+
+
+
+PS_1_4::MacroRegModify PS_1_4::texm3x3tex_MacroMods = {
+	texm3x3tex, ARRAYSIZE(texm3x3tex),
+	texm3xxtex_RegMods, ARRAYSIZE(texm3xxtex_RegMods)
+};
+
+
+// macro token expansion for ps_1_1 instruction: texm3x3spec
+PS_1_4::TokenInst PS_1_4::texm3x3spec[] = {
+	// texcoord t(x)
+	{		sid_TEXOP_PS1_1_3, sid_TEXCOORD
+	_token_ sid_TEX_PS1_1_3, sid_1T3
+
+	// dp3 r4.b, r3, r(x)
+	_token_ sid_BINARYOP,	sid_DP3
+	_token_ sid_REG_PS1_4,	sid_R4
+	_token_ sid_DSTMASK,	sid_B
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R3
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R0
+
+	// dp3_x2 r3, r4, c(x)
+	_token_ sid_BINARYOP,	sid_DP3
+	_token_ sid_DSTMOD,		sid_X2
+	_token_ sid_REG_PS1_4,	sid_R3
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R4
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_CONSTANT,	sid_C0
+
+	// mul r3, r3, c(x)
+	_token_ sid_UNARYOP,	sid_MUL
+	_token_ sid_REG_PS1_4,	sid_R3
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R3
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_CONSTANT,	sid_C0
+
+	// dp3 r2, r4, r4
+	_token_ sid_BINARYOP,	sid_DP3
+	_token_ sid_REG_PS1_4,	sid_R2
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R4
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R4
+
+	// mad r4.rgb, 1-c(x), r2, r3
+	_token_ sid_TERNARYOP,	sid_MAD
+	_token_ sid_REG_PS1_4,	sid_R4
+	_token_ sid_DSTMASK,	sid_RGB
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_PRESRCMOD,	sid_INVERT
+	_token_ sid_CONSTANT,	sid_C0
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R2
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R3
+
+	// + mov r4.a, r2.r
+	_token_ sid_UNARYOP,	sid_MOV
+	_token_ sid_REG_PS1_4,	sid_R4
+	_token_ sid_DSTMASK,	sid_A
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R2
+	_token_ sid_SRCREP,		sid_RRRR
+
+	// texld r3, r4.xyz_dz
+	_token_ sid_TEXOP_PS1_4, sid_TEXLD
+	_token_ sid_REG_PS1_4,	sid_R3
+	_token_ sid_SEPERATOR,	sid_COMMA
+	_token_ sid_REG_PS1_4,	sid_R4
+	_token_ sid_TEXSWIZZLE,	sid_STRDR
+	_token_end_
+
+};
+
+PS_1_4::RegModOffset PS_1_4::texm3x3spec_RegMods[] = {
+	{8, R_BASE, 1},
+	{15, R_BASE, 2},
+	{21, C_BASE, 2},
+	{33, C_BASE, 2},
+
+};
+
+PS_1_4::MacroRegModify PS_1_4::texm3x3spec_MacroMods = {
+	texm3x3spec, ARRAYSIZE(texm3x3spec),
+	texm3x3spec_RegMods, ARRAYSIZE(texm3x3spec_RegMods)
+};
+
+
+/* ********************* END OF CLASS STATIC DATA ********************************* */
+
+PS_1_4::PS_1_4()
+{
+	// allocate enough room for a large pixel shader
+	mPhase1TEX_mi.reserve(50);
+	mPhase2TEX_mi.reserve(30);
+	mPhase1ALU_mi.reserve(100);
+	mPhase2ALU_mi.reserve(100);
+
+
+	mSymbolTypeLib = PS_1_4_SymbolTypeLib;
+	mSymbolTypeLibCnt = ARRAYSIZE(PS_1_4_SymbolTypeLib);
+	mRootRulePath = PS_1_x_RulePath;
+	mRulePathLibCnt = ARRAYSIZE(PS_1_x_RulePath);
+	// tell compiler what the symbol id is for a numeric value
+	mValueID = sid_VALUE;
+	// The type library must have text definitions initialized
+	// before compiler is invoked
+
+	// only need to initialize the rule database once
+	if(LibInitialized == false) {
+		InitSymbolTypeLib();
+		LibInitialized = true;
+	}
+
+	// set initial context to recognize PS base instructions
+	mActiveContexts = ckp_PS_BASE;
+
+}
+
+
+bool PS_1_4::bindMachineInstInPassToFragmentShader(const MachineInstContainer & PassMachineInstructions)
+{
+  size_t instIDX = 0;
+  size_t instCount = PassMachineInstructions.size();
+  bool error = false;
+
+  while ((instIDX < instCount) && !error) {
+    switch(PassMachineInstructions[instIDX]) {
+      case mi_COLOROP1:
+        if((instIDX+7) < instCount)
+          glColorFragmentOp1ATI(PassMachineInstructions[instIDX+1], // op
+            PassMachineInstructions[instIDX+2], // dst
+            PassMachineInstructions[instIDX+3], // dstMask
+            PassMachineInstructions[instIDX+4], // dstMod
+            PassMachineInstructions[instIDX+5], // arg1
+            PassMachineInstructions[instIDX+6], // arg1Rep
+            PassMachineInstructions[instIDX+7]);// arg1Mod
+        instIDX += 8;
+        break;
+
+      case mi_COLOROP2:
+        if((instIDX+10) < instCount)
+          glColorFragmentOp2ATI(PassMachineInstructions[instIDX+1], // op
+            PassMachineInstructions[instIDX+2], // dst
+            PassMachineInstructions[instIDX+3], // dstMask
+            PassMachineInstructions[instIDX+4], // dstMod
+            PassMachineInstructions[instIDX+5], // arg1
+            PassMachineInstructions[instIDX+6], // arg1Rep
+            PassMachineInstructions[instIDX+7], // arg1Mod
+            PassMachineInstructions[instIDX+8], // arg2
+            PassMachineInstructions[instIDX+9], // arg2Rep
+            PassMachineInstructions[instIDX+10]);// arg2Mod
+        instIDX += 11;
+        break;
+
+      case mi_COLOROP3:
+        if((instIDX+13) < instCount)
+          glColorFragmentOp3ATI(PassMachineInstructions[instIDX+1], // op
+            PassMachineInstructions[instIDX+2],  // dst
+            PassMachineInstructions[instIDX+3],  // dstMask
+            PassMachineInstructions[instIDX+4],  // dstMod
+            PassMachineInstructions[instIDX+5],  // arg1
+            PassMachineInstructions[instIDX+6],  // arg1Rep
+            PassMachineInstructions[instIDX+7],  // arg1Mod
+            PassMachineInstructions[instIDX+8],  // arg2
+            PassMachineInstructions[instIDX+9],  // arg2Rep
+            PassMachineInstructions[instIDX+10], // arg2Mod
+            PassMachineInstructions[instIDX+11], // arg2
+            PassMachineInstructions[instIDX+12], // arg2Rep
+            PassMachineInstructions[instIDX+13]);// arg2Mod
+        instIDX += 14;
+        break;
+
+      case mi_ALPHAOP1:
+        if((instIDX+6) < instCount)
+          glAlphaFragmentOp1ATI(PassMachineInstructions[instIDX+1], // op
+            PassMachineInstructions[instIDX+2],   // dst
+            PassMachineInstructions[instIDX+3],   // dstMod
+            PassMachineInstructions[instIDX+4],   // arg1
+            PassMachineInstructions[instIDX+5],   // arg1Rep
+            PassMachineInstructions[instIDX+6]);  // arg1Mod
+        instIDX += 7;
+        break;
+
+      case mi_ALPHAOP2:
+        if((instIDX+9) < instCount)
+          glAlphaFragmentOp2ATI(PassMachineInstructions[instIDX+1], // op
+            PassMachineInstructions[instIDX+2],   // dst
+            PassMachineInstructions[instIDX+3],   // dstMod
+            PassMachineInstructions[instIDX+4],   // arg1
+            PassMachineInstructions[instIDX+5],   // arg1Rep
+            PassMachineInstructions[instIDX+6],   // arg1Mod
+            PassMachineInstructions[instIDX+7],   // arg2
+            PassMachineInstructions[instIDX+8],   // arg2Rep
+            PassMachineInstructions[instIDX+9]);  // arg2Mod
+        instIDX += 10;
+        break;
+
+      case mi_ALPHAOP3:
+        if((instIDX+12) < instCount)
+          glAlphaFragmentOp3ATI(PassMachineInstructions[instIDX+1], // op
+            PassMachineInstructions[instIDX+2],   // dst
+            PassMachineInstructions[instIDX+3],   // dstMod
+            PassMachineInstructions[instIDX+4],   // arg1
+            PassMachineInstructions[instIDX+5],   // arg1Rep
+            PassMachineInstructions[instIDX+6],   // arg1Mod
+            PassMachineInstructions[instIDX+7],   // arg2
+            PassMachineInstructions[instIDX+8],   // arg2Rep
+            PassMachineInstructions[instIDX+9],   // arg2Mod
+            PassMachineInstructions[instIDX+10],  // arg2
+            PassMachineInstructions[instIDX+11],  // arg2Rep
+            PassMachineInstructions[instIDX+12]); // arg2Mod
+        instIDX += 13;
+        break;
+
+      case mi_SETCONSTANTS:
+        if((instIDX+2) < instCount)
+          glSetFragmentShaderConstantATI(PassMachineInstructions[instIDX+1], // dst
+            &mConstants[PassMachineInstructions[instIDX+2]]);
+        instIDX += 3;
+        break;
+
+      case mi_PASSTEXCOORD:
+        if((instIDX+3) < instCount)
+          glPassTexCoordATI(PassMachineInstructions[instIDX+1], // dst
+            PassMachineInstructions[instIDX+2], // coord
+            PassMachineInstructions[instIDX+3]); // swizzle
+        instIDX += 4;
+        break;
+
+      case mi_SAMPLEMAP:
+        if((instIDX+3) < instCount)
+          glSampleMapATI(PassMachineInstructions[instIDX+1], // dst
+            PassMachineInstructions[instIDX+2], // interp
+            PassMachineInstructions[instIDX+3]); // swizzle
+        instIDX += 4;
+        break;
+
+	  default:
+		instIDX = instCount;
+		// should generate an error since an unknown instruction was found
+		// instead for now the bind process is terminated and the fragment program may still function
+		// but its output may not be what was programmed
+
+    } // end of switch
+
+    error = (glGetError() != GL_NO_ERROR);
+  }// end of while
+
+  return !error;
+
+}
+
+
+size_t PS_1_4::getMachineInst( size_t Idx)
+{
+	if (Idx < mPhase1TEX_mi.size()) {
+		return mPhase1TEX_mi[Idx];
+	}
+	else {
+		Idx -= mPhase1TEX_mi.size();
+		if (Idx < mPhase1ALU_mi.size()) {
+			return mPhase1ALU_mi[Idx];
+		}
+		else {
+			Idx -= mPhase1ALU_mi.size();
+			if (Idx < mPhase2TEX_mi.size()) {
+				return mPhase2TEX_mi[Idx];
+			}
+			else {
+				Idx -= mPhase2TEX_mi.size();
+				if (Idx < mPhase2ALU_mi.size()) {
+					return mPhase2ALU_mi[Idx];
+				}
+
+			}
+
+		}
+
+	}
+
+	return 0;
+
+}
+
+
+void PS_1_4::addMachineInst(const PhaseType phase, const uint inst)
+{
+	switch(phase) {
+
+		case ptPHASE1TEX:
+			mPhase1TEX_mi.push_back(inst);
+			break;
+
+		case ptPHASE1ALU:
+			mPhase1ALU_mi.push_back(inst);
+			break;
+
+		case ptPHASE2TEX:
+			mPhase2TEX_mi.push_back(inst);
+
+			break;
+
+		case ptPHASE2ALU:
+			mPhase2ALU_mi.push_back(inst);
+			break;
+
+
+	} // end switch(phase)
+
+}
+
+size_t PS_1_4::getMachineInstCount()
+{
+
+	return (mPhase1TEX_mi.size() + mPhase1ALU_mi.size() + mPhase2TEX_mi.size() + mPhase2ALU_mi.size());
+}
+
+
+bool PS_1_4::bindAllMachineInstToFragmentShader()
+{
+	bool passed;
+
+	// there are 4 machine instruction ques to pass to the ATI fragment shader
+	passed = bindMachineInstInPassToFragmentShader(mPhase1TEX_mi);
+	passed &= bindMachineInstInPassToFragmentShader(mPhase1ALU_mi);
+	passed &= bindMachineInstInPassToFragmentShader(mPhase2TEX_mi);
+	passed &= bindMachineInstInPassToFragmentShader(mPhase2ALU_mi);
+	return passed;
+
+}
+
+
+bool PS_1_4::expandMacro(const MacroRegModify & MacroMod)
+{
+
+	RegModOffset * regmod;
+
+	// set source and destination registers in macro expansion
+	for (uint i = 0; i < MacroMod.RegModSize; i++) {
+		regmod = &MacroMod.RegMods[i];
+		MacroMod.Macro[regmod->MacroOffset].mID = regmod->RegisterBase + mOpParrams[regmod->OpParramsIndex].Arg;
+
+	}
+
+	// turn macro support on so that ps.1.4 ALU instructions get put in phase 1 alu instruction sequence container
+	mMacroOn = true;
+	// pass macro tokens on to be turned into machine instructions
+	// expand macro to ps.1.4 by doing recursive call to doPass2
+	bool passed = Pass2scan(MacroMod.Macro, MacroMod.MacroSize);
+	mMacroOn = false;
+
+	return passed;
+}
+
+
+bool PS_1_4::BuildMachineInst()
+{
+
+	// check the states to see if a machine instruction can be assembled
+
+	// assume all arguments have been set up
+	bool passed = false;
+
+	
+
+	passed = true; // assume everything will go okay untill proven otherwise
+
+	// start with machine NOP instuction
+	// this is used after the switch to see if an instruction was set up
+	// determine which MachineInstID is required based on the op instruction
+	mOpType = mi_NOP;
+
+	switch(mOpInst) {
+		// ALU operations
+		case sid_ADD:
+		case sid_SUB:
+		case sid_MUL:
+		case sid_MAD:
+		case sid_LRP:
+		case sid_MOV:
+		case sid_CMP:
+		case sid_CND:
+		case sid_DP2ADD:
+		case sid_DP3:
+		case sid_DP4:
+			mOpType = (MachineInstID)(mi_COLOROP1 + mArgCnt - 1);
+
+			// if context is ps.1.x and Macro not on or a phase marker was found then put all ALU ops in phase 2 ALU container
+			if (((mActiveContexts & ckp_PS_1_1) && !mMacroOn) || mPhaseMarkerFound) mInstructionPhase = ptPHASE2ALU;
+			else mInstructionPhase = ptPHASE1ALU;
+			// check for alpha op in destination register which is OpParrams[0]
+			// if no Mask for destination then make it .rgba
+			if(mOpParrams[0].MaskRep == 0) mOpParrams[0].MaskRep =
+			GL_RED_BIT_ATI | GL_GREEN_BIT_ATI | GL_BLUE_BIT_ATI | ALPHA_BIT;
+			if (mOpParrams[0].MaskRep & ALPHA_BIT) {
+				mDo_Alpha = true;
+				mOpParrams[0].MaskRep -= ALPHA_BIT;
+				if(mOpParrams[0].MaskRep == 0) mOpType = mi_NOP; // only do alpha op
+			}
+			break;
+
+		case sid_TEXCRD:
+			mOpType = mi_PASSTEXCOORD;
+			if (mPhaseMarkerFound) mInstructionPhase = ptPHASE2TEX;
+			else mInstructionPhase = ptPHASE1TEX;
+			break;
+
+		case sid_TEXLD:
+			mOpType = mi_SAMPLEMAP;
+			if (mPhaseMarkerFound) mInstructionPhase = ptPHASE2TEX;
+			else mInstructionPhase = ptPHASE1TEX;
+			break;
+
+		case sid_TEX: // PS_1_1 emulation
+			mOpType = mi_TEX;
+			mInstructionPhase = ptPHASE1TEX;
+			break;
+
+		case sid_TEXCOORD: // PS_1_1 emulation
+			mOpType = mi_TEXCOORD;
+			mInstructionPhase = ptPHASE1TEX;
+			break;
+
+		case sid_TEXREG2AR:
+			passed = expandMacro(texreg2ar_MacroMods);
+			break;
+
+		case sid_TEXREG2GB:
+			passed = expandMacro(texreg2gb_MacroMods);
+			break;
+
+		case sid_TEXDP3:
+			passed = expandMacro(texdp3_MacroMods);
+			break;
+
+		case sid_TEXDP3TEX:
+			passed = expandMacro(texdp3tex_MacroMods);
+			break;
+
+		case sid_TEXM3X2PAD:
+			passed = expandMacro(texm3x2pad_MacroMods);
+			break;
+
+		case sid_TEXM3X2TEX:
+			passed = expandMacro(texm3x2tex_MacroMods);
+			break;
+
+		case sid_TEXM3X3PAD:
+			// only 2 texm3x3pad instructions allowed
+			// use count to modify macro to select which mask to use
+			if(mTexm3x3padCount<2) {
+				texm3x3pad[4].mID = sid_R + mTexm3x3padCount;
+				mTexm3x3padCount++;
+				passed = expandMacro(texm3x3pad_MacroMods);
+
+			}
+			else passed = false;
+
+			break;
+
+		case sid_TEXM3X3TEX:
+			passed = expandMacro(texm3x3tex_MacroMods);
+			break;
+
+		case sid_DEF:
+			mOpType = mi_SETCONSTANTS;
+			mInstructionPhase = ptPHASE1TEX;
+			break;
+
+		case sid_PHASE: // PS_1_4 only
+			mPhaseMarkerFound = true;
+			break;
+
+	} // end of switch
+
+	if(passed) passed = expandMachineInstruction();
+
+	return passed;
+}
+
+
+bool PS_1_4::expandMachineInstruction()
+{
+	// now push instructions onto MachineInstructions container
+	// assume that an instruction will be expanded
+	bool passed = true;
+
+	if (mOpType != mi_NOP) {
+
+		// a machine instruction will be built
+		// this is currently the last one being built so keep track of it
+		if (mInstructionPhase == ptPHASE2ALU) { 
+			mSecondLastInstructionPos = mLastInstructionPos;
+			mLastInstructionPos = mPhase2ALU_mi.size();
+		}
+
+
+		switch (mOpType) {
+			case mi_COLOROP1:
+			case mi_COLOROP2:
+			case mi_COLOROP3:
+				{
+					addMachineInst(mInstructionPhase, mOpType);
+					addMachineInst(mInstructionPhase, mSymbolTypeLib[mOpInst].mPass2Data);
+					// send all parameters to machine inst container
+					for(int i=0; i<=mArgCnt; i++) {
+						addMachineInst(mInstructionPhase, mOpParrams[i].Arg);
+						addMachineInst(mInstructionPhase, mOpParrams[i].MaskRep);
+						addMachineInst(mInstructionPhase, mOpParrams[i].Mod);
+						// check if source register read is valid in this phase
+						passed &= isRegisterReadValid(mInstructionPhase, i);
+					}
+
+					// record which registers were written to and in which phase
+					// mOpParrams[0].Arg is always the destination register r0 -> r5
+					updateRegisterWriteState(mInstructionPhase);
+
+				}
+				break;
+
+			case mi_SETCONSTANTS:
+				addMachineInst(mInstructionPhase, mOpType);
+				addMachineInst(mInstructionPhase, mOpParrams[0].Arg); // dst
+				addMachineInst(mInstructionPhase, mConstantsPos); // index into constants array
+				break;
+
+			case mi_PASSTEXCOORD:
+			case mi_SAMPLEMAP:
+				// if source is a temp register than place instruction in phase 2 Texture ops
+				if ((mOpParrams[1].Arg >= GL_REG_0_ATI) && (mOpParrams[1].Arg <= GL_REG_5_ATI)) {
+					mInstructionPhase = ptPHASE2TEX;
+				}
+
+				addMachineInst(mInstructionPhase, mOpType);
+				addMachineInst(mInstructionPhase, mOpParrams[0].Arg); // dst
+				addMachineInst(mInstructionPhase, mOpParrams[1].Arg); // coord
+				addMachineInst(mInstructionPhase, mOpParrams[1].MaskRep + GL_SWIZZLE_STR_ATI); // swizzle
+				// record which registers were written to and in which phase
+				// mOpParrams[0].Arg is always the destination register r0 -> r5
+				updateRegisterWriteState(mInstructionPhase);
+				break;
+
+			case mi_TEX: // PS_1_1 emulation - turn CISC into RISC - phase 1
+				addMachineInst(mInstructionPhase, mi_SAMPLEMAP);
+				addMachineInst(mInstructionPhase, mOpParrams[0].Arg); // dst
+				// tex tx becomes texld rx, tx with x: 0 - 3
+				addMachineInst(mInstructionPhase, mOpParrams[0].Arg - GL_REG_0_ATI + GL_TEXTURE0_ARB); // interp
+				// default to str which fills rgb of destination register
+				addMachineInst(mInstructionPhase, GL_SWIZZLE_STR_ATI); // swizzle
+				// record which registers were written to and in which phase
+				// mOpParrams[0].Arg is always the destination register r0 -> r5
+				updateRegisterWriteState(mInstructionPhase);
+				break;
+
+			case mi_TEXCOORD: // PS_1_1 emulation - turn CISC into RISC - phase 1
+				addMachineInst(mInstructionPhase, mi_PASSTEXCOORD);
+				addMachineInst(mInstructionPhase, mOpParrams[0].Arg); // dst
+				// texcoord tx becomes texcrd rx, tx with x: 0 - 3
+				addMachineInst(mInstructionPhase, mOpParrams[0].Arg - GL_REG_0_ATI + GL_TEXTURE0_ARB); // interp
+				// default to str which fills rgb of destination register
+				addMachineInst(mInstructionPhase, GL_SWIZZLE_STR_ATI); // swizzle
+				// record which registers were written to and in which phase
+				// mOpParrams[0].Arg is always the destination register r0 -> r5
+				updateRegisterWriteState(mInstructionPhase);
+				break;
+
+	
+
+
+		} // end of switch (mOpType)
+	} // end of if (mOpType != mi_NOP)
+
+	if(mDo_Alpha) {
+		// process alpha channel
+		//
+		// a scaler machine instruction will be built
+		// this is currently the last one being built so keep track of it
+		if (mInstructionPhase == ptPHASE2ALU) { 
+			mSecondLastInstructionPos = mLastInstructionPos;
+			mLastInstructionPos = mPhase2ALU_mi.size();
+		}
+
+		MachineInstID alphaoptype = (MachineInstID)(mi_ALPHAOP1 + mArgCnt - 1);
+		addMachineInst(mInstructionPhase, alphaoptype);
+		addMachineInst(mInstructionPhase, mSymbolTypeLib[mOpInst].mPass2Data);
+		// put all parameters in instruction que
+		for(int i=0; i<=mArgCnt; i++) {
+			addMachineInst(mInstructionPhase, mOpParrams[i].Arg);
+			// destination parameter has no mask since it is the alpha channel
+			// don't push mask for parrameter 0 (dst)
+			if(i>0) addMachineInst(mInstructionPhase, mOpParrams[i].MaskRep);
+			addMachineInst(mInstructionPhase, mOpParrams[i].Mod);
+			// check if source register read is valid in this phase
+			passed &= isRegisterReadValid(mInstructionPhase, i);
+		}
+
+		updateRegisterWriteState(mInstructionPhase);
+	}
+
+	// instruction passed on to machine instruction so clear the pipe
+	clearMachineInstState();
+
+	return passed;
+
+}
+
+
+void PS_1_4::updateRegisterWriteState(const PhaseType phase)
+{
+	int reg_offset = mOpParrams[0].Arg - GL_REG_0_ATI;
+
+	switch(phase) {
+
+		case ptPHASE1TEX:
+		case ptPHASE1ALU:
+			Phase_RegisterUsage[reg_offset].Phase1Write = true;
+			break;
+
+		case ptPHASE2TEX:
+		case ptPHASE2ALU:
+			Phase_RegisterUsage[reg_offset].Phase2Write = true;
+			break;
+
+	} // end switch(phase)
+
+}
+
+
+bool PS_1_4::isRegisterReadValid(const PhaseType phase, const int param)
+{
+	bool passed = true; // assume everything will go alright
+	// if in phase 2 ALU and argument is a source
+	if((phase == ptPHASE2ALU) && (param>0)) {
+		// is source argument a temp register r0 - r5?
+		if((mOpParrams[param].Arg >= GL_REG_0_ATI) && (mOpParrams[param].Arg <= GL_REG_5_ATI)) {
+			int reg_offset = mOpParrams[param].Arg - GL_REG_0_ATI;
+			// if register was not written to in phase 2 but was in phase 1
+			if((Phase_RegisterUsage[reg_offset].Phase2Write == false) && Phase_RegisterUsage[reg_offset].Phase1Write) {
+				// only perform register pass if there are ALU instructions in phase 1
+				
+				if(mPhase1ALU_mi.size() > 0) {
+					// build machine instructions for passing a register from phase 1 to phase 2
+					// NB: only rgb components of register will get passed
+
+					addMachineInst(ptPHASE2TEX, mi_PASSTEXCOORD);
+					addMachineInst(ptPHASE2TEX, mOpParrams[param].Arg); // dst
+					addMachineInst(ptPHASE2TEX, mOpParrams[param].Arg); // coord
+					addMachineInst(ptPHASE2TEX, GL_SWIZZLE_STR_ATI); // swizzle
+					// mark register as being written to
+					Phase_RegisterUsage[reg_offset].Phase2Write = true;
+				}
+
+			}
+			// register can not be used because it has not been written to previously
+			else passed = false;
+		}
+
+	}
+
+	return passed;
+
+}
+
+
+void PS_1_4::optimize()
+{
+	// perform some optimizations on ps.1.1 machine instructions
+	if (mActiveContexts & ckp_PS_1_1) {
+		// need to check last few instructions to make sure r0 is set
+		// ps.1.1 emulation uses r4 for r0 so last couple of instructions will probably require
+		// changine destination register back to r0
+		if (mLastInstructionPos < mPhase2ALU_mi.size()) {
+			// first argument at mLastInstructionPos + 2 is destination register for all ps.1.1 ALU instructions
+			mPhase2ALU_mi[mLastInstructionPos + 2] = GL_REG_0_ATI; 
+			// if was an alpha op only then modify second last instruction destination register
+			if ((mPhase2ALU_mi[mLastInstructionPos] == mi_ALPHAOP1) ||
+				(mPhase2ALU_mi[mLastInstructionPos] == mi_ALPHAOP2) ||
+				(mPhase2ALU_mi[mLastInstructionPos] == mi_ALPHAOP3)
+				
+				) {
+
+				mPhase2ALU_mi[mSecondLastInstructionPos + 2] = GL_REG_0_ATI; 
+			}
+
+		}// end if (mLastInstructionPos < mMachineInstructions.size())
+
+	}// end if (mActiveContexts & ckp_PS_1_1)
+
+}
+
+
+void PS_1_4::clearMachineInstState()
+{
+	// set current Machine Instruction State to baseline
+	mOpType = mi_NOP;
+	mOpInst = sid_INVALID;
+	mDo_Alpha = false;
+	mArgCnt = 0;
+
+	for(int i=0; i<MAXOPPARRAMS; i++) {
+		mOpParrams[i].Arg = GL_NONE;
+		mOpParrams[i].Filled = false;
+		mOpParrams[i].MaskRep = GL_NONE;
+		mOpParrams[i].Mod = GL_NONE;
+	}
+
+}
+
+
+void PS_1_4::clearAllMachineInst()
+{
+
+	mPhase1TEX_mi.clear();
+	mPhase1ALU_mi.clear();
+	mPhase2TEX_mi.clear();
+	mPhase2ALU_mi.clear();
+
+	// reset write state for all registers
+	for(int i = 0; i<6; i++) {
+		Phase_RegisterUsage[i].Phase1Write = false;
+		Phase_RegisterUsage[i].Phase2Write = false;
+
+	}
+
+	mPhaseMarkerFound = false;
+	mConstantsPos = -4;
+	// keep track of the last instruction built
+	// this info is used at the end of pass 2 to optimize the machine code
+	mLastInstructionPos = 0;
+	mSecondLastInstructionPos = 0;
+
+	mMacroOn = false;  // macro's off at the beginning
+	mTexm3x3padCount = 0;
+
+}
+
+bool PS_1_4::doPass2()
+{
+	clearAllMachineInst();
+	// if pass 2 was successful, optimize the machine instructions
+	bool passed = Pass2scan(&mTokenInstructions[0], mTokenInstructions.size());
+	if (passed) optimize();  
+
+	return passed;
+
+}
+
+
+bool PS_1_4::Pass2scan(const TokenInst * Tokens, const size_t size)
+{
+
+	// execute TokenInstructions to build MachineInstructions
+	bool passed = true;
+	SymbolDef* cursymboldef;
+	uint ActiveNTTRuleID;
+
+	clearMachineInstState();
+
+
+	// iterate through all the tokens and build machine instruction
+	// for each machine instruction need: optype, opinst, and up to 5 parameters
+	for(uint i = 0; i < size; i++) {
+		// lookup instruction type in library
+
+		cursymboldef = &mSymbolTypeLib[Tokens[i].mID];
+		ActiveNTTRuleID = Tokens[i].mNTTRuleID;
+		mCurrentLine = Tokens[i].mLine;
+		mCharPos = Tokens[i].mPos;
+
+		switch(ActiveNTTRuleID) {
+
+			case sid_CONSTANT:
+			case sid_COLOR:
+			case sid_REG_PS1_4:
+			case sid_TEX_PS1_4:
+			case sid_REG_PS1_1_3:
+			case sid_TEX_PS1_1_3:
+				// registars can be used for read and write so they can be used for dst and arg
+				passed = setOpParram(cursymboldef);
+				break;
+
+
+			case sid_DEFCONST:
+			case sid_UNARYOP:
+			case sid_BINARYOP:
+			case sid_TERNARYOP:
+			case sid_TEXOP_PS1_1_3:
+			case sid_TEXOP_PS1_4:
+			case sid_PHASEMARKER:
+			case sid_TEXCISCOP_PS1_1_3:
+				// if the last instruction has not been passed on then do it now
+				// make sure the pipe is clear for a new instruction
+				BuildMachineInst();
+				if(mOpInst == sid_INVALID) {
+					mOpInst = cursymboldef->mID;
+				}
+				else passed = false;
+				break;
+
+			case sid_DSTMASK:
+			case sid_SRCREP:
+			case sid_TEXSWIZZLE:
+				// could be a dst mask or a arg replicator
+				// if dst mask and alpha included then make up a alpha instruction: maybe best to wait until instruction args completed
+				mOpParrams[mArgCnt].MaskRep = cursymboldef->mPass2Data;
+				break;
+
+			case sid_DSTMOD:
+			case sid_DSTSAT:
+			case sid_PRESRCMOD:
+			case sid_POSTSRCMOD:
+				mOpParrams[mArgCnt].Mod |= cursymboldef->mPass2Data;
+				break;
+
+
+			case sid_NUMVAL:
+				passed = setOpParram(cursymboldef);
+				// keep track of how many values are used
+				// update Constants array position
+				mConstantsPos++;
+				break;
+
+			case sid_SEPERATOR:
+				mArgCnt++;
+				break;
+		} // end of switch
+
+		if(!passed) break;
+	}// end of for: i<TokenInstCnt
+
+	// check to see if there is still an instruction left in the pipe
+	if(passed) {
+		BuildMachineInst();
+		// if there are no more instructions in the pipe than OpInst should be invalid
+		if(mOpInst != sid_INVALID) passed = false;
+	}
+
+
+	return passed;
+}
+
+
+
+bool PS_1_4::setOpParram(const SymbolDef* symboldef)
+{
+  bool success = true;
+  if(mArgCnt<MAXOPPARRAMS) {
+    if(mOpParrams[mArgCnt].Filled) mArgCnt++;
+  }
+  if (mArgCnt<MAXOPPARRAMS) {
+    mOpParrams[mArgCnt].Filled = true;
+    mOpParrams[mArgCnt].Arg = symboldef->mPass2Data;
+  }
+  else success = false;
+
+  return success;
+}
+
+
+
+
+// *********************************************************************************
+//  this is where the tests are carried out to make sure the PS_1_4 compiler works
+
+#ifdef _DEBUG
+// check the functionality of functions in PS_1_4: each test will print to the output file PASSED of FAILED
+void PS_1_4::test()
+{
+  
+
+  struct test1result{
+    char character;
+    int line;
+  };
+
+  struct testfloatresult{
+    char *teststr;
+    float fvalue;
+    int charsize;
+  };
+
+  char TestStr1[] = "   \n\r  //c  \n\r// test\n\r  \t  c   - \n\r ,  e";
+  test1result test1results[] = {
+    {'c', 4},
+    {'-', 4},
+    {',', 5},
+    {'e', 5}
+  };
+
+  testfloatresult testfloatresults[] = {
+    {"1 test", 1.0f, 1},
+    {"2.3f test", 2.3f, 3},
+    {"-0.5 test", -0.5f, 4},
+    {" 23.6 test", 23.6f, 5},
+    {"  -0.021 test", -0.021f, 8},
+    {"12 test", 12.0f, 2},
+    {"3test", 3.0f, 1}
+  };
+
+
+
+  SymbolID test3result[] = { sid_MOV, sid_COMMA, sid_MUL, sid_ADD, sid_NEGATE, sid_T0
+  };
+
+  #define PART2INST 17
+  char TestStr3[] = "mov r0,c1";
+  char TestSymbols[] = "mov";
+  char passed[] = "PASSED\n";
+  char failed[] = "***** FAILED *****\n";
+
+  int resultID = 0;
+
+  // loop variable used in for loops
+  int i;
+  fp = fopen("ASMTests.txt", "wt");
+
+// **************************************************************
+  // first test: see if positionToNextSymbol can find a valid Symbol
+  fprintf(fp, "Testing: positionToNextSymbol\n");
+
+  mSource = TestStr1;
+  mCharPos = 0;
+  mCurrentLine = 1;
+  mEndOfSource = (int)strlen(mSource);
+  while (positionToNextSymbol()) {
+    fprintf(fp,"  character found: [%c]   Line:%d  : " , mSource[mCharPos], mCurrentLine);
+    if( (mSource[mCharPos] == test1results[resultID].character) && (mCurrentLine==test1results[resultID].line)) fprintf(fp, passed);
+    else fprintf(fp, failed);
+    resultID++;
+    mCharPos++;
+  }
+  fprintf(fp, "finished testing: positionToNextSymbol\n");
+
+
+// **************************************************************
+  // Second Test
+  // did the type lib get initialized properly with a default name index
+  fprintf(fp, "\nTesting: getTypeDefText\n");
+  char* resultstr = getTypeDefText(sid_MOV);
+  fprintf(fp, "  default name of mov is: [%s]: %s", resultstr, (strcmp("mov", resultstr)==0)?passed:failed);
+  fprintf(fp, "finished testing: getTypeDefText\n");
+
+// **************************************************************
+// **************************************************************
+  // fourth test - does isSymbol work correctly
+  fprintf(fp, "\nTesting: isSymbol\n");
+  mSource = TestStr3;
+  mCharPos = 0;
+  fprintf(fp, "  before: [%s]\n", mSource + mCharPos);
+  fprintf(fp, "  symbol to find: [%s]\n", TestSymbols);
+  if(isSymbol(TestSymbols, resultID)) {
+    fprintf(fp, "  after: [%s] : %s", mSource + resultID + 1, (mSource[resultID + 1] == 'r')? passed:failed);
+  }
+  else fprintf(fp, failed);
+  fprintf(fp,"  symbol size: %d\n", resultID);
+  fprintf(fp, "finished testing: isSymbol\n");
+
+// **************************************************************
+  fprintf(fp, "\nTesting: isFloatValue\n");
+  float fvalue = 0;
+  int charsize = 0;
+  char teststrfloat1[] = "1 test";
+  mCharPos = 0;
+  int testsize = ARRAYSIZE(testfloatresults);
+  for(i=0; i<testsize; i++) {
+    mSource = testfloatresults[i].teststr;
+    fprintf(fp, "  test string [%s]\n", mSource);
+    isFloatValue(fvalue, charsize);
+    fprintf(fp, "   value is: %f should be %f: %s", fvalue, testfloatresults[i].fvalue, (fvalue == testfloatresults[i].fvalue)?passed:failed);
+    fprintf(fp, "   char size is: %d should be %d: %s", charsize, testfloatresults[i].charsize, (charsize == testfloatresults[i].charsize)?passed:failed);
+  }
+
+  fprintf(fp, "finished testing: isFloatValue\n");
+
+
+// **************************************************************
+
+  // simple compile test:
+  char CompileTest1src[] = "ps.1.4\n";
+  SymbolID CompileTest1result[] = {sid_PS_1_4};
+
+  testCompile("Basic PS_1_4", CompileTest1src, CompileTest1result, ARRAYSIZE(CompileTest1result));
+
+// **************************************************************
+  char CompileTest2src[] = "ps.1.1\n";
+  SymbolID CompileTest2result[] = {sid_PS_1_1};
+
+  testCompile("Basic PS_1_1", CompileTest2src, CompileTest2result, ARRAYSIZE(CompileTest2result));
+
+// **************************************************************
+  char CompileTest3src[] = "ps.1.4\ndef c0, 1.0, 2.0, 3.0, 4.0\n";
+  SymbolID CompileTest3result[] = {sid_PS_1_4, sid_DEF, sid_C0, sid_COMMA, sid_VALUE, sid_COMMA,
+		sid_VALUE, sid_COMMA, sid_VALUE, sid_COMMA, sid_VALUE};
+
+  testCompile("PS_1_4 with defines", CompileTest3src, CompileTest3result, ARRAYSIZE(CompileTest3result));
+
+
+// **************************************************************
+  char CompileTest4src[] = "ps.1.4\n//test kkl \ndef c0, 1.0, 2.0, 3.0, 4.0\ndef c3, 1.0, 2.0, 3.0, 4.0\n";
+  SymbolID CompileTest4result[] = {sid_PS_1_4, sid_DEF, sid_C0, sid_COMMA, sid_VALUE, sid_COMMA,
+		sid_VALUE, sid_COMMA, sid_VALUE, sid_COMMA, sid_VALUE,sid_DEF, sid_C3, sid_COMMA, sid_VALUE, sid_COMMA,
+		sid_VALUE, sid_COMMA, sid_VALUE, sid_COMMA, sid_VALUE};
+
+  testCompile("PS_1_4 with 2 defines", CompileTest4src, CompileTest4result, ARRAYSIZE(CompileTest4result));
+
+// **************************************************************
+  char CompileTest5src[] = "ps.1.4\ndef c0, 1.0, 2.0, 3.0, 4.0\n";
+  SymbolID CompileTest5result[] = {sid_PS_1_4, sid_DEF, sid_C0, sid_COMMA, sid_VALUE, sid_COMMA,
+		sid_VALUE, sid_COMMA, sid_VALUE, sid_COMMA, sid_VALUE};
+  GLuint CompileTest5MachinInstResults[] = {mi_SETCONSTANTS, GL_CON_0_ATI, 0};
+
+  testCompile("PS_1_4 with defines", CompileTest3src, CompileTest3result, ARRAYSIZE(CompileTest3result), CompileTest5MachinInstResults, ARRAYSIZE(CompileTest5MachinInstResults));
+// **************************************************************
+  char CompileTest6Src[] = "ps.1.4\nmov r0.xzw, c1 \nmul r3, r2, c3";
+  SymbolID CompileTest6result[] = {sid_PS_1_4, sid_MOV, sid_R0, sid_RBA, sid_COMMA, sid_C1,
+	  sid_MUL, sid_R3, sid_COMMA, sid_R2, sid_COMMA, sid_C3};
+  
+  testCompile("PS_1_4 ALU simple", CompileTest6Src, CompileTest6result, ARRAYSIZE(CompileTest6result));
+
+// **************************************************************
+  // test to see if PS_1_4 compile pass 2 generates the proper machine instructions
+	char CompileTest7Src[] = "ps.1.4\ndef c0,1.0,2.0,3.0,4.0\nmov_x8 r1,v0\nmov r0,r1.g";
+
+	SymbolID CompileTest7result[] = {
+		sid_PS_1_4, sid_DEF, sid_C0, sid_COMMA, sid_VALUE, sid_COMMA,
+		sid_VALUE, sid_COMMA, sid_VALUE, sid_COMMA, sid_VALUE, sid_MOV, sid_X8, sid_R1, sid_COMMA,
+		sid_V0, sid_MOV, sid_R0, sid_COMMA, sid_R1, sid_GGGG
+	};
+
+	GLuint CompileTest7MachinInstResults[] = {
+		mi_SETCONSTANTS, GL_CON_0_ATI, 0,
+		mi_COLOROP1, GL_MOV_ATI, GL_REG_1_ATI, RGB_BITS, GL_8X_BIT_ATI,	GL_PRIMARY_COLOR_ARB, GL_NONE, GL_NONE,
+		mi_ALPHAOP1, GL_MOV_ATI, GL_REG_1_ATI, GL_8X_BIT_ATI, GL_PRIMARY_COLOR_ARB, GL_NONE, GL_NONE,
+		mi_COLOROP1, GL_MOV_ATI, GL_REG_0_ATI, RGB_BITS, GL_NONE,GL_REG_1_ATI, GL_GREEN, GL_NONE,
+		mi_ALPHAOP1, GL_MOV_ATI, GL_REG_0_ATI, GL_NONE, GL_REG_1_ATI, GL_GREEN, GL_NONE,
+	};
+
+
+	testCompile("PS_1_4 ALU simple modifier", CompileTest7Src, CompileTest7result, ARRAYSIZE(CompileTest7result), CompileTest7MachinInstResults, ARRAYSIZE(CompileTest7MachinInstResults));
+
+// **************************************************************
+// test to see if a PS_1_1 can be compiled - pass 1 and pass 2 are checked
+
+	char TestStr5[] = "ps.1.1\ndef c0,1.0,2.0,3.0,4.0\ntex t0\n// test\ntex t1\ndp3 t0.rgb, t0_bx2, t1_bx2\n+ mov r0,1 - t0";
+
+	SymbolID test5result[] = {
+		sid_PS_1_1, sid_DEF, sid_C0, sid_COMMA, sid_VALUE, sid_COMMA,
+		sid_VALUE, sid_COMMA, sid_VALUE, sid_COMMA, sid_VALUE, sid_TEX, sid_1T0, sid_TEX, sid_1T1,
+		sid_DP3, sid_1T0, sid_RGB, sid_COMMA, sid_1T0, sid_BX2, sid_COMMA, sid_1T1, sid_BX2,
+		
+		sid_PLUS, sid_MOV, sid_1R0, sid_COMMA, sid_INVERT, sid_1T0
+	};
+
+	GLuint test5MachinInstResults[] = {
+		mi_SETCONSTANTS, GL_CON_0_ATI, 0, mi_SAMPLEMAP, GL_REG_0_ATI, GL_TEXTURE0_ARB, GL_SWIZZLE_STR_ATI, mi_SAMPLEMAP, GL_REG_1_ATI, GL_TEXTURE1_ARB, GL_SWIZZLE_STR_ATI,
+		mi_COLOROP2, GL_DOT3_ATI, GL_REG_0_ATI, RGB_BITS, GL_NONE, GL_REG_0_ATI, GL_NONE, GL_2X_BIT_ATI | GL_BIAS_BIT_ATI,
+		GL_REG_1_ATI, GL_NONE, GL_2X_BIT_ATI | GL_BIAS_BIT_ATI,
+		mi_COLOROP1, GL_MOV_ATI, GL_REG_0_ATI, RGB_BITS, GL_NONE, GL_REG_0_ATI, GL_NONE, GL_COMP_BIT_ATI, mi_ALPHAOP1, GL_MOV_ATI, GL_REG_0_ATI,
+		GL_NONE, GL_REG_0_ATI, GL_NONE, GL_COMP_BIT_ATI,
+	};
+
+
+	testCompile("PS_1_1 Texture simple", TestStr5, test5result, ARRAYSIZE(test5result), test5MachinInstResults, ARRAYSIZE(test5MachinInstResults));
+
+
+// **************************************************************
+// test to see if a PS_1_2 CISC instructions can be compiled - pass 1 and pass 2 are checked
+
+	char TestStr6[] = "ps.1.2\ndef c0,1.0,2.0,3.0,4.0\ntex t0\n// test\ntexreg2ar t1, t0";
+
+	SymbolID test6result[] = {
+		sid_PS_1_2, sid_DEF, sid_C0, sid_COMMA, sid_VALUE, sid_COMMA,
+		sid_VALUE, sid_COMMA, sid_VALUE, sid_COMMA, sid_VALUE,
+		sid_TEX, sid_1T0,
+		sid_TEXREG2AR, sid_1T1, sid_COMMA, sid_1T0
+	};
+
+	GLuint test6MachinInstResults[] = {
+		// def c0
+		mi_SETCONSTANTS, GL_CON_0_ATI, 0,
+		// texld r0, t0.str
+		mi_SAMPLEMAP, GL_REG_0_ATI, GL_TEXTURE0_ARB, GL_SWIZZLE_STR_ATI,
+		// mov r1.r, r0.a 
+		mi_COLOROP1, GL_MOV_ATI, GL_REG_1_ATI, GL_RED_BIT_ATI, GL_NONE, GL_REG_0_ATI, GL_ALPHA, GL_NONE,
+		// mov r1.g, r0.r
+		mi_COLOROP1, GL_MOV_ATI, GL_REG_1_ATI, GL_GREEN_BIT_ATI, GL_NONE, GL_REG_0_ATI, GL_RED, GL_NONE,
+		// texld r1, r1
+		mi_SAMPLEMAP, GL_REG_1_ATI, GL_REG_1_ATI, GL_SWIZZLE_STR_ATI,
+	};
+
+
+	testCompile("PS_1_2 CISC instructions", TestStr6, test6result, ARRAYSIZE(test6result), test6MachinInstResults, ARRAYSIZE(test6MachinInstResults));
+
+// **************************************************************
+// test to see if a PS_1_4 two phase can be compiled - pass 1 and pass 2 are checked
+
+	char TestStr7[] = "ps.1.4\ndef c0,1.0,2.0,3.0,4.0\ntexld r0, t0\n// test\nmul r0, r0, c0\nphase\ntexld r1, r0\nmul r0,r0,r1\n";
+
+	SymbolID test7result[] = {
+		sid_PS_1_4,
+		// def c0,1.0,2.0,3.0,4.0
+		sid_DEF, sid_C0, sid_COMMA, sid_VALUE, sid_COMMA, sid_VALUE, sid_COMMA, sid_VALUE, sid_COMMA, sid_VALUE,
+		// texld r0, t0
+		sid_TEXLD, sid_R0, sid_COMMA, sid_T0,
+		// mul r0, r0, c0
+		sid_MUL, sid_R0, sid_COMMA, sid_R0, sid_COMMA, sid_C0,
+		// phase
+		sid_PHASE,
+		// texld r1, r0
+		sid_TEXLD, sid_R1, sid_COMMA, sid_R0,
+		// mul r0, r0, r1
+		sid_MUL, sid_R0, sid_COMMA, sid_R0, sid_COMMA, sid_R1,
+
+	};
+
+	GLuint test7MachinInstResults[] = {
+		// def c0
+		mi_SETCONSTANTS, GL_CON_0_ATI, 0,
+		// texld r0, t0.str
+		mi_SAMPLEMAP, GL_REG_0_ATI, GL_TEXTURE0_ARB, GL_SWIZZLE_STR_ATI,
+		// mul r0, r0, c0
+		mi_COLOROP2, GL_MUL_ATI, GL_REG_0_ATI, RGB_BITS, GL_NONE, GL_REG_0_ATI, GL_NONE, GL_NONE, GL_CON_0_ATI, GL_NONE, GL_NONE,
+		mi_ALPHAOP2, GL_MUL_ATI, GL_REG_0_ATI, GL_NONE, GL_REG_0_ATI, GL_NONE, GL_NONE, GL_CON_0_ATI, GL_NONE, GL_NONE,
+		// phase
+		// texld r1, r0.str
+		mi_SAMPLEMAP, GL_REG_1_ATI, GL_REG_0_ATI, GL_SWIZZLE_STR_ATI,
+		// pass ro register
+		mi_PASSTEXCOORD, GL_REG_0_ATI, GL_REG_0_ATI, GL_SWIZZLE_STR_ATI,
+		// mul r0, r0, r1
+		mi_COLOROP2, GL_MUL_ATI, GL_REG_0_ATI, RGB_BITS, GL_NONE, GL_REG_0_ATI, GL_NONE, GL_NONE, GL_REG_1_ATI, GL_NONE, GL_NONE,
+		// mul r0.a, r0
+		mi_ALPHAOP2, GL_MUL_ATI, GL_REG_0_ATI, GL_NONE, GL_REG_0_ATI, GL_NONE, GL_NONE, GL_REG_1_ATI, GL_NONE, GL_NONE,
+	};
+
+
+	testCompile("PS_1_4 texture complex : Phase - instructions", TestStr7, test7result, ARRAYSIZE(test7result), test7MachinInstResults, ARRAYSIZE(test7MachinInstResults));
+
+
+	fclose(fp);
+	fp = NULL;
+	//reset contexts
+
+// **************************************************************
+}
+
+void PS_1_4::testCompile(char* testname, char* teststr, SymbolID* testresult, uint testresultsize, GLuint* MachinInstResults, uint MachinInstResultsSize)
+{
+
+	char passed[] = "PASSED\n";
+	char failed[] = "***** FAILED ****\n";
+
+	setActiveContexts(ckp_PS_BASE);
+
+	fprintf(fp, "\n*** TESTING: %s Compile: Check Pass 1 and 2\n", testname);
+	fprintf(fp, "  source to compile:\n[\n%s\n]\n", teststr);
+	bool compiled = compile(teststr);
+	fprintf(fp, "  Pass 1 Lines scaned: %d, Tokens produced: %d out of %d: %s",
+		mCurrentLine, mTokenInstructions.size(), testresultsize,
+		(mTokenInstructions.size() == (uint)testresultsize) ? passed : failed);
+
+	fprintf(fp, "\n  Validating Pass 1:\n");
+
+	fprintf(fp, "\n  Tokens:\n");
+    uint i;
+	for(i = 0; i<(mTokenInstructions.size()); i++) {
+		fprintf(fp,"    Token[%d] [%s] %d: [%s] %d: %s", i, getTypeDefText(mTokenInstructions[i].mID),
+			mTokenInstructions[i].mID, getTypeDefText(testresult[i]), testresult[i],
+			(mTokenInstructions[i].mID == (uint)testresult[i]) ? passed : failed);
+	}
+
+	if(MachinInstResults != NULL) {
+		fprintf(fp, "\n  Machine Instructions:\n");
+
+		fprintf(fp, "  Pass 2 Machine Instructions generated: %d out of %d: %s", getMachineInstCount(),
+			MachinInstResultsSize, (getMachineInstCount() == MachinInstResultsSize) ? passed : failed);
+
+		size_t MIcount = getMachineInstCount();
+
+		fprintf(fp, "\n  Validating Pass 2:\n");
+		for(i = 0; i<MIcount; i++) {
+			fprintf(fp,"    instruction[%d] = 0x%x : 0x%x : %s", i, getMachineInst(i), MachinInstResults[i], (getMachineInst(i) == MachinInstResults[i]) ? passed : failed);
+		}
+
+		fprintf(fp, "\n  Constants:\n");
+		for(i=0; i<4; i++) {
+			fprintf(fp, "    Constants[%d] = %f : %s", i, mConstants[i], (mConstants[i] == (1.0f+i)) ? passed : failed);
+		}
+	}
+	if(!compiled) fprintf(fp, failed);
+
+	fprintf(fp, "\nfinished testing: %s Compile: Check Pass 2\n\n", testname);
+
+	setActiveContexts(ckp_PS_BASE);
+}
+
+void PS_1_4::testbinder()
+{
+  FILE* fp;
+  char BindTestStr[] = "mov_x8 r0,v0";
+  char passed[] = "PASSED\n";
+  char failed[] = "FAILED\n";
+  #define BinderInstCnt 8
+  GLuint BindMachinInst[BinderInstCnt] = {mi_COLOROP1, GL_MOV_ATI, GL_REG_0_ATI, GL_NONE, GL_8X_BIT_ATI,
+   GL_PRIMARY_COLOR_ARB, GL_NONE, GL_NONE};
+
+  fp = fopen("ASMTests.txt", "at");
+  fprintf(fp,"Testing: bindMachineInstToFragmentShader\n");
+  // fill Machin instruction container with predefined code
+  clearAllMachineInst();
+  for(int i=0; i<BinderInstCnt; i++) {
+    mPhase2ALU_mi.push_back(BindMachinInst[i]);
+  }
+  fprintf(fp,"bindMachineInstToFragmentShader succes: %s\n",bindAllMachineInstToFragmentShader()?passed:failed);
+  fprintf(fp,"finished testing: bindAllMachineInstToFragmentShader\n");
+  fclose(fp);
+}
+
+#endif
+
+
+
Index: /RenderSystems/GL/src/glew.cpp
===================================================================
--- /RenderSystems/GL/src/glew.cpp	(revision 5)
+++ /RenderSystems/GL/src/glew.cpp	(revision 5)
@@ -0,0 +1,2262 @@
+/*
+** The OpenGL Extension Wrangler Library
+** Copyright (C) 2002-2005, Milan Ikits <milan ikits[]ieee org>
+** Copyright (C) 2002-2005, Marcelo E. Magallon <mmagallo[]debian org>
+** Copyright (C) 2002, Lev Povalahev
+** All rights reserved.
+** 
+** Redistribution and use in source and binary forms, with or without 
+** modification, are permitted provided that the following conditions are met:
+** 
+** * Redistributions of source code must retain the above copyright notice, 
+**   this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright notice, 
+**   this list of conditions and the following disclaimer in the documentation 
+**   and/or other materials provided with the distribution.
+** * The name of the author may be used to endorse or promote products 
+**   derived from this software without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
+** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+** THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <GL/glew.h>
+
+#if defined(_WIN32)
+#include <GL/wglew.h>
+#endif
+
+#include "OgreGLSupport.h"
+/*
+ * Define glewGetContext and related helper macros.
+ */
+#ifdef GLEW_MX
+#  define glewGetContext() ctx
+#  ifdef _WIN32
+#    define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx
+#    define GLEW_CONTEXT_ARG_VAR_INIT ctx
+#    define wglewGetContext() ctx
+#    define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx
+#    define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx
+#  else /* _WIN32 */
+#    define GLEW_CONTEXT_ARG_DEF_INIT void
+#    define GLEW_CONTEXT_ARG_VAR_INIT
+#    define glxewGetContext() ctx
+#    define GLXEW_CONTEXT_ARG_DEF_INIT void
+#    define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx
+#  endif /* _WIN32 */
+#  define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx
+#else /* GLEW_MX */
+#  define GLEW_CONTEXT_ARG_DEF_INIT Ogre::GLSupport *glSupport
+#  define GLEW_CONTEXT_ARG_VAR_INIT glSupport
+#  define GLEW_CONTEXT_ARG_DEF_LIST Ogre::GLSupport *glSupport
+#  define WGLEW_CONTEXT_ARG_DEF_INIT Ogre::GLSupport *glSupport
+#  define WGLEW_CONTEXT_ARG_DEF_LIST Ogre::GLSupport *glSupport
+#  define GLXEW_CONTEXT_ARG_DEF_INIT void
+#  define GLXEW_CONTEXT_ARG_DEF_LIST void
+#endif /* GLEW_MX */
+
+/*
+ * GLEW, just like OpenGL or GLU, does not rely on the standard C library.
+ * These functions implement the functionality required in this file.
+ */
+
+static GLuint _glewStrLen (const GLubyte* s)
+{
+  GLuint i=0;
+  while (s+i != NULL && s[i] != '\0') i++;
+  return i;
+}
+
+static GLuint _glewStrCLen (const GLubyte* s, GLubyte c)
+{
+  GLuint i=0;
+  while (s+i != NULL && s[i] != '\0' && s[i] != c) i++;
+  return i;
+}
+
+static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n)
+{
+  GLuint i=0;
+  while (i < n && a+i != NULL && b+i != NULL && a[i] == b[i]) i++;
+  return i == n ? GL_TRUE : GL_FALSE;
+}
+
+static GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb)
+{
+  while (*na > 0 && (**a == ' ' || **a == '\n' || **a == '\r' || **a == '\t'))
+  {
+    (*a)++;
+    (*na)--;
+  }
+  if(*na >= nb)
+  {
+    GLuint i=0;
+    while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++;
+	if(i == nb)
+	{
+		*a = *a + nb;
+		*na = *na - nb;
+		return GL_TRUE;
+	}
+  }
+  return GL_FALSE;
+}
+
+static GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb)
+{
+  if(*na >= nb)
+  {
+    GLuint i=0;
+    while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++;
+	if(i == nb)
+	{
+		*a = *a + nb;
+		*na = *na - nb;
+		return GL_TRUE;
+	}
+  }
+  return GL_FALSE;
+}
+
+static GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb)
+{
+  if(*na >= nb)
+  {
+    GLuint i=0;
+    while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++;
+    if (i == nb && (*na == nb || (*a)[i] == ' ' || (*a)[i] == '\n' || (*a)[i] == '\r' || (*a)[i] == '\t'))
+    {
+      *a = *a + nb;
+      *na = *na - nb;
+      return GL_TRUE;
+    }
+  }
+  return GL_FALSE;
+}
+
+// Define procedure address
+#define glewGetProcAddress(name) glSupport->getProcAddress((const char*)(name))
+// Not experimental
+#define glewExperimental 0
+
+// Shut up MSVC compiler "inconsistent dll linkage" warning
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+#  pragma warning (disable : 4273)
+#endif
+
+#if !defined(_WIN32) || !defined(GLEW_MX)
+
+PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D = NULL;
+PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements = NULL;
+PFNGLTEXIMAGE3DPROC __glewTexImage3D = NULL;
+PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D = NULL;
+
+PFNGLACTIVETEXTUREPROC __glewActiveTexture = NULL;
+PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture = NULL;
+PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D = NULL;
+PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D = NULL;
+PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D = NULL;
+PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D = NULL;
+PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D = NULL;
+PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D = NULL;
+PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage = NULL;
+PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd = NULL;
+PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf = NULL;
+PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd = NULL;
+PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf = NULL;
+PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d = NULL;
+PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv = NULL;
+PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f = NULL;
+PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv = NULL;
+PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i = NULL;
+PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv = NULL;
+PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s = NULL;
+PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv = NULL;
+PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d = NULL;
+PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv = NULL;
+PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f = NULL;
+PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv = NULL;
+PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i = NULL;
+PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv = NULL;
+PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s = NULL;
+PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv = NULL;
+PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d = NULL;
+PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv = NULL;
+PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f = NULL;
+PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv = NULL;
+PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i = NULL;
+PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv = NULL;
+PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s = NULL;
+PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv = NULL;
+PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d = NULL;
+PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv = NULL;
+PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f = NULL;
+PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv = NULL;
+PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i = NULL;
+PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv = NULL;
+PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s = NULL;
+PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv = NULL;
+PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage = NULL;
+
+PFNGLBLENDCOLORPROC __glewBlendColor = NULL;
+PFNGLBLENDEQUATIONPROC __glewBlendEquation = NULL;
+PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate = NULL;
+PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer = NULL;
+PFNGLFOGCOORDDPROC __glewFogCoordd = NULL;
+PFNGLFOGCOORDDVPROC __glewFogCoorddv = NULL;
+PFNGLFOGCOORDFPROC __glewFogCoordf = NULL;
+PFNGLFOGCOORDFVPROC __glewFogCoordfv = NULL;
+PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays = NULL;
+PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements = NULL;
+PFNGLPOINTPARAMETERFPROC __glewPointParameterf = NULL;
+PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv = NULL;
+PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b = NULL;
+PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv = NULL;
+PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d = NULL;
+PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv = NULL;
+PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f = NULL;
+PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv = NULL;
+PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i = NULL;
+PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv = NULL;
+PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s = NULL;
+PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv = NULL;
+PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub = NULL;
+PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv = NULL;
+PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui = NULL;
+PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv = NULL;
+PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us = NULL;
+PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv = NULL;
+PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer = NULL;
+PFNGLWINDOWPOS2DPROC __glewWindowPos2d = NULL;
+PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv = NULL;
+PFNGLWINDOWPOS2FPROC __glewWindowPos2f = NULL;
+PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv = NULL;
+PFNGLWINDOWPOS2IPROC __glewWindowPos2i = NULL;
+PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv = NULL;
+PFNGLWINDOWPOS2SPROC __glewWindowPos2s = NULL;
+PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv = NULL;
+PFNGLWINDOWPOS3DPROC __glewWindowPos3d = NULL;
+PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv = NULL;
+PFNGLWINDOWPOS3FPROC __glewWindowPos3f = NULL;
+PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv = NULL;
+PFNGLWINDOWPOS3IPROC __glewWindowPos3i = NULL;
+PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv = NULL;
+PFNGLWINDOWPOS3SPROC __glewWindowPos3s = NULL;
+PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv = NULL;
+
+PFNGLBEGINQUERYPROC __glewBeginQuery = NULL;
+PFNGLBINDBUFFERPROC __glewBindBuffer = NULL;
+PFNGLBUFFERDATAPROC __glewBufferData = NULL;
+PFNGLBUFFERSUBDATAPROC __glewBufferSubData = NULL;
+PFNGLDELETEBUFFERSPROC __glewDeleteBuffers = NULL;
+PFNGLDELETEQUERIESPROC __glewDeleteQueries = NULL;
+PFNGLENDQUERYPROC __glewEndQuery = NULL;
+PFNGLGENBUFFERSPROC __glewGenBuffers = NULL;
+PFNGLGENQUERIESPROC __glewGenQueries = NULL;
+PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv = NULL;
+PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv = NULL;
+PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData = NULL;
+PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv = NULL;
+PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv = NULL;
+PFNGLGETQUERYIVPROC __glewGetQueryiv = NULL;
+PFNGLISBUFFERPROC __glewIsBuffer = NULL;
+PFNGLISQUERYPROC __glewIsQuery = NULL;
+PFNGLMAPBUFFERPROC __glewMapBuffer = NULL;
+PFNGLUNMAPBUFFERPROC __glewUnmapBuffer = NULL;
+
+PFNGLATTACHSHADERPROC __glewAttachShader = NULL;
+PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation = NULL;
+PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate = NULL;
+PFNGLCOMPILESHADERPROC __glewCompileShader = NULL;
+PFNGLCREATEPROGRAMPROC __glewCreateProgram = NULL;
+PFNGLCREATESHADERPROC __glewCreateShader = NULL;
+PFNGLDELETEPROGRAMPROC __glewDeleteProgram = NULL;
+PFNGLDELETESHADERPROC __glewDeleteShader = NULL;
+PFNGLDETACHSHADERPROC __glewDetachShader = NULL;
+PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray = NULL;
+PFNGLDRAWBUFFERSPROC __glewDrawBuffers = NULL;
+PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray = NULL;
+PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib = NULL;
+PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform = NULL;
+PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders = NULL;
+PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation = NULL;
+PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog = NULL;
+PFNGLGETPROGRAMIVPROC __glewGetProgramiv = NULL;
+PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog = NULL;
+PFNGLGETSHADERSOURCEPROC __glewGetShaderSource = NULL;
+PFNGLGETSHADERIVPROC __glewGetShaderiv = NULL;
+PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation = NULL;
+PFNGLGETUNIFORMFVPROC __glewGetUniformfv = NULL;
+PFNGLGETUNIFORMIVPROC __glewGetUniformiv = NULL;
+PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv = NULL;
+PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv = NULL;
+PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv = NULL;
+PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv = NULL;
+PFNGLISPROGRAMPROC __glewIsProgram = NULL;
+PFNGLISSHADERPROC __glewIsShader = NULL;
+PFNGLLINKPROGRAMPROC __glewLinkProgram = NULL;
+PFNGLSHADERSOURCEPROC __glewShaderSource = NULL;
+PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate = NULL;
+PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate = NULL;
+PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate = NULL;
+PFNGLUNIFORM1FPROC __glewUniform1f = NULL;
+PFNGLUNIFORM1FVPROC __glewUniform1fv = NULL;
+PFNGLUNIFORM1IPROC __glewUniform1i = NULL;
+PFNGLUNIFORM1IVPROC __glewUniform1iv = NULL;
+PFNGLUNIFORM2FPROC __glewUniform2f = NULL;
+PFNGLUNIFORM2FVPROC __glewUniform2fv = NULL;
+PFNGLUNIFORM2IPROC __glewUniform2i = NULL;
+PFNGLUNIFORM2IVPROC __glewUniform2iv = NULL;
+PFNGLUNIFORM3FPROC __glewUniform3f = NULL;
+PFNGLUNIFORM3FVPROC __glewUniform3fv = NULL;
+PFNGLUNIFORM3IPROC __glewUniform3i = NULL;
+PFNGLUNIFORM3IVPROC __glewUniform3iv = NULL;
+PFNGLUNIFORM4FPROC __glewUniform4f = NULL;
+PFNGLUNIFORM4FVPROC __glewUniform4fv = NULL;
+PFNGLUNIFORM4IPROC __glewUniform4i = NULL;
+PFNGLUNIFORM4IVPROC __glewUniform4iv = NULL;
+PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv = NULL;
+PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv = NULL;
+PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv = NULL;
+PFNGLUSEPROGRAMPROC __glewUseProgram = NULL;
+PFNGLVALIDATEPROGRAMPROC __glewValidateProgram = NULL;
+PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d = NULL;
+PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv = NULL;
+PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f = NULL;
+PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv = NULL;
+PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s = NULL;
+PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv = NULL;
+PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d = NULL;
+PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv = NULL;
+PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f = NULL;
+PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv = NULL;
+PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s = NULL;
+PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv = NULL;
+PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d = NULL;
+PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv = NULL;
+PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f = NULL;
+PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv = NULL;
+PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s = NULL;
+PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv = NULL;
+PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv = NULL;
+PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv = NULL;
+PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv = NULL;
+PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub = NULL;
+PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv = NULL;
+PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv = NULL;
+PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv = NULL;
+PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv = NULL;
+PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d = NULL;
+PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv = NULL;
+PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f = NULL;
+PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv = NULL;
+PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv = NULL;
+PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s = NULL;
+PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv = NULL;
+PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv = NULL;
+PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv = NULL;
+PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv = NULL;
+PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer = NULL;
+
+PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv = NULL;
+PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv = NULL;
+PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv = NULL;
+PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv = NULL;
+PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv = NULL;
+PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv = NULL;
+
+PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB = NULL;
+
+PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB = NULL;
+
+PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB = NULL;
+PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB = NULL;
+PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB = NULL;
+PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB = NULL;
+PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB = NULL;
+PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB = NULL;
+PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB = NULL;
+PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB = NULL;
+PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB = NULL;
+PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB = NULL;
+PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB = NULL;
+PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB = NULL;
+PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB = NULL;
+PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB = NULL;
+PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB = NULL;
+PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB = NULL;
+PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB = NULL;
+PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB = NULL;
+PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB = NULL;
+PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB = NULL;
+PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB = NULL;
+PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB = NULL;
+PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB = NULL;
+PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB = NULL;
+PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB = NULL;
+PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB = NULL;
+PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB = NULL;
+PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB = NULL;
+PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB = NULL;
+PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB = NULL;
+PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB = NULL;
+PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB = NULL;
+PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB = NULL;
+PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB = NULL;
+
+PFNGLBEGINQUERYARBPROC __glewBeginQueryARB = NULL;
+PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB = NULL;
+PFNGLENDQUERYARBPROC __glewEndQueryARB = NULL;
+PFNGLGENQUERIESARBPROC __glewGenQueriesARB = NULL;
+PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB = NULL;
+PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB = NULL;
+PFNGLGETQUERYIVARBPROC __glewGetQueryivARB = NULL;
+PFNGLISQUERYARBPROC __glewIsQueryARB = NULL;
+
+PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB = NULL;
+PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB = NULL;
+PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB = NULL;
+PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB = NULL;
+PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB = NULL;
+PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB = NULL;
+PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB = NULL;
+PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB = NULL;
+PFNGLGETHANDLEARBPROC __glewGetHandleARB = NULL;
+PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB = NULL;
+PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB = NULL;
+PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB = NULL;
+PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB = NULL;
+PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB = NULL;
+PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB = NULL;
+PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB = NULL;
+PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB = NULL;
+PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB = NULL;
+PFNGLUNIFORM1FARBPROC __glewUniform1fARB = NULL;
+PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB = NULL;
+PFNGLUNIFORM1IARBPROC __glewUniform1iARB = NULL;
+PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB = NULL;
+PFNGLUNIFORM2FARBPROC __glewUniform2fARB = NULL;
+PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB = NULL;
+PFNGLUNIFORM2IARBPROC __glewUniform2iARB = NULL;
+PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB = NULL;
+PFNGLUNIFORM3FARBPROC __glewUniform3fARB = NULL;
+PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB = NULL;
+PFNGLUNIFORM3IARBPROC __glewUniform3iARB = NULL;
+PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB = NULL;
+PFNGLUNIFORM4FARBPROC __glewUniform4fARB = NULL;
+PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB = NULL;
+PFNGLUNIFORM4IARBPROC __glewUniform4iARB = NULL;
+PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB = NULL;
+PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB = NULL;
+PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB = NULL;
+PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB = NULL;
+PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB = NULL;
+PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB = NULL;
+
+PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB = NULL;
+PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB = NULL;
+PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB = NULL;
+PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB = NULL;
+PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB = NULL;
+PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB = NULL;
+PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB = NULL;
+
+PFNGLBINDBUFFERARBPROC __glewBindBufferARB = NULL;
+PFNGLBUFFERDATAARBPROC __glewBufferDataARB = NULL;
+PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB = NULL;
+PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB = NULL;
+PFNGLGENBUFFERSARBPROC __glewGenBuffersARB = NULL;
+PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB = NULL;
+PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB = NULL;
+PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB = NULL;
+PFNGLISBUFFERARBPROC __glewIsBufferARB = NULL;
+PFNGLMAPBUFFERARBPROC __glewMapBufferARB = NULL;
+PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB = NULL;
+
+PFNGLBINDPROGRAMARBPROC __glewBindProgramARB = NULL;
+PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB = NULL;
+PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB = NULL;
+PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB = NULL;
+PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB = NULL;
+PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB = NULL;
+PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB = NULL;
+PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB = NULL;
+PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB = NULL;
+PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB = NULL;
+PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB = NULL;
+PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB = NULL;
+PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB = NULL;
+PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB = NULL;
+PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB = NULL;
+PFNGLISPROGRAMARBPROC __glewIsProgramARB = NULL;
+PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB = NULL;
+PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB = NULL;
+PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB = NULL;
+PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB = NULL;
+PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB = NULL;
+PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB = NULL;
+PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB = NULL;
+PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB = NULL;
+PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB = NULL;
+PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB = NULL;
+PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB = NULL;
+PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB = NULL;
+PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB = NULL;
+PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB = NULL;
+PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB = NULL;
+PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB = NULL;
+PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB = NULL;
+PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB = NULL;
+PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB = NULL;
+PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB = NULL;
+PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB = NULL;
+PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB = NULL;
+PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB = NULL;
+PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB = NULL;
+PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB = NULL;
+PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB = NULL;
+PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB = NULL;
+PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB = NULL;
+PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB = NULL;
+PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB = NULL;
+PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB = NULL;
+PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB = NULL;
+PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB = NULL;
+PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB = NULL;
+PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB = NULL;
+PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB = NULL;
+PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB = NULL;
+PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB = NULL;
+PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB = NULL;
+PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB = NULL;
+PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB = NULL;
+PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB = NULL;
+PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB = NULL;
+PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB = NULL;
+PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB = NULL;
+PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB = NULL;
+
+PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB = NULL;
+PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB = NULL;
+PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB = NULL;
+
+PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI = NULL;
+
+PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI = NULL;
+PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI = NULL;
+PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI = NULL;
+PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI = NULL;
+PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI = NULL;
+PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI = NULL;
+PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI = NULL;
+PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI = NULL;
+PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI = NULL;
+PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI = NULL;
+PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI = NULL;
+PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI = NULL;
+PFNGLSAMPLEMAPATIPROC __glewSampleMapATI = NULL;
+PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI = NULL;
+
+PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT = NULL;
+PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT = NULL;
+PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT = NULL;
+PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT = NULL;
+PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT = NULL;
+PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT = NULL;
+PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT = NULL;
+PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT = NULL;
+PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT = NULL;
+PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT = NULL;
+PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT = NULL;
+PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT = NULL;
+PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT = NULL;
+PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT = NULL;
+PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT = NULL;
+PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT = NULL;
+PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT = NULL;
+
+PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT = NULL;
+PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT = NULL;
+PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT = NULL;
+PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT = NULL;
+PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT = NULL;
+PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT = NULL;
+PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT = NULL;
+PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT = NULL;
+PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT = NULL;
+PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT = NULL;
+PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT = NULL;
+PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT = NULL;
+PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT = NULL;
+PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT = NULL;
+PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT = NULL;
+PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT = NULL;
+PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT = NULL;
+
+PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT = NULL;
+
+PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV = NULL;
+PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV = NULL;
+PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV = NULL;
+PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV = NULL;
+PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV = NULL;
+PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV = NULL;
+
+PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV = NULL;
+PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV = NULL;
+PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV = NULL;
+PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV = NULL;
+PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV = NULL;
+PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV = NULL;
+PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV = NULL;
+
+PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV = NULL;
+PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV = NULL;
+PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV = NULL;
+PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV = NULL;
+PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV = NULL;
+PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV = NULL;
+PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV = NULL;
+PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV = NULL;
+PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV = NULL;
+PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV = NULL;
+PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV = NULL;
+PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV = NULL;
+PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV = NULL;
+
+PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV = NULL;
+PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV = NULL;
+
+PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV = NULL;
+PFNGLBINDPROGRAMNVPROC __glewBindProgramNV = NULL;
+PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV = NULL;
+PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV = NULL;
+PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV = NULL;
+PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV = NULL;
+PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV = NULL;
+PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV = NULL;
+PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV = NULL;
+PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV = NULL;
+PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV = NULL;
+PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV = NULL;
+PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV = NULL;
+PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV = NULL;
+PFNGLISPROGRAMNVPROC __glewIsProgramNV = NULL;
+PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV = NULL;
+PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV = NULL;
+PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV = NULL;
+PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV = NULL;
+PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV = NULL;
+PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV = NULL;
+PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV = NULL;
+PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV = NULL;
+PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV = NULL;
+PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV = NULL;
+PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV = NULL;
+PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV = NULL;
+PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV = NULL;
+PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV = NULL;
+PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV = NULL;
+PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV = NULL;
+PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV = NULL;
+PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV = NULL;
+PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV = NULL;
+PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV = NULL;
+PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV = NULL;
+PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV = NULL;
+PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV = NULL;
+PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV = NULL;
+PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV = NULL;
+PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV = NULL;
+PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV = NULL;
+PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV = NULL;
+PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV = NULL;
+PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV = NULL;
+PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV = NULL;
+PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV = NULL;
+PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV = NULL;
+PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV = NULL;
+PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV = NULL;
+PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV = NULL;
+PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV = NULL;
+PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV = NULL;
+PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV = NULL;
+PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV = NULL;
+PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV = NULL;
+PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV = NULL;
+PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV = NULL;
+PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV = NULL;
+PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV = NULL;
+PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV = NULL;
+PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV = NULL;
+PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV = NULL;
+PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV = NULL;
+// SJS
+PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB = NULL;
+PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB = NULL;
+PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT = NULL;
+PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT = NULL;
+// SJS
+
+#endif /* !WIN32 || !GLEW_MX */
+
+#if !defined(GLEW_MX)
+
+GLboolean __GLEW_VERSION_1_1 = GL_FALSE;
+GLboolean __GLEW_VERSION_1_2 = GL_FALSE;
+GLboolean __GLEW_VERSION_1_3 = GL_FALSE;
+GLboolean __GLEW_VERSION_1_4 = GL_FALSE;
+GLboolean __GLEW_VERSION_1_5 = GL_FALSE;
+GLboolean __GLEW_VERSION_2_0 = GL_FALSE;
+GLboolean __GLEW_VERSION_2_1 = GL_FALSE;
+GLboolean __GLEW_ARB_draw_buffers = GL_FALSE;
+GLboolean __GLEW_ARB_fragment_program = GL_FALSE;
+GLboolean __GLEW_ARB_fragment_shader = GL_FALSE;
+GLboolean __GLEW_ARB_half_float_pixel = GL_FALSE;
+GLboolean __GLEW_ARB_multisample = GL_FALSE;
+GLboolean __GLEW_ARB_multitexture = GL_FALSE;
+GLboolean __GLEW_ARB_occlusion_query = GL_FALSE;
+GLboolean __GLEW_ARB_shader_objects = GL_FALSE;
+GLboolean __GLEW_ARB_shading_language_100 = GL_FALSE;
+GLboolean __GLEW_ARB_texture_compression = GL_FALSE;
+GLboolean __GLEW_ARB_texture_cube_map = GL_FALSE;
+GLboolean __GLEW_ARB_texture_env_combine = GL_FALSE;
+GLboolean __GLEW_ARB_texture_env_dot3 = GL_FALSE;
+GLboolean __GLEW_ARB_texture_float = GL_FALSE;
+GLboolean __GLEW_ARB_texture_non_power_of_two = GL_FALSE;
+GLboolean __GLEW_ARB_vertex_buffer_object = GL_FALSE;
+GLboolean __GLEW_ARB_vertex_program = GL_FALSE;
+GLboolean __GLEW_ARB_vertex_shader = GL_FALSE;
+GLboolean __GLEW_ATI_draw_buffers = GL_FALSE;
+GLboolean __GLEW_ATI_fragment_shader = GL_FALSE;
+GLboolean __GLEW_ATI_texture_float = GL_FALSE;
+GLboolean __GLEW_EXT_framebuffer_object = GL_FALSE;
+GLboolean __GLEW_EXT_pixel_buffer_object = GL_FALSE;
+GLboolean __GLEW_ARB_pixel_buffer_object = GL_FALSE;
+GLboolean __GLEW_EXT_secondary_color = GL_FALSE;
+GLboolean __GLEW_EXT_stencil_two_side = GL_FALSE;
+GLboolean __GLEW_EXT_stencil_wrap = GL_FALSE;
+GLboolean __GLEW_EXT_texture_compression_s3tc = GL_FALSE;
+GLboolean __GLEW_EXT_texture_cube_map = GL_FALSE;
+GLboolean __GLEW_EXT_texture_env_combine = GL_FALSE;
+GLboolean __GLEW_EXT_texture_env_dot3 = GL_FALSE;
+GLboolean __GLEW_EXT_texture_filter_anisotropic = GL_FALSE;
+GLboolean __GLEW_NV_fragment_program = GL_FALSE;
+GLboolean __GLEW_NV_fragment_program2 = GL_FALSE;
+GLboolean __GLEW_NV_fragment_program_option = GL_FALSE;
+GLboolean __GLEW_NV_occlusion_query = GL_FALSE;
+GLboolean __GLEW_NV_register_combiners = GL_FALSE;
+GLboolean __GLEW_NV_register_combiners2 = GL_FALSE;
+GLboolean __GLEW_NV_texture_compression_vtc = GL_FALSE;
+GLboolean __GLEW_NV_texture_shader = GL_FALSE;
+GLboolean __GLEW_NV_vertex_program = GL_FALSE;
+GLboolean __GLEW_NV_vertex_program2_option = GL_FALSE;
+GLboolean __GLEW_NV_vertex_program3 = GL_FALSE;
+GLboolean __GLEW_SGIS_generate_mipmap = GL_FALSE;
+// SJS changes for OGRE
+GLboolean __GLEW_EXT_point_sprite = GL_FALSE;
+GLboolean __GLEW_EXT_point_parameters = GL_FALSE;
+GLboolean __GLEW_ARB_point_parameters = GL_FALSE;
+GLboolean __GLEW_ARB_point_sprite = GL_FALSE;
+GLboolean __GLEW_EXT_texture_lod_bias = GL_FALSE;
+// End changes
+
+#endif /* !GLEW_MX */
+
+#ifdef GL_VERSION_1_2
+
+static GLboolean _glewInit_GL_VERSION_1_2 (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3D")) == NULL) || r;
+  r = ((glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElements")) == NULL) || r;
+  r = ((glTexImage3D = (PFNGLTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexImage3D")) == NULL) || r;
+  r = ((glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3D")) == NULL) || r;
+  
+  return r;
+}
+
+#endif /* GL_VERSION_1_2 */
+
+#ifdef GL_VERSION_1_3
+
+static GLboolean _glewInit_GL_VERSION_1_3 (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glActiveTexture = (PFNGLACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glActiveTexture")) == NULL) || r;
+  r = ((glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTexture")) == NULL) || r;
+  r = ((glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1D")) == NULL) || r;
+  r = ((glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2D")) == NULL) || r;
+  r = ((glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3D")) == NULL) || r;
+  r = ((glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1D")) == NULL) || r;
+  r = ((glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2D")) == NULL) || r;
+  r = ((glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3D")) == NULL) || r;
+  r = ((glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImage")) == NULL) || r;
+  r = ((glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixd")) == NULL) || r;
+  r = ((glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixf")) == NULL) || r;
+  r = ((glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixd")) == NULL) || r;
+  r = ((glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixf")) == NULL) || r;
+  r = ((glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1d")) == NULL) || r;
+  r = ((glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dv")) == NULL) || r;
+  r = ((glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1f")) == NULL) || r;
+  r = ((glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fv")) == NULL) || r;
+  r = ((glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1i")) == NULL) || r;
+  r = ((glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iv")) == NULL) || r;
+  r = ((glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1s")) == NULL) || r;
+  r = ((glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sv")) == NULL) || r;
+  r = ((glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2d")) == NULL) || r;
+  r = ((glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dv")) == NULL) || r;
+  r = ((glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2f")) == NULL) || r;
+  r = ((glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fv")) == NULL) || r;
+  r = ((glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2i")) == NULL) || r;
+  r = ((glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iv")) == NULL) || r;
+  r = ((glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2s")) == NULL) || r;
+  r = ((glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sv")) == NULL) || r;
+  r = ((glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3d")) == NULL) || r;
+  r = ((glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dv")) == NULL) || r;
+  r = ((glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3f")) == NULL) || r;
+  r = ((glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fv")) == NULL) || r;
+  r = ((glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3i")) == NULL) || r;
+  r = ((glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iv")) == NULL) || r;
+  r = ((glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3s")) == NULL) || r;
+  r = ((glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sv")) == NULL) || r;
+  r = ((glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4d")) == NULL) || r;
+  r = ((glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dv")) == NULL) || r;
+  r = ((glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4f")) == NULL) || r;
+  r = ((glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fv")) == NULL) || r;
+  r = ((glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4i")) == NULL) || r;
+  r = ((glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iv")) == NULL) || r;
+  r = ((glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4s")) == NULL) || r;
+  r = ((glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sv")) == NULL) || r;
+  r = ((glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverage")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_VERSION_1_3 */
+
+#ifdef GL_VERSION_1_4
+
+static GLboolean _glewInit_GL_VERSION_1_4 (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glBlendColor = (PFNGLBLENDCOLORPROC)glewGetProcAddress((const GLubyte*)"glBlendColor")) == NULL) || r;
+  r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r;
+  r = ((glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparate")) == NULL) || r;
+  r = ((glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointer")) == NULL) || r;
+  r = ((glFogCoordd = (PFNGLFOGCOORDDPROC)glewGetProcAddress((const GLubyte*)"glFogCoordd")) == NULL) || r;
+  r = ((glFogCoorddv = (PFNGLFOGCOORDDVPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddv")) == NULL) || r;
+  r = ((glFogCoordf = (PFNGLFOGCOORDFPROC)glewGetProcAddress((const GLubyte*)"glFogCoordf")) == NULL) || r;
+  r = ((glFogCoordfv = (PFNGLFOGCOORDFVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfv")) == NULL) || r;
+  r = ((glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArrays")) == NULL) || r;
+  r = ((glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElements")) == NULL) || r;
+  r = ((glPointParameterf = (PFNGLPOINTPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glPointParameterf")) == NULL) || r;
+  r = ((glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfv")) == NULL) || r;
+  r = ((glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3b")) == NULL) || r;
+  r = ((glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bv")) == NULL) || r;
+  r = ((glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3d")) == NULL) || r;
+  r = ((glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dv")) == NULL) || r;
+  r = ((glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3f")) == NULL) || r;
+  r = ((glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fv")) == NULL) || r;
+  r = ((glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3i")) == NULL) || r;
+  r = ((glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iv")) == NULL) || r;
+  r = ((glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3s")) == NULL) || r;
+  r = ((glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sv")) == NULL) || r;
+  r = ((glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ub")) == NULL) || r;
+  r = ((glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubv")) == NULL) || r;
+  r = ((glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ui")) == NULL) || r;
+  r = ((glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiv")) == NULL) || r;
+  r = ((glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3us")) == NULL) || r;
+  r = ((glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usv")) == NULL) || r;
+  r = ((glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointer")) == NULL) || r;
+  r = ((glWindowPos2d = (PFNGLWINDOWPOS2DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2d")) == NULL) || r;
+  r = ((glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dv")) == NULL) || r;
+  r = ((glWindowPos2f = (PFNGLWINDOWPOS2FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2f")) == NULL) || r;
+  r = ((glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fv")) == NULL) || r;
+  r = ((glWindowPos2i = (PFNGLWINDOWPOS2IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2i")) == NULL) || r;
+  r = ((glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iv")) == NULL) || r;
+  r = ((glWindowPos2s = (PFNGLWINDOWPOS2SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2s")) == NULL) || r;
+  r = ((glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sv")) == NULL) || r;
+  r = ((glWindowPos3d = (PFNGLWINDOWPOS3DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3d")) == NULL) || r;
+  r = ((glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dv")) == NULL) || r;
+  r = ((glWindowPos3f = (PFNGLWINDOWPOS3FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3f")) == NULL) || r;
+  r = ((glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fv")) == NULL) || r;
+  r = ((glWindowPos3i = (PFNGLWINDOWPOS3IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3i")) == NULL) || r;
+  r = ((glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iv")) == NULL) || r;
+  r = ((glWindowPos3s = (PFNGLWINDOWPOS3SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3s")) == NULL) || r;
+  r = ((glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sv")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_VERSION_1_4 */
+
+#ifdef GL_VERSION_1_5
+
+static GLboolean _glewInit_GL_VERSION_1_5 (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glBeginQuery = (PFNGLBEGINQUERYPROC)glewGetProcAddress((const GLubyte*)"glBeginQuery")) == NULL) || r;
+  r = ((glBindBuffer = (PFNGLBINDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindBuffer")) == NULL) || r;
+  r = ((glBufferData = (PFNGLBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferData")) == NULL) || r;
+  r = ((glBufferSubData = (PFNGLBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferSubData")) == NULL) || r;
+  r = ((glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffers")) == NULL) || r;
+  r = ((glDeleteQueries = (PFNGLDELETEQUERIESPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueries")) == NULL) || r;
+  r = ((glEndQuery = (PFNGLENDQUERYPROC)glewGetProcAddress((const GLubyte*)"glEndQuery")) == NULL) || r;
+  r = ((glGenBuffers = (PFNGLGENBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenBuffers")) == NULL) || r;
+  r = ((glGenQueries = (PFNGLGENQUERIESPROC)glewGetProcAddress((const GLubyte*)"glGenQueries")) == NULL) || r;
+  r = ((glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteriv")) == NULL) || r;
+  r = ((glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointerv")) == NULL) || r;
+  r = ((glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubData")) == NULL) || r;
+  r = ((glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectiv")) == NULL) || r;
+  r = ((glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuiv")) == NULL) || r;
+  r = ((glGetQueryiv = (PFNGLGETQUERYIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryiv")) == NULL) || r;
+  r = ((glIsBuffer = (PFNGLISBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsBuffer")) == NULL) || r;
+  r = ((glIsQuery = (PFNGLISQUERYPROC)glewGetProcAddress((const GLubyte*)"glIsQuery")) == NULL) || r;
+  r = ((glMapBuffer = (PFNGLMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glMapBuffer")) == NULL) || r;
+  r = ((glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glUnmapBuffer")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_VERSION_1_5 */
+
+#ifdef GL_VERSION_2_0
+
+static GLboolean _glewInit_GL_VERSION_2_0 (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glAttachShader = (PFNGLATTACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glAttachShader")) == NULL) || r;
+  r = ((glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocation")) == NULL) || r;
+  r = ((glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparate")) == NULL) || r;
+  r = ((glCompileShader = (PFNGLCOMPILESHADERPROC)glewGetProcAddress((const GLubyte*)"glCompileShader")) == NULL) || r;
+  r = ((glCreateProgram = (PFNGLCREATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glCreateProgram")) == NULL) || r;
+  r = ((glCreateShader = (PFNGLCREATESHADERPROC)glewGetProcAddress((const GLubyte*)"glCreateShader")) == NULL) || r;
+  r = ((glDeleteProgram = (PFNGLDELETEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgram")) == NULL) || r;
+  r = ((glDeleteShader = (PFNGLDELETESHADERPROC)glewGetProcAddress((const GLubyte*)"glDeleteShader")) == NULL) || r;
+  r = ((glDetachShader = (PFNGLDETACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glDetachShader")) == NULL) || r;
+  r = ((glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArray")) == NULL) || r;
+  r = ((glDrawBuffers = (PFNGLDRAWBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffers")) == NULL) || r;
+  r = ((glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArray")) == NULL) || r;
+  r = ((glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttrib")) == NULL) || r;
+  r = ((glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniform")) == NULL) || r;
+  r = ((glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedShaders")) == NULL) || r;
+  r = ((glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocation")) == NULL) || r;
+  r = ((glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInfoLog")) == NULL) || r;
+  r = ((glGetProgramiv = (PFNGLGETPROGRAMIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramiv")) == NULL) || r;
+  r = ((glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetShaderInfoLog")) == NULL) || r;
+  r = ((glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSource")) == NULL) || r;
+  r = ((glGetShaderiv = (PFNGLGETSHADERIVPROC)glewGetProcAddress((const GLubyte*)"glGetShaderiv")) == NULL) || r;
+  r = ((glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocation")) == NULL) || r;
+  r = ((glGetUniformfv = (PFNGLGETUNIFORMFVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfv")) == NULL) || r;
+  r = ((glGetUniformiv = (PFNGLGETUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformiv")) == NULL) || r;
+  r = ((glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointerv")) == NULL) || r;
+  r = ((glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdv")) == NULL) || r;
+  r = ((glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfv")) == NULL) || r;
+  r = ((glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribiv")) == NULL) || r;
+  r = ((glIsProgram = (PFNGLISPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glIsProgram")) == NULL) || r;
+  r = ((glIsShader = (PFNGLISSHADERPROC)glewGetProcAddress((const GLubyte*)"glIsShader")) == NULL) || r;
+  r = ((glLinkProgram = (PFNGLLINKPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glLinkProgram")) == NULL) || r;
+  r = ((glShaderSource = (PFNGLSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glShaderSource")) == NULL) || r;
+  r = ((glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparate")) == NULL) || r;
+  r = ((glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilMaskSeparate")) == NULL) || r;
+  r = ((glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparate")) == NULL) || r;
+  r = ((glUniform1f = (PFNGLUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glUniform1f")) == NULL) || r;
+  r = ((glUniform1fv = (PFNGLUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glUniform1fv")) == NULL) || r;
+  r = ((glUniform1i = (PFNGLUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glUniform1i")) == NULL) || r;
+  r = ((glUniform1iv = (PFNGLUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glUniform1iv")) == NULL) || r;
+  r = ((glUniform2f = (PFNGLUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glUniform2f")) == NULL) || r;
+  r = ((glUniform2fv = (PFNGLUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glUniform2fv")) == NULL) || r;
+  r = ((glUniform2i = (PFNGLUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glUniform2i")) == NULL) || r;
+  r = ((glUniform2iv = (PFNGLUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glUniform2iv")) == NULL) || r;
+  r = ((glUniform3f = (PFNGLUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glUniform3f")) == NULL) || r;
+  r = ((glUniform3fv = (PFNGLUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glUniform3fv")) == NULL) || r;
+  r = ((glUniform3i = (PFNGLUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glUniform3i")) == NULL) || r;
+  r = ((glUniform3iv = (PFNGLUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glUniform3iv")) == NULL) || r;
+  r = ((glUniform4f = (PFNGLUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glUniform4f")) == NULL) || r;
+  r = ((glUniform4fv = (PFNGLUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glUniform4fv")) == NULL) || r;
+  r = ((glUniform4i = (PFNGLUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glUniform4i")) == NULL) || r;
+  r = ((glUniform4iv = (PFNGLUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glUniform4iv")) == NULL) || r;
+  r = ((glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fv")) == NULL) || r;
+  r = ((glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fv")) == NULL) || r;
+  r = ((glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fv")) == NULL) || r;
+  r = ((glUseProgram = (PFNGLUSEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glUseProgram")) == NULL) || r;
+  r = ((glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glValidateProgram")) == NULL) || r;
+  r = ((glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1d")) == NULL) || r;
+  r = ((glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dv")) == NULL) || r;
+  r = ((glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1f")) == NULL) || r;
+  r = ((glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fv")) == NULL) || r;
+  r = ((glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1s")) == NULL) || r;
+  r = ((glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sv")) == NULL) || r;
+  r = ((glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2d")) == NULL) || r;
+  r = ((glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dv")) == NULL) || r;
+  r = ((glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2f")) == NULL) || r;
+  r = ((glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fv")) == NULL) || r;
+  r = ((glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2s")) == NULL) || r;
+  r = ((glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sv")) == NULL) || r;
+  r = ((glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3d")) == NULL) || r;
+  r = ((glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dv")) == NULL) || r;
+  r = ((glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3f")) == NULL) || r;
+  r = ((glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fv")) == NULL) || r;
+  r = ((glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3s")) == NULL) || r;
+  r = ((glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sv")) == NULL) || r;
+  r = ((glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nbv")) == NULL) || r;
+  r = ((glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Niv")) == NULL) || r;
+  r = ((glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nsv")) == NULL) || r;
+  r = ((glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nub")) == NULL) || r;
+  r = ((glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nubv")) == NULL) || r;
+  r = ((glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nuiv")) == NULL) || r;
+  r = ((glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nusv")) == NULL) || r;
+  r = ((glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bv")) == NULL) || r;
+  r = ((glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4d")) == NULL) || r;
+  r = ((glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dv")) == NULL) || r;
+  r = ((glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4f")) == NULL) || r;
+  r = ((glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fv")) == NULL) || r;
+  r = ((glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4iv")) == NULL) || r;
+  r = ((glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4s")) == NULL) || r;
+  r = ((glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sv")) == NULL) || r;
+  r = ((glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubv")) == NULL) || r;
+  r = ((glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uiv")) == NULL) || r;
+  r = ((glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usv")) == NULL) || r;
+  r = ((glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointer")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_VERSION_2_0 */
+
+#ifdef GL_VERSION_2_1
+
+static GLboolean _glewInit_GL_VERSION_2_1 (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3fv")) == NULL) || r;
+  r = ((glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2fv")) == NULL) || r;
+  r = ((glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4fv")) == NULL) || r;
+  r = ((glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2fv")) == NULL) || r;
+  r = ((glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4fv")) == NULL) || r;
+  r = ((glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3fv")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_VERSION_2_1 */
+
+#ifdef GL_ARB_draw_buffers
+
+static GLboolean _glewInit_GL_ARB_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersARB")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_ARB_draw_buffers */
+
+#ifdef GL_ARB_fragment_program
+
+#endif /* GL_ARB_fragment_program */
+
+#ifdef GL_ARB_fragment_shader
+
+#endif /* GL_ARB_fragment_shader */
+
+#ifdef GL_ARB_half_float_pixel
+
+#endif /* GL_ARB_half_float_pixel */
+
+#ifdef GL_ARB_multisample
+
+static GLboolean _glewInit_GL_ARB_multisample (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverageARB")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_ARB_multisample */
+
+#ifdef GL_ARB_multitexture
+
+static GLboolean _glewInit_GL_ARB_multitexture (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glActiveTextureARB")) == NULL) || r;
+  r = ((glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTextureARB")) == NULL) || r;
+  r = ((glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dARB")) == NULL) || r;
+  r = ((glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dvARB")) == NULL) || r;
+  r = ((glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fARB")) == NULL) || r;
+  r = ((glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fvARB")) == NULL) || r;
+  r = ((glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iARB")) == NULL) || r;
+  r = ((glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1ivARB")) == NULL) || r;
+  r = ((glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sARB")) == NULL) || r;
+  r = ((glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1svARB")) == NULL) || r;
+  r = ((glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dARB")) == NULL) || r;
+  r = ((glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dvARB")) == NULL) || r;
+  r = ((glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fARB")) == NULL) || r;
+  r = ((glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fvARB")) == NULL) || r;
+  r = ((glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iARB")) == NULL) || r;
+  r = ((glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2ivARB")) == NULL) || r;
+  r = ((glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sARB")) == NULL) || r;
+  r = ((glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2svARB")) == NULL) || r;
+  r = ((glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dARB")) == NULL) || r;
+  r = ((glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dvARB")) == NULL) || r;
+  r = ((glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fARB")) == NULL) || r;
+  r = ((glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fvARB")) == NULL) || r;
+  r = ((glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iARB")) == NULL) || r;
+  r = ((glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3ivARB")) == NULL) || r;
+  r = ((glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sARB")) == NULL) || r;
+  r = ((glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3svARB")) == NULL) || r;
+  r = ((glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dARB")) == NULL) || r;
+  r = ((glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dvARB")) == NULL) || r;
+  r = ((glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fARB")) == NULL) || r;
+  r = ((glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fvARB")) == NULL) || r;
+  r = ((glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iARB")) == NULL) || r;
+  r = ((glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4ivARB")) == NULL) || r;
+  r = ((glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sARB")) == NULL) || r;
+  r = ((glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4svARB")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_ARB_multitexture */
+
+#ifdef GL_ARB_occlusion_query
+
+static GLboolean _glewInit_GL_ARB_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryARB")) == NULL) || r;
+  r = ((glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueriesARB")) == NULL) || r;
+  r = ((glEndQueryARB = (PFNGLENDQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glEndQueryARB")) == NULL) || r;
+  r = ((glGenQueriesARB = (PFNGLGENQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glGenQueriesARB")) == NULL) || r;
+  r = ((glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectivARB")) == NULL) || r;
+  r = ((glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuivARB")) == NULL) || r;
+  r = ((glGetQueryivARB = (PFNGLGETQUERYIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryivARB")) == NULL) || r;
+  r = ((glIsQueryARB = (PFNGLISQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glIsQueryARB")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_ARB_occlusion_query */
+
+#ifdef GL_ARB_shader_objects
+
+static GLboolean _glewInit_GL_ARB_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glAttachObjectARB")) == NULL) || r;
+  r = ((glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderARB")) == NULL) || r;
+  r = ((glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateProgramObjectARB")) == NULL) || r;
+  r = ((glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderObjectARB")) == NULL) || r;
+  r = ((glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteObjectARB")) == NULL) || r;
+  r = ((glDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDetachObjectARB")) == NULL) || r;
+  r = ((glGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformARB")) == NULL) || r;
+  r = ((glGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedObjectsARB")) == NULL) || r;
+  r = ((glGetHandleARB = (PFNGLGETHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetHandleARB")) == NULL) || r;
+  r = ((glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetInfoLogARB")) == NULL) || r;
+  r = ((glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterfvARB")) == NULL) || r;
+  r = ((glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivARB")) == NULL) || r;
+  r = ((glGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSourceARB")) == NULL) || r;
+  r = ((glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocationARB")) == NULL) || r;
+  r = ((glGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfvARB")) == NULL) || r;
+  r = ((glGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformivARB")) == NULL) || r;
+  r = ((glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glLinkProgramARB")) == NULL) || r;
+  r = ((glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glShaderSourceARB")) == NULL) || r;
+  r = ((glUniform1fARB = (PFNGLUNIFORM1FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fARB")) == NULL) || r;
+  r = ((glUniform1fvARB = (PFNGLUNIFORM1FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fvARB")) == NULL) || r;
+  r = ((glUniform1iARB = (PFNGLUNIFORM1IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1iARB")) == NULL) || r;
+  r = ((glUniform1ivARB = (PFNGLUNIFORM1IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ivARB")) == NULL) || r;
+  r = ((glUniform2fARB = (PFNGLUNIFORM2FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fARB")) == NULL) || r;
+  r = ((glUniform2fvARB = (PFNGLUNIFORM2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fvARB")) == NULL) || r;
+  r = ((glUniform2iARB = (PFNGLUNIFORM2IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2iARB")) == NULL) || r;
+  r = ((glUniform2ivARB = (PFNGLUNIFORM2IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ivARB")) == NULL) || r;
+  r = ((glUniform3fARB = (PFNGLUNIFORM3FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fARB")) == NULL) || r;
+  r = ((glUniform3fvARB = (PFNGLUNIFORM3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fvARB")) == NULL) || r;
+  r = ((glUniform3iARB = (PFNGLUNIFORM3IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3iARB")) == NULL) || r;
+  r = ((glUniform3ivARB = (PFNGLUNIFORM3IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ivARB")) == NULL) || r;
+  r = ((glUniform4fARB = (PFNGLUNIFORM4FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fARB")) == NULL) || r;
+  r = ((glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fvARB")) == NULL) || r;
+  r = ((glUniform4iARB = (PFNGLUNIFORM4IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4iARB")) == NULL) || r;
+  r = ((glUniform4ivARB = (PFNGLUNIFORM4IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ivARB")) == NULL) || r;
+  r = ((glUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fvARB")) == NULL) || r;
+  r = ((glUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fvARB")) == NULL) || r;
+  r = ((glUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fvARB")) == NULL) || r;
+  r = ((glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glUseProgramObjectARB")) == NULL) || r;
+  r = ((glValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramARB")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_ARB_shader_objects */
+
+#ifdef GL_ARB_shading_language_100
+
+#endif /* GL_ARB_shading_language_100 */
+
+#ifdef GL_ARB_texture_compression
+
+static GLboolean _glewInit_GL_ARB_texture_compression (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1DARB")) == NULL) || r;
+  r = ((glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2DARB")) == NULL) || r;
+  r = ((glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3DARB")) == NULL) || r;
+  r = ((glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1DARB")) == NULL) || r;
+  r = ((glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2DARB")) == NULL) || r;
+  r = ((glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3DARB")) == NULL) || r;
+  r = ((glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImageARB")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_ARB_texture_compression */
+
+#ifdef GL_ARB_texture_cube_map
+
+#endif /* GL_ARB_texture_cube_map */
+
+#ifdef GL_ARB_texture_env_combine
+
+#endif /* GL_ARB_texture_env_combine */
+
+#ifdef GL_ARB_texture_env_dot3
+
+#endif /* GL_ARB_texture_env_dot3 */
+
+#ifdef GL_ARB_texture_float
+
+#endif /* GL_ARB_texture_float */
+
+#ifdef GL_ARB_texture_non_power_of_two
+
+#endif /* GL_ARB_texture_non_power_of_two */
+
+#ifdef GL_ARB_vertex_buffer_object
+
+static GLboolean _glewInit_GL_ARB_vertex_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glBindBufferARB = (PFNGLBINDBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glBindBufferARB")) == NULL) || r;
+  r = ((glBufferDataARB = (PFNGLBUFFERDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferDataARB")) == NULL) || r;
+  r = ((glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferSubDataARB")) == NULL) || r;
+  r = ((glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffersARB")) == NULL) || r;
+  r = ((glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glGenBuffersARB")) == NULL) || r;
+  r = ((glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterivARB")) == NULL) || r;
+  r = ((glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointervARB")) == NULL) || r;
+  r = ((glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubDataARB")) == NULL) || r;
+  r = ((glIsBufferARB = (PFNGLISBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glIsBufferARB")) == NULL) || r;
+  r = ((glMapBufferARB = (PFNGLMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glMapBufferARB")) == NULL) || r;
+  r = ((glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glUnmapBufferARB")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_ARB_vertex_buffer_object */
+
+#ifdef GL_ARB_vertex_program
+
+static GLboolean _glewInit_GL_ARB_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glBindProgramARB")) == NULL) || r;
+  r = ((glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsARB")) == NULL) || r;
+  r = ((glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArrayARB")) == NULL) || r;
+  r = ((glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArrayARB")) == NULL) || r;
+  r = ((glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsARB")) == NULL) || r;
+  r = ((glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterdvARB")) == NULL) || r;
+  r = ((glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterfvARB")) == NULL) || r;
+  r = ((glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterdvARB")) == NULL) || r;
+  r = ((glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterfvARB")) == NULL) || r;
+  r = ((glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringARB")) == NULL) || r;
+  r = ((glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivARB")) == NULL) || r;
+  r = ((glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervARB")) == NULL) || r;
+  r = ((glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvARB")) == NULL) || r;
+  r = ((glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvARB")) == NULL) || r;
+  r = ((glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivARB")) == NULL) || r;
+  r = ((glIsProgramARB = (PFNGLISPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glIsProgramARB")) == NULL) || r;
+  r = ((glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dARB")) == NULL) || r;
+  r = ((glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dvARB")) == NULL) || r;
+  r = ((glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fARB")) == NULL) || r;
+  r = ((glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fvARB")) == NULL) || r;
+  r = ((glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dARB")) == NULL) || r;
+  r = ((glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dvARB")) == NULL) || r;
+  r = ((glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fARB")) == NULL) || r;
+  r = ((glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fvARB")) == NULL) || r;
+  r = ((glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glProgramStringARB")) == NULL) || r;
+  r = ((glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dARB")) == NULL) || r;
+  r = ((glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvARB")) == NULL) || r;
+  r = ((glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fARB")) == NULL) || r;
+  r = ((glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvARB")) == NULL) || r;
+  r = ((glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sARB")) == NULL) || r;
+  r = ((glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svARB")) == NULL) || r;
+  r = ((glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dARB")) == NULL) || r;
+  r = ((glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvARB")) == NULL) || r;
+  r = ((glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fARB")) == NULL) || r;
+  r = ((glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvARB")) == NULL) || r;
+  r = ((glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sARB")) == NULL) || r;
+  r = ((glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svARB")) == NULL) || r;
+  r = ((glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dARB")) == NULL) || r;
+  r = ((glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvARB")) == NULL) || r;
+  r = ((glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fARB")) == NULL) || r;
+  r = ((glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvARB")) == NULL) || r;
+  r = ((glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sARB")) == NULL) || r;
+  r = ((glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svARB")) == NULL) || r;
+  r = ((glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NbvARB")) == NULL) || r;
+  r = ((glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NivARB")) == NULL) || r;
+  r = ((glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NsvARB")) == NULL) || r;
+  r = ((glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubARB")) == NULL) || r;
+  r = ((glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubvARB")) == NULL) || r;
+  r = ((glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NuivARB")) == NULL) || r;
+  r = ((glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NusvARB")) == NULL) || r;
+  r = ((glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bvARB")) == NULL) || r;
+  r = ((glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dARB")) == NULL) || r;
+  r = ((glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvARB")) == NULL) || r;
+  r = ((glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fARB")) == NULL) || r;
+  r = ((glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvARB")) == NULL) || r;
+  r = ((glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ivARB")) == NULL) || r;
+  r = ((glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sARB")) == NULL) || r;
+  r = ((glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svARB")) == NULL) || r;
+  r = ((glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvARB")) == NULL) || r;
+  r = ((glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uivARB")) == NULL) || r;
+  r = ((glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usvARB")) == NULL) || r;
+  r = ((glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerARB")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_ARB_vertex_program */
+
+#ifdef GL_ARB_vertex_shader
+
+static GLboolean _glewInit_GL_ARB_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocationARB")) == NULL) || r;
+  r = ((glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttribARB")) == NULL) || r;
+  r = ((glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocationARB")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_ARB_vertex_shader */
+
+#ifdef GL_ATI_draw_buffers
+
+static GLboolean _glewInit_GL_ATI_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersATI")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_ATI_draw_buffers */
+
+#ifdef GL_ATI_fragment_shader
+
+static GLboolean _glewInit_GL_ATI_fragment_shader (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp1ATI")) == NULL) || r;
+  r = ((glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp2ATI")) == NULL) || r;
+  r = ((glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp3ATI")) == NULL) || r;
+  r = ((glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBeginFragmentShaderATI")) == NULL) || r;
+  r = ((glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBindFragmentShaderATI")) == NULL) || r;
+  r = ((glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp1ATI")) == NULL) || r;
+  r = ((glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp2ATI")) == NULL) || r;
+  r = ((glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp3ATI")) == NULL) || r;
+  r = ((glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glDeleteFragmentShaderATI")) == NULL) || r;
+  r = ((glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glEndFragmentShaderATI")) == NULL) || r;
+  r = ((glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)glewGetProcAddress((const GLubyte*)"glGenFragmentShadersATI")) == NULL) || r;
+  r = ((glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)glewGetProcAddress((const GLubyte*)"glPassTexCoordATI")) == NULL) || r;
+  r = ((glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)glewGetProcAddress((const GLubyte*)"glSampleMapATI")) == NULL) || r;
+  r = ((glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)glewGetProcAddress((const GLubyte*)"glSetFragmentShaderConstantATI")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_ATI_fragment_shader */
+
+#ifdef GL_ATI_texture_float
+
+#endif /* GL_ATI_texture_float */
+
+#ifdef GL_EXT_framebuffer_object
+
+static GLboolean _glewInit_GL_EXT_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindFramebufferEXT")) == NULL) || r;
+  r = ((glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbufferEXT")) == NULL) || r;
+  r = ((glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatusEXT")) == NULL) || r;
+  r = ((glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffersEXT")) == NULL) || r;
+  r = ((glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffersEXT")) == NULL) || r;
+  r = ((glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbufferEXT")) == NULL) || r;
+  r = ((glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1DEXT")) == NULL) || r;
+  r = ((glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2DEXT")) == NULL) || r;
+  r = ((glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3DEXT")) == NULL) || r;
+  r = ((glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffersEXT")) == NULL) || r;
+  r = ((glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffersEXT")) == NULL) || r;
+  r = ((glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmapEXT")) == NULL) || r;
+  r = ((glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameterivEXT")) == NULL) || r;
+  r = ((glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameterivEXT")) == NULL) || r;
+  r = ((glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsFramebufferEXT")) == NULL) || r;
+  r = ((glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbufferEXT")) == NULL) || r;
+  r = ((glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageEXT")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_EXT_framebuffer_object */
+
+#ifdef GL_EXT_secondary_color
+
+static GLboolean _glewInit_GL_EXT_secondary_color (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bEXT")) == NULL) || r;
+  r = ((glSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bvEXT")) == NULL) || r;
+  r = ((glSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dEXT")) == NULL) || r;
+  r = ((glSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dvEXT")) == NULL) || r;
+  r = ((glSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fEXT")) == NULL) || r;
+  r = ((glSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fvEXT")) == NULL) || r;
+  r = ((glSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iEXT")) == NULL) || r;
+  r = ((glSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ivEXT")) == NULL) || r;
+  r = ((glSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sEXT")) == NULL) || r;
+  r = ((glSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3svEXT")) == NULL) || r;
+  r = ((glSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubEXT")) == NULL) || r;
+  r = ((glSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubvEXT")) == NULL) || r;
+  r = ((glSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiEXT")) == NULL) || r;
+  r = ((glSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uivEXT")) == NULL) || r;
+  r = ((glSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usEXT")) == NULL) || r;
+  r = ((glSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usvEXT")) == NULL) || r;
+  r = ((glSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerEXT")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_EXT_secondary_color */
+
+#ifdef GL_EXT_stencil_two_side
+
+static GLboolean _glewInit_GL_EXT_stencil_two_side (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveStencilFaceEXT")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_EXT_stencil_two_side */
+
+#ifdef GL_EXT_stencil_wrap
+
+#endif /* GL_EXT_stencil_wrap */
+
+#ifdef GL_EXT_texture_compression_s3tc
+
+#endif /* GL_EXT_texture_compression_s3tc */
+
+#ifdef GL_EXT_texture_cube_map
+
+#endif /* GL_EXT_texture_cube_map */
+
+#ifdef GL_EXT_texture_env_combine
+
+#endif /* GL_EXT_texture_env_combine */
+
+#ifdef GL_EXT_texture_env_dot3
+
+#endif /* GL_EXT_texture_env_dot3 */
+
+#ifdef GL_EXT_texture_filter_anisotropic
+
+#endif /* GL_EXT_texture_filter_anisotropic */
+
+#ifdef GL_NV_fragment_program
+
+static GLboolean _glewInit_GL_NV_fragment_program (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterdvNV")) == NULL) || r;
+  r = ((glGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterfvNV")) == NULL) || r;
+  r = ((glProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dNV")) == NULL) || r;
+  r = ((glProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dvNV")) == NULL) || r;
+  r = ((glProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fNV")) == NULL) || r;
+  r = ((glProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fvNV")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_NV_fragment_program */
+
+#ifdef GL_NV_fragment_program2
+
+#endif /* GL_NV_fragment_program2 */
+
+#ifdef GL_NV_fragment_program_option
+
+#endif /* GL_NV_fragment_program_option */
+
+#ifdef GL_NV_occlusion_query
+
+static GLboolean _glewInit_GL_NV_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glBeginOcclusionQueryNV")) == NULL) || r;
+  r = ((glDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteOcclusionQueriesNV")) == NULL) || r;
+  r = ((glEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glEndOcclusionQueryNV")) == NULL) || r;
+  r = ((glGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glGenOcclusionQueriesNV")) == NULL) || r;
+  r = ((glGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryivNV")) == NULL) || r;
+  r = ((glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryuivNV")) == NULL) || r;
+  r = ((glIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glIsOcclusionQueryNV")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_NV_occlusion_query */
+
+#ifdef GL_NV_register_combiners
+
+static GLboolean _glewInit_GL_NV_register_combiners (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerInputNV")) == NULL) || r;
+  r = ((glCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerOutputNV")) == NULL) || r;
+  r = ((glCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfNV")) == NULL) || r;
+  r = ((glCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfvNV")) == NULL) || r;
+  r = ((glCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameteriNV")) == NULL) || r;
+  r = ((glCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterivNV")) == NULL) || r;
+  r = ((glFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glFinalCombinerInputNV")) == NULL) || r;
+  r = ((glGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterfvNV")) == NULL) || r;
+  r = ((glGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterivNV")) == NULL) || r;
+  r = ((glGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterfvNV")) == NULL) || r;
+  r = ((glGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterivNV")) == NULL) || r;
+  r = ((glGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterfvNV")) == NULL) || r;
+  r = ((glGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterivNV")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_NV_register_combiners */
+
+#ifdef GL_NV_register_combiners2
+
+static GLboolean _glewInit_GL_NV_register_combiners2 (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerStageParameterfvNV")) == NULL) || r;
+  r = ((glGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerStageParameterfvNV")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_NV_register_combiners2 */
+
+#ifdef GL_NV_texture_compression_vtc
+
+#endif /* GL_NV_texture_compression_vtc */
+
+#ifdef GL_NV_texture_shader
+
+#endif /* GL_NV_texture_shader */
+
+#ifdef GL_NV_vertex_program
+
+static GLboolean _glewInit_GL_NV_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((glAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glAreProgramsResidentNV")) == NULL) || r;
+  r = ((glBindProgramNV = (PFNGLBINDPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glBindProgramNV")) == NULL) || r;
+  r = ((glDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsNV")) == NULL) || r;
+  r = ((glExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glExecuteProgramNV")) == NULL) || r;
+  r = ((glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsNV")) == NULL) || r;
+  r = ((glGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterdvNV")) == NULL) || r;
+  r = ((glGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterfvNV")) == NULL) || r;
+  r = ((glGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringNV")) == NULL) || r;
+  r = ((glGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivNV")) == NULL) || r;
+  r = ((glGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetTrackMatrixivNV")) == NULL) || r;
+  r = ((glGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervNV")) == NULL) || r;
+  r = ((glGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvNV")) == NULL) || r;
+  r = ((glGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvNV")) == NULL) || r;
+  r = ((glGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivNV")) == NULL) || r;
+  r = ((glIsProgramNV = (PFNGLISPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glIsProgramNV")) == NULL) || r;
+  r = ((glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glLoadProgramNV")) == NULL) || r;
+  r = ((glProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dNV")) == NULL) || r;
+  r = ((glProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dvNV")) == NULL) || r;
+  r = ((glProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fNV")) == NULL) || r;
+  r = ((glProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fvNV")) == NULL) || r;
+  r = ((glProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4dvNV")) == NULL) || r;
+  r = ((glProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4fvNV")) == NULL) || r;
+  r = ((glRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glRequestResidentProgramsNV")) == NULL) || r;
+  r = ((glTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC)glewGetProcAddress((const GLubyte*)"glTrackMatrixNV")) == NULL) || r;
+  r = ((glVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dNV")) == NULL) || r;
+  r = ((glVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvNV")) == NULL) || r;
+  r = ((glVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fNV")) == NULL) || r;
+  r = ((glVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvNV")) == NULL) || r;
+  r = ((glVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sNV")) == NULL) || r;
+  r = ((glVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svNV")) == NULL) || r;
+  r = ((glVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dNV")) == NULL) || r;
+  r = ((glVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvNV")) == NULL) || r;
+  r = ((glVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fNV")) == NULL) || r;
+  r = ((glVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvNV")) == NULL) || r;
+  r = ((glVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sNV")) == NULL) || r;
+  r = ((glVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svNV")) == NULL) || r;
+  r = ((glVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dNV")) == NULL) || r;
+  r = ((glVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvNV")) == NULL) || r;
+  r = ((glVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fNV")) == NULL) || r;
+  r = ((glVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvNV")) == NULL) || r;
+  r = ((glVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sNV")) == NULL) || r;
+  r = ((glVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svNV")) == NULL) || r;
+  r = ((glVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dNV")) == NULL) || r;
+  r = ((glVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvNV")) == NULL) || r;
+  r = ((glVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fNV")) == NULL) || r;
+  r = ((glVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvNV")) == NULL) || r;
+  r = ((glVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sNV")) == NULL) || r;
+  r = ((glVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svNV")) == NULL) || r;
+  r = ((glVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubNV")) == NULL) || r;
+  r = ((glVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvNV")) == NULL) || r;
+  r = ((glVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerNV")) == NULL) || r;
+  r = ((glVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1dvNV")) == NULL) || r;
+  r = ((glVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1fvNV")) == NULL) || r;
+  r = ((glVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1svNV")) == NULL) || r;
+  r = ((glVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2dvNV")) == NULL) || r;
+  r = ((glVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2fvNV")) == NULL) || r;
+  r = ((glVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2svNV")) == NULL) || r;
+  r = ((glVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3dvNV")) == NULL) || r;
+  r = ((glVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3fvNV")) == NULL) || r;
+  r = ((glVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3svNV")) == NULL) || r;
+  r = ((glVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4dvNV")) == NULL) || r;
+  r = ((glVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4fvNV")) == NULL) || r;
+  r = ((glVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4svNV")) == NULL) || r;
+  r = ((glVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4ubvNV")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* GL_NV_vertex_program */
+
+#ifdef GL_NV_vertex_program2_option
+
+#endif /* GL_NV_vertex_program2_option */
+
+#ifdef GL_NV_vertex_program3
+
+#endif /* GL_NV_vertex_program3 */
+
+#ifdef GL_SGIS_generate_mipmap
+
+#endif /* GL_SGIS_generate_mipmap */
+
+// Begin SJS change for OGRE
+#ifdef GL_ARB_point_parameters
+static GLboolean _glewInit_GL_ARB_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+	GLboolean r = GL_FALSE;
+
+	r = ((glPointParameterfARB = (PFNGLPOINTPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfARB")) == NULL) || r;
+	r = ((glPointParameterfvARB = (PFNGLPOINTPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvARB")) == NULL) || r;
+	// For convenience, if GL 1.4 not defined, assign same to non-ARB version since interface identical
+	if (!GLEW_VERSION_1_4)
+	{
+		glPointParameterf = glPointParameterfARB;
+		glPointParameterfv = glPointParameterfvARB;
+	}
+
+	return r;
+}
+#endif /* GL_ARB_point_parameters */
+
+#ifdef GL_EXT_point_parameters
+static GLboolean _glewInit_GL_EXT_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+	GLboolean r = GL_FALSE;
+
+	r = ((glPointParameterfEXT = (PFNGLPOINTPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfEXT")) == NULL) || r;
+	r = ((glPointParameterfvEXT = (PFNGLPOINTPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvEXT")) == NULL) || r;
+	// For convenience, if GL 1.4 not defined, assign same to non-EXT version since interface identical
+	if (!GLEW_VERSION_1_4)
+	{
+		glPointParameterf = glPointParameterfEXT;
+		glPointParameterfv = glPointParameterfvEXT;
+	}
+
+	return r;
+}
+#endif /* GL_EXT_point_parameters */
+
+// End SJS change for OGRE
+
+
+/* ------------------------------------------------------------------------- */
+
+/* 
+ * Search for name in the extensions string. Use of strstr()
+ * is not sufficient because extension names can be prefixes of
+ * other extension names. Could use strtok() but the constant
+ * string returned by glGetString might be in read-only memory.
+ */
+GLboolean glewGetExtension (const char* name)
+{    
+  GLubyte* p;
+  GLubyte* end;
+  GLuint len = _glewStrLen((const GLubyte*)name);
+  p = (GLubyte*)glGetString(GL_EXTENSIONS);
+  if (0 == p) return GL_FALSE;
+  end = p + _glewStrLen(p);
+  while (p < end)
+  {
+    GLuint n = _glewStrCLen(p, ' ');
+    if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE;
+    p += n+1;
+  }
+  return GL_FALSE;
+}
+
+/* ------------------------------------------------------------------------- */
+
+GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
+{
+  const GLubyte* s;
+  GLuint major, minor;
+  /* check for SiS driver */
+  s = glGetString(GL_RENDERER);
+  if (s && _glewStrSame(s,(const GLubyte*)"SiS",3))
+  {
+	  GLEW_VERSION_1_1 = GL_TRUE;
+      GLEW_VERSION_1_2 = GL_FALSE;
+      GLEW_VERSION_1_3 = GL_FALSE;
+      GLEW_VERSION_1_4 = GL_FALSE;
+      GLEW_VERSION_1_5 = GL_FALSE;
+      GLEW_VERSION_2_0 = GL_FALSE;
+      GLEW_VERSION_2_1 = GL_FALSE;
+  }
+  else
+  {
+	/* query opengl version */
+	s = glGetString(GL_VERSION);
+	if (!s) return GLEW_ERROR_NO_GL_VERSION;
+	major = _glewStrCLen(s, '.')-1;
+	minor = _glewStrCLen(s, '.')+1;
+  	if (s+major == NULL
+	  || s+minor-1 == NULL || s+minor == NULL
+	  || (s[major] == 1 && s[minor] < '1'))
+	{
+	  return GLEW_ERROR_GL_VERSION_10_ONLY;
+	}
+	else
+	{
+	  if (s[major] >= '2')
+	  {
+		GLEW_VERSION_1_1 = GL_TRUE;
+		GLEW_VERSION_1_2 = GL_TRUE;
+		GLEW_VERSION_1_3 = GL_TRUE;
+		GLEW_VERSION_1_4 = GL_TRUE;
+		GLEW_VERSION_1_5 = GL_TRUE;
+		GLEW_VERSION_2_0 = GL_TRUE;
+        if (s[minor] >= '1')
+        {
+          GLEW_VERSION_2_1 = GL_TRUE;
+        }
+        else
+        {
+          GLEW_VERSION_2_1 = GL_FALSE;
+        }
+	  }
+	  else
+	  {
+		if (s[minor] >= '5')
+		{
+		  GLEW_VERSION_1_1 = GL_TRUE;
+		  GLEW_VERSION_1_2 = GL_TRUE;
+		  GLEW_VERSION_1_3 = GL_TRUE;
+		  GLEW_VERSION_1_4 = GL_TRUE;
+		  GLEW_VERSION_1_5 = GL_TRUE;
+		  GLEW_VERSION_2_0 = GL_FALSE;
+          GLEW_VERSION_2_1 = GL_FALSE;
+		}
+	    if (s[minor] == '4')
+		{
+		  GLEW_VERSION_1_1 = GL_TRUE;
+		  GLEW_VERSION_1_2 = GL_TRUE;
+		  GLEW_VERSION_1_3 = GL_TRUE;
+		  GLEW_VERSION_1_4 = GL_TRUE;
+		  GLEW_VERSION_1_5 = GL_FALSE;
+		  GLEW_VERSION_2_0 = GL_FALSE;
+          GLEW_VERSION_2_1 = GL_FALSE;
+		}
+		if (s[minor] == '3')
+		{
+		  GLEW_VERSION_1_1 = GL_TRUE;
+		  GLEW_VERSION_1_2 = GL_TRUE;
+		  GLEW_VERSION_1_3 = GL_TRUE;
+		  GLEW_VERSION_1_4 = GL_FALSE;
+		  GLEW_VERSION_1_5 = GL_FALSE;
+		  GLEW_VERSION_2_0 = GL_FALSE;
+          GLEW_VERSION_2_1 = GL_FALSE;
+		}
+		if (s[minor] == '2')
+		{
+		  GLEW_VERSION_1_1 = GL_TRUE;
+		  GLEW_VERSION_1_2 = GL_TRUE;
+		  GLEW_VERSION_1_3 = GL_FALSE;
+		  GLEW_VERSION_1_4 = GL_FALSE;
+		  GLEW_VERSION_1_5 = GL_FALSE;
+		  GLEW_VERSION_2_0 = GL_FALSE;
+          GLEW_VERSION_2_1 = GL_FALSE;
+		}
+		if (s[minor] < '2')
+		{
+		  GLEW_VERSION_1_1 = GL_TRUE;
+		  GLEW_VERSION_1_2 = GL_FALSE;
+		  GLEW_VERSION_1_3 = GL_FALSE;
+		  GLEW_VERSION_1_4 = GL_FALSE;
+		  GLEW_VERSION_1_5 = GL_FALSE;
+		  GLEW_VERSION_2_0 = GL_FALSE;
+          GLEW_VERSION_2_1 = GL_FALSE;
+		}
+	  }
+	}
+  }
+  /* initialize extensions */
+#ifdef GL_VERSION_1_2
+  if (glewExperimental || GLEW_VERSION_1_2) GLEW_VERSION_1_2 = !_glewInit_GL_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_VERSION_1_2 */
+#ifdef GL_VERSION_1_3
+  if (glewExperimental || GLEW_VERSION_1_3) GLEW_VERSION_1_3 = !_glewInit_GL_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_VERSION_1_3 */
+#ifdef GL_VERSION_1_4
+  if (glewExperimental || GLEW_VERSION_1_4) GLEW_VERSION_1_4 = !_glewInit_GL_VERSION_1_4(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_VERSION_1_4 */
+#ifdef GL_VERSION_1_5
+  if (glewExperimental || GLEW_VERSION_1_5) GLEW_VERSION_1_5 = !_glewInit_GL_VERSION_1_5(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_VERSION_1_5 */
+#ifdef GL_VERSION_2_0
+  if (glewExperimental || GLEW_VERSION_2_0) GLEW_VERSION_2_0 = !_glewInit_GL_VERSION_2_0(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_VERSION_2_0 */
+#ifdef GL_VERSION_2_1
+  if (glewExperimental || GLEW_VERSION_2_1) GLEW_VERSION_2_1 = !_glewInit_GL_VERSION_2_1(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_VERSION_2_1 */
+#ifdef GL_ARB_draw_buffers
+  GLEW_ARB_draw_buffers = glewGetExtension("GL_ARB_draw_buffers");
+  if (glewExperimental || GLEW_ARB_draw_buffers) GLEW_ARB_draw_buffers = !_glewInit_GL_ARB_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ARB_draw_buffers */
+#ifdef GL_ARB_fragment_program
+  GLEW_ARB_fragment_program = glewGetExtension("GL_ARB_fragment_program");
+#endif /* GL_ARB_fragment_program */
+#ifdef GL_ARB_fragment_shader
+  GLEW_ARB_fragment_shader = glewGetExtension("GL_ARB_fragment_shader");
+#endif /* GL_ARB_fragment_shader */
+#ifdef GL_ARB_half_float_pixel
+  GLEW_ARB_half_float_pixel = glewGetExtension("GL_ARB_half_float_pixel");
+#endif /* GL_ARB_half_float_pixel */
+#ifdef GL_ARB_multisample
+  GLEW_ARB_multisample = glewGetExtension("GL_ARB_multisample");
+  if (glewExperimental || GLEW_ARB_multisample) GLEW_ARB_multisample = !_glewInit_GL_ARB_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ARB_multisample */
+#ifdef GL_ARB_multitexture
+  GLEW_ARB_multitexture = glewGetExtension("GL_ARB_multitexture");
+  if (glewExperimental || GLEW_ARB_multitexture) GLEW_ARB_multitexture = !_glewInit_GL_ARB_multitexture(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ARB_multitexture */
+#ifdef GL_ARB_occlusion_query
+  GLEW_ARB_occlusion_query = glewGetExtension("GL_ARB_occlusion_query");
+  if (glewExperimental || GLEW_ARB_occlusion_query) GLEW_ARB_occlusion_query = !_glewInit_GL_ARB_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ARB_occlusion_query */
+#ifdef GL_ARB_shader_objects
+  GLEW_ARB_shader_objects = glewGetExtension("GL_ARB_shader_objects");
+  if (glewExperimental || GLEW_ARB_shader_objects) GLEW_ARB_shader_objects = !_glewInit_GL_ARB_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ARB_shader_objects */
+#ifdef GL_ARB_shading_language_100
+  GLEW_ARB_shading_language_100 = glewGetExtension("GL_ARB_shading_language_100");
+#endif /* GL_ARB_shading_language_100 */
+#ifdef GL_ARB_texture_compression
+  GLEW_ARB_texture_compression = glewGetExtension("GL_ARB_texture_compression");
+  if (glewExperimental || GLEW_ARB_texture_compression) GLEW_ARB_texture_compression = !_glewInit_GL_ARB_texture_compression(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ARB_texture_compression */
+#ifdef GL_ARB_texture_cube_map
+  GLEW_ARB_texture_cube_map = glewGetExtension("GL_ARB_texture_cube_map");
+#endif /* GL_ARB_texture_cube_map */
+#ifdef GL_ARB_texture_env_combine
+  GLEW_ARB_texture_env_combine = glewGetExtension("GL_ARB_texture_env_combine");
+#endif /* GL_ARB_texture_env_combine */
+#ifdef GL_ARB_texture_env_dot3
+  GLEW_ARB_texture_env_dot3 = glewGetExtension("GL_ARB_texture_env_dot3");
+#endif /* GL_ARB_texture_env_dot3 */
+#ifdef GL_ARB_texture_float
+  GLEW_ARB_texture_float = glewGetExtension("GL_ARB_texture_float");
+#endif /* GL_ARB_texture_float */
+#ifdef GL_ARB_texture_non_power_of_two
+  GLEW_ARB_texture_non_power_of_two = glewGetExtension("GL_ARB_texture_non_power_of_two");
+#endif /* GL_ARB_texture_non_power_of_two */
+#ifdef GL_ARB_vertex_buffer_object
+  GLEW_ARB_vertex_buffer_object = glewGetExtension("GL_ARB_vertex_buffer_object");
+  if (glewExperimental || GLEW_ARB_vertex_buffer_object) GLEW_ARB_vertex_buffer_object = !_glewInit_GL_ARB_vertex_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ARB_vertex_buffer_object */
+#ifdef GL_ARB_vertex_program
+  GLEW_ARB_vertex_program = glewGetExtension("GL_ARB_vertex_program");
+  if (glewExperimental || GLEW_ARB_vertex_program) GLEW_ARB_vertex_program = !_glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ARB_vertex_program */
+#ifdef GL_ARB_vertex_shader
+  GLEW_ARB_vertex_shader = glewGetExtension("GL_ARB_vertex_shader");
+  if (glewExperimental || GLEW_ARB_vertex_shader) { GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }
+#endif /* GL_ARB_vertex_shader */
+#ifdef GL_ATI_draw_buffers
+  GLEW_ATI_draw_buffers = glewGetExtension("GL_ATI_draw_buffers");
+  if (glewExperimental || GLEW_ATI_draw_buffers) GLEW_ATI_draw_buffers = !_glewInit_GL_ATI_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ATI_draw_buffers */
+#ifdef GL_ATI_fragment_shader
+  GLEW_ATI_fragment_shader = glewGetExtension("GL_ATI_fragment_shader");
+  if (glewExperimental || GLEW_ATI_fragment_shader) GLEW_ATI_fragment_shader = !_glewInit_GL_ATI_fragment_shader(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ATI_fragment_shader */
+#ifdef GL_ATI_texture_float
+  GLEW_ATI_texture_float = glewGetExtension("GL_ATI_texture_float");
+#endif /* GL_ATI_texture_float */
+#ifdef GL_EXT_framebuffer_object
+  GLEW_EXT_framebuffer_object = glewGetExtension("GL_EXT_framebuffer_object");
+  if (glewExperimental || GLEW_EXT_framebuffer_object) GLEW_EXT_framebuffer_object = !_glewInit_GL_EXT_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_EXT_framebuffer_object */
+#ifdef GL_EXT_pixel_buffer_object
+  GLEW_EXT_pixel_buffer_object = glewGetExtension("GL_EXT_pixel_buffer_object");
+#endif /* GL_EXT_pixel_buffer_object */
+#ifdef GL_ARB_pixel_buffer_object
+  GLEW_ARB_pixel_buffer_object = glewGetExtension("GL_ARB_pixel_buffer_object");
+#endif /* GL_ARB_pixel_buffer_object */
+#ifdef GL_EXT_secondary_color
+  GLEW_EXT_secondary_color = glewGetExtension("GL_EXT_secondary_color");
+  if (glewExperimental || GLEW_EXT_secondary_color) GLEW_EXT_secondary_color = !_glewInit_GL_EXT_secondary_color(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_EXT_secondary_color */
+#ifdef GL_EXT_stencil_two_side
+  GLEW_EXT_stencil_two_side = glewGetExtension("GL_EXT_stencil_two_side");
+  if (glewExperimental || GLEW_EXT_stencil_two_side) GLEW_EXT_stencil_two_side = !_glewInit_GL_EXT_stencil_two_side(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_EXT_stencil_two_side */
+#ifdef GL_EXT_stencil_wrap
+  GLEW_EXT_stencil_wrap = glewGetExtension("GL_EXT_stencil_wrap");
+#endif /* GL_EXT_stencil_wrap */
+#ifdef GL_EXT_texture_compression_s3tc
+  GLEW_EXT_texture_compression_s3tc = glewGetExtension("GL_EXT_texture_compression_s3tc");
+#endif /* GL_EXT_texture_compression_s3tc */
+#ifdef GL_EXT_texture_cube_map
+  GLEW_EXT_texture_cube_map = glewGetExtension("GL_EXT_texture_cube_map");
+#endif /* GL_EXT_texture_cube_map */
+#ifdef GL_EXT_texture_env_combine
+  GLEW_EXT_texture_env_combine = glewGetExtension("GL_EXT_texture_env_combine");
+#endif /* GL_EXT_texture_env_combine */
+#ifdef GL_EXT_texture_env_dot3
+  GLEW_EXT_texture_env_dot3 = glewGetExtension("GL_EXT_texture_env_dot3");
+#endif /* GL_EXT_texture_env_dot3 */
+#ifdef GL_EXT_texture_filter_anisotropic
+  GLEW_EXT_texture_filter_anisotropic = glewGetExtension("GL_EXT_texture_filter_anisotropic");
+#endif /* GL_EXT_texture_filter_anisotropic */
+#ifdef GL_NV_fragment_program
+  GLEW_NV_fragment_program = glewGetExtension("GL_NV_fragment_program");
+  if (glewExperimental || GLEW_NV_fragment_program) GLEW_NV_fragment_program = !_glewInit_GL_NV_fragment_program(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_NV_fragment_program */
+#ifdef GL_NV_fragment_program2
+  GLEW_NV_fragment_program2 = glewGetExtension("GL_NV_fragment_program2");
+#endif /* GL_NV_fragment_program2 */
+#ifdef GL_NV_fragment_program_option
+  GLEW_NV_fragment_program_option = glewGetExtension("GL_NV_fragment_program_option");
+#endif /* GL_NV_fragment_program_option */
+#ifdef GL_NV_occlusion_query
+  GLEW_NV_occlusion_query = glewGetExtension("GL_NV_occlusion_query");
+  if (glewExperimental || GLEW_NV_occlusion_query) GLEW_NV_occlusion_query = !_glewInit_GL_NV_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_NV_occlusion_query */
+#ifdef GL_NV_register_combiners
+  GLEW_NV_register_combiners = glewGetExtension("GL_NV_register_combiners");
+  if (glewExperimental || GLEW_NV_register_combiners) GLEW_NV_register_combiners = !_glewInit_GL_NV_register_combiners(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_NV_register_combiners */
+#ifdef GL_NV_register_combiners2
+  GLEW_NV_register_combiners2 = glewGetExtension("GL_NV_register_combiners2");
+  if (glewExperimental || GLEW_NV_register_combiners2) GLEW_NV_register_combiners2 = !_glewInit_GL_NV_register_combiners2(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_NV_register_combiners2 */
+#ifdef GL_NV_texture_compression_vtc
+  GLEW_NV_texture_compression_vtc = glewGetExtension("GL_NV_texture_compression_vtc");
+#endif /* GL_NV_texture_compression_vtc */
+#ifdef GL_NV_texture_shader
+  GLEW_NV_texture_shader = glewGetExtension("GL_NV_texture_shader");
+#endif /* GL_NV_texture_shader */
+#ifdef GL_NV_vertex_program
+  GLEW_NV_vertex_program = glewGetExtension("GL_NV_vertex_program");
+  if (glewExperimental || GLEW_NV_vertex_program) GLEW_NV_vertex_program = !_glewInit_GL_NV_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_NV_vertex_program */
+#ifdef GL_NV_vertex_program2_option
+  GLEW_NV_vertex_program2_option = glewGetExtension("GL_NV_vertex_program2_option");
+#endif /* GL_NV_vertex_program2_option */
+#ifdef GL_NV_vertex_program3
+  GLEW_NV_vertex_program3 = glewGetExtension("GL_NV_vertex_program3");
+#endif /* GL_NV_vertex_program3 */
+#ifdef GL_SGIS_generate_mipmap
+  GLEW_SGIS_generate_mipmap = glewGetExtension("GL_SGIS_generate_mipmap");
+#endif /* GL_SGIS_generate_mipmap */
+// SJS Changes for OGRE
+#ifdef GL_ARB_point_sprite
+  GLEW_ARB_point_sprite = glewGetExtension("GL_ARB_point_sprite");
+#endif /* GL_ARB_point_sprite */
+#ifdef GL_EXT_point_parameters
+  GLEW_EXT_point_parameters = glewGetExtension("GL_EXT_point_parameters");
+  if (glewExperimental || GLEW_EXT_point_parameters) GLEW_EXT_point_parameters = !_glewInit_GL_EXT_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_EXT_point_parameters */
+#ifdef GL_ARB_point_parameters
+  GLEW_ARB_point_parameters = glewGetExtension("GL_ARB_point_parameters");
+  if (glewExperimental || GLEW_ARB_point_parameters) GLEW_ARB_point_parameters = !_glewInit_GL_ARB_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ARB_point_parameters */
+#ifdef GL_EXT_texture_lod_bias
+  GLEW_EXT_texture_lod_bias = glewGetExtension("GL_EXT_texture_lod_bias");
+#endif /* GL_EXT_texture_lod_bias */
+
+// End SJS changes
+
+  return GLEW_OK;
+}
+
+
+#if defined(_WIN32)
+
+#if !defined(GLEW_MX)
+
+PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB = NULL;
+
+PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB = NULL;
+PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB = NULL;
+PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB = NULL;
+PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB = NULL;
+PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB = NULL;
+
+PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB = NULL;
+PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB = NULL;
+PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB = NULL;
+
+PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB = NULL;
+PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB = NULL;
+PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB = NULL;
+
+PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT = NULL;
+
+PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT = NULL;
+PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT = NULL;
+GLboolean __WGLEW_ARB_extensions_string = GL_FALSE;
+GLboolean __WGLEW_ARB_multisample = GL_FALSE;
+GLboolean __WGLEW_ARB_pbuffer = GL_FALSE;
+GLboolean __WGLEW_ARB_pixel_format = GL_FALSE;
+GLboolean __WGLEW_ARB_pixel_format_float = GL_FALSE;
+GLboolean __WGLEW_ARB_render_texture = GL_FALSE;
+GLboolean __WGLEW_ATI_pixel_format_float = GL_FALSE;
+GLboolean __WGLEW_EXT_extensions_string = GL_FALSE;
+GLboolean __WGLEW_EXT_swap_control = GL_FALSE;
+
+#endif /* !GLEW_MX */
+
+#ifdef WGL_ARB_extensions_string
+
+static GLboolean _glewInit_WGL_ARB_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* WGL_ARB_extensions_string */
+
+#ifdef WGL_ARB_multisample
+
+#endif /* WGL_ARB_multisample */
+
+#ifdef WGL_ARB_pbuffer
+
+static GLboolean _glewInit_WGL_ARB_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferARB")) == NULL) || r;
+  r = ((wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferARB")) == NULL) || r;
+  r = ((wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCARB")) == NULL) || r;
+  r = ((wglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferARB")) == NULL) || r;
+  r = ((wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCARB")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* WGL_ARB_pbuffer */
+
+#ifdef WGL_ARB_pixel_format
+
+static GLboolean _glewInit_WGL_ARB_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatARB")) == NULL) || r;
+  r = ((wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvARB")) == NULL) || r;
+  r = ((wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivARB")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* WGL_ARB_pixel_format */
+
+#ifdef WGL_ARB_pixel_format_float
+
+#endif /* WGL_ARB_pixel_format_float */
+
+#ifdef WGL_ARB_render_texture
+
+static GLboolean _glewInit_WGL_ARB_render_texture (WGLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((wglBindTexImageARB = (PFNWGLBINDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglBindTexImageARB")) == NULL) || r;
+  r = ((wglReleaseTexImageARB = (PFNWGLRELEASETEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglReleaseTexImageARB")) == NULL) || r;
+  r = ((wglSetPbufferAttribARB = (PFNWGLSETPBUFFERATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"wglSetPbufferAttribARB")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* WGL_ARB_render_texture */
+
+#ifdef WGL_ATI_pixel_format_float
+
+#endif /* WGL_ATI_pixel_format_float */
+
+#ifdef WGL_EXT_extensions_string
+
+static GLboolean _glewInit_WGL_EXT_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* WGL_EXT_extensions_string */
+
+#ifdef WGL_EXT_swap_control
+
+static GLboolean _glewInit_WGL_EXT_swap_control (WGLEW_CONTEXT_ARG_DEF_INIT)
+{
+  GLboolean r = GL_FALSE;
+
+  r = ((wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetSwapIntervalEXT")) == NULL) || r;
+  r = ((wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglSwapIntervalEXT")) == NULL) || r;
+
+  return r;
+}
+
+#endif /* WGL_EXT_swap_control */
+
+/* ------------------------------------------------------------------------- */
+
+static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL;
+static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL;
+
+GLboolean wglewGetExtension (const char* name)
+{    
+  GLubyte* p;
+  GLubyte* end;
+  GLuint len = _glewStrLen((const GLubyte*)name);
+  if (_wglewGetExtensionsStringARB == NULL)
+    if (_wglewGetExtensionsStringEXT == NULL)
+      return GL_FALSE;
+    else
+      p = (GLubyte*)_wglewGetExtensionsStringEXT();
+  else
+    p = (GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
+  if (0 == p) return GL_FALSE;
+  end = p + _glewStrLen(p);
+  while (p < end)
+  {
+    GLuint n = _glewStrCLen(p, ' ');
+    if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE;
+    p += n+1;
+  }
+  return GL_FALSE;
+}
+
+GLenum wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST)
+{
+  GLboolean crippled;
+  /* find wgl extension string query functions */
+  if (_wglewGetExtensionsStringARB == NULL)
+    _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB");
+  if (_wglewGetExtensionsStringEXT == NULL)
+    _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT");
+  /* initialize extensions */
+  crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL;
+#ifdef WGL_ARB_extensions_string
+  WGLEW_ARB_extensions_string = wglewGetExtension("WGL_ARB_extensions_string");
+  if (glewExperimental || WGLEW_ARB_extensions_string|| crippled) WGLEW_ARB_extensions_string= !_glewInit_WGL_ARB_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* WGL_ARB_extensions_string */
+#ifdef WGL_ARB_multisample
+  WGLEW_ARB_multisample = wglewGetExtension("WGL_ARB_multisample");
+#endif /* WGL_ARB_multisample */
+#ifdef WGL_ARB_pbuffer
+  WGLEW_ARB_pbuffer = wglewGetExtension("WGL_ARB_pbuffer");
+  if (glewExperimental || WGLEW_ARB_pbuffer|| crippled) WGLEW_ARB_pbuffer= !_glewInit_WGL_ARB_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* WGL_ARB_pbuffer */
+#ifdef WGL_ARB_pixel_format
+  WGLEW_ARB_pixel_format = wglewGetExtension("WGL_ARB_pixel_format");
+  if (glewExperimental || WGLEW_ARB_pixel_format|| crippled) WGLEW_ARB_pixel_format= !_glewInit_WGL_ARB_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* WGL_ARB_pixel_format */
+#ifdef WGL_ARB_pixel_format_float
+  WGLEW_ARB_pixel_format_float = wglewGetExtension("WGL_ARB_pixel_format_float");
+#endif /* WGL_ARB_pixel_format_float */
+#ifdef WGL_ARB_render_texture
+  WGLEW_ARB_render_texture = wglewGetExtension("WGL_ARB_render_texture");
+  if (glewExperimental || WGLEW_ARB_render_texture|| crippled) WGLEW_ARB_render_texture= !_glewInit_WGL_ARB_render_texture(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* WGL_ARB_render_texture */
+#ifdef WGL_ATI_pixel_format_float
+  WGLEW_ATI_pixel_format_float = wglewGetExtension("WGL_ATI_pixel_format_float");
+#endif /* WGL_ATI_pixel_format_float */
+#ifdef WGL_EXT_extensions_string
+  WGLEW_EXT_extensions_string = wglewGetExtension("WGL_EXT_extensions_string");
+  if (glewExperimental || WGLEW_EXT_extensions_string|| crippled) WGLEW_EXT_extensions_string= !_glewInit_WGL_EXT_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* WGL_EXT_extensions_string */
+#ifdef WGL_EXT_swap_control
+  WGLEW_EXT_swap_control = wglewGetExtension("WGL_EXT_swap_control");
+  if (glewExperimental || WGLEW_EXT_swap_control|| crippled) WGLEW_EXT_swap_control= !_glewInit_WGL_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* WGL_EXT_swap_control */
+
+  return GLEW_OK;
+}
+
+#endif /* !__APPLE__ || GLEW_APPLE_GLX */
+
Index: /RenderSystems/GL/src/gtk/Makefile.am
===================================================================
--- /RenderSystems/GL/src/gtk/Makefile.am	(revision 5)
+++ /RenderSystems/GL/src/gtk/Makefile.am	(revision 5)
@@ -0,0 +1,9 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/RenderSystems/GL/include \
+           -I$(top_srcdir)/OgreMain/include $(GLSUPPORT_CFLAGS) \
+           -I$(top_srcdir)/PlatformManagers/$(OGRE_PLATFORM)/include \
+           -I$(top_srcdir)/RenderSystems/GL/include/$(OGRE_GLSUPPORT) \
+           -I$(top_srcdir)/RenderSystems/GL/src/$(OGRE_GLSUPPORT)
+
+noinst_LTLIBRARIES = libsupport.la
+
+libsupport_la_SOURCES = OgreGTKGLSupport.cpp OgreGTKWindow.cpp
Index: /RenderSystems/GL/src/gtk/OgreGLUtil.h
===================================================================
--- /RenderSystems/GL/src/gtk/OgreGLUtil.h	(revision 5)
+++ /RenderSystems/GL/src/gtk/OgreGLUtil.h	(revision 5)
@@ -0,0 +1,43 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef INCL_OGRE_GLUTIL_H
+#define INCL_OGRE_GLUTIL_H
+
+#include "gtk/OgreGTKGLSupport.h"
+
+namespace Ogre {
+    
+inline GLSupport* getGLSupport()
+{
+    return new GTKGLSupport();
+}
+
+};
+#endif // INCL_OGRE_GLUTIL_H
Index: /RenderSystems/GL/src/gtk/OgreGTKGLSupport.cpp
===================================================================
--- /RenderSystems/GL/src/gtk/OgreGTKGLSupport.cpp	(revision 5)
+++ /RenderSystems/GL/src/gtk/OgreGTKGLSupport.cpp	(revision 5)
@@ -0,0 +1,231 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGTKGLSupport.h"
+#include "OgreGTKWindow.h"
+
+#include "OgreLogManager.h"
+#include "OgreException.h"
+#include "OgreStringConverter.h"
+
+
+
+using namespace Ogre;
+
+template<> GTKGLSupport* Singleton<GTKGLSupport>::ms_Singleton = 0;
+GTKGLSupport* GTKGLSupport::getSingletonPtr(void)
+{
+    return ms_Singleton;
+}
+GTKGLSupport& GTKGLSupport::getSingleton(void)
+{  
+    assert( ms_Singleton );  return ( *ms_Singleton );  
+}
+
+GTKGLSupport::GTKGLSupport() : 
+    _kit(0, NULL),
+    _context_ref(0)
+{
+    Gtk::GL::init(0, NULL);
+    _main_context = 0;
+    _main_window = 0;
+    //_ogre_widget = 0;
+}
+
+void GTKGLSupport::addConfig()
+{
+    ConfigOption optFullScreen;
+    ConfigOption optVideoMode;
+
+     // FS setting possiblities
+    optFullScreen.name = "Full Screen";
+    optFullScreen.possibleValues.push_back("Yes");
+    optFullScreen.possibleValues.push_back("No");
+    optFullScreen.currentValue = "No";
+    optFullScreen.immutable = false;
+ 
+    // Video mode possiblities
+    // XXX Actually do this
+    optVideoMode.name = "Video Mode";
+    optVideoMode.immutable = false;
+    optVideoMode.possibleValues.push_back("640 x 480");
+    optVideoMode.possibleValues.push_back("800 x 600");
+    optVideoMode.possibleValues.push_back("1024 x 768");
+    optVideoMode.possibleValues.push_back("1280 x 1024");
+
+    optVideoMode.currentValue = "800 x 600";
+
+    mOptions[optFullScreen.name] = optFullScreen;
+    mOptions[optVideoMode.name] = optVideoMode;
+}
+    
+String GTKGLSupport::validateConfig()
+{
+    return String("");
+}
+
+RenderWindow* GTKGLSupport::createWindow(bool autoCreateWindow, 
+                                         GLRenderSystem* renderSystem, 
+					 const String& windowTitle)
+{
+    if (autoCreateWindow)
+    {
+        ConfigOptionMap::iterator opt = mOptions.find("Full Screen");
+        if (opt == mOptions.end())
+            OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't find full screen options!", "GTKGLSupport::createWindow");
+        bool fullscreen = (opt->second.currentValue == "Yes");
+ 
+        opt = mOptions.find("Video Mode");
+        if (opt == mOptions.end())
+            OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Can't find video mode options!", "GTKGLSupport::createWindow");
+        String val = opt->second.currentValue;
+        String::size_type pos = val.find('x');
+        if (pos == String::npos)
+            OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Invalid Video Mode provided", "GTKGLSupport::createWindow");
+ 
+        unsigned int w = StringConverter::parseUnsignedInt(val.substr(0, pos));
+        unsigned int h = StringConverter::parseUnsignedInt(val.substr(pos + 1));
+ 
+        return renderSystem->createRenderWindow(windowTitle, w, h, 32,
+fullscreen);
+    }
+    else
+    {
+        // XXX What is the else?
+                return NULL;
+    }
+}
+
+RenderWindow* GTKGLSupport::newWindow(const String& name, unsigned int width, 
+        unsigned int height, unsigned int colourDepth, bool fullScreen, int left, int top,
+        bool depthBuffer, RenderWindow* parentWindowHandle, bool vsync)
+{
+    GTKWindow* window = new GTKWindow();
+    window->create(name, width, height, colourDepth, fullScreen, left, top,
+                   depthBuffer, parentWindowHandle);
+
+    //if(!_ogre_widget)
+    //	_ogre_widget = window->get_ogre_widget();
+
+    // Copy some important information for future reference, for example
+    // for when the context is needed
+    if(!_main_context)
+        _main_context = window->get_ogre_widget()->get_gl_context();
+    if(!_main_window)
+        _main_window = window->get_ogre_widget()->get_gl_window();
+
+    return window;
+}
+
+void GTKGLSupport::start()
+{
+    LogManager::getSingleton().logMessage(
+        "******************************\n"
+        "*** Starting GTK Subsystem ***\n"
+        "******************************");
+
+}
+ 
+void GTKGLSupport::stop()
+{
+    LogManager::getSingleton().logMessage(
+        "******************************\n"
+        "*** Stopping GTK Subsystem ***\n"
+        "******************************");
+}
+
+void GTKGLSupport::begin_context(RenderTarget *_target)
+{
+	// Support nested contexts, in which case.. nothing happens
+    	++_context_ref;
+    	if (_context_ref == 1) {
+		if(_target) {
+			// Begin a specific context
+			OGREWidget *_ogre_widget = static_cast<GTKWindow*>(_target)->get_ogre_widget();
+
+	        	_ogre_widget->get_gl_window()->gl_begin(_ogre_widget->get_gl_context());
+		} else {
+			// Begin a generic main context
+			_main_window->gl_begin(_main_context);
+		}
+    	}
+}
+
+void GTKGLSupport::end_context()
+{
+    	--_context_ref;
+    	if(_context_ref < 0)
+        	OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Too many contexts destroyed!", "GTKGLSupport::end_context");
+    	if (_context_ref == 0)
+    	{
+		// XX is this enough? (_main_window might not be the current window,
+ 		// but we can never be sure the previous rendering window 
+		// even still exists)
+		_main_window->gl_end();
+    	}
+}
+ 
+void GTKGLSupport::initialiseExtensions(void)
+{
+    // XXX anythign to actually do here?
+}
+
+bool GTKGLSupport::checkMinGLVersion(const String& v) const
+{
+    int major, minor;
+    Gdk::GL::query_version(major, minor);
+
+    std::string::size_type pos = v.find(".");
+    int cmaj = atoi(v.substr(0, pos).c_str());
+    int cmin = atoi(v.substr(pos + 1).c_str());
+
+    return ( (major >= cmaj) && (minor >= cmin) );
+}
+
+bool GTKGLSupport::checkExtension(const String& ext) const
+{
+	// query_gl_extension needs an active context, doesn't matter which one
+	if (_context_ref == 0)
+		_main_window->gl_begin(_main_context);
+
+	bool result = Gdk::GL::query_gl_extension(ext.c_str());
+
+	if (_context_ref == 0)
+		_main_window->gl_end();
+}
+
+void* GTKGLSupport::getProcAddress(const String& procname)
+{
+    return (void*)Gdk::GL::get_proc_address(procname.c_str());
+}
+
+Glib::RefPtr<const Gdk::GL::Context> GTKGLSupport::getMainContext() const {
+	return _main_context;
+}
+
Index: /RenderSystems/GL/src/gtk/OgreGTKWindow.cpp
===================================================================
--- /RenderSystems/GL/src/gtk/OgreGTKWindow.cpp	(revision 5)
+++ /RenderSystems/GL/src/gtk/OgreGTKWindow.cpp	(revision 5)
@@ -0,0 +1,224 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreGTKWindow.h"
+#include "OgreGTKGLSupport.h"
+#include "OgreRenderSystem.h"
+#include "OgreRoot.h"
+#include "OgreLogManager.h"
+
+using namespace Ogre;
+
+OGREWidget::OGREWidget(bool useDepthBuffer) : 
+	Gtk::GL::DrawingArea()
+{
+    Glib::RefPtr<Gdk::GL::Config> glconfig;
+
+    Gdk::GL::ConfigMode mode = Gdk::GL::MODE_RGBA | Gdk::GL::MODE_DOUBLE;
+    if (useDepthBuffer)
+        mode |= Gdk::GL::MODE_DEPTH;
+
+    glconfig = Gdk::GL::Config::create(mode);
+    if (glconfig.is_null())
+    {
+    	LogManager::getSingleton().logMessage("[gtk] GLCONFIG BLOWUP");
+    }
+
+    // Inherit GL context from Ogre main context
+    set_gl_capability(glconfig, GTKGLSupport::getSingleton().getMainContext());
+
+    add_events(Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK);
+}
+
+// OGREWidget TODO: 
+// - resize events et al
+// - Change aspect ratio
+
+GTKWindow::GTKWindow():
+	mGtkWindow(0)
+{
+    	//kit = Gtk::Main::instance();
+	
+	// Should  this move to GTKGLSupport?
+    	// Gtk::GL::init(0, NULL);
+	// Already done in GTKGLSupport	
+
+	mWidth = 0;
+	mHeight  = 0;
+}
+
+GTKWindow::~GTKWindow()
+{
+}
+bool GTKWindow::pump_events()
+{
+    Gtk::Main *kit = Gtk::Main::instance();
+    if (kit->events_pending())
+    {
+        kit->iteration(false);
+        return true;
+    }
+    return false;
+}
+
+OGREWidget* GTKWindow::get_ogre_widget()
+{
+    return ogre;
+}
+
+void GTKWindow::create(const String& name, unsigned int width, unsigned int height, unsigned int colourDepth, 
+                       bool fullScreen, int left, int top, bool depthBuffer, 
+                       void* miscParam, ...)
+{
+   	mName = name;
+	mWidth = width;
+	mHeight = height;
+
+	if(!miscParam) {
+    		mGtkWindow = new Gtk::Window();
+    		mGtkWindow->set_title(mName);
+
+    		if (fullScreen)
+    		{
+        		mGtkWindow->set_decorated(false);
+        		mGtkWindow->fullscreen();
+    		}
+    		else
+    		{
+        		mGtkWindow->set_default_size(mWidth, mHeight);
+        		mGtkWindow->move(left, top); 
+    		}
+	} else {
+		// If miscParam is not 0, a parent widget has been passed in,
+		// we will handle this later on after the widget has been created.
+	}
+
+    	ogre = Gtk::manage(new OGREWidget(depthBuffer));
+    	ogre->set_size_request(width, height);
+
+	ogre->signal_delete_event().connect(SigC::slot(*this, &GTKWindow::on_delete_event));
+	ogre->signal_expose_event().connect(SigC::slot(*this, &GTKWindow::on_expose_event));
+
+	if(mGtkWindow) {
+    		mGtkWindow->add(*ogre);
+    		mGtkWindow->show_all();
+	}
+	if(miscParam) {
+		// Attach it!
+		// Note that the parent widget *must* be visible already at this point,
+		// or the widget won't get realized in time for the GLinit that follows
+		// this call. This is usually the case for Glade generated windows, anyway.
+		reinterpret_cast<Gtk::Container*>(miscParam)->add(*ogre);
+		ogre->show();
+	}
+	//ogre->realize();
+}
+
+void GTKWindow::destroy()
+{
+    	Root::getSingleton().getRenderSystem()->detachRenderTarget( this->getName() );
+	// We could detach the widget from its parent and destroy it here too,
+	// but then again, it is managed so we rely on GTK to destroy it.
+	delete mGtkWindow;
+	mGtkWindow = 0;
+
+}
+
+bool GTKWindow::isActive() const
+{
+    return ogre->is_realized();
+}
+
+bool GTKWindow::isClosed() const
+{
+    return ogre->is_visible();
+}
+
+void GTKWindow::reposition(int left, int top)
+{
+	if(mGtkWindow)
+    		mGtkWindow->move(left, top);
+}
+
+void GTKWindow::resize(unsigned int width, unsigned int height)
+{
+	if(mGtkWindow)
+    		mGtkWindow->resize(width, height);
+}
+
+void GTKWindow::swapBuffers(bool waitForVSync)
+{
+    	Glib::RefPtr<Gdk::GL::Window> glwindow = ogre->get_gl_window();
+    	glwindow->swap_buffers();
+}
+
+void GTKWindow::writeContentsToFile(const String& filename)
+{
+    	// XXX impl me
+}
+
+void GTKWindow::getCustomAttribute( const String& name, void* pData )
+{
+	if( name == "GTKMMWINDOW" )
+	{
+		Gtk::Window **win = static_cast<Gtk::Window **>(pData);
+		// Oh, the burdens of multiple inheritance
+		*win = mGtkWindow;
+		return;
+	}
+	else if( name == "GTKGLMMWIDGET" )
+	{
+	    	Gtk::GL::DrawingArea **widget = static_cast<Gtk::GL::DrawingArea **>(pData);
+		*widget = ogre;
+		return;
+	}
+	else if( name == "isTexture" )
+	{
+		bool *b = reinterpret_cast< bool * >( pData );
+		*b = false;
+		return;
+	}
+	RenderWindow::getCustomAttribute(name, pData);
+}
+
+
+bool GTKWindow::on_delete_event(GdkEventAny* event)
+{
+    Root::getSingleton().getRenderSystem()->detachRenderTarget( this->getName() );
+    return false;
+}
+
+bool GTKWindow::on_expose_event(GdkEventExpose* event)
+{
+    // Window exposed, update interior
+    //std::cout << "Window exposed, update interior" << std::endl;
+    // TODO: time between events, as expose events can be sent crazily fast
+    update();
+    return false;
+}
Index: /RenderSystems/GL/src/nvparse/Makefile.am
===================================================================
--- /RenderSystems/GL/src/nvparse/Makefile.am	(revision 5)
+++ /RenderSystems/GL/src/nvparse/Makefile.am	(revision 5)
@@ -0,0 +1,81 @@
+EXTRA_DIST = ps1.0_grammar.y rc1.0_grammar.y ts1.0_grammar.y vs1.0_grammar.y \
+             ps1.0_tokens.l  rc1.0_tokens.l  ts1.0_tokens.l  vs1.0_tokens.l \
+             Makefile.reyacc
+
+AM_YFLAGS = -d
+
+INCLUDES = -DYY_NEVER_INTERACTIVE -DYY_NO_UNPUT $(STLPORT_CFLAGS) -I$(top_srcdir)/RenderSystems/GL/include \
+           -I$(top_srcdir)/OgreMain/include $(GLSUPPORT_CFLAGS) \
+           -I$(top_srcdir)/PlatformManagers/$(OGRE_PLATFORM)/include \
+            $(CFLAGS_VISIBILITY)
+
+noinst_LTLIBRARIES = libnvparse.la
+
+libnvparse_la_SOURCES = nvparse.cpp nvparse_errors.cpp rc1.0_combiners.cpp \
+                       rc1.0_final.cpp rc1.0_general.cpp ts1.0_inst.cpp \
+                       ts1.0_inst_list.cpp _ts1.0_parser.cpp _ts1.0_lexer.cpp \
+                       _rc1.0_lexer.cpp _rc1.0_parser.cpp avp1.0_impl.cpp \
+ _ps1.0_parser.h _vs1.0_parser.h nvparse_errors.h \
+                        rc1.0_combiners.h  rc1.0_register.h _rc1.0_parser.h \
+                        macro.h nvparse_externs.h rc1.0_final.h ts1.0_inst.h \
+                        vs1.0_inst.h _ts1.0_parser.h nvparse.h \
+                        ps1.0_program.h rc1.0_general.h ts1.0_inst_list.h \
+                        vs1.0_inst_list.h
+
+if OGRE_LINUX
+  libnvparse_la_SOURCES += _vs1.0_lexer.cpp _vs1.0_parser.cpp _ps1.0_lexer.cpp _ps1.0_parser.cpp vs1.0_inst.cpp  vs1.0_inst_list.cpp ps1.0_program.cpp vsp1.0_impl.cpp vcp1.0_impl.cpp vp1.0_impl.cpp 
+endif
+
+if OGRE_NT
+  INCLUDES += -I$(srcdir)/winheaders
+  libnvparse_la_SOURCES += _vs1.0_lexer.cpp _vs1.0_parser.cpp _ps1.0_lexer.cpp _ps1.0_parser.cpp vs1.0_inst.cpp  vs1.0_inst_list.cpp ps1.0_program.cpp vsp1.0_impl.cpp vcp1.0_impl.cpp vp1.0_impl.cpp 
+endif
+
+if OGRE_OSX
+  INCLUDES += -DMACOS -I../../../../Mac/XCode/OgreFramework
+endif
+
+# ifeq ($(OS), "Linux")
+#$(MAIN):
+#	-bison -o _ps1.0_parser.c ps1.0_grammar.y
+#	-mv -f _ps1.0_parser.c _ps1.0_parser.cpp
+#	-bison -o _rc1.0_parser.c rc1.0_grammar.y
+#	-mv -f _rc1.0_parser.c _rc1.0_parser.cpp
+#	-bison -o _ts1.0_parser.c ts1.0_grammar.y
+#	-mv -f _ts1.0_parser.c _ts1.0_parser.cpp
+#	-bison -o _vs1.0_parser.c vs1.0_grammar.y
+#	-mv -f _vs1.0_parser.c _vs1.0_parser.cpp
+#	-flex -o_rc1.0_lexer.cpp rc1.0_tokens.l
+#	-flex -o_ps1.0_lexer.cpp ps1.0_tokens.l
+#	-flex -o_ts1.0_lexer.cpp ts1.0_tokens.l
+#	-flex -o_vs1.0_lexer.cpp vs1.0_tokens.l
+#	make compile
+#endif
+
+#ifeq ($(OS), "Windows_NT")
+#$(MAIN):
+#	-bison -o _ps1.0_parser.c ps1.0_grammar.y
+#	-mv -f _ps1.0_parser.c _ps1.0_parser.cpp
+#	-bison -o _rc1.0_parser.c rc1.0_grammar.y
+#	-mv -f _rc1.0_parser.c _rc1.0_parser.cpp
+#	-bison -o _ts1.0_parser.c ts1.0_grammar.y
+#	-mv -f _ts1.0_parser.c _ts1.0_parser.cpp
+#	-bison -o _vs1.0_parser.c vs1.0_grammar.y
+#	-mv -f _vs1.0_parser.c _vs1.0_parser.cpp
+#	-flex -o_rc1.0_lexer.cpp rc1.0_tokens.l
+#	-flex -o_ps1.0_lexer.cpp ps1.0_tokens.l
+#	-flex -o_ts1.0_lexer.cpp ts1.0_tokens.l
+#	-flex -o_vs1.0_lexer.cpp vs1.0_tokens.l
+#	make compile
+#endif
+
+#ifeq ($(OS), "MacOSX")
+#$(MAIN):
+#	-bison -o _rc1.0_parser.c rc1.0_grammar.y
+#	-mv -f _rc1.0_parser.c _rc1.0_parser.cpp
+#	-bison -o _ts1.0_parser.c ts1.0_grammar.y
+#	-mv -f _ts1.0_parser.c _ts1.0_parser.cpp
+#	-flex -o_rc1.0_lexer.cpp rc1.0_tokens.l
+#	-flex -o_ts1.0_lexer.cpp ts1.0_tokens.l
+#	make compile
+#endif
Index: /RenderSystems/GL/src/nvparse/Makefile.in
===================================================================
--- /RenderSystems/GL/src/nvparse/Makefile.in	(revision 5)
+++ /RenderSystems/GL/src/nvparse/Makefile.in	(revision 5)
@@ -0,0 +1,619 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+@OGRE_LINUX_TRUE@am__append_1 = _vs1.0_lexer.cpp _vs1.0_parser.cpp _ps1.0_lexer.cpp _ps1.0_parser.cpp vs1.0_inst.cpp  vs1.0_inst_list.cpp ps1.0_program.cpp vsp1.0_impl.cpp vcp1.0_impl.cpp vp1.0_impl.cpp 
+@OGRE_NT_TRUE@am__append_2 = -I$(srcdir)/winheaders
+@OGRE_NT_TRUE@am__append_3 = _vs1.0_lexer.cpp _vs1.0_parser.cpp _ps1.0_lexer.cpp _ps1.0_parser.cpp vs1.0_inst.cpp  vs1.0_inst_list.cpp ps1.0_program.cpp vsp1.0_impl.cpp vcp1.0_impl.cpp vp1.0_impl.cpp 
+@OGRE_OSX_TRUE@am__append_4 = -DMACOS -I../../../../Mac/XCode/OgreFramework
+subdir = RenderSystems/GL/src/nvparse
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libnvparse_la_LIBADD =
+am__libnvparse_la_SOURCES_DIST = nvparse.cpp nvparse_errors.cpp \
+	rc1.0_combiners.cpp rc1.0_final.cpp rc1.0_general.cpp \
+	ts1.0_inst.cpp ts1.0_inst_list.cpp _ts1.0_parser.cpp \
+	_ts1.0_lexer.cpp _rc1.0_lexer.cpp _rc1.0_parser.cpp \
+	avp1.0_impl.cpp _ps1.0_parser.h _vs1.0_parser.h \
+	nvparse_errors.h rc1.0_combiners.h rc1.0_register.h \
+	_rc1.0_parser.h macro.h nvparse_externs.h rc1.0_final.h \
+	ts1.0_inst.h vs1.0_inst.h _ts1.0_parser.h nvparse.h \
+	ps1.0_program.h rc1.0_general.h ts1.0_inst_list.h \
+	vs1.0_inst_list.h _vs1.0_lexer.cpp _vs1.0_parser.cpp \
+	_ps1.0_lexer.cpp _ps1.0_parser.cpp vs1.0_inst.cpp \
+	vs1.0_inst_list.cpp ps1.0_program.cpp vsp1.0_impl.cpp \
+	vcp1.0_impl.cpp vp1.0_impl.cpp
+@OGRE_LINUX_TRUE@am__objects_1 = _vs1.0_lexer.lo _vs1.0_parser.lo \
+@OGRE_LINUX_TRUE@	_ps1.0_lexer.lo _ps1.0_parser.lo \
+@OGRE_LINUX_TRUE@	vs1.0_inst.lo vs1.0_inst_list.lo \
+@OGRE_LINUX_TRUE@	ps1.0_program.lo vsp1.0_impl.lo \
+@OGRE_LINUX_TRUE@	vcp1.0_impl.lo vp1.0_impl.lo
+@OGRE_NT_TRUE@am__objects_2 = _vs1.0_lexer.lo _vs1.0_parser.lo \
+@OGRE_NT_TRUE@	_ps1.0_lexer.lo _ps1.0_parser.lo vs1.0_inst.lo \
+@OGRE_NT_TRUE@	vs1.0_inst_list.lo ps1.0_program.lo \
+@OGRE_NT_TRUE@	vsp1.0_impl.lo vcp1.0_impl.lo vp1.0_impl.lo
+am_libnvparse_la_OBJECTS = nvparse.lo nvparse_errors.lo \
+	rc1.0_combiners.lo rc1.0_final.lo rc1.0_general.lo \
+	ts1.0_inst.lo ts1.0_inst_list.lo _ts1.0_parser.lo \
+	_ts1.0_lexer.lo _rc1.0_lexer.lo _rc1.0_parser.lo \
+	avp1.0_impl.lo $(am__objects_1) $(am__objects_2)
+libnvparse_la_OBJECTS = $(am_libnvparse_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libnvparse_la_SOURCES)
+DIST_SOURCES = $(am__libnvparse_la_SOURCES_DIST)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+EXTRA_DIST = ps1.0_grammar.y rc1.0_grammar.y ts1.0_grammar.y vs1.0_grammar.y \
+             ps1.0_tokens.l  rc1.0_tokens.l  ts1.0_tokens.l  vs1.0_tokens.l \
+             Makefile.reyacc
+
+AM_YFLAGS = -d
+INCLUDES = -DYY_NEVER_INTERACTIVE -DYY_NO_UNPUT $(STLPORT_CFLAGS) \
+	-I$(top_srcdir)/RenderSystems/GL/include \
+	-I$(top_srcdir)/OgreMain/include $(GLSUPPORT_CFLAGS) \
+	-I$(top_srcdir)/PlatformManagers/$(OGRE_PLATFORM)/include \
+	$(CFLAGS_VISIBILITY) $(am__append_2) $(am__append_4)
+noinst_LTLIBRARIES = libnvparse.la
+libnvparse_la_SOURCES = nvparse.cpp nvparse_errors.cpp \
+	rc1.0_combiners.cpp rc1.0_final.cpp rc1.0_general.cpp \
+	ts1.0_inst.cpp ts1.0_inst_list.cpp _ts1.0_parser.cpp \
+	_ts1.0_lexer.cpp _rc1.0_lexer.cpp _rc1.0_parser.cpp \
+	avp1.0_impl.cpp _ps1.0_parser.h _vs1.0_parser.h \
+	nvparse_errors.h rc1.0_combiners.h rc1.0_register.h \
+	_rc1.0_parser.h macro.h nvparse_externs.h rc1.0_final.h \
+	ts1.0_inst.h vs1.0_inst.h _ts1.0_parser.h nvparse.h \
+	ps1.0_program.h rc1.0_general.h ts1.0_inst_list.h \
+	vs1.0_inst_list.h $(am__append_1) $(am__append_3)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  RenderSystems/GL/src/nvparse/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  RenderSystems/GL/src/nvparse/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libnvparse.la: $(libnvparse_la_OBJECTS) $(libnvparse_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libnvparse_la_LDFLAGS) $(libnvparse_la_OBJECTS) $(libnvparse_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_ps1.0_lexer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_ps1.0_parser.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_rc1.0_lexer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_rc1.0_parser.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_ts1.0_lexer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_ts1.0_parser.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_vs1.0_lexer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_vs1.0_parser.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avp1.0_impl.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nvparse.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nvparse_errors.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ps1.0_program.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rc1.0_combiners.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rc1.0_final.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rc1.0_general.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ts1.0_inst.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ts1.0_inst_list.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vcp1.0_impl.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vp1.0_impl.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vs1.0_inst.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vs1.0_inst_list.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vsp1.0_impl.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+
+# ifeq ($(OS), "Linux")
+#$(MAIN):
+#	-bison -o _ps1.0_parser.c ps1.0_grammar.y
+#	-mv -f _ps1.0_parser.c _ps1.0_parser.cpp
+#	-bison -o _rc1.0_parser.c rc1.0_grammar.y
+#	-mv -f _rc1.0_parser.c _rc1.0_parser.cpp
+#	-bison -o _ts1.0_parser.c ts1.0_grammar.y
+#	-mv -f _ts1.0_parser.c _ts1.0_parser.cpp
+#	-bison -o _vs1.0_parser.c vs1.0_grammar.y
+#	-mv -f _vs1.0_parser.c _vs1.0_parser.cpp
+#	-flex -o_rc1.0_lexer.cpp rc1.0_tokens.l
+#	-flex -o_ps1.0_lexer.cpp ps1.0_tokens.l
+#	-flex -o_ts1.0_lexer.cpp ts1.0_tokens.l
+#	-flex -o_vs1.0_lexer.cpp vs1.0_tokens.l
+#	make compile
+#endif
+
+#ifeq ($(OS), "Windows_NT")
+#$(MAIN):
+#	-bison -o _ps1.0_parser.c ps1.0_grammar.y
+#	-mv -f _ps1.0_parser.c _ps1.0_parser.cpp
+#	-bison -o _rc1.0_parser.c rc1.0_grammar.y
+#	-mv -f _rc1.0_parser.c _rc1.0_parser.cpp
+#	-bison -o _ts1.0_parser.c ts1.0_grammar.y
+#	-mv -f _ts1.0_parser.c _ts1.0_parser.cpp
+#	-bison -o _vs1.0_parser.c vs1.0_grammar.y
+#	-mv -f _vs1.0_parser.c _vs1.0_parser.cpp
+#	-flex -o_rc1.0_lexer.cpp rc1.0_tokens.l
+#	-flex -o_ps1.0_lexer.cpp ps1.0_tokens.l
+#	-flex -o_ts1.0_lexer.cpp ts1.0_tokens.l
+#	-flex -o_vs1.0_lexer.cpp vs1.0_tokens.l
+#	make compile
+#endif
+
+#ifeq ($(OS), "MacOSX")
+#$(MAIN):
+#	-bison -o _rc1.0_parser.c rc1.0_grammar.y
+#	-mv -f _rc1.0_parser.c _rc1.0_parser.cpp
+#	-bison -o _ts1.0_parser.c ts1.0_grammar.y
+#	-mv -f _ts1.0_parser.c _ts1.0_parser.cpp
+#	-flex -o_rc1.0_lexer.cpp rc1.0_tokens.l
+#	-flex -o_ts1.0_lexer.cpp ts1.0_tokens.l
+#	make compile
+#endif
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /RenderSystems/GL/src/nvparse/Makefile.reyacc
===================================================================
--- /RenderSystems/GL/src/nvparse/Makefile.reyacc	(revision 5)
+++ /RenderSystems/GL/src/nvparse/Makefile.reyacc	(revision 5)
@@ -0,0 +1,19 @@
+MAIN=../libnvparse.a
+
+$(MAIN):
+	-bison -d -o _ps1.0_parser.c ps1.0_grammar.y
+	-mv -f _ps1.0_parser.c _ps1.0_parser.cpp
+	-bison -d -o _rc1.0_parser.c  rc1.0_grammar.y
+	-mv -f _rc1.0_parser.c _rc1.0_parser.cpp
+	-bison -d -o _ts1.0_parser.c  ts1.0_grammar.y
+	-mv -f _ts1.0_parser.c _ts1.0_parser.cpp
+	-bison -d -o _vs1.0_parser.c  vs1.0_grammar.y
+	-mv -f _vs1.0_parser.c _vs1.0_parser.cpp
+	-flex -o_rc1.0_lexer.cpp rc1.0_tokens.l
+	-flex -o_ps1.0_lexer.cpp ps1.0_tokens.l
+	-flex -o_ts1.0_lexer.cpp ts1.0_tokens.l
+	-flex -o_vs1.0_lexer.cpp vs1.0_tokens.l
+
+all: $(MAIN)
+
+install:
Index: /RenderSystems/GL/src/nvparse/_ps1.0_lexer.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/_ps1.0_lexer.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/_ps1.0_lexer.cpp	(revision 5)
@@ -0,0 +1,1868 @@
+#define yy_create_buffer ps10__create_buffer
+#define yy_delete_buffer ps10__delete_buffer
+#define yy_scan_buffer ps10__scan_buffer
+#define yy_scan_string ps10__scan_string
+#define yy_scan_bytes ps10__scan_bytes
+#define yy_flex_debug ps10__flex_debug
+#define yy_init_buffer ps10__init_buffer
+#define yy_flush_buffer ps10__flush_buffer
+#define yy_load_buffer_state ps10__load_buffer_state
+#define yy_switch_to_buffer ps10__switch_to_buffer
+#define yyin ps10_in
+#define yyleng ps10_leng
+#define yylex ps10_lex
+#define yyout ps10_out
+#define yyrestart ps10_restart
+#define yytext ps10_text
+#define yywrap ps10_wrap
+
+#line 20 "_ps1.0_lexer.cpp"
+/* A lexical scanner generated by flex */
+
+/* Scanner skeleton version:
+ * $Header: /cvsroot/ogre/ogrenew/RenderSystems/GL/src/nvparse/_ps1.0_lexer.cpp,v 1.2 2005/07/08 16:51:23 miathan6 Exp $
+ */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+
+#include <stdio.h>
+#include <unistd.h>
+
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+#include <stdlib.h>
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else	/* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_PROTOS
+#define YY_USE_CONST
+
+#endif	/* __STDC__ */
+#endif	/* ! __cplusplus */
+
+#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include <io.h>
+#include <stdlib.h>
+#define YY_USE_CONST
+#define YY_USE_PROTOS
+#endif
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index.  If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition.  This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.  The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#define YY_BUF_SIZE 16384
+
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+extern int yyleng;
+extern FILE *yyin, *yyout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+/* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator).  This
+ * avoids problems with code like:
+ *
+ * 	if ( condition_holds )
+ *		yyless( 5 );
+ *	else
+ *		do_something_else();
+ *
+ * Prior to using the do-while the compiler would get upset at the
+ * "else" because it interpreted the "if" statement as being all
+ * done when it reached the ';' after the yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+		*yy_cp = yy_hold_char; \
+		YY_RESTORE_YY_MORE_OFFSET \
+		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+		} \
+	while ( 0 )
+
+#define unput(c) yyunput( c, yytext_ptr )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+typedef unsigned int yy_size_t;
+
+
+struct yy_buffer_state
+	{
+	FILE *yy_input_file;
+
+	char *yy_ch_buf;		/* input buffer */
+	char *yy_buf_pos;		/* current position in input buffer */
+
+	/* Size of input buffer in bytes, not including room for EOB
+	 * characters.
+	 */
+	yy_size_t yy_buf_size;
+
+	/* Number of characters read into yy_ch_buf, not including EOB
+	 * characters.
+	 */
+	int yy_n_chars;
+
+	/* Whether we "own" the buffer - i.e., we know we created it,
+	 * and can realloc() it to grow it, and should free() it to
+	 * delete it.
+	 */
+	int yy_is_our_buffer;
+
+	/* Whether this is an "interactive" input source; if so, and
+	 * if we're using stdio for input, then we want to use getc()
+	 * instead of fread(), to make sure we stop fetching input after
+	 * each newline.
+	 */
+	int yy_is_interactive;
+
+	/* Whether we're considered to be at the beginning of a line.
+	 * If so, '^' rules will be active on the next match, otherwise
+	 * not.
+	 */
+	int yy_at_bol;
+
+	/* Whether to try to fill the input buffer when we reach the
+	 * end of it.
+	 */
+	int yy_fill_buffer;
+
+	int yy_buffer_status;
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+	/* When an EOF's been seen but there's still some text to process
+	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+	 * shouldn't try reading from the input source any more.  We might
+	 * still have a bunch of tokens to match, though, because of
+	 * possible backing-up.
+	 *
+	 * When we actually see the EOF, we change the status to "new"
+	 * (via yyrestart()), so that the user can continue scanning by
+	 * just pointing yyin at a new input file.
+	 */
+#define YY_BUFFER_EOF_PENDING 2
+	};
+
+static YY_BUFFER_STATE yy_current_buffer = 0;
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ */
+#define YY_CURRENT_BUFFER yy_current_buffer
+
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+
+static int yy_n_chars;		/* number of characters read into yy_ch_buf */
+
+
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1;		/* whether we need to initialize */
+static int yy_start = 0;	/* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin.  A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart YY_PROTO(( FILE *input_file ));
+
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+void yy_load_buffer_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+static void yy_flex_free YY_PROTO(( void * ));
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+	{ \
+	if ( ! yy_current_buffer ) \
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+	yy_current_buffer->yy_is_interactive = is_interactive; \
+	}
+
+#define yy_set_bol(at_bol) \
+	{ \
+	if ( ! yy_current_buffer ) \
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+	yy_current_buffer->yy_at_bol = at_bol; \
+	}
+
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+typedef unsigned char YY_CHAR;
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+typedef int yy_state_type;
+extern char *yytext;
+#define yytext_ptr yytext
+
+static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+static int yy_get_next_buffer YY_PROTO(( void ));
+static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+	yytext_ptr = yy_bp; \
+	yyleng = (int) (yy_cp - yy_bp); \
+	yy_hold_char = *yy_cp; \
+	*yy_cp = '\0'; \
+	yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 36
+#define YY_END_OF_BUFFER 37
+static yyconst short int yy_accept[231] =
+    {   0,
+        0,    0,    0,    0,   37,   35,   33,   32,   35,   35,
+       35,   35,    1,   35,   35,   35,   35,   35,   35,   35,
+       35,   35,   35,   35,   35,   35,    5,    5,   33,   32,
+        0,    0,    0,    0,    0,    0,    0,    2,    0,    0,
+        0,    0,    8,    0,    0,    0,    0,    0,    0,    0,
+        7,    0,    9,    0,   10,    0,    5,    4,    3,    0,
+       11,    0,    0,   12,    6,   13,   14,   15,   16,   17,
+        0,    0,   18,    0,    0,   19,    0,    0,    3,    0,
+        0,    8,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    7,    0,    0,    0,    0,    9,    0,    0,    0,
+
+        0,    0,    0,    0,    0,   10,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,   34,   11,    0,    0,   12,
+        0,   13,    0,   14,    0,   15,    0,   16,    0,   17,
+        0,    0,   18,    0,    0,   20,    0,    0,    0,    0,
+        0,    0,   11,    0,   12,    0,   13,    0,   14,    0,
+       15,    0,   16,    0,   17,    0,   18,   21,    0,   23,
+
+        0,    0,    0,   22,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,   26,   27,
+       24,   25,   28,    0,   30,    0,   29,    0,   31,    0
+    } ;
+
+static yyconst int yy_ec[256] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
+        1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    5,    1,    6,    7,    8,    9,   10,   11,
+       12,   13,   14,   14,   14,   15,   15,    1,   16,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,   17,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,   18,    1,   19,   20,   21,   22,
+
+       23,   24,   25,    1,   26,    1,   27,   28,   29,   30,
+       31,   32,    1,   33,   34,   35,   36,   37,   38,   39,
+       40,   41,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1
+    } ;
+
+static yyconst int yy_meta[42] =
+    {   0,
+        1,    1,    2,    1,    1,    1,    3,    1,    4,    4,
+        4,    4,    4,    4,    5,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    6,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1
+    } ;
+
+static yyconst short int yy_base[236] =
+    {   0,
+        0,    0,   37,    0,  365,  366,   51,   54,  361,   43,
+      355,   57,  366,  328,  339,  330,   37,  326,   43,   56,
+      322,   61,   58,  350,   75,    0,  349,   79,   85,   88,
+      352,   91,   81,  110,   88,   94,   90,  366,  105,  107,
+      347,  331,  108,  330,  327,  338,  317,  326,  310,  318,
+      118,  325,  120,  305,  123,    0,  336,    0,    0,  332,
+      323,  112,  320,  321,  366,  320,  319,  318,  317,  316,
+      114,  313,  314,  129,  311,  136,  139,  310,    0,    0,
+      121,  366,  304,  288,  135,  132,  142,  148,  151,  157,
+      158,  366,  302,  286,  149,  161,  366,  300,  284,  160,
+
+      300,  291,  295,  308,  296,  366,  293,  277,  163,  184,
+      305,  296,  124,  294,  272,  293,  300,  299,  290,  190,
+      297,  288,  193,  295,  286,  194,  293,  284,  197,  291,
+      282,  198,  289,  280,  201,  278,  256,  277,  284,  283,
+      274,  202,  272,  250,  271,  278,  259,  256,  258,  246,
+      259,  263,  241,  262,  269,  366,  261,  243,  243,  258,
+      240,  256,  238,  254,  236,  252,  234,  250,  232,  248,
+      230,  230,  245,  227,  227,  232,  226,  230,  205,  246,
+      222,  221,  366,  220,  366,  219,  366,  218,  366,  217,
+      366,  216,  366,  215,  366,  214,  366,  366,  225,  366,
+
+      186,  188,  205,  366,  223,  209,  210,  196,  204,  192,
+      186,  178,  162,  107,  117,  106,   78,   81,  366,  366,
+      366,  366,  366,   80,  366,   52,  366,   40,  366,  366,
+      227,  231,  233,  235,  240
+    } ;
+
+static yyconst short int yy_def[236] =
+    {   0,
+      230,    1,    1,    3,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  231,  230,  230,  230,  230,
+      230,  230,  230,  232,  232,  233,  232,  232,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  233,  232,  233,  234,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  234,  235,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,    0,
+      230,  230,  230,  230,  230
+    } ;
+
+static yyconst short int yy_nxt[408] =
+    {   0,
+        6,    7,    8,    9,    6,   10,    6,   11,    6,   12,
+        6,    6,    6,    6,    6,   13,   14,    6,   15,    6,
+       16,   17,    6,    6,    6,    6,    6,   18,   19,    6,
+        6,   14,   20,   21,   22,    6,   23,    6,    6,    6,
+        6,   24,   25,   26,   33,   27,   28,   27,   27,   27,
+       27,   27,   29,   30,   31,   32,   30,   31,   39,   45,
+      229,   48,   40,   34,   51,   51,   55,   55,   46,   53,
+       53,   53,   53,   49,  228,   35,   33,   36,   50,   37,
+       39,   56,   33,   54,   40,   59,   29,   30,   31,   32,
+       30,   31,   32,   30,   31,   34,   51,   51,   55,   55,
+
+      227,   34,   53,   53,   53,   53,   39,   35,   33,   36,
+       40,   37,  226,   35,   62,   36,  225,   37,   43,   43,
+       43,   43,   43,   43,   71,   63,   74,   34,  224,   77,
+       82,   82,   92,   92,  157,   72,  157,   75,  223,   35,
+       78,   36,  111,   37,   83,  222,   93,   97,   97,   82,
+       84,   92,   94,  118,  112,  101,  102,  106,  106,  113,
+      116,   98,  103,  121,  104,  119,   97,   99,  105,  124,
+      120,  107,  127,  117,  138,  122,  106,  108,  130,  133,
+      123,  125,  140,  221,  128,  145,  126,  139,  154,  129,
+      131,  134,  156,  156,  141,  132,  135,  220,  146,  142,
+
+      160,  155,  160,  162,  164,  162,  164,  166,  168,  166,
+      168,  170,  173,  170,  173,  201,  202,  205,  219,  207,
+      206,  208,  209,  211,  210,  218,  217,  216,  215,  212,
+       43,  214,   43,   57,   57,   57,   58,   58,   79,   79,
+      110,  213,  110,  110,  110,  110,  204,  141,  134,  131,
+      128,  125,  122,  119,  112,  106,  203,  200,  199,  198,
+       97,  197,  196,   92,  195,  194,  193,  192,  191,  190,
+      189,  188,  187,  186,  185,  184,   82,  183,  182,  106,
+      181,  106,  106,  180,  179,  178,  177,  176,   97,  175,
+       97,   97,  174,  173,   92,  172,   92,   92,  171,  170,
+
+      169,  168,  167,  166,  165,  164,  163,  162,  161,  160,
+       82,  159,   82,   82,  158,  157,  153,  152,  151,  150,
+      149,  148,  147,  144,  143,  137,  136,  115,  114,  109,
+      100,   96,   95,   91,   90,   89,   88,   87,   86,   85,
+       81,   80,   59,   76,   73,   70,   69,   68,   67,   66,
+       65,   64,   61,   60,   30,   59,   56,   52,   47,   44,
+       42,   41,   38,   30,  230,    5,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+
+      230,  230,  230,  230,  230,  230,  230
+    } ;
+
+static yyconst short int yy_chk[408] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    3,    3,    3,   10,    3,    3,    3,    3,    3,
+        3,    3,    7,    7,    7,    8,    8,    8,   12,   17,
+      228,   19,   12,   10,   20,   20,   23,   23,   17,   22,
+       22,   22,   22,   19,  226,   10,   25,   10,   19,   10,
+       28,   25,   33,   22,   28,   28,   29,   29,   29,   30,
+       30,   30,   32,   32,   32,   25,   35,   35,   37,   37,
+
+      224,   33,   36,   36,   36,   36,   39,   25,   40,   25,
+       39,   25,  218,   33,   43,   33,  217,   33,   34,   34,
+       34,   34,   34,   34,   51,   43,   53,   40,  216,   55,
+       62,   62,   71,   71,  113,   51,  113,   53,  215,   40,
+       55,   40,   81,   40,   62,  214,   71,   74,   74,   62,
+       62,   71,   71,   86,   81,   76,   76,   77,   77,   81,
+       85,   74,   76,   87,   76,   86,   74,   74,   76,   88,
+       86,   77,   89,   85,   95,   87,   77,   77,   90,   91,
+       87,   88,   96,  213,   89,  100,   88,   95,  109,   89,
+       90,   91,  110,  110,   96,   90,   91,  212,  100,   96,
+
+      120,  109,  120,  123,  126,  123,  126,  129,  132,  129,
+      132,  135,  142,  135,  142,  179,  179,  201,  211,  202,
+      201,  202,  202,  203,  202,  210,  209,  208,  207,  203,
+      231,  206,  231,  232,  232,  232,  233,  233,  234,  234,
+      235,  205,  235,  235,  235,  235,  199,  196,  194,  192,
+      190,  188,  186,  184,  182,  181,  180,  178,  177,  176,
+      175,  174,  173,  172,  171,  170,  169,  168,  167,  166,
+      165,  164,  163,  162,  161,  160,  159,  158,  157,  155,
+      154,  153,  152,  151,  150,  149,  148,  147,  146,  145,
+      144,  143,  141,  140,  139,  138,  137,  136,  134,  133,
+
+      131,  130,  128,  127,  125,  124,  122,  121,  119,  118,
+      117,  116,  115,  114,  112,  111,  108,  107,  105,  104,
+      103,  102,  101,   99,   98,   94,   93,   84,   83,   78,
+       75,   73,   72,   70,   69,   68,   67,   66,   64,   63,
+       61,   60,   57,   54,   52,   50,   49,   48,   47,   46,
+       45,   44,   42,   41,   31,   27,   24,   21,   18,   16,
+       15,   14,   11,    9,    5,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
+
+      230,  230,  230,  230,  230,  230,  230
+    } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yytext;
+#line 1 "ps1.0_tokens.l"
+#define INITIAL 0
+/* definitions */
+#line 8 "ps1.0_tokens.l"
+
+#include <stdlib.h>
+#include <list>
+#include <vector>
+
+#include "ps1.0_program.h"
+
+using namespace std;
+using namespace ps10;
+
+#include "_ps1.0_parser.h"
+
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+
+#define YY_INPUT(buf,result,max_size)                            \
+{                                                                \
+	int c = *myin++;                                             \
+	result = (c == 0) ? YY_NULL : (buf[0] = c, 1);               \
+}
+
+#define YY_ALWAYS_INTERACTIVE 1
+
+//#define DBG_MESG(msg, line)  	errors.set(msg, line)
+#define DBG_MESG(msg, line)
+
+static char buf[80];
+
+
+#define DEFSTATE 1
+
+/* end of definitions */
+#line 583 "_ps1.0_lexer.cpp"
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap YY_PROTO(( void ));
+#else
+extern int yywrap YY_PROTO(( void ));
+#endif
+#endif
+
+#ifndef YY_NO_UNPUT
+static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput YY_PROTO(( void ));
+#else
+static int input YY_PROTO(( void ));
+#endif
+#endif
+
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
+#ifdef YY_MALLOC_DECL
+YY_MALLOC_DECL
+#else
+#if __STDC__
+#ifndef __cplusplus
+#include <stdlib.h>
+#endif
+#else
+/* Just try to get by without declaring the routines.  This will fail
+ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+ * or sizeof(void*) != sizeof(int).
+ */
+#endif
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+	if ( yy_current_buffer->yy_is_interactive ) \
+		{ \
+		int c = '*', n; \
+		for ( n = 0; n < max_size && \
+			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+			buf[n] = (char) c; \
+		if ( c == '\n' ) \
+			buf[n++] = (char) c; \
+		if ( c == EOF && ferror( yyin ) ) \
+			YY_FATAL_ERROR( "input in flex scanner failed" ); \
+		result = n; \
+		} \
+	else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
+		  && ferror( yyin ) ) \
+		YY_FATAL_ERROR( "input in flex scanner failed" );
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL int yylex YY_PROTO(( void ))
+#endif
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+	YY_USER_ACTION
+
+YY_DECL
+	{
+	register yy_state_type yy_current_state;
+	register char *yy_cp = NULL, *yy_bp = NULL;
+	register int yy_act;
+
+#line 43 "ps1.0_tokens.l"
+
+
+#line 737 "_ps1.0_lexer.cpp"
+
+	if ( yy_init )
+		{
+		yy_init = 0;
+
+#ifdef YY_USER_INIT
+		YY_USER_INIT;
+#endif
+
+		if ( ! yy_start )
+			yy_start = 1;	/* first start state */
+
+		if ( ! yyin )
+			yyin = stdin;
+
+		if ( ! yyout )
+			yyout = stdout;
+
+		if ( ! yy_current_buffer )
+			yy_current_buffer =
+				yy_create_buffer( yyin, YY_BUF_SIZE );
+
+		yy_load_buffer_state();
+		}
+
+	while ( 1 )		/* loops until end-of-file is reached */
+		{
+		yy_cp = yy_c_buf_p;
+
+		/* Support of yytext. */
+		*yy_cp = yy_hold_char;
+
+		/* yy_bp points to the position in yy_ch_buf of the start of
+		 * the current run.
+		 */
+		yy_bp = yy_cp;
+
+		yy_current_state = yy_start;
+yy_match:
+		do
+			{
+			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+			if ( yy_accept[yy_current_state] )
+				{
+				yy_last_accepting_state = yy_current_state;
+				yy_last_accepting_cpos = yy_cp;
+				}
+			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+				{
+				yy_current_state = (int) yy_def[yy_current_state];
+				if ( yy_current_state >= 231 )
+					yy_c = yy_meta[(unsigned int) yy_c];
+				}
+			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+			++yy_cp;
+			}
+		while ( yy_base[yy_current_state] != 366 );
+
+yy_find_action:
+		yy_act = yy_accept[yy_current_state];
+		if ( yy_act == 0 )
+			{ /* have to back up */
+			yy_cp = yy_last_accepting_cpos;
+			yy_current_state = yy_last_accepting_state;
+			yy_act = yy_accept[yy_current_state];
+			}
+
+		YY_DO_BEFORE_ACTION;
+
+
+do_action:	/* This label is used only to access EOF actions. */
+
+
+		switch ( yy_act )
+	{ /* beginning of action switch */
+			case 0: /* must back up */
+			/* undo the effects of YY_DO_BEFORE_ACTION */
+			*yy_cp = yy_hold_char;
+			yy_cp = yy_last_accepting_cpos;
+			yy_current_state = yy_last_accepting_state;
+			goto yy_find_action;
+
+case 1:
+#line 46 "ps1.0_tokens.l"
+case 2:
+YY_RULE_SETUP
+#line 46 "ps1.0_tokens.l"
+{
+			    char ch;
+			    while ((ch = yyinput()) != '\n')
+					;
+				line_number++;
+				DBG_MESG("dbg: comment, NEWLINE", line_number-1);
+				return NEWLINE;
+			}
+	YY_BREAK
+case 3:
+#line 56 "ps1.0_tokens.l"
+case 4:
+#line 57 "ps1.0_tokens.l"
+case 5:
+YY_RULE_SETUP
+#line 57 "ps1.0_tokens.l"
+{
+				ps10_lval.fval = (float)atof(yytext);
+				// debug
+				DBG_MESG("dbg: NUMBER", line_number);
+				return NUMBER;
+			}
+	YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 67 "ps1.0_tokens.l"
+{
+				// debug
+				DBG_MESG("dbg: DEF", line_number);
+				BEGIN DEFSTATE;
+				return DEF;
+			}
+	YY_BREAK
+case 7:
+#line 76 "ps1.0_tokens.l"
+case 8:
+#line 77 "ps1.0_tokens.l"
+case 9:
+#line 78 "ps1.0_tokens.l"
+case 10:
+YY_RULE_SETUP
+#line 78 "ps1.0_tokens.l"
+{
+				sprintf(buf, "dbg: REG = %s", yytext);
+				// debug
+				DBG_MESG(buf, line_number);
+				ps10_lval.sval = new string(yytext);
+				return REG;
+			}
+	YY_BREAK
+case 11:
+#line 87 "ps1.0_tokens.l"
+case 12:
+#line 88 "ps1.0_tokens.l"
+case 13:
+#line 89 "ps1.0_tokens.l"
+case 14:
+#line 90 "ps1.0_tokens.l"
+case 15:
+#line 91 "ps1.0_tokens.l"
+case 16:
+#line 92 "ps1.0_tokens.l"
+case 17:
+#line 93 "ps1.0_tokens.l"
+case 18:
+YY_RULE_SETUP
+#line 93 "ps1.0_tokens.l"
+{
+				sprintf(buf, "dbg: BLENDOP = %s", yytext);
+				// debug
+				DBG_MESG(buf, line_number);
+				ps10_lval.sval = new string(yytext);
+				return BLENDOP;
+			}
+	YY_BREAK
+case 19:
+#line 102 "ps1.0_tokens.l"
+case 20:
+#line 103 "ps1.0_tokens.l"
+case 21:
+#line 104 "ps1.0_tokens.l"
+case 22:
+#line 105 "ps1.0_tokens.l"
+case 23:
+#line 106 "ps1.0_tokens.l"
+case 24:
+#line 107 "ps1.0_tokens.l"
+case 25:
+#line 108 "ps1.0_tokens.l"
+case 26:
+#line 109 "ps1.0_tokens.l"
+case 27:
+#line 110 "ps1.0_tokens.l"
+case 28:
+#line 111 "ps1.0_tokens.l"
+case 29:
+#line 112 "ps1.0_tokens.l"
+case 30:
+#line 113 "ps1.0_tokens.l"
+case 31:
+YY_RULE_SETUP
+#line 113 "ps1.0_tokens.l"
+{
+				sprintf(buf, "dbg: ADDROP = %s", yytext);
+				// debug
+				DBG_MESG(buf, line_number);
+				ps10_lval.sval = new string(yytext);
+				return ADDROP;
+			}
+	YY_BREAK
+case 32:
+YY_RULE_SETUP
+#line 123 "ps1.0_tokens.l"
+{
+				line_number++;
+				BEGIN 0;
+				// debug
+				DBG_MESG("dbg: NEWLINE", line_number-1);
+				return NEWLINE;
+			}
+	YY_BREAK
+case 33:
+YY_RULE_SETUP
+#line 131 "ps1.0_tokens.l"
+{
+			}
+	YY_BREAK
+case 34:
+YY_RULE_SETUP
+#line 134 "ps1.0_tokens.l"
+{
+				return HEADER;
+			}
+	YY_BREAK
+case 35:
+YY_RULE_SETUP
+#line 138 "ps1.0_tokens.l"
+{
+				char buf[40];
+				sprintf(buf, "character token == '%c'", *yytext);
+				DBG_MESG(buf, line_number);
+				return *yytext;
+			}
+	YY_BREAK
+case 36:
+YY_RULE_SETUP
+#line 145 "ps1.0_tokens.l"
+ECHO;
+	YY_BREAK
+#line 974 "_ps1.0_lexer.cpp"
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(DEFSTATE):
+	yyterminate();
+
+	case YY_END_OF_BUFFER:
+		{
+		/* Amount of text matched not including the EOB char. */
+		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+
+		/* Undo the effects of YY_DO_BEFORE_ACTION. */
+		*yy_cp = yy_hold_char;
+		YY_RESTORE_YY_MORE_OFFSET
+
+		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+			{
+			/* We're scanning a new file or input source.  It's
+			 * possible that this happened because the user
+			 * just pointed yyin at a new source and called
+			 * yylex().  If so, then we have to assure
+			 * consistency between yy_current_buffer and our
+			 * globals.  Here is the right place to do so, because
+			 * this is the first action (other than possibly a
+			 * back-up) that will match for the new input source.
+			 */
+			yy_n_chars = yy_current_buffer->yy_n_chars;
+			yy_current_buffer->yy_input_file = yyin;
+			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+			}
+
+		/* Note that here we test for yy_c_buf_p "<=" to the position
+		 * of the first EOB in the buffer, since yy_c_buf_p will
+		 * already have been incremented past the NUL character
+		 * (since all states make transitions on EOB to the
+		 * end-of-buffer state).  Contrast this with the test
+		 * in input().
+		 */
+		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+			{ /* This was really a NUL. */
+			yy_state_type yy_next_state;
+
+			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+
+			yy_current_state = yy_get_previous_state();
+
+			/* Okay, we're now positioned to make the NUL
+			 * transition.  We couldn't have
+			 * yy_get_previous_state() go ahead and do it
+			 * for us because it doesn't know how to deal
+			 * with the possibility of jamming (and we don't
+			 * want to build jamming into it because then it
+			 * will run more slowly).
+			 */
+
+			yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+			yy_bp = yytext_ptr + YY_MORE_ADJ;
+
+			if ( yy_next_state )
+				{
+				/* Consume the NUL. */
+				yy_cp = ++yy_c_buf_p;
+				yy_current_state = yy_next_state;
+				goto yy_match;
+				}
+
+			else
+				{
+				yy_cp = yy_c_buf_p;
+				goto yy_find_action;
+				}
+			}
+
+		else switch ( yy_get_next_buffer() )
+			{
+			case EOB_ACT_END_OF_FILE:
+				{
+				yy_did_buffer_switch_on_eof = 0;
+
+				if ( yywrap() )
+					{
+					/* Note: because we've taken care in
+					 * yy_get_next_buffer() to have set up
+					 * yytext, we can now set up
+					 * yy_c_buf_p so that if some total
+					 * hoser (like flex itself) wants to
+					 * call the scanner after we return the
+					 * YY_NULL, it'll still work - another
+					 * YY_NULL will get returned.
+					 */
+					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+					yy_act = YY_STATE_EOF(YY_START);
+					goto do_action;
+					}
+
+				else
+					{
+					if ( ! yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+					}
+				break;
+				}
+
+			case EOB_ACT_CONTINUE_SCAN:
+				yy_c_buf_p =
+					yytext_ptr + yy_amount_of_matched_text;
+
+				yy_current_state = yy_get_previous_state();
+
+				yy_cp = yy_c_buf_p;
+				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				goto yy_match;
+
+			case EOB_ACT_LAST_MATCH:
+				yy_c_buf_p =
+				&yy_current_buffer->yy_ch_buf[yy_n_chars];
+
+				yy_current_state = yy_get_previous_state();
+
+				yy_cp = yy_c_buf_p;
+				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				goto yy_find_action;
+			}
+		break;
+		}
+
+	default:
+		YY_FATAL_ERROR(
+			"fatal flex scanner internal error--no action found" );
+	} /* end of action switch */
+		} /* end of scanning one token */
+	} /* end of yylex */
+
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ *	EOB_ACT_LAST_MATCH -
+ *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *	EOB_ACT_END_OF_FILE - end of file
+ */
+
+static int yy_get_next_buffer()
+	{
+	register char *dest = yy_current_buffer->yy_ch_buf;
+	register char *source = yytext_ptr;
+	register int number_to_move, i;
+	int ret_val;
+
+	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+		YY_FATAL_ERROR(
+		"fatal flex scanner internal error--end of buffer missed" );
+
+	if ( yy_current_buffer->yy_fill_buffer == 0 )
+		{ /* Don't try to fill the buffer, so this is an EOF. */
+		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+			{
+			/* We matched a single character, the EOB, so
+			 * treat this as a final EOF.
+			 */
+			return EOB_ACT_END_OF_FILE;
+			}
+
+		else
+			{
+			/* We matched some text prior to the EOB, first
+			 * process it.
+			 */
+			return EOB_ACT_LAST_MATCH;
+			}
+		}
+
+	/* Try to read more data. */
+
+	/* First move last chars to start of buffer. */
+	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+
+	for ( i = 0; i < number_to_move; ++i )
+		*(dest++) = *(source++);
+
+	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+		/* don't do the read, it's not guaranteed to return an EOF,
+		 * just force an EOF
+		 */
+		yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+
+	else
+		{
+		int num_to_read =
+			yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+		while ( num_to_read <= 0 )
+			{ /* Not enough room in the buffer - grow it. */
+#ifdef YY_USES_REJECT
+			YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+			/* just a shorter name for the current buffer */
+			YY_BUFFER_STATE b = yy_current_buffer;
+
+			int yy_c_buf_p_offset =
+				(int) (yy_c_buf_p - b->yy_ch_buf);
+
+			if ( b->yy_is_our_buffer )
+				{
+				int new_size = b->yy_buf_size * 2;
+
+				if ( new_size <= 0 )
+					b->yy_buf_size += b->yy_buf_size / 8;
+				else
+					b->yy_buf_size *= 2;
+
+				b->yy_ch_buf = (char *)
+					/* Include room in for 2 EOB chars. */
+					yy_flex_realloc( (void *) b->yy_ch_buf,
+							 b->yy_buf_size + 2 );
+				}
+			else
+				/* Can't grow it, we don't own it. */
+				b->yy_ch_buf = 0;
+
+			if ( ! b->yy_ch_buf )
+				YY_FATAL_ERROR(
+				"fatal error - scanner input buffer overflow" );
+
+			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+			num_to_read = yy_current_buffer->yy_buf_size -
+						number_to_move - 1;
+#endif
+			}
+
+		if ( num_to_read > YY_READ_BUF_SIZE )
+			num_to_read = YY_READ_BUF_SIZE;
+
+		/* Read in more data. */
+		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+			yy_n_chars, num_to_read );
+
+		yy_current_buffer->yy_n_chars = yy_n_chars;
+		}
+
+	if ( yy_n_chars == 0 )
+		{
+		if ( number_to_move == YY_MORE_ADJ )
+			{
+			ret_val = EOB_ACT_END_OF_FILE;
+			yyrestart( yyin );
+			}
+
+		else
+			{
+			ret_val = EOB_ACT_LAST_MATCH;
+			yy_current_buffer->yy_buffer_status =
+				YY_BUFFER_EOF_PENDING;
+			}
+		}
+
+	else
+		ret_val = EOB_ACT_CONTINUE_SCAN;
+
+	yy_n_chars += number_to_move;
+	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+
+	return ret_val;
+	}
+
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+static yy_state_type yy_get_previous_state()
+	{
+	register yy_state_type yy_current_state;
+	register char *yy_cp;
+
+	yy_current_state = yy_start;
+
+	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+		{
+		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+		if ( yy_accept[yy_current_state] )
+			{
+			yy_last_accepting_state = yy_current_state;
+			yy_last_accepting_cpos = yy_cp;
+			}
+		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+			{
+			yy_current_state = (int) yy_def[yy_current_state];
+			if ( yy_current_state >= 231 )
+				yy_c = yy_meta[(unsigned int) yy_c];
+			}
+		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+		}
+
+	return yy_current_state;
+	}
+
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ *	next_state = yy_try_NUL_trans( current_state );
+ */
+
+#ifdef YY_USE_PROTOS
+static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+#else
+static yy_state_type yy_try_NUL_trans( yy_current_state )
+yy_state_type yy_current_state;
+#endif
+	{
+	register int yy_is_jam;
+	register char *yy_cp = yy_c_buf_p;
+
+	register YY_CHAR yy_c = 1;
+	if ( yy_accept[yy_current_state] )
+		{
+		yy_last_accepting_state = yy_current_state;
+		yy_last_accepting_cpos = yy_cp;
+		}
+	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+		{
+		yy_current_state = (int) yy_def[yy_current_state];
+		if ( yy_current_state >= 231 )
+			yy_c = yy_meta[(unsigned int) yy_c];
+		}
+	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+	yy_is_jam = (yy_current_state == 230);
+
+	return yy_is_jam ? 0 : yy_current_state;
+	}
+
+
+#ifndef YY_NO_UNPUT
+#ifdef YY_USE_PROTOS
+static void yyunput( int c, register char *yy_bp )
+#else
+static void yyunput( c, yy_bp )
+int c;
+register char *yy_bp;
+#endif
+	{
+	register char *yy_cp = yy_c_buf_p;
+
+	/* undo effects of setting up yytext */
+	*yy_cp = yy_hold_char;
+
+	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+		{ /* need to shift things up to make room */
+		/* +2 for EOB chars. */
+		register int number_to_move = yy_n_chars + 2;
+		register char *dest = &yy_current_buffer->yy_ch_buf[
+					yy_current_buffer->yy_buf_size + 2];
+		register char *source =
+				&yy_current_buffer->yy_ch_buf[number_to_move];
+
+		while ( source > yy_current_buffer->yy_ch_buf )
+			*--dest = *--source;
+
+		yy_cp += (int) (dest - source);
+		yy_bp += (int) (dest - source);
+		yy_current_buffer->yy_n_chars =
+			yy_n_chars = yy_current_buffer->yy_buf_size;
+
+		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+			YY_FATAL_ERROR( "flex scanner push-back overflow" );
+		}
+
+	*--yy_cp = (char) c;
+
+
+	yytext_ptr = yy_bp;
+	yy_hold_char = *yy_cp;
+	yy_c_buf_p = yy_cp;
+	}
+#endif	/* ifndef YY_NO_UNPUT */
+
+
+#ifdef __cplusplus
+static int yyinput()
+#else
+static int input()
+#endif
+	{
+	int c;
+
+	*yy_c_buf_p = yy_hold_char;
+
+	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+		{
+		/* yy_c_buf_p now points to the character we want to return.
+		 * If this occurs *before* the EOB characters, then it's a
+		 * valid NUL; if not, then we've hit the end of the buffer.
+		 */
+		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+			/* This was really a NUL. */
+			*yy_c_buf_p = '\0';
+
+		else
+			{ /* need more input */
+			int offset = yy_c_buf_p - yytext_ptr;
+			++yy_c_buf_p;
+
+			switch ( yy_get_next_buffer() )
+				{
+				case EOB_ACT_LAST_MATCH:
+					/* This happens because yy_g_n_b()
+					 * sees that we've accumulated a
+					 * token and flags that we need to
+					 * try matching the token before
+					 * proceeding.  But for input(),
+					 * there's no matching to consider.
+					 * So convert the EOB_ACT_LAST_MATCH
+					 * to EOB_ACT_END_OF_FILE.
+					 */
+
+					/* Reset buffer status. */
+					yyrestart( yyin );
+
+					/* fall through */
+
+				case EOB_ACT_END_OF_FILE:
+					{
+					if ( yywrap() )
+						return EOF;
+
+					if ( ! yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+#ifdef __cplusplus
+					return yyinput();
+#else
+					return input();
+#endif
+					}
+
+				case EOB_ACT_CONTINUE_SCAN:
+					yy_c_buf_p = yytext_ptr + offset;
+					break;
+				}
+			}
+		}
+
+	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
+	*yy_c_buf_p = '\0';	/* preserve yytext */
+	yy_hold_char = *++yy_c_buf_p;
+
+
+	return c;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yyrestart( FILE *input_file )
+#else
+void yyrestart( input_file )
+FILE *input_file;
+#endif
+	{
+	if ( ! yy_current_buffer )
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+	yy_init_buffer( yy_current_buffer, input_file );
+	yy_load_buffer_state();
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+#else
+void yy_switch_to_buffer( new_buffer )
+YY_BUFFER_STATE new_buffer;
+#endif
+	{
+	if ( yy_current_buffer == new_buffer )
+		return;
+
+	if ( yy_current_buffer )
+		{
+		/* Flush out information for old buffer. */
+		*yy_c_buf_p = yy_hold_char;
+		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+		yy_current_buffer->yy_n_chars = yy_n_chars;
+		}
+
+	yy_current_buffer = new_buffer;
+	yy_load_buffer_state();
+
+	/* We don't actually know whether we did this switch during
+	 * EOF (yywrap()) processing, but the only time this flag
+	 * is looked at is after yywrap() is called, so it's safe
+	 * to go ahead and always set it.
+	 */
+	yy_did_buffer_switch_on_eof = 1;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_load_buffer_state( void )
+#else
+void yy_load_buffer_state()
+#endif
+	{
+	yy_n_chars = yy_current_buffer->yy_n_chars;
+	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+	yyin = yy_current_buffer->yy_input_file;
+	yy_hold_char = *yy_c_buf_p;
+	}
+
+
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+#else
+YY_BUFFER_STATE yy_create_buffer( file, size )
+FILE *file;
+int size;
+#endif
+	{
+	YY_BUFFER_STATE b;
+
+	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_buf_size = size;
+
+	/* yy_ch_buf has to be 2 characters longer than the size given because
+	 * we need to put in 2 end-of-buffer characters.
+	 */
+	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+	if ( ! b->yy_ch_buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_is_our_buffer = 1;
+
+	yy_init_buffer( b, file );
+
+	return b;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_delete_buffer( YY_BUFFER_STATE b )
+#else
+void yy_delete_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+	{
+	if ( ! b )
+		return;
+
+	if ( b == yy_current_buffer )
+		yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+	if ( b->yy_is_our_buffer )
+		yy_flex_free( (void *) b->yy_ch_buf );
+
+	yy_flex_free( (void *) b );
+	}
+
+
+
+#ifdef YY_USE_PROTOS
+void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+#else
+void yy_init_buffer( b, file )
+YY_BUFFER_STATE b;
+FILE *file;
+#endif
+
+
+	{
+	yy_flush_buffer( b );
+
+	b->yy_input_file = file;
+	b->yy_fill_buffer = 1;
+
+#if YY_ALWAYS_INTERACTIVE
+	b->yy_is_interactive = 1;
+#else
+#if YY_NEVER_INTERACTIVE
+	b->yy_is_interactive = 0;
+#else
+	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+#endif
+#endif
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_flush_buffer( YY_BUFFER_STATE b )
+#else
+void yy_flush_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+
+	{
+	if ( ! b )
+		return;
+
+	b->yy_n_chars = 0;
+
+	/* We always need two end-of-buffer characters.  The first causes
+	 * a transition to the end-of-buffer state.  The second causes
+	 * a jam in that state.
+	 */
+	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+	b->yy_buf_pos = &b->yy_ch_buf[0];
+
+	b->yy_at_bol = 1;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	if ( b == yy_current_buffer )
+		yy_load_buffer_state();
+	}
+
+
+#ifndef YY_NO_SCAN_BUFFER
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+#else
+YY_BUFFER_STATE yy_scan_buffer( base, size )
+char *base;
+yy_size_t size;
+#endif
+	{
+	YY_BUFFER_STATE b;
+
+	if ( size < 2 ||
+	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
+	     base[size-1] != YY_END_OF_BUFFER_CHAR )
+		/* They forgot to leave room for the EOB's. */
+		return 0;
+
+	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
+	b->yy_buf_pos = b->yy_ch_buf = base;
+	b->yy_is_our_buffer = 0;
+	b->yy_input_file = 0;
+	b->yy_n_chars = b->yy_buf_size;
+	b->yy_is_interactive = 0;
+	b->yy_at_bol = 1;
+	b->yy_fill_buffer = 0;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	yy_switch_to_buffer( b );
+
+	return b;
+	}
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+#else
+YY_BUFFER_STATE yy_scan_string( yy_str )
+yyconst char *yy_str;
+#endif
+	{
+	int len;
+	for ( len = 0; yy_str[len]; ++len )
+		;
+
+	return yy_scan_bytes( yy_str, len );
+	}
+#endif
+
+
+#ifndef YY_NO_SCAN_BYTES
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
+#else
+YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+yyconst char *bytes;
+int len;
+#endif
+	{
+	YY_BUFFER_STATE b;
+	char *buf;
+	yy_size_t n;
+	int i;
+
+	/* Get memory for full buffer, including space for trailing EOB's. */
+	n = len + 2;
+	buf = (char *) yy_flex_alloc( n );
+	if ( ! buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+	for ( i = 0; i < len; ++i )
+		buf[i] = bytes[i];
+
+	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+	b = yy_scan_buffer( buf, n );
+	if ( ! b )
+		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+	/* It's okay to grow etc. this buffer, and we should throw it
+	 * away when we're done.
+	 */
+	b->yy_is_our_buffer = 1;
+
+	return b;
+	}
+#endif
+
+
+#ifndef YY_NO_PUSH_STATE
+#ifdef YY_USE_PROTOS
+static void yy_push_state( int new_state )
+#else
+static void yy_push_state( new_state )
+int new_state;
+#endif
+	{
+	if ( yy_start_stack_ptr >= yy_start_stack_depth )
+		{
+		yy_size_t new_size;
+
+		yy_start_stack_depth += YY_START_STACK_INCR;
+		new_size = yy_start_stack_depth * sizeof( int );
+
+		if ( ! yy_start_stack )
+			yy_start_stack = (int *) yy_flex_alloc( new_size );
+
+		else
+			yy_start_stack = (int *) yy_flex_realloc(
+					(void *) yy_start_stack, new_size );
+
+		if ( ! yy_start_stack )
+			YY_FATAL_ERROR(
+			"out of memory expanding start-condition stack" );
+		}
+
+	yy_start_stack[yy_start_stack_ptr++] = YY_START;
+
+	BEGIN(new_state);
+	}
+#endif
+
+
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state()
+	{
+	if ( --yy_start_stack_ptr < 0 )
+		YY_FATAL_ERROR( "start-condition stack underflow" );
+
+	BEGIN(yy_start_stack[yy_start_stack_ptr]);
+	}
+#endif
+
+
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state()
+	{
+	return yy_start_stack[yy_start_stack_ptr - 1];
+	}
+#endif
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+#ifdef YY_USE_PROTOS
+static void yy_fatal_error( yyconst char msg[] )
+#else
+static void yy_fatal_error( msg )
+char msg[];
+#endif
+	{
+	(void) fprintf( stderr, "%s\n", msg );
+	exit( YY_EXIT_FAILURE );
+	}
+
+
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+		yytext[yyleng] = yy_hold_char; \
+		yy_c_buf_p = yytext + n; \
+		yy_hold_char = *yy_c_buf_p; \
+		*yy_c_buf_p = '\0'; \
+		yyleng = n; \
+		} \
+	while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef yytext_ptr
+#ifdef YY_USE_PROTOS
+static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
+#else
+static void yy_flex_strncpy( s1, s2, n )
+char *s1;
+yyconst char *s2;
+int n;
+#endif
+	{
+	register int i;
+	for ( i = 0; i < n; ++i )
+		s1[i] = s2[i];
+	}
+#endif
+
+#ifdef YY_NEED_STRLEN
+#ifdef YY_USE_PROTOS
+static int yy_flex_strlen( yyconst char *s )
+#else
+static int yy_flex_strlen( s )
+yyconst char *s;
+#endif
+	{
+	register int n;
+	for ( n = 0; s[n]; ++n )
+		;
+
+	return n;
+	}
+#endif
+
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_alloc( yy_size_t size )
+#else
+static void *yy_flex_alloc( size )
+yy_size_t size;
+#endif
+	{
+	return (void *) malloc( size );
+	}
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_realloc( void *ptr, yy_size_t size )
+#else
+static void *yy_flex_realloc( ptr, size )
+void *ptr;
+yy_size_t size;
+#endif
+	{
+	/* The cast to (char *) in the following accommodates both
+	 * implementations that use char* generic pointers, and those
+	 * that use void* generic pointers.  It works with the latter
+	 * because both ANSI C and C++ allow castless assignment from
+	 * any pointer type to void*, and deal with argument conversions
+	 * as though doing an assignment.
+	 */
+	return (void *) realloc( (char *) ptr, size );
+	}
+
+#ifdef YY_USE_PROTOS
+static void yy_flex_free( void *ptr )
+#else
+static void yy_flex_free( ptr )
+void *ptr;
+#endif
+	{
+	free( ptr );
+	}
+
+#if YY_MAIN
+int main()
+	{
+	yylex();
+	return 0;
+	}
+#endif
+#line 145 "ps1.0_tokens.l"
+
+bool ps10_init(char* inputString)
+{
+    myin = inputString;
+	return init_extensions();
+}
+
+#ifndef ps10_wrap
+int ps10_wrap(void)
+{
+  return(1);
+}
+#endif
Index: /RenderSystems/GL/src/nvparse/_ps1.0_parser.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/_ps1.0_parser.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/_ps1.0_parser.cpp	(revision 5)
@@ -0,0 +1,1558 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/* A Bison parser, made by GNU Bison 1.875.  */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+/* Written by Richard Stallman by simplifying the original so called
+   ``semantic'' parser.  */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+   infringing on user name space.  This should be done even for local
+   variables, as they might otherwise be expanded by user macros.
+   There are some unavoidable exceptions within include files to
+   define necessary library symbols; they are noted "INFRINGES ON
+   USER NAME SPACE" below.  */
+
+/* Identify Bison output.  */
+#define YYBISON 1
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+/* If NAME_PREFIX is specified substitute the variables and functions
+   names.  */
+#define yyparse ps10_parse
+#define yylex   ps10_lex
+#define yyerror ps10_error
+#define yylval  ps10_lval
+#define yychar  ps10_char
+#define yydebug ps10_debug
+#define yynerrs ps10_nerrs
+
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     HEADER = 258,
+     NEWLINE = 259,
+     NUMBER = 260,
+     REG = 261,
+     DEF = 262,
+     ADDROP = 263,
+     BLENDOP = 264
+   };
+#endif
+#define HEADER 258
+#define NEWLINE 259
+#define NUMBER 260
+#define REG 261
+#define DEF 262
+#define ADDROP 263
+#define BLENDOP 264
+
+
+
+
+/* Copy the first part of user declarations.  */
+#line 3 "ps1.0_grammar.y"
+
+
+/*
+
+	This is a parser for the DX8 PS1.0 pixel shaders.  I intend
+	to use it to set NV_texture_shader* and NV_register_combiners*
+	state in OpenGL, but the parse tree could be used for any
+	other purpose.
+
+	Cass Everitt
+	7-19-01
+
+*/
+
+void yyerror(char* s);
+int yylex ( void );
+
+#ifdef _WIN32
+# include <windows.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "ps1.0_program.h"
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+#include <list>
+#include <vector>
+
+using namespace std;
+using namespace ps10;
+
+//#define DBG_MESG(msg, line)  	errors.set(msg, line)
+#define DBG_MESG(msg, line)
+
+
+
+
+/* Enabling traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+/* Enabling verbose error messages.  */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#line 43 "ps1.0_grammar.y"
+typedef union YYSTYPE {
+	int ival;
+	float fval;
+	
+	string * sval;
+	constdef * cdef;
+	vector<constdef> * consts;
+	vector<string> * line;
+	list<vector<string> > * lines;
+} YYSTYPE;
+/* Line 191 of yacc.c.  */
+#line 153 "_ps1.0_parser.c"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+/* Copy the second part of user declarations.  */
+
+
+/* Line 214 of yacc.c.  */
+#line 165 "_ps1.0_parser.c"
+
+#if ! defined (yyoverflow) || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols.  */
+
+# if YYSTACK_USE_ALLOCA
+#  define YYSTACK_ALLOC alloca
+# else
+#  ifndef YYSTACK_USE_ALLOCA
+#   if defined (alloca) || defined (_ALLOCA_H)
+#    define YYSTACK_ALLOC alloca
+#   else
+#    ifdef __GNUC__
+#     define YYSTACK_ALLOC __builtin_alloca
+#    endif
+#   endif
+#  endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+   /* Pacify GCC's `empty if-body' warning. */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+# else
+#  if defined (__STDC__) || defined (__cplusplus)
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   define YYSIZE_T size_t
+#  endif
+#  define YYSTACK_ALLOC malloc
+#  define YYSTACK_FREE free
+# endif
+#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+
+
+#if (! defined (yyoverflow) \
+     && (! defined (__cplusplus) \
+	 || (YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member.  */
+union yyalloc
+{
+  short yyss;
+  YYSTYPE yyvs;
+  };
+
+/* The size of the maximum gap between one aligned stack and the next.  */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+   N elements.  */
+# define YYSTACK_BYTES(N) \
+     ((N) * (sizeof (short) + sizeof (YYSTYPE))				\
+      + YYSTACK_GAP_MAXIMUM)
+
+/* Copy COUNT objects from FROM to TO.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if 1 < __GNUC__
+#   define YYCOPY(To, From, Count) \
+      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#  else
+#   define YYCOPY(To, From, Count)		\
+      do					\
+	{					\
+	  register YYSIZE_T yyi;		\
+	  for (yyi = 0; yyi < (Count); yyi++)	\
+	    (To)[yyi] = (From)[yyi];		\
+	}					\
+      while (0)
+#  endif
+# endif
+
+/* Relocate STACK from its old location to the new one.  The
+   local variables YYSIZE and YYSTACKSIZE give the old and new number of
+   elements in the stack, and YYPTR gives the new location of the
+   stack.  Advance YYPTR to a properly aligned location for the next
+   stack.  */
+# define YYSTACK_RELOCATE(Stack)					\
+    do									\
+      {									\
+	YYSIZE_T yynewbytes;						\
+	YYCOPY (&yyptr->Stack, Stack, yysize);				\
+	Stack = &yyptr->Stack;						\
+	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+	yyptr += yynewbytes / sizeof (*yyptr);				\
+      }									\
+    while (0)
+
+#endif
+
+#if defined (__STDC__) || defined (__cplusplus)
+   typedef signed char yysigned_char;
+#else
+   typedef short yysigned_char;
+#endif
+
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL  6
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   80
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS  12
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS  10
+/* YYNRULES -- Number of rules. */
+#define YYNRULES  26
+/* YYNRULES -- Number of states. */
+#define YYNSTATES  63
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   264
+
+#define YYTRANSLATE(YYX) 						\
+  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+static const unsigned char yytranslate[] =
+{
+       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,    11,    10,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
+       5,     6,     7,     8,     9
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const unsigned char yyprhs[] =
+{
+       0,     0,     3,     9,    16,    21,    27,    32,    38,    42,
+      47,    49,    52,    64,    66,    69,    73,    79,    87,    89,
+      92,    99,   108,   119,   120,   122,   124
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yysigned_char yyrhs[] =
+{
+      13,     0,    -1,     3,    21,    14,    16,    18,    -1,    21,
+       3,    21,    14,    16,    18,    -1,     3,    21,    16,    18,
+      -1,    21,     3,    21,    16,    18,    -1,     3,    21,    14,
+      18,    -1,    21,     3,    21,    14,    18,    -1,     3,    21,
+      18,    -1,    21,     3,    21,    18,    -1,    15,    -1,    14,
+      15,    -1,     7,     6,    10,     5,    10,     5,    10,     5,
+      10,     5,    21,    -1,    17,    -1,    16,    17,    -1,     8,
+       6,    21,    -1,     8,     6,    10,     6,    21,    -1,     8,
+       6,    10,     6,    10,     6,    21,    -1,    19,    -1,    18,
+      19,    -1,    20,     9,     6,    10,     6,    21,    -1,    20,
+       9,     6,    10,     6,    10,     6,    21,    -1,    20,     9,
+       6,    10,     6,    10,     6,    10,     6,    21,    -1,    -1,
+      11,    -1,     4,    -1,    21,     4,    -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const unsigned short yyrline[] =
+{
+       0,    72,    72,    79,    86,    93,   100,   107,   114,   121,
+     131,   139,   151,   165,   173,   184,   194,   206,   223,   231,
+     243,   257,   273,   293,   295,   301,   305
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE
+/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+static const char *const yytname[] =
+{
+  "$end", "error", "$undefined", "HEADER", "NEWLINE", "NUMBER", "REG", 
+  "DEF", "ADDROP", "BLENDOP", "','", "'+'", "$accept", "WholeEnchilada", 
+  "Defs", "Def", "AddrOps", "AddrOp", "BlendOps", "BlendOp", "MaybePlus", 
+  "Newlines", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+   token YYLEX-NUM.  */
+static const unsigned short yytoknum[] =
+{
+       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
+      44,    43
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const unsigned char yyr1[] =
+{
+       0,    12,    13,    13,    13,    13,    13,    13,    13,    13,
+      14,    14,    15,    16,    16,    17,    17,    17,    18,    18,
+      19,    19,    19,    20,    20,    21,    21
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const unsigned char yyr2[] =
+{
+       0,     2,     5,     6,     4,     5,     4,     5,     3,     4,
+       1,     2,    11,     1,     2,     3,     5,     7,     1,     2,
+       6,     8,    10,     0,     1,     1,     2
+};
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+   means the default is an error.  */
+static const unsigned char yydefact[] =
+{
+       0,     0,    25,     0,     0,    23,     1,     0,    26,     0,
+       0,    24,    23,    10,    23,    13,     8,    18,     0,    23,
+       0,     0,    11,    23,     6,    14,     4,    19,     0,    23,
+      23,     9,     0,     0,    15,     2,     0,    23,     7,     5,
+       0,     0,     0,     3,     0,     0,    16,     0,     0,     0,
+       0,    20,     0,    17,     0,     0,     0,    21,     0,     0,
+       0,    22,    12
+};
+
+/* YYDEFGOTO[NTERM-NUM]. */
+static const yysigned_char yydefgoto[] =
+{
+      -1,     3,    12,    13,    14,    15,    16,    17,    18,     4
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -15
+static const yysigned_char yypact[] =
+{
+      10,     1,   -15,    47,    52,     0,   -15,     1,   -15,    37,
+      51,   -15,    43,   -15,    41,   -15,    -8,   -15,    53,     0,
+      50,    26,   -15,    41,    -8,   -15,    -8,   -15,    55,    43,
+      41,    -8,    58,    59,    60,    -8,    56,    41,    -8,    -8,
+      57,    27,    62,    -8,    64,    65,    60,    34,    63,     1,
+      66,    60,    69,    60,    35,    67,    70,    60,    73,     1,
+       1,    60,    60
+};
+
+/* YYPGOTO[NTERM-NUM].  */
+static const yysigned_char yypgoto[] =
+{
+     -15,   -15,    61,    -3,     3,     5,     4,   -14,   -15,    -1
+};
+
+/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
+   positive, shift that token.  If negative, reduce the rule which
+   number is the opposite.  If zero, do what YYDEFACT says.
+   If YYTABLE_NINF, syntax error.  */
+#define YYTABLE_NINF -24
+static const yysigned_char yytable[] =
+{
+       5,   -23,    27,    11,     8,     2,    19,     9,    10,    22,
+      27,    11,    27,     1,     2,    23,    24,    27,    26,    25,
+      34,    27,    30,    31,    27,    27,    22,    35,    25,    27,
+       2,     2,    37,    38,    39,    25,    33,    45,     2,     2,
+      46,    43,    25,    20,    50,    56,    51,     6,    53,    10,
+       9,    10,    11,    57,    11,     7,     8,    21,    61,    62,
+      32,    36,    28,    40,     8,    41,    42,    44,    47,    48,
+       0,    49,    54,    52,    55,     0,    59,    58,    60,     0,
+      29
+};
+
+static const yysigned_char yycheck[] =
+{
+       1,     9,    16,    11,     4,     4,     7,     7,     8,    12,
+      24,    11,    26,     3,     4,    12,    12,    31,    14,    14,
+      21,    35,    19,    19,    38,    39,    29,    23,    23,    43,
+       4,     4,    29,    29,    30,    30,    10,    10,     4,     4,
+      41,    37,    37,     6,    10,    10,    47,     0,    49,     8,
+       7,     8,    11,    54,    11,     3,     4,     6,    59,    60,
+      10,     6,     9,     5,     4,     6,    10,    10,     6,     5,
+      -1,     6,     6,    10,     5,    -1,     6,    10,     5,    -1,
+      19
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const unsigned char yystos[] =
+{
+       0,     3,     4,    13,    21,    21,     0,     3,     4,     7,
+       8,    11,    14,    15,    16,    17,    18,    19,    20,    21,
+       6,     6,    15,    16,    18,    17,    18,    19,     9,    14,
+      16,    18,    10,    10,    21,    18,     6,    16,    18,    18,
+       5,     6,    10,    18,    10,    10,    21,     6,     5,     6,
+      10,    21,    10,    21,     6,     5,    10,    21,    10,     6,
+       5,    21,    21
+};
+
+#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
+# define YYSIZE_T __SIZE_TYPE__
+#endif
+#if ! defined (YYSIZE_T) && defined (size_t)
+# define YYSIZE_T size_t
+#endif
+#if ! defined (YYSIZE_T)
+# if defined (__STDC__) || defined (__cplusplus)
+#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYSIZE_T size_t
+# endif
+#endif
+#if ! defined (YYSIZE_T)
+# define YYSIZE_T unsigned int
+#endif
+
+#define yyerrok		(yyerrstatus = 0)
+#define yyclearin	(yychar = YYEMPTY)
+#define YYEMPTY		(-2)
+#define YYEOF		0
+
+#define YYACCEPT	goto yyacceptlab
+#define YYABORT		goto yyabortlab
+#define YYERROR		goto yyerrlab1
+
+
+/* Like YYERROR except do call yyerror.  This remains here temporarily
+   to ease the transition to the new meaning of YYERROR, for GCC.
+   Once GCC version 2 has supplanted version 1, this can go.  */
+
+#define YYFAIL		goto yyerrlab
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)					\
+do								\
+  if (yychar == YYEMPTY && yylen == 1)				\
+    {								\
+      yychar = (Token);						\
+      yylval = (Value);						\
+      yytoken = YYTRANSLATE (yychar);				\
+      YYPOPSTACK;						\
+      goto yybackup;						\
+    }								\
+  else								\
+    { 								\
+      yyerror ("syntax error: cannot back up");\
+      YYERROR;							\
+    }								\
+while (0)
+
+#define YYTERROR	1
+#define YYERRCODE	256
+
+/* YYLLOC_DEFAULT -- Compute the default location (before the actions
+   are run).  */
+
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N)         \
+  Current.first_line   = Rhs[1].first_line;      \
+  Current.first_column = Rhs[1].first_column;    \
+  Current.last_line    = Rhs[N].last_line;       \
+  Current.last_column  = Rhs[N].last_column;
+#endif
+
+/* YYLEX -- calling `yylex' with the right arguments.  */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#endif
+
+/* Enable debugging if requested.  */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args)			\
+do {						\
+  if (yydebug)					\
+    YYFPRINTF Args;				\
+} while (0)
+
+# define YYDSYMPRINT(Args)			\
+do {						\
+  if (yydebug)					\
+    yysymprint Args;				\
+} while (0)
+
+# define YYDSYMPRINTF(Title, Token, Value, Location)		\
+do {								\
+  if (yydebug)							\
+    {								\
+      YYFPRINTF (stderr, "%s ", Title);				\
+      yysymprint (stderr, 					\
+                  Token, Value);	\
+      YYFPRINTF (stderr, "\n");					\
+    }								\
+} while (0)
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (cinluded).                                                   |
+`------------------------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_stack_print (short *bottom, short *top)
+#else
+static void
+yy_stack_print (bottom, top)
+    short *bottom;
+    short *top;
+#endif
+{
+  YYFPRINTF (stderr, "Stack now");
+  for (/* Nothing. */; bottom <= top; ++bottom)
+    YYFPRINTF (stderr, " %d", *bottom);
+  YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top)				\
+do {								\
+  if (yydebug)							\
+    yy_stack_print ((Bottom), (Top));				\
+} while (0)
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced.  |
+`------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_reduce_print (int yyrule)
+#else
+static void
+yy_reduce_print (yyrule)
+    int yyrule;
+#endif
+{
+  int yyi;
+  unsigned int yylineno = yyrline[yyrule];
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
+             yyrule - 1, yylineno);
+  /* Print the symbols being reduced, and their result.  */
+  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
+    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
+  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
+}
+
+# define YY_REDUCE_PRINT(Rule)		\
+do {					\
+  if (yydebug)				\
+    yy_reduce_print (Rule);		\
+} while (0)
+
+/* Nonzero means print parse trace.  It is left uninitialized so that
+   multiple parsers can coexist.  */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YYDSYMPRINT(Args)
+# define YYDSYMPRINTF(Title, Token, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks.  */
+#ifndef	YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+   if the built-in stack extension method is used).
+
+   Do not make this value too large; the results are undefined if
+   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+   evaluated with infinite-precision integer arithmetic.  */
+
+#if YYMAXDEPTH == 0
+# undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+#  if defined (__GLIBC__) && defined (_STRING_H)
+#   define yystrlen strlen
+#  else
+/* Return the length of YYSTR.  */
+static YYSIZE_T
+#   if defined (__STDC__) || defined (__cplusplus)
+yystrlen (const char *yystr)
+#   else
+yystrlen (yystr)
+     const char *yystr;
+#   endif
+{
+  register const char *yys = yystr;
+
+  while (*yys++ != '\0')
+    continue;
+
+  return yys - yystr - 1;
+}
+#  endif
+# endif
+
+# ifndef yystpcpy
+#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+#   define yystpcpy stpcpy
+#  else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+   YYDEST.  */
+static char *
+#   if defined (__STDC__) || defined (__cplusplus)
+yystpcpy (char *yydest, const char *yysrc)
+#   else
+yystpcpy (yydest, yysrc)
+     char *yydest;
+     const char *yysrc;
+#   endif
+{
+  register char *yyd = yydest;
+  register const char *yys = yysrc;
+
+  while ((*yyd++ = *yys++) != '\0')
+    continue;
+
+  return yyd - 1;
+}
+#  endif
+# endif
+
+#endif /* !YYERROR_VERBOSE */
+
+
+
+
+#if YYDEBUG
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yysymprint (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  /* Pacify ``unused variable'' warnings.  */
+  (void) yyvaluep;
+
+  if (yytype < YYNTOKENS)
+    {
+      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+# ifdef YYPRINT
+      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# endif
+    }
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  switch (yytype)
+    {
+      default:
+        break;
+    }
+  YYFPRINTF (yyoutput, ")");
+}
+
+#endif /* ! YYDEBUG */
+/*-----------------------------------------------.
+| Release the memory associated to this symbol.  |
+`-----------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yydestruct (int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yydestruct (yytype, yyvaluep)
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  /* Pacify ``unused variable'' warnings.  */
+  (void) yyvaluep;
+
+  switch (yytype)
+    {
+
+      default:
+        break;
+    }
+}
+
+
+
+/* Prevent warnings from -Wmissing-prototypes.  */
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM);
+# else
+int yyparse ();
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+
+/* The lookahead symbol.  */
+int yychar;
+
+/* The semantic value of the lookahead symbol.  */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far.  */
+int yynerrs;
+
+
+
+/*----------.
+| yyparse.  |
+`----------*/
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM)
+# else
+int yyparse (YYPARSE_PARAM)
+  void *YYPARSE_PARAM;
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int
+yyparse (void)
+#else
+int
+yyparse ()
+
+#endif
+#endif
+{
+  
+  register int yystate;
+  register int yyn;
+  int yyresult;
+  /* Number of tokens to shift before error messages enabled.  */
+  int yyerrstatus;
+  /* Lookahead token as an internal (translated) token number.  */
+  int yytoken = 0;
+
+  /* Three stacks and their tools:
+     `yyss': related to states,
+     `yyvs': related to semantic values,
+     `yyls': related to locations.
+
+     Refer to the stacks thru separate pointers, to allow yyoverflow
+     to reallocate them elsewhere.  */
+
+  /* The state stack.  */
+  short	yyssa[YYINITDEPTH];
+  short *yyss = yyssa;
+  register short *yyssp;
+
+  /* The semantic value stack.  */
+  YYSTYPE yyvsa[YYINITDEPTH];
+  YYSTYPE *yyvs = yyvsa;
+  register YYSTYPE *yyvsp;
+
+
+
+#define YYPOPSTACK   (yyvsp--, yyssp--)
+
+  YYSIZE_T yystacksize = YYINITDEPTH;
+
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
+
+  /* When reducing, the number of symbols on the RHS of the reduced
+     rule.  */
+  int yylen;
+
+  YYDPRINTF ((stderr, "Starting parse\n"));
+
+  yystate = 0;
+  yyerrstatus = 0;
+  yynerrs = 0;
+  yychar = YYEMPTY;		/* Cause a token to be read.  */
+
+  /* Initialize stack pointers.
+     Waste one element of value and location stack
+     so that they stay on the same level as the state stack.
+     The wasted elements are never initialized.  */
+
+  yyssp = yyss;
+  yyvsp = yyvs;
+
+  goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate.  |
+`------------------------------------------------------------*/
+ yynewstate:
+  /* In all cases, when you get here, the value and location stacks
+     have just been pushed. so pushing a state here evens the stacks.
+     */
+  yyssp++;
+
+ yysetstate:
+  *yyssp = yystate;
+
+  if (yyss + yystacksize - 1 <= yyssp)
+    {
+      /* Get the current used size of the three stacks, in elements.  */
+      YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+      {
+	/* Give user a chance to reallocate the stack. Use copies of
+	   these so that the &'s don't force the real ones into
+	   memory.  */
+	YYSTYPE *yyvs1 = yyvs;
+	short *yyss1 = yyss;
+
+
+	/* Each stack pointer address is followed by the size of the
+	   data in use in that stack, in bytes.  This used to be a
+	   conditional around just the two extra args, but that might
+	   be undefined if yyoverflow is a macro.  */
+	yyoverflow ("parser stack overflow",
+		    &yyss1, yysize * sizeof (*yyssp),
+		    &yyvs1, yysize * sizeof (*yyvsp),
+
+		    &yystacksize);
+
+	yyss = yyss1;
+	yyvs = yyvs1;
+      }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+      goto yyoverflowlab;
+# else
+      /* Extend the stack our own way.  */
+      if (YYMAXDEPTH <= yystacksize)
+	goto yyoverflowlab;
+      yystacksize *= 2;
+      if (YYMAXDEPTH < yystacksize)
+	yystacksize = YYMAXDEPTH;
+
+      {
+	short *yyss1 = yyss;
+	union yyalloc *yyptr =
+	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+	if (! yyptr)
+	  goto yyoverflowlab;
+	YYSTACK_RELOCATE (yyss);
+	YYSTACK_RELOCATE (yyvs);
+
+#  undef YYSTACK_RELOCATE
+	if (yyss1 != yyssa)
+	  YYSTACK_FREE (yyss1);
+      }
+# endif
+#endif /* no yyoverflow */
+
+      yyssp = yyss + yysize - 1;
+      yyvsp = yyvs + yysize - 1;
+
+
+      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+		  (unsigned long int) yystacksize));
+
+      if (yyss + yystacksize - 1 <= yyssp)
+	YYABORT;
+    }
+
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+  goto yybackup;
+
+/*-----------.
+| yybackup.  |
+`-----------*/
+yybackup:
+
+/* Do appropriate processing given the current state.  */
+/* Read a lookahead token if we need one and don't already have one.  */
+/* yyresume: */
+
+  /* First try to decide what to do without reference to lookahead token.  */
+
+  yyn = yypact[yystate];
+  if (yyn == YYPACT_NINF)
+    goto yydefault;
+
+  /* Not known => get a lookahead token if don't already have one.  */
+
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
+  if (yychar == YYEMPTY)
+    {
+      YYDPRINTF ((stderr, "Reading a token: "));
+      yychar = YYLEX;
+    }
+
+  if (yychar <= YYEOF)
+    {
+      yychar = yytoken = YYEOF;
+      YYDPRINTF ((stderr, "Now at end of input.\n"));
+    }
+  else
+    {
+      yytoken = YYTRANSLATE (yychar);
+      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
+    }
+
+  /* If the proper action on seeing token YYTOKEN is to reduce or to
+     detect an error, take that action.  */
+  yyn += yytoken;
+  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+    goto yydefault;
+  yyn = yytable[yyn];
+  if (yyn <= 0)
+    {
+      if (yyn == 0 || yyn == YYTABLE_NINF)
+	goto yyerrlab;
+      yyn = -yyn;
+      goto yyreduce;
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  /* Shift the lookahead token.  */
+  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
+
+  /* Discard the token being shifted unless it is eof.  */
+  if (yychar != YYEOF)
+    yychar = YYEMPTY;
+
+  *++yyvsp = yylval;
+
+
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state.  |
+`-----------------------------------------------------------*/
+yydefault:
+  yyn = yydefact[yystate];
+  if (yyn == 0)
+    goto yyerrlab;
+  goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction.  |
+`-----------------------------*/
+yyreduce:
+  /* yyn is the number of a rule to reduce with.  */
+  yylen = yyr2[yyn];
+
+  /* If YYLEN is nonzero, implement the default value of the action:
+     `$$ = $1'.
+
+     Otherwise, the following line sets YYVAL to garbage.
+     This behavior is undocumented and Bison
+     users should not rely upon it.  Assigning to YYVAL
+     unconditionally makes the parser a bit smaller, and it avoids a
+     GCC warning that YYVAL may be used uninitialized.  */
+  yyval = yyvsp[1-yylen];
+
+
+  YY_REDUCE_PRINT (yyn);
+  switch (yyn)
+    {
+        case 2:
+#line 73 "ps1.0_grammar.y"
+    {
+		DBG_MESG("dbg: WholeEnchilada", line_number);		
+		ps10::invoke(yyvsp[-2].consts, yyvsp[-1].lines, yyvsp[0].lines);
+	;}
+    break;
+
+  case 3:
+#line 80 "ps1.0_grammar.y"
+    {
+		DBG_MESG("dbg: WholeEnchilada", line_number);		
+		ps10::invoke(yyvsp[-2].consts, yyvsp[-1].lines, yyvsp[0].lines);
+	;}
+    break;
+
+  case 4:
+#line 87 "ps1.0_grammar.y"
+    {
+		DBG_MESG("dbg: WholeEnchilada", line_number);		
+		ps10::invoke( 0, yyvsp[-1].lines, yyvsp[0].lines);
+	;}
+    break;
+
+  case 5:
+#line 94 "ps1.0_grammar.y"
+    {
+		DBG_MESG("dbg: WholeEnchilada", line_number);		
+		ps10::invoke( 0, yyvsp[-1].lines, yyvsp[0].lines);
+	;}
+    break;
+
+  case 6:
+#line 101 "ps1.0_grammar.y"
+    {
+		DBG_MESG("dbg: WholeEnchilada", line_number);		
+		ps10::invoke(yyvsp[-1].consts, 0, yyvsp[0].lines);
+	;}
+    break;
+
+  case 7:
+#line 108 "ps1.0_grammar.y"
+    {
+		DBG_MESG("dbg: WholeEnchilada", line_number);		
+		ps10::invoke(yyvsp[-1].consts, 0, yyvsp[0].lines);
+	;}
+    break;
+
+  case 8:
+#line 115 "ps1.0_grammar.y"
+    {
+		DBG_MESG("dbg: WholeEnchilada", line_number);		
+		ps10::invoke( 0, 0, yyvsp[0].lines);
+	;}
+    break;
+
+  case 9:
+#line 122 "ps1.0_grammar.y"
+    {
+		DBG_MESG("dbg: WholeEnchilada", line_number);		
+		ps10::invoke( 0, 0, yyvsp[0].lines);
+	;}
+    break;
+
+  case 10:
+#line 132 "ps1.0_grammar.y"
+    {
+		yyval.consts = new vector<constdef>;
+		yyval.consts->push_back(* yyvsp[0].cdef);
+		delete yyvsp[0].cdef;
+	;}
+    break;
+
+  case 11:
+#line 140 "ps1.0_grammar.y"
+    {
+		yyval.consts = yyvsp[-1].consts;
+		yyval.consts->push_back(* yyvsp[0].cdef);
+		delete yyvsp[0].cdef;
+	;}
+    break;
+
+  case 12:
+#line 152 "ps1.0_grammar.y"
+    {
+		yyval.cdef = new constdef;
+		yyval.cdef->reg = * yyvsp[-9].sval;
+		yyval.cdef->r = yyvsp[-7].fval;
+		yyval.cdef->g = yyvsp[-5].fval;
+		yyval.cdef->b = yyvsp[-3].fval;
+		yyval.cdef->a = yyvsp[-1].fval;
+		delete yyvsp[-9].sval;
+	;}
+    break;
+
+  case 13:
+#line 166 "ps1.0_grammar.y"
+    {
+		yyval.lines = new list<vector<string> >;
+		yyval.lines->push_back(* yyvsp[0].line);
+		delete yyvsp[0].line;
+	;}
+    break;
+
+  case 14:
+#line 174 "ps1.0_grammar.y"
+    {
+		yyval.lines = yyvsp[-1].lines;
+		yyval.lines->push_back(* yyvsp[0].line);
+		delete yyvsp[0].line;
+	;}
+    break;
+
+  case 15:
+#line 185 "ps1.0_grammar.y"
+    {
+		yyval.line = new vector<string>;
+		yyval.line->push_back(* yyvsp[-2].sval);
+		yyval.line->push_back(* yyvsp[-1].sval);
+		delete yyvsp[-2].sval;
+		delete yyvsp[-1].sval;
+	;}
+    break;
+
+  case 16:
+#line 195 "ps1.0_grammar.y"
+    {
+		yyval.line = new vector<string>;
+		yyval.line->push_back(* yyvsp[-4].sval);
+		yyval.line->push_back(* yyvsp[-3].sval);
+		yyval.line->push_back(* yyvsp[-1].sval);
+		delete yyvsp[-4].sval;
+		delete yyvsp[-3].sval;
+		delete yyvsp[-1].sval;
+	;}
+    break;
+
+  case 17:
+#line 207 "ps1.0_grammar.y"
+    {
+		yyval.line = new vector<string>;
+		yyval.line->push_back(* yyvsp[-6].sval);
+		yyval.line->push_back(* yyvsp[-5].sval);
+		yyval.line->push_back(* yyvsp[-3].sval);
+		yyval.line->push_back(* yyvsp[-1].sval);
+		delete yyvsp[-6].sval;
+		delete yyvsp[-5].sval;
+		delete yyvsp[-3].sval;
+		delete yyvsp[-1].sval;
+	;}
+    break;
+
+  case 18:
+#line 224 "ps1.0_grammar.y"
+    {
+		yyval.lines = new list<vector<string> >;
+		yyval.lines->push_back(* yyvsp[0].line);
+		delete yyvsp[0].line;
+	;}
+    break;
+
+  case 19:
+#line 232 "ps1.0_grammar.y"
+    {
+		yyval.lines = yyvsp[-1].lines;
+		yyval.lines->push_back(* yyvsp[0].line);
+		delete yyvsp[0].line;
+	;}
+    break;
+
+  case 20:
+#line 244 "ps1.0_grammar.y"
+    {
+		yyval.line = new vector<string>;
+        if ( yyvsp[-5].ival )
+          yyval.line->push_back("+");
+		yyval.line->push_back(* yyvsp[-4].sval);
+		yyval.line->push_back(* yyvsp[-3].sval);
+		yyval.line->push_back(* yyvsp[-1].sval);
+		delete yyvsp[-4].sval;
+		delete yyvsp[-3].sval;
+		delete yyvsp[-1].sval;
+	;}
+    break;
+
+  case 21:
+#line 258 "ps1.0_grammar.y"
+    {
+		yyval.line = new vector<string>;
+        if ( yyvsp[-7].ival )
+          yyval.line->push_back("+");
+		yyval.line->push_back(* yyvsp[-6].sval);
+		yyval.line->push_back(* yyvsp[-5].sval);
+		yyval.line->push_back(* yyvsp[-3].sval);
+		yyval.line->push_back(* yyvsp[-1].sval);
+		delete yyvsp[-6].sval;
+		delete yyvsp[-5].sval;
+		delete yyvsp[-3].sval;
+		delete yyvsp[-1].sval;
+	;}
+    break;
+
+  case 22:
+#line 274 "ps1.0_grammar.y"
+    {
+		yyval.line = new vector<string>;
+        if ( yyvsp[-9].ival )
+          yyval.line->push_back("+");
+		yyval.line->push_back(* yyvsp[-8].sval);
+		yyval.line->push_back(* yyvsp[-7].sval);
+		yyval.line->push_back(* yyvsp[-5].sval);
+		yyval.line->push_back(* yyvsp[-3].sval);
+		yyval.line->push_back(* yyvsp[-1].sval);
+		delete yyvsp[-8].sval;
+		delete yyvsp[-7].sval;
+		delete yyvsp[-5].sval;
+		delete yyvsp[-3].sval;
+		delete yyvsp[-1].sval;
+	;}
+    break;
+
+  case 23:
+#line 293 "ps1.0_grammar.y"
+    { yyval.ival=0; ;}
+    break;
+
+  case 24:
+#line 296 "ps1.0_grammar.y"
+    { yyval.ival=1; ;}
+    break;
+
+  case 25:
+#line 302 "ps1.0_grammar.y"
+    {;}
+    break;
+
+  case 26:
+#line 306 "ps1.0_grammar.y"
+    {;}
+    break;
+
+
+    }
+
+/* Line 999 of yacc.c.  */
+#line 1325 "_ps1.0_parser.c"
+
+
+  yyvsp -= yylen;
+  yyssp -= yylen;
+
+
+  YY_STACK_PRINT (yyss, yyssp);
+
+  *++yyvsp = yyval;
+
+
+  /* Now `shift' the result of the reduction.  Determine what state
+     that goes to, based on the state we popped back to and the rule
+     number reduced by.  */
+
+  yyn = yyr1[yyn];
+
+  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+    yystate = yytable[yystate];
+  else
+    yystate = yydefgoto[yyn - YYNTOKENS];
+
+  goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
+    {
+      ++yynerrs;
+#if YYERROR_VERBOSE
+      yyn = yypact[yystate];
+
+      if (YYPACT_NINF < yyn && yyn < YYLAST)
+	{
+	  YYSIZE_T yysize = 0;
+	  int yytype = YYTRANSLATE (yychar);
+	  char *yymsg;
+	  int yyx, yycount;
+
+	  yycount = 0;
+	  /* Start YYX at -YYN if negative to avoid negative indexes in
+	     YYCHECK.  */
+	  for (yyx = yyn < 0 ? -yyn : 0;
+	       yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
+	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+	      yysize += yystrlen (yytname[yyx]) + 15, yycount++;
+	  yysize += yystrlen ("syntax error, unexpected ") + 1;
+	  yysize += yystrlen (yytname[yytype]);
+	  yymsg = (char *) YYSTACK_ALLOC (yysize);
+	  if (yymsg != 0)
+	    {
+	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
+	      yyp = yystpcpy (yyp, yytname[yytype]);
+
+	      if (yycount < 5)
+		{
+		  yycount = 0;
+		  for (yyx = yyn < 0 ? -yyn : 0;
+		       yyx < (int) (sizeof (yytname) / sizeof (char *));
+		       yyx++)
+		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+		      {
+			const char *yyq = ! yycount ? ", expecting " : " or ";
+			yyp = yystpcpy (yyp, yyq);
+			yyp = yystpcpy (yyp, yytname[yyx]);
+			yycount++;
+		      }
+		}
+	      yyerror (yymsg);
+	      YYSTACK_FREE (yymsg);
+	    }
+	  else
+	    yyerror ("syntax error; also virtual memory exhausted");
+	}
+      else
+#endif /* YYERROR_VERBOSE */
+	yyerror ("syntax error");
+    }
+
+
+
+  if (yyerrstatus == 3)
+    {
+      /* If just tried and failed to reuse lookahead token after an
+	 error, discard it.  */
+
+      /* Return failure if at end of input.  */
+      if (yychar == YYEOF)
+        {
+	  /* Pop the error token.  */
+          YYPOPSTACK;
+	  /* Pop the rest of the stack.  */
+	  while (yyss < yyssp)
+	    {
+	      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+	      yydestruct (yystos[*yyssp], yyvsp);
+	      YYPOPSTACK;
+	    }
+	  YYABORT;
+        }
+
+      YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
+      yydestruct (yytoken, &yylval);
+      yychar = YYEMPTY;
+
+    }
+
+  /* Else will try to reuse lookahead token after shifting the error
+     token.  */
+  goto yyerrlab1;
+
+
+/*----------------------------------------------------.
+| yyerrlab1 -- error raised explicitly by an action.  |
+`----------------------------------------------------*/
+yyerrlab1:
+  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
+
+  for (;;)
+    {
+      yyn = yypact[yystate];
+      if (yyn != YYPACT_NINF)
+	{
+	  yyn += YYTERROR;
+	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+	    {
+	      yyn = yytable[yyn];
+	      if (0 < yyn)
+		break;
+	    }
+	}
+
+      /* Pop the current state because it cannot handle the error token.  */
+      if (yyssp == yyss)
+	YYABORT;
+
+      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+      yydestruct (yystos[yystate], yyvsp);
+      yyvsp--;
+      yystate = *--yyssp;
+
+      YY_STACK_PRINT (yyss, yyssp);
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  YYDPRINTF ((stderr, "Shifting error token, "));
+
+  *++yyvsp = yylval;
+
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here.  |
+`-------------------------------------*/
+yyacceptlab:
+  yyresult = 0;
+  goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here.  |
+`-----------------------------------*/
+yyabortlab:
+  yyresult = 1;
+  goto yyreturn;
+
+#ifndef yyoverflow
+/*----------------------------------------------.
+| yyoverflowlab -- parser overflow comes here.  |
+`----------------------------------------------*/
+yyoverflowlab:
+  yyerror ("parser stack overflow");
+  yyresult = 2;
+  /* Fall through.  */
+#endif
+
+yyreturn:
+#ifndef yyoverflow
+  if (yyss != yyssa)
+    YYSTACK_FREE (yyss);
+#endif
+  return yyresult;
+}
+
+
+#line 309 "ps1.0_grammar.y"
+
+
+void yyerror(char* s)
+{
+	errors.set("parser: syntax error", line_number);
+}
+
Index: /RenderSystems/GL/src/nvparse/_ps1.0_parser.h
===================================================================
--- /RenderSystems/GL/src/nvparse/_ps1.0_parser.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/_ps1.0_parser.h	(revision 5)
@@ -0,0 +1,102 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/* A Bison parser, made by GNU Bison 1.875.  */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     HEADER = 258,
+     NEWLINE = 259,
+     NUMBER = 260,
+     REG = 261,
+     DEF = 262,
+     ADDROP = 263,
+     BLENDOP = 264
+   };
+#endif
+#define HEADER 258
+#define NEWLINE 259
+#define NUMBER 260
+#define REG 261
+#define DEF 262
+#define ADDROP 263
+#define BLENDOP 264
+
+
+
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#line 43 "ps1.0_grammar.y"
+typedef union YYSTYPE {
+	int ival;
+	float fval;
+	
+	string * sval;
+	constdef * cdef;
+	vector<constdef> * consts;
+	vector<string> * line;
+	list<vector<string> > * lines;
+} YYSTYPE;
+/* Line 1240 of yacc.c.  */
+#line 65 "_ps1.0_parser.h"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+extern YYSTYPE ps10_lval;
+
+
+
Index: /RenderSystems/GL/src/nvparse/_rc1.0_lexer.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/_rc1.0_lexer.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/_rc1.0_lexer.cpp	(revision 5)
@@ -0,0 +1,2470 @@
+#define yy_create_buffer rc10__create_buffer
+#define yy_delete_buffer rc10__delete_buffer
+#define yy_scan_buffer rc10__scan_buffer
+#define yy_scan_string rc10__scan_string
+#define yy_scan_bytes rc10__scan_bytes
+#define yy_flex_debug rc10__flex_debug
+#define yy_init_buffer rc10__init_buffer
+#define yy_flush_buffer rc10__flush_buffer
+#define yy_load_buffer_state rc10__load_buffer_state
+#define yy_switch_to_buffer rc10__switch_to_buffer
+#define yyin rc10_in
+#define yyleng rc10_leng
+#define yylex rc10_lex
+#define yyout rc10_out
+#define yyrestart rc10_restart
+#define yytext rc10_text
+#define yywrap rc10_wrap
+
+#line 20 "_rc1.0_lexer.cpp"
+/* A lexical scanner generated by flex */
+
+/* Scanner skeleton version:
+ * $Header: /cvsroot/ogre/ogrenew/RenderSystems/GL/src/nvparse/_rc1.0_lexer.cpp,v 1.5 2005/07/08 16:51:23 miathan6 Exp $
+ */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+
+#include <stdio.h>
+#include <unistd.h>
+
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+#include <stdlib.h>
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else	/* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_PROTOS
+#define YY_USE_CONST
+
+#endif	/* __STDC__ */
+#endif	/* ! __cplusplus */
+
+#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include <io.h>
+#include <stdlib.h>
+#define YY_USE_CONST
+#define YY_USE_PROTOS
+#endif
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index.  If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition.  This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.  The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#define YY_BUF_SIZE 16384
+
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+extern int yyleng;
+extern FILE *yyin, *yyout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+/* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator).  This
+ * avoids problems with code like:
+ *
+ * 	if ( condition_holds )
+ *		yyless( 5 );
+ *	else
+ *		do_something_else();
+ *
+ * Prior to using the do-while the compiler would get upset at the
+ * "else" because it interpreted the "if" statement as being all
+ * done when it reached the ';' after the yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+		*yy_cp = yy_hold_char; \
+		YY_RESTORE_YY_MORE_OFFSET \
+		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+		} \
+	while ( 0 )
+
+#define unput(c) yyunput( c, yytext_ptr )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+typedef unsigned int yy_size_t;
+
+
+struct yy_buffer_state
+	{
+	FILE *yy_input_file;
+
+	char *yy_ch_buf;		/* input buffer */
+	char *yy_buf_pos;		/* current position in input buffer */
+
+	/* Size of input buffer in bytes, not including room for EOB
+	 * characters.
+	 */
+	yy_size_t yy_buf_size;
+
+	/* Number of characters read into yy_ch_buf, not including EOB
+	 * characters.
+	 */
+	int yy_n_chars;
+
+	/* Whether we "own" the buffer - i.e., we know we created it,
+	 * and can realloc() it to grow it, and should free() it to
+	 * delete it.
+	 */
+	int yy_is_our_buffer;
+
+	/* Whether this is an "interactive" input source; if so, and
+	 * if we're using stdio for input, then we want to use getc()
+	 * instead of fread(), to make sure we stop fetching input after
+	 * each newline.
+	 */
+	int yy_is_interactive;
+
+	/* Whether we're considered to be at the beginning of a line.
+	 * If so, '^' rules will be active on the next match, otherwise
+	 * not.
+	 */
+	int yy_at_bol;
+
+	/* Whether to try to fill the input buffer when we reach the
+	 * end of it.
+	 */
+	int yy_fill_buffer;
+
+	int yy_buffer_status;
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+	/* When an EOF's been seen but there's still some text to process
+	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+	 * shouldn't try reading from the input source any more.  We might
+	 * still have a bunch of tokens to match, though, because of
+	 * possible backing-up.
+	 *
+	 * When we actually see the EOF, we change the status to "new"
+	 * (via yyrestart()), so that the user can continue scanning by
+	 * just pointing yyin at a new input file.
+	 */
+#define YY_BUFFER_EOF_PENDING 2
+	};
+
+static YY_BUFFER_STATE yy_current_buffer = 0;
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ */
+#define YY_CURRENT_BUFFER yy_current_buffer
+
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+
+static int yy_n_chars;		/* number of characters read into yy_ch_buf */
+
+
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1;		/* whether we need to initialize */
+static int yy_start = 0;	/* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin.  A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart YY_PROTO(( FILE *input_file ));
+
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+void yy_load_buffer_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+static void yy_flex_free YY_PROTO(( void * ));
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+	{ \
+	if ( ! yy_current_buffer ) \
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+	yy_current_buffer->yy_is_interactive = is_interactive; \
+	}
+
+#define yy_set_bol(at_bol) \
+	{ \
+	if ( ! yy_current_buffer ) \
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+	yy_current_buffer->yy_at_bol = at_bol; \
+	}
+
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+typedef unsigned char YY_CHAR;
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+typedef int yy_state_type;
+extern char *yytext;
+#define yytext_ptr yytext
+
+static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+static int yy_get_next_buffer YY_PROTO(( void ));
+static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+	yytext_ptr = yy_bp; \
+	yyleng = (int) (yy_cp - yy_bp); \
+	yy_hold_char = *yy_cp; \
+	*yy_cp = '\0'; \
+	yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 94
+#define YY_END_OF_BUFFER 95
+static yyconst short int yy_accept[309] =
+    {   0,
+        0,    0,   95,   94,   92,   91,   94,   94,    3,   82,
+       83,   87,   89,   85,   88,   86,   94,   79,   84,   90,
+       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
+       93,   93,   93,   93,   93,   93,   80,   81,   92,   91,
+        0,    0,    0,   79,   78,    1,    2,   77,   79,   93,
+       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
+       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
+        0,   77,   93,   93,   93,   93,   93,   93,   93,   93,
+        8,   93,   93,   66,   56,   93,   68,   93,   93,   67,
+       93,   93,   93,    0,   93,   93,   93,   12,   16,   93,
+
+       93,   93,   93,   93,    0,   93,   71,    0,    0,   93,
+       93,   28,   32,   36,   40,   93,   52,    0,   69,   93,
+       93,    0,    0,   93,   93,   93,   93,   93,    6,    7,
+        0,   93,   54,   55,    0,   59,    0,   93,   93,    0,
+        0,    0,    0,   93,    0,    0,   93,   93,   10,   11,
+        0,   14,   15,    0,   93,   44,   48,   93,   62,   93,
+        0,   93,    0,    0,   93,   20,   24,   26,   27,    0,
+       30,   31,    0,   34,   35,    0,   38,   39,    0,   93,
+       50,   51,    0,    4,   93,   93,    0,    0,   93,    0,
+        0,   57,   93,    5,   93,   53,   58,   93,    0,    0,
+
+        0,    0,    0,    0,   93,    0,   93,   93,    9,   13,
+       93,   42,   43,    0,   46,   47,    0,   93,   93,   93,
+       18,   19,    0,   22,   23,    0,   25,   29,   33,   37,
+       64,   49,   93,   93,   61,    0,    0,   93,   63,   93,
+        0,    0,   93,   93,   93,   41,   45,   93,   93,   93,
+       93,   17,   21,   93,   93,   93,   93,   93,   93,   93,
+       93,   93,   93,   93,   93,   93,   75,   93,   93,   93,
+       60,   76,   93,   93,   93,   93,   93,   93,   93,   70,
+       93,   65,   93,   93,   93,   74,   93,   93,   93,   93,
+       93,   93,   93,   73,   93,   93,   93,   93,   93,   93,
+
+       93,   93,   93,   93,   93,   93,   72,    0
+    } ;
+
+static yyconst int yy_ec[256] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
+        1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2,    5,    1,    6,    1,    1,    1,    1,    7,
+        8,    9,   10,   11,   12,   13,   14,   15,   16,   17,
+       18,   19,   19,   19,   19,   19,   19,    1,   20,    1,
+       21,    1,    1,    1,   22,   22,   23,   22,   22,   22,
+       22,   22,   22,   22,   22,   22,   22,   22,   22,   22,
+       22,   24,   22,   22,   22,   22,   22,   22,   22,   22,
+        1,    1,    1,    1,   25,    1,   26,   27,   28,   29,
+
+       30,   31,   32,   33,   34,   22,   22,   35,   36,   37,
+       38,   39,   22,   40,   41,   42,   43,   44,   45,   46,
+       47,   48,   49,    1,   50,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1
+    } ;
+
+static yyconst int yy_meta[51] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    2,    1,    2,    2,    2,    2,    2,    1,
+        1,    2,    2,    2,    2,    2,    2,    2,    2,    2,
+        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
+        2,    2,    2,    2,    2,    2,    2,    2,    1,    1
+    } ;
+
+static yyconst short int yy_base[310] =
+    {   0,
+        0,    0,  543,  544,  540,  544,   48,  536,  544,  544,
+      544,  544,   40,  544,   47,   52,   63,   63,  544,  544,
+      527,   48,   41,   60,   71,   61,   72,   73,   74,   75,
+       76,   77,   83,   78,   79,   84,  544,  544,  537,  544,
+       90,  514,  112,  119,  124,  544,  544,  129,  136,  524,
+      111,   89,   99,  143,  120,  144,  145,   88,  146,  147,
+      149,   87,  150,  152,  151,  158,  153,  154,  155,  157,
+      513,  157,   90,  172,  173,  178,  177,  175,  185,  186,
+      522,  188,  189,  521,  520,  519,  518,  191,  192,  517,
+      207,  193,  195,  513,  204,  216,  197,  515,  514,  194,
+
+      201,  218,  202,  222,  211,  227,  513,  219,  216,  234,
+      235,  512,  511,  510,  509,  236,  508,  507,  506,  240,
+      237,  234,  243,  241,  260,  242,  250,  259,  544,  544,
+      486,  258,  544,  544,  485,  544,  484,  264,  265,  260,
+      264,  266,  268,  275,  270,  500,  285,  286,  544,  544,
+      482,  544,  544,  481,  288,  499,  498,  289,  497,  292,
+      482,  290,  481,  480,  294,  493,  492,  544,  544,  472,
+      544,  544,  471,  544,  544,  470,  544,  544,  469,  296,
+      544,  544,  468,  544,  298,  300,  472,  471,  302,  290,
+      293,  484,  309,  544,  314,  544,  544,  312,  308,  310,
+
+      469,  465,  464,  463,  315,  461,  326,  329,  544,  544,
+      330,  544,  544,  455,  544,  544,  454,  333,  328,  340,
+      544,  544,  453,  544,  544,  452,  544,  544,  544,  544,
+      342,  544,  338,  334,  470,  455,  454,  341,  467,  343,
+      452,  451,  339,  344,  347,  544,  544,  345,  348,  362,
+      349,  544,  544,  364,  365,  367,  369,  366,  370,  376,
+      371,  377,  380,  382,  383,  385,  464,  390,  391,  389,
+      463,  460,  393,  394,  392,  395,  403,  398,  400,  457,
+      404,  245,  420,  415,  399,  208,  405,  414,  422,  425,
+      428,  430,  435,  436,  409,  439,  438,  440,  442,  443,
+
+      444,  446,  449,  447,  450,  456,  156,  544,  119
+    } ;
+
+static yyconst short int yy_def[310] =
+    {   0,
+      308,    1,  308,  308,  308,  308,  308,  308,  308,  308,
+      308,  308,  308,  308,  308,  308,  308,  309,  308,  308,
+      309,  309,  309,  309,  309,  309,  309,  309,  309,  309,
+      309,  309,  309,  309,  309,  309,  308,  308,  308,  308,
+      308,  308,  308,  308,  308,  308,  308,  308,  309,  309,
+      309,  309,  309,  309,  309,  309,  309,  309,  309,  309,
+      309,  309,  309,  309,  309,  309,  309,  309,  309,  309,
+      308,  308,  309,  309,  309,  309,  309,  309,  309,  309,
+      309,  309,  309,  309,  309,  309,  309,  309,  309,  309,
+      309,  309,  309,  308,  309,  309,  309,  309,  309,  309,
+
+      309,  309,  309,  309,  308,  309,  309,  308,  308,  309,
+      309,  309,  309,  309,  309,  309,  309,  308,  309,  309,
+      309,  308,  308,  309,  309,  309,  309,  309,  308,  308,
+      308,  309,  308,  308,  308,  308,  308,  309,  309,  308,
+      308,  308,  308,  309,  308,  308,  309,  309,  308,  308,
+      308,  308,  308,  308,  309,  309,  309,  309,  309,  309,
+      308,  309,  308,  308,  309,  309,  309,  308,  308,  308,
+      308,  308,  308,  308,  308,  308,  308,  308,  308,  309,
+      308,  308,  308,  308,  309,  309,  308,  308,  309,  308,
+      308,  309,  309,  308,  309,  308,  308,  309,  308,  308,
+
+      308,  308,  308,  308,  309,  308,  309,  309,  308,  308,
+      309,  308,  308,  308,  308,  308,  308,  309,  309,  309,
+      308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
+      309,  308,  309,  309,  309,  308,  308,  309,  309,  309,
+      308,  308,  309,  309,  309,  308,  308,  309,  309,  309,
+      309,  308,  308,  309,  309,  309,  309,  309,  309,  309,
+      309,  309,  309,  309,  309,  309,  309,  309,  309,  309,
+      309,  309,  309,  309,  309,  309,  309,  309,  309,  309,
+      309,  309,  309,  309,  309,  309,  309,  309,  309,  309,
+      309,  309,  309,  309,  309,  309,  309,  309,  309,  309,
+
+      309,  309,  309,  309,  309,  309,  309,    0,  308
+    } ;
+
+static yyconst short int yy_nxt[595] =
+    {   0,
+        4,    5,    6,    7,    8,    9,   10,   11,   12,   13,
+       14,   15,   16,   17,   18,   18,   18,   18,   18,   19,
+       20,   21,   21,   21,   21,   22,   23,   24,   25,   26,
+       27,   21,   28,   21,   29,   30,   21,   31,   21,   32,
+       33,   34,   35,   21,   21,   21,   21,   36,   37,   38,
+       40,   41,   43,  308,   44,   44,   44,   44,   44,   43,
+      308,   44,   44,   44,   44,   44,   45,   45,   45,   45,
+       45,   46,  308,  308,   52,   48,   47,   49,   49,   49,
+       49,   49,   51,  308,  308,  308,  308,  308,  308,  308,
+      308,  308,   40,   41,   53,  308,  308,   54,   59,  308,
+
+      308,  308,  308,   60,   55,   57,   56,   68,   64,   58,
+       65,  308,   62,   70,   74,   69,   85,   61,   63,   81,
+       50,   66,   95,  308,   75,   67,   45,   45,   45,   45,
+       45,   48,  308,   44,   44,   44,   44,   44,   45,   45,
+       45,   45,   45,   72,   72,   72,   72,   72,   48,   73,
+       49,   49,   49,   49,   49,  308,  308,  308,  308,  308,
+       78,  308,  308,  308,  308,  308,  308,  308,  308,  308,
+      308,   72,   72,   72,   72,   72,   88,   76,   87,   77,
+       82,   80,   79,   89,  308,  308,   83,  308,   90,  308,
+      308,   86,   98,   99,   84,   92,   93,  308,  308,   91,
+
+      308,  308,  102,  308,  308,  308,  308,  308,   97,  308,
+      103,  104,   96,  308,  308,  100,  308,  101,  106,  308,
+      308,  112,  113,  114,  115,  110,  116,  107,  308,  119,
+      308,  111,  117,  124,  308,  121,  129,  130,  127,  308,
+      120,  136,  125,  126,  133,  134,  308,  308,  308,  308,
+      131,  132,  308,  308,  308,  137,  128,  308,  135,  149,
+      150,  148,  308,  138,  139,  155,  147,  144,  152,  153,
+      308,  308,  308,  151,  156,  157,  308,  308,  159,  166,
+      167,  158,  154,  160,  162,  168,  169,  308,  165,  171,
+      172,  174,  175,  177,  178,  181,  182,  308,  308,  170,
+
+      308,  308,  308,  173,  308,  176,  308,  179,  308,  183,
+      308,  180,  308,  186,  308,  212,  213,  192,  215,  216,
+      198,  308,  207,  195,  308,  205,  308,  308,  189,  214,
+      193,  185,  217,  221,  222,  224,  225,  208,  308,  219,
+      308,  308,  308,  231,  211,  308,  308,  223,  218,  226,
+      308,  308,  308,  308,  308,  308,  308,  308,  220,  308,
+      308,  308,  233,  234,  240,  235,  243,  244,  239,  248,
+      238,  245,  254,  249,  308,  255,  308,  308,  308,  308,
+      250,  308,  308,  308,  251,  258,  256,  257,  308,  308,
+      262,  263,  308,  260,  308,  308,  264,  308,  259,  266,
+
+      261,  308,  308,  308,  308,  308,  308,  308,  265,  273,
+      308,  308,  308,  267,  268,  308,  308,  308,  269,  274,
+      270,  308,  272,  271,  275,  277,  308,  308,  281,  283,
+      280,  276,  308,  278,  308,  279,  287,  308,  284,  282,
+      308,  288,  308,  289,  285,  286,  290,  308,  308,  296,
+      308,  308,  308,  292,  308,  308,  308,  291,  308,  308,
+      295,  308,  308,  298,  293,  294,  297,  301,  308,  308,
+      302,  300,  308,  304,  299,  308,  308,  253,  252,  308,
+      247,  246,  308,  242,  241,  237,  236,  232,  305,  230,
+      229,  228,  303,  307,  306,  227,  308,  210,  209,  206,
+
+      204,  203,  202,  201,  200,  199,  197,  196,  194,  308,
+      191,  190,  188,  187,  184,  164,  163,  161,  308,  146,
+      145,  143,  142,  141,  140,  308,  123,  122,  118,  308,
+      308,  109,  108,  308,  105,   94,  308,   71,   39,  308,
+       42,   39,  308,    3,  308,  308,  308,  308,  308,  308,
+      308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
+      308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
+      308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
+      308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
+      308,  308,  308,  308
+
+    } ;
+
+static yyconst short int yy_chk[595] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        7,    7,   13,   23,   13,   13,   13,   13,   13,   15,
+       22,   15,   15,   15,   15,   15,   16,   16,   16,   16,
+       16,   17,   24,   26,   23,   18,   17,   18,   18,   18,
+       18,   18,   22,   25,   27,   28,   29,   30,   31,   32,
+       34,   35,   41,   41,   24,   33,   36,   24,   28,   62,
+
+       58,   52,   73,   29,   25,   27,   26,   34,   32,   27,
+       33,   53,   31,   36,   52,   35,   62,   30,   31,   58,
+      309,   33,   73,   51,   53,   33,   43,   43,   43,   43,
+       43,   44,   55,   44,   44,   44,   44,   44,   45,   45,
+       45,   45,   45,   48,   48,   48,   48,   48,   49,   51,
+       49,   49,   49,   49,   49,   54,   56,   57,   59,   60,
+       55,   61,   63,   65,   64,   67,   68,   69,  307,   70,
+       66,   72,   72,   72,   72,   72,   65,   54,   64,   54,
+       59,   57,   56,   66,   74,   75,   60,   78,   67,   77,
+       76,   63,   76,   76,   61,   69,   70,   79,   80,   68,
+
+       82,   83,   78,   88,   89,   92,  100,   93,   75,   97,
+       79,   80,   74,  101,  103,   76,   95,   77,   82,   91,
+      286,   91,   91,   91,   91,   88,   92,   83,   96,   95,
+      102,   89,   93,  100,  104,   97,  105,  105,  103,  106,
+       96,  109,  101,  102,  108,  108,  110,  111,  116,  121,
+      105,  106,  120,  124,  126,  109,  104,  282,  108,  122,
+      122,  121,  127,  110,  111,  124,  120,  116,  123,  123,
+      132,  128,  125,  122,  125,  125,  138,  139,  127,  139,
+      139,  126,  123,  128,  132,  140,  140,  144,  138,  141,
+      141,  142,  142,  143,  143,  145,  145,  147,  148,  140,
+
+      155,  158,  162,  141,  160,  142,  165,  143,  180,  145,
+      185,  144,  186,  148,  189,  190,  190,  158,  191,  191,
+      165,  193,  185,  162,  198,  180,  195,  205,  155,  190,
+      160,  147,  191,  199,  199,  200,  200,  186,  207,  195,
+      219,  208,  211,  205,  189,  218,  234,  199,  193,  200,
+      233,  243,  220,  238,  231,  240,  244,  248,  198,  245,
+      249,  251,  207,  208,  220,  211,  231,  233,  219,  238,
+      218,  234,  243,  240,  250,  244,  254,  255,  258,  256,
+      240,  257,  259,  261,  240,  249,  245,  248,  260,  262,
+      255,  256,  263,  251,  264,  265,  257,  266,  250,  259,
+
+      254,  270,  268,  269,  275,  273,  274,  276,  258,  266,
+      278,  285,  279,  260,  261,  277,  281,  287,  262,  268,
+      263,  295,  265,  264,  269,  273,  288,  284,  277,  279,
+      276,  270,  283,  274,  289,  275,  285,  290,  281,  278,
+      291,  287,  292,  288,  283,  284,  289,  293,  294,  295,
+      297,  296,  298,  291,  299,  300,  301,  290,  302,  304,
+      294,  303,  305,  297,  292,  293,  296,  300,  306,  280,
+      301,  299,  272,  303,  298,  271,  267,  242,  241,  239,
+      237,  236,  235,  226,  223,  217,  214,  206,  304,  204,
+      203,  202,  302,  306,  305,  201,  192,  188,  187,  183,
+
+      179,  176,  173,  170,  167,  166,  164,  163,  161,  159,
+      157,  156,  154,  151,  146,  137,  135,  131,  119,  118,
+      117,  115,  114,  113,  112,  107,   99,   98,   94,   90,
+       87,   86,   85,   84,   81,   71,   50,   42,   39,   21,
+        8,    5,    3,  308,  308,  308,  308,  308,  308,  308,
+      308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
+      308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
+      308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
+      308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
+      308,  308,  308,  308
+
+    } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yytext;
+#line 1 "rc1.0_tokens.l"
+#define INITIAL 0
+/* definitions */
+#line 8 "rc1.0_tokens.l"
+
+#include <stdlib.h>
+#include "rc1.0_combiners.h"
+#include "_rc1.0_parser.h"
+
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+#define YY_INPUT(buf,result,max_size) \
+{ \
+    result = 0;                        \
+    while (*myin && result < max_size) \
+    buf[result++] = *myin++;           \
+}
+
+#define YY_ALWAYS_INTERACTIVE 1
+
+/* end of definitions */
+#line 635 "_rc1.0_lexer.cpp"
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap YY_PROTO(( void ));
+#else
+extern int yywrap YY_PROTO(( void ));
+#endif
+#endif
+
+#ifndef YY_NO_UNPUT
+static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput YY_PROTO(( void ));
+#else
+static int input YY_PROTO(( void ));
+#endif
+#endif
+
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
+#ifdef YY_MALLOC_DECL
+YY_MALLOC_DECL
+#else
+#if __STDC__
+#ifndef __cplusplus
+#include <stdlib.h>
+#endif
+#else
+/* Just try to get by without declaring the routines.  This will fail
+ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+ * or sizeof(void*) != sizeof(int).
+ */
+#endif
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+	if ( yy_current_buffer->yy_is_interactive ) \
+		{ \
+		int c = '*', n; \
+		for ( n = 0; n < max_size && \
+			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+			buf[n] = (char) c; \
+		if ( c == '\n' ) \
+			buf[n++] = (char) c; \
+		if ( c == EOF && ferror( yyin ) ) \
+			YY_FATAL_ERROR( "input in flex scanner failed" ); \
+		result = n; \
+		} \
+	else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
+		  && ferror( yyin ) ) \
+		YY_FATAL_ERROR( "input in flex scanner failed" );
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL int yylex YY_PROTO(( void ))
+#endif
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+	YY_USER_ACTION
+
+YY_DECL
+	{
+	register yy_state_type yy_current_state;
+	register char *yy_cp = NULL, *yy_bp = NULL;
+	register int yy_act;
+
+#line 27 "rc1.0_tokens.l"
+
+
+#line 789 "_rc1.0_lexer.cpp"
+
+	if ( yy_init )
+		{
+		yy_init = 0;
+
+#ifdef YY_USER_INIT
+		YY_USER_INIT;
+#endif
+
+		if ( ! yy_start )
+			yy_start = 1;	/* first start state */
+
+		if ( ! yyin )
+			yyin = stdin;
+
+		if ( ! yyout )
+			yyout = stdout;
+
+		if ( ! yy_current_buffer )
+			yy_current_buffer =
+				yy_create_buffer( yyin, YY_BUF_SIZE );
+
+		yy_load_buffer_state();
+		}
+
+	while ( 1 )		/* loops until end-of-file is reached */
+		{
+		yy_cp = yy_c_buf_p;
+
+		/* Support of yytext. */
+		*yy_cp = yy_hold_char;
+
+		/* yy_bp points to the position in yy_ch_buf of the start of
+		 * the current run.
+		 */
+		yy_bp = yy_cp;
+
+		yy_current_state = yy_start;
+yy_match:
+		do
+			{
+			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+			if ( yy_accept[yy_current_state] )
+				{
+				yy_last_accepting_state = yy_current_state;
+				yy_last_accepting_cpos = yy_cp;
+				}
+			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+				{
+				yy_current_state = (int) yy_def[yy_current_state];
+				if ( yy_current_state >= 309 )
+					yy_c = yy_meta[(unsigned int) yy_c];
+				}
+			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+			++yy_cp;
+			}
+		while ( yy_base[yy_current_state] != 544 );
+
+yy_find_action:
+		yy_act = yy_accept[yy_current_state];
+		if ( yy_act == 0 )
+			{ /* have to back up */
+			yy_cp = yy_last_accepting_cpos;
+			yy_current_state = yy_last_accepting_state;
+			yy_act = yy_accept[yy_current_state];
+			}
+
+		YY_DO_BEFORE_ACTION;
+
+
+do_action:	/* This label is used only to access EOF actions. */
+
+
+		switch ( yy_act )
+	{ /* beginning of action switch */
+			case 0: /* must back up */
+			/* undo the effects of YY_DO_BEFORE_ACTION */
+			*yy_cp = yy_hold_char;
+			yy_cp = yy_last_accepting_cpos;
+			yy_current_state = yy_last_accepting_state;
+			goto yy_find_action;
+
+case 1:
+YY_RULE_SETUP
+#line 29 "rc1.0_tokens.l"
+{
+			    A:
+				switch (yyinput()) {
+				  case '*': goto B;
+				  case 0: errors.set("end-of-file in comment", line_number); break;
+				  case '\n': line_number++;
+				  default:  goto A;
+				}
+			    B:
+				switch (yyinput()) {
+				  case '*': goto B;
+				  case '/': break;
+				  case 0: errors.set("end-of-file in comment", line_number); break;
+				  case '\n': line_number++;
+				  default:  goto A;
+				}
+			}
+	YY_BREAK
+case 2:
+YY_RULE_SETUP
+#line 47 "rc1.0_tokens.l"
+{
+			    char ch;
+			    while ((ch = yyinput()) != '\n');
+			    if (ch == '\n') line_number++;
+			}
+	YY_BREAK
+case 3:
+YY_RULE_SETUP
+#line 53 "rc1.0_tokens.l"
+{
+			    char ch;
+			    while ((ch = yyinput()) != '\n');
+			    if (ch == '\n') line_number++;
+			}
+	YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 59 "rc1.0_tokens.l"
+{ /* eat header */ }
+	YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 61 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_FOG_RGB;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 65 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_FOG_ALPHA;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 7:
+YY_RULE_SETUP
+#line 69 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_FOG_BLUE;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 73 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_FOG;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 78 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_PRIMARY_COLOR_RGB;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 82 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_PRIMARY_COLOR_ALPHA;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 86 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_PRIMARY_COLOR_BLUE;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 90 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_PRIMARY_COLOR;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 95 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_SECONDARY_COLOR_RGB;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 99 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_SECONDARY_COLOR_ALPHA;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 103 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_SECONDARY_COLOR_BLUE;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 16:
+YY_RULE_SETUP
+#line 107 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_SECONDARY_COLOR;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 112 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_SPARE0_RGB;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 18:
+YY_RULE_SETUP
+#line 116 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_SPARE0_ALPHA;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 19:
+YY_RULE_SETUP
+#line 120 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_SPARE0_BLUE;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 20:
+YY_RULE_SETUP
+#line 124 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_SPARE0;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 21:
+YY_RULE_SETUP
+#line 129 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_SPARE1_RGB;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 22:
+YY_RULE_SETUP
+#line 133 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_SPARE1_ALPHA;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 23:
+YY_RULE_SETUP
+#line 137 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_SPARE1_BLUE;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 24:
+YY_RULE_SETUP
+#line 141 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_SPARE1;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 25:
+YY_RULE_SETUP
+#line 146 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE0_RGB;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 26:
+YY_RULE_SETUP
+#line 150 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE0_ALPHA;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 27:
+YY_RULE_SETUP
+#line 154 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE0_BLUE;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 28:
+YY_RULE_SETUP
+#line 158 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE0;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 29:
+YY_RULE_SETUP
+#line 163 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE1_RGB;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 30:
+YY_RULE_SETUP
+#line 167 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE1_ALPHA;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 31:
+YY_RULE_SETUP
+#line 171 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE1_BLUE;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 32:
+YY_RULE_SETUP
+#line 175 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE1;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 33:
+YY_RULE_SETUP
+#line 180 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE2_RGB;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 34:
+YY_RULE_SETUP
+#line 184 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE2_ALPHA;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 35:
+YY_RULE_SETUP
+#line 188 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE2_BLUE;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 36:
+YY_RULE_SETUP
+#line 192 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE2;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 37:
+YY_RULE_SETUP
+#line 197 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE3_RGB;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 38:
+YY_RULE_SETUP
+#line 201 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE3_ALPHA;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 39:
+YY_RULE_SETUP
+#line 205 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE3_BLUE;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 40:
+YY_RULE_SETUP
+#line 209 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE3;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 41:
+YY_RULE_SETUP
+#line 214 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_CONST_COLOR0_RGB;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 42:
+YY_RULE_SETUP
+#line 218 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_CONST_COLOR0_ALPHA;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 43:
+YY_RULE_SETUP
+#line 222 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_CONST_COLOR0_BLUE;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 44:
+YY_RULE_SETUP
+#line 226 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_CONST_COLOR0;
+			    return(constVariable);
+			}
+	YY_BREAK
+case 45:
+YY_RULE_SETUP
+#line 231 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_CONST_COLOR1_RGB;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 46:
+YY_RULE_SETUP
+#line 235 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_CONST_COLOR1_ALPHA;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 47:
+YY_RULE_SETUP
+#line 239 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_CONST_COLOR1_BLUE;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 48:
+YY_RULE_SETUP
+#line 243 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_CONST_COLOR1;
+			    return(constVariable);
+			}
+	YY_BREAK
+case 49:
+YY_RULE_SETUP
+#line 248 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_ZERO_RGB;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 50:
+YY_RULE_SETUP
+#line 252 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_ZERO_ALPHA;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 51:
+YY_RULE_SETUP
+#line 256 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_ZERO_BLUE;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 52:
+YY_RULE_SETUP
+#line 260 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_ZERO;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 53:
+YY_RULE_SETUP
+#line 265 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_ONE_RGB;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 54:
+YY_RULE_SETUP
+#line 269 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_ONE_ALPHA;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 55:
+YY_RULE_SETUP
+#line 273 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_ONE_BLUE;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 56:
+YY_RULE_SETUP
+#line 277 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_ONE;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 57:
+YY_RULE_SETUP
+#line 282 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_DISCARD;
+			    return(regVariable);
+			}
+	YY_BREAK
+case 58:
+YY_RULE_SETUP
+#line 287 "rc1.0_tokens.l"
+return(fragment_rgb);
+	YY_BREAK
+case 59:
+YY_RULE_SETUP
+#line 288 "rc1.0_tokens.l"
+return(fragment_alpha);
+	YY_BREAK
+case 60:
+YY_RULE_SETUP
+#line 290 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_FINAL_PRODUCT;
+			    return(final_product);
+			}
+	YY_BREAK
+case 61:
+YY_RULE_SETUP
+#line 295 "rc1.0_tokens.l"
+{
+			    rc10_lval.registerEnum.word = RCP_COLOR_SUM;
+			    return(color_sum);
+			}
+	YY_BREAK
+case 62:
+YY_RULE_SETUP
+#line 300 "rc1.0_tokens.l"
+return(expandString);
+	YY_BREAK
+case 63:
+YY_RULE_SETUP
+#line 301 "rc1.0_tokens.l"
+return(halfBiasString);
+	YY_BREAK
+case 64:
+YY_RULE_SETUP
+#line 302 "rc1.0_tokens.l"
+return(unsignedString);
+	YY_BREAK
+case 65:
+YY_RULE_SETUP
+#line 303 "rc1.0_tokens.l"
+return(unsignedInvertString);
+	YY_BREAK
+case 66:
+YY_RULE_SETUP
+#line 304 "rc1.0_tokens.l"
+{
+					rc10_lval.ival = GL_TRUE;
+					return(muxString);
+				}
+	YY_BREAK
+case 67:
+YY_RULE_SETUP
+#line 309 "rc1.0_tokens.l"
+{
+					rc10_lval.ival = GL_FALSE;
+					return(sumString);
+				}
+	YY_BREAK
+case 68:
+YY_RULE_SETUP
+#line 314 "rc1.0_tokens.l"
+{
+					rc10_lval.ival = RCP_RGB;
+					return(rgb_portion);
+				}
+	YY_BREAK
+case 69:
+YY_RULE_SETUP
+#line 318 "rc1.0_tokens.l"
+{
+					rc10_lval.ival = RCP_ALPHA;
+					return(alpha_portion);
+				}
+	YY_BREAK
+case 70:
+YY_RULE_SETUP
+#line 323 "rc1.0_tokens.l"
+{
+				rc10_lval.ival = true;
+				return(clamp_color_sum);
+			}
+	YY_BREAK
+case 71:
+YY_RULE_SETUP
+#line 327 "rc1.0_tokens.l"
+return(lerp);
+	YY_BREAK
+case 72:
+YY_RULE_SETUP
+#line 330 "rc1.0_tokens.l"
+{
+				rc10_lval.biasScaleEnum.word = RCP_BIAS_BY_NEGATIVE_ONE_HALF_SCALE_BY_TWO;
+				return(bias_by_negative_one_half_scale_by_two);
+			}
+	YY_BREAK
+case 73:
+YY_RULE_SETUP
+#line 334 "rc1.0_tokens.l"
+{
+				rc10_lval.biasScaleEnum.word = RCP_BIAS_BY_NEGATIVE_ONE_HALF;
+				return(bias_by_negative_one_half);
+			}
+	YY_BREAK
+case 74:
+YY_RULE_SETUP
+#line 338 "rc1.0_tokens.l"
+{
+				rc10_lval.biasScaleEnum.word = RCP_SCALE_BY_ONE_HALF;
+				return(scale_by_one_half);
+			}
+	YY_BREAK
+case 75:
+YY_RULE_SETUP
+#line 342 "rc1.0_tokens.l"
+{
+				rc10_lval.biasScaleEnum.word = RCP_SCALE_BY_TWO;
+				return(scale_by_two);
+			}
+	YY_BREAK
+case 76:
+YY_RULE_SETUP
+#line 346 "rc1.0_tokens.l"
+{
+				rc10_lval.biasScaleEnum.word = RCP_SCALE_BY_FOUR;
+				return(scale_by_four);
+			}
+	YY_BREAK
+case 77:
+YY_RULE_SETUP
+#line 351 "rc1.0_tokens.l"
+{
+				rc10_lval.fval = (float)atof(yytext);
+				return(floatValue);
+			}
+	YY_BREAK
+case 78:
+YY_RULE_SETUP
+#line 356 "rc1.0_tokens.l"
+{
+				rc10_lval.fval = (float)atof(yytext);
+				return(floatValue);
+			}
+	YY_BREAK
+case 79:
+YY_RULE_SETUP
+#line 361 "rc1.0_tokens.l"
+{
+				rc10_lval.fval = (float)atof(yytext);
+				return(floatValue);
+			}
+	YY_BREAK
+case 80:
+YY_RULE_SETUP
+#line 366 "rc1.0_tokens.l"
+return(openBracket);
+	YY_BREAK
+case 81:
+YY_RULE_SETUP
+#line 367 "rc1.0_tokens.l"
+return(closeBracket);
+	YY_BREAK
+case 82:
+YY_RULE_SETUP
+#line 368 "rc1.0_tokens.l"
+return(openParen);
+	YY_BREAK
+case 83:
+YY_RULE_SETUP
+#line 369 "rc1.0_tokens.l"
+return(closeParen);
+	YY_BREAK
+case 84:
+YY_RULE_SETUP
+#line 370 "rc1.0_tokens.l"
+return(semicolon);
+	YY_BREAK
+case 85:
+YY_RULE_SETUP
+#line 371 "rc1.0_tokens.l"
+return(comma);
+	YY_BREAK
+case 86:
+YY_RULE_SETUP
+#line 372 "rc1.0_tokens.l"
+return(dot);
+	YY_BREAK
+case 87:
+YY_RULE_SETUP
+#line 373 "rc1.0_tokens.l"
+return(times);
+	YY_BREAK
+case 88:
+YY_RULE_SETUP
+#line 374 "rc1.0_tokens.l"
+return(minus);
+	YY_BREAK
+case 89:
+YY_RULE_SETUP
+#line 375 "rc1.0_tokens.l"
+return(plus);
+	YY_BREAK
+case 90:
+YY_RULE_SETUP
+#line 376 "rc1.0_tokens.l"
+return(equals);
+	YY_BREAK
+case 91:
+YY_RULE_SETUP
+#line 378 "rc1.0_tokens.l"
+{
+				line_number++;
+			}
+	YY_BREAK
+case 92:
+YY_RULE_SETUP
+#line 382 "rc1.0_tokens.l"
+{}
+	YY_BREAK
+case 93:
+YY_RULE_SETUP
+#line 384 "rc1.0_tokens.l"
+{
+				errors.set("unrecognized token", line_number);
+			}
+	YY_BREAK
+case 94:
+YY_RULE_SETUP
+#line 389 "rc1.0_tokens.l"
+ECHO;
+	YY_BREAK
+#line 1574 "_rc1.0_lexer.cpp"
+case YY_STATE_EOF(INITIAL):
+	yyterminate();
+
+	case YY_END_OF_BUFFER:
+		{
+		/* Amount of text matched not including the EOB char. */
+		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+
+		/* Undo the effects of YY_DO_BEFORE_ACTION. */
+		*yy_cp = yy_hold_char;
+		YY_RESTORE_YY_MORE_OFFSET
+
+		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+			{
+			/* We're scanning a new file or input source.  It's
+			 * possible that this happened because the user
+			 * just pointed yyin at a new source and called
+			 * yylex().  If so, then we have to assure
+			 * consistency between yy_current_buffer and our
+			 * globals.  Here is the right place to do so, because
+			 * this is the first action (other than possibly a
+			 * back-up) that will match for the new input source.
+			 */
+			yy_n_chars = yy_current_buffer->yy_n_chars;
+			yy_current_buffer->yy_input_file = yyin;
+			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+			}
+
+		/* Note that here we test for yy_c_buf_p "<=" to the position
+		 * of the first EOB in the buffer, since yy_c_buf_p will
+		 * already have been incremented past the NUL character
+		 * (since all states make transitions on EOB to the
+		 * end-of-buffer state).  Contrast this with the test
+		 * in input().
+		 */
+		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+			{ /* This was really a NUL. */
+			yy_state_type yy_next_state;
+
+			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+
+			yy_current_state = yy_get_previous_state();
+
+			/* Okay, we're now positioned to make the NUL
+			 * transition.  We couldn't have
+			 * yy_get_previous_state() go ahead and do it
+			 * for us because it doesn't know how to deal
+			 * with the possibility of jamming (and we don't
+			 * want to build jamming into it because then it
+			 * will run more slowly).
+			 */
+
+			yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+			yy_bp = yytext_ptr + YY_MORE_ADJ;
+
+			if ( yy_next_state )
+				{
+				/* Consume the NUL. */
+				yy_cp = ++yy_c_buf_p;
+				yy_current_state = yy_next_state;
+				goto yy_match;
+				}
+
+			else
+				{
+				yy_cp = yy_c_buf_p;
+				goto yy_find_action;
+				}
+			}
+
+		else switch ( yy_get_next_buffer() )
+			{
+			case EOB_ACT_END_OF_FILE:
+				{
+				yy_did_buffer_switch_on_eof = 0;
+
+				if ( yywrap() )
+					{
+					/* Note: because we've taken care in
+					 * yy_get_next_buffer() to have set up
+					 * yytext, we can now set up
+					 * yy_c_buf_p so that if some total
+					 * hoser (like flex itself) wants to
+					 * call the scanner after we return the
+					 * YY_NULL, it'll still work - another
+					 * YY_NULL will get returned.
+					 */
+					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+					yy_act = YY_STATE_EOF(YY_START);
+					goto do_action;
+					}
+
+				else
+					{
+					if ( ! yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+					}
+				break;
+				}
+
+			case EOB_ACT_CONTINUE_SCAN:
+				yy_c_buf_p =
+					yytext_ptr + yy_amount_of_matched_text;
+
+				yy_current_state = yy_get_previous_state();
+
+				yy_cp = yy_c_buf_p;
+				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				goto yy_match;
+
+			case EOB_ACT_LAST_MATCH:
+				yy_c_buf_p =
+				&yy_current_buffer->yy_ch_buf[yy_n_chars];
+
+				yy_current_state = yy_get_previous_state();
+
+				yy_cp = yy_c_buf_p;
+				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				goto yy_find_action;
+			}
+		break;
+		}
+
+	default:
+		YY_FATAL_ERROR(
+			"fatal flex scanner internal error--no action found" );
+	} /* end of action switch */
+		} /* end of scanning one token */
+	} /* end of yylex */
+
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ *	EOB_ACT_LAST_MATCH -
+ *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *	EOB_ACT_END_OF_FILE - end of file
+ */
+
+static int yy_get_next_buffer()
+	{
+	register char *dest = yy_current_buffer->yy_ch_buf;
+	register char *source = yytext_ptr;
+	register int number_to_move, i;
+	int ret_val;
+
+	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+		YY_FATAL_ERROR(
+		"fatal flex scanner internal error--end of buffer missed" );
+
+	if ( yy_current_buffer->yy_fill_buffer == 0 )
+		{ /* Don't try to fill the buffer, so this is an EOF. */
+		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+			{
+			/* We matched a single character, the EOB, so
+			 * treat this as a final EOF.
+			 */
+			return EOB_ACT_END_OF_FILE;
+			}
+
+		else
+			{
+			/* We matched some text prior to the EOB, first
+			 * process it.
+			 */
+			return EOB_ACT_LAST_MATCH;
+			}
+		}
+
+	/* Try to read more data. */
+
+	/* First move last chars to start of buffer. */
+	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+
+	for ( i = 0; i < number_to_move; ++i )
+		*(dest++) = *(source++);
+
+	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+		/* don't do the read, it's not guaranteed to return an EOF,
+		 * just force an EOF
+		 */
+		yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+
+	else
+		{
+		int num_to_read =
+			yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+		while ( num_to_read <= 0 )
+			{ /* Not enough room in the buffer - grow it. */
+#ifdef YY_USES_REJECT
+			YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+			/* just a shorter name for the current buffer */
+			YY_BUFFER_STATE b = yy_current_buffer;
+
+			int yy_c_buf_p_offset =
+				(int) (yy_c_buf_p - b->yy_ch_buf);
+
+			if ( b->yy_is_our_buffer )
+				{
+				int new_size = b->yy_buf_size * 2;
+
+				if ( new_size <= 0 )
+					b->yy_buf_size += b->yy_buf_size / 8;
+				else
+					b->yy_buf_size *= 2;
+
+				b->yy_ch_buf = (char *)
+					/* Include room in for 2 EOB chars. */
+					yy_flex_realloc( (void *) b->yy_ch_buf,
+							 b->yy_buf_size + 2 );
+				}
+			else
+				/* Can't grow it, we don't own it. */
+				b->yy_ch_buf = 0;
+
+			if ( ! b->yy_ch_buf )
+				YY_FATAL_ERROR(
+				"fatal error - scanner input buffer overflow" );
+
+			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+			num_to_read = yy_current_buffer->yy_buf_size -
+						number_to_move - 1;
+#endif
+			}
+
+		if ( num_to_read > YY_READ_BUF_SIZE )
+			num_to_read = YY_READ_BUF_SIZE;
+
+		/* Read in more data. */
+		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+			yy_n_chars, num_to_read );
+
+		yy_current_buffer->yy_n_chars = yy_n_chars;
+		}
+
+	if ( yy_n_chars == 0 )
+		{
+		if ( number_to_move == YY_MORE_ADJ )
+			{
+			ret_val = EOB_ACT_END_OF_FILE;
+			yyrestart( yyin );
+			}
+
+		else
+			{
+			ret_val = EOB_ACT_LAST_MATCH;
+			yy_current_buffer->yy_buffer_status =
+				YY_BUFFER_EOF_PENDING;
+			}
+		}
+
+	else
+		ret_val = EOB_ACT_CONTINUE_SCAN;
+
+	yy_n_chars += number_to_move;
+	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+
+	return ret_val;
+	}
+
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+static yy_state_type yy_get_previous_state()
+	{
+	register yy_state_type yy_current_state;
+	register char *yy_cp;
+
+	yy_current_state = yy_start;
+
+	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+		{
+		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+		if ( yy_accept[yy_current_state] )
+			{
+			yy_last_accepting_state = yy_current_state;
+			yy_last_accepting_cpos = yy_cp;
+			}
+		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+			{
+			yy_current_state = (int) yy_def[yy_current_state];
+			if ( yy_current_state >= 309 )
+				yy_c = yy_meta[(unsigned int) yy_c];
+			}
+		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+		}
+
+	return yy_current_state;
+	}
+
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ *	next_state = yy_try_NUL_trans( current_state );
+ */
+
+#ifdef YY_USE_PROTOS
+static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+#else
+static yy_state_type yy_try_NUL_trans( yy_current_state )
+yy_state_type yy_current_state;
+#endif
+	{
+	register int yy_is_jam;
+	register char *yy_cp = yy_c_buf_p;
+
+	register YY_CHAR yy_c = 1;
+	if ( yy_accept[yy_current_state] )
+		{
+		yy_last_accepting_state = yy_current_state;
+		yy_last_accepting_cpos = yy_cp;
+		}
+	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+		{
+		yy_current_state = (int) yy_def[yy_current_state];
+		if ( yy_current_state >= 309 )
+			yy_c = yy_meta[(unsigned int) yy_c];
+		}
+	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+	yy_is_jam = (yy_current_state == 308);
+
+	return yy_is_jam ? 0 : yy_current_state;
+	}
+
+
+#ifndef YY_NO_UNPUT
+#ifdef YY_USE_PROTOS
+static void yyunput( int c, register char *yy_bp )
+#else
+static void yyunput( c, yy_bp )
+int c;
+register char *yy_bp;
+#endif
+	{
+	register char *yy_cp = yy_c_buf_p;
+
+	/* undo effects of setting up yytext */
+	*yy_cp = yy_hold_char;
+
+	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+		{ /* need to shift things up to make room */
+		/* +2 for EOB chars. */
+		register int number_to_move = yy_n_chars + 2;
+		register char *dest = &yy_current_buffer->yy_ch_buf[
+					yy_current_buffer->yy_buf_size + 2];
+		register char *source =
+				&yy_current_buffer->yy_ch_buf[number_to_move];
+
+		while ( source > yy_current_buffer->yy_ch_buf )
+			*--dest = *--source;
+
+		yy_cp += (int) (dest - source);
+		yy_bp += (int) (dest - source);
+		yy_current_buffer->yy_n_chars =
+			yy_n_chars = yy_current_buffer->yy_buf_size;
+
+		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+			YY_FATAL_ERROR( "flex scanner push-back overflow" );
+		}
+
+	*--yy_cp = (char) c;
+
+
+	yytext_ptr = yy_bp;
+	yy_hold_char = *yy_cp;
+	yy_c_buf_p = yy_cp;
+	}
+#endif	/* ifndef YY_NO_UNPUT */
+
+
+#ifdef __cplusplus
+static int yyinput()
+#else
+static int input()
+#endif
+	{
+	int c;
+
+	*yy_c_buf_p = yy_hold_char;
+
+	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+		{
+		/* yy_c_buf_p now points to the character we want to return.
+		 * If this occurs *before* the EOB characters, then it's a
+		 * valid NUL; if not, then we've hit the end of the buffer.
+		 */
+		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+			/* This was really a NUL. */
+			*yy_c_buf_p = '\0';
+
+		else
+			{ /* need more input */
+			int offset = yy_c_buf_p - yytext_ptr;
+			++yy_c_buf_p;
+
+			switch ( yy_get_next_buffer() )
+				{
+				case EOB_ACT_LAST_MATCH:
+					/* This happens because yy_g_n_b()
+					 * sees that we've accumulated a
+					 * token and flags that we need to
+					 * try matching the token before
+					 * proceeding.  But for input(),
+					 * there's no matching to consider.
+					 * So convert the EOB_ACT_LAST_MATCH
+					 * to EOB_ACT_END_OF_FILE.
+					 */
+
+					/* Reset buffer status. */
+					yyrestart( yyin );
+
+					/* fall through */
+
+				case EOB_ACT_END_OF_FILE:
+					{
+					if ( yywrap() )
+						return EOF;
+
+					if ( ! yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+#ifdef __cplusplus
+					return yyinput();
+#else
+					return input();
+#endif
+					}
+
+				case EOB_ACT_CONTINUE_SCAN:
+					yy_c_buf_p = yytext_ptr + offset;
+					break;
+				}
+			}
+		}
+
+	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
+	*yy_c_buf_p = '\0';	/* preserve yytext */
+	yy_hold_char = *++yy_c_buf_p;
+
+
+	return c;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yyrestart( FILE *input_file )
+#else
+void yyrestart( input_file )
+FILE *input_file;
+#endif
+	{
+	if ( ! yy_current_buffer )
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+	yy_init_buffer( yy_current_buffer, input_file );
+	yy_load_buffer_state();
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+#else
+void yy_switch_to_buffer( new_buffer )
+YY_BUFFER_STATE new_buffer;
+#endif
+	{
+	if ( yy_current_buffer == new_buffer )
+		return;
+
+	if ( yy_current_buffer )
+		{
+		/* Flush out information for old buffer. */
+		*yy_c_buf_p = yy_hold_char;
+		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+		yy_current_buffer->yy_n_chars = yy_n_chars;
+		}
+
+	yy_current_buffer = new_buffer;
+	yy_load_buffer_state();
+
+	/* We don't actually know whether we did this switch during
+	 * EOF (yywrap()) processing, but the only time this flag
+	 * is looked at is after yywrap() is called, so it's safe
+	 * to go ahead and always set it.
+	 */
+	yy_did_buffer_switch_on_eof = 1;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_load_buffer_state( void )
+#else
+void yy_load_buffer_state()
+#endif
+	{
+	yy_n_chars = yy_current_buffer->yy_n_chars;
+	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+	yyin = yy_current_buffer->yy_input_file;
+	yy_hold_char = *yy_c_buf_p;
+	}
+
+
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+#else
+YY_BUFFER_STATE yy_create_buffer( file, size )
+FILE *file;
+int size;
+#endif
+	{
+	YY_BUFFER_STATE b;
+
+	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_buf_size = size;
+
+	/* yy_ch_buf has to be 2 characters longer than the size given because
+	 * we need to put in 2 end-of-buffer characters.
+	 */
+	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+	if ( ! b->yy_ch_buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_is_our_buffer = 1;
+
+	yy_init_buffer( b, file );
+
+	return b;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_delete_buffer( YY_BUFFER_STATE b )
+#else
+void yy_delete_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+	{
+	if ( ! b )
+		return;
+
+	if ( b == yy_current_buffer )
+		yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+	if ( b->yy_is_our_buffer )
+		yy_flex_free( (void *) b->yy_ch_buf );
+
+	yy_flex_free( (void *) b );
+	}
+
+
+
+#ifdef YY_USE_PROTOS
+void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+#else
+void yy_init_buffer( b, file )
+YY_BUFFER_STATE b;
+FILE *file;
+#endif
+
+
+	{
+	yy_flush_buffer( b );
+
+	b->yy_input_file = file;
+	b->yy_fill_buffer = 1;
+
+#if YY_ALWAYS_INTERACTIVE
+	b->yy_is_interactive = 1;
+#else
+#if YY_NEVER_INTERACTIVE
+	b->yy_is_interactive = 0;
+#else
+	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+#endif
+#endif
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_flush_buffer( YY_BUFFER_STATE b )
+#else
+void yy_flush_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+
+	{
+	if ( ! b )
+		return;
+
+	b->yy_n_chars = 0;
+
+	/* We always need two end-of-buffer characters.  The first causes
+	 * a transition to the end-of-buffer state.  The second causes
+	 * a jam in that state.
+	 */
+	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+	b->yy_buf_pos = &b->yy_ch_buf[0];
+
+	b->yy_at_bol = 1;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	if ( b == yy_current_buffer )
+		yy_load_buffer_state();
+	}
+
+
+#ifndef YY_NO_SCAN_BUFFER
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+#else
+YY_BUFFER_STATE yy_scan_buffer( base, size )
+char *base;
+yy_size_t size;
+#endif
+	{
+	YY_BUFFER_STATE b;
+
+	if ( size < 2 ||
+	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
+	     base[size-1] != YY_END_OF_BUFFER_CHAR )
+		/* They forgot to leave room for the EOB's. */
+		return 0;
+
+	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
+	b->yy_buf_pos = b->yy_ch_buf = base;
+	b->yy_is_our_buffer = 0;
+	b->yy_input_file = 0;
+	b->yy_n_chars = b->yy_buf_size;
+	b->yy_is_interactive = 0;
+	b->yy_at_bol = 1;
+	b->yy_fill_buffer = 0;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	yy_switch_to_buffer( b );
+
+	return b;
+	}
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+#else
+YY_BUFFER_STATE yy_scan_string( yy_str )
+yyconst char *yy_str;
+#endif
+	{
+	int len;
+	for ( len = 0; yy_str[len]; ++len )
+		;
+
+	return yy_scan_bytes( yy_str, len );
+	}
+#endif
+
+
+#ifndef YY_NO_SCAN_BYTES
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
+#else
+YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+yyconst char *bytes;
+int len;
+#endif
+	{
+	YY_BUFFER_STATE b;
+	char *buf;
+	yy_size_t n;
+	int i;
+
+	/* Get memory for full buffer, including space for trailing EOB's. */
+	n = len + 2;
+	buf = (char *) yy_flex_alloc( n );
+	if ( ! buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+	for ( i = 0; i < len; ++i )
+		buf[i] = bytes[i];
+
+	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+	b = yy_scan_buffer( buf, n );
+	if ( ! b )
+		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+	/* It's okay to grow etc. this buffer, and we should throw it
+	 * away when we're done.
+	 */
+	b->yy_is_our_buffer = 1;
+
+	return b;
+	}
+#endif
+
+
+#ifndef YY_NO_PUSH_STATE
+#ifdef YY_USE_PROTOS
+static void yy_push_state( int new_state )
+#else
+static void yy_push_state( new_state )
+int new_state;
+#endif
+	{
+	if ( yy_start_stack_ptr >= yy_start_stack_depth )
+		{
+		yy_size_t new_size;
+
+		yy_start_stack_depth += YY_START_STACK_INCR;
+		new_size = yy_start_stack_depth * sizeof( int );
+
+		if ( ! yy_start_stack )
+			yy_start_stack = (int *) yy_flex_alloc( new_size );
+
+		else
+			yy_start_stack = (int *) yy_flex_realloc(
+					(void *) yy_start_stack, new_size );
+
+		if ( ! yy_start_stack )
+			YY_FATAL_ERROR(
+			"out of memory expanding start-condition stack" );
+		}
+
+	yy_start_stack[yy_start_stack_ptr++] = YY_START;
+
+	BEGIN(new_state);
+	}
+#endif
+
+
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state()
+	{
+	if ( --yy_start_stack_ptr < 0 )
+		YY_FATAL_ERROR( "start-condition stack underflow" );
+
+	BEGIN(yy_start_stack[yy_start_stack_ptr]);
+	}
+#endif
+
+
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state()
+	{
+	return yy_start_stack[yy_start_stack_ptr - 1];
+	}
+#endif
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+#ifdef YY_USE_PROTOS
+static void yy_fatal_error( yyconst char msg[] )
+#else
+static void yy_fatal_error( msg )
+char msg[];
+#endif
+	{
+	(void) fprintf( stderr, "%s\n", msg );
+	exit( YY_EXIT_FAILURE );
+	}
+
+
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+		yytext[yyleng] = yy_hold_char; \
+		yy_c_buf_p = yytext + n; \
+		yy_hold_char = *yy_c_buf_p; \
+		*yy_c_buf_p = '\0'; \
+		yyleng = n; \
+		} \
+	while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef yytext_ptr
+#ifdef YY_USE_PROTOS
+static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
+#else
+static void yy_flex_strncpy( s1, s2, n )
+char *s1;
+yyconst char *s2;
+int n;
+#endif
+	{
+	register int i;
+	for ( i = 0; i < n; ++i )
+		s1[i] = s2[i];
+	}
+#endif
+
+#ifdef YY_NEED_STRLEN
+#ifdef YY_USE_PROTOS
+static int yy_flex_strlen( yyconst char *s )
+#else
+static int yy_flex_strlen( s )
+yyconst char *s;
+#endif
+	{
+	register int n;
+	for ( n = 0; s[n]; ++n )
+		;
+
+	return n;
+	}
+#endif
+
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_alloc( yy_size_t size )
+#else
+static void *yy_flex_alloc( size )
+yy_size_t size;
+#endif
+	{
+	return (void *) malloc( size );
+	}
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_realloc( void *ptr, yy_size_t size )
+#else
+static void *yy_flex_realloc( ptr, size )
+void *ptr;
+yy_size_t size;
+#endif
+	{
+	/* The cast to (char *) in the following accommodates both
+	 * implementations that use char* generic pointers, and those
+	 * that use void* generic pointers.  It works with the latter
+	 * because both ANSI C and C++ allow castless assignment from
+	 * any pointer type to void*, and deal with argument conversions
+	 * as though doing an assignment.
+	 */
+	return (void *) realloc( (char *) ptr, size );
+	}
+
+#ifdef YY_USE_PROTOS
+static void yy_flex_free( void *ptr )
+#else
+static void yy_flex_free( ptr )
+void *ptr;
+#endif
+	{
+	free( ptr );
+	}
+
+#if YY_MAIN
+int main()
+	{
+	yylex();
+	return 0;
+	}
+#endif
+#line 389 "rc1.0_tokens.l"
+
+
+bool rc10_init_more();
+
+bool rc10_init(char* inputString)
+{
+    myin = inputString;
+	return rc10_init_more();
+}
+
+#ifndef rc10_wrap
+int rc10_wrap(void)
+{
+  return(1);
+}
+#endif
Index: /RenderSystems/GL/src/nvparse/_rc1.0_parser.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/_rc1.0_parser.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/_rc1.0_parser.cpp	(revision 5)
@@ -0,0 +1,2325 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/* A Bison parser, made by GNU Bison 1.875.  */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+/* Written by Richard Stallman by simplifying the original so called
+   ``semantic'' parser.  */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+   infringing on user name space.  This should be done even for local
+   variables, as they might otherwise be expanded by user macros.
+   There are some unavoidable exceptions within include files to
+   define necessary library symbols; they are noted "INFRINGES ON
+   USER NAME SPACE" below.  */
+
+/* Identify Bison output.  */
+#define YYBISON 1
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+/* If NAME_PREFIX is specified substitute the variables and functions
+   names.  */
+#define yyparse rc10_parse
+#define yylex   rc10_lex
+#define yyerror rc10_error
+#define yylval  rc10_lval
+#define yychar  rc10_char
+#define yydebug rc10_debug
+#define yynerrs rc10_nerrs
+
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     regVariable = 258,
+     constVariable = 259,
+     color_sum = 260,
+     final_product = 261,
+     expandString = 262,
+     halfBiasString = 263,
+     unsignedString = 264,
+     unsignedInvertString = 265,
+     muxString = 266,
+     sumString = 267,
+     rgb_portion = 268,
+     alpha_portion = 269,
+     openParen = 270,
+     closeParen = 271,
+     openBracket = 272,
+     closeBracket = 273,
+     semicolon = 274,
+     comma = 275,
+     dot = 276,
+     times = 277,
+     minus = 278,
+     equals = 279,
+     plus = 280,
+     bias_by_negative_one_half_scale_by_two = 281,
+     bias_by_negative_one_half = 282,
+     scale_by_one_half = 283,
+     scale_by_two = 284,
+     scale_by_four = 285,
+     clamp_color_sum = 286,
+     lerp = 287,
+     fragment_rgb = 288,
+     fragment_alpha = 289,
+     floatValue = 290
+   };
+#endif
+#define regVariable 258
+#define constVariable 259
+#define color_sum 260
+#define final_product 261
+#define expandString 262
+#define halfBiasString 263
+#define unsignedString 264
+#define unsignedInvertString 265
+#define muxString 266
+#define sumString 267
+#define rgb_portion 268
+#define alpha_portion 269
+#define openParen 270
+#define closeParen 271
+#define openBracket 272
+#define closeBracket 273
+#define semicolon 274
+#define comma 275
+#define dot 276
+#define times 277
+#define minus 278
+#define equals 279
+#define plus 280
+#define bias_by_negative_one_half_scale_by_two 281
+#define bias_by_negative_one_half 282
+#define scale_by_one_half 283
+#define scale_by_two 284
+#define scale_by_four 285
+#define clamp_color_sum 286
+#define lerp 287
+#define fragment_rgb 288
+#define fragment_alpha 289
+#define floatValue 290
+
+
+
+
+/* Copy the first part of user declarations.  */
+#line 3 "rc1.0_grammar.y"
+
+void yyerror(char* s);
+int yylex ( void );
+
+#ifdef _WIN32
+# include <windows.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "rc1.0_combiners.h"
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+
+
+
+/* Enabling traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+/* Enabling verbose error messages.  */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#line 20 "rc1.0_grammar.y"
+typedef union YYSTYPE {
+  int ival;
+  float fval;
+  RegisterEnum registerEnum;
+  BiasScaleEnum biasScaleEnum;
+  MappedRegisterStruct mappedRegisterStruct;
+  ConstColorStruct constColorStruct;
+  GeneralPortionStruct generalPortionStruct;
+  GeneralFunctionStruct generalFunctionStruct;
+  OpStruct opStruct;
+  GeneralCombinerStruct generalCombinerStruct;
+  GeneralCombinersStruct generalCombinersStruct;
+  FinalProductStruct finalProductStruct;
+  FinalRgbFunctionStruct finalRgbFunctionStruct;
+  FinalAlphaFunctionStruct finalAlphaFunctionStruct;
+  FinalCombinerStruct finalCombinerStruct;
+  CombinersStruct combinersStruct;
+} YYSTYPE;
+/* Line 191 of yacc.c.  */
+#line 191 "_rc1.0_parser.c"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+/* Copy the second part of user declarations.  */
+
+
+/* Line 214 of yacc.c.  */
+#line 203 "_rc1.0_parser.c"
+
+#if ! defined (yyoverflow) || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols.  */
+
+# if YYSTACK_USE_ALLOCA
+#  define YYSTACK_ALLOC alloca
+# else
+#  ifndef YYSTACK_USE_ALLOCA
+#   if defined (alloca) || defined (_ALLOCA_H)
+#    define YYSTACK_ALLOC alloca
+#   else
+#    ifdef __GNUC__
+#     define YYSTACK_ALLOC __builtin_alloca
+#    endif
+#   endif
+#  endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+   /* Pacify GCC's `empty if-body' warning. */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+# else
+#  if defined (__STDC__) || defined (__cplusplus)
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   define YYSIZE_T size_t
+#  endif
+#  define YYSTACK_ALLOC malloc
+#  define YYSTACK_FREE free
+# endif
+#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+
+
+#if (! defined (yyoverflow) \
+     && (! defined (__cplusplus) \
+	 || (YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member.  */
+union yyalloc
+{
+  short yyss;
+  YYSTYPE yyvs;
+  };
+
+/* The size of the maximum gap between one aligned stack and the next.  */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+   N elements.  */
+# define YYSTACK_BYTES(N) \
+     ((N) * (sizeof (short) + sizeof (YYSTYPE))				\
+      + YYSTACK_GAP_MAXIMUM)
+
+/* Copy COUNT objects from FROM to TO.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if 1 < __GNUC__
+#   define YYCOPY(To, From, Count) \
+      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#  else
+#   define YYCOPY(To, From, Count)		\
+      do					\
+	{					\
+	  register YYSIZE_T yyi;		\
+	  for (yyi = 0; yyi < (Count); yyi++)	\
+	    (To)[yyi] = (From)[yyi];		\
+	}					\
+      while (0)
+#  endif
+# endif
+
+/* Relocate STACK from its old location to the new one.  The
+   local variables YYSIZE and YYSTACKSIZE give the old and new number of
+   elements in the stack, and YYPTR gives the new location of the
+   stack.  Advance YYPTR to a properly aligned location for the next
+   stack.  */
+# define YYSTACK_RELOCATE(Stack)					\
+    do									\
+      {									\
+	YYSIZE_T yynewbytes;						\
+	YYCOPY (&yyptr->Stack, Stack, yysize);				\
+	Stack = &yyptr->Stack;						\
+	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+	yyptr += yynewbytes / sizeof (*yyptr);				\
+      }									\
+    while (0)
+
+#endif
+
+#if defined (__STDC__) || defined (__cplusplus)
+   typedef signed char yysigned_char;
+#else
+   typedef short yysigned_char;
+#endif
+
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL  27
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   258
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS  36
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS  22
+/* YYNRULES -- Number of rules. */
+#define YYNRULES  88
+/* YYNRULES -- Number of states. */
+#define YYNSTATES  220
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   290
+
+#define YYTRANSLATE(YYX) 						\
+  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+static const unsigned char yytranslate[] =
+{
+       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
+       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
+      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
+      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
+      35
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const unsigned short yyprhs[] =
+{
+       0,     0,     3,     5,     9,    14,    17,    20,    24,    26,
+      39,    42,    44,    49,    55,    62,    66,    71,    77,    83,
+      88,    90,    92,    94,    97,   102,   108,   113,   119,   124,
+     129,   132,   135,   138,   140,   143,   147,   151,   153,   160,
+     167,   172,   179,   186,   191,   196,   201,   206,   211,   213,
+     218,   223,   225,   230,   235,   237,   242,   247,   250,   254,
+     258,   263,   268,   271,   275,   279,   284,   289,   291,   294,
+     297,   301,   305,   307,   310,   313,   317,   321,   326,   333,
+     347,   361,   373,   380,   389,   394,   401,   406,   408
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yysigned_char yyrhs[] =
+{
+      37,     0,    -1,    38,    -1,    39,    40,    52,    -1,    39,
+      39,    40,    52,    -1,    40,    52,    -1,    39,    52,    -1,
+      39,    39,    52,    -1,    52,    -1,     4,    24,    15,    35,
+      20,    35,    20,    35,    20,    35,    16,    19,    -1,    40,
+      41,    -1,    41,    -1,    17,    42,    42,    18,    -1,    17,
+      39,    42,    42,    18,    -1,    17,    39,    39,    42,    42,
+      18,    -1,    17,    42,    18,    -1,    17,    39,    42,    18,
+      -1,    17,    39,    39,    42,    18,    -1,    43,    17,    45,
+      50,    18,    -1,    43,    17,    45,    18,    -1,    13,    -1,
+      14,    -1,    57,    -1,    23,    57,    -1,     7,    15,    57,
+      16,    -1,    23,     7,    15,    57,    16,    -1,     8,    15,
+      57,    16,    -1,    23,     8,    15,    57,    16,    -1,     9,
+      15,    57,    16,    -1,    10,    15,    57,    16,    -1,    46,
+      46,    -1,    46,    47,    -1,    47,    46,    -1,    46,    -1,
+      47,    47,    -1,    47,    47,    48,    -1,    47,    47,    49,
+      -1,    47,    -1,    57,    24,    44,    21,    44,    19,    -1,
+      57,    24,    44,    22,    44,    19,    -1,    57,    24,    44,
+      19,    -1,    57,    24,    11,    15,    16,    19,    -1,    57,
+      24,    12,    15,    16,    19,    -1,    26,    15,    16,    19,
+      -1,    27,    15,    16,    19,    -1,    28,    15,    16,    19,
+      -1,    29,    15,    16,    19,    -1,    30,    15,    16,    19,
+      -1,    57,    -1,     9,    15,    57,    16,    -1,    10,    15,
+      57,    16,    -1,     5,    -1,     9,    15,     5,    16,    -1,
+      10,    15,     5,    16,    -1,     6,    -1,     9,    15,     6,
+      16,    -1,    10,    15,     6,    16,    -1,    56,    55,    -1,
+      53,    56,    55,    -1,    54,    56,    55,    -1,    53,    54,
+      56,    55,    -1,    54,    53,    56,    55,    -1,    55,    56,
+      -1,    53,    55,    56,    -1,    54,    55,    56,    -1,    53,
+      54,    55,    56,    -1,    54,    53,    55,    56,    -1,    55,
+      -1,    53,    55,    -1,    54,    55,    -1,    53,    54,    55,
+      -1,    54,    53,    55,    -1,    56,    -1,    53,    56,    -1,
+      54,    56,    -1,    53,    54,    56,    -1,    54,    53,    56,
+      -1,    31,    15,    16,    19,    -1,     6,    24,    51,    22,
+      51,    19,    -1,    33,    24,    32,    15,    51,    20,    51,
+      20,    51,    16,    25,    51,    19,    -1,    33,    24,    51,
+      25,    32,    15,    51,    20,    51,    20,    51,    16,    19,
+      -1,    33,    24,    32,    15,    51,    20,    51,    20,    51,
+      16,    19,    -1,    33,    24,    51,    22,    51,    19,    -1,
+      33,    24,    51,    22,    51,    25,    51,    19,    -1,    33,
+      24,    51,    19,    -1,    33,    24,    51,    25,    51,    19,
+      -1,    34,    24,    51,    19,    -1,     4,    -1,     3,    -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const unsigned short yyrline[] =
+{
+       0,    73,    73,    80,    86,    92,    98,   106,   114,   124,
+     133,   138,   146,   152,   158,   164,   170,   176,   184,   190,
+     200,   204,   210,   216,   222,   228,   234,   240,   246,   252,
+     260,   266,   272,   278,   284,   290,   296,   302,   310,   318,
+     324,   336,   344,   352,   356,   360,   364,   368,   374,   380,
+     386,   392,   398,   404,   410,   416,   422,   430,   436,   442,
+     448,   454,   461,   467,   473,   479,   485,   492,   500,   508,
+     516,   524,   533,   541,   549,   557,   565,   575,   581,   589,
+     595,   601,   611,   623,   633,   647,   661,   669,   673
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE
+/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+static const char *const yytname[] =
+{
+  "$end", "error", "$undefined", "regVariable", "constVariable", 
+  "color_sum", "final_product", "expandString", "halfBiasString", 
+  "unsignedString", "unsignedInvertString", "muxString", "sumString", 
+  "rgb_portion", "alpha_portion", "openParen", "closeParen", 
+  "openBracket", "closeBracket", "semicolon", "comma", "dot", "times", 
+  "minus", "equals", "plus", "bias_by_negative_one_half_scale_by_two", 
+  "bias_by_negative_one_half", "scale_by_one_half", "scale_by_two", 
+  "scale_by_four", "clamp_color_sum", "lerp", "fragment_rgb", 
+  "fragment_alpha", "floatValue", "$accept", "WholeEnchilada", 
+  "Combiners", "ConstColor", "GeneralCombiners", "GeneralCombiner", 
+  "GeneralPortion", "PortionDesignator", "GeneralMappedRegister", 
+  "GeneralFunction", "Dot", "Mul", "Mux", "Sum", "BiasScale", 
+  "FinalMappedRegister", "FinalCombiner", "ClampColorSum", "FinalProduct", 
+  "FinalRgbFunction", "FinalAlphaFunction", "Register", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+   token YYLEX-NUM.  */
+static const unsigned short yytoknum[] =
+{
+       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
+     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
+     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
+     285,   286,   287,   288,   289,   290
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const unsigned char yyr1[] =
+{
+       0,    36,    37,    38,    38,    38,    38,    38,    38,    39,
+      40,    40,    41,    41,    41,    41,    41,    41,    42,    42,
+      43,    43,    44,    44,    44,    44,    44,    44,    44,    44,
+      45,    45,    45,    45,    45,    45,    45,    45,    46,    47,
+      47,    48,    49,    50,    50,    50,    50,    50,    51,    51,
+      51,    51,    51,    51,    51,    51,    51,    52,    52,    52,
+      52,    52,    52,    52,    52,    52,    52,    52,    52,    52,
+      52,    52,    52,    52,    52,    52,    52,    53,    54,    55,
+      55,    55,    55,    55,    55,    55,    56,    57,    57
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const unsigned char yyr2[] =
+{
+       0,     2,     1,     3,     4,     2,     2,     3,     1,    12,
+       2,     1,     4,     5,     6,     3,     4,     5,     5,     4,
+       1,     1,     1,     2,     4,     5,     4,     5,     4,     4,
+       2,     2,     2,     1,     2,     3,     3,     1,     6,     6,
+       4,     6,     6,     4,     4,     4,     4,     4,     1,     4,
+       4,     1,     4,     4,     1,     4,     4,     2,     3,     3,
+       4,     4,     2,     3,     3,     4,     4,     1,     2,     2,
+       3,     3,     1,     2,     2,     3,     3,     4,     6,    13,
+      13,    11,     6,     8,     4,     6,     4,     1,     1
+};
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+   means the default is an error.  */
+static const unsigned char yydefact[] =
+{
+       0,     0,     0,     0,     0,     0,     0,     0,     2,     0,
+       0,    11,     8,     0,     0,    67,    72,     0,     0,    20,
+      21,     0,     0,     0,     0,     0,     0,     1,     0,     0,
+       6,    10,     5,     0,    68,    73,     0,    69,    74,    62,
+      57,     0,    88,    87,    51,    54,     0,     0,     0,    48,
+       0,     0,    15,     0,     0,     0,     0,     0,     0,     0,
+       7,     3,    70,    75,    63,    58,    71,    76,    64,    59,
+       0,     0,     0,     0,     0,    16,     0,    12,     0,    33,
+      37,     0,    77,     0,    84,     0,     0,    86,     4,    65,
+      60,    66,    61,     0,     0,     0,     0,     0,     0,     0,
+       0,    17,     0,    13,    19,     0,     0,     0,     0,     0,
+       0,    30,    31,    32,    34,     0,     0,     0,     0,     0,
+       0,    52,    55,    49,    53,    56,    50,    78,    14,     0,
+       0,     0,     0,     0,    18,    35,    36,     0,     0,     0,
+       0,     0,     0,     0,    22,     0,    82,     0,     0,    85,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,    23,    40,     0,     0,     0,     0,     0,
+       0,    43,    44,    45,    46,    47,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,    83,     0,     0,
+       0,     0,    24,    26,    28,    29,     0,     0,    38,    39,
+       0,     0,     0,     0,     0,    25,    27,     0,     0,     0,
+      41,    42,    81,     0,     0,     9,     0,     0,    79,    80
+};
+
+/* YYDEFGOTO[NTERM-NUM]. */
+static const short yydefgoto[] =
+{
+      -1,     7,     8,     9,    10,    11,    22,    23,   143,    78,
+      79,    80,   135,   136,   110,    48,    12,    13,    14,    15,
+      16,    49
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -63
+static const short yypact[] =
+{
+      48,   -13,    -8,    53,    16,    11,    14,    73,   -63,    48,
+      94,   -63,   -63,    43,   147,    44,    47,    70,   144,   -63,
+     -63,    53,    -5,    74,    78,    83,   144,   -63,    94,    94,
+     -63,   -63,   -63,    17,    44,    47,    17,    44,    47,   -63,
+     -63,    64,   -63,   -63,   -63,   -63,    97,   111,   107,   -63,
+      58,   103,   -63,   117,    80,   132,   142,    21,   139,    94,
+     -63,   -63,    44,    47,   -63,   -63,    44,    47,   -63,   -63,
+     146,   167,   171,   144,   151,   -63,   149,   -63,   116,    80,
+      80,   138,   -63,   144,   -63,   144,    92,   -63,   -63,   -63,
+     -63,   -63,   -63,   133,   170,   173,   174,   175,   176,   177,
+     160,   -63,   169,   -63,   -63,   179,   180,   181,   182,   183,
+     184,   -63,   -63,   -63,    80,   129,   185,    28,   186,   187,
+     188,   -63,   -63,   -63,   -63,   -63,   -63,   -63,   -63,   191,
+     193,   194,   195,   196,   -63,   -63,   -63,   189,   199,   200,
+     201,   202,   152,   163,   -63,   144,   -63,   144,   144,   -63,
+     164,   203,   204,   205,   206,   207,    98,    80,    80,    80,
+      80,   212,   213,   -63,   -63,   129,   129,   198,   210,   211,
+     214,   -63,   -63,   -63,   -63,   -63,   215,   217,   219,   220,
+     221,   222,    80,    80,   223,   224,   144,   -63,   144,   165,
+     225,   228,   -63,   -63,   -63,   -63,   229,   230,   -63,   -63,
+     231,   232,   233,   234,   235,   -63,   -63,    50,   144,   236,
+     -63,   -63,   -63,   144,   240,   -63,   238,   239,   -63,   -63
+};
+
+/* YYPGOTO[NTERM-NUM].  */
+static const short yypgoto[] =
+{
+     -63,   -63,   -63,     9,    -2,     0,   -18,   -63,   -62,   -63,
+      39,    61,   -63,   -63,   -63,   -25,    -4,   190,   208,     1,
+       8,   -52
+};
+
+/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
+   positive, shift that token.  If negative, reduce the rule which
+   number is the opposite.  If zero, do what YYDEFACT says.
+   If YYTABLE_NINF, syntax error.  */
+#define YYTABLE_NINF -1
+static const unsigned char yytable[] =
+{
+      57,    58,    81,    51,    53,    30,    32,    29,    19,    20,
+      31,    17,    21,    52,    34,    37,    18,    40,    28,    96,
+      99,    35,    38,    39,    60,    61,    59,    81,    81,    31,
+      50,    24,    74,    76,    62,    25,    65,    66,    26,    69,
+      84,    63,    64,    85,    67,    68,    86,   146,   100,     2,
+       5,     6,     1,   147,     2,    88,   102,     1,   116,    31,
+     117,   119,   137,   144,    90,     3,    19,    20,    92,   212,
+      89,    19,    20,    27,    91,   213,     5,     6,     6,     4,
+       5,     5,     6,    42,    43,    41,    42,    43,    44,    45,
+     163,    54,    46,    47,    55,    42,    43,    44,    45,    70,
+       2,    46,    47,   184,   185,   178,   179,   180,   181,   176,
+     177,     3,    71,   144,   144,    56,    19,    20,   111,   113,
+     167,    75,   168,   169,   118,     4,    72,     5,     6,    73,
+     196,   197,    42,    43,   104,    77,   138,   139,   140,   141,
+     112,   114,   105,   106,   107,   108,   109,    42,    43,    44,
+      45,    82,   142,    46,    47,    42,    43,    83,    87,   161,
+     162,   200,   115,   201,    19,    20,    93,   103,   120,   101,
+      42,    43,    94,    95,    42,    43,    97,    98,     4,   127,
+       5,     6,   164,   214,   165,   166,   121,   128,   216,   122,
+     123,   124,   125,   126,   129,   130,   131,   132,   133,   170,
+     202,   148,   134,     0,    36,   145,   149,   151,   150,   152,
+     153,   154,   155,   156,   157,   158,   159,   160,   186,     0,
+       0,    33,   171,   172,   173,   174,   175,   182,   183,   187,
+     190,   188,   191,     0,   189,   192,   193,   194,   195,     0,
+       0,   203,   198,   199,   204,   205,   206,   207,     0,   209,
+       0,     0,   208,   210,   211,   215,   217,   218,   219
+};
+
+static const short yycheck[] =
+{
+      25,    26,    54,    21,    22,     9,    10,     9,    13,    14,
+      10,    24,     3,    18,    13,    14,    24,    16,     9,    71,
+      72,    13,    14,    15,    28,    29,    28,    79,    80,    29,
+      21,    15,    50,    51,    33,    24,    35,    36,    24,    38,
+      19,    33,    34,    22,    36,    37,    25,    19,    73,     6,
+      33,    34,     4,    25,     6,    59,    74,     4,    83,    59,
+      85,    86,   114,   115,    63,    17,    13,    14,    67,    19,
+      62,    13,    14,     0,    66,    25,    33,    34,    34,    31,
+      33,    33,    34,     3,     4,    15,     3,     4,     5,     6,
+     142,    17,     9,    10,    16,     3,     4,     5,     6,    35,
+       6,     9,    10,   165,   166,   157,   158,   159,   160,    11,
+      12,    17,    15,   165,   166,    32,    13,    14,    79,    80,
+     145,    18,   147,   148,    32,    31,    15,    33,    34,    22,
+     182,   183,     3,     4,    18,    18,     7,     8,     9,    10,
+      79,    80,    26,    27,    28,    29,    30,     3,     4,     5,
+       6,    19,    23,     9,    10,     3,     4,    15,    19,     7,
+       8,   186,    24,   188,    13,    14,    20,    18,    35,    18,
+       3,     4,     5,     6,     3,     4,     5,     6,    31,    19,
+      33,    34,    19,   208,    21,    22,    16,    18,   213,    16,
+      16,    16,    16,    16,    15,    15,    15,    15,    15,    35,
+      35,    15,    18,    -1,    14,    20,    19,    16,    20,    16,
+      16,    16,    16,    24,    15,    15,    15,    15,    20,    -1,
+      -1,    13,    19,    19,    19,    19,    19,    15,    15,    19,
+      15,    20,    15,    -1,    20,    16,    16,    16,    16,    -1,
+      -1,    16,    19,    19,    16,    16,    16,    16,    -1,    16,
+      -1,    -1,    20,    19,    19,    19,    16,    19,    19
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const unsigned char yystos[] =
+{
+       0,     4,     6,    17,    31,    33,    34,    37,    38,    39,
+      40,    41,    52,    53,    54,    55,    56,    24,    24,    13,
+      14,    39,    42,    43,    15,    24,    24,     0,    39,    40,
+      52,    41,    52,    54,    55,    56,    53,    55,    56,    56,
+      55,    15,     3,     4,     5,     6,     9,    10,    51,    57,
+      39,    42,    18,    42,    17,    16,    32,    51,    51,    40,
+      52,    52,    55,    56,    56,    55,    55,    56,    56,    55,
+      35,    15,    15,    22,    42,    18,    42,    18,    45,    46,
+      47,    57,    19,    15,    19,    22,    25,    19,    52,    56,
+      55,    56,    55,    20,     5,     6,    57,     5,     6,    57,
+      51,    18,    42,    18,    18,    26,    27,    28,    29,    30,
+      50,    46,    47,    46,    47,    24,    51,    51,    32,    51,
+      35,    16,    16,    16,    16,    16,    16,    19,    18,    15,
+      15,    15,    15,    15,    18,    48,    49,    57,     7,     8,
+       9,    10,    23,    44,    57,    20,    19,    25,    15,    19,
+      20,    16,    16,    16,    16,    16,    24,    15,    15,    15,
+      15,     7,     8,    57,    19,    21,    22,    51,    51,    51,
+      35,    19,    19,    19,    19,    19,    11,    12,    57,    57,
+      57,    57,    15,    15,    44,    44,    20,    19,    20,    20,
+      15,    15,    16,    16,    16,    16,    57,    57,    19,    19,
+      51,    51,    35,    16,    16,    16,    16,    16,    20,    16,
+      19,    19,    19,    25,    51,    19,    51,    16,    19,    19
+};
+
+#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
+# define YYSIZE_T __SIZE_TYPE__
+#endif
+#if ! defined (YYSIZE_T) && defined (size_t)
+# define YYSIZE_T size_t
+#endif
+#if ! defined (YYSIZE_T)
+# if defined (__STDC__) || defined (__cplusplus)
+#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYSIZE_T size_t
+# endif
+#endif
+#if ! defined (YYSIZE_T)
+# define YYSIZE_T unsigned int
+#endif
+
+#define yyerrok		(yyerrstatus = 0)
+#define yyclearin	(yychar = YYEMPTY)
+#define YYEMPTY		(-2)
+#define YYEOF		0
+
+#define YYACCEPT	goto yyacceptlab
+#define YYABORT		goto yyabortlab
+#define YYERROR		goto yyerrlab1
+
+
+/* Like YYERROR except do call yyerror.  This remains here temporarily
+   to ease the transition to the new meaning of YYERROR, for GCC.
+   Once GCC version 2 has supplanted version 1, this can go.  */
+
+#define YYFAIL		goto yyerrlab
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)					\
+do								\
+  if (yychar == YYEMPTY && yylen == 1)				\
+    {								\
+      yychar = (Token);						\
+      yylval = (Value);						\
+      yytoken = YYTRANSLATE (yychar);				\
+      YYPOPSTACK;						\
+      goto yybackup;						\
+    }								\
+  else								\
+    { 								\
+      yyerror ("syntax error: cannot back up");\
+      YYERROR;							\
+    }								\
+while (0)
+
+#define YYTERROR	1
+#define YYERRCODE	256
+
+/* YYLLOC_DEFAULT -- Compute the default location (before the actions
+   are run).  */
+
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N)         \
+  Current.first_line   = Rhs[1].first_line;      \
+  Current.first_column = Rhs[1].first_column;    \
+  Current.last_line    = Rhs[N].last_line;       \
+  Current.last_column  = Rhs[N].last_column;
+#endif
+
+/* YYLEX -- calling `yylex' with the right arguments.  */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#endif
+
+/* Enable debugging if requested.  */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args)			\
+do {						\
+  if (yydebug)					\
+    YYFPRINTF Args;				\
+} while (0)
+
+# define YYDSYMPRINT(Args)			\
+do {						\
+  if (yydebug)					\
+    yysymprint Args;				\
+} while (0)
+
+# define YYDSYMPRINTF(Title, Token, Value, Location)		\
+do {								\
+  if (yydebug)							\
+    {								\
+      YYFPRINTF (stderr, "%s ", Title);				\
+      yysymprint (stderr, 					\
+                  Token, Value);	\
+      YYFPRINTF (stderr, "\n");					\
+    }								\
+} while (0)
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (cinluded).                                                   |
+`------------------------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_stack_print (short *bottom, short *top)
+#else
+static void
+yy_stack_print (bottom, top)
+    short *bottom;
+    short *top;
+#endif
+{
+  YYFPRINTF (stderr, "Stack now");
+  for (/* Nothing. */; bottom <= top; ++bottom)
+    YYFPRINTF (stderr, " %d", *bottom);
+  YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top)				\
+do {								\
+  if (yydebug)							\
+    yy_stack_print ((Bottom), (Top));				\
+} while (0)
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced.  |
+`------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_reduce_print (int yyrule)
+#else
+static void
+yy_reduce_print (yyrule)
+    int yyrule;
+#endif
+{
+  int yyi;
+  unsigned int yylineno = yyrline[yyrule];
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
+             yyrule - 1, yylineno);
+  /* Print the symbols being reduced, and their result.  */
+  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
+    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
+  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
+}
+
+# define YY_REDUCE_PRINT(Rule)		\
+do {					\
+  if (yydebug)				\
+    yy_reduce_print (Rule);		\
+} while (0)
+
+/* Nonzero means print parse trace.  It is left uninitialized so that
+   multiple parsers can coexist.  */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YYDSYMPRINT(Args)
+# define YYDSYMPRINTF(Title, Token, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks.  */
+#ifndef	YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+   if the built-in stack extension method is used).
+
+   Do not make this value too large; the results are undefined if
+   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+   evaluated with infinite-precision integer arithmetic.  */
+
+#if YYMAXDEPTH == 0
+# undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+#  if defined (__GLIBC__) && defined (_STRING_H)
+#   define yystrlen strlen
+#  else
+/* Return the length of YYSTR.  */
+static YYSIZE_T
+#   if defined (__STDC__) || defined (__cplusplus)
+yystrlen (const char *yystr)
+#   else
+yystrlen (yystr)
+     const char *yystr;
+#   endif
+{
+  register const char *yys = yystr;
+
+  while (*yys++ != '\0')
+    continue;
+
+  return yys - yystr - 1;
+}
+#  endif
+# endif
+
+# ifndef yystpcpy
+#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+#   define yystpcpy stpcpy
+#  else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+   YYDEST.  */
+static char *
+#   if defined (__STDC__) || defined (__cplusplus)
+yystpcpy (char *yydest, const char *yysrc)
+#   else
+yystpcpy (yydest, yysrc)
+     char *yydest;
+     const char *yysrc;
+#   endif
+{
+  register char *yyd = yydest;
+  register const char *yys = yysrc;
+
+  while ((*yyd++ = *yys++) != '\0')
+    continue;
+
+  return yyd - 1;
+}
+#  endif
+# endif
+
+#endif /* !YYERROR_VERBOSE */
+
+
+
+
+#if YYDEBUG
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yysymprint (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  /* Pacify ``unused variable'' warnings.  */
+  (void) yyvaluep;
+
+  if (yytype < YYNTOKENS)
+    {
+      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+# ifdef YYPRINT
+      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# endif
+    }
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  switch (yytype)
+    {
+      default:
+        break;
+    }
+  YYFPRINTF (yyoutput, ")");
+}
+
+#endif /* ! YYDEBUG */
+/*-----------------------------------------------.
+| Release the memory associated to this symbol.  |
+`-----------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yydestruct (int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yydestruct (yytype, yyvaluep)
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  /* Pacify ``unused variable'' warnings.  */
+  (void) yyvaluep;
+
+  switch (yytype)
+    {
+
+      default:
+        break;
+    }
+}
+
+
+
+/* Prevent warnings from -Wmissing-prototypes.  */
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM);
+# else
+int yyparse ();
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+
+/* The lookahead symbol.  */
+int yychar;
+
+/* The semantic value of the lookahead symbol.  */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far.  */
+int yynerrs;
+
+
+
+/*----------.
+| yyparse.  |
+`----------*/
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM)
+# else
+int yyparse (YYPARSE_PARAM)
+  void *YYPARSE_PARAM;
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int
+yyparse (void)
+#else
+int
+yyparse ()
+
+#endif
+#endif
+{
+  
+  register int yystate;
+  register int yyn;
+  int yyresult;
+  /* Number of tokens to shift before error messages enabled.  */
+  int yyerrstatus;
+  /* Lookahead token as an internal (translated) token number.  */
+  int yytoken = 0;
+
+  /* Three stacks and their tools:
+     `yyss': related to states,
+     `yyvs': related to semantic values,
+     `yyls': related to locations.
+
+     Refer to the stacks thru separate pointers, to allow yyoverflow
+     to reallocate them elsewhere.  */
+
+  /* The state stack.  */
+  short	yyssa[YYINITDEPTH];
+  short *yyss = yyssa;
+  register short *yyssp;
+
+  /* The semantic value stack.  */
+  YYSTYPE yyvsa[YYINITDEPTH];
+  YYSTYPE *yyvs = yyvsa;
+  register YYSTYPE *yyvsp;
+
+
+
+#define YYPOPSTACK   (yyvsp--, yyssp--)
+
+  YYSIZE_T yystacksize = YYINITDEPTH;
+
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
+
+  /* When reducing, the number of symbols on the RHS of the reduced
+     rule.  */
+  int yylen;
+
+  YYDPRINTF ((stderr, "Starting parse\n"));
+
+  yystate = 0;
+  yyerrstatus = 0;
+  yynerrs = 0;
+  yychar = YYEMPTY;		/* Cause a token to be read.  */
+
+  /* Initialize stack pointers.
+     Waste one element of value and location stack
+     so that they stay on the same level as the state stack.
+     The wasted elements are never initialized.  */
+
+  yyssp = yyss;
+  yyvsp = yyvs;
+
+  goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate.  |
+`------------------------------------------------------------*/
+ yynewstate:
+  /* In all cases, when you get here, the value and location stacks
+     have just been pushed. so pushing a state here evens the stacks.
+     */
+  yyssp++;
+
+ yysetstate:
+  *yyssp = yystate;
+
+  if (yyss + yystacksize - 1 <= yyssp)
+    {
+      /* Get the current used size of the three stacks, in elements.  */
+      YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+      {
+	/* Give user a chance to reallocate the stack. Use copies of
+	   these so that the &'s don't force the real ones into
+	   memory.  */
+	YYSTYPE *yyvs1 = yyvs;
+	short *yyss1 = yyss;
+
+
+	/* Each stack pointer address is followed by the size of the
+	   data in use in that stack, in bytes.  This used to be a
+	   conditional around just the two extra args, but that might
+	   be undefined if yyoverflow is a macro.  */
+	yyoverflow ("parser stack overflow",
+		    &yyss1, yysize * sizeof (*yyssp),
+		    &yyvs1, yysize * sizeof (*yyvsp),
+
+		    &yystacksize);
+
+	yyss = yyss1;
+	yyvs = yyvs1;
+      }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+      goto yyoverflowlab;
+# else
+      /* Extend the stack our own way.  */
+      if (YYMAXDEPTH <= yystacksize)
+	goto yyoverflowlab;
+      yystacksize *= 2;
+      if (YYMAXDEPTH < yystacksize)
+	yystacksize = YYMAXDEPTH;
+
+      {
+	short *yyss1 = yyss;
+	union yyalloc *yyptr =
+	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+	if (! yyptr)
+	  goto yyoverflowlab;
+	YYSTACK_RELOCATE (yyss);
+	YYSTACK_RELOCATE (yyvs);
+
+#  undef YYSTACK_RELOCATE
+	if (yyss1 != yyssa)
+	  YYSTACK_FREE (yyss1);
+      }
+# endif
+#endif /* no yyoverflow */
+
+      yyssp = yyss + yysize - 1;
+      yyvsp = yyvs + yysize - 1;
+
+
+      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+		  (unsigned long int) yystacksize));
+
+      if (yyss + yystacksize - 1 <= yyssp)
+	YYABORT;
+    }
+
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+  goto yybackup;
+
+/*-----------.
+| yybackup.  |
+`-----------*/
+yybackup:
+
+/* Do appropriate processing given the current state.  */
+/* Read a lookahead token if we need one and don't already have one.  */
+/* yyresume: */
+
+  /* First try to decide what to do without reference to lookahead token.  */
+
+  yyn = yypact[yystate];
+  if (yyn == YYPACT_NINF)
+    goto yydefault;
+
+  /* Not known => get a lookahead token if don't already have one.  */
+
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
+  if (yychar == YYEMPTY)
+    {
+      YYDPRINTF ((stderr, "Reading a token: "));
+      yychar = YYLEX;
+    }
+
+  if (yychar <= YYEOF)
+    {
+      yychar = yytoken = YYEOF;
+      YYDPRINTF ((stderr, "Now at end of input.\n"));
+    }
+  else
+    {
+      yytoken = YYTRANSLATE (yychar);
+      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
+    }
+
+  /* If the proper action on seeing token YYTOKEN is to reduce or to
+     detect an error, take that action.  */
+  yyn += yytoken;
+  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+    goto yydefault;
+  yyn = yytable[yyn];
+  if (yyn <= 0)
+    {
+      if (yyn == 0 || yyn == YYTABLE_NINF)
+	goto yyerrlab;
+      yyn = -yyn;
+      goto yyreduce;
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  /* Shift the lookahead token.  */
+  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
+
+  /* Discard the token being shifted unless it is eof.  */
+  if (yychar != YYEOF)
+    yychar = YYEMPTY;
+
+  *++yyvsp = yylval;
+
+
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state.  |
+`-----------------------------------------------------------*/
+yydefault:
+  yyn = yydefact[yystate];
+  if (yyn == 0)
+    goto yyerrlab;
+  goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction.  |
+`-----------------------------*/
+yyreduce:
+  /* yyn is the number of a rule to reduce with.  */
+  yylen = yyr2[yyn];
+
+  /* If YYLEN is nonzero, implement the default value of the action:
+     `$$ = $1'.
+
+     Otherwise, the following line sets YYVAL to garbage.
+     This behavior is undocumented and Bison
+     users should not rely upon it.  Assigning to YYVAL
+     unconditionally makes the parser a bit smaller, and it avoids a
+     GCC warning that YYVAL may be used uninitialized.  */
+  yyval = yyvsp[1-yylen];
+
+
+  YY_REDUCE_PRINT (yyn);
+  switch (yyn)
+    {
+        case 2:
+#line 74 "rc1.0_grammar.y"
+    {
+			yyvsp[0].combinersStruct.Validate();
+			yyvsp[0].combinersStruct.Invoke();
+		;}
+    break;
+
+  case 3:
+#line 81 "rc1.0_grammar.y"
+    {
+			CombinersStruct combinersStruct;
+			combinersStruct.Init(yyvsp[-1].generalCombinersStruct, yyvsp[0].finalCombinerStruct, yyvsp[-2].constColorStruct);
+			yyval.combinersStruct = combinersStruct;
+		;}
+    break;
+
+  case 4:
+#line 87 "rc1.0_grammar.y"
+    {
+			CombinersStruct combinersStruct;
+			combinersStruct.Init(yyvsp[-1].generalCombinersStruct, yyvsp[0].finalCombinerStruct, yyvsp[-3].constColorStruct, yyvsp[-2].constColorStruct);
+			yyval.combinersStruct = combinersStruct;
+		;}
+    break;
+
+  case 5:
+#line 93 "rc1.0_grammar.y"
+    {
+			CombinersStruct combinersStruct;
+			combinersStruct.Init(yyvsp[-1].generalCombinersStruct, yyvsp[0].finalCombinerStruct);
+			yyval.combinersStruct = combinersStruct;
+		;}
+    break;
+
+  case 6:
+#line 99 "rc1.0_grammar.y"
+    {
+			GeneralCombinersStruct generalCombinersStruct;
+			generalCombinersStruct.Init();
+			CombinersStruct combinersStruct;
+			combinersStruct.Init(generalCombinersStruct, yyvsp[0].finalCombinerStruct, yyvsp[-1].constColorStruct);
+			yyval.combinersStruct = combinersStruct;
+		;}
+    break;
+
+  case 7:
+#line 107 "rc1.0_grammar.y"
+    {
+			GeneralCombinersStruct generalCombinersStruct;
+			generalCombinersStruct.Init();
+			CombinersStruct combinersStruct;
+			combinersStruct.Init(generalCombinersStruct, yyvsp[0].finalCombinerStruct, yyvsp[-2].constColorStruct, yyvsp[-1].constColorStruct);
+			yyval.combinersStruct = combinersStruct;
+		;}
+    break;
+
+  case 8:
+#line 115 "rc1.0_grammar.y"
+    {
+			GeneralCombinersStruct generalCombinersStruct;
+			generalCombinersStruct.Init();
+			CombinersStruct combinersStruct;
+			combinersStruct.Init(generalCombinersStruct, yyvsp[0].finalCombinerStruct);
+			yyval.combinersStruct = combinersStruct;
+		;}
+    break;
+
+  case 9:
+#line 125 "rc1.0_grammar.y"
+    {
+			ConstColorStruct constColorStruct;
+			constColorStruct.Init(yyvsp[-11].registerEnum, yyvsp[-8].fval, yyvsp[-6].fval, yyvsp[-4].fval, yyvsp[-2].fval);
+			yyval.constColorStruct = constColorStruct;
+		;}
+    break;
+
+  case 10:
+#line 134 "rc1.0_grammar.y"
+    {
+			yyvsp[-1].generalCombinersStruct += yyvsp[0].generalCombinerStruct;
+			yyval.generalCombinersStruct = yyvsp[-1].generalCombinersStruct;
+		;}
+    break;
+
+  case 11:
+#line 139 "rc1.0_grammar.y"
+    {
+			GeneralCombinersStruct generalCombinersStruct;
+			generalCombinersStruct.Init(yyvsp[0].generalCombinerStruct);
+			yyval.generalCombinersStruct = generalCombinersStruct;
+		;}
+    break;
+
+  case 12:
+#line 147 "rc1.0_grammar.y"
+    {
+			GeneralCombinerStruct generalCombinerStruct;
+			generalCombinerStruct.Init(yyvsp[-2].generalPortionStruct, yyvsp[-1].generalPortionStruct);
+			yyval.generalCombinerStruct = generalCombinerStruct;
+		;}
+    break;
+
+  case 13:
+#line 153 "rc1.0_grammar.y"
+    {
+			GeneralCombinerStruct generalCombinerStruct;
+			generalCombinerStruct.Init(yyvsp[-2].generalPortionStruct, yyvsp[-1].generalPortionStruct, yyvsp[-3].constColorStruct);
+			yyval.generalCombinerStruct = generalCombinerStruct;
+		;}
+    break;
+
+  case 14:
+#line 159 "rc1.0_grammar.y"
+    {
+			GeneralCombinerStruct generalCombinerStruct;
+			generalCombinerStruct.Init(yyvsp[-2].generalPortionStruct, yyvsp[-1].generalPortionStruct, yyvsp[-4].constColorStruct, yyvsp[-3].constColorStruct);
+			yyval.generalCombinerStruct = generalCombinerStruct;
+		;}
+    break;
+
+  case 15:
+#line 165 "rc1.0_grammar.y"
+    {
+			GeneralCombinerStruct generalCombinerStruct;
+			generalCombinerStruct.Init(yyvsp[-1].generalPortionStruct);
+			yyval.generalCombinerStruct = generalCombinerStruct;
+		;}
+    break;
+
+  case 16:
+#line 171 "rc1.0_grammar.y"
+    {
+			GeneralCombinerStruct generalCombinerStruct;
+			generalCombinerStruct.Init(yyvsp[-1].generalPortionStruct, yyvsp[-2].constColorStruct);
+			yyval.generalCombinerStruct = generalCombinerStruct;
+		;}
+    break;
+
+  case 17:
+#line 177 "rc1.0_grammar.y"
+    {
+			GeneralCombinerStruct generalCombinerStruct;
+			generalCombinerStruct.Init(yyvsp[-1].generalPortionStruct, yyvsp[-3].constColorStruct, yyvsp[-2].constColorStruct);
+			yyval.generalCombinerStruct = generalCombinerStruct;
+		;}
+    break;
+
+  case 18:
+#line 185 "rc1.0_grammar.y"
+    {
+			GeneralPortionStruct generalPortionStruct;
+			generalPortionStruct.Init(yyvsp[-4].ival, yyvsp[-2].generalFunctionStruct, yyvsp[-1].biasScaleEnum);
+			yyval.generalPortionStruct = generalPortionStruct;
+		;}
+    break;
+
+  case 19:
+#line 191 "rc1.0_grammar.y"
+    {
+			BiasScaleEnum noScale;
+			noScale.word = RCP_SCALE_BY_ONE;
+			GeneralPortionStruct generalPortionStruct;
+			generalPortionStruct.Init(yyvsp[-3].ival, yyvsp[-1].generalFunctionStruct, noScale);
+			yyval.generalPortionStruct = generalPortionStruct;
+		;}
+    break;
+
+  case 20:
+#line 201 "rc1.0_grammar.y"
+    {
+			yyval.ival = yyvsp[0].ival;
+		;}
+    break;
+
+  case 21:
+#line 205 "rc1.0_grammar.y"
+    {
+			yyval.ival = yyvsp[0].ival;
+		;}
+    break;
+
+  case 22:
+#line 211 "rc1.0_grammar.y"
+    {
+			MappedRegisterStruct reg;
+			reg.Init(yyvsp[0].registerEnum, GL_SIGNED_IDENTITY_NV);
+			yyval.mappedRegisterStruct = reg;
+		;}
+    break;
+
+  case 23:
+#line 217 "rc1.0_grammar.y"
+    {
+			MappedRegisterStruct reg;
+			reg.Init(yyvsp[0].registerEnum, GL_SIGNED_NEGATE_NV);
+			yyval.mappedRegisterStruct = reg;
+		;}
+    break;
+
+  case 24:
+#line 223 "rc1.0_grammar.y"
+    {
+			MappedRegisterStruct reg;
+			reg.Init(yyvsp[-1].registerEnum, GL_EXPAND_NORMAL_NV);
+			yyval.mappedRegisterStruct = reg;
+		;}
+    break;
+
+  case 25:
+#line 229 "rc1.0_grammar.y"
+    {
+			MappedRegisterStruct reg;
+			reg.Init(yyvsp[-1].registerEnum, GL_EXPAND_NEGATE_NV);
+			yyval.mappedRegisterStruct = reg;
+		;}
+    break;
+
+  case 26:
+#line 235 "rc1.0_grammar.y"
+    {
+			MappedRegisterStruct reg;
+			reg.Init(yyvsp[-1].registerEnum, GL_HALF_BIAS_NORMAL_NV);
+			yyval.mappedRegisterStruct = reg;
+		;}
+    break;
+
+  case 27:
+#line 241 "rc1.0_grammar.y"
+    {
+			MappedRegisterStruct reg;
+			reg.Init(yyvsp[-1].registerEnum, GL_HALF_BIAS_NEGATE_NV);
+			yyval.mappedRegisterStruct = reg;
+		;}
+    break;
+
+  case 28:
+#line 247 "rc1.0_grammar.y"
+    {
+			MappedRegisterStruct reg;
+			reg.Init(yyvsp[-1].registerEnum, GL_UNSIGNED_IDENTITY_NV);
+			yyval.mappedRegisterStruct = reg;
+		;}
+    break;
+
+  case 29:
+#line 253 "rc1.0_grammar.y"
+    {
+			MappedRegisterStruct reg;
+			reg.Init(yyvsp[-1].registerEnum, GL_UNSIGNED_INVERT_NV);
+			yyval.mappedRegisterStruct = reg;
+		;}
+    break;
+
+  case 30:
+#line 261 "rc1.0_grammar.y"
+    {
+			GeneralFunctionStruct generalFunction;
+			generalFunction.Init(yyvsp[-1].opStruct, yyvsp[0].opStruct);
+			yyval.generalFunctionStruct = generalFunction;
+		;}
+    break;
+
+  case 31:
+#line 267 "rc1.0_grammar.y"
+    {
+			GeneralFunctionStruct generalFunction;
+			generalFunction.Init(yyvsp[-1].opStruct, yyvsp[0].opStruct);
+			yyval.generalFunctionStruct = generalFunction;
+		;}
+    break;
+
+  case 32:
+#line 273 "rc1.0_grammar.y"
+    {
+			GeneralFunctionStruct generalFunction;
+			generalFunction.Init(yyvsp[-1].opStruct, yyvsp[0].opStruct);
+			yyval.generalFunctionStruct = generalFunction;
+		;}
+    break;
+
+  case 33:
+#line 279 "rc1.0_grammar.y"
+    {
+			GeneralFunctionStruct generalFunction;
+			generalFunction.Init(yyvsp[0].opStruct);
+			yyval.generalFunctionStruct = generalFunction;
+		;}
+    break;
+
+  case 34:
+#line 285 "rc1.0_grammar.y"
+    {
+			GeneralFunctionStruct generalFunction;
+			generalFunction.Init(yyvsp[-1].opStruct, yyvsp[0].opStruct);
+			yyval.generalFunctionStruct = generalFunction;
+		;}
+    break;
+
+  case 35:
+#line 291 "rc1.0_grammar.y"
+    {
+			GeneralFunctionStruct generalFunction;
+			generalFunction.Init(yyvsp[-2].opStruct, yyvsp[-1].opStruct, yyvsp[0].opStruct);
+			yyval.generalFunctionStruct = generalFunction;
+		;}
+    break;
+
+  case 36:
+#line 297 "rc1.0_grammar.y"
+    {
+			GeneralFunctionStruct generalFunction;
+			generalFunction.Init(yyvsp[-2].opStruct, yyvsp[-1].opStruct, yyvsp[0].opStruct);
+			yyval.generalFunctionStruct = generalFunction;
+		;}
+    break;
+
+  case 37:
+#line 303 "rc1.0_grammar.y"
+    {
+			GeneralFunctionStruct generalFunction;
+			generalFunction.Init(yyvsp[0].opStruct);
+			yyval.generalFunctionStruct = generalFunction;
+		;}
+    break;
+
+  case 38:
+#line 311 "rc1.0_grammar.y"
+    {
+			OpStruct dotFunction;
+			dotFunction.Init(RCP_DOT, yyvsp[-5].registerEnum, yyvsp[-3].mappedRegisterStruct, yyvsp[-1].mappedRegisterStruct);
+			yyval.opStruct = dotFunction;
+		;}
+    break;
+
+  case 39:
+#line 319 "rc1.0_grammar.y"
+    {
+			OpStruct mulFunction;
+			mulFunction.Init(RCP_MUL, yyvsp[-5].registerEnum, yyvsp[-3].mappedRegisterStruct, yyvsp[-1].mappedRegisterStruct);
+			yyval.opStruct = mulFunction;
+		;}
+    break;
+
+  case 40:
+#line 325 "rc1.0_grammar.y"
+    {
+			RegisterEnum zero;
+			zero.word = RCP_ZERO;
+			MappedRegisterStruct one;
+			one.Init(zero, GL_UNSIGNED_INVERT_NV);
+			OpStruct mulFunction;
+			mulFunction.Init(RCP_MUL, yyvsp[-3].registerEnum, yyvsp[-1].mappedRegisterStruct, one);
+			yyval.opStruct = mulFunction;
+		;}
+    break;
+
+  case 41:
+#line 337 "rc1.0_grammar.y"
+    {
+			OpStruct muxFunction;
+			muxFunction.Init(RCP_MUX, yyvsp[-5].registerEnum);
+			yyval.opStruct = muxFunction;
+		;}
+    break;
+
+  case 42:
+#line 345 "rc1.0_grammar.y"
+    {
+			OpStruct sumFunction;
+			sumFunction.Init(RCP_SUM, yyvsp[-5].registerEnum);
+			yyval.opStruct = sumFunction;
+		;}
+    break;
+
+  case 43:
+#line 353 "rc1.0_grammar.y"
+    {
+			yyval.biasScaleEnum = yyvsp[-3].biasScaleEnum;
+		;}
+    break;
+
+  case 44:
+#line 357 "rc1.0_grammar.y"
+    {
+			yyval.biasScaleEnum = yyvsp[-3].biasScaleEnum;
+		;}
+    break;
+
+  case 45:
+#line 361 "rc1.0_grammar.y"
+    {
+			yyval.biasScaleEnum = yyvsp[-3].biasScaleEnum;
+		;}
+    break;
+
+  case 46:
+#line 365 "rc1.0_grammar.y"
+    {
+			yyval.biasScaleEnum = yyvsp[-3].biasScaleEnum;
+		;}
+    break;
+
+  case 47:
+#line 369 "rc1.0_grammar.y"
+    {
+			yyval.biasScaleEnum = yyvsp[-3].biasScaleEnum;
+		;}
+    break;
+
+  case 48:
+#line 375 "rc1.0_grammar.y"
+    {
+			MappedRegisterStruct reg;
+			reg.Init(yyvsp[0].registerEnum, GL_UNSIGNED_IDENTITY_NV);
+			yyval.mappedRegisterStruct = reg;
+		;}
+    break;
+
+  case 49:
+#line 381 "rc1.0_grammar.y"
+    {
+			MappedRegisterStruct reg;
+			reg.Init(yyvsp[-1].registerEnum, GL_UNSIGNED_IDENTITY_NV);
+			yyval.mappedRegisterStruct = reg;
+		;}
+    break;
+
+  case 50:
+#line 387 "rc1.0_grammar.y"
+    {
+			MappedRegisterStruct reg;
+			reg.Init(yyvsp[-1].registerEnum, GL_UNSIGNED_INVERT_NV);
+			yyval.mappedRegisterStruct = reg;
+		;}
+    break;
+
+  case 51:
+#line 393 "rc1.0_grammar.y"
+    {
+			MappedRegisterStruct reg;
+			reg.Init(yyvsp[0].registerEnum);
+			yyval.mappedRegisterStruct = reg;
+		;}
+    break;
+
+  case 52:
+#line 399 "rc1.0_grammar.y"
+    {
+			MappedRegisterStruct reg;
+			reg.Init(yyvsp[-1].registerEnum, GL_UNSIGNED_IDENTITY_NV);
+			yyval.mappedRegisterStruct = reg;
+		;}
+    break;
+
+  case 53:
+#line 405 "rc1.0_grammar.y"
+    {
+			MappedRegisterStruct reg;
+			reg.Init(yyvsp[-1].registerEnum, GL_UNSIGNED_INVERT_NV);
+			yyval.mappedRegisterStruct = reg;
+		;}
+    break;
+
+  case 54:
+#line 411 "rc1.0_grammar.y"
+    {
+			MappedRegisterStruct reg;
+			reg.Init(yyvsp[0].registerEnum);
+			yyval.mappedRegisterStruct = reg;
+		;}
+    break;
+
+  case 55:
+#line 417 "rc1.0_grammar.y"
+    {
+			MappedRegisterStruct reg;
+			reg.Init(yyvsp[-1].registerEnum, GL_UNSIGNED_IDENTITY_NV);
+			yyval.mappedRegisterStruct = reg;
+		;}
+    break;
+
+  case 56:
+#line 423 "rc1.0_grammar.y"
+    {
+			MappedRegisterStruct reg;
+			reg.Init(yyvsp[-1].registerEnum, GL_UNSIGNED_INVERT_NV);
+			yyval.mappedRegisterStruct = reg;
+		;}
+    break;
+
+  case 57:
+#line 431 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init(yyvsp[0].finalRgbFunctionStruct, yyvsp[-1].finalAlphaFunctionStruct, false);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 58:
+#line 437 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init(yyvsp[0].finalRgbFunctionStruct, yyvsp[-1].finalAlphaFunctionStruct, true);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 59:
+#line 443 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init(yyvsp[0].finalRgbFunctionStruct, yyvsp[-1].finalAlphaFunctionStruct, false, yyvsp[-2].finalProductStruct);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 60:
+#line 449 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init(yyvsp[0].finalRgbFunctionStruct, yyvsp[-1].finalAlphaFunctionStruct, true, yyvsp[-2].finalProductStruct);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 61:
+#line 455 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init(yyvsp[0].finalRgbFunctionStruct, yyvsp[-1].finalAlphaFunctionStruct, true, yyvsp[-3].finalProductStruct);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 62:
+#line 462 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init(yyvsp[-1].finalRgbFunctionStruct, yyvsp[0].finalAlphaFunctionStruct, false);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 63:
+#line 468 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init(yyvsp[-1].finalRgbFunctionStruct, yyvsp[0].finalAlphaFunctionStruct, true);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 64:
+#line 474 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init(yyvsp[-1].finalRgbFunctionStruct, yyvsp[0].finalAlphaFunctionStruct, false, yyvsp[-2].finalProductStruct);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 65:
+#line 480 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init(yyvsp[-1].finalRgbFunctionStruct, yyvsp[0].finalAlphaFunctionStruct, true, yyvsp[-2].finalProductStruct);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 66:
+#line 486 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init(yyvsp[-1].finalRgbFunctionStruct, yyvsp[0].finalAlphaFunctionStruct, true, yyvsp[-3].finalProductStruct);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 67:
+#line 493 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			FinalAlphaFunctionStruct finalAlphaFunctionStruct;
+			finalAlphaFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init(yyvsp[0].finalRgbFunctionStruct, finalAlphaFunctionStruct, false);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 68:
+#line 501 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			FinalAlphaFunctionStruct finalAlphaFunctionStruct;
+			finalAlphaFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init(yyvsp[0].finalRgbFunctionStruct, finalAlphaFunctionStruct, true);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 69:
+#line 509 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			FinalAlphaFunctionStruct finalAlphaFunctionStruct;
+			finalAlphaFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init(yyvsp[0].finalRgbFunctionStruct, finalAlphaFunctionStruct, false, yyvsp[-1].finalProductStruct);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 70:
+#line 517 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			FinalAlphaFunctionStruct finalAlphaFunctionStruct;
+			finalAlphaFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init(yyvsp[0].finalRgbFunctionStruct, finalAlphaFunctionStruct, true, yyvsp[-1].finalProductStruct);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 71:
+#line 525 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			FinalAlphaFunctionStruct finalAlphaFunctionStruct;
+			finalAlphaFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init(yyvsp[0].finalRgbFunctionStruct, finalAlphaFunctionStruct, true, yyvsp[-2].finalProductStruct);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 72:
+#line 534 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init(finalRgbFunctionStruct, yyvsp[0].finalAlphaFunctionStruct, false);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 73:
+#line 542 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init(finalRgbFunctionStruct, yyvsp[0].finalAlphaFunctionStruct, true);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 74:
+#line 550 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init(finalRgbFunctionStruct, yyvsp[0].finalAlphaFunctionStruct, false, yyvsp[-1].finalProductStruct);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 75:
+#line 558 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init(finalRgbFunctionStruct, yyvsp[0].finalAlphaFunctionStruct, true, yyvsp[-1].finalProductStruct);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 76:
+#line 566 "rc1.0_grammar.y"
+    {
+			FinalCombinerStruct finalCombinerStruct;
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init(finalRgbFunctionStruct, yyvsp[0].finalAlphaFunctionStruct, true, yyvsp[-2].finalProductStruct);
+			yyval.finalCombinerStruct = finalCombinerStruct;
+		;}
+    break;
+
+  case 77:
+#line 576 "rc1.0_grammar.y"
+    {
+			yyval.ival = yyvsp[-3].ival;
+		;}
+    break;
+
+  case 78:
+#line 582 "rc1.0_grammar.y"
+    {
+			FinalProductStruct finalProductStruct;
+			finalProductStruct.Init(yyvsp[-3].mappedRegisterStruct, yyvsp[-1].mappedRegisterStruct);
+			yyval.finalProductStruct = finalProductStruct;
+		;}
+    break;
+
+  case 79:
+#line 590 "rc1.0_grammar.y"
+    {
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.Init(yyvsp[-8].mappedRegisterStruct, yyvsp[-6].mappedRegisterStruct, yyvsp[-4].mappedRegisterStruct, yyvsp[-1].mappedRegisterStruct);
+			yyval.finalRgbFunctionStruct = finalRgbFunctionStruct;
+		;}
+    break;
+
+  case 80:
+#line 596 "rc1.0_grammar.y"
+    {
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.Init(yyvsp[-6].mappedRegisterStruct, yyvsp[-4].mappedRegisterStruct, yyvsp[-2].mappedRegisterStruct, yyvsp[-10].mappedRegisterStruct);
+			yyval.finalRgbFunctionStruct = finalRgbFunctionStruct;
+		;}
+    break;
+
+  case 81:
+#line 602 "rc1.0_grammar.y"
+    {
+			RegisterEnum zero;
+			zero.word = RCP_ZERO;
+			MappedRegisterStruct reg;
+			reg.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.Init(yyvsp[-6].mappedRegisterStruct, yyvsp[-4].mappedRegisterStruct, yyvsp[-2].mappedRegisterStruct, reg);
+			yyval.finalRgbFunctionStruct = finalRgbFunctionStruct;
+		;}
+    break;
+
+  case 82:
+#line 612 "rc1.0_grammar.y"
+    {
+			RegisterEnum zero;
+			zero.word = RCP_ZERO;
+			MappedRegisterStruct reg1;
+			reg1.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+			MappedRegisterStruct reg2;
+			reg2.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.Init(yyvsp[-3].mappedRegisterStruct, yyvsp[-1].mappedRegisterStruct, reg1, reg2);
+			yyval.finalRgbFunctionStruct = finalRgbFunctionStruct;
+		;}
+    break;
+
+  case 83:
+#line 624 "rc1.0_grammar.y"
+    {
+			RegisterEnum zero;
+			zero.word = RCP_ZERO;
+			MappedRegisterStruct reg1;
+			reg1.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.Init(yyvsp[-5].mappedRegisterStruct, yyvsp[-3].mappedRegisterStruct, reg1, yyvsp[-1].mappedRegisterStruct);
+			yyval.finalRgbFunctionStruct = finalRgbFunctionStruct;
+		;}
+    break;
+
+  case 84:
+#line 634 "rc1.0_grammar.y"
+    {
+			RegisterEnum zero;
+			zero.word = RCP_ZERO;
+			MappedRegisterStruct reg1;
+			reg1.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+			MappedRegisterStruct reg2;
+			reg2.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+			MappedRegisterStruct reg3;
+			reg3.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.Init(reg1, reg2, reg3, yyvsp[-1].mappedRegisterStruct);
+			yyval.finalRgbFunctionStruct = finalRgbFunctionStruct;
+		;}
+    break;
+
+  case 85:
+#line 648 "rc1.0_grammar.y"
+    {
+			RegisterEnum zero;
+			zero.word = RCP_ZERO;
+			MappedRegisterStruct reg2;
+			reg2.Init(zero, GL_UNSIGNED_INVERT_NV);
+			MappedRegisterStruct reg3;
+			reg3.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.Init(yyvsp[-3].mappedRegisterStruct, reg2, reg3, yyvsp[-1].mappedRegisterStruct);
+			yyval.finalRgbFunctionStruct = finalRgbFunctionStruct;
+		;}
+    break;
+
+  case 86:
+#line 662 "rc1.0_grammar.y"
+    {
+			FinalAlphaFunctionStruct finalAlphaFunctionStruct;
+			finalAlphaFunctionStruct.Init(yyvsp[-1].mappedRegisterStruct);
+			yyval.finalAlphaFunctionStruct = finalAlphaFunctionStruct;
+		;}
+    break;
+
+  case 87:
+#line 670 "rc1.0_grammar.y"
+    {
+			yyval.registerEnum = yyvsp[0].registerEnum;
+		;}
+    break;
+
+  case 88:
+#line 674 "rc1.0_grammar.y"
+    {
+			yyval.registerEnum = yyvsp[0].registerEnum;
+		;}
+    break;
+
+
+    }
+
+/* Line 999 of yacc.c.  */
+#line 2093 "_rc1.0_parser.c"
+
+
+  yyvsp -= yylen;
+  yyssp -= yylen;
+
+
+  YY_STACK_PRINT (yyss, yyssp);
+
+  *++yyvsp = yyval;
+
+
+  /* Now `shift' the result of the reduction.  Determine what state
+     that goes to, based on the state we popped back to and the rule
+     number reduced by.  */
+
+  yyn = yyr1[yyn];
+
+  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+    yystate = yytable[yystate];
+  else
+    yystate = yydefgoto[yyn - YYNTOKENS];
+
+  goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
+    {
+      ++yynerrs;
+#if YYERROR_VERBOSE
+      yyn = yypact[yystate];
+
+      if (YYPACT_NINF < yyn && yyn < YYLAST)
+	{
+	  YYSIZE_T yysize = 0;
+	  int yytype = YYTRANSLATE (yychar);
+	  char *yymsg;
+	  int yyx, yycount;
+
+	  yycount = 0;
+	  /* Start YYX at -YYN if negative to avoid negative indexes in
+	     YYCHECK.  */
+	  for (yyx = yyn < 0 ? -yyn : 0;
+	       yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
+	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+	      yysize += yystrlen (yytname[yyx]) + 15, yycount++;
+	  yysize += yystrlen ("syntax error, unexpected ") + 1;
+	  yysize += yystrlen (yytname[yytype]);
+	  yymsg = (char *) YYSTACK_ALLOC (yysize);
+	  if (yymsg != 0)
+	    {
+	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
+	      yyp = yystpcpy (yyp, yytname[yytype]);
+
+	      if (yycount < 5)
+		{
+		  yycount = 0;
+		  for (yyx = yyn < 0 ? -yyn : 0;
+		       yyx < (int) (sizeof (yytname) / sizeof (char *));
+		       yyx++)
+		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+		      {
+			const char *yyq = ! yycount ? ", expecting " : " or ";
+			yyp = yystpcpy (yyp, yyq);
+			yyp = yystpcpy (yyp, yytname[yyx]);
+			yycount++;
+		      }
+		}
+	      yyerror (yymsg);
+	      YYSTACK_FREE (yymsg);
+	    }
+	  else
+	    yyerror ("syntax error; also virtual memory exhausted");
+	}
+      else
+#endif /* YYERROR_VERBOSE */
+	yyerror ("syntax error");
+    }
+
+
+
+  if (yyerrstatus == 3)
+    {
+      /* If just tried and failed to reuse lookahead token after an
+	 error, discard it.  */
+
+      /* Return failure if at end of input.  */
+      if (yychar == YYEOF)
+        {
+	  /* Pop the error token.  */
+          YYPOPSTACK;
+	  /* Pop the rest of the stack.  */
+	  while (yyss < yyssp)
+	    {
+	      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+	      yydestruct (yystos[*yyssp], yyvsp);
+	      YYPOPSTACK;
+	    }
+	  YYABORT;
+        }
+
+      YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
+      yydestruct (yytoken, &yylval);
+      yychar = YYEMPTY;
+
+    }
+
+  /* Else will try to reuse lookahead token after shifting the error
+     token.  */
+  goto yyerrlab1;
+
+
+/*----------------------------------------------------.
+| yyerrlab1 -- error raised explicitly by an action.  |
+`----------------------------------------------------*/
+yyerrlab1:
+  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
+
+  for (;;)
+    {
+      yyn = yypact[yystate];
+      if (yyn != YYPACT_NINF)
+	{
+	  yyn += YYTERROR;
+	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+	    {
+	      yyn = yytable[yyn];
+	      if (0 < yyn)
+		break;
+	    }
+	}
+
+      /* Pop the current state because it cannot handle the error token.  */
+      if (yyssp == yyss)
+	YYABORT;
+
+      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+      yydestruct (yystos[yystate], yyvsp);
+      yyvsp--;
+      yystate = *--yyssp;
+
+      YY_STACK_PRINT (yyss, yyssp);
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  YYDPRINTF ((stderr, "Shifting error token, "));
+
+  *++yyvsp = yylval;
+
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here.  |
+`-------------------------------------*/
+yyacceptlab:
+  yyresult = 0;
+  goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here.  |
+`-----------------------------------*/
+yyabortlab:
+  yyresult = 1;
+  goto yyreturn;
+
+#ifndef yyoverflow
+/*----------------------------------------------.
+| yyoverflowlab -- parser overflow comes here.  |
+`----------------------------------------------*/
+yyoverflowlab:
+  yyerror ("parser stack overflow");
+  yyresult = 2;
+  /* Fall through.  */
+#endif
+
+yyreturn:
+#ifndef yyoverflow
+  if (yyss != yyssa)
+    YYSTACK_FREE (yyss);
+#endif
+  return yyresult;
+}
+
+
+#line 679 "rc1.0_grammar.y"
+
+void yyerror(char* s)
+{
+     errors.set("unrecognized token");
+}
+
Index: /RenderSystems/GL/src/nvparse/_rc1.0_parser.h
===================================================================
--- /RenderSystems/GL/src/nvparse/_rc1.0_parser.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/_rc1.0_parser.h	(revision 5)
@@ -0,0 +1,162 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/* A Bison parser, made by GNU Bison 1.875.  */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     regVariable = 258,
+     constVariable = 259,
+     color_sum = 260,
+     final_product = 261,
+     expandString = 262,
+     halfBiasString = 263,
+     unsignedString = 264,
+     unsignedInvertString = 265,
+     muxString = 266,
+     sumString = 267,
+     rgb_portion = 268,
+     alpha_portion = 269,
+     openParen = 270,
+     closeParen = 271,
+     openBracket = 272,
+     closeBracket = 273,
+     semicolon = 274,
+     comma = 275,
+     dot = 276,
+     times = 277,
+     minus = 278,
+     equals = 279,
+     plus = 280,
+     bias_by_negative_one_half_scale_by_two = 281,
+     bias_by_negative_one_half = 282,
+     scale_by_one_half = 283,
+     scale_by_two = 284,
+     scale_by_four = 285,
+     clamp_color_sum = 286,
+     lerp = 287,
+     fragment_rgb = 288,
+     fragment_alpha = 289,
+     floatValue = 290
+   };
+#endif
+#define regVariable 258
+#define constVariable 259
+#define color_sum 260
+#define final_product 261
+#define expandString 262
+#define halfBiasString 263
+#define unsignedString 264
+#define unsignedInvertString 265
+#define muxString 266
+#define sumString 267
+#define rgb_portion 268
+#define alpha_portion 269
+#define openParen 270
+#define closeParen 271
+#define openBracket 272
+#define closeBracket 273
+#define semicolon 274
+#define comma 275
+#define dot 276
+#define times 277
+#define minus 278
+#define equals 279
+#define plus 280
+#define bias_by_negative_one_half_scale_by_two 281
+#define bias_by_negative_one_half 282
+#define scale_by_one_half 283
+#define scale_by_two 284
+#define scale_by_four 285
+#define clamp_color_sum 286
+#define lerp 287
+#define fragment_rgb 288
+#define fragment_alpha 289
+#define floatValue 290
+
+
+
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#line 20 "rc1.0_grammar.y"
+typedef union YYSTYPE {
+  int ival;
+  float fval;
+  RegisterEnum registerEnum;
+  BiasScaleEnum biasScaleEnum;
+  MappedRegisterStruct mappedRegisterStruct;
+  ConstColorStruct constColorStruct;
+  GeneralPortionStruct generalPortionStruct;
+  GeneralFunctionStruct generalFunctionStruct;
+  OpStruct opStruct;
+  GeneralCombinerStruct generalCombinerStruct;
+  GeneralCombinersStruct generalCombinersStruct;
+  FinalProductStruct finalProductStruct;
+  FinalRgbFunctionStruct finalRgbFunctionStruct;
+  FinalAlphaFunctionStruct finalAlphaFunctionStruct;
+  FinalCombinerStruct finalCombinerStruct;
+  CombinersStruct combinersStruct;
+} YYSTYPE;
+/* Line 1240 of yacc.c.  */
+#line 125 "_rc1.0_parser.h"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+extern YYSTYPE rc10_lval;
+
+
+
Index: /RenderSystems/GL/src/nvparse/_ts1.0_lexer.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/_ts1.0_lexer.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/_ts1.0_lexer.cpp	(revision 5)
@@ -0,0 +1,2219 @@
+#define yy_create_buffer ts10__create_buffer
+#define yy_delete_buffer ts10__delete_buffer
+#define yy_scan_buffer ts10__scan_buffer
+#define yy_scan_string ts10__scan_string
+#define yy_scan_bytes ts10__scan_bytes
+#define yy_flex_debug ts10__flex_debug
+#define yy_init_buffer ts10__init_buffer
+#define yy_flush_buffer ts10__flush_buffer
+#define yy_load_buffer_state ts10__load_buffer_state
+#define yy_switch_to_buffer ts10__switch_to_buffer
+#define yyin ts10_in
+#define yyleng ts10_leng
+#define yylex ts10_lex
+#define yyout ts10_out
+#define yyrestart ts10_restart
+#define yytext ts10_text
+#define yywrap ts10_wrap
+
+#line 20 "_ts1.0_lexer.cpp"
+/* A lexical scanner generated by flex */
+
+/* Scanner skeleton version:
+ * $Header: /cvsroot/ogre/ogrenew/RenderSystems/GL/src/nvparse/_ts1.0_lexer.cpp,v 1.5 2005/07/08 16:51:23 miathan6 Exp $
+ */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+
+#include <stdio.h>
+#include <unistd.h>
+
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+#include <stdlib.h>
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else	/* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_PROTOS
+#define YY_USE_CONST
+
+#endif	/* __STDC__ */
+#endif	/* ! __cplusplus */
+
+#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include <io.h>
+#include <stdlib.h>
+#define YY_USE_CONST
+#define YY_USE_PROTOS
+#endif
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index.  If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition.  This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.  The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#define YY_BUF_SIZE 16384
+
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+extern int yyleng;
+extern FILE *yyin, *yyout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+/* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator).  This
+ * avoids problems with code like:
+ *
+ * 	if ( condition_holds )
+ *		yyless( 5 );
+ *	else
+ *		do_something_else();
+ *
+ * Prior to using the do-while the compiler would get upset at the
+ * "else" because it interpreted the "if" statement as being all
+ * done when it reached the ';' after the yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+		*yy_cp = yy_hold_char; \
+		YY_RESTORE_YY_MORE_OFFSET \
+		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+		} \
+	while ( 0 )
+
+#define unput(c) yyunput( c, yytext_ptr )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+typedef unsigned int yy_size_t;
+
+
+struct yy_buffer_state
+	{
+	FILE *yy_input_file;
+
+	char *yy_ch_buf;		/* input buffer */
+	char *yy_buf_pos;		/* current position in input buffer */
+
+	/* Size of input buffer in bytes, not including room for EOB
+	 * characters.
+	 */
+	yy_size_t yy_buf_size;
+
+	/* Number of characters read into yy_ch_buf, not including EOB
+	 * characters.
+	 */
+	int yy_n_chars;
+
+	/* Whether we "own" the buffer - i.e., we know we created it,
+	 * and can realloc() it to grow it, and should free() it to
+	 * delete it.
+	 */
+	int yy_is_our_buffer;
+
+	/* Whether this is an "interactive" input source; if so, and
+	 * if we're using stdio for input, then we want to use getc()
+	 * instead of fread(), to make sure we stop fetching input after
+	 * each newline.
+	 */
+	int yy_is_interactive;
+
+	/* Whether we're considered to be at the beginning of a line.
+	 * If so, '^' rules will be active on the next match, otherwise
+	 * not.
+	 */
+	int yy_at_bol;
+
+	/* Whether to try to fill the input buffer when we reach the
+	 * end of it.
+	 */
+	int yy_fill_buffer;
+
+	int yy_buffer_status;
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+	/* When an EOF's been seen but there's still some text to process
+	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+	 * shouldn't try reading from the input source any more.  We might
+	 * still have a bunch of tokens to match, though, because of
+	 * possible backing-up.
+	 *
+	 * When we actually see the EOF, we change the status to "new"
+	 * (via yyrestart()), so that the user can continue scanning by
+	 * just pointing yyin at a new input file.
+	 */
+#define YY_BUFFER_EOF_PENDING 2
+	};
+
+static YY_BUFFER_STATE yy_current_buffer = 0;
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ */
+#define YY_CURRENT_BUFFER yy_current_buffer
+
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+
+static int yy_n_chars;		/* number of characters read into yy_ch_buf */
+
+
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1;		/* whether we need to initialize */
+static int yy_start = 0;	/* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin.  A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart YY_PROTO(( FILE *input_file ));
+
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+void yy_load_buffer_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+static void yy_flex_free YY_PROTO(( void * ));
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+	{ \
+	if ( ! yy_current_buffer ) \
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+	yy_current_buffer->yy_is_interactive = is_interactive; \
+	}
+
+#define yy_set_bol(at_bol) \
+	{ \
+	if ( ! yy_current_buffer ) \
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+	yy_current_buffer->yy_at_bol = at_bol; \
+	}
+
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+typedef unsigned char YY_CHAR;
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+typedef int yy_state_type;
+extern char *yytext;
+#define yytext_ptr yytext
+
+static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+static int yy_get_next_buffer YY_PROTO(( void ));
+static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+	yytext_ptr = yy_bp; \
+	yyleng = (int) (yy_cp - yy_bp); \
+	yy_hold_char = *yy_cp; \
+	*yy_cp = '\0'; \
+	yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 59
+#define YY_END_OF_BUFFER 60
+static yyconst short int yy_accept[404] =
+    {   0,
+        0,    0,   60,   59,   57,   56,   59,   59,    3,    4,
+        5,   59,    7,   59,   59,   55,    6,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   57,   56,    0,
+        0,    0,   55,   54,    1,    2,   53,   55,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,    0,
+       53,   58,   58,   58,   58,   58,   58,   15,   58,   58,
+       58,    0,   58,   58,   58,   58,   58,   58,   58,   58,
+        9,   10,   11,   58,    0,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,    0,   58,   58,   58,   58,   58,
+       12,   58,   58,   58,    8,   58,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   24,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   16,   17,   19,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   27,   28,   58,   58,   58,   22,   58,   58,
+       58,   58,   21,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   13,   14,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   23,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+
+       58,   58,   26,   20,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   18,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   29,   30,   35,   36,
+       37,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   25,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       38,   39,   40,   58,   58,   58,   58,   58,   58,   58,
+       31,   32,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   33,   34,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   44,   45,   46,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   41,
+       42,   43,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       50,   51,   52,   58,   58,   58,   58,   58,   58,   47,
+
+       48,   49,    0
+    } ;
+
+static yyconst int yy_ec[256] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
+        1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2,    5,    1,    6,    1,    1,    1,    1,    7,
+        8,    9,   10,   11,   10,   12,   13,   14,   15,   16,
+       17,   18,   18,   18,   18,   18,   18,    1,   19,    1,
+        1,    1,    1,    1,   20,   21,   21,   21,   22,   21,
+       23,   24,   21,   21,   21,   25,   21,   26,   27,   21,
+       28,   29,   30,   31,   32,   21,   21,   21,   21,   33,
+        1,    1,    1,    1,   34,    1,   35,   36,   37,   38,
+
+       39,   40,   41,   42,   21,   21,   21,   43,   44,   45,
+       46,   47,   48,   49,   50,   51,   52,   21,   21,   53,
+       54,   21,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1
+    } ;
+
+static yyconst int yy_meta[55] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2,    1,    2,    2,    2,    2,    2,    1,    2,
+        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
+        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
+        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
+        2,    2,    2,    2
+    } ;
+
+static yyconst short int yy_base[405] =
+    {   0,
+        0,    0,  844,  845,  841,  845,   52,  837,  845,  845,
+      845,   45,  845,   50,   60,   60,  845,  829,   58,   59,
+       46,   67,   70,   71,   72,   73,   75,  838,  845,   85,
+      808,   76,   85,  104,  845,  845,  110,  117,  826,   83,
+       74,   93,   95,   97,   98,  103,  104,  118,   84,  807,
+      137,  126,  127,  128,  131,  129,  134,  824,  135,  137,
+      150,  820,  147,  144,  148,  149,  160,  161,  163,  162,
+      822,  821,  820,  164,  819,  165,  167,  168,  171,  169,
+      172,  174,  176,  177,  816,  179,  180,  181,  183,  185,
+      817,  187,  191,  193,  845,  188,  200,  199,  202,  203,
+
+      212,  205,  211,  217,  223,  224,  225,  226,  228,  230,
+      227,  240,  234,  236,  231,  238,  246,  247,  248,  239,
+      241,  250,  252,  251,  255,  259,  262,  268,  270,  272,
+      274,  275,  281,  816,  815,  814,  284,  288,  286,  287,
+      285,  289,  292,  298,  290,  294,  300,  301,  302,  304,
+      305,  303,  813,  812,  319,  306,  307,  811,  309,  325,
+      332,  334,  810,  327,  333,  335,  336,  337,  338,  339,
+      346,  343,  809,  808,  350,  351,  355,  352,  357,  354,
+      358,  360,  361,  362,  388,  367,  370,  371,  374,  807,
+      377,  380,  386,  384,  395,  396,  397,  398,  399,  403,
+
+      400,  401,  402,  806,  407,  408,  411,  412,  413,  414,
+      406,  422,  416,  420,  419,  805,  443,  446,  448,  451,
+      454,  435,  425,  426,  427,  452,  804,  803,  802,  801,
+      800,  437,  460,  461,  463,  465,  464,  467,  468,  469,
+      470,  475,  473,  471,  474,  476,  481,  482,  483,  489,
+      484,  496,  497,  799,  490,  491,  505,  506,  509,  508,
+      510,  511,  520,  523,  524,  513,  512,  526,  527,  530,
+      798,  797,  796,  531,  536,  537,  543,  540,  546,  545,
+      795,  793,  551,  550,  553,  556,  557,  560,  561,  565,
+      559,  567,  562,  571,  570,  563,  791,  790,  564,  569,
+
+      576,  577,  579,  580,  582,  583,  584,  585,  586,  596,
+      599,  600,  601,  603,  604,  607,  608,  612,  613,  616,
+      617,  619,  618,  622,  623,  628,  626,  627,  629,  641,
+      642,  645,  647,  649,  652,  653,  656,  657,  665,  666,
+      668,  654,  655,  672,  674,  648,  789,  788,  787,  679,
+      683,  685,  686,  678,  687,  691,  693,  694,  695,  786,
+      785,  784,  697,  699,  700,  701,  702,  703,  704,  709,
+      712,  718,  720,  714,  721,  710,  715,  723,  728,  730,
+      716,  731,  733,  751,  753,  760,  763,  735,  743,  745,
+      783,  782,  781,  747,  764,  766,  767,  771,  773,  780,
+
+      774,  770,  845,  744
+    } ;
+
+static yyconst short int yy_def[405] =
+    {   0,
+      403,    1,  403,  403,  403,  403,  403,  403,  403,  403,
+      403,  403,  403,  403,  403,  404,  403,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  403,  403,  403,
+      403,  403,  403,  403,  403,  403,  403,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  403,
+      403,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  403,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  403,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  403,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  403,  404,  404,  404,  404,  404,
+
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
+
+      404,  404,    0,  403
+    } ;
+
+static yyconst short int yy_nxt[900] =
+    {   0,
+        4,    5,    6,    7,    8,    9,   10,   11,    4,   12,
+       13,   14,   15,   16,   16,   16,   16,   16,   17,   18,
+       18,   18,   19,   18,   20,   18,   18,   18,   18,   18,
+       18,   18,   18,   18,   18,   18,   21,   22,   23,   18,
+       18,   18,   18,   18,   24,   25,   26,   18,   18,   18,
+       27,   18,   18,   18,   29,   30,   32,  403,   33,   33,
+       33,   33,   33,   34,   34,   34,   34,   34,   35,  403,
+      403,   37,   36,   38,   38,   38,   38,   38,  403,   40,
+       41,  403,  403,  403,  403,  403,  403,   29,   30,   34,
+       34,   34,   34,   34,  403,  403,   37,   42,   33,   33,
+
+       33,   33,   33,   53,  403,   43,  403,   48,  403,  403,
+       52,   47,   44,   49,  403,  403,   46,   34,   34,   34,
+       34,   34,   45,   51,   51,   51,   51,   51,   37,  403,
+       38,   38,   38,   38,   38,   54,   61,  403,  403,  403,
+      403,   55,  403,   59,   57,  403,  403,   56,  403,   58,
+       51,   51,   51,   51,   51,  403,   64,   63,  403,  403,
+      403,  403,   67,   71,   72,   73,   76,   60,   68,   66,
+       65,  403,  403,  403,  403,  403,  403,   77,  403,  403,
+      403,   78,  403,  403,   69,  403,   70,  403,  403,   86,
+      403,  403,  403,   79,  403,   83,  403,   87,  403,  403,
+
+       74,   82,  403,   97,  403,   81,   80,   88,   89,   91,
+      403,  403,   96,  403,  403,   84,  403,   90,  104,  105,
+      101,   99,  403,  403,   92,   94,   93,  109,  403,   98,
+      100,  103,  102,  106,  403,  403,  403,  403,  403,  403,
+      108,  403,  403,  113,  112,  403,  107,  403,  114,  403,
+      403,  403,  403,  111,  121,  122,  123,  403,  403,  403,
+      110,  403,  403,  403,  115,  118,  403,  126,  119,  127,
+      403,  129,  120,  403,  128,  116,  124,  117,  134,  403,
+      131,  403,  130,  403,  132,  403,  403,  135,  125,  136,
+      133,  139,  403,  138,  140,  403,  403,  403,  403,  403,
+
+      403,  403,  137,  403,  142,  403,  141,  150,  151,  403,
+      143,  403,  403,  403,  403,  403,  403,  403,  403,  148,
+      403,  147,  144,  145,  149,  146,  156,  154,  157,  152,
+      403,  155,  161,  162,  164,  165,  403,  153,  403,  159,
+      169,  158,  171,  403,  403,  403,  403,  403,  403,  403,
+      403,  170,  160,  163,  403,  166,  167,  403,  173,  172,
+      174,  403,  403,  403,  175,  403,  403,  168,  403,  403,
+      176,  403,  403,  403,  178,  179,  194,  195,  403,  181,
+      180,  403,  403,  184,  185,  403,  177,  183,  403,  182,
+      186,  403,  190,  188,  192,  403,  189,  403,  187,  403,
+
+      191,  193,  196,  197,  198,  199,  403,  403,  403,  403,
+      403,  403,  403,  403,  403,  203,  202,  403,  403,  403,
+      200,  201,  403,  403,  403,  403,  204,  403,  205,  206,
+      403,  403,  211,  403,  213,  215,  403,  403,  403,  214,
+      207,  208,  209,  210,  212,  216,  403,  217,  403,  222,
+      218,  219,  220,  221,  403,  223,  225,  403,  227,  403,
+      224,  228,  403,  403,  229,  403,  234,  230,  226,  232,
+      231,  403,  403,  233,  403,  403,  403,  235,  403,  403,
+      403,  403,  403,  237,  403,  403,  403,  403,  236,  247,
+      248,  249,  403,  403,  403,  403,  240,  242,  238,  241,
+
+      403,  403,  403,  239,  252,  245,  244,  403,  403,  250,
+      260,  261,  246,  243,  254,  251,  403,  403,  259,  403,
+      403,  403,  403,  403,  403,  253,  255,  256,  257,  263,
+      264,  403,  262,  258,  403,  403,  271,  403,  403,  272,
+      273,  403,  403,  266,  265,  267,  274,  403,  403,  270,
+      275,  403,  281,  268,  403,  269,  403,  403,  282,  285,
+      286,  403,  403,  278,  403,  276,  277,  403,  403,  280,
+      403,  403,  403,  403,  403,  403,  403,  297,  403,  279,
+      403,  403,  403,  283,  284,  287,  298,  403,  403,  288,
+      403,  403,  295,  403,  403,  403,  403,  403,  289,  301,
+
+      293,  290,  292,  291,  294,  296,  299,  403,  300,  302,
+      403,  403,  403,  307,  403,  403,  309,  306,  403,  403,
+      310,  305,  303,  403,  403,  312,  304,  403,  403,  403,
+      403,  308,  314,  403,  403,  311,  316,  403,  403,  403,
+      403,  317,  329,  330,  331,  319,  322,  313,  315,  318,
+      324,  326,  403,  403,  323,  321,  403,  328,  403,  403,
+      403,  320,  325,  403,  403,  403,  403,  403,  403,  327,
+      342,  343,  344,  333,  334,  332,  403,  403,  337,  403,
+      338,  347,  348,  403,  349,  403,  335,  336,  339,  403,
+      403,  340,  341,  345,  403,  346,  403,  403,  403,  350,
+
+      351,  354,  403,  360,  403,  403,  403,  361,  403,  362,
+      403,  403,  403,  403,  403,  403,  359,  352,  355,  353,
+      403,  403,  356,  403,  357,  403,  403,  403,  364,  403,
+      358,  403,  403,  367,  403,  377,  378,  379,  366,  403,
+      369,  403,  403,  363,  403,   39,  403,  365,  370,  368,
+      373,  374,  372,  375,  403,  385,  403,  371,  403,  380,
+      381,  376,  403,  384,  403,  388,  389,  390,  382,  391,
+      386,  403,  387,  383,  403,  403,  392,  403,  403,  393,
+      394,  403,  403,  400,  403,  403,  397,  401,  395,  402,
+      396,  403,  403,  403,  403,  403,  403,  403,  403,  403,
+
+      403,  403,  403,  398,  403,  399,  403,  403,  403,  403,
+      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
+      403,  403,  403,  403,  403,  403,  403,  403,  403,   95,
+       85,  403,  403,  403,   75,  403,   62,  403,   50,   28,
+      403,   31,   28,  403,    3,  403,  403,  403,  403,  403,
+      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
+      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
+      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
+      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
+      403,  403,  403,  403,  403,  403,  403,  403,  403
+
+    } ;
+
+static yyconst short int yy_chk[900] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    7,    7,   12,   21,   12,   12,
+       12,   12,   12,   14,   14,   14,   14,   14,   15,   19,
+       20,   16,   15,   16,   16,   16,   16,   16,   22,   19,
+       20,   23,   24,   25,   26,   41,   27,   30,   30,   32,
+       32,   32,   32,   32,   40,   49,   33,   21,   33,   33,
+
+       33,   33,   33,   41,   42,   22,   43,   26,   44,   45,
+       40,   25,   22,   27,   46,   47,   24,   34,   34,   34,
+       34,   34,   23,   37,   37,   37,   37,   37,   38,   48,
+       38,   38,   38,   38,   38,   42,   49,   52,   53,   54,
+       56,   43,   55,   47,   45,   57,   59,   44,   60,   46,
+       51,   51,   51,   51,   51,   64,   53,   52,   63,   65,
+       66,   61,   56,   61,   61,   61,   63,   48,   57,   55,
+       54,   67,   68,   70,   69,   74,   76,   64,   77,   78,
+       80,   65,   79,   81,   59,   82,   60,   83,   84,   76,
+       86,   87,   88,   66,   89,   70,   90,   77,   92,   96,
+
+       61,   69,   93,   87,   94,   68,   67,   78,   79,   81,
+       98,   97,   86,   99,  100,   74,  102,   80,   96,   97,
+       92,   89,  103,  101,   82,   84,   83,  101,  104,   88,
+       90,   94,   93,   98,  105,  106,  107,  108,  111,  109,
+      100,  110,  115,  104,  103,  113,   99,  114,  105,  116,
+      120,  112,  121,  102,  112,  112,  112,  117,  118,  119,
+      101,  122,  124,  123,  106,  109,  125,  113,  110,  114,
+      126,  116,  111,  127,  115,  107,  112,  108,  121,  128,
+      118,  129,  117,  130,  119,  131,  132,  122,  112,  123,
+      120,  126,  133,  125,  127,  137,  141,  139,  140,  138,
+
+      142,  145,  124,  143,  129,  146,  128,  139,  140,  144,
+      129,  147,  148,  149,  152,  150,  151,  156,  157,  137,
+      159,  133,  130,  131,  138,  132,  145,  143,  146,  141,
+      155,  144,  150,  151,  155,  155,  160,  142,  164,  148,
+      156,  147,  159,  161,  165,  162,  166,  167,  168,  169,
+      170,  157,  149,  152,  172,  155,  155,  171,  161,  160,
+      162,  175,  176,  178,  164,  180,  177,  155,  179,  181,
+      165,  182,  183,  184,  167,  168,  184,  184,  186,  170,
+      169,  187,  188,  175,  176,  189,  166,  172,  191,  171,
+      177,  192,  180,  179,  182,  194,  179,  193,  178,  185,
+
+      181,  183,  185,  185,  185,  186,  195,  196,  197,  198,
+      199,  201,  202,  203,  200,  191,  189,  211,  205,  206,
+      187,  188,  207,  208,  209,  210,  192,  213,  193,  194,
+      215,  214,  199,  212,  201,  203,  223,  224,  225,  202,
+      195,  196,  197,  198,  200,  205,  222,  206,  232,  211,
+      207,  208,  209,  210,  217,  212,  214,  218,  217,  219,
+      213,  218,  220,  226,  219,  221,  224,  220,  215,  222,
+      221,  233,  234,  223,  235,  237,  236,  225,  238,  239,
+      240,  241,  244,  232,  243,  245,  242,  246,  226,  242,
+      242,  242,  247,  248,  249,  251,  235,  237,  233,  236,
+
+      250,  255,  256,  234,  244,  240,  239,  252,  253,  242,
+      252,  252,  241,  238,  246,  243,  257,  258,  251,  260,
+      259,  261,  262,  267,  266,  245,  247,  248,  249,  255,
+      256,  263,  253,  250,  264,  265,  263,  268,  269,  264,
+      265,  270,  274,  258,  257,  259,  266,  275,  276,  262,
+      267,  278,  276,  260,  277,  261,  280,  279,  277,  280,
+      280,  284,  283,  270,  285,  268,  269,  286,  287,  275,
+      291,  288,  289,  293,  296,  299,  290,  293,  292,  274,
+      300,  295,  294,  278,  279,  283,  294,  301,  302,  284,
+      303,  304,  291,  305,  306,  307,  308,  309,  285,  296,
+
+      289,  286,  288,  287,  290,  292,  295,  310,  295,  299,
+      311,  312,  313,  304,  314,  315,  306,  303,  316,  317,
+      307,  302,  300,  318,  319,  309,  301,  320,  321,  323,
+      322,  305,  311,  324,  325,  308,  313,  327,  328,  326,
+      329,  314,  326,  326,  326,  316,  319,  310,  312,  315,
+      321,  323,  330,  331,  320,  318,  332,  325,  333,  346,
+      334,  317,  322,  335,  336,  342,  343,  337,  338,  324,
+      337,  337,  337,  328,  329,  327,  339,  340,  332,  341,
+      333,  339,  340,  344,  341,  345,  330,  331,  334,  354,
+      350,  335,  336,  338,  351,  338,  352,  353,  355,  342,
+
+      343,  346,  356,  355,  357,  358,  359,  356,  363,  357,
+      364,  365,  366,  367,  368,  369,  354,  344,  350,  345,
+      370,  376,  351,  371,  352,  374,  377,  381,  359,  372,
+      353,  373,  375,  365,  378,  375,  375,  375,  364,  379,
+      367,  380,  382,  358,  383,  404,  388,  363,  368,  366,
+      371,  372,  370,  373,  389,  381,  390,  369,  394,  376,
+      377,  374,  384,  380,  385,  384,  384,  384,  378,  385,
+      382,  386,  383,  379,  387,  395,  386,  396,  397,  387,
+      388,  402,  398,  397,  399,  401,  394,  398,  389,  399,
+      390,  400,  393,  392,  391,  362,  361,  360,  349,  348,
+
+      347,  298,  297,  395,  282,  396,  281,  273,  272,  271,
+      254,  231,  230,  229,  228,  227,  216,  204,  190,  174,
+      173,  163,  158,  154,  153,  136,  135,  134,   91,   85,
+       75,   73,   72,   71,   62,   58,   50,   39,   31,   28,
+       18,    8,    5,    3,  403,  403,  403,  403,  403,  403,
+      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
+      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
+      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
+      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
+      403,  403,  403,  403,  403,  403,  403,  403,  403
+
+    } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yytext;
+#line 1 "ts1.0_tokens.l"
+#define INITIAL 0
+/* definitions */
+#line 7 "ts1.0_tokens.l"
+#include <stdlib.h>
+#include "ts1.0_inst.h"
+#include "ts1.0_inst_list.h"
+#include "_ts1.0_parser.h"
+#ifdef _WIN32
+# include <windows.h>
+#endif
+#include <GL/glew.h>
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+
+#define YY_INPUT(buf,result,max_size) \
+{ \
+	int c = *myin++; \
+	result = (c == 0) ? YY_NULL : (buf[0] = c, 1); \
+}
+
+#define YY_ALWAYS_INTERACTIVE 1
+
+/* end of definitions */
+#line 738 "_ts1.0_lexer.cpp"
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap YY_PROTO(( void ));
+#else
+extern int yywrap YY_PROTO(( void ));
+#endif
+#endif
+
+#ifndef YY_NO_UNPUT
+static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput YY_PROTO(( void ));
+#else
+static int input YY_PROTO(( void ));
+#endif
+#endif
+
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
+#ifdef YY_MALLOC_DECL
+YY_MALLOC_DECL
+#else
+#if __STDC__
+#ifndef __cplusplus
+#include <stdlib.h>
+#endif
+#else
+/* Just try to get by without declaring the routines.  This will fail
+ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+ * or sizeof(void*) != sizeof(int).
+ */
+#endif
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+	if ( yy_current_buffer->yy_is_interactive ) \
+		{ \
+		int c = '*', n; \
+		for ( n = 0; n < max_size && \
+			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+			buf[n] = (char) c; \
+		if ( c == '\n' ) \
+			buf[n++] = (char) c; \
+		if ( c == EOF && ferror( yyin ) ) \
+			YY_FATAL_ERROR( "input in flex scanner failed" ); \
+		result = n; \
+		} \
+	else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
+		  && ferror( yyin ) ) \
+		YY_FATAL_ERROR( "input in flex scanner failed" );
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL int yylex YY_PROTO(( void ))
+#endif
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+	YY_USER_ACTION
+
+YY_DECL
+	{
+	register yy_state_type yy_current_state;
+	register char *yy_cp = NULL, *yy_bp = NULL;
+	register int yy_act;
+
+#line 29 "ts1.0_tokens.l"
+
+
+#line 892 "_ts1.0_lexer.cpp"
+
+	if ( yy_init )
+		{
+		yy_init = 0;
+
+#ifdef YY_USER_INIT
+		YY_USER_INIT;
+#endif
+
+		if ( ! yy_start )
+			yy_start = 1;	/* first start state */
+
+		if ( ! yyin )
+			yyin = stdin;
+
+		if ( ! yyout )
+			yyout = stdout;
+
+		if ( ! yy_current_buffer )
+			yy_current_buffer =
+				yy_create_buffer( yyin, YY_BUF_SIZE );
+
+		yy_load_buffer_state();
+		}
+
+	while ( 1 )		/* loops until end-of-file is reached */
+		{
+		yy_cp = yy_c_buf_p;
+
+		/* Support of yytext. */
+		*yy_cp = yy_hold_char;
+
+		/* yy_bp points to the position in yy_ch_buf of the start of
+		 * the current run.
+		 */
+		yy_bp = yy_cp;
+
+		yy_current_state = yy_start;
+yy_match:
+		do
+			{
+			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+			if ( yy_accept[yy_current_state] )
+				{
+				yy_last_accepting_state = yy_current_state;
+				yy_last_accepting_cpos = yy_cp;
+				}
+			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+				{
+				yy_current_state = (int) yy_def[yy_current_state];
+				if ( yy_current_state >= 404 )
+					yy_c = yy_meta[(unsigned int) yy_c];
+				}
+			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+			++yy_cp;
+			}
+		while ( yy_base[yy_current_state] != 845 );
+
+yy_find_action:
+		yy_act = yy_accept[yy_current_state];
+		if ( yy_act == 0 )
+			{ /* have to back up */
+			yy_cp = yy_last_accepting_cpos;
+			yy_current_state = yy_last_accepting_state;
+			yy_act = yy_accept[yy_current_state];
+			}
+
+		YY_DO_BEFORE_ACTION;
+
+
+do_action:	/* This label is used only to access EOF actions. */
+
+
+		switch ( yy_act )
+	{ /* beginning of action switch */
+			case 0: /* must back up */
+			/* undo the effects of YY_DO_BEFORE_ACTION */
+			*yy_cp = yy_hold_char;
+			yy_cp = yy_last_accepting_cpos;
+			yy_current_state = yy_last_accepting_state;
+			goto yy_find_action;
+
+case 1:
+YY_RULE_SETUP
+#line 31 "ts1.0_tokens.l"
+{
+			    A:
+				switch (yyinput()) {
+				  case '*': goto B;
+				  case 0: errors.set("end-of-file in comment", line_number); break;
+				  case '\n': line_number++;
+				  default:  goto A;
+				}
+			    B:
+				switch (yyinput()) {
+				  case '*': goto B;
+				  case '/': break;
+				  case 0: errors.set("end-of-file in comment", line_number); break;
+				  case '\n': line_number++;
+				  default:  goto A;
+				}
+			}
+	YY_BREAK
+case 2:
+YY_RULE_SETUP
+#line 49 "ts1.0_tokens.l"
+{
+			    char ch;
+			    while ((ch = yyinput()) != '\n');
+			    if (ch == '\n') line_number++;
+			}
+	YY_BREAK
+case 3:
+YY_RULE_SETUP
+#line 55 "ts1.0_tokens.l"
+{
+			    char ch;
+			    while ((ch = yyinput()) != '\n');
+			    if (ch == '\n') line_number++;
+			}
+	YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 61 "ts1.0_tokens.l"
+return(openParen);
+	YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 62 "ts1.0_tokens.l"
+return(closeParen);
+	YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 63 "ts1.0_tokens.l"
+return(semicolon);
+	YY_BREAK
+case 7:
+YY_RULE_SETUP
+#line 64 "ts1.0_tokens.l"
+return(comma);
+	YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 66 "ts1.0_tokens.l"
+{ /* eat header */ }
+	YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 68 "ts1.0_tokens.l"
+{
+			    ts10_lval.fval = (float)0;
+			    return(texVariable);
+			}
+	YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 73 "ts1.0_tokens.l"
+{
+			    ts10_lval.fval = (float)1;
+			    return(texVariable);
+			}
+	YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 78 "ts1.0_tokens.l"
+{
+			    ts10_lval.fval = (float)2;
+			    return(texVariable);
+			}
+	YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 83 "ts1.0_tokens.l"
+return(expandString);
+	YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 85 "ts1.0_tokens.l"
+{
+				ts10_lval.fval = (float)GL_GEQUAL;
+				return (gequal);
+			}
+	YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 90 "ts1.0_tokens.l"
+{
+				ts10_lval.fval = (float)GL_LESS;
+				return(less);
+			}
+	YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 95 "ts1.0_tokens.l"
+return(nop);
+	YY_BREAK
+case 16:
+YY_RULE_SETUP
+#line 96 "ts1.0_tokens.l"
+return(texture_1d);
+	YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 97 "ts1.0_tokens.l"
+return(texture_2d);
+	YY_BREAK
+case 18:
+YY_RULE_SETUP
+#line 98 "ts1.0_tokens.l"
+return(texture_rectangle);
+	YY_BREAK
+case 19:
+YY_RULE_SETUP
+#line 99 "ts1.0_tokens.l"
+return(texture_3d);
+	YY_BREAK
+case 20:
+YY_RULE_SETUP
+#line 100 "ts1.0_tokens.l"
+return(texture_cube_map);
+	YY_BREAK
+case 21:
+YY_RULE_SETUP
+#line 101 "ts1.0_tokens.l"
+return(cull_fragment);
+	YY_BREAK
+case 22:
+YY_RULE_SETUP
+#line 102 "ts1.0_tokens.l"
+return(pass_through);
+	YY_BREAK
+case 23:
+YY_RULE_SETUP
+#line 103 "ts1.0_tokens.l"
+return(offset_2d_scale);
+	YY_BREAK
+case 24:
+YY_RULE_SETUP
+#line 104 "ts1.0_tokens.l"
+return(offset_2d);
+	YY_BREAK
+case 25:
+YY_RULE_SETUP
+#line 105 "ts1.0_tokens.l"
+return(offset_rectangle_scale);
+	YY_BREAK
+case 26:
+YY_RULE_SETUP
+#line 106 "ts1.0_tokens.l"
+return(offset_rectangle);
+	YY_BREAK
+case 27:
+YY_RULE_SETUP
+#line 107 "ts1.0_tokens.l"
+return(dependent_ar);
+	YY_BREAK
+case 28:
+YY_RULE_SETUP
+#line 108 "ts1.0_tokens.l"
+return(dependent_gb);
+	YY_BREAK
+case 29:
+YY_RULE_SETUP
+#line 110 "ts1.0_tokens.l"
+return(dot_product_2d_1of2);
+	YY_BREAK
+case 30:
+YY_RULE_SETUP
+#line 111 "ts1.0_tokens.l"
+return(dot_product_2d_2of2);
+	YY_BREAK
+case 31:
+YY_RULE_SETUP
+#line 113 "ts1.0_tokens.l"
+return(dot_product_rectangle_1of2);
+	YY_BREAK
+case 32:
+YY_RULE_SETUP
+#line 114 "ts1.0_tokens.l"
+return(dot_product_rectangle_2of2);
+	YY_BREAK
+case 33:
+YY_RULE_SETUP
+#line 116 "ts1.0_tokens.l"
+return(dot_product_depth_replace_1of2);
+	YY_BREAK
+case 34:
+YY_RULE_SETUP
+#line 117 "ts1.0_tokens.l"
+return(dot_product_depth_replace_2of2);
+	YY_BREAK
+case 35:
+YY_RULE_SETUP
+#line 119 "ts1.0_tokens.l"
+return(dot_product_3d_1of3);
+	YY_BREAK
+case 36:
+YY_RULE_SETUP
+#line 120 "ts1.0_tokens.l"
+return(dot_product_3d_2of3);
+	YY_BREAK
+case 37:
+YY_RULE_SETUP
+#line 121 "ts1.0_tokens.l"
+return(dot_product_3d_3of3);
+	YY_BREAK
+case 38:
+YY_RULE_SETUP
+#line 123 "ts1.0_tokens.l"
+return(dot_product_cube_map_1of3);
+	YY_BREAK
+case 39:
+YY_RULE_SETUP
+#line 124 "ts1.0_tokens.l"
+return(dot_product_cube_map_2of3);
+	YY_BREAK
+case 40:
+YY_RULE_SETUP
+#line 125 "ts1.0_tokens.l"
+return(dot_product_cube_map_3of3);
+	YY_BREAK
+case 41:
+YY_RULE_SETUP
+#line 127 "ts1.0_tokens.l"
+return(dot_product_reflect_cube_map_eye_from_qs_1of3);
+	YY_BREAK
+case 42:
+YY_RULE_SETUP
+#line 128 "ts1.0_tokens.l"
+return(dot_product_reflect_cube_map_eye_from_qs_2of3);
+	YY_BREAK
+case 43:
+YY_RULE_SETUP
+#line 129 "ts1.0_tokens.l"
+return(dot_product_reflect_cube_map_eye_from_qs_3of3);
+	YY_BREAK
+case 44:
+YY_RULE_SETUP
+#line 131 "ts1.0_tokens.l"
+return(dot_product_reflect_cube_map_const_eye_1of3);
+	YY_BREAK
+case 45:
+YY_RULE_SETUP
+#line 132 "ts1.0_tokens.l"
+return(dot_product_reflect_cube_map_const_eye_2of3);
+	YY_BREAK
+case 46:
+YY_RULE_SETUP
+#line 133 "ts1.0_tokens.l"
+return(dot_product_reflect_cube_map_const_eye_3of3);
+	YY_BREAK
+case 47:
+YY_RULE_SETUP
+#line 135 "ts1.0_tokens.l"
+return(dot_product_cube_map_and_reflect_cube_map_eye_from_qs_1of3);
+	YY_BREAK
+case 48:
+YY_RULE_SETUP
+#line 136 "ts1.0_tokens.l"
+return(dot_product_cube_map_and_reflect_cube_map_eye_from_qs_2of3);
+	YY_BREAK
+case 49:
+YY_RULE_SETUP
+#line 137 "ts1.0_tokens.l"
+return(dot_product_cube_map_and_reflect_cube_map_eye_from_qs_3of3);
+	YY_BREAK
+case 50:
+YY_RULE_SETUP
+#line 139 "ts1.0_tokens.l"
+return(dot_product_cube_map_and_reflect_cube_map_const_eye_1of3);
+	YY_BREAK
+case 51:
+YY_RULE_SETUP
+#line 140 "ts1.0_tokens.l"
+return(dot_product_cube_map_and_reflect_cube_map_const_eye_2of3);
+	YY_BREAK
+case 52:
+YY_RULE_SETUP
+#line 141 "ts1.0_tokens.l"
+return(dot_product_cube_map_and_reflect_cube_map_const_eye_3of3);
+	YY_BREAK
+case 53:
+YY_RULE_SETUP
+#line 143 "ts1.0_tokens.l"
+{
+				ts10_lval.fval = (float)atof(yytext);
+				return(floatValue);
+			}
+	YY_BREAK
+case 54:
+YY_RULE_SETUP
+#line 148 "ts1.0_tokens.l"
+{
+				ts10_lval.fval = (float)atof(yytext);
+				return(floatValue);
+			}
+	YY_BREAK
+case 55:
+YY_RULE_SETUP
+#line 153 "ts1.0_tokens.l"
+{
+				ts10_lval.fval = (float)atof(yytext);
+				return(floatValue);
+			}
+	YY_BREAK
+case 56:
+YY_RULE_SETUP
+#line 158 "ts1.0_tokens.l"
+{
+				line_number++;
+			}
+	YY_BREAK
+case 57:
+YY_RULE_SETUP
+#line 162 "ts1.0_tokens.l"
+{}
+	YY_BREAK
+case 58:
+YY_RULE_SETUP
+#line 164 "ts1.0_tokens.l"
+{
+				errors.set("unrecognized token", line_number);
+			}
+	YY_BREAK
+case 59:
+YY_RULE_SETUP
+#line 169 "ts1.0_tokens.l"
+ECHO;
+	YY_BREAK
+#line 1322 "_ts1.0_lexer.cpp"
+case YY_STATE_EOF(INITIAL):
+	yyterminate();
+
+	case YY_END_OF_BUFFER:
+		{
+		/* Amount of text matched not including the EOB char. */
+		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+
+		/* Undo the effects of YY_DO_BEFORE_ACTION. */
+		*yy_cp = yy_hold_char;
+		YY_RESTORE_YY_MORE_OFFSET
+
+		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+			{
+			/* We're scanning a new file or input source.  It's
+			 * possible that this happened because the user
+			 * just pointed yyin at a new source and called
+			 * yylex().  If so, then we have to assure
+			 * consistency between yy_current_buffer and our
+			 * globals.  Here is the right place to do so, because
+			 * this is the first action (other than possibly a
+			 * back-up) that will match for the new input source.
+			 */
+			yy_n_chars = yy_current_buffer->yy_n_chars;
+			yy_current_buffer->yy_input_file = yyin;
+			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+			}
+
+		/* Note that here we test for yy_c_buf_p "<=" to the position
+		 * of the first EOB in the buffer, since yy_c_buf_p will
+		 * already have been incremented past the NUL character
+		 * (since all states make transitions on EOB to the
+		 * end-of-buffer state).  Contrast this with the test
+		 * in input().
+		 */
+		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+			{ /* This was really a NUL. */
+			yy_state_type yy_next_state;
+
+			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+
+			yy_current_state = yy_get_previous_state();
+
+			/* Okay, we're now positioned to make the NUL
+			 * transition.  We couldn't have
+			 * yy_get_previous_state() go ahead and do it
+			 * for us because it doesn't know how to deal
+			 * with the possibility of jamming (and we don't
+			 * want to build jamming into it because then it
+			 * will run more slowly).
+			 */
+
+			yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+			yy_bp = yytext_ptr + YY_MORE_ADJ;
+
+			if ( yy_next_state )
+				{
+				/* Consume the NUL. */
+				yy_cp = ++yy_c_buf_p;
+				yy_current_state = yy_next_state;
+				goto yy_match;
+				}
+
+			else
+				{
+				yy_cp = yy_c_buf_p;
+				goto yy_find_action;
+				}
+			}
+
+		else switch ( yy_get_next_buffer() )
+			{
+			case EOB_ACT_END_OF_FILE:
+				{
+				yy_did_buffer_switch_on_eof = 0;
+
+				if ( yywrap() )
+					{
+					/* Note: because we've taken care in
+					 * yy_get_next_buffer() to have set up
+					 * yytext, we can now set up
+					 * yy_c_buf_p so that if some total
+					 * hoser (like flex itself) wants to
+					 * call the scanner after we return the
+					 * YY_NULL, it'll still work - another
+					 * YY_NULL will get returned.
+					 */
+					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+					yy_act = YY_STATE_EOF(YY_START);
+					goto do_action;
+					}
+
+				else
+					{
+					if ( ! yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+					}
+				break;
+				}
+
+			case EOB_ACT_CONTINUE_SCAN:
+				yy_c_buf_p =
+					yytext_ptr + yy_amount_of_matched_text;
+
+				yy_current_state = yy_get_previous_state();
+
+				yy_cp = yy_c_buf_p;
+				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				goto yy_match;
+
+			case EOB_ACT_LAST_MATCH:
+				yy_c_buf_p =
+				&yy_current_buffer->yy_ch_buf[yy_n_chars];
+
+				yy_current_state = yy_get_previous_state();
+
+				yy_cp = yy_c_buf_p;
+				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				goto yy_find_action;
+			}
+		break;
+		}
+
+	default:
+		YY_FATAL_ERROR(
+			"fatal flex scanner internal error--no action found" );
+	} /* end of action switch */
+		} /* end of scanning one token */
+	} /* end of yylex */
+
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ *	EOB_ACT_LAST_MATCH -
+ *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *	EOB_ACT_END_OF_FILE - end of file
+ */
+
+static int yy_get_next_buffer()
+	{
+	register char *dest = yy_current_buffer->yy_ch_buf;
+	register char *source = yytext_ptr;
+	register int number_to_move, i;
+	int ret_val;
+
+	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+		YY_FATAL_ERROR(
+		"fatal flex scanner internal error--end of buffer missed" );
+
+	if ( yy_current_buffer->yy_fill_buffer == 0 )
+		{ /* Don't try to fill the buffer, so this is an EOF. */
+		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+			{
+			/* We matched a single character, the EOB, so
+			 * treat this as a final EOF.
+			 */
+			return EOB_ACT_END_OF_FILE;
+			}
+
+		else
+			{
+			/* We matched some text prior to the EOB, first
+			 * process it.
+			 */
+			return EOB_ACT_LAST_MATCH;
+			}
+		}
+
+	/* Try to read more data. */
+
+	/* First move last chars to start of buffer. */
+	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+
+	for ( i = 0; i < number_to_move; ++i )
+		*(dest++) = *(source++);
+
+	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+		/* don't do the read, it's not guaranteed to return an EOF,
+		 * just force an EOF
+		 */
+		yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+
+	else
+		{
+		int num_to_read =
+			yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+		while ( num_to_read <= 0 )
+			{ /* Not enough room in the buffer - grow it. */
+#ifdef YY_USES_REJECT
+			YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+			/* just a shorter name for the current buffer */
+			YY_BUFFER_STATE b = yy_current_buffer;
+
+			int yy_c_buf_p_offset =
+				(int) (yy_c_buf_p - b->yy_ch_buf);
+
+			if ( b->yy_is_our_buffer )
+				{
+				int new_size = b->yy_buf_size * 2;
+
+				if ( new_size <= 0 )
+					b->yy_buf_size += b->yy_buf_size / 8;
+				else
+					b->yy_buf_size *= 2;
+
+				b->yy_ch_buf = (char *)
+					/* Include room in for 2 EOB chars. */
+					yy_flex_realloc( (void *) b->yy_ch_buf,
+							 b->yy_buf_size + 2 );
+				}
+			else
+				/* Can't grow it, we don't own it. */
+				b->yy_ch_buf = 0;
+
+			if ( ! b->yy_ch_buf )
+				YY_FATAL_ERROR(
+				"fatal error - scanner input buffer overflow" );
+
+			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+			num_to_read = yy_current_buffer->yy_buf_size -
+						number_to_move - 1;
+#endif
+			}
+
+		if ( num_to_read > YY_READ_BUF_SIZE )
+			num_to_read = YY_READ_BUF_SIZE;
+
+		/* Read in more data. */
+		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+			yy_n_chars, num_to_read );
+
+		yy_current_buffer->yy_n_chars = yy_n_chars;
+		}
+
+	if ( yy_n_chars == 0 )
+		{
+		if ( number_to_move == YY_MORE_ADJ )
+			{
+			ret_val = EOB_ACT_END_OF_FILE;
+			yyrestart( yyin );
+			}
+
+		else
+			{
+			ret_val = EOB_ACT_LAST_MATCH;
+			yy_current_buffer->yy_buffer_status =
+				YY_BUFFER_EOF_PENDING;
+			}
+		}
+
+	else
+		ret_val = EOB_ACT_CONTINUE_SCAN;
+
+	yy_n_chars += number_to_move;
+	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+
+	return ret_val;
+	}
+
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+static yy_state_type yy_get_previous_state()
+	{
+	register yy_state_type yy_current_state;
+	register char *yy_cp;
+
+	yy_current_state = yy_start;
+
+	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+		{
+		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+		if ( yy_accept[yy_current_state] )
+			{
+			yy_last_accepting_state = yy_current_state;
+			yy_last_accepting_cpos = yy_cp;
+			}
+		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+			{
+			yy_current_state = (int) yy_def[yy_current_state];
+			if ( yy_current_state >= 404 )
+				yy_c = yy_meta[(unsigned int) yy_c];
+			}
+		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+		}
+
+	return yy_current_state;
+	}
+
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ *	next_state = yy_try_NUL_trans( current_state );
+ */
+
+#ifdef YY_USE_PROTOS
+static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+#else
+static yy_state_type yy_try_NUL_trans( yy_current_state )
+yy_state_type yy_current_state;
+#endif
+	{
+	register int yy_is_jam;
+	register char *yy_cp = yy_c_buf_p;
+
+	register YY_CHAR yy_c = 1;
+	if ( yy_accept[yy_current_state] )
+		{
+		yy_last_accepting_state = yy_current_state;
+		yy_last_accepting_cpos = yy_cp;
+		}
+	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+		{
+		yy_current_state = (int) yy_def[yy_current_state];
+		if ( yy_current_state >= 404 )
+			yy_c = yy_meta[(unsigned int) yy_c];
+		}
+	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+	yy_is_jam = (yy_current_state == 403);
+
+	return yy_is_jam ? 0 : yy_current_state;
+	}
+
+
+#ifndef YY_NO_UNPUT
+#ifdef YY_USE_PROTOS
+static void yyunput( int c, register char *yy_bp )
+#else
+static void yyunput( c, yy_bp )
+int c;
+register char *yy_bp;
+#endif
+	{
+	register char *yy_cp = yy_c_buf_p;
+
+	/* undo effects of setting up yytext */
+	*yy_cp = yy_hold_char;
+
+	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+		{ /* need to shift things up to make room */
+		/* +2 for EOB chars. */
+		register int number_to_move = yy_n_chars + 2;
+		register char *dest = &yy_current_buffer->yy_ch_buf[
+					yy_current_buffer->yy_buf_size + 2];
+		register char *source =
+				&yy_current_buffer->yy_ch_buf[number_to_move];
+
+		while ( source > yy_current_buffer->yy_ch_buf )
+			*--dest = *--source;
+
+		yy_cp += (int) (dest - source);
+		yy_bp += (int) (dest - source);
+		yy_current_buffer->yy_n_chars =
+			yy_n_chars = yy_current_buffer->yy_buf_size;
+
+		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+			YY_FATAL_ERROR( "flex scanner push-back overflow" );
+		}
+
+	*--yy_cp = (char) c;
+
+
+	yytext_ptr = yy_bp;
+	yy_hold_char = *yy_cp;
+	yy_c_buf_p = yy_cp;
+	}
+#endif	/* ifndef YY_NO_UNPUT */
+
+
+#ifdef __cplusplus
+static int yyinput()
+#else
+static int input()
+#endif
+	{
+	int c;
+
+	*yy_c_buf_p = yy_hold_char;
+
+	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+		{
+		/* yy_c_buf_p now points to the character we want to return.
+		 * If this occurs *before* the EOB characters, then it's a
+		 * valid NUL; if not, then we've hit the end of the buffer.
+		 */
+		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+			/* This was really a NUL. */
+			*yy_c_buf_p = '\0';
+
+		else
+			{ /* need more input */
+			int offset = yy_c_buf_p - yytext_ptr;
+			++yy_c_buf_p;
+
+			switch ( yy_get_next_buffer() )
+				{
+				case EOB_ACT_LAST_MATCH:
+					/* This happens because yy_g_n_b()
+					 * sees that we've accumulated a
+					 * token and flags that we need to
+					 * try matching the token before
+					 * proceeding.  But for input(),
+					 * there's no matching to consider.
+					 * So convert the EOB_ACT_LAST_MATCH
+					 * to EOB_ACT_END_OF_FILE.
+					 */
+
+					/* Reset buffer status. */
+					yyrestart( yyin );
+
+					/* fall through */
+
+				case EOB_ACT_END_OF_FILE:
+					{
+					if ( yywrap() )
+						return EOF;
+
+					if ( ! yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+#ifdef __cplusplus
+					return yyinput();
+#else
+					return input();
+#endif
+					}
+
+				case EOB_ACT_CONTINUE_SCAN:
+					yy_c_buf_p = yytext_ptr + offset;
+					break;
+				}
+			}
+		}
+
+	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
+	*yy_c_buf_p = '\0';	/* preserve yytext */
+	yy_hold_char = *++yy_c_buf_p;
+
+
+	return c;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yyrestart( FILE *input_file )
+#else
+void yyrestart( input_file )
+FILE *input_file;
+#endif
+	{
+	if ( ! yy_current_buffer )
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+	yy_init_buffer( yy_current_buffer, input_file );
+	yy_load_buffer_state();
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+#else
+void yy_switch_to_buffer( new_buffer )
+YY_BUFFER_STATE new_buffer;
+#endif
+	{
+	if ( yy_current_buffer == new_buffer )
+		return;
+
+	if ( yy_current_buffer )
+		{
+		/* Flush out information for old buffer. */
+		*yy_c_buf_p = yy_hold_char;
+		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+		yy_current_buffer->yy_n_chars = yy_n_chars;
+		}
+
+	yy_current_buffer = new_buffer;
+	yy_load_buffer_state();
+
+	/* We don't actually know whether we did this switch during
+	 * EOF (yywrap()) processing, but the only time this flag
+	 * is looked at is after yywrap() is called, so it's safe
+	 * to go ahead and always set it.
+	 */
+	yy_did_buffer_switch_on_eof = 1;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_load_buffer_state( void )
+#else
+void yy_load_buffer_state()
+#endif
+	{
+	yy_n_chars = yy_current_buffer->yy_n_chars;
+	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+	yyin = yy_current_buffer->yy_input_file;
+	yy_hold_char = *yy_c_buf_p;
+	}
+
+
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+#else
+YY_BUFFER_STATE yy_create_buffer( file, size )
+FILE *file;
+int size;
+#endif
+	{
+	YY_BUFFER_STATE b;
+
+	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_buf_size = size;
+
+	/* yy_ch_buf has to be 2 characters longer than the size given because
+	 * we need to put in 2 end-of-buffer characters.
+	 */
+	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+	if ( ! b->yy_ch_buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_is_our_buffer = 1;
+
+	yy_init_buffer( b, file );
+
+	return b;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_delete_buffer( YY_BUFFER_STATE b )
+#else
+void yy_delete_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+	{
+	if ( ! b )
+		return;
+
+	if ( b == yy_current_buffer )
+		yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+	if ( b->yy_is_our_buffer )
+		yy_flex_free( (void *) b->yy_ch_buf );
+
+	yy_flex_free( (void *) b );
+	}
+
+
+
+#ifdef YY_USE_PROTOS
+void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+#else
+void yy_init_buffer( b, file )
+YY_BUFFER_STATE b;
+FILE *file;
+#endif
+
+
+	{
+	yy_flush_buffer( b );
+
+	b->yy_input_file = file;
+	b->yy_fill_buffer = 1;
+
+#if YY_ALWAYS_INTERACTIVE
+	b->yy_is_interactive = 1;
+#else
+#if YY_NEVER_INTERACTIVE
+	b->yy_is_interactive = 0;
+#else
+	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+#endif
+#endif
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_flush_buffer( YY_BUFFER_STATE b )
+#else
+void yy_flush_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+
+	{
+	if ( ! b )
+		return;
+
+	b->yy_n_chars = 0;
+
+	/* We always need two end-of-buffer characters.  The first causes
+	 * a transition to the end-of-buffer state.  The second causes
+	 * a jam in that state.
+	 */
+	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+	b->yy_buf_pos = &b->yy_ch_buf[0];
+
+	b->yy_at_bol = 1;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	if ( b == yy_current_buffer )
+		yy_load_buffer_state();
+	}
+
+
+#ifndef YY_NO_SCAN_BUFFER
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+#else
+YY_BUFFER_STATE yy_scan_buffer( base, size )
+char *base;
+yy_size_t size;
+#endif
+	{
+	YY_BUFFER_STATE b;
+
+	if ( size < 2 ||
+	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
+	     base[size-1] != YY_END_OF_BUFFER_CHAR )
+		/* They forgot to leave room for the EOB's. */
+		return 0;
+
+	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
+	b->yy_buf_pos = b->yy_ch_buf = base;
+	b->yy_is_our_buffer = 0;
+	b->yy_input_file = 0;
+	b->yy_n_chars = b->yy_buf_size;
+	b->yy_is_interactive = 0;
+	b->yy_at_bol = 1;
+	b->yy_fill_buffer = 0;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	yy_switch_to_buffer( b );
+
+	return b;
+	}
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+#else
+YY_BUFFER_STATE yy_scan_string( yy_str )
+yyconst char *yy_str;
+#endif
+	{
+	int len;
+	for ( len = 0; yy_str[len]; ++len )
+		;
+
+	return yy_scan_bytes( yy_str, len );
+	}
+#endif
+
+
+#ifndef YY_NO_SCAN_BYTES
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
+#else
+YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+yyconst char *bytes;
+int len;
+#endif
+	{
+	YY_BUFFER_STATE b;
+	char *buf;
+	yy_size_t n;
+	int i;
+
+	/* Get memory for full buffer, including space for trailing EOB's. */
+	n = len + 2;
+	buf = (char *) yy_flex_alloc( n );
+	if ( ! buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+	for ( i = 0; i < len; ++i )
+		buf[i] = bytes[i];
+
+	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+	b = yy_scan_buffer( buf, n );
+	if ( ! b )
+		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+	/* It's okay to grow etc. this buffer, and we should throw it
+	 * away when we're done.
+	 */
+	b->yy_is_our_buffer = 1;
+
+	return b;
+	}
+#endif
+
+
+#ifndef YY_NO_PUSH_STATE
+#ifdef YY_USE_PROTOS
+static void yy_push_state( int new_state )
+#else
+static void yy_push_state( new_state )
+int new_state;
+#endif
+	{
+	if ( yy_start_stack_ptr >= yy_start_stack_depth )
+		{
+		yy_size_t new_size;
+
+		yy_start_stack_depth += YY_START_STACK_INCR;
+		new_size = yy_start_stack_depth * sizeof( int );
+
+		if ( ! yy_start_stack )
+			yy_start_stack = (int *) yy_flex_alloc( new_size );
+
+		else
+			yy_start_stack = (int *) yy_flex_realloc(
+					(void *) yy_start_stack, new_size );
+
+		if ( ! yy_start_stack )
+			YY_FATAL_ERROR(
+			"out of memory expanding start-condition stack" );
+		}
+
+	yy_start_stack[yy_start_stack_ptr++] = YY_START;
+
+	BEGIN(new_state);
+	}
+#endif
+
+
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state()
+	{
+	if ( --yy_start_stack_ptr < 0 )
+		YY_FATAL_ERROR( "start-condition stack underflow" );
+
+	BEGIN(yy_start_stack[yy_start_stack_ptr]);
+	}
+#endif
+
+
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state()
+	{
+	return yy_start_stack[yy_start_stack_ptr - 1];
+	}
+#endif
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+#ifdef YY_USE_PROTOS
+static void yy_fatal_error( yyconst char msg[] )
+#else
+static void yy_fatal_error( msg )
+char msg[];
+#endif
+	{
+	(void) fprintf( stderr, "%s\n", msg );
+	exit( YY_EXIT_FAILURE );
+	}
+
+
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+		yytext[yyleng] = yy_hold_char; \
+		yy_c_buf_p = yytext + n; \
+		yy_hold_char = *yy_c_buf_p; \
+		*yy_c_buf_p = '\0'; \
+		yyleng = n; \
+		} \
+	while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef yytext_ptr
+#ifdef YY_USE_PROTOS
+static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
+#else
+static void yy_flex_strncpy( s1, s2, n )
+char *s1;
+yyconst char *s2;
+int n;
+#endif
+	{
+	register int i;
+	for ( i = 0; i < n; ++i )
+		s1[i] = s2[i];
+	}
+#endif
+
+#ifdef YY_NEED_STRLEN
+#ifdef YY_USE_PROTOS
+static int yy_flex_strlen( yyconst char *s )
+#else
+static int yy_flex_strlen( s )
+yyconst char *s;
+#endif
+	{
+	register int n;
+	for ( n = 0; s[n]; ++n )
+		;
+
+	return n;
+	}
+#endif
+
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_alloc( yy_size_t size )
+#else
+static void *yy_flex_alloc( size )
+yy_size_t size;
+#endif
+	{
+	return (void *) malloc( size );
+	}
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_realloc( void *ptr, yy_size_t size )
+#else
+static void *yy_flex_realloc( ptr, size )
+void *ptr;
+yy_size_t size;
+#endif
+	{
+	/* The cast to (char *) in the following accommodates both
+	 * implementations that use char* generic pointers, and those
+	 * that use void* generic pointers.  It works with the latter
+	 * because both ANSI C and C++ allow castless assignment from
+	 * any pointer type to void*, and deal with argument conversions
+	 * as though doing an assignment.
+	 */
+	return (void *) realloc( (char *) ptr, size );
+	}
+
+#ifdef YY_USE_PROTOS
+static void yy_flex_free( void *ptr )
+#else
+static void yy_flex_free( ptr )
+void *ptr;
+#endif
+	{
+	free( ptr );
+	}
+
+#if YY_MAIN
+int main()
+	{
+	yylex();
+	return 0;
+	}
+#endif
+#line 169 "ts1.0_tokens.l"
+
+
+bool ts10_init_more();
+
+bool ts10_init(char* inputString)
+{
+    myin = inputString;
+	return ts10_init_more();
+}
+
+
+#ifndef ts10_wrap
+int ts10_wrap(void)
+{
+  return(1);
+}
+#endif
Index: /RenderSystems/GL/src/nvparse/_ts1.0_parser.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/_ts1.0_parser.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/_ts1.0_parser.cpp	(revision 5)
@@ -0,0 +1,1842 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/* A Bison parser, made by GNU Bison 1.875.  */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+/* Written by Richard Stallman by simplifying the original so called
+   ``semantic'' parser.  */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+   infringing on user name space.  This should be done even for local
+   variables, as they might otherwise be expanded by user macros.
+   There are some unavoidable exceptions within include files to
+   define necessary library symbols; they are noted "INFRINGES ON
+   USER NAME SPACE" below.  */
+
+/* Identify Bison output.  */
+#define YYBISON 1
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+/* If NAME_PREFIX is specified substitute the variables and functions
+   names.  */
+#define yyparse ts10_parse
+#define yylex   ts10_lex
+#define yyerror ts10_error
+#define yylval  ts10_lval
+#define yychar  ts10_char
+#define yydebug ts10_debug
+#define yynerrs ts10_nerrs
+
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     floatValue = 258,
+     gequal = 259,
+     less = 260,
+     texVariable = 261,
+     expandString = 262,
+     openParen = 263,
+     closeParen = 264,
+     semicolon = 265,
+     comma = 266,
+     nop = 267,
+     texture_1d = 268,
+     texture_2d = 269,
+     texture_rectangle = 270,
+     texture_3d = 271,
+     texture_cube_map = 272,
+     cull_fragment = 273,
+     pass_through = 274,
+     offset_2d_scale = 275,
+     offset_2d = 276,
+     offset_rectangle_scale = 277,
+     offset_rectangle = 278,
+     dependent_ar = 279,
+     dependent_gb = 280,
+     dot_product_2d_1of2 = 281,
+     dot_product_2d_2of2 = 282,
+     dot_product_rectangle_1of2 = 283,
+     dot_product_rectangle_2of2 = 284,
+     dot_product_depth_replace_1of2 = 285,
+     dot_product_depth_replace_2of2 = 286,
+     dot_product_3d_1of3 = 287,
+     dot_product_3d_2of3 = 288,
+     dot_product_3d_3of3 = 289,
+     dot_product_cube_map_1of3 = 290,
+     dot_product_cube_map_2of3 = 291,
+     dot_product_cube_map_3of3 = 292,
+     dot_product_reflect_cube_map_eye_from_qs_1of3 = 293,
+     dot_product_reflect_cube_map_eye_from_qs_2of3 = 294,
+     dot_product_reflect_cube_map_eye_from_qs_3of3 = 295,
+     dot_product_reflect_cube_map_const_eye_1of3 = 296,
+     dot_product_reflect_cube_map_const_eye_2of3 = 297,
+     dot_product_reflect_cube_map_const_eye_3of3 = 298,
+     dot_product_cube_map_and_reflect_cube_map_eye_from_qs_1of3 = 299,
+     dot_product_cube_map_and_reflect_cube_map_eye_from_qs_2of3 = 300,
+     dot_product_cube_map_and_reflect_cube_map_eye_from_qs_3of3 = 301,
+     dot_product_cube_map_and_reflect_cube_map_const_eye_1of3 = 302,
+     dot_product_cube_map_and_reflect_cube_map_const_eye_2of3 = 303,
+     dot_product_cube_map_and_reflect_cube_map_const_eye_3of3 = 304
+   };
+#endif
+#define floatValue 258
+#define gequal 259
+#define less 260
+#define texVariable 261
+#define expandString 262
+#define openParen 263
+#define closeParen 264
+#define semicolon 265
+#define comma 266
+#define nop 267
+#define texture_1d 268
+#define texture_2d 269
+#define texture_rectangle 270
+#define texture_3d 271
+#define texture_cube_map 272
+#define cull_fragment 273
+#define pass_through 274
+#define offset_2d_scale 275
+#define offset_2d 276
+#define offset_rectangle_scale 277
+#define offset_rectangle 278
+#define dependent_ar 279
+#define dependent_gb 280
+#define dot_product_2d_1of2 281
+#define dot_product_2d_2of2 282
+#define dot_product_rectangle_1of2 283
+#define dot_product_rectangle_2of2 284
+#define dot_product_depth_replace_1of2 285
+#define dot_product_depth_replace_2of2 286
+#define dot_product_3d_1of3 287
+#define dot_product_3d_2of3 288
+#define dot_product_3d_3of3 289
+#define dot_product_cube_map_1of3 290
+#define dot_product_cube_map_2of3 291
+#define dot_product_cube_map_3of3 292
+#define dot_product_reflect_cube_map_eye_from_qs_1of3 293
+#define dot_product_reflect_cube_map_eye_from_qs_2of3 294
+#define dot_product_reflect_cube_map_eye_from_qs_3of3 295
+#define dot_product_reflect_cube_map_const_eye_1of3 296
+#define dot_product_reflect_cube_map_const_eye_2of3 297
+#define dot_product_reflect_cube_map_const_eye_3of3 298
+#define dot_product_cube_map_and_reflect_cube_map_eye_from_qs_1of3 299
+#define dot_product_cube_map_and_reflect_cube_map_eye_from_qs_2of3 300
+#define dot_product_cube_map_and_reflect_cube_map_eye_from_qs_3of3 301
+#define dot_product_cube_map_and_reflect_cube_map_const_eye_1of3 302
+#define dot_product_cube_map_and_reflect_cube_map_const_eye_2of3 303
+#define dot_product_cube_map_and_reflect_cube_map_const_eye_3of3 304
+
+
+
+
+/* Copy the first part of user declarations.  */
+#line 3 "ts1.0_grammar.y"
+
+void yyerror(char* s);
+int yylex ( void );
+
+#ifdef _WIN32
+# include <windows.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include "ts1.0_inst.h"
+#include "ts1.0_inst_list.h"
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+
+
+/* Enabling traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+/* Enabling verbose error messages.  */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#line 18 "ts1.0_grammar.y"
+typedef union YYSTYPE {
+  float fval;
+  InstPtr inst;
+  InstListPtr instList;
+  MappedVariablePtr variable;
+} YYSTYPE;
+/* Line 191 of yacc.c.  */
+#line 205 "_ts1.0_parser.c"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+/* Copy the second part of user declarations.  */
+
+
+/* Line 214 of yacc.c.  */
+#line 217 "_ts1.0_parser.c"
+
+#if ! defined (yyoverflow) || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols.  */
+
+# if YYSTACK_USE_ALLOCA
+#  define YYSTACK_ALLOC alloca
+# else
+#  ifndef YYSTACK_USE_ALLOCA
+#   if defined (alloca) || defined (_ALLOCA_H)
+#    define YYSTACK_ALLOC alloca
+#   else
+#    ifdef __GNUC__
+#     define YYSTACK_ALLOC __builtin_alloca
+#    endif
+#   endif
+#  endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+   /* Pacify GCC's `empty if-body' warning. */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+# else
+#  if defined (__STDC__) || defined (__cplusplus)
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   define YYSIZE_T size_t
+#  endif
+#  define YYSTACK_ALLOC malloc
+#  define YYSTACK_FREE free
+# endif
+#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+
+
+#if (! defined (yyoverflow) \
+     && (! defined (__cplusplus) \
+	 || (YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member.  */
+union yyalloc
+{
+  short yyss;
+  YYSTYPE yyvs;
+  };
+
+/* The size of the maximum gap between one aligned stack and the next.  */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+   N elements.  */
+# define YYSTACK_BYTES(N) \
+     ((N) * (sizeof (short) + sizeof (YYSTYPE))				\
+      + YYSTACK_GAP_MAXIMUM)
+
+/* Copy COUNT objects from FROM to TO.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if 1 < __GNUC__
+#   define YYCOPY(To, From, Count) \
+      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#  else
+#   define YYCOPY(To, From, Count)		\
+      do					\
+	{					\
+	  register YYSIZE_T yyi;		\
+	  for (yyi = 0; yyi < (Count); yyi++)	\
+	    (To)[yyi] = (From)[yyi];		\
+	}					\
+      while (0)
+#  endif
+# endif
+
+/* Relocate STACK from its old location to the new one.  The
+   local variables YYSIZE and YYSTACKSIZE give the old and new number of
+   elements in the stack, and YYPTR gives the new location of the
+   stack.  Advance YYPTR to a properly aligned location for the next
+   stack.  */
+# define YYSTACK_RELOCATE(Stack)					\
+    do									\
+      {									\
+	YYSIZE_T yynewbytes;						\
+	YYCOPY (&yyptr->Stack, Stack, yysize);				\
+	Stack = &yyptr->Stack;						\
+	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+	yyptr += yynewbytes / sizeof (*yyptr);				\
+      }									\
+    while (0)
+
+#endif
+
+#if defined (__STDC__) || defined (__cplusplus)
+   typedef signed char yysigned_char;
+#else
+   typedef short yysigned_char;
+#endif
+
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL  80
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   223
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS  50
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS  6
+/* YYNRULES -- Number of rules. */
+#define YYNRULES  46
+/* YYNRULES -- Number of states. */
+#define YYNSTATES  218
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   304
+
+#define YYTRANSLATE(YYX) 						\
+  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+static const unsigned char yytranslate[] =
+{
+       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
+       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
+      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
+      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
+      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
+      45,    46,    47,    48,    49
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const unsigned short yyprhs[] =
+{
+       0,     0,     3,     5,     9,    12,    17,    19,    23,    27,
+      31,    35,    39,    43,    54,    58,    75,    88,   105,   118,
+     123,   128,   133,   138,   143,   148,   153,   158,   163,   168,
+     173,   178,   183,   188,   193,   198,   203,   214,   219,   224,
+     229,   234,   239,   250,   255,   260,   262
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yysigned_char yyrhs[] =
+{
+      51,     0,    -1,    52,    -1,    52,    54,    10,    -1,    54,
+      10,    -1,     7,     8,     6,     9,    -1,     6,    -1,    12,
+       8,     9,    -1,    13,     8,     9,    -1,    14,     8,     9,
+      -1,    15,     8,     9,    -1,    16,     8,     9,    -1,    17,
+       8,     9,    -1,    18,     8,    55,    11,    55,    11,    55,
+      11,    55,     9,    -1,    19,     8,     9,    -1,    20,     8,
+       6,    11,     3,    11,     3,    11,     3,    11,     3,    11,
+       3,    11,     3,     9,    -1,    21,     8,     6,    11,     3,
+      11,     3,    11,     3,    11,     3,     9,    -1,    22,     8,
+       6,    11,     3,    11,     3,    11,     3,    11,     3,    11,
+       3,    11,     3,     9,    -1,    23,     8,     6,    11,     3,
+      11,     3,    11,     3,    11,     3,     9,    -1,    24,     8,
+       6,     9,    -1,    25,     8,     6,     9,    -1,    26,     8,
+      53,     9,    -1,    27,     8,    53,     9,    -1,    28,     8,
+      53,     9,    -1,    29,     8,    53,     9,    -1,    30,     8,
+      53,     9,    -1,    31,     8,    53,     9,    -1,    32,     8,
+      53,     9,    -1,    33,     8,    53,     9,    -1,    34,     8,
+      53,     9,    -1,    35,     8,    53,     9,    -1,    36,     8,
+      53,     9,    -1,    37,     8,    53,     9,    -1,    38,     8,
+      53,     9,    -1,    39,     8,    53,     9,    -1,    40,     8,
+      53,     9,    -1,    41,     8,    53,    11,     3,    11,     3,
+      11,     3,     9,    -1,    42,     8,    53,     9,    -1,    43,
+       8,    53,     9,    -1,    44,     8,    53,     9,    -1,    45,
+       8,    53,     9,    -1,    46,     8,    53,     9,    -1,    47,
+       8,    53,    11,     3,    11,     3,    11,     3,     9,    -1,
+      48,     8,    53,     9,    -1,    49,     8,    53,     9,    -1,
+       4,    -1,     5,    -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const unsigned short yyrline[] =
+{
+       0,    73,    73,    81,    87,    97,   103,   111,   115,   119,
+     123,   127,   131,   135,   139,   143,   147,   151,   155,   159,
+     163,   167,   172,   177,   182,   187,   192,   197,   202,   207,
+     212,   217,   222,   227,   232,   237,   242,   247,   252,   257,
+     262,   267,   272,   277,   282,   289,   293
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE
+/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+static const char *const yytname[] =
+{
+  "$end", "error", "$undefined", "floatValue", "gequal", "less", 
+  "texVariable", "expandString", "openParen", "closeParen", "semicolon", 
+  "comma", "nop", "texture_1d", "texture_2d", "texture_rectangle", 
+  "texture_3d", "texture_cube_map", "cull_fragment", "pass_through", 
+  "offset_2d_scale", "offset_2d", "offset_rectangle_scale", 
+  "offset_rectangle", "dependent_ar", "dependent_gb", 
+  "dot_product_2d_1of2", "dot_product_2d_2of2", 
+  "dot_product_rectangle_1of2", "dot_product_rectangle_2of2", 
+  "dot_product_depth_replace_1of2", "dot_product_depth_replace_2of2", 
+  "dot_product_3d_1of3", "dot_product_3d_2of3", "dot_product_3d_3of3", 
+  "dot_product_cube_map_1of3", "dot_product_cube_map_2of3", 
+  "dot_product_cube_map_3of3", 
+  "dot_product_reflect_cube_map_eye_from_qs_1of3", 
+  "dot_product_reflect_cube_map_eye_from_qs_2of3", 
+  "dot_product_reflect_cube_map_eye_from_qs_3of3", 
+  "dot_product_reflect_cube_map_const_eye_1of3", 
+  "dot_product_reflect_cube_map_const_eye_2of3", 
+  "dot_product_reflect_cube_map_const_eye_3of3", 
+  "dot_product_cube_map_and_reflect_cube_map_eye_from_qs_1of3", 
+  "dot_product_cube_map_and_reflect_cube_map_eye_from_qs_2of3", 
+  "dot_product_cube_map_and_reflect_cube_map_eye_from_qs_3of3", 
+  "dot_product_cube_map_and_reflect_cube_map_const_eye_1of3", 
+  "dot_product_cube_map_and_reflect_cube_map_const_eye_2of3", 
+  "dot_product_cube_map_and_reflect_cube_map_const_eye_3of3", "$accept", 
+  "WholeEnchilada", "InstListDesc", "MappedVariableDesc", "InstDesc", 
+  "CondDesc", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+   token YYLEX-NUM.  */
+static const unsigned short yytoknum[] =
+{
+       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
+     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
+     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
+     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
+     295,   296,   297,   298,   299,   300,   301,   302,   303,   304
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const unsigned char yyr1[] =
+{
+       0,    50,    51,    52,    52,    53,    53,    54,    54,    54,
+      54,    54,    54,    54,    54,    54,    54,    54,    54,    54,
+      54,    54,    54,    54,    54,    54,    54,    54,    54,    54,
+      54,    54,    54,    54,    54,    54,    54,    54,    54,    54,
+      54,    54,    54,    54,    54,    55,    55
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const unsigned char yyr2[] =
+{
+       0,     2,     1,     3,     2,     4,     1,     3,     3,     3,
+       3,     3,     3,    10,     3,    16,    12,    16,    12,     4,
+       4,     4,     4,     4,     4,     4,     4,     4,     4,     4,
+       4,     4,     4,     4,     4,     4,    10,     4,     4,     4,
+       4,     4,    10,     4,     4,     1,     1
+};
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+   means the default is an error.  */
+static const unsigned char yydefact[] =
+{
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       2,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       1,     0,     4,     7,     8,     9,    10,    11,    12,    45,
+      46,     0,    14,     0,     0,     0,     0,     0,     0,     6,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     3,     0,     0,     0,     0,
+       0,    19,    20,     0,    21,    22,    23,    24,    25,    26,
+      27,    28,    29,    30,    31,    32,    33,    34,    35,     0,
+      37,    38,    39,    40,    41,     0,    43,    44,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     5,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,    13,     0,     0,     0,     0,
+      36,    42,     0,     0,     0,     0,     0,    16,     0,    18,
+       0,     0,     0,     0,     0,     0,    15,    17
+};
+
+/* YYDEFGOTO[NTERM-NUM]. */
+static const yysigned_char yydefgoto[] =
+{
+      -1,    39,    40,   101,    41,    91
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -127
+static const short yypact[] =
+{
+     -11,    31,    35,    39,    40,    41,    42,    43,    44,    45,
+      46,    71,    72,    73,    74,    75,    76,    77,    78,    79,
+      80,    81,    82,    83,    84,    85,    86,    87,    88,    89,
+      90,    91,    92,    93,    94,    95,    96,    97,    98,   107,
+     -11,    36,    99,   100,   101,   102,   103,   104,    37,   105,
+     109,   110,   111,   112,   113,   114,    38,    38,    38,    38,
+      38,    38,    38,    38,    38,    38,    38,    38,    38,    38,
+      38,    38,    38,    38,    38,    38,    38,    38,    38,    38,
+    -127,   115,  -127,  -127,  -127,  -127,  -127,  -127,  -127,  -127,
+    -127,   116,  -127,   117,   118,   119,   120,   123,   124,  -127,
+     126,   127,   128,   129,   130,   131,   132,   133,   134,   135,
+     136,   137,   138,   139,   140,   141,   142,   143,   145,   146,
+     147,   148,   149,   150,   152,  -127,    37,   121,   155,   159,
+     160,  -127,  -127,   158,  -127,  -127,  -127,  -127,  -127,  -127,
+    -127,  -127,  -127,  -127,  -127,  -127,  -127,  -127,  -127,   162,
+    -127,  -127,  -127,  -127,  -127,   163,  -127,  -127,   156,   157,
+     161,   164,   165,   168,   167,   169,    37,   166,   170,   171,
+     176,  -127,   178,   179,   172,   173,   174,   175,   177,   180,
+     181,    37,   184,   186,   187,   190,   191,   192,   188,   185,
+     189,   193,   194,   197,   198,  -127,   195,   196,   199,   200,
+    -127,  -127,   201,   202,   203,   204,   205,  -127,   206,  -127,
+     207,   208,   212,   213,   211,   214,  -127,  -127
+};
+
+/* YYPGOTO[NTERM-NUM].  */
+static const short yypgoto[] =
+{
+    -127,  -127,  -127,    -1,   182,  -126
+};
+
+/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
+   positive, shift that token.  If negative, reduce the rule which
+   number is the opposite.  If zero, do what YYDEFACT says.
+   If YYTABLE_NINF, syntax error.  */
+#define YYTABLE_NINF -1
+static const unsigned char yytable[] =
+{
+     158,     1,     2,     3,     4,     5,     6,     7,     8,     9,
+      10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
+      20,    21,    22,    23,    24,    25,    26,    27,    28,    29,
+      30,    31,    32,    33,    34,    35,    36,    37,    38,    42,
+     174,    89,    90,    43,    99,   100,    82,    44,    45,    46,
+      47,    48,    49,    50,    51,   188,   102,   103,   104,   105,
+     106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
+     116,   117,   118,   119,   120,   121,   122,   123,   124,    52,
+      53,    54,    55,    56,    57,    58,    59,    60,    61,    62,
+      63,    64,    65,    66,    67,    68,    69,    70,    71,    72,
+      73,    74,    75,    76,    77,    78,    79,    80,    83,    84,
+      85,    86,    87,    88,    92,    93,    94,    95,    96,    97,
+      98,     0,     0,     0,   159,   125,     0,   126,   127,   128,
+     129,   130,   131,   132,   133,     0,   134,   135,   136,   137,
+     138,   139,   140,   141,   142,   143,   144,   145,   146,   147,
+     148,     0,   150,   149,   151,   152,   153,   154,   160,   156,
+     155,   157,   161,   162,   163,   164,   165,   166,   167,   175,
+       0,     0,   168,   176,   177,   169,   170,   171,   172,   178,
+     173,   179,   180,   181,   182,   183,   184,   189,   185,   190,
+     191,   186,   187,   192,   193,   194,   196,   195,   202,   203,
+     197,     0,   204,   205,   198,   199,   200,   201,   210,   211,
+       0,   207,   206,   209,   208,   214,   215,     0,   212,   213,
+     216,     0,    81,   217
+};
+
+static const short yycheck[] =
+{
+     126,    12,    13,    14,    15,    16,    17,    18,    19,    20,
+      21,    22,    23,    24,    25,    26,    27,    28,    29,    30,
+      31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
+      41,    42,    43,    44,    45,    46,    47,    48,    49,     8,
+     166,     4,     5,     8,     6,     7,    10,     8,     8,     8,
+       8,     8,     8,     8,     8,   181,    57,    58,    59,    60,
+      61,    62,    63,    64,    65,    66,    67,    68,    69,    70,
+      71,    72,    73,    74,    75,    76,    77,    78,    79,     8,
+       8,     8,     8,     8,     8,     8,     8,     8,     8,     8,
+       8,     8,     8,     8,     8,     8,     8,     8,     8,     8,
+       8,     8,     8,     8,     8,     8,     8,     0,     9,     9,
+       9,     9,     9,     9,     9,     6,     6,     6,     6,     6,
+       6,    -1,    -1,    -1,     3,    10,    -1,    11,    11,    11,
+      11,    11,     9,     9,     8,    -1,     9,     9,     9,     9,
+       9,     9,     9,     9,     9,     9,     9,     9,     9,     9,
+       9,    -1,     9,    11,     9,     9,     9,     9,     3,     9,
+      11,     9,     3,     3,     6,     3,     3,    11,    11,     3,
+      -1,    -1,    11,     3,     3,    11,    11,     9,    11,     3,
+      11,     3,     3,    11,    11,    11,    11,     3,    11,     3,
+       3,    11,    11,     3,     3,     3,    11,     9,     3,     3,
+      11,    -1,     3,     3,    11,    11,     9,     9,     3,     3,
+      -1,     9,    11,     9,    11,     3,     3,    -1,    11,    11,
+       9,    -1,    40,     9
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const unsigned char yystos[] =
+{
+       0,    12,    13,    14,    15,    16,    17,    18,    19,    20,
+      21,    22,    23,    24,    25,    26,    27,    28,    29,    30,
+      31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
+      41,    42,    43,    44,    45,    46,    47,    48,    49,    51,
+      52,    54,     8,     8,     8,     8,     8,     8,     8,     8,
+       8,     8,     8,     8,     8,     8,     8,     8,     8,     8,
+       8,     8,     8,     8,     8,     8,     8,     8,     8,     8,
+       8,     8,     8,     8,     8,     8,     8,     8,     8,     8,
+       0,    54,    10,     9,     9,     9,     9,     9,     9,     4,
+       5,    55,     9,     6,     6,     6,     6,     6,     6,     6,
+       7,    53,    53,    53,    53,    53,    53,    53,    53,    53,
+      53,    53,    53,    53,    53,    53,    53,    53,    53,    53,
+      53,    53,    53,    53,    53,    10,    11,    11,    11,    11,
+      11,     9,     9,     8,     9,     9,     9,     9,     9,     9,
+       9,     9,     9,     9,     9,     9,     9,     9,     9,    11,
+       9,     9,     9,     9,     9,    11,     9,     9,    55,     3,
+       3,     3,     3,     6,     3,     3,    11,    11,    11,    11,
+      11,     9,    11,    11,    55,     3,     3,     3,     3,     3,
+       3,    11,    11,    11,    11,    11,    11,    11,    55,     3,
+       3,     3,     3,     3,     3,     9,    11,    11,    11,    11,
+       9,     9,     3,     3,     3,     3,    11,     9,    11,     9,
+       3,     3,    11,    11,     3,     3,     9,     9
+};
+
+#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
+# define YYSIZE_T __SIZE_TYPE__
+#endif
+#if ! defined (YYSIZE_T) && defined (size_t)
+# define YYSIZE_T size_t
+#endif
+#if ! defined (YYSIZE_T)
+# if defined (__STDC__) || defined (__cplusplus)
+#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYSIZE_T size_t
+# endif
+#endif
+#if ! defined (YYSIZE_T)
+# define YYSIZE_T unsigned int
+#endif
+
+#define yyerrok		(yyerrstatus = 0)
+#define yyclearin	(yychar = YYEMPTY)
+#define YYEMPTY		(-2)
+#define YYEOF		0
+
+#define YYACCEPT	goto yyacceptlab
+#define YYABORT		goto yyabortlab
+#define YYERROR		goto yyerrlab1
+
+
+/* Like YYERROR except do call yyerror.  This remains here temporarily
+   to ease the transition to the new meaning of YYERROR, for GCC.
+   Once GCC version 2 has supplanted version 1, this can go.  */
+
+#define YYFAIL		goto yyerrlab
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)					\
+do								\
+  if (yychar == YYEMPTY && yylen == 1)				\
+    {								\
+      yychar = (Token);						\
+      yylval = (Value);						\
+      yytoken = YYTRANSLATE (yychar);				\
+      YYPOPSTACK;						\
+      goto yybackup;						\
+    }								\
+  else								\
+    { 								\
+      yyerror ("syntax error: cannot back up");\
+      YYERROR;							\
+    }								\
+while (0)
+
+#define YYTERROR	1
+#define YYERRCODE	256
+
+/* YYLLOC_DEFAULT -- Compute the default location (before the actions
+   are run).  */
+
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N)         \
+  Current.first_line   = Rhs[1].first_line;      \
+  Current.first_column = Rhs[1].first_column;    \
+  Current.last_line    = Rhs[N].last_line;       \
+  Current.last_column  = Rhs[N].last_column;
+#endif
+
+/* YYLEX -- calling `yylex' with the right arguments.  */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#endif
+
+/* Enable debugging if requested.  */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args)			\
+do {						\
+  if (yydebug)					\
+    YYFPRINTF Args;				\
+} while (0)
+
+# define YYDSYMPRINT(Args)			\
+do {						\
+  if (yydebug)					\
+    yysymprint Args;				\
+} while (0)
+
+# define YYDSYMPRINTF(Title, Token, Value, Location)		\
+do {								\
+  if (yydebug)							\
+    {								\
+      YYFPRINTF (stderr, "%s ", Title);				\
+      yysymprint (stderr, 					\
+                  Token, Value);	\
+      YYFPRINTF (stderr, "\n");					\
+    }								\
+} while (0)
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (cinluded).                                                   |
+`------------------------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_stack_print (short *bottom, short *top)
+#else
+static void
+yy_stack_print (bottom, top)
+    short *bottom;
+    short *top;
+#endif
+{
+  YYFPRINTF (stderr, "Stack now");
+  for (/* Nothing. */; bottom <= top; ++bottom)
+    YYFPRINTF (stderr, " %d", *bottom);
+  YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top)				\
+do {								\
+  if (yydebug)							\
+    yy_stack_print ((Bottom), (Top));				\
+} while (0)
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced.  |
+`------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_reduce_print (int yyrule)
+#else
+static void
+yy_reduce_print (yyrule)
+    int yyrule;
+#endif
+{
+  int yyi;
+  unsigned int yylineno = yyrline[yyrule];
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
+             yyrule - 1, yylineno);
+  /* Print the symbols being reduced, and their result.  */
+  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
+    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
+  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
+}
+
+# define YY_REDUCE_PRINT(Rule)		\
+do {					\
+  if (yydebug)				\
+    yy_reduce_print (Rule);		\
+} while (0)
+
+/* Nonzero means print parse trace.  It is left uninitialized so that
+   multiple parsers can coexist.  */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YYDSYMPRINT(Args)
+# define YYDSYMPRINTF(Title, Token, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks.  */
+#ifndef	YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+   if the built-in stack extension method is used).
+
+   Do not make this value too large; the results are undefined if
+   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+   evaluated with infinite-precision integer arithmetic.  */
+
+#if YYMAXDEPTH == 0
+# undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+#  if defined (__GLIBC__) && defined (_STRING_H)
+#   define yystrlen strlen
+#  else
+/* Return the length of YYSTR.  */
+static YYSIZE_T
+#   if defined (__STDC__) || defined (__cplusplus)
+yystrlen (const char *yystr)
+#   else
+yystrlen (yystr)
+     const char *yystr;
+#   endif
+{
+  register const char *yys = yystr;
+
+  while (*yys++ != '\0')
+    continue;
+
+  return yys - yystr - 1;
+}
+#  endif
+# endif
+
+# ifndef yystpcpy
+#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+#   define yystpcpy stpcpy
+#  else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+   YYDEST.  */
+static char *
+#   if defined (__STDC__) || defined (__cplusplus)
+yystpcpy (char *yydest, const char *yysrc)
+#   else
+yystpcpy (yydest, yysrc)
+     char *yydest;
+     const char *yysrc;
+#   endif
+{
+  register char *yyd = yydest;
+  register const char *yys = yysrc;
+
+  while ((*yyd++ = *yys++) != '\0')
+    continue;
+
+  return yyd - 1;
+}
+#  endif
+# endif
+
+#endif /* !YYERROR_VERBOSE */
+
+
+
+
+#if YYDEBUG
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yysymprint (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  /* Pacify ``unused variable'' warnings.  */
+  (void) yyvaluep;
+
+  if (yytype < YYNTOKENS)
+    {
+      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+# ifdef YYPRINT
+      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# endif
+    }
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  switch (yytype)
+    {
+      default:
+        break;
+    }
+  YYFPRINTF (yyoutput, ")");
+}
+
+#endif /* ! YYDEBUG */
+/*-----------------------------------------------.
+| Release the memory associated to this symbol.  |
+`-----------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yydestruct (int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yydestruct (yytype, yyvaluep)
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  /* Pacify ``unused variable'' warnings.  */
+  (void) yyvaluep;
+
+  switch (yytype)
+    {
+
+      default:
+        break;
+    }
+}
+
+
+
+/* Prevent warnings from -Wmissing-prototypes.  */
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM);
+# else
+int yyparse ();
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+
+/* The lookahead symbol.  */
+int yychar;
+
+/* The semantic value of the lookahead symbol.  */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far.  */
+int yynerrs;
+
+
+
+/*----------.
+| yyparse.  |
+`----------*/
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM)
+# else
+int yyparse (YYPARSE_PARAM)
+  void *YYPARSE_PARAM;
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int
+yyparse (void)
+#else
+int
+yyparse ()
+
+#endif
+#endif
+{
+  
+  register int yystate;
+  register int yyn;
+  int yyresult;
+  /* Number of tokens to shift before error messages enabled.  */
+  int yyerrstatus;
+  /* Lookahead token as an internal (translated) token number.  */
+  int yytoken = 0;
+
+  /* Three stacks and their tools:
+     `yyss': related to states,
+     `yyvs': related to semantic values,
+     `yyls': related to locations.
+
+     Refer to the stacks thru separate pointers, to allow yyoverflow
+     to reallocate them elsewhere.  */
+
+  /* The state stack.  */
+  short	yyssa[YYINITDEPTH];
+  short *yyss = yyssa;
+  register short *yyssp;
+
+  /* The semantic value stack.  */
+  YYSTYPE yyvsa[YYINITDEPTH];
+  YYSTYPE *yyvs = yyvsa;
+  register YYSTYPE *yyvsp;
+
+
+
+#define YYPOPSTACK   (yyvsp--, yyssp--)
+
+  YYSIZE_T yystacksize = YYINITDEPTH;
+
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
+
+  /* When reducing, the number of symbols on the RHS of the reduced
+     rule.  */
+  int yylen;
+
+  YYDPRINTF ((stderr, "Starting parse\n"));
+
+  yystate = 0;
+  yyerrstatus = 0;
+  yynerrs = 0;
+  yychar = YYEMPTY;		/* Cause a token to be read.  */
+
+  /* Initialize stack pointers.
+     Waste one element of value and location stack
+     so that they stay on the same level as the state stack.
+     The wasted elements are never initialized.  */
+
+  yyssp = yyss;
+  yyvsp = yyvs;
+
+  goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate.  |
+`------------------------------------------------------------*/
+ yynewstate:
+  /* In all cases, when you get here, the value and location stacks
+     have just been pushed. so pushing a state here evens the stacks.
+     */
+  yyssp++;
+
+ yysetstate:
+  *yyssp = yystate;
+
+  if (yyss + yystacksize - 1 <= yyssp)
+    {
+      /* Get the current used size of the three stacks, in elements.  */
+      YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+      {
+	/* Give user a chance to reallocate the stack. Use copies of
+	   these so that the &'s don't force the real ones into
+	   memory.  */
+	YYSTYPE *yyvs1 = yyvs;
+	short *yyss1 = yyss;
+
+
+	/* Each stack pointer address is followed by the size of the
+	   data in use in that stack, in bytes.  This used to be a
+	   conditional around just the two extra args, but that might
+	   be undefined if yyoverflow is a macro.  */
+	yyoverflow ("parser stack overflow",
+		    &yyss1, yysize * sizeof (*yyssp),
+		    &yyvs1, yysize * sizeof (*yyvsp),
+
+		    &yystacksize);
+
+	yyss = yyss1;
+	yyvs = yyvs1;
+      }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+      goto yyoverflowlab;
+# else
+      /* Extend the stack our own way.  */
+      if (YYMAXDEPTH <= yystacksize)
+	goto yyoverflowlab;
+      yystacksize *= 2;
+      if (YYMAXDEPTH < yystacksize)
+	yystacksize = YYMAXDEPTH;
+
+      {
+	short *yyss1 = yyss;
+	union yyalloc *yyptr =
+	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+	if (! yyptr)
+	  goto yyoverflowlab;
+	YYSTACK_RELOCATE (yyss);
+	YYSTACK_RELOCATE (yyvs);
+
+#  undef YYSTACK_RELOCATE
+	if (yyss1 != yyssa)
+	  YYSTACK_FREE (yyss1);
+      }
+# endif
+#endif /* no yyoverflow */
+
+      yyssp = yyss + yysize - 1;
+      yyvsp = yyvs + yysize - 1;
+
+
+      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+		  (unsigned long int) yystacksize));
+
+      if (yyss + yystacksize - 1 <= yyssp)
+	YYABORT;
+    }
+
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+  goto yybackup;
+
+/*-----------.
+| yybackup.  |
+`-----------*/
+yybackup:
+
+/* Do appropriate processing given the current state.  */
+/* Read a lookahead token if we need one and don't already have one.  */
+/* yyresume: */
+
+  /* First try to decide what to do without reference to lookahead token.  */
+
+  yyn = yypact[yystate];
+  if (yyn == YYPACT_NINF)
+    goto yydefault;
+
+  /* Not known => get a lookahead token if don't already have one.  */
+
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
+  if (yychar == YYEMPTY)
+    {
+      YYDPRINTF ((stderr, "Reading a token: "));
+      yychar = YYLEX;
+    }
+
+  if (yychar <= YYEOF)
+    {
+      yychar = yytoken = YYEOF;
+      YYDPRINTF ((stderr, "Now at end of input.\n"));
+    }
+  else
+    {
+      yytoken = YYTRANSLATE (yychar);
+      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
+    }
+
+  /* If the proper action on seeing token YYTOKEN is to reduce or to
+     detect an error, take that action.  */
+  yyn += yytoken;
+  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+    goto yydefault;
+  yyn = yytable[yyn];
+  if (yyn <= 0)
+    {
+      if (yyn == 0 || yyn == YYTABLE_NINF)
+	goto yyerrlab;
+      yyn = -yyn;
+      goto yyreduce;
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  /* Shift the lookahead token.  */
+  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
+
+  /* Discard the token being shifted unless it is eof.  */
+  if (yychar != YYEOF)
+    yychar = YYEMPTY;
+
+  *++yyvsp = yylval;
+
+
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state.  |
+`-----------------------------------------------------------*/
+yydefault:
+  yyn = yydefact[yystate];
+  if (yyn == 0)
+    goto yyerrlab;
+  goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction.  |
+`-----------------------------*/
+yyreduce:
+  /* yyn is the number of a rule to reduce with.  */
+  yylen = yyr2[yyn];
+
+  /* If YYLEN is nonzero, implement the default value of the action:
+     `$$ = $1'.
+
+     Otherwise, the following line sets YYVAL to garbage.
+     This behavior is undocumented and Bison
+     users should not rely upon it.  Assigning to YYVAL
+     unconditionally makes the parser a bit smaller, and it avoids a
+     GCC warning that YYVAL may be used uninitialized.  */
+  yyval = yyvsp[1-yylen];
+
+
+  YY_REDUCE_PRINT (yyn);
+  switch (yyn)
+    {
+        case 2:
+#line 74 "ts1.0_grammar.y"
+    {
+			yyvsp[0].instList->Validate();
+			yyvsp[0].instList->Invoke();
+		    delete yyvsp[0].instList;
+		;}
+    break;
+
+  case 3:
+#line 82 "ts1.0_grammar.y"
+    {
+		    *(yyvsp[-2].instList) += yyvsp[-1].inst;
+			delete yyvsp[-1].inst;
+		    yyval.instList = yyvsp[-2].instList;
+		;}
+    break;
+
+  case 4:
+#line 88 "ts1.0_grammar.y"
+    {
+		    InstListPtr instList = new InstList;
+		    *instList += yyvsp[-1].inst;
+			delete yyvsp[-1].inst;
+		    yyval.instList = instList;
+		;}
+    break;
+
+  case 5:
+#line 98 "ts1.0_grammar.y"
+    {
+			yyval.variable = new MappedVariable;
+			yyval.variable->var = yyvsp[-1].fval;
+			yyval.variable->expand = true;
+		;}
+    break;
+
+  case 6:
+#line 104 "ts1.0_grammar.y"
+    {
+			yyval.variable = new MappedVariable;
+			yyval.variable->var = yyvsp[0].fval;
+			yyval.variable->expand = false;
+		;}
+    break;
+
+  case 7:
+#line 112 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_NOP);
+		;}
+    break;
+
+  case 8:
+#line 116 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_TEXTURE_1D);
+		;}
+    break;
+
+  case 9:
+#line 120 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_TEXTURE_2D);
+		;}
+    break;
+
+  case 10:
+#line 124 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_TEXTURE_RECTANGLE);
+		;}
+    break;
+
+  case 11:
+#line 128 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_TEXTURE_3D);
+		;}
+    break;
+
+  case 12:
+#line 132 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_TEXTURE_CUBE_MAP);
+		;}
+    break;
+
+  case 13:
+#line 136 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_CULL_FRAGMENT, yyvsp[-7].fval, yyvsp[-5].fval, yyvsp[-3].fval, yyvsp[-1].fval);
+		;}
+    break;
+
+  case 14:
+#line 140 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_PASS_THROUGH);
+		;}
+    break;
+
+  case 15:
+#line 144 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_OFFSET_2D_SCALE, yyvsp[-13].fval, yyvsp[-11].fval, yyvsp[-9].fval, yyvsp[-7].fval, yyvsp[-5].fval, yyvsp[-3].fval, yyvsp[-1].fval);
+		;}
+    break;
+
+  case 16:
+#line 148 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_OFFSET_2D, yyvsp[-9].fval, yyvsp[-7].fval, yyvsp[-5].fval, yyvsp[-3].fval, yyvsp[-1].fval);
+		;}
+    break;
+
+  case 17:
+#line 152 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_OFFSET_RECTANGLE_SCALE, yyvsp[-13].fval, yyvsp[-11].fval, yyvsp[-9].fval, yyvsp[-7].fval, yyvsp[-5].fval, yyvsp[-3].fval, yyvsp[-1].fval);
+		;}
+    break;
+
+  case 18:
+#line 156 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_OFFSET_RECTANGLE, yyvsp[-9].fval, yyvsp[-7].fval, yyvsp[-5].fval, yyvsp[-3].fval, yyvsp[-1].fval);
+		;}
+    break;
+
+  case 19:
+#line 160 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DEPENDENT_AR, yyvsp[-1].fval);
+		;}
+    break;
+
+  case 20:
+#line 164 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DEPENDENT_GB, yyvsp[-1].fval);
+		;}
+    break;
+
+  case 21:
+#line 168 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_2D_1_OF_2, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 22:
+#line 173 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_2D_2_OF_2, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 23:
+#line 178 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_RECTANGLE_1_OF_2, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 24:
+#line 183 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_RECTANGLE_2_OF_2, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 25:
+#line 188 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_DEPTH_REPLACE_1_OF_2, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 26:
+#line 193 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_DEPTH_REPLACE_2_OF_2, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 27:
+#line 198 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_3D_1_OF_3, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 28:
+#line 203 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_3D_2_OF_3, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 29:
+#line 208 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_3D_3_OF_3, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 30:
+#line 213 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_1_OF_3, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 31:
+#line 218 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_2_OF_3, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 32:
+#line 223 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_3_OF_3, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 33:
+#line 228 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_EYE_FROM_QS_1_OF_3, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 34:
+#line 233 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_EYE_FROM_QS_2_OF_3, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 35:
+#line 238 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_EYE_FROM_QS_3_OF_3, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 36:
+#line 243 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_CONST_EYE_1_OF_3, yyvsp[-7].variable, yyvsp[-5].fval, yyvsp[-3].fval, yyvsp[-1].fval);
+			delete yyvsp[-7].variable;
+		;}
+    break;
+
+  case 37:
+#line 248 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_CONST_EYE_2_OF_3, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 38:
+#line 253 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_CONST_EYE_3_OF_3, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 39:
+#line 258 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_EYE_FROM_QS_1_OF_3, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 40:
+#line 263 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_EYE_FROM_QS_2_OF_3, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 41:
+#line 268 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_EYE_FROM_QS_3_OF_3, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 42:
+#line 273 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_CONST_EYE_1_OF_3, yyvsp[-7].variable, yyvsp[-5].fval, yyvsp[-3].fval, yyvsp[-1].fval);
+			delete yyvsp[-7].variable;
+		;}
+    break;
+
+  case 43:
+#line 278 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_CONST_EYE_2_OF_3, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 44:
+#line 283 "ts1.0_grammar.y"
+    {
+		    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_CONST_EYE_3_OF_3, yyvsp[-1].variable);
+			delete yyvsp[-1].variable;
+		;}
+    break;
+
+  case 45:
+#line 290 "ts1.0_grammar.y"
+    {
+			yyval.fval = yyvsp[0].fval;
+		;}
+    break;
+
+  case 46:
+#line 294 "ts1.0_grammar.y"
+    {
+			yyval.fval = yyvsp[0].fval;
+		;}
+    break;
+
+
+    }
+
+/* Line 999 of yacc.c.  */
+#line 1610 "_ts1.0_parser.c"
+
+
+  yyvsp -= yylen;
+  yyssp -= yylen;
+
+
+  YY_STACK_PRINT (yyss, yyssp);
+
+  *++yyvsp = yyval;
+
+
+  /* Now `shift' the result of the reduction.  Determine what state
+     that goes to, based on the state we popped back to and the rule
+     number reduced by.  */
+
+  yyn = yyr1[yyn];
+
+  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+    yystate = yytable[yystate];
+  else
+    yystate = yydefgoto[yyn - YYNTOKENS];
+
+  goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
+    {
+      ++yynerrs;
+#if YYERROR_VERBOSE
+      yyn = yypact[yystate];
+
+      if (YYPACT_NINF < yyn && yyn < YYLAST)
+	{
+	  YYSIZE_T yysize = 0;
+	  int yytype = YYTRANSLATE (yychar);
+	  char *yymsg;
+	  int yyx, yycount;
+
+	  yycount = 0;
+	  /* Start YYX at -YYN if negative to avoid negative indexes in
+	     YYCHECK.  */
+	  for (yyx = yyn < 0 ? -yyn : 0;
+	       yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
+	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+	      yysize += yystrlen (yytname[yyx]) + 15, yycount++;
+	  yysize += yystrlen ("syntax error, unexpected ") + 1;
+	  yysize += yystrlen (yytname[yytype]);
+	  yymsg = (char *) YYSTACK_ALLOC (yysize);
+	  if (yymsg != 0)
+	    {
+	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
+	      yyp = yystpcpy (yyp, yytname[yytype]);
+
+	      if (yycount < 5)
+		{
+		  yycount = 0;
+		  for (yyx = yyn < 0 ? -yyn : 0;
+		       yyx < (int) (sizeof (yytname) / sizeof (char *));
+		       yyx++)
+		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+		      {
+			const char *yyq = ! yycount ? ", expecting " : " or ";
+			yyp = yystpcpy (yyp, yyq);
+			yyp = yystpcpy (yyp, yytname[yyx]);
+			yycount++;
+		      }
+		}
+	      yyerror (yymsg);
+	      YYSTACK_FREE (yymsg);
+	    }
+	  else
+	    yyerror ("syntax error; also virtual memory exhausted");
+	}
+      else
+#endif /* YYERROR_VERBOSE */
+	yyerror ("syntax error");
+    }
+
+
+
+  if (yyerrstatus == 3)
+    {
+      /* If just tried and failed to reuse lookahead token after an
+	 error, discard it.  */
+
+      /* Return failure if at end of input.  */
+      if (yychar == YYEOF)
+        {
+	  /* Pop the error token.  */
+          YYPOPSTACK;
+	  /* Pop the rest of the stack.  */
+	  while (yyss < yyssp)
+	    {
+	      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+	      yydestruct (yystos[*yyssp], yyvsp);
+	      YYPOPSTACK;
+	    }
+	  YYABORT;
+        }
+
+      YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
+      yydestruct (yytoken, &yylval);
+      yychar = YYEMPTY;
+
+    }
+
+  /* Else will try to reuse lookahead token after shifting the error
+     token.  */
+  goto yyerrlab1;
+
+
+/*----------------------------------------------------.
+| yyerrlab1 -- error raised explicitly by an action.  |
+`----------------------------------------------------*/
+yyerrlab1:
+  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
+
+  for (;;)
+    {
+      yyn = yypact[yystate];
+      if (yyn != YYPACT_NINF)
+	{
+	  yyn += YYTERROR;
+	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+	    {
+	      yyn = yytable[yyn];
+	      if (0 < yyn)
+		break;
+	    }
+	}
+
+      /* Pop the current state because it cannot handle the error token.  */
+      if (yyssp == yyss)
+	YYABORT;
+
+      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+      yydestruct (yystos[yystate], yyvsp);
+      yyvsp--;
+      yystate = *--yyssp;
+
+      YY_STACK_PRINT (yyss, yyssp);
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  YYDPRINTF ((stderr, "Shifting error token, "));
+
+  *++yyvsp = yylval;
+
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here.  |
+`-------------------------------------*/
+yyacceptlab:
+  yyresult = 0;
+  goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here.  |
+`-----------------------------------*/
+yyabortlab:
+  yyresult = 1;
+  goto yyreturn;
+
+#ifndef yyoverflow
+/*----------------------------------------------.
+| yyoverflowlab -- parser overflow comes here.  |
+`----------------------------------------------*/
+yyoverflowlab:
+  yyerror ("parser stack overflow");
+  yyresult = 2;
+  /* Fall through.  */
+#endif
+
+yyreturn:
+#ifndef yyoverflow
+  if (yyss != yyssa)
+    YYSTACK_FREE (yyss);
+#endif
+  return yyresult;
+}
+
+
+#line 300 "ts1.0_grammar.y"
+
+void yyerror(char* s)
+{
+     errors.set("unrecognized token");
+}
+
Index: /RenderSystems/GL/src/nvparse/_ts1.0_parser.h
===================================================================
--- /RenderSystems/GL/src/nvparse/_ts1.0_parser.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/_ts1.0_parser.h	(revision 5)
@@ -0,0 +1,178 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/* A Bison parser, made by GNU Bison 1.875.  */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     floatValue = 258,
+     gequal = 259,
+     less = 260,
+     texVariable = 261,
+     expandString = 262,
+     openParen = 263,
+     closeParen = 264,
+     semicolon = 265,
+     comma = 266,
+     nop = 267,
+     texture_1d = 268,
+     texture_2d = 269,
+     texture_rectangle = 270,
+     texture_3d = 271,
+     texture_cube_map = 272,
+     cull_fragment = 273,
+     pass_through = 274,
+     offset_2d_scale = 275,
+     offset_2d = 276,
+     offset_rectangle_scale = 277,
+     offset_rectangle = 278,
+     dependent_ar = 279,
+     dependent_gb = 280,
+     dot_product_2d_1of2 = 281,
+     dot_product_2d_2of2 = 282,
+     dot_product_rectangle_1of2 = 283,
+     dot_product_rectangle_2of2 = 284,
+     dot_product_depth_replace_1of2 = 285,
+     dot_product_depth_replace_2of2 = 286,
+     dot_product_3d_1of3 = 287,
+     dot_product_3d_2of3 = 288,
+     dot_product_3d_3of3 = 289,
+     dot_product_cube_map_1of3 = 290,
+     dot_product_cube_map_2of3 = 291,
+     dot_product_cube_map_3of3 = 292,
+     dot_product_reflect_cube_map_eye_from_qs_1of3 = 293,
+     dot_product_reflect_cube_map_eye_from_qs_2of3 = 294,
+     dot_product_reflect_cube_map_eye_from_qs_3of3 = 295,
+     dot_product_reflect_cube_map_const_eye_1of3 = 296,
+     dot_product_reflect_cube_map_const_eye_2of3 = 297,
+     dot_product_reflect_cube_map_const_eye_3of3 = 298,
+     dot_product_cube_map_and_reflect_cube_map_eye_from_qs_1of3 = 299,
+     dot_product_cube_map_and_reflect_cube_map_eye_from_qs_2of3 = 300,
+     dot_product_cube_map_and_reflect_cube_map_eye_from_qs_3of3 = 301,
+     dot_product_cube_map_and_reflect_cube_map_const_eye_1of3 = 302,
+     dot_product_cube_map_and_reflect_cube_map_const_eye_2of3 = 303,
+     dot_product_cube_map_and_reflect_cube_map_const_eye_3of3 = 304
+   };
+#endif
+#define floatValue 258
+#define gequal 259
+#define less 260
+#define texVariable 261
+#define expandString 262
+#define openParen 263
+#define closeParen 264
+#define semicolon 265
+#define comma 266
+#define nop 267
+#define texture_1d 268
+#define texture_2d 269
+#define texture_rectangle 270
+#define texture_3d 271
+#define texture_cube_map 272
+#define cull_fragment 273
+#define pass_through 274
+#define offset_2d_scale 275
+#define offset_2d 276
+#define offset_rectangle_scale 277
+#define offset_rectangle 278
+#define dependent_ar 279
+#define dependent_gb 280
+#define dot_product_2d_1of2 281
+#define dot_product_2d_2of2 282
+#define dot_product_rectangle_1of2 283
+#define dot_product_rectangle_2of2 284
+#define dot_product_depth_replace_1of2 285
+#define dot_product_depth_replace_2of2 286
+#define dot_product_3d_1of3 287
+#define dot_product_3d_2of3 288
+#define dot_product_3d_3of3 289
+#define dot_product_cube_map_1of3 290
+#define dot_product_cube_map_2of3 291
+#define dot_product_cube_map_3of3 292
+#define dot_product_reflect_cube_map_eye_from_qs_1of3 293
+#define dot_product_reflect_cube_map_eye_from_qs_2of3 294
+#define dot_product_reflect_cube_map_eye_from_qs_3of3 295
+#define dot_product_reflect_cube_map_const_eye_1of3 296
+#define dot_product_reflect_cube_map_const_eye_2of3 297
+#define dot_product_reflect_cube_map_const_eye_3of3 298
+#define dot_product_cube_map_and_reflect_cube_map_eye_from_qs_1of3 299
+#define dot_product_cube_map_and_reflect_cube_map_eye_from_qs_2of3 300
+#define dot_product_cube_map_and_reflect_cube_map_eye_from_qs_3of3 301
+#define dot_product_cube_map_and_reflect_cube_map_const_eye_1of3 302
+#define dot_product_cube_map_and_reflect_cube_map_const_eye_2of3 303
+#define dot_product_cube_map_and_reflect_cube_map_const_eye_3of3 304
+
+
+
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#line 18 "ts1.0_grammar.y"
+typedef union YYSTYPE {
+  float fval;
+  InstPtr inst;
+  InstListPtr instList;
+  MappedVariablePtr variable;
+} YYSTYPE;
+/* Line 1240 of yacc.c.  */
+#line 141 "_ts1.0_parser.h"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+extern YYSTYPE ts10_lval;
+
+
+
Index: /RenderSystems/GL/src/nvparse/_vs1.0_lexer.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/_vs1.0_lexer.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/_vs1.0_lexer.cpp	(revision 5)
@@ -0,0 +1,5032 @@
+#include <ctype.h>
+
+#define yy_create_buffer vs10__create_buffer
+#define yy_delete_buffer vs10__delete_buffer
+#define yy_scan_buffer vs10__scan_buffer
+#define yy_scan_string vs10__scan_string
+#define yy_scan_bytes vs10__scan_bytes
+#define yy_flex_debug vs10__flex_debug
+#define yy_init_buffer vs10__init_buffer
+#define yy_flush_buffer vs10__flush_buffer
+#define yy_load_buffer_state vs10__load_buffer_state
+#define yy_switch_to_buffer vs10__switch_to_buffer
+#define yyin vs10_in
+#define yyleng vs10_leng
+#define yylex vs10_lex
+#define yyout vs10_out
+#define yyrestart vs10_restart
+#define yytext vs10_text
+#define yywrap vs10_wrap
+
+#line 20 "_vs1.0_lexer.cpp"
+/* A lexical scanner generated by flex */
+
+/* Scanner skeleton version:
+ * $Header: /cvsroot/ogre/ogrenew/RenderSystems/GL/src/nvparse/_vs1.0_lexer.cpp,v 1.4 2005/11/10 07:24:20 nfz Exp $
+ */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+
+#include <stdio.h>
+#include <unistd.h>
+
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+#include <stdlib.h>
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else	/* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_PROTOS
+#define YY_USE_CONST
+
+#endif	/* __STDC__ */
+#endif	/* ! __cplusplus */
+
+#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include <io.h>
+#include <stdlib.h>
+#define YY_USE_CONST
+#define YY_USE_PROTOS
+#endif
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index.  If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition.  This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.  The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#define YY_BUF_SIZE 16384
+
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+extern int yyleng;
+extern FILE *yyin, *yyout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+/* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator).  This
+ * avoids problems with code like:
+ *
+ * 	if ( condition_holds )
+ *		yyless( 5 );
+ *	else
+ *		do_something_else();
+ *
+ * Prior to using the do-while the compiler would get upset at the
+ * "else" because it interpreted the "if" statement as being all
+ * done when it reached the ';' after the yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+		*yy_cp = yy_hold_char; \
+		YY_RESTORE_YY_MORE_OFFSET \
+		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+		} \
+	while ( 0 )
+
+#define unput(c) yyunput( c, yytext_ptr )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+typedef unsigned int yy_size_t;
+
+
+struct yy_buffer_state
+	{
+	FILE *yy_input_file;
+
+	char *yy_ch_buf;		/* input buffer */
+	char *yy_buf_pos;		/* current position in input buffer */
+
+	/* Size of input buffer in bytes, not including room for EOB
+	 * characters.
+	 */
+	yy_size_t yy_buf_size;
+
+	/* Number of characters read into yy_ch_buf, not including EOB
+	 * characters.
+	 */
+	int yy_n_chars;
+
+	/* Whether we "own" the buffer - i.e., we know we created it,
+	 * and can realloc() it to grow it, and should free() it to
+	 * delete it.
+	 */
+	int yy_is_our_buffer;
+
+	/* Whether this is an "interactive" input source; if so, and
+	 * if we're using stdio for input, then we want to use getc()
+	 * instead of fread(), to make sure we stop fetching input after
+	 * each newline.
+	 */
+	int yy_is_interactive;
+
+	/* Whether we're considered to be at the beginning of a line.
+	 * If so, '^' rules will be active on the next match, otherwise
+	 * not.
+	 */
+	int yy_at_bol;
+
+	/* Whether to try to fill the input buffer when we reach the
+	 * end of it.
+	 */
+	int yy_fill_buffer;
+
+	int yy_buffer_status;
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+	/* When an EOF's been seen but there's still some text to process
+	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+	 * shouldn't try reading from the input source any more.  We might
+	 * still have a bunch of tokens to match, though, because of
+	 * possible backing-up.
+	 *
+	 * When we actually see the EOF, we change the status to "new"
+	 * (via yyrestart()), so that the user can continue scanning by
+	 * just pointing yyin at a new input file.
+	 */
+#define YY_BUFFER_EOF_PENDING 2
+	};
+
+static YY_BUFFER_STATE yy_current_buffer = 0;
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ */
+#define YY_CURRENT_BUFFER yy_current_buffer
+
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+
+static int yy_n_chars;		/* number of characters read into yy_ch_buf */
+
+
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1;		/* whether we need to initialize */
+static int yy_start = 0;	/* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin.  A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart YY_PROTO(( FILE *input_file ));
+
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+void yy_load_buffer_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+static void yy_flex_free YY_PROTO(( void * ));
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+	{ \
+	if ( ! yy_current_buffer ) \
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+	yy_current_buffer->yy_is_interactive = is_interactive; \
+	}
+
+#define yy_set_bol(at_bol) \
+	{ \
+	if ( ! yy_current_buffer ) \
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+	yy_current_buffer->yy_at_bol = at_bol; \
+	}
+
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+
+#define YY_USES_REJECT
+typedef unsigned char YY_CHAR;
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+typedef int yy_state_type;
+extern char *yytext;
+#define yytext_ptr yytext
+
+static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+static int yy_get_next_buffer YY_PROTO(( void ));
+static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+	yytext_ptr = yy_bp; \
+	yyleng = (int) (yy_cp - yy_bp); \
+	yy_hold_char = *yy_cp; \
+	*yy_cp = '\0'; \
+	yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 72
+#define YY_END_OF_BUFFER 73
+static yyconst short int yy_acclist[406] =
+    {   0,
+        2,    2,   56,   56,   46,   46,   31,   31,   29,   29,
+       73,   69,   71,   72,   64,   69,   71,   72,   66,   69,
+       72,   71,   72,   71,   72,   63,   71,   72,   63,   71,
+       72,   37,   63,   71,   72,   63,   71,   72,   36,   71,
+       72,   13,   71,   72,   62,   71,   72,   62,   63,   71,
+       72,   62,   71,   72,   62,   71,   72,   62,   71,   72,
+       62,   71,   72,   62,   71,   72,   64,   69,   71,   72,
+       16,   63,   71,   72,   72,   72,   22,   65,   72,   21,
+       72,   23,   72,   72,   34,   72,   72,   20,   72,   68,
+       70,   72,   68,   72,   70,   72,   67,   70,   72,    2,
+
+       72,    1,   72,   41,   72,   41,   42,   72,   56,   72,
+       56,   72,   57,   72,   56,   72,   56,   72,   56,   72,
+       50,   72,   46,   50,   72,   49,   72,   48,   72,   50,
+       72,   47,   50,   72,   72,   72,   59,   72,   72,   72,
+       61,   72,   72,   40,   72,   40,   62,   72,   39,   40,
+       62,   72,   45,   72,   44,   45,   72,   43,   45,   72,
+       72,   27,   72,   31,   72,   31,   72,   32,   72,   31,
+       72,   29,   72,   30,   72,   51,   72,   64,   15,   17,
+       14,   36,   13,   62,   62,    3,   62,    6,   62,   62,
+       62,   62,   62,    5,   62,    4,   62,   62,   64,   16,
+
+       16,   19,   34,   20,   67,    2,    1,   41,   56,   56,
+       56,   56,   17,   56,   56,   54,   56,   50,   46,   50,
+       47,   50,   47,   50,   47,   59,   61,   60,   61,   39,
+       39,   39,   62,   44,   27,   31,   31,   31,   31,   29,
+       51,   53,   51,   51,   14,   12,   12,   62,    3,   12,
+        3,   12,    6,   12,    6,   12,    8,   62,   62,   62,
+       62,    7,   62,    5,   12,    5,   12,    4,   12,    4,
+       12,   16,   56,   39,   62,   31,   31,   31,   52,    3,
+        3,    6,    6,    8,   12,    8,   12,    9,   62,   10,
+       62,   11,   62,    7,   12,    7,   12,    5,    5,    4,
+
+        4,   55,   56,   38,   39,   62,   31,   31,   26,    8,
+        8,    9,   12,    9,   12,   10,   12,   10,   12,   11,
+       12,   11,   12,    7,    7,   55,   56,   56,   55,   56,
+       58,   59,   38,   39,   38,   39,   26,   31,   31,   26,
+       26,   28,    9,    9,   10,   10,   11,   11,   35,   55,
+       56,   55,   56,   55,   56,   55,   56,   26,   31,   31,
+       26,   31,   28,   31,   26,   26,   26,   28,   28,   24,
+       35,   35,   55,   56,   55,   56,   26,   31,   26,   31,
+       26,   31,   28,   31,   31,   28,   31,   33,   26,   28,
+       28,   28,   25,   26,   31,   28,   31,   28,   31,   28,
+
+       31,   28,   18,   28,   31
+    } ;
+
+static yyconst short int yy_accept[330] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    2,    3,    3,
+        3,    4,    5,    6,    7,    7,    7,    7,    7,    7,
+        7,    7,    7,    7,    7,    8,    9,   10,   11,   11,
+       11,   12,   15,   19,   22,   24,   26,   29,   32,   36,
+       39,   42,   45,   48,   52,   55,   58,   61,   64,   67,
+       71,   75,   76,   77,   80,   82,   84,   85,   87,   88,
+       90,   93,   95,   97,  100,  102,  104,  106,  109,  111,
+      113,  115,  117,  119,  121,  123,  126,  128,  130,  132,
+      135,  136,  137,  139,  140,  141,  143,  144,  146,  149,
+
+      153,  155,  158,  161,  162,  164,  166,  168,  170,  172,
+      174,  176,  178,  179,  179,  179,  179,  179,  179,  180,
+      181,  182,  183,  184,  185,  186,  188,  190,  191,  192,
+      193,  194,  196,  198,  199,  200,  201,  202,  202,  203,
+      203,  204,  204,  205,  206,  207,  208,  209,  210,  211,
+      212,  213,  215,  216,  217,  218,  219,  221,  223,  225,
+      226,  226,  227,  227,  227,  227,  227,  228,  228,  230,
+      231,  232,  234,  235,  235,  236,  237,  238,  239,  240,
+      241,  243,  244,  244,  244,  245,  245,  245,  245,  245,
+      245,  245,  246,  247,  249,  251,  253,  255,  257,  259,
+
+      260,  261,  262,  264,  266,  268,  270,  272,  272,  273,
+      274,  274,  276,  277,  278,  279,  279,  280,  280,  280,
+      280,  280,  280,  280,  281,  282,  283,  284,  286,  288,
+      290,  292,  294,  296,  298,  299,  300,  301,  302,  302,
+      304,  304,  307,  308,  309,  309,  310,  310,  310,  310,
+      310,  311,  312,  314,  316,  318,  320,  322,  324,  325,
+      326,  326,  328,  329,  331,  331,  333,  335,  337,  339,
+      340,  340,  341,  341,  342,  343,  343,  343,  343,  344,
+      345,  346,  347,  348,  349,  350,  352,  354,  356,  358,
+      360,  361,  363,  365,  365,  366,  367,  368,  369,  369,
+
+      370,  371,  371,  371,  372,  373,  375,  377,  379,  381,
+      383,  385,  386,  388,  389,  390,  391,  392,  393,  394,
+      394,  396,  398,  400,  402,  403,  404,  406,  406
+    } ;
+
+static yyconst int yy_ec[256] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2,    4,    4,    5,    4,    6,    4,    4,    7,
+        8,    9,   10,   11,    6,   12,   13,   14,   14,   14,
+       14,   14,   14,   14,   14,   14,   14,    4,   15,    6,
+        4,    6,    4,    4,   16,   16,   16,   17,   16,   18,
+       16,   16,   16,   16,   16,   16,   16,   16,   16,   19,
+       16,   16,   16,   20,   16,   16,   16,   16,   16,   16,
+        6,   21,    6,    4,   22,    4,   23,   16,   24,   25,
+
+       26,   27,   28,   16,   29,   16,   16,   30,   31,   32,
+       33,   16,   16,   34,   35,   36,   37,   38,   39,   39,
+       39,   39,    4,    4,    4,    4,    4,    4,    4,    4,
+        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
+        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
+        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
+        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
+        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
+        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
+        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
+
+        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
+        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
+        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
+        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
+        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
+        4,    4,    4,    4,    4
+    } ;
+
+static yyconst int yy_meta[40] =
+    {   0,
+        1,    2,    3,    1,    1,    1,    2,    1,    1,    1,
+        4,    1,    1,    5,    1,    5,    5,    5,    5,    5,
+        1,    5,    5,    5,    5,    5,    5,    5,    5,    5,
+        5,    5,    5,    5,    5,    5,    5,    5,    5
+    } ;
+
+static yyconst short int yy_base[369] =
+    {   0,
+        0,   38,  764,  763,  761,  760,  759,  758,  757,  756,
+      755,  754,  753,  752,   48,   69,  751,  750,   39,   84,
+       86,   90,   93,  107,   41,   95,   44,   80,  122,    0,
+      112,  160,  749,  748,  163,  167,  747,  746,  740,  739,
+      746,  767,  100,  767,  767,  148,  767,  173,  767,   53,
+      731,    0,  722,    0,  157,  164,  163,  170,  173,  186,
+      187,  740,  767,  767,  767,  767,  739,  767,  738,  767,
+      767,  767,  767,    0,  737,  767,    0,    0,  718,  191,
+      767,  185,  195,  178,    0,  736,  767,  767,  724,  725,
+      732,  198,  767,  199,  200,  767,  201,  767,    0,  211,
+
+      767,  732,  767,  730,  767,    0,  213,  767,  706,    0,
+      767,  217,  221,  705,  704,  175,  201,  232,  767,  767,
+        0,  715,    0,  234,    0,  237,  239,  241,  243,  245,
+      255,  268,  270,  277,  281,  726,  272,  724,  767,  723,
+      767,  722,  767,    0,  721,  767,    0,  702,  285,  283,
+      228,  701,  291,  767,   43,    0,  719,  709,  708,    0,
+      715,  767,  293,  222,  295,  206,  767,  208,  767,  298,
+      767,  300,  715,  713,  767,    0,  303,  689,  232,    0,
+      308,  711,  700,  709,  294,  679,  683,  674,  683,  282,
+      683,    0,  767,    0,  314,  767,  322,  767,  324,  328,
+
+      330,  332,  339,  334,  767,  341,  767,  692,  703,  297,
+       82,  345,  672,  668,  675,  692,  767,  661,  659,  651,
+      644,  640,  630,  355,  767,  357,  767,  360,  767,  366,
+      368,  370,  372,  767,  374,  767,  376,  767,  254,  378,
+      379,  383,  629,  606,  599,  381,  603,  598,  593,  558,
+      395,  767,  398,  767,  400,  767,  402,  767,  404,  767,
+      502,  406,  374,  396,  410,  767,  412,  767,  416,  453,
+      439,  420,  445,  336,  421,  452,  423,  395,  422,  767,
+      435,  767,  437,  767,  439,  430,  431,  434,  454,  446,
+      403,  351,  458,  408,  413,  417,  449,  461,  376,  453,
+
+      353,  343,  314,  475,  767,  466,  480,  457,  471,  475,
+      483,  309,  476,  311,  479,  484,  487,  490,  250,  162,
+      491,  494,  495,  498,  499,  115,  502,  767,  517,  522,
+      527,  532,  537,  542,  547,  552,  557,  562,  567,  572,
+      577,  582,  587,  592,   95,   89,  597,  602,  607,   40,
+      612,  617,  622,  627,  632,  637,  642,  647,  652,  657,
+      662,  667,  672,  677,  682,  687,  692,  697
+    } ;
+
+static yyconst short int yy_def[369] =
+    {   0,
+      328,    1,  329,  329,  330,  330,  330,  330,  330,  330,
+      331,  331,  332,  332,  333,  333,  334,  334,  335,  335,
+      336,  336,  337,  337,  338,  338,  339,  339,  328,   29,
+      340,  340,  341,  341,  342,  342,  343,  343,  330,  330,
+      328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
+      328,  344,  345,  346,  345,  345,  345,  345,  345,  328,
+      328,  347,  328,  328,  328,  328,  348,  328,  349,  328,
+      328,  328,  328,  350,  351,  328,  352,  352,  353,  353,
+      328,  353,  353,  353,  354,  354,  328,  328,  354,  355,
+      356,  356,  328,  356,  357,  328,  357,  328,  346,  346,
+
+      328,  328,  328,  358,  328,  359,  359,  328,  359,  360,
+      328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
+      361,  328,  344,  345,  346,  345,  345,  345,  345,  345,
+      345,  345,  345,  345,  328,  328,  328,  347,  328,  348,
+      328,  349,  328,  350,  351,  328,  352,  353,  353,  353,
+      353,  353,  353,  328,  353,  354,  354,  355,  355,  362,
+      356,  328,  356,  356,  356,  357,  328,  357,  328,  328,
+      328,  346,  328,  358,  328,  359,  359,  359,  359,  360,
+      328,  328,  328,  363,  328,  328,  328,  328,  328,  328,
+      328,  361,  328,  346,  328,  328,  328,  328,  345,  345,
+
+      345,  345,  345,  328,  328,  328,  328,  328,  328,  353,
+      356,  346,  359,  359,  359,  363,  328,  328,  328,  328,
+      328,  328,  328,  328,  328,  328,  328,  328,  328,  345,
+      345,  345,  328,  328,  328,  328,  328,  328,  328,  353,
+      356,  346,  359,  359,  328,  328,  328,  328,  328,  328,
+      328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
+      328,  353,  353,  364,  356,  328,  328,  328,  359,  359,
+      328,  328,  328,  365,  328,  328,  328,  328,  328,  328,
+      328,  328,  328,  328,  328,  364,  364,  364,  364,  359,
+      359,  366,  359,  328,  365,  365,  365,  328,  328,  367,
+
+      328,  328,  328,  328,  328,  364,  364,  366,  366,  366,
+      359,  359,  368,  328,  365,  367,  367,  367,  328,  328,
+      366,  368,  368,  368,  367,  328,  368,    0,  328,  328,
+      328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
+      328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
+      328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
+      328,  328,  328,  328,  328,  328,  328,  328
+    } ;
+
+static yyconst short int yy_nxt[807] =
+    {   0,
+       42,   43,   44,   45,   46,   47,   47,   47,   47,   48,
+       47,   49,   50,   51,   52,   53,   53,   53,   53,   53,
+       45,   54,   55,   56,   53,   53,   53,   53,   53,   53,
+       53,   53,   57,   58,   53,   53,   53,   59,   53,   60,
+       63,   78,   92,   93,  144,   63,   96,   61,   71,   71,
+       72,   73,   73,   73,   73,   73,   73,   73,   73,   73,
+       73,  120,   73,  149,   97,  121,   94,  210,   73,   71,
+       71,   72,   73,   73,   73,   73,   73,   73,   73,   73,
+       73,   73,   96,   73,  162,   63,   78,   80,   81,   73,
+       63,   80,   81,  125,   86,   87,   92,   93,   82,  124,
+
+       97,  113,   82,   88,  114,   89,   83,   90,   86,   87,
+       83,   84,  241,  102,   63,   84,  326,   88,  103,   89,
+       94,   90,   98,   98,   63,   98,   98,   98,   98,   98,
+       98,   98,   98,   98,   98,   98,   98,   99,   99,   99,
+       99,   99,   98,   99,   99,   99,   99,   99,   99,   99,
+       99,   99,   99,   99,   99,   99,   99,   99,   99,   99,
+      100,  102,   63,  326,  107,  108,  103,  109,  107,  108,
+      126,  109,  115,  116,  118,  119,  117,  127,  125,  128,
+      129,  130,  131,  132,  125,  125,  133,  135,  137,  119,
+      114,  125,  150,  152,  125,  136,  153,  154,  149,  163,
+
+      162,  162,  167,  169,  188,  149,  189,  134,  167,  155,
+      169,  149,  170,  171,  177,  149,  151,  178,  181,  182,
+      168,  168,  113,  164,  162,  114,  168,  190,  168,  183,
+      165,  184,  191,  118,  119,  193,  193,  185,  195,  196,
+      197,  198,  193,  193,  193,  193,  193,  193,  149,  172,
+      126,  319,  127,  165,  199,  194,  193,  193,  194,  155,
+      194,  214,  194,  215,  194,  261,  194,  239,  203,  204,
+      205,  206,  207,  137,  119,  200,  194,  201,  193,  193,
+      202,  132,  135,  133,  150,  114,  153,  154,  208,  194,
+      136,  194,  153,  154,  163,  162,  182,  162,  194,  170,
+
+      171,  170,  171,  149,  177,  149,  221,  178,  151,  181,
+      182,  149,  314,  222,  185,  224,  225,  149,  164,  211,
+      183,  313,  184,  226,  227,  228,  229,  240,  185,  193,
+      193,  193,  193,  193,  193,  235,  236,  199,  212,  320,
+      233,  234,  237,  238,  319,  194,  170,  171,  296,  194,
+      297,  194,  203,  194,  301,  230,  224,  225,  226,  227,
+      194,  251,  252,  309,  231,  310,  232,  253,  254,  255,
+      256,  257,  258,  259,  260,  235,  236,  237,  238,  262,
+      265,  266,  272,  242,  267,  268,  264,  194,  300,  194,
+      263,  194,  264,  273,  149,  274,  251,  252,  149,  279,
+
+      280,  281,  282,  283,  284,  259,  260,  262,  287,  314,
+      288,  265,  266,  267,  268,  292,  289,  290,  263,  303,
+      264,  272,  298,  279,  280,  296,  149,  297,  291,  315,
+      292,  297,  273,  299,  274,  300,  281,  282,  283,  284,
+      304,  305,  287,  306,  288,  288,  287,  290,  288,  302,
+      289,  289,  285,  301,  289,  307,  154,  274,  291,  311,
+      292,  296,  298,  297,  294,  317,  287,  318,  288,  309,
+      312,  310,  313,  299,  289,  300,  304,  305,  306,  293,
+      288,  307,  154,  321,  311,  310,  289,  309,  323,  310,
+      324,  315,  287,  297,  288,  312,  317,  313,  318,  325,
+
+      289,  318,  317,  321,  318,  310,  323,  327,  324,  324,
+      323,  325,  324,  318,  327,  285,  324,   62,   62,   62,
+       62,   62,   63,   63,   63,   63,   63,   67,   67,   67,
+       67,   67,   69,   69,   69,   69,   69,   74,   74,   74,
+       74,   74,   75,   75,   75,   75,   75,   77,   77,   77,
+       77,   77,   79,   79,   79,   79,   79,   85,   85,   85,
+       85,   85,   91,   91,   91,   91,   91,   95,   95,   95,
+       95,   95,  101,  101,  101,  101,  101,  104,  104,  104,
+      104,  104,  106,  106,  106,  106,  106,  110,  110,  110,
+      110,  110,  123,  123,  278,  123,  123,  138,  138,  138,
+
+      138,  138,  140,  140,  140,  140,  140,  142,  142,  142,
+      142,  142,  145,  145,  145,  145,  145,  147,  277,  147,
+      147,  147,  148,  148,  276,  148,  148,  156,  156,  275,
+      271,  156,  159,  159,  270,  159,  159,  161,  161,  161,
+      161,  161,  166,  166,  166,  166,  166,  174,  174,  174,
+      174,  174,  176,  176,  269,  176,  176,  180,  180,  250,
+      180,  180,  192,  192,  249,  192,  192,  160,  160,  248,
+      160,  160,  216,  216,  216,  216,  216,  286,  286,  247,
+      286,  286,  295,  295,  246,  295,  295,  308,  308,  245,
+      308,  308,  316,  316,  217,  316,  316,  322,  322,  244,
+
+      322,  322,  243,  215,  209,  239,  223,  220,  219,  218,
+      189,  217,  184,  182,  213,  175,  173,  162,  160,  160,
+      157,  149,  149,  146,  143,  141,  139,  209,  122,  187,
+      186,  179,  175,  173,  162,  160,  158,  157,  149,  146,
+      143,  141,  139,  125,  122,  328,  112,  112,  111,  111,
+      105,  105,   76,   76,   70,   70,   68,   68,   66,   66,
+       65,   65,   64,   64,   63,   63,   41,  328,  328,  328,
+      328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
+      328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
+      328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
+
+      328,  328,  328,  328,  328,  328
+    } ;
+
+static yyconst short int yy_chk[807] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    2,
+       19,   19,   25,   25,  350,   19,   27,    2,   15,   15,
+       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
+       15,   50,   15,  155,   27,   50,   25,  155,   15,   16,
+       16,   16,   16,   16,   16,   16,   16,   16,   16,   16,
+       16,   16,   28,   16,  211,   20,   20,   21,   21,   16,
+       20,   22,   22,  346,   23,   23,   26,   26,   21,  345,
+
+       28,   43,   22,   23,   43,   23,   21,   23,   24,   24,
+       22,   21,  211,   31,   31,   22,  326,   24,   31,   24,
+       26,   24,   29,   29,   29,   29,   29,   29,   29,   29,
+       29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
+       29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
+       29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
+       29,   32,   32,  320,   35,   35,   32,   35,   36,   36,
+       55,   36,   46,   46,   48,   48,   46,   56,   55,   57,
+       57,   57,   57,   58,   57,   56,   59,   60,   61,   61,
+       60,   58,   80,   82,   59,   60,   83,   83,   84,   92,
+
+       92,   94,   95,   97,  116,   82,  116,   59,  166,   84,
+      168,   80,  100,  100,  107,   83,   80,  107,  112,  112,
+       95,   97,  113,   92,  164,  113,  166,  117,  168,  112,
+       94,  112,  117,  118,  118,  124,  124,  112,  126,  126,
+      127,  127,  128,  128,  129,  129,  130,  130,  151,  100,
+      126,  319,  127,  164,  128,  124,  131,  131,  126,  151,
+      127,  179,  128,  179,  129,  239,  130,  239,  131,  132,
+      132,  133,  133,  137,  137,  129,  131,  130,  134,  134,
+      130,  132,  135,  133,  150,  135,  149,  149,  134,  132,
+      135,  133,  153,  153,  163,  163,  185,  165,  134,  170,
+
+      170,  172,  172,  150,  177,  149,  190,  177,  150,  181,
+      181,  153,  314,  190,  185,  195,  195,  210,  163,  165,
+      181,  312,  181,  197,  197,  199,  199,  210,  181,  200,
+      200,  201,  201,  202,  202,  204,  204,  199,  172,  303,
+      203,  203,  206,  206,  302,  199,  212,  212,  274,  200,
+      274,  201,  203,  202,  301,  200,  224,  224,  226,  226,
+      203,  228,  228,  292,  201,  292,  202,  230,  230,  231,
+      231,  232,  232,  233,  233,  235,  235,  237,  237,  240,
+      241,  241,  246,  212,  242,  242,  263,  230,  299,  231,
+      240,  232,  240,  246,  263,  246,  251,  251,  240,  253,
+
+      253,  255,  255,  257,  257,  259,  259,  262,  264,  294,
+      264,  265,  265,  267,  267,  291,  264,  269,  262,  278,
+      262,  272,  275,  279,  279,  295,  262,  295,  269,  296,
+      269,  296,  272,  275,  272,  275,  281,  281,  283,  283,
+      285,  285,  286,  287,  286,  287,  288,  290,  288,  277,
+      286,  287,  285,  276,  288,  289,  289,  273,  290,  293,
+      290,  297,  298,  297,  271,  300,  289,  300,  289,  308,
+      293,  308,  293,  298,  289,  298,  304,  304,  306,  270,
+      306,  307,  307,  309,  311,  309,  306,  310,  313,  310,
+      313,  315,  307,  315,  307,  311,  316,  311,  316,  317,
+
+      307,  317,  318,  321,  318,  321,  322,  323,  322,  323,
+      324,  325,  324,  325,  327,  261,  327,  329,  329,  329,
+      329,  329,  330,  330,  330,  330,  330,  331,  331,  331,
+      331,  331,  332,  332,  332,  332,  332,  333,  333,  333,
+      333,  333,  334,  334,  334,  334,  334,  335,  335,  335,
+      335,  335,  336,  336,  336,  336,  336,  337,  337,  337,
+      337,  337,  338,  338,  338,  338,  338,  339,  339,  339,
+      339,  339,  340,  340,  340,  340,  340,  341,  341,  341,
+      341,  341,  342,  342,  342,  342,  342,  343,  343,  343,
+      343,  343,  344,  344,  250,  344,  344,  347,  347,  347,
+
+      347,  347,  348,  348,  348,  348,  348,  349,  349,  349,
+      349,  349,  351,  351,  351,  351,  351,  352,  249,  352,
+      352,  352,  353,  353,  248,  353,  353,  354,  354,  247,
+      245,  354,  355,  355,  244,  355,  355,  356,  356,  356,
+      356,  356,  357,  357,  357,  357,  357,  358,  358,  358,
+      358,  358,  359,  359,  243,  359,  359,  360,  360,  223,
+      360,  360,  361,  361,  222,  361,  361,  362,  362,  221,
+      362,  362,  363,  363,  363,  363,  363,  364,  364,  220,
+      364,  364,  365,  365,  219,  365,  365,  366,  366,  218,
+      366,  366,  367,  367,  216,  367,  367,  368,  368,  215,
+
+      368,  368,  214,  213,  209,  208,  191,  189,  188,  187,
+      186,  184,  183,  182,  178,  174,  173,  161,  159,  158,
+      157,  152,  148,  145,  142,  140,  138,  136,  122,  115,
+      114,  109,  104,  102,   91,   90,   89,   86,   79,   75,
+       69,   67,   62,   53,   51,   41,   40,   39,   38,   37,
+       34,   33,   18,   17,   14,   13,   12,   11,   10,    9,
+        8,    7,    6,    5,    4,    3,  328,  328,  328,  328,
+      328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
+      328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
+      328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
+
+      328,  328,  328,  328,  328,  328
+    } ;
+
+static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
+static char *yy_full_match;
+static int yy_lp;
+#define REJECT \
+{ \
+*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
+yy_cp = yy_full_match; /* restore poss. backed-over text */ \
+++yy_lp; \
+goto find_rule; \
+}
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yytext;
+#line 1 "vs1.0_tokens.l"
+#define INITIAL 0
+#define INCLUDE 1
+#define DEFINE 2
+#define DEFSTR 3
+#define DEFSPACE 4
+#define SKIPLINE 5
+#define EATCOMMENT 6
+#define EATSTRING 7
+#define SAVELINE 8
+ 
+#define MACRONAME 9
+#define MACROBODY 10
+#define MACROPARM 11
+#define EATMACRO 12
+#define EATDEFINE 13
+#define MODIFIER 14
+#define MACROPARMSTART 15
+
+#define IFDEFNAME 16
+#define IFDEFBODY 17
+#define ENDMACRO 18
+#define MACROPARMEND 19
+
+#line 8 "vs1.0_tokens.l"
+
+#include <stdarg.h>
+#include <stdlib.h>
+#ifdef _WIN32
+#include <io.h>
+#  ifdef __GNUC__
+#    include <sys/types.h>
+#    include <ctype.h>
+#  endif
+#else
+#include <sys/types.h>
+#include <ctype.h>
+#define _stat stat
+#define _open open
+#define _O_RDONLY O_RDONLY
+#define _fstat fstat
+#define _close close
+#define stricmp strcasecmp
+
+#endif
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include "macro.h"
+#include "nvparse_errors.h"
+#include "vs1.0_inst_list.h"
+#include "_vs1.0_parser.h"
+#define yylineno line_number
+#include "nvparse_externs.h"
+
+#define yylineno line_number
+int line_incr;
+void LexError(char *format, ...);
+void LexWarning(char *format, ...);
+char *ReadTextFile(const char * filename);
+
+unsigned int MakeRegisterMask(char *findName);
+unsigned int FindSwizzleValue(char *swizzleText);
+
+
+enum ERROR_VALUES {
+	ERROR_NONE = 0,
+	ERROR_MEMORY_ALLOC,
+	ERROR_FILE_OPEN,
+	ERROR_UNSUCCESSFUL_ASSEMBLE,
+	ERROR_TOO_MANY_PARMS,
+	ERROR_DEST_WRITE,
+	ERROR_LIST_OPEN,
+	ERROR_DEST_OPEN,
+	ERROR_NO_ARGUMENTS,
+	ERROR_MACRO_OVERRUN
+};
+
+
+
+//extern void GenSwitchFileNames(char *fileName);
+//extern unsigned int gLinesAssembled;
+unsigned int gLinesAssembled;
+
+#define YY_INPUT(buf,result,max_size) \
+{ \
+	int c = *myin++; \
+	result = (c == 0) ? YY_NULL : (buf[0] = c, 1); \
+}
+
+#define SAFEDELETEARRAY(x) if ((x) != NULL) \
+						delete [] (x)
+#define SAFEFREE(x) if ((x) != NULL) \
+						free((x))
+
+#define MAXREPLACESTRING 255
+
+char gReplaceText[MAXREPLACESTRING+1];
+
+//
+// forward prototypes for macro functions
+//
+void MacroIncFunction(char *, unsigned int *, char **);
+void MacroDecFunction(char *, unsigned int *, char **);
+void MacroAddFunction(char *, unsigned int *, char **);
+void MacroSubFunction(char *, unsigned int *, char **);
+
+MACROFUNCTIONS gMacroFunctions[] = { 
+	{ "inc(", MacroIncFunction },
+	{ "dec(", MacroDecFunction },
+	{ "add(", MacroAddFunction },
+	{ "sub(", MacroSubFunction }
+};
+
+#define NUM_MACRO_FUNCTIONS (sizeof(gMacroFunctions) / sizeof(MACROFUNCTIONS))
+
+#define MAX_INCLUDE_DEPTH 1024
+typedef struct INCLUDEINFO
+{
+	char	*fileName;
+	unsigned int lineNo;
+	YY_BUFFER_STATE buffer;
+	MACROENTRY *lastInvokeMacro;				// save off in case nested macros.
+	MACROENTRY *lastParseMacro;				// recursive macros
+	MACROTEXT *lastMacroLineParse;			// save off for recursive lines of macros working on.
+	bool lastbInsideMacro;					// save off for recursive macros
+	bool lastbInsideDefine;					// save off for recursive macros/defines
+	bool lastbInsideInclude;
+	bool lastbProcessingIFDEF; 				// save off #define information
+//	FILE *fileHandle;
+	char *prevString;
+	char *nextString;
+} INCLUDEINFO;
+
+INCLUDEINFO gIncludeStack[MAX_INCLUDE_DEPTH];
+int gIncludeStackIndex = 0;
+
+IFDEFINFO gIfDefStack[MAX_IFDEF_DEPTH];
+int gIfDefStackIndex = 0;
+
+unsigned int &base_linenumber = gIncludeStack[0].lineNo;
+
+bool gbInsideInclude = false;
+bool gbProcessingBuiltIn = false;
+bool gbProcessingDefine = false;
+unsigned int gCountParen = 0;
+
+bool gbProcessingIFDEF = false;
+bool gbIFDEF = false;
+bool gbCompareDefine = false;
+unsigned int gIfDefStartLine;
+
+
+MACROENTRY *gLastMacro;
+MACROENTRY *gInvokeMacro;
+MACROENTRY *gTempMacro;					// until all the parameters are read
+MACROENTRY *FindMacro(char *macroName);
+MACROENTRY *FindNMacro(char *macroName, unsigned int sLen);
+
+MACROFUNCTIONPTR gMacroCallFunction;
+
+char *builtInMacros =	"macro m3x2 reg1, reg2, reg3\n"
+						"	dp3	%reg1.x, %reg2, %reg3\n"
+						"	dp3 %reg1.y, %reg2, %inc(%reg3)\n"
+						"endm";
+
+//
+// local prototypes
+//
+void CleanUp();
+void ReplaceMacroParms(char *srcLine, char *destLine, 
+							MACROENTRY *srcParms, MACROENTRY *invParms);
+
+MACROTEXT *SaveMacroText(char *srcText, MACROTEXT *lastMacroText);
+void FreeMacroEntry(MACROENTRY *macEntry);
+void EndMacroParms();
+char *FindAlphaNum(char *srcStr, unsigned int *sLen);
+void DebugUnhandledState();
+
+
+unsigned int gCommentStartLine;
+unsigned int gMacroStartLine;
+
+char *gCurFileName = NULL;
+
+#define MAXSAVELINE 4095
+
+char gSaveLine[MAXSAVELINE+1];
+char gMacroLine[MAXSAVELINE+1];
+
+#if 1
+#ifdef _DEBUG
+#define ECHO DebugUnhandledState();
+#else
+#define ECHO
+#endif
+#endif
+
+bool gbInsideMacro = false;		// flag if we are doing a macro replace or not.
+bool gbTempInsideMacro = false;
+unsigned int gInvokeState = INITIAL;
+
+
+MACROENTRY *gParseMacro;		// which source macro entry we are using
+MACROENTRY *gTempParseMacro;	// temporary holder until parameters are received.
+MACROTEXT *gMacroLineParse;		// which line we are currently parsing inside the macro invocation
+
+typedef enum OPCODETYPE
+{
+	TYPE_NONE = 0,
+	TYPE_VERTEX_SHADER = 1,
+	TYPE_PIXEL_SHADER = 2
+};
+typedef struct OPCODEMAP
+{
+	char *string;				// string for opcode
+	int tokenName;              // name of the corresponding token
+	int numArguments;			// number of arguments for opcode
+	float version;				// minimum version supported in.
+	int opcodeTypeFlags;		// whether opcode can be used in vertex shader or pixel shader
+	bool opcodeModify;			// if opcode modifiers can be used
+	bool textureOpcode;			// only outputs to the texture unit
+} OPCODEMAP;
+
+#ifndef TRUE
+#define TRUE true
+#endif
+#ifndef FALSE
+#define FALSE false
+#endif
+
+OPCODEMAP theOpcodes[] = {
+	{ "add",  ADD_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER | TYPE_PIXEL_SHADER, TRUE, FALSE },
+	{ "dp3",  DP3_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER | TYPE_PIXEL_SHADER, TRUE, FALSE },
+	{ "dp4",  DP4_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "dst",  DST_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "exp",  EXP_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "expp", EXPP_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "frc",  FRC_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "lit",  LIT_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "log",  LOG_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "logp", LOGP_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "m3x2", M3X2_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "m3x3", M3X3_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "m3x4", M3X4_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "m4x3", M4X3_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "m4x4", M4X4_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "mad",  MAD_INSTR, 4, 1.0f, TYPE_VERTEX_SHADER | TYPE_PIXEL_SHADER, TRUE, FALSE },
+	{ "max",  MAX_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "min",  MIN_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "mov",  MOV_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER | TYPE_PIXEL_SHADER, TRUE, FALSE },
+	{ "mul",  MUL_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER | TYPE_PIXEL_SHADER, TRUE, FALSE },
+	{ "nop",  NOP_INSTR, 0, 1.0f, TYPE_VERTEX_SHADER | TYPE_PIXEL_SHADER, TRUE, FALSE },
+	{ "rcp",  RCP_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "rsq",  RSQ_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "sge",  SGE_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "slt",  SLT_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "sub",  SUB_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER | TYPE_PIXEL_SHADER, TRUE, FALSE },
+};
+
+#define NUMOPCODES (sizeof(theOpcodes) / sizeof(OPCODEMAP))
+OPCODEMAP *FindOpcode(char *findName);
+
+
+#line 990 "_vs1.0_lexer.cpp"
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap YY_PROTO(( void ));
+#else
+extern int yywrap YY_PROTO(( void ));
+#endif
+#endif
+
+#ifndef YY_NO_UNPUT
+static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput YY_PROTO(( void ));
+#else
+static int input YY_PROTO(( void ));
+#endif
+#endif
+
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
+#ifdef YY_MALLOC_DECL
+YY_MALLOC_DECL
+#else
+#if __STDC__
+#ifndef __cplusplus
+#include <stdlib.h>
+#endif
+#else
+/* Just try to get by without declaring the routines.  This will fail
+ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+ * or sizeof(void*) != sizeof(int).
+ */
+#endif
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+	if ( yy_current_buffer->yy_is_interactive ) \
+		{ \
+		int c = '*', n; \
+		for ( n = 0; n < max_size && \
+			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+			buf[n] = (char) c; \
+		if ( c == '\n' ) \
+			buf[n++] = (char) c; \
+		if ( c == EOF && ferror( yyin ) ) \
+			YY_FATAL_ERROR( "input in flex scanner failed" ); \
+		result = n; \
+		} \
+	else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
+		  && ferror( yyin ) ) \
+		YY_FATAL_ERROR( "input in flex scanner failed" );
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL int yylex YY_PROTO(( void ))
+#endif
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+	if ( yyleng > 0 ) \
+		yy_current_buffer->yy_at_bol = \
+				(yytext[yyleng - 1] == '\n'); \
+	YY_USER_ACTION
+
+YY_DECL
+	{
+	register yy_state_type yy_current_state;
+	register char *yy_cp = NULL, *yy_bp = NULL;
+	register int yy_act;
+
+#line 261 "vs1.0_tokens.l"
+
+
+#line 1147 "_vs1.0_lexer.cpp"
+
+	if ( yy_init )
+		{
+		yy_init = 0;
+
+#ifdef YY_USER_INIT
+		YY_USER_INIT;
+#endif
+
+		if ( ! yy_start )
+			yy_start = 1;	/* first start state */
+
+		if ( ! yyin )
+			yyin = stdin;
+
+		if ( ! yyout )
+			yyout = stdout;
+
+		if ( ! yy_current_buffer )
+			yy_current_buffer =
+				yy_create_buffer( yyin, YY_BUF_SIZE );
+
+		yy_load_buffer_state();
+		}
+
+	while ( 1 )		/* loops until end-of-file is reached */
+		{
+		yy_cp = yy_c_buf_p;
+
+		/* Support of yytext. */
+		*yy_cp = yy_hold_char;
+
+		/* yy_bp points to the position in yy_ch_buf of the start of
+		 * the current run.
+		 */
+		yy_bp = yy_cp;
+
+		yy_current_state = yy_start;
+		yy_current_state += YY_AT_BOL();
+		yy_state_ptr = yy_state_buf;
+		*yy_state_ptr++ = yy_current_state;
+yy_match:
+		do
+			{
+			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+				{
+				yy_current_state = (int) yy_def[yy_current_state];
+				if ( yy_current_state >= 329 )
+					yy_c = yy_meta[(unsigned int) yy_c];
+				}
+			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+			*yy_state_ptr++ = yy_current_state;
+			++yy_cp;
+			}
+		while ( yy_base[yy_current_state] != 767 );
+
+yy_find_action:
+		yy_current_state = *--yy_state_ptr;
+		yy_lp = yy_accept[yy_current_state];
+find_rule: /* we branch to this label when backing up */
+		for ( ; ; ) /* until we find what rule we matched */
+			{
+			if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
+				{
+				yy_act = yy_acclist[yy_lp];
+					{
+					yy_full_match = yy_cp;
+					break;
+					}
+				}
+			--yy_cp;
+			yy_current_state = *--yy_state_ptr;
+			yy_lp = yy_accept[yy_current_state];
+			}
+
+		YY_DO_BEFORE_ACTION;
+
+
+do_action:	/* This label is used only to access EOF actions. */
+
+
+		switch ( yy_act )
+	{ /* beginning of action switch */
+case 1:
+YY_RULE_SETUP
+#line 263 "vs1.0_tokens.l"
+{
+	gbProcessingDefine = false;
+	gSaveLine[0] = '\0';
+	strncat(gSaveLine, yytext, MAXSAVELINE);
+//	GenDebugLine();
+	if (gbProcessingIFDEF && (gbCompareDefine != gbIFDEF))
+	{
+		BEGIN(IFDEFBODY);
+	}
+	else
+	{
+		BEGIN(INITIAL);
+	}
+	yyless(0);
+}
+	YY_BREAK
+case 2:
+YY_RULE_SETUP
+#line 279 "vs1.0_tokens.l"
+{
+	gbProcessingDefine = false;
+	gSaveLine[0] = '\0';
+	strncat(gSaveLine, yytext, MAXSAVELINE);
+//	GenDebugLine();
+	if (gbProcessingIFDEF && (gbCompareDefine != gbIFDEF))
+	{
+		BEGIN(IFDEFBODY);
+	}
+	else
+	{
+		BEGIN(INITIAL);
+	}
+	yyless(0);
+}
+	YY_BREAK
+case 3:
+YY_RULE_SETUP
+#line 295 "vs1.0_tokens.l"
+{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_ADDRESS_REG;
+	vs10_lval.reg.index = atoi(&yytext[1]);
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+	YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 304 "vs1.0_tokens.l"
+{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_VERTEX_ATTRIB_REG;
+	vs10_lval.reg.index = atoi(&yytext[1]);
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+	YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 313 "vs1.0_tokens.l"
+{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_TEMPORARY_REG;
+	vs10_lval.reg.index = atoi(&yytext[1]);
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+	YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 322 "vs1.0_tokens.l"
+{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_CONSTANT_MEM_REG;
+	vs10_lval.reg.index = atoi(&yytext[1]);
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+	YY_BREAK
+case 7:
+YY_RULE_SETUP
+#line 331 "vs1.0_tokens.l"
+{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_TEXTURE_RESULT_REG;
+	vs10_lval.reg.index = atoi(&yytext[2]);
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+	YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 340 "vs1.0_tokens.l"
+{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_COLOR_RESULT_REG;
+	vs10_lval.reg.index = atoi(&yytext[2]);
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+	YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 349 "vs1.0_tokens.l"
+{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_FOG_RESULT_REG;
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+	YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 357 "vs1.0_tokens.l"
+{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_POSITION_RESULT_REG;
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+	YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 365 "vs1.0_tokens.l"
+{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_POINTS_RESULT_REG;
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+	YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 373 "vs1.0_tokens.l"
+{
+
+	unsigned int offset;
+	
+    offset = strcspn(yytext, " \t\n_");
+	yyless(offset);
+
+	OPCODEMAP *opcodeMap = FindOpcode(yytext);
+	if ( opcodeMap != NULL )
+	{
+//		fprintf( stderr, "%s\t", opcodeMap->string );
+		return( opcodeMap->tokenName );
+	}
+	else
+	{
+		gTempParseMacro = FindMacro(yytext);
+
+		if (gTempParseMacro != NULL)
+		{
+			if (gIncludeStackIndex >= MAX_INCLUDE_DEPTH )
+			{
+				LexError("macros nested too deeply");
+				exit( 1 );
+			}
+
+			if (gTempParseMacro->firstMacroLines != NULL)
+			{
+
+				gTempMacro = (MACROENTRY *)malloc(sizeof(MACROENTRY));
+				if (gTempMacro == NULL)
+				{
+					LexError("Out of memory allocating MACROENTRY structure.\n");
+				}
+				else
+				{
+
+					gTempMacro->next = NULL;
+					gTempMacro->prev = NULL;
+					gTempMacro->macroName = NULL;
+					gTempMacro->firstMacroParms = NULL;
+					gTempMacro->lastMacroParms = NULL;
+					gTempMacro->firstMacroLines = NULL;
+					gTempMacro->lastMacroLines = NULL;
+					gTempMacro->numParms = 0;
+					gTempMacro->nLines = 0;
+
+					gbTempInsideMacro = true;		// flag we are currently doing a macro replace.
+					gInvokeState = YYSTATE;
+					if (gTempParseMacro->numParms > 0)
+					{
+						BEGIN(MACROPARMSTART);
+					}
+					else
+					{
+						EndMacroParms();
+						gbTempInsideMacro = false;	// no longer waiting for macro invocation
+					}
+
+					
+				}
+			}
+		}
+		else
+		{
+//			fprintf( stderr, "Opcode: \"%s\" not found\n", yytext );
+			REJECT;
+		}
+	}
+
+	//unsigned int offset;
+	//
+	//INSTRMAP *opcodeMap;
+	//
+	//offset = strcspn(yytext, " \t\n_");
+	//yyless(offset);	
+	//opcodeMap = FindInstruction(yytext);
+	//if (opcodeMap == NULL)
+	//{
+	//	REJECT;
+	//}
+	//
+	//yylval.opcodeInfo.opcodeMap = opcodeMap;
+	//
+	//return OPCODE;
+}
+	YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 460 "vs1.0_tokens.l"
+{
+//	fprintf( stderr, "%s", yytext );
+	char *cmt = new char[yyleng+1];
+	strncpy( cmt, yytext, yyleng );
+	cmt[0] = '#';
+	cmt[yyleng] = '\0';
+	vs10_lval.comment = cmt;
+	return COMMENT;
+}
+	YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 470 "vs1.0_tokens.l"
+{
+//	fprintf( stderr, "%s", yytext );
+	char *cmt = new char[yyleng+1];
+	strncpy( cmt+1, yytext+1, yyleng-1 );
+	cmt[0] = '#';
+	cmt[1] = ' ';
+	cmt[yyleng] = '\0';
+	vs10_lval.comment = cmt;
+	return COMMENT;
+}
+	YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 481 "vs1.0_tokens.l"
+{
+	fprintf( stderr, "COISSUE found\n" );
+	yyless(yyleng-1);
+	//return COISSUE;
+}
+	YY_BREAK
+case 16:
+YY_RULE_SETUP
+#line 487 "vs1.0_tokens.l"
+{
+	fprintf( stderr, "COISSUE found\n" );
+	//return COISSUE;
+}
+	YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 492 "vs1.0_tokens.l"
+{
+	gCommentStartLine = yylineno;
+	yyless(0);
+	BEGIN(EATCOMMENT);
+}
+	YY_BREAK
+case 18:
+YY_RULE_SETUP
+#line 498 "vs1.0_tokens.l"
+{ 
+	BEGIN(INCLUDE);
+}
+	YY_BREAK
+case 19:
+YY_RULE_SETUP
+#line 502 "vs1.0_tokens.l"
+{	/* got the include file name */
+
+//	FILE *newyyin;
+char *newyyin;
+	char incFileName[1024];
+	unsigned long sLen;
+	bool validFileName;
+
+	if ( gIncludeStackIndex >= MAX_INCLUDE_DEPTH )
+	{
+		LexError("Includes nested too deeply, aborting\n");
+		exit( 1 );
+	}
+
+//	GenDebugLine();
+//	GenListString();
+	yylineno++;
+	gLinesAssembled++;
+
+	validFileName = true;
+	// zap "" and <>
+	if ((yytext[0] == '"') || (yytext[0] == '<'))
+	{
+		char *endQuote;
+		endQuote = strchr(&yytext[1], yytext[0]);
+		sLen = (endQuote - yytext)-1;
+		if (endQuote == NULL)
+		{
+			LexError("Unable to open include file %s\n", incFileName);
+			BEGIN(INITIAL);
+			validFileName = false;
+		}
+		else
+		{
+			incFileName[0] ='\0';
+			strncat(incFileName, &yytext[1], sLen);
+		}
+	}
+	else
+	{
+		strcpy(incFileName, yytext);
+	}
+
+	if (validFileName)
+	{
+		sLen = strlen(incFileName);
+		if ((incFileName[sLen-1] == '"') || (incFileName[sLen-1] == '>'))
+		{
+			incFileName[sLen-1] = '\0';
+		}
+
+
+		newyyin = ReadTextFile( incFileName );
+//		newyyin = fopen( incFileName, "r" );
+
+		if ( ! newyyin )
+		{
+			LexError("Unable to open include file %s\n", incFileName);
+			BEGIN(SAVELINE);
+		}
+		else
+		{
+			gIncludeStack[gIncludeStackIndex].fileName = gCurFileName;
+			gIncludeStack[gIncludeStackIndex].lineNo = yylineno;
+//			gIncludeStack[gIncludeStackIndex].fileHandle = yyin;
+			gIncludeStack[gIncludeStackIndex].prevString = myin;
+			gIncludeStack[gIncludeStackIndex].nextString = newyyin;
+			gIncludeStack[gIncludeStackIndex].lastInvokeMacro = gInvokeMacro;
+			gIncludeStack[gIncludeStackIndex].lastParseMacro = gParseMacro;
+			gIncludeStack[gIncludeStackIndex].lastMacroLineParse = gMacroLineParse;
+			gIncludeStack[gIncludeStackIndex].lastbInsideMacro = gbInsideMacro;
+			gIncludeStack[gIncludeStackIndex].lastbInsideInclude = gbInsideInclude;
+			gIncludeStack[gIncludeStackIndex].buffer = YY_CURRENT_BUFFER;
+			gIncludeStack[gIncludeStackIndex].lastbProcessingIFDEF = gbProcessingIFDEF;
+			gIncludeStackIndex++;
+
+			gbProcessingIFDEF = false;
+
+			gCurFileName = strdup(incFileName);
+//			yyin = newyyin;
+			myin = newyyin;
+
+//			GenSwitchFileNames(gCurFileName);
+
+			yylineno = 1;
+
+			yy_switch_to_buffer(yy_create_buffer( yyin, YY_BUF_SIZE ) );
+
+			gbInsideInclude = true;
+
+			BEGIN(SAVELINE);
+		}
+	}
+}
+	YY_BREAK
+case YY_STATE_EOF(EATCOMMENT):
+#line 597 "vs1.0_tokens.l"
+{
+	LexError("End of file reached before end of comment started on line %d.\n", gCommentStartLine);
+	BEGIN(INITIAL);
+}
+	YY_BREAK
+case 20:
+YY_RULE_SETUP
+#line 602 "vs1.0_tokens.l"
+{
+	char *endComment;
+	unsigned int keepSize;
+
+	strcpy(gSaveLine, yytext);
+	endComment = strstr(yytext, "*/");
+
+	char *cmt;
+	if (endComment != NULL)
+	{
+		keepSize = (endComment - yytext+2);
+		yyless(keepSize);
+		BEGIN(INITIAL);
+
+		if ( yytext[0] == '/' && yytext[1] == '*' )
+		{
+			cmt = new char[yyleng];
+			strncpy( cmt+3, yytext+2, yyleng-2 );
+			cmt[0] = '#';
+			cmt[1] = ' ';
+			cmt[2] = ' ';
+			cmt[yyleng-1] = '\0';
+		}
+		else
+		{
+			cmt = new char[yyleng];
+			strncpy( cmt+1, yytext, yyleng-2 );
+			cmt[0] = '#';
+			cmt[yyleng-1] = '\0';
+		}
+		vs10_lval.comment = cmt;
+		return COMMENT;
+	}
+	else
+	{
+//		GenDebugLine();
+//		GenListString();
+		gLinesAssembled++;
+		yylineno++;
+
+		if ( yytext[0] == '/' && yytext[1] == '*' )
+		{
+			cmt = new char[yyleng+2];
+			strncpy( cmt+3, yytext+2, yyleng-2 );
+			cmt[0] = '#';
+			cmt[1] = ' ';
+			cmt[2] = ' ';
+			cmt[yyleng+1] = '\0';
+		}
+		else
+		{
+			cmt = new char[yyleng+2];
+			strncpy( cmt+1, yytext, yyleng );
+			cmt[0] = '#';
+			cmt[yyleng+1] = '\0';
+		}
+		vs10_lval.comment = cmt;
+		return COMMENT;
+	}
+}
+	YY_BREAK
+case YY_STATE_EOF(DEFSTR):
+#line 663 "vs1.0_tokens.l"
+{
+	LexError("#define was incomplete before end of file\n");
+	BEGIN(INITIAL);
+}
+	YY_BREAK
+case YY_STATE_EOF(DEFINE):
+#line 668 "vs1.0_tokens.l"
+{
+	LexError("#define was incomplete before end of file\n");
+	BEGIN(INITIAL);
+}
+	YY_BREAK
+case YY_STATE_EOF(DEFSPACE):
+#line 673 "vs1.0_tokens.l"
+{
+	LexError("#define was incomplete before end of file\n");
+	BEGIN(INITIAL);
+}
+	YY_BREAK
+case YY_STATE_EOF(INCLUDE):
+#line 678 "vs1.0_tokens.l"
+{
+	LexError("#include was incomplete before end of file\n");
+	BEGIN(INITIAL);
+}
+	YY_BREAK
+case YY_STATE_EOF(MACROBODY):
+#line 683 "vs1.0_tokens.l"
+{
+	LexError("End of file reached before end of #define or endm was found, macro started on line %d.\n", gMacroStartLine);
+	BEGIN(INITIAL);
+}
+	YY_BREAK
+case YY_STATE_EOF(IFDEFBODY):
+#line 688 "vs1.0_tokens.l"
+{
+	LexError("End of file reached before #endif found, macro started on line %d.\n", gIfDefStartLine);
+	BEGIN(INITIAL);
+}
+	YY_BREAK
+case 21:
+YY_RULE_SETUP
+#line 693 "vs1.0_tokens.l"
+{
+	LexError("#define was incomplete before end of line\n");
+	BEGIN(SAVELINE);
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+	YY_BREAK
+case 22:
+YY_RULE_SETUP
+#line 702 "vs1.0_tokens.l"
+{
+	LexError("#define was incomplete before end of line\n");
+	BEGIN(SAVELINE);
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+	YY_BREAK
+case 23:
+YY_RULE_SETUP
+#line 711 "vs1.0_tokens.l"
+{
+	LexError("#define was incomplete before end of line\n");
+	BEGIN(SAVELINE);
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+	YY_BREAK
+case 24:
+YY_RULE_SETUP
+#line 720 "vs1.0_tokens.l"
+{
+	if (gIfDefStackIndex >= MAX_IFDEF_DEPTH)
+	{
+		LexError("Out of stack space for #ifdef, aborting.\n");
+		exit( 1 );
+	}
+	else
+	{
+		gIfDefStack[gIfDefStackIndex].lastbProcessingIFDEF = gbProcessingIFDEF;
+		gIfDefStack[gIfDefStackIndex].lastbIFDEF = gbIFDEF;
+		gIfDefStack[gIfDefStackIndex].lastbCompareDefine = gbCompareDefine;
+		gIfDefStack[gIfDefStackIndex].lastIfDefStartLine = gIfDefStartLine;
+		gIfDefStackIndex++;
+		gIfDefStartLine = yylineno;
+
+		gbCompareDefine = true;
+		BEGIN(IFDEFNAME);
+	}
+}
+	YY_BREAK
+case 25:
+YY_RULE_SETUP
+#line 740 "vs1.0_tokens.l"
+{
+	if (gIfDefStackIndex >= MAX_IFDEF_DEPTH)
+	{
+		LexError("Out of stack space for #ifdef, aborting.\n");
+		exit( 1 );
+	}
+	else
+	{
+		gIfDefStack[gIfDefStackIndex].lastbProcessingIFDEF = gbProcessingIFDEF;
+		gIfDefStack[gIfDefStackIndex].lastbIFDEF = gbIFDEF;
+		gIfDefStack[gIfDefStackIndex].lastbCompareDefine = gbCompareDefine;
+		gIfDefStack[gIfDefStackIndex].lastIfDefStartLine = gIfDefStartLine;
+		gIfDefStackIndex++;
+		gIfDefStartLine = yylineno;
+
+		gbCompareDefine = false;
+		BEGIN(IFDEFNAME);
+	}
+}
+	YY_BREAK
+case 26:
+YY_RULE_SETUP
+#line 760 "vs1.0_tokens.l"
+{
+	if (!gbProcessingIFDEF)
+	{
+		LexError("Unexpected #else found at line %d, skipping.\n", yylineno);
+	}
+	else
+	{
+		gbCompareDefine = !gbCompareDefine;
+		BEGIN(INITIAL);
+	}
+}
+	YY_BREAK
+case 27:
+YY_RULE_SETUP
+#line 772 "vs1.0_tokens.l"
+{
+	char *defineName;
+	unsigned int sLen;
+
+
+	defineName = FindAlphaNum(yytext, &sLen);
+	if (defineName == NULL)
+	{
+		defineName = strdup(yytext);
+		defineName[yyleng-1] = '\0';	// kill \n
+		LexWarning("Mangled name (%s) for #ifdef, assuming not defined.\n", defineName);
+		free(defineName);
+		gbIFDEF = false;
+	}
+	else
+	{
+		if (FindNMacro(defineName, sLen) != NULL)
+		{
+			gbIFDEF = true;
+		}
+		else
+		{
+			gbIFDEF = false;
+		}
+	}
+
+	gbProcessingIFDEF = true;
+	if (gbIFDEF != gbCompareDefine)
+	{
+		BEGIN(IFDEFBODY);
+	}
+	else
+	{
+		BEGIN(SAVELINE);
+	}
+
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+	YY_BREAK
+case 28:
+YY_RULE_SETUP
+#line 814 "vs1.0_tokens.l"
+{
+	if (!gbProcessingIFDEF)
+	{
+		LexError("Unexpected #endif found at line %d, skipping.\n", yylineno);
+	}
+	else
+	{
+		gIfDefStackIndex--;
+		gbProcessingIFDEF = gIfDefStack[gIfDefStackIndex].lastbProcessingIFDEF;
+		gbIFDEF = gIfDefStack[gIfDefStackIndex].lastbIFDEF;
+		gbCompareDefine = gIfDefStack[gIfDefStackIndex].lastbCompareDefine;
+		gIfDefStartLine = gIfDefStack[gIfDefStackIndex].lastIfDefStartLine;
+
+	}
+
+	if (YYSTATE == IFDEFBODY)
+	{
+		strncpy(gSaveLine, yytext, MAXSAVELINE);
+	}
+
+	BEGIN(ENDMACRO);
+
+}
+	YY_BREAK
+case 29:
+YY_RULE_SETUP
+#line 838 "vs1.0_tokens.l"
+{
+	LexWarning("Garbage at end of #endif or endm will be ignored.\n");
+}
+	YY_BREAK
+case 30:
+YY_RULE_SETUP
+#line 842 "vs1.0_tokens.l"
+{
+	BEGIN(SAVELINE);
+	return '\n';
+}
+	YY_BREAK
+case YY_STATE_EOF(ENDMACRO):
+#line 847 "vs1.0_tokens.l"
+{
+	BEGIN(INITIAL);
+}
+	YY_BREAK
+case 31:
+YY_RULE_SETUP
+#line 851 "vs1.0_tokens.l"
+{
+	// eat line, because we are not in a TRUE #ifdef, or FALSE #ifndef
+	strncpy(gSaveLine, yytext, MAXSAVELINE);
+}
+	YY_BREAK
+case 32:
+YY_RULE_SETUP
+#line 856 "vs1.0_tokens.l"
+{
+	strcat(gSaveLine, yytext);
+//	GenDebugLine();
+//	GenListString();
+	yylineno++;
+	gLinesAssembled++;
+}
+	YY_BREAK
+case 33:
+YY_RULE_SETUP
+#line 864 "vs1.0_tokens.l"
+{ 
+	gbProcessingDefine = true;
+	gMacroStartLine = yylineno;
+	gCountParen = 0;
+	BEGIN(MACRONAME); 
+} 
+	YY_BREAK
+case 34:
+YY_RULE_SETUP
+#line 871 "vs1.0_tokens.l"
+{
+	BEGIN(SAVELINE);
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+	YY_BREAK
+case 35:
+YY_RULE_SETUP
+#line 879 "vs1.0_tokens.l"
+{
+//	unsigned int majorVersion;
+//	unsigned int minorVersion;
+//	int minorOffset;
+//	
+//
+//	majorVersion = (unsigned int)(atoi(&yytext[3]));
+//	// skip "ps." + second '.'
+//	minorOffset = strcspn(&yytext[3], ".")+4;
+//	minorVersion = (unsigned int)(atoi(&yytext[minorOffset]));
+//	yylval.ival = D3DVS_VERSION(majorVersion, minorVersion);
+//
+
+//	fprintf( stderr, "%s", yytext );
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return VERTEX_SHADER;
+}
+	YY_BREAK
+case 36:
+YY_RULE_SETUP
+#line 898 "vs1.0_tokens.l"
+{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.ival = atoi(yytext);
+	return INTVAL;
+}
+	YY_BREAK
+case 37:
+YY_RULE_SETUP
+#line 905 "vs1.0_tokens.l"
+{ 
+		BEGIN(MODIFIER);
+//fprintf( stderr, "." );
+		return yytext[0];
+}
+	YY_BREAK
+case 38:
+YY_RULE_SETUP
+#line 911 "vs1.0_tokens.l"
+{
+//	fprintf( stderr, "%s", yytext );
+	BEGIN(INITIAL);
+
+	vs10_lval.mask[0] = tolower(yytext[0]);
+	vs10_lval.mask[1] = tolower(yytext[1]);
+	vs10_lval.mask[2] = tolower(yytext[2]);
+	vs10_lval.mask[3] = tolower(yytext[3]);
+
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+
+	return XYZW_MODIFIER;
+
+#if 0
+ 	char temp[6];
+
+	temp[0] = '\0';
+	strncat(temp, yytext, 4);
+	strlwr(temp);
+	vs10_lval.lval = FindSwizzleValue(temp);
+
+	BEGIN(INITIAL);
+	return SWIZZLE_MODIFIER;
+#endif
+
+}
+	YY_BREAK
+case 39:
+YY_RULE_SETUP
+#line 939 "vs1.0_tokens.l"
+{
+//	fprintf( stderr, "%s", yytext );
+	BEGIN(INITIAL);
+
+	int validLen = strspn(yytext, "xyzw");
+        int i;
+	for ( i = 0; i < validLen; i++ )
+		vs10_lval.mask[i] = tolower( yytext[i] );
+	while ( i < 4 )
+	{
+		vs10_lval.mask[i] = 0;
+		i++;
+	}
+
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+
+	return XYZW_MODIFIER;
+
+#if 0
+ 	//char temp[6];
+ 	char *temp = new char[6];
+	unsigned int registerMask;
+	unsigned int validLen;
+
+	temp[0] = '\0';
+	validLen = strspn(yytext, "xyzw");
+	strncat(temp, yytext,  validLen);
+	for ( int i = 0; i < validLen; i++ )
+		temp[i] = tolower( temp[i] );
+	registerMask = MakeRegisterMask(temp);
+
+	if (registerMask != 0)
+	{
+		//vs10_lval.sval = temp;
+		vs10_lval.lval = registerMask;
+		BEGIN(INITIAL);
+		return XYZW_MODIFIER;
+	}
+	else
+	{
+		//vs10_lval.sval = temp;
+		vs10_lval.lval = FindSwizzleValue(temp);
+		BEGIN(INITIAL);
+		return SWIZZLE_MODIFIER;	
+	}
+#endif
+}
+	YY_BREAK
+case 40:
+YY_RULE_SETUP
+#line 988 "vs1.0_tokens.l"
+{
+		BEGIN(INITIAL);
+		yyless(0);
+}
+	YY_BREAK
+case 41:
+YY_RULE_SETUP
+#line 993 "vs1.0_tokens.l"
+{
+	/* setup and save off #define/macro name */
+	if (FindMacro(yytext) != NULL)
+	{
+		LexWarning("Redefinition of #define/macro %s, ignoring.\n", yytext);
+		if (gbProcessingDefine)
+		{
+			BEGIN(EATDEFINE);
+		}
+		else
+		{
+			BEGIN(EATMACRO);
+		}
+	}
+	else
+	{
+
+		BEGIN(MACROPARMSTART);
+		// %%%%% This should be setup to use memory pools
+		gTempMacro = (MACROENTRY *)malloc(sizeof(MACROENTRY));
+		if (gTempMacro == NULL)
+		{
+			LexError("Out of memory for macro table.\n");
+			if (gbProcessingDefine)
+			{
+				BEGIN(EATDEFINE);
+			}
+			else
+			{
+				BEGIN(EATMACRO);
+			}
+		}
+		else
+		{
+			gTempMacro->prev = gLastMacro;
+			gTempMacro->next = NULL;
+
+			gTempMacro->firstMacroParms = NULL;
+			gTempMacro->lastMacroParms = NULL;
+			gTempMacro->firstMacroLines = NULL;
+			gTempMacro->lastMacroLines = NULL;
+			gTempMacro->numParms = 0;
+			gTempMacro->bIsDefine = gbProcessingDefine;
+			gTempMacro->nLines = 0;
+
+			if (gCurFileName != NULL)
+			{
+				gTempMacro->fileName = strdup(gCurFileName);
+			}
+			else
+			{
+				gTempMacro->fileName = NULL;
+			}
+
+			gTempMacro->lineNo = yylineno;
+
+			/* %%%%% this should be set up in memory pools. */
+			gTempMacro->macroName = (char *)malloc(strlen(yytext)+1);
+			if (gTempMacro->macroName == NULL)
+			{
+				LexError("Out of memory for string table.\n");
+				SAFEFREE(gTempMacro);
+				if (gbProcessingDefine)
+				{
+					BEGIN(EATDEFINE);
+				}
+				else
+				{
+					BEGIN(EATMACRO);
+				}
+			}
+			else
+			{
+				strcpy(gTempMacro->macroName, yytext);
+			}
+		}
+	}
+}
+	YY_BREAK
+case 42:
+YY_RULE_SETUP
+#line 1072 "vs1.0_tokens.l"
+{
+	LexError("No macro name specified, skipping macro definition.\n");
+	SAFEFREE(gTempMacro->fileName);
+	SAFEFREE(gTempMacro);
+	if (gbProcessingDefine)
+	{
+		BEGIN(EATDEFINE);
+	}
+	else
+	{
+		BEGIN(EATMACRO);
+	}
+
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+	YY_BREAK
+case 43:
+YY_RULE_SETUP
+#line 1091 "vs1.0_tokens.l"
+{
+	gCountParen++; 
+}
+	YY_BREAK
+case 44:
+YY_RULE_SETUP
+#line 1095 "vs1.0_tokens.l"
+{}
+	YY_BREAK
+case 45:
+YY_RULE_SETUP
+#line 1097 "vs1.0_tokens.l"
+{
+	if (gbProcessingDefine && (gCountParen == 0))
+	{
+		EndMacroParms();
+	}
+	else
+	{
+		BEGIN(MACROPARM);
+	}
+	yyless(0);
+}
+	YY_BREAK
+case 46:
+YY_RULE_SETUP
+#line 1109 "vs1.0_tokens.l"
+{ 
+	if ((gCountParen == 0) && gbProcessingDefine)
+	{
+		EndMacroParms();
+	}
+}
+	YY_BREAK
+case 47:
+YY_RULE_SETUP
+#line 1116 "vs1.0_tokens.l"
+{
+	if (gCountParen == 0)
+	{
+		EndMacroParms();
+	}	
+}
+	YY_BREAK
+case 48:
+YY_RULE_SETUP
+#line 1123 "vs1.0_tokens.l"
+{}
+	YY_BREAK
+case YY_STATE_EOF(MACROPARM):
+#line 1125 "vs1.0_tokens.l"
+{
+	EndMacroParms();
+//	GenDebugLine();
+//	GenListString();
+	yylineno++;
+	gLinesAssembled++;
+	BEGIN(INITIAL);
+}
+	YY_BREAK
+case 49:
+YY_RULE_SETUP
+#line 1134 "vs1.0_tokens.l"
+{
+	if (gbProcessingDefine && (gCountParen > 0))
+	{
+		LexError("Malformed #define, skipping.\n");
+		BEGIN(SAVELINE);
+	}
+	else
+	{
+		EndMacroParms();
+//		GenDebugLine();
+//		GenListString();
+		yylineno++;
+		gLinesAssembled++;
+		if (gbProcessingDefine)
+		{
+			gbProcessingDefine = false;
+			BEGIN(SAVELINE);
+		}
+	}
+}
+	YY_BREAK
+case 50:
+YY_RULE_SETUP
+#line 1156 "vs1.0_tokens.l"
+{ 
+
+	MACROTEXT *tMacro;
+	char *macroParmEnd;
+	unsigned int startOffset;
+	bool bFoundEndParen;
+	unsigned int leftParenCount;
+	unsigned int rightParenCount;
+
+	bFoundEndParen = false;
+
+	// sheesh, we gotta count the parenthesis....
+	macroParmEnd = yytext;
+	leftParenCount = 0;
+	rightParenCount = 0;
+	while (*macroParmEnd)
+	{
+		if (*macroParmEnd == ')')
+		{
+			rightParenCount++;
+		}
+		if (*macroParmEnd == '(')
+		{
+			leftParenCount++;
+		}
+
+		macroParmEnd++;
+	}
+
+	// if we found the last right parenthesis.
+	if (rightParenCount == leftParenCount+1)
+	{
+		// find if we got the last parenthesis on this line
+		macroParmEnd = strrchr(yytext, ')');
+		yyless((macroParmEnd - yytext));
+		BEGIN(MACROPARMEND);
+	}
+
+	startOffset = strspn(yytext, " \t");
+
+	tMacro = SaveMacroText(&yytext[startOffset], gTempMacro->lastMacroParms);
+	if (tMacro == NULL)
+	{
+		LexError("Out of memory for string table for macro parameter(s).\n");
+		FreeMacroEntry(gTempMacro);
+		BEGIN(EATMACRO);
+	}
+	else
+	{
+		// if first one wasn't set then set it
+		if (gTempMacro->firstMacroParms == NULL)
+		{
+			gTempMacro->firstMacroParms = tMacro;
+		}
+
+		gTempMacro->lastMacroParms = tMacro;
+
+		gTempMacro->numParms++;
+	}
+
+}
+	YY_BREAK
+case 51:
+YY_RULE_SETUP
+#line 1218 "vs1.0_tokens.l"
+{
+	if (!gbProcessingDefine && !gbTempInsideMacro)
+	{
+		LexError("Malformed  macro, skipping.\n");
+		BEGIN(EATMACRO);
+	}
+	else
+	{
+		gCountParen--;
+
+		// we can get multiple \n's here
+		while (yytext[yyleng-2] == '\n')
+		{
+			yyleng--;
+		}
+		yyless(yyleng);
+
+		// if there isn't a \n on this line, macro starts on this line,
+		// not next, like in a macro definition
+		if (yytext[yyleng-1] != '\n')
+		{
+			EndMacroParms();
+		}
+		else
+		{
+			if (yytext[yyleng-1] == '\n')
+			{
+				gTempMacro->lineNo++;
+			}
+			// count this line
+			gTempMacro->nLines++;
+//			GenDebugLine();
+//			GenListString();
+			EndMacroParms();
+			if (!gbInsideMacro)
+			{
+				yylineno++;
+			}
+
+			gLinesAssembled++;
+		}
+
+	}
+}
+	YY_BREAK
+case 52:
+YY_RULE_SETUP
+#line 1263 "vs1.0_tokens.l"
+{
+	if (!gbProcessingDefine && !gbTempInsideMacro)
+	{
+		LexError("Malformed  macro, skipping.\n");
+		BEGIN(EATMACRO);
+	}
+	else
+	{
+
+		// no matter what count this line
+		gTempMacro->nLines++;
+		gCountParen--;
+		EndMacroParms();
+		if (!gbInsideMacro)
+		{
+			yylineno++;
+		}
+
+		gLinesAssembled++;
+	}
+}
+	YY_BREAK
+case 53:
+YY_RULE_SETUP
+#line 1285 "vs1.0_tokens.l"
+{
+	if (!gbProcessingDefine && !gbTempInsideMacro)
+	{
+		LexError("Malformed  macro, skipping.\n");
+		BEGIN(EATMACRO);
+	}
+	else
+	{
+		gCountParen--;
+		if (gCountParen == 0)
+		{
+			// no matter what count this line
+			gTempMacro->nLines++;
+			EndMacroParms();
+			if (!gbInsideMacro)
+			{
+				yylineno++;
+			}
+
+			gLinesAssembled++;
+		}
+		else
+		{
+			REJECT;
+		}
+	}
+}
+	YY_BREAK
+case 54:
+YY_RULE_SETUP
+#line 1313 "vs1.0_tokens.l"
+{
+	MACROTEXT *tMacro;
+	unsigned int copyLen;
+	char *endLine;
+
+	gSaveLine[0] ='\0';
+	endLine = strchr(yytext, '\\');
+	copyLen = (endLine - yytext);
+	if (copyLen > MAXSAVELINE)
+	{
+		copyLen = MAXSAVELINE;
+	}
+
+	strncat(gSaveLine, yytext, copyLen);
+	strcat(gSaveLine, "\n");
+	tMacro = SaveMacroText(gSaveLine, gLastMacro->lastMacroLines);
+	if (tMacro == NULL)
+	{
+		LexError("Out of memory for string table for macro parameter(s).\n");
+		BEGIN(EATDEFINE);
+	}
+	else
+	{
+		gLastMacro->nLines++;
+		// if first one wasn't set then set it
+		if (gLastMacro->firstMacroLines == NULL)
+		{
+			gLastMacro->firstMacroLines = tMacro;
+		}
+
+		gLastMacro->lastMacroLines = tMacro;
+	}
+
+//	GenDebugLine();
+//	GenListString();
+	yylineno++;
+	gLinesAssembled++;
+}
+	YY_BREAK
+case 55:
+YY_RULE_SETUP
+#line 1352 "vs1.0_tokens.l"
+{
+
+	strncpy(gSaveLine, yytext, MAXSAVELINE);
+	if (gbProcessingDefine)
+	{
+		LexError("Malformed #define, skipping.\n");
+	}
+
+	BEGIN(ENDMACRO);
+}
+	YY_BREAK
+case 56:
+YY_RULE_SETUP
+#line 1363 "vs1.0_tokens.l"
+{
+		MACROTEXT *tMacro;
+
+		// check if processing #define and only one line, if not then append \n
+		if (!gbProcessingDefine || (gLastMacro->nLines >= 1))
+		{
+			gSaveLine[0] = '\0';
+			strncat(gSaveLine, yytext, MAXSAVELINE);
+			strcat(gSaveLine, "\n");
+			tMacro = SaveMacroText(gSaveLine, gLastMacro->lastMacroLines);
+			gLastMacro->nLines++;
+		}
+		else if (gLastMacro->numParms > 0)	// check if parameters were there
+		{
+			// if so, we need the '\n' appended
+			gMacroLine[0] = '\0';
+			strncat(gMacroLine, yytext, MAXSAVELINE);
+			strcat(gMacroLine, "\n");
+			tMacro = SaveMacroText(gMacroLine, gLastMacro->lastMacroLines);
+			gLastMacro->nLines++;
+		}
+		else	// straight no newline macro replace
+		{
+			tMacro = SaveMacroText(yytext, gLastMacro->lastMacroLines);
+		}
+
+		if (tMacro == NULL)
+		{
+			LexError("Out of memory for string table for macro parameter(s).\n");
+			BEGIN(EATMACRO);
+		}
+		else
+		{
+			// if first one wasn't set then set it
+			if (gLastMacro->firstMacroLines == NULL)
+			{
+				gLastMacro->firstMacroLines = tMacro;
+			}
+
+			gLastMacro->lastMacroLines = tMacro;
+		}
+}
+	YY_BREAK
+case 57:
+YY_RULE_SETUP
+#line 1406 "vs1.0_tokens.l"
+{
+
+	MACROTEXT *tMacro;
+//	GenDebugLine();
+//	GenListString();
+	yylineno++;
+	gLinesAssembled++;
+	if (gbProcessingDefine)
+	{
+		gbProcessingDefine = false;
+		BEGIN(SAVELINE);
+	}
+	else
+	{
+		// this means \n by itself inside macro body
+		if (((yylineno-1) - gLastMacro->lineNo) !=  gLastMacro->nLines)
+		{
+			strcpy(gMacroLine, "\n");
+			tMacro = SaveMacroText(gMacroLine, gLastMacro->lastMacroLines);
+			gLastMacro->nLines++;
+
+			if (tMacro == NULL)
+			{
+				LexError("Out of memory for string table for macro parameter(s).\n");
+				BEGIN(EATMACRO);
+			}
+			else
+			{
+				// if first one wasn't set then set it
+				if (gLastMacro->firstMacroLines == NULL)
+				{
+					gLastMacro->firstMacroLines = tMacro;
+				}
+
+				gLastMacro->lastMacroLines = tMacro;
+			}
+		}
+	}
+}
+	YY_BREAK
+case 58:
+YY_RULE_SETUP
+#line 1446 "vs1.0_tokens.l"
+{
+	BEGIN(SAVELINE);
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+	YY_BREAK
+case 59:
+YY_RULE_SETUP
+#line 1454 "vs1.0_tokens.l"
+{
+	strncpy(gSaveLine, yytext, MAXSAVELINE);
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+	YY_BREAK
+case 60:
+YY_RULE_SETUP
+#line 1462 "vs1.0_tokens.l"
+{
+	strncpy(gSaveLine, yytext, MAXSAVELINE);
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+	YY_BREAK
+case 61:
+YY_RULE_SETUP
+#line 1470 "vs1.0_tokens.l"
+{
+	strncpy(gSaveLine, yytext, MAXSAVELINE);
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+	BEGIN(SAVELINE);
+}
+	YY_BREAK
+case 62:
+YY_RULE_SETUP
+#line 1479 "vs1.0_tokens.l"
+{
+
+	gTempParseMacro = FindMacro(yytext);
+
+	if (gTempParseMacro != NULL)
+	{
+		if (gIncludeStackIndex >= MAX_INCLUDE_DEPTH )
+		{
+			LexError("macros nested too deeply");
+			exit( 1 );
+		}
+
+		if (gTempParseMacro->firstMacroLines != NULL)
+		{
+
+			gTempMacro = (MACROENTRY *)malloc(sizeof(MACROENTRY));
+			if (gTempMacro == NULL)
+			{
+				LexError("Out of memory allocating MACROENTRY structure.\n");
+			}
+			else
+			{
+
+				gTempMacro->next = NULL;
+				gTempMacro->prev = NULL;
+				gTempMacro->macroName = NULL;
+				gTempMacro->firstMacroParms = NULL;
+				gTempMacro->lastMacroParms = NULL;
+				gTempMacro->firstMacroLines = NULL;
+				gTempMacro->lastMacroLines = NULL;
+				gTempMacro->numParms = 0;
+				gTempMacro->nLines = 0;
+
+				gbTempInsideMacro = true;		// flag we are currently doing a macro replace.
+				gInvokeState = YYSTATE;
+				if (gTempParseMacro->numParms > 0)
+				{
+					BEGIN(MACROPARMSTART);
+				}
+				else
+				{
+					EndMacroParms();
+					gbTempInsideMacro = false;	// no longer waiting for macro invocation
+				}				
+			}
+		}
+	}
+	else
+	{
+		BEGIN(INITIAL);
+		REJECT;
+	}
+}
+	YY_BREAK
+case 63:
+YY_RULE_SETUP
+#line 1533 "vs1.0_tokens.l"
+{ 
+//    fprintf( stderr, "%c ", yytext[0] );
+	return yytext[0];
+}
+	YY_BREAK
+case 64:
+YY_RULE_SETUP
+#line 1539 "vs1.0_tokens.l"
+{}
+	YY_BREAK
+case 65:
+YY_RULE_SETUP
+#line 1541 "vs1.0_tokens.l"
+{
+	LexError("Didn't find label string for #define.\n");
+	BEGIN(SAVELINE);
+//	return '\n';
+}
+	YY_BREAK
+case 66:
+YY_RULE_SETUP
+#line 1547 "vs1.0_tokens.l"
+{
+//fprintf(stderr, "\n");
+//	line_incr = 1;
+	line_incr++;
+	BEGIN(SAVELINE);
+	return '\n';
+}
+	YY_BREAK
+case 67:
+YY_RULE_SETUP
+#line 1555 "vs1.0_tokens.l"
+{
+	BEGIN(INITIAL);
+//	fprintf( stderr, "%s", yytext );
+	if (yyleng == 1)
+		return yytext[0];
+	else
+		LexError("Unrecognized Token: %s\n", yytext);
+	return UNKNOWN_STRING;
+}
+	YY_BREAK
+case 68:
+YY_RULE_SETUP
+#line 1565 "vs1.0_tokens.l"
+{
+//	vs10_lval.ival = yytext[0];
+	LexError("Illegal character: %d decimal.\n", yytext[0]);
+	return(ILLEGAL);
+}
+	YY_BREAK
+case 69:
+YY_RULE_SETUP
+#line 1571 "vs1.0_tokens.l"
+{
+//	vs10_lval.ival = yytext[0];
+	LexError("Illegal character: %d decimal.\n", yytext[0]);
+	return(ILLEGAL); 
+}
+	YY_BREAK
+case 70:
+YY_RULE_SETUP
+#line 1577 "vs1.0_tokens.l"
+{
+	return yytext[0];
+}
+	YY_BREAK
+case 71:
+YY_RULE_SETUP
+#line 1581 "vs1.0_tokens.l"
+{
+	BEGIN(EATSTRING);
+	yyless(0);
+}
+	YY_BREAK
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(SKIPLINE):
+case YY_STATE_EOF(EATSTRING):
+case YY_STATE_EOF(SAVELINE):
+case YY_STATE_EOF(MACRONAME):
+case YY_STATE_EOF(EATMACRO):
+case YY_STATE_EOF(EATDEFINE):
+case YY_STATE_EOF(MODIFIER):
+case YY_STATE_EOF(MACROPARMSTART):
+case YY_STATE_EOF(IFDEFNAME):
+case YY_STATE_EOF(MACROPARMEND):
+#line 1586 "vs1.0_tokens.l"
+{
+	bool wasInMacro;
+	bool oneLiner;
+	char *macroText;
+
+	wasInMacro = gbInsideMacro;
+	oneLiner = false;
+
+
+	// if we are inside the macro then do next line until their are no more
+	if (gbInsideMacro)
+	{
+		oneLiner = (gParseMacro->nLines == 0);
+
+		// free the temporary parameter replaced line we were working on.
+		// get next line in macro text, if any
+		gMacroLineParse = gMacroLineParse->next;
+		// more lines to parse?
+		if (gMacroLineParse != NULL)
+		{
+			macroText = gMacroLine;
+			// if no replacement text, just use source line
+			if (gParseMacro->firstMacroParms == NULL)
+			{
+				macroText = gMacroLineParse->macroText;
+			}
+			else
+			{
+				// replace the macro parameters
+				ReplaceMacroParms(gMacroLineParse->macroText, gMacroLine, gParseMacro, gInvokeMacro);
+			}
+
+//			if (gExpandMacros)
+//			{
+//				strcpy(gSaveLine, macroText);
+//			}
+
+			BEGIN(INITIAL);
+			// and lex it.
+			yy_scan_string(macroText);
+		}
+		else
+		{
+			// no more lines in this macro, so free the working macro
+			SAFEFREE(gInvokeMacro);
+			// shut off flag for inside a macro replacement state.
+			gbInsideMacro = false;
+		}
+	}
+
+	if (gbProcessingIFDEF && !wasInMacro)
+	{
+		LexError("End of file reached before #endif found, macro started on line %d.\n", gIfDefStartLine);
+	}
+
+	if (!gbInsideMacro)
+	{
+		if ( gIncludeStackIndex == 0 )
+		{
+			if (!gbProcessingBuiltIn)
+				CleanUp();
+			return 0;
+//			return TOKEN_EOF;
+		}
+		else
+		{
+			yy_delete_buffer( YY_CURRENT_BUFFER );
+			SAFEFREE(gCurFileName);
+//			SAFEDELETE(myin);
+//			SAFECLOSE(yyin);
+		}
+
+		gIncludeStackIndex--;
+		SAFEDELETEARRAY( gIncludeStack[gIncludeStackIndex].nextString );
+		yy_switch_to_buffer(gIncludeStack[gIncludeStackIndex].buffer );
+		gCurFileName = gIncludeStack[gIncludeStackIndex].fileName;
+//		yyin = gIncludeStack[gIncludeStackIndex].fileHandle;
+		myin = gIncludeStack[gIncludeStackIndex].prevString;
+		yylineno = gIncludeStack[gIncludeStackIndex].lineNo;
+		gInvokeMacro = gIncludeStack[gIncludeStackIndex].lastInvokeMacro;
+		gParseMacro = gIncludeStack[gIncludeStackIndex].lastParseMacro;
+		gMacroLineParse = gIncludeStack[gIncludeStackIndex].lastMacroLineParse;
+		gbInsideInclude = gIncludeStack[gIncludeStackIndex].lastbInsideInclude;
+		gbInsideMacro = gIncludeStack[gIncludeStackIndex].lastbInsideMacro;
+		gbProcessingIFDEF = gIncludeStack[gIncludeStackIndex].lastbProcessingIFDEF;
+
+		if (!gbInsideMacro && !oneLiner)
+		{
+//			GenSwitchFileNames(gCurFileName);
+			BEGIN(SAVELINE);
+		}
+		else
+		{
+			BEGIN(INITIAL);
+		}
+
+		// gSaveLine was last line saved, before macro invocation
+		if (wasInMacro && !gbInsideMacro && !oneLiner)
+		{
+//			GenDebugLine();
+//			GenListString();
+			gLinesAssembled++;
+			yylineno++;
+		}
+
+	}
+
+}
+	YY_BREAK
+case 72:
+YY_RULE_SETUP
+#line 1695 "vs1.0_tokens.l"
+ECHO;
+	YY_BREAK
+#line 2908 "_vs1.0_lexer.cpp"
+
+	case YY_END_OF_BUFFER:
+		{
+		/* Amount of text matched not including the EOB char. */
+		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+
+		/* Undo the effects of YY_DO_BEFORE_ACTION. */
+		*yy_cp = yy_hold_char;
+		YY_RESTORE_YY_MORE_OFFSET
+
+		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+			{
+			/* We're scanning a new file or input source.  It's
+			 * possible that this happened because the user
+			 * just pointed yyin at a new source and called
+			 * yylex().  If so, then we have to assure
+			 * consistency between yy_current_buffer and our
+			 * globals.  Here is the right place to do so, because
+			 * this is the first action (other than possibly a
+			 * back-up) that will match for the new input source.
+			 */
+			yy_n_chars = yy_current_buffer->yy_n_chars;
+			yy_current_buffer->yy_input_file = yyin;
+			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+			}
+
+		/* Note that here we test for yy_c_buf_p "<=" to the position
+		 * of the first EOB in the buffer, since yy_c_buf_p will
+		 * already have been incremented past the NUL character
+		 * (since all states make transitions on EOB to the
+		 * end-of-buffer state).  Contrast this with the test
+		 * in input().
+		 */
+		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+			{ /* This was really a NUL. */
+			yy_state_type yy_next_state;
+
+			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+
+			yy_current_state = yy_get_previous_state();
+
+			/* Okay, we're now positioned to make the NUL
+			 * transition.  We couldn't have
+			 * yy_get_previous_state() go ahead and do it
+			 * for us because it doesn't know how to deal
+			 * with the possibility of jamming (and we don't
+			 * want to build jamming into it because then it
+			 * will run more slowly).
+			 */
+
+			yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+			yy_bp = yytext_ptr + YY_MORE_ADJ;
+
+			if ( yy_next_state )
+				{
+				/* Consume the NUL. */
+				yy_cp = ++yy_c_buf_p;
+				yy_current_state = yy_next_state;
+				goto yy_match;
+				}
+
+			else
+				{
+				yy_cp = yy_c_buf_p;
+				goto yy_find_action;
+				}
+			}
+
+		else switch ( yy_get_next_buffer() )
+			{
+			case EOB_ACT_END_OF_FILE:
+				{
+				yy_did_buffer_switch_on_eof = 0;
+
+				if ( yywrap() )
+					{
+					/* Note: because we've taken care in
+					 * yy_get_next_buffer() to have set up
+					 * yytext, we can now set up
+					 * yy_c_buf_p so that if some total
+					 * hoser (like flex itself) wants to
+					 * call the scanner after we return the
+					 * YY_NULL, it'll still work - another
+					 * YY_NULL will get returned.
+					 */
+					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+					yy_act = YY_STATE_EOF(YY_START);
+					goto do_action;
+					}
+
+				else
+					{
+					if ( ! yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+					}
+				break;
+				}
+
+			case EOB_ACT_CONTINUE_SCAN:
+				yy_c_buf_p =
+					yytext_ptr + yy_amount_of_matched_text;
+
+				yy_current_state = yy_get_previous_state();
+
+				yy_cp = yy_c_buf_p;
+				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				goto yy_match;
+
+			case EOB_ACT_LAST_MATCH:
+				yy_c_buf_p =
+				&yy_current_buffer->yy_ch_buf[yy_n_chars];
+
+				yy_current_state = yy_get_previous_state();
+
+				yy_cp = yy_c_buf_p;
+				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				goto yy_find_action;
+			}
+		break;
+		}
+
+	default:
+		YY_FATAL_ERROR(
+			"fatal flex scanner internal error--no action found" );
+	} /* end of action switch */
+		} /* end of scanning one token */
+	} /* end of yylex */
+
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ *	EOB_ACT_LAST_MATCH -
+ *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *	EOB_ACT_END_OF_FILE - end of file
+ */
+
+static int yy_get_next_buffer()
+	{
+	register char *dest = yy_current_buffer->yy_ch_buf;
+	register char *source = yytext_ptr;
+	register int number_to_move, i;
+	int ret_val;
+
+	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+		YY_FATAL_ERROR(
+		"fatal flex scanner internal error--end of buffer missed" );
+
+	if ( yy_current_buffer->yy_fill_buffer == 0 )
+		{ /* Don't try to fill the buffer, so this is an EOF. */
+		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+			{
+			/* We matched a single character, the EOB, so
+			 * treat this as a final EOF.
+			 */
+			return EOB_ACT_END_OF_FILE;
+			}
+
+		else
+			{
+			/* We matched some text prior to the EOB, first
+			 * process it.
+			 */
+			return EOB_ACT_LAST_MATCH;
+			}
+		}
+
+	/* Try to read more data. */
+
+	/* First move last chars to start of buffer. */
+	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+
+	for ( i = 0; i < number_to_move; ++i )
+		*(dest++) = *(source++);
+
+	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+		/* don't do the read, it's not guaranteed to return an EOF,
+		 * just force an EOF
+		 */
+		yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+
+	else
+		{
+		int num_to_read =
+			yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+		while ( num_to_read <= 0 )
+			{ /* Not enough room in the buffer - grow it. */
+#ifdef YY_USES_REJECT
+			YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+			/* just a shorter name for the current buffer */
+			YY_BUFFER_STATE b = yy_current_buffer;
+
+			int yy_c_buf_p_offset =
+				(int) (yy_c_buf_p - b->yy_ch_buf);
+
+			if ( b->yy_is_our_buffer )
+				{
+				int new_size = b->yy_buf_size * 2;
+
+				if ( new_size <= 0 )
+					b->yy_buf_size += b->yy_buf_size / 8;
+				else
+					b->yy_buf_size *= 2;
+
+				b->yy_ch_buf = (char *)
+					/* Include room in for 2 EOB chars. */
+					yy_flex_realloc( (void *) b->yy_ch_buf,
+							 b->yy_buf_size + 2 );
+				}
+			else
+				/* Can't grow it, we don't own it. */
+				b->yy_ch_buf = 0;
+
+			if ( ! b->yy_ch_buf )
+				YY_FATAL_ERROR(
+				"fatal error - scanner input buffer overflow" );
+
+			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+			num_to_read = yy_current_buffer->yy_buf_size -
+						number_to_move - 1;
+#endif
+			}
+
+		if ( num_to_read > YY_READ_BUF_SIZE )
+			num_to_read = YY_READ_BUF_SIZE;
+
+		/* Read in more data. */
+		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+			yy_n_chars, num_to_read );
+
+		yy_current_buffer->yy_n_chars = yy_n_chars;
+		}
+
+	if ( yy_n_chars == 0 )
+		{
+		if ( number_to_move == YY_MORE_ADJ )
+			{
+			ret_val = EOB_ACT_END_OF_FILE;
+			yyrestart( yyin );
+			}
+
+		else
+			{
+			ret_val = EOB_ACT_LAST_MATCH;
+			yy_current_buffer->yy_buffer_status =
+				YY_BUFFER_EOF_PENDING;
+			}
+		}
+
+	else
+		ret_val = EOB_ACT_CONTINUE_SCAN;
+
+	yy_n_chars += number_to_move;
+	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+
+	return ret_val;
+	}
+
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+static yy_state_type yy_get_previous_state()
+	{
+	register yy_state_type yy_current_state;
+	register char *yy_cp;
+
+	yy_current_state = yy_start;
+	yy_current_state += YY_AT_BOL();
+	yy_state_ptr = yy_state_buf;
+	*yy_state_ptr++ = yy_current_state;
+
+	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+		{
+		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 4);
+		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+			{
+			yy_current_state = (int) yy_def[yy_current_state];
+			if ( yy_current_state >= 329 )
+				yy_c = yy_meta[(unsigned int) yy_c];
+			}
+		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+		*yy_state_ptr++ = yy_current_state;
+		}
+
+	return yy_current_state;
+	}
+
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ *	next_state = yy_try_NUL_trans( current_state );
+ */
+
+#ifdef YY_USE_PROTOS
+static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+#else
+static yy_state_type yy_try_NUL_trans( yy_current_state )
+yy_state_type yy_current_state;
+#endif
+	{
+	register int yy_is_jam;
+
+	register YY_CHAR yy_c = 4;
+	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+		{
+		yy_current_state = (int) yy_def[yy_current_state];
+		if ( yy_current_state >= 329 )
+			yy_c = yy_meta[(unsigned int) yy_c];
+		}
+	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+	yy_is_jam = (yy_current_state == 328);
+	if ( ! yy_is_jam )
+		*yy_state_ptr++ = yy_current_state;
+
+	return yy_is_jam ? 0 : yy_current_state;
+	}
+
+
+#ifndef YY_NO_UNPUT
+#ifdef YY_USE_PROTOS
+static void yyunput( int c, register char *yy_bp )
+#else
+static void yyunput( c, yy_bp )
+int c;
+register char *yy_bp;
+#endif
+	{
+	register char *yy_cp = yy_c_buf_p;
+
+	/* undo effects of setting up yytext */
+	*yy_cp = yy_hold_char;
+
+	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+		{ /* need to shift things up to make room */
+		/* +2 for EOB chars. */
+		register int number_to_move = yy_n_chars + 2;
+		register char *dest = &yy_current_buffer->yy_ch_buf[
+					yy_current_buffer->yy_buf_size + 2];
+		register char *source =
+				&yy_current_buffer->yy_ch_buf[number_to_move];
+
+		while ( source > yy_current_buffer->yy_ch_buf )
+			*--dest = *--source;
+
+		yy_cp += (int) (dest - source);
+		yy_bp += (int) (dest - source);
+		yy_current_buffer->yy_n_chars =
+			yy_n_chars = yy_current_buffer->yy_buf_size;
+
+		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+			YY_FATAL_ERROR( "flex scanner push-back overflow" );
+		}
+
+	*--yy_cp = (char) c;
+
+
+	yytext_ptr = yy_bp;
+	yy_hold_char = *yy_cp;
+	yy_c_buf_p = yy_cp;
+	}
+#endif	/* ifndef YY_NO_UNPUT */
+
+
+#ifdef __cplusplus
+static int yyinput()
+#else
+static int input()
+#endif
+	{
+	int c;
+
+	*yy_c_buf_p = yy_hold_char;
+
+	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+		{
+		/* yy_c_buf_p now points to the character we want to return.
+		 * If this occurs *before* the EOB characters, then it's a
+		 * valid NUL; if not, then we've hit the end of the buffer.
+		 */
+		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+			/* This was really a NUL. */
+			*yy_c_buf_p = '\0';
+
+		else
+			{ /* need more input */
+			int offset = yy_c_buf_p - yytext_ptr;
+			++yy_c_buf_p;
+
+			switch ( yy_get_next_buffer() )
+				{
+				case EOB_ACT_LAST_MATCH:
+					/* This happens because yy_g_n_b()
+					 * sees that we've accumulated a
+					 * token and flags that we need to
+					 * try matching the token before
+					 * proceeding.  But for input(),
+					 * there's no matching to consider.
+					 * So convert the EOB_ACT_LAST_MATCH
+					 * to EOB_ACT_END_OF_FILE.
+					 */
+
+					/* Reset buffer status. */
+					yyrestart( yyin );
+
+					/* fall through */
+
+				case EOB_ACT_END_OF_FILE:
+					{
+					if ( yywrap() )
+						return EOF;
+
+					if ( ! yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+#ifdef __cplusplus
+					return yyinput();
+#else
+					return input();
+#endif
+					}
+
+				case EOB_ACT_CONTINUE_SCAN:
+					yy_c_buf_p = yytext_ptr + offset;
+					break;
+				}
+			}
+		}
+
+	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
+	*yy_c_buf_p = '\0';	/* preserve yytext */
+	yy_hold_char = *++yy_c_buf_p;
+
+	yy_current_buffer->yy_at_bol = (c == '\n');
+
+	return c;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yyrestart( FILE *input_file )
+#else
+void yyrestart( input_file )
+FILE *input_file;
+#endif
+	{
+	if ( ! yy_current_buffer )
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+	yy_init_buffer( yy_current_buffer, input_file );
+	yy_load_buffer_state();
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+#else
+void yy_switch_to_buffer( new_buffer )
+YY_BUFFER_STATE new_buffer;
+#endif
+	{
+	if ( yy_current_buffer == new_buffer )
+		return;
+
+	if ( yy_current_buffer )
+		{
+		/* Flush out information for old buffer. */
+		*yy_c_buf_p = yy_hold_char;
+		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+		yy_current_buffer->yy_n_chars = yy_n_chars;
+		}
+
+	yy_current_buffer = new_buffer;
+	yy_load_buffer_state();
+
+	/* We don't actually know whether we did this switch during
+	 * EOF (yywrap()) processing, but the only time this flag
+	 * is looked at is after yywrap() is called, so it's safe
+	 * to go ahead and always set it.
+	 */
+	yy_did_buffer_switch_on_eof = 1;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_load_buffer_state( void )
+#else
+void yy_load_buffer_state()
+#endif
+	{
+	yy_n_chars = yy_current_buffer->yy_n_chars;
+	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+	yyin = yy_current_buffer->yy_input_file;
+	yy_hold_char = *yy_c_buf_p;
+	}
+
+
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+#else
+YY_BUFFER_STATE yy_create_buffer( file, size )
+FILE *file;
+int size;
+#endif
+	{
+	YY_BUFFER_STATE b;
+
+	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_buf_size = size;
+
+	/* yy_ch_buf has to be 2 characters longer than the size given because
+	 * we need to put in 2 end-of-buffer characters.
+	 */
+	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+	if ( ! b->yy_ch_buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_is_our_buffer = 1;
+
+	yy_init_buffer( b, file );
+
+	return b;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_delete_buffer( YY_BUFFER_STATE b )
+#else
+void yy_delete_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+	{
+	if ( ! b )
+		return;
+
+	if ( b == yy_current_buffer )
+		yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+	if ( b->yy_is_our_buffer )
+		yy_flex_free( (void *) b->yy_ch_buf );
+
+	yy_flex_free( (void *) b );
+	}
+
+
+
+#ifdef YY_USE_PROTOS
+void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+#else
+void yy_init_buffer( b, file )
+YY_BUFFER_STATE b;
+FILE *file;
+#endif
+
+
+	{
+	yy_flush_buffer( b );
+
+	b->yy_input_file = file;
+	b->yy_fill_buffer = 1;
+
+#if YY_ALWAYS_INTERACTIVE
+	b->yy_is_interactive = 1;
+#else
+#if YY_NEVER_INTERACTIVE
+	b->yy_is_interactive = 0;
+#else
+	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+#endif
+#endif
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_flush_buffer( YY_BUFFER_STATE b )
+#else
+void yy_flush_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+
+	{
+	if ( ! b )
+		return;
+
+	b->yy_n_chars = 0;
+
+	/* We always need two end-of-buffer characters.  The first causes
+	 * a transition to the end-of-buffer state.  The second causes
+	 * a jam in that state.
+	 */
+	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+	b->yy_buf_pos = &b->yy_ch_buf[0];
+
+	b->yy_at_bol = 1;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	if ( b == yy_current_buffer )
+		yy_load_buffer_state();
+	}
+
+
+#ifndef YY_NO_SCAN_BUFFER
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+#else
+YY_BUFFER_STATE yy_scan_buffer( base, size )
+char *base;
+yy_size_t size;
+#endif
+	{
+	YY_BUFFER_STATE b;
+
+	if ( size < 2 ||
+	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
+	     base[size-1] != YY_END_OF_BUFFER_CHAR )
+		/* They forgot to leave room for the EOB's. */
+		return 0;
+
+	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
+	b->yy_buf_pos = b->yy_ch_buf = base;
+	b->yy_is_our_buffer = 0;
+	b->yy_input_file = 0;
+	b->yy_n_chars = b->yy_buf_size;
+	b->yy_is_interactive = 0;
+	b->yy_at_bol = 1;
+	b->yy_fill_buffer = 0;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	yy_switch_to_buffer( b );
+
+	return b;
+	}
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+#else
+YY_BUFFER_STATE yy_scan_string( yy_str )
+yyconst char *yy_str;
+#endif
+	{
+	int len;
+	for ( len = 0; yy_str[len]; ++len )
+		;
+
+	return yy_scan_bytes( yy_str, len );
+	}
+#endif
+
+
+#ifndef YY_NO_SCAN_BYTES
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
+#else
+YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+yyconst char *bytes;
+int len;
+#endif
+	{
+	YY_BUFFER_STATE b;
+	char *buf;
+	yy_size_t n;
+	int i;
+
+	/* Get memory for full buffer, including space for trailing EOB's. */
+	n = len + 2;
+	buf = (char *) yy_flex_alloc( n );
+	if ( ! buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+	for ( i = 0; i < len; ++i )
+		buf[i] = bytes[i];
+
+	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+	b = yy_scan_buffer( buf, n );
+	if ( ! b )
+		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+	/* It's okay to grow etc. this buffer, and we should throw it
+	 * away when we're done.
+	 */
+	b->yy_is_our_buffer = 1;
+
+	return b;
+	}
+#endif
+
+
+#ifndef YY_NO_PUSH_STATE
+#ifdef YY_USE_PROTOS
+static void yy_push_state( int new_state )
+#else
+static void yy_push_state( new_state )
+int new_state;
+#endif
+	{
+	if ( yy_start_stack_ptr >= yy_start_stack_depth )
+		{
+		yy_size_t new_size;
+
+		yy_start_stack_depth += YY_START_STACK_INCR;
+		new_size = yy_start_stack_depth * sizeof( int );
+
+		if ( ! yy_start_stack )
+			yy_start_stack = (int *) yy_flex_alloc( new_size );
+
+		else
+			yy_start_stack = (int *) yy_flex_realloc(
+					(void *) yy_start_stack, new_size );
+
+		if ( ! yy_start_stack )
+			YY_FATAL_ERROR(
+			"out of memory expanding start-condition stack" );
+		}
+
+	yy_start_stack[yy_start_stack_ptr++] = YY_START;
+
+	BEGIN(new_state);
+	}
+#endif
+
+
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state()
+	{
+	if ( --yy_start_stack_ptr < 0 )
+		YY_FATAL_ERROR( "start-condition stack underflow" );
+
+	BEGIN(yy_start_stack[yy_start_stack_ptr]);
+	}
+#endif
+
+
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state()
+	{
+	return yy_start_stack[yy_start_stack_ptr - 1];
+	}
+#endif
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+#ifdef YY_USE_PROTOS
+static void yy_fatal_error( yyconst char msg[] )
+#else
+static void yy_fatal_error( msg )
+char msg[];
+#endif
+	{
+	(void) fprintf( stderr, "%s\n", msg );
+	exit( YY_EXIT_FAILURE );
+	}
+
+
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+		yytext[yyleng] = yy_hold_char; \
+		yy_c_buf_p = yytext + n; \
+		yy_hold_char = *yy_c_buf_p; \
+		*yy_c_buf_p = '\0'; \
+		yyleng = n; \
+		} \
+	while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef yytext_ptr
+#ifdef YY_USE_PROTOS
+static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
+#else
+static void yy_flex_strncpy( s1, s2, n )
+char *s1;
+yyconst char *s2;
+int n;
+#endif
+	{
+	register int i;
+	for ( i = 0; i < n; ++i )
+		s1[i] = s2[i];
+	}
+#endif
+
+#ifdef YY_NEED_STRLEN
+#ifdef YY_USE_PROTOS
+static int yy_flex_strlen( yyconst char *s )
+#else
+static int yy_flex_strlen( s )
+yyconst char *s;
+#endif
+	{
+	register int n;
+	for ( n = 0; s[n]; ++n )
+		;
+
+	return n;
+	}
+#endif
+
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_alloc( yy_size_t size )
+#else
+static void *yy_flex_alloc( size )
+yy_size_t size;
+#endif
+	{
+	return (void *) malloc( size );
+	}
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_realloc( void *ptr, yy_size_t size )
+#else
+static void *yy_flex_realloc( ptr, size )
+void *ptr;
+yy_size_t size;
+#endif
+	{
+	/* The cast to (char *) in the following accommodates both
+	 * implementations that use char* generic pointers, and those
+	 * that use void* generic pointers.  It works with the latter
+	 * because both ANSI C and C++ allow castless assignment from
+	 * any pointer type to void*, and deal with argument conversions
+	 * as though doing an assignment.
+	 */
+	return (void *) realloc( (char *) ptr, size );
+	}
+
+#ifdef YY_USE_PROTOS
+static void yy_flex_free( void *ptr )
+#else
+static void yy_flex_free( ptr )
+void *ptr;
+#endif
+	{
+	free( ptr );
+	}
+
+#if YY_MAIN
+int main()
+	{
+	yylex();
+	return 0;
+	}
+#endif
+#line 1695 "vs1.0_tokens.l"
+
+
+
+//=====================================================================
+// Function:	FindNMacro
+// Description:	Look through macros and see if it had been predefined
+// Parameters:	findName = name to lookup
+//				sLen = # characters valid in source (findName)
+// Returns:		MACROENTRY * = pointer to macro entry if found
+//=====================================================================
+MACROENTRY *FindNMacro(char *findName, unsigned int sLen)
+{
+	MACROENTRY *curEntry;
+
+	curEntry = gLastMacro;
+	while (curEntry != NULL)
+	{
+		if (strlen(curEntry->macroName) == sLen)
+		{
+			if (!strncmp(curEntry->macroName, findName, sLen))
+			{
+				break;
+			}
+		}
+
+		curEntry = curEntry->prev;
+	}
+
+	return curEntry;
+	
+}
+
+//=====================================================================
+// Function:	FindMacro
+// Description:	Look through macros and see if it had been predefined
+// Parameters:	findName = name to lookup
+// Returns:		MACROENTRY * = pointer to macro entry if found
+//=====================================================================
+MACROENTRY *FindMacro(char *findName)
+{
+	MACROENTRY *curEntry;
+
+	curEntry = gLastMacro;
+	while (curEntry != NULL)
+	{
+		if (!strcmp(curEntry->macroName, findName))
+		{
+			break;
+		}
+
+		curEntry = curEntry->prev;
+	}
+
+	return curEntry;
+	
+}
+
+//=====================================================================
+// Function:	CleanUp
+// Description:	Clean up the #define strings
+// Parameters:	.
+// Returns:		.
+//=====================================================================
+void CleanUp()
+{
+	void *tPtr;
+
+	// free up the macros that were alloced
+	while (gLastMacro != NULL)
+	{
+
+		FreeMacroEntry(gLastMacro);
+
+		tPtr = gLastMacro;
+		gLastMacro = gLastMacro->prev;
+		SAFEFREE(tPtr);
+	}
+
+}
+
+//=====================================================================
+// Function:	FreeMacroEntry
+// Description:	Frees up the macro entry data, (parms, lines of text)
+// Parameters:	macEntry = pointer to the MACROENTRY structure
+// Returns:		.
+//=====================================================================
+void FreeMacroEntry(MACROENTRY *macEntry)
+{
+	MACROTEXT *tText;
+	MACROTEXT *tNext;
+
+	SAFEFREE(macEntry->macroName);
+	SAFEFREE(macEntry->fileName);
+	// free the macro lines that were alloced
+	tText = macEntry->lastMacroLines;
+	while (tText != NULL)
+	{
+		tNext = tText->prev;
+		SAFEFREE(tText);
+		tText = tNext;
+	}
+
+	// free the text of the macro parms that were alloced
+	tText = macEntry->lastMacroParms;
+	while (tText != NULL)
+	{
+		tNext = tText->prev;
+		SAFEFREE(tText);
+		tText = tNext;
+	}
+}
+
+//=====================================================================
+// Function:	CheckMacroFunctions
+// Description:	Find if this text is a builtin macro function
+// Parameters:	lookString = non-null terminated string of possible
+//				and if found set global macro function call
+// Returns:		.
+//=====================================================================
+void CheckMacroFunctions(char *lookString, unsigned int *recognizedLen, char **invString)
+{
+
+	unsigned int i;
+	unsigned int sLen;
+	
+	for (i=0; i< NUM_MACRO_FUNCTIONS; i++)
+	{
+		sLen = strlen(gMacroFunctions[i].name);
+		if (!strncmp(gMacroFunctions[i].name, lookString, sLen))
+		{
+			gMacroCallFunction = gMacroFunctions[i].function;
+			*recognizedLen = sLen;
+			*invString = NULL;
+			return;
+		}
+	}
+}
+
+//=====================================================================
+// Function:	FindAlphaNum
+// Description:	Find a whole alpha numeric string, ie consists of
+//				[A-Za-z0-9_] only
+// Parameters:	srcStr = source string to search through.
+//				sLen = unsinged int pointer to length of string found
+// Returns:		pointer to found start of string.
+//				NULL if none.
+//=====================================================================
+char *FindAlphaNum(char *srcStr, unsigned int *sLen)
+{
+	char curChar;
+	char *foundStr;
+
+	while (*srcStr != '\0')
+	{
+		curChar = toupper(*srcStr);
+		if ((curChar >= 'A') && (curChar <= 'Z'))
+			break;
+
+		if ((curChar >= '0') && (curChar <='9'))
+			break;
+
+		if (curChar == '_')
+			break;
+
+		srcStr++;
+	}
+
+	if (*srcStr == '\0')
+	{
+		return NULL;
+	}
+
+	foundStr = srcStr;
+
+	*sLen = 0;
+	// now search for end of string of [A-Za-z0-9_]
+	while (*srcStr != '\0')
+	{
+		curChar = toupper(*srcStr);
+		if ((curChar < 'A') || (curChar > 'Z'))
+		{
+			if ((curChar < '0') || (curChar > '9'))
+			{
+				if (curChar != '_')
+					break;
+			}
+		}
+
+		(*sLen)++;
+		srcStr++;
+	}
+
+	return foundStr;
+
+}
+
+//=====================================================================
+// Function:	FindDefineParm
+// Description:	Find if the MACROENTRY->macroText linked list contains
+//				replaceable parameters.
+// Parameters:	srcParms = pointer to MACROENTRY structure for source
+//						parameters
+//				invParms = MACROENTRY pointer to invocation parameters
+//				lookString = non-null terminated string of possible
+//							replaceable string
+//				recognizedLen = replacement string matched length
+//				invString = invocation string to replace with
+// Returns:		pointer to first character found in lookstring
+//=====================================================================
+char *FindDefineParm(MACROENTRY *srcParms, MACROENTRY *invParms, 
+						char *lookString, unsigned int *recognizedLen, char **invString)
+{
+	MACROTEXT *srcText;
+	MACROTEXT *invText;
+	char *checkStr;
+	unsigned int checkLen;
+	unsigned int sLen;
+
+	checkStr = lookString;
+	*invString = NULL;
+
+	// first search for first [A-Za-z0-9_] only string
+	checkStr = FindAlphaNum(lookString, &checkLen);
+
+	while (checkStr != NULL)
+	{
+		// check all the #define parameters for match
+		srcText = srcParms->firstMacroParms;
+		invText = invParms->firstMacroParms;
+		while (srcText)
+		{
+			sLen = strlen(srcText->macroText);
+			// lengths should match
+			if (sLen == checkLen)
+			{
+				if (!strncmp(checkStr, srcText->macroText, checkLen))
+				{
+					// it matched so return replacement text
+					*invString = invText->macroText;
+					// and length that we reconized
+					*recognizedLen = checkLen;
+					return checkStr;
+				}
+			}
+
+			srcText = srcText->next;
+			invText = invText->next;
+		}
+
+		// not found yet, so go to next string.
+		checkStr = FindAlphaNum(checkStr+checkLen, &checkLen);
+	}
+
+	return NULL;
+}
+
+//=====================================================================
+// Function:	FindReplaceParm
+// Description:	Find if the MACROENTRY->macroText linked list contains
+//				a replaceable parameters.
+// Parameters:	srcParms = pointer to MACROENTRY structure for source
+//						parameters
+//				invParms = MACROENTRY pointer to invocation parameters
+//				lookString = non-null terminated string of possible
+//							replaceable string
+//				recognizedLen = replacement string matched length
+//				invString = invocation string to replace with
+// Returns:		.
+//=====================================================================
+void FindReplaceParm(MACROENTRY *srcParms, MACROENTRY *invParms, 
+						char *lookString, unsigned int *recognizedLen, char **invString)
+{
+	unsigned int sLen;
+	MACROTEXT *srcText;
+	MACROTEXT *invText;
+
+	*recognizedLen = 0;
+	*invString = NULL;
+
+	srcText = srcParms->firstMacroParms;
+	invText = invParms->firstMacroParms;
+
+	if (srcText != NULL)
+	{
+		// go until srcText # strings ends
+		while (srcText != NULL)
+		{
+			sLen = strlen(srcText->macroText);
+			if (!strncmp(srcText->macroText, lookString, sLen))
+			{
+				// found it so return src, replacement string
+				*recognizedLen = strlen(srcText->macroText);
+				*invString = invText->macroText;
+				// call function macro if it was invoked prior.
+				if (gMacroCallFunction != NULL)
+				{
+					gMacroCallFunction(lookString, recognizedLen, invString);
+					gMacroCallFunction = NULL;
+				}
+				return;
+			}
+
+			srcText = srcText->next;
+			invText = invText->next;
+		}
+	}
+
+	// ok, it wasn't found, look through builtin macro functions
+	CheckMacroFunctions(lookString, recognizedLen, invString);
+}
+
+//=====================================================================
+// Function:	ReplaceMacroParms
+// Description:	Replace macro parameters when macro was defined, with
+//				those specified on the macro invocation line
+// Parameters:	srcLine = source line to replace src macro parms with
+//				destLine = destination line save to.
+//				invocation macro parameters.
+//				parseMacro = currently parsing macro entry
+//				invParms = invocation macro entry
+// Returns:		.
+//=====================================================================
+void ReplaceMacroParms(char *srcLine, char *destLine, 
+							MACROENTRY *srcParms, MACROENTRY *invParms)
+{
+	char *findReplace;
+	char *invString;
+	unsigned int sLen;
+	unsigned int dLen;
+	unsigned int copyLen;
+	unsigned int subLen;
+	unsigned int recognizedLen;
+
+	destLine[0]= '\0';
+
+	sLen = strlen(srcLine);
+	dLen = 0;
+
+	while (sLen > 0)
+	{
+		// strtok might work better except it modifies the string, so
+		// kind of do my own....
+		if (!srcParms->bIsDefine)
+		{
+			findReplace = strchr(srcLine, '%');
+			if (findReplace != NULL)
+			{
+				// bypass % sign in findReplacement
+				findReplace++;
+				// figure out length of source before %
+				copyLen = (findReplace - srcLine)-1;
+				// check if there is a replacement string
+				FindReplaceParm(srcParms, invParms, findReplace, &recognizedLen, &invString);
+			}
+			else
+			{
+				strcat(destLine, srcLine);
+				return;
+			}
+		}
+		else
+		{
+			findReplace = FindDefineParm(srcParms, invParms, srcLine, &recognizedLen, &invString);
+			if (findReplace != NULL)
+			{
+				// figure out length of source before %
+				copyLen = findReplace - srcLine;
+			}
+			else
+			{
+				strcat(destLine, srcLine);
+				return;
+			}
+		}
+
+
+		if (invString != NULL)
+		{
+			// figure out how much we are going to substitute
+			subLen = strlen(invString);
+		}
+		else
+		{
+			subLen = 0;
+		}
+
+		if ((dLen + copyLen + subLen) > MAXSAVELINE)
+		{
+			LexError("Macro string overrun.\n");
+			CleanUp();
+			exit(ERROR_MACRO_OVERRUN);
+		}
+
+		if (copyLen > 0)
+		{
+			strncat(destLine, srcLine, copyLen);
+			dLen += copyLen;
+		}
+
+		srcLine += copyLen;
+		sLen -= copyLen;
+		// in macro so skip % part of variable
+		if (!srcParms->bIsDefine)
+		{
+			// skip %, also
+			srcLine++;
+			sLen--;
+		}
+
+		if (invString != NULL)
+		{
+			strcat(destLine, invString);
+			dLen += strlen(invString);
+		}
+
+		srcLine += recognizedLen;
+		sLen -= recognizedLen;
+	}
+
+}
+
+//=====================================================================
+// Function:	SaveMacroText
+// Description:	Adds a string to a linked list of MACROTEXT structures
+// Parameters:	srcText = pointer to source text to save
+//				lastMacroText = last allocated, or NULL
+// Returns:		newly allocated MACROTEXT structure, or NULL
+//=====================================================================
+MACROTEXT *SaveMacroText(char *srcText, MACROTEXT *lastMacroText)
+{
+	MACROTEXT *curMacroText;
+
+	curMacroText = (MACROTEXT *)malloc(sizeof(MACROTEXT));
+	if (curMacroText == NULL)
+	{
+		return NULL;
+	}
+	else
+	{
+		// no next entry but set up previous with previously alloced macro parameter
+		curMacroText->next = NULL;
+		curMacroText->prev = lastMacroText;
+
+		// if the macroParm pointer is null then we are the first allocated
+		// so if not set the last one allocate next pointer to newly allocated structure
+		if (lastMacroText != NULL)
+		{
+			lastMacroText->next = curMacroText;
+		}
+
+		/* %%%%% this should be set up in memory pools. */
+		curMacroText->macroText = strdup(srcText);
+		if (curMacroText->macroText == NULL)
+		{
+			SAFEFREE(curMacroText);
+			return NULL;
+		}
+	}
+
+	return curMacroText;
+}
+
+//=====================================================================
+// Function:	ParseBuiltInMacroParms
+// Description:	parse parameters of string and fill in MACROENTRY
+//				structure.
+// Parameters:	parsedMacro = pointer to MACROENTRY structure that gets
+//				filled in with parameter pointers and count
+//				parmStr = string to parse parameters from
+// Returns:		false if error
+//=====================================================================
+bool ParseBuiltInMacroParms(MACROENTRY *parsedMacro, char *parmStr)
+{
+	char *endStr;
+	char *foundParm;
+	MACROTEXT *prevMT;
+	MACROTEXT *curMT;
+
+	parsedMacro->numParms = 0;
+	parsedMacro->firstMacroParms = NULL;
+	
+	foundParm = strdup(parmStr);
+	if (foundParm == NULL)
+	{
+		LexError("Out of memory parsing bultin macro parameters.\n");
+		return false;
+	}
+
+	// assume a ')' is on the end.
+	endStr = strrchr(foundParm, ')');
+	if (endStr == NULL)
+	{
+		LexWarning("Ending parenthesis not found for macro %s.\n", parsedMacro->macroName);
+		endStr = foundParm + strlen(foundParm);
+	}
+
+	prevMT = NULL;
+	// strip out and seperate parameters
+	while (foundParm < endStr)
+	{
+		// allocate a macro text structure
+		curMT = (MACROTEXT *)malloc(sizeof(MACROTEXT));
+		if (curMT == NULL)
+		{
+			free(parmStr);
+			LexError("Out of memory parsing bultin macro parameters.\n");
+			return false;
+		} 
+		curMT->next = NULL;
+		curMT->prev = prevMT;
+		parsedMacro->numParms++;
+
+		if (prevMT != NULL)
+		{
+			prevMT->next = curMT;
+		}
+		else
+		{
+			parsedMacro->firstMacroParms = curMT;
+		}
+
+		curMT->macroText = foundParm;
+		// search for next parameters, delimited by comma
+		foundParm = strchr(foundParm, ',');
+		if (foundParm == NULL)
+		{
+			foundParm = endStr;
+			*foundParm = '\0';
+		}
+		else
+		{
+			// skip comma
+			*foundParm = '\0';
+			foundParm++;
+		}
+		prevMT = curMT;
+	}
+
+	return true;
+}
+
+//=====================================================================
+// Function:	MacroMathFunction
+// Description:	Comes here after macro replacement is done to perform
+//				some mathematic function on parameter (macro replacement
+//				 string (ie, register))
+// Parameters:	invMacro = macroentry pointer containing macro information
+//				recognizedLen = # characters recoginized so far
+//				invStr = invoked replacement string so far
+//				mathStr = "-", "+", etc for mathematic function
+// Returns:		new recognizedLen, invStr, with incremented #
+//=====================================================================
+void MacroMathFunction(MACROENTRY *invMacro, unsigned int *recognizedLen, char **invStr,
+						char *mathStr)
+{
+	char *numStartStr;
+	unsigned int sLen;
+	char numberStr[256];
+	unsigned int number;
+	char *operand;
+
+
+	// verify enough paramters to complete operation
+	if (invMacro->numParms != 2)
+	{
+		LexError("Two parameters are required for %s macro\n", invMacro->macroName);
+		return;
+	}
+
+	// get second macro parm, which is add by amount.
+	operand = invMacro->firstMacroParms->next->macroText;
+
+	// first find inner most bracket if any
+	numStartStr = strrchr(*invStr, ']');
+	if (numStartStr == NULL)
+	{
+		numStartStr = strrchr(*invStr, ')');
+	}
+
+	if (numStartStr != NULL)
+	{
+		if ((strlen(*invStr)+strlen(operand)+1) > MAXREPLACESTRING)
+		{
+			LexError("Out of Temporary string replacement memory inside builtin macro %s\n",
+					invMacro->macroName);
+		}
+		else
+		{
+			sLen = (numStartStr - *invStr);
+			gReplaceText[0] = '\0';
+			strncat(gReplaceText, *invStr, sLen);
+			strcat(gReplaceText, mathStr);
+			strcat(gReplaceText, operand);
+			strcat(gReplaceText, numStartStr);
+			*invStr = gReplaceText;
+		}
+	}
+	else
+	{
+		numStartStr = strpbrk(*invStr, "0123456789");
+		if (numStartStr != NULL)
+		{
+			// put up to number we found
+			sLen = numStartStr - *invStr;
+			if (sLen > MAXREPLACESTRING)
+				goto ErrOut;
+
+			gReplaceText[0] = '\0';
+			strncat(gReplaceText, *invStr, sLen);
+
+			switch (mathStr[0])
+			{
+				case '-':
+					number = atoi(numStartStr)-atoi(operand);
+					break;
+				case '+':
+					number = atoi(numStartStr)+atoi(operand);
+					break;
+			}
+			sprintf(numberStr, "%d", number);
+
+			if ((strlen(gReplaceText) + strlen(numberStr)) > MAXREPLACESTRING)
+				goto ErrOut;
+
+			strcat(gReplaceText, numberStr);
+
+			while ((*numStartStr != '\0') && (*numStartStr >= '0' && *numStartStr <= '9'))
+				numStartStr++;
+
+			if ((strlen(gReplaceText) + strlen(numStartStr)) > MAXREPLACESTRING)
+				goto ErrOut;
+
+			strcat(gReplaceText, numStartStr);
+
+			*invStr = gReplaceText;
+		}
+		else
+		{
+			if ((strlen(*invStr)+strlen(operand)+1) > MAXREPLACESTRING)
+			{
+				LexError("Out of Temporary string replacement memory inside builtin macro %s\n",
+					invMacro->macroName);
+			}
+			else
+			{
+				sprintf(gReplaceText, "%s%s%s", *invStr, mathStr, operand);
+				*invStr = gReplaceText;
+			}
+		}
+	}
+
+
+	return;
+
+ErrOut:
+	LexError("Out of Temporary string replacement memory inside builtin macro %s\n",
+				invMacro->macroName);
+	// skip ')'
+	(*recognizedLen)++;
+}
+
+//=====================================================================
+// Function:	MacroIncFunction
+// Description:	Comes here after macro replacement is done to increment
+//				macro replacement string (ie, register)
+// Parameters:	lookStr = string after '(', so we can get parameters
+//				recognizedLen = # characters recoginized so far
+//				invStr = invoked replacement string so far
+// Returns:		new recognizedLen, invStr, with incremented #
+//=====================================================================
+void MacroIncFunction(char *lookStr, unsigned int *recognizedLen, char **invStr)
+{
+	MACROENTRY tMEntry;
+	MACROTEXT parm1;
+	MACROTEXT parm2;
+
+	tMEntry.macroName = "%inc()";
+	tMEntry.numParms = 2;
+	tMEntry.firstMacroParms = &parm1;
+	parm1.prev = NULL;
+	parm1.next = &parm2;
+	parm1.macroText = *invStr;
+	parm2.prev = &parm1;
+	parm2.next = NULL;
+	parm2.macroText = "1";
+
+	MacroMathFunction(&tMEntry, recognizedLen, invStr, "+");
+	// skip ')'
+	(*recognizedLen)++;
+}
+
+//=====================================================================
+// Function:	MacroDecFunction
+// Description:	Comes here after macro replacement is done to decrement
+//				macro replacement string (ie, register)
+// Parameters:	lookStr = string after '(', so we can get parameters
+//				recognizedLen = # characters recoginized so far
+//				invStr = invoked replacement string so far
+// Returns:		new recognizedLen, invStr, with decremented #
+//=====================================================================
+void MacroDecFunction(char *lookStr, unsigned int *recognizedLen, char **invStr)
+{
+	MACROENTRY tMEntry;
+	MACROTEXT parm1;
+	MACROTEXT parm2;
+
+	tMEntry.macroName = "%dec()";
+	tMEntry.numParms = 2;
+	tMEntry.firstMacroParms = &parm1;
+	parm1.prev = NULL;
+	parm1.next = &parm2;
+	parm1.macroText = *invStr;
+	parm2.prev = &parm1;
+	parm2.next = NULL;
+	parm2.macroText = "1";
+
+	MacroMathFunction(&tMEntry, recognizedLen, invStr, "-");
+	// skip ')'
+	(*recognizedLen)++;
+}
+
+//=====================================================================
+// Function:	MacroAddFunction
+// Description:	Comes here after macro replacement is done to add
+//				macro replacement string (ie, register)
+// Parameters:	lookStr = string after '(', so we can get parameters
+//				recognizedLen = # characters recoginized so far
+//				invStr = invoked replacement string so far
+// Returns:		new recognizedLen, invStr, with incremented #
+//=====================================================================
+void MacroAddFunction(char *lookStr, unsigned int *recognizedLen, char **invStr)
+{
+	MACROENTRY tMEntry;
+	MACROTEXT *curMT;
+	MACROTEXT *nextMT;
+	unsigned int i;
+
+	tMEntry.macroName = "%add()";
+	if (strlen(lookStr) > MAXREPLACESTRING)
+	{
+		LexError("Out of Temporary string replacement memory inside builtin macro %add()\n");
+		return;
+	}
+	if (ParseBuiltInMacroParms(&tMEntry, lookStr))
+	{
+		MacroMathFunction(&tMEntry, recognizedLen, invStr, "+");
+		// skip ',' strlen(parm2)+ ')'
+		(*recognizedLen) += strlen(tMEntry.firstMacroParms->next->macroText)+2;
+	}
+
+	curMT = tMEntry.firstMacroParms;
+	// in this case only one string was allocated
+	free(curMT->macroText);
+	for (i=0; i<tMEntry.numParms; i++)
+	{
+		nextMT = curMT->next;
+		free(curMT);
+		curMT = nextMT;
+	}
+}
+
+//=====================================================================
+// Function:	MacroSubFunction
+// Description:	Comes here after macro replacement is done to subtract
+//				macro replacement string (ie, register)
+// Parameters:	invParms, parameters that macro was invoked with
+//				recognizedLen = # characters recoginized so far
+//				invStr = invoked replacement string so far
+// Returns:		new recognizedLen, invStr, with incremented #
+//=====================================================================
+void MacroSubFunction(char *lookStr, unsigned int *recognizedLen, char **invStr)
+{
+	MACROENTRY tMEntry;
+	MACROTEXT *curMT;
+	MACROTEXT *nextMT;
+	unsigned int i;
+
+	tMEntry.macroName = "%sub()";
+	if (ParseBuiltInMacroParms(&tMEntry, lookStr))
+	{
+		MacroMathFunction(&tMEntry, recognizedLen, invStr, "-");
+		// skip ',' strlen(parm2)+ ')'
+		(*recognizedLen) += strlen(tMEntry.firstMacroParms->next->macroText)+2;
+	}
+	curMT = tMEntry.firstMacroParms;
+	// in this case only one string was allocated
+	free(curMT->macroText);
+	for (i=0; i<tMEntry.numParms; i++)
+	{
+		nextMT = curMT->next;
+		free(curMT);
+		curMT = nextMT;
+	}
+}
+
+//=====================================================================
+// Function:	EndMacroParms
+// Description:	Does update and cleanup one end of macro parameters
+//				is reached
+// Parameters:	.
+// Returns:		.
+//=====================================================================
+void EndMacroParms()
+{
+	char *curFileName;
+	char *macroFileName;
+	char tempStr[1024];
+	char *macroText;
+
+	if (gbTempInsideMacro)
+	{
+		if (gTempParseMacro->numParms != gTempMacro->numParms)
+		{
+			LexError("Macro invocation number of parameters do not match macro definition, skipping\n");
+			BEGIN(INITIAL);
+			SAFEFREE(gTempMacro);
+		}
+		else
+		{
+			// we got all the parameters for the MACRO invocation, so start inside
+			// the macro now, by saving off current state on stack
+			gIncludeStack[gIncludeStackIndex].lineNo = yylineno;
+			gIncludeStack[gIncludeStackIndex].fileName = gCurFileName;
+//			gIncludeStack[gIncludeStackIndex].fileHandle = yyin;
+//fprintf( stderr, "Chris fix this code with myin stuff\n" );
+			gIncludeStack[gIncludeStackIndex].prevString = myin;
+			gIncludeStack[gIncludeStackIndex].nextString = NULL;
+			gIncludeStack[gIncludeStackIndex].lastInvokeMacro = gInvokeMacro;
+			gIncludeStack[gIncludeStackIndex].lastParseMacro = gParseMacro;
+			gIncludeStack[gIncludeStackIndex].lastMacroLineParse = gMacroLineParse;
+			gIncludeStack[gIncludeStackIndex].lastbInsideMacro = gbInsideMacro;
+			gIncludeStack[gIncludeStackIndex].lastbInsideInclude = gbInsideInclude;
+			gIncludeStack[gIncludeStackIndex].buffer = YY_CURRENT_BUFFER;
+			gIncludeStack[gIncludeStackIndex].lastbProcessingIFDEF = gbProcessingIFDEF;
+			gIncludeStackIndex++;
+
+			gParseMacro = gTempParseMacro;
+			gInvokeMacro = gTempMacro;
+			gbInsideMacro = gbTempInsideMacro;
+
+			gbTempInsideMacro = false;
+
+//			yyin = NULL;
+			myin = NULL;
+			curFileName = gCurFileName;
+			if (curFileName == NULL)
+				curFileName = "";
+
+			macroFileName = gParseMacro->fileName;
+			if (macroFileName == NULL)
+				macroFileName = "";
+
+			sprintf(tempStr, "%s(%d) : References ->\n%s", curFileName, yylineno, macroFileName); 
+			gCurFileName = strdup(tempStr);
+			gMacroLineParse = gParseMacro->firstMacroLines;
+
+			macroText = gMacroLine;
+			// if no replacement text, just use source line
+			if (gParseMacro->firstMacroParms == NULL)
+			{
+				macroText = gMacroLineParse->macroText;
+			}
+			else
+			{
+				// replace the macro parameters
+				ReplaceMacroParms(gMacroLineParse->macroText, gMacroLine, gParseMacro, gInvokeMacro);
+			}
+
+			yylineno = gParseMacro->lineNo;
+			if (gParseMacro->nLines >= 1)
+			{
+				strcpy(gSaveLine, macroText);
+			}
+
+//			if (gExpandMacros && (gParseMacro->nLines >= 1))
+//			{
+//				// in case there is anything there dump it out
+//				GenDebugLine();
+//				GenListString();			
+//				if (gInvokeMacro->nLines >= 1)
+//					GenSwitchFileNames(macroFileName);
+//			}
+
+			BEGIN(gInvokeState);
+			yy_scan_string(macroText);
+			gInvokeState = INITIAL;
+		}
+	}
+	else
+	{
+		if (gLastMacro != NULL)
+		{
+			gLastMacro->next = gTempMacro;
+		}
+		gLastMacro = gTempMacro;
+		BEGIN(MACROBODY);
+	}
+}
+
+//=====================================================================
+// Function:	FindSwizzleValue
+// Description:	see if valid swizzle value and return the bits
+// Parameters:	swizzleTex = pointer to characters to analyze
+// Returns:		unsigned int = bits for swizzle values, or 0 for error
+//=====================================================================
+unsigned int FindSwizzleValue(char *swizzleText)
+{
+	unsigned int swizzleBits;
+	unsigned int sLen;
+	unsigned int i;
+	unsigned int lastMask;
+
+	sLen = strlen(swizzleText);
+	swizzleBits = 0;
+	lastMask = 0;
+
+	for (i=0; i<sLen; i++)
+	{
+		switch (swizzleText[i])
+		{
+		case 'x':
+			swizzleBits |= (WRITEMASK_X << (4*(3-i)));
+			lastMask = WRITEMASK_X;
+			break;
+		case 'y':
+			swizzleBits |= (WRITEMASK_Y << (4*(3-i)));
+			lastMask = WRITEMASK_Y;
+			break;
+		case 'z':
+			swizzleBits |= (WRITEMASK_Z << (4*(3-i)));
+			lastMask = WRITEMASK_Z;
+			break;
+		case 'w':
+			swizzleBits |= (WRITEMASK_W << (4*(3-i)));
+			lastMask = WRITEMASK_W;
+			break;
+		}
+	}
+
+	for (; i<4; i++)
+	{
+		swizzleBits |= (lastMask << (4*(3-i)));
+	}
+
+	return swizzleBits;
+}
+
+#if 0
+unsigned int FindSwizzleValue(char *swizzleText)
+{
+
+	DWORD swizzleBits;
+	DWORD sLen;
+	DWORD i;
+	DWORD lastIndex;
+
+	sLen = strlen(swizzleText);
+	swizzleBits = 0;
+	lastIndex = 0;
+
+	for (i=0; i<sLen; i++)
+	{
+		switch (swizzleText[i])
+		{
+		case 'x':
+			swizzleBits |= (0 << (D3DVS_SWIZZLE_SHIFT + (i * 2)));
+			lastIndex = 0;
+			break;
+		case 'y':
+			swizzleBits |= (1 << (D3DVS_SWIZZLE_SHIFT + (i * 2)));
+			lastIndex = 1;
+			break;
+		case 'z':
+			swizzleBits |= (2 << (D3DVS_SWIZZLE_SHIFT + (i * 2)));
+			lastIndex = 2;
+			break;
+		case 'w':
+			swizzleBits |= (3 << (D3DVS_SWIZZLE_SHIFT + (i * 2)));
+			lastIndex = 3;
+			break;
+		}
+	}
+
+	for (; i<4; i++)
+	{
+		swizzleBits |= (lastIndex << (D3DVS_SWIZZLE_SHIFT + (i * 2)));
+	}
+
+	return swizzleBits;
+
+	
+}
+#endif
+
+//=====================================================================
+// Function:	FindRegisterMask
+// Description:	Look through register mask strings
+// Parameters:	findName = name to lookup
+// Returns:		unsigned int with token value
+//=====================================================================
+unsigned int MakeRegisterMask(char *findName)
+{
+
+	unsigned int regMask;
+	char *findFirst;
+
+	regMask = 0;
+
+	findFirst = strchr(findName, 'x');
+	if (findFirst != NULL)
+	{
+		if (strchr(findFirst+1, 'x') != NULL)
+		{
+			return 0;
+		}
+
+		regMask |= WRITEMASK_X;
+	}
+
+	findFirst = strchr(findName, 'y');
+	if (findFirst != NULL)
+	{
+		regMask |= WRITEMASK_Y;
+		// invalide write mask, must be swizzle
+		if (strchr(findFirst+1, 'x') != NULL)
+		{
+			return 0;
+		}
+
+		if (strchr(findFirst+1, 'y') != NULL)
+		{
+			return 0;
+		}
+
+	}
+
+	findFirst = strchr(findName, 'z');
+	if (findFirst != NULL)
+	{
+		regMask |= WRITEMASK_Z;
+		if (strchr(findFirst+1, 'x') != NULL)
+		{
+			return 0;
+		}
+
+		if (strchr(findFirst+1, 'y') != NULL)
+		{
+			return 0;
+		}
+
+		if (strchr(findFirst+1, 'z') != NULL)
+		{
+			return 0;
+		}
+	}
+
+	findFirst = strchr(findName, 'w');
+	if (findFirst != NULL)
+	{
+
+		regMask |= WRITEMASK_W;
+		if (strchr(findFirst+1, 'x') != NULL)
+		{
+			return 0;
+		}
+
+		if (strchr(findFirst+1, 'y') != NULL)
+		{
+			return 0;
+		}
+
+		if (strchr(findFirst+1, 'z') != NULL)
+		{
+			return 0;
+		}
+
+		if (strchr(findFirst+1, 'w') != NULL)
+		{
+			return 0;
+		}
+	}
+
+	return regMask;
+	
+}
+
+//=====================================================================
+// Function:	LexError
+// Description:	output an error to the stdout
+// Parameters:	typical printf like format
+// Returns:		.
+//=====================================================================
+void LexError(char *format, ...)
+{
+	char errstring[4096];
+	va_list marker;
+
+//	fprintf( stderr,"(%d) : Error : ", yylineno);
+	if ( gbInsideInclude )
+		{
+		sprintf( errstring, "%s", gCurFileName );
+		sprintf( errstring+strlen(errstring),"(%d) : Error : ", yylineno);
+		}
+	else
+		{
+		sprintf( errstring,"(%d) : Error : ", yylineno);
+		}
+
+	va_start(marker, format);
+//	vprintf(format, marker);
+	vsprintf(errstring+strlen(errstring), format, marker);
+	va_end(marker);
+	errors.set( errstring );
+}
+
+//=====================================================================
+// Function:	LexWarning
+// Description:	output a warning to the stdout
+// Parameters:	typical printf like format
+// Returns:		.
+//=====================================================================
+void LexWarning(char *format, ...)
+{
+	char errstring[4096];
+	va_list marker;
+
+//	fprintf( stderr,"(%d) : warning : ", yylineno);
+	if ( gbInsideInclude )
+		sprintf( errstring, "%s", gCurFileName );
+	sprintf( errstring+strlen(errstring),"(%d) : Warning : ", yylineno);
+//	sprintf( errstring,"(%d) : Warning : ", yylineno);
+
+	va_start(marker, format);
+//	vprintf(format, marker);
+	vsprintf(errstring+strlen(errstring), format, marker);
+	va_end(marker);
+	errors.set( errstring );
+}
+
+//=====================================================================
+// Function:	DebugUnhandledState
+// Description:	Come here in debug mode, when a state isn't handled
+//				for the Lexer
+// Parameters:	.
+// Returns:		.
+//=====================================================================
+void DebugUnhandledState()
+{
+	fprintf( stderr,"Unhandled state reached, with %s text.\n", yytext);
+}
+
+//=====================================================================
+// Function:	FindOpcode
+// Description:	Look through opcodes and see if in the table
+// Parameters:	findName = name to lookup
+// Returns:		OPCODEMAP * = pointer to opcode map entry, if found
+//=====================================================================
+OPCODEMAP *FindOpcode(char *findName)
+{
+
+	unsigned i;
+
+	// just do linear search for now
+	for (i=0; i<NUMOPCODES; i++)
+	{
+		if (!stricmp(theOpcodes[i].string, findName))
+		{
+			return &theOpcodes[i];
+		}
+
+	}
+
+	return NULL;
+}
+
+char *ReadTextFile(const char * filename)
+{
+	char path[3][32] = { ".\0",
+					     "../../data/programs\0",
+					     "../../../data/programs\0" };
+	char name[8192];
+	int i;
+
+    if (!filename) return 0;
+
+    struct _stat status;
+    int found = 0;
+    for ( i = 0; i < 3; i++ )
+    {
+	sprintf( name, "%s/%s", path[i], filename );
+
+	int fh = ::_open(name, _O_RDONLY);
+
+	if(fh != -1)
+        {
+            int result = _fstat( fh, &status );
+            if( result != 0 )
+            {
+                fprintf( stderr, "An fstat error occurred.\n" );
+                break;
+            }
+            ::_close( fh );
+	    found = i+1;
+            break;
+        }
+    }
+
+    if ( 0 == found )
+	{
+		fprintf(stderr,"Cannot open \"%s\" for stat read!\n", filename);
+		return NULL;
+	}
+    long size = status.st_size;
+
+    char * buf = new char[size+1];
+
+	FILE *fp = 0;
+    if (!(fp = fopen(name, "r")))
+	{
+		fprintf(stderr,"Cannot open \"%s\" for read!\n", name);
+		return NULL;
+	}
+
+	int bytes;
+	bytes = fread(buf, 1, size, fp);
+
+    buf[bytes] = 0;
+
+	fclose(fp);
+	return buf;
+}
+
+bool vs10_init_more();
+
+bool vs10_init(char* inputString)
+{
+	BEGIN(SAVELINE);
+    myin = inputString;
+	line_incr = 0;
+	return vs10_init_more();
+}
+
+#ifndef vs10_wrap
+int vs10_wrap(void)
+{
+  return(1);
+}
+#endif
Index: /RenderSystems/GL/src/nvparse/_vs1.0_parser.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/_vs1.0_parser.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/_vs1.0_parser.cpp	(revision 5)
@@ -0,0 +1,1873 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/* A Bison parser, made by GNU Bison 1.875.  */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+/* Written by Richard Stallman by simplifying the original so called
+   ``semantic'' parser.  */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+   infringing on user name space.  This should be done even for local
+   variables, as they might otherwise be expanded by user macros.
+   There are some unavoidable exceptions within include files to
+   define necessary library symbols; they are noted "INFRINGES ON
+   USER NAME SPACE" below.  */
+
+/* Identify Bison output.  */
+#define YYBISON 1
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+/* If NAME_PREFIX is specified substitute the variables and functions
+   names.  */
+#define yyparse vs10_parse
+#define yylex   vs10_lex
+#define yyerror vs10_error
+#define yylval  vs10_lval
+#define yychar  vs10_char
+#define yydebug vs10_debug
+#define yynerrs vs10_nerrs
+
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     VERTEX_SHADER = 258,
+     ADD_INSTR = 259,
+     DP3_INSTR = 260,
+     DP4_INSTR = 261,
+     DST_INSTR = 262,
+     EXP_INSTR = 263,
+     EXPP_INSTR = 264,
+     FRC_INSTR = 265,
+     LIT_INSTR = 266,
+     LOG_INSTR = 267,
+     LOGP_INSTR = 268,
+     M3X2_INSTR = 269,
+     M3X3_INSTR = 270,
+     M3X4_INSTR = 271,
+     M4X3_INSTR = 272,
+     M4X4_INSTR = 273,
+     MAD_INSTR = 274,
+     MAX_INSTR = 275,
+     MIN_INSTR = 276,
+     MOV_INSTR = 277,
+     MUL_INSTR = 278,
+     NOP_INSTR = 279,
+     RCP_INSTR = 280,
+     RSQ_INSTR = 281,
+     SGE_INSTR = 282,
+     SLT_INSTR = 283,
+     SUB_INSTR = 284,
+     ILLEGAL = 285,
+     UNKNOWN_STRING = 286,
+     INTVAL = 287,
+     REGISTER = 288,
+     XYZW_MODIFIER = 289,
+     COMMENT = 290
+   };
+#endif
+#define VERTEX_SHADER 258
+#define ADD_INSTR 259
+#define DP3_INSTR 260
+#define DP4_INSTR 261
+#define DST_INSTR 262
+#define EXP_INSTR 263
+#define EXPP_INSTR 264
+#define FRC_INSTR 265
+#define LIT_INSTR 266
+#define LOG_INSTR 267
+#define LOGP_INSTR 268
+#define M3X2_INSTR 269
+#define M3X3_INSTR 270
+#define M3X4_INSTR 271
+#define M4X3_INSTR 272
+#define M4X4_INSTR 273
+#define MAD_INSTR 274
+#define MAX_INSTR 275
+#define MIN_INSTR 276
+#define MOV_INSTR 277
+#define MUL_INSTR 278
+#define NOP_INSTR 279
+#define RCP_INSTR 280
+#define RSQ_INSTR 281
+#define SGE_INSTR 282
+#define SLT_INSTR 283
+#define SUB_INSTR 284
+#define ILLEGAL 285
+#define UNKNOWN_STRING 286
+#define INTVAL 287
+#define REGISTER 288
+#define XYZW_MODIFIER 289
+#define COMMENT 290
+
+
+
+
+/* Copy the first part of user declarations.  */
+#line 3 "vs1.0_grammar.y"
+
+void yyerror(char *s);
+int yylex(void);
+
+#include <math.h>
+#include <string>
+
+#include <stdlib.h>
+#include "vs1.0_inst_list.h"
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+//extern bool gbTempInsideMacro;
+//extern unsigned int &base_linenumber;
+void LexError(char *format, ...);
+extern int line_incr;
+
+#define do_linenum_incr()		{ line_number+=line_incr; line_incr = 0; }
+//int get_linenum()			{ return( gbTempInsideMacro ? base_linenumber : line_number ); }
+int get_linenum()			{ return( line_number ); }
+
+#define YYDEBUG 1
+
+
+
+/* Enabling traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+/* Enabling verbose error messages.  */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#line 27 "vs1.0_grammar.y"
+typedef union YYSTYPE {
+  int ival;
+  unsigned int lval;
+  float fval;
+  char mask[4];
+  char *comment;
+  VS10Reg reg;
+  VS10InstPtr inst;
+  VS10InstListPtr instList;
+} YYSTYPE;
+/* Line 191 of yacc.c.  */
+#line 190 "_vs1.0_parser.c"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+/* Copy the second part of user declarations.  */
+
+
+/* Line 214 of yacc.c.  */
+#line 202 "_vs1.0_parser.c"
+
+#if ! defined (yyoverflow) || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols.  */
+
+# if YYSTACK_USE_ALLOCA
+#  define YYSTACK_ALLOC alloca
+# else
+#  ifndef YYSTACK_USE_ALLOCA
+#   if defined (alloca) || defined (_ALLOCA_H)
+#    define YYSTACK_ALLOC alloca
+#   else
+#    ifdef __GNUC__
+#     define YYSTACK_ALLOC __builtin_alloca
+#    endif
+#   endif
+#  endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+   /* Pacify GCC's `empty if-body' warning. */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+# else
+#  if defined (__STDC__) || defined (__cplusplus)
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   define YYSIZE_T size_t
+#  endif
+#  define YYSTACK_ALLOC malloc
+#  define YYSTACK_FREE free
+# endif
+#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+
+
+#if (! defined (yyoverflow) \
+     && (! defined (__cplusplus) \
+	 || (YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member.  */
+union yyalloc
+{
+  short yyss;
+  YYSTYPE yyvs;
+  };
+
+/* The size of the maximum gap between one aligned stack and the next.  */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+   N elements.  */
+# define YYSTACK_BYTES(N) \
+     ((N) * (sizeof (short) + sizeof (YYSTYPE))				\
+      + YYSTACK_GAP_MAXIMUM)
+
+/* Copy COUNT objects from FROM to TO.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if 1 < __GNUC__
+#   define YYCOPY(To, From, Count) \
+      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#  else
+#   define YYCOPY(To, From, Count)		\
+      do					\
+	{					\
+	  register YYSIZE_T yyi;		\
+	  for (yyi = 0; yyi < (Count); yyi++)	\
+	    (To)[yyi] = (From)[yyi];		\
+	}					\
+      while (0)
+#  endif
+# endif
+
+/* Relocate STACK from its old location to the new one.  The
+   local variables YYSIZE and YYSTACKSIZE give the old and new number of
+   elements in the stack, and YYPTR gives the new location of the
+   stack.  Advance YYPTR to a properly aligned location for the next
+   stack.  */
+# define YYSTACK_RELOCATE(Stack)					\
+    do									\
+      {									\
+	YYSIZE_T yynewbytes;						\
+	YYCOPY (&yyptr->Stack, Stack, yysize);				\
+	Stack = &yyptr->Stack;						\
+	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+	yyptr += yynewbytes / sizeof (*yyptr);				\
+      }									\
+    while (0)
+
+#endif
+
+#if defined (__STDC__) || defined (__cplusplus)
+   typedef signed char yysigned_char;
+#else
+   typedef short yysigned_char;
+#endif
+
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL  44
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   88
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS  44
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS  18
+/* YYNRULES -- Number of rules. */
+#define YYNRULES  59
+/* YYNRULES -- Number of states. */
+#define YYNSTATES  103
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   290
+
+#define YYTRANSLATE(YYX) 						\
+  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+static const unsigned char yytranslate[] =
+{
+       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+      36,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,    43,    37,    38,    39,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,    41,     2,    42,     2,     2,     2,     2,     2,    40,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
+       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
+      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
+      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
+      35
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const unsigned char yyprhs[] =
+{
+       0,     0,     3,     5,     8,    10,    12,    14,    16,    18,
+      20,    22,    24,    26,    28,    30,    35,    40,    44,    47,
+      49,    51,    53,    58,    65,    74,    79,    86,    92,   100,
+     108,   118,   123,   128,   135,   144,   146,   148,   150,   152,
+     154,   156,   158,   160,   162,   164,   166,   168,   170,   172,
+     174,   176,   178,   180,   182,   184,   186,   188,   190,   192
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yysigned_char yyrhs[] =
+{
+      45,     0,    -1,    46,    -1,    46,    47,    -1,    47,    -1,
+      48,    -1,    36,    -1,    49,    -1,    53,    -1,    54,    -1,
+      55,    -1,    56,    -1,    24,    -1,    35,    -1,     3,    -1,
+      57,    50,    37,    50,    -1,    38,    51,    39,    34,    -1,
+      51,    39,    34,    -1,    38,    51,    -1,    51,    -1,    33,
+      -1,    52,    -1,    40,    41,    32,    42,    -1,    40,    41,
+      33,    39,    34,    42,    -1,    40,    41,    33,    39,    34,
+      43,    32,    42,    -1,    40,    41,    33,    42,    -1,    40,
+      41,    33,    43,    32,    42,    -1,    40,    41,    38,    33,
+      42,    -1,    40,    41,    38,    33,    43,    32,    42,    -1,
+      40,    41,    38,    33,    39,    34,    42,    -1,    40,    41,
+      38,    33,    39,    34,    43,    32,    42,    -1,    58,    50,
+      37,    50,    -1,    59,    50,    37,    50,    -1,    60,    50,
+      37,    50,    37,    50,    -1,    61,    50,    37,    50,    37,
+      50,    37,    50,    -1,    22,    -1,    11,    -1,    25,    -1,
+      26,    -1,     8,    -1,     9,    -1,    12,    -1,    13,    -1,
+      10,    -1,    23,    -1,     4,    -1,     5,    -1,     6,    -1,
+       7,    -1,    21,    -1,    20,    -1,    28,    -1,    27,    -1,
+      14,    -1,    15,    -1,    16,    -1,    17,    -1,    18,    -1,
+      29,    -1,    19,    -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const unsigned short yyrline[] =
+{
+       0,    96,    96,   104,   110,   122,   127,   134,   135,   136,
+     137,   138,   139,   143,   147,   153,   159,   169,   179,   189,
+     200,   200,   204,   211,   246,   282,   287,   292,   297,   302,
+     307,   314,   320,   326,   332,   339,   343,   349,   353,   357,
+     361,   365,   369,   375,   381,   385,   389,   393,   397,   401,
+     405,   409,   413,   417,   421,   425,   429,   433,   437,   443
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE
+/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+static const char *const yytname[] =
+{
+  "$end", "error", "$undefined", "VERTEX_SHADER", "ADD_INSTR", "DP3_INSTR", 
+  "DP4_INSTR", "DST_INSTR", "EXP_INSTR", "EXPP_INSTR", "FRC_INSTR", 
+  "LIT_INSTR", "LOG_INSTR", "LOGP_INSTR", "M3X2_INSTR", "M3X3_INSTR", 
+  "M3X4_INSTR", "M4X3_INSTR", "M4X4_INSTR", "MAD_INSTR", "MAX_INSTR", 
+  "MIN_INSTR", "MOV_INSTR", "MUL_INSTR", "NOP_INSTR", "RCP_INSTR", 
+  "RSQ_INSTR", "SGE_INSTR", "SLT_INSTR", "SUB_INSTR", "ILLEGAL", 
+  "UNKNOWN_STRING", "INTVAL", "REGISTER", "XYZW_MODIFIER", "COMMENT", 
+  "'\\n'", "','", "'-'", "'.'", "'c'", "'['", "']'", "'+'", "$accept", 
+  "VS10Program", "InstSequence", "InstLine", "Instruction", 
+  "VECTORopinstruction", "genericReg", "genReg", "constantReg", 
+  "SCALARopinstruction", "UNARYopinstruction", "BINopinstruction", 
+  "TRIopinstruction", "VECTORop", "SCALARop", "UNARYop", "BINop", "TRIop", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+   token YYLEX-NUM.  */
+static const unsigned short yytoknum[] =
+{
+       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
+     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
+     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
+     285,   286,   287,   288,   289,   290,    10,    44,    45,    46,
+      99,    91,    93,    43
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const unsigned char yyr1[] =
+{
+       0,    44,    45,    46,    46,    47,    47,    48,    48,    48,
+      48,    48,    48,    48,    48,    49,    50,    50,    50,    50,
+      51,    51,    52,    52,    52,    52,    52,    52,    52,    52,
+      52,    53,    54,    55,    56,    57,    57,    58,    58,    58,
+      58,    58,    58,    59,    60,    60,    60,    60,    60,    60,
+      60,    60,    60,    60,    60,    60,    60,    60,    60,    61
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const unsigned char yyr2[] =
+{
+       0,     2,     1,     2,     1,     1,     1,     1,     1,     1,
+       1,     1,     1,     1,     1,     4,     4,     3,     2,     1,
+       1,     1,     4,     6,     8,     4,     6,     5,     7,     7,
+       9,     4,     4,     6,     8,     1,     1,     1,     1,     1,
+       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
+       1,     1,     1,     1,     1,     1,     1,     1,     1,     1
+};
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+   means the default is an error.  */
+static const unsigned char yydefact[] =
+{
+       0,    14,    45,    46,    47,    48,    39,    40,    43,    36,
+      41,    42,    53,    54,    55,    56,    57,    59,    50,    49,
+      35,    44,    12,    37,    38,    52,    51,    58,    13,     6,
+       0,     2,     4,     5,     7,     8,     9,    10,    11,     0,
+       0,     0,     0,     0,     1,     3,    20,     0,     0,     0,
+      19,    21,     0,     0,     0,     0,    18,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,    15,    17,
+      31,    32,     0,     0,    16,    22,     0,    25,     0,     0,
+       0,     0,     0,     0,     0,    27,     0,    33,     0,    23,
+       0,    26,     0,     0,     0,     0,    29,     0,    28,    34,
+      24,     0,    30
+};
+
+/* YYDEFGOTO[NTERM-NUM]. */
+static const yysigned_char yydefgoto[] =
+{
+      -1,    30,    31,    32,    33,    34,    49,    50,    51,    35,
+      36,    37,    38,    39,    40,    41,    42,    43
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -41
+static const yysigned_char yypact[] =
+{
+      52,   -41,   -41,   -41,   -41,   -41,   -41,   -41,   -41,   -41,
+     -41,   -41,   -41,   -41,   -41,   -41,   -41,   -41,   -41,   -41,
+     -41,   -41,   -41,   -41,   -41,   -41,   -41,   -41,   -41,   -41,
+       6,    52,   -41,   -41,   -41,   -41,   -41,   -41,   -41,   -29,
+     -29,   -29,   -29,   -29,   -41,   -41,   -41,   -28,   -31,   -23,
+     -22,   -41,   -18,   -12,    -4,    -3,    -2,   -25,   -29,     1,
+     -29,   -29,   -29,   -29,     2,     0,   -15,     5,   -41,   -41,
+     -41,   -41,     7,     8,   -41,   -41,     9,   -41,    14,   -13,
+     -29,   -29,   -27,    10,    13,   -41,    16,   -41,    12,   -41,
+      18,   -41,   -11,    11,   -29,    40,   -41,    19,   -41,   -41,
+     -41,    41,   -41
+};
+
+/* YYPGOTO[NTERM-NUM].  */
+static const yysigned_char yypgoto[] =
+{
+     -41,   -41,   -41,    53,   -41,   -41,   -40,    -8,   -41,   -41,
+     -41,   -41,   -41,   -41,   -41,   -41,   -41,   -41
+};
+
+/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
+   positive, shift that token.  If negative, reduce the rule which
+   number is the opposite.  If zero, do what YYDEFACT says.
+   If YYTABLE_NINF, syntax error.  */
+#define YYTABLE_NINF -1
+static const unsigned char yytable[] =
+{
+      52,    53,    54,    55,    46,    46,    44,    65,    66,    47,
+      57,    48,    48,    67,    58,    89,    90,    59,    68,    60,
+      70,    71,    72,    73,    76,    61,    84,    77,    78,    85,
+      86,    96,    97,    62,    63,    69,    74,    64,    79,    56,
+      87,    88,    75,    82,    80,    81,    83,    92,    93,    94,
+      95,   101,    91,    98,    99,     1,     2,     3,     4,     5,
+       6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
+      16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
+      26,    27,   100,   102,    45,     0,     0,    28,    29
+};
+
+static const yysigned_char yycheck[] =
+{
+      40,    41,    42,    43,    33,    33,     0,    32,    33,    38,
+      41,    40,    40,    38,    37,    42,    43,    39,    58,    37,
+      60,    61,    62,    63,    39,    37,    39,    42,    43,    42,
+      43,    42,    43,    37,    37,    34,    34,    39,    33,    47,
+      80,    81,    42,    34,    37,    37,    32,    34,    32,    37,
+      32,    32,    42,    42,    94,     3,     4,     5,     6,     7,
+       8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
+      18,    19,    20,    21,    22,    23,    24,    25,    26,    27,
+      28,    29,    42,    42,    31,    -1,    -1,    35,    36
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const unsigned char yystos[] =
+{
+       0,     3,     4,     5,     6,     7,     8,     9,    10,    11,
+      12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
+      22,    23,    24,    25,    26,    27,    28,    29,    35,    36,
+      45,    46,    47,    48,    49,    53,    54,    55,    56,    57,
+      58,    59,    60,    61,     0,    47,    33,    38,    40,    50,
+      51,    52,    50,    50,    50,    50,    51,    41,    37,    39,
+      37,    37,    37,    37,    39,    32,    33,    38,    50,    34,
+      50,    50,    50,    50,    34,    42,    39,    42,    43,    33,
+      37,    37,    34,    32,    39,    42,    43,    50,    50,    42,
+      43,    42,    34,    32,    37,    32,    42,    43,    42,    50,
+      42,    32,    42
+};
+
+#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
+# define YYSIZE_T __SIZE_TYPE__
+#endif
+#if ! defined (YYSIZE_T) && defined (size_t)
+# define YYSIZE_T size_t
+#endif
+#if ! defined (YYSIZE_T)
+# if defined (__STDC__) || defined (__cplusplus)
+#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYSIZE_T size_t
+# endif
+#endif
+#if ! defined (YYSIZE_T)
+# define YYSIZE_T unsigned int
+#endif
+
+#define yyerrok		(yyerrstatus = 0)
+#define yyclearin	(yychar = YYEMPTY)
+#define YYEMPTY		(-2)
+#define YYEOF		0
+
+#define YYACCEPT	goto yyacceptlab
+#define YYABORT		goto yyabortlab
+#define YYERROR		goto yyerrlab1
+
+
+/* Like YYERROR except do call yyerror.  This remains here temporarily
+   to ease the transition to the new meaning of YYERROR, for GCC.
+   Once GCC version 2 has supplanted version 1, this can go.  */
+
+#define YYFAIL		goto yyerrlab
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)					\
+do								\
+  if (yychar == YYEMPTY && yylen == 1)				\
+    {								\
+      yychar = (Token);						\
+      yylval = (Value);						\
+      yytoken = YYTRANSLATE (yychar);				\
+      YYPOPSTACK;						\
+      goto yybackup;						\
+    }								\
+  else								\
+    { 								\
+      yyerror ("syntax error: cannot back up");\
+      YYERROR;							\
+    }								\
+while (0)
+
+#define YYTERROR	1
+#define YYERRCODE	256
+
+/* YYLLOC_DEFAULT -- Compute the default location (before the actions
+   are run).  */
+
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N)         \
+  Current.first_line   = Rhs[1].first_line;      \
+  Current.first_column = Rhs[1].first_column;    \
+  Current.last_line    = Rhs[N].last_line;       \
+  Current.last_column  = Rhs[N].last_column;
+#endif
+
+/* YYLEX -- calling `yylex' with the right arguments.  */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#endif
+
+/* Enable debugging if requested.  */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args)			\
+do {						\
+  if (yydebug)					\
+    YYFPRINTF Args;				\
+} while (0)
+
+# define YYDSYMPRINT(Args)			\
+do {						\
+  if (yydebug)					\
+    yysymprint Args;				\
+} while (0)
+
+# define YYDSYMPRINTF(Title, Token, Value, Location)		\
+do {								\
+  if (yydebug)							\
+    {								\
+      YYFPRINTF (stderr, "%s ", Title);				\
+      yysymprint (stderr, 					\
+                  Token, Value);	\
+      YYFPRINTF (stderr, "\n");					\
+    }								\
+} while (0)
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (cinluded).                                                   |
+`------------------------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_stack_print (short *bottom, short *top)
+#else
+static void
+yy_stack_print (bottom, top)
+    short *bottom;
+    short *top;
+#endif
+{
+  YYFPRINTF (stderr, "Stack now");
+  for (/* Nothing. */; bottom <= top; ++bottom)
+    YYFPRINTF (stderr, " %d", *bottom);
+  YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top)				\
+do {								\
+  if (yydebug)							\
+    yy_stack_print ((Bottom), (Top));				\
+} while (0)
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced.  |
+`------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_reduce_print (int yyrule)
+#else
+static void
+yy_reduce_print (yyrule)
+    int yyrule;
+#endif
+{
+  int yyi;
+  unsigned int yylineno = yyrline[yyrule];
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
+             yyrule - 1, yylineno);
+  /* Print the symbols being reduced, and their result.  */
+  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
+    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
+  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
+}
+
+# define YY_REDUCE_PRINT(Rule)		\
+do {					\
+  if (yydebug)				\
+    yy_reduce_print (Rule);		\
+} while (0)
+
+/* Nonzero means print parse trace.  It is left uninitialized so that
+   multiple parsers can coexist.  */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YYDSYMPRINT(Args)
+# define YYDSYMPRINTF(Title, Token, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks.  */
+#ifndef	YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+   if the built-in stack extension method is used).
+
+   Do not make this value too large; the results are undefined if
+   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+   evaluated with infinite-precision integer arithmetic.  */
+
+#if YYMAXDEPTH == 0
+# undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+#  if defined (__GLIBC__) && defined (_STRING_H)
+#   define yystrlen strlen
+#  else
+/* Return the length of YYSTR.  */
+static YYSIZE_T
+#   if defined (__STDC__) || defined (__cplusplus)
+yystrlen (const char *yystr)
+#   else
+yystrlen (yystr)
+     const char *yystr;
+#   endif
+{
+  register const char *yys = yystr;
+
+  while (*yys++ != '\0')
+    continue;
+
+  return yys - yystr - 1;
+}
+#  endif
+# endif
+
+# ifndef yystpcpy
+#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+#   define yystpcpy stpcpy
+#  else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+   YYDEST.  */
+static char *
+#   if defined (__STDC__) || defined (__cplusplus)
+yystpcpy (char *yydest, const char *yysrc)
+#   else
+yystpcpy (yydest, yysrc)
+     char *yydest;
+     const char *yysrc;
+#   endif
+{
+  register char *yyd = yydest;
+  register const char *yys = yysrc;
+
+  while ((*yyd++ = *yys++) != '\0')
+    continue;
+
+  return yyd - 1;
+}
+#  endif
+# endif
+
+#endif /* !YYERROR_VERBOSE */
+
+
+
+
+#if YYDEBUG
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yysymprint (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  /* Pacify ``unused variable'' warnings.  */
+  (void) yyvaluep;
+
+  if (yytype < YYNTOKENS)
+    {
+      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+# ifdef YYPRINT
+      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# endif
+    }
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  switch (yytype)
+    {
+      default:
+        break;
+    }
+  YYFPRINTF (yyoutput, ")");
+}
+
+#endif /* ! YYDEBUG */
+/*-----------------------------------------------.
+| Release the memory associated to this symbol.  |
+`-----------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yydestruct (int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yydestruct (yytype, yyvaluep)
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  /* Pacify ``unused variable'' warnings.  */
+  (void) yyvaluep;
+
+  switch (yytype)
+    {
+
+      default:
+        break;
+    }
+}
+
+
+
+/* Prevent warnings from -Wmissing-prototypes.  */
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM);
+# else
+int yyparse ();
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+
+/* The lookahead symbol.  */
+int yychar;
+
+/* The semantic value of the lookahead symbol.  */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far.  */
+int yynerrs;
+
+
+
+/*----------.
+| yyparse.  |
+`----------*/
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM)
+# else
+int yyparse (YYPARSE_PARAM)
+  void *YYPARSE_PARAM;
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int
+yyparse (void)
+#else
+int
+yyparse ()
+
+#endif
+#endif
+{
+  
+  register int yystate;
+  register int yyn;
+  int yyresult;
+  /* Number of tokens to shift before error messages enabled.  */
+  int yyerrstatus;
+  /* Lookahead token as an internal (translated) token number.  */
+  int yytoken = 0;
+
+  /* Three stacks and their tools:
+     `yyss': related to states,
+     `yyvs': related to semantic values,
+     `yyls': related to locations.
+
+     Refer to the stacks thru separate pointers, to allow yyoverflow
+     to reallocate them elsewhere.  */
+
+  /* The state stack.  */
+  short	yyssa[YYINITDEPTH];
+  short *yyss = yyssa;
+  register short *yyssp;
+
+  /* The semantic value stack.  */
+  YYSTYPE yyvsa[YYINITDEPTH];
+  YYSTYPE *yyvs = yyvsa;
+  register YYSTYPE *yyvsp;
+
+
+
+#define YYPOPSTACK   (yyvsp--, yyssp--)
+
+  YYSIZE_T yystacksize = YYINITDEPTH;
+
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
+
+  /* When reducing, the number of symbols on the RHS of the reduced
+     rule.  */
+  int yylen;
+
+  YYDPRINTF ((stderr, "Starting parse\n"));
+
+  yystate = 0;
+  yyerrstatus = 0;
+  yynerrs = 0;
+  yychar = YYEMPTY;		/* Cause a token to be read.  */
+
+  /* Initialize stack pointers.
+     Waste one element of value and location stack
+     so that they stay on the same level as the state stack.
+     The wasted elements are never initialized.  */
+
+  yyssp = yyss;
+  yyvsp = yyvs;
+
+  goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate.  |
+`------------------------------------------------------------*/
+ yynewstate:
+  /* In all cases, when you get here, the value and location stacks
+     have just been pushed. so pushing a state here evens the stacks.
+     */
+  yyssp++;
+
+ yysetstate:
+  *yyssp = yystate;
+
+  if (yyss + yystacksize - 1 <= yyssp)
+    {
+      /* Get the current used size of the three stacks, in elements.  */
+      YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+      {
+	/* Give user a chance to reallocate the stack. Use copies of
+	   these so that the &'s don't force the real ones into
+	   memory.  */
+	YYSTYPE *yyvs1 = yyvs;
+	short *yyss1 = yyss;
+
+
+	/* Each stack pointer address is followed by the size of the
+	   data in use in that stack, in bytes.  This used to be a
+	   conditional around just the two extra args, but that might
+	   be undefined if yyoverflow is a macro.  */
+	yyoverflow ("parser stack overflow",
+		    &yyss1, yysize * sizeof (*yyssp),
+		    &yyvs1, yysize * sizeof (*yyvsp),
+
+		    &yystacksize);
+
+	yyss = yyss1;
+	yyvs = yyvs1;
+      }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+      goto yyoverflowlab;
+# else
+      /* Extend the stack our own way.  */
+      if (YYMAXDEPTH <= yystacksize)
+	goto yyoverflowlab;
+      yystacksize *= 2;
+      if (YYMAXDEPTH < yystacksize)
+	yystacksize = YYMAXDEPTH;
+
+      {
+	short *yyss1 = yyss;
+	union yyalloc *yyptr =
+	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+	if (! yyptr)
+	  goto yyoverflowlab;
+	YYSTACK_RELOCATE (yyss);
+	YYSTACK_RELOCATE (yyvs);
+
+#  undef YYSTACK_RELOCATE
+	if (yyss1 != yyssa)
+	  YYSTACK_FREE (yyss1);
+      }
+# endif
+#endif /* no yyoverflow */
+
+      yyssp = yyss + yysize - 1;
+      yyvsp = yyvs + yysize - 1;
+
+
+      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+		  (unsigned long int) yystacksize));
+
+      if (yyss + yystacksize - 1 <= yyssp)
+	YYABORT;
+    }
+
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+  goto yybackup;
+
+/*-----------.
+| yybackup.  |
+`-----------*/
+yybackup:
+
+/* Do appropriate processing given the current state.  */
+/* Read a lookahead token if we need one and don't already have one.  */
+/* yyresume: */
+
+  /* First try to decide what to do without reference to lookahead token.  */
+
+  yyn = yypact[yystate];
+  if (yyn == YYPACT_NINF)
+    goto yydefault;
+
+  /* Not known => get a lookahead token if don't already have one.  */
+
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
+  if (yychar == YYEMPTY)
+    {
+      YYDPRINTF ((stderr, "Reading a token: "));
+      yychar = YYLEX;
+    }
+
+  if (yychar <= YYEOF)
+    {
+      yychar = yytoken = YYEOF;
+      YYDPRINTF ((stderr, "Now at end of input.\n"));
+    }
+  else
+    {
+      yytoken = YYTRANSLATE (yychar);
+      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
+    }
+
+  /* If the proper action on seeing token YYTOKEN is to reduce or to
+     detect an error, take that action.  */
+  yyn += yytoken;
+  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+    goto yydefault;
+  yyn = yytable[yyn];
+  if (yyn <= 0)
+    {
+      if (yyn == 0 || yyn == YYTABLE_NINF)
+	goto yyerrlab;
+      yyn = -yyn;
+      goto yyreduce;
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  /* Shift the lookahead token.  */
+  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
+
+  /* Discard the token being shifted unless it is eof.  */
+  if (yychar != YYEOF)
+    yychar = YYEMPTY;
+
+  *++yyvsp = yylval;
+
+
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state.  |
+`-----------------------------------------------------------*/
+yydefault:
+  yyn = yydefact[yystate];
+  if (yyn == 0)
+    goto yyerrlab;
+  goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction.  |
+`-----------------------------*/
+yyreduce:
+  /* yyn is the number of a rule to reduce with.  */
+  yylen = yyr2[yyn];
+
+  /* If YYLEN is nonzero, implement the default value of the action:
+     `$$ = $1'.
+
+     Otherwise, the following line sets YYVAL to garbage.
+     This behavior is undocumented and Bison
+     users should not rely upon it.  Assigning to YYVAL
+     unconditionally makes the parser a bit smaller, and it avoids a
+     GCC warning that YYVAL may be used uninitialized.  */
+  yyval = yyvsp[1-yylen];
+
+
+  YY_REDUCE_PRINT (yyn);
+  switch (yyn)
+    {
+        case 2:
+#line 97 "vs1.0_grammar.y"
+    {
+	yyvsp[0].instList->Validate();
+	yyvsp[0].instList->Translate();
+	delete yyvsp[0].instList;
+	;}
+    break;
+
+  case 3:
+#line 105 "vs1.0_grammar.y"
+    {
+		*(yyvsp[-1].instList) += yyvsp[0].inst;
+		delete yyvsp[0].inst;
+		yyval.instList = yyvsp[-1].instList
+	;}
+    break;
+
+  case 4:
+#line 111 "vs1.0_grammar.y"
+    {
+ 		VS10InstListPtr instList = new VS10InstList;
+		if ( yyvsp[0].inst != NULL )
+			{
+			*instList += yyvsp[0].inst;
+			delete yyvsp[0].inst;
+			}
+		yyval.instList = instList;
+	;}
+    break;
+
+  case 5:
+#line 123 "vs1.0_grammar.y"
+    {
+		yyval.inst = yyvsp[0].inst;
+		do_linenum_incr();
+	;}
+    break;
+
+  case 6:
+#line 128 "vs1.0_grammar.y"
+    {
+		yyval.inst = new VS10Inst( get_linenum() );
+		do_linenum_incr();
+	;}
+    break;
+
+  case 12:
+#line 140 "vs1.0_grammar.y"
+    {
+		   yyval.inst = new VS10Inst( get_linenum(), VS10_NOP );
+		   ;}
+    break;
+
+  case 13:
+#line 144 "vs1.0_grammar.y"
+    {
+		   yyval.inst = new VS10Inst( get_linenum(), VS10_COMMENT, yyvsp[0].comment );
+		   ;}
+    break;
+
+  case 14:
+#line 148 "vs1.0_grammar.y"
+    {
+		   yyval.inst = new VS10Inst( get_linenum(), VS10_HEADER );
+		   ;}
+    break;
+
+  case 15:
+#line 154 "vs1.0_grammar.y"
+    {
+		yyval.inst = new VS10Inst( get_linenum(), yyvsp[-3].ival, yyvsp[-2].reg, yyvsp[0].reg );
+	;}
+    break;
+
+  case 16:
+#line 160 "vs1.0_grammar.y"
+    {
+		   VS10Reg reg;
+		   reg = yyvsp[-2].reg;
+		   reg.sign = -1;
+		   reg.type = yyvsp[-2].reg.type;
+		   reg.index = yyvsp[-2].reg.index;
+		   for ( int i = 0; i < 4; i++ ) reg.mask[i] = yyvsp[0].mask[i];
+		   yyval.reg = reg;
+		   ;}
+    break;
+
+  case 17:
+#line 170 "vs1.0_grammar.y"
+    {
+		   VS10Reg reg;
+		   reg = yyvsp[-2].reg;
+		   reg.sign = 1;
+		   reg.type = yyvsp[-2].reg.type;
+		   reg.index = yyvsp[-2].reg.index;
+		   for ( int i = 0; i < 4; i++ ) reg.mask[i] = yyvsp[0].mask[i];
+		   yyval.reg = reg;
+		   ;}
+    break;
+
+  case 18:
+#line 180 "vs1.0_grammar.y"
+    {
+		   VS10Reg reg;
+		   reg = yyvsp[0].reg;
+		   reg.sign = -1;
+		   reg.type = yyvsp[0].reg.type;
+		   reg.index = yyvsp[0].reg.index;
+		   for ( int i = 0; i < 4; i++ ) reg.mask[i] = 0;
+		   yyval.reg = reg;
+		   ;}
+    break;
+
+  case 19:
+#line 190 "vs1.0_grammar.y"
+    {
+		   VS10Reg reg;
+		   reg = yyvsp[0].reg;
+		   reg.sign = 1;
+		   reg.type = yyvsp[0].reg.type;
+		   reg.index = yyvsp[0].reg.index;
+		   for ( int i = 0; i < 4; i++ ) reg.mask[i] = 0;
+		   yyval.reg = reg;
+		   ;}
+    break;
+
+  case 21:
+#line 201 "vs1.0_grammar.y"
+    {
+	  ;}
+    break;
+
+  case 22:
+#line 205 "vs1.0_grammar.y"
+    {
+		   VS10Reg reg;
+		   reg.type = TYPE_CONSTANT_MEM_REG;
+		   reg.index = yyvsp[-1].ival;
+		   yyval.reg = reg;
+		   ;}
+    break;
+
+  case 23:
+#line 212 "vs1.0_grammar.y"
+    {
+		   // Register is valid only if
+		   //	type = TYPE_ADDRESS_REG
+		   //	index = 0
+		   //	len(mask) = 1
+		   //	mask[0] = 'x'
+		   VS10Reg reg;
+		   yyval.reg.type = TYPE_CONSTANT_A0_REG;
+		   if ( yyvsp[-3].reg.type != TYPE_ADDRESS_REG )
+		       {
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+			   }
+		       else if ( yyvsp[-3].reg.index != 0 )
+			   {
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+			   }
+			   else
+			   {
+			       int len = 0;
+				   while ( len < 2 )
+				   {
+				       if ( yyvsp[-1].mask[len] == 0 )
+				           break;
+					   len++;
+				   }
+				   if ( len != 1 || yyvsp[-1].mask[0] != 'x' )
+				   {
+			       LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+				   }
+
+				   reg.type = TYPE_CONSTANT_A0_REG;
+				   yyval.reg = reg;
+			   }
+		   ;}
+    break;
+
+  case 24:
+#line 247 "vs1.0_grammar.y"
+    {
+		   // Register is valid only if
+		   //	type = TYPE_ADDRESS_REG
+		   //	index = 0
+		   //	len(mask) = 1
+		   //	mask[0] = 'x'
+		   VS10Reg reg;
+		   yyval.reg.type = TYPE_CONSTANT_A0_OFFSET_REG;
+		   if ( yyvsp[-5].reg.type != TYPE_ADDRESS_REG )
+		       {
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+			   }
+		       else if ( yyvsp[-5].reg.index != 0 )
+			   {
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+			   }
+			   else
+			   {
+			       int len = 0;
+				   while ( len < 2 )
+				   {
+				       if ( yyvsp[-3].mask[len] == 0 )
+				           break;
+					   len++;
+				   }
+				   if ( len != 1 || yyvsp[-3].mask[0] != 'x' )
+				   {
+			       LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+				   }
+
+				   reg.type = TYPE_CONSTANT_A0_OFFSET_REG;
+				   reg.index = yyvsp[-1].ival;
+				   yyval.reg = reg;
+			   }
+		   ;}
+    break;
+
+  case 25:
+#line 283 "vs1.0_grammar.y"
+    {
+		       yyval.reg.type = TYPE_CONSTANT_A0_REG;
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+		   ;}
+    break;
+
+  case 26:
+#line 288 "vs1.0_grammar.y"
+    {
+		       yyval.reg.type = TYPE_CONSTANT_A0_REG;
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+		   ;}
+    break;
+
+  case 27:
+#line 293 "vs1.0_grammar.y"
+    {
+		       yyval.reg.type = TYPE_CONSTANT_A0_REG;
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+		   ;}
+    break;
+
+  case 28:
+#line 298 "vs1.0_grammar.y"
+    {
+		       yyval.reg.type = TYPE_CONSTANT_A0_REG;
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+		   ;}
+    break;
+
+  case 29:
+#line 303 "vs1.0_grammar.y"
+    {
+		       yyval.reg.type = TYPE_CONSTANT_A0_REG;
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+		   ;}
+    break;
+
+  case 30:
+#line 308 "vs1.0_grammar.y"
+    {
+		       yyval.reg.type = TYPE_CONSTANT_A0_REG;
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+		   ;}
+    break;
+
+  case 31:
+#line 315 "vs1.0_grammar.y"
+    {
+		yyval.inst = new VS10Inst( get_linenum(), yyvsp[-3].ival, yyvsp[-2].reg, yyvsp[0].reg );
+	;}
+    break;
+
+  case 32:
+#line 321 "vs1.0_grammar.y"
+    {
+		yyval.inst = new VS10Inst( get_linenum(), yyvsp[-3].ival, yyvsp[-2].reg, yyvsp[0].reg );
+	;}
+    break;
+
+  case 33:
+#line 327 "vs1.0_grammar.y"
+    {
+		yyval.inst = new VS10Inst( get_linenum(), yyvsp[-5].ival, yyvsp[-4].reg, yyvsp[-2].reg, yyvsp[0].reg );
+	;}
+    break;
+
+  case 34:
+#line 334 "vs1.0_grammar.y"
+    {
+		yyval.inst = new VS10Inst( get_linenum(), yyvsp[-7].ival, yyvsp[-6].reg, yyvsp[-4].reg, yyvsp[-2].reg, yyvsp[0].reg );
+	;}
+    break;
+
+  case 35:
+#line 340 "vs1.0_grammar.y"
+    {
+		yyval.ival = VS10_MOV;
+	;}
+    break;
+
+  case 36:
+#line 344 "vs1.0_grammar.y"
+    {
+		yyval.ival = VS10_LIT;
+	;}
+    break;
+
+  case 37:
+#line 350 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_RCP;
+	;}
+    break;
+
+  case 38:
+#line 354 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_RSQ;
+	;}
+    break;
+
+  case 39:
+#line 358 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_EXP;
+	;}
+    break;
+
+  case 40:
+#line 362 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_EXPP;
+	;}
+    break;
+
+  case 41:
+#line 366 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_LOG;
+	;}
+    break;
+
+  case 42:
+#line 370 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_LOGP;
+	;}
+    break;
+
+  case 43:
+#line 376 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_FRC;
+	;}
+    break;
+
+  case 44:
+#line 382 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_MUL;
+	;}
+    break;
+
+  case 45:
+#line 386 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_ADD;
+	;}
+    break;
+
+  case 46:
+#line 390 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_DP3;
+	;}
+    break;
+
+  case 47:
+#line 394 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_DP4;
+	;}
+    break;
+
+  case 48:
+#line 398 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_DST;
+	;}
+    break;
+
+  case 49:
+#line 402 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_MIN;
+	;}
+    break;
+
+  case 50:
+#line 406 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_MAX;
+	;}
+    break;
+
+  case 51:
+#line 410 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_SLT;
+	;}
+    break;
+
+  case 52:
+#line 414 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_SGE;
+	;}
+    break;
+
+  case 53:
+#line 418 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_M3X2;
+	;}
+    break;
+
+  case 54:
+#line 422 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_M3X3;
+	;}
+    break;
+
+  case 55:
+#line 426 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_M3X4;
+	;}
+    break;
+
+  case 56:
+#line 430 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_M4X3;
+	;}
+    break;
+
+  case 57:
+#line 434 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_M4X4;
+	;}
+    break;
+
+  case 58:
+#line 438 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_SUB;
+	;}
+    break;
+
+  case 59:
+#line 444 "vs1.0_grammar.y"
+    {
+	yyval.ival = VS10_MAD;
+	;}
+    break;
+
+
+    }
+
+/* Line 999 of yacc.c.  */
+#line 1639 "_vs1.0_parser.c"
+
+
+  yyvsp -= yylen;
+  yyssp -= yylen;
+
+
+  YY_STACK_PRINT (yyss, yyssp);
+
+  *++yyvsp = yyval;
+
+
+  /* Now `shift' the result of the reduction.  Determine what state
+     that goes to, based on the state we popped back to and the rule
+     number reduced by.  */
+
+  yyn = yyr1[yyn];
+
+  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+    yystate = yytable[yystate];
+  else
+    yystate = yydefgoto[yyn - YYNTOKENS];
+
+  goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
+    {
+      ++yynerrs;
+#if YYERROR_VERBOSE
+      yyn = yypact[yystate];
+
+      if (YYPACT_NINF < yyn && yyn < YYLAST)
+	{
+	  YYSIZE_T yysize = 0;
+	  int yytype = YYTRANSLATE (yychar);
+	  char *yymsg;
+	  int yyx, yycount;
+
+	  yycount = 0;
+	  /* Start YYX at -YYN if negative to avoid negative indexes in
+	     YYCHECK.  */
+	  for (yyx = yyn < 0 ? -yyn : 0;
+	       yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
+	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+	      yysize += yystrlen (yytname[yyx]) + 15, yycount++;
+	  yysize += yystrlen ("syntax error, unexpected ") + 1;
+	  yysize += yystrlen (yytname[yytype]);
+	  yymsg = (char *) YYSTACK_ALLOC (yysize);
+	  if (yymsg != 0)
+	    {
+	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
+	      yyp = yystpcpy (yyp, yytname[yytype]);
+
+	      if (yycount < 5)
+		{
+		  yycount = 0;
+		  for (yyx = yyn < 0 ? -yyn : 0;
+		       yyx < (int) (sizeof (yytname) / sizeof (char *));
+		       yyx++)
+		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+		      {
+			const char *yyq = ! yycount ? ", expecting " : " or ";
+			yyp = yystpcpy (yyp, yyq);
+			yyp = yystpcpy (yyp, yytname[yyx]);
+			yycount++;
+		      }
+		}
+	      yyerror (yymsg);
+	      YYSTACK_FREE (yymsg);
+	    }
+	  else
+	    yyerror ("syntax error; also virtual memory exhausted");
+	}
+      else
+#endif /* YYERROR_VERBOSE */
+	yyerror ("syntax error");
+    }
+
+
+
+  if (yyerrstatus == 3)
+    {
+      /* If just tried and failed to reuse lookahead token after an
+	 error, discard it.  */
+
+      /* Return failure if at end of input.  */
+      if (yychar == YYEOF)
+        {
+	  /* Pop the error token.  */
+          YYPOPSTACK;
+	  /* Pop the rest of the stack.  */
+	  while (yyss < yyssp)
+	    {
+	      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+	      yydestruct (yystos[*yyssp], yyvsp);
+	      YYPOPSTACK;
+	    }
+	  YYABORT;
+        }
+
+      YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
+      yydestruct (yytoken, &yylval);
+      yychar = YYEMPTY;
+
+    }
+
+  /* Else will try to reuse lookahead token after shifting the error
+     token.  */
+  goto yyerrlab1;
+
+
+/*----------------------------------------------------.
+| yyerrlab1 -- error raised explicitly by an action.  |
+`----------------------------------------------------*/
+yyerrlab1:
+  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
+
+  for (;;)
+    {
+      yyn = yypact[yystate];
+      if (yyn != YYPACT_NINF)
+	{
+	  yyn += YYTERROR;
+	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+	    {
+	      yyn = yytable[yyn];
+	      if (0 < yyn)
+		break;
+	    }
+	}
+
+      /* Pop the current state because it cannot handle the error token.  */
+      if (yyssp == yyss)
+	YYABORT;
+
+      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+      yydestruct (yystos[yystate], yyvsp);
+      yyvsp--;
+      yystate = *--yyssp;
+
+      YY_STACK_PRINT (yyss, yyssp);
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  YYDPRINTF ((stderr, "Shifting error token, "));
+
+  *++yyvsp = yylval;
+
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here.  |
+`-------------------------------------*/
+yyacceptlab:
+  yyresult = 0;
+  goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here.  |
+`-----------------------------------*/
+yyabortlab:
+  yyresult = 1;
+  goto yyreturn;
+
+#ifndef yyoverflow
+/*----------------------------------------------.
+| yyoverflowlab -- parser overflow comes here.  |
+`----------------------------------------------*/
+yyoverflowlab:
+  yyerror ("parser stack overflow");
+  yyresult = 2;
+  /* Fall through.  */
+#endif
+
+yyreturn:
+#ifndef yyoverflow
+  if (yyss != yyssa)
+    YYSTACK_FREE (yyss);
+#endif
+  return yyresult;
+}
+
+
+#line 450 "vs1.0_grammar.y"
+
+void yyerror(char* s)
+{
+    LexError( "Syntax Error.\n" );
+    //errors.set(s);
+    //errors.set("unrecognized token");
+}
+
Index: /RenderSystems/GL/src/nvparse/_vs1.0_parser.h
===================================================================
--- /RenderSystems/GL/src/nvparse/_vs1.0_parser.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/_vs1.0_parser.h	(revision 5)
@@ -0,0 +1,154 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/* A Bison parser, made by GNU Bison 1.875.  */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     VERTEX_SHADER = 258,
+     ADD_INSTR = 259,
+     DP3_INSTR = 260,
+     DP4_INSTR = 261,
+     DST_INSTR = 262,
+     EXP_INSTR = 263,
+     EXPP_INSTR = 264,
+     FRC_INSTR = 265,
+     LIT_INSTR = 266,
+     LOG_INSTR = 267,
+     LOGP_INSTR = 268,
+     M3X2_INSTR = 269,
+     M3X3_INSTR = 270,
+     M3X4_INSTR = 271,
+     M4X3_INSTR = 272,
+     M4X4_INSTR = 273,
+     MAD_INSTR = 274,
+     MAX_INSTR = 275,
+     MIN_INSTR = 276,
+     MOV_INSTR = 277,
+     MUL_INSTR = 278,
+     NOP_INSTR = 279,
+     RCP_INSTR = 280,
+     RSQ_INSTR = 281,
+     SGE_INSTR = 282,
+     SLT_INSTR = 283,
+     SUB_INSTR = 284,
+     ILLEGAL = 285,
+     UNKNOWN_STRING = 286,
+     INTVAL = 287,
+     REGISTER = 288,
+     XYZW_MODIFIER = 289,
+     COMMENT = 290
+   };
+#endif
+#define VERTEX_SHADER 258
+#define ADD_INSTR 259
+#define DP3_INSTR 260
+#define DP4_INSTR 261
+#define DST_INSTR 262
+#define EXP_INSTR 263
+#define EXPP_INSTR 264
+#define FRC_INSTR 265
+#define LIT_INSTR 266
+#define LOG_INSTR 267
+#define LOGP_INSTR 268
+#define M3X2_INSTR 269
+#define M3X3_INSTR 270
+#define M3X4_INSTR 271
+#define M4X3_INSTR 272
+#define M4X4_INSTR 273
+#define MAD_INSTR 274
+#define MAX_INSTR 275
+#define MIN_INSTR 276
+#define MOV_INSTR 277
+#define MUL_INSTR 278
+#define NOP_INSTR 279
+#define RCP_INSTR 280
+#define RSQ_INSTR 281
+#define SGE_INSTR 282
+#define SLT_INSTR 283
+#define SUB_INSTR 284
+#define ILLEGAL 285
+#define UNKNOWN_STRING 286
+#define INTVAL 287
+#define REGISTER 288
+#define XYZW_MODIFIER 289
+#define COMMENT 290
+
+
+
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#line 27 "vs1.0_grammar.y"
+typedef union YYSTYPE {
+  int ival;
+  unsigned int lval;
+  float fval;
+  char mask[4];
+  char *comment;
+  VS10Reg reg;
+  VS10InstPtr inst;
+  VS10InstListPtr instList;
+} YYSTYPE;
+/* Line 1240 of yacc.c.  */
+#line 117 "_vs1.0_parser.h"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+extern YYSTYPE vs10_lval;
+
+
+
Index: /RenderSystems/GL/src/nvparse/avp1.0_impl.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/avp1.0_impl.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/avp1.0_impl.cpp	(revision 5)
@@ -0,0 +1,190 @@
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+#include <string.h>
+#include <string>
+#include <ctype.h>
+
+#if defined(__APPLE__) && defined(__GNUC__)
+#include <OpenGL/glu.h>
+#else
+#include <GL/glu.h>
+#endif
+
+#include <OgreGLPrerequisites.h>
+
+using namespace std;
+
+namespace
+{
+	void LoadProgram( GLenum target, GLuint id, char *instring );
+	void StrToUpper(char * string);
+	GLint vpid;
+}
+
+
+bool is_avp10(const char * s)
+{
+	return ! strncmp(s, "!!ARBvp1.0", 10);
+}
+
+bool avp10_init(char * s)
+{
+	static bool avpinit = false;
+	if (avpinit == false )
+	{
+      /*
+		if(! glh_init_extensions("GL_ARB_vertex_program"))
+		{
+			errors.set("unable to initialize GL_ARB_vertex_program");
+			return false;
+		}
+		else
+		{
+        */
+			avpinit = true;
+            /*
+		}
+        */
+	}
+	
+	errors.reset();
+	line_number = 1;
+	myin = s;
+
+    glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_BINDING_ARB, &vpid);
+        
+    if ( vpid == 0 )
+    {
+        char str[128];
+        sprintf( str, "No vertex program id bound for nvparse() invocation.  Bound id = %d\n", (int)vpid );
+        errors.set( str );
+		return false;
+    }
+	
+	return true;	
+}
+
+int avp10_parse()
+{
+    LoadProgram( GL_VERTEX_PROGRAM_ARB, vpid, myin );
+	return 0;
+}
+
+namespace
+{
+	//.----------------------------------------------------------------------------.
+	//|   Function   : LoadProgram                                                 |
+	//|   Description: Load a program into GL, and report any errors encountered.  |
+	//.----------------------------------------------------------------------------.
+	void LoadProgram( GLenum target, GLuint id, char *instring )
+	{
+        GLint  errPos;
+        GLenum errCode;
+        const GLubyte *errString;
+        int len = strlen(instring);
+
+        glBindProgramARB(target, id);
+        errCode = glGetError();
+        if (errCode == GL_INVALID_OPERATION)
+                errString = gluErrorString(errCode);
+
+        glProgramStringARB(target, 
+                           GL_PROGRAM_FORMAT_ASCII_ARB, 
+                           len,
+                           instring);
+
+		if ((errCode = glGetError()) != GL_NO_ERROR)
+		{
+			errString = gluErrorString(errCode);
+			
+			glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errPos);
+            if (errPos == -1)
+                return;
+			
+			int nlines = 1;
+			int nchar  = 1;
+			int i;
+			for (i = 0; i < errPos; i++)
+			{
+				if (instring[i] == '\n')
+				{
+					nlines++;
+					nchar = 1;
+				}
+				else
+				{
+					nchar++;
+				}
+			}
+			int start;
+			int end;
+			int flag = ((instring[errPos]==';') | (instring[errPos-1]==';')) ? 1 : 0;
+			for (i = errPos; i >= 0; i--)
+			{
+				start = i;
+				if (flag && (start >= errPos-1))
+					continue;
+				if (instring[i] == ';')
+				{
+					if (!flag)
+					{
+						start = i+1;
+						if (instring[start] == '\n')
+							start++;
+					}
+					break;
+				}
+			}
+			for (i = errPos; i < len; i++)
+			{
+				end = i;
+				if (instring[i] == ';' && end > start)
+				{
+					break;
+				}
+			}
+			if (errPos - start > 30)
+			{
+				start = errPos - 30;
+			}
+			if (end - errPos > 30)
+			{
+				end = errPos + 30;
+			}
+			
+			char substring[96];
+			memset( substring, 0, 96 );
+			strncpy( substring, &(instring[start]), end-start+1 );
+
+            char str[256];
+			sprintf(str, "error at line %d character %d\n\"%s\"\n", nlines, nchar, substring);
+			int width = errPos-start;
+
+			for (i = 0; i < width; i++)
+			{
+				strcat(str, " ");
+			}
+
+			strcat(str, "|\n");
+			for (i = 0; i < width; i++)
+			{
+				strcat(str, " ");
+			}
+			strcat(str, "^\n");
+			
+			errors.set(str);
+		}
+	}
+	
+	
+	//.----------------------------------------------------------------------------.
+	//|   Function   : StrToUpper                                                  |
+	//|   Description: Converts all lowercase chars in a string to uppercase.      |
+	//.----------------------------------------------------------------------------.
+	void StrToUpper(char *string)
+	{
+		for (unsigned int i = 0; i < strlen(string); i++)
+			string[i] = toupper(string[i]);
+	}
+	
+}
Index: /RenderSystems/GL/src/nvparse/macro.h
===================================================================
--- /RenderSystems/GL/src/nvparse/macro.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/macro.h	(revision 5)
@@ -0,0 +1,43 @@
+#ifdef _WIN32
+#include <io.h>
+#else
+#include <ctype.h>
+#endif
+typedef struct MACROTEXT {
+	MACROTEXT *next;
+	MACROTEXT *prev;
+	char *macroText;
+} MACROTEXT;
+
+typedef struct MACROENTRY
+{
+	MACROENTRY *next;
+	MACROENTRY *prev;
+	char *macroName;
+	MACROTEXT *firstMacroParms;
+	MACROTEXT *lastMacroParms;
+	MACROTEXT *firstMacroLines;
+	MACROTEXT *lastMacroLines;
+	unsigned int numParms;
+	char *fileName;
+	unsigned int lineNo;
+	unsigned int nLines;
+	bool bIsDefine;
+} MACROENTRY;
+
+#define MAX_IFDEF_DEPTH 1024
+typedef struct IFDEFINFO
+{
+	bool			lastbProcessingIFDEF;			// save off for if we were processing #ifdef
+	bool			lastbIFDEF;						// wether ifdef was true or not
+	bool			lastbCompareDefine;				// wether we compare #ifdef or #ifndef
+	unsigned int	lastIfDefStartLine;				// where we started for this #ifdef
+} IFDEFINFO;
+
+
+typedef void (*MACROFUNCTIONPTR)(char *, unsigned int *, char **);
+
+typedef struct MACROFUNCTIONS {
+	char *name;
+	MACROFUNCTIONPTR function;
+} MACROFUNCTIONS;
Index: /RenderSystems/GL/src/nvparse/nvparse.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/nvparse.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/nvparse.cpp	(revision 5)
@@ -0,0 +1,210 @@
+#ifdef _WIN32
+# include <windows.h>
+#else
+#include <stdarg.h>
+#define strnicmp strncasecmp
+#endif
+
+#include <stdio.h>
+
+#if defined(__APPLE__) && defined(__GNUC__)
+#include <OpenGL/glu.h>
+#else
+#include <GL/glu.h>
+#endif
+
+#include <string>
+#include <vector>
+
+#include "nvparse.h"
+#include "nvparse_errors.h"
+
+//void yyinit(char*);
+//int yyparse(void);
+
+
+// RC1.0  -- register combiners 1.0 configuration
+bool rc10_init(char *);
+int  rc10_parse();
+bool is_rc10(const char *);
+
+// TS1.0  -- texture shader 1.0 configuration
+bool ts10_init(char *);
+int  ts10_parse();
+bool is_ts10(const char *);
+
+// ARBvp1.0  -- ARB vertex program
+bool avp10_init(char *);
+int  avp10_parse();
+bool is_avp10(const char *);
+
+#if !defined(__APPLE__)
+// VP1.0  -- vertex program
+bool vp10_init(char *);
+int  vp10_parse();
+bool is_vp10(const char *);
+
+// VSP1.0  -- vertex state program
+bool vsp10_init(char *);
+int  vsp10_parse(int vspid);
+bool is_vsp10(const char *);
+
+// VCP1.0  -- vertex constant program
+bool vcp10_init(char *);
+int  vcp10_parse();
+bool is_vcp10(const char *);
+
+// DX8 stuff
+
+// PS1.0  -- DX8 Pixel Shader 1.0 configuration
+bool ps10_init(char *);
+int  ps10_parse();
+bool ps10_set_map(const std::vector<int>& argv);
+bool is_ps10(const char *);
+const int* ps10_get_info(int* pcount);
+
+// VS1.0  -- DX8 Vertex Shader 1.0
+bool vs10_init(char *);
+int  vs10_parse();
+bool is_vs10(const char *);
+void vs10_load_program();
+#endif
+
+nvparse_errors errors;
+int line_number;
+char * myin = 0;
+
+void nvparse(const char * input_string, int argc /* = 0 */,...)
+{
+    if (NULL == input_string)
+    {
+        errors.set("NULL string passed to nvparse");
+        return;
+    }
+    
+    char * instring = strdup(input_string);
+
+    // register combiners (1 and 2)
+    if(is_rc10(instring))
+    {
+        if(rc10_init(instring))
+        {
+            rc10_parse();
+        }
+    }
+
+    // texture shader
+    else if(is_ts10(instring))
+    {
+        if(ts10_init(instring))
+        {
+            ts10_parse();
+        }
+    }
+
+    // vertex program
+    else if(is_avp10(instring))
+    {
+        if(avp10_init(instring))
+        {
+            avp10_parse();
+        }
+    }
+
+#if !defined(__APPLE__)
+    // vertex constant program
+    else if(is_vcp10(instring))
+    {
+        if(vcp10_init(instring))
+        {
+            vcp10_parse();
+        }
+    }
+
+    // vertex state program
+    else if(is_vsp10(instring))
+    {
+        if(vsp10_init(instring))
+        {
+            vsp10_parse(argc);
+        }
+    }
+
+    // vertex program
+    else if(is_vp10(instring))
+    {
+        if(vp10_init(instring))
+        {
+            vp10_parse();
+        }
+    }
+
+    // DX8 vertex shader
+    else if ( is_vs10(instring) )
+    {
+        if(vs10_init(instring))
+        {
+            vs10_parse();
+            vs10_load_program();
+        }
+
+    }
+    else if (is_ps10(instring))
+    {
+        if(ps10_init(instring))
+        {
+            va_list ap;
+            std::vector<int> argv;
+            va_start(ap,argc);
+            for (int i=0;i<argc;++i)
+            {
+                int arg = va_arg(ap,int);
+                argv.push_back(arg);
+            }
+            va_end(ap);
+            if (!ps10_set_map(argv))
+                return;
+            ps10_parse();
+        }
+    }
+#endif
+    else
+    {
+        errors.set("invalid string.\n "
+                   "first characters must be: !!ARBvp1.0 or !!VP1.0 or !!VSP1.0 or !!RC1.0 or !!TS1.0\n "
+                   "or it must be a valid DirectX 8.0 Vertex Shader");
+    }
+    free(instring);
+}
+
+char * const * const nvparse_get_errors()
+{
+    return errors.get_errors();
+}
+
+char * const * const nvparse_print_errors(FILE * errfp)
+{
+    for (char * const *  ep = nvparse_get_errors(); *ep; ep++)
+    {
+        const char * errstr = *ep;
+        fprintf(errfp, "%s\n", errstr);
+    }
+    return nvparse_get_errors();
+}
+
+
+const int* nvparse_get_info(const char* input_string, int* pcount)
+{
+#if !defined(__APPLE__)
+    if (NULL == input_string)
+    {
+        errors.set("NULL string passed to nvparse_get_info");
+        return 0;
+    }
+    if (is_ps10(input_string))
+    {
+        return ps10_get_info(pcount);
+    }
+#endif
+    return 0;
+}
Index: /RenderSystems/GL/src/nvparse/nvparse.h
===================================================================
--- /RenderSystems/GL/src/nvparse/nvparse.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/nvparse.h	(revision 5)
@@ -0,0 +1,22 @@
+#ifndef NVPARSE_H
+#define NVPARSE_H
+
+#define NVPARSE 1
+
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+void nvparse(const char * input_string, int argc = 0,...);
+char * const * const nvparse_get_errors();
+char * const * const nvparse_print_errors(FILE *fp);
+const int* nvparse_get_info(const char* input_string, int* pcount);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
Index: /RenderSystems/GL/src/nvparse/nvparse_errors.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/nvparse_errors.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/nvparse_errors.cpp	(revision 5)
@@ -0,0 +1,47 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "nvparse_errors.h"
+
+
+
+nvparse_errors::nvparse_errors()
+{
+	num_errors = 0;
+	reset();
+}
+
+nvparse_errors::~nvparse_errors()
+{
+	reset();
+}
+
+
+void nvparse_errors::reset()
+{
+	for(int i=0; i < num_errors; i++)
+	    free(elist[i]);//FIXME detail_nmap something is writing 0x2 to elist[1] blah!
+	for(int j=0; j <= NVPARSE_MAX_ERRORS; j++)
+		elist[j] = 0;
+	num_errors = 0;
+}
+
+void nvparse_errors::set(const char * e)
+{
+	if(num_errors < NVPARSE_MAX_ERRORS)
+		elist[num_errors++] = strdup(e);
+}
+
+void nvparse_errors::set(const char * e, int line_number)
+{
+	char buff[256];
+	sprintf(buff, "error on line %d: %s", line_number, e);
+	if(num_errors < NVPARSE_MAX_ERRORS)
+		elist[num_errors++] = strdup(buff);
+}
+
+char * const * const nvparse_errors::get_errors()
+{
+	return elist;
+}
Index: /RenderSystems/GL/src/nvparse/nvparse_errors.h
===================================================================
--- /RenderSystems/GL/src/nvparse/nvparse_errors.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/nvparse_errors.h	(revision 5)
@@ -0,0 +1,25 @@
+#ifndef _NVPARSE_ERRORS_H_
+#define _NVPARSE_ERRORS_H_
+
+#ifdef _WIN32
+    #pragma warning(disable:4786)   // stupid symbol size limitation
+#endif
+
+#define NVPARSE_MAX_ERRORS 32
+class nvparse_errors
+{
+public:
+	nvparse_errors();
+	~nvparse_errors();
+
+	void reset();
+	void set(const char * e);
+	void set(const char * e, int line_number);
+	char * const * const get_errors();
+    inline int  get_num_errors() { return num_errors; }
+private:
+        char* elist [NVPARSE_MAX_ERRORS+1];
+	int num_errors;
+};
+
+#endif
Index: /RenderSystems/GL/src/nvparse/nvparse_externs.h
===================================================================
--- /RenderSystems/GL/src/nvparse/nvparse_externs.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/nvparse_externs.h	(revision 5)
@@ -0,0 +1,10 @@
+#ifndef NVPARSE_EXTERNS_H
+#define NVPARSE_EXTERNS_H
+
+extern nvparse_errors errors;
+extern int line_number;
+extern char * myin;
+
+#include <GL/glew.h>
+
+#endif
Index: /RenderSystems/GL/src/nvparse/ps1.0__test_main.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/ps1.0__test_main.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/ps1.0__test_main.cpp	(revision 5)
@@ -0,0 +1,135 @@
+/* 
+
+  This is a test app for the ps10 lexer/parser.
+
+  Cass Everitt
+  07-06-01
+
+*/
+#include <stdio.h>
+#include <state_to_nvparse_text.h>
+#include "nvparse_errors.h"
+
+#include <string>
+#include <GL/glut.h>
+
+#define GLH_EXT_SINGLE_FILE
+#include <glh_extensions.h>
+
+using namespace std;
+
+bool ps10_init(char *);
+int  ps10_parse(void);
+
+nvparse_errors errors;
+int line_number;
+char * myin = 0;
+
+char * const * const nvparse_get_errors()
+{
+  return errors.get_errors();
+}
+
+char * const * const nvparse_print_errors(FILE * errfp)
+{
+  for (char * const *  ep = nvparse_get_errors(); *ep; ep++)
+  {
+    const char * errstr = *ep;
+    fprintf(errfp, "%s\n", errstr);
+  }
+  return nvparse_get_errors();
+}
+
+
+char * read_input_file(string filename)
+{
+	char buf[256];
+	FILE * fp = fopen(filename.c_str(), "rb");
+	if(! fp)
+		return 0;
+	string result;
+	while(fgets(buf, 255, fp) > 0)
+	{
+		result += buf;
+	}
+	fclose(fp);
+	char * r = new char[result.size()+1];
+	strcpy(r, result.c_str());
+	return r;
+}
+
+
+int main(int argc, char **argv)
+{
+/*
+	char test_string[] =
+		"Ps.1.0                                    \n\n\n"
+		"def c0,  0.4, 1, 0, .2       ; diffuse    \n"
+		"def c7,   .3, .2, .1, 0                   \n \n"
+		"                                             \n"
+		"add r0, t0_bias, r1_bx2                                 \n"
+		"cnd r0, r0.a, t0, r1                                 \n"
+		"dp3 r0, t0, r1                                 \n"
+		"lrp r0, t0.a, t0, r1                                 \n"
+		"mad r0, t0.a, t0, r1                                 \n"
+		"mov r0.a, -r1.a                                \n"
+		"mul r0, t0, r1                                 \n"
+		"sub r0, t0, r1                                 \n"
+		;
+*/
+/*
+	char test_string[] = 
+		"Ps.1.0                              \n"
+		"def c0,  0.4, 1, 0, .2              \n"
+		"def c7,   .3, .2, .1, 0             \n"
+		"add r0, t0_bias, r1_bx2             \n"
+		"cnd r0, r0.a, t0, r1                \n"
+		"dp3 r0, t0, r1                      \n"
+		"lrp r0, t0.a, t0, r1                \n"
+		"mad r0, t0.a, t0, r1                \n"
+		"mov r0.a, -r1.a                     \n"
+		"mul r0, t0, r1                      \n"
+		"sub r0, t0, r1                      \n"
+		;
+*/
+	char test_string[] = 
+"ps.1.1\n"
+"tex t0\n"
+"mul r1, t0, c0\n"
+"mul r0, r1, v0\n"
+"// End of program\n"
+		;
+    
+	glutInit(&argc, argv);
+	glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH|GLUT_RGB);
+	glutCreateWindow("test window");
+
+    char * str;
+    if(argc == 2)
+    {
+        str = read_input_file(argv[1]);
+    }
+    else
+    {
+        str = test_string;
+    }
+
+	line_number = 1;
+
+	ps10_init(str);
+
+    glNewList(GL_COMPILE_AND_EXECUTE, 1);
+	ps10_parse();
+    glEndList();
+
+    char * err = (char *) gluErrorString(glGetError());
+
+	errors.set("spacer...");
+	nvparse_print_errors(stderr);
+
+    fprintf(stdout, "\n\nnvparse output: \n\n");
+    fprintf(stdout, state_to_rc10() );
+
+
+	return 0;
+}
Index: /RenderSystems/GL/src/nvparse/ps1.0_grammar.y
===================================================================
--- /RenderSystems/GL/src/nvparse/ps1.0_grammar.y	(revision 5)
+++ /RenderSystems/GL/src/nvparse/ps1.0_grammar.y	(revision 5)
@@ -0,0 +1,314 @@
+%start WholeEnchilada
+%name-prefix="ps10_"
+%{
+
+/*
+
+	This is a parser for the DX8 PS1.0 pixel shaders.  I intend
+	to use it to set NV_texture_shader* and NV_register_combiners*
+	state in OpenGL, but the parse tree could be used for any
+	other purpose.
+
+	Cass Everitt
+	7-19-01
+
+*/
+
+void yyerror(char* s);
+int yylex ( void );
+
+#ifdef _WIN32
+# include <windows.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "ps1.0_program.h"
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+#include <list>
+#include <vector>
+
+using namespace std;
+using namespace ps10;
+
+//#define DBG_MESG(msg, line)  	errors.set(msg, line)
+#define DBG_MESG(msg, line)
+
+
+%}
+%union 
+{
+	int ival;
+	float fval;
+	
+	string * sval;
+	constdef * cdef;
+	vector<constdef> * consts;
+	vector<string> * line;
+	list<vector<string> > * lines;
+}
+
+%token <ival> HEADER NEWLINE
+%token <fval> NUMBER
+%token <sval> REG
+%token <sval> DEF
+%token <sval> ADDROP
+%token <sval> BLENDOP
+
+%type <cdef> Def
+%type <consts> Defs
+%type <line> AddrOp BlendOp
+%type <lines> AddrOps BlendOps
+%type <ival> MaybePlus
+
+
+%%
+
+WholeEnchilada :
+
+	HEADER Newlines Defs AddrOps BlendOps
+	{
+		DBG_MESG("dbg: WholeEnchilada", line_number);		
+		ps10::invoke($3, $4, $5);
+	}
+	|
+
+	Newlines HEADER Newlines Defs AddrOps BlendOps
+	{
+		DBG_MESG("dbg: WholeEnchilada", line_number);		
+		ps10::invoke($4, $5, $6);
+	}
+	|
+
+	HEADER Newlines AddrOps BlendOps
+	{
+		DBG_MESG("dbg: WholeEnchilada", line_number);		
+		ps10::invoke( 0, $3, $4);
+	}
+	|
+
+	Newlines HEADER Newlines AddrOps BlendOps
+	{
+		DBG_MESG("dbg: WholeEnchilada", line_number);		
+		ps10::invoke( 0, $4, $5);
+	}
+	|
+
+	HEADER Newlines Defs BlendOps
+	{
+		DBG_MESG("dbg: WholeEnchilada", line_number);		
+		ps10::invoke($3, 0, $4);
+	}
+	|
+	
+	Newlines HEADER Newlines Defs BlendOps
+	{
+		DBG_MESG("dbg: WholeEnchilada", line_number);		
+		ps10::invoke($4, 0, $5);
+	}
+	|
+
+	HEADER Newlines BlendOps
+	{
+		DBG_MESG("dbg: WholeEnchilada", line_number);		
+		ps10::invoke( 0, 0, $3);
+	}
+	|
+
+	Newlines HEADER Newlines BlendOps
+	{
+		DBG_MESG("dbg: WholeEnchilada", line_number);		
+		ps10::invoke( 0, 0, $4);
+	}
+	;
+
+
+Defs :
+
+	Def
+	{
+		$$ = new vector<constdef>;
+		$$->push_back(* $1);
+		delete $1;
+	}
+	|
+
+	Defs Def
+	{
+		$$ = $1;
+		$$->push_back(* $2);
+		delete $2;
+	}
+	;
+
+
+
+Def :
+
+	DEF REG ',' NUMBER ',' NUMBER ',' NUMBER  ',' NUMBER Newlines
+	{
+		$$ = new constdef;
+		$$->reg = * $2;
+		$$->r = $4;
+		$$->g = $6;
+		$$->b = $8;
+		$$->a = $10;
+		delete $2;
+	}
+    	;
+
+AddrOps:
+
+	AddrOp
+	{
+		$$ = new list<vector<string> >;
+		$$->push_back(* $1);
+		delete $1;
+	}
+	|
+
+	AddrOps AddrOp
+	{
+		$$ = $1;
+		$$->push_back(* $2);
+		delete $2;
+	}
+	;
+
+
+AddrOp :
+
+	ADDROP REG Newlines
+	{
+		$$ = new vector<string>;
+		$$->push_back(* $1);
+		$$->push_back(* $2);
+		delete $1;
+		delete $2;
+	}
+	|
+
+	ADDROP REG ',' REG Newlines
+	{
+		$$ = new vector<string>;
+		$$->push_back(* $1);
+		$$->push_back(* $2);
+		$$->push_back(* $4);
+		delete $1;
+		delete $2;
+		delete $4;
+	}
+	|
+
+	ADDROP REG ',' REG ',' REG Newlines
+	{
+		$$ = new vector<string>;
+		$$->push_back(* $1);
+		$$->push_back(* $2);
+		$$->push_back(* $4);
+		$$->push_back(* $6);
+		delete $1;
+		delete $2;
+		delete $4;
+		delete $6;
+	}
+	;
+
+
+BlendOps:
+
+	BlendOp
+	{
+		$$ = new list<vector<string> >;
+		$$->push_back(* $1);
+		delete $1;
+	}
+	|
+
+	BlendOps BlendOp
+	{
+		$$ = $1;
+		$$->push_back(* $2);
+		delete $2;
+	}
+	;
+
+
+BlendOp :
+
+
+	MaybePlus BLENDOP REG ',' REG Newlines
+	{
+		$$ = new vector<string>;
+        if ( $1 )
+          $$->push_back("+");
+		$$->push_back(* $2);
+		$$->push_back(* $3);
+		$$->push_back(* $5);
+		delete $2;
+		delete $3;
+		delete $5;
+	}
+	|
+
+	MaybePlus BLENDOP REG ',' REG ',' REG Newlines
+	{
+		$$ = new vector<string>;
+        if ( $1 )
+          $$->push_back("+");
+		$$->push_back(* $2);
+		$$->push_back(* $3);
+		$$->push_back(* $5);
+		$$->push_back(* $7);
+		delete $2;
+		delete $3;
+		delete $5;
+		delete $7;
+	}
+	|
+
+	MaybePlus BLENDOP REG ',' REG ',' REG ',' REG Newlines
+	{
+		$$ = new vector<string>;
+        if ( $1 )
+          $$->push_back("+");
+		$$->push_back(* $2);
+		$$->push_back(* $3);
+		$$->push_back(* $5);
+		$$->push_back(* $7);
+		$$->push_back(* $9);
+		delete $2;
+		delete $3;
+		delete $5;
+		delete $7;
+		delete $9;
+	}
+	;
+
+MaybePlus :
+  /* empty */
+  { $$=0; }
+  |
+ '+' 
+  { $$=1; }
+  ;
+
+Newlines :
+
+ NEWLINE
+ {}
+ |
+
+ Newlines NEWLINE
+ {}
+ ;
+
+%%
+
+void yyerror(char* s)
+{
+	errors.set("parser: syntax error", line_number);
+}
Index: /RenderSystems/GL/src/nvparse/ps1.0_program.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/ps1.0_program.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/ps1.0_program.cpp	(revision 5)
@@ -0,0 +1,1015 @@
+#include "ps1.0_program.h"
+
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+#include <OgreGLPrerequisites.h>
+
+#include <string>
+#include <map>
+#include <algorithm>
+#include <string.h>
+#include <set>
+
+
+using namespace std;
+using namespace ps10;
+struct ltstr
+{
+	bool operator()(const char* s1, const char* s2) const
+	{
+		return strcmp(s1, s2) < 0;
+	}
+};
+
+#define DBG_MESG(msg, line)  	errors.set(msg, line)
+//#define DBG_MESG(msg, line)
+namespace ps10
+{
+	std::map<int, std::pair<int,int> > constToStageAndConstMap;
+	std::vector<int> constToStageArray;
+	std::map<int, int> stageToConstMap; // to keep track of which constants have been used up for this stage.
+		// r-value of 0 means none, r-value of 1 means c0 used, and r-value of 2 means both used.
+	//std::map<int, int> constToStageMap;
+	std::map<int, GLenum> stageToTargetMap;
+	std::set<const char*, ltstr> alphaBlueRegisters; // Keeps track of whether the result of a register
+		// was a dp3, if a register is in this set, it means that if it is used a source for the alpha 
+		// component the blue component should be used, and not the alpha component.
+	void SetFinalCombinerStage();
+}
+
+void RemoveFromAlphaBlue(std::string s)
+{
+	std::set<const char*, ltstr>::iterator iter = 
+		ps10::alphaBlueRegisters.find(s.c_str());
+	if (iter != alphaBlueRegisters.end())
+		alphaBlueRegisters.erase(iter);
+}
+
+/*
+void AddToMap(string s, int stage)
+{
+	const char* cstr = s.c_str();
+	if (cstr[0] == 'c')
+	{
+		int constNum = atoi(&cstr[1]);
+		if (constNum < 0 || constNum > 7)
+			return;
+		constToStageMap[constNum] = stage;
+	}
+}
+*/
+
+bool AddToMap(string s, int stage, GLenum& constVal)
+{
+	const char* cstr = s.c_str();
+	if (cstr[0] == 'c')
+	{
+		int constNum = atoi(&cstr[1]);
+		std::map<int, int>::iterator iter = stageToConstMap.find(stage);
+		if (iter == stageToConstMap.end())
+		{
+			// no constants used for this stage. 
+			std::pair<int, int> temp;
+			temp.first = stage;
+			temp.second = 0;
+			constToStageAndConstMap[constNum] = temp;
+			stageToConstMap[stage] = 0;
+			constVal = 0;
+			constToStageArray.push_back(constNum);
+			constToStageArray.push_back(stage);
+			constToStageArray.push_back(constVal);
+		}
+		else
+		{
+			int constUsed = (*iter).second;
+			if (constUsed >= 1)
+				return false;
+			else // const0 has been used, so use const1 for this stage.
+			{
+				std::pair<int,int> temp;
+				temp.first = stage;
+				temp.second = 1;
+				constToStageAndConstMap[constNum] = temp;
+				stageToConstMap[stage] = 1;
+				constVal = 1;
+				constToStageArray.push_back(constNum);
+				constToStageArray.push_back(stage);
+				constToStageArray.push_back(constVal);
+			}
+			
+		}
+	}
+	constVal += GL_CONSTANT_COLOR0_NV;
+	return true;
+}
+
+bool IsLegalTarget(int target)
+{
+	if (target == GL_TEXTURE_CUBE_MAP_ARB)
+		return true;
+	if (target == GL_TEXTURE_3D)
+		return true;
+#if defined(GL_EXT_texture_rectangle)
+	if (target == GL_TEXTURE_RECTANGLE_EXT)
+		return true;
+#elif defined(GL_NV_texture_rectangle)
+        if (target == GL_TEXTURE_RECTANGLE_NV)
+                return true;
+#endif
+	if (target == GL_TEXTURE_2D)
+		return true;
+	if (target == GL_TEXTURE_1D)
+		return true;
+	return false;
+}
+
+bool ps10_set_map(const std::vector<int>& argv)
+{
+	if (argv.size() % 2 != 0)
+	{
+		errors.set("Odd number of arguments for texture target map.");
+		return false;
+	}
+	for (unsigned int i=0;i<argv.size();i=i+2)
+	{
+		int stage = argv[i];
+		int target = argv[i+1];
+		if (!IsLegalTarget(target))
+		{
+			errors.set("Illegal target in texture target map.");
+			return false;
+		}
+		ps10::stageToTargetMap[stage] = target;
+	}
+	return true;
+}
+
+int const_to_combiner_reg_mapping[32][3]; // each 3 tuple is: (constant#, stage #, reg #)
+int const_to_combiner_reg_mapping_count = 0;
+
+
+namespace
+{
+	struct set_constants
+	{
+		void operator() (constdef c)
+		{
+			if(c.reg[0] != 'c' && c.reg.size() != 2)
+				DBG_MESG("def line must use constant registers", 0);
+			int reg = c.reg[1] - '0';
+			GLenum stage = GL_COMBINER0_NV + (reg / 2);
+			GLenum cclr  = GL_CONSTANT_COLOR0_NV + (reg % 2);
+
+			GLfloat cval[4];
+			cval[0] = c.r;
+			cval[1] = c.g;
+			cval[2] = c.b;
+			cval[3] = c.a;
+			glCombinerStageParameterfvNV(stage, cclr, cval);
+		}
+	};
+
+	GLenum get_tex_target(int stage)
+	{
+		std::map<int, GLenum>::iterator iter = stageToTargetMap.find(stage);
+		if (iter != stageToTargetMap.end())
+			return (*iter).second;
+		// If no mapping set, use the current state. This will not work correctly, in general,
+		// if nvparse was invoked within a display list.
+		if(glIsEnabled(GL_TEXTURE_CUBE_MAP_ARB))
+			return GL_TEXTURE_CUBE_MAP_ARB;
+		if(glIsEnabled(GL_TEXTURE_3D))
+			return GL_TEXTURE_3D;
+#if defined(GL_EXT_texture_rectangle)
+		if(glIsEnabled(GL_TEXTURE_RECTANGLE_EXT))
+			return GL_TEXTURE_RECTANGLE_EXT;
+#elif defined(GL_NV_texture_rectangle)
+                if(glIsEnabled(GL_TEXTURE_RECTANGLE_NV))
+                        return GL_TEXTURE_RECTANGLE_NV;
+#endif
+		if(glIsEnabled(GL_TEXTURE_2D))
+			return GL_TEXTURE_2D;
+		if(glIsEnabled(GL_TEXTURE_1D))
+			return GL_TEXTURE_1D;
+
+		//otherwise make the op none...
+		return GL_NONE;
+	}
+
+	
+
+	struct set_texture_shaders
+	{
+		set_texture_shaders(vector<constdef> * cdef)
+		{
+			for(stage = 0; stage < 4; stage++)
+			{
+				glActiveTextureARB(GL_TEXTURE0_ARB + stage);
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_NONE);
+			}
+			stage = 0;
+			c = cdef;
+		}
+
+		void operator() (vector<string> & instr)
+		{
+			if(stage > 3)
+				return;
+			glActiveTextureARB(GL_TEXTURE0_ARB + stage);
+
+			string op = instr[0];
+			if(op == "tex")
+			{
+				if(instr.size() != 2)
+					fprintf(stderr,"incorrect \"tex\" instruction, stage %d...\n", stage);
+				reg2stage[instr[1]] = stage;
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, get_tex_target(stage));
+			}
+			else if(op == "texbem")
+			{
+				if(instr.size() != 3 || stage == 0)
+					fprintf(stderr,"incorrect \"texbem\" instruction, stage %d...\n", stage);
+				reg2stage[instr[1]] = stage;
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_OFFSET_TEXTURE_2D_NV);
+				if(reg2stage.count(instr[2]) == 0)
+					fprintf(stderr,"incorrect \"texbem\" instruction, stage %d...\n", stage);
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
+			}
+			else if(op == "texbeml")
+			{
+				if(instr.size() != 3 || stage == 0)
+					fprintf(stderr,"incorrect \"texbeml\" instruction, stage %d...\n", stage);
+				reg2stage[instr[1]] = stage;
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_OFFSET_TEXTURE_SCALE_NV);
+				if(reg2stage.count(instr[2]) == 0)
+					fprintf(stderr,"incorrect \"texbeml\" instruction, stage %d...\n", stage);
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
+			}
+			else if(op == "texcoord")
+			{
+				if(instr.size() != 2)
+					fprintf(stderr,"incorrect \"texcoord\" instruction, stage %d...\n", stage);
+				reg2stage[instr[1]] = stage;
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_PASS_THROUGH_NV);
+			}
+			else if(op == "texkill")
+			{
+				if(instr.size() != 2)
+					fprintf(stderr,"incorrect \"texkill\" instruction, stage %d...\n", stage);
+				reg2stage[instr[1]] = stage;
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_CULL_FRAGMENT_NV);
+			}
+			else if(op == "texm3x2pad")
+			{
+				if(instr.size() != 3 || stage == 0)
+					fprintf(stderr,"incorrect \"texm3x2pad\" instruction, stage %d...\n", stage);
+				reg2stage[instr[1]] = stage;
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_NV);
+				if(instr[2].find("_bx2") != string::npos)
+				{
+				   instr[2].erase(instr[2].begin() + instr[2].find("_bx2"), instr[2].end());
+				   glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+				}
+				if(reg2stage.count(instr[2]) == 0)
+					fprintf(stderr,"incorrect \"texm3x2pad\" instruction, stage %d...\n", stage);
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
+			}
+			else if(op == "texm3x2tex")
+			{
+				if(instr.size() != 3 || stage == 0)
+					fprintf(stderr,"incorrect \"texm3x2tex\" instruction, stage %d...\n", stage);
+				reg2stage[instr[1]] = stage;
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_TEXTURE_2D_NV);
+				if(instr[2].find("_bx2") != string::npos)
+				{
+				   instr[2].erase(instr[2].begin() + instr[2].find("_bx2"), instr[2].end());
+				   glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+				}
+				if(reg2stage.count(instr[2]) == 0)
+					fprintf(stderr,"incorrect \"texm3x2tex\" instruction, stage %d...\n", stage);
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
+			}
+			else if(op == "texm3x3pad")
+			{
+				if(instr.size() != 3 || stage == 0)
+					fprintf(stderr,"incorrect \"texm3x3pad\" instruction, stage %d...\n", stage);
+				reg2stage[instr[1]] = stage;
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_NV);
+				if(instr[2].find("_bx2") != string::npos)
+				{
+				   instr[2].erase(instr[2].begin() + instr[2].find("_bx2"), instr[2].end());
+				   glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+				}
+				if(reg2stage.count(instr[2]) == 0)
+					fprintf(stderr,"incorrect \"texm3x3pad\" instruction, stage %d...\n", stage);
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
+			}
+			else if(op == "texm3x3tex")
+			{
+				if(instr.size() != 3 || stage == 0)
+					fprintf(stderr,"incorrect \"texm3x3tex\" instruction, stage %d...\n", stage);
+				reg2stage[instr[1]] = stage;
+
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV);
+
+				if(instr[2].find("_bx2") != string::npos)
+				{
+				   instr[2].erase(instr[2].begin() + instr[2].find("_bx2"), instr[2].end());
+				   glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+				}
+				if(reg2stage.count(instr[2]) == 0)
+					fprintf(stderr,"incorrect \"texm3x3tex\" instruction, stage %d...\n", stage);
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
+			}
+			else if(op == "texm3x3spec")
+			{
+				if(instr.size() != 4 || stage == 0)
+					fprintf(stderr,"incorrect \"texm3x3spec\" instruction, stage %d...\n", stage);
+				reg2stage[instr[1]] = stage;
+
+				if(! c)
+					return;
+				constdef cd;
+				for(int i = c->size()-1; i >= 0; i--)
+				{
+					cd = (*c)[i];
+					if(cd.reg == "c0")
+						break;
+				}
+
+				if(cd.reg != "c0" || instr[3] != "c0")
+					return;
+				GLfloat eye[4];
+				eye[0] = cd.r;
+				eye[1] = cd.g;
+				eye[2] = cd.b;
+				eye[3] = cd.a;
+
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV);
+				glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_CONST_EYE_NV, eye);
+
+				if(instr[2].find("_bx2") != string::npos)
+				{
+				   instr[2].erase(instr[2].begin() + instr[2].find("_bx2"), instr[2].end());
+				   glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+				}
+				if(reg2stage.count(instr[2]) == 0)
+					fprintf(stderr,"incorrect \"texm3x3tex\" instruction, stage %d...\n", stage);
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
+			}
+			else if(op == "texm3x3vspec")
+			{
+				if(instr.size() != 3 || stage == 0)
+					fprintf(stderr,"incorrect \"texm3x3vspec\" instruction, stage %d...\n", stage);
+				reg2stage[instr[1]] = stage;
+
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV);
+
+				if(instr[2].find("_bx2") != string::npos)
+				{
+				   instr[2].erase(instr[2].begin() + instr[2].find("_bx2"), instr[2].end());
+				   glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+				}
+				if(reg2stage.count(instr[2]) == 0)
+					fprintf(stderr,"incorrect \"texm3x3tex\" instruction, stage %d...\n", stage);
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
+			}
+			else if(op == "texreg2ar")
+			{
+				if(instr.size() != 3 || stage == 0)
+					fprintf(stderr,"incorrect \"texreg2ar\" instruction, stage %d...\n", stage);
+				reg2stage[instr[1]] = stage;
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DEPENDENT_AR_TEXTURE_2D_NV);
+				if(reg2stage.count(instr[2]) == 0)
+					fprintf(stderr,"incorrect \"texreg2ar\" instruction, stage %d...\n", stage);
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
+			}
+			else if(op == "texreg2gb")
+			{
+				if(instr.size() != 3 || stage == 0)
+					fprintf(stderr,"incorrect \"texreg2gb\" instruction, stage %d...\n", stage);
+				reg2stage[instr[1]] = stage;
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DEPENDENT_GB_TEXTURE_2D_NV);
+				if(reg2stage.count(instr[2]) == 0)
+					fprintf(stderr,"incorrect \"texreg2gb\" instruction, stage %d...\n", stage);
+				glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + reg2stage[instr[2]]);
+			}
+			stage++;
+		}
+
+		map<string, int> reg2stage;
+		int stage;
+		vector<constdef> * c;
+	};
+	
+	GLenum reg_enum(string s, int stage)
+	{
+		/*if(s == "c0")
+			return GL_CONSTANT_COLOR0_NV;
+		else if(s == "c1")
+			return GL_CONSTANT_COLOR1_NV;
+		else if(s == "c2")
+			return GL_CONSTANT_COLOR0_NV;
+		else if(s == "c3")
+			return GL_CONSTANT_COLOR1_NV;
+		else if(s == "c4")
+			return GL_CONSTANT_COLOR0_NV;
+		else if(s == "c5")
+			return GL_CONSTANT_COLOR1_NV;
+		else if(s == "c6")
+			return GL_CONSTANT_COLOR0_NV;
+		else if(s == "c7")
+			return GL_CONSTANT_COLOR1_NV;
+			*/
+		if (s == "c0" || s == "c1" || s == "c2" || s == "c3" || 
+			s == "c4" || s == "c5" || s == "c6" || s == "c7")
+		{
+			GLenum result;
+			if (!AddToMap(s,stage,result))
+				errors.set("Illegal constant usage.",line_number);
+			  // This is a pain, since the caller is a void and no check is made for errors. Sigh.
+			return result;
+		}
+		else if(s == "t0")
+			return GL_TEXTURE0_ARB;
+		else if(s == "t1")
+			return GL_TEXTURE1_ARB;
+		else if(s == "t2")
+			return GL_TEXTURE2_ARB;
+		else if(s == "t3")
+			return GL_TEXTURE3_ARB;
+		else if(s == "v0")
+			return GL_PRIMARY_COLOR_NV;
+		else if(s == "v1")
+			return GL_SECONDARY_COLOR_NV;
+		else if(s == "r0")
+			return GL_SPARE0_NV;
+		else if(s == "r1")
+			return GL_SPARE1_NV;
+		else // ??
+			return GL_DISCARD_NV;
+	}
+
+	struct src
+	{
+		src(string s, int stage, string *regname=NULL)
+		{
+			init(s, stage, regname);
+		}
+
+
+		void init(string s, int stage, string *regname=NULL)
+		{
+			arg = s;
+			comp = GL_RGB;
+            alphaComp = GL_ALPHA;
+			map = GL_SIGNED_IDENTITY_NV;
+
+			unsigned int offset;
+			if(
+                (offset = s.find(".a")) != string::npos ||
+                (offset = s.find(".w")) != string::npos
+              )
+			{
+				comp = GL_ALPHA;
+				s.erase(offset, offset+2);
+			}
+            else if ((offset = s.find(".b")) != string::npos ||
+                     (offset = s.find(".z")) != string::npos)
+            {
+                alphaComp = GL_BLUE;
+                s.erase(offset,offset+2);
+            }
+
+			bool negate = false;
+
+			if(s[0] == '1')
+			{
+				s.erase(0, 1);
+				while(s[0] == ' ')
+					s.erase(0,1);
+				if(s[0] == '-')
+					s.erase(0,1);
+				while(s[0] == ' ')
+					s.erase(0,1);
+				map = GL_UNSIGNED_INVERT_NV;
+			}
+			else if(s[0] == '-')
+			{
+				s.erase(0, 1);
+				while(s[0] == ' ')
+					s.erase(0,1);
+				negate = true;
+				map = GL_UNSIGNED_INVERT_NV;
+			}
+
+			bool half_bias = false;
+			bool expand = false;
+			if(s.find("_bias") != string::npos)
+			{
+				s.erase(s.find("_bias"), 5);
+				half_bias = true;
+			}
+			else if(s.find("_bx2") != string::npos)
+			{
+				s.erase(s.find("_bx2"), 4);
+				expand = true;
+			}
+			
+			if(expand)
+			{
+				if(negate)
+					map = GL_EXPAND_NEGATE_NV;
+				else
+					map = GL_EXPAND_NORMAL_NV;
+			}
+			else if(half_bias)
+			{
+				if(negate)
+					map = GL_HALF_BIAS_NEGATE_NV;
+				else
+					map = GL_HALF_BIAS_NORMAL_NV;
+			}
+			reg = reg_enum(s,stage);
+
+			if (regname != NULL) 
+				*regname = s; // return the bare register name
+
+			
+            //alphaComp = GL_ALPHA;
+			std::set<const char*, ltstr>::iterator iter = 
+				ps10::alphaBlueRegisters.find(s.c_str());
+			if (iter != ps10::alphaBlueRegisters.end())
+				alphaComp = GL_BLUE;
+
+		}
+
+		string arg;
+		GLenum reg;
+		GLenum map;
+		GLenum comp;
+		GLenum alphaComp;
+	};
+
+
+	struct set_register_combiners
+	{
+		set_register_combiners()
+		{
+          // combiner = 0;
+          combiner = -1;
+		}
+
+		void operator() (vector<string> & instr)
+		{
+			string op;
+			GLenum scale = GL_NONE;
+			bool op_sat = false;
+            bool paired_instr = false;
+            int instr_base = 0;
+            if (instr[0]=="+") {
+              paired_instr = true;
+              instr_base = 1;
+            }
+			op = instr[instr_base];
+			unsigned int offset;
+			if((offset = op.find("_x2")) != string::npos)
+			{
+				scale = GL_SCALE_BY_TWO_NV;
+				op.erase(op.begin()+offset, op.begin()+offset+3);
+			}
+			else if((offset = op.find("_x4")) != string::npos)
+			{
+				scale = GL_SCALE_BY_FOUR_NV;
+				op.erase(op.begin()+offset, op.begin()+offset+3);
+			}
+			else if((offset = op.find("_d2")) != string::npos)
+			{
+				scale = GL_SCALE_BY_ONE_HALF_NV;
+				op.erase(op.begin()+offset, op.begin()+offset+3);
+			}
+
+			if((offset = op.find("_sat")) != string::npos)
+			{
+				// need to actually use this...
+				op_sat = true;
+				op.erase(op.begin()+offset, op.begin()+offset+4);
+			}
+			
+			string dst = instr[1+instr_base];
+			int mask = GL_RGBA;
+			if(
+                (offset = dst.find(".rgba")) != string::npos  ||
+                (offset = dst.find(".xyzw")) != string::npos 
+                )
+			{
+				dst.erase(offset, offset + 5);
+			}
+			else if(
+                (offset = dst.find(".rgb")) != string::npos  ||
+                (offset = dst.find(".xyz")) != string::npos 
+                )
+			{
+				dst.erase(offset, offset + 4);
+				mask = GL_RGB;
+			}
+			else if(
+                (offset = dst.find(".a")) != string::npos  ||
+                (offset = dst.find(".w")) != string::npos 
+                )
+			{
+				dst.erase(offset, offset + 2);
+				mask = GL_ALPHA;
+			}
+
+            if (!paired_instr) 
+              combiner++;
+
+			GLenum dreg = reg_enum(dst,combiner);
+			GLenum C = GL_COMBINER0_NV + combiner;
+
+			bool isAlphaBlue = false; // To keep track of whether the dst register's alpha was its blue value.
+
+			if(op == "add" || op == "sub")
+			{
+				src a(instr[2+instr_base],combiner);
+				src b(instr[3+instr_base],combiner);
+
+				if(mask == GL_RGBA || mask == GL_RGB)
+				{
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_A_NV, a.reg, a.map, a.comp);
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_RGB);
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_C_NV, b.reg, b.map, b.comp);
+					if(op == "add")
+						glCombinerInputNV(C, GL_RGB, GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_RGB);
+					else
+						glCombinerInputNV(C, GL_RGB, GL_VARIABLE_D_NV, GL_ZERO, GL_EXPAND_NORMAL_NV, GL_RGB);
+					glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, dreg, scale, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+				else if (!paired_instr)
+				{
+					glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+
+				if(mask == GL_RGBA || mask == GL_ALPHA)
+				{
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_A_NV, a.reg, a.map, a.alphaComp);
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_ALPHA);
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_C_NV, b.reg, b.map, b.alphaComp);
+					if(op == "add")
+						glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_ALPHA);
+					else
+						glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_D_NV, GL_ZERO, GL_EXPAND_NORMAL_NV, GL_ALPHA);
+					glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, dreg, scale, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+				else if (!paired_instr)
+				{
+					glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+			}
+			else if(op == "cnd")
+			{
+				src a(instr[3+instr_base],combiner);
+				src b(instr[4+instr_base],combiner);
+
+				if(instr[2+instr_base] != "r0.a" && instr[2+instr_base] != "r0.w")
+				{} // bad
+				if(mask == GL_RGBA || mask == GL_RGB)
+				{
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_A_NV, a.reg, a.map, a.comp);
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_RGB);
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_C_NV, b.reg, b.map, b.comp);
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_RGB);
+					glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, dreg, scale, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_TRUE);
+				}
+				else if (!paired_instr)
+				{
+					glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+
+				if(mask == GL_RGBA || mask == GL_ALPHA)
+				{
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_A_NV, a.reg, a.map, a.alphaComp);
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_ALPHA);
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_C_NV, b.reg, b.map, b.alphaComp);
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_ALPHA);
+					glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, dreg, scale, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_TRUE);
+				}
+				else if (!paired_instr)
+				{
+					glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+			}
+			else if(op == "dp3")
+			{
+				src a(instr[2+instr_base],combiner);
+				src b(instr[3+instr_base],combiner);
+
+				if(mask == GL_RGBA || mask == GL_RGB)
+				{
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_A_NV, a.reg, a.map, a.comp);
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_B_NV, b.reg, b.map, b.comp);
+					glCombinerOutputNV(C, GL_RGB, dreg, GL_DISCARD_NV, GL_DISCARD_NV, scale, GL_NONE,
+						GL_TRUE, GL_FALSE, GL_FALSE);
+				}
+				else if (!paired_instr)
+				{
+					// ooh.. what to do here?
+				}
+
+				if(mask == GL_RGBA || mask == GL_ALPHA)
+				{
+					// todo -- make next ref to dst.a actually ref dst.b since combiners can't write dp3 to the alpha channel
+					// Done by Ashu: Put this register in the alphaBlueRegister set. 
+					isAlphaBlue = true;
+					ps10::alphaBlueRegisters.insert(dst.c_str());
+				}
+				else if (!paired_instr)
+				{
+					glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+			}
+			else if(op == "lrp")
+			{
+				src a(instr[2+instr_base],combiner);
+				src b(instr[3+instr_base],combiner);
+				src c(instr[4+instr_base],combiner);
+
+				if(mask == GL_RGBA || mask == GL_RGB)
+				{
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_A_NV, a.reg, GL_UNSIGNED_IDENTITY_NV, a.comp);
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_B_NV, b.reg, b.map, b.comp);
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_C_NV, a.reg, GL_UNSIGNED_INVERT_NV, a.comp);
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_D_NV, c.reg, c.map, c.comp);
+					glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, dreg, scale, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+				else if (!paired_instr)
+				{
+					glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+
+				if(mask == GL_RGBA || mask == GL_ALPHA)
+				{
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_A_NV, a.reg, GL_UNSIGNED_IDENTITY_NV, a.alphaComp);
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_B_NV, b.reg, b.map, b.alphaComp);
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_C_NV, a.reg, GL_UNSIGNED_INVERT_NV, a.alphaComp);
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_D_NV, c.reg, c.map, c.alphaComp);
+					glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, dreg, scale, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+				else if (!paired_instr)
+				{
+					glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+			}
+			else if(op == "mad")
+			{
+				src a(instr[2+instr_base],combiner);
+				src b(instr[3+instr_base],combiner);
+				src c(instr[4+instr_base],combiner);
+
+				if(mask == GL_RGBA || mask == GL_RGB)
+				{
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_A_NV, a.reg, a.map, a.comp);
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_B_NV, b.reg, b.map, b.comp);					
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_C_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_RGB);
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_D_NV, c.reg, c.map, c.comp);
+					glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, dreg, scale, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+				else if (!paired_instr)
+				{
+					glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+
+				if(mask == GL_RGBA || mask == GL_ALPHA)
+				{
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_A_NV, a.reg, a.map, a.alphaComp);
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_B_NV, b.reg, b.map, b.alphaComp);
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_C_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_ALPHA);
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_D_NV, c.reg, c.map, c.alphaComp);
+					glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, dreg, scale, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+				else if (!paired_instr)
+				{
+					glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+			}
+			else if(op == "mov")
+			{
+				src a(instr[2+instr_base],combiner);
+
+				if(mask == GL_RGBA || mask == GL_RGB)
+				{
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_A_NV, a.reg, a.map, a.comp);
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_RGB);
+					glCombinerOutputNV(C, GL_RGB, dreg, GL_DISCARD_NV, GL_DISCARD_NV, scale, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+				else if (!paired_instr)
+				{
+					glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+
+				if(mask == GL_RGBA || mask == GL_ALPHA)
+				{
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_A_NV, a.reg, a.map, a.alphaComp);
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_ALPHA);
+					glCombinerOutputNV(C, GL_ALPHA, dreg, GL_DISCARD_NV, GL_DISCARD_NV, scale, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+				else if (!paired_instr)
+				{
+					glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+			}
+			else if(op == "mul")
+			{
+				src a(instr[2+instr_base],combiner);
+				src b(instr[3+instr_base],combiner);
+
+				if(mask == GL_RGBA || mask == GL_RGB)
+				{
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_A_NV, a.reg, a.map, a.comp);
+					glCombinerInputNV(C, GL_RGB, GL_VARIABLE_B_NV, b.reg, b.map, b.comp);
+					glCombinerOutputNV(C, GL_RGB, dreg, GL_DISCARD_NV, GL_DISCARD_NV, scale, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+				else if (!paired_instr)
+				{
+					glCombinerOutputNV(C, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+
+				if(mask == GL_RGBA || mask == GL_ALPHA)
+				{
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_A_NV, a.reg, a.map, a.alphaComp);
+					glCombinerInputNV(C, GL_ALPHA, GL_VARIABLE_B_NV, b.reg, b.map, b.alphaComp);
+					glCombinerOutputNV(C, GL_ALPHA, dreg, GL_DISCARD_NV, GL_DISCARD_NV, scale, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+				else if (!paired_instr)
+				{
+					glCombinerOutputNV(C, GL_ALPHA, GL_DISCARD_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE,
+									   GL_FALSE, GL_FALSE, GL_FALSE);
+				}
+			}
+            // combiner++;
+			if (!isAlphaBlue)
+				RemoveFromAlphaBlue(dst);
+		}
+
+		int combiner;
+	};
+
+
+}
+
+void ps10::SetFinalCombinerStage()
+{
+	glFinalCombinerInputNV(GL_VARIABLE_A_NV,GL_FOG,GL_UNSIGNED_IDENTITY_NV,GL_ALPHA);
+	glFinalCombinerInputNV(GL_VARIABLE_B_NV,GL_SPARE0_NV,
+			GL_UNSIGNED_IDENTITY_NV,GL_RGB);
+	glFinalCombinerInputNV(GL_VARIABLE_C_NV,GL_FOG,GL_UNSIGNED_IDENTITY_NV,GL_RGB);
+	glFinalCombinerInputNV(GL_VARIABLE_D_NV,GL_ZERO,GL_UNSIGNED_IDENTITY_NV,GL_RGB);
+	glFinalCombinerInputNV(GL_VARIABLE_E_NV,GL_ZERO,GL_UNSIGNED_IDENTITY_NV,GL_RGB);
+	glFinalCombinerInputNV(GL_VARIABLE_F_NV,GL_ZERO,GL_UNSIGNED_IDENTITY_NV,GL_RGB);
+	std::set<const char*, ltstr>::iterator iter = ps10::alphaBlueRegisters.find("r0");
+	GLenum alphaComp = GL_ALPHA;
+	if (iter != ps10::alphaBlueRegisters.end())
+		alphaComp = GL_BLUE;
+	glFinalCombinerInputNV(GL_VARIABLE_G_NV,GL_SPARE0_NV,GL_UNSIGNED_IDENTITY_NV,alphaComp);
+	// We can now clear alphaBlueRegisters for the next go around
+	alphaBlueRegisters.clear();
+}
+
+void ps10::invoke(vector<constdef> * c,
+	              list<vector<string> > * a,
+				  list<vector<string> > * b)
+{
+	const_to_combiner_reg_mapping_count = 0; // Hansong
+
+
+	glEnable(GL_PER_STAGE_CONSTANTS_NV); // should we require apps to do this?
+	if(c)
+		for_each(c->begin(), c->end(), set_constants());
+	if(a)
+		for_each(a->begin(), a->end(), set_texture_shaders(c));
+	glActiveTextureARB( GL_TEXTURE0_ARB );
+    int numCombiners = 0;
+    list<vector<string> >::iterator it = b->begin();
+    for(; it!=b->end(); ++it) {
+      if ( (*it)[0] != "+" )
+        numCombiners++;
+    }
+    glCombinerParameteriNV(GL_NUM_GENERAL_COMBINERS_NV, numCombiners);
+	if(b)
+		for_each(b->begin(), b->end(), set_register_combiners());
+	SetFinalCombinerStage();
+	// We can clear the stageToTarget map now.
+	stageToTargetMap.clear();
+}
+
+// simple identification - just look for magic substring
+//  -- easy to break...
+bool is_ps10(const char * s)
+{
+	if(strstr(s, "ps.1.0"))
+		return true;
+	if(strstr(s, "Ps.1.0"))
+		return true;
+	if(strstr(s, "ps.1.1"))
+		return true;
+	if(strstr(s, "Ps.1.1"))
+		return true;
+	return false;
+}
+
+bool ps10::init_extensions()
+{
+	// register combiners	
+	static bool rcinit = false;
+	if(rcinit == false)
+	{
+      /*
+		if(! glh_init_extensions("GL_NV_register_combiners"))
+		{
+			errors.set("unable to initialize GL_NV_register_combiners\n");
+			return false;
+		}
+		else
+		{
+        */
+			rcinit = true;
+            /*
+		}
+        */
+	}
+
+	// register combiners 2
+	static bool rc2init = false;
+	if(rc2init == false)
+	{
+      /*
+		if( ! glh_init_extensions("GL_NV_register_combiners2"))
+		{
+			errors.set("unable to initialize GL_NV_register_combiners2\n");
+			return false;
+		}
+		else
+		{
+        */
+			rc2init = true;
+            /*
+		}
+        */
+	}
+	
+	static bool tsinit = 0;	
+	if (tsinit == false )
+	{
+      /*
+		if(! glh_init_extensions( "GL_NV_texture_shader " "GL_ARB_multitexture " ))
+		{
+			errors.set("unable to initialize GL_NV_texture_shader\n");
+			return false;
+		}
+		else
+		{
+        */
+			tsinit = true;
+            /*
+		}
+        */
+	}
+	constToStageAndConstMap.clear();
+	constToStageArray.clear();
+	stageToConstMap.clear();
+	line_number = 1;
+	return true;
+}
+
+const int* ps10_get_info(int* pcount)
+{
+	if (pcount)
+		*pcount = constToStageArray.size();
+	return &(constToStageArray[0]);
+}
Index: /RenderSystems/GL/src/nvparse/ps1.0_program.h
===================================================================
--- /RenderSystems/GL/src/nvparse/ps1.0_program.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/ps1.0_program.h	(revision 5)
@@ -0,0 +1,30 @@
+#ifndef _PS10_PROGRAM_H
+#define _PS10_PROGRAM_H
+
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+#include <string>
+#include <list>
+#include <vector>
+#include <map>
+
+namespace ps10
+{
+
+	struct constdef
+	{
+		std::string reg;
+		float r,g,b,a;
+	};
+
+	extern std::map<int, std::pair<int,int> > constToStageAndConstMap;
+	extern std::map<int, GLenum> stageToTargetMap;
+	void invoke(std::vector<constdef> * c,
+		        std::list<std::vector<std::string> > * a,
+				std::list<std::vector<std::string> > * b);
+	
+	bool init_extensions();
+}
+
+#endif
Index: /RenderSystems/GL/src/nvparse/ps1.0_tokens.l
===================================================================
--- /RenderSystems/GL/src/nvparse/ps1.0_tokens.l	(revision 5)
+++ /RenderSystems/GL/src/nvparse/ps1.0_tokens.l	(revision 5)
@@ -0,0 +1,157 @@
+/* definitions */
+digit    [0-9]
+char     [a-zA-Z_.]
+alphanum [0-9a-zA-Z_]
+
+%option prefix="ps10_"
+%{  /* code to be included */
+
+#include <stdlib.h>
+#include <list>
+#include <vector>
+
+#include "ps1.0_program.h"
+
+using namespace std;
+using namespace ps10;
+
+#include "_ps1.0_parser.h"
+
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+
+#define YY_INPUT(buf,result,max_size)                            \
+{                                                                \
+	int c = *myin++;                                             \
+	result = (c == 0) ? YY_NULL : (buf[0] = c, 1);               \
+}
+
+#define YY_ALWAYS_INTERACTIVE 1
+
+//#define DBG_MESG(msg, line)  	errors.set(msg, line)
+#define DBG_MESG(msg, line)
+
+static char buf[80];
+
+
+%}
+
+%s DEFSTATE
+
+/* end of definitions */
+%%
+
+; |
+\/\/			{
+			    char ch;
+			    while ((ch = yyinput()) != '\n')
+					;
+				line_number++;
+				DBG_MESG("dbg: comment, NEWLINE", line_number-1);
+				return NEWLINE;
+			}
+
+<DEFSTATE>[+-]?[0-9]+\.[0-9]* |
+<DEFSTATE>[+-]?[0-9]*\.[0-9]+	|
+<DEFSTATE>[+-]?[0-9]+	{
+				ps10_lval.fval = (float)atof(yytext);
+				// debug
+				DBG_MESG("dbg: NUMBER", line_number);
+				return NUMBER;
+			}
+
+
+
+
+def			{
+				// debug
+				DBG_MESG("dbg: DEF", line_number);
+				BEGIN DEFSTATE;
+				return DEF;
+			}
+
+
+((1[ \t]*)?-[ \t]*)?r[01](\.a|\.b|\.w|\.rgb|\.xyz|_bias|_bx2)?   |
+((1[ \t]*)?-[ \t]*)?c[0-7](\.a|\.b|\.w|\.rgb|\.xyz|_bias|_bx2)?  |
+((1[ \t]*)?-[ \t]*)?t[0-3](\.a|\.b|\.w|\.rgb|\.xyz|_bias|_bx2)?  |
+((1[ \t]*)?-[ \t]*)?v[01](\.a|\.b|\.w|\.rgb|\.xyz|_bias|_bx2)?   {
+				sprintf(buf, "dbg: REG = %s", yytext);
+				// debug
+				DBG_MESG(buf, line_number);
+				ps10_lval.sval = new string(yytext);
+				return REG;
+			}
+
+add(_x2|_x4|_d2)?(_sat)? |
+cnd(_x2|_x4|_d2)?(_sat)? |
+dp3(_x2|_x4|_d2)?(_sat)? |
+lrp(_x2|_x4|_d2)?(_sat)? |
+mad(_x2|_x4|_d2)?(_sat)? |
+mov(_x2|_x4|_d2)?(_sat)? |
+mul(_x2|_x4|_d2)?(_sat)? |
+sub(_x2|_x4|_d2)?(_sat)? {
+				sprintf(buf, "dbg: BLENDOP = %s", yytext);
+				// debug
+				DBG_MESG(buf, line_number);
+				ps10_lval.sval = new string(yytext);
+				return BLENDOP;
+			}
+
+tex          |
+texbem       |
+texbeml      |
+texcoord     |
+texkill      |
+texm3x2pad   |
+texm3x2tex   |
+texreg2ar    |
+texreg2gb    |
+texm3x3pad   |
+texm3x3spec  |
+texm3x3tex   |
+texm3x3vspec	{
+				sprintf(buf, "dbg: ADDROP = %s", yytext);
+				// debug
+				DBG_MESG(buf, line_number);
+				ps10_lval.sval = new string(yytext);
+				return ADDROP;
+			}
+
+
+
+([ \t]*\r?\n)+	{
+				line_number++;
+				BEGIN 0;
+				// debug
+				DBG_MESG("dbg: NEWLINE", line_number-1);
+				return NEWLINE;
+			}
+
+[ \t]+		{
+			}
+
+[Pp]s\.1.[01]		{
+				return HEADER;
+			}
+
+.			{
+				char buf[40];
+				sprintf(buf, "character token == '%c'", *yytext);
+				DBG_MESG(buf, line_number);
+				return *yytext;
+			}
+
+%%
+bool ps10_init(char* inputString)
+{
+    myin = inputString;
+	return init_extensions();
+}
+
+#ifndef ps10_wrap
+int ps10_wrap(void)
+{
+  return(1);
+}
+#endif
Index: /RenderSystems/GL/src/nvparse/rc1.0_combiners.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/rc1.0_combiners.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/rc1.0_combiners.cpp	(revision 5)
@@ -0,0 +1,91 @@
+#include "rc1.0_combiners.h"
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+#include <string.h>
+#include <OgreGLPrerequisites.h>
+
+void CombinersStruct::Validate()
+{
+	if (2 == numConsts &&
+		cc[0].reg.bits.name == cc[1].reg.bits.name)
+		errors.set("global constant set twice");
+
+	generals.Validate(numConsts, &cc[0]);
+
+	final.Validate();
+}
+
+void CombinersStruct::Invoke()
+{
+	for (int i = 0; i < numConsts; i++)
+		glCombinerParameterfvNV(cc[i].reg.bits.name, &(cc[i].v[0]));
+
+	generals.Invoke();
+
+	final.Invoke();
+}
+
+bool is_rc10(const char * s)
+{
+	return ! strncmp(s, "!!RC1.0", 7);
+}
+
+
+bool rc10_init_more()
+{
+	bool rcinit = false;
+	if(rcinit == false)
+	{
+      /*
+		if(! glh_init_extensions("GL_NV_register_combiners"))
+		{
+			errors.set("unable to initialize GL_NV_register_combiners\n");
+			return false;
+		}
+		else
+		{
+        */
+			rcinit = true;
+            /*
+		}
+        */
+	}
+
+	bool rc2init = false;
+	if(rc2init == false)
+	{
+		//glh_init_extensions("GL_NV_register_combiners2");
+		// Don't fail if this doesn't initialize.
+		// We will run even if it doesn't exist.
+		rc2init = true;
+	}
+	
+	errors.reset();
+	line_number = 1;
+
+	return true;
+}
+/*
+    else if(!strncmp(instring, "!!RC1.0", 7))
+    {
+        if(glCombinerParameterfvNV == 0)
+        {
+            if(! glh_init_extensions("GL_NV_register_combiners"))
+            {
+                errors.set("unable to initialize GL_NV_register_combiners\n");
+                free(instring);
+                return;
+            }
+        }
+        if(glCombinerStageParameterfvNV == 0)
+        {
+            glh_init_extensions("GL_NV_register_combiners2");
+            // Don't fail if this doesn't initialize.
+            // We will run even if it doesn't exist.
+        }
+        errors.reset();
+        line_number = 1;
+        rc10_init(instring+7);
+        rc10_parse();
+    }
+*/
Index: /RenderSystems/GL/src/nvparse/rc1.0_combiners.h
===================================================================
--- /RenderSystems/GL/src/nvparse/rc1.0_combiners.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/rc1.0_combiners.h	(revision 5)
@@ -0,0 +1,24 @@
+#ifndef _RC10_COMBINERS_H
+#define _RC10_COMBINERS_H
+
+#include "rc1.0_general.h"
+#include "rc1.0_final.h"
+
+class CombinersStruct {
+public:
+	void Init(GeneralCombinersStruct _gcs, FinalCombinerStruct _fc, ConstColorStruct _cc0, ConstColorStruct _cc1)
+	{ generals = _gcs; final = _fc; cc[0] = _cc0; cc[1] = _cc1; numConsts = 2;}
+	void Init(GeneralCombinersStruct _gcs, FinalCombinerStruct _fc, ConstColorStruct _cc0)
+	{ generals = _gcs; final = _fc; cc[0] = _cc0; numConsts = 1;}
+	void Init(GeneralCombinersStruct _gcs, FinalCombinerStruct _fc)
+	{ generals = _gcs; final = _fc; numConsts = 0;}
+	void Validate();
+	void Invoke();
+private:
+	GeneralCombinersStruct generals;
+	FinalCombinerStruct final;
+	ConstColorStruct cc[2];
+	int numConsts;
+};
+
+#endif
Index: /RenderSystems/GL/src/nvparse/rc1.0_final.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/rc1.0_final.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/rc1.0_final.cpp	(revision 5)
@@ -0,0 +1,159 @@
+#include "rc1.0_final.h"
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+#include <OgreGLPrerequisites.h>
+
+void FinalRgbFunctionStruct::ZeroOut()
+{
+	RegisterEnum zero;
+	zero.word = RCP_ZERO;
+	a.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+	b.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+	c.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+	d.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+}
+
+void FinalAlphaFunctionStruct::ZeroOut()
+{
+	RegisterEnum zero;
+	zero.word = RCP_ZERO;
+	g.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+}
+
+void FinalProductStruct::ZeroOut()
+{
+	RegisterEnum zero;
+	zero.word = RCP_ZERO;
+	e.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+	f.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+}
+void FinalCombinerStruct::Validate()
+{
+	if (hasProduct &&
+		(GL_E_TIMES_F_NV == product.e.reg.bits.name ||
+		 GL_SPARE0_PLUS_SECONDARY_COLOR_NV == product.e.reg.bits.name ||
+		 GL_DISCARD_NV == product.e.reg.bits.name ||
+		 GL_E_TIMES_F_NV == product.f.reg.bits.name ||
+		 GL_SPARE0_PLUS_SECONDARY_COLOR_NV == product.f.reg.bits.name ||
+		 GL_DISCARD_NV == product.f.reg.bits.name))
+		errors.set("invalid input register for final_product");
+
+	if (hasProduct &&
+		(RCP_BLUE == product.e.reg.bits.channel ||
+		 RCP_BLUE == product.f.reg.bits.channel))
+		errors.set("blue register used in final_product");
+
+	if (GL_E_TIMES_F_NV == alpha.g.reg.bits.name ||
+		GL_SPARE0_PLUS_SECONDARY_COLOR_NV == alpha.g.reg.bits.name ||
+		GL_DISCARD_NV == alpha.g.reg.bits.name)
+		errors.set("invalid input register for final alpha");
+
+	if (RCP_RGB == alpha.g.reg.bits.channel)
+		errors.set("rgb register used in final alpha");
+
+	if (GL_SPARE0_PLUS_SECONDARY_COLOR_NV == rgb.a.reg.bits.name &&
+		GL_SPARE0_PLUS_SECONDARY_COLOR_NV != rgb.b.reg.bits.name &&
+		GL_ZERO == rgb.c.reg.bits.name && GL_UNSIGNED_IDENTITY_NV == rgb.c.map)
+	{
+		MappedRegisterStruct temp;
+		temp = rgb.a;
+		rgb.a = rgb.b;
+		rgb.b = temp;
+	}
+
+	if (GL_SPARE0_PLUS_SECONDARY_COLOR_NV == rgb.a.reg.bits.name &&
+		GL_ZERO == rgb.b.reg.bits.name && GL_UNSIGNED_INVERT_NV == rgb.b.map &&
+		GL_ZERO == rgb.c.reg.bits.name && GL_UNSIGNED_IDENTITY_NV == rgb.c.map &&
+		GL_SPARE0_PLUS_SECONDARY_COLOR_NV != rgb.d.reg.bits.name)
+	{
+		MappedRegisterStruct temp;
+		temp = rgb.a;
+		rgb.a = rgb.d;
+		rgb.d = temp;
+	}
+
+	if (GL_SPARE0_PLUS_SECONDARY_COLOR_NV == rgb.a.reg.bits.name ||
+		GL_DISCARD_NV == rgb.a.reg.bits.name ||
+		GL_DISCARD_NV == rgb.b.reg.bits.name ||
+		GL_DISCARD_NV == rgb.c.reg.bits.name ||
+		GL_DISCARD_NV == rgb.d.reg.bits.name)
+		errors.set("invalid input register for final rgb");
+
+	if (RCP_BLUE == rgb.a.reg.bits.channel ||
+		RCP_BLUE == rgb.b.reg.bits.channel ||
+		RCP_BLUE == rgb.c.reg.bits.channel ||
+		RCP_BLUE == rgb.d.reg.bits.channel)
+		errors.set("blue register used in final rgb");
+
+	if ((GL_E_TIMES_F_NV == rgb.a.reg.bits.name ||
+		GL_E_TIMES_F_NV == rgb.b.reg.bits.name ||
+		GL_E_TIMES_F_NV == rgb.c.reg.bits.name ||
+		GL_E_TIMES_F_NV == rgb.d.reg.bits.name) && !hasProduct)
+		errors.set("final_product used but not set");
+
+	if (RCP_NONE == rgb.a.reg.bits.channel)
+		rgb.a.reg.bits.channel = RCP_RGB;
+	if (RCP_NONE == rgb.b.reg.bits.channel)
+		rgb.b.reg.bits.channel = RCP_RGB;
+	if (RCP_NONE == rgb.c.reg.bits.channel)
+		rgb.c.reg.bits.channel = RCP_RGB;
+	if (RCP_NONE == rgb.d.reg.bits.channel)
+		rgb.d.reg.bits.channel = RCP_RGB;
+	if (RCP_NONE == product.e.reg.bits.channel)
+		product.e.reg.bits.channel = RCP_RGB;
+	if (RCP_NONE == product.f.reg.bits.channel)
+		product.f.reg.bits.channel = RCP_RGB;
+	if (RCP_NONE == alpha.g.reg.bits.channel)
+		alpha.g.reg.bits.channel = RCP_ALPHA;
+}
+
+void FinalCombinerStruct::Invoke()
+{
+	if(clamp)
+		glCombinerParameteriNV(GL_COLOR_SUM_CLAMP_NV, GL_TRUE);
+	else
+		glCombinerParameteriNV(GL_COLOR_SUM_CLAMP_NV, GL_FALSE);
+
+	glFinalCombinerInputNV(
+		GL_VARIABLE_A_NV,
+		rgb.a.reg.bits.name,
+		rgb.a.map,
+		MAP_CHANNEL(rgb.a.reg.bits.channel));
+
+	glFinalCombinerInputNV(
+		GL_VARIABLE_B_NV,
+		rgb.b.reg.bits.name,
+		rgb.b.map,
+		MAP_CHANNEL(rgb.b.reg.bits.channel));
+
+	glFinalCombinerInputNV(
+		GL_VARIABLE_C_NV,
+		rgb.c.reg.bits.name,
+		rgb.c.map,
+		MAP_CHANNEL(rgb.c.reg.bits.channel));
+
+	glFinalCombinerInputNV(
+		GL_VARIABLE_D_NV,
+		rgb.d.reg.bits.name,
+		rgb.d.map,
+		MAP_CHANNEL(rgb.d.reg.bits.channel));
+
+	glFinalCombinerInputNV(
+		GL_VARIABLE_E_NV,
+		product.e.reg.bits.name,
+		product.e.map,
+		MAP_CHANNEL(product.e.reg.bits.channel));
+
+	glFinalCombinerInputNV(
+		GL_VARIABLE_F_NV,
+		product.f.reg.bits.name,
+		product.f.map,
+		MAP_CHANNEL(product.f.reg.bits.channel));
+
+	glFinalCombinerInputNV(
+		GL_VARIABLE_G_NV,
+		alpha.g.reg.bits.name,
+		alpha.g.map,
+		MAP_CHANNEL(alpha.g.reg.bits.channel));
+}
Index: /RenderSystems/GL/src/nvparse/rc1.0_final.h
===================================================================
--- /RenderSystems/GL/src/nvparse/rc1.0_final.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/rc1.0_final.h	(revision 5)
@@ -0,0 +1,48 @@
+#ifndef _RC10_FINAL_H
+#define _RC10_FINAL_H
+
+#include "rc1.0_register.h"
+
+class FinalAlphaFunctionStruct {
+public:
+	void Init(MappedRegisterStruct _g) { g = _g; }
+	void ZeroOut();
+	MappedRegisterStruct g;
+};
+
+class FinalRgbFunctionStruct {
+public:
+	void Init(MappedRegisterStruct _a, MappedRegisterStruct _b, MappedRegisterStruct _c, MappedRegisterStruct _d)
+	{ a = _a; b = _b; c = _c; d = _d; }
+	void ZeroOut();
+	MappedRegisterStruct a;
+	MappedRegisterStruct b;
+	MappedRegisterStruct c;
+	MappedRegisterStruct d;
+};
+
+class FinalProductStruct {
+public:
+	void Init(MappedRegisterStruct _e, MappedRegisterStruct _f) { e = _e; f = _f; }
+	void ZeroOut();
+	MappedRegisterStruct e;
+	MappedRegisterStruct f;
+};
+
+class FinalCombinerStruct {
+public:
+	void Init(FinalRgbFunctionStruct _rgb, FinalAlphaFunctionStruct _alpha, int _clamp, FinalProductStruct _product)
+	{ rgb = _rgb; alpha = _alpha; clamp = _clamp; product = _product; hasProduct = true;}
+	void Init(FinalRgbFunctionStruct _rgb, FinalAlphaFunctionStruct _alpha, int _clamp)
+	{ rgb = _rgb; alpha = _alpha; clamp = _clamp; hasProduct = false; product.ZeroOut();}
+
+	int hasProduct;
+	FinalProductStruct product;
+	int clamp;
+	FinalRgbFunctionStruct rgb;
+	FinalAlphaFunctionStruct alpha;
+	void Validate();
+	void Invoke();
+};
+
+#endif
Index: /RenderSystems/GL/src/nvparse/rc1.0_general.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/rc1.0_general.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/rc1.0_general.cpp	(revision 5)
@@ -0,0 +1,300 @@
+#include "rc1.0_general.h"
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+#include <stdio.h>
+
+#include <OgreGLPrerequisites.h>
+
+void GeneralCombinersStruct::Validate(int numConsts, ConstColorStruct *pcc)
+{
+	GLint maxGCs;
+	glGetIntegerv(GL_MAX_GENERAL_COMBINERS_NV, &maxGCs);
+	if (num > maxGCs) {
+		char buffer[256];
+		sprintf(buffer, "%d general combiners specified, only %d supported", num, (int)maxGCs);
+		errors.set(buffer);
+		num = maxGCs;
+	}
+
+	if (0 == num) {
+		// Setup a "fake" general combiner 0
+		general[0].ZeroOut();
+		num = 1;
+	}
+
+	localConsts = 0;
+	int i;
+	for (i = 0; i < num; i++)
+		localConsts += general[i].numConsts;
+
+	if (localConsts > 0)
+		if (NULL == glCombinerStageParameterfvNV)
+			errors.set("local constant(s) specified, but not supported -- ignored");
+		else
+			for (i = 0; i < num; i++)
+				general[i].SetUnusedLocalConsts(numConsts, pcc);
+
+	for (i = 0; i < num; i++)
+		general[i].Validate(i);
+
+
+	for (; i < maxGCs; i++)
+		general[i].ZeroOut();
+}
+
+void GeneralCombinersStruct::Invoke()
+{
+	glCombinerParameteriNV(GL_NUM_GENERAL_COMBINERS_NV, num);
+	int i;
+	for (i = 0; i < num; i++)
+		general[i].Invoke(i);
+	
+	if (NULL != glCombinerStageParameterfvNV) {
+		if (localConsts > 0)
+			glEnable(GL_PER_STAGE_CONSTANTS_NV);
+		else
+			glDisable(GL_PER_STAGE_CONSTANTS_NV);
+	}
+		
+}
+
+void GeneralCombinerStruct::ZeroOut()
+{
+		numPortions = 2;
+		numConsts = 0;
+
+		portion[0].ZeroOut();
+		portion[0].designator = RCP_RGB;
+		portion[1].ZeroOut();
+		portion[1].designator = RCP_ALPHA;
+}
+
+
+void GeneralCombinerStruct::SetUnusedLocalConsts(int numGlobalConsts, ConstColorStruct *globalCCs)
+{
+        int i;
+	for (i = 0; i < numGlobalConsts; i++) {
+		bool constUsed = false;
+		int j;
+		for (j = 0; j < numConsts; j++)
+			constUsed |= (cc[j].reg.bits.name == globalCCs[i].reg.bits.name);
+		if (!constUsed)
+			cc[numConsts++] = globalCCs[i];
+	}
+}
+
+
+void GeneralCombinerStruct::Validate(int stage)
+{
+	if (2 == numConsts &&
+		cc[0].reg.bits.name == cc[1].reg.bits.name)
+		errors.set("local constant set twice");
+
+	switch (numPortions)
+	{
+	case 0:
+		portion[0].designator = RCP_RGB;
+		// Fallthru
+	case 1:
+		portion[1].designator = ((RCP_RGB == portion[0].designator) ? RCP_ALPHA : RCP_RGB);
+		// Fallthru
+	case 2:
+		if (portion[0].designator == portion[1].designator)
+			errors.set("portion declared twice");
+		break;
+	}
+	int i;
+	for (i = 0; i < numPortions; i++)
+		portion[i].Validate(stage);
+
+	for (; i < 2; i++)
+		portion[i].ZeroOut();
+
+}
+
+void GeneralCombinerStruct::Invoke(int stage)
+{
+	int i;
+
+	if (NULL != glCombinerStageParameterfvNV)
+		for (i = 0; i < numConsts; i++)
+			glCombinerStageParameterfvNV(GL_COMBINER0_NV + stage, cc[i].reg.bits.name, &(cc[i].v[0]));
+
+	for (i = 0; i < 2; i++)
+		portion[i].Invoke(stage);
+}
+
+void GeneralPortionStruct::Validate(int stage)
+{
+	gf.Validate(stage, designator);
+}
+
+void GeneralPortionStruct::Invoke(int stage)
+{
+	gf.Invoke(stage, designator, bs);
+}
+
+void GeneralPortionStruct::ZeroOut()
+{
+	gf.ZeroOut();
+	bs.word = RCP_SCALE_BY_ONE;
+}
+
+void GeneralFunctionStruct::ZeroOut()
+{
+	// Create mapped registers for zero and discard
+	MappedRegisterStruct unsignedZero;
+	RegisterEnum zero;
+	zero.word = RCP_ZERO;
+	unsignedZero.Init(zero);
+
+	MappedRegisterStruct unsignedDiscard;
+	RegisterEnum discard;
+	discard.word = RCP_DISCARD;
+	unsignedDiscard.Init(discard);
+
+	numOps = 3;
+
+	op[0].op = RCP_MUL;
+	op[0].reg[0] = unsignedDiscard;
+	op[0].reg[1] = unsignedZero;
+	op[0].reg[2] = unsignedZero;
+
+	op[1].op = RCP_MUL;
+	op[1].reg[0] = unsignedDiscard;
+	op[1].reg[1] = unsignedZero;
+	op[1].reg[2] = unsignedZero;
+
+	op[2].op = RCP_SUM;
+	op[2].reg[0] = unsignedDiscard;
+
+}
+
+void GeneralFunctionStruct::Validate(int stage, int portion)
+{
+        int i;
+	for (i = 0; i < numOps; i++)
+		op[i].Validate(stage, portion);
+	// Check if multiple ops are writing to same register (and it's not DISCARD)
+	if (numOps > 1 &&
+		op[0].reg[0].reg.bits.name == op[1].reg[0].reg.bits.name &&
+		GL_DISCARD_NV != op[0].reg[0].reg.bits.name)
+		errors.set("writing to same register twice");
+	if (numOps > 2 &&
+		(op[0].reg[0].reg.bits.name == op[2].reg[0].reg.bits.name ||
+		 op[1].reg[0].reg.bits.name == op[2].reg[0].reg.bits.name) &&
+		GL_DISCARD_NV != op[2].reg[0].reg.bits.name)
+		errors.set("writing to same register twice");
+
+	// Set unused outputs to discard, unused inputs to zero/unsigned_identity
+	if (numOps < 2) {
+		// Set C input to zero
+		op[1].reg[1].reg.bits.name = GL_ZERO;
+		op[1].reg[1].map = GL_UNSIGNED_IDENTITY_NV;
+		op[1].reg[1].reg.bits.channel = portion;
+
+		// Set D input to zero
+		op[1].reg[2].reg.bits.name = GL_ZERO;
+		op[1].reg[2].map = GL_UNSIGNED_IDENTITY_NV;
+		op[1].reg[2].reg.bits.channel = portion;
+
+		// Discard CD output
+		op[1].op = false;
+		op[1].reg[0].reg.bits.name = GL_DISCARD_NV;
+	}
+
+	if (numOps < 3) {
+		// Discard muxSum output
+		op[2].reg[0].reg.bits.name = GL_DISCARD_NV;
+		op[2].op = RCP_SUM;
+	}
+}
+
+
+void GeneralFunctionStruct::Invoke(int stage, int portion, BiasScaleEnum bs)
+{
+	GLenum portionEnum = (RCP_RGB == portion) ? GL_RGB : GL_ALPHA;
+
+	glCombinerInputNV(GL_COMBINER0_NV + stage,
+		portionEnum,
+		GL_VARIABLE_A_NV,
+		op[0].reg[1].reg.bits.name,
+		op[0].reg[1].map,
+		MAP_CHANNEL(op[0].reg[1].reg.bits.channel));
+
+	glCombinerInputNV(GL_COMBINER0_NV + stage,
+		portionEnum,
+		GL_VARIABLE_B_NV,
+		op[0].reg[2].reg.bits.name,
+		op[0].reg[2].map,
+		MAP_CHANNEL(op[0].reg[2].reg.bits.channel));
+
+	glCombinerInputNV(GL_COMBINER0_NV + stage,
+		portionEnum,
+		GL_VARIABLE_C_NV,
+		op[1].reg[1].reg.bits.name,
+		op[1].reg[1].map,
+		MAP_CHANNEL(op[1].reg[1].reg.bits.channel));
+
+	glCombinerInputNV(GL_COMBINER0_NV + stage,
+		portionEnum,
+		GL_VARIABLE_D_NV,
+		op[1].reg[2].reg.bits.name,
+		op[1].reg[2].map,
+		MAP_CHANNEL(op[1].reg[2].reg.bits.channel));
+
+	glCombinerOutputNV(GL_COMBINER0_NV + stage,
+		portionEnum,
+		op[0].reg[0].reg.bits.name,
+		op[1].reg[0].reg.bits.name,
+		op[2].reg[0].reg.bits.name,
+		bs.bits.scale,
+		bs.bits.bias,
+		op[0].op,
+		op[1].op,
+		(op[2].op == RCP_MUX) ? true : false);
+}
+
+// This helper function assigns a channel to an undesignated input register
+static void ConvertRegister(RegisterEnum& reg, int portion)
+{
+	if (RCP_NONE == reg.bits.channel) {
+		reg.bits.channel = portion;
+		if (GL_FOG == reg.bits.name && RCP_ALPHA == portion)
+			// Special case where fog alpha is final only, but RGB is not
+			reg.bits.finalOnly = true;
+	}
+}
+
+
+void OpStruct::Validate(int stage, int portion)
+{
+	int args = 1;
+
+	if (RCP_DOT == op || RCP_MUL == op)
+		args = 3;
+	else
+		args = 1;
+
+	if (reg[0].reg.bits.readOnly)
+		errors.set("writing to a read-only register");
+
+	if (RCP_ALPHA == portion &&
+		RCP_DOT == op)
+		errors.set("dot used in alpha portion");
+	int i;
+	for (i = 0; i < args; i++) {
+		ConvertRegister(reg[i].reg, portion);
+		if (reg[i].reg.bits.finalOnly)
+			errors.set("final register used in general combiner");
+		if (RCP_RGB == portion &&
+			RCP_BLUE == reg[i].reg.bits.channel)
+			errors.set("blue register used in rgb portion");
+		if (RCP_ALPHA == portion &&
+			RCP_RGB == reg[i].reg.bits.channel)
+			errors.set("rgb register used in alpha portion");
+		if (i > 0 &&
+			GL_DISCARD_NV == reg[i].reg.bits.name)
+			errors.set("reading from discard");
+	}
+}
Index: /RenderSystems/GL/src/nvparse/rc1.0_general.h
===================================================================
--- /RenderSystems/GL/src/nvparse/rc1.0_general.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/rc1.0_general.h	(revision 5)
@@ -0,0 +1,107 @@
+#ifndef _RC10_GENERAL_H
+#define _RC10_GENERAL_H
+
+#include "rc1.0_register.h"
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+enum {
+	RCP_MUL = 0,
+	RCP_DOT,
+	RCP_MUX,
+	RCP_SUM
+};
+
+class ConstColorStruct {
+public:
+	void Init(RegisterEnum _reg, float _v0, float _v1, float _v2, float _v3)
+	{ reg = _reg; v[0] = _v0; v[1] = _v1; v[2] = _v2; v[3] = _v3; }
+	RegisterEnum reg;
+	float v[4];
+};
+
+class OpStruct {
+public:
+	void Init(int _op, RegisterEnum _reg0, MappedRegisterStruct _reg1, MappedRegisterStruct _reg2)
+	{ op = _op; reg[0].reg = _reg0; reg[1] = _reg1; reg[2] = _reg2; }
+	void Init(int _op, RegisterEnum _reg0)
+	{ op = _op; reg[0].reg = _reg0; }
+	int op;
+	MappedRegisterStruct reg[3];
+	void Validate(int stage, int portion);
+};
+
+class GeneralFunctionStruct {
+public:
+	void Init(OpStruct _op0, OpStruct _op1, OpStruct _op2) { op[0] = _op0; op[1] = _op1; op[2] = _op2; numOps = 3; }
+	void Init(OpStruct _op0, OpStruct _op1) { op[0] = _op0; op[1] = _op1; numOps = 2; }
+	void Init(OpStruct _op0) { op[0] = _op0; numOps = 1; }
+	void Validate(int stage, int portion);
+	void Invoke(int stage, int portion, BiasScaleEnum bs);
+	void ZeroOut();
+	int numOps;
+	OpStruct op[3];
+};
+
+
+class GeneralPortionStruct {
+public:
+	void Init(int _designator, GeneralFunctionStruct _gf, BiasScaleEnum _bs)
+	{ designator = _designator; gf = _gf; bs = _bs; }
+
+	void Validate(int stage);
+	void Invoke(int stage);
+	void ZeroOut();
+	int designator;
+	GeneralFunctionStruct gf;
+	BiasScaleEnum bs;
+};
+
+class GeneralCombinerStruct {
+public:
+	void Init(GeneralPortionStruct _portion0, GeneralPortionStruct _portion1, ConstColorStruct _cc0, ConstColorStruct _cc1)
+	{ portion[0] = _portion0; portion[1] = _portion1; numPortions = 2; cc[0] = _cc0; cc[1] = _cc1; numConsts = 2; }
+	void Init(GeneralPortionStruct _portion0, GeneralPortionStruct _portion1, ConstColorStruct _cc0)
+	{ portion[0] = _portion0; portion[1] = _portion1; numPortions = 2; cc[0] = _cc0; numConsts = 1; }
+	void Init(GeneralPortionStruct _portion0, GeneralPortionStruct _portion1)
+	{ portion[0] = _portion0; portion[1] = _portion1; numPortions = 2; numConsts = 0; }
+
+	void Init(GeneralPortionStruct _portion0, ConstColorStruct _cc0, ConstColorStruct _cc1)
+	{ portion[0] = _portion0; numPortions = 1; cc[0] = _cc0; cc[1] = _cc1; numConsts = 2; }
+	void Init(GeneralPortionStruct _portion0, ConstColorStruct _cc0)
+	{ portion[0] = _portion0; numPortions = 1; cc[0] = _cc0; numConsts = 1; }
+	void Init(GeneralPortionStruct _portion0)
+	{ portion[0] = _portion0; numPortions = 1; numConsts = 0; }
+
+	void Validate(int stage);
+	void SetUnusedLocalConsts(int numGlobalConsts, ConstColorStruct *globalCCs);
+	void Invoke(int stage);
+	void ZeroOut();
+	GeneralPortionStruct portion[2];
+	int numPortions;
+	ConstColorStruct cc[2];
+	int numConsts;
+};
+
+class GeneralCombinersStruct {
+public:
+	void Init() {num = 0;}
+	void Init(GeneralCombinerStruct _gc) { num = 1; general[0] = _gc; }
+	GeneralCombinersStruct& operator+=(GeneralCombinerStruct& _gc)
+	{
+		if (num < RCP_NUM_GENERAL_COMBINERS)
+			general[num++] = _gc;
+		else
+			errors.set("Too many general combiners.");
+		return *this;
+	}
+	void Validate(int numConsts, ConstColorStruct *cc);
+	void Invoke();
+	GeneralCombinerStruct general[RCP_NUM_GENERAL_COMBINERS];
+	int num;
+private:
+	int localConsts;
+};
+
+
+#endif
Index: /RenderSystems/GL/src/nvparse/rc1.0_grammar.y
===================================================================
--- /RenderSystems/GL/src/nvparse/rc1.0_grammar.y	(revision 5)
+++ /RenderSystems/GL/src/nvparse/rc1.0_grammar.y	(revision 5)
@@ -0,0 +1,683 @@
+%start WholeEnchilada
+%name-prefix="rc10_"
+%{
+void yyerror(char* s);
+int yylex ( void );
+
+#ifdef _WIN32
+# include <windows.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "rc1.0_combiners.h"
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+
+%}
+%union {
+  int ival;
+  float fval;
+  RegisterEnum registerEnum;
+  BiasScaleEnum biasScaleEnum;
+  MappedRegisterStruct mappedRegisterStruct;
+  ConstColorStruct constColorStruct;
+  GeneralPortionStruct generalPortionStruct;
+  GeneralFunctionStruct generalFunctionStruct;
+  OpStruct opStruct;
+  GeneralCombinerStruct generalCombinerStruct;
+  GeneralCombinersStruct generalCombinersStruct;
+  FinalProductStruct finalProductStruct;
+  FinalRgbFunctionStruct finalRgbFunctionStruct;
+  FinalAlphaFunctionStruct finalAlphaFunctionStruct;
+  FinalCombinerStruct finalCombinerStruct;
+  CombinersStruct combinersStruct;
+}
+
+%token <registerEnum> regVariable constVariable color_sum final_product
+%token <ival> expandString halfBiasString unsignedString unsignedInvertString muxString sumString
+%token <ival> rgb_portion alpha_portion
+%token <ival> openParen closeParen openBracket closeBracket semicolon comma
+%token <ival> dot times minus equals plus
+%token <biasScaleEnum> bias_by_negative_one_half_scale_by_two bias_by_negative_one_half
+%token <biasScaleEnum> scale_by_one_half scale_by_two scale_by_four
+
+%token <ival> clamp_color_sum lerp
+%token <ival> fragment_rgb fragment_alpha
+
+%token <fval> floatValue
+
+%type <combinersStruct> WholeEnchilada Combiners
+
+%type <constColorStruct> ConstColor
+%type <generalCombinerStruct> GeneralCombiner
+%type <generalCombinersStruct> GeneralCombiners
+%type <ival> PortionDesignator
+%type <opStruct> Mux Sum Dot Mul
+%type <generalPortionStruct> GeneralPortion
+%type <generalFunctionStruct> GeneralFunction
+%type <biasScaleEnum> BiasScale
+
+%type <registerEnum> Register
+%type <mappedRegisterStruct> GeneralMappedRegister FinalMappedRegister
+%type <finalProductStruct> FinalProduct
+%type <ival> ClampColorSum
+%type <finalRgbFunctionStruct> FinalRgbFunction
+%type <finalAlphaFunctionStruct> FinalAlphaFunction
+%type <finalCombinerStruct> FinalCombiner
+
+%%
+
+WholeEnchilada	: Combiners
+		{
+			$1.Validate();
+			$1.Invoke();
+		}
+		;
+
+Combiners : ConstColor GeneralCombiners FinalCombiner
+		{
+			CombinersStruct combinersStruct;
+			combinersStruct.Init($2, $3, $1);
+			$$ = combinersStruct;
+		}
+		| ConstColor ConstColor GeneralCombiners FinalCombiner
+		{
+			CombinersStruct combinersStruct;
+			combinersStruct.Init($3, $4, $1, $2);
+			$$ = combinersStruct;
+		}
+		| GeneralCombiners FinalCombiner
+		{
+			CombinersStruct combinersStruct;
+			combinersStruct.Init($1, $2);
+			$$ = combinersStruct;
+		}
+		| ConstColor FinalCombiner
+		{
+			GeneralCombinersStruct generalCombinersStruct;
+			generalCombinersStruct.Init();
+			CombinersStruct combinersStruct;
+			combinersStruct.Init(generalCombinersStruct, $2, $1);
+			$$ = combinersStruct;
+		}
+		| ConstColor ConstColor FinalCombiner
+		{
+			GeneralCombinersStruct generalCombinersStruct;
+			generalCombinersStruct.Init();
+			CombinersStruct combinersStruct;
+			combinersStruct.Init(generalCombinersStruct, $3, $1, $2);
+			$$ = combinersStruct;
+		}
+		| FinalCombiner
+		{
+			GeneralCombinersStruct generalCombinersStruct;
+			generalCombinersStruct.Init();
+			CombinersStruct combinersStruct;
+			combinersStruct.Init(generalCombinersStruct, $1);
+			$$ = combinersStruct;
+		}
+		;
+ 
+ConstColor : constVariable equals openParen floatValue comma floatValue comma floatValue comma floatValue closeParen semicolon
+		{
+			ConstColorStruct constColorStruct;
+			constColorStruct.Init($1, $4, $6, $8, $10);
+			$$ = constColorStruct;
+		}
+		;
+ 
+ 
+GeneralCombiners	 : GeneralCombiners GeneralCombiner
+		{
+			$1 += $2;
+			$$ = $1;
+		}
+		| GeneralCombiner
+		{
+			GeneralCombinersStruct generalCombinersStruct;
+			generalCombinersStruct.Init($1);
+			$$ = generalCombinersStruct;
+		}
+		;
+ 
+GeneralCombiner : openBracket GeneralPortion GeneralPortion closeBracket
+		{
+			GeneralCombinerStruct generalCombinerStruct;
+			generalCombinerStruct.Init($2, $3);
+			$$ = generalCombinerStruct;
+		}
+		| openBracket ConstColor GeneralPortion GeneralPortion closeBracket
+		{
+			GeneralCombinerStruct generalCombinerStruct;
+			generalCombinerStruct.Init($3, $4, $2);
+			$$ = generalCombinerStruct;
+		}
+		| openBracket ConstColor ConstColor GeneralPortion GeneralPortion closeBracket
+		{
+			GeneralCombinerStruct generalCombinerStruct;
+			generalCombinerStruct.Init($4, $5, $2, $3);
+			$$ = generalCombinerStruct;
+		}
+		| openBracket GeneralPortion closeBracket
+		{
+			GeneralCombinerStruct generalCombinerStruct;
+			generalCombinerStruct.Init($2);
+			$$ = generalCombinerStruct;
+		}
+		| openBracket ConstColor GeneralPortion closeBracket
+		{
+			GeneralCombinerStruct generalCombinerStruct;
+			generalCombinerStruct.Init($3, $2);
+			$$ = generalCombinerStruct;
+		}
+		| openBracket ConstColor ConstColor GeneralPortion closeBracket
+		{
+			GeneralCombinerStruct generalCombinerStruct;
+			generalCombinerStruct.Init($4, $2, $3);
+			$$ = generalCombinerStruct;
+		}
+		;
+ 
+GeneralPortion	: PortionDesignator openBracket GeneralFunction BiasScale closeBracket
+		{
+			GeneralPortionStruct generalPortionStruct;
+			generalPortionStruct.Init($1, $3, $4);
+			$$ = generalPortionStruct;
+		}
+		| PortionDesignator openBracket GeneralFunction closeBracket
+		{
+			BiasScaleEnum noScale;
+			noScale.word = RCP_SCALE_BY_ONE;
+			GeneralPortionStruct generalPortionStruct;
+			generalPortionStruct.Init($1, $3, noScale);
+			$$ = generalPortionStruct;
+		}
+		;
+ 
+PortionDesignator	: rgb_portion
+		{
+			$$ = $1;
+		}
+		| alpha_portion
+		{
+			$$ = $1;
+		}
+		;
+
+GeneralMappedRegister :     Register
+		{
+			MappedRegisterStruct reg;
+			reg.Init($1, GL_SIGNED_IDENTITY_NV);
+			$$ = reg;
+		}
+		| minus Register
+		{
+			MappedRegisterStruct reg;
+			reg.Init($2, GL_SIGNED_NEGATE_NV);
+			$$ = reg;
+		}
+		| expandString openParen Register closeParen
+		{
+			MappedRegisterStruct reg;
+			reg.Init($3, GL_EXPAND_NORMAL_NV);
+			$$ = reg;
+		}
+		| minus expandString openParen Register closeParen
+		{
+			MappedRegisterStruct reg;
+			reg.Init($4, GL_EXPAND_NEGATE_NV);
+			$$ = reg;
+		}
+		| halfBiasString openParen Register closeParen
+		{
+			MappedRegisterStruct reg;
+			reg.Init($3, GL_HALF_BIAS_NORMAL_NV);
+			$$ = reg;
+		}
+		| minus halfBiasString openParen Register closeParen
+		{
+			MappedRegisterStruct reg;
+			reg.Init($4, GL_HALF_BIAS_NEGATE_NV);
+			$$ = reg;
+		}
+		| unsignedString openParen Register closeParen
+		{
+			MappedRegisterStruct reg;
+			reg.Init($3, GL_UNSIGNED_IDENTITY_NV);
+			$$ = reg;
+		}
+		| unsignedInvertString openParen Register closeParen
+		{
+			MappedRegisterStruct reg;
+			reg.Init($3, GL_UNSIGNED_INVERT_NV);
+			$$ = reg;
+		}
+		;
+  
+GeneralFunction	: Dot Dot
+		{
+			GeneralFunctionStruct generalFunction;
+			generalFunction.Init($1, $2);
+			$$ = generalFunction;
+		}
+		| Dot Mul
+		{
+			GeneralFunctionStruct generalFunction;
+			generalFunction.Init($1, $2);
+			$$ = generalFunction;
+		}
+		| Mul Dot
+		{
+			GeneralFunctionStruct generalFunction;
+			generalFunction.Init($1, $2);
+			$$ = generalFunction;
+		}
+		| Dot
+		{
+			GeneralFunctionStruct generalFunction;
+			generalFunction.Init($1);
+			$$ = generalFunction;
+		}
+		| Mul Mul
+		{
+			GeneralFunctionStruct generalFunction;
+			generalFunction.Init($1, $2);
+			$$ = generalFunction;
+		}
+		| Mul Mul Mux
+		{
+			GeneralFunctionStruct generalFunction;
+			generalFunction.Init($1, $2, $3);
+			$$ = generalFunction;
+		}
+		| Mul Mul Sum
+		{
+			GeneralFunctionStruct generalFunction;
+			generalFunction.Init($1, $2, $3);
+			$$ = generalFunction;
+		}
+		| Mul
+		{
+			GeneralFunctionStruct generalFunction;
+			generalFunction.Init($1);
+			$$ = generalFunction;
+		}
+		;
+ 
+Dot : Register equals GeneralMappedRegister dot GeneralMappedRegister semicolon
+		{
+			OpStruct dotFunction;
+			dotFunction.Init(RCP_DOT, $1, $3, $5);
+			$$ = dotFunction;
+		}
+		;
+ 
+Mul : Register equals GeneralMappedRegister times GeneralMappedRegister semicolon
+		{
+			OpStruct mulFunction;
+			mulFunction.Init(RCP_MUL, $1, $3, $5);
+			$$ = mulFunction;
+		}
+		| Register equals GeneralMappedRegister semicolon
+		{
+			RegisterEnum zero;
+			zero.word = RCP_ZERO;
+			MappedRegisterStruct one;
+			one.Init(zero, GL_UNSIGNED_INVERT_NV);
+			OpStruct mulFunction;
+			mulFunction.Init(RCP_MUL, $1, $3, one);
+			$$ = mulFunction;
+		}
+		;
+
+Mux : Register equals muxString openParen closeParen semicolon
+		{
+			OpStruct muxFunction;
+			muxFunction.Init(RCP_MUX, $1);
+			$$ = muxFunction;
+		}
+		;
+
+Sum : Register equals sumString openParen closeParen semicolon
+		{
+			OpStruct sumFunction;
+			sumFunction.Init(RCP_SUM, $1);
+			$$ = sumFunction;
+		}
+		;
+ 
+BiasScale	: bias_by_negative_one_half_scale_by_two openParen closeParen semicolon
+		{
+			$$ = $1;
+		}
+		| bias_by_negative_one_half openParen closeParen semicolon
+		{
+			$$ = $1;
+		}
+		| scale_by_one_half openParen closeParen semicolon
+		{
+			$$ = $1;
+		}
+		| scale_by_two openParen closeParen semicolon
+		{
+			$$ = $1;
+		}
+		| scale_by_four openParen closeParen semicolon
+		{
+			$$ = $1;
+		}
+		;
+
+FinalMappedRegister : Register
+		{
+			MappedRegisterStruct reg;
+			reg.Init($1, GL_UNSIGNED_IDENTITY_NV);
+			$$ = reg;
+		}
+		| unsignedString openParen Register closeParen
+		{
+			MappedRegisterStruct reg;
+			reg.Init($3, GL_UNSIGNED_IDENTITY_NV);
+			$$ = reg;
+		}
+		| unsignedInvertString openParen Register closeParen
+		{
+			MappedRegisterStruct reg;
+			reg.Init($3, GL_UNSIGNED_INVERT_NV);
+			$$ = reg;
+		}
+		| color_sum
+		{
+			MappedRegisterStruct reg;
+			reg.Init($1);
+			$$ = reg;
+		}
+		| unsignedString openParen color_sum closeParen
+		{
+			MappedRegisterStruct reg;
+			reg.Init($3, GL_UNSIGNED_IDENTITY_NV);
+			$$ = reg;
+		}
+		| unsignedInvertString openParen color_sum closeParen
+		{
+			MappedRegisterStruct reg;
+			reg.Init($3, GL_UNSIGNED_INVERT_NV);
+			$$ = reg;
+		}
+		| final_product
+		{
+			MappedRegisterStruct reg;
+			reg.Init($1);
+			$$ = reg;
+		}
+		| unsignedString openParen final_product closeParen
+		{
+			MappedRegisterStruct reg;
+			reg.Init($3, GL_UNSIGNED_IDENTITY_NV);
+			$$ = reg;
+		}
+		| unsignedInvertString openParen final_product closeParen
+		{
+			MappedRegisterStruct reg;
+			reg.Init($3, GL_UNSIGNED_INVERT_NV);
+			$$ = reg;
+		}
+		;
+
+FinalCombiner : FinalAlphaFunction FinalRgbFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init($2, $1, false);
+			$$ = finalCombinerStruct;
+		}
+		| ClampColorSum FinalAlphaFunction FinalRgbFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init($3, $2, true);
+			$$ = finalCombinerStruct;
+		}
+		| FinalProduct FinalAlphaFunction FinalRgbFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init($3, $2, false, $1);
+			$$ = finalCombinerStruct;
+		}
+		| ClampColorSum FinalProduct FinalAlphaFunction FinalRgbFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init($4, $3, true, $2);
+			$$ = finalCombinerStruct;
+		}
+		| FinalProduct ClampColorSum FinalAlphaFunction FinalRgbFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init($4, $3, true, $1);
+			$$ = finalCombinerStruct;
+		}
+
+		| FinalRgbFunction FinalAlphaFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init($1, $2, false);
+			$$ = finalCombinerStruct;
+		}
+		| ClampColorSum FinalRgbFunction FinalAlphaFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init($2, $3, true);
+			$$ = finalCombinerStruct;
+		}
+		| FinalProduct FinalRgbFunction FinalAlphaFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init($2, $3, false, $1);
+			$$ = finalCombinerStruct;
+		}
+		| ClampColorSum FinalProduct FinalRgbFunction FinalAlphaFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init($3, $4, true, $2);
+			$$ = finalCombinerStruct;
+		}
+		| FinalProduct ClampColorSum FinalRgbFunction FinalAlphaFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			finalCombinerStruct.Init($3, $4, true, $1);
+			$$ = finalCombinerStruct;
+		}
+
+		| FinalRgbFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			FinalAlphaFunctionStruct finalAlphaFunctionStruct;
+			finalAlphaFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init($1, finalAlphaFunctionStruct, false);
+			$$ = finalCombinerStruct;
+		}
+		| ClampColorSum FinalRgbFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			FinalAlphaFunctionStruct finalAlphaFunctionStruct;
+			finalAlphaFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init($2, finalAlphaFunctionStruct, true);
+			$$ = finalCombinerStruct;
+		}
+		| FinalProduct FinalRgbFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			FinalAlphaFunctionStruct finalAlphaFunctionStruct;
+			finalAlphaFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init($2, finalAlphaFunctionStruct, false, $1);
+			$$ = finalCombinerStruct;
+		}
+		| ClampColorSum FinalProduct FinalRgbFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			FinalAlphaFunctionStruct finalAlphaFunctionStruct;
+			finalAlphaFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init($3, finalAlphaFunctionStruct, true, $2);
+			$$ = finalCombinerStruct;
+		}
+		| FinalProduct ClampColorSum FinalRgbFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			FinalAlphaFunctionStruct finalAlphaFunctionStruct;
+			finalAlphaFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init($3, finalAlphaFunctionStruct, true, $1);
+			$$ = finalCombinerStruct;
+		}
+
+		| FinalAlphaFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init(finalRgbFunctionStruct, $1, false);
+			$$ = finalCombinerStruct;
+		}
+		| ClampColorSum FinalAlphaFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init(finalRgbFunctionStruct, $2, true);
+			$$ = finalCombinerStruct;
+		}
+		| FinalProduct FinalAlphaFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init(finalRgbFunctionStruct, $2, false, $1);
+			$$ = finalCombinerStruct;
+		}
+		| ClampColorSum FinalProduct FinalAlphaFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init(finalRgbFunctionStruct, $3, true, $2);
+			$$ = finalCombinerStruct;
+		}
+		| FinalProduct ClampColorSum FinalAlphaFunction
+		{
+			FinalCombinerStruct finalCombinerStruct;
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.ZeroOut();
+			finalCombinerStruct.Init(finalRgbFunctionStruct, $3, true, $1);
+			$$ = finalCombinerStruct;
+		}
+		;
+
+ClampColorSum	: clamp_color_sum openParen closeParen semicolon
+		{
+			$$ = $1;
+		}
+		; 
+
+FinalProduct	: final_product equals FinalMappedRegister times FinalMappedRegister semicolon
+		{
+			FinalProductStruct finalProductStruct;
+			finalProductStruct.Init($3, $5);
+			$$ = finalProductStruct;
+		}
+		;
+
+FinalRgbFunction	: fragment_rgb equals lerp openParen FinalMappedRegister comma FinalMappedRegister comma FinalMappedRegister closeParen plus FinalMappedRegister semicolon
+		{
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.Init($5, $7, $9, $12);
+			$$ = finalRgbFunctionStruct;
+		}
+		| fragment_rgb equals FinalMappedRegister plus lerp openParen FinalMappedRegister comma FinalMappedRegister comma FinalMappedRegister closeParen semicolon
+		{
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.Init($7, $9, $11, $3);
+			$$ = finalRgbFunctionStruct;
+		}
+		| fragment_rgb equals lerp openParen FinalMappedRegister comma FinalMappedRegister comma FinalMappedRegister closeParen semicolon
+		{
+			RegisterEnum zero;
+			zero.word = RCP_ZERO;
+			MappedRegisterStruct reg;
+			reg.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.Init($5, $7, $9, reg);
+			$$ = finalRgbFunctionStruct;
+		}
+		| fragment_rgb equals FinalMappedRegister times FinalMappedRegister semicolon
+		{
+			RegisterEnum zero;
+			zero.word = RCP_ZERO;
+			MappedRegisterStruct reg1;
+			reg1.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+			MappedRegisterStruct reg2;
+			reg2.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.Init($3, $5, reg1, reg2);
+			$$ = finalRgbFunctionStruct;
+		}
+		| fragment_rgb equals FinalMappedRegister times FinalMappedRegister plus FinalMappedRegister semicolon
+		{
+			RegisterEnum zero;
+			zero.word = RCP_ZERO;
+			MappedRegisterStruct reg1;
+			reg1.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.Init($3, $5, reg1, $7);
+			$$ = finalRgbFunctionStruct;
+		}
+		| fragment_rgb equals FinalMappedRegister semicolon
+		{
+			RegisterEnum zero;
+			zero.word = RCP_ZERO;
+			MappedRegisterStruct reg1;
+			reg1.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+			MappedRegisterStruct reg2;
+			reg2.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+			MappedRegisterStruct reg3;
+			reg3.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.Init(reg1, reg2, reg3, $3);
+			$$ = finalRgbFunctionStruct;
+		}
+		| fragment_rgb equals FinalMappedRegister plus FinalMappedRegister semicolon
+		{
+			RegisterEnum zero;
+			zero.word = RCP_ZERO;
+			MappedRegisterStruct reg2;
+			reg2.Init(zero, GL_UNSIGNED_INVERT_NV);
+			MappedRegisterStruct reg3;
+			reg3.Init(zero, GL_UNSIGNED_IDENTITY_NV);
+			FinalRgbFunctionStruct finalRgbFunctionStruct;
+			finalRgbFunctionStruct.Init($3, reg2, reg3, $5);
+			$$ = finalRgbFunctionStruct;
+		}
+		;
+
+FinalAlphaFunction	: fragment_alpha equals FinalMappedRegister semicolon
+		{
+			FinalAlphaFunctionStruct finalAlphaFunctionStruct;
+			finalAlphaFunctionStruct.Init($3);
+			$$ = finalAlphaFunctionStruct;
+		}
+		;
+
+Register : constVariable
+		{
+			$$ = $1;
+		}
+		| regVariable
+		{
+			$$ = $1;
+		}
+		;
+
+%%
+void yyerror(char* s)
+{
+     errors.set("unrecognized token");
+}
Index: /RenderSystems/GL/src/nvparse/rc1.0_register.h
===================================================================
--- /RenderSystems/GL/src/nvparse/rc1.0_register.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/rc1.0_register.h	(revision 5)
@@ -0,0 +1,201 @@
+#ifndef _RC10_REGISTER_H
+#define _RC10_REGISTER_H
+
+#include <stdlib.h>
+#include <GL/glew.h>
+
+#define RCP_NUM_GENERAL_COMBINERS 8
+
+#define RCP_RGB		0
+#define RCP_ALPHA	1
+#define RCP_BLUE	2
+#define RCP_NONE	3
+
+typedef union _RegisterEnum {
+  struct {
+#if BYTE_ORDER != BIG_ENDIAN
+    unsigned int name          :16; // OpenGL enum for register
+    unsigned int channel       : 2; // RCP_RGB, RCP_ALPHA, etc
+    unsigned int readOnly      : 1; // true or false
+    unsigned int finalOnly     : 1; // true or false
+    unsigned int unused        :12;
+#else
+    unsigned int unused        :12;
+    unsigned int finalOnly     : 1; // true or false
+    unsigned int readOnly      : 1; // true or false
+    unsigned int channel       : 2; // RCP_RGB, RCP_ALPHA, RCP_BLUE, RCP_NONE
+    unsigned int name          :16; // OpenGL enum for register
+#endif
+  } bits;
+  unsigned int word;
+} RegisterEnum;
+// No need for writeOnly flag, since DISCARD is the only register in that category
+
+// WARNING:  Don't monkey with the above structure or this macro
+// unless you're absolutely sure of what you're doing!
+// This constant allocation makes validation *much* cleaner.
+#define RCP_SET_REGISTER_ENUM(name, channel, readonly, finalonly) \
+	 ((finalonly << 19) | (readonly << 18) | (channel << 16) | name)
+
+#define RCP_FOG_RGB					RCP_SET_REGISTER_ENUM(GL_FOG, RCP_RGB,   1, 0)
+#define RCP_FOG_ALPHA				RCP_SET_REGISTER_ENUM(GL_FOG, RCP_ALPHA, 1, 1)
+#define RCP_FOG_BLUE				RCP_SET_REGISTER_ENUM(GL_FOG, RCP_BLUE,  1, 0)
+#define RCP_FOG						RCP_SET_REGISTER_ENUM(GL_FOG, RCP_NONE,  1, 0)
+#define RCP_PRIMARY_COLOR_RGB		RCP_SET_REGISTER_ENUM(GL_PRIMARY_COLOR_NV, RCP_RGB,   0, 0)
+#define RCP_PRIMARY_COLOR_ALPHA		RCP_SET_REGISTER_ENUM(GL_PRIMARY_COLOR_NV, RCP_ALPHA, 0, 0)
+#define RCP_PRIMARY_COLOR_BLUE		RCP_SET_REGISTER_ENUM(GL_PRIMARY_COLOR_NV, RCP_BLUE,  0, 0)
+#define RCP_PRIMARY_COLOR			RCP_SET_REGISTER_ENUM(GL_PRIMARY_COLOR_NV, RCP_NONE,  0, 0)
+#define RCP_SECONDARY_COLOR_RGB		RCP_SET_REGISTER_ENUM(GL_SECONDARY_COLOR_NV, RCP_RGB,   0, 0)
+#define RCP_SECONDARY_COLOR_ALPHA	RCP_SET_REGISTER_ENUM(GL_SECONDARY_COLOR_NV, RCP_ALPHA, 0, 0)
+#define RCP_SECONDARY_COLOR_BLUE	RCP_SET_REGISTER_ENUM(GL_SECONDARY_COLOR_NV, RCP_BLUE,  0, 0)
+#define RCP_SECONDARY_COLOR			RCP_SET_REGISTER_ENUM(GL_SECONDARY_COLOR_NV, RCP_NONE,  0, 0)
+#define RCP_SPARE0_RGB				RCP_SET_REGISTER_ENUM(GL_SPARE0_NV, RCP_RGB,   0, 0)
+#define RCP_SPARE0_ALPHA			RCP_SET_REGISTER_ENUM(GL_SPARE0_NV, RCP_ALPHA, 0, 0)
+#define RCP_SPARE0_BLUE				RCP_SET_REGISTER_ENUM(GL_SPARE0_NV, RCP_BLUE,  0, 0)
+#define RCP_SPARE0					RCP_SET_REGISTER_ENUM(GL_SPARE0_NV, RCP_NONE,  0, 0)
+#define RCP_SPARE1_RGB				RCP_SET_REGISTER_ENUM(GL_SPARE1_NV, RCP_RGB,   0, 0)
+#define RCP_SPARE1_ALPHA			RCP_SET_REGISTER_ENUM(GL_SPARE1_NV, RCP_ALPHA, 0, 0)
+#define RCP_SPARE1_BLUE				RCP_SET_REGISTER_ENUM(GL_SPARE1_NV, RCP_BLUE,  0, 0)
+#define RCP_SPARE1					RCP_SET_REGISTER_ENUM(GL_SPARE1_NV, RCP_NONE,  0, 0)
+#define RCP_TEXTURE0_RGB			RCP_SET_REGISTER_ENUM(GL_TEXTURE0_ARB, RCP_RGB,   0, 0)
+#define RCP_TEXTURE0_ALPHA			RCP_SET_REGISTER_ENUM(GL_TEXTURE0_ARB, RCP_ALPHA, 0, 0)
+#define RCP_TEXTURE0_BLUE			RCP_SET_REGISTER_ENUM(GL_TEXTURE0_ARB, RCP_BLUE,  0, 0)
+#define RCP_TEXTURE0				RCP_SET_REGISTER_ENUM(GL_TEXTURE0_ARB, RCP_NONE,  0, 0)
+#define RCP_TEXTURE1_RGB			RCP_SET_REGISTER_ENUM(GL_TEXTURE1_ARB, RCP_RGB,   0, 0)
+#define RCP_TEXTURE1_ALPHA			RCP_SET_REGISTER_ENUM(GL_TEXTURE1_ARB, RCP_ALPHA, 0, 0)
+#define RCP_TEXTURE1_BLUE			RCP_SET_REGISTER_ENUM(GL_TEXTURE1_ARB, RCP_BLUE,  0, 0)
+#define RCP_TEXTURE1				RCP_SET_REGISTER_ENUM(GL_TEXTURE1_ARB, RCP_NONE,  0, 0)
+#define RCP_TEXTURE2_RGB			RCP_SET_REGISTER_ENUM(GL_TEXTURE2_ARB, RCP_RGB,   0, 0)
+#define RCP_TEXTURE2_ALPHA			RCP_SET_REGISTER_ENUM(GL_TEXTURE2_ARB, RCP_ALPHA, 0, 0)
+#define RCP_TEXTURE2_BLUE			RCP_SET_REGISTER_ENUM(GL_TEXTURE2_ARB, RCP_BLUE,  0, 0)
+#define RCP_TEXTURE2				RCP_SET_REGISTER_ENUM(GL_TEXTURE2_ARB, RCP_NONE,  0, 0)
+#define RCP_TEXTURE3_RGB			RCP_SET_REGISTER_ENUM(GL_TEXTURE3_ARB, RCP_RGB,   0, 0)
+#define RCP_TEXTURE3_ALPHA			RCP_SET_REGISTER_ENUM(GL_TEXTURE3_ARB, RCP_ALPHA, 0, 0)
+#define RCP_TEXTURE3_BLUE			RCP_SET_REGISTER_ENUM(GL_TEXTURE3_ARB, RCP_BLUE,  0, 0)
+#define RCP_TEXTURE3				RCP_SET_REGISTER_ENUM(GL_TEXTURE3_ARB, RCP_NONE,  0, 0)
+#define RCP_CONST_COLOR0_RGB		RCP_SET_REGISTER_ENUM(GL_CONSTANT_COLOR0_NV, RCP_RGB,   1, 0)
+#define RCP_CONST_COLOR0_ALPHA		RCP_SET_REGISTER_ENUM(GL_CONSTANT_COLOR0_NV, RCP_ALPHA, 1, 0)
+#define RCP_CONST_COLOR0_BLUE		RCP_SET_REGISTER_ENUM(GL_CONSTANT_COLOR0_NV, RCP_BLUE,  1, 0)
+#define RCP_CONST_COLOR0			RCP_SET_REGISTER_ENUM(GL_CONSTANT_COLOR0_NV, RCP_NONE,  1, 0)
+#define RCP_CONST_COLOR1_RGB		RCP_SET_REGISTER_ENUM(GL_CONSTANT_COLOR1_NV, RCP_RGB,   1, 0)
+#define RCP_CONST_COLOR1_ALPHA		RCP_SET_REGISTER_ENUM(GL_CONSTANT_COLOR1_NV, RCP_ALPHA, 1, 0)
+#define RCP_CONST_COLOR1_BLUE		RCP_SET_REGISTER_ENUM(GL_CONSTANT_COLOR1_NV, RCP_BLUE,  1, 0)
+#define RCP_CONST_COLOR1			RCP_SET_REGISTER_ENUM(GL_CONSTANT_COLOR1_NV, RCP_NONE,  1, 0)
+#define RCP_ZERO_RGB				RCP_SET_REGISTER_ENUM(GL_ZERO, RCP_RGB,   1, 0)
+#define RCP_ZERO_ALPHA				RCP_SET_REGISTER_ENUM(GL_ZERO, RCP_ALPHA, 1, 0)
+#define RCP_ZERO_BLUE				RCP_SET_REGISTER_ENUM(GL_ZERO, RCP_BLUE,  1, 0)
+#define RCP_ZERO					RCP_SET_REGISTER_ENUM(GL_ZERO, RCP_NONE,  1, 0)
+#define RCP_ONE_RGB					RCP_SET_REGISTER_ENUM(GL_ONE, RCP_RGB,   1, 0)
+#define RCP_ONE_ALPHA				RCP_SET_REGISTER_ENUM(GL_ONE, RCP_ALPHA, 1, 0)
+#define RCP_ONE_BLUE				RCP_SET_REGISTER_ENUM(GL_ONE, RCP_BLUE,  1, 0)
+#define RCP_ONE						RCP_SET_REGISTER_ENUM(GL_ONE, RCP_NONE,  1, 0)
+#define RCP_DISCARD					RCP_SET_REGISTER_ENUM(GL_DISCARD_NV, RCP_NONE, 0, 0)
+#define RCP_FINAL_PRODUCT			RCP_SET_REGISTER_ENUM(GL_E_TIMES_F_NV, RCP_NONE, 1, 1)
+#define RCP_COLOR_SUM				RCP_SET_REGISTER_ENUM(GL_SPARE0_PLUS_SECONDARY_COLOR_NV, RCP_NONE, 1, 1)
+
+#define MAP_CHANNEL(channel) ((RCP_RGB == (channel)) ? GL_RGB : (RCP_ALPHA == (channel) ? GL_ALPHA : GL_BLUE))
+
+typedef union _BiasScaleEnum {
+  struct {
+#if BYTE_ORDER != BIG_ENDIAN
+    unsigned int bias          :16; // OpenGL enum for bias
+    unsigned int scale         :16; // OpenGL enum for scale
+#else
+    unsigned int scale         :16; // OpenGL enum for scale
+    unsigned int bias          :16; // OpenGL enum for bias
+#endif
+  } bits;
+  unsigned int word;
+} BiasScaleEnum;
+
+// WARNING:  Don't monkey with the above structure or this macro
+// unless you're absolutely sure of what you're doing!
+// This constant allocation makes validation *much* cleaner.
+#define RCP_SET_BIAS_SCALE_ENUM(bias, scale) ((scale << 16) | bias)
+
+#define RCP_BIAS_BY_NEGATIVE_ONE_HALF_SCALE_BY_TWO	RCP_SET_BIAS_SCALE_ENUM(GL_BIAS_BY_NEGATIVE_ONE_HALF_NV, GL_SCALE_BY_TWO_NV)
+#define RCP_BIAS_BY_NEGATIVE_ONE_HALF				RCP_SET_BIAS_SCALE_ENUM(GL_BIAS_BY_NEGATIVE_ONE_HALF_NV, GL_NONE)
+#define RCP_SCALE_BY_ONE_HALF						RCP_SET_BIAS_SCALE_ENUM(GL_NONE, GL_SCALE_BY_ONE_HALF_NV)
+#define RCP_SCALE_BY_ONE							RCP_SET_BIAS_SCALE_ENUM(GL_NONE, GL_NONE)
+#define RCP_SCALE_BY_TWO							RCP_SET_BIAS_SCALE_ENUM(GL_NONE, GL_SCALE_BY_TWO_NV)
+#define RCP_SCALE_BY_FOUR							RCP_SET_BIAS_SCALE_ENUM(GL_NONE, GL_SCALE_BY_FOUR_NV)
+
+class MappedRegisterStruct {
+public:
+	void Init(RegisterEnum _reg, int _map = GL_UNSIGNED_IDENTITY_NV)
+	{
+		if (RCP_ONE == _reg.bits.name) {
+			_reg.bits.name = RCP_ZERO;
+			switch (_map) {
+			case GL_UNSIGNED_IDENTITY_NV:
+				_map = GL_UNSIGNED_INVERT_NV;
+				break;
+			case GL_UNSIGNED_INVERT_NV:
+				_map = GL_UNSIGNED_IDENTITY_NV;
+				break;
+			case GL_EXPAND_NORMAL_NV:
+				_map = GL_UNSIGNED_INVERT_NV;
+				break;
+			case GL_EXPAND_NEGATE_NV:
+				_map = GL_EXPAND_NORMAL_NV;
+				break;
+			case GL_HALF_BIAS_NORMAL_NV:
+				_map = GL_HALF_BIAS_NEGATE_NV;
+				break;
+			case GL_HALF_BIAS_NEGATE_NV:
+				_map = GL_HALF_BIAS_NORMAL_NV;
+				break;
+			case GL_SIGNED_IDENTITY_NV:
+				_map = GL_UNSIGNED_INVERT_NV;
+				break;
+			case GL_SIGNED_NEGATE_NV:
+				_map = GL_EXPAND_NORMAL_NV;
+				break;
+			}
+		}
+		map = _map;
+		reg = _reg;
+	}
+	int	map;
+	RegisterEnum reg;
+};
+
+#ifdef TEST_BIT_FIELDS
+
+class RegisterEnumTest {
+  public:
+    RegisterEnumTest()
+    {
+      RegisterEnum reg;
+      bool error = false;
+
+      if (sizeof(reg.bits) != sizeof(reg.word))
+        error = true;
+
+      reg.word = 0; reg.bits.name = 0xFFFF;
+      if (RCP_SET_REGISTER_ENUM(0xFFFF, 0, 0, 0) != reg.word)
+        error = true;
+
+      reg.word = 0; reg.bits.channel = 3;
+      if (RCP_SET_REGISTER_ENUM(0, 3, 0, 0) != reg.word) 
+        error = true;
+
+      reg.word = 0; reg.bits.readOnly = true;
+      if (RCP_SET_REGISTER_ENUM(0, 0, 1, 0) != reg.word) 
+        error = true;
+
+      reg.word = 0; reg.bits.finalOnly = true;
+      if (RCP_SET_REGISTER_ENUM(0, 0, 0, 1) != reg.word) 
+        error = true;
+
+      if (error) {
+	fprintf(stderr, "ERROR: Bit Fields were not compiled correctly in " __FILE__ "!\n");
+	exit(1);
+      }
+    }
+};
+
+static RegisterEnumTest registerEnumTest;
+#endif
+
+#endif
Index: /RenderSystems/GL/src/nvparse/rc1.0_tokens.l
===================================================================
--- /RenderSystems/GL/src/nvparse/rc1.0_tokens.l	(revision 5)
+++ /RenderSystems/GL/src/nvparse/rc1.0_tokens.l	(revision 5)
@@ -0,0 +1,404 @@
+/* definitions */
+digit    [0-9]
+char     [a-zA-Z_.]
+alphanum [0-9a-zA-Z_]
+
+%option prefix="rc10_"
+%{  /* code to be included */
+
+#include <stdlib.h>
+#include "rc1.0_combiners.h"
+#include "_rc1.0_parser.h"
+
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+#define YY_INPUT(buf,result,max_size) \
+{ \
+    result = 0;                        \
+    while (*myin && result < max_size) \
+    buf[result++] = *myin++;           \
+}
+
+#define YY_ALWAYS_INTERACTIVE 1
+
+%}
+/* end of definitions */
+%%
+
+\/\*			{
+			    A:
+				switch (yyinput()) {
+				  case '*': goto B;
+				  case 0: errors.set("end-of-file in comment", line_number); break;
+				  case '\n': line_number++;
+				  default:  goto A;
+				}
+			    B:
+				switch (yyinput()) {
+				  case '*': goto B;
+				  case '/': break;
+				  case 0: errors.set("end-of-file in comment", line_number); break;
+				  case '\n': line_number++;
+				  default:  goto A;
+				}
+			}
+
+\/\/		{
+			    char ch;
+			    while ((ch = yyinput()) != '\n');
+			    if (ch == '\n') line_number++;
+			}
+
+\#			{
+			    char ch;
+			    while ((ch = yyinput()) != '\n');
+			    if (ch == '\n') line_number++;
+			}
+
+!!RC1\.0	{ /* eat header */ }
+
+fog\.rgb	{
+			    rc10_lval.registerEnum.word = RCP_FOG_RGB;
+			    return(regVariable);
+			}
+fog\.a		{
+			    rc10_lval.registerEnum.word = RCP_FOG_ALPHA;
+			    return(regVariable);
+			}
+fog\.b		{
+			    rc10_lval.registerEnum.word = RCP_FOG_BLUE;
+			    return(regVariable);
+			}
+fog			{
+			    rc10_lval.registerEnum.word = RCP_FOG;
+			    return(regVariable);
+			}
+
+col0\.rgb	{
+			    rc10_lval.registerEnum.word = RCP_PRIMARY_COLOR_RGB;
+			    return(regVariable);
+			}
+col0\.a		{
+			    rc10_lval.registerEnum.word = RCP_PRIMARY_COLOR_ALPHA;
+			    return(regVariable);
+			}
+col0\.b		{
+			    rc10_lval.registerEnum.word = RCP_PRIMARY_COLOR_BLUE;
+			    return(regVariable);
+			}
+col0		{
+			    rc10_lval.registerEnum.word = RCP_PRIMARY_COLOR;
+			    return(regVariable);
+			}
+
+col1\.rgb	{
+			    rc10_lval.registerEnum.word = RCP_SECONDARY_COLOR_RGB;
+			    return(regVariable);
+			}
+col1\.a		{
+			    rc10_lval.registerEnum.word = RCP_SECONDARY_COLOR_ALPHA;
+			    return(regVariable);
+			}
+col1\.b		{
+			    rc10_lval.registerEnum.word = RCP_SECONDARY_COLOR_BLUE;
+			    return(regVariable);
+			}
+col1		{
+			    rc10_lval.registerEnum.word = RCP_SECONDARY_COLOR;
+			    return(regVariable);
+			}
+
+spare0\.rgb	{
+			    rc10_lval.registerEnum.word = RCP_SPARE0_RGB;
+			    return(regVariable);
+			}
+spare0\.a		{
+			    rc10_lval.registerEnum.word = RCP_SPARE0_ALPHA;
+			    return(regVariable);
+			}
+spare0\.b		{
+			    rc10_lval.registerEnum.word = RCP_SPARE0_BLUE;
+			    return(regVariable);
+			}
+spare0		{
+			    rc10_lval.registerEnum.word = RCP_SPARE0;
+			    return(regVariable);
+			}
+
+spare1\.rgb	{
+			    rc10_lval.registerEnum.word = RCP_SPARE1_RGB;
+			    return(regVariable);
+			}
+spare1\.a		{
+			    rc10_lval.registerEnum.word = RCP_SPARE1_ALPHA;
+			    return(regVariable);
+			}
+spare1\.b		{
+			    rc10_lval.registerEnum.word = RCP_SPARE1_BLUE;
+			    return(regVariable);
+			}
+spare1		{
+			    rc10_lval.registerEnum.word = RCP_SPARE1;
+			    return(regVariable);
+			}
+
+tex0\.rgb	{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE0_RGB;
+			    return(regVariable);
+			}
+tex0\.a		{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE0_ALPHA;
+			    return(regVariable);
+			}
+tex0\.b		{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE0_BLUE;
+			    return(regVariable);
+			}
+tex0		{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE0;
+			    return(regVariable);
+			}
+
+tex1\.rgb	{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE1_RGB;
+			    return(regVariable);
+			}
+tex1\.a		{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE1_ALPHA;
+			    return(regVariable);
+			}
+tex1\.b		{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE1_BLUE;
+			    return(regVariable);
+			}
+tex1		{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE1;
+			    return(regVariable);
+			}
+
+tex2\.rgb	{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE2_RGB;
+			    return(regVariable);
+			}
+tex2\.a		{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE2_ALPHA;
+			    return(regVariable);
+			}
+tex2\.b		{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE2_BLUE;
+			    return(regVariable);
+			}
+tex2		{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE2;
+			    return(regVariable);
+			}
+
+tex3\.rgb	{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE3_RGB;
+			    return(regVariable);
+			}
+tex3\.a		{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE3_ALPHA;
+			    return(regVariable);
+			}
+tex3\.b		{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE3_BLUE;
+			    return(regVariable);
+			}
+tex3		{
+			    rc10_lval.registerEnum.word = RCP_TEXTURE3;
+			    return(regVariable);
+			}
+
+const0\.rgb	{
+			    rc10_lval.registerEnum.word = RCP_CONST_COLOR0_RGB;
+			    return(regVariable);
+			}
+const0\.a		{
+			    rc10_lval.registerEnum.word = RCP_CONST_COLOR0_ALPHA;
+			    return(regVariable);
+			}
+const0\.b		{
+			    rc10_lval.registerEnum.word = RCP_CONST_COLOR0_BLUE;
+			    return(regVariable);
+			}
+const0		{
+			    rc10_lval.registerEnum.word = RCP_CONST_COLOR0;
+			    return(constVariable);
+			}
+
+const1\.rgb	{
+			    rc10_lval.registerEnum.word = RCP_CONST_COLOR1_RGB;
+			    return(regVariable);
+			}
+const1\.a		{
+			    rc10_lval.registerEnum.word = RCP_CONST_COLOR1_ALPHA;
+			    return(regVariable);
+			}
+const1\.b		{
+			    rc10_lval.registerEnum.word = RCP_CONST_COLOR1_BLUE;
+			    return(regVariable);
+			}
+const1		{
+			    rc10_lval.registerEnum.word = RCP_CONST_COLOR1;
+			    return(constVariable);
+			}
+
+zero\.rgb	{
+			    rc10_lval.registerEnum.word = RCP_ZERO_RGB;
+			    return(regVariable);
+			}
+zero\.a		{
+			    rc10_lval.registerEnum.word = RCP_ZERO_ALPHA;
+			    return(regVariable);
+			}
+zero\.b		{
+			    rc10_lval.registerEnum.word = RCP_ZERO_BLUE;
+			    return(regVariable);
+			}
+zero		{
+			    rc10_lval.registerEnum.word = RCP_ZERO;
+			    return(regVariable);
+			}
+
+one\.rgb	{
+			    rc10_lval.registerEnum.word = RCP_ONE_RGB;
+			    return(regVariable);
+			}
+one\.a		{
+			    rc10_lval.registerEnum.word = RCP_ONE_ALPHA;
+			    return(regVariable);
+			}
+one\.b		{
+			    rc10_lval.registerEnum.word = RCP_ONE_BLUE;
+			    return(regVariable);
+			}
+one			{
+			    rc10_lval.registerEnum.word = RCP_ONE;
+			    return(regVariable);
+			}
+
+discard		{
+			    rc10_lval.registerEnum.word = RCP_DISCARD;
+			    return(regVariable);
+			}
+
+out\.rgb		return(fragment_rgb);
+out\.a			return(fragment_alpha);
+
+final_product {
+			    rc10_lval.registerEnum.word = RCP_FINAL_PRODUCT;
+			    return(final_product);
+			}
+
+color_sum {
+			    rc10_lval.registerEnum.word = RCP_COLOR_SUM;
+			    return(color_sum);
+			}
+
+expand			return(expandString);
+half_bias		return(halfBiasString);
+unsigned		return(unsignedString);
+unsigned_invert	return(unsignedInvertString);
+mux				{
+					rc10_lval.ival = GL_TRUE;
+					return(muxString);
+				}
+
+sum				{
+					rc10_lval.ival = GL_FALSE;
+					return(sumString);
+				}
+
+rgb				{
+					rc10_lval.ival = RCP_RGB;
+					return(rgb_portion);
+				}
+alpha			{
+					rc10_lval.ival = RCP_ALPHA;
+					return(alpha_portion);
+				}
+
+clamp_color_sum {
+				rc10_lval.ival = true;
+				return(clamp_color_sum);
+			}
+lerp			return(lerp);
+
+
+bias_by_negative_one_half_scale_by_two {
+				rc10_lval.biasScaleEnum.word = RCP_BIAS_BY_NEGATIVE_ONE_HALF_SCALE_BY_TWO;
+				return(bias_by_negative_one_half_scale_by_two);
+			}
+bias_by_negative_one_half {
+				rc10_lval.biasScaleEnum.word = RCP_BIAS_BY_NEGATIVE_ONE_HALF;
+				return(bias_by_negative_one_half);
+			}
+scale_by_one_half {
+				rc10_lval.biasScaleEnum.word = RCP_SCALE_BY_ONE_HALF;
+				return(scale_by_one_half);
+			}
+scale_by_two {
+				rc10_lval.biasScaleEnum.word = RCP_SCALE_BY_TWO;
+				return(scale_by_two);
+			}
+scale_by_four {
+				rc10_lval.biasScaleEnum.word = RCP_SCALE_BY_FOUR;
+				return(scale_by_four);
+			}
+
+[+-]?[0-9]+\.[0-9]*	{
+				rc10_lval.fval = (float)atof(yytext);
+				return(floatValue);
+			}
+
+[+-]?[0-9]*\.[0-9]+	{
+				rc10_lval.fval = (float)atof(yytext);
+				return(floatValue);
+			}
+
+[+-]?[0-9]+		{
+				rc10_lval.fval = (float)atof(yytext);
+				return(floatValue);
+			}
+
+\{			return(openBracket);
+\}			return(closeBracket);
+\(			return(openParen);
+\)			return(closeParen);
+;			return(semicolon);
+,			return(comma);
+\.			return(dot);
+\*			return(times);
+-			return(minus);
+\+			return(plus);
+=			return(equals);
+
+\r*\n		{
+				line_number++;
+			}
+
+[ \t]+		{}
+
+{alphanum}+ {
+				errors.set("unrecognized token", line_number);
+			}
+				
+
+%%
+
+bool rc10_init_more();
+
+bool rc10_init(char* inputString)
+{
+    myin = inputString;
+	return rc10_init_more();
+}
+
+#ifndef rc10_wrap
+int rc10_wrap(void)
+{
+  return(1);
+}
+#endif
Index: /RenderSystems/GL/src/nvparse/ts1.0_grammar.y
===================================================================
--- /RenderSystems/GL/src/nvparse/ts1.0_grammar.y	(revision 5)
+++ /RenderSystems/GL/src/nvparse/ts1.0_grammar.y	(revision 5)
@@ -0,0 +1,304 @@
+%start WholeEnchilada
+%name-prefix="ts10_"
+%{
+void yyerror(char* s);
+int yylex ( void );
+
+#ifdef _WIN32
+# include <windows.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include "ts1.0_inst.h"
+#include "ts1.0_inst_list.h"
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+%}
+%union {
+  float fval;
+  InstPtr inst;
+  InstListPtr instList;
+  MappedVariablePtr variable;
+}
+
+%token <fval> floatValue gequal less texVariable expandString
+%token <fval> openParen closeParen semicolon comma
+%token <fval> nop
+%token <fval> texture_1d
+%token <fval> texture_2d
+%token <fval> texture_rectangle
+%token <fval> texture_3d
+%token <fval> texture_cube_map 
+%token <fval> cull_fragment
+%token <fval> pass_through
+%token <fval> offset_2d_scale 
+%token <fval> offset_2d
+%token <fval> offset_rectangle_scale 
+%token <fval> offset_rectangle
+%token <fval> dependent_ar
+%token <fval> dependent_gb
+%token <fval> dot_product_2d_1of2
+%token <fval> dot_product_2d_2of2 
+%token <fval> dot_product_rectangle_1of2
+%token <fval> dot_product_rectangle_2of2 
+%token <fval> dot_product_depth_replace_1of2
+%token <fval> dot_product_depth_replace_2of2 
+%token <fval> dot_product_3d_1of3
+%token <fval> dot_product_3d_2of3
+%token <fval> dot_product_3d_3of3
+%token <fval> dot_product_cube_map_1of3
+%token <fval> dot_product_cube_map_2of3
+%token <fval> dot_product_cube_map_3of3
+%token <fval> dot_product_reflect_cube_map_eye_from_qs_1of3
+%token <fval> dot_product_reflect_cube_map_eye_from_qs_2of3
+%token <fval> dot_product_reflect_cube_map_eye_from_qs_3of3
+%token <fval> dot_product_reflect_cube_map_const_eye_1of3
+%token <fval> dot_product_reflect_cube_map_const_eye_2of3
+%token <fval> dot_product_reflect_cube_map_const_eye_3of3
+%token <fval> dot_product_cube_map_and_reflect_cube_map_eye_from_qs_1of3
+%token <fval> dot_product_cube_map_and_reflect_cube_map_eye_from_qs_2of3
+%token <fval> dot_product_cube_map_and_reflect_cube_map_eye_from_qs_3of3
+%token <fval> dot_product_cube_map_and_reflect_cube_map_const_eye_1of3
+%token <fval> dot_product_cube_map_and_reflect_cube_map_const_eye_2of3
+%token <fval> dot_product_cube_map_and_reflect_cube_map_const_eye_3of3
+
+%type <instList> WholeEnchilada InstListDesc
+%type <inst> InstDesc
+%type <variable> MappedVariableDesc
+%type <fval> CondDesc
+
+%%
+
+WholeEnchilada: InstListDesc
+		{
+			$1->Validate();
+			$1->Invoke();
+		    delete $1;
+		}
+		;
+
+InstListDesc: InstListDesc InstDesc semicolon
+		{
+		    *($1) += $2;
+			delete $2;
+		    $$ = $1;
+		}
+		| InstDesc semicolon
+		{
+		    InstListPtr instList = new InstList;
+		    *instList += $1;
+			delete $1;
+		    $$ = instList;
+		}
+		;
+
+
+MappedVariableDesc:	expandString openParen texVariable closeParen
+		{
+			$$ = new MappedVariable;
+			$$->var = $3;
+			$$->expand = true;
+		}
+		| texVariable
+		{
+			$$ = new MappedVariable;
+			$$->var = $1;
+			$$->expand = false;
+		}
+		;
+
+InstDesc	: nop openParen closeParen
+		{
+		    $$ = new Inst(TSP_NOP);
+		}
+		| texture_1d openParen closeParen
+		{
+		    $$ = new Inst(TSP_TEXTURE_1D);
+		}
+		| texture_2d openParen closeParen
+		{
+		    $$ = new Inst(TSP_TEXTURE_2D);
+		}
+		| texture_rectangle openParen closeParen
+		{
+		    $$ = new Inst(TSP_TEXTURE_RECTANGLE);
+		}
+		| texture_3d openParen closeParen
+		{
+		    $$ = new Inst(TSP_TEXTURE_3D);
+		}
+		| texture_cube_map openParen closeParen
+		{
+		    $$ = new Inst(TSP_TEXTURE_CUBE_MAP);
+		}
+		| cull_fragment openParen CondDesc comma CondDesc comma CondDesc comma CondDesc closeParen
+		{
+		    $$ = new Inst(TSP_CULL_FRAGMENT, $3, $5, $7, $9);
+		}
+		| pass_through openParen closeParen
+		{
+		    $$ = new Inst(TSP_PASS_THROUGH);
+		}
+		| offset_2d_scale openParen texVariable comma floatValue comma floatValue comma floatValue comma floatValue comma floatValue comma floatValue closeParen
+		{
+		    $$ = new Inst(TSP_OFFSET_2D_SCALE, $3, $5, $7, $9, $11, $13, $15);
+		}
+		| offset_2d openParen texVariable comma floatValue comma floatValue comma floatValue comma floatValue closeParen
+		{
+		    $$ = new Inst(TSP_OFFSET_2D, $3, $5, $7, $9, $11);
+		}
+		| offset_rectangle_scale openParen texVariable comma floatValue comma floatValue comma floatValue comma floatValue comma floatValue comma floatValue closeParen
+		{
+		    $$ = new Inst(TSP_OFFSET_RECTANGLE_SCALE, $3, $5, $7, $9, $11, $13, $15);
+		}
+		| offset_rectangle openParen texVariable comma floatValue comma floatValue comma floatValue comma floatValue closeParen
+		{
+		    $$ = new Inst(TSP_OFFSET_RECTANGLE, $3, $5, $7, $9, $11);
+		}
+		| dependent_ar openParen texVariable closeParen
+		{
+		    $$ = new Inst(TSP_DEPENDENT_AR, $3);
+		}
+		| dependent_gb openParen texVariable closeParen
+		{
+		    $$ = new Inst(TSP_DEPENDENT_GB, $3);
+		}
+		| dot_product_2d_1of2 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_2D_1_OF_2, $3);
+			delete $3;
+		}
+		| dot_product_2d_2of2 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_2D_2_OF_2, $3);
+			delete $3;
+		}
+		| dot_product_rectangle_1of2 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_RECTANGLE_1_OF_2, $3);
+			delete $3;
+		}
+		| dot_product_rectangle_2of2 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_RECTANGLE_2_OF_2, $3);
+			delete $3;
+		}
+		| dot_product_depth_replace_1of2 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_DEPTH_REPLACE_1_OF_2, $3);
+			delete $3;
+		}
+		| dot_product_depth_replace_2of2 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_DEPTH_REPLACE_2_OF_2, $3);
+			delete $3;
+		}
+		| dot_product_3d_1of3 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_3D_1_OF_3, $3);
+			delete $3;
+		}
+		| dot_product_3d_2of3 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_3D_2_OF_3, $3);
+			delete $3;
+		}
+		| dot_product_3d_3of3 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_3D_3_OF_3, $3);
+			delete $3;
+		}
+		| dot_product_cube_map_1of3 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_1_OF_3, $3);
+			delete $3;
+		}
+		| dot_product_cube_map_2of3 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_2_OF_3, $3);
+			delete $3;
+		}
+		| dot_product_cube_map_3of3 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_3_OF_3, $3);
+			delete $3;
+		}
+		| dot_product_reflect_cube_map_eye_from_qs_1of3 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_EYE_FROM_QS_1_OF_3, $3);
+			delete $3;
+		}
+		| dot_product_reflect_cube_map_eye_from_qs_2of3 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_EYE_FROM_QS_2_OF_3, $3);
+			delete $3;
+		}
+		| dot_product_reflect_cube_map_eye_from_qs_3of3 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_EYE_FROM_QS_3_OF_3, $3);
+			delete $3;
+		}
+		| dot_product_reflect_cube_map_const_eye_1of3 openParen MappedVariableDesc comma floatValue comma floatValue comma floatValue closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_CONST_EYE_1_OF_3, $3, $5, $7, $9);
+			delete $3;
+		}
+		| dot_product_reflect_cube_map_const_eye_2of3 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_CONST_EYE_2_OF_3, $3);
+			delete $3;
+		}
+		| dot_product_reflect_cube_map_const_eye_3of3 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_CONST_EYE_3_OF_3, $3);
+			delete $3;
+		}
+		| dot_product_cube_map_and_reflect_cube_map_eye_from_qs_1of3 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_EYE_FROM_QS_1_OF_3, $3);
+			delete $3;
+		}
+		| dot_product_cube_map_and_reflect_cube_map_eye_from_qs_2of3 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_EYE_FROM_QS_2_OF_3, $3);
+			delete $3;
+		}
+		| dot_product_cube_map_and_reflect_cube_map_eye_from_qs_3of3 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_EYE_FROM_QS_3_OF_3, $3);
+			delete $3;
+		}
+		| dot_product_cube_map_and_reflect_cube_map_const_eye_1of3 openParen MappedVariableDesc comma floatValue comma floatValue comma floatValue closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_CONST_EYE_1_OF_3, $3, $5, $7, $9);
+			delete $3;
+		}
+		| dot_product_cube_map_and_reflect_cube_map_const_eye_2of3 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_CONST_EYE_2_OF_3, $3);
+			delete $3;
+		}
+		| dot_product_cube_map_and_reflect_cube_map_const_eye_3of3 openParen MappedVariableDesc closeParen
+		{
+		    $$ = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_CONST_EYE_3_OF_3, $3);
+			delete $3;
+		}
+		;
+
+CondDesc :	gequal
+		{
+			$$ = $1;
+		}
+		| 	less
+		{
+			$$ = $1;
+		}
+		;
+
+
+%%
+void yyerror(char* s)
+{
+     errors.set("unrecognized token");
+}
Index: /RenderSystems/GL/src/nvparse/ts1.0_inst.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/ts1.0_inst.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/ts1.0_inst.cpp	(revision 5)
@@ -0,0 +1,294 @@
+#include "ts1.0_inst.h"
+#include <OgreGLPrerequisites.h>
+
+Inst::Inst(int inst, float arg0, float arg1, float arg2, float arg3, float arg4, float arg5, float arg6)
+{
+	opcode.word = inst;
+	expand = 0;
+	args[0] = arg0;
+	args[1] = arg1;
+	args[2] = arg2;
+	args[3] = arg3;
+	args[4] = arg4;
+	args[5] = arg5;
+	args[6] = arg6;
+}
+
+Inst::Inst(int inst, MappedVariablePtr arg0, float arg1, float arg2, float arg3, float arg4, float arg5, float arg6)
+{
+	opcode.word = inst;
+	expand = arg0->expand;
+	args[0] = arg0->var;
+	args[1] = arg1;
+	args[2] = arg2;
+	args[3] = arg3;
+	args[4] = arg4;
+	args[5] = arg5;
+	args[6] = arg6;
+}
+
+void Inst::Invoke()
+{
+	switch(opcode.word) {
+	case TSP_NOP:
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_NONE);
+		break;
+	case TSP_TEXTURE_1D:
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_1D);
+		break;
+	case TSP_TEXTURE_2D:
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_2D);
+		break;
+#if defined(GL_EXT_texture_rectangle)
+	case TSP_TEXTURE_RECTANGLE:
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_RECTANGLE_EXT);
+		break;
+#elif defined(GL_NV_texture_rectangle)
+        case TSP_TEXTURE_RECTANGLE:
+                glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_RECTANGLE_NV);
+                break;
+#else
+	case TSP_TEXTURE_RECTANGLE:
+                break;
+#endif
+	case TSP_TEXTURE_3D:
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_3D);
+		break;
+	case TSP_TEXTURE_CUBE_MAP:
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_CUBE_MAP_ARB);
+		break;
+	case TSP_CULL_FRAGMENT:
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_CULL_FRAGMENT_NV);
+		glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_CULL_MODES_NV, &args[0]);
+		break;
+	case TSP_PASS_THROUGH:
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_PASS_THROUGH_NV);
+		break;
+	case TSP_OFFSET_2D_SCALE:
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_OFFSET_TEXTURE_SCALE_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, &args[1]);
+		glTexEnvf(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_SCALE_NV, args[5]);
+		glTexEnvf(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_BIAS_NV, args[6]);
+		break;
+	case TSP_OFFSET_2D:
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_OFFSET_TEXTURE_2D_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, &args[1]);
+		break;
+	case TSP_OFFSET_RECTANGLE_SCALE:
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, &args[1]);
+		glTexEnvf(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_SCALE_NV, args[5]);
+		glTexEnvf(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_BIAS_NV, args[6]);
+		break;
+	case TSP_OFFSET_RECTANGLE:
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_OFFSET_TEXTURE_RECTANGLE_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, &args[1]);
+		break;
+	case TSP_DEPENDENT_AR:
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DEPENDENT_AR_TEXTURE_2D_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DEPENDENT_GB:
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DEPENDENT_GB_TEXTURE_2D_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_2D_1_OF_2:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_2D_2_OF_2:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_TEXTURE_2D_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_RECTANGLE_1_OF_2:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_RECTANGLE_2_OF_2:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_DEPTH_REPLACE_1_OF_2:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_DEPTH_REPLACE_2_OF_2:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_DEPTH_REPLACE_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_3D_1_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_3D_2_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_3D_3_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_TEXTURE_2D_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_CUBE_MAP_1_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_CUBE_MAP_2_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_CUBE_MAP_3_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_EYE_FROM_QS_1_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_EYE_FROM_QS_2_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_EYE_FROM_QS_3_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_CONST_EYE_1_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_CONST_EYE_2_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_CONST_EYE_3_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_CONST_EYE_NV, &args[1]);
+		break;
+	case TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_EYE_FROM_QS_1_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_EYE_FROM_QS_2_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_EYE_FROM_QS_3_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_CONST_EYE_1_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_CONST_EYE_2_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		break;
+	case TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_CONST_EYE_3_OF_3:
+		if (expand)
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_EXPAND_NORMAL_NV);
+		else
+			glTexEnvi(GL_TEXTURE_SHADER_NV, GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV, GL_UNSIGNED_IDENTITY_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV);
+		glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + (int)args[0]);
+		glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_CONST_EYE_NV, &args[1]);
+		break;
+	}
+}
Index: /RenderSystems/GL/src/nvparse/ts1.0_inst.h
===================================================================
--- /RenderSystems/GL/src/nvparse/ts1.0_inst.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/ts1.0_inst.h	(revision 5)
@@ -0,0 +1,140 @@
+#ifndef _INST_H
+#define _INST_H
+
+#define TSP_MAX_ARGS 7
+#define TSP_NUM_TEXTURE_UNITS 4
+
+#ifdef _WIN32
+# define BYTE_ORDER !BIG_ENDIAN
+#endif
+#include <stdlib.h>  
+
+typedef union _InstructionEnum {
+  struct {
+#if BYTE_ORDER != BIG_ENDIAN
+    unsigned int instruction   :10; // instruction id
+    unsigned int stage         : 4; // stage number
+    unsigned int dependent     : 1; // dependent operation
+    unsigned int noOutput      : 1; // no RGBA output
+#else
+    unsigned int noOutput      : 1;
+    unsigned int dependent     : 1;
+    unsigned int stage         : 4;
+    unsigned int instruction   :10;
+#endif
+  } bits;
+  unsigned int word;
+} InstructionEnum;
+
+// WARNING:  Don't monkey with the above structure or this macro
+// unless you're absolutely sure of what you're doing!
+// This constant allocation makes validation *much* cleaner.
+#define TSP_SET_INSTRUCTION_ENUM(inst, st, dep, noout) \
+	 ((noout << 15) | (dep << 14) | (st << 10) | inst)
+
+#define TSP_NOP					TSP_SET_INSTRUCTION_ENUM(0, 0, 0, 1)
+#define TSP_TEXTURE_1D			TSP_SET_INSTRUCTION_ENUM(1, 0, 0, 0)
+#define TSP_TEXTURE_2D			TSP_SET_INSTRUCTION_ENUM(2, 0, 0, 0)
+#define TSP_TEXTURE_RECTANGLE	TSP_SET_INSTRUCTION_ENUM(3, 0, 0, 0)
+#define TSP_TEXTURE_3D			TSP_SET_INSTRUCTION_ENUM(4, 0, 0, 0)
+#define TSP_TEXTURE_CUBE_MAP	TSP_SET_INSTRUCTION_ENUM(5, 0, 0, 0)
+#define TSP_CULL_FRAGMENT		TSP_SET_INSTRUCTION_ENUM(6, 0, 0, 1)
+#define TSP_PASS_THROUGH		TSP_SET_INSTRUCTION_ENUM(7, 0, 0, 0)
+#define TSP_DEPENDENT_AR		TSP_SET_INSTRUCTION_ENUM(8, 0, 1, 0)
+#define TSP_DEPENDENT_GB		TSP_SET_INSTRUCTION_ENUM(9, 0, 1, 0)
+#define TSP_OFFSET_2D			TSP_SET_INSTRUCTION_ENUM(10, 0, 1, 0)
+#define TSP_OFFSET_2D_SCALE		TSP_SET_INSTRUCTION_ENUM(11, 0, 1, 0)
+#define TSP_OFFSET_RECTANGLE			TSP_SET_INSTRUCTION_ENUM(12, 0, 1, 0)
+#define TSP_OFFSET_RECTANGLE_SCALE		TSP_SET_INSTRUCTION_ENUM(13, 0, 1, 0)
+
+#define TSP_DOT_PRODUCT_2D_1_OF_2				TSP_SET_INSTRUCTION_ENUM(14, 0, 1, 1)
+#define TSP_DOT_PRODUCT_2D_2_OF_2				TSP_SET_INSTRUCTION_ENUM(14, 1, 1, 0)
+
+#define TSP_DOT_PRODUCT_RECTANGLE_1_OF_2				TSP_SET_INSTRUCTION_ENUM(15, 0, 1, 1)
+#define TSP_DOT_PRODUCT_RECTANGLE_2_OF_2				TSP_SET_INSTRUCTION_ENUM(15, 1, 1, 0)
+
+#define TSP_DOT_PRODUCT_DEPTH_REPLACE_1_OF_2	TSP_SET_INSTRUCTION_ENUM(16, 0, 1, 1)
+#define TSP_DOT_PRODUCT_DEPTH_REPLACE_2_OF_2	TSP_SET_INSTRUCTION_ENUM(16, 1, 1, 0)
+
+#define TSP_DOT_PRODUCT_3D_1_OF_3		TSP_SET_INSTRUCTION_ENUM(17, 0, 1, 1)
+#define TSP_DOT_PRODUCT_3D_2_OF_3		TSP_SET_INSTRUCTION_ENUM(17, 1, 1, 1)
+#define TSP_DOT_PRODUCT_3D_3_OF_3		TSP_SET_INSTRUCTION_ENUM(17, 2, 1, 0)
+
+#define TSP_DOT_PRODUCT_CUBE_MAP_1_OF_3	TSP_SET_INSTRUCTION_ENUM(18, 0, 1, 1)
+#define TSP_DOT_PRODUCT_CUBE_MAP_2_OF_3	TSP_SET_INSTRUCTION_ENUM(18, 1, 1, 1)
+#define TSP_DOT_PRODUCT_CUBE_MAP_3_OF_3	TSP_SET_INSTRUCTION_ENUM(18, 2, 1, 0)
+
+#define TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_EYE_FROM_QS_1_OF_3	TSP_SET_INSTRUCTION_ENUM(19, 0, 1, 1)
+#define TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_EYE_FROM_QS_2_OF_3	TSP_SET_INSTRUCTION_ENUM(19, 1, 1, 1)
+#define TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_EYE_FROM_QS_3_OF_3	TSP_SET_INSTRUCTION_ENUM(19, 2, 1, 0)
+
+#define TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_CONST_EYE_1_OF_3	TSP_SET_INSTRUCTION_ENUM(20, 0, 1, 1)
+#define TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_CONST_EYE_2_OF_3	TSP_SET_INSTRUCTION_ENUM(20, 1, 1, 1)
+#define TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_CONST_EYE_3_OF_3	TSP_SET_INSTRUCTION_ENUM(20, 2, 1, 0)
+
+#define TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_EYE_FROM_QS_1_OF_3	TSP_SET_INSTRUCTION_ENUM(21, 0, 1, 1)
+#define TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_EYE_FROM_QS_2_OF_3	TSP_SET_INSTRUCTION_ENUM(21, 1, 1, 0)
+#define TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_EYE_FROM_QS_3_OF_3	TSP_SET_INSTRUCTION_ENUM(21, 2, 1, 0)
+
+#define TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_CONST_EYE_1_OF_3		TSP_SET_INSTRUCTION_ENUM(22, 0, 1, 1)
+#define TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_CONST_EYE_2_OF_3		TSP_SET_INSTRUCTION_ENUM(22, 1, 1, 0)
+#define TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_CONST_EYE_3_OF_3		TSP_SET_INSTRUCTION_ENUM(22, 2, 1, 0)
+
+typedef struct _MappedVariable {
+	float var;
+	int expand;
+} MappedVariable, *MappedVariablePtr;
+
+typedef class Inst {
+public:
+	Inst(int inst, float arg0 = 0., float arg1 = 0., float arg2 = 0., float arg3 = 0., float arg4 = 0., float arg5 = 0., float arg6 = 0.);
+	Inst(int inst, MappedVariablePtr arg0, float arg1 = 0., float arg2 = 0., float arg3 = 0., float arg4 = 0., float arg5 = 0., float arg6 = 0.);
+	void Invoke();
+	InstructionEnum opcode;
+	float args[TSP_MAX_ARGS];
+private:
+	int expand;
+} *InstPtr;
+
+#ifdef TEST_BIT_FIELDS
+
+#include <stdio.h>
+
+class InstructionEnumTest {
+  public:
+    InstructionEnumTest()
+    {
+      InstructionEnum inst;
+      bool error = false;
+
+      if (sizeof(inst.bits) != sizeof(inst.word))
+        error = true;
+
+      inst.word = 0; inst.bits.instruction = 0x3FF;
+      if (TSP_SET_INSTRUCTION_ENUM(0x3FF, 0, 0, 0) != inst.word)
+        error = true;
+
+      inst.word = 0; inst.bits.stage = 0x0F;
+      if (TSP_SET_INSTRUCTION_ENUM(0, 0x0F, 0, 0) != inst.word) 
+        error = true;
+
+      inst.word = 0; inst.bits.dependent = true;
+      if (TSP_SET_INSTRUCTION_ENUM(0, 0, 1, 0) != inst.word) 
+        error = true;
+
+      inst.word = 0; inst.bits.noOutput = true;
+      if (TSP_SET_INSTRUCTION_ENUM(0, 0, 0, 1) != inst.word) 
+        error = true;
+
+      if (error) {
+	fprintf(stderr, "ERROR: Bit Fields were not compiled correctly in " __FILE__ "!\n");
+	exit(1);
+      }
+    }
+};
+
+static InstructionEnumTest instructionEnumTest;
+
+#endif /* TEST_BIT_FIELDS */
+
+#endif
Index: /RenderSystems/GL/src/nvparse/ts1.0_inst_list.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/ts1.0_inst_list.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/ts1.0_inst_list.cpp	(revision 5)
@@ -0,0 +1,139 @@
+#include "ts1.0_inst_list.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+#include <OgreGLPrerequisites.h>
+
+using namespace Ogre;
+
+const int instListInc = 4;
+
+InstList::InstList()
+{
+	size = 0;
+	max = instListInc;
+	list = (InstPtr)malloc(sizeof(Inst) * max);
+}
+
+InstList::~InstList()
+{
+	free(list);
+}
+
+int InstList::Size()
+{
+	return size;
+}
+
+InstList& InstList::operator+=(InstPtr t)
+{
+	if (size == max) {
+		/* Extend list size by instListInc amount */
+		max += instListInc;
+		list = (InstPtr)realloc(list, sizeof(Inst) * max);
+	}
+	list[size++] = *t;
+	return *this;
+}
+
+void InstList::Invoke()
+{
+        int i;
+	for (i = 0; i < size; i++) {
+		// set active texture
+		glActiveTextureARB(GL_TEXTURE0_ARB + i);
+		list[i].Invoke();
+	}
+	// Reset active texture to unit 0
+	// Could do a glGet to figure out what the initial active texunit was,
+	// and reset to that, but the glGet would not behave well within
+	// a display list...
+	glActiveTextureARB(GL_TEXTURE0_ARB);
+}
+
+void InstList::Validate()
+{
+	if (size > TSP_NUM_TEXTURE_UNITS)
+		errors.set("too many instructions");
+	int i;
+	for (i = 0; i < size; i++) {
+		int stage = list[i].opcode.bits.stage;
+		if (stage > i)
+			errors.set("prior stage missing");
+		if (list[i].opcode.bits.instruction != list[i - stage].opcode.bits.instruction)
+			errors.set("stage mismatch");
+		if (list[i].opcode.bits.dependent) {
+			int previousTexture = (int)list[i].args[0];
+			if (previousTexture >= i - stage)
+				errors.set("invalid texture reference");
+			if (list[previousTexture].opcode.bits.noOutput)
+				errors.set("no output on referenced texture");
+		}
+	}
+
+	// Assign remaining undesignated texture units to nop
+	for (; i < TSP_NUM_TEXTURE_UNITS; i++) {
+		InstPtr nopInst = new Inst(TSP_NOP);
+		*this += nopInst;
+		delete nopInst;
+	}
+}
+
+bool is_ts10(const char * s)
+{
+	return ! strncmp(s, "!!TS1.0", 7);
+}
+
+bool ts10_init_more()
+{
+	static bool tsinit = false;
+	if (tsinit == false )
+	{
+      /*
+		if(! glh_init_extensions( "GL_NV_texture_shader " "GL_ARB_multitexture " ))
+		{
+			errors.set("unable to initialize GL_NV_texture_shader\n");
+			return false;
+		}
+		else
+		{
+        */
+			tsinit = true;
+            /*
+		}
+        */
+	}
+	errors.reset();
+	line_number = 1;
+	return true;
+}
+
+/*
+
+      else if(!strncmp(instring, "!!TS1.0", 7))
+    {
+        if (tsinit == 0 )
+        {
+            if(! glh_init_extensions( "GL_NV_texture_shader " "GL_ARB_multitexture " ))
+            {
+                errors.set("unable to initialize GL_NV_texture_shader\n");
+                free(instring);
+                return;
+            }
+            else
+            {
+                tsinit = 1;
+            }
+        }
+        errors.reset();
+        line_number = 1;
+        ts10_init(instring+7);
+        ts10_parse();
+    }
+    
+
+  */
Index: /RenderSystems/GL/src/nvparse/ts1.0_inst_list.h
===================================================================
--- /RenderSystems/GL/src/nvparse/ts1.0_inst_list.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/ts1.0_inst_list.h	(revision 5)
@@ -0,0 +1,20 @@
+#ifndef _InstList_h
+#define _InstList_h
+
+#include "ts1.0_inst.h"
+
+typedef class InstList {
+public:
+	InstList();
+	~InstList();
+	int Size();
+	InstList& operator+=(InstPtr t);
+	void Validate();
+	void Invoke();
+private:
+    InstPtr list;
+    int size;
+    int max;
+} *InstListPtr;
+
+#endif
Index: /RenderSystems/GL/src/nvparse/ts1.0_tokens.l
===================================================================
--- /RenderSystems/GL/src/nvparse/ts1.0_tokens.l	(revision 5)
+++ /RenderSystems/GL/src/nvparse/ts1.0_tokens.l	(revision 5)
@@ -0,0 +1,184 @@
+/* definitions */
+digit    [0-9]
+char     [a-zA-Z_.]
+alphanum [0-9a-zA-Z_]
+%option prefix="ts10_"
+%{  /* code to be included */
+#include <stdlib.h>
+#include "ts1.0_inst.h"
+#include "ts1.0_inst_list.h"
+#include "_ts1.0_parser.h"
+#ifdef _WIN32
+# include <windows.h>
+#endif
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+
+#define YY_INPUT(buf,result,max_size) \
+{ \
+	int c = *myin++; \
+	result = (c == 0) ? YY_NULL : (buf[0] = c, 1); \
+}
+
+#define YY_ALWAYS_INTERACTIVE 1
+
+%}
+/* end of definitions */
+%%
+
+\/\*			{
+			    A:
+				switch (yyinput()) {
+				  case '*': goto B;
+				  case 0: errors.set("end-of-file in comment", line_number); break;
+				  case '\n': line_number++;
+				  default:  goto A;
+				}
+			    B:
+				switch (yyinput()) {
+				  case '*': goto B;
+				  case '/': break;
+				  case 0: errors.set("end-of-file in comment", line_number); break;
+				  case '\n': line_number++;
+				  default:  goto A;
+				}
+			}
+
+\/\/		{
+			    char ch;
+			    while ((ch = yyinput()) != '\n');
+			    if (ch == '\n') line_number++;
+			}
+
+\#			{
+			    char ch;
+			    while ((ch = yyinput()) != '\n');
+			    if (ch == '\n') line_number++;
+			}
+
+\(			return(openParen);
+\)			return(closeParen);
+;			return(semicolon);
+,			return(comma);
+
+!!TS1\.0    { /* eat header */ }
+
+tex0		{
+			    ts10_lval.fval = (float)0;
+			    return(texVariable);
+			}
+
+tex1		{
+			    ts10_lval.fval = (float)1;
+			    return(texVariable);
+			}
+
+tex2		{
+			    ts10_lval.fval = (float)2;
+			    return(texVariable);
+			}
+
+expand		return(expandString);
+
+GEQUAL_TO_ZERO	{
+				ts10_lval.fval = (float)GL_GEQUAL;
+				return (gequal);
+			}
+
+LESS_THAN_ZERO	{
+				ts10_lval.fval = (float)GL_LESS;
+				return(less);
+			}
+
+nop			return(nop);
+texture_1d		return(texture_1d);
+texture_2d		return(texture_2d);
+texture_rectangle	return(texture_rectangle);
+texture_3d		return(texture_3d);
+texture_cube_map return(texture_cube_map);
+cull_fragment	return(cull_fragment);
+pass_through	return(pass_through);
+offset_2d_scale return(offset_2d_scale);
+offset_2d	return(offset_2d);
+offset_rectangle_scale return(offset_rectangle_scale);
+offset_rectangle	return(offset_rectangle);
+dependent_ar	return(dependent_ar);
+dependent_gb	return(dependent_gb);
+
+dot_product_2d_1of2	return(dot_product_2d_1of2);
+dot_product_2d_2of2 return(dot_product_2d_2of2);
+
+dot_product_rectangle_1of2	return(dot_product_rectangle_1of2);
+dot_product_rectangle_2of2 return(dot_product_rectangle_2of2);
+
+dot_product_depth_replace_1of2	return(dot_product_depth_replace_1of2);
+dot_product_depth_replace_2of2 return(dot_product_depth_replace_2of2);
+
+dot_product_3d_1of3	return(dot_product_3d_1of3);
+dot_product_3d_2of3	return(dot_product_3d_2of3);
+dot_product_3d_3of3	return(dot_product_3d_3of3);
+
+dot_product_cube_map_1of3	return(dot_product_cube_map_1of3);
+dot_product_cube_map_2of3	return(dot_product_cube_map_2of3);
+dot_product_cube_map_3of3	return(dot_product_cube_map_3of3);
+
+dot_product_reflect_cube_map_eye_from_qs_1of3	return(dot_product_reflect_cube_map_eye_from_qs_1of3);
+dot_product_reflect_cube_map_eye_from_qs_2of3	return(dot_product_reflect_cube_map_eye_from_qs_2of3);
+dot_product_reflect_cube_map_eye_from_qs_3of3	return(dot_product_reflect_cube_map_eye_from_qs_3of3);
+
+dot_product_reflect_cube_map_const_eye_1of3	return(dot_product_reflect_cube_map_const_eye_1of3);
+dot_product_reflect_cube_map_const_eye_2of3	return(dot_product_reflect_cube_map_const_eye_2of3);
+dot_product_reflect_cube_map_const_eye_3of3	return(dot_product_reflect_cube_map_const_eye_3of3);
+
+dot_product_cube_map_and_reflect_cube_map_eye_from_qs_1of3	return(dot_product_cube_map_and_reflect_cube_map_eye_from_qs_1of3);
+dot_product_cube_map_and_reflect_cube_map_eye_from_qs_2of3	return(dot_product_cube_map_and_reflect_cube_map_eye_from_qs_2of3);
+dot_product_cube_map_and_reflect_cube_map_eye_from_qs_3of3	return(dot_product_cube_map_and_reflect_cube_map_eye_from_qs_3of3);
+
+dot_product_cube_map_and_reflect_cube_map_const_eye_1of3	return(dot_product_cube_map_and_reflect_cube_map_const_eye_1of3);
+dot_product_cube_map_and_reflect_cube_map_const_eye_2of3	return(dot_product_cube_map_and_reflect_cube_map_const_eye_2of3);
+dot_product_cube_map_and_reflect_cube_map_const_eye_3of3	return(dot_product_cube_map_and_reflect_cube_map_const_eye_3of3);
+
+[+-]?[0-9]+\.[0-9]*	{
+				ts10_lval.fval = (float)atof(yytext);
+				return(floatValue);
+			}
+
+[+-]?[0-9]*\.[0-9]+	{
+				ts10_lval.fval = (float)atof(yytext);
+				return(floatValue);
+			}
+
+[+-]?[0-9]+		{
+				ts10_lval.fval = (float)atof(yytext);
+				return(floatValue);
+			}
+
+\r*\n		{
+				line_number++;
+			}
+
+[ \t]+		{}
+
+{alphanum}+ {
+				errors.set("unrecognized token", line_number);
+			}
+				
+
+%%
+
+bool ts10_init_more();
+
+bool ts10_init(char* inputString)
+{
+    myin = inputString;
+	return ts10_init_more();
+}
+
+
+#ifndef ts10_wrap
+int ts10_wrap(void)
+{
+  return(1);
+}
+#endif
Index: /RenderSystems/GL/src/nvparse/vcp1.0_impl.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/vcp1.0_impl.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/vcp1.0_impl.cpp	(revision 5)
@@ -0,0 +1,356 @@
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+#include <string.h>
+#include <string>
+#include <ctype.h>
+
+#include <OgreGLPrerequisites.h>
+
+#ifndef _WIN32
+# define strnicmp strncasecmp
+#endif
+
+using namespace std;
+
+namespace
+{
+	void ParseVertexProgramConstants( GLenum target, char *instring);
+	GLuint LookupTrackMatrix(char *matrixName);
+	GLuint LookupTrackMatrixTransform(char *matrixTransformName);
+}
+
+bool is_vcp10(const char * s)
+{
+	return ! strncmp(s, "!!VCP1.0", 8);
+}
+
+bool vcp10_init(char * s)
+{
+	static int vpinit = 0;
+	
+	if (vpinit == 0 )
+	{
+      /*
+		if(! glh_init_extensions("GL_NV_vertex_program"))
+		{
+			errors.set("unable to initialize GL_NV_vertex_program");
+			return false;
+		}
+		else
+		{
+        */
+			vpinit = 1;
+            /*
+		}
+        */
+	}
+	
+	errors.reset();
+	line_number = 1;
+	
+	myin = s;
+	
+	return true;
+}
+
+int vcp10_parse()
+{
+	// parse the constant declarations, setting their values in the GL.
+	ParseVertexProgramConstants( GL_VERTEX_PROGRAM_NV, myin);
+	return 0;
+}
+
+
+namespace
+{
+	
+	//.----------------------------------------------------------------------------.
+	//|   Function   : ParseVertexProgramConstants                                 |
+	//|   Description: Parse and set VP1.0 constant memory based on const          |
+	//|                directives.                                                 |
+	//|                                                                            |
+	//|   Format     : c[XX] = (x, y, z, w);    # where XXX is an integer 0-95.    | 
+	//|              : c[XX] = TRACK(matrix, transform);   # track a matrix        |
+	//.----------------------------------------------------------------------------.
+	void ParseVertexProgramConstants(GLenum target, char *instring)
+	{
+		// don't overwrite the original string.
+		char *tmpstring = new char[strlen(instring)+1];
+		strcpy(tmpstring, instring);
+		
+		char lineSeparator[] = "\n";
+		//char wordSeparator[] = " \t";
+		char error[256];
+		char dummy[256];
+		char *token;
+		
+		//iterate over the lines in the string
+		token = strtok(tmpstring, lineSeparator);
+		
+		// we assume the first line is the "!!VCP1.0 line".
+		if (token != NULL)
+		{
+			token = strtok(NULL, lineSeparator);
+		}
+		
+		int iLineCount = 1; // skip first line
+		
+		while (token != NULL)
+		{
+			iLineCount++;
+			
+			// if the first non-whitespace character is a #, this is a comment.  Skip.
+			if (!sscanf(token, " #%s", dummy))
+			{ // not a comment.  Is it a constant?
+				
+				// strip whitespace from the beginning of the string
+				int i;
+				for (i = 0; i < (int)strlen(token) && isspace(token[i]); i++);
+				token += i;
+				
+				if (strlen(token) > 0 &&                  // this is not a blank line and
+					!strnicmp(token, "c[", 2)) // the first word is of the form "c[xx]", so its a constant.
+				{
+					int iConstID;
+					int iNumValuesAssigned;
+					char c[6];
+					
+					iNumValuesAssigned = sscanf(token, " %c [ %d ] = %s ", &c[0], &iConstID, dummy);
+					
+					if (3 != iNumValuesAssigned || toupper(c[0]) != 'C')
+					{  // error in constant directive.
+						sprintf(error, "error at line %d \n\"%s\"\n", iLineCount, token);
+						errors.set(error);
+					}
+					else if (!strnicmp(dummy, "track", 5))
+					{ // this is a TrackMatrix directive
+						char matrixName[256], matrixTransformName[256];
+						
+						// the series of %c's are to make sure "track(" doesn't get glommed onto the matrixName
+						iNumValuesAssigned = sscanf(token, 
+							" %c [ %d ] = %c%c%c%c%c ( %s %s ) ;",
+							&c[0], &iConstID, &c[1], &c[2], &c[3], &c[4], &c[5],
+							matrixName, matrixTransformName);
+						
+						if (iNumValuesAssigned < 8)
+						{
+							sprintf(error, "error at line %d \n\"%s\"\n", iLineCount, token);
+							errors.set(error);
+						}
+						else
+						{
+							char *buffer;
+							if (9 == iNumValuesAssigned)
+							{
+								// just need to remove any junk from the matrix names and IDs.
+								buffer = strstr(matrixName, ",");
+								if (buffer) 
+									*buffer = 0;
+								
+								buffer = strstr(matrixTransformName, ")");
+								if (buffer)
+									*buffer = 0;
+							}
+							else // 8 == iNumValuesAssigned
+							{
+								// have to split the two names, since they both were put into the matrixName
+								buffer = strstr(matrixName, ",");
+								if (buffer)
+								{
+									strcpy(matrixTransformName, buffer + 1);
+									*buffer = 0;
+									// get rid of paren at end of transform name, if it is there
+									buffer = strstr(matrixTransformName, ")");
+									if (buffer)
+										*buffer = 0;
+									
+								}
+								else
+								{
+									sprintf(error, "error at line %d \n\"%s\"\n", iLineCount, token);
+									errors.set(error);
+								}
+							}
+							
+							// constant ID must be modulo 4.
+							if (0 != (iConstID % 4))
+							{
+								sprintf(error, 
+									"error at line %d \n\"%s\"\n\tglTrackMatrixNV address must be modulo 4\n",
+									iLineCount, token);
+								errors.set(error);
+							}
+							else if (iConstID < 0 || iConstID > 95)
+							{
+								sprintf(error, 
+									"error at line %d \n\"%s\"\n\tConstant address out of range\n",
+									iLineCount, token);
+								errors.set(error);
+							}
+							else
+							{
+								// get the enum values for the specified matrices
+								GLuint iMatrixID     = LookupTrackMatrix(matrixName);
+								GLuint iTransformID  = LookupTrackMatrixTransform(matrixTransformName);
+								
+								if (0 == iMatrixID)
+								{
+									sprintf(error, 
+										"error at line %d \n\"%s\"\n\tInvalid Matrix parameter in glTrackMatrixNV.\n",
+										iLineCount, token);
+									errors.set(error);
+								}
+								else if (0 == iTransformID)
+								{
+									sprintf(error, 
+										"error at line %d \n\"%s\"\n\tInvalid Transform parameter in glTrackMatrixNV\n",
+										iLineCount, token);
+									errors.set(error);
+								}
+								else
+								{
+									// untrack any currently tracked matrix
+									glTrackMatrixNV(target, iConstID, GL_NONE, GL_IDENTITY_NV);
+									
+									// tell GL the matrix to track
+									glTrackMatrixNV(target, iConstID, iMatrixID, iTransformID);         
+								}
+							}
+						}
+					}
+					else                         // this is a constant directive
+					{  
+						float xyzw[4] = {0, 0, 0, 0};
+						iNumValuesAssigned = sscanf(token, 
+							" %c [ %d ] = ( %f , %f , %f , %f ) ; ", 
+							&c[0], &iConstID, xyzw, xyzw + 1, xyzw + 2, xyzw + 3);
+						
+						if (6 != iNumValuesAssigned)
+						{ // error in constant directive.
+							sprintf(error, "error at line %d \n\"%s\"\n", iLineCount, token);
+							errors.set(error);
+						}
+						else if (iConstID < 0 || iConstID > 95)
+						{
+							sprintf(error, 
+								"error at line %d \n\"%s\"\n\tConstant address out of range\n",
+								iLineCount, token);
+							errors.set(error);
+						}
+						else 
+						{
+							// Always set the closest matrix location to tracking NONE to avoid errors!
+							glTrackMatrixNV(target, iConstID - (iConstID % 4), GL_NONE, GL_IDENTITY_NV);
+							
+							// tell GL the constant values
+							glProgramParameter4fvNV(target, iConstID, xyzw);
+						}
+					}
+        }
+      }
+      
+      // get the next line
+      token = strtok(NULL, lineSeparator);
+  }
+}
+
+
+struct MatrixLookupEntry
+{
+    string name;
+    GLuint      ID; 
+};
+
+
+//.----------------------------------------------------------------------------.
+//|   Function   : LookupTrackMatrix                                           |
+//|   Description: Returns the enumerated matrix name given a valid string     |
+//|                or 0 if an unknown matrix is requested.                    |
+//.----------------------------------------------------------------------------.
+GLuint LookupTrackMatrix(char *matrixName)
+{
+    static bool bFirstTime = true;
+    static int iNumEntries = 14;
+    static MatrixLookupEntry* matrixLookupTable = new MatrixLookupEntry[iNumEntries];
+    
+    if (bFirstTime) // build the lookup table
+    {
+        matrixLookupTable[0].name   = "GL_NONE";
+        matrixLookupTable[0].ID     = GL_NONE;
+        matrixLookupTable[1].name   = "GL_MODELVIEW";
+        matrixLookupTable[1].ID     = GL_MODELVIEW;
+        matrixLookupTable[2].name   = "GL_PROJECTION";
+        matrixLookupTable[2].ID     = GL_PROJECTION;
+        matrixLookupTable[3].name   = "GL_TEXTURE";
+        matrixLookupTable[3].ID     = GL_TEXTURE;
+        matrixLookupTable[4].name   = "GL_COLOR";
+        matrixLookupTable[4].ID     = GL_COLOR;
+        matrixLookupTable[5].name   = "GL_MODELVIEW_PROJECTION_NV";
+        matrixLookupTable[5].ID     = GL_MODELVIEW_PROJECTION_NV;
+        matrixLookupTable[6].name   = "GL_MATRIX0_NV";
+        matrixLookupTable[6].ID     = GL_MATRIX0_NV;
+        matrixLookupTable[7].name   = "GL_MATRIX1_NV";
+        matrixLookupTable[7].ID     = GL_MATRIX1_NV;
+        matrixLookupTable[8].name   = "GL_MATRIX2_NV";
+        matrixLookupTable[8].ID     = GL_MATRIX2_NV;
+        matrixLookupTable[9].name   = "GL_MATRIX3_NV";
+        matrixLookupTable[9].ID     = GL_MATRIX3_NV;
+        matrixLookupTable[10].name  = "GL_MATRIX4_NV";
+        matrixLookupTable[10].ID    = GL_MATRIX4_NV;
+        matrixLookupTable[11].name  = "GL_MATRIX5_NV";
+        matrixLookupTable[11].ID    = GL_MATRIX5_NV;
+        matrixLookupTable[12].name  = "GL_MATRIX6_NV";
+        matrixLookupTable[12].ID    = GL_MATRIX6_NV;
+        matrixLookupTable[13].name  = "GL_MATRIX7_NV";
+        matrixLookupTable[13].ID    = GL_MATRIX7_NV;
+        bFirstTime = false;
+    }
+    
+    for (int i = 0; i < iNumEntries; i++)
+    {
+        if (!strcmp(matrixName, matrixLookupTable[i].name.c_str()))
+        {
+            
+            return matrixLookupTable[i].ID;
+        }
+    }
+    
+    return 0;
+}
+
+//.----------------------------------------------------------------------------.
+//|   Function   : LookupTrackMatrixTransform                                  |
+//|   Description: Returns the enumerated matrix transform name given a valid  |
+//|                string name or 0 if an unknown transform is requested.     |
+//.----------------------------------------------------------------------------.
+GLuint LookupTrackMatrixTransform(char *matrixTransformName)
+{
+    static bool bFirstTime = true;
+    static int iNumEntries = 4;
+    static MatrixLookupEntry* transformLookupTable = new MatrixLookupEntry[iNumEntries];
+    
+    if (bFirstTime)
+    {
+        transformLookupTable[0].name  = "GL_IDENTITY_NV";
+        transformLookupTable[0].ID    = GL_IDENTITY_NV;
+        transformLookupTable[1].name  = "GL_INVERSE_NV";
+        transformLookupTable[1].ID    = GL_INVERSE_NV;
+        transformLookupTable[2].name  = "GL_TRANSPOSE_NV";
+        transformLookupTable[2].ID    = GL_TRANSPOSE_NV;
+        transformLookupTable[3].name  = "GL_INVERSE_TRANSPOSE_NV";
+        transformLookupTable[3].ID    = GL_INVERSE_TRANSPOSE_NV;
+        bFirstTime = false;
+    }
+    
+    for (int i = 0; i < iNumEntries; i++)
+    {
+        if (!strcmp( matrixTransformName, transformLookupTable[i].name.c_str()))
+        {
+            return transformLookupTable[i].ID;
+        }
+    }
+    
+    return 0;
+}
+
+}
Index: /RenderSystems/GL/src/nvparse/vp1.0_impl.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/vp1.0_impl.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/vp1.0_impl.cpp	(revision 5)
@@ -0,0 +1,217 @@
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+#include <string.h>
+#include <string>
+#include <ctype.h>
+#include <OgreGLPrerequisites.h>
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#	include <OpenGL/glu.h>
+#else
+#	include <GL/glu.h>
+#endif
+
+using namespace std;
+
+
+namespace
+{
+	void LoadProgram( GLenum target, GLuint id, char *instring );
+	void StrToUpper(char * string);
+	int vpid;
+}
+
+
+bool is_vp10(const char * s)
+{
+	return ! strncmp(s, "!!VP1.0", 7);
+}
+
+bool vp10_init(char * s)
+{
+	static bool vpinit = false;
+	if (vpinit == false )
+	{
+      /*
+		if(! glh_init_extensions("GL_NV_vertex_program"))
+		{
+			errors.set("unable to initialize GL_NV_vertex_program");
+			return false;
+		}
+		else
+		{
+        */
+			vpinit = true;
+            /*
+		}
+        */
+	}
+	
+	errors.reset();
+	line_number = 1;
+	myin = s;
+
+    glGetIntegerv( GL_VERTEX_PROGRAM_BINDING_NV, &vpid );
+        
+    if ( vpid == 0 )
+    {
+        char str[128];
+        sprintf( str, "No vertex program id bound for nvparse() invocation.  Bound id = %d\n", vpid );
+        errors.set( str );
+		return false;
+    }
+	
+	return true;	
+}
+
+int vp10_parse()
+{
+    LoadProgram( GL_VERTEX_PROGRAM_NV, vpid, myin );
+	return 0;
+}
+
+namespace
+{
+	//.----------------------------------------------------------------------------.
+	//|   Function   : LoadProgram                                                 |
+	//|   Description: Load a program into GL, and report any errors encountered.  |
+	//.----------------------------------------------------------------------------.
+	void LoadProgram( GLenum target, GLuint id, char *instring )
+	{
+		GLint  errPos;
+		GLenum errCode;
+		const GLubyte *errString;
+		
+		int len = strlen(instring);
+		glLoadProgramNV( target, id, len, (const GLubyte *) instring );
+		if ( (errCode = glGetError()) != GL_NO_ERROR )
+		{
+			errString = gluErrorString( errCode );
+			
+			glGetIntegerv( GL_PROGRAM_ERROR_POSITION_NV, &errPos );
+            if (errPos == -1)
+                return;
+			
+			int nlines = 1;
+			int nchar  = 1;
+			int i;
+			for ( i = 0; i < errPos; i++ )
+			{
+				if ( instring[i] == '\n' )
+				{
+					nlines++;
+					nchar = 1;
+				}
+				else
+				{
+					nchar++;
+				}
+			}
+			int start;
+			int end;
+			int flag = ((instring[errPos]==';') | (instring[errPos-1]==';')) ? 1 : 0;
+			for ( i = errPos; i >= 0; i-- )
+			{
+				start = i;
+				if ( flag && (start >= errPos-1)  )
+					continue;
+				if ( instring[i] == ';' )
+				{
+					if ( !flag )
+					{
+						start = i+1;
+						if ( instring[start] == '\n' )
+							start++;
+					}
+					break;
+				}
+			}
+			for ( i = errPos; i < len; i++ )
+			{
+				end = i;
+				if ( instring[i] == ';' && end > start)
+				{
+					break;
+				}
+			}
+			if ( errPos - start > 30 )
+			{
+				start = errPos - 30;
+			}
+			if ( end - errPos > 30 )
+			{
+				end = errPos + 30;
+			}
+			
+			char substring[96];
+			memset( substring, 0, 96 );
+			strncpy( substring, &(instring[start]), end-start+1 );
+			char str[256];
+			//sprintf( str, "error at line %d character %d\n    \"%s\"\n", nlines, nchar, substring );
+			sprintf( str, "error at line %d character %d\n\"%s\"\n", nlines, nchar, substring );
+			int width = errPos-start;
+			for ( i = 0; i < width; i++ )
+			{
+				strcat( str, " " );
+			}
+			strcat( str, "|\n" );
+			for ( i = 0; i < width; i++ )
+			{
+				strcat( str, " " );
+			}
+			strcat( str, "^\n" );
+			
+			errors.set( str );
+		}
+	}
+	
+	
+	//.----------------------------------------------------------------------------.
+	//|   Function   : StrToUpper                                                  |
+	//|   Description: Converts all lowercase chars in a string to uppercase.      |
+	//.----------------------------------------------------------------------------.
+	void StrToUpper(char *string)
+	{
+		for (unsigned int i = 0; i < strlen(string); i++)
+			string[i] = toupper(string[i]);
+	}
+	
+}
+/*    else if(!strncmp(instring, "!!VP1.0", 7))
+    {
+        if (vpinit == 0 )
+        {
+            if(! glh_init_extensions("GL_NV_vertex_program"))
+            {
+                errors.set("unable to initialize GL_NV_vertex_program");
+                free(instring);
+                return;
+            }
+            else
+            {
+                vpinit = 1;
+            }
+        }
+        
+        errors.reset();
+        line_number = 1;
+        
+        int vpid;
+        glGetIntegerv( GL_VERTEX_PROGRAM_BINDING_NV, &vpid );
+        
+        if ( glGetError() != GL_NO_ERROR )
+        {
+            errors.set( "Previous GL_ERROR prior to vertex program parsing.\n" );
+        }
+        
+        if ( vpid == 0 )
+        {
+            char str[128];
+            sprintf( str, "No vertex program id bound for nvparse() invocation.  Bound id = %d\n", vpid );
+            errors.set( str );
+        }
+        else
+        {
+            LoadProgram( GL_VERTEX_PROGRAM_NV, vpid, instring );
+        }
+    }
+  */
Index: /RenderSystems/GL/src/nvparse/vs1.0_grammar.y
===================================================================
--- /RenderSystems/GL/src/nvparse/vs1.0_grammar.y	(revision 5)
+++ /RenderSystems/GL/src/nvparse/vs1.0_grammar.y	(revision 5)
@@ -0,0 +1,456 @@
+%start VS10Program
+%name-prefix="vs10_"
+%{
+void yyerror(char *s);
+int yylex(void);
+
+#include <math.h>
+#include <string>
+
+#include <stdlib.h>
+#include "vs1.0_inst_list.h"
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+//extern bool gbTempInsideMacro;
+//extern unsigned int &base_linenumber;
+void LexError(char *format, ...);
+extern int line_incr;
+
+#define do_linenum_incr()		{ line_number+=line_incr; line_incr = 0; }
+//int get_linenum()			{ return( gbTempInsideMacro ? base_linenumber : line_number ); }
+int get_linenum()			{ return( line_number ); }
+
+#define YYDEBUG 1
+
+%}
+%union {
+  int ival;
+  unsigned int lval;
+  float fval;
+  char mask[4];
+  char *comment;
+  VS10Reg reg;
+  VS10InstPtr inst;
+  VS10InstListPtr instList;
+};
+
+%token VERTEX_SHADER
+
+%token ADD_INSTR
+%token DP3_INSTR
+%token DP4_INSTR
+%token DST_INSTR
+%token EXP_INSTR
+%token EXPP_INSTR
+%token FRC_INSTR
+%token LIT_INSTR
+%token LOG_INSTR
+%token LOGP_INSTR
+%token M3X2_INSTR
+%token M3X3_INSTR
+%token M3X4_INSTR
+%token M4X3_INSTR
+%token M4X4_INSTR
+%token MAD_INSTR
+%token MAX_INSTR
+%token MIN_INSTR
+%token MOV_INSTR
+%token MUL_INSTR
+%token NOP_INSTR
+%token RCP_INSTR
+%token RSQ_INSTR
+%token SGE_INSTR
+%token SLT_INSTR
+%token SUB_INSTR
+
+%token ILLEGAL 
+%token UNKNOWN_STRING
+
+%token <ival> INTVAL
+%token <reg> REGISTER
+%token <mask> XYZW_MODIFIER
+%token <comment> COMMENT
+
+%type <instList> InstSequence
+%type <inst> InstLine
+%type <inst> Instruction
+%type <inst> VECTORopinstruction
+%type <inst> SCALARopinstruction
+%type <inst> UNARYopinstruction
+%type <inst> BINopinstruction
+%type <inst> TRIopinstruction
+%type <ival> VECTORop
+%type <ival> SCALARop
+%type <ival> UNARYop
+%type <ival> BINop
+%type <ival> TRIop
+
+%type <reg> genericReg
+%type <reg> genReg
+%type <reg> constantReg
+
+
+%%      /*beginning of rules section */
+
+VS10Program: InstSequence
+	{
+	$1->Validate();
+	$1->Translate();
+	delete $1;
+	}
+	;
+
+InstSequence: InstSequence InstLine
+	{
+		*($1) += $2;
+		delete $2;
+		$$ = $1
+	}
+	| InstLine
+	{
+ 		VS10InstListPtr instList = new VS10InstList;
+		if ( $1 != NULL )
+			{
+			*instList += $1;
+			delete $1;
+			}
+		$$ = instList;
+	}
+	;
+
+InstLine: Instruction
+	{
+		$$ = $1;
+		do_linenum_incr();
+	}
+	| '\n'
+	{
+		$$ = new VS10Inst( get_linenum() );
+		do_linenum_incr();
+	}
+	;
+
+Instruction: VECTORopinstruction
+           | SCALARopinstruction
+           | UNARYopinstruction
+           | BINopinstruction
+           | TRIopinstruction
+		   | NOP_INSTR
+		   {
+		   $$ = new VS10Inst( get_linenum(), VS10_NOP );
+		   }
+		   | COMMENT
+		   {
+		   $$ = new VS10Inst( get_linenum(), VS10_COMMENT, $1 );
+		   }
+		   | VERTEX_SHADER
+		   {
+		   $$ = new VS10Inst( get_linenum(), VS10_HEADER );
+		   }
+		   ;
+
+VECTORopinstruction: VECTORop genericReg ',' genericReg
+	{
+		$$ = new VS10Inst( get_linenum(), $1, $2, $4 );
+	}
+	;
+
+genericReg : '-' genReg '.' XYZW_MODIFIER
+		   {
+		   VS10Reg reg;
+		   reg = $2;
+		   reg.sign = -1;
+		   reg.type = $2.type;
+		   reg.index = $2.index;
+		   for ( int i = 0; i < 4; i++ ) reg.mask[i] = $4[i];
+		   $$ = reg;
+		   }
+		   | genReg '.' XYZW_MODIFIER
+		   {
+		   VS10Reg reg;
+		   reg = $1;
+		   reg.sign = 1;
+		   reg.type = $1.type;
+		   reg.index = $1.index;
+		   for ( int i = 0; i < 4; i++ ) reg.mask[i] = $3[i];
+		   $$ = reg;
+		   }
+		   | '-' genReg
+		   {
+		   VS10Reg reg;
+		   reg = $2;
+		   reg.sign = -1;
+		   reg.type = $2.type;
+		   reg.index = $2.index;
+		   for ( int i = 0; i < 4; i++ ) reg.mask[i] = 0;
+		   $$ = reg;
+		   }
+		   | genReg
+		   {
+		   VS10Reg reg;
+		   reg = $1;
+		   reg.sign = 1;
+		   reg.type = $1.type;
+		   reg.index = $1.index;
+		   for ( int i = 0; i < 4; i++ ) reg.mask[i] = 0;
+		   $$ = reg;
+		   }
+		   ;
+genReg: REGISTER | constantReg
+	  {
+	  }
+	  ;
+constantReg: 'c' '[' INTVAL ']'
+		   {
+		   VS10Reg reg;
+		   reg.type = TYPE_CONSTANT_MEM_REG;
+		   reg.index = $3;
+		   $$ = reg;
+		   }
+		   | 'c' '[' REGISTER '.' XYZW_MODIFIER ']'
+		   {
+		   // Register is valid only if
+		   //	type = TYPE_ADDRESS_REG
+		   //	index = 0
+		   //	len(mask) = 1
+		   //	mask[0] = 'x'
+		   VS10Reg reg;
+		   $$.type = TYPE_CONSTANT_A0_REG;
+		   if ( $3.type != TYPE_ADDRESS_REG )
+		       {
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+			   }
+		       else if ( $3.index != 0 )
+			   {
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+			   }
+			   else
+			   {
+			       int len = 0;
+				   while ( len < 2 )
+				   {
+				       if ( $5[len] == 0 )
+				           break;
+					   len++;
+				   }
+				   if ( len != 1 || $5[0] != 'x' )
+				   {
+			       LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+				   }
+
+				   reg.type = TYPE_CONSTANT_A0_REG;
+				   $$ = reg;
+			   }
+		   }
+		   | 'c' '[' REGISTER '.' XYZW_MODIFIER '+' INTVAL ']'
+		   {
+		   // Register is valid only if
+		   //	type = TYPE_ADDRESS_REG
+		   //	index = 0
+		   //	len(mask) = 1
+		   //	mask[0] = 'x'
+		   VS10Reg reg;
+		   $$.type = TYPE_CONSTANT_A0_OFFSET_REG;
+		   if ( $3.type != TYPE_ADDRESS_REG )
+		       {
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+			   }
+		       else if ( $3.index != 0 )
+			   {
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+			   }
+			   else
+			   {
+			       int len = 0;
+				   while ( len < 2 )
+				   {
+				       if ( $5[len] == 0 )
+				           break;
+					   len++;
+				   }
+				   if ( len != 1 || $5[0] != 'x' )
+				   {
+			       LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+				   }
+
+				   reg.type = TYPE_CONSTANT_A0_OFFSET_REG;
+				   reg.index = $7;
+				   $$ = reg;
+			   }
+		   }
+		   | 'c' '[' REGISTER ']'
+		   {
+		       $$.type = TYPE_CONSTANT_A0_REG;
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+		   }
+		   | 'c' '[' REGISTER '+' INTVAL ']'
+		   {
+		       $$.type = TYPE_CONSTANT_A0_REG;
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+		   }
+		   | 'c' '[' '-' REGISTER  ']'
+		   {
+		       $$.type = TYPE_CONSTANT_A0_REG;
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+		   }
+		   | 'c' '[' '-' REGISTER '+' INTVAL ']'
+		   {
+		       $$.type = TYPE_CONSTANT_A0_REG;
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+		   }
+		   | 'c' '[' '-' REGISTER '.' XYZW_MODIFIER ']'
+		   {
+		       $$.type = TYPE_CONSTANT_A0_REG;
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+		   }
+		   | 'c' '[' '-' REGISTER '.' XYZW_MODIFIER '+' INTVAL ']'
+		   {
+		       $$.type = TYPE_CONSTANT_A0_REG;
+			   LexError( "constant register index must be:\t<int>, a0.x, or a0.x + <int>.\n" );
+		   }
+		   ;
+
+SCALARopinstruction: SCALARop genericReg ',' genericReg
+	{
+		$$ = new VS10Inst( get_linenum(), $1, $2, $4 );
+	}
+	;
+
+UNARYopinstruction: UNARYop genericReg ',' genericReg
+	{
+		$$ = new VS10Inst( get_linenum(), $1, $2, $4 );
+	}
+	;
+
+BINopinstruction: BINop genericReg ',' genericReg ',' genericReg
+	{
+		$$ = new VS10Inst( get_linenum(), $1, $2, $4, $6 );
+	}
+	;
+
+TRIopinstruction: TRIop genericReg ','
+                        genericReg ',' genericReg ',' genericReg
+	{
+		$$ = new VS10Inst( get_linenum(), $1, $2, $4, $6, $8 );
+	}
+	;
+
+VECTORop: MOV_INSTR
+	{
+		$$ = VS10_MOV;
+	}
+    | LIT_INSTR
+	{
+		$$ = VS10_LIT;
+	}
+	;
+
+SCALARop: RCP_INSTR
+	{
+	$$ = VS10_RCP;
+	}
+    | RSQ_INSTR
+	{
+	$$ = VS10_RSQ;
+	}
+	| EXP_INSTR
+	{
+	$$ = VS10_EXP;
+	}
+	| EXPP_INSTR
+	{
+	$$ = VS10_EXPP;
+	}
+    | LOG_INSTR
+	{
+	$$ = VS10_LOG;
+	}
+    | LOGP_INSTR
+	{
+	$$ = VS10_LOGP;
+	}
+	;
+
+UNARYop: FRC_INSTR
+	{
+	$$ = VS10_FRC;
+	}
+    	;
+	
+BINop: MUL_INSTR
+	{
+	$$ = VS10_MUL;
+	}
+    | ADD_INSTR
+	{
+	$$ = VS10_ADD;
+	}
+    | DP3_INSTR
+	{
+	$$ = VS10_DP3;
+	}
+    | DP4_INSTR
+	{
+	$$ = VS10_DP4;
+	}
+    | DST_INSTR
+	{
+	$$ = VS10_DST;
+	}
+    | MIN_INSTR
+	{
+	$$ = VS10_MIN;
+	}
+    | MAX_INSTR
+	{
+	$$ = VS10_MAX;
+	}
+    | SLT_INSTR
+	{
+	$$ = VS10_SLT;
+	}
+    | SGE_INSTR
+	{
+	$$ = VS10_SGE;
+	}
+    | M3X2_INSTR
+	{
+	$$ = VS10_M3X2;
+	}
+    | M3X3_INSTR
+	{
+	$$ = VS10_M3X3;
+	}
+    | M3X4_INSTR
+	{
+	$$ = VS10_M3X4;
+	}
+    | M4X3_INSTR
+	{
+	$$ = VS10_M4X3;
+	}
+    | M4X4_INSTR
+	{
+	$$ = VS10_M4X4;
+	}
+    | SUB_INSTR
+	{
+	$$ = VS10_SUB;
+	}
+	;
+
+TRIop: MAD_INSTR
+	{
+	$$ = VS10_MAD;
+	}
+	;
+
+
+%%
+void yyerror(char* s)
+{
+    LexError( "Syntax Error.\n" );
+    //errors.set(s);
+    //errors.set("unrecognized token");
+}
Index: /RenderSystems/GL/src/nvparse/vs1.0_inst.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/vs1.0_inst.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/vs1.0_inst.cpp	(revision 5)
@@ -0,0 +1,1474 @@
+#ifdef WIN32
+#pragma warning(disable:4786)
+#endif
+#include "vs1.0_inst.h"
+#include <stdio.h>
+#include <string>
+#include <map>
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+
+std::string vs10_transstring;
+
+#if 0
+VS10Reg::VS10Reg()
+{
+    type = 0;
+    index = 0;
+	sign = 0;
+    mask = 0;
+}
+
+VS10Reg::VS10Reg(const VS10Reg &r)
+{
+    type = r.type;
+    index = r.index;
+	sign = r.sign;
+    mask = r.mask;
+}
+
+VS10Reg& VS10Reg::operator=(const VS10Reg &r)
+{
+    if ( this != &r )
+    {
+        type = r.type;
+        index = r.index;
+		sign = r.sign;
+        mask = r.mask;
+    }
+    return *this;
+}
+#endif
+
+void VS10Reg::Init()
+{
+    type = 0;
+    index = -1;
+    sign = 0;
+    mask[0] = 'j';
+    mask[1] = 'j';
+    mask[2] = 'j';
+    mask[3] = 'j';
+}
+
+int VS10Reg::ValidateIndex()
+{
+    switch( type )
+    {
+    case TYPE_TEMPORARY_REG:
+        if ( index < 0 || index > 11 ) return 0;
+        else return 1;
+        break;
+    case TYPE_VERTEX_ATTRIB_REG:
+        if ( index < 0 || index > 15 ) return 0;
+        else return 1;
+        break;
+    case TYPE_ADDRESS_REG:        
+        if ( index != 0 ) return 0;
+        else return 1;
+        break;
+    case TYPE_CONSTANT_MEM_REG:
+        if ( index < 0 || index > 95 ) return 0;
+        else return 1;
+        break;
+    case TYPE_CONSTANT_A0_REG:
+    case TYPE_CONSTANT_A0_OFFSET_REG:
+        return 1;
+        break;
+    case TYPE_POSITION_RESULT_REG:
+        return 1;
+        break;
+    case TYPE_COLOR_RESULT_REG:
+        if ( index < 0 || index > 1 ) return 0;
+        else return 1;
+        break;
+    case TYPE_TEXTURE_RESULT_REG:
+        if ( index < 0 || index > 3 ) return 0;
+        else return 1;
+        break;
+    case TYPE_FOG_RESULT_REG:
+        return 1;
+        break;
+    case TYPE_POINTS_RESULT_REG:
+        return 1;
+        break;
+    default:
+        errors.set( "VS10Reg::ValidateIndex() Internal Error: unknown register type\n" );
+        return 1;
+    }
+}
+
+void VS10Reg::Translate()
+{
+    char str[16];
+
+    if ( sign == -1 )
+        vs10_transstring.append( "-" );
+    
+    switch ( type )
+    {
+    case TYPE_TEMPORARY_REG:
+        sprintf( str, "R%d", index );
+        vs10_transstring.append( str );
+        break;
+    case TYPE_VERTEX_ATTRIB_REG:
+        sprintf( str, "v[%d]", index );
+        vs10_transstring.append( str );
+        break;
+    case TYPE_ADDRESS_REG:        
+        sprintf( str, "A%d", index );
+        vs10_transstring.append( str );
+        break;
+    case TYPE_CONSTANT_MEM_REG:
+        sprintf( str, "c[%d]", index );
+        vs10_transstring.append( str );
+        break;
+    case TYPE_CONSTANT_A0_REG:
+        vs10_transstring.append( "c[ A0.x ]" );
+        break;
+    case TYPE_CONSTANT_A0_OFFSET_REG:
+        sprintf( str, "c[ A0.x + %d ]", index );
+        vs10_transstring.append( str );
+        break;
+    case TYPE_POSITION_RESULT_REG:
+        vs10_transstring.append( "o[HPOS]" );
+        break;
+    case TYPE_COLOR_RESULT_REG:
+        sprintf( str, "o[COL%d]", index );
+        vs10_transstring.append( str );
+        break;
+    case TYPE_TEXTURE_RESULT_REG:
+        sprintf( str, "o[TEX%d]", index );
+        vs10_transstring.append( str );
+        break;
+    case TYPE_FOG_RESULT_REG:
+        vs10_transstring.append( "o[FOGC]" );
+        break;
+    case TYPE_POINTS_RESULT_REG:
+        vs10_transstring.append( "o[PSIZ]" );
+        break;
+    default:
+        errors.set( "VS10Reg::Translate() Internal Error: unknown register type\n" );
+    }
+
+    if ( mask[0] != 0 )
+    {
+        str[0] = '.';
+        strncpy( str+1, mask, 4 );
+        str[5] = 0;
+        vs10_transstring.append( str );
+    }
+}
+
+VS10Inst::~VS10Inst()
+{
+    if (comment != NULL ) delete [] comment;
+}
+
+VS10Inst::VS10Inst()
+{
+    line = -1;
+    instid = -1;
+    dst.Init();
+    src[0].Init();
+    src[1].Init();
+    src[2].Init();
+    comment = NULL;
+}
+
+VS10Inst::VS10Inst( int currline )
+{
+    line = currline;
+    instid = -1;
+    dst.Init();
+    src[0].Init();
+    src[1].Init();
+    src[2].Init();
+    comment = NULL;
+}
+
+VS10Inst::VS10Inst( const VS10Inst &inst )
+{
+    line = inst.line;
+    instid = inst.instid;
+    dst = inst.dst;
+    src[0] = inst.src[0];
+    src[1] = inst.src[1];
+    src[2] = inst.src[2];
+    if ( inst.comment == NULL )
+        comment = NULL;
+    else
+    {
+        comment = new char[strlen(inst.comment)+1];
+        strcpy( comment, inst.comment );
+    }
+}
+
+VS10Inst& VS10Inst::operator=(const VS10Inst &inst)
+{
+    if ( this != &inst )
+    {
+        line = inst.line;
+        instid = inst.instid;
+        dst = inst.dst;
+        src[0] = inst.src[0];
+        src[1] = inst.src[1];
+        src[2] = inst.src[2];
+        if ( inst.comment == NULL )
+            comment = NULL;
+        else
+        {
+            comment = new char[strlen(inst.comment)+1];
+            strcpy( comment, inst.comment );
+        }
+    }
+    return *this;
+}
+
+
+VS10Inst::VS10Inst(int currline, int inst)
+{
+    line = currline;
+    instid = inst;
+    dst.Init();
+    src[0].Init();
+    src[1].Init();
+    src[2].Init();
+    comment = NULL;
+}
+
+VS10Inst::VS10Inst(int currline, int inst, char *cmt)
+{
+    line = currline;
+    instid = inst;
+    dst.Init();
+    src[0].Init();
+    src[1].Init();
+    src[2].Init();
+    comment = cmt;
+}
+
+VS10Inst::VS10Inst(int currline, int inst, VS10Reg dreg, VS10Reg src0)
+{
+    line = currline;
+	instid = inst;
+	dst = dreg;
+    src[0] = src0;
+    src[1].Init();
+    src[2].Init();
+    comment = NULL;
+}
+
+VS10Inst::VS10Inst(int currline, int inst, VS10Reg dreg, VS10Reg src0, VS10Reg src1)
+{
+    line = currline;
+	instid = inst;
+	dst = dreg;
+    src[0] = src0;
+    src[1] = src1;
+    src[2].Init();
+    comment = NULL;
+}
+
+VS10Inst::VS10Inst(int currline, int inst, VS10Reg dreg, VS10Reg src0, VS10Reg src1, VS10Reg src2)
+{
+    line = currline;
+	instid = inst;
+	dst = dreg;
+    src[0] = src0;
+    src[1] = src1;
+    src[2] = src2;
+    comment = NULL;
+}
+
+void VS10Inst::Validate( int &vsflag )
+{
+
+    // Handle comments, noops, and newlines.
+    if ( instid == VS10_COMMENT || instid == VS10_NOP || instid == -1 ) return;
+
+    // Handle the header case.
+    if ( instid == VS10_HEADER )
+    {
+        if ( vsflag == 0 )
+        {
+            vsflag = 1;
+            return;
+        }
+        else
+        {
+            char temp[128];
+            sprintf( temp, "(%d) Error: vs.1.0 token already encountered\n", line );
+            errors.set( temp );
+            return;
+        }
+    }
+
+    // Validate register indices are valid.
+    ValidateRegIndices();
+
+    // Verify destination masking is valid.
+    ValidateDestMask();
+
+    // Verify source swizzling is valid.
+    ValidateSrcMasks();
+
+    // Verify destination register is writable.
+    ValidateDestWritable();
+
+    // Verify source registers are readable.
+    ValidateSrcReadable();
+
+    // Verify not reading from multiple vertex attributes or constants
+    ValidateReadPorts();
+}
+
+void VS10Inst::ValidateRegIndices()
+{
+    char temp[256];
+    int result;
+
+    // Destination register.
+    result = dst.ValidateIndex();
+    if ( !result )
+    {
+        sprintf( temp, "(%d) Error: destination register index out of range\n", line );
+        errors.set( temp );
+    }
+
+    // Source register.
+    result = src[0].ValidateIndex();
+    if ( !result )
+    {
+        sprintf( temp, "(%d) Error: source register index out of range\n", line );
+        errors.set( temp );
+    }
+
+    switch( instid )
+    {
+        // Vector operations.
+        case VS10_MOV: 
+        case VS10_LIT:
+            break;
+
+        // Unary operations.
+        case VS10_FRC: 
+            break;
+
+        // Scalar operations.
+        case VS10_EXP: 
+        case VS10_EXPP:
+        case VS10_LOG: 
+        case VS10_LOGP:
+        case VS10_RCP: 
+        case VS10_RSQ:
+            break;
+        
+        // Binary operations.
+        case VS10_ADD:
+        case VS10_DP3:
+        case VS10_DP4: 
+        case VS10_DST: 
+        case VS10_SGE: 
+        case VS10_SLT: 
+        case VS10_SUB:
+        case VS10_MAX: 
+        case VS10_MIN: 
+        case VS10_MUL: 
+            result = src[1].ValidateIndex();
+            if ( !result )
+            {
+                sprintf( temp, "(%d) Error: second source register index out of range\n", line );
+                errors.set( temp );
+            }
+            break;
+
+        case VS10_M3X2:
+        case VS10_M3X3:
+        case VS10_M3X4:
+        case VS10_M4X3:
+        case VS10_M4X4:
+            {
+                result = src[1].ValidateIndex();
+                if ( !result )
+                {
+                    sprintf( temp, "(%d) Error: second source register index out of range\n", line );
+                    errors.set( temp );
+                }
+                int orig;
+                orig = src[1].index;
+                switch( instid )
+                {
+                    case VS10_M3X2:
+                        src[1].index = src[1].index + 1;
+                        break;
+                    case VS10_M3X3:
+                    case VS10_M4X3:
+                        src[1].index = src[1].index + 2;
+                        break;
+                    case VS10_M3X4:
+                    case VS10_M4X4:
+                        src[1].index = src[1].index + 3;
+                        break;
+                }
+                result = src[1].ValidateIndex();
+                src[1].index = orig;
+                if ( !result )
+                {
+                    sprintf( temp, "(%d) Error: macro expansion produces source register index out of range\n", line );
+                    errors.set( temp );
+                }
+            }
+            break;
+
+        // Trinary operations.
+        case VS10_MAD:
+            result = src[1].ValidateIndex();
+            if ( !result )
+            {
+                sprintf( temp, "(%d) Error: second source register index out of range\n", line );
+                errors.set( temp );
+            }
+            result = src[2].ValidateIndex();
+            if ( !result )
+            {
+                sprintf( temp, "(%d) Error: third source register index out of range\n", line );
+                errors.set( temp );
+            }
+            break;
+        default:
+            errors.set( "VS10Inst::ValidateRegIndices() Internal Error: unknown instruction type\n" );
+            break;
+    }
+}
+
+void VS10Inst::ValidateDestMask()
+{
+    char temp[256];
+    typedef std::map<char, int> MyMap;
+    typedef MyMap::value_type MyPair;
+    static const MyPair pairs[] = 
+    {
+        MyPair('x',1),
+        MyPair('y',2),
+        MyPair('z',3),
+        MyPair('w',4),
+    };
+    static const MyMap swizzleMap(pairs, pairs+(sizeof(pairs)/sizeof(pairs[0])));
+
+    if ( dst.mask[0] == 0 ) return;
+    int i = 1;
+    while ( i < 4 && dst.mask[i] != 0 )
+    {
+        MyMap::const_iterator lastMaskIt = swizzleMap.find(dst.mask[i-1]);
+        MyMap::const_iterator curMaskIt = swizzleMap.find(dst.mask[i]);
+        if (lastMaskIt == swizzleMap.end() || curMaskIt == swizzleMap.end() ||
+            lastMaskIt->second >= curMaskIt->second)
+//        if ( dst.mask[i-1] >= dst.mask[i] )
+        {
+            char mask[5];
+            strncpy( mask, dst.mask, 4 );
+            mask[4] = 0;
+            sprintf( temp, "(%d) Error: destination register has invalid mask: %s\n", line, mask );
+            errors.set( temp );
+            break;
+        }
+        i++;
+    }
+}
+
+void VS10Inst::ValidateSrcMasks()
+{
+    char temp[256];
+    char mask[5];
+    int len;
+    int i;
+
+    switch( instid )
+    {
+        // Vector operations.
+        case VS10_MOV: 
+        case VS10_LIT:
+            strncpy( mask, src[0].mask, 4 );
+            mask[4] = 0;
+            len = strlen( mask );
+            if ( len != 1 )
+            {
+                for ( i = len; i < 4; i++ )
+                    src[0].mask[i] = src[0].mask[len-1];
+            }
+            break;
+
+        // Unary operations.
+        case VS10_FRC: 
+            strncpy( mask, src[0].mask, 4 );
+            mask[4] = 0;
+            len = strlen( mask );
+            if ( len != 1 )
+            {
+                for ( i = len; i < 4; i++ )
+                    src[0].mask[i] = src[0].mask[len-1];
+            }
+            break;
+
+        // Scalar operations.
+        case VS10_EXP: 
+        case VS10_EXPP:
+        case VS10_LOG: 
+        case VS10_LOGP:
+            strncpy( mask, src[0].mask, 4 );
+            mask[4] = 0;
+            len = strlen( mask );
+            if( len != 1 )
+            {
+                sprintf( temp, "(%d) Error: source register has invalid mask: %s\n", line, mask );
+                errors.set( temp );
+            }
+            break;
+
+        case VS10_RCP: 
+        case VS10_RSQ:
+            strncpy( mask, src[0].mask, 4 );
+            mask[4] = 0;
+            len = strlen( mask );
+            if( len != 0 && len != 1 )
+            {
+                sprintf( temp, "(%d) Error: source register has invalid mask: %s\n", line, mask );
+                errors.set( temp );
+            }
+            if ( len == 0 )
+            {
+                strcpy( src[0].mask, "w" );
+            }
+            break;
+        
+        // Binary operations.
+        case VS10_ADD:
+        case VS10_DP3:
+        case VS10_DP4: 
+        case VS10_DST: 
+        case VS10_SGE: 
+        case VS10_SLT: 
+        case VS10_SUB:
+        case VS10_M3X2:
+        case VS10_M3X3:
+        case VS10_M3X4:
+        case VS10_M4X3:
+        case VS10_M4X4:
+        case VS10_MAX: 
+        case VS10_MIN: 
+        case VS10_MUL: 
+            strncpy( mask, src[0].mask, 4 );
+            mask[4] = 0;
+            len = strlen( mask );
+            if ( len != 0 && len != 1 )
+            {
+                for ( i = len; i < 4; i++ )
+                    src[0].mask[i] = src[0].mask[len-1];
+            }
+            strncpy( mask, src[1].mask, 4 );
+            mask[4] = 0;
+            len = strlen( mask );
+            if ( len != 0 && len != 1 )
+            {
+                for ( i = len; i < 4; i++ )
+                    src[1].mask[i] = src[1].mask[len-1];
+            }
+            break;
+
+        // Trinary operations.
+        case VS10_MAD:
+            strncpy( mask, src[0].mask, 4 );
+            mask[4] = 0;
+            len = strlen( mask );
+            if ( len != 0 && len != 1 )
+            {
+                for ( i = len; i < 4; i++ )
+                    src[0].mask[i] = src[0].mask[len-1];
+            }
+            strncpy( mask, src[1].mask, 4 );
+            mask[4] = 0;
+            len = strlen( mask );
+            if ( len != 0 && len != 1 )
+            {
+                for ( i = len; i < 4; i++ )
+                    src[1].mask[i] = src[1].mask[len-1];
+            }
+            strncpy( mask, src[2].mask, 4 );
+            mask[4] = 0;
+            len = strlen( mask );
+            if ( len != 0 && len != 1 )
+            {
+                for ( i = len; i < 4; i++ )
+                    src[2].mask[i] = src[2].mask[len-1];
+            }
+            break;
+        default:
+            errors.set( "VS10Inst::ValidateSrcMasks() Internal Error: unknown instruction type\n" );
+            break;
+    }
+}
+
+void VS10Inst::ValidateDestWritable()
+{
+    char temp[256];
+
+    switch ( dst.type )
+    {
+        case TYPE_TEMPORARY_REG:
+        case TYPE_POSITION_RESULT_REG:
+        case TYPE_COLOR_RESULT_REG:
+        case TYPE_TEXTURE_RESULT_REG:
+        case TYPE_FOG_RESULT_REG:
+        case TYPE_POINTS_RESULT_REG:
+            break;
+        case TYPE_VERTEX_ATTRIB_REG:
+        case TYPE_CONSTANT_MEM_REG:
+        case TYPE_CONSTANT_A0_REG:
+        case TYPE_CONSTANT_A0_OFFSET_REG:
+            sprintf( temp, "(%d) Error: destination register is not writable\n", line );
+            errors.set( temp );
+            break;
+        case TYPE_ADDRESS_REG:
+            if ( instid != VS10_MOV )
+            {
+                sprintf( temp, "(%d) Error: destination register is not writable using this instruction\n", line );
+                errors.set( temp );
+            }
+            break;
+        default:
+            errors.set( "VS10Inst::ValidateDestWritable() Internal Error: unknown register type\n" );
+    }
+
+    if ( instid == VS10_FRC && dst.type != TYPE_TEMPORARY_REG )
+    {
+        sprintf( temp, "(%d) Error: destination register must be a temporary register\n", line );
+        errors.set( temp );
+    }
+}
+
+void VS10Inst::ValidateSrcReadable()
+{
+    char temp[256];
+
+    // Source register.
+    switch( src[0].type )
+    {
+        case TYPE_TEMPORARY_REG:
+        case TYPE_VERTEX_ATTRIB_REG:
+        case TYPE_CONSTANT_MEM_REG:
+        case TYPE_CONSTANT_A0_REG:
+        case TYPE_CONSTANT_A0_OFFSET_REG:
+            break;
+        case TYPE_ADDRESS_REG:
+        case TYPE_POSITION_RESULT_REG:
+        case TYPE_COLOR_RESULT_REG:
+        case TYPE_TEXTURE_RESULT_REG:
+        case TYPE_FOG_RESULT_REG:
+        case TYPE_POINTS_RESULT_REG:
+            sprintf( temp, "(%d) Error: source register is not readable\n", line );
+            errors.set( temp );
+            break;
+        default:
+            errors.set( "VS10Inst::ValidateSrcReadable() Internal Error: unknown register type\n" );
+    }
+    
+    switch( instid )
+    {
+        // Vector operations.
+        case VS10_MOV: 
+        case VS10_LIT:
+            break;
+
+        // Unary operations.
+        case VS10_FRC: 
+            break;
+
+        // Scalar operations.
+        case VS10_EXP: 
+        case VS10_EXPP:
+        case VS10_LOG: 
+        case VS10_LOGP:
+        case VS10_RCP: 
+        case VS10_RSQ:
+            break;
+        
+        // Binary operations.
+        case VS10_ADD:
+        case VS10_DP3:
+        case VS10_DP4: 
+        case VS10_DST: 
+        case VS10_SGE: 
+        case VS10_SLT: 
+        case VS10_SUB:
+        case VS10_M3X2:
+        case VS10_M3X3:
+        case VS10_M3X4:
+        case VS10_M4X3:
+        case VS10_M4X4:
+        case VS10_MAX: 
+        case VS10_MIN: 
+        case VS10_MUL: 
+            switch( src[1].type )
+            {
+                case TYPE_TEMPORARY_REG:
+                case TYPE_VERTEX_ATTRIB_REG:
+                case TYPE_CONSTANT_MEM_REG:
+                case TYPE_CONSTANT_A0_REG:
+                case TYPE_CONSTANT_A0_OFFSET_REG:
+                    break;
+                case TYPE_ADDRESS_REG:
+                case TYPE_POSITION_RESULT_REG:
+                case TYPE_COLOR_RESULT_REG:
+                case TYPE_TEXTURE_RESULT_REG:
+                case TYPE_FOG_RESULT_REG:
+                case TYPE_POINTS_RESULT_REG:
+                    sprintf( temp, "(%d) Error: second source register is not readable\n", line );
+                    errors.set( temp );
+                    break;
+                default:
+                    errors.set( "VS10Inst::ValidateSrcReadable() Internal Error: unknown register type\n" );
+            }
+            break;
+
+        // Trinary operations.
+        case VS10_MAD:
+            switch( src[1].type )
+            {
+                case TYPE_TEMPORARY_REG:
+                case TYPE_VERTEX_ATTRIB_REG:
+                case TYPE_CONSTANT_MEM_REG:
+                case TYPE_CONSTANT_A0_REG:
+                case TYPE_CONSTANT_A0_OFFSET_REG:
+                    break;
+                case TYPE_ADDRESS_REG:
+                case TYPE_POSITION_RESULT_REG:
+                case TYPE_COLOR_RESULT_REG:
+                case TYPE_TEXTURE_RESULT_REG:
+                case TYPE_FOG_RESULT_REG:
+                case TYPE_POINTS_RESULT_REG:
+                    sprintf( temp, "(%d) Error: second source register is not readable\n", line );
+                    errors.set( temp );
+                    break;
+                default:
+                    errors.set( "VS10Inst::ValidateSrcReadable() Internal Error: unknown register type\n" );
+            }
+            switch( src[2].type )
+            {
+                case TYPE_TEMPORARY_REG:
+                case TYPE_VERTEX_ATTRIB_REG:
+                case TYPE_CONSTANT_MEM_REG:
+                case TYPE_CONSTANT_A0_REG:
+                case TYPE_CONSTANT_A0_OFFSET_REG:
+                    break;
+                case TYPE_ADDRESS_REG:
+                case TYPE_POSITION_RESULT_REG:
+                case TYPE_COLOR_RESULT_REG:
+                case TYPE_TEXTURE_RESULT_REG:
+                case TYPE_FOG_RESULT_REG:
+                case TYPE_POINTS_RESULT_REG:
+                    sprintf( temp, "(%d) Error: third source register is not readable\n", line );
+                    errors.set( temp );
+                    break;
+                default:
+                    errors.set( "VS10Inst::ValidateSrcReadable() Internal Error: unknown register type\n" );
+            }
+            break;
+        default:
+            errors.set( "VS10Inst::ValidateSrcReadable() Internal Error: unknown register type\n" );
+            break;
+    }
+}
+
+void VS10Inst::ValidateReadPorts()
+{
+    int constidx[3];
+    int attribidx[3];
+    int i;
+    int acount;
+    int ccount;
+    char temp[256];
+
+    switch( instid )
+    {
+        // Vector operations.
+        case VS10_MOV: 
+        case VS10_LIT:
+            break;
+
+        // Unary operations.
+        case VS10_FRC: 
+            break;
+
+        // Scalar operations.
+        case VS10_EXP: 
+        case VS10_EXPP:
+        case VS10_LOG: 
+        case VS10_LOGP:
+        case VS10_RCP: 
+        case VS10_RSQ:
+            break;
+        
+        // Binary operations.
+        case VS10_ADD:
+        case VS10_DP3:
+        case VS10_DP4: 
+        case VS10_DST: 
+        case VS10_SGE: 
+        case VS10_SLT: 
+        case VS10_SUB:
+        case VS10_M3X2:
+        case VS10_M3X3:
+        case VS10_M3X4:
+        case VS10_M4X3:
+        case VS10_M4X4:
+        case VS10_MAX: 
+        case VS10_MIN: 
+        case VS10_MUL: 
+            acount = 0;
+            ccount = 0;
+            for ( i = 0; i < 2; i++ )
+            {
+                switch( src[i].type )
+                {
+                    case TYPE_VERTEX_ATTRIB_REG:
+                        attribidx[acount] = src[i].index;
+                        acount++;
+                        break;
+                    case TYPE_CONSTANT_MEM_REG:
+                        constidx[ccount] = src[i].index;
+                        ccount++;
+                        break;
+                    case TYPE_CONSTANT_A0_REG:
+                        constidx[ccount] = 100 + src[i].index;
+                        ccount++;
+                        break;
+                    case TYPE_CONSTANT_A0_OFFSET_REG:
+                        constidx[ccount] = 200 + src[i].index;
+                        ccount++;
+                        break;
+                    case TYPE_TEMPORARY_REG:
+                    case TYPE_ADDRESS_REG:
+                    case TYPE_POSITION_RESULT_REG:
+                    case TYPE_COLOR_RESULT_REG:
+                    case TYPE_TEXTURE_RESULT_REG:
+                    case TYPE_FOG_RESULT_REG:
+                    case TYPE_POINTS_RESULT_REG:
+                        break;
+                    default:
+                        errors.set( "VS10Inst::ValidateReadPorts() Internal Error: unknown register type\n" );
+                }
+            }
+            if ( acount == 2 )
+            {
+                if ( attribidx[0] != attribidx[1] )
+                {
+                    sprintf( temp, "(%d) Error: multiple unique attribute registers accessed in this instruction\n", line );
+                    errors.set( temp );
+                }
+            }
+            else if ( ccount == 2 )
+            {
+                if ( constidx[0] != constidx[1] )
+                {
+                    sprintf( temp, "(%d) Error: multiple unique constant registers accessed in this instruction\n", line );
+                    errors.set( temp );
+                }
+            }
+            break;
+
+        // Trinary operations.
+        case VS10_MAD:
+            acount = 0;
+            ccount = 0;
+            for ( i = 0; i < 3; i++ )
+            {
+                switch( src[i].type )
+                {
+                    case TYPE_VERTEX_ATTRIB_REG:
+                        attribidx[acount] = src[i].index;
+                        acount++;
+                        break;
+                    case TYPE_CONSTANT_MEM_REG:
+                        constidx[ccount] = src[i].index;
+                        ccount++;
+                        break;
+                    case TYPE_CONSTANT_A0_REG:
+                        constidx[ccount] = 100 + src[i].index;
+                        ccount++;
+                        break;
+                    case TYPE_CONSTANT_A0_OFFSET_REG:
+                        constidx[ccount] = 200 + src[i].index;
+                        ccount++;
+                        break;
+                    case TYPE_TEMPORARY_REG:
+                    case TYPE_ADDRESS_REG:
+                    case TYPE_POSITION_RESULT_REG:
+                    case TYPE_COLOR_RESULT_REG:
+                    case TYPE_TEXTURE_RESULT_REG:
+                    case TYPE_FOG_RESULT_REG:
+                    case TYPE_POINTS_RESULT_REG:
+                        break;
+                    default:
+                        errors.set( "VS10Inst::ValidateReadPorts() Internal Error: unknown register type\n" );
+                }
+            }
+            if ( acount == 3 )
+            {
+                if ( attribidx[0] != attribidx[1] || attribidx[1] != attribidx[2] )
+                {
+                    sprintf( temp, "(%d) Error: multiple unique attribute registers accessed in this instruction\n", line );
+                    errors.set( temp );
+                }
+            }
+            else if ( acount == 2 )
+            {
+                if ( attribidx[0] != attribidx[1] )
+                {
+                    sprintf( temp, "(%d) Error: multiple unique attribute registers accessed in this instruction\n", line );
+                    errors.set( temp );
+                }
+            }
+            else if ( ccount == 3 )
+            {
+                if ( constidx[0] != constidx[1] || constidx[1] != constidx[2] )
+                {
+                    sprintf( temp, "(%d) Error: multiple unique constant registers accessed in this instruction\n", line );
+                    errors.set( temp );
+                }
+            }
+            else if ( ccount == 2 )
+            {
+                if ( constidx[0] != constidx[1] )
+                {
+                    sprintf( temp, "(%d) Error: multiple unique constant registers accessed in this instruction\n", line );
+                    errors.set( temp );
+                }
+            }
+            break;
+        default:
+            errors.set( "VS10Inst::ValidateSrcReadable() Internal Error: unknown register type\n" );
+            break;
+    }
+}
+
+int VS10Inst::Translate()
+{
+    int flag;
+    int ninstr;
+
+#if DEBUGGING_PURPOSES
+    char mystr[16];
+    if ( instid == VS10_HEADER )
+    {
+        sprintf( mystr, "%d:\tvs.1.0 (skip)\n", line );
+        vs10_transstring.append( mystr );
+        return 0;
+    }
+    sprintf( mystr, "%d:\t", line );
+    vs10_transstring.append( mystr );
+#endif
+
+    switch( instid )
+    {
+    case VS10_ADD:
+        vs10_transstring.append( "ADD    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        vs10_transstring.append( ", " );
+        src[1].Translate();
+        ninstr = 1;
+        break;
+    case VS10_DP3:
+        vs10_transstring.append( "DP3    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        vs10_transstring.append( ", " );
+        src[1].Translate();
+        ninstr = 1;
+        break;
+    case VS10_DP4: 
+        vs10_transstring.append( "DP4    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        vs10_transstring.append( ", " );
+        src[1].Translate();
+        ninstr = 1;
+        break;
+    case VS10_DST: 
+        vs10_transstring.append( "DST    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        vs10_transstring.append( ", " );
+        src[1].Translate();
+        ninstr = 1;
+        break;
+    case VS10_EXP: 
+        vs10_transstring.append( "EXP    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        ninstr = 1;
+        break;
+    case VS10_EXPP:
+        vs10_transstring.append( "EXP    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        ninstr = 1;
+        break;
+    case VS10_FRC:
+        char temp[128];
+        sprintf( temp, "(%d) Error: FRC built-in macro not yet supported.\n", line );
+        errors.set( temp );
+        ninstr = 0;
+        break;
+    case VS10_LIT: 
+        vs10_transstring.append( "LIT    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        ninstr = 1;
+        break;
+    case VS10_LOG: 
+        vs10_transstring.append( "LOG    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        ninstr = 1;
+        break;
+    case VS10_LOGP:
+        vs10_transstring.append( "LOG    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        ninstr = 1;
+        break;
+    case VS10_M3X2:
+    case VS10_M3X3:
+    case VS10_M3X4:
+        if ( dst.mask[0] != 0 )
+        {
+            ninstr = 0;
+            int i = 0;
+            while ( i < 4 && dst.mask[i] != 0 )
+            {
+                if ( dst.mask[i] == 'x' )
+                {
+                    char oldval;
+                    vs10_transstring.append( "DP3    " );
+                    oldval = dst.mask[0];
+                    dst.mask[0] = 0;
+                    dst.Translate();
+                    dst.mask[0] = oldval;
+                    vs10_transstring.append( ".x, " );
+                    src[0].Translate();
+                    vs10_transstring.append( ", " );
+                    src[1].Translate();
+                    vs10_transstring.append( ";\n" );
+                    ninstr++;
+                }
+                if ( dst.mask[i] == 'y' )
+                {
+                    char oldval;
+                    int  oldindex;
+                    vs10_transstring.append( "DP3    " );
+                    oldval = dst.mask[0];
+                    dst.mask[0] = 0;
+                    dst.Translate();
+                    dst.mask[0] = oldval;
+                    vs10_transstring.append( ".y, " );
+                    src[0].Translate();
+                    vs10_transstring.append( ", " );
+                    oldindex = src[1].index;
+                    src[1].index = src[1].index + 1;
+                    src[1].Translate();
+                    src[1].index = oldindex;
+                    vs10_transstring.append( ";\n" );
+                    ninstr++;
+                }
+                if ( dst.mask[i] == 'z' && (instid == VS10_M3X3 || instid == VS10_M3X4) )
+                {
+                    char oldval;
+                    int  oldindex;
+                    vs10_transstring.append( "DP3    " );
+                    oldval = dst.mask[0];
+                    dst.mask[0] = 0;
+                    dst.Translate();
+                    dst.mask[0] = oldval;
+                    vs10_transstring.append( ".z, " );
+                    src[0].Translate();
+                    vs10_transstring.append( ", " );
+                    oldindex = src[1].index;
+                    src[1].index = src[1].index + 2;
+                    src[1].Translate();
+                    src[1].index = oldindex;
+                    vs10_transstring.append( ";\n" );
+                    ninstr++;
+                }
+                if ( dst.mask[i] == 'w' && instid == VS10_M3X4 )
+                {
+                    char oldval;
+                    int  oldindex;
+                    vs10_transstring.append( "DP3    " );
+                    oldval = dst.mask[0];
+                    dst.mask[0] = 0;
+                    dst.Translate();
+                    dst.mask[0] = oldval;
+                    vs10_transstring.append( ".w, " );
+                    src[0].Translate();
+                    vs10_transstring.append( ", " );
+                    oldindex = src[1].index;
+                    src[1].index = src[1].index + 3;
+                    src[1].Translate();
+                    src[1].index = oldindex;
+                    vs10_transstring.append( ";\n" );
+                    ninstr++;
+                }
+                i++;
+            }
+            return ninstr;
+        }
+        else
+        {
+            ninstr = 0;
+
+            char oldval;
+            int  oldindex;
+
+            vs10_transstring.append( "DP3    " );
+            oldval = dst.mask[0];
+            dst.mask[0] = 0;
+            dst.Translate();
+            dst.mask[0] = oldval;
+            vs10_transstring.append( ".x, " );
+            src[0].Translate();
+            vs10_transstring.append( ", " );
+            src[1].Translate();
+            vs10_transstring.append( ";\n" );
+            ninstr++;
+
+            vs10_transstring.append( "DP3    " );
+            oldval = dst.mask[0];
+            dst.mask[0] = 0;
+            dst.Translate();
+            dst.mask[0] = oldval;
+            vs10_transstring.append( ".y, " );
+            src[0].Translate();
+            vs10_transstring.append( ", " );
+            oldindex = src[1].index;
+            src[1].index = src[1].index + 1;
+            src[1].Translate();
+            src[1].index = oldindex;
+            vs10_transstring.append( ";\n" );
+            ninstr++;
+
+            if ( instid == VS10_M3X3 || instid == VS10_M3X4 )
+            {
+                vs10_transstring.append( "DP3    " );
+                oldval = dst.mask[0];
+                dst.mask[0] = 0;
+                dst.Translate();
+                dst.mask[0] = oldval;
+                vs10_transstring.append( ".z, " );
+                src[0].Translate();
+                vs10_transstring.append( ", " );
+                oldindex = src[1].index;
+                src[1].index = src[1].index + 2;
+                src[1].Translate();
+                src[1].index = oldindex;
+                vs10_transstring.append( ";\n" );
+                ninstr++;
+            }
+
+            if ( instid == VS10_M3X4 )
+            {
+                vs10_transstring.append( "DP3    " );
+                oldval = dst.mask[0];
+                dst.mask[0] = 0;
+                dst.Translate();
+                dst.mask[0] = oldval;
+                vs10_transstring.append( ".w, " );
+                src[0].Translate();
+                vs10_transstring.append( ", " );
+                oldindex = src[1].index;
+                src[1].index = src[1].index + 3;
+                src[1].Translate();
+                src[1].index = oldindex;
+                vs10_transstring.append( ";\n" );
+                ninstr++;
+            }
+            return ninstr;
+        }
+        break;
+    case VS10_M4X3:
+    case VS10_M4X4:
+        if ( dst.mask[0] != 0 )
+        {
+            ninstr = 0;
+            int i = 0;
+            while ( i < 4 && dst.mask[i] != 0 )
+            {
+                if ( dst.mask[i] == 'x' )
+                {
+                    char oldval;
+                    vs10_transstring.append( "DP4    " );
+                    oldval = dst.mask[0];
+                    dst.mask[0] = 0;
+                    dst.Translate();
+                    dst.mask[0] = oldval;
+                    vs10_transstring.append( ".x, " );
+                    src[0].Translate();
+                    vs10_transstring.append( ", " );
+                    src[1].Translate();
+                    vs10_transstring.append( ";\n" );
+                    ninstr++;
+                }
+                if ( dst.mask[i] == 'y' )
+                {
+                    char oldval;
+                    int  oldindex;
+                    vs10_transstring.append( "DP4    " );
+                    oldval = dst.mask[0];
+                    dst.mask[0] = 0;
+                    dst.Translate();
+                    dst.mask[0] = oldval;
+                    vs10_transstring.append( ".y, " );
+                    src[0].Translate();
+                    vs10_transstring.append( ", " );
+                    oldindex = src[1].index;
+                    src[1].index = src[1].index + 1;
+                    src[1].Translate();
+                    src[1].index = oldindex;
+                    vs10_transstring.append( ";\n" );
+                    ninstr++;
+                }
+                if ( dst.mask[i] == 'z' )
+                {
+                    char oldval;
+                    int  oldindex;
+                    vs10_transstring.append( "DP4    " );
+                    oldval = dst.mask[0];
+                    dst.mask[0] = 0;
+                    dst.Translate();
+                    dst.mask[0] = oldval;
+                    vs10_transstring.append( ".z, " );
+                    src[0].Translate();
+                    vs10_transstring.append( ", " );
+                    oldindex = src[1].index;
+                    src[1].index = src[1].index + 2;
+                    src[1].Translate();
+                    src[1].index = oldindex;
+                    vs10_transstring.append( ";\n" );
+                    ninstr++;
+                }
+                if ( dst.mask[i] == 'w' && instid == VS10_M4X4 )
+                {
+                    char oldval;
+                    int  oldindex;
+                    vs10_transstring.append( "DP4    " );
+                    oldval = dst.mask[0];
+                    dst.mask[0] = 0;
+                    dst.Translate();
+                    dst.mask[0] = oldval;
+                    vs10_transstring.append( ".w, " );
+                    src[0].Translate();
+                    vs10_transstring.append( ", " );
+                    oldindex = src[1].index;
+                    src[1].index = src[1].index + 3;
+                    src[1].Translate();
+                    src[1].index = oldindex;
+                    vs10_transstring.append( ";\n" );
+                    ninstr++;
+                }
+                i++;
+            }
+            return ninstr;
+        }
+        else
+        {
+            ninstr = 0;
+
+            char oldval;
+            int  oldindex;
+
+            vs10_transstring.append( "DP4    " );
+            oldval = dst.mask[0];
+            dst.mask[0] = 0;
+            dst.Translate();
+            dst.mask[0] = oldval;
+            vs10_transstring.append( ".x, " );
+            src[0].Translate();
+            vs10_transstring.append( ", " );
+            src[1].Translate();
+            vs10_transstring.append( ";\n" );
+            ninstr++;
+
+            vs10_transstring.append( "DP4    " );
+            oldval = dst.mask[0];
+            dst.mask[0] = 0;
+            dst.Translate();
+            dst.mask[0] = oldval;
+            vs10_transstring.append( ".y, " );
+            src[0].Translate();
+            vs10_transstring.append( ", " );
+            oldindex = src[1].index;
+            src[1].index = src[1].index + 1;
+            src[1].Translate();
+            src[1].index = oldindex;
+            vs10_transstring.append( ";\n" );
+            ninstr++;
+
+            vs10_transstring.append( "DP4    " );
+            oldval = dst.mask[0];
+            dst.mask[0] = 0;
+            dst.Translate();
+            dst.mask[0] = oldval;
+            vs10_transstring.append( ".z, " );
+            src[0].Translate();
+            vs10_transstring.append( ", " );
+            oldindex = src[1].index;
+            src[1].index = src[1].index + 2;
+            src[1].Translate();
+            src[1].index = oldindex;
+            vs10_transstring.append( ";\n" );
+            ninstr++;
+
+            if ( instid == VS10_M4X4 )
+            {
+                vs10_transstring.append( "DP4    " );
+                oldval = dst.mask[0];
+                dst.mask[0] = 0;
+                dst.Translate();
+                dst.mask[0] = oldval;
+                vs10_transstring.append( ".w, " );
+                src[0].Translate();
+                vs10_transstring.append( ", " );
+                oldindex = src[1].index;
+                src[1].index = src[1].index + 3;
+                src[1].Translate();
+                src[1].index = oldindex;
+                vs10_transstring.append( ";\n" );
+                ninstr++;
+            }
+            return ninstr;
+        }
+        break;
+    case VS10_MAD: 
+        vs10_transstring.append( "MAD    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        vs10_transstring.append( ", " );
+        src[1].Translate();
+        vs10_transstring.append( ", " );
+        src[2].Translate();
+        ninstr = 1;
+        break;
+    case VS10_MAX: 
+        vs10_transstring.append( "MAX    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        vs10_transstring.append( ", " );
+        src[1].Translate();
+        ninstr = 1;
+        break;
+    case VS10_MIN: 
+        vs10_transstring.append( "MIN    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        vs10_transstring.append( ", " );
+        src[1].Translate();
+        ninstr = 1;
+        break;
+    case VS10_MOV:
+        if ( dst.type == TYPE_ADDRESS_REG )
+            vs10_transstring.append( "ARL    " );
+        else
+            vs10_transstring.append( "MOV    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        ninstr = 1;
+        break;
+    case VS10_MUL: 
+        vs10_transstring.append( "MUL    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        vs10_transstring.append( ", " );
+        src[1].Translate();
+        ninstr = 1;
+        break;
+    case VS10_NOP: 
+        return 0;
+        break;
+    case VS10_RCP: 
+        vs10_transstring.append( "RCP    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        ninstr = 1;
+        break;
+    case VS10_RSQ: 
+        vs10_transstring.append( "RSQ    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        ninstr = 1;
+        break;
+    case VS10_SGE: 
+        vs10_transstring.append( "SGE    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        vs10_transstring.append( ", " );
+        src[1].Translate();
+        ninstr = 1;
+        break;
+    case VS10_SLT: 
+        vs10_transstring.append( "SLT    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        vs10_transstring.append( ", " );
+        src[1].Translate();
+        ninstr = 1;
+        break;
+    case VS10_SUB:
+        vs10_transstring.append( "ADD    " );
+        dst.Translate();
+        vs10_transstring.append( ", " );
+        src[0].Translate();
+        vs10_transstring.append( ", " );
+        flag = src[1].sign;
+        if ( flag == -1 ) src[1].sign = 1;
+        else src[1].sign = -1;
+        src[1].Translate();
+        src[1].sign = flag;
+        ninstr = 1;
+        break;
+    case VS10_COMMENT:
+        vs10_transstring.append( comment );
+        return 0;
+        break;
+    case VS10_HEADER:
+        //vs10_transstring.append( "!!VP1.0\n" );
+        return 0;
+        break;
+    case -1:
+        vs10_transstring.append( "\n" );
+        return 0;
+    default:
+        errors.set( "VS10Inst::Translate() Internal Error: unknown instruction type\n" );
+    }
+
+    vs10_transstring.append( ";\n" );
+    return ninstr;
+}
Index: /RenderSystems/GL/src/nvparse/vs1.0_inst.h
===================================================================
--- /RenderSystems/GL/src/nvparse/vs1.0_inst.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/vs1.0_inst.h	(revision 5)
@@ -0,0 +1,89 @@
+#ifndef _VS10INST_H
+#define _VS10INST_H
+
+#define VS10_ADD        1
+#define VS10_DP3        2
+#define VS10_DP4        3
+#define VS10_DST        4
+#define VS10_EXP        5
+#define VS10_EXPP       6
+#define VS10_FRC        7
+#define VS10_LIT        8
+#define VS10_LOG        9
+#define VS10_LOGP       10
+#define VS10_M3X2       11
+#define VS10_M3X3       12
+#define VS10_M3X4       13
+#define VS10_M4X3       14
+#define VS10_M4X4       15
+#define VS10_MAD        16
+#define VS10_MAX        17
+#define VS10_MIN        18
+#define VS10_MOV        19
+#define VS10_MUL        20
+#define VS10_NOP        21
+#define VS10_RCP        22
+#define VS10_RSQ        23
+#define VS10_SGE        24
+#define VS10_SLT        25
+#define VS10_SUB        26
+#define VS10_COMMENT    27
+#define VS10_HEADER     28
+
+#define TYPE_TEMPORARY_REG          1
+#define TYPE_VERTEX_ATTRIB_REG      2
+#define TYPE_ADDRESS_REG            3
+#define TYPE_CONSTANT_MEM_REG       4
+#define TYPE_CONSTANT_A0_REG        5
+#define TYPE_CONSTANT_A0_OFFSET_REG 6
+#define TYPE_POSITION_RESULT_REG    7
+#define TYPE_COLOR_RESULT_REG       8
+#define TYPE_TEXTURE_RESULT_REG     9
+#define TYPE_FOG_RESULT_REG         10
+#define TYPE_POINTS_RESULT_REG      11
+
+class VS10Reg {
+public:
+//    VS10Reg();
+//    VS10Reg(const VS10Reg &r);
+//	VS10Reg& operator=(const VS10Reg &r);
+	void Init();
+    void Translate();
+    int type;
+    int index;
+	int sign;
+    char mask[4];
+
+    int ValidateIndex();
+};
+
+typedef class VS10Inst {
+public:
+	~VS10Inst();
+	VS10Inst();
+	VS10Inst(int currline);
+	VS10Inst(const VS10Inst &inst);
+    VS10Inst& operator=(const VS10Inst &inst);
+	VS10Inst(int currline, int inst);
+	VS10Inst(int currline, int inst, char *cmt);
+	VS10Inst(int currline, int inst, VS10Reg dreg, VS10Reg src0);
+	VS10Inst(int currline, int inst, VS10Reg dreg, VS10Reg src0, VS10Reg src1);
+	VS10Inst(int currline, int inst, VS10Reg dreg, VS10Reg src0, VS10Reg src1, VS10Reg src2);
+    void Validate( int &vsflag );
+	int Translate();
+	VS10Reg dst;
+    VS10Reg src[3];
+private:
+    int line;
+    int instid;
+    char *comment;
+    void ValidateRegIndices();
+    void ValidateDestMask();
+    void ValidateSrcMasks();
+    void ValidateDestWritable();
+    void ValidateSrcReadable();
+    void ValidateReadPorts();
+
+} *VS10InstPtr;
+
+#endif
Index: /RenderSystems/GL/src/nvparse/vs1.0_inst_list.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/vs1.0_inst_list.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/vs1.0_inst_list.cpp	(revision 5)
@@ -0,0 +1,314 @@
+#include "vs1.0_inst_list.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <string>
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+#include <string.h>
+#include <OgreGLPrerequisites.h>
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#	include <OpenGL/glu.h>
+#else
+#	include <GL/glu.h>
+#endif
+
+using namespace std;
+
+extern string vs10_transstring;
+
+#define MAX_NUM_INSTRUCTIONS    128
+#define INSTRUCTION_LIST_INC    128
+
+VS10InstList::VS10InstList()
+{
+	size = 0;
+	max = INSTRUCTION_LIST_INC;
+    list = new VS10Inst[max];
+}
+
+VS10InstList::~VS10InstList()
+{
+    delete [] list;
+}
+
+int VS10InstList::Size()
+{
+	return size;
+}
+
+VS10InstList& VS10InstList::operator+=(VS10InstPtr t)
+{
+	if (size == max) {
+		// Extend list size by increment amount.
+        VS10InstPtr newlist;
+		max += INSTRUCTION_LIST_INC;
+        newlist = new VS10Inst[max];
+        for ( int i = 0; i < size; i++ )
+            newlist[i] = list[i];
+        delete [] list;
+        list = newlist;
+	}
+	list[size++] = *t;
+	return *this;
+}
+
+void VS10InstList::Translate()
+{
+    int ntranslated = 0;
+
+    vs10_transstring.append( "!!VP1.0\n" );
+	for (int i = 0; i < size; i++)
+        {
+	    ntranslated += list[i].Translate();
+	    }
+    vs10_transstring.append( "END\n" );
+
+    if ( ntranslated > 128 )
+    {
+        char str[256];
+        sprintf( str, "Vertex Shader had more than 128 instructions. (Converted to: %d)\n", ntranslated );
+        errors.set( str );
+    }
+    //fprintf( stderr, "Converted vertex shader to vertex program with %d instructions.\n\n", ntranslated );
+}
+
+void VS10InstList::Validate()
+{
+    int vsflag = 0;
+    for ( int i = 0; i < size; i++ )
+        {
+        list[i].Validate( vsflag );
+        }
+}
+
+
+
+namespace
+{
+	void LoadProgram( GLenum target, GLuint id, char *instring );
+	void StrToUpper(char * string);
+	int vpid;
+}
+
+
+
+bool is_vs10(const char *s)
+{
+    int len;
+    char *temp;
+    bool vshader_flag;
+
+    temp = NULL;
+    len = strlen(s);
+    if ( len > 0 )
+        temp = new char [len+1];
+    for ( int k = 0; k < len; k++ )
+    {
+        temp[k] = (char) tolower( (char) s[k] );
+    }
+    if ( len == 0 )
+        vshader_flag = false;
+    else
+    {
+        vshader_flag = ( NULL != strstr(temp, "vs.1.0") ) ||
+                       ( NULL != strstr(temp, "vs.1.1") );
+        delete [] temp;
+    }
+    return vshader_flag;
+}
+
+bool vs10_init_more()
+{
+	static bool vpinit = false;
+	if (vpinit == false )
+	{
+      /*
+		if(! glh_init_extensions("GL_NV_vertex_program"))
+		{
+			errors.set("unable to initialize GL_NV_vertex_program");
+			return false;
+		}
+		else
+		{
+        */
+			vpinit = true;
+            /*
+		}
+        */
+	}
+	
+	glGetIntegerv( GL_VERTEX_PROGRAM_BINDING_NV, &vpid );
+	
+	if ( vpid == 0 )
+	{
+		char str[128];
+		sprintf( str, "No vertex program id bound for nvparse() invocation.  Bound id = %d\n", vpid );
+		errors.set( str );
+		return false;
+	}
+    errors.reset();
+    line_number = 1;
+    vs10_transstring = "";
+	return true;	
+}
+
+void vs10_load_program()
+{
+    // Only load the program if no errors occurred.
+    if ( errors.get_num_errors() == 0 )
+    	LoadProgram( GL_VERTEX_PROGRAM_NV, vpid, (char *) vs10_transstring.c_str() );
+}
+
+
+namespace
+{
+	//.----------------------------------------------------------------------------.
+	//|   Function   : LoadProgram                                                 |
+	//|   Description: Load a program into GL, and report any errors encountered.  |
+	//.----------------------------------------------------------------------------.
+	void LoadProgram( GLenum target, GLuint id, char *instring )
+	{
+		GLint  errPos;
+		GLenum errCode;
+		const GLubyte *errString;
+		
+		int len = strlen(instring);
+		glLoadProgramNV( target, id, len, (const GLubyte *) instring );
+		if ( (errCode = glGetError()) != GL_NO_ERROR )
+		{
+			errString = gluErrorString( errCode );
+			
+			glGetIntegerv( GL_PROGRAM_ERROR_POSITION_NV, &errPos );
+			
+			int nlines = 1;
+			int nchar  = 1;
+			int i;
+			for ( i = 0; i < errPos; i++ )
+			{
+				if ( instring[i] == '\n' )
+				{
+					nlines++;
+					nchar = 1;
+				}
+				else
+				{
+					nchar++;
+				}
+			}
+			int start;
+			int end;
+			int flag = ((instring[errPos]==';') | (instring[errPos-1]==';')) ? 1 : 0;
+			for ( i = errPos; i >= 0; i-- )
+			{
+				start = i;
+				if ( flag && (start >= errPos-1)  )
+					continue;
+				if ( instring[i] == ';' )
+				{
+					if ( !flag )
+					{
+						start = i+1;
+						if ( instring[start] == '\n' )
+							start++;
+					}
+					break;
+				}
+			}
+			for ( i = errPos; i < len; i++ )
+			{
+				end = i;
+				if ( instring[i] == ';' && end > start)
+				{
+					break;
+				}
+			}
+			if ( errPos - start > 30 )
+			{
+				start = errPos - 30;
+			}
+			if ( end - errPos > 30 )
+			{
+				end = errPos + 30;
+			}
+			
+			char substring[96];
+			memset( substring, 0, 96 );
+			strncpy( substring, &(instring[start]), end-start+1 );
+			char str[256];
+			//sprintf( str, "error at line %d character %d\n    \"%s\"\n", nlines, nchar, substring );
+			sprintf( str, "error at line %d character %d\n\"%s\"\n", nlines, nchar, substring );
+			int width = errPos-start;
+			for ( i = 0; i < width; i++ )
+			{
+				strcat( str, " " );
+			}
+			strcat( str, "|\n" );
+			for ( i = 0; i < width; i++ )
+			{
+				strcat( str, " " );
+			}
+			strcat( str, "^\n" );
+			
+			errors.set( str );
+		}
+	}
+	
+	
+	//.----------------------------------------------------------------------------.
+	//|   Function   : StrToUpper                                                  |
+	//|   Description: Converts all lowercase chars in a string to uppercase.      |
+	//.----------------------------------------------------------------------------.
+	void StrToUpper(char *string)
+	{
+		for (unsigned int i = 0; i < strlen(string); i++)
+			string[i] = toupper(string[i]);
+	}
+	
+}
+
+/*
+    else if ( is_vs10(instring) )
+    {
+        if (vpinit == 0 )
+        {
+            if(! glh_init_extensions("GL_NV_vertex_program"))
+            {
+                errors.set("unable to initialize GL_NV_vertex_program");
+                free(instring);
+                return;
+            }
+            else
+            {
+                vpinit = 1;
+            }
+        }
+
+        if ( glGetError() != GL_NO_ERROR )
+        {
+            errors.set( "Previous GL_ERROR prior to vertex shader parsing.\n" );
+        }
+
+        int vpid;
+        glGetIntegerv( GL_VERTEX_PROGRAM_BINDING_NV, &vpid );
+        
+        if ( vpid == 0 )
+        {
+            char str[128];
+            sprintf( str, "No vertex program id bound for nvparse() invocation.  Bound id = %d\n", vpid );
+            errors.set( str );
+        }
+        else
+        {
+            errors.reset();
+            line_number = 1;
+            vs10_init(instring);
+            vs10_transstring = "";
+            vs10_parse();
+            //fprintf( stderr, "Converted text:\n%s\n\n\n", vs10_transstring.c_str() );
+            LoadProgram( GL_VERTEX_PROGRAM_NV, vpid, (char *) vs10_transstring.c_str() );
+        }
+        
+    }
+
+*/
Index: /RenderSystems/GL/src/nvparse/vs1.0_inst_list.h
===================================================================
--- /RenderSystems/GL/src/nvparse/vs1.0_inst_list.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/vs1.0_inst_list.h	(revision 5)
@@ -0,0 +1,25 @@
+#ifndef _VS10_H
+#define _VS10_H
+
+#define WRITEMASK_X		0x01
+#define WRITEMASK_Y		0x02
+#define WRITEMASK_Z		0x04
+#define WRITEMASK_W		0x08
+
+#include "vs1.0_inst.h"
+
+typedef class VS10InstList {
+public:
+	VS10InstList();
+	~VS10InstList();
+	int Size();
+	VS10InstList& operator+=(VS10InstPtr t);
+	void Validate();
+	void Translate();
+private:
+    VS10InstPtr list;
+    int size;
+    int max;
+} *VS10InstListPtr;
+
+#endif
Index: /RenderSystems/GL/src/nvparse/vs1.0_tokens.l
===================================================================
--- /RenderSystems/GL/src/nvparse/vs1.0_tokens.l	(revision 5)
+++ /RenderSystems/GL/src/nvparse/vs1.0_tokens.l	(revision 5)
@@ -0,0 +1,2942 @@
+%option prefix="vs10_"
+
+%x INCLUDE DEFINE DEFSTR DEFSPACE SKIPLINE EATCOMMENT EATSTRING SAVELINE 
+%x MACRONAME MACROBODY MACROPARM EATMACRO EATDEFINE MODIFIER MACROPARMSTART
+%x IFDEFNAME IFDEFBODY ENDMACRO MACROPARMEND
+
+%{
+
+#include <stdarg.h>
+#include <stdlib.h>
+#ifdef _WIN32
+#include <io.h>
+#  ifdef __GNUC__
+#    include <sys/types.h>
+#    include <ctype.h>
+#  endif
+#else
+#include <sys/types.h>
+#include <ctype.h>
+#define _stat stat
+#define _open open
+#define _O_RDONLY O_RDONLY
+#define _fstat fstat
+#define _close close
+#define stricmp strcasecmp
+
+#endif
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include "macro.h"
+#include "nvparse_errors.h"
+#include "vs1.0_inst_list.h"
+#include "_vs1.0_parser.h"
+#define yylineno line_number
+#include "nvparse_externs.h"
+
+#define yylineno line_number
+int line_incr;
+void LexError(char *format, ...);
+void LexWarning(char *format, ...);
+char *ReadTextFile(const char * filename);
+
+unsigned int MakeRegisterMask(char *findName);
+unsigned int FindSwizzleValue(char *swizzleText);
+
+
+enum ERROR_VALUES {
+	ERROR_NONE = 0,
+	ERROR_MEMORY_ALLOC,
+	ERROR_FILE_OPEN,
+	ERROR_UNSUCCESSFUL_ASSEMBLE,
+	ERROR_TOO_MANY_PARMS,
+	ERROR_DEST_WRITE,
+	ERROR_LIST_OPEN,
+	ERROR_DEST_OPEN,
+	ERROR_NO_ARGUMENTS,
+	ERROR_MACRO_OVERRUN
+};
+
+
+
+//extern void GenSwitchFileNames(char *fileName);
+//extern unsigned int gLinesAssembled;
+unsigned int gLinesAssembled;
+
+#define YY_INPUT(buf,result,max_size) \
+{ \
+	int c = *myin++; \
+	result = (c == 0) ? YY_NULL : (buf[0] = c, 1); \
+}
+
+#define SAFEDELETEARRAY(x) if ((x) != NULL) \
+						delete [] (x)
+#define SAFEFREE(x) if ((x) != NULL) \
+						free((x))
+
+#define MAXREPLACESTRING 255
+
+char gReplaceText[MAXREPLACESTRING+1];
+
+//
+// forward prototypes for macro functions
+//
+void MacroIncFunction(char *, unsigned int *, char **);
+void MacroDecFunction(char *, unsigned int *, char **);
+void MacroAddFunction(char *, unsigned int *, char **);
+void MacroSubFunction(char *, unsigned int *, char **);
+
+MACROFUNCTIONS gMacroFunctions[] = { 
+	{ "inc(", MacroIncFunction },
+	{ "dec(", MacroDecFunction },
+	{ "add(", MacroAddFunction },
+	{ "sub(", MacroSubFunction }
+};
+
+#define NUM_MACRO_FUNCTIONS (sizeof(gMacroFunctions) / sizeof(MACROFUNCTIONS))
+
+#define MAX_INCLUDE_DEPTH 1024
+typedef struct INCLUDEINFO
+{
+	char	*fileName;
+	unsigned int lineNo;
+	YY_BUFFER_STATE buffer;
+	MACROENTRY *lastInvokeMacro;				// save off in case nested macros.
+	MACROENTRY *lastParseMacro;				// recursive macros
+	MACROTEXT *lastMacroLineParse;			// save off for recursive lines of macros working on.
+	bool lastbInsideMacro;					// save off for recursive macros
+	bool lastbInsideDefine;					// save off for recursive macros/defines
+	bool lastbInsideInclude;
+	bool lastbProcessingIFDEF; 				// save off #define information
+//	FILE *fileHandle;
+	char *prevString;
+	char *nextString;
+} INCLUDEINFO;
+
+INCLUDEINFO gIncludeStack[MAX_INCLUDE_DEPTH];
+int gIncludeStackIndex = 0;
+
+IFDEFINFO gIfDefStack[MAX_IFDEF_DEPTH];
+int gIfDefStackIndex = 0;
+
+unsigned int &base_linenumber = gIncludeStack[0].lineNo;
+
+bool gbInsideInclude = false;
+bool gbProcessingBuiltIn = false;
+bool gbProcessingDefine = false;
+unsigned int gCountParen = 0;
+
+bool gbProcessingIFDEF = false;
+bool gbIFDEF = false;
+bool gbCompareDefine = false;
+unsigned int gIfDefStartLine;
+
+
+MACROENTRY *gLastMacro;
+MACROENTRY *gInvokeMacro;
+MACROENTRY *gTempMacro;					// until all the parameters are read
+MACROENTRY *FindMacro(char *macroName);
+MACROENTRY *FindNMacro(char *macroName, unsigned int sLen);
+
+MACROFUNCTIONPTR gMacroCallFunction;
+
+char *builtInMacros =	"macro m3x2 reg1, reg2, reg3\n"
+						"	dp3	%reg1.x, %reg2, %reg3\n"
+						"	dp3 %reg1.y, %reg2, %inc(%reg3)\n"
+						"endm";
+
+//
+// local prototypes
+//
+void CleanUp();
+void ReplaceMacroParms(char *srcLine, char *destLine, 
+							MACROENTRY *srcParms, MACROENTRY *invParms);
+
+MACROTEXT *SaveMacroText(char *srcText, MACROTEXT *lastMacroText);
+void FreeMacroEntry(MACROENTRY *macEntry);
+void EndMacroParms();
+char *FindAlphaNum(char *srcStr, unsigned int *sLen);
+void DebugUnhandledState();
+
+
+unsigned int gCommentStartLine;
+unsigned int gMacroStartLine;
+
+char *gCurFileName = NULL;
+
+#define MAXSAVELINE 4095
+
+char gSaveLine[MAXSAVELINE+1];
+char gMacroLine[MAXSAVELINE+1];
+
+#if 1
+#ifdef _DEBUG
+#define ECHO DebugUnhandledState();
+#else
+#define ECHO
+#endif
+#endif
+
+bool gbInsideMacro = false;		// flag if we are doing a macro replace or not.
+bool gbTempInsideMacro = false;
+unsigned int gInvokeState = INITIAL;
+
+
+MACROENTRY *gParseMacro;		// which source macro entry we are using
+MACROENTRY *gTempParseMacro;	// temporary holder until parameters are received.
+MACROTEXT *gMacroLineParse;		// which line we are currently parsing inside the macro invocation
+
+typedef enum OPCODETYPE
+{
+	TYPE_NONE = 0,
+	TYPE_VERTEX_SHADER = 1,
+	TYPE_PIXEL_SHADER = 2
+};
+typedef struct OPCODEMAP
+{
+	char *string;				// string for opcode
+	int tokenName;              // name of the corresponding token
+	int numArguments;			// number of arguments for opcode
+	float version;				// minimum version supported in.
+	int opcodeTypeFlags;		// whether opcode can be used in vertex shader or pixel shader
+	bool opcodeModify;			// if opcode modifiers can be used
+	bool textureOpcode;			// only outputs to the texture unit
+} OPCODEMAP;
+
+#ifndef TRUE
+#define TRUE true
+#endif
+#ifndef FALSE
+#define FALSE false
+#endif
+
+OPCODEMAP theOpcodes[] = {
+	{ "add",  ADD_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER | TYPE_PIXEL_SHADER, TRUE, FALSE },
+	{ "dp3",  DP3_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER | TYPE_PIXEL_SHADER, TRUE, FALSE },
+	{ "dp4",  DP4_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "dst",  DST_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "exp",  EXP_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "expp", EXPP_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "frc",  FRC_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "lit",  LIT_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "log",  LOG_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "logp", LOGP_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "m3x2", M3X2_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "m3x3", M3X3_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "m3x4", M3X4_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "m4x3", M4X3_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "m4x4", M4X4_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "mad",  MAD_INSTR, 4, 1.0f, TYPE_VERTEX_SHADER | TYPE_PIXEL_SHADER, TRUE, FALSE },
+	{ "max",  MAX_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "min",  MIN_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "mov",  MOV_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER | TYPE_PIXEL_SHADER, TRUE, FALSE },
+	{ "mul",  MUL_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER | TYPE_PIXEL_SHADER, TRUE, FALSE },
+	{ "nop",  NOP_INSTR, 0, 1.0f, TYPE_VERTEX_SHADER | TYPE_PIXEL_SHADER, TRUE, FALSE },
+	{ "rcp",  RCP_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "rsq",  RSQ_INSTR, 2, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "sge",  SGE_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "slt",  SLT_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER, FALSE, FALSE },
+	{ "sub",  SUB_INSTR, 3, 1.0f, TYPE_VERTEX_SHADER | TYPE_PIXEL_SHADER, TRUE, FALSE },
+};
+
+#define NUMOPCODES (sizeof(theOpcodes) / sizeof(OPCODEMAP))
+OPCODEMAP *FindOpcode(char *findName);
+
+
+%}
+
+digits	([0-9]+)
+digit	([0-9])
+pt	"."
+sign		[+-]?
+exponent	([eE]{sign}{digits})
+alpha [a-zA-Z_]
+alphadigs [a-zA-Z0-9_]
+notAlphaDigs ([^a-zA-Z0-9_])
+
+identifier		{alpha}{alphadigs}*
+
+
+%%
+
+<SAVELINE>.*\n {
+	gbProcessingDefine = false;
+	gSaveLine[0] = '\0';
+	strncat(gSaveLine, yytext, MAXSAVELINE);
+//	GenDebugLine();
+	if (gbProcessingIFDEF && (gbCompareDefine != gbIFDEF))
+	{
+		BEGIN(IFDEFBODY);
+	}
+	else
+	{
+		BEGIN(INITIAL);
+	}
+	yyless(0);
+}
+
+<SAVELINE>.* {
+	gbProcessingDefine = false;
+	gSaveLine[0] = '\0';
+	strncat(gSaveLine, yytext, MAXSAVELINE);
+//	GenDebugLine();
+	if (gbProcessingIFDEF && (gbCompareDefine != gbIFDEF))
+	{
+		BEGIN(IFDEFBODY);
+	}
+	else
+	{
+		BEGIN(INITIAL);
+	}
+	yyless(0);
+}
+
+a{digits}[ \t]*[\n]?	{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_ADDRESS_REG;
+	vs10_lval.reg.index = atoi(&yytext[1]);
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+
+v{digits}[ \t]*[\n]?	{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_VERTEX_ATTRIB_REG;
+	vs10_lval.reg.index = atoi(&yytext[1]);
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+
+r{digits}[ \t]*[\n]?	{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_TEMPORARY_REG;
+	vs10_lval.reg.index = atoi(&yytext[1]);
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+
+c{digits}[ \t]*[\n]?	{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_CONSTANT_MEM_REG;
+	vs10_lval.reg.index = atoi(&yytext[1]);
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+
+oT{digits}[ \t]*[\n]?	{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_TEXTURE_RESULT_REG;
+	vs10_lval.reg.index = atoi(&yytext[2]);
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+
+oD{digits}[ \t]*[\n]?	{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_COLOR_RESULT_REG;
+	vs10_lval.reg.index = atoi(&yytext[2]);
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+
+oFog[ \t]*[\n]?	{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_FOG_RESULT_REG;
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+
+oPos[ \t]*[\n]?	{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_POSITION_RESULT_REG;
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+
+oPts[ \t]*[\n]?	{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.reg.type = TYPE_POINTS_RESULT_REG;
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return REGISTER;
+}
+
+[a-zA-Z][a-zA-Z0-9]+[ \t\n_] {
+
+	unsigned int offset;
+	
+    offset = strcspn(yytext, " \t\n_");
+	yyless(offset);
+
+	OPCODEMAP *opcodeMap = FindOpcode(yytext);
+	if ( opcodeMap != NULL )
+	{
+//		fprintf( stderr, "%s\t", opcodeMap->string );
+		return( opcodeMap->tokenName );
+	}
+	else
+	{
+		gTempParseMacro = FindMacro(yytext);
+
+		if (gTempParseMacro != NULL)
+		{
+			if (gIncludeStackIndex >= MAX_INCLUDE_DEPTH )
+			{
+				LexError("macros nested too deeply");
+				exit( 1 );
+			}
+
+			if (gTempParseMacro->firstMacroLines != NULL)
+			{
+
+				gTempMacro = (MACROENTRY *)malloc(sizeof(MACROENTRY));
+				if (gTempMacro == NULL)
+				{
+					LexError("Out of memory allocating MACROENTRY structure.\n");
+				}
+				else
+				{
+
+					gTempMacro->next = NULL;
+					gTempMacro->prev = NULL;
+					gTempMacro->macroName = NULL;
+					gTempMacro->firstMacroParms = NULL;
+					gTempMacro->lastMacroParms = NULL;
+					gTempMacro->firstMacroLines = NULL;
+					gTempMacro->lastMacroLines = NULL;
+					gTempMacro->numParms = 0;
+					gTempMacro->nLines = 0;
+
+					gbTempInsideMacro = true;		// flag we are currently doing a macro replace.
+					gInvokeState = YYSTATE;
+					if (gTempParseMacro->numParms > 0)
+					{
+						BEGIN(MACROPARMSTART);
+					}
+					else
+					{
+						EndMacroParms();
+						gbTempInsideMacro = false;	// no longer waiting for macro invocation
+					}
+
+					
+				}
+			}
+		}
+		else
+		{
+//			fprintf( stderr, "Opcode: \"%s\" not found\n", yytext );
+			REJECT;
+		}
+	}
+
+	//unsigned int offset;
+	//
+	//INSTRMAP *opcodeMap;
+	//
+	//offset = strcspn(yytext, " \t\n_");
+	//yyless(offset);	
+	//opcodeMap = FindInstruction(yytext);
+	//if (opcodeMap == NULL)
+	//{
+	//	REJECT;
+	//}
+	//
+	//yylval.opcodeInfo.opcodeMap = opcodeMap;
+	//
+	//return OPCODE;
+}
+
+
+";".*  {
+//	fprintf( stderr, "%s", yytext );
+	char *cmt = new char[yyleng+1];
+	strncpy( cmt, yytext, yyleng );
+	cmt[0] = '#';
+	cmt[yyleng] = '\0';
+	vs10_lval.comment = cmt;
+	return COMMENT;
+}
+
+"//".* {
+//	fprintf( stderr, "%s", yytext );
+	char *cmt = new char[yyleng+1];
+	strncpy( cmt+1, yytext+1, yyleng-1 );
+	cmt[0] = '#';
+	cmt[1] = ' ';
+	cmt[yyleng] = '\0';
+	vs10_lval.comment = cmt;
+	return COMMENT;
+}
+
+"+"[ \t]*\n {
+	fprintf( stderr, "COISSUE found\n" );
+	yyless(yyleng-1);
+	//return COISSUE;
+}
+
+^[ \t]*"+"[ \t]* {
+	fprintf( stderr, "COISSUE found\n" );
+	//return COISSUE;
+}
+
+<INITIAL,MACROBODY>"/*" {
+	gCommentStartLine = yylineno;
+	yyless(0);
+	BEGIN(EATCOMMENT);
+}
+
+"#include"[ \t]+ { 
+	BEGIN(INCLUDE);
+}
+
+<INCLUDE>[^ \t].*\n {	/* got the include file name */
+
+//	FILE *newyyin;
+char *newyyin;
+	char incFileName[1024];
+	unsigned long sLen;
+	bool validFileName;
+
+	if ( gIncludeStackIndex >= MAX_INCLUDE_DEPTH )
+	{
+		LexError("Includes nested too deeply, aborting\n");
+		exit( 1 );
+	}
+
+//	GenDebugLine();
+//	GenListString();
+	yylineno++;
+	gLinesAssembled++;
+
+	validFileName = true;
+	// zap "" and <>
+	if ((yytext[0] == '"') || (yytext[0] == '<'))
+	{
+		char *endQuote;
+		endQuote = strchr(&yytext[1], yytext[0]);
+		sLen = (endQuote - yytext)-1;
+		if (endQuote == NULL)
+		{
+			LexError("Unable to open include file %s\n", incFileName);
+			BEGIN(INITIAL);
+			validFileName = false;
+		}
+		else
+		{
+			incFileName[0] ='\0';
+			strncat(incFileName, &yytext[1], sLen);
+		}
+	}
+	else
+	{
+		strcpy(incFileName, yytext);
+	}
+
+	if (validFileName)
+	{
+		sLen = strlen(incFileName);
+		if ((incFileName[sLen-1] == '"') || (incFileName[sLen-1] == '>'))
+		{
+			incFileName[sLen-1] = '\0';
+		}
+
+
+		newyyin = ReadTextFile( incFileName );
+//		newyyin = fopen( incFileName, "r" );
+
+		if ( ! newyyin )
+		{
+			LexError("Unable to open include file %s\n", incFileName);
+			BEGIN(SAVELINE);
+		}
+		else
+		{
+			gIncludeStack[gIncludeStackIndex].fileName = gCurFileName;
+			gIncludeStack[gIncludeStackIndex].lineNo = yylineno;
+//			gIncludeStack[gIncludeStackIndex].fileHandle = yyin;
+			gIncludeStack[gIncludeStackIndex].prevString = myin;
+			gIncludeStack[gIncludeStackIndex].nextString = newyyin;
+			gIncludeStack[gIncludeStackIndex].lastInvokeMacro = gInvokeMacro;
+			gIncludeStack[gIncludeStackIndex].lastParseMacro = gParseMacro;
+			gIncludeStack[gIncludeStackIndex].lastMacroLineParse = gMacroLineParse;
+			gIncludeStack[gIncludeStackIndex].lastbInsideMacro = gbInsideMacro;
+			gIncludeStack[gIncludeStackIndex].lastbInsideInclude = gbInsideInclude;
+			gIncludeStack[gIncludeStackIndex].buffer = YY_CURRENT_BUFFER;
+			gIncludeStack[gIncludeStackIndex].lastbProcessingIFDEF = gbProcessingIFDEF;
+			gIncludeStackIndex++;
+
+			gbProcessingIFDEF = false;
+
+			gCurFileName = strdup(incFileName);
+//			yyin = newyyin;
+			myin = newyyin;
+
+//			GenSwitchFileNames(gCurFileName);
+
+			yylineno = 1;
+
+			yy_switch_to_buffer(yy_create_buffer( yyin, YY_BUF_SIZE ) );
+
+			gbInsideInclude = true;
+
+			BEGIN(SAVELINE);
+		}
+	}
+}
+
+<EATCOMMENT><<EOF>> {
+	LexError("End of file reached before end of comment started on line %d.\n", gCommentStartLine);
+	BEGIN(INITIAL);
+}
+
+<EATCOMMENT>.*\n {
+	char *endComment;
+	unsigned int keepSize;
+
+	strcpy(gSaveLine, yytext);
+	endComment = strstr(yytext, "*/");
+
+	char *cmt;
+	if (endComment != NULL)
+	{
+		keepSize = (endComment - yytext+2);
+		yyless(keepSize);
+		BEGIN(INITIAL);
+
+		if ( yytext[0] == '/' && yytext[1] == '*' )
+		{
+			cmt = new char[yyleng];
+			strncpy( cmt+3, yytext+2, yyleng-2 );
+			cmt[0] = '#';
+			cmt[1] = ' ';
+			cmt[2] = ' ';
+			cmt[yyleng-1] = '\0';
+		}
+		else
+		{
+			cmt = new char[yyleng];
+			strncpy( cmt+1, yytext, yyleng-2 );
+			cmt[0] = '#';
+			cmt[yyleng-1] = '\0';
+		}
+		vs10_lval.comment = cmt;
+		return COMMENT;
+	}
+	else
+	{
+//		GenDebugLine();
+//		GenListString();
+		gLinesAssembled++;
+		yylineno++;
+
+		if ( yytext[0] == '/' && yytext[1] == '*' )
+		{
+			cmt = new char[yyleng+2];
+			strncpy( cmt+3, yytext+2, yyleng-2 );
+			cmt[0] = '#';
+			cmt[1] = ' ';
+			cmt[2] = ' ';
+			cmt[yyleng+1] = '\0';
+		}
+		else
+		{
+			cmt = new char[yyleng+2];
+			strncpy( cmt+1, yytext, yyleng );
+			cmt[0] = '#';
+			cmt[yyleng+1] = '\0';
+		}
+		vs10_lval.comment = cmt;
+		return COMMENT;
+	}
+}
+
+<DEFSTR><<EOF>> {
+	LexError("#define was incomplete before end of file\n");
+	BEGIN(INITIAL);
+}
+
+<DEFINE><<EOF>> {
+	LexError("#define was incomplete before end of file\n");
+	BEGIN(INITIAL);
+}
+
+<DEFSPACE><<EOF>> {
+	LexError("#define was incomplete before end of file\n");
+	BEGIN(INITIAL);
+}
+
+<INCLUDE><<EOF>> {
+	LexError("#include was incomplete before end of file\n");
+	BEGIN(INITIAL);
+}
+
+<MACROBODY><<EOF>> {
+	LexError("End of file reached before end of #define or endm was found, macro started on line %d.\n", gMacroStartLine);
+	BEGIN(INITIAL);
+}
+
+<IFDEFBODY><<EOF>> {
+	LexError("End of file reached before #endif found, macro started on line %d.\n", gIfDefStartLine);
+	BEGIN(INITIAL);
+}
+
+<DEFSTR>\n {
+	LexError("#define was incomplete before end of line\n");
+	BEGIN(SAVELINE);
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+
+<DEFINE>\n {
+	LexError("#define was incomplete before end of line\n");
+	BEGIN(SAVELINE);
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+
+<DEFSPACE>\n {
+	LexError("#define was incomplete before end of line\n");
+	BEGIN(SAVELINE);
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+
+"#ifdef"[ \t]+ {
+	if (gIfDefStackIndex >= MAX_IFDEF_DEPTH)
+	{
+		LexError("Out of stack space for #ifdef, aborting.\n");
+		exit( 1 );
+	}
+	else
+	{
+		gIfDefStack[gIfDefStackIndex].lastbProcessingIFDEF = gbProcessingIFDEF;
+		gIfDefStack[gIfDefStackIndex].lastbIFDEF = gbIFDEF;
+		gIfDefStack[gIfDefStackIndex].lastbCompareDefine = gbCompareDefine;
+		gIfDefStack[gIfDefStackIndex].lastIfDefStartLine = gIfDefStartLine;
+		gIfDefStackIndex++;
+		gIfDefStartLine = yylineno;
+
+		gbCompareDefine = true;
+		BEGIN(IFDEFNAME);
+	}
+}
+
+"#ifndef"[ \t]+ {
+	if (gIfDefStackIndex >= MAX_IFDEF_DEPTH)
+	{
+		LexError("Out of stack space for #ifdef, aborting.\n");
+		exit( 1 );
+	}
+	else
+	{
+		gIfDefStack[gIfDefStackIndex].lastbProcessingIFDEF = gbProcessingIFDEF;
+		gIfDefStack[gIfDefStackIndex].lastbIFDEF = gbIFDEF;
+		gIfDefStack[gIfDefStackIndex].lastbCompareDefine = gbCompareDefine;
+		gIfDefStack[gIfDefStackIndex].lastIfDefStartLine = gIfDefStartLine;
+		gIfDefStackIndex++;
+		gIfDefStartLine = yylineno;
+
+		gbCompareDefine = false;
+		BEGIN(IFDEFNAME);
+	}
+}
+
+<INITIAL,IFDEFBODY>"#else"[ \t]*((";"|"//").*)* {
+	if (!gbProcessingIFDEF)
+	{
+		LexError("Unexpected #else found at line %d, skipping.\n", yylineno);
+	}
+	else
+	{
+		gbCompareDefine = !gbCompareDefine;
+		BEGIN(INITIAL);
+	}
+}
+
+<IFDEFNAME>.*\n {
+	char *defineName;
+	unsigned int sLen;
+
+
+	defineName = FindAlphaNum(yytext, &sLen);
+	if (defineName == NULL)
+	{
+		defineName = strdup(yytext);
+		defineName[yyleng-1] = '\0';	// kill \n
+		LexWarning("Mangled name (%s) for #ifdef, assuming not defined.\n", defineName);
+		free(defineName);
+		gbIFDEF = false;
+	}
+	else
+	{
+		if (FindNMacro(defineName, sLen) != NULL)
+		{
+			gbIFDEF = true;
+		}
+		else
+		{
+			gbIFDEF = false;
+		}
+	}
+
+	gbProcessingIFDEF = true;
+	if (gbIFDEF != gbCompareDefine)
+	{
+		BEGIN(IFDEFBODY);
+	}
+	else
+	{
+		BEGIN(SAVELINE);
+	}
+
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+
+<INITIAL,IFDEFBODY>[ \t]*"#endif"[ \t]*((";"|"//").*)* {
+	if (!gbProcessingIFDEF)
+	{
+		LexError("Unexpected #endif found at line %d, skipping.\n", yylineno);
+	}
+	else
+	{
+		gIfDefStackIndex--;
+		gbProcessingIFDEF = gIfDefStack[gIfDefStackIndex].lastbProcessingIFDEF;
+		gbIFDEF = gIfDefStack[gIfDefStackIndex].lastbIFDEF;
+		gbCompareDefine = gIfDefStack[gIfDefStackIndex].lastbCompareDefine;
+		gIfDefStartLine = gIfDefStack[gIfDefStackIndex].lastIfDefStartLine;
+
+	}
+
+	if (YYSTATE == IFDEFBODY)
+	{
+		strncpy(gSaveLine, yytext, MAXSAVELINE);
+	}
+
+	BEGIN(ENDMACRO);
+
+}
+
+<ENDMACRO>.* {
+	LexWarning("Garbage at end of #endif or endm will be ignored.\n");
+}
+
+<ENDMACRO>\n {
+	BEGIN(SAVELINE);
+	return '\n';
+}
+
+<ENDMACRO><<EOF>> {
+	BEGIN(INITIAL);
+}
+
+<IFDEFBODY>.* {
+	// eat line, because we are not in a TRUE #ifdef, or FALSE #ifndef
+	strncpy(gSaveLine, yytext, MAXSAVELINE);
+}
+
+<IFDEFBODY>\n {
+	strcat(gSaveLine, yytext);
+//	GenDebugLine();
+//	GenListString();
+	yylineno++;
+	gLinesAssembled++;
+}
+
+"#define"[ \t]+   { 
+	gbProcessingDefine = true;
+	gMacroStartLine = yylineno;
+	gCountParen = 0;
+	BEGIN(MACRONAME); 
+} 
+
+<SKIPLINE>.*\n	{
+	BEGIN(SAVELINE);
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+
+"vs."{digits}"."{digits}[ \t]*[\n]? {
+//	unsigned int majorVersion;
+//	unsigned int minorVersion;
+//	int minorOffset;
+//	
+//
+//	majorVersion = (unsigned int)(atoi(&yytext[3]));
+//	// skip "ps." + second '.'
+//	minorOffset = strcspn(&yytext[3], ".")+4;
+//	minorVersion = (unsigned int)(atoi(&yytext[minorOffset]));
+//	yylval.ival = D3DVS_VERSION(majorVersion, minorVersion);
+//
+
+//	fprintf( stderr, "%s", yytext );
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+	return VERTEX_SHADER;
+}
+
+{digits}	{ 
+//	fprintf( stderr, "%s", yytext );
+	vs10_lval.ival = atoi(yytext);
+	return INTVAL;
+}
+
+
+{pt} { 
+		BEGIN(MODIFIER);
+//fprintf( stderr, "." );
+		return yytext[0];
+}
+
+<MODIFIER>[w-z][w-z][w-z][w-z][ \t]*[\n]? {
+//	fprintf( stderr, "%s", yytext );
+	BEGIN(INITIAL);
+
+	vs10_lval.mask[0] = tolower(yytext[0]);
+	vs10_lval.mask[1] = tolower(yytext[1]);
+	vs10_lval.mask[2] = tolower(yytext[2]);
+	vs10_lval.mask[3] = tolower(yytext[3]);
+
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+
+	return XYZW_MODIFIER;
+
+#if 0
+ 	char temp[6];
+
+	temp[0] = '\0';
+	strncat(temp, yytext, 4);
+	strlwr(temp);
+	vs10_lval.lval = FindSwizzleValue(temp);
+
+	BEGIN(INITIAL);
+	return SWIZZLE_MODIFIER;
+#endif
+
+}
+
+<MODIFIER>[w-z][w-z]?[w-z]?[w-z]?[ \t]*[\n]? {
+//	fprintf( stderr, "%s", yytext );
+	BEGIN(INITIAL);
+
+	int validLen = strspn(yytext, "xyzw");
+        int i;
+	for ( i = 0; i < validLen; i++ )
+		vs10_lval.mask[i] = tolower( yytext[i] );
+	while ( i < 4 )
+	{
+		vs10_lval.mask[i] = 0;
+		i++;
+	}
+
+	if ( yytext[yyleng-1] == '\n' )
+		line_incr = 1;
+
+	return XYZW_MODIFIER;
+
+#if 0
+ 	//char temp[6];
+ 	char *temp = new char[6];
+	unsigned int registerMask;
+	unsigned int validLen;
+
+	temp[0] = '\0';
+	validLen = strspn(yytext, "xyzw");
+	strncat(temp, yytext,  validLen);
+	for ( int i = 0; i < validLen; i++ )
+		temp[i] = tolower( temp[i] );
+	registerMask = MakeRegisterMask(temp);
+
+	if (registerMask != 0)
+	{
+		//vs10_lval.sval = temp;
+		vs10_lval.lval = registerMask;
+		BEGIN(INITIAL);
+		return XYZW_MODIFIER;
+	}
+	else
+	{
+		//vs10_lval.sval = temp;
+		vs10_lval.lval = FindSwizzleValue(temp);
+		BEGIN(INITIAL);
+		return SWIZZLE_MODIFIER;	
+	}
+#endif
+}
+
+<MODIFIER>. {
+		BEGIN(INITIAL);
+		yyless(0);
+}
+
+<MACRONAME>[^ \t(]+ {
+	/* setup and save off #define/macro name */
+	if (FindMacro(yytext) != NULL)
+	{
+		LexWarning("Redefinition of #define/macro %s, ignoring.\n", yytext);
+		if (gbProcessingDefine)
+		{
+			BEGIN(EATDEFINE);
+		}
+		else
+		{
+			BEGIN(EATMACRO);
+		}
+	}
+	else
+	{
+
+		BEGIN(MACROPARMSTART);
+		// %%%%% This should be setup to use memory pools
+		gTempMacro = (MACROENTRY *)malloc(sizeof(MACROENTRY));
+		if (gTempMacro == NULL)
+		{
+			LexError("Out of memory for macro table.\n");
+			if (gbProcessingDefine)
+			{
+				BEGIN(EATDEFINE);
+			}
+			else
+			{
+				BEGIN(EATMACRO);
+			}
+		}
+		else
+		{
+			gTempMacro->prev = gLastMacro;
+			gTempMacro->next = NULL;
+
+			gTempMacro->firstMacroParms = NULL;
+			gTempMacro->lastMacroParms = NULL;
+			gTempMacro->firstMacroLines = NULL;
+			gTempMacro->lastMacroLines = NULL;
+			gTempMacro->numParms = 0;
+			gTempMacro->bIsDefine = gbProcessingDefine;
+			gTempMacro->nLines = 0;
+
+			if (gCurFileName != NULL)
+			{
+				gTempMacro->fileName = strdup(gCurFileName);
+			}
+			else
+			{
+				gTempMacro->fileName = NULL;
+			}
+
+			gTempMacro->lineNo = yylineno;
+
+			/* %%%%% this should be set up in memory pools. */
+			gTempMacro->macroName = (char *)malloc(strlen(yytext)+1);
+			if (gTempMacro->macroName == NULL)
+			{
+				LexError("Out of memory for string table.\n");
+				SAFEFREE(gTempMacro);
+				if (gbProcessingDefine)
+				{
+					BEGIN(EATDEFINE);
+				}
+				else
+				{
+					BEGIN(EATMACRO);
+				}
+			}
+			else
+			{
+				strcpy(gTempMacro->macroName, yytext);
+			}
+		}
+	}
+}
+
+<MACRONAME>\n {
+	LexError("No macro name specified, skipping macro definition.\n");
+	SAFEFREE(gTempMacro->fileName);
+	SAFEFREE(gTempMacro);
+	if (gbProcessingDefine)
+	{
+		BEGIN(EATDEFINE);
+	}
+	else
+	{
+		BEGIN(EATMACRO);
+	}
+
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+
+<MACROPARMSTART>"(" {
+	gCountParen++; 
+}
+
+<MACROPARMSTART>[ \t]+ {}
+
+<MACROPARMSTART>. {
+	if (gbProcessingDefine && (gCountParen == 0))
+	{
+		EndMacroParms();
+	}
+	else
+	{
+		BEGIN(MACROPARM);
+	}
+	yyless(0);
+}
+
+<MACROPARM>[ \t]* { 
+	if ((gCountParen == 0) && gbProcessingDefine)
+	{
+		EndMacroParms();
+	}
+}
+
+<MACROPARM>(";"|"//").* {
+	if (gCountParen == 0)
+	{
+		EndMacroParms();
+	}	
+}
+
+<MACROPARM>"," {}
+
+<MACROPARM><<EOF>> {
+	EndMacroParms();
+//	GenDebugLine();
+//	GenListString();
+	yylineno++;
+	gLinesAssembled++;
+	BEGIN(INITIAL);
+}
+
+<MACROPARM>\n {
+	if (gbProcessingDefine && (gCountParen > 0))
+	{
+		LexError("Malformed #define, skipping.\n");
+		BEGIN(SAVELINE);
+	}
+	else
+	{
+		EndMacroParms();
+//		GenDebugLine();
+//		GenListString();
+		yylineno++;
+		gLinesAssembled++;
+		if (gbProcessingDefine)
+		{
+			gbProcessingDefine = false;
+			BEGIN(SAVELINE);
+		}
+	}
+}
+
+
+<MACROPARM>[^\n,]+ { 
+
+	MACROTEXT *tMacro;
+	char *macroParmEnd;
+	unsigned int startOffset;
+	bool bFoundEndParen;
+	unsigned int leftParenCount;
+	unsigned int rightParenCount;
+
+	bFoundEndParen = false;
+
+	// sheesh, we gotta count the parenthesis....
+	macroParmEnd = yytext;
+	leftParenCount = 0;
+	rightParenCount = 0;
+	while (*macroParmEnd)
+	{
+		if (*macroParmEnd == ')')
+		{
+			rightParenCount++;
+		}
+		if (*macroParmEnd == '(')
+		{
+			leftParenCount++;
+		}
+
+		macroParmEnd++;
+	}
+
+	// if we found the last right parenthesis.
+	if (rightParenCount == leftParenCount+1)
+	{
+		// find if we got the last parenthesis on this line
+		macroParmEnd = strrchr(yytext, ')');
+		yyless((macroParmEnd - yytext));
+		BEGIN(MACROPARMEND);
+	}
+
+	startOffset = strspn(yytext, " \t");
+
+	tMacro = SaveMacroText(&yytext[startOffset], gTempMacro->lastMacroParms);
+	if (tMacro == NULL)
+	{
+		LexError("Out of memory for string table for macro parameter(s).\n");
+		FreeMacroEntry(gTempMacro);
+		BEGIN(EATMACRO);
+	}
+	else
+	{
+		// if first one wasn't set then set it
+		if (gTempMacro->firstMacroParms == NULL)
+		{
+			gTempMacro->firstMacroParms = tMacro;
+		}
+
+		gTempMacro->lastMacroParms = tMacro;
+
+		gTempMacro->numParms++;
+	}
+
+}
+
+<MACROPARMEND>")"[ \t]*"\\"*\n* {
+	if (!gbProcessingDefine && !gbTempInsideMacro)
+	{
+		LexError("Malformed  macro, skipping.\n");
+		BEGIN(EATMACRO);
+	}
+	else
+	{
+		gCountParen--;
+
+		// we can get multiple \n's here
+		while (yytext[yyleng-2] == '\n')
+		{
+			yyleng--;
+		}
+		yyless(yyleng);
+
+		// if there isn't a \n on this line, macro starts on this line,
+		// not next, like in a macro definition
+		if (yytext[yyleng-1] != '\n')
+		{
+			EndMacroParms();
+		}
+		else
+		{
+			if (yytext[yyleng-1] == '\n')
+			{
+				gTempMacro->lineNo++;
+			}
+			// count this line
+			gTempMacro->nLines++;
+//			GenDebugLine();
+//			GenListString();
+			EndMacroParms();
+			if (!gbInsideMacro)
+			{
+				yylineno++;
+			}
+
+			gLinesAssembled++;
+		}
+
+	}
+}
+
+<MACROPARMEND>")"[ \t]*(";"|"//").*\n {
+	if (!gbProcessingDefine && !gbTempInsideMacro)
+	{
+		LexError("Malformed  macro, skipping.\n");
+		BEGIN(EATMACRO);
+	}
+	else
+	{
+
+		// no matter what count this line
+		gTempMacro->nLines++;
+		gCountParen--;
+		EndMacroParms();
+		if (!gbInsideMacro)
+		{
+			yylineno++;
+		}
+
+		gLinesAssembled++;
+	}
+}
+
+<MACROPARMEND>")"[ \t]+ {
+	if (!gbProcessingDefine && !gbTempInsideMacro)
+	{
+		LexError("Malformed  macro, skipping.\n");
+		BEGIN(EATMACRO);
+	}
+	else
+	{
+		gCountParen--;
+		if (gCountParen == 0)
+		{
+			// no matter what count this line
+			gTempMacro->nLines++;
+			EndMacroParms();
+			if (!gbInsideMacro)
+			{
+				yylineno++;
+			}
+
+			gLinesAssembled++;
+		}
+		else
+		{
+			REJECT;
+		}
+	}
+}
+
+<MACROBODY>.*"\\"[ \t]*\n {
+	MACROTEXT *tMacro;
+	unsigned int copyLen;
+	char *endLine;
+
+	gSaveLine[0] ='\0';
+	endLine = strchr(yytext, '\\');
+	copyLen = (endLine - yytext);
+	if (copyLen > MAXSAVELINE)
+	{
+		copyLen = MAXSAVELINE;
+	}
+
+	strncat(gSaveLine, yytext, copyLen);
+	strcat(gSaveLine, "\n");
+	tMacro = SaveMacroText(gSaveLine, gLastMacro->lastMacroLines);
+	if (tMacro == NULL)
+	{
+		LexError("Out of memory for string table for macro parameter(s).\n");
+		BEGIN(EATDEFINE);
+	}
+	else
+	{
+		gLastMacro->nLines++;
+		// if first one wasn't set then set it
+		if (gLastMacro->firstMacroLines == NULL)
+		{
+			gLastMacro->firstMacroLines = tMacro;
+		}
+
+		gLastMacro->lastMacroLines = tMacro;
+	}
+
+//	GenDebugLine();
+//	GenListString();
+	yylineno++;
+	gLinesAssembled++;
+}
+
+<MACROBODY>[ \t]*"endm"[ \t]*((";"|"//").*)* {
+
+	strncpy(gSaveLine, yytext, MAXSAVELINE);
+	if (gbProcessingDefine)
+	{
+		LexError("Malformed #define, skipping.\n");
+	}
+
+	BEGIN(ENDMACRO);
+}
+
+<MACROBODY>[^\n]* {
+		MACROTEXT *tMacro;
+
+		// check if processing #define and only one line, if not then append \n
+		if (!gbProcessingDefine || (gLastMacro->nLines >= 1))
+		{
+			gSaveLine[0] = '\0';
+			strncat(gSaveLine, yytext, MAXSAVELINE);
+			strcat(gSaveLine, "\n");
+			tMacro = SaveMacroText(gSaveLine, gLastMacro->lastMacroLines);
+			gLastMacro->nLines++;
+		}
+		else if (gLastMacro->numParms > 0)	// check if parameters were there
+		{
+			// if so, we need the '\n' appended
+			gMacroLine[0] = '\0';
+			strncat(gMacroLine, yytext, MAXSAVELINE);
+			strcat(gMacroLine, "\n");
+			tMacro = SaveMacroText(gMacroLine, gLastMacro->lastMacroLines);
+			gLastMacro->nLines++;
+		}
+		else	// straight no newline macro replace
+		{
+			tMacro = SaveMacroText(yytext, gLastMacro->lastMacroLines);
+		}
+
+		if (tMacro == NULL)
+		{
+			LexError("Out of memory for string table for macro parameter(s).\n");
+			BEGIN(EATMACRO);
+		}
+		else
+		{
+			// if first one wasn't set then set it
+			if (gLastMacro->firstMacroLines == NULL)
+			{
+				gLastMacro->firstMacroLines = tMacro;
+			}
+
+			gLastMacro->lastMacroLines = tMacro;
+		}
+}
+
+<MACROBODY>\n {
+
+	MACROTEXT *tMacro;
+//	GenDebugLine();
+//	GenListString();
+	yylineno++;
+	gLinesAssembled++;
+	if (gbProcessingDefine)
+	{
+		gbProcessingDefine = false;
+		BEGIN(SAVELINE);
+	}
+	else
+	{
+		// this means \n by itself inside macro body
+		if (((yylineno-1) - gLastMacro->lineNo) !=  gLastMacro->nLines)
+		{
+			strcpy(gMacroLine, "\n");
+			tMacro = SaveMacroText(gMacroLine, gLastMacro->lastMacroLines);
+			gLastMacro->nLines++;
+
+			if (tMacro == NULL)
+			{
+				LexError("Out of memory for string table for macro parameter(s).\n");
+				BEGIN(EATMACRO);
+			}
+			else
+			{
+				// if first one wasn't set then set it
+				if (gLastMacro->firstMacroLines == NULL)
+				{
+					gLastMacro->firstMacroLines = tMacro;
+				}
+
+				gLastMacro->lastMacroLines = tMacro;
+			}
+		}
+	}
+}
+
+<EATMACRO>[ \t]*"endm"[ \t]*\n {
+	BEGIN(SAVELINE);
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+
+<EATMACRO>.*\n {
+	strncpy(gSaveLine, yytext, MAXSAVELINE);
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+
+<EATDEFINE>.*"\\"\n {
+	strncpy(gSaveLine, yytext, MAXSAVELINE);
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+}
+
+<EATDEFINE>.*\n {
+	strncpy(gSaveLine, yytext, MAXSAVELINE);
+//	GenDebugLine();
+//	GenListString();
+	gLinesAssembled++;
+	yylineno++;
+	BEGIN(SAVELINE);
+}
+
+<INITIAL,MODIFIER>{alpha}{alphadigs}* {
+
+	gTempParseMacro = FindMacro(yytext);
+
+	if (gTempParseMacro != NULL)
+	{
+		if (gIncludeStackIndex >= MAX_INCLUDE_DEPTH )
+		{
+			LexError("macros nested too deeply");
+			exit( 1 );
+		}
+
+		if (gTempParseMacro->firstMacroLines != NULL)
+		{
+
+			gTempMacro = (MACROENTRY *)malloc(sizeof(MACROENTRY));
+			if (gTempMacro == NULL)
+			{
+				LexError("Out of memory allocating MACROENTRY structure.\n");
+			}
+			else
+			{
+
+				gTempMacro->next = NULL;
+				gTempMacro->prev = NULL;
+				gTempMacro->macroName = NULL;
+				gTempMacro->firstMacroParms = NULL;
+				gTempMacro->lastMacroParms = NULL;
+				gTempMacro->firstMacroLines = NULL;
+				gTempMacro->lastMacroLines = NULL;
+				gTempMacro->numParms = 0;
+				gTempMacro->nLines = 0;
+
+				gbTempInsideMacro = true;		// flag we are currently doing a macro replace.
+				gInvokeState = YYSTATE;
+				if (gTempParseMacro->numParms > 0)
+				{
+					BEGIN(MACROPARMSTART);
+				}
+				else
+				{
+					EndMacroParms();
+					gbTempInsideMacro = false;	// no longer waiting for macro invocation
+				}				
+			}
+		}
+	}
+	else
+	{
+		BEGIN(INITIAL);
+		REJECT;
+	}
+}
+
+[,\[\]\-\+\(\)\*\<\>\/\%_\.] { 
+//    fprintf( stderr, "%c ", yytext[0] );
+	return yytext[0];
+}
+
+
+[ \t]+	{}
+
+<DEFINE>\n {
+	LexError("Didn't find label string for #define.\n");
+	BEGIN(SAVELINE);
+//	return '\n';
+}
+
+"\n" {
+//fprintf(stderr, "\n");
+//	line_incr = 1;
+	line_incr++;
+	BEGIN(SAVELINE);
+	return '\n';
+}
+
+<EATSTRING>{alphadigs}+ {
+	BEGIN(INITIAL);
+//	fprintf( stderr, "%s", yytext );
+	if (yyleng == 1)
+		return yytext[0];
+	else
+		LexError("Unrecognized Token: %s\n", yytext);
+	return UNKNOWN_STRING;
+}
+
+<EATSTRING>[\001-\040]		{
+//	vs10_lval.ival = yytext[0];
+	LexError("Illegal character: %d decimal.\n", yytext[0]);
+	return(ILLEGAL);
+}
+
+[\001-\040]		{
+//	vs10_lval.ival = yytext[0];
+	LexError("Illegal character: %d decimal.\n", yytext[0]);
+	return(ILLEGAL); 
+}
+
+<EATSTRING>. {
+	return yytext[0];
+}
+
+. {
+	BEGIN(EATSTRING);
+	yyless(0);
+}
+
+<<EOF>> {
+	bool wasInMacro;
+	bool oneLiner;
+	char *macroText;
+
+	wasInMacro = gbInsideMacro;
+	oneLiner = false;
+
+
+	// if we are inside the macro then do next line until their are no more
+	if (gbInsideMacro)
+	{
+		oneLiner = (gParseMacro->nLines == 0);
+
+		// free the temporary parameter replaced line we were working on.
+		// get next line in macro text, if any
+		gMacroLineParse = gMacroLineParse->next;
+		// more lines to parse?
+		if (gMacroLineParse != NULL)
+		{
+			macroText = gMacroLine;
+			// if no replacement text, just use source line
+			if (gParseMacro->firstMacroParms == NULL)
+			{
+				macroText = gMacroLineParse->macroText;
+			}
+			else
+			{
+				// replace the macro parameters
+				ReplaceMacroParms(gMacroLineParse->macroText, gMacroLine, gParseMacro, gInvokeMacro);
+			}
+
+//			if (gExpandMacros)
+//			{
+//				strcpy(gSaveLine, macroText);
+//			}
+
+			BEGIN(INITIAL);
+			// and lex it.
+			yy_scan_string(macroText);
+		}
+		else
+		{
+			// no more lines in this macro, so free the working macro
+			SAFEFREE(gInvokeMacro);
+			// shut off flag for inside a macro replacement state.
+			gbInsideMacro = false;
+		}
+	}
+
+	if (gbProcessingIFDEF && !wasInMacro)
+	{
+		LexError("End of file reached before #endif found, macro started on line %d.\n", gIfDefStartLine);
+	}
+
+	if (!gbInsideMacro)
+	{
+		if ( gIncludeStackIndex == 0 )
+		{
+			if (!gbProcessingBuiltIn)
+				CleanUp();
+			return 0;
+//			return TOKEN_EOF;
+		}
+		else
+		{
+			yy_delete_buffer( YY_CURRENT_BUFFER );
+			SAFEFREE(gCurFileName);
+//			SAFEDELETE(myin);
+//			SAFECLOSE(yyin);
+		}
+
+		gIncludeStackIndex--;
+		SAFEDELETEARRAY( gIncludeStack[gIncludeStackIndex].nextString );
+		yy_switch_to_buffer(gIncludeStack[gIncludeStackIndex].buffer );
+		gCurFileName = gIncludeStack[gIncludeStackIndex].fileName;
+//		yyin = gIncludeStack[gIncludeStackIndex].fileHandle;
+		myin = gIncludeStack[gIncludeStackIndex].prevString;
+		yylineno = gIncludeStack[gIncludeStackIndex].lineNo;
+		gInvokeMacro = gIncludeStack[gIncludeStackIndex].lastInvokeMacro;
+		gParseMacro = gIncludeStack[gIncludeStackIndex].lastParseMacro;
+		gMacroLineParse = gIncludeStack[gIncludeStackIndex].lastMacroLineParse;
+		gbInsideInclude = gIncludeStack[gIncludeStackIndex].lastbInsideInclude;
+		gbInsideMacro = gIncludeStack[gIncludeStackIndex].lastbInsideMacro;
+		gbProcessingIFDEF = gIncludeStack[gIncludeStackIndex].lastbProcessingIFDEF;
+
+		if (!gbInsideMacro && !oneLiner)
+		{
+//			GenSwitchFileNames(gCurFileName);
+			BEGIN(SAVELINE);
+		}
+		else
+		{
+			BEGIN(INITIAL);
+		}
+
+		// gSaveLine was last line saved, before macro invocation
+		if (wasInMacro && !gbInsideMacro && !oneLiner)
+		{
+//			GenDebugLine();
+//			GenListString();
+			gLinesAssembled++;
+			yylineno++;
+		}
+
+	}
+
+}
+
+%%
+
+
+//=====================================================================
+// Function:	FindNMacro
+// Description:	Look through macros and see if it had been predefined
+// Parameters:	findName = name to lookup
+//				sLen = # characters valid in source (findName)
+// Returns:		MACROENTRY * = pointer to macro entry if found
+//=====================================================================
+MACROENTRY *FindNMacro(char *findName, unsigned int sLen)
+{
+	MACROENTRY *curEntry;
+
+	curEntry = gLastMacro;
+	while (curEntry != NULL)
+	{
+		if (strlen(curEntry->macroName) == sLen)
+		{
+			if (!strncmp(curEntry->macroName, findName, sLen))
+			{
+				break;
+			}
+		}
+
+		curEntry = curEntry->prev;
+	}
+
+	return curEntry;
+	
+}
+
+//=====================================================================
+// Function:	FindMacro
+// Description:	Look through macros and see if it had been predefined
+// Parameters:	findName = name to lookup
+// Returns:		MACROENTRY * = pointer to macro entry if found
+//=====================================================================
+MACROENTRY *FindMacro(char *findName)
+{
+	MACROENTRY *curEntry;
+
+	curEntry = gLastMacro;
+	while (curEntry != NULL)
+	{
+		if (!strcmp(curEntry->macroName, findName))
+		{
+			break;
+		}
+
+		curEntry = curEntry->prev;
+	}
+
+	return curEntry;
+	
+}
+
+//=====================================================================
+// Function:	CleanUp
+// Description:	Clean up the #define strings
+// Parameters:	.
+// Returns:		.
+//=====================================================================
+void CleanUp()
+{
+	void *tPtr;
+
+	// free up the macros that were alloced
+	while (gLastMacro != NULL)
+	{
+
+		FreeMacroEntry(gLastMacro);
+
+		tPtr = gLastMacro;
+		gLastMacro = gLastMacro->prev;
+		SAFEFREE(tPtr);
+	}
+
+}
+
+//=====================================================================
+// Function:	FreeMacroEntry
+// Description:	Frees up the macro entry data, (parms, lines of text)
+// Parameters:	macEntry = pointer to the MACROENTRY structure
+// Returns:		.
+//=====================================================================
+void FreeMacroEntry(MACROENTRY *macEntry)
+{
+	MACROTEXT *tText;
+	MACROTEXT *tNext;
+
+	SAFEFREE(macEntry->macroName);
+	SAFEFREE(macEntry->fileName);
+	// free the macro lines that were alloced
+	tText = macEntry->lastMacroLines;
+	while (tText != NULL)
+	{
+		tNext = tText->prev;
+		SAFEFREE(tText);
+		tText = tNext;
+	}
+
+	// free the text of the macro parms that were alloced
+	tText = macEntry->lastMacroParms;
+	while (tText != NULL)
+	{
+		tNext = tText->prev;
+		SAFEFREE(tText);
+		tText = tNext;
+	}
+}
+
+//=====================================================================
+// Function:	CheckMacroFunctions
+// Description:	Find if this text is a builtin macro function
+// Parameters:	lookString = non-null terminated string of possible
+//				and if found set global macro function call
+// Returns:		.
+//=====================================================================
+void CheckMacroFunctions(char *lookString, unsigned int *recognizedLen, char **invString)
+{
+
+	unsigned int i;
+	unsigned int sLen;
+	
+	for (i=0; i< NUM_MACRO_FUNCTIONS; i++)
+	{
+		sLen = strlen(gMacroFunctions[i].name);
+		if (!strncmp(gMacroFunctions[i].name, lookString, sLen))
+		{
+			gMacroCallFunction = gMacroFunctions[i].function;
+			*recognizedLen = sLen;
+			*invString = NULL;
+			return;
+		}
+	}
+}
+
+//=====================================================================
+// Function:	FindAlphaNum
+// Description:	Find a whole alpha numeric string, ie consists of
+//				[A-Za-z0-9_] only
+// Parameters:	srcStr = source string to search through.
+//				sLen = unsinged int pointer to length of string found
+// Returns:		pointer to found start of string.
+//				NULL if none.
+//=====================================================================
+char *FindAlphaNum(char *srcStr, unsigned int *sLen)
+{
+	char curChar;
+	char *foundStr;
+
+	while (*srcStr != '\0')
+	{
+		curChar = toupper(*srcStr);
+		if ((curChar >= 'A') && (curChar <= 'Z'))
+			break;
+
+		if ((curChar >= '0') && (curChar <='9'))
+			break;
+
+		if (curChar == '_')
+			break;
+
+		srcStr++;
+	}
+
+	if (*srcStr == '\0')
+	{
+		return NULL;
+	}
+
+	foundStr = srcStr;
+
+	*sLen = 0;
+	// now search for end of string of [A-Za-z0-9_]
+	while (*srcStr != '\0')
+	{
+		curChar = toupper(*srcStr);
+		if ((curChar < 'A') || (curChar > 'Z'))
+		{
+			if ((curChar < '0') || (curChar > '9'))
+			{
+				if (curChar != '_')
+					break;
+			}
+		}
+
+		(*sLen)++;
+		srcStr++;
+	}
+
+	return foundStr;
+
+}
+
+//=====================================================================
+// Function:	FindDefineParm
+// Description:	Find if the MACROENTRY->macroText linked list contains
+//				replaceable parameters.
+// Parameters:	srcParms = pointer to MACROENTRY structure for source
+//						parameters
+//				invParms = MACROENTRY pointer to invocation parameters
+//				lookString = non-null terminated string of possible
+//							replaceable string
+//				recognizedLen = replacement string matched length
+//				invString = invocation string to replace with
+// Returns:		pointer to first character found in lookstring
+//=====================================================================
+char *FindDefineParm(MACROENTRY *srcParms, MACROENTRY *invParms, 
+						char *lookString, unsigned int *recognizedLen, char **invString)
+{
+	MACROTEXT *srcText;
+	MACROTEXT *invText;
+	char *checkStr;
+	unsigned int checkLen;
+	unsigned int sLen;
+
+	checkStr = lookString;
+	*invString = NULL;
+
+	// first search for first [A-Za-z0-9_] only string
+	checkStr = FindAlphaNum(lookString, &checkLen);
+
+	while (checkStr != NULL)
+	{
+		// check all the #define parameters for match
+		srcText = srcParms->firstMacroParms;
+		invText = invParms->firstMacroParms;
+		while (srcText)
+		{
+			sLen = strlen(srcText->macroText);
+			// lengths should match
+			if (sLen == checkLen)
+			{
+				if (!strncmp(checkStr, srcText->macroText, checkLen))
+				{
+					// it matched so return replacement text
+					*invString = invText->macroText;
+					// and length that we reconized
+					*recognizedLen = checkLen;
+					return checkStr;
+				}
+			}
+
+			srcText = srcText->next;
+			invText = invText->next;
+		}
+
+		// not found yet, so go to next string.
+		checkStr = FindAlphaNum(checkStr+checkLen, &checkLen);
+	}
+
+	return NULL;
+}
+
+//=====================================================================
+// Function:	FindReplaceParm
+// Description:	Find if the MACROENTRY->macroText linked list contains
+//				a replaceable parameters.
+// Parameters:	srcParms = pointer to MACROENTRY structure for source
+//						parameters
+//				invParms = MACROENTRY pointer to invocation parameters
+//				lookString = non-null terminated string of possible
+//							replaceable string
+//				recognizedLen = replacement string matched length
+//				invString = invocation string to replace with
+// Returns:		.
+//=====================================================================
+void FindReplaceParm(MACROENTRY *srcParms, MACROENTRY *invParms, 
+						char *lookString, unsigned int *recognizedLen, char **invString)
+{
+	unsigned int sLen;
+	MACROTEXT *srcText;
+	MACROTEXT *invText;
+
+	*recognizedLen = 0;
+	*invString = NULL;
+
+	srcText = srcParms->firstMacroParms;
+	invText = invParms->firstMacroParms;
+
+	if (srcText != NULL)
+	{
+		// go until srcText # strings ends
+		while (srcText != NULL)
+		{
+			sLen = strlen(srcText->macroText);
+			if (!strncmp(srcText->macroText, lookString, sLen))
+			{
+				// found it so return src, replacement string
+				*recognizedLen = strlen(srcText->macroText);
+				*invString = invText->macroText;
+				// call function macro if it was invoked prior.
+				if (gMacroCallFunction != NULL)
+				{
+					gMacroCallFunction(lookString, recognizedLen, invString);
+					gMacroCallFunction = NULL;
+				}
+				return;
+			}
+
+			srcText = srcText->next;
+			invText = invText->next;
+		}
+	}
+
+	// ok, it wasn't found, look through builtin macro functions
+	CheckMacroFunctions(lookString, recognizedLen, invString);
+}
+
+//=====================================================================
+// Function:	ReplaceMacroParms
+// Description:	Replace macro parameters when macro was defined, with
+//				those specified on the macro invocation line
+// Parameters:	srcLine = source line to replace src macro parms with
+//				destLine = destination line save to.
+//				invocation macro parameters.
+//				parseMacro = currently parsing macro entry
+//				invParms = invocation macro entry
+// Returns:		.
+//=====================================================================
+void ReplaceMacroParms(char *srcLine, char *destLine, 
+							MACROENTRY *srcParms, MACROENTRY *invParms)
+{
+	char *findReplace;
+	char *invString;
+	unsigned int sLen;
+	unsigned int dLen;
+	unsigned int copyLen;
+	unsigned int subLen;
+	unsigned int recognizedLen;
+
+	destLine[0]= '\0';
+
+	sLen = strlen(srcLine);
+	dLen = 0;
+
+	while (sLen > 0)
+	{
+		// strtok might work better except it modifies the string, so
+		// kind of do my own....
+		if (!srcParms->bIsDefine)
+		{
+			findReplace = strchr(srcLine, '%');
+			if (findReplace != NULL)
+			{
+				// bypass % sign in findReplacement
+				findReplace++;
+				// figure out length of source before %
+				copyLen = (findReplace - srcLine)-1;
+				// check if there is a replacement string
+				FindReplaceParm(srcParms, invParms, findReplace, &recognizedLen, &invString);
+			}
+			else
+			{
+				strcat(destLine, srcLine);
+				return;
+			}
+		}
+		else
+		{
+			findReplace = FindDefineParm(srcParms, invParms, srcLine, &recognizedLen, &invString);
+			if (findReplace != NULL)
+			{
+				// figure out length of source before %
+				copyLen = findReplace - srcLine;
+			}
+			else
+			{
+				strcat(destLine, srcLine);
+				return;
+			}
+		}
+
+
+		if (invString != NULL)
+		{
+			// figure out how much we are going to substitute
+			subLen = strlen(invString);
+		}
+		else
+		{
+			subLen = 0;
+		}
+
+		if ((dLen + copyLen + subLen) > MAXSAVELINE)
+		{
+			LexError("Macro string overrun.\n");
+			CleanUp();
+			exit(ERROR_MACRO_OVERRUN);
+		}
+
+		if (copyLen > 0)
+		{
+			strncat(destLine, srcLine, copyLen);
+			dLen += copyLen;
+		}
+
+		srcLine += copyLen;
+		sLen -= copyLen;
+		// in macro so skip % part of variable
+		if (!srcParms->bIsDefine)
+		{
+			// skip %, also
+			srcLine++;
+			sLen--;
+		}
+
+		if (invString != NULL)
+		{
+			strcat(destLine, invString);
+			dLen += strlen(invString);
+		}
+
+		srcLine += recognizedLen;
+		sLen -= recognizedLen;
+	}
+
+}
+
+//=====================================================================
+// Function:	SaveMacroText
+// Description:	Adds a string to a linked list of MACROTEXT structures
+// Parameters:	srcText = pointer to source text to save
+//				lastMacroText = last allocated, or NULL
+// Returns:		newly allocated MACROTEXT structure, or NULL
+//=====================================================================
+MACROTEXT *SaveMacroText(char *srcText, MACROTEXT *lastMacroText)
+{
+	MACROTEXT *curMacroText;
+
+	curMacroText = (MACROTEXT *)malloc(sizeof(MACROTEXT));
+	if (curMacroText == NULL)
+	{
+		return NULL;
+	}
+	else
+	{
+		// no next entry but set up previous with previously alloced macro parameter
+		curMacroText->next = NULL;
+		curMacroText->prev = lastMacroText;
+
+		// if the macroParm pointer is null then we are the first allocated
+		// so if not set the last one allocate next pointer to newly allocated structure
+		if (lastMacroText != NULL)
+		{
+			lastMacroText->next = curMacroText;
+		}
+
+		/* %%%%% this should be set up in memory pools. */
+		curMacroText->macroText = strdup(srcText);
+		if (curMacroText->macroText == NULL)
+		{
+			SAFEFREE(curMacroText);
+			return NULL;
+		}
+	}
+
+	return curMacroText;
+}
+
+//=====================================================================
+// Function:	ParseBuiltInMacroParms
+// Description:	parse parameters of string and fill in MACROENTRY
+//				structure.
+// Parameters:	parsedMacro = pointer to MACROENTRY structure that gets
+//				filled in with parameter pointers and count
+//				parmStr = string to parse parameters from
+// Returns:		false if error
+//=====================================================================
+bool ParseBuiltInMacroParms(MACROENTRY *parsedMacro, char *parmStr)
+{
+	char *endStr;
+	char *foundParm;
+	MACROTEXT *prevMT;
+	MACROTEXT *curMT;
+
+	parsedMacro->numParms = 0;
+	parsedMacro->firstMacroParms = NULL;
+	
+	foundParm = strdup(parmStr);
+	if (foundParm == NULL)
+	{
+		LexError("Out of memory parsing bultin macro parameters.\n");
+		return false;
+	}
+
+	// assume a ')' is on the end.
+	endStr = strrchr(foundParm, ')');
+	if (endStr == NULL)
+	{
+		LexWarning("Ending parenthesis not found for macro %s.\n", parsedMacro->macroName);
+		endStr = foundParm + strlen(foundParm);
+	}
+
+	prevMT = NULL;
+	// strip out and seperate parameters
+	while (foundParm < endStr)
+	{
+		// allocate a macro text structure
+		curMT = (MACROTEXT *)malloc(sizeof(MACROTEXT));
+		if (curMT == NULL)
+		{
+			free(parmStr);
+			LexError("Out of memory parsing bultin macro parameters.\n");
+			return false;
+		} 
+		curMT->next = NULL;
+		curMT->prev = prevMT;
+		parsedMacro->numParms++;
+
+		if (prevMT != NULL)
+		{
+			prevMT->next = curMT;
+		}
+		else
+		{
+			parsedMacro->firstMacroParms = curMT;
+		}
+
+		curMT->macroText = foundParm;
+		// search for next parameters, delimited by comma
+		foundParm = strchr(foundParm, ',');
+		if (foundParm == NULL)
+		{
+			foundParm = endStr;
+			*foundParm = '\0';
+		}
+		else
+		{
+			// skip comma
+			*foundParm = '\0';
+			foundParm++;
+		}
+		prevMT = curMT;
+	}
+
+	return true;
+}
+
+//=====================================================================
+// Function:	MacroMathFunction
+// Description:	Comes here after macro replacement is done to perform
+//				some mathematic function on parameter (macro replacement
+//				 string (ie, register))
+// Parameters:	invMacro = macroentry pointer containing macro information
+//				recognizedLen = # characters recoginized so far
+//				invStr = invoked replacement string so far
+//				mathStr = "-", "+", etc for mathematic function
+// Returns:		new recognizedLen, invStr, with incremented #
+//=====================================================================
+void MacroMathFunction(MACROENTRY *invMacro, unsigned int *recognizedLen, char **invStr,
+						char *mathStr)
+{
+	char *numStartStr;
+	unsigned int sLen;
+	char numberStr[256];
+	unsigned int number;
+	char *operand;
+
+
+	// verify enough paramters to complete operation
+	if (invMacro->numParms != 2)
+	{
+		LexError("Two parameters are required for %s macro\n", invMacro->macroName);
+		return;
+	}
+
+	// get second macro parm, which is add by amount.
+	operand = invMacro->firstMacroParms->next->macroText;
+
+	// first find inner most bracket if any
+	numStartStr = strrchr(*invStr, ']');
+	if (numStartStr == NULL)
+	{
+		numStartStr = strrchr(*invStr, ')');
+	}
+
+	if (numStartStr != NULL)
+	{
+		if ((strlen(*invStr)+strlen(operand)+1) > MAXREPLACESTRING)
+		{
+			LexError("Out of Temporary string replacement memory inside builtin macro %s\n",
+					invMacro->macroName);
+		}
+		else
+		{
+			sLen = (numStartStr - *invStr);
+			gReplaceText[0] = '\0';
+			strncat(gReplaceText, *invStr, sLen);
+			strcat(gReplaceText, mathStr);
+			strcat(gReplaceText, operand);
+			strcat(gReplaceText, numStartStr);
+			*invStr = gReplaceText;
+		}
+	}
+	else
+	{
+		numStartStr = strpbrk(*invStr, "0123456789");
+		if (numStartStr != NULL)
+		{
+			// put up to number we found
+			sLen = numStartStr - *invStr;
+			if (sLen > MAXREPLACESTRING)
+				goto ErrOut;
+
+			gReplaceText[0] = '\0';
+			strncat(gReplaceText, *invStr, sLen);
+
+			switch (mathStr[0])
+			{
+				case '-':
+					number = atoi(numStartStr)-atoi(operand);
+					break;
+				case '+':
+					number = atoi(numStartStr)+atoi(operand);
+					break;
+			}
+			sprintf(numberStr, "%d", number);
+
+			if ((strlen(gReplaceText) + strlen(numberStr)) > MAXREPLACESTRING)
+				goto ErrOut;
+
+			strcat(gReplaceText, numberStr);
+
+			while ((*numStartStr != '\0') && (*numStartStr >= '0' && *numStartStr <= '9'))
+				numStartStr++;
+
+			if ((strlen(gReplaceText) + strlen(numStartStr)) > MAXREPLACESTRING)
+				goto ErrOut;
+
+			strcat(gReplaceText, numStartStr);
+
+			*invStr = gReplaceText;
+		}
+		else
+		{
+			if ((strlen(*invStr)+strlen(operand)+1) > MAXREPLACESTRING)
+			{
+				LexError("Out of Temporary string replacement memory inside builtin macro %s\n",
+					invMacro->macroName);
+			}
+			else
+			{
+				sprintf(gReplaceText, "%s%s%s", *invStr, mathStr, operand);
+				*invStr = gReplaceText;
+			}
+		}
+	}
+
+
+	return;
+
+ErrOut:
+	LexError("Out of Temporary string replacement memory inside builtin macro %s\n",
+				invMacro->macroName);
+	// skip ')'
+	(*recognizedLen)++;
+}
+
+//=====================================================================
+// Function:	MacroIncFunction
+// Description:	Comes here after macro replacement is done to increment
+//				macro replacement string (ie, register)
+// Parameters:	lookStr = string after '(', so we can get parameters
+//				recognizedLen = # characters recoginized so far
+//				invStr = invoked replacement string so far
+// Returns:		new recognizedLen, invStr, with incremented #
+//=====================================================================
+void MacroIncFunction(char *lookStr, unsigned int *recognizedLen, char **invStr)
+{
+	MACROENTRY tMEntry;
+	MACROTEXT parm1;
+	MACROTEXT parm2;
+
+	tMEntry.macroName = "%inc()";
+	tMEntry.numParms = 2;
+	tMEntry.firstMacroParms = &parm1;
+	parm1.prev = NULL;
+	parm1.next = &parm2;
+	parm1.macroText = *invStr;
+	parm2.prev = &parm1;
+	parm2.next = NULL;
+	parm2.macroText = "1";
+
+	MacroMathFunction(&tMEntry, recognizedLen, invStr, "+");
+	// skip ')'
+	(*recognizedLen)++;
+}
+
+//=====================================================================
+// Function:	MacroDecFunction
+// Description:	Comes here after macro replacement is done to decrement
+//				macro replacement string (ie, register)
+// Parameters:	lookStr = string after '(', so we can get parameters
+//				recognizedLen = # characters recoginized so far
+//				invStr = invoked replacement string so far
+// Returns:		new recognizedLen, invStr, with decremented #
+//=====================================================================
+void MacroDecFunction(char *lookStr, unsigned int *recognizedLen, char **invStr)
+{
+	MACROENTRY tMEntry;
+	MACROTEXT parm1;
+	MACROTEXT parm2;
+
+	tMEntry.macroName = "%dec()";
+	tMEntry.numParms = 2;
+	tMEntry.firstMacroParms = &parm1;
+	parm1.prev = NULL;
+	parm1.next = &parm2;
+	parm1.macroText = *invStr;
+	parm2.prev = &parm1;
+	parm2.next = NULL;
+	parm2.macroText = "1";
+
+	MacroMathFunction(&tMEntry, recognizedLen, invStr, "-");
+	// skip ')'
+	(*recognizedLen)++;
+}
+
+//=====================================================================
+// Function:	MacroAddFunction
+// Description:	Comes here after macro replacement is done to add
+//				macro replacement string (ie, register)
+// Parameters:	lookStr = string after '(', so we can get parameters
+//				recognizedLen = # characters recoginized so far
+//				invStr = invoked replacement string so far
+// Returns:		new recognizedLen, invStr, with incremented #
+//=====================================================================
+void MacroAddFunction(char *lookStr, unsigned int *recognizedLen, char **invStr)
+{
+	MACROENTRY tMEntry;
+	MACROTEXT *curMT;
+	MACROTEXT *nextMT;
+	unsigned int i;
+
+	tMEntry.macroName = "%add()";
+	if (strlen(lookStr) > MAXREPLACESTRING)
+	{
+		LexError("Out of Temporary string replacement memory inside builtin macro %add()\n");
+		return;
+	}
+	if (ParseBuiltInMacroParms(&tMEntry, lookStr))
+	{
+		MacroMathFunction(&tMEntry, recognizedLen, invStr, "+");
+		// skip ',' strlen(parm2)+ ')'
+		(*recognizedLen) += strlen(tMEntry.firstMacroParms->next->macroText)+2;
+	}
+
+	curMT = tMEntry.firstMacroParms;
+	// in this case only one string was allocated
+	free(curMT->macroText);
+	for (i=0; i<tMEntry.numParms; i++)
+	{
+		nextMT = curMT->next;
+		free(curMT);
+		curMT = nextMT;
+	}
+}
+
+//=====================================================================
+// Function:	MacroSubFunction
+// Description:	Comes here after macro replacement is done to subtract
+//				macro replacement string (ie, register)
+// Parameters:	invParms, parameters that macro was invoked with
+//				recognizedLen = # characters recoginized so far
+//				invStr = invoked replacement string so far
+// Returns:		new recognizedLen, invStr, with incremented #
+//=====================================================================
+void MacroSubFunction(char *lookStr, unsigned int *recognizedLen, char **invStr)
+{
+	MACROENTRY tMEntry;
+	MACROTEXT *curMT;
+	MACROTEXT *nextMT;
+	unsigned int i;
+
+	tMEntry.macroName = "%sub()";
+	if (ParseBuiltInMacroParms(&tMEntry, lookStr))
+	{
+		MacroMathFunction(&tMEntry, recognizedLen, invStr, "-");
+		// skip ',' strlen(parm2)+ ')'
+		(*recognizedLen) += strlen(tMEntry.firstMacroParms->next->macroText)+2;
+	}
+	curMT = tMEntry.firstMacroParms;
+	// in this case only one string was allocated
+	free(curMT->macroText);
+	for (i=0; i<tMEntry.numParms; i++)
+	{
+		nextMT = curMT->next;
+		free(curMT);
+		curMT = nextMT;
+	}
+}
+
+//=====================================================================
+// Function:	EndMacroParms
+// Description:	Does update and cleanup one end of macro parameters
+//				is reached
+// Parameters:	.
+// Returns:		.
+//=====================================================================
+void EndMacroParms()
+{
+	char *curFileName;
+	char *macroFileName;
+	char tempStr[1024];
+	char *macroText;
+
+	if (gbTempInsideMacro)
+	{
+		if (gTempParseMacro->numParms != gTempMacro->numParms)
+		{
+			LexError("Macro invocation number of parameters do not match macro definition, skipping\n");
+			BEGIN(INITIAL);
+			SAFEFREE(gTempMacro);
+		}
+		else
+		{
+			// we got all the parameters for the MACRO invocation, so start inside
+			// the macro now, by saving off current state on stack
+			gIncludeStack[gIncludeStackIndex].lineNo = yylineno;
+			gIncludeStack[gIncludeStackIndex].fileName = gCurFileName;
+//			gIncludeStack[gIncludeStackIndex].fileHandle = yyin;
+//fprintf( stderr, "Chris fix this code with myin stuff\n" );
+			gIncludeStack[gIncludeStackIndex].prevString = myin;
+			gIncludeStack[gIncludeStackIndex].nextString = NULL;
+			gIncludeStack[gIncludeStackIndex].lastInvokeMacro = gInvokeMacro;
+			gIncludeStack[gIncludeStackIndex].lastParseMacro = gParseMacro;
+			gIncludeStack[gIncludeStackIndex].lastMacroLineParse = gMacroLineParse;
+			gIncludeStack[gIncludeStackIndex].lastbInsideMacro = gbInsideMacro;
+			gIncludeStack[gIncludeStackIndex].lastbInsideInclude = gbInsideInclude;
+			gIncludeStack[gIncludeStackIndex].buffer = YY_CURRENT_BUFFER;
+			gIncludeStack[gIncludeStackIndex].lastbProcessingIFDEF = gbProcessingIFDEF;
+			gIncludeStackIndex++;
+
+			gParseMacro = gTempParseMacro;
+			gInvokeMacro = gTempMacro;
+			gbInsideMacro = gbTempInsideMacro;
+
+			gbTempInsideMacro = false;
+
+//			yyin = NULL;
+			myin = NULL;
+			curFileName = gCurFileName;
+			if (curFileName == NULL)
+				curFileName = "";
+
+			macroFileName = gParseMacro->fileName;
+			if (macroFileName == NULL)
+				macroFileName = "";
+
+			sprintf(tempStr, "%s(%d) : References ->\n%s", curFileName, yylineno, macroFileName); 
+			gCurFileName = strdup(tempStr);
+			gMacroLineParse = gParseMacro->firstMacroLines;
+
+			macroText = gMacroLine;
+			// if no replacement text, just use source line
+			if (gParseMacro->firstMacroParms == NULL)
+			{
+				macroText = gMacroLineParse->macroText;
+			}
+			else
+			{
+				// replace the macro parameters
+				ReplaceMacroParms(gMacroLineParse->macroText, gMacroLine, gParseMacro, gInvokeMacro);
+			}
+
+			yylineno = gParseMacro->lineNo;
+			if (gParseMacro->nLines >= 1)
+			{
+				strcpy(gSaveLine, macroText);
+			}
+
+//			if (gExpandMacros && (gParseMacro->nLines >= 1))
+//			{
+//				// in case there is anything there dump it out
+//				GenDebugLine();
+//				GenListString();			
+//				if (gInvokeMacro->nLines >= 1)
+//					GenSwitchFileNames(macroFileName);
+//			}
+
+			BEGIN(gInvokeState);
+			yy_scan_string(macroText);
+			gInvokeState = INITIAL;
+		}
+	}
+	else
+	{
+		if (gLastMacro != NULL)
+		{
+			gLastMacro->next = gTempMacro;
+		}
+		gLastMacro = gTempMacro;
+		BEGIN(MACROBODY);
+	}
+}
+
+//=====================================================================
+// Function:	FindSwizzleValue
+// Description:	see if valid swizzle value and return the bits
+// Parameters:	swizzleTex = pointer to characters to analyze
+// Returns:		unsigned int = bits for swizzle values, or 0 for error
+//=====================================================================
+unsigned int FindSwizzleValue(char *swizzleText)
+{
+	unsigned int swizzleBits;
+	unsigned int sLen;
+	unsigned int i;
+	unsigned int lastMask;
+
+	sLen = strlen(swizzleText);
+	swizzleBits = 0;
+	lastMask = 0;
+
+	for (i=0; i<sLen; i++)
+	{
+		switch (swizzleText[i])
+		{
+		case 'x':
+			swizzleBits |= (WRITEMASK_X << (4*(3-i)));
+			lastMask = WRITEMASK_X;
+			break;
+		case 'y':
+			swizzleBits |= (WRITEMASK_Y << (4*(3-i)));
+			lastMask = WRITEMASK_Y;
+			break;
+		case 'z':
+			swizzleBits |= (WRITEMASK_Z << (4*(3-i)));
+			lastMask = WRITEMASK_Z;
+			break;
+		case 'w':
+			swizzleBits |= (WRITEMASK_W << (4*(3-i)));
+			lastMask = WRITEMASK_W;
+			break;
+		}
+	}
+
+	for (; i<4; i++)
+	{
+		swizzleBits |= (lastMask << (4*(3-i)));
+	}
+
+	return swizzleBits;
+}
+
+#if 0
+unsigned int FindSwizzleValue(char *swizzleText)
+{
+
+	DWORD swizzleBits;
+	DWORD sLen;
+	DWORD i;
+	DWORD lastIndex;
+
+	sLen = strlen(swizzleText);
+	swizzleBits = 0;
+	lastIndex = 0;
+
+	for (i=0; i<sLen; i++)
+	{
+		switch (swizzleText[i])
+		{
+		case 'x':
+			swizzleBits |= (0 << (D3DVS_SWIZZLE_SHIFT + (i * 2)));
+			lastIndex = 0;
+			break;
+		case 'y':
+			swizzleBits |= (1 << (D3DVS_SWIZZLE_SHIFT + (i * 2)));
+			lastIndex = 1;
+			break;
+		case 'z':
+			swizzleBits |= (2 << (D3DVS_SWIZZLE_SHIFT + (i * 2)));
+			lastIndex = 2;
+			break;
+		case 'w':
+			swizzleBits |= (3 << (D3DVS_SWIZZLE_SHIFT + (i * 2)));
+			lastIndex = 3;
+			break;
+		}
+	}
+
+	for (; i<4; i++)
+	{
+		swizzleBits |= (lastIndex << (D3DVS_SWIZZLE_SHIFT + (i * 2)));
+	}
+
+	return swizzleBits;
+
+	
+}
+#endif
+
+//=====================================================================
+// Function:	FindRegisterMask
+// Description:	Look through register mask strings
+// Parameters:	findName = name to lookup
+// Returns:		unsigned int with token value
+//=====================================================================
+unsigned int MakeRegisterMask(char *findName)
+{
+
+	unsigned int regMask;
+	char *findFirst;
+
+	regMask = 0;
+
+	findFirst = strchr(findName, 'x');
+	if (findFirst != NULL)
+	{
+		if (strchr(findFirst+1, 'x') != NULL)
+		{
+			return 0;
+		}
+
+		regMask |= WRITEMASK_X;
+	}
+
+	findFirst = strchr(findName, 'y');
+	if (findFirst != NULL)
+	{
+		regMask |= WRITEMASK_Y;
+		// invalide write mask, must be swizzle
+		if (strchr(findFirst+1, 'x') != NULL)
+		{
+			return 0;
+		}
+
+		if (strchr(findFirst+1, 'y') != NULL)
+		{
+			return 0;
+		}
+
+	}
+
+	findFirst = strchr(findName, 'z');
+	if (findFirst != NULL)
+	{
+		regMask |= WRITEMASK_Z;
+		if (strchr(findFirst+1, 'x') != NULL)
+		{
+			return 0;
+		}
+
+		if (strchr(findFirst+1, 'y') != NULL)
+		{
+			return 0;
+		}
+
+		if (strchr(findFirst+1, 'z') != NULL)
+		{
+			return 0;
+		}
+	}
+
+	findFirst = strchr(findName, 'w');
+	if (findFirst != NULL)
+	{
+
+		regMask |= WRITEMASK_W;
+		if (strchr(findFirst+1, 'x') != NULL)
+		{
+			return 0;
+		}
+
+		if (strchr(findFirst+1, 'y') != NULL)
+		{
+			return 0;
+		}
+
+		if (strchr(findFirst+1, 'z') != NULL)
+		{
+			return 0;
+		}
+
+		if (strchr(findFirst+1, 'w') != NULL)
+		{
+			return 0;
+		}
+	}
+
+	return regMask;
+	
+}
+
+//=====================================================================
+// Function:	LexError
+// Description:	output an error to the stdout
+// Parameters:	typical printf like format
+// Returns:		.
+//=====================================================================
+void LexError(char *format, ...)
+{
+	char errstring[4096];
+	va_list marker;
+
+//	fprintf( stderr,"(%d) : Error : ", yylineno);
+	if ( gbInsideInclude )
+		{
+		sprintf( errstring, "%s", gCurFileName );
+		sprintf( errstring+strlen(errstring),"(%d) : Error : ", yylineno);
+		}
+	else
+		{
+		sprintf( errstring,"(%d) : Error : ", yylineno);
+		}
+
+	va_start(marker, format);
+//	vprintf(format, marker);
+	vsprintf(errstring+strlen(errstring), format, marker);
+	va_end(marker);
+	errors.set( errstring );
+}
+
+//=====================================================================
+// Function:	LexWarning
+// Description:	output a warning to the stdout
+// Parameters:	typical printf like format
+// Returns:		.
+//=====================================================================
+void LexWarning(char *format, ...)
+{
+	char errstring[4096];
+	va_list marker;
+
+//	fprintf( stderr,"(%d) : warning : ", yylineno);
+	if ( gbInsideInclude )
+		sprintf( errstring, "%s", gCurFileName );
+	sprintf( errstring+strlen(errstring),"(%d) : Warning : ", yylineno);
+//	sprintf( errstring,"(%d) : Warning : ", yylineno);
+
+	va_start(marker, format);
+//	vprintf(format, marker);
+	vsprintf(errstring+strlen(errstring), format, marker);
+	va_end(marker);
+	errors.set( errstring );
+}
+
+//=====================================================================
+// Function:	DebugUnhandledState
+// Description:	Come here in debug mode, when a state isn't handled
+//				for the Lexer
+// Parameters:	.
+// Returns:		.
+//=====================================================================
+void DebugUnhandledState()
+{
+	fprintf( stderr,"Unhandled state reached, with %s text.\n", yytext);
+}
+
+//=====================================================================
+// Function:	FindOpcode
+// Description:	Look through opcodes and see if in the table
+// Parameters:	findName = name to lookup
+// Returns:		OPCODEMAP * = pointer to opcode map entry, if found
+//=====================================================================
+OPCODEMAP *FindOpcode(char *findName)
+{
+
+	unsigned i;
+
+	// just do linear search for now
+	for (i=0; i<NUMOPCODES; i++)
+	{
+		if (!stricmp(theOpcodes[i].string, findName))
+		{
+			return &theOpcodes[i];
+		}
+
+	}
+
+	return NULL;
+}
+
+char *ReadTextFile(const char * filename)
+{
+	char path[3][32] = { ".\0",
+					     "../../data/programs\0",
+					     "../../../data/programs\0" };
+	char name[8192];
+	int i;
+
+    if (!filename) return 0;
+
+    struct _stat status;
+    int found = 0;
+    for ( i = 0; i < 3; i++ )
+    {
+	sprintf( name, "%s/%s", path[i], filename );
+
+	int fh = ::_open(name, _O_RDONLY);
+
+	if(fh != -1)
+        {
+            int result = _fstat( fh, &status );
+            if( result != 0 )
+            {
+                fprintf( stderr, "An fstat error occurred.\n" );
+                break;
+            }
+            ::_close( fh );
+	    found = i+1;
+            break;
+        }
+    }
+
+    if ( 0 == found )
+	{
+		fprintf(stderr,"Cannot open \"%s\" for stat read!\n", filename);
+		return NULL;
+	}
+    long size = status.st_size;
+
+    char * buf = new char[size+1];
+
+	FILE *fp = 0;
+    if (!(fp = fopen(name, "r")))
+	{
+		fprintf(stderr,"Cannot open \"%s\" for read!\n", name);
+		return NULL;
+	}
+
+	int bytes;
+	bytes = fread(buf, 1, size, fp);
+
+    buf[bytes] = 0;
+
+	fclose(fp);
+	return buf;
+}
+
+bool vs10_init_more();
+
+bool vs10_init(char* inputString)
+{
+	BEGIN(SAVELINE);
+    myin = inputString;
+	line_incr = 0;
+	return vs10_init_more();
+}
+
+#ifndef vs10_wrap
+int vs10_wrap(void)
+{
+  return(1);
+}
+#endif
Index: /RenderSystems/GL/src/nvparse/vsp1.0_impl.cpp
===================================================================
--- /RenderSystems/GL/src/nvparse/vsp1.0_impl.cpp	(revision 5)
+++ /RenderSystems/GL/src/nvparse/vsp1.0_impl.cpp	(revision 5)
@@ -0,0 +1,200 @@
+#include "nvparse_errors.h"
+#include "nvparse_externs.h"
+#include <string.h>
+#include <string>
+#include <ctype.h>
+
+#include <OgreGLPrerequisites.h>
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#	include <OpenGL/glu.h>
+#else
+#	include <GL/glu.h>
+#endif
+
+
+using namespace std;
+
+
+namespace
+{
+	void LoadProgram( GLenum target, GLuint id, char *instring );
+	void StrToUpper(char * string);
+}
+
+
+bool is_vsp10(const char * s)
+{
+	return ! strncmp(s, "!!VSP1.0", 8);
+}
+
+bool vsp10_init(char * s)
+{
+	static bool vpinit = false;
+	if (vpinit == false )
+	{
+      /*
+		if(! glh_init_extensions("GL_NV_vertex_program"))
+		{
+			errors.set("unable to initialize GL_NV_vertex_program");
+			return false;
+		}
+		else
+		{
+        */
+			vpinit = true;
+            /*
+		}
+        */
+	}
+	
+	errors.reset();
+	line_number = 1;
+	myin = s;
+	
+	return true;	
+}
+
+int vsp10_parse(int vpsid)
+{
+    LoadProgram( GL_VERTEX_STATE_PROGRAM_NV, vpsid, myin );
+	return 0;
+}
+
+namespace
+{
+	//.----------------------------------------------------------------------------.
+	//|   Function   : LoadProgram                                                 |
+	//|   Description: Load a program into GL, and report any errors encountered.  |
+	//.----------------------------------------------------------------------------.
+	void LoadProgram( GLenum target, GLuint id, char *instring )
+	{
+		GLint  errPos;
+		GLenum errCode;
+		const GLubyte *errString;
+		
+		int len = strlen(instring);
+		glLoadProgramNV( target, id, len, (const GLubyte *) instring );
+		if ( (errCode = glGetError()) != GL_NO_ERROR )
+		{
+			errString = gluErrorString( errCode );
+			
+			glGetIntegerv( GL_PROGRAM_ERROR_POSITION_NV, &errPos );
+			
+			int nlines = 1;
+			int nchar  = 1;
+			int i;
+			for ( i = 0; i < errPos; i++ )
+			{
+				if ( instring[i] == '\n' )
+				{
+					nlines++;
+					nchar = 1;
+				}
+				else
+				{
+					nchar++;
+				}
+			}
+			int start;
+			int end;
+			int flag = ((instring[errPos]==';') | (instring[errPos-1]==';')) ? 1 : 0;
+			for ( i = errPos; i >= 0; i-- )
+			{
+				start = i;
+				if ( flag && (start >= errPos-1)  )
+					continue;
+				if ( instring[i] == ';' )
+				{
+					if ( !flag )
+					{
+						start = i+1;
+						if ( instring[start] == '\n' )
+							start++;
+					}
+					break;
+				}
+			}
+			for ( i = errPos; i < len; i++ )
+			{
+				end = i;
+				if ( instring[i] == ';' && end > start)
+				{
+					break;
+				}
+			}
+			if ( errPos - start > 30 )
+			{
+				start = errPos - 30;
+			}
+			if ( end - errPos > 30 )
+			{
+				end = errPos + 30;
+			}
+			
+			char substring[96];
+			memset( substring, 0, 96 );
+			strncpy( substring, &(instring[start]), end-start+1 );
+			char str[256];
+			//sprintf( str, "error at line %d character %d\n    \"%s\"\n", nlines, nchar, substring );
+			sprintf( str, "error at line %d character %d\n\"%s\"\n", nlines, nchar, substring );
+			int width = errPos-start;
+			for ( i = 0; i < width; i++ )
+			{
+				strcat( str, " " );
+			}
+			strcat( str, "|\n" );
+			for ( i = 0; i < width; i++ )
+			{
+				strcat( str, " " );
+			}
+			strcat( str, "^\n" );
+			
+			errors.set( str );
+		}
+	}
+	
+	
+	//.----------------------------------------------------------------------------.
+	//|   Function   : StrToUpper                                                  |
+	//|   Description: Converts all lowercase chars in a string to uppercase.      |
+	//.----------------------------------------------------------------------------.
+	void StrToUpper(char *string)
+	{
+		for (unsigned int i = 0; i < strlen(string); i++)
+			string[i] = toupper(string[i]);
+	}
+	
+}
+/*
+else if(!strncmp(instring, "!!VSP1.0", 8))
+{
+if (vpinit == 0 )
+{
+if(! glh_init_extensions("GL_NV_vertex_program"))
+{
+errors.set("unable to initialize GL_NV_vertex_program");
+free(instring);
+return;
+}
+else
+{
+vpinit = 1;
+}
+}
+
+  errors.reset();
+  line_number = 1;
+  
+	va_list ap;
+	va_start(ap, input_string);
+	int vpsid = va_arg(ap,int);
+	va_end(ap);
+	
+	  if ( glGetError() != GL_NO_ERROR )
+	  {
+	  errors.set( "Previous GL_ERROR prior to vertex state program parsing." );
+	  }
+	  
+        LoadProgram( GL_VERTEX_STATE_PROGRAM_NV, vpsid, instring );
+		}
+		*/
Index: /RenderSystems/GL/src/nvparse/winheaders/unistd.h
===================================================================
--- /RenderSystems/GL/src/nvparse/winheaders/unistd.h	(revision 5)
+++ /RenderSystems/GL/src/nvparse/winheaders/unistd.h	(revision 5)
@@ -0,0 +1,1 @@
+// to make flex and vc++ play nice together
Index: /RenderSystems/GL/src/win32/Makefile.am
===================================================================
--- /RenderSystems/GL/src/win32/Makefile.am	(revision 5)
+++ /RenderSystems/GL/src/win32/Makefile.am	(revision 5)
@@ -0,0 +1,12 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/RenderSystems/GL/include \
+           -I$(top_srcdir)/OgreMain/include $(GLSUPPORT_CFLAGS) \
+           -I$(top_srcdir)/PlatformManagers/$(OGRE_PLATFORM)/include \
+           $(CFLAGS_VISIBILITY)
+
+noinst_LTLIBRARIES = libsupport.la
+
+libsupport_la_SOURCES = ../OgreWin32GLSupport.cpp \
+		../OgreWin32RenderTexture.cpp \
+		../OgreWin32Window.cpp \
+		OgreWin32Context.cpp
+libsupport_la_LDFLAGS =
Index: /RenderSystems/GL/src/win32/Makefile.in
===================================================================
--- /RenderSystems/GL/src/win32/Makefile.in	(revision 5)
+++ /RenderSystems/GL/src/win32/Makefile.in	(revision 5)
@@ -0,0 +1,532 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = RenderSystems/GL/src/win32
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libsupport_la_LIBADD =
+am_libsupport_la_OBJECTS = OgreWin32GLSupport.lo \
+	OgreWin32RenderTexture.lo OgreWin32Window.lo \
+	OgreWin32Context.lo
+libsupport_la_OBJECTS = $(am_libsupport_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libsupport_la_SOURCES)
+DIST_SOURCES = $(libsupport_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/RenderSystems/GL/include \
+           -I$(top_srcdir)/OgreMain/include $(GLSUPPORT_CFLAGS) \
+           -I$(top_srcdir)/PlatformManagers/$(OGRE_PLATFORM)/include \
+           $(CFLAGS_VISIBILITY)
+
+noinst_LTLIBRARIES = libsupport.la
+libsupport_la_SOURCES = ../OgreWin32GLSupport.cpp \
+		../OgreWin32RenderTexture.cpp \
+		../OgreWin32Window.cpp \
+		OgreWin32Context.cpp
+
+libsupport_la_LDFLAGS = 
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  RenderSystems/GL/src/win32/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  RenderSystems/GL/src/win32/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libsupport.la: $(libsupport_la_OBJECTS) $(libsupport_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libsupport_la_LDFLAGS) $(libsupport_la_OBJECTS) $(libsupport_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreWin32Context.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreWin32GLSupport.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreWin32RenderTexture.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreWin32Window.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+OgreWin32GLSupport.lo: ../OgreWin32GLSupport.cpp
+@am__fastdepCXX_TRUE@	if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OgreWin32GLSupport.lo -MD -MP -MF "$(DEPDIR)/OgreWin32GLSupport.Tpo" -c -o OgreWin32GLSupport.lo `test -f '../OgreWin32GLSupport.cpp' || echo '$(srcdir)/'`../OgreWin32GLSupport.cpp; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/OgreWin32GLSupport.Tpo" "$(DEPDIR)/OgreWin32GLSupport.Plo"; else rm -f "$(DEPDIR)/OgreWin32GLSupport.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../OgreWin32GLSupport.cpp' object='OgreWin32GLSupport.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OgreWin32GLSupport.lo `test -f '../OgreWin32GLSupport.cpp' || echo '$(srcdir)/'`../OgreWin32GLSupport.cpp
+
+OgreWin32RenderTexture.lo: ../OgreWin32RenderTexture.cpp
+@am__fastdepCXX_TRUE@	if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OgreWin32RenderTexture.lo -MD -MP -MF "$(DEPDIR)/OgreWin32RenderTexture.Tpo" -c -o OgreWin32RenderTexture.lo `test -f '../OgreWin32RenderTexture.cpp' || echo '$(srcdir)/'`../OgreWin32RenderTexture.cpp; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/OgreWin32RenderTexture.Tpo" "$(DEPDIR)/OgreWin32RenderTexture.Plo"; else rm -f "$(DEPDIR)/OgreWin32RenderTexture.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../OgreWin32RenderTexture.cpp' object='OgreWin32RenderTexture.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OgreWin32RenderTexture.lo `test -f '../OgreWin32RenderTexture.cpp' || echo '$(srcdir)/'`../OgreWin32RenderTexture.cpp
+
+OgreWin32Window.lo: ../OgreWin32Window.cpp
+@am__fastdepCXX_TRUE@	if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT OgreWin32Window.lo -MD -MP -MF "$(DEPDIR)/OgreWin32Window.Tpo" -c -o OgreWin32Window.lo `test -f '../OgreWin32Window.cpp' || echo '$(srcdir)/'`../OgreWin32Window.cpp; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/OgreWin32Window.Tpo" "$(DEPDIR)/OgreWin32Window.Plo"; else rm -f "$(DEPDIR)/OgreWin32Window.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../OgreWin32Window.cpp' object='OgreWin32Window.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o OgreWin32Window.lo `test -f '../OgreWin32Window.cpp' || echo '$(srcdir)/'`../OgreWin32Window.cpp
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /RenderSystems/GL/src/win32/OgreGLUtil.h
===================================================================
--- /RenderSystems/GL/src/win32/OgreGLUtil.h	(revision 5)
+++ /RenderSystems/GL/src/win32/OgreGLUtil.h	(revision 5)
@@ -0,0 +1,40 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://ogre.sourgeforge.net/
+
+Copyright (c) 2000-2003 Steven J. Streeting
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/gpl.html.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef INCL_OGRE_GLUTIL_H
+#define INCL_OGRE_GLUTIL_H
+
+#include "OgreWin32GLSupport.h"
+
+namespace Ogre {
+    
+inline GLSupport* getGLSupport()
+{
+    return new Win32GLSupport();
+}
+
+};
+
+#endif // INCL_OGRE_GLUTIL_H
Index: /RenderSystems/GL/src/win32/OgreWin32Context.cpp
===================================================================
--- /RenderSystems/GL/src/win32/OgreWin32Context.cpp	(revision 5)
+++ /RenderSystems/GL/src/win32/OgreWin32Context.cpp	(revision 5)
@@ -0,0 +1,110 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreWin32Context.h"
+#include "OgreException.h"
+#include "OgreGLRenderSystem.h"
+#include "OgreRoot.h"
+
+namespace Ogre {
+
+    Win32Context::Win32Context(HDC     HDC,
+                 HGLRC   Glrc):
+        mHDC(HDC),
+        mGlrc(Glrc)
+    {
+    }
+    
+    Win32Context::~Win32Context()
+    {
+		// NB have to do this is subclass to ensure any methods called back
+		// are on this subclass and not half-destructed superclass
+		GLRenderSystem *rs = static_cast<GLRenderSystem*>(Root::getSingleton().getRenderSystem());
+		rs->_unregisterContext(this);
+    }
+        
+    void Win32Context::setCurrent()
+    {
+         wglMakeCurrent(mHDC, mGlrc);      
+    }
+	void Win32Context::endCurrent()
+	{
+		wglMakeCurrent(NULL, NULL);
+	}
+
+	String translateError()
+	{
+
+		int winError = GetLastError();
+		char* errDesc;
+		int i;
+
+		errDesc = new char[255];
+		// Try windows errors first
+		i = FormatMessage(
+			FORMAT_MESSAGE_FROM_SYSTEM |
+			FORMAT_MESSAGE_IGNORE_INSERTS,
+			NULL,
+			winError,
+			MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+			(LPTSTR) errDesc,
+			255,
+			NULL
+			);
+
+		return String(errDesc);
+	}
+	GLContext* Win32Context::clone() const
+	{
+		// Create new context based on own HDC
+		HGLRC newCtx = wglCreateContext(mHDC);
+		
+		if (!newCtx)
+		{
+			OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
+				"Error calling wglCreateContext", "Win32Context::clone");
+		}
+
+		HGLRC oldrc = wglGetCurrentContext();
+		HDC oldhdc = wglGetCurrentDC();
+		wglMakeCurrent(NULL, NULL);
+		// Share lists with old context
+	    if (!wglShareLists(mGlrc, newCtx))
+		{
+			String errorMsg = translateError();
+			wglDeleteContext(newCtx);
+			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, String("wglShareLists() failed: ") + errorMsg, "Win32Context::clone");
+		}
+		// restore old context
+		wglMakeCurrent(oldhdc, oldrc);
+		
+
+		return new Win32Context(mHDC, newCtx);
+	}
+}
Index: /RenderSystems/Makefile.am
===================================================================
--- /RenderSystems/Makefile.am	(revision 5)
+++ /RenderSystems/Makefile.am	(revision 5)
@@ -0,0 +1,5 @@
+SUBDIRS = GL
+
+if BUILD_DX9RENDERSYSTEM
+SUBDIRS += Direct3D9
+endif
Index: /RenderSystems/Makefile.in
===================================================================
--- /RenderSystems/Makefile.in	(revision 5)
+++ /RenderSystems/Makefile.in	(revision 5)
@@ -0,0 +1,545 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+@BUILD_DX9RENDERSYSTEM_TRUE@am__append_1 = Direct3D9
+subdir = RenderSystems
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = GL Direct3D9
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = GL $(am__append_1)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  RenderSystems/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  RenderSystems/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/BSP/Makefile.am
===================================================================
--- /Samples/BSP/Makefile.am	(revision 5)
+++ /Samples/BSP/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src 
Index: /Samples/BSP/Makefile.in
===================================================================
--- /Samples/BSP/Makefile.in	(revision 5)
+++ /Samples/BSP/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/BSP
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src 
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/BSP/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/BSP/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/BSP/scripts/Demo_BSP.cbp
===================================================================
--- /Samples/BSP/scripts/Demo_BSP.cbp	(revision 5)
+++ /Samples/BSP/scripts/Demo_BSP.cbp	(revision 5)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_BSP" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_BSP.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_BSP.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\BSP.cpp" />
+		<Unit filename="..\..\Common\include\ExampleApplication.h" />
+		<Unit filename="..\..\Common\include\ExampleFrameListener.h" />
+		<Unit filename="..\..\Common\include\ExampleLoadingBar.h" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/BSP/scripts/Demo_BSP.vcproj
===================================================================
--- /Samples/BSP/scripts/Demo_BSP.vcproj	(revision 5)
+++ /Samples/BSP/scripts/Demo_BSP.vcproj	(revision 5)
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_BSP"
+	ProjectGUID="{D5EAD9CA-691E-4367-BFCC-C671581851E4}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_BSP.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_BSP.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_BSP.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\BSP.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\..\Common\include\ExampleApplication.h">
+			</File>
+			<File
+				RelativePath="..\..\Common\include\ExampleFrameListener.h">
+			</File>
+			<File
+				RelativePath="..\..\Common\include\ExampleLoadingBar.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/BSP/scripts/Demo_BSP_linux.cbp
===================================================================
--- /Samples/BSP/scripts/Demo_BSP_linux.cbp	(revision 5)
+++ /Samples/BSP/scripts/Demo_BSP_linux.cbp	(revision 5)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_BSP" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_BSP_d" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_BSP" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../../Samples/Common/bin/$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="../src/BSP.cpp" />
+		<Unit filename="../../Common/include/ExampleApplication.h" />
+		<Unit filename="../../Common/include/ExampleFrameListener.h" />
+		<Unit filename="../../Common/include/ExampleLoadingBar.h" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/BSP/scripts/Demo_BSP_stlp.cbp
===================================================================
--- /Samples/BSP/scripts/Demo_BSP_stlp.cbp	(revision 5)
+++ /Samples/BSP/scripts/Demo_BSP_stlp.cbp	(revision 5)
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_BSP" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_BSP.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_BSP.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\BSP.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\Common\include\ExampleApplication.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\Common\include\ExampleFrameListener.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\..\Common\include\ExampleLoadingBar.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/BSP/scripts/Demo_BSP_vc8.vcproj
===================================================================
--- /Samples/BSP/scripts/Demo_BSP_vc8.vcproj	(revision 5)
+++ /Samples/BSP/scripts/Demo_BSP_vc8.vcproj	(revision 5)
@@ -0,0 +1,234 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_BSP"
+	ProjectGUID="{D5EAD9CA-691E-4367-BFCC-C671581851E4}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\PlugIns\BSPSceneManager\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_BSP.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_BSP.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_BSP.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\BSP.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\..\Common\include\ExampleApplication.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\Common\include\ExampleFrameListener.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\Common\include\ExampleLoadingBar.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/BSP/scripts/Demo_BSP_vc8.vcproj.user
===================================================================
--- /Samples/BSP/scripts/Demo_BSP_vc8.vcproj.user	(revision 5)
+++ /Samples/BSP/scripts/Demo_BSP_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/BSP/src/BSP.cpp
===================================================================
--- /Samples/BSP/src/BSP.cpp	(revision 5)
+++ /Samples/BSP/src/BSP.cpp	(revision 5)
@@ -0,0 +1,154 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+#include "Ogre.h"
+#include "ExampleApplication.h"
+#include "ExampleLoadingBar.h"
+
+/**
+    \file 
+        BSP.cpp
+    \brief
+        Shows the indoor level rendering (Binary Space Partition or BSP based).
+    \par
+        Also demonstrates loading levels from Quake3Arena and using
+        curved bezier surfaces (as demonstrated in the Bezier example)
+        in a large level.
+*/
+
+class BspApplication : public ExampleApplication
+{
+public:
+	BspApplication()
+	{
+
+
+	}
+
+protected:
+
+	String mQuakePk3;
+	String mQuakeLevel;
+	ExampleLoadingBar mLoadingBar;
+
+	void loadResources(void)
+	{
+
+		mLoadingBar.start(mWindow, 1, 1, 0.75);
+
+		// Turn off rendering of everything except overlays
+		mSceneMgr->clearSpecialCaseRenderQueues();
+		mSceneMgr->addSpecialCaseRenderQueue(RENDER_QUEUE_OVERLAY);
+		mSceneMgr->setSpecialCaseRenderQueueMode(SceneManager::SCRQM_INCLUDE);
+
+		// Set up the world geometry link
+		ResourceGroupManager::getSingleton().linkWorldGeometryToResourceGroup(
+			ResourceGroupManager::getSingleton().getWorldResourceGroupName(), 
+			mQuakeLevel, mSceneMgr);
+
+		// Initialise the rest of the resource groups, parse scripts etc
+		ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+		ResourceGroupManager::getSingleton().loadResourceGroup(
+			ResourceGroupManager::getSingleton().getWorldResourceGroupName(),
+			false, true);
+
+		// Back to full rendering
+		mSceneMgr->clearSpecialCaseRenderQueues();
+		mSceneMgr->setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE);
+
+		mLoadingBar.finish();
+
+
+	}
+
+	// Override resource sources (include Quake3 archives)
+	void setupResources(void)
+	{
+
+		// Load Quake3 locations from a file
+		ConfigFile cf;
+
+		cf.load("quake3settings.cfg");
+
+		mQuakePk3 = cf.getSetting("Pak0Location");
+		mQuakeLevel = cf.getSetting("Map");
+
+		ExampleApplication::setupResources();
+		ResourceGroupManager::getSingleton().addResourceLocation(
+			mQuakePk3, "Zip", ResourceGroupManager::getSingleton().getWorldResourceGroupName(), true);
+
+	}
+	// Override scene manager (use indoor instead of generic)
+	void chooseSceneManager(void)
+	{
+		mSceneMgr = mRoot->createSceneManager("BspSceneManager");
+	}
+	// Scene creation
+	void createScene(void)
+	{
+
+		// modify camera for close work
+		mCamera->setNearClipDistance(4);
+		mCamera->setFarClipDistance(4000);
+
+		// Also change position, and set Quake-type orientation
+		// Get random player start point
+		ViewPoint vp = mSceneMgr->getSuggestedViewpoint(true);
+		mCamera->setPosition(vp.position);
+		mCamera->pitch(Degree(90)); // Quake uses X/Y horizon, Z up
+		mCamera->rotate(vp.orientation);
+		// Don't yaw along variable axis, causes leaning
+		mCamera->setFixedYawAxis(true, Vector3::UNIT_Z);
+
+
+	}
+
+};
+
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char**argv)
+#endif
+{
+    // Create application object
+    BspApplication app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << 
+            e.getFullDescription().c_str() << std::endl;
+#endif
+    }
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/BSP/src/Makefile.am
===================================================================
--- /Samples/BSP/src/Makefile.am	(revision 5)
+++ /Samples/BSP/src/Makefile.am	(revision 5)
@@ -0,0 +1,7 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/BSP/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = BSP
+
+BSP_SOURCES = BSP.cpp
+BSP_LDFLAGS = -L$(top_builddir)/OgreMain/src
+BSP_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/BSP/src/Makefile.in
===================================================================
--- /Samples/BSP/src/Makefile.in	(revision 5)
+++ /Samples/BSP/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = BSP$(EXEEXT)
+subdir = Samples/BSP/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_BSP_OBJECTS = BSP.$(OBJEXT)
+BSP_OBJECTS = $(am_BSP_OBJECTS)
+am__DEPENDENCIES_1 =
+BSP_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(BSP_SOURCES)
+DIST_SOURCES = $(BSP_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/BSP/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+BSP_SOURCES = BSP.cpp
+BSP_LDFLAGS = -L$(top_builddir)/OgreMain/src
+BSP_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/BSP/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/BSP/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+BSP$(EXEEXT): $(BSP_OBJECTS) $(BSP_DEPENDENCIES) 
+	@rm -f BSP$(EXEEXT)
+	$(CXXLINK) $(BSP_LDFLAGS) $(BSP_OBJECTS) $(BSP_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BSP.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/BezierPatch/Makefile.am
===================================================================
--- /Samples/BezierPatch/Makefile.am	(revision 5)
+++ /Samples/BezierPatch/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/BezierPatch/Makefile.in
===================================================================
--- /Samples/BezierPatch/Makefile.in	(revision 5)
+++ /Samples/BezierPatch/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/BezierPatch
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/BezierPatch/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/BezierPatch/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/BezierPatch/include/Bezier.h
===================================================================
--- /Samples/BezierPatch/include/Bezier.h	(revision 5)
+++ /Samples/BezierPatch/include/Bezier.h	(revision 5)
@@ -0,0 +1,212 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+
+/**
+    \file 
+        Bezier.h
+    \brief
+        Specialisation of OGRE's framework application to show off
+        the bezier patch support.
+*/
+
+#include "ExampleApplication.h"
+
+// Hack struct for test
+PatchMeshPtr patch;
+Pass* patchPass;
+
+// Event handler to add ability to alter subdivision
+class BezierListener : public ExampleFrameListener
+{
+protected:
+public:
+    BezierListener(RenderWindow* win, Camera* cam)
+        : ExampleFrameListener(win, cam)
+    {
+        
+    }
+
+    bool frameStarted(const FrameEvent& evt)
+    {
+	if( ExampleFrameListener::frameStarted(evt) == false )
+		return false;
+
+        static Real timeLapse = 0.0f;
+        static Real factor = 0.0;
+        static bool wireframe = 0;
+
+
+        timeLapse += evt.timeSinceLastFrame;
+
+        // Prgressively grow the patch
+        if (timeLapse > 1.0f)
+        {
+            factor += 0.2;
+
+            if (factor > 1.0f) 
+            {
+                wireframe = !wireframe;
+                //mCamera->setPolygonMode(wireframe ? PM_WIREFRAME : PM_SOLID);
+                patchPass->setPolygonMode(wireframe ? PM_WIREFRAME : PM_SOLID);
+                factor = 0.0f;
+
+            }
+
+            patch->setSubdivision(factor);
+            mDebugText = "Bezier subdivision factor: " + StringConverter::toString(factor);
+            timeLapse = 0.0f;
+
+        }
+
+        // Call default
+        return true;
+    }
+};
+
+       
+class BezierApplication : public ExampleApplication
+{
+protected:
+    VertexDeclaration* patchDecl;
+    float* patchCtlPoints;
+
+public:
+    BezierApplication() : patchDecl(NULL), patchCtlPoints(NULL) { }
+    ~BezierApplication()
+    {
+        if (patchCtlPoints)
+            delete [] patchCtlPoints;
+
+        // patch vertex declaration will be deleted automatically
+    }
+
+protected:
+
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+    #pragma pack(push)
+    #pragma pack(1)
+#endif
+    struct PatchVertex {
+        float x, y, z;
+        float nx, ny, nz;
+        float u, v;
+    };
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+    #pragma pack(pop)
+#endif
+
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.2, 0.2, 0.2));
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        l->setType(Light::LT_DIRECTIONAL);
+        l->setDirection(-0.5, -0.5, 0);
+
+        // Create patch
+        patchDecl = HardwareBufferManager::getSingleton().createVertexDeclaration();
+        patchDecl->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+        patchDecl->addElement(0, sizeof(float)*3, VET_FLOAT3, VES_NORMAL);
+        patchDecl->addElement(0, sizeof(float)*6, VET_FLOAT2, VES_TEXTURE_COORDINATES, 0);
+
+        // Make a 3x3 patch for test
+        patchCtlPoints = (float*)( new PatchVertex[9] );
+
+        // Patch data
+        PatchVertex *pVert = (PatchVertex*)patchCtlPoints;
+
+        pVert->x = -500.0; pVert->y = 200.0; pVert->z = -500.0;
+        pVert->nx = -0.5; pVert->ny = 0.5; pVert->nz = 0.0;
+        pVert->u = 0.0; pVert->v = 0.0;
+        pVert++;
+        pVert->x = 0.0; pVert->y = 500.0; pVert->z = -750.0;
+        pVert->nx = 0.0; pVert->ny = 0.5; pVert->nz = 0.0;
+        pVert->u = 0.5; pVert->v = 0.0;
+        pVert++;
+        pVert->x = 500.0; pVert->y = 1000.0; pVert->z = -500.0;
+        pVert->nx = 0.5; pVert->ny = 0.5; pVert->nz = 0.0;
+        pVert->u = 1.0; pVert->v = 0.0;
+        pVert++;
+
+        pVert->x = -500.0; pVert->y = 0.0; pVert->z = 0.0;
+        pVert->nx = -0.5; pVert->ny = 0.5; pVert->nz = 0.0;
+        pVert->u = 0.0; pVert->v = 0.5;
+        pVert++;
+        pVert->x = 0.0; pVert->y = 500.0; pVert->z = 0.0;
+        pVert->nx = 0.0; pVert->ny = 0.5; pVert->nz = 0.0;
+        pVert->u = 0.5; pVert->v = 0.5;
+        pVert++;
+        pVert->x = 500.0; pVert->y = -50.0; pVert->z = 0.0;
+        pVert->nx = 0.5; pVert->ny = 0.5; pVert->nz = 0.0;
+        pVert->u = 1.0; pVert->v = 0.5;
+        pVert++;
+
+        pVert->x = -500.0; pVert->y = 0.0; pVert->z = 500.0;
+        pVert->nx = -0.5; pVert->ny = 0.5; pVert->nz = 0.0;
+        pVert->u = 0.0; pVert->v = 1.0;
+        pVert++;
+        pVert->x = 0.0; pVert->y = 500.0; pVert->z = 500.0;
+        pVert->nx = 0.0; pVert->ny = 0.5; pVert->nz = 0.0;
+        pVert->u = 0.5; pVert->v = 1.0;
+        pVert++;
+        pVert->x = 500.0; pVert->y = 200.0; pVert->z = 800.0;
+        pVert->nx = 0.5; pVert->ny = 0.5; pVert->nz = 0.0;
+        pVert->u = 1.0; pVert->v = 1.0;
+        pVert++;
+
+
+        patch = MeshManager::getSingleton().createBezierPatch(
+            "Bezier1", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+            patchCtlPoints, patchDecl, 
+            3, 3, 5, 5, PatchSurface::VS_BOTH);
+
+        // Start patch at 0 detail
+        patch->setSubdivision(0.0f);
+        // Create entity based on patch
+        Entity* patchEntity = mSceneMgr->createEntity("Entity1", "Bezier1");
+
+        MaterialPtr pMat = MaterialManager::getSingleton().create("TextMat", 
+            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+        pMat->getTechnique(0)->getPass(0)->createTextureUnitState( "BumpyMetal.jpg" );
+        patchEntity->setMaterialName("TextMat");
+		patchPass = pMat->getTechnique(0)->getPass(0);
+
+        // Attach the entity to the root of the scene
+        mSceneMgr->getRootSceneNode()->attachObject(patchEntity);
+
+        mCamera->setPosition(500,500, 1500);
+        mCamera->lookAt(0,200,-300);
+
+    }
+    void destroyScene(void)
+    {
+        // free up the pointer before we shut down OGRE
+        patch.setNull();
+    }
+	void createFrameListener(void)
+    {
+		// This is where we instantiate our own frame listener
+        mFrameListener= new BezierListener(mWindow, mCamera);
+        mRoot->addFrameListener(mFrameListener);
+
+    }
+
+};
Index: /Samples/BezierPatch/include/Makefile.am
===================================================================
--- /Samples/BezierPatch/include/Makefile.am	(revision 5)
+++ /Samples/BezierPatch/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = Bezier.h
Index: /Samples/BezierPatch/include/Makefile.in
===================================================================
--- /Samples/BezierPatch/include/Makefile.in	(revision 5)
+++ /Samples/BezierPatch/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/BezierPatch/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = Bezier.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/BezierPatch/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/BezierPatch/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/BezierPatch/scripts/Demo_BezierPatch.cbp
===================================================================
--- /Samples/BezierPatch/scripts/Demo_BezierPatch.cbp	(revision 5)
+++ /Samples/BezierPatch/scripts/Demo_BezierPatch.cbp	(revision 5)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_BezierPatch" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_BezierPatch.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_BezierPatch.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\Bezier.h" />
+		<Unit filename="..\src\Bezier.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/BezierPatch/scripts/Demo_BezierPatch.vcproj
===================================================================
--- /Samples/BezierPatch/scripts/Demo_BezierPatch.vcproj	(revision 5)
+++ /Samples/BezierPatch/scripts/Demo_BezierPatch.vcproj	(revision 5)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_BezierPatch"
+	ProjectGUID="{EDD4B978-5ABA-448B-8DA7-A02F99714D66}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_BezierPatch.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_BezierPatch.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_BezierPatch.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\Bezier.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\Bezier.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/BezierPatch/scripts/Demo_BezierPatch_linux.cbp
===================================================================
--- /Samples/BezierPatch/scripts/Demo_BezierPatch_linux.cbp	(revision 5)
+++ /Samples/BezierPatch/scripts/Demo_BezierPatch_linux.cbp	(revision 5)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_BezierPatch" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/$(TARGET_NAME)/Demo_BezierPatch_d" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/$(TARGET_NAME)" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/$(TARGET_NAME)/Demo_BezierPatch" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/$(TARGET_NAME)" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/Bezier.h" />
+		<Unit filename="../src/Bezier.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/BezierPatch/scripts/Demo_BezierPatch_stlp.cbp
===================================================================
--- /Samples/BezierPatch/scripts/Demo_BezierPatch_stlp.cbp	(revision 5)
+++ /Samples/BezierPatch/scripts/Demo_BezierPatch_stlp.cbp	(revision 5)
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_BezierPatch" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_BezierPatch.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DWIN32" />
+					<Add option="-D_DEBUG" />
+					<Add option="-D_WINDOWS" />
+					<Add option="-D_STLP_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_BezierPatch.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DWIN32" />
+					<Add option="-DNDEBUG" />
+					<Add option="-D_WINDOWS" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-D_STLP_USE_DYNAMIC_LIB" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\Bezier.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\Bezier.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/BezierPatch/scripts/Demo_BezierPatch_vc8.vcproj
===================================================================
--- /Samples/BezierPatch/scripts/Demo_BezierPatch_vc8.vcproj	(revision 5)
+++ /Samples/BezierPatch/scripts/Demo_BezierPatch_vc8.vcproj	(revision 5)
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_BezierPatch"
+	ProjectGUID="{EDD4B978-5ABA-448B-8DA7-A02F99714D66}"
+	RootNamespace="Demo_BezierPatch"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_BezierPatch.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_BezierPatch.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_BezierPatch.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\Bezier.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\Bezier.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/BezierPatch/scripts/Demo_BezierPatch_vc8.vcproj.user
===================================================================
--- /Samples/BezierPatch/scripts/Demo_BezierPatch_vc8.vcproj.user	(revision 5)
+++ /Samples/BezierPatch/scripts/Demo_BezierPatch_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/BezierPatch/src/Bezier.cpp
===================================================================
--- /Samples/BezierPatch/src/Bezier.cpp	(revision 5)
+++ /Samples/BezierPatch/src/Bezier.cpp	(revision 5)
@@ -0,0 +1,55 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        Bezier.cpp
+    \brief
+        Shows OGRE's bezier patch feature
+*/
+
+#include "Bezier.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+    // Create application object
+    BezierApplication app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL );
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+
+    return 0;
+}
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/BezierPatch/src/Makefile.am
===================================================================
--- /Samples/BezierPatch/src/Makefile.am	(revision 5)
+++ /Samples/BezierPatch/src/Makefile.am	(revision 5)
@@ -0,0 +1,7 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/BezierPatch/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = Bezier
+
+Bezier_SOURCES = Bezier.cpp
+Bezier_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Bezier_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/BezierPatch/src/Makefile.in
===================================================================
--- /Samples/BezierPatch/src/Makefile.in	(revision 5)
+++ /Samples/BezierPatch/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = Bezier$(EXEEXT)
+subdir = Samples/BezierPatch/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_Bezier_OBJECTS = Bezier.$(OBJEXT)
+Bezier_OBJECTS = $(am_Bezier_OBJECTS)
+am__DEPENDENCIES_1 =
+Bezier_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Bezier_SOURCES)
+DIST_SOURCES = $(Bezier_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/BezierPatch/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+Bezier_SOURCES = Bezier.cpp
+Bezier_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Bezier_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/BezierPatch/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/BezierPatch/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+Bezier$(EXEEXT): $(Bezier_OBJECTS) $(Bezier_DEPENDENCIES) 
+	@rm -f Bezier$(EXEEXT)
+	$(CXXLINK) $(Bezier_LDFLAGS) $(Bezier_OBJECTS) $(Bezier_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Bezier.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/CameraTrack/Makefile.am
===================================================================
--- /Samples/CameraTrack/Makefile.am	(revision 5)
+++ /Samples/CameraTrack/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src 
Index: /Samples/CameraTrack/Makefile.in
===================================================================
--- /Samples/CameraTrack/Makefile.in	(revision 5)
+++ /Samples/CameraTrack/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/CameraTrack
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src 
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/CameraTrack/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/CameraTrack/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/CameraTrack/bin/debug/.keepme
===================================================================
--- /Samples/CameraTrack/bin/debug/.keepme	(revision 5)
+++ /Samples/CameraTrack/bin/debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/CameraTrack/bin/release/.keepme
===================================================================
--- /Samples/CameraTrack/bin/release/.keepme	(revision 5)
+++ /Samples/CameraTrack/bin/release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/CameraTrack/include/.keepme
===================================================================
--- /Samples/CameraTrack/include/.keepme	(revision 5)
+++ /Samples/CameraTrack/include/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/CameraTrack/obj/Debug/.keepme
===================================================================
--- /Samples/CameraTrack/obj/Debug/.keepme	(revision 5)
+++ /Samples/CameraTrack/obj/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/CameraTrack/obj/Release/.keepme
===================================================================
--- /Samples/CameraTrack/obj/Release/.keepme	(revision 5)
+++ /Samples/CameraTrack/obj/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/CameraTrack/scripts/Demo_CameraTrack.cbp
===================================================================
--- /Samples/CameraTrack/scripts/Demo_CameraTrack.cbp	(revision 5)
+++ /Samples/CameraTrack/scripts/Demo_CameraTrack.cbp	(revision 5)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_CameraTrack" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_CameraTrack.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_CameraTrack.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\CameraTrack.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/CameraTrack/scripts/Demo_CameraTrack.vcproj
===================================================================
--- /Samples/CameraTrack/scripts/Demo_CameraTrack.vcproj	(revision 5)
+++ /Samples/CameraTrack/scripts/Demo_CameraTrack.vcproj	(revision 5)
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_CameraTrack"
+	ProjectGUID="{161D4349-5DB6-4BCC-A890-FC20A2BB181A}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_CameraTrack.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_CameraTrack.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_CameraTrack.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\CameraTrack.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/CameraTrack/scripts/Demo_CameraTrack_linux.cbp
===================================================================
--- /Samples/CameraTrack/scripts/Demo_CameraTrack_linux.cbp	(revision 5)
+++ /Samples/CameraTrack/scripts/Demo_CameraTrack_linux.cbp	(revision 5)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_CameraTrack" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="../../Common/bin/Debug/Demo_CameraTrack_d" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="../../Common/bin/Release/Demo_CameraTrack" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../src/CameraTrack.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/CameraTrack/scripts/Demo_CameraTrack_stlp.cbp
===================================================================
--- /Samples/CameraTrack/scripts/Demo_CameraTrack_stlp.cbp	(revision 5)
+++ /Samples/CameraTrack/scripts/Demo_CameraTrack_stlp.cbp	(revision 5)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_CameraTrack" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_CameraTrack.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_CameraTrack.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\CameraTrack.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/CameraTrack/scripts/Demo_CameraTrack_vc8.vcproj
===================================================================
--- /Samples/CameraTrack/scripts/Demo_CameraTrack_vc8.vcproj	(revision 5)
+++ /Samples/CameraTrack/scripts/Demo_CameraTrack_vc8.vcproj	(revision 5)
@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_CameraTrack"
+	ProjectGUID="{161D4349-5DB6-4BCC-A890-FC20A2BB181A}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_CameraTrack.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_CameraTrack.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_CameraTrack.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\CameraTrack.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/CameraTrack/scripts/Demo_CameraTrack_vc8.vcproj.user
===================================================================
--- /Samples/CameraTrack/scripts/Demo_CameraTrack_vc8.vcproj.user	(revision 5)
+++ /Samples/CameraTrack/scripts/Demo_CameraTrack_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/CameraTrack/src/CameraTrack.cpp
===================================================================
--- /Samples/CameraTrack/src/CameraTrack.cpp	(revision 5)
+++ /Samples/CameraTrack/src/CameraTrack.cpp	(revision 5)
@@ -0,0 +1,179 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+/*
+-----------------------------------------------------------------------------
+Filename:    CameraTrack.cpp
+Description: An example of using AnimationTracks to smoothly make a node
+             follow a predefined path, with spline interpolation. Also 
+             uses the auto tracking ability of the camera.
+-----------------------------------------------------------------------------
+*/
+
+#include "ExampleApplication.h"
+
+AnimationState* mAnimState;
+
+// Event handler 
+class CameraTrackListener: public ExampleFrameListener
+{
+protected:
+public:
+    CameraTrackListener(RenderWindow* win, Camera* cam)
+        : ExampleFrameListener(win, cam)
+    {
+    }
+
+    bool frameStarted(const FrameEvent& evt)
+    {
+	if( ExampleFrameListener::frameStarted(evt) == false )
+		return false;
+
+        mAnimState->addTime(evt.timeSinceLastFrame);
+
+        return true;
+    }
+};
+
+class CameraTrackApplication : public ExampleApplication
+{
+public:
+    CameraTrackApplication() {
+    
+
+    
+    }
+
+    ~CameraTrackApplication() {  }
+
+protected:
+    SceneNode* mFountainNode;
+
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.2, 0.2, 0.2));
+
+        // Create a skydome
+        mSceneMgr->setSkyDome(true, "Examples/CloudySky", 5, 8);
+
+        // Create a light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        l->setPosition(20,80,50);
+
+        Entity *ent;
+
+        // Define a floor plane mesh
+        Plane p;
+        p.normal = Vector3::UNIT_Y;
+        p.d = 200;
+        MeshManager::getSingleton().createPlane(
+            "FloorPlane", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+            p, 200000, 200000, 20, 20, true, 1, 50, 50, Vector3::UNIT_Z);
+
+        // Create an entity (the floor)
+        ent = mSceneMgr->createEntity("floor", "FloorPlane");
+        ent->setMaterialName("Examples/RustySteel");
+        // Attach to child of root node, better for culling (otherwise bounds are the combination of the 2)
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+
+        // Add a head, give it it's own node
+        SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        ent = mSceneMgr->createEntity("head", "ogrehead.mesh");
+        headNode->attachObject(ent);
+
+        // Make sure the camera track this node
+        mCamera->setAutoTracking(true, headNode);
+
+        // Create the camera node & attach camera
+        SceneNode* camNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        camNode->attachObject(mCamera);
+
+        // set up spline animation of node
+        Animation* anim = mSceneMgr->createAnimation("CameraTrack", 10);
+        // Spline it for nice curves
+        anim->setInterpolationMode(Animation::IM_SPLINE);
+        // Create a track to animate the camera's node
+        NodeAnimationTrack* track = anim->createNodeTrack(0, camNode);
+        // Setup keyframes
+        TransformKeyFrame* key = track->createNodeKeyFrame(0); // startposition
+        key = track->createNodeKeyFrame(2.5);
+        key->setTranslate(Vector3(500,500,-1000));
+        key = track->createNodeKeyFrame(5);
+        key->setTranslate(Vector3(-1500,1000,-600));
+        key = track->createNodeKeyFrame(7.5);
+        key->setTranslate(Vector3(0,-100,0));
+        key = track->createNodeKeyFrame(10);
+        key->setTranslate(Vector3(0,0,0));
+        // Create a new animation state to track this
+        mAnimState = mSceneMgr->createAnimationState("CameraTrack");
+        mAnimState->setEnabled(true);
+
+        // Put in a bit of fog for the hell of it
+        mSceneMgr->setFog(FOG_EXP, ColourValue::White, 0.0002);
+
+    }
+
+    // Create new frame listener
+    void createFrameListener(void)
+    {
+        mFrameListener= new CameraTrackListener(mWindow, mCamera);
+        mRoot->addFrameListener(mFrameListener);
+
+    }
+
+
+};
+
+
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+    // Create application object
+    CameraTrackApplication app;
+
+    try {
+        app.go();
+    } catch( Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/CameraTrack/src/Makefile.am
===================================================================
--- /Samples/CameraTrack/src/Makefile.am	(revision 5)
+++ /Samples/CameraTrack/src/Makefile.am	(revision 5)
@@ -0,0 +1,7 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/CameraTrack/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = CameraTrack
+
+CameraTrack_SOURCES = CameraTrack.cpp
+CameraTrack_LDFLAGS = -L$(top_builddir)/OgreMain/src
+CameraTrack_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/CameraTrack/src/Makefile.in
===================================================================
--- /Samples/CameraTrack/src/Makefile.in	(revision 5)
+++ /Samples/CameraTrack/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = CameraTrack$(EXEEXT)
+subdir = Samples/CameraTrack/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_CameraTrack_OBJECTS = CameraTrack.$(OBJEXT)
+CameraTrack_OBJECTS = $(am_CameraTrack_OBJECTS)
+am__DEPENDENCIES_1 =
+CameraTrack_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(CameraTrack_SOURCES)
+DIST_SOURCES = $(CameraTrack_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/CameraTrack/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+CameraTrack_SOURCES = CameraTrack.cpp
+CameraTrack_LDFLAGS = -L$(top_builddir)/OgreMain/src
+CameraTrack_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/CameraTrack/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/CameraTrack/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+CameraTrack$(EXEEXT): $(CameraTrack_OBJECTS) $(CameraTrack_DEPENDENCIES) 
+	@rm -f CameraTrack$(EXEEXT)
+	$(CXXLINK) $(CameraTrack_LDFLAGS) $(CameraTrack_OBJECTS) $(CameraTrack_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CameraTrack.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/CelShading/Makefile.am
===================================================================
--- /Samples/CelShading/Makefile.am	(revision 5)
+++ /Samples/CelShading/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src 
Index: /Samples/CelShading/Makefile.in
===================================================================
--- /Samples/CelShading/Makefile.in	(revision 5)
+++ /Samples/CelShading/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/CelShading
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src 
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/CelShading/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/CelShading/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/CelShading/scripts/Demo_CelShading.cbp
===================================================================
--- /Samples/CelShading/scripts/Demo_CelShading.cbp	(revision 5)
+++ /Samples/CelShading/scripts/Demo_CelShading.cbp	(revision 5)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_CelShading" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_CelShading.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_CelShading.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\CelShading.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/CelShading/scripts/Demo_CelShading.vcproj
===================================================================
--- /Samples/CelShading/scripts/Demo_CelShading.vcproj	(revision 5)
+++ /Samples/CelShading/scripts/Demo_CelShading.vcproj	(revision 5)
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_CelShading"
+	ProjectGUID="{A0C80324-EF9A-41AE-A833-1CC909C38ABB}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_CelShading.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_CelShading.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_CelShading.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\CelShading.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/CelShading/scripts/Demo_CelShading_linux.cbp
===================================================================
--- /Samples/CelShading/scripts/Demo_CelShading_linux.cbp	(revision 5)
+++ /Samples/CelShading/scripts/Demo_CelShading_linux.cbp	(revision 5)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_CelShading" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_CelShading_d" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_CelShading" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../src/CelShading.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/CelShading/scripts/Demo_CelShading_stlp.cbp
===================================================================
--- /Samples/CelShading/scripts/Demo_CelShading_stlp.cbp	(revision 5)
+++ /Samples/CelShading/scripts/Demo_CelShading_stlp.cbp	(revision 5)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_CelShading" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_CelShading.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_CelShading.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\CelShading.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/CelShading/scripts/Demo_CelShading_vc8.vcproj
===================================================================
--- /Samples/CelShading/scripts/Demo_CelShading_vc8.vcproj	(revision 5)
+++ /Samples/CelShading/scripts/Demo_CelShading_vc8.vcproj	(revision 5)
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_CelShading"
+	ProjectGUID="{A0C80324-EF9A-41AE-A833-1CC909C38ABB}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_CelShading.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_CelShading.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_CelShading.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\CelShading.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/CelShading/scripts/Demo_CelShading_vc8.vcproj.user
===================================================================
--- /Samples/CelShading/scripts/Demo_CelShading_vc8.vcproj.user	(revision 5)
+++ /Samples/CelShading/scripts/Demo_CelShading_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/CelShading/src/CelShading.cpp
===================================================================
--- /Samples/CelShading/src/CelShading.cpp	(revision 5)
+++ /Samples/CelShading/src/CelShading.cpp	(revision 5)
@@ -0,0 +1,166 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+/*
+-----------------------------------------------------------------------------
+Filename:    CelShading.cpp
+Description: Demo of cel-shaded graphics using vertex & fragment programs
+-----------------------------------------------------------------------------
+*/
+
+
+#include "ExampleApplication.h"
+
+SceneNode* rotNode;
+
+// Listener class for frame updates
+class CelShadingListener : public ExampleFrameListener
+{
+protected:
+public:
+    CelShadingListener(RenderWindow* win, Camera* cam)
+        : ExampleFrameListener(win, cam)
+    {
+    }
+
+    bool frameStarted(const FrameEvent& evt)
+    {
+	if( ExampleFrameListener::frameStarted(evt) == false )
+		return false;
+
+        rotNode->yaw(Degree(evt.timeSinceLastFrame * 30));
+        return true;
+    }
+};
+
+// Custom parameter bindings
+#define CUSTOM_SHININESS 1
+#define CUSTOM_DIFFUSE 2
+#define CUSTOM_SPECULAR 3
+
+class CelShadingApplication : public ExampleApplication
+{
+public:
+    CelShadingApplication() { 
+    }
+
+    ~CelShadingApplication() {  }
+
+protected:
+    
+	void createFrameListener(void)
+    {
+		// This is where we instantiate our own frame listener
+        mFrameListener= new CelShadingListener(mWindow, mCamera);
+        mRoot->addFrameListener(mFrameListener);
+
+    }
+    
+
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+        // Check capabilities
+		const RenderSystemCapabilities* caps = Root::getSingleton().getRenderSystem()->getCapabilities();
+        if (!caps->hasCapability(RSC_VERTEX_PROGRAM) || !(caps->hasCapability(RSC_FRAGMENT_PROGRAM)))
+        {
+			OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "Your card does not support vertex and fragment programs, so cannot "
+                "run this demo. Sorry!", 
+                "CelShading::createScene");
+        }
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // Add light to the scene node
+        rotNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        rotNode->createChildSceneNode(Vector3(20,40,50))->attachObject(l);
+
+        Entity *ent = mSceneMgr->createEntity("head", "ogrehead.mesh");
+
+        mCamera->setPosition(20, 0, 100);
+        mCamera->lookAt(0,0,0);
+
+
+        // Set common material, but define custom parameters to change colours
+        // See Example-Advanced.material for how these are finally bound to GPU parameters
+        SubEntity* sub;
+        // eyes
+        sub = ent->getSubEntity(0);
+        sub->setMaterialName("Examples/CelShading");
+        sub->setCustomParameter(CUSTOM_SHININESS, Vector4(35.0f, 0.0f, 0.0f, 0.0f));
+        sub->setCustomParameter(CUSTOM_DIFFUSE, Vector4(1.0f, 0.3f, 0.3f, 1.0f));
+        sub->setCustomParameter(CUSTOM_SPECULAR, Vector4(1.0f, 0.6f, 0.6f, 1.0f));
+        // skin
+        sub = ent->getSubEntity(1);
+        sub->setMaterialName("Examples/CelShading");
+        sub->setCustomParameter(CUSTOM_SHININESS, Vector4(10.0f, 0.0f, 0.0f, 0.0f));
+        sub->setCustomParameter(CUSTOM_DIFFUSE, Vector4(0.0f, 0.5f, 0.0f, 1.0f));
+        sub->setCustomParameter(CUSTOM_SPECULAR, Vector4(0.3f, 0.5f, 0.3f, 1.0f));
+        // earring
+        sub = ent->getSubEntity(2);
+        sub->setMaterialName("Examples/CelShading");
+        sub->setCustomParameter(CUSTOM_SHININESS, Vector4(25.0f, 0.0f, 0.0f, 0.0f));
+        sub->setCustomParameter(CUSTOM_DIFFUSE, Vector4(1.0f, 1.0f, 0.0f, 1.0f));
+        sub->setCustomParameter(CUSTOM_SPECULAR, Vector4(1.0f, 1.0f, 0.7f, 1.0f));
+        // teeth
+        sub = ent->getSubEntity(3);
+        sub->setMaterialName("Examples/CelShading");
+        sub->setCustomParameter(CUSTOM_SHININESS, Vector4(20.0f, 0.0f, 0.0f, 0.0f));
+        sub->setCustomParameter(CUSTOM_DIFFUSE, Vector4(1.0f, 1.0f, 0.7f, 1.0f));
+        sub->setCustomParameter(CUSTOM_SPECULAR, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
+
+        // Add entity to the root scene node
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+
+        mWindow->getViewport(0)->setBackgroundColour(ColourValue::White);
+    }
+};
+
+
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+    // Create application object
+    CelShadingApplication app;
+
+    try {
+        app.go();
+    } catch( Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/CelShading/src/Makefile.am
===================================================================
--- /Samples/CelShading/src/Makefile.am	(revision 5)
+++ /Samples/CelShading/src/Makefile.am	(revision 5)
@@ -0,0 +1,7 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/CelShading/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = CelShading
+
+CelShading_SOURCES = CelShading.cpp
+CelShading_LDFLAGS = -L$(top_builddir)/OgreMain/src
+CelShading_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/CelShading/src/Makefile.in
===================================================================
--- /Samples/CelShading/src/Makefile.in	(revision 5)
+++ /Samples/CelShading/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = CelShading$(EXEEXT)
+subdir = Samples/CelShading/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_CelShading_OBJECTS = CelShading.$(OBJEXT)
+CelShading_OBJECTS = $(am_CelShading_OBJECTS)
+am__DEPENDENCIES_1 =
+CelShading_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(CelShading_SOURCES)
+DIST_SOURCES = $(CelShading_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/CelShading/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+CelShading_SOURCES = CelShading.cpp
+CelShading_LDFLAGS = -L$(top_builddir)/OgreMain/src
+CelShading_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/CelShading/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/CelShading/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+CelShading$(EXEEXT): $(CelShading_OBJECTS) $(CelShading_DEPENDENCIES) 
+	@rm -f CelShading$(EXEEXT)
+	$(CXXLINK) $(CelShading_LDFLAGS) $(CelShading_OBJECTS) $(CelShading_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CelShading.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Common/CEGUIRenderer/CEGUI-OGRE.pc.in
===================================================================
--- /Samples/Common/CEGUIRenderer/CEGUI-OGRE.pc.in	(revision 5)
+++ /Samples/Common/CEGUIRenderer/CEGUI-OGRE.pc.in	(revision 5)
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: CEGUI-OGRE
+Description: CEGUI Renderer interface module for OGRE (Object-Oriented Graphics Rendering Engine).
+Version: @VERSION@
+Requires: OGRE = @VERSION@, CEGUI >= 0.3.0
+Libs: -L${libdir} -lCEGUIOgreRenderer
+Cflags: -I${includedir}/@PACKAGE@ @OGRE_CFLAGS@
Index: /Samples/Common/CEGUIRenderer/Makefile.am
===================================================================
--- /Samples/Common/CEGUIRenderer/Makefile.am	(revision 5)
+++ /Samples/Common/CEGUIRenderer/Makefile.am	(revision 5)
@@ -0,0 +1,4 @@
+SUBDIRS = src include
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = CEGUI-OGRE.pc
Index: /Samples/Common/CEGUIRenderer/Makefile.in
===================================================================
--- /Samples/Common/CEGUIRenderer/Makefile.in	(revision 5)
+++ /Samples/Common/CEGUIRenderer/Makefile.in	(revision 5)
@@ -0,0 +1,580 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Common/CEGUIRenderer
+DIST_COMMON = $(srcdir)/CEGUI-OGRE.pc.in $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES = CEGUI-OGRE.pc
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
+pkgconfigDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(pkgconfig_DATA)
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = CEGUI-OGRE.pc
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Common/CEGUIRenderer/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Common/CEGUIRenderer/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+CEGUI-OGRE.pc: $(top_builddir)/config.status $(srcdir)/CEGUI-OGRE.pc.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+install-pkgconfigDATA: $(pkgconfig_DATA)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkgconfigdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfigdir)"
+	@list='$(pkgconfig_DATA)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
+	  $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
+	done
+
+uninstall-pkgconfigDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkgconfig_DATA)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
+	done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-pkgconfigDATA
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkgconfigDATA
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-pkgconfigDATA \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	maintainer-clean-recursive mostlyclean mostlyclean-generic \
+	mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
+	tags tags-recursive uninstall uninstall-am uninstall-info-am \
+	uninstall-pkgconfigDATA
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Common/CEGUIRenderer/include/Makefile.am
===================================================================
--- /Samples/Common/CEGUIRenderer/include/Makefile.am	(revision 5)
+++ /Samples/Common/CEGUIRenderer/include/Makefile.am	(revision 5)
@@ -0,0 +1,3 @@
+pkginclude_HEADERS = OgreCEGUIRenderer.h \
+					 OgreCEGUITexture.h \
+					 OgreCEGUIResourceProvider.h
Index: /Samples/Common/CEGUIRenderer/include/Makefile.in
===================================================================
--- /Samples/Common/CEGUIRenderer/include/Makefile.in	(revision 5)
+++ /Samples/Common/CEGUIRenderer/include/Makefile.in	(revision 5)
@@ -0,0 +1,468 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Common/CEGUIRenderer/include
+DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkgincludedir)"
+pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(pkginclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+pkginclude_HEADERS = OgreCEGUIRenderer.h \
+					 OgreCEGUITexture.h \
+					 OgreCEGUIResourceProvider.h
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Common/CEGUIRenderer/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Common/CEGUIRenderer/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+install-pkgincludeHEADERS: $(pkginclude_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkgincludedir)" || $(mkdir_p) "$(DESTDIR)$(pkgincludedir)"
+	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
+	  $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
+	done
+
+uninstall-pkgincludeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(pkgincludedir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-pkgincludeHEADERS
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkgincludeHEADERS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-pkgincludeHEADERS \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-pkgincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Common/CEGUIRenderer/include/OgreCEGUIRenderer.h
===================================================================
--- /Samples/Common/CEGUIRenderer/include/OgreCEGUIRenderer.h	(revision 5)
+++ /Samples/Common/CEGUIRenderer/include/OgreCEGUIRenderer.h	(revision 5)
@@ -0,0 +1,464 @@
+/************************************************************************
+	filename: 	OgreCEGUIRenderer.h
+	created:	11/5/2004
+	author:		Paul D Turner
+
+	purpose:	Interface for main Ogre GUI renderer class
+*************************************************************************/
+/*************************************************************************
+    Crazy Eddie's GUI System (http://www.cegui.org.uk)
+    Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*************************************************************************/
+/*************************************************************************
+	This file contains code that is specific to Ogre (http://www.ogre3d.org)
+*************************************************************************/
+#ifndef _OgreCEGUIRenderer_h_
+#define _OgreCEGUIRenderer_h_
+
+#include <CEGUI/CEGUIBase.h>
+#include <CEGUI/CEGUIRenderer.h>
+#include <CEGUI/CEGUITexture.h>
+
+#include <OgreRenderQueueListener.h>
+#include <OgreSceneManagerEnumerator.h>
+#include <OgreTextureUnitState.h>
+
+#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) && !defined(OGRE_STATIC_LIB)
+#   ifdef OGRE_GUIRENDERER_EXPORTS
+#       define OGRE_GUIRENDERER_API __declspec(dllexport)
+#   else
+#       if defined(__MINGW32__)
+#           define OGRE_GUIRENDERER_API
+#       else
+#           define OGRE_GUIRENDERER_API __declspec(dllimport)
+#       endif
+#   endif
+#elif defined ( OGRE_GCC_VISIBILITY )
+#    define OGRE_GUIRENDERER_API  __attribute__ ((visibility("default")))
+#else
+#    define OGRE_GUIRENDERER_API
+#endif
+
+
+// Start of CEGUI namespace section
+namespace CEGUI
+{
+/*************************************************************************
+	Forward refs
+*************************************************************************/
+class OgreCEGUITexture;
+class OgreCEGUIRenderer;
+
+
+/*!
+\brief
+	RenderQueueListener based class used to hook into the ogre rendering system
+*/
+class _OgrePrivate CEGUIRQListener : public Ogre::RenderQueueListener
+{
+public:
+	CEGUIRQListener(OgreCEGUIRenderer* renderer, Ogre::uint8 queue_id, bool post_queue)
+	{
+		d_renderer		= renderer;
+		d_queue_id		= queue_id;
+		d_post_queue	= post_queue;
+	}
+
+	virtual ~CEGUIRQListener() {}
+
+	virtual void	renderQueueStarted(Ogre::uint8 id, const Ogre::String& invocation, bool& skipThisQueue);
+	virtual void	renderQueueEnded(Ogre::uint8 id, const Ogre::String& invocation, bool& repeatThisQueue);
+
+	// methods for adjusting target queue settings
+	void	setTargetRenderQueue(Ogre::uint8 queue_id)		{d_queue_id = queue_id;}
+	void	setPostRenderQueue(bool post_queue)		{d_post_queue = post_queue;}
+
+private:
+	/*************************************************************************
+		Implementation Data
+	*************************************************************************/
+	OgreCEGUIRenderer*				d_renderer;		//!< CEGUI renderer object for Ogre.
+	Ogre::uint8	d_queue_id;		//!< ID of the queue that we are hooked into
+	bool						d_post_queue;	//!< true if we render after everything else in our queue.
+};
+
+
+/*!
+\brief
+	Renderer class to interface with Ogre engine.
+*/
+class OGRE_GUIRENDERER_API OgreCEGUIRenderer : public Renderer
+{
+public:
+	/*!
+	\brief
+		Constructor for renderer class that uses Ogre for rendering. Note that if
+		you use this option you must call setTargetSceneManager before rendering.
+
+	\param window
+		Pointer to an Ogre::RenderWindow object.
+
+	\param queue_id
+		Ogre::uint8 value that specifies where the GUI should appear in the ogre rendering output.
+
+	\param post_queue
+		set to true to have GUI rendered after render queue \a queue_id, or false to have the GUI rendered before render queue
+		\a queue_id.
+
+	\param max_quads
+		Obsolete.  Set to 0.
+
+	*/
+	OgreCEGUIRenderer(Ogre::RenderWindow* window,
+		Ogre::uint8 queue_id = Ogre::RENDER_QUEUE_OVERLAY,
+		bool post_queue = false, uint max_quads = 0);
+
+
+	/*!
+	\brief
+		Constructor for renderer class that uses Ogre for rendering.
+
+	\param window
+		Pointer to an Ogre::RenderWindow object.
+
+	\param queue_id
+		Ogre::uint8 value that specifies where the GUI should appear in the ogre rendering output.
+
+	\param post_queue
+		set to true to have GUI rendered after render queue \a queue_id, or false to have the GUI rendered before render queue
+		\a queue_id.
+
+	\param max_quads
+		Obsolete.  Set to 0.
+
+	\param scene_manager
+		Pointer to an Ogre::SceneManager object that is to be used for GUI rendering.
+	*/
+	OgreCEGUIRenderer(Ogre::RenderWindow* window, Ogre::uint8 queue_id, bool post_queue, uint max_quads, Ogre::SceneManager* scene_manager);
+
+
+	/*!
+	\brief
+		Destructor for Ogre renderer.
+	*/
+	virtual ~OgreCEGUIRenderer(void);
+
+
+
+	// add's a quad to the list to be rendered
+	virtual	void	addQuad(const Rect& dest_rect, float z, const Texture* tex, const Rect& texture_rect, const ColourRect& colours, QuadSplitMode quad_split_mode);
+
+	// perform final rendering for all queued renderable quads.
+	virtual	void	doRender(void);
+
+	// clear the queue
+	virtual	void	clearRenderList(void);
+
+
+	/*!
+	\brief
+		Enable or disable the queueing of quads from this point on.
+
+		This only affects queueing.  If queueing is turned off, any calls to addQuad will cause the quad to be rendered directly.  Note that
+		disabling queueing will not cause currently queued quads to be rendered, nor is the queue cleared - at any time the queue can still
+		be drawn by calling doRender, and the list can be cleared by calling clearRenderList.  Re-enabling the queue causes subsequent quads
+		to be added as if queueing had never been disabled.
+
+	\param setting
+		true to enable queueing, or false to disable queueing (see notes above).
+
+	\return
+		Nothing
+	*/
+	virtual void	setQueueingEnabled(bool setting)		{d_queueing = setting;}
+
+
+	// create an empty texture
+	virtual	Texture*	createTexture(void);
+
+	// create a texture and load it with the specified file.
+	virtual	Texture*	createTexture(const String& filename, const String& resourceGroup = "General");
+
+	// create a texture and set it to the specified size
+	virtual	Texture*	createTexture(float size);
+
+    // create an OGRE resource provider.
+    virtual ResourceProvider* createResourceProvider(void);
+
+	// destroy the given texture
+	virtual	void		destroyTexture(Texture* texture);
+
+	// destroy all textures still active
+	virtual void		destroyAllTextures(void);
+
+
+	/*!
+	\brief
+		Return whether queueing is enabled.
+
+	\return
+		true if queueing is enabled, false if queueing is disabled.
+	*/
+	virtual bool	isQueueingEnabled(void) const	{return d_queueing;}
+
+
+	/*!
+	\brief
+	Return the current width of the display in pixels
+
+	\return
+	float value equal to the current width of the display in pixels.
+	*/
+	virtual float	getWidth(void) const		{return d_display_area.getWidth();}
+
+
+	/*!
+	\brief
+	Return the current height of the display in pixels
+
+	\return
+	float value equal to the current height of the display in pixels.
+	*/
+	virtual float	getHeight(void) const		{return d_display_area.getHeight();}
+
+
+	/*!
+	\brief
+	Return the size of the display in pixels
+
+	\return
+	Size object describing the dimensions of the current display.
+	*/
+	virtual Size	getSize(void) const			{return d_display_area.getSize();}
+
+
+	/*!
+	\brief
+	Return a Rect describing the screen
+
+	\return
+	A Rect object that describes the screen area.  Typically, the top-left values are always 0, and the size of the area described is
+	equal to the screen resolution.
+	*/
+	virtual Rect	getRect(void) const			{return d_display_area;}
+
+
+	/*!
+	\brief
+		Return the maximum texture size available
+
+	\return
+		Size of the maximum supported texture in pixels (textures are always assumed to be square)
+	*/
+	virtual	uint	getMaxTextureSize(void) const		{return 2048;}		// TODO: Change to proper value
+
+
+	/*!
+	\brief
+		Return the horizontal display resolution dpi
+
+	\return
+		horizontal resolution of the display in dpi.
+	*/
+	virtual	uint	getHorzScreenDPI(void) const	{return 96;}
+
+
+	/*!
+	\brief
+		Return the vertical display resolution dpi
+
+	\return
+		vertical resolution of the display in dpi.
+	*/
+	virtual	uint	getVertScreenDPI(void) const	{return 96;}
+
+
+	/*!
+	\brief
+		Set the scene manager to be used for rendering the GUI.
+
+		The GUI system will be unhooked from the current scene manager and attached to what ever
+		is specified here.
+
+	\param scene_manager
+		Pointer to an Ogre::SceneManager object that is the new target Ogre::SceneManager to be
+		used for GUI rendering.
+
+	\return
+		Nothing.
+	*/
+	void	setTargetSceneManager(Ogre::SceneManager* scene_manager);
+
+
+	/*!
+	\brief
+		Set the target render queue for GUI rendering.
+
+	\param queue_id
+		Ogre::uint8 value specifying the render queue that the GUI system should attach to.
+
+	\param post_queue
+		- true to specify that the GUI should render after everything else in render queue \a queue_id.
+		- false to specify the GUI should render before everything else in render queue \a queue_id.
+
+	\return
+		Nothing.
+	*/
+	void	setTargetRenderQueue(Ogre::uint8 queue_id, bool post_queue);
+
+
+	/*!
+	\brief
+		Create a texture from an existing Ogre::TexturePtr object.
+
+	\note
+		If you want to use an Ogre::RenderTexture (for putting rendered output onto Gui elements or other
+		advanced techniques), you can get the Ogre::TexturePtr to be used by calling Ogre::TextureManager::getByName()
+		passing the name returned from Ogre::RenderTexture::getName() (and casting the result as necessary).
+
+	\param texture
+		pointer to an Ogre::TexturePtr object to be used as the basis for the new CEGUI::Texture
+
+	\return
+		Pointer to the newly created CEGUI::TexturePtr object.
+	*/
+	Texture*	createTexture(Ogre::TexturePtr& texture);
+
+
+	/*!
+	\brief
+	Set the size of the display in pixels.
+
+	You do not have to call this method under normal operation as the system
+	will automatically extract the size from the current view port.
+
+	\note
+	This method will cause the EventDisplaySizeChanged event to fire if the
+	display size has changed.
+
+	\param sz
+	Size object describing the size of the display.
+
+	\return
+	Nothing.
+	*/
+	void	setDisplaySize(const Size& sz);
+
+
+private:
+	/************************************************************************
+		Implementation Constants
+	************************************************************************/
+	static const size_t    VERTEX_PER_QUAD;						 //!< number of vertices per quad
+	static const size_t    VERTEX_PER_TRIANGLE;					 //!< number of vertices for a triangle
+    static const size_t    VERTEXBUFFER_INITIAL_CAPACITY;		 //!< initial capacity of the allocated vertex buffer
+    static const size_t    UNDERUSED_FRAME_THRESHOLD;            //!< number of frames to wait before shrinking buffer
+
+	/*************************************************************************
+	    Implementation Structs & classes
+	*************************************************************************/
+	/*!
+	\brief
+		structure used for all vertices.
+	*/
+	struct QuadVertex {
+		float x, y, z;			//!< The position for the vertex.
+		Ogre::RGBA diffuse;		//!< colour of the vertex
+		float tu1, tv1;			//!< texture coordinates
+	};
+
+	/*!
+	\brief
+		structure holding details about a quad to be drawn
+	*/
+	struct QuadInfo
+	{
+		Ogre::TexturePtr		texture;
+		Rect				position;
+		float				z;
+		Rect				texPosition;
+        uint32		        topLeftCol;
+        uint32		        topRightCol;
+        uint32		        bottomLeftCol;
+        uint32		        bottomRightCol;
+
+        QuadSplitMode		splitMode;
+
+		bool operator<(const QuadInfo& other) const
+		{
+			// this is intentionally reversed.
+			return z > other.z;
+		}
+	};
+
+
+	/*************************************************************************
+	    Implementation Methods
+	*************************************************************************/
+	// setup states etc
+	void	initRenderStates(void);
+
+	// sort quads list according to texture
+	void	sortQuads(void);
+
+	// render a quad directly to the display
+	void	renderQuadDirect(const Rect& dest_rect, float z, const Texture* tex, const Rect& texture_rect, const ColourRect& colours, QuadSplitMode quad_split_mode);
+
+	// convert colour value to whatever the Ogre render system is expecting.
+    uint32    colourToOgre(const colour& col) const;
+
+	// perform main work of the constructor.  This does everything except the final hook into the render system.
+	void	constructor_impl(Ogre::RenderWindow* window, Ogre::uint8 queue_id, bool post_queue, uint max_quads);
+
+
+	/*************************************************************************
+	    Implementation Data
+	*************************************************************************/
+	Rect				d_display_area;
+
+	typedef std::multiset<QuadInfo>		QuadList;
+	QuadList d_quadlist;
+	bool	 d_queueing;		//!< setting for queueing control.
+
+	// Ogre specific bits.
+	Ogre::Root*					d_ogre_root;		//!< pointer to the Ogre root object that we attach to
+	Ogre::RenderSystem*			d_render_sys;		//!< Pointer to the render system for Ogre.
+	Ogre::uint8	d_queue_id;			//!< ID of the queue that we are hooked into
+	Ogre::TexturePtr			d_currTexture;		//!< currently set texture;
+	Ogre::RenderOperation		d_render_op;		//!< Ogre render operation we use to do our stuff.
+	Ogre::HardwareVertexBufferSharedPtr	d_buffer;	//!< vertex buffer to queue sprite rendering
+    size_t d_underused_framecount;                  //!< Number of frames elapsed since buffer utilization was above half the capacity
+    Ogre::RenderOperation		d_direct_render_op;		//!< Renderop for cursor
+	Ogre::HardwareVertexBufferSharedPtr	d_direct_buffer;	//!< Renderop for cursor
+	Ogre::SceneManager*			d_sceneMngr;		//!< The scene manager we are hooked into.
+	Ogre::LayerBlendModeEx		d_colourBlendMode;	//!< Controls colour blending mode used.
+	Ogre::LayerBlendModeEx		d_alphaBlendMode;	//!< Controls alpha blending mode used.
+	Ogre::TextureUnitState::UVWAddressingMode d_uvwAddressMode;
+
+	CEGUIRQListener*			d_ourlistener;
+	bool						d_post_queue;		//!< true if we render after everything else in our queue.
+	size_t						d_bufferPos;		//!< index into buffer where next vertex should be put.
+	bool						d_sorted;			//!< true when data in quad list is sorted.
+	Point						d_texelOffset;		//!< Offset required for proper texel mapping.
+
+	std::list<OgreCEGUITexture*> d_texturelist;		//!< List used to track textures.
+};
+
+} // End of  CEGUI namespace section
+
+
+#endif	// end of guard _OgreCEGUIRenderer_h_
Index: /Samples/Common/CEGUIRenderer/include/OgreCEGUIResourceProvider.h
===================================================================
--- /Samples/Common/CEGUIRenderer/include/OgreCEGUIResourceProvider.h	(revision 5)
+++ /Samples/Common/CEGUIRenderer/include/OgreCEGUIResourceProvider.h	(revision 5)
@@ -0,0 +1,52 @@
+/************************************************************************
+	filename: 	CEGUIOgreResourceProvider.h
+	created:	8/7/2004
+	author:		James '_mental_' O'Sullivan
+	
+	purpose:	Defines abstract base class for CEGUIData objects
+*************************************************************************/
+/*************************************************************************
+    Crazy Eddie's GUI System (http://www.cegui.org.uk)
+    Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*************************************************************************/
+#ifndef _OgreCEGUIResourceProvider_h_
+#define _OgreCEGUIResourceProvider_h_
+
+#include <CEGUI/CEGUIResourceProvider.h>
+#include "OgreCEGUIRenderer.h"
+
+// Start of CEGUI namespace section
+namespace CEGUI
+{
+class _OgrePrivate OgreCEGUIResourceProvider : public ResourceProvider
+{
+public:
+	/*************************************************************************
+		Construction and Destruction
+	*************************************************************************/
+	OgreCEGUIResourceProvider();
+
+	~OgreCEGUIResourceProvider(void) {}
+
+//    void loadInputSourceContainer(const String& filename, InputSourceContainer& output);
+    void loadRawDataContainer(const String& filename, RawDataContainer& output, const String& resourceGroup);
+    void unloadRawDataContainer(RawDataContainer& output);
+};
+
+} // End of  CEGUI namespace section
+
+#endif	// end of guard _OgreCEGUIResourceProvider_h_
Index: /Samples/Common/CEGUIRenderer/include/OgreCEGUITexture.h
===================================================================
--- /Samples/Common/CEGUIRenderer/include/OgreCEGUITexture.h	(revision 5)
+++ /Samples/Common/CEGUIRenderer/include/OgreCEGUITexture.h	(revision 5)
@@ -0,0 +1,179 @@
+/************************************************************************
+	filename: 	OgreCEGUITexture.h
+	created:	11/5/2004
+	author:		Paul D Turner
+	
+	purpose:	Interface to Texture implemented via Ogre engine
+*************************************************************************/
+/*************************************************************************
+    Crazy Eddie's GUI System (http://www.cegui.org.uk)
+    Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*************************************************************************/
+#ifndef _OgreCEGUITexture_h_
+#define _OgreCEGUITexture_h_
+
+#include <CEGUI/CEGUIBase.h>
+#include <CEGUI/CEGUIRenderer.h>
+#include <CEGUI/CEGUITexture.h>
+#include "OgreCEGUIRenderer.h"
+
+// Start of CEGUI namespace section
+namespace CEGUI
+{
+/*!
+\brief
+	Texture class that is created by OgreCEGUIRenderer objects
+*/
+class _OgrePrivate OgreCEGUITexture : public Texture
+{
+private:
+	/*************************************************************************
+		Friends (to allow construction and destruction)
+	*************************************************************************/
+	friend	Texture* OgreCEGUIRenderer::createTexture(void);
+	friend	Texture* OgreCEGUIRenderer::createTexture(const String& filename, const String& resourceGroup);
+	friend	Texture* OgreCEGUIRenderer::createTexture(float size);
+	friend	void	 OgreCEGUIRenderer::destroyTexture(Texture* texture);
+
+
+	/*************************************************************************
+		Construction & Destruction (by Renderer object only)
+	*************************************************************************/
+	OgreCEGUITexture(Renderer* owner);
+	virtual ~OgreCEGUITexture(void);
+
+public:
+	/*!
+	\brief
+		Returns the current pixel width of the texture
+
+	\return
+		ushort value that is the current width of the texture in pixels
+	*/
+	virtual	ushort	getWidth(void) const		{return d_width;}
+
+
+	/*!
+	\brief
+		Returns the current pixel height of the texture
+
+	\return
+		ushort value that is the current height of the texture in pixels
+	*/
+	virtual	ushort	getHeight(void) const		{return d_height;}
+
+
+	/*!
+	\brief
+		Loads the specified image file into the texture.  The texture is resized as required to hold the image.
+
+	\param filename
+		The filename of the image file that is to be loaded into the texture
+
+	\return
+		Nothing.
+	*/
+	virtual void	loadFromFile(const String& filename, const String& resourceGroup);
+
+
+	/*!
+	\brief
+		Loads (copies) an image in memory into the texture.  The texture is resized as required to hold the image.
+	
+	\param buffPtr
+		Pointer to the buffer containing the image data
+	
+	\param buffWidth
+		Width of the buffer (in pixels as specified by \a pixelFormat )
+	
+	\param buffHeight
+		Height of the buffer (in pixels as specified by \a pixelFormat )
+	
+	\param pixelFormat
+	PixelFormat value describing the format contained in \a buffPtr
+	
+	\return
+		Nothing.
+	*/
+	virtual void	loadFromMemory(const void* buffPtr, uint buffWidth, uint buffHeight, PixelFormat pixelFormat);
+
+
+	/*!
+	\brief
+		Return a pointer to the internal Ogre::Texture object
+
+	\return
+		Pointer to the Ogre::Texture object currently being used by this Texture object
+	*/
+	Ogre::TexturePtr	getOgreTexture(void) const		{return d_ogre_texture;}
+
+
+	/*!
+	\brief
+		set the size of the internal Ogre texture.  Previous Ogre texture is lost.
+
+	\param size
+		pixel size of the new internal texture.  This will be rounded up to a power of 2.
+
+	\return
+		Nothing.
+	*/
+	void	setOgreTextureSize(uint size);
+
+
+	/*!
+	\brief
+		Set the internal Ogre::TexturePtr object.
+
+	\param texture
+		Reference to an Ogre::TexturePtr object that is to be used by this Texture object.
+
+	\return
+		Nothing.
+	*/
+	void	setOgreTexture(Ogre::TexturePtr& texture);
+
+
+private:
+	/*************************************************************************
+		Implementation Functions
+	*************************************************************************/
+	// safely free Ogre::Texture texture (can be called multiple times with no ill effect)
+	void	freeOgreTexture(void);
+
+	// return a Ogre::string that contains a unique name.
+	Ogre::String	getUniqueName(void);
+
+
+	/*************************************************************************
+		Implementation Data
+	*************************************************************************/
+	static	uint32          d_texturenumber;	//!< Counter used to provide unique texture names.
+
+	Ogre::TexturePtr		d_ogre_texture;		//!< The 'real' texture.
+
+	ushort					d_width;			//!< cached width of the texture
+	ushort					d_height;			//!< cached height of the texture
+
+	bool	d_isLinked;		//!< True if we are linked to a texture we did not actually create.
+};
+
+
+} // End of  CEGUI namespace section
+
+
+#endif	// end of guard _OgreCEGUITexture_h_
Index: /Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer.cbp
===================================================================
--- /Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer.cbp	(revision 5)
+++ /Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer.cbp	(revision 5)
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="OgreGUIRenderer" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\..\lib\OgreGUIRenderer_d.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\bin\Debug" />
+				<Option external_deps="..\..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="CEGUIBase_d" />
+					<Add library="Ogremain_d" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\..\lib\OgreGUIRenderer.dll" prefix_auto="0" extension_auto="0" />
+				<Option object_output="..\bin\Release" />
+				<Option external_deps="..\..\..\..\lib\OgreMain.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="CEGUIBase" />
+					<Add library="Ogremain" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add option="-D_USRDLL" />
+			<Add option="-DOGRE_GUIRENDERER_EXPORTS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\..\Dependencies\include\CEGUI" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\OgreCEGUIRenderer.h" />
+		<Unit filename="..\include\OgreCEGUIResourceProvider.h" />
+		<Unit filename="..\include\OgreCEGUITexture.h" />
+		<Unit filename="..\src\OgreCEGUIRenderer.cpp" />
+		<Unit filename="..\src\OgreCEGUIResourceProvider.cpp" />
+		<Unit filename="..\src\OgreCEGUITexture.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer.vcproj
===================================================================
--- /Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer.vcproj	(revision 5)
+++ /Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer.vcproj	(revision 5)
@@ -0,0 +1,251 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="OgreGUIRenderer"
+	ProjectGUID="{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}"
+	RootNamespace="OgreGUIRenderer"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\..\OgreMain\include;..\..\..\..\Dependencies\include;..\..\..\..\Dependencies\include\CEGUI"
+				PreprocessorDefinitions="WIN32;_DEBUG;_STLP_DEBUG;_WINDOWS;_USRDLL;OGRE_GUIRENDERER_EXPORTS"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				ForceConformanceInForLoopScope="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				WarnAsError="TRUE"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="4"
+				DisableSpecificWarnings="4251"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="CEGUIBase_d.lib OgreMain_d.lib"
+				OutputFile="$(OutDir)/$(ProjectName)_d.dll"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\..\lib&quot;;..\..\..\..\dependencies\lib\$(ConfigurationName)"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(ProjectName)_d.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy &quot;$(TargetPath)&quot; &quot;..\..\..\..\Samples\Common\bin\$(ConfigurationName)&quot;"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="..\include;..\..\..\..\OgreMain\include;..\..\..\..\Dependencies\include;..\..\..\..\Dependencies\include\CEGUI"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_GUIRENDERER_EXPORTS"
+				RuntimeLibrary="2"
+				ForceConformanceInForLoopScope="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				WarnAsError="TRUE"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4251"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="CEGUIBase.lib OgreMain.lib"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\..\lib&quot;;..\..\..\..\dependencies\lib\$(ConfigurationName)"
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/$(TargetName).lib"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy &quot;$(TargetPath)&quot; &quot;..\..\..\..\Samples\Common\bin\$(ConfigurationName)&quot;"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\..\OgreMain\include;..\..\..\..\Dependencies\include;..\..\..\..\Dependencies\include\CEGUI"
+				PreprocessorDefinitions="WIN32;_DEBUG;_STLP_DEBUG;_WINDOWS;_USRDLL;OGRE_GUIRENDERER_EXPORTS;OGRE_STATIC_LIB"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				ForceConformanceInForLoopScope="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				WarnAsError="TRUE"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="4"
+				DisableSpecificWarnings="4251"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)/$(ProjectName)Static_d.lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="..\include;..\..\..\..\OgreMain\include;..\..\..\..\Dependencies\include;..\..\..\..\Dependencies\include\CEGUI"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_GUIRENDERER_EXPORTS;OGRE_STATIC_LIB"
+				RuntimeLibrary="2"
+				ForceConformanceInForLoopScope="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				WarnAsError="TRUE"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4251"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)/$(ProjectName)Static.lib"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\OgreCEGUIRenderer.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCEGUIResourceProvider.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OgreCEGUITexture.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\OgreCEGUIRenderer.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCEGUIResourceProvider.h">
+			</File>
+			<File
+				RelativePath="..\include\OgreCEGUITexture.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer_linux.cbp
===================================================================
--- /Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer_linux.cbp	(revision 5)
+++ /Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer_linux.cbp	(revision 5)
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="OgreGUIRenderer" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../../../lib/libOgreGUIRenderer_d.so" prefix_auto="0" extension_auto="0" />
+				<Option object_output="../bin/Debug" />
+				<Option external_deps="../../../../lib/libOgreMain_d.so;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="CEGUIBase" />
+					<Add library="OgreMain_d" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cp $($(TARGET_NAME)_OUTPUT_FILE) ../../bin/$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../../../lib/libOgreGUIRenderer.so" prefix_auto="0" extension_auto="0" />
+				<Option object_output="../bin/Release" />
+				<Option external_deps="../../../../lib/libOgreMain.so;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreMain" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cp $($(TARGET_NAME)_OUTPUT_FILE) ../../bin/$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-fvisibility=hidden" />
+			<Add option="-fvisibility-inlines-hidden" />
+			<Add option="-fPIC" />
+			<Add option="-DOGRE_GUIRENDERER_EXPORTS" />
+			<Add option="-DOGRE_GCC_VISIBILITY" />
+			<Add option="-DPIC" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../bin/$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="../include/OgreCEGUIRenderer.h" />
+		<Unit filename="../include/OgreCEGUIResourceProvider.h" />
+		<Unit filename="../include/OgreCEGUITexture.h" />
+		<Unit filename="../src/OgreCEGUIRenderer.cpp" />
+		<Unit filename="../src/OgreCEGUIResourceProvider.cpp" />
+		<Unit filename="../src/OgreCEGUITexture.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer_stlp.cbp
===================================================================
--- /Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer_stlp.cbp	(revision 5)
+++ /Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer_stlp.cbp	(revision 5)
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="4" />
+	<Project>
+		<Option title="OgreGUIRenderer" />
+		<Option default_target="-1" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\..\lib\OgreGUIRenderer_d.dll" />
+				<Option object_output="..\bin\Debug" />
+				<Option external_deps="..\..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option includeInTargetAll="1" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DWIN32" />
+					<Add option="-D_DEBUG" />
+					<Add option="-D_STLP_DEBUG" />
+					<Add option="-D_WINDOWS" />
+					<Add option="-D_USRDLL" />
+				</Compiler>
+				<Linker>
+					<Add library="CEGUIBase_d" />
+					<Add library="Ogremain_d" />
+					<Add library="stlportstlg.5.0" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\..\lib\OgreGUIRenderer.dll" />
+				<Option object_output="..\bin\Release" />
+				<Option external_deps="..\..\..\..\lib\OgreMain.dll;" />
+				<Option type="3" />
+				<Option compiler="gcc" />
+				<Option includeInTargetAll="1" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DWIN32" />
+					<Add option="-DNDEBUG" />
+					<Add option="-D_WINDOWS" />
+					<Add option="-D_USRDLL" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="CEGUIBase" />
+					<Add library="Ogremain" />
+					<Add library="stlport.5.0" />
+				</Linker>
+				<ExtraCommands>
+					<Add after="cmd /c copy $($(TARGET_NAME)_OUTPUT_FILE) ..\..\bin\$(TARGET_NAME)" />
+				</ExtraCommands>
+			</Target>
+		</Build>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-D_STLP_USE_DYNAMIC_LIB" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\..\Dependencies\include\CEGUI" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\OgreCEGUIRenderer.h">
+			<Option compilerVar="" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCEGUIResourceProvider.h">
+			<Option compilerVar="" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OgreCEGUITexture.h">
+			<Option compilerVar="" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCEGUIRenderer.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCEGUIResourceProvider.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OgreCEGUITexture.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer_vc8.vcproj
===================================================================
--- /Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer_vc8.vcproj	(revision 5)
+++ /Samples/Common/CEGUIRenderer/scripts/OgreGUIRenderer_vc8.vcproj	(revision 5)
@@ -0,0 +1,371 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="OgreGUIRenderer"
+	ProjectGUID="{2250CA22-7F4D-4BC0-A8E7-B4400D209B33}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\..\OgreMain\include;..\..\..\..\Dependencies\include;..\..\..\..\Dependencies\include\CEGUI"
+				PreprocessorDefinitions="WIN32;_DEBUG;_STLP_DEBUG;_WINDOWS;_USRDLL;OGRE_GUIRENDERER_EXPORTS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				ForceConformanceInForLoopScope="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				WarnAsError="true"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="4"
+				DisableSpecificWarnings="4251"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="CEGUIBase_d.lib Ogremain_d.lib"
+				OutputFile="$(OutDir)/$(ProjectName)_d.dll"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\..\lib&quot;;..\..\..\..\dependencies\lib\$(ConfigurationName)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(IntDir)/$(ProjectName)_d.pdb"
+				SubSystem="2"
+				ImportLibrary="..\..\..\..\lib\$(ProjectName)_d.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy &quot;$(TargetPath)&quot; &quot;..\..\..\..\Samples\Common\bin\$(ConfigurationName)&quot;"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="..\include;..\..\..\..\OgreMain\include;..\..\..\..\Dependencies\include;..\..\..\..\Dependencies\include\CEGUI"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_GUIRENDERER_EXPORTS"
+				RuntimeLibrary="2"
+				ForceConformanceInForLoopScope="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				WarnAsError="true"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4251"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="CEGUIBase.lib Ogremain.lib"
+				OutputFile="$(OutDir)/$(ProjectName).dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\..\lib&quot;;..\..\..\..\dependencies\lib\$(ConfigurationName)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(IntDir)/$(ProjectName).pdb"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="..\..\..\..\lib\$(ProjectName).lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy &quot;$(TargetPath)&quot; &quot;..\..\..\..\Samples\Common\bin\$(ConfigurationName)&quot;"
+			/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\..\OgreMain\include;..\..\..\..\Dependencies\include;..\..\..\..\Dependencies\include\CEGUI"
+				PreprocessorDefinitions="WIN32;_DEBUG;_STLP_DEBUG;_WINDOWS;_USRDLL;OGRE_STATIC_LIB"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				ForceConformanceInForLoopScope="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				WarnAsError="true"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="4"
+				DisableSpecificWarnings="4251"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)\$(ProjectName)Static_d.lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy &quot;$(TargetPath)&quot; &quot;..\..\..\..\Samples\Common\bin\$(ConfigurationName)&quot;"
+			/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\..\..\..\lib"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="..\include;..\..\..\..\OgreMain\include;..\..\..\..\Dependencies\include;..\..\..\..\Dependencies\include\CEGUI"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OGRE_STATIC_LIB"
+				RuntimeLibrary="2"
+				ForceConformanceInForLoopScope="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				WarnAsError="true"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4251"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)\$(ProjectName)Static.lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine=""
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\OgreCEGUIRenderer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCEGUIResourceProvider.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OgreCEGUITexture.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\OgreCEGUIRenderer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCEGUIResourceProvider.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OgreCEGUITexture.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Common/CEGUIRenderer/src/Makefile.am
===================================================================
--- /Samples/Common/CEGUIRenderer/src/Makefile.am	(revision 5)
+++ /Samples/Common/CEGUIRenderer/src/Makefile.am	(revision 5)
@@ -0,0 +1,8 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Common/CEGUIRenderer/include -I$(top_srcdir)/OgreMain/include @CEGUI_CFLAGS@ $(CFLAGS_VISIBILITY)
+
+lib_LTLIBRARIES = libCEGUIOgreRenderer.la
+
+libCEGUIOgreRenderer_la_SOURCES = OgreCEGUIRenderer.cpp OgreCEGUITexture.cpp OgreCEGUIResourceProvider.cpp
+libCEGUIOgreRenderer_la_LIBADD  = $(STLPORT_LIBS)
+libCEGUIOgreRenderer_la_LDFLAGS = -release @PACKAGE_VERSION@
+
Index: /Samples/Common/CEGUIRenderer/src/Makefile.in
===================================================================
--- /Samples/Common/CEGUIRenderer/src/Makefile.in	(revision 5)
+++ /Samples/Common/CEGUIRenderer/src/Makefile.in	(revision 5)
@@ -0,0 +1,534 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Common/CEGUIRenderer/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libdir)"
+libLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(lib_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+libCEGUIOgreRenderer_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_libCEGUIOgreRenderer_la_OBJECTS = OgreCEGUIRenderer.lo \
+	OgreCEGUITexture.lo OgreCEGUIResourceProvider.lo
+libCEGUIOgreRenderer_la_OBJECTS =  \
+	$(am_libCEGUIOgreRenderer_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libCEGUIOgreRenderer_la_SOURCES)
+DIST_SOURCES = $(libCEGUIOgreRenderer_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Common/CEGUIRenderer/include -I$(top_srcdir)/OgreMain/include @CEGUI_CFLAGS@ $(CFLAGS_VISIBILITY)
+lib_LTLIBRARIES = libCEGUIOgreRenderer.la
+libCEGUIOgreRenderer_la_SOURCES = OgreCEGUIRenderer.cpp OgreCEGUITexture.cpp OgreCEGUIResourceProvider.cpp
+libCEGUIOgreRenderer_la_LIBADD = $(STLPORT_LIBS)
+libCEGUIOgreRenderer_la_LDFLAGS = -release @PACKAGE_VERSION@
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Common/CEGUIRenderer/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Common/CEGUIRenderer/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    f=$(am__strip_dir) \
+	    echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+	    $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  p=$(am__strip_dir) \
+	  echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+	  $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+	done
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libCEGUIOgreRenderer.la: $(libCEGUIOgreRenderer_la_OBJECTS) $(libCEGUIOgreRenderer_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(libdir) $(libCEGUIOgreRenderer_la_LDFLAGS) $(libCEGUIOgreRenderer_la_OBJECTS) $(libCEGUIOgreRenderer_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCEGUIRenderer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCEGUIResourceProvider.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OgreCEGUITexture.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(libdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-libLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libLTLIBRARIES clean-libtool ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am \
+	install-libLTLIBRARIES install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-libLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Common/CEGUIRenderer/src/OgreCEGUIRenderer.cpp
===================================================================
--- /Samples/Common/CEGUIRenderer/src/OgreCEGUIRenderer.cpp	(revision 5)
+++ /Samples/Common/CEGUIRenderer/src/OgreCEGUIRenderer.cpp	(revision 5)
@@ -0,0 +1,789 @@
+/************************************************************************
+	filename: 	OgreCEGUIRenderer.cpp
+	created:	11/5/2004
+	author:		Paul D Turner
+	
+	purpose:	Implementation of Renderer class for Ogre engine
+*************************************************************************/
+/*************************************************************************
+    Crazy Eddie's GUI System (http://www.cegui.org.uk)
+    Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*************************************************************************/
+
+#include <CEGUI/CEGUIImagesetManager.h>
+#include <CEGUI/CEGUIImageset.h>
+#include <CEGUI/CEGUIImage.h>
+#include <CEGUI/CEGUIExceptions.h>
+#include <CEGUI/CEGUISystem.h>
+
+#include "OgreCEGUIRenderer.h"
+#include "OgreCEGUITexture.h"
+#include "OgreCEGUIResourceProvider.h"
+
+#include <OgreRenderSystem.h>
+#include <OgreRoot.h>
+#include <OgreHardwareBufferManager.h>
+#include <OgreRenderWindow.h>
+
+// Start of CEGUI namespace section
+namespace CEGUI
+{
+/*************************************************************************
+	Constants definitions
+*************************************************************************/
+const size_t	OgreCEGUIRenderer::VERTEX_PER_QUAD			= 6;
+const size_t	OgreCEGUIRenderer::VERTEX_PER_TRIANGLE		= 3;
+const size_t	OgreCEGUIRenderer::VERTEXBUFFER_INITIAL_CAPACITY	= 256;
+const size_t    OgreCEGUIRenderer::UNDERUSED_FRAME_THRESHOLD = 50000; // halfs buffer every 8 minutes on 100fps
+
+/*************************************************************************
+	Utility function to create a render operation and vertex buffer to render quads
+*************************************************************************/
+static void createQuadRenderOp(Ogre::RenderOperation &d_render_op, 
+    Ogre::HardwareVertexBufferSharedPtr &d_buffer, size_t nquads)
+{
+    using namespace Ogre;
+    // Create and initialise the Ogre specific parts required for use in rendering later.
+	d_render_op.vertexData = new VertexData;
+	d_render_op.vertexData->vertexStart = 0;
+
+	// setup vertex declaration for the vertex format we use
+	VertexDeclaration* vd = d_render_op.vertexData->vertexDeclaration;
+	size_t vd_offset = 0;
+	vd->addElement(0, vd_offset, VET_FLOAT3, VES_POSITION);
+	vd_offset += VertexElement::getTypeSize(VET_FLOAT3);
+	vd->addElement(0, vd_offset, VET_COLOUR, VES_DIFFUSE);
+	vd_offset += VertexElement::getTypeSize(VET_COLOUR);
+	vd->addElement(0, vd_offset, VET_FLOAT2, VES_TEXTURE_COORDINATES);
+
+	// create hardware vertex buffer
+	d_buffer = HardwareBufferManager::getSingleton().createVertexBuffer(vd->getVertexSize(0), nquads,  
+        HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, false);
+
+	// bind vertex buffer
+	d_render_op.vertexData->vertexBufferBinding->setBinding(0, d_buffer);
+
+	// complete render operation basic initialisation
+	d_render_op.operationType = RenderOperation::OT_TRIANGLE_LIST;
+	d_render_op.useIndexes = false;
+}
+
+static void destroyQuadRenderOp(Ogre::RenderOperation &d_render_op, 
+    Ogre::HardwareVertexBufferSharedPtr &d_buffer)
+{
+    delete d_render_op.vertexData;
+    d_render_op.vertexData = 0;
+    d_buffer.setNull();
+}
+
+/*************************************************************************
+	Constructor
+*************************************************************************/
+OgreCEGUIRenderer::OgreCEGUIRenderer(Ogre::RenderWindow* window, Ogre::uint8 queue_id, bool post_queue, uint max_quads)
+{
+	constructor_impl(window, queue_id, post_queue, max_quads);
+}
+
+
+/*************************************************************************
+	Constructor (specifying scene manager)
+*************************************************************************/
+OgreCEGUIRenderer::OgreCEGUIRenderer(Ogre::RenderWindow* window, Ogre::uint8 queue_id, bool post_queue, uint max_quads, Ogre::SceneManager* scene_manager)
+{
+	constructor_impl(window, queue_id, post_queue, max_quads);
+
+	// hook into ogre rendering system
+	setTargetSceneManager(scene_manager);
+}
+
+
+/*************************************************************************
+	Destructor
+*************************************************************************/
+OgreCEGUIRenderer::~OgreCEGUIRenderer(void)
+{
+	setTargetSceneManager(NULL);
+
+	if (d_ourlistener)
+	{
+		delete d_ourlistener;
+	}
+
+	// cleanup vertex data we allocated in constructor
+	destroyQuadRenderOp(d_render_op, d_buffer);
+    destroyQuadRenderOp(d_direct_render_op, d_direct_buffer);
+
+	destroyAllTextures();
+}
+
+
+/*************************************************************************
+	add's a quad to the list to be rendered
+*************************************************************************/
+void OgreCEGUIRenderer::addQuad(const Rect& dest_rect, float z, const Texture* tex, const Rect& texture_rect, const ColourRect& colours, QuadSplitMode quad_split_mode)
+{
+	// if not queueing, render directly (as in, right now!). This is used for the mouse cursor.
+	if (!d_queueing)
+	{
+		renderQuadDirect(dest_rect, z, tex, texture_rect, colours, quad_split_mode);
+	}
+	else
+	{
+		d_sorted = false;
+		QuadInfo quad;
+		
+		// set quad position, flipping y co-ordinates, and applying appropriate texel origin offset
+		quad.position.d_left	= dest_rect.d_left;
+		quad.position.d_right	= dest_rect.d_right;
+		quad.position.d_top		= d_display_area.getHeight() - dest_rect.d_top;
+		quad.position.d_bottom	= d_display_area.getHeight() - dest_rect.d_bottom;
+		quad.position.offset(d_texelOffset);
+
+		// convert quad co-ordinates for a -1 to 1 co-ordinate system.
+		quad.position.d_left	/= (d_display_area.getWidth() * 0.5f);
+		quad.position.d_right	/= (d_display_area.getWidth() * 0.5f);
+		quad.position.d_top		/= (d_display_area.getHeight() * 0.5f);
+		quad.position.d_bottom	/= (d_display_area.getHeight() * 0.5f);
+		quad.position.offset(Point(-1.0f, -1.0f));
+
+		quad.z				= -1 + z;
+		quad.texture		= ((OgreCEGUITexture*)tex)->getOgreTexture();
+		quad.texPosition	= texture_rect;
+
+		// covert colours for ogre, note that top / bottom are switched.
+		quad.topLeftCol		= colourToOgre(colours.d_bottom_left);
+		quad.topRightCol	= colourToOgre(colours.d_bottom_right);
+		quad.bottomLeftCol	= colourToOgre(colours.d_top_left);
+		quad.bottomRightCol	= colourToOgre(colours.d_top_right);
+		
+		// set quad split mode
+		quad.splitMode = quad_split_mode;
+
+		d_quadlist.insert(quad);
+	}
+}
+
+
+
+/*************************************************************************
+perform final rendering for all queued renderable quads.
+*************************************************************************/
+void OgreCEGUIRenderer::doRender(void)
+{
+    // Render if overlays enabled and the quad list is not empty
+	if (d_render_sys->_getViewport()->getOverlaysEnabled() && !d_quadlist.empty())
+	{
+        /// Quad list needs to be sorted and thus the vertex buffer rebuilt. If not, we can
+        /// reuse the vertex buffer resulting in a nice speed gain.
+        if(!d_sorted)
+        {
+            sortQuads();
+            /// Resize vertex buffer if it is too small
+            size_t size = d_buffer->getNumVertices();
+            size_t requestedSize = d_quadlist.size()*VERTEX_PER_QUAD;
+            if(size < requestedSize)
+            {
+                /// Double buffer size until smaller than requested size
+                while(size < requestedSize)
+                    size = size * 2;
+                /// Reallocate the buffer
+                destroyQuadRenderOp(d_render_op, d_buffer);
+                createQuadRenderOp(d_render_op, d_buffer, size);
+            }
+            else if(requestedSize < size/2 && d_underused_framecount >= UNDERUSED_FRAME_THRESHOLD)
+            {
+                /// Resize vertex buffer if it has been to big for too long
+                size = size / 2;
+                destroyQuadRenderOp(d_render_op, d_buffer);
+                createQuadRenderOp(d_render_op, d_buffer, size);
+                /// Reset underused framecount so it takes another UNDERUSED_FRAME_THRESHOLD to half again
+                d_underused_framecount = 0;
+            }
+            /// Fill the buffer
+            QuadVertex*	buffmem;
+            buffmem = (QuadVertex*)d_buffer->lock(Ogre::HardwareVertexBuffer::HBL_DISCARD);
+            // iterate over each quad in the list
+            for (QuadList::iterator i = d_quadlist.begin(); i != d_quadlist.end(); ++i)
+            {
+                const QuadInfo& quad = (*i);
+                // setup Vertex 1...
+                buffmem->x = quad.position.d_left;
+                buffmem->y = quad.position.d_bottom;
+                buffmem->z = quad.z;
+                buffmem->diffuse = quad.topLeftCol;
+                buffmem->tu1 = quad.texPosition.d_left;
+                buffmem->tv1 = quad.texPosition.d_bottom;
+                ++buffmem;
+    
+                // setup Vertex 2...
+                
+                // top-left to bottom-right diagonal
+                if (quad.splitMode == TopLeftToBottomRight)
+                {
+                    buffmem->x = quad.position.d_right;
+                    buffmem->y = quad.position.d_bottom;
+                    buffmem->z = quad.z;
+                    buffmem->diffuse = quad.topRightCol;
+                    buffmem->tu1 = quad.texPosition.d_right;
+                    buffmem->tv1 = quad.texPosition.d_bottom;
+                }
+                // bottom-left to top-right diagonal
+                else
+                {
+                    buffmem->x = quad.position.d_right;
+                    buffmem->y = quad.position.d_top;
+                    buffmem->z = quad.z;
+                    buffmem->diffuse = quad.bottomRightCol;
+                    buffmem->tu1 = quad.texPosition.d_right;
+                    buffmem->tv1 = quad.texPosition.d_top;
+                }
+                ++buffmem;
+    
+                // setup Vertex 3...
+                buffmem->x = quad.position.d_left;
+                buffmem->y = quad.position.d_top;
+                buffmem->z = quad.z;
+                buffmem->diffuse = quad.bottomLeftCol;
+                buffmem->tu1 = quad.texPosition.d_left;
+                buffmem->tv1 = quad.texPosition.d_top;
+                ++buffmem;
+    
+                // setup Vertex 4...
+                buffmem->x = quad.position.d_right;
+                buffmem->y = quad.position.d_bottom;
+                buffmem->z = quad.z;
+                buffmem->diffuse = quad.topRightCol;
+                buffmem->tu1 = quad.texPosition.d_right;
+                buffmem->tv1 = quad.texPosition.d_bottom;
+                ++buffmem;
+    
+                // setup Vertex 5...
+                buffmem->x = quad.position.d_right;
+                buffmem->y = quad.position.d_top;
+                buffmem->z = quad.z;
+                buffmem->diffuse = quad.bottomRightCol;
+                buffmem->tu1 = quad.texPosition.d_right;
+                buffmem->tv1 = quad.texPosition.d_top;
+                ++buffmem;
+    
+                // setup Vertex 6...
+                
+                // top-left to bottom-right diagonal
+                if (quad.splitMode == TopLeftToBottomRight)
+                {
+                    buffmem->x = quad.position.d_left;
+                    buffmem->y = quad.position.d_top;
+                    buffmem->z = quad.z;
+                    buffmem->diffuse = quad.bottomLeftCol;
+                    buffmem->tu1 = quad.texPosition.d_left;
+                    buffmem->tv1 = quad.texPosition.d_top;
+                }
+                // bottom-left to top-right diagonal
+                else
+                {
+                    buffmem->x = quad.position.d_left;
+                    buffmem->y = quad.position.d_bottom;
+                    buffmem->z = quad.z;
+                    buffmem->diffuse = quad.topLeftCol;
+                    buffmem->tu1 = quad.texPosition.d_left;
+                    buffmem->tv1 = quad.texPosition.d_bottom;
+                }
+                ++buffmem;
+            }
+    
+            // ensure we leave the buffer in the unlocked state
+            d_buffer->unlock();
+        }
+        
+        /// Render the buffer
+        d_bufferPos = 0;
+		bool first = true;
+
+        // Iterate over each quad in the list and render it
+        QuadList::iterator i = d_quadlist.begin();
+        while(i != d_quadlist.end())
+        {
+            
+            d_currTexture = i->texture;
+            d_render_op.vertexData->vertexStart = d_bufferPos;
+            for (; i != d_quadlist.end(); ++i)
+            {
+                const QuadInfo& quad = (*i);
+                if (d_currTexture != quad.texture)
+				{
+                    /// If it has a different texture, render this quad in next operation
+					/// also need to reset render states
+					first = true;
+		            break;
+				}
+                d_bufferPos += VERTEX_PER_QUAD;
+            }
+            d_render_op.vertexData->vertexCount = d_bufferPos - d_render_op.vertexData->vertexStart;
+            /// Set texture, and do the render
+            d_render_sys->_setTexture(0, true, d_currTexture);
+			if (first)
+			{
+				initRenderStates();
+				first = false;
+			}
+            d_render_sys->_render(d_render_op);
+        }
+
+	}
+    /// Count frames to check if utilization of vertex buffer was below half the capacity for 500,000 frames
+    if(d_bufferPos < d_buffer->getNumVertices()/2)
+       d_underused_framecount++;
+    else
+       d_underused_framecount = 0;
+}
+
+
+/*************************************************************************
+	clear the queue
+*************************************************************************/
+void OgreCEGUIRenderer::clearRenderList(void)
+{
+	d_sorted = true;
+	d_quadlist.clear();
+}
+
+
+/*************************************************************************
+	create an empty texture
+*************************************************************************/
+Texture* OgreCEGUIRenderer::createTexture(void)
+{
+	OgreCEGUITexture* tex = new OgreCEGUITexture(this);
+	d_texturelist.push_back(tex);
+	return tex;
+}
+
+
+/*************************************************************************
+	create a texture and load it with the specified file.
+*************************************************************************/
+Texture* OgreCEGUIRenderer::createTexture(const String& filename, const String& resourceGroup)
+{
+	OgreCEGUITexture* tex = (OgreCEGUITexture*)createTexture();
+	tex->loadFromFile(filename, resourceGroup);
+
+	return tex;
+}
+
+
+/*************************************************************************
+	create a texture and set it to the specified size
+*************************************************************************/
+Texture* OgreCEGUIRenderer::createTexture(float size)
+{
+	OgreCEGUITexture* tex = (OgreCEGUITexture*)createTexture();
+	tex->setOgreTextureSize((uint)size);
+
+	return tex;
+}
+
+
+/*************************************************************************
+	destroy the given texture
+*************************************************************************/
+void OgreCEGUIRenderer::destroyTexture(Texture* texture)
+{
+	if (texture != NULL)
+	{
+		OgreCEGUITexture* tex = (OgreCEGUITexture*)texture;
+
+		d_texturelist.remove(tex);
+		delete tex;
+	}
+}
+
+
+/*************************************************************************
+	destroy all textures still active
+*************************************************************************/
+void OgreCEGUIRenderer::destroyAllTextures(void)
+{
+	while (!d_texturelist.empty())
+	{
+		destroyTexture(*(d_texturelist.begin()));
+	}
+}
+
+
+/*************************************************************************
+	setup states etc	
+*************************************************************************/
+void OgreCEGUIRenderer::initRenderStates(void)
+{
+	using namespace Ogre;
+
+	// set-up matrices
+	d_render_sys->_setWorldMatrix(Matrix4::IDENTITY);
+	d_render_sys->_setViewMatrix(Matrix4::IDENTITY);
+	d_render_sys->_setProjectionMatrix(Matrix4::IDENTITY);
+
+	// initialise render settings
+	d_render_sys->setLightingEnabled(false);
+	d_render_sys->_setDepthBufferParams(false, false);
+	d_render_sys->_setDepthBias(0, 0);
+	d_render_sys->_setCullingMode(CULL_NONE);
+	d_render_sys->_setFog(FOG_NONE);
+	d_render_sys->_setColourBufferWriteEnabled(true, true, true, true);
+	d_render_sys->unbindGpuProgram(GPT_FRAGMENT_PROGRAM);
+	d_render_sys->unbindGpuProgram(GPT_VERTEX_PROGRAM);
+	d_render_sys->setShadingType(SO_GOURAUD);
+	d_render_sys->_setPolygonMode(PM_SOLID);
+
+	// initialise texture settings
+	d_render_sys->_setTextureCoordCalculation(0, TEXCALC_NONE);
+	d_render_sys->_setTextureCoordSet(0, 0);
+	d_render_sys->_setTextureUnitFiltering(0, FO_LINEAR, FO_LINEAR, FO_POINT);
+	d_render_sys->_setTextureAddressingMode(0, d_uvwAddressMode);
+	d_render_sys->_setTextureMatrix(0, Matrix4::IDENTITY);
+	d_render_sys->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0);
+	d_render_sys->_setTextureBlendMode(0, d_colourBlendMode);
+	d_render_sys->_setTextureBlendMode(0, d_alphaBlendMode);
+	d_render_sys->_disableTextureUnitsFrom(1);
+
+	// enable alpha blending
+	d_render_sys->_setSceneBlending(SBF_SOURCE_ALPHA, SBF_ONE_MINUS_SOURCE_ALPHA);
+}
+
+
+ 
+/*************************************************************************
+	sort quads list according to texture	
+*************************************************************************/
+void OgreCEGUIRenderer::sortQuads(void)
+{
+	if (!d_sorted)
+	{
+		d_sorted = true;
+	}
+
+}
+
+/*************************************************************************
+render a quad directly to the display
+*************************************************************************/
+void OgreCEGUIRenderer::renderQuadDirect(const Rect& dest_rect, float z, const Texture* tex, const Rect& texture_rect, const ColourRect& colours, QuadSplitMode quad_split_mode)
+{
+	if (d_render_sys->_getViewport()->getOverlaysEnabled())
+	{
+		z = -1 + z;
+
+		Rect final_rect;
+
+		// set quad position, flipping y co-ordinates, and applying appropriate texel origin offset
+		final_rect.d_left	= dest_rect.d_left;
+		final_rect.d_right	= dest_rect.d_right;
+		final_rect.d_top	= d_display_area.getHeight() - dest_rect.d_top;
+		final_rect.d_bottom	= d_display_area.getHeight() - dest_rect.d_bottom;
+		final_rect.offset(d_texelOffset);
+
+		// convert quad co-ordinates for a -1 to 1 co-ordinate system.
+		final_rect.d_left	/= (d_display_area.getWidth() * 0.5f);
+		final_rect.d_right	/= (d_display_area.getWidth() * 0.5f);
+		final_rect.d_top	/= (d_display_area.getHeight() * 0.5f);
+		final_rect.d_bottom	/= (d_display_area.getHeight() * 0.5f);
+		final_rect.offset(Point(-1.0f, -1.0f));
+
+		// convert colours for ogre, note that top / bottom are switched.
+        uint32 topLeftCol	= colourToOgre(colours.d_bottom_left);
+        uint32 topRightCol	= colourToOgre(colours.d_bottom_right);
+        uint32 bottomLeftCol	= colourToOgre(colours.d_top_left);
+        uint32 bottomRightCol= colourToOgre(colours.d_top_right);
+
+		QuadVertex*	buffmem = (QuadVertex*)d_direct_buffer->lock(Ogre::HardwareVertexBuffer::HBL_DISCARD);
+
+		// setup Vertex 1...
+		buffmem->x	= final_rect.d_left;
+		buffmem->y	= final_rect. d_bottom;
+		buffmem->z	= z;
+		buffmem->diffuse = topLeftCol;
+		buffmem->tu1	= texture_rect.d_left;
+		buffmem->tv1	= texture_rect.d_bottom;
+		++buffmem;
+
+		// setup Vertex 2...
+		
+		// top-left to bottom-right diagonal
+		if (quad_split_mode == TopLeftToBottomRight)
+		{
+			buffmem->x	= final_rect.d_right;
+			buffmem->y = final_rect.d_bottom;
+			buffmem->z	= z;
+			buffmem->diffuse = topRightCol;
+			buffmem->tu1	= texture_rect.d_right;
+			buffmem->tv1	= texture_rect.d_bottom;
+			++buffmem;
+		}
+		// bottom-left to top-right diagonal
+		else
+		{
+			buffmem->x	= final_rect.d_right;
+			buffmem->y = final_rect.d_top;
+			buffmem->z	= z;
+			buffmem->diffuse = bottomRightCol;
+			buffmem->tu1	= texture_rect.d_right;
+			buffmem->tv1	= texture_rect.d_top;
+			++buffmem;
+		}
+
+		// setup Vertex 3...
+		buffmem->x	= final_rect.d_left;
+		buffmem->y	= final_rect.d_top;
+		buffmem->z	= z;
+		buffmem->diffuse = bottomLeftCol;
+		buffmem->tu1	= texture_rect.d_left;
+		buffmem->tv1	= texture_rect.d_top;
+		++buffmem;
+
+		// setup Vertex 4...
+		buffmem->x	= final_rect.d_right;
+		buffmem->y	= final_rect.d_bottom;
+		buffmem->z	= z;
+		buffmem->diffuse = topRightCol;
+		buffmem->tu1	= texture_rect.d_right;
+		buffmem->tv1	= texture_rect.d_bottom;
+		++buffmem;
+
+		// setup Vertex 5...
+		buffmem->x	= final_rect.d_right;
+		buffmem->y	= final_rect.d_top;
+		buffmem->z	= z;
+		buffmem->diffuse = bottomRightCol;
+		buffmem->tu1	= texture_rect.d_right;
+		buffmem->tv1	= texture_rect.d_top;
+		++buffmem;
+
+		// setup Vertex 6...
+		
+		// top-left to bottom-right diagonal
+		if (quad_split_mode == TopLeftToBottomRight)
+		{
+			buffmem->x	= final_rect.d_left;
+			buffmem->y = final_rect.d_top;
+			buffmem->z	= z;
+			buffmem->diffuse = bottomLeftCol;
+			buffmem->tu1	= texture_rect.d_left;
+			buffmem->tv1	= texture_rect.d_top;
+		}
+		// bottom-left to top-right diagonal
+		else
+		{
+			buffmem->x	= final_rect.d_left;
+			buffmem->y = final_rect.d_bottom;
+			buffmem->z	= z;
+			buffmem->diffuse = topLeftCol;
+			buffmem->tu1	= texture_rect.d_left;
+			buffmem->tv1	= texture_rect.d_bottom;
+		}
+
+		d_direct_buffer->unlock();
+
+        //
+		// perform rendering...
+		//
+		d_render_sys->_setTexture(0, true, ((OgreCEGUITexture*)tex)->getOgreTexture()->getName());
+		initRenderStates();
+		d_direct_render_op.vertexData->vertexCount = VERTEX_PER_QUAD;
+		d_render_sys->_render(d_direct_render_op);
+	}
+
+}
+
+/*************************************************************************
+	convert ARGB colour value to whatever the Ogre render system is
+	expecting.	
+*************************************************************************/
+uint32 OgreCEGUIRenderer::colourToOgre(const colour& col) const
+{
+	Ogre::ColourValue cv(col.getRed(), col.getGreen(), col.getBlue(), col.getAlpha());
+
+    uint32 final;
+	d_render_sys->convertColourValue(cv, &final);
+
+	return final;
+}
+
+
+/*************************************************************************
+	Set the scene manager to be used for rendering the GUI.	
+*************************************************************************/
+void OgreCEGUIRenderer::setTargetSceneManager(Ogre::SceneManager* scene_manager)
+{
+	// unhook from current scene manager.
+	if (d_sceneMngr != NULL)
+	{
+		d_sceneMngr->removeRenderQueueListener(d_ourlistener);
+		d_sceneMngr = NULL;
+	}
+
+	// hook new scene manager if that is not NULL
+	if (scene_manager != NULL)
+	{
+		d_sceneMngr = scene_manager;
+		d_sceneMngr->addRenderQueueListener(d_ourlistener);
+	}
+
+}
+
+
+/*************************************************************************
+	Set the target render queue for GUI rendering.	
+*************************************************************************/
+void OgreCEGUIRenderer::setTargetRenderQueue(Ogre::uint8 queue_id, bool post_queue)
+{
+	d_queue_id		= queue_id;
+	d_post_queue	= post_queue;
+
+	if (d_ourlistener != NULL)
+	{
+		d_ourlistener->setTargetRenderQueue(queue_id);
+		d_ourlistener->setPostRenderQueue(post_queue);
+	}
+
+}
+
+
+/*************************************************************************
+	perform main work of the constructor
+*************************************************************************/
+void OgreCEGUIRenderer::constructor_impl(Ogre::RenderWindow* window, Ogre::uint8 queue_id, bool post_queue, uint max_quads)
+{
+	using namespace Ogre;
+
+	// initialise the renderer fields
+	d_queueing		= true;
+	d_queue_id		= queue_id;
+	d_currTexture.isNull();
+	d_post_queue	= post_queue;
+	d_sceneMngr		= NULL;
+	d_bufferPos		= 0;
+	d_sorted		= true;
+	d_ogre_root		= Root::getSingletonPtr();
+	d_render_sys	= d_ogre_root->getRenderSystem();
+    // set ID string
+    d_identifierString = "CEGUI::OgreRenderer - Official Ogre based renderer module for CEGUI";
+
+	// Create and initialise the Ogre specific parts required for use in rendering later.
+    // Main GUI
+    createQuadRenderOp(d_render_op, d_buffer, VERTEXBUFFER_INITIAL_CAPACITY);
+    d_underused_framecount = 0;
+
+    // Mouse cursor
+    createQuadRenderOp(d_direct_render_op, d_direct_buffer, VERTEX_PER_QUAD);
+
+	// Discover display settings and setup d_display_area
+	d_display_area.d_left	= 0;
+	d_display_area.d_top	= 0;
+	d_display_area.d_right	= window->getWidth();
+	d_display_area.d_bottom	= window->getHeight();
+
+	// initialise required texel offset
+	d_texelOffset = Point((float)d_render_sys->getHorizontalTexelOffset(), -(float)d_render_sys->getVerticalTexelOffset());
+
+	// create listener which will handler the rendering side of things for us.
+	d_ourlistener = new CEGUIRQListener(this, queue_id, post_queue);
+
+	// Initialise blending modes to be used.
+	d_colourBlendMode.blendType	= Ogre::LBT_COLOUR;
+	d_colourBlendMode.source1	= Ogre::LBS_TEXTURE;
+	d_colourBlendMode.source2	= Ogre::LBS_DIFFUSE;
+	d_colourBlendMode.operation	= Ogre::LBX_MODULATE;
+
+	d_alphaBlendMode.blendType	= Ogre::LBT_ALPHA;
+	d_alphaBlendMode.source1	= Ogre::LBS_TEXTURE;
+	d_alphaBlendMode.source2	= Ogre::LBS_DIFFUSE;
+	d_alphaBlendMode.operation	= Ogre::LBX_MODULATE;
+
+	d_uvwAddressMode.u = Ogre::TextureUnitState::TAM_CLAMP;
+	d_uvwAddressMode.v = Ogre::TextureUnitState::TAM_CLAMP;
+	d_uvwAddressMode.w = Ogre::TextureUnitState::TAM_CLAMP;
+}
+
+
+/*************************************************************************
+	Create a texture from an existing Ogre::TexturePtr object	
+*************************************************************************/
+Texture* OgreCEGUIRenderer::createTexture(Ogre::TexturePtr& texture)
+{
+	OgreCEGUITexture* t = (OgreCEGUITexture*)createTexture();
+
+	if (!texture.isNull())
+	{
+		t->setOgreTexture(texture);
+	}
+
+	return t;
+
+}
+
+/*************************************************************************
+	Create a resource provider object
+*************************************************************************/
+ResourceProvider* OgreCEGUIRenderer::createResourceProvider(void)
+{
+    d_resourceProvider = new OgreCEGUIResourceProvider();
+    return d_resourceProvider;
+}
+
+/*************************************************************************
+Set the size of the display in pixels.	
+*************************************************************************/
+void OgreCEGUIRenderer::setDisplaySize(const Size& sz)
+{
+	if (d_display_area.getSize() != sz)
+	{
+		d_display_area.setSize(sz);
+
+		EventArgs args;
+		fireEvent(EventDisplaySizeChanged, args, EventNamespace);
+	}
+
+}
+
+/*************************************************************************
+	Callback from Ogre invoked before other stuff in our target queue
+	is rendered
+*************************************************************************/
+void CEGUIRQListener::renderQueueStarted(Ogre::uint8 id, const Ogre::String& invocation, 
+										 bool& skipThisQueue)
+{
+	if ((!d_post_queue) && (d_queue_id == id))
+	{
+		CEGUI::System::getSingleton().renderGUI();
+	}
+
+}
+
+
+/*************************************************************************
+Callback from Ogre invoked after other stuff in our target queue
+is rendered
+*************************************************************************/
+void CEGUIRQListener::renderQueueEnded(Ogre::uint8 id, const Ogre::String& invocation, bool& repeatThisQueue)
+{
+	if ((d_post_queue) && (d_queue_id == id))
+	{
+		CEGUI::System::getSingleton().renderGUI();
+	}
+
+}
+
+} // End of  CEGUI namespace section
Index: /Samples/Common/CEGUIRenderer/src/OgreCEGUIResourceProvider.cpp
===================================================================
--- /Samples/Common/CEGUIRenderer/src/OgreCEGUIResourceProvider.cpp	(revision 5)
+++ /Samples/Common/CEGUIRenderer/src/OgreCEGUIResourceProvider.cpp	(revision 5)
@@ -0,0 +1,97 @@
+/************************************************************************
+	filename: 	OgreCEGUIResourceProvider.cpp
+	created:	8/7/2004
+	author:		James '_mental_' O'Sullivan
+
+	purpose:	Implements the Resource Provider common functionality
+*************************************************************************/
+/*************************************************************************
+    Crazy Eddie's GUI System (http://www.cegui.org.uk)
+    Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*************************************************************************/
+#include "OgreCEGUIResourceProvider.h"
+
+#include <CEGUI/CEGUIExceptions.h>
+#include <OgreArchiveManager.h>
+
+
+// Start of CEGUI namespace section
+namespace CEGUI
+{
+    OgreCEGUIResourceProvider::OgreCEGUIResourceProvider() : ResourceProvider()
+    {
+        // set deafult resource group for Ogre
+        d_defaultResourceGroup = Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME.c_str();
+    }
+
+//    void OgreResourceProvider::loadInputSourceContainer(const String& filename, InputSourceContainer& output)
+//   {
+//        Ogre::DataStreamPtr input = Ogre::ResourceGroupManager::getSingleton().openResource(filename.c_str());
+//
+//		if (input.isNull())
+//		{
+//			throw InvalidRequestException((utf8*)
+//				"Scheme::Scheme - Filename supplied for Scheme loading must be valid");
+//		}
+//
+//       XERCES_CPP_NAMESPACE_USE
+//        size_t buffsz = input->size();
+//        unsigned char* mem = reinterpret_cast<unsigned char*>(XMLPlatformUtils::fgArrayMemoryManager->allocate(buffsz));
+//        memcpy(mem, input.getPointer()->getAsString().c_str(), buffsz);
+//        InputSource* mInputSource = new MemBufInputSource(mem, buffsz, filename.c_str(), true);
+//        input.setNull();
+//
+//       output.setData(mInputSource);
+//    }
+
+    void OgreCEGUIResourceProvider::loadRawDataContainer(const String& filename, RawDataContainer& output,  const String& resourceGroup)
+    {
+        String orpGroup;
+        if (resourceGroup.empty())
+            orpGroup = d_defaultResourceGroup.empty() ? Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME.c_str() : d_defaultResourceGroup;
+        else
+            orpGroup = resourceGroup;
+
+        Ogre::DataStreamPtr input =
+            Ogre::ResourceGroupManager::getSingleton().openResource(filename.c_str(), orpGroup.c_str());
+
+		if (input.isNull())
+		{
+            throw InvalidRequestException((utf8*)
+                "OgreCEGUIResourceProvider::loadRawDataContainer - Unable to open resource file '" + filename + (utf8*)"' in resource group '" + orpGroup + (utf8*)"'.");
+        }
+
+		Ogre::String buf = input->getAsString();
+		const size_t memBuffSize = buf.length();
+
+        unsigned char* mem = new unsigned char[memBuffSize];
+        memcpy(mem, buf.c_str(), memBuffSize);
+
+        output.setData(mem);
+        output.setSize(memBuffSize);
+    }
+
+	void OgreCEGUIResourceProvider::unloadRawDataContainer(RawDataContainer& data)
+	{
+		if (data.getDataPtr())
+		{
+			delete[] data.getDataPtr();
+			data.setData(0);
+			data.setSize(0);
+		}
+	}
+} // End of  CEGUI namespace section
Index: /Samples/Common/CEGUIRenderer/src/OgreCEGUITexture.cpp
===================================================================
--- /Samples/Common/CEGUIRenderer/src/OgreCEGUITexture.cpp	(revision 5)
+++ /Samples/Common/CEGUIRenderer/src/OgreCEGUITexture.cpp	(revision 5)
@@ -0,0 +1,268 @@
+/************************************************************************
+	filename: 	OgreCEGUITexture.cpp
+	created:	11/5/2004
+	author:		Paul D Turner
+	
+	purpose:	Implementation of Texture using Ogre engine
+*************************************************************************/
+/*************************************************************************
+    Crazy Eddie's GUI System (http://www.cegui.org.uk)
+    Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*************************************************************************/
+
+#include <CEGUI/CEGUISystem.h>
+#include <CEGUI/CEGUIExceptions.h>
+#include "OgreCEGUITexture.h"
+#include "OgreCEGUIRenderer.h"
+
+#include <OgreTextureManager.h>
+
+// Start of CEGUI namespace section
+namespace CEGUI
+{
+/*************************************************************************
+	Static data definition / initialisation
+*************************************************************************/
+uint32 OgreCEGUITexture::d_texturenumber		= 0;
+
+
+/*************************************************************************
+	Constructor
+*************************************************************************/
+OgreCEGUITexture::OgreCEGUITexture(Renderer* owner) :
+	Texture(owner)
+{
+	d_ogre_texture.setNull();
+	d_isLinked = false;
+}
+
+
+/*************************************************************************
+	Destructor
+*************************************************************************/
+OgreCEGUITexture::~OgreCEGUITexture(void)
+{
+	freeOgreTexture();
+}
+
+
+/*************************************************************************
+	Loads the specified image file into the texture.  The texture is
+	resized as required to hold the image.	
+*************************************************************************/
+void OgreCEGUITexture::loadFromFile(const String& filename, const String& resourceGroup)
+{
+	using namespace Ogre;
+
+	// unload old ogre texture
+	freeOgreTexture();
+
+	// create / load a new ogre texture from the specified image
+	try
+	{
+		TextureManager& textureManager = TextureManager::getSingleton();
+
+		// see if texture already exists
+		Ogre::TexturePtr ogreTexture = (Ogre::TexturePtr)textureManager.getByName(filename.c_str());
+
+		if (!ogreTexture.isNull())
+		{
+			// texture already exists, so create a 'linked' texture (ensures texture is not destroyed twice)
+			d_ogre_texture = ogreTexture;
+			d_isLinked = true;
+		}
+		// texture does not already exist, so load it in
+		else
+		{
+            String orpGroup;
+            if (resourceGroup.empty())
+            {
+                const String& defGrp = CEGUI::System::getSingleton().getResourceProvider()->getDefaultResourceGroup();
+                orpGroup = defGrp.empty() ? Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME.c_str() : defGrp;
+            }
+            else
+            {
+                orpGroup = resourceGroup;
+            }
+
+			d_ogre_texture = TextureManager::getSingleton().load(filename.c_str(), orpGroup.c_str(), TEX_TYPE_2D, 0, 1.0f);
+			d_isLinked = false;
+		}
+
+	}
+	catch(Ogre::Exception e)
+	{
+		throw RendererException((utf8*)"Failed to create Texture object from file '" + filename + "'. Additional Information:\n" + e.getFullDescription().c_str());
+	}
+
+	// if we got a pointer cache some details
+	if (!d_ogre_texture.isNull())
+	{
+		d_width		= d_ogre_texture->getWidth();
+		d_height	= d_ogre_texture->getHeight();
+	}
+	// no texture from image so throw.
+	else
+	{
+		throw RendererException((utf8*)"Failed to create Texture object from file '" + filename + "'.  Ogre returned a NULL pointer.");
+	}
+
+}
+
+
+/*************************************************************************
+	Loads (copies) an image in memory into the texture.  The texture is
+	resized as required to hold the image.	
+*************************************************************************/
+
+void _byteSwap(unsigned char* b, int n)
+{
+    register int i = 0;
+    register int j = n-1;
+    while (i<j)
+    {
+        std::swap(b[i], b[j]);
+        i++, j--;
+    }
+}
+#define byteSwap(x) _byteSwap((unsigned char*) &x,sizeof(x))
+
+void OgreCEGUITexture::loadFromMemory(const void* buffPtr, uint buffWidth, uint buffHeight, PixelFormat pixelFormat)
+{
+	using namespace Ogre;
+
+	// get rid of old texture
+	freeOgreTexture();
+
+	// wrap input buffer with an Ogre DataChunk
+    uint32 bytesize = ((buffWidth * sizeof(uint32)) * buffHeight);
+
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+    uint32* swappedBuffer = new uint32[bytesize/4];
+    memcpy(swappedBuffer, buffPtr, bytesize);
+
+    for (int i=0; i < bytesize/4; i++)
+        byteSwap(swappedBuffer[i]);
+
+    DataStreamPtr odc(new MemoryDataStream(static_cast<void*>(swappedBuffer), bytesize, false));
+#else
+	DataStreamPtr odc(new MemoryDataStream(const_cast<void*>(buffPtr), bytesize, false));
+#endif
+
+	// get pixel type for the target texture - the elements here might look wrong, but is just
+	// differences in definition (at the core level, between GL and D3D).
+	Ogre::PixelFormat targetFmt =
+		(pixelFormat == PF_RGBA) ? Ogre::PF_A8R8G8B8 : Ogre::PF_R8G8B8;
+
+	// try to create a Ogre::Texture from the input data
+	d_ogre_texture = TextureManager::getSingleton().loadRawData(getUniqueName(), "General", odc, buffWidth, buffHeight, targetFmt , TEX_TYPE_2D, 0, 1.0f);
+
+	// if we got a pointer cache some details
+	if (!d_ogre_texture.isNull())
+	{
+		d_width		= d_ogre_texture->getWidth();
+		d_height	= d_ogre_texture->getHeight();
+	}
+	// no texture from memory so throw.
+	else
+	{
+		throw RendererException((utf8*)"Failed to create Texture object from memory:  Ogre returned a NULL Ogre::Texture pointer.");
+	}
+
+}
+
+
+/*************************************************************************
+	set the size of the internal Ogre texture.  Previous Ogre texture
+	is lost.	
+*************************************************************************/
+void OgreCEGUITexture::setOgreTextureSize(uint size)
+{
+	using namespace Ogre;
+
+	// unload any current Ogre::Texture
+	freeOgreTexture();
+
+	// Try to create an empty texture of the given size
+	d_ogre_texture = TextureManager::getSingleton().createManual(getUniqueName(), "General", TEX_TYPE_2D, size, size, 0, PF_A8R8G8B8, TU_DEFAULT);
+
+	// if we got a pointer cache some details
+	if (!d_ogre_texture.isNull())
+	{
+		d_width		= d_ogre_texture->getWidth();
+		d_height	= d_ogre_texture->getHeight();
+	}
+	// no texture so throw.
+	else
+	{
+		throw RendererException((utf8*)"Failed to create texture of specified size: Ogre::Texture creation failed.");
+	}
+
+}
+
+
+/*************************************************************************
+	safely free Ogre::Texture texture (can be called multiple times with
+	no ill effect)
+*************************************************************************/
+void OgreCEGUITexture::freeOgreTexture(void)
+{
+	if ((!d_ogre_texture.isNull()) && !d_isLinked)
+	{
+		Ogre::TextureManager::getSingleton().remove(d_ogre_texture->getHandle());
+	}
+	d_ogre_texture.setNull();
+}
+
+
+/*************************************************************************
+	return a Ogre::string that contains a unique name.	
+*************************************************************************/
+Ogre::String OgreCEGUITexture::getUniqueName(void)
+{
+	Ogre::String str;
+
+#ifdef CEGUI_USEOLDOGRESTRING
+	str << "_cegui_ogre_" << d_texturenumber;
+#else
+	Ogre::StringUtil::StrStreamType strstream;
+	strstream << "_cegui_ogre_" << d_texturenumber;
+	str = strstream.str();
+#endif
+
+	++d_texturenumber;
+
+	return str;
+}
+
+
+/*************************************************************************
+	Set the internal Ogre::Texture object.
+*************************************************************************/
+void OgreCEGUITexture::setOgreTexture(Ogre::TexturePtr& texture)
+{
+	freeOgreTexture();
+
+	d_ogre_texture = texture;
+	d_width	 = d_ogre_texture->getWidth();
+	d_height = d_ogre_texture->getHeight();
+	d_isLinked = true;
+}
+
+
+} // End of  CEGUI namespace section
+
Index: /Samples/Common/Makefile.am
===================================================================
--- /Samples/Common/Makefile.am	(revision 5)
+++ /Samples/Common/Makefile.am	(revision 5)
@@ -0,0 +1,5 @@
+SUBDIRS = include bin
+
+if HAVE_CEGUI
+SUBDIRS += CEGUIRenderer
+endif
Index: /Samples/Common/Makefile.in
===================================================================
--- /Samples/Common/Makefile.in	(revision 5)
+++ /Samples/Common/Makefile.in	(revision 5)
@@ -0,0 +1,545 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+@HAVE_CEGUI_TRUE@am__append_1 = CEGUIRenderer
+subdir = Samples/Common
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = include bin CEGUIRenderer
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = include bin $(am__append_1)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Common/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Common/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Common/bin/Debug/.keepme
===================================================================
--- /Samples/Common/bin/Debug/.keepme	(revision 5)
+++ /Samples/Common/bin/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Common/bin/Debug/Plugins.cfg
===================================================================
--- /Samples/Common/bin/Debug/Plugins.cfg	(revision 5)
+++ /Samples/Common/bin/Debug/Plugins.cfg	(revision 5)
@@ -0,0 +1,14 @@
+# Defines plugins to load
+
+# Define plugin folder
+PluginFolder=.
+
+# Define plugins
+Plugin=RenderSystem_Direct3D9_d
+Plugin=RenderSystem_GL_d
+Plugin=Plugin_ParticleFX_d
+Plugin=Plugin_BSPSceneManager_d
+Plugin=Plugin_OctreeSceneManager_d
+Plugin=Plugin_CgProgramManager_d
+
+
Index: /Samples/Common/bin/Debug/media.cfg
===================================================================
--- /Samples/Common/bin/Debug/media.cfg	(revision 5)
+++ /Samples/Common/bin/Debug/media.cfg	(revision 5)
@@ -0,0 +1,16 @@
+Mesh=ogrehead.mesh
+Mesh=geosphere4500.mesh
+Mesh=razor.mesh
+Mesh=knot.mesh
+Mesh=RZR-002.mesh
+Mesh=geosphere8000.mesh
+Mesh=sphere.mesh
+
+CubeMap=cubescene.jpg
+CubeMap=early_morning.jpg
+CubeMap=cubemap.jpg
+CubeMap=morning.jpg
+CubeMap=cloudy_noon.jpg
+CubeMap=evening.jpg
+CubeMap=stormy.jpg
+CubeMap=stevecube.jpg
Index: /Samples/Common/bin/Debug/quake3settings.cfg
===================================================================
--- /Samples/Common/bin/Debug/quake3settings.cfg	(revision 5)
+++ /Samples/Common/bin/Debug/quake3settings.cfg	(revision 5)
@@ -0,0 +1,2 @@
+Pak0Location: f:\quake3arena\baseq3\pak0.pk3
+Map: maps/q3dm3.bsp
Index: /Samples/Common/bin/Debug/resources.cfg
===================================================================
--- /Samples/Common/bin/Debug/resources.cfg	(revision 5)
+++ /Samples/Common/bin/Debug/resources.cfg	(revision 5)
@@ -0,0 +1,23 @@
+# Resource locations to be added to the 'boostrap' path
+# This also contains the minimum you need to use the Ogre example framework
+[Bootstrap]
+Zip=../../../Media/packs/OgreCore.zip
+
+# Resource locations to be added to the default path
+[General]
+FileSystem=../../../Media
+FileSystem=../../../Media/fonts
+FileSystem=../../../Media/materials/programs
+FileSystem=../../../Media/materials/scripts
+FileSystem=../../../Media/materials/textures
+FileSystem=../../../Media/models
+FileSystem=../../../Media/overlays
+FileSystem=../../../Media/particle
+FileSystem=../../../Media/gui
+FileSystem=../../../Media/DeferredShadingMedia
+Zip=../../../Media/packs/cubemap.zip
+Zip=../../../Media/packs/cubemapsJS.zip
+Zip=../../../Media/packs/dragon.zip
+Zip=../../../Media/packs/fresneldemo.zip
+Zip=../../../Media/packs/ogretestmap.zip
+Zip=../../../Media/packs/skybox.zip
Index: /Samples/Common/bin/Makefile.am
===================================================================
--- /Samples/Common/bin/Makefile.am	(revision 5)
+++ /Samples/Common/bin/Makefile.am	(revision 5)
@@ -0,0 +1,13 @@
+edit = sed \
+	-e 's,@OGRE_PLUGINDIR\@,$(libdir)/$(PACKAGE),g' \
+	-e 's,@OGRE_MEDIADIR\@,$(top_srcdir)/Samples/Media,g'
+
+CONFIGS = plugins.cfg resources.cfg
+
+install-data-local:
+	-$(INSTALL_DATA) $(srcdir)/*.cfg . && \
+	for i in ${CONFIGS} ; do \
+		$(edit) $(srcdir)/$$i.in > $$i.tmp && \
+		$(INSTALL_DATA) $$i.tmp $$i && \
+		rm -f $$i.tmp; \
+	done
Index: /Samples/Common/bin/Makefile.in
===================================================================
--- /Samples/Common/bin/Makefile.in	(revision 5)
+++ /Samples/Common/bin/Makefile.in	(revision 5)
@@ -0,0 +1,399 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Common/bin
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+edit = sed \
+	-e 's,@OGRE_PLUGINDIR\@,$(libdir)/$(PACKAGE),g' \
+	-e 's,@OGRE_MEDIADIR\@,$(top_srcdir)/Samples/Media,g'
+
+CONFIGS = plugins.cfg resources.cfg
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Common/bin/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Common/bin/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	distclean distclean-generic distclean-libtool distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-data-local install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	uninstall uninstall-am uninstall-info-am
+
+
+install-data-local:
+	-$(INSTALL_DATA) $(srcdir)/*.cfg . && \
+	for i in ${CONFIGS} ; do \
+		$(edit) $(srcdir)/$$i.in > $$i.tmp && \
+		$(INSTALL_DATA) $$i.tmp $$i && \
+		rm -f $$i.tmp; \
+	done
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Common/bin/Release/.keepme
===================================================================
--- /Samples/Common/bin/Release/.keepme	(revision 5)
+++ /Samples/Common/bin/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Common/bin/Release/Plugins.cfg
===================================================================
--- /Samples/Common/bin/Release/Plugins.cfg	(revision 5)
+++ /Samples/Common/bin/Release/Plugins.cfg	(revision 5)
@@ -0,0 +1,14 @@
+# Defines plugins to load
+
+# Define plugin folder
+PluginFolder=.
+
+# Define plugins
+Plugin=RenderSystem_Direct3D9
+Plugin=RenderSystem_GL
+Plugin=Plugin_ParticleFX
+Plugin=Plugin_BSPSceneManager
+Plugin=Plugin_OctreeSceneManager
+Plugin=Plugin_CgProgramManager
+
+
Index: /Samples/Common/bin/Release/media.cfg
===================================================================
--- /Samples/Common/bin/Release/media.cfg	(revision 5)
+++ /Samples/Common/bin/Release/media.cfg	(revision 5)
@@ -0,0 +1,16 @@
+Mesh=ogrehead.mesh
+Mesh=geosphere4500.mesh
+Mesh=razor.mesh
+Mesh=knot.mesh
+Mesh=RZR-002.mesh
+Mesh=geosphere8000.mesh
+Mesh=sphere.mesh
+
+CubeMap=cubescene.jpg
+CubeMap=early_morning.jpg
+CubeMap=cubemap.jpg
+CubeMap=morning.jpg
+CubeMap=cloudy_noon.jpg
+CubeMap=evening.jpg
+CubeMap=stormy.jpg
+CubeMap=stevecube.jpg
Index: /Samples/Common/bin/Release/quake3settings.cfg
===================================================================
--- /Samples/Common/bin/Release/quake3settings.cfg	(revision 5)
+++ /Samples/Common/bin/Release/quake3settings.cfg	(revision 5)
@@ -0,0 +1,3 @@
+Pak0Location: f:\quake3levels\chiropteraDM.pk3
+Map: maps/chiropteradm.bsp
+
Index: /Samples/Common/bin/Release/resources.cfg
===================================================================
--- /Samples/Common/bin/Release/resources.cfg	(revision 5)
+++ /Samples/Common/bin/Release/resources.cfg	(revision 5)
@@ -0,0 +1,23 @@
+# Resource locations to be added to the 'boostrap' path
+# This also contains the minimum you need to use the Ogre example framework
+[Bootstrap]
+Zip=../../../Media/packs/OgreCore.zip
+
+# Resource locations to be added to the default path
+[General]
+FileSystem=../../../Media
+FileSystem=../../../Media/fonts
+FileSystem=../../../Media/materials/programs
+FileSystem=../../../Media/materials/scripts
+FileSystem=../../../Media/materials/textures
+FileSystem=../../../Media/models
+FileSystem=../../../Media/overlays
+FileSystem=../../../Media/particle
+FileSystem=../../../Media/gui
+FileSystem=../../../Media/DeferredShadingMedia
+Zip=../../../Media/packs/cubemap.zip
+Zip=../../../Media/packs/cubemapsJS.zip
+Zip=../../../Media/packs/dragon.zip
+Zip=../../../Media/packs/fresneldemo.zip
+Zip=../../../Media/packs/ogretestmap.zip
+Zip=../../../Media/packs/skybox.zip
Index: /Samples/Common/bin/media.cfg
===================================================================
--- /Samples/Common/bin/media.cfg	(revision 5)
+++ /Samples/Common/bin/media.cfg	(revision 5)
@@ -0,0 +1,16 @@
+Mesh=ogrehead.mesh
+Mesh=geosphere4500.mesh
+Mesh=razor.mesh
+Mesh=knot.mesh
+Mesh=RZR-002.mesh
+Mesh=geosphere8000.mesh
+Mesh=sphere.mesh
+
+CubeMap=cubescene.jpg
+CubeMap=early_morning.jpg
+CubeMap=cubemap.jpg
+CubeMap=morning.jpg
+CubeMap=cloudy_noon.jpg
+CubeMap=evening.jpg
+CubeMap=stormy.jpg
+CubeMap=stevecube.jpg
Index: /Samples/Common/bin/plugins.cfg
===================================================================
--- /Samples/Common/bin/plugins.cfg	(revision 5)
+++ /Samples/Common/bin/plugins.cfg	(revision 5)
@@ -0,0 +1,12 @@
+# Defines plugins to load
+
+# Define plugin folder
+PluginFolder=/usr/local/lib/OGRE
+
+# Define D3D rendering implementation plugin
+Plugin=RenderSystem_GL.so
+Plugin=Plugin_ParticleFX.so
+Plugin=Plugin_BSPSceneManager.so
+Plugin=Plugin_OctreeSceneManager.so
+Plugin=Plugin_CgProgramManager.so
+
Index: /Samples/Common/bin/plugins.cfg.in
===================================================================
--- /Samples/Common/bin/plugins.cfg.in	(revision 5)
+++ /Samples/Common/bin/plugins.cfg.in	(revision 5)
@@ -0,0 +1,12 @@
+# Defines plugins to load
+
+# Define plugin folder
+PluginFolder=@OGRE_PLUGINDIR@
+
+# Define D3D rendering implementation plugin
+Plugin=RenderSystem_GL.so
+Plugin=Plugin_ParticleFX.so
+Plugin=Plugin_BSPSceneManager.so
+Plugin=Plugin_OctreeSceneManager.so
+Plugin=Plugin_CgProgramManager.so
+
Index: /Samples/Common/bin/quake3settings.cfg
===================================================================
--- /Samples/Common/bin/quake3settings.cfg	(revision 5)
+++ /Samples/Common/bin/quake3settings.cfg	(revision 5)
@@ -0,0 +1,2 @@
+Pak0Location: /usr/local/games/quake3/baseq3/pak0.pk3
+Map: maps/q3dm3.bsp
Index: /Samples/Common/bin/resources.cfg
===================================================================
--- /Samples/Common/bin/resources.cfg	(revision 5)
+++ /Samples/Common/bin/resources.cfg	(revision 5)
@@ -0,0 +1,23 @@
+# Resource locations to be added to the 'boostrap' path
+# This also contains the minimum you need to use the Ogre example framework
+[Bootstrap]
+Zip=../../Media/packs/OgreCore.zip
+
+# Resource locations to be added to the default path
+[General]
+FileSystem=../../Media
+FileSystem=../../Media/fonts
+FileSystem=../../Media/materials/programs
+FileSystem=../../Media/materials/scripts
+FileSystem=../../Media/materials/textures
+FileSystem=../../Media/models
+FileSystem=../../Media/overlays
+FileSystem=../../Media/particle
+FileSystem=../../Media/gui
+FileSystem=../../Media/DeferredShadingMedia
+Zip=../../Media/packs/cubemap.zip
+Zip=../../Media/packs/cubemapsJS.zip
+Zip=../../Media/packs/dragon.zip
+Zip=../../Media/packs/fresneldemo.zip
+Zip=../../Media/packs/ogretestmap.zip
+Zip=../../Media/packs/skybox.zip
Index: /Samples/Common/bin/resources.cfg.in
===================================================================
--- /Samples/Common/bin/resources.cfg.in	(revision 5)
+++ /Samples/Common/bin/resources.cfg.in	(revision 5)
@@ -0,0 +1,22 @@
+# Resource locations to be added to the 'boostrap' path
+# This also contains the minimum you need to use the Ogre example framework
+[Bootstrap]
+Zip=@OGRE_MEDIADIR@/packs/OgreCore.zip
+
+# Resource locations to be added to the default path
+[General]
+FileSystem=@OGRE_MEDIADIR@
+FileSystem=@OGRE_MEDIADIR@/fonts
+FileSystem=@OGRE_MEDIADIR@/materials/programs
+FileSystem=@OGRE_MEDIADIR@/materials/scripts
+FileSystem=@OGRE_MEDIADIR@/materials/textures
+FileSystem=@OGRE_MEDIADIR@/models
+FileSystem=@OGRE_MEDIADIR@/overlays
+FileSystem=@OGRE_MEDIADIR@/particle
+FileSystem=@OGRE_MEDIADIR@/gui
+Zip=@OGRE_MEDIADIR@/packs/cubemap.zip
+Zip=@OGRE_MEDIADIR@/packs/cubemapsJS.zip
+Zip=@OGRE_MEDIADIR@/packs/dragon.zip
+Zip=@OGRE_MEDIADIR@/packs/fresneldemo.zip
+Zip=@OGRE_MEDIADIR@/packs/ogretestmap.zip
+Zip=@OGRE_MEDIADIR@/packs/skybox.zip
Index: /Samples/Common/include/ExampleApplication.h
===================================================================
--- /Samples/Common/include/ExampleApplication.h	(revision 5)
+++ /Samples/Common/include/ExampleApplication.h	(revision 5)
@@ -0,0 +1,257 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+/*
+-----------------------------------------------------------------------------
+Filename:    ExampleApplication.h
+Description: Base class for all the OGRE examples
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __ExampleApplication_H__
+#define __ExampleApplication_H__
+
+#include "Ogre.h"
+#include "OgreConfigFile.h"
+#include "ExampleFrameListener.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#include <CoreFoundation/CoreFoundation.h>
+
+// This function will locate the path to our application on OS X,
+// unlike windows you can not rely on the curent working directory
+// for locating your configuration files and resources.
+std::string macBundlePath()
+{
+    char path[1024];
+    CFBundleRef mainBundle = CFBundleGetMainBundle();
+    assert(mainBundle);
+
+    CFURLRef mainBundleURL = CFBundleCopyBundleURL(mainBundle);
+    assert(mainBundleURL);
+
+    CFStringRef cfStringRef = CFURLCopyFileSystemPath( mainBundleURL, kCFURLPOSIXPathStyle);
+    assert(cfStringRef);
+
+    CFStringGetCString(cfStringRef, path, 1024, kCFStringEncodingASCII);
+
+    CFRelease(mainBundleURL);
+    CFRelease(cfStringRef);
+
+    return std::string(path);
+}
+#endif
+
+using namespace Ogre;
+
+/** Base class which manages the standard startup of an Ogre application.
+    Designed to be subclassed for specific examples if required.
+*/
+class ExampleApplication
+{
+public:
+    /// Standard constructor
+    ExampleApplication()
+    {
+        mFrameListener = 0;
+        mRoot = 0;
+		// Provide a nice cross platform solution for locating the configuration files
+		// On windows files are searched for in the current working directory, on OS X however
+		// you must provide the full path, the helper function macBundlePath does this for us.
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+		mResourcePath = macBundlePath() + "/Contents/Resources/";
+#else
+		mResourcePath = "";
+#endif
+    }
+    /// Standard destructor
+    virtual ~ExampleApplication()
+    {
+        if (mFrameListener)
+            delete mFrameListener;
+        if (mRoot)
+            delete mRoot;
+    }
+
+    /// Start the example
+    virtual void go(void)
+    {
+        if (!setup())
+            return;
+
+        mRoot->startRendering();
+
+        // clean up
+        destroyScene();
+    }
+
+protected:
+    Root *mRoot;
+    Camera* mCamera;
+    SceneManager* mSceneMgr;
+    ExampleFrameListener* mFrameListener;
+    RenderWindow* mWindow;
+	Ogre::String mResourcePath;
+
+    // These internal methods package up the stages in the startup process
+    /** Sets up the application - returns false if the user chooses to abandon configuration. */
+    virtual bool setup(void)
+    {
+
+		String pluginsPath;
+		// only use plugins.cfg if not static
+#ifndef OGRE_STATIC_LIB
+		pluginsPath = mResourcePath + "plugins.cfg";
+#endif
+		
+        mRoot = new Root(pluginsPath, 
+            mResourcePath + "ogre.cfg", mResourcePath + "Ogre.log");
+
+        setupResources();
+
+        bool carryOn = configure();
+        if (!carryOn) return false;
+
+        chooseSceneManager();
+        createCamera();
+        createViewports();
+
+        // Set default mipmap level (NB some APIs ignore this)
+        TextureManager::getSingleton().setDefaultNumMipmaps(5);
+
+		// Create any resource listeners (for loading screens)
+		createResourceListener();
+		// Load resources
+		loadResources();
+
+		// Create the scene
+        createScene();
+
+        createFrameListener();
+
+        return true;
+
+    }
+    /** Configures the application - returns false if the user chooses to abandon configuration. */
+    virtual bool configure(void)
+    {
+        // Show the configuration dialog and initialise the system
+        // You can skip this and use root.restoreConfig() to load configuration
+        // settings if you were sure there are valid ones saved in ogre.cfg
+        if(mRoot->showConfigDialog())
+        {
+            // If returned true, user clicked OK so initialise
+            // Here we choose to let the system create a default rendering window by passing 'true'
+            mWindow = mRoot->initialise(true);
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+    virtual void chooseSceneManager(void)
+    {
+        // Create the SceneManager, in this case a generic one
+        mSceneMgr = mRoot->createSceneManager(ST_GENERIC, "ExampleSMInstance");
+    }
+    virtual void createCamera(void)
+    {
+        // Create the camera
+        mCamera = mSceneMgr->createCamera("PlayerCam");
+
+        // Position it at 500 in Z direction
+        mCamera->setPosition(Vector3(0,0,500));
+        // Look back along -Z
+        mCamera->lookAt(Vector3(0,0,-300));
+        mCamera->setNearClipDistance(5);
+
+    }
+    virtual void createFrameListener(void)
+    {
+        mFrameListener= new ExampleFrameListener(mWindow, mCamera);
+        mFrameListener->showDebugOverlay(true);
+        mRoot->addFrameListener(mFrameListener);
+    }
+
+    virtual void createScene(void) = 0;    // pure virtual - this has to be overridden
+
+    virtual void destroyScene(void){}    // Optional to override this
+
+    virtual void createViewports(void)
+    {
+        // Create one viewport, entire window
+        Viewport* vp = mWindow->addViewport(mCamera);
+        vp->setBackgroundColour(ColourValue(0,0,0));
+
+        // Alter the camera aspect ratio to match the viewport
+        mCamera->setAspectRatio(
+            Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
+    }
+
+    /// Method which will define the source of resources (other than current folder)
+    virtual void setupResources(void)
+    {
+        // Load resource paths from config file
+        ConfigFile cf;
+        cf.load(mResourcePath + "resources.cfg");
+
+        // Go through all sections & settings in the file
+        ConfigFile::SectionIterator seci = cf.getSectionIterator();
+
+        String secName, typeName, archName;
+        while (seci.hasMoreElements())
+        {
+            secName = seci.peekNextKey();
+            ConfigFile::SettingsMultiMap *settings = seci.getNext();
+            ConfigFile::SettingsMultiMap::iterator i;
+            for (i = settings->begin(); i != settings->end(); ++i)
+            {
+                typeName = i->first;
+                archName = i->second;
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+                // OS X does not set the working directory relative to the app,
+                // In order to make things portable on OS X we need to provide
+                // the loading with it's own bundle path location
+                ResourceGroupManager::getSingleton().addResourceLocation(
+                    String(macBundlePath() + "/" + archName), typeName, secName);
+#else
+                ResourceGroupManager::getSingleton().addResourceLocation(
+                    archName, typeName, secName);
+#endif
+            }
+        }
+    }
+
+	/// Optional override method where you can create resource listeners (e.g. for loading screens)
+	virtual void createResourceListener(void)
+	{
+
+	}
+
+	/// Optional override method where you can perform resource group loading
+	/// Must at least do ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+	virtual void loadResources(void)
+	{
+		// Initialise, parse scripts etc
+		ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+
+	}
+
+
+
+};
+
+
+#endif
Index: /Samples/Common/include/ExampleFrameListener.h
===================================================================
--- /Samples/Common/include/ExampleFrameListener.h	(revision 5)
+++ /Samples/Common/include/ExampleFrameListener.h	(revision 5)
@@ -0,0 +1,401 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+/*
+-----------------------------------------------------------------------------
+Filename:    ExampleFrameListener.h
+Description: Defines an example frame listener which responds to frame events.
+This frame listener just moves a specified camera around based on
+keyboard and mouse movements.
+Mouse:    Freelook
+W or Up:  Forward
+S or Down:Backward
+A:        Step left
+D:        Step right
+             PgUp:     Move upwards
+             PgDown:   Move downwards
+             F:        Toggle frame rate stats on/off
+			 R:        Render mode
+             T:        Cycle texture filtering
+                       Bilinear, Trilinear, Anisotropic(8)
+             P:        Toggle on/off display of camera position / orientation
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __ExampleFrameListener_H__
+#define __ExampleFrameListener_H__
+
+#include "Ogre.h"
+#include "OgreStringConverter.h"
+#include "OgreException.h"
+
+//Use this define to signify OIS will be used as a DLL
+//(so that dll import/export macros are in effect)
+#define OIS_DYNAMIC_LIB
+#include <OIS/OIS.h>
+
+using namespace Ogre;
+
+class ExampleFrameListener: public FrameListener, public WindowEventListener
+{
+protected:
+	void updateStats(void)
+	{
+		static String currFps = "Current FPS: ";
+		static String avgFps = "Average FPS: ";
+		static String bestFps = "Best FPS: ";
+		static String worstFps = "Worst FPS: ";
+		static String tris = "Triangle Count: ";
+		static String batches = "Batch Count: ";
+
+		// update stats when necessary
+		try {
+			OverlayElement* guiAvg = OverlayManager::getSingleton().getOverlayElement("Core/AverageFps");
+			OverlayElement* guiCurr = OverlayManager::getSingleton().getOverlayElement("Core/CurrFps");
+			OverlayElement* guiBest = OverlayManager::getSingleton().getOverlayElement("Core/BestFps");
+			OverlayElement* guiWorst = OverlayManager::getSingleton().getOverlayElement("Core/WorstFps");
+
+			const RenderTarget::FrameStats& stats = mWindow->getStatistics();
+			guiAvg->setCaption(avgFps + StringConverter::toString(stats.avgFPS));
+			guiCurr->setCaption(currFps + StringConverter::toString(stats.lastFPS));
+			guiBest->setCaption(bestFps + StringConverter::toString(stats.bestFPS)
+				+" "+StringConverter::toString(stats.bestFrameTime)+" ms");
+			guiWorst->setCaption(worstFps + StringConverter::toString(stats.worstFPS)
+				+" "+StringConverter::toString(stats.worstFrameTime)+" ms");
+
+			OverlayElement* guiTris = OverlayManager::getSingleton().getOverlayElement("Core/NumTris");
+			guiTris->setCaption(tris + StringConverter::toString(stats.triangleCount));
+
+			OverlayElement* guiBatches = OverlayManager::getSingleton().getOverlayElement("Core/NumBatches");
+			guiBatches->setCaption(batches + StringConverter::toString(stats.batchCount));
+
+			OverlayElement* guiDbg = OverlayManager::getSingleton().getOverlayElement("Core/DebugText");
+			guiDbg->setCaption(mDebugText);
+		}
+		catch(...) { /* ignore */ }
+	}
+
+public:
+	// Constructor takes a RenderWindow because it uses that to determine input context
+	ExampleFrameListener(RenderWindow* win, Camera* cam, bool bufferedKeys = false, bool bufferedMouse = false,
+			     bool bufferedJoy = false ) :
+		mCamera(cam), mTranslateVector(Vector3::ZERO), mWindow(win), mStatsOn(true), mNumScreenShots(0),
+		mMoveScale(0.0f), mRotScale(0.0f), mTimeUntilNextToggle(0), mFiltering(TFO_BILINEAR),
+		mAniso(1), mSceneDetailIndex(0), mMoveSpeed(100), mRotateSpeed(36), mDebugOverlay(0),
+		mInputManager(0), mMouse(0), mKeyboard(0), mJoy(0)
+	{
+		using namespace OIS;
+
+		mDebugOverlay = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
+
+		LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
+		ParamList pl;
+		size_t windowHnd = 0;
+		std::ostringstream windowHndStr;
+
+		win->getCustomAttribute("WINDOW", &windowHnd);
+		windowHndStr << windowHnd;
+		pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
+
+		mInputManager = InputManager::createInputSystem( pl );
+
+		//Create all devices (We only catch joystick exceptions here, as, most people have Key/Mouse)
+		mKeyboard = static_cast<Keyboard*>(mInputManager->createInputObject( OISKeyboard, bufferedKeys ));
+		mMouse = static_cast<Mouse*>(mInputManager->createInputObject( OISMouse, bufferedMouse ));
+		try {
+			mJoy = static_cast<JoyStick*>(mInputManager->createInputObject( OISJoyStick, bufferedJoy ));
+		}
+		catch(...) {
+			mJoy = 0;
+		}
+
+		//Set initial mouse clipping size
+		windowResized(mWindow);
+
+		showDebugOverlay(true);
+
+		//Register as a Window listener
+		WindowEventUtilities::addWindowEventListener(mWindow, this);
+	}
+
+	//Adjust mouse clipping area
+	virtual void windowResized(RenderWindow* rw)
+	{
+		unsigned int width, height, depth;
+		int left, top;
+		rw->getMetrics(width, height, depth, left, top);
+
+		const OIS::MouseState &ms = mMouse->getMouseState();
+		ms.width = width;
+		ms.height = height;
+	}
+
+	//Unattach OIS before window shutdown (very important under Linux)
+	virtual void windowClosed(RenderWindow* rw)
+	{
+		//Only close for window that created OIS (the main window in these demos)
+		if( rw == mWindow )
+		{
+			if( mInputManager )
+			{
+				mInputManager->destroyInputObject( mMouse );
+				mInputManager->destroyInputObject( mKeyboard );
+				mInputManager->destroyInputObject( mJoy );
+
+				OIS::InputManager::destroyInputSystem(mInputManager);
+				mInputManager = 0;
+			}
+		}
+	}
+
+	virtual ~ExampleFrameListener()
+	{
+		//Remove ourself as a Window listener
+		WindowEventUtilities::removeWindowEventListener(mWindow, this);
+		windowClosed(mWindow);
+	}
+
+	virtual bool processUnbufferedKeyInput(const FrameEvent& evt)
+	{
+		using namespace OIS;
+
+		if(mKeyboard->isKeyDown(KC_A))
+			mTranslateVector.x = -mMoveScale;	// Move camera left
+
+		if(mKeyboard->isKeyDown(KC_D))
+			mTranslateVector.x = mMoveScale;	// Move camera RIGHT
+
+		if(mKeyboard->isKeyDown(KC_UP) || mKeyboard->isKeyDown(KC_W) )
+			mTranslateVector.z = -mMoveScale;	// Move camera forward
+
+		if(mKeyboard->isKeyDown(KC_DOWN) || mKeyboard->isKeyDown(KC_S) )
+			mTranslateVector.z = mMoveScale;	// Move camera backward
+
+		if(mKeyboard->isKeyDown(KC_PGUP))
+			mTranslateVector.y = mMoveScale;	// Move camera up
+
+		if(mKeyboard->isKeyDown(KC_PGDOWN))
+			mTranslateVector.y = -mMoveScale;	// Move camera down
+
+		if(mKeyboard->isKeyDown(KC_RIGHT))
+			mCamera->yaw(-mRotScale);
+
+		if(mKeyboard->isKeyDown(KC_LEFT))
+			mCamera->yaw(mRotScale);
+
+		if( mKeyboard->isKeyDown(KC_ESCAPE) || mKeyboard->isKeyDown(KC_Q) )
+			return false;
+
+       	if( mKeyboard->isKeyDown(KC_F) && mTimeUntilNextToggle <= 0 )
+		{
+			mStatsOn = !mStatsOn;
+			showDebugOverlay(mStatsOn);
+			mTimeUntilNextToggle = 1;
+		}
+
+		if( mKeyboard->isKeyDown(KC_T) && mTimeUntilNextToggle <= 0 )
+		{
+			switch(mFiltering)
+			{
+			case TFO_BILINEAR:
+				mFiltering = TFO_TRILINEAR;
+				mAniso = 1;
+				break;
+			case TFO_TRILINEAR:
+				mFiltering = TFO_ANISOTROPIC;
+				mAniso = 8;
+				break;
+			case TFO_ANISOTROPIC:
+				mFiltering = TFO_BILINEAR;
+				mAniso = 1;
+				break;
+			default: break;
+			}
+			MaterialManager::getSingleton().setDefaultTextureFiltering(mFiltering);
+			MaterialManager::getSingleton().setDefaultAnisotropy(mAniso);
+
+			showDebugOverlay(mStatsOn);
+			mTimeUntilNextToggle = 1;
+		}
+
+		if(mKeyboard->isKeyDown(KC_SYSRQ) && mTimeUntilNextToggle <= 0)
+		{
+			std::ostringstream ss;
+			ss << "screenshot_" << ++mNumScreenShots << ".png";
+			mWindow->writeContentsToFile(ss.str());
+			mTimeUntilNextToggle = 0.5;
+			mDebugText = "Saved: " + ss.str();
+		}
+
+		if(mKeyboard->isKeyDown(KC_R) && mTimeUntilNextToggle <=0)
+		{
+			mSceneDetailIndex = (mSceneDetailIndex+1)%3 ;
+			switch(mSceneDetailIndex) {
+				case 0 : mCamera->setPolygonMode(PM_SOLID); break;
+				case 1 : mCamera->setPolygonMode(PM_WIREFRAME); break;
+				case 2 : mCamera->setPolygonMode(PM_POINTS); break;
+			}
+			mTimeUntilNextToggle = 0.5;
+		}
+
+		static bool displayCameraDetails = false;
+		if(mKeyboard->isKeyDown(KC_P) && mTimeUntilNextToggle <= 0)
+		{
+			displayCameraDetails = !displayCameraDetails;
+			mTimeUntilNextToggle = 0.5;
+			if (!displayCameraDetails)
+				mDebugText = "";
+		}
+
+		// Print camera details
+		if(displayCameraDetails)
+			mDebugText = "P: " + StringConverter::toString(mCamera->getDerivedPosition()) +
+						 " " + "O: " + StringConverter::toString(mCamera->getDerivedOrientation());
+
+		// Return true to continue rendering
+		return true;
+	}
+
+	bool processUnbufferedMouseInput(const FrameEvent& evt)
+	{
+		using namespace OIS;
+
+		// Rotation factors, may not be used if the second mouse button is pressed
+		// 2nd mouse button - slide, otherwise rotate
+		const MouseState &ms = mMouse->getMouseState();
+		if( ms.buttonDown( MB_Right ) )
+		{
+			mTranslateVector.x += ms.X.rel * 0.13;
+			mTranslateVector.y -= ms.Y.rel * 0.13;
+		}
+		else
+		{
+			mRotX = Degree(-ms.X.rel * 0.13);
+			mRotY = Degree(-ms.Y.rel * 0.13);
+		}
+
+		return true;
+	}
+
+	void moveCamera()
+	{
+		// Make all the changes to the camera
+		// Note that YAW direction is around a fixed axis (freelook style) rather than a natural YAW
+		//(e.g. airplane)
+		mCamera->yaw(mRotX);
+		mCamera->pitch(mRotY);
+		mCamera->moveRelative(mTranslateVector);
+	}
+
+	void showDebugOverlay(bool show)
+	{
+		if (mDebugOverlay)
+		{
+			if (show)
+				mDebugOverlay->show();
+			else
+				mDebugOverlay->hide();
+		}
+	}
+
+	// Override frameStarted event to process that (don't care about frameEnded)
+	bool frameStarted(const FrameEvent& evt)
+	{
+		using namespace OIS;
+
+		if(mWindow->isClosed())	return false;
+
+		//Need to capture/update each device
+		mKeyboard->capture();
+		mMouse->capture();
+		if( mJoy ) mJoy->capture();
+
+		bool buffJ = (mJoy) ? mJoy->buffered() : true;
+
+		//Check if one of the devices is not buffered
+		if( !mMouse->buffered() || !mKeyboard->buffered() || !buffJ )
+		{
+			// one of the input modes is immediate, so setup what is needed for immediate movement
+			if (mTimeUntilNextToggle >= 0)
+				mTimeUntilNextToggle -= evt.timeSinceLastFrame;
+
+			// If this is the first frame, pick a speed
+			if (evt.timeSinceLastFrame == 0)
+			{
+				mMoveScale = 1;
+				mRotScale = 0.1;
+			}
+			// Otherwise scale movement units by time passed since last frame
+			else
+			{
+				// Move about 100 units per second,
+				mMoveScale = mMoveSpeed * evt.timeSinceLastFrame;
+				// Take about 10 seconds for full rotation
+				mRotScale = mRotateSpeed * evt.timeSinceLastFrame;
+			}
+			mRotX = 0;
+			mRotY = 0;
+			mTranslateVector = Ogre::Vector3::ZERO;
+		}
+
+		//Check to see which device is not buffered, and handle it
+		if( !mKeyboard->buffered() )
+			if( processUnbufferedKeyInput(evt) == false )
+				return false;
+		if( !mMouse->buffered() )
+			if( processUnbufferedMouseInput(evt) == false )
+				return false;
+
+		if( !mMouse->buffered() || !mKeyboard->buffered() || !buffJ )
+			moveCamera();
+
+		return true;
+	}
+
+	bool frameEnded(const FrameEvent& evt)
+	{
+		updateStats();
+		return true;
+	}
+
+protected:
+	Camera* mCamera;
+
+	Vector3 mTranslateVector;
+	RenderWindow* mWindow;
+	bool mStatsOn;
+
+	std::string mDebugText;
+
+	unsigned int mNumScreenShots;
+	float mMoveScale;
+	Degree mRotScale;
+	// just to stop toggles flipping too fast
+	Real mTimeUntilNextToggle ;
+	Radian mRotX, mRotY;
+	TextureFilterOptions mFiltering;
+	int mAniso;
+
+	int mSceneDetailIndex ;
+	Real mMoveSpeed;
+	Degree mRotateSpeed;
+	Overlay* mDebugOverlay;
+
+	//OIS Input devices
+	OIS::InputManager* mInputManager;
+	OIS::Mouse*    mMouse;
+	OIS::Keyboard* mKeyboard;
+	OIS::JoyStick* mJoy;
+};
+
+#endif
Index: /Samples/Common/include/ExampleLoadingBar.h
===================================================================
--- /Samples/Common/include/ExampleLoadingBar.h	(revision 5)
+++ /Samples/Common/include/ExampleLoadingBar.h	(revision 5)
@@ -0,0 +1,182 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+/*
+-----------------------------------------------------------------------------
+Filename:    ExampleLoadingBar.h
+Description: Defines an example loading progress bar which you can use during 
+startup, level changes etc to display loading progress. 
+IMPORTANT: Note that this progress bar relies on you having the OgreCore.zip 
+package already added to a resource group called 'Bootstrap' - this provides
+the basic resources required for the progress bar and will be loaded automatically.
+*/
+#include "OgreResourceGroupManager.h"
+#include "OgreException.h"
+#include "OgreOverlay.h"
+#include "OgreOverlayManager.h"
+#include "OgreRenderWindow.h"
+
+using namespace Ogre;
+
+/** Defines an example loading progress bar which you can use during 
+	startup, level changes etc to display loading progress. 
+@remarks
+	Basically you just need to create an instance of this class, call start()
+	before loading and finish() afterwards. You may also need to stop areas of
+	your scene rendering in between since this method will call 
+	RenderWindow::update() to update the display of the bar - we advise using
+	SceneManager's 'special case render queues' for this, see
+	SceneManager::addSpecialCaseRenderQueue for details.
+@note 
+	This progress bar relies on you having the OgreCore.zip package already 
+	added to a resource group called 'Bootstrap' - this provides the basic 
+	resources required for the progress bar and will be loaded automatically.
+*/
+class ExampleLoadingBar : public ResourceGroupListener
+{
+protected:
+	RenderWindow* mWindow;
+	Overlay* mLoadOverlay;
+	Real mInitProportion;
+	unsigned short mNumGroupsInit;
+	unsigned short mNumGroupsLoad;
+	Real mProgressBarMaxSize;
+	Real mProgressBarScriptSize;
+	Real mProgressBarInc;
+	OverlayElement* mLoadingBarElement;
+	OverlayElement* mLoadingDescriptionElement;
+	OverlayElement* mLoadingCommentElement;
+
+public:
+	ExampleLoadingBar() {}
+	virtual ~ExampleLoadingBar(){}
+
+	/** Show the loading bar and start listening.
+	@param window The window to update 
+	@param numGroupsInit The number of groups you're going to be initialising
+	@param numGroupsLoad The number of groups you're going to be loading
+	@param initProportion The proportion of the progress which will be taken
+		up by initialisation (ie script parsing etc). Defaults to 0.7 since
+		script parsing can often take the majority of the time.
+	*/
+	virtual void start(RenderWindow* window, 
+		unsigned short numGroupsInit = 1, 
+		unsigned short numGroupsLoad = 1, 
+		Real initProportion = 0.70f)
+	{
+		mWindow = window;
+		mNumGroupsInit = numGroupsInit;
+		mNumGroupsLoad = numGroupsLoad;
+		mInitProportion = initProportion;
+		// We need to pre-initialise the 'Bootstrap' group so we can use
+		// the basic contents in the loading screen
+		ResourceGroupManager::getSingleton().initialiseResourceGroup("Bootstrap");
+
+		OverlayManager& omgr = OverlayManager::getSingleton();
+		mLoadOverlay = (Overlay*)omgr.getByName("Core/LoadOverlay");
+		if (!mLoadOverlay)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Cannot find loading overlay", "ExampleLoadingBar::start");
+		}
+		mLoadOverlay->show();
+
+		// Save links to the bar and to the loading text, for updates as we go
+		mLoadingBarElement = omgr.getOverlayElement("Core/LoadPanel/Bar/Progress");
+		mLoadingCommentElement = omgr.getOverlayElement("Core/LoadPanel/Comment");
+		mLoadingDescriptionElement = omgr.getOverlayElement("Core/LoadPanel/Description");
+
+		OverlayElement* barContainer = omgr.getOverlayElement("Core/LoadPanel/Bar");
+		mProgressBarMaxSize = barContainer->getWidth();
+		mLoadingBarElement->setWidth(0);
+
+		// self is listener
+		ResourceGroupManager::getSingleton().addResourceGroupListener(this);
+
+
+
+	}
+
+	/** Hide the loading bar and stop listening. 
+	*/
+	virtual void finish(void)
+	{
+		// hide loading screen
+		mLoadOverlay->hide();
+
+		// Unregister listener
+		ResourceGroupManager::getSingleton().removeResourceGroupListener(this);
+
+	}
+
+
+	// ResourceGroupListener callbacks
+	void resourceGroupScriptingStarted(const String& groupName, size_t scriptCount)
+	{
+		assert(mNumGroupsInit > 0 && "You stated you were not going to init "
+			"any groups, but you did! Divide by zero would follow...");
+		// Lets assume script loading is 70%
+		mProgressBarInc = mProgressBarMaxSize * mInitProportion / (Real)scriptCount;
+		mProgressBarInc /= mNumGroupsInit;
+		mLoadingDescriptionElement->setCaption("Parsing scripts...");
+		mWindow->update();
+	}
+	void scriptParseStarted(const String& scriptName)
+	{
+		mLoadingCommentElement->setCaption(scriptName);
+		mWindow->update();
+	}
+	void scriptParseEnded(const String& scriptName)
+	{
+		mLoadingBarElement->setWidth(
+			mLoadingBarElement->getWidth() + mProgressBarInc);
+		mWindow->update();
+	}
+	void resourceGroupScriptingEnded(const String& groupName)
+	{
+	}
+	void resourceGroupLoadStarted(const String& groupName, size_t resourceCount)
+	{
+		assert(mNumGroupsLoad > 0 && "You stated you were not going to load "
+			"any groups, but you did! Divide by zero would follow...");
+		mProgressBarInc = mProgressBarMaxSize * (1-mInitProportion) / 
+			(Real)resourceCount;
+		mProgressBarInc /= mNumGroupsLoad;
+		mLoadingDescriptionElement->setCaption("Loading resources...");
+		mWindow->update();
+	}
+	void resourceLoadStarted(const ResourcePtr& resource)
+	{
+		mLoadingCommentElement->setCaption(resource->getName());
+		mWindow->update();
+	}
+	void resourceLoadEnded(void)
+	{
+	}
+	void worldGeometryStageStarted(const String& description)
+	{
+		mLoadingCommentElement->setCaption(description);
+		mWindow->update();
+	}
+	void worldGeometryStageEnded(void)
+	{
+		mLoadingBarElement->setWidth(
+			mLoadingBarElement->getWidth() + mProgressBarInc);
+		mWindow->update();
+	}
+	void resourceGroupLoadEnded(const String& groupName)
+	{
+	}
+
+};
+
Index: /Samples/Common/include/Makefile.am
===================================================================
--- /Samples/Common/include/Makefile.am	(revision 5)
+++ /Samples/Common/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = ExampleApplication.h ExampleFrameListener.h ExampleLoadingBar.h
Index: /Samples/Common/include/Makefile.in
===================================================================
--- /Samples/Common/include/Makefile.in	(revision 5)
+++ /Samples/Common/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Common/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = ExampleApplication.h ExampleFrameListener.h ExampleLoadingBar.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Common/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Common/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Common/misc/.keepme
===================================================================
--- /Samples/Common/misc/.keepme	(revision 5)
+++ /Samples/Common/misc/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Common/setup/build.bat
===================================================================
--- /Samples/Common/setup/build.bat	(revision 5)
+++ /Samples/Common/setup/build.bat	(revision 5)
@@ -0,0 +1,15 @@
+@echo off
+rem copy & tweak resources.cfg
+copy ..\bin\release\resources.cfg .\
+sed -i -e 's/\.\.\/\.\.\/\.\.\///' resources.cfg
+
+rem create quake3settings.cfg
+echo Pak0Location: Media\packs\chiropteraDM.pk3 > quake3settings.cfg
+echo Map: maps/chiropteradm.bsp >> quake3settings.cfg
+
+candle demos.wxs
+light -out OgreDemos.msi demos.wixobj %WIX_ROOT%\ui\wixui_featuretree.wixlib
+
+
+:end
+pause
Index: /Samples/Common/setup/demos.wxs
===================================================================
--- /Samples/Common/setup/demos.wxs	(revision 5)
+++ /Samples/Common/setup/demos.wxs	(revision 5)
@@ -0,0 +1,474 @@
+<?xml version='1.0' encoding='windows-1252'?>
+<Wix xmlns='http://schemas.microsoft.com/wix/2003/01/wi'>
+
+  <Product 
+	  Name='OGRE Demos 1.4.5' 
+		Id='B3483083-1A14-4250-B196-AB82DE686742'
+		Language='1033' Codepage='1252' 
+		Version='1.4.5' Manufacturer='OGRE Project'>
+
+    <Package Id='????????-????-????-????-????????????' Keywords='Installer'
+    Description="OGRE Demos Installer"
+    Comments='OGRE Demos' Manufacturer='OGRE Project'
+        InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
+
+    <Media Id='1' Cabinet='1.cab' EmbedCab='yes' DiskPrompt="CD 1" />
+    <Property Id='DiskPrompt' Value="OGRE Demos Installer [1]" />
+    <Directory Id='TARGETDIR' Name='SourceDir'>
+      <!-- VC runtimes -->
+      <Merge Id='CRT' Language='0' src='C:\Program Files\Common Files\Merge Modules\microsoft_vc80_crt_x86.msm' DiskId='1' />
+      <Merge Id='CRT Policy' Language='0' src='C:\Program Files\Common Files\Merge Modules\policy_8_0_Microsoft_VC80_CRT_x86.msm' DiskId='1' />
+      <Directory Id="ProgramFilesFolder" Name="PFiles">
+        <Directory Id='INSTALLDIR' Name='OgreDemo'>
+          <Component Id='OgreDemosComp' Guid='9C446B4F-F01E-4bd9-8411-8D4738E60A23'>
+            <File Id='OgreMainDLL' Name='OgreMain.dll' DiskId='1'
+              src='..\bin\release\OgreMain.dll' Vital='yes' />
+            <File Id='CEGUIBase' Name="CEBase.dll" LongName='CEGUIBase.dll' DiskId='1'
+              src='..\bin\release\CEGUIBase.dll' Vital='yes' />
+ 		  	<File Id='CEGuiExpat' Name="CEEBase.dll" LongName='CEGUIExpatParser.dll' DiskId='1'
+              src='..\bin\release\CEGUIExpatParser.dll' Vital='yes' />
+		  	<File Id='CEGUIFalagard' Name="CEFBase.dll" LongName='CEGUIFalagardWRBase.dll' DiskId='1'
+              src='..\bin\release\CEGUIFalagardWRBase.dll' Vital='yes' />
+            <File Id='Cg' Name="cg.dll" DiskId='1'
+              src='..\bin\release\cg.dll' Vital='yes' />
+            <File Id='OgreGuiRenderer' Name="OgreGuiR.dll" LongName='OgreGUIRenderer.dll' DiskId='1'
+              src='..\bin\release\OgreGUIRenderer.dll' Vital='yes' />
+            <File Id='BSPPlugin' Name="PlugBsp.dll" LongName='Plugin_BSPSceneManager.dll' DiskId='1'
+              src='..\bin\release\Plugin_BSPSceneManager.dll' Vital='yes' />
+            <File Id='CgPlugin' Name="PlugCg.dll" LongName='Plugin_CgProgramManager.dll' DiskId='1'
+              src='..\bin\release\Plugin_CgProgramManager.dll' Vital='yes' />
+            <File Id='OctreePlugin' Name="PlugOct.dll" LongName='Plugin_OctreeSceneManager.dll' DiskId='1'
+              src='..\bin\release\Plugin_OctreeSceneManager.dll' Vital='yes' />
+            <File Id='ParticleFXPlugin' Name="PlugFX.dll" LongName='Plugin_ParticleFX.dll' DiskId='1'
+              src='..\bin\release\Plugin_ParticleFX.dll' Vital='yes' />
+            <File Id='ReferenceAppLayer' Name="RefApp.dll" LongName='ReferenceAppLayer.dll' DiskId='1'
+              src='..\bin\release\ReferenceAppLayer.dll' Vital='yes' />
+            <File Id='D3D9' Name="RsD3D9.dll" LongName='RenderSystem_Direct3D9.dll' DiskId='1'
+              src='..\bin\release\RenderSystem_Direct3D9.dll' Vital='yes' />
+            <File Id='GL' Name="RsGL.dll" LongName='RenderSystem_GL.dll' DiskId='1'
+              src='..\bin\release\RenderSystem_GL.dll' Vital='yes' />
+		  <File Id='OIS' Name="OIS.dll" LongName='OIS.dll' DiskId='1'
+              src='..\bin\release\OIS.dll' Vital='yes' />
+
+
+            <File Id='Readme' Name="Readme.htm" LongName='Readme.html' DiskId='1'
+              src='..\..\Readme.html' Vital='yes'>
+              <Shortcut Id="ReadmeShortcut" Directory="DemosMenuDir" Name="Readme"/>
+            </File>
+            <File Id='Plugins.cfg' Name="Plugins.cfg" DiskId='1'
+              src='..\bin\release\plugins.cfg' Vital='yes' />
+            <File Id='media.cfg' Name="media.cfg" LongName="media.cfg" DiskId='1'
+              src='..\bin\release\media.cfg' Vital='yes' />
+            <!-- Following config files are tweaked locally -->
+            <File Id='resources.cfg' Name="res.cfg" LongName="resources.cfg" DiskId='1'
+              src='.\resources.cfg' Vital='yes' />
+            <File Id='quake3settings.cfg' Name="q3a.cfg" LongName="quake3settings.cfg" DiskId='1'
+              src='.\quake3settings.cfg' Vital='yes' />
+
+            <!-- Tallow generated & tweaked entries below -->
+
+            <File Id="file926" Name="DEMO_S_1.EXE" LongName="Demo_Shadows.exe" src="..\bin\release\Demo_Shadows.exe" DiskId='1'>
+              <Shortcut Id="ShadowsShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="Shadows"/>
+            </File>
+            <File Id="file927" Name="DEMO_D_1.EXE" LongName="Demo_DynTex.exe" src="..\bin\release\Demo_DynTex.exe" DiskId='1' >
+              <Shortcut Id="DynTexShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="DynTex" LongName="Dynamic Textures"/>
+            </File>
+            <File Id="file929" Name="DEMO_W_1.EXE" LongName="Demo_Water.exe" src="..\bin\release\Demo_Water.exe" DiskId='1' >
+              <Shortcut Id="WaterShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="Water" LongName="Water Simulation"/>
+            </File>
+            <File Id="file931" Name="DEMO_T_3.EXE" LongName="Demo_Terrain.exe" src="..\bin\release\Demo_Terrain.exe" DiskId='1' >
+              <Shortcut Id="TerrainShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="Terrain"/>
+            </File>
+            <File Id="file935" Name="Demo_Gui.exe" src="..\bin\release\Demo_Gui.exe" DiskId='1' >
+              <Shortcut Id="GuiShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="Gui"/>
+            </File>
+            <File Id="file936" Name="DEF79B_1.EXE" LongName="Demo_SkeletalAnimation.exe" src="..\bin\release\Demo_SkeletalAnimation.exe" DiskId='1' >
+              <Shortcut Id="SkeletalShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="SkelAnim" LongName="Skeletal Animation"/>
+            </File>
+            <File Id="file937" Name="DEMO_R_1.EXE" LongName="Demo_RenderToTexture.exe" src="..\bin\release\Demo_RenderToTexture.exe" DiskId='1' >
+              <Shortcut Id="RTTShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="RTT" LongName="Render To Reflection Texture"/>
+            </File>
+            <File Id="file938" Name="DEMO_P_1.EXE" LongName="Demo_ParticleFX.exe" src="..\bin\release\Demo_ParticleFX.exe" DiskId='1' >
+              <Shortcut Id="ParticleShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="Particle" LongName="Particle Effects"/>
+            </File>
+            <File Id="file939" Name="DEMO_L_1.EXE" LongName="Demo_Lighting.exe" src="..\bin\release\Demo_Lighting.exe" DiskId='1' >
+              <Shortcut Id="LightingShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="Lighting" LongName="Lighting and Ribbons"/>
+            </File>
+            <File Id="file940" Name="DEMO_F_1.EXE" LongName="Demo_Fresnel.exe" src="..\bin\release\Demo_Fresnel.exe" DiskId='1' >
+              <Shortcut Id="FresnelShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="Fresnel" LongName="Fresnel Reflections and Refractions"/>
+            </File>
+            <File Id="file942" Name="DEMO_D_2.EXE" LongName="Demo_Dot3Bump.exe" src="..\bin\release\Demo_Dot3Bump.exe" DiskId='1' >
+              <Shortcut Id="Dot3Shortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="Dot3Bump" LongName="Normal Mapping &amp; Offset Mapping"/>
+            </File>
+            <File Id="file943" Name="DEMO_C_1.EXE" LongName="Demo_CubeMapping.exe" src="..\bin\release\Demo_CubeMapping.exe" DiskId='1' >
+              <Shortcut Id="CubeMappingShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="CubeMap" LongName="Cube Mapping"/>
+            </File>
+            <File Id="file944" Name="DEMO_C_2.EXE" LongName="Demo_CelShading.exe" src="..\bin\release\Demo_CelShading.exe" DiskId='1' >
+              <Shortcut Id="CelShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="CelShad" LongName="Cel Shading"/>
+            </File>
+            <File Id="file945" Name="DEMO_C_3.EXE" LongName="Demo_CameraTrack.exe" src="..\bin\release\Demo_CameraTrack.exe" DiskId='1' >
+              <Shortcut Id="CameraTrackShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="CamTrack" LongName="Camera Tracks"/>
+            </File>
+            <File Id="file946" Name="Demo_BSP.exe" src="..\bin\release\Demo_BSP.exe" DiskId='1' >
+              <Shortcut Id="BSPShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="BSP" LongName="Quake3 Level Loading"/>
+            </File>
+            <File Id="file948" Name="DEMO_G_1.EXE" LongName="Demo_Grass.exe" src="..\bin\release\Demo_Grass.exe" DiskId='1' >
+              <Shortcut Id="GrassShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="Grass" LongName="Grass via StaticGeometry"/>
+            </File>
+            <File Id="file949" Name="DEMO_B_2.EXE" LongName="Demo_BspCollision.exe" src="..\bin\release\Demo_BspCollision.exe" DiskId='1' >
+              <Shortcut Id="BspCollisionShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="BspColl" LongName="Physics Integration"/>
+            </File>
+            <File Id="file950" Name="DEMO_F_2.EXE" LongName="Demo_FacialAnimation.exe" src="..\bin\release\Demo_FacialAnimation.exe" DiskId='1' >
+              <Shortcut Id="FacialShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="FaceAnim" LongName="Facial Animation"/>
+            </File>
+            <File Id="file951" Name="DEMO_C_4.EXE" LongName="Demo_Compositor.exe" src="..\bin\release\Demo_Compositor.exe" DiskId='1' >
+              <Shortcut Id="CompositorShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="Compostr" LongName="Compositor Effects"/>
+            </File>
+            <File Id="file953" Name="DEMO_V_1.EXE" LongName="Demo_VolumeTex.exe" src="..\bin\release\Demo_VolumeTex.exe" DiskId='1' >
+              <Shortcut Id="VolumeTexShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="VolTex" LongName="Volume (3D) Textures"/>
+            </File>
+            <File Id="file954" Name="DEMO_O_1.EXE" LongName="Demo_Ocean.exe" src="..\bin\release\Demo_Ocean.exe" DiskId='1' >
+              <Shortcut Id="OceanShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="Ocean" LongName="Ocean Shader Effects"/>
+            </File>
+            <File Id="crowddemo" Name="demcrowd.exe" LongName="Demo_Crowd.exe" src="..\bin\release\Demo_Crowd.exe" DiskId='1' >
+				<Shortcut Id="CrowdShortcut" Directory="DemosMenuDir" WorkingDirectory="INSTALLDIR" Name="Crowd" LongName="Crowd"/>
+            </File>
+
+          </Component>
+
+		  <Directory Id="directory0" Name="Media">
+            <Component Id="MediaComp" DiskId="1" Guid="DD9848F5-1B79-4be8-B866-0A38A373451C">
+              <File Id="file0" Name="terrain.cfg" src="..\..\Media\terrain.cfg" />
+            </Component>
+            <Directory Id="directory18" Name="fonts">
+			  <Component Id="MediaFontsComp" DiskId="1" Guid="40B9BEA8-31F4-41ef-915E-AD27F7FEF4B3">
+                <File Id="file114" Name="SAMPLE_1.FON" LongName="sample.fontdef" src="..\..\Media\fonts\sample.fontdef" />
+                <File Id="file115" Name="solo5.ttf" src="..\..\Media\fonts\solo5.ttf" />
+				<File Id="file116_" Name="bluebold.ttf" src="..\..\Media\fonts\bluebold.ttf" />
+				<File Id="file117_" Name="bluecond.ttf" src="..\..\Media\fonts\bluecond.ttf" />
+				<File Id="file118_" Name="bluehigh.ttf" src="..\..\Media\fonts\bluehigh.ttf" />
+				<File Id="file119_" Name="read_me.htm" LongName="read_me.html" src="..\..\Media\fonts\read_me.html" />
+              </Component>
+            </Directory>
+            <Directory Id="directory20" Name="gui">
+			  <Component Id="MediaGuiComp" DiskId="1" Guid="AF71EDA0-4DE9-418d-8207-71319DD49FE7">
+                <File Id="file123" Name="Falagard.xsd" src="..\..\Media\gui\Falagard.xsd" />
+                <File Id="file124" Name="Font.xsd" src="..\..\Media\gui\Font.xsd" />
+                <File Id="file125" Name="GUILAY_1.XSD" LongName="GUILayout.xsd" src="..\..\Media\gui\GUILayout.xsd" />
+                <File Id="file126" Name="GUISCH_1.XSD" LongName="GUIScheme.xsd" src="..\..\Media\gui\GUIScheme.xsd" />
+                <File Id="file127" Name="Imageset.xsd" src="..\..\Media\gui\Imageset.xsd" />
+                <File Id="file128" Name="OCEAND_1.CON" LongName="OceanDemoCegui.config" src="..\..\Media\gui\OceanDemoCegui.config" />
+                <File Id="file129" Name="OCEAND_1.XML" LongName="OceanDemoLayout.xml" src="..\..\Media\gui\OceanDemoLayout.xml" />
+                <File Id="file130" Name="TAHARE_1.IMA" LongName="TaharezLook.imageset" src="..\..\Media\gui\TaharezLook.imageset" />
+                <File Id="file131" Name="TAHARE_1.LOO" LongName="TaharezLook.looknfeel" src="..\..\Media\gui\TaharezLook.looknfeel" />
+                <File Id="file133" Name="TAHARE_1.TGA" LongName="TaharezLook.tga" src="..\..\Media\gui\TaharezLook.tga" />
+                <File Id="file134" Name="TAHARE_2.SCH" LongName="TaharezLookSkin.scheme" src="..\..\Media\gui\TaharezLookSkin.scheme" />
+                <File Id="file135" Name="TAHARE_3.SCH" LongName="TaharezLookWidgetAliases.scheme" src="..\..\Media\gui\TaharezLookWidgetAliases.scheme" />
+                <File Id="file136" Name="CEGUI8_1.LAY" LongName="cegui8.layout" src="..\..\Media\gui\cegui8.layout" />
+                <File Id="file137" Name="FACIAL_1.LAY" LongName="facial.layout" src="..\..\Media\gui\facial.layout" />
+                <File Id="file138" Name="OGREGU_1.LAY" LongName="ogregui.layout" src="..\..\Media\gui\ogregui.layout" />
+                <File Id="file139" Name="bluehi_1.FON" LongName="bluehighway-10.font" src="..\..\Media\gui\bluehighway-10.font" />
+                <File Id="file140" Name="bluehi_2.FON" LongName="bluehighway-12.font" src="..\..\Media\gui\bluehighway-12.font" />
+                <File Id="file141" Name="bluehi_3.FON" LongName="bluehighway-8.font" src="..\..\Media\gui\bluehighway-8.font" />
+				<File Id="file143_" Name="Compo_1.lay" LongName="CompositorDemo.layout" src="..\..\Media\gui\CompositorDemo.layout" />
+				<File Id="file144_" Name="Compo_1.con" LongName="CompositorDemoCegui.config" src="..\..\Media\gui\CompositorDemoCegui.config" />
+				<File Id="shadowslayout" Name="shadows.lay" LongName="shadows.layout" src="..\..\Media\gui\shadows.layout" />
+				<File Id="crowdlayout" Name="crowd.lay" LongName="CrowdDemo.layout" src="..\..\Media\gui\CrowdDemo.layout" />
+				
+              </Component>
+            </Directory>
+            <Directory Id="directory22" Name="MATERI_1" LongName="materials">
+              <Directory Id="directory24" Name="programs">
+				<Component Id="MediaMaterialsProgramsComp" DiskId="1" Guid="78887AB3-E9CD-4b78-9CD1-A35EFCB69F38">
+                  <File Id="file157" Name="BLOOM__1.HLS" LongName="Bloom_ps20.hlsl" src="..\..\Media\materials\programs\Bloom_ps20.hlsl" />
+                  <File Id="file158" Name="BLOOM__2.HLS" LongName="Bloom_vs11.hlsl" src="..\..\Media\materials\programs\Bloom_vs11.hlsl" />
+                  <File Id="file159" Name="BLUR0__1.HLS" LongName="Blur0_ps20.hlsl" src="..\..\Media\materials\programs\Blur0_ps20.hlsl" />
+                  <File Id="file160" Name="BLUR0__1.GLS" LongName="Blur0_vs.glsl" src="..\..\Media\materials\programs\Blur0_vs.glsl" />
+                  <File Id="file161" Name="BLUR0__2.HLS" LongName="Blur0_vs11.hlsl" src="..\..\Media\materials\programs\Blur0_vs11.hlsl" />
+                  <File Id="file162" Name="BLUR1__1.HLS" LongName="Blur1_ps20.hlsl" src="..\..\Media\materials\programs\Blur1_ps20.hlsl" />
+                  <File Id="file163" Name="BLUR1__1.GLS" LongName="Blur1_vs.glsl" src="..\..\Media\materials\programs\Blur1_vs.glsl" />
+                  <File Id="file164" Name="BLUR1__2.HLS" LongName="Blur1_vs11.hlsl" src="..\..\Media\materials\programs\Blur1_vs11.hlsl" />
+                  <File Id="file165" Name="BLUR_P_1.GLS" LongName="Blur_ps.glsl" src="..\..\Media\materials\programs\Blur_ps.glsl" />
+                  <File Id="file166" Name="COMBIN_1.CG" LongName="Combine_fp.cg" src="..\..\Media\materials\programs\Combine_fp.cg" />
+                  <File Id="file167" Name="DOF_ps.cg" src="..\..\Media\materials\programs\DOF_ps.cg" />
+                  <File Id="file168" Name="EXAMPL_1.CG" LongName="Example_Basic.cg" src="..\..\Media\materials\programs\Example_Basic.cg" />
+                  <File Id="file169" Name="EXAMPL_2.CG" LongName="Example_BumpMapping.cg" src="..\..\Media\materials\programs\Example_BumpMapping.cg" />
+                  <File Id="file170" Name="EXAMPL_3.CG" LongName="Example_CelShading.cg" src="..\..\Media\materials\programs\Example_CelShading.cg" />
+                  <File Id="file171" Name="EXAMPL_4.CG" LongName="Example_Fresnel.cg" src="..\..\Media\materials\programs\Example_Fresnel.cg" />
+                  <File Id="file172" Name="EXAMPL_1.ASM" LongName="Example_FresnelPS.asm" src="..\..\Media\materials\programs\Example_FresnelPS.asm" />
+                  <File Id="file173" Name="EXAA61_1.CG" LongName="Example_Projection.cg" src="..\..\Media\materials\programs\Example_Projection.cg" />
+                  <File Id="file174" Name="GlassFP.cg" src="..\..\Media\materials\programs\GlassFP.cg" />
+                  <File Id="file175" Name="Grass.cg" src="..\..\Media\materials\programs\Grass.cg" />
+                  <File Id="file176" Name="GRAYSC_1.CG" LongName="GrayScale.cg" src="..\..\Media\materials\programs\GrayScale.cg" />
+                  <File Id="file177" Name="HEATVI_1.CG" LongName="HeatVision.cg" src="..\..\Media\materials\programs\HeatVision.cg" />
+                  <File Id="file178" Name="OCEAN2_1.FRA" LongName="Ocean2GLSL.frag" src="..\..\Media\materials\programs\Ocean2GLSL.frag" />
+                  <File Id="file179" Name="OCEAN2_1.VER" LongName="Ocean2GLSL.vert" src="..\..\Media\materials\programs\Ocean2GLSL.vert" />
+                  <File Id="file180" Name="OCEAN2_2.FRA" LongName="Ocean2HLSL_Cg.frag" src="..\..\Media\materials\programs\Ocean2HLSL_Cg.frag" />
+                  <File Id="file181" Name="OCEAN2_2.VER" LongName="Ocean2HLSL_Cg.vert" src="..\..\Media\materials\programs\Ocean2HLSL_Cg.vert" />
+                  <File Id="file182" Name="OFFSET_1.CG" LongName="OffsetMapping.cg" src="..\..\Media\materials\programs\OffsetMapping.cg" />
+                  <File Id="file183" Name="OFFSET_1.ASM" LongName="OffsetMapping_specular.asm" src="..\..\Media\materials\programs\OffsetMapping_specular.asm" />
+                  <File Id="file184" Name="OldTV.cg" src="..\..\Media\materials\programs\OldTV.cg" />
+                  <File Id="file185" Name="STDQUA_1.CG" LongName="StdQuad_vp.cg" src="..\..\Media\materials\programs\StdQuad_vp.cg" />
+                  <File Id="file186" Name="OCEANG_1.FRA" LongName="oceanGLSL.frag" src="..\..\Media\materials\programs\oceanGLSL.frag" />
+                  <File Id="file187" Name="OCEANG_1.VER" LongName="oceanGLSL.vert" src="..\..\Media\materials\programs\oceanGLSL.vert" />
+                  <File Id="file188" Name="OCEANH_1.FRA" LongName="oceanHLSL_Cg.frag" src="..\..\Media\materials\programs\oceanHLSL_Cg.frag" />
+                  <File Id="file189" Name="OCEANH_1.VER" LongName="oceanHLSL_Cg.vert" src="..\..\Media\materials\programs\oceanHLSL_Cg.vert" />
+                  <File Id="file190_" Name="OldMov_1.cg" LongName="OldMovieFP.cg" src="..\..\Media\materials\programs\OldMovieFP.cg" />
+                  <File Id="file191_" Name="hdr.cg" src="..\..\Media\materials\programs\hdr.cg" />
+                  <File Id="file192_" Name="StdQua_1.gls" LongName="StdQuad_vp.glsl" src="..\..\Media\materials\programs\StdQuad_vp.glsl" />
+				  <File Id="file193_" Name="hdr.hls" LongName="hdr.hlsl" src="..\..\Media\materials\programs\hdr.hlsl" />
+				  <File Id="file194_" Name="hdrbloom.gls" LongName="hdr_bloom.glsl" src="..\..\Media\materials\programs\hdr_bloom.glsl" />
+				  <File Id="file195_" Name="hdrd2x2l.gls" LongName="hdr_downscale2x2luminence.glsl" src="..\..\Media\materials\programs\hdr_downscale2x2luminence.glsl" />
+				  <File Id="file196_" Name="hdrd3x3.gls" LongName="hdr_downscale3x3.glsl" src="..\..\Media\materials\programs\hdr_downscale3x3.glsl" />
+				  <File Id="file197_" Name="hdrd3x3b.gls" LongName="hdr_downscale3x3brightpass.glsl" src="..\..\Media\materials\programs\hdr_downscale3x3brightpass.glsl" />
+				  <File Id="file198_" Name="hdr_tm.gls" LongName="hdr_finalToneMapping.glsl" src="..\..\Media\materials\programs\hdr_finalToneMapping.glsl" />
+				  <File Id="file199_" Name="hdr_util.gls" LongName="hdr_tonemap_util.glsl" src="..\..\Media\materials\programs\hdr_tonemap_util.glsl" />
+				  <File Id="file200_" Name="InvertFP.cg" src="..\..\Media\materials\programs\InvertFP.cg" />
+				  <File Id="file201_" Name="Laplac_1.cg" LongName="LaplaceFP.cg" src="..\..\Media\materials\programs\LaplaceFP.cg" />
+				  <File Id="file202_" Name="Poster_1.cg" LongName="PosterizeFP.cg" src="..\..\Media\materials\programs\PosterizeFP.cg" />
+				  <File Id="file203_" Name="Sharpe_1.cg" LongName="SharpenEdgesFP.cg" src="..\..\Media\materials\programs\SharpenEdgesFP.cg" />
+				  <File Id="file204_" Name="TilingFP.cg" src="..\..\Media\materials\programs\TilingFP.cg" />
+				  <File Id="ambonetexglsl" Name="Amb1Tex.gls" LongName="AmbientOneTexture.glsl" src="..\..\Media\materials\programs\AmbientOneTexture.glsl" />
+				  <File Id="depthshadowhlsl" Name="dsmap.hls" LongName="DepthShadowmap.hlsl" src="..\..\Media\materials\programs\DepthShadowmap.hlsl" />
+				  <File Id="depthshadowglslcfp" Name="dsmap1.gls" LongName="DepthShadowmapCasterFp.glsl" src="..\..\Media\materials\programs\DepthShadowmapCasterFp.glsl" />
+				  <File Id="depthshadowglslcvp" Name="dsmap2.gls" LongName="DepthShadowmapCasterVp.glsl" src="..\..\Media\materials\programs\DepthShadowmapCasterVp.glsl" />
+				  <File Id="depthshadowglslnmrfp" Name="dsmap3.gls" LongName="DepthShadowmapNormalMapReceiverFp.glsl" src="..\..\Media\materials\programs\DepthShadowmapNormalMapReceiverFp.glsl" />
+				  <File Id="depthshadowglslnmrvp" Name="dsmap4.gls" LongName="DepthShadowmapNormalMapReceiverVp.glsl" src="..\..\Media\materials\programs\DepthShadowmapNormalMapReceiverVp.glsl" />
+				  <File Id="depthshadowglslrfp" Name="dsmap5.gls" LongName="DepthShadowmapReceiverFp.glsl" src="..\..\Media\materials\programs\DepthShadowmapReceiverFp.glsl" />
+				  <File Id="depthshadowglslrvp" Name="dsmap6.gls" LongName="DepthShadowmapReceiverVp.glsl" src="..\..\Media\materials\programs\DepthShadowmapReceiverVp.glsl" />
+				  <File Id="examplebasichlsl" Name="exampl1.hls" LongName="Example_Basic.hlsl" src="..\..\Media\materials\programs\Example_Basic.hlsl" />
+				  <File Id="offsetmappinghlsl" Name="offsmap1.hls" LongName="OffsetMapping.hlsl" src="..\..\Media\materials\programs\OffsetMapping.hlsl" />
+				  <File Id="offsetmappingfpglsl" Name="offsmap1.gls" LongName="OffsetMappingFp.glsl" src="..\..\Media\materials\programs\OffsetMappingFp.glsl" />
+				  <File Id="offsetmappingvpglsl" Name="offsmap2.gls" LongName="OffsetMappingVp.glsl" src="..\..\Media\materials\programs\OffsetMappingVp.glsl" />
+				  <File Id="skintwoweightsglsl" Name="skin2w.gls" LongName="skinningTwoWeightsVp.glsl" src="..\..\Media\materials\programs\skinningTwoWeightsVp.glsl" />
+				  <File Id="instancingcg" Name="inst.cg" LongName="instancing.cg" src="..\..\Media\materials\programs\instancing.cg" />
+				  <File Id="instancingvpglsl" Name="instvp.gls" LongName="instancingVp.glsl" src="..\..\Media\materials\programs\instancingVp.glsl" />
+				  <File Id="crowdvpglsl" Name="crowvp.gls" LongName="crowdVp.glsl" src="..\..\Media\materials\programs\crowdVp.glsl" />
+                </Component>
+              </Directory>
+              <Directory Id="directory26" Name="scripts">
+			    <Component Id="MediaMaterialsScriptsComp" DiskId="1" Guid="64DFDE91-5809-4ba0-865E-08E7EE7E8F0E">
+                  <File Id="file197" Name="BLACKA_1.MAT" LongName="BlackAndWhite.material" src="..\..\Media\materials\scripts\BlackAndWhite.material" />
+                  <File Id="file198" Name="BLOOM_1.MAT" LongName="Bloom.material" src="..\..\Media\materials\scripts\Bloom.material" />
+                  <File Id="file199" Name="DOF_1.MAT" LongName="DOF.material" src="..\..\Media\materials\scripts\DOF.material" />
+                  <File Id="file200" Name="EMBOSS_1.MAT" LongName="Embossed.material" src="..\..\Media\materials\scripts\Embossed.material" />
+                  <File Id="file201" Name="EXAMPL_1.MAT" LongName="Example-DynTex.material" src="..\..\Media\materials\scripts\Example-DynTex.material" />
+                  <File Id="file202" Name="EXAMPL_2.MAT" LongName="Example-Water.material" src="..\..\Media\materials\scripts\Example-Water.material" />
+                  <File Id="file203" Name="EXAMPL_3.MAT" LongName="Example.material" src="..\..\Media\materials\scripts\Example.material" />
+                  <File Id="file204" Name="EXAMPL_4.MAT" LongName="Examples-Advanced.material" src="..\..\Media\materials\scripts\Examples-Advanced.material" />
+                  <File Id="file205" Name="EXAMPL_1.PRO" LongName="Examples.program" src="..\..\Media\materials\scripts\Examples.program" />
+                  <File Id="file206" Name="GLASS_1.MAT" LongName="Glass.material" src="..\..\Media\materials\scripts\Glass.material" />
+                  <File Id="file207" Name="HEATVI_1.MAT" LongName="HeatVision.material" src="..\..\Media\materials\scripts\HeatVision.material" />
+                  <File Id="file208" Name="HURT_1.MAT" LongName="Hurt.material" src="..\..\Media\materials\scripts\Hurt.material" />
+                  <File Id="file209" Name="MOTION_1.MAT" LongName="MotionBlur.material" src="..\..\Media\materials\scripts\MotionBlur.material" />
+                  <File Id="file210" Name="OCEAN_1.CON" LongName="Ocean.controls" src="..\..\Media\materials\scripts\Ocean.controls" />
+                  <File Id="file211" Name="OFFSET_1.MAT" LongName="OffsetMapping.material" src="..\..\Media\materials\scripts\OffsetMapping.material" />
+                  <File Id="file212" Name="OGRE_1.MAT" LongName="Ogre.material" src="..\..\Media\materials\scripts\Ogre.material" />
+                  <File Id="file213" Name="OLDTV_1.MAT" LongName="OldTV.material" src="..\..\Media\materials\scripts\OldTV.material" />
+                  <File Id="file214" Name="RZR-00_1.MAT" LongName="RZR-002.material" src="..\..\Media\materials\scripts\RZR-002.material" />
+                  <File Id="file215" Name="STDQUA_1.PRO" LongName="StdQuad_vp.program" src="..\..\Media\materials\scripts\StdQuad_vp.program" />
+                  <File Id="file216" Name="FACIAL_1.MAT" LongName="facial.material" src="..\..\Media\materials\scripts\facial.material" />
+                  <File Id="file217" Name="SMOKE_1.MAT" LongName="smoke.material" src="..\..\Media\materials\scripts\smoke.material" />
+                  <File Id="file218" Name="EXAMPL_1.COM" LongName="Examples.compositor" src="..\..\Media\materials\scripts\Examples.compositor" />
+                  <File Id="file219" Name="OCEAN_1.MAT" LongName="Ocean.material" src="..\..\Media\materials\scripts\Ocean.material" />
+				  <File Id="file220_" Name="OldMovie.mat" LongName="OldMovie.material" src="..\..\Media\materials\scripts\OldMovie.material" />
+				  <File Id="file221_" Name="hdr.mat" LongName="hdr.material" src="..\..\Media\materials\scripts\hdr.material" />
+				  <File Id="file222_" Name="Sharpe_1.mat" LongName="SharpenEdges.material" src="..\..\Media\materials\scripts\SharpenEdges.material" />
+				  <File Id="file223_" Name="Invert.mat" LongName="Invert.material" src="..\..\Media\materials\scripts\Invert.material" />
+				  <File Id="file224_" Name="Laplace.mat" LongName="Laplace.material" src="..\..\Media\materials\scripts\Laplace.material" />
+				  <File Id="file225_" Name="Poster_1.mat" LongName="Posterize.material" src="..\..\Media\materials\scripts\Posterize.material" />
+				  <File Id="file226_" Name="Tiling.mat" LongName="Tiling.material" src="..\..\Media\materials\scripts\Tiling.material" />
+				  <File Id="depthshadowmat" Name="depthsha.mat" LongName="DepthShadowmap.material" src="..\..\Media\materials\scripts\DepthShadowmap.material" />
+				  <File Id="instancingmat" Name="instanc.mat" LongName="instancing.material" src="..\..\Media\materials\scripts\instancing.material" />
+                </Component>
+              </Directory>
+              <Directory Id="directory28" Name="textures">
+			    <Component Id="MediaMaterialsTexturesComp" DiskId="1" Guid="75560EC1-67EF-4711-AFBC-80FF55335E9B">
+                  <File Id="file227" Name="10points.png" src="..\..\Media\materials\textures\10points.png" />
+                  <File Id="file229" Name="BEACHS_1.JPG" LongName="BeachStones.jpg" src="..\..\Media\materials\textures\BeachStones.jpg" />
+                  <File Id="file230" Name="BUMPYM_1.JPG" LongName="BumpyMetal.jpg" src="..\..\Media\materials\textures\BumpyMetal.jpg" />
+                  <File Id="file231" Name="Chrome.jpg" src="..\..\Media\materials\textures\Chrome.jpg" />
+                  <File Id="file232" Name="Dirt.jpg" src="..\..\Media\materials\textures\Dirt.jpg" />
+                  <File Id="file233" Name="DR_BUN_1.JPG" LongName="Dr_Bunsen_Head.jpg" src="..\..\Media\materials\textures\Dr_Bunsen_Head.jpg" />
+                  <File Id="file234" Name="GLX_icon.png" src="..\..\Media\materials\textures\GLX_icon.png" />
+                  <File Id="file235" Name="GREENS_1.JPG" LongName="GreenSkin.jpg" src="..\..\Media\materials\textures\GreenSkin.jpg" />
+                  <File Id="file236" Name="HEATLO_1.TGA" LongName="HeatLookup.tga" src="..\..\Media\materials\textures\HeatLookup.tga" />
+                  <File Id="file237" Name="HEATNO_1.TGA" LongName="HeatNoise.tga" src="..\..\Media\materials\textures\HeatNoise.tga" />
+                  <File Id="file238" Name="MtlPlat2.jpg" src="..\..\Media\materials\textures\MtlPlat2.jpg" />
+                  <File Id="file239" Name="NMBalls.png" src="..\..\Media\materials\textures\NMBalls.png" />
+                  <File Id="file240" Name="NMBUMP_1.PNG" LongName="NMBumpsOut.png" src="..\..\Media\materials\textures\NMBumpsOut.png" />
+                  <File Id="file241" Name="NMHOLL_1.PNG" LongName="NMHollyBumps.png" src="..\..\Media\materials\textures\NMHollyBumps.png" />
+                  <File Id="file242" Name="NMSTRI_1.PNG" LongName="NMStripes.png" src="..\..\Media\materials\textures\NMStripes.png" />
+                  <File Id="file243" Name="NPRMET_1.TGA" LongName="NPRMetallic.tga" src="..\..\Media\materials\textures\NPRMetallic.tga" />
+                  <File Id="file244" Name="NOISEV_1.DDS" LongName="NoiseVolume.dds" src="..\..\Media\materials\textures\NoiseVolume.dds" />
+                  <File Id="file245" Name="RZR-002.png" src="..\..\Media\materials\textures\RZR-002.png" />
+                  <File Id="file246" Name="Random3D.dds" src="..\..\Media\materials\textures\Random3D.dds" />
+                  <File Id="file247" Name="RUSTED_1.JPG" LongName="RustedMetal.jpg" src="..\..\Media\materials\textures\RustedMetal.jpg" />
+                  <File Id="file248" Name="RUSTYB_1.PNG" LongName="RustyBarrel.png" src="..\..\Media\materials\textures\RustyBarrel.png" />
+                  <File Id="file249" Name="RUSTYS_1.JPG" LongName="RustySteel.jpg" src="..\..\Media\materials\textures\RustySteel.jpg" />
+                  <File Id="file250" Name="Water01.jpg" src="..\..\Media\materials\textures\Water01.jpg" />
+                  <File Id="file251" Name="Water02.jpg" src="..\..\Media\materials\textures\Water02.jpg" />
+                  <File Id="file252" Name="WATERN_1.TGA" LongName="WaterNormal1.tga" src="..\..\Media\materials\textures\WaterNormal1.tga" />
+                  <File Id="file253" Name="WATERN_2.TGA" LongName="WaterNormal2.tga" src="..\..\Media\materials\textures\WaterNormal2.tga" />
+                  <File Id="file254" Name="WeirdEye.png" src="..\..\Media\materials\textures\WeirdEye.png" />
+                  <File Id="file255" Name="WOODPA_1.PNG" LongName="WoodPallet.png" src="..\..\Media\materials\textures\WoodPallet.png" />
+                  <File Id="file256" Name="ATHENE_1.PNG" LongName="atheneNormalMap.png" src="..\..\Media\materials\textures\atheneNormalMap.png" />
+                  <File Id="file257" Name="aureola.png" src="..\..\Media\materials\textures\aureola.png" />
+                  <File Id="file258" Name="BASIC__1.PNG" LongName="basic_droplet.png" src="..\..\Media\materials\textures\basic_droplet.png" />
+                  <File Id="file259" Name="CEL_SH_1.PNG" LongName="cel_shading_diffuse.png" src="..\..\Media\materials\textures\cel_shading_diffuse.png" />
+                  <File Id="file260" Name="CEL_SH_2.PNG" LongName="cel_shading_edge.png" src="..\..\Media\materials\textures\cel_shading_edge.png" />
+                  <File Id="file261" Name="CEL_SH_3.PNG" LongName="cel_shading_specular.png" src="..\..\Media\materials\textures\cel_shading_specular.png" />
+                  <File Id="file262" Name="clouds.jpg" src="..\..\Media\materials\textures\clouds.jpg" />
+                  <File Id="file263" Name="cursor.png" src="..\..\Media\materials\textures\cursor.png" />
+                  <File Id="file264" Name="dirt01.jpg" src="..\..\Media\materials\textures\dirt01.jpg" />
+                  <File Id="file265" Name="dkyellow.png" src="..\..\Media\materials\textures\dkyellow.png" />
+                  <File Id="file266" Name="droplet.png" src="..\..\Media\materials\textures\droplet.png" />
+                  <File Id="file267" Name="EGYPTR_1.JPG" LongName="egyptrockyfull.jpg" src="..\..\Media\materials\textures\egyptrockyfull.jpg" />
+                  <File Id="file268" Name="flare.png" src="..\..\Media\materials\textures\flare.png" />
+                  <File Id="file269" Name="FLARET_1.PNG" LongName="flaretrail.png" src="..\..\Media\materials\textures\flaretrail.png" />
+                  <File Id="file270" Name="gras_02.png" src="..\..\Media\materials\textures\gras_02.png" />
+                  <File Id="file271" Name="GRASS__1.JPG" LongName="grass_1024.jpg" src="..\..\Media\materials\textures\grass_1024.jpg" />
+                  <File Id="file272" Name="nm_bk.png" src="..\..\Media\materials\textures\nm_bk.png" />
+                  <File Id="file273" Name="nm_dn.png" src="..\..\Media\materials\textures\nm_dn.png" />
+                  <File Id="file274" Name="nm_fr.png" src="..\..\Media\materials\textures\nm_fr.png" />
+                  <File Id="file275" Name="nm_lf.png" src="..\..\Media\materials\textures\nm_lf.png" />
+                  <File Id="file276" Name="nm_rt.png" src="..\..\Media\materials\textures\nm_rt.png" />
+                  <File Id="file277" Name="nm_up.png" src="..\..\Media\materials\textures\nm_up.png" />
+                  <File Id="file278" Name="nskingr.jpg" src="..\..\Media\materials\textures\nskingr.jpg" />
+                  <File Id="file279" Name="OGREBO_1.PNG" LongName="ogreborder.png" src="..\..\Media\materials\textures\ogreborder.png" />
+                  <File Id="file280" Name="OGREBO_2.PNG" LongName="ogreborderUp.png" src="..\..\Media\materials\textures\ogreborderUp.png" />
+                  <File Id="file281" Name="OGREBO_3.PNG" LongName="ogrebordercenter.png" src="..\..\Media\materials\textures\ogrebordercenter.png" />
+                  <File Id="file282" Name="ogregui.tga" src="..\..\Media\materials\textures\ogregui.tga" />
+                  <File Id="file283" Name="OGRELO_1.JPG" LongName="ogrelogo-small.jpg" src="..\..\Media\materials\textures\ogrelogo-small.jpg" />
+                  <File Id="file284" Name="ogrelogo.png" src="..\..\Media\materials\textures\ogrelogo.png" />
+                  <File Id="file285" Name="PERLIN_1.DDS" LongName="perlinvolume.dds" src="..\..\Media\materials\textures\perlinvolume.dds" />
+                  <File Id="file286" Name="r2skin.jpg" src="..\..\Media\materials\textures\r2skin.jpg" />
+                  <File Id="file287" Name="RIBBON_1.PNG" LongName="ribbonband.png" src="..\..\Media\materials\textures\ribbonband.png" />
+                  <File Id="file288" Name="rockwall.tga" src="..\..\Media\materials\textures\rockwall.tga" />
+                  <File Id="file289" Name="ROCKWA_1.TGA" LongName="rockwall_NH.tga" src="..\..\Media\materials\textures\rockwall_NH.tga" />
+                  <File Id="file290" Name="scr-back.png" src="..\..\Media\materials\textures\scr-back.png" />
+                  <File Id="file291" Name="SCR-DO_1.PNG" LongName="scr-down-p.png" src="..\..\Media\materials\textures\scr-down-p.png" />
+                  <File Id="file292" Name="scr-down.png" src="..\..\Media\materials\textures\scr-down.png" />
+                  <File Id="file293" Name="SCR-TH_1.PNG" LongName="scr-thumb.png" src="..\..\Media\materials\textures\scr-thumb.png" />
+                  <File Id="file294" Name="scr-up-p.png" src="..\..\Media\materials\textures\scr-up-p.png" />
+                  <File Id="file295" Name="scr-up.png" src="..\..\Media\materials\textures\scr-up.png" />
+                  <File Id="file296" Name="smoke.png" src="..\..\Media\materials\textures\smoke.png" />
+                  <File Id="file297" Name="SMOKEC_1.PNG" LongName="smokecolors.png" src="..\..\Media\materials\textures\smokecolors.png" />
+                  <File Id="file298" Name="SNOW_1_1.JPG" LongName="snow_1024.jpg" src="..\..\Media\materials\textures\snow_1024.jpg" />
+                  <File Id="file299" Name="spacesky.jpg" src="..\..\Media\materials\textures\spacesky.jpg" />
+                  <File Id="file300" Name="SPHERE_1.PNG" LongName="spheremap.png" src="..\..\Media\materials\textures\spheremap.png" />
+                  <File Id="file301" Name="STEELH_1.PNG" LongName="steelhead.png" src="..\..\Media\materials\textures\steelhead.png" />
+                  <File Id="file302" Name="TERR_D_1.JPG" LongName="terr_dirt-grass.jpg" src="..\..\Media\materials\textures\terr_dirt-grass.jpg" />
+                  <File Id="file303" Name="TERR_R_1.JPG" LongName="terr_rock-dirt.jpg" src="..\..\Media\materials\textures\terr_rock-dirt.jpg" />
+                  <File Id="file304" Name="TERR_R_2.JPG" LongName="terr_rock6.jpg" src="..\..\Media\materials\textures\terr_rock6.jpg" />
+                  <File Id="file305" Name="terrain.png" src="..\..\Media\materials\textures\terrain.png" />
+                  <File Id="file306" Name="TERRAI_1.JPG" LongName="terrain_detail.jpg" src="..\..\Media\materials\textures\terrain_detail.jpg" />
+                  <File Id="file307" Name="TERRAI_2.JPG" LongName="terrain_texture.jpg" src="..\..\Media\materials\textures\terrain_texture.jpg" />
+                  <File Id="file308" Name="texmap2.jpg" src="..\..\Media\materials\textures\texmap2.jpg" />
+                  <File Id="file309" Name="waveNM.png" src="..\..\Media\materials\textures\waveNM.png" />
+                  <File Id="file310" Name="waves2.dds" src="..\..\Media\materials\textures\waves2.dds" />
+				  <File Id="file311_" Name="bluejaiq.jpg" LongName="blue_jaiqua.jpg" src="..\..\Media\materials\textures\blue_jaiqua.jpg" />
+				  <File Id="file312_" Name="Sepia1D.tga" src="..\..\Media\materials\textures\Sepia1D.tga" />
+				  <File Id="file313_" Name="fw12b.jpg" src="..\..\Media\materials\textures\fw12b.jpg" />
+				  <File Id="file314_" Name="1D_Noise.png" src="..\..\Media\materials\textures\1D_Noise.png" />
+				  <File Id="file315_" Name="1D_Noi_2.png" LongName="1D_Noise2.png" src="..\..\Media\materials\textures\1D_Noise2.png" />
+				  <File Id="file316_" Name="8x8Pag_1.png" LongName="8x8PagesSplotches2.png" src="..\..\Media\materials\textures\8x8PagesSplotches2.png" />
+				  <File Id="file317_" Name="normal_1.png" LongName="normalNoiseColor.png" src="..\..\Media\materials\textures\normalNoiseColor.png" />
+             </Component>
+              </Directory>
+            </Directory>
+            <Directory Id="directory30" Name="models">
+			  <Component Id="MediaModelsComp" DiskId="1" Guid="DDFBD1F9-4B4A-4672-BA61-7850FDA9C7C3">
+                <File Id="file318" Name="BARREL_1.MES" LongName="Barrel.mesh" src="..\..\Media\models\Barrel.mesh" />
+                <File Id="file319" Name="RZR-00_1.MES" LongName="RZR-002.mesh" src="..\..\Media\models\RZR-002.mesh" />
+                <File Id="file320" Name="WOODPA_1.MES" LongName="WoodPallet.mesh" src="..\..\Media\models\WoodPallet.mesh" />
+                <File Id="file321" Name="ATHENE_1.MES" LongName="athene.mesh" src="..\..\Media\models\athene.mesh" />
+                <File Id="file322" Name="COLUMN_1.MES" LongName="column.mesh" src="..\..\Media\models\column.mesh" />
+                <File Id="file323" Name="CUBE_1.MES" LongName="cube.mesh" src="..\..\Media\models\cube.mesh" />
+                <File Id="file324" Name="FACIAL_1.MES" LongName="facial.mesh" src="..\..\Media\models\facial.mesh" />
+                <File Id="file325" Name="FISH_1.MES" LongName="fish.mesh" src="..\..\Media\models\fish.mesh" />
+                <File Id="file326" Name="FISH_1.SKE" LongName="fish.skeleton" src="..\..\Media\models\fish.skeleton" />
+                <File Id="file327" Name="GEOSPH_1.MES" LongName="geosphere4500.mesh" src="..\..\Media\models\geosphere4500.mesh" />
+                <File Id="file328" Name="GEOSPH_2.MES" LongName="geosphere8000.mesh" src="..\..\Media\models\geosphere8000.mesh" />
+                <File Id="file329" Name="KNOT_1.MES" LongName="knot.mesh" src="..\..\Media\models\knot.mesh" />
+                <File Id="file330" Name="NINJA_1.MES" LongName="ninja.mesh" src="..\..\Media\models\ninja.mesh" />
+                <File Id="file331" Name="NINJA_1.SKE" LongName="ninja.skeleton" src="..\..\Media\models\ninja.skeleton" />
+                <File Id="file332" Name="OGREHE_1.MES" LongName="ogrehead.mesh" src="..\..\Media\models\ogrehead.mesh" />
+                <File Id="file333" Name="RAZOR_1.MES" LongName="razor.mesh" src="..\..\Media\models\razor.mesh" />
+                <File Id="file334" Name="ROBOT_1.MES" LongName="robot.mesh" src="..\..\Media\models\robot.mesh" />
+                <File Id="file335" Name="ROBOT_1.SKE" LongName="robot.skeleton" src="..\..\Media\models\robot.skeleton" />
+                <File Id="file336" Name="SPHERE_1.MES" LongName="sphere.mesh" src="..\..\Media\models\sphere.mesh" />
+				<File Id="file337_" Name="jaiqua.mes" LongName="jaiqua.mesh" src="..\..\Media\models\jaiqua.mesh" />
+				<File Id="file338_" Name="jaiqua.ske" LongName="jaiqua.skeleton" src="..\..\Media\models\jaiqua.skeleton" />
+				<File Id="file339_" Name="tudorhou.mes" LongName="tudorhouse.mesh" src="..\..\Media\models\tudorhouse.mesh" />
+              </Component>
+            </Directory>
+            <Directory Id="directory32" Name="overlays">
+			  <Component Id="MediaOverlaysComp" DiskId="1" Guid="1186634B-76D5-406f-BDB3-5202014DB0CB">
+                <File Id="file344" Name="BASICO_1.INC" LongName="BasicOgreGuiTemplates.inc" src="..\..\Media\overlays\BasicOgreGuiTemplates.inc" />
+                <File Id="file345" Name="DP3_1.OVE" LongName="DP3.overlay" src="..\..\Media\overlays\DP3.overlay" />
+                <File Id="file346" Name="EXAMPL_1.OVE" LongName="Example-CubeMapping.overlay" src="..\..\Media\overlays\Example-CubeMapping.overlay" />
+                <File Id="file347" Name="EXAMPL_2.OVE" LongName="Example-DynTex.overlay" src="..\..\Media\overlays\Example-DynTex.overlay" />
+                <File Id="file348" Name="EXAMPL_3.OVE" LongName="Example-Water.overlay" src="..\..\Media\overlays\Example-Water.overlay" />
+                <File Id="file349" Name="SHADOW_1.OVE" LongName="Shadows.overlay" src="..\..\Media\overlays\Shadows.overlay" />
+                <File Id="file350" Name="COMPOS_1.OVE" LongName="Compositor.overlay" src="..\..\Media\overlays\Compositor.overlay" />
+              </Component>
+            </Directory>
+            <Directory Id="directory34" Name="packs">
+			  <Component Id="MediaPacksComp" DiskId="1" Guid="21D81EFC-0541-462e-8460-7A174CAA39DF">
+                <File Id="file358" Name="OgreCore.zip" src="..\..\Media\packs\OgreCore.zip" />
+                <File Id="file359" Name="cubemap.zip" src="..\..\Media\packs\cubemap.zip" />
+                <File Id="file360" Name="CUBEMA_1.ZIP" LongName="cubemapsJS.zip" src="..\..\Media\packs\cubemapsJS.zip" />
+                <File Id="file361" Name="dragon.zip" src="..\..\Media\packs\dragon.zip" />
+                <File Id="file362" Name="FRESNE_1.ZIP" LongName="fresneldemo.zip" src="..\..\Media\packs\fresneldemo.zip" />
+                <File Id="file363" Name="OGRETE_1.ZIP" LongName="ogretestmap.zip" src="..\..\Media\packs\ogretestmap.zip" />
+                <File Id="file364" Name="skybox.zip" src="..\..\Media\packs\skybox.zip" />
+                <File Id="file365" Name="chiropt.pk3" LongName="chiropteraDM.pk3" src="..\..\Media\packs\chiropteraDM.pk3" />
+                <File Id="file366" Name="chiropt.txt" LongName="chiropteraDM.txt" src="..\..\Media\packs\chiropteraDM.txt" />
+              </Component>
+            </Directory>
+            <Directory Id="directory36" Name="particle">
+			  <Component Id="MediaParticleComp" DiskId="1" Guid="CC0CCE4F-11EE-429f-8CE2-79F6C3F490F8">
+                <File Id="file372" Name="EXAMPL_1.PAR" LongName="Example-Water.particle" src="..\..\Media\particle\Example-Water.particle" />
+                <File Id="file373" Name="EXAMPL_2.PAR" LongName="Example.particle" src="..\..\Media\particle\Example.particle" />
+                <File Id="file374" Name="SMOKE_1.PAR" LongName="smoke.particle" src="..\..\Media\particle\smoke.particle" />
+				<File Id="emittedpart" Name="emitemit.PAR" LongName="emitted_emitter.particle" src="..\..\Media\particle\emitted_emitter.particle" />
+              </Component>
+            </Directory>
+          </Directory>
+
+        </Directory>
+        <!-- Start menu -->
+        <Directory Id="ProgramMenuFolder" Name="PMenu" LongName="Programs">
+          <Directory Id="OGREProgramMenuDir" Name='OGRE'>
+            <Directory Id="DemosMenuDir" Name="Demos"/>
+          </Directory>
+        </Directory>
+
+      </Directory>
+    </Directory>
+
+    <Feature Id='DemosFeature' Level='1' ConfigurableDirectory="INSTALLDIR" Title='Demos' 
+      Description='OGRE Demos' 
+      Absent='disallow' AllowAdvertise='no'>
+      <ComponentRef Id='OgreDemosComp' />
+      <ComponentRef Id='MediaComp' />
+      <ComponentRef Id='MediaFontsComp' />
+      <ComponentRef Id='MediaGuiComp' />
+      <ComponentRef Id='MediaMaterialsProgramsComp' />
+      <ComponentRef Id='MediaMaterialsScriptsComp' />
+      <ComponentRef Id='MediaMaterialsTexturesComp' />
+      <ComponentRef Id='MediaModelsComp' />
+      <ComponentRef Id='MediaOverlaysComp' />
+      <ComponentRef Id='MediaPacksComp' />
+      <ComponentRef Id='MediaParticleComp' />
+      <MergeRef Id='CRT' />
+      <MergeRef Id='CRT Policy' />
+    </Feature>
+    <!-- enable UI -->
+    <UIRef Id="WixUI" />
+  </Product>
+</Wix>
+
+
+
Index: /Samples/Common/src/.keepme
===================================================================
--- /Samples/Common/src/.keepme	(revision 5)
+++ /Samples/Common/src/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Compositor/Makefile.am
===================================================================
--- /Samples/Compositor/Makefile.am	(revision 5)
+++ /Samples/Compositor/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/Compositor/Makefile.in
===================================================================
--- /Samples/Compositor/Makefile.in	(revision 5)
+++ /Samples/Compositor/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Compositor
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Compositor/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Compositor/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Compositor/include/Compositor.h
===================================================================
--- /Samples/Compositor/include/Compositor.h	(revision 5)
+++ /Samples/Compositor/include/Compositor.h	(revision 5)
@@ -0,0 +1,110 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef _CompositorDemo_H_
+#define _CompositorDemo_H_
+
+#include "OgreConfigFile.h"
+#include "OgreStringConverter.h"
+#include "OgreException.h"
+#include "ItemSelectorViewManager.h"
+
+#include "OgreNoMemoryMacros.h"
+#include <CEGUI/CEGUIImageset.h>
+#include <CEGUI/CEGUISystem.h>
+#include <CEGUI/CEGUILogger.h>
+#include <CEGUI/CEGUISchemeManager.h>
+#include <CEGUI/CEGUIWindowManager.h>
+#include <CEGUI/CEGUIWindow.h>
+#include <CEGUI/elements/CEGUICombobox.h>
+#include <CEGUI/elements/CEGUIListbox.h>
+#include <CEGUI/elements/CEGUIListboxTextItem.h>
+#include <CEGUI/elements/CEGUIPushButton.h>
+#include <CEGUI/elements/CEGUIScrollbar.h>
+#include "OgreMemoryMacros.h"
+
+#include "OgreCEGUIRenderer.h"
+
+//---------------------------------------------------------------------------
+    class CompositorDemo_FrameListener;
+//---------------------------------------------------------------------------
+    class CompositorDemo
+    {
+    protected:
+        Ogre::Root*			  mRoot;
+        Ogre::Camera*		  mCamera;
+        Ogre::SceneManager*	  mSceneMgr;
+        // the scene node of the entity
+        Ogre::SceneNode*	  mMainNode;
+
+        CompositorDemo_FrameListener* mFrameListener;
+        Ogre::RenderWindow*	  mWindow;
+        CEGUI::OgreCEGUIRenderer*    mGUIRenderer;
+        CEGUI::System*        mGUISystem;
+
+        size_t				  mCurrentMaterial;
+		Ogre::SceneNode * mSpinny;
+
+//        typedef std::vector< ShaderControlGUIWidget > ShaderControlContainer;
+//        typedef ShaderControlContainer::iterator ShaderControlIterator;
+
+//        ShaderControlContainer    mShaderControlContainer;
+//        MaterialControlsContainer mMaterialControlsContainer;
+
+        // These internal methods package up the stages in the startup process
+        /** Sets up the application - returns false if the user chooses to abandon configuration. */
+        bool setup(void);
+
+        /** Configures the application - returns false if the user chooses to abandon configuration. */
+        bool configure(void);
+        void chooseSceneManager(void);
+        void createCamera(void);
+        void createViewports(void);
+
+        /// Method which will define the source of resources (other than current folder)
+        void setupResources(void);
+        void loadResources(void);
+        void createScene(void);
+        void createFrameListener(void);
+        void createEffects(void);
+
+        void connectEventHandlers(void);
+        //void configureShaderControls(void);
+
+        void doErrorBox(const char* text);
+
+        bool handleQuit(const CEGUI::EventArgs& e);
+        //bool handleShaderControl(const CEGUI::EventArgs& e);
+        //bool handleShaderComboChanged(const CEGUI::EventArgs& e);
+        bool handleErrorBox(const CEGUI::EventArgs& e);
+        //void setShaderControlVal(const float val, const size_t index);
+
+    public:
+        CompositorDemo() : mRoot(0), mFrameListener(0), mGUIRenderer(0), mGUISystem(0)
+        {
+        }
+
+        ~CompositorDemo();
+
+        void go(void);
+        Ogre::Camera* getCamera(void) const { return mCamera; }
+        Ogre::SceneManager* getSceneManager(void) const { return mSceneMgr; }
+        Ogre::RenderWindow* getRenderWindow(void) const { return mWindow; }
+        Ogre::SceneNode* getMainNode(void) const { return mMainNode; }
+		CEGUI::OgreCEGUIRenderer* getGuiRenderer(void) const { return mGUIRenderer; }
+
+    };
+
+
+#endif	// end _CompositorDemo_H_
Index: /Samples/Compositor/include/CompositorDemo_FrameListener.h
===================================================================
--- /Samples/Compositor/include/CompositorDemo_FrameListener.h	(revision 5)
+++ /Samples/Compositor/include/CompositorDemo_FrameListener.h	(revision 5)
@@ -0,0 +1,175 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef _CompositorDemo_FrameListener_H_
+#define _CompositorDemo_FrameListener_H_
+
+#include <OgreFrameListener.h>
+#include <OIS/OIS.h>
+
+#include "ItemSelectorViewManager.h"
+
+//---------------------------------------------------------------------------
+    class HeatVisionListener: public Ogre::CompositorInstance::Listener
+    {
+    public:
+        HeatVisionListener();
+        virtual ~HeatVisionListener();
+        virtual void notifyMaterialSetup(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat);
+        virtual void notifyMaterialRender(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat);
+    protected:
+        Ogre::GpuProgramParametersSharedPtr fpParams;
+        float start, end, curr;
+        Ogre::Timer *timer;
+    };
+	//---------------------------------------------------------------------------
+	class HDRListener: public Ogre::CompositorInstance::Listener
+	{
+	protected:
+		int mVpWidth, mVpHeight;
+		int mBloomSize;
+		// Array params - have to pack in groups of 4 since this is how Cg generates them
+		// also prevents dependent texture read problems if ops don't require swizzle
+		float mBloomTexWeights[15][4];
+		float mBloomTexOffsetsHorz[15][4];
+		float mBloomTexOffsetsVert[15][4];
+	public:
+		HDRListener();
+		virtual ~HDRListener();
+		void notifyViewportSize(int width, int height);
+		void notifyCompositor(Ogre::CompositorInstance* instance);
+		virtual void notifyMaterialSetup(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat);
+		virtual void notifyMaterialRender(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat);
+	};
+	//---------------------------------------------------------------------------
+	class GaussianListener: public Ogre::CompositorInstance::Listener
+	{
+	protected:
+		int mVpWidth, mVpHeight;
+		// Array params - have to pack in groups of 4 since this is how Cg generates them
+		// also prevents dependent texture read problems if ops don't require swizzle
+		float mBloomTexWeights[15][4];
+		float mBloomTexOffsetsHorz[15][4];
+		float mBloomTexOffsetsVert[15][4];
+	public:
+		GaussianListener();
+		virtual ~GaussianListener();
+		void notifyViewportSize(int width, int height);
+		virtual void notifyMaterialSetup(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat);
+		virtual void notifyMaterialRender(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat);
+	};
+//---------------------------------------------------------------------------
+    class CompositorDemo;
+
+    class CompositorDemo_FrameListener : Ogre::FrameListener, OIS::KeyListener,
+        OIS::MouseListener, ItemSelectorInterface
+    {
+    #define MINSPEED .150f
+    #define MOVESPEED 30
+    #define MAXSPEED 1.800f
+
+
+    protected:
+        std::string mDebugText;
+
+        CompositorDemo* mMain;
+        HeatVisionListener *hvListener;
+		HDRListener *hdrListener;
+		GaussianListener *gaussianListener;
+        Ogre::Vector3 mTranslateVector;
+        bool mStatsOn;
+        unsigned int mNumScreenShots;
+        bool mWriteToFile;
+        float mSkipCount;
+        float mUpdateFreq;
+        int mSceneDetailIndex;
+        Ogre::TextureFilterOptions mFiltering;
+        int mAniso;
+        bool mQuit;
+
+        float mMoveScale;
+        float mRotScale;
+        float mSpeed;
+        float mAvgFrameTime;
+        Ogre::Real mMoveSpeed;
+        Ogre::Real mRotateSpeed;
+        CEGUI::Point mLastMousePosition;
+        bool mLastMousePositionSet;
+        // just to stop toggles flipping too fast
+        Ogre::Real mTimeUntilNextToggle ;
+        float mRotX, mRotY;
+        bool mProcessMovement;
+        bool mUpdateMovement;
+        bool mLMBDown;
+        bool mRMBDown;
+        bool mMoveFwd;
+        bool mMoveBck;
+        bool mMoveLeft;
+        bool mMoveRight;
+		Ogre::SceneNode* mSpinny;
+
+        ItemSelectorViewManager* mCompositorSelectorViewManager;
+
+		OIS::Mouse    *mMouse;
+		OIS::Keyboard *mKeyboard;
+		OIS::InputManager* mInputManager;
+
+        CEGUI::Renderer* mGuiRenderer;
+        CEGUI::Window* mGuiAvg;
+        CEGUI::Window* mGuiCurr;
+        CEGUI::Window* mGuiBest;
+        CEGUI::Window* mGuiWorst;
+        CEGUI::Window* mGuiTris;
+        CEGUI::Window* mGuiDbg;
+        CEGUI::Window* mRoot;
+		CEGUI::Listbox* mDebugRTTListbox;
+		CEGUI::Window* mDebugRTTStaticImage;
+		typedef std::vector<CEGUI::Imageset*> ImageSetList;
+		ImageSetList mDebugRTTImageSets;
+
+        CEGUI::MouseButton convertOISButtonToCegui(int ois_button_id);
+        void CheckMovementKeys( CEGUI::Key::Scan keycode, bool state );
+        void updateStats(void);
+        void registerCompositors(void);
+		void initDebugRTTWindow(void);
+		void updateDebugRTTWindow(void);
+
+    public:
+        CompositorDemo_FrameListener(CompositorDemo* main);
+        virtual ~CompositorDemo_FrameListener();
+		void setSpinningNode(Ogre::SceneNode* node) { mSpinny = node; }
+
+    private:
+        void connectEventHandlers(void);
+
+		virtual bool mouseMoved(const OIS::MouseEvent &e);
+		virtual bool mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id);
+        virtual bool mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id);
+
+        virtual bool keyPressed(const OIS::KeyEvent &e);
+        virtual bool keyReleased(const OIS::KeyEvent &e);
+
+        // Event handlers
+        bool frameStarted(const Ogre::FrameEvent& evt);
+        bool handleMouseMove(const CEGUI::EventArgs& e);
+        bool handleMouseButtonUp(const CEGUI::EventArgs& e);
+        bool handleMouseButtonDown(const CEGUI::EventArgs& e);
+        bool handleMouseWheelEvent(const CEGUI::EventArgs& e);
+        bool handleKeyDownEvent(const CEGUI::EventArgs& e);
+        bool handleKeyUpEvent(const CEGUI::EventArgs& e);
+		bool handleRttSelection(const CEGUI::EventArgs& e);
+        void itemStateChanged(const size_t index, const bool state);
+    };
+
+#endif
Index: /Samples/Compositor/include/ItemSelectorViewManager.h
===================================================================
--- /Samples/Compositor/include/ItemSelectorViewManager.h	(revision 5)
+++ /Samples/Compositor/include/ItemSelectorViewManager.h	(revision 5)
@@ -0,0 +1,96 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef _ItemSelectorViewManager_H_
+#define _ItemSelectorViewManager_H_
+
+#include "OgreString.h"
+
+#include "OgreNoMemoryMacros.h"
+#include <CEGUI/CEGUIImageset.h>
+#include <CEGUI/CEGUISystem.h>
+#include <CEGUI/CEGUILogger.h>
+#include <CEGUI/CEGUISchemeManager.h>
+#include <CEGUI/CEGUIWindowManager.h>
+#include <CEGUI/CEGUIWindow.h>
+#include <CEGUI/elements/CEGUICheckbox.h>
+#include <CEGUI/elements/CEGUICombobox.h>
+#include <CEGUI/elements/CEGUIListbox.h>
+#include <CEGUI/elements/CEGUIListboxTextItem.h>
+#include <CEGUI/elements/CEGUIPushButton.h>
+#include <CEGUI/elements/CEGUIScrollbar.h>
+#include <CEGUI/elements/CEGUIScrollablePane.h>
+#include "OgreMemoryMacros.h"
+
+    /** Provides interface between a View and a Controller.
+    */
+    class ItemSelectorInterface
+    {
+    public:
+        virtual ~ItemSelectorInterface(void) {}
+        virtual void itemStateChanged(const size_t index, const bool state) = 0;
+    };
+
+    /** A generic view for showing checkbox items in a vertical list.  Checkboxes
+        are in a Scrollable pane so items can be scrolled into view.
+    */
+    class ItemSelectorViewManager
+    {
+    public:
+        ItemSelectorViewManager(const Ogre::String& parentWindowName);
+        ~ItemSelectorViewManager(void){}
+
+        /** Returns number of items in the container.
+        */
+        size_t getSelectorCount(void) const { return mItemSelectorContainer.size(); }
+        /** iterates through compositors available through CompositorManager and update list
+        */
+        /** Add a new Item selector to the container
+        */
+        void addItemSelector(const Ogre::String& displayText);
+        Ogre::String getItemSelectorText(const size_t index) const
+        {
+            return Ogre::String(mItemSelectorContainer.at(index).CheckBoxWidget->getText().c_str());
+        }
+        /** Inform Manager about who will be the controller that responds to item event messages.
+        */
+        void setItemSelectorController(ItemSelectorInterface* controller);
+
+    protected:
+        struct ItemSelector
+        {
+            // make use of widget text member to store Compositor name
+            // widget toggle state is used for enable/disable compositor
+            // widget ID used for selector index
+            CEGUI::Checkbox* CheckBoxWidget;
+
+            ItemSelector() : CheckBoxWidget(0) {}
+        };
+        typedef std::vector<ItemSelector> ItemSelectorContainer;
+        typedef ItemSelectorContainer::iterator ItemSelectorIterator;
+
+        float mVerticalScrollPosition;
+        CEGUI::Window* mParentWindow;
+        CEGUI::ScrollablePane* mScrollablePane;
+        ItemSelectorInterface* mItemSelectorController;
+
+        ItemSelectorContainer mItemSelectorContainer;
+
+    private:
+        bool handleCheckStateChanged(const CEGUI::EventArgs& e);
+
+    };
+
+
+#endif
Index: /Samples/Compositor/include/Makefile.am
===================================================================
--- /Samples/Compositor/include/Makefile.am	(revision 5)
+++ /Samples/Compositor/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = Compositor.h CompositorDemo_FrameListener.h ItemSelectorViewManager.h
Index: /Samples/Compositor/include/Makefile.in
===================================================================
--- /Samples/Compositor/include/Makefile.in	(revision 5)
+++ /Samples/Compositor/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Compositor/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = Compositor.h CompositorDemo_FrameListener.h ItemSelectorViewManager.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Compositor/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Compositor/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Compositor/scripts/Demo_Compositor.cbp
===================================================================
--- /Samples/Compositor/scripts/Demo_Compositor.cbp	(revision 5)
+++ /Samples/Compositor/scripts/Demo_Compositor.cbp	(revision 5)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Compositor" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Compositor.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug\" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OgreGUIRenderer_d" />
+					<Add library="CEGUIBase_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Compositor.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release\" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OgreGUIRenderer" />
+					<Add library="CEGUIBase" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI\elements" />
+			<Add directory="..\..\Common\CEGUIRenderer\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\Compositor.h" />
+		<Unit filename="..\include\CompositorDemo_FrameListener.h" />
+		<Unit filename="..\include\ItemSelectorViewManager.h" />
+		<Unit filename="..\src\Compositor.cpp" />
+		<Unit filename="..\src\CompositorDemo_FrameListener.cpp" />
+		<Unit filename="..\src\ItemSelectorViewManager.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Compositor/scripts/Demo_Compositor.vcproj
===================================================================
--- /Samples/Compositor/scripts/Demo_Compositor.vcproj	(revision 5)
+++ /Samples/Compositor/scripts/Demo_Compositor.vcproj	(revision 5)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_Compositor"
+	ProjectGUID="{FBD73586-AD33-4191-A604-68AE21278729}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/Zm150"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib"
+				OutputFile="$(OutDir)/Demo_Compositor.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_Compositor.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib CEGUIBase.lib OgreGUIRenderer.lib"
+				OutputFile="$(OutDir)/Demo_Compositor.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\Compositor.cpp">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalOptions="/Zm150"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\CompositorDemo_FrameListener.cpp">
+			</File>
+			<File
+				RelativePath="..\src\ItemSelectorViewManager.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+			<File
+				RelativePath="..\include\Compositor.h">
+			</File>
+			<File
+				RelativePath="..\include\CompositorDemo_FrameListener.h">
+			</File>
+			<File
+				RelativePath="..\include\ItemSelectorViewManager.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Compositor/scripts/Demo_Compositor_linux.cbp
===================================================================
--- /Samples/Compositor/scripts/Demo_Compositor_linux.cbp	(revision 5)
+++ /Samples/Compositor/scripts/Demo_Compositor_linux.cbp	(revision 5)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Compositor" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_Compositor" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug/" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OgreGUIRenderer_d" />
+					<Add library="CEGUIBase" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_Compositor" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release/" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OgreGUIRenderer" />
+					<Add library="CEGUIBase" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+			<Add directory="$(#CEGUI)" />
+			<Add directory="../../Common/CEGUIRenderer/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/Compositor.h" />
+		<Unit filename="../include/CompositorDemo_FrameListener.h" />
+		<Unit filename="../include/ItemSelectorViewManager.h" />
+		<Unit filename="../src/Compositor.cpp" />
+		<Unit filename="../src/CompositorDemo_FrameListener.cpp" />
+		<Unit filename="../src/ItemSelectorViewManager.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Compositor/scripts/Demo_Compositor_stlp.cbp
===================================================================
--- /Samples/Compositor/scripts/Demo_Compositor_stlp.cbp	(revision 5)
+++ /Samples/Compositor/scripts/Demo_Compositor_stlp.cbp	(revision 5)
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_Compositor" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Compositor.exe" />
+				<Option working_dir="..\..\Common\bin\Debug\" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OgreGUIRenderer_d" />
+					<Add library="CEGUIBase_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Compositor.exe" />
+				<Option working_dir="..\..\Common\bin\Release\" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OgreGUIRenderer" />
+					<Add library="CEGUIBase" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI\elements" />
+			<Add directory="..\..\Common\CEGUIRenderer\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\Compositor.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\CompositorDemo_FrameListener.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\ItemSelectorViewManager.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\Compositor.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\CompositorDemo_FrameListener.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\ItemSelectorViewManager.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Compositor/scripts/Demo_Compositor_vc8.vcproj
===================================================================
--- /Samples/Compositor/scripts/Demo_Compositor_vc8.vcproj	(revision 5)
+++ /Samples/Compositor/scripts/Demo_Compositor_vc8.vcproj	(revision 5)
@@ -0,0 +1,249 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_Compositor"
+	ProjectGUID="{FBD73586-AD33-4191-A604-68AE21278729}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/Zm150"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib"
+				OutputFile="$(OutDir)/Demo_Compositor.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_Compositor.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib CEGUIBase.lib OgreGUIRenderer.lib"
+				OutputFile="$(OutDir)/Demo_Compositor.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\Compositor.cpp"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalOptions="/Zm150"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\CompositorDemo_FrameListener.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\ItemSelectorViewManager.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\Compositor.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\CompositorDemo_FrameListener.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\ItemSelectorViewManager.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Compositor/scripts/Demo_Compositor_vc8.vcproj.user
===================================================================
--- /Samples/Compositor/scripts/Demo_Compositor_vc8.vcproj.user	(revision 5)
+++ /Samples/Compositor/scripts/Demo_Compositor_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/Compositor/src/Compositor.cpp
===================================================================
--- /Samples/Compositor/src/Compositor.cpp	(revision 5)
+++ /Samples/Compositor/src/Compositor.cpp	(revision 5)
@@ -0,0 +1,552 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file
+        Compositor.cpp
+    \brief
+        Shows OGRE's Compositor feature
+	\author
+		W.J. :wumpus: van der Laan
+			Ogre composition framework
+		Manuel Bua
+			Postfilter ideas and original out-of-core implementation
+        Jeff (nfz) Doyle
+            added gui framework to demo
+*/
+
+#include <Ogre.h>
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+
+#include "Compositor.h"
+#include "CompositorDemo_FrameListener.h"
+
+/**********************************************************************
+OS X Specific Resource Location Finding
+**********************************************************************/
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+
+Ogre::String bundlePath()
+{
+    char path[1024];
+    CFBundleRef mainBundle = CFBundleGetMainBundle();
+    assert(mainBundle);
+    
+    CFURLRef mainBundleURL = CFBundleCopyBundleURL( mainBundle);
+    assert(mainBundleURL);
+    
+    CFStringRef cfStringRef = CFURLCopyFileSystemPath( mainBundleURL, kCFURLPOSIXPathStyle);
+    assert(cfStringRef);
+    
+    CFStringGetCString(cfStringRef, path, 1024, kCFStringEncodingASCII);
+    
+    CFRelease(mainBundleURL);
+    CFRelease(cfStringRef);
+    
+    return Ogre::String(path);
+}
+
+#endif
+
+/*************************************************************************
+	                    CompositorDemo Methods
+*************************************************************************/
+    CompositorDemo::~CompositorDemo()
+    {
+        delete mGUISystem;
+        delete mGUIRenderer;
+        delete mFrameListener;
+
+        delete mRoot;
+    }
+
+//--------------------------------------------------------------------------
+    void CompositorDemo::go(void)
+    {
+        if (!setup())
+            return;
+
+        mRoot->startRendering();
+    }
+
+//--------------------------------------------------------------------------
+    bool CompositorDemo::setup(void)
+    {
+		#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+            Ogre::String mResourcePath;
+            mResourcePath = bundlePath() + "/Contents/Resources/";
+            mRoot = new Ogre::Root(mResourcePath + "plugins.cfg", 
+                               mResourcePath + "ogre.cfg", mResourcePath + "Ogre.log");
+        #else
+		
+			mRoot = new Ogre::Root();
+		
+		#endif
+
+        setupResources();
+        bool carryOn = configure();
+        if (!carryOn) return false;
+
+        chooseSceneManager();
+        createCamera();
+        createViewports();
+
+        // Set default mipmap level (NB some APIs ignore this)
+        Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
+        loadResources();
+
+        // Create the scene
+        createScene();
+
+        createFrameListener();
+
+        // load some GUI stuff for demo.
+        //loadAllMaterialControlFiles(mMaterialControlsContainer);
+
+        return true;
+
+    }
+
+//--------------------------------------------------------------------------
+    bool CompositorDemo::configure(void)
+    {
+        // Show the configuration dialog and initialise the system
+        // You can skip this and use root.restoreConfig() to load configuration
+        // settings if you were sure there are valid ones saved in ogre.cfg
+        if(mRoot->showConfigDialog())
+        {
+            // If returned true, user clicked OK so initialise
+            // Here we choose to let the system create a default rendering window by passing 'true'
+            mWindow = mRoot->initialise(true);
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+//--------------------------------------------------------------------------
+    void CompositorDemo::chooseSceneManager(void)
+    {
+        // Get the SceneManager, in this case a generic one
+        mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC, "ExampleSMInstance");
+    }
+
+//--------------------------------------------------------------------------
+    void CompositorDemo::createCamera(void)
+    {
+        // Create the camera
+        mCamera = mSceneMgr->createCamera("PlayerCam");
+
+        // Position it at 500 in Z direction
+        mCamera->setPosition(Ogre::Vector3(0,0,0));
+        // Look back along -Z
+        mCamera->lookAt(Ogre::Vector3(0,0,-300));
+        mCamera->setNearClipDistance(1);
+
+    }
+
+//--------------------------------------------------------------------------
+void CompositorDemo::createViewports(void)
+{
+    // Create one viewport, entire window
+    Ogre::Viewport* vp = mWindow->addViewport(mCamera);
+    vp->setBackgroundColour(Ogre::ColourValue(0,0,0));
+
+    // Alter the camera aspect ratio to match the viewport
+    mCamera->setAspectRatio(
+        Ogre::Real(vp->getActualWidth()) / Ogre::Real(vp->getActualHeight()));
+}
+
+//--------------------------------------------------------------------------
+    void CompositorDemo::setupResources(void)
+    {
+        // Load resource paths from config file
+        Ogre::ConfigFile cf;
+		
+		#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+                Ogre::String mResourcePath;
+                mResourcePath = bundlePath() + "/Contents/Resources/";
+                cf.load(mResourcePath + "resources.cfg");
+        #else
+		
+			cf.load("resources.cfg");
+		
+		#endif
+
+        // Go through all sections & settings in the file
+        Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
+
+        Ogre::String secName, typeName, archName;
+        while (seci.hasMoreElements())
+        {
+            secName = seci.peekNextKey();
+            Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
+            Ogre::ConfigFile::SettingsMultiMap::iterator i;
+            for (i = settings->begin(); i != settings->end(); ++i)
+            {
+                typeName = i->first;
+                archName = i->second;
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+                // OS X does not set the working directory relative to the app,
+                // In order to make things portable on OS X we need to provide
+                // the loading with it's own bundle path location
+                Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
+                    Ogre::String(bundlePath() + "/" + archName), typeName, secName);
+#else
+                Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
+                    archName, typeName, secName);
+#endif
+
+            }
+        }
+
+        Ogre::LogManager::getSingleton().logMessage( "Resource directories setup" );
+
+    }
+
+//-----------------------------------------------------------------------------------
+	void CompositorDemo::loadResources(void)
+	{
+		// Initialise, parse all scripts etc
+        Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+
+	}
+
+//-----------------------------------------------------------------------------------
+    void CompositorDemo::createScene(void)
+    {
+		mSceneMgr->setShadowTechnique(Ogre::SHADOWTYPE_TEXTURE_MODULATIVE);
+		mSceneMgr->setShadowFarDistance(1000);
+        // setup GUI system
+        mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr);
+        // load scheme and set up defaults
+        mGUISystem = new CEGUI::System(mGUIRenderer, (CEGUI::ResourceProvider *)0, (CEGUI::XMLParser*)0,
+            (CEGUI::ScriptModule*)0, (CEGUI::utf8*)"CompositorDemoCegui.config");
+        CEGUI::System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow");
+
+		Ogre::MovableObject::setDefaultVisibilityFlags(0x00000001);
+
+		// Set ambient light
+		mSceneMgr->setAmbientLight(Ogre::ColourValue(0.3, 0.3, 0.2));
+
+		Ogre::Light* l = mSceneMgr->createLight("Light2");
+		Ogre::Vector3 dir(-1,-1,0);
+		dir.normalise();
+		l->setType(Ogre::Light::LT_DIRECTIONAL);
+		l->setDirection(dir);
+		l->setDiffuseColour(1, 1, 0.8);
+		l->setSpecularColour(1, 1, 1);
+
+
+		Ogre::Entity* pEnt;
+
+		// House
+		pEnt = mSceneMgr->createEntity( "1", "tudorhouse.mesh" );
+		Ogre::SceneNode* n1 = mSceneMgr->getRootSceneNode()->createChildSceneNode(Ogre::Vector3(350, 450, -200));
+		n1->attachObject( pEnt );
+
+		pEnt = mSceneMgr->createEntity( "2", "tudorhouse.mesh" );
+		Ogre::SceneNode* n2 = mSceneMgr->getRootSceneNode()->createChildSceneNode(Ogre::Vector3(-350, 450, -200));
+		n2->attachObject( pEnt );
+
+		pEnt = mSceneMgr->createEntity( "3", "knot.mesh" );
+		mSpinny = mSceneMgr->getRootSceneNode()->createChildSceneNode(Ogre::Vector3(0, 0, 300));
+		mSpinny->attachObject( pEnt );
+		pEnt->setMaterialName("Examples/MorningCubeMap");
+
+		mSceneMgr->setSkyBox(true, "Examples/MorningSkyBox");
+
+
+		Ogre::Plane plane;
+		plane.normal = Ogre::Vector3::UNIT_Y;
+		plane.d = 100;
+		Ogre::MeshManager::getSingleton().createPlane("Myplane",
+			Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			1500, 1500, 10, 10, true, 1, 5, 5, Ogre::Vector3::UNIT_Z);
+		Ogre::Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("Examples/Rockwall");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+		mCamera->setPosition(-400, 50, 900);
+		mCamera->lookAt(0,80,0);
+
+        connectEventHandlers();
+		/// Create a couple of hard coded postfilter effects as an example of how to do it
+		/// but the preferred method is to use compositor scripts.
+		createEffects();
+    }
+//-----------------------------------------------------------------------------------
+    void CompositorDemo::createFrameListener(void)
+    {
+        mFrameListener = new CompositorDemo_FrameListener(this);
+		mFrameListener->setSpinningNode(mSpinny);
+
+    }
+//--------------------------------------------------------------------------
+    void CompositorDemo::connectEventHandlers(void)
+    {
+        CEGUI::WindowManager::getSingleton().getWindow("ExitDemoBtn")->
+            subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&CompositorDemo::handleQuit, this));
+    }
+
+//-----------------------------------------------------------------------------------
+	/// Create the hard coded postfilter effects
+	void CompositorDemo::createEffects(void)
+	{
+	    // Bloom compositor is loaded from script but here is the hard coded equivalent
+//		CompositorPtr comp = CompositorManager::getSingleton().create(
+//				"Bloom", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
+//			);
+//		{
+//			CompositionTechnique *t = comp->createTechnique();
+//			{
+//				CompositionTechnique::TextureDefinition *def = t->createTextureDefinition("rt0");
+//				def->width = 128;
+//				def->height = 128;
+//				def->format = PF_A8R8G8B8;
+//			}
+//			{
+//				CompositionTechnique::TextureDefinition *def = t->createTextureDefinition("rt1");
+//				def->width = 128;
+//				def->height = 128;
+//				def->format = PF_A8R8G8B8;
+//			}
+//			{
+//				CompositionTargetPass *tp = t->createTargetPass();
+//				tp->setInputMode(CompositionTargetPass::IM_PREVIOUS);
+//				tp->setOutputName("rt1");
+//			}
+//			{
+//				CompositionTargetPass *tp = t->createTargetPass();
+//				tp->setInputMode(CompositionTargetPass::IM_NONE);
+//				tp->setOutputName("rt0");
+//				CompositionPass *pass = tp->createPass();
+//				pass->setType(CompositionPass::PT_RENDERQUAD);
+//				pass->setMaterialName("Ogre/Compositor/Blur0");
+//				pass->setInput(0, "rt1");
+//			}
+//			{
+//				CompositionTargetPass *tp = t->createTargetPass();
+//				tp->setInputMode(CompositionTargetPass::IM_NONE);
+//				tp->setOutputName("rt1");
+//				CompositionPass *pass = tp->createPass();
+//				pass->setType(CompositionPass::PT_RENDERQUAD);
+//				pass->setMaterialName("Ogre/Compositor/Blur1");
+//				pass->setInput(0, "rt0");
+//			}
+//			{
+//				CompositionTargetPass *tp = t->getOutputTargetPass();
+//				tp->setInputMode(CompositionTargetPass::IM_PREVIOUS);
+//				{ CompositionPass *pass = tp->createPass();
+//				pass->setType(CompositionPass::PT_RENDERQUAD);
+//				pass->setMaterialName("Ogre/Compositor/BloomBlend");
+//				pass->setInput(0, "rt1");
+//				}
+//			}
+//		}
+	    // Glass compositor is loaded from script but here is the hard coded equivalent
+		/// Glass effect
+//		CompositorPtr comp2 = CompositorManager::getSingleton().create(
+//				"Glass", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
+//			);
+//		{
+//			CompositionTechnique *t = comp2->createTechnique();
+//			{
+//				CompositionTechnique::TextureDefinition *def = t->createTextureDefinition("rt0");
+//				def->width = 0;
+//				def->height = 0;
+//				def->format = PF_R8G8B8;
+//			}
+//			{
+//				CompositionTargetPass *tp = t->createTargetPass();
+//				tp->setInputMode(CompositionTargetPass::IM_PREVIOUS);
+//				tp->setOutputName("rt0");
+//			}
+//			{
+//				CompositionTargetPass *tp = t->getOutputTargetPass();
+//				tp->setInputMode(CompositionTargetPass::IM_NONE);
+//				{ CompositionPass *pass = tp->createPass();
+//				pass->setType(CompositionPass::PT_RENDERQUAD);
+//				pass->setMaterialName("Ogre/Compositor/GlassPass");
+//				pass->setInput(0, "rt0");
+//				}
+//			}
+//		}
+		/// Motion blur effect
+		Ogre::CompositorPtr comp3 = Ogre::CompositorManager::getSingleton().create(
+				"Motion Blur", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
+			);
+		{
+			Ogre::CompositionTechnique *t = comp3->createTechnique();
+			{
+				Ogre::CompositionTechnique::TextureDefinition *def = t->createTextureDefinition("scene");
+				def->width = 0;
+				def->height = 0;
+				def->format = Ogre::PF_R8G8B8;
+			}
+			{
+				Ogre::CompositionTechnique::TextureDefinition *def = t->createTextureDefinition("sum");
+				def->width = 0;
+				def->height = 0;
+				def->format = Ogre::PF_R8G8B8;
+			}
+			{
+				Ogre::CompositionTechnique::TextureDefinition *def = t->createTextureDefinition("temp");
+				def->width = 0;
+				def->height = 0;
+				def->format = Ogre::PF_R8G8B8;
+			}
+			/// Render scene
+			{
+				Ogre::CompositionTargetPass *tp = t->createTargetPass();
+				tp->setInputMode(Ogre::CompositionTargetPass::IM_PREVIOUS);
+				tp->setOutputName("scene");
+			}
+			/// Initialisation pass for sum texture
+			{
+				Ogre::CompositionTargetPass *tp = t->createTargetPass();
+				tp->setInputMode(Ogre::CompositionTargetPass::IM_PREVIOUS);
+				tp->setOutputName("sum");
+				tp->setOnlyInitial(true);
+			}
+			/// Do the motion blur
+			{
+				Ogre::CompositionTargetPass *tp = t->createTargetPass();
+				tp->setInputMode(Ogre::CompositionTargetPass::IM_NONE);
+				tp->setOutputName("temp");
+				{ Ogre::CompositionPass *pass = tp->createPass();
+				pass->setType(Ogre::CompositionPass::PT_RENDERQUAD);
+				pass->setMaterialName("Ogre/Compositor/Combine");
+				pass->setInput(0, "scene");
+				pass->setInput(1, "sum");
+				}
+			}
+			/// Copy back sum texture
+			{
+				Ogre::CompositionTargetPass *tp = t->createTargetPass();
+				tp->setInputMode(Ogre::CompositionTargetPass::IM_NONE);
+				tp->setOutputName("sum");
+				{ Ogre::CompositionPass *pass = tp->createPass();
+				pass->setType(Ogre::CompositionPass::PT_RENDERQUAD);
+				pass->setMaterialName("Ogre/Compositor/Copyback");
+				pass->setInput(0, "temp");
+				}
+			}
+			/// Display result
+			{
+				Ogre::CompositionTargetPass *tp = t->getOutputTargetPass();
+				tp->setInputMode(Ogre::CompositionTargetPass::IM_NONE);
+				{ Ogre::CompositionPass *pass = tp->createPass();
+				pass->setType(Ogre::CompositionPass::PT_RENDERQUAD);
+				pass->setMaterialName("Ogre/Compositor/MotionBlur");
+				pass->setInput(0, "sum");
+				}
+			}
+		}
+		/// Heat vision effect
+		Ogre::CompositorPtr comp4 = Ogre::CompositorManager::getSingleton().create(
+				"Heat Vision", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
+			);
+		{
+			Ogre::CompositionTechnique *t = comp4->createTechnique();
+			{
+				Ogre::CompositionTechnique::TextureDefinition *def = t->createTextureDefinition("scene");
+				def->width = 256;
+				def->height = 256;
+				def->format = Ogre::PF_R8G8B8;
+			}
+			{
+				Ogre::CompositionTechnique::TextureDefinition *def = t->createTextureDefinition("temp");
+				def->width = 256;
+				def->height = 256;
+				def->format = Ogre::PF_R8G8B8;
+			}
+			/// Render scene
+			{
+				Ogre::CompositionTargetPass *tp = t->createTargetPass();
+				tp->setInputMode(Ogre::CompositionTargetPass::IM_PREVIOUS);
+				tp->setOutputName("scene");
+			}
+			/// Light to heat pass
+			{
+				Ogre::CompositionTargetPass *tp = t->createTargetPass();
+				tp->setInputMode(Ogre::CompositionTargetPass::IM_NONE);
+				tp->setOutputName("temp");
+				{
+					Ogre::CompositionPass *pass = tp->createPass();
+					pass->setType(Ogre::CompositionPass::PT_RENDERQUAD);
+					pass->setIdentifier(0xDEADBABE); /// Identify pass for use in listener
+					pass->setMaterialName("Fury/HeatVision/LightToHeat");
+					pass->setInput(0, "scene");
+				}
+			}
+			/// Display result
+			{
+				Ogre::CompositionTargetPass *tp = t->getOutputTargetPass();
+				tp->setInputMode(Ogre::CompositionTargetPass::IM_NONE);
+				{
+					Ogre::CompositionPass *pass = tp->createPass();
+					pass->setType(Ogre::CompositionPass::PT_RENDERQUAD);
+					pass->setMaterialName("Fury/HeatVision/Blur");
+					pass->setInput(0, "temp");
+				}
+			}
+		}
+	}
+//--------------------------------------------------------------------------
+    bool CompositorDemo::handleQuit(const CEGUI::EventArgs& e)
+    {
+        mRoot->queueEndRendering();
+        return true;
+    }
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+	INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+	int main(int argc, char *argv[])
+#endif
+{
+   // Create application object
+    CompositorDemo app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/Compositor/src/CompositorDemo_FrameListener.cpp
===================================================================
--- /Samples/Compositor/src/CompositorDemo_FrameListener.cpp	(revision 5)
+++ /Samples/Compositor/src/CompositorDemo_FrameListener.cpp	(revision 5)
@@ -0,0 +1,849 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+#include <Ogre.h>
+#include <OgreTimer.h>
+#include <CEGUI/CEGUIPropertyHelper.h>
+
+#include "CompositorDemo_FrameListener.h"
+#include "Compositor.h"
+
+/*************************************************************************
+	                    HeatVisionListener Methods
+*************************************************************************/
+//---------------------------------------------------------------------------
+    HeatVisionListener::HeatVisionListener()
+    {
+		timer = new Ogre::Timer();
+        start = end = curr = 0.0f;
+    }
+//---------------------------------------------------------------------------
+    HeatVisionListener::~HeatVisionListener()
+    {
+       delete timer;
+    }
+//---------------------------------------------------------------------------
+    void HeatVisionListener::notifyMaterialSetup(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat)
+    {
+        if(pass_id == 0xDEADBABE)
+        {
+            timer->reset();
+            fpParams =
+                mat->getTechnique(0)->getPass(0)->getFragmentProgramParameters();
+        }
+    }
+//---------------------------------------------------------------------------
+    void HeatVisionListener::notifyMaterialRender(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat)
+    {
+        if(pass_id == 0xDEADBABE)
+        {
+            // "random_fractions" parameter
+            fpParams->setNamedConstant("random_fractions", Ogre::Vector4(Ogre::Math::RangeRandom(0.0, 1.0), Ogre::Math::RangeRandom(0, 1.0), 0, 0));
+
+            // "depth_modulator" parameter
+            float inc = ((float)timer->getMilliseconds())/1000.0f;
+            if ( (fabs(curr-end) <= 0.001) ) {
+                // take a new value to reach
+                end = Ogre::Math::RangeRandom(0.95, 1.0);
+                start = curr;
+            } else {
+                if (curr > end) curr -= inc;
+                else curr += inc;
+            }
+            timer->reset();
+
+            fpParams->setNamedConstant("depth_modulator", Ogre::Vector4(curr, 0, 0, 0));
+        }
+    }
+//---------------------------------------------------------------------------
+
+	/*************************************************************************
+	HDRListener Methods
+	*************************************************************************/
+	//---------------------------------------------------------------------------
+	HDRListener::HDRListener()
+	{
+	}
+	//---------------------------------------------------------------------------
+	HDRListener::~HDRListener()
+	{
+	}
+	//---------------------------------------------------------------------------
+	void HDRListener::notifyViewportSize(int width, int height)
+	{
+		mVpWidth = width;
+		mVpHeight = height;
+	}
+	//---------------------------------------------------------------------------
+	void HDRListener::notifyCompositor(Ogre::CompositorInstance* instance)
+	{
+		// Get some RTT dimensions for later calculations
+		Ogre::CompositionTechnique::TextureDefinitionIterator defIter =
+			instance->getTechnique()->getTextureDefinitionIterator();
+		while (defIter.hasMoreElements())
+		{
+			Ogre::CompositionTechnique::TextureDefinition* def =
+				defIter.getNext();
+			if(def->name == "rt_bloom0")
+			{
+				mBloomSize = (int)def->width; // should be square
+				// Calculate gaussian texture offsets & weights
+				float deviation = 3.0f;
+				float texelSize = 1.0f / (float)mBloomSize;
+
+				// central sample, no offset
+				mBloomTexOffsetsHorz[0][0] = 0.0f;
+				mBloomTexOffsetsHorz[0][1] = 0.0f;
+				mBloomTexOffsetsVert[0][0] = 0.0f;
+				mBloomTexOffsetsVert[0][1] = 0.0f;
+				mBloomTexWeights[0][0] = mBloomTexWeights[0][1] =
+					mBloomTexWeights[0][2] = Ogre::Math::gaussianDistribution(0, 0, deviation);
+				mBloomTexWeights[0][3] = 1.0f;
+
+				// 'pre' samples
+				for(int i = 1; i < 8; ++i)
+				{
+					mBloomTexWeights[i][0] = mBloomTexWeights[i][1] =
+						mBloomTexWeights[i][2] = 1.25f * Ogre::Math::gaussianDistribution(i, 0, deviation);
+					mBloomTexWeights[i][3] = 1.0f;
+					mBloomTexOffsetsHorz[i][0] = i * texelSize;
+					mBloomTexOffsetsHorz[i][1] = 0.0f;
+					mBloomTexOffsetsVert[i][0] = 0.0f;
+					mBloomTexOffsetsVert[i][1] = i * texelSize;
+				}
+				// 'post' samples
+				for(int i = 8; i < 15; ++i)
+				{
+					mBloomTexWeights[i][0] = mBloomTexWeights[i][1] =
+						mBloomTexWeights[i][2] = mBloomTexWeights[i - 7][0];
+					mBloomTexWeights[i][3] = 1.0f;
+
+					mBloomTexOffsetsHorz[i][0] = -mBloomTexOffsetsHorz[i - 7][0];
+					mBloomTexOffsetsHorz[i][1] = 0.0f;
+					mBloomTexOffsetsVert[i][0] = 0.0f;
+					mBloomTexOffsetsVert[i][1] = -mBloomTexOffsetsVert[i - 7][1];
+				}
+
+			}
+		}
+	}
+	//---------------------------------------------------------------------------
+	void HDRListener::notifyMaterialSetup(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat)
+	{
+		// Prepare the fragment params offsets
+		switch(pass_id)
+		{
+		//case 994: // rt_lum4
+		case 993: // rt_lum3
+		case 992: // rt_lum2
+		case 991: // rt_lum1
+		case 990: // rt_lum0
+			break;
+		case 800: // rt_brightpass
+			break;
+		case 701: // rt_bloom1
+			{
+				// horizontal bloom
+				mat->load();
+				Ogre::GpuProgramParametersSharedPtr fparams =
+					mat->getBestTechnique()->getPass(0)->getFragmentProgramParameters();
+				const Ogre::String& progName = mat->getBestTechnique()->getPass(0)->getFragmentProgramName();
+				fparams->setNamedConstant("sampleOffsets", mBloomTexOffsetsHorz[0], 15);
+				fparams->setNamedConstant("sampleWeights", mBloomTexWeights[0], 15);
+
+				break;
+			}
+		case 700: // rt_bloom0
+			{
+				// vertical bloom
+				mat->load();
+				Ogre::GpuProgramParametersSharedPtr fparams =
+					mat->getTechnique(0)->getPass(0)->getFragmentProgramParameters();
+				const Ogre::String& progName = mat->getBestTechnique()->getPass(0)->getFragmentProgramName();
+				fparams->setNamedConstant("sampleOffsets", mBloomTexOffsetsVert[0], 15);
+				fparams->setNamedConstant("sampleWeights", mBloomTexWeights[0], 15);
+
+				break;
+			}
+		}
+	}
+	//---------------------------------------------------------------------------
+	void HDRListener::notifyMaterialRender(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat)
+	{
+	}
+	//---------------------------------------------------------------------------
+
+
+	/*************************************************************************
+	GaussianListener Methods
+	*************************************************************************/
+	//---------------------------------------------------------------------------
+	GaussianListener::GaussianListener()
+	{
+	}
+	//---------------------------------------------------------------------------
+	GaussianListener::~GaussianListener()
+	{
+	}
+	//---------------------------------------------------------------------------
+	void GaussianListener::notifyViewportSize(int width, int height)
+	{
+		mVpWidth = width;
+		mVpHeight = height;
+		// Calculate gaussian texture offsets & weights
+		float deviation = 3.0f;
+		float texelSize = 1.0f / (float)std::min(mVpWidth, mVpHeight);
+
+		// central sample, no offset
+		mBloomTexOffsetsHorz[0][0] = 0.0f;
+		mBloomTexOffsetsHorz[0][1] = 0.0f;
+		mBloomTexOffsetsVert[0][0] = 0.0f;
+		mBloomTexOffsetsVert[0][1] = 0.0f;
+		mBloomTexWeights[0][0] = mBloomTexWeights[0][1] =
+			mBloomTexWeights[0][2] = Ogre::Math::gaussianDistribution(0, 0, deviation);
+		mBloomTexWeights[0][3] = 1.0f;
+
+		// 'pre' samples
+		for(int i = 1; i < 8; ++i)
+		{
+			mBloomTexWeights[i][0] = mBloomTexWeights[i][1] =
+				mBloomTexWeights[i][2] = Ogre::Math::gaussianDistribution(i, 0, deviation);
+			mBloomTexWeights[i][3] = 1.0f;
+			mBloomTexOffsetsHorz[i][0] = i * texelSize;
+			mBloomTexOffsetsHorz[i][1] = 0.0f;
+			mBloomTexOffsetsVert[i][0] = 0.0f;
+			mBloomTexOffsetsVert[i][1] = i * texelSize;
+		}
+		// 'post' samples
+		for(int i = 8; i < 15; ++i)
+		{
+			mBloomTexWeights[i][0] = mBloomTexWeights[i][1] =
+				mBloomTexWeights[i][2] = mBloomTexWeights[i - 7][0];
+			mBloomTexWeights[i][3] = 1.0f;
+
+			mBloomTexOffsetsHorz[i][0] = -mBloomTexOffsetsHorz[i - 7][0];
+			mBloomTexOffsetsHorz[i][1] = 0.0f;
+			mBloomTexOffsetsVert[i][0] = 0.0f;
+			mBloomTexOffsetsVert[i][1] = -mBloomTexOffsetsVert[i - 7][1];
+		}
+	}
+	//---------------------------------------------------------------------------
+	void GaussianListener::notifyMaterialSetup(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat)
+	{
+		// Prepare the fragment params offsets
+		switch(pass_id)
+		{
+		case 701: // blur horz
+			{
+				// horizontal bloom
+				mat->load();
+				Ogre::GpuProgramParametersSharedPtr fparams =
+					mat->getBestTechnique()->getPass(0)->getFragmentProgramParameters();
+				const Ogre::String& progName = mat->getBestTechnique()->getPass(0)->getFragmentProgramName();
+				fparams->setNamedConstant("sampleOffsets", mBloomTexOffsetsHorz[0], 15);
+				fparams->setNamedConstant("sampleWeights", mBloomTexWeights[0], 15);
+
+				break;
+			}
+		case 700: // blur vert
+			{
+				// vertical bloom
+				mat->load();
+				Ogre::GpuProgramParametersSharedPtr fparams =
+					mat->getTechnique(0)->getPass(0)->getFragmentProgramParameters();
+				const Ogre::String& progName = mat->getBestTechnique()->getPass(0)->getFragmentProgramName();
+				fparams->setNamedConstant("sampleOffsets", mBloomTexOffsetsVert[0], 15);
+				fparams->setNamedConstant("sampleWeights", mBloomTexWeights[0], 15);
+
+				break;
+			}
+		}
+	}
+	//---------------------------------------------------------------------------
+	void GaussianListener::notifyMaterialRender(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat)
+	{
+	}
+	//---------------------------------------------------------------------------
+
+/*************************************************************************
+	CompositorDemo_FrameListener methods that handle all input for this Compositor demo.
+*************************************************************************/
+
+    CompositorDemo_FrameListener::CompositorDemo_FrameListener(CompositorDemo* main)
+        : mMain(main)
+        , hvListener(0)
+		, hdrListener(0)
+		, gaussianListener(0)
+        , mTranslateVector(Ogre::Vector3::ZERO)
+        , mStatsOn(true)
+        , mNumScreenShots(0)
+        , mWriteToFile(false)
+        , mSkipCount(0)
+        , mUpdateFreq(50)
+        , mSceneDetailIndex(0)
+        , mFiltering(Ogre::TFO_BILINEAR)
+        , mAniso(1)
+        , mQuit(false)
+        , mMoveScale(0.0f)
+        , mRotScale(0.0f)
+        , mSpeed(MINSPEED)
+        , mAvgFrameTime(0.1)
+        , mMoveSpeed(100)
+        , mRotateSpeed(0)
+        , mLastMousePositionSet(false)
+        , mTimeUntilNextToggle(0)
+        , mRotX(0)
+        , mRotY(0)
+        , mProcessMovement(false)
+        , mUpdateMovement(false)
+
+        , mLMBDown(false)
+        , mRMBDown(false)
+        , mMoveFwd(false)
+        , mMoveBck(false)
+        , mMoveLeft(false)
+        , mMoveRight(false)
+		, mSpinny(0)
+        , mCompositorSelectorViewManager(0)
+		, mMouse(0)
+		, mKeyboard(0)
+
+    {
+
+        Ogre::Root::getSingleton().addFrameListener(this);
+
+        // using buffered input
+		OIS::ParamList pl;
+		size_t windowHnd = 0;
+		std::ostringstream windowHndStr;
+
+		mMain->getRenderWindow()->getCustomAttribute("WINDOW", &windowHnd);
+		windowHndStr << windowHnd;
+		pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
+
+		mInputManager = OIS::InputManager::createInputSystem( pl );
+
+		//Create all devices (We only catch joystick exceptions here, as, most people have Key/Mouse)
+		mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, true ));
+		mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, true ));
+
+		unsigned int width, height, depth;
+		int left, top;
+		mMain->getRenderWindow()->getMetrics(width, height, depth, left, top);
+
+		//Set Mouse Region.. if window resizes, we should alter this to reflect as well
+		const OIS::MouseState &ms = mMouse->getMouseState();
+		ms.width = width;
+		ms.height = height;
+
+		mMouse->setEventCallback(this);
+		mKeyboard->setEventCallback(this);
+
+        mGuiRenderer = CEGUI::System::getSingleton().getRenderer();
+
+        mGuiAvg   = CEGUI::WindowManager::getSingleton().getWindow("OPAverageFPS");
+        mGuiCurr  = CEGUI::WindowManager::getSingleton().getWindow("OPCurrentFPS");
+        mGuiBest  = CEGUI::WindowManager::getSingleton().getWindow("OPBestFPS");
+        mGuiWorst = CEGUI::WindowManager::getSingleton().getWindow("OPWorstFPS");
+        mGuiTris  = CEGUI::WindowManager::getSingleton().getWindow("OPTriCount");
+        mGuiDbg   = CEGUI::WindowManager::getSingleton().getWindow("OPDebugMsg");
+        mRoot	  = CEGUI::WindowManager::getSingleton().getWindow("root");
+
+        registerCompositors();
+		initDebugRTTWindow();
+        connectEventHandlers();
+    }
+//--------------------------------------------------------------------------
+    CompositorDemo_FrameListener::~CompositorDemo_FrameListener()
+    {
+		if(mInputManager)
+		{
+			mInputManager->destroyInputObject(mKeyboard);
+			mInputManager->destroyInputObject(mMouse);
+			OIS::InputManager::destroyInputSystem(mInputManager);
+			mInputManager = 0;
+		}
+
+        delete hvListener;
+		delete hdrListener;
+		delete gaussianListener;
+        delete mCompositorSelectorViewManager;
+    }
+//--------------------------------------------------------------------------
+    void CompositorDemo_FrameListener::connectEventHandlers(void)
+    {
+        CEGUI::Window* wndw = CEGUI::WindowManager::getSingleton().getWindow("root");
+
+        wndw->subscribeEvent(CEGUI::Window::EventMouseMove, CEGUI::Event::Subscriber(&CompositorDemo_FrameListener::handleMouseMove, this));
+
+        wndw->subscribeEvent(CEGUI::Window::EventMouseButtonUp, CEGUI::Event::Subscriber(&CompositorDemo_FrameListener::handleMouseButtonUp, this));
+
+        wndw->subscribeEvent(CEGUI::Window::EventMouseButtonDown, CEGUI::Event::Subscriber(&CompositorDemo_FrameListener::handleMouseButtonDown, this));
+
+        wndw->subscribeEvent(CEGUI::Window::EventMouseWheel, CEGUI::Event::Subscriber(&CompositorDemo_FrameListener::handleMouseWheelEvent, this));
+        wndw->subscribeEvent(CEGUI::Window::EventKeyDown, CEGUI::Event::Subscriber(&CompositorDemo_FrameListener::handleKeyDownEvent, this ));
+        wndw->subscribeEvent(CEGUI::Window::EventKeyUp, CEGUI::Event::Subscriber(&CompositorDemo_FrameListener::handleKeyUpEvent, this ));
+    }
+//--------------------------------------------------------------------------
+    bool CompositorDemo_FrameListener::frameStarted(const Ogre::FrameEvent& evt)
+    {
+	mMouse->capture();
+	mKeyboard->capture();
+
+	if( mMain->getRenderWindow()->isClosed() )
+		return false;
+
+        if (mQuit)
+            return false;
+        else
+        {
+            mSkipCount++;
+            if (mSkipCount >= mUpdateFreq)
+            {
+                mSkipCount = 0;
+                updateStats();
+            }
+            // update movement process
+            if(mProcessMovement || mUpdateMovement)
+            {
+                mTranslateVector.x += mMoveLeft ? mAvgFrameTime * -MOVESPEED : 0;
+                mTranslateVector.x += mMoveRight ? mAvgFrameTime * MOVESPEED : 0;
+                mTranslateVector.z += mMoveFwd ? mAvgFrameTime * -MOVESPEED : 0;
+                mTranslateVector.z += mMoveBck ? mAvgFrameTime * MOVESPEED : 0;
+
+                mMain->getCamera()->yaw(Ogre::Angle(mRotX));
+                mMain->getCamera()->pitch(Ogre::Angle(mRotY));
+                mMain->getCamera()->moveRelative(mTranslateVector);
+
+                mUpdateMovement = false;
+                mRotX = 0;
+                mRotY = 0;
+                mTranslateVector = Ogre::Vector3::ZERO;
+            }
+
+            if(mWriteToFile)
+            {
+                mMain->getRenderWindow()->writeContentsToFile("frame_" +
+                    Ogre::StringConverter::toString(++mNumScreenShots) + ".png");
+            }
+
+			if (mSpinny)
+				mSpinny->yaw(Ogre::Degree(10 * evt.timeSinceLastFrame));
+
+            return true;
+        }
+    }
+
+//--------------------------------------------------------------------------
+    bool CompositorDemo_FrameListener::mouseMoved (const OIS::MouseEvent &e)
+    {
+        CEGUI::System::getSingleton().injectMouseMove( e.state.X.rel, e.state.Y.rel );
+		CEGUI::System::getSingleton().injectMouseWheelChange(e.state.Z.rel);
+		return true;
+    }
+
+//--------------------------------------------------------------------------
+	bool CompositorDemo_FrameListener::keyPressed (const OIS::KeyEvent &e)
+    {
+        // give 'quitting' priority
+		if (e.key == OIS::KC_ESCAPE)
+        {
+            mQuit = true;
+            return false;
+        }
+
+		if (e.key == OIS::KC_V)
+			mMain->getRenderWindow()->getViewport(0)->setBackgroundColour(Ogre::ColourValue(0,1,0));
+
+        if (e.key == OIS::KC_SYSRQ )
+        {
+			std::ostringstream ss;
+            ss << "screenshot_" << ++mNumScreenShots << ".png";
+            mMain->getRenderWindow()->writeContentsToFile(ss.str());
+            mDebugText = "Saved: " + ss.str();
+			//mTimeUntilNextToggle = 0.5;
+        }
+
+        // do event injection
+        CEGUI::System& cegui = CEGUI::System::getSingleton();
+        cegui.injectKeyDown(e.key);
+		cegui.injectChar(e.text);
+		return true;
+    }
+
+//--------------------------------------------------------------------------
+    bool CompositorDemo_FrameListener::keyReleased (const OIS::KeyEvent &e)
+    {
+        CEGUI::System::getSingleton().injectKeyUp(e.key);
+		return true;
+    }
+
+//--------------------------------------------------------------------------
+	bool CompositorDemo_FrameListener::mousePressed (const OIS::MouseEvent &e, OIS::MouseButtonID id)
+    {
+        CEGUI::System::getSingleton().injectMouseButtonDown(convertOISButtonToCegui(id));
+		return true;
+	}
+
+//--------------------------------------------------------------------------
+	bool CompositorDemo_FrameListener::mouseReleased (const OIS::MouseEvent &e, OIS::MouseButtonID id)
+    {
+        CEGUI::System::getSingleton().injectMouseButtonUp(convertOISButtonToCegui(id));
+		return true;
+    }
+
+//--------------------------------------------------------------------------
+    CEGUI::MouseButton CompositorDemo_FrameListener::convertOISButtonToCegui(int ois_button_id)
+    {
+        switch (ois_button_id)
+		{
+		case 0: return CEGUI::LeftButton;
+		case 1: return CEGUI::RightButton;
+		case 2:	return CEGUI::MiddleButton;
+		case 3: return CEGUI::X1Button;
+		default: return CEGUI::LeftButton;
+		}
+    }
+
+//--------------------------------------------------------------------------
+    void CompositorDemo_FrameListener::updateStats(void)
+    {
+        static CEGUI::String currFps = "Current FPS: ";
+        static CEGUI::String avgFps = "Average FPS: ";
+        static CEGUI::String bestFps = "Best FPS: ";
+        static CEGUI::String worstFps = "Worst FPS: ";
+        static CEGUI::String tris = "Triangle Count: ";
+
+
+        const Ogre::RenderTarget::FrameStats& stats = mMain->getRenderWindow()->getStatistics();
+
+        mGuiAvg->setText(avgFps + Ogre::StringConverter::toString(stats.avgFPS));
+        mGuiCurr->setText(currFps + Ogre::StringConverter::toString(stats.lastFPS));
+        mGuiBest->setText(bestFps + Ogre::StringConverter::toString(stats.bestFPS)
+            + " " + Ogre::StringConverter::toString(stats.bestFrameTime)+" ms");
+        mGuiWorst->setText(worstFps + Ogre::StringConverter::toString(stats.worstFPS)
+            + " " + Ogre::StringConverter::toString(stats.worstFrameTime)+" ms");
+
+        mGuiTris->setText(tris + Ogre::StringConverter::toString(stats.triangleCount));
+        mGuiDbg->setText(mDebugText);
+        mAvgFrameTime = 1.0f/(stats.avgFPS + 1.0f);
+        if (mAvgFrameTime > 0.1f) mAvgFrameTime = 0.1f;
+
+    }
+
+
+//--------------------------------------------------------------------------
+    bool CompositorDemo_FrameListener::handleMouseMove(const CEGUI::EventArgs& e)
+    {
+        using namespace CEGUI;
+
+        if( mLMBDown && !mRMBDown)
+        {
+            // rotate camera
+            mRotX += -((const MouseEventArgs&)e).moveDelta.d_x * mAvgFrameTime * 10.0;
+            mRotY += -((const MouseEventArgs&)e).moveDelta.d_y * mAvgFrameTime * 10.0;
+            MouseCursor::getSingleton().setPosition( mLastMousePosition );
+            mUpdateMovement = true;
+        }
+        else
+        {
+            if( mRMBDown && !mLMBDown)
+            {
+                // translate camera
+                mTranslateVector.x += ((const MouseEventArgs&)e).moveDelta.d_x * mAvgFrameTime * MOVESPEED;
+                mTranslateVector.y += -((const MouseEventArgs&)e).moveDelta.d_y * mAvgFrameTime * MOVESPEED;
+                //mTranslateVector.z = 0;
+                MouseCursor::getSingleton().setPosition( mLastMousePosition );
+                mUpdateMovement = true;
+            }
+            else
+            {
+                if( mRMBDown && mLMBDown)
+                {
+                    mTranslateVector.z += (((const MouseEventArgs&)e).moveDelta.d_x + ((const MouseEventArgs&)e).moveDelta.d_y) * mAvgFrameTime * MOVESPEED;
+                    MouseCursor::getSingleton().setPosition( mLastMousePosition );
+                    mUpdateMovement = true;
+                }
+
+            }
+        }
+
+        return true;
+    }
+
+//--------------------------------------------------------------------------
+    bool CompositorDemo_FrameListener::handleMouseButtonUp(const CEGUI::EventArgs& e)
+    {
+        using namespace CEGUI;
+
+        //Window* wndw = ((const WindowEventArgs&)e).window;
+        if( ((const MouseEventArgs&)e).button == LeftButton )
+        {
+            mLMBDown = false;
+        }
+
+        if( ((const MouseEventArgs&)e).button == RightButton )
+        {
+            mRMBDown = false;
+        }
+        if( !mLMBDown && !mRMBDown )
+        {
+            MouseCursor::getSingleton().show();
+            if(mLastMousePositionSet)
+            {
+                MouseCursor::getSingleton().setPosition( mLastMousePosition );
+                mLastMousePositionSet = false;
+            }
+            mRoot->releaseInput();
+        }
+
+        return true;
+    }
+
+//--------------------------------------------------------------------------
+    bool CompositorDemo_FrameListener::handleMouseButtonDown(const CEGUI::EventArgs& e)
+    {
+        using namespace CEGUI;
+
+        //Window* wndw = ((const WindowEventArgs&)e).window;
+        if( ((const MouseEventArgs&)e).button == LeftButton )
+        {
+            mLMBDown = true;
+        }
+
+        if( ((const MouseEventArgs&)e).button == RightButton )
+        {
+            mRMBDown = true;
+        }
+
+        if( mLMBDown || mRMBDown )
+        {
+            MouseCursor::getSingleton().hide();
+            if (!mLastMousePositionSet)
+            {
+                mLastMousePosition = MouseCursor::getSingleton().getPosition();
+                mLastMousePositionSet = true;
+            }
+            mRoot->captureInput();
+        }
+
+        return true;
+    }
+
+//--------------------------------------------------------------------------
+    bool CompositorDemo_FrameListener::handleMouseWheelEvent(const CEGUI::EventArgs& e)
+    {
+        using namespace CEGUI;
+        mTranslateVector.z += ((const MouseEventArgs&)e).wheelChange * -5.0;
+        mUpdateMovement = true;
+
+        return true;
+    }
+
+//--------------------------------------------------------------------------
+    bool CompositorDemo_FrameListener::handleKeyDownEvent(const CEGUI::EventArgs& e)
+    {
+        using namespace CEGUI;
+
+        CheckMovementKeys( ((const KeyEventArgs&)e).scancode , true);
+
+        return true;
+    }
+
+//--------------------------------------------------------------------------
+    bool CompositorDemo_FrameListener::handleKeyUpEvent(const CEGUI::EventArgs& e)
+    {
+        using namespace CEGUI;
+        CheckMovementKeys( ((const KeyEventArgs&)e).scancode, false );
+
+        return true;
+    }
+
+//--------------------------------------------------------------------------
+    void CompositorDemo_FrameListener::CheckMovementKeys( CEGUI::Key::Scan scancode, bool state )
+    {
+        using namespace CEGUI;
+
+        switch ( scancode )
+        {
+            case Key::A:
+                mMoveLeft = state;
+                break;
+
+            case Key::D:
+                mMoveRight = state;
+                break;
+
+            case Key::S:
+                mMoveBck = state;
+                break;
+
+            case Key::W:
+                mMoveFwd = state;
+                break;
+
+            default:
+                break;
+
+        }
+
+        mProcessMovement = mMoveLeft || mMoveRight || mMoveFwd || mMoveBck;
+
+    }
+
+//-----------------------------------------------------------------------------------
+    void CompositorDemo_FrameListener::itemStateChanged(const size_t index, const bool state)
+    {
+        // get the item text and tell compositor manager to set enable state
+        Ogre::CompositorManager::getSingleton().setCompositorEnabled(mMain->getRenderWindow()->getViewport(0),
+            mCompositorSelectorViewManager->getItemSelectorText(index), state);
+		updateDebugRTTWindow();
+    }
+//-----------------------------------------------------------------------------------
+    void CompositorDemo_FrameListener::registerCompositors(void)
+    {
+        Ogre::Viewport *vp = mMain->getRenderWindow()->getViewport(0);
+        hvListener = new HeatVisionListener();
+		hdrListener = new HDRListener();
+		gaussianListener = new GaussianListener();
+
+        mCompositorSelectorViewManager = new ItemSelectorViewManager("CompositorSelectorWin");
+        // tell view manager to notify us when an item changes selection state
+        mCompositorSelectorViewManager->setItemSelectorController(this);
+        //iterate through Compositor Managers resources and add name keys ast Item selectors to Compositor selector view manager
+        Ogre::CompositorManager::ResourceMapIterator resourceIterator =
+            Ogre::CompositorManager::getSingleton().getResourceIterator();
+
+        // add all compositor resources to the view container
+        while (resourceIterator.hasMoreElements())
+        {
+            Ogre::ResourcePtr resource = resourceIterator.getNext();
+            const Ogre::String& compositorName = resource->getName();
+            // Don't add base Ogre/Scene compositor to view
+            if (compositorName == "Ogre/Scene")
+                continue;
+
+            mCompositorSelectorViewManager->addItemSelector(compositorName);
+			int addPosition = -1;
+			if (compositorName == "HDR")
+			{
+				// HDR must be first in the chain
+				addPosition = 0;
+			}
+            Ogre::CompositorInstance *instance = Ogre::CompositorManager::getSingleton().addCompositor(vp, compositorName, addPosition);
+            Ogre::CompositorManager::getSingleton().setCompositorEnabled(vp, compositorName, false);
+            // special handling for Heat Vision which uses a listener
+            if(instance && (compositorName == "Heat Vision"))
+                instance->addListener(hvListener);
+			else if(instance && (compositorName == "HDR"))
+			{
+				instance->addListener(hdrListener);
+				hdrListener->notifyViewportSize(vp->getActualWidth(), vp->getActualHeight());
+				hdrListener->notifyCompositor(instance);
+
+			}
+			else if(instance && (compositorName == "Gaussian Blur"))
+			{
+				instance->addListener(gaussianListener);
+				gaussianListener->notifyViewportSize(vp->getActualWidth(), vp->getActualHeight());
+			}
+        }
+    }
+	//---------------------------------------------------------------------
+	void CompositorDemo_FrameListener::initDebugRTTWindow(void)
+	{
+		mDebugRTTStaticImage = CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)"DebugRTTImage");
+		mDebugRTTListbox = static_cast<CEGUI::Listbox*>(
+			CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)"DebugRTTListbox"));
+		mDebugRTTListbox->subscribeEvent(CEGUI::Listbox::EventSelectionChanged,
+			CEGUI::Event::Subscriber(&CompositorDemo_FrameListener::handleRttSelection, this));
+	}
+	//---------------------------------------------------------------------
+	bool CompositorDemo_FrameListener::handleRttSelection(const CEGUI::EventArgs& e)
+	{
+		if (mDebugRTTListbox->getSelectedCount() > 0)
+		{
+			// image set is in user data
+			CEGUI::Imageset* imgSet = (CEGUI::Imageset*)mDebugRTTListbox->getFirstSelectedItem()->getUserData();
+
+			mDebugRTTStaticImage->setProperty("Image",
+                CEGUI::PropertyHelper::imageToString(&imgSet->getImage("RttImage")));
+
+		}
+		else
+		{
+			mDebugRTTStaticImage->setProperty("Image", "");
+
+		}
+		return true;
+	}
+	//---------------------------------------------------------------------
+	void CompositorDemo_FrameListener::updateDebugRTTWindow(void)
+	{
+		// Clear listbox
+		mDebugRTTListbox->resetList();
+		// Clear imagesets
+		mDebugRTTStaticImage->setProperty("Image", "");
+		for (ImageSetList::iterator isIt = mDebugRTTImageSets.begin();
+			isIt != mDebugRTTImageSets.end(); ++isIt)
+		{
+			CEGUI::ImagesetManager::getSingleton().destroyImageset(*isIt);
+		}
+		mDebugRTTImageSets.clear();
+		// Add an entry for each render texture for all active compositors
+		Ogre::Viewport* vp = mMain->getRenderWindow()->getViewport(0);
+		Ogre::CompositorChain* chain = Ogre::CompositorManager::getSingleton().getCompositorChain(vp);
+		Ogre::CompositorChain::InstanceIterator it = chain->getCompositors();
+		while (it.hasMoreElements())
+		{
+			Ogre::CompositorInstance* inst = it.getNext();
+			if (inst->getEnabled())
+			{
+				Ogre::CompositionTechnique::TextureDefinitionIterator texIt =
+					inst->getTechnique()->getTextureDefinitionIterator();
+				while (texIt.hasMoreElements())
+				{
+					Ogre::CompositionTechnique::TextureDefinition* texDef = texIt.getNext();
+
+					// Get instance name of texture
+					const Ogre::String& instName = inst->getTextureInstanceName(texDef->name);
+					// Create CEGUI texture from name of OGRE texture
+					CEGUI::Texture* tex = mMain->getGuiRenderer()->createTexture(instName);
+					// Create imageset
+					CEGUI::Imageset* imgSet =
+						CEGUI::ImagesetManager::getSingleton().createImageset(
+							instName, tex);
+					mDebugRTTImageSets.push_back(imgSet);
+					imgSet->defineImage((CEGUI::utf8*)"RttImage",
+						CEGUI::Point(0.0f, 0.0f),
+						CEGUI::Size(tex->getWidth(), tex->getHeight()),
+						CEGUI::Point(0.0f,0.0f));
+
+
+					CEGUI::ListboxTextItem *item = new CEGUI::ListboxTextItem(texDef->name, 0, imgSet);
+					item->setSelectionBrushImage("TaharezLook", "ListboxSelectionBrush");
+					item->setSelectionColours(CEGUI::colour(0,0,1));
+					mDebugRTTListbox->addItem(item);
+
+				}
+
+			}
+
+		}
+
+
+
+	}
+
+
Index: /Samples/Compositor/src/ItemSelectorViewManager.cpp
===================================================================
--- /Samples/Compositor/src/ItemSelectorViewManager.cpp	(revision 5)
+++ /Samples/Compositor/src/ItemSelectorViewManager.cpp	(revision 5)
@@ -0,0 +1,86 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+#include <CEGUI/CEGUIPropertyHelper.h>
+
+#include "OgreStringConverter.h"
+#include "ItemSelectorViewManager.h"
+
+//-----------------------------------------------------------------------------------
+// ItemSelectorViewManager Methods
+//-----------------------------------------------------------------------------------
+#define WIDGET_XPOS 0.0
+#define WIDGET_YSTART 0.1f
+#define WIDGET_YOFFSET 0.13f
+#define ITEM_YSIZE 15
+#define ITEM_YSPACING 2
+
+    ItemSelectorViewManager::ItemSelectorViewManager(const Ogre::String& parentWindowName)
+        : mItemSelectorController(0)
+    {
+        mParentWindow = CEGUI::WindowManager::getSingleton().getWindow(parentWindowName);
+        // add a scrollable pane as a child to the parent
+        mScrollablePane = (CEGUI::ScrollablePane*)CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/ScrollablePane",
+                                    ("MainScrollPane"));
+        mScrollablePane->setHorizontalAlignment(CEGUI::HA_CENTRE);
+        mScrollablePane->setSize(CEGUI::UVector2(CEGUI::UDim(0.9, 0), CEGUI::UDim(0.75, 0)));
+        mParentWindow->addChildWindow(mScrollablePane);
+        mScrollablePane->setPosition(CEGUI::UVector2(CEGUI::UDim(WIDGET_XPOS, 0), CEGUI::UDim(WIDGET_YSTART, 0)));
+        // setup scrollable pane to resize to inside of parent window when parent resizes
+        // scrollbars should only become visible when required
+        // automatically handled by scrollable pane
+    }
+//-----------------------------------------------------------------------------------
+    void ItemSelectorViewManager::addItemSelector(const Ogre::String& displayText)
+    {
+        // add a new item selector
+        // determine new index for item
+        assert(mScrollablePane);
+        const size_t idx = mItemSelectorContainer.size();
+        mItemSelectorContainer.push_back(ItemSelector());
+        ItemSelector& item = mItemSelectorContainer.back();
+        // create new checkbox
+        CEGUI::Checkbox* checkbox = item.CheckBoxWidget = (CEGUI::Checkbox*)CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/Checkbox",
+                                    ( ("ItemCheckbox" + Ogre::StringConverter::toString(idx)).c_str() ));
+        // set checkbox ID to selector ID
+        checkbox->setID(idx);
+        checkbox->setSize(CEGUI::UVector2(CEGUI::UDim(0, 140), CEGUI::UDim(0, ITEM_YSIZE)));
+        checkbox->setText(displayText.c_str());
+        checkbox->setProperty("HoverTextColour", CEGUI::PropertyHelper::colourToString(CEGUI::colour(1.0, 1.0, 0.0)));
+        // add event handler for when checkbox state changes
+        checkbox->subscribeEvent(CEGUI::Checkbox::EventCheckStateChanged, CEGUI::Event::Subscriber(&ItemSelectorViewManager::handleCheckStateChanged, this ));
+        checkbox->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0), CEGUI::UDim(0, 12 + (ITEM_YSIZE + ITEM_YSPACING)* static_cast<float>(idx))));
+        // add checkbox to the scroll pane
+        mScrollablePane->addChildWindow(checkbox);
+    }
+//-----------------------------------------------------------------------------------
+    void ItemSelectorViewManager::setItemSelectorController(ItemSelectorInterface* controller)
+    {
+        mItemSelectorController = controller;
+    }
+//-----------------------------------------------------------------------------------
+    bool ItemSelectorViewManager::handleCheckStateChanged(const CEGUI::EventArgs& e)
+    {
+        // activate controller if set
+        if (mItemSelectorController)
+        {
+            CEGUI::Checkbox* checkbox = static_cast<CEGUI::Checkbox*>(
+                static_cast<const CEGUI::WindowEventArgs&>(e).window);
+            mItemSelectorController->itemStateChanged(checkbox->getID(), checkbox->isSelected());
+            float selectColour = checkbox->isSelected() ? 0.0f : 1.0f;
+            checkbox->setProperty("NormalTextColour",
+                CEGUI::PropertyHelper::colourToString(CEGUI::colour(selectColour, 1.0f, selectColour)));
+        }
+        return true;
+    }
Index: /Samples/Compositor/src/Makefile.am
===================================================================
--- /Samples/Compositor/src/Makefile.am	(revision 5)
+++ /Samples/Compositor/src/Makefile.am	(revision 5)
@@ -0,0 +1,7 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Compositor/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include -I$(top_srcdir)/Samples/Common/CEGUIRenderer/include @CEGUI_CFLAGS@ $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = Compositor
+
+Compositor_SOURCES = Compositor.cpp CompositorDemo_FrameListener.cpp ItemSelectorViewManager.cpp
+Compositor_LDFLAGS = -L$(top_builddir)/OgreMain/src -L$(top_builddir)/Samples/Common/CEGUIRenderer/src
+Compositor_LDADD = -lOgreMain @CEGUI_LIBS@ -lCEGUIOgreRenderer $(OIS_LIBS)
Index: /Samples/Compositor/src/Makefile.in
===================================================================
--- /Samples/Compositor/src/Makefile.in	(revision 5)
+++ /Samples/Compositor/src/Makefile.in	(revision 5)
@@ -0,0 +1,530 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = Compositor$(EXEEXT)
+subdir = Samples/Compositor/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_Compositor_OBJECTS = Compositor.$(OBJEXT) \
+	CompositorDemo_FrameListener.$(OBJEXT) \
+	ItemSelectorViewManager.$(OBJEXT)
+Compositor_OBJECTS = $(am_Compositor_OBJECTS)
+am__DEPENDENCIES_1 =
+Compositor_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Compositor_SOURCES)
+DIST_SOURCES = $(Compositor_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Compositor/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include -I$(top_srcdir)/Samples/Common/CEGUIRenderer/include @CEGUI_CFLAGS@ $(OIS_CFLAGS)
+Compositor_SOURCES = Compositor.cpp CompositorDemo_FrameListener.cpp ItemSelectorViewManager.cpp
+Compositor_LDFLAGS = -L$(top_builddir)/OgreMain/src -L$(top_builddir)/Samples/Common/CEGUIRenderer/src
+Compositor_LDADD = -lOgreMain @CEGUI_LIBS@ -lCEGUIOgreRenderer $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Compositor/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Compositor/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+Compositor$(EXEEXT): $(Compositor_OBJECTS) $(Compositor_DEPENDENCIES) 
+	@rm -f Compositor$(EXEEXT)
+	$(CXXLINK) $(Compositor_LDFLAGS) $(Compositor_OBJECTS) $(Compositor_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Compositor.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CompositorDemo_FrameListener.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ItemSelectorViewManager.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/CubeMapping/Makefile.am
===================================================================
--- /Samples/CubeMapping/Makefile.am	(revision 5)
+++ /Samples/CubeMapping/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/CubeMapping/Makefile.in
===================================================================
--- /Samples/CubeMapping/Makefile.in	(revision 5)
+++ /Samples/CubeMapping/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/CubeMapping
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/CubeMapping/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/CubeMapping/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/CubeMapping/include/CubeMapping.h
===================================================================
--- /Samples/CubeMapping/include/CubeMapping.h	(revision 5)
+++ /Samples/CubeMapping/include/CubeMapping.h	(revision 5)
@@ -0,0 +1,728 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        CubeMapping.h
+    \brief
+        Specialisation of OGRE's framework application to show the
+        cube mapping feature where a wrap-around environment is reflected
+        off of an object.
+		Extended with Perlin noise to show we can.
+*/
+
+#include "ExampleApplication.h"
+
+#define ENTITY_NAME "CubeMappedEntity"
+#define MESH_NAME "CubeMappedMesh"
+
+#define MATERIAL_NAME "Examples/SceneCubeMap2"
+#define SKYBOX_MATERIAL "Examples/SceneSkyBox2"
+
+/* ==================================================================== */
+/*    Perlin Noise data and algorithms - copied from Perlin himself :)  */
+/* ==================================================================== */
+#define lerp(t,a,b) ( (a)+(t)*((b)-(a)) )
+#define fade(t) ( (t)*(t)*(t)*(t)*((t)*((t)*6-15)+10) )
+double grad(int hash, double x, double y, double z) {
+	int h = hash & 15;                      // CONVERT LO 4 BITS OF HASH CODE
+	double u = h<8||h==12||h==13 ? x : y,   // INTO 12 GRADIENT DIRECTIONS.
+		v = h<4||h==12||h==13 ? y : z;
+	return ((h&1) == 0 ? u : -u) + ((h&2) == 0 ? v : -v);
+}
+int p[512]={
+	151,160,137,91,90,15,
+	131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,
+	190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,
+	88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166,
+	77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,
+	102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196,
+	135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123,
+	5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,
+	223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9,
+	129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228,
+	251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107,
+	49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254,
+	138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180,
+
+	151,160,137,91,90,15,
+	131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,
+	190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,
+	88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166,
+	77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,
+	102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196,
+	135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123,
+	5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,
+	223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9,
+	129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228,
+	251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107,
+	49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254,
+	138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180
+	};
+
+double noise3(double x, double y, double z) {
+	int X = ((int)floor(x)) & 255,                  // FIND UNIT CUBE THAT
+		Y = ((int)floor(y)) & 255,                  // CONTAINS POINT.
+		Z = ((int)floor(z)) & 255;
+	x -= floor(x);                                // FIND RELATIVE X,Y,Z
+	y -= floor(y);                                // OF POINT IN CUBE.
+	z -= floor(z);
+	double u = fade(x),                                // COMPUTE FADE CURVES
+		v = fade(y),                                // FOR EACH OF X,Y,Z.
+		w = fade(z);
+	int A = p[X  ]+Y, AA = p[A]+Z, AB = p[A+1]+Z,      // HASH COORDINATES OF
+		B = p[X+1]+Y, BA = p[B]+Z, BB = p[B+1]+Z;      // THE 8 CUBE CORNERS,
+
+	return lerp(w, lerp(v, lerp(u, grad(p[AA  ], x  , y  , z   ),  // AND ADD
+						grad(p[BA  ], x-1, y  , z   )), // BLENDED
+					lerp(u, grad(p[AB  ], x  , y-1, z   ),  // RESULTS
+						grad(p[BB  ], x-1, y-1, z   ))),// FROM  8
+				lerp(v, lerp(u, grad(p[AA+1], x  , y  , z-1 ),  // CORNERS
+						grad(p[BA+1], x-1, y  , z-1 )), // OF CUBE
+					lerp(u, grad(p[AB+1], x  , y-1, z-1 ),
+						grad(p[BB+1], x-1, y-1, z-1 ))));
+}
+
+/* ==================================================================== */
+/*                                 Main part                            */
+/* ==================================================================== */
+
+class CubeMapListener : public ExampleFrameListener
+{
+private:
+	// main variables
+	Real tm ;
+	Real timeoutDelay ;
+	SceneManager *mSceneMgr ;
+	SceneNode *objectNode ;
+
+	// mesh-specific data
+	MeshPtr originalMesh ;
+	MeshPtr clonedMesh ;
+
+	Entity *objectEntity ;
+	std::vector<MaterialPtr> clonedMaterials ;
+
+	// configuration
+	Real displacement ;
+	Real density ;
+	Real timeDensity ;
+	bool noiseOn ;
+	size_t currentMeshIndex ;
+	StringVector availableMeshes ;
+	size_t currentLBXindex ;
+	LayerBlendOperationEx currentLBX ;
+	size_t currentCubeMapIndex ;
+	StringVector availableCubeMaps ;
+	MaterialPtr material ;
+	
+	void _updatePositionNoise(int numVertices, float *dstVertices,
+		float *defaultVertices)
+	{
+		for(int i=0;i<3*numVertices;i+=3) {
+			double n = 1 + displacement * noise3(
+				defaultVertices[i]/density + tm,
+				defaultVertices[i+1]/density + tm,
+				defaultVertices[i+2]/density + tm);
+			dstVertices[i+0] = defaultVertices[i] * n ;
+			dstVertices[i+1] = defaultVertices[i+1] * n ;
+			dstVertices[i+2] = defaultVertices[i+2] * n ;
+		}
+	}
+	
+	float* _normalsGetCleared(VertexData *vertexData)
+	{
+		const VertexElement *normVE = vertexData->
+			vertexDeclaration->findElementBySemantic(VES_NORMAL);
+		HardwareVertexBufferSharedPtr normHVB = vertexData->
+			vertexBufferBinding->getBuffer(normVE->getSource());
+		float* normals = (float*) normHVB->lock(0, normHVB->getSizeInBytes(), 
+			HardwareBuffer::HBL_DISCARD);
+		memset(normals, 0, normHVB->getSizeInBytes());
+		return normals;
+	}
+	
+	void _normalsSaveNormalized(VertexData *vertexData, float *normals)
+	{
+		const VertexElement *normVE = vertexData->
+			vertexDeclaration->findElementBySemantic(VES_NORMAL);
+		HardwareVertexBufferSharedPtr normHVB = vertexData->
+			vertexBufferBinding->getBuffer(normVE->getSource());
+		size_t numVertices = normHVB->getNumVertices();
+		for(size_t i=0;i<numVertices;i++, normals+=3) {
+			Vector3 n(normals[0], normals[1], normals[2]);
+			n.normalise();
+			normals[0] = n.x ;
+			normals[1] = n.y ;
+			normals[2] = n.z ;
+		}
+		normHVB->unlock();
+	}
+	
+	void _updateVertexDataNoiseAndNormals(
+			VertexData *dstData, 
+			VertexData *orgData,
+			IndexData *indexData,
+			float *normals)
+	{
+		size_t i ;
+		
+		// Find destination vertex buffer
+		const VertexElement *dstVEPos = dstData->
+			vertexDeclaration->findElementBySemantic(VES_POSITION);
+		HardwareVertexBufferSharedPtr dstHVBPos = dstData->
+			vertexBufferBinding->getBuffer(dstVEPos->getSource());
+		// Find source vertex buffer 
+		const VertexElement *orgVEPos = orgData->
+			vertexDeclaration->findElementBySemantic(VES_POSITION);
+		HardwareVertexBufferSharedPtr orgHVBPos = orgData->
+			vertexBufferBinding->getBuffer(orgVEPos->getSource());
+		// Lock these buffers
+		float *dstDataPos = (float*) dstHVBPos->lock(0, dstHVBPos->getSizeInBytes(),
+			HardwareBuffer::HBL_DISCARD);
+		float *orgDataPos = (float*) orgHVBPos->lock(0, orgHVBPos->getSizeInBytes(),
+			HardwareBuffer::HBL_READ_ONLY);
+		// make noise
+		size_t numVertices = orgHVBPos->getNumVertices();
+		for(i=0;i<3*numVertices;i+=3) {
+			double n = 1 + displacement * noise3(
+				orgDataPos[i]/density + tm,
+				orgDataPos[i+1]/density + tm,
+				orgDataPos[i+2]/density + tm);
+			dstDataPos[i+0] = orgDataPos[i] * n ;
+			dstDataPos[i+1] = orgDataPos[i+1] * n ;
+			dstDataPos[i+2] = orgDataPos[i+2] * n ;
+		}
+		// Unlock original position buffer
+		orgHVBPos->unlock();
+
+		// calculate normals
+		HardwareIndexBufferSharedPtr indexHB = indexData->indexBuffer ;
+		unsigned short * vertexIndices = (unsigned short*) indexHB->lock(
+			0, indexHB->getSizeInBytes(), HardwareBuffer::HBL_READ_ONLY);
+		size_t numFaces = indexData->indexCount / 3 ;
+		for(i=0 ; i<numFaces ; i++, vertexIndices+=3) {
+			//~ int p0 = 0;
+			//~ int p1 = 1;
+			//~ int p2 = 2;
+			int p0 = vertexIndices[0] ;
+			int p1 = vertexIndices[1] ;
+			int p2 = vertexIndices[2] ;
+
+			//~ Vector3 v0(10,0,20);
+			//~ Vector3 v1(30,0,20);
+			//~ Vector3 v2(20,-1,50);
+			Vector3 v0(dstDataPos[3*p0], dstDataPos[3*p0+1], dstDataPos[3*p0+2]);
+			Vector3 v1(dstDataPos[3*p1], dstDataPos[3*p1+1], dstDataPos[3*p1+2]);
+			Vector3 v2(dstDataPos[3*p2], dstDataPos[3*p2+1], dstDataPos[3*p2+2]);
+
+			Vector3 diff1 = v1 - v2 ;
+			Vector3 diff2 = v1 - v0 ;
+			Vector3 fn = diff1.crossProduct(diff2);
+#define _ADD_VECTOR_TO_REALS(ptr,vec) { *(ptr)+=vec.x; *((ptr)+1)+=vec.y; *((ptr)+2)+=vec.z; }
+			_ADD_VECTOR_TO_REALS(normals+3*p0, fn);
+			_ADD_VECTOR_TO_REALS(normals+3*p1, fn);
+			_ADD_VECTOR_TO_REALS(normals+3*p2, fn);
+#undef _ADD_VECTOR_TO_REALS
+		}
+		indexHB->unlock();
+
+		// Unlock destination position buffer
+		dstHVBPos->unlock();
+	}
+
+	void updateNoise()
+	{
+		float *sharedNormals = 0 ;
+		for(int m=0;m<clonedMesh->getNumSubMeshes();m++) { // for each subMesh
+			SubMesh *subMesh = clonedMesh->getSubMesh(m);
+			SubMesh *orgSubMesh = originalMesh->getSubMesh(m);
+			if (subMesh->useSharedVertices) {
+				if (!sharedNormals) { // first of shared
+					sharedNormals = _normalsGetCleared(clonedMesh->sharedVertexData);
+				}
+				_updateVertexDataNoiseAndNormals(
+					clonedMesh->sharedVertexData, 
+					originalMesh->sharedVertexData,
+					subMesh->indexData,
+					sharedNormals);
+			} else {
+				float* normals = _normalsGetCleared(subMesh->vertexData);
+				_updateVertexDataNoiseAndNormals(
+					subMesh->vertexData, 
+					orgSubMesh->vertexData,
+					subMesh->indexData,
+					normals);
+				_normalsSaveNormalized(subMesh->vertexData, normals);
+			}
+		}
+		if (sharedNormals) {
+			_normalsSaveNormalized(clonedMesh->sharedVertexData, sharedNormals);
+		}
+	}
+
+	void clearEntity()
+	{
+		// delete cloned materials 
+		for(unsigned int m=0;m<clonedMaterials.size();m++) {
+			MaterialManager::getSingleton().remove(clonedMaterials[m]->getHandle()) ;
+		}
+		clonedMaterials.clear();
+		
+		// detach and destroy entity
+		objectNode->detachAllObjects();
+		mSceneMgr->destroyEntity(ENTITY_NAME);
+		
+		// destroy mesh as well, to reset its geometry
+		MeshManager::getSingleton().remove(clonedMesh->getHandle());
+		
+		objectEntity = 0 ;
+	}
+	
+	VertexData* _prepareVertexData(VertexData *orgVD)
+	{
+		if (!orgVD)
+			return 0 ;
+
+        // Hacky bit: reorganise vertex buffers to a buffer-per-element
+        // Since this demo was written a while back to assume that
+        // Really this demo should be replaced with a vertex program noise
+        // distortion, but left the software for now since it's nice for older
+        // card owners
+        VertexDeclaration* newDecl = orgVD->vertexDeclaration->clone();
+        const VertexDeclaration::VertexElementList& elems = newDecl->getElements();
+        VertexDeclaration::VertexElementList::const_iterator di;
+        unsigned short buf = 0;
+        for (di = elems.begin(); di != elems.end(); ++di)
+        {
+            newDecl->modifyElement(buf, buf, 0, di->getType(), di->getSemantic(), di->getIndex()); 
+            buf++;
+        }
+        orgVD->reorganiseBuffers(newDecl);
+
+
+		VertexData* newVD = new VertexData();
+		// copy things that do not change
+		newVD->vertexCount = orgVD->vertexCount ;
+		newVD->vertexStart = orgVD->vertexStart ;
+		// now copy vertex buffers, looking in the declarations
+		VertexDeclaration* newVDecl = newVD->vertexDeclaration ;
+		VertexBufferBinding* newVBind = newVD->vertexBufferBinding ;
+		// note: I assume various semantics are not shared among buffers
+		const VertexDeclaration::VertexElementList& orgVEL = orgVD->vertexDeclaration->getElements() ;
+		VertexDeclaration::VertexElementList::const_iterator veli, velend;
+		velend = orgVEL.end();
+		// For each declaration, prepare buffer
+		for( veli = orgVEL.begin() ; veli != velend ; ++veli)
+		{
+			VertexElementSemantic ves = (*veli).getSemantic();
+			int source = (*veli).getSource() ;
+			HardwareVertexBufferSharedPtr orgBuf = orgVD->vertexBufferBinding->
+				getBuffer( source );
+			// check usage for the new buffer
+			bool dynamic = false ;
+			switch(ves) {
+				case VES_NORMAL :
+				case VES_POSITION :
+					dynamic = true ;
+					break ;
+				case VES_BLEND_INDICES : 
+				case VES_BLEND_WEIGHTS :
+				case VES_DIFFUSE : 
+				case VES_SPECULAR :
+				case VES_TEXTURE_COORDINATES :
+				default :
+					dynamic = false ;
+					break ;
+			}
+			if (dynamic) { // create a new dynamic buffer with write access
+				HardwareVertexBufferSharedPtr newBuf = 
+					HardwareBufferManager::getSingleton().createVertexBuffer(
+						orgBuf->getVertexSize(), orgBuf->getNumVertices(),
+						HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, 
+						//~ HardwareBuffer::HBU_DYNAMIC, 
+						true
+						//~ false
+						);
+				newBuf->copyData(*orgBuf, 0, 0, orgBuf->getSizeInBytes(), true);
+				newVBind->setBinding( source, newBuf );
+			} else { // use the old one
+				newVBind->setBinding( source, orgBuf );
+			}
+			// add element for declaration
+			newVDecl->addElement(source, (*veli).getOffset(), (*veli).getType(),
+				ves, (*veli).getIndex());
+		}
+		return newVD;
+	}
+	
+	void prepareClonedMesh()
+	{
+		// we create new Mesh based on the original one, but changing
+		// HBU flags (inside _prepareVertexData)
+		clonedMesh = MeshManager::getSingleton().createManual(MESH_NAME, 
+            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		clonedMesh->_setBounds(originalMesh->getBounds()); 
+		clonedMesh->_setBoundingSphereRadius(originalMesh->getBoundingSphereRadius());
+		//~ if (originalMesh->sharedVertexData)
+			//~ clonedMesh->sharedVertexData = originalMesh->sharedVertexData->clone();
+		clonedMesh->sharedVertexData = 
+			_prepareVertexData(originalMesh->sharedVertexData);
+		for(int sm=0;sm<originalMesh->getNumSubMeshes();sm++) {
+			SubMesh *orgSM = originalMesh->getSubMesh(sm);
+			SubMesh *newSM = clonedMesh->createSubMesh();
+			if (orgSM->isMatInitialised()) {
+				newSM->setMaterialName(orgSM->getMaterialName());
+			}
+			newSM->useSharedVertices = orgSM->useSharedVertices ;
+			// prepare vertex data
+			newSM->vertexData = _prepareVertexData(orgSM->vertexData);
+			// reuse index data
+			newSM->indexData->indexBuffer = orgSM->indexData->indexBuffer ;
+			newSM->indexData->indexStart = orgSM->indexData->indexStart ;
+			newSM->indexData->indexCount = orgSM->indexData->indexCount ;
+		}
+	}
+
+	void prepareEntity(const String& meshName) 
+	{
+		if (objectEntity) {
+			clearEntity();
+		}
+		
+		// load mesh if necessary - note, I assume this is the only point
+		// Mesh can get loaded, since I want to make sure about its HBU etc.
+		originalMesh = MeshManager::getSingleton().getByName(meshName);
+		if (originalMesh.isNull()) {
+			originalMesh = MeshManager::getSingleton().load(meshName,
+                ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+				HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
+				HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
+				true, true); //so we can still read it
+			if (originalMesh.isNull()) {
+				OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+					"Can't find a mesh: '"+meshName+"'",
+					"CubeMapListener::prepareEntity");
+			}
+		}
+		
+		
+		prepareClonedMesh();
+
+        // create an entity based on cloned mesh
+		objectEntity = mSceneMgr->createEntity( ENTITY_NAME, MESH_NAME);
+        objectEntity->setMaterialName( material->getName() );
+        Pass* pass = material->getTechnique(0)->getPass(0);
+		
+		// go through subentities and set materials as required
+		for(int m=0;m<clonedMesh->getNumSubMeshes();m++) {
+			SubMesh *subMesh = clonedMesh->getSubMesh(m);
+			SubEntity *subEntity = objectEntity->getSubEntity(m);
+			// check if this submesh has material set
+			if (subMesh->isMatInitialised()) {
+				const String& matName = subMesh->getMaterialName();
+				MaterialPtr subMat = 
+                    MaterialManager::getSingleton().getByName(matName);
+				if (!subMat.isNull()) { // clone material, add layers from global material
+					subMat->load();
+					MaterialPtr cloned = subMat->clone(
+						"CubeMapTempMaterial#"+StringConverter::toString(m));
+                    Pass* clonedPass = cloned->getTechnique(0)->getPass(0);
+					// can't help it - have to do it :)
+					if (meshName=="knot.mesh") {
+						for(size_t tl=0;tl<clonedPass->getNumTextureUnitStates();tl++) {
+							TextureUnitState *tlayer = clonedPass->getTextureUnitState(tl);
+							tlayer->setScrollAnimation(1.0 , 0);
+						}
+					}
+					// add layers
+					for(size_t tl=0;tl<pass->getNumTextureUnitStates();tl++) {
+						TextureUnitState *orgTL = pass->getTextureUnitState(tl);
+						TextureUnitState *newTL = clonedPass->createTextureUnitState(
+							orgTL->getTextureName());
+						*newTL = *orgTL ;
+						newTL->setColourOperationEx(currentLBX);
+					}
+					subEntity->setMaterialName(cloned->getName());
+					clonedMaterials.push_back(cloned);
+				} 
+			} 
+		}
+
+		objectNode->attachObject(objectEntity);
+		
+		// update noise to avoid one frame w/o noise
+		if (noiseOn)
+			updateNoise();
+	}
+	
+	void updateInfoDisplacement()
+	{
+		OverlayManager::getSingleton().getOverlayElement("Example/CubeMapping/Displacement")
+			->setCaption("[1/2] Displacement: "+StringConverter::toString(displacement));		
+	}
+	void updateInfoDensity()
+	{
+		OverlayManager::getSingleton().getOverlayElement("Example/CubeMapping/Density")
+			->setCaption("[3/4] Noise density: "+StringConverter::toString(density));		
+	}
+	void updateInfoTimeDensity()
+	{
+		OverlayManager::getSingleton().getOverlayElement("Example/CubeMapping/TimeDensity")
+			->setCaption("[5/6] Time density: "+StringConverter::toString(timeDensity));
+	}
+	void setObject()
+	{
+		currentMeshIndex %= availableMeshes.size();
+		const String& meshName = availableMeshes[currentMeshIndex];
+		printf("Switching to object: %s\n", meshName.c_str());
+		prepareEntity(meshName);
+		OverlayManager::getSingleton().getOverlayElement("Example/CubeMapping/Object")
+			->setCaption("[O] Object: "+meshName);
+	}
+	void setNoiseOn()
+	{
+		OverlayManager::getSingleton().getOverlayElement("Example/CubeMapping/Noise")
+			->setCaption(String("[N] Noise: ")+ ((noiseOn)?"on":"off") );		
+	}
+	void setMaterialBlending()
+	{
+		currentLBXindex %= 5;
+		String lbxName ;
+#define _LAZYERU_(a,b,c) case a : currentLBX = b ; lbxName = c ; break ;
+		switch (currentLBXindex) {
+			_LAZYERU_(0, LBX_ADD, "ADD")
+			_LAZYERU_(1, LBX_MODULATE, "MODULATE")
+			_LAZYERU_(2, LBX_MODULATE_X2, "MODULATE X2")
+			_LAZYERU_(3, LBX_MODULATE_X4, "MODULATE X4")
+			_LAZYERU_(4, LBX_SOURCE1, "SOURCE1")
+			_LAZYERU_(5, LBX_SOURCE2, "SOURCE2")
+			// more?
+		}
+#undef _LAZYERU_		
+		// reset entities, materials and so on
+		prepareEntity(availableMeshes[currentMeshIndex]);
+		OverlayManager::getSingleton().getOverlayElement("Example/CubeMapping/Material")
+			->setCaption("[M] Material blend:"+lbxName);
+	}
+	void setCubeMap()
+	{
+		currentCubeMapIndex %= availableCubeMaps.size();
+		unsigned int i ;
+		String cubeMapName = availableCubeMaps[currentCubeMapIndex];
+		Pass *pass = material->getTechnique(0)->getPass(0);
+		for(i=0;i<(int)pass->getTextureUnitState(0)->getNumFrames();i++) {
+			String oldTexName = pass->getTextureUnitState(0)->
+				getFrameTextureName(i);
+			TexturePtr oldTex = TextureManager::getSingleton().getByName(oldTexName);
+			TextureManager::getSingleton().remove(oldTexName);
+		}
+		pass->getTextureUnitState(0)->setCubicTextureName(cubeMapName, true);
+		
+		MaterialPtr mat2 = 
+			MaterialManager::getSingleton().getByName(SKYBOX_MATERIAL);
+        Pass* pass2 = mat2->getTechnique(0)->getPass(0);
+		for(i=0;i<(int)pass2->getTextureUnitState(0)->getNumFrames();i++) {
+			String oldTexName = pass2->getTextureUnitState(0)->
+				getFrameTextureName(i);
+			TexturePtr oldTex = TextureManager::getSingleton().getByName(oldTexName);
+			TextureManager::getSingleton().remove(oldTexName);
+		}
+		pass2->getTextureUnitState(0)->setCubicTextureName(cubeMapName, false);
+
+		mSceneMgr->setSkyBox(true, SKYBOX_MATERIAL );
+
+		prepareEntity(availableMeshes[currentMeshIndex]);
+		OverlayManager::getSingleton().getOverlayElement("Example/CubeMapping/CubeMap")
+			->setCaption("[C] CubeMap:"+cubeMapName);
+	}
+	
+#define RANDOM_FROM(a,b) (((float)(rand() & 65535)) / 65536.0f * ((b)-(a)) + (a))
+	void goRandom()
+	{
+		displacement = RANDOM_FROM(0.0f, 1.0f);
+		updateInfoDisplacement();
+
+		density = RANDOM_FROM(1.0f, 300.0f);
+		updateInfoDensity();
+		
+		timeDensity = RANDOM_FROM(1.0f, 10.0f);
+		updateInfoTimeDensity();
+	}
+	
+#define MEDIA_FILENAME "media.cfg"
+	void readConfig()
+	{
+        std::string media_filename(MEDIA_FILENAME);
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+        media_filename = macBundlePath() + "/Contents/Resources/" + media_filename;
+#endif
+		ConfigFile cfg;
+		cfg.load( media_filename );
+		availableMeshes = cfg.getMultiSetting("Mesh");
+		availableCubeMaps = cfg.getMultiSetting("CubeMap");
+	}
+	
+public:
+    CubeMapListener(RenderWindow* win, Camera* cam,
+			SceneManager *sceneMgr, SceneNode *objectNode)
+        : ExampleFrameListener(win, cam)
+    {
+		this->mSceneMgr = sceneMgr ;
+		this->objectNode = objectNode ;
+
+		tm = 0 ;
+		timeoutDelay = 0 ;
+		displacement = 0.1f;
+		density = 50.0f;
+		timeDensity = 5.0f;
+		objectEntity = 0 ;
+		
+		material = MaterialManager::getSingleton().getByName(MATERIAL_NAME);
+
+		if (material.isNull()) {
+			OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED,
+				"Can't find material: "+String(MATERIAL_NAME),
+				"CubeMapListener::CubeMapListener");
+		}
+		
+		readConfig();
+
+		currentMeshIndex = 0 ;
+		setObject();
+		
+		currentLBXindex = 0 ;
+		setMaterialBlending();
+		
+		currentCubeMapIndex = 0 ;
+		setCubeMap();
+		
+		noiseOn = true ;
+		setNoiseOn();
+
+		updateInfoDisplacement();
+		updateInfoDensity();
+		updateInfoTimeDensity();
+    }
+    virtual bool frameStarted(const FrameEvent& evt)
+    {
+		// Call default
+		if( ExampleFrameListener::frameStarted(evt) == false )
+			return false;
+
+		tm += evt.timeSinceLastFrame / timeDensity ;
+
+		if (noiseOn)
+			updateNoise();
+
+		objectNode->yaw(Degree(20*evt.timeSinceLastFrame));
+
+        return true;
+    }
+	virtual bool processUnbufferedKeyInput(const FrameEvent& evt)
+    {
+		using namespace OIS;
+
+		bool retval = ExampleFrameListener::processUnbufferedKeyInput(evt);
+
+		Real changeSpeed = evt.timeSinceLastFrame ;
+		
+		// adjust keyboard speed with SHIFT (increase) and CONTROL (decrease)
+		if (mKeyboard->isKeyDown(KC_LSHIFT) || mKeyboard->isKeyDown(KC_RSHIFT)) {
+			changeSpeed *= 10.0f ;
+		}
+		if (mKeyboard->isKeyDown(KC_LCONTROL)) { 
+			changeSpeed /= 10.0f ;
+		}
+		
+#define ADJUST_RANGE(_value,_keyPlus,_keyMinus,_minVal,_maxVal,_change,_macro) {\
+	if (mKeyboard->isKeyDown(_keyPlus)) \
+		{ _value+=_change ; if (_value>=_maxVal) _value = _maxVal ; _macro ; } ; \
+	if (mKeyboard->isKeyDown(_keyMinus)) \
+		{ _value-=_change; if (_value<=_minVal) _value = _minVal ; _macro ; } ; \
+}
+		
+		ADJUST_RANGE(displacement, KC_2, KC_1, -2, 2, 0.1f*changeSpeed, updateInfoDisplacement()) ;
+
+		ADJUST_RANGE(density, KC_4, KC_3, 0.1, 500, 10.0f*changeSpeed, updateInfoDensity()) ;
+
+		ADJUST_RANGE(timeDensity, KC_6, KC_5, 1, 10, 1.0f*changeSpeed, updateInfoTimeDensity()) ;
+
+#define SWITCH_VALUE(_key,_timeDelay, _macro) { \
+		if (mKeyboard->isKeyDown(_key) && timeoutDelay==0) { \
+			timeoutDelay = _timeDelay ; _macro ;} }
+	
+		timeoutDelay-=evt.timeSinceLastFrame ;
+		if (timeoutDelay<=0)
+			timeoutDelay = 0;
+
+		SWITCH_VALUE(KC_O, 0.5f, currentMeshIndex++ ; setObject());
+
+		SWITCH_VALUE(KC_N, 0.5f, noiseOn = !noiseOn ; setNoiseOn());
+
+		SWITCH_VALUE(KC_M, 0.5f, currentLBXindex++ ; setMaterialBlending());
+
+		SWITCH_VALUE(KC_C, 0.5f, currentCubeMapIndex++ ; setCubeMap());
+		
+		SWITCH_VALUE(KC_SPACE, 0.5f, goRandom());
+
+		return retval ;
+	}
+} ;
+
+class CubeMapApplication : public ExampleApplication
+{
+public:
+    CubeMapApplication() {}
+
+protected:
+	SceneNode *objectNode;
+
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+        // First check that cube mapping is supported
+        if (!Root::getSingleton().getRenderSystem()->getCapabilities()->hasCapability(RSC_CUBEMAPPING))
+        {
+            OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "Your card does not support cube mapping, so cannot "
+                "run this demo. Sorry!", 
+                "CubeMapApplication::createScene");
+        }
+
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a skybox
+        mSceneMgr->setSkyBox(true, SKYBOX_MATERIAL );
+
+        // Create a light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        l->setPosition(20,80,50);
+
+        objectNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+
+		// show overlay
+		Overlay* overlay = OverlayManager::getSingleton().getByName("Example/CubeMappingOverlay");    
+		overlay->show();
+	}
+
+    void createFrameListener(void)
+    {
+        mFrameListener= new CubeMapListener(mWindow, mCamera, mSceneMgr, objectNode);
+        mRoot->addFrameListener(mFrameListener);
+    }
+};
Index: /Samples/CubeMapping/include/Makefile.am
===================================================================
--- /Samples/CubeMapping/include/Makefile.am	(revision 5)
+++ /Samples/CubeMapping/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = CubeMapping.h
Index: /Samples/CubeMapping/include/Makefile.in
===================================================================
--- /Samples/CubeMapping/include/Makefile.in	(revision 5)
+++ /Samples/CubeMapping/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/CubeMapping/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = CubeMapping.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/CubeMapping/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/CubeMapping/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/CubeMapping/scripts/Demo_CubeMapping.cbp
===================================================================
--- /Samples/CubeMapping/scripts/Demo_CubeMapping.cbp	(revision 5)
+++ /Samples/CubeMapping/scripts/Demo_CubeMapping.cbp	(revision 5)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_CubeMapping" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_CubeMapping.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_CubeMapping.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\CubeMapping.h" />
+		<Unit filename="..\src\CubeMapping.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/CubeMapping/scripts/Demo_CubeMapping.vcproj
===================================================================
--- /Samples/CubeMapping/scripts/Demo_CubeMapping.vcproj	(revision 5)
+++ /Samples/CubeMapping/scripts/Demo_CubeMapping.vcproj	(revision 5)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_CubeMapping"
+	ProjectGUID="{89C04C44-50A4-47E3-BA46-8EA257329C80}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_CubeMapping.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_CubeMapping.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_CubeMapping.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\CubeMapping.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\CubeMapping.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/CubeMapping/scripts/Demo_CubeMapping_linux.cbp
===================================================================
--- /Samples/CubeMapping/scripts/Demo_CubeMapping_linux.cbp	(revision 5)
+++ /Samples/CubeMapping/scripts/Demo_CubeMapping_linux.cbp	(revision 5)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_CubeMapping" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_CubeMapping" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_CubeMapping" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/CubeMapping.h" />
+		<Unit filename="../src/CubeMapping.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/CubeMapping/scripts/Demo_CubeMapping_stlp.cbp
===================================================================
--- /Samples/CubeMapping/scripts/Demo_CubeMapping_stlp.cbp	(revision 5)
+++ /Samples/CubeMapping/scripts/Demo_CubeMapping_stlp.cbp	(revision 5)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_CubeMapping" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_CubeMapping.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_CubeMapping.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\CubeMapping.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\CubeMapping.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/CubeMapping/scripts/Demo_CubeMapping_vc8.vcproj
===================================================================
--- /Samples/CubeMapping/scripts/Demo_CubeMapping_vc8.vcproj	(revision 5)
+++ /Samples/CubeMapping/scripts/Demo_CubeMapping_vc8.vcproj	(revision 5)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_CubeMapping"
+	ProjectGUID="{89C04C44-50A4-47E3-BA46-8EA257329C80}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_CubeMapping.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_CubeMapping.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_CubeMapping.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\CubeMapping.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\CubeMapping.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/CubeMapping/scripts/Demo_CubeMapping_vc8.vcproj.user
===================================================================
--- /Samples/CubeMapping/scripts/Demo_CubeMapping_vc8.vcproj.user	(revision 5)
+++ /Samples/CubeMapping/scripts/Demo_CubeMapping_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/CubeMapping/src/CubeMapping.cpp
===================================================================
--- /Samples/CubeMapping/src/CubeMapping.cpp	(revision 5)
+++ /Samples/CubeMapping/src/CubeMapping.cpp	(revision 5)
@@ -0,0 +1,59 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        CubeMapping.cpp
+    \brief
+        Shows OGRE's cube mapping feature where a wrap-around environment 
+        is projected off of an object
+*/
+
+#include "CubeMapping.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char *argv[])
+#endif
+{
+    // Create application object
+    CubeMapApplication app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " <<
+            e.getFullDescription().c_str() << std::endl;
+#endif
+    }
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/CubeMapping/src/Makefile.am
===================================================================
--- /Samples/CubeMapping/src/Makefile.am	(revision 5)
+++ /Samples/CubeMapping/src/Makefile.am	(revision 5)
@@ -0,0 +1,6 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/CubeMapping/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = CubeMapping
+CubeMapping_SOURCES = CubeMapping.cpp
+CubeMapping_LDFLAGS = -L$(top_builddir)/OgreMain/src
+CubeMapping_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/CubeMapping/src/Makefile.in
===================================================================
--- /Samples/CubeMapping/src/Makefile.in	(revision 5)
+++ /Samples/CubeMapping/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = CubeMapping$(EXEEXT)
+subdir = Samples/CubeMapping/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_CubeMapping_OBJECTS = CubeMapping.$(OBJEXT)
+CubeMapping_OBJECTS = $(am_CubeMapping_OBJECTS)
+am__DEPENDENCIES_1 =
+CubeMapping_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(CubeMapping_SOURCES)
+DIST_SOURCES = $(CubeMapping_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/CubeMapping/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+CubeMapping_SOURCES = CubeMapping.cpp
+CubeMapping_LDFLAGS = -L$(top_builddir)/OgreMain/src
+CubeMapping_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/CubeMapping/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/CubeMapping/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+CubeMapping$(EXEEXT): $(CubeMapping_OBJECTS) $(CubeMapping_DEPENDENCIES) 
+	@rm -f CubeMapping$(EXEEXT)
+	$(CXXLINK) $(CubeMapping_LDFLAGS) $(CubeMapping_OBJECTS) $(CubeMapping_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CubeMapping.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/DeferredShading/Makefile.am
===================================================================
--- /Samples/DeferredShading/Makefile.am	(revision 5)
+++ /Samples/DeferredShading/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/DeferredShading/Makefile.in
===================================================================
--- /Samples/DeferredShading/Makefile.in	(revision 5)
+++ /Samples/DeferredShading/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/DeferredShading
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/DeferredShading/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/DeferredShading/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/DeferredShading/include/CreateSphere.h
===================================================================
--- /Samples/DeferredShading/include/CreateSphere.h	(revision 5)
+++ /Samples/DeferredShading/include/CreateSphere.h	(revision 5)
@@ -0,0 +1,87 @@
+/// From the WIKI -- tesselate a sphere
+void createSphere(const std::string& strName, const float r, const int nRings = 16, const int nSegments = 16)
+{
+	MeshPtr pSphere = MeshManager::getSingleton().createManual(strName, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+	SubMesh *pSphereVertex = pSphere->createSubMesh();
+
+	pSphere->sharedVertexData = new VertexData();
+	VertexData* vertexData = pSphere->sharedVertexData;
+
+	// define the vertex format
+	VertexDeclaration* vertexDecl = vertexData->vertexDeclaration;
+	size_t currOffset = 0;
+	// positions
+	vertexDecl->addElement(0, currOffset, VET_FLOAT3, VES_POSITION);
+	currOffset += VertexElement::getTypeSize(VET_FLOAT3);
+	// normals
+	vertexDecl->addElement(0, currOffset, VET_FLOAT3, VES_NORMAL);
+	currOffset += VertexElement::getTypeSize(VET_FLOAT3);
+	// two dimensional texture coordinates
+	vertexDecl->addElement(0, currOffset, VET_FLOAT2, VES_TEXTURE_COORDINATES, 0);
+	currOffset += VertexElement::getTypeSize(VET_FLOAT2);
+
+	// allocate the vertex buffer
+	vertexData->vertexCount = (nRings + 1) * (nSegments+1);
+	HardwareVertexBufferSharedPtr vBuf = HardwareBufferManager::getSingleton().createVertexBuffer(vertexDecl->getVertexSize(0), vertexData->vertexCount, HardwareBuffer::HBU_STATIC_WRITE_ONLY, false);
+	VertexBufferBinding* binding = vertexData->vertexBufferBinding;
+	binding->setBinding(0, vBuf);
+	float* pVertex = static_cast<float*>(vBuf->lock(HardwareBuffer::HBL_DISCARD));
+
+	// allocate index buffer
+	pSphereVertex->indexData->indexCount = 6 * nRings * (nSegments + 1);
+	pSphereVertex->indexData->indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(HardwareIndexBuffer::IT_16BIT, pSphereVertex->indexData->indexCount, HardwareBuffer::HBU_STATIC_WRITE_ONLY, false);
+	HardwareIndexBufferSharedPtr iBuf = pSphereVertex->indexData->indexBuffer;
+	unsigned short* pIndices = static_cast<unsigned short*>(iBuf->lock(HardwareBuffer::HBL_DISCARD));
+
+	float fDeltaRingAngle = (Math::PI / nRings);
+	float fDeltaSegAngle = (2 * Math::PI / nSegments);
+	unsigned short wVerticeIndex = 0 ;
+
+	// Generate the group of rings for the sphere
+	for( int ring = 0; ring <= nRings; ring++ ) {
+		float r0 = r * sinf (ring * fDeltaRingAngle);
+		float y0 = r * cosf (ring * fDeltaRingAngle);
+
+		// Generate the group of segments for the current ring
+		for(int seg = 0; seg <= nSegments; seg++) {
+			float x0 = r0 * sinf(seg * fDeltaSegAngle);
+			float z0 = r0 * cosf(seg * fDeltaSegAngle);
+
+			// Add one vertex to the strip which makes up the sphere
+			*pVertex++ = x0;
+			*pVertex++ = y0;
+			*pVertex++ = z0;
+
+			Vector3 vNormal = Vector3(x0, y0, z0).normalisedCopy();
+			*pVertex++ = vNormal.x;
+			*pVertex++ = vNormal.y;
+			*pVertex++ = vNormal.z;
+
+			*pVertex++ = (float) seg / (float) nSegments;
+			*pVertex++ = (float) ring / (float) nRings;
+
+			if (ring != nRings) {
+                               // each vertex (except the last) has six indicies pointing to it
+				*pIndices++ = wVerticeIndex + nSegments + 1;
+				*pIndices++ = wVerticeIndex;               
+				*pIndices++ = wVerticeIndex + nSegments;
+				*pIndices++ = wVerticeIndex + nSegments + 1;
+				*pIndices++ = wVerticeIndex + 1;
+				*pIndices++ = wVerticeIndex;
+				wVerticeIndex ++;
+			}
+		}; // end for seg
+	} // end for ring
+
+	// Unlock
+	vBuf->unlock();
+	iBuf->unlock();
+	// Generate face list
+	pSphereVertex->useSharedVertices = true;
+
+	// the original code was missing this line:
+	pSphere->_setBounds( AxisAlignedBox( Vector3(-r, -r, -r), Vector3(r, r, r) ), false );
+	pSphere->_setBoundingSphereRadius(r);
+        // this line makes clear the mesh is loaded (avoids memory leakes)
+        pSphere->load();
+}
Index: /Samples/DeferredShading/include/DeferredShading.h
===================================================================
--- /Samples/DeferredShading/include/DeferredShading.h	(revision 5)
+++ /Samples/DeferredShading/include/DeferredShading.h	(revision 5)
@@ -0,0 +1,120 @@
+/**
+Implementation of a Deferred Shading engine in OGRE, using Multiple Render Targets and
+HLSL/GLSL high level language shaders.
+	// W.J. :wumpus: van der Laan 2005 //
+
+Deferred shading renders the scene to a 'fat' texture format, using a shader that outputs colour, 
+normal, depth, and possible other attributes per fragment. Multi Render Target is required as we 
+are dealing with many outputs which get written into multiple render textures in the same pass.
+
+After rendering the scene in this format, the shading (lighting) can be done as a post process. 
+This means that lighting is done in screen space. Adding them requires nothing more than rendering 
+a screenful quad; thus the method allows for an enormous amount of lights without noticable 
+performance loss.
+
+Little lights affecting small area ("Minilights") can be even further optimised by rendering 
+their convex bounding geometry. This is also shown in this demo by 6 swarming lights.
+
+The paper for GDC2004 on Deferred Shading can be found here:
+  http://www.talula.demon.co.uk/DeferredShading.pdf
+*******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*******************************************************************************
+*/
+#ifndef H_WJ_DeferredShadingSystem
+#define H_WJ_DeferredShadingSystem
+
+#include "OgreCompositorInstance.h"
+#include "OgreSceneManager.h"
+#include "OgreSceneNode.h"
+#include "OgreMaterial.h"
+class MLight;
+class MaterialGenerator;
+
+/** System to manage Deferred Shading for a camera/render target.
+ */
+class DeferredShadingSystem: public Ogre::CompositorInstance::Listener
+{
+public:
+	DeferredShadingSystem(Ogre::Viewport *vp, Ogre::SceneManager *sm, Ogre::Camera *cam);
+	~DeferredShadingSystem();
+
+	enum DSMode
+	{
+		DSM_SINGLEPASS = 0,  // Single pass + two lights
+		DSM_MULTIPASS = 1,   // Multi pass
+		DSM_SHOWCOLOUR = 2,  // Show diffuse (for debugging)
+		DSM_SHOWNORMALS = 3, // Show normals (for debugging)
+		DSM_SHOWDSP = 4,	 // Show depth and specular channel (for debugging)
+		DSM_COUNT = 5
+	};
+
+	/** Set rendering mode (one of DSMode)
+	 */
+	void setMode(DSMode mode);
+
+	/** Activate or deactivate system
+	 */
+	void setActive(bool active);
+
+	/** Create a new MiniLight 
+	 */
+	MLight *createMLight();
+
+	/** Destroy a MiniLight
+	 */
+	void destroyMLight(MLight *m);
+
+	/** Update fat (origin) render target
+	*/
+	void update();
+
+	/// Visibility mask for scene
+	static const Ogre::uint32 SceneVisibilityMask = 0x00000001;
+	/// Visibility mask for post-processing geometry (lights, unlit particles)
+	static const Ogre::uint32 PostVisibilityMask = 0x00000002;
+
+	/** @copydoc CompositorInstance::Listener::notifyMaterialSetup
+	 */
+	virtual void notifyMaterialSetup(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat);
+protected:
+	Ogre::Viewport *mViewport;
+	Ogre::SceneManager *mSceneMgr;
+	Ogre::Camera *mCamera;
+	
+	// Fat render target
+	Ogre::MultiRenderTarget *rttTex;
+	// Filters
+	Ogre::CompositorInstance *mInstance[DSM_COUNT];
+	// Active/inactive
+	bool mActive;
+	DSMode mCurrentMode;
+
+	std::set<MLight*> mLights;
+	Ogre::TexturePtr mTexture0, mTexture1;
+
+	MaterialGenerator *mLightMaterialGenerator;
+
+    void createResources();
+	void initialiseLightGeometry();
+	void setupMaterial(const Ogre::MaterialPtr &mat);
+};
+
+#endif
Index: /Samples/DeferredShading/include/LightMaterialGenerator.h
===================================================================
--- /Samples/DeferredShading/include/LightMaterialGenerator.h	(revision 5)
+++ /Samples/DeferredShading/include/LightMaterialGenerator.h	(revision 5)
@@ -0,0 +1,54 @@
+/**
+Implementation of Deferred Shading in OGRE using Multiple Render Targets and
+HLSL/GLSL high level language shaders.
+	// W.J. :wumpus: van der Laan 2005 //
+
+Deferred shading renders the scene to a 'fat' texture format, using a shader that outputs colour, 
+normal, depth, and possible other attributes per fragment. Multi Render Target is required as we 
+are dealing with many outputs which get written into multiple render textures in the same pass.
+
+After rendering the scene in this format, the shading (lighting) can be done as a post process. 
+This means that lighting is done in screen space. Adding them requires nothing more than rendering 
+a screenful quad; thus the method allows for an enormous amount of lights without noticable 
+performance loss.
+
+Little lights affecting small area ("Minilights") can be even further optimised by rendering 
+their convex bounding geometry. This is also shown in this demo by 6 swarming lights.
+
+The paper for GDC2004 on Deferred Shading can be found here:
+  http://www.talula.demon.co.uk/DeferredShading.pdf
+
+This uses a heavily hacked version of the Ogre PostProcessing framework by Manuel.
+*******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*******************************************************************************
+*/
+#ifndef H_WJ_LightMaterialGenerator
+#define H_WJ_LightMaterialGenerator
+
+#include "MaterialGenerator.h"
+
+class LightMaterialGenerator: public MaterialGenerator
+{
+public:
+	LightMaterialGenerator(const Ogre::String &language);
+};
+
+#endif
Index: /Samples/DeferredShading/include/MLight.h
===================================================================
--- /Samples/DeferredShading/include/MLight.h	(revision 5)
+++ /Samples/DeferredShading/include/MLight.h	(revision 5)
@@ -0,0 +1,107 @@
+/**
+*******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*******************************************************************************
+*/
+#ifndef H_WJ_MLight
+#define H_WJ_MLight
+
+#include "OgreCompositorInstance.h"
+#include "OgreSceneManager.h"
+#include "OgreSceneNode.h"
+#include "DeferredShading.h"
+
+/** Renderable minilight. Do not create this directly, but use 
+	DeferredShadingSystem::createMLight.
+	XXX support other types of light other than point lights.
+ */
+class MLight: public Ogre::SimpleRenderable
+{
+public:
+	MLight(MaterialGenerator *gen);
+	~MLight();
+
+	/** Permutatation of light materials
+	 */
+	enum MaterialID
+	{
+		MI_QUAD			= 0x1, // Rendered as fullscreen quad
+		MI_ATTENUATED	= 0x2, // Rendered attenuated
+		MI_SPECULAR		= 0x4  // Specular component is calculated
+	};
+
+	/** Set constant, linear, quadratic Attenuation terms 
+	 */
+	void setAttenuation(float c, float b, float a);
+
+	/** Set the diffuse colour 
+	 */
+	void setDiffuseColour(const Ogre::ColourValue &col);
+	void setDiffuseColour(float r=1.0f, float g=1.0f, float b=1.0f, float a=1.0f)
+	{
+		setDiffuseColour(Ogre::ColourValue(r,g,b,a));
+	}
+
+	/** Set the specular colour
+	 */
+	void setSpecularColour(const Ogre::ColourValue &col);
+	void setSpecularColour(float r=1.0f, float g=1.0f, float b=1.0f, float a=1.0f)
+	{
+		setSpecularColour(Ogre::ColourValue(r,g,b,a));
+	}
+
+	/** Get diffuse colour.
+	*/
+	Ogre::ColourValue getDiffuseColour();
+
+	/** Get specular colour. 
+	*/
+	Ogre::ColourValue getSpecularColour();
+
+	/** Create geometry for this light.
+	*/
+	void rebuildGeometry(float radius);
+
+	/** Create a sphere geometry.
+	*/
+	void createSphere(const float r, const int nRings = 16, const int nSegments = 16);
+
+	/** Create a rectangle.
+	*/
+	void createRectangle2D();
+
+	/** @copydoc MovableObject::getBoundingRadius */
+	virtual Ogre::Real getBoundingRadius(void) const;
+	/** @copydoc Renderable::getSquaredViewDepth */
+	virtual Ogre::Real getSquaredViewDepth(const Ogre::Camera*) const;
+	/** @copydoc Renderable::getMaterial */
+	virtual const Ogre::MaterialPtr& getMaterial(void) const;
+protected:
+	/// Mode to ignore world orientation/position
+	bool bIgnoreWorld;
+	/// Bounding sphere radius
+	float mRadius;
+	/// Deferred shading system this minilight is part of
+	MaterialGenerator *mGenerator;
+	/// Material permutation
+	size_t mPermutation;
+};
+
+#endif
Index: /Samples/DeferredShading/include/Makefile.in
===================================================================
--- /Samples/DeferredShading/include/Makefile.in	(revision 5)
+++ /Samples/DeferredShading/include/Makefile.in	(revision 5)
@@ -0,0 +1,386 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/DeferredShading/include
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/DeferredShading/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/DeferredShading/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	distclean distclean-generic distclean-libtool distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-exec install-exec-am \
+	install-info install-info-am install-man install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/DeferredShading/include/MaterialGenerator.h
===================================================================
--- /Samples/DeferredShading/include/MaterialGenerator.h	(revision 5)
+++ /Samples/DeferredShading/include/MaterialGenerator.h	(revision 5)
@@ -0,0 +1,92 @@
+/**
+*******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*******************************************************************************
+*/
+#ifndef H_WJ_MaterialGenerator
+#define H_WJ_MaterialGenerator
+
+#include "OgreMaterial.h"
+#include "OgreStringVector.h"
+
+/** Caching, on-the-fly material generator. This is a class that automatically 
+	generates and stores different permutations of a material, and its shaders. 
+	It can be used if you have a material that has lots of slightly different 
+	variations, like whether to use a specular light, skinning, normal mapping 
+	and other options. Writing all these out is a tedioius job. Of course it is 
+	possible to always use the material with all features, but that might result 
+	in large, slow shader programs. This class provides an efficient solution
+	to that.
+ */
+class MaterialGenerator
+{
+public:
+	/** Bitfield used to signify a material permutations */
+	typedef Ogre::uint32 Perm;
+	~MaterialGenerator();
+
+	const Ogre::MaterialPtr &getMaterial(Perm permutation);
+
+	/** Implementation class that takes care of actual generation or lookup
+		of the various constituent parts (template material, fragment shader
+		and vertex shader). These methods are only called once for every permutation,
+		after which the result is stored and re-used.
+	*/
+	class Impl
+	{
+	public:
+		virtual ~Impl();
+		virtual Ogre::GpuProgramPtr generateVertexShader(Perm permutation) = 0;
+		virtual Ogre::GpuProgramPtr generateFragmentShader(Perm permutation) = 0;
+		virtual Ogre::MaterialPtr generateTemplateMaterial(Perm permutation) = 0;
+	};
+protected:
+	/** The constructor is protected as this base class should never be constructed
+		as-is. It is meant to be subclassed so that values can be assigned to
+		the various fields controlling material generator, and most importantly, the
+		mImpl field.
+	*/
+	MaterialGenerator();
+
+	const Ogre::GpuProgramPtr &getVertexShader(Perm permutation);
+	const Ogre::GpuProgramPtr &getFragmentShader(Perm permutation);
+	const Ogre::MaterialPtr &getTemplateMaterial(Perm permutation);
+	
+	/// Base name of materials generated by this
+	Ogre::String materialBaseName;
+	/// Name of every bit
+	Ogre::StringVector bitNames;
+	/// Mask of permutation bits that influence vertex shader choice
+	Perm vsMask;
+	/// Mask of permutation bits that influence fragment shader choice
+	Perm fsMask;
+	/// Mask of permutation bits that influence template material choice
+	Perm matMask;
+	/// Generator
+	Impl *mImpl;
+
+	typedef std::map<Perm, Ogre::GpuProgramPtr> ProgramMap;
+	typedef std::map<Perm, Ogre::MaterialPtr> MaterialMap;
+
+	ProgramMap mVs, mFs;
+	MaterialMap mTemplateMat, mMaterials;
+};
+
+#endif
Index: /Samples/DeferredShading/scripts/Demo_DeferredShading.cbp
===================================================================
--- /Samples/DeferredShading/scripts/Demo_DeferredShading.cbp	(revision 5)
+++ /Samples/DeferredShading/scripts/Demo_DeferredShading.cbp	(revision 5)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_DeferredShading" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_DeferredShading.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_DeferredShading.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\CreateSphere.h" />
+		<Unit filename="..\include\DeferredShading.h" />
+		<Unit filename="..\include\LightMaterialGenerator.h" />
+		<Unit filename="..\include\MLight.h" />
+		<Unit filename="..\include\MaterialGenerator.h" />
+		<Unit filename="..\src\DeferredShading.cpp" />
+		<Unit filename="..\src\DeferredShadingDemo.cpp" />
+		<Unit filename="..\src\LightMaterialGenerator.cpp" />
+		<Unit filename="..\src\MLight.cpp" />
+		<Unit filename="..\src\MaterialGenerator.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/DeferredShading/scripts/Demo_DeferredShading.vcproj
===================================================================
--- /Samples/DeferredShading/scripts/Demo_DeferredShading.vcproj	(revision 5)
+++ /Samples/DeferredShading/scripts/Demo_DeferredShading.vcproj	(revision 5)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_DeferredShading"
+	ProjectGUID="{64715BCF-1A2B-46E0-9E6C-18470FAC8D4D}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_DeferredShading.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_DeferredShading.pdb"
+				SubSystem="1"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_DeferredShading.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\include\CreateSphere.h">
+			</File>
+			<File
+				RelativePath="..\src\DeferredShading.cpp">
+			</File>
+			<File
+				RelativePath="..\include\DeferredShading.h">
+			</File>
+			<File
+				RelativePath="..\src\DeferredShadingDemo.cpp">
+			</File>
+			<File
+				RelativePath="..\src\LightMaterialGenerator.cpp">
+			</File>
+			<File
+				RelativePath="..\include\LightMaterialGenerator.h">
+			</File>
+			<File
+				RelativePath="..\src\MaterialGenerator.cpp">
+			</File>
+			<File
+				RelativePath="..\include\MaterialGenerator.h">
+			</File>
+			<File
+				RelativePath="..\src\MLight.cpp">
+			</File>
+			<File
+				RelativePath="..\include\MLight.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/DeferredShading/scripts/Demo_DeferredShading_linux.cbp
===================================================================
--- /Samples/DeferredShading/scripts/Demo_DeferredShading_linux.cbp	(revision 5)
+++ /Samples/DeferredShading/scripts/Demo_DeferredShading_linux.cbp	(revision 5)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_DeferredShading" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_DeferredShading" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_DeferredShading" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/CreateSphere.h" />
+		<Unit filename="../include/DeferredShading.h" />
+		<Unit filename="../include/LightMaterialGenerator.h" />
+		<Unit filename="../include/MLight.h" />
+		<Unit filename="../include/MaterialGenerator.h" />
+		<Unit filename="../src/DeferredShading.cpp" />
+		<Unit filename="../src/DeferredShadingDemo.cpp" />
+		<Unit filename="../src/LightMaterialGenerator.cpp" />
+		<Unit filename="../src/MLight.cpp" />
+		<Unit filename="../src/MaterialGenerator.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/DeferredShading/scripts/Demo_DeferredShading_stlp.cbp
===================================================================
--- /Samples/DeferredShading/scripts/Demo_DeferredShading_stlp.cbp	(revision 5)
+++ /Samples/DeferredShading/scripts/Demo_DeferredShading_stlp.cbp	(revision 5)
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_DeferredShading" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_DeferredShading.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_DeferredShading.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\CreateSphere.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\DeferredShading.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\LightMaterialGenerator.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\MLight.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\MaterialGenerator.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\DeferredShading.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\DeferredShadingDemo.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\LightMaterialGenerator.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\MLight.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\MaterialGenerator.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/DeferredShading/scripts/Demo_DeferredShading_vc8.vcproj
===================================================================
--- /Samples/DeferredShading/scripts/Demo_DeferredShading_vc8.vcproj	(revision 5)
+++ /Samples/DeferredShading/scripts/Demo_DeferredShading_vc8.vcproj	(revision 5)
@@ -0,0 +1,258 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_DeferredShading"
+	ProjectGUID="{A2404F4B-2FB1-41B1-AAA6-6FD10921A791}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				RuntimeTypeInfo="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_DeferredShading.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_DeferredShading.pdb"
+				SubSystem="1"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				RuntimeTypeInfo="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_DeferredShading.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\include\CreateSphere.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\DeferredShading.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\include\DeferredShading.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\DeferredShadingDemo.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\LightMaterialGenerator.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\include\LightMaterialGenerator.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\MaterialGenerator.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\include\MaterialGenerator.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\MLight.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\include\MLight.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/DeferredShading/scripts/Demo_DeferredShading_vc8.vcproj.user
===================================================================
--- /Samples/DeferredShading/scripts/Demo_DeferredShading_vc8.vcproj.user	(revision 5)
+++ /Samples/DeferredShading/scripts/Demo_DeferredShading_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/DeferredShading/src/DeferredShading.cpp
===================================================================
--- /Samples/DeferredShading/src/DeferredShading.cpp	(revision 5)
+++ /Samples/DeferredShading/src/DeferredShading.cpp	(revision 5)
@@ -0,0 +1,344 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+
+#include "DeferredShading.h"
+
+#include "OgreConfigFile.h"
+#include "OgreStringConverter.h"
+#include "OgreException.h"
+
+#include "OgreHardwarePixelBuffer.h"
+#include "OgreRoot.h"
+#include "OgreRenderSystem.h"
+#include "OgreMaterialManager.h"
+
+#include "OgreEntity.h"
+#include "OgreSubEntity.h"
+#include "OgreRoot.h"
+
+#include "OgreCompositor.h"
+#include "OgreCompositorManager.h"
+#include "OgreCompositorChain.h"
+#include "OgreCompositorInstance.h"
+#include "OgreCompositionTechnique.h"
+#include "OgreCompositionPass.h"
+#include "OgreCompositionTargetPass.h"
+
+#include "MLight.h"
+#include "LightMaterialGenerator.h"
+
+#include "OgreHighLevelGpuProgram.h"
+#include "OgreHighLevelGpuProgramManager.h"
+
+using namespace Ogre;
+
+/// XXX make this a .compositor script
+void createPostFilters()
+{
+	/** Postfilter for rendering to fat render target. Excludes skies, backgrounds and other unwanted
+		objects.
+	*/
+	CompositorPtr comp7 = CompositorManager::getSingleton().create(
+				"DeferredShading/Fat", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
+			);
+	{
+		CompositionTechnique *t = comp7->createTechnique();
+		{
+			CompositionTargetPass *tp = t->getOutputTargetPass();
+			tp->setInputMode(CompositionTargetPass::IM_NONE);
+			tp->setVisibilityMask(DeferredShadingSystem::SceneVisibilityMask);
+			/// Clear
+			{	CompositionPass *pass = tp->createPass();
+				pass->setType(CompositionPass::PT_CLEAR);
+				pass->setClearColour(ColourValue(0,0,0,0));
+			}
+			/// Render geometry
+			{	CompositionPass *pass = tp->createPass();
+				pass->setType(CompositionPass::PT_RENDERSCENE);
+				pass->setFirstRenderQueue(RENDER_QUEUE_1);
+				pass->setLastRenderQueue(RENDER_QUEUE_9);
+			}
+		}
+	}
+	/** Postfilter doing full deferred shading with two lights in one pass
+	*/
+	CompositorPtr comp = CompositorManager::getSingleton().create(
+				"DeferredShading/Single", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
+			);
+	{
+		CompositionTechnique *t = comp->createTechnique();
+		{
+			CompositionTargetPass *tp = t->getOutputTargetPass();
+			tp->setInputMode(CompositionTargetPass::IM_NONE);
+			tp->setVisibilityMask(DeferredShadingSystem::PostVisibilityMask);
+			/// Render skies
+			{	CompositionPass *pass = tp->createPass();
+				pass->setType(CompositionPass::PT_RENDERSCENE);
+				pass->setFirstRenderQueue(RENDER_QUEUE_SKIES_EARLY);
+				pass->setLastRenderQueue(RENDER_QUEUE_SKIES_EARLY);
+			}
+			/// Render ambient pass
+			{	CompositionPass *pass = tp->createPass();
+				pass->setType(CompositionPass::PT_RENDERQUAD);
+				pass->setMaterialName("DeferredShading/Post/Single");
+				pass->setIdentifier(1);
+			}
+			/// Render overlayed geometry
+			{	CompositionPass *pass = tp->createPass();
+				pass->setType(CompositionPass::PT_RENDERSCENE);
+				pass->setFirstRenderQueue(RENDER_QUEUE_1);
+				pass->setLastRenderQueue(RENDER_QUEUE_9);
+			}
+		}
+	}
+	/** Postfilter doing full deferred shading with an ambient pass and multiple light passes
+	*/
+	CompositorPtr comp2 = CompositorManager::getSingleton().create(
+				"DeferredShading/Multi", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
+			);
+	{
+		CompositionTechnique *t = comp2->createTechnique();
+		{
+			CompositionTargetPass *tp = t->getOutputTargetPass();
+			tp->setInputMode(CompositionTargetPass::IM_NONE);
+			tp->setVisibilityMask(DeferredShadingSystem::PostVisibilityMask);
+			/// Render skies
+			{	CompositionPass *pass = tp->createPass();
+				pass->setType(CompositionPass::PT_RENDERSCENE);
+				pass->setFirstRenderQueue(RENDER_QUEUE_SKIES_EARLY);
+				pass->setLastRenderQueue(RENDER_QUEUE_SKIES_EARLY);
+			}
+			/// Render ambient pass
+			{	CompositionPass *pass = tp->createPass();
+				pass->setType(CompositionPass::PT_RENDERQUAD);
+				pass->setMaterialName("DeferredShading/Post/Multi");
+				pass->setIdentifier(1);
+			}
+			/// Render overlayed geometry
+			{
+				CompositionPass *pass = tp->createPass();
+				pass->setType(CompositionPass::PT_RENDERSCENE);
+				pass->setFirstRenderQueue(RENDER_QUEUE_1);
+				pass->setLastRenderQueue(RENDER_QUEUE_9);
+			}
+		}
+	}	
+	/** Postfilter that shows the normal channel
+	*/
+	CompositorPtr comp3 = CompositorManager::getSingleton().create(
+				"DeferredShading/ShowNormal", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
+			);
+	{
+		CompositionTechnique *t = comp3->createTechnique();
+		{
+			CompositionTargetPass *tp = t->getOutputTargetPass();
+			tp->setInputMode(CompositionTargetPass::IM_NONE);
+			{	CompositionPass *pass = tp->createPass();
+				pass->setType(CompositionPass::PT_RENDERQUAD);
+				pass->setMaterialName("DeferredShading/Post/ShowNormal");
+				pass->setIdentifier(1);
+			}
+		}
+	}	
+	/** Postfilter that shows the depth and specular channel
+	*/
+	CompositorPtr comp4 = CompositorManager::getSingleton().create(
+				"DeferredShading/ShowDepthSpecular", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
+			);
+	{
+		CompositionTechnique *t = comp4->createTechnique();
+		{
+			CompositionTargetPass *tp = t->getOutputTargetPass();
+			tp->setInputMode(CompositionTargetPass::IM_NONE);
+			{	CompositionPass *pass = tp->createPass();
+				pass->setType(CompositionPass::PT_RENDERQUAD);
+				pass->setMaterialName("DeferredShading/Post/ShowDS");
+				pass->setIdentifier(1);
+			}
+		}
+	}	
+	/** Postfilter that shows the depth and specular channel
+	*/
+	CompositorPtr comp5 = CompositorManager::getSingleton().create(
+				"DeferredShading/ShowColour", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
+			);
+	{
+		CompositionTechnique *t = comp5->createTechnique();
+		{
+			CompositionTargetPass *tp = t->getOutputTargetPass();
+			tp->setInputMode(CompositionTargetPass::IM_NONE);
+			{	CompositionPass *pass = tp->createPass();
+				pass->setType(CompositionPass::PT_RENDERQUAD);
+				pass->setMaterialName("DeferredShading/Post/ShowColour");
+				pass->setIdentifier(1);
+			}
+		}
+	}
+}
+
+
+DeferredShadingSystem::DeferredShadingSystem(
+		Viewport *vp, SceneManager *sm,  Camera *cam
+	):
+	mSceneMgr(sm), mViewport(vp), mCamera(cam),
+		mLightMaterialGenerator(0)
+{
+	for(int i=0; i<DSM_COUNT; ++i)
+		mInstance[i]=0;
+
+	mActive = true;
+	mCurrentMode = DSM_MULTIPASS;
+
+	rttTex = 0;
+
+	createPostFilters();
+
+	createResources();
+	// Hide post geometry
+	mSceneMgr->setVisibilityMask(mSceneMgr->getVisibilityMask() & ~PostVisibilityMask);
+	// Default to normal deferred shading mode
+	setMode(mCurrentMode);
+	setActive(true);
+}
+
+DeferredShadingSystem::~DeferredShadingSystem()
+{
+	// Delete mini lights
+	for(std::set<MLight*>::iterator i=mLights.begin(); i!=mLights.end(); ++i)
+	{
+		delete (*i);
+	}
+
+	Ogre::CompositorChain *chain = Ogre::CompositorManager::getSingleton().getCompositorChain(mViewport);
+	for(int i=0; i<DSM_COUNT; ++i)
+		chain->_removeInstance(mInstance[i]);
+
+	delete mLightMaterialGenerator;
+}
+void DeferredShadingSystem::setMode(DSMode mode)
+{
+	for(int i=0; i<DSM_COUNT; ++i)
+	{
+		if(i == mode)
+			mInstance[i]->setEnabled(mActive);
+		else
+			mInstance[i]->setEnabled(false);
+	}
+	mCurrentMode = mode;
+}
+void DeferredShadingSystem::setActive(bool active)
+{
+	mActive = active;
+	setMode(mCurrentMode);
+}
+void DeferredShadingSystem::createResources(void)
+{
+	Ogre::CompositorManager &compMan = Ogre::CompositorManager::getSingleton();
+	// Create 'fat' render target
+	unsigned int width = mViewport->getActualWidth();
+	unsigned int height = mViewport->getActualHeight();
+	PixelFormat format = PF_FLOAT16_RGBA;
+	//PixelFormat format = PF_SHORT_RGBA;
+
+	mTexture0 = TextureManager::getSingleton().createManual("RttTex0", 
+		ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, TEX_TYPE_2D, 
+		width, height, 0, format, TU_RENDERTARGET );
+	mTexture1 = TextureManager::getSingleton().createManual("RttTex1", 
+		ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, TEX_TYPE_2D, 
+		width, height, 0, format, TU_RENDERTARGET );
+	//assert(mTexture0->getFormat() == format);
+	//assert(mTexture1->getFormat() == format);
+	rttTex = Ogre::Root::getSingleton().getRenderSystem()->createMultiRenderTarget("MRT");
+    RenderTexture* rt0 = mTexture0->getBuffer()->getRenderTarget();
+    RenderTexture* rt1 = mTexture1->getBuffer()->getRenderTarget();
+    rt0->setAutoUpdated(false);
+    rt1->setAutoUpdated(false);
+	rttTex->bindSurface(0, rt0);
+	rttTex->bindSurface(1, rt1);
+	rttTex->setAutoUpdated( false );
+
+	// Setup viewport on 'fat' render target
+	Viewport* v = rttTex->addViewport( mCamera );
+	v->setClearEveryFrame( false );
+	v->setOverlaysEnabled( false );
+    // Should disable skies for MRT due it's not designed for that, and
+    // will causing NVIDIA refusing write anything to other render targets
+    // for some reason.
+    v->setSkiesEnabled(false);
+	v->setBackgroundColour( ColourValue( 0, 0, 0, 0) );
+	compMan.addCompositor(v, "DeferredShading/Fat");
+
+	// Create lights material generator
+	setupMaterial(MaterialManager::getSingleton().getByName("DeferredShading/LightMaterialQuad"));
+	setupMaterial(MaterialManager::getSingleton().getByName("DeferredShading/LightMaterial"));
+	if(Root::getSingleton().getRenderSystem()->getName()=="OpenGL Rendering Subsystem")
+		mLightMaterialGenerator = new LightMaterialGenerator("glsl");
+	else
+		mLightMaterialGenerator = new LightMaterialGenerator("hlsl");
+
+	// Create filters
+	mInstance[DSM_SINGLEPASS] = compMan.addCompositor(mViewport, "DeferredShading/Single");
+	mInstance[DSM_MULTIPASS] = compMan.addCompositor(mViewport, "DeferredShading/Multi");
+	mInstance[DSM_SHOWNORMALS] = compMan.addCompositor(mViewport, "DeferredShading/ShowNormal");
+	mInstance[DSM_SHOWDSP] = compMan.addCompositor(mViewport, "DeferredShading/ShowDepthSpecular");
+	mInstance[DSM_SHOWCOLOUR] = compMan.addCompositor(mViewport, "DeferredShading/ShowColour");
+
+	// Add material setup callback
+	for(int i=0; i<DSM_COUNT; ++i)
+		mInstance[i]->addListener(this);
+}
+void DeferredShadingSystem::setupMaterial(const MaterialPtr &mat)
+{
+	for(unsigned short i=0; i<mat->getNumTechniques(); ++i)
+	{
+		Pass *pass = mat->getTechnique(i)->getPass(0);
+		pass->getTextureUnitState(0)->setTextureName(mTexture0->getName());
+		pass->getTextureUnitState(1)->setTextureName(mTexture1->getName());
+	}
+}
+
+MLight *DeferredShadingSystem::createMLight()
+{
+	MLight *rv = new MLight(mLightMaterialGenerator);
+	rv->setVisibilityFlags(PostVisibilityMask);
+	mLights.insert(rv);
+
+	return rv;
+}
+void DeferredShadingSystem::destroyMLight(MLight *m)
+{
+	mLights.erase(m);
+	delete m;
+}
+
+void DeferredShadingSystem::update()
+{
+	rttTex->update();
+}
+
+void DeferredShadingSystem::notifyMaterialSetup(uint32 pass_id, MaterialPtr &mat)
+{
+	/// Local pass identifier 1 is the render quad pass
+	if(pass_id == 1)
+	{
+		setupMaterial(mat);
+	}
+}
Index: /Samples/DeferredShading/src/DeferredShadingDemo.cpp
===================================================================
--- /Samples/DeferredShading/src/DeferredShadingDemo.cpp	(revision 5)
+++ /Samples/DeferredShading/src/DeferredShadingDemo.cpp	(revision 5)
@@ -0,0 +1,580 @@
+/**
+Demo of Deferred Shading in OGRE using Multiple Render Targets and HLSL/GLSL high level 
+language shaders.
+	// W.J. :wumpus: van der Laan 2005 //
+
+Deferred shading renders the scene to a 'fat' texture format, using a shader that outputs colour, 
+normal, depth, and possible other attributes per fragment. Multi Render Target is required as we 
+are dealing with many outputs which get written into multiple render textures in the same pass.
+
+After rendering the scene in this format, the shading (lighting) can be done as a post process. 
+This means that lighting is done in screen space. Adding them requires nothing more than rendering 
+a screenful quad; thus the method allows for an enormous amount of lights without noticable 
+performance loss.
+
+Little lights affecting small area ("Minilights") can be even further optimised by rendering 
+their convex bounding geometry. This is also shown in this demo by 6 swarming lights.
+
+The paper for GDC2004 on Deferred Shading can be found here:
+  http://www.talula.demon.co.uk/DeferredShading.pdf
+
+This demo source file is in the public domain.
+*/
+
+#include "Ogre.h"
+#include "ExampleApplication.h"
+#include "ExampleFrameListener.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#include "DeferredShading.h"
+#include "MLight.h"
+#include "CreateSphere.h"
+class SharedData : public Ogre::Singleton<SharedData> {
+
+public:
+
+	SharedData()
+		: iRoot(0),
+		  iCamera(0),
+		  iWindow(0),
+		  mAnimState(0),
+		  mMLAnimState(0),
+		  iLight1(0), iLight2(0)
+	{
+		iActivate = false;
+	}
+
+		~SharedData() {}
+
+		// shared data across the application
+		Real iLastFrameTime;
+		Root *iRoot;
+		Camera *iCamera;
+		RenderWindow *iWindow;
+
+		DeferredShadingSystem *iSystem;
+		bool iActivate;
+		bool iGlobalActivate;
+
+		// Animation state for big lights
+		AnimationState* mAnimState;
+		// Animation state for light swarm
+		AnimationState* mMLAnimState;
+
+		// overlay stuff.. too lazy to do a good thing for it
+		SceneManager *iSceneMgr;
+		RenderTarget *iSceneTarget;
+
+		MLight *iLight1, *iLight2;
+
+		std::vector<Node*> mLightNodes;
+
+};
+template<> SharedData* Singleton<SharedData>::ms_Singleton = 0;
+
+class RenderToTextureFrameListener : public ExampleFrameListener
+{
+protected:
+	Real timeoutDelay ;
+	Vector3 oldCamPos;
+	Quaternion oldCamOri;
+	DeferredShadingSystem::DSMode mode;
+public:
+	RenderToTextureFrameListener(RenderWindow* window, Camera* maincam)
+		:ExampleFrameListener(window, maincam), 
+		oldCamPos(0,0,0), oldCamOri(0,0,0,0)
+	{
+		timeoutDelay = 0;
+		mMoveSpeed = 200;
+		mode = (DeferredShadingSystem::DSMode)1;
+	}
+
+	bool frameStarted(const FrameEvent& evt)
+	{
+		if( ExampleFrameListener::frameStarted(evt) == false )
+			return false;
+
+		SharedData::getSingleton().iLastFrameTime = evt.timeSinceLastFrame;
+
+		if (SharedData::getSingleton().mAnimState)
+            SharedData::getSingleton().mAnimState->addTime(evt.timeSinceLastFrame);
+		if (SharedData::getSingleton().mMLAnimState)
+            SharedData::getSingleton().mMLAnimState->addTime(evt.timeSinceLastFrame);
+		
+		// Only update fat buffer if something changed
+		bool somethingChanged = false;
+		if(mCamera->getPosition()!=oldCamPos || mCamera->getOrientation()!=oldCamOri)
+		{
+			somethingChanged = true;
+			oldCamPos = mCamera->getPosition();
+			oldCamOri = mCamera->getOrientation();
+		}
+		
+		if(somethingChanged)
+			SharedData::getSingleton().iSystem->update();
+		return true;
+	}
+
+	virtual bool processUnbufferedKeyInput(const FrameEvent& evt) {
+		using namespace OIS;
+		bool retval = ExampleFrameListener::processUnbufferedKeyInput(evt);
+
+		// "C" switch filters
+		if (mKeyboard->isKeyDown(KC_C) && timeoutDelay==0) 
+		{
+			timeoutDelay = 0.5f;
+
+			mode = (DeferredShadingSystem::DSMode)((int)mode+1);
+			if(mode == DeferredShadingSystem::DSM_COUNT)
+				mode = (DeferredShadingSystem::DSMode)1;
+
+			SharedData::getSingleton().iSystem->setMode( mode );
+
+			updateOverlays();
+		}
+
+		// "B" activate/deactivate minilight rendering
+		if (mKeyboard->isKeyDown(KC_B) && timeoutDelay==0) 
+		{
+			timeoutDelay = 0.5f;
+			SharedData::getSingleton().iActivate = !SharedData::getSingleton().iActivate;
+			// Hide/show all minilights
+			std::vector<Node*>::iterator i = SharedData::getSingleton().mLightNodes.begin();
+			std::vector<Node*>::iterator iend = SharedData::getSingleton().mLightNodes.end();
+			for(; i!=iend; ++i)
+			{
+				static_cast<SceneNode*>(*i)->setVisible(SharedData::getSingleton().iActivate, true);
+			}
+			
+			updateOverlays();
+		}
+		// "G" activate/deactivate global light rendering
+		if (mKeyboard->isKeyDown(KC_G) && timeoutDelay==0) 
+		{
+			timeoutDelay = 0.5f;
+			SharedData::getSingleton().iGlobalActivate = !SharedData::getSingleton().iGlobalActivate;
+			SharedData::getSingleton().iLight1->setVisible(SharedData::getSingleton().iGlobalActivate);
+			SharedData::getSingleton().iLight2->setVisible(SharedData::getSingleton().iGlobalActivate);
+			updateOverlays();
+		}
+
+		timeoutDelay -= evt.timeSinceLastFrame;
+		if (timeoutDelay <= 0) timeoutDelay = 0;
+
+		return retval;
+	}
+
+	void updateOverlays() 
+	{
+
+		OverlayManager::getSingleton().getOverlayElement( "Example/Shadows/ShadowTechniqueInfo" )
+			->setCaption( "" );
+
+		OverlayManager::getSingleton().getOverlayElement( "Example/Shadows/MaterialInfo" )
+			->setCaption( "");
+
+		OverlayManager::getSingleton().getOverlayElement( "Example/Shadows/ShadowTechnique" )
+			->setCaption( "[B] MiniLights active: " + StringConverter::toString( SharedData::getSingleton().iActivate ) );
+
+		std::string name;
+		switch(mode)
+		{
+		case DeferredShadingSystem::DSM_SINGLEPASS:
+			name="SinglePass"; break;
+		case DeferredShadingSystem::DSM_MULTIPASS:
+			name="MultiPass"; break;
+		case DeferredShadingSystem::DSM_SHOWCOLOUR:
+			name="ShowColour"; break;
+		case DeferredShadingSystem::DSM_SHOWNORMALS:
+			name="ShowNormals"; break;
+		case DeferredShadingSystem::DSM_SHOWDSP:
+			name="ShowDSP"; break;
+		}
+		OverlayManager::getSingleton().getOverlayElement( "Example/Shadows/Materials" )
+			->setCaption( "[C] Change mode, current is \"" + name + "\"");
+
+		OverlayManager::getSingleton().getOverlayElement( "Example/Shadows/Info" )
+			->setCaption( "[G] Global lights active: " + StringConverter::toString( SharedData::getSingleton().iGlobalActivate ) );
+
+	}
+};
+
+
+class RenderToTextureApplication : public ExampleApplication, public RenderTargetListener
+{
+public:
+    RenderToTextureApplication() : mPlane(0) {
+		new SharedData();
+		mPlane = 0;
+		mSystem = 0;
+	}
+    
+	~RenderToTextureApplication()
+    {
+		delete ( SharedData::getSingletonPtr() );
+
+        delete mPlane;
+		delete mSystem;
+	}
+
+
+protected:
+    MovablePlane* mPlane;
+    Entity* mPlaneEnt;
+    SceneNode* mPlaneNode;
+	DeferredShadingSystem *mSystem;
+
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+		RenderSystem *rs = Root::getSingleton().getRenderSystem();
+		const RenderSystemCapabilities* caps = rs->getCapabilities();
+        if (!caps->hasCapability(RSC_VERTEX_PROGRAM) || !(caps->hasCapability(RSC_FRAGMENT_PROGRAM)))
+        {
+            OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "Your card does not support vertex and fragment programs, so cannot "
+                "run this demo. Sorry!", 
+                "DeferredShading::createScene");
+        }
+		if (caps->numMultiRenderTargets()<2)
+        {
+            OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "Your card does not support at least two simulataneous render targets, so cannot "
+                "run this demo. Sorry!", 
+                "DeferredShading::createScene");
+        }
+		MovableObject::setDefaultVisibilityFlags(0x00000001);
+		mSceneMgr->setVisibilityMask(0x00000001);
+		// Prepare athene mesh for normalmapping
+        MeshPtr pAthene = MeshManager::getSingleton().load("athene.mesh", 
+            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+        unsigned short src, dest;
+        if (!pAthene->suggestTangentVectorBuildParams(VES_TANGENT, src, dest))
+            pAthene->buildTangentVectors(VES_TANGENT, src, dest);
+		// Prepare knot mesh for normal mapping
+		pAthene = MeshManager::getSingleton().load("knot.mesh", 
+            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+        if (!pAthene->suggestTangentVectorBuildParams(VES_TANGENT, src, dest))
+            pAthene->buildTangentVectors(VES_TANGENT, src, dest);
+
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.2, 0.2, 0.15));
+        // Skybox
+        mSceneMgr->setSkyBox(true, "Test13/SkyBox");
+
+		// Create "root" node
+		SceneNode* rootNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+
+        // Create a prefab plane
+        mPlane = new MovablePlane("ReflectPlane");
+        mPlane->d = 0;
+        mPlane->normal = Vector3::UNIT_Y;
+        MeshManager::getSingleton().createCurvedPlane("ReflectionPlane", 
+            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+			*mPlane,
+			2000, 2000, -1000,
+            20, 20, 
+			true, 1, 10, 10, Vector3::UNIT_Z);
+        mPlaneEnt = mSceneMgr->createEntity( "Plane", "ReflectionPlane" );
+		mPlaneNode = rootNode->createChildSceneNode();
+        mPlaneNode->attachObject(mPlaneEnt);
+        mPlaneNode->translate(-5, -30, 0);
+        //mPlaneNode->roll(Degree(5));
+        mPlaneEnt->setMaterialName("Test13/Ground");
+
+        // Create an entity from a model (will be loaded automatically)
+        Entity* knotEnt = mSceneMgr->createEntity("Knot", "knot.mesh");
+		knotEnt->setMaterialName("Test13/RockWall");
+		knotEnt->setMeshLodBias(0.25f);
+
+        // Create an entity from a model (will be loaded automatically)
+        Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh");
+		ogreHead->getSubEntity(0)->setMaterialName("Test13/DeferredOgre/Eyes");// eyes
+		ogreHead->getSubEntity(1)->setMaterialName("Test13/DeferredOgre/Skin"); 
+		ogreHead->getSubEntity(2)->setMaterialName("Test13/DeferredOgre/EarRing"); // earrings
+		ogreHead->getSubEntity(3)->setMaterialName("Test13/DeferredOgre/Tusks"); // tusks
+		rootNode->createChildSceneNode( "Head" )->attachObject( ogreHead );
+
+        Entity* athena = mSceneMgr->createEntity("Athena", "athene.mesh");
+		athena->setMaterialName("Test13/DeferredAthena");
+		SceneNode *aNode = rootNode->createChildSceneNode();
+		aNode->attachObject( athena );
+		aNode->setPosition(-100, 40, 100);
+
+        // Add a whole bunch of extra entities to fill the scene a bit
+        Entity *cloneEnt;
+		int N=4;
+        for (int n = 0; n < N; ++n)
+        {
+			float theta = 2.0f*Math::PI*(float)n/(float)N;
+            // Create a new node under the root
+            SceneNode* node = mSceneMgr->createSceneNode();
+            // Random translate
+            Vector3 nodePos;
+            nodePos.x = Math::SymmetricRandom() * 40.0 + Math::Sin(theta) * 500.0;
+            nodePos.y = Math::SymmetricRandom() * 20.0 - 40.0;
+            nodePos.z = Math::SymmetricRandom() * 40.0 + Math::Cos(theta) * 500.0;
+            node->setPosition(nodePos);
+			Quaternion orientation(Math::SymmetricRandom(),Math::SymmetricRandom(),Math::SymmetricRandom(),Math::SymmetricRandom());
+			orientation.normalise();
+			node->setOrientation(orientation);
+            rootNode->addChild(node);
+            // Clone knot
+            char cloneName[12];
+            sprintf(cloneName, "Knot%d", n);
+            cloneEnt = knotEnt->clone(cloneName);
+            // Attach to new node
+            node->attachObject(cloneEnt);
+
+        }
+
+        mCamera->setPosition(-50, 100, 500);
+        mCamera->lookAt(0,0,0);
+
+		// show overlay
+		Overlay* overlay = OverlayManager::getSingleton().getByName("Example/ShadowsOverlay");    
+		overlay->show();
+
+		mSystem = new DeferredShadingSystem(mWindow->getViewport(0), mSceneMgr, mCamera);
+
+		
+		// Create a light
+        MLight* l = mSystem->createMLight();//"SunLight");
+        //l->setType(Light::LT_POINT);
+        //l->setPosition(600.0, 1000.0, 200.0);
+        l->setDiffuseColour(1.0f, 0.6f, 0.2f);
+        l->setSpecularColour(0.3f, 0.15f, 0.06f);
+		//l->setDiffuseColour(0.0f, 0.0f, 0.0f);
+		//l->setSpecularColour(0.0f, 0.0f, 0.0f);
+		
+		// Create moving light
+		MLight* l2 = mSystem->createMLight();//"MainLight2");
+        //l2->setType(Light::LT_POINT);
+        l2->setDiffuseColour(0.75f, 0.7f, 0.8f);
+		l2->setSpecularColour(0.85f, 0.9f, 1.0f);
+		
+		SceneNode *lightNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		lightNode->attachObject(l2);
+
+		// Create a track for the light
+        Animation* anim = mSceneMgr->createAnimation("LightTrack", 16);
+        // Spline it for nice curves
+        anim->setInterpolationMode(Animation::IM_SPLINE);
+        // Create a track to animate the camera's node
+        NodeAnimationTrack* track = anim->createNodeTrack(0, lightNode);
+        // Setup keyframes
+        TransformKeyFrame* key = track->createNodeKeyFrame(0); // A startposition
+        key->setTranslate(Vector3(300,300,-300));
+        key = track->createNodeKeyFrame(4);//B
+        key->setTranslate(Vector3(300,300,300));
+        key = track->createNodeKeyFrame(8);//C
+        key->setTranslate(Vector3(-300,300,300));
+        key = track->createNodeKeyFrame(12);//D
+        key->setTranslate(Vector3(-300,300,-300));
+		key = track->createNodeKeyFrame(16);//D
+        key->setTranslate(Vector3(300,300,-300));
+        // Create a new animation state to track this
+        SharedData::getSingleton().mAnimState = mSceneMgr->createAnimationState("LightTrack");
+        SharedData::getSingleton().mAnimState->setEnabled(true);
+
+		// Create some happy little lights
+		createSampleLights();
+
+		// safely setup application's (not postfilter!) shared data
+		SharedData::getSingleton().iCamera = mCamera;
+		SharedData::getSingleton().iRoot = mRoot;
+		SharedData::getSingleton().iWindow = mWindow;
+		SharedData::getSingleton().iActivate = true;
+		SharedData::getSingleton().iGlobalActivate = true;
+		SharedData::getSingleton().iSceneMgr = mSceneMgr;
+		SharedData::getSingleton().iSystem = mSystem;
+		SharedData::getSingleton().iLight1 = l;
+		SharedData::getSingleton().iLight2 = l2;
+	}
+
+    void createFrameListener(void)
+    {
+        mFrameListener= new RenderToTextureFrameListener(mWindow, mCamera);
+		// initialize overlays
+		static_cast<RenderToTextureFrameListener*>(mFrameListener)->updateOverlays();
+        mRoot->addFrameListener(mFrameListener);
+    }
+
+	void createSampleLights()
+	{
+		// Create some lights		
+		std::vector<MLight*> lights;
+		SceneNode *parentNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("LightsParent");
+		// Create light nodes
+		std::vector<Node*> nodes;
+
+		MLight *a = mSystem->createMLight();
+		SceneNode *an = parentNode->createChildSceneNode();
+		an->attachObject(a);
+		a->setAttenuation(1.0f, 0.001f, 0.002f);
+		//a->setAttenuation(1.0f, 0.000f, 0.000f);
+		an->setPosition(0,0,25);
+		a->setDiffuseColour(1,0,0);
+		//a->setSpecularColour(0.5,0,0);
+		lights.push_back(a);
+		nodes.push_back(an);
+
+		MLight *b = mSystem->createMLight();
+		SceneNode *bn = parentNode->createChildSceneNode();
+		bn->attachObject(b);
+		b->setAttenuation(1.0f, 0.001f, 0.003f);
+		bn->setPosition(25,0,0);
+		b->setDiffuseColour(1,1,0);
+		//b->setSpecularColour(0.5,0.5,0);
+		lights.push_back(b);
+		nodes.push_back(bn);
+
+		MLight *c = mSystem->createMLight();
+		SceneNode *cn = parentNode->createChildSceneNode();
+		cn->attachObject(c);
+		c->setAttenuation(1.0f, 0.001f, 0.004f);
+		cn->setPosition(0,0,-25);
+		c->setDiffuseColour(0,1,1);
+		c->setSpecularColour(0.25,1.0,1.0); // Cyan light has specular component
+		lights.push_back(c);
+		nodes.push_back(cn);
+
+		MLight *d = mSystem->createMLight();
+		SceneNode *dn = parentNode->createChildSceneNode();
+		dn->attachObject(d);
+		d->setAttenuation(1.0f, 0.002f, 0.002f);
+		dn->setPosition(-25,0,0);
+		d->setDiffuseColour(1,0,1);
+		d->setSpecularColour(0.0,0,0.0);
+		lights.push_back(d);
+		nodes.push_back(dn);
+
+		MLight *e = mSystem->createMLight();
+		SceneNode *en = parentNode->createChildSceneNode();
+		en->attachObject(e);
+		e->setAttenuation(1.0f, 0.002f, 0.0025f);
+		en->setPosition(25,0,25);
+		e->setDiffuseColour(0,0,1);
+		e->setSpecularColour(0,0,0);
+		lights.push_back(e);
+		nodes.push_back(en);
+		
+		MLight *f = mSystem->createMLight();
+		SceneNode *fn = parentNode->createChildSceneNode();
+		fn->attachObject(f);
+		f->setAttenuation(1.0f, 0.0015f, 0.0021f);
+		fn->setPosition(-25,0,-25);
+		f->setDiffuseColour(0,1,0);
+		f->setSpecularColour(0,0.0,0.0);
+		lights.push_back(f);
+		nodes.push_back(fn);
+
+		// Create marker meshes to show user where the lights are
+		Entity *ent;
+		createSphere("PointLightMesh", 1.0f, 5, 5);
+		for(std::vector<MLight*>::iterator i=lights.begin(); i!=lights.end(); ++i)
+		{
+			ent = mSceneMgr->createEntity((*i)->getName()+"v", "PointLightMesh");
+			String matname = (*i)->getName()+"m";
+			// Create coloured material
+			MaterialPtr mat = MaterialManager::getSingleton().create(matname,
+                ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+            Pass* pass = mat->getTechnique(0)->getPass(0);
+            pass->setDiffuse(0.0f,0.0f,0.0f,1.0f);
+			pass->setAmbient(0.0f,0.0f,0.0f);
+			pass->setSelfIllumination((*i)->getDiffuseColour());
+
+			ent->setMaterialName(matname);
+			ent->setVisibilityFlags(DeferredShadingSystem::PostVisibilityMask);
+			static_cast<SceneNode*>((*i)->getParentNode())->attachObject(ent);
+		}		
+
+		// Store nodes for hiding/showing
+		SharedData::getSingleton().mLightNodes = nodes;
+
+		// Do some animation for node a-f
+		// Generate helix structure
+		float seconds_per_station = 1.0f;
+		float r=35;
+		//Vector3 base(0,-30,0);
+		Vector3 base(-100, -30, 85);
+
+		float h=120;
+		const size_t s_to_top = 16;
+		const size_t stations = s_to_top*2-1;
+		float ascend = h/((float)s_to_top);
+		float stations_per_revolution = 3.5f;
+		size_t skip = 2; // stations between lights
+		Vector3 station_pos[stations];
+		for(int x=0; x<s_to_top; ++x)
+		{
+			float theta = ((float)x/stations_per_revolution)*2.0f*Math::PI;
+			station_pos[x] = base+Vector3(Math::Sin(theta)*r, ascend*x, Math::Cos(theta)*r);
+		}
+		for(int x=s_to_top; x<stations; ++x)
+		{
+			float theta = ((float)x/stations_per_revolution)*2.0f*Math::PI;
+			station_pos[x] = base+Vector3(Math::Sin(theta)*r, h-ascend*(x-s_to_top), Math::Cos(theta)*r);
+		}
+		// Create a track for the light swarm
+		Animation* anim = mSceneMgr->createAnimation("LightSwarmTrack", stations*seconds_per_station);
+		// Spline it for nice curves
+		anim->setInterpolationMode(Animation::IM_SPLINE);
+		for(unsigned int x=0; x<nodes.size(); ++x)
+		{
+			// Create a track to animate the camera's node
+			NodeAnimationTrack* track = anim->createNodeTrack(x, nodes[x]);
+			for(int y=0; y<=stations; ++y)
+			{
+				// Setup keyframes
+				TransformKeyFrame* key = track->createNodeKeyFrame(y*seconds_per_station); // A startposition
+				key->setTranslate(station_pos[(x*skip+y)%stations]);
+				// Make sure size of light doesn't change
+				key->setScale(nodes[x]->getScale());
+			}
+		}
+		// Create a new animation state to track this
+		SharedData::getSingleton().mMLAnimState = mSceneMgr->createAnimationState("LightSwarmTrack");
+		SharedData::getSingleton().mMLAnimState->setEnabled(true);
+	}
+
+};
+
+
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+//	INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+//#else
+	int main(int argc, char *argv[])
+//#endif
+	{
+		// Create application object
+		RenderToTextureApplication app;
+
+		try {
+			app.go();
+		} catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+			MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+			std::cerr << "An exception has occured: " <<
+				e.getFullDescription().c_str() << std::endl;
+#endif
+		}
+
+		return 0;
+	}
+
+#ifdef __cplusplus
+}
+#endif
+
+
Index: /Samples/DeferredShading/src/LightMaterialGenerator.cpp
===================================================================
--- /Samples/DeferredShading/src/LightMaterialGenerator.cpp	(revision 5)
+++ /Samples/DeferredShading/src/LightMaterialGenerator.cpp	(revision 5)
@@ -0,0 +1,294 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+
+#include "LightMaterialGenerator.h"
+
+#include "OgreStringConverter.h"
+#include "OgreException.h"
+#include "OgreMaterialManager.h"
+
+#include "OgrePass.h"
+#include "OgreTechnique.h"
+
+#include "OgreHighLevelGpuProgram.h"
+#include "OgreHighLevelGpuProgramManager.h"
+
+#include "MLight.h"
+
+using namespace Ogre;
+
+class LightMaterialGeneratorHLSL: public MaterialGenerator::Impl
+{
+public:
+	LightMaterialGeneratorHLSL(const String &baseName):
+		mBaseName(baseName)
+	{}
+	typedef MaterialGenerator::Perm Perm;
+
+	virtual Ogre::GpuProgramPtr generateVertexShader(Perm permutation)
+	{
+		if(permutation & MLight::MI_QUAD)
+		{
+			return HighLevelGpuProgramManager::getSingleton().getByName("DeferredShading/post/hlsl/vs");
+		}
+		else
+		{
+			return HighLevelGpuProgramManager::getSingleton().getByName("DeferredShading/post/hlsl/LightMaterial_vs");
+		}
+	}
+	virtual Ogre::GpuProgramPtr generateFragmentShader(Perm permutation)
+	{
+		bool isAttenuated = permutation & MLight::MI_ATTENUATED;
+		bool isSpecular = permutation & MLight::MI_SPECULAR;
+		// bool isShadowed = perm&4;
+
+		/// Create name
+		String name=mBaseName+StringConverter::toString(permutation)+"_ps";
+		/// Create shader
+		std::stringstream shader;
+		shader <<
+		"sampler Tex0: register(s0);\n"
+		"sampler Tex1: register(s1);\n"
+		"float4x4 worldView;\n"
+		// Attributes of light
+		"float4 lightDiffuseColor;\n"
+		"float4 lightSpecularColor;\n"
+		"float4 lightFalloff;\n"
+		"float4 main(float2 texCoord: TEXCOORD0, float3 projCoord: TEXCOORD1) : COLOR\n"
+		"{\n"
+		"    float4 a0 = tex2D(Tex0, texCoord); \n"// Attribute 0: Diffuse color+shininess
+		"    float4 a1 = tex2D(Tex1, texCoord); \n"// Attribute 1: Normal+depth
+		// Attributes
+		"    float3 colour = a0.rgb;\n"
+		"    float alpha = a0.a;"		// Specularity
+		"    float distance = a1.w;"	// Distance from viewer (w)
+		"    float3 normal = a1.xyz;\n"
+		// Calculate position of texel in view space
+		"    float3 position = projCoord*distance;\n"
+		// Extract position in view space from worldView matrix
+		"	 float3 lightPos = float3(worldView[0][3],worldView[1][3],worldView[2][3]);\n"
+		// Calculate light direction and distance
+		"    float3 lightVec = lightPos - position;\n"
+		"    float len_sq = dot(lightVec, lightVec);\n"
+		"    float len = sqrt(len_sq);\n"
+		"    float3 lightDir = lightVec/len;\n"
+		/// Calculate attenuation
+		"    float attenuation = dot(lightFalloff, float3(1, len, len_sq));\n"
+		/// Calculate diffuse colour
+		"    float3 light_diffuse = max(0,dot(lightDir, normal)) * lightDiffuseColor;\n"
+		/// Calculate specular component
+		"    float3 viewDir = -normalize(position);\n"
+		"    float3 h = normalize(viewDir + lightDir);\n"
+		"    float3 light_specular = pow(dot(normal, h),32) * lightSpecularColor;\n"
+		// Accumulate total lighting for this fragment
+		"    float3 total_light_contrib;\n"
+		"    total_light_contrib = light_diffuse;\n";
+		if(isSpecular)
+		{
+			/// Calculate specular contribution
+			shader << 
+			"	 total_light_contrib += alpha * light_specular;\n";
+		}
+		if(isAttenuated)
+		{
+			shader <<
+			"    return float4(total_light_contrib*colour/attenuation, 0);\n";
+		}
+		else
+		{
+			shader <<
+			"    return float4(total_light_contrib*colour, 0);\n";
+		}
+		shader <<
+		"}\n";
+		
+		/// Create shader object
+		HighLevelGpuProgramPtr program = HighLevelGpuProgramManager::getSingleton().createProgram(
+			name, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+			"hlsl", GPT_FRAGMENT_PROGRAM);
+		program->setSource(shader.str());
+		program->setParameter("target","ps_2_0");
+		program->setParameter("entry_point","main");
+		/// Set up default parameters
+		GpuProgramParametersSharedPtr params = program->getDefaultParameters();
+		params->setNamedAutoConstant("worldView", GpuProgramParameters::ACT_WORLDVIEW_MATRIX, 0);
+		params->setNamedAutoConstant("lightDiffuseColor", GpuProgramParameters::ACT_CUSTOM, 1);
+		if(isSpecular)
+			params->setNamedAutoConstant("lightSpecularColor", GpuProgramParameters::ACT_CUSTOM, 2);
+		if(isAttenuated)
+			params->setNamedAutoConstant("lightFalloff", GpuProgramParameters::ACT_CUSTOM, 3);
+
+		return HighLevelGpuProgramManager::getSingleton().getByName(program->getName());
+	}
+	virtual Ogre::MaterialPtr generateTemplateMaterial(Perm permutation)
+	{
+		if(permutation & MLight::MI_QUAD)
+		{
+			return MaterialManager::getSingleton().getByName("DeferredShading/LightMaterialQuad");
+		}
+		else
+		{
+			return MaterialManager::getSingleton().getByName("DeferredShading/LightMaterial");
+		}
+	}
+protected:
+	String mBaseName;
+};
+
+class LightMaterialGeneratorGLSL: public MaterialGenerator::Impl
+{
+public:
+	LightMaterialGeneratorGLSL(const String &baseName):
+		mBaseName(baseName)
+	{}
+	typedef MaterialGenerator::Perm Perm;
+
+	virtual Ogre::GpuProgramPtr generateVertexShader(Perm permutation)
+	{
+		if(permutation & MLight::MI_QUAD)
+		{
+			return HighLevelGpuProgramManager::getSingleton().getByName("DeferredShading/post/glsl/vs");
+		}
+		else
+		{
+			return HighLevelGpuProgramManager::getSingleton().getByName("DeferredShading/post/glsl/LightMaterial_vs");
+		}
+	}
+	virtual Ogre::GpuProgramPtr generateFragmentShader(Perm permutation)
+	{
+		bool isAttenuated = permutation & MLight::MI_ATTENUATED;
+		bool isSpecular = permutation & MLight::MI_SPECULAR;
+		// bool isShadowed = perm&4;
+
+		/// Create name
+		String name=mBaseName+StringConverter::toString(permutation)+"_ps";
+		/// Create shader
+		std::stringstream shader;
+		shader <<
+		"uniform sampler2D tex0;\n"
+		"uniform sampler2D tex1;\n"
+		"varying vec2 texCoord;\n"
+		"varying vec3 projCoord;\n"
+		/// World view matrix to get object position in view space
+		"uniform mat4 worldView;\n"
+		/// Attributes of light
+		"uniform vec3 lightDiffuseColor;\n"
+		"uniform vec3 lightSpecularColor;\n"
+		"uniform vec3 lightFalloff;\n"
+		"void main()\n"
+		"{\n"
+		"	 vec4 a0 = texture2D(tex0, texCoord);\n" // Attribute 0: Diffuse color+shininess
+		"    vec4 a1 = texture2D(tex1, texCoord);\n" // Attribute 1: Normal+depth
+		/// Attributes
+		"    vec3 colour = a0.rgb;\n"
+		"    float alpha = a0.a;\n"		// Specularity
+		"    float distance = a1.w;\n"  // Distance from viewer (w)
+		"    vec3 normal = a1.xyz;\n"
+		/// Calculate position of texel in view space
+		"    vec3 position = projCoord*distance;\n"
+		/// Extract position in view space from worldView matrix
+		"	 vec3 lightPos = vec3(worldView[3][0],worldView[3][1],worldView[3][2]);\n"
+		/// Calculate light direction and distance
+		"    vec3 lightVec = lightPos - position;\n"
+		"    float len_sq = dot(lightVec, lightVec);\n"
+		"    float len = sqrt(len_sq);\n"
+		"    vec3 lightDir = lightVec/len;\n"
+		/// Calculate attenuation
+		"    float attenuation = dot(lightFalloff, vec3(1, len, len_sq));\n"
+		/// Calculate diffuse colour
+		"    vec3 light_diffuse = max(0.0,dot(lightDir, normal)) * lightDiffuseColor;\n"
+		/// Calculate specular component
+		"    vec3 viewDir = -normalize(position);\n"
+		"    vec3 h = normalize(viewDir + lightDir);\n"
+		"    vec3 light_specular = pow(dot(normal, h),32.0) * lightSpecularColor;\n"
+		/// Calcalate total lighting for this fragment
+		"    vec3 total_light_contrib;\n"
+		"    total_light_contrib = light_diffuse;\n";
+		if(isSpecular)
+		{
+			shader<<
+			"	 total_light_contrib += alpha * light_specular;\n";
+		}
+		if(isAttenuated)
+		{
+			shader<<
+			"    gl_FragColor = vec4(total_light_contrib*colour/attenuation, 0);\n";
+		}
+		else
+		{
+			shader<<
+			"    gl_FragColor = vec4(total_light_contrib*colour, 0);\n";
+		}
+		shader<<
+		"}\n";
+		
+		/// Create shader object
+		HighLevelGpuProgramPtr program = HighLevelGpuProgramManager::getSingleton().createProgram(
+			name, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+			"glsl", GPT_FRAGMENT_PROGRAM);
+		program->setSource(shader.str());
+		/// Set up default parameters
+		GpuProgramParametersSharedPtr params = program->getDefaultParameters();
+
+		params->setNamedAutoConstant("worldView", GpuProgramParameters::ACT_WORLDVIEW_MATRIX, 0);
+		params->setNamedAutoConstant("lightDiffuseColor", GpuProgramParameters::ACT_CUSTOM, 1);
+		if(isSpecular)
+			params->setNamedAutoConstant("lightSpecularColor", GpuProgramParameters::ACT_CUSTOM, 2);
+		if(isAttenuated)
+			params->setNamedAutoConstant("lightFalloff", GpuProgramParameters::ACT_CUSTOM, 3);
+
+		params->setNamedConstant("tex0", 0);
+		params->setNamedConstant("tex1", 1);
+
+		return HighLevelGpuProgramManager::getSingleton().getByName(program->getName());
+	}
+	virtual Ogre::MaterialPtr generateTemplateMaterial(Perm permutation)
+	{
+		if(permutation & MLight::MI_QUAD)
+		{
+			return MaterialManager::getSingleton().getByName("DeferredShading/LightMaterialQuad");
+		}
+		else
+		{
+			return MaterialManager::getSingleton().getByName("DeferredShading/LightMaterial");
+		}
+	}
+protected:
+	String mBaseName;
+};
+
+
+LightMaterialGenerator::LightMaterialGenerator(const Ogre::String &language)
+{
+	bitNames.push_back("Quad");		  // MI_QUAD
+	bitNames.push_back("Attenuated"); // MI_ATTENUATED
+	bitNames.push_back("Specular");   // MI_SPECULAR
+
+	vsMask = 0x00000001;
+	fsMask = 0x00000006;
+	matMask = 0x00000001;
+	
+	materialBaseName = "DeferredShading/LightMaterial/";
+	if(language=="hlsl")
+		mImpl = new LightMaterialGeneratorHLSL("DeferredShading/LightMaterial/hlsl/");
+	else
+		mImpl = new LightMaterialGeneratorGLSL("DeferredShading/LightMaterial/glsl/");
+}
Index: /Samples/DeferredShading/src/MLight.cpp
===================================================================
--- /Samples/DeferredShading/src/MLight.cpp	(revision 5)
+++ /Samples/DeferredShading/src/MLight.cpp	(revision 5)
@@ -0,0 +1,274 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+#include "MLight.h"
+
+#include "OgreStringConverter.h"
+#include "OgreException.h"
+
+#include "OgreMesh.h"
+#include "OgreSubMesh.h"
+#include "OgreResourceGroupManager.h"
+#include "OgreMeshManager.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreHardwarePixelBuffer.h"
+#include "OgreHardwareBufferManager.h"
+
+#include "OgreRoot.h"
+
+#include "OgreCamera.h"
+
+#include "MaterialGenerator.h"
+
+using namespace Ogre;
+//-----------------------------------------------------------------------
+MLight::MLight(MaterialGenerator *sys):
+	bIgnoreWorld(false), mGenerator(sys),mPermutation(0)
+{
+	// Set up geometry
+	//setMaterial("DeferredShading/Post/LightMaterial");
+	// Set render priority to high (just after normal postprocess)
+	setRenderQueueGroup(RENDER_QUEUE_2);
+	// Allocate render operation
+	mRenderOp.operationType = Ogre::RenderOperation::OT_TRIANGLE_LIST;
+	mRenderOp.indexData = 0;
+	mRenderOp.vertexData = 0;
+	mRenderOp.useIndexes = true;
+
+	// Diffuse and specular colour
+	setDiffuseColour(Ogre::ColourValue(1,1,1));
+	setSpecularColour(Ogre::ColourValue(0,0,0));
+	// Set Attenuation
+	setAttenuation(1.0f,0.0f,0.0f);
+}
+//-----------------------------------------------------------------------
+MLight::~MLight()
+{
+	// need to release IndexData and vertexData created for renderable
+    delete mRenderOp.indexData;
+    delete mRenderOp.vertexData;
+}
+//-----------------------------------------------------------------------
+void MLight::setAttenuation(float c, float b, float a)
+{
+	// Set Attenuation parameter to shader
+	setCustomParameter(3, Vector4(c, b, a, 0));
+
+	/// There is attenuation? Set material accordingly
+	if(c != 1.0f || b != 0.0f || a != 0.0f)
+		mPermutation |= MI_ATTENUATED;
+	else
+		mPermutation &= ~MI_ATTENUATED;
+
+	// Calculate radius from Attenuation
+	int threshold_level = 15;// differece of 10-15 levels deemed unnoticable
+	float threshold = 1.0f/((float)threshold_level/256.0f); 
+
+	// Use quadratic formula to determine outer radius
+	c = c-threshold;
+	float d=sqrt(b*b-4*a*c);
+	float x=(-2*c)/(b+d);
+
+	rebuildGeometry(x);
+}
+//-----------------------------------------------------------------------
+void MLight::setDiffuseColour(const Ogre::ColourValue &col)
+{
+	setCustomParameter(1, Vector4(col.r, col.g, col.b, col.a));
+}
+//-----------------------------------------------------------------------
+void MLight::setSpecularColour(const Ogre::ColourValue &col)
+{
+	setCustomParameter(2, Vector4(col.r, col.g, col.b, col.a));
+	/// There is a specular component? Set material accordingly
+	
+	if(col.r != 0.0f || col.g != 0.0f || col.b != 0.0f)
+		mPermutation |= MI_SPECULAR;
+	else
+		mPermutation &= ~MI_SPECULAR;
+		
+}
+//-----------------------------------------------------------------------
+Ogre::ColourValue MLight::getDiffuseColour()
+{
+	Ogre::Vector4 val = getCustomParameter(1);
+	return Ogre::ColourValue(val[0], val[1], val[2], val[3]);
+}
+//-----------------------------------------------------------------------
+Ogre::ColourValue MLight::getSpecularColour()
+{
+	Ogre::Vector4 val = getCustomParameter(2);
+	return Ogre::ColourValue(val[0], val[1], val[2], val[3]);
+}
+//-----------------------------------------------------------------------
+void MLight::rebuildGeometry(float radius)
+{
+	// Scale node to radius
+	
+	if(radius > 10000.0f)
+	{
+		createRectangle2D();
+		mPermutation |= MI_QUAD;
+	}
+	else
+	{
+		/// XXX some more intelligent expression for rings and segments
+		createSphere(radius, 5, 5);
+		mPermutation &= ~MI_QUAD;
+	}	
+}
+//-----------------------------------------------------------------------
+void MLight::createRectangle2D()
+{
+	/// XXX this RenderOp should really be re-used between MLight objects,
+	/// not generated every time
+	delete mRenderOp.vertexData; 
+	delete mRenderOp.indexData; 
+	mRenderOp.vertexData = new VertexData();
+    mRenderOp.indexData = 0;
+
+    mRenderOp.vertexData->vertexCount = 4; 
+    mRenderOp.vertexData->vertexStart = 0; 
+    mRenderOp.operationType = RenderOperation::OT_TRIANGLE_STRIP; 
+    mRenderOp.useIndexes = false; 
+
+    VertexDeclaration* decl = mRenderOp.vertexData->vertexDeclaration;
+    VertexBufferBinding* bind = mRenderOp.vertexData->vertexBufferBinding;
+
+    decl->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+
+    HardwareVertexBufferSharedPtr vbuf = 
+        HardwareBufferManager::getSingleton().createVertexBuffer(
+        decl->getVertexSize(0),
+        mRenderOp.vertexData->vertexCount,
+        HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+
+    // Bind buffer
+    bind->setBinding(0, vbuf);
+	// Upload data
+	float data[]={
+		-1,1,-1,  // corner 1
+		-1,-1,-1, // corner 2
+		1,1,-1,   // corner 3
+		1,-1,-1}; // corner 4
+	vbuf->writeData(0, sizeof(data), data, true);
+
+	// Set bounding
+    setBoundingBox(AxisAlignedBox(-10000,-10000,-10000,10000,10000,10000));
+	mRadius = 15000;
+	bIgnoreWorld = true;
+}
+//-----------------------------------------------------------------------
+void MLight::createSphere(const float r, const int nRings, const int nSegments)
+{
+	delete mRenderOp.vertexData; 
+	delete mRenderOp.indexData;
+	mRenderOp.operationType = Ogre::RenderOperation::OT_TRIANGLE_LIST;
+	mRenderOp.indexData = new IndexData();
+	mRenderOp.vertexData = new VertexData();
+	mRenderOp.useIndexes = true;
+
+	VertexData* vertexData = mRenderOp.vertexData;
+	IndexData* indexData = mRenderOp.indexData;
+
+	// define the vertex format
+	VertexDeclaration* vertexDecl = vertexData->vertexDeclaration;
+	size_t currOffset = 0;
+	// only generate positions
+	vertexDecl->addElement(0, currOffset, VET_FLOAT3, VES_POSITION);
+	currOffset += VertexElement::getTypeSize(VET_FLOAT3);
+	// allocate the vertex buffer
+	vertexData->vertexCount = (nRings + 1) * (nSegments+1);
+	HardwareVertexBufferSharedPtr vBuf = HardwareBufferManager::getSingleton().createVertexBuffer(vertexDecl->getVertexSize(0), vertexData->vertexCount, HardwareBuffer::HBU_STATIC_WRITE_ONLY, false);
+	VertexBufferBinding* binding = vertexData->vertexBufferBinding;
+	binding->setBinding(0, vBuf);
+	float* pVertex = static_cast<float*>(vBuf->lock(HardwareBuffer::HBL_DISCARD));
+
+	// allocate index buffer
+	indexData->indexCount = 6 * nRings * (nSegments + 1);
+	indexData->indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(HardwareIndexBuffer::IT_16BIT, indexData->indexCount, HardwareBuffer::HBU_STATIC_WRITE_ONLY, false);
+	HardwareIndexBufferSharedPtr iBuf = indexData->indexBuffer;
+	unsigned short* pIndices = static_cast<unsigned short*>(iBuf->lock(HardwareBuffer::HBL_DISCARD));
+
+	float fDeltaRingAngle = (Math::PI / nRings);
+	float fDeltaSegAngle = (2 * Math::PI / nSegments);
+	unsigned short wVerticeIndex = 0 ;
+
+	// Generate the group of rings for the sphere
+	for( int ring = 0; ring <= nRings; ring++ ) {
+		float r0 = r * sinf (ring * fDeltaRingAngle);
+		float y0 = r * cosf (ring * fDeltaRingAngle);
+
+		// Generate the group of segments for the current ring
+		for(int seg = 0; seg <= nSegments; seg++) {
+			float x0 = r0 * sinf(seg * fDeltaSegAngle);
+			float z0 = r0 * cosf(seg * fDeltaSegAngle);
+
+			// Add one vertex to the strip which makes up the sphere
+			*pVertex++ = x0;
+			*pVertex++ = y0;
+			*pVertex++ = z0;
+
+			if (ring != nRings) 
+			{
+                // each vertex (except the last) has six indicies pointing to it
+				*pIndices++ = wVerticeIndex + nSegments + 1;
+				*pIndices++ = wVerticeIndex;               
+				*pIndices++ = wVerticeIndex + nSegments;
+				*pIndices++ = wVerticeIndex + nSegments + 1;
+				*pIndices++ = wVerticeIndex + 1;
+				*pIndices++ = wVerticeIndex;
+				wVerticeIndex ++;
+			}
+		}; // end for seg
+	} // end for ring
+
+	// Unlock
+	vBuf->unlock();
+	iBuf->unlock();
+
+	// Set bounding box and sphere
+	setBoundingBox( AxisAlignedBox( Vector3(-r, -r, -r), Vector3(r, r, r) ) );
+	mRadius = r;
+	bIgnoreWorld = false;
+}								 
+//-----------------------------------------------------------------------
+Real MLight::getBoundingRadius(void) const
+{
+	return mRadius;
+}
+//-----------------------------------------------------------------------
+Ogre::Real MLight::getSquaredViewDepth(const Ogre::Camera* cam) const
+{
+	if(bIgnoreWorld)
+	{
+		return 0.0f;
+	}
+	else
+	{
+		Vector3 dist = cam->getDerivedPosition() - getWorldPosition();                                                                       
+		return dist.squaredLength();
+	}
+}
+//-----------------------------------------------------------------------
+const MaterialPtr& MLight::getMaterial(void) const
+{
+	return mGenerator->getMaterial(mPermutation);
+}
Index: /Samples/DeferredShading/src/Makefile.am
===================================================================
--- /Samples/DeferredShading/src/Makefile.am	(revision 5)
+++ /Samples/DeferredShading/src/Makefile.am	(revision 5)
@@ -0,0 +1,11 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/DeferredShading/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = DeferredShading
+DeferredShading_SOURCES = DeferredShading.cpp \
+DeferredShadingDemo.cpp \
+LightMaterialGenerator.cpp \
+MaterialGenerator.cpp \
+MLight.cpp
+
+DeferredShading_LDFLAGS = -L$(top_builddir)/OgreMain/src
+DeferredShading_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/DeferredShading/src/Makefile.in
===================================================================
--- /Samples/DeferredShading/src/Makefile.in	(revision 5)
+++ /Samples/DeferredShading/src/Makefile.in	(revision 5)
@@ -0,0 +1,537 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = DeferredShading$(EXEEXT)
+subdir = Samples/DeferredShading/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_DeferredShading_OBJECTS = DeferredShading.$(OBJEXT) \
+	DeferredShadingDemo.$(OBJEXT) LightMaterialGenerator.$(OBJEXT) \
+	MaterialGenerator.$(OBJEXT) MLight.$(OBJEXT)
+DeferredShading_OBJECTS = $(am_DeferredShading_OBJECTS)
+am__DEPENDENCIES_1 =
+DeferredShading_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(DeferredShading_SOURCES)
+DIST_SOURCES = $(DeferredShading_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/DeferredShading/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+DeferredShading_SOURCES = DeferredShading.cpp \
+DeferredShadingDemo.cpp \
+LightMaterialGenerator.cpp \
+MaterialGenerator.cpp \
+MLight.cpp
+
+DeferredShading_LDFLAGS = -L$(top_builddir)/OgreMain/src
+DeferredShading_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/DeferredShading/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/DeferredShading/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+DeferredShading$(EXEEXT): $(DeferredShading_OBJECTS) $(DeferredShading_DEPENDENCIES) 
+	@rm -f DeferredShading$(EXEEXT)
+	$(CXXLINK) $(DeferredShading_LDFLAGS) $(DeferredShading_OBJECTS) $(DeferredShading_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DeferredShading.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DeferredShadingDemo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LightMaterialGenerator.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLight.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MaterialGenerator.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/DeferredShading/src/MaterialGenerator.cpp
===================================================================
--- /Samples/DeferredShading/src/MaterialGenerator.cpp	(revision 5)
+++ /Samples/DeferredShading/src/MaterialGenerator.cpp	(revision 5)
@@ -0,0 +1,132 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+
+#include "MaterialGenerator.h"
+
+#include "OgreStringConverter.h"
+#include "OgreException.h"
+
+#include "OgrePass.h"
+#include "OgreTechnique.h"
+
+#include "OgreHighLevelGpuProgram.h"
+#include "OgreHighLevelGpuProgramManager.h"
+
+using namespace Ogre;
+
+MaterialGenerator::MaterialGenerator():
+	vsMask(0), fsMask(0), matMask(0), mImpl(0)
+{
+}
+MaterialGenerator::~MaterialGenerator()
+{
+	delete mImpl;
+}
+
+const Ogre::MaterialPtr &MaterialGenerator::getMaterial(Perm permutation)
+{
+	/// Check input validity
+	size_t totalBits = bitNames.size();
+	size_t totalPerms = 1<<totalBits;
+	assert(permutation < totalPerms);
+
+	/// Check if material/shader permutation already was generated
+	MaterialMap::iterator i = mMaterials.find(permutation);
+	if(i != mMaterials.end())
+	{
+		return i->second;
+	}
+	else
+	{
+		/// Create it
+		Ogre::MaterialPtr templ = getTemplateMaterial(permutation & matMask);
+		Ogre::GpuProgramPtr vs = getVertexShader(permutation & vsMask);
+		Ogre::GpuProgramPtr fs = getFragmentShader(permutation & fsMask);
+		
+		/// Create material name
+		String name=materialBaseName;
+		for(size_t bit=0; bit<totalBits; ++bit)
+			if(permutation & (1<<bit))
+				name += bitNames[bit];
+
+		std::cerr << name << " " << vs->getName() << " " << fs->getName() << std::endl;
+		/// Create material from template, and set shaders
+		MaterialPtr mat = templ->clone(name);
+		Technique *tech = mat->getTechnique(0);
+		Pass *pass = tech->getPass(0);
+		pass->setFragmentProgram(fs->getName());
+		pass->setVertexProgram(vs->getName());
+
+		/// And store it
+		mMaterials[permutation] = mat;
+		return mMaterials[permutation];
+	}
+}
+
+const Ogre::GpuProgramPtr &MaterialGenerator::getVertexShader(Perm permutation)
+{
+	ProgramMap::iterator i = mVs.find(permutation);
+	if(i != mVs.end())
+	{
+		return i->second;
+	}
+	else
+	{
+		/// Create it
+		mVs[permutation] = mImpl->generateVertexShader(permutation);
+		return mVs[permutation];
+	}
+}
+
+const Ogre::GpuProgramPtr &MaterialGenerator::getFragmentShader(Perm permutation)
+{
+	ProgramMap::iterator i = mFs.find(permutation);
+	if(i != mFs.end())
+	{
+		return i->second;
+	}
+	else
+	{
+		/// Create it
+		mFs[permutation] = mImpl->generateFragmentShader(permutation);
+		return mFs[permutation];
+	}
+}
+
+const Ogre::MaterialPtr &MaterialGenerator::getTemplateMaterial(Perm permutation)
+{
+	MaterialMap::iterator i = mTemplateMat.find(permutation);
+	if(i != mTemplateMat.end())
+	{
+		return i->second;
+	}
+	else
+	{
+		/// Create it
+		mTemplateMat[permutation] = mImpl->generateTemplateMaterial(permutation);
+		return mTemplateMat[permutation];
+	}
+}
+
+MaterialGenerator::Impl::~Impl()
+{
+}
+
Index: /Samples/Dot3Bump/Makefile.am
===================================================================
--- /Samples/Dot3Bump/Makefile.am	(revision 5)
+++ /Samples/Dot3Bump/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src 
Index: /Samples/Dot3Bump/Makefile.in
===================================================================
--- /Samples/Dot3Bump/Makefile.in	(revision 5)
+++ /Samples/Dot3Bump/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Dot3Bump
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src 
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Dot3Bump/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Dot3Bump/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Dot3Bump/scripts/Demo_Dot3Bump.cbp
===================================================================
--- /Samples/Dot3Bump/scripts/Demo_Dot3Bump.cbp	(revision 5)
+++ /Samples/Dot3Bump/scripts/Demo_Dot3Bump.cbp	(revision 5)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Dot3Bump" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Dot3Bump.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Dot3Bump.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\Dot3Bump.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Dot3Bump/scripts/Demo_Dot3Bump.vcproj
===================================================================
--- /Samples/Dot3Bump/scripts/Demo_Dot3Bump.vcproj	(revision 5)
+++ /Samples/Dot3Bump/scripts/Demo_Dot3Bump.vcproj	(revision 5)
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_Dot3Bump"
+	ProjectGUID="{279EA6C7-59CF-48E4-BAC7-3C356A8114F6}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_Dot3Bump.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_Dot3Bump.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_Dot3Bump.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\Dot3Bump.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Dot3Bump/scripts/Demo_Dot3Bump_linux.cbp
===================================================================
--- /Samples/Dot3Bump/scripts/Demo_Dot3Bump_linux.cbp	(revision 5)
+++ /Samples/Dot3Bump/scripts/Demo_Dot3Bump_linux.cbp	(revision 5)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Dot3Bump" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_Dot3Bump" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_Dot3Bump" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../src/Dot3Bump.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Dot3Bump/scripts/Demo_Dot3Bump_stlp.cbp
===================================================================
--- /Samples/Dot3Bump/scripts/Demo_Dot3Bump_stlp.cbp	(revision 5)
+++ /Samples/Dot3Bump/scripts/Demo_Dot3Bump_stlp.cbp	(revision 5)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_Dot3Bump" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Dot3Bump.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Dot3Bump.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\Dot3Bump.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Dot3Bump/scripts/Demo_Dot3Bump_vc8.vcproj
===================================================================
--- /Samples/Dot3Bump/scripts/Demo_Dot3Bump_vc8.vcproj	(revision 5)
+++ /Samples/Dot3Bump/scripts/Demo_Dot3Bump_vc8.vcproj	(revision 5)
@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_Dot3Bump"
+	ProjectGUID="{279EA6C7-59CF-48E4-BAC7-3C356A8114F6}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_Dot3Bump.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_Dot3Bump.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_Dot3Bump.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\Dot3Bump.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Dot3Bump/scripts/Demo_Dot3Bump_vc8.vcproj.user
===================================================================
--- /Samples/Dot3Bump/scripts/Demo_Dot3Bump_vc8.vcproj.user	(revision 5)
+++ /Samples/Dot3Bump/scripts/Demo_Dot3Bump_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/Dot3Bump/src/Dot3Bump.cpp
===================================================================
--- /Samples/Dot3Bump/src/Dot3Bump.cpp	(revision 5)
+++ /Samples/Dot3Bump/src/Dot3Bump.cpp	(revision 5)
@@ -0,0 +1,336 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        Dot3Bump.cpp
+    \brief
+        Specialisation of OGRE's framework application to show the
+        dotproduct blending operation and normalization cube map usage
+		for achieving bump mapping effect
+	\par
+		Tangent space computations made through the guide of the
+		tutorial on bump mapping from http://users.ox.ac.uk/~univ1234
+		author : paul.baker@univ.ox.ac.uk
+**/
+
+#include "ExampleApplication.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+// entities we'll use
+#define NUM_ENTITIES 3
+Entity* mEntities[NUM_ENTITIES];
+String mEntityMeshes[NUM_ENTITIES] = 
+{
+    "athene.mesh",
+    "knot.mesh",
+    "ogrehead.mesh"
+};
+size_t mCurrentEntity = 0;
+
+// Lights
+#define NUM_LIGHTS 3
+
+// the light
+Light *mLights[NUM_LIGHTS];
+// billboards for lights
+BillboardSet* mLightFlareSets[NUM_LIGHTS];
+Billboard* mLightFlares[NUM_LIGHTS];
+// Positions for lights
+Vector3 mLightPositions[NUM_LIGHTS] = 
+{
+	Vector3(300,0,0),
+	Vector3(-300,50,0),
+	Vector3(0, -300, -100)
+};
+// Base orientations of the lights 
+Radian mLightRotationAngles[NUM_LIGHTS] = { Degree(0), Degree(30), Degree(75) };
+Vector3 mLightRotationAxes[NUM_LIGHTS] = {
+    Vector3::UNIT_X, 
+    Vector3::UNIT_Z,
+    Vector3::UNIT_Y
+};
+// Rotation speed for lights, degrees per second
+Real mLightSpeeds[NUM_LIGHTS] = { 30, 10, 50};
+
+// Colours for the lights
+ColourValue mDiffuseLightColours[NUM_LIGHTS] =
+{
+	ColourValue(1, 1, 1),
+	ColourValue(1, 0, 0),
+	ColourValue(1, 1, 0.5)
+};
+ColourValue mSpecularLightColours[NUM_LIGHTS] =
+{
+	ColourValue(1, 1, 1),
+	ColourValue(1, 0.8, 0.8),
+	ColourValue(1, 1, 0.8)
+};
+// Which lights are enabled
+bool mLightState[NUM_LIGHTS] = 
+{
+	true,
+	true,
+	false
+};
+// The materials
+#define NUM_MATERIALS 4
+String mMaterialNames[NUM_ENTITIES][NUM_MATERIALS] = 
+{
+    // athene
+    "Examples/Athene/Basic",
+    "Examples/Athene/NormalMapped",
+    "Examples/Athene/NormalMappedSpecular",
+    "Examples/Athene/NormalMapped",
+    // knot
+	"Examples/BumpMapping/SingleLight",
+	"Examples/BumpMapping/MultiLight",
+	"Examples/BumpMapping/MultiLightSpecular",
+    "Examples/OffsetMapping/Specular",
+    // ogre head
+    "Examples/BumpMapping/SingleLight",
+    "Examples/BumpMapping/MultiLight",
+    "Examples/BumpMapping/MultiLightSpecular",
+    "Examples/OffsetMapping/Specular"
+};
+size_t mCurrentMaterial = 1;
+
+// the scene node of the entity
+SceneNode *mMainNode;
+// the light nodes
+SceneNode* mLightNodes[NUM_LIGHTS];
+// the light node pivots
+SceneNode* mLightPivots[NUM_LIGHTS];
+
+OverlayElement* mObjectInfo;
+OverlayElement* mMaterialInfo;
+OverlayElement* mInfo;
+
+#define KEY_PRESSED(_key,_timeDelay, _macro) \
+{ \
+    if (mKeyboard->isKeyDown(_key) && timeDelay <= 0) \
+    { \
+		timeDelay = _timeDelay; \
+        _macro ; \
+    } \
+}
+
+
+
+// Event handler to add ability to change material
+class Dp3_Listener : public ExampleFrameListener
+{
+public:
+    Dp3_Listener(RenderWindow* win, Camera* cam)
+        : ExampleFrameListener(win, cam)
+    {
+    }
+
+    void flipLightState(size_t i)
+    {
+        mLightState[i] = !mLightState[i];
+        mLights[i]->setVisible(mLightState[i]);
+        mLightFlareSets[i]->setVisible(mLightState[i]);
+    }
+    bool frameStarted(const FrameEvent& evt)
+    {
+	using namespace OIS;
+
+        if(!ExampleFrameListener::frameStarted(evt))
+            return false;
+        
+        static Real timeDelay = 0;
+
+        timeDelay -= evt.timeSinceLastFrame;
+
+		// switch meshes
+        KEY_PRESSED(KC_O, 1, 
+            mEntities[mCurrentEntity]->setVisible(false); 
+            mCurrentEntity = (++mCurrentEntity) % NUM_ENTITIES; 
+            mEntities[mCurrentEntity]->setVisible(true);
+            mEntities[mCurrentEntity]->setMaterialName(mMaterialNames[mCurrentEntity][mCurrentMaterial]);
+            mObjectInfo->setCaption("Current: " + mEntityMeshes[mCurrentEntity]);
+            mMaterialInfo->setCaption("Current: " + mMaterialNames[mCurrentEntity][mCurrentMaterial]);
+        );
+
+		// switch materials
+		KEY_PRESSED(KC_M, 1, 
+            mCurrentMaterial = (++mCurrentMaterial) % NUM_MATERIALS; 
+            mEntities[mCurrentEntity]->setMaterialName(mMaterialNames[mCurrentEntity][mCurrentMaterial]);
+            mMaterialInfo->setCaption("Current: " + mMaterialNames[mCurrentEntity][mCurrentMaterial]);
+        );
+
+		// enable / disable lights
+		KEY_PRESSED(KC_1, 1, flipLightState(0));
+		// switch materials
+		KEY_PRESSED(KC_2, 1, flipLightState(1));
+		// switch materials
+		KEY_PRESSED(KC_3, 1, flipLightState(2));
+
+        // animate the lights
+        for (size_t i = 0; i < NUM_LIGHTS; ++i)
+            mLightPivots[i]->rotate(Ogre::Vector3::UNIT_Z, Degree(mLightSpeeds[i] * evt.timeSinceLastFrame));
+
+		return true;
+    }
+
+};
+
+class Dp3_Application : public ExampleApplication
+{
+public:
+    Dp3_Application() {}
+	
+protected:
+	SceneNode *mpObjsNode; // the node wich will hold our entities
+
+	void createScene(void)
+    {
+        // First check that vertex programs and dot3 or fragment programs are supported
+		const RenderSystemCapabilities* caps = Root::getSingleton().getRenderSystem()->getCapabilities();
+        if (!caps->hasCapability(RSC_VERTEX_PROGRAM))
+        {
+            OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "Your card does not support vertex programs, so cannot "
+                "run this demo. Sorry!", 
+                "Dot3Bump::createScene");
+        }
+        if (!(caps->hasCapability(RSC_FRAGMENT_PROGRAM) 
+			|| caps->hasCapability(RSC_DOT3)) )
+        {
+            OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "Your card does not support dot3 blending or fragment programs, so cannot "
+                "run this demo. Sorry!", 
+                "Dot3Bump::createScene");
+        }
+
+        // Set ambient light and fog
+        mSceneMgr->setAmbientLight(ColourValue(0.0, 0.0, 0.0));
+        /*
+		// Define a floor plane mesh
+        Plane p;
+        p.normal = Vector3::UNIT_Y;
+        p.d = 200;
+        MeshManager::getSingleton().createPlane("FloorPlane",p,2000,2000,1,1,true,1,5,5,Vector3::UNIT_Z);
+        // Create an entity (the floor)
+        Entity *floorEnt = mSceneMgr->createEntity("floor", "FloorPlane");
+        floorEnt->setMaterialName("Examples/DP3Terrain");
+        mSceneMgr->getRootSceneNode()->attachObject(floorEnt);
+        */
+
+        mMainNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+
+        // Load the meshes with non-default HBU options
+		for(int mn = 0; mn < NUM_ENTITIES; mn++) {
+			MeshPtr pMesh = MeshManager::getSingleton().load(mEntityMeshes[mn],
+                ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,    
+                HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, 
+				HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
+				true, true); //so we can still read it
+            // Build tangent vectors, all our meshes use only 1 texture coordset 
+			// Note we can build into VES_TANGENT now (SM2+)
+            unsigned short src, dest;
+            if (!pMesh->suggestTangentVectorBuildParams(VES_TANGENT, src, dest))
+            {
+                pMesh->buildTangentVectors(VES_TANGENT, src, dest);
+            }
+            // Create entity
+            mEntities[mn] = mSceneMgr->createEntity("Ent" + StringConverter::toString(mn), 
+                mEntityMeshes[mn]);
+            // Attach to child of root node
+    		mMainNode->attachObject(mEntities[mn]);
+            // Make invisible, except for index 0
+            if (mn == 0)
+                mEntities[mn]->setMaterialName(mMaterialNames[mCurrentEntity][mCurrentMaterial]);
+            else
+                mEntities[mn]->setVisible(false);
+		}
+
+        for (unsigned int i = 0; i < NUM_LIGHTS; ++i)
+        {
+            mLightPivots[i] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+            mLightPivots[i]->rotate(mLightRotationAxes[i], mLightRotationAngles[i]);
+            // Create a light, use default parameters
+            mLights[i] = mSceneMgr->createLight("Light" + StringConverter::toString(i));
+			mLights[i]->setPosition(mLightPositions[i]);
+			mLights[i]->setDiffuseColour(mDiffuseLightColours[i]);
+			mLights[i]->setSpecularColour(mSpecularLightColours[i]);
+			mLights[i]->setVisible(mLightState[i]);
+            // Attach light
+            mLightPivots[i]->attachObject(mLights[i]);
+			// Create billboard for light
+			mLightFlareSets[i] = mSceneMgr->createBillboardSet("Flare" + StringConverter::toString(i));
+			mLightFlareSets[i]->setMaterialName("Examples/Flare");
+			mLightPivots[i]->attachObject(mLightFlareSets[i]);
+			mLightFlares[i] = mLightFlareSets[i]->createBillboard(mLightPositions[i]);
+			mLightFlares[i]->setColour(mDiffuseLightColours[i]);
+			mLightFlareSets[i]->setVisible(mLightState[i]);
+        }
+        // move the camera a bit right and make it look at the knot
+		mCamera->moveRelative(Vector3(50, 0, 20));
+		mCamera->lookAt(0, 0, 0);
+		// show overlay
+		Overlay* pOver = OverlayManager::getSingleton().getByName("Example/DP3Overlay");    
+        mObjectInfo = OverlayManager::getSingleton().getOverlayElement("Example/DP3/ObjectInfo");
+        mMaterialInfo = OverlayManager::getSingleton().getOverlayElement("Example/DP3/MaterialInfo");
+        mInfo = OverlayManager::getSingleton().getOverlayElement("Example/DP3/Info");
+
+        mObjectInfo->setCaption("Current: " + mEntityMeshes[mCurrentEntity]);
+        mMaterialInfo->setCaption("Current: " + mMaterialNames[mCurrentEntity][mCurrentMaterial]);
+        if (!caps->hasCapability(RSC_FRAGMENT_PROGRAM))
+        {
+            mInfo->setCaption("NOTE: Light colours and specular highlights are not supported by your card.");
+        }
+		pOver->show();
+	}
+
+    // Create new frame listener
+    void createFrameListener(void)
+    {
+        mFrameListener= new Dp3_Listener(mWindow, mCamera);
+        mRoot->addFrameListener(mFrameListener);
+    }
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+    // Create application object
+    Dp3_Application app;
+
+    try {
+        app.go();
+    } catch( Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/Dot3Bump/src/Makefile.am
===================================================================
--- /Samples/Dot3Bump/src/Makefile.am	(revision 5)
+++ /Samples/Dot3Bump/src/Makefile.am	(revision 5)
@@ -0,0 +1,7 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = Dot3Bump
+
+Dot3Bump_SOURCES = Dot3Bump.cpp
+Dot3Bump_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Dot3Bump_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/Dot3Bump/src/Makefile.in
===================================================================
--- /Samples/Dot3Bump/src/Makefile.in	(revision 5)
+++ /Samples/Dot3Bump/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = Dot3Bump$(EXEEXT)
+subdir = Samples/Dot3Bump/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_Dot3Bump_OBJECTS = Dot3Bump.$(OBJEXT)
+Dot3Bump_OBJECTS = $(am_Dot3Bump_OBJECTS)
+am__DEPENDENCIES_1 =
+Dot3Bump_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Dot3Bump_SOURCES)
+DIST_SOURCES = $(Dot3Bump_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+Dot3Bump_SOURCES = Dot3Bump.cpp
+Dot3Bump_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Dot3Bump_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Dot3Bump/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Dot3Bump/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+Dot3Bump$(EXEEXT): $(Dot3Bump_OBJECTS) $(Dot3Bump_DEPENDENCIES) 
+	@rm -f Dot3Bump$(EXEEXT)
+	$(CXXLINK) $(Dot3Bump_LDFLAGS) $(Dot3Bump_OBJECTS) $(Dot3Bump_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Dot3Bump.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/DynTex/Makefile.am
===================================================================
--- /Samples/DynTex/Makefile.am	(revision 5)
+++ /Samples/DynTex/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/DynTex/Makefile.in
===================================================================
--- /Samples/DynTex/Makefile.in	(revision 5)
+++ /Samples/DynTex/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/DynTex
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/DynTex/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/DynTex/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/DynTex/include/Makefile.in
===================================================================
--- /Samples/DynTex/include/Makefile.in	(revision 5)
+++ /Samples/DynTex/include/Makefile.in	(revision 5)
@@ -0,0 +1,386 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/DynTex/include
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/DynTex/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/DynTex/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	distclean distclean-generic distclean-libtool distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-exec install-exec-am \
+	install-info install-info-am install-man install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/DynTex/scripts/Demo_DynTex.cbp
===================================================================
--- /Samples/DynTex/scripts/Demo_DynTex.cbp	(revision 5)
+++ /Samples/DynTex/scripts/Demo_DynTex.cbp	(revision 5)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_DynTex" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_DynTex.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug\" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_DynTex.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release\" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\DynTex.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/DynTex/scripts/Demo_DynTex.vcproj
===================================================================
--- /Samples/DynTex/scripts/Demo_DynTex.vcproj	(revision 5)
+++ /Samples/DynTex/scripts/Demo_DynTex.vcproj	(revision 5)
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_DynTex"
+	ProjectGUID="{8330C155-7C4B-4564-A7D9-946DE5A19B27}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_DynTex.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_DynTex.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_DynTex.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\DynTex.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/DynTex/scripts/Demo_DynTex_linux.cbp
===================================================================
--- /Samples/DynTex/scripts/Demo_DynTex_linux.cbp	(revision 5)
+++ /Samples/DynTex/scripts/Demo_DynTex_linux.cbp	(revision 5)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_DynTex" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_DynTex" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug/" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_DynTex" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release/" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../src/DynTex.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/DynTex/scripts/Demo_DynTex_stlp.cbp
===================================================================
--- /Samples/DynTex/scripts/Demo_DynTex_stlp.cbp	(revision 5)
+++ /Samples/DynTex/scripts/Demo_DynTex_stlp.cbp	(revision 5)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_DynTex" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_DynTex.exe" />
+				<Option working_dir="..\..\Common\bin\Debug\" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_DynTex.exe" />
+				<Option working_dir="..\..\Common\bin\Release\" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\DynTex.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/DynTex/scripts/Demo_DynTex_vc8.vcproj
===================================================================
--- /Samples/DynTex/scripts/Demo_DynTex_vc8.vcproj	(revision 5)
+++ /Samples/DynTex/scripts/Demo_DynTex_vc8.vcproj	(revision 5)
@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_DynTex"
+	ProjectGUID="{8330C155-7C4B-4564-A7D9-946DE5A19B27}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_DynTex.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_DynTex.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_DynTex.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\DynTex.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/DynTex/scripts/Demo_DynTex_vc8.vcproj.user
===================================================================
--- /Samples/DynTex/scripts/Demo_DynTex_vc8.vcproj.user	(revision 5)
+++ /Samples/DynTex/scripts/Demo_DynTex_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/DynTex/src/DynTex.cpp
===================================================================
--- /Samples/DynTex/src/DynTex.cpp	(revision 5)
+++ /Samples/DynTex/src/DynTex.cpp	(revision 5)
@@ -0,0 +1,439 @@
+// Dynamic texturing demo
+//
+// Feel free to use this for anything you want (Wumpus, OGRE Team 2004). This file is public domain.
+// Uses the Grey-Scott diffusion reaction process, a nice overview of the parameter space can be seen at
+//   http://www.cacr.caltech.edu/ismap/image.html
+//
+// Some very cool effects can be reached with some combinations of parameters, varying the parameters 
+// during growth gives even more curious things.
+//
+// Use 1-8 to change parameters, and 0 to reset to initial conditions
+
+#include "ExampleApplication.h"
+#include <OgreTexture.h>
+#include <OgreHardwarePixelBuffer.h>
+#include <OgreTextureManager.h>
+#include <OgreLogManager.h>
+#include <sstream>
+TexturePtr ptex;
+HardwarePixelBufferSharedPtr buffer;
+Overlay* overlay;
+static const int reactorExtent = 130; // must be 2^N + 2
+uint32 clut[1024];
+AnimationState *swim;
+// Nano fixed point library
+#define FROMFLOAT(X) ((int)((X)*((float)(1<<16))))
+#define TOFLOAT(X) ((float)((X)/((float)(1<<16))))
+#define MULT(X,Y) (((X)*(Y))>>16)
+ColourValue HSVtoRGB( float h, float s, float v )
+{
+	int i;
+	ColourValue rv(0.0f, 0.0f, 0.0f, 1.0f);
+	float f, p, q, t;
+	h = fmodf(h, 360.0f);
+	h /= 60.0f;			// sector 0 to 5
+	i = (int)floor( h );
+	f = h - i;			// factorial part of h
+	p = v * ( 1.0f - s );
+	q = v * ( 1.0f - s * f );
+	t = v * ( 1.0f - s * ( 1.0f - f ) );
+	
+	switch( i ) {
+		case 0:	rv.r = v;	rv.g = t;	rv.b = p;	break;
+		case 1:	rv.r = q;	rv.g = v;	rv.b = p;	break;
+		case 2:	rv.r = p;	rv.g = v;	rv.b = t;	break;
+		case 3:	rv.r = p;	rv.g = q;	rv.b = v;	break;
+		case 4:	rv.r = t;	rv.g = p;	rv.b = v;	break;
+		default:	rv.r = v;	rv.g = p;	rv.b = q;	break;
+	}
+	return rv;
+}
+class DynTexFrameListener : public ExampleFrameListener
+{
+private:
+    static float fDefDim;
+    static float fDefVel;
+	float tim;
+	
+	int *chemical[2];
+	int *delta[2];
+	size_t mSize;
+	int dt,hdiv0,hdiv1; // diffusion parameters
+	int F,k; // reaction parameters
+
+	bool rpressed;
+public:
+    DynTexFrameListener(RenderWindow* win, Camera* cam) : ExampleFrameListener( win, cam )
+    {
+		tim = 0;
+		rpressed = false;
+		// Create  colour lookup
+		for(unsigned int col=0; col<1024; col++) 
+		{
+			ColourValue c;
+			c = HSVtoRGB((1.0f-col/1024.0f)*90.0f+225.0f, 0.9f, 0.75f+0.25f*(1.0f-col/1024.0f));
+			c.a = 1.0f - col/1024.0f;
+			PixelUtil::packColour(c, PF_A8R8G8B8, &clut[col]);
+		}
+		// Setup
+		LogManager::getSingleton().logMessage("Creating chemical containment");
+		mSize = reactorExtent*reactorExtent;
+		chemical[0] = new int [mSize];
+		chemical[1] = new int [mSize];
+		delta[0] = new int [mSize];
+		delta[1] = new int [mSize];
+		
+		dt = FROMFLOAT(2.0f);
+		hdiv0 = FROMFLOAT(2.0E-5f/(2.0f*0.01f*0.01f)); // a / (2.0f*h*h); -- really diffusion rate 
+		hdiv1 = FROMFLOAT(1.0E-5f/(2.0f*0.01f*0.01f)); // a / (2.0f*h*h); -- really diffusion rate 
+		//k = FROMFLOAT(0.056f);
+		//F = FROMFLOAT(0.020f);
+		k = FROMFLOAT(0.0619f);
+		F = FROMFLOAT(0.0316f);
+		
+		resetReactor();
+		fireUpReactor();
+		updateInfoParamF();
+		updateInfoParamK();
+		updateInfoParamA0();
+		updateInfoParamA1();
+		
+		LogManager::getSingleton().logMessage("Cthulhu dawn");
+    }
+	void resetReactor()
+	{
+		LogManager::getSingleton().logMessage("Facilitating neutral start up conditions");
+		for(unsigned int x=0; x<mSize; x++) 
+		{
+			chemical[0][x] = FROMFLOAT(1.0f);
+			chemical[1][x] = FROMFLOAT(0.0f);
+		}
+	}
+	void fireUpReactor()
+	{
+		LogManager::getSingleton().logMessage("Warning: reactor is being fired up");
+		int center = reactorExtent/2;
+		for(unsigned int x=center-10; x<center+10; x++) 
+		{
+			for(unsigned int y=center-10; y<center+10; y++) 
+			{
+				chemical[0][y*reactorExtent+x] = FROMFLOAT(0.5f) + rand()%FROMFLOAT(0.1);
+				chemical[1][y*reactorExtent+x] = FROMFLOAT(0.25f) + rand()%FROMFLOAT(0.1);
+			}
+		}
+		LogManager::getSingleton().logMessage("Warning: reaction has begun");
+	}
+	
+	void runStep()
+	{
+		unsigned int x, y;
+		for(x=0; x<mSize; x++) 
+		{
+			delta[0][x] = 0;
+			delta[1][x] = 0;
+		}
+		// Boundary conditions
+		unsigned int idx;
+		idx = 0;
+		for(y=0; y<reactorExtent; y++) 
+		{
+			chemical[0][idx] = chemical[0][idx+reactorExtent-2];
+			chemical[0][idx+reactorExtent-1] = chemical[0][idx+1];
+			chemical[1][idx] = chemical[1][idx+reactorExtent-2];
+			chemical[1][idx+reactorExtent-1] = chemical[1][idx+1];
+			idx += reactorExtent;
+		}
+		unsigned int skip = reactorExtent*(reactorExtent-1);
+		for(y=0; y<reactorExtent; y++) 
+		{
+			chemical[0][y] = chemical[0][y + skip - reactorExtent];
+			chemical[0][y + skip] = chemical[0][y + reactorExtent];
+			chemical[1][y] = chemical[1][y + skip - reactorExtent];
+			chemical[1][y + skip] = chemical[1][y + reactorExtent];
+		}
+		// Diffusion
+		idx = reactorExtent+1;
+		for(y=0; y<reactorExtent-2; y++) 
+		{
+			for(x=0; x<reactorExtent-2; x++) 
+			{
+				delta[0][idx] += MULT(chemical[0][idx-reactorExtent] + chemical[0][idx-1]
+								-4*chemical[0][idx] + chemical[0][idx+1]
+								+chemical[0][idx+reactorExtent], hdiv0);
+				delta[1][idx] += MULT(chemical[1][idx-reactorExtent] + chemical[1][idx-1]
+								-4*chemical[1][idx] + chemical[1][idx+1]
+								+chemical[1][idx+reactorExtent], hdiv1);
+				idx++;
+			}
+			idx += 2;
+		}
+		// Reaction (Grey-Scott)
+		idx = reactorExtent+1;
+		int U,V;
+
+		for(y=0; y<reactorExtent-2; y++) 
+		{
+			for(x=0; x<reactorExtent-2; x++) 
+			{                        
+				U = chemical[0][idx]; V = chemical[1][idx];
+				int UVV = MULT(MULT(U,V),V);
+				delta[0][idx] += -UVV + MULT(F,(1<<16)-U);
+				delta[1][idx] += UVV - MULT(F+k,V);
+				idx++;
+			}
+			idx += 2;
+		}
+		// Update concentrations
+		for(x=0; x<mSize; x++) 
+		{
+			chemical[0][x] += MULT(delta[0][x], dt);
+			chemical[1][x] += MULT(delta[1][x], dt);
+		}
+	}
+
+	void buildTexture()
+	{
+		buffer->lock(HardwareBuffer::HBL_DISCARD);
+		const PixelBox &pb = buffer->getCurrentLock();
+		unsigned int idx = reactorExtent+1;
+		for(unsigned int y=0; y<(reactorExtent-2); y++) {
+			uint32 *data = static_cast<uint32*>(pb.data) + y*pb.rowPitch;
+			int *chem = &chemical[0][idx];
+			for(unsigned int x=0; x<(reactorExtent-2); x++) {
+				data[x] = clut[(chem[x]>>6)&1023];
+			}
+			idx += reactorExtent;
+		}
+		buffer->unlock();
+	}
+	// GUI updaters
+	void updateInfoParamK()
+	{
+		OverlayManager::getSingleton().getOverlayElement("Example/DynTex/Param_K") \
+			->setCaption("[1/2]k: "+StringConverter::toString(TOFLOAT(k)));		
+	}
+	void updateInfoParamF()
+	{
+		OverlayManager::getSingleton().getOverlayElement("Example/DynTex/Param_F") \
+			->setCaption("[3/4]F: "+StringConverter::toString(TOFLOAT(F)));		
+	}
+	void updateInfoParamA0()
+	{
+		// Diffusion rate for chemical 1
+		OverlayManager::getSingleton().getOverlayElement("Example/DynTex/Param_A0") \
+			->setCaption("[5/6]Diffusion 1: "+StringConverter::toString(TOFLOAT(hdiv0)));		
+	}
+	void updateInfoParamA1()
+	{
+		// Diffusion rate for chemical 2
+		OverlayManager::getSingleton().getOverlayElement("Example/DynTex/Param_A1") \
+			->setCaption("[7/8]Diffusion 2: "+StringConverter::toString(TOFLOAT(hdiv1)));		
+	}
+
+    bool frameStarted( const FrameEvent& evt )
+    {
+	using namespace OIS;
+        if( ExampleFrameListener::frameStarted( evt ) == false )
+		return false;
+		
+        if( mKeyboard->isKeyDown( KC_1 ) ) {
+        	k -= FROMFLOAT(0.005f*evt.timeSinceLastFrame);
+			updateInfoParamK();
+		}
+        if( mKeyboard->isKeyDown( KC_2 ) ) {
+        	k += FROMFLOAT(0.005f*evt.timeSinceLastFrame);
+			updateInfoParamK();
+		}
+        if( mKeyboard->isKeyDown( KC_3 ) ) {
+        	F -= FROMFLOAT(0.005f*evt.timeSinceLastFrame);
+			updateInfoParamF();
+		}
+        if( mKeyboard->isKeyDown( KC_4 ) ) {
+        	F += FROMFLOAT(0.005f*evt.timeSinceLastFrame);
+			updateInfoParamF();
+		}
+        if( mKeyboard->isKeyDown( KC_5 ) ) {
+        	hdiv0 -= FROMFLOAT(0.005f*evt.timeSinceLastFrame);
+			updateInfoParamA0();
+		}
+        if( mKeyboard->isKeyDown( KC_6 ) ) {
+        	hdiv0 += FROMFLOAT(0.005f*evt.timeSinceLastFrame);
+			updateInfoParamA0();
+		}
+        if( mKeyboard->isKeyDown( KC_7 ) ) {
+        	hdiv1 -= FROMFLOAT(0.005f*evt.timeSinceLastFrame);
+			updateInfoParamA1();
+		}
+        if( mKeyboard->isKeyDown( KC_8 ) ) {
+        	hdiv1 += FROMFLOAT(0.005f*evt.timeSinceLastFrame);
+			updateInfoParamA1();
+		}
+
+		if( mKeyboard->isKeyDown( KC_0 ) && !rpressed ) {
+			// Reset 0
+			resetReactor();
+			fireUpReactor();
+			rpressed = true;
+		} else {
+			rpressed = false;
+		}
+		for(int x=0; x<10; x++)
+			runStep();
+		buildTexture();
+		swim->addTime(evt.timeSinceLastFrame);
+
+        return true;
+    }
+
+	virtual ~DynTexFrameListener(void)
+    {
+		delete [] chemical[0];
+        delete [] chemical[1];
+		delete [] delta[0];
+		delete [] delta[1];
+    }
+};
+
+float DynTexFrameListener::fDefDim = 25.0f;
+float DynTexFrameListener::fDefVel = 50.0f;
+
+class DynTexApplication : public ExampleApplication
+{
+public:
+    DynTexApplication() {}
+
+protected:
+	
+	
+    virtual void createFrameListener(void)
+    {
+        mFrameListener= new DynTexFrameListener(mWindow, mCamera);
+        mFrameListener->showDebugOverlay(true);
+        mRoot->addFrameListener(mFrameListener);
+    }
+
+
+	virtual void createViewports(void)
+    {
+		// Create one viewport, entire window
+        Viewport* vp = mWindow->addViewport(mCamera);
+        vp->setBackgroundColour(ColourValue(0,0,0));
+
+        // Alter the camera aspect ratio to match the viewport
+        mCamera->setAspectRatio(
+            Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
+    }
+
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+        // Create dynamic texture
+		ptex = TextureManager::getSingleton().createManual(
+			"DynaTex","General", TEX_TYPE_2D, reactorExtent-2, reactorExtent-2, 0, PF_A8R8G8B8, 
+			TU_DYNAMIC_WRITE_ONLY);
+		buffer = ptex->getBuffer(0, 0);
+
+		// Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.6, 0.6, 0.6));
+		mSceneMgr->setSkyBox(true, "Examples/SpaceSkyBox", 50 );
+
+        //mRoot->getRenderSystem()->clearFrameBuffer(FBT_COLOUR, ColourValue(255,255,255,0));
+
+        // Create a light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setDiffuseColour(0.75, 0.75, 0.80);
+		l->setSpecularColour(0.9, 0.9, 1);
+        l->setPosition(-100,80,50);
+		mSceneMgr->getRootSceneNode()->attachObject(l);
+
+			
+        Entity *planeEnt = mSceneMgr->createEntity("TexPlane1", Ogre::SceneManager::PT_PLANE);
+        // Give the plane a texture
+        planeEnt->setMaterialName("Examples/DynaTest");
+
+        SceneNode* node = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(-100,-40,-100));
+        node->attachObject(planeEnt);
+		node->setScale(3.0f, 3.0f, 3.0f);
+
+        // Create objects
+        SceneNode *blaNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(-200,0,50));
+        Entity *ent2 = mSceneMgr->createEntity( "knot", "knot.mesh" );
+		ent2->setMaterialName("Examples/DynaTest4");
+        blaNode->attachObject( ent2 );
+		
+		blaNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(200,-90,50));
+        ent2 = mSceneMgr->createEntity( "knot2", "knot.mesh" );
+		ent2->setMaterialName("Examples/DynaTest2");
+        blaNode->attachObject( ent2 );
+        blaNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(-110,200,50));
+		
+		// Cloaked fish
+        ent2 = mSceneMgr->createEntity( "knot3", "fish.mesh" );
+		ent2->setMaterialName("Examples/DynaTest3");
+		swim = ent2->getAnimationState("swim");
+		swim->setEnabled(true);
+        blaNode->attachObject( ent2 );
+		blaNode->setScale(50.0f, 50.0f, 50.0f);
+		
+		
+		//TextureManager::getSingleton().getByName("RustySteel.jpg");
+		
+		
+		std::stringstream d;
+		d << "HardwarePixelBuffer " << buffer->getWidth() << " " << buffer->getHeight() << " " << buffer->getDepth();
+		LogManager::getSingleton().logMessage(d.str());
+		
+		buffer->lock(HardwareBuffer::HBL_NORMAL);
+		const PixelBox &pb = buffer->getCurrentLock();
+		d.str("");
+		d << "PixelBox " << pb.getWidth() << " " << pb.getHeight() << " " << pb.getDepth() << " " << pb.rowPitch << " " << pb.slicePitch << " " << pb.data << " " << PixelUtil::getFormatName(pb.format);
+		LogManager::getSingleton().logMessage(d.str());
+		buffer->unlock();
+		
+		// show GUI
+		overlay = OverlayManager::getSingleton().getByName("Example/DynTexOverlay");    
+		overlay->show();
+    }
+
+	void destroyScene(void)
+	{
+		// Free resource pointers before shutdown
+		ptex.setNull();
+		buffer.setNull();
+	}
+
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char *argv[])
+#endif
+{
+    // Create application object
+    DynTexApplication app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " <<
+            e.getFullDescription().c_str() << std::endl;
+#endif
+    }
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/DynTex/src/Makefile.am
===================================================================
--- /Samples/DynTex/src/Makefile.am	(revision 5)
+++ /Samples/DynTex/src/Makefile.am	(revision 5)
@@ -0,0 +1,6 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/DynTex/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = DynTex
+DynTex_SOURCES = DynTex.cpp
+DynTex_LDFLAGS = -L$(top_builddir)/OgreMain/src
+DynTex_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/DynTex/src/Makefile.in
===================================================================
--- /Samples/DynTex/src/Makefile.in	(revision 5)
+++ /Samples/DynTex/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = DynTex$(EXEEXT)
+subdir = Samples/DynTex/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_DynTex_OBJECTS = DynTex.$(OBJEXT)
+DynTex_OBJECTS = $(am_DynTex_OBJECTS)
+am__DEPENDENCIES_1 =
+DynTex_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(DynTex_SOURCES)
+DIST_SOURCES = $(DynTex_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/DynTex/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+DynTex_SOURCES = DynTex.cpp
+DynTex_LDFLAGS = -L$(top_builddir)/OgreMain/src
+DynTex_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/DynTex/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/DynTex/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+DynTex$(EXEEXT): $(DynTex_OBJECTS) $(DynTex_DEPENDENCIES) 
+	@rm -f DynTex$(EXEEXT)
+	$(CXXLINK) $(DynTex_LDFLAGS) $(DynTex_OBJECTS) $(DynTex_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DynTex.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/EnvMapping/Makefile.am
===================================================================
--- /Samples/EnvMapping/Makefile.am	(revision 5)
+++ /Samples/EnvMapping/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/EnvMapping/Makefile.in
===================================================================
--- /Samples/EnvMapping/Makefile.in	(revision 5)
+++ /Samples/EnvMapping/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/EnvMapping
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/EnvMapping/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/EnvMapping/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/EnvMapping/bin/Debug/.keepme
===================================================================
--- /Samples/EnvMapping/bin/Debug/.keepme	(revision 5)
+++ /Samples/EnvMapping/bin/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/EnvMapping/bin/Release/.keepme
===================================================================
--- /Samples/EnvMapping/bin/Release/.keepme	(revision 5)
+++ /Samples/EnvMapping/bin/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/EnvMapping/include/EnvMapping.h
===================================================================
--- /Samples/EnvMapping/include/EnvMapping.h	(revision 5)
+++ /Samples/EnvMapping/include/EnvMapping.h	(revision 5)
@@ -0,0 +1,60 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        EnvMapping.cpp
+    \brief
+        Specialisation of OGRE's framework application to show the
+        environment mapping feature.
+*/
+
+#include "ExampleApplication.h"
+
+class EnvMapApplication : public ExampleApplication
+{
+public:
+    EnvMapApplication() {}
+
+protected:
+
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        l->setPosition(20,80,50);
+
+
+        Entity *ent = mSceneMgr->createEntity("head", "ogrehead.mesh");
+
+
+        // Set material loaded from Example.material
+        ent->setMaterialName("Examples/EnvMappedRustySteel");
+
+        // Add entity to the root scene node
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+
+
+        
+
+    }
+
+};
Index: /Samples/EnvMapping/include/Makefile.am
===================================================================
--- /Samples/EnvMapping/include/Makefile.am	(revision 5)
+++ /Samples/EnvMapping/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = EnvMapping.h
Index: /Samples/EnvMapping/include/Makefile.in
===================================================================
--- /Samples/EnvMapping/include/Makefile.in	(revision 5)
+++ /Samples/EnvMapping/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/EnvMapping/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = EnvMapping.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/EnvMapping/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/EnvMapping/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/EnvMapping/misc/.keepme
===================================================================
--- /Samples/EnvMapping/misc/.keepme	(revision 5)
+++ /Samples/EnvMapping/misc/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/EnvMapping/obj/Debug/.keepme
===================================================================
--- /Samples/EnvMapping/obj/Debug/.keepme	(revision 5)
+++ /Samples/EnvMapping/obj/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/EnvMapping/obj/Release/.keepme
===================================================================
--- /Samples/EnvMapping/obj/Release/.keepme	(revision 5)
+++ /Samples/EnvMapping/obj/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/EnvMapping/scripts/Demo_EnvMapping.cbp
===================================================================
--- /Samples/EnvMapping/scripts/Demo_EnvMapping.cbp	(revision 5)
+++ /Samples/EnvMapping/scripts/Demo_EnvMapping.cbp	(revision 5)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_EnvMapping" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_EnvMapping.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_EnvMapping.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\EnvMapping.h" />
+		<Unit filename="..\src\EnvMapping.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/EnvMapping/scripts/Demo_EnvMapping.vcproj
===================================================================
--- /Samples/EnvMapping/scripts/Demo_EnvMapping.vcproj	(revision 5)
+++ /Samples/EnvMapping/scripts/Demo_EnvMapping.vcproj	(revision 5)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_EnvMapping"
+	ProjectGUID="{40308138-609B-4162-AA55-E8E02BF207F0}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_EnvMapping.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_EnvMapping.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_EnvMapping.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\EnvMapping.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\EnvMapping.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/EnvMapping/scripts/Demo_EnvMapping_linux.cbp
===================================================================
--- /Samples/EnvMapping/scripts/Demo_EnvMapping_linux.cbp	(revision 5)
+++ /Samples/EnvMapping/scripts/Demo_EnvMapping_linux.cbp	(revision 5)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_EnvMapping" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_EnvMapping" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_EnvMapping" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/EnvMapping.h" />
+		<Unit filename="../src/EnvMapping.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/EnvMapping/scripts/Demo_EnvMapping_stlp.cbp
===================================================================
--- /Samples/EnvMapping/scripts/Demo_EnvMapping_stlp.cbp	(revision 5)
+++ /Samples/EnvMapping/scripts/Demo_EnvMapping_stlp.cbp	(revision 5)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_EnvMapping" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_EnvMapping.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_EnvMapping.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\EnvMapping.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\EnvMapping.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/EnvMapping/scripts/Demo_EnvMapping_vc8.vcproj
===================================================================
--- /Samples/EnvMapping/scripts/Demo_EnvMapping_vc8.vcproj	(revision 5)
+++ /Samples/EnvMapping/scripts/Demo_EnvMapping_vc8.vcproj	(revision 5)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_EnvMapping"
+	ProjectGUID="{40308138-609B-4162-AA55-E8E02BF207F0}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_EnvMapping.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_EnvMapping.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_EnvMapping.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\EnvMapping.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\EnvMapping.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/EnvMapping/scripts/Demo_EnvMapping_vc8.vcproj.user
===================================================================
--- /Samples/EnvMapping/scripts/Demo_EnvMapping_vc8.vcproj.user	(revision 5)
+++ /Samples/EnvMapping/scripts/Demo_EnvMapping_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/EnvMapping/src/EnvMapping.cpp
===================================================================
--- /Samples/EnvMapping/src/EnvMapping.cpp	(revision 5)
+++ /Samples/EnvMapping/src/EnvMapping.cpp	(revision 5)
@@ -0,0 +1,59 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        EnvMapping.cpp
+    \brief
+        Shows OGRE's environment mapping feature as well as the
+        blending modes available when using multiple texture layers
+*/
+
+#include "EnvMapping.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+    // Create application object
+    EnvMapApplication app;
+
+    try {
+        app.go();
+    } catch( Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/EnvMapping/src/Makefile.am
===================================================================
--- /Samples/EnvMapping/src/Makefile.am	(revision 5)
+++ /Samples/EnvMapping/src/Makefile.am	(revision 5)
@@ -0,0 +1,7 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/EnvMapping/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = EnvMapping
+
+EnvMapping_SOURCES = EnvMapping.cpp
+EnvMapping_LDFLAGS = -L$(top_builddir)/OgreMain/src
+EnvMapping_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/EnvMapping/src/Makefile.in
===================================================================
--- /Samples/EnvMapping/src/Makefile.in	(revision 5)
+++ /Samples/EnvMapping/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = EnvMapping$(EXEEXT)
+subdir = Samples/EnvMapping/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_EnvMapping_OBJECTS = EnvMapping.$(OBJEXT)
+EnvMapping_OBJECTS = $(am_EnvMapping_OBJECTS)
+am__DEPENDENCIES_1 =
+EnvMapping_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(EnvMapping_SOURCES)
+DIST_SOURCES = $(EnvMapping_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/EnvMapping/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+EnvMapping_SOURCES = EnvMapping.cpp
+EnvMapping_LDFLAGS = -L$(top_builddir)/OgreMain/src
+EnvMapping_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/EnvMapping/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/EnvMapping/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+EnvMapping$(EXEEXT): $(EnvMapping_OBJECTS) $(EnvMapping_DEPENDENCIES) 
+	@rm -f EnvMapping$(EXEEXT)
+	$(CXXLINK) $(EnvMapping_LDFLAGS) $(EnvMapping_OBJECTS) $(EnvMapping_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EnvMapping.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/FacialAnimation/Makefile.am
===================================================================
--- /Samples/FacialAnimation/Makefile.am	(revision 5)
+++ /Samples/FacialAnimation/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src 
Index: /Samples/FacialAnimation/Makefile.in
===================================================================
--- /Samples/FacialAnimation/Makefile.in	(revision 5)
+++ /Samples/FacialAnimation/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/FacialAnimation
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src 
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/FacialAnimation/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/FacialAnimation/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/FacialAnimation/scripts/Demo_FacialAnimation.cbp
===================================================================
--- /Samples/FacialAnimation/scripts/Demo_FacialAnimation.cbp	(revision 5)
+++ /Samples/FacialAnimation/scripts/Demo_FacialAnimation.cbp	(revision 5)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_FacialAnimation" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_FacialAnimation.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="CEGUIBase_d" />
+					<Add library="OgreGUIRenderer_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_FacialAnimation.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release\" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreGUIRenderer" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI" />
+			<Add directory="..\..\Common\CEGUIRenderer\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\FacialAnimation.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/FacialAnimation/scripts/Demo_FacialAnimation.vcproj
===================================================================
--- /Samples/FacialAnimation/scripts/Demo_FacialAnimation.vcproj	(revision 5)
+++ /Samples/FacialAnimation/scripts/Demo_FacialAnimation.vcproj	(revision 5)
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_FacialAnimation"
+	ProjectGUID="{7576D7EA-D4C5-4E06-B46E-B9EBF78B265B}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/Zm150"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib"
+				OutputFile="$(OutDir)/Demo_FacialAnimation.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_FacialAnimation.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib CEGUIBase.lib OgreGUIRenderer.lib"
+				OutputFile="$(OutDir)/Demo_FacialAnimation.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\FacialAnimation.cpp">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalOptions="/Zm150"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/FacialAnimation/scripts/Demo_FacialAnimation_linux.cbp
===================================================================
--- /Samples/FacialAnimation/scripts/Demo_FacialAnimation_linux.cbp	(revision 5)
+++ /Samples/FacialAnimation/scripts/Demo_FacialAnimation_linux.cbp	(revision 5)
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_FacialAnimation" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_FacialAnimation" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreGUIRenderer_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_FacialAnimation" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release/" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreGUIRenderer" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+			<Add directory="$(#CEGUI)" />
+			<Add directory="../../Common/CEGUIRenderer/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../src/FacialAnimation.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/FacialAnimation/scripts/Demo_FacialAnimation_stlp.cbp
===================================================================
--- /Samples/FacialAnimation/scripts/Demo_FacialAnimation_stlp.cbp	(revision 5)
+++ /Samples/FacialAnimation/scripts/Demo_FacialAnimation_stlp.cbp	(revision 5)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_FacialAnimation" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_FacialAnimation.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="CEGUIBase_d" />
+					<Add library="OgreGUIRenderer_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_FacialAnimation.exe" />
+				<Option working_dir="..\..\Common\bin\Release\" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreGUIRenderer" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI" />
+			<Add directory="..\..\Common\CEGUIRenderer\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\FacialAnimation.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/FacialAnimation/scripts/Demo_FacialAnimation_vc8.vcproj
===================================================================
--- /Samples/FacialAnimation/scripts/Demo_FacialAnimation_vc8.vcproj	(revision 5)
+++ /Samples/FacialAnimation/scripts/Demo_FacialAnimation_vc8.vcproj	(revision 5)
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_FacialAnimation"
+	ProjectGUID="{59670412-2E76-4AE7-9923-3BE8D44323EE}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib"
+				OutputFile="$(OutDir)/Demo_FacialAnimation.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_FacialAnimation.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib  CEGUIBase.lib OgreGUIRenderer.lib"
+				OutputFile="$(OutDir)/Demo_FacialAnimation.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\FacialAnimation.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/FacialAnimation/scripts/Demo_FacialAnimation_vc8.vcproj.user
===================================================================
--- /Samples/FacialAnimation/scripts/Demo_FacialAnimation_vc8.vcproj.user	(revision 5)
+++ /Samples/FacialAnimation/scripts/Demo_FacialAnimation_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/FacialAnimation/src/FacialAnimation.cpp
===================================================================
--- /Samples/FacialAnimation/src/FacialAnimation.cpp	(revision 5)
+++ /Samples/FacialAnimation/src/FacialAnimation.cpp	(revision 5)
@@ -0,0 +1,480 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        FacialAnimation.cpp
+    \brief
+        Demonstration of facial animation features, using Pose animation
+*/
+
+#include <CEGUI/CEGUIImageset.h>
+#include <CEGUI/CEGUISystem.h>
+#include <CEGUI/CEGUILogger.h>
+#include <CEGUI/CEGUISchemeManager.h>
+#include <CEGUI/CEGUIWindowManager.h>
+#include <CEGUI/CEGUIWindow.h>
+#include <CEGUI/elements/CEGUICombobox.h>
+#include <CEGUI/elements/CEGUIListbox.h>
+#include <CEGUI/elements/CEGUIListboxTextItem.h>
+#include <CEGUI/elements/CEGUIPushButton.h>
+#include <CEGUI/elements/CEGUIScrollbar.h>
+#include <CEGUI/elements/CEGUIRadioButton.h>
+#include "OgreCEGUIRenderer.h"
+#include "OgreCEGUIResourceProvider.h"
+
+#include "ExampleApplication.h"
+
+//----------------------------------------------------------------//
+CEGUI::MouseButton convertOISMouseButtonToCegui(int buttonID)
+{
+    switch (buttonID)
+    {
+	case 0: return CEGUI::LeftButton;
+	case 1: return CEGUI::RightButton;
+	case 2:	return CEGUI::MiddleButton;
+	case 3: return CEGUI::X1Button;
+	default: return CEGUI::LeftButton;
+    }
+}
+
+AnimationState* speakAnimState;
+AnimationState* manualAnimState;
+VertexPoseKeyFrame* manualKeyFrame;
+
+enum ScrollbarIndex
+{
+	SI_HAPPY = 0,
+	SI_SAD = 1,
+	SI_ANGRY = 2,
+	SI_A = 3,
+	SI_E = 4,
+	SI_I = 5,
+	SI_O = 6,
+	SI_U = 7,
+	SI_C = 8,
+	SI_W = 9,
+	SI_M = 10,
+	SI_L = 11,
+	SI_F = 12,
+	SI_T = 13,
+	SI_P = 14,
+	SI_R = 15,
+	SI_S = 16,
+	SI_TH = 17,
+	SI_COUNT = 18
+};
+String scrollbarNames[SI_COUNT] = {
+	"Facial/Happy_Scroll",
+	"Facial/Sad_Scroll",
+	"Facial/Angry_Scroll",
+	"Facial/A_Scroll",
+	"Facial/E_Scroll",
+	"Facial/I_Scroll",
+	"Facial/O_Scroll",
+	"Facial/U_Scroll",
+	"Facial/C_Scroll",
+	"Facial/W_Scroll",
+	"Facial/M_Scroll",
+	"Facial/L_Scroll",
+	"Facial/F_Scroll",
+	"Facial/T_Scroll",
+	"Facial/P_Scroll",
+	"Facial/R_Scroll",
+	"Facial/S_Scroll",
+	"Facial/TH_Scroll",
+};
+unsigned short poseIndexes[SI_COUNT] = 
+{ 1, 2, 3, 4, 7, 8, 6, 5, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18};
+
+CEGUI::Scrollbar* scrollbars[SI_COUNT];
+
+
+class GuiFrameListener : public ExampleFrameListener, public OIS::MouseListener
+{
+private:
+    CEGUI::Renderer* mGUIRenderer;
+    bool mShutdownRequested;
+
+public:
+    // NB using buffered input, this is the only change
+    GuiFrameListener(RenderWindow* win, Camera* cam, CEGUI::Renderer* renderer)
+        : ExampleFrameListener(win, cam, false, true), 
+          mGUIRenderer(renderer),
+          mShutdownRequested(false)
+    {
+		mMouse->setEventCallback(this);
+	}
+
+    /// Tell the frame listener to exit at the end of the next frame
+    void requestShutdown(void)
+    {
+        mShutdownRequested = true;
+    }
+
+    bool frameEnded(const FrameEvent& evt)
+    {
+        if (mShutdownRequested)
+            return false;
+        else
+            return ExampleFrameListener::frameEnded(evt);
+    }
+
+	bool frameStarted(const FrameEvent& evt)
+	{
+		if( ExampleFrameListener::frameStarted(evt) == false )
+			return false;
+		speakAnimState->addTime(evt.timeSinceLastFrame);
+		return true;
+
+	}
+	//----------------------------------------------------------------//
+	bool mouseMoved( const OIS::MouseEvent &arg )
+	{
+		CEGUI::System::getSingleton().injectMouseMove( arg.state.X.rel, arg.state.Y.rel );
+		return true;
+	}
+
+	//----------------------------------------------------------------//
+	bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
+	{
+		CEGUI::System::getSingleton().injectMouseButtonDown(convertOISMouseButtonToCegui(id));
+		return true;
+	}
+
+	//----------------------------------------------------------------//
+	bool mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
+	{
+		CEGUI::System::getSingleton().injectMouseButtonUp(convertOISMouseButtonToCegui(id));
+		return true;
+	}
+
+	//----------------------------------------------------------------//
+	bool keyPressed( const OIS::KeyEvent &arg )
+	{
+		if( arg.key == OIS::KC_ESCAPE )
+			mShutdownRequested = true;
+		CEGUI::System::getSingleton().injectKeyDown( arg.key );
+		CEGUI::System::getSingleton().injectChar( arg.text );
+		return true;
+	}
+
+	//----------------------------------------------------------------//
+	bool keyReleased( const OIS::KeyEvent &arg )
+	{
+		CEGUI::System::getSingleton().injectKeyUp( arg.key );
+		return true;
+	}
+};
+
+class FacialApplication : public ExampleApplication
+{
+private:
+    CEGUI::OgreCEGUIRenderer* mGUIRenderer;
+    CEGUI::System* mGUISystem;
+    CEGUI::Window* mEditorGuiSheet;
+	CEGUI::Scrollbar* mRed;
+	CEGUI::Scrollbar* mGreen;
+	CEGUI::Scrollbar* mBlue;
+	CEGUI::Window* mPreview; // StaticImage
+	CEGUI::Window* mTip;
+	CEGUI::Listbox* mList;
+	CEGUI::Window* mEditBox;
+
+public:
+    FacialApplication()
+      : mGUIRenderer(0),
+        mGUISystem(0),
+        mEditorGuiSheet(0)
+    {
+
+	}
+
+    ~FacialApplication()
+    {
+        if(mEditorGuiSheet)
+        {
+            CEGUI::WindowManager::getSingleton().destroyWindow(mEditorGuiSheet);
+        }
+        if(mGUISystem)
+        {
+            delete mGUISystem;
+            mGUISystem = 0;
+        }
+        if(mGUIRenderer)
+        {
+            delete mGUIRenderer;
+            mGUIRenderer = 0;
+        }
+    }
+
+protected:
+
+	bool mPlayAnimation;
+
+	// Handle the scrollbars changing
+	bool handleScrollChanged(const CEGUI::EventArgs& e)
+	{
+		if (!mPlayAnimation)
+		{
+			// Alter the animation 
+			// Find which one it is first
+			const CEGUI::WindowEventArgs& args = static_cast<const CEGUI::WindowEventArgs&>(e);
+			String name = args.window->getName().c_str();
+			// Find which pose was changed
+			int i;
+			for (i = 0; i < SI_COUNT; ++i)
+			{
+				if (scrollbarNames[i] == name)
+				{
+					break;
+				}
+			}
+			if (i != SI_COUNT)
+			{
+				// Update the pose
+				manualKeyFrame->updatePoseReference(
+					poseIndexes[i], scrollbars[i]->getScrollPosition());
+				// Dirty animation state since we're fudging this manually
+				manualAnimState->getParent()->_notifyDirty();
+			}
+
+		}
+		return true;
+
+	}
+
+	// Handle play animation / manual tweaking event
+	bool handleRadioChanged(const CEGUI::EventArgs& e)
+	{
+		mPlayAnimation = !mPlayAnimation;
+		speakAnimState->setEnabled(mPlayAnimation);
+		manualAnimState->setEnabled(!mPlayAnimation);
+		for (int i = 0; i < SI_COUNT; ++i)
+		{
+			// enable / disable scrollbars
+			scrollbars[i]->setEnabled(!mPlayAnimation);
+		}
+
+		return true;
+
+	}
+
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        l->setPosition(20,80,50);
+		l->setDiffuseColour(1.0, 1.0, 1.0);
+
+		// Create a light
+		l = mSceneMgr->createLight("MainLight2");
+		// Accept default settings: point light, white diffuse, just set position
+		// NB I could attach the light to a SceneNode if I wanted it to move automatically with
+		//  other objects, but I don't
+		l->setPosition(-120,-80,-50);
+		l->setDiffuseColour(0.7, 0.7, 0.6);
+
+
+		// Pre-load the mesh so that we can tweak it with a manual animation
+		MeshPtr mesh = MeshManager::getSingleton().load("facial.mesh", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Animation* anim = mesh->createAnimation("manual", 0);
+		VertexAnimationTrack* track = anim->createVertexTrack(4, VAT_POSE);
+		manualKeyFrame = track->createVertexPoseKeyFrame(0);
+		// create pose references, initially zero
+		for (int i = 0; i < SI_COUNT; ++i)
+		{
+			manualKeyFrame->addPoseReference(poseIndexes[i], 0.0f);
+		}
+
+		// setup GUI system
+        mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, 
+            Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr);
+
+        mGUISystem = new CEGUI::System(mGUIRenderer);
+
+        CEGUI::Logger::getSingleton().setLoggingLevel(CEGUI::Informative);
+
+        Entity* head = mSceneMgr->createEntity("Head", "facial.mesh");
+		speakAnimState = head->getAnimationState("Speak");
+		speakAnimState->setEnabled(true);
+		manualAnimState = head->getAnimationState("manual");
+		manualAnimState->setTimePosition(0);
+
+        SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        headNode->attachObject(head);
+
+		mCamera->setPosition(-20, 50, 150);
+		mCamera->lookAt(0,35,0);
+
+        // load scheme and set up defaults
+        CEGUI::SchemeManager::getSingleton().loadScheme(
+                (CEGUI::utf8*)"TaharezLookSkin.scheme");
+        mGUISystem->setDefaultMouseCursor(
+                (CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow");
+        mGUISystem->setDefaultFont((CEGUI::utf8*)"BlueHighway-12");
+
+        CEGUI::Window* sheet = 
+            CEGUI::WindowManager::getSingleton().loadWindowLayout(
+                (CEGUI::utf8*)"facial.layout"); 
+        mGUISystem->setGUISheet(sheet);
+
+		CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
+		for (int i = 0; i < SI_COUNT; ++i)
+		{
+			scrollbars[i] = static_cast<CEGUI::Scrollbar*>(
+				wmgr.getWindow(scrollbarNames[i]));
+			scrollbars[i]->subscribeEvent(
+				CEGUI::Scrollbar::EventScrollPositionChanged, 
+				CEGUI::Event::Subscriber(&FacialApplication::handleScrollChanged, this));
+			// disable to begin with
+			scrollbars[i]->setEnabled(false);
+
+		}
+
+		CEGUI::RadioButton* btn = static_cast<CEGUI::RadioButton*>(
+			wmgr.getWindow((CEGUI::utf8*)"Facial/Radio/Play"));
+		// play animation by default
+		btn->setSelected(true);
+		btn->subscribeEvent(CEGUI::RadioButton::EventSelectStateChanged, 
+			CEGUI::Event::Subscriber(&FacialApplication::handleRadioChanged, this));
+
+		mPlayAnimation = true;
+
+
+
+    }
+
+    // Create new frame listener
+    void createFrameListener(void)
+    {
+        mFrameListener= new GuiFrameListener(mWindow, mCamera, mGUIRenderer);
+        mRoot->addFrameListener(mFrameListener);
+    }
+
+    void setupEventHandlers(void)
+    {
+		/*
+		CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
+        wmgr.getWindow((CEGUI::utf8*)"OgreGuiDemo/TabCtrl/Page1/QuitButton")
+			->subscribeEvent(
+				CEGUI::PushButton::EventClicked, 
+				CEGUI::Event::Subscriber(&FacialApplication::handleQuit, this));
+        wmgr.getWindow((CEGUI::utf8*)"OgreGuiDemo/TabCtrl/Page1/NewButton")
+			->subscribeEvent(
+				CEGUI::PushButton::EventClicked, 
+				CEGUI::Event::Subscriber(&FacialApplication::handleNew, this));
+        wmgr.getWindow((CEGUI::utf8*)"OgreGuiDemo/TabCtrl/Page1/LoadButton")
+			->subscribeEvent(
+				CEGUI::PushButton::EventClicked, 
+				CEGUI::Event::Subscriber(&FacialApplication::handleLoad, this));
+        wmgr.getWindow((CEGUI::utf8*)"OgreGuiDemo/TabCtrl/Page2/ObjectTypeList")
+			->subscribeEvent(
+				CEGUI::Combobox::EventListSelectionAccepted, 
+				CEGUI::Event::Subscriber(&FacialApplication::handleObjectSelection, this));
+		*/
+
+    }
+
+
+	void setupLoadedLayoutHandlers(void)
+	{
+		/*
+		CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
+		mRed = static_cast<CEGUI::Scrollbar*>(
+			wmgr.getWindow((CEGUI::utf8*)"Demo8/Window1/Controls/Red"));
+		mGreen = static_cast<CEGUI::Scrollbar*>(
+			wmgr.getWindow((CEGUI::utf8*)"Demo8/Window1/Controls/Green"));
+		mBlue = static_cast<CEGUI::Scrollbar*>(
+			wmgr.getWindow((CEGUI::utf8*)"Demo8/Window1/Controls/Blue"));
+		mPreview = static_cast<CEGUI::StaticImage*>(
+			wmgr.getWindow((CEGUI::utf8*)"Demo8/Window1/Controls/ColourSample"));
+		mList = static_cast<CEGUI::Listbox*>(
+			wmgr.getWindow((CEGUI::utf8*)"Demo8/Window1/Listbox"));
+		mEditBox = 
+			wmgr.getWindow((CEGUI::utf8*)"Demo8/Window1/Controls/Editbox");
+	
+		mRed->subscribeEvent(
+				CEGUI::Scrollbar::EventScrollPositionChanged, 
+				CEGUI::Event::Subscriber(&FacialApplication::handleColourChanged, this));
+		mGreen->subscribeEvent(
+			CEGUI::Scrollbar::EventScrollPositionChanged, 
+			CEGUI::Event::Subscriber(&FacialApplication::handleColourChanged, this));
+		mBlue->subscribeEvent(
+			CEGUI::Scrollbar::EventScrollPositionChanged, 
+			CEGUI::Event::Subscriber(&FacialApplication::handleColourChanged, this));
+
+		wmgr.getWindow((CEGUI::utf8*)"Demo8/Window1/Controls/Add")
+			->subscribeEvent(
+			CEGUI::PushButton::EventClicked, 
+			CEGUI::Event::Subscriber(&FacialApplication::handleAdd, this));
+
+		CEGUI::Window* root = wmgr.getWindow("Demo8");
+		setupEnterExitEvents(root);
+		*/
+
+
+	}
+
+    bool handleQuit(const CEGUI::EventArgs& e)
+    {
+        static_cast<GuiFrameListener*>(mFrameListener)->requestShutdown();
+        return true;
+    }
+
+
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char *argv[])
+#endif
+{
+
+    // Create application object
+    FacialApplication app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " <<
+            e.getFullDescription().c_str() << std::endl;
+#endif
+    }
+
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/FacialAnimation/src/Makefile.am
===================================================================
--- /Samples/FacialAnimation/src/Makefile.am	(revision 5)
+++ /Samples/FacialAnimation/src/Makefile.am	(revision 5)
@@ -0,0 +1,7 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/FacialAnimation/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/CEGUIRenderer/include -I$(top_srcdir)/Samples/Common/include @CEGUI_CFLAGS@ $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = FacialAnimation
+
+FacialAnimation_SOURCES = FacialAnimation.cpp
+FacialAnimation_LDFLAGS = -L$(top_builddir)/OgreMain/src -L$(top_builddir)/Samples/Common/CEGUIRenderer/src
+FacialAnimation_LDADD = -lOgreMain @CEGUI_LIBS@ -lCEGUIOgreRenderer $(OIS_LIBS)
Index: /Samples/FacialAnimation/src/Makefile.in
===================================================================
--- /Samples/FacialAnimation/src/Makefile.in	(revision 5)
+++ /Samples/FacialAnimation/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = FacialAnimation$(EXEEXT)
+subdir = Samples/FacialAnimation/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_FacialAnimation_OBJECTS = FacialAnimation.$(OBJEXT)
+FacialAnimation_OBJECTS = $(am_FacialAnimation_OBJECTS)
+am__DEPENDENCIES_1 =
+FacialAnimation_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(FacialAnimation_SOURCES)
+DIST_SOURCES = $(FacialAnimation_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/FacialAnimation/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/CEGUIRenderer/include -I$(top_srcdir)/Samples/Common/include @CEGUI_CFLAGS@ $(OIS_CFLAGS)
+FacialAnimation_SOURCES = FacialAnimation.cpp
+FacialAnimation_LDFLAGS = -L$(top_builddir)/OgreMain/src -L$(top_builddir)/Samples/Common/CEGUIRenderer/src
+FacialAnimation_LDADD = -lOgreMain @CEGUI_LIBS@ -lCEGUIOgreRenderer $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/FacialAnimation/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/FacialAnimation/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+FacialAnimation$(EXEEXT): $(FacialAnimation_OBJECTS) $(FacialAnimation_DEPENDENCIES) 
+	@rm -f FacialAnimation$(EXEEXT)
+	$(CXXLINK) $(FacialAnimation_LDFLAGS) $(FacialAnimation_OBJECTS) $(FacialAnimation_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FacialAnimation.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Fresnel/Makefile.am
===================================================================
--- /Samples/Fresnel/Makefile.am	(revision 5)
+++ /Samples/Fresnel/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src
Index: /Samples/Fresnel/Makefile.in
===================================================================
--- /Samples/Fresnel/Makefile.in	(revision 5)
+++ /Samples/Fresnel/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Fresnel
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Fresnel/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Fresnel/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Fresnel/scripts/Demo_Fresnel.cbp
===================================================================
--- /Samples/Fresnel/scripts/Demo_Fresnel.cbp	(revision 5)
+++ /Samples/Fresnel/scripts/Demo_Fresnel.cbp	(revision 5)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Fresnel" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Fresnel.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Fresnel.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\Fresnel.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Fresnel/scripts/Demo_Fresnel.vcproj
===================================================================
--- /Samples/Fresnel/scripts/Demo_Fresnel.vcproj	(revision 5)
+++ /Samples/Fresnel/scripts/Demo_Fresnel.vcproj	(revision 5)
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_Fresnel"
+	ProjectGUID="{B5E6BAD4-960F-418B-8904-FE93EC51947B}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_Fresnel.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_Fresnel.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_Fresnel.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\Fresnel.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Fresnel/scripts/Demo_Fresnel_linux.cbp
===================================================================
--- /Samples/Fresnel/scripts/Demo_Fresnel_linux.cbp	(revision 5)
+++ /Samples/Fresnel/scripts/Demo_Fresnel_linux.cbp	(revision 5)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Fresnel" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_Fresnel" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_Fresnel" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/bin" />
+		</Linker>
+		<Unit filename="../src/Fresnel.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Fresnel/scripts/Demo_Fresnel_stlp.cbp
===================================================================
--- /Samples/Fresnel/scripts/Demo_Fresnel_stlp.cbp	(revision 5)
+++ /Samples/Fresnel/scripts/Demo_Fresnel_stlp.cbp	(revision 5)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_Fresnel" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Fresnel.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Fresnel.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\Fresnel.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Fresnel/scripts/Demo_Fresnel_vc8.vcproj
===================================================================
--- /Samples/Fresnel/scripts/Demo_Fresnel_vc8.vcproj	(revision 5)
+++ /Samples/Fresnel/scripts/Demo_Fresnel_vc8.vcproj	(revision 5)
@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_Fresnel"
+	ProjectGUID="{B5E6BAD4-960F-418B-8904-FE93EC51947B}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_Fresnel.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_Fresnel.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_Fresnel.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\Fresnel.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Fresnel/scripts/Demo_Fresnel_vc8.vcproj.user
===================================================================
--- /Samples/Fresnel/scripts/Demo_Fresnel_vc8.vcproj.user	(revision 5)
+++ /Samples/Fresnel/scripts/Demo_Fresnel_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/Fresnel/src/Fresnel.cpp
===================================================================
--- /Samples/Fresnel/src/Fresnel.cpp	(revision 5)
+++ /Samples/Fresnel/src/Fresnel.cpp	(revision 5)
@@ -0,0 +1,379 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/*
+-----------------------------------------------------------------------------
+Filename:    Fresnel.cpp
+Description: Fresnel reflections and refractions
+-----------------------------------------------------------------------------
+*/
+
+#include "ExampleApplication.h"
+#include "OgreHardwarePixelBuffer.h"
+// Hacky globals
+Camera* theCam;
+Entity* pPlaneEnt;
+std::vector<Entity*> aboveWaterEnts;
+std::vector<Entity*> belowWaterEnts;
+
+// Fish!
+#define NUM_FISH 30
+#define NUM_FISH_WAYPOINTS 10
+#define FISH_PATH_LENGTH 200 
+#define FISH_SCALE 1.2
+AnimationState* fishAnimations[NUM_FISH];
+SimpleSpline fishSplines[NUM_FISH];
+Vector3 fishLastPosition[NUM_FISH];
+SceneNode* fishNodes[NUM_FISH];
+Real animTime = 0.0f;
+
+
+Plane reflectionPlane;
+
+
+class RefractionTextureListener : public RenderTargetListener
+{
+public:
+    void preRenderTargetUpdate(const RenderTargetEvent& evt)
+    {
+        // Hide plane and objects above the water
+        pPlaneEnt->setVisible(false);
+        std::vector<Entity*>::iterator i, iend;
+        iend = aboveWaterEnts.end();
+        for (i = aboveWaterEnts.begin(); i != iend; ++i)
+        {
+            (*i)->setVisible(false);
+        }
+
+    }
+    void postRenderTargetUpdate(const RenderTargetEvent& evt)
+    {
+        // Show plane and objects above the water
+        pPlaneEnt->setVisible(true);
+        std::vector<Entity*>::iterator i, iend;
+        iend = aboveWaterEnts.end();
+        for (i = aboveWaterEnts.begin(); i != iend; ++i)
+        {
+            (*i)->setVisible(true);
+        }
+    }
+
+};
+class ReflectionTextureListener : public RenderTargetListener
+{
+public:
+    void preRenderTargetUpdate(const RenderTargetEvent& evt)
+    {
+        // Hide plane and objects below the water
+        pPlaneEnt->setVisible(false);
+        std::vector<Entity*>::iterator i, iend;
+        iend = belowWaterEnts.end();
+        for (i = belowWaterEnts.begin(); i != iend; ++i)
+        {
+            (*i)->setVisible(false);
+        }
+        theCam->enableReflection(reflectionPlane);
+
+    }
+    void postRenderTargetUpdate(const RenderTargetEvent& evt)
+    {
+        // Show plane and objects below the water
+        pPlaneEnt->setVisible(true);
+        std::vector<Entity*>::iterator i, iend;
+        iend = belowWaterEnts.end();
+        for (i = belowWaterEnts.begin(); i != iend; ++i)
+        {
+            (*i)->setVisible(true);
+        }
+        theCam->disableReflection();
+    }
+
+};
+
+class FresnelFrameListener : public ExampleFrameListener
+{
+public:
+
+    FresnelFrameListener(RenderWindow* win, Camera* cam)
+        : ExampleFrameListener(win, cam, false, false)
+    {}
+    bool frameStarted(const FrameEvent &evt)
+    {
+        animTime += evt.timeSinceLastFrame;
+        while (animTime > FISH_PATH_LENGTH)
+            animTime -= FISH_PATH_LENGTH;
+
+        for (size_t fish = 0; fish < NUM_FISH; ++fish)
+        {
+            // Animate the fish
+            fishAnimations[fish]->addTime(evt.timeSinceLastFrame*2);
+            // Move the fish
+            Vector3 newPos = fishSplines[fish].interpolate(animTime / FISH_PATH_LENGTH);
+            fishNodes[fish]->setPosition(newPos);
+            // Work out the direction
+            Vector3 direction = fishLastPosition[fish] - newPos;
+            direction.normalise();
+			// Test for opposite vectors
+			Real d = 1.0f + Vector3::UNIT_X.dotProduct(direction);
+			if (fabs(d) < 0.00001)
+			{
+				// Diametrically opposed vectors
+				Quaternion orientation;
+				orientation.FromAxes(Vector3::NEGATIVE_UNIT_X, 
+					Vector3::UNIT_Y, Vector3::NEGATIVE_UNIT_Z);
+				fishNodes[fish]->setOrientation(orientation);
+			}
+			else
+			{
+				fishNodes[fish]->setOrientation(
+					Vector3::UNIT_X.getRotationTo(direction));
+			}
+            fishLastPosition[fish] = newPos;
+
+        }
+
+
+
+        return ExampleFrameListener::frameStarted(evt);
+    }
+
+};
+
+class FresnelApplication : public ExampleApplication
+{
+protected:
+    RefractionTextureListener mRefractionListener;
+    ReflectionTextureListener mReflectionListener;
+public:
+    FresnelApplication() {
+    
+    
+    }
+
+    ~FresnelApplication() 
+    {
+    }
+protected:
+    
+
+
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+
+        // Check prerequisites first
+		const RenderSystemCapabilities* caps = Root::getSingleton().getRenderSystem()->getCapabilities();
+        if (!caps->hasCapability(RSC_VERTEX_PROGRAM) || !(caps->hasCapability(RSC_FRAGMENT_PROGRAM)))
+        {
+            OGRE_EXCEPT(1, "Your card does not support vertex and fragment programs, so cannot "
+                "run this demo. Sorry!", 
+                "Fresnel::createScene");
+        }
+        else
+        {
+            if (!GpuProgramManager::getSingleton().isSyntaxSupported("arbfp1") &&
+                !GpuProgramManager::getSingleton().isSyntaxSupported("ps_2_0") &&
+				!GpuProgramManager::getSingleton().isSyntaxSupported("ps_1_4")
+				)
+            {
+                OGRE_EXCEPT(1, "Your card does not support advanced fragment programs, "
+                    "so cannot run this demo. Sorry!", 
+                "Fresnel::createScene");
+            }
+        }
+
+        theCam = mCamera;
+        theCam->setPosition(-50,125,760);
+		theCam->setDirection (0,0,-1);
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setType(Light::LT_DIRECTIONAL);
+        l->setDirection(-Vector3::UNIT_Y);
+
+        Entity* pEnt;
+
+        TexturePtr mTexture = TextureManager::getSingleton().createManual( "Refraction", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, TEX_TYPE_2D, 
+			512, 512, 0, PF_R8G8B8, TU_RENDERTARGET );
+        //RenderTexture* rttTex = mRoot->getRenderSystem()->createRenderTexture( "Refraction", 512, 512 );
+        RenderTarget *rttTex = mTexture->getBuffer()->getRenderTarget();
+		
+        {
+            Viewport *v = rttTex->addViewport( mCamera );
+            MaterialPtr mat = MaterialManager::getSingleton().getByName("Examples/FresnelReflectionRefraction");
+            mat->getTechnique(0)->getPass(0)->getTextureUnitState(2)->setTextureName("Refraction");
+            v->setOverlaysEnabled(false);
+            rttTex->addListener(&mRefractionListener);
+        }
+        
+		mTexture = TextureManager::getSingleton().createManual( "Reflection", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, TEX_TYPE_2D, 
+			512, 512, 0, PF_R8G8B8, TU_RENDERTARGET );
+        //rttTex = mRoot->getRenderSystem()->createRenderTexture( "Reflection", 512, 512 );
+        rttTex = mTexture->getBuffer()->getRenderTarget();
+        {
+            Viewport *v = rttTex->addViewport( mCamera );
+            MaterialPtr mat = MaterialManager::getSingleton().getByName("Examples/FresnelReflectionRefraction");
+            mat->getTechnique(0)->getPass(0)->getTextureUnitState(1)->setTextureName("Reflection");
+            v->setOverlaysEnabled(false);
+            rttTex->addListener(&mReflectionListener);
+        }
+        
+        
+        // Define a floor plane mesh
+        reflectionPlane.normal = Vector3::UNIT_Y;
+        reflectionPlane.d = 0;
+        MeshManager::getSingleton().createPlane("ReflectPlane",
+            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+            reflectionPlane,
+            700,1300,10,10,true,1,3,5,Vector3::UNIT_Z);
+        pPlaneEnt = mSceneMgr->createEntity( "plane", "ReflectPlane" );
+        pPlaneEnt->setMaterialName("Examples/FresnelReflectionRefraction");
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+        
+        mSceneMgr->setSkyBox(true, "Examples/CloudyNoonSkyBox");
+
+        // My node to which all objects will be attached
+        SceneNode* myRootNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+
+		// above water entities
+        pEnt = mSceneMgr->createEntity( "RomanBathUpper", "RomanBathUpper.mesh" );
+		myRootNode->attachObject(pEnt);        
+        aboveWaterEnts.push_back(pEnt);
+
+        pEnt = mSceneMgr->createEntity( "Columns", "Columns.mesh" );
+		myRootNode->attachObject(pEnt);        
+        aboveWaterEnts.push_back(pEnt);
+
+		Ogre::SceneNode *headNode = myRootNode->createChildSceneNode ();
+		pEnt = mSceneMgr->createEntity( "OgreHead", "ogrehead.mesh" );
+		pEnt->setMaterialName ("RomanBath/OgreStone");
+        headNode->attachObject(pEnt);
+		headNode->setPosition(-350,55,130);
+		headNode->rotate(Vector3::UNIT_Y, Degree (90));
+        aboveWaterEnts.push_back(pEnt);
+
+		// below water entities
+		pEnt = mSceneMgr->createEntity( "RomanBathLower", "RomanBathLower.mesh" );
+        myRootNode->attachObject(pEnt);
+        belowWaterEnts.push_back(pEnt);
+
+		for (size_t fishNo = 0; fishNo < NUM_FISH; ++fishNo)
+        {
+            pEnt = mSceneMgr->createEntity("fish" + StringConverter::toString(fishNo), "fish.mesh");
+            fishNodes[fishNo] = myRootNode->createChildSceneNode();
+			fishNodes[fishNo]->setScale(FISH_SCALE, FISH_SCALE, FISH_SCALE);
+            fishAnimations[fishNo] = pEnt->getAnimationState("swim");
+            fishAnimations[fishNo]->setEnabled(true);
+            fishNodes[fishNo]->attachObject(pEnt);
+            belowWaterEnts.push_back(pEnt);
+
+            // Generate a random selection of points for the fish to swim to
+            fishSplines[fishNo].setAutoCalculate(false);
+            Vector3 lastPos;
+            for (size_t waypoint = 0; waypoint < NUM_FISH_WAYPOINTS; ++waypoint)
+            {
+                Vector3 pos = Vector3(
+                    Math::SymmetricRandom() * 270, -10, Math::SymmetricRandom() * 700);
+                if (waypoint > 0)
+                {
+                    // check this waypoint isn't too far, we don't want turbo-fish ;)
+                    // since the waypoints are achieved every 5 seconds, half the length
+                    // of the pond is ok
+                    while ((lastPos - pos).length() > 750)
+                    {
+                        pos = Vector3(
+                            Math::SymmetricRandom() * 270, -10, Math::SymmetricRandom() * 700);
+                    }
+                }
+                fishSplines[fishNo].addPoint(pos);
+                lastPos = pos;
+            }
+            // close the spline
+            fishSplines[fishNo].addPoint(fishSplines[fishNo].getPoint(0));
+            // recalc
+            fishSplines[fishNo].recalcTangents();
+
+
+        }
+
+
+
+
+    }
+
+    void createFrameListener(void)
+    {
+        mFrameListener= new FresnelFrameListener(mWindow, mCamera);
+        mFrameListener->showDebugOverlay(true);
+        mRoot->addFrameListener(mFrameListener);
+    }
+
+};
+
+
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+    // Create application object
+    FresnelApplication app;
+
+    try {
+        app.go();
+    } catch( Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/Fresnel/src/Makefile.am
===================================================================
--- /Samples/Fresnel/src/Makefile.am	(revision 5)
+++ /Samples/Fresnel/src/Makefile.am	(revision 5)
@@ -0,0 +1,7 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Fresnel/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = Fresnel
+
+Fresnel_SOURCES = Fresnel.cpp
+Fresnel_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Fresnel_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/Fresnel/src/Makefile.in
===================================================================
--- /Samples/Fresnel/src/Makefile.in	(revision 5)
+++ /Samples/Fresnel/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = Fresnel$(EXEEXT)
+subdir = Samples/Fresnel/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_Fresnel_OBJECTS = Fresnel.$(OBJEXT)
+Fresnel_OBJECTS = $(am_Fresnel_OBJECTS)
+am__DEPENDENCIES_1 =
+Fresnel_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Fresnel_SOURCES)
+DIST_SOURCES = $(Fresnel_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Fresnel/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+Fresnel_SOURCES = Fresnel.cpp
+Fresnel_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Fresnel_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Fresnel/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Fresnel/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+Fresnel$(EXEEXT): $(Fresnel_OBJECTS) $(Fresnel_DEPENDENCIES) 
+	@rm -f Fresnel$(EXEEXT)
+	$(CXXLINK) $(Fresnel_LDFLAGS) $(Fresnel_OBJECTS) $(Fresnel_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Fresnel.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Grass/Makefile.am
===================================================================
--- /Samples/Grass/Makefile.am	(revision 5)
+++ /Samples/Grass/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src
Index: /Samples/Grass/Makefile.in
===================================================================
--- /Samples/Grass/Makefile.in	(revision 5)
+++ /Samples/Grass/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Grass
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Grass/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Grass/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Grass/scripts/Demo_Grass.cbp
===================================================================
--- /Samples/Grass/scripts/Demo_Grass.cbp	(revision 5)
+++ /Samples/Grass/scripts/Demo_Grass.cbp	(revision 5)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Grass" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Grass.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Grass.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\Grass.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Grass/scripts/Demo_Grass.vcproj
===================================================================
--- /Samples/Grass/scripts/Demo_Grass.vcproj	(revision 5)
+++ /Samples/Grass/scripts/Demo_Grass.vcproj	(revision 5)
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_Grass"
+	ProjectGUID="{A6698238-7305-11D9-AAC8-91EC5E497716}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_Grass.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_Grass.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_Grass.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\Grass.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Grass/scripts/Demo_Grass_linux.cbp
===================================================================
--- /Samples/Grass/scripts/Demo_Grass_linux.cbp	(revision 5)
+++ /Samples/Grass/scripts/Demo_Grass_linux.cbp	(revision 5)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Grass" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_Grass" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_Grass" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../src/Grass.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Grass/scripts/Demo_Grass_stlp.cbp
===================================================================
--- /Samples/Grass/scripts/Demo_Grass_stlp.cbp	(revision 5)
+++ /Samples/Grass/scripts/Demo_Grass_stlp.cbp	(revision 5)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_Grass" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Grass.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Grass.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\Grass.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Grass/scripts/Demo_Grass_vc8.vcproj
===================================================================
--- /Samples/Grass/scripts/Demo_Grass_vc8.vcproj	(revision 5)
+++ /Samples/Grass/scripts/Demo_Grass_vc8.vcproj	(revision 5)
@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_Grass"
+	ProjectGUID="{A6698238-7305-11D9-AAC8-91EC5E497716}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_Grass.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_Grass.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_Grass.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\Grass.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Grass/scripts/Demo_Grass_vc8.vcproj.user
===================================================================
--- /Samples/Grass/scripts/Demo_Grass_vc8.vcproj.user	(revision 5)
+++ /Samples/Grass/scripts/Demo_Grass_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/Grass/src/Grass.cpp
===================================================================
--- /Samples/Grass/src/Grass.cpp	(revision 5)
+++ /Samples/Grass/src/Grass.cpp	(revision 5)
@@ -0,0 +1,485 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        Grass.cpp
+    \brief
+        Specialisation of OGRE's framework application to show the
+        use of the StaticGeometry class to create 'baked' instances of
+		many meshes, to create effects like grass efficiently.
+**/
+
+#include "ExampleApplication.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+
+#define KEY_PRESSED(_key,_timeDelay, _macro) \
+{ \
+    if (mKeyboard->isKeyDown(_key) && timeDelay <= 0) \
+    { \
+		timeDelay = _timeDelay; \
+        _macro ; \
+    } \
+}
+
+#define GRASS_HEIGHT 300
+#define GRASS_WIDTH 250
+#define GRASS_MESH_NAME "grassblades"
+#define GRASS_MATERIAL "Examples/GrassBlades"
+#define OFFSET_PARAM 999
+
+Light* mLight;
+SceneNode* mLightNode = 0;
+AnimationState* mAnimState = 0;
+ColourValue mMinLightColour(0.5, 0.1, 0.0);
+ColourValue mMaxLightColour(1.0, 0.6, 0.0);
+Real mMinFlareSize = 40;
+Real mMaxFlareSize = 80;
+StaticGeometry* mStaticGeom;
+
+
+/** This class 'wibbles' the light and billboard */
+class LightWibbler : public ControllerValue<Real>
+{
+protected:
+	Light* mLight;
+	Billboard* mBillboard;
+	ColourValue mColourRange;
+	ColourValue mHalfColour;
+	Real mMinSize;
+	Real mSizeRange;
+	Real intensity;
+public:
+	LightWibbler(Light* light, Billboard* billboard, const ColourValue& minColour, 
+		const ColourValue& maxColour, Real minSize, Real maxSize)
+	{
+		mLight = light;
+		mBillboard = billboard;
+		mColourRange.r = (maxColour.r - minColour.r) * 0.5;
+		mColourRange.g = (maxColour.g - minColour.g) * 0.5;
+		mColourRange.b = (maxColour.b - minColour.b) * 0.5;
+		mHalfColour = minColour + mColourRange;
+		mMinSize = minSize;
+		mSizeRange = maxSize - minSize;
+	}
+
+	virtual Real  getValue (void) const
+	{
+		return intensity;
+	}
+
+	virtual void  setValue (Real value)
+	{
+		intensity = value;
+
+		ColourValue newColour;
+
+		// Attenuate the brightness of the light
+		newColour.r = mHalfColour.r + (mColourRange.r * intensity);
+		newColour.g = mHalfColour.g + (mColourRange.g * intensity);
+		newColour.b = mHalfColour.b + (mColourRange.b * intensity);
+
+		mLight->setDiffuseColour(newColour);
+		mBillboard->setColour(newColour);
+		// set billboard size
+		Real newSize = mMinSize + (intensity * mSizeRange);
+		mBillboard->setDimensions(newSize, newSize);
+
+	}
+};
+
+class GrassListener : public ExampleFrameListener
+{
+protected:
+	SceneManager* mSceneManager;
+	bool mShowBBs;
+public:
+	GrassListener(RenderWindow* win, Camera* cam, SceneManager* sceneManager)
+		: ExampleFrameListener(win, cam), 
+		mSceneManager(sceneManager), mShowBBs(false)
+	{
+	}
+
+
+	void waveGrass(Real timeElapsed)
+	{
+		static Real xinc = Math::PI * 0.4;
+		static Real zinc = Math::PI * 0.55;
+		static Real xpos = Math::RangeRandom(-Math::PI, Math::PI);
+		static Real zpos = Math::RangeRandom(-Math::PI, Math::PI);
+
+		xpos += xinc * timeElapsed;
+		zpos += zinc * timeElapsed;
+
+		// Update vertex program parameters by binding a value to each renderable
+		static Vector4 offset(0,0,0,0);
+
+		StaticGeometry::RegionIterator rit =  mStaticGeom->getRegionIterator();
+		while (rit.hasMoreElements())
+		{
+			StaticGeometry::Region* reg = rit.getNext();
+
+			// a little randomness
+			xpos += reg->getCentre().x * 0.001;
+			zpos += reg->getCentre().z * 0.001;
+			offset.x = Math::Sin(xpos) * 5;
+			offset.z = Math::Sin(zpos) * 5;
+
+			StaticGeometry::Region::LODIterator lodit = reg->getLODIterator();
+			while (lodit.hasMoreElements())
+			{
+				StaticGeometry::LODBucket* lod = lodit.getNext();
+				StaticGeometry::LODBucket::MaterialIterator matit = 
+					lod->getMaterialIterator();
+				while (matit.hasMoreElements())
+				{
+					StaticGeometry::MaterialBucket* mat = matit.getNext();
+					StaticGeometry::MaterialBucket::GeometryIterator geomit = 
+						mat->getGeometryIterator();
+					while (geomit.hasMoreElements())
+					{
+						StaticGeometry::GeometryBucket* geom = geomit.getNext();
+						geom->setCustomParameter(OFFSET_PARAM, offset);
+
+					}
+				}
+			}
+		}
+
+	}
+
+	bool frameStarted(const FrameEvent& evt)
+	{
+		if( ExampleFrameListener::frameStarted(evt) == false )
+			return false;
+
+		static Real timeDelay = 0;
+		timeDelay -= evt.timeSinceLastFrame;
+
+		if (mAnimState)
+			mAnimState->addTime(evt.timeSinceLastFrame);
+
+		KEY_PRESSED(OIS::KC_B, 1, 
+			mShowBBs = !mShowBBs;
+			mSceneManager->showBoundingBoxes(mShowBBs);
+			)
+
+		waveGrass(evt.timeSinceLastFrame);
+
+		return true;
+	}
+};
+
+
+
+class Grass_Application : public ExampleApplication
+{
+public:
+    Grass_Application() {}
+	
+protected:
+	SceneNode *mpObjsNode; // the node wich will hold our entities
+
+	void createGrassMesh()
+	{
+		// Each grass section is 3 planes at 60 degrees to each other
+		// Normals point straight up to simulate correct lighting
+		MeshPtr msh = MeshManager::getSingleton().createManual(GRASS_MESH_NAME, 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		SubMesh* sm = msh->createSubMesh();
+		sm->useSharedVertices = false;
+		sm->vertexData = new VertexData();
+		sm->vertexData->vertexStart = 0;
+		sm->vertexData->vertexCount = 12;
+		VertexDeclaration* dcl = sm->vertexData->vertexDeclaration;
+		size_t offset = 0;
+		dcl->addElement(0, offset, VET_FLOAT3, VES_POSITION);
+		offset += VertexElement::getTypeSize(VET_FLOAT3);
+		dcl->addElement(0, offset, VET_FLOAT3, VES_NORMAL);
+		offset += VertexElement::getTypeSize(VET_FLOAT3);
+		dcl->addElement(0, offset, VET_FLOAT2, VES_TEXTURE_COORDINATES);
+		offset += VertexElement::getTypeSize(VET_FLOAT2);
+
+		HardwareVertexBufferSharedPtr vbuf = HardwareBufferManager::getSingleton()
+			.createVertexBuffer(
+				offset, 12, HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+		float* pReal = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD));
+		Vector3 baseVec(GRASS_WIDTH/2, 0, 0);
+		Vector3 vec = baseVec;
+		Quaternion rot;
+		rot.FromAngleAxis(Degree(60), Vector3::UNIT_Y);
+		int i;
+		for (i = 0; i < 3; ++i)
+		{
+			// position
+			*pReal++ = -vec.x;
+			*pReal++ = GRASS_HEIGHT;
+			*pReal++ = -vec.z;
+			// normal
+			*pReal++ = 0;
+			*pReal++ = 1;
+			*pReal++ = 0;
+			// uv
+			*pReal++ = 0;
+			*pReal++ = 0;
+
+			// position
+			*pReal++ = vec.x;
+			*pReal++ = GRASS_HEIGHT;
+			*pReal++ = vec.z;
+			// normal
+			*pReal++ = 0;
+			*pReal++ = 1;
+			*pReal++ = 0;
+			// uv
+			*pReal++ = 1;
+			*pReal++ = 0;
+
+			// position
+			*pReal++ = -vec.x;
+			*pReal++ = 0;
+			*pReal++ = -vec.z;
+			// normal
+			*pReal++ = 0;
+			*pReal++ = 1;
+			*pReal++ = 0;
+			// uv
+			*pReal++ = 0;
+			*pReal++ = 1;
+
+			// position
+			*pReal++ = vec.x;
+			*pReal++ = 0;
+			*pReal++ = vec.z;
+			// normal
+			*pReal++ = 0;
+			*pReal++ = 1;
+			*pReal++ = 0;
+			// uv
+			*pReal++ = 1;
+			*pReal++ = 1;
+
+			vec = rot * vec;
+		}
+		vbuf->unlock();
+		sm->vertexData->vertexBufferBinding->setBinding(0, vbuf);
+		sm->indexData->indexCount = 6*3;
+		sm->indexData->indexBuffer = HardwareBufferManager::getSingleton()
+			.createIndexBuffer(HardwareIndexBuffer::IT_16BIT, 6*3,
+				HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+		uint16* pI = static_cast<uint16*>(
+			sm->indexData->indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+		for (i = 0; i < 3; ++i)
+		{
+			int off = i*4;
+			*pI++ = 0 + off;
+			*pI++ = 3 + off;
+			*pI++ = 1 + off;
+
+			*pI++ = 0 + off;
+			*pI++ = 2 + off;
+			*pI++ = 3 + off;
+		}
+
+		sm->indexData->indexBuffer->unlock();
+
+		sm->setMaterialName(GRASS_MATERIAL);
+		msh->load();
+
+	}
+
+	void setupLighting()
+	{
+		// Set ambient light
+		mSceneMgr->setAmbientLight(ColourValue(0.2, 0.2, 0.2));
+		// Point light, movable, reddish
+		mLight = mSceneMgr->createLight("Light2");
+		mLight->setDiffuseColour(mMinLightColour);
+		mLight->setSpecularColour(1, 1, 1);
+		mLight->setAttenuation(8000,1,0.0005,0);
+
+		// Create light node
+		mLightNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(
+			"MovingLightNode");
+		mLightNode->attachObject(mLight);
+		// create billboard set
+		BillboardSet* bbs = mSceneMgr->createBillboardSet("lightbbs", 1);
+		bbs->setMaterialName("Examples/Flare");
+		Billboard* bb = bbs->createBillboard(0,0,0,mMinLightColour);
+		// attach
+		mLightNode->attachObject(bbs);
+
+		// create controller, after this is will get updated on its own
+		ControllerFunctionRealPtr func = ControllerFunctionRealPtr(
+			new WaveformControllerFunction(Ogre::WFT_SINE, 0.0, 0.5));
+		ControllerManager& contMgr = ControllerManager::getSingleton();
+		ControllerValueRealPtr val = ControllerValueRealPtr(
+			new LightWibbler(mLight, bb, mMinLightColour, mMaxLightColour, 
+			mMinFlareSize, mMaxFlareSize));
+		Controller<Real>* controller = contMgr.createController(
+			contMgr.getFrameTimeSource(), val, func);
+
+		//mLight->setPosition(Vector3(300,250,-300));
+		mLightNode->setPosition(Vector3(300,250,-300));
+
+
+		// Create a track for the light
+		Animation* anim = mSceneMgr->createAnimation("LightTrack", 20);
+		// Spline it for nice curves
+		anim->setInterpolationMode(Animation::IM_SPLINE);
+		// Create a track to animate the camera's node
+		NodeAnimationTrack* track = anim->createNodeTrack(0, mLightNode);
+		// Setup keyframes
+		TransformKeyFrame* key = track->createNodeKeyFrame(0); // A startposition
+		key->setTranslate(Vector3(300,550,-300));
+		key = track->createNodeKeyFrame(2);//B
+		key->setTranslate(Vector3(150,600,-250));
+		key = track->createNodeKeyFrame(4);//C
+		key->setTranslate(Vector3(-150,650,-100));
+		key = track->createNodeKeyFrame(6);//D
+		key->setTranslate(Vector3(-400,500,-200));
+		key = track->createNodeKeyFrame(8);//E
+		key->setTranslate(Vector3(-200,500,-400));
+		key = track->createNodeKeyFrame(10);//F
+		key->setTranslate(Vector3(-100,450,-200));
+		key = track->createNodeKeyFrame(12);//G
+		key->setTranslate(Vector3(-100,400,180));
+		key = track->createNodeKeyFrame(14);//H
+		key->setTranslate(Vector3(0,250,600));
+		key = track->createNodeKeyFrame(16);//I
+		key->setTranslate(Vector3(100,650,100));
+		key = track->createNodeKeyFrame(18);//J
+		key->setTranslate(Vector3(250,600,0));
+		key = track->createNodeKeyFrame(20);//K == A
+		key->setTranslate(Vector3(300,550,-300));
+		// Create a new animation state to track this
+		mAnimState = mSceneMgr->createAnimationState("LightTrack");
+		mAnimState->setEnabled(true);
+	}
+
+	void createScene(void)
+    {
+
+		mSceneMgr->setSkyBox(true, "Examples/SpaceSkyBox");
+
+		setupLighting();
+
+
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 0;
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			14500,14500,10,10,true,1,50,50,Vector3::UNIT_Z);
+		Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("Examples/GrassFloor");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+		Vector3 minV(-2000,0,-2000);
+		Vector3 maxV(2000,0,2000);
+
+
+		createGrassMesh();
+
+		Entity* e = mSceneMgr->createEntity("1", GRASS_MESH_NAME);
+
+		StaticGeometry* s = mSceneMgr->createStaticGeometry("bing");
+		s->setRegionDimensions(Vector3(1000,1000,1000));
+		// Set the region origin so the centre is at 0 world
+		s->setOrigin(Vector3(-500, 500, -500));
+
+		for (int x = -1950; x < 1950; x += 150)
+		{
+			for (int z = -1950; z < 1950; z += 150)
+			{
+				Vector3 pos(
+					x + Math::RangeRandom(-25, 25), 
+					0, 
+					z + Math::RangeRandom(-25, 25));
+				Quaternion orientation;
+				orientation.FromAngleAxis(
+					Degree(Math::RangeRandom(0, 359)),
+					Vector3::UNIT_Y);
+				Vector3 scale(
+					1, Math::RangeRandom(0.85, 1.15), 1);
+				s->addEntity(e, pos, orientation, scale);
+			}
+
+		}
+
+		s->build();
+		mStaticGeom = s;
+
+		// Put an Ogre head in the middle
+		MeshPtr m = MeshManager::getSingleton().load("ogrehead.mesh", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		unsigned short src, dest;
+		if (!m->suggestTangentVectorBuildParams(VES_TANGENT, src, dest))
+		{
+			m->buildTangentVectors(VES_TANGENT, src, dest);
+		}
+		e = mSceneMgr->createEntity("head", "ogrehead.mesh");
+		e->setMaterialName("Examples/OffsetMapping/Specular");
+		SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		headNode->attachObject(e);
+		headNode->setScale(7,7,7);
+		headNode->setPosition(0,200,0);
+		e->setNormaliseNormals(true);
+		mCamera->move(Vector3(0,350,0));
+	}
+
+    // Create new frame listener
+    void createFrameListener(void)
+    {
+        mFrameListener= new GrassListener(mWindow, mCamera, mSceneMgr);
+        mRoot->addFrameListener(mFrameListener);
+    }
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+    // Create application object
+    Grass_Application app;
+
+    try {
+        app.go();
+    } catch( Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
Index: /Samples/Grass/src/Makefile.am
===================================================================
--- /Samples/Grass/src/Makefile.am	(revision 5)
+++ /Samples/Grass/src/Makefile.am	(revision 5)
@@ -0,0 +1,7 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = Grass
+
+Grass_SOURCES = Grass.cpp
+Grass_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Grass_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/Grass/src/Makefile.in
===================================================================
--- /Samples/Grass/src/Makefile.in	(revision 5)
+++ /Samples/Grass/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = Grass$(EXEEXT)
+subdir = Samples/Grass/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_Grass_OBJECTS = Grass.$(OBJEXT)
+Grass_OBJECTS = $(am_Grass_OBJECTS)
+am__DEPENDENCIES_1 =
+Grass_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Grass_SOURCES)
+DIST_SOURCES = $(Grass_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+Grass_SOURCES = Grass.cpp
+Grass_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Grass_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Grass/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Grass/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+Grass$(EXEEXT): $(Grass_OBJECTS) $(Grass_DEPENDENCIES) 
+	@rm -f Grass$(EXEEXT)
+	$(CXXLINK) $(Grass_LDFLAGS) $(Grass_OBJECTS) $(Grass_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grass.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Gui/Makefile.am
===================================================================
--- /Samples/Gui/Makefile.am	(revision 5)
+++ /Samples/Gui/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src
Index: /Samples/Gui/Makefile.in
===================================================================
--- /Samples/Gui/Makefile.in	(revision 5)
+++ /Samples/Gui/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Gui
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Gui/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Gui/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Gui/scripts/Demo_Gui.cbp
===================================================================
--- /Samples/Gui/scripts/Demo_Gui.cbp	(revision 5)
+++ /Samples/Gui/scripts/Demo_Gui.cbp	(revision 5)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Gui" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Gui.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\libOgreMain_d.dll;..\..\Common\CEGUIRenderer\bin\Debug\libOgreGUIRenderer_d.a;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="CEGUIBase_d" />
+					<Add library="OgreGUIRenderer_d" />
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Gui.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\libOgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreGUIRenderer" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI" />
+			<Add directory="..\..\Common\CEGUIRenderer\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\Gui.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Gui/scripts/Demo_Gui.vcproj
===================================================================
--- /Samples/Gui/scripts/Demo_Gui.vcproj	(revision 5)
+++ /Samples/Gui/scripts/Demo_Gui.vcproj	(revision 5)
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_Gui"
+	ProjectGUID="{0F83CA41-4364-49FF-A230-613B08B5CF82}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/Zm150"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib"
+				OutputFile="$(OutDir)/Demo_Gui.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_Gui.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib CEGUIBase.lib OgreGUIRenderer.lib"
+				OutputFile="$(OutDir)/Demo_Gui.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\Gui.cpp">
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalOptions="/Zm150"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Gui/scripts/Demo_Gui_linux.cbp
===================================================================
--- /Samples/Gui/scripts/Demo_Gui_linux.cbp	(revision 5)
+++ /Samples/Gui/scripts/Demo_Gui_linux.cbp	(revision 5)
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Gui" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_Gui" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="CEGUIBase" />
+					<Add library="OgreGUIRenderer_d" />
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_Gui" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreGUIRenderer" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+			<Add directory="$(#CEGUI)" />
+			<Add directory="../../Common/CEGUIRenderer/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../src/Gui.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Gui/scripts/Demo_Gui_stlp.cbp
===================================================================
--- /Samples/Gui/scripts/Demo_Gui_stlp.cbp	(revision 5)
+++ /Samples/Gui/scripts/Demo_Gui_stlp.cbp	(revision 5)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_Gui" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Gui.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\libOgreMain_d.dll;..\..\Common\CEGUIRenderer\bin\Debug\libOgreGUIRenderer_d.a;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="CEGUIBase_d" />
+					<Add library="OgreGUIRenderer_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Gui.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\libOgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreGUIRenderer" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI" />
+			<Add directory="..\..\Common\CEGUIRenderer\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\Gui.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Gui/scripts/Demo_Gui_vc8.vcproj
===================================================================
--- /Samples/Gui/scripts/Demo_Gui_vc8.vcproj	(revision 5)
+++ /Samples/Gui/scripts/Demo_Gui_vc8.vcproj	(revision 5)
@@ -0,0 +1,231 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_Gui"
+	ProjectGUID="{0F83CA41-4364-49FF-A230-613B08B5CF82}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/Zm150"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib"
+				OutputFile="$(OutDir)/Demo_Gui.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_Gui.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib CEGUIBase.lib OgreGUIRenderer.lib"
+				OutputFile="$(OutDir)/Demo_Gui.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\Gui.cpp"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalOptions="/Zm150"
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Gui/scripts/Demo_Gui_vc8.vcproj.user
===================================================================
--- /Samples/Gui/scripts/Demo_Gui_vc8.vcproj.user	(revision 5)
+++ /Samples/Gui/scripts/Demo_Gui_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/Gui/src/Gui.cpp
===================================================================
--- /Samples/Gui/src/Gui.cpp	(revision 5)
+++ /Samples/Gui/src/Gui.cpp	(revision 5)
@@ -0,0 +1,566 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        Gui.cpp
+    \brief
+        An example of CEGUI's features
+*/
+
+#include <CEGUI/CEGUIImageset.h>
+#include <CEGUI/CEGUISystem.h>
+#include <CEGUI/CEGUILogger.h>
+#include <CEGUI/CEGUISchemeManager.h>
+#include <CEGUI/CEGUIWindowManager.h>
+#include <CEGUI/CEGUIWindow.h>
+#include <CEGUI/CEGUIPropertyHelper.h>
+#include <CEGUI/elements/CEGUICombobox.h>
+#include <CEGUI/elements/CEGUIListbox.h>
+#include <CEGUI/elements/CEGUIListboxTextItem.h>
+#include <CEGUI/elements/CEGUIPushButton.h>
+#include <CEGUI/elements/CEGUIScrollbar.h>
+#include "OgreCEGUIRenderer.h"
+#include "OgreCEGUIResourceProvider.h"
+
+#include "ExampleApplication.h"
+
+//----------------------------------------------------------------//
+CEGUI::MouseButton convertOISMouseButtonToCegui(int buttonID)
+{
+    switch (buttonID)
+    {
+	case 0: return CEGUI::LeftButton;
+	case 1: return CEGUI::RightButton;
+	case 2:	return CEGUI::MiddleButton;
+	case 3: return CEGUI::X1Button;
+	default: return CEGUI::LeftButton;
+    }
+}
+
+class GuiFrameListener : public ExampleFrameListener, public OIS::KeyListener, public OIS::MouseListener
+{
+private:
+    CEGUI::Renderer* mGUIRenderer;
+    bool mShutdownRequested;
+
+public:
+    // NB using buffered input, this is the only change
+    GuiFrameListener(RenderWindow* win, Camera* cam, CEGUI::Renderer* renderer)
+        : ExampleFrameListener(win, cam, true, true, true), 
+          mGUIRenderer(renderer),
+          mShutdownRequested(false)
+    {
+		mMouse->setEventCallback(this);
+		mKeyboard->setEventCallback(this);
+    }
+
+    /// Tell the frame listener to exit at the end of the next frame
+    void requestShutdown(void)
+    {
+        mShutdownRequested = true;
+    }
+
+    bool frameEnded(const FrameEvent& evt)
+    {
+        if (mShutdownRequested)
+            return false;
+        else
+            return ExampleFrameListener::frameEnded(evt);
+    }
+	//----------------------------------------------------------------//
+	bool mouseMoved( const OIS::MouseEvent &arg )
+	{
+		CEGUI::System::getSingleton().injectMouseMove( arg.state.X.rel, arg.state.Y.rel );
+		return true;
+	}
+
+	//----------------------------------------------------------------//
+	bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
+	{
+		CEGUI::System::getSingleton().injectMouseButtonDown(convertOISMouseButtonToCegui(id));
+		return true;
+	}
+
+	//----------------------------------------------------------------//
+	bool mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
+	{
+		CEGUI::System::getSingleton().injectMouseButtonUp(convertOISMouseButtonToCegui(id));
+		return true;
+	}
+
+	//----------------------------------------------------------------//
+	bool keyPressed( const OIS::KeyEvent &arg )
+	{
+		if( arg.key == OIS::KC_ESCAPE )
+			mShutdownRequested = true;
+		CEGUI::System::getSingleton().injectKeyDown( arg.key );
+		CEGUI::System::getSingleton().injectChar( arg.text );
+		return true;
+	}
+
+	//----------------------------------------------------------------//
+	bool keyReleased( const OIS::KeyEvent &arg )
+	{
+		CEGUI::System::getSingleton().injectKeyUp( arg.key );
+		return true;
+	}
+};
+
+class GuiApplication : public ExampleApplication
+{
+private:
+    CEGUI::OgreCEGUIRenderer* mGUIRenderer;
+    CEGUI::System* mGUISystem;
+    CEGUI::Window* mEditorGuiSheet;
+	CEGUI::Scrollbar* mRed;
+	CEGUI::Scrollbar* mGreen;
+	CEGUI::Scrollbar* mBlue;
+	CEGUI::Window* mPreview; // StaticImage
+	CEGUI::Window* mTip;
+	CEGUI::Listbox* mList;
+	CEGUI::Window* mEditBox;
+	typedef std::map<CEGUI::String, CEGUI::String> DescriptionMap;
+	DescriptionMap mDescriptionMap;
+
+public:
+    GuiApplication()
+      : mGUIRenderer(0),
+        mGUISystem(0),
+        mEditorGuiSheet(0)
+    {
+		mDescriptionMap[(CEGUI::utf8*)"Demo8"] = 
+			(CEGUI::utf8*)"The main containing panel";
+		mDescriptionMap[(CEGUI::utf8*)"Demo8/Window1"] = 
+			(CEGUI::utf8*)"A test window";
+		mDescriptionMap[(CEGUI::utf8*)"Demo8/Window1/Listbox"] = 
+			(CEGUI::utf8*)"A list box";
+		mDescriptionMap[(CEGUI::utf8*)"Demo8/Window1/Controls/Red"] = 
+			(CEGUI::utf8*)"A colour slider";
+		mDescriptionMap[(CEGUI::utf8*)"Demo8/Window1/Controls/Green"] = 
+			(CEGUI::utf8*)"A colour slider";
+		mDescriptionMap[(CEGUI::utf8*)"Demo8/Window1/Controls/Blue"] = 
+			(CEGUI::utf8*)"A colour slider";
+		mDescriptionMap[(CEGUI::utf8*)"Demo8/Window1/Controls/ColourSample"] = 
+			(CEGUI::utf8*)"The colour that will be used for the selection when added to the list";
+		mDescriptionMap[(CEGUI::utf8*)"Demo8/Window1/Controls/Editbox"] = 
+			(CEGUI::utf8*)"An edit box; this text will be added to the list";
+		mDescriptionMap[(CEGUI::utf8*)"Demo8/Window1/Controls/Add"] = 
+			(CEGUI::utf8*)"Adds the text to the list";
+		mDescriptionMap[(CEGUI::utf8*)"Demo8/Window1/Controls/ins1"] = 
+			(CEGUI::utf8*)"Some static text";
+
+
+	}
+
+    ~GuiApplication()
+    {
+        if(mEditorGuiSheet)
+        {
+            CEGUI::WindowManager::getSingleton().destroyWindow(mEditorGuiSheet);
+        }
+        if(mGUISystem)
+        {
+            delete mGUISystem;
+            mGUISystem = 0;
+        }
+        if(mGUIRenderer)
+        {
+            delete mGUIRenderer;
+            mGUIRenderer = 0;
+        }
+    }
+
+protected:
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a skydome
+        mSceneMgr->setSkyDome(true, "Examples/CloudySky", 5, 8);
+
+        // Create a light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        l->setPosition(20,80,50);
+
+        // setup GUI system
+        mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, 
+            Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr);
+
+        mGUISystem = new CEGUI::System(mGUIRenderer);
+
+        CEGUI::Logger::getSingleton().setLoggingLevel(CEGUI::Informative);
+
+        Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh");
+
+        SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        headNode->attachObject(ogreHead);
+
+
+        // Setup Render To Texture for preview window
+        RenderTexture* rttTex = mRoot->getRenderSystem()->createRenderTexture( "RttTex", 512, 512, TEX_TYPE_2D, PF_R8G8B8 );
+        {
+            Camera* rttCam = mSceneMgr->createCamera("RttCam");
+            SceneNode* camNode = 
+                mSceneMgr->getRootSceneNode()->createChildSceneNode("rttCamNode");
+            camNode->attachObject(rttCam);
+            rttCam->setPosition(0,0,200);
+            //rttCam->setVisible(true);
+
+            Viewport *v = rttTex->addViewport( rttCam );
+            v->setOverlaysEnabled(false);
+            v->setClearEveryFrame( true );
+            v->setBackgroundColour( ColourValue::Black );
+        }
+
+        // Retrieve CEGUI texture for the RTT
+        CEGUI::Texture* rttTexture = mGUIRenderer->createTexture((CEGUI::utf8*)"RttTex");
+
+        CEGUI::Imageset* rttImageSet = 
+            CEGUI::ImagesetManager::getSingleton().createImageset(
+                    (CEGUI::utf8*)"RttImageset", rttTexture);
+
+        rttImageSet->defineImage((CEGUI::utf8*)"RttImage", 
+                CEGUI::Point(0.0f, 0.0f),
+                CEGUI::Size(rttTexture->getWidth(), rttTexture->getHeight()),
+                CEGUI::Point(0.0f,0.0f));
+
+        // load scheme and set up defaults
+        CEGUI::SchemeManager::getSingleton().loadScheme(
+                (CEGUI::utf8*)"TaharezLookSkin.scheme");
+        mGUISystem->setDefaultMouseCursor(
+                (CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow");
+        mGUISystem->setDefaultFont((CEGUI::utf8*)"BlueHighway-12");
+
+        CEGUI::Window* sheet = 
+            CEGUI::WindowManager::getSingleton().loadWindowLayout(
+                (CEGUI::utf8*)"ogregui.layout"); 
+        mGUISystem->setGUISheet(sheet);
+
+        CEGUI::Combobox* objectComboBox = (CEGUI::Combobox*)CEGUI::WindowManager::getSingleton().getWindow("OgreGuiDemo/TabCtrl/Page2/ObjectTypeList");
+
+        CEGUI::ListboxTextItem* item = new CEGUI::ListboxTextItem((CEGUI::utf8*)"FrameWindow", 0);
+        objectComboBox->addItem(item);
+        item = new CEGUI::ListboxTextItem((CEGUI::utf8*)"Horizontal Scrollbar", 1);
+        objectComboBox->addItem(item);
+        item = new CEGUI::ListboxTextItem((CEGUI::utf8*)"Vertical Scrollbar", 2);
+        objectComboBox->addItem(item);
+        item = new CEGUI::ListboxTextItem((CEGUI::utf8*)"StaticText", 3);
+        objectComboBox->addItem(item);
+        item = new CEGUI::ListboxTextItem((CEGUI::utf8*)"StaticImage", 4);
+        objectComboBox->addItem(item);
+        item = new CEGUI::ListboxTextItem((CEGUI::utf8*)"Render to Texture", 5);
+        objectComboBox->addItem(item);
+
+        setupEventHandlers();
+    }
+
+    // Create new frame listener
+    void createFrameListener(void)
+    {
+        mFrameListener= new GuiFrameListener(mWindow, mCamera, mGUIRenderer);
+        mRoot->addFrameListener(mFrameListener);
+    }
+
+    void setupEventHandlers(void)
+    {
+		CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
+        wmgr.getWindow((CEGUI::utf8*)"OgreGuiDemo/TabCtrl/Page1/QuitButton")
+			->subscribeEvent(
+				CEGUI::PushButton::EventClicked, 
+				CEGUI::Event::Subscriber(&GuiApplication::handleQuit, this));
+        wmgr.getWindow((CEGUI::utf8*)"OgreGuiDemo/TabCtrl/Page1/NewButton")
+			->subscribeEvent(
+				CEGUI::PushButton::EventClicked, 
+				CEGUI::Event::Subscriber(&GuiApplication::handleNew, this));
+        wmgr.getWindow((CEGUI::utf8*)"OgreGuiDemo/TabCtrl/Page1/LoadButton")
+			->subscribeEvent(
+				CEGUI::PushButton::EventClicked, 
+				CEGUI::Event::Subscriber(&GuiApplication::handleLoad, this));
+        wmgr.getWindow((CEGUI::utf8*)"OgreGuiDemo/TabCtrl/Page2/ObjectTypeList")
+			->subscribeEvent(
+				CEGUI::Combobox::EventListSelectionAccepted, 
+				CEGUI::Event::Subscriber(&GuiApplication::handleObjectSelection, this));
+
+    }
+
+	void setupEnterExitEvents(CEGUI::Window* win)
+	{
+		win->subscribeEvent(
+			CEGUI::Window::EventMouseEnters, 
+			CEGUI::Event::Subscriber(&GuiApplication::handleMouseEnters, this));
+		win->subscribeEvent(
+			CEGUI::Window::EventMouseLeaves, 
+			CEGUI::Event::Subscriber(&GuiApplication::handleMouseLeaves, this));
+		for (unsigned int i = 0; i < win->getChildCount(); ++i)
+		{
+			CEGUI::Window* child = win->getChildAtIdx(i);
+			setupEnterExitEvents(child);
+		}
+
+	}
+
+	void setupLoadedLayoutHandlers(void)
+	{
+		CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
+		mRed = static_cast<CEGUI::Scrollbar*>(
+			wmgr.getWindow((CEGUI::utf8*)"Demo8/Window1/Controls/Red"));
+		mGreen = static_cast<CEGUI::Scrollbar*>(
+			wmgr.getWindow((CEGUI::utf8*)"Demo8/Window1/Controls/Green"));
+		mBlue = static_cast<CEGUI::Scrollbar*>(
+			wmgr.getWindow((CEGUI::utf8*)"Demo8/Window1/Controls/Blue"));
+		mPreview = wmgr.getWindow((CEGUI::utf8*)"Demo8/Window1/Controls/ColourSample");
+		mList = static_cast<CEGUI::Listbox*>(
+			wmgr.getWindow((CEGUI::utf8*)"Demo8/Window1/Listbox"));
+		mEditBox = 
+			wmgr.getWindow((CEGUI::utf8*)"Demo8/Window1/Controls/Editbox");
+		mTip = 
+			wmgr.getWindow((CEGUI::utf8*)"Demo8/Window2/Tips");
+	
+		mRed->subscribeEvent(
+				CEGUI::Scrollbar::EventScrollPositionChanged, 
+				CEGUI::Event::Subscriber(&GuiApplication::handleColourChanged, this));
+		mGreen->subscribeEvent(
+			CEGUI::Scrollbar::EventScrollPositionChanged, 
+			CEGUI::Event::Subscriber(&GuiApplication::handleColourChanged, this));
+		mBlue->subscribeEvent(
+			CEGUI::Scrollbar::EventScrollPositionChanged, 
+			CEGUI::Event::Subscriber(&GuiApplication::handleColourChanged, this));
+
+		wmgr.getWindow((CEGUI::utf8*)"Demo8/Window1/Controls/Add")
+			->subscribeEvent(
+			CEGUI::PushButton::EventClicked, 
+			CEGUI::Event::Subscriber(&GuiApplication::handleAdd, this));
+
+		CEGUI::Window* root = wmgr.getWindow("Demo8");
+		setupEnterExitEvents(root);
+
+
+
+	}
+
+    CEGUI::Window* createRttGuiObject(void)
+    {
+        static unsigned int rttCounter = 0;
+		String guiObjectName = "NewRttImage" + StringConverter::toString(rttCounter);
+
+        CEGUI::Imageset* rttImageSet = 
+            CEGUI::ImagesetManager::getSingleton().getImageset(
+                (CEGUI::utf8*)"RttImageset");
+        CEGUI::Window* si = CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)"TaharezLook/StaticImage", (CEGUI::utf8*)guiObjectName.c_str());
+        si->setSize(CEGUI::UVector2( CEGUI::UDim(0.5f, 0), CEGUI::UDim(0.4f, 0)));
+        si->setProperty("Image", CEGUI::PropertyHelper::imageToString(
+            &rttImageSet->getImage((CEGUI::utf8*)"RttImage")));
+
+        rttCounter++;
+
+        return si;
+    }
+
+    CEGUI::Window* createStaticImageObject(void)
+    {
+        static unsigned int siCounter = 0;
+        String guiObjectName = "NewStaticImage" + StringConverter::toString(siCounter);
+
+        CEGUI::Imageset* imageSet = 
+            CEGUI::ImagesetManager::getSingleton().getImageset(
+                (CEGUI::utf8*)"TaharezLook");
+
+        CEGUI::Window* si = CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)"TaharezLook/StaticImage", (CEGUI::utf8*)guiObjectName.c_str());
+        si->setSize(CEGUI::UVector2( CEGUI::UDim(0.2f, 0), CEGUI::UDim(0.2f, 0)));
+        si->setProperty("Image", CEGUI::PropertyHelper::imageToString(
+            &imageSet->getImage((CEGUI::utf8*)"ClientBrush")));
+
+        siCounter++;
+
+        return si;
+    }
+
+    bool handleQuit(const CEGUI::EventArgs& e)
+    {
+        static_cast<GuiFrameListener*>(mFrameListener)->requestShutdown();
+        return true;
+    }
+
+    bool handleNew(const CEGUI::EventArgs& e)
+    {
+        if(mEditorGuiSheet)
+            CEGUI::WindowManager::getSingleton().destroyWindow(mEditorGuiSheet);
+
+        mEditorGuiSheet = CEGUI::WindowManager::getSingleton().createWindow("DefaultGUISheet", "NewLayout");
+
+        CEGUI::Window* editorWindow = CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)"OgreGuiDemo2/MainWindow");
+        editorWindow->addChildWindow(mEditorGuiSheet);
+
+        return true;
+    }
+
+    bool handleLoad(const CEGUI::EventArgs& e)
+    {
+        if(mEditorGuiSheet)
+            CEGUI::WindowManager::getSingleton().destroyWindow(mEditorGuiSheet);
+
+        mEditorGuiSheet = 
+            CEGUI::WindowManager::getSingleton().loadWindowLayout(
+                (CEGUI::utf8*)"cegui8.layout"); 
+		setupLoadedLayoutHandlers();
+
+        CEGUI::Window* editorWindow = CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)"OgreGuiDemo2/MainWindow");
+        editorWindow->addChildWindow(mEditorGuiSheet);
+
+        return true;
+    }
+
+
+    bool handleObjectSelection(const CEGUI::EventArgs& e)
+    {
+        static unsigned int windowNumber = 0;
+        static unsigned int vertScrollNumber = 0;
+        static unsigned int horizScrollNumber = 0;
+        static unsigned int textScrollNumber = 0;
+        String guiObjectName;
+        CEGUI::Window* window = 0;
+
+        // Set a random position to place this object.
+        Real posX = Math::RangeRandom(0.0, 0.7); 
+        Real posY = Math::RangeRandom(0.1, 0.7); 
+
+        const CEGUI::WindowEventArgs& windowEventArgs = static_cast<const CEGUI::WindowEventArgs&>(e);
+        CEGUI::ListboxItem* item = static_cast<CEGUI::Combobox*>(windowEventArgs.window)->getSelectedItem();
+
+        CEGUI::Window* editorWindow = CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)"OgreGuiDemo2/MainWindow");
+
+        switch(item->getID())
+        {
+        case 0:
+            guiObjectName = "NewWindow" + StringConverter::toString(windowNumber);
+            window = CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)"TaharezLook/FrameWindow", (CEGUI::utf8*)guiObjectName.c_str());
+            window->setSize(CEGUI::UVector2(CEGUI::UDim(0.3f,0), CEGUI::UDim(0.3f,0)));
+            window->setText((CEGUI::utf8*)"New Window");
+            windowNumber++;
+            break;
+        case 1:
+            guiObjectName = "NewHorizScroll" + StringConverter::toString(horizScrollNumber);
+            window = CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)"TaharezLook/HorizontalScrollbar", (CEGUI::utf8*)guiObjectName.c_str());
+            window->setSize(CEGUI::UVector2(CEGUI::UDim(0.75f,0), CEGUI::UDim(0.03f,0)));
+            horizScrollNumber++;
+            break;
+        case 2:
+            guiObjectName = "NewVertScroll" + StringConverter::toString(vertScrollNumber);
+            window = CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)"TaharezLook/VerticalScrollbar", (CEGUI::utf8*)guiObjectName.c_str());
+            window->setSize(CEGUI::UVector2(CEGUI::UDim(0.03f,0), CEGUI::UDim(0.75f,0)));
+            vertScrollNumber++;
+            break;
+        case 3:
+            guiObjectName = "NewStaticText" + StringConverter::toString(textScrollNumber);
+            window = CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)"TaharezLook/StaticText", (CEGUI::utf8*)guiObjectName.c_str());
+            window->setSize(CEGUI::UVector2(CEGUI::UDim(0.25f,0), CEGUI::UDim(0.1f,0)));
+            window->setText((CEGUI::utf8*)"Example static text");
+            textScrollNumber++;
+            break;
+        case 4:
+            window = createStaticImageObject();
+            break;
+        case 5:
+            window = createRttGuiObject();
+            break;
+        };
+
+        editorWindow->addChildWindow(window);
+        window->setPosition(CEGUI::UVector2(CEGUI::UDim(posX, 0), CEGUI::UDim(posY, 0)));
+
+        return true;
+    }
+
+	bool handleColourChanged(const CEGUI::EventArgs& e)
+	{
+        mPreview->setProperty("ImageColours",
+            CEGUI::PropertyHelper::colourToString(CEGUI::colour(
+                mRed->getScrollPosition() / 255.0f,
+                mGreen->getScrollPosition() / 255.0f,
+                mBlue->getScrollPosition() / 255.0f)));
+
+		return true;
+
+	}
+
+	bool handleAdd(const CEGUI::EventArgs& e)
+	{
+		CEGUI::ListboxTextItem *listboxitem = 
+			new CEGUI::ListboxTextItem (mEditBox->getText());
+		listboxitem->setSelectionBrushImage("TaharezLook", "ListboxSelectionBrush");
+		listboxitem->setSelected(mList->getItemCount() == 0);
+		listboxitem->setSelectionColours(
+            CEGUI::PropertyHelper::stringToColourRect(mPreview->getProperty("ImageColours")));
+		mList->addItem(listboxitem);
+		return true;
+	}
+
+	bool handleMouseEnters(const CEGUI::EventArgs& e)
+	{
+		CEGUI::WindowEventArgs& we = ((CEGUI::WindowEventArgs&)e);
+		DescriptionMap::iterator i = 
+			mDescriptionMap.find(we.window->getName());
+		if (i != mDescriptionMap.end())
+		{
+			mTip->setText(i->second);
+		}
+		else
+		{
+			mTip->setText((CEGUI::utf8*)"");
+		}
+		
+		return true;
+	}
+	bool handleMouseLeaves(const CEGUI::EventArgs& e)
+	{
+		mTip->setText((CEGUI::utf8*)"");
+		return true;
+	}
+
+};
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char *argv[])
+#endif
+{
+
+    // Create application object
+    GuiApplication app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " <<
+            e.getFullDescription().c_str() << std::endl;
+#endif
+    }
+
+
+    return 0;
+}
+
Index: /Samples/Gui/src/Makefile.am
===================================================================
--- /Samples/Gui/src/Makefile.am	(revision 5)
+++ /Samples/Gui/src/Makefile.am	(revision 5)
@@ -0,0 +1,6 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/CEGUIRenderer/include -I$(top_srcdir)/Samples/Common/include @CEGUI_CFLAGS@ $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = Gui
+Gui_SOURCES = Gui.cpp
+Gui_LDFLAGS = -L$(top_builddir)/OgreMain/src -L$(top_builddir)/Samples/Common/CEGUIRenderer/src
+Gui_LDADD = -lOgreMain @CEGUI_LIBS@ -lCEGUIOgreRenderer $(OIS_LIBS)
Index: /Samples/Gui/src/Makefile.in
===================================================================
--- /Samples/Gui/src/Makefile.in	(revision 5)
+++ /Samples/Gui/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = Gui$(EXEEXT)
+subdir = Samples/Gui/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_Gui_OBJECTS = Gui.$(OBJEXT)
+Gui_OBJECTS = $(am_Gui_OBJECTS)
+am__DEPENDENCIES_1 =
+Gui_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Gui_SOURCES)
+DIST_SOURCES = $(Gui_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/CEGUIRenderer/include -I$(top_srcdir)/Samples/Common/include @CEGUI_CFLAGS@ $(OIS_CFLAGS)
+Gui_SOURCES = Gui.cpp
+Gui_LDFLAGS = -L$(top_builddir)/OgreMain/src -L$(top_builddir)/Samples/Common/CEGUIRenderer/src
+Gui_LDADD = -lOgreMain @CEGUI_LIBS@ -lCEGUIOgreRenderer $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Gui/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Gui/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+Gui$(EXEEXT): $(Gui_OBJECTS) $(Gui_DEPENDENCIES) 
+	@rm -f Gui$(EXEEXT)
+	$(CXXLINK) $(Gui_LDFLAGS) $(Gui_OBJECTS) $(Gui_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Gui.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Instancing/Makefile.am
===================================================================
--- /Samples/Instancing/Makefile.am	(revision 5)
+++ /Samples/Instancing/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/Instancing/Makefile.in
===================================================================
--- /Samples/Instancing/Makefile.in	(revision 5)
+++ /Samples/Instancing/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Instancing
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Instancing/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Instancing/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Instancing/include/Instancing.h
===================================================================
--- /Samples/Instancing/include/Instancing.h	(revision 5)
+++ /Samples/Instancing/include/Instancing.h	(revision 5)
@@ -0,0 +1,435 @@
+#include <OgreNoMemoryMacros.h>
+
+
+
+#include "CEGUI/CEGUI.h"
+#include "OgreCEGUIRenderer.h"
+#include "OgreConfigFile.h"
+#include "OgreStringConverter.h"
+#include "OgreException.h"
+#include "OgreFrameListener.h"
+#include "ExampleApplication.h"
+#include "OgreInstancedGeometry.h"
+
+using namespace Ogre;
+
+#define maxObjectsPerBatch 80
+#define FLT_MAX         3.402823466e+38F        /* max value */
+const size_t numTypeMeshes = 4;
+class InstancingApplication;
+String meshes[]=
+{ 
+	"razor", //0
+	"knot", 
+	"tudorhouse",
+	"WoodPallet"//6
+
+};
+
+enum CurrentGeomOpt{
+	INSTANCE_OPT,
+	STATIC_OPT,
+	ENTITY_OPT
+};
+
+CEGUI::MouseButton convertOISMouseButtonToCegui(int buttonID)
+{
+  switch (buttonID)
+    {
+	case 0: return CEGUI::LeftButton;
+	case 1: return CEGUI::RightButton;
+	case 2:	return CEGUI::MiddleButton;
+	case 3: return CEGUI::X1Button;
+	default: return CEGUI::LeftButton;
+    }
+}
+//out of the listener class...if set as a member, the sample crashes when moving the mouse!
+
+// Event handler to add ability to alter subdivision
+class InstancingListener : public ExampleFrameListener, public OIS::KeyListener, public OIS::MouseListener
+{
+protected:
+	InstancingApplication * mMain;
+	bool mRequestShutDown;
+	bool mLMBDown;
+	bool mRMBDown;
+	double mAvgFrameTime;
+	size_t meshSelected;
+	size_t numMesh;
+	size_t objectCount;
+	String mDebugText;
+	CurrentGeomOpt currentGeomOpt;
+	
+	size_t numRender;
+
+	Ogre::Timer*timer;
+	double mLastTime,mBurnAmount;
+
+	std::vector <InstancedGeometry *>		renderInstance;
+	std::vector <StaticGeometry *>	renderStatic;
+	std::vector <Entity *>			renderEntity;
+	std::vector <SceneNode *>			nodes; 
+	std::vector <Vector3 *>			posMatrices;
+
+	CEGUI::Renderer* mGUIRenderer;
+	CEGUI::Window* mGuiAvg;
+	CEGUI::Window* mGuiCurr;
+	CEGUI::Window* mGuiBest;
+	CEGUI::Window* mGuiWorst;
+	CEGUI::Window* mGuiTris;
+	CEGUI::Window* mGuiDbg;
+	CEGUI::Window* mRoot;
+	CEGUI::Point mLastMousePosition;
+public:
+
+	//-----------------------------------------------------------------------
+	InstancingListener(RenderWindow* win, Camera* cam,CEGUI::Renderer* renderer, InstancingApplication*main);
+	//-----------------------------------------------------------------------
+	~InstancingListener();
+	//-----------------------------------------------------------------------
+	bool frameStarted(const FrameEvent& evt);
+	//-----------------------------------------------------------------------
+	void burnCPU(void);
+	//-----------------------------------------------------------------------
+	void destroyCurrentGeomOpt();
+	//-----------------------------------------------------------------------
+	void createCurrentGeomOpt();
+	//-----------------------------------------------------------------------
+	void createInstanceGeom();
+	//-----------------------------------------------------------------------
+	void destroyInstanceGeom();
+	//-----------------------------------------------------------------------
+	void createStaticGeom();
+	//-----------------------------------------------------------------------
+	void setupInstancedMaterialToEntity(Entity*);
+	//-----------------------------------------------------------------------
+	String buildInstancedMaterial(const String &);
+	//-----------------------------------------------------------------------
+	void destroyStaticGeom();
+	//-----------------------------------------------------------------------
+	void createEntityGeom();
+	//-----------------------------------------------------------------------
+	void destroyEntityGeom();
+	//-----------------------------------------------------------------------
+	void setObjectCount(size_t val)
+	{
+		numMesh=val;
+	};
+	//-----------------------------------------------------------------------
+	void setBurnedTime(double timeBurned)
+	{
+		mBurnAmount=timeBurned;
+	};
+	//-----------------------------------------------------------------------
+	void changSelectedMesh(size_t number)
+	{	
+		meshSelected=number;
+	}
+	 //-----------------------------------------------------------------------
+	void mouseReleased (OIS::MouseEvent *e);
+	void mouseClicked(OIS::MouseEvent* e);
+	void mouseEntered(OIS::MouseEvent* e) ;
+	void mouseExited(OIS::MouseEvent* e);
+	void requestShutdown(void);
+	void setCurrentGeometryOpt(CurrentGeomOpt opt);
+	bool handleMouseMove(const CEGUI::EventArgs& e);
+	bool handleMouseButtonDown(const CEGUI::EventArgs& e);
+	bool handleMouseButtonUp(const CEGUI::EventArgs& e);
+	//----------------------------------------------------------------//
+	bool mouseMoved( const OIS::MouseEvent &arg );
+	//----------------------------------------------------------------//
+	bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
+	//----------------------------------------------------------------//
+	bool mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
+	//--------------------------------------------------------------------------
+	void updateStats(void);
+		//----------------------------------------------------------------//
+	bool keyPressed( const OIS::KeyEvent &arg )
+	{
+		if( arg.key == OIS::KC_ESCAPE )
+			mRequestShutDown = true;
+		return true;
+	}
+
+	//----------------------------------------------------------------//
+	bool keyReleased( const OIS::KeyEvent &arg )
+	{
+		return true;
+	}
+};
+
+//-----------------------------------------------------------------------
+//-----------------------------------------------------------------------
+class InstancingApplication : public ExampleApplication
+{
+
+public:
+	//-----------------------------------------------------------------------
+	InstancingApplication():mGUIRenderer(0),
+        mGUISystem(0),
+        mEditorGuiSheet(0)  { }
+	//-----------------------------------------------------------------------
+	~InstancingApplication()
+	{
+		 if(mEditorGuiSheet)
+       {
+           CEGUI::WindowManager::getSingleton().destroyWindow(mEditorGuiSheet);
+       }
+       if(mGUISystem)
+       {
+           delete mGUISystem;
+           mGUISystem = 0;
+       }
+       if(mGUIRenderer)
+       {
+           delete mGUIRenderer;
+           mGUIRenderer = 0;
+       }
+	
+	}
+	RenderWindow*getRenderWindow(void)
+	{
+		return mWindow;
+	}
+
+protected:
+   CEGUI::OgreCEGUIRenderer* mGUIRenderer;
+   CEGUI::System* mGUISystem;
+   CEGUI::Window* mEditorGuiSheet;
+
+	//-----------------------------------------------------------------------
+	// Just override the mandatory create scene method
+	void createScene(void)
+	{
+		
+		// Set ambient light
+		mSceneMgr->setAmbientLight(ColourValue(0.2, 0.2, 0.2));
+		Light* l = mSceneMgr->createLight("MainLight");
+		//add a skybox
+		mSceneMgr->setSkyBox(true, "Examples/MorningSkyBox", 1000);
+		//setup the light
+		l->setType(Light::LT_DIRECTIONAL);
+		l->setDirection(-0.5, -0.5, 0);
+
+		mCamera->setPosition(500,500, 1500);
+		mCamera->lookAt(0,0,0);
+		   Plane plane;
+        plane.normal = Vector3::UNIT_Y;
+        plane.d = 100;
+        MeshManager::getSingleton().createPlane("Myplane",
+            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+            1500,1500,20,20,true,1,5,5,Vector3::UNIT_Z);
+        Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+        pPlaneEnt->setMaterialName("Examples/Rockwall");
+        pPlaneEnt->setCastShadows(false);
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+		setupGUI();
+		setupEventHandlers();
+
+		//set up the compositor
+		Ogre::Viewport* pViewport = mWindow->getViewport(0);
+		pViewport->setCamera(mCamera);
+		CompositorManager::getSingleton().addCompositor(pViewport,"Bloom");
+
+		
+	}
+	//-----------------------------------------------------------------------
+	void destroyScene(void)
+	{
+	}
+	//-----------------------------------------------------------------------
+	void createFrameListener(void)
+	{
+		// This is where we instantiate our own frame listener
+		mFrameListener= new InstancingListener(mWindow, mCamera,mGUIRenderer,this);
+		mRoot->addFrameListener(mFrameListener);
+	}
+	//-----------------------------------------------------------------------
+	void setupResources(void)
+	{
+		ExampleApplication::setupResources();
+
+		/*ResourceGroupManager *rsm = ResourceGroupManager::getSingletonPtr ();
+		StringVector groups = rsm->getResourceGroups ();        
+		if (std::find(groups.begin(), groups.end(), String("Instancing")) == groups.end())
+		{
+			rsm->createResourceGroup("Instancing");
+			try
+			{
+				rsm->addResourceLocation("../../../../../ogreaddons/instancing/Media/materials/programs","FileSystem", "Instancing");
+				rsm->addResourceLocation("../../../../../ogreaddons/instancing/Media/materials/scripts","FileSystem", "Instancing");
+				rsm->addResourceLocation("../../../../../ogreaddons/instancing/Media/models","FileSystem", "Instancing");
+			}
+			catch (Ogre::Exception& e)
+			{
+				String error = e.getFullDescription();
+				rsm->addResourceLocation("../../../Instancing/Media/materials/programs","FileSystem", "Instancing");
+				rsm->addResourceLocation("../../../Instancing/Media/materials/scripts","FileSystem", "Instancing");
+				rsm->addResourceLocation("../../../Instancing/Media/models","FileSystem", "Instancing");
+			}
+		}*/
+	}
+	void setupGUI(void)
+	{
+		// Set up GUI system
+       mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, true, 3000, mSceneMgr);
+       mGUISystem = new CEGUI::System(mGUIRenderer);
+       CEGUI::Logger::getSingleton().setLoggingLevel(CEGUI::Informative);
+
+	   CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"TaharezLookSkin.scheme");
+       mGUISystem->setDefaultMouseCursor((CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow");
+       CEGUI::MouseCursor::getSingleton().setImage("TaharezLook", "MouseMoveCursor");
+       mEditorGuiSheet= CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)"DefaultWindow", (CEGUI::utf8*)"Sheet");  
+       mGUISystem->setGUISheet(mEditorGuiSheet);
+	 
+
+
+	    mEditorGuiSheet = CEGUI::WindowManager::getSingleton().loadWindowLayout((CEGUI::utf8*)"InstancingDemo.layout");
+		mGUISystem->setGUISheet(mEditorGuiSheet);
+	}
+	void setupEventHandlers(void)
+	{
+		using namespace CEGUI;
+		CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
+		wmgr.getWindow((CEGUI::utf8*)"ExitDemoBtn")->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&InstancingApplication::handleQuit, this));
+
+		wmgr.getWindow((CEGUI::utf8*)"tInstancing")->subscribeEvent(CEGUI::RadioButton::EventSelectStateChanged, CEGUI::Event::Subscriber(&InstancingApplication::handleTechniqueChanged, this));
+		wmgr.getWindow((CEGUI::utf8*)"tStaticGeometry")->subscribeEvent(CEGUI::RadioButton::EventSelectStateChanged, CEGUI::Event::Subscriber(&InstancingApplication::handleTechniqueChanged, this));
+		wmgr.getWindow((CEGUI::utf8*)"tIndependantEntities")->subscribeEvent(CEGUI::RadioButton::EventSelectStateChanged, CEGUI::Event::Subscriber(&InstancingApplication::handleTechniqueChanged, this));
+		wmgr.getWindow((CEGUI::utf8*)"Object Count")->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged,CEGUI::Event::Subscriber(&InstancingApplication::handleObjectCountChanged, this));
+		wmgr.getWindow((CEGUI::utf8*)"Time Burner")->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged,CEGUI::Event::Subscriber(&InstancingApplication::handleTimeBurnerChanged, this));
+		wmgr.getWindow((CEGUI::utf8*)"PostEffect")->subscribeEvent(CEGUI::Checkbox::EventCheckStateChanged,CEGUI::Event::Subscriber(&InstancingApplication::handlePostEffectChanged, this));
+		wmgr.getWindow((CEGUI::utf8*)"Shadows")->subscribeEvent(CEGUI::Checkbox::EventCheckStateChanged,CEGUI::Event::Subscriber(&InstancingApplication::handleShadowsChanged, this));
+		CEGUI::Combobox*ObjectList=((CEGUI::Combobox*)(wmgr.getWindow((CEGUI::utf8*)"Objects")));
+		for(size_t i=0;i<numTypeMeshes;++i)
+		{
+			CEGUI::ListboxTextItem*item=new CEGUI::ListboxTextItem(meshes[i],i);
+			ObjectList->addItem(item);
+				
+		}
+		ObjectList->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted,CEGUI::Event::Subscriber(&InstancingApplication::handleObjectChanged,this));
+		
+		
+
+		CEGUI::Window* wndw = CEGUI::WindowManager::getSingleton().getWindow("root");
+
+		wndw->subscribeEvent(Window::EventMouseMove, CEGUI::Event::Subscriber(&InstancingApplication::handleMouseMove,this));
+
+		wndw->subscribeEvent(Window::EventMouseButtonUp, CEGUI::Event::Subscriber(&InstancingApplication::handleMouseButtonUp,this));
+
+		wndw->subscribeEvent(Window::EventMouseButtonDown, CEGUI::Event::Subscriber(&InstancingApplication::handleMouseButtonDown,this));
+
+}
+	//-----------------------------------------------------------------------
+	bool handleQuit(const CEGUI::EventArgs& e)
+	{
+		static_cast<InstancingListener*>(mFrameListener)->requestShutdown();
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	bool handleMouseMove(const CEGUI::EventArgs& e)
+	{
+		static_cast<InstancingListener*>(mFrameListener)->handleMouseMove(e);
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	bool handleMouseButtonDown(const CEGUI::EventArgs& e)
+	{
+		static_cast<InstancingListener*>(mFrameListener)->handleMouseButtonDown(e);
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	bool handleMouseButtonUp(const CEGUI::EventArgs& e)
+	{
+		static_cast<InstancingListener*>(mFrameListener)->handleMouseButtonUp(e);
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	bool handleTechniqueChanged(const CEGUI::EventArgs& e)
+	{
+
+		static_cast<InstancingListener*>(mFrameListener)->destroyCurrentGeomOpt();
+				
+		CEGUI::uint id = ((CEGUI::RadioButton*)((const CEGUI::WindowEventArgs&)e).window)->getSelectedButtonInGroup()->getID();
+		if (id == 0)
+		{
+			static_cast<InstancingListener*>(mFrameListener)->setCurrentGeometryOpt(INSTANCE_OPT);
+		}
+		if (id == 1)
+		{
+			static_cast<InstancingListener*>(mFrameListener)->setCurrentGeometryOpt(STATIC_OPT);
+		}
+		if (id == 2)
+		{
+			static_cast<InstancingListener*>(mFrameListener)->setCurrentGeometryOpt(ENTITY_OPT);
+		}
+		static_cast<InstancingListener*>(mFrameListener)->createCurrentGeomOpt();
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	bool handleObjectCountChanged(const CEGUI::EventArgs& e)
+	{
+		static_cast<InstancingListener*>(mFrameListener)->destroyCurrentGeomOpt();
+		float scrollval = ((CEGUI::Scrollbar*)((const CEGUI::WindowEventArgs&)e).window)->getScrollPosition();
+		int objectCount = 1000*scrollval;
+		static_cast<InstancingListener*>(mFrameListener)->setObjectCount(objectCount );
+		static_cast<InstancingListener*>(mFrameListener)->createCurrentGeomOpt();
+		String value=StringConverter::toString(objectCount);
+		CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)"Object Count Number")->setText(CEGUI::String(value.c_str()));
+
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	bool handleTimeBurnerChanged(const CEGUI::EventArgs& e)
+	{
+		
+		float scrollval = ((CEGUI::Scrollbar*)((const CEGUI::WindowEventArgs&)e).window)->getScrollPosition();
+		double timeBurned = 0.0166f*scrollval;
+		char* timeChar= new char[10];
+		sprintf(timeChar,"%0.1f ms",timeBurned*1000.0f);
+		CEGUI::String timeText(timeChar);
+		CEGUI::WindowManager::getSingleton().getWindow("Time Burner Value")->setText(timeText);
+
+		static_cast<InstancingListener*>(mFrameListener)->setBurnedTime(timeBurned);
+		delete[] timeChar;
+		return true;
+	}
+		//-----------------------------------------------------------------------
+	bool handlePostEffectChanged(const CEGUI::EventArgs& e)
+	{
+		Ogre::Viewport* pViewport = mWindow->getViewport(0);
+		if(((CEGUI::Checkbox*)((const CEGUI::WindowEventArgs&)e).window)->isSelected())
+		{
+				CompositorManager::getSingleton().setCompositorEnabled(pViewport,"Bloom",true);
+		}
+		else
+		{
+				CompositorManager::getSingleton().setCompositorEnabled(pViewport,"Bloom",false);
+		}
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	bool handleShadowsChanged(const CEGUI::EventArgs&e)
+	{
+		if(((CEGUI::Checkbox*)((const CEGUI::WindowEventArgs&)e).window)->isSelected())
+		{
+			mSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_MODULATIVE);
+		}
+		else
+		{
+			mSceneMgr->setShadowTechnique(SHADOWTYPE_NONE);
+		}
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	bool handleObjectChanged(const CEGUI::EventArgs&e)
+	{
+		CEGUI::Combobox*combo=((CEGUI::Combobox*)((const CEGUI::WindowEventArgs&)e).window);
+		static_cast<InstancingListener*>(mFrameListener)->destroyCurrentGeomOpt();
+		static_cast<InstancingListener*>(mFrameListener)->changSelectedMesh(combo->getSelectedItem()->getID());
+		static_cast<InstancingListener*>(mFrameListener)->createCurrentGeomOpt();
+		return true;
+	}
+
+	
+};
Index: /Samples/Instancing/include/Makefile.am
===================================================================
--- /Samples/Instancing/include/Makefile.am	(revision 5)
+++ /Samples/Instancing/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = Instancing.h crowd.h
Index: /Samples/Instancing/include/Makefile.in
===================================================================
--- /Samples/Instancing/include/Makefile.in	(revision 5)
+++ /Samples/Instancing/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Instancing/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = Instancing.h crowd.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Instancing/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Instancing/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Instancing/include/crowd.h
===================================================================
--- /Samples/Instancing/include/crowd.h	(revision 5)
+++ /Samples/Instancing/include/crowd.h	(revision 5)
@@ -0,0 +1,417 @@
+#include <OgreNoMemoryMacros.h>
+
+
+
+#include "CEGUI/CEGUI.h"
+#include "OgreCEGUIRenderer.h"
+#include "OgreConfigFile.h"
+#include "OgreStringConverter.h"
+#include "OgreException.h"
+#include "OgreFrameListener.h"
+#include "ExampleApplication.h"
+#include "OgreInstancedGeometry.h"
+
+using namespace Ogre;
+
+#define maxObjectsPerBatch 4
+const size_t numTypeMeshes = 6;
+#define FLT_MAX         3.402823466e+38F        /* max value */
+class CrowdApplication;
+
+enum CurrentGeomOpt{
+	INSTANCE_OPT,
+	ENTITY_OPT
+};
+
+CEGUI::MouseButton convertOISMouseButtonToCegui(int buttonID)
+{
+  switch (buttonID)
+    {
+	case 0: return CEGUI::LeftButton;
+	case 1: return CEGUI::RightButton;
+	case 2:	return CEGUI::MiddleButton;
+	case 3: return CEGUI::X1Button;
+	default: return CEGUI::LeftButton;
+    }
+}
+//out of the listener class...if set as a member, the sample crashes when moving the mouse!
+
+// Event handler to add ability to alter subdivision
+class CrowdListener : public ExampleFrameListener, public OIS::KeyListener, public OIS::MouseListener
+{
+protected:
+	CrowdApplication * mMain;
+	bool mRequestShutDown;
+	bool mLMBDown;
+	bool mRMBDown;
+	double mAvgFrameTime;
+	size_t meshSelected;
+	size_t numMesh;
+	size_t objectCount;
+	String mDebugText;
+
+	CurrentGeomOpt currentGeomOpt;
+
+	size_t numRender;
+
+	Ogre::Timer*timer;
+	double mLastTime,mBurnAmount;
+
+	std::vector <InstancedGeometry *>		renderInstance;
+	std::vector <StaticGeometry *>	renderStatic;
+	std::vector <Entity *>			renderEntity;
+	std::vector <AnimationState*> animations;
+
+	std::vector <SceneNode *>			nodes; 
+	std::vector <Vector3 *>			posMatrices;
+
+	CEGUI::Renderer* mGUIRenderer;
+	CEGUI::Window* mGuiAvg;
+	CEGUI::Window* mGuiCurr;
+	CEGUI::Window* mGuiBest;
+	CEGUI::Window* mGuiWorst;
+	CEGUI::Window* mGuiTris;
+	CEGUI::Window* mGuiDbg;
+	CEGUI::Window* mRoot;
+	CEGUI::Point mLastMousePosition;
+public:
+
+	//-----------------------------------------------------------------------
+	CrowdListener(RenderWindow* win, Camera* cam,CEGUI::Renderer* renderer, CrowdApplication*main);
+	//-----------------------------------------------------------------------
+	~CrowdListener();
+	//-----------------------------------------------------------------------
+	bool frameStarted(const FrameEvent& evt);
+	//-----------------------------------------------------------------------
+	void burnCPU(void);
+	//-----------------------------------------------------------------------
+	void destroyCurrentGeomOpt();
+	//-----------------------------------------------------------------------
+	void createCurrentGeomOpt();
+	//-----------------------------------------------------------------------
+	void createInstanceGeom();
+	//-----------------------------------------------------------------------
+	void destroyInstanceGeom();
+	//-----------------------------------------------------------------------
+	void setupInstancedMaterialToEntity(Entity*);
+	//-----------------------------------------------------------------------
+	String buildCrowdMaterial(const String &,int);
+	//-----------------------------------------------------------------------
+	void createStaticGeom();
+	//-----------------------------------------------------------------------
+	void destroyStaticGeom();
+	//-----------------------------------------------------------------------
+	void createEntityGeom();
+	//-----------------------------------------------------------------------
+	void destroyEntityGeom();
+	//-----------------------------------------------------------------------
+	void setObjectCount(size_t val)
+	{
+		numMesh=val;
+	};
+	//-----------------------------------------------------------------------
+	void setBurnedTime(double timeBurned)
+	{
+		mBurnAmount=timeBurned;
+	};
+	//-----------------------------------------------------------------------
+	void changSelectedMesh(size_t number)
+	{	
+		meshSelected=number;
+	}
+	bool mouseMoved( const OIS::MouseEvent &arg );
+	//----------------------------------------------------------------//
+	bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
+	//----------------------------------------------------------------//
+	bool mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
+	 //-----------------------------------------------------------------------
+	void mouseReleased (OIS::MouseEvent *e);
+	void mouseClicked(OIS::MouseEvent* e);
+	void mouseEntered(OIS::MouseEvent* e) ;
+	void mouseExited(OIS::MouseEvent* e);
+	void requestShutdown(void);
+	void setCurrentGeometryOpt(CurrentGeomOpt opt);
+	bool handleMouseMove(const CEGUI::EventArgs& e);
+	//--------------------------------------------------------------------------
+	bool handleMouseButtonUp(const CEGUI::EventArgs& e);
+	//--------------------------------------------------------------------------
+	bool handleMouseButtonDown(const CEGUI::EventArgs& e);
+	//--------------------------------------------------------------------------
+	void updateStats(void);
+	//----------------------------------------------------------------//
+	bool keyPressed( const OIS::KeyEvent &arg )
+	{
+		if( arg.key == OIS::KC_ESCAPE )
+			mRequestShutDown = true;
+		return true;
+	}
+
+	//----------------------------------------------------------------//
+	bool keyReleased( const OIS::KeyEvent &arg )
+	{
+		return true;
+	}
+
+};
+
+//-----------------------------------------------------------------------
+//-----------------------------------------------------------------------
+class CrowdApplication : public ExampleApplication
+{
+
+public:
+	//-----------------------------------------------------------------------
+	CrowdApplication():mGUIRenderer(0),
+        mGUISystem(0),
+        mEditorGuiSheet(0)  { }
+	//-----------------------------------------------------------------------
+	~CrowdApplication()
+	{
+		 if(mEditorGuiSheet)
+       {
+           CEGUI::WindowManager::getSingleton().destroyWindow(mEditorGuiSheet);
+       }
+       if(mGUISystem)
+       {
+           delete mGUISystem;
+           mGUISystem = 0;
+       }
+       if(mGUIRenderer)
+       {
+           delete mGUIRenderer;
+           mGUIRenderer = 0;
+       }
+	
+	}
+	RenderWindow*getRenderWindow(void)
+	{
+		return mWindow;
+	}
+
+protected:
+   CEGUI::OgreCEGUIRenderer* mGUIRenderer;
+   CEGUI::System* mGUISystem;
+   CEGUI::Window* mEditorGuiSheet;
+	//-----------------------------------------------------------------------
+	// Just override the mandatory scene manager choice method
+      virtual void chooseSceneManager(void)
+    {
+        // Get the SceneManager, in this case a generic one
+        mSceneMgr = mRoot->createSceneManager("TerrainSceneManager");
+    }
+	//-----------------------------------------------------------------------
+	// Just override the mandatory create scene method
+
+	void createScene(void)
+	{
+		std::string terrain_cfg("terrain.cfg");
+        mSceneMgr -> setWorldGeometry( terrain_cfg );
+		// Set ambient light
+		mSceneMgr->setAmbientLight(ColourValue(0.2, 0.2, 0.2));
+
+		Light* l = mSceneMgr->createLight("MainLight");
+
+		//add a skybox
+		mSceneMgr->setSkyBox(true, "Examples/MorningSkyBox", 1000);
+
+		//setup the light
+		l->setType(Light::LT_DIRECTIONAL);
+		Vector3 dir(-0.3, -1, 0.2);
+		dir.normalise();
+		l->setDirection(dir);
+		l->setDiffuseColour(1.0, 1.0, 0.8);
+
+		mCamera->setPosition(700,100, 500);
+		mCamera->lookAt(600,80,600);
+
+		mSceneMgr->setShadowTextureSize(1024);
+		setupGUI();
+		setupEventHandlers();
+		//set up the compositor
+		Ogre::Viewport* pViewport = mWindow->getViewport(0);
+		pViewport->setCamera(mCamera);
+		CompositorManager::getSingleton().addCompositor(pViewport,"Bloom");
+	}
+	//-----------------------------------------------------------------------
+	void destroyScene(void)
+	{
+	}
+	//-----------------------------------------------------------------------
+	void createFrameListener(void)
+	{
+		// This is where we instantiate our own frame listener
+		mFrameListener= new CrowdListener(mWindow, mCamera,mGUIRenderer,this);
+		mRoot->addFrameListener(mFrameListener);
+	}
+	//-----------------------------------------------------------------------
+	void setupResources(void)
+	{
+		ExampleApplication::setupResources();
+
+		/*ResourceGroupManager *rsm = ResourceGroupManager::getSingletonPtr ();
+		StringVector groups = rsm->getResourceGroups ();        
+		if (std::find(groups.begin(), groups.end(), String("Crowd")) == groups.end())
+		{
+			rsm->createResourceGroup("Crowd");
+			try
+			{
+				rsm->addResourceLocation("../../../../../ogreaddons/Crowd/Media/materials/programs","FileSystem", "Crowd");
+				rsm->addResourceLocation("../../../../../ogreaddons/Crowd/Media/materials/scripts","FileSystem", "Crowd");
+				rsm->addResourceLocation("../../../../../ogreaddons/Crowd/Media/models","FileSystem", "Crowd");
+			}
+			catch (Ogre::Exception& e)
+			{
+				String error = e.getFullDescription();
+				rsm->addResourceLocation("../../../Crowd/Media/materials/programs","FileSystem", "Crowd");
+				rsm->addResourceLocation("../../../Crowd/Media/materials/scripts","FileSystem", "Crowd");
+				rsm->addResourceLocation("../../../Crowd/Media/models","FileSystem", "Crowd");
+			}
+		}*/
+	}
+	void setupGUI(void)
+	{
+		// Set up GUI system
+       mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, true, 3000, mSceneMgr);
+       mGUISystem = new CEGUI::System(mGUIRenderer);
+       CEGUI::Logger::getSingleton().setLoggingLevel(CEGUI::Informative);
+
+	   CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"TaharezLookSkin.scheme");
+       mGUISystem->setDefaultMouseCursor((CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow");
+       CEGUI::MouseCursor::getSingleton().setImage("TaharezLook", "MouseMoveCursor");
+       mEditorGuiSheet= CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)"DefaultWindow", (CEGUI::utf8*)"Sheet");  
+       mGUISystem->setGUISheet(mEditorGuiSheet);
+	 
+
+
+	    mEditorGuiSheet = CEGUI::WindowManager::getSingleton().loadWindowLayout((CEGUI::utf8*)"CrowdDemo.layout");
+		mGUISystem->setGUISheet(mEditorGuiSheet);
+	}
+	void setupEventHandlers(void)
+	{
+		using namespace CEGUI;
+		CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
+		wmgr.getWindow((CEGUI::utf8*)"ExitDemoBtn")->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&CrowdApplication::handleQuit, this));
+
+		wmgr.getWindow((CEGUI::utf8*)"tInstancing")->subscribeEvent(CEGUI::RadioButton::EventSelectStateChanged, CEGUI::Event::Subscriber(&CrowdApplication::handleTechniqueChanged, this));
+		wmgr.getWindow((CEGUI::utf8*)"tIndependantEntities")->subscribeEvent(CEGUI::RadioButton::EventSelectStateChanged, CEGUI::Event::Subscriber(&CrowdApplication::handleTechniqueChanged, this));
+		wmgr.getWindow((CEGUI::utf8*)"Object Count")->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged,CEGUI::Event::Subscriber(&CrowdApplication::handleObjectCountChanged, this));
+		wmgr.getWindow((CEGUI::utf8*)"Shadows")->subscribeEvent(CEGUI::Checkbox::EventCheckStateChanged,CEGUI::Event::Subscriber(&CrowdApplication::handleShadowsChanged, this));
+		
+		wmgr.getWindow((CEGUI::utf8*)"Time Burner")->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged,CEGUI::Event::Subscriber(&CrowdApplication::handleTimeBurnerChanged, this));
+		wmgr.getWindow((CEGUI::utf8*)"PostEffect")->subscribeEvent(CEGUI::Checkbox::EventCheckStateChanged,CEGUI::Event::Subscriber(&CrowdApplication::handlePostEffectChanged, this));
+
+
+		CEGUI::Window* wndw = CEGUI::WindowManager::getSingleton().getWindow("root");
+
+		wndw->subscribeEvent(Window::EventMouseMove, CEGUI::Event::Subscriber(&CrowdApplication::handleMouseMove,this));
+
+		wndw->subscribeEvent(Window::EventMouseButtonUp, CEGUI::Event::Subscriber(&CrowdApplication::handleMouseButtonUp,this));
+
+		wndw->subscribeEvent(Window::EventMouseButtonDown, CEGUI::Event::Subscriber(&CrowdApplication::handleMouseButtonDown,this));
+
+}
+	//-----------------------------------------------------------------------
+	bool handleQuit(const CEGUI::EventArgs& e)
+	{
+		static_cast<CrowdListener*>(mFrameListener)->requestShutdown();
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	bool handleMouseMove(const CEGUI::EventArgs& e)
+	{
+		static_cast<CrowdListener*>(mFrameListener)->handleMouseMove(e);
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	bool handleMouseButtonDown(const CEGUI::EventArgs& e)
+	{
+		static_cast<CrowdListener*>(mFrameListener)->handleMouseButtonDown(e);
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	bool handleMouseButtonUp(const CEGUI::EventArgs& e)
+	{
+		static_cast<CrowdListener*>(mFrameListener)->handleMouseButtonUp(e);
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	bool handleTechniqueChanged(const CEGUI::EventArgs& e)
+	{
+
+		static_cast<CrowdListener*>(mFrameListener)->destroyCurrentGeomOpt();
+				
+		CEGUI::uint id = ((CEGUI::RadioButton*)((const CEGUI::WindowEventArgs&)e).window)->getSelectedButtonInGroup()->getID();
+		if (id == 0)
+		{
+			static_cast<CrowdListener*>(mFrameListener)->setCurrentGeometryOpt(INSTANCE_OPT);
+		}
+		if (id == 1)
+		{
+			static_cast<CrowdListener*>(mFrameListener)->setCurrentGeometryOpt(ENTITY_OPT);
+		}
+		static_cast<CrowdListener*>(mFrameListener)->createCurrentGeomOpt();
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	bool handleObjectCountChanged(const CEGUI::EventArgs& e)
+	{
+		static_cast<CrowdListener*>(mFrameListener)->destroyCurrentGeomOpt();
+		float scrollval = ((CEGUI::Scrollbar*)((const CEGUI::WindowEventArgs&)e).window)->getScrollPosition();
+		int objectCount = 1000*scrollval;
+		static_cast<CrowdListener*>(mFrameListener)->setObjectCount(objectCount );
+		static_cast<CrowdListener*>(mFrameListener)->createCurrentGeomOpt();
+		String value=StringConverter::toString(objectCount);
+		CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)"Object Count Number")->setText(CEGUI::String(value.c_str()));
+
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	bool handleTimeBurnerChanged(const CEGUI::EventArgs& e)
+	{
+		
+		float scrollval = ((CEGUI::Scrollbar*)((const CEGUI::WindowEventArgs&)e).window)->getScrollPosition();
+		double timeBurned = 0.0166f*scrollval;
+		char* timeChar= new char[10];
+		sprintf(timeChar,"%0.1f ms",timeBurned*1000.0f);
+		CEGUI::String timeText(timeChar);
+		CEGUI::WindowManager::getSingleton().getWindow("Time Burner Value")->setText(timeText);
+
+		static_cast<CrowdListener*>(mFrameListener)->setBurnedTime(timeBurned);
+		delete[] timeChar;
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	bool handlePostEffectChanged(const CEGUI::EventArgs& e)
+	{
+		Ogre::Viewport* pViewport = mWindow->getViewport(0);
+		if(((CEGUI::Checkbox*)((const CEGUI::WindowEventArgs&)e).window)->isSelected())
+		{
+				CompositorManager::getSingleton().setCompositorEnabled(pViewport,"Bloom",true);
+		}
+		else
+		{
+				CompositorManager::getSingleton().setCompositorEnabled(pViewport,"Bloom",false);
+		}
+		return true;
+	}
+	//-----------------------------------------------------------------------
+	bool handleShadowsChanged(const CEGUI::EventArgs&e)
+	{
+		if(((CEGUI::Checkbox*)((const CEGUI::WindowEventArgs&)e).window)->isSelected())
+		{
+			mSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_MODULATIVE);
+			LiSPSMShadowCameraSetup* lispsm = new LiSPSMShadowCameraSetup();
+			lispsm->setOptimalAdjustFactor(0.3);
+			mSceneMgr->setShadowCameraSetup(ShadowCameraSetupPtr(lispsm));
+			mSceneMgr->setShadowColour(ColourValue(0.5, 0.5, 0.5));
+		}
+		else
+		{
+			mSceneMgr->setShadowTechnique(SHADOWTYPE_NONE);
+		}
+		return true;
+	}
+
+
+	
+};
Index: /Samples/Instancing/scripts/Demo_Crowd.cbp
===================================================================
--- /Samples/Instancing/scripts/Demo_Crowd.cbp	(revision 5)
+++ /Samples/Instancing/scripts/Demo_Crowd.cbp	(revision 5)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Crowd" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Crowd.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="ois_d" />
+					<Add library="CEGUIBase_d" />
+					<Add library="OgreGUIRenderer_d" />
+					<Add library="OgreMain_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Crowd.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="ois" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreGUIRenderer" />
+					<Add library="OgreMain" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI\elements" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI\falagard" />
+			<Add directory="..\..\Common\CEGUIRenderer\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\crowd.h" />
+		<Unit filename="..\src\crowd.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Instancing/scripts/Demo_Crowd.vcproj
===================================================================
--- /Samples/Instancing/scripts/Demo_Crowd.vcproj	(revision 5)
+++ /Samples/Instancing/scripts/Demo_Crowd.vcproj	(revision 5)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_Crowd"
+	ProjectGUID="{AA219712-966C-40DA-9B9A-FB4812DDC17A}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib"
+				OutputFile="$(OutDir)/Demo_Crowd.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_Crowd.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib CEGUIBase.lib OgreGUIRenderer.lib"
+				OutputFile="$(OutDir)/Demo_Crowd.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\crowd.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\crowd.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Instancing/scripts/Demo_Crowd_linux.cbp
===================================================================
--- /Samples/Instancing/scripts/Demo_Crowd_linux.cbp	(revision 5)
+++ /Samples/Instancing/scripts/Demo_Crowd_linux.cbp	(revision 5)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Crowd" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_Crowd" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OIS" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreGUIRenderer_d" />
+					<Add library="OgreMain_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_Crowd" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OIS" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreGUIRenderer" />
+					<Add library="OgreMain" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+			<Add directory="../../Common/CEGUIRenderer/include" />
+			<Add directory="$(#CEGUI)" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/crowd.h" />
+		<Unit filename="../src/crowd.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Instancing/scripts/Demo_Crowd_vc8.vcproj
===================================================================
--- /Samples/Instancing/scripts/Demo_Crowd_vc8.vcproj	(revision 5)
+++ /Samples/Instancing/scripts/Demo_Crowd_vc8.vcproj	(revision 5)
@@ -0,0 +1,223 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_Crowd"
+	ProjectGUID="{5C668293-B752-499A-98C1-5042CACA1897}"
+	RootNamespace="Demo_Crowd"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib"
+				OutputFile="$(OutDir)/Demo_Crowd.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_Instancing.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib CEGUIBase.lib OgreGUIRenderer.lib"
+				OutputFile="$(OutDir)/Demo_Crowd.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\crowd.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\crowd.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Instancing/scripts/Demo_Crowd_vc8.vcproj.user
===================================================================
--- /Samples/Instancing/scripts/Demo_Crowd_vc8.vcproj.user	(revision 5)
+++ /Samples/Instancing/scripts/Demo_Crowd_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine="SINBAD"
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine="SINBAD"
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/Instancing/scripts/Demo_Instancing.cbp
===================================================================
--- /Samples/Instancing/scripts/Demo_Instancing.cbp	(revision 5)
+++ /Samples/Instancing/scripts/Demo_Instancing.cbp	(revision 5)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Instancing" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Instancing.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="ois_d" />
+					<Add library="CEGUIBase_d" />
+					<Add library="OgreGUIRenderer_d" />
+					<Add library="OgreMain_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Instancing.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="ois" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreGUIRenderer" />
+					<Add library="OgreMain" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI\elements" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI\falagard" />
+			<Add directory="..\..\Common\CEGUIRenderer\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\Instancing.h" />
+		<Unit filename="..\src\Instancing.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Instancing/scripts/Demo_Instancing.vcproj
===================================================================
--- /Samples/Instancing/scripts/Demo_Instancing.vcproj	(revision 5)
+++ /Samples/Instancing/scripts/Demo_Instancing.vcproj	(revision 5)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_Instancing"
+	ProjectGUID="{E5D4F8AE-310D-4A1E-A77E-FBF9BCA04E05}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib"
+				OutputFile="$(OutDir)/Demo_Instancing.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_Instancing.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib CEGUIBase.lib OgreGUIRenderer.lib"
+				OutputFile="$(OutDir)/Demo_Instancing.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\Instancing.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\Instancing.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Instancing/scripts/Demo_Instancing_vc8.vcproj
===================================================================
--- /Samples/Instancing/scripts/Demo_Instancing_vc8.vcproj	(revision 5)
+++ /Samples/Instancing/scripts/Demo_Instancing_vc8.vcproj	(revision 5)
@@ -0,0 +1,224 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_Instancing"
+	ProjectGUID="{35134523-6D5B-4AFA-BFB4-4D57C42C2169}"
+	RootNamespace="Demo_Instancing"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/Zm150"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib"
+				OutputFile="$(OutDir)/Demo_Instancing.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_Instancing.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib CEGUIBase.lib OgreGUIRenderer.lib"
+				OutputFile="$(OutDir)/Demo_Instancing.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\Instancing.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\Instancing.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Instancing/scripts/Demo_Instancing_vc8.vcproj.user
===================================================================
--- /Samples/Instancing/scripts/Demo_Instancing_vc8.vcproj.user	(revision 5)
+++ /Samples/Instancing/scripts/Demo_Instancing_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine="SINBAD"
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine="SINBAD"
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/Instancing/src/Instancing.cpp
===================================================================
--- /Samples/Instancing/src/Instancing.cpp	(revision 5)
+++ /Samples/Instancing/src/Instancing.cpp	(revision 5)
@@ -0,0 +1,526 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2005 The OGRE Team
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+\file 
+Instancing.cpp
+\brief
+Shows OGRE's bezier instancing feature
+*/
+
+#include "Instancing.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+
+	INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+	int main(int argc, char **argv)
+#endif
+	{
+		// Create application object
+		InstancingApplication app;
+
+		try {
+			app.go();
+		} catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+			MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL );
+#else
+			std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+		}
+
+
+		return 0;
+	}
+#ifdef __cplusplus
+}
+#endif
+
+InstancingListener::InstancingListener(RenderWindow* win, Camera* cam,CEGUI::Renderer* renderer, InstancingApplication*main)
+: ExampleFrameListener(win, cam,false,true),
+mRequestShutDown(false),
+mLMBDown(false),
+mRMBDown(false),
+mAvgFrameTime(0.1),
+mMain(main),
+mBurnAmount(0)
+{ 
+	const GpuProgramManager::SyntaxCodes &syntaxCodes = GpuProgramManager::getSingleton().getSupportedSyntax();
+	for (GpuProgramManager::SyntaxCodes::const_iterator iter = syntaxCodes.begin();iter != syntaxCodes.end();++iter)
+	{
+		LogManager::getSingleton().logMessage("supported syntax : "+(*iter));
+	}
+	mGUIRenderer=renderer;
+	numMesh = 160;
+	numRender = 0;
+	meshSelected = 0;
+	currentGeomOpt = INSTANCE_OPT;
+	createCurrentGeomOpt();
+
+	mMouse->setEventCallback(this);
+	mKeyboard->setEventCallback(this);
+
+	mGuiAvg   = CEGUI::WindowManager::getSingleton().getWindow("OPAverageFPS");
+	mGuiCurr  = CEGUI::WindowManager::getSingleton().getWindow("OPCurrentFPS");
+	mGuiBest  = CEGUI::WindowManager::getSingleton().getWindow("OPBestFPS");
+	mGuiWorst = CEGUI::WindowManager::getSingleton().getWindow("OPWorstFPS");
+	mGuiTris  = CEGUI::WindowManager::getSingleton().getWindow("OPTriCount");
+	mGuiDbg   = CEGUI::WindowManager::getSingleton().getWindow("OPDebugMsg");
+	mRoot	  = CEGUI::WindowManager::getSingleton().getWindow("root");
+
+	mDebugOverlay->hide();
+
+	timer = new Ogre::Timer();
+	mLastTime = timer->getMicroseconds()/1000000.0f;
+
+}
+//-----------------------------------------------------------------------
+InstancingListener::~InstancingListener()
+{
+	destroyCurrentGeomOpt();
+	delete timer;
+}
+//-----------------------------------------------------------------------
+bool InstancingListener::frameStarted(const FrameEvent& evt)
+{
+	burnCPU();
+	updateStats();
+
+	if(mRequestShutDown)
+		return false;
+	const bool returnValue = ExampleFrameListener::frameStarted(evt);
+	// Call default
+	return returnValue;
+}
+//-----------------------------------------------------------------------
+void InstancingListener::burnCPU(void)
+{
+	double mStartTime = timer->getMicroseconds()/1000000.0f; //convert into seconds
+	double mCurTime =  mStartTime;
+	double mStopTime = mLastTime + mBurnAmount;
+	double mCPUUsage;
+
+	while( mCurTime < mStopTime )
+	{
+		mCurTime = timer->getMicroseconds()/1000000.0f; //convert into seconds
+	}
+
+	if( mCurTime - mLastTime > 0.00001f )
+		mCPUUsage = (mCurTime - mStartTime) / (mCurTime - mLastTime) * 100.0f;
+	else
+		mCPUUsage = FLT_MAX;
+
+	mLastTime = timer->getMicroseconds()/1000000.0f; //convert into seconds
+	int time = mCPUUsage+0.5f;
+	if(mTimeUntilNextToggle<=0)
+	{
+		mDebugText="remaining for logic:"+ StringConverter::toString(time);
+		mTimeUntilNextToggle=1;
+	}
+
+}
+//-----------------------------------------------------------------------
+void InstancingListener::destroyCurrentGeomOpt()
+{
+	switch(currentGeomOpt)
+	{
+	case INSTANCE_OPT:destroyInstanceGeom();break;
+	case STATIC_OPT:destroyStaticGeom ();break;
+	case ENTITY_OPT: destroyEntityGeom ();break;
+	}
+
+	assert (numRender == posMatrices.size ());
+	for (size_t i = 0; i < numRender; i++)
+	{
+		delete [] posMatrices[i];
+	}
+	posMatrices.clear();
+}
+//-----------------------------------------------------------------------
+void InstancingListener::createCurrentGeomOpt()
+{
+	LogManager::getSingleton().logMessage("geom deleted");
+	objectCount=numMesh;
+	numRender=1;
+	while(objectCount>maxObjectsPerBatch)
+	{
+		numRender++;
+		objectCount-=maxObjectsPerBatch;
+	}
+
+	assert (meshSelected < numTypeMeshes);
+	MeshPtr m = MeshManager::getSingleton ().getByName (meshes[meshSelected] + ".mesh");
+	if (m.isNull ())
+	{
+		m = MeshManager::getSingleton ().load (meshes[meshSelected] + ".mesh", 
+			ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
+	}
+	const Real radius = m->getBoundingSphereRadius ();
+
+	// could/should print on screen mesh name, 
+	//optimisation type, 
+	//mesh vertices num, 
+	//32 bit or not, 
+	//etC..
+
+
+
+	posMatrices.resize (numRender);
+	posMatrices.reserve (numRender);
+
+
+	std::vector <Vector3 *> posMatCurr;
+	posMatCurr.resize (numRender);
+	posMatCurr.reserve (numRender);
+	for (size_t i = 0; i < numRender; i++)
+	{
+		posMatrices[i] = new Vector3[numMesh];
+		posMatCurr[i] = posMatrices[i];
+	}
+
+	size_t i = 0, j = 0;
+	for (size_t p = 0; p < numMesh; p++)
+	{
+		for (size_t k = 0; k < numRender; k++)
+		{
+			posMatCurr[k]->x = radius*i;
+			posMatCurr[k]->y = k*radius;
+
+			posMatCurr[k]->z = radius*j;
+			posMatCurr[k]++;
+		}
+		if (++j== 10) 
+		{
+			j = 0;
+			i++;
+		}
+
+	}
+	posMatCurr.clear ();
+
+
+	switch(currentGeomOpt)
+	{
+	case INSTANCE_OPT:createInstanceGeom();break;
+	case STATIC_OPT:createStaticGeom ();break;
+	case ENTITY_OPT: createEntityGeom ();break;
+	}
+}
+//-----------------------------------------------------------------------
+void InstancingListener::createInstanceGeom()
+{
+	if (Root::getSingleton ().getRenderSystem ()->getCapabilities ()->hasCapability (RSC_VERTEX_PROGRAM) == false)
+	{
+		OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Your video card doesn't support batching", "Demo_Instance::createScene");
+	}
+
+	Entity *ent = mCamera->getSceneManager()->createEntity(meshes[meshSelected], meshes[meshSelected] + ".mesh");	
+
+
+	renderInstance.reserve(numRender);
+	renderInstance.resize(numRender);
+
+	//Load a mesh to read data from.	
+	InstancedGeometry* batch = new InstancedGeometry(mCamera->getSceneManager(), 
+		meshes[meshSelected] + "s" );
+	batch->setCastShadows(true);
+
+	batch->setBatchInstanceDimensions (Vector3(1000000, 1000000, 1000000));
+	const size_t batchSize = (numMesh > maxObjectsPerBatch) ? maxObjectsPerBatch :numMesh;
+	setupInstancedMaterialToEntity(ent);
+	for(size_t i = 0; i < batchSize ; i++)
+	{
+		batch->addEntity(ent, Vector3::ZERO);
+	}
+	batch->setOrigin(Vector3::ZERO);
+
+	batch->build();
+
+
+	for (size_t k = 0; k < numRender-1; k++)
+	{
+		batch->addBatchInstance();
+	}
+	size_t i = 0;
+	InstancedGeometry::BatchInstanceIterator regIt = batch->getBatchInstanceIterator();
+	size_t baseIndexForBatch = 0;
+	size_t k = 0;
+	while (regIt.hasMoreElements ())
+	{
+
+		InstancedGeometry::BatchInstance *r = regIt.getNext();
+		unsigned short objectCount;
+
+		InstancedGeometry::InstancedObject **objects= r->getObjectsAsArray(objectCount);
+		for(size_t j = 0; j < objectCount; j++)
+		{
+
+
+			const Vector3 position (posMatrices[k][j]);								
+			objects[j]->setPosition(position);
+
+		}
+		k++;
+		delete[] objects;	
+	}
+	batch->setVisible(true);
+	renderInstance[0] = batch;
+
+	mCamera->getSceneManager()->destroyEntity (ent);
+}
+void InstancingListener::setupInstancedMaterialToEntity(Entity*ent)
+{
+	for (Ogre::uint i = 0; i < ent->getNumSubEntities(); ++i)
+	{
+		SubEntity* se = ent->getSubEntity(i);
+		String materialName= se->getMaterialName();
+		se->setMaterialName(buildInstancedMaterial(materialName));
+	}
+}
+String InstancingListener::buildInstancedMaterial(const String &originalMaterialName)
+{
+
+	// already instanced ?
+	if (StringUtil::endsWith (originalMaterialName, "/instanced"))
+		return originalMaterialName;
+
+	MaterialPtr originalMaterial = MaterialManager::getSingleton ().getByName (originalMaterialName);
+
+	// if originalMat doesn't exists use "Instancing" material name
+	const String instancedMaterialName (originalMaterial.isNull() ? "Instancing" : originalMaterialName + "/Instanced");
+	MaterialPtr  instancedMaterial = MaterialManager::getSingleton ().getByName (instancedMaterialName);
+
+	// already exists ?
+	if (instancedMaterial.isNull())
+	{
+		instancedMaterial = originalMaterial->clone(instancedMaterialName);
+		instancedMaterial->load();
+		Technique::PassIterator pIt = instancedMaterial->getBestTechnique ()->getPassIterator();
+		while (pIt.hasMoreElements())
+		{
+
+			Pass * const p = pIt.getNext();
+			p->setVertexProgram("Instancing", false);
+			p->setShadowCasterVertexProgram("InstancingShadowCaster");
+
+
+		}
+	}
+	instancedMaterial->load();
+	return instancedMaterialName;
+
+
+}
+//-----------------------------------------------------------------------
+void InstancingListener::destroyInstanceGeom()
+{
+	delete renderInstance[0];
+	renderInstance.clear();
+}
+//-----------------------------------------------------------------------
+void InstancingListener::createStaticGeom()
+{
+	Entity *ent = mCamera->getSceneManager()->createEntity(meshes[meshSelected], meshes[meshSelected] + ".mesh");	
+
+	renderStatic.reserve (numRender);
+	renderStatic.resize (numRender);
+
+	StaticGeometry* geom = new StaticGeometry (mCamera->getSceneManager(), 
+		meshes[meshSelected] + "s");
+
+	geom->setRegionDimensions (Vector3(1000000, 1000000, 1000000));
+	size_t k = 0;
+	size_t y = 0;
+	for (size_t i = 0; i < numMesh; i++)
+	{
+		if (y==maxObjectsPerBatch)
+		{
+			y=0;
+			k++;
+		}
+		geom->addEntity (ent, posMatrices[k][y]);
+		y++;
+	}
+	geom->setCastShadows(true);
+	geom->build ();
+	renderStatic[0] = geom;
+	mCamera->getSceneManager ()->destroyEntity (ent);
+}
+//-----------------------------------------------------------------------
+void InstancingListener::destroyStaticGeom()
+{
+
+	delete renderStatic[0];
+
+	renderStatic.clear();
+}
+//-----------------------------------------------------------------------
+void InstancingListener::createEntityGeom()
+{
+	size_t k = 0;
+	size_t y = 0;
+	renderEntity.reserve (numMesh);
+	renderEntity.resize (numMesh);
+	nodes.reserve (numMesh);
+	nodes.resize (numMesh);
+
+	for (size_t i = 0; i < numMesh; i++)
+	{
+		if (y==maxObjectsPerBatch)
+		{
+			y=0;
+			k++;
+		}
+		LogManager::getSingleton().logMessage("marche3");
+		nodes[i]=mCamera->getSceneManager()->getRootSceneNode()->createChildSceneNode("node"+StringConverter::toString(i));
+		LogManager::getSingleton().logMessage(":"+nodes[i]->getName());
+		renderEntity[i]=mCamera->getSceneManager()->createEntity(meshes[meshSelected]+StringConverter::toString(i), meshes[meshSelected] + ".mesh");	
+		nodes[i]->attachObject(renderEntity[i]);
+		nodes[i]->setPosition(posMatrices[k][y]);
+
+		y++;
+	}
+
+}
+//-----------------------------------------------------------------------
+void InstancingListener::destroyEntityGeom()
+{
+	size_t i;
+	size_t j=0;
+	for (i=0;i<numMesh;i++)
+	{
+		LogManager::getSingleton().logMessage(" " +nodes[i]->getName());
+		LogManager::getSingleton().logMessage(StringConverter::toString(j)+":"+StringConverter::toString(j<numMesh));
+		String name=nodes[i]->getName();
+		mCamera->getSceneManager()->destroySceneNode(name);
+		mCamera->getSceneManager()->destroyEntity(renderEntity[i]);
+		j++;
+	}
+
+
+
+}
+//-----------------------------------------------------------------------
+bool InstancingListener::mouseMoved ( const OIS::MouseEvent &arg )
+{
+
+	CEGUI::System::getSingleton().injectMouseMove( arg.state.X.rel, arg.state.Y.rel );
+	return true;
+}	
+//-----------------------------------------------------------------------
+bool InstancingListener::mousePressed ( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
+{
+	CEGUI::System::getSingleton().injectMouseButtonDown(convertOISMouseButtonToCegui(id));
+	return true;
+}
+//-----------------------------------------------------------------------
+bool InstancingListener::mouseReleased (const OIS::MouseEvent &arg, OIS::MouseButtonID id)
+{
+	CEGUI::System::getSingleton().injectMouseButtonUp(convertOISMouseButtonToCegui(id));
+	return true;
+}
+/*
+void InstancingListener::mouseClicked(OIS::MouseEvent* e) {}
+void InstancingListener::mouseEntered(OIS::MouseEvent* e) {}
+void InstancingListener::mouseExited(OIS::MouseEvent* e) {}*/
+void InstancingListener::requestShutdown(void)
+{
+	mRequestShutDown=true;
+}
+void InstancingListener::setCurrentGeometryOpt(CurrentGeomOpt opt)
+{
+	currentGeomOpt=opt;
+}
+bool InstancingListener::handleMouseMove(const CEGUI::EventArgs& e)
+{
+	using namespace CEGUI;
+
+	if( mLMBDown)
+	{
+		int a =0;
+		// rotate camera
+		mRotX += Ogre::Degree(-((const MouseEventArgs&)e).moveDelta.d_x * mAvgFrameTime * 10.0);
+		mRotY += Ogre::Degree(-((const MouseEventArgs&)e).moveDelta.d_y * mAvgFrameTime * 10.0);
+		mCamera->yaw(mRotX);
+		mCamera->pitch(mRotY);
+		MouseCursor::getSingleton().setPosition( mLastMousePosition );
+	}
+
+
+	return true;
+}
+//--------------------------------------------------------------------------
+bool InstancingListener::handleMouseButtonUp(const CEGUI::EventArgs& e)
+{
+	using namespace CEGUI;
+
+
+	if( ((const MouseEventArgs&)e).button == LeftButton )
+	{
+		mLMBDown = false;
+		MouseCursor::getSingleton().setPosition( mLastMousePosition );
+		CEGUI::MouseCursor::getSingleton().show();
+	}
+
+
+	return true;
+}
+
+//--------------------------------------------------------------------------
+bool InstancingListener::handleMouseButtonDown(const CEGUI::EventArgs& e)
+{
+	using namespace CEGUI;
+
+
+	if( ((const MouseEventArgs&)e).button == LeftButton )
+	{
+		mLMBDown = true;
+		mLastMousePosition=CEGUI::MouseCursor::getSingleton().getPosition();
+		CEGUI::MouseCursor::getSingleton().hide();
+	}
+
+	return true;
+}
+//--------------------------------------------------------------------------
+void InstancingListener::updateStats(void)
+{
+	static CEGUI::String currFps = "Current FPS: ";
+	static CEGUI::String avgFps = "Average FPS: ";
+	static CEGUI::String bestFps = "Best FPS: ";
+	static CEGUI::String worstFps = "Worst FPS: ";
+	static CEGUI::String tris = "Triangle Count: ";
+
+
+	const Ogre::RenderTarget::FrameStats& stats = mMain->getRenderWindow()->getStatistics();
+
+	mGuiAvg->setText(avgFps + Ogre::StringConverter::toString(stats.avgFPS));
+	mGuiCurr->setText(currFps + Ogre::StringConverter::toString(stats.lastFPS));
+	mGuiBest->setText(bestFps + Ogre::StringConverter::toString(stats.bestFPS)
+		+ " " + Ogre::StringConverter::toString(stats.bestFrameTime)+" ms");
+	mGuiWorst->setText(worstFps + Ogre::StringConverter::toString(stats.worstFPS)
+		+ " " + Ogre::StringConverter::toString(stats.worstFrameTime)+" ms");
+
+	mGuiTris->setText(tris + Ogre::StringConverter::toString(stats.triangleCount));
+	mGuiDbg->setText(mDebugText);
+	mAvgFrameTime = 1.0f/(stats.avgFPS + 1.0f);
+	if (mAvgFrameTime > 0.1f) mAvgFrameTime = 0.1f;
+
+}
Index: /Samples/Instancing/src/Makefile.am
===================================================================
--- /Samples/Instancing/src/Makefile.am	(revision 5)
+++ /Samples/Instancing/src/Makefile.am	(revision 5)
@@ -0,0 +1,11 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Instancing/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include -I$(top_srcdir)/Samples/Common/CEGUIRenderer/include @CEGUI_CFLAGS@ $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = Instancing Crowd
+
+Instancing_SOURCES = Instancing.cpp
+Instancing_LDFLAGS = -L$(top_builddir)/OgreMain/src -L$(top_builddir)/Samples/Common/CEGUIRenderer/src
+Instancing_LDADD = -lOgreMain @CEGUI_LIBS@ -lCEGUIOgreRenderer $(OIS_LIBS)
+
+Crowd_SOURCES = crowd.cpp
+Crowd_LDFLAGS = -L$(top_builddir)/OgreMain/src -L$(top_builddir)/Samples/Common/CEGUIRenderer/src
+Crowd_LDADD = -lOgreMain @CEGUI_LIBS@ -lCEGUIOgreRenderer $(OIS_LIBS)
Index: /Samples/Instancing/src/Makefile.in
===================================================================
--- /Samples/Instancing/src/Makefile.in	(revision 5)
+++ /Samples/Instancing/src/Makefile.in	(revision 5)
@@ -0,0 +1,536 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = Instancing$(EXEEXT) Crowd$(EXEEXT)
+subdir = Samples/Instancing/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_Crowd_OBJECTS = crowd.$(OBJEXT)
+Crowd_OBJECTS = $(am_Crowd_OBJECTS)
+am__DEPENDENCIES_1 =
+Crowd_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_Instancing_OBJECTS = Instancing.$(OBJEXT)
+Instancing_OBJECTS = $(am_Instancing_OBJECTS)
+Instancing_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Crowd_SOURCES) $(Instancing_SOURCES)
+DIST_SOURCES = $(Crowd_SOURCES) $(Instancing_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Instancing/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include -I$(top_srcdir)/Samples/Common/CEGUIRenderer/include @CEGUI_CFLAGS@ $(OIS_CFLAGS)
+Instancing_SOURCES = Instancing.cpp
+Instancing_LDFLAGS = -L$(top_builddir)/OgreMain/src -L$(top_builddir)/Samples/Common/CEGUIRenderer/src
+Instancing_LDADD = -lOgreMain @CEGUI_LIBS@ -lCEGUIOgreRenderer $(OIS_LIBS)
+Crowd_SOURCES = crowd.cpp
+Crowd_LDFLAGS = -L$(top_builddir)/OgreMain/src -L$(top_builddir)/Samples/Common/CEGUIRenderer/src
+Crowd_LDADD = -lOgreMain @CEGUI_LIBS@ -lCEGUIOgreRenderer $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Instancing/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Instancing/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+Crowd$(EXEEXT): $(Crowd_OBJECTS) $(Crowd_DEPENDENCIES) 
+	@rm -f Crowd$(EXEEXT)
+	$(CXXLINK) $(Crowd_LDFLAGS) $(Crowd_OBJECTS) $(Crowd_LDADD) $(LIBS)
+Instancing$(EXEEXT): $(Instancing_OBJECTS) $(Instancing_DEPENDENCIES) 
+	@rm -f Instancing$(EXEEXT)
+	$(CXXLINK) $(Instancing_LDFLAGS) $(Instancing_OBJECTS) $(Instancing_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Instancing.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crowd.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Instancing/src/crowd.cpp
===================================================================
--- /Samples/Instancing/src/crowd.cpp	(revision 5)
+++ /Samples/Instancing/src/crowd.cpp	(revision 5)
@@ -0,0 +1,498 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2005 The OGRE Team
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        Crowd.cpp
+    \brief
+        Shows OGRE's bezier Crowd feature
+*/
+
+#include "crowd.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+    // Create application object
+    CrowdApplication app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL );
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+
+    return 0;
+}
+#ifdef __cplusplus
+}
+#endif
+
+	CrowdListener::CrowdListener(RenderWindow* win, Camera* cam,CEGUI::Renderer* renderer, CrowdApplication*main)
+		: ExampleFrameListener(win, cam,false,true),
+		mRequestShutDown(false),
+		mLMBDown(false),
+		mRMBDown(false),
+		mAvgFrameTime(0.1),
+		mMain(main),
+		mBurnAmount(0)
+	{ 
+		const GpuProgramManager::SyntaxCodes &syntaxCodes = GpuProgramManager::getSingleton().getSupportedSyntax();
+		for (GpuProgramManager::SyntaxCodes::const_iterator iter = syntaxCodes.begin();iter != syntaxCodes.end();++iter)
+		{
+				LogManager::getSingleton().logMessage("supported syntax : "+(*iter));
+		}
+		mGUIRenderer=renderer;
+		numMesh = 160;
+		numRender = 0;
+		meshSelected = 0;
+		currentGeomOpt = INSTANCE_OPT;
+		createCurrentGeomOpt();
+
+		mMouse->setEventCallback(this);
+		mKeyboard->setEventCallback(this);
+
+		mGuiAvg   = CEGUI::WindowManager::getSingleton().getWindow("OPAverageFPS");
+		mGuiCurr  = CEGUI::WindowManager::getSingleton().getWindow("OPCurrentFPS");
+		mGuiBest  = CEGUI::WindowManager::getSingleton().getWindow("OPBestFPS");
+		mGuiWorst = CEGUI::WindowManager::getSingleton().getWindow("OPWorstFPS");
+		mGuiTris  = CEGUI::WindowManager::getSingleton().getWindow("OPTriCount");
+		mGuiDbg   = CEGUI::WindowManager::getSingleton().getWindow("OPDebugMsg");
+		mRoot	  = CEGUI::WindowManager::getSingleton().getWindow("root");
+		mDebugOverlay->hide();
+		timer = new Ogre::Timer();
+		mLastTime = timer->getMicroseconds()/1000000.0f;
+
+	}
+	//-----------------------------------------------------------------------
+	CrowdListener::~CrowdListener()
+	{
+		destroyCurrentGeomOpt();
+		delete timer;
+	}
+	//-----------------------------------------------------------------------
+	bool CrowdListener::frameStarted(const FrameEvent& evt)
+	{
+
+		burnCPU();
+		std::vector <AnimationState*>::iterator it;
+		for(it=animations.begin();it!=animations.end();it++)
+		{
+			(*it)->addTime(evt.timeSinceLastFrame);
+		}
+		
+		updateStats();
+
+		if(mRequestShutDown)
+			return false;
+		const bool returnValue = ExampleFrameListener::frameStarted(evt);
+		// Call default
+		return returnValue;
+	}
+	//-----------------------------------------------------------------------
+	void CrowdListener::burnCPU(void)
+	{
+	    double mStartTime = timer->getMicroseconds()/1000000.0f; //convert into seconds
+		double mCurTime =  mStartTime;
+		double mStopTime = mLastTime + mBurnAmount;
+		double mCPUUsage;
+
+		while( mCurTime < mStopTime )
+		{
+			mCurTime = timer->getMicroseconds()/1000000.0f; //convert into seconds
+		}
+
+		if( mCurTime - mLastTime > 0.00001f )
+			mCPUUsage = (mCurTime - mStartTime) / (mCurTime - mLastTime) * 100.0f;
+		else
+			mCPUUsage = FLT_MAX;
+
+		mLastTime = timer->getMicroseconds()/1000000.0f; //convert into seconds
+		int time = mCPUUsage+0.5f;
+		if(mTimeUntilNextToggle<=0)
+		{
+			//mDebugText="remaining for logic:"+ StringConverter::toString(time);
+			mTimeUntilNextToggle=1;
+		}
+		
+	}
+	//-----------------------------------------------------------------------
+	void CrowdListener::destroyCurrentGeomOpt()
+	{
+		switch(currentGeomOpt)
+		{
+			case INSTANCE_OPT:destroyInstanceGeom();break;
+			case ENTITY_OPT: destroyEntityGeom ();break;
+		}
+	}
+	//-----------------------------------------------------------------------
+	void CrowdListener::createCurrentGeomOpt()
+	{
+		LogManager::getSingleton().logMessage("geom deleted");
+		objectCount=numMesh;
+		numRender=1;
+		while(objectCount>maxObjectsPerBatch)
+		{
+			numRender++;
+			objectCount-=maxObjectsPerBatch;
+		}
+	
+		assert (meshSelected < numTypeMeshes);
+		MeshPtr m = MeshManager::getSingleton ().getByName ("robot.mesh");
+		if (m.isNull ())
+		{
+			m = MeshManager::getSingleton ().load ("robot.mesh", 
+				ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
+		}
+		const Real radius = m->getBoundingSphereRadius ();
+
+		// could/should print on screen mesh name, 
+		//optimisation type, 
+		//mesh vertices num, 
+		//32 bit or not, 
+		//etC..
+
+
+		switch(currentGeomOpt)
+		{
+			case INSTANCE_OPT:createInstanceGeom();break;
+			case ENTITY_OPT: createEntityGeom ();break;
+		}
+
+	}
+	//-----------------------------------------------------------------------
+	void CrowdListener::createInstanceGeom()
+	{
+		if (Root::getSingleton ().getRenderSystem ()->getCapabilities ()->hasCapability (RSC_VERTEX_PROGRAM) == false)
+		{
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Your video card doesn't support batching", "Demo_Instance::createScene");
+		}
+
+		Entity *ent = mCamera->getSceneManager()->createEntity("robot","robot.mesh");	
+		setupInstancedMaterialToEntity(ent);
+
+		renderInstance.reserve(numRender);
+		renderInstance.resize(numRender);
+
+		//Load a mesh to read data from.	
+		InstancedGeometry* batch = new InstancedGeometry(mCamera->getSceneManager(), 
+			"robots" );
+		batch->setCastShadows(true);
+
+        size_t i, k;
+
+		batch->setBatchInstanceDimensions (Vector3(1000000, 1000000, 1000000));
+		const size_t batchSize = (numMesh > maxObjectsPerBatch) ? maxObjectsPerBatch :numMesh;
+		for(i = 0; i < batchSize ; i++)
+		{
+			batch->addEntity(ent, Vector3::ZERO);
+		}
+		batch->setOrigin(Vector3::ZERO);
+
+		batch->build();
+
+
+		for (k = 0; k < numRender-1; k++)
+		{
+			batch->addBatchInstance();
+		}
+
+		i = 0,k = 0;
+		InstancedGeometry::BatchInstanceIterator regIt = batch->getBatchInstanceIterator();
+		size_t baseIndexForBatch = 0;
+		//create a RayQuery to get the terrain height
+		RaySceneQuery* raySceneQuery=mCamera->getSceneManager()->createRayQuery(Ray(Vector3(0,0,0), Vector3::NEGATIVE_UNIT_Y));
+		RaySceneQueryResult::iterator it;
+		RaySceneQueryResult& qryResult=raySceneQuery->execute();
+		while (regIt.hasMoreElements ())
+		{
+
+			InstancedGeometry::BatchInstance *r = regIt.getNext();
+			unsigned short objectCount;
+
+			InstancedGeometry::InstancedObject **objects= r->getObjectsAsArray(objectCount);
+			for(size_t j = 0; j < objectCount; j++)
+			{
+				Vector3 position;
+				
+				position.x=10*k+500;
+				position.z=10*i+500;
+				position.y=0;
+				raySceneQuery->setRay (Ray(position, Vector3::UNIT_Y));
+				raySceneQuery->execute();
+                it = qryResult.begin();
+
+                if (it != qryResult.end() && it->worldFragment)
+					position.y =  it->worldFragment->singleIntersection.y;
+				
+										
+				objects[j]->setPosition(position);
+				objects[j]->setScale(Vector3(0.1,0.1,0.1));
+				AnimationState*anim=objects[j]->getAnimationState("Walk");
+				animations.push_back(anim);
+				//offset the animation time, to show that all objects are independently animated.
+				anim->setTimePosition(i+k);
+				anim->setEnabled(true);
+				k++;
+			}
+
+			if(k>14)
+			{
+				k=0;
+			    i++;
+			}
+			delete[] objects;	
+		}
+		batch->setVisible(true);
+		renderInstance[0] = batch;
+		mCamera->getSceneManager()->destroyQuery(raySceneQuery);
+		mCamera->getSceneManager()->destroyEntity (ent);
+	}
+	//-----------------------------------------------------------------------
+	void CrowdListener::destroyInstanceGeom()
+	{
+		delete renderInstance[0];
+		renderInstance.clear();
+		animations.clear();
+	}
+	void CrowdListener::setupInstancedMaterialToEntity(Entity*ent)
+	{
+		for (Ogre::uint i = 0; i < ent->getNumSubEntities(); ++i)
+		{
+			SubEntity* se = ent->getSubEntity(i);
+			String materialName= se->getMaterialName();
+			se->setMaterialName(buildCrowdMaterial(materialName, ent->getSkeleton()->getNumBones()));
+		}
+	}
+	String CrowdListener::buildCrowdMaterial(const String &originalMaterialName,int numBones)
+	{
+
+		// already instanced ?
+		if (StringUtil::endsWith (originalMaterialName, "/instanced"))
+			return originalMaterialName;
+
+		MaterialPtr originalMaterial = MaterialManager::getSingleton ().getByName (originalMaterialName);
+
+		// if originalMat doesn't exists use "Instancing" material name
+		const String instancedMaterialName (originalMaterial.isNull() ? "Instancing" : originalMaterialName + "/Instanced");
+		MaterialPtr  instancedMaterial = MaterialManager::getSingleton ().getByName (instancedMaterialName);
+
+		// already exists ?
+		if (instancedMaterial.isNull())
+		{
+			instancedMaterial = originalMaterial->clone(instancedMaterialName);
+			instancedMaterial->load();
+			Technique::PassIterator pIt = instancedMaterial->getBestTechnique ()->getPassIterator();
+			while (pIt.hasMoreElements())
+			{
+
+				Pass * const p = pIt.getNext();
+				p->setVertexProgram("Crowd",true);
+				p->setShadowCasterVertexProgram("CrowdShadowCaster");
+		
+			}
+		}
+		instancedMaterial->load();
+		return instancedMaterialName;
+
+
+	}
+	//-----------------------------------------------------------------------
+	void CrowdListener::createEntityGeom()
+	{
+		size_t k = 0;
+		size_t y = 0;
+		renderEntity.reserve (numMesh);
+		renderEntity.resize (numMesh);
+		nodes.reserve (numMesh);
+		nodes.resize (numMesh);
+		//create a RayQuery to get the terrain height
+		RaySceneQuery* raySceneQuery=mCamera->getSceneManager()->createRayQuery(Ray(Vector3(0,0,0), Vector3::NEGATIVE_UNIT_Y));
+		RaySceneQueryResult::iterator it;
+		RaySceneQueryResult& qryResult=raySceneQuery->execute();
+		for (size_t i = 0; i < numMesh; i++)
+		{
+		
+			Vector3 position;
+				
+			position.x=10*y+500;
+			position.y=0;
+			position.z=10*k+500;	
+
+			raySceneQuery->setRay (Ray(position, Vector3::UNIT_Y));
+			raySceneQuery->execute();
+            it = qryResult.begin();
+
+            if (it != qryResult.end() && it->worldFragment)
+				position.y =  it->worldFragment->singleIntersection.y;
+
+			nodes[i]=mCamera->getSceneManager()->getRootSceneNode()->createChildSceneNode("node"+StringConverter::toString(i));
+			LogManager::getSingleton().logMessage(":"+nodes[i]->getName());
+			renderEntity[i]=mCamera->getSceneManager()->createEntity("robot"+StringConverter::toString(i), "robot.mesh");	
+	    	nodes[i]->attachObject(renderEntity[i]);
+			nodes[i]->setPosition(position);
+			nodes[i]->setScale(Vector3(0.1,0.1,0.1));
+			AnimationState*anim=renderEntity[i]->getAnimationState("Walk");
+			animations.push_back(anim);
+			anim->setTimePosition(y+k);
+			anim->setEnabled(true);
+			y++;
+			if (y>14)
+			{
+				y=0;
+				k++;
+			}
+		}
+		mCamera->getSceneManager()->destroyQuery(raySceneQuery);
+
+
+	}
+	//-----------------------------------------------------------------------
+	void CrowdListener::destroyEntityGeom()
+	{
+		size_t i;
+		size_t j=0;
+		for (i=0;i<numMesh;i++)
+		{
+			LogManager::getSingleton().logMessage(" " +nodes[i]->getName());
+			LogManager::getSingleton().logMessage(StringConverter::toString(j)+":"+StringConverter::toString(j<numMesh));
+			String name=nodes[i]->getName();
+			mCamera->getSceneManager()->destroySceneNode(name);
+			mCamera->getSceneManager()->destroyEntity(renderEntity[i]);
+			j++;
+		}
+		animations.clear();
+
+
+
+	}
+	//-----------------------------------------------------------------------
+	bool CrowdListener::mouseMoved ( const OIS::MouseEvent &arg )
+	{
+
+		CEGUI::System::getSingleton().injectMouseMove( arg.state.X.rel, arg.state.Y.rel );
+		return true;
+	}	
+	//-----------------------------------------------------------------------
+   bool CrowdListener::mousePressed ( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
+   {
+       CEGUI::System::getSingleton().injectMouseButtonDown(convertOISMouseButtonToCegui(id));
+		return true;
+   }
+	//-----------------------------------------------------------------------
+   bool CrowdListener::mouseReleased (const OIS::MouseEvent &arg, OIS::MouseButtonID id)
+   {
+	   CEGUI::System::getSingleton().injectMouseButtonUp(convertOISMouseButtonToCegui(id));
+		return true;
+   }
+
+   void CrowdListener::requestShutdown(void)
+   {
+	   mRequestShutDown=true;
+   }
+   void CrowdListener::setCurrentGeometryOpt(CurrentGeomOpt opt)
+   {
+	   currentGeomOpt=opt;
+   }
+   bool CrowdListener::handleMouseMove(const CEGUI::EventArgs& e)
+	{
+		using namespace CEGUI;
+
+		if( mLMBDown)
+		{
+			int a =0;
+			// rotate camera
+			mRotX += Ogre::Degree(-((const MouseEventArgs&)e).moveDelta.d_x * mAvgFrameTime * 10.0);
+			mRotY += Ogre::Degree(-((const MouseEventArgs&)e).moveDelta.d_y * mAvgFrameTime * 10.0);
+			mCamera->yaw(mRotX);
+			mCamera->pitch(mRotY);
+			MouseCursor::getSingleton().setPosition( mLastMousePosition );
+		}
+			
+
+	 return true;
+	}
+	//--------------------------------------------------------------------------
+	bool CrowdListener::handleMouseButtonUp(const CEGUI::EventArgs& e)
+	{
+		using namespace CEGUI;
+
+		
+		if( ((const MouseEventArgs&)e).button == LeftButton )
+		{
+			mLMBDown = false;
+			MouseCursor::getSingleton().setPosition( mLastMousePosition );
+			CEGUI::MouseCursor::getSingleton().show();
+		}
+
+
+		return true;
+	}
+
+	//--------------------------------------------------------------------------
+	bool CrowdListener::handleMouseButtonDown(const CEGUI::EventArgs& e)
+	{
+		using namespace CEGUI;
+
+		
+		if( ((const MouseEventArgs&)e).button == LeftButton )
+		{
+			mLMBDown = true;
+			mLastMousePosition=CEGUI::MouseCursor::getSingleton().getPosition();
+			CEGUI::MouseCursor::getSingleton().hide();
+		}
+
+
+
+		return true;
+	}
+	//--------------------------------------------------------------------------
+	void CrowdListener::updateStats(void)
+	{
+		static CEGUI::String currFps = "Current FPS: ";
+		static CEGUI::String avgFps = "Average FPS: ";
+		static CEGUI::String bestFps = "Best FPS: ";
+		static CEGUI::String worstFps = "Worst FPS: ";
+		static CEGUI::String tris = "Triangle Count: ";
+
+
+		const Ogre::RenderTarget::FrameStats& stats = mMain->getRenderWindow()->getStatistics();
+        
+		mGuiAvg->setText(avgFps + Ogre::StringConverter::toString(stats.avgFPS));
+		mGuiCurr->setText(currFps + Ogre::StringConverter::toString(stats.lastFPS));
+		mGuiBest->setText(bestFps + Ogre::StringConverter::toString(stats.bestFPS)
+			+ " " + Ogre::StringConverter::toString(stats.bestFrameTime)+" ms");
+		mGuiWorst->setText(worstFps + Ogre::StringConverter::toString(stats.worstFPS)
+			+ " " + Ogre::StringConverter::toString(stats.worstFrameTime)+" ms");
+
+		mGuiTris->setText(tris + Ogre::StringConverter::toString(stats.triangleCount));
+		mAvgFrameTime = 1.0f/(stats.avgFPS + 1.0f);
+		if (mAvgFrameTime > 0.1f) mAvgFrameTime = 0.1f;
+
+	}
Index: /Samples/Lighting/Makefile.am
===================================================================
--- /Samples/Lighting/Makefile.am	(revision 5)
+++ /Samples/Lighting/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/Lighting/Makefile.in
===================================================================
--- /Samples/Lighting/Makefile.in	(revision 5)
+++ /Samples/Lighting/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Lighting
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Lighting/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Lighting/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Lighting/bin/Debug/.keepme
===================================================================
--- /Samples/Lighting/bin/Debug/.keepme	(revision 5)
+++ /Samples/Lighting/bin/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Lighting/bin/Release/.keepme
===================================================================
--- /Samples/Lighting/bin/Release/.keepme	(revision 5)
+++ /Samples/Lighting/bin/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Lighting/include/Lighting.h
===================================================================
--- /Samples/Lighting/include/Lighting.h	(revision 5)
+++ /Samples/Lighting/include/Lighting.h	(revision 5)
@@ -0,0 +1,374 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        Lighting.h
+    \brief
+        Shows lighting support in OGRE. Also demonstrates the use of billboards
+        and controllers for automatic time-relative behaviour.
+*/
+
+
+#include "ExampleApplication.h"
+
+
+/** This class turns lights & billboards linked to them on & off */
+class LightFlasher : public ControllerValue<Real>
+{
+protected:
+	Light* mLight;
+	Billboard* mBillboard;
+	ColourValue mMaxColour;
+	Real intensity;
+public:
+	LightFlasher(Light* light, Billboard* billboard, ColourValue maxColour)
+	{
+		mLight = light;
+		mBillboard = billboard;
+		mMaxColour = maxColour;
+	}
+
+	virtual Real  getValue (void) const
+	{
+		return intensity;
+	}
+
+	virtual void  setValue (Real value)
+	{
+		intensity = value;
+
+		ColourValue newColour;
+
+		// Attenuate the brightness of the light
+		newColour.r = mMaxColour.r * intensity;
+		newColour.g = mMaxColour.g * intensity;
+		newColour.b = mMaxColour.b * intensity;
+
+		mLight->setDiffuseColour(newColour);
+		mBillboard->setColour(newColour);
+	}
+};
+
+
+/** Controller function mapping waveform to light intensity */
+class LightFlasherControllerFunction : public WaveformControllerFunction
+{
+public:
+	LightFlasherControllerFunction(WaveformType wavetype, Real frequency, Real phase) : WaveformControllerFunction(wavetype, 0, frequency, phase, 1, true)
+	{
+
+	}
+};
+
+
+// Some global node data
+SceneNode* mRedYellowLightsNode;
+SceneNode* mGreenBlueLightsNode;
+std::vector<AnimationState*> mAnimStateList;
+
+
+// Listener class for frame updates
+class LightingListener : public ExampleFrameListener
+{
+protected:
+public:
+    LightingListener(RenderWindow* win, Camera* cam)
+        : ExampleFrameListener(win, cam)
+    {
+    }
+
+    bool frameStarted(const FrameEvent& evt)
+    {
+	if( ExampleFrameListener::frameStarted(evt) == false )
+		return false;
+
+		std::vector<AnimationState*>::iterator animi;
+		for (animi = mAnimStateList.begin(); animi != mAnimStateList.end(); ++animi)
+		{
+			(*animi)->addTime(evt.timeSinceLastFrame);
+		}
+
+        return true;
+    }
+};
+
+/** Application class */
+class LightingApplication : public ExampleApplication
+{
+protected:
+
+	// The set of all the billboards used for the lights
+    // 2 sets because we'll rotate them differently
+	BillboardSet* mRedYellowLights;
+	BillboardSet* mGreenBlueLights;
+
+	// Billboards
+	Billboard* mRedLightBoard;
+	Billboard* mBlueLightBoard;
+	Billboard* mYellowLightBoard;
+	Billboard* mGreenLightBoard;
+
+	// Lights
+	Light* mRedLight;
+	Light* mBlueLight;
+	Light* mYellowLight;
+	Light* mGreenLight;
+
+
+	// Light flashers
+	ControllerValueRealPtr mRedLightFlasher;
+	ControllerValueRealPtr mBlueLightFlasher;
+	ControllerValueRealPtr mYellowLightFlasher;
+	ControllerValueRealPtr mGreenLightFlasher;
+
+	// Light controller functions
+	ControllerFunctionRealPtr mRedLightControllerFunc;
+	ControllerFunctionRealPtr mBlueLightControllerFunc;
+	ControllerFunctionRealPtr mYellowLightControllerFunc;
+	ControllerFunctionRealPtr mGreenLightControllerFunc;
+
+	// Light controllers
+	Controller<Real>* mRedLightController;
+	Controller<Real>* mBlueLightController;
+	Controller<Real>* mYellowLightController;
+	Controller<Real>* mGreenLightController;
+
+	void createScene(void)
+    {
+		// Set a very low level of ambient lighting
+		mSceneMgr->setAmbientLight(ColourValue(0.1, 0.1, 0.1));
+
+        // Use the "Space" skybox
+        mSceneMgr->setSkyBox(true, "Examples/SpaceSkyBox");
+
+		// Load ogre head
+		Entity* head = mSceneMgr->createEntity("head", "ogrehead.mesh");
+
+		// Attach the head to the scene
+		mSceneMgr->getRootSceneNode()->attachObject(head);
+
+		/*
+		// Create nodes for the lights to be rotated with
+        mRedYellowLightsNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        mGreenBlueLightsNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+
+
+        // First create the BillboardSets. This will define the materials for the billboards
+		// in its set to use
+		mRedYellowLights = mSceneMgr->createBillboardSet("RedYellowLights");
+		mRedYellowLights->setMaterialName("Examples/Flare");
+		mRedYellowLightsNode->attachObject(mRedYellowLights);
+
+		mGreenBlueLights = mSceneMgr->createBillboardSet("GreenBlueLights");
+		mGreenBlueLights->setMaterialName("Examples/Flare");
+		mGreenBlueLightsNode->attachObject(mGreenBlueLights);
+
+		// Red light billboard, in "off" state
+		Vector3 redLightPosition(78, -8, -70);
+		mRedLightBoard = mRedYellowLights->createBillboard(redLightPosition);
+		mRedLightBoard->setColour(ColourValue::Black);
+
+
+		// Blue light billboard, in "off" state
+		Vector3 blueLightPosition(-90, -8, -70);
+		mBlueLightBoard = mGreenBlueLights->createBillboard(blueLightPosition);
+		mBlueLightBoard->setColour(ColourValue::Black);
+
+
+		// Yellow light billboard, in "off" state
+		Vector3 yellowLightPosition(-4.5, 30, -80);
+		mYellowLightBoard = mRedYellowLights->createBillboard(yellowLightPosition);
+		mYellowLightBoard->setColour(ColourValue::Black);
+
+		// Green light billboard, in "off" state
+		Vector3 greenLightPosition(50, 70, 80);
+		mGreenLightBoard = mGreenBlueLights->createBillboard(greenLightPosition);
+		mGreenLightBoard->setColour(ColourValue::Black);
+
+		// Red light, in "off" state
+		mRedLight = mSceneMgr->createLight("RedFlyingLight");
+		mRedLight->setType(Light::LT_POINT);
+		mRedLight->setPosition(redLightPosition);
+		mRedLight->setDiffuseColour(ColourValue::Black);
+		mRedYellowLightsNode->attachObject(mRedLight);
+
+		// Blue light, in "off" state
+		mBlueLight = mSceneMgr->createLight("BlueFlyingLight");
+		mBlueLight->setType(Light::LT_POINT);
+		mBlueLight->setPosition(blueLightPosition);
+		mBlueLight->setDiffuseColour(ColourValue::Black);
+		mGreenBlueLightsNode->attachObject(mBlueLight);
+
+		// Yellow light in "off" state
+		mYellowLight = mSceneMgr->createLight("YellowFlyingLight");
+		mYellowLight->setType(Light::LT_POINT);
+		mYellowLight->setPosition(yellowLightPosition);
+		mYellowLight->setDiffuseColour(ColourValue::Black);
+		mRedYellowLightsNode->attachObject(mYellowLight);
+
+		// Yellow light in "off" state
+		mGreenLight = mSceneMgr->createLight("GreenFlyingLight");
+		mGreenLight->setType(Light::LT_POINT);
+		mGreenLight->setPosition(greenLightPosition);
+		mGreenLight->setDiffuseColour(ColourValue::Black);
+		mGreenBlueLightsNode->attachObject(mGreenLight);
+
+		// Light flashers
+		mRedLightFlasher = ControllerValueRealPtr(
+            new LightFlasher(mRedLight, mRedLightBoard, ColourValue::Red));
+		mBlueLightFlasher = ControllerValueRealPtr(
+            new LightFlasher(mBlueLight, mBlueLightBoard, ColourValue::Blue));
+		mYellowLightFlasher = ControllerValueRealPtr(
+            new LightFlasher(mYellowLight, mYellowLightBoard, ColourValue(1.0, 1.0, 0.0)));
+		mGreenLightFlasher = ControllerValueRealPtr(
+            new LightFlasher(mGreenLight, mGreenLightBoard, ColourValue::Green));
+
+		// Light controller functions
+		mRedLightControllerFunc = ControllerFunctionRealPtr(
+            new LightFlasherControllerFunction(Ogre::WFT_SINE, 0.5, 0.0));
+		mBlueLightControllerFunc = ControllerFunctionRealPtr(
+            new LightFlasherControllerFunction(Ogre::WFT_SINE, 0.75, 0.5));
+		mYellowLightControllerFunc = ControllerFunctionRealPtr(
+            new LightFlasherControllerFunction(Ogre::WFT_TRIANGLE, 0.25, 0.0));
+		mGreenLightControllerFunc = ControllerFunctionRealPtr(
+            new LightFlasherControllerFunction(Ogre::WFT_SINE, 0.25, 0.5));
+
+		// Light controllers
+		ControllerManager* mControllerManager = &ControllerManager::getSingleton();
+		mRedLightController = mControllerManager->createController(mControllerManager->getFrameTimeSource(), mRedLightFlasher, mRedLightControllerFunc);
+		mBlueLightController = mControllerManager->createController(mControllerManager->getFrameTimeSource(), mBlueLightFlasher, mBlueLightControllerFunc);
+		mYellowLightController = mControllerManager->createController(mControllerManager->getFrameTimeSource(), mYellowLightFlasher, mYellowLightControllerFunc);
+		mGreenLightController = mControllerManager->createController(mControllerManager->getFrameTimeSource(), mGreenLightFlasher, mGreenLightControllerFunc);
+
+		*/
+
+		setupTrailLights();
+
+    }
+
+	void setupTrailLights(void)
+	{
+		mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+		Vector3 dir(-1, -1, 0.5);
+		dir.normalise();
+		Light* l = mSceneMgr->createLight("light1");
+		l->setType(Light::LT_DIRECTIONAL);
+		l->setDirection(dir);
+
+		NameValuePairList pairList;
+		pairList["numberOfChains"] = "2";
+		pairList["maxElements"] = "80";
+		RibbonTrail* trail = static_cast<RibbonTrail*>(
+			mSceneMgr->createMovableObject("1", "RibbonTrail", &pairList));
+		trail->setMaterialName("Examples/LightRibbonTrail");
+		trail->setTrailLength(400);
+
+
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(trail);
+
+		// Create 3 nodes for trail to follow
+		SceneNode* animNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		animNode->setPosition(50,30,0);
+		Animation* anim = mSceneMgr->createAnimation("an1", 14);
+		anim->setInterpolationMode(Animation::IM_SPLINE);
+		NodeAnimationTrack* track = anim->createNodeTrack(1, animNode);
+		TransformKeyFrame* kf = track->createNodeKeyFrame(0);
+		kf->setTranslate(Vector3(50,30,0));
+		kf = track->createNodeKeyFrame(2);
+		kf->setTranslate(Vector3(100, -30, 0));
+		kf = track->createNodeKeyFrame(4);
+		kf->setTranslate(Vector3(120, -100, 150));
+		kf = track->createNodeKeyFrame(6);
+		kf->setTranslate(Vector3(30, -100, 50));
+		kf = track->createNodeKeyFrame(8);
+		kf->setTranslate(Vector3(-50, 30, -50));
+		kf = track->createNodeKeyFrame(10);
+		kf->setTranslate(Vector3(-150, -20, -100));
+		kf = track->createNodeKeyFrame(12);
+		kf->setTranslate(Vector3(-50, -30, 0));
+		kf = track->createNodeKeyFrame(14);
+		kf->setTranslate(Vector3(50,30,0));
+
+		AnimationState* animState = mSceneMgr->createAnimationState("an1");
+		animState->setEnabled(true);
+		mAnimStateList.push_back(animState);
+
+		trail->setInitialColour(0, 1.0, 0.8, 0);
+		trail->setColourChange(0, 0.5, 0.5, 0.5, 0.5);
+		trail->setInitialWidth(0, 5);
+		trail->addNode(animNode);
+
+		// Add light
+		Light* l2 = mSceneMgr->createLight("l2");
+		l2->setDiffuseColour(trail->getInitialColour(0));
+		animNode->attachObject(l2);
+
+		// Add billboard
+		BillboardSet* bbs = mSceneMgr->createBillboardSet("bb", 1);
+		bbs->createBillboard(Vector3::ZERO, trail->getInitialColour(0));
+		bbs->setMaterialName("Examples/Flare");
+		animNode->attachObject(bbs);
+
+		animNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		animNode->setPosition(-50,100,0);
+		anim = mSceneMgr->createAnimation("an2", 10);
+		anim->setInterpolationMode(Animation::IM_SPLINE);
+		track = anim->createNodeTrack(1, animNode);
+		kf = track->createNodeKeyFrame(0);
+		kf->setTranslate(Vector3(-50,100,0));
+		kf = track->createNodeKeyFrame(2);
+		kf->setTranslate(Vector3(-100, 150, -30));
+		kf = track->createNodeKeyFrame(4);
+		kf->setTranslate(Vector3(-200, 0, 40));
+		kf = track->createNodeKeyFrame(6);
+		kf->setTranslate(Vector3(0, -150, 70));
+		kf = track->createNodeKeyFrame(8);
+		kf->setTranslate(Vector3(50, 0, 30));
+		kf = track->createNodeKeyFrame(10);
+		kf->setTranslate(Vector3(-50,100,0));
+
+		animState = mSceneMgr->createAnimationState("an2");
+		animState->setEnabled(true);
+		mAnimStateList.push_back(animState);
+
+		trail->setInitialColour(1, 0.0, 1.0, 0.4);
+		trail->setColourChange(1, 0.5, 0.5, 0.5, 0.5);
+		trail->setInitialWidth(1, 5);
+		trail->addNode(animNode);
+
+
+		// Add light
+		l2 = mSceneMgr->createLight("l3");
+		l2->setDiffuseColour(trail->getInitialColour(1));
+		animNode->attachObject(l2);
+
+		// Add billboard
+		bbs = mSceneMgr->createBillboardSet("bb2", 1);
+		bbs->createBillboard(Vector3::ZERO, trail->getInitialColour(1));
+		bbs->setMaterialName("Examples/Flare");
+		animNode->attachObject(bbs);
+
+
+	}
+
+	void createFrameListener(void)
+    {
+		// This is where we instantiate our own frame listener
+        mFrameListener= new LightingListener(mWindow, mCamera);
+        mRoot->addFrameListener(mFrameListener);
+
+    }
+
+};
Index: /Samples/Lighting/include/Makefile.am
===================================================================
--- /Samples/Lighting/include/Makefile.am	(revision 5)
+++ /Samples/Lighting/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = Lighting.h
Index: /Samples/Lighting/include/Makefile.in
===================================================================
--- /Samples/Lighting/include/Makefile.in	(revision 5)
+++ /Samples/Lighting/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Lighting/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = Lighting.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Lighting/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Lighting/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Lighting/misc/.keepme
===================================================================
--- /Samples/Lighting/misc/.keepme	(revision 5)
+++ /Samples/Lighting/misc/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Lighting/obj/Debug/.keepme
===================================================================
--- /Samples/Lighting/obj/Debug/.keepme	(revision 5)
+++ /Samples/Lighting/obj/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Lighting/obj/Release/.keepme
===================================================================
--- /Samples/Lighting/obj/Release/.keepme	(revision 5)
+++ /Samples/Lighting/obj/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Lighting/scripts/Demo_Lighting.cbp
===================================================================
--- /Samples/Lighting/scripts/Demo_Lighting.cbp	(revision 5)
+++ /Samples/Lighting/scripts/Demo_Lighting.cbp	(revision 5)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Lighting" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Lighting.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Lighting.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\Lighting.h" />
+		<Unit filename="..\src\Lighting.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Lighting/scripts/Demo_Lighting.vcproj
===================================================================
--- /Samples/Lighting/scripts/Demo_Lighting.vcproj	(revision 5)
+++ /Samples/Lighting/scripts/Demo_Lighting.vcproj	(revision 5)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_Lighting"
+	ProjectGUID="{09F9E809-02CF-4926-8203-2B9C02FBD916}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_Lighting.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_Lighting.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_Lighting.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\Lighting.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\Lighting.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Lighting/scripts/Demo_Lighting_linux.cbp
===================================================================
--- /Samples/Lighting/scripts/Demo_Lighting_linux.cbp	(revision 5)
+++ /Samples/Lighting/scripts/Demo_Lighting_linux.cbp	(revision 5)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Lighting" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_Lighting" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_Lighting" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/Lighting.h" />
+		<Unit filename="../src/Lighting.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Lighting/scripts/Demo_Lighting_stlp.cbp
===================================================================
--- /Samples/Lighting/scripts/Demo_Lighting_stlp.cbp	(revision 5)
+++ /Samples/Lighting/scripts/Demo_Lighting_stlp.cbp	(revision 5)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_Lighting" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Lighting.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Lighting.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\Lighting.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\Lighting.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Lighting/scripts/Demo_Lighting_vc8.vcproj
===================================================================
--- /Samples/Lighting/scripts/Demo_Lighting_vc8.vcproj	(revision 5)
+++ /Samples/Lighting/scripts/Demo_Lighting_vc8.vcproj	(revision 5)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_Lighting"
+	ProjectGUID="{09F9E809-02CF-4926-8203-2B9C02FBD916}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_Lighting.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_Lighting.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_Lighting.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\Lighting.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\Lighting.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Lighting/scripts/Demo_Lighting_vc8.vcproj.user
===================================================================
--- /Samples/Lighting/scripts/Demo_Lighting_vc8.vcproj.user	(revision 5)
+++ /Samples/Lighting/scripts/Demo_Lighting_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/Lighting/src/Lighting.cpp
===================================================================
--- /Samples/Lighting/src/Lighting.cpp	(revision 5)
+++ /Samples/Lighting/src/Lighting.cpp	(revision 5)
@@ -0,0 +1,57 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        Lighting.cpp
+    \brief
+        Shows lighting support in OGRE.
+*/
+
+#include "Lighting.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+    // Create application object
+    LightingApplication app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/Lighting/src/Makefile.am
===================================================================
--- /Samples/Lighting/src/Makefile.am	(revision 5)
+++ /Samples/Lighting/src/Makefile.am	(revision 5)
@@ -0,0 +1,7 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Lighting/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = Lighting
+
+Lighting_SOURCES = Lighting.cpp
+Lighting_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Lighting_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/Lighting/src/Makefile.in
===================================================================
--- /Samples/Lighting/src/Makefile.in	(revision 5)
+++ /Samples/Lighting/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = Lighting$(EXEEXT)
+subdir = Samples/Lighting/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_Lighting_OBJECTS = Lighting.$(OBJEXT)
+Lighting_OBJECTS = $(am_Lighting_OBJECTS)
+am__DEPENDENCIES_1 =
+Lighting_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Lighting_SOURCES)
+DIST_SOURCES = $(Lighting_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Lighting/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+Lighting_SOURCES = Lighting.cpp
+Lighting_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Lighting_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Lighting/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Lighting/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+Lighting$(EXEEXT): $(Lighting_OBJECTS) $(Lighting_DEPENDENCIES) 
+	@rm -f Lighting$(EXEEXT)
+	$(CXXLINK) $(Lighting_LDFLAGS) $(Lighting_OBJECTS) $(Lighting_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Lighting.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Makefile.am
===================================================================
--- /Samples/Makefile.am	(revision 5)
+++ /Samples/Makefile.am	(revision 5)
@@ -0,0 +1,12 @@
+SUBDIRS = Common
+
+if OGRE_BUILDING_DEMOS
+ SUBDIRS += SkeletalAnimation BezierPatch EnvMapping Transpacency Lighting \
+            ParticleFX TextureFX SkyDome BSP SkyPlane SkyBox CameraTrack Terrain \
+            RenderToTexture Water CubeMapping Dot3Bump Smoke CelShading Fresnel \
+            DynTex VolumeTex Grass DeferredShading
+
+if HAVE_CEGUI
+ SUBDIRS += Gui FacialAnimation OceanDemo Compositor Shadows Instancing
+endif
+endif
Index: /Samples/Makefile.in
===================================================================
--- /Samples/Makefile.in	(revision 5)
+++ /Samples/Makefile.in	(revision 5)
@@ -0,0 +1,555 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+@OGRE_BUILDING_DEMOS_TRUE@am__append_1 = SkeletalAnimation BezierPatch EnvMapping Transpacency Lighting \
+@OGRE_BUILDING_DEMOS_TRUE@            ParticleFX TextureFX SkyDome BSP SkyPlane SkyBox CameraTrack Terrain \
+@OGRE_BUILDING_DEMOS_TRUE@            RenderToTexture Water CubeMapping Dot3Bump Smoke CelShading Fresnel \
+@OGRE_BUILDING_DEMOS_TRUE@            DynTex VolumeTex Grass DeferredShading
+
+@HAVE_CEGUI_TRUE@@OGRE_BUILDING_DEMOS_TRUE@am__append_2 = Gui FacialAnimation OceanDemo Compositor Shadows Instancing
+subdir = Samples
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = Common SkeletalAnimation BezierPatch EnvMapping \
+	Transpacency Lighting ParticleFX TextureFX SkyDome BSP \
+	SkyPlane SkyBox CameraTrack Terrain RenderToTexture Water \
+	CubeMapping Dot3Bump Smoke CelShading Fresnel DynTex VolumeTex \
+	Grass DeferredShading Gui FacialAnimation OceanDemo Compositor \
+	Shadows Instancing
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = Common $(am__append_1) $(am__append_2)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Media/DeferredShadingMedia/COPYING
===================================================================
--- /Samples/Media/DeferredShadingMedia/COPYING	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/COPYING	(revision 5)
@@ -0,0 +1,18 @@
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_notex_ps.glsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_notex_ps.glsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_notex_ps.glsl	(revision 5)
@@ -0,0 +1,54 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Single colour normal mapped
+*/
+
+#extension GL_ARB_draw_buffers : enable
+
+varying vec3 normal;
+varying vec3 tangent_;
+varying vec3 binormal;
+
+varying vec2 texCoord0;
+varying float depth;
+
+uniform sampler2D normTex;
+
+uniform float specularity;
+uniform vec3 colour;
+
+void main()                    
+{
+	// Frame for normal mapping
+	mat3 rotation = mat3(tangent_, binormal, normal);
+	vec3 texnormal = (vec3(texture2D(normTex, texCoord0))-0.5)*2.0;
+	
+   	gl_FragData[0].rgb = colour;
+	gl_FragData[0].a = specularity;
+	// rotation*texnormal is reversed for GL because matrices are stored transposed internally
+	// compared to HLSL
+	gl_FragData[1].xyz = normalize(rotation*texnormal); // Do normalisation here, saves an operation per light
+	gl_FragData[1].w = depth;
+	
+}
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_ps.glsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_ps.glsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_ps.glsl	(revision 5)
@@ -0,0 +1,52 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Textured normal mapped
+*/
+
+#extension GL_ARB_draw_buffers : enable
+
+varying vec3 normal;
+varying vec3 tangent_;
+varying vec3 binormal;
+
+varying vec2 texCoord0;
+varying float depth;
+uniform sampler2D tex0;
+uniform sampler2D normTex;
+
+uniform float specularity;
+
+void main()                    
+{
+	// Frame for normal mapping
+	mat3 rotation = mat3(tangent_, binormal, normal);
+	vec3 texnormal = (vec3(texture2D(normTex, texCoord0))-0.5)*2.0;
+	
+   	gl_FragData[0].rgb = vec3(texture2D(tex0, texCoord0));
+	gl_FragData[0].a = specularity;
+	// rotation*texnormal is reversed for GL because matrices are stored transposed internally
+	// compared to HLSL
+	gl_FragData[1].xyz = normalize(rotation*texnormal); // Do normalisation here, saves an operation per light
+	gl_FragData[1].w = depth;
+}
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_vs.glsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_vs.glsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_vs.glsl	(revision 5)
@@ -0,0 +1,47 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Normal mapped
+*/
+varying vec3 normal;
+varying vec3 tangent_;
+varying vec3 binormal;
+
+varying vec2 texCoord0;
+varying float depth;
+
+attribute vec3 tangent;
+
+void main()                    
+{
+   vec4 projPos = gl_ModelViewProjectionMatrix * gl_Vertex;
+   
+   gl_Position = projPos;
+   depth = projPos.w;
+   texCoord0 = vec2(gl_MultiTexCoord0);
+   
+   normal = vec3(gl_ModelViewMatrix*vec4(gl_Normal,0));
+   tangent_ = vec3(gl_ModelViewMatrix*vec4(tangent,0));
+   binormal = cross(normal, tangent_);
+   
+}
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/notex_ps.glsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/notex_ps.glsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/notex_ps.glsl	(revision 5)
@@ -0,0 +1,42 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Single colour phong
+*/
+
+#extension GL_ARB_draw_buffers : enable
+
+varying vec3 normal;
+varying vec2 texCoord0;
+varying float depth;
+
+uniform float specularity;
+uniform vec3 colour;
+
+void main()                    
+{
+   	gl_FragData[0].rgb = colour;
+	gl_FragData[0].a = specularity;
+	gl_FragData[1].xyz = normalize(normal); // Do normalisation here, saves an operation per light
+	gl_FragData[1].w = depth;
+}
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/ps.glsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/ps.glsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/ps.glsl	(revision 5)
@@ -0,0 +1,42 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Textured phongs
+*/
+
+#extension GL_ARB_draw_buffers : enable
+
+varying vec3 normal;
+varying vec2 texCoord0;
+varying float depth;
+
+uniform sampler2D Tex0;
+uniform float specularity;
+
+void main()                    
+{
+   	gl_FragData[0].rgb = vec3(texture2D(Tex0, texCoord0));
+	gl_FragData[0].a = specularity;
+	gl_FragData[1].xyz = normalize(normal); // Do normalisation here, saves an operation per light
+	gl_FragData[1].w = depth;
+}
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/vs.glsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/vs.glsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/vs.glsl	(revision 5)
@@ -0,0 +1,40 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Phong material vertex shader
+*/
+varying vec3 normal;
+varying vec2 texCoord0;
+varying float depth;
+
+void main()                    
+{
+
+   vec4 projPos = gl_ModelViewProjectionMatrix * gl_Vertex;
+   
+   gl_Position = projPos;
+   depth = projPos.w;
+   texCoord0 = vec2(gl_MultiTexCoord0);
+   
+   normal = vec3(gl_ModelViewMatrix*vec4(gl_Normal,0));
+}
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_notex_ps.hlsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_notex_ps.hlsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_notex_ps.hlsl	(revision 5)
@@ -0,0 +1,56 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Single colour normal mapped
+*/
+sampler Tex0: register(s0);
+
+struct OUTPUT
+{
+	float4 color0 : COLOR0; // Diffuse color + ?
+	float4 color1 : COLOR1; // Normal + depth
+};
+
+float3 colour;
+float specularity;
+
+OUTPUT main(
+	float3 normal: TEXCOORD0,
+	float4 texCoord0: TEXCOORD1,
+	float depth: TEXCOORD2,
+	float3 tangent: TEXCOORD3,
+	float3 binormal: TEXCOORD4
+)
+{
+	OUTPUT output;
+	// Frame for normal mapping
+	float3x3 rotation = float3x3(tangent, binormal, normal);
+	float3 texnormal = (tex2D(Tex0, texCoord0)-0.5)*2;
+	
+	output.color0.rgb = colour;
+	output.color0.a = specularity;
+	output.color1.xyz = normalize(mul(texnormal,rotation)); // Do normalisation here, saves an operation per light
+	output.color1.w = depth;
+	
+	return output;
+}
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_ps.hlsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_ps.hlsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_ps.hlsl	(revision 5)
@@ -0,0 +1,56 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Textured normal mapped
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+struct OUTPUT
+{
+	float4 color0 : COLOR0; // Diffuse color + ?
+	float4 color1 : COLOR1; // Normal + depth
+};
+
+float specularity;
+
+OUTPUT main(
+	float3 normal: TEXCOORD0,
+	float4 texCoord0: TEXCOORD1,
+	float depth: TEXCOORD2,
+	float3 tangent: TEXCOORD3,
+	float3 binormal: TEXCOORD4
+)
+{
+	OUTPUT output;
+	// Frame for normal mapping
+	float3x3 rotation = float3x3(tangent, binormal, normal);
+	float3 texnormal = (tex2D(Tex1, texCoord0)-0.5)*2;
+	
+	output.color0.rgb = tex2D(Tex0, texCoord0);
+	output.color0.a = specularity;
+	output.color1.xyz = normalize(mul(texnormal,rotation)); // Do normalisation here, saves an operation per light
+	output.color1.w = depth;
+	
+	return output;
+}
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_vs.hlsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_vs.hlsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_vs.hlsl	(revision 5)
@@ -0,0 +1,61 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Normal mapped
+*/
+struct VS_OUTPUT {
+   float4 pos: POSITION;
+   float4 normal: TEXCOORD0;
+   float2 texCoord0: TEXCOORD1;
+   float depth: TEXCOORD2;
+   float3 tangent: TEXCOORD3;
+   float3 binormal: TEXCOORD4;
+};
+
+float4x4 worldViewProj;
+float4x4 world;
+float4x4 worldView;
+
+VS_OUTPUT main(
+	float4 Pos: POSITION, 
+	float3 normal: NORMAL,
+	float2 texCoord0: TEXCOORD0,
+	float3 tangent: TANGENT0
+){
+   VS_OUTPUT Out;
+   
+   Out.normal = mul(worldView, normal);
+   float4 projPos = mul(worldViewProj, Pos);
+   
+   Out.tangent = mul(worldView, tangent);
+   Out.binormal = cross(Out.normal, Out.tangent);
+   
+   Out.pos = projPos;
+   Out.texCoord0 = texCoord0;
+   Out.depth = projPos.w;
+   //Out.depth = projPos.z/projPos.w;
+
+   return Out;
+}
+
+
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/notex_ps.hlsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/notex_ps.hlsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/notex_ps.hlsl	(revision 5)
@@ -0,0 +1,47 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Single colour phong
+*/
+struct OUTPUT
+{
+	float4 color0 : COLOR0; // Diffuse color
+	float4 color1 : COLOR1; // Position
+};
+
+float3 colour;
+float specularity;
+
+OUTPUT main(
+	float4 normal: TEXCOORD0,
+	float4 texCoord0: TEXCOORD1,
+	float depth: TEXCOORD2
+)
+{
+	OUTPUT output;
+	output.color0.rgb = colour;
+	output.color0.a = specularity;
+	output.color1.xyz = normal;
+	output.color1.w = depth;
+	return output;
+}
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/ps.hlsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/ps.hlsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/ps.hlsl	(revision 5)
@@ -0,0 +1,48 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Textured phongs
+*/
+sampler Tex0: register(s0);
+
+struct OUTPUT
+{
+	float4 color0 : COLOR0; // Diffuse color
+	float4 color1 : COLOR1; // Position
+};
+
+float specularity;
+
+OUTPUT main(
+	float4 normal: TEXCOORD0,
+	float4 texCoord0: TEXCOORD1,
+	float depth: TEXCOORD2
+)
+{
+	OUTPUT output;
+	output.color0.rgb = tex2D(Tex0, texCoord0);
+	output.color0.a = specularity;
+	output.color1.xyz = normalize(normal); // Do normalisation here, saves an operation per light
+	output.color1.w = depth;
+	return output;
+}
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/vs.hlsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/vs.hlsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/material/hlsl/vs.hlsl	(revision 5)
@@ -0,0 +1,54 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Phong material vertex shader
+*/
+struct VS_OUTPUT {
+   float4 pos: POSITION;
+   float4 normal: TEXCOORD0;
+   float2 texCoord0: TEXCOORD1;
+   float1 depth: TEXCOORD2;
+};
+
+float4x4 worldViewProj;
+float4x4 world;
+float4x4 worldView;
+
+VS_OUTPUT main(
+	float4 Pos: POSITION, 
+	float3 Normal: NORMAL,
+	float2 texCoord0: TEXCOORD0
+){
+   VS_OUTPUT Out;
+   
+   Out.normal = mul(worldView, Normal);
+   float4 projPos = mul(worldViewProj, Pos);
+   Out.pos = projPos;
+   Out.texCoord0 = texCoord0;
+   Out.depth = projPos.w;
+   //Out.depth = projPos.z/projPos.w;
+
+   return Out;
+}
+
+
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/Ambient_ps.glsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/Ambient_ps.glsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/Ambient_ps.glsl	(revision 5)
@@ -0,0 +1,56 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Multipass, ambient (base) pass
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+uniform mat4 proj;
+
+uniform vec3 ambientColor;
+
+void main()
+{
+	vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+    
+    // Clip fragment if depth is too far, so the skybox can be rendered on the background
+    if(a1.w==0.0)
+		discard;
+      
+    // Attributes
+    vec3 colour = a0.rgb;
+    float alpha = a0.a;		// Specularity
+    float distance = a1.w;  // Distance from viewer -- is zero if no lighting wanted
+    
+	// Calculate ambient colour of fragment
+    gl_FragColor = vec4( ambientColor*colour ,0);
+    
+    // Calculate depth of fragment; GL requires a 2.0* here as the range is [-1, 1]
+    // Also, see again how matrix is transposed ([3][2] instead of [2][3])
+    gl_FragDepth = projCoord.z*proj[2][2] + proj[3][2]/(2.0*distance);
+}
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/GlobalLight_ps.glsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/GlobalLight_ps.glsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/GlobalLight_ps.glsl	(revision 5)
@@ -0,0 +1,96 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Multipass, one light
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+// Attributes of light
+uniform vec4 lightPos0;
+uniform vec3 lightDiffuseColor0;
+uniform vec3 lightSpecularColor0;
+
+// Global parameters for lights
+struct LightGlobal
+{
+	vec3 position;
+	vec3 normal;
+	vec3 viewDir;
+};
+
+// Current state of light
+struct LightAccum
+{
+	vec3 light_diffuse;
+	vec3 light_specular;
+};
+
+// Do lighting calculations for one light
+void processLight(
+	inout LightAccum accum,
+	LightGlobal global,
+	vec4 lightPos,
+	vec3 lightDiffuseColor,
+	vec3 lightSpecularColor)
+{
+    vec3 lightVec = vec3(lightPos) - global.position;
+    vec3 lightDir = normalize(lightVec);
+    accum.light_diffuse += max(0.0,dot(lightDir, global.normal)) * lightDiffuseColor;
+    
+    vec3 h = normalize(global.viewDir + lightDir);
+    accum.light_specular += pow(dot(global.normal, h),32.0) * lightSpecularColor;
+}
+
+void main()
+{
+	vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+      
+    // Attributes
+    vec3 colour = a0.rgb;
+    float alpha = a0.a;		// Specularity
+    float distance = a1.w;  // Distance from viewer -- is zero if no lighting wanted
+    
+    LightGlobal global;
+    global.normal = a1.xyz;
+	global.position = projCoord*distance;
+    
+    // Apply light
+    LightAccum accum;
+    accum.light_diffuse = vec3(0,0,0);
+    accum.light_specular = vec3(0,0,0);
+    global.viewDir = -normalize(global.position);
+    
+    processLight(accum, global, lightPos0, lightDiffuseColor0, lightSpecularColor0);
+    
+    // Calcalate total lighting for this fragment
+    vec3 total_light_contrib;
+	total_light_contrib = accum.light_diffuse+alpha*accum.light_specular;
+	
+	// Calculate colour of fragment
+    gl_FragColor = vec4( total_light_contrib*colour ,0);
+}
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_ps.glsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_ps.glsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_ps.glsl	(revision 5)
@@ -0,0 +1,85 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Light geometry material
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+// World view matrix to get object position in view space
+uniform mat4 worldView;
+
+// Attributes of light
+uniform vec3 lightDiffuseColor;
+uniform vec3 lightSpecularColor;
+uniform vec3 lightFalloff;
+
+void main()
+{
+	vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+
+    // Attributes
+    vec3 colour = a0.rgb;
+    float alpha = a0.a;		// Specularity
+    float distance = a1.w;  // Distance from viewer (w)
+    vec3 normal = a1.xyz;
+
+	// Calculate position of texel in view space
+    vec3 position = projCoord*distance;
+	
+	// Extract position in view space from worldView matrix
+	//vec3 lightPos = vec3(worldView[0][3],worldView[1][3],worldView[2][3]);
+	vec3 lightPos = vec3(worldView[3][0],worldView[3][1],worldView[3][2]);
+	
+    // Calculate light direction and distance
+    vec3 lightVec = lightPos - position;
+    float len_sq = dot(lightVec, lightVec);
+    float len = sqrt(len_sq);
+    vec3 lightDir = lightVec/len;
+    
+    /// Calculate attenuation    
+    float attenuation = dot(lightFalloff, vec3(1, len, len_sq));
+    
+    /// Calculate diffuse colour
+    vec3 light_diffuse = max(0.0,dot(lightDir, normal)) * lightDiffuseColor;
+    
+    /// Calculate specular component
+    vec3 viewDir = -normalize(position);
+    vec3 h = normalize(viewDir + lightDir);
+    vec3 light_specular = pow(dot(normal, h),32.0) * lightSpecularColor;
+    
+    // Calcalate total lighting for this fragment
+    vec3 total_light_contrib;
+    total_light_contrib = light_diffuse;
+	// Uncomment next line if specular desired
+	//total_light_contrib += alpha * light_specular;
+	
+    gl_FragColor = vec4(total_light_contrib*colour/attenuation, 0);
+    //gl_FragColor = vec4(1.0/attenuation, 0.0,0.0,0.0);
+    //gl_FragColor = vec4(a1.xyz,  0.0);
+}
+
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_vs.glsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_vs.glsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_vs.glsl	(revision 5)
@@ -0,0 +1,61 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Light geometry material
+*/
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+uniform float vpWidth;
+uniform float vpHeight;
+uniform mat4 invProj;
+
+void main()                    
+{
+   vec4 projPos = gl_ModelViewProjectionMatrix * gl_Vertex;
+   projPos = projPos/projPos.w;
+   
+   // projPos is now in nonhomogeneous 2d space -- this makes sure no perspective interpolation is
+   // done that could mess with our concept.
+   //gl_Position = projPos;
+   vec2 texSize = vec2(vpWidth, vpHeight);
+   vec2 tcTemp = vec2(projPos[0], projPos[1])/2.0+0.5;
+   tcTemp = (floor(tcTemp * texSize)+0.5)/texSize;
+   
+   //float3 position = mul(invProj, float4(projCoord, 0, 1))*distance; 
+   // Acquire view space position via inverse projection transformation
+   // Optimisation for perspective, symmetric view frustrums 
+   // These interpolate over the frustrum plane for w=1
+   
+   projCoord = vec3(projPos[0], projPos[1], 1)*vec3(
+		invProj[0][0], // X vector component from X
+		invProj[1][1], // Y vector component from Y
+		invProj[3][2]  // Z vector component from W
+   );
+   
+   //projCoord = vec3(invProj*vec4(projPos[0], projPos[1], 0, 1));
+   
+   // Texture coordinate magic, this compensates for jitter
+   texCoord = vec2(tcTemp[0], 1.0-tcTemp[1]);   
+   gl_Position = vec4((tcTemp-0.5)*2.0, 0.0, 1.0);
+}
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowColour_ps.glsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowColour_ps.glsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowColour_ps.glsl	(revision 5)
@@ -0,0 +1,39 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Debug, show colour channel
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+void main()
+{
+	vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+    
+    gl_FragColor=vec4(a0.xyz, 0);
+}
+
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowDS_ps.glsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowDS_ps.glsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowDS_ps.glsl	(revision 5)
@@ -0,0 +1,39 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Debug, show depth and specularity channel
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+void main()
+{
+    vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+    
+    gl_FragColor=vec4(a0.w, 0, a1.w/1000.0, 0);
+}
+
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowNormal_ps.glsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowNormal_ps.glsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowNormal_ps.glsl	(revision 5)
@@ -0,0 +1,39 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Debug, show normal channel
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+void main()
+{
+	vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+    
+    gl_FragColor=vec4((a1.xyz+vec3(1))*0.5,0);
+}
+
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/SinglePass_ps.glsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/SinglePass_ps.glsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/SinglePass_ps.glsl	(revision 5)
@@ -0,0 +1,111 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Single pass
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+uniform mat4 proj;
+
+uniform vec3 ambientColor;
+// Attributes of light 0
+uniform vec4 lightPos0;
+uniform vec3 lightDiffuseColor0;
+uniform vec3 lightSpecularColor0;
+// Attributes of light 1
+uniform vec4 lightPos1;
+uniform vec3 lightDiffuseColor1;
+uniform vec3 lightSpecularColor1;
+
+// Global parameters for lights
+struct LightGlobal
+{
+	vec3 position;
+	vec3 normal;
+	vec3 viewDir;
+};
+
+// Current state of light
+struct LightAccum
+{
+	vec3 light_diffuse;
+	vec3 light_specular;
+};
+
+// Do lighting calculations for one light
+void processLight(
+	inout LightAccum accum,
+	LightGlobal global,
+	vec4 lightPos,
+	vec3 lightDiffuseColor,
+	vec3 lightSpecularColor)
+{
+    vec3 lightVec = vec3(lightPos) - global.position;
+    vec3 lightDir = normalize(lightVec);
+    accum.light_diffuse += max(0.0,dot(lightDir, global.normal)) * lightDiffuseColor;
+    
+    vec3 h = normalize(global.viewDir + lightDir);
+    accum.light_specular += pow(dot(global.normal, h),32.0) * lightSpecularColor;
+}
+
+void main()
+{
+	vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+    
+    // Clip fragment if depth is too far, so the skybox can be rendered on the background
+    if(a1.w==0.0)
+		discard;
+      
+    // Attributes
+    vec3 colour = a0.rgb;
+    float alpha = a0.a;		// Specularity
+    float distance = a1.w;  // Distance from viewer -- is zero if no lighting wanted
+    
+    LightGlobal global;
+    global.normal = a1.xyz;
+	global.position = projCoord*distance;
+    
+    // Apply light
+    LightAccum accum;
+    accum.light_diffuse = vec3(0,0,0);
+    accum.light_specular = vec3(0,0,0);
+    global.viewDir = -normalize(global.position);
+    
+    processLight(accum, global, lightPos0, lightDiffuseColor0, lightSpecularColor0);
+    processLight(accum, global, lightPos1, lightDiffuseColor1, lightSpecularColor1);
+    
+    // Calcalate total lighting for this fragment
+    vec3 total_light_contrib;
+	total_light_contrib = ambientColor+accum.light_diffuse+alpha*accum.light_specular;
+	
+	// Calculate colour of fragment
+    gl_FragColor = vec4( total_light_contrib*colour ,0);
+    
+    // Calculate depth of fragment; GL requires a 2.0* here as the range is [-1, 1]
+    gl_FragDepth = projCoord.z*proj[2][2] + proj[3][2]/(2.0*distance);
+}
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/vs.glsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/vs.glsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/glsl/vs.glsl	(revision 5)
@@ -0,0 +1,42 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Generic fullscreen quad
+*/
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+uniform mat4 invProj;
+
+void main()                    
+{
+	vec2 inPos = sign(gl_Vertex.xy);
+	gl_Position = vec4(inPos.xy, 0.0, 1.0);
+	
+	texCoord  = (vec2(inPos.x, -inPos.y) + 1.0)/2.0;
+   
+	// Projection coordinates
+	// Inverted projection matrix
+	// These interpolate over the frustrum plane for w=1
+    projCoord = vec3(invProj*vec4(inPos.x, inPos.y, 0, 1));
+}
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/Ambient_ps.hlsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/Ambient_ps.hlsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/Ambient_ps.hlsl	(revision 5)
@@ -0,0 +1,55 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Multipass, ambient (base) pass
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+// Ambient and depth pass
+float4 ambientColor;
+
+float4x4 proj;
+
+struct POUTPUT
+{
+	float4 colour: COLOR;
+	float depth: DEPTH;
+};
+
+POUTPUT main(float2 texCoord: TEXCOORD0, float3 projCoord: TEXCOORD1)
+{
+    float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+    
+    // Clip fragment if depth is too close, so the skybox can be rendered on the background
+    clip(a1.w-0.001);
+      
+    // Attributes
+    POUTPUT o;
+    float3 colour = a0.rgb;
+    o.colour = float4( ambientColor*colour ,0);
+    o.depth = projCoord.z*proj[2][2] + proj[2][3]/a1.w;
+    return o;
+}
+
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/GlobalLight_ps.hlsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/GlobalLight_ps.hlsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/GlobalLight_ps.hlsl	(revision 5)
@@ -0,0 +1,101 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Multipass, one light
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+// Attributes of light 0
+float4 lightPos0;
+float4 lightDiffuseColor0;
+float4 lightSpecularColor0;
+
+// Global parameters for lights
+struct LightGlobal
+{
+	float3 position;
+	float3 normal;
+	float3 viewDir;
+};
+
+// Current state of light
+struct LightAccum
+{
+	float3 light_diffuse;
+	float3 light_specular;
+};
+
+// Do lighting calculations for one light
+void processLight(
+	inout LightAccum accum,
+	LightGlobal global,
+	float4 lightPos,
+	float4 lightDiffuseColor,
+	float4 lightSpecularColor)
+{
+    float3 lightVec = lightPos - global.position;
+    float3 lightDir = normalize(lightVec);
+    accum.light_diffuse += max(0,dot(lightDir, global.normal)) * lightDiffuseColor;
+    
+    float3 h = normalize(global.viewDir + lightDir);
+    accum.light_specular += pow(dot(global.normal, h),32) * lightSpecularColor;
+}
+
+float4 main(float2 texCoord: TEXCOORD0, float3 projCoord: TEXCOORD1) : COLOR 
+{
+    float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+    
+    LightGlobal global; 
+    
+    // Clip fragment if depth is too close, so the skybox can be rendered on the background
+    //clip(a1.w-0.001);
+      
+    // Attributes
+    float3 colour = a0.rgb;
+    float alpha = a0.a;		// Specularity
+    float distance = a1.w;  // Distance from viewer
+    //global.normal = normalize(a1.xyz);
+    global.normal = a1.xyz;
+
+    // Acquire view space position via inverse projection transformation
+    //global.position = mul(invProj, float4(projCoord, 0, 1))*distance;
+    global.position = projCoord*distance;
+    
+    // Apply light
+    LightAccum accum;
+    accum.light_diffuse = float3(0,0,0);
+    accum.light_specular = float3(0,0,0);
+    global.viewDir = -normalize(global.position);
+    
+    processLight(accum, global, lightPos0, lightDiffuseColor0, lightSpecularColor0);
+    
+    // Calcalate total lighting for this fragment
+    float3 total_light_contrib;
+	total_light_contrib = accum.light_diffuse+alpha*accum.light_specular;
+    return float4( total_light_contrib*colour ,0);
+    //return float4(accum.light_diffuse,0);
+    //return float4(global.position/1000.0,0);
+}
+
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_ps.hlsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_ps.hlsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_ps.hlsl	(revision 5)
@@ -0,0 +1,89 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Light geometry material
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+float4x4 worldView;
+
+// Attributes of light
+float4 lightDiffuseColor;
+float4 lightSpecularColor;
+float4 lightFalloff;
+
+float4 main(float2 texCoord: TEXCOORD0, float3 projCoord: TEXCOORD1) : COLOR 
+{
+	float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+
+    // Attributes
+    float3 colour = a0.rgb;
+    float alpha = a0.a;		// Specularity
+    float distance = a1.w;  // Distance from viewer (w)
+    float3 normal = a1.xyz;
+
+	// Calculate position of texel in view space
+    float3 position = projCoord*distance;
+	
+	// Extract position in view space from worldView matrix
+	float3 lightPos = float3(worldView[0][3],worldView[1][3],worldView[2][3]);
+	
+    // Calculate light direction and distance
+    float3 lightVec = lightPos - position;
+    float len_sq = dot(lightVec, lightVec);
+    float len = sqrt(len_sq);
+    float3 lightDir = lightVec/len;
+    
+    /// Calculate attenuation    
+    float attenuation = dot(lightFalloff, float3(1, len, len_sq));
+    
+    /// Calculate diffuse colour
+    float3 light_diffuse = max(0,dot(lightDir, normal)) * lightDiffuseColor;
+    
+    /// Calculate specular component
+    float3 viewDir = -normalize(position);
+    float3 h = normalize(viewDir + lightDir);
+    float3 light_specular = pow(dot(normal, h),32) * lightSpecularColor;
+    
+    // Calcalate total lighting for this fragment
+    float3 total_light_contrib;
+    total_light_contrib = light_diffuse;
+	// Uncomment next line if specular desired
+	//total_light_contrib += alpha * light_specular;
+	
+    return float4(total_light_contrib*colour/attenuation, 0);
+}
+// Debugging only
+    //return lightDiffuseColor;
+    //return lightDiffuseColor/attenuation;
+    //return float4(abs(position-position2),0);
+    //return length(lightPos-position)/1000.0;
+    //return float4(abs(lightPos-lightPos2),0);
+    //return float4(lightPos-position,0);
+    //return float4(-global.position/1000.0f,0);
+    //return float4(global.position/1000.0,0);
+    ///return float4(lightPos[0], lightPos[1], -lightPos[2], 0)/1000.0f;
+    //return lightDiffuseColor*a0.xyzw/2;
+
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_vs.hlsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_vs.hlsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_vs.hlsl	(revision 5)
@@ -0,0 +1,69 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Light geometry material
+*/
+struct VS_OUTPUT {
+   float4 pos: POSITION;
+   float2 texCoord: TEXCOORD0;
+   float3 projCoord: TEXCOORD1;
+};
+
+uniform float vpWidth, vpHeight;
+uniform float4x4 worldViewProj;
+uniform float4x4 invProj;
+
+VS_OUTPUT main(
+	float4 Pos: POSITION
+){
+   VS_OUTPUT Out;
+   
+   float4 projPos = mul(worldViewProj, Pos);
+   projPos = projPos/projPos.w;
+   //projPos[2] = 0;
+
+   // projPos is now in nonhomogeneous 2d space -- this makes sure no perspective interpolation is
+   // done that could mess with our concept.
+   Out.pos = projPos;
+   
+   //float3 position = mul(invProj, float4(projCoord, 0, 1))*distance; 
+   // Acquire view space position via inverse projection transformation
+   // Optimisation for perspective, symmetric view frustrums 
+   // These interpolate over the frustrum plane for w=1
+   Out.projCoord = float3(projPos[0], projPos[1], 1)*float3(
+		invProj[0][0], // X vector component from X
+		invProj[1][1], // Y vector component from Y
+		invProj[2][3]  // Z vector component from W
+   );
+   
+   // Texture coordinate magic, this compensates for jitter
+   float2 texCoord = float2(projPos[0]/2+0.5, -projPos[1]/2+0.5);
+   float2 texSize = float2(vpWidth, vpHeight);
+   texCoord = floor(texCoord * texSize)/texSize;
+   Out.texCoord = texCoord;
+   
+
+   return Out;
+}
+
+
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowColour_ps.hlsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowColour_ps.hlsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowColour_ps.hlsl	(revision 5)
@@ -0,0 +1,36 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Debug, show colour channel
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+float4 main(float2 texCoord: TEXCOORD0, float2 projCoord: TEXCOORD1) : COLOR 
+{
+    float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+    
+    return float4(a0.xyz, 0);
+}
+
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowDS_ps.hlsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowDS_ps.hlsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowDS_ps.hlsl	(revision 5)
@@ -0,0 +1,36 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Debug, show depth and specularity channel
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+float4 main(float2 texCoord: TEXCOORD0, float2 projCoord: TEXCOORD1) : COLOR 
+{
+    float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+    
+    return float4(a0.w, 0, a1.w/1000.0, 0);
+}
+
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowNormal_ps.hlsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowNormal_ps.hlsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowNormal_ps.hlsl	(revision 5)
@@ -0,0 +1,38 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Debug, show normal channel
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+float4 main(float2 texCoord: TEXCOORD0, float2 projCoord: TEXCOORD1) : COLOR 
+{
+    float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+    
+    return float4((a1.xyz+1)*0.5,0);
+    //float d=dot(a1.xyz,float3(0,0,1))*2.0+0.5;
+    //return float4(1,0,0,0)*d+float4(0,0,1,0)*(1-d);
+}
+
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/SinglePass_ps.hlsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/SinglePass_ps.hlsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/SinglePass_ps.hlsl	(revision 5)
@@ -0,0 +1,132 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Single pass
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+float4x4 proj;
+
+float4 ambientColor;
+// Attributes of light 0
+float4 lightPos0;
+float4 lightDiffuseColor0;
+float4 lightSpecularColor0;
+// Attributes of light 1
+float4 lightPos1;
+float4 lightDiffuseColor1;
+float4 lightSpecularColor1;
+
+// Global parameters for lights
+struct LightGlobal
+{
+	float3 position;
+	float3 normal;
+	float3 viewDir;
+};
+
+// Current state of light
+struct LightAccum
+{
+	float3 light_diffuse;
+	float3 light_specular;
+};
+
+// Do lighting calculations for one light
+void processLight(
+	inout LightAccum accum,
+	LightGlobal global,
+	float4 lightPos,
+	float4 lightDiffuseColor,
+	float4 lightSpecularColor)
+{
+    float3 lightVec = lightPos - global.position;
+    float3 lightDir = normalize(lightVec);
+    accum.light_diffuse += max(0,dot(lightDir, global.normal)) * lightDiffuseColor;
+    
+    float3 h = normalize(global.viewDir + lightDir);
+    accum.light_specular += pow(dot(global.normal, h),32) * lightSpecularColor;
+}
+
+struct POUTPUT
+{
+	float4 colour: COLOR;
+	float depth: DEPTH;
+};
+
+POUTPUT main(float2 texCoord: TEXCOORD0, float3 projCoord: TEXCOORD1)
+{
+	POUTPUT o;
+	
+    float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+    
+    LightGlobal global; 
+    
+    // Clip fragment if depth is too far, so the skybox can be rendered on the background
+    clip(a1.w-0.001);
+      
+    // Attributes
+    float3 colour = a0.rgb;
+    float alpha = a0.a;		// Specularity
+    float distance = a1.w;  // Distance from viewer -- is zero if no lighting wanted
+    //global.normal = normalize(a1.xyz); // normalizing done already
+    global.normal = a1.xyz;
+
+    // Acquire view space position via inverse projection transformation
+    //global.position = mul(invProj, float4(projCoord, 0, 1))*distance;
+    // Acquire view space position via inverse projection transformation
+    //float4 tpos;
+    //tpos = float4(projCoord, distance, 1.0);
+    //tpos = mul(invProj, tpos);
+    //tpos = tpos / tpos.w;
+    //global.position = tpos;
+    //global.position = float3(
+	//	invProj[0][0], // X vector component from X
+	//	invProj[1][1], // Y vector component from Y
+	//	invProj[2][3]  // Z vector component from W
+	//)*projCoord*distance;
+	global.position = projCoord*distance;
+    
+    // Apply light
+    LightAccum accum;
+    accum.light_diffuse = float3(0,0,0);
+    accum.light_specular = float3(0,0,0);
+    global.viewDir = -normalize(global.position);
+    
+    processLight(accum, global, lightPos0, lightDiffuseColor0, lightSpecularColor0);
+    processLight(accum, global, lightPos1, lightDiffuseColor1, lightSpecularColor1);
+    
+    // Calcalate total lighting for this fragment
+    float3 total_light_contrib;
+	total_light_contrib = ambientColor+accum.light_diffuse+alpha*accum.light_specular;
+	
+    o.colour = float4( total_light_contrib*colour ,0);
+    // Depth buffer value
+    // Transfering depth makes it possible to render particle effects and other transparent
+    // things unaffected by light in the postprocessing phase.
+    o.depth = projCoord.z*proj[2][2] + proj[2][3]/distance;
+    return o;
+}
+
Index: /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/vs.hlsl
===================================================================
--- /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/vs.hlsl	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/DeferredShading/post/hlsl/vs.hlsl	(revision 5)
@@ -0,0 +1,59 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Generic fullscreen quad
+*/
+struct VS_OUTPUT {
+   float4 Pos: POSITION;
+   float2 texCoord: TEXCOORD0;
+   float3 projCoord: TEXCOORD1;
+};
+float4x4 invProj;
+
+VS_OUTPUT main(float4 Pos: POSITION){
+   VS_OUTPUT Out;
+
+	// Clean up inaccuracies
+	Pos.xy = sign(Pos.xy);
+
+	Out.Pos = float4(Pos.xy, 0, 1);
+	
+	// Image-space
+	Out.texCoord.x = 0.5 * (1 + Pos.x);
+	Out.texCoord.y = 0.5 * (1 - Pos.y);
+   
+	// Projection coordinates
+	// Inverted projection matrix
+	// These interpolate over the frustrum plane for w=1
+    Out.projCoord = float3(Pos.x, Pos.y, 1) *
+		float3(
+			invProj[0][0], // X vector component from X
+			invProj[1][1], // Y vector component from Y
+			invProj[2][3]  // Z vector component from W
+		);
+
+	return Out;
+}
+
+
+
Index: /Samples/Media/DeferredShadingMedia/deferred.glsl.program
===================================================================
--- /Samples/Media/DeferredShadingMedia/deferred.glsl.program	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/deferred.glsl.program	(revision 5)
@@ -0,0 +1,50 @@
+// Materials for rendering to the fat buffer
+
+// Plain phong
+vertex_program DeferredShading/material/glsl/vs glsl
+{
+	source DeferredShading/material/glsl/vs.glsl
+}
+fragment_program DeferredShading/material/glsl/ps glsl
+{
+	source DeferredShading/material/glsl/ps.glsl
+	default_params
+	{
+		param_named specularity float 0.0
+	}
+}
+fragment_program DeferredShading/material/glsl/notex_ps glsl
+{
+	source DeferredShading/material/glsl/notex_ps.glsl
+	default_params
+	{
+		param_named specularity float 0.0
+		param_named colour float3 0.7 0.7 0.7
+	}
+}
+
+// Normal mapping
+vertex_program DeferredShading/material/glsl/nm_vs glsl
+{
+	source DeferredShading/material/glsl/nm_vs.glsl
+}
+fragment_program DeferredShading/material/glsl/nm_ps glsl
+{
+	source DeferredShading/material/glsl/nm_ps.glsl
+	default_params
+	{
+		param_named specularity float 0.0
+		param_named tex0 int 0
+		param_named normTex int 1
+	}
+}
+fragment_program DeferredShading/material/glsl/nm_notex_ps glsl
+{
+	source DeferredShading/material/glsl/nm_notex_ps.glsl
+	default_params
+	{
+		param_named colour float3 0.7 0.7 0.7
+		param_named specularity float 0.0
+		param_named normTex int 0
+	}
+}
Index: /Samples/Media/DeferredShadingMedia/deferred.hlsl.program
===================================================================
--- /Samples/Media/DeferredShadingMedia/deferred.hlsl.program	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/deferred.hlsl.program	(revision 5)
@@ -0,0 +1,70 @@
+// Materials for rendering to the fat buffer
+
+// Plain phong
+vertex_program DeferredShading/material/hlsl/vs hlsl
+{
+	source DeferredShading/material/hlsl/vs.hlsl
+	target vs_1_1
+	entry_point main
+	
+	default_params
+	{
+		param_named_auto worldView worldview_matrix
+		param_named_auto worldViewProj worldviewproj_matrix
+	}
+}
+fragment_program DeferredShading/material/hlsl/ps hlsl
+{
+	source DeferredShading/material/hlsl/ps.hlsl
+	target ps_2_0
+	entry_point main
+	default_params
+	{
+		param_named specularity float 0.0
+	}
+}
+fragment_program DeferredShading/material/hlsl/notex_ps hlsl
+{
+	source DeferredShading/material/hlsl/notex_ps.hlsl
+	target ps_2_0
+	entry_point main
+	default_params
+	{
+		param_named specularity float 0.0
+	}
+}
+
+// Normal mapping
+vertex_program DeferredShading/material/hlsl/nm_vs hlsl
+{
+	source DeferredShading/material/hlsl/nm_vs.hlsl
+	target vs_1_1
+	entry_point main
+	
+	default_params
+	{
+		param_named_auto worldView worldview_matrix
+		param_named_auto worldViewProj worldviewproj_matrix
+	}
+}
+fragment_program DeferredShading/material/hlsl/nm_ps hlsl
+{
+	source DeferredShading/material/hlsl/nm_ps.hlsl
+	target ps_2_0
+	entry_point main
+	default_params
+	{
+		param_named specularity float 0.0
+	}
+}
+fragment_program DeferredShading/material/hlsl/nm_notex_ps hlsl
+{
+	source DeferredShading/material/hlsl/nm_notex_ps.hlsl
+	target ps_2_0
+	entry_point main
+	default_params
+	{
+		param_named colour float3 0.7 0.7 0.7
+		param_named specularity float 0.0
+	}
+}
Index: /Samples/Media/DeferredShadingMedia/deferred.material
===================================================================
--- /Samples/Media/DeferredShadingMedia/deferred.material	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/deferred.material	(revision 5)
@@ -0,0 +1,152 @@
+// Materials for rendering to the fat buffer
+
+// Textured Phong shading material
+material DeferredShading/Material/TexturedPhong
+{
+	technique hlsl
+	{
+		pass main
+		{
+			vertex_program_ref DeferredShading/material/hlsl/vs
+			{
+			}
+			fragment_program_ref DeferredShading/material/hlsl/ps
+			{
+			}
+
+			texture_unit
+			{
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			vertex_program_ref DeferredShading/material/glsl/vs
+			{
+			}
+			fragment_program_ref DeferredShading/material/glsl/ps
+			{
+			}
+
+			texture_unit
+			{
+			}
+		}
+	}
+}
+
+// Untextured Phong shading material
+material DeferredShading/Material/UntexturedPhong
+{
+	technique hlsl
+	{
+		pass main
+		{
+			vertex_program_ref DeferredShading/material/hlsl/vs
+			{
+			}
+			fragment_program_ref DeferredShading/material/hlsl/notex_ps
+			{
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			vertex_program_ref DeferredShading/material/glsl/vs
+			{
+			}
+			fragment_program_ref DeferredShading/material/glsl/notex_ps
+			{
+			}
+		}
+	}
+}
+
+// Textured normal mapped material
+material DeferredShading/Material/TexturedNormalMapped
+{
+	technique hlsl
+	{
+		pass main
+		{
+			vertex_program_ref DeferredShading/material/hlsl/nm_vs
+			{
+			}
+			fragment_program_ref DeferredShading/material/hlsl/nm_ps
+			{
+			}
+
+			texture_unit
+			{
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			vertex_program_ref DeferredShading/material/glsl/nm_vs
+			{
+			}
+			fragment_program_ref DeferredShading/material/glsl/nm_ps
+			{
+			}
+
+			texture_unit
+			{
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+			}
+		}
+	}
+}
+
+// Untextured normal mapped material
+material DeferredShading/Material/UntexturedNormalMapped
+{
+	technique hlsl
+	{
+		pass main
+		{
+			vertex_program_ref DeferredShading/material/hlsl/nm_vs
+			{
+			}
+			fragment_program_ref DeferredShading/material/hlsl/nm_notex_ps
+			{
+			}
+			texture_unit
+			{
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			vertex_program_ref DeferredShading/material/glsl/nm_vs
+			{
+			}
+			fragment_program_ref DeferredShading/material/glsl/nm_notex_ps
+			{
+			}
+			texture_unit
+			{
+				tex_coord_set 0
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+			}
+		}
+	}
+}
Index: /Samples/Media/DeferredShadingMedia/deferred_post_debug.glsl.program
===================================================================
--- /Samples/Media/DeferredShadingMedia/deferred_post_debug.glsl.program	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/deferred_post_debug.glsl.program	(revision 5)
@@ -0,0 +1,27 @@
+fragment_program DeferredShading/post/glsl/ShowNormal_ps glsl
+{
+	source DeferredShading/post/glsl/ShowNormal_ps.glsl
+	default_params
+	{
+		param_named tex0 int 0
+		param_named tex1 int 1
+	}
+}
+fragment_program DeferredShading/post/glsl/ShowDS_ps glsl
+{
+	source DeferredShading/post/glsl/ShowDS_ps.glsl
+	default_params
+	{
+		param_named tex0 int 0
+		param_named tex1 int 1
+	}
+}
+fragment_program DeferredShading/post/glsl/ShowColour_ps glsl
+{
+	source DeferredShading/post/glsl/ShowColour_ps.glsl
+	default_params
+	{
+		param_named tex0 int 0
+		param_named tex1 int 1
+	}
+}
Index: /Samples/Media/DeferredShadingMedia/deferred_post_debug.hlsl.program
===================================================================
--- /Samples/Media/DeferredShadingMedia/deferred_post_debug.hlsl.program	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/deferred_post_debug.hlsl.program	(revision 5)
@@ -0,0 +1,18 @@
+fragment_program DeferredShading/post/hlsl/ShowNormal_ps hlsl
+{
+	source DeferredShading/post/hlsl/ShowNormal_ps.hlsl
+	target ps_2_0
+	entry_point main
+}
+fragment_program DeferredShading/post/hlsl/ShowDS_ps hlsl
+{
+	source DeferredShading/post/hlsl/ShowDS_ps.hlsl
+	target ps_2_0
+	entry_point main
+}
+fragment_program DeferredShading/post/hlsl/ShowColour_ps hlsl
+{
+	source DeferredShading/post/hlsl/ShowColour_ps.hlsl
+	target ps_2_0
+	entry_point main
+}
Index: /Samples/Media/DeferredShadingMedia/deferred_post_debug.material
===================================================================
--- /Samples/Media/DeferredShadingMedia/deferred_post_debug.material	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/deferred_post_debug.material	(revision 5)
@@ -0,0 +1,172 @@
+material DeferredShading/Post/ShowNormal
+{
+    technique
+    {
+    	pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			fragment_program_ref DeferredShading/post/hlsl/ShowNormal_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/hlsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+	technique
+    {
+    	pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			fragment_program_ref DeferredShading/post/glsl/ShowNormal_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/glsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
+
+material DeferredShading/Post/ShowDS
+{
+    technique
+    {
+    	pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			fragment_program_ref DeferredShading/post/hlsl/ShowDS_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/hlsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+	technique
+    {
+    	pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			fragment_program_ref DeferredShading/post/glsl/ShowDS_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/glsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
+material DeferredShading/Post/ShowColour
+{
+    technique
+    {
+    	pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			fragment_program_ref DeferredShading/post/hlsl/ShowColour_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/hlsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+	technique
+    {
+    	pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			fragment_program_ref DeferredShading/post/glsl/ShowColour_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/glsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
Index: /Samples/Media/DeferredShadingMedia/deferred_post_minilight.glsl.program
===================================================================
--- /Samples/Media/DeferredShadingMedia/deferred_post_minilight.glsl.program	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/deferred_post_minilight.glsl.program	(revision 5)
@@ -0,0 +1,26 @@
+// Auxilary lights
+vertex_program DeferredShading/post/glsl/LightMaterial_vs glsl
+{
+	source DeferredShading/post/glsl/LightMaterial_vs.glsl
+	default_params
+	{
+		param_named_auto invProj inverse_projection_matrix
+		param_named_auto vpWidth viewport_width
+		param_named_auto vpHeight viewport_height
+	}
+}
+fragment_program DeferredShading/post/glsl/LightMaterial_ps glsl
+{
+	source DeferredShading/post/glsl/LightMaterial_ps.glsl
+	default_params
+	{
+		param_named_auto worldView worldview_matrix
+		
+		param_named_auto lightDiffuseColor custom 1
+		param_named_auto lightSpecularColor custom 2
+		param_named_auto lightFalloff custom 3
+		
+		param_named tex0 int 0
+		param_named tex1 int 1
+	}
+}
Index: /Samples/Media/DeferredShadingMedia/deferred_post_minilight.hlsl.program
===================================================================
--- /Samples/Media/DeferredShadingMedia/deferred_post_minilight.hlsl.program	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/deferred_post_minilight.hlsl.program	(revision 5)
@@ -0,0 +1,29 @@
+// Auxilary lights
+vertex_program DeferredShading/post/hlsl/LightMaterial_vs hlsl
+{
+	source DeferredShading/post/hlsl/LightMaterial_vs.hlsl
+	target vs_1_1
+	entry_point main
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto invProj inverse_projection_matrix
+		param_named_auto vpWidth viewport_width
+		param_named_auto vpHeight viewport_height
+	}
+}
+fragment_program DeferredShading/post/hlsl/LightMaterial_ps hlsl
+{
+	source DeferredShading/post/hlsl/LightMaterial_ps.hlsl
+	target ps_2_0
+	entry_point main
+
+	default_params
+	{
+		param_named_auto worldView worldview_matrix
+		
+		param_named_auto lightDiffuseColor custom 1
+		param_named_auto lightSpecularColor custom 2
+		param_named_auto lightFalloff custom 3
+	}
+}
Index: /Samples/Media/DeferredShadingMedia/deferred_post_minilight.material
===================================================================
--- /Samples/Media/DeferredShadingMedia/deferred_post_minilight.material	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/deferred_post_minilight.material	(revision 5)
@@ -0,0 +1,56 @@
+// Auxilary lights
+
+/// Reference material [geometry]
+material DeferredShading/LightMaterial
+{
+    technique
+    {
+		pass
+		{
+			// Don't disable depth test, because the light doesn't have to be rendered
+			// if the bounding geometry is obscured.
+			scene_blend add
+			depth_write off
+			depth_check on
+			lighting off
+			
+			
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
+/// Reference material [quad]
+material DeferredShading/LightMaterialQuad
+{
+    technique
+    {
+		pass
+		{
+			scene_blend add
+			depth_write off
+			depth_check off
+			lighting off
+			
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
+
Index: /Samples/Media/DeferredShadingMedia/deferred_post_multipass.glsl.program
===================================================================
--- /Samples/Media/DeferredShadingMedia/deferred_post_multipass.glsl.program	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/deferred_post_multipass.glsl.program	(revision 5)
@@ -0,0 +1,26 @@
+// Post processors
+fragment_program DeferredShading/post/glsl/Ambient_ps glsl
+{
+	source DeferredShading/post/glsl/Ambient_ps.glsl
+	
+	default_params
+	{
+		param_named_auto ambientColor ambient_light_colour 0		
+		param_named_auto proj projection_matrix
+		param_named tex0 int 0
+		param_named tex1 int 1
+	}
+}
+fragment_program DeferredShading/post/glsl/GlobalLight_ps glsl
+{
+	source DeferredShading/post/glsl/GlobalLight_ps.glsl
+	
+	default_params
+	{
+		param_named_auto lightPos0 light_position_view_space 0
+		param_named_auto lightDiffuseColor0 light_diffuse_colour 0
+		param_named_auto lightSpecularColor0 light_specular_colour 0
+		param_named tex0 int 0
+		param_named tex1 int 1
+	}
+}
Index: /Samples/Media/DeferredShadingMedia/deferred_post_multipass.hlsl.program
===================================================================
--- /Samples/Media/DeferredShadingMedia/deferred_post_multipass.hlsl.program	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/deferred_post_multipass.hlsl.program	(revision 5)
@@ -0,0 +1,28 @@
+// Post processors
+fragment_program DeferredShading/post/hlsl/Ambient_ps hlsl
+{
+	source DeferredShading/post/hlsl/Ambient_ps.hlsl
+	target ps_2_0
+	entry_point main
+	
+	default_params
+	{
+		param_named_auto ambientColor ambient_light_colour 0		
+		param_named_auto proj projection_matrix
+	}
+}
+fragment_program DeferredShading/post/hlsl/GlobalLight_ps hlsl
+{
+	source DeferredShading/post/hlsl/GlobalLight_ps.hlsl
+	target ps_2_0
+	entry_point main
+	
+	default_params
+	{
+		//param_named_auto invProj inverse_projection_matrix	
+		
+		param_named_auto lightPos0 light_position_view_space 0
+		param_named_auto lightDiffuseColor0 light_diffuse_colour 0
+		param_named_auto lightSpecularColor0 light_specular_colour 0
+	}
+}
Index: /Samples/Media/DeferredShadingMedia/deferred_post_multipass.material
===================================================================
--- /Samples/Media/DeferredShadingMedia/deferred_post_multipass.material	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/deferred_post_multipass.material	(revision 5)
@@ -0,0 +1,118 @@
+// Post processors
+
+material DeferredShading/Post/Multi
+{
+    technique
+    {
+    	pass
+		{
+			// Ambient and depth write pass
+			cull_hardware none
+			cull_software none
+			//depth_check off
+			depth_write on
+
+			fragment_program_ref DeferredShading/post/hlsl/Ambient_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/hlsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+		pass
+		{
+			scene_blend add
+			cull_hardware none
+			cull_software none
+			iteration once_per_light
+			depth_write off
+			//depth_check off
+
+			fragment_program_ref DeferredShading/post/hlsl/GlobalLight_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/hlsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+	technique
+    {
+    	pass
+		{
+			// Ambient and depth write pass
+			cull_hardware none
+			cull_software none
+			//depth_check off
+			depth_write on
+
+			fragment_program_ref DeferredShading/post/glsl/Ambient_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/glsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+		pass
+		{
+			scene_blend add
+			cull_hardware none
+			cull_software none
+			iteration once_per_light
+			depth_write off
+			depth_check off
+
+			fragment_program_ref DeferredShading/post/glsl/GlobalLight_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/glsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
+
Index: /Samples/Media/DeferredShadingMedia/deferred_post_onepass.glsl.program
===================================================================
--- /Samples/Media/DeferredShadingMedia/deferred_post_onepass.glsl.program	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/deferred_post_onepass.glsl.program	(revision 5)
@@ -0,0 +1,27 @@
+// Post processors
+
+vertex_program DeferredShading/post/glsl/vs glsl
+{
+	source DeferredShading/post/glsl/vs.glsl
+	default_params
+	{
+		param_named_auto invProj inverse_projection_matrix
+	}
+}
+fragment_program DeferredShading/post/glsl/SinglePass_ps glsl
+{
+	source DeferredShading/post/glsl/SinglePass_ps.glsl
+	default_params
+	{
+		param_named_auto proj projection_matrix
+		param_named_auto ambientColor ambient_light_colour 0
+		param_named_auto lightPos0 light_position_view_space 0
+		param_named_auto lightDiffuseColor0 light_diffuse_colour 0
+		param_named_auto lightSpecularColor0 light_specular_colour 0
+		param_named_auto lightPos1 light_position_view_space 1
+		param_named_auto lightDiffuseColor1 light_diffuse_colour 1
+		param_named_auto lightSpecularColor1 light_specular_colour 1
+		param_named tex0 int 0
+		param_named tex1 int 1
+	}
+}
Index: /Samples/Media/DeferredShadingMedia/deferred_post_onepass.hlsl.program
===================================================================
--- /Samples/Media/DeferredShadingMedia/deferred_post_onepass.hlsl.program	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/deferred_post_onepass.hlsl.program	(revision 5)
@@ -0,0 +1,29 @@
+// Post processors
+vertex_program DeferredShading/post/hlsl/vs hlsl
+{
+	source DeferredShading/post/hlsl/vs.hlsl
+	target vs_1_1
+	entry_point main
+	default_params
+	{
+		param_named_auto invProj inverse_projection_matrix
+	}
+}
+fragment_program DeferredShading/post/hlsl/SinglePass_ps hlsl
+{
+	source DeferredShading/post/hlsl/SinglePass_ps.hlsl
+	target ps_2_0
+	entry_point main
+	
+	default_params
+	{
+		param_named_auto proj projection_matrix
+		param_named_auto ambientColor ambient_light_colour 0
+		param_named_auto lightPos0 light_position_view_space 0
+		param_named_auto lightDiffuseColor0 light_diffuse_colour 0
+		param_named_auto lightSpecularColor0 light_specular_colour 0
+		param_named_auto lightPos1 light_position_view_space 1
+		param_named_auto lightDiffuseColor1 light_diffuse_colour 1
+		param_named_auto lightSpecularColor1 light_specular_colour 1
+	}
+}
Index: /Samples/Media/DeferredShadingMedia/deferred_post_onepass.material
===================================================================
--- /Samples/Media/DeferredShadingMedia/deferred_post_onepass.material	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/deferred_post_onepass.material	(revision 5)
@@ -0,0 +1,65 @@
+// Post processors
+material DeferredShading/Post/Single
+{
+    technique
+    {
+    	pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+			depth_write on
+			// Doesn't work for some reason
+			//depth_check off
+
+			fragment_program_ref DeferredShading/post/hlsl/SinglePass_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/hlsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+	technique
+    {
+    	pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+			depth_write on
+			// Doesn't work for some reason
+			//depth_check off
+
+			fragment_program_ref DeferredShading/post/glsl/SinglePass_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/glsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
+
Index: /Samples/Media/DeferredShadingMedia/deferreddemo.material
===================================================================
--- /Samples/Media/DeferredShadingMedia/deferreddemo.material	(revision 5)
+++ /Samples/Media/DeferredShadingMedia/deferreddemo.material	(revision 5)
@@ -0,0 +1,228 @@
+// Materials for deferred shading test
+
+// Sky box
+material Test13/SkyBox
+{
+	technique
+	{
+		pass
+		{
+			depth_write off
+			lighting off
+			texture_unit
+			{
+				cubic_texture evening.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+// Ground plane
+material Test13/Ground: DeferredShading/Material/TexturedPhong
+{
+	technique hlsl
+	{
+		pass main
+		{
+			texture_unit
+			{
+				texture grass_1024.jpg
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			texture_unit
+			{
+				texture grass_1024.jpg
+			}
+		}
+	}
+}
+
+// Rock wall texture [bumpmapped]
+material Test13/RockWall: DeferredShading/Material/TexturedNormalMapped
+{
+	technique hlsl
+	{
+		pass main
+		{
+			texture_unit
+			{
+				texture rockwall.tga
+			}
+			texture_unit
+			{
+				texture rockwall_NH.tga
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			texture_unit
+			{
+				texture rockwall.tga
+			}
+			texture_unit
+			{
+				texture rockwall_NH.tga
+			}
+		}
+	}
+}
+
+
+// Athena texture [bumpmapped, untextured]
+material Test13/DeferredAthena: DeferredShading/Material/UntexturedNormalMapped
+{
+	technique hlsl
+	{
+		pass main
+		{
+			texture_unit
+			{
+				texture atheneNormalMap.png
+			}
+			fragment_program_ref
+			{
+				param_named specularity float 0.5
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			texture_unit
+			{
+				texture atheneNormalMap.png
+			}
+			fragment_program_ref
+			{
+				param_named specularity float 0.5
+			}
+		}
+	}
+}
+
+/// Ogre parts
+material Test13/DeferredOgre/Skin: DeferredShading/Material/TexturedPhong
+{
+	technique hlsl
+	{
+		pass main
+		{
+			cull_hardware none
+			texture_unit
+			{
+				texture GreenSkin.jpg
+				tex_address_mode mirror
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			cull_hardware none
+			texture_unit
+			{
+				texture GreenSkin.jpg
+				tex_address_mode mirror
+			}
+		}
+	}
+}
+material Test13/DeferredOgre/EarRing: DeferredShading/Material/UntexturedPhong
+{
+	technique hlsl
+	{
+		pass main
+		{
+			fragment_program_ref
+			{
+				param_named specularity float 1.5
+				param_named colour float3 0.5 0.5 0
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			fragment_program_ref
+			{
+				param_named specularity float 1.5
+				param_named colour float3 0.5 0.5 0
+			}
+		}
+	}
+}
+material Test13/DeferredOgre/Tusks: DeferredShading/Material/TexturedPhong
+{
+	technique hlsl
+	{
+		pass main
+		{
+			fragment_program_ref
+			{
+				param_named specularity float 0.5
+			}
+			texture_unit
+			{
+				texture dirt01.jpg
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			fragment_program_ref
+			{
+				param_named specularity float 0.5
+			}
+			texture_unit
+			{
+				texture dirt01.jpg
+			}
+		}
+	}
+}
+material Test13/DeferredOgre/Eyes: DeferredShading/Material/TexturedPhong
+{
+	technique hlsl
+	{
+		pass main
+		{
+			fragment_program_ref
+			{
+				param_named specularity float 1.0
+			}
+			texture_unit
+			{
+				texture WeirdEye.png
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			fragment_program_ref
+			{
+				param_named specularity float 1.0
+			}
+			texture_unit
+			{
+				texture WeirdEye.png
+			}
+		}
+	}
+}
+
Index: /Samples/Media/fonts/read_me.html
===================================================================
--- /Samples/Media/fonts/read_me.html	(revision 5)
+++ /Samples/Media/fonts/read_me.html	(revision 5)
@@ -0,0 +1,2 @@
+<html><head><title>Larabie Fonts "read me" file, license and FAQ</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta name="keywords" content="typodermic,typo dermic,fonts,Larabie,Larabie Fonts,fontd,fotn,fnots,fons,fots,fnts,font,truetype,typefaces,typeface,logo,ttf,opentype,larbie,laribie,larby,larabee,lairby,larrabie,larraby,laraby,typography,Type1,postscript,macintosh,windows,design,lettering,type"><font face="Georgia"><h3>LARABIE FONTS README.TXT</h3><p>All Larabie Fonts in this file are free to use for personal and/or commercial purposes. No payment is necessary to use these fonts for personal or commercial use. For Software Products who want to include Larabie Fonts see the License Agreement below. You can add this font to a website but do not combine fonts into a single archive or alter them in any way.</p><p>All Larabie Fonts are free for commercial use but a sample of your product would be gratefully appreciated so I can see how the font looks in use. Contact <a href="http://www.larabiefonts.com/donation.html">www.larabiefonts.com/donation.html</a> for mailing information.</p><p>Some Larabie Fonts have enhanced and expanded families available for sale at <a href="http://www.typodermic.com">www.typodermic.com</a>.</p><p>If you'd like to make a voluntary donation to Larabie Fonts for the use of the free fonts in any amount please go to <a href="http://www.larabiefonts.com/donation.html">www.larabiefonts.com/donation.html</a></p><p>I accept CDs, magazines, t-shirts, a sample of your merchandise or anything featuring Larabie Fonts. Please remember to list your item as a gift on the customs form or I will have to pay import duties and taxes on the item. Mailing information is provided at the link above.</p><p>Font installation help is available at <a href="http://www.larabiefonts.com/help.html">www.larabiefonts.com/help.html</a></p><h3>LARABIE FONTS FREQUENTLY ASKED QUESTIONS</h3><ul><li>Q: How do use these fonts in my favourite software?<li>A: In Windows, you take the fonts out of the ZIP archive and place them in your fonts folder which can be found in your Control Panel. The next time you run your software, the font will be available. For example: If you install a new font, the next time you run Microsoft Word, that font will be available in the menu under Format / Font. For anything more complicated, or Mac installation, visit <a href="http://www.larabiefonts.com/help.html">www.larabiefonts.com/help.html</a></ul><ul><li>Q: How can I use this font in <a href="http://www.aol.com/aim/">AOL Instant Messenger</a>, <a href="http://messenger.msn.com/">MSN Messenger</a>, <a href="http://www.microsoft.com/office/outlook/">Outlook</a>, <a href="http://www.microsoft.com/office/outlook/">Outlook Express</a>, <a href="http://www.eudora.com/">Euodora</a> or any other email software?<li>A: At the time of this writing (Feb 2004) you cant. After installing one of my fonts, you may be able to select it in the above applications but the person at the other end wont see that same thing unless they have the font installed. If you really want to use my fonts in these applications, make sure the people at the other end have the same fonts installed.</ul><ul><li>Q: How can I use these fonts on a web page?<li>A: If youre creating a web page using Flash, its easy. Consult your Flash manual. If youre using <a href="http://www.adobe.com/products/acrobat/">Acrobat</a>, make sure the font embedding settings are turned on. Consult your Acrobat manual. For anything else there are limitations: If you want to use one of my fonts as your main, text font youre pretty much out of luck unless you explore a font embedding tool such as <a href="http://www.microsoft.com/typography/web/embedding/weft/">WEFT</a> but I dont recommend it. To use my fonts as headings or titles, use image creation software such as <a href="http://www.gimp.org/">The Gimp</a>, <a href="http://www.adobe.com/products/photoshop/">Photoshop</a>, <a href="http://www.jasc.com/">Paint Shop Pro</a>, <a href="http://www.google.com/search?q=pixia">Pixia</a> etc. Save the images as GIF files and place them on your web page. Theres a lot more to it than can be explained here but there are countless books available on web page design.</ul><ul><li>Q: How can I make these fonts bigger?<li>A: All my fonts are infinitely scalable; the limitations are in your software. A common problem is scaling fonts in Microsoft Word. If you choose Format / Font you can type in any number you like under size.</ul><ul><li>Q: Are these fonts really free?<li>A: Yes they are. Some fonts such as <a href="http://www.typodermic.com/fonts/19.html">Neuropol</a> have expanded font families available for sale at <a href="http://www.typodermic.com">www.typodermic.com</a> but the version you downloaded at Larabie Fonts is free.</ul><ul><li>Q: Your licence agreement states that the fonts cant be altered. Does that mean I cant mess around with your fonts in Photoshop/Illustrator/Publisher etc?<li>A: Those license restrictions refer to altering the actual fonts themselves, not what you make with them. As long as you dont alter the font files in font creation software such as FontLab or Fontographer youre free to create anything you like with them.</ul><ul><li>Q: Can I use your fonts in a logo?<li>A: Yes. But check with a lawyer if youre not sure. Its okay with me if you use it but do so at your own risk.</ul><ul><li>Q: Can I send you a sample of the nifty thing I created with your fonts?<li>A: Of course. Check <a href="http://www.larabiefonts.com/donation.html">www.larabiefonts.com/donation.html</a> for my current email or mailing address.</ul><ul><li>Q: Can you make a custom font for me?<li>A: Possibly. Check <a href="http://typodermic.com/custom.html">typodermic.com/custom.html</a> for details. Keep in mind that making fonts is my full-time job so no freebies.</ul><ul><li>Q: I want to sell software that includes you font files.<li>A: Contact me first at <a href="http://www.larabiefonts.com/email.html">www.larabiefonts.com/email.html</a>.</ul><ul><li>Q: I want to sell rubber stamp alphabets, alphabet punches or stencil alphabets using your font designs.<li>A: Contact me first at <a href="http://www.larabiefonts.com/email.html">www.larabiefonts.com/email.html</a>.</ul><ul><li>Q: My software wont let me embed one of your fonts.<li>A: You may have an old version of one of my fonts. Uninstall it and install a current version on Larabie Fonts.</ul><ul><li>Q: Can you help me find a font?<li>A: I really dont have the time but if you send a donation, I can give it a try. If not. post your question on my font forum: <a href="http://www.larabiefonts.com/info.html">www.larabiefonts.com/info.html</a>.</ul><h3>LARABIE FONTS END-USER LICENSE AGREEMENT FOR SOFTWARE PRODUCTS</h3><h4>SOFTWARE PRODUCT LICENSE</h4><p>The SOFTWARE PRODUCT is protected by copyright laws and International copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold.</p><h5>1. GRANT OF LICENSE. This document grants you the following rights:</h5><p>- Installation and Use. You may install and use an unlimited number of copies of the SOFTWARE PRODUCT.  You may copy and distribute unlimited copies of the SOFTWARE PRODUCT as you receive them, in any medium, provided that you publish on each copy an appropriate copyright notice. Keep intact all the notices that refer to this License and give any other recipients of the fonts a copy of this License along with the fonts.</p><h5>2. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS.</h5><p>- You may modify your copy or copies of the SOFTWARE PRODUCT or any portion of it, provided that you also meet all of these rules:</p><p>a) Do not alter in any way alphanumeric characters (A-Z, a-z, 1-9) contained in the font. An exception is converting between formats, here is allowed the nominal distortion that occurs during conversion from second order to third order quadratic curves (TrueType to Postscript) and vice versa.</p><p>b) Extra characters may be added; here it is allowed to use curves (shapes) from alphanumeric characters in fonts under same license.</p><p>c) It is allowed to modify and remove analpahbetics (punctuation, special characters, ligatures and symbols).</p><p>d) The original font name must be retained but can be augmented. (ie. a Font named Blue Highway can be renamed Blue Highway Cyrillic or Blue Highway ANSI, etc.)</p><p>e) Character mapping may be altered.</p><p>f) If the kerning information is altered or discarded it must be stated in the user notes or documentation.</p><p>g) All modifications must be released under this license.</p></p>LIMITED WARRANTY NO WARRANTIES. Larabie Fonts expressly disclaims any warranty for the SOFTWARE PRODUCT. The SOFTWARE PRODUCT and any related documentation is provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties or merchantability, fitness for a particular purpose, or non-infringement. The entire risk arising out of use or performance of the SOFTWARE PRODUCT remains with you.</p><p>NO LIABILITY FOR CONSEQUENTIAL DAMAGES. In no event shall Larabie Fonts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use this product, even if Larabie Fonts has been advised of the possibility of such damages.</p><h5>3. MISCELLANEOUS</h5><p>Should you have any questions concerning this document, or if you desire to contact Larabie Fonts for any reason, please email <a href="http://www.larabiefonts.com/email.html">www.larabiefonts.com/email.html</a>.</p></font></BODY></HTML>
+
Index: /Samples/Media/fonts/sample.fontdef
===================================================================
--- /Samples/Media/fonts/sample.fontdef	(revision 5)
+++ /Samples/Media/fonts/sample.fontdef	(revision 5)
@@ -0,0 +1,11 @@
+StarWars
+{
+	// Now this one I agree with ;)
+	// A Star Wars font :)
+	type 		truetype
+	source 		solo5.ttf
+	size 		16
+	resolution 	96
+}
+
+
Index: /Samples/Media/gui/CompositorDemo.layout
===================================================================
--- /Samples/Media/gui/CompositorDemo.layout	(revision 5)
+++ /Samples/Media/gui/CompositorDemo.layout	(revision 5)
@@ -0,0 +1,182 @@
+<?xml version="1.0" ?>
+<GUILayout>
+<Window Type="DefaultGUISheet" Name="root">
+
+	<Window Type="DefaultGUISheet" Name="debug_overlay">
+		<Property Name="AlwaysOnTop" Value="True" />
+		<Property Name="Disabled" Value="True" />
+		
+		<Window Type="TaharezLook/StaticText" Name="Panel 1">
+			<Property Name="UnifiedPosition" Value="{{0,0},{0.83,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.23,0},{0.17,0}}" />
+			<Property Name="TopLeftFrameImage" Value="set:OgreGuiImagery image:BoxTopLeft" />
+			<Property Name="TopRightFrameImage" Value="set:OgreGuiImagery image:BoxTopRight" />
+			<Property Name="BottomLeftFrameImage" Value="set:OgreGuiImagery image:BoxBottomLeft" />
+			<Property Name="BottomRightFrameImage" Value="set:OgreGuiImagery image:BoxBottomRight" />
+			<Property Name="LeftFrameImage" Value="set:OgreGuiImagery image:BoxLeft" />
+			<Property Name="TopFrameImage" Value="set:OgreGuiImagery image:BoxTop" />
+			<Property Name="RightFrameImage" Value="set:OgreGuiImagery image:BoxRight" />
+			<Property Name="BottomFrameImage" Value="set:OgreGuiImagery image:BoxBottom" />
+			<Property Name="BackgroundImage" Value="set:OgreGuiImagery image:BoxBack" />
+			<Property Name="Alpha" Value="0.9" />
+			<Property Name="InheritsAlpha" Value="False" />
+	
+			<Window Type="TaharezLook/StaticText" Name="OPCurrentFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.12,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.85,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FF4FF06F tr:FF4FF06F bl:FF4FF06F br:FF4FF06F" />
+				<Property Name="HorzFormatting" Value="HorzCentred" />
+				<Property Name="Text" Value="Current FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticImage" Name="OPBar1">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="UnifiedPosition" Value="{{0.2,0},{0.27,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.6,0},{0.025,0}}" />
+				<Property Name="Image" Value="set:OgreGuiImagery image:Bar" />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPAverageFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.32,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Average FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPWorstFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.45,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Worst FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPBestFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.58,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Best FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPTriCount">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.71,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Triangle Count: " />
+			</Window>
+
+		</Window>
+
+		<Window Type="TaharezLook/StaticText" Name="OPDebugMsg">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="Font" Value="BlueHighway-10" />
+			<Property Name="UnifiedPosition" Value="{{0.25,0},{0.93,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.65,0},{0.07,0}}" />
+			<Property Name="TextColours" Value="tl:A0FFFFFF tr:A0FFFFFF bl:A0FFFFFF br:A0FFFFFF" />
+			<Property Name="InheritsAlpha" Value="False" />
+			<Property Name="VertFormatting" Value="VertCentred" />
+			<Property Name="HorzFormatting" Value="WordWrapCentred" />
+		</Window>
+
+		<Window Type="TaharezLook/StaticImage" Name="OgreLogo">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="UnifiedPosition" Value="{{0.9,0},{0.95,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.1,0},{0.05,0}}" />
+			<Property Name="Image" Value="set:OgreGuiImagery image:OgreLogo" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+
+		<Window Type="TaharezLook/StaticImage" Name="CeguiLogo">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="UnifiedPosition" Value="{{0.9125,0},{0.9115,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.075,0},{0.0385,0}}" />
+			<Property Name="Image" Value="set:OgreGuiImagery image:CeguiLogo" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+
+	</Window>
+
+	<Window Type="DefaultGUISheet" Name="CompositorDemo">
+
+		<Property Name="UnifiedMaxSize" Value="{{1,0},{2,0}}" />
+		<Property Name="UnifiedSize" Value="{{1,0},{2,0}}" />
+
+
+		<Window Type="TaharezLook/StaticText" Name="HelpTxt">
+			<Property Name="UnifiedPosition" Value="{{0.6,0},{0.8,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.5,0},{0.3,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.5,0},{0.3,0}}" />
+			<Property Name="Text" Value="Use the Combo boxes to select a shader and a model" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+		
+		<Window Type="TaharezLook/FrameWindow" Name="CompositorSelectorWin">
+			<Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.16,0},{0.22,0}}" />
+			<Property Name="UnifiedMaxSize" Value="{{0.16,0},{0.75,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.16,0},{0.3,0}}" />
+			<Property Name="Text" Value="Compositors" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="CloseButtonEnabled" Value="False" />
+
+			<Window Type="TaharezLook/Button" Name="ExitDemoBtn">
+				<Property Name="VerticalAlignment" Value="Bottom" />
+				<Property Name="HorizontalAlignment" Value="Centre" />
+				<Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.33,0},{0.03,0}}" />
+				<Property Name="Text" Value="Exit Demo" />
+				<Property Name="InheritsAlpha" Value="False" />
+			</Window>
+
+		</Window>
+		<Window Type="TaharezLook/FrameWindow" Name="DebugRTTs">
+			<Property Name="RollUpState" Value="True" />
+			<Property Name="UnifiedPosition" Value="{{0.70,0},{0,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.3,0},{0.3,0}}" />
+			<Property Name="UnifiedMaxSize" Value="{{0.3,0},{0.3,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.3,0},{0.3,0}}" />
+			<Property Name="Text" Value="Debug RTTs" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="CloseButtonEnabled" Value="False" />
+
+			<Window Type="TaharezLook/Listbox" Name="DebugRTTListbox">
+				<Property Name="UnifiedPosition" Value="{{0.02,0},{0.1,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.1,0},{0.25,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.1,0},{0.25,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.1,0},{0.25,0}}" />
+			</Window>
+			<Window Type="TaharezLook/StaticImage" Name="DebugRTTImage">
+				<Property Name="UnifiedPosition" Value="{{0.36,0},{0.1,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.2,0},{0.25,0}}" />
+			</Window>
+		</Window>
+	</Window>
+
+
+</Window>
+
+</GUILayout>
Index: /Samples/Media/gui/CompositorDemoCegui.config
===================================================================
--- /Samples/Media/gui/CompositorDemoCegui.config	(revision 5)
+++ /Samples/Media/gui/CompositorDemoCegui.config	(revision 5)
@@ -0,0 +1,6 @@
+<?xml version="1.0" ?>
+<CEGUIConfig
+	Scheme="TaharezLookSkin.scheme"
+	Layout="CompositorDemo.layout"
+	DefaultFont="BlueHighway-12"
+/>
Index: /Samples/Media/gui/CrowdDemo.layout
===================================================================
--- /Samples/Media/gui/CrowdDemo.layout	(revision 5)
+++ /Samples/Media/gui/CrowdDemo.layout	(revision 5)
@@ -0,0 +1,201 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+    <Window Type="DefaultWindow" Name="root" >
+        <Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Window Type="DefaultWindow" Name="debug_overlay" >
+            <Property Name="Disabled" Value="True" />
+            <Property Name="AlwaysOnTop" Value="True" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+            <Window Type="TaharezLook/StaticText" Name="Panel 1" >
+                <Property Name="Alpha" Value="0.9" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0,0},{0.83,0},{0.23,0},{1,0}}" />
+                <Window Type="TaharezLook/StaticText" Name="OPCurrentFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Current FPS: " />
+                    <Property Name="TextColours" Value="tl:FF4FF06F tr:FF4FF06F bl:FF4FF06F br:FF4FF06F" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="HorzFormatting" Value="HorzCentred" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.12,0},{0.925,0},{0.37,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticImage" Name="OPBar1" >
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.27,0},{0.8,0},{0.295,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPAverageFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Average FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.32,0},{1.075,0},{0.57,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPWorstFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Worst FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.45,0},{1.075,0},{0.7,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPBestFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Best FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.58,0},{1.075,0},{0.83,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPTriCount" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Triangle Count: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.71,0},{1.075,0},{0.96,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+            </Window>
+            <Window Type="TaharezLook/StaticText" Name="OPDebugMsg" >
+                <Property Name="Font" Value="BlueHighway-10" />
+                <Property Name="TextColours" Value="tl:A0FFFFFF tr:A0FFFFFF bl:A0FFFFFF br:A0FFFFFF" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="HorzFormatting" Value="WordWrapCentred" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.93,0},{0.9,0},{1,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="OgreLogo" >
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.9,0},{0.95,0},{1,0},{1,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="CeguiLogo" >
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.9125,0},{0.9115,0},{0.9875,0},{0.95,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+        </Window>
+        <Window Type="DefaultWindow" Name="InstancingDemo" >
+            <Property Name="Font" Value="BlueHighway-8" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+            <Window Type="TaharezLook/FrameWindow" Name="CompositorSelectorWin" >
+                <Property Name="Text" Value="Techniques" />
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="TitlebarFont" Value="BlueHighway-12" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="TitlebarEnabled" Value="True" />
+                <Property Name="UnifiedAreaRect" Value="{{-0.00292969,0},{0.00381679,1.25081e-037},{0.331094,0},{0.464121,1.25081e-037}}" />
+                <Property Name="CloseButtonEnabled" Value="False" />
+                <Window Type="TaharezLook/RadioButton" Name="tInstancing" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Instancing" />
+                    <Property Name="Selected" Value="True" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.055847,0},{0.10764,0},{0.973986,0},{0.187074,0}}" />
+                </Window>
+                <Window Type="TaharezLook/RadioButton" Name="tIndependantEntities" >
+                    <Property Name="ID" Value="1" />
+                    <Property Name="Font" Value="BlueHighway-12" />
+					<Property Name="Text" Value="Independent Entities" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.055847,0},{0.172136,0},{0.962291,0},{0.265333,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Checkbox" Name="Shadows" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Shadows on/off" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.475788,0},{1.05,0},{0.579744,0}}" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Object Count Text" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Object Count:" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0880073,0},{0.263737,0},{0.382815,0},{0.369793,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Object Count Number" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="160" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.388902,0},{0.277557,0},{0.631087,0},{0.364265,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Object Count" >
+                    <Property Name="PageSize" Value="0" />
+                    <Property Name="StepSize" Value="1" />
+                    <Property Name="OverlapSize" Value="0" />
+                    <Property Name="DocumentSize" Value="1" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.39,0},{0.95,0},{0.441213,0}}" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Time Burner Text" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="CPU occupation:" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.59802,0},{0.427339,0},{0.680451,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Time Burner Value" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="0 ms" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.415811,0},{0.599679,0},{0.640395,0},{0.686178,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Time Burner" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="PageSize" Value="0" />
+                    <Property Name="StepSize" Value="1" />
+                    <Property Name="OverlapSize" Value="0" />
+                    <Property Name="DocumentSize" Value="1" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.687236,0},{0.95,0},{0.74726,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Checkbox" Name="PostEffect" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Post Effect On/Off" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0470764,0},{0.765568,0},{0.892124,0},{0.82884,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Button" Name="ExitDemoBtn" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Exit Demo" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{-0.0526254,0},{-0.063219,0},{0.277375,0},{-4.06504e-005,0}}" />
+                    <Property Name="VerticalAlignment" Value="Bottom" />
+                    <Property Name="HorizontalAlignment" Value="Centre" />
+                </Window>
+            </Window>
+        </Window>
+    </Window>
+</GUILayout>
Index: /Samples/Media/gui/Falagard.xsd
===================================================================
--- /Samples/Media/gui/Falagard.xsd	(revision 5)
+++ /Samples/Media/gui/Falagard.xsd	(revision 5)
@@ -0,0 +1,391 @@
+<?xml version="1.0" ?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+	<xsd:element name="Falagard" type="falagardSpecificationType" />
+	<xsd:complexType name="falagardSpecificationType">
+		<xsd:sequence>
+			<xsd:element name="WidgetLook" type="widgetLookType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+	</xsd:complexType>
+	<xsd:complexType name="widgetLookType">
+		<xsd:sequence>
+            <xsd:element name="PropertyDefinition" type="propertyDefinitionType" minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="PropertyLinkDefinition" type="propertyLinkDefinitionType" minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="Property" type="propertyType" minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="NamedArea" type="namedAreaType" minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Child" type="widgetComponentType" minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="ImagerySection" type="imagerySectionType" minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="StateImagery" type="stateType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="name" type="xsd:string" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="propertyDefinitionType">
+        <xsd:attribute name="type" type="propertyTypeEnum" use="optional" default="Generic" />
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+        <xsd:attribute name="initialValue" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="layoutOnWrite" type="xsd:boolean" use="optional" default="false" />
+        <xsd:attribute name="redrawOnWrite" type="xsd:boolean" use="optional" default="false" />
+    </xsd:complexType>
+    <xsd:complexType name="propertyLinkDefinitionType">
+        <xsd:attribute name="type" type="propertyTypeEnum" use="optional" default="Generic" />
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+        <xsd:attribute name="widget" type="xsd:string" use="required" />
+        <xsd:attribute name="targetProperty" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="initialValue" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="layoutOnWrite" type="xsd:boolean" use="optional" default="false" />
+        <xsd:attribute name="redrawOnWrite" type="xsd:boolean" use="optional" default="false" />
+    </xsd:complexType>
+    <xsd:complexType name="namedAreaType">
+        <xsd:sequence>
+            <xsd:element name="Area" type="componentAreaType" />
+        </xsd:sequence>
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+    </xsd:complexType>
+	<xsd:complexType name="stateType">
+		<xsd:sequence>
+			<xsd:element name="Layer" type="layerType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="name" type="xsd:string" use="required" />
+        <xsd:attribute name="clipped" type="xsd:boolean" use="optional" default="true" />
+	</xsd:complexType>
+	<xsd:complexType name="layerType">
+		<xsd:sequence>
+			<xsd:element name="Section" type="sectionSpecType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="priority" type="xsd:integer" use="optional" default="0" />
+	</xsd:complexType>
+    <xsd:complexType name="sectionSpecType">
+        <xsd:choice  minOccurs="0" maxOccurs="1">
+            <xsd:element name="Colour" type="colourType" />
+            <xsd:element name="Colours" type="colourRectType" />
+            <xsd:element name="ColourProperty" type="settingByPropertyType" />
+            <xsd:element name="ColourRectProperty" type="settingByPropertyType" />
+        </xsd:choice>
+        <xsd:attribute name="look" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="section" type="xsd:string" use="required" />
+        <xsd:attribute name="controlProperty" type="xsd:string" use="optional" default="" />
+    </xsd:complexType>
+	<xsd:complexType name="imagerySectionType">
+		<xsd:sequence>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="Colour" type="colourType" />
+                <xsd:element name="Colours" type="colourRectType" />
+                <xsd:element name="ColourProperty" type="settingByPropertyType" />
+                <xsd:element name="ColourRectProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:element name="FrameComponent" type="frameComponentType" minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="ImageryComponent" type="imageryComponentType" minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="TextComponent" type="textComponentType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="name" type="xsd:string" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="frameComponentType">
+        <xsd:sequence>
+            <xsd:element name="Area" type="componentAreaType" />
+            <xsd:element name="Image" type="frameImageType" minOccurs="0" maxOccurs="9" />
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="Colour" type="colourType" />
+                <xsd:element name="Colours" type="colourRectType" />
+                <xsd:element name="ColourProperty" type="settingByPropertyType" />
+                <xsd:element name="ColourRectProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="VertFormat" type="vertFormatType" />
+                <xsd:element name="VertFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="HorzFormat" type="horzFormatType" />
+                <xsd:element name="HorzFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:complexType>
+    <xsd:complexType name="textComponentType">
+        <xsd:sequence>
+            <xsd:element name="Area" type="componentAreaType" />
+            <xsd:element name="Text" type="textStringType" minOccurs="0" maxOccurs="1" />
+            <xsd:element name="TextProperty" type="textPropertyType" minOccurs="0" maxOccurs="1" />
+            <xsd:element name="FontProperty" type="fontPropertyType" minOccurs="0" maxOccurs="1" />
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="Colour" type="colourType" />
+                <xsd:element name="Colours" type="colourRectType" />
+                <xsd:element name="ColourProperty" type="settingByPropertyType" />
+                <xsd:element name="ColourRectProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="VertFormat" type="vertTextFormatType" />
+                <xsd:element name="VertFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="HorzFormat" type="horzTextFormatType" />
+                <xsd:element name="HorzFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:complexType>
+	<xsd:complexType name="imageryComponentType">
+		<xsd:sequence>
+			<xsd:element name="Area" type="componentAreaType" />
+            <xsd:choice>
+                <xsd:element name="Image" type="imageType" />
+                <xsd:element name="ImageProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="Colour" type="colourType" />
+                <xsd:element name="Colours" type="colourRectType" />
+                <xsd:element name="ColourProperty" type="settingByPropertyType" />
+                <xsd:element name="ColourRectProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="VertFormat" type="vertFormatType" />
+                <xsd:element name="VertFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="HorzFormat" type="horzFormatType" />
+                <xsd:element name="HorzFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+		</xsd:sequence>
+	</xsd:complexType>
+	<xsd:complexType name="widgetComponentType">
+		<xsd:sequence>
+			<xsd:element name="Area" type="componentAreaType" />
+			<xsd:element name="VertAlignment" type="vertAlignmentType" minOccurs="0" maxOccurs="1" />
+			<xsd:element name="HorzAlignment" type="horzAlignmentType" minOccurs="0" maxOccurs="1" />
+			<xsd:element name="Property" type="propertyType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="type" type="xsd:string" use="required" />
+		<xsd:attribute name="nameSuffix" type="xsd:string" use="required" />
+		<xsd:attribute name="renderer" type="xsd:string" use="optional" default="" />
+		<xsd:attribute name="look" type="xsd:string" use="optional" default="" />
+	</xsd:complexType>
+	<xsd:complexType name="horzFormatType">
+		<xsd:attribute name="type" type="horzFormatEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="vertFormatType">
+		<xsd:attribute name="type" type="vertFormatEnum" use="required" />
+	</xsd:complexType>
+        <xsd:complexType name="horzTextFormatType">
+		<xsd:attribute name="type" type="horzTextFormatEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="vertTextFormatType">
+		<xsd:attribute name="type" type="vertTextFormatEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="horzAlignmentType">
+		<xsd:attribute name="type" type="horzAlignmentEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="vertAlignmentType">
+		<xsd:attribute name="type" type="vertAlignmentEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="propertyType">
+		<xsd:attribute name="name" type="xsd:string" use="required" />
+		<xsd:attribute name="value" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="imageType">
+		<xsd:attribute name="imageset" type="xsd:string" use="required" />
+		<xsd:attribute name="image" type="xsd:string" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="frameImageType">
+        <xsd:attribute name="type" type="frameImageComponentEnum" use="required" />
+        <xsd:attribute name="imageset" type="xsd:string" use="required" />
+        <xsd:attribute name="image" type="xsd:string" use="required" />
+    </xsd:complexType>
+	<xsd:complexType name="componentAreaType">
+        <xsd:choice>
+            <xsd:sequence>
+                <xsd:element name="Dim" type="dimensionType" minOccurs="4" maxOccurs="4" />
+            </xsd:sequence>
+            <xsd:element name="AreaProperty" type="settingByPropertyType" />
+        </xsd:choice>
+	</xsd:complexType>
+	<xsd:complexType name="dimensionType">
+		<xsd:choice>
+			<xsd:element name="UnifiedDim" type="unifiedDimType" />
+			<xsd:element name="AbsoluteDim" type="absoluteDimType" />
+			<xsd:element name="ImageDim" type="imageDimType" />
+            <xsd:element name="WidgetDim" type="widgetDimType" />
+            <xsd:element name="FontDim" type="fontDimType" />
+            <xsd:element name="PropertyDim" type="propertyDimType" />
+		</xsd:choice>
+		<xsd:attribute name="type" type="dimensionTypeEnum" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="fontDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+        <xsd:attribute name="widget" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="font" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="string" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="type" type="fontMetricTypeEnum" use="required" />
+        <xsd:attribute name="padding" type="xsd:decimal" use="optional" default="0" />
+    </xsd:complexType>
+    <xsd:complexType name="propertyDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+        <xsd:attribute name="widget" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+    </xsd:complexType>
+	<xsd:complexType name="unifiedDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+		<xsd:attribute name="scale" type="xsd:decimal" use="optional" default="0" />
+		<xsd:attribute name="offset" type="xsd:integer" use="optional" default="0" />
+		<xsd:attribute name="type" type="dimensionTypeEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="absoluteDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+		<xsd:attribute name="value" type="xsd:decimal" use="optional" default="0" />
+	</xsd:complexType>
+	<xsd:complexType name="imageDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+		<xsd:attribute name="imageset" type="xsd:string" use="required" />
+		<xsd:attribute name="image" type="xsd:string" use="required" />
+		<xsd:attribute name="dimension" type="dimensionTypeEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="widgetDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+		<xsd:attribute name="widget" type="xsd:string" use="optional" default="" />
+		<xsd:attribute name="dimension" type="dimensionTypeEnum" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="settingByPropertyType">
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+    </xsd:complexType>
+	<xsd:complexType name="colourRectType">
+		<xsd:attribute name="topLeft" type="colourValType" use="required" />
+		<xsd:attribute name="topRight" type="colourValType" use="required" />
+		<xsd:attribute name="bottomLeft" type="colourValType" use="required" />
+		<xsd:attribute name="bottomRight" type="colourValType" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="colourType">
+		<xsd:attribute name="colour" type="colourValType" use="required" />
+	</xsd:complexType>
+	<xsd:simpleType name="colourValType">
+		<xsd:restriction base="xsd:string">
+			<xsd:pattern value="[a-fA-F0-9]{8}" />
+		</xsd:restriction>
+	</xsd:simpleType>
+    <xsd:complexType name="textStringType">
+        <xsd:attribute name="string" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="font" type="xsd:string" use="optional" default="" />
+    </xsd:complexType>
+    <xsd:complexType name="textPropertyType">
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+    </xsd:complexType>
+    <xsd:complexType name="fontPropertyType">
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+    </xsd:complexType>
+    <xsd:complexType name="dimensionOperatorType">
+        <xsd:choice>
+            <xsd:element name="UnifiedDim" type="unifiedDimType" />
+            <xsd:element name="AbsoluteDim" type="absoluteDimType" />
+            <xsd:element name="ImageDim" type="imageDimType" />
+            <xsd:element name="WidgetDim" type="widgetDimType" />
+            <xsd:element name="FontDim" type="fontDimType" />
+            <xsd:element name="PropertyDim" type="propertyDimType" />
+        </xsd:choice>
+        <xsd:attribute name="op" type="dimensionOperatorEnum" use="required" />
+    </xsd:complexType>
+	<xsd:simpleType name="dimensionTypeEnum">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="LeftEdge" />
+			<xsd:enumeration value="TopEdge" />
+			<xsd:enumeration value="RightEdge" />
+			<xsd:enumeration value="BottomEdge" />
+			<xsd:enumeration value="XPosition" />
+			<xsd:enumeration value="YPosition" />
+			<xsd:enumeration value="Width" />
+			<xsd:enumeration value="Height" />
+			<xsd:enumeration value="XOffset" />
+			<xsd:enumeration value="YOffset" />
+		</xsd:restriction>
+	</xsd:simpleType>
+	<xsd:simpleType name="vertFormatEnum">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="TopAligned" />
+			<xsd:enumeration value="CentreAligned" />
+			<xsd:enumeration value="BottomAligned" />
+			<xsd:enumeration value="Stretched" />
+			<xsd:enumeration value="Tiled" />
+		</xsd:restriction>
+	</xsd:simpleType>
+	<xsd:simpleType name="horzFormatEnum">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="LeftAligned" />
+			<xsd:enumeration value="CentreAligned" />
+			<xsd:enumeration value="RightAligned" />
+			<xsd:enumeration value="Stretched" />
+			<xsd:enumeration value="Tiled" />
+		</xsd:restriction>
+	</xsd:simpleType>
+	<xsd:simpleType name="vertAlignmentEnum">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="TopAligned" />
+			<xsd:enumeration value="CentreAligned" />
+			<xsd:enumeration value="BottomAligned" />
+		</xsd:restriction>
+	</xsd:simpleType>
+	<xsd:simpleType name="horzAlignmentEnum">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="LeftAligned" />
+			<xsd:enumeration value="CentreAligned" />
+			<xsd:enumeration value="RightAligned" />
+		</xsd:restriction>
+	</xsd:simpleType>
+    <xsd:simpleType name="horzTextFormatEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="LeftAligned" />
+            <xsd:enumeration value="RightAligned" />
+            <xsd:enumeration value="CentreAligned" />
+            <xsd:enumeration value="Justified" />
+            <xsd:enumeration value="WordWrapLeftAligned" />
+            <xsd:enumeration value="WordWrapRightAligned" />
+            <xsd:enumeration value="WordWrapCentreAligned" />
+            <xsd:enumeration value="WordWrapJustified" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="vertTextFormatEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="TopAligned" />
+            <xsd:enumeration value="BottomAligned" />
+            <xsd:enumeration value="CentreAligned" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="propertyTypeEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="Generic" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="fontMetricTypeEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="LineSpacing" />
+            <xsd:enumeration value="Baseline" />
+            <xsd:enumeration value="HorzExtent" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="dimensionOperatorEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="Noop" />
+            <xsd:enumeration value="Add" />
+            <xsd:enumeration value="Subtract" />
+            <xsd:enumeration value="Multiply" />
+            <xsd:enumeration value="Divide" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="frameImageComponentEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="Background" />
+            <xsd:enumeration value="TopLeftCorner" />
+            <xsd:enumeration value="TopRightCorner" />
+            <xsd:enumeration value="BottomLeftCorner" />
+            <xsd:enumeration value="BottomRightCorner" />
+            <xsd:enumeration value="LeftEdge" />
+            <xsd:enumeration value="RightEdge" />
+            <xsd:enumeration value="TopEdge" />
+            <xsd:enumeration value="BottomEdge" />
+        </xsd:restriction>
+    </xsd:simpleType>
+</xsd:schema>
Index: /Samples/Media/gui/Font.xsd
===================================================================
--- /Samples/Media/gui/Font.xsd	(revision 5)
+++ /Samples/Media/gui/Font.xsd	(revision 5)
@@ -0,0 +1,34 @@
+<?xml version="1.0" ?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+	<xsd:element name="Font" type="FontType" />
+
+	<xsd:complexType name="FontType">
+		<xsd:sequence>
+			<xsd:element name="Mapping" type="MapType" maxOccurs="unbounded" minOccurs="0" />
+		</xsd:sequence>
+		<xsd:attributeGroup ref="FontAttrs" />
+	</xsd:complexType>
+	<xsd:complexType name="MapType">
+		<xsd:attribute name="Codepoint" type="xsd:nonNegativeInteger" use="required" />
+		<xsd:attribute name="Image" type="xsd:string" use="required" />
+		<xsd:attribute name="HorzAdvance" type="xsd:integer" use="optional" default="-1" />
+	</xsd:complexType>
+	<xsd:attributeGroup name="FontAttrs">
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+		<xsd:attribute name="Filename" type="xsd:string" use="required" />
+		<xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+		<xsd:attribute name="Type" use="required">
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:string">
+					<xsd:enumeration value="FreeType" />
+					<xsd:enumeration value="Pixmap" />
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="Size" type="xsd:nonNegativeInteger" use="optional" default="12" />
+		<xsd:attribute name="NativeHorzRes" type="xsd:nonNegativeInteger" use="optional" default="640" />
+		<xsd:attribute name="NativeVertRes" type="xsd:nonNegativeInteger" use="optional" default="480" />
+		<xsd:attribute name="AutoScaled" type="xsd:boolean" use="optional" default="false" />
+		<xsd:attribute name="AntiAlias" type="xsd:boolean" use="optional" default="true" />
+	</xsd:attributeGroup>
+</xsd:schema>
Index: /Samples/Media/gui/GUILayout.xsd
===================================================================
--- /Samples/Media/gui/GUILayout.xsd	(revision 5)
+++ /Samples/Media/gui/GUILayout.xsd	(revision 5)
@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+	<xsd:element name="GUILayout" type="GUILayoutType"/>
+	
+	<xsd:complexType name="GUILayoutType">
+		<xsd:sequence>
+			<xsd:element name="Window" type="WindowType" />
+		</xsd:sequence>
+		<xsd:attribute name="Parent" type="xsd:string" use="optional" default=""/>
+	</xsd:complexType>
+	
+	<xsd:complexType name="WindowType">
+		<xsd:sequence>
+			<xsd:element name="LayoutImport" type="LayoutImportType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Event" type="EventType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element name="Window" type="WindowType" />
+				<xsd:element name="AutoWindow" type="AutoWindowType" />
+			</xsd:choice>
+			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="Type" type="xsd:string" use="required"/>
+		<xsd:attribute name="Name" type="xsd:string" use="optional" default="" />
+	</xsd:complexType>
+
+	<xsd:complexType name="AutoWindowType">
+		<xsd:sequence>
+			<xsd:element name="LayoutImport" type="LayoutImportType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Event" type="EventType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element name="Window" type="WindowType" />
+				<xsd:element name="AutoWindow" type="AutoWindowType" />
+			</xsd:choice>
+			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="NameSuffix" type="xsd:string" use="required"/>
+	</xsd:complexType>
+
+	<xsd:complexType name="PropertyType">
+		<xsd:simpleContent>
+			<xsd:extension base="xsd:string">
+				<xsd:attribute name="Name" type="xsd:string" use="required"/>
+				<xsd:attribute name="Value" type="xsd:string" use="optional"/>
+			</xsd:extension>
+		</xsd:simpleContent> 
+	</xsd:complexType>
+
+	<xsd:complexType name="LayoutImportType">
+		<xsd:attribute name="Filename" type="xsd:string" use="required"/>
+		<xsd:attribute name="Prefix" type="xsd:string" use="optional" default="" />
+		<xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+	</xsd:complexType>
+
+	<xsd:complexType name="EventType">
+		<xsd:attribute name="Name" type="xsd:string" use="required"/>
+		<xsd:attribute name="Function" type="xsd:string" use="required"/>
+	</xsd:complexType>
+
+</xsd:schema>
+
Index: /Samples/Media/gui/GUIScheme.xsd
===================================================================
--- /Samples/Media/gui/GUIScheme.xsd	(revision 5)
+++ /Samples/Media/gui/GUIScheme.xsd	(revision 5)
@@ -0,0 +1,54 @@
+<?xml version="1.0" ?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+	<xsd:element name="GUIScheme" type="SchemeType" />
+	<xsd:complexType name="SchemeType">
+        <xsd:choice minOccurs="0" maxOccurs="unbounded">
+			<xsd:element name="Imageset" type="NamedDataType" />
+            <xsd:element name="ImagesetFromImage" type="NamedDataType" />
+			<xsd:element name="Font" type="NamedDataType" />
+            <xsd:element name="LookNFeel" type="FileDataType" />
+			<xsd:element name="WindowSet" type="WindowSetType" />
+			<xsd:element name="WindowRendererSet" type="WindowRendererSetType" />
+			<xsd:element name="WindowAlias" type="WindowAliasType" />
+            <xsd:element name="FalagardMapping" type="FalagardMapType" />
+		</xsd:choice>
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowSetType">
+		<xsd:sequence>
+            <xsd:element name="WindowFactory" type="WindowFactoryType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="Filename" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowRendererSetType">
+		<xsd:sequence>
+            <xsd:element name="WindowRendererFactory" type="WindowRendererFactoryType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="Filename" type="xsd:string" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="FileDataType">
+        <xsd:attribute name="Filename" type="xsd:string" use="required" />
+        <xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+    </xsd:complexType>
+	<xsd:complexType name="NamedDataType">
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+		<xsd:attribute name="Filename" type="xsd:string" use="required" />
+		<xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowFactoryType">
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowRendererFactoryType">
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowAliasType">
+		<xsd:attribute name="Alias" type="xsd:string" use="required" />
+		<xsd:attribute name="Target" type="xsd:string" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="FalagardMapType">
+        <xsd:attribute name="WindowType" type="xsd:string" use="required" />
+        <xsd:attribute name="TargetType" type="xsd:string" use="required" />
+		<xsd:attribute name="Renderer" type="xsd:string" use="required" />
+        <xsd:attribute name="LookNFeel" type="xsd:string" use="required" />
+    </xsd:complexType>
+</xsd:schema>
Index: /Samples/Media/gui/Imageset.xsd
===================================================================
--- /Samples/Media/gui/Imageset.xsd	(revision 5)
+++ /Samples/Media/gui/Imageset.xsd	(revision 5)
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+	<xsd:element name="Imageset" type="ImagesetType"/>
+	
+	<xsd:complexType name="ImagesetType">
+		<xsd:sequence>
+			<xsd:element name="Image" type="ImageType" maxOccurs="unbounded"/>
+		</xsd:sequence>
+		<xsd:attribute name="Imagefile" type="xsd:string" use="required"/>
+		<xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+		<xsd:attribute name="Name" type="xsd:string" use="required"/>
+		<xsd:attribute name="NativeHorzRes" type="xsd:nonNegativeInteger" use="optional" default="640" />
+		<xsd:attribute name="NativeVertRes" type="xsd:nonNegativeInteger" use="optional" default="480" />
+		<xsd:attribute name="AutoScaled" type="xsd:boolean" use="optional" default="false" />
+	</xsd:complexType>
+	
+	<xsd:complexType name="ImageType">
+		<xsd:attribute name="Name" type="xsd:string" use="required"/>
+		<xsd:attribute name="XPos" type="xsd:nonNegativeInteger" use="required"/>
+		<xsd:attribute name="YPos" type="xsd:nonNegativeInteger" use="required"/>
+		<xsd:attribute name="Width" type="xsd:nonNegativeInteger" use="required"/>
+		<xsd:attribute name="Height" type="xsd:nonNegativeInteger" use="required"/>
+		<xsd:attribute name="XOffset" type="xsd:integer" use="optional" default="0"/>
+		<xsd:attribute name="YOffset" type="xsd:integer" use="optional" default="0"/>						
+	</xsd:complexType>
+
+</xsd:schema>
Index: /Samples/Media/gui/InstancingDemo.layout
===================================================================
--- /Samples/Media/gui/InstancingDemo.layout	(revision 5)
+++ /Samples/Media/gui/InstancingDemo.layout	(revision 5)
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+    <Window Type="DefaultWindow" Name="root" >
+        <Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Window Type="DefaultWindow" Name="debug_overlay" >
+            <Property Name="Disabled" Value="True" />
+            <Property Name="AlwaysOnTop" Value="True" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+            <Window Type="TaharezLook/StaticText" Name="Panel 1" >
+                <Property Name="Alpha" Value="0.9" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0,0},{0.83,0},{0.23,0},{1,0}}" />
+                <Window Type="TaharezLook/StaticText" Name="OPCurrentFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Current FPS: " />
+                    <Property Name="TextColours" Value="tl:FF4FF06F tr:FF4FF06F bl:FF4FF06F br:FF4FF06F" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="HorzFormatting" Value="HorzCentred" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.12,0},{0.925,0},{0.37,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticImage" Name="OPBar1" >
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.27,0},{0.8,0},{0.295,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPAverageFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Average FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.32,0},{1.075,0},{0.57,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPWorstFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Worst FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.45,0},{1.075,0},{0.7,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPBestFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Best FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.58,0},{1.075,0},{0.83,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPTriCount" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Triangle Count: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.71,0},{1.075,0},{0.96,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+            </Window>
+            <Window Type="TaharezLook/StaticText" Name="OPDebugMsg" >
+                <Property Name="Font" Value="BlueHighway-10" />
+                <Property Name="TextColours" Value="tl:A0FFFFFF tr:A0FFFFFF bl:A0FFFFFF br:A0FFFFFF" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="HorzFormatting" Value="WordWrapCentred" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.93,0},{0.9,0},{1,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="OgreLogo" >
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.9,0},{0.95,0},{1,0},{1,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="CeguiLogo" >
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.9125,0},{0.9115,0},{0.9875,0},{0.95,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+        </Window>
+        <Window Type="DefaultWindow" Name="InstancingDemo" >
+            <Property Name="Font" Value="BlueHighway-12" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{2,0}}" />
+            <Window Type="TaharezLook/FrameWindow" Name="CompositorSelectorWin" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Techniques" />
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="TitlebarFont" Value="BlueHighway-12" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="TitlebarEnabled" Value="True" />
+                <Property Name="UnifiedAreaRect" Value="{{0,0},{0.00508906,0},{0.237344,0},{0.487022,0}}" />
+                <Property Name="CloseButtonEnabled" Value="False" />
+                <Window Type="TaharezLook/RadioButton" Name="tInstancing" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Instancing" />
+                    <Property Name="Selected" Value="True" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.0592397,0},{1.05,0},{0.140919,0}}" />
+                </Window>
+                <Window Type="TaharezLook/RadioButton" Name="tStaticGeometry" >
+                    <Property Name="ID" Value="1" />
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Static Geometry" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.118479,0},{1.05,0},{0.198839,0}}" />
+                </Window>
+                <Window Type="TaharezLook/RadioButton" Name="tIndependantEntities" >
+                    <Property Name="ID" Value="2" />
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Independant Entities" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.180359,0},{1.05,0},{0.260718,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Checkbox" Name="Shadows" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Shadows on/off" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.458078,0},{1.05,0},{0.545613,0}}" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Object Count Text" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Object Count:" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0458855,0},{0.242239,0},{0.480053,0},{0.324677,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Object Count Number" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="160" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.475313,0},{0.245588,0},{0.679954,0},{0.327894,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/Combobox" Name="Objects" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Choose an object" />
+                    <Property Name="ReadOnly" Value="True" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0541145,0},{0.561555,0},{0.954114,0},{0.821555,0}}" />
+                    <Property Name="MaxEditTextLength" Value="1073741823" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Object Count" >
+                    <Property Name="PageSize" Value="0" />
+                    <Property Name="StepSize" Value="1" />
+                    <Property Name="OverlapSize" Value="0" />
+                    <Property Name="DocumentSize" Value="1" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.06,0},{0.33,0},{0.96,0},{0.382246,0}}" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Time Burner Text" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="CPU occupation:" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0664582,0},{0.650819,0},{0.571251,0},{0.750819,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Time Burner Value" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="0 ms" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.616458,0},{0.650819,0},{0.905365,0},{0.750819,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Time Burner" >
+                    <Property Name="PageSize" Value="0" />
+                    <Property Name="StepSize" Value="1" />
+                    <Property Name="OverlapSize" Value="0" />
+                    <Property Name="DocumentSize" Value="1" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.75,0},{0.962344,0},{0.804855,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Checkbox" Name="PostEffect" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Post Effect On/Off" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.813539,0},{0.918334,0},{0.895712,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Button" Name="ExitDemoBtn" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Exit Demo" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{-0.0325521,0},{-0.0135575,0},{0.48346,0},{0.0739895,0}}" />
+                    <Property Name="VerticalAlignment" Value="Bottom" />
+                    <Property Name="HorizontalAlignment" Value="Centre" />
+                </Window>
+            </Window>
+        </Window>
+    </Window>
+</GUILayout>
Index: /Samples/Media/gui/OceanDemoCegui.config
===================================================================
--- /Samples/Media/gui/OceanDemoCegui.config	(revision 5)
+++ /Samples/Media/gui/OceanDemoCegui.config	(revision 5)
@@ -0,0 +1,6 @@
+<?xml version="1.0" ?>
+<CEGUIConfig
+	Scheme="TaharezLookSkin.scheme"
+	Layout="OceanDemoLayout.xml"
+	DefaultFont="BlueHighway-12"
+/>
Index: /Samples/Media/gui/OceanDemoLayout.xml
===================================================================
--- /Samples/Media/gui/OceanDemoLayout.xml	(revision 5)
+++ /Samples/Media/gui/OceanDemoLayout.xml	(revision 5)
@@ -0,0 +1,264 @@
+<?xml version="1.0" ?>
+<GUILayout>
+<Window Type="DefaultGUISheet" Name="root">
+
+	<Window Type="DefaultGUISheet" Name="debug_overlay">
+		<Property Name="AlwaysOnTop" Value="True" />
+		<Property Name="Disabled" Value="True" />
+		
+		<Window Type="TaharezLook/StaticText" Name="Panel 1">
+			<Property Name="UnifiedPosition" Value="{{0,0},{0.83,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.23,0},{0.17,0}}" />
+			<Property Name="Alpha" Value="0.9" />
+			<Property Name="InheritsAlpha" Value="False" />
+	
+			<Window Type="TaharezLook/StaticText" Name="OPCurrentFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.12,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.85,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FF4FF06F tr:FF4FF06F bl:FF4FF06F br:FF4FF06F" />
+				<Property Name="HorzFormatting" Value="HorzCentred" />
+				<Property Name="Text" Value="Current FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticImage" Name="OPBar1">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="UnifiedPosition" Value="{{0.2,0},{0.27,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.6,0},{0.025,0}}" />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPAverageFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.32,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Average FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPWorstFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.45,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Worst FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPBestFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.58,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Best FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPTriCount">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.71,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Triangle Count: " />
+			</Window>
+
+		</Window>
+
+		<Window Type="TaharezLook/StaticText" Name="OPDebugMsg">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="Font" Value="BlueHighway-10" />
+			<Property Name="UnifiedPosition" Value="{{0.25,0},{0.93,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.65,0},{0.07,0}}" />
+			<Property Name="TextColours" Value="tl:A0FFFFFF tr:A0FFFFFF bl:A0FFFFFF br:A0FFFFFF" />
+			<Property Name="InheritsAlpha" Value="False" />
+			<Property Name="VertFormatting" Value="VertCentred" />
+			<Property Name="HorzFormatting" Value="WordWrapCentred" />
+		</Window>
+
+		<Window Type="TaharezLook/StaticImage" Name="OgreLogo">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="UnifiedPosition" Value="{{0.9,0},{0.95,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.1,0},{0.05,0}}" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+
+		<Window Type="TaharezLook/StaticImage" Name="CeguiLogo">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="UnifiedPosition" Value="{{0.9125,0},{0.9115,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.075,0},{0.0385,0}}" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+
+	</Window>
+
+	<Window Type="DefaultGUISheet" Name="OceanDemo">
+
+		<Property Name="UnifiedMaxSize" Value="{{1,0},{2,0}}" />
+		<Property Name="UnifiedSize" Value="{{1,0},{2,0}}" />
+
+
+		<Window Type="TaharezLook/StaticText" Name="HelpTxt">
+			<Property Name="UnifiedPosition" Value="{{0.6,0},{0.8,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.5,0},{0.3,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.5,0},{0.3,0}}" />
+			<Property Name="Text" Value="Use the Combo boxes to select a shader and a model" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+		
+		<Window Type="TaharezLook/FrameWindow" Name="OceanDemo/MainWin">
+			<Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" />
+			<Property Name="UnifiedMaxSize" Value="{{0.23,0},{0.23,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.23,0},{0.23,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.23,0},{0.23,0}}" />
+			<Property Name="Text" Value="Selector" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="CloseButtonEnabled" Value="False" />
+
+			<Window Type="TaharezLook/StaticText" Name="ShaderTxt">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.10,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="HorzFormatting" Value="LeftAligned" />
+				<Property Name="Text" Value="Active Material" />
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="InheritsAlpha" Value="False" />
+			</Window>
+
+			<Window Type="TaharezLook/Combobox" Name="ShaderCombos">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.27,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="ReadOnly" Value="True" />
+				<Property Name="ClippedByParent" Value="False" />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="ModelTxt">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.40,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="HorzFormatting" Value="LeftAligned" />
+				<Property Name="Text" Value="Active Model" />
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="InheritsAlpha" Value="False" />
+			</Window>
+
+			<Window Type="TaharezLook/Combobox" Name="ModelCombos">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.57,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="ReadOnly" Value="True" />
+				<Property Name="ClippedByParent" Value="False" />
+			</Window>
+
+			<Window Type="TaharezLook/Button" Name="ExitDemoBtn">
+				<Property Name="UnifiedPosition" Value="{{0.25,0},{0.79,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.04,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.04,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.33,0},{0.04,0}}" />
+				<Property Name="Text" Value="Exit Demo" />
+				<Property Name="InheritsAlpha" Value="False" />
+			</Window>
+
+
+		</Window>
+
+
+		<Window Type="TaharezLook/FrameWindow" Name="ShaderControlsWin">
+			<Property Name="UnifiedPosition" Value="{{0.50,0},{0,0}}" />
+			<Property Name="UnifiedMaxSize" Value="{{0.5,0},{0.22,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.5,0},{0.22,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.5,0},{0.22,0}}" />
+			<Property Name="Text" Value="Shader Controls" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="CloseButtonEnabled" Value="False" />
+			
+			<Window Type="TaharezLook/VerticalScrollbar" Name="VerticalScroll">
+				<Property Name="UnifiedPosition" Value="{{0.94,0},{0.2,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.04,0},{0.75,0}}" />
+				<Property Name="DocumentSize" Value="1" />
+				<Property Name="PageSize" Value="1" />
+				<Property Name="StepSize" Value="0.01" />
+				<Property Name="OverlapSize" Value="0.5" />
+			</Window>
+			
+		</Window>
+
+		<Window Type="TaharezLook/FrameWindow" Name="MovementControlsWin">
+			<Property Name="UnifiedPosition" Value="{{0.0,0},{0.2,0}}" />
+			<Property Name="UnifiedMaxSize" Value="{{0.15,0},{0.22,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.15,0},{0.22,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.15,0},{0.22,0}}" />
+			<Property Name="Text" Value="Movement" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="CloseButtonEnabled" Value="False" />
+			
+			<Window Type="TaharezLook/RadioButton" Name="CameraRBtn">
+				<Property Name="UnifiedPosition" Value="{{0.1,0},{0.2,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.33,0},{0.03,0}}" />
+				<Property Name="Text" Value="Camera" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="Selected" Value="true" />
+				<Property Name="ID" Value="0" />
+			
+			</Window>
+
+			<Window Type="TaharezLook/RadioButton" Name="ModelRBtn">
+				<Property Name="UnifiedPosition" Value="{{0.1,0},{0.4,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.33,0},{0.03,0}}" />
+				<Property Name="Text" Value="Model" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="Selected" Value="False" />
+				<Property Name="ID" Value="1" />
+			
+			</Window>
+			
+			<Window Type="TaharezLook/Checkbox" Name="ModelSpinCB">
+				<Property Name="UnifiedPosition" Value="{{0.2,0},{0.53,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="Text" Value="Spin" />
+				<Property Name="Selected" Value="True" />
+			</Window>
+
+			<Window Type="TaharezLook/Checkbox" Name="LightSpinCB">
+				<Property Name="UnifiedPosition" Value="{{0.1,0},{0.7,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="Text" Value="Spin Light" />
+				<Property Name="Selected" Value="False" />
+			</Window>
+		</Window>
+	</Window>
+
+</Window>
+
+</GUILayout>
Index: /Samples/Media/gui/TaharezLook.imageset
===================================================================
--- /Samples/Media/gui/TaharezLook.imageset	(revision 5)
+++ /Samples/Media/gui/TaharezLook.imageset	(revision 5)
@@ -0,0 +1,242 @@
+<?xml version="1.0" ?>
+<Imageset Name="TaharezLook" Imagefile="TaharezLook.tga" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true">
+	<Image Name="ClientBrush" XPos="2" YPos="2" Width="64" Height="64" />
+	<Image Name="WindowLeftEdge" XPos="6" YPos="95" Width="1" Height="22" XOffset="4" />
+	<Image Name="WindowRightEdge" XPos="34" YPos="95" Width="1" Height="22" XOffset="-5" />
+	<Image Name="WindowTopEdge" XPos="9" YPos="68" Width="23" Height="1" />
+	<Image Name="WindowBottomEdge" XPos="9" YPos="143" Width="23" Height="1" />
+	<Image Name="WindowTopLeft" XPos="2" YPos="68" Width="5" Height="24" />
+	<Image Name="WindowTopRight" XPos="34" YPos="68" Width="5" Height="24" />
+	<Image Name="WindowBottomLeft" XPos="2" YPos="120" Width="5" Height="24" />
+	<Image Name="WindowBottomRight" XPos="34" YPos="120" Width="5" Height="24" />
+	<Image Name="ButtonLeftNormal" XPos="68" YPos="20" Width="12" Height="16" />
+	<Image Name="ButtonMiddleNormal" XPos="82" YPos="20" Width="12" Height="16" />
+	<Image Name="ButtonRightNormal" XPos="96" YPos="20" Width="12" Height="16" />
+	<Image Name="ButtonLeftPushed" XPos="68" YPos="38" Width="12" Height="16" />
+	<Image Name="ButtonMiddlePushed" XPos="82" YPos="38" Width="12" Height="16" />
+	<Image Name="ButtonRightPushed" XPos="96" YPos="38" Width="12" Height="16" />
+	<Image Name="ButtonLeftHighlight" XPos="68" YPos="56" Width="12" Height="16" />
+	<Image Name="ButtonMiddleHighlight" XPos="82" YPos="56" Width="12" Height="16" />
+	<Image Name="ButtonRightHighlight" XPos="96" YPos="56" Width="12" Height="16" />
+	<Image Name="CheckboxNormal" XPos="110" YPos="2" Width="12" Height="12" />
+	<Image Name="CheckboxHover" XPos="110" YPos="30" Width="12" Height="12" />
+	<Image Name="CheckboxMark" XPos="110" YPos="16" Width="12" Height="12" />
+	<Image Name="RadioButtonNormal" XPos="124" YPos="2" Width="12" Height="12" />
+	<Image Name="RadioButtonHover" XPos="124" YPos="30" Width="12" Height="12" />
+	<Image Name="RadioButtonMark" XPos="124" YPos="16" Width="12" Height="12" />
+	<Image Name="TitlebarLeft" XPos="68" YPos="2" Width="8" Height="16" />
+	<Image Name="TitlebarMiddle" XPos="78" YPos="2" Width="8" Height="16" />
+	<Image Name="TitlebarRight" XPos="88" YPos="2" Width="8" Height="16" />
+	<Image Name="NewTitlebarLeft" XPos="61" YPos="127" Width="13" Height="16" />
+	<Image Name="NewTitlebarMiddle" XPos="77" YPos="127" Width="12" Height="16" />
+	<Image Name="NewTitlebarRight" XPos="92" YPos="127" Width="12" Height="16" />
+	<Image Name="SysAreaMiddle" XPos="107" YPos="127" Width="12" Height="16" />
+	<Image Name="SysAreaRight" XPos="122" YPos="127" Width="13" Height="16" />
+	<Image Name="StaticLeft" XPos="41" YPos="89" Width="6" Height="6" />
+	<Image Name="StaticRight" XPos="63" YPos="89" Width="6" Height="6" />
+	<Image Name="StaticTop" XPos="52" YPos="78" Width="6" Height="6" />
+	<Image Name="StaticBottom" XPos="52" YPos="100" Width="6" Height="6" />
+	<Image Name="StaticTopLeft" XPos="41" YPos="78" Width="6" Height="6" />
+	<Image Name="StaticTopRight" XPos="63" YPos="78" Width="6" Height="6" />
+	<Image Name="StaticBottomLeft" XPos="41" YPos="100" Width="6" Height="6" />
+	<Image Name="StaticBottomRight" XPos="63" YPos="100" Width="6" Height="6" />
+	<Image Name="StaticBackdrop" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="ProgressBarLeft" XPos="71" YPos="74" Width="7" Height="12" />
+	<Image Name="ProgressBarMiddle" XPos="80" YPos="74" Width="6" Height="12" />
+	<Image Name="ProgressBarRight" XPos="88" YPos="74" Width="6" Height="12" />
+	<Image Name="ProgressBarDimSegment" XPos="96" YPos="74" Width="8" Height="12" />
+	<Image Name="ProgressBarLitSegment" XPos="106" YPos="74" Width="8" Height="12" />
+	<Image Name="EditBoxLeft" XPos="41" YPos="108" Width="4" Height="18" />
+	<Image Name="EditBoxMiddle" XPos="47" YPos="108" Width="4" Height="18" />
+	<Image Name="EditBoxRight" XPos="53" YPos="108" Width="4" Height="18" />
+	<Image Name="EditBoxCarat" XPos="60" YPos="108" Width="4" Height="18" />
+	<Image Name="SpinnerUpNormal" XPos="68" YPos="110" Width="10" Height="6" />
+	<Image Name="SpinnerDownNormal" XPos="68" YPos="118" Width="10" Height="6" />
+	<Image Name="SpinnerUpHover" XPos="82" YPos="110" Width="10" Height="6" />
+	<Image Name="SpinnerDownHover" XPos="82" YPos="118" Width="10" Height="6" />
+	<Image Name="TextSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" />
+	<Image Name="VertScrollTop" XPos="182" YPos="2" Width="20" Height="8" />
+	<Image Name="VertScrollMiddle" XPos="182" YPos="12" Width="20" Height="8" />
+	<Image Name="VertScrollBottom" XPos="182" YPos="22" Width="20" Height="8" />
+	<Image Name="VertScrollBarSegment" XPos="206" YPos="2" Width="4" Height="10" />
+	<Image Name="VertScrollThumbNormal" XPos="214" YPos="2" Width="8" Height="24" />
+	<Image Name="VertScrollThumbHover" XPos="224" YPos="2" Width="8" Height="24" />
+	<Image Name="VertScrollUpNormal" XPos="196" YPos="32" Width="12" Height="12" />
+	<Image Name="VertScrollDownNormal" XPos="182" YPos="32" Width="12" Height="12" />
+	<Image Name="VertScrollUpHover" XPos="196" YPos="46" Width="12" Height="12" />
+	<Image Name="VertScrollDownHover" XPos="182" YPos="46" Width="12" Height="12" />
+	<Image Name="MiniVertScrollBarSegment" XPos="207" YPos="60" Width="4" Height="10" />
+	<Image Name="MiniVertScrollThumbNormal" XPos="214" YPos="59" Width="7" Height="22" />
+	<Image Name="MiniVertScrollThumbTopNormal" XPos="214" YPos="59" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbMiddleNormal" XPos="214" YPos="65" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbBottomNormal" XPos="214" YPos="76" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbTopHover" XPos="223" YPos="59" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbMiddleHover" XPos="223" YPos="65" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbBottomHover" XPos="223" YPos="76" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbHover" XPos="223" YPos="59" Width="7" Height="22" />
+	<Image Name="MiniVertScrollUpNormal" XPos="194" YPos="60" Width="10" Height="9" />
+	<Image Name="MiniVertScrollDownNormal" XPos="182" YPos="59" Width="10" Height="9" />
+	<Image Name="MiniVertScrollUpHover" XPos="194" YPos="70" Width="10" Height="9" />
+	<Image Name="MiniVertScrollDownHover" XPos="182" YPos="69" Width="10" Height="9" />
+	<Image Name="VertSliderBody" XPos="234" YPos="2" Width="9" Height="48" />
+	<Image Name="VertSliderThumbNormal" XPos="217" YPos="28" Width="15" Height="6" />
+	<Image Name="VertSliderThumbHover" XPos="217" YPos="36" Width="15" Height="6" />
+	<Image Name="MiniHorzScrollBarSegment" XPos="244" YPos="80" Width="10" Height="4" />
+	<Image Name="MiniHorzScrollThumbNormal" XPos="233" YPos="87" Width="22" Height="7" />
+	<Image Name="MiniHorzScrollThumbLeftNormal" XPos="233" YPos="87" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbMiddleNormal" XPos="239" YPos="87" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbRightNormal" XPos="250" YPos="87" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbHover" XPos="233" YPos="96" Width="22" Height="7" />
+	<Image Name="MiniHorzScrollThumbLeftHover" XPos="233" YPos="96" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbMiddleHover" XPos="239" YPos="96" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbRightHover" XPos="250" YPos="96" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollLeftNormal" XPos="246" YPos="55" Width="9" Height="10" />
+	<Image Name="MiniHorzScrollRightNormal" XPos="245" YPos="67" Width="9" Height="10" />
+	<Image Name="MiniHorzScrollLeftHover" XPos="236" YPos="55" Width="9" Height="10" />
+	<Image Name="MiniHorzScrollRightHover" XPos="235" YPos="67" Width="9" Height="10" />
+	<Image Name="ListboxLeft" XPos="41" YPos="89" Width="7" Height="6" />
+	<Image Name="ListboxRight" XPos="62" YPos="89" Width="7" Height="6" />
+	<Image Name="ListboxTop" XPos="52" YPos="78" Width="6" Height="7" />
+	<Image Name="ListboxBottom" XPos="52" YPos="99" Width="6" Height="7" />
+	<Image Name="ListboxTopLeft" XPos="41" YPos="78" Width="7" Height="7" />
+	<Image Name="ListboxTopRight" XPos="62" YPos="78" Width="7" Height="7" />
+	<Image Name="ListboxBottomLeft" XPos="41" YPos="99" Width="7" Height="7" />
+	<Image Name="ListboxBottomRight" XPos="62" YPos="99" Width="7" Height="7" />
+	<Image Name="ListboxBackdrop" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="ListboxSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" />
+	<Image Name="ComboboxEditLeft" XPos="138" YPos="2" Width="8" Height="16" />
+	<Image Name="ComboboxEditMiddle" XPos="148" YPos="2" Width="8" Height="16" />
+	<Image Name="ComboboxListButtonNormal" XPos="158" YPos="2" Width="16" Height="16" />
+	<Image Name="ComboboxListButtonHover" XPos="158" YPos="20" Width="16" Height="16" />
+	<Image Name="ComboboxListLeft" XPos="138" YPos="48" Width="8" Height="8" />
+	<Image Name="ComboboxListRight" XPos="158" YPos="48" Width="8" Height="8" />
+	<Image Name="ComboboxListTop" XPos="148" YPos="48" Width="8" Height="8" />
+	<Image Name="ComboboxListBottom" XPos="148" YPos="58" Width="8" Height="8" />
+	<Image Name="ComboboxListTopLeft" XPos="138" YPos="38" Width="8" Height="8" />
+	<Image Name="ComboboxListTopRight" XPos="158" YPos="38" Width="8" Height="8" />
+	<Image Name="ComboboxListBottomLeft" XPos="138" YPos="58" Width="8" Height="8" />
+	<Image Name="ComboboxListBottomRight" XPos="158" YPos="58" Width="8" Height="8" />
+	<Image Name="ComboboxListBackdrop" XPos="148" YPos="48" Width="8" Height="8" />
+	<Image Name="ComboboxSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" />
+	<Image Name="ComboboxDividerLeft" XPos="138" YPos="68" Width="14" Height="1" />
+	<Image Name="ComboboxDividerMiddle" XPos="154" YPos="68" Width="8" Height="1" />
+	<Image Name="ComboboxDividerRight" XPos="164" YPos="68" Width="14" Height="1" />
+	<Image Name="HeaderBarBackdropNormal" XPos="230" YPos="163" Width="10" Height="12" />
+	<Image Name="HeaderBarBackdropHover" XPos="230" YPos="163" Width="10" Height="12" />
+	<Image Name="HeaderBarSplitterNormal" XPos="225" YPos="92" Width="3" Height="16" />
+	<Image Name="HeaderBarSplitterHover" XPos="200" YPos="92" Width="3" Height="16" />
+	<Image Name="HeaderBarSortUp" XPos="233" YPos="178" Width="8" Height="8" />
+	<Image Name="HeaderBarSortDown" XPos="244" YPos="178" Width="8" Height="8" />
+	<Image Name="MultiListLeft" XPos="170" YPos="92" Width="7" Height="6" />
+	<Image Name="MultiListRight" XPos="191" YPos="92" Width="7" Height="6" />
+	<Image Name="MultiListTop" XPos="181" YPos="81" Width="6" Height="7" />
+	<Image Name="MultiListBottom" XPos="181" YPos="102" Width="6" Height="7" />
+	<Image Name="MultiListTopLeft" XPos="170" YPos="81" Width="7" Height="7" />
+	<Image Name="MultiListTopRight" XPos="191" YPos="81" Width="7" Height="7" />
+	<Image Name="MultiListBottomLeft" XPos="170" YPos="102" Width="7" Height="7" />
+	<Image Name="MultiListBottomRight" XPos="191" YPos="102" Width="7" Height="7" />
+	<Image Name="MultiListBackdrop" XPos="181" YPos="92" Width="6" Height="6" />
+	<Image Name="MultiListSelectionBrush" XPos="9" YPos="71" Width="14" Height="14" />
+	<Image Name="AltProgressLeft" XPos="71" YPos="88" Width="8" Height="12" />
+	<Image Name="AltProgressMiddle" XPos="81" YPos="88" Width="8" Height="12" />
+	<Image Name="AltProgressRight" XPos="91" YPos="88" Width="8" Height="12" />
+	<Image Name="AltProgressQuarter" XPos="102" YPos="89" Width="3" Height="4" />
+	<Image Name="AltProgressHalf" XPos="109" YPos="89" Width="4" Height="5" />
+	<Image Name="AltProgressLight1" XPos="100" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight2" XPos="106" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight3" XPos="112" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight4" XPos="118" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight5" XPos="124" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight6" XPos="130" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight7" XPos="136" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight8" XPos="142" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight9" XPos="148" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight10" XPos="154" YPos="97" Width="4" Height="8" />
+	<Image Name="CloseButtonNormal" XPos="41" YPos="128" Width="16" Height="16" />
+	<Image Name="CloseButtonHover" XPos="41" YPos="146" Width="16" Height="16" />
+	<Image Name="CloseButtonPressed" XPos="41" YPos="164" Width="16" Height="16" />
+	<Image Name="NewCloseButtonNormal" XPos="90" YPos="146" Width="10" Height="10" />
+	<Image Name="NewCloseButtonHover" XPos="90" YPos="146" Width="10" Height="10" />
+	<Image Name="NewCloseButtonPressed" XPos="90" YPos="146" Width="10" Height="10" />
+	<Image Name="MultiLineEditboxLeft" XPos="41" YPos="89" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxRight" XPos="63" YPos="89" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxTop" XPos="52" YPos="78" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxBottom" XPos="52" YPos="100" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxTopLeft" XPos="41" YPos="78" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxTopRight" XPos="63" YPos="78" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxBottomLeft" XPos="41" YPos="100" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxBottomRight" XPos="63" YPos="100" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxBackdrop" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxSelectionBrush" XPos="9" YPos="71" Width="14" Height="14" />
+	<Image Name="MouseTarget" XPos="182" YPos="127" Width="17" Height="17" XOffset="-8" YOffset="-8" />
+	<Image Name="MouseArrow" XPos="138" YPos="127" Width="31" Height="25" XOffset="0" YOffset="0" />
+	<Image Name="MouseMoveCursor" XPos="201" YPos="127" Width="18" Height="18" XOffset="-8" YOffset="-8" />
+	<Image Name="MouseNoSoCursor" XPos="221" YPos="127" Width="8" Height="18" XOffset="-3" YOffset="-8" />
+	<Image Name="MouseEsWeCursor" XPos="182" YPos="150" Width="18" Height="8" XOffset="-8" YOffset="-3" />
+	<Image Name="MouseNeSwCursor" XPos="201" YPos="147" Width="14" Height="14" XOffset="-7" YOffset="-7" />
+	<Image Name="MouseNwSeCursor" XPos="230" YPos="126" Width="14" Height="14" XOffset="-7" YOffset="-7" />
+	<Image Name="MouseTextBar" XPos="173" YPos="127" Width="7" Height="18" XOffset="-2" YOffset="-9" />
+	<Image Name="TabHorizontalFiller" XPos="197" YPos="201" Width="7" Height="1" />
+	<Image Name="TabContentPaneUpperLeft" XPos="41" YPos="78" Width="7" Height="7" />
+	<Image Name="TabContentPaneUpper" XPos="52" YPos="78" Width="6" Height="7" />
+	<Image Name="TabContentPaneUpperRight" XPos="62" YPos="78" Width="7" Height="7" />
+	<Image Name="TabContentPaneLeft" XPos="41" YPos="89" Width="7" Height="6" />
+	<Image Name="TabContentPaneRight" XPos="62" YPos="89" Width="7" Height="6" />
+	<Image Name="TabContentPaneLower" XPos="52" YPos="99" Width="6" Height="7" />
+	<Image Name="TabContentPaneLowerLeft" XPos="41" YPos="99" Width="7" Height="7" />
+	<Image Name="TabContentPaneLowerRight" XPos="62" YPos="99" Width="7" Height="7" />
+	<Image Name="TabContentPaneMiddle" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="TabButtonScrollLeftNormal" XPos="97" YPos="108" Width="16" Height="17" />
+	<Image Name="TabButtonScrollRightNormal" XPos="112" YPos="108" Width="16" Height="17" />
+	<Image Name="TabButtonScrollLeftHover" XPos="127" YPos="108" Width="16" Height="17" />
+	<Image Name="TabButtonScrollRightHover" XPos="142" YPos="108" Width="16" Height="17" />
+	<Image Name="TabButtonLeftNormal" XPos="41" YPos="89" Width="7" Height="6" />
+	<Image Name="TabButtonRightNormal" XPos="62" YPos="89" Width="7" Height="6" />
+	<Image Name="TabButtonUpperNormal" XPos="52" YPos="78" Width="6" Height="7" />
+	<Image Name="TabButtonLowerNormal" XPos="52" YPos="99" Width="6" Height="7" />
+	<Image Name="TabButtonUpperLeftNormal" XPos="41" YPos="78" Width="7" Height="7" />
+	<Image Name="TabButtonUpperLeft2Normal" XPos="186" YPos="164" Width="7" Height="7" />
+	<Image Name="TabButtonUpperRightNormal" XPos="62" YPos="78" Width="7" Height="7" />
+	<Image Name="TabButtonLowerLeftNormal" XPos="41" YPos="99" Width="7" Height="7" />
+	<Image Name="TabButtonLowerRightNormal" XPos="62" YPos="99" Width="7" Height="7" />
+	<Image Name="TabButtonLowerRight2Normal" XPos="187" YPos="195" Width="7" Height="7" />
+	<Image Name="TabButtonMiddleNormal" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="TabButtonLeftSelected" XPos="41" YPos="89" Width="7" Height="6" />
+	<Image Name="TabButtonRightSelected" XPos="62" YPos="89" Width="7" Height="6" />
+	<Image Name="TabButtonUpperSelected" XPos="52" YPos="78" Width="6" Height="7" />
+	<Image Name="TabButtonLowerSelected" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="TabButtonUpperLeftSelected" XPos="41" YPos="78" Width="7" Height="7" />
+	<Image Name="TabButtonUpperRightSelected" XPos="62" YPos="78" Width="7" Height="7" />
+	<Image Name="TabButtonLowerLeftSelected" XPos="41" YPos="99" Width="7" Height="7" />
+	<Image Name="TabButtonLowerRightSelected" XPos="62" YPos="99" Width="7" Height="7" />
+	<Image Name="TabButtonMiddleSelected" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="TooltipTopLeft" XPos="61" YPos="160" Width="4" Height="4" />
+	<Image Name="TooltipTopRight" XPos="85" YPos="160" Width="5" Height="4" />
+	<Image Name="TooltipBottomLeft" XPos="61" YPos="184" Width="4" Height="5" />
+	<Image Name="TooltipBottomRight" XPos="85" YPos="184" Width="5" Height="5" />
+	<Image Name="TooltipLeftEdge" XPos="61" YPos="171" Width="4" Height="6" />
+	<Image Name="TooltipRightEdge" XPos="85" YPos="171" Width="5" Height="6" />
+	<Image Name="TooltipTopEdge" XPos="72" YPos="160" Width="6" Height="4" />
+	<Image Name="TooltipBottomEdge" XPos="72" YPos="184" Width="6" Height="5" />
+	<Image Name="TooltipMiddle" XPos="72" YPos="171" Width="6" Height="6" />
+	<Image Name="MenuTopLeft" XPos="166" YPos="204" Width="2" Height="2" />
+	<Image Name="MenuTopRight" XPos="175" YPos="204" Width="3" Height="2" />
+	<Image Name="MenuBottomLeft" XPos="166" YPos="213" Width="2" Height="3" />
+	<Image Name="MenuBottomRight" XPos="175" YPos="213" Width="3" Height="3" />
+	<Image Name="MenuLeft" XPos="166" YPos="209" Width="2" Height="1" />
+	<Image Name="MenuRight" XPos="175" YPos="209" Width="3" Height="1" />
+	<Image Name="MenuTop" XPos="171" YPos="204" Width="1" Height="2" />
+	<Image Name="MenuBottom" XPos="171" YPos="213" Width="1" Height="3" />
+	<Image Name="MenuMiddle" XPos="171" YPos="209" Width="1" Height="1" />
+	<Image Name="PopupMenuFrameTopLeft" XPos="186" YPos="204" Width="2" Height="2" />
+	<Image Name="PopupMenuFrameTopRight" XPos="195" YPos="204" Width="4" Height="2" />
+	<Image Name="PopupMenuFrameBottomLeft" XPos="186" YPos="213" Width="2" Height="4" />
+	<Image Name="PopupMenuFrameBottomRight" XPos="195" YPos="213" Width="4" Height="4" />
+	<Image Name="PopupMenuFrameLeft" XPos="186" YPos="209" Width="2" Height="1" />
+	<Image Name="PopupMenuFrameRight" XPos="195" YPos="209" Width="4" Height="1" />
+	<Image Name="PopupMenuFrameTop" XPos="191" YPos="204" Width="1" Height="2" />
+	<Image Name="PopupMenuFrameBottom" XPos="191" YPos="213" Width="1" Height="4" />
+	<Image Name="PopupMenuMiddle" XPos="191" YPos="209" Width="1" Height="1" />
+	<Image Name="PopupMenuArrowRight" XPos="179" YPos="204" Width="5" Height="5" />
+	<Image Name="PopupMenuArrowLeft" XPos="179" YPos="210" Width="5" Height="5" />
+</Imageset>
Index: /Samples/Media/gui/TaharezLook.looknfeel
===================================================================
--- /Samples/Media/gui/TaharezLook.looknfeel	(revision 5)
+++ /Samples/Media/gui/TaharezLook.looknfeel	(revision 5)
@@ -0,0 +1,4315 @@
+<?xml version="1.0" ?>
+<Falagard>
+    <!--
+    ***************************************************
+        TaharezLook/Button
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Button">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" />
+        <PropertyDefinition name="VertLabelFormatting" initialValue="CentreAligned" />
+        <PropertyDefinition name="HorzLabelFormatting" initialValue="CentreAligned" />
+        <PropertyDefinition name="NormalImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="VertImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <PropertyDefinition name="HorzImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <VertFormatProperty name="VertLabelFormatting" />
+                <HorzFormatProperty name="HorzLabelFormatting" />
+            </TextComponent>
+        </ImagerySection>
+        <ImagerySection name="normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="ButtonLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ButtonRightNormal" />
+                <Image type="Background" imageset="TaharezLook" image="ButtonMiddleNormal" />
+            </FrameComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="NormalImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="ButtonLeftHighlight" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ButtonRightHighlight" />
+                <Image type="Background" imageset="TaharezLook" image="ButtonMiddleHighlight" />
+            </FrameComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="HoverImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="pushed">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="ButtonLeftPushed" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ButtonRightPushed" />
+                <Image type="Background" imageset="TaharezLook" image="ButtonMiddlePushed" />
+            </FrameComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="PushedImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="pushed" />
+                <Section section="label">
+                    <ColourProperty name="PushedTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="PushedOff">
+            <Layer>
+                <Section section="hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/RadioButton
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/RadioButton">
+		<PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" />
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" >
+                        <ImageDim imageset="TaharezLook" image="RadioButtonNormal" dimension="Width">
+                            <DimOperator op="Add">
+                                <AbsoluteDim value="3" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <ImagerySection name="normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="RadioButtonNormal" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="RadioButtonHover" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="select_mark">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="RadioButtonMark" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedNormal">
+            <Layer>
+                <Section section="normal" />
+                <Section section="select_mark" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedHover">
+            <Layer>
+                <Section section="hover" />
+                <Section section="select_mark" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedDisabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="select_mark">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Checkbox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Checkbox">
+		<PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" />
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" >
+                        <ImageDim imageset="TaharezLook" image="CheckboxNormal" dimension="Width">
+                            <DimOperator op="Add">
+                                <AbsoluteDim value="3" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <ImagerySection name="normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="CheckboxNormal" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="CheckboxHover" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="select_mark">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="CheckboxMark" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedNormal">
+            <Layer>
+                <Section section="normal" />
+                <Section section="select_mark" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedHover">
+            <Layer>
+                <Section section="hover" />
+                <Section section="select_mark" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedDisabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="select_mark">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Editbox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Editbox">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="SelectedTextColour" initialValue="FF000000" redrawOnWrite="true" />
+        <PropertyDefinition name="ActiveSelectionColour" initialValue="FF607FFF" redrawOnWrite="true" />
+        <PropertyDefinition name="InactiveSelectionColour" initialValue="FF808080" redrawOnWrite="true" />
+        <Property name="MouseCursorImage" value="set:TaharezLook image:MouseTextBar" />
+        <NamedArea name="TextArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="5" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="5" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" offset="-5" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" offset="-5" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="container_normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="EditBoxLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="EditBoxRight" />
+                <Image type="Background" imageset="TaharezLook" image="EditBoxMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="selection">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="TextSelectionBrush" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="Carat">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><ImageDim imageset="TaharezLook" image="EditBoxCarat" dimension="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="EditBoxCarat" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="container_normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ReadOnly">
+            <Layer>
+                <Section section="container_normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="container_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ActiveSelection">
+            <Layer>
+                <Section section="selection">
+                    <ColourProperty name="ActiveSelectionColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveSelection">
+            <Layer>
+                <Section section="selection">
+                    <ColourProperty name="InactiveSelectionColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Titlebar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Titlebar">
+        <PropertyDefinition name="CaptionColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <ImagerySection name="main">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="NewTitlebarLeft" />
+                <VertFormat type="Stretched" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width">
+                                    <DimOperator op="Add">
+                                        <ImageDim imageset="TaharezLook" image="SysAreaMiddle" dimension="Width" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="NewTitlebarRight" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="SysAreaMiddle" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="SysAreaRight" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="NewTitlebarLeft" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width">
+                                    <DimOperator op="Add">
+                                        <ImageDim imageset="TaharezLook" image="SysAreaMiddle" dimension="Width">
+                                            <DimOperator op="Add">
+                                                <ImageDim imageset="TaharezLook" image="NewTitlebarRight" dimension="Width" />
+                                            </DimOperator>
+                                        </ImageDim>
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="NewTitlebarMiddle" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="caption">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="NewTitlebarLeft" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" offset="-75" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ColourProperty name="CaptionColour" />
+                <VertFormat type="CentreAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <StateImagery name="Active">
+            <Layer>
+                <Section section="main" />
+                <Section section="caption" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Inactive">
+            <Layer>
+                <Section section="main" />
+                <Section section="caption" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="caption">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/FrameWindow
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/FrameWindow">
+        <PropertyLinkDefinition name="CaptionColour" widget="__auto_titlebar__" targetProperty="CaptionColour" initialValue="FFFFFFFF" />
+        <PropertyLinkDefinition name="TitlebarFont" widget="__auto_titlebar__" targetProperty="Font" />
+        <Property name="NSSizingCursorImage" value="set:TaharezLook image:MouseNoSoCursor" />
+        <Property name="EWSizingCursorImage" value="set:TaharezLook image:MouseEsWeCursor" />
+        <Property name="NWSESizingCursorImage" value="set:TaharezLook image:MouseNwSeCursor" />
+        <Property name="NESWSizingCursorImage" value="set:TaharezLook image:MouseNeSwCursor" />
+        <NamedArea name="ClientWithTitleWithFrame">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="WindowTopLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_titlebar__" dimension="BottomEdge" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="WindowTopRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="WindowBottomEdge" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ClientWithTitleNoFrame">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_titlebar__" dimension="BottomEdge" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="BottomEdge" ><WidgetDim dimension="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ClientNoTitleWithFrame">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="WindowTopLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="WindowTopEdge" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="WindowTopRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="WindowBottomEdge" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ClientNoTitleNoFrame">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+        </NamedArea>
+        <Child type="TaharezLook/Titlebar" nameSuffix="__auto_titlebar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><FontDim type="LineSpacing" padding="8" /></Dim>
+            </Area>
+            <Property name="AlwaysOnTop" value="False" />
+        </Child>
+        <Child type="TaharezLook/SystemButton" nameSuffix="__auto_closebutton__">
+            <Area>
+                <Dim type="LeftEdge" >
+                    <UnifiedDim scale="1" type="LeftEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="SysAreaMiddle" dimension="Width" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="TopEdge" >
+                    <AbsoluteDim value="0.5">
+                        <DimOperator op="Multiply">
+                            <WidgetDim widget="__auto_titlebar__" dimension="Height">
+                                <DimOperator op="Subtract">
+                                    <ImageDim imageset="TaharezLook" image="NewCloseButtonNormal" dimension="Width" />
+                                </DimOperator>
+                            </WidgetDim>
+                        </DimOperator>
+                    </AbsoluteDim>
+                </Dim>
+                <Dim type="Width" ><ImageDim imageset="TaharezLook" image="NewCloseButtonNormal" dimension="Width" /></Dim>
+                <Dim type="Height" ><ImageDim imageset="TaharezLook" image="NewCloseButtonNormal" dimension="Width" /></Dim>
+            </Area>
+            <Property name="AlwaysOnTop" value="True" />
+            <Property name="NormalImage" value="set:TaharezLook image:NewCloseButtonNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:NewCloseButtonHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:NewCloseButtonPressed" />
+        </Child>
+        <ImagerySection name="withtitle_frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><WidgetDim widget="__auto_titlebar__" dimension="BottomEdge" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+                </Area>
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="WindowBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="WindowBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="WindowLeftEdge" />
+                <Image type="RightEdge" imageset="TaharezLook" image="WindowRightEdge" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="WindowBottomEdge" />
+                <Image type="Background" imageset="TaharezLook" image="ClientBrush" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Tiled" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="notitle_frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="WindowTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="WindowTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="WindowBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="WindowBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="WindowLeftEdge" />
+                <Image type="RightEdge" imageset="TaharezLook" image="WindowRightEdge" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="WindowBottomEdge" />
+                <Image type="Background" imageset="TaharezLook" image="ClientBrush" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Tiled" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="withtitle_noframe_client_area">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><WidgetDim widget="__auto_titlebar__" dimension="Height" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="ClientBrush" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="notitle_noframe_client_area">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="ClientBrush" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="ActiveWithTitleWithFrame">
+            <Layer>
+                <Section section="withtitle_frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveWithTitleWithFrame">
+            <Layer>
+                <Section section="withtitle_frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledWithTitleWithFrame">
+            <Layer>
+                <Section section="withtitle_frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ActiveWithTitleNoFrame">
+            <Layer>
+                <Section section="withtitle_noframe_client_area" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveWithTitleNoFrame">
+            <Layer>
+                <Section section="withtitle_noframe_client_area" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledWithTitleNoFrame">
+            <Layer>
+                <Section section="withtitle_noframe_client_area">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ActiveNoTitleWithFrame">
+            <Layer>
+                <Section section="notitle_frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveNoTitleWithFrame">
+            <Layer>
+                <Section section="notitle_frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledNoTitleWithFrame">
+            <Layer>
+                <Section section="notitle_frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ActiveNoTitleNoFrame">
+            <Layer>
+                <Section section="notitle_noframe_client_area" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveNoTitleNoFrame">
+            <Layer>
+                <Section section="notitle_noframe_client_area" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledNoTitleNoFrame">
+            <Layer>
+                <Section section="notitle_noframe_client_area">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ProgressBar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ProgressBar">
+        <NamedArea name="ProgressArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ProgressBarLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ProgressBarRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="ProgressBarLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ProgressBarRight" />
+                <Image type="Background" imageset="TaharezLook" image="ProgressBarMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="progress_lights" >
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="ProgressBarLitSegment" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="EnabledProgress">
+            <Layer>
+                <Section section="progress_lights" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledProgress">
+            <Layer>
+                <Section section="progress_lights">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/AlternateProgressBar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/AltProgressBar">
+        <NamedArea name="ProgressArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="AltProgressLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="2" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="AltProgressRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-4" type="Height" /></Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="AltProgressLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="AltProgressRight" />
+                <Image type="Background" imageset="TaharezLook" image="AltProgressMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="progress_lights" >
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight1" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.1" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight2" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.2" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight3" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.3" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight4" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.4" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight5" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.5" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight6" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.6" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight7" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.7" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight8" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.8" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight9" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.9" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight10" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="EnabledProgress">
+            <Layer>
+                <Section section="progress_lights" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledProgress">
+            <Layer>
+                <Section section="progress_lights">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/VUMeter (progress bar)
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/VUMeter">
+        <Property name="VerticalProgress" value="True" />
+        <NamedArea name="ProgressArea">
+            <Area>
+                <Dim type="LeftEdge" ><UnifiedDim scale="0" type="LeftEdge" /></Dim>
+                <Dim type="TopEdge" ><UnifiedDim scale="0" type="TopEdge" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="progress_lights" >
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><UnifiedDim scale="0.5" type="TopEdge" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="0.5" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="TextSelectionBrush" />
+                <Colours topLeft="FF00FF00" topRight="FF00FF00" bottomLeft="FF00FF00" bottomRight="FF00FF00" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><UnifiedDim scale="0.2" type="TopEdge" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="0.3" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="TextSelectionBrush" />
+                <Colours topLeft="FFFFFF00" topRight="FFFFFF00" bottomLeft="FFFFFF00" bottomRight="FFFFFF00" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><UnifiedDim scale="0" type="TopEdge" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="0.2" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="TextSelectionBrush" />
+                <Colours topLeft="FFFF0000" topRight="FFFF0000" bottomLeft="FFFF0000" bottomRight="FFFF0000" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+        </StateImagery>
+        <StateImagery name="Disabled">
+        </StateImagery>
+        <StateImagery name="EnabledProgress">
+            <Layer>
+                <Section section="progress_lights" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledProgress">
+            <Layer>
+                <Section section="progress_lights">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/SliderThumb
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/SliderThumb">
+        <Property name="VertFree" value="True" />
+        <ImagerySection name="normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertSliderThumbNormal" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertSliderThumbHover" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Slider
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Slider">
+        <Property name="VerticalSlider" value="True" />
+        <Property name="MouseButtonDownAutoRepeat" value="True" />
+        <Property name="WantsMultiClickEvents" value="False" />
+        <NamedArea name="ThumbTrackArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/SliderThumb" nameSuffix="__auto_thumb__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                <Dim type="Height" ><ImageDim imageset="TaharezLook" image="VertSliderThumbNormal" dimension="Height" /></Dim>
+            </Area>
+        </Child>
+        <ImagerySection name="main">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="3" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" offset="-6" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertSliderBody" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/HorizontalScrollbarThumb
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/HorizontalScrollbarThumb">
+        <Property name="HorzFree" value="True" />
+        <ImagerySection name="normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="MiniHorzScrollThumbLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="MiniHorzScrollThumbRightNormal" />
+                <Image type="Background" imageset="TaharezLook" image="MiniHorzScrollThumbMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="MiniHorzScrollThumbLeftHover" />
+                <Image type="RightEdge" imageset="TaharezLook" image="MiniHorzScrollThumbRightHover" />
+                <Image type="Background" imageset="TaharezLook" image="MiniHorzScrollThumbMiddleHover" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/HorizontalScrollbar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/HorizontalScrollbar">
+        <NamedArea name="ThumbTrackArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MiniHorzScrollLeftNormal" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1.0" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MiniHorzScrollRightNormal" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_incbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><ImageDim imageset="TaharezLook" image="MiniHorzScrollRightNormal" dimension="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:MiniHorzScrollRightNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:MiniHorzScrollRightHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:MiniHorzScrollRightNormal" />
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_decbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><ImageDim imageset="TaharezLook" image="MiniHorzScrollLeftNormal" dimension="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+            <Property name="NormalImage" value="set:TaharezLook image:MiniHorzScrollLeftNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:MiniHorzScrollLeftHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:MiniHorzScrollLeftNormal" />
+        </Child>
+        <Child  type="TaharezLook/HorizontalScrollbarThumb" nameSuffix="__auto_thumb__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+            <Property name="UnifiedMinSize" value="{{0,25},{0,0}}" />
+        </Child>
+        <ImagerySection name="main">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MiniHorzScrollLeftNormal" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1.0" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="MiniHorzScrollRightNormal" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="MiniHorzScrollBarSegment" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/VerticalScrollbarThumb
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/VerticalScrollbarThumb">
+        <Property name="VertFree" value="True" />
+        <ImagerySection name="normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image type="TopEdge" imageset="TaharezLook" image="MiniVertScrollThumbTopNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="MiniVertScrollThumbBottomNormal" />
+                <Image type="Background" imageset="TaharezLook" image="MiniVertScrollThumbMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image type="TopEdge" imageset="TaharezLook" image="MiniVertScrollThumbTopHover" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="MiniVertScrollThumbBottomHover" />
+                <Image type="Background" imageset="TaharezLook" image="MiniVertScrollThumbMiddleHover" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/VerticalScrollbar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/VerticalScrollbar">
+        <Property name="VerticalScrollbar" value="True" />
+        <NamedArea name="ThumbTrackArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MiniVertScrollUpNormal" dimension="Height" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1.0" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MiniVertScrollDownNormal" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_incbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><ImageDim imageset="TaharezLook" image="MiniVertScrollDownNormal" dimension="Height" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:MiniVertScrollDownNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:MiniVertScrollDownHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:MiniVertScrollDownNormal" />
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_decbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><ImageDim imageset="TaharezLook" image="MiniVertScrollUpNormal" dimension="Height" /></Dim>
+            </Area>
+            <Property name="NormalImage" value="set:TaharezLook image:MiniVertScrollUpNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:MiniVertScrollUpHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:MiniVertScrollUpNormal" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbarThumb" nameSuffix="__auto_thumb__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="0.1" type="Height" /></Dim>
+            </Area>
+            <Property name="UnifiedMinSize" value="{{0,0},{0,25}}" />
+        </Child>
+        <ImagerySection name="main">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MiniVertScrollUpNormal" dimension="Height" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1.0" type="BottomEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="MiniVertScrollDownNormal" dimension="Height" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="MiniVertScrollBarSegment" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="CentreAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Listbox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Listbox">
+        <NamedArea name="ItemRenderingArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ListboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ListboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ListboxRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ListboxBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ListboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ListboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ListboxRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ListboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ListboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ListboxBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ListboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ListboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-12" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="ListboxTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="ListboxTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="ListboxBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="ListboxBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="ListboxLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ListboxRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="ListboxTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="ListboxBottom" />
+                <Image type="Background" imageset="TaharezLook" image="ListboxBackdrop" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ComboDropList
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ComboDropList">
+        <NamedArea name="ItemRenderingArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ComboboxListRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ComboboxListBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ComboboxListRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ComboboxListBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-12" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="ComboboxListTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="ComboboxListTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="ComboboxListBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="ComboboxListBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="ComboboxListLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ComboboxListRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="ComboboxListTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="ComboboxListBottom" />
+                <Image type="Background" imageset="TaharezLook" image="ComboboxListBackdrop" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ComboEditbox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ComboEditbox">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="SelectedTextColour" initialValue="FF000000" redrawOnWrite="true" />
+        <PropertyDefinition name="ActiveSelectionColour" initialValue="FF607FFF" redrawOnWrite="true" />
+        <PropertyDefinition name="InactiveSelectionColour" initialValue="FF808080" redrawOnWrite="true" />
+        <Property name="MouseCursorImage" value="set:TaharezLook image:MouseTextBar" />
+        <NamedArea name="TextArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="5" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="5" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" offset="-5" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" offset="-5" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="container_normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="ComboboxEditLeft" />
+                <Image type="Background" imageset="TaharezLook" image="ComboboxEditMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="selection">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="TextSelectionBrush" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="Carat">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><ImageDim imageset="TaharezLook" image="EditBoxCarat" dimension="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="EditBoxCarat" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="container_normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ReadOnly">
+            <Layer>
+                <Section section="container_normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="container_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ActiveSelection">
+            <Layer>
+                <Section section="selection">
+                    <ColourProperty name="ActiveSelectionColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveSelection">
+            <Layer>
+                <Section section="selection">
+                    <ColourProperty name="InactiveSelectionColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Combobox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Combobox">
+        <PropertyLinkDefinition name="NormalEditTextColour" widget="__auto_editbox__" targetProperty="NormalTextColour" initialValue="FFFFFFFF" />
+        <PropertyLinkDefinition name="SelectedEditTextColour" widget="__auto_editbox__" targetProperty="SelectedTextColour" initialValue="FF000000" />
+        <PropertyLinkDefinition name="ActiveEditSelectionColour" widget="__auto_editbox__" targetProperty="ActiveSelectionColour" initialValue="FF6060FF" />
+        <PropertyLinkDefinition name="InactiveEditSelectionColour" widget="__auto_editbox__" targetProperty="InactiveSelectionColour" initialValue="FF808080" />
+        <Child  type="TaharezLook/ComboEditbox" nameSuffix="__auto_editbox__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <FontDim type="LineSpacing">
+                                <DimOperator op="Multiply">
+                                    <AbsoluteDim value="1.5" />
+                                </DimOperator>
+                            </FontDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="Height" >
+                    <FontDim type="LineSpacing">
+                        <DimOperator op="Multiply">
+                            <AbsoluteDim value="1.5" />
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+            </Area>
+        </Child>
+        <Child  type="TaharezLook/ComboDropList" nameSuffix="__auto_droplist__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_editbox__" dimension="BottomEdge" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+            </Area>
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_button__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><WidgetDim widget="__auto_editbox__" dimension="Height" /></Dim>
+                <Dim type="Height" ><WidgetDim widget="__auto_editbox__" dimension="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:ComboboxListButtonNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:ComboboxListButtonHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:ComboboxListButtonNormal" />
+        </Child>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Spinner
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Spinner">
+        <Child  type="TaharezLook/Editbox" nameSuffix="__auto_editbox__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_incbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="0.5" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:VertScrollUpNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:VertScrollUpHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:VertScrollUpNormal" />
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_decbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><UnifiedDim scale="0.5" type="TopEdge" /></Dim>
+                <Dim type="Width" ><ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="0.5" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:VertScrollDownNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:VertScrollDownHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:VertScrollDownNormal" />
+        </Child>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/StaticShared
+        (Shared imagery components for static widgets)
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/StaticShared">
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="StaticTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="StaticTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="StaticBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="StaticBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="StaticLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="StaticRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="StaticTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="StaticBottom" />
+                <ColourRectProperty name="FrameColours" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="background">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="StaticRight" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1" type="BottomEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="StaticBottom" dimension="Height" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="StaticBackdrop" />
+                <!--<ColourRectProperty name="BackgroundColours" />-->
+                <Colours topLeft="FFFFFFFF" topRight="FFFFFFFF" bottomLeft="FFFFFFFF" bottomRight="FFFFFFFF" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="background_noframe">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge"><UnifiedDim scale="1" type="RightEdge" /></Dim>
+                    <Dim type="BottomEdge"><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="StaticBackdrop" />
+                <!--<ColourRectProperty name="BackgroundColours" />-->
+                <Colours topLeft="FFFFFFFF" topRight="FFFFFFFF" bottomLeft="FFFFFFFF" bottomRight="FFFFFFFF" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/StaticImage
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/StaticImage">
+		<PropertyDefinition name="ImageColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+		<PropertyDefinition name="FrameColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+		<PropertyDefinition name="BackgroundColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="VertFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <PropertyDefinition name="HorzFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <Property name="BackgroundEnabled" value="True" />
+        <Property name="FrameEnabled" value="True" />
+        <ImagerySection name="image_withframe">
+            <ImageryComponent>
+                <Area>
+					<Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+					<Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+					<Dim type="RightEdge" >
+						<UnifiedDim scale="1" type="RightEdge">
+							<DimOperator op="Subtract">
+								<ImageDim imageset="TaharezLook" image="StaticRight" dimension="Width" />
+							</DimOperator>
+						</UnifiedDim>
+					</Dim>
+					<Dim type="BottomEdge" >
+						<UnifiedDim scale="1" type="BottomEdge">
+							<DimOperator op="Subtract">
+								<ImageDim imageset="TaharezLook" image="StaticBottom" dimension="Height" />
+							</DimOperator>
+						</UnifiedDim>
+					</Dim>
+				</Area>
+                <ImageProperty name="Image" />
+                <ColourRectProperty name="ImageColours" />
+                <VertFormatProperty name="VertFormatting" />
+                <HorzFormatProperty name="HorzFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="image_noframe">
+            <ImageryComponent>
+                <Area>
+					<Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+					<Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+					<Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+					<Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+				</Area>
+                <ImageProperty name="Image" />
+                <ColourRectProperty name="ImageColours" />
+                <VertFormatProperty name="VertFormatting" />
+                <HorzFormatProperty name="HorzFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+        <StateImagery name="EnabledFrame">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledFrame">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="WithFrameEnabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="WithFrameDisabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="NoFrameEnabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background_noframe" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="NoFrameDisabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background_noframe" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="WithFrameImage">
+            <Layer>
+                <Section section="image_withframe" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="NoFrameImage">
+            <Layer>
+                <Section section="image_noframe" />
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/StaticText
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/StaticText">
+		<PropertyDefinition name="FrameColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+		<PropertyDefinition name="BackgroundColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+        <Property name="FrameEnabled" value="True" />
+        <Property name="BackgroundEnabled" value="True" />
+        <NamedArea name="WithFrameTextRenderArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="StaticRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="StaticBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="WithFrameTextRenderAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="StaticRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="WithFrameTextRenderAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="StaticBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="WithFrameTextRenderAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="NoFrameTextRenderArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="NoFrameTextRenderAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="NoFrameTextRenderAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="NoFrameTextRenderAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-12" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+        <StateImagery name="EnabledFrame">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledFrame">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="WithFrameEnabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="WithFrameDisabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="NoFrameEnabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background_noframe" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="NoFrameDisabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background_noframe" />
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ListHeaderSegment
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ListHeaderSegment">
+        <Property name="SizingCursorImage" value="set:TaharezLook image:MouseEsWeCursor" />
+        <Property name="MovingCursorImage" value="set:TaharezLook image:MouseMoveCursor" />
+        <ImagerySection name="segment_normal">
+            <Colours topLeft="FFDDDDDD" topRight="FFDDDDDD" bottomLeft="FFDDDDDD" bottomRight="FFDDDDDD" />
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="HeaderBarSplitterNormal" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarBackdropNormal" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="segment_hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="HeaderBarSplitterNormal" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarBackdropHover" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="splitter_normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarSplitterNormal" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="splitter_hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarSplitterHover" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="ascend_icon">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="3" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="3" /></Dim>
+                    <Dim type="Width" ><ImageDim imageset="TaharezLook" image="HeaderBarSortUp" dimension="Width" /></Dim>
+                    <Dim type="Height" ><ImageDim imageset="TaharezLook" image="HeaderBarSortUp" dimension="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarSortUp" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="descend_icon">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="3" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="3" /></Dim>
+                    <Dim type="Width" ><ImageDim imageset="TaharezLook" image="HeaderBarSortDown" dimension="Width" /></Dim>
+                    <Dim type="Height" ><ImageDim imageset="TaharezLook" image="HeaderBarSortDown" dimension="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarSortDown" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" >
+                        <ImageDim imageset="TaharezLook" image="HeaderBarSortUp" dimension="Width">
+                            <DimOperator op="Add">
+                                <AbsoluteDim value="5" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1" type="RightEdge" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <VertFormat type="CentreAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="segment_normal" />
+                <Section section="splitter_normal" />
+                <Section section="label" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="segment_hover" />
+                <Section section="splitter_normal" />
+                <Section section="label" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SplitterHover">
+            <Layer>
+                <Section section="segment_normal" />
+                <Section section="splitter_hover" />
+                <Section section="label" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DragGhost" clipped="false" >
+            <Layer priority="1" >
+                <Section section="segment_normal">
+                    <Colours topLeft="90FFFFFF" topRight="90FFFFFF" bottomLeft="90FFFFFF" bottomRight="90FFFFFF" />
+                </Section>
+                <Section section="splitter_normal">
+                    <Colours topLeft="90FFFFFF" topRight="90FFFFFF" bottomLeft="90FFFFFF" bottomRight="90FFFFFF" />
+                </Section>
+                <Section section="label">
+                    <Colours topLeft="90FFFFFF" topRight="90FFFFFF" bottomLeft="90FFFFFF" bottomRight="90FFFFFF" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="AscendingSortIcon">
+            <Layer>
+                <Section section="ascend_icon" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DescendingSortIcon">
+            <Layer>
+                <Section section="descend_icon" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="GhostAscendingSortIcon" clipped="false">
+            <Layer priority="1" >
+                <Section section="ascend_icon">
+                    <Colours topLeft="90FFFFFF" topRight="90FFFFFF" bottomLeft="90FFFFFF" bottomRight="90FFFFFF" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="GhostDescendingSortIcon" clipped="false">
+            <Layer priority="1" >
+                <Section section="descend_icon">
+                    <Colours topLeft="90FFFFFF" topRight="90FFFFFF" bottomLeft="90FFFFFF" bottomRight="90FFFFFF" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="segment_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="splitter_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ListHeader
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ListHeader">
+        <Property name="SegmentWidgetType" value="TaharezLook/ListHeaderSegment" />
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/MultiColumnList
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/MultiColumnList">
+        <NamedArea name="ItemRenderingArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_listheader__" dimension="BottomEdge" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiListRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiListBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_listheader__" dimension="BottomEdge" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiListRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_listheader__" dimension="BottomEdge" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiListBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_listheader__" dimension="BottomEdge" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/ListHeader" nameSuffix="__auto_listheader__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="2" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="2" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1" offset="-2" type="RightEdge" /></Dim>
+                <Dim type="Height" >
+                    <FontDim type="LineSpacing">
+                        <DimOperator op="Multiply">
+                            <AbsoluteDim value="1.5" />
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+            </Area>
+        </Child>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_listheader__" dimension="BottomEdge" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1" offset="-12" type="BottomEdge" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="MultiListTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="MultiListTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="MultiListBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="MultiListBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="MultiListLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="MultiListRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="MultiListTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="MultiListBottom" />
+                <Image type="Background" imageset="TaharezLook" image="MultiListBackdrop" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/MultiLineEditbox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/MultiLineEditbox">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="SelectedTextColour" initialValue="FF000000" redrawOnWrite="true" />
+        <PropertyDefinition name="ActiveSelectionColour" initialValue="FF607FFF" redrawOnWrite="true" />
+        <PropertyDefinition name="InactiveSelectionColour" initialValue="FF808080" redrawOnWrite="true" />
+        <Property name="MouseCursorImage" value="set:TaharezLook image:MouseTextBar" />
+        <Property name="SelectionBrushImage" value="set:TaharezLook image:MultiLineEditboxSelectionBrush" />
+        <NamedArea name="TextArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiLineEditboxRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiLineEditboxBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="TextAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiLineEditboxRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="TextAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiLineEditboxBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="TextAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-12" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="MultiLineEditboxTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="MultiLineEditboxTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="MultiLineEditboxBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="MultiLineEditboxBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="MultiLineEditboxLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="MultiLineEditboxRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="MultiLineEditboxTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="MultiLineEditboxBottom" />
+                <Image type="Background" imageset="TaharezLook" image="MultiLineEditboxBackdrop" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="Carat">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><ImageDim imageset="TaharezLook" image="EditBoxCarat" dimension="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="EditBoxCarat" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ReadOnly">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Tooltip
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Tooltip">
+        <NamedArea name="TextArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="TooltipLeftEdge" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="TooltipTopEdge" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="TooltipRightEdge" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="TooltipBottomEdge" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TooltipTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TooltipTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TooltipBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TooltipBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TooltipLeftEdge" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TooltipRightEdge" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TooltipTopEdge" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TooltipBottomEdge" />
+                <Image type="Background" imageset="TaharezLook" image="TooltipMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="TooltipLeftEdge" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="TooltipTopEdge" dimension="Height" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TooltipRightEdge" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1" type="BottomEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TooltipBottomEdge" dimension="Height" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <Colours topLeft="FF000000" topRight="FF000000" bottomLeft="FF000000" bottomRight="FF000000" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="CentreAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+                <Section section="label" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main" />
+                <Section section="label" />
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ScrollablePane
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ScrollablePane">
+        <NamedArea name="ViewableArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ViewableAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ViewableAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ViewableAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-12" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/TabButton
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/TabButton">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFC0C0C0" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverTextColour" initialValue="FFE0E0E0" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="SelectedTextColour" initialValue="FFE0E0E0" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" />
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="CentreAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <ImagerySection name="top_normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabButtonUpperLeftNormal" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabButtonUpperRightNormal" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabButtonLowerLeftNormal" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabButtonLowerRight2Normal" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightNormal" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabButtonUpperNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabButtonLowerNormal" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="bot_normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabButtonUpperLeft2Normal" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabButtonUpperRightNormal" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabButtonLowerLeftNormal" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabButtonLowerRightNormal" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightNormal" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabButtonUpperNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabButtonLowerNormal" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="top_hover">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabButtonUpperLeftNormal" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabButtonUpperRightNormal" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabButtonLowerLeftNormal" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabButtonLowerRight2Normal" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightNormal" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabButtonUpperNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabButtonLowerNormal" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="bot_hover">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabButtonUpperLeft2Normal" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabButtonUpperRightNormal" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabButtonLowerLeftNormal" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabButtonLowerRightNormal" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightNormal" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabButtonUpperNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabButtonLowerNormal" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="top_selected">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabButtonUpperLeftSelected" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabButtonUpperSelected" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabButtonUpperRightSelected" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftSelected" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleSelected" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightSelected" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="bot_selected">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftSelected" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleSelected" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightSelected" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabButtonLowerLeftNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabButtonLowerNormal" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabButtonLowerRightNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="TopNormal">
+            <Layer>
+                <Section section="top_normal" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="BottomNormal">
+            <Layer>
+                <Section section="bot_normal" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="TopHover">
+            <Layer>
+                <Section section="top_hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="BottomHover">
+            <Layer>
+                <Section section="bot_hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="TopSelected">
+            <Layer>
+                <Section section="top_selected" />
+                <Section section="label">
+                    <ColourProperty name="SelectedTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="BottomSelected">
+            <Layer>
+                <Section section="bot_selected" />
+                <Section section="label">
+                    <ColourProperty name="SelectedTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="TopPushed">
+            <Layer>
+                <Section section="top_normal" />
+                <Section section="label">
+                    <ColourProperty name="PushedTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="BottomPushed">
+            <Layer>
+                <Section section="bot_normal" />
+                <Section section="label">
+                    <ColourProperty name="PushedTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="TopDisabled">
+            <Layer>
+                <Section section="top_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="BottomDisabled">
+            <Layer>
+                <Section section="bot_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/TabContentPane
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/TabContentPane">
+        <PropertyDefinition name="EnableTop" initialValue="0" redrawOnWrite="true" layoutOnwrite="true" />
+        <PropertyDefinition name="EnableBottom" initialValue="0" redrawOnWrite="true" layoutOnwrite="true" />
+        <ImagerySection name="normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <ImageDim imageset="TaharezLook" image="TabContentPaneUpperLeft" dimension="Height">
+                            <DimOperator op="Multiply">
+                                <PropertyDim name="EnableTop" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabContentPaneUpperLeft" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabContentPaneUpper" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabContentPaneUpperRight" />
+            </FrameComponent>
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" >
+                        <ImageDim imageset="TaharezLook" image="TabContentPaneUpperLeft" dimension="Height">
+                            <DimOperator op="Multiply">
+                                <PropertyDim name="EnableTop" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1" type="Height">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TabContentPaneLowerLeft" dimension="Height">
+                                    <DimOperator op="Multiply">
+                                        <PropertyDim name="EnableBottom" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabContentPaneLeft" />
+                <Image type="Background" imageset="TaharezLook" image="TabContentPaneMiddle" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabContentPaneRight" />
+            </FrameComponent>
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" >
+                        <UnifiedDim scale="1" type="Height">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TabContentPaneLowerLeft" dimension="Height">
+                                    <DimOperator op="Multiply">
+                                        <PropertyDim name="EnableBottom" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabContentPaneLowerLeft" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabContentPaneLower" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabContentPaneLowerRight" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/TabButtonPane
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/TabButtonPane">
+        <PropertyDefinition name="EnableTop" initialValue="1" redrawOnWrite="true" layoutOnwrite="true" />
+        <PropertyDefinition name="EnableBottom" initialValue="1" redrawOnWrite="true" layoutOnwrite="true" />
+        <ImagerySection name="normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <ImageDim imageset="TaharezLook" image="TabHorizontalFiller" dimension="Height">
+                            <DimOperator op="Multiply">
+                                <PropertyDim name="EnableTop" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                </Area>
+                <Image type="TopEdge" imageset="TaharezLook" image="TabHorizontalFiller" />
+            </FrameComponent>
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" >
+                        <ImageDim imageset="TaharezLook" image="TabHorizontalFiller" dimension="Height">
+                            <DimOperator op="Multiply">
+                                <PropertyDim name="EnableTop" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1" type="Height">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TabHorizontalFiller" dimension="Height">
+                                    <DimOperator op="Multiply">
+                                        <PropertyDim name="EnableBottom" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+            </FrameComponent>
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" >
+                        <UnifiedDim scale="1" type="Height">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TabHorizontalFiller" dimension="Height">
+                                    <DimOperator op="Multiply">
+                                        <PropertyDim name="EnableBottom" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabHorizontalFiller" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/TabControl
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/TabControl">
+        <Property name="TabButtonType" value="TaharezLook/TabButton" />
+        <Property name="TabTextPadding" value="{0,6}" />
+        <Child type="TaharezLook/TabContentPane" nameSuffix="__auto_TabPane__">
+            <Area>
+                <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge"><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="TopEdge">
+                    <PropertyDim widget="__auto_TabPane__" name="EnableBottom">
+                        <DimOperator op="Multiply">
+                            <PropertyDim name="TabHeight" type="Height" />
+                        </DimOperator>
+                    </PropertyDim>
+                </Dim>
+                <Dim type="Height">
+                    <UnifiedDim scale="1" type="Height">
+                        <DimOperator op="Subtract">
+                            <PropertyDim name="TabHeight" type="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </Child>
+        <Child  type="TaharezLook/TabButtonPane" nameSuffix="__auto_TabPane__Buttons">
+            <Area>
+                <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge"><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="TopEdge">
+                    <PropertyDim widget="__auto_TabPane__Buttons" name="EnableTop">
+                        <DimOperator op="Multiply">
+                            <UnifiedDim scale="1" type="Height">
+                                <DimOperator op="Subtract">
+                                    <PropertyDim name="TabHeight" type="Height" />
+                                </DimOperator>
+                            </UnifiedDim>
+                        </DimOperator>
+                    </PropertyDim>
+                </Dim>
+                <Dim type="Height"><PropertyDim name="TabHeight" type="Height" /></Dim>
+            </Area>
+        </Child>
+        <Child type="TaharezLook/SystemButton" nameSuffix="__auto_TabPane__ScrollLeft">
+            <Area>
+                <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge">
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="TopEdge" />
+                </Dim>
+                <Dim type="Width">
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="Height">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="TabButtonScrollLeftNormal" dimension="Width">
+                                <DimOperator op="Divide">
+                                    <ImageDim imageset="TaharezLook" image="TabButtonScrollLeftNormal" dimension="Height" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </WidgetDim>
+                </Dim>
+                <Dim type="BottomEdge">
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="BottomEdge" />
+                </Dim>
+            </Area>
+            <Property name="AlwaysOnTop" value="True" />
+            <Property name="NormalImage" value="set:TaharezLook image:TabButtonScrollLeftNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:TabButtonScrollLeftHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:TabButtonScrollLeftHover" />
+        </Child>
+        <Child type="TaharezLook/SystemButton" nameSuffix="__auto_TabPane__ScrollRight">
+            <Area>
+                <Dim type="Width">
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="Height">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="TabButtonScrollRightNormal" dimension="Width">
+                                <DimOperator op="Divide">
+                                    <ImageDim imageset="TaharezLook" image="TabButtonScrollRightNormal" dimension="Height" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </WidgetDim>
+                </Dim>
+                <Dim type="LeftEdge">
+                    <UnifiedDim scale="1" type="Width">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_TabPane__ScrollRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="TopEdge">
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="TopEdge" />
+                </Dim>
+                <Dim type="Height"><AbsoluteDim value="0" />
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="Height" />
+                </Dim>
+            </Area>
+            <Property name="AlwaysOnTop" value="True" />
+            <Property name="NormalImage" value="set:TaharezLook image:TabButtonScrollRightNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:TabButtonScrollRightHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:TabButtonScrollRightHover" />
+        </Child>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/MenuItem
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/MenuItem">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="OpenedColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <Property name="WantsMultiClickEvents" value="False" />
+        <NamedArea name="ContentSize">
+            <Area>
+                <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width">
+                    <FontDim type="HorzExtent">
+                        <DimOperator op="Add">
+                            <ImageDim imageset="TaharezLook" image="MenuLeft" dimension="Width">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="MenuRight" dimension="Width" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+                <Dim type="Height">
+                    <FontDim type="LineSpacing">
+                        <DimOperator op="Add">
+                            <ImageDim imageset="TaharezLook" image="MenuTop" dimension="Height">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="MenuBottom" dimension="Height" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="HasPopupContentSize">
+            <Area>
+                <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width">
+                    <FontDim type="HorzExtent">
+                        <DimOperator op="Add">
+                            <ImageDim imageset="TaharezLook" image="MenuLeft" dimension="Width">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="MenuRight" dimension="Width">
+                                        <DimOperator op="Add">
+                                            <ImageDim imageset="TaharezLook" image="PopupMenuArrowLeft" dimension="Width">
+                                                <DimOperator op="Multiply">
+                                                    <AbsoluteDim value="3" />
+                                                </DimOperator>
+                                            </ImageDim>
+                                        </DimOperator>
+                                    </ImageDim>
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+                <Dim type="Height">
+                    <FontDim type="LineSpacing">
+                        <DimOperator op="Add">
+                            <ImageDim imageset="TaharezLook" image="MenuTop" dimension="Height">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="MenuBottom" dimension="Height" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MenuLeft" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MenuTop" dimension="Height" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="MenuRight" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1" type="BottomEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="MenuBottom" dimension="Height" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="MenuTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="MenuTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="MenuBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="MenuBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="MenuLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="MenuRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="MenuTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="MenuBottom" />
+                <Image type="Background" imageset="TaharezLook" image="MenuMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="popup_arrow_right">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" >
+                        <UnifiedDim scale="1" type="Width">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="PopupMenuArrowRight" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="PopupMenuArrowRight" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="popup_arrow_left">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" >
+                        <UnifiedDim scale="1" type="Width">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="PopupMenuArrowLeft" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="PopupMenuArrowLeft" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="EnabledNormal">
+            <Layer>
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="EnabledHover">
+            <Layer>
+                <Section section="frame">
+                    <ColourProperty name="HoverColour" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="EnabledPushed">
+            <Layer>
+                <Section section="frame">
+                    <ColourProperty name="PushedColour" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="EnabledPopupOpen">
+            <Layer>
+                <Section section="frame">
+                    <ColourProperty name="OpenedColour" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledNormal">
+            <Layer>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledHover">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledPushed">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledPopupOpen">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="PopupClosedIcon">
+            <Layer>
+                <Section section="popup_arrow_right" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="PopupOpenIcon">
+            <Layer>
+                <Section section="popup_arrow_left" />
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/PopupMenu
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/PopupMenu">
+        <PropertyDefinition name="BackgroundColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="BorderWidth" initialValue="0" layoutOnWrite="true" />
+        <NamedArea name="ItemRenderArea">
+            <Area>
+                <Dim type="LeftEdge" >
+                    <ImageDim imageset="TaharezLook" image="PopupMenuFrameLeft" dimension="Width">
+                        <DimOperator op="Add">
+                            <PropertyDim name="BorderWidth" />
+                        </DimOperator>
+                    </ImageDim>
+                </Dim>
+                <Dim type="TopEdge" >
+                    <ImageDim imageset="TaharezLook" image="PopupMenuFrameTop" dimension="Height">
+                        <DimOperator op="Add">
+                            <PropertyDim name="BorderWidth" />
+                        </DimOperator>
+                    </ImageDim>
+                </Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="PopupMenuFrameRight" dimension="Width">
+                                <DimOperator op="Add">
+                                    <PropertyDim name="BorderWidth" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="PopupMenuFrameBottom" dimension="Height">
+                                <DimOperator op="Add">
+                                    <PropertyDim name="BorderWidth" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="PopupMenuFrameTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="PopupMenuFrameTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="PopupMenuFrameBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="PopupMenuFrameBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="PopupMenuFrameLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="PopupMenuFrameRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="PopupMenuFrameTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="PopupMenuFrameBottom" />
+                <Image type="Background" imageset="TaharezLook" image="PopupMenuMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="frame">
+                    <ColourRectProperty name="BackgroundColours" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    
+    <!--
+    ***************************************************
+        TaharezLook/Menubar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Menubar">
+        <PropertyDefinition name="BackgroundColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="BorderWidth" initialValue="5" layoutOnWrite="true" />
+        <NamedArea name="ItemRenderArea">
+            <Area>
+                <Dim type="LeftEdge" >
+                    <ImageDim imageset="TaharezLook" image="PopupMenuFrameLeft" dimension="Width">
+                        <DimOperator op="Add">
+                            <PropertyDim name="BorderWidth" />
+                        </DimOperator>
+                    </ImageDim>
+                </Dim>
+                <Dim type="TopEdge" >
+                    <ImageDim imageset="TaharezLook" image="PopupMenuFrameTop" dimension="Height">
+                        <DimOperator op="Add">
+                            <PropertyDim name="BorderWidth" />
+                        </DimOperator>
+                    </ImageDim>
+                </Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="PopupMenuFrameRight" dimension="Width">
+                                <DimOperator op="Add">
+                                    <PropertyDim name="BorderWidth" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="PopupMenuFrameBottom" dimension="Height">
+                                <DimOperator op="Add">
+                                    <PropertyDim name="BorderWidth" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="PopupMenuFrameTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="PopupMenuFrameTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="PopupMenuFrameBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="PopupMenuFrameBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="PopupMenuFrameLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="PopupMenuFrameRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="PopupMenuFrameTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="PopupMenuFrameBottom" />
+                <Image type="Background" imageset="TaharezLook" image="PopupMenuMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="frame">
+                    <ColourRectProperty name="BackgroundColours" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/LargeVerticalScrollbarThumb
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/LargeVerticalScrollbarThumb">
+        <Property name="VertFree" value="True" />
+        <ImagerySection name="normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertScrollThumbNormal" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertScrollThumbHover" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/LargeVerticalScrollbar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/LargeVerticalScrollbar">
+        <Property name="VerticalScrollbar" value="True" />
+        <NamedArea name="ThumbTrackArea">
+            <Area>
+                <Dim type="LeftEdge" ><UnifiedDim scale="0.325" type="LeftEdge" /></Dim>
+                <Dim type="TopEdge" >
+                    <WidgetDim widget="__auto_decbtn__" dimension="Height">
+                        <DimOperator op="Add">
+                            <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                                <DimOperator op="Multiply">
+                                    <AbsoluteDim value="0.5" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </WidgetDim>
+                </Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1.0" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_decbtn__" dimension="Height">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                                        <DimOperator op="Multiply">
+                                            <AbsoluteDim value="0.5" />
+                                        </DimOperator>
+                                    </ImageDim>
+                                </DimOperator>
+                            </WidgetDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_incbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><UnifiedDim scale="0.25" type="LeftEdge" /></Dim>
+                <Dim type="TopEdge" >
+                    <AbsoluteDim value="-1">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                                <DimOperator op="Multiply">
+                                    <AbsoluteDim value="0.5" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </AbsoluteDim>
+                </Dim>
+                <Dim type="Width" ><UnifiedDim scale="0.6" type="Width" /></Dim>
+                <Dim type="Height" >
+                    <UnifiedDim scale="0.6" type="Width">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Width">
+                                <DimOperator op="Divide">
+                                    <ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Height"/>
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:VertScrollDownNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:VertScrollDownHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:VertScrollDownNormal" />
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_decbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><UnifiedDim scale="0.25" type="LeftEdge" /></Dim>
+                <Dim type="TopEdge">
+                    <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                        <DimOperator op="Multiply">
+                            <AbsoluteDim value="0.5" />
+                        </DimOperator>
+                    </ImageDim>
+                </Dim>
+                <Dim type="Width" ><UnifiedDim scale="0.6" type="Width" /></Dim>
+                <Dim type="Height" >
+                    <UnifiedDim scale="0.6" type="Width">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Width">
+                                <DimOperator op="Divide">
+                                    <ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Height"/>
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+            <Property name="NormalImage" value="set:TaharezLook image:VertScrollUpNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:VertScrollUpHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:VertScrollUpNormal" />
+        </Child>
+        <Child  type="TaharezLook/LargeVerticalScrollbarThumb" nameSuffix="__auto_thumb__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="0.4" type="Width" /></Dim>
+                <Dim type="Height" >
+                    <UnifiedDim scale="0.4" type="Width">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="VertScrollThumbNormal" dimension="Height">
+                                <DimOperator op="Divide">
+                                    <ImageDim imageset="TaharezLook" image="VertScrollThumbNormal" dimension="Width"/>
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </Child>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopEdge" imageset="TaharezLook" image="VertScrollTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="VertScrollBottom" />
+                <Image type="Background" imageset="TaharezLook" image="VertScrollMiddle" />
+            </FrameComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.45" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" >
+                        <WidgetDim widget="__auto_decbtn__" dimension="Height">
+                            <DimOperator op="Add">
+                                <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                                    <DimOperator op="Multiply">
+                                        <AbsoluteDim value="0.5" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </WidgetDim>
+                    </Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1.0" type="BottomEdge">
+                            <DimOperator op="Subtract">
+                                <WidgetDim widget="__auto_decbtn__" dimension="Height">
+                                    <DimOperator op="Add">
+                                        <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                                            <DimOperator op="Multiply">
+                                                <AbsoluteDim value="0.5" />
+                                            </DimOperator>
+                                        </ImageDim>
+                                    </DimOperator>
+                                </WidgetDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertScrollBarSegment" />
+                <VertFormat type="Tiled" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+
+    <!--
+    ***************************************************
+        TaharezLook/ImageButton
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ImageButton">
+        <PropertyDefinition name="NormalImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="VertImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <PropertyDefinition name="HorzImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <ImagerySection name="normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="NormalImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="HoverImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="pushed">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="PushedImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="disabled">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="DisabledImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="pushed" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="PushedOff">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="disabled" />
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+
+</Falagard>
+
Index: /Samples/Media/gui/TaharezLookSkin.scheme
===================================================================
--- /Samples/Media/gui/TaharezLookSkin.scheme	(revision 5)
+++ /Samples/Media/gui/TaharezLookSkin.scheme	(revision 5)
@@ -0,0 +1,48 @@
+<?xml version="1.0" ?>
+<GUIScheme Name="TaharezLook">
+	<Imageset Name="TaharezLook" Filename="TaharezLook.imageset" />
+    <Font Name="BlueHighway-12" Filename="bluehighway-12.font" />
+    <Font Name="BlueHighway-10" Filename="bluehighway-10.font" />
+    <Font Name="BlueHighway-8" Filename="bluehighway-8.font" />
+	<LookNFeel Filename="TaharezLook.looknfeel" />
+	<WindowRendererSet Filename="CEGUIFalagardWRBase" />
+	<FalagardMapping WindowType="TaharezLook/Button"      TargetType="CEGUI/PushButton"  Renderer="Falagard/Button"       LookNFeel="TaharezLook/Button" />
+	<FalagardMapping WindowType="TaharezLook/Checkbox"    TargetType="CEGUI/Checkbox"    Renderer="Falagard/ToggleButton" LookNFeel="TaharezLook/Checkbox" />
+	<FalagardMapping WindowType="TaharezLook/ImageButton" TargetType="CEGUI/PushButton"  Renderer="Falagard/Button"       LookNFeel="TaharezLook/ImageButton" />
+	<FalagardMapping WindowType="TaharezLook/RadioButton" TargetType="CEGUI/RadioButton" Renderer="Falagard/ToggleButton" LookNFeel="TaharezLook/RadioButton" />
+	<FalagardMapping WindowType="TaharezLook/FrameWindow"  TargetType="CEGUI/FrameWindow" Renderer="Falagard/FrameWindow"  LookNFeel="TaharezLook/FrameWindow" />
+	<FalagardMapping WindowType="TaharezLook/Titlebar"     TargetType="CEGUI/Titlebar"    Renderer="Falagard/Titlebar"     LookNFeel="TaharezLook/Titlebar" />
+	<FalagardMapping WindowType="TaharezLook/SystemButton" TargetType="CEGUI/PushButton"  Renderer="Falagard/SystemButton" LookNFeel="TaharezLook/Button" />
+	<FalagardMapping WindowType="TaharezLook/Editbox"          TargetType="CEGUI/Editbox"          Renderer="Falagard/Editbox"          LookNFeel="TaharezLook/Editbox" />
+	<FalagardMapping WindowType="TaharezLook/MultiLineEditbox" TargetType="CEGUI/MultiLineEditbox" Renderer="Falagard/MultiLineEditbox" LookNFeel="TaharezLook/MultiLineEditbox" />
+	<FalagardMapping WindowType="TaharezLook/Menubar"   TargetType="CEGUI/Menubar"   Renderer="Falagard/Menubar"   LookNFeel="TaharezLook/Menubar" />
+	<FalagardMapping WindowType="TaharezLook/PopupMenu" TargetType="CEGUI/PopupMenu" Renderer="Falagard/PopupMenu" LookNFeel="TaharezLook/PopupMenu" />
+	<FalagardMapping WindowType="TaharezLook/MenuItem"  TargetType="CEGUI/MenuItem"  Renderer="Falagard/MenuItem"  LookNFeel="TaharezLook/MenuItem" />
+	<FalagardMapping WindowType="TaharezLook/AlternateProgressBar" TargetType="CEGUI/ProgressBar" Renderer="Falagard/ProgressBar" LookNFeel="TaharezLook/AltProgressBar" />
+	<FalagardMapping WindowType="TaharezLook/ProgressBar"          TargetType="CEGUI/ProgressBar" Renderer="Falagard/ProgressBar" LookNFeel="TaharezLook/ProgressBar" />
+	<FalagardMapping WindowType="TaharezLook/VUMeter"              TargetType="CEGUI/ProgressBar" Renderer="Falagard/ProgressBar" LookNFeel="TaharezLook/VUMeter" />
+	<FalagardMapping WindowType="TaharezLook/VerticalScrollbar"   TargetType="CEGUI/Scrollbar" Renderer="Falagard/Scrollbar" LookNFeel="TaharezLook/VerticalScrollbar" />
+	<FalagardMapping WindowType="TaharezLook/HorizontalScrollbar" TargetType="CEGUI/Scrollbar" Renderer="Falagard/Scrollbar" LookNFeel="TaharezLook/HorizontalScrollbar" />
+	<FalagardMapping WindowType="TaharezLook/VerticalScrollbarThumb"   TargetType="CEGUI/Thumb" Renderer="Falagard/Button" LookNFeel="TaharezLook/VerticalScrollbarThumb" />
+	<FalagardMapping WindowType="TaharezLook/HorizontalScrollbarThumb" TargetType="CEGUI/Thumb" Renderer="Falagard/Button" LookNFeel="TaharezLook/HorizontalScrollbarThumb" />
+	<FalagardMapping WindowType="TaharezLook/LargeVerticalScrollbar"      TargetType="CEGUI/Scrollbar" Renderer="Falagard/Scrollbar" LookNFeel="TaharezLook/LargeVerticalScrollbar" />
+	<FalagardMapping WindowType="TaharezLook/LargeVerticalScrollbarThumb" TargetType="CEGUI/Thumb"     Renderer="Falagard/Button"    LookNFeel="TaharezLook/LargeVerticalScrollbarThumb" />
+	<FalagardMapping WindowType="TaharezLook/TabButton"  TargetType="CEGUI/TabButton"  Renderer="Falagard/TabButton"  LookNFeel="TaharezLook/TabButton" />
+	<FalagardMapping WindowType="TaharezLook/TabControl" TargetType="CEGUI/TabControl" Renderer="Falagard/TabControl" LookNFeel="TaharezLook/TabControl" />
+	<FalagardMapping WindowType="TaharezLook/TabContentPane"    TargetType="DefaultWindow"    Renderer="Falagard/Default"    LookNFeel="TaharezLook/TabContentPane" />
+	<FalagardMapping WindowType="TaharezLook/TabButtonPane"    TargetType="DefaultWindow"    Renderer="Falagard/Default"    LookNFeel="TaharezLook/TabButtonPane" />
+	<FalagardMapping WindowType="TaharezLook/ComboDropList" TargetType="CEGUI/ComboDropList" Renderer="Falagard/Listbox" LookNFeel="TaharezLook/ComboDropList" />
+	<FalagardMapping WindowType="TaharezLook/ComboEditbox"  TargetType="CEGUI/Editbox"	 Renderer="Falagard/Editbox" LookNFeel="TaharezLook/ComboEditbox" />
+	<FalagardMapping WindowType="TaharezLook/Combobox"	TargetType="CEGUI/Combobox"	 Renderer="Falagard/Default" LookNFeel="TaharezLook/Combobox" />
+	<FalagardMapping WindowType="TaharezLook/Listbox"           TargetType="CEGUI/Listbox"           Renderer="Falagard/Listbox"           LookNFeel="TaharezLook/Listbox" />
+	<FalagardMapping WindowType="TaharezLook/ListHeader"        TargetType="CEGUI/ListHeader"        Renderer="Falagard/ListHeader"        LookNFeel="TaharezLook/ListHeader" />
+	<FalagardMapping WindowType="TaharezLook/ListHeaderSegment" TargetType="CEGUI/ListHeaderSegment" Renderer="Falagard/ListHeaderSegment" LookNFeel="TaharezLook/ListHeaderSegment" />
+	<FalagardMapping WindowType="TaharezLook/MultiColumnList"   TargetType="CEGUI/MultiColumnList"   Renderer="Falagard/MultiColumnList"   LookNFeel="TaharezLook/MultiColumnList" />
+	<FalagardMapping WindowType="TaharezLook/Slider"      TargetType="CEGUI/Slider"      Renderer="Falagard/Slider"  LookNFeel="TaharezLook/Slider" />
+	<FalagardMapping WindowType="TaharezLook/SliderThumb" TargetType="CEGUI/Thumb" Renderer="Falagard/Button"  LookNFeel="TaharezLook/SliderThumb" />
+	<FalagardMapping WindowType="TaharezLook/ScrollablePane" TargetType="CEGUI/ScrollablePane" Renderer="Falagard/ScrollablePane" LookNFeel="TaharezLook/ScrollablePane" />
+	<FalagardMapping WindowType="TaharezLook/Spinner" TargetType="CEGUI/Spinner" Renderer="Falagard/Default" LookNFeel="TaharezLook/Spinner" />
+	<FalagardMapping WindowType="TaharezLook/Tooltip" TargetType="CEGUI/Tooltip" Renderer="Falagard/Tooltip" LookNFeel="TaharezLook/Tooltip" />
+	<FalagardMapping WindowType="TaharezLook/StaticImage" TargetType="DefaultWindow" Renderer="Falagard/StaticImage" LookNFeel="TaharezLook/StaticImage" />
+	<FalagardMapping WindowType="TaharezLook/StaticText"  TargetType="DefaultWindow" Renderer="Falagard/StaticText"  LookNFeel="TaharezLook/StaticText" />
+</GUIScheme>
Index: /Samples/Media/gui/TaharezLookWidgetAliases.scheme
===================================================================
--- /Samples/Media/gui/TaharezLookWidgetAliases.scheme	(revision 5)
+++ /Samples/Media/gui/TaharezLookWidgetAliases.scheme	(revision 5)
@@ -0,0 +1,34 @@
+<?xml version="1.0" ?>
+<GUIScheme Name="TaharezLookWidgetAliases">
+	<WindowAlias Alias="Taharez AltProgressBar" Target="TaharezLook/AlternateProgressBar" />
+	<WindowAlias Alias="Taharez Button" Target="TaharezLook/Button" />
+	<WindowAlias Alias="Taharez Checkbox" Target="TaharezLook/Checkbox" />
+	<WindowAlias Alias="Taharez Close Button" Target="TaharezLook/CloseButton" />
+	<WindowAlias Alias="Taharez Combobox" Target="TaharezLook/Combobox" />
+	<WindowAlias Alias="Taharez ComboDropList" Target="TaharezLook/ComboDropList" />
+	<WindowAlias Alias="Taharez ComboEditbox" Target="TaharezLook/ComboEditbox" />
+	<WindowAlias Alias="Taharez Editbox" Target="TaharezLook/Editbox" />
+	<WindowAlias Alias="Taharez Frame Window" Target="TaharezLook/FrameWindow" />
+	<WindowAlias Alias="Taharez Listbox" Target="TaharezLook/Listbox" />
+	<WindowAlias Alias="Taharez ListHeader" Target="TaharezLook/ListHeader" />
+	<WindowAlias Alias="Taharez ListHeaderSegment" Target="TaharezLook/ListHeaderSegment" />
+	<WindowAlias Alias="Taharez MiniHorzScrollbar" Target="TaharezLook/HorizontalScrollbar" />
+	<WindowAlias Alias="Taharez MiniHorzScrollbarThumb" Target="TaharezLook/HorizontalScrollbarThumb" />
+	<WindowAlias Alias="Taharez MiniVertScrollbar" Target="TaharezLook/VerticalScrollbar" />
+	<WindowAlias Alias="Taharez MiniVertScrollbarThumb" Target="TaharezLook/VerticalScrollbarThumb" />
+	<WindowAlias Alias="Taharez MultiColumnList" Target="TaharezLook/MultiColumnList" />
+	<WindowAlias Alias="Taharez MultiLineEditbox" Target="TaharezLook/MultiLineEditbox" />
+	<WindowAlias Alias="Taharez ProgressBar" Target="TaharezLook/ProgressBar" />
+	<WindowAlias Alias="Taharez RadioButton" Target="TaharezLook/RadioButton" />
+	<WindowAlias Alias="Taharez Slider" Target="TaharezLook/Slider" />
+	<WindowAlias Alias="Taharez Slider Thumb" Target="TaharezLook/SliderThumb" />
+	<WindowAlias Alias="Taharez StaticImage" Target="TaharezLook/StaticImage" />
+	<WindowAlias Alias="Taharez StaticText" Target="TaharezLook/StaticText" />
+	<WindowAlias Alias="Taharez Tab Button" Target="TaharezLook/TabButton" />
+	<WindowAlias Alias="Taharez Tab Pane" Target="TaharezLook/TabPane" />
+	<WindowAlias Alias="Taharez Tab Control" Target="TaharezLook/TabControl" />
+	<WindowAlias Alias="Taharez Titlebar" Target="TaharezLook/Titlebar" />
+	<WindowAlias Alias="Taharez VertScrollbar" Target="TaharezLook/LargeVerticalScrollbar" />
+	<WindowAlias Alias="Taharez VertScrollbarThumb" Target="TaharezLook/LargeVerticalScrollbarThumb" />
+</GUIScheme>
+
Index: /Samples/Media/gui/bluehighway-10.font
===================================================================
--- /Samples/Media/gui/bluehighway-10.font	(revision 5)
+++ /Samples/Media/gui/bluehighway-10.font	(revision 5)
@@ -0,0 +1,2 @@
+<?xml version="1.0" ?>
+<Font Name="BlueHighway-10" Filename="bluehigh.ttf" Type="FreeType" Size="10" NativeHorzRes="1024" NativeVertRes="768" AutoScaled="false" AntiAlias="true" />
Index: /Samples/Media/gui/bluehighway-12.font
===================================================================
--- /Samples/Media/gui/bluehighway-12.font	(revision 5)
+++ /Samples/Media/gui/bluehighway-12.font	(revision 5)
@@ -0,0 +1,2 @@
+<?xml version="1.0" ?>
+<Font Name="BlueHighway-12" Filename="bluehigh.ttf" Type="FreeType" Size="12" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true"/>
Index: /Samples/Media/gui/bluehighway-8.font
===================================================================
--- /Samples/Media/gui/bluehighway-8.font	(revision 5)
+++ /Samples/Media/gui/bluehighway-8.font	(revision 5)
@@ -0,0 +1,2 @@
+<?xml version="1.0" ?>
+<Font Name="BlueHighway-8" Filename="bluehigh.ttf" Type="FreeType" Size="8" NativeHorzRes="1024" NativeVertRes="768" AutoScaled="true" AntiAlias="true" />
Index: /Samples/Media/gui/cegui8.layout
===================================================================
--- /Samples/Media/gui/cegui8.layout	(revision 5)
+++ /Samples/Media/gui/cegui8.layout	(revision 5)
@@ -0,0 +1,130 @@
+<?xml version="1.0" ?>
+<!-- Layout file from CEGUI Demo8 -->
+<GUILayout>
+<Window Type="DefaultGUISheet" Name="demo_root">
+
+	<Window Type="DefaultGUISheet" Name="Demo8">
+
+		<Property Name="UnifiedMaxSize" Value="{{1,0},{2,0}}" />
+		<Property Name="UnifiedSize" Value="{{1,0},{2,0}}"  />
+
+		<Window Type="TaharezLook/VerticalScrollbar" Name="Demo8/ViewScroll">
+			<Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}"  />
+			<Property Name="UnifiedSize" Value="{{0.03,0},{0.75,0}}"  />
+			<Property Name="DocumentSize" Value="2" />
+			<Property Name="PageSize" Value="1" />
+			<Property Name="StepSize" Value="0.01" />
+			<Property Name="OverlapSize" Value="0.5" />
+		</Window>
+
+        <Window Type="TaharezLook/FrameWindow" Name="Demo8/Window1">
+			<Property Name="UnifiedPosition" Value="{{0.05,0},{0.1,0}}"  />
+			<Property Name="UnifiedMaxSize" Value="{{0.5,0},{1,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0,128},{0,128}}" />
+			<Property Name="UnifiedSize" Value="{{0.4,0},{0.35,0}}"  />
+			<Property Name="Text" Value="Demo 8 - Listbox Demo" />
+
+			<Window Type="TaharezLook/Listbox" Name="Demo8/Window1/Listbox">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.1,0}}"  />
+				<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.9,0},{0.33,0}}"  />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="Demo8/Window1/Controls">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.45,0}}"  />
+				<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.9,0},{0.5,0}}"  />
+
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Demo8/Window1/Controls/Red">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.05,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.9,0},{0.06,0}}"  />
+					<Property Name="DocumentSize" Value="255" />
+					<Property Name="PageSize" Value="16" />
+					<Property Name="StepSize" Value="1" />
+					<Property Name="OverlapSize" Value="1" />
+				</Window>
+
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Demo8/Window1/Controls/Green">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.12,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.9,0},{0.06,0}}"  />
+					<Property Name="DocumentSize" Value="256" />
+					<Property Name="PageSize" Value="16" />
+					<Property Name="StepSize" Value="1" />
+					<Property Name="OverlapSize" Value="1" />
+				</Window>
+
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Demo8/Window1/Controls/Blue">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.19,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.9,0},{0.06,0}}"  />
+					<Property Name="DocumentSize" Value="255" />
+					<Property Name="PageSize" Value="16" />
+					<Property Name="StepSize" Value="1" />
+					<Property Name="OverlapSize" Value="1" />
+				</Window>
+
+				<Window Type="TaharezLook/StaticImage" Name="Demo8/Window1/Controls/ColourSample">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.26,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.9,0},{0.1,0}}"  />
+					<Property Name="Image" Value="set:TaharezLook image:ListboxSelectionBrush" />
+					<Property Name="ImageColours" Value="tl:0 tr:0 bl:0 br:0" />
+				</Window>
+
+				<Window Type="TaharezLook/Editbox" Name="Demo8/Window1/Controls/Editbox">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.38,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.6,0},{0.15,0}}"  />
+				</Window>
+
+                <Window Type="TaharezLook/Button" Name="Demo8/Window1/Controls/Add">
+					<Property Name="UnifiedPosition" Value="{{0.68,0},{0.38,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.3,0},{0.15,0}}"  />
+					<Property Name="Text" Value="Add" />
+				</Window>
+
+                <Window Type="TaharezLook/StaticText" Name="Demo8/Window1/Controls/ins1">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.55,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.9,0},{0.4,0}}"  />
+					<Property Name="HorzFormatting" Value="WordWrapCentred" />
+					<Property Name="Text" Value="Use this panel to add items.  The scrollbars change the selection colour." />
+				</Window>
+
+			</Window>
+			
+		</Window>
+
+        <Window Type="TaharezLook/FrameWindow" Name="Demo8/Window2">
+			<Property Name="UnifiedPosition" Value="{{0.55,0},{0.1,0}}"  />
+			<Property Name="UnifiedMaxSize" Value="{{0.5,0},{1,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0,128},{0,128}}" />
+			<Property Name="UnifiedSize" Value="{{0.4,0},{0.3,0}}"  />
+			<Property Name="Text" Value="Demo 8 - Information Window" />
+
+            <Window Type="TaharezLook/StaticText" Name="Demo8/Window2/Info">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.1,0}}"  />
+				<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.9,0},{0.3,0}}"  />
+				<Property Name="HorzFormatting" Value="WordWrapCentred" />
+				<Property Name="Text" Value="The panel below gives some information about the item under the mouse." />
+			</Window>
+	
+            <Window Type="TaharezLook/StaticText" Name="Demo8/Window2/Tips">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.5,0}}"  />
+				<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.9,0},{0.4,0}}"  />
+				<Property Name="HorzFormatting" Value="WordWrapCentred" />
+			</Window>
+
+		</Window>
+
+
+	</Window>
+
+</Window>
+
+</GUILayout>
Index: /Samples/Media/gui/facial.layout
===================================================================
--- /Samples/Media/gui/facial.layout	(revision 5)
+++ /Samples/Media/gui/facial.layout	(revision 5)
@@ -0,0 +1,379 @@
+<?xml version="1.0" ?>
+<GUILayout>
+<Window Type="DefaultGUISheet" Name="root">
+    <Window Type="DefaultGUISheet" Name="FacialDemo">
+		<Property Name="UnifiedSize" Value="{{0.25,0},{1,0}}" />
+
+		<Window Type="TaharezLook/FrameWindow" Name="OgreGuiDemo/WindowPropertiesWindow">
+
+			<Property Name="UnifiedSize" Value="{{0,200},{0,400}}" />
+            <Property Name="UnifiedPosition" Value="{{0,0},{0,0.52}}" />
+            <Property Name="TitlebarEnabled" Value="false" />
+            <Property Name="CloseButtonEnabled" Value="false" />
+			<Property Name="Text" Value="Editor Window" />
+			<Window Type="TaharezLook/RadioButton" Name="Facial/Radio/Play">
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,15},{0,5}}" />
+				<Property Name="UnifiedSize" Value="{{0,90},{0,40}}" />
+                <Property Name="Text" Value="Animation" />
+            </Window>
+			<Window Type="TaharezLook/RadioButton" Name="Facial/Radio/Manual">
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,110},{0,5}}" />
+				<Property Name="UnifiedSize" Value="{{0,90},{0,40}}" />
+                <Property Name="Text" Value="Manual" />
+			</Window>				
+			<Window Type="TaharezLook/StaticText" Name="Facial/Expressions">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,5},{0,35}}" />
+				<Property Name="UnifiedSize" Value="{{0,190},{0,40}}" />
+                <Property Name="Text" Value="Expressions" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/Happy_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,5},{0,55}}" />
+				<Property Name="UnifiedSize" Value="{{0,60},{0,40}}" />
+                <Property Name="Text" Value="Happy" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/Happy_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,75}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/Sad_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,5},{0,70}}" />
+				<Property Name="UnifiedSize" Value="{{0,60},{0,40}}" />
+                <Property Name="Text" Value="Sad" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/Sad_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,90}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/Angry_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,5},{0,85}}" />
+				<Property Name="UnifiedSize" Value="{{0,60},{0,40}}" />
+                <Property Name="Text" Value="Angry" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/Angry_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,105}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="Facial/MouthShapes">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,5},{0,110}}" />
+				<Property Name="UnifiedSize" Value="{{0,150},{0,40}}" />
+                <Property Name="Text" Value="Mouth Shapes" />
+            </Window>
+
+			<Window Type="TaharezLook/StaticText" Name="Facial/A_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,135}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="A" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/A_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,150}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/E_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,25},{0,150}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="E" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/E_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,165}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/I_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,165}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="I" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/I_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,180}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/O_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,25},{0,180}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="O" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/O_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,195}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/U_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,195}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="U" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/U_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,210}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/C_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,210}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="C" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/C_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,225}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+			</Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/W_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,25},{0,225}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="W" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/W_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,240}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/M_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,240}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="M" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/M_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,255}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/L_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,255}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="L" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/L_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,270}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/F_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,270}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="F" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/F_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,285}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/T_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,285}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="T" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/T_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,300}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/P_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,300}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="P" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/P_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,315}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/R_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,315}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="R" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/R_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,330}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/S_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,330}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="S" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/S_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,345}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/TH_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,345}}" />
+				<Property Name="UnifiedSize" Value="{{0,35},{0,40}}" />
+                <Property Name="Text" Value="TH" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/TH_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,360}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			
+			<!-- A, U, O, E, I, C, W, M, L, F, T, P, R, S, TH -->
+
+        </Window>
+	</Window>
+</Window>
+
+</GUILayout>
Index: /Samples/Media/gui/ogregui.layout
===================================================================
--- /Samples/Media/gui/ogregui.layout	(revision 5)
+++ /Samples/Media/gui/ogregui.layout	(revision 5)
@@ -0,0 +1,79 @@
+<?xml version="1.0" ?>
+<GUILayout>
+<Window Type="DefaultGUISheet" Name="root">
+    <Window Type="DefaultGUISheet" Name="OgreGuiDemo">
+		<Property Name="UnifiedSize" Value="{{0.25,0},{1,0}}" />
+
+        <Window Type="TaharezLook/TabControl" Name="OgreGuiDemo/TabCtrl">
+            <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}" />
+            <Property Name="UnifiedSize" Value="{{1,0},{0.5,0}}" />
+
+            <Window Type="DefaultGUISheet" Name="OgreGuiDemo/TabCtrl/Page1">
+                <Property Name="Text" Value="File" />
+                <Window Type="TaharezLook/Button" Name="OgreGuiDemo/TabCtrl/Page1/NewButton">
+                    <Property Name="UnifiedPosition" Value="{{0.1,0},{0.1,0}}" />
+                    <Property Name="UnifiedSize" Value="{{0.8,0},{0.07,0}}" />
+                    <Property Name="Text" Value="New" />
+                </Window>
+                <Window Type="TaharezLook/Button" Name="OgreGuiDemo/TabCtrl/Page1/LoadButton">
+                    <Property Name="UnifiedPosition" Value="{{0.1,0},{0.2,0}}" />
+                    <Property Name="UnifiedSize" Value="{{0.8,0},{0.07,0}}" />
+                    <Property Name="Text" Value="Load Test Layout" />
+                </Window>
+                <Window Type="TaharezLook/Button" Name="OgreGuiDemo/TabCtrl/Page1/QuitButton">
+                    <Property Name="UnifiedPosition" Value="{{0.1,0},{0.3,0}}" />
+                    <Property Name="UnifiedSize" Value="{{0.8,0},{0.07,0}}" />
+                    <Property Name="Text" Value="Quit" />
+                </Window>
+            </Window>
+            <Window Type="DefaultGUISheet" Name="OgreGuiDemo/TabCtrl/Page2">
+                <Property Name="Text" Value="Objects" />
+                <Window Type="TaharezLook/Combobox" Name="OgreGuiDemo/TabCtrl/Page2/ObjectTypeList">
+                    <Property Name="UnifiedPosition" Value="{{0.1,0},{0.1,0}}" />
+                    <Property Name="UnifiedSize" Value="{{0.8,0},{0.5,0}}" />
+                    <Property Name="Text" Value="Select Type" />
+                    <Property Name="ClippedByParent" Value="false" />
+                    <Property Name="ReadOnly" Value="true" />
+                </Window>
+            </Window>
+        </Window>
+        <!--<Window Type="TaharezLook/FrameWindow" Name="OgreGuiDemo/WindowPropertiesWindow">
+            <Property Name="UnifiedSize" Value="{{1,0},{0.3,0}}" />
+            <Property Name="UnifiedPosition" Value="{{0,0},{0.52,0}}" />
+            <Property Name="TitlebarEnabled" Value="false" />
+            <Property Name="CloseButtonEnabled" Value="false" />
+            <Property Name="Visible" Value="false" />
+            <Property Name="Text" Value="Editor Window" />
+            <Window Type="TaharezLook/StaticText" Name="OgreGuiDemo/WindowProperties/NameText">
+                <Property Name="UnifiedPosition" Value="{{0.05,0},{0.2,0}}" />
+                <Property Name="UnifiedSize" Value="{{0.9,0},{0.4,0}}" />
+                <Property Name="Text" Value="Name:" />
+            </Window>
+
+            <Window Type="TaharezLook/Button" Name="OgreGuiDemo/WindowPropertiesWindow/OKButton">
+                <Property Name="UnifiedPosition" Value="{{0.15,0},{0.8,0}}" />
+                <Property Name="UnifiedSize" Value="{{0.3,0},{0.1,0}}" />
+                <Property Name="Text" Value="OK" />
+            </Window>
+            <Window Type="TaharezLook/Button" Name="OgreGuiDemo/WindowPropertiesWindow/CancelButton">
+                <Property Name="UnifiedPosition" Value="{{0.55,0},{0.8,0}}" />
+                <Property Name="UnifiedSize" Value="{{0.3,0},{0.1,0}}" />
+                <Property Name="Text" Value="Cancel" />
+            </Window>
+        </Window>-->
+	</Window>
+    <Window Type="DefaultGUISheet" Name="OgreGuiDemo2">
+		<Property Name="UnifiedSize" Value="{{0.75,0},{1,0}}" />
+		<Property Name="UnifiedPosition" Value="{{0.25,0},{0,0}}" />
+        <Window Type="TaharezLook/FrameWindow" Name="OgreGuiDemo2/MainWindow">
+            <Property Name="UnifiedSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" />
+            <Property Name="DragMovingEnabled" Value="false" />
+            <Property Name="RollUpEnabled" Value="false" />
+            <Property Name="CloseButtonEnabled" Value="false" />
+            <Property Name="Text" Value="Editor Window" />
+        </Window>
+    </Window>
+</Window>
+
+</GUILayout>
Index: /Samples/Media/gui/shadows.layout
===================================================================
--- /Samples/Media/gui/shadows.layout	(revision 5)
+++ /Samples/Media/gui/shadows.layout	(revision 5)
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+    <Window Type="DefaultWindow" Name="Shadows" >
+        <Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Window Type="TaharezLook/FrameWindow" Name="Shadows/Main" >
+            <Property Name="Font" Value="BlueHighway-12" />
+            <Property Name="Alpha" Value="0.5" />
+            <Property Name="FrameEnabled" Value="False" />
+            <Property Name="TitlebarFont" Value="BlueHighway-12" />
+            <Property Name="SizingEnabled" Value="False" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="TitlebarEnabled" Value="False" />
+            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{0.797107,0},{0.148408,0}}" />
+            <Property Name="DragMovingEnabled" Value="False" />
+            <Property Name="CloseButtonEnabled" Value="False" />
+            <Window Type="TaharezLook/RadioButton" Name="Shadows/Stencil" >
+                <Property Name="ID" Value="1" />
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Stencil shadows" />
+                <Property Name="GroupID" Value="1" />
+                <Property Name="Tooltip" Value="Stencil Shadows: Geometric shadow volumes are generated from mesh silhouettes and extruded, shadowed areas calculated in the stencil buffer. Good on lower end hardware but cannot handle alpha or vertex programs that deform shape, and is too expensive at high poly counts. Sharp edged shadows." />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.00465426,0},{0.167892,0},{0.192628,0},{0.344774,0}}" />
+            </Window>
+            <Window Type="TaharezLook/RadioButton" Name="Shadows/Texture" >
+                <Property Name="ID" Value="2" />
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Texture shadows" />
+                <Property Name="GroupID" Value="1" />
+                <Property Name="Tooltip" Value="Texture Shadows: Shadow casters are rendered to a texture and this is later projected onto shadow receivers. More flexible,  handles alpha and deforming vertex programs, and texture shadow can be used in shaders for more advanced effects. Uses more GPU memory and fixed size can cause aliasing (but see projection options)" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.00531136,0},{0.362541,0},{0.194019,0},{0.529099,0}}" />
+            </Window>
+            <Window Type="TaharezLook/StaticText" Name="Shadows/Label2" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Lighting:" />
+                <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.19234,0},{-0.0189824,0},{0.303863,0},{0.18662,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/StaticText" Name="Shadows/Label1" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Technique:" />
+                <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.00658522,0},{-0.00904641,0},{0.160622,0},{0.186908,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/RadioButton" Name="Shadows/Additive" >
+                <Property Name="ID" Value="3" />
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Additive" />
+                <Property Name="GroupID" Value="2" />
+                <Property Name="Tooltip" Value="Additive Lighting: Light is built up incrementally in the scene, and areas of shadow are masked out per light during the process. Much more realistic lighting model, taking into account multiple coloured lights and ambient contribution well, but more expensive since it can take more passes to render." />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.196723,0},{0.174711,0},{0.327724,0},{0.348675,0}}" />
+            </Window>
+            <Window Type="TaharezLook/RadioButton" Name="Shadows/Modulative" >
+                <Property Name="ID" Value="4" />
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Modulative" />
+                <Property Name="GroupID" Value="2" />
+                <Property Name="Tooltip" Value="Modulative shadows: Shadowed areas are uniformly darkened by a shadow colour after rendering the scene normally. A simple but inaccurate model, it works best when there is one dominant light source (e.g. outdoor daylight). Multiple lights exhibit overdarkening artefacts." />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.195901,0},{0.36936,0},{0.334983,0},{0.532604,0}}" />
+            </Window>
+            <Window Type="TaharezLook/StaticText" Name="Shadows/Desc" >
+                <Property Name="Font" Value="BlueHighway-10" />
+                <Property Name="Text" >
+</Property>
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="HorzFormatting" Value="WordWrapLeftAligned" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="VertFormatting" Value="TopAligned" />
+                <Property Name="UnifiedAreaRect" Value="{{-0.00124776,0},{0.534509,0},{0.998327,0},{1.00537,0}}" />
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="Shadows/ProjectionGroup" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.318294,0},{0.0269328,0},{0.547929,0},{0.488323,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+                <Window Type="TaharezLook/StaticText" Name="Shadows/Label21" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Projection:" />
+                    <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0242767,0},{-0.00538364,0},{0.514109,0},{0.300338,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/Combobox" Name="Shadows/Projection" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Tooltip" Value="Projection: This is the basis for the shadow projection. A uniform projection is the simplest but can also cause aliasing close to the camera due to the finite resolution of the shadow texture. You can plug new ShadowCameraSetup classes to change the projection basis and distribute the shadow texture differently to compensate for this." />
+                    <Property Name="ReadOnly" Value="True" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0215161,0},{0.406132,0},{1.00682,0},{4,0}}" />
+                    <Property Name="MaxEditTextLength" Value="1073741823" />
+                </Window>
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="Shadows/MaterialGroup" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.554514,0},{0.0286934,0},{0.927227,0},{0.490084,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+                <Window Type="TaharezLook/StaticText" Name="Shadows/Label211" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Material Setup:" />
+                    <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.021516,0},{-0.158454,0},{0.862772,0},{0.387132,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/Combobox" Name="Shadows/Material" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Tooltip" Value="Material setup: You can customise materials texture shadows with material; you can modify the standard shadow passes, which are separate from the normal render, or you can use &apos;custom sequence&apos; shadows which allow you to incorporate shadow textures directly in your own materials, thus gaining complete control. Both can use shaders for effects like PCF / depth shadowmapping." />
+                    <Property Name="ReadOnly" Value="True" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.021516,0},{0.406132,0},{0.731289,0},{4,0}}" />
+                    <Property Name="MaxEditTextLength" Value="1073741823" />
+                </Window>
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="Shadows/DepthShadowTweakGroup" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.825038,0},{0.0186838,0},{0.999281,0},{0.548657,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+                <Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/FixedBiasLabel" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="FixedBias:" />
+                    <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+					<Property Name="UnifiedAreaRect" Value="{{0.0316741,0},{0.0,0},{0.373716,0},{0.2,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Shadows/DepthShadowTweakGroup/FixedBias" >
+                    <Property Name="PageSize" Value="0.001" />
+                    <Property Name="StepSize" Value="0.0005" />
+                    <Property Name="OverlapSize" Value="0.0005" />
+                    <Property Name="DocumentSize" Value="0.021" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+					<Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.0,0},{1,0},{0.15,0}}" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/FixedBiasText" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+					<Property Name="Text" Value="" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedAreaRect" Value="{{0.70,0},{0.125,0},{0.943746,0},{0.3,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/SlopeBiasLabel" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="SlopeBias:" />
+                    <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+					<Property Name="UnifiedAreaRect" Value="{{0.0316741,0},{0.35,0},{0.373716,0},{0.55,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Shadows/DepthShadowTweakGroup/SlopeBias" >
+                    <Property Name="PageSize" Value="0.1" />
+                    <Property Name="StepSize" Value="0.05" />
+                    <Property Name="OverlapSize" Value="0.05" />
+                    <Property Name="DocumentSize" Value="2.1" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.35,0},{1,0},{0.5,0}}" />
+                </Window>
+				<Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/SlopeBiasText" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+					<Property Name="Text" Value="" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedAreaRect" Value="{{0.70,0},{0.475,0},{0.943746,0},{0.675,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+				<Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/SlopeClampLabel" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+					<Property Name="Text" Value="Clamp:" />
+                    <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+					<Property Name="UnifiedAreaRect" Value="{{0.0316741,0},{0.675,0},{0.472153,0},{0.85,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Shadows/DepthShadowTweakGroup/SlopeClamp" >
+                    <Property Name="PageSize" Value="0.01" />
+                    <Property Name="StepSize" Value="0.005" />
+                    <Property Name="OverlapSize" Value="0.005" />
+                    <Property Name="DocumentSize" Value="0.11" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+					<Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.7,0},{1,0},{0.85,0}}" />
+                </Window>
+				<Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/SlopeClampText" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+					<Property Name="Text" Value="" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedAreaRect" Value="{{0.70,0},{0.825,0},{0.943746,0},{0.99,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+            </Window>
+        </Window>
+    </Window>
+</GUILayout>
Index: /Samples/Media/materials/programs/AmbientOneTexture.glsl
===================================================================
--- /Samples/Media/materials/programs/AmbientOneTexture.glsl	(revision 5)
+++ /Samples/Media/materials/programs/AmbientOneTexture.glsl	(revision 5)
@@ -0,0 +1,13 @@
+uniform vec4 ambient;
+
+/*
+  Basic ambient lighting vertex program
+*/
+void main()
+{
+	gl_Position = ftransform();
+	gl_TexCoord[0] = gl_MultiTexCoord0;
+	gl_FrontColor = ambient;
+}
+
+
Index: /Samples/Media/materials/programs/Bloom_ps20.hlsl
===================================================================
--- /Samples/Media/materials/programs/Bloom_ps20.hlsl	(revision 5)
+++ /Samples/Media/materials/programs/Bloom_ps20.hlsl	(revision 5)
@@ -0,0 +1,52 @@
+sampler Blur1: register(s1);
+sampler RT: register(s0);
+
+
+float luminance(float3 c)
+{
+	return dot( c, float3(0.3, 0.59, 0.11) );
+}
+
+float4 main(float2 texCoord: TEXCOORD0) : COLOR {
+	float4 sharp = tex2D(RT,   texCoord);
+	float4 blur  = tex2D(Blur1, texCoord);
+
+
+
+	return ( sharp + blur * 1.8 ) / 2;
+
+//	float4 color	= lerp( sharp, blur, 0.4f );
+
+//	return color;
+
+
+/*
+	return ( sharp + blur * 1.8 ) / 2 +
+			 luminance(blur) * 
+			 float4( 0.5, 0.5, 0.5, 0) +
+			 luminance(sharp) *
+			 float4( 0.3, 0.3, 0.3, 0);
+*/
+/*
+	return ( sharp + blur * 0.9) / 2 +
+			 luminance(blur) * float4(0.1, 0.15, 0.7, 0);
+*/
+
+/*
+	return ( sharp + blur * 0.9) / 2 +
+			 luminance(blur) * float4(0.1, 0.15, 0.7, 0);
+*/
+
+//	float4 retColor = luminance( sharp ) +
+//							luminance( blur ) + blur / 2;
+//	return retColor;
+}
+
+
+
+
+
+
+
+
+
Index: /Samples/Media/materials/programs/Bloom_vs11.hlsl
===================================================================
--- /Samples/Media/materials/programs/Bloom_vs11.hlsl	(revision 5)
+++ /Samples/Media/materials/programs/Bloom_vs11.hlsl	(revision 5)
@@ -0,0 +1,21 @@
+
+struct VS_OUTPUT {
+   float4 Pos: POSITION;
+   float2 texCoord: TEXCOORD0;
+};
+
+VS_OUTPUT main(float4 Pos: POSITION){
+   VS_OUTPUT Out;
+
+   // Clean up inaccuracies
+   Pos.xy = sign(Pos.xy);
+
+   Out.Pos = float4(Pos.xy, 0, 1);
+   // Image-space
+   Out.texCoord.x = 0.5 * (1 + Pos.x);
+   Out.texCoord.y = 0.5 * (1 - Pos.y);
+
+   return Out;
+}
+
+
Index: /Samples/Media/materials/programs/Blur0_ps20.hlsl
===================================================================
--- /Samples/Media/materials/programs/Blur0_ps20.hlsl	(revision 5)
+++ /Samples/Media/materials/programs/Blur0_ps20.hlsl	(revision 5)
@@ -0,0 +1,31 @@
+sampler RT: register(s0);
+// Simple blur filter
+
+float4 main(float2 texCoord: TEXCOORD0) : COLOR {
+
+	float2 samples[12] = {
+   	-0.326212, -0.405805,
+   	-0.840144, -0.073580,
+   	-0.695914,  0.457137,
+   	-0.203345,  0.620716,
+    	0.962340, -0.194983,
+    	0.473434, -0.480026,
+    	0.519456,  0.767022,
+    	0.185461, -0.893124,
+    	0.507431,  0.064425,
+    	0.896420,  0.412458,
+   	-0.321940, -0.932615,
+   	-0.791559, -0.597705,
+	};
+
+   float4 sum = tex2D(RT, texCoord);
+   for (int i = 0; i < 12; i++){
+      sum += tex2D(RT, texCoord + 0.025 * samples[i]);
+   }
+   return sum / 13;
+
+}
+
+
+
+
Index: /Samples/Media/materials/programs/Blur0_vs.glsl
===================================================================
--- /Samples/Media/materials/programs/Blur0_vs.glsl	(revision 5)
+++ /Samples/Media/materials/programs/Blur0_vs.glsl	(revision 5)
@@ -0,0 +1,15 @@
+varying vec2 texCoord[5];
+
+void main()                    
+{
+	vec2 inPos = sign(gl_Vertex.xy);
+	gl_Position = vec4(inPos.xy, 0.0, 1.0);
+	
+	texCoord[0]  = (vec2(inPos.x, -inPos.y) + 1.0)/2.0;
+	
+	const float size = 0.01;
+	texCoord[1] = texCoord[0] + vec2(1.0, 0.0)*size;
+	texCoord[2] = texCoord[0] + vec2(2.0, 0.0)*size;
+	texCoord[3] = texCoord[0] + vec2(-1.0, 0.0)*size;
+	texCoord[4] = texCoord[0] + vec2(-2.0, 0.0)*size;
+}
Index: /Samples/Media/materials/programs/Blur0_vs11.hlsl
===================================================================
--- /Samples/Media/materials/programs/Blur0_vs11.hlsl	(revision 5)
+++ /Samples/Media/materials/programs/Blur0_vs11.hlsl	(revision 5)
@@ -0,0 +1,22 @@
+struct VS_OUTPUT {
+   float4 Pos: POSITION;
+   float2 texCoord: TEXCOORD0;
+};
+
+VS_OUTPUT main(float4 Pos: POSITION){
+   VS_OUTPUT Out;
+
+   // Clean up inaccuracies
+   Pos.xy = sign(Pos.xy);
+
+   Out.Pos = float4(Pos.xy, 0, 1);
+   // Image-space
+   Out.texCoord.x = 0.5 * (1 + Pos.x);
+   Out.texCoord.y = 0.5 * (1 - Pos.y);
+
+   return Out;
+}
+
+
+
+
Index: /Samples/Media/materials/programs/Blur1_ps20.hlsl
===================================================================
--- /Samples/Media/materials/programs/Blur1_ps20.hlsl	(revision 5)
+++ /Samples/Media/materials/programs/Blur1_ps20.hlsl	(revision 5)
@@ -0,0 +1,28 @@
+sampler Blur0: register(s0);
+// Simple blur filter
+
+float4 main(float2 texCoord: TEXCOORD0) : COLOR {
+
+	float2 samples[12] = {
+   	-0.326212, -0.405805,
+   	-0.840144, -0.073580,
+   	-0.695914,  0.457137,
+   	-0.203345,  0.620716,
+    	0.962340, -0.194983,
+    	0.473434, -0.480026,
+    	0.519456,  0.767022,
+    	0.185461, -0.893124,
+    	0.507431,  0.064425,
+    	0.896420,  0.412458,
+   	-0.321940, -0.932615,
+   	-0.791559, -0.597705,
+	};
+
+   float4 sum = tex2D(Blur0, texCoord);
+   for (int i = 0; i < 12; i++){
+      sum += tex2D(Blur0, texCoord + 0.025 * samples[i]);
+   }
+   return sum / 13;
+
+}
+
Index: /Samples/Media/materials/programs/Blur1_vs.glsl
===================================================================
--- /Samples/Media/materials/programs/Blur1_vs.glsl	(revision 5)
+++ /Samples/Media/materials/programs/Blur1_vs.glsl	(revision 5)
@@ -0,0 +1,15 @@
+varying vec2 texCoord[5];
+
+void main()                    
+{
+	vec2 inPos = sign(gl_Vertex.xy);
+	gl_Position = vec4(inPos.xy, 0.0, 1.0);
+	
+	texCoord[0]  = (vec2(inPos.x, -inPos.y) + 1.0)/2.0;
+	
+	const float size = 0.01;
+	texCoord[1] = texCoord[0] + vec2(0.0, 1.0)*size;
+	texCoord[2] = texCoord[0] + vec2(0.0, 2.0)*size;
+	texCoord[3] = texCoord[0] + vec2(0.0, -1.0)*size;
+	texCoord[4] = texCoord[0] + vec2(0.0, -2.0)*size;
+}
Index: /Samples/Media/materials/programs/Blur1_vs11.hlsl
===================================================================
--- /Samples/Media/materials/programs/Blur1_vs11.hlsl	(revision 5)
+++ /Samples/Media/materials/programs/Blur1_vs11.hlsl	(revision 5)
@@ -0,0 +1,19 @@
+struct VS_OUTPUT {
+   float4 Pos: POSITION;
+   float2 texCoord: TEXCOORD0;
+};
+
+VS_OUTPUT main(float4 Pos: POSITION){
+   VS_OUTPUT Out;
+
+   // Clean up inaccuracies
+   Pos.xy = sign(Pos.xy);
+
+   Out.Pos = float4(Pos.xy, 0, 1);
+   // Image-space
+   Out.texCoord.x = 0.5 * (1 + Pos.x);
+   Out.texCoord.y = 0.5 * (1 - Pos.y);
+
+   return Out;
+}
+
Index: /Samples/Media/materials/programs/Blur_ps.glsl
===================================================================
--- /Samples/Media/materials/programs/Blur_ps.glsl	(revision 5)
+++ /Samples/Media/materials/programs/Blur_ps.glsl	(revision 5)
@@ -0,0 +1,14 @@
+uniform sampler2D tex0;
+
+varying vec2 texCoord[5];
+
+void main()
+{
+	vec4 sum = texture2D(tex0, texCoord[0]) + 
+			   texture2D(tex0, texCoord[1]) +
+			   texture2D(tex0, texCoord[2]) + 
+			   texture2D(tex0, texCoord[3]) +
+			   texture2D(tex0, texCoord[4]);
+	gl_FragColor = sum / 5.0;
+}
+
Index: /Samples/Media/materials/programs/Combine_fp.cg
===================================================================
--- /Samples/Media/materials/programs/Combine_fp.cg	(revision 5)
+++ /Samples/Media/materials/programs/Combine_fp.cg	(revision 5)
@@ -0,0 +1,15 @@
+float4 Combine_fp
+(
+    in float2 texCoord: TEXCOORD0,
+    
+    uniform sampler RT : register(s0),
+    uniform sampler Sum : register(s1),
+
+    uniform float blur
+) : COLOR
+{
+   float4 render = tex2D(RT, texCoord);
+   float4 sum = tex2D(Sum, texCoord);
+
+   return lerp(render, sum, blur);
+}
Index: /Samples/Media/materials/programs/DOF_ps.cg
===================================================================
--- /Samples/Media/materials/programs/DOF_ps.cg	(revision 5)
+++ /Samples/Media/materials/programs/DOF_ps.cg	(revision 5)
@@ -0,0 +1,47 @@
+// Simple blur filter
+
+const float2 samples[8] = {
+    {-1, 1},
+    {-1, 0},
+    {-1, -1},
+    {0, -1},
+    {1, -1},
+    {1, 0},
+    {1, 1},
+    {0, 1}
+};
+
+float4 blur(
+
+    in float2 texCoord: TEXCOORD0,
+    uniform float sampleDistance: register(c0),
+    uniform sampler Blur0: register(s0)
+
+) : COLOR
+{
+   float4 sum = tex2D(Blur0, texCoord);
+   for (int i = 0; i < 8; ++i){
+      sum += tex2D(Blur0, texCoord + sampleDistance * samples[i]);
+   }
+   return sum / 9;
+}
+
+
+
+float4 blend
+(
+    in float2 texCoord: TEXCOORD0,
+
+    uniform sampler Blur0 : register(s0),
+    uniform sampler Blur1 : register(s1),
+
+    uniform float focus: register(c0),
+    uniform float range: register(c1)
+) : COLOR
+{
+   float4 sharp = tex2D(Blur0, texCoord);
+   float4 blur  = tex2D(Blur1, texCoord);
+
+   // alpha channel of sharp RT has depth info
+   return lerp(sharp, blur, saturate(range * abs(focus - sharp.a)));
+}
Index: /Samples/Media/materials/programs/DepthShadowmap.hlsl
===================================================================
--- /Samples/Media/materials/programs/DepthShadowmap.hlsl	(revision 5)
+++ /Samples/Media/materials/programs/DepthShadowmap.hlsl	(revision 5)
@@ -0,0 +1,309 @@
+/* This file implements standard programs for depth shadow mapping. 
+   These particular ones are suitable for additive lighting models, and
+   include 3 techniques to reduce depth fighting on self-shadowed surfaces,
+   constant bias, gradient (slope-scale) bias, and a fuzzy shadow map comparison*/
+
+
+// Shadow caster vertex program.
+void casterVP(
+	float4 position			: POSITION,
+	out float4 outPos		: POSITION,
+	out float2 outDepth		: TEXCOORD0,
+
+	uniform float4x4 worldViewProj,
+	uniform float4 texelOffsets,
+	uniform float4 depthRange
+	)
+{
+	outPos = mul(worldViewProj, position);
+
+	// fix pixel / texel alignment
+	outPos.xy += texelOffsets.zw * outPos.w;
+	// linear depth storage
+	// offset / scale range output
+#if LINEAR_RANGE
+	outDepth.x = (outPos.z - depthRange.x) * depthRange.w;
+#else
+	outDepth.x = outPos.z;
+#endif
+	outDepth.y = outPos.w;
+}
+
+
+// Shadow caster fragment program for high-precision single-channel textures	
+void casterFP(
+	float2 depth			: TEXCOORD0,
+	out float4 result		: COLOR)
+	
+{
+#if LINEAR_RANGE
+	float finalDepth = depth.x;
+#else
+	float finalDepth = depth.x / depth.y;
+#endif
+	// just smear across all components 
+	// therefore this one needs high individual channel precision
+	result = float4(finalDepth, finalDepth, finalDepth, 1);
+}
+
+
+	
+void receiverVP(
+	float4 position		: POSITION,
+	float4 normal		: NORMAL,
+
+	out float4 outPos			: POSITION,
+	out float4 outColour		: COLOR,
+	out float4 outShadowUV		: TEXCOORD0,
+
+	uniform float4x4 world,
+	uniform float4x4 worldIT,
+	uniform float4x4 worldViewProj,
+	uniform float4x4 texViewProj,
+	uniform float4 lightPosition,
+	uniform float4 lightColour,
+	uniform float4 shadowDepthRange
+	)
+{
+	float4 worldPos = mul(world, position);
+	outPos = mul(worldViewProj, position);
+
+	float3 worldNorm = mul(worldIT, normal).xyz;
+
+	// calculate lighting (simple vertex lighting)
+	float3 lightDir = normalize(
+		lightPosition.xyz -  (worldPos.xyz * lightPosition.w));
+
+	outColour = lightColour * max(dot(lightDir, worldNorm), 0.0);
+
+	// calculate shadow map coords
+	outShadowUV = mul(texViewProj, worldPos);
+#if LINEAR_RANGE
+	// adjust by fixed depth bias, rescale into range
+	outShadowUV.z = (outShadowUV.z - shadowDepthRange.x) * shadowDepthRange.w;
+#endif
+	
+
+
+	
+}
+
+void receiverFP(
+	float4 position			: POSITION,
+	float4 shadowUV			: TEXCOORD0,
+	float4 vertexColour		: COLOR,
+
+	uniform sampler2D shadowMap : register(s0),
+	uniform float inverseShadowmapSize,
+	uniform float fixedDepthBias,
+	uniform float gradientClamp,
+	uniform float gradientScaleBias,
+	uniform float shadowFuzzyWidth,
+	
+	out float4 result		: COLOR)
+{
+	// point on shadowmap
+#if LINEAR_RANGE
+	shadowUV.xy = shadowUV.xy / shadowUV.w;
+#else
+	shadowUV = shadowUV / shadowUV.w;
+#endif
+	float centerdepth = tex2D(shadowMap, shadowUV.xy).x;
+    
+    // gradient calculation
+  	float pixeloffset = inverseShadowmapSize;
+    float4 depths = float4(
+    	tex2D(shadowMap, shadowUV.xy + float2(-pixeloffset, 0)).x,
+    	tex2D(shadowMap, shadowUV.xy + float2(+pixeloffset, 0)).x,
+    	tex2D(shadowMap, shadowUV.xy + float2(0, -pixeloffset)).x,
+    	tex2D(shadowMap, shadowUV.xy + float2(0, +pixeloffset)).x);
+
+	float2 differences = abs( depths.yw - depths.xz );
+	float gradient = min(gradientClamp, max(differences.x, differences.y));
+	float gradientFactor = gradient * gradientScaleBias;
+
+	// visibility function
+	float depthAdjust = gradientFactor + (fixedDepthBias * centerdepth);
+	float finalCenterDepth = centerdepth + depthAdjust;
+
+	// shadowUV.z contains lightspace position of current object
+
+#if FUZZY_TEST
+	// fuzzy test - introduces some ghosting in result and doesn't appear to be needed?
+	//float visibility = saturate(1 + delta_z / (gradient * shadowFuzzyWidth));
+	float visibility = saturate(1 + (finalCenterDepth - shadowUV.z) * shadowFuzzyWidth * shadowUV.w);
+
+	result = vertexColour * visibility;
+#else
+	// hard test
+#if PCF
+	// use depths from prev, calculate diff
+	depths += depthAdjust.xxxx;
+	float final = (finalCenterDepth > shadowUV.z) ? 1.0f : 0.0f;
+	final += (depths.x > shadowUV.z) ? 1.0f : 0.0f;
+	final += (depths.y > shadowUV.z) ? 1.0f : 0.0f;
+	final += (depths.z > shadowUV.z) ? 1.0f : 0.0f;
+	final += (depths.w > shadowUV.z) ? 1.0f : 0.0f;
+	
+	final *= 0.2f;
+
+	result = float4(vertexColour.xyz * final, 1);
+	
+#else
+	result = (finalCenterDepth > shadowUV.z) ? vertexColour : float4(0,0,0,1);
+#endif
+
+#endif
+   
+
+	
+}
+
+
+
+
+// Expand a range-compressed vector
+float3 expand(float3 v)
+{
+	return (v - 0.5) * 2;
+}
+
+
+/* Normal mapping plus depth shadowmapping receiver programs
+*/
+void normalMapShadowReceiverVp(float4 position	: POSITION,
+			 float3 normal		: NORMAL,
+			 float2 uv			: TEXCOORD0,
+			 float3 tangent     : TANGENT0,
+			 
+			 // outputs
+			 out float4 outPos    	 : POSITION,
+			 out float4 outShadowUV	 : TEXCOORD0,
+			 out float2 oUv	 		 : TEXCOORD1,
+			 out float3 oTSLightDir  : TEXCOORD2,
+			 // parameters
+			 uniform float4 lightPosition, // object space
+			 uniform float4x4 world,
+			 uniform float4x4 worldViewProj,
+			 uniform float4x4 texViewProj)
+{
+	float4 worldPos = mul(world, position);
+	outPos = mul(worldViewProj, position);
+
+	// calculate shadow map coords
+	outShadowUV = mul(texViewProj, worldPos);
+#if LINEAR_RANGE
+	// adjust by fixed depth bias, rescale into range
+	outShadowUV.z = (outShadowUV.z - shadowDepthRange.x) * shadowDepthRange.w;
+#endif
+	
+	// pass the main uvs straight through unchanged
+	oUv = uv;
+
+	// calculate tangent space light vector
+	// Get object space light direction
+	// Non-normalised since we'll do that in the fragment program anyway
+	float3 lightDir = lightPosition.xyz -  (position * lightPosition.w);
+
+	// Calculate the binormal (NB we assume both normal and tangent are
+	// already normalised)
+	// NB looks like nvidia cross params are BACKWARDS to what you'd expect
+	// this equates to NxT, not TxN
+	float3 binormal = cross(tangent, normal);
+	
+	// Form a rotation matrix out of the vectors
+	float3x3 rotation = float3x3(tangent, binormal, normal);
+	
+	// Transform the light vector according to this matrix
+	oTSLightDir = mul(rotation, lightDir);
+
+	
+}
+
+
+void normalMapShadowReceiverFp(
+			  float4 shadowUV	: TEXCOORD0,
+			  float2 uv			: TEXCOORD1,
+			  float3 TSlightDir : TEXCOORD2,
+
+			  out float4 result	: COLOR,
+
+			  uniform float4 lightColour,
+			  uniform float inverseShadowmapSize,
+			  uniform float fixedDepthBias,
+			  uniform float gradientClamp,
+			  uniform float gradientScaleBias,
+			  uniform float shadowFuzzyWidth,
+			  
+			  uniform sampler2D   shadowMap : register(s0),
+			  uniform sampler2D   normalMap : register(s1),
+			  uniform samplerCUBE normalCubeMap : register(s2))
+{
+
+	// retrieve normalised light vector, expand from range-compressed
+	float3 lightVec = expand(texCUBE(normalCubeMap, TSlightDir).xyz);
+
+	// get bump map vector, again expand from range-compressed
+	float3 bumpVec = expand(tex2D(normalMap, uv).xyz);
+
+	// Calculate dot product
+	float4 vertexColour = lightColour * dot(bumpVec, lightVec);
+
+
+	// point on shadowmap
+#if LINEAR_RANGE
+	shadowUV.xy = shadowUV.xy / shadowUV.w;
+#else
+	shadowUV = shadowUV / shadowUV.w;
+#endif
+	float centerdepth = tex2D(shadowMap, shadowUV.xy).x;
+    
+    // gradient calculation
+  	float pixeloffset = inverseShadowmapSize;
+    float4 depths = float4(
+    	tex2D(shadowMap, shadowUV.xy + float2(-pixeloffset, 0)).x,
+    	tex2D(shadowMap, shadowUV.xy + float2(+pixeloffset, 0)).x,
+    	tex2D(shadowMap, shadowUV.xy + float2(0, -pixeloffset)).x,
+    	tex2D(shadowMap, shadowUV.xy + float2(0, +pixeloffset)).x);
+
+	float2 differences = abs( depths.yw - depths.xz );
+	float gradient = min(gradientClamp, max(differences.x, differences.y));
+	float gradientFactor = gradient * gradientScaleBias;
+
+	// visibility function
+	float depthAdjust = gradientFactor + (fixedDepthBias * centerdepth);
+	float finalCenterDepth = centerdepth + depthAdjust;
+
+	// shadowUV.z contains lightspace position of current object
+
+#if FUZZY_TEST
+	// fuzzy test - introduces some ghosting in result and doesn't appear to be needed?
+	//float visibility = saturate(1 + delta_z / (gradient * shadowFuzzyWidth));
+	float visibility = saturate(1 + (finalCenterDepth - shadowUV.z) * shadowFuzzyWidth * shadowUV.w);
+
+	result = vertexColour * visibility;
+#else
+	// hard test
+#if PCF
+	// use depths from prev, calculate diff
+	depths += depthAdjust.xxxx;
+	float final = (finalCenterDepth > shadowUV.z) ? 1.0f : 0.0f;
+	final += (depths.x > shadowUV.z) ? 1.0f : 0.0f;
+	final += (depths.y > shadowUV.z) ? 1.0f : 0.0f;
+	final += (depths.z > shadowUV.z) ? 1.0f : 0.0f;
+	final += (depths.w > shadowUV.z) ? 1.0f : 0.0f;
+	
+	final *= 0.2f;
+
+	result = float4(vertexColour.xyz * final, 1);
+	
+#else
+	result = (finalCenterDepth > shadowUV.z) ? vertexColour : float4(0,0,0,1);
+#endif
+
+#endif
+
+
+	
+}
+
Index: /Samples/Media/materials/programs/DepthShadowmapCasterFp.glsl
===================================================================
--- /Samples/Media/materials/programs/DepthShadowmapCasterFp.glsl	(revision 5)
+++ /Samples/Media/materials/programs/DepthShadowmapCasterFp.glsl	(revision 5)
@@ -0,0 +1,16 @@
+
+varying vec2 depth;
+
+void main()
+{
+#if LINEAR_RANGE
+	float finalDepth = depth.x;
+#else
+	float finalDepth = depth.x / depth.y;
+#endif
+	// just smear across all components 
+	// therefore this one needs high individual channel precision
+	gl_FragColor = vec4(finalDepth, finalDepth, finalDepth, 1);
+
+}
+
Index: /Samples/Media/materials/programs/DepthShadowmapCasterVp.glsl
===================================================================
--- /Samples/Media/materials/programs/DepthShadowmapCasterVp.glsl	(revision 5)
+++ /Samples/Media/materials/programs/DepthShadowmapCasterVp.glsl	(revision 5)
@@ -0,0 +1,24 @@
+uniform mat4 worldViewProj;
+uniform vec4 texelOffsets;
+uniform vec4 depthRange;
+
+varying vec2 depth;
+
+void main()
+{
+	gl_Position = ftransform();
+
+	// fix pixel / texel alignment
+	gl_Position.xy += texelOffsets.zw * gl_Position.w;
+	// linear depth storage
+	// offset / scale range output
+#if LINEAR_RANGE
+	depth.x = (gl_Position.z - depthRange.x) * depthRange.w;
+#else
+	depth.x = gl_Position.z;
+#endif
+	depth.y = gl_Position.w;
+
+
+}
+
Index: /Samples/Media/materials/programs/DepthShadowmapNormalMapReceiverFp.glsl
===================================================================
--- /Samples/Media/materials/programs/DepthShadowmapNormalMapReceiverFp.glsl	(revision 5)
+++ /Samples/Media/materials/programs/DepthShadowmapNormalMapReceiverFp.glsl	(revision 5)
@@ -0,0 +1,84 @@
+uniform float inverseShadowmapSize;
+uniform float fixedDepthBias;
+uniform float gradientClamp;
+uniform float gradientScaleBias;
+uniform float shadowFuzzyWidth;
+uniform vec4 lightColour;
+
+uniform sampler2D shadowMap;
+uniform sampler2D normalMap;
+
+varying vec3 tangentLightDir;
+
+
+// Expand a range-compressed vector
+vec3 expand(vec3 v)
+{
+	return (v - 0.5) * 2.0;
+}
+
+void main()
+{
+
+	// get the new normal and diffuse values
+	vec3 normal = normalize(expand(texture2D(normalMap, gl_TexCoord[1].xy).xyz));
+	
+	vec4 vertexColour = clamp(dot(normal, tangentLightDir),0.0,1.0) * lightColour;
+
+
+	vec4 shadowUV = gl_TexCoord[0];
+	// point on shadowmap
+#if LINEAR_RANGE
+	shadowUV.xy = shadowUV.xy / shadowUV.w;
+#else
+	shadowUV = shadowUV / shadowUV.w;
+#endif
+	float centerdepth = texture2D(shadowMap, shadowUV.xy).x;
+    
+    // gradient calculation
+  	float pixeloffset = inverseShadowmapSize;
+    vec4 depths = vec4(
+    	texture2D(shadowMap, shadowUV.xy + vec2(-pixeloffset, 0)).x,
+    	texture2D(shadowMap, shadowUV.xy + vec2(+pixeloffset, 0)).x,
+    	texture2D(shadowMap, shadowUV.xy + vec2(0, -pixeloffset)).x,
+    	texture2D(shadowMap, shadowUV.xy + vec2(0, +pixeloffset)).x);
+
+	vec2 differences = abs( depths.yw - depths.xz );
+	float gradient = min(gradientClamp, max(differences.x, differences.y));
+	float gradientFactor = gradient * gradientScaleBias;
+
+	// visibility function
+	float depthAdjust = gradientFactor + (fixedDepthBias * centerdepth);
+	float finalCenterDepth = centerdepth + depthAdjust;
+
+	// shadowUV.z contains lightspace position of current object
+
+#if FUZZY_TEST
+	// fuzzy test - introduces some ghosting in result and doesn't appear to be needed?
+	//float visibility = saturate(1 + delta_z / (gradient * shadowFuzzyWidth));
+	float visibility = saturate(1 + (finalCenterDepth - shadowUV.z) * shadowFuzzyWidth * shadowUV.w);
+
+	gl_FragColor = vertexColour * visibility;
+#else
+	// hard test
+#if PCF
+	// use depths from prev, calculate diff
+	depths += depthAdjust;
+	float final = (finalCenterDepth > shadowUV.z) ? 1.0 : 0.0;
+	final += (depths.x > shadowUV.z) ? 1.0 : 0.0;
+	final += (depths.y > shadowUV.z) ? 1.0 : 0.0;
+	final += (depths.z > shadowUV.z) ? 1.0 : 0.0;
+	final += (depths.w > shadowUV.z) ? 1.0 : 0.0;
+	
+	final *= 0.2;
+
+	gl_FragColor = vec4(vertexColour.xyz * final, 1);
+	
+#else
+	gl_FragColor = (finalCenterDepth > shadowUV.z) ? vertexColour : vec4(0,0,0,1);
+#endif
+
+#endif
+   
+}
+
Index: /Samples/Media/materials/programs/DepthShadowmapNormalMapReceiverVp.glsl
===================================================================
--- /Samples/Media/materials/programs/DepthShadowmapNormalMapReceiverVp.glsl	(revision 5)
+++ /Samples/Media/materials/programs/DepthShadowmapNormalMapReceiverVp.glsl	(revision 5)
@@ -0,0 +1,42 @@
+attribute vec3 tangent;
+
+uniform mat4 world;
+uniform mat4 worldViewProj;
+uniform mat4 texViewProj;
+uniform vec4 lightPosition; // object space
+uniform vec4 shadowDepthRange;
+
+varying vec3 tangentLightDir;
+
+
+void main()
+{
+	gl_Position = ftransform();
+	
+	vec4 worldPos = world * gl_Vertex;
+
+	// Get object space light direction 
+    vec3 lightDir = normalize(lightPosition.xyz -  (gl_Vertex.xyz * lightPosition.w));
+
+	// calculate shadow map coords
+	gl_TexCoord[0] = texViewProj * worldPos;
+#if LINEAR_RANGE
+	// adjust by fixed depth bias, rescale into range
+	gl_TexCoord[0].z = (gl_TexCoord[0].z - shadowDepthRange.x) * shadowDepthRange.w;
+#endif
+
+	// pass the main uvs straight through unchanged 
+	gl_TexCoord[1] = gl_MultiTexCoord0;
+
+	// Calculate the binormal (NB we assume both normal and tangent are 
+	// already normalised) 
+	vec3 binormal = cross(gl_Normal, tangent); 
+
+	// Form a rotation matrix out of the vectors 
+	mat3 rotation = mat3(tangent, binormal, gl_Normal); 
+    
+	// Transform the light vector according to this matrix 
+	tangentLightDir = normalize(rotation * lightDir); 
+
+}
+
Index: /Samples/Media/materials/programs/DepthShadowmapReceiverFp.glsl
===================================================================
--- /Samples/Media/materials/programs/DepthShadowmapReceiverFp.glsl	(revision 5)
+++ /Samples/Media/materials/programs/DepthShadowmapReceiverFp.glsl	(revision 5)
@@ -0,0 +1,66 @@
+uniform float inverseShadowmapSize;
+uniform float fixedDepthBias;
+uniform float gradientClamp;
+uniform float gradientScaleBias;
+uniform float shadowFuzzyWidth;
+
+uniform sampler2D shadowMap;
+
+void main()
+{
+	vec4 shadowUV = gl_TexCoord[0];
+	// point on shadowmap
+#if LINEAR_RANGE
+	shadowUV.xy = shadowUV.xy / shadowUV.w;
+#else
+	shadowUV = shadowUV / shadowUV.w;
+#endif
+	float centerdepth = texture2D(shadowMap, shadowUV.xy).x;
+    
+    // gradient calculation
+  	float pixeloffset = inverseShadowmapSize;
+    vec4 depths = vec4(
+    	texture2D(shadowMap, shadowUV.xy + vec2(-pixeloffset, 0)).x,
+    	texture2D(shadowMap, shadowUV.xy + vec2(+pixeloffset, 0)).x,
+    	texture2D(shadowMap, shadowUV.xy + vec2(0, -pixeloffset)).x,
+    	texture2D(shadowMap, shadowUV.xy + vec2(0, +pixeloffset)).x);
+
+	vec2 differences = abs( depths.yw - depths.xz );
+	float gradient = min(gradientClamp, max(differences.x, differences.y));
+	float gradientFactor = gradient * gradientScaleBias;
+
+	// visibility function
+	float depthAdjust = gradientFactor + (fixedDepthBias * centerdepth);
+	float finalCenterDepth = centerdepth + depthAdjust;
+
+	// shadowUV.z contains lightspace position of current object
+
+#if FUZZY_TEST
+	// fuzzy test - introduces some ghosting in result and doesn't appear to be needed?
+	//float visibility = saturate(1 + delta_z / (gradient * shadowFuzzyWidth));
+	float visibility = saturate(1 + (finalCenterDepth - shadowUV.z) * shadowFuzzyWidth * shadowUV.w);
+
+	gl_FragColor = vertexColour * visibility;
+#else
+	// hard test
+#if PCF
+	// use depths from prev, calculate diff
+	depths += depthAdjust;
+	float final = (finalCenterDepth > shadowUV.z) ? 1.0 : 0.0;
+	final += (depths.x > shadowUV.z) ? 1.0 : 0.0;
+	final += (depths.y > shadowUV.z) ? 1.0 : 0.0;
+	final += (depths.z > shadowUV.z) ? 1.0 : 0.0;
+	final += (depths.w > shadowUV.z) ? 1.0 : 0.0;
+	
+	final *= 0.2;
+
+	gl_FragColor = vec4(gl_Color.xyz * final, 1);
+	
+#else
+	gl_FragColor = (finalCenterDepth > shadowUV.z) ? gl_Color : vec4(0,0,0,1);
+#endif
+
+#endif
+   
+}
+
Index: /Samples/Media/materials/programs/DepthShadowmapReceiverVp.glsl
===================================================================
--- /Samples/Media/materials/programs/DepthShadowmapReceiverVp.glsl	(revision 5)
+++ /Samples/Media/materials/programs/DepthShadowmapReceiverVp.glsl	(revision 5)
@@ -0,0 +1,32 @@
+uniform mat4 world;
+uniform mat4 worldIT;
+uniform mat4 worldViewProj;
+uniform mat4 texViewProj;
+uniform vec4 lightPosition;
+uniform vec4 lightColour;
+uniform vec4 shadowDepthRange;
+
+
+void main()
+{
+	gl_Position = ftransform();
+	
+	vec4 worldPos = world * gl_Vertex;
+
+	vec3 worldNorm = (worldIT * vec4(gl_Normal, 1)).xyz;
+
+	// calculate lighting (simple vertex lighting)
+	vec3 lightDir = normalize(
+		lightPosition.xyz -  (worldPos.xyz * lightPosition.w));
+
+	gl_FrontColor = lightColour * max(dot(lightDir, worldNorm), 0.0);
+
+	// calculate shadow map coords
+	gl_TexCoord[0] = texViewProj * worldPos;
+#if LINEAR_RANGE
+	// adjust by fixed depth bias, rescale into range
+	gl_TexCoord[0].z = (gl_TexCoord[0].z - shadowDepthRange.x) * shadowDepthRange.w;
+#endif
+
+}
+
Index: /Samples/Media/materials/programs/Example_Basic.cg
===================================================================
--- /Samples/Media/materials/programs/Example_Basic.cg	(revision 5)
+++ /Samples/Media/materials/programs/Example_Basic.cg	(revision 5)
@@ -0,0 +1,272 @@
+/*
+  Basic ambient lighting vertex program
+*/
+void ambientOneTexture_vp(float4 position : POSITION,
+						  float2 uv		  : TEXCOORD0,
+						  
+						  out float4 oPosition : POSITION,
+						  out float2 oUv	   : TEXCOORD0,
+						  out float4 colour    : COLOR,
+
+						  uniform float4x4 worldViewProj,
+						  uniform float4 ambient)
+{
+	oPosition = mul(worldViewProj, position);
+	oUv = uv;
+	colour = ambient;
+}
+
+/*
+  Single-weight-per-vertex hardware skinning, 2 lights
+  The trouble with vertex programs is they're not general purpose, but
+  fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningOneWeight_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float  blendIdx : BLENDINDICES,
+	
+
+	out float4 oPosition : POSITION,
+	out float2 oUv       : TEXCOORD0,
+	out float4 colour           : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   lightPos[2],
+	uniform float4   lightDiffuseColour[2],
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0);
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	// transform normal
+	float3 norm = mul((float3x3)worldMatrix3x4Array[blendIdx], normal);
+	// Lighting - support point and directional
+	float3 lightDir0 = 	normalize(
+		lightPos[0].xyz -  (blendPos.xyz * lightPos[0].w));
+	float3 lightDir1 = 	normalize(
+		lightPos[1].xyz -  (blendPos.xyz * lightPos[1].w));
+
+	oUv = uv;
+	colour = ambient + 
+		(saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) + 
+		(saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+	
+}	
+
+/*
+  Single-weight-per-vertex hardware skinning, shadow-caster pass
+*/
+void hardwareSkinningOneWeightCaster_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float  blendIdx : BLENDINDICES,
+	
+
+	out float4 oPosition : POSITION,
+	out float4 colour    : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0);
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	
+	colour = ambient;
+	
+}	
+
+/*
+  Two-weight-per-vertex hardware skinning, 2 lights
+  The trouble with vertex programs is they're not general purpose, but
+  fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningTwoWeights_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float4 blendIdx : BLENDINDICES,
+	float4 blendWgt : BLENDWEIGHT,
+	
+
+	out float4 oPosition : POSITION,
+	out float2 oUv       : TEXCOORD0,
+	out float4 colour           : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   lightPos[2],
+	uniform float4   lightDiffuseColour[2],
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(0,0,0,0);
+	int i;
+	for (i = 0; i < 2; ++i)
+	{
+		blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+	}
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	// transform normal
+	float3 norm = float3(0,0,0);
+	for (i = 0; i < 2; ++i)
+	{
+		norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) * 
+		blendWgt[i];
+	}
+	norm = normalize(norm);
+	// Lighting - support point and directional
+	float3 lightDir0 = 	normalize(
+		lightPos[0].xyz -  (blendPos.xyz * lightPos[0].w));
+	float3 lightDir1 = 	normalize(
+		lightPos[1].xyz -  (blendPos.xyz * lightPos[1].w));
+
+	
+	oUv = uv;
+	colour = float4(0.5, 0.5, 0.5, 1) + 
+		(saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) + 
+		(saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+	
+}
+
+/*
+  Two-weight-per-vertex hardware skinning, shadow caster pass
+*/
+void hardwareSkinningTwoWeightsCaster_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float4 blendIdx : BLENDINDICES,
+	float4 blendWgt : BLENDWEIGHT,
+	
+
+	out float4 oPosition : POSITION,
+	out float4 colour           : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(0,0,0,0);
+	int i;
+	for (i = 0; i < 2; ++i)
+	{
+		blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+	}
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	
+
+	colour = ambient;
+		
+	
+}
+
+
+/*
+  Four-weight-per-vertex hardware skinning, 2 lights
+  The trouble with vertex programs is they're not general purpose, but
+  fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningFourWeights_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float4 blendIdx : BLENDINDICES,
+	float4 blendWgt : BLENDWEIGHT,
+	
+
+	out float4 oPosition : POSITION,
+	out float2 oUv       : TEXCOORD0,
+	out float4 colour           : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   lightPos[2],
+	uniform float4   lightDiffuseColour[2],
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(0,0,0,0);
+	int i;
+	for (i = 0; i < 4; ++i)
+	{
+		blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+	}
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	// transform normal
+	float3 norm = float3(0,0,0);
+	for (i = 0; i < 4; ++i)
+	{
+		norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) * 
+		blendWgt[i];
+	}
+	norm = normalize(norm);
+	// Lighting - support point and directional
+	float3 lightDir0 = 	normalize(
+		lightPos[0].xyz -  (blendPos.xyz * lightPos[0].w));
+	float3 lightDir1 = 	normalize(
+		lightPos[1].xyz -  (blendPos.xyz * lightPos[1].w));
+
+	
+	oUv = uv;
+	colour = ambient + 
+		(saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) + 
+		(saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+	
+}
+
+void hardwareMorphAnimation(float3 pos1 : POSITION,
+			  float4 normal		: NORMAL,
+			  float2 uv		  : TEXCOORD0,
+			  float3 pos2	  : TEXCOORD1,
+						  
+			  out float4 oPosition : POSITION,
+			  out float2 oUv	   : TEXCOORD0,
+			  out float4 colour    : COLOR,
+
+			  uniform float4x4 worldViewProj, 
+			  uniform float4 anim_t)
+{
+	// interpolate
+	float4 interp = float4(pos1 + anim_t.x*(pos2 - pos1), 1.0f);
+	
+	oPosition = mul(worldViewProj, interp);
+	oUv = uv;
+	colour = float4(1,0,0,1);
+}
+
+void hardwarePoseAnimation(float3 pos : POSITION,
+			  float4 normal		: NORMAL,
+			  float2 uv		  : TEXCOORD0,
+			  float3 pose1	  : TEXCOORD1,
+			  float3 pose2	  : TEXCOORD2,
+						  
+			  out float4 oPosition : POSITION,
+			  out float2 oUv	   : TEXCOORD0,
+			  out float4 colour    : COLOR,
+
+			  uniform float4x4 worldViewProj, 
+			  uniform float4 anim_t)
+{
+	// interpolate
+	float4 interp = float4(pos + anim_t.x*pose1 + anim_t.y*pose2, 1.0f);
+	
+	oPosition = mul(worldViewProj, interp);
+	oUv = uv;
+	colour = float4(1,0,0,1);
+}
Index: /Samples/Media/materials/programs/Example_Basic.hlsl
===================================================================
--- /Samples/Media/materials/programs/Example_Basic.hlsl	(revision 5)
+++ /Samples/Media/materials/programs/Example_Basic.hlsl	(revision 5)
@@ -0,0 +1,273 @@
+/*
+  Basic ambient lighting vertex program
+*/
+void ambientOneTexture_vp(float4 position : POSITION,
+						  float2 uv		  : TEXCOORD0,
+						  
+						  out float4 oPosition : POSITION,
+						  out float2 oUv	   : TEXCOORD0,
+						  out float4 colour    : COLOR,
+
+						  uniform float4x4 worldViewProj,
+						  uniform float4 ambient)
+{
+	oPosition = mul(worldViewProj, position);
+	oUv = uv;
+	colour = ambient;
+}
+
+/*
+  Single-weight-per-vertex hardware skinning, 2 lights
+  The trouble with vertex programs is they're not general purpose, but
+  fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningOneWeight_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float  blendIdx : BLENDINDICES,
+	
+
+	out float4 oPosition : POSITION,
+	out float2 oUv       : TEXCOORD0,
+	out float4 colour           : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   lightPos[2],
+	uniform float4   lightDiffuseColour[2],
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0);
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	// transform normal
+	float3 norm = mul((float3x3)worldMatrix3x4Array[blendIdx], normal);
+	// Lighting - support point and directional
+	float3 lightDir0 = 	normalize(
+		lightPos[0].xyz -  (blendPos.xyz * lightPos[0].w));
+	float3 lightDir1 = 	normalize(
+		lightPos[1].xyz -  (blendPos.xyz * lightPos[1].w));
+
+	oUv = uv;
+	colour = ambient + 
+		(saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) + 
+		(saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+	
+}	
+
+/*
+  Single-weight-per-vertex hardware skinning, shadow-caster pass
+*/
+void hardwareSkinningOneWeightCaster_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float  blendIdx : BLENDINDICES,
+	
+
+	out float4 oPosition : POSITION,
+	out float4 colour    : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0);
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	
+	colour = ambient;
+	
+}	
+
+/*
+  Two-weight-per-vertex hardware skinning, 2 lights
+  The trouble with vertex programs is they're not general purpose, but
+  fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningTwoWeights_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float4 blendIdx : BLENDINDICES,
+	float4 blendWgt : BLENDWEIGHT,
+	
+
+	out float4 oPosition : POSITION,
+	out float2 oUv       : TEXCOORD0,
+	out float4 colour           : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   lightPos[2],
+	uniform float4   lightDiffuseColour[2],
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(0,0,0,0);
+	int i;
+	for (i = 0; i < 2; ++i)
+	{
+		blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+	}
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	// transform normal
+	float3 norm = float3(0,0,0);
+	for (i = 0; i < 2; ++i)
+	{
+		norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) * 
+		blendWgt[i];
+	}
+	norm = normalize(norm);
+	// Lighting - support point and directional
+	float3 lightDir0 = 	normalize(
+		lightPos[0].xyz -  (blendPos.xyz * lightPos[0].w));
+	float3 lightDir1 = 	normalize(
+		lightPos[1].xyz -  (blendPos.xyz * lightPos[1].w));
+
+	
+	oUv = uv;
+	colour = ambient + 
+		(saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) + 
+		(saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+	
+}
+
+/*
+  Two-weight-per-vertex hardware skinning, shadow caster pass
+*/
+void hardwareSkinningTwoWeightsCaster_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float4 blendIdx : BLENDINDICES,
+	float4 blendWgt : BLENDWEIGHT,
+	
+
+	out float4 oPosition : POSITION,
+	out float4 colour           : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(0,0,0,0);
+	int i;
+	for (i = 0; i < 2; ++i)
+	{
+		blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+	}
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	
+
+	colour = ambient;
+		
+	
+}
+
+
+/*
+  Four-weight-per-vertex hardware skinning, 2 lights
+  The trouble with vertex programs is they're not general purpose, but
+  fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningFourWeights_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float4 blendIdx : BLENDINDICES,
+	float4 blendWgt : BLENDWEIGHT,
+	
+
+	out float4 oPosition : POSITION,
+	out float2 oUv       : TEXCOORD0,
+	out float4 colour           : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   lightPos[2],
+	uniform float4   lightDiffuseColour[2],
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(0,0,0,0);
+	int i;
+	for (i = 0; i < 4; ++i)
+	{
+		blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+	}
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	// transform normal
+	float3 norm = float3(0,0,0);
+	for (i = 0; i < 4; ++i)
+	{
+		norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) * 
+		blendWgt[i];
+	}
+	norm = normalize(norm);
+	// Lighting - support point and directional
+	float3 lightDir0 = 	normalize(
+		lightPos[0].xyz -  (blendPos.xyz * lightPos[0].w));
+	float3 lightDir1 = 	normalize(
+		lightPos[1].xyz -  (blendPos.xyz * lightPos[1].w));
+
+	
+	oUv = uv;
+	colour = ambient + 
+		(saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) + 
+		(saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+	
+}
+
+void hardwareMorphAnimation(float3 pos1 : POSITION,
+			  float4 normal		: NORMAL,
+			  float2 uv		  : TEXCOORD0,
+			  float3 pos2	  : TEXCOORD1,
+						  
+			  out float4 oPosition : POSITION,
+			  out float2 oUv	   : TEXCOORD0,
+			  out float4 colour    : COLOR,
+
+			  uniform float4x4 worldViewProj, 
+			  uniform float4 anim_t)
+{
+	// interpolate
+	float4 interp = float4(pos1 + anim_t.x*(pos2 - pos1), 1.0f);
+	
+	oPosition = mul(worldViewProj, interp);
+	oUv = uv;
+	colour = float4(1,0,0,1);
+}
+
+void hardwarePoseAnimation(float3 pos : POSITION,
+			  float4 normal		: NORMAL,
+			  float2 uv		  : TEXCOORD0,
+			  float3 pose1	  : TEXCOORD1,
+			  float3 pose2	  : TEXCOORD2,
+						  
+			  out float4 oPosition : POSITION,
+			  out float2 oUv	   : TEXCOORD0,
+			  out float4 colour    : COLOR,
+
+			  uniform float4x4 worldViewProj, 
+			  uniform float4 anim_t)
+{
+	// interpolate
+	float4 interp = float4(pos + anim_t.x*pose1 + anim_t.y*pose2, 1.0f);
+	
+	oPosition = mul(worldViewProj, interp);
+	oUv = uv;
+	colour = float4(1,0,0,1);
+}
+
Index: /Samples/Media/materials/programs/Example_BumpMapping.cg
===================================================================
--- /Samples/Media/materials/programs/Example_BumpMapping.cg	(revision 5)
+++ /Samples/Media/materials/programs/Example_BumpMapping.cg	(revision 5)
@@ -0,0 +1,236 @@
+// General functions
+
+// Expand a range-compressed vector
+float3 expand(float3 v)
+{
+	return (v - 0.5) * 2;
+}
+
+
+/* Bump mapping vertex program
+   In this program, we want to calculate the tangent space light vector
+   on a per-vertex level which will get passed to the fragment program,
+   or to the fixed function dot3 operation, to produce the per-pixel
+   lighting effect. 
+*/
+void main_vp(float4 position	: POSITION,
+			 float3 normal		: NORMAL,
+			 float2 uv			: TEXCOORD0,
+			 float3 tangent     : TANGENT0,
+			 // outputs
+			 out float4 oPosition    : POSITION,
+			 out float2 oUv			 : TEXCOORD0,
+			 out float3 oTSLightDir	 : TEXCOORD1,
+			 // parameters
+			 uniform float4 lightPosition, // object space
+			 uniform float4x4 worldViewProj)
+{
+	// calculate output position
+	oPosition = mul(worldViewProj, position);
+
+	// pass the main uvs straight through unchanged
+	oUv = uv;
+
+	// calculate tangent space light vector
+	// Get object space light direction
+	// Non-normalised since we'll do that in the fragment program anyway
+	float3 lightDir = lightPosition.xyz -  (position * lightPosition.w);
+
+	// Calculate the binormal (NB we assume both normal and tangent are
+	// already normalised)
+	// NB looks like nvidia cross params are BACKWARDS to what you'd expect
+	// this equates to NxT, not TxN
+	float3 binormal = cross(tangent, normal);
+	
+	// Form a rotation matrix out of the vectors
+	float3x3 rotation = float3x3(tangent, binormal, normal);
+	
+	// Transform the light vector according to this matrix
+	oTSLightDir = mul(rotation, lightDir);
+	
+	
+}
+
+/* Bump mapping vertex program for shadow receiving
+   In this program, we want to calculate the tangent space light vector
+   on a per-vertex level which will get passed to the fragment program,
+   or to the fixed function dot3 operation, to produce the per-pixel
+   lighting effect. 
+*/
+void main_shadowreceiver_vp(float4 position	: POSITION,
+			 float3 normal		: NORMAL,
+			 float2 uv			: TEXCOORD0,
+			 float3 tangent     : TANGENT0,
+			 
+			 // outputs
+			 out float4 oPosition    : POSITION,
+			 out float4 uvproj		 : TEXCOORD0,
+			 out float2 oUv	 		 : TEXCOORD1,
+			 out float3 oTSLightDir  : TEXCOORD2,
+			 
+			 // parameters
+			 uniform float4 lightPosition, // object space
+			 uniform float4x4 worldViewProj,
+			 uniform float4x4 worldMatrix,
+			 uniform float4x4 texViewProj)
+{
+	// calculate output position
+	oPosition = mul(worldViewProj, position);
+
+	// pass the main uvs straight through unchanged
+	oUv = uv;
+
+	// calculate tangent space light vector
+	// Get object space light direction
+	// Non-normalised since we'll do that in the fragment program anyway
+	float3 lightDir = lightPosition.xyz -  (position * lightPosition.w);
+
+	// Calculate the binormal (NB we assume both normal and tangent are
+	// already normalised)
+	// NB looks like nvidia cross params are BACKWARDS to what you'd expect
+	// this equates to NxT, not TxN
+	float3 binormal = cross(tangent, normal);
+	
+	// Form a rotation matrix out of the vectors
+	float3x3 rotation = float3x3(tangent, binormal, normal);
+	
+	// Transform the light vector according to this matrix
+	oTSLightDir = mul(rotation, lightDir);
+
+	// Projection
+    uvproj = mul(worldMatrix, position);
+	uvproj = mul(texViewProj, uvproj);
+	
+}
+
+
+void main_fp( float2 uv			: TEXCOORD0,
+			  float3 TSlightDir : TEXCOORD1,
+
+			  out float4 colour	: COLOR,
+
+			  uniform float4 lightDiffuse,
+			  uniform sampler2D   normalMap : register(s0),
+			  uniform samplerCUBE normalCubeMap : register(s1) )
+{
+	// retrieve normalised light vector, expand from range-compressed
+	float3 lightVec = expand(texCUBE(normalCubeMap, TSlightDir).xyz);
+
+	// get bump map vector, again expand from range-compressed
+	float3 bumpVec = expand(tex2D(normalMap, uv).xyz);
+
+	// Calculate dot product
+	colour = lightDiffuse * dot(bumpVec, lightVec);
+	
+}
+
+void main_shadowreceiver_fp(
+			  float4 uvproj		: TEXCOORD0,
+			  float2 uv			: TEXCOORD1,
+			  float3 TSlightDir : TEXCOORD2,
+
+			  out float4 colour	: COLOR,
+
+			  uniform float4 lightDiffuse,
+			  uniform sampler2D   shadowMap : register(s0),
+			  uniform sampler2D   normalMap : register(s1),
+			  uniform samplerCUBE normalCubeMap : register(s2))
+{
+
+
+	// retrieve normalised light vector, expand from range-compressed
+	float3 lightVec = expand(texCUBE(normalCubeMap, TSlightDir).xyz);
+
+	// get bump map vector, again expand from range-compressed
+	float3 bumpVec = expand(tex2D(normalMap, uv).xyz);
+
+	// get shadow value
+	float3 shadow = tex2Dproj(shadowMap, uvproj).xyz;
+
+	// Calculate dot product
+	colour = float4(shadow * lightDiffuse * dot(bumpVec, lightVec), 1.0f);
+	
+}
+
+/* Vertex program which includes specular component */
+void specular_vp(float4 position	: POSITION,
+			 	 float3 normal		: NORMAL,
+			 	 float2 uv			: TEXCOORD0,
+			 	 float3 tangent     : TANGENT0,
+			 	 // outputs
+			 	 out float4 oPosition    : POSITION,
+			 	 out float2 oUv			 : TEXCOORD0,
+			 	 out float3 oTSLightDir	 : TEXCOORD1,
+				 out float3 oTSHalfAngle : TEXCOORD2,
+			 	 // parameters
+				 uniform float4 lightPosition, // object space
+			 	 uniform float3 eyePosition,   // object space
+			 	 uniform float4x4 worldViewProj)
+{
+	// calculate output position
+	oPosition = mul(worldViewProj, position);
+
+	// pass the main uvs straight through unchanged
+	oUv = uv;
+
+	// calculate tangent space light vector
+	// Get object space light direction
+	float3 lightDir = normalize(lightPosition.xyz -  (position * lightPosition.w));
+
+	// Calculate the binormal (NB we assume both normal and tangent are
+	// already normalised)
+	// NB looks like nvidia cross params are BACKWARDS to what you'd expect
+	// this equates to NxT, not TxN
+	float3 binormal = cross(tangent, normal);
+	
+	// Form a rotation matrix out of the vectors
+	float3x3 rotation = float3x3(tangent, binormal, normal);
+	
+	// Transform the light vector according to this matrix
+	oTSLightDir = mul(rotation, lightDir);
+
+	// Calculate half-angle in tangent space
+	float3 eyeDir = normalize(eyePosition - position.xyz);
+	float3 halfAngle = normalize(eyeDir + lightDir);
+	oTSHalfAngle = mul(rotation, halfAngle);
+	
+	
+}
+
+/* Fragment program which supports specular component */
+void specular_fp( float2 uv			: TEXCOORD0,
+			  float3 TSlightDir : TEXCOORD1,
+			  float3 TShalfAngle: TEXCOORD2,
+
+			  out float4 colour	: COLOR,
+
+			  uniform float4 lightDiffuse,
+			  uniform float4 lightSpecular,
+			  uniform sampler2D   normalMap : register(s0),
+			  uniform samplerCUBE normalCubeMap : register(s1), 
+			  uniform samplerCUBE normalCubeMap2 : register(s2)) // we need this second binding to be compatible with ps_1_1, ps_2_0 could reuse the other
+{
+	// retrieve normalised light vector, expand from range-compressed
+	float3 lightVec = expand(texCUBE(normalCubeMap, TSlightDir).xyz);
+
+	// retrieve half angle and normalise through cube map
+	float3 halfAngle = expand(texCUBE(normalCubeMap2, TShalfAngle).xyz);
+
+	// get bump map vector, again expand from range-compressed
+	float3 bumpVec = expand(tex2D(normalMap, uv).xyz);
+
+	// Pre-raise the specular exponent to the eight power
+	// Note we have no 'pow' function in basic fragment programs, if we were willing to accept compatibility
+	// with ps_2_0 / arbfp1 and above, we could have a variable shininess parameter
+	// This is equivalent to 
+	float specFactor = dot(bumpVec, halfAngle);
+	for (int i = 0; i < 3; ++i)
+		specFactor *= specFactor;
+	
+
+	// Calculate dot product for diffuse
+	colour = (lightDiffuse * saturate(dot(bumpVec, lightVec))) + 
+			(lightSpecular * specFactor);
+	
+}
+			 
Index: /Samples/Media/materials/programs/Example_CelShading.cg
===================================================================
--- /Samples/Media/materials/programs/Example_CelShading.cg	(revision 5)
+++ /Samples/Media/materials/programs/Example_CelShading.cg	(revision 5)
@@ -0,0 +1,63 @@
+
+/* Cel shading vertex program for single-pass rendering
+   In this program, we want to calculate the diffuse and specular
+   ramp components, and the edge factor (for doing simple outlining)
+   For the outlining to look good, we need a pretty well curved model.
+*/
+void main_vp(float4 position	: POSITION,
+			 float3 normal		: NORMAL,
+			 // outputs
+			 out float4 oPosition : POSITION,
+			 out float  diffuse		 : TEXCOORD0,
+			 out float  specular	 : TEXCOORD1,
+			 out float  edge		 : TEXCOORD2,
+			 // parameters
+			 uniform float3 lightPosition, // object space
+			 uniform float3 eyePosition,   // object space
+			 uniform float4  shininess,
+			 uniform float4x4 worldViewProj)
+{
+	// calculate output position
+	oPosition = mul(worldViewProj, position);
+
+	// calculate light vector
+	float3 N = normalize(normal);
+	float3 L = normalize(lightPosition - position.xyz);
+	
+	// Calculate diffuse component
+	diffuse = max(dot(N, L) , 0);
+
+	// Calculate specular component
+	float3 E = normalize(eyePosition - position.xyz);
+	float3 H = normalize(L + E);
+	specular = pow(max(dot(N, H), 0), shininess);
+	// Mask off specular if diffuse is 0
+	if (diffuse == 0) specular = 0;
+
+	// Edge detection, dot eye and normal vectors
+	edge = max(dot(N, E), 0);
+}
+
+void main_fp(float diffuseIn 	: TEXCOORD0,
+			 float specularIn	: TEXCOORD1,
+			 float edge		: TEXCOORD2,
+			 
+			 out float4 colour	: COLOR,
+			 
+			 uniform float4 diffuse,
+			 uniform float4 specular,
+			 
+			 uniform sampler1D diffuseRamp,
+			 uniform sampler1D specularRamp,
+			 uniform sampler1D edgeRamp)
+{
+	// Step functions from textures
+	diffuseIn = tex1D(diffuseRamp, diffuseIn).x;
+	specularIn = tex1D(specularRamp, specularIn).x;
+	edge = tex1D(edgeRamp, edge).x;
+
+	colour = edge * ((diffuse * diffuseIn) + 
+					(specular * specularIn));
+}
+			 
+			 
Index: /Samples/Media/materials/programs/Example_Fresnel.cg
===================================================================
--- /Samples/Media/materials/programs/Example_Fresnel.cg	(revision 5)
+++ /Samples/Media/materials/programs/Example_Fresnel.cg	(revision 5)
@@ -0,0 +1,115 @@
+// Vertex program for fresnel reflections / refractions
+void main_vp(
+		float4 pos			: POSITION,
+		float4 normal		: NORMAL,
+		float2 tex			: TEXCOORD0,
+		
+		out float4 oPos		: POSITION,
+		out float3 noiseCoord : TEXCOORD0,
+		out float4 projectionCoord : TEXCOORD1,
+		out float3 oEyeDir : TEXCOORD2, 
+		out float3 oNormal : TEXCOORD3, 
+
+		uniform float4x4 worldViewProjMatrix,
+		uniform float3 eyePosition, // object space
+		uniform float timeVal,
+		uniform float scale,  // the amount to scale the noise texture by
+		uniform float scroll, // the amount by which to scroll the noise
+		uniform float noise  // the noise perturb as a factor of the  time
+		)
+{
+	oPos = mul(worldViewProjMatrix, pos);
+	// Projective texture coordinates, adjust for mapping
+	float4x4 scalemat = float4x4(0.5,   0,   0, 0.5, 
+	                               0,-0.5,   0, 0.5,
+								   0,   0, 0.5, 0.5,
+								   0,   0,   0,   1);
+	projectionCoord = mul(scalemat, oPos);
+	// Noise map coords
+	noiseCoord.xy = (tex + (timeVal * scroll)) * scale;
+	noiseCoord.z = noise * timeVal;
+
+	oEyeDir = normalize(pos.xyz - eyePosition); 
+	oNormal = normal.rgb; 
+	
+}
+
+// Fragment program for distorting a texture using a 3D noise texture
+void main_fp(
+		float3 noiseCoord			: TEXCOORD0,
+		float4 projectionCoord		: TEXCOORD1,
+		float3 eyeDir				: TEXCOORD2,
+		float3 normal				: TEXCOORD3,
+		
+		out float4 col		: COLOR,
+		
+		uniform float4 tintColour,
+		uniform float noiseScale, 
+		uniform float fresnelBias,
+		uniform float fresnelScale,
+		uniform float fresnelPower,
+		uniform sampler2D noiseMap : register(s0),
+		uniform sampler2D reflectMap : register(s1),
+		uniform sampler2D refractMap : register(s2)
+		)
+{
+	// Do the tex projection manually so we can distort _after_
+	float2 final = projectionCoord.xy / projectionCoord.w;
+
+	// Noise
+	float3 noiseNormal = (tex2D(noiseMap, (noiseCoord.xy / 5)).rgb - 0.5).rbg * noiseScale;
+	final += noiseNormal.xz;
+
+	// Fresnel
+	//normal = normalize(normal + noiseNormal.xz);
+	float fresnel = fresnelBias + fresnelScale * pow(1 + dot(eyeDir, normal), fresnelPower);
+
+	// Reflection / refraction
+	float4 reflectionColour = tex2D(reflectMap, final);
+	float4 refractionColour = tex2D(refractMap, final) + tintColour;
+
+	// Final colour
+	col = lerp(refractionColour, reflectionColour, fresnel);
+
+
+}
+
+
+// Old version to match ATI PS 1.3 implementation
+void main_vp_old(
+		float4 pos			: POSITION,
+		float4 normal		: NORMAL,
+		float2 tex			: TEXCOORD0,
+		
+		out float4 oPos		: POSITION,
+		out float fresnel   : COLOR,
+		out float3 noiseCoord : TEXCOORD0,
+		out float4 projectionCoord : TEXCOORD1,
+
+		uniform float4x4 worldViewProjMatrix,
+		uniform float3 eyePosition, // object space
+		uniform float fresnelBias,
+		uniform float fresnelScale,
+		uniform float fresnelPower,
+		uniform float timeVal,
+		uniform float scale,  // the amount to scale the noise texture by
+		uniform float scroll, // the amount by which to scroll the noise
+		uniform float noise  // the noise perturb as a factor of the  time
+		)
+{
+	oPos = mul(worldViewProjMatrix, pos);
+	// Projective texture coordinates, adjust for mapping
+	float4x4 scalemat = float4x4(0.5,   0,   0, 0.5, 
+	                               0,-0.5,   0, 0.5,
+								   0,   0, 0.5, 0.5,
+								   0,   0,   0,   1);
+	projectionCoord = mul(scalemat, oPos);
+	// Noise map coords
+	noiseCoord.xy = (tex + (timeVal * scroll)) * scale;
+	noiseCoord.z = noise * timeVal;
+
+	// calc fresnel factor (reflection coefficient)
+	float3 eyeDir = normalize(pos.xyz - eyePosition);
+	fresnel = fresnelBias + fresnelScale * pow(1 + dot(eyeDir, normal), fresnelPower);
+	
+}
Index: /Samples/Media/materials/programs/Example_FresnelPS.asm
===================================================================
--- /Samples/Media/materials/programs/Example_FresnelPS.asm	(revision 5)
+++ /Samples/Media/materials/programs/Example_FresnelPS.asm	(revision 5)
@@ -0,0 +1,72 @@
+ps.1.4
+  // conversion from Cg generated ARB_fragment_program to ps.1.4 by NFZ
+  // command line args: -profile arbfp1 -entry main_fp
+  // program main_fp
+  // c0 : distortionRange
+  // c1 : tintColour
+  // testure 0 : noiseMap
+  // texture 1 : reflectMap
+  // texture 2 : refractMap
+  // v0.x : fresnel 
+  // t0.xyz : noiseCoord
+  // t1.xyw : projectionCoord 
+
+def c2, 2, 1, 0, 0
+
+  // Cg:	distort.x = tex3D(noiseMap, noiseCoord).x;
+  // arbfp1:	TEX R0.x, fragment.texcoord[0], texture[0], 3D;
+  // sample noise map using noiseCoord in TEX unit 0 
+
+texld r0, t0.xyz
+
+  // get projected texture coordinates from TEX coord 1
+  // will be used in phase 2
+
+texcrd r1.xy, t1_dw.xyw
+mov r1.z, c2.y
+
+  // Cg:	distort.y = tex3D(noiseMap, noiseCoord + yoffset).x;
+  // arbfp1:	ADD R1.xyz, fragment.texcoord[0], c1;
+  // arbfp1:	TEX R1.x, R1, texture[0], 3D;
+  // arbfp1:	MOV R0.y, R1.x;
+
+  // Cg:	distort = (distort * 2 - 1) * distortionRange;
+  // arbfp1:	MAD R0.xy, R0, c0.x, -c0.y;
+  // arbfp1:	MUL R0.xy, R0, u0.x;
+  // (distort * 2 - 1) same as 2*(distort -.5) so use _bx2
+
+
+  // Cg:	final = projectionCoord.xy / projectionCoord.w;
+  // Cg:	final += distort;
+  // arbfp1:	RCP R0.w, fragment.texcoord[1].w;
+  // arbfp1:	MAD R0.xy, fragment.texcoord[1], R0.w, R0;
+  // 	final = (distort *  projectionCoord.w) + projectionCoord.xy
+  // for ps.1.4 have to re-arrange things a bit to perturb projected texture coordinates
+
+mad r0.xyz, r0_bx2, c0.x, r1
+
+phase
+
+  // do dependant texture reads
+  // Cg:	reflectionColour = tex2D(reflectMap, final);
+  // arbfp1:	TEX R0, R0, texture[1], 2D;
+  // sampe reflectMap using dependant read : texunit 1 
+
+texld r1, r0.xyz
+
+  // Cg:	refractionColour = tex2D(refractMap, final) + tintColour;
+  // arbfp1:	TEX R1, R0, texture[2], 2D;
+  // sample refractMap : texunit 2 
+
+texld r2, r0.xyz
+
+  // adding tintColour that is in global c1
+  // arbfp1:	ADD R1, R1, u1;
+
+add r2, r2, c1
+
+  // Cg:	col = lerp(refractionColour, reflectionColour, fresnel);
+  // arbfp1:	ADD R0, R0, -R1;
+  // arbfp1:	MAD result.color, fragment.color.primary.x, R0, R1;
+
+lrp r0, v0.x, r1, r2
Index: /Samples/Media/materials/programs/Example_Projection.cg
===================================================================
--- /Samples/Media/materials/programs/Example_Projection.cg	(revision 5)
+++ /Samples/Media/materials/programs/Example_Projection.cg	(revision 5)
@@ -0,0 +1,28 @@
+
+void generalPurposeProjection_vp(
+		float4 pos			: POSITION,
+		
+		out float4 oPos		: POSITION,
+		out float4 texCoord : TEXCOORD0,
+
+		uniform float4x4 worldViewProjMatrix,
+		uniform float4x4 worldMatrix,
+		uniform float4x4 texViewProjMatrix)
+{
+	oPos = mul(worldViewProjMatrix, pos);
+	// multiply position by world matrix, then by projective view/proj
+	float4 newpos = mul(worldMatrix, pos);
+	texCoord = mul(texViewProjMatrix, newpos);
+	
+}
+
+void generalPurposeProjection_fp(
+		float4 texCoord		: TEXCOORD0,
+		out float4 col		: COLOR,
+		uniform sampler2D texMap)
+{
+	col = tex2Dproj(texMap, texCoord);
+
+}
+		
+
Index: /Samples/Media/materials/programs/GlassFP.cg
===================================================================
--- /Samples/Media/materials/programs/GlassFP.cg	(revision 5)
+++ /Samples/Media/materials/programs/GlassFP.cg	(revision 5)
@@ -0,0 +1,9 @@
+sampler RT : register(s0);
+sampler NormalMap : register(s1);
+
+float4 main_ps(float2 iTexCoord : TEXCOORD0) : COLOR
+{
+	float4 normal = 2 * (tex2D(NormalMap, iTexCoord * 2.5) - 0.5);
+
+	return tex2D(RT, iTexCoord + normal.xy * 0.05);
+}
Index: /Samples/Media/materials/programs/Grass.cg
===================================================================
--- /Samples/Media/materials/programs/Grass.cg	(revision 5)
+++ /Samples/Media/materials/programs/Grass.cg	(revision 5)
@@ -0,0 +1,31 @@
+// Vertex program to wave some grass about
+// Simplistic, assumes base of the grass at 0
+void grass_vp(float4 position : POSITION,
+			  float3 normal   : NORMAL,
+			  float2 uv		  : TEXCOORD0,
+			  out float4 oPosition : POSITION,
+			  out float2 oUv	   : TEXCOORD0,
+			  out float4 colour    : COLOR,
+
+			  uniform float4x4 worldViewProj,
+			  uniform float4 ambient,
+			  uniform float4 objSpaceLight,
+			  uniform float4 lightColour,
+			  uniform float4 offset)
+{
+	float4 mypos = position;
+	//offset = float4(0.5, 0, 0, 0);
+	float4 factor = float4(1,1,1,1) - uv.yyyy;
+	mypos = mypos + offset * factor;
+	oPosition = mul(worldViewProj, mypos);
+
+	oUv = uv;
+	// get vertex light direction (support directional and point)
+	float3 light = normalize(
+		objSpaceLight.xyz -  (position.xyz * objSpaceLight.w));
+	float diffuseFactor = max(dot(normal, light), 0);
+	
+	
+	colour = ambient + diffuseFactor * lightColour;
+}
+
Index: /Samples/Media/materials/programs/GrayScale.cg
===================================================================
--- /Samples/Media/materials/programs/GrayScale.cg	(revision 5)
+++ /Samples/Media/materials/programs/GrayScale.cg	(revision 5)
@@ -0,0 +1,18 @@
+sampler RT : register(s0);
+
+float4 GrayScale_ps(float2 iTexCoord : TEXCOORD0) : COLOR
+{
+    float3 greyscale = dot(tex2D(RT, iTexCoord).rgb, float3(0.3, 0.59, 0.11));
+	return float4(greyscale, 1.0);
+}
+
+float4 Embossed_ps(float2 iTexCoord : TEXCOORD0) : COLOR
+{
+    float4 Color;
+    Color.a = 1.0f;
+    Color.rgb = 0.5f;
+    Color -= tex2D( RT, iTexCoord - 0.001)*2.0f;
+    Color += tex2D( RT, iTexCoord + 0.001)*2.0f;
+    Color.rgb = (Color.r+Color.g+Color.b)/3.0f;
+    return Color;
+}
Index: /Samples/Media/materials/programs/HeatVision.cg
===================================================================
--- /Samples/Media/materials/programs/HeatVision.cg	(revision 5)
+++ /Samples/Media/materials/programs/HeatVision.cg	(revision 5)
@@ -0,0 +1,230 @@
+//////////////////////////////////////////////
+//				 CASTER PASS				//
+//				    HEAT					//
+//////////////////////////////////////////////
+
+// vs_1_1
+void HeatCaster_vp(
+              // in
+              float4 vPos: POSITION,
+              float4 vNormal: NORMAL,
+              
+              // out
+              out float4 oPos: POSITION,
+              out float2 oNDotV: TEXCOORD0,
+              
+              // parameters
+              uniform float4x4 worldViewProj,
+              uniform float3 eyePosition        // object space
+            )
+{
+   float4 eyeDir = float4(eyePosition - vPos.xyz, 0);
+   eyeDir = normalize(eyeDir);
+   oPos   = mul( worldViewProj, vPos );
+   oNDotV = clamp( dot( vNormal, eyeDir ), 0, 1 );
+}
+
+// ps_2_0
+float4 HeatCaster_fp(
+                        // input from vp
+                        float2 iNDotV: TEXCOORD0
+                     ) : COLOR0
+{
+   return iNDotV.x;
+}
+
+
+//////////////////////////////////////////////
+//				 CASTER PASS				//
+//				    COLD					//
+//////////////////////////////////////////////
+
+// vs_1_1
+void ColdCaster_vp(
+              // in
+              float4 vPos: POSITION,
+              float4 vNormal: NORMAL,
+              
+              // out
+              out float4 oPos: POSITION,
+              out float2 oNDotV: TEXCOORD0,
+              
+              // parameters
+              uniform float4x4 worldViewProj,
+              uniform float3 eyePosition        // object space
+            )
+{
+   float4 eyeDir = float4(eyePosition - vPos.xyz, 0);
+   eyeDir = normalize(eyeDir);
+   oPos   = mul( worldViewProj, vPos );
+   oNDotV = clamp( dot( vNormal, eyeDir ), 0, 1 );
+}
+
+// ps_2_0
+float4 ColdCaster_fp(
+                        // input from vp
+                        float2 iNDotV: TEXCOORD0
+                     ) : COLOR0
+{
+   return iNDotV.x / 2;
+}
+
+
+//////////////////////////////////////////////
+//	   PASS 1 - Light to heat conversion	//
+//////////////////////////////////////////////
+
+// vs_1_1
+void LightToHeat_vp(
+                    // in
+                    float4 inPos: POSITION,
+                    
+                    uniform float flipping,
+
+                    // out
+                    out float4 Pos: POSITION,
+                    out float2 uv0: TEXCOORD0
+                   )
+{
+    Pos = float4(inPos.x, flipping * inPos.y, 0.0f, 1.0f);
+    inPos.xy = sign(inPos.xy);
+    uv0  = (float2(inPos.x, -inPos.y) + 1.0f)/2.0f;
+}
+
+
+// ps_2_0
+void LightToHeat_fp(
+                        // input from vp
+                        float4 inDiffuse: COLOR0,
+                        float2 inUV0: TEXCOORD0,
+                        
+                        // out
+                        out float4 outColor: COLOR0,
+                        
+                        // params
+                        uniform float4 random_fractions,
+                        uniform float4 heatBiasScale,
+                        uniform float4 depth_modulator,
+
+                        uniform sampler2D Input,         // output of HeatVisionCaster_fp (NdotV)
+                        uniform sampler2D NoiseMap,
+                        uniform sampler2D HeatLookup
+                     )
+{
+   float  depth, heat, interference;
+
+   //  Output constant color:
+   depth = tex2D( Input, inUV0 );
+   depth *= (depth * depth_modulator);
+
+   heat  = (depth * heatBiasScale.y);
+
+//   if (depth > 0)
+   {
+		interference = -0.5 + tex2D( NoiseMap, inUV0 + float2( random_fractions.x, random_fractions.y ) );
+		interference *= interference;
+		interference *= 1 - heat;
+		heat += interference;//+ heatBiasScale.x;
+   }
+
+/*
+	heatBias isn't used for now
+   if (heat > 0)
+       heat += heatBiasScale.x;
+*/
+
+   // Clamp UVs
+   heat  = max( 0.005, min( 0.995, heat ) );
+   outColor = tex2D( HeatLookup, float2( heat, 0.f ) );
+}
+
+
+//////////////////////////////////////////////
+// PASS 2 - add simple blur (final pass)	//
+//////////////////////////////////////////////
+
+// vs_1_1
+void Blur_vp(
+                    // in
+                    float4 inPos: POSITION,
+                    
+                    uniform float flipping,
+
+                    // out
+                    out float4 Pos: POSITION,
+                    out float2 uv0: TEXCOORD0
+                   )
+{
+    Pos = float4(inPos.x, flipping * inPos.y, 0.0f, 1.0f);
+    inPos.xy = sign(inPos.xy);
+    uv0  = (float2(inPos.x, -inPos.y) + 1.0f)/2.0f;
+}
+
+// ps_2_0
+void Blur_fp(
+                    // input from vp
+                    float4 inDiffuse: COLOR0,
+                    float2 inUV0: TEXCOORD0,
+                    
+                    // out
+                    out float4 outColor: COLOR0,
+                    
+                    // parameters
+                    uniform sampler2D Input,             // output of HeatVision_fp1 (HeatRenderTexture)
+                    uniform float4 blurAmount
+                    )
+{
+   int i;
+   float4 tmpOutColor;
+   float  diffuseGlowFactor;
+   const float2 offsets[4] = 
+   {
+/*
+		// hazy blur
+		-1.8, -1.8,
+		-1.8, 1.8,
+		1.8, -1.8,
+		1.8, 1.8
+*/
+/*
+		// less-hazy blur
+	  -1.0,  2.0,
+	  -1.0, -1.0,
+	   1.0, -1.0,
+	   1.0,  1.0
+*/
+/*
+      -0.326212, -0.405805,
+      -0.840144, -0.073580,
+      -0.695914,  0.457137,
+      -0.203345,  0.620716
+*/
+
+	  -0.3,  0.4,
+	  -0.3, -0.4,
+	   0.3, -0.4,
+	   0.3,  0.4
+
+   };
+
+   tmpOutColor = tex2D( Input, inUV0 );	// UV coords are in image space
+
+   // calculate glow amount
+   diffuseGlowFactor = 0.0113f * (2.0 - max( tmpOutColor.r, tmpOutColor.g ));
+
+   // basic blur filter
+   for (i = 0; i < 4; i++) {
+      tmpOutColor += tex2D( Input, inUV0 + blurAmount.x * diffuseGlowFactor * offsets[i] );
+   }
+
+   tmpOutColor *= 0.25;
+
+   // TIPS (old-skool strikes again!)
+   // Pay attention here! If you use the "out float4 outColor" directly
+   // in your steps while creating the output color (like you remove
+   // the "tmpOutColor" var and just use the "outColor" directly)
+   // your pixel-color output IS CHANGING EACH TIME YOU DO AN ASSIGNMENT TOO!
+   // A temporary variable, instead, acts like a per-pixel double buffer, and
+   // best of all, lead to better performance.
+   outColor = tmpOutColor;
+}
Index: /Samples/Media/materials/programs/InvertFP.cg
===================================================================
--- /Samples/Media/materials/programs/InvertFP.cg	(revision 5)
+++ /Samples/Media/materials/programs/InvertFP.cg	(revision 5)
@@ -0,0 +1,6 @@
+sampler RT : register(s0);
+
+float4 Invert_ps (float2 iTexCoord : TEXCOORD0) : COLOR
+{
+	return 1 - tex2D(RT, iTexCoord);
+}
Index: /Samples/Media/materials/programs/LaplaceFP.cg
===================================================================
--- /Samples/Media/materials/programs/LaplaceFP.cg	(revision 5)
+++ /Samples/Media/materials/programs/LaplaceFP.cg	(revision 5)
@@ -0,0 +1,36 @@
+sampler Image : register(s0);
+
+// The Laplace filter approximates the second order derivate,
+// that is, the rate of change of slope in the image. It can be
+// used for edge detection. The Laplace filter gives negative
+// response on the higher side of the edge and positive response
+// on the lower side.
+
+// This is the filter kernel:
+// 0  1  0
+// 1 -4  1
+// 0  1  0
+
+
+
+float4 Laplace_ps (float2 texCoord: TEXCOORD0,
+			uniform float scale,
+			uniform float pixelSize) : COLOR
+{
+
+    float2 samples[4] = {
+        0, -1,
+       -1,  0,
+        1,  0,
+        0,  1
+    };
+   float4 laplace = -4 * tex2D(Image, texCoord);
+
+   // Sample the neighbor pixels
+   for (int i = 0; i < 4; i++){
+      laplace += tex2D(Image, texCoord + pixelSize * samples[i]);
+   }
+
+   return (0.5 + scale * laplace);
+}
+
Index: /Samples/Media/materials/programs/Ocean2GLSL.frag
===================================================================
--- /Samples/Media/materials/programs/Ocean2GLSL.frag	(revision 5)
+++ /Samples/Media/materials/programs/Ocean2GLSL.frag	(revision 5)
@@ -0,0 +1,71 @@
+/*********************************************************************NVMH3****
+Copyright NVIDIA Corporation 2003
+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
+*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS
+BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
+WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
+BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
+ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
+Comments:
+	Simple ocean shader with animated bump map and geometric waves
+	Based partly on "Effective Water Simulation From Physical Models", GPU Gems
+
+11 Aug 05: converted from HLSL to GLSL by Jeff Doyle (nfz) to work in Ogre
+
+******************************************************************************/
+
+
+uniform sampler2D NormalMap;
+uniform samplerCube EnvironmentMap;
+uniform vec4 deepColor;
+uniform vec4 shallowColor;
+uniform vec4 reflectionColor;
+uniform float reflectionAmount;
+uniform float reflectionBlur;
+uniform float waterAmount;
+uniform float fresnelPower;
+uniform float fresnelBias;
+uniform float hdrMultiplier;
+
+varying mat3 rotMatrix; // first row of the 3x3 transform from tangent to cube space
+varying vec2 bumpCoord0;
+varying vec2 bumpCoord1;
+varying vec2 bumpCoord2;
+varying vec3 eyeVector;
+
+
+void main(void)
+{
+	// sum normal maps
+	// sample from 3 different points so no texture repetition is noticeable
+    vec4 t0 = texture2D(NormalMap, bumpCoord0) * 2.0 - 1.0;
+    vec4 t1 = texture2D(NormalMap, bumpCoord1) * 2.0 - 1.0;
+    vec4 t2 = texture2D(NormalMap, bumpCoord2) * 2.0 - 1.0;
+    vec3 N = t0.xyz + t1.xyz + t2.xyz;
+
+    N = normalize(rotMatrix * N);
+
+	// reflection
+    vec3 E = normalize(eyeVector);
+    vec3 R = reflect(E, N);
+    // Ogre conversion for cube map lookup
+    R.z = -R.z;
+
+    vec4 reflection = textureCube(EnvironmentMap, R, reflectionBlur);
+    // cheap hdr effect
+    reflection.rgb *= (reflection.r + reflection.g + reflection.b) * hdrMultiplier;
+
+	// fresnel
+    float facing = 1.0 - dot(-E, N);
+    float fresnel = clamp(fresnelBias + pow(facing, fresnelPower), 0.0, 1.0);
+
+    vec4 waterColor = mix(shallowColor, deepColor, facing) * waterAmount;
+
+    reflection = mix(waterColor,  reflection * reflectionColor, fresnel) * reflectionAmount;
+    gl_FragColor = waterColor + reflection;
+}
Index: /Samples/Media/materials/programs/Ocean2GLSL.vert
===================================================================
--- /Samples/Media/materials/programs/Ocean2GLSL.vert	(revision 5)
+++ /Samples/Media/materials/programs/Ocean2GLSL.vert	(revision 5)
@@ -0,0 +1,91 @@
+/*********************************************************************NVMH3****
+Copyright NVIDIA Corporation 2003
+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
+*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS
+BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
+WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
+BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
+ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
+Comments:
+	Simple ocean shader with animated bump map and geometric waves
+	Based partly on "Effective Water Simulation From Physical Models", GPU Gems
+
+11 Aug 05: converted from HLSL to GLSL by Jeff Doyle (nfz) to work in Ogre
+
+******************************************************************************/
+
+uniform vec3 eyePosition;
+uniform float BumpScale;
+uniform vec2 textureScale;
+uniform vec2 bumpSpeed;
+uniform float time;
+uniform float waveFreq;
+uniform float waveAmp;
+
+varying mat3 rotMatrix; //  transform from tangent to obj space
+varying vec2 bumpCoord0;
+varying vec2 bumpCoord1;
+varying vec2 bumpCoord2;
+varying vec3 eyeVector;
+
+// wave functions
+struct Wave {
+  float freq;  // 2*PI / wavelength
+  float amp;   // amplitude
+  float phase; // speed * 2*PI / wavelength
+  vec2 dir;
+};
+
+
+void main(void)
+{
+
+	#define NWAVES 2
+
+	Wave wave[NWAVES];
+
+	wave[0] = Wave( waveFreq, waveAmp, 0.5, vec2(-1, 0) );
+	wave[1] = Wave( 3.0 * waveFreq, 0.33 * waveAmp, 1.7, vec2(-0.7, 0.7) );
+
+
+    vec4 P = gl_Vertex;
+
+	// sum waves
+	float ddx = 0.0, ddy = 0.0;
+	float deriv;
+	float angle;
+
+	// wave synthesis using two sine waves at different frequencies and phase shift
+	for(int i = 0; i<NWAVES; ++i)
+	{
+		angle = dot(wave[i].dir, P.xz) * wave[i].freq + time * wave[i].phase;
+		P.y += wave[i].amp * sin( angle );
+		// calculate derivate of wave function
+		deriv = wave[i].freq * wave[i].amp * cos(angle);
+		ddx -= deriv * wave[i].dir.x;
+		ddy -= deriv * wave[i].dir.y;
+	}
+
+	// compute the 3x3 tranform from tangent space to object space
+	// compute tangent basis
+    vec3 T = normalize(vec3(1.0, ddy, 0.0)) * BumpScale;
+    vec3 B = normalize(vec3(0.0, ddx, 1.0)) * BumpScale;
+    vec3 N = normalize(vec3(ddx, 1.0, ddy));
+
+	rotMatrix = mat3(T, B, N);
+
+	gl_Position = gl_ModelViewProjectionMatrix * P;
+
+	// calculate texture coordinates for normal map lookup
+	bumpCoord0.xy = gl_MultiTexCoord0.xy * textureScale + time * bumpSpeed;
+	bumpCoord1.xy = gl_MultiTexCoord0.xy * textureScale * 2.0 + time * bumpSpeed * 4.0;
+	bumpCoord2.xy = gl_MultiTexCoord0.xy * textureScale * 4.0 + time * bumpSpeed * 8.0;
+
+
+	eyeVector = P.xyz - eyePosition; // eye position in vertex space
+}
Index: /Samples/Media/materials/programs/Ocean2HLSL_Cg.frag
===================================================================
--- /Samples/Media/materials/programs/Ocean2HLSL_Cg.frag	(revision 5)
+++ /Samples/Media/materials/programs/Ocean2HLSL_Cg.frag	(revision 5)
@@ -0,0 +1,85 @@
+/*********************************************************************NVMH3****
+Copyright NVIDIA Corporation 2003
+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
+*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS
+BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
+WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
+BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
+ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
+Comments:
+	Simple ocean shader with animated bump map and geometric waves
+	Based partly on "Effective Water Simulation From Physical Models", GPU Gems
+
+11 Aug 05: heavily modified by Jeff Doyle (nfz) for Ogre
+
+******************************************************************************/
+
+
+
+struct v2f {
+	float4 Position  : POSITION;  // in clip space
+	float3 rotMatrix1 : TEXCOORD0; // first row of the 3x3 transform from tangent to obj space
+	float3 rotMatrix2 : TEXCOORD1; // second row of the 3x3 transform from tangent to obj space
+	float3 rotMatrix3 : TEXCOORD2; // third row of the 3x3 transform from tangent to obj space
+
+	float2 bumpCoord0 : TEXCOORD3;
+	float2 bumpCoord1 : TEXCOORD4;
+	float2 bumpCoord2 : TEXCOORD5;
+
+	float3 eyeVector  : TEXCOORD6;
+};
+
+
+float4 main(v2f IN,
+			uniform sampler2D NormalMap,
+			uniform samplerCUBE EnvironmentMap,
+			uniform float4 deepColor,
+			uniform float4 shallowColor,
+			uniform float4 reflectionColor,
+			uniform float reflectionAmount,
+			uniform float reflectionBlur,
+			uniform float waterAmount,
+			uniform float fresnelPower,
+			uniform float fresnelBias,
+			uniform float hdrMultiplier
+			) : COLOR
+{
+	// sum normal maps
+	// sample from 3 different points so no texture repetition is noticeable
+    float4 t0 = tex2D(NormalMap, IN.bumpCoord0) * 2.0 - 1.0;
+    float4 t1 = tex2D(NormalMap, IN.bumpCoord1) * 2.0 - 1.0;
+    float4 t2 = tex2D(NormalMap, IN.bumpCoord2) * 2.0 - 1.0;
+    float3 N = t0.xyz + t1.xyz + t2.xyz;
+
+    float3x3 m; // tangent to world matrix
+    m[0] = IN.rotMatrix1;
+    m[1] = IN.rotMatrix2;
+    m[2] = IN.rotMatrix3;
+
+    N = normalize( mul( N, m ) );
+
+	// reflection
+    float3 E = normalize(IN.eyeVector);
+    float4 R;
+    R.xyz = reflect(E, N);
+    // Ogre conversion for cube map lookup
+    R.z = -R.z;
+    R.w = reflectionBlur;
+    float4 reflection = texCUBEbias(EnvironmentMap, R);
+    // cheap hdr effect
+    reflection.rgb *= (reflection.r + reflection.g + reflection.b) * hdrMultiplier;
+
+	// fresnel
+    float facing = 1.0 - max(dot(-E, N), 0);
+    float fresnel = saturate(fresnelBias + pow(facing, fresnelPower));
+
+    float4 waterColor = lerp(shallowColor, deepColor, facing) * waterAmount;
+
+    reflection = lerp(waterColor,  reflection * reflectionColor, fresnel) * reflectionAmount;
+    return waterColor + reflection;
+}
Index: /Samples/Media/materials/programs/Ocean2HLSL_Cg.vert
===================================================================
--- /Samples/Media/materials/programs/Ocean2HLSL_Cg.vert	(revision 5)
+++ /Samples/Media/materials/programs/Ocean2HLSL_Cg.vert	(revision 5)
@@ -0,0 +1,108 @@
+/*********************************************************************NVMH3****
+Copyright NVIDIA Corporation 2003
+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
+*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS
+BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
+WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
+BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
+ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
+Comments:
+	Simple ocean shader with animated bump map and geometric waves
+	Based partly on "Effective Water Simulation From Physical Models", GPU Gems
+
+11 Aug 05: heavily modified by Jeff Doyle (nfz) for Ogre
+
+******************************************************************************/
+
+struct a2v {
+	float4 Position : POSITION;   // in object space
+	float2 TexCoord : TEXCOORD0;
+};
+
+struct v2f {
+	float4 Position  : POSITION;  // in clip space
+	float3 rotMatrix1 : TEXCOORD0; // first row of the 3x3 transform from tangent to obj space
+	float3 rotMatrix2 : TEXCOORD1; // second row of the 3x3 transform from tangent to obj space
+	float3 rotMatrix3 : TEXCOORD2; // third row of the 3x3 transform from tangent to obj space
+
+	float2 bumpCoord0 : TEXCOORD3;
+	float2 bumpCoord1 : TEXCOORD4;
+	float2 bumpCoord2 : TEXCOORD5;
+
+	float3 eyeVector  : TEXCOORD6;
+};
+
+// wave functions
+
+struct Wave {
+  float freq;  // 2*PI / wavelength
+  float amp;   // amplitude
+  float phase; // speed * 2*PI / wavelength
+  float2 dir;
+};
+
+v2f main(a2v IN,
+		uniform float4x4 WorldViewProj,
+		uniform float3 eyePosition,
+		uniform float BumpScale,
+		uniform float2 textureScale,
+		uniform float2 bumpSpeed,
+		uniform float time,
+		uniform float waveFreq,
+		uniform float waveAmp
+        )
+{
+	v2f OUT;
+
+	#define NWAVES 2
+	Wave wave[NWAVES] = {
+		{ 1.0, 1.0, 0.5, float2(-1, 0) },
+		{ 2.0, 0.5, 1.7, float2(-0.7, 0.7) }
+	};
+
+    wave[0].freq = waveFreq;
+    wave[0].amp = waveAmp;
+
+    wave[1].freq = waveFreq * 3.0;
+    wave[1].amp = waveAmp * 0.33;
+
+    float4 P = IN.Position;
+
+	// sum waves
+	float ddx = 0.0, ddy = 0.0;
+	float deriv;
+	float angle;
+
+	// wave synthesis using two sine waves at different frequencies and phase shift
+	for(int i = 0; i<NWAVES; ++i)
+	{
+		angle = dot(wave[i].dir, P.xz) * wave[i].freq + time * wave[i].phase;
+		P.y += wave[i].amp * sin( angle );
+		// calculate derivate of wave function
+		deriv = wave[i].freq * wave[i].amp * cos(angle);
+		ddx -= deriv * wave[i].dir.x;
+		ddy -= deriv * wave[i].dir.y;
+	}
+
+	// compute the 3x3 tranform from tangent space to object space
+	// first rows are the tangent and binormal scaled by the bump scale
+
+	OUT.rotMatrix1.xyz = BumpScale * normalize(float3(1, ddy, 0)); // Binormal
+	OUT.rotMatrix2.xyz = BumpScale * normalize(float3(0, ddx, 1)); // Tangent
+	OUT.rotMatrix3.xyz = normalize(float3(ddx, 1, ddy)); // Normal
+
+	OUT.Position = mul(WorldViewProj, P);
+
+	// calculate texture coordinates for normal map lookup
+	OUT.bumpCoord0.xy = IN.TexCoord*textureScale + time * bumpSpeed;
+	OUT.bumpCoord1.xy = IN.TexCoord*textureScale * 2.0 + time * bumpSpeed * 4.0;
+	OUT.bumpCoord2.xy = IN.TexCoord*textureScale * 4.0 + time * bumpSpeed * 8.0;
+
+	OUT.eyeVector = P.xyz - eyePosition; // eye position in vertex space
+	return OUT;
+}
Index: /Samples/Media/materials/programs/OffsetMapping.cg
===================================================================
--- /Samples/Media/materials/programs/OffsetMapping.cg	(revision 5)
+++ /Samples/Media/materials/programs/OffsetMapping.cg	(revision 5)
@@ -0,0 +1,97 @@
+/* Bump mapping with Parallax offset vertex program 
+   In this program, we want to calculate the tangent space light end eye vectors 
+   which will get passed to the fragment program to produce the per-pixel bump map 
+   with parallax offset effect. 
+*/ 
+
+/* Vertex program that moves light and eye vectors into texture tangent space at vertex */ 
+
+void main_vp(float4 position   : POSITION, 
+              float3 normal      : NORMAL, 
+              float2 uv         : TEXCOORD0, 
+              float3 tangent     : TANGENT0, 
+              // outputs 
+              out float4 oPosition    : POSITION, 
+              out float2 oUv          : TEXCOORD0, 
+              out float3 oLightDir    : TEXCOORD1, // tangent space 
+             out float3 oEyeDir       : TEXCOORD2, // tangent space 
+             out float3 oHalfAngle    : TEXCOORD3, // 
+              // parameters 
+              uniform float4 lightPosition, // object space 
+              uniform float3 eyePosition,   // object space 
+              uniform float4x4 worldViewProj) 
+{  
+   // calculate output position 
+   oPosition = mul(worldViewProj, position); 
+
+   // pass the main uvs straight through unchanged 
+   oUv = uv; 
+
+   // calculate tangent space light vector 
+   // Get object space light direction 
+   float3 lightDir = normalize(lightPosition.xyz -  (position * lightPosition.w));
+   float3 eyeDir = eyePosition - position.xyz; 
+    
+   // Calculate the binormal (NB we assume both normal and tangent are 
+   // already normalised) 
+   // NB looks like nvidia cross params are BACKWARDS to what you'd expect 
+   // this equates to NxT, not TxN 
+   float3 binormal = cross(tangent, normal); 
+    
+   // Form a rotation matrix out of the vectors 
+   float3x3 rotation = float3x3(tangent, binormal, normal); 
+    
+   // Transform the light vector according to this matrix 
+   lightDir = normalize(mul(rotation, lightDir)); 
+   eyeDir = normalize(mul(rotation, eyeDir)); 
+
+   oLightDir = lightDir; 
+   oEyeDir = eyeDir; 
+   oHalfAngle = normalize(eyeDir + lightDir); 
+}
+
+// General functions
+
+// Expand a range-compressed vector
+float3 expand(float3 v)
+{
+	return (v - 0.5) * 2;
+}
+
+void main_fp(float2 uv : TEXCOORD0,
+	float3 lightDir : TEXCOORD1,
+	float3 eyeDir : TEXCOORD2,
+	float3 halfAngle : TEXCOORD3,
+	uniform float3 lightDiffuse,
+	uniform float3 lightSpecular,
+	uniform float4 scaleBias,
+	uniform sampler2D normalHeightMap,
+	uniform sampler2D diffuseMap,
+	out float4 oColor : COLOR)
+{
+	// get the height using the tex coords
+	float height = tex2D(normalHeightMap, uv).a;
+
+	// scale and bias factors	
+	float scale = scaleBias.x;
+	float bias = scaleBias.y;
+
+	// calculate displacement	
+	float displacement = (height * scale) + bias;
+	
+	float3 uv2 = float3(uv, 1);
+	
+	// calculate the new tex coord to use for normal and diffuse
+	float2 newTexCoord = ((eyeDir * displacement) + uv2).xy;
+	
+	// get the new normal and diffuse values
+	float3 normal = expand(tex2D(normalHeightMap, newTexCoord).xyz);
+	float3 diffuse = tex2D(diffuseMap, newTexCoord).xyz;
+	
+	float3 specular = pow(saturate(dot(normal, halfAngle)), 32) * lightSpecular;
+	float3 col = diffuse * saturate(dot(normal, lightDir)) * lightDiffuse + specular;
+		
+	oColor = float4(col, 1);
+}
+
+
Index: /Samples/Media/materials/programs/OffsetMapping.hlsl
===================================================================
--- /Samples/Media/materials/programs/OffsetMapping.hlsl	(revision 5)
+++ /Samples/Media/materials/programs/OffsetMapping.hlsl	(revision 5)
@@ -0,0 +1,135 @@
+/* Offset mapping including a shadow element and multiple lights in one pass */ 
+void integratedshadows_vp(float4 position   : POSITION, 
+              float3 normal      : NORMAL, 
+              float2 uv         : TEXCOORD0, 
+              float3 tangent     : TANGENT0, 
+              // outputs 
+              out float4 oPosition    : POSITION, 
+              out float2 oUv          : TEXCOORD0, 
+              out float3 oLightDir    : TEXCOORD1, // tangent space 
+             out float3 oEyeDir       : TEXCOORD2, // tangent space 
+			 out float3 oSpotDirection : TEXCOORD3, // tangent space
+              out float3 oLightDir1    : TEXCOORD4, // tangent space 
+              out float3 oSpotDirection1    : TEXCOORD5, // tangent space 
+			 out float4 oShadowUV1 : TEXCOORD6,
+			 out float4 oShadowUV2 : TEXCOORD7,
+              // parameters 
+              uniform float4 lightPosition, // object space 
+              uniform float4 lightPosition1, // object space 
+              uniform float3 eyePosition,   // object space 
+ 			  uniform float3 spotDirection, // object space
+ 			  uniform float3 spotDirection1, // object space
+              uniform float4x4 worldViewProj,
+			  uniform float4x4 worldMatrix,
+			  uniform float4x4 texViewProj1,
+			  uniform float4x4 texViewProj2) 
+{  
+   // calculate output position 
+   oPosition = mul(worldViewProj, position); 
+
+   float4 worldPos = mul(worldMatrix, position);
+   oShadowUV1 = mul(texViewProj1, worldPos);
+   oShadowUV2 = mul(texViewProj2, worldPos);
+   
+   
+
+   // pass the main uvs straight through unchanged 
+   oUv = uv; 
+
+   // calculate tangent space light vector 
+   // Get object space light direction 
+   float3 lightDir = normalize(lightPosition.xyz -  (position * lightPosition.w));
+   float3 lightDir1 = normalize(lightPosition1.xyz -  (position * lightPosition1.w));
+   float3 eyeDir = eyePosition - position.xyz; 
+    
+   // Calculate the binormal (NB we assume both normal and tangent are 
+   // already normalised) 
+   // NB looks like nvidia cross params are BACKWARDS to what you'd expect 
+   // this equates to NxT, not TxN 
+   float3 binormal = cross(tangent, normal); 
+    
+   // Form a rotation matrix out of the vectors 
+   float3x3 rotation = float3x3(tangent, binormal, normal); 
+    
+   // Transform the light vector according to this matrix 
+   lightDir = normalize(mul(rotation, lightDir)); 
+   lightDir1 = normalize(mul(rotation, lightDir1)); 
+   eyeDir = normalize(mul(rotation, eyeDir)); 
+
+   oLightDir = lightDir; 
+   oLightDir1 = lightDir1; 
+   oEyeDir = eyeDir; 
+   oSpotDirection = normalize(mul(rotation, -spotDirection));
+   oSpotDirection1 = normalize(mul(rotation, -spotDirection1));
+}
+
+// Expand a range-compressed vector
+float3 expand(float3 v)
+{
+	return (v - 0.5) * 2;
+}
+
+void integratedshadows_fp(
+	float2 uv : TEXCOORD0,
+	float3 lightDir : TEXCOORD1,
+	float3 eyeDir : TEXCOORD2,
+	float3 spotDir : TEXCOORD3,
+	float3 lightDir1 : TEXCOORD4,
+	float3 spotDir1 : TEXCOORD5,
+	float4 shadowUV1 : TEXCOORD6,
+	float4 shadowUV2 : TEXCOORD7,
+	uniform float3 lightDiffuse,
+	uniform float4 scaleBias,
+    uniform float4 spotParams,
+	uniform float3 lightDiffuse1,
+    uniform float4 spotParams1,
+	uniform sampler2D normalHeightMap : register(s0),
+	uniform sampler2D diffuseMap : register(s1),
+	uniform sampler2D shadowMap1 : register(s2),
+	uniform sampler2D shadowMap2 : register(s3),
+	out float4 oColour : COLOR)
+{
+	// get the height using the tex coords
+	float height = tex2D(normalHeightMap, uv).a;
+
+	// scale and bias factors	
+	float scale = scaleBias.x;
+	float bias = scaleBias.y;
+
+	// calculate displacement	
+	float displacement = (height * scale) + bias;
+	
+	float3 uv2 = float3(uv, 1);
+
+	float3 scaledEyeDir = eyeDir * displacement;
+	
+	// calculate the new tex coord to use for normal and diffuse
+	float2 newTexCoord = (scaledEyeDir + uv2).xy;
+	
+	// get the new normal and diffuse values
+	float3 normal = expand(tex2D(normalHeightMap, newTexCoord).xyz);
+	float3 diffuse = tex2D(diffuseMap, newTexCoord).xyz;
+	
+	float3 col1 = diffuse * saturate(dot(normal, lightDir)) * lightDiffuse;
+	// factor in spotlight angle
+	float rho = saturate(dot(spotDir, lightDir));
+	// factor = (rho - cos(outer/2) / cos(inner/2) - cos(outer/2)) ^ falloff
+	float spotFactor = pow(
+		saturate(rho - spotParams.y) / (spotParams.x - spotParams.y), spotParams.z);
+	col1 = col1 * spotFactor;
+	float3 col2 = diffuse * saturate(dot(normal, lightDir1)) * lightDiffuse1;
+	// factor in spotlight angle
+	rho = saturate(dot(spotDir1, lightDir1));
+	// factor = (rho - cos(outer/2) / cos(inner/2) - cos(outer/2)) ^ falloff
+	spotFactor = pow(
+		saturate(rho - spotParams1.y) / (spotParams1.x - spotParams1.y), spotParams1.z);
+	col2 = col2 * spotFactor;
+
+	// shadow textures
+	col1 = col1 * tex2Dproj(shadowMap1, shadowUV1);
+	col2 = col2 * tex2Dproj(shadowMap2, shadowUV2);
+
+	oColour = float4(col1 + col2, 1);
+
+}
+
Index: /Samples/Media/materials/programs/OffsetMappingFp.glsl
===================================================================
--- /Samples/Media/materials/programs/OffsetMappingFp.glsl	(revision 5)
+++ /Samples/Media/materials/programs/OffsetMappingFp.glsl	(revision 5)
@@ -0,0 +1,69 @@
+uniform vec4 lightDiffuse;
+uniform vec4 scaleBias;
+uniform vec4 spotParams;
+uniform vec4 lightDiffuse1;
+uniform vec4 spotParams1;
+
+uniform sampler2D normalHeightMap;
+uniform sampler2D diffuseMap;
+uniform sampler2D shadowMap1;
+uniform sampler2D shadowMap2;
+
+
+
+varying vec3 tangentEyeDir;
+varying vec3 tangentLightDir[2];
+varying vec3 tangentSpotDir[2];
+varying vec4 shadowUV[2];
+
+
+// Expand a range-compressed vector
+vec3 expand(vec3 v)
+{
+	return (v - 0.5) * 2.0;
+}
+
+
+void main()
+{
+	// get the height using the tex coords
+	float height = texture2D(normalHeightMap, gl_TexCoord[0].xy).a;
+	// scale and bias factors	
+	float scale = scaleBias.x;
+	float bias = scaleBias.y;
+
+	// calculate displacement	
+	float displacement = (height * scale) + bias;
+	//float displacement = (height * 0.04) - 0.02;
+	
+	vec3 scaledEyeDir = tangentEyeDir * displacement;
+	
+	// calculate the new tex coord to use for normal and diffuse
+	vec2 newTexCoord = (scaledEyeDir + gl_TexCoord[0].xyz).xy;
+	
+	// get the new normal and diffuse values
+	vec3 normal = expand(texture2D(normalHeightMap, newTexCoord).xyz);
+	vec4 diffuse = texture2D(diffuseMap, newTexCoord);
+	
+	vec4 col1 = diffuse * clamp(dot(normal, tangentLightDir[0]),0.0,1.0) * lightDiffuse;
+	// factor in spotlight angle
+	float rho = clamp(dot(tangentSpotDir[0], tangentLightDir[0]),0.0,1.0);
+	// factor = (rho - cos(outer/2) / cos(inner/2) - cos(outer/2)) ^ falloff
+	float spotFactor = pow(
+		clamp(rho - spotParams.y,0.0,1.0) / (spotParams.x - spotParams.y), spotParams.z);
+	col1 = col1 * spotFactor;
+	vec4 col2 = diffuse * clamp(dot(normal, tangentLightDir[1]),0.0,1.0) * lightDiffuse1;
+	// factor in spotlight angle
+	rho = clamp(dot(tangentSpotDir[1], tangentLightDir[1]),0.0,1.0);
+	// factor = (rho - cos(outer/2) / cos(inner/2) - cos(outer/2)) ^ falloff
+	spotFactor = pow(
+		clamp(rho - spotParams1.y,0.0,1.0) / (spotParams1.x - spotParams1.y), spotParams1.z);
+	col2 = col2 * spotFactor;
+
+	// shadow textures
+	col1 = col1 * texture2DProj(shadowMap1, shadowUV[0]);
+	col2 = col2 * texture2DProj(shadowMap2, shadowUV[1]);
+
+	gl_FragColor = col1 + col2;
+
+}
Index: /Samples/Media/materials/programs/OffsetMappingVp.glsl
===================================================================
--- /Samples/Media/materials/programs/OffsetMappingVp.glsl	(revision 5)
+++ /Samples/Media/materials/programs/OffsetMappingVp.glsl	(revision 5)
@@ -0,0 +1,54 @@
+attribute vec3 tangent;
+
+uniform vec4 lightPosition; // object space 
+uniform vec4 lightPosition1; // object space 
+uniform vec4 eyePosition;   // object space 
+uniform vec4 spotDirection; // object space
+uniform vec4 spotDirection1; // object space
+uniform mat4 worldViewProj; // not actually used but here for compat with HLSL
+uniform mat4 worldMatrix;
+uniform mat4 texViewProj1;
+uniform mat4 texViewProj2;
+
+
+varying vec3 tangentEyeDir;
+varying vec3 tangentLightDir[2];
+varying vec3 tangentSpotDir[2];
+varying vec4 shadowUV[2];
+
+void main()
+{
+	gl_Position = ftransform();
+
+	vec4 worldPos = worldMatrix * gl_Vertex;
+
+	shadowUV[0] = texViewProj1 * worldPos;
+	shadowUV[1] = texViewProj2 * worldPos;
+
+	// pass the main uvs straight through unchanged 
+	gl_TexCoord[0] = gl_MultiTexCoord0;
+
+	// calculate tangent space light vector 
+	// Get object space light direction 
+    vec3 lightDir = normalize(lightPosition.xyz -  (gl_Vertex.xyz * lightPosition.w));
+	vec3 lightDir1 = normalize(lightPosition1.xyz -  (gl_Vertex.xyz * lightPosition1.w));
+	
+	vec3 eyeDir = (eyePosition - gl_Vertex).xyz; 
+
+	// Calculate the binormal (NB we assume both normal and tangent are 
+	// already normalised) 
+	vec3 binormal = cross(gl_Normal, tangent); 
+
+	// Form a rotation matrix out of the vectors 
+	mat3 rotation = mat3(tangent, binormal, gl_Normal); 
+    
+	// Transform the light vector according to this matrix 
+	tangentLightDir[0] = normalize(rotation * lightDir); 
+	tangentLightDir[1] = normalize(rotation * lightDir1); 
+	// Invert the Y on the eye dir since we'll be using this to alter UVs and
+	// GL has Y inverted
+	tangentEyeDir = normalize(rotation * eyeDir) * vec3(1, -1, 1); 
+
+	tangentSpotDir[0] = normalize(rotation * -spotDirection.xyz);
+	tangentSpotDir[1] = normalize(rotation * -spotDirection1.xyz);	
+}
Index: /Samples/Media/materials/programs/OffsetMapping_specular.asm
===================================================================
--- /Samples/Media/materials/programs/OffsetMapping_specular.asm	(revision 5)
+++ /Samples/Media/materials/programs/OffsetMapping_specular.asm	(revision 5)
@@ -0,0 +1,44 @@
+// Pixel Shader for doing bump mapping with parallax plus diffuse and specular lighting by nfz 
+
+// uv               TEXCOORD0 
+// lightDir            TEXCOORD1 
+// eyeDir            TEXCOORD2 
+// half               TEXCOORD3 
+
+// lightDiffuse         c0 
+// lightSpecular      c1 
+// Parallax scale and bias c2 
+// normal/height map   texunit 0 - height map in alpha channel 
+// diffuse texture      texunit 1 
+
+ps.1.4 
+
+
+texld r0, t0               // get height 
+texcrd r2.xyz, t0            // get uv coordinates 
+texcrd r3.xyz, t2            // get eyedir vector 
+
+
+mad r0.xyz, r0.a, c2.x, c2.y   // displacement = height * scale + bias 
+mad r2.xyz, r3, r0, r2         // newtexcoord = eyedir * displacement + uv 
+
+phase 
+
+texld r0, r2.xyz            // get normal N using newtexcoord 
+texld r1, r2.xyz            // get diffuse texture using newtexcoord 
+texcrd r4.xyz, t1            // get lightdir vector 
+texcrd r5.xyz, t3            // get half angle vector 
+
+dp3_sat r5.rgb, r0_bx2, r5         // N dot H - spec calc 
+dp3_sat r4.rgb, r0_bx2, r4         // N dot L - diffuse calc 
++ mul r5.a, r5.r, r5.r 
+mul r0.rgb, r4, r1            // colour = diffusetex * N dot L 
++ mul r5.a, r5.a, r5.a 
+
+mul r5.rgb, r5.a, r5.a          
+mul r5.rgb, r5, r5          
+mul r5.rgb, r5, r5          
+mul r5.rgb, r5, c1            // specular = (N dot H)^32 * specularlight 
+
+mad r0.rgb, r0, c0, r5         // colour = diffusetex * (N dot L)* diffuselight + specular 
++ mov r0.a, c2.b 
Index: /Samples/Media/materials/programs/OldMovieFP.cg
===================================================================
--- /Samples/Media/materials/programs/OldMovieFP.cg	(revision 5)
+++ /Samples/Media/materials/programs/OldMovieFP.cg	(revision 5)
@@ -0,0 +1,54 @@
+sampler RT : register(s0);
+sampler SplotchesTx : register(s1);
+sampler Texture2 : register(s2);
+sampler SepiaTx : register(s3);
+
+float2 calcSpriteAddr(float2 texCoord, float DirtFrequency, float period)
+{
+   return texCoord + tex1D(Texture2, period  * DirtFrequency);
+}
+
+float4 getSplotches(float2 spriteAddr)
+{
+   // get sprite address into paged texture coords space
+   spriteAddr = spriteAddr / 6.3f;
+   //spriteAddr = spriteAddr - frac(spriteAddr);
+   spriteAddr = spriteAddr - (spriteAddr /33.3f);
+
+   return tex2D(SplotchesTx, spriteAddr);
+}
+
+float4 OldMovie_ps (float2 texCoord  : TEXCOORD0,
+				uniform float time_cycle_period,
+				uniform float flicker,
+				uniform float DirtFrequency,
+				uniform float3 luminance,
+				uniform float frameJitter,
+				uniform float lumiShift
+				) : COLOR
+{
+
+   // get sprite address
+   float2 spriteAddr = calcSpriteAddr(texCoord, DirtFrequency, time_cycle_period);
+
+    // add some dark and light splotches to the film
+   float4 splotches = getSplotches(spriteAddr);
+   float4 specs = 1.0f - getSplotches(spriteAddr / 3.0f);
+
+   // convert color to base luminance
+   float4 base = tex2D(RT, texCoord + float2(0, spriteAddr.y * frameJitter));
+   float lumi = dot(base.rgb, luminance);
+   // randomly shift luminance
+   lumi -= spriteAddr.x * lumiShift;
+   // tone map luminance
+   base.rgb = tex1D(SepiaTx, lumi );
+
+   // calc flicker speed
+   float darken = frac(flicker * time_cycle_period);
+
+   // we want darken to cycle between 0.6 and 1.0
+   darken = abs(darken - 0.5f) * 0.4f + 0.6f;
+   // composite dirt onto film
+   return base * splotches * darken + specs;
+}
+
Index: /Samples/Media/materials/programs/OldTV.cg
===================================================================
--- /Samples/Media/materials/programs/OldTV.cg	(revision 5)
+++ /Samples/Media/materials/programs/OldTV.cg	(revision 5)
@@ -0,0 +1,42 @@
+
+
+sampler Image: register(s0);
+sampler Rand: register(s1);
+sampler Noise: register(s2);
+
+float4 OldTV_ps(float2 pos: TEXCOORD1, float2 img: TEXCOORD0,
+    uniform float distortionFreq: register(c3),
+    uniform float distortionScale: register(c4),
+    uniform float distortionRoll: register(c5),
+    uniform float interference: register(c7),
+    uniform float frameLimit: register(c8),
+    uniform float frameShape: register(c0),
+    uniform float frameSharpness: register(c1),
+    uniform float time_0_X: register(c2),
+    uniform float sin_time_0_X: register(c6)
+
+) : COLOR {
+   // Define a frame shape
+   float f = (1 - pos.x * pos.x) * (1 - pos.y * pos.y);
+   float frame = saturate(frameSharpness * (pow(f, frameShape) - frameLimit));
+
+   // Interference ... just a texture filled with rand()
+   float rand = tex3D(Rand, float3(1.5 * pos, time_0_X)) - 0.2;
+
+   // Some signed noise for the distortion effect
+   float noisy = tex3D(Noise, float3(0, 0.5 * pos.y, 0.1 * time_0_X)) - 0.5;
+
+   // Repeat a 1 - x^2 (0 < x < 1) curve and roll it with sinus.
+   float dst = frac(pos.y * distortionFreq + distortionRoll * sin_time_0_X);
+   dst *= (1 - dst);
+   // Make sure distortion is highest in the center of the image
+   dst /= 1 + distortionScale * abs(pos.y);
+
+   // ... and finally distort
+   img.x += distortionScale * noisy * dst;
+   float4 image = tex2D(Image, img);
+
+   // Combine frame, distorted image and interference
+   return frame * (interference * rand + image);
+}
+
Index: /Samples/Media/materials/programs/PosterizeFP.cg
===================================================================
--- /Samples/Media/materials/programs/PosterizeFP.cg	(revision 5)
+++ /Samples/Media/materials/programs/PosterizeFP.cg	(revision 5)
@@ -0,0 +1,17 @@
+sampler RT : register(s0);
+
+float4 Posterize_ps (float2 iTexCoord : TEXCOORD0) : COLOR
+{
+
+	float nColors = 8;
+	float gamma = 0.6;
+
+	float4 texCol = tex2D(RT, iTexCoord);
+	float3 tc = texCol.xyz;
+	tc = pow(tc, gamma);
+	tc = tc * nColors;
+	tc = floor(tc);
+	tc = tc / nColors;
+	tc = pow(tc,1.0/gamma);
+	return float4(tc,texCol.w);
+}
Index: /Samples/Media/materials/programs/SharpenEdgesFP.cg
===================================================================
--- /Samples/Media/materials/programs/SharpenEdgesFP.cg	(revision 5)
+++ /Samples/Media/materials/programs/SharpenEdgesFP.cg	(revision 5)
@@ -0,0 +1,23 @@
+sampler RT: register(s0);
+
+float4 sharpenEdges_fp(float2 iTexCoord: TEXCOORD0, uniform float2 vTexelSize) : COLOR
+{
+
+	float2 usedTexelED[8] = {
+		-1, -1,
+		 0, -1,
+		 1, -1,
+		-1,  0,
+		 1,  0,
+		-1,  1,
+		 0,  1,
+	     1,  1,
+	};
+
+	float4 cAvgColor= 9 * tex2D (RT, iTexCoord);
+
+	for(int t=0; t<8; t++)
+		cAvgColor -= tex2D(RT, iTexCoord + vTexelSize * usedTexelED[t]);
+
+	return cAvgColor;
+}
Index: /Samples/Media/materials/programs/StdQuad_vp.cg
===================================================================
--- /Samples/Media/materials/programs/StdQuad_vp.cg	(revision 5)
+++ /Samples/Media/materials/programs/StdQuad_vp.cg	(revision 5)
@@ -0,0 +1,113 @@
+void StdQuad_vp
+(
+    in float4 inPos : POSITION,
+
+    out float4 pos : POSITION,
+    out float2 uv0 : TEXCOORD0,
+
+    uniform float4x4 worldViewProj
+)
+{
+    // Use standardise transform, so work accord with render system specific (RS depth, requires texture flipping, etc)
+    pos = mul(worldViewProj, inPos);
+
+    // The input positions adjusted by texel offsets, so clean up inaccuracies
+    inPos.xy = sign(inPos.xy);
+
+    // Convert to image-space
+    uv0 = (float2(inPos.x, -inPos.y) + 1.0f) * 0.5f;
+}
+
+void StdQuad_Tex2_vp
+(
+    in float4 inPos : POSITION,
+
+    out float4 pos : POSITION,
+    out float2 uv0 : TEXCOORD0,
+    out float2 uv1 : TEXCOORD1,
+
+    uniform float4x4 worldViewProj
+)
+{
+    // Use standardise transform, so work accord with render system specific (RS depth, requires texture flipping, etc)
+    pos = mul(worldViewProj, inPos);
+
+    // The input positions adjusted by texel offsets, so clean up inaccuracies
+    inPos.xy = sign(inPos.xy);
+
+    // Convert to image-space
+    uv0 = (float2(inPos.x, -inPos.y) + 1.0f) * 0.5f;
+    uv1 = uv0;
+}
+
+void StdQuad_Tex2a_vp
+(
+    in float4 inPos : POSITION,
+
+    out float4 pos : POSITION,
+    out float2 uv0 : TEXCOORD0,
+    out float2 uv1 : TEXCOORD1,
+
+    uniform float4x4 worldViewProj
+)
+{
+    // Use standardise transform, so work accord with render system specific (RS depth, requires texture flipping, etc)
+    pos = mul(worldViewProj, inPos);
+
+    // The input positions adjusted by texel offsets, so clean up inaccuracies
+    inPos.xy = sign(inPos.xy);
+
+    // Convert to image-space
+    uv0 = (float2(inPos.x, -inPos.y) + 1.0f) * 0.5f;
+    uv1 = inPos.xy;
+}
+
+void StdQuad_Tex3_vp
+(
+    in float4 inPos : POSITION,
+
+    out float4 pos : POSITION,
+    out float2 uv0 : TEXCOORD0,
+    out float2 uv1 : TEXCOORD1,
+    out float2 uv2 : TEXCOORD2,
+
+    uniform float4x4 worldViewProj
+)
+{
+    // Use standardise transform, so work accord with render system specific (RS depth, requires texture flipping, etc)
+    pos = mul(worldViewProj, inPos);
+
+    // The input positions adjusted by texel offsets, so clean up inaccuracies
+    inPos.xy = sign(inPos.xy);
+
+    // Convert to image-space
+    uv0 = (float2(inPos.x, -inPos.y) + 1.0f) * 0.5f;
+    uv1 = uv0;
+    uv2 = uv0;
+}
+
+void StdQuad_Tex4_vp
+(
+    in float4 inPos : POSITION,
+
+    out float4 pos : POSITION,
+    out float2 uv0 : TEXCOORD0,
+    out float2 uv1 : TEXCOORD1,
+    out float2 uv2 : TEXCOORD2,
+    out float2 uv3 : TEXCOORD3,
+
+    uniform float4x4 worldViewProj
+)
+{
+    // Use standardise transform, so work accord with render system specific (RS depth, requires texture flipping, etc)
+    pos = mul(worldViewProj, inPos);
+
+    // The input positions adjusted by texel offsets, so clean up inaccuracies
+    inPos.xy = sign(inPos.xy);
+
+    // Convert to image-space
+    uv0 = (float2(inPos.x, -inPos.y) + 1.0f) * 0.5f;
+    uv1 = uv0;
+    uv2 = uv0;
+    uv3 = uv0;
+}
Index: /Samples/Media/materials/programs/StdQuad_vp.glsl
===================================================================
--- /Samples/Media/materials/programs/StdQuad_vp.glsl	(revision 5)
+++ /Samples/Media/materials/programs/StdQuad_vp.glsl	(revision 5)
@@ -0,0 +1,11 @@
+varying vec2 uv;
+
+void main()                    
+{
+	gl_Position = ftransform();
+	
+	vec2 inPos = sign(gl_Vertex.xy);
+	
+	uv = (vec2(inPos.x, -inPos.y) + 1.0)/2.0;
+}
+
Index: /Samples/Media/materials/programs/TilingFP.cg
===================================================================
--- /Samples/Media/materials/programs/TilingFP.cg	(revision 5)
+++ /Samples/Media/materials/programs/TilingFP.cg	(revision 5)
@@ -0,0 +1,33 @@
+sampler RT : register(s0);
+
+float4 Tiling_ps(float4 inPos : POSITION,
+				float2 iTexCoord : TEXCOORD0,
+				uniform half NumTiles,
+				uniform half Threshhold) : COLOR
+{
+
+
+	half3 EdgeColor = {0.7, 0.7, 0.7};
+
+    half size = 1.0/NumTiles;
+    half2 Pbase = iTexCoord - fmod(iTexCoord, size.xx);
+    half2 PCenter = Pbase + (size/2.0).xx;
+    half2 st = (iTexCoord - Pbase)/size;
+    half4 c1 = (half4)0;
+    half4 c2 = (half4)0;
+    half4 invOff = half4((1-EdgeColor),1);
+    if (st.x > st.y) { c1 = invOff; }
+    half threshholdB =  1.0 - Threshhold;
+    if (st.x > threshholdB) { c2 = c1; }
+    if (st.y > threshholdB) { c2 = c1; }
+    half4 cBottom = c2;
+    c1 = (half4)0;
+    c2 = (half4)0;
+    if (st.x > st.y) { c1 = invOff; }
+    if (st.x < Threshhold) { c2 = c1; }
+    if (st.y < Threshhold) { c2 = c1; }
+    half4 cTop = c2;
+    half4 tileColor = tex2D(RT, PCenter);
+    half4 result = tileColor + cTop - cBottom;
+    return result;
+}
Index: /Samples/Media/materials/programs/crowdVp.glsl
===================================================================
--- /Samples/Media/materials/programs/crowdVp.glsl	(revision 5)
+++ /Samples/Media/materials/programs/crowdVp.glsl	(revision 5)
@@ -0,0 +1,62 @@
+uniform mat4 viewProjectionMatrix;
+uniform float numBones;
+uniform vec4 worldMatrix3x4Array[240];
+uniform vec4 lightDiffuseColour;
+uniform vec4 ambient;
+uniform vec4 lightPos;
+
+attribute vec4 blendIndices;
+attribute vec4 blendWeights;
+
+
+void main()
+{
+	vec3 blendPos = vec3(0,0,0);
+	vec3 blendNorm = vec3(0,0,0);
+	
+	vec3 tmpPos = vec3(0,0,0);
+	vec3 tmpNorm = vec3(0,0,0);
+
+
+	int instanceOffset = int(gl_MultiTexCoord1.x) * 3 * int(numBones);
+	for (int bone = 0; bone < 2; ++bone)
+	{
+		// perform matrix multiplication manually since no 3x4 matrices
+		for (int row = 0; row < 3; ++row)
+		{
+		    int idx = instanceOffset + int(blendIndices[bone]) * 3 + row;
+			vec4 blendMatrixRow = worldMatrix3x4Array[idx];
+			tmpPos[row] = dot(blendMatrixRow, gl_Vertex);
+#if SHADOW_CASTER
+#else
+			tmpNorm[row] = dot(blendMatrixRow.xyz, gl_Normal);
+#endif
+			
+		}
+		// now weight this into final 
+		blendPos += tmpPos * blendWeights[bone];
+#if SHADOW_CASTER
+#else
+		blendNorm += tmpNorm * blendWeights[bone];
+#endif
+	}
+
+	// apply view / projection to position
+	gl_Position = viewProjectionMatrix * vec4(blendPos, 1);
+
+	
+#if SHADOW_CASTER
+	gl_FrontColor = ambient;
+#else
+	// simple lighting model
+	vec3 lightDir = normalize(
+		lightPos.xyz -  (blendPos.xyz * lightPos.w));
+	gl_FrontColor = ambient 
+		+ clamp(dot(lightDir, blendNorm), 0.0, 1.0) * lightDiffuseColour;
+#endif
+    gl_FrontSecondaryColor = vec4(0);
+	gl_TexCoord[0] = gl_MultiTexCoord0;
+
+	
+}
+
Index: /Samples/Media/materials/programs/hdr.cg
===================================================================
--- /Samples/Media/materials/programs/hdr.cg	(revision 5)
+++ /Samples/Media/materials/programs/hdr.cg	(revision 5)
@@ -0,0 +1,25 @@
+void morningskybox_fp (
+	float2 uv : TEXCOORD0,
+	out float4 colour : COLOR,
+
+	uniform sampler2D tex : register(s0) )
+{
+	colour = tex2D(tex, uv);
+
+	// blow out the light a bit
+	colour *= 1.7;
+}
+void morningcubemap_fp (
+	float3 uv : TEXCOORD0,
+	out float4 colour : COLOR,
+
+	uniform samplerCUBE tex : register(s0) )
+{
+	colour = texCUBE(tex, uv);
+
+	// blow out the light a bit
+	colour *= 1.7;
+}
+
+
+
Index: /Samples/Media/materials/programs/hdr.hlsl
===================================================================
--- /Samples/Media/materials/programs/hdr.hlsl	(revision 5)
+++ /Samples/Media/materials/programs/hdr.hlsl	(revision 5)
@@ -0,0 +1,228 @@
+// RGBE mode utilities
+// RGB each carry a mantissa, A carries a shared exponent
+// The exponent is calculated based on the largest colour channel
+
+
+float3 decodeRGBE8(in float4 rgbe)
+{
+    // get exponent (-128 since it can be +ve or -ve)
+	float exp = rgbe.a * 255 - 128;
+	
+	// expand out the rgb value
+	return rgbe.rgb * exp2(exp);
+}
+
+float4 encodeRGBE8(in float3 rgb)
+{
+	float4 ret;
+
+    // What is the largest colour channel?
+	float highVal = max(rgb.r, max(rgb.g, rgb.b));
+	
+	// Take the logarithm, clamp it to a whole value
+	float exp = ceil(log2(highVal));
+
+    // Divide the components by the shared exponent
+	ret.rgb = rgb / exp2(exp);
+	
+	// Store the shared exponent in the alpha channel
+	ret.a = (exp + 128) / 255;
+
+	return ret;
+}
+
+
+static const float4 LUMINENCE_FACTOR  = float4(0.27f, 0.67f, 0.06f, 0.0f);
+static const float MIDDLE_GREY = 0.72f;
+static const float FUDGE = 0.001f;
+static const float L_WHITE = 1.5f;
+static const float4 BRIGHT_LIMITER = float4(0.6f, 0.6f, 0.6f, 0.0f);
+
+
+/** Tone mapping function 
+@note Only affects rgb, not a
+@param inColour The HDR colour
+@param lum The scene lumninence 
+@returns Tone mapped colour
+*/
+float4 toneMap(float4 inColour, float lum)
+{
+	// From Reinhard et al
+	// "Photographic Tone Reproduction for Digital Images"
+	
+	// Initial luminence scaling (equation 2)
+    inColour.rgb *= MIDDLE_GREY / (FUDGE + lum);
+
+	// Control white out (equation 4 nom)
+    inColour.rgb *= (1.0f + inColour / L_WHITE);
+
+	// Final mapping (equation 4 denom)
+	inColour.rgb /= (1.0f + inColour);
+	
+	return inColour;
+
+}
+
+/* Downsample a 2x2 area and convert to greyscale
+*/
+float4 downscale2x2Luminence(
+	float2 uv : TEXCOORD0,
+	uniform float2 texelSize, // depends on size of source texture
+	uniform sampler2D inRTT : register(s0)
+    ) : COLOR
+{
+	
+    float4 accum = float4(0.0f, 0.0f, 0.0f, 0.0f);
+
+	float2 texOffset[4] = {
+		-0.5, -0.5,
+		-0.5,  0.5, 
+		 0.5, -0.5,
+		 0.5, 0.5 };
+
+	for( int i = 0; i < 4; i++ )
+    {
+        // Get colour from source
+        accum += tex2D(inRTT, uv + texelSize * texOffset[i]);
+    }
+    
+	// Adjust the accumulated amount by lum factor
+	// Cannot use float3's here because it generates dependent texture errors because of swizzle
+	float lum = dot(accum, LUMINENCE_FACTOR);
+	// take average of 4 samples
+	lum *= 0.25;
+	return lum;
+
+}
+
+/* Downsample a 3x3 area 
+ * This shader is used multiple times on different source sizes, so texel size has to be configurable
+*/
+float4 downscale3x3(
+	float2 uv : TEXCOORD0,
+	uniform float2 texelSize, // depends on size of source texture
+	uniform sampler2D inRTT : register(s0)
+    ) : COLOR
+{
+	
+    float4 accum = float4(0.0f, 0.0f, 0.0f, 0.0f);
+
+	float2 texOffset[9] = {
+		-1.0, -1.0,
+		 0.0, -1.0,
+		 1.0, -1.0,
+		-1.0,  0.0,
+		 0.0,  0.0,
+		 1.0,  0.0,
+		-1.0,  1.0,
+		 0.0,  1.0,
+		 1.0,  1.0
+	};
+
+	for( int i = 0; i < 9; i++ )
+    {
+        // Get colour from source
+        accum += tex2D(inRTT, uv + texelSize * texOffset[i]);
+    }
+    
+	// take average of 9 samples
+	accum *= 0.1111111111111111;
+	return accum;
+
+}
+
+/* Downsample a 3x3 area from main RTT and perform a brightness pass
+*/
+float4 downscale3x3brightpass(
+	float2 uv : TEXCOORD0,
+	uniform float2 texelSize, // depends on size of source texture
+	uniform sampler2D inRTT : register(s0),
+	uniform sampler2D inLum : register(s1)
+    ) : COLOR
+{
+	
+    float4 accum = float4(0.0f, 0.0f, 0.0f, 0.0f);
+
+	float2 texOffset[9] = {
+		-1.0, -1.0,
+		 0.0, -1.0,
+		 1.0, -1.0,
+		-1.0,  0.0,
+		 0.0,  0.0,
+		 1.0,  0.0,
+		-1.0,  1.0,
+		 0.0,  1.0,
+		 1.0,  1.0
+	};
+
+	for( int i = 0; i < 9; i++ )
+    {
+        // Get colour from source
+        accum += tex2D(inRTT, uv + texelSize * texOffset[i]);
+    }
+    
+	// take average of 9 samples
+	accum *= 0.1111111111111111;
+
+    // Reduce bright and clamp
+    accum = max(float4(0.0f, 0.0f, 0.0f, 1.0f), accum - BRIGHT_LIMITER);
+
+	// Sample the luminence texture
+	float4 lum = tex2D(inLum, float2(0.5f, 0.5f));
+	
+	// Tone map result
+	return toneMap(accum, lum.r);
+
+}
+
+/* Gaussian bloom, requires offsets and weights to be provided externally
+*/
+float4 bloom(
+		float2 uv : TEXCOORD0,
+		uniform float2 sampleOffsets[15],
+		uniform float4 sampleWeights[15],	
+		uniform sampler2D inRTT : register(s0)
+		) : COLOR
+{
+    float4 accum = float4(0.0f, 0.0f, 0.0f, 1.0f);
+	float2 sampleUV;
+    
+    for( int i = 0; i < 15; i++ )
+    {
+        // Sample from adjacent points, 7 each side and central
+        sampleUV = uv + sampleOffsets[i];
+        accum += sampleWeights[i] * tex2D(inRTT, sampleUV);
+    }
+    
+    return accum;
+	
+}
+		
+
+/* Final scene composition, with tone mapping
+*/
+float4 finalToneMapping(
+	float2 uv : TEXCOORD0,
+	uniform sampler2D inRTT : register(s0),
+	uniform sampler2D inBloom : register(s1),
+	uniform sampler2D inLum : register(s2)
+    ) : COLOR
+{
+	// Get main scene colour
+    float4 sceneCol = tex2D(inRTT, uv);
+
+	// Get luminence value
+	float4 lum = tex2D(inLum, float2(0.5f, 0.5f));
+
+	// tone map this
+	float4 toneMappedSceneCol = toneMap(sceneCol, lum.r);
+	
+	// Get bloom colour
+    float4 bloom = tex2D(inBloom, uv);
+
+	// Add scene & bloom
+	return float4(toneMappedSceneCol.rgb + bloom.rgb, 1.0f);
+     	
+}
+
+
Index: /Samples/Media/materials/programs/hdr_bloom.glsl
===================================================================
--- /Samples/Media/materials/programs/hdr_bloom.glsl	(revision 5)
+++ /Samples/Media/materials/programs/hdr_bloom.glsl	(revision 5)
@@ -0,0 +1,22 @@
+uniform sampler2D inRTT;
+
+uniform vec4 sampleOffsets[15];
+uniform vec4 sampleWeights[15];
+
+varying vec2 uv;
+
+void main(void)
+{
+    vec4 accum = vec4(0.0, 0.0, 0.0, 1.0);
+	vec2 sampleUV;
+    
+    for( int i = 0; i < 15; i++ )
+    {
+        // Sample from adjacent points, 7 each side and central
+        sampleUV = uv + sampleOffsets[i].xy;
+        accum += sampleWeights[i] * texture2D(inRTT, sampleUV);
+    }
+    
+    gl_FragColor = accum;
+	
+}
Index: /Samples/Media/materials/programs/hdr_downscale2x2luminence.glsl
===================================================================
--- /Samples/Media/materials/programs/hdr_downscale2x2luminence.glsl	(revision 5)
+++ /Samples/Media/materials/programs/hdr_downscale2x2luminence.glsl	(revision 5)
@@ -0,0 +1,24 @@
+uniform sampler2D inRTT;
+uniform vec2 texelSize;
+
+varying vec2 uv;
+
+void main(void)
+{
+	
+    vec4 accum = vec4(0.0, 0.0, 0.0, 0.0);
+	vec4 LUMINENCE_FACTOR  = vec4(0.27, 0.67, 0.06, 0.0);
+
+    // Get colour from source
+    accum += texture2D(inRTT, uv + texelSize * vec2(-0.5, -0.5));
+    accum += texture2D(inRTT, uv + texelSize * vec2(-0.5, 0.5));
+    accum += texture2D(inRTT, uv + texelSize * vec2(0.5, 0.5));
+    accum += texture2D(inRTT, uv + texelSize * vec2(0.5, -0.5));
+    
+	// Adjust the accumulated amount by lum factor
+	float lum = dot(accum, LUMINENCE_FACTOR);
+	// take average of 4 samples
+	lum *= 0.25;
+	gl_FragColor = vec4(lum, lum, lum, 1.0);
+
+}
Index: /Samples/Media/materials/programs/hdr_downscale3x3.glsl
===================================================================
--- /Samples/Media/materials/programs/hdr_downscale3x3.glsl	(revision 5)
+++ /Samples/Media/materials/programs/hdr_downscale3x3.glsl	(revision 5)
@@ -0,0 +1,26 @@
+uniform sampler2D inRTT;
+uniform vec2 texelSize;
+
+varying vec2 uv;
+
+void main(void)
+{
+    vec4 accum = vec4(0.0, 0.0, 0.0, 0.0);
+
+    // Get colour from source
+    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, -1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, -1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, -1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0,  0.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0,  0.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0,  0.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0,  1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0,  1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0,  1.0));
+    
+	// take average of 9 samples
+	accum *= 0.1111111111111111;
+
+	gl_FragColor = accum;
+
+}
Index: /Samples/Media/materials/programs/hdr_downscale3x3brightpass.glsl
===================================================================
--- /Samples/Media/materials/programs/hdr_downscale3x3brightpass.glsl	(revision 5)
+++ /Samples/Media/materials/programs/hdr_downscale3x3brightpass.glsl	(revision 5)
@@ -0,0 +1,37 @@
+uniform sampler2D inRTT;
+uniform sampler2D inLum;
+uniform vec2 texelSize;
+
+varying vec2 uv;
+const vec4 BRIGHT_LIMITER = vec4(0.6, 0.6, 0.6, 0.0);
+
+// declare external function
+vec4 toneMap(in vec4 inColour, in float lum);
+
+void main(void)
+{
+    vec4 accum = vec4(0.0, 0.0, 0.0, 0.0);
+
+    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, -1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, -1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, -1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0,  0.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0,  0.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0,  0.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0,  1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0,  1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0,  1.0));
+    
+	// take average of 9 samples
+	accum *= 0.1111111111111111;
+
+    // Reduce bright and clamp
+    accum = max(vec4(0.0, 0.0, 0.0, 1.0), accum - BRIGHT_LIMITER);
+
+	// Sample the luminence texture
+	vec4 lum = texture2D(inLum, vec2(0.5, 0.5));
+	
+	// Tone map result
+	gl_FragColor = toneMap(accum, lum.r);
+
+}
Index: /Samples/Media/materials/programs/hdr_finalToneMapping.glsl
===================================================================
--- /Samples/Media/materials/programs/hdr_finalToneMapping.glsl	(revision 5)
+++ /Samples/Media/materials/programs/hdr_finalToneMapping.glsl	(revision 5)
@@ -0,0 +1,28 @@
+uniform sampler2D inRTT;
+uniform sampler2D inBloom;
+uniform sampler2D inLum;
+
+varying vec2 uv;
+
+// declare external function
+vec4 toneMap(in vec4 inColour, in float lum);
+
+void main(void)
+{
+	// Get main scene colour
+    vec4 sceneCol = texture2D(inRTT, uv);
+
+	// Get luminence value
+	vec4 lum = texture2D(inLum, vec2(0.5, 0.5));
+
+	// tone map this
+	vec4 toneMappedSceneCol = toneMap(sceneCol, lum.r);
+	
+	// Get bloom colour
+    vec4 bloom = texture2D(inBloom, uv);
+
+	// Add scene & bloom
+	gl_FragColor = vec4(toneMappedSceneCol.rgb + bloom.rgb, 1.0);
+    
+}
+
Index: /Samples/Media/materials/programs/hdr_tonemap_util.glsl
===================================================================
--- /Samples/Media/materials/programs/hdr_tonemap_util.glsl	(revision 5)
+++ /Samples/Media/materials/programs/hdr_tonemap_util.glsl	(revision 5)
@@ -0,0 +1,29 @@
+const float MIDDLE_GREY = 0.72;
+const float FUDGE = 0.001;
+const float L_WHITE = 1.5;
+
+/** Tone mapping function 
+@note Only affects rgb, not a
+@param inColour The HDR colour
+@param lum The scene lumninence 
+@returns Tone mapped colour
+*/
+vec4 toneMap(in vec4 inColour, in float lum)
+{
+	// From Reinhard et al
+	// "Photographic Tone Reproduction for Digital Images"
+	
+	// Initial luminence scaling (equation 2)
+    inColour.rgb *= MIDDLE_GREY / (FUDGE + lum);
+
+	// Control white out (equation 4 nom)
+    inColour.rgb *= (1.0 + inColour.rgb / L_WHITE);
+
+	// Final mapping (equation 4 denom)
+	inColour.rgb /= (1.0 + inColour.rgb);
+	
+	return inColour;
+
+}
+
+
Index: /Samples/Media/materials/programs/instancing.cg
===================================================================
--- /Samples/Media/materials/programs/instancing.cg	(revision 5)
+++ /Samples/Media/materials/programs/instancing.cg	(revision 5)
@@ -0,0 +1,125 @@
+
+
+void instancing_vp(uniform float3x4   worldMatrix3x4Array[80], float4 position : POSITION,
+						float3 normal : NORMAL,
+						float2 uv : TEXCOORD0,
+						float index : TEXCOORD1,
+						uniform float4x4 viewProjectionMatrix,
+						uniform float4 lightPos,
+						uniform float4 ambient,
+						uniform float4 lightDiffuseColour,
+						out float4 oPosition : POSITION,
+						out float2 oUv : TEXCOORD0,
+						out float4 Color : COLOR )
+{
+	// transform by indexed matrix
+	float4 transformedPos = float4(mul(worldMatrix3x4Array[index], position).xyz, 1.0);
+	
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, transformedPos);
+	oUv = uv;
+
+	float3 norm = mul((float3x3)worldMatrix3x4Array[index], normal);
+	
+	float3 lightDir = 	normalize(
+		lightPos.xyz -  (transformedPos.xyz * lightPos.w));
+
+	Color = ambient + saturate(dot(lightDir, norm)) * lightDiffuseColour;
+	
+	
+}
+
+/*
+  Instancing shadow-caster pass
+*/
+void instancingCaster_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float index     : TEXCOORD1,
+
+	out float4 oPosition : POSITION,
+	out float4 colour    : COLOR,
+	// Support up to 80 bones of float3x4
+	uniform float3x4   worldMatrix3x4Array[80],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 transformedPos = float4(mul(worldMatrix3x4Array[index], position).xyz, 1.0);
+
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, transformedPos);
+	
+	colour = ambient;
+	
+}
+void crowd_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float4  blendIdx : BLENDINDICES,
+	float4	blendWgt : BLENDWEIGHT,
+	float   index : TEXCOORD1,
+
+	out float4 oPosition : POSITION,
+	out float2 oUv       : TEXCOORD0,
+	out float4 colour           : COLOR,
+	// Support up to 20 bones of float3x4
+	// vs_2_0 only supports 256 params so more than this is not feasible
+	uniform float4x4 viewProjectionMatrix,
+	uniform float numBones,
+	uniform float3x4   worldMatrix3x4Array[80],
+	uniform float4 lightDiffuseColour,
+	uniform float4 ambient,
+	uniform float4 lightPos)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(0,0,0,0);
+	int i;
+	for (i = 0; i < 4; ++i)
+	{
+		blendPos += float4(mul(worldMatrix3x4Array[index*numBones+blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+	}
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	oUv = uv;
+	float3 norm = float3(0,0,0);
+	for (i = 0; i < 4; ++i)
+	{
+		norm += mul((float3x3)worldMatrix3x4Array[index*numBones+blendIdx[i]], normal)* blendWgt[i];
+	}
+	float3 lightDir = 	normalize(
+		lightPos.xyz -  (blendPos.xyz * lightPos.w));
+
+	colour = ambient + saturate(dot(lightDir, norm)) * lightDiffuseColour;
+
+	
+}
+
+/*
+  Single-weight-per-vertex hardware skinning, shadow-caster pass
+*/
+void crowdCaster_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float  blendIdx : BLENDINDICES,
+	float index     : TEXCOORD1,
+
+	out float4 oPosition : POSITION,
+	out float4 colour    : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[80],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float numBones,
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(mul(worldMatrix3x4Array[index*numBones+blendIdx], position).xyz, 1.0);
+
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	
+	colour = ambient;
+	
+}	
Index: /Samples/Media/materials/programs/instancingVp.glsl
===================================================================
--- /Samples/Media/materials/programs/instancingVp.glsl	(revision 5)
+++ /Samples/Media/materials/programs/instancingVp.glsl	(revision 5)
@@ -0,0 +1,39 @@
+uniform vec4 worldMatrix3x4Array[240];
+uniform mat4 viewProjectionMatrix;
+uniform vec4 lightPos;
+uniform vec4 ambient;
+uniform vec4 lightDiffuseColour;
+
+void main()
+{
+
+	// transform by indexed matrix
+	// perform matrix multiplication manually since no 3x4 matrices
+	vec3 transformedPos;
+	vec3 transformedNorm;
+	int instanceOffset = int(gl_MultiTexCoord1.x) * 3;
+	for (int row = 0; row < 3; ++row)
+	{
+		vec4 matrixRow = worldMatrix3x4Array[instanceOffset + row];
+		transformedPos[row] = dot(matrixRow, gl_Vertex);
+#if SHADOW_CASTER
+#else
+		transformedNorm[row] = dot(matrixRow.xyz, gl_Normal);
+#endif
+		
+	}
+	
+	// view / projection
+	gl_Position = viewProjectionMatrix * vec4(transformedPos,1);
+	gl_TexCoord[0] = gl_MultiTexCoord0;
+    gl_FrontSecondaryColor = vec4(0);
+	
+#if SHADOW_CASTER
+	gl_FrontColor = ambient;
+#else
+	vec3 lightDir = normalize(
+		lightPos.xyz -  (transformedPos.xyz * lightPos.w));
+	gl_FrontColor = ambient + clamp(dot(lightDir, transformedNorm),0.0,1.0) * lightDiffuseColour;
+#endif
+	
+}
Index: /Samples/Media/materials/programs/oceanGLSL.frag
===================================================================
--- /Samples/Media/materials/programs/oceanGLSL.frag	(revision 5)
+++ /Samples/Media/materials/programs/oceanGLSL.frag	(revision 5)
@@ -0,0 +1,45 @@
+// oceanGLSL.frag
+// fragment program for Ocean water simulation
+// 05 Aug 2005
+// adapted for Ogre by nfz
+// converted from HLSL to GLSL
+// original shader source from Render Monkey 1.6 Reflections Refractions.rfx
+
+// 06 Aug 2005: moved uvw calculation from fragment program into vertex program 
+
+uniform float fadeBias;
+uniform float fadeExp;
+uniform vec4 waterColor;
+uniform sampler3D Noise;
+uniform samplerCube skyBox;
+
+varying vec3 uvw;
+varying vec3 normal;
+varying vec3 vVec;
+
+void main(void)
+{
+   vec3 noisy = texture3D(Noise, uvw).xyz;
+   
+   // convert to signed noise
+   vec3 bump = 2.0 * noisy - 1.0;
+   bump.xz *= 0.15;
+   // Make sure the normal always points upwards
+   // note that Ogres y axis is vertical (RM Z axis is vertical)
+   bump.y = 0.8 * abs(bump.y) + 0.2;
+   // Offset the surface normal with the bump
+   bump = normalize(normal + bump);
+
+   // Find the reflection vector
+   vec3 normView = normalize(vVec);
+   vec3 reflVec = reflect(normView, bump);
+   // Ogre has z flipped for cubemaps
+   reflVec.z = -reflVec.z;
+   vec4 refl = textureCube(skyBox, reflVec);
+
+   // set up for fresnel calc
+   float lrp = 1.0 - dot(-normView, bump);
+   
+   // Interpolate between the water color and reflection for fresnel effect
+   gl_FragColor = mix(waterColor, refl, clamp(fadeBias + pow(lrp, fadeExp), 0.0, 1.0) );
+}
Index: /Samples/Media/materials/programs/oceanGLSL.vert
===================================================================
--- /Samples/Media/materials/programs/oceanGLSL.vert	(revision 5)
+++ /Samples/Media/materials/programs/oceanGLSL.vert	(revision 5)
@@ -0,0 +1,32 @@
+// oceanGLSL.vert
+// vertex program for Ocean water simulation
+// 05 Aug 2005
+// adapted for Ogre by nfz
+// converted from HLSL to GLSL
+// original shader source from Render Monkey 1.6 Reflections Refractions.rfx
+
+// 06 Aug 2005: moved uvw calculation from fragment program into vertex program 
+
+uniform vec3 scale;
+uniform vec3 eyePosition;
+uniform vec2 waveSpeed;
+uniform float noiseSpeed;
+uniform float time_0_X;
+
+varying vec3 uvw;
+varying vec3 normal;
+varying vec3 vVec;
+
+void main(void)
+{
+   gl_Position = ftransform();
+   
+   //  the view vector needs to be in vertex space
+   vVec = gl_Vertex.xyz - eyePosition;
+   normal = gl_Normal;
+   // uvw is the calculated uvw coordinates based on vertex position
+   uvw = gl_Vertex.xyz * scale.xyz;
+   uvw.xz += waveSpeed * time_0_X;
+   uvw.y += uvw.z + noiseSpeed * time_0_X;
+   
+}
Index: /Samples/Media/materials/programs/oceanHLSL_Cg.frag
===================================================================
--- /Samples/Media/materials/programs/oceanHLSL_Cg.frag	(revision 5)
+++ /Samples/Media/materials/programs/oceanHLSL_Cg.frag	(revision 5)
@@ -0,0 +1,44 @@
+// oceanHLSL_Cg.frag
+// fragment program for Ocean water simulation
+// 04 Aug 2005
+// adapted for Ogre by nfz
+// original shader source from Render Monkey 1.6 Reflections Refractions.rfx
+// can be used in both Cg and HLSL compilers
+
+// 06 Aug 2005: moved uvw calculation from fragment program into vertex program 
+
+float4 main(float3 uvw: TEXCOORD0, float3 normal: TEXCOORD1, float3 vVec: TEXCOORD2,
+	uniform float fadeBias,
+	uniform float fadeExp,
+	uniform float4 waterColor,
+	uniform sampler Noise,
+	uniform sampler skyBox
+
+) : COLOR
+{
+
+   float3 noisy = tex3D(Noise, uvw).xyz;
+
+   // convert to Signed noise 
+   float3 bump = 2 * noisy - 1;
+   bump.xz *= 0.15;
+   // Make sure the normal always points upwards
+   // note that Ogres y axis is vertical (RM Z axis is vertical)
+   bump.y = 0.8 * abs(bump.y) + 0.2;
+   // Offset the surface normal with the bump
+   bump = normalize(normal + bump);
+
+   // Find the reflection vector
+   float3 normView = normalize(vVec);
+   float3 reflVec = reflect(normView, bump);
+   // Ogre has z flipped for cubemaps
+   reflVec.z = -reflVec.z;
+   float4 refl = texCUBE(skyBox, reflVec);
+
+   // set up for fresnel calc
+   float lrp = 1 - dot(-normView, bump);
+   
+   // Interpolate between the water color and reflection for fresnel effect
+   return lerp(waterColor, refl, saturate(fadeBias + pow(lrp, fadeExp)));
+
+}
Index: /Samples/Media/materials/programs/oceanHLSL_Cg.vert
===================================================================
--- /Samples/Media/materials/programs/oceanHLSL_Cg.vert	(revision 5)
+++ /Samples/Media/materials/programs/oceanHLSL_Cg.vert	(revision 5)
@@ -0,0 +1,41 @@
+// oceanHLSL_Cg.vert
+// vertex program for Ocean water simulation
+// 04 Aug 2005
+// adapted for Ogre by nfz
+// original shader source from Render Monkey 1.6 Reflections Refractions.rfx
+// can be used in both Cg and HLSL compilers
+
+// 06 Aug 2005: moved uvw calculation from fragment program into vertex program 
+
+struct VS_OUTPUT {
+   float4 Pos:    POSITION;
+   float3 uvw:    TEXCOORD0;
+   float3 normal: TEXCOORD1;
+   float3 vVec:   TEXCOORD2;
+};
+
+VS_OUTPUT main(float4 Pos: POSITION, float3 normal: NORMAL,
+	uniform float4x4 worldViewProj_matrix,
+	uniform float3 scale,
+	uniform float2 waveSpeed,
+	uniform float noiseSpeed,
+	uniform float time_0_X,
+	uniform float3 eyePosition
+
+)
+{
+   VS_OUTPUT Out;
+
+   Out.Pos = mul(worldViewProj_matrix, Pos);
+   
+   // uvw is the calculated uvw coordinates based on vertex position
+   Out.uvw = Pos.xyz * scale;
+   Out.uvw.xz += waveSpeed * time_0_X;
+   Out.uvw.y += Out.uvw.z + noiseSpeed * time_0_X;
+   
+   //  the view vector needs to be in vertex space
+   Out.vVec = Pos.xyz - eyePosition;
+   Out.normal = normal;
+
+   return Out;
+}
Index: /Samples/Media/materials/programs/skinningTwoWeightsShadowCasterVp.glsl
===================================================================
--- /Samples/Media/materials/programs/skinningTwoWeightsShadowCasterVp.glsl	(revision 5)
+++ /Samples/Media/materials/programs/skinningTwoWeightsShadowCasterVp.glsl	(revision 5)
@@ -0,0 +1,40 @@
+// Example GLSL program for skinning with two bone weights per vertex
+
+attribute vec4 blendIndices;
+attribute vec4 blendWeights;
+
+// 3x4 matrix, passed as vec4's for compatibility with GL 2.0
+// GL 2.0 supports 3x4 matrices
+// Support 24 bones ie 24*3, but use 72 since our parser can pick that out for sizing
+uniform vec4 worldMatrix3x4Array[72];
+uniform mat4 viewProjectionMatrix;
+uniform vec4 ambient;
+
+void main()
+{
+	vec3 blendPos = vec3(0,0,0);
+
+	for (int bone = 0; bone < 2; ++bone)
+	{
+		// perform matrix multiplication manually since no 3x4 matrices
+        // ATI GLSL compiler can't handle indexing an array within an array so calculate the inner index first
+	    int idx = int(blendIndices[bone]) * 3;
+        // ATI GLSL compiler can't handle unrolling the loop so do it manually
+        // ATI GLSL has better performance when mat4 is used rather than using individual dot product
+        // There is a bug in ATI mat4 constructor (Cat 7.2) when indexed uniform array elements are used as vec4 parameter so manually assign
+		mat4 worldMatrix;
+		worldMatrix[0] = worldMatrix3x4Array[idx];
+		worldMatrix[1] = worldMatrix3x4Array[idx + 1];
+		worldMatrix[2] = worldMatrix3x4Array[idx + 2];
+		worldMatrix[3] = vec4(0);
+		// now weight this into final 
+		blendPos += (gl_Vertex * worldMatrix).xyz * blendWeights[bone];
+	}
+
+	// apply view / projection to position
+	gl_Position = viewProjectionMatrix * vec4(blendPos, 1);
+	
+	gl_FrontSecondaryColor = vec4(0,0,0,0);
+	gl_FrontColor = ambient;
+	gl_TexCoord[0] = gl_MultiTexCoord0;
+}
Index: /Samples/Media/materials/programs/skinningTwoWeightsVp.glsl
===================================================================
--- /Samples/Media/materials/programs/skinningTwoWeightsVp.glsl	(revision 5)
+++ /Samples/Media/materials/programs/skinningTwoWeightsVp.glsl	(revision 5)
@@ -0,0 +1,57 @@
+// Example GLSL program for skinning with two bone weights per vertex
+
+attribute vec4 blendIndices;
+attribute vec4 blendWeights;
+
+// 3x4 matrix, passed as vec4's for compatibility with GL 2.0
+// GL 2.0 supports 3x4 matrices
+// Support 24 bones ie 24*3, but use 72 since our parser can pick that out for sizing
+uniform vec4 worldMatrix3x4Array[72];
+uniform mat4 viewProjectionMatrix;
+uniform vec4 lightPos[2];
+uniform vec4 lightDiffuseColour[2];
+
+void main()
+{
+	vec3 blendPos = vec3(0,0,0);
+	vec3 blendNorm = vec3(0,0,0);
+	
+	for (int bone = 0; bone < 2; ++bone)
+	{
+		// perform matrix multiplication manually since no 3x4 matrices
+        // ATI GLSL compiler can't handle indexing an array within an array so calculate the inner index first
+	    int idx = int(blendIndices[bone]) * 3;
+        // ATI GLSL compiler can't handle unrolling the loop so do it manually
+        // ATI GLSL has better performance when mat4 is used rather than using individual dot product
+        // There is a bug in ATI mat4 constructor (Cat 7.2) when indexed uniform array elements are used as vec4 parameter so manually assign
+		mat4 worldMatrix;
+		worldMatrix[0] = worldMatrix3x4Array[idx];
+		worldMatrix[1] = worldMatrix3x4Array[idx + 1];
+		worldMatrix[2] = worldMatrix3x4Array[idx + 2];
+		worldMatrix[3] = vec4(0);
+		// now weight this into final 
+	    float weight = blendWeights[bone];
+		blendPos += (gl_Vertex * worldMatrix).xyz * weight;
+		
+		mat3 worldRotMatrix = mat3(worldMatrix[0].xyz, worldMatrix[1].xyz, worldMatrix[2].xyz);
+		blendNorm += (gl_Normal * worldRotMatrix) * weight;
+
+	}
+
+	// apply view / projection to position
+	gl_Position = viewProjectionMatrix * vec4(blendPos, 1);
+
+	// simple vertex lighting model
+	vec3 lightDir0 = normalize(
+		lightPos[0].xyz -  (blendPos.xyz * lightPos[0].w));
+	vec3 lightDir1 = normalize(
+		lightPos[1].xyz -  (blendPos.xyz * lightPos[1].w));
+		
+	gl_FrontSecondaryColor = vec4(0);
+	gl_FrontColor = vec4(0.5, 0.5, 0.5, 1.0) 
+		+ clamp(dot(lightDir0, blendNorm), 0.0, 1.0) * lightDiffuseColour[0]
+		+ clamp(dot(lightDir1, blendNorm), 0.0, 1.0) * lightDiffuseColour[1];
+
+	gl_TexCoord[0] = gl_MultiTexCoord0;
+	
+}
Index: /Samples/Media/materials/programs/varianceshadowcasterfp.cg
===================================================================
--- /Samples/Media/materials/programs/varianceshadowcasterfp.cg	(revision 5)
+++ /Samples/Media/materials/programs/varianceshadowcasterfp.cg	(revision 5)
@@ -0,0 +1,65 @@
+/////////////////////////////////////////////////////////////////////////////////
+//
+// shadowcasterfp.cg
+//
+// Hamilton Chong
+// (c) 2006
+//
+// This is an example fragment shader for shadow caster objects.  
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+
+// Define outputs from vertex shader.
+struct VertexOut
+{
+  float4 position   : POSITION;     // can't rely on access to this
+  float4 pos  	    : TEXCOORD0;    // position of fragment (in homogeneous coordinates)
+  float4 normal     : TEXCOORD1;    // un-normalized normal in object space
+  float4 modelPos   : TEXCOORD2;    // coordinates of model in object space at this point
+};
+
+struct FragmentOut
+{
+    float4 color  : COLOR0;
+};
+
+FragmentOut main( VertexOut        In,                     // fragment to process
+                  uniform float    uDepthOffset,           // offset amount (constant in eye space)
+                  uniform float4x4 uProjection             // projection matrix
+              )
+{
+    FragmentOut Out;
+
+    // compute the "normalized device coordinates" (no viewport applied yet)
+    float4 postproj = In.pos / In.pos.w;
+
+    // get the normalized normal of the geometry seen at this point
+    float4 normal = normalize(In.normal);
+
+
+    // -- Computing Depth Bias Quantities -----------------------------
+
+    // We now compute the change in z that would signify a push in the z direction
+    // by 1 unit in eye space.  Note that eye space z is related in a nonlinear way to
+    // screen space z, so this is not just a constant.  
+    // ddepth below is how much screen space z at this point would change for that push.
+    // NOTE: computation of ddepth likely differs from OpenGL's glPolygonOffset "unit"
+    //  computation, which is allowed to be vendor specific.
+    float4 dpwdz = mul(uProjection, float4(0.0, 0.0, 1.0, 0.0));
+    float4 dpdz = (dpwdz - (postproj * dpwdz.w)) / In.pos.w;
+    float  ddepth = abs(dpdz.z);
+
+    // -- End depth bias helper section --------------------------------   
+
+    // We now compute the depth of the fragment.  This is the actual depth value plus
+    // our depth bias.  The depth bias depends on how uncertain we are about the z value
+    // plus some constant push in the z direction.  The exact coefficients to use are
+    // up to you, but at least it should be somewhat intuitive now what the tradeoffs are.
+    float depthval = postproj.z /* + (0.5 * dzlen)*/ + (uDepthOffset * ddepth);
+    depthval = (0.5 * depthval) + 0.5; // put into [0,1] range instead of [-1,1] 
+
+    
+    Out.color = float4(depthval, depthval * depthval, depthval, 0.0);
+    return Out;
+}
Index: /Samples/Media/materials/programs/varianceshadowcastervp.cg
===================================================================
--- /Samples/Media/materials/programs/varianceshadowcastervp.cg	(revision 5)
+++ /Samples/Media/materials/programs/varianceshadowcastervp.cg	(revision 5)
@@ -0,0 +1,44 @@
+/////////////////////////////////////////////////////////////////////////////////
+//
+// shadowcastervp.cg
+//
+// Hamilton Chong
+// (c) 2006
+//
+// This is an example vertex shader for shadow caster objects.  
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+
+// Define inputs from application.
+struct VertexIn
+{
+  float4 position : POSITION;       // vertex position in object space
+  float4 normal   : NORMAL;         // vertex normal in object space
+};
+
+// Define outputs from vertex shader.
+struct VertexOut
+{
+  float4 position   : POSITION;     // post projection position coordinates
+  float4 pos  	    : TEXCOORD0;    // ditto. Not all hardware allows access values bound to POSITION in fp.
+  float4 normal     : TEXCOORD1;    // normal in object space (to be interpolated)
+  float4 modelPos   : TEXCOORD2;    // position in object space (to be interpolated) 
+};
+
+VertexOut main( VertexIn         In,                   // vertex to process
+                uniform float4x4 uModelViewProjection  // model-view-projection matrix
+              )
+{
+    VertexOut Out;   // output data
+    
+    // Transform vertex position into post projective (homogenous screen) space.
+    Out.position = mul(uModelViewProjection, In.position);
+    Out.pos      = mul(uModelViewProjection, In.position);
+
+    // copy over data to interpolate using perspective correct interpolation
+    Out.normal = float4(In.normal.x, In.normal.y, In.normal.z, 0.0);
+    Out.modelPos = In.position;
+
+    return Out;
+}
Index: /Samples/Media/materials/programs/varianceshadowreceiverfp.cg
===================================================================
--- /Samples/Media/materials/programs/varianceshadowreceiverfp.cg	(revision 5)
+++ /Samples/Media/materials/programs/varianceshadowreceiverfp.cg	(revision 5)
@@ -0,0 +1,107 @@
+/////////////////////////////////////////////////////////////////////////////////
+//
+// shadowreceiverfp.cg
+//
+// Hamilton Chong
+// (c) 2006
+//
+// This is an example fragment shader for shadow receiver objects.  
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+
+sampler2D ShadowMap : TEXUNIT0;
+
+// Define outputs from vertex shader.
+struct Vertex
+{
+  float4 position       : POSITION;     // fragment position in post projective space
+  float4 shadowCoord    : TEXCOORD0;    // fragment position in shadow map coordinates
+  float  diffuse        : TEXCOORD1;    // diffuse shading value
+};
+
+struct Fragment
+{
+    float4 color  : COLOR0;
+};
+
+Fragment main(Vertex        In, 
+              uniform float uSTexWidth,
+              uniform float uSTexHeight)
+{
+    Fragment Out;
+
+    // compute the shadow coordinates for texture lookup
+    // NOTE: texture_viewproj_matrix maps z into [0,1] range, not [-1,1], so
+    //  have to make sure shadow caster stores depth values with same convention.
+    float4 scoord = In.shadowCoord / In.shadowCoord.w;
+
+
+    // -- Bilinear Filtering of Sample -------------------------------------------- 
+
+    // One could use scoord.xy to look up the shadow map for depth testing, but
+    // we'll be implementing a simple "percentage closest filtering" algorithm instead.
+    // This mimics the behavior of turning on bilinear filtering on NVIDIA hardware
+    // when also performing shadow comparisons.  This causes bilinear filtering of
+    // depth tests.  Note that this is NOT the same as bilinear filtering the depth
+    // values and then doing the depth comparison.  The two operations are not 
+    // commutative.  PCF is explicitly about filtering the test values since
+    // testing filtered z values is often meaningless.  
+
+    // Real percentage closest filtering should sample from the entire footprint
+    // on the shadow map, not just seek the closest four sample points.  Such 
+    // an improvement is for future work.
+
+    
+    // NOTE: Assuming OpenGL convention for texture lookups with integers in centers.
+    //  DX convention is to have integers mark sample corners
+    float2 tcoord;
+    tcoord.x = (scoord.x * uSTexWidth) - 0.5;
+    tcoord.y = (scoord.y * uSTexHeight) - 0.5;
+    float x0 = floor(tcoord.x);
+    float x1 = ceil(tcoord.x);
+    float fracx = frac(tcoord.x);
+    float y0 = floor(tcoord.y);
+    float y1 = ceil(tcoord.y);
+    float fracy = frac(tcoord.y);
+    
+    // sample coordinates in [0,1]^2 domain
+    float2 t00, t01, t10, t11;
+    float invWidth  = 1.0 / uSTexWidth;
+    float invHeight = 1.0 / uSTexHeight;
+    t00 = float2((x0+0.5) * invWidth, (y0+0.5) * invHeight);
+    t10 = float2((x1+0.5) * invWidth, (y0+0.5) * invHeight);
+    t01 = float2((x0+0.5) * invWidth, (y1+0.5) * invHeight);
+    t11 = float2((x1+0.5) * invWidth, (y1+0.5) * invHeight);
+    
+    // grab the samples
+    float2 z00 = tex2D(ShadowMap, t00).xy;
+    float2 z01 = tex2D(ShadowMap, t01).xy;
+    float2 z10 = tex2D(ShadowMap, t10).xy;
+    float2 z11 = tex2D(ShadowMap, t11).xy;
+
+    // bilinear filter the sample data
+    float2 d0 = ((1.0 - fracx) * z00) + (fracx * z10);
+    float2 d1 = ((1.0 - fracx) * z01) + (fracx * z11);
+    float2 datum = ((1.0 - fracy) * d0) + (fracy * d1);
+
+    // -- Variance Shadow Mapping ---------------------------------------------------
+
+    float zVariance = datum.y - (datum.x * datum.x);
+    float zDeviation = scoord.z - datum.x;
+    zDeviation = (zDeviation < 0.0) ? 0.0 : zDeviation;
+    float visibility = zVariance / (zVariance + (zDeviation * zDeviation));
+    float ztest = (scoord.z < datum.x) ? 1.0:0.0;  // filtering depth ok, because used only for small variance
+    visibility = (zVariance > 0.0) ? visibility : ztest; // if variance too small, we get garbage
+    //0.0000001
+
+    // determine that all geometry within pixel border of shadow map (and outside) is lit
+    float filterBorder = max(invWidth, invHeight);
+    visibility = (all(abs(scoord.xy-0.5)<=0.5-filterBorder)) ? visibility : 1.0;
+
+    // ------------------------------------------------------------------------------
+
+    visibility *= In.diffuse;
+    Out.color = float4(visibility, visibility, visibility, 0.0);
+    return Out;
+}
Index: /Samples/Media/materials/programs/varianceshadowreceivervp.cg
===================================================================
--- /Samples/Media/materials/programs/varianceshadowreceivervp.cg	(revision 5)
+++ /Samples/Media/materials/programs/varianceshadowreceivervp.cg	(revision 5)
@@ -0,0 +1,47 @@
+/////////////////////////////////////////////////////////////////////////////////
+//
+// shadowreceivervp.cg
+//
+// Hamilton Chong
+// (c) 2006
+//
+// This is an example vertex shader for shadow receiver objects.  
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+// Define inputs from application.
+struct VertexIn
+{
+  float4 position       : POSITION;     // vertex position in object space
+  float4 normal         : NORMAL;       // vertex normal in object space
+};
+
+// Define outputs from vertex shader.
+struct Vertex
+{
+  float4 position       : POSITION;     // vertex position in post projective space
+  float4 shadowCoord    : TEXCOORD0;    // vertex position in shadow map coordinates
+  float  diffuse        : TEXCOORD1;    // diffuse shading value
+};
+
+Vertex main(VertexIn         In,
+            uniform float4x4 uModelViewProjection,   // model-view-projection matrix
+            uniform float4   uLightPosition,         // light position in object space
+            uniform float4x4 uModel,                 // model matrix
+            uniform float4x4 uTextureViewProjection  // shadow map's view projection matrix
+            )
+{
+    Vertex Out;
+
+    // compute diffuse shading
+    float3 lightDirection = normalize(uLightPosition.xyz - In.position.xyz);
+    Out.diffuse = dot(In.normal.xyz, lightDirection);
+
+    // compute shadow map lookup coordinates
+    Out.shadowCoord = mul(uTextureViewProjection, mul(uModel, In.position));
+
+    // compute vertex's homogenous screen-space coordinates
+    Out.position = mul(uModelViewProjection, In.position);
+
+    return Out;
+}
Index: /Samples/Media/materials/scripts/BlackAndWhite.material
===================================================================
--- /Samples/Media/materials/scripts/BlackAndWhite.material	(revision 5)
+++ /Samples/Media/materials/scripts/BlackAndWhite.material	(revision 5)
@@ -0,0 +1,34 @@
+fragment_program Ogre/Compositor/B&W_FP cg
+{
+	source GrayScale.cg
+	entry_point GrayScale_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/BlackAndWhite
+{
+	technique
+	{
+
+		pass
+		{
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Cg_vp
+			{
+			}
+
+			fragment_program_ref Ogre/Compositor/B&W_FP
+			{
+			}
+
+			texture_unit
+			{
+				texture RT
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+			}
+		}
+	}
+}
Index: /Samples/Media/materials/scripts/Bloom.material
===================================================================
--- /Samples/Media/materials/scripts/Bloom.material	(revision 5)
+++ /Samples/Media/materials/scripts/Bloom.material	(revision 5)
@@ -0,0 +1,178 @@
+//DirectX 9.0 HLSL Vertex Shader vs_1_1
+vertex_program Blur0_vs11 hlsl
+{
+	source Blur0_vs11.hlsl
+	target vs_1_1
+	entry_point main
+}
+
+//DirectX 9.0 HLSL Pixel Shader ps_2_0
+fragment_program Blur0_ps20 hlsl
+{
+	source Blur0_ps20.hlsl
+	target ps_2_0
+	entry_point main
+}
+
+//DirectX 9.0 HLSL Vertex Shader vs_1_1
+vertex_program Blur1_vs11 hlsl
+{
+	source Blur1_vs11.hlsl
+	target vs_1_1
+	entry_point main
+}
+
+//DirectX 9.0 HLSL Pixel Shader ps_2_0
+fragment_program Blur1_ps20 hlsl
+{
+	source Blur1_ps20.hlsl
+	target ps_2_0
+	entry_point main
+}
+
+vertex_program Blur0_vs_glsl glsl
+{
+	source Blur0_vs.glsl
+}
+vertex_program Blur1_vs_glsl glsl
+{
+	source Blur1_vs.glsl
+}
+fragment_program Blur_ps_glsl glsl
+{
+	source Blur_ps.glsl
+	default_params
+	{
+		param_named tex0 int 0
+	}
+}
+
+//Effect: Bloom
+material Ogre/Compositor/Blur0
+{
+	technique
+	{
+		//Rendering Pass: Blur0 (pass index: #1 )
+		pass
+		{
+			//State: D3DRS_CULLMODE, Value : D3DCULL_NONE
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			fragment_program_ref Blur0_ps20
+			{
+			}
+			vertex_program_ref Blur0_vs11
+			{
+			}
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+			}
+		}
+	}
+	technique
+	{
+		//Rendering Pass: Blur0 (pass index: #1 )
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			fragment_program_ref Blur_ps_glsl
+			{
+			}
+			vertex_program_ref Blur0_vs_glsl
+			{
+			}
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+			}
+		}
+	}
+}
+
+material Ogre/Compositor/Blur1
+{
+	technique
+	{
+
+		//Rendering Pass: Blur1 (pass index: #2 )
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			fragment_program_ref Blur1_ps20
+			{
+			}
+			vertex_program_ref Blur1_vs11
+			{
+			}
+			texture_unit
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+			}
+		}
+	}
+	technique
+	{
+
+		//Rendering Pass: Blur1 (pass index: #2 )
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			fragment_program_ref Blur_ps_glsl
+			{
+			}
+			vertex_program_ref Blur1_vs_glsl
+			{
+			}
+			texture_unit
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+			}
+		}
+	}
+}
+
+/// Overlay quad
+material Ogre/Compositor/BloomBlend
+{
+    technique
+    {
+        pass
+        {
+            lighting on
+            diffuse 0.0 0.0 0.0 0.6
+            specular 0.0 0.0 0.0 0.0
+            ambient 0.0 0.0 0.0
+            emissive 1.0 1.0 1.0
+            cull_hardware none
+            depth_check off
+            scene_blend alpha_blend
+
+            texture_unit
+            {
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+            }
+        }
+    }
+}
Index: /Samples/Media/materials/scripts/DOF.material
===================================================================
--- /Samples/Media/materials/scripts/DOF.material	(revision 5)
+++ /Samples/Media/materials/scripts/DOF.material	(revision 5)
@@ -0,0 +1,94 @@
+fragment_program DOF_Blur_ps cg
+{
+	source DOF_ps.cg
+	entry_point blur
+	profiles ps_2_0 arbfp1
+}
+
+fragment_program DOF_Blend_ps cg
+{
+	source DOF_ps.cg
+	entry_point blend
+	profiles ps_2_0 arbfp1
+}
+
+//Effect: Depth of Field
+material Ogre/Compositor/DOF_Blur0
+{
+	technique
+	{
+		//Rendering Pass: Blur0 (pass index: #1 )
+		pass
+		{
+			//State: D3DRS_CULLMODE, Value : D3DCULL_NONE
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			fragment_program_ref DOF_Blur_ps
+			{
+			    param_named sampleDistance float 0.1
+			}
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+			texture_unit
+			{
+			    // texture will get added at runtime
+                tex_coord_set 0
+				tex_address_mode wrap
+				filtering trilinear
+			}
+		}
+	}
+}
+
+// cheat here by copying from DOF_Blur0
+material Ogre/Compositor/DOF_Blur1 : Ogre/Compositor/DOF_Blur0
+{
+	technique
+	{
+		//Rendering Pass: Blur0 (pass index: #1 )
+		pass
+		{
+		    // use the same pixel shader as DOF_Blur0
+			fragment_program_ref
+			{
+			    // override value from copied DOF_Blur0 material
+			    param_named sampleDistance float 0.1
+			}
+		}
+	}
+}
+
+material Ogre/Compositor/DOF_Blend
+{
+    technique
+    {
+        pass
+        {
+			fragment_program_ref DOF_Blend_ps
+			{
+			    param_named focus float 0.66
+			    param_named range float 1.0
+			}
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+            texture_unit Blur0
+            {
+			    // texture will get added at runtime
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering trilinear
+            }
+            texture_unit Blur1
+            {
+			    // texture will get added at runtime
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering trilinear
+            }
+        }
+    }
+}
Index: /Samples/Media/materials/scripts/DepthShadowmap.material
===================================================================
--- /Samples/Media/materials/scripts/DepthShadowmap.material	(revision 5)
+++ /Samples/Media/materials/scripts/DepthShadowmap.material	(revision 5)
@@ -0,0 +1,595 @@
+
+// ***-- Begin HLSL section --**
+
+vertex_program Ogre/DepthShadowmap/CasterVP_HLSL hlsl
+{
+    source DepthShadowmap.hlsl
+    entry_point casterVP
+    target vs_2_0
+
+	preprocessor_defines LINEAR_RANGE=0
+
+    default_params
+    {
+        param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto texelOffsets texel_offsets
+		//param_named_auto depthRange scene_depth_range
+    }
+}
+
+
+fragment_program Ogre/DepthShadowmap/CasterFP_HLSL hlsl
+{
+    source DepthShadowmap.hlsl
+    entry_point casterFP
+    target ps_2_0
+
+	preprocessor_defines LINEAR_RANGE=0
+
+    default_params
+    {
+    }
+}
+
+
+vertex_program Ogre/DepthShadowmap/ReceiverVP_HLSL hlsl
+{
+    source DepthShadowmap.hlsl
+    entry_point receiverVP
+    target vs_2_0
+
+	preprocessor_defines LINEAR_RANGE=0
+
+    default_params
+    {
+        param_named_auto world world_matrix
+        param_named_auto worldIT inverse_transpose_world_matrix
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto texViewProj texture_viewproj_matrix
+		param_named_auto lightPosition light_position 0
+		param_named_auto lightColour light_diffuse_colour 0
+		//param_named_auto shadowDepthRange shadow_scene_depth_range 0
+    }
+}
+
+
+fragment_program Ogre/DepthShadowmap/ReceiverFP_HLSL hlsl
+{
+    source DepthShadowmap.hlsl
+    entry_point receiverFP
+	target ps_2_0
+
+	preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=0
+
+	default_params
+    {
+        param_named inverseShadowmapSize float 0.0009765625
+		param_named fixedDepthBias float 0.0005
+		param_named gradientClamp float 0.0098
+		param_named gradientScaleBias float 0
+		//param_named shadowFuzzyWidth float 1
+    }
+}
+
+fragment_program Ogre/DepthShadowmap/ReceiverFPPCF_HLSL hlsl
+{
+    source DepthShadowmap.hlsl
+    entry_point receiverFP
+	target ps_2_0
+
+	preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=1
+
+	default_params
+    {
+        param_named inverseShadowmapSize float 0.0009765625
+		param_named gradientClamp float 0.0098
+		param_named gradientScaleBias float 0
+		//param_named shadowFuzzyWidth float 1
+    }
+}
+vertex_program Ogre/DepthShadowmap/NormalMapReceiverVP_HLSL hlsl
+{
+    source DepthShadowmap.hlsl
+    entry_point normalMapShadowReceiverVp
+    target vs_2_0
+
+	preprocessor_defines LINEAR_RANGE=0
+
+    default_params
+    {
+        param_named_auto world world_matrix
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto texViewProj texture_viewproj_matrix
+		param_named_auto lightPosition light_position_object_space 0
+		//param_named_auto shadowDepthRange shadow_scene_depth_range 0
+    }
+}
+
+fragment_program Ogre/DepthShadowmap/NormalMapReceiverFP_HLSL hlsl
+{
+    source DepthShadowmap.hlsl
+    entry_point normalMapShadowReceiverFp
+	target ps_2_0
+
+	preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=0
+
+	default_params
+    {
+		param_named_auto lightColour light_diffuse_colour 0
+        param_named inverseShadowmapSize float 0.0009765625
+		param_named fixedDepthBias float 0.0005
+		param_named gradientClamp float 0.0098
+		param_named gradientScaleBias float 0
+		//param_named shadowFuzzyWidth float 1
+    }
+}
+fragment_program Ogre/DepthShadowmap/NormalMapReceiverFPPCF_HLSL hlsl
+{
+    source DepthShadowmap.hlsl
+    entry_point normalMapShadowReceiverFp
+	target ps_2_0
+
+	preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=1
+
+	default_params
+    {
+		param_named_auto lightColour light_diffuse_colour 0
+        param_named inverseShadowmapSize float 0.0009765625
+		param_named fixedDepthBias float 0.0005
+		param_named gradientClamp float 0.0098
+		param_named gradientScaleBias float 0
+		//param_named shadowFuzzyWidth float 1
+    }
+}
+
+
+
+// **-- End HLSL Section --**
+
+// **-- Begin GLSL Section --**
+vertex_program Ogre/DepthShadowmap/CasterVP_GLSL glsl
+{
+    source DepthShadowmapCasterVp.glsl
+
+	preprocessor_defines LINEAR_RANGE=0
+
+    default_params
+    {
+        param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto texelOffsets texel_offsets
+		//param_named_auto depthRange scene_depth_range
+    }
+}
+
+
+fragment_program Ogre/DepthShadowmap/CasterFP_GLSL glsl
+{
+    source DepthShadowmapCasterFp.glsl
+
+	preprocessor_defines LINEAR_RANGE=0
+
+    default_params
+    {
+    }
+}
+
+
+vertex_program Ogre/DepthShadowmap/ReceiverVP_GLSL glsl
+{
+    source DepthShadowmapReceiverVp.glsl
+
+	preprocessor_defines LINEAR_RANGE=0
+
+    default_params
+    {
+        param_named_auto world world_matrix
+        param_named_auto worldIT inverse_transpose_world_matrix
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto texViewProj texture_viewproj_matrix
+		param_named_auto lightPosition light_position 0
+		param_named_auto lightColour light_diffuse_colour 0
+		//param_named_auto shadowDepthRange shadow_scene_depth_range 0
+    }
+}
+
+
+fragment_program Ogre/DepthShadowmap/ReceiverFP_GLSL glsl
+{
+    source DepthShadowmapReceiverFp.glsl
+
+	preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=0
+
+	default_params
+    {
+		param_named shadowMap int 0
+        param_named inverseShadowmapSize float 0.0009765625
+		param_named fixedDepthBias float 0.0005
+		param_named gradientClamp float 0.0098
+		param_named gradientScaleBias float 0
+		//param_named shadowFuzzyWidth float 1
+    }
+}
+
+fragment_program Ogre/DepthShadowmap/ReceiverFPPCF_GLSL glsl
+{
+    source DepthShadowmapReceiverFp.glsl
+
+	preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=1
+
+	default_params
+    {
+        param_named inverseShadowmapSize float 0.0009765625
+		param_named gradientClamp float 0.0098
+		param_named gradientScaleBias float 0
+		//param_named shadowFuzzyWidth float 1
+    }
+}
+vertex_program Ogre/DepthShadowmap/NormalMapReceiverVP_GLSL glsl
+{
+    source DepthShadowmapNormalMapReceiverVp.glsl
+
+	preprocessor_defines LINEAR_RANGE=0
+
+    default_params
+    {
+        param_named_auto world world_matrix
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto texViewProj texture_viewproj_matrix
+		param_named_auto lightPosition light_position_object_space 0
+		//param_named_auto shadowDepthRange shadow_scene_depth_range 0
+    }
+}
+
+fragment_program Ogre/DepthShadowmap/NormalMapReceiverFP_GLSL glsl
+{
+    source DepthShadowmapNormalMapReceiverFp.glsl
+
+	preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=0
+
+	default_params
+    {
+		param_named_auto lightColour light_diffuse_colour 0
+        param_named inverseShadowmapSize float 0.0009765625
+		param_named fixedDepthBias float 0.0005
+		param_named gradientClamp float 0.0098
+		param_named gradientScaleBias float 0
+		//param_named shadowFuzzyWidth float 1
+
+		param_named shadowMap int 0
+		param_named normalMap int 1
+    }
+}
+fragment_program Ogre/DepthShadowmap/NormalMapReceiverFPPCF_GLSL glsl
+{
+    source DepthShadowmapNormalMapReceiverFp.glsl
+
+	preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=1
+
+	default_params
+    {
+		param_named_auto lightColour light_diffuse_colour 0
+        param_named inverseShadowmapSize float 0.0009765625
+		param_named fixedDepthBias float 0.0005
+		param_named gradientClamp float 0.0098
+		param_named gradientScaleBias float 0
+		//param_named shadowFuzzyWidth float 1
+
+		param_named shadowMap int 0
+		param_named normalMap int 1
+    }
+}
+
+// **-- End GLSL Section --**
+
+// **-- Begin Unified Section --**
+vertex_program Ogre/DepthShadowmap/CasterVP unified
+{
+	delegate Ogre/DepthShadowmap/CasterVP_GLSL
+	delegate Ogre/DepthShadowmap/CasterVP_HLSL
+}
+fragment_program Ogre/DepthShadowmap/CasterFP unified
+{
+	delegate Ogre/DepthShadowmap/CasterFP_GLSL
+	delegate Ogre/DepthShadowmap/CasterFP_HLSL
+}
+vertex_program Ogre/DepthShadowmap/ReceiverVP unified
+{
+	delegate Ogre/DepthShadowmap/ReceiverVP_GLSL
+	delegate Ogre/DepthShadowmap/ReceiverVP_HLSL
+}
+fragment_program Ogre/DepthShadowmap/ReceiverFP unified
+{
+	delegate Ogre/DepthShadowmap/ReceiverFP_GLSL
+	delegate Ogre/DepthShadowmap/ReceiverFP_HLSL
+}
+fragment_program Ogre/DepthShadowmap/ReceiverFPPCF unified
+{
+	delegate Ogre/DepthShadowmap/ReceiverFPPCF_GLSL
+	delegate Ogre/DepthShadowmap/ReceiverFPPCF_HLSL
+}
+vertex_program Ogre/DepthShadowmap/NormalMapReceiverVP unified
+{
+	delegate Ogre/DepthShadowmap/NormalMapReceiverVP_HLSL
+	delegate Ogre/DepthShadowmap/NormalMapReceiverVP_GLSL
+}
+vertex_program Ogre/DepthShadowmap/NormalMapReceiverFP unified
+{
+	delegate Ogre/DepthShadowmap/NormalMapReceiverFP_HLSL
+	delegate Ogre/DepthShadowmap/NormalMapReceiverFP_GLSL
+}
+vertex_program Ogre/DepthShadowmap/NormalMapReceiverFPPCF unified
+{
+	delegate Ogre/DepthShadowmap/NormalMapReceiverFPPCF_HLSL
+	delegate Ogre/DepthShadowmap/NormalMapReceiverFPPCF_GLSL
+}
+
+// **-- End Unified Section --**
+
+
+
+// Generic Shadow caster material (floating point shadowmap)
+material Ogre/DepthShadowmap/Caster/Float
+{
+	technique
+    {
+        pass 
+        {
+            vertex_program_ref Ogre/DepthShadowmap/CasterVP
+            {
+            }
+            fragment_program_ref Ogre/DepthShadowmap/CasterFP
+            {
+            }
+        }
+    }
+}
+
+// Generic Shadow receiver material (floating point shadowmap)
+material Ogre/DepthShadowmap/Receiver/Float
+{
+	technique
+    {
+        pass 
+        {
+            vertex_program_ref Ogre/DepthShadowmap/ReceiverVP
+            {
+            }
+            fragment_program_ref Ogre/DepthShadowmap/ReceiverFP
+            {
+            }
+            texture_unit ShadowMap
+            {
+                tex_address_mode clamp
+                filtering none
+            }
+        }
+    }
+}
+
+
+// Specific receiver material for rockwall
+material Ogre/DepthShadowmap/Receiver/RockWall
+{
+
+	// This is the preferred technique which uses both vertex and
+	// fragment programs, supports coloured lights
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0 
+			// Really basic vertex program
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTextureUnified
+			{
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass lighting
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Ogre/DepthShadowmap/ReceiverVP
+			{
+			}
+			shadow_receiver_vertex_program_ref Ogre/DepthShadowmap/ReceiverVP
+			{
+			}
+
+			// Fragment program
+			fragment_program_ref Ogre/DepthShadowmap/ReceiverFP
+			{
+			}
+			shadow_receiver_fragment_program_ref Ogre/DepthShadowmap/ReceiverFP
+			{
+			}
+
+			// shadowmap texture will be bound by code
+
+		}
+		
+		// Decal pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			lighting off
+			// Really basic vertex program
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTextureUnified
+			{
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+
+
+			texture_unit
+			{
+				texture rockwall.tga
+			}
+			
+		}
+	}
+
+
+}
+
+// Specific receiver material for Athene
+material Ogre/DepthShadowmap/Receiver/Athene
+{
+
+	// This is the preferred technique which uses both vertex and
+	// fragment programs, supports coloured lights
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0 
+			// Really basic vertex program
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTextureUnified
+			{
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass lighting
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Ogre/DepthShadowmap/NormalMapReceiverVP
+			{
+			}
+			shadow_receiver_vertex_program_ref Ogre/DepthShadowmap/NormalMapReceiverVP
+			{
+			}
+
+			// Fragment program
+			fragment_program_ref Ogre/DepthShadowmap/NormalMapReceiverFP
+			{
+			}
+			shadow_receiver_fragment_program_ref Ogre/DepthShadowmap/NormalMapReceiverFP
+			{
+			}
+
+			// shadowmap texture will be bound by code
+
+			// Base bump map
+			texture_unit
+			{
+				texture atheneNormalMap.png
+				colour_op replace
+			}
+			// Normalisation cube map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+			}
+
+		}
+		
+		// Decal pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			lighting off
+			// Really basic vertex program
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTextureUnified
+			{
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+
+
+			texture_unit
+			{
+				texture egyptrockyfull.jpg 
+			}
+			
+		}
+	}
+
+
+}
+
+
+
+// Specialisation to use PCF
+material Ogre/DepthShadowmap/Receiver/Float/PCF : Ogre/DepthShadowmap/Receiver/Float
+{
+	technique
+	{
+		pass
+		{
+			// override just receiver program 
+			fragment_program_ref Ogre/DepthShadowmap/ReceiverFPPCF
+			{
+			}
+			
+		}
+	}
+}
+
+// Specialisation to use PCF
+material Ogre/DepthShadowmap/Receiver/RockWall/PCF : Ogre/DepthShadowmap/Receiver/RockWall
+{
+	technique
+	{
+		pass lighting
+		{
+			// override just receiver program 
+			shadow_receiver_fragment_program_ref Ogre/DepthShadowmap/ReceiverFPPCF
+			{
+			}
+			
+		}
+	}
+}
+// Specialisation to use PCF
+material Ogre/DepthShadowmap/Receiver/Athene/PCF : Ogre/DepthShadowmap/Receiver/Athene
+{
+	technique
+	{
+		pass lighting
+		{
+			// override just receiver program 
+			shadow_receiver_fragment_program_ref Ogre/DepthShadowmap/NormalMapReceiverFPPCF
+			{
+			}
+			
+		}
+	}
+}
+
+
Index: /Samples/Media/materials/scripts/Embossed.material
===================================================================
--- /Samples/Media/materials/scripts/Embossed.material	(revision 5)
+++ /Samples/Media/materials/scripts/Embossed.material	(revision 5)
@@ -0,0 +1,33 @@
+fragment_program Ogre/Compositor/Embossed_FP cg
+{
+	source GrayScale.cg
+	entry_point Embossed_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/Embossed
+{
+	technique
+	{
+
+		pass
+		{
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Cg_vp
+			{
+			}
+
+			fragment_program_ref Ogre/Compositor/Embossed_FP
+			{
+			}
+
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+			}
+		}
+	}
+}
Index: /Samples/Media/materials/scripts/Example-DynTex.material
===================================================================
--- /Samples/Media/materials/scripts/Example-DynTex.material	(revision 5)
+++ /Samples/Media/materials/scripts/Example-DynTex.material	(revision 5)
@@ -0,0 +1,86 @@
+
+material Examples/DynaTest
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture DynaTex 2d
+			}
+			depth_write off
+			scene_blend alpha_blend
+			lighting off
+		}
+	}
+}
+
+
+material Examples/DynaTest2
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture DynaTex 2d
+			}
+			diffuse 0.8 0.8 0.8
+			specular 0.7 0.7 0.7 40.0
+			ambient 0.5 0.5 0.5
+		}
+	}
+}
+
+material Examples/DynaTest3
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture DynaTex 2d
+			}
+			diffuse 0.2 0.8 0.8
+			specular 0.4 0.7 0.7 30.0
+			ambient 0.2 0.5 1.0
+			depth_write off
+			scene_blend alpha_blend
+		}
+	}
+}
+
+material Examples/DynaTest4
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture DynaTex 2d
+			}
+			diffuse 0.8 0.8 0.8
+			specular 0.7 0.7 0.4 20.0
+			ambient 1.0 0.5 0.2
+		}
+	}
+}
+
+material Examples/VTDarkStuff
+{
+	technique
+	{
+		pass
+		{
+			diffuse 0.0 0.0 0.0
+			ambient 0.1 0.1 0.15
+			cull_hardware none
+			lighting on
+		}
+		
+	}
+}
Index: /Samples/Media/materials/scripts/Example-Water.material
===================================================================
--- /Samples/Media/materials/scripts/Example-Water.material	(revision 5)
+++ /Samples/Media/materials/scripts/Example-Water.material	(revision 5)
@@ -0,0 +1,183 @@
+
+material Examples/Water0
+{
+	technique
+	{
+		pass
+		{
+			scene_blend colour_blend
+			depth_write off
+
+			texture_unit
+			{
+				texture Water01.jpg
+				env_map spherical
+				scroll_anim 0.01 0.01
+			}
+		}
+	}
+}
+material Examples/Water1
+{
+	technique
+	{
+		pass
+		{
+			scene_blend colour_blend
+			depth_write off
+
+			texture_unit
+			{
+				texture BeachStones.jpg
+				scale 0.25 0.25
+			}
+
+			texture_unit
+			{
+				texture Water01.jpg
+				env_map spherical
+				scroll_anim 0.01 0.01
+			}
+		}
+	}
+}
+material Examples/Water2
+{
+	technique
+	{
+		pass
+		{
+			scene_blend colour_blend
+			depth_write off
+
+			texture_unit
+			{
+				texture Water01.jpg
+				scroll_anim 0.01 0.01
+			}
+		}
+	}
+}
+material Examples/Water3
+{
+	technique
+	{
+		pass
+		{
+			scene_blend colour_blend
+			depth_write off
+
+			texture_unit
+			{
+				texture Water02.jpg
+				env_map spherical
+				scroll_anim 0.01 0.01
+				rotate_anim 0.03
+			}
+		}
+	}
+}
+material Examples/Water4
+{
+	technique
+	{
+		pass
+		{
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture Water02.jpg
+				env_map spherical
+				scroll_anim 0.01 0.01
+			}
+		}
+	}
+}
+material Examples/Water5
+{
+	technique
+	{
+		pass
+		{
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture BeachStones.jpg
+				scale 0.25 0.25
+			}
+
+			texture_unit
+			{
+				texture Water01.jpg
+				env_map spherical
+				scroll_anim 0.01 0.01
+			}
+		}
+	}
+}
+material Examples/Water6
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+
+			texture_unit
+			{
+				cubic_texture cubescene.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
+material Examples/Water7
+{
+	technique
+	{
+		pass
+		{
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture BeachStones.jpg
+				scale 0.25 0.25
+			}
+
+			texture_unit
+			{
+				cubic_texture cubescene.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
+material Examples/Water8
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				cubic_texture cubescene.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
Index: /Samples/Media/materials/scripts/Example.material
===================================================================
--- /Samples/Media/materials/scripts/Example.material	(revision 5)
+++ /Samples/Media/materials/scripts/Example.material	(revision 5)
@@ -0,0 +1,1044 @@
+
+material Examples/EnvMappedRustySteel
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture RustySteel.jpg
+			}
+
+			texture_unit
+			{
+				texture spheremap.png
+				colour_op_ex add src_texture src_current
+				colour_op_multipass_fallback one one
+				env_map spherical
+			}
+		}
+	}
+}
+material Examples/OgreLogo
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.8 0.8 0.8
+
+			texture_unit
+			{
+				texture ogrelogo.png
+			}
+		}
+	}
+}
+material Examples/DarkMaterial
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.1 0.1 0.1
+
+			texture_unit
+			{
+				texture BeachStones.jpg
+			}
+		}
+	}
+}
+material Examples/SpaceSkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture stevecube.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+material Examples/SceneSkyBox1
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture cubemap_fr.jpg cubemap_bk.jpg cubemap_lf.jpg cubemap_rt.jpg cubemap_up.jpg cubemap_dn.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+material Examples/SceneCubeMap1
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+
+			texture_unit
+			{
+				cubic_texture cubemap.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
+material Examples/SceneSkyBox2
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture cubescene_fr.jpg cubescene_bk.jpg cubescene_lf.jpg cubescene_rt.jpg cubescene_up.jpg cubescene_dn.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+material Examples/SceneCubeMap2
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+
+			texture_unit
+			{
+				cubic_texture cubescene.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
+
+material Examples/CloudyNoonSkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture cloudy_noon.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+material Examples/StormySkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture stormy.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+
+fragment_program Examples/MorningSkyBoxHDRfp cg
+{
+	source hdr.cg
+	entry_point morningskybox_fp
+	profiles ps_2_0 arbfp1
+
+}
+material Examples/MorningSkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture morning.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+
+	// HDR technique (fake)
+	technique
+	{
+		scheme HDR
+
+		pass
+		{
+			lighting off
+			depth_write off
+
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			fragment_program_ref Examples/MorningSkyBoxHDRfp
+			{
+			}
+
+			texture_unit
+			{
+				cubic_texture morning.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+fragment_program Examples/MorningCubeMapHDRfp cg
+{
+	source hdr.cg
+	entry_point morningcubemap_fp
+	profiles ps_2_0 arbfp1
+
+}
+material Examples/MorningCubeMap
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+	// HDR technique (fake)
+	technique
+	{
+		scheme HDR
+
+		pass
+		{
+			lighting off
+
+			fragment_program_ref Examples/MorningCubeMapHDRfp
+			{
+			}
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
+
+
+material Examples/EveningSkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture evening.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+material Examples/CloudySky
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				texture clouds.jpg
+				scroll_anim 0.15 0
+			}
+		}
+	}
+}
+material Examples/RustySteel
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture RustySteel.jpg
+			}
+		}
+	}
+}
+material Examples/Chrome
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture Chrome.jpg
+				env_map spherical
+			}
+		}
+	}
+}
+material Examples/SpaceSkyPlane
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+			fog_override true none
+
+			texture_unit
+			{
+				texture spacesky.jpg
+			}
+		}
+	}
+}
+material Examples/TextureEffect1
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.75 0.75 0.75
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture BumpyMetal.jpg
+				rotate_anim 0.2
+				wave_xform scale_x sine 1 0.1 0 5
+				wave_xform scale_y sine 0.5 0.2 0.5 3
+			}
+		}
+	}
+}
+material Examples/TextureEffect2
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture Water02.jpg
+				scroll_anim 0.5 0
+			}
+		}
+	}
+}
+material Examples/TextureEffect3
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.7 0.7 0.7
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture Water01.jpg
+				scroll_anim -0.25 0.1
+			}
+
+			texture_unit
+			{
+				texture Water01.jpg
+				colour_op_ex add src_texture src_current
+				colour_op_multipass_fallback one one
+				scroll_anim -0.1 0.25
+			}
+		}
+	}
+}
+material Examples/TextureEffect4
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.3 0.3 0.3
+			scene_blend colour_blend
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture Water02.jpg
+				scroll_anim 0.01 0.01
+			}
+		}
+	}
+}
+material Examples/BumpyMetal
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.75 0.75 0.75
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture BumpyMetal.jpg
+			}
+		}
+	}
+}
+material Examples/TransparentTest
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.2 0.2 0.2
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture Water01.jpg
+				scroll_anim 0.25 0
+			}
+
+			texture_unit
+			{
+				texture Water01.jpg
+				wave_xform scroll_y sine 0 0.1 0 0.5
+			}
+		}
+	}
+}
+material Examples/Flare
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture flare.png
+			}
+		}
+	}
+}
+material Examples/Flare2
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture flaretrail.png
+			}
+		}
+	}
+}
+material Examples/FlarePointSprite
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			point_sprites on
+			point_size 2
+			point_size_attenuation on
+
+			texture_unit
+			{
+				texture flare.png
+			}
+		}
+	}
+}
+
+material Examples/Droplet
+{
+	technique
+	{
+		pass
+		{
+			scene_blend colour_blend
+			depth_write off
+
+			texture_unit
+			{
+				texture basic_droplet.png
+			}
+		}
+	}
+}
+material Examples/Hilite/Yellow
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture dkyellow.png
+			}
+		}
+	}
+}
+material Examples/Rocky
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.2 0.2 0.2
+
+			texture_unit
+			{
+				texture egyptrockyfull.jpg
+			}
+		}
+	}
+}
+material Examples/10PointBlock
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture 10points.png
+			}
+		}
+	}
+}
+material Material__25
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture texmap2.jpg
+			}
+		}
+	}
+}
+material 2 - Default
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture MtlPlat2.jpg
+			}
+		}
+	}
+}
+material Material #8
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture BODY.jpg
+			}
+		}
+	}
+}
+material Material #3
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture HEAD4.jpg
+			}
+		}
+	}
+}
+material Material #9
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture LEGS.jpg
+			}
+		}
+	}
+}
+
+material Examples/Fish
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture steelhead.png
+			}
+		}
+	}
+}
+material Examples/Ninja
+{
+	technique
+	{
+		pass
+		{
+		
+			texture_unit
+			{
+				texture nskingr.jpg
+			}
+		}
+	}
+}
+
+material Examples/Robot
+{
+	// Hardware skinning techniique
+	technique
+	{
+		pass
+		{
+			vertex_program_ref Ogre/HardwareSkinningOneWeight
+			{
+				param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+				param_named_auto viewProjectionMatrix viewproj_matrix
+				param_named_auto lightPos[0] light_position 0
+				param_named_auto lightPos[1] light_position 1
+				param_named_auto lightDiffuseColour[0] light_diffuse_colour 0
+				param_named_auto lightDiffuseColour[1] light_diffuse_colour 1
+				param_named_auto ambient ambient_light_colour
+			
+			}
+			// alternate shadow caster program
+			shadow_caster_vertex_program_ref Ogre/HardwareSkinningOneWeightShadowCaster
+			{
+				param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+				param_named_auto viewProjectionMatrix viewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			
+			}
+
+			texture_unit
+			{
+				texture r2skin.jpg
+			}
+		}
+	}
+
+	// Software blending technique
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture r2skin.jpg
+			}
+		}
+	}
+}
+
+material Examples/GrassFloor
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture grass_1024.jpg
+			}
+		}
+	}
+}
+
+vertex_program Examples/GrassWaverVp cg
+{
+	source Grass.cg
+	entry_point grass_vp
+	profiles vs_1_1 arbvp1
+}
+
+material Examples/GrassBlades
+{
+	// Vertex program waving grass
+    technique
+    {
+        pass
+        {
+			vertex_program_ref Examples/GrassWaverVp
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+				param_named_auto objSpaceLight light_position_object_space 0
+				param_named_auto lightColour light_diffuse_colour 0
+				param_named_auto offset custom 999
+			}
+			alpha_rejection greater 150 
+			scene_blend alpha_blend
+		    cull_hardware none
+            cull_software none
+            texture_unit
+            {
+                texture gras_02.png 
+            }
+        }
+    }
+
+	// Non-vertex program technique (no waving)
+	technique
+    {
+        pass
+        {
+			alpha_rejection greater 150 
+			scene_blend alpha_blend
+		    cull_hardware none
+            cull_software none
+            texture_unit
+            {
+                texture gras_02.png 
+            }
+        }
+    }
+}
+
+material Examples/Rockwall
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture rockwall.tga
+			}
+		}
+	}
+}
+
+material Examples/Aureola
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_write off
+			cull_hardware none
+
+			texture_unit
+			{
+				texture aureola.png PF_BYTE_LA
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+// Test hardware morph animation
+material Examples/HardwareMorphAnimation
+{
+	technique
+	{
+		pass
+		{
+			
+			vertex_program_ref Ogre/HardwareMorphAnimation
+			{
+				// all default
+			}
+
+			texture_unit
+			{
+				tex_coord_set 0
+				colour_op_ex source1 src_current src_current
+			}
+			// need to define these texture units otherwise GL won't use the uv sets			
+			texture_unit
+			{
+				tex_coord_set 1
+				// also need to set blending to ignore texture which is GL warning texture
+				colour_op_ex source1 src_current src_current
+			}
+			texture_unit
+			{
+				tex_coord_set 2
+				colour_op_ex source1 src_current src_current
+			}
+		
+		}
+	}
+}
+
+// Test hardware pose animation
+material Examples/HardwarePoseAnimation
+{
+	technique
+	{
+		pass
+		{
+			
+			vertex_program_ref Ogre/HardwarePoseAnimation
+			{
+				// all default
+			}
+			texture_unit
+			{
+				tex_coord_set 0
+				colour_op_ex source1 src_current src_current
+			}
+			// need to define these texture units otherwise GL won't use the uv sets			
+			texture_unit
+			{
+				tex_coord_set 1
+				// also need to set blending to ignore texture which is GL warning texture
+				colour_op_ex source1 src_current src_current
+			}
+			texture_unit
+			{
+				tex_coord_set 2
+				colour_op_ex source1 src_current src_current
+			}
+
+		
+		}
+	}
+}
+
+material RustyBarrel
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.5 0.5 0.5 1.0
+			diffuse 1.0 1.0 1.0 1.0
+			specular 0.0 0.0 0.0 1.0 12.5
+			emissive 0.0 0.0 0.0 1.0
+			texture_unit
+			{
+				texture RustyBarrel.png
+				filtering trilinear
+			}
+		}
+	}
+}
+
+material WoodPallet
+{
+	receive_shadows on
+	technique
+	{
+		pass
+		{
+			ambient 0.5 0.5 0.5 1.0
+			diffuse 1.0 1.0 1.0 1.0
+			specular 0.0 0.0 0.0 1.0 12.5
+
+			texture_unit
+			{
+				texture WoodPallet.png
+				filtering trilinear
+			}
+		}
+	}
+}
+
+material Examples/LightRibbonTrail
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture ribbonband.png 1d
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
+
+material Examples/TudorHouse
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture fw12b.jpg
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+material jaiqua
+{
+	// Hardware skinning techniique
+	technique
+	{
+		pass
+		{
+			vertex_program_ref Ogre/HardwareSkinningTwoWeights
+			{
+			
+			}
+			// alternate shadow caster program
+			shadow_caster_vertex_program_ref Ogre/HardwareSkinningTwoWeightsShadowCaster
+			{
+				param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+				param_named_auto viewProjectionMatrix viewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			
+			}
+
+			texture_unit
+			{
+				texture blue_jaiqua.jpg
+				tex_address_mode clamp
+			}
+		}
+	}
+
+	// Software blending technique
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture blue_jaiqua.jpg
+				tex_address_mode clamp
+			}
+		}
+	}
+	
+}
+
+
+material Examples/Plane/IntegratedShadows
+{
+	technique
+	{
+		pass
+		{
+			// Single-pass shadowing
+			texture_unit
+			{
+				texture MtlPlat2.jpg
+			}
+			texture_unit
+			{
+				// standard modulation blend
+				content_type shadow
+				tex_address_mode clamp
+			}
+		}
+	}
+	
+}
Index: /Samples/Media/materials/scripts/Examples-Advanced.material
===================================================================
--- /Samples/Media/materials/scripts/Examples-Advanced.material	(revision 5)
+++ /Samples/Media/materials/scripts/Examples-Advanced.material	(revision 5)
@@ -0,0 +1,1167 @@
+// -------------------------------
+// Cel Shading Section
+// -------------------------------
+vertex_program Ogre/CelShadingVP cg
+{
+	source Example_CelShading.cg
+	entry_point main_vp
+	profiles vs_1_1 arbvp1
+
+	default_params
+	{
+		param_named_auto lightPosition light_position_object_space 0
+		param_named_auto eyePosition camera_position_object_space
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named shininess float 10 
+	}
+}
+
+fragment_program Ogre/CelShadingFP cg
+{
+	source Example_CelShading.cg
+	entry_point main_fp
+	profiles ps_1_1 arbfp1 fp20
+}
+
+
+material Examples/CelShading
+{
+	technique
+	{
+		pass
+		{
+			vertex_program_ref Ogre/CelShadingVP
+			{
+				// map shininess from custom renderable param 1
+				param_named_auto shininess custom 1
+			}
+			fragment_program_ref Ogre/CelShadingFP
+			{
+				// map diffuse from custom renderable param 2
+				param_named_auto diffuse custom 2
+				// map specular from custom renderable param 2
+				param_named_auto specular custom 3
+			}
+			texture_unit
+			{
+				texture cel_shading_diffuse.png 1d
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				texture cel_shading_specular.png 1d
+				tex_address_mode clamp
+				filtering none
+				tex_coord_set 1
+			}
+			texture_unit
+			{
+				texture cel_shading_edge.png 1d
+				tex_address_mode clamp
+				filtering none
+				tex_coord_set 2
+			}
+		}
+	}
+	
+}
+
+
+
+//------------------------
+// Bump mapping section
+//------------------------
+
+// Bump map vertex program, support for this is required
+vertex_program Examples/BumpMapVP cg
+{
+	source Example_BumpMapping.cg
+	entry_point main_vp
+	profiles vs_1_1 arbvp1
+}
+
+// Bump map fragment program, support for this is optional
+fragment_program Examples/BumpMapFP cg
+{
+	source Example_BumpMapping.cg
+	entry_point main_fp
+	profiles ps_1_1 arbfp1 fp20
+}
+
+// Bump map vertex program shadow receiver
+vertex_program Examples/BumpMapVPShadowRcv cg
+{
+	source Example_BumpMapping.cg
+	entry_point main_shadowreceiver_vp
+	profiles vs_1_1 arbvp1
+}
+// Bump map fragment program shadow receiver, support for this is optional
+fragment_program Examples/BumpMapFPShadowRcv cg
+{
+	source Example_BumpMapping.cg
+	entry_point main_shadowreceiver_fp
+	profiles ps_1_1 arbfp1 fp20
+}
+
+
+// Bump map with specular vertex program, support for this is required
+vertex_program Examples/BumpMapVPSpecular cg
+{
+	source Example_BumpMapping.cg
+	entry_point specular_vp
+	profiles vs_1_1 arbvp1
+}
+
+// Bump map fragment program, support for this is optional
+fragment_program Examples/BumpMapFPSpecular cg
+{
+	source Example_BumpMapping.cg
+	entry_point specular_fp
+	profiles ps_1_1 arbfp1 fp20
+}
+
+// Single light material, less passes (one pass on a 4-unit card)
+material Examples/BumpMapping/SingleLight
+{
+	// Preferred technique, uses vertex and fragment programs
+	// to support a single coloured light
+	technique
+	{
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVP
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+
+			// Fragment program
+			fragment_program_ref Examples/BumpMapFP
+			{
+				param_named_auto lightDiffuse light_diffuse_colour 0 
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture NMBumpsOut.png
+				colour_op replace
+			}
+			// Normalisation cube map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+			}
+			// Decal
+			texture_unit
+			{
+				texture RustySteel.jpg
+			}
+		}
+	}
+	// Fallback technique, uses vertex program but only fixed-function
+	// fragment shading, which does not support coloured light
+	technique
+	{
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVP
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+
+			// Base bump map
+			texture_unit
+			{
+				texture NMBumpsOut.png
+				colour_op replace
+			}
+			// Normalisation cube map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+				colour_op_ex dotproduct src_texture src_current
+				colour_op_multipass_fallback dest_colour zero
+			}
+			// Decal
+			texture_unit
+			{
+				texture RustySteel.jpg
+			}
+		}
+	}
+}
+
+// Any number of lights, diffuse
+material Examples/BumpMapping/MultiLight
+{
+
+	// This is the preferred technique which uses both vertex and
+	// fragment programs, supports coloured lights
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0 
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVP
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+
+			// Fragment program
+			fragment_program_ref Examples/BumpMapFP
+			{
+				param_named_auto lightDiffuse light_diffuse_colour 0 
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture NMBumpsOut.png
+				colour_op replace
+			}
+			// Normalisation cube map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+			}
+		}
+		
+		// Decal pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			lighting off
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+			texture_unit
+			{
+				texture RustedMetal.jpg 
+			}
+			
+		}
+	}
+
+	// This is the fallback which cards which don't have fragment program 
+	// support will use
+	// Note that it still requires vertex program support
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVP
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture NMBumpsOut.png
+				colour_op replace
+			}
+			// Normalisation cube map, with dot product on bump map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+				colour_op_ex dotproduct src_texture src_current
+				colour_op_multipass_fallback dest_colour zero
+			}
+		}
+		
+		// Decal pass
+		pass
+		{
+			lighting off
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+			texture_unit
+			{
+				texture RustedMetal.jpg 
+			}
+			
+		}
+
+	}
+}
+
+// Any number of lights, diffuse and specular
+material Examples/BumpMapping/MultiLightSpecular
+{
+
+	// This is the preferred technique which uses both vertex and
+	// fragment programs, supports coloured lights
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVPSpecular
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto eyePosition camera_position_object_space
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+
+			// Fragment program
+			fragment_program_ref Examples/BumpMapFPSpecular
+			{
+				param_named_auto lightDiffuse light_diffuse_colour 0 
+				param_named_auto lightSpecular light_specular_colour 0
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture NMBumpsOut.png
+				colour_op replace
+			}
+			// Normalisation cube map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+			}
+			// Normalisation cube map #2
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 2
+				tex_address_mode clamp
+			}
+		}
+		
+		// Decal pass
+		pass
+		{
+			lighting off
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+			texture_unit
+			{
+				texture RustedMetal.jpg 
+			}
+			
+		}
+	}
+
+	// This is the fallback which cards which don't have fragment program 
+	// support will use, NB does not support specular colour
+	// Note that it still requires vertex program support
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVP
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture NMBumpsOut.png
+				colour_op replace
+			}
+			// Normalisation cube map, with dot product on bump map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+				colour_op_ex dotproduct src_texture src_current
+				colour_op_multipass_fallback dest_colour zero
+			}
+		}
+		
+		// Decal pass
+		pass
+		{
+			lighting off
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+			texture_unit
+			{
+				texture RustedMetal.jpg 
+			}
+			
+		}
+
+	}
+}
+
+//---------------------------
+// Projective texture section
+//---------------------------
+
+
+vertex_program Examples/TexProjectionVP cg
+{
+	source Example_Projection.cg
+	entry_point generalPurposeProjection_vp
+	profiles vs_1_1 arbvp1
+}
+
+fragment_program Examples/TexProjectionFP cg
+{
+	source Example_Projection.cg
+	entry_point generalPurposeProjection_fp
+	// sorry, ps_1_1 can't do this, fp20 can though
+	profiles ps_2_0 arbfp1 fp20
+}
+
+material Examples/GeneralTexProjection
+{
+	technique
+	{
+		pass 
+		{
+			
+			vertex_program_ref Examples/TexProjectionVP
+			{
+				param_named_auto worldViewProjMatrix worldviewproj_matrix
+				param_named_auto worldMatrix world_matrix
+				// You'll need to update the tex projection, I suggest using
+				// the Frustum class
+				//param_named_auto texWorldViewProj worldviewproj_matrix
+			}
+			fragment_program_ref Examples/TexProjectionFP
+			{
+				// no params
+			}
+			texture_unit
+			{
+				// Project the OGRE logo
+				texture ogrelogo.png
+				tex_address_mode clamp
+			}
+		}
+		
+			
+	}
+    
+}
+
+//----------------------------
+// Distortion effects
+//----------------------------
+
+vertex_program Examples/FresnelRefractReflectVP cg
+{
+	source Example_Fresnel.cg
+	entry_point main_vp
+	profiles vs_1_1 arbvp1
+}
+vertex_program Examples/FresnelRefractReflectVPold cg
+{
+	source Example_Fresnel.cg
+	entry_point main_vp_old
+	profiles vs_1_1 arbvp1
+}
+
+fragment_program Examples/FresnelRefractReflectFP cg
+{
+	source Example_Fresnel.cg
+	entry_point main_fp
+	// sorry, ps_1_1 and fp20 can't do this
+	profiles ps_2_0 arbfp1
+}
+
+fragment_program Examples/FresnelRefractReflectPS asm
+{
+	source Example_FresnelPS.asm
+	// sorry, only for ps_1_4 :)
+	syntax ps_1_4
+
+}
+
+material Examples/FresnelReflectionRefraction
+{
+	// ps_2_0 / arbfp1
+	technique
+	{
+		pass 
+		{
+			
+			vertex_program_ref Examples/FresnelRefractReflectVP
+			{
+				param_named_auto worldViewProjMatrix worldviewproj_matrix
+				param_named_auto eyePosition camera_position_object_space
+				param_named_auto timeVal time 0.05
+				param_named scroll float 1  
+				param_named scale float 1 
+				param_named noise float 1 
+				// scroll and noisePos will need updating per frame
+			}
+			fragment_program_ref Examples/FresnelRefractReflectFP
+			{
+				param_named fresnelBias float -0.1 
+				param_named fresnelScale float 1.8 
+				param_named fresnelPower float 8  
+				param_named tintColour float4 0 0.0.05 0.05 1
+				param_named noiseScale float 0.05 
+			}
+			// Noise
+			texture_unit
+			{
+				// Perlin noise volume
+				texture waves2.dds
+				// min / mag filtering, no mip
+				filtering linear linear none
+			}
+			// Reflection
+			texture_unit
+			{
+				// Will be filled in at runtime
+				texture Reflection
+				tex_address_mode clamp
+				// needed by ps.1.4
+				tex_coord_set 1
+			}
+			// Refraction
+			texture_unit
+			{
+				// Will be filled in at runtime
+				texture Refraction
+				tex_address_mode clamp
+				// needed by ps.1.4
+				tex_coord_set 2
+			}
+		}
+		
+			
+	}
+
+	// ATI 8500 +
+	technique
+	{
+		pass
+		{
+			vertex_program_ref Examples/FresnelRefractReflectVPold
+			{
+				param_named_auto worldViewProjMatrix worldviewproj_matrix
+				param_named_auto eyePosition camera_position_object_space
+				param_named fresnelBias float -0.3
+				param_named fresnelScale float 1.4
+				param_named fresnelPower float 8
+				param_named_auto timeVal time_0_1 20
+				param_named scroll float 1 
+				param_named scale float 4 
+				param_named noise float 1
+				// scroll and noisePos will need updating per frame
+			}
+
+			// for ATI RADEON 8500 - 9200
+			fragment_program_ref Examples/FresnelRefractReflectPS
+			{
+				// distortionRange
+				param_indexed 0  float 0.025  
+				// tintColour
+				param_indexed 1  float4 0.05 0.12 0.15 1
+			}
+
+			// Noise
+			texture_unit
+			{
+				// Perlin noise volume
+				texture perlinvolume.dds 3d
+				// min / mag filtering, no mip
+				filtering linear linear none
+			}
+			// Reflection
+			texture_unit
+			{
+				// Will be filled in at runtime
+				texture Reflection
+				tex_address_mode clamp
+				// needed by ps.1.4
+				tex_coord_set 1
+			}
+			// Refraction
+			texture_unit
+			{
+				// Will be filled in at runtime
+				texture Refraction
+				tex_address_mode clamp
+				// needed by ps.1.4
+				tex_coord_set 2
+			}
+		}
+	}    
+}
+
+// Normal-mapped Athene statue
+material Examples/Athene/NormalMapped
+{
+
+	// This is the preferred technique which uses both vertex and
+	// fragment programs, supports coloured lights
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0 
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVP
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+
+			// Fragment program
+			fragment_program_ref Examples/BumpMapFP
+			{
+				param_named_auto lightDiffuse light_diffuse_colour 0 
+			}
+
+			// texture shadow receiver program
+			shadow_receiver_vertex_program_ref Examples/BumpMapVPShadowRcv
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto worldMatrix world_matrix
+				param_named_auto texViewProj texture_viewproj_matrix
+			}
+			// Additive texture shadow receiver program
+			shadow_receiver_fragment_program_ref Examples/BumpMapFPShadowRcv
+			{
+				param_named_auto lightDiffuse light_diffuse_colour 0 
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture atheneNormalMap.png
+				colour_op replace
+			}
+			// Normalisation cube map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+			}
+		}
+		
+		// Decal pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			lighting off
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+			texture_unit
+			{
+				texture egyptrockyfull.jpg 
+			}
+			
+		}
+	}
+
+	// This is the fallback which cards which don't have fragment program 
+	// support will use
+	// Note that it still requires vertex program support
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVP
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture atheneNormalMap.png
+				colour_op replace
+			}
+			// Normalisation cube map, with dot product on bump map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+				colour_op_ex dotproduct src_texture src_current
+				colour_op_multipass_fallback dest_colour zero
+			}
+		}
+		
+		// Decal pass
+		pass
+		{
+			lighting off
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+			texture_unit
+			{
+				texture egyptrockyfull.jpg
+			}
+			
+		}
+
+	}
+}
+
+// Basic Athene statue
+material Examples/Athene/Basic
+{
+
+	technique
+	{
+		pass
+		{
+			ambient 0.3 0.3 0.3
+			diffuse 1.0 1.0 0.9
+
+			texture_unit
+			{
+				texture egyptrockyfull.jpg 
+			}
+			
+		}
+	}
+}
+
+
+// Any number of lights, diffuse and specular
+material Examples/Athene/NormalMappedSpecular
+{
+
+	// This is the preferred technique which uses both vertex and
+	// fragment programs, supports coloured lights
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVPSpecular
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto eyePosition camera_position_object_space
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+
+			// Fragment program
+			fragment_program_ref Examples/BumpMapFPSpecular
+			{
+				param_named_auto lightDiffuse light_diffuse_colour 0 
+				param_named_auto lightSpecular light_specular_colour 0
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture atheneNormalMap.png
+				colour_op replace
+			}
+			// Normalisation cube map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+			}
+			// Normalisation cube map #2
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 2
+				tex_address_mode clamp
+			}
+		}
+		
+		// Decal pass
+		pass
+		{
+			lighting off
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+			texture_unit
+			{
+				texture egyptrockyfull.jpg 
+			}
+			
+		}
+	}
+
+	// This is the fallback which cards which don't have fragment program 
+	// support will use, NB does not support specular colour
+	// Note that it still requires vertex program support
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVP
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture atheneNormalMap.png
+				colour_op replace
+			}
+			// Normalisation cube map, with dot product on bump map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+				colour_op_ex dotproduct src_texture src_current
+				colour_op_multipass_fallback dest_colour zero
+			}
+		}
+		
+		// Decal pass
+		pass
+		{
+			lighting off
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+			texture_unit
+			{
+				texture egyptrockyfull.jpg 
+			}
+			
+		}
+
+	}
+}
+
Index: /Samples/Media/materials/scripts/Examples.compositor
===================================================================
--- /Samples/Media/materials/scripts/Examples.compositor	(revision 5)
+++ /Samples/Media/materials/scripts/Examples.compositor	(revision 5)
@@ -0,0 +1,592 @@
+// Manuel's bloom
+// Needs a scene-sized rtt, but does only one render of the scene
+compositor Bloom
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 128 128 PF_A8R8G8B8
+        texture rt1 128 128 PF_A8R8G8B8
+
+        target rt1
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target rt0
+        {
+            // Start with clear texture
+            input none
+            // Vertical blur pass
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Blur0
+                input 0 rt1
+            }
+        }
+
+        target rt1
+        {
+            // Start with clear texture
+            input none
+            // Horizontal blur pass
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Blur1
+                input 0 rt0
+            }
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input previous
+            // Draw a fullscreen quad
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/BloomBlend
+                input 0 rt1
+            }
+        }
+    }
+}
+
+compositor Glass
+{
+    technique
+    {
+        texture rt0 target_width target_height PF_R8G8B8
+
+        target rt0 { input previous }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+
+            pass render_quad
+            {
+                material Ogre/Compositor/GlassPass
+                input 0 rt0
+            }
+        }
+    }
+}
+
+compositor "Old TV"
+{
+    technique
+    {
+        texture rt0 target_width target_height PF_R8G8B8
+
+        // render scene to a texture
+        target rt0 { input previous }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+
+            pass render_quad
+            {
+                // convert the previous render target to a black and white image, add some noise, distort it,
+                // then render to scene aligned quad
+                material Ogre/Compositor/OldTV
+                input 0 rt0
+            }
+        }
+    }
+}
+
+
+// Black and white effect
+compositor B&W
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/BlackAndWhite
+                input 0 rt0
+            }
+        }
+    }
+}
+
+//compositor DOF // based on Blur but final pass does depth of field
+//{
+//    technique
+//    {
+//        // Temporary textures
+//        texture rt0 target_width target_height PF_A8R8G8B8
+//        texture rt1 target_width target_height PF_A8R8G8B8
+//
+//        target rt1
+//        {
+//            // Render output from previous compositor (or original scene)
+//            input previous
+//        }
+//
+//        target rt0
+//        {
+//            // Start with clear texture
+//            input none
+//            // Vertical blur pass
+//            pass render_quad
+//            {
+//                // Renders a fullscreen quad with a material
+//                material Ogre/Compositor/DOF_Blur0
+//                input 0 rt1
+//            }
+//        }
+//
+//        target rt1
+//        {
+//            // Start with clear texture
+//            input none
+//            // Horizontal blur pass
+//            pass render_quad
+//            {
+//                // Renders a fullscreen quad with a material
+//                material Ogre/Compositor/DOF_Blur1
+//                input 0 rt0
+//            }
+//        }
+//
+//        target_output
+//        {
+//            // Start with clear output
+//            input none
+//            // Draw a fullscreen quad
+//            pass render_quad
+//            {
+//                // Renders a fullscreen quad with a material
+//                material Ogre/Compositor/DOF_Blend
+//                input 0 rt0
+//                input 1 rt1
+//            }
+//        }
+//    }
+//}
+
+// Embossed (fake bump) effect
+compositor Embossed
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Embossed
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// SharpenEdges
+compositor Sharpen Edges
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/SharpenEdges
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Invert
+compositor Invert
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Invert
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Posterize
+compositor Posterize
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Posterize
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Laplace
+compositor Laplace
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Laplace
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Tiling
+compositor Tiling
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Tiling
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Old Movie
+compositor Old Movie
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/OldMovie
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// HDR
+compositor HDR
+{
+	// floating point only for now
+	technique
+	{
+        // Temporary textures
+		// Fullsize HDR render target, used as tone mapping source
+        texture rt_full target_width target_height PF_FLOAT16_RGB
+		// Targets used for luminance evaluation (3x3 downsample, point filtering)
+		texture rt_lum0 1 1 PF_FLOAT16_RGB
+		texture rt_lum1 4 4 PF_FLOAT16_RGB
+		texture rt_lum2 16 16 PF_FLOAT16_RGB
+		texture rt_lum3 64 64 PF_FLOAT16_RGB
+		texture rt_lum4 128 128 PF_FLOAT16_RGB
+		// Bright-pass filtered target (tone mapped)
+		texture rt_brightpass 128 128 PF_R8G8B8
+		// Bloom filter targets
+		texture rt_bloom0 128 128 PF_R8G8B8
+		texture rt_bloom1 128 128 PF_R8G8B8
+
+
+		target rt_full
+		{
+			// No input, render differently
+			input none
+
+			// Use float target HDR material scheme (unclamped shaders)
+			material_scheme HDR
+
+			pass clear
+			{
+			}
+
+			pass render_scene
+			{
+			}
+
+		}
+
+		// Downsample the original HDR scene to extract luminence value
+		target rt_lum4
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 2x2 filter and convert to greyscale
+                material Ogre/Compositor/HDR/Downsample2x2Luminence
+                input 0 rt_full
+                identifier 994
+            }
+		}
+		target rt_lum3
+		{
+            input none
+            pass render_quad
+            {
+				// Downsample using a 3x3 filter
+                material Ogre/Compositor/HDR/Downsample3x3
+                input 0 rt_lum4
+                identifier 993
+            }
+		}
+		target rt_lum2
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 3x3 filter
+                material Ogre/Compositor/HDR/Downsample3x3
+                input 0 rt_lum3
+                identifier 992
+            }
+		}
+		target rt_lum1
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 3x3 filter
+                material Ogre/Compositor/HDR/Downsample3x3
+                input 0 rt_lum2
+                identifier 991
+            }
+		}
+		target rt_lum0
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 3x3 filter
+                material Ogre/Compositor/HDR/Downsample3x3
+                input 0 rt_lum1
+                identifier 990
+            }
+		}
+
+
+		target rt_brightpass
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 3x3 filter, hi-pass and tone map
+                material Ogre/Compositor/HDR/Downsample3x3Brightpass
+                input 0 rt_full
+		        input 1 rt_lum0
+				identifier 800
+            }
+		}
+
+		target rt_bloom1
+		{
+			input none
+			pass render_quad
+			{
+				// Blur horizontally
+				material Ogre/Compositor/HDR/GaussianBloom
+				input 0 rt_brightpass
+				identifier 701
+			}
+		}
+		target rt_bloom0
+		{
+			input none
+			pass render_quad
+			{
+				// Blur horizontally
+				material Ogre/Compositor/HDR/GaussianBloom
+				input 0 rt_bloom1
+				identifier 700
+			}
+		}
+
+
+		// Final output combines tone mapping of the original scene, with an
+		// exposure setting passed in as a GPU parameter, and an additive bloom
+		// effect
+		target_output
+		{
+			input none
+			pass render_quad
+			{
+				material Ogre/Compositor/HDR/ToneMapping
+				input 0 rt_full
+				input 1 rt_bloom0
+				input 2 rt_lum0
+			}
+		}
+
+
+	}
+
+}
+
+
+// Gaussian blur effect
+compositor Gaussian Blur
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+        texture rt1 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target rt1
+        {
+            // Blur horizontally
+            input none
+			pass render_quad
+			{
+				material Ogre/Compositor/HDR/GaussianBloom
+				input 0 rt0
+				identifier 700
+			}
+        }
+
+		target_output
+        {
+            // Start with clear output
+            input none
+            // Blur vertically
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+				material Ogre/Compositor/HDR/GaussianBloom
+                input 0 rt1
+				identifier 701
+            }
+        }
+    }
+}
+
Index: /Samples/Media/materials/scripts/Examples.program
===================================================================
--- /Samples/Media/materials/scripts/Examples.program	(revision 5)
+++ /Samples/Media/materials/scripts/Examples.program	(revision 5)
@@ -0,0 +1,158 @@
+//---------------------------------------------------
+// This file includes a number of basic GPU programs
+// for use in many materials. 
+//---------------------------------------------------
+
+
+// A really basic ambient pass program, support for one texture coodinate set
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTexture cg
+{
+	source Example_Basic.cg
+	entry_point ambientOneTexture_vp
+	profiles vs_1_1 arbvp1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto ambient ambient_light_colour
+	}
+	
+}
+// A really basic ambient pass program, support for one texture coodinate set
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureHLSL hlsl
+{
+	source Example_Basic.hlsl
+	entry_point ambientOneTexture_vp
+	target vs_1_1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto ambient ambient_light_colour
+	}
+}
+// A really basic ambient pass program, support for one texture coodinate set
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureGLSL glsl
+{
+	source AmbientOneTexture.glsl
+
+	default_params
+	{
+		param_named_auto ambient ambient_light_colour
+	}
+}
+
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureUnified unified
+{
+	delegate Ogre/BasicVertexPrograms/AmbientOneTextureGLSL
+	delegate Ogre/BasicVertexPrograms/AmbientOneTextureHLSL
+}
+
+
+// Same as below, but for use when rendering texture shadows
+vertex_program Ogre/HardwareSkinningOneWeightShadowCaster cg
+{
+	source Example_Basic.cg
+	entry_point hardwareSkinningOneWeightCaster_vp
+	profiles vs_1_1 arbvp1
+	includes_skeletal_animation true
+}
+// Basic hardware skinning using one indexed weight per vertex
+vertex_program Ogre/HardwareSkinningOneWeight cg
+{
+   source Example_Basic.cg
+   entry_point hardwareSkinningOneWeight_vp
+   profiles vs_1_1 arbvp1
+   includes_skeletal_animation true   
+}
+// Same as below, but for use when rendering texture shadows
+vertex_program Ogre/HardwareSkinningTwoWeightsShadowCasterCg cg
+{
+	source Example_Basic.cg
+	entry_point hardwareSkinningTwoWeightsCaster_vp
+	profiles vs_1_1 arbvp1
+	includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeightsShadowCasterGLSL glsl
+{
+	source skinningTwoWeightsShadowCasterVp.glsl
+	includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeightsShadowCaster unified
+{
+	delegate Ogre/HardwareSkinningTwoWeightsShadowCasterGLSL
+	delegate Ogre/HardwareSkinningTwoWeightsShadowCasterCg
+}
+
+// Basic hardware skinning using two indexed weights per vertex
+vertex_program Ogre/HardwareSkinningTwoWeightsCg cg
+{
+   source Example_Basic.cg
+   entry_point hardwareSkinningTwoWeights_vp
+   profiles vs_1_1 arbvp1
+   includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeightsGLSL glsl
+{
+   source skinningTwoWeightsVp.glsl
+   includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeights unified
+{
+	delegate Ogre/HardwareSkinningTwoWeightsGLSL
+	delegate Ogre/HardwareSkinningTwoWeightsCg
+	
+   default_params
+   {
+   		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto lightPos[0] light_position 0
+		param_named_auto lightPos[1] light_position 1
+		param_named_auto lightDiffuseColour[0] light_diffuse_colour 0
+		param_named_auto lightDiffuseColour[1] light_diffuse_colour 1
+   }
+}
+
+// Basic hardware skinning using four indexed weights per vertex
+vertex_program Ogre/HardwareSkinningFourWeights cg
+{
+   source Example_Basic.cg
+   entry_point hardwareSkinningFourWeights_vp
+   profiles vs_1_1 arbvp1
+   includes_skeletal_animation true
+
+}
+// Basic hardware morph animation 
+vertex_program Ogre/HardwareMorphAnimation cg
+{
+	source Example_Basic.cg
+	entry_point hardwareMorphAnimation
+	profiles vs_1_1 arbvp1
+
+	includes_morph_animation true
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto anim_t animation_parametric
+	}
+}
+// Basic hardware pose animation supporting 2 active poses
+vertex_program Ogre/HardwarePoseAnimation cg
+{
+	source Example_Basic.cg
+	entry_point hardwarePoseAnimation
+	profiles vs_1_1 arbvp1
+
+	includes_pose_animation 2
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto anim_t animation_parametric
+	}
+}
+
+
Index: /Samples/Media/materials/scripts/Glass.material
===================================================================
--- /Samples/Media/materials/scripts/Glass.material	(revision 5)
+++ /Samples/Media/materials/scripts/Glass.material	(revision 5)
@@ -0,0 +1,40 @@
+fragment_program Ogre/Compositor/GlassFP cg
+{
+	source GlassFP.cg
+	entry_point main_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/GlassPass
+{
+	technique
+	{
+		pass
+		{
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Cg_vp
+			{
+			}
+
+			fragment_program_ref Ogre/Compositor/GlassFP
+			{
+			}
+
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+			}
+
+			texture_unit
+			{
+				texture WaterNormal1.tga 2d
+                tex_coord_set 1
+				//tex_address_mode clamp
+				filtering linear linear linear
+			}
+		}
+	}
+}
Index: /Samples/Media/materials/scripts/HeatVision.material
===================================================================
--- /Samples/Media/materials/scripts/HeatVision.material	(revision 5)
+++ /Samples/Media/materials/scripts/HeatVision.material	(revision 5)
@@ -0,0 +1,209 @@
+///////////////////////////////////
+//			 PASS 0
+//		HEAT CASTERS PASS
+///////////////////////////////////
+
+vertex_program Fury/HeatVision/HeatCaster_vp cg
+{
+   source HeatVision.cg
+   entry_point HeatCaster_vp
+   profiles vs_1_1 arbvp1
+}
+
+fragment_program Fury/HeatVision/HeatCaster_fp cg
+{
+   source HeatVision.cg
+   entry_point HeatCaster_fp
+   profiles ps_2_0 arbfp1
+}
+
+material Fury/HeatVision/HeatCaster
+{
+    technique
+    {
+        pass
+        {
+            vertex_program_ref Fury/HeatVision/HeatCaster_vp
+            {
+                param_named_auto eyePosition camera_position_object_space
+                param_named_auto worldViewProj worldviewproj_matrix
+            }
+
+            fragment_program_ref Fury/HeatVision/HeatCaster_fp
+            {
+            }
+        }
+    }
+}
+
+///////////////////////////////////
+//			 PASS 0
+//		HEAT CASTERS PASS
+///////////////////////////////////
+
+vertex_program Fury/HeatVision/ColdCaster_vp cg
+{
+   source HeatVision.cg
+   entry_point ColdCaster_vp
+   profiles vs_1_1 arbvp1
+}
+
+fragment_program Fury/HeatVision/ColdCaster_fp cg
+{
+   source HeatVision.cg
+   entry_point ColdCaster_fp
+   profiles ps_2_0 arbfp1
+}
+
+material Fury/HeatVision/ColdCaster
+{
+    technique
+    {
+        pass
+        {
+            vertex_program_ref Fury/HeatVision/ColdCaster_vp
+            {
+                param_named_auto eyePosition camera_position_object_space
+                param_named_auto worldViewProj worldviewproj_matrix
+            }
+
+            fragment_program_ref Fury/HeatVision/ColdCaster_fp
+            {
+            }
+        }
+    }
+}
+
+///////////////////////////////////
+//			  PASS 1
+//  LIGHT TO HEAT CONVERSION PASS
+///////////////////////////////////
+
+vertex_program Fury/HeatVision/LightToHeat_vp cg
+{
+   source HeatVision.cg
+   entry_point LightToHeat_vp
+   profiles vs_1_1 arbvp1
+
+    default_params
+    {
+        param_named_auto flipping render_target_flipping
+    }
+}
+
+fragment_program Fury/HeatVision/LightToHeat_fp cg
+{
+   source HeatVision.cg
+   entry_point LightToHeat_fp
+   profiles ps_2_0 arbfp1
+}
+
+material Fury/HeatVision/LightToHeat
+{
+    technique
+    {
+        // pass 1
+        pass
+        {
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+            vertex_program_ref Fury/HeatVision/LightToHeat_vp
+            {
+            }
+
+            fragment_program_ref Fury/HeatVision/LightToHeat_fp
+            {
+                // these should be *really* random!
+                param_named random_fractions float4 0.3 0.7 0 0
+
+                param_named depth_modulator float4 0.6 0 0 0
+
+                // this one can be fixed
+                param_named heatBiasScale float4 0.0 1.0 0 0
+            }
+
+            // INPUT (from scene, where entities has "Fury/HeatVision/Caster" material for heat emanation)
+            texture_unit
+            {
+                tex_coord_set 0
+                filtering linear linear none
+                tex_address_mode clamp
+            }
+
+            // Noise map
+            texture_unit
+            {
+                texture HeatNoise.tga
+                tex_coord_set 0
+            }
+
+            // heat conversion texture
+            texture_unit
+            {
+                texture HeatLookup.tga
+                tex_coord_set 0
+                filtering point point none
+            }
+        }
+    }
+
+}
+
+
+///////////////////////////////////
+//			  PASS 2
+//			 BLUR PASS
+///////////////////////////////////
+
+vertex_program Fury/HeatVision/Blur_vp cg
+{
+   source HeatVision.cg
+   entry_point Blur_vp
+   profiles vs_1_1 arbvp1
+
+    default_params
+    {
+        param_named_auto flipping render_target_flipping
+    }
+}
+
+fragment_program Fury/HeatVision/Blur_fp cg
+{
+   source HeatVision.cg
+   entry_point Blur_fp
+   profiles ps_2_0 arbfp1
+}
+
+material Fury/HeatVision/Blur
+{
+    technique
+    {
+        // pass 1
+        pass
+        {
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+            vertex_program_ref Fury/HeatVision/Blur_vp
+            {
+            }
+
+            fragment_program_ref Fury/HeatVision/Blur_fp
+            {
+                param_named blurAmount float4 0.5 0 0 0
+            }
+
+            // INPUT (from previous)
+            texture_unit
+            {
+                texture Input
+                tex_coord_set 0
+                filtering linear linear none
+                tex_address_mode clamp
+            }
+        }
+    }
+}
Index: /Samples/Media/materials/scripts/Hurt.material
===================================================================
--- /Samples/Media/materials/scripts/Hurt.material	(revision 5)
+++ /Samples/Media/materials/scripts/Hurt.material	(revision 5)
@@ -0,0 +1,18 @@
+/// Just a simple red quad blended over the scene
+material RedQuad
+{
+    technique
+    {
+        pass
+        {
+            lighting on
+            diffuse 0.0 0.0 0.0 0.5
+            specular 0.0 0.0 0.0 1.0 
+            ambient 0.0 0.0 0.0
+            emissive 1.0 0.0 0.0
+            cull_hardware none
+            depth_check off
+            scene_blend alpha_blend
+        }
+    }
+}
Index: /Samples/Media/materials/scripts/Invert.material
===================================================================
--- /Samples/Media/materials/scripts/Invert.material	(revision 5)
+++ /Samples/Media/materials/scripts/Invert.material	(revision 5)
@@ -0,0 +1,36 @@
+fragment_program Ogre/Compositor/InvertFP cg
+{
+	source InvertFP.cg
+	entry_point Invert_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/Invert
+{
+	technique
+	{
+
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+
+			fragment_program_ref Ogre/Compositor/InvertFP
+			{
+			}
+
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering trilinear
+			}
+
+		}
+	}
+}
Index: /Samples/Media/materials/scripts/Laplace.material
===================================================================
--- /Samples/Media/materials/scripts/Laplace.material	(revision 5)
+++ /Samples/Media/materials/scripts/Laplace.material	(revision 5)
@@ -0,0 +1,39 @@
+fragment_program Ogre/Compositor/LaplaceFP cg
+{
+	source LaplaceFP.cg
+	entry_point Laplace_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/Laplace
+{
+    technique
+    {
+
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+
+			fragment_program_ref Ogre/Compositor/LaplaceFP
+			{
+				param_named pixelSize float 0.0031
+				param_named scale float 1.0
+			}
+
+
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering trilinear
+			}
+
+		}
+	}
+}
Index: /Samples/Media/materials/scripts/MotionBlur.material
===================================================================
--- /Samples/Media/materials/scripts/MotionBlur.material	(revision 5)
+++ /Samples/Media/materials/scripts/MotionBlur.material	(revision 5)
@@ -0,0 +1,84 @@
+fragment_program Ogre/Compositor/Combine_fp cg
+{
+	source Combine_fp.cg
+	profiles ps_2_0 arbfp1
+	entry_point Combine_fp
+
+	default_params
+	{
+		param_named blur float 0.8
+	}
+}
+
+material Ogre/Compositor/Combine
+{
+	technique
+	{
+		pass
+		{
+			depth_check off
+
+			fragment_program_ref Ogre/Compositor/Combine_fp
+			{
+			}
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Cg_vp
+			{
+			}
+
+			texture_unit RT
+			{
+				tex_address_mode clamp
+				filtering linear linear none
+                tex_coord_set 0
+			}
+
+			texture_unit SUM
+			{
+				tex_address_mode clamp
+				filtering linear linear none
+                tex_coord_set 0
+			}
+		}
+	}
+}
+
+material Ogre/Compositor/Copyback
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_check off
+
+			texture_unit Temp
+			{
+				tex_address_mode clamp
+				filtering linear linear none
+				colour_op replace
+                tex_coord_set 0
+			}
+		}
+	}
+}
+
+material Ogre/Compositor/MotionBlur
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_check off
+
+			texture_unit Sum
+			{
+				tex_address_mode clamp
+				filtering linear linear none
+				colour_op replace
+                tex_coord_set 0
+			}
+		}
+	}
+}
Index: /Samples/Media/materials/scripts/Ocean.controls
===================================================================
--- /Samples/Media/materials/scripts/Ocean.controls	(revision 5)
+++ /Samples/Media/materials/scripts/Ocean.controls	(revision 5)
@@ -0,0 +1,90 @@
+[1. Ocean2 Cg]
+material = Ocean2_Cg
+control = Wavelet Scale, BumpScale, GPU_VERTEX, 0, 2, 0
+control = Texture Scale X, textureScale, GPU_VERTEX, 0, 40, 0
+control = Texture Scale Y, textureScale, GPU_VERTEX, 0, 40, 1
+control = Wavelet Speed X, bumpSpeed, GPU_VERTEX, -0.1, 0.1, 0
+control = Wavelet Speed Y, bumpSpeed, GPU_VERTEX, -0.1, 0.1, 1
+control = Wave Frequency, waveFreq, GPU_VERTEX, 0, 0.05, 0
+control = Wave Amplitude, waveAmp, GPU_VERTEX, 0, 25, 0
+
+control = Deep Color [Red], deepColor, GPU_FRAGMENT, 0, 1, 0
+control = Deep Color [Green], deepColor, GPU_FRAGMENT, 0, 1, 1
+control = Deep Color [Blue], deepColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Shallow Color [Red], shallowColor, GPU_FRAGMENT, 0, 1, 0
+control = Shallow Color [Green], shallowColor, GPU_FRAGMENT, 0, 1, 1
+control = Shallow Color [Blue], shallowColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Reflection Color [Red], reflectionColor, GPU_FRAGMENT, 0, 1, 0
+control = Reflection Color [Green], reflectionColor, GPU_FRAGMENT, 0, 1, 1
+control = Reflection Color [Blue], reflectionColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Reflection Amount, reflectionAmount, GPU_FRAGMENT, 0, 1, 0
+control = Reflection Blur, reflectionBlur, GPU_FRAGMENT, 0, 8, 0
+control = Water Amount, waterAmount, GPU_FRAGMENT, 0, 1, 0
+control = Fresnel Power, fresnelPower, GPU_FRAGMENT, 0, 10, 0
+control = Fresnel Bias, fresnelBias, GPU_FRAGMENT, 0, 1, 0
+control = HDR Mulitplier, hdrMultiplier, GPU_FRAGMENT, 0, 2, 0
+
+[1a. Ocean2 HLSL/GLSL]
+material = Ocean2_HLSL_GLSL
+control = Wavelet Scale, BumpScale, GPU_VERTEX, 0, 2, 0
+control = Texture Scale X, textureScale, GPU_VERTEX, 0, 40, 0
+control = Texture Scale Y, textureScale, GPU_VERTEX, 0, 40, 1
+control = Wavelet Speed X, bumpSpeed, GPU_VERTEX, -0.1, 0.1, 0
+control = Wavelet Speed Y, bumpSpeed, GPU_VERTEX, -0.1, 0.1, 1
+control = Wave Frequency, waveFreq, GPU_VERTEX, 0, 0.05, 0
+control = Wave Amplitude, waveAmp, GPU_VERTEX, 0, 25, 0
+
+control = Deep Color [Red], deepColor, GPU_FRAGMENT, 0, 1, 0
+control = Deep Color [Green], deepColor, GPU_FRAGMENT, 0, 1, 1
+control = Deep Color [Blue], deepColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Shallow Color [Red], shallowColor, GPU_FRAGMENT, 0, 1, 0
+control = Shallow Color [Green], shallowColor, GPU_FRAGMENT, 0, 1, 1
+control = Shallow Color [Blue], shallowColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Reflection Color [Red], reflectionColor, GPU_FRAGMENT, 0, 1, 0
+control = Reflection Color [Green], reflectionColor, GPU_FRAGMENT, 0, 1, 1
+control = Reflection Color [Blue], reflectionColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Reflection Amount, reflectionAmount, GPU_FRAGMENT, 0, 1, 0
+control = Reflection Blur, reflectionBlur, GPU_FRAGMENT, 0, 8, 0
+control = Water Amount, waterAmount, GPU_FRAGMENT, 0, 1, 0
+control = Fresnel Power, fresnelPower, GPU_FRAGMENT, 0, 10, 0
+control = Fresnel Bias, fresnelBias, GPU_FRAGMENT, 0, 1, 0
+control = HDR Mulitplier, hdrMultiplier, GPU_FRAGMENT, 0, 2, 0
+
+[2. Ocean1 HLSL/GLSL]
+material = OceanHLSL_GLSL
+control = scale x, scale, GPU_VERTEX, 0, 0.1, 0
+control = scale y, scale, GPU_VERTEX, 0, 0.1, 1
+control = scale z, scale, GPU_VERTEX, 0, 0.1, 2
+control = Wave Speed X, waveSpeed, GPU_VERTEX, 0, 1, 0
+control = Wave Speed Y, waveSpeed, GPU_VERTEX, 0, 1, 1
+control = Noise Speed, noiseSpeed, GPU_VERTEX, 0, 1, 0
+
+control = Fade Bias, fadeBias, GPU_FRAGMENT, 0, 1, 0
+control = Fade Exponent, fadeExp, GPU_FRAGMENT, 0, 20, 0
+control = Water Color (r), waterColor, GPU_FRAGMENT, 0, 1, 0
+control = Water Color (g), waterColor, GPU_FRAGMENT, 0, 1, 1
+control = Water Color (b), waterColor, GPU_FRAGMENT, 0, 1, 2
+
+[3. Ocean1 Cg]
+material = OceanCg
+control = scale x, scale, GPU_VERTEX, 0, 0.1, 0
+control = scale y, scale, GPU_VERTEX, 0, 0.1, 1
+control = scale z, scale, GPU_VERTEX, 0, 0.1, 2
+control = Wave Speed X, waveSpeed, GPU_VERTEX, 0, 1, 0
+control = Wave Speed Y, waveSpeed, GPU_VERTEX, 0, 1, 1
+control = Noise Speed, noiseSpeed, GPU_VERTEX, 0, 1, 0
+
+control = Fade Bias, fadeBias, GPU_FRAGMENT, 0, 1, 0
+control = Fade Exponent, fadeExp, GPU_FRAGMENT, 0, 20, 0
+control = Water Color (r), waterColor, GPU_FRAGMENT, 0, 1, 0
+control = Water Color (g), waterColor, GPU_FRAGMENT, 0, 1, 1
+control = Water Color (b), waterColor, GPU_FRAGMENT, 0, 1, 2
+
+
+
Index: /Samples/Media/materials/scripts/Ocean.material
===================================================================
--- /Samples/Media/materials/scripts/Ocean.material	(revision 5)
+++ /Samples/Media/materials/scripts/Ocean.material	(revision 5)
@@ -0,0 +1,427 @@
+vertex_program HLSL/OceanVS hlsl
+{
+	source oceanHLSL_Cg.vert
+	entry_point main
+	target vs_1_1
+
+
+	default_params
+	{
+		param_named_auto worldViewProj_matrix worldviewproj_matrix
+		param_named_auto eyePosition camera_position_object_space
+		param_named scale float3 0.012 0.005 0.03
+		param_named_auto time_0_X time_0_x 100.0
+	}
+}
+
+fragment_program HLSL/OceanFS hlsl
+{
+	source oceanHLSL_Cg.frag
+	entry_point main
+	target ps_2_0
+
+}
+
+vertex_program GLSL/OceanVS glsl
+{
+	source oceanGLSL.vert
+
+	default_params
+	{
+		param_named_auto eyePosition camera_position_object_space
+		param_named scale float3 0.012 0.005 0.03
+		param_named_auto time_0_X time_0_x 100.0
+	}
+}
+
+fragment_program GLSL/OceanFS glsl
+{
+	source oceanGLSL.frag
+
+	default_params
+	{
+		param_named Noise int 0
+		param_named skyBox int 1
+	}
+}
+
+material OceanHLSL_GLSL
+{
+	technique
+	{
+		pass
+		{
+			vertex_program_ref HLSL/OceanVS
+			{
+				param_named waveSpeed float2 0.0 0.168
+				param_named noiseSpeed float 0.155
+			}
+
+			fragment_program_ref HLSL/OceanFS
+			{
+				param_named fadeBias float 0.336
+				param_named fadeExp float 5.546
+				param_named waterColor float4 0.0 0.244 0.395 1.0
+			}
+
+			texture_unit
+			{
+				texture NoiseVolume.dds 3d
+				tex_coord_set 0
+				filtering linear linear none
+			}
+
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				tex_coord_set 1
+			}
+
+		}
+
+	}
+
+	technique
+	{
+		pass
+		{
+			vertex_program_ref GLSL/OceanVS
+			{
+				param_named waveSpeed float2 0.0 0.168
+				param_named noiseSpeed float 0.155
+			}
+
+			fragment_program_ref GLSL/OceanFS
+			{
+				param_named fadeBias float 0.336
+				param_named fadeExp float 5.546
+				param_named waterColor float4 0.0 0.244 0.395 1.0
+			}
+
+			texture_unit
+			{
+				texture NoiseVolume.dds 3d
+				tex_coord_set 0
+				filtering linear linear none
+				tex_address_mode wrap
+			}
+
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				tex_coord_set 1
+			}
+
+		}
+
+	}
+
+}
+
+
+vertex_program Cg/OceanVS cg
+{
+	source oceanHLSL_Cg.vert
+	entry_point main
+	profiles vs_1_1 arbvp1
+
+
+	default_params
+	{
+		param_named_auto worldViewProj_matrix worldviewproj_matrix
+		param_named_auto eyePosition camera_position_object_space
+		param_named scale float3 0.012 0.005 0.03
+		param_named_auto time_0_X time_0_x 100.0
+	}
+}
+
+fragment_program Cg/OceanFS cg
+{
+	source oceanHLSL_Cg.frag
+	entry_point main
+	profiles ps_2_0 arbfp1
+
+}
+
+material OceanCg
+{
+	technique
+	{
+		pass
+		{
+			vertex_program_ref Cg/OceanVS
+			{
+				param_named waveSpeed float2 0.0 0.168
+				param_named noiseSpeed float 0.155
+			}
+
+			fragment_program_ref Cg/OceanFS
+			{
+				param_named fadeBias float 0.336
+				param_named fadeExp float 5.546
+				param_named waterColor float4 0.0 0.244 0.395 1.0
+			}
+
+			texture_unit
+			{
+				texture NoiseVolume.dds 3d
+				tex_coord_set 0
+				filtering linear linear none
+			}
+
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				tex_coord_set 1
+			}
+
+		}
+
+	}
+}
+
+
+vertex_program Cg/Ocean2VS cg
+{
+	source Ocean2HLSL_Cg.vert
+	entry_point main
+	profiles vs_1_1 arbvp1
+
+
+	default_params
+	{
+		param_named_auto WorldViewProj worldviewproj_matrix
+		param_named_auto eyePosition camera_position_object_space
+	}
+}
+
+fragment_program Cg/Ocean2FS cg
+{
+	source Ocean2HLSL_Cg.frag
+	entry_point main
+	profiles ps_2_0 arbfp1
+
+}
+
+material Ocean2_Cg
+{
+	technique
+	{
+		pass
+		{
+			vertex_program_ref Cg/Ocean2VS
+			{
+				param_named BumpScale float 0.2
+				param_named textureScale float2 25 26
+				param_named bumpSpeed float2 0.015 0.005
+				param_named_auto time time_0_x 100.0
+				param_named waveFreq float 0.028
+				param_named waveAmp float 1.8
+			}
+
+			fragment_program_ref Cg/Ocean2FS
+			{
+				param_named deepColor float4 0 0.3 0.5 1.0
+				param_named shallowColor float4 0 1 1 1.0
+				param_named reflectionColor float4 0.95 1 1 1.0
+				param_named reflectionAmount float 1.0
+				param_named reflectionBlur float 0.0
+				param_named waterAmount float 0.3
+				param_named fresnelPower float 5.0
+				param_named fresnelBias float 0.328
+				param_named hdrMultiplier float 0.471
+			}
+
+			texture_unit
+			{
+				texture waves2.dds
+				tex_coord_set 0
+				filtering linear linear linear
+			}
+
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				tex_coord_set 1
+				filtering linear linear linear
+			}
+
+		}
+
+	}
+}
+
+
+vertex_program HLSL/Ocean2VS hlsl
+{
+	source Ocean2HLSL_Cg.vert
+	entry_point main
+	target vs_1_1
+
+
+	default_params
+	{
+		param_named_auto WorldViewProj worldviewproj_matrix
+		param_named_auto eyePosition camera_position_object_space
+	}
+}
+
+fragment_program HLSL/Ocean2FS hlsl
+{
+	source Ocean2HLSL_Cg.frag
+	entry_point main
+	target ps_2_0
+
+}
+
+vertex_program GLSL/Ocean2VS glsl
+{
+	source Ocean2GLSL.vert
+
+}
+
+fragment_program GLSL/Ocean2FS glsl
+{
+	source Ocean2GLSL.frag
+}
+
+material Ocean2_HLSL_GLSL
+{
+	technique HLSL
+	{
+		pass
+		{
+			vertex_program_ref HLSL/Ocean2VS
+			{
+				param_named BumpScale float 0.2
+				param_named textureScale float2 25 26
+				param_named bumpSpeed float2 0.015 0.005
+				param_named_auto time time_0_x 100.0
+				param_named waveFreq float 0.028
+				param_named waveAmp float 1.8
+			}
+
+			fragment_program_ref HLSL/Ocean2FS
+			{
+				param_named deepColor float4 0 0.3 0.5 1.0
+				param_named shallowColor float4 0 1 1 1.0
+				param_named reflectionColor float4 0.95 1 1 1.0
+				param_named reflectionAmount float 1.0
+				param_named reflectionBlur float 0.0
+				param_named waterAmount float 0.3
+				param_named fresnelPower float 5.0
+				param_named fresnelBias float 0.328
+				param_named hdrMultiplier float 0.471
+			}
+
+			texture_unit
+			{
+				texture waves2.dds
+				tex_coord_set 0
+				filtering linear linear linear
+			}
+
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				filtering linear linear linear
+				tex_coord_set 1
+			}
+
+		}
+
+	}
+
+	technique GLSL
+	{
+		pass
+		{
+			vertex_program_ref GLSL/Ocean2VS
+			{
+				param_named_auto eyePosition camera_position_object_space
+				param_named_auto time time_0_x 100.0
+				param_named BumpScale float 0.2
+				param_named textureScale float2 25 26
+				param_named bumpSpeed float2 0.015 0.005
+				param_named waveFreq float 0.028
+				param_named waveAmp float 1.8
+			}
+
+			fragment_program_ref GLSL/Ocean2FS
+			{
+				param_named deepColor float4 0 0.3 0.5 1.0
+				param_named shallowColor float4 0 1 1 1.0
+				param_named reflectionColor float4 0.95 1 1 1.0
+				param_named reflectionAmount float 1.0
+				param_named reflectionBlur float 0.0
+				param_named waterAmount float 0.3
+				param_named fresnelPower float 5.0
+				param_named fresnelBias float 0.328
+				param_named hdrMultiplier float 0.471
+				param_named NormalMap int 0
+				param_named EnvironmentMap int 1
+			}
+
+			texture_unit
+			{
+				texture waves2.dds
+				tex_coord_set 0
+				filtering linear linear linear
+			}
+
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				tex_coord_set 1
+				filtering linear linear linear
+			}
+
+		}
+
+	}
+}
+
+material SkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+			depth_check off
+
+			texture_unit
+			{
+				cubic_texture morning.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+material LightFlare
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture flare.png
+			}
+		}
+	}
+}
+
+
Index: /Samples/Media/materials/scripts/OffsetMapping.material
===================================================================
--- /Samples/Media/materials/scripts/OffsetMapping.material	(revision 5)
+++ /Samples/Media/materials/scripts/OffsetMapping.material	(revision 5)
@@ -0,0 +1,242 @@
+// Bump map with Parallax offset vertex program, support for this is required 
+vertex_program Examples/OffsetMappingVP cg 
+{ 
+   source OffsetMapping.cg 
+   entry_point main_vp 
+   profiles vs_1_1 arbvp1 
+} 
+
+// Bump map with parallax fragment program 
+fragment_program Examples/OffsetMappingFP cg
+{ 
+   source OffsetMapping.cg
+   entry_point main_fp
+   profiles ps_2_0 arbfp1
+} 
+
+// Bump map with parallax fragment program 
+fragment_program Examples/OffsetMappingPS asm 
+{ 
+   source OffsetMapping_specular.asm 
+   // sorry, only for ps_1_4 and above:) 
+   syntax ps_1_4 
+} 
+
+
+material Examples/OffsetMapping/Specular 
+{ 
+
+  // This is the preferred technique which uses both vertex and 
+   // fragment programs, supports coloured lights 
+   technique 
+   { 
+      // do the lighting  and bump mapping with parallax pass 
+      pass 
+      { 
+       
+         // Vertex program reference 
+         vertex_program_ref Examples/OffsetMappingVP 
+         { 
+            param_named_auto lightPosition light_position_object_space 0 
+            param_named_auto eyePosition camera_position_object_space 
+            param_named_auto worldViewProj worldviewproj_matrix 
+         } 
+
+         // Fragment program 
+         fragment_program_ref Examples/OffsetMappingFP
+         { 
+            param_named_auto lightDiffuse light_diffuse_colour 0 
+            param_named_auto lightSpecular light_specular_colour 0 
+            // Parallax Height scale and bias 
+            param_named scaleBias float4 0.04 -0.02 1 0 
+         } 
+          
+         // Normal + height(alpha) map 
+         texture_unit 
+         { 
+            texture rockwall_NH.tga
+            tex_coord_set 0 
+         } 
+
+         // Base diffuse texture map 
+         texture_unit 
+         { 
+            texture rockwall.tga
+            tex_coord_set 1 
+         } 
+      } 
+   } 
+
+
+   // This is the preferred technique which uses both vertex and 
+   // fragment programs, supports coloured lights 
+   technique 
+   { 
+      // do the lighting  and bump mapping with parallax pass 
+      pass 
+      { 
+       
+         // Vertex program reference 
+         vertex_program_ref Examples/OffsetMappingVP 
+         { 
+            param_named_auto lightPosition light_position_object_space 0 
+            param_named_auto eyePosition camera_position_object_space 
+            param_named_auto worldViewProj worldviewproj_matrix 
+         } 
+
+         // Fragment program 
+         fragment_program_ref Examples/OffsetMappingPS 
+         { 
+            param_indexed_auto 0 light_diffuse_colour 0 
+            param_indexed_auto 1 light_specular_colour 0 
+            // Parallax Height scale and bias 
+            param_indexed 2 float4 0.04 -0.02 1 0 
+         } 
+          
+         // Normal + height(alpha) map 
+         texture_unit 
+         { 
+            texture rockwall_NH.tga
+            tex_coord_set 0 
+         } 
+
+         // Base diffuse texture map 
+         texture_unit 
+         { 
+            texture rockwall.tga
+            tex_coord_set 1 
+         } 
+      } 
+   } 
+   
+   // Simple no-shader fallback
+   technique 
+   { 
+      pass 
+      { 
+         // Base diffuse texture map 
+         texture_unit 
+         { 
+            texture rockwall.tga
+         } 
+	  }
+   }
+
+}
+
+
+
+// Single-pass offset mapping with shadows
+vertex_program Examples/OffsetMappingIntegratedShadowsVPhlsl hlsl 
+{ 
+   source OffsetMapping.hlsl
+   entry_point integratedshadows_vp 
+   target vs_2_0
+} 
+vertex_program Examples/OffsetMappingIntegratedShadowsVPglsl glsl 
+{ 
+   source OffsetMappingVp.glsl
+} 
+
+// Single-pass offset mapping with shadows
+fragment_program Examples/OffsetMappingIntegratedShadowsFPhlsl hlsl
+{ 
+   source OffsetMapping.hlsl
+   entry_point integratedshadows_fp
+   target ps_2_0
+} 
+fragment_program Examples/OffsetMappingIntegratedShadowsFPglsl glsl
+{
+	source OffsetMappingFp.glsl
+	default_params
+	{
+		// assign samplers as required by GLSL
+		param_named normalHeightMap int 0
+		param_named diffuseMap int 1
+		param_named shadowMap1 int 2
+		param_named shadowMap2 int 3
+	}
+}
+// Single-pass offset mapping with shadows
+vertex_program Examples/OffsetMappingIntegratedShadowsVP unified
+{
+	delegate Examples/OffsetMappingIntegratedShadowsVPhlsl
+	delegate Examples/OffsetMappingIntegratedShadowsVPglsl
+}
+// Single-pass offset mapping with shadows
+fragment_program Examples/OffsetMappingIntegratedShadowsFP unified
+{
+	delegate Examples/OffsetMappingIntegratedShadowsFPhlsl
+	delegate Examples/OffsetMappingIntegratedShadowsFPglsl
+}
+
+
+
+material Examples/OffsetMapping/IntegratedShadows 
+{ 
+
+   technique 
+   { 
+      // do the lighting  and bump mapping with parallax pass 
+      pass 
+      { 
+       
+         // Vertex program reference 
+         vertex_program_ref Examples/OffsetMappingIntegratedShadowsVP
+         { 
+            param_named_auto lightPosition light_position_object_space 0
+            param_named_auto eyePosition camera_position_object_space 
+            param_named_auto worldViewProj worldviewproj_matrix 
+			param_named_auto spotDirection light_direction_object_space 0
+
+            param_named_auto lightPosition1 light_position_object_space 1
+			param_named_auto spotDirection1 light_direction_object_space 1
+			// shadow texture projections
+			param_named_auto worldMatrix world_matrix
+			param_named_auto texViewProj1 texture_viewproj_matrix 0
+			param_named_auto texViewProj2 texture_viewproj_matrix 1
+         } 
+
+         // Fragment program 
+         fragment_program_ref Examples/OffsetMappingIntegratedShadowsFP
+         { 
+            param_named_auto lightDiffuse light_diffuse_colour 0 
+			param_named_auto spotParams spotlight_params 0
+
+			param_named_auto lightDiffuse1 light_diffuse_colour 1
+			param_named_auto spotParams1 spotlight_params 1
+            // Parallax Height scale and bias 
+            param_named scaleBias float4 0.04 -0.02 1 0 
+         } 
+          
+         // Normal + height(alpha) map 
+         texture_unit 
+         { 
+            texture rockwall_NH.tga
+            tex_coord_set 0 
+         } 
+
+         // Base diffuse texture map 
+         texture_unit 
+         { 
+            texture rockwall.tga
+            tex_coord_set 1 
+         } 
+
+		 // shadowmap 1
+		 texture_unit
+		 {
+		 	content_type shadow
+		 }
+		 // shadowmap 2
+		 texture_unit
+		 {
+		 	content_type shadow
+		 }
+      } 
+   } 
+
+
+
+}
+
Index: /Samples/Media/materials/scripts/Ogre.material
===================================================================
--- /Samples/Media/materials/scripts/Ogre.material	(revision 5)
+++ /Samples/Media/materials/scripts/Ogre.material	(revision 5)
@@ -0,0 +1,119 @@
+
+material Ogre/Earring
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.5 0.5 0
+			diffuse 1 1 0
+
+			texture_unit
+			{
+				texture spheremap.png
+				colour_op_ex add src_texture src_current
+				colour_op_multipass_fallback one one
+				env_map spherical
+			}
+		}
+	}
+}
+material Ogre/Skin
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.7 0.7 0.7
+			cull_hardware none
+
+			texture_unit
+			{
+				texture GreenSkin.jpg
+				tex_address_mode mirror
+			}
+		}
+	}
+}
+material Ogre/Tusks
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.5 0.5 0.4
+			diffuse 1 1 0.8
+
+			texture_unit
+			{
+				texture dirt01.jpg
+				colour_op_ex add src_texture src_current
+				colour_op_multipass_fallback one one
+			}
+		}
+	}
+}
+material Ogre/Eyes
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture WeirdEye.png
+			}
+		}
+	}
+}
+material Cursor/default
+{
+	technique
+	{
+		pass
+		{
+			scene_blend alpha_blend
+
+			texture_unit
+			{
+				texture cursor.png
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+material Core/StatsBlockBorder/Down
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture ogreborder.png
+			}
+		}
+	}
+}
+material Core/StatsBlockBorder/Up
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture ogreborderUp.png
+			}
+		}
+	}
+}
Index: /Samples/Media/materials/scripts/OldMovie.material
===================================================================
--- /Samples/Media/materials/scripts/OldMovie.material	(revision 5)
+++ /Samples/Media/materials/scripts/OldMovie.material	(revision 5)
@@ -0,0 +1,67 @@
+fragment_program Ogre/Compositor/OldMovieFP cg
+{
+	source OldMovieFP.cg
+	entry_point OldMovie_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/OldMovie
+{
+    technique
+    {
+
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+
+			fragment_program_ref Ogre/Compositor/OldMovieFP
+			{
+				param_named_auto time_cycle_period time 20
+				param_named flicker float 0.4
+				param_named DirtFrequency float 0.0005
+				param_named luminance float3 0.30 0.59 0.11
+				param_named frameJitter float 0.004
+				param_named lumiShift float 0.03
+			}
+
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering trilinear
+			}
+
+			texture_unit SplotchesTx
+			{
+				texture 8x8PagesSplotches2.png 2d
+                tex_coord_set 1
+				tex_address_mode wrap
+				filtering trilinear
+			}
+
+			texture_unit
+			{
+				texture 1D_Noise.png 1d
+                tex_coord_set 2
+				tex_address_mode wrap
+				filtering point point none
+			}
+
+
+			texture_unit SepiaTx
+			{
+				texture Sepia1D.tga 1d
+                tex_coord_set 3
+				tex_address_mode mirror
+				filtering point point none
+			}
+
+		}
+	}
+}
Index: /Samples/Media/materials/scripts/OldTV.material
===================================================================
--- /Samples/Media/materials/scripts/OldTV.material	(revision 5)
+++ /Samples/Media/materials/scripts/OldTV.material	(revision 5)
@@ -0,0 +1,59 @@
+fragment_program Ogre/Compositor/OldTV_FP cg
+{
+	source OldTV.cg
+	entry_point OldTV_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/OldTV
+{
+	technique
+	{
+
+		pass
+		{
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+
+			fragment_program_ref Ogre/Compositor/OldTV_FP
+			{
+                param_named_auto time_0_X time_0_x 120
+                param_named_auto sin_time_0_X sintime_0_x 120
+
+                param_named distortionFreq float 2.7
+                param_named distortionScale float 2.5
+                param_named distortionRoll float 0.93
+                param_named interference float 0.5
+                param_named frameLimit float 0.40
+                param_named frameShape float 0.26
+                param_named frameSharpness float 6.0
+			}
+
+			texture_unit 0
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+			}
+
+			texture_unit 1
+			{
+				texture Random3D.dds 3d
+                tex_coord_set 1
+				tex_address_mode wrap
+				filtering linear linear linear
+			}
+
+			texture_unit 2
+			{
+				texture NoiseVolume.dds 3d
+                tex_coord_set 2
+				tex_address_mode wrap
+				filtering linear linear linear
+			}
+		}
+	}
+}
Index: /Samples/Media/materials/scripts/Posterize.material
===================================================================
--- /Samples/Media/materials/scripts/Posterize.material	(revision 5)
+++ /Samples/Media/materials/scripts/Posterize.material	(revision 5)
@@ -0,0 +1,36 @@
+fragment_program Ogre/Compositor/PosterizeFP cg
+{
+	source PosterizeFP.cg
+	entry_point Posterize_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/Posterize
+{
+    technique
+    {
+
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+
+			fragment_program_ref Ogre/Compositor/PosterizeFP
+			{
+			}
+
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering trilinear
+			}
+
+		}
+	}
+}
Index: /Samples/Media/materials/scripts/RZR-002.material
===================================================================
--- /Samples/Media/materials/scripts/RZR-002.material	(revision 5)
+++ /Samples/Media/materials/scripts/RZR-002.material	(revision 5)
@@ -0,0 +1,15 @@
+
+material RZR-002
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture RZR-002.png
+			}
+		}
+	}
+}
Index: /Samples/Media/materials/scripts/SharpenEdges.material
===================================================================
--- /Samples/Media/materials/scripts/SharpenEdges.material	(revision 5)
+++ /Samples/Media/materials/scripts/SharpenEdges.material	(revision 5)
@@ -0,0 +1,60 @@
+fragment_program Ogre/Compositor/SharpenEdgesFP_cg cg
+{
+	source SharpenEdgesFP.cg
+    entry_point sharpenEdges_fp
+	profiles ps_2_0 arbfp1
+}
+
+fragment_program Ogre/Compositor/SharpenEdgesFP_ps_2_a hlsl
+{
+	source SharpenEdgesFP.cg
+    entry_point sharpenEdges_fp
+	target ps_2_a
+}
+
+fragment_program Ogre/Compositor/SharpenEdgesFP unified
+{
+	delegate Ogre/Compositor/SharpenEdgesFP_ps_2_a
+	delegate Ogre/Compositor/SharpenEdgesFP_cg
+
+	default_params
+	{
+		param_named_auto vTexelSize inverse_texture_size 0
+	}
+}
+
+material Ogre/Compositor/SharpenEdges
+{
+    technique
+    {
+
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			//DirectX 9.0 HLSL Vertex Shader vs_1_1
+			//vertex_program_ref PostFilters/SharpenEdgesVP
+			//{
+			//}
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+
+			//DirectX 9.0 HLSL Pixel Shader ps_2_0
+			fragment_program_ref Ogre/Compositor/SharpenEdgesFP
+			{
+			}
+
+			texture_unit
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering trilinear
+			}
+
+		}
+	}
+}
Index: /Samples/Media/materials/scripts/StdQuad_vp.program
===================================================================
--- /Samples/Media/materials/scripts/StdQuad_vp.program	(revision 5)
+++ /Samples/Media/materials/scripts/StdQuad_vp.program	(revision 5)
@@ -0,0 +1,71 @@
+vertex_program Ogre/Compositor/StdQuad_Cg_vp cg
+{
+	source StdQuad_vp.cg
+	entry_point StdQuad_vp
+	profiles vs_1_1 arbvp1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+	}
+}
+
+vertex_program Ogre/Compositor/StdQuad_Tex2_vp cg
+{
+	source StdQuad_vp.cg
+	entry_point StdQuad_Tex2_vp
+	profiles vs_1_1 arbvp1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+	}
+}
+
+vertex_program Ogre/Compositor/StdQuad_Tex2a_vp cg
+{
+	source StdQuad_vp.cg
+	entry_point StdQuad_Tex2a_vp
+	profiles vs_1_1 arbvp1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+	}
+}
+
+vertex_program Ogre/Compositor/StdQuad_Tex3_vp cg
+{
+	source StdQuad_vp.cg
+	entry_point StdQuad_Tex3_vp
+	profiles vs_1_1 arbvp1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+	}
+}
+
+vertex_program Ogre/Compositor/StdQuad_Tex4_vp cg
+{
+	source StdQuad_vp.cg
+	entry_point StdQuad_Tex4_vp
+	profiles vs_1_1 arbvp1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+	}
+}
+
+vertex_program Ogre/Compositor/StdQuad_GLSL_vp glsl
+{
+	source StdQuad_vp.glsl
+}
+
+
+vertex_program Ogre/Compositor/StdQuad_vp unified
+{
+	delegate Ogre/Compositor/StdQuad_GLSL_vp
+	delegate Ogre/Compositor/StdQuad_Cg_vp
+}
Index: /Samples/Media/materials/scripts/Tiling.material
===================================================================
--- /Samples/Media/materials/scripts/Tiling.material	(revision 5)
+++ /Samples/Media/materials/scripts/Tiling.material	(revision 5)
@@ -0,0 +1,39 @@
+fragment_program Ogre/Compositor/TilingFP cg
+{
+	source TilingFP.cg
+	entry_point Tiling_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/Tiling
+{
+    technique
+    {
+
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+
+			//DirectX 9.0 HLSL Pixel Shader ps_2_0
+			fragment_program_ref Ogre/Compositor/TilingFP
+			{
+				param_named NumTiles float 75.0
+				param_named Threshhold float 0.15
+			}
+
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering trilinear
+			}
+
+		}
+	}
+}
Index: /Samples/Media/materials/scripts/VarianceShadowmap.material
===================================================================
--- /Samples/Media/materials/scripts/VarianceShadowmap.material	(revision 5)
+++ /Samples/Media/materials/scripts/VarianceShadowmap.material	(revision 5)
@@ -0,0 +1,103 @@
+
+// Shadow Caster __________________________________________________
+
+
+vertex_program VarianceShadowMapping/ShadowCasterVP cg
+{
+    source varianceshadowcastervp.cg
+    entry_point main
+    profiles arbvp1 vs_2_x
+
+    default_params
+    {
+        param_named_auto uModelViewProjection worldviewproj_matrix
+    }
+}
+
+fragment_program VarianceShadowMapping/ShadowCasterFP cg
+{
+    source varianceshadowcasterfp.cg
+    entry_point main
+    profiles arbfp1 ps_2_x
+
+    default_params
+    {
+        param_named      uDepthOffset float       1.0
+        param_named_auto uProjection              projection_matrix
+    }
+}
+
+material VarianceShadowMapping/ShadowCaster
+{
+    technique default
+    {
+        // Z-write only pass
+        pass Z-write
+        {
+            //Instead of using depth_bias, we'll be implementing it manually
+
+            vertex_program_ref VarianceShadowMapping/ShadowCasterVP
+            {
+            }
+            fragment_program_ref VarianceShadowMapping/ShadowCasterFP
+            {
+            }
+        }
+    }
+}
+
+
+
+// Shadow Receiver ________________________________________________
+
+vertex_program VarianceShadowMapping/ShadowReceiverVP cg
+{
+    source varianceshadowreceivervp.cg
+    entry_point main
+    profiles arbvp1 vs_2_x
+
+    default_params
+    {
+        param_named_auto uModelViewProjection   worldviewproj_matrix
+        param_named_auto uLightPosition         light_position_object_space 0
+        param_named_auto uModel                 world_matrix
+        param_named_auto uTextureViewProjection texture_viewproj_matrix
+    }
+}
+
+fragment_program VarianceShadowMapping/ShadowReceiverFP cg
+{
+    source varianceshadowreceiverfp.cg
+    entry_point main
+    profiles arbfp1 ps_2_x
+
+    default_params
+    {
+        param_named uSTexWidth  float 512.0
+        param_named uSTexHeight float 512.0
+    }
+}
+
+material VarianceShadowMapping/ShadowReceiver
+{
+    technique default
+    {
+        pass lighting
+        {
+            vertex_program_ref VarianceShadowMapping/ShadowReceiverVP
+            {
+            }
+
+            fragment_program_ref VarianceShadowMapping/ShadowReceiverFP
+            {
+            }
+
+            // we won't rely on hardware specific filtering of z-tests
+            texture_unit ShadowMap
+            {
+                tex_address_mode clamp
+                filtering none
+            }
+        }
+    }
+}
Index: /Samples/Media/materials/scripts/facial.material
===================================================================
--- /Samples/Media/materials/scripts/facial.material	(revision 5)
+++ /Samples/Media/materials/scripts/facial.material	(revision 5)
@@ -0,0 +1,85 @@
+
+material drbunsen_head
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.25 0.25 0.25
+			diffuse 1.0 1.0 1.0
+
+			texture_unit
+			{
+				texture Dr_Bunsen_Head.jpg
+			}
+		}
+	}
+}
+
+material drbunsen_teeth
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.25 0.25 0.25
+			diffuse 1.0 1.0 1.0
+
+		}
+	}
+}
+
+material drbunsen_tongue
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.25 0.25 0.25
+			diffuse 1.0 0.1 0.1
+
+		}
+	}
+}
+
+material drbunsen_gums
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.25 0.25 0.25
+			diffuse 1.0 0.1 0.1
+
+		}
+	}
+}
+
+material drbunsen_glasses
+{
+	technique
+	{
+		pass
+		{
+			depth_write off
+			scene_blend modulate
+			ambient 0.25 0.25 0.25
+			diffuse 0.75 0.75 0.75
+
+		}
+	}
+}
+
+material drbunsen_glasses_frame
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.25 0.25 0.25
+			diffuse 0.35 0.18 0 1
+
+		}
+	}
+}
+
Index: /Samples/Media/materials/scripts/hdr.material
===================================================================
--- /Samples/Media/materials/scripts/hdr.material	(revision 5)
+++ /Samples/Media/materials/scripts/hdr.material	(revision 5)
@@ -0,0 +1,286 @@
+// Downsample a 2x2 area & turn into luminence (unclamped)
+fragment_program Ogre/Compositor/HDR/downscale2x2LuminenceHLSL_fp hlsl
+{
+	source hdr.hlsl
+	entry_point downscale2x2Luminence
+	target ps_2_0
+}
+fragment_program Ogre/Compositor/HDR/downscale2x2LuminenceGLSL_fp glsl
+{
+	source hdr_downscale2x2luminence.glsl
+	default_params
+	{
+		param_named inRTT int 0
+	}
+}
+fragment_program Ogre/Compositor/HDR/downscale2x2Luminence_fp unified
+{
+	delegate Ogre/Compositor/HDR/downscale2x2LuminenceGLSL_fp
+	delegate Ogre/Compositor/HDR/downscale2x2LuminenceHLSL_fp
+	default_params
+	{
+	    param_named_auto texelSize inverse_texture_size 0
+	}
+}
+
+material Ogre/Compositor/HDR/Downsample2x2Luminence
+{
+	technique
+	{
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_vp
+			{
+			}
+			fragment_program_ref Ogre/Compositor/HDR/downscale2x2Luminence_fp
+			{
+			}
+
+			texture_unit
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering none 
+			}
+		}
+	}
+}
+
+// Downsample a 3x3 area
+fragment_program Ogre/Compositor/HDR/downscale3x3HLSL_fp hlsl
+{
+	source hdr.hlsl
+	entry_point downscale3x3
+	target ps_2_0
+}
+fragment_program Ogre/Compositor/HDR/downscale3x3GLSL_fp glsl
+{
+	source hdr_downscale3x3.glsl
+	default_params
+	{
+		param_named inRTT int 0
+	}
+}
+fragment_program Ogre/Compositor/HDR/downscale3x3_fp unified
+{
+	delegate Ogre/Compositor/HDR/downscale3x3GLSL_fp
+	delegate Ogre/Compositor/HDR/downscale3x3HLSL_fp
+	default_params
+	{
+	    param_named_auto texelSize inverse_texture_size 0
+	}
+}
+
+
+material Ogre/Compositor/HDR/Downsample3x3
+{
+	technique
+	{
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_vp
+			{
+			}
+			fragment_program_ref Ogre/Compositor/HDR/downscale3x3_fp
+			{
+			}
+
+			texture_unit
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering none 
+			}
+		}
+	}
+}
+
+// Downsample a 3x3 area and perform a brightness filter pass
+fragment_program Ogre/Compositor/HDR/downscale3x3brightpassHLSL_fp hlsl
+{
+	source hdr.hlsl
+	entry_point downscale3x3brightpass
+	target ps_2_0
+}
+fragment_program Ogre/Compositor/HDR/utils_fp glsl
+{
+	source hdr_tonemap_util.glsl
+}
+fragment_program Ogre/Compositor/HDR/downscale3x3brightpassGLSL_fp glsl
+{
+	source hdr_downscale3x3brightpass.glsl
+	// re-use common functions
+	attach Ogre/Compositor/HDR/utils_fp
+	default_params
+	{
+		param_named inRTT int 0
+		param_named inLum int 1
+	}
+}
+fragment_program Ogre/Compositor/HDR/downscale3x3brightpass_fp unified
+{
+	delegate Ogre/Compositor/HDR/downscale3x3brightpassGLSL_fp
+	delegate Ogre/Compositor/HDR/downscale3x3brightpassHLSL_fp
+	default_params
+	{
+	    param_named_auto texelSize inverse_texture_size 0
+	}
+}
+
+
+material Ogre/Compositor/HDR/Downsample3x3Brightpass
+{
+	technique
+	{
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_vp
+			{
+			}
+			fragment_program_ref Ogre/Compositor/HDR/downscale3x3brightpass_fp
+			{
+			}
+
+			// Scene 
+			texture_unit
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering none 
+			}
+			// Luminence 
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none 
+			}
+		}
+	}
+}
+
+// Bloom an area using gaussian distribution
+fragment_program Ogre/Compositor/HDR/bloomHLSL_fp hlsl
+{
+	source hdr.hlsl
+	entry_point bloom
+	target ps_2_0
+}
+fragment_program Ogre/Compositor/HDR/bloomGLSL_fp glsl
+{
+	source hdr_bloom.glsl
+	default_params
+	{
+		param_named inRTT int 0
+	}
+}
+fragment_program Ogre/Compositor/HDR/bloom_fp unified
+{
+	delegate Ogre/Compositor/HDR/bloomGLSL_fp
+	delegate Ogre/Compositor/HDR/bloomHLSL_fp
+}
+
+
+material Ogre/Compositor/HDR/GaussianBloom
+{
+	technique
+	{
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_vp
+			{
+			}
+			fragment_program_ref Ogre/Compositor/HDR/bloom_fp
+			{
+			}
+
+			// Input 
+			texture_unit
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering none 
+			}
+		}
+	}
+}
+
+
+// Perform final tone mapping
+fragment_program Ogre/Compositor/HDR/finaltonemappingHLSL_fp hlsl
+{
+	source hdr.hlsl
+	entry_point finalToneMapping
+	target ps_2_0
+}
+fragment_program Ogre/Compositor/HDR/finaltonemappingGLSL_fp glsl
+{
+	source hdr_finalToneMapping.glsl
+	// re-use common functions
+	attach Ogre/Compositor/HDR/utils_fp
+	default_params
+	{
+		param_named inRTT int 0
+		param_named inBloom int 1
+		param_named inLum int 2
+	}
+}
+fragment_program Ogre/Compositor/HDR/finaltonemapping_fp unified
+{
+	delegate Ogre/Compositor/HDR/finaltonemappingHLSL_fp
+	delegate Ogre/Compositor/HDR/finaltonemappingGLSL_fp
+}
+
+material Ogre/Compositor/HDR/ToneMapping
+{
+	technique
+	{
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_vp
+			{
+			}
+			fragment_program_ref Ogre/Compositor/HDR/finaltonemapping_fp
+			{
+			}
+
+			// Scene 
+			texture_unit
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+			}
+			// Bloom
+			texture_unit
+			{
+				tex_address_mode clamp
+			}
+			// Luminence 
+			texture_unit
+			{
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+
Index: /Samples/Media/materials/scripts/instancing.material
===================================================================
--- /Samples/Media/materials/scripts/instancing.material	(revision 5)
+++ /Samples/Media/materials/scripts/instancing.material	(revision 5)
@@ -0,0 +1,131 @@
+
+vertex_program InstancingCg cg
+{
+	source instancing.cg
+	profiles vs_2_0
+	entry_point instancing_vp
+
+	default_params
+	{
+		param_named_auto ambient ambient_light_colour
+		param_named_auto lightDiffuseColour light_diffuse_colour 0
+		param_named_auto lightPos light_position 0
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+	}
+}
+vertex_program InstancingShadowCasterCg cg
+{
+   	source instancing.cg
+	profiles vs_2_0
+	entry_point instancingCaster_vp
+	default_params
+	{
+		param_named_auto ambient ambient_light_colour
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+	}
+}
+vertex_program CrowdCg cg
+{
+	source instancing.cg
+	profiles vs_2_0
+	entry_point crowd_vp
+	default_params
+	{
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto numBones custom 0
+		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+		param_named_auto lightPos light_position 0
+		param_named_auto lightDiffuseColour light_diffuse_colour 0
+		param_named_auto ambient ambient_light_colour
+	}
+}
+vertex_program CrowdShadowCasterCg cg
+{
+	source instancing.cg
+	profiles vs_2_0
+	entry_point crowdCaster_vp
+	default_params
+	{
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto numBones custom 0
+		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+		param_named_auto ambient ambient_light_colour
+	}
+}
+
+
+vertex_program InstancingGLSL glsl
+{
+	source instancingVp.glsl
+	preprocessor_defines SHADOW_CASTER=0
+	default_params
+	{
+		param_named_auto ambient ambient_light_colour
+		param_named_auto lightDiffuseColour light_diffuse_colour 0
+		param_named_auto lightPos light_position 0
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+	}
+}
+vertex_program InstancingShadowCasterGLSL glsl
+{
+   	source instancingVp.glsl
+	preprocessor_defines SHADOW_CASTER=1
+	default_params
+	{
+		param_named_auto ambient ambient_light_colour
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+	}
+}
+vertex_program CrowdGLSL glsl
+{
+	source crowdVp.glsl
+	preprocessor_defines SHADOW_CASTER=0
+	default_params
+	{
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto numBones custom 0
+		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+		param_named_auto lightPos light_position 0
+		param_named_auto lightDiffuseColour light_diffuse_colour 0
+		param_named_auto ambient ambient_light_colour
+	}
+}
+vertex_program CrowdShadowCasterGLSL glsl
+{
+	source crowdVp.glsl
+	preprocessor_defines SHADOW_CASTER=1
+	default_params
+	{
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto numBones custom 0
+		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+		param_named_auto ambient ambient_light_colour
+	}
+}
+
+
+vertex_program Instancing unified
+{
+	delegate InstancingGLSL
+	delegate InstancingCg
+}
+vertex_program InstancingShadowCaster unified
+{
+	delegate InstancingShadowCasterGLSL
+	delegate InstancingShadowCasterCg
+}
+vertex_program Crowd unified
+{
+	delegate CrowdGLSL
+	delegate CrowdCg
+}
+vertex_program CrowdShadowCaster unified
+{
+	delegate CrowdShadowCasterGLSL
+	delegate CrowdShadowCasterCg
+}
+
Index: /Samples/Media/materials/scripts/smoke.material
===================================================================
--- /Samples/Media/materials/scripts/smoke.material	(revision 5)
+++ /Samples/Media/materials/scripts/smoke.material	(revision 5)
@@ -0,0 +1,19 @@
+
+material Examples/Smoke
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_write off
+
+			texture_unit
+			{
+				texture smoke.png
+				tex_address_mode clamp
+			}
+		}
+	}
+}
Index: /Samples/Media/overlays/BasicOgreGuiTemplates.inc
===================================================================
--- /Samples/Media/overlays/BasicOgreGuiTemplates.inc	(revision 5)
+++ /Samples/Media/overlays/BasicOgreGuiTemplates.inc	(revision 5)
@@ -0,0 +1,47 @@
+// Ogre overlay scripts
+template container BorderPanel(SS/Templates/BasicBorderPanel)
+{
+	left 0
+	top 0
+	width 1
+	height 1
+	material Core/StatsBlockCenter
+    	border_size 0.06 0.06 0.06665 0.06665
+    	border_material Core/StatsBlockBorder
+    	border_topleft_uv     0.0000 0.0000 0.1914 0.2031
+	border_top_uv         0.1914 0.0000 0.8086 0.2031
+	border_topright_uv    0.8086 0.0000 1.0000 0.2031
+	border_left_uv        0.0000 0.2031 0.1914 0.7852
+	border_right_uv       0.8086 0.2031 1.0000 0.7852
+	border_bottomleft_uv  0.0000 0.7852 0.1914 1.0000
+        border_bottom_uv      0.1914 0.7852 0.8086 1.0000
+	border_bottomright_uv 0.8086 0.7852 1.0000 1.0000
+}
+
+template container BorderPanel(SS/Templates/BasicSmallBorderPanel) : SS/Templates/BasicBorderPanel
+{
+    border_size 0.04 0.04 0.04665 0.04665
+}
+
+
+template element TextArea(SS/Templates/BasicText)
+{
+	font_name Ogre
+	char_height 0.08
+	colour_top 1 1 0
+	colour_bottom 1 0.2 0.2
+	left 0.03
+	top 0.02
+	width 0.12
+	height 0.09
+}
+
+template container Panel(SS/Templates/BasicPanel)
+{
+	left 0 
+	top 0
+	width 1
+	height 1
+	material Core/StatsBlockCenter
+}
+
Index: /Samples/Media/overlays/Compositor.overlay
===================================================================
--- /Samples/Media/overlays/Compositor.overlay	(revision 5)
+++ /Samples/Media/overlays/Compositor.overlay	(revision 5)
@@ -0,0 +1,66 @@
+Example/CompositorOverlay
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Core/CompositorPanel)
+	{
+		metrics_mode pixels
+		vert_align top
+		left 5 
+		top 5
+		width 500
+		height 55
+		material Core/StatsBlockCenter
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+
+		element TextArea(Example/Compositor/Desc)
+		{
+			metrics_mode pixels
+			left 5
+			top 5
+			width 180
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Use keys 1-8 to toggle each compositor
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/Compositor/ActiveLabel)
+		{
+			metrics_mode pixels
+			left 5
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Active Compositors:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/Compositor/ActiveText)
+		{
+			metrics_mode pixels
+			left 155
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Current:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+	}
+}
Index: /Samples/Media/overlays/DP3.overlay
===================================================================
--- /Samples/Media/overlays/DP3.overlay	(revision 5)
+++ /Samples/Media/overlays/DP3.overlay	(revision 5)
@@ -0,0 +1,105 @@
+Example/DP3Overlay
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Core/DP3Panel)
+	{
+		metrics_mode pixels
+		vert_align top
+		left 5 
+		top 5
+		width 500
+		height 70
+		material Core/StatsBlockCenter
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+		element TextArea(Example/DP3/Light)
+		{
+			metrics_mode pixels
+			left 5
+			top 5
+			width 180
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [1,2,3] toggle lights
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/DP3/Object)
+		{
+			metrics_mode pixels
+			left 5
+			top 20
+			width 180
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [O] change objects
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/DP3/ObjectInfo)
+		{
+			metrics_mode pixels
+			left 155
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Current:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/DP3/Materials)
+		{
+			metrics_mode pixels
+			left 5
+			top 35
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [M] Change material
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/DP3/MaterialInfo)
+		{
+			metrics_mode pixels
+			left 155
+			top 35
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Current:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/DP3/Info)
+		{
+			metrics_mode pixels
+			left 5
+			top 50
+			width 250
+			height 30
+			font_name BlueHighway
+			char_height 16
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+	}
+}
Index: /Samples/Media/overlays/Example-CubeMapping.overlay
===================================================================
--- /Samples/Media/overlays/Example-CubeMapping.overlay	(revision 5)
+++ /Samples/Media/overlays/Example-CubeMapping.overlay	(revision 5)
@@ -0,0 +1,139 @@
+Example/CubeMappingOverlay
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Core/CubeMappingPanel)
+	{
+		metrics_mode pixels
+		vert_align top
+		left 5 
+		top 5
+		width 250
+		height 130
+		material Core/StatsBlockCenter
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+		element TextArea(Example/CubeMapping/Displacement)
+		{
+			metrics_mode pixels
+			left 5
+			top 5
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [1/2] Displacement:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/CubeMapping/Density)
+		{
+			metrics_mode pixels
+			left 5
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [3/4] Noise density:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/CubeMapping/TimeDensity)
+		{
+			metrics_mode pixels
+			left 5
+			top 35
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [5/6] Time density:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+
+		element TextArea(Example/CubeMapping/Noise)
+		{
+			metrics_mode pixels
+			left 5
+			top 50
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [N] Noise: _not_set_
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/CubeMapping/Material)
+		{
+			metrics_mode pixels
+			left 5
+			top 65
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [M] Material: *UNIMPLEMENTED*
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/CubeMapping/Object)
+		{
+			metrics_mode pixels
+			left 5
+			top 80
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [O] Object:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/CubeMapping/CubeMap)
+		{
+			metrics_mode pixels
+			left 5
+			top 95
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [C] CubeMap:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		
+		element TextArea(Example/CubeMapping/Random)
+		{
+			metrics_mode pixels
+			left 5
+			top 110
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [SPACE] Go random!
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+	}
+}
Index: /Samples/Media/overlays/Example-DynTex.overlay
===================================================================
--- /Samples/Media/overlays/Example-DynTex.overlay	(revision 5)
+++ /Samples/Media/overlays/Example-DynTex.overlay	(revision 5)
@@ -0,0 +1,194 @@
+Example/DynTexOverlay
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Core/DynTexPanel)
+	{
+		metrics_mode pixels
+		vert_align top
+		left 5 
+		top 5
+		width 200
+		height 100
+		material Core/StatsBlockCenter
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+		element TextArea(Example/DynTex/Note)
+		{
+			metrics_mode pixels
+			left 5
+			top 5
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Reaction parameters
+			colour_top 0.7 0.9 0.7
+			colour_bottom 0.5 0.7 0.5
+		}
+
+		element TextArea(Example/DynTex/Param_K)
+		{
+			metrics_mode pixels
+			left 5
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [1/2]K:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/DynTex/Param_F)
+		{
+			metrics_mode pixels
+			left 5
+			top 35
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [3/4]F:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/DynTex/Param_A0)
+		{
+			metrics_mode pixels
+			left 5
+			top 50
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [5/6]Diffusion 1:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/DynTex/Param_A1)
+		{
+			metrics_mode pixels
+			left 5
+			top 65
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [7/8]Diffusion 2:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/DynTex/Zero)
+		{
+			metrics_mode pixels
+			left 5
+			top 80
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [0]Reset initial conditions
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+
+	}
+}
+Example/VolTexOverlay
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Example/VolTexPanel)
+	{
+		metrics_mode pixels
+		vert_align top
+		left 5 
+		top 5
+		width 200
+		height 70
+		material Core/StatsBlockCenter
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+		element TextArea(Example/VolTex/Note)
+		{
+			metrics_mode pixels
+			left 5
+			top 5
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Julia parameters
+			colour_top 0.7 0.9 0.7
+			colour_bottom 0.5 0.7 0.5
+		}
+
+		element TextArea(Example/VolTex/Param_real)
+		{
+			metrics_mode pixels
+			left 5
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [1/2]real:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/VolTex/Param_imag)
+		{
+			metrics_mode pixels
+			left 5
+			top 35
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [3/4]imag:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/VolTex/Param_theta)
+		{
+			metrics_mode pixels
+			left 5
+			top 50
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [5/6]theta:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+
+	}
+}
Index: /Samples/Media/overlays/Example-Water.overlay
===================================================================
--- /Samples/Media/overlays/Example-Water.overlay	(revision 5)
+++ /Samples/Media/overlays/Example-Water.overlay	(revision 5)
@@ -0,0 +1,168 @@
+Example/WaterOverlay
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Core/WaterPanel)
+	{
+		metrics_mode pixels
+		vert_align top
+		left 5 
+		top 5
+		width 400
+		height 87
+		material Core/StatsBlockCenter
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+		    
+		element TextArea(Example/Water/Normals)
+		{
+			metrics_mode pixels
+			left 5
+			top 5
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [N]Normals:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Water/Rain)
+		{
+			metrics_mode pixels
+			left 5
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [SPACE]Rain
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Water/SkyBox)
+		{
+			metrics_mode pixels
+			left 5
+			top 35
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [B]SkyBox: 
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Water/Depth)
+		{
+			metrics_mode pixels
+			left 5
+			top 50
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [U/J]Head depth:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Water/Material)
+		{
+			metrics_mode pixels
+			left 5
+			top 65
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [M]Material:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Water/Note)
+		{
+			metrics_mode pixels
+			left 200
+			top 5
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Careful with these values!
+			colour_top 0.7 0.9 0.7
+			colour_bottom 0.5 0.7 0.5
+		}
+
+		element TextArea(Example/Water/Param_C)
+		{
+			metrics_mode pixels
+			left 200
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [1/2]Ripple speed:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Water/Param_D)
+		{
+			metrics_mode pixels
+			left 200
+			top 35
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [3/4]Distance:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Water/Param_U)
+		{
+			metrics_mode pixels
+			left 200
+			top 50
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [5/6]Viscosity:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Water/Param_T)
+		{
+			metrics_mode pixels
+			left 200
+			top 65
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [7/8]Time period:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+
+	}
+}
Index: /Samples/Media/overlays/Shadows.overlay
===================================================================
--- /Samples/Media/overlays/Shadows.overlay	(revision 5)
+++ /Samples/Media/overlays/Shadows.overlay	(revision 5)
@@ -0,0 +1,92 @@
+Example/ShadowsOverlay
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Core/ShadowsPanel)
+	{
+		metrics_mode pixels
+		vert_align top
+		left 5 
+		top 5
+		width 500
+		height 55
+		material Core/StatsBlockCenter
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+
+		element TextArea(Example/Shadows/ShadowTechnique)
+		{
+			metrics_mode pixels
+			left 5
+			top 5
+			width 180
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [O] Shadow Technique
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/Shadows/ShadowTechniqueInfo)
+		{
+			metrics_mode pixels
+			left 155
+			top 5
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Current:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Shadows/Materials)
+		{
+			metrics_mode pixels
+			left 5
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [M] Athene Material
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/Shadows/MaterialInfo)
+		{
+			metrics_mode pixels
+			left 155
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Current:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/Shadows/Info)
+		{
+			metrics_mode pixels
+			left 5
+			top 35
+			width 250
+			height 30
+			font_name BlueHighway
+			char_height 16
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+	}
+}
Index: /Samples/Media/particle/Example-Water.particle
===================================================================
--- /Samples/Media/particle/Example-Water.particle	(revision 5)
+++ /Samples/Media/particle/Example-Water.particle	(revision 5)
@@ -0,0 +1,35 @@
+Examples/Water/Rain
+{
+    material        Examples/Droplet
+    particle_width  100
+    particle_height 300
+    cull_each       true
+    quota           100
+    // Make common direction straight down (faster than self oriented)
+    billboard_type  oriented_common
+    common_direction 0 -1 0
+    
+    // Area emitter
+    emitter Box
+    {
+        angle           0
+        emission_rate   20
+        time_to_live    5
+        direction       0 -1 0
+        velocity    	1000
+        colour_range_start  0.3 1 0.3
+        colour_range_end    0.7 1 0.7
+        width           3000
+        height          3000
+        depth           0
+    }
+
+    // Gravity
+    affector LinearForce
+    {
+        force_vector      0 -1000 0
+        force_application add
+    }
+
+}
+
Index: /Samples/Media/particle/Example.particle
===================================================================
--- /Samples/Media/particle/Example.particle	(revision 5)
+++ /Samples/Media/particle/Example.particle	(revision 5)
@@ -0,0 +1,395 @@
+// Example particle systems
+
+// Exudes greeny particles which float upwards
+Examples/GreenyNimbus
+{
+    material        Examples/FlarePointSprite
+	point_rendering	true
+	// point rendering means size is controlled by material
+	// provide fallback sizes for hardware that doesn't support point sprite
+    particle_width  30
+    particle_height 30
+    cull_each       false
+	cull_each       false
+    quota           10000
+    billboard_type  point
+    
+    // Area emitter
+    emitter Box
+    {
+        angle           30
+        emission_rate   30
+        time_to_live    5
+        direction       0 1 0
+        velocity    	0
+        colour_range_start  1 1 0
+        colour_range_end    0.3 1 0.3
+        width           60
+        height          60
+        depth           60
+    }
+
+    // Make em float upwards
+    affector LinearForce
+    {
+        force_vector      0 100 0
+        force_application add
+    }
+
+    // Fader
+    affector ColourFader
+    {
+        red -0.25
+        green -0.25
+        blue -0.25
+    }
+
+
+}
+
+// A sparkly purple fountain
+Examples/PurpleFountain
+{
+    material        Examples/Flare2
+    particle_width  20
+    particle_height 40
+    cull_each       false
+    quota           10000
+    billboard_type  oriented_self
+    
+    // Area emitter
+    emitter Point
+    {
+        angle           15
+        emission_rate   75
+        time_to_live    3
+        direction       0 1 0
+        velocity_min    250
+        velocity_max    300
+        colour_range_start  0 0 0
+        colour_range_end    1 1 1
+    }
+
+    // Gravity
+    affector LinearForce
+    {
+        force_vector      0 -100 0
+        force_application add
+    }
+
+    // Fader
+    affector ColourFader
+    {
+        red -0.25
+        green -0.25
+        blue -0.25
+    }
+}
+
+
+// A downpour
+Examples/Rain
+{
+    material        Examples/Droplet
+    particle_width  20
+    particle_height 100
+    cull_each       true
+    quota           10000
+    // Make common direction straight down (faster than self oriented)
+    billboard_type  oriented_common
+    common_direction 0 -1 0
+    
+    // Area emitter
+    emitter Box
+    {
+        angle           0
+        emission_rate   100
+        time_to_live    5
+        direction       0 -1 0
+        velocity    	50
+        colour_range_start  0.3 1 0.3
+        colour_range_end    0.7 1 0.7
+        width           1000
+        height          1000
+        depth           0
+    }
+
+    // Gravity
+    affector LinearForce
+    {
+        force_vector      0 -200 0
+        force_application add
+    }
+
+}
+
+// A jet engine (of sorts)
+Examples/JetEngine1
+{
+	material 		Examples/Flare
+	particle_width 	25
+	particle_height	25
+	cull_each		false
+	quota			200
+	billboard_type	point
+
+	emitter Point
+	{
+		angle 5
+		emission_rate 100
+        time_to_live    1
+        direction       0 -1 0
+        velocity_min    250
+        velocity_max    300
+        colour_range_start  1 1 0.5
+        colour_range_end    1 0.8 0.3
+		
+	}
+	affector ColourFader
+	{
+		red -0.25
+		green -1
+		blue -1
+	}
+	
+}
+Examples/JetEngine2
+{
+	material 		Examples/Flare
+	particle_width 	15
+	particle_height	15
+	cull_each		false
+	quota			200
+	billboard_type	point
+
+	emitter Point
+	{
+		angle 3
+		emission_rate 100
+        time_to_live    1
+        direction       0 -1 0
+        velocity_min    350
+        velocity_max    400
+        colour_range_start  0.5 1 1
+        colour_range_end    0.3 0.8 1
+		
+	}
+	affector ColourFader
+	{
+		red -1
+		green -1
+		blue -0.5
+	}
+	
+}
+
+// Exudes aureola particles which around the model float upwards
+Examples/Aureola
+{
+    material        Examples/Aureola
+    particle_width  200
+    particle_height 200
+    cull_each       false
+    quota           100
+    billboard_type  perpendicular_common
+    common_direction 0 1 0
+    common_up_vector 0 0 1
+
+    // Area emitter
+    emitter Box
+    {
+        angle           30
+        emission_rate   4
+        time_to_live    5
+        position        0 -100 0
+        direction       0 1 0
+        velocity_min  	0
+        velocity_max  	30
+        colour_range_start  0.3 0.3 0.3 0.0
+        colour_range_end    0.8 0.8 0.8 0.0
+        width           10
+        height          10
+        depth           30
+    }
+
+    // Make em float upwards
+    affector LinearForce
+    {
+        force_vector      0 70 0
+        force_application add
+    }
+
+    // Fader
+    affector ColourFader2
+    {
+        red1 +0.4
+        green1 +0.4
+        blue1 +0.4
+        alpha1 +0.7
+
+        red2 -0.25
+        green2 -0.25
+        blue2 -0.25
+        alpha2 -0.3333
+
+        state_change 3.5
+    }
+
+    // Rotater
+    affector Rotator
+    {
+        rotation_range_start 0
+        rotation_range_end 360
+        rotation_speed_range_start 0
+        rotation_speed_range_end 180
+    }
+}
+
+
+Examples/Swarm
+{
+	quota	3000
+	material	Examples/Flare2
+	particle_width	12
+	particle_height	24
+	cull_each	true
+	renderer	billboard
+	sorted	true
+	local_space	false
+	billboard_type	oriented_self
+
+	emitter Box
+	{
+		angle	180
+		colour	1 1 1 1
+		colour_range_start	1 1 1 1
+		colour_range_end	1 1 1 1
+		direction	0 1 0
+		emission_rate	30
+		position	0 0 0
+		velocity	50
+		velocity_min	50
+		velocity_max	1
+		time_to_live	20
+		time_to_live_min	20
+		time_to_live_max	20
+		duration	0
+		duration_min	0
+		duration_max	0
+		repeat_delay	0
+		repeat_delay_min	0
+		repeat_delay_max	0
+		width	80
+		height	80
+		depth	80
+	}
+
+	affector ColourFader
+	{
+		red	-0.05
+		green	0
+		blue	0
+		alpha	0
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 -50 0
+		plane_normal	0 1 0
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 50 0
+		plane_normal	0 -1 0
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	50 0 0
+		plane_normal	-1 0 0
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	-50 0 0
+		plane_normal	1 0 0
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 0 50
+		plane_normal	0 0 -1
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 0 -50
+		plane_normal	0 0 1
+		bounce	1
+	}
+
+	affector DirectionRandomiser
+	{
+		randomness	60
+	}
+}
+
+
+Examples/Snow
+{
+	quota	2000
+	material	Examples/Flare
+	particle_width	4
+	particle_height	4
+	cull_each	true
+	renderer	billboard
+	sorted	true
+	local_space	false
+	billboard_type	point
+
+	emitter Box
+	{
+		angle	0
+		colour	1 1 1 1
+		colour_range_start	1 1 1 1
+		colour_range_end	1 1 1 1
+		direction	0 -1 0
+		emission_rate	100
+		position	0 200 0
+		velocity	20
+		velocity_min	20
+		velocity_max	20
+		time_to_live	20
+		time_to_live_min	20
+		time_to_live_max	20
+		duration	0
+		duration_min	0
+		duration_max	0
+		repeat_delay	0
+		repeat_delay_min	0
+		repeat_delay_max	0
+		width	200
+		height	200
+		depth	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 0 0
+		plane_normal	0 1 0
+		bounce	0
+	}
+
+	affector DirectionRandomiser
+	{
+		randomness	10
+	}
+}
+
+
Index: /Samples/Media/particle/emitted_emitter.particle
===================================================================
--- /Samples/Media/particle/emitted_emitter.particle	(revision 5)
+++ /Samples/Media/particle/emitted_emitter.particle	(revision 5)
@@ -0,0 +1,56 @@
+// Example emitted emitters
+Examples/Fireworks
+{
+    material Examples/Flare
+    point_rendering            false
+    particle_width             10
+    particle_height            10
+    cull_each                  false
+    quota                      1000
+    emit_emitter_quota         10
+    billboard_type             point
+    
+    // Emitter that emits multiple Point emitters with name 'explosion'
+    emitter Box
+    {
+        name                    mainEmitter
+        emit_emitter            explosion
+        angle                   30
+        emission_rate           1000
+        time_to_live            3
+        direction               0 1 0
+        velocity                200
+    }
+
+    // This Point emitter is emitted by the Box emitter and emits billboard particles itself
+    emitter Point
+    {
+        name                    explosion
+        angle                   360
+        emission_rate           1000
+        time_to_live            2
+        direction               0 1 0
+        velocity                80
+        duration                0.1
+        repeat_delay_min        2
+        repeat_delay_max        3
+    }
+
+    // Make em float downwards
+    affector LinearForce
+    {
+        force_vector            0 -100 0
+        force_application       add
+    }
+
+    // Give em some nice colours
+    affector ColourInterpolator
+    {
+        time0                   0
+        colour0                 1 1 0
+        time1                   0.5
+        colour1                 1 0 0
+        time2                   0.9
+        colour2                 0 0 1
+    }
+}
Index: /Samples/Media/particle/smoke.particle
===================================================================
--- /Samples/Media/particle/smoke.particle	(revision 5)
+++ /Samples/Media/particle/smoke.particle	(revision 5)
@@ -0,0 +1,43 @@
+// Example particle systems
+
+// smoke
+Examples/Smoke
+{
+    	material        	Examples/Smoke
+    	particle_width  	55
+    	particle_height 	55
+    	cull_each       	true
+    	quota           	500
+    	billboard_type  	point
+		sorted				true
+    
+    	// Area emitter
+    	emitter Point
+    	{
+		angle               		11
+        	emission_rate       		15
+        	time_to_live        		4
+        	direction           		0 1 0
+        	velocity_min        		150
+        	velocity_max        		240    	
+	}
+
+	affector ColourImage
+	{
+		image		smokecolors.png
+	}
+
+   	affector Rotator
+   	{
+        	rotation_range_start  		0
+        	rotation_range_end   	 	360
+        	rotation_speed_range_start  	-60
+        	rotation_speed_range_end    	200
+   	}
+
+   	affector Scaler
+   	{
+       	rate 	100
+   	}
+
+}
Index: /Samples/Media/terrain.cfg
===================================================================
--- /Samples/Media/terrain.cfg	(revision 5)
+++ /Samples/Media/terrain.cfg	(revision 5)
@@ -0,0 +1,71 @@
+# The main world texture (if you wish the terrain manager to create a material for you)
+WorldTexture=terrain_texture.jpg
+
+# The detail texture (if you wish the terrain manager to create a material for you)
+DetailTexture=terrain_detail.jpg
+
+#number of times the detail texture will tile in a terrain tile
+DetailTile=3
+
+# Heightmap source
+PageSource=Heightmap
+
+# Heightmap-source specific settings
+Heightmap.image=terrain.png
+
+# If you use RAW, fill in the below too
+# RAW-specific setting - size (horizontal/vertical)
+#Heightmap.raw.size=513
+# RAW-specific setting - bytes per pixel (1 = 8bit, 2=16bit)
+#Heightmap.raw.bpp=2
+
+# How large is a page of tiles (in vertices)? Must be (2^n)+1
+PageSize=513
+
+# How large is each tile? Must be (2^n)+1 and be smaller than PageSize
+TileSize=65
+
+# The maximum error allowed when determining which LOD to use
+MaxPixelError=3
+
+# The size of a terrain page, in world units
+PageWorldX=1500
+PageWorldZ=1500
+# Maximum height of the terrain 
+MaxHeight=100
+
+# Upper LOD limit
+MaxMipMapLevel=5
+
+#VertexNormals=yes
+#VertexColors=yes
+#UseTriStrips=yes
+
+# Use vertex program to morph LODs, if available
+VertexProgramMorph=yes
+
+# The proportional distance range at which the LOD morph starts to take effect
+# This is as a proportion of the distance between the current LODs effective range,
+# and the effective range of the next lower LOD
+LODMorphStart=0.2
+
+# This following section is for if you want to provide your own terrain shading routine
+# Note that since you define your textures within the material this makes the 
+# WorldTexture and DetailTexture settings redundant
+
+# The name of the vertex program parameter you wish to bind the morph LOD factor to
+# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely
+# to the same position as the next lower LOD
+# USE THIS IF YOU USE HIGH-LEVEL VERTEX PROGRAMS WITH LOD MORPHING
+#MorphLODFactorParamName=morphFactor
+
+# The index of the vertex program parameter you wish to bind the morph LOD factor to
+# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely
+# to the same position as the next lower LOD
+# USE THIS IF YOU USE ASSEMBLER VERTEX PROGRAMS WITH LOD MORPHING
+#MorphLODFactorParamIndex=4
+
+# The name of the material you will define to shade the terrain
+#CustomMaterialName=TestTerrainMaterial
+
+
Index: /Samples/OceanDemo/Makefile.am
===================================================================
--- /Samples/OceanDemo/Makefile.am	(revision 5)
+++ /Samples/OceanDemo/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/OceanDemo/Makefile.in
===================================================================
--- /Samples/OceanDemo/Makefile.in	(revision 5)
+++ /Samples/OceanDemo/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/OceanDemo
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/OceanDemo/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/OceanDemo/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/OceanDemo/include/Makefile.am
===================================================================
--- /Samples/OceanDemo/include/Makefile.am	(revision 5)
+++ /Samples/OceanDemo/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = MaterialControls.h OceanDemo.h
Index: /Samples/OceanDemo/include/Makefile.in
===================================================================
--- /Samples/OceanDemo/include/Makefile.in	(revision 5)
+++ /Samples/OceanDemo/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/OceanDemo/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = MaterialControls.h OceanDemo.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/OceanDemo/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/OceanDemo/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/OceanDemo/include/MaterialControls.h
===================================================================
--- /Samples/OceanDemo/include/MaterialControls.h	(revision 5)
+++ /Samples/OceanDemo/include/MaterialControls.h	(revision 5)
@@ -0,0 +1,125 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __MaterialControls_H__
+#define __MaterialControls_H__
+
+#include "CEGUI/CEGUIForwardRefs.h"
+#include "OgreString.h"
+
+enum ShaderValType
+{
+	GPU_VERTEX, GPU_FRAGMENT, MAT_SPECULAR, MAT_DIFFUSE, MAT_AMBIENT, MAT_SHININESS, MAT_EMISSIVE
+};
+
+//---------------------------------------------------------------------------
+struct ShaderControl
+{
+    Ogre::String Name;
+	Ogre::String ParamName;
+	ShaderValType ValType;
+	float MinVal;
+	float MaxVal;
+	size_t ElementIndex;
+	mutable size_t PhysicalIndex;
+
+	float getRange(void) const { return MaxVal - MinVal; }
+	float convertParamToScrollPosition(const float val) const { return val - MinVal; }
+	float convertScrollPositionToParam(const float val) const { return val + MinVal; }
+};
+
+typedef std::vector<ShaderControl> ShaderControlsContainer;
+typedef ShaderControlsContainer::iterator ShaderControlIterator;
+// used for materials that have user controls
+
+//---------------------------------------------------------------------------
+class MaterialControls
+{
+public:
+    MaterialControls(const Ogre::String& displayName, const Ogre::String& materialName)
+        : mDisplayName(displayName)
+        , mMaterialName(materialName)
+    {
+    };
+
+    ~MaterialControls(void){}
+
+    const Ogre::String& getDisplayName(void) const { return mDisplayName; }
+    const Ogre::String& getMaterialName(void) const { return mMaterialName; }
+    size_t getShaderControlCount(void) const { return mShaderControlsContainer.size(); }
+    const ShaderControl& getShaderControl(const size_t idx) const
+    {
+        assert( idx < mShaderControlsContainer.size() );
+        return mShaderControlsContainer[idx];
+    }
+    /** add a new control by passing a string parameter
+
+    @param
+      params is a string using the following format:
+        "<Control Name>, <Shader parameter name>, <Parameter Type>, <Min Val>, <Max Val>, <Parameter Sub Index>"
+
+        <Control Name> is the string displayed for the control name on screen
+        <Shader parameter name> is the name of the variable in the shader
+        <Parameter Type> can be GPU_VERTEX, GPU_FRAGMENT
+        <Min Val> minimum value that parameter can be
+        <Max Val> maximum value that parameter can be
+        <Parameter Sub Index> index into the the float array of the parameter.  All GPU parameters are assumed to be float[4].
+
+    */
+    void addControl(const Ogre::String& params);
+
+protected:
+
+    Ogre::String mDisplayName;
+    Ogre::String mMaterialName;
+
+    ShaderControlsContainer mShaderControlsContainer;
+};
+
+typedef std::vector<MaterialControls> MaterialControlsContainer;
+typedef MaterialControlsContainer::iterator MaterialControlsIterator;
+
+
+//---------------------------------------------------------------------------
+struct ShaderControlGUIWidget
+{
+	CEGUI::Window* TextWidget;
+	CEGUI::Window* NumberWidget;
+	CEGUI::Scrollbar*  ScrollWidget;
+
+	ShaderControlGUIWidget() : TextWidget(NULL), NumberWidget(NULL), ScrollWidget(NULL) {}
+};
+
+//---------------------------------------------------------------------------
+/** loads material shader controls from a configuration file
+    A .controls file is made up of the following:
+
+    [<material display name>]
+    material = <material name>
+    control = <Control Name>, <Shader parameter name>, <Parameter Type>, <Min Val>, <Max Val>, <Parameter Sub Index>
+
+    <material display name> is what is displayed in the material combo box.
+    <material name> is the name of the material in the material script.
+    control is the shader control associated with the material. The order
+    of the contol definions in the .controls file determins their order
+    when displayed in the controls window.
+
+    you can have multiple .controls files or put them all in one.
+*/
+void loadMaterialControlsFile(MaterialControlsContainer& controlsContainer, const Ogre::String& filename);
+/** load all control files found in resource paths
+*/
+void loadAllMaterialControlFiles(MaterialControlsContainer& controlsContainer);
+
+#endif // __MaterialControls_H__
Index: /Samples/OceanDemo/include/OceanDemo.h
===================================================================
--- /Samples/OceanDemo/include/OceanDemo.h	(revision 5)
+++ /Samples/OceanDemo/include/OceanDemo.h	(revision 5)
@@ -0,0 +1,212 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef _OceanDemo_H_
+#define _OceanDemo_H_
+
+#include "CEGUI/CEGUI.h"
+#include "OgreCEGUIRenderer.h"
+
+#include "OgreConfigFile.h"
+#include "OgreStringConverter.h"
+#include "OgreException.h"
+#include "OgreFrameListener.h"
+
+#include "MaterialControls.h"
+#include <OIS/OIS.h>
+
+//---------------------------------------------------------------------------
+enum MovementType
+{
+	mv_CAMERA, mv_MODEL, mv_LIGHT
+};
+
+//---------------------------------------------------------------------------
+class OceanDemo;
+
+class OceanDemo_FrameListener : public Ogre::FrameListener, public OIS::KeyListener, OIS::MouseListener
+{
+#define MINSPEED .150f
+#define MOVESPEED 30
+#define MAXSPEED 1.800f
+
+
+protected:
+	OceanDemo* mMain;
+
+    Ogre::Vector3 mTranslateVector;
+    bool mStatsOn;
+	unsigned int mNumScreenShots;
+	bool mWriteToFile;
+    float mMoveScale;
+    float mRotScale;
+	float mSpeed;
+	float mAvgFrameTime;
+	int mSceneDetailIndex;
+    Ogre::Real mMoveSpeed;
+    Ogre::Real mRotateSpeed;
+	float mSkipCount;
+	float mUpdateFreq;
+	CEGUI::Point mLastMousePosition;
+	bool mLastMousePositionSet;
+	bool mSpinModel;
+	bool mSpinLight;
+
+	OIS::Mouse *mMouse;
+	OIS::Keyboard *mKeyboard;
+    OIS::InputManager* mInputManager;
+
+    // just to stop toggles flipping too fast
+    Ogre::Real mTimeUntilNextToggle ;
+    float mRotX, mRotY;
+    Ogre::TextureFilterOptions mFiltering;
+    int mAniso;
+	bool mQuit;
+	bool mLMBDown;
+	bool mRMBDown;
+	bool mProcessMovement;
+	bool mUpdateMovement;
+	bool mMoveFwd;
+	bool mMoveBck;
+	bool mMoveLeft;
+	bool mMoveRight;
+
+	CEGUI::Renderer* mGuiRenderer;
+	CEGUI::Window* mGuiAvg;
+	CEGUI::Window* mGuiCurr;
+	CEGUI::Window* mGuiBest;
+	CEGUI::Window* mGuiWorst;
+	CEGUI::Window* mGuiTris;
+	CEGUI::Window* mGuiDbg;
+	CEGUI::Window* mRoot;
+
+	std::string mDebugText;
+
+	CEGUI::MouseButton convertOISButtonToCegui(int ois_button_id);
+	void CheckMovementKeys( CEGUI::Key::Scan keycode, bool state );
+	void updateStats(void);
+
+
+public:
+	OceanDemo_FrameListener(OceanDemo* main);
+	virtual ~OceanDemo_FrameListener();
+
+
+	virtual bool mouseMoved ( const OIS::MouseEvent &arg );
+	virtual bool mousePressed ( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
+	virtual bool mouseReleased ( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
+
+	virtual bool keyPressed ( const OIS::KeyEvent &arg );
+	virtual bool keyReleased ( const OIS::KeyEvent &arg );
+
+	bool frameStarted(const Ogre::FrameEvent& evt);
+	bool handleMouseMove(const CEGUI::EventArgs& e);
+	bool handleMouseButtonUp(const CEGUI::EventArgs& e);
+	bool handleMouseButtonDown(const CEGUI::EventArgs& e);
+	bool handleMouseWheelEvent(const CEGUI::EventArgs& e);
+	bool handleKeyDownEvent(const CEGUI::EventArgs& e);
+	bool handleKeyUpEvent(const CEGUI::EventArgs& e);
+	bool handelModelSpinChange(const CEGUI::EventArgs& e);
+	bool handelLightSpinChange(const CEGUI::EventArgs& e);
+};
+
+
+
+
+//---------------------------------------------------------------------------
+class OceanDemo
+{
+protected:
+    Ogre::Root*			  mRoot;
+    Ogre::Camera*		  mCamera;
+    Ogre::SceneManager*	  mSceneMgr;
+	// the scene node of the entity
+	Ogre::SceneNode*	  mMainNode;
+
+    OceanDemo_FrameListener* mFrameListener;
+    Ogre::RenderWindow*	  mWindow;
+    CEGUI::OgreCEGUIRenderer*    mGUIRenderer;
+    CEGUI::System*        mGUISystem;
+	Ogre::Entity*		  mCurrentEntity;
+    Ogre::Entity*         mOceanSurfaceEnt;
+
+	size_t				  mCurrentMaterial;
+	Ogre::MaterialPtr	  mActiveMaterial;
+	Ogre::Pass*			  mActivePass;
+	Ogre::GpuProgramPtr	  mActiveFragmentProgram;
+	Ogre::GpuProgramPtr	  mActiveVertexProgram;
+	Ogre::GpuProgramParametersSharedPtr mActiveFragmentParameters;
+	Ogre::GpuProgramParametersSharedPtr mActiveVertexParameters;
+
+	typedef std::vector< ShaderControlGUIWidget > ShaderControlContainer;
+	typedef ShaderControlContainer::iterator ShaderControlIterator;
+
+	ShaderControlContainer    mShaderControlContainer;
+    MaterialControlsContainer mMaterialControlsContainer;
+	CEGUI::Scrollbar*	  mVertScroll;
+	MovementType		  mMouseMovement;
+
+
+    // These internal methods package up the stages in the startup process
+    /** Sets up the application - returns false if the user chooses to abandon configuration. */
+    bool setup(void);
+
+	/** Configures the application - returns false if the user chooses to abandon configuration. */
+    bool configure(void);
+    void chooseSceneManager(void);
+    void createCamera(void);
+    void createViewports(void);
+
+    /// Method which will define the source of resources (other than current folder)
+    void setupResources(void);
+	void loadResources(void);
+	bool setupGUI(void);
+	void createScene(void);
+	void createFrameListener(void);
+
+	void initComboBoxes(void);
+	void initDemoEventWiring(void);
+	void configureShaderControls(void);
+
+	void doErrorBox(const char* text);
+
+	bool handleQuit(const CEGUI::EventArgs& e);
+	bool handleShaderControl(const CEGUI::EventArgs& e);
+	bool handleModelComboChanged(const CEGUI::EventArgs& e);
+	bool handleShaderComboChanged(const CEGUI::EventArgs& e);
+	bool handleScrollControlsWindow(const CEGUI::EventArgs& e);
+	bool handleMovementTypeChange(const CEGUI::EventArgs& e);
+
+	bool handleErrorBox(const CEGUI::EventArgs& e);
+	void setShaderControlVal(const float val, const size_t index);
+
+public:
+	OceanDemo() : mRoot(0), mFrameListener(0), mGUIRenderer(NULL), mGUISystem(0),
+        mCurrentEntity(0), mCurrentMaterial(0), mActivePass(0), mMouseMovement(mv_CAMERA)
+    {
+    }
+
+    ~OceanDemo();
+
+    void go(void);
+	Ogre::Camera* getCamera(void) const { return mCamera; }
+	Ogre::SceneManager* getSceneManager(void) const { return mSceneMgr; }
+	Ogre::RenderWindow* getRenderWindow(void) const { return mWindow; }
+	MovementType getMouseMovement(void) const { return mMouseMovement; }
+	Ogre::SceneNode* getMainNode(void) const { return mMainNode; }
+
+};
+
+
+#endif	// end _OceanDemo_H_
Index: /Samples/OceanDemo/script/Demo_Ocean.cbp
===================================================================
--- /Samples/OceanDemo/script/Demo_Ocean.cbp	(revision 5)
+++ /Samples/OceanDemo/script/Demo_Ocean.cbp	(revision 5)
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Ocean" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Ocean.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="ois_d" />
+					<Add library="CEGUIBase_d" />
+					<Add library="OgreGUIRenderer_d" />
+					<Add library="OgreMain_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Ocean.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="ois" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreGUIRenderer" />
+					<Add library="OgreMain" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI\elements" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI\falagard" />
+			<Add directory="..\..\Common\CEGUIRenderer\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\MaterialControls.h" />
+		<Unit filename="..\include\OceanDemo.h" />
+		<Unit filename="..\src\MaterialControls.cpp" />
+		<Unit filename="..\src\OceanDemo.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/OceanDemo/script/Demo_Ocean.vcproj
===================================================================
--- /Samples/OceanDemo/script/Demo_Ocean.vcproj	(revision 5)
+++ /Samples/OceanDemo/script/Demo_Ocean.vcproj	(revision 5)
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_Ocean"
+	ProjectGUID="{35134523-6D5B-4AFA-BFB4-4D57C42C2169}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/Zm150"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib"
+				OutputFile="$(OutDir)/Demo_Ocean.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_Ocean.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib CEGUIBase.lib OgreGUIRenderer.lib"
+				OutputFile="$(OutDir)/Demo_Ocean.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\MaterialControls.cpp">
+			</File>
+			<File
+				RelativePath="..\src\OceanDemo.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\MaterialControls.h">
+			</File>
+			<File
+				RelativePath="..\include\OceanDemo.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/OceanDemo/script/Demo_Ocean_linux.cbp
===================================================================
--- /Samples/OceanDemo/script/Demo_Ocean_linux.cbp	(revision 5)
+++ /Samples/OceanDemo/script/Demo_Ocean_linux.cbp	(revision 5)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Ocean" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_Ocean" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OIS" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreGUIRenderer_d" />
+					<Add library="OgreMain_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_Ocean" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OIS" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreGUIRenderer" />
+					<Add library="OgreMain" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+			<Add directory="../../Common/CEGUIRenderer/include" />
+			<Add directory="$(#CEGUI)" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/MaterialControls.h" />
+		<Unit filename="../include/OceanDemo.h" />
+		<Unit filename="../src/MaterialControls.cpp" />
+		<Unit filename="../src/OceanDemo.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/OceanDemo/script/Demo_Ocean_stlp.cbp
===================================================================
--- /Samples/OceanDemo/script/Demo_Ocean_stlp.cbp	(revision 5)
+++ /Samples/OceanDemo/script/Demo_Ocean_stlp.cbp	(revision 5)
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_Ocean" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Ocean.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="CEGUIBase_d" />
+					<Add library="OgreGUIRenderer_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Ocean.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreGUIRenderer" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI\elements" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI\falagard" />
+			<Add directory="..\..\Common\CEGUIRenderer\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\MaterialControls.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\OceanDemo.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\MaterialControls.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\OceanDemo.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/OceanDemo/script/Demo_Ocean_vc8.vcproj
===================================================================
--- /Samples/OceanDemo/script/Demo_Ocean_vc8.vcproj	(revision 5)
+++ /Samples/OceanDemo/script/Demo_Ocean_vc8.vcproj	(revision 5)
@@ -0,0 +1,232 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_Ocean"
+	ProjectGUID="{E726B7BD-CB22-4CA5-AB6A-124FDDA6C4AC}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib"
+				OutputFile="$(OutDir)/Demo_Ocean.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_Ocean.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib  CEGUIBase.lib OgreGUIRenderer.lib"
+				OutputFile="$(OutDir)/Demo_Ocean.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\MaterialControls.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\OceanDemo.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\MaterialControls.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\OceanDemo.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/OceanDemo/script/Demo_Ocean_vc8.vcproj.user
===================================================================
--- /Samples/OceanDemo/script/Demo_Ocean_vc8.vcproj.user	(revision 5)
+++ /Samples/OceanDemo/script/Demo_Ocean_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/OceanDemo/src/Makefile.am
===================================================================
--- /Samples/OceanDemo/src/Makefile.am	(revision 5)
+++ /Samples/OceanDemo/src/Makefile.am	(revision 5)
@@ -0,0 +1,7 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/OceanDemo/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/CEGUIRenderer/include -I$(top_srcdir)/Samples/Common/include @CEGUI_CFLAGS@ $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = OceanDemo
+
+OceanDemo_SOURCES = MaterialControls.cpp OceanDemo.cpp
+OceanDemo_LDFLAGS = -L$(top_builddir)/OgreMain/src -L$(top_builddir)/Samples/Common/CEGUIRenderer/src
+OceanDemo_LDADD = -lOgreMain @CEGUI_LIBS@ -lCEGUIOgreRenderer $(OIS_LIBS)
Index: /Samples/OceanDemo/src/Makefile.in
===================================================================
--- /Samples/OceanDemo/src/Makefile.in	(revision 5)
+++ /Samples/OceanDemo/src/Makefile.in	(revision 5)
@@ -0,0 +1,527 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = OceanDemo$(EXEEXT)
+subdir = Samples/OceanDemo/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_OceanDemo_OBJECTS = MaterialControls.$(OBJEXT) OceanDemo.$(OBJEXT)
+OceanDemo_OBJECTS = $(am_OceanDemo_OBJECTS)
+am__DEPENDENCIES_1 =
+OceanDemo_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(OceanDemo_SOURCES)
+DIST_SOURCES = $(OceanDemo_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/OceanDemo/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/CEGUIRenderer/include -I$(top_srcdir)/Samples/Common/include @CEGUI_CFLAGS@ $(OIS_CFLAGS)
+OceanDemo_SOURCES = MaterialControls.cpp OceanDemo.cpp
+OceanDemo_LDFLAGS = -L$(top_builddir)/OgreMain/src -L$(top_builddir)/Samples/Common/CEGUIRenderer/src
+OceanDemo_LDADD = -lOgreMain @CEGUI_LIBS@ -lCEGUIOgreRenderer $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/OceanDemo/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/OceanDemo/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+OceanDemo$(EXEEXT): $(OceanDemo_OBJECTS) $(OceanDemo_DEPENDENCIES) 
+	@rm -f OceanDemo$(EXEEXT)
+	$(CXXLINK) $(OceanDemo_LDFLAGS) $(OceanDemo_OBJECTS) $(OceanDemo_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MaterialControls.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OceanDemo.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/OceanDemo/src/MaterialControls.cpp
===================================================================
--- /Samples/OceanDemo/src/MaterialControls.cpp	(revision 5)
+++ /Samples/OceanDemo/src/MaterialControls.cpp	(revision 5)
@@ -0,0 +1,123 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+#include "MaterialControls.h"
+#include "OgreLogManager.h"
+#include "OgreStringVector.h"
+#include "OgreStringConverter.h"
+#include "OgreConfigFile.h"
+#include "OgreResourceGroupManager.h"
+#include "OgreException.h"
+
+/********************************************************************************
+            MaterialControls Methods
+*********************************************************************************/
+void MaterialControls::addControl(const Ogre::String& params)
+{
+    // params is a string containing using the following format:
+    //  "<Control Name>, <Shader parameter name>, <Parameter Type>, <Min Val>, <Max Val>, <Parameter Sub Index>"
+
+    // break up long string into components
+    Ogre::StringVector vecparams = Ogre::StringUtil::split(params, ",");
+
+    // if there are not five elements then log error and move on
+    if (vecparams.size() != 6)
+    {
+        Ogre::LogManager::getSingleton().logMessage(
+            "Incorrect number of parameters passed in params string for MaterialControls::addControl()" );
+
+        return;
+    }
+
+    ShaderControl newControl;
+    Ogre::StringUtil::trim(vecparams[0]);
+    newControl.Name = vecparams[0];
+
+    Ogre::StringUtil::trim(vecparams[1]);
+    newControl.ParamName = vecparams[1];
+
+    Ogre::StringUtil::trim(vecparams[2]);
+    if (vecparams[2] == "GPU_VERTEX")
+        newControl.ValType = GPU_VERTEX;
+    else if (vecparams[2] == "GPU_FRAGMENT")
+        newControl.ValType = GPU_FRAGMENT;
+
+    newControl.MinVal = Ogre::StringConverter::parseReal(vecparams[3]);
+    newControl.MaxVal = Ogre::StringConverter::parseReal(vecparams[4]);
+    newControl.ElementIndex = Ogre::StringConverter::parseInt(vecparams[5]);
+
+    mShaderControlsContainer.push_back(newControl);
+
+}
+
+void loadMaterialControlsFile(MaterialControlsContainer& controlsContainer, const Ogre::String& filename)
+{
+    // Load material controls from config file
+    Ogre::ConfigFile cf;
+
+    try
+    {
+
+        cf.load(filename, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, "\t;=", true);
+
+        // Go through all sections & controls in the file
+        Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
+
+        Ogre::String secName, typeName, materialName, dataString;
+
+        while (seci.hasMoreElements())
+        {
+            secName = seci.peekNextKey();
+            Ogre::ConfigFile::SettingsMultiMap* settings = seci.getNext();
+            if (!secName.empty() && settings)
+            {
+                materialName = cf.getSetting("material", secName);
+
+                MaterialControls newMaaterialControls(secName, materialName);
+                controlsContainer.push_back(newMaaterialControls);
+
+                size_t idx = controlsContainer.size() - 1;
+
+                Ogre::ConfigFile::SettingsMultiMap::iterator i;
+
+                for (i = settings->begin(); i != settings->end(); ++i)
+                {
+                    typeName = i->first;
+                    dataString = i->second;
+                    if (typeName == "control")
+                        controlsContainer[idx].addControl(dataString);
+                }
+            }
+        }
+
+	    Ogre::LogManager::getSingleton().logMessage( "Material Controls setup" );
+    }
+    catch (Ogre::Exception e)
+    {
+        // Guess the file didn't exist
+    }
+}
+
+
+void loadAllMaterialControlFiles(MaterialControlsContainer& controlsContainer)
+{
+    Ogre::StringVectorPtr fileStringVector = Ogre::ResourceGroupManager::getSingleton().findResourceNames( Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, "*.controls" );
+    std::vector<Ogre::String>::iterator controlsFileNameIterator = fileStringVector->begin();
+
+    while ( controlsFileNameIterator != fileStringVector->end() )
+	{
+        loadMaterialControlsFile(controlsContainer, *controlsFileNameIterator);
+        ++controlsFileNameIterator;
+	}
+}
Index: /Samples/OceanDemo/src/OceanDemo.cpp
===================================================================
--- /Samples/OceanDemo/src/OceanDemo.cpp	(revision 5)
+++ /Samples/OceanDemo/src/OceanDemo.cpp	(revision 5)
@@ -0,0 +1,1428 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+#include "OceanDemo.h"
+#include "Ogre.h"
+
+#include <cstdlib>
+
+
+/**********************************************************************
+OS X Specific Resource Location Finding
+**********************************************************************/
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+
+Ogre::String bundlePath()
+{
+    char path[1024];
+    CFBundleRef mainBundle = CFBundleGetMainBundle();
+    assert( mainBundle );
+
+    CFURLRef mainBundleURL = CFBundleCopyBundleURL( mainBundle);
+    assert( mainBundleURL);
+
+    CFStringRef cfStringRef = CFURLCopyFileSystemPath( mainBundleURL, kCFURLPOSIXPathStyle);
+    assert( cfStringRef);
+
+    CFStringGetCString( cfStringRef, path, 1024, kCFStringEncodingASCII);
+
+    CFRelease( mainBundleURL);
+    CFRelease( cfStringRef);
+
+    return Ogre::String( path);
+}
+
+#endif
+
+/**********************************************************************
+  Static declarations
+**********************************************************************/
+// Lights
+#define NUM_LIGHTS 1
+
+// the light
+Ogre::Light* mLights[NUM_LIGHTS];
+// billboards for lights
+Ogre::BillboardSet* mLightFlareSets[NUM_LIGHTS];
+Ogre::Billboard* mLightFlares[NUM_LIGHTS];
+// Positions for lights
+Ogre::Vector3 mLightPositions[NUM_LIGHTS] =
+{
+	Ogre::Vector3(00, 400, 00)
+};
+// Base orientations of the lights
+Ogre::Real mLightRotationAngles[NUM_LIGHTS] = { 35 };
+Ogre::Vector3 mLightRotationAxes[NUM_LIGHTS] = {
+    Ogre::Vector3::UNIT_X
+};
+// Rotation speed for lights, degrees per second
+Ogre::Real mLightSpeeds[NUM_LIGHTS] = { 30};
+
+// Colours for the lights
+Ogre::ColourValue mDiffuseLightColours[NUM_LIGHTS] =
+{
+	Ogre::ColourValue(0.6, 0.6, 0.6)
+};
+
+Ogre::ColourValue mSpecularLightColours[NUM_LIGHTS] =
+{
+	Ogre::ColourValue(0.5, 0.5, 0.5)
+};
+
+// Which lights are enabled
+bool mLightState[NUM_LIGHTS] =
+{
+	true
+};
+
+// the light nodes
+Ogre::SceneNode* mLightNodes[NUM_LIGHTS];
+// the light node pivots
+Ogre::SceneNode* mLightPivots[NUM_LIGHTS];
+
+#define UVECTOR2(x, y) UVector2(cegui_reldim(x), cegui_reldim(y))
+#define TEXTWIDGET_SIZE UVECTOR2(0.19, 0.06)
+#define NUMBERWIDGET_SIZE UVECTOR2(0.065, 0.06)
+#define SCROLLWIDGET_SIZE UVECTOR2(0.21, 0.02)
+
+#define TEXTWIDGET_XPOS 0.01
+#define NUMBERWIDGET_XPOS 0.37
+#define SCROLLWIDGET_XPOS 0.50
+
+#define TEXTWIDGET_YADJUST (-0.05f)
+#define WIDGET_YSTART 0.2f
+#define WIDGET_YOFFSET 0.15f
+
+/*************************************************************************
+	sub-class for ListboxTextItem that auto-sets the selection brush
+	image.
+*************************************************************************/
+class MyListItem : public CEGUI::ListboxTextItem
+{
+public:
+    MyListItem(const CEGUI::String& text, CEGUI::uint id) : CEGUI::ListboxTextItem(text, id)
+	{
+		setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
+	}
+};
+
+
+
+/*********************************************************************
+    Main Program Entry Point
+***********************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char *argv[])
+#endif
+{
+	// Create application object
+	OceanDemo app;
+
+	try {
+		app.go();
+
+	} catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " <<
+            e.getFullDescription().c_str() << std::endl;
+#endif
+    }
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/*************************************************************************
+	                    OceanDemo Methods
+*************************************************************************/
+OceanDemo::~OceanDemo()
+{
+	delete mGUISystem;
+	delete mGUIRenderer;
+    delete mFrameListener;
+
+    // get rid of the shared pointers before shutting down ogre or exceptions occure
+    mActiveFragmentProgram.setNull();
+    mActiveFragmentParameters.setNull();
+    mActiveVertexProgram.setNull();
+    mActiveVertexParameters.setNull();
+    mActiveMaterial.setNull();
+
+    delete mRoot;
+}
+
+//--------------------------------------------------------------------------
+void OceanDemo::go(void)
+{
+    if (!setup())
+        return;
+
+    mRoot->startRendering();
+}
+
+//--------------------------------------------------------------------------
+bool OceanDemo::setup(void)
+{
+	bool setupCompleted = false;
+
+	#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+        Ogre::String mResourcePath;
+        mResourcePath = bundlePath() + "/Contents/Resources/";
+        mRoot = new Ogre::Root(mResourcePath + "plugins.cfg",
+                         mResourcePath + "ogre.cfg", mResourcePath + "Ogre.log");
+    #else
+
+        mRoot = new Ogre::Root();
+
+    #endif
+
+    setupResources();
+
+    if (configure())
+    {
+        chooseSceneManager();
+        createCamera();
+        createViewports();
+
+        // Set default mipmap level (NB some APIs ignore this)
+        Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
+        loadResources();
+
+
+        if (setupGUI())
+        {
+            // Create the scene
+            createScene();
+
+            createFrameListener();
+
+            // load some GUI stuff for demo.
+            loadAllMaterialControlFiles(mMaterialControlsContainer);
+            initDemoEventWiring();
+            initComboBoxes();
+            setupCompleted = true;
+        }
+    }
+
+	return setupCompleted;
+}
+
+//--------------------------------------------------------------------------
+bool OceanDemo::configure(void)
+{
+    // Show the configuration dialog and initialise the system
+    // You can skip this and use root.restoreConfig() to load configuration
+    // settings if you were sure there are valid ones saved in ogre.cfg
+    if(mRoot->showConfigDialog())
+    {
+        // If returned true, user clicked OK so initialise
+        // Here we choose to let the system create a default rendering window by passing 'true'
+        mWindow = mRoot->initialise(true);
+        return true;
+    }
+    else
+    {
+        return false;
+    }
+}
+
+//--------------------------------------------------------------------------
+void OceanDemo::chooseSceneManager(void)
+{
+    // Get the SceneManager, in this case a generic one
+    mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC, "ExampleSMInstance");
+}
+
+//--------------------------------------------------------------------------
+void OceanDemo::createCamera(void)
+{
+    // Create the camera
+    mCamera = mSceneMgr->createCamera("PlayerCam");
+
+    // Position it at 500 in Z direction
+    mCamera->setPosition(Ogre::Vector3(0,0,0));
+    // Look back along -Z
+    mCamera->lookAt(Ogre::Vector3(0,0,-300));
+    mCamera->setNearClipDistance(1);
+
+}
+
+//--------------------------------------------------------------------------
+void OceanDemo::createViewports(void)
+{
+    // Create one viewport, entire window
+    Ogre::Viewport* vp = mWindow->addViewport(mCamera);
+    vp->setBackgroundColour(Ogre::ColourValue(0,0,0));
+
+    // Alter the camera aspect ratio to match the viewport
+    mCamera->setAspectRatio(
+        Ogre::Real(vp->getActualWidth()) / Ogre::Real(vp->getActualHeight()));
+}
+
+//--------------------------------------------------------------------------
+void OceanDemo::setupResources(void)
+{
+    // Load resource paths from config file
+    Ogre::ConfigFile cf;
+
+    #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+        Ogre::String mResourcePath;
+        mResourcePath = bundlePath() + "/Contents/Resources/";
+        cf.load(mResourcePath + "resources.cfg");
+    #else
+        cf.load("resources.cfg");
+    #endif
+
+    // Go through all sections & settings in the file
+    Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
+
+    Ogre::String secName, typeName, archName;
+    while (seci.hasMoreElements())
+    {
+        secName = seci.peekNextKey();
+        Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
+        Ogre::ConfigFile::SettingsMultiMap::iterator i;
+        for (i = settings->begin(); i != settings->end(); ++i)
+        {
+            typeName = i->first;
+            archName = i->second;
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+                // OS X does not set the working directory relative to the app,
+                // In order to make things portable on OS X we need to provide
+                // the loading with it's own bundle path location
+                Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
+                    Ogre::String(bundlePath() + "/" + archName), typeName, secName);
+#else
+                Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
+                    archName, typeName, secName);
+#endif
+        }
+    }
+
+	Ogre::LogManager::getSingleton().logMessage( "Resource directories setup" );
+
+}
+
+//-----------------------------------------------------------------------------------
+	void OceanDemo::loadResources(void)
+	{
+		// Initialise, parse scripts etc
+        Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+
+	}
+
+//--------------------------------------------------------------------------
+bool OceanDemo::setupGUI(void)
+{
+    bool setupGUICompleted = false;
+	// setup GUI system
+	try
+	{
+        mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 0, mSceneMgr);
+        // load scheme and set up defaults
+
+        mGUISystem = new CEGUI::System(mGUIRenderer, 0, 0, 0, (CEGUI::utf8*)"OceanDemoCegui.config");
+        CEGUI::System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow");
+        setupGUICompleted = true;
+	}
+	catch(...)
+	{
+
+	}
+
+	return setupGUICompleted;
+}
+//--------------------------------------------------------------------------
+void OceanDemo::createScene(void)
+{
+    // Set ambient light
+    mSceneMgr->setAmbientLight(Ogre::ColourValue(0.3, 0.3, 0.3));
+	mSceneMgr->setSkyBox(true, "SkyBox", 1000);
+
+    mMainNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+
+
+    for (unsigned int i = 0; i < NUM_LIGHTS; ++i)
+    {
+        mLightPivots[i] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        mLightPivots[i]->rotate(mLightRotationAxes[i], Ogre::Angle(mLightRotationAngles[i]));
+        // Create a light, use default parameters
+        mLights[i] = mSceneMgr->createLight("Light" + Ogre::StringConverter::toString(i));
+		mLights[i]->setPosition(mLightPositions[i]);
+		mLights[i]->setDiffuseColour(mDiffuseLightColours[i]);
+		mLights[i]->setSpecularColour(mSpecularLightColours[i]);
+		mLights[i]->setVisible(mLightState[i]);
+		//mLights[i]->setAttenuation(400, 0.1 , 1 , 0);
+        // Attach light
+        mLightPivots[i]->attachObject(mLights[i]);
+		// Create billboard for light
+        mLightFlareSets[i] = mSceneMgr->createBillboardSet("Flare" + Ogre::StringConverter::toString(i));
+		mLightFlareSets[i]->setMaterialName("LightFlare");
+		mLightPivots[i]->attachObject(mLightFlareSets[i]);
+		mLightFlares[i] = mLightFlareSets[i]->createBillboard(mLightPositions[i]);
+		mLightFlares[i]->setColour(mDiffuseLightColours[i]);
+		mLightFlareSets[i]->setVisible(mLightState[i]);
+    }
+
+    // move the camera a bit right and make it look at the knot
+	mCamera->moveRelative(Ogre::Vector3(50, 0, 100));
+	mCamera->lookAt(0, 0, 0);
+
+    // Define a plane mesh that will be used for the ocean surface
+    Ogre::Plane oceanSurface;
+    oceanSurface.normal = Ogre::Vector3::UNIT_Y;
+    oceanSurface.d = 20;
+    Ogre::MeshManager::getSingleton().createPlane("OceanSurface",
+        Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+        oceanSurface,
+        1000, 1000, 50, 50, true, 1, 1, 1, Ogre::Vector3::UNIT_Z);
+
+    mOceanSurfaceEnt = mSceneMgr->createEntity( "OceanSurface", "OceanSurface" );
+    mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(mOceanSurfaceEnt);
+
+}
+
+
+//--------------------------------------------------------------------------
+void OceanDemo::initComboBoxes(void)
+{
+	using namespace CEGUI;
+
+
+	Combobox* cbobox = (Combobox*)WindowManager::getSingleton().getWindow("ShaderCombos");
+
+    for(size_t idx = 0; idx < mMaterialControlsContainer.size(); ++idx  )
+	{
+        cbobox->addItem(new MyListItem( mMaterialControlsContainer[idx].getDisplayName().c_str(), static_cast<CEGUI::uint>(idx)));
+	}
+
+	// make first item visible
+    if (cbobox->getItemCount() > 0)
+	    cbobox->setItemSelectState((size_t)0, true);
+
+    Editbox* eb;
+    // set text in combobox
+    if (!mMaterialControlsContainer.empty())
+    {
+        eb = (Editbox*)WindowManager::getSingleton().getWindow(cbobox->getName() + "__auto_editbox__");
+        eb->setText(mMaterialControlsContainer[0].getDisplayName().c_str());
+        handleShaderComboChanged(CEGUI::WindowEventArgs(cbobox));
+    }
+
+	cbobox = (Combobox*)WindowManager::getSingleton().getWindow("ModelCombos");
+    Ogre::StringVectorPtr meshStringVector = Ogre::ResourceGroupManager::getSingleton().findResourceNames( Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, "*.mesh" );
+    std::vector<Ogre::String>::iterator meshFileNameIterator = meshStringVector->begin();
+
+    while ( meshFileNameIterator != meshStringVector->end() )
+	{
+        cbobox->addItem(new MyListItem( (*meshFileNameIterator).c_str(), 0 ));
+        ++meshFileNameIterator;
+	}
+
+	// make first item visible
+	//cbobox->setItemSelectState((CEGUI::uint)0, true);
+ //   eb = (Editbox*)WindowManager::getSingleton().getWindow(cbobox->getName() + "__auto_editbox__");
+ //   if (meshStringVector->begin() != meshStringVector->end())
+ //   {
+ //       eb->setText((*meshStringVector->begin()).c_str());
+ //       handleModelComboChanged(CEGUI::WindowEventArgs(cbobox));
+ //   }
+
+}
+
+
+//--------------------------------------------------------------------------
+void OceanDemo::initDemoEventWiring(void)
+{
+	using namespace CEGUI;
+
+	WindowManager::getSingleton().getWindow("ExitDemoBtn")->
+		subscribeEvent(PushButton::EventClicked, CEGUI::Event::Subscriber(&OceanDemo::handleQuit, this));
+
+	WindowManager::getSingleton().getWindow("ModelCombos")->
+        subscribeEvent(Combobox::EventListSelectionAccepted, CEGUI::Event::Subscriber(&OceanDemo::handleModelComboChanged, this));
+
+	WindowManager::getSingleton().getWindow("ShaderCombos")->
+		subscribeEvent(Combobox::EventListSelectionAccepted, CEGUI::Event::Subscriber(&OceanDemo::handleShaderComboChanged, this));
+
+	Window* wndw = WindowManager::getSingleton().getWindow("root");
+
+	wndw->subscribeEvent(Window::EventMouseMove, CEGUI::Event::Subscriber(&OceanDemo_FrameListener::handleMouseMove, mFrameListener));
+
+	wndw->subscribeEvent(Window::EventMouseButtonUp, CEGUI::Event::Subscriber(&OceanDemo_FrameListener::handleMouseButtonUp, mFrameListener));
+
+	wndw->subscribeEvent(Window::EventMouseButtonDown, CEGUI::Event::Subscriber(&OceanDemo_FrameListener::handleMouseButtonDown, mFrameListener));
+
+	wndw->subscribeEvent(Window::EventMouseWheel, CEGUI::Event::Subscriber(&OceanDemo_FrameListener::handleMouseWheelEvent, mFrameListener));
+	wndw->subscribeEvent(Window::EventKeyDown, CEGUI::Event::Subscriber(&OceanDemo_FrameListener::handleKeyDownEvent, mFrameListener ));
+	wndw->subscribeEvent(Window::EventKeyUp, CEGUI::Event::Subscriber(&OceanDemo_FrameListener::handleKeyUpEvent, mFrameListener ));
+
+	wndw = WindowManager::getSingleton().getWindow("ModelSpinCB");
+	wndw->subscribeEvent(Checkbox::EventCheckStateChanged, CEGUI::Event::Subscriber(&OceanDemo_FrameListener::handelModelSpinChange, mFrameListener ));
+
+	wndw = WindowManager::getSingleton().getWindow("LightSpinCB");
+	wndw->subscribeEvent(Checkbox::EventCheckStateChanged, CEGUI::Event::Subscriber(&OceanDemo_FrameListener::handelLightSpinChange, mFrameListener ));
+
+	wndw = WindowManager::getSingleton().getWindow("CameraRBtn");
+	wndw->subscribeEvent(RadioButton::EventSelectStateChanged, CEGUI::Event::Subscriber(&OceanDemo::handleMovementTypeChange, this ));
+
+	wndw = WindowManager::getSingleton().getWindow("ModelRBtn");
+	wndw->subscribeEvent(RadioButton::EventSelectStateChanged, CEGUI::Event::Subscriber(&OceanDemo::handleMovementTypeChange, this ));
+
+	mVertScroll = (Scrollbar*)WindowManager::getSingleton().getWindow("VerticalScroll");
+	mVertScroll->subscribeEvent(Scrollbar::EventScrollPositionChanged, CEGUI::Event::Subscriber(&OceanDemo::handleScrollControlsWindow, this ));
+
+}
+
+
+//--------------------------------------------------------------------------
+void OceanDemo::doErrorBox(const char* text)
+{
+	using namespace CEGUI;
+
+	WindowManager& winMgr = WindowManager::getSingleton();
+	Window* root = winMgr.getWindow("root_wnd");
+
+	FrameWindow* errbox;
+
+	try
+	{
+		errbox = (FrameWindow*)winMgr.getWindow("ErrorBox");
+	}
+	catch(UnknownObjectException x)
+	{
+		// create frame window for box
+		FrameWindow* fwnd = (FrameWindow*)winMgr.createWindow("TaharezLook/FrameWindow", "ErrorBox");
+		root->addChildWindow(fwnd);
+		fwnd->setPosition(UVECTOR2(0.25, 0.25f));
+		fwnd->setMaxSize(UVECTOR2(1.0f, 1.0f));
+		fwnd->setSize(UVECTOR2(0.5f, 0.5f));
+		fwnd->setText("CEGUI Demo - Error!");
+		fwnd->setDragMovingEnabled(false);
+		fwnd->setSizingEnabled(false);
+		fwnd->setAlwaysOnTop(true);
+		fwnd->setCloseButtonEnabled(false);
+
+		// create error text message
+		Window* wnd = winMgr.createWindow("TaharezLook/StaticText", "ErrorBox/Message");
+		fwnd->addChildWindow(wnd);
+		wnd->setPosition(UVECTOR2(0.1f, 0.1f));
+		wnd->setSize(UVECTOR2(0.8f, 0.5f));
+		wnd->setProperty("VertFormatting", "VertCentred");
+		wnd->setProperty("HorzFormatting", "HorzCentred");
+		wnd->setProperty("BackgroundEnabled", "false");
+		wnd->setProperty("FrameEnabled", "false");
+
+		// create ok button
+		wnd = (PushButton*)winMgr.createWindow("TaharezLook/Button", "ErrorBox/OkButton");
+		fwnd->addChildWindow(wnd);
+		wnd->setPosition(UVECTOR2(0.3f, 0.80f));
+		wnd->setSize(UVECTOR2(0.4f, 0.1f));
+		wnd->setText("Okay!");
+
+		// subscribe event
+		wnd->subscribeEvent(PushButton::EventClicked, CEGUI::Event::Subscriber(&OceanDemo::handleErrorBox, this ));
+
+		errbox = fwnd;
+	}
+
+	errbox->getChild("ErrorBox/Message")->setText(text);
+	errbox->show();
+	errbox->activate();
+}
+
+
+//--------------------------------------------------------------------------
+bool OceanDemo::handleQuit(const CEGUI::EventArgs& e)
+{
+	mRoot->queueEndRendering();
+    return true;
+}
+
+//--------------------------------------------------------------------------
+void OceanDemo::setShaderControlVal(const float val, const size_t index)
+{
+	char valTxtBuf[20];
+
+	// set the text of the value
+	sprintf(valTxtBuf, "%3.3f", val );
+	mShaderControlContainer[index].NumberWidget->setText(valTxtBuf);
+}
+
+//--------------------------------------------------------------------------
+bool OceanDemo::handleShaderControl(const CEGUI::EventArgs& e)
+{
+	using namespace CEGUI;
+	using namespace Ogre;
+
+
+	size_t index = ((Scrollbar*)((const WindowEventArgs&)e).window)->getID();
+    const ShaderControl& ActiveShaderDef = mMaterialControlsContainer[mCurrentMaterial].getShaderControl(index);
+
+	float val = ((Scrollbar*)((const WindowEventArgs&)e).window)->getScrollPosition();
+	val = ActiveShaderDef.convertScrollPositionToParam(val);
+	setShaderControlVal( val, index );
+
+	if(mActivePass)
+	{
+		switch(ActiveShaderDef.ValType)
+		{
+			case GPU_VERTEX:
+			case GPU_FRAGMENT:
+				{
+					GpuProgramParametersSharedPtr activeParameters =
+						(ActiveShaderDef.ValType == GPU_VERTEX) ?
+							mActiveVertexParameters : mActiveFragmentParameters;
+
+					if(!activeParameters.isNull())
+					{
+						activeParameters->_writeRawConstant(
+							ActiveShaderDef.PhysicalIndex + ActiveShaderDef.ElementIndex, val);
+					}
+				}
+				break;
+
+			case MAT_SPECULAR:
+				{
+					// get the specular values from the material pass
+					ColourValue OldSpec(mActivePass->getSpecular());
+					OldSpec[ActiveShaderDef.ElementIndex] = val;
+					mActivePass->setSpecular( OldSpec );
+				}
+
+				break;
+
+			case MAT_DIFFUSE:
+				{
+					// get the specular values from the material pass
+					ColourValue OldSpec(mActivePass->getDiffuse());
+					OldSpec[ActiveShaderDef.ElementIndex] = val;
+					mActivePass->setDiffuse( OldSpec );
+				}
+				break;
+
+			case MAT_AMBIENT:
+				{
+					// get the specular values from the material pass
+					ColourValue OldSpec(mActivePass->getAmbient());
+					OldSpec[ActiveShaderDef.ElementIndex] = val;
+					mActivePass->setAmbient( OldSpec );
+				}
+				break;
+
+			case MAT_SHININESS:
+				// get the specular values from the material pass
+				mActivePass->setShininess( val );
+				break;
+		}
+	}
+
+    return true;
+}
+
+//--------------------------------------------------------------------------
+void OceanDemo::configureShaderControls(void)
+{
+	using namespace CEGUI;
+
+    if (mMaterialControlsContainer.empty()) return;
+
+    mActiveMaterial = Ogre::MaterialManager::getSingleton().getByName( mMaterialControlsContainer[mCurrentMaterial].getMaterialName() );
+    if(!mActiveMaterial.isNull() && mActiveMaterial->getNumSupportedTechniques())
+	{
+        Ogre::Technique* currentTechnique = mActiveMaterial->getSupportedTechnique(0);
+		if(currentTechnique)
+		{
+			mActivePass = currentTechnique->getPass(0);
+			if(mActivePass)
+			{
+                if (mActivePass->hasFragmentProgram())
+                {
+				    mActiveFragmentProgram = mActivePass->getFragmentProgram();
+    				mActiveFragmentParameters = mActivePass->getFragmentProgramParameters();
+                }
+                if (mActivePass->hasVertexProgram())
+                {
+				    mActiveVertexProgram = mActivePass->getVertexProgram();
+				    mActiveVertexParameters = mActivePass->getVertexProgramParameters();
+                }
+
+                size_t activeControlCount = mMaterialControlsContainer[mCurrentMaterial].getShaderControlCount();
+				mVertScroll->setDocumentSize( activeControlCount / 5.0f );
+				mVertScroll->setScrollPosition(0.0f);
+
+				// init the GUI controls
+				// check the material entry for Params GUI list
+                if(mMaterialControlsContainer[mCurrentMaterial].getShaderControlCount() > 0)
+				{
+					// if mShaderControlContainer size < Params list
+					if( activeControlCount > mShaderControlContainer.size())
+					{
+						// resize container
+						mShaderControlContainer.resize( activeControlCount );
+					}
+					Window* controlWindow = WindowManager::getSingleton().getWindow("ShaderControlsWin");
+					// initialize each widget based on control data
+					// iterate through the params GUI list
+					for( size_t i=0; i < activeControlCount; ++i )
+					{
+						const ShaderControl& ActiveShaderDef = mMaterialControlsContainer[mCurrentMaterial].getShaderControl(i);
+
+						// if TextWidget is NULL
+						Window* activeTextWidget = mShaderControlContainer[i].TextWidget;
+						if(activeTextWidget == NULL)
+						{
+							// create TextWidget
+
+							mShaderControlContainer[i].TextWidget = activeTextWidget =
+								WindowManager::getSingleton().createWindow("TaharezLook/StaticText",
+                                ( ("UniformTxt" + Ogre::StringConverter::toString(i)).c_str() ));
+							// add to Shader control window
+							controlWindow->addChildWindow( activeTextWidget );
+							// set position based on its index
+							activeTextWidget->setPosition(UVECTOR2(TEXTWIDGET_XPOS, WIDGET_YSTART + TEXTWIDGET_YADJUST + WIDGET_YOFFSET * float(i)));
+							activeTextWidget->setProperty("VertFormatting", "TopAligned");
+							activeTextWidget->setProperty("HorzFormatting", "RightAligned");
+							activeTextWidget->setProperty("FrameEnabled", "false");
+							activeTextWidget->setInheritsAlpha(false);
+							activeTextWidget->setProperty("BackgroundEnabled", "false");
+							activeTextWidget->setMaxSize( TEXTWIDGET_SIZE );
+							activeTextWidget->setMinSize( TEXTWIDGET_SIZE );
+							activeTextWidget->setSize( TEXTWIDGET_SIZE );
+						}
+
+						// set TextWidget text to control name
+                        activeTextWidget->setText( ActiveShaderDef.Name.c_str() );
+						// make TextWidget visible
+						activeTextWidget->show();
+
+						// if NumberWidget is NULL
+						Window* activeNumberWidget = mShaderControlContainer[i].NumberWidget;
+						if(activeNumberWidget == NULL)
+						{
+							// create NumberWidget
+
+							mShaderControlContainer[i].NumberWidget = activeNumberWidget =
+								WindowManager::getSingleton().createWindow("TaharezLook/StaticText",
+                                ( ("UniformNumTxt" + Ogre::StringConverter::toString(i)).c_str() ));
+							// add to Shader control window
+							controlWindow->addChildWindow( activeNumberWidget );
+							// set position based on its index
+							activeNumberWidget->setPosition(UVECTOR2(NUMBERWIDGET_XPOS, WIDGET_YSTART + TEXTWIDGET_YADJUST + WIDGET_YOFFSET * float(i)));
+							activeNumberWidget->setProperty("HorzFormatting", "RightAligned");
+							activeNumberWidget->setProperty("VertFormatting", "TopAligned");
+							activeNumberWidget->setProperty("FrameEnabled", "false");
+							activeNumberWidget->setInheritsAlpha(false);
+							activeNumberWidget->setProperty("BackgroundEnabled", "false");
+							activeNumberWidget->setMaxSize( NUMBERWIDGET_SIZE );
+							activeNumberWidget->setMinSize( NUMBERWIDGET_SIZE );
+							activeNumberWidget->setSize( NUMBERWIDGET_SIZE );
+						}
+						// make TextWidget visible
+						activeNumberWidget->show();
+
+						Scrollbar* activeScrollWidget = mShaderControlContainer[i].ScrollWidget;
+						// if ScrollWidget is NULL
+						if( activeScrollWidget == NULL )
+						{
+							// create ScrollWidget
+							mShaderControlContainer[i].ScrollWidget = activeScrollWidget =
+								(Scrollbar*)WindowManager::getSingleton().createWindow("TaharezLook/HorizontalScrollbar",
+                                ( ("UniformSB" + Ogre::StringConverter::toString(i)).c_str() ));
+							// add to Shader control window
+							controlWindow->addChildWindow( activeScrollWidget );
+							// set position based on its index
+							activeScrollWidget->setPosition(UVECTOR2(SCROLLWIDGET_XPOS, WIDGET_YSTART + WIDGET_YOFFSET * float(i)));
+							activeScrollWidget->setInheritsAlpha(false);
+							activeScrollWidget->setMaxSize( SCROLLWIDGET_SIZE );
+							activeScrollWidget->setMinSize( SCROLLWIDGET_SIZE );
+							activeScrollWidget->setSize( SCROLLWIDGET_SIZE );
+                            activeScrollWidget->setID( static_cast<CEGUI::uint>(i) );
+							activeScrollWidget->setOverlapSize(0);
+							// wire up ScrollWidget position changed event to handleShaderControl
+							activeScrollWidget->subscribeEvent(Scrollbar::EventScrollPositionChanged, CEGUI::Event::Subscriber(&OceanDemo::handleShaderControl, this ));						}
+						// set max value of ScrollWidget
+						float maxval = ActiveShaderDef.getRange();
+						activeScrollWidget->setDocumentSize(maxval);
+						activeScrollWidget->setPageSize(0.000);
+						activeScrollWidget->setStepSize(maxval/20);
+						// get current value of param
+
+						float uniformVal = 0.0;
+
+						switch(ActiveShaderDef.ValType)
+						{
+							case GPU_VERTEX:
+							case GPU_FRAGMENT:
+								{
+									Ogre::GpuProgramParametersSharedPtr activeParameters =
+										(ActiveShaderDef.ValType == Ogre::GPT_VERTEX_PROGRAM) ?
+											mActiveVertexParameters : mActiveFragmentParameters;
+									if(!activeParameters.isNull())
+									{
+										// use param name to get index : use appropiate paramters ptr
+										const Ogre::GpuConstantDefinition& def = 
+											activeParameters->getConstantDefinition(ActiveShaderDef.ParamName);
+										ActiveShaderDef.PhysicalIndex = def.physicalIndex;
+										// use index to get RealConstantEntry
+										const float* pFloat = activeParameters->getFloatPointer(ActiveShaderDef.PhysicalIndex);
+										// set position of ScrollWidget as param value
+										uniformVal = pFloat[ActiveShaderDef.ElementIndex];
+										activeScrollWidget->setScrollPosition( ActiveShaderDef.convertParamToScrollPosition(uniformVal) );
+									}
+								}
+								break;
+
+							case MAT_SPECULAR:
+								{
+									// get the specular values from the material pass
+
+									Ogre::ColourValue OldSpec(mActivePass->getSpecular());
+									uniformVal = OldSpec[ActiveShaderDef.ElementIndex];
+									activeScrollWidget->setScrollPosition( ActiveShaderDef.convertParamToScrollPosition(uniformVal) );
+								}
+								break;
+
+							case MAT_DIFFUSE:
+								{
+									// get the diffuse values from the material pass
+
+									Ogre::ColourValue OldSpec(mActivePass->getDiffuse());
+									uniformVal = OldSpec[ActiveShaderDef.ElementIndex];
+									activeScrollWidget->setScrollPosition( ActiveShaderDef.convertParamToScrollPosition(uniformVal) );
+								}
+								break;
+
+							case MAT_AMBIENT:
+								{
+									// get the ambient values from the material pass
+
+									Ogre::ColourValue OldSpec(mActivePass->getAmbient());
+									uniformVal = OldSpec[ActiveShaderDef.ElementIndex];
+									activeScrollWidget->setScrollPosition( ActiveShaderDef.convertParamToScrollPosition(uniformVal) );
+								}
+								break;
+
+							case MAT_SHININESS:
+								{
+									// get the ambient values from the material pass
+
+									uniformVal = mActivePass->getShininess();
+									activeScrollWidget->setScrollPosition( ActiveShaderDef.convertParamToScrollPosition(uniformVal) );
+								}
+
+								break;
+
+							case MAT_EMISSIVE:
+								{
+									// get the ambient values from the material pass
+
+									//ColourValue OldSpec(mActivePass->gete());
+									//activeScrollWidget->setScrollPosition( OldSpec.val[ActiveShaderDef->ElementIndex] );
+								}
+								break;
+						}
+
+						setShaderControlVal( uniformVal, i );
+						activeScrollWidget->show();
+					} // end of iterate
+				}
+
+				// turn off extra GUI widgets
+				// iterate from 1 + active widgets to end
+				for( size_t i = activeControlCount; i < mShaderControlContainer.size(); i++ )
+				{
+					// hide widget
+					if( mShaderControlContainer[i].TextWidget != NULL )
+					{
+						mShaderControlContainer[i].TextWidget->hide();
+					}
+
+					if( mShaderControlContainer[i].NumberWidget != NULL )
+					{
+						mShaderControlContainer[i].NumberWidget->hide();
+					}
+
+					{
+						mShaderControlContainer[i].ScrollWidget->hide();
+					}
+
+				}// end of iterate
+
+			}
+		}
+	}
+
+}
+
+//--------------------------------------------------------------------------
+bool OceanDemo::handleModelComboChanged(const CEGUI::EventArgs& e)
+{
+	using namespace CEGUI;
+
+    // get the selected mesh filename from the combo box
+	CEGUI::ListboxItem* item = ((Combobox*)((const WindowEventArgs&)e).window)->getSelectedItem();
+
+    // convert from CEGUI::String to Ogre::String
+    Ogre::String meshName(item->getText().c_str());
+
+    // hide the current entity
+    if (mCurrentEntity)
+    {
+        mCurrentEntity->setVisible(false);
+        // disconnect the entity from the scenenode
+        mMainNode->detachObject(mCurrentEntity->getName());
+    }
+
+    // find the entity selected in combo box
+    // an exception is raised by getEntity if it doesn't exist
+    // so trap the exception if entity not found and load it
+    try
+    {
+        mCurrentEntity = mSceneMgr->getEntity( meshName );
+    }
+    catch (Ogre::Exception e)
+    // if not found create it
+    {
+        Ogre::MeshPtr pMesh = Ogre::MeshManager::getSingleton().load(meshName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
+            //Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY,
+			//Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY,
+			//true, true
+            ); //so we can still read it
+        // Build tangent vectors, all our meshes use only 1 texture coordset
+        //pMesh->buildTangentVectors(0, 1);
+        // Create entity
+        mCurrentEntity = mSceneMgr->createEntity(meshName, meshName);
+    }
+
+    // make the entity visible and attach it to our main scenenode
+    mCurrentEntity->setVisible(true);
+    mMainNode->attachObject(mCurrentEntity);
+
+    // set the the entity's material to the current material
+    //mCurrentEntity->setMaterialName(mMaterialControlsContainer[mCurrentMaterial].getMaterialName());
+	configureShaderControls();
+    return true;
+}
+
+//--------------------------------------------------------------------------
+bool OceanDemo::handleShaderComboChanged(const CEGUI::EventArgs& e)
+{
+	using namespace CEGUI;
+
+	CEGUI::ListboxItem* item = ((Combobox*)((const WindowEventArgs&)e).window)->getSelectedItem();
+
+	mCurrentMaterial = item->getID();
+    if (mOceanSurfaceEnt)
+	    mOceanSurfaceEnt->setMaterialName(mMaterialControlsContainer[mCurrentMaterial].getMaterialName());
+	configureShaderControls();
+
+    return true;
+}
+
+
+//--------------------------------------------------------------------------
+bool OceanDemo::handleScrollControlsWindow(const CEGUI::EventArgs& e)
+{
+	using namespace CEGUI;
+
+	size_t controlCount = mShaderControlContainer.size();
+	float scrollval = ((Scrollbar*)((const WindowEventArgs&)e).window)->getScrollPosition();
+
+	for (size_t i = 0; i < controlCount; i++)
+	{
+		float ypos = WIDGET_YSTART + WIDGET_YOFFSET * float(i) - scrollval;
+		mShaderControlContainer[i].TextWidget->setPosition(UVECTOR2( TEXTWIDGET_XPOS, ypos + TEXTWIDGET_YADJUST));
+		mShaderControlContainer[i].NumberWidget->setPosition(UVECTOR2( NUMBERWIDGET_XPOS, ypos + TEXTWIDGET_YADJUST));
+		mShaderControlContainer[i].ScrollWidget->setPosition(UVECTOR2( SCROLLWIDGET_XPOS, ypos ));
+	}
+
+    return true;
+}
+
+//--------------------------------------------------------------------------
+bool OceanDemo::handleMovementTypeChange(const CEGUI::EventArgs& e)
+{
+	using namespace CEGUI;
+	CEGUI::uint id = ((RadioButton*)((const WindowEventArgs&)e).window)->getSelectedButtonInGroup()->getID();
+	if (id == 0)
+	{
+		mMouseMovement = mv_CAMERA;
+	}
+	else
+	{
+		mMouseMovement = mv_MODEL;
+	}
+
+    return true;
+}
+
+
+//--------------------------------------------------------------------------
+bool OceanDemo::handleErrorBox(const CEGUI::EventArgs& e)
+{
+	CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)"ErrorBox")->hide();
+    return true;
+}
+
+//--------------------------------------------------------------------------
+void OceanDemo::createFrameListener(void)
+{
+	mFrameListener= new OceanDemo_FrameListener(this);
+	mRoot->addFrameListener(mFrameListener);
+}
+
+
+/*************************************************************************
+	OceanDemo_FrameListener methods that handle all input for this GLSL demo.
+*************************************************************************/
+
+OceanDemo_FrameListener::OceanDemo_FrameListener(OceanDemo* main)
+    : mMain(main)
+    , mStatsOn(true)
+    , mWriteToFile(false)
+    , mLastMousePositionSet(false)
+    , mSpinModel(true)
+    , mSpinLight(false)
+	, mMouse(0)
+	, mKeyboard(0)
+    , mLMBDown(false)
+    , mRMBDown(false)
+    , mProcessMovement(false)
+    , mUpdateMovement(false)
+    , mMoveFwd(false)
+    , mMoveBck(false)
+    , mMoveLeft(false)
+    , mMoveRight(false)
+
+{
+    mRotateSpeed = 0;
+    mMoveSpeed = 100;
+
+	mNumScreenShots = 0;
+	mTimeUntilNextToggle = 0;
+    mSceneDetailIndex = 0;
+    mMoveScale = 0.0f;
+	mSpeed = MINSPEED;
+	mRotX = 0;
+	mRotY = 0;
+    mRotScale = 0.0f;
+	mTranslateVector = Ogre::Vector3::ZERO;
+    mAniso = 1;
+    mFiltering = Ogre::TFO_BILINEAR;
+	mAvgFrameTime = 0.1;
+
+	// using buffered input
+	OIS::ParamList pl;
+	size_t windowHnd = 0;
+	std::ostringstream windowHndStr;
+	mMain->getRenderWindow()->getCustomAttribute("WINDOW", &windowHnd);
+	windowHndStr << windowHnd;
+	pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
+
+	mInputManager = OIS::InputManager::createInputSystem( pl );
+	//Create all devices (We only catch joystick exceptions here, as, most people have Key/Mouse)
+	mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, true ));
+	mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, true ));
+
+	unsigned int width, height, depth;
+	int left, top;
+	mMain->getRenderWindow()->getMetrics(width, height, depth, left, top);
+
+	//Set Mouse Region.. if window resizes, we should alter this to reflect as well
+	const OIS::MouseState &ms = mMouse->getMouseState();
+	ms.width = width;
+	ms.height = height;
+
+	mMouse->setEventCallback(this);
+	mKeyboard->setEventCallback(this);
+
+	mQuit = false;
+	mSkipCount = 0;
+	mUpdateFreq = 50;
+
+	mGuiRenderer = CEGUI::System::getSingleton().getRenderer();
+
+	mGuiAvg   = CEGUI::WindowManager::getSingleton().getWindow("OPAverageFPS");
+	mGuiCurr  = CEGUI::WindowManager::getSingleton().getWindow("OPCurrentFPS");
+	mGuiBest  = CEGUI::WindowManager::getSingleton().getWindow("OPBestFPS");
+	mGuiWorst = CEGUI::WindowManager::getSingleton().getWindow("OPWorstFPS");
+	mGuiTris  = CEGUI::WindowManager::getSingleton().getWindow("OPTriCount");
+	mGuiDbg   = CEGUI::WindowManager::getSingleton().getWindow("OPDebugMsg");
+	mRoot	  = CEGUI::WindowManager::getSingleton().getWindow("root");
+}
+
+//--------------------------------------------------------------------------
+OceanDemo_FrameListener::~OceanDemo_FrameListener()
+{
+	if(mInputManager)
+	{
+		mInputManager->destroyInputObject(mMouse);
+		mInputManager->destroyInputObject(mKeyboard);
+		OIS::InputManager::destroyInputSystem(mInputManager);
+		mInputManager = 0;
+	}
+}
+
+
+//--------------------------------------------------------------------------
+bool OceanDemo_FrameListener::frameStarted(const Ogre::FrameEvent& evt)
+{
+	mMouse->capture();
+	mKeyboard->capture();
+
+	if (mQuit)
+		return false;
+	else
+	{
+		mSkipCount++;
+		if (mSkipCount >= mUpdateFreq)
+		{
+			mSkipCount = 0;
+			updateStats();
+		}
+		// update movement process
+		if(mProcessMovement || mUpdateMovement)
+		{
+			mTranslateVector.x += mMoveLeft ? mAvgFrameTime * -MOVESPEED : 0;
+			mTranslateVector.x += mMoveRight ? mAvgFrameTime * MOVESPEED : 0;
+			mTranslateVector.z += mMoveFwd ? mAvgFrameTime * -MOVESPEED : 0;
+			mTranslateVector.z += mMoveBck ? mAvgFrameTime * MOVESPEED : 0;
+			switch(mMain->getMouseMovement())
+			{
+				case mv_CAMERA:
+                    mMain->getCamera()->yaw(Ogre::Angle(mRotX));
+					mMain->getCamera()->pitch(Ogre::Angle(mRotY));
+					mMain->getCamera()->moveRelative(mTranslateVector);
+					break;
+
+				case mv_MODEL:
+					mMain->getMainNode()->yaw(Ogre::Angle(mRotX));
+					//mMain->getMainNode()->pitch(mRotY);
+					mMain->getMainNode()->translate(mTranslateVector);
+					break;
+                default:
+                    break;
+			}
+
+			mUpdateMovement = false;
+			mRotX = 0;
+			mRotY = 0;
+			mTranslateVector = Ogre::Vector3::ZERO;
+		}
+
+		if(mSpinModel)
+		{
+			mRotateSpeed = mAvgFrameTime * 20;
+			mMain->getMainNode()->yaw( Ogre::Angle(mRotateSpeed) );
+		}
+		if(mSpinLight)
+		{
+	        mLightPivots[0]->rotate(mLightRotationAxes[0], Ogre::Angle(mRotateSpeed * 2.0f));
+		}
+		if(mWriteToFile)
+		{
+			char tmp[20];
+			sprintf(tmp, "frame_%d.png", ++mNumScreenShots);
+			mMain->getRenderWindow()->writeContentsToFile(tmp);
+		}
+		return true;
+	}
+}
+
+//--------------------------------------------------------------------------
+bool OceanDemo_FrameListener::mouseMoved (const OIS::MouseEvent &e)
+{
+	CEGUI::System::getSingleton().injectMouseMove( e.state.X.rel, e.state.Y.rel );
+	CEGUI::System::getSingleton().injectMouseWheelChange(e.state.Z.rel);
+	return true;
+}
+
+//--------------------------------------------------------------------------
+bool OceanDemo_FrameListener::keyPressed (const OIS::KeyEvent &e)
+{
+    // give 'quitting' priority
+	if (e.key == OIS::KC_ESCAPE)
+    {
+        mQuit = true;
+        return false;
+    }
+
+    if (e.key == OIS::KC_SYSRQ )
+    {
+		std::ostringstream ss;
+        ss << "screenshot_" << ++mNumScreenShots << ".png";
+        mMain->getRenderWindow()->writeContentsToFile(ss.str());
+        //mTimeUntilNextToggle = 0.5;
+		mDebugText = "Saved: " + ss.str();
+    }
+
+    // do event injection
+    CEGUI::System& cegui = CEGUI::System::getSingleton();
+    cegui.injectKeyDown(e.key);
+	cegui.injectChar(e.text);
+	return true;
+}
+
+//--------------------------------------------------------------------------
+bool OceanDemo_FrameListener::keyReleased (const OIS::KeyEvent &e)
+{
+	CEGUI::System::getSingleton().injectKeyUp(e.key);
+	return true;
+}
+
+//--------------------------------------------------------------------------
+bool OceanDemo_FrameListener::mousePressed (const OIS::MouseEvent &e, OIS::MouseButtonID id)
+{
+	CEGUI::System::getSingleton().injectMouseButtonDown(convertOISButtonToCegui(id));
+	return true;
+}
+
+//--------------------------------------------------------------------------
+bool OceanDemo_FrameListener::mouseReleased (const OIS::MouseEvent &e, OIS::MouseButtonID id)
+{
+	CEGUI::System::getSingleton().injectMouseButtonUp(convertOISButtonToCegui(id));
+	return true;
+}
+
+//--------------------------------------------------------------------------
+CEGUI::MouseButton OceanDemo_FrameListener::convertOISButtonToCegui(int ois_button_id)
+{
+    switch (ois_button_id)
+    {
+	case 0: return CEGUI::LeftButton;
+	case 1: return CEGUI::RightButton;
+	case 2:	return CEGUI::MiddleButton;
+	case 3: return CEGUI::X1Button;
+	default: return CEGUI::LeftButton;
+    }
+}
+//--------------------------------------------------------------------------
+void OceanDemo_FrameListener::updateStats(void)
+{
+	static CEGUI::String currFps = "Current FPS: ";
+	static CEGUI::String avgFps = "Average FPS: ";
+	static CEGUI::String bestFps = "Best FPS: ";
+	static CEGUI::String worstFps = "Worst FPS: ";
+	static CEGUI::String tris = "Triangle Count: ";
+
+
+	const Ogre::RenderTarget::FrameStats& stats = mMain->getRenderWindow()->getStatistics();
+
+	mGuiAvg->setText(avgFps + Ogre::StringConverter::toString(stats.avgFPS));
+	mGuiCurr->setText(currFps + Ogre::StringConverter::toString(stats.lastFPS));
+	mGuiBest->setText(bestFps + Ogre::StringConverter::toString(stats.bestFPS)
+		+ " " + Ogre::StringConverter::toString(stats.bestFrameTime)+" ms");
+	mGuiWorst->setText(worstFps + Ogre::StringConverter::toString(stats.worstFPS)
+		+ " " + Ogre::StringConverter::toString(stats.worstFrameTime)+" ms");
+
+	mGuiTris->setText(tris + Ogre::StringConverter::toString(stats.triangleCount));
+	mGuiDbg->setText(mDebugText);
+	mAvgFrameTime = 1.0f/(stats.avgFPS + 1.0f);
+	if (mAvgFrameTime > 0.1f) mAvgFrameTime = 0.1f;
+
+}
+
+
+//--------------------------------------------------------------------------
+bool OceanDemo_FrameListener::handleMouseMove(const CEGUI::EventArgs& e)
+{
+	using namespace CEGUI;
+
+	if( mLMBDown && !mRMBDown)
+	{
+		// rotate camera
+		mRotX += -((const MouseEventArgs&)e).moveDelta.d_x * mAvgFrameTime * 10.0;
+		mRotY += -((const MouseEventArgs&)e).moveDelta.d_y * mAvgFrameTime * 10.0;
+		MouseCursor::getSingleton().setPosition( mLastMousePosition );
+		mUpdateMovement = true;
+	}
+	else
+	{
+		if( mRMBDown && !mLMBDown)
+		{
+			// translate camera
+			mTranslateVector.x += ((const MouseEventArgs&)e).moveDelta.d_x * mAvgFrameTime * MOVESPEED;
+			mTranslateVector.y += -((const MouseEventArgs&)e).moveDelta.d_y * mAvgFrameTime * MOVESPEED;
+			//mTranslateVector.z = 0;
+			MouseCursor::getSingleton().setPosition( mLastMousePosition );
+			mUpdateMovement = true;
+		}
+		else
+		{
+			if( mRMBDown && mLMBDown)
+			{
+				mTranslateVector.z += (((const MouseEventArgs&)e).moveDelta.d_x + ((const MouseEventArgs&)e).moveDelta.d_y) * mAvgFrameTime * MOVESPEED;
+				MouseCursor::getSingleton().setPosition( mLastMousePosition );
+				mUpdateMovement = true;
+			}
+
+		}
+	}
+
+    return true;
+}
+
+//--------------------------------------------------------------------------
+bool OceanDemo_FrameListener::handleMouseButtonUp(const CEGUI::EventArgs& e)
+{
+	using namespace CEGUI;
+
+	//Window* wndw = ((const WindowEventArgs&)e).window;
+	if( ((const MouseEventArgs&)e).button == LeftButton )
+	{
+		mLMBDown = false;
+	}
+
+	if( ((const MouseEventArgs&)e).button == RightButton )
+	{
+		mRMBDown = false;
+	}
+	if( !mLMBDown && !mRMBDown )
+	{
+		MouseCursor::getSingleton().show();
+		if(mLastMousePositionSet)
+		{
+			MouseCursor::getSingleton().setPosition( mLastMousePosition );
+			mLastMousePositionSet = false;
+		}
+		mRoot->releaseInput();
+	}
+
+    return true;
+}
+
+//--------------------------------------------------------------------------
+bool OceanDemo_FrameListener::handleMouseButtonDown(const CEGUI::EventArgs& e)
+{
+	using namespace CEGUI;
+
+	//Window* wndw = ((const WindowEventArgs&)e).window;
+	if( ((const MouseEventArgs&)e).button == LeftButton )
+	{
+		mLMBDown = true;
+	}
+
+	if( ((const MouseEventArgs&)e).button == RightButton )
+	{
+		mRMBDown = true;
+	}
+
+	if( mLMBDown || mRMBDown )
+	{
+		MouseCursor::getSingleton().hide();
+		if (!mLastMousePositionSet)
+		{
+			mLastMousePosition = MouseCursor::getSingleton().getPosition();
+			mLastMousePositionSet = true;
+		}
+		mRoot->captureInput();
+	}
+
+    return true;
+}
+
+//--------------------------------------------------------------------------
+bool OceanDemo_FrameListener::handleMouseWheelEvent(const CEGUI::EventArgs& e)
+{
+	using namespace CEGUI;
+	mTranslateVector.z += ((const MouseEventArgs&)e).wheelChange * -5.0;
+	mUpdateMovement = true;
+
+    return true;
+}
+
+//--------------------------------------------------------------------------
+bool OceanDemo_FrameListener::handleKeyDownEvent(const CEGUI::EventArgs& e)
+{
+	using namespace CEGUI;
+
+	CheckMovementKeys( ((const KeyEventArgs&)e).scancode , true);
+
+    return true;
+}
+
+//--------------------------------------------------------------------------
+bool OceanDemo_FrameListener::handleKeyUpEvent(const CEGUI::EventArgs& e)
+{
+	using namespace CEGUI;
+	CheckMovementKeys( ((const KeyEventArgs&)e).scancode, false );
+
+    return true;
+}
+
+
+//--------------------------------------------------------------------------
+bool OceanDemo_FrameListener::handelModelSpinChange(const CEGUI::EventArgs& e)
+{
+	using namespace CEGUI;
+	mSpinModel = ((Checkbox*)((const WindowEventArgs&)e).window)->isSelected();
+
+    return true;
+}
+
+//--------------------------------------------------------------------------
+bool OceanDemo_FrameListener::handelLightSpinChange(const CEGUI::EventArgs& e)
+{
+	using namespace CEGUI;
+	mSpinLight = ((Checkbox*)((const WindowEventArgs&)e).window)->isSelected();
+
+    return true;
+}
+
+//--------------------------------------------------------------------------
+void OceanDemo_FrameListener::CheckMovementKeys( CEGUI::Key::Scan scancode, bool state )
+{
+	using namespace CEGUI;
+
+	switch ( scancode )
+	{
+		case Key::A:
+			mMoveLeft = state;
+			break;
+
+		case Key::D:
+			mMoveRight = state;
+			break;
+
+		case Key::S:
+			mMoveBck = state;
+			break;
+
+		case Key::W:
+			mMoveFwd = state;
+			break;
+
+        default:
+            break;
+
+	}
+
+	mProcessMovement = mMoveLeft || mMoveRight || mMoveFwd || mMoveBck;
+
+}
Index: /Samples/ParticleFX/Makefile.am
===================================================================
--- /Samples/ParticleFX/Makefile.am	(revision 5)
+++ /Samples/ParticleFX/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/ParticleFX/Makefile.in
===================================================================
--- /Samples/ParticleFX/Makefile.in	(revision 5)
+++ /Samples/ParticleFX/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/ParticleFX
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/ParticleFX/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/ParticleFX/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/ParticleFX/bin/Debug/.keepme
===================================================================
--- /Samples/ParticleFX/bin/Debug/.keepme	(revision 5)
+++ /Samples/ParticleFX/bin/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/ParticleFX/bin/Release/.keepme
===================================================================
--- /Samples/ParticleFX/bin/Release/.keepme	(revision 5)
+++ /Samples/ParticleFX/bin/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/ParticleFX/include/Makefile.am
===================================================================
--- /Samples/ParticleFX/include/Makefile.am	(revision 5)
+++ /Samples/ParticleFX/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = ParticleFX.h
Index: /Samples/ParticleFX/include/Makefile.in
===================================================================
--- /Samples/ParticleFX/include/Makefile.in	(revision 5)
+++ /Samples/ParticleFX/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/ParticleFX/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = ParticleFX.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/ParticleFX/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/ParticleFX/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/ParticleFX/include/ParticleFX.h
===================================================================
--- /Samples/ParticleFX/include/ParticleFX.h	(revision 5)
+++ /Samples/ParticleFX/include/ParticleFX.h	(revision 5)
@@ -0,0 +1,135 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+/*
+-----------------------------------------------------------------------------
+Filename:    ParticleApplication.cpp
+Description: Specialisation of OGRE's framework application to show the
+             environment mapping feature.
+-----------------------------------------------------------------------------
+*/
+
+
+#include "ExampleApplication.h"
+
+
+// Event handler to add ability to alter curvature
+class ParticleFrameListener : public ExampleFrameListener
+{
+protected:
+    SceneNode* mFountainNode;
+public:
+    ParticleFrameListener(RenderWindow* win, Camera* cam, SceneNode* fountainNode)
+        : ExampleFrameListener(win, cam)
+    {
+        mFountainNode = fountainNode;
+    }
+
+    bool frameStarted(const FrameEvent& evt)
+    {
+        if( ExampleFrameListener::frameStarted(evt) == false )
+            return false;
+        // Rotate fountains
+        mFountainNode->yaw(Degree(evt.timeSinceLastFrame * 30));
+
+        // Call default
+        return true;
+
+    }
+};
+
+
+
+class ParticleApplication : public ExampleApplication
+{
+public:
+    ParticleApplication() {}
+
+protected:
+    SceneNode* mFountainNode;
+
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+
+
+        Entity *ent = mSceneMgr->createEntity("head", "ogrehead.mesh");
+
+        // Add entity to the root scene node
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+
+
+        // Green nimbus around Ogre
+        //mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(
+        //        mSceneMgr->createParticleSystem("Nimbus", "Examples/GreenyNimbus"));
+
+        // Create some nice fireworks
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(
+                mSceneMgr->createParticleSystem("Fireworks", "Examples/Fireworks"));
+
+        // Create shared node for 2 fountains
+        mFountainNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+
+        // fountain 1
+        ParticleSystem* pSys2 = mSceneMgr->createParticleSystem("fountain1",
+            "Examples/PurpleFountain");
+        // Point the fountain at an angle
+        SceneNode* fNode = mFountainNode->createChildSceneNode();
+        fNode->translate(200,-100,0);
+        fNode->rotate(Vector3::UNIT_Z, Degree(20));
+        fNode->attachObject(pSys2);
+
+        // fountain 2
+        ParticleSystem* pSys3 = mSceneMgr->createParticleSystem("fountain2",
+            "Examples/PurpleFountain");
+        // Point the fountain at an angle
+        fNode = mFountainNode->createChildSceneNode();
+        fNode->translate(-200,-100,0);
+        fNode->rotate(Vector3::UNIT_Z, Degree(-20));
+        fNode->attachObject(pSys3);
+
+
+
+
+        // Create a rainstorm
+        ParticleSystem* pSys4 = mSceneMgr->createParticleSystem("rain",
+            "Examples/Rain");
+        SceneNode* rNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        rNode->translate(0,1000,0);
+        rNode->attachObject(pSys4);
+        // Fast-forward the rain so it looks more natural
+        pSys4->fastForward(5);
+
+
+        // Aureola around Ogre perpendicular to the ground
+        ParticleSystem* pSys5 = mSceneMgr->createParticleSystem("Aureola",
+            "Examples/Aureola");
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pSys5);
+
+		// Set nonvisible timeout
+		ParticleSystem::setDefaultNonVisibleUpdateTimeout(5);
+    }
+
+    // Create new frame listener
+    void createFrameListener(void)
+    {
+        mFrameListener= new ParticleFrameListener(mWindow, mCamera, mFountainNode);
+        mRoot->addFrameListener(mFrameListener);
+    }
+
+
+};
+
Index: /Samples/ParticleFX/misc/.keepme
===================================================================
--- /Samples/ParticleFX/misc/.keepme	(revision 5)
+++ /Samples/ParticleFX/misc/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/ParticleFX/obj/Debug/.keepme
===================================================================
--- /Samples/ParticleFX/obj/Debug/.keepme	(revision 5)
+++ /Samples/ParticleFX/obj/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/ParticleFX/obj/Release/.keepme
===================================================================
--- /Samples/ParticleFX/obj/Release/.keepme	(revision 5)
+++ /Samples/ParticleFX/obj/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/ParticleFX/scripts/Demo_ParticleFX.cbp
===================================================================
--- /Samples/ParticleFX/scripts/Demo_ParticleFX.cbp	(revision 5)
+++ /Samples/ParticleFX/scripts/Demo_ParticleFX.cbp	(revision 5)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_ParticleFX" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_ParticleFX.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_ParticleFX.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\ParticleFX.h" />
+		<Unit filename="..\src\ParticleFX.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/ParticleFX/scripts/Demo_ParticleFX.vcproj
===================================================================
--- /Samples/ParticleFX/scripts/Demo_ParticleFX.vcproj	(revision 5)
+++ /Samples/ParticleFX/scripts/Demo_ParticleFX.vcproj	(revision 5)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_ParticleFX"
+	ProjectGUID="{74204563-3B14-42A3-B9E6-8E3201D571BC}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_ParticleFX.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_ParticleFX.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_ParticleFX.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\ParticleFX.cpp">
+			</File>
+			<Filter
+				Name="Header Files"
+				Filter="h;hpp;hxx;hm;inl;inc">
+				<File
+					RelativePath="..\include\ParticleFX.h">
+				</File>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/ParticleFX/scripts/Demo_ParticleFX_linux.cbp
===================================================================
--- /Samples/ParticleFX/scripts/Demo_ParticleFX_linux.cbp	(revision 5)
+++ /Samples/ParticleFX/scripts/Demo_ParticleFX_linux.cbp	(revision 5)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_ParticleFX" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_ParticleFX" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_ParticleFX" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/ParticleFX.h" />
+		<Unit filename="../src/ParticleFX.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/ParticleFX/scripts/Demo_ParticleFX_stlp.cbp
===================================================================
--- /Samples/ParticleFX/scripts/Demo_ParticleFX_stlp.cbp	(revision 5)
+++ /Samples/ParticleFX/scripts/Demo_ParticleFX_stlp.cbp	(revision 5)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_ParticleFX" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_ParticleFX.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_ParticleFX.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\ParticleFX.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\ParticleFX.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/ParticleFX/scripts/Demo_ParticleFX_vc8.vcproj
===================================================================
--- /Samples/ParticleFX/scripts/Demo_ParticleFX_vc8.vcproj	(revision 5)
+++ /Samples/ParticleFX/scripts/Demo_ParticleFX_vc8.vcproj	(revision 5)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_ParticleFX"
+	ProjectGUID="{74204563-3B14-42A3-B9E6-8E3201D571BC}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_ParticleFX.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_ParticleFX.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_ParticleFX.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\ParticleFX.cpp"
+				>
+			</File>
+			<Filter
+				Name="Header Files"
+				Filter="h;hpp;hxx;hm;inl;inc"
+				>
+				<File
+					RelativePath="..\include\ParticleFX.h"
+					>
+				</File>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/ParticleFX/scripts/Demo_ParticleFX_vc8.vcproj.user
===================================================================
--- /Samples/ParticleFX/scripts/Demo_ParticleFX_vc8.vcproj.user	(revision 5)
+++ /Samples/ParticleFX/scripts/Demo_ParticleFX_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/ParticleFX/src/Makefile.am
===================================================================
--- /Samples/ParticleFX/src/Makefile.am	(revision 5)
+++ /Samples/ParticleFX/src/Makefile.am	(revision 5)
@@ -0,0 +1,7 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/ParticleFX/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = ParticleFX
+
+ParticleFX_SOURCES = ParticleFX.cpp
+ParticleFX_LDFLAGS = -L$(top_builddir)/OgreMain/src
+ParticleFX_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/ParticleFX/src/Makefile.in
===================================================================
--- /Samples/ParticleFX/src/Makefile.in	(revision 5)
+++ /Samples/ParticleFX/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = ParticleFX$(EXEEXT)
+subdir = Samples/ParticleFX/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_ParticleFX_OBJECTS = ParticleFX.$(OBJEXT)
+ParticleFX_OBJECTS = $(am_ParticleFX_OBJECTS)
+am__DEPENDENCIES_1 =
+ParticleFX_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(ParticleFX_SOURCES)
+DIST_SOURCES = $(ParticleFX_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/ParticleFX/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+ParticleFX_SOURCES = ParticleFX.cpp
+ParticleFX_LDFLAGS = -L$(top_builddir)/OgreMain/src
+ParticleFX_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/ParticleFX/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/ParticleFX/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+ParticleFX$(EXEEXT): $(ParticleFX_OBJECTS) $(ParticleFX_DEPENDENCIES) 
+	@rm -f ParticleFX$(EXEEXT)
+	$(CXXLINK) $(ParticleFX_LDFLAGS) $(ParticleFX_OBJECTS) $(ParticleFX_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ParticleFX.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/ParticleFX/src/ParticleFX.cpp
===================================================================
--- /Samples/ParticleFX/src/ParticleFX.cpp	(revision 5)
+++ /Samples/ParticleFX/src/ParticleFX.cpp	(revision 5)
@@ -0,0 +1,52 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+
+#include "ParticleFX.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+    // Create application object
+    ParticleApplication app;
+
+    try {
+        app.go();
+    } catch( Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/ReadMe.html
===================================================================
--- /Samples/ReadMe.html	(revision 5)
+++ /Samples/ReadMe.html	(revision 5)
@@ -0,0 +1,1417 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+
+  
+
+
+  
+  <title>OGRE Readme</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+
+
+  
+  <style>
+<!--
+BODY { color: #000000; font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 10pt }
+P.header { font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 12pt; font-weight: bold }
+P.mainheader { background: #6b7d6b; color: #ffffff; font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 10pt; font-weight: bold }
+P.maincontent { font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 10pt }
+BLOCKQUOTE { color: #000000; font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 10pt }
+A:link { color: #003300 }
+-->
+  </style>
+</head>
+
+
+<body style="direction: ltr; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" lang="en-GB" link="#003300">
+
+
+<p class="header" align="center">OGRE
+(Object-Oriented Graphics Rendering Engine)</p>
+
+
+<p class="header" align="center">Demo Distribution
+README file</p>
+
+
+<p class="header" align="center"><a href="http://www.ogre3d.org">http://www.ogre3d.org</a></p>
+
+
+<p class="MainHeader" align="left">Summary</p>
+
+
+<p>OGRE (Object-Oriented Graphics Rendering Engine) is a
+scene-oriented, flexible 3D engine written in C++ designed to make it
+easier and more intuitive for developers to produce games and demos
+utilising 3D hardware. The class library abstracts all the details of
+using the underlying system libraries like Direct3D and OpenGL and
+provides an interface based on world objects and other intuitive
+classes. </p>
+
+
+<p>To run these demos you need to have DirectX 9 installed, although
+you can also choose to run the demos in OpenGL if you wish.&nbsp;</p>
+
+<ul>
+
+
+</ul>
+
+<p class="mainheader" align="left">So now what?</p>
+
+
+
+<p align="left">These demos are only a small sample of what you can achieve with OGRE. For more eye candy, visit the&nbsp;<a href="http://www.ogre3d.org/">Official Web Site</a>,
+and click on 'Featured Projects. If you would like to start making
+applications using OGRE,&nbsp;you can download the latest source code
+and documentation from the site</p>
+<p class="mainheader" align="left">Licensing</p>
+
+
+
+
+
+<p>OGRE is available&nbsp;free (both 'free as in beer' and 'free as in speech')&nbsp;under the GNU Lesser General
+Public License or LGPL&nbsp;(see Docs/licenses/lgpl.txt).
+By downloading and using the software, you are subject to these
+licensing conditions, so please read the license text carefully. The
+LGPL is compatible with almost all possible uses of the library
+(including commercial uses), but there are some responsibilities placed
+upon the user to maintain the&nbsp;freedom of the software for
+downstream users.</p>
+
+
+<p>Alternatively, you may license OGRE under the OGRE Unrestricted
+License (OUL) which comes with fewer conditions than the LGPL. This
+license is commercial and&nbsp;basically allows you to&nbsp;pay for the
+privilege of side-stepping the responsibilities of the LGPL. The
+software in both cases is identical, only the licensing conditions
+vary. If you wish to discuss this option&nbsp; please mail
+licensing@ogre3d.org for more details.</p>
+
+
+<p class="mainheader" align="left">Licensing for 3rd-party libraries used in OGRE</p>
+
+
+
+Several 3rd-party libraries are used in OGRE for various purposes, and the licensing details of each are given here.<br>
+
+
+
+<br>
+
+
+
+<span style="text-decoration: underline; font-weight: bold;">Core Dependencies<br>
+
+
+
+</span><br>
+
+
+These are the libraries which the core of OGRE depends on, and are
+therefore prerequisites for any use of OGRE. None of these libraries
+have been modified from their original distributions, and they are all
+licensed under liberal terms. You should read the detail of the
+licenses when distributing an application since most require you to
+include the license in your documentation. All the license texts are
+included in the Docs/licenses folder.<br>
+
+
+
+<br>
+
+<span style="font-weight: bold;">FreeImage</span><br>
+
+
+<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">
+
+
+
+  <tbody>
+
+
+
+    <tr>
+
+
+
+      <td style="width: 20%;">Original Authors:</td>
+
+
+
+      <td>Herv&eacute; Drolon and Floris van den Berg<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Website:</td>
+
+
+
+      <td>http://freeimage.sourceforge.net<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Licensed Under:</td>
+
+
+
+      <td>FreeImage Public License&nbsp;</td>
+
+
+
+    </tr>
+
+
+
+  
+  
+  
+  </tbody>
+</table>
+
+
+<br>
+
+
+<span style="font-weight: bold;">FreeType</span><br>
+
+
+<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">
+
+
+
+  <tbody>
+
+
+
+    <tr>
+
+
+
+      <td style="width: 20%;">Original Authors:</td>
+
+
+
+      <td>David Turner, Robert Wilhelm, and Werner Lemberg<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Website:</td>
+
+
+
+      <td>http://www.freetype.org<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Licensed Under:</td>
+
+
+
+      <td>FreeType License</td>
+
+
+
+    </tr>
+
+
+
+  
+  
+  
+  </tbody>
+</table>
+
+
+<br>
+
+<span style="font-weight: bold;">LibJPEG</span><br>
+
+
+<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">
+
+
+
+  <tbody>
+
+
+
+    <tr>
+
+
+
+      <td style="width: 20%;">Original Authors:</td>
+
+
+
+      <td>Thomas G. Lane, Independent JPEG Group<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Website:</td>
+
+
+
+      <td>http://www.ijg.org/<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Licensed Under:</td>
+
+
+
+      <td>LibJPEG License<br>
+
+      </td>
+
+
+
+    </tr>
+
+
+
+  
+  
+  
+  </tbody>
+</table>
+
+
+<br>
+
+<span style="font-weight: bold;">LibMNG</span><br>
+
+
+<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">
+
+
+
+  <tbody>
+
+
+
+    <tr>
+
+
+
+      <td style="width: 20%;">Original Authors:</td>
+
+
+
+      <td>Gerard Juyn, Glenn Randers-Pehrson, Raphael Assenat, John Stiles<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Website:</td>
+
+
+
+      <td>http://www.libmng.com<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Licensed Under:</td>
+
+
+
+      <td>LibJPEG License<br>
+
+      </td>
+
+
+
+    </tr>
+
+
+
+  
+  
+  
+  </tbody>
+</table>
+
+
+<br>
+
+<span style="font-weight: bold;">LibPNG</span><br>
+
+
+<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">
+
+
+
+  <tbody>
+
+
+
+    <tr>
+
+
+
+      <td style="width: 20%;">Original Authors:</td>
+
+
+
+      <td>Guy Eric Schalnat, Andreas Dilger, Glenn Randers-Pehrson and others<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Website:</td>
+
+
+
+      <td>http://www.libpng.org<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Licensed Under:</td>
+
+
+
+      <td>LibPNG License<br>
+
+      </td>
+
+
+
+    </tr>
+
+
+
+  
+  
+  
+  </tbody>
+</table>
+
+<br>
+
+
+<span style="font-weight: bold; text-decoration: underline;"></span><span style="font-weight: bold;">LibTIFF</span><br>
+
+
+<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">
+
+
+
+  <tbody>
+
+
+
+    <tr>
+
+
+
+      <td style="width: 20%;">Original Authors:</td>
+
+
+
+      <td>Sam Leffler, Silicon Graphics Inc<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Website:</td>
+
+
+
+      <td>http://www.libtiff.org/<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Licensed Under:</td>
+
+
+
+      <td>LibTIFF License<br>
+
+      </td>
+
+
+
+    </tr>
+
+
+
+  
+  
+  
+  </tbody>
+</table>
+
+<br>
+
+
+<span style="font-weight: bold; text-decoration: underline;"></span><br>
+
+
+
+<span style="font-weight: bold;">Zlib<br>
+
+
+
+</span>
+<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">
+
+
+
+  <tbody>
+
+
+
+    <tr>
+
+
+
+      <td style="width: 20%;">Original Authors:</td>
+
+
+
+      <td>Jean-loup Gailly and Mark
+	Adler</td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Website:</td>
+
+
+
+      <td>http://www.zlib.net</td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Licensed Under:</td>
+
+
+
+      <td>Zlib License&nbsp;</td>
+
+
+
+    </tr>
+
+
+
+  
+  
+  
+  </tbody>
+</table>
+
+
+
+<span style="font-weight: bold;"><br>
+
+
+
+Zziplib</span><br>
+
+
+<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">
+
+
+
+  <tbody>
+
+
+
+    <tr>
+
+
+
+      <td style="width: 20%;">Original Author:</td>
+
+
+
+      <td>Guido Draheim</td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Website:</td>
+
+
+
+      <td>http://zziplib.sourceforge.net<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Licensed Under:</td>
+
+
+
+      <td>Mozilla Public License 1.1&nbsp;</td>
+
+
+
+    </tr>
+
+
+
+  
+  
+  
+  </tbody>
+</table>
+
+
+<br>
+
+
+<span style="font-weight: bold;"></span><span style="font-weight: bold; text-decoration: underline;">Optional Plugin Dependencies<br>
+
+
+<span style="text-decoration: underline;"><span style="font-weight: bold;"><br>
+
+
+</span></span></span>These dependencies are only needed if you use the plugins they relate to.<br>
+
+
+<br>
+
+
+<span style="font-weight: bold;">NVidia Cg<br>
+
+
+</span>
+<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">
+
+
+
+  <tbody>
+
+
+
+    <tr>
+
+
+
+      <td style="width: 20%;">Original Authors:</td>
+
+
+
+      <td>NVidia</td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Website:</td>
+
+
+
+      <td>http://developer.nvidia.com</td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Licensed Under:</td>
+
+
+
+      <td>Custom free license (binary only)<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+  <tr>
+
+
+      <td>Needed By:</td>
+
+
+      <td>Plugin_CgProgramManager</td>
+
+
+    </tr>
+
+
+  
+  
+  </tbody>
+</table>
+
+
+<br>
+
+
+<span style="font-weight: bold; text-decoration: underline;"><span style="text-decoration: underline;"><span style="font-weight: bold;"></span></span>Sample Program Dependencies<br>
+
+
+<br>
+
+
+</span>These dependencies are only used by our sample programs, and
+thus you do not need to use them to use OGRE,&nbsp;if you don't want to.<br>
+
+
+<br>
+
+
+<span style="font-weight: bold;">OIS</span><br>
+
+
+<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">
+
+
+
+  <tbody>
+
+
+
+    <tr>
+
+
+
+      <td style="width: 20%;">Original Authors:</td>
+
+
+
+      <td>Phillip Castaneda</td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Website:</td>
+
+
+
+      <td>http://www.wreckedgames.com/wiki/index.php/WreckedLibs:OIS<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Licensed Under:</td>
+
+
+
+      <td>Zlib License</td>
+
+
+
+    </tr>
+
+
+
+  
+  
+  
+  </tbody>
+</table>
+
+
+<br>
+
+
+<span style="font-weight: bold; text-decoration: underline;"></span><span style="font-weight: bold;">CEGUI</span><br>
+
+
+<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">
+
+
+
+  <tbody>
+
+
+
+    <tr>
+
+
+
+      <td style="width: 20%;">Original Authors:</td>
+
+
+
+      <td>Paul D Turner, Tomas Lindquist Olsen and others<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Website:</td>
+
+
+
+      <td>http://www.cegui.org.uk<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Licensed Under:</td>
+
+
+
+      <td>MIT License</td>
+
+
+    </tr>
+
+
+  
+  
+  </tbody>
+</table>
+
+
+<br>
+
+
+<span style="font-weight: bold;">ODE</span><br>
+
+
+<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">
+
+
+
+  <tbody>
+
+
+
+    <tr>
+
+
+
+      <td style="width: 20%;">Original Authors:</td>
+
+
+
+      <td>Russell Smith<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Website:</td>
+
+
+
+      <td>http://www.ode.org/<br>
+
+
+      </td>
+
+
+
+    </tr>
+
+
+
+    <tr>
+
+
+
+      <td>Licensed Under:</td>
+
+
+
+      <td>BSD License</td>
+
+
+    </tr>
+
+
+  
+  
+  </tbody>
+</table>
+
+
+<br>
+
+
+
+<p class="mainheader" align="left">Acknowledgements</p>
+
+
+
+
+
+<p>The authors wish to credit the following for their work which is
+used in whole or in part in OGRE:</p>
+
+
+
+
+
+<p>Artwork:</p>
+
+
+
+
+
+<ul>
+  <li>
+    
+    
+    
+    
+    <p style="margin-bottom: 0cm;">Matt Anderson at
+	<a href="http://www.the3dstudio.com/">www.The3dStudio.com</a> who
+	kindly gave permission for the use of some textures. These textures are used with permission of
+    <a href="http://www.the3dstudio.com/">www.The3dStudio.com</a> and may
+not be re-distributed, sold, or given away except in the form of
+rendered images, animations, or real time 3D applications when credit
+is given to <a href="http://www.the3dstudio.com/">www.The3dStudio.com</a>.</p>
+
+
+
+
+
+	</li>
+  <li>
+    
+    
+    
+    
+    <p style="margin-bottom: 0cm;">Jonathan Clark at
+	<a href="http://www.jonathanclark.com/">http://www.jonathanclark.com</a>
+	for some Golgotha textures thet were released to the public domain.</p>
+
+
+
+
+
+	</li>
+  <li>
+    
+    
+    
+    
+    <p style="margin-bottom: 0cm;">The 'Raptor Assault Gunboat' mesh
+	&amp; texture are &copy; 2002 by Adrian 'cearny' Cearnau.</p>
+
+
+
+
+
+	</li>
+  <li>
+    
+    
+    
+    
+    <p style="margin-bottom: 0cm;">The robot andn ninja mesh and
+	animation are by <a href="http://www.psionic3d.co.uk/">Psionic</a>,
+	kindly made available from the <a href="http://www.insanesoftware.de/">CharacterFX</a>
+	site</p>
+
+
+
+
+
+	</li>
+  <li>
+    
+    
+    
+    
+    <p style="margin-bottom: 0cm;">The 'Razor 2' mesh is by Dennis
+	Verbeek</p>
+
+
+
+
+
+	</li>
+  <li>
+    
+    
+    
+    
+    <p style="margin-bottom: 0cm;">Skyboxes in cubemapJS.zip are
+	&copy;<a href="http://www.schlorb.com/">Johannes Schlorb</a>, used
+	with permission. 
+	</p>
+
+
+
+
+
+	</li>
+  <li>
+    
+    
+    
+    
+    <p>Grass texture is courtesy of Mathias 'freezer' Walc</p>
+
+
+
+
+  </li>
+  <li>
+    
+    
+    
+    
+    <p>The 'Han Solo' TrueType font is &copy; 2000 by Iconian Fonts -
+Daniel Zadorozny. This font may be freely distributed and is free for
+all non-commercial uses. This font is e-mailware; that is, if you
+like it, please e-mail the author at: <a href="mailto:iconian@aol.com">iconian@aol.com</a>.</p>
+
+
+
+
+  </li>
+  <li>SoftImage|XSI sample media files (facial.mesh, jaiqua.mesh and associated files) are provided courtesy of Avid Technology, Inc.<br>
+
+
+
+
+&copy; 2004 Avid Technology, Inc. All rights
+reserved. Avid is either a registered trademark or trademark of Avid
+Technology, Inc. in the United States and/or other countries. 
+  </li>
+</ul>
+
+
+
+
+
+<p>Included as source (modified as appropriate), and credited
+appropriately in the source files affected:</p>
+
+
+
+
+
+<ul>
+  <li>
+    
+    
+    
+    
+    <p style="margin-bottom: 0cm;">Many of the maths/spatial routines
+	are inspired by Dr D.H. Eberley, adapted from the 'free' parts of
+	the Wild Magic engine 0.2 source provided with his book "3D
+	Engine Design" (<a href="http://www.geometrictools.com/">http://www.geometrictools.com/</a>)</p>
+
+
+
+
+
+	</li>
+  <li>
+    
+    
+    
+    
+    <p style="margin-bottom: 0cm;">Quake3 loading routines used a lot
+	of information gleaned from <a href="http://www.planetquake.com/aftershock/">Aftershock</a>
+	and <a href="http://strony.poland.com/bsekura/">Bart Sekura's ROGL</a></p>
+
+
+
+
+
+	</li>
+  <li>
+    
+    
+    
+    
+    <p style="margin-bottom: 0cm;">Singleton template class is &copy;
+	Scott Bilas 2000 from Game Programming Gems 
+	</p>
+
+
+
+
+
+	</li>
+  <li>
+    
+    
+    
+    
+    <p>Memory manager is based on MMGR &copy; Paul Nettle at <a href="../Docs/www.fluidstudios.com">Fluid
+	Studios</a></p>
+
+
+
+
+
+  </li>
+</ul>
+
+
+<p>Standalone tools used:</p>
+
+
+
+
+
+<ul>
+  <li>
+    
+    
+    
+    
+    <p style="margin-bottom: 0cm;">Document generation from C++
+	source code is by Doxygen &copy; Dimitri van Heesch
+	(<a href="http://www.doxygen.org/">http://www.doxygen.org</a>)</p>
+
+
+
+
+
+	</li>
+  <li>
+    
+    
+    
+    
+    <p>Milkshape3D for modelling &amp; exporting
+	(<a href="http://www.milkshape3d.com/">http://www.milkshape3d.com</a>)</p>
+
+
+
+
+
+  </li>
+</ul>
+
+
+
+
+
+<p>And I'd also like to thank the following just for inspiration,
+ideas, and pretty much anything else:</p>
+
+
+
+
+
+<ul>
+  <li>
+    
+    
+    
+    
+    <p style="margin-bottom: 0cm;">Scott Meyers for his superb
+	'Effective C++' series</p>
+
+
+
+
+
+	</li>
+  <li>
+    
+    
+    
+    
+    <p style="margin-bottom: 0cm;">Everybody who has ever written for
+	Game Developer magazine, but particularly Chris Hecker and Jeff
+	Lander whose work is consistently enlightening</p>
+
+
+
+
+
+	</li>
+  <li>
+    
+    
+    
+    
+    <p style="margin-bottom: 0cm;">Michael Abrash for his 'Zen' books
+	which inspired me to try graphics programming in the first place</p>
+
+
+
+
+
+	</li>
+  <li>
+    
+    
+    
+    
+    <p style="margin-bottom: 0cm;">Everybody at SourceForge and VA
+	Linux for providing <b>fantastic</b> facilities for developers with
+	modest budgets</p>
+
+
+
+
+
+	</li>
+  <li>
+    
+    
+    
+    
+    <p style="margin-bottom: 0cm;">Scott Adams (Dilbert) for
+	providing a humourous distraction when I've had enough for the day<br>
+
+
+
+
+    </p>
+
+
+
+
+  </li>
+</ul>
+
+
+
+
+<ul>
+  <li>
+    
+    
+    
+    
+    <p>My wife Marie for putting up with all this!</p>
+
+
+
+
+
+  </li>
+</ul>
+Copyright &copy; 2007 by The OGRE Team
+<p>
+<script type="text/javascript">
+<!--//hide script from old browsers
+document.write( "Last modified "+ document.lastModified );
+//end hiding contents -->
+</script> </p>
+
+
+</body>
+</html>
Index: /Samples/RenderToTexture/Makefile.am
===================================================================
--- /Samples/RenderToTexture/Makefile.am	(revision 5)
+++ /Samples/RenderToTexture/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src 
Index: /Samples/RenderToTexture/Makefile.in
===================================================================
--- /Samples/RenderToTexture/Makefile.in	(revision 5)
+++ /Samples/RenderToTexture/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/RenderToTexture
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src 
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/RenderToTexture/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/RenderToTexture/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/RenderToTexture/bin/Debug/.keepme
===================================================================
--- /Samples/RenderToTexture/bin/Debug/.keepme	(revision 5)
+++ /Samples/RenderToTexture/bin/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/RenderToTexture/bin/Release/.keepme
===================================================================
--- /Samples/RenderToTexture/bin/Release/.keepme	(revision 5)
+++ /Samples/RenderToTexture/bin/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/RenderToTexture/misc/.keepme
===================================================================
--- /Samples/RenderToTexture/misc/.keepme	(revision 5)
+++ /Samples/RenderToTexture/misc/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/RenderToTexture/obj/Debug/.keepme
===================================================================
--- /Samples/RenderToTexture/obj/Debug/.keepme	(revision 5)
+++ /Samples/RenderToTexture/obj/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/RenderToTexture/obj/Release/.keepme
===================================================================
--- /Samples/RenderToTexture/obj/Release/.keepme	(revision 5)
+++ /Samples/RenderToTexture/obj/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/RenderToTexture/scripts/Demo_RenderToTexture.cbp
===================================================================
--- /Samples/RenderToTexture/scripts/Demo_RenderToTexture.cbp	(revision 5)
+++ /Samples/RenderToTexture/scripts/Demo_RenderToTexture.cbp	(revision 5)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_RenderToTexture" />
+		<Option pch_mode="0" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_RenderToTexture.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug\" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_RenderToTexture.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release\" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\RenderToTexture.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/RenderToTexture/scripts/Demo_RenderToTexture.vcproj
===================================================================
--- /Samples/RenderToTexture/scripts/Demo_RenderToTexture.vcproj	(revision 5)
+++ /Samples/RenderToTexture/scripts/Demo_RenderToTexture.vcproj	(revision 5)
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_RenderToTexture"
+	ProjectGUID="{109F610E-9B23-4D05-819E-A7F27A42AA94}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_RenderToTexture.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_RenderToTexture.pdb"
+				SubSystem="1"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				RuntimeTypeInfo="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_RenderToTexture.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\RenderToTexture.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/RenderToTexture/scripts/Demo_RenderToTexture_linux.cbp
===================================================================
--- /Samples/RenderToTexture/scripts/Demo_RenderToTexture_linux.cbp	(revision 5)
+++ /Samples/RenderToTexture/scripts/Demo_RenderToTexture_linux.cbp	(revision 5)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_RenderToTexture" />
+		<Option platforms="Unix;" />
+		<Option pch_mode="0" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_RenderToTexture" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug/" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_RenderToTexture" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release/" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../src/RenderToTexture.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/RenderToTexture/scripts/Demo_RenderToTexture_stlp.cbp
===================================================================
--- /Samples/RenderToTexture/scripts/Demo_RenderToTexture_stlp.cbp	(revision 5)
+++ /Samples/RenderToTexture/scripts/Demo_RenderToTexture_stlp.cbp	(revision 5)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_RenderToTexture" />
+		<Option pch_mode="0" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_RenderToTexture.exe" />
+				<Option working_dir="..\..\Common\bin\Debug\" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_RenderToTexture.exe" />
+				<Option working_dir="..\..\Common\bin\Release\" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="1" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-frtti" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\RenderToTexture.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/RenderToTexture/scripts/Demo_RenderToTexture_vc8.vcproj
===================================================================
--- /Samples/RenderToTexture/scripts/Demo_RenderToTexture_vc8.vcproj	(revision 5)
+++ /Samples/RenderToTexture/scripts/Demo_RenderToTexture_vc8.vcproj	(revision 5)
@@ -0,0 +1,224 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_RenderToTexture"
+	ProjectGUID="{109F610E-9B23-4D05-819E-A7F27A42AA94}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				RuntimeTypeInfo="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_RenderToTexture.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_RenderToTexture.pdb"
+				SubSystem="1"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				RuntimeTypeInfo="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_RenderToTexture.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\RenderToTexture.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/RenderToTexture/scripts/Demo_RenderToTexture_vc8.vcproj.user
===================================================================
--- /Samples/RenderToTexture/scripts/Demo_RenderToTexture_vc8.vcproj.user	(revision 5)
+++ /Samples/RenderToTexture/scripts/Demo_RenderToTexture_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/RenderToTexture/src/Makefile.am
===================================================================
--- /Samples/RenderToTexture/src/Makefile.am	(revision 5)
+++ /Samples/RenderToTexture/src/Makefile.am	(revision 5)
@@ -0,0 +1,6 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/RenderToTexture/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = RenderToTexture
+RenderToTexture_SOURCES = RenderToTexture.cpp
+RenderToTexture_LDFLAGS = -L$(top_builddir)/OgreMain/src
+RenderToTexture_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/RenderToTexture/src/Makefile.in
===================================================================
--- /Samples/RenderToTexture/src/Makefile.in	(revision 5)
+++ /Samples/RenderToTexture/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = RenderToTexture$(EXEEXT)
+subdir = Samples/RenderToTexture/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_RenderToTexture_OBJECTS = RenderToTexture.$(OBJEXT)
+RenderToTexture_OBJECTS = $(am_RenderToTexture_OBJECTS)
+am__DEPENDENCIES_1 =
+RenderToTexture_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(RenderToTexture_SOURCES)
+DIST_SOURCES = $(RenderToTexture_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/RenderToTexture/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+RenderToTexture_SOURCES = RenderToTexture.cpp
+RenderToTexture_LDFLAGS = -L$(top_builddir)/OgreMain/src
+RenderToTexture_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/RenderToTexture/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/RenderToTexture/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+RenderToTexture$(EXEEXT): $(RenderToTexture_OBJECTS) $(RenderToTexture_DEPENDENCIES) 
+	@rm -f RenderToTexture$(EXEEXT)
+	$(CXXLINK) $(RenderToTexture_LDFLAGS) $(RenderToTexture_OBJECTS) $(RenderToTexture_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RenderToTexture.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/RenderToTexture/src/RenderToTexture.cpp
===================================================================
--- /Samples/RenderToTexture/src/RenderToTexture.cpp	(revision 5)
+++ /Samples/RenderToTexture/src/RenderToTexture.cpp	(revision 5)
@@ -0,0 +1,220 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        RenderToTexture.cpp
+    \brief
+        Shows OGRE's RenderToTexture feature, and using it to drive a reflection.
+*/
+
+#include "ExampleApplication.h"
+#include "ExampleFrameListener.h"
+
+class RenderToTextureFrameListener : public ExampleFrameListener
+{
+protected:
+    Camera* mReflectCam;
+    SceneNode* mPlaneNode;
+public:
+    RenderToTextureFrameListener(RenderWindow* window, Camera* maincam, Camera* reflectCam, 
+        SceneNode* planeSceneNode)
+        :ExampleFrameListener(window, maincam), 
+        mReflectCam(reflectCam), mPlaneNode(planeSceneNode)
+    {
+
+    }
+    bool frameStarted(const FrameEvent& evt)
+    {
+        if( ExampleFrameListener::frameStarted(evt) == false )
+		return false;
+
+        // Make sure reflection camera is updated too
+        mReflectCam->setOrientation(mCamera->getOrientation());
+        mReflectCam->setPosition(mCamera->getPosition());
+
+        // Rotate plane
+        mPlaneNode->yaw(Degree(30 * evt.timeSinceLastFrame), Node::TS_PARENT);
+
+        return true;
+    }
+};
+
+class RenderToTextureApplication : public ExampleApplication, public RenderTargetListener
+{
+public:
+    RenderToTextureApplication() : mPlane(0) {}
+    ~RenderToTextureApplication()
+    {
+        delete mPlane;
+    }
+
+protected:
+
+    MovablePlane* mPlane;
+    Entity* mPlaneEnt;
+    Camera* mReflectCam;
+    SceneNode* mPlaneNode;
+    // render target events
+    void preRenderTargetUpdate(const RenderTargetEvent& evt)
+    {
+        // Hide plane 
+        mPlaneEnt->setVisible(false);
+
+    }
+    void postRenderTargetUpdate(const RenderTargetEvent& evt)
+    {
+        // Show plane 
+        mPlaneEnt->setVisible(true);
+    }
+
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.2, 0.2, 0.2));
+        // Skybox
+        mSceneMgr->setSkyBox(true, "Examples/MorningSkyBox");
+
+        // Create a light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setType(Light::LT_DIRECTIONAL);
+        Vector3 dir(0.5, -1, 0);
+        dir.normalise();
+        l->setDirection(dir);
+        l->setDiffuseColour(1.0f, 1.0f, 0.8f);
+        l->setSpecularColour(1.0f, 1.0f, 1.0f);
+
+
+        // Create a prefab plane
+        mPlane = new MovablePlane("ReflectPlane");
+        mPlane->d = 0;
+        mPlane->normal = Vector3::UNIT_Y;
+        MeshManager::getSingleton().createPlane("ReflectionPlane", 
+            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+            *mPlane, 2000, 2000, 
+            1, 1, true, 1, 1, 1, Vector3::UNIT_Z);
+        mPlaneEnt = mSceneMgr->createEntity( "Plane", "ReflectionPlane" );
+
+        // Create an entity from a model (will be loaded automatically)
+        Entity* knotEnt = mSceneMgr->createEntity("Knot", "knot.mesh");
+
+        // Create an entity from a model (will be loaded automatically)
+        Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh");
+
+        knotEnt->setMaterialName("Examples/TextureEffect2");
+
+        // Attach the rtt entity to the root of the scene
+        SceneNode* rootNode = mSceneMgr->getRootSceneNode();
+        mPlaneNode = rootNode->createChildSceneNode();
+
+        // Attach both the plane entity, and the plane definition
+        mPlaneNode->attachObject(mPlaneEnt);
+        mPlaneNode->attachObject(mPlane);
+        mPlaneNode->translate(0, -10, 0);
+        // Tilt it a little to make it interesting
+        mPlaneNode->roll(Degree(5));
+
+        rootNode->createChildSceneNode( "Head" )->attachObject( ogreHead );
+
+		TexturePtr texture = TextureManager::getSingleton().createManual( "RttTex", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, TEX_TYPE_2D, 
+			512, 512, 0, PF_R8G8B8, TU_RENDERTARGET );
+		RenderTarget *rttTex = texture->getBuffer()->getRenderTarget();
+        {
+            mReflectCam = mSceneMgr->createCamera("ReflectCam");
+            mReflectCam->setNearClipDistance(mCamera->getNearClipDistance());
+            mReflectCam->setFarClipDistance(mCamera->getFarClipDistance());
+            mReflectCam->setAspectRatio(
+                (Real)mWindow->getViewport(0)->getActualWidth() / 
+                (Real)mWindow->getViewport(0)->getActualHeight());
+
+            Viewport *v = rttTex->addViewport( mReflectCam );
+            v->setClearEveryFrame( true );
+            v->setBackgroundColour( ColourValue::Black );
+
+            MaterialPtr mat = MaterialManager::getSingleton().create("RttMat",
+                ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+            TextureUnitState* t = mat->getTechnique(0)->getPass(0)->createTextureUnitState("RustedMetal.jpg");
+            t = mat->getTechnique(0)->getPass(0)->createTextureUnitState("RttTex");
+            // Blend with base texture
+            t->setColourOperationEx(LBX_BLEND_MANUAL, LBS_TEXTURE, LBS_CURRENT, ColourValue::White, 
+                ColourValue::White, 0.25);
+			t->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
+			t->setProjectiveTexturing(true, mReflectCam);
+            rttTex->addListener(this);
+
+            // set up linked reflection
+            mReflectCam->enableReflection(mPlane);
+            // Also clip
+            mReflectCam->enableCustomNearClipPlane(mPlane);
+        }
+
+        // Give the plane a texture
+        mPlaneEnt->setMaterialName("RttMat");
+
+
+        // Add a whole bunch of extra transparent entities
+        Entity *cloneEnt;
+        for (int n = 0; n < 10; ++n)
+        {
+            // Create a new node under the root
+            SceneNode* node = mSceneMgr->createSceneNode();
+            // Random translate
+            Vector3 nodePos;
+            nodePos.x = Math::SymmetricRandom() * 750.0;
+            nodePos.y = Math::SymmetricRandom() * 100.0 + 25;
+            nodePos.z = Math::SymmetricRandom() * 750.0;
+            node->setPosition(nodePos);
+            rootNode->addChild(node);
+            // Clone knot
+            char cloneName[12];
+            sprintf(cloneName, "Knot%d", n);
+            cloneEnt = knotEnt->clone(cloneName);
+            // Attach to new node
+            node->attachObject(cloneEnt);
+
+        }
+
+        mCamera->setPosition(-50, 100, 500);
+        mCamera->lookAt(0,0,0);
+    }
+
+    void createFrameListener(void)
+    {
+        mFrameListener= new RenderToTextureFrameListener(mWindow, mCamera, mReflectCam, mPlaneNode);
+        mRoot->addFrameListener(mFrameListener);
+
+    }
+
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int main(int argc, char ** argv)
+{
+
+    // Create application object
+    RenderToTextureApplication app;
+
+    app.go();
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/Shadows/Makefile.am
===================================================================
--- /Samples/Shadows/Makefile.am	(revision 5)
+++ /Samples/Shadows/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src
Index: /Samples/Shadows/Makefile.in
===================================================================
--- /Samples/Shadows/Makefile.in	(revision 5)
+++ /Samples/Shadows/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Shadows
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Shadows/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Shadows/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Shadows/scripts/Demo_Shadows.cbp
===================================================================
--- /Samples/Shadows/scripts/Demo_Shadows.cbp	(revision 5)
+++ /Samples/Shadows/scripts/Demo_Shadows.cbp	(revision 5)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Shadows" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Shadows.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="CEGUIBase_d" />
+					<Add library="OgreGUIRenderer_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Shadows.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreGUIRenderer" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+			<Add directory="..\..\..\Dependencies\include\CEGUI" />
+			<Add directory="..\..\Common\CEGUIRenderer\include" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\Shadows.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Shadows/scripts/Demo_Shadows.vcproj
===================================================================
--- /Samples/Shadows/scripts/Demo_Shadows.vcproj	(revision 5)
+++ /Samples/Shadows/scripts/Demo_Shadows.vcproj	(revision 5)
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_Shadows"
+	ProjectGUID="{F6C5DBF5-AD48-4F33-B824-595092CFE850}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib"
+				OutputFile="$(OutDir)/Demo_Shadows.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_Shadows.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib CEGUIBase.lib OgreGUIRenderer.lib"
+				OutputFile="$(OutDir)/Demo_Shadows.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\Shadows.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Shadows/scripts/Demo_Shadows_linux.cbp
===================================================================
--- /Samples/Shadows/scripts/Demo_Shadows_linux.cbp	(revision 5)
+++ /Samples/Shadows/scripts/Demo_Shadows_linux.cbp	(revision 5)
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Shadows" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_Shadows" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreGUIRenderer_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_Shadows" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+					<Add library="CEGUIBase" />
+					<Add library="OgreGUIRenderer" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+			<Add directory="../../Common/CEGUIRenderer/include" />
+			<Add directory="$(#CEGUI)" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../src/Shadows.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Shadows/scripts/Demo_Shadows_stlp.cbp
===================================================================
--- /Samples/Shadows/scripts/Demo_Shadows_stlp.cbp	(revision 5)
+++ /Samples/Shadows/scripts/Demo_Shadows_stlp.cbp	(revision 5)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_Shadows" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Shadows.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Shadows.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\Shadows.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Shadows/scripts/Demo_Shadows_vc8.vcproj
===================================================================
--- /Samples/Shadows/scripts/Demo_Shadows_vc8.vcproj	(revision 5)
+++ /Samples/Shadows/scripts/Demo_Shadows_vc8.vcproj	(revision 5)
@@ -0,0 +1,223 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_Shadows"
+	ProjectGUID="{F6C5DBF5-AD48-4F33-B824-595092CFE850}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib"
+				OutputFile="$(OutDir)/Demo_Shadows.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_Shadows.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\Dependencies\include\CEGUI;..\..\Common\CEGUIRenderer\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib CEGUIBase.lib OgreGUIRenderer.lib"
+				OutputFile="$(OutDir)/Demo_Shadows.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+				FixedBaseAddress="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\Shadows.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Shadows/scripts/Demo_Shadows_vc8.vcproj.user
===================================================================
--- /Samples/Shadows/scripts/Demo_Shadows_vc8.vcproj.user	(revision 5)
+++ /Samples/Shadows/scripts/Demo_Shadows_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/Shadows/src/Makefile.am
===================================================================
--- /Samples/Shadows/src/Makefile.am	(revision 5)
+++ /Samples/Shadows/src/Makefile.am	(revision 5)
@@ -0,0 +1,6 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/CEGUIRenderer/include -I$(top_srcdir)/Samples/Common/include @CEGUI_CFLAGS@ $(OIS_CFLAGS) 
+
+ogreexec_PROGRAMS = Shadows
+Shadows_SOURCES = Shadows.cpp
+Shadows_LDFLAGS = -L$(top_builddir)/OgreMain/src -L$(top_builddir)/Samples/Common/CEGUIRenderer/src
+Shadows_LDADD = -lOgreMain @CEGUI_LIBS@ -lCEGUIOgreRenderer $(OIS_LIBS)
Index: /Samples/Shadows/src/Makefile.in
===================================================================
--- /Samples/Shadows/src/Makefile.in	(revision 5)
+++ /Samples/Shadows/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = Shadows$(EXEEXT)
+subdir = Samples/Shadows/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_Shadows_OBJECTS = Shadows.$(OBJEXT)
+Shadows_OBJECTS = $(am_Shadows_OBJECTS)
+am__DEPENDENCIES_1 =
+Shadows_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Shadows_SOURCES)
+DIST_SOURCES = $(Shadows_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/CEGUIRenderer/include -I$(top_srcdir)/Samples/Common/include @CEGUI_CFLAGS@ $(OIS_CFLAGS) 
+Shadows_SOURCES = Shadows.cpp
+Shadows_LDFLAGS = -L$(top_builddir)/OgreMain/src -L$(top_builddir)/Samples/Common/CEGUIRenderer/src
+Shadows_LDADD = -lOgreMain @CEGUI_LIBS@ -lCEGUIOgreRenderer $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Shadows/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Shadows/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+Shadows$(EXEEXT): $(Shadows_OBJECTS) $(Shadows_DEPENDENCIES) 
+	@rm -f Shadows$(EXEEXT)
+	$(CXXLINK) $(Shadows_LDFLAGS) $(Shadows_OBJECTS) $(Shadows_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Shadows.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Shadows/src/Shadows.cpp
===================================================================
--- /Samples/Shadows/src/Shadows.cpp	(revision 5)
+++ /Samples/Shadows/src/Shadows.cpp	(revision 5)
@@ -0,0 +1,1563 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        Shadows.cpp
+    \brief
+        Shows a few ways to use Ogre's shadowing techniques
+*/
+
+#include <CEGUI/CEGUIImageset.h>
+#include <CEGUI/CEGUISystem.h>
+#include <CEGUI/CEGUILogger.h>
+#include <CEGUI/CEGUISchemeManager.h>
+#include <CEGUI/CEGUIWindowManager.h>
+#include <CEGUI/CEGUIWindow.h>
+#include <CEGUI/elements/CEGUICombobox.h>
+#include <CEGUI/elements/CEGUIComboDropList.h>
+#include <CEGUI/elements/CEGUIEditbox.h>
+#include <CEGUI/elements/CEGUIListbox.h>
+#include <CEGUI/elements/CEGUIListboxTextItem.h>
+#include <CEGUI/elements/CEGUIPushButton.h>
+#include <CEGUI/elements/CEGUIScrollbar.h>
+#include <CEGUI/elements/CEGUIRadioButton.h>
+#include "OgreCEGUIRenderer.h"
+#include "OgreCEGUIResourceProvider.h"
+#include "ExampleApplication.h"
+
+/*
+#include "OgreNoMemoryMacros.h"
+#include <ode/odecpp.h>
+#include <ode/odecpp_collision.h>
+#include "OgreMemoryMacros.h"
+*/
+
+/*
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#include "OgreNoMemoryMacros.h"
+#include <crtdbg.h>
+#endi*/
+
+Entity* mAthene;
+AnimationState* mAnimState = 0;
+Entity* pPlaneEnt;
+std::vector<Entity*> pColumns;
+Light* mLight;
+Light* mSunLight;
+SceneNode* mLightNode = 0;
+AnimationState* mLightAnimationState = 0;
+ColourValue mMinLightColour(0.2, 0.1, 0.0);
+ColourValue mMaxLightColour(0.5, 0.3, 0.1);
+Real mMinFlareSize = 40;
+Real mMaxFlareSize = 80;
+
+// New depth shadowmapping
+String CUSTOM_ROCKWALL_MATERIAL("Ogre/DepthShadowmap/Receiver/RockWall");
+String CUSTOM_CASTER_MATERIAL("Ogre/DepthShadowmap/Caster/Float");
+String CUSTOM_RECEIVER_MATERIAL("Ogre/DepthShadowmap/Receiver/Float");
+String CUSTOM_ATHENE_MATERIAL("Ogre/DepthShadowmap/Receiver/Athene");
+
+String BASIC_ROCKWALL_MATERIAL("Examples/Rockwall");
+String BASIC_ATHENE_MATERIAL("Examples/Athene/NormalMapped");
+
+
+
+OverlayElement* mShadowTechniqueInfo;
+OverlayElement* mMaterialInfo;
+OverlayElement* mInfo;
+
+
+/** This class 'wibbles' the light and billboard */
+class LightWibbler : public ControllerValue<Real>
+{
+protected:
+    Light* mLight;
+    Billboard* mBillboard;
+    ColourValue mColourRange;
+    ColourValue mMinColour;
+    Real mMinSize;
+    Real mSizeRange;
+    Real intensity;
+public:
+    LightWibbler(Light* light, Billboard* billboard, const ColourValue& minColour, 
+        const ColourValue& maxColour, Real minSize, Real maxSize)
+    {
+        mLight = light;
+        mBillboard = billboard;
+        mMinColour = minColour;
+        mColourRange.r = maxColour.r - minColour.r;
+        mColourRange.g = maxColour.g - minColour.g;
+        mColourRange.b = maxColour.b - minColour.b;
+        mMinSize = minSize;
+        mSizeRange = maxSize - minSize;
+    }
+
+    virtual Real  getValue (void) const
+    {
+        return intensity;
+    }
+
+    virtual void  setValue (Real value)
+    {
+        intensity = value;
+
+        ColourValue newColour;
+
+        // Attenuate the brightness of the light
+        newColour.r = mMinColour.r + (mColourRange.r * intensity);
+        newColour.g = mMinColour.g + (mColourRange.g * intensity);
+        newColour.b = mMinColour.b + (mColourRange.b * intensity);
+
+        mLight->setDiffuseColour(newColour);
+        mBillboard->setColour(newColour);
+        // set billboard size
+        Real newSize = mMinSize + (intensity * mSizeRange);
+        mBillboard->setDimensions(newSize, newSize);
+
+    }
+};
+
+Real timeDelay = 0;
+#define KEY_PRESSED(_key,_timeDelay, _macro) \
+{ \
+    if (mKeyboard->isKeyDown(_key) && timeDelay <= 0) \
+{ \
+    timeDelay = _timeDelay; \
+    _macro ; \
+} \
+}
+
+
+//---------------------------------------------------------------------------
+class GaussianListener: public Ogre::CompositorInstance::Listener
+{
+protected:
+	int mVpWidth, mVpHeight;
+	// Array params - have to pack in groups of 4 since this is how Cg generates them
+	// also prevents dependent texture read problems if ops don't require swizzle
+	float mBloomTexWeights[15][4];
+	float mBloomTexOffsetsHorz[15][4];
+	float mBloomTexOffsetsVert[15][4];
+public:
+	GaussianListener() {}
+	virtual ~GaussianListener() {}
+	void notifyViewportSize(int width, int height)
+	{
+		mVpWidth = width;
+		mVpHeight = height;
+		// Calculate gaussian texture offsets & weights
+		float deviation = 3.0f;
+		float texelSize = 1.0f / (float)std::min(mVpWidth, mVpHeight);
+
+		// central sample, no offset
+		mBloomTexOffsetsHorz[0][0] = 0.0f;
+		mBloomTexOffsetsHorz[0][1] = 0.0f;
+		mBloomTexOffsetsVert[0][0] = 0.0f;
+		mBloomTexOffsetsVert[0][1] = 0.0f;
+		mBloomTexWeights[0][0] = mBloomTexWeights[0][1] = 
+			mBloomTexWeights[0][2] = Ogre::Math::gaussianDistribution(0, 0, deviation);
+		mBloomTexWeights[0][3] = 1.0f;
+
+		// 'pre' samples
+		for(int i = 1; i < 8; ++i)
+		{
+			mBloomTexWeights[i][0] = mBloomTexWeights[i][1] = 
+				mBloomTexWeights[i][2] = Ogre::Math::gaussianDistribution(i, 0, deviation);
+			mBloomTexWeights[i][3] = 1.0f;
+			mBloomTexOffsetsHorz[i][0] = i * texelSize;
+			mBloomTexOffsetsHorz[i][1] = 0.0f;
+			mBloomTexOffsetsVert[i][0] = 0.0f;
+			mBloomTexOffsetsVert[i][1] = i * texelSize;
+		}
+		// 'post' samples
+		for(int i = 8; i < 15; ++i)
+		{
+			mBloomTexWeights[i][0] = mBloomTexWeights[i][1] = 
+				mBloomTexWeights[i][2] = mBloomTexWeights[i - 7][0];
+			mBloomTexWeights[i][3] = 1.0f;
+
+			mBloomTexOffsetsHorz[i][0] = -mBloomTexOffsetsHorz[i - 7][0];
+			mBloomTexOffsetsHorz[i][1] = 0.0f;
+			mBloomTexOffsetsVert[i][0] = 0.0f;
+			mBloomTexOffsetsVert[i][1] = -mBloomTexOffsetsVert[i - 7][1];
+		}
+
+	}
+	virtual void notifyMaterialSetup(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat)
+	{
+		// Prepare the fragment params offsets
+		switch(pass_id)
+		{
+		case 701: // blur horz
+			{
+				// horizontal bloom
+				mat->load();
+				Ogre::GpuProgramParametersSharedPtr fparams = 
+					mat->getBestTechnique()->getPass(0)->getFragmentProgramParameters();
+				const Ogre::String& progName = mat->getBestTechnique()->getPass(0)->getFragmentProgramName();
+				// A bit hacky - Cg & HLSL index arrays via [0], GLSL does not
+				fparams->setNamedConstant("sampleOffsets", mBloomTexOffsetsHorz[0], 15);
+				fparams->setNamedConstant("sampleWeights", mBloomTexWeights[0], 15);
+
+				break;
+			}
+		case 700: // blur vert
+			{
+				// vertical bloom 
+				mat->load();
+				Ogre::GpuProgramParametersSharedPtr fparams = 
+					mat->getTechnique(0)->getPass(0)->getFragmentProgramParameters();
+				const Ogre::String& progName = mat->getBestTechnique()->getPass(0)->getFragmentProgramName();
+				fparams->setNamedConstant("sampleOffsets", mBloomTexOffsetsVert[0], 15);
+				fparams->setNamedConstant("sampleWeights", mBloomTexWeights[0], 15);
+
+				break;
+			}
+		}
+
+	}
+	virtual void notifyMaterialRender(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat)
+	{
+
+	}
+};
+GaussianListener gaussianListener;
+
+
+class ShadowsListener : public ExampleFrameListener, public OIS::MouseListener, 
+	public OIS::KeyListener
+{
+protected:
+    SceneManager* mSceneMgr;
+	Viewport *mShadowVp;
+	CompositorInstance* mShadowCompositor;
+	bool mShutdownRequested;
+	CEGUI::Window* mRootGuiPanel;
+	bool mLMBDown;
+	bool mRMBDown;
+	bool mProcessMovement;
+	bool mUpdateMovement;
+	bool mMoveFwd;
+	bool mMoveBck;
+	bool mMoveLeft;
+	bool mMoveRight;
+	CEGUI::Point mLastMousePosition;
+	bool mLastMousePositionSet;
+	float mAvgFrameTime;
+	Camera* mTexCam;
+
+
+	//----------------------------------------------------------------//
+	CEGUI::MouseButton convertOISMouseButtonToCegui(int buttonID)
+	{
+		switch (buttonID)
+		{
+		case 0: return CEGUI::LeftButton;
+		case 1: return CEGUI::RightButton;
+		case 2:	return CEGUI::MiddleButton;
+		case 3: return CEGUI::X1Button;
+		default: return CEGUI::LeftButton;
+		}
+	}
+public:
+	ShadowsListener(RenderWindow* win, Camera* cam, SceneManager* sm)
+        : ExampleFrameListener(win, cam, true, true)
+		, mSceneMgr(sm)
+		, mShadowVp(0)
+		, mShadowCompositor(0)
+		, mShutdownRequested(false)
+		, mLMBDown(false)
+		, mRMBDown(false)
+		, mProcessMovement(false)
+		, mUpdateMovement(false)
+		, mMoveFwd(false)
+		, mMoveBck(false)
+		, mMoveLeft(false)
+		, mMoveRight(false)
+		, mLastMousePositionSet(false)
+		, mAvgFrameTime(0.1f)
+
+    {
+		mMouse->setEventCallback(this);
+		mKeyboard->setEventCallback(this);
+
+		mRootGuiPanel = CEGUI::WindowManager::getSingleton().getWindow("Shadows");
+
+		mMoveSpeed = 10.0f;
+
+		// Set up a debug panel to display the shadow
+		MaterialPtr debugMat = MaterialManager::getSingleton().create(
+			"Ogre/DebugShadowMap0", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		debugMat->getTechnique(0)->getPass(0)->setLightingEnabled(false);
+		TexturePtr shadowTex = mSceneMgr->getShadowTexture(0);
+		TextureUnitState *t = debugMat->getTechnique(0)->getPass(0)->createTextureUnitState(shadowTex->getName());
+		t->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
+
+		debugMat = MaterialManager::getSingleton().create(
+			"Ogre/DebugShadowMap1", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		debugMat->getTechnique(0)->getPass(0)->setLightingEnabled(false);
+		shadowTex = mSceneMgr->getShadowTexture(1);
+		t = debugMat->getTechnique(0)->getPass(0)->createTextureUnitState(shadowTex->getName());
+		t->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
+
+		/* Uncomment this to display the shadow textures
+		OverlayContainer* debugPanel = (OverlayContainer*)
+			(OverlayManager::getSingleton().createOverlayElement("Panel", "Ogre/DebugShadowPanel0"));
+		debugPanel->_setPosition(0.8, 0);
+		debugPanel->_setDimensions(0.2, 0.2);
+		debugPanel->setMaterialName("Ogre/DebugShadowMap0");
+		Overlay* debugOverlay = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
+		debugOverlay->add2D(debugPanel);
+		
+		debugPanel = (OverlayContainer*)
+			(OverlayManager::getSingleton().createOverlayElement("Panel", "Ogre/DebugShadowPanel1"));
+		debugPanel->_setPosition(0.8, 0.2);
+		debugPanel->_setDimensions(0.2, 0.2);
+		debugPanel->setMaterialName("Ogre/DebugShadowMap1");
+		debugOverlay->add2D(debugPanel);
+		*/
+		
+
+    }
+
+
+	bool frameStarted(const FrameEvent& evt)
+	{
+		CEGUI::System::getSingleton().injectTimePulse(evt.timeSinceLastFrame);
+
+		mMouse->capture();
+		mKeyboard->capture();
+
+		if (mShutdownRequested)
+			return false;
+		else
+		{
+			// update movement process
+			if(mProcessMovement || mUpdateMovement)
+			{
+				mTranslateVector.x += mMoveLeft ? mAvgFrameTime * -mMoveSpeed : 0;
+				mTranslateVector.x += mMoveRight ? mAvgFrameTime * mMoveSpeed : 0;
+				mTranslateVector.z += mMoveFwd ? mAvgFrameTime * -mMoveSpeed : 0;
+				mTranslateVector.z += mMoveBck ? mAvgFrameTime * mMoveSpeed : 0;
+
+				mCamera->yaw(mRotX);
+				mCamera->pitch(mRotY);
+				mCamera->moveRelative(mTranslateVector);
+
+				mUpdateMovement = false;
+				mRotX = 0;
+				mRotY = 0;
+				mTranslateVector = Ogre::Vector3::ZERO;
+			}
+
+		}
+
+		return true;
+	}
+
+    bool frameEnded(const FrameEvent& evt)
+    {
+		if (mAnimState)
+			mAnimState->addTime(evt.timeSinceLastFrame);
+
+		if (mShutdownRequested)
+			return false;
+		else
+			return ExampleFrameListener::frameEnded(evt);
+
+    }
+	//----------------------------------------------------------------//
+	bool mouseMoved( const OIS::MouseEvent &arg )
+	{
+		CEGUI::System::getSingleton().injectMouseMove( arg.state.X.rel, arg.state.Y.rel );
+		return true;
+	}
+
+	//----------------------------------------------------------------//
+	bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
+	{
+		CEGUI::System::getSingleton().injectMouseButtonDown(convertOISMouseButtonToCegui(id));
+		return true;
+	}
+
+	//----------------------------------------------------------------//
+	bool mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
+	{
+		CEGUI::System::getSingleton().injectMouseButtonUp(convertOISMouseButtonToCegui(id));
+		return true;
+	}
+
+	//----------------------------------------------------------------//
+	bool keyPressed( const OIS::KeyEvent &arg )
+	{
+		if( arg.key == OIS::KC_ESCAPE )
+			mShutdownRequested = true;
+
+		if (arg.key == OIS::KC_SYSRQ)
+			mWindow->writeContentsToTimestampedFile("screenshot", ".jpg");
+
+		CEGUI::System::getSingleton().injectKeyDown( arg.key );
+		CEGUI::System::getSingleton().injectChar( arg.text );
+		return true;
+	}
+
+	//----------------------------------------------------------------//
+	bool keyReleased( const OIS::KeyEvent &arg )
+	{
+		CEGUI::System::getSingleton().injectKeyUp( arg.key );
+		return true;
+	}
+	//--------------------------------------------------------------------------
+	bool handleMouseMove(const CEGUI::EventArgs& e)
+	{
+		const CEGUI::MouseEventArgs& me = static_cast<const CEGUI::MouseEventArgs&>(e);
+
+		if( mLMBDown && !mRMBDown)
+		{
+			// rotate camera
+			mRotX += Degree(-me.moveDelta.d_x * mAvgFrameTime * 3.0);
+			mRotY += Degree(-me.moveDelta.d_y * mAvgFrameTime * 3.0);
+			CEGUI::MouseCursor::getSingleton().setPosition( mLastMousePosition );
+			mUpdateMovement = true;
+		}
+		else
+		{
+			if( mRMBDown && !mLMBDown)
+			{
+				// translate camera
+				mTranslateVector.x += me.moveDelta.d_x * mAvgFrameTime * mMoveSpeed;
+				mTranslateVector.y += -me.moveDelta.d_y * mAvgFrameTime * mMoveSpeed;
+				//mTranslateVector.z = 0;
+				CEGUI::MouseCursor::getSingleton().setPosition( mLastMousePosition );
+				mUpdateMovement = true;
+			}
+			else
+			{
+				if( mRMBDown && mLMBDown)
+				{
+					mTranslateVector.z += (me.moveDelta.d_x + me.moveDelta.d_y) * mAvgFrameTime * mMoveSpeed;
+					CEGUI::MouseCursor::getSingleton().setPosition( mLastMousePosition );
+					mUpdateMovement = true;
+				}
+
+			}
+		}
+
+		return true;
+	}
+
+	//--------------------------------------------------------------------------
+	bool handleMouseButtonUp(const CEGUI::EventArgs& e)
+	{
+		const CEGUI::MouseEventArgs& me = static_cast<const CEGUI::MouseEventArgs&>(e);
+
+		//Window* wndw = ((const WindowEventArgs&)e).window;
+		if( me.button == CEGUI::LeftButton )
+		{
+			mLMBDown = false;
+		}
+
+		if( me.button == CEGUI::RightButton )
+		{
+			mRMBDown = false;
+		}
+		if( !mLMBDown && !mRMBDown )
+		{
+			CEGUI::MouseCursor::getSingleton().show();
+			if(mLastMousePositionSet)
+			{
+				CEGUI::MouseCursor::getSingleton().setPosition( mLastMousePosition );
+				mLastMousePositionSet = false;
+			}
+			mRootGuiPanel->releaseInput();
+		}
+
+		return true;
+	}
+
+	//--------------------------------------------------------------------------
+	bool handleMouseButtonDown(const CEGUI::EventArgs& e)
+	{
+		const CEGUI::MouseEventArgs& me = static_cast<const CEGUI::MouseEventArgs&>(e);
+
+		//Window* wndw = ((const WindowEventArgs&)e).window;
+		if( me.button == CEGUI::LeftButton )
+		{
+			mLMBDown = true;
+		}
+
+		if( me.button == CEGUI::RightButton )
+		{
+			mRMBDown = true;
+		}
+
+		if( mLMBDown || mRMBDown )
+		{
+			CEGUI::MouseCursor::getSingleton().hide();
+			if (!mLastMousePositionSet)
+			{
+				mLastMousePosition = CEGUI::MouseCursor::getSingleton().getPosition();
+				mLastMousePositionSet = true;
+			}
+			mRootGuiPanel->captureInput();
+		}
+
+		return true;
+	}
+
+	//--------------------------------------------------------------------------
+	bool handleMouseWheelEvent(const CEGUI::EventArgs& e)
+	{
+		const CEGUI::MouseEventArgs& me = static_cast<const CEGUI::MouseEventArgs&>(e);
+		mTranslateVector.z += me.wheelChange * -5.0;
+		mUpdateMovement = true;
+
+		return true;
+	}
+
+	//--------------------------------------------------------------------------
+	void checkMovementKeys(CEGUI::Key::Scan scancode, bool state )
+	{
+
+		switch ( scancode )
+		{
+		case CEGUI::Key::A:
+			mMoveLeft = state;
+			break;
+
+		case CEGUI::Key::D:
+			mMoveRight = state;
+			break;
+
+		case CEGUI::Key::S:
+			mMoveBck = state;
+			break;
+
+		case CEGUI::Key::W:
+			mMoveFwd = state;
+			break;
+
+		default:
+			break;
+
+		}
+
+		mProcessMovement = mMoveLeft || mMoveRight || mMoveFwd || mMoveBck;
+
+	}
+	//--------------------------------------------------------------------------
+	bool handleKeyDownEvent(const CEGUI::EventArgs& e)
+	{
+		const CEGUI::KeyEventArgs& ke = static_cast<const CEGUI::KeyEventArgs&>(e);
+
+		checkMovementKeys(ke.scancode , true);
+
+		return true;
+	}
+
+	//--------------------------------------------------------------------------
+	bool handleKeyUpEvent(const CEGUI::EventArgs& e)
+	{
+		const CEGUI::KeyEventArgs& ke = static_cast<const CEGUI::KeyEventArgs&>(e);
+		checkMovementKeys(ke.scancode, false );
+
+		return true;
+	}
+
+    
+
+
+};
+
+class ShadowsApplication : public ExampleApplication
+{
+protected:
+	enum ShadowProjection
+	{
+		UNIFORM,
+		UNIFORM_FOCUSED,
+		LISPSM,
+		PLANE_OPTIMAL
+	};
+
+	enum ShadowMaterial
+	{
+		MAT_STANDARD,
+		MAT_DEPTH_FLOAT,
+		MAT_DEPTH_FLOAT_PCF
+	};
+	CEGUI::OgreCEGUIRenderer* mGUIRenderer;
+	CEGUI::System* mGUISystem;
+	CEGUI::Window* mDescWindow;
+	CEGUI::Scrollbar* mFixedBias;
+	CEGUI::Scrollbar* mGradientBias;
+	CEGUI::Scrollbar* mGradientClamp;
+	CEGUI::Window* mDepthShadowTweak;
+	CEGUI::Window* mFixedBiasText;
+	CEGUI::Window* mGradientBiasText;
+	CEGUI::Window* mGradientClampText;
+	
+
+	ShadowTechnique mCurrentShadowTechnique;
+	ShadowProjection mCurrentProjection;
+	ShadowMaterial mCurrentMaterial;
+
+	GpuProgramParametersSharedPtr mCustomRockwallVparams;
+	GpuProgramParametersSharedPtr mCustomRockwallFparams;
+	GpuProgramParametersSharedPtr mCustomAtheneVparams;
+	GpuProgramParametersSharedPtr mCustomAtheneFparams;
+
+	ShadowCameraSetupPtr mCurrentShadowCameraSetup;
+	/// Plane that defines plane-optimal shadow mapping basis
+	MovablePlane* mPlane;
+	// transient pointer to LiSPSM setup if present
+	LiSPSMShadowCameraSetup* mLiSPSMSetup;
+
+	bool mIsOpenGL;
+
+public:
+	ShadowsApplication() : 
+	  mGUIRenderer(0),
+	  mGUISystem(0),
+	  mPlane(0)
+	{
+
+
+    }
+
+    ~ShadowsApplication() 
+    {
+		mDescWindow = 0;
+
+		if(mGUISystem)
+		{
+			delete mGUISystem;
+			mGUISystem = 0;
+		}
+		if(mGUIRenderer)
+		{
+			delete mGUIRenderer;
+			mGUIRenderer = 0;
+		}
+
+		delete mPlane;
+    }
+protected:
+
+	// Override this to ensure FPU mode
+	bool configure(void)
+	{
+		// Show the configuration dialog and initialise the system
+		// You can skip this and use root.restoreConfig() to load configuration
+		// settings if you were sure there are valid ones saved in ogre.cfg
+		if(mRoot->showConfigDialog())
+		{
+			// Custom option - to use PlaneOptimalShadowCameraSetup we must have
+			// double-precision. Thus, set the D3D floating point mode if present, 
+			// no matter what was chosen
+			ConfigOptionMap& optMap = mRoot->getRenderSystem()->getConfigOptions();
+			ConfigOptionMap::iterator i = optMap.find("Floating-point mode");
+			if (i != optMap.end())
+			{
+				if (i->second.currentValue != "Consistent")
+				{
+					i->second.currentValue = "Consistent";
+					LogManager::getSingleton().logMessage("Demo_Shadows: overriding "
+						"D3D floating point mode to 'Consistent' to ensure precision "
+						"for plane-optimal camera setup option");
+
+				}
+			}
+
+			// If returned true, user clicked OK so initialise
+			// Here we choose to let the system create a default rendering window by passing 'true'
+			mWindow = mRoot->initialise(true);
+			return true;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	void generalSceneSetup()
+    {
+        // do this first so we generate edge lists
+        mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_ADDITIVE);
+		mCurrentShadowTechnique = SHADOWTYPE_STENCIL_ADDITIVE;
+
+        // Set ambient light off
+        mSceneMgr->setAmbientLight(ColourValue(0.0, 0.0, 0.0));
+
+        // Fixed light, dim
+        mSunLight = mSceneMgr->createLight("SunLight");
+        mSunLight->setType(Light::LT_SPOTLIGHT);
+        mSunLight->setPosition(1500,1750,1300);
+        mSunLight->setSpotlightRange(Degree(30), Degree(50));
+        Vector3 dir;
+        dir = -mSunLight->getPosition();
+        dir.normalise();
+        mSunLight->setDirection(dir);
+        mSunLight->setDiffuseColour(0.35, 0.35, 0.38);
+        mSunLight->setSpecularColour(0.9, 0.9, 1);
+
+        // Point light, movable, reddish
+        mLight = mSceneMgr->createLight("Light2");
+        mLight->setDiffuseColour(mMinLightColour);
+        mLight->setSpecularColour(1, 1, 1);
+        mLight->setAttenuation(8000,1,0.0005,0);
+
+        // Create light node
+        mLightNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(
+            "MovingLightNode");
+        mLightNode->attachObject(mLight);
+        // create billboard set
+        BillboardSet* bbs = mSceneMgr->createBillboardSet("lightbbs", 1);
+        bbs->setMaterialName("Examples/Flare");
+        Billboard* bb = bbs->createBillboard(0,0,0,mMinLightColour);
+        // attach
+        mLightNode->attachObject(bbs);
+
+        // create controller, after this is will get updated on its own
+        ControllerFunctionRealPtr func = ControllerFunctionRealPtr(
+            new WaveformControllerFunction(Ogre::WFT_SINE, 0.75, 0.5));
+        ControllerManager& contMgr = ControllerManager::getSingleton();
+        ControllerValueRealPtr val = ControllerValueRealPtr(
+            new LightWibbler(mLight, bb, mMinLightColour, mMaxLightColour, 
+            mMinFlareSize, mMaxFlareSize));
+        Controller<Real>* controller = contMgr.createController(
+            contMgr.getFrameTimeSource(), val, func);
+
+        //mLight->setPosition(Vector3(300,250,-300));
+        mLightNode->setPosition(Vector3(300,1750,-700));
+
+
+        // Create a track for the light
+        Animation* anim = mSceneMgr->createAnimation("LightTrack", 20);
+        // Spline it for nice curves
+        anim->setInterpolationMode(Animation::IM_SPLINE);
+        // Create a track to animate the camera's node
+        NodeAnimationTrack* track = anim->createNodeTrack(0, mLightNode);
+        // Setup keyframes
+        TransformKeyFrame* key = track->createNodeKeyFrame(0); // A startposition
+        key->setTranslate(Vector3(300,750,-700));
+        key = track->createNodeKeyFrame(2);//B
+        key->setTranslate(Vector3(150,800,-250));
+        key = track->createNodeKeyFrame(4);//C
+        key->setTranslate(Vector3(-150,850,-100));
+        key = track->createNodeKeyFrame(6);//D
+        key->setTranslate(Vector3(-400,700,-200));
+        key = track->createNodeKeyFrame(8);//E
+        key->setTranslate(Vector3(-200,700,-400));
+        key = track->createNodeKeyFrame(10);//F
+        key->setTranslate(Vector3(-100,850,-200));
+        key = track->createNodeKeyFrame(12);//G
+        key->setTranslate(Vector3(-100,575,180));
+        key = track->createNodeKeyFrame(14);//H
+        key->setTranslate(Vector3(0,750,300));
+        key = track->createNodeKeyFrame(16);//I
+        key->setTranslate(Vector3(100,850,100));
+        key = track->createNodeKeyFrame(18);//J
+        key->setTranslate(Vector3(250,800,0));
+        key = track->createNodeKeyFrame(20);//K == A
+        key->setTranslate(Vector3(300,750,-700));
+        // Create a new animation state to track this
+        mAnimState = mSceneMgr->createAnimationState("LightTrack");
+        mAnimState->setEnabled(true);
+        // Make light node look at origin, this is for when we
+        // change the moving light to a spotlight
+        mLightNode->setAutoTracking(true, mSceneMgr->getRootSceneNode());
+
+        // Prepare athene mesh for normalmapping
+        MeshPtr pAthene = MeshManager::getSingleton().load("athene.mesh", 
+            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+        unsigned short src, dest;
+        if (!pAthene->suggestTangentVectorBuildParams(VES_TANGENT, src, dest))
+        {
+            pAthene->buildTangentVectors(VES_TANGENT, src, dest);
+        }
+
+        SceneNode* node;
+        node = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        mAthene = mSceneMgr->createEntity( "athene", "athene.mesh" );
+        mAthene->setMaterialName(BASIC_ATHENE_MATERIAL);
+        node->attachObject( mAthene );
+        node->translate(0,-27, 0);
+        node->yaw(Degree(90));
+
+        Entity* pEnt;
+		// Columns
+		for (int x = -2; x <= 2; ++x)
+		{
+			for (int z = -2; z <= 2; ++z)
+			{
+				if (x != 0 || z != 0)
+				{
+					StringUtil::StrStreamType str;
+					str << "col" << x << "_" << z;
+					node = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+					pEnt = mSceneMgr->createEntity( str.str(), "column.mesh" );
+					pEnt->setMaterialName(BASIC_ROCKWALL_MATERIAL);
+					pColumns.push_back(pEnt);
+					node->attachObject( pEnt );
+					node->translate(x*300,0, z*300);
+
+				}
+			}
+
+		}
+
+
+        // Skybox
+        mSceneMgr->setSkyBox(true, "Examples/StormySkyBox");
+
+        // Floor plane (use POSM plane def)
+		mPlane = new MovablePlane("*mPlane");
+        mPlane->normal = Vector3::UNIT_Y;
+        mPlane->d = 107;
+        MeshManager::getSingleton().createPlane("Myplane",
+            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, *mPlane,
+            1500,1500,50,50,true,1,5,5,Vector3::UNIT_Z);
+        pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+        pPlaneEnt->setMaterialName(BASIC_ROCKWALL_MATERIAL);
+        pPlaneEnt->setCastShadows(false);
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+		if (mRoot->getRenderSystem()->getCapabilities()->hasCapability(RSC_HWRENDER_TO_TEXTURE))
+        {
+            // In D3D, use a 1024x1024 shadow texture
+            mSceneMgr->setShadowTextureSettings(1024, 2);
+        }
+        else
+        {
+            // Use 512x512 texture in GL since we can't go higher than the window res
+            mSceneMgr->setShadowTextureSettings(512, 2);
+        }
+        mSceneMgr->setShadowColour(ColourValue(0.5, 0.5, 0.5));
+
+        // incase infinite far distance is not supported
+        mCamera->setFarClipDistance(100000);
+
+        //mSceneMgr->setShowDebugShadows(true);
+
+		mCamera->setPosition(250, 20, 400);
+		mCamera->lookAt(0, 10, 0);
+
+    }
+	
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+		// Need to detect D3D or GL for best depth shadowmapping
+		if (Root::getSingleton().getRenderSystem()->getName().find("GL") != String::npos)
+		{
+			mIsOpenGL = true;
+		}
+		else
+		{
+			mIsOpenGL = false;
+		}
+
+		// set up general scene (this defaults to additive stencils)
+        generalSceneSetup();
+
+		setupGUI();
+
+
+    }
+
+	/// Change basic shadow technique 
+	void changeShadowTechnique(ShadowTechnique newTech)
+	{
+		mSceneMgr->setShadowTechnique(newTech);
+
+		// Below is for projection
+		//configureShadowCameras(mCurrentShadowTechnique, newTech);
+
+		configureLights(newTech);
+
+		// Advanced modes - materials / compositors
+		//configureCompositors(mCurrentShadowTechnique, newTech);
+		//configureTextures(mCurrentShadowTechnique, newTech);
+		//configureShadowCasterReceiverMaterials(mCurrentShadowTechnique, newTech);
+
+		updateGUI(newTech);
+
+		mCurrentShadowTechnique = newTech;
+
+
+	}
+
+
+
+	void configureLights(ShadowTechnique newTech)
+	{
+		Vector3 dir;
+		switch (newTech)
+		{
+		case SHADOWTYPE_STENCIL_ADDITIVE:
+			// Fixed light, dim
+			mSunLight->setCastShadows(true);
+
+			// Point light, movable, reddish
+			mLight->setType(Light::LT_POINT);
+			mLight->setCastShadows(true);
+			mLight->setDiffuseColour(mMinLightColour);
+			mLight->setSpecularColour(1, 1, 1);
+			mLight->setAttenuation(8000,1,0.0005,0);
+
+			break;
+		case SHADOWTYPE_STENCIL_MODULATIVE:
+			// Multiple lights cause obvious silhouette edges in modulative mode
+			// So turn off shadows on the direct light
+			// Fixed light, dim
+			mSunLight->setCastShadows(false);
+
+			// Point light, movable, reddish
+			mLight->setType(Light::LT_POINT);
+			mLight->setCastShadows(true);
+			mLight->setDiffuseColour(mMinLightColour);
+			mLight->setSpecularColour(1, 1, 1);
+			mLight->setAttenuation(8000,1,0.0005,0);
+			break;
+		case SHADOWTYPE_TEXTURE_MODULATIVE:
+		case SHADOWTYPE_TEXTURE_ADDITIVE:
+			// Fixed light, dim
+			mSunLight->setCastShadows(true);
+
+			// Change moving light to spotlight
+			// Point light, movable, reddish
+			mLight->setType(Light::LT_SPOTLIGHT);
+			mLight->setDirection(Vector3::NEGATIVE_UNIT_Z);
+			mLight->setCastShadows(true);
+			mLight->setDiffuseColour(mMinLightColour);
+			mLight->setSpecularColour(1, 1, 1);
+			mLight->setAttenuation(8000,1,0.0005,0);
+			mLight->setSpotlightRange(Degree(80),Degree(90));
+
+
+			break;
+		default:
+			break;
+		};
+
+	}
+
+	void setupGUI()
+	{
+		// setup GUI system
+		mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, 
+			Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr);
+
+		mGUISystem = new CEGUI::System(mGUIRenderer);
+
+		CEGUI::Logger::getSingleton().setLoggingLevel(CEGUI::Informative);
+
+		// load scheme and set up defaults
+		CEGUI::SchemeManager::getSingleton().loadScheme(
+			(CEGUI::utf8*)"TaharezLookSkin.scheme");
+		mGUISystem->setDefaultMouseCursor(
+			(CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow");
+		mGUISystem->setDefaultFont((CEGUI::utf8*)"BlueHighway-12");
+
+		CEGUI::Window* sheet = 
+			CEGUI::WindowManager::getSingleton().loadWindowLayout(
+			(CEGUI::utf8*)"shadows.layout"); 
+		mGUISystem->setGUISheet(sheet);
+
+		// Tooltips aren't big enough, do our own
+		//mGUISystem->setDefaultTooltip("TaharezLook/Tooltip");
+
+		CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
+		// Get description window
+		mDescWindow = wmgr.getWindow("Shadows/Desc");
+
+		CEGUI::Window *wnd = wmgr.getWindow("Shadows/Stencil");
+		wnd->subscribeEvent(CEGUI::Window::EventMouseEnters, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnter, this));
+		wnd->subscribeEvent(CEGUI::Window::EventMouseLeaves, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
+		wnd = wmgr.getWindow("Shadows/Texture");
+		wnd->subscribeEvent(CEGUI::Window::EventMouseEnters, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnter, this));
+		wnd->subscribeEvent(CEGUI::Window::EventMouseLeaves, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
+		wnd = wmgr.getWindow("Shadows/Additive");
+		wnd->subscribeEvent(CEGUI::Window::EventMouseEnters, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnter, this));
+		wnd->subscribeEvent(CEGUI::Window::EventMouseLeaves, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
+		wnd = wmgr.getWindow("Shadows/Modulative");
+		wnd->subscribeEvent(CEGUI::Window::EventMouseEnters, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnter, this));
+		wnd->subscribeEvent(CEGUI::Window::EventMouseLeaves, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
+		
+		// Combo doesn't raise enter / exit itself, have to grab subcomponents?
+		CEGUI::Combobox* cbo = static_cast<CEGUI::Combobox*>(wmgr.getWindow("Shadows/Projection"));
+		cbo->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted,
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleProjectionChanged, this));
+		cbo->getEditbox()->subscribeEvent(CEGUI::Window::EventMouseEnters, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnterCombo, this));
+		cbo->getEditbox()->subscribeEvent(CEGUI::Window::EventMouseLeaves, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
+		cbo->getDropList()->subscribeEvent(CEGUI::Window::EventMouseEnters, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnterCombo, this));
+		cbo->getDropList()->subscribeEvent(CEGUI::Window::EventMouseLeaves, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
+		cbo->getPushButton()->subscribeEvent(CEGUI::Window::EventMouseEnters, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnterCombo, this));
+		cbo->getPushButton()->subscribeEvent(CEGUI::Window::EventMouseLeaves, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
+		// Populate projection
+		// Get a select image to be used for highlighting items in listbox when mouse moves over them
+		const CEGUI::Image* selectImage = &CEGUI::ImagesetManager::getSingleton().getImageset("TaharezLook")->getImage("MultiListSelectionBrush");
+		CEGUI::ListboxTextItem* li = new CEGUI::ListboxTextItem("Uniform", UNIFORM);
+        li->setSelectionBrushImage(selectImage);
+		li->setTooltipText("Uniform: Shadows are rendered and projected using a uniform "
+			"frustum for the whole light coverage. Simple and lowest quality.");
+		cbo->addItem(li);
+		cbo->setItemSelectState(li, true);
+		cbo->setText("Uniform");
+		mCurrentProjection = UNIFORM;
+		li = new CEGUI::ListboxTextItem("Uniform Focused", UNIFORM_FOCUSED);
+        li->setSelectionBrushImage(selectImage);
+		li->setTooltipText("Uniform Focused: As Uniform except that the frustum is "
+			"focused on the visible area of the camera. Better quality than Uniform "
+			"at the expense of some 'swimming'.");
+		cbo->addItem(li);
+		li = new CEGUI::ListboxTextItem("LiSPSM", LISPSM);
+        li->setSelectionBrushImage(selectImage);
+		li->setTooltipText("LiSPSM: The frustum is distorted to take into account "
+			"the perspective of the camera, and focused on the visible area. "
+			"Good quality & flexibility.");
+		cbo->addItem(li);
+		li = new CEGUI::ListboxTextItem("Plane Optimal", PLANE_OPTIMAL);
+        li->setSelectionBrushImage(selectImage);
+		li->setTooltipText("Plane Optimal: The frustum is optimised to project "
+			"shadows onto a plane of interest. Best possible quality for the "
+			"plane, less good for other receiver angles.");
+		cbo->addItem(li);
+
+		
+		cbo = static_cast<CEGUI::Combobox*>(wmgr.getWindow("Shadows/Material"));
+		cbo->getEditbox()->subscribeEvent(CEGUI::Window::EventMouseEnters, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnterCombo, this));
+		cbo->getEditbox()->subscribeEvent(CEGUI::Window::EventMouseLeaves, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
+		cbo->getDropList()->subscribeEvent(CEGUI::Window::EventMouseEnters, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnterCombo, this));
+		cbo->getDropList()->subscribeEvent(CEGUI::Window::EventMouseLeaves, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
+		cbo->getPushButton()->subscribeEvent(CEGUI::Window::EventMouseEnters, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseEnterCombo, this));
+		cbo->getPushButton()->subscribeEvent(CEGUI::Window::EventMouseLeaves, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMouseLeave, this));
+		cbo->subscribeEvent(CEGUI::Combobox::EventListSelectionAccepted,
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleMaterialChanged, this));
+
+		li = new CEGUI::ListboxTextItem("Standard", MAT_STANDARD);
+		li->setSelectionBrushImage(selectImage);
+		li->setTooltipText("Standard Material: Shadows are rendered into a simple RGB texture "
+			" and are received only by objects that are not themselves shadow casters "
+			" (no self-shadowing)");
+		cbo->addItem(li);
+		cbo->setItemSelectState(li, true);
+		cbo->setText("Standard");
+		mCurrentMaterial = MAT_STANDARD;
+
+		// Only add depth shadowmapping if supported
+		if (GpuProgramManager::getSingleton().isSyntaxSupported("ps_2_0") ||
+			GpuProgramManager::getSingleton().isSyntaxSupported("glsl"))
+		{
+			li = new CEGUI::ListboxTextItem("Depth Shadowmap", MAT_DEPTH_FLOAT);
+			li->setSelectionBrushImage(selectImage);
+			li->setTooltipText("Depth Shadowmap: Shadow caster depth is rendered into a "
+				" floating point texture and a depth comparison is performed on receivers "
+				" (self-shadowing allowed). Requires floating point textures and shader support.");
+			cbo->addItem(li);
+
+			li = new CEGUI::ListboxTextItem("Depth Shadowmap (PCF)", MAT_DEPTH_FLOAT_PCF);
+			li->setSelectionBrushImage(selectImage);
+			li->setTooltipText("Depth Shadowmap (PCF): Shadow caster depth is rendered into a "
+				" floating point texture and a depth comparison is performed on receivers "
+				" (self-shadowing allowed), with a percentage closest filter. Requires "
+				"floating point textures and shader support.");
+			cbo->addItem(li);
+		}
+
+		CEGUI::RadioButton* radio = static_cast<CEGUI::RadioButton*>(
+			wmgr.getWindow("Shadows/Stencil"));
+		radio->setSelected(true);
+		radio->subscribeEvent(CEGUI::RadioButton::EventSelectStateChanged, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleShadowTypeChanged, this));
+		radio = static_cast<CEGUI::RadioButton*>(wmgr.getWindow("Shadows/Texture"));
+		radio->subscribeEvent(CEGUI::RadioButton::EventSelectStateChanged, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleShadowTypeChanged, this));
+		radio = static_cast<CEGUI::RadioButton*>(wmgr.getWindow("Shadows/Modulative"));
+		radio->subscribeEvent(CEGUI::RadioButton::EventSelectStateChanged, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleShadowTypeChanged, this));
+		radio = static_cast<CEGUI::RadioButton*>(wmgr.getWindow("Shadows/Additive"));
+		radio->setSelected(true);
+		radio->subscribeEvent(CEGUI::RadioButton::EventSelectStateChanged, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleShadowTypeChanged, this));
+
+
+
+		mFixedBias = static_cast<CEGUI::Scrollbar*>(wmgr.getWindow("Shadows/DepthShadowTweakGroup/FixedBias"));
+		mFixedBias->setScrollPosition(0.002f);
+		mFixedBias->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleParamsChanged, this));
+		mGradientBias = static_cast<CEGUI::Scrollbar*>(wmgr.getWindow("Shadows/DepthShadowTweakGroup/SlopeBias"));
+		mGradientBias->setScrollPosition(0.0008f);
+		mGradientBias->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleParamsChanged, this));
+		mGradientClamp = static_cast<CEGUI::Scrollbar*>(wmgr.getWindow("Shadows/DepthShadowTweakGroup/SlopeClamp"));
+		mGradientClamp->setScrollPosition(0.02f);
+		mGradientClamp->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged, 
+			CEGUI::Event::Subscriber(&ShadowsApplication::handleParamsChanged, this));
+
+		mDepthShadowTweak = wmgr.getWindow("Shadows/DepthShadowTweakGroup");
+		mDepthShadowTweak->setVisible(false);
+		mFixedBiasText = wmgr.getWindow("Shadows/DepthShadowTweakGroup/FixedBiasText");
+		mGradientBiasText = wmgr.getWindow("Shadows/DepthShadowTweakGroup/SlopeBiasText");
+		mGradientClampText = wmgr.getWindow("Shadows/DepthShadowTweakGroup/SlopeClampText");
+		
+
+		
+
+		updateGUI(mCurrentShadowTechnique);
+
+
+
+	}
+
+	void updateGUI(ShadowTechnique newTech)
+	{
+		bool isTextureBased = (newTech & SHADOWDETAILTYPE_TEXTURE) != 0;
+
+		// Stencil based technique, turn off the texture-specific options
+		CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
+		CEGUI::Window* win = wmgr.getWindow("Shadows/Projection");
+		win->setEnabled(isTextureBased);
+		win = wmgr.getWindow("Shadows/Material");
+		win->setEnabled(isTextureBased);
+
+	}
+
+	/// callback when mouse enters a described field (non-combo)
+	bool handleMouseEnter(const CEGUI::EventArgs& e)
+	{
+		const CEGUI::WindowEventArgs& winargs = 
+			static_cast<const CEGUI::WindowEventArgs&>(e);
+		mDescWindow->setText(winargs.window->getTooltipText());
+
+		return true;
+	}
+	/// callback when mouse leaves a described field
+	bool handleMouseLeave(const CEGUI::EventArgs& e)
+	{
+		//if (mDescWindow)
+		//	mDescWindow->setText("");
+
+		return true;
+	}
+
+	void updateTipForCombo(CEGUI::Combobox* cbo)
+	{
+
+		CEGUI::String text = cbo->getTooltipText();
+
+		text.append(" ");
+		if (cbo->getSelectedItem())
+			text.append(cbo->getSelectedItem()->getTooltipText());
+		mDescWindow->setText(text);
+
+	}
+	/// callback when mouse enters a described field (combo)
+	bool handleMouseEnterCombo(const CEGUI::EventArgs& e)
+	{
+		const CEGUI::WindowEventArgs& winargs = 
+			static_cast<const CEGUI::WindowEventArgs&>(e);
+		// get tooltip from parent combo (events raised on contained components)
+		CEGUI::Combobox* cbo = static_cast<CEGUI::Combobox*>(winargs.window->getParent());
+		updateTipForCombo(cbo);
+
+		return true;
+	}
+	// Callback when a shadow type combo changed
+	bool handleShadowTypeChanged(const CEGUI::EventArgs& e)
+	{
+		// Only trigger change on selected
+		const CEGUI::WindowEventArgs& we = static_cast<const CEGUI::WindowEventArgs&>(e);
+		CEGUI::RadioButton* radio = static_cast<CEGUI::RadioButton*>(we.window);
+		if (radio->isSelected())
+		{
+			ShadowTechnique newTech = mCurrentShadowTechnique;
+			switch (radio->getID())
+			{
+			case 1:
+				// stencil 
+				newTech = static_cast<ShadowTechnique>(
+					(newTech & ~SHADOWDETAILTYPE_TEXTURE) | SHADOWDETAILTYPE_STENCIL);
+				resetMaterials();
+				break;
+			case 2:
+				// texture
+				newTech = static_cast<ShadowTechnique>(
+					(newTech & ~SHADOWDETAILTYPE_STENCIL) | SHADOWDETAILTYPE_TEXTURE);
+				break;
+			case 3:
+				// additive
+				newTech = static_cast<ShadowTechnique>(
+					(newTech & ~SHADOWDETAILTYPE_MODULATIVE) | SHADOWDETAILTYPE_ADDITIVE);
+				break;
+			case 4:
+				// modulative
+				newTech = static_cast<ShadowTechnique>(
+					(newTech & ~SHADOWDETAILTYPE_ADDITIVE) | SHADOWDETAILTYPE_MODULATIVE);
+				break;
+
+
+			}
+
+			changeShadowTechnique(newTech);
+
+		}
+
+		return true;
+	}
+
+	bool handleProjectionChanged(const CEGUI::EventArgs& e)
+	{
+		const CEGUI::WindowEventArgs& winargs = 
+			static_cast<const CEGUI::WindowEventArgs&>(e);
+		CEGUI::Combobox* cbo = static_cast<CEGUI::Combobox*>(winargs.window);
+
+		if (cbo->getSelectedItem())
+		{
+			ShadowProjection proj = (ShadowProjection)cbo->getSelectedItem()->getID();
+			if (proj != mCurrentProjection)
+			{
+				switch(proj)
+				{
+				case UNIFORM:
+					mCurrentShadowCameraSetup = 
+						ShadowCameraSetupPtr(new DefaultShadowCameraSetup());
+					break;
+				case UNIFORM_FOCUSED:
+					mCurrentShadowCameraSetup = 
+						ShadowCameraSetupPtr(new FocusedShadowCameraSetup());
+					break;
+				case LISPSM:
+					{
+						mLiSPSMSetup = new LiSPSMShadowCameraSetup();
+						//mLiSPSMSetup->setUseAggressiveFocusRegion(false);
+						mCurrentShadowCameraSetup = ShadowCameraSetupPtr(mLiSPSMSetup);
+					}
+					break;
+				case PLANE_OPTIMAL:
+					mCurrentShadowCameraSetup = 
+						ShadowCameraSetupPtr(new PlaneOptimalShadowCameraSetup(mPlane));
+					break;
+
+				};
+				mCurrentProjection = proj;
+
+				mSceneMgr->setShadowCameraSetup(mCurrentShadowCameraSetup);
+
+				updateTipForCombo(cbo);
+				if (!mCustomRockwallVparams.isNull() && !mCustomRockwallFparams.isNull())
+				{
+					// set
+					setDefaultDepthShadowParams();
+				}
+
+			}
+		}
+
+		return true;
+	}
+
+	void updateDepthShadowParams()
+	{
+		mCustomRockwallFparams->setNamedConstant("fixedDepthBias", 
+			mFixedBias->getScrollPosition());
+		mCustomRockwallFparams->setNamedConstant("gradientScaleBias",
+			mGradientBias->getScrollPosition());
+		mCustomRockwallFparams->setNamedConstant("gradientClamp",
+			mGradientClamp->getScrollPosition());
+
+		mCustomAtheneFparams->setNamedConstant("fixedDepthBias", 
+			mFixedBias->getScrollPosition());
+		mCustomAtheneFparams->setNamedConstant("gradientScaleBias",
+			mGradientBias->getScrollPosition());
+		mCustomAtheneFparams->setNamedConstant("gradientClamp",
+			mGradientClamp->getScrollPosition());
+
+
+		mFixedBiasText->setText(StringConverter::toString(
+			mFixedBias->getScrollPosition(), 4, 5, '0', std::ios::fixed));
+		mGradientBiasText->setText(StringConverter::toString(
+			mGradientBias->getScrollPosition(), 4, 5, '0', std::ios::fixed));
+		mGradientClampText->setText(StringConverter::toString(
+			mGradientClamp->getScrollPosition(), 4, 5, '0', std::ios::fixed));
+	}
+
+	void setDefaultDepthShadowParams()
+	{
+		switch(mCurrentProjection)
+		{
+		case UNIFORM:
+		case UNIFORM_FOCUSED:
+		case PLANE_OPTIMAL:
+			mFixedBias->setScrollPosition(0.0f);
+			mGradientBias->setScrollPosition(0.0f);
+			break;
+		case LISPSM:
+			mFixedBias->setScrollPosition(0.009f);
+			mGradientBias->setScrollPosition(0.04f);
+			break;
+		};
+
+		updateDepthShadowParams();
+
+	}
+
+	bool handleParamsChanged(const CEGUI::EventArgs& e)
+	{
+		if (!mCustomRockwallVparams.isNull() && !mCustomRockwallFparams.isNull())
+		{
+			updateDepthShadowParams();
+		}
+
+		return true;
+	}
+
+	void rebindDebugShadowOverlays()
+	{
+		MaterialPtr debugMat = 
+			MaterialManager::getSingleton().getByName("Ogre/DebugShadowMap0");
+		TexturePtr shadowTex = mSceneMgr->getShadowTexture(0);
+		debugMat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(shadowTex->getName());
+
+		debugMat = 
+			MaterialManager::getSingleton().getByName("Ogre/DebugShadowMap1");
+		shadowTex = mSceneMgr->getShadowTexture(1);
+		debugMat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(shadowTex->getName());
+	}
+
+	void resetMaterials()
+	{
+		// Sort out base materials
+		pPlaneEnt->setMaterialName(BASIC_ROCKWALL_MATERIAL);
+		mAthene->setMaterialName(BASIC_ATHENE_MATERIAL);
+		for (std::vector<Entity*>::iterator i = pColumns.begin();
+			i != pColumns.end(); ++i)
+		{
+			(*i)->setMaterialName(BASIC_ROCKWALL_MATERIAL);
+		}
+
+		mCustomRockwallVparams.setNull();
+		mCustomRockwallFparams.setNull();
+		mCustomAtheneVparams.setNull();
+		mCustomAtheneFparams.setNull();
+
+	}
+	bool handleMaterialChanged(const CEGUI::EventArgs& e)
+	{
+		const CEGUI::WindowEventArgs& winargs = 
+			static_cast<const CEGUI::WindowEventArgs&>(e);
+		CEGUI::Combobox* cbo = static_cast<CEGUI::Combobox*>(winargs.window);
+
+		if (cbo->getSelectedItem())
+		{
+			ShadowMaterial mat = (ShadowMaterial)cbo->getSelectedItem()->getID();
+			MaterialPtr themat;
+			if (mat != mCurrentMaterial)
+			{
+				switch(mat)
+				{
+				case MAT_STANDARD:
+					mSceneMgr->setShadowTexturePixelFormat(PF_L8);
+					mSceneMgr->setShadowTextureCasterMaterial(StringUtil::BLANK);
+					mSceneMgr->setShadowTextureReceiverMaterial(StringUtil::BLANK);
+					mSceneMgr->setShadowTextureSelfShadow(false);	
+					mDepthShadowTweak->setVisible(false);
+
+					resetMaterials();
+
+					break;
+				case MAT_DEPTH_FLOAT:
+					if (mIsOpenGL)
+					{
+						// GL performs much better if you pick half-float format
+						mSceneMgr->setShadowTexturePixelFormat(PF_FLOAT16_R);
+					}
+					else
+					{
+						// D3D is the opposite - if you ask for PF_FLOAT16_R you
+						// get an integer format instead! You can ask for PF_FLOAT16_GR
+						// but the precision doesn't work well
+						mSceneMgr->setShadowTexturePixelFormat(PF_FLOAT32_R);
+					}
+					mSceneMgr->setShadowTextureCasterMaterial(CUSTOM_CASTER_MATERIAL);
+					mSceneMgr->setShadowTextureReceiverMaterial(CUSTOM_RECEIVER_MATERIAL);
+					mSceneMgr->setShadowTextureSelfShadow(true);	
+					// Sort out base materials
+					pPlaneEnt->setMaterialName(CUSTOM_ROCKWALL_MATERIAL);
+					mAthene->setMaterialName(CUSTOM_ATHENE_MATERIAL);
+					for (std::vector<Entity*>::iterator i = pColumns.begin();
+						i != pColumns.end(); ++i)
+					{
+						(*i)->setMaterialName(CUSTOM_ROCKWALL_MATERIAL);
+					}
+
+					themat = MaterialManager::getSingleton().getByName(CUSTOM_ROCKWALL_MATERIAL);
+					mCustomRockwallVparams = themat->getTechnique(0)->getPass(1)->getShadowReceiverVertexProgramParameters();
+					mCustomRockwallFparams = themat->getTechnique(0)->getPass(1)->getShadowReceiverFragmentProgramParameters();
+					themat = MaterialManager::getSingleton().getByName(CUSTOM_ATHENE_MATERIAL);
+					mCustomAtheneVparams = themat->getTechnique(0)->getPass(1)->getShadowReceiverVertexProgramParameters();
+					mCustomAtheneFparams = themat->getTechnique(0)->getPass(1)->getShadowReceiverFragmentProgramParameters();
+					mDepthShadowTweak->setVisible(true);
+
+
+					// set the current params
+					setDefaultDepthShadowParams();
+					break;
+				case MAT_DEPTH_FLOAT_PCF:
+					if (mIsOpenGL)
+					{
+						// GL performs much better if you pick half-float format
+						mSceneMgr->setShadowTexturePixelFormat(PF_FLOAT16_R);
+					}
+					else
+					{
+						// D3D is the opposite - if you ask for PF_FLOAT16_R you
+						// get an integer format instead! You can ask for PF_FLOAT16_GR
+						// but the precision doesn't work well
+						mSceneMgr->setShadowTexturePixelFormat(PF_FLOAT32_R);
+					}
+					mSceneMgr->setShadowTextureCasterMaterial(CUSTOM_CASTER_MATERIAL);
+					mSceneMgr->setShadowTextureReceiverMaterial(CUSTOM_RECEIVER_MATERIAL + "/PCF");
+					mSceneMgr->setShadowTextureSelfShadow(true);	
+					// Sort out base materials
+					pPlaneEnt->setMaterialName(CUSTOM_ROCKWALL_MATERIAL + "/PCF");
+					mAthene->setMaterialName(CUSTOM_ATHENE_MATERIAL + "/PCF");
+					for (std::vector<Entity*>::iterator i = pColumns.begin();
+						i != pColumns.end(); ++i)
+					{
+						(*i)->setMaterialName(CUSTOM_ROCKWALL_MATERIAL + "/PCF");
+					}
+
+					themat = MaterialManager::getSingleton().getByName(CUSTOM_ROCKWALL_MATERIAL + "/PCF");
+					mCustomRockwallVparams = themat->getTechnique(0)->getPass(1)->getShadowReceiverVertexProgramParameters();
+					mCustomRockwallFparams = themat->getTechnique(0)->getPass(1)->getShadowReceiverFragmentProgramParameters();
+					themat = MaterialManager::getSingleton().getByName(CUSTOM_ATHENE_MATERIAL + "/PCF");
+					mCustomAtheneVparams = themat->getTechnique(0)->getPass(1)->getShadowReceiverVertexProgramParameters();
+					mCustomAtheneFparams = themat->getTechnique(0)->getPass(1)->getShadowReceiverFragmentProgramParameters();
+					mDepthShadowTweak->setVisible(true);
+
+					// set the current params
+					setDefaultDepthShadowParams();
+					break;
+				};
+				mCurrentMaterial = mat;
+
+				updateTipForCombo(cbo);
+				rebindDebugShadowOverlays();
+
+			}
+		}
+
+		return true;
+	}
+
+    // Create new frame listener
+    void createFrameListener(void)
+    {
+        ShadowsListener* shadowListener = new ShadowsListener(mWindow, mCamera, mSceneMgr);
+		mFrameListener = shadowListener;
+        mFrameListener->showDebugOverlay(true);
+        mRoot->addFrameListener(mFrameListener);
+
+		// Hook up Root sheet (handles main input)
+		CEGUI::Window* wnd = CEGUI::WindowManager::getSingleton().getWindow("Shadows");
+		wnd->subscribeEvent(CEGUI::Window::EventMouseMove, 
+			CEGUI::Event::Subscriber(&ShadowsListener::handleMouseMove, shadowListener));
+		wnd->subscribeEvent(CEGUI::Window::EventMouseButtonUp, 
+			CEGUI::Event::Subscriber(&ShadowsListener::handleMouseButtonUp, shadowListener));
+		wnd->subscribeEvent(CEGUI::Window::EventMouseButtonDown, 
+			CEGUI::Event::Subscriber(&ShadowsListener::handleMouseButtonDown, shadowListener));
+		wnd->subscribeEvent(CEGUI::Window::EventMouseWheel, 
+			CEGUI::Event::Subscriber(&ShadowsListener::handleMouseWheelEvent, shadowListener));
+		wnd->subscribeEvent(CEGUI::Window::EventKeyDown, 
+			CEGUI::Event::Subscriber(&ShadowsListener::handleKeyDownEvent, shadowListener ));
+		wnd->subscribeEvent(CEGUI::Window::EventKeyUp, 
+			CEGUI::Event::Subscriber(&ShadowsListener::handleKeyUpEvent, shadowListener ));
+
+
+    }
+
+
+public:
+    void go(void)
+    {
+        if (!setup())
+            return;
+
+        mRoot->startRendering();
+    }
+
+
+};
+
+
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char *argv[])
+#endif
+{
+    // Create application object
+    ShadowsApplication app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " <<
+            e.getFullDescription().c_str() << std::endl;
+#endif
+    }
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/SkeletalAnimation/Makefile.am
===================================================================
--- /Samples/SkeletalAnimation/Makefile.am	(revision 5)
+++ /Samples/SkeletalAnimation/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/SkeletalAnimation/Makefile.in
===================================================================
--- /Samples/SkeletalAnimation/Makefile.in	(revision 5)
+++ /Samples/SkeletalAnimation/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/SkeletalAnimation
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/SkeletalAnimation/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/SkeletalAnimation/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/SkeletalAnimation/bin/Debug/.keepme
===================================================================
--- /Samples/SkeletalAnimation/bin/Debug/.keepme	(revision 5)
+++ /Samples/SkeletalAnimation/bin/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkeletalAnimation/bin/Release/.keepme
===================================================================
--- /Samples/SkeletalAnimation/bin/Release/.keepme	(revision 5)
+++ /Samples/SkeletalAnimation/bin/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkeletalAnimation/include/Makefile.am
===================================================================
--- /Samples/SkeletalAnimation/include/Makefile.am	(revision 5)
+++ /Samples/SkeletalAnimation/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = SkeletalAnimation.h
Index: /Samples/SkeletalAnimation/include/Makefile.in
===================================================================
--- /Samples/SkeletalAnimation/include/Makefile.in	(revision 5)
+++ /Samples/SkeletalAnimation/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/SkeletalAnimation/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = SkeletalAnimation.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/SkeletalAnimation/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/SkeletalAnimation/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/SkeletalAnimation/include/SkeletalAnimation.h
===================================================================
--- /Samples/SkeletalAnimation/include/SkeletalAnimation.h	(revision 5)
+++ /Samples/SkeletalAnimation/include/SkeletalAnimation.h	(revision 5)
@@ -0,0 +1,235 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+/*
+-----------------------------------------------------------------------------
+Filename:    SkeletalAnimation.h
+Description: Specialisation of OGRE's framework application to show the
+             skeletal animation feature, including spline animation.
+-----------------------------------------------------------------------------
+*/
+
+
+#include "ExampleApplication.h"
+
+#define NUM_JAIQUAS 6
+AnimationState* mAnimState[NUM_JAIQUAS];
+Real mAnimationSpeed[NUM_JAIQUAS];
+Vector3 mSneakStartOffset;
+Vector3 mSneakEndOffset;
+
+Quaternion mOrientations[NUM_JAIQUAS];
+Vector3 mBasePositions[NUM_JAIQUAS];
+SceneNode* mSceneNode[NUM_JAIQUAS];
+Degree mAnimationRotation(-60);
+Real mAnimChop = 7.96666f;
+Real mAnimChopBlend = 0.3f;
+
+// Event handler to animate
+class SkeletalAnimationFrameListener : public ExampleFrameListener
+{
+protected:
+public:
+	SkeletalAnimationFrameListener(RenderWindow* win, Camera* cam, const std::string &debugText)
+        : ExampleFrameListener(win, cam)
+    {
+		mDebugText = debugText;
+    }
+
+    bool frameStarted(const FrameEvent& evt)
+    {
+	if( ExampleFrameListener::frameStarted(evt) == false )
+		return false;
+
+        for (int i = 0; i < NUM_JAIQUAS; ++i)
+        {
+			Real inc = evt.timeSinceLastFrame * mAnimationSpeed[i]; 
+			if ((mAnimState[i]->getTimePosition() + inc) >= mAnimChop)
+			{
+				// Loop
+				// Need to reposition the scene node origin since animation includes translation
+				// Calculate as an offset to the end position, rotated by the
+				// amount the animation turns the character
+				Quaternion rot(mAnimationRotation, Vector3::UNIT_Y);
+				Vector3 startoffset = mSceneNode[i]->getOrientation() * -mSneakStartOffset;
+				Vector3 endoffset = mSneakEndOffset;
+				Vector3 offset = rot * startoffset;
+				Vector3 currEnd = mSceneNode[i]->getOrientation() * endoffset + mSceneNode[i]->getPosition();
+				mSceneNode[i]->setPosition(currEnd + offset);
+				mSceneNode[i]->rotate(rot);
+
+				mAnimState[i]->setTimePosition((mAnimState[i]->getTimePosition() + inc) - mAnimChop);
+			}
+			else
+			{
+				mAnimState[i]->addTime(inc);
+			}
+        }
+
+        return true;
+    }
+};
+
+
+
+class SkeletalApplication : public ExampleApplication
+{
+public:
+    SkeletalApplication() {}
+
+protected:
+	std::string mDebugText;
+
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+		mSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_MODULATIVE);
+		mSceneMgr->setShadowTextureSize(512);
+		mSceneMgr->setShadowColour(ColourValue(0.6, 0.6, 0.6));
+
+        // Setup animation default
+        Animation::setDefaultInterpolationMode(Animation::IM_LINEAR);
+        Animation::setDefaultRotationInterpolationMode(Animation::RIM_LINEAR);
+
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+		// The jaiqua sneak animation doesn't loop properly, so lets hack it so it does
+		// We want to copy the initial keyframes of all bones, but alter the Spineroot
+		// to give it an offset of where the animation ends
+		SkeletonPtr skel = SkeletonManager::getSingleton().load("jaiqua.skeleton", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Animation* anim = skel->getAnimation("Sneak");
+		Animation::NodeTrackIterator trackIter = anim->getNodeTrackIterator();
+		while (trackIter.hasMoreElements())
+		{
+			NodeAnimationTrack* track = trackIter.getNext();
+
+			TransformKeyFrame oldKf(0, 0);
+			track->getInterpolatedKeyFrame(mAnimChop, &oldKf);
+
+			// Drop all keyframes after the chop
+			while (track->getKeyFrame(track->getNumKeyFrames()-1)->getTime() >= mAnimChop - mAnimChopBlend)
+				track->removeKeyFrame(track->getNumKeyFrames()-1);
+
+			TransformKeyFrame* newKf = track->createNodeKeyFrame(mAnimChop);
+			TransformKeyFrame* startKf = track->getNodeKeyFrame(0);
+
+			Bone* bone = skel->getBone(track->getHandle());
+			if (bone->getName() == "Spineroot")
+			{
+				mSneakStartOffset = startKf->getTranslate() + bone->getInitialPosition();
+				mSneakEndOffset = oldKf.getTranslate() + bone->getInitialPosition();
+				mSneakStartOffset.y = mSneakEndOffset.y;
+				// Adjust spine root relative to new location
+				newKf->setRotation(oldKf.getRotation());
+				newKf->setTranslate(oldKf.getTranslate());
+				newKf->setScale(oldKf.getScale());
+
+
+			}
+			else
+			{
+				newKf->setRotation(startKf->getRotation());
+				newKf->setTranslate(startKf->getTranslate());
+				newKf->setScale(startKf->getScale());
+			}
+		}
+
+
+
+
+        Entity *ent;
+		Real rotInc = Math::TWO_PI / (float)NUM_JAIQUAS;
+		Real rot = 0.0f;
+        for (int i = 0; i < NUM_JAIQUAS; ++i)
+        {
+			Quaternion q;
+			q.FromAngleAxis(Radian(rot), Vector3::UNIT_Y);
+
+			mOrientations[i] = q;
+			mBasePositions[i] = q * Vector3(0,0,-20);
+
+            ent = mSceneMgr->createEntity("jaiqua" + StringConverter::toString(i), "jaiqua.mesh");
+            // Add entity to the scene node
+			mSceneNode[i] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+			mSceneNode[i]->attachObject(ent);
+			mSceneNode[i]->rotate(q);
+			mSceneNode[i]->translate(mBasePositions[i]);
+			
+            mAnimState[i] = ent->getAnimationState("Sneak");
+            mAnimState[i]->setEnabled(true);
+			mAnimState[i]->setLoop(false); // manual loop since translation involved
+            mAnimationSpeed[i] = Math::RangeRandom(0.5, 1.5);
+
+			rot += rotInc;
+        }
+
+
+
+        // Give it a little ambience with lights
+        Light* l;
+        l = mSceneMgr->createLight("BlueLight");
+		l->setType(Light::LT_SPOTLIGHT);
+        l->setPosition(-200,150,-100);
+		Vector3 dir(-l->getPosition());
+		dir.normalise();
+		l->setDirection(dir);
+        l->setDiffuseColour(0.5, 0.5, 1.0);
+
+        l = mSceneMgr->createLight("GreenLight");
+		l->setType(Light::LT_SPOTLIGHT);
+        l->setPosition(0,150,-100);
+		dir = -l->getPosition();
+		dir.normalise();
+		l->setDirection(dir);
+        l->setDiffuseColour(0.5, 1.0, 0.5);
+
+        // Position the camera
+        mCamera->setPosition(100,20,0);
+        mCamera->lookAt(0,10,0);
+
+        // Report whether hardware skinning is enabled or not
+        Technique* t = ent->getSubEntity(0)->getMaterial()->getBestTechnique();
+        Pass* p = t->getPass(0);
+        if (p->hasVertexProgram() && p->getVertexProgram()->isSkeletalAnimationIncluded())
+            mDebugText = "Hardware skinning is enabled";
+        else
+            mDebugText = "Software skinning is enabled";
+
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 100;
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			1500,1500,20,20,true,1,60,60,Vector3::UNIT_Z);
+		Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("Examples/Rockwall");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(0,99,0))->attachObject(pPlaneEnt);
+
+
+
+
+    }
+
+    // Create new frame listener
+    void createFrameListener(void)
+    {
+        mFrameListener= new SkeletalAnimationFrameListener(mWindow, mCamera, mDebugText);
+        mRoot->addFrameListener(mFrameListener);
+    }
+
+
+};
+
Index: /Samples/SkeletalAnimation/misc/.keepme
===================================================================
--- /Samples/SkeletalAnimation/misc/.keepme	(revision 5)
+++ /Samples/SkeletalAnimation/misc/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkeletalAnimation/obj/Debug/.keepme
===================================================================
--- /Samples/SkeletalAnimation/obj/Debug/.keepme	(revision 5)
+++ /Samples/SkeletalAnimation/obj/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkeletalAnimation/obj/Release/.keepme
===================================================================
--- /Samples/SkeletalAnimation/obj/Release/.keepme	(revision 5)
+++ /Samples/SkeletalAnimation/obj/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation.cbp
===================================================================
--- /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation.cbp	(revision 5)
+++ /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation.cbp	(revision 5)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_SkeletalAnimation" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_SkeletalAnimation.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_SkeletalAnimation.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\SkeletalAnimation.h" />
+		<Unit filename="..\src\SkeletalAnimation.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation.vcproj
===================================================================
--- /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation.vcproj	(revision 5)
+++ /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation.vcproj	(revision 5)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_SkeletalAnimation"
+	ProjectGUID="{43E76713-7E47-4AB0-A2FE-F4296B5C3EF8}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_SkeletalAnimation.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_SkeletalAnimation.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_SkeletalAnimation.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\SkeletalAnimation.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\SkeletalAnimation.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation_linux.cbp
===================================================================
--- /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation_linux.cbp	(revision 5)
+++ /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation_linux.cbp	(revision 5)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_SkeletalAnimation" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_SkeletalAnimation" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_SkeletalAnimation" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/SkeletalAnimation.h" />
+		<Unit filename="../src/SkeletalAnimation.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation_stlp.cbp
===================================================================
--- /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation_stlp.cbp	(revision 5)
+++ /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation_stlp.cbp	(revision 5)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_SkeletalAnimation" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_SkeletalAnimation.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_SkeletalAnimation.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\SkeletalAnimation.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\SkeletalAnimation.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation_vc8.vcproj
===================================================================
--- /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation_vc8.vcproj	(revision 5)
+++ /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation_vc8.vcproj	(revision 5)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_SkeletalAnimation"
+	ProjectGUID="{43E76713-7E47-4AB0-A2FE-F4296B5C3EF8}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_SkeletalAnimation.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_SkeletalAnimation.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_SkeletalAnimation.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\SkeletalAnimation.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\SkeletalAnimation.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation_vc8.vcproj.user
===================================================================
--- /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation_vc8.vcproj.user	(revision 5)
+++ /Samples/SkeletalAnimation/scripts/Demo_SkeletalAnimation_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/SkeletalAnimation/src/Makefile.am
===================================================================
--- /Samples/SkeletalAnimation/src/Makefile.am	(revision 5)
+++ /Samples/SkeletalAnimation/src/Makefile.am	(revision 5)
@@ -0,0 +1,7 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/SkeletalAnimation/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = SkeletalAnimation
+
+SkeletalAnimation_SOURCES = SkeletalAnimation.cpp
+SkeletalAnimation_LDFLAGS = -L$(top_builddir)/OgreMain/src
+SkeletalAnimation_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/SkeletalAnimation/src/Makefile.in
===================================================================
--- /Samples/SkeletalAnimation/src/Makefile.in	(revision 5)
+++ /Samples/SkeletalAnimation/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = SkeletalAnimation$(EXEEXT)
+subdir = Samples/SkeletalAnimation/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_SkeletalAnimation_OBJECTS = SkeletalAnimation.$(OBJEXT)
+SkeletalAnimation_OBJECTS = $(am_SkeletalAnimation_OBJECTS)
+am__DEPENDENCIES_1 =
+SkeletalAnimation_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(SkeletalAnimation_SOURCES)
+DIST_SOURCES = $(SkeletalAnimation_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/SkeletalAnimation/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+SkeletalAnimation_SOURCES = SkeletalAnimation.cpp
+SkeletalAnimation_LDFLAGS = -L$(top_builddir)/OgreMain/src
+SkeletalAnimation_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/SkeletalAnimation/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/SkeletalAnimation/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+SkeletalAnimation$(EXEEXT): $(SkeletalAnimation_OBJECTS) $(SkeletalAnimation_DEPENDENCIES) 
+	@rm -f SkeletalAnimation$(EXEEXT)
+	$(CXXLINK) $(SkeletalAnimation_LDFLAGS) $(SkeletalAnimation_OBJECTS) $(SkeletalAnimation_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SkeletalAnimation.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/SkeletalAnimation/src/SkeletalAnimation.cpp
===================================================================
--- /Samples/SkeletalAnimation/src/SkeletalAnimation.cpp	(revision 5)
+++ /Samples/SkeletalAnimation/src/SkeletalAnimation.cpp	(revision 5)
@@ -0,0 +1,51 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+#include "SkeletalAnimation.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+    // Create application object
+    SkeletalApplication app;
+
+    try {
+        app.go();
+    } catch( Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/SkyBox/Makefile.am
===================================================================
--- /Samples/SkyBox/Makefile.am	(revision 5)
+++ /Samples/SkyBox/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/SkyBox/Makefile.in
===================================================================
--- /Samples/SkyBox/Makefile.in	(revision 5)
+++ /Samples/SkyBox/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/SkyBox
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/SkyBox/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/SkyBox/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/SkyBox/bin/Debug/.keepme
===================================================================
--- /Samples/SkyBox/bin/Debug/.keepme	(revision 5)
+++ /Samples/SkyBox/bin/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkyBox/bin/Release/.keepme
===================================================================
--- /Samples/SkyBox/bin/Release/.keepme	(revision 5)
+++ /Samples/SkyBox/bin/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkyBox/include/Makefile.am
===================================================================
--- /Samples/SkyBox/include/Makefile.am	(revision 5)
+++ /Samples/SkyBox/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = SkyBox.h
Index: /Samples/SkyBox/include/Makefile.in
===================================================================
--- /Samples/SkyBox/include/Makefile.in	(revision 5)
+++ /Samples/SkyBox/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/SkyBox/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = SkyBox.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/SkyBox/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/SkyBox/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/SkyBox/include/SkyBox.h
===================================================================
--- /Samples/SkyBox/include/SkyBox.h	(revision 5)
+++ /Samples/SkyBox/include/SkyBox.h	(revision 5)
@@ -0,0 +1,146 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        SkyBox.h
+    \brief
+        Specialisation of OGRE's framework application to show the
+        skybox feature where a wrap-around environment is projected
+        onto a cube around the camera.
+*/
+
+#include "ExampleApplication.h"
+
+ParticleSystem *pThrusters;
+
+class SkyBoxFrameListener : public ExampleFrameListener
+{
+private:
+    static float fDefDim;
+    static float fDefVel;
+
+public:
+    SkyBoxFrameListener(RenderWindow* win, Camera* cam) : ExampleFrameListener( win, cam )
+    {
+    }
+
+    bool frameStarted( const FrameEvent& evt )
+    {
+        if( ExampleFrameListener::frameStarted( evt ) == false )
+		return false;
+
+        if( mKeyboard->isKeyDown( OIS::KC_N ) )
+        {
+            pThrusters->setDefaultDimensions( fDefDim + 0.25, fDefDim + 0.25 );
+            fDefDim += 0.25;
+        }
+
+        if( mKeyboard->isKeyDown( OIS::KC_M ) )
+        {
+            pThrusters->setDefaultDimensions( fDefDim - 0.25, fDefDim - 0.25 );
+            fDefDim -= 0.25;
+        }
+
+        if( mKeyboard->isKeyDown( OIS::KC_H ) )
+        {
+            pThrusters->getEmitter( 0 )->setParticleVelocity( fDefVel + 1 );
+            pThrusters->getEmitter( 1 )->setParticleVelocity( fDefVel + 1 );
+            fDefVel += 1;            
+        }
+
+        if( mKeyboard->isKeyDown( OIS::KC_J ) && !( fDefVel < 0.0f ) )
+        {
+            pThrusters->getEmitter( 0 )->setParticleVelocity( fDefVel - 1 );
+            pThrusters->getEmitter( 1 )->setParticleVelocity( fDefVel - 1 );
+            fDefVel -= 1;            
+        }
+
+        return true;
+    }
+};
+
+float SkyBoxFrameListener::fDefDim = 25.0f;
+float SkyBoxFrameListener::fDefVel = 50.0f;
+
+class SkyBoxApplication : public ExampleApplication
+{
+public:
+    SkyBoxApplication() {}
+
+protected:
+    virtual void createFrameListener(void)
+    {
+        mFrameListener= new SkyBoxFrameListener(mWindow, mCamera);
+        mRoot->addFrameListener(mFrameListener);
+    }
+
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a skybox
+        mSceneMgr->setSkyBox(true, "Examples/SpaceSkyBox", 50 );
+
+        // Create a light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        l->setPosition(20,80,50);
+
+        // Also add a nice starship in
+        Entity *ent = mSceneMgr->createEntity( "razor", "razor.mesh" );
+
+        mSceneMgr->getRootSceneNode()->attachObject( ent );
+
+        pThrusters = mSceneMgr->createParticleSystem( "ParticleSys1", 200 );
+
+        pThrusters ->setMaterialName( "Examples/Flare" );
+        pThrusters ->setDefaultDimensions( 25, 25 );
+
+        ParticleEmitter *pEmit1 = pThrusters ->addEmitter( "Point" );
+        ParticleEmitter *pEmit2 = pThrusters ->addEmitter( "Point" );
+
+        // Thruster 1
+        pEmit1->setAngle( Degree(3) );
+        pEmit1->setTimeToLive( 0.2 );
+        pEmit1->setEmissionRate( 70 );
+
+        pEmit1->setParticleVelocity( 50 );
+
+        pEmit1->setDirection(- Vector3::UNIT_Z);
+        pEmit1->setColour( ColourValue::White, ColourValue::Red);        
+
+        // Thruster 2
+        pEmit2->setAngle( Degree(3) );
+        pEmit2->setTimeToLive( 0.2 );
+        pEmit2->setEmissionRate( 70 );
+
+        pEmit2->setParticleVelocity( 50 );
+
+        pEmit2->setDirection( -Vector3::UNIT_Z );
+        pEmit2->setColour( ColourValue::White, ColourValue::Red );
+
+        // Set the position of the thrusters
+        pEmit1->setPosition( Vector3( 5.7f, 0.0f, 0.0f ) );
+        pEmit2->setPosition( Vector3( -18.0f, 0.0f, 0.0f ) );
+
+        mSceneMgr->getRootSceneNode()->createChildSceneNode( Vector3( 0.0f, 6.5f, -67.0f ) )
+            ->attachObject(pThrusters);
+    }
+
+};
Index: /Samples/SkyBox/misc/.keepme
===================================================================
--- /Samples/SkyBox/misc/.keepme	(revision 5)
+++ /Samples/SkyBox/misc/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkyBox/obj/Debug/.keepme
===================================================================
--- /Samples/SkyBox/obj/Debug/.keepme	(revision 5)
+++ /Samples/SkyBox/obj/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkyBox/obj/Release/.keepme
===================================================================
--- /Samples/SkyBox/obj/Release/.keepme	(revision 5)
+++ /Samples/SkyBox/obj/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkyBox/scripts/Demo_SkyBox.cbp
===================================================================
--- /Samples/SkyBox/scripts/Demo_SkyBox.cbp	(revision 5)
+++ /Samples/SkyBox/scripts/Demo_SkyBox.cbp	(revision 5)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_SkyBox" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_SkyBox.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_SkyBox.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\SkyBox.h" />
+		<Unit filename="..\src\SkyBox.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/SkyBox/scripts/Demo_SkyBox.vcproj
===================================================================
--- /Samples/SkyBox/scripts/Demo_SkyBox.vcproj	(revision 5)
+++ /Samples/SkyBox/scripts/Demo_SkyBox.vcproj	(revision 5)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_SkyBox"
+	ProjectGUID="{BC7E19F4-4B5D-4549-B473-E234011B6719}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_SkyBox.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_SkyBox.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_SkyBox.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\SkyBox.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\SkyBox.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/SkyBox/scripts/Demo_SkyBox_linux.cbp
===================================================================
--- /Samples/SkyBox/scripts/Demo_SkyBox_linux.cbp	(revision 5)
+++ /Samples/SkyBox/scripts/Demo_SkyBox_linux.cbp	(revision 5)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_SkyBox" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_SkyBox" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_SkyBox" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/SkyBox.h" />
+		<Unit filename="../src/SkyBox.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/SkyBox/scripts/Demo_SkyBox_stlp.cbp
===================================================================
--- /Samples/SkyBox/scripts/Demo_SkyBox_stlp.cbp	(revision 5)
+++ /Samples/SkyBox/scripts/Demo_SkyBox_stlp.cbp	(revision 5)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_SkyBox" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_SkyBox.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_SkyBox.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\SkyBox.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\SkyBox.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/SkyBox/scripts/Demo_SkyBox_vc8.vcproj
===================================================================
--- /Samples/SkyBox/scripts/Demo_SkyBox_vc8.vcproj	(revision 5)
+++ /Samples/SkyBox/scripts/Demo_SkyBox_vc8.vcproj	(revision 5)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_SkyBox"
+	ProjectGUID="{BC7E19F4-4B5D-4549-B473-E234011B6719}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_SkyBox.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_SkyBox.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_SkyBox.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\SkyBox.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\SkyBox.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/SkyBox/scripts/Demo_SkyBox_vc8.vcproj.user
===================================================================
--- /Samples/SkyBox/scripts/Demo_SkyBox_vc8.vcproj.user	(revision 5)
+++ /Samples/SkyBox/scripts/Demo_SkyBox_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/SkyBox/src/Makefile.am
===================================================================
--- /Samples/SkyBox/src/Makefile.am	(revision 5)
+++ /Samples/SkyBox/src/Makefile.am	(revision 5)
@@ -0,0 +1,6 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/SkyBox/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = SkyBox
+SkyBox_SOURCES = SkyBox.cpp
+SkyBox_LDFLAGS = -L$(top_builddir)/OgreMain/src
+SkyBox_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/SkyBox/src/Makefile.in
===================================================================
--- /Samples/SkyBox/src/Makefile.in	(revision 5)
+++ /Samples/SkyBox/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = SkyBox$(EXEEXT)
+subdir = Samples/SkyBox/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_SkyBox_OBJECTS = SkyBox.$(OBJEXT)
+SkyBox_OBJECTS = $(am_SkyBox_OBJECTS)
+am__DEPENDENCIES_1 =
+SkyBox_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(SkyBox_SOURCES)
+DIST_SOURCES = $(SkyBox_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/SkyBox/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+SkyBox_SOURCES = SkyBox.cpp
+SkyBox_LDFLAGS = -L$(top_builddir)/OgreMain/src
+SkyBox_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/SkyBox/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/SkyBox/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+SkyBox$(EXEEXT): $(SkyBox_OBJECTS) $(SkyBox_DEPENDENCIES) 
+	@rm -f SkyBox$(EXEEXT)
+	$(CXXLINK) $(SkyBox_LDFLAGS) $(SkyBox_OBJECTS) $(SkyBox_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SkyBox.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/SkyBox/src/SkyBox.cpp
===================================================================
--- /Samples/SkyBox/src/SkyBox.cpp	(revision 5)
+++ /Samples/SkyBox/src/SkyBox.cpp	(revision 5)
@@ -0,0 +1,59 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        SkyBox.cpp
+    \brief
+        Shows OGRE's skybox feature where a wrap-around environment is projected
+        onto a cube around the camera.
+*/
+
+#include "SkyBox.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char *argv[])
+#endif
+{
+    // Create application object
+    SkyBoxApplication app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " <<
+            e.getFullDescription().c_str() << std::endl;
+#endif
+    }
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/SkyDome/Makefile.am
===================================================================
--- /Samples/SkyDome/Makefile.am	(revision 5)
+++ /Samples/SkyDome/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/SkyDome/Makefile.in
===================================================================
--- /Samples/SkyDome/Makefile.in	(revision 5)
+++ /Samples/SkyDome/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/SkyDome
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/SkyDome/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/SkyDome/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/SkyDome/bin/Debug/.keepme
===================================================================
--- /Samples/SkyDome/bin/Debug/.keepme	(revision 5)
+++ /Samples/SkyDome/bin/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkyDome/bin/Release/.keepme
===================================================================
--- /Samples/SkyDome/bin/Release/.keepme	(revision 5)
+++ /Samples/SkyDome/bin/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkyDome/include/Makefile.am
===================================================================
--- /Samples/SkyDome/include/Makefile.am	(revision 5)
+++ /Samples/SkyDome/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = SkyDome.h
Index: /Samples/SkyDome/include/Makefile.in
===================================================================
--- /Samples/SkyDome/include/Makefile.in	(revision 5)
+++ /Samples/SkyDome/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/SkyDome/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = SkyDome.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/SkyDome/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/SkyDome/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/SkyDome/include/SkyDome.h
===================================================================
--- /Samples/SkyDome/include/SkyDome.h	(revision 5)
+++ /Samples/SkyDome/include/SkyDome.h	(revision 5)
@@ -0,0 +1,153 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        SkyDome.h
+    \brief
+        Specialisation of OGRE's framework application to show the
+        skydome feature
+*/
+
+
+#include "ExampleApplication.h"
+
+// Event handler to add ability to alter curvature
+class SkyDomeFrameListener : public ExampleFrameListener
+{
+protected:
+    Real mCurvature;
+    Real mTiling;
+    SceneManager* mSceneMgr;
+public:
+    SkyDomeFrameListener(RenderWindow* win, Camera* cam, SceneManager* mgr)
+        : ExampleFrameListener(win, cam)
+    {
+        mSceneMgr = mgr;
+        mCurvature = 1;
+        mTiling = 15;
+
+    }
+
+    bool frameStarted(const FrameEvent& evt)
+    {
+        // Change curvature / tiling
+        // Delay timer to stop too quick updates of curvature
+        static Real timeDelay = 0;
+
+        bool updateSky;
+        updateSky = false;
+        
+        if(!ExampleFrameListener::frameStarted(evt))
+            return false;
+        
+        if (mKeyboard->isKeyDown(OIS::KC_H) && timeDelay <= 0)
+        {
+            mCurvature += 1;
+            timeDelay = 0.1;
+            updateSky = true;
+        }
+        if (mKeyboard->isKeyDown(OIS::KC_G) && timeDelay <= 0)
+        {
+            mCurvature -= 1;
+            timeDelay = 0.1;
+            updateSky = true;
+        }
+
+        if (mKeyboard->isKeyDown(OIS::KC_U) && timeDelay <= 0)
+        {
+            mTiling += 1;
+            timeDelay = 0.1;
+            updateSky = true;
+        }
+        if (mKeyboard->isKeyDown(OIS::KC_Y) && timeDelay <= 0)
+        {
+            mTiling -= 1;
+            timeDelay = 0.1;
+            updateSky = true;
+        }
+
+        if (timeDelay > 0)
+            timeDelay -= evt.timeSinceLastFrame;
+
+        if (updateSky)
+        {
+            mSceneMgr->setSkyDome(true, "Examples/CloudySky", mCurvature, mTiling);
+        }
+
+        return true;
+
+    }
+};
+
+class SkyDomeApplication : public ExampleApplication
+{
+public:
+    SkyDomeApplication()
+    {
+    }
+
+protected:
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a skydome
+        mSceneMgr->setSkyDome(true, "Examples/CloudySky", 5, 8);
+
+        // Create a light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        l->setPosition(20,80,50);
+
+        Entity *ent;
+
+        // Define a floor plane mesh
+        Plane p;
+        p.normal = Vector3::UNIT_Y;
+        p.d = 200;
+        MeshManager::getSingleton().createPlane("FloorPlane",
+            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+            p,2000,2000,1,1,true,1,5,5,Vector3::UNIT_Z);
+
+        // Create an entity (the floor)
+        ent = mSceneMgr->createEntity("floor", "FloorPlane");
+        ent->setMaterialName("Examples/RustySteel");
+
+        mSceneMgr->getRootSceneNode()->attachObject(ent);
+
+        ent = mSceneMgr->createEntity("head", "ogrehead.mesh");
+        // Attach to child of root node, better for culling (otherwise bounds are the combination of the 2)
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+
+    }
+    // Create new frame listener
+    void createFrameListener(void)
+    {
+        mFrameListener= new SkyDomeFrameListener(mWindow, mCamera, mSceneMgr);
+        mRoot->addFrameListener(mFrameListener);
+    }
+
+
+    bool setup()
+    {
+        ExampleApplication::setup();
+        LogManager::getSingleton().setLogDetail( LL_BOREME );
+        return true;
+    }
+};
Index: /Samples/SkyDome/misc/.keepme
===================================================================
--- /Samples/SkyDome/misc/.keepme	(revision 5)
+++ /Samples/SkyDome/misc/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkyDome/obj/Debug/.keepme
===================================================================
--- /Samples/SkyDome/obj/Debug/.keepme	(revision 5)
+++ /Samples/SkyDome/obj/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkyDome/obj/Release/.keepme
===================================================================
--- /Samples/SkyDome/obj/Release/.keepme	(revision 5)
+++ /Samples/SkyDome/obj/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkyDome/scripts/Demo_SkyDome.cbp
===================================================================
--- /Samples/SkyDome/scripts/Demo_SkyDome.cbp	(revision 5)
+++ /Samples/SkyDome/scripts/Demo_SkyDome.cbp	(revision 5)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_SkyDome" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_SkyDome.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_SkyDome.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\SkyDome.h" />
+		<Unit filename="..\src\SkyDome.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/SkyDome/scripts/Demo_SkyDome.vcproj
===================================================================
--- /Samples/SkyDome/scripts/Demo_SkyDome.vcproj	(revision 5)
+++ /Samples/SkyDome/scripts/Demo_SkyDome.vcproj	(revision 5)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_SkyDome"
+	ProjectGUID="{C9AF3D1F-44A3-413A-B137-264C6D559CED}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_SkyDome.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_SkyDome.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_SkyDome.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\SkyDome.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\SkyDome.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/SkyDome/scripts/Demo_SkyDome_linux.cbp
===================================================================
--- /Samples/SkyDome/scripts/Demo_SkyDome_linux.cbp	(revision 5)
+++ /Samples/SkyDome/scripts/Demo_SkyDome_linux.cbp	(revision 5)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_SkyDome" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_SkyDome" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_SkyDome" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/SkyDome.h" />
+		<Unit filename="../src/SkyDome.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/SkyDome/scripts/Demo_SkyDome_stlp.cbp
===================================================================
--- /Samples/SkyDome/scripts/Demo_SkyDome_stlp.cbp	(revision 5)
+++ /Samples/SkyDome/scripts/Demo_SkyDome_stlp.cbp	(revision 5)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_SkyDome" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_SkyDome.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_SkyDome.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\SkyDome.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\SkyDome.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/SkyDome/scripts/Demo_SkyDome_vc8.vcproj
===================================================================
--- /Samples/SkyDome/scripts/Demo_SkyDome_vc8.vcproj	(revision 5)
+++ /Samples/SkyDome/scripts/Demo_SkyDome_vc8.vcproj	(revision 5)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_SkyDome"
+	ProjectGUID="{C9AF3D1F-44A3-413A-B137-264C6D559CED}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_SkyDome.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_SkyDome.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_SkyDome.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\SkyDome.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\SkyDome.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/SkyDome/scripts/Demo_SkyDome_vc8.vcproj.user
===================================================================
--- /Samples/SkyDome/scripts/Demo_SkyDome_vc8.vcproj.user	(revision 5)
+++ /Samples/SkyDome/scripts/Demo_SkyDome_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/SkyDome/src/Makefile.am
===================================================================
--- /Samples/SkyDome/src/Makefile.am	(revision 5)
+++ /Samples/SkyDome/src/Makefile.am	(revision 5)
@@ -0,0 +1,6 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/SkyDome/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = SkyDome
+SkyDome_SOURCES = SkyDome.cpp
+SkyDome_LDFLAGS = -L$(top_builddir)/OgreMain/src
+SkyDome_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/SkyDome/src/Makefile.in
===================================================================
--- /Samples/SkyDome/src/Makefile.in	(revision 5)
+++ /Samples/SkyDome/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = SkyDome$(EXEEXT)
+subdir = Samples/SkyDome/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_SkyDome_OBJECTS = SkyDome.$(OBJEXT)
+SkyDome_OBJECTS = $(am_SkyDome_OBJECTS)
+am__DEPENDENCIES_1 =
+SkyDome_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(SkyDome_SOURCES)
+DIST_SOURCES = $(SkyDome_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/SkyDome/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+SkyDome_SOURCES = SkyDome.cpp
+SkyDome_LDFLAGS = -L$(top_builddir)/OgreMain/src
+SkyDome_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/SkyDome/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/SkyDome/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+SkyDome$(EXEEXT): $(SkyDome_OBJECTS) $(SkyDome_DEPENDENCIES) 
+	@rm -f SkyDome$(EXEEXT)
+	$(CXXLINK) $(SkyDome_LDFLAGS) $(SkyDome_OBJECTS) $(SkyDome_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SkyDome.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/SkyDome/src/SkyDome.cpp
===================================================================
--- /Samples/SkyDome/src/SkyDome.cpp	(revision 5)
+++ /Samples/SkyDome/src/SkyDome.cpp	(revision 5)
@@ -0,0 +1,60 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        SkyDome.cpp
+    \brief
+        Show's Ogre's skydome feature
+*/
+
+#include "SkyDome.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char *argv[])
+#endif
+{
+
+    // Create application object
+    SkyDomeApplication app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " <<
+            e.getFullDescription().c_str() << std::endl;
+#endif
+    }
+
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/SkyPlane/Makefile.am
===================================================================
--- /Samples/SkyPlane/Makefile.am	(revision 5)
+++ /Samples/SkyPlane/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/SkyPlane/Makefile.in
===================================================================
--- /Samples/SkyPlane/Makefile.in	(revision 5)
+++ /Samples/SkyPlane/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/SkyPlane
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/SkyPlane/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/SkyPlane/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/SkyPlane/bin/Debug/.keepme
===================================================================
--- /Samples/SkyPlane/bin/Debug/.keepme	(revision 5)
+++ /Samples/SkyPlane/bin/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkyPlane/bin/Release/.keepme
===================================================================
--- /Samples/SkyPlane/bin/Release/.keepme	(revision 5)
+++ /Samples/SkyPlane/bin/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkyPlane/include/Makefile.am
===================================================================
--- /Samples/SkyPlane/include/Makefile.am	(revision 5)
+++ /Samples/SkyPlane/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = SkyPlane.h
Index: /Samples/SkyPlane/include/Makefile.in
===================================================================
--- /Samples/SkyPlane/include/Makefile.in	(revision 5)
+++ /Samples/SkyPlane/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/SkyPlane/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = SkyPlane.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/SkyPlane/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/SkyPlane/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/SkyPlane/include/SkyPlane.h
===================================================================
--- /Samples/SkyPlane/include/SkyPlane.h	(revision 5)
+++ /Samples/SkyPlane/include/SkyPlane.h	(revision 5)
@@ -0,0 +1,62 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        SkyPlane.h
+    \brief
+        Specialisation of OGRE's framework application to show the
+        skyplane feature where a fixed constant-distance
+        skyplane is displayed in the background.
+*/
+
+#include "ExampleApplication.h"
+
+class SkyPlaneApplication : public ExampleApplication
+{
+public:
+    SkyPlaneApplication() {}
+
+protected:
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Define the required skyplane
+        Plane plane;
+        // 5000 world units from the camera
+        plane.d = 5000;
+        // Above the camera, facing down
+        plane.normal = -Vector3::UNIT_Y;
+        // Create the plane 10000 units wide, tile the texture 3 times
+        mSceneMgr->setSkyPlane(true, plane, "Examples/SpaceSkyPlane",10000,3);
+
+        // Create a light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        l->setPosition(20,80,50);
+
+        // Also add a nice dragon in
+        Entity *ent = mSceneMgr->createEntity("dragon", "dragon.mesh");
+        mSceneMgr->getRootSceneNode()->attachObject(ent);
+
+
+
+    }
+
+};
Index: /Samples/SkyPlane/misc/.keepme
===================================================================
--- /Samples/SkyPlane/misc/.keepme	(revision 5)
+++ /Samples/SkyPlane/misc/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkyPlane/obj/Debug/.keepme
===================================================================
--- /Samples/SkyPlane/obj/Debug/.keepme	(revision 5)
+++ /Samples/SkyPlane/obj/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkyPlane/obj/Release/.keepme
===================================================================
--- /Samples/SkyPlane/obj/Release/.keepme	(revision 5)
+++ /Samples/SkyPlane/obj/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/SkyPlane/scripts/Demo_SkyPlane.cbp
===================================================================
--- /Samples/SkyPlane/scripts/Demo_SkyPlane.cbp	(revision 5)
+++ /Samples/SkyPlane/scripts/Demo_SkyPlane.cbp	(revision 5)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_SkyPlane" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_SkyPlane.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_SkyPlane.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\SkyPlane.h" />
+		<Unit filename="..\src\SkyPlane.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/SkyPlane/scripts/Demo_SkyPlane.vcproj
===================================================================
--- /Samples/SkyPlane/scripts/Demo_SkyPlane.vcproj	(revision 5)
+++ /Samples/SkyPlane/scripts/Demo_SkyPlane.vcproj	(revision 5)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_SkyPlane"
+	ProjectGUID="{2EF34790-42A6-4722-925A-8255120A90E3}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_SkyPlane.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_SkyPlane.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_SkyPlane.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\SkyPlane.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\SkyPlane.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/SkyPlane/scripts/Demo_SkyPlane_linux.cbp
===================================================================
--- /Samples/SkyPlane/scripts/Demo_SkyPlane_linux.cbp	(revision 5)
+++ /Samples/SkyPlane/scripts/Demo_SkyPlane_linux.cbp	(revision 5)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_SkyPlane" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_SkyPlane" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_SkyPlane" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/SkyPlane.h" />
+		<Unit filename="../src/SkyPlane.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/SkyPlane/scripts/Demo_SkyPlane_stlp.cbp
===================================================================
--- /Samples/SkyPlane/scripts/Demo_SkyPlane_stlp.cbp	(revision 5)
+++ /Samples/SkyPlane/scripts/Demo_SkyPlane_stlp.cbp	(revision 5)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_SkyPlane" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_SkyPlane.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_SkyPlane.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\SkyPlane.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\SkyPlane.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/SkyPlane/scripts/Demo_SkyPlane_vc8.vcproj
===================================================================
--- /Samples/SkyPlane/scripts/Demo_SkyPlane_vc8.vcproj	(revision 5)
+++ /Samples/SkyPlane/scripts/Demo_SkyPlane_vc8.vcproj	(revision 5)
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_SkyPlane"
+	ProjectGUID="{2EF34790-42A6-4722-925A-8255120A90E3}"
+	RootNamespace="Demo_SkyPlane"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_SkyPlane.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_SkyPlane.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_SkyPlane.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\SkyPlane.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\SkyPlane.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/SkyPlane/scripts/Demo_SkyPlane_vc8.vcproj.user
===================================================================
--- /Samples/SkyPlane/scripts/Demo_SkyPlane_vc8.vcproj.user	(revision 5)
+++ /Samples/SkyPlane/scripts/Demo_SkyPlane_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/SkyPlane/src/Makefile.am
===================================================================
--- /Samples/SkyPlane/src/Makefile.am	(revision 5)
+++ /Samples/SkyPlane/src/Makefile.am	(revision 5)
@@ -0,0 +1,6 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/SkyPlane/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = SkyPlane
+SkyPlane_SOURCES = SkyPlane.cpp
+SkyPlane_LDFLAGS = -L$(top_builddir)/OgreMain/src
+SkyPlane_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/SkyPlane/src/Makefile.in
===================================================================
--- /Samples/SkyPlane/src/Makefile.in	(revision 5)
+++ /Samples/SkyPlane/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = SkyPlane$(EXEEXT)
+subdir = Samples/SkyPlane/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_SkyPlane_OBJECTS = SkyPlane.$(OBJEXT)
+SkyPlane_OBJECTS = $(am_SkyPlane_OBJECTS)
+am__DEPENDENCIES_1 =
+SkyPlane_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(SkyPlane_SOURCES)
+DIST_SOURCES = $(SkyPlane_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/SkyPlane/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+SkyPlane_SOURCES = SkyPlane.cpp
+SkyPlane_LDFLAGS = -L$(top_builddir)/OgreMain/src
+SkyPlane_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/SkyPlane/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/SkyPlane/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+SkyPlane$(EXEEXT): $(SkyPlane_OBJECTS) $(SkyPlane_DEPENDENCIES) 
+	@rm -f SkyPlane$(EXEEXT)
+	$(CXXLINK) $(SkyPlane_LDFLAGS) $(SkyPlane_OBJECTS) $(SkyPlane_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SkyPlane.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/SkyPlane/src/SkyPlane.cpp
===================================================================
--- /Samples/SkyPlane/src/SkyPlane.cpp	(revision 5)
+++ /Samples/SkyPlane/src/SkyPlane.cpp	(revision 5)
@@ -0,0 +1,59 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        SkyPlane.cpp
+    \brief
+        Shows OGRE's skyplane feature where a fixed constant-distance
+        skyplane is displayed in the background.
+*/
+
+#include "SkyPlane.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char *argv[])
+#endif
+{
+    // Create application object
+    SkyPlaneApplication app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL );
+#else
+        std::cerr << "An exception has occured: " <<
+            e.getFullDescription().c_str() << std::endl;
+#endif
+    }
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/Smoke/Makefile.am
===================================================================
--- /Samples/Smoke/Makefile.am	(revision 5)
+++ /Samples/Smoke/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/Smoke/Makefile.in
===================================================================
--- /Samples/Smoke/Makefile.in	(revision 5)
+++ /Samples/Smoke/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Smoke
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Smoke/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Smoke/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Smoke/include/Makefile.am
===================================================================
--- /Samples/Smoke/include/Makefile.am	(revision 5)
+++ /Samples/Smoke/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = Smoke.h
Index: /Samples/Smoke/include/Makefile.in
===================================================================
--- /Samples/Smoke/include/Makefile.in	(revision 5)
+++ /Samples/Smoke/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Smoke/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = Smoke.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Smoke/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Smoke/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Smoke/include/Smoke.h
===================================================================
--- /Samples/Smoke/include/Smoke.h	(revision 5)
+++ /Samples/Smoke/include/Smoke.h	(revision 5)
@@ -0,0 +1,91 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+/*
+-----------------------------------------------------------------------------
+Filename:    ParticleApplication.cpp
+Description: Specialisation of OGRE's framework application to show the
+             environment mapping feature.
+-----------------------------------------------------------------------------
+*/
+
+
+#include "ExampleApplication.h"
+
+
+// Event handler to add ability to alter curvature
+class ParticleFrameListener : public ExampleFrameListener
+{
+protected:
+    SceneNode* mFountainNode;
+public:
+    ParticleFrameListener(RenderWindow* win, Camera* cam, SceneNode* fountainNode)
+        : ExampleFrameListener(win, cam)
+    {
+        mFountainNode = fountainNode;
+    }
+
+    bool frameStarted(const FrameEvent& evt)
+    {
+
+        // Rotate fountains
+//        mFountainNode->yaw(evt.timeSinceLastFrame * 30);
+
+        // Call default
+        return ExampleFrameListener::frameStarted(evt);
+
+    }
+};
+
+
+
+class ParticleApplication : public ExampleApplication
+{
+public:
+    ParticleApplication() {}
+
+protected:
+    SceneNode* mFountainNode;
+
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a skydome
+        mSceneMgr->setSkyDome(true, "Examples/CloudySky", 5, 8);
+
+       
+        // Create shared node for 2 fountains
+        mFountainNode = static_cast<SceneNode*>(mSceneMgr->getRootSceneNode()->createChild());
+
+        // smoke
+        ParticleSystem* pSys2 = mSceneMgr->createParticleSystem("fountain1", 
+            "Examples/Smoke");
+        // Point the fountain at an angle
+        SceneNode* fNode = static_cast<SceneNode*>(mFountainNode->createChild());
+        fNode->attachObject(pSys2);
+
+    }
+
+    // Create new frame listener
+    void createFrameListener(void)
+    {
+        mFrameListener= new ParticleFrameListener(mWindow, mCamera, mFountainNode);
+        mRoot->addFrameListener(mFrameListener);
+    }
+
+
+};
+
Index: /Samples/Smoke/scripts/Demo_Smoke.cbp
===================================================================
--- /Samples/Smoke/scripts/Demo_Smoke.cbp	(revision 5)
+++ /Samples/Smoke/scripts/Demo_Smoke.cbp	(revision 5)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Smoke" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Smoke.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Smoke.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\Smoke.h" />
+		<Unit filename="..\src\Smoke.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Smoke/scripts/Demo_Smoke.vcproj
===================================================================
--- /Samples/Smoke/scripts/Demo_Smoke.vcproj	(revision 5)
+++ /Samples/Smoke/scripts/Demo_Smoke.vcproj	(revision 5)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_Smoke"
+	ProjectGUID="{86B4ED07-3D95-45C3-B387-512046E95C68}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_Smoke.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_Smoke.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_Smoke.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\Smoke.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\Smoke.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Smoke/scripts/Demo_Smoke_linux.cbp
===================================================================
--- /Samples/Smoke/scripts/Demo_Smoke_linux.cbp	(revision 5)
+++ /Samples/Smoke/scripts/Demo_Smoke_linux.cbp	(revision 5)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Smoke" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_Smoke" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_Smoke" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/Smoke.h" />
+		<Unit filename="../src/Smoke.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Smoke/scripts/Demo_Smoke_stlp.cbp
===================================================================
--- /Samples/Smoke/scripts/Demo_Smoke_stlp.cbp	(revision 5)
+++ /Samples/Smoke/scripts/Demo_Smoke_stlp.cbp	(revision 5)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_Smoke" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Smoke.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Smoke.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\Smoke.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\Smoke.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Smoke/scripts/Demo_Smoke_vc8.vcproj
===================================================================
--- /Samples/Smoke/scripts/Demo_Smoke_vc8.vcproj	(revision 5)
+++ /Samples/Smoke/scripts/Demo_Smoke_vc8.vcproj	(revision 5)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_Smoke"
+	ProjectGUID="{86B4ED07-3D95-45C3-B387-512046E95C68}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_Smoke.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_Smoke.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_Smoke.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\Smoke.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\Smoke.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Smoke/scripts/Demo_Smoke_vc8.vcproj.user
===================================================================
--- /Samples/Smoke/scripts/Demo_Smoke_vc8.vcproj.user	(revision 5)
+++ /Samples/Smoke/scripts/Demo_Smoke_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/Smoke/src/Makefile.am
===================================================================
--- /Samples/Smoke/src/Makefile.am	(revision 5)
+++ /Samples/Smoke/src/Makefile.am	(revision 5)
@@ -0,0 +1,7 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Smoke/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = Smoke
+
+Smoke_SOURCES = Smoke.cpp
+Smoke_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Smoke_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/Smoke/src/Makefile.in
===================================================================
--- /Samples/Smoke/src/Makefile.in	(revision 5)
+++ /Samples/Smoke/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = Smoke$(EXEEXT)
+subdir = Samples/Smoke/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_Smoke_OBJECTS = Smoke.$(OBJEXT)
+Smoke_OBJECTS = $(am_Smoke_OBJECTS)
+am__DEPENDENCIES_1 =
+Smoke_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Smoke_SOURCES)
+DIST_SOURCES = $(Smoke_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Smoke/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+Smoke_SOURCES = Smoke.cpp
+Smoke_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Smoke_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Smoke/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Smoke/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+Smoke$(EXEEXT): $(Smoke_OBJECTS) $(Smoke_DEPENDENCIES) 
+	@rm -f Smoke$(EXEEXT)
+	$(CXXLINK) $(Smoke_LDFLAGS) $(Smoke_OBJECTS) $(Smoke_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Smoke.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Smoke/src/Smoke.cpp
===================================================================
--- /Samples/Smoke/src/Smoke.cpp	(revision 5)
+++ /Samples/Smoke/src/Smoke.cpp	(revision 5)
@@ -0,0 +1,58 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+/*
+-----------------------------------------------------------------------------
+Filename:    envmap.cpp
+Description: Shows OGRE's environment mapping feature as well as the
+             blending modes available when using multiple texture layers
+-----------------------------------------------------------------------------
+*/
+
+#include "Smoke.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+    // Create application object
+    ParticleApplication app;
+
+    try {
+        app.go();
+    } catch( Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/Terrain/Makefile.am
===================================================================
--- /Samples/Terrain/Makefile.am	(revision 5)
+++ /Samples/Terrain/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = include src
Index: /Samples/Terrain/Makefile.in
===================================================================
--- /Samples/Terrain/Makefile.in	(revision 5)
+++ /Samples/Terrain/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Terrain
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = include src
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Terrain/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Terrain/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Terrain/bin/Debug/.keepme
===================================================================
--- /Samples/Terrain/bin/Debug/.keepme	(revision 5)
+++ /Samples/Terrain/bin/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Terrain/bin/Release/.keepme
===================================================================
--- /Samples/Terrain/bin/Release/.keepme	(revision 5)
+++ /Samples/Terrain/bin/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Terrain/include/Makefile.am
===================================================================
--- /Samples/Terrain/include/Makefile.am	(revision 5)
+++ /Samples/Terrain/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = Terrain.h
Index: /Samples/Terrain/include/Makefile.in
===================================================================
--- /Samples/Terrain/include/Makefile.in	(revision 5)
+++ /Samples/Terrain/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Terrain/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = Terrain.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Terrain/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Terrain/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Terrain/include/Terrain.h
===================================================================
--- /Samples/Terrain/include/Terrain.h	(revision 5)
+++ /Samples/Terrain/include/Terrain.h	(revision 5)
@@ -0,0 +1,153 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        Terrain.h
+    \brief
+        Specialisation of OGRE's framework application to show the
+        terrain rendering plugin 
+*/
+
+#include "ExampleApplication.h"
+
+RaySceneQuery* raySceneQuery = 0;
+
+// Event handler to add ability to alter curvature
+class TerrainFrameListener : public ExampleFrameListener
+{
+public:
+    TerrainFrameListener(RenderWindow* win, Camera* cam)
+        : ExampleFrameListener(win, cam)
+    {
+        // Reduce move speed
+        mMoveSpeed = 50;
+
+    }
+
+    bool frameStarted(const FrameEvent& evt)
+    {
+        if( ExampleFrameListener::frameStarted(evt) == false )
+		return false;
+
+        // clamp to terrain
+        static Ray updateRay;
+        updateRay.setOrigin(mCamera->getPosition());
+        updateRay.setDirection(Vector3::NEGATIVE_UNIT_Y);
+        raySceneQuery->setRay(updateRay);
+        RaySceneQueryResult& qryResult = raySceneQuery->execute();
+        RaySceneQueryResult::iterator i = qryResult.begin();
+        if (i != qryResult.end() && i->worldFragment)
+        {
+            mCamera->setPosition(mCamera->getPosition().x, 
+                i->worldFragment->singleIntersection.y + 10, 
+                mCamera->getPosition().z);
+        }
+
+        return true;
+
+    }
+
+};
+
+
+
+class TerrainApplication : public ExampleApplication
+{
+public:
+    TerrainApplication() {}
+
+    ~TerrainApplication()
+    {
+        delete raySceneQuery;
+    }
+
+protected:
+
+
+    virtual void chooseSceneManager(void)
+    {
+        // Get the SceneManager, in this case a generic one
+        mSceneMgr = mRoot->createSceneManager("TerrainSceneManager");
+    }
+
+    virtual void createCamera(void)
+    {
+        // Create the camera
+        mCamera = mSceneMgr->createCamera("PlayerCam");
+
+        // Position it at 500 in Z direction
+        mCamera->setPosition(Vector3(128,25,128));
+        // Look back along -Z
+        mCamera->lookAt(Vector3(0,0,-300));
+        mCamera->setNearClipDistance( 1 );
+        mCamera->setFarClipDistance( 1000 );
+
+    }
+   
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+        Plane waterPlane;
+
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        l->setPosition(20,80,50);
+
+        // Fog
+        // NB it's VERY important to set this before calling setWorldGeometry 
+        // because the vertex program picked will be different
+        ColourValue fadeColour(0.93, 0.86, 0.76);
+        mSceneMgr->setFog( FOG_LINEAR, fadeColour, .001, 500, 1000);
+        mWindow->getViewport(0)->setBackgroundColour(fadeColour);
+
+        std::string terrain_cfg("terrain.cfg");
+        mSceneMgr -> setWorldGeometry( terrain_cfg );
+        // Infinite far plane?
+        if (mRoot->getRenderSystem()->getCapabilities()->hasCapability(RSC_INFINITE_FAR_PLANE))
+        {
+            mCamera->setFarClipDistance(0);
+        }
+
+        // Define the required skyplane
+        Plane plane;
+        // 5000 world units from the camera
+        plane.d = 5000;
+        // Above the camera, facing down
+        plane.normal = -Vector3::UNIT_Y;
+
+        // Set a nice viewpoint
+        mCamera->setPosition(707,2500,528);
+        mCamera->setOrientation(Quaternion(-0.3486, 0.0122, 0.9365, 0.0329));
+        //mRoot -> showDebugOverlay( true );
+
+        raySceneQuery = mSceneMgr->createRayQuery(
+            Ray(mCamera->getPosition(), Vector3::NEGATIVE_UNIT_Y));
+
+
+    }
+    // Create new frame listener
+    void createFrameListener(void)
+    {
+        mFrameListener= new TerrainFrameListener(mWindow, mCamera);
+        mRoot->addFrameListener(mFrameListener);
+    }
+
+};
Index: /Samples/Terrain/misc/.keepme
===================================================================
--- /Samples/Terrain/misc/.keepme	(revision 5)
+++ /Samples/Terrain/misc/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Terrain/obj/Debug/.keepme
===================================================================
--- /Samples/Terrain/obj/Debug/.keepme	(revision 5)
+++ /Samples/Terrain/obj/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Terrain/obj/Release/.keepme
===================================================================
--- /Samples/Terrain/obj/Release/.keepme	(revision 5)
+++ /Samples/Terrain/obj/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Terrain/scripts/Demo_Terrain.cbp
===================================================================
--- /Samples/Terrain/scripts/Demo_Terrain.cbp	(revision 5)
+++ /Samples/Terrain/scripts/Demo_Terrain.cbp	(revision 5)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Terrain" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Terrain.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Terrain.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\Terrain.h" />
+		<Unit filename="..\src\Terrain.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Terrain/scripts/Demo_Terrain.vcproj
===================================================================
--- /Samples/Terrain/scripts/Demo_Terrain.vcproj	(revision 5)
+++ /Samples/Terrain/scripts/Demo_Terrain.vcproj	(revision 5)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_Terrain"
+	ProjectGUID="{1BB416AA-358A-4B4B-B565-14CE1BF9D4FD}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_Terrain.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_Terrain.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_Terrain.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\Terrain.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\Terrain.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Terrain/scripts/Demo_Terrain_linux.cbp
===================================================================
--- /Samples/Terrain/scripts/Demo_Terrain_linux.cbp	(revision 5)
+++ /Samples/Terrain/scripts/Demo_Terrain_linux.cbp	(revision 5)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Terrain" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_Terrain" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_Terrain" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/Terrain.h" />
+		<Unit filename="../src/Terrain.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Terrain/scripts/Demo_Terrain_stlp.cbp
===================================================================
--- /Samples/Terrain/scripts/Demo_Terrain_stlp.cbp	(revision 5)
+++ /Samples/Terrain/scripts/Demo_Terrain_stlp.cbp	(revision 5)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_Terrain" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Terrain.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Terrain.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\Terrain.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\Terrain.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Terrain/scripts/Demo_Terrain_vc8.vcproj
===================================================================
--- /Samples/Terrain/scripts/Demo_Terrain_vc8.vcproj	(revision 5)
+++ /Samples/Terrain/scripts/Demo_Terrain_vc8.vcproj	(revision 5)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_Terrain"
+	ProjectGUID="{1BB416AA-358A-4B4B-B565-14CE1BF9D4FD}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_Terrain.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_Terrain.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_Terrain.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\Terrain.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\Terrain.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Terrain/scripts/Demo_Terrain_vc8.vcproj.user
===================================================================
--- /Samples/Terrain/scripts/Demo_Terrain_vc8.vcproj.user	(revision 5)
+++ /Samples/Terrain/scripts/Demo_Terrain_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/Terrain/src/Makefile.am
===================================================================
--- /Samples/Terrain/src/Makefile.am	(revision 5)
+++ /Samples/Terrain/src/Makefile.am	(revision 5)
@@ -0,0 +1,6 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Terrain/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = Terrain 
+Terrain_SOURCES = Terrain.cpp
+Terrain_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Terrain_LDADD = -lOgreMain -lpthread $(OIS_LIBS)
Index: /Samples/Terrain/src/Makefile.in
===================================================================
--- /Samples/Terrain/src/Makefile.in	(revision 5)
+++ /Samples/Terrain/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = Terrain$(EXEEXT)
+subdir = Samples/Terrain/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_Terrain_OBJECTS = Terrain.$(OBJEXT)
+Terrain_OBJECTS = $(am_Terrain_OBJECTS)
+am__DEPENDENCIES_1 =
+Terrain_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Terrain_SOURCES)
+DIST_SOURCES = $(Terrain_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Terrain/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+Terrain_SOURCES = Terrain.cpp
+Terrain_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Terrain_LDADD = -lOgreMain -lpthread $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Terrain/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Terrain/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+Terrain$(EXEEXT): $(Terrain_OBJECTS) $(Terrain_DEPENDENCIES) 
+	@rm -f Terrain$(EXEEXT)
+	$(CXXLINK) $(Terrain_LDFLAGS) $(Terrain_OBJECTS) $(Terrain_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Terrain.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Terrain/src/Terrain.cpp
===================================================================
--- /Samples/Terrain/src/Terrain.cpp	(revision 5)
+++ /Samples/Terrain/src/Terrain.cpp	(revision 5)
@@ -0,0 +1,58 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    @file 
+        Terrain.cpp
+    @brief
+        Shows OGRE's terrain rendering plugin.
+*/
+
+#include "Terrain.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char *argv[])
+#endif
+{
+    // Create application object
+    TerrainApplication app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " <<
+            e.getFullDescription().c_str() << std::endl;
+#endif
+    }
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/TextureFX/Makefile.am
===================================================================
--- /Samples/TextureFX/Makefile.am	(revision 5)
+++ /Samples/TextureFX/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/TextureFX/Makefile.in
===================================================================
--- /Samples/TextureFX/Makefile.in	(revision 5)
+++ /Samples/TextureFX/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/TextureFX
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/TextureFX/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/TextureFX/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/TextureFX/bin/Debug/.keepme
===================================================================
--- /Samples/TextureFX/bin/Debug/.keepme	(revision 5)
+++ /Samples/TextureFX/bin/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/TextureFX/bin/Release/.keepme
===================================================================
--- /Samples/TextureFX/bin/Release/.keepme	(revision 5)
+++ /Samples/TextureFX/bin/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/TextureFX/include/Makefile.am
===================================================================
--- /Samples/TextureFX/include/Makefile.am	(revision 5)
+++ /Samples/TextureFX/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = TextureFX.h
Index: /Samples/TextureFX/include/Makefile.in
===================================================================
--- /Samples/TextureFX/include/Makefile.in	(revision 5)
+++ /Samples/TextureFX/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/TextureFX/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = TextureFX.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/TextureFX/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/TextureFX/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/TextureFX/include/TextureFX.h
===================================================================
--- /Samples/TextureFX/include/TextureFX.h	(revision 5)
+++ /Samples/TextureFX/include/TextureFX.h	(revision 5)
@@ -0,0 +1,112 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        TextureFX.h
+    \brief
+        Shows OGRE's ability to handle different types of texture effects.
+*/
+
+
+#include "ExampleApplication.h"
+
+class TextureEffectsApplication : public ExampleApplication
+{
+public:
+    TextureEffectsApplication() {}
+
+protected:
+
+    void createScalingPlane()
+    {
+        // Set up a material for the plane
+
+        // Create a prefab plane
+        Entity *planeEnt = mSceneMgr->createEntity("Plane", SceneManager::PT_PLANE);
+        // Give the plane a texture
+        planeEnt->setMaterialName("Examples/TextureEffect1");
+
+        SceneNode* node = 
+            mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(-250,-40,-100));
+
+        node->attachObject(planeEnt);
+    }
+
+    void createScrollingKnot()
+    {
+        Entity *ent = mSceneMgr->createEntity("knot", "knot.mesh");
+
+
+        ent->setMaterialName("Examples/TextureEffect2");
+        // Add entity to the root scene node
+        SceneNode* node = 
+            mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(200,50,150));
+
+        node->attachObject(ent);
+
+    }
+
+    void createWateryPlane()
+    {
+        // Create a prefab plane
+        Entity *planeEnt = mSceneMgr->createEntity("WaterPlane", SceneManager::PT_PLANE);
+        // Give the plane a texture
+        planeEnt->setMaterialName("Examples/TextureEffect3");
+
+        mSceneMgr->getRootSceneNode()->attachObject(planeEnt);
+    }
+
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        l->setPosition(20,80,50);
+
+
+        createScalingPlane();
+        createScrollingKnot();
+        createWateryPlane();
+
+
+        // Set up a material for the skydome
+        MaterialPtr skyMat = MaterialManager::getSingleton().create("SkyMat",
+            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+        // Perform no dynamic lighting on the sky
+        skyMat->setLightingEnabled(false);
+        // Use a cloudy sky
+        TextureUnitState* t = skyMat->getTechnique(0)->getPass(0)->createTextureUnitState("clouds.jpg");
+        // Scroll the clouds
+        t->setScrollAnimation(0.15, 0);
+
+        // System will automatically set no depth write
+
+        // Create a skydome
+        mSceneMgr->setSkyDome(true, "SkyMat", -5, 2);
+
+
+
+
+
+    }
+
+};
Index: /Samples/TextureFX/misc/.keepme
===================================================================
--- /Samples/TextureFX/misc/.keepme	(revision 5)
+++ /Samples/TextureFX/misc/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/TextureFX/obj/Debug/.keepme
===================================================================
--- /Samples/TextureFX/obj/Debug/.keepme	(revision 5)
+++ /Samples/TextureFX/obj/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/TextureFX/obj/Release/.keepme
===================================================================
--- /Samples/TextureFX/obj/Release/.keepme	(revision 5)
+++ /Samples/TextureFX/obj/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/TextureFX/scripts/Demo_TextureFX.cbp
===================================================================
--- /Samples/TextureFX/scripts/Demo_TextureFX.cbp	(revision 5)
+++ /Samples/TextureFX/scripts/Demo_TextureFX.cbp	(revision 5)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_TextureFX" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_TextureFX.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_TextureFX.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\TextureFX.h" />
+		<Unit filename="..\src\TextureFX.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/TextureFX/scripts/Demo_TextureFX.vcproj
===================================================================
--- /Samples/TextureFX/scripts/Demo_TextureFX.vcproj	(revision 5)
+++ /Samples/TextureFX/scripts/Demo_TextureFX.vcproj	(revision 5)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_TextureFX"
+	ProjectGUID="{4C359709-9A70-4ED8-9071-8BCF1BCD83E7}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_TextureFX.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_TextureFX.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_TextureFX.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\TextureFX.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\TextureFX.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/TextureFX/scripts/Demo_TextureFX_linux.cbp
===================================================================
--- /Samples/TextureFX/scripts/Demo_TextureFX_linux.cbp	(revision 5)
+++ /Samples/TextureFX/scripts/Demo_TextureFX_linux.cbp	(revision 5)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_TextureFX" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_TextureFX" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_TextureFX" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/TextureFX.h" />
+		<Unit filename="../src/TextureFX.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/TextureFX/scripts/Demo_TextureFX_stlp.cbp
===================================================================
--- /Samples/TextureFX/scripts/Demo_TextureFX_stlp.cbp	(revision 5)
+++ /Samples/TextureFX/scripts/Demo_TextureFX_stlp.cbp	(revision 5)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_TextureFX" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_TextureFX.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_TextureFX.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\TextureFX.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\TextureFX.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/TextureFX/scripts/Demo_TextureFX_vc8.vcproj
===================================================================
--- /Samples/TextureFX/scripts/Demo_TextureFX_vc8.vcproj	(revision 5)
+++ /Samples/TextureFX/scripts/Demo_TextureFX_vc8.vcproj	(revision 5)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_TextureFX"
+	ProjectGUID="{4C359709-9A70-4ED8-9071-8BCF1BCD83E7}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_TextureFX.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_TextureFX.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_TextureFX.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\TextureFX.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\TextureFX.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/TextureFX/scripts/Demo_TextureFX_vc8.vcproj.user
===================================================================
--- /Samples/TextureFX/scripts/Demo_TextureFX_vc8.vcproj.user	(revision 5)
+++ /Samples/TextureFX/scripts/Demo_TextureFX_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/TextureFX/src/Makefile.am
===================================================================
--- /Samples/TextureFX/src/Makefile.am	(revision 5)
+++ /Samples/TextureFX/src/Makefile.am	(revision 5)
@@ -0,0 +1,6 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/TextureFX/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = TextureFX
+TextureFX_SOURCES = TextureFX.cpp
+TextureFX_LDFLAGS = -L$(top_builddir)/OgreMain/src
+TextureFX_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/TextureFX/src/Makefile.in
===================================================================
--- /Samples/TextureFX/src/Makefile.in	(revision 5)
+++ /Samples/TextureFX/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = TextureFX$(EXEEXT)
+subdir = Samples/TextureFX/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_TextureFX_OBJECTS = TextureFX.$(OBJEXT)
+TextureFX_OBJECTS = $(am_TextureFX_OBJECTS)
+am__DEPENDENCIES_1 =
+TextureFX_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(TextureFX_SOURCES)
+DIST_SOURCES = $(TextureFX_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/TextureFX/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+TextureFX_SOURCES = TextureFX.cpp
+TextureFX_LDFLAGS = -L$(top_builddir)/OgreMain/src
+TextureFX_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/TextureFX/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/TextureFX/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+TextureFX$(EXEEXT): $(TextureFX_OBJECTS) $(TextureFX_DEPENDENCIES) 
+	@rm -f TextureFX$(EXEEXT)
+	$(CXXLINK) $(TextureFX_LDFLAGS) $(TextureFX_OBJECTS) $(TextureFX_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TextureFX.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/TextureFX/src/TextureFX.cpp
===================================================================
--- /Samples/TextureFX/src/TextureFX.cpp	(revision 5)
+++ /Samples/TextureFX/src/TextureFX.cpp	(revision 5)
@@ -0,0 +1,59 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        TextureFX.cpp
+    \brief
+        Shows OGRE's ability to handle different types of texture effects.
+*/
+
+#include "TextureFX.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+
+    // Create application object
+    TextureEffectsApplication app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/Transpacency/Makefile.am
===================================================================
--- /Samples/Transpacency/Makefile.am	(revision 5)
+++ /Samples/Transpacency/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/Transpacency/Makefile.in
===================================================================
--- /Samples/Transpacency/Makefile.in	(revision 5)
+++ /Samples/Transpacency/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Transpacency
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Transpacency/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Transpacency/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Transpacency/bin/Debug/.keepme
===================================================================
--- /Samples/Transpacency/bin/Debug/.keepme	(revision 5)
+++ /Samples/Transpacency/bin/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Transpacency/bin/Release/.keepme
===================================================================
--- /Samples/Transpacency/bin/Release/.keepme	(revision 5)
+++ /Samples/Transpacency/bin/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Transpacency/include/Makefile.am
===================================================================
--- /Samples/Transpacency/include/Makefile.am	(revision 5)
+++ /Samples/Transpacency/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS = Transparency.h
Index: /Samples/Transpacency/include/Makefile.in
===================================================================
--- /Samples/Transpacency/include/Makefile.in	(revision 5)
+++ /Samples/Transpacency/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Transpacency/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = Transparency.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Transpacency/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Transpacency/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Transpacency/include/Transparency.h
===================================================================
--- /Samples/Transpacency/include/Transparency.h	(revision 5)
+++ /Samples/Transpacency/include/Transparency.h	(revision 5)
@@ -0,0 +1,90 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        Transparency.h
+    \brief
+        Specialisation of OGRE's framework application to show the transparency,
+        or scene blending features.
+    \par
+        Note that this is a little rudimentary - it's because whilst
+        OGRE supports lots of blending options, the SceneManager has
+        to ensure the rendering order is correct when object transparency
+        is enabled. Right now this is not quite right in the default
+        manager so this scene is kept deliberately simple.
+*/
+
+#include "ExampleApplication.h"
+
+class TransApplication : public ExampleApplication
+{
+public:
+    TransApplication() {}
+
+protected:
+
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        l->setPosition(20,80,50);
+
+
+        // Create a prefab plane
+        Entity *planeEnt = mSceneMgr->createEntity("Plane", SceneManager::PT_PLANE);
+        // Give the plane a texture
+        planeEnt->setMaterialName("Examples/BumpyMetal");
+
+        // Create an entity from a model (will be loaded automatically)
+        Entity* knotEnt = mSceneMgr->createEntity("Knot", "knot.mesh");
+
+        knotEnt->setMaterialName("Examples/TransparentTest");
+
+        // Attach the 2 new entities to the root of the scene
+        SceneNode* rootNode = mSceneMgr->getRootSceneNode();
+        rootNode->attachObject(planeEnt);
+        rootNode->attachObject(knotEnt);
+
+        // Add a whole bunch of extra transparent entities
+        Entity *cloneEnt;
+        for (int n = 0; n < 10; ++n)
+        {
+            // Create a new node under the root
+            SceneNode* node = mSceneMgr->createSceneNode();
+            // Random translate
+            Vector3 nodePos;
+            nodePos.x = Math::SymmetricRandom() * 500.0;
+            nodePos.y = Math::SymmetricRandom() * 500.0;
+            nodePos.z = Math::SymmetricRandom() * 500.0;
+            node->setPosition(nodePos);
+            rootNode->addChild(node);
+            // Clone knot
+            char cloneName[12];
+            sprintf(cloneName, "Knot%d", n);
+            cloneEnt = knotEnt->clone(cloneName);
+            // Attach to new node
+            node->attachObject(cloneEnt);
+
+        }
+    }
+
+};
Index: /Samples/Transpacency/misc/.keepme
===================================================================
--- /Samples/Transpacency/misc/.keepme	(revision 5)
+++ /Samples/Transpacency/misc/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Transpacency/obj/Debug/.keepme
===================================================================
--- /Samples/Transpacency/obj/Debug/.keepme	(revision 5)
+++ /Samples/Transpacency/obj/Debug/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Transpacency/obj/Release/.keepme
===================================================================
--- /Samples/Transpacency/obj/Release/.keepme	(revision 5)
+++ /Samples/Transpacency/obj/Release/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Samples/Transpacency/scripts/Demo_Transparency.cbp
===================================================================
--- /Samples/Transpacency/scripts/Demo_Transparency.cbp	(revision 5)
+++ /Samples/Transpacency/scripts/Demo_Transparency.cbp	(revision 5)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Transparency" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Transparency.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Transparency.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\Transparency.h" />
+		<Unit filename="..\src\Transparency.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Transpacency/scripts/Demo_Transparency.vcproj
===================================================================
--- /Samples/Transpacency/scripts/Demo_Transparency.vcproj	(revision 5)
+++ /Samples/Transpacency/scripts/Demo_Transparency.vcproj	(revision 5)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_Transparency"
+	ProjectGUID="{AB50ACAA-ADE7-4554-B56B-68991C41D29A}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_Transparency.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_Transparency.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_Transparency.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\Transparency.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\Transparency.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Transpacency/scripts/Demo_Transparency_linux.cbp
===================================================================
--- /Samples/Transpacency/scripts/Demo_Transparency_linux.cbp	(revision 5)
+++ /Samples/Transpacency/scripts/Demo_Transparency_linux.cbp	(revision 5)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Transparency" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_Transparency." prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_Transparency" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/Transparency.h" />
+		<Unit filename="../src/Transparency.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Transpacency/scripts/Demo_Transparency_stlp.cbp
===================================================================
--- /Samples/Transpacency/scripts/Demo_Transparency_stlp.cbp	(revision 5)
+++ /Samples/Transpacency/scripts/Demo_Transparency_stlp.cbp	(revision 5)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_Transparency" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Transparency.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Transparency.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\Transparency.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\Transparency.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Transpacency/scripts/Demo_Transparency_vc8.vcproj
===================================================================
--- /Samples/Transpacency/scripts/Demo_Transparency_vc8.vcproj	(revision 5)
+++ /Samples/Transpacency/scripts/Demo_Transparency_vc8.vcproj	(revision 5)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_Transparency"
+	ProjectGUID="{AB50ACAA-ADE7-4554-B56B-68991C41D29A}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_Transparency.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_Transparency.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_Transparency.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\Transparency.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\Transparency.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Transpacency/scripts/Demo_Transparency_vc8.vcproj.user
===================================================================
--- /Samples/Transpacency/scripts/Demo_Transparency_vc8.vcproj.user	(revision 5)
+++ /Samples/Transpacency/scripts/Demo_Transparency_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/Transpacency/src/Makefile.am
===================================================================
--- /Samples/Transpacency/src/Makefile.am	(revision 5)
+++ /Samples/Transpacency/src/Makefile.am	(revision 5)
@@ -0,0 +1,6 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Transpacency/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = Transparency
+Transparency_SOURCES = Transparency.cpp
+Transparency_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Transparency_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/Transpacency/src/Makefile.in
===================================================================
--- /Samples/Transpacency/src/Makefile.in	(revision 5)
+++ /Samples/Transpacency/src/Makefile.in	(revision 5)
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = Transparency$(EXEEXT)
+subdir = Samples/Transpacency/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_Transparency_OBJECTS = Transparency.$(OBJEXT)
+Transparency_OBJECTS = $(am_Transparency_OBJECTS)
+am__DEPENDENCIES_1 =
+Transparency_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Transparency_SOURCES)
+DIST_SOURCES = $(Transparency_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Transpacency/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+Transparency_SOURCES = Transparency.cpp
+Transparency_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Transparency_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Transpacency/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Transpacency/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+Transparency$(EXEEXT): $(Transparency_OBJECTS) $(Transparency_DEPENDENCIES) 
+	@rm -f Transparency$(EXEEXT)
+	$(CXXLINK) $(Transparency_LDFLAGS) $(Transparency_OBJECTS) $(Transparency_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Transparency.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Transpacency/src/Transparency.cpp
===================================================================
--- /Samples/Transpacency/src/Transparency.cpp	(revision 5)
+++ /Samples/Transpacency/src/Transparency.cpp	(revision 5)
@@ -0,0 +1,64 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+/**
+    \file 
+        Transparency.cpp
+    \brief
+        Shows OGRE's transparency, or scene blending features.
+    \par
+        Note that this is a little rudimentary - it's because whilst
+        OGRE supports lots of blending options, the SceneManager has
+        to ensure the rendering order is correct when object transparency
+        is enabled. Right now this is not quite right in the default
+        manager so this scene is kept deliberately simple.
+*/
+
+#include "Transparency.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char ** argv)
+#endif
+{
+
+    // Create application object
+    TransApplication app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/VolumeTex/Makefile.am
===================================================================
--- /Samples/VolumeTex/Makefile.am	(revision 5)
+++ /Samples/VolumeTex/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src include
Index: /Samples/VolumeTex/Makefile.in
===================================================================
--- /Samples/VolumeTex/Makefile.in	(revision 5)
+++ /Samples/VolumeTex/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/VolumeTex
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src include
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/VolumeTex/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/VolumeTex/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/VolumeTex/include/Julia.h
===================================================================
--- /Samples/VolumeTex/include/Julia.h	(revision 5)
+++ /Samples/VolumeTex/include/Julia.h	(revision 5)
@@ -0,0 +1,113 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+/* Original author: John C. Hare
+ * Date: June 26, 1996 (although I've had these around for at least 6 years)
+ * Adapted to C++ by W.J. van der Laan 2004
+ */
+#ifndef H_Q_Julia
+#define H_Q_Julia
+#include <cmath>
+
+/**
+ * Simple, fast, inline quaternion math functions
+ */
+struct Quat {
+        float r,i,j,k;
+};
+
+inline void qadd(Quat &a, const Quat &b)
+{
+        a.r += b.r;
+        a.i += b.i;
+        a.j += b.j;
+        a.k += b.k;
+}
+
+inline void qmult(Quat &c, const Quat &a, const Quat &b) 
+{
+        c.r = a.r*b.r - a.i*b.i - a.j*b.j - a.k*b.k;
+        c.i = a.r*b.i + a.i*b.r + a.j*b.k - a.k*b.j;
+        c.j = a.r*b.j + a.j*b.r + a.k*b.i - a.i*b.k;
+        c.k = a.r*b.k + a.k*b.r + a.i*b.j - a.j*b.i;
+}
+
+inline void qsqr(Quat &b, const Quat &a) 
+{
+        b.r = a.r*a.r - a.i*a.i - a.j*a.j - a.k*a.k;
+        b.i = 2.0f*a.r*a.i;
+        b.j = 2.0f*a.r*a.j;
+        b.k = 2.0f*a.r*a.k;
+}
+
+/**
+ * Implicit function that evaluates the Julia set.
+ */
+class Julia {
+private:
+	float global_real, global_imag, global_theta;
+	Quat oc,c,eio,emio;
+public:
+	Julia(float global_real, float global_imag, float global_theta);
+	inline float eval(float x, float y, float z) {
+		Quat q, temp;
+		int i;
+	
+		q.r = x;
+		q.i = y;
+		q.j = z;
+		q.k = 0.0;
+	
+		for (i = 30; i > 0; i--) {
+			qsqr(temp, q);
+			qmult(q, emio, temp);
+			qadd(q, c);
+	
+			if (q.r*q.r + q.i*q.i + q.j*q.j + q.k*q.k > 8.0)
+				break;
+		}
+	
+		return((float)i);
+	}
+};
+
+
+Julia::Julia(float global_real, float global_imag, float global_theta):
+		global_real(global_real), global_imag(global_imag), global_theta(global_theta)  {
+
+	oc.r = global_real;
+	oc.i = global_imag;
+	oc.j = oc.k = 0.0;
+
+	eio.r = cos(global_theta);
+	eio.i = sin(global_theta);
+	eio.j = 0.0;
+	eio.k = 0.0;
+
+	emio.r = cos(-global_theta);
+	emio.i = sin(-global_theta);
+	emio.j = 0.0;
+	emio.k = 0.0;
+
+	/***
+	 *** multiply eio*c only once at the beginning of iteration
+	 *** (since q |-> sqrt(eio*(q-eio*c)))
+	 *** q -> e-io*q^2 - eio*c
+	 ***/
+
+	qmult(c, eio,oc);
+
+}
+
+
+#endif
Index: /Samples/VolumeTex/include/Makefile.in
===================================================================
--- /Samples/VolumeTex/include/Makefile.in	(revision 5)
+++ /Samples/VolumeTex/include/Makefile.in	(revision 5)
@@ -0,0 +1,386 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/VolumeTex/include
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/VolumeTex/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/VolumeTex/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	distclean distclean-generic distclean-libtool distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-exec install-exec-am \
+	install-info install-info-am install-man install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/VolumeTex/include/ThingRenderable.h
===================================================================
--- /Samples/VolumeTex/include/ThingRenderable.h	(revision 5)
+++ /Samples/VolumeTex/include/ThingRenderable.h	(revision 5)
@@ -0,0 +1,59 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+#ifndef H_THINGRENDERABLE
+#define H_THINGRENDERABLE
+
+#include <OgrePrerequisites.h>
+#include <OgreSimpleRenderable.h>
+#include <OgreQuaternion.h>
+#include <OgreVector3.h>
+
+/** Quad fragments that rotate around origin (0,0,0) in a random orbit, always oriented to 0,0,0.
+	@author W.J. van der Laan
+*/
+class ThingRenderable: public Ogre::SimpleRenderable {
+public:
+	/** Create one this object.
+		@param radius	Radius of orbits
+		@param count	Number of quads
+		@param qsize	Size of quads
+	 */
+	ThingRenderable(float radius, size_t count, float qsize);
+	~ThingRenderable();
+	/**
+	 * Retrieves ratios of the origin-centered bounding sphere for this
+	 * object.
+	 */
+	Ogre::Real getBoundingRadius() const;
+	/**
+	 * Returns the camera-relative squared depth of this renderable.
+	 */
+	Ogre::Real getSquaredViewDepth(const Ogre::Camera*) const;
+	/**
+	 * Notify that t seconds have elapsed.
+	 */
+	void addTime(float t);
+protected:
+	void initialise();
+	void fillBuffer();
+
+	Ogre::HardwareVertexBufferSharedPtr vbuf;// Our vertex buffer
+	float mRadius;
+	size_t mCount;
+	float mQSize;
+	std::vector <Ogre::Quaternion> things;
+	std::vector <Ogre::Quaternion> orbits;
+};
+
+#endif
Index: /Samples/VolumeTex/include/VolumeRenderable.h
===================================================================
--- /Samples/VolumeTex/include/VolumeRenderable.h	(revision 5)
+++ /Samples/VolumeTex/include/VolumeRenderable.h	(revision 5)
@@ -0,0 +1,53 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+#ifndef OWL_VOLUMERENDERABLE
+#define OWL_VOLUMERENDERABLE
+#include <OgrePrerequisites.h>
+#include <OgreSimpleRenderable.h>
+
+/** Direct Volume Rendering.
+ 	TODO: LOD: reduce number of slices in distance
+ 	TODO: option to generate normals for lighting
+ 	@author W.J. van der Laan
+*/
+class VolumeRenderable: public Ogre::SimpleRenderable {
+public:
+	VolumeRenderable(size_t nSlices, float size, const Ogre::String & texture);
+	~VolumeRenderable();
+	
+	// Copydoc Ogre::SimpleRenderable::notifyCurrentCamera
+	void _notifyCurrentCamera( Ogre::Camera* cam );
+	void getWorldTransforms( Ogre::Matrix4* xform ) const;
+	
+	/**
+	 * Retrieves ratios of the origin-centered bounding sphere for this
+	 * object.
+	 */
+	Ogre::Real getBoundingRadius() const;
+	
+	/**
+	 * Returns the camera-relative squared depth of this renderable.
+	 */
+	Ogre::Real getSquaredViewDepth(const Ogre::Camera*) const;
+protected:
+	void initialise();
+
+	size_t mSlices;
+	float mSize;
+	float mRadius;
+	Ogre::Matrix3 mFakeOrientation;
+	Ogre::String mTexture;
+	Ogre::TextureUnitState *mUnit;
+};
+#endif
Index: /Samples/VolumeTex/scripts/Demo_VolumeTex.cbp
===================================================================
--- /Samples/VolumeTex/scripts/Demo_VolumeTex.cbp	(revision 5)
+++ /Samples/VolumeTex/scripts/Demo_VolumeTex.cbp	(revision 5)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_VolumeTex" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_VolumeTex.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_VolumeTex.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\Julia.h" />
+		<Unit filename="..\include\ThingRenderable.h" />
+		<Unit filename="..\include\VolumeRenderable.h" />
+		<Unit filename="..\src\ThingRenderable.cpp" />
+		<Unit filename="..\src\VolumeRenderable.cpp" />
+		<Unit filename="..\src\VolumeTex.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/VolumeTex/scripts/Demo_VolumeTex.vcproj
===================================================================
--- /Samples/VolumeTex/scripts/Demo_VolumeTex.vcproj	(revision 5)
+++ /Samples/VolumeTex/scripts/Demo_VolumeTex.vcproj	(revision 5)
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_VolumeTex"
+	ProjectGUID="{E779DB4B-06BE-4453-A4DA-87646D7F1505}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_VolumeTex.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_VolumeTex.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_VolumeTex.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\ThingRenderable.cpp">
+			</File>
+			<File
+				RelativePath="..\src\VolumeRenderable.cpp">
+			</File>
+			<File
+				RelativePath="..\src\VolumeTex.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\Julia.h">
+			</File>
+			<File
+				RelativePath="..\include\ThingRenderable.h">
+			</File>
+			<File
+				RelativePath="..\include\VolumeRenderable.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/VolumeTex/scripts/Demo_VolumeTex_linux.cbp
===================================================================
--- /Samples/VolumeTex/scripts/Demo_VolumeTex_linux.cbp	(revision 5)
+++ /Samples/VolumeTex/scripts/Demo_VolumeTex_linux.cbp	(revision 5)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_VolumeTex" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_VolumeTex" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_VolumeTex" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/Julia.h" />
+		<Unit filename="../include/ThingRenderable.h" />
+		<Unit filename="../include/VolumeRenderable.h" />
+		<Unit filename="../src/ThingRenderable.cpp" />
+		<Unit filename="../src/VolumeRenderable.cpp" />
+		<Unit filename="../src/VolumeTex.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/VolumeTex/scripts/Demo_VolumeTex_stlp.cbp
===================================================================
--- /Samples/VolumeTex/scripts/Demo_VolumeTex_stlp.cbp	(revision 5)
+++ /Samples/VolumeTex/scripts/Demo_VolumeTex_stlp.cbp	(revision 5)
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_VolumeTex" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_VolumeTex.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_VolumeTex.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\Julia.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\ThingRenderable.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\include\VolumeRenderable.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\ThingRenderable.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\VolumeRenderable.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\VolumeTex.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/VolumeTex/scripts/Demo_VolumeTex_vc8.vcproj
===================================================================
--- /Samples/VolumeTex/scripts/Demo_VolumeTex_vc8.vcproj	(revision 5)
+++ /Samples/VolumeTex/scripts/Demo_VolumeTex_vc8.vcproj	(revision 5)
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_VolumeTex"
+	ProjectGUID="{724B4906-44BE-49FB-B1C8-E02AAAC0780C}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_VolumeTex.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_VolumeTex.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_VolumeTex.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\ThingRenderable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\VolumeRenderable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\VolumeTex.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\Julia.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\ThingRenderable.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\VolumeRenderable.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/VolumeTex/scripts/Demo_VolumeTex_vc8.vcproj.user
===================================================================
--- /Samples/VolumeTex/scripts/Demo_VolumeTex_vc8.vcproj.user	(revision 5)
+++ /Samples/VolumeTex/scripts/Demo_VolumeTex_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/VolumeTex/src/Makefile.am
===================================================================
--- /Samples/VolumeTex/src/Makefile.am	(revision 5)
+++ /Samples/VolumeTex/src/Makefile.am	(revision 5)
@@ -0,0 +1,6 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/VolumeTex/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = VolumeTex
+VolumeTex_SOURCES = VolumeTex.cpp VolumeRenderable.cpp ThingRenderable.cpp
+VolumeTex_LDFLAGS = -L$(top_builddir)/OgreMain/src
+VolumeTex_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/VolumeTex/src/Makefile.in
===================================================================
--- /Samples/VolumeTex/src/Makefile.in	(revision 5)
+++ /Samples/VolumeTex/src/Makefile.in	(revision 5)
@@ -0,0 +1,529 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = VolumeTex$(EXEEXT)
+subdir = Samples/VolumeTex/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_VolumeTex_OBJECTS = VolumeTex.$(OBJEXT) VolumeRenderable.$(OBJEXT) \
+	ThingRenderable.$(OBJEXT)
+VolumeTex_OBJECTS = $(am_VolumeTex_OBJECTS)
+am__DEPENDENCIES_1 =
+VolumeTex_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(VolumeTex_SOURCES)
+DIST_SOURCES = $(VolumeTex_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/VolumeTex/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+VolumeTex_SOURCES = VolumeTex.cpp VolumeRenderable.cpp ThingRenderable.cpp
+VolumeTex_LDFLAGS = -L$(top_builddir)/OgreMain/src
+VolumeTex_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/VolumeTex/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/VolumeTex/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+VolumeTex$(EXEEXT): $(VolumeTex_OBJECTS) $(VolumeTex_DEPENDENCIES) 
+	@rm -f VolumeTex$(EXEEXT)
+	$(CXXLINK) $(VolumeTex_LDFLAGS) $(VolumeTex_OBJECTS) $(VolumeTex_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ThingRenderable.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VolumeRenderable.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VolumeTex.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/VolumeTex/src/ThingRenderable.cpp
===================================================================
--- /Samples/VolumeTex/src/ThingRenderable.cpp	(revision 5)
+++ /Samples/VolumeTex/src/ThingRenderable.cpp	(revision 5)
@@ -0,0 +1,185 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+#include "ThingRenderable.h"
+#include <OgreHardwareVertexBuffer.h>
+#include <OgreHardwareIndexBuffer.h>
+#include <OgreHardwareBufferManager.h>
+#include <OgreCamera.h>
+using namespace Ogre;
+
+ThingRenderable::ThingRenderable(float radius, size_t count, float qsize):
+	mRadius(radius),
+	mCount(count),
+	mQSize(qsize)
+{
+	mBox = Ogre::AxisAlignedBox(-radius, -radius, -radius, radius, radius, radius);
+	initialise();
+	fillBuffer();
+}
+ThingRenderable::~ThingRenderable()
+{
+    // need to release IndexData and vertexData created for renderable
+    delete mRenderOp.indexData;
+    delete mRenderOp.vertexData;
+}
+
+void ThingRenderable::addTime(float t)
+{
+	for(size_t x=0; x<mCount; x++)
+	{
+		Quaternion dest = things[x] * orbits[x];
+		things[x] = things[x] + t * (dest - things[x]);
+		things[x].normalise();
+	}
+	fillBuffer();
+}
+// Generate float between -1 and 1
+float randFloat()
+{
+	return ((float)rand()/RAND_MAX)*2.0f-1.0f;
+}
+void ThingRenderable::initialise()
+{
+	// Fill array with randomly oriented quads
+	Vector3 ax, ay, az;
+	size_t x;
+	Quaternion q;
+	things.clear(); orbits.clear();
+	for(x=0; x<mCount; x++)
+	{
+		ax = Vector3(randFloat(), randFloat(), randFloat());
+		ay = Vector3(randFloat(), randFloat(), randFloat());
+		az = ax.crossProduct(ay);
+		ay = az.crossProduct(ax);
+		ax.normalise(); ay.normalise(); az.normalise();
+		q.FromAxes(ax, ay, az);
+		//std::cerr << ax.dotProduct(ay) << " " << ay.dotProduct(az) << " " << az.dotProduct(ax) << std::endl;
+		things.push_back(q);
+		
+		ax = Vector3(randFloat(), randFloat(), randFloat());
+		ay = Vector3(randFloat(), randFloat(), randFloat());
+		az = ax.crossProduct(ay);
+		ay = az.crossProduct(ax);
+		ax.normalise(); ay.normalise(); az.normalise();
+		q.FromAxes(ax, ay, az);
+		orbits.push_back(q);
+	}
+	
+	// Create buffers
+	size_t nvertices = mCount*4; // n+1 planes
+	//size_t elemsize = 2*3; // position, normal
+	//size_t dsize = elemsize*nvertices;
+	
+	Ogre::IndexData *idata = new Ogre::IndexData();
+	Ogre::VertexData *vdata = new Ogre::VertexData();
+
+	// Quads
+	unsigned short *faces = new unsigned short[mCount*6];
+	for(x=0; x<mCount; x++) 
+	{
+		faces[x*6+0] = x*4+0;
+		faces[x*6+1] = x*4+1;
+		faces[x*6+2] = x*4+2;
+		faces[x*6+3] = x*4+0;
+		faces[x*6+4] = x*4+2;
+		faces[x*6+5] = x*4+3;
+	}
+	// Setup buffers
+	vdata->vertexStart = 0;
+	vdata->vertexCount = nvertices;
+	
+	VertexDeclaration* decl = vdata->vertexDeclaration;
+	VertexBufferBinding* bind = vdata->vertexBufferBinding;
+
+	size_t offset = 0;
+	decl->addElement(0, offset, VET_FLOAT3, VES_POSITION);
+	offset += VertexElement::getTypeSize(VET_FLOAT3);
+
+	vbuf = 
+	HardwareBufferManager::getSingleton().createVertexBuffer(
+		offset, nvertices, HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY);
+
+	bind->setBinding(0, vbuf);
+
+	//vbuf->writeData(0, vbuf->getSizeInBytes(), vertices, true);
+	
+	HardwareIndexBufferSharedPtr ibuf = HardwareBufferManager::getSingleton().
+		createIndexBuffer(
+			HardwareIndexBuffer::IT_16BIT, 
+			mCount*6, 
+			HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+
+	idata->indexBuffer = ibuf;
+	idata->indexCount = mCount*6;
+	idata->indexStart = 0;
+	ibuf->writeData(0, ibuf->getSizeInBytes(), faces, true);
+
+	// Delete temporary buffers
+	delete [] faces;
+	
+	// Now make the render operation
+	mRenderOp.operationType = Ogre::RenderOperation::OT_TRIANGLE_LIST;
+	mRenderOp.indexData = idata;
+	mRenderOp.vertexData = vdata;
+	mRenderOp.useIndexes = true;
+}
+
+void ThingRenderable::fillBuffer()
+{
+	// Transfer vertices and normals
+	float *vIdx = static_cast<float*>(vbuf->lock(Ogre::HardwareBuffer::HBL_DISCARD));
+	size_t elemsize = 1*3; // position only
+	size_t planesize = 4*elemsize; // four vertices per plane
+	for(size_t x=0; x<mCount; x++) 
+	{
+		Vector3 ax, ay, az;
+		things[x].ToAxes(ax, ay, az);
+		Vector3 pos = az * mRadius; // scale to radius
+		ax *= mQSize;
+		ay *= mQSize;
+		Vector3 pos1 = pos - ax - ay;
+		Vector3 pos2 = pos + ax - ay;
+		Vector3 pos3 = pos + ax + ay;
+		Vector3 pos4 = pos - ax + ay;
+		vIdx[x*planesize + 0*elemsize + 0] = pos1.x;
+		vIdx[x*planesize + 0*elemsize + 1] = pos1.y;
+		vIdx[x*planesize + 0*elemsize + 2] = pos1.z;
+		vIdx[x*planesize + 1*elemsize + 0] = pos2.x;
+		vIdx[x*planesize + 1*elemsize + 1] = pos2.y;
+		vIdx[x*planesize + 1*elemsize + 2] = pos2.z;
+		vIdx[x*planesize + 2*elemsize + 0] = pos3.x;
+		vIdx[x*planesize + 2*elemsize + 1] = pos3.y;
+		vIdx[x*planesize + 2*elemsize + 2] = pos3.z;
+		vIdx[x*planesize + 3*elemsize + 0] = pos4.x;
+		vIdx[x*planesize + 3*elemsize + 1] = pos4.y;
+		vIdx[x*planesize + 3*elemsize + 2] = pos4.z;
+	}
+	vbuf->unlock();
+}
+Ogre::Real ThingRenderable::getBoundingRadius() const
+{
+	return mRadius;
+}
+Ogre::Real ThingRenderable::getSquaredViewDepth(const Ogre::Camera* cam) const
+{
+	Ogre::Vector3 min, max, mid, dist;
+
+	min = mBox.getMinimum();
+	max = mBox.getMaximum();
+	mid = ((min - max) * 0.5) + min;
+	dist = cam->getDerivedPosition() - mid;
+                                                                        
+	return dist.squaredLength();
+}
+
Index: /Samples/VolumeTex/src/VolumeRenderable.cpp
===================================================================
--- /Samples/VolumeTex/src/VolumeRenderable.cpp	(revision 5)
+++ /Samples/VolumeTex/src/VolumeRenderable.cpp	(revision 5)
@@ -0,0 +1,243 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+#include "VolumeRenderable.h"
+#include <OgreCamera.h>
+#include <OgreSceneNode.h>
+#include <OgreHardwareVertexBuffer.h>
+#include <OgreHardwareIndexBuffer.h>
+#include <OgreHardwareBufferManager.h>
+#include <OgreMaterial.h>
+#include <OgreTechnique.h>
+#include <OgrePass.h>
+#include <OgreTextureUnitState.h>
+#include <OgreTextureManager.h>
+#include <OgreMaterialManager.h>
+using namespace Ogre;
+
+VolumeRenderable::VolumeRenderable(size_t nSlices, float size, const String &texture):
+	mSlices(nSlices),
+	mSize(size),
+	mTexture(texture)
+{
+	mRadius = sqrtf(size*size+size*size+size*size)/2.0f;
+	mBox = Ogre::AxisAlignedBox(-size, -size, -size, size, size, size);
+	
+	// No shadows
+	setCastShadows(false);
+	
+	initialise();
+}
+VolumeRenderable::~VolumeRenderable()
+{
+	// Remove private material
+	MaterialManager::getSingleton().remove(mTexture);
+    // need to release IndexData and vertexData created for renderable
+    delete mRenderOp.indexData;
+    delete mRenderOp.vertexData;
+
+}
+
+void VolumeRenderable::_notifyCurrentCamera( Camera* cam )
+{
+	MovableObject::_notifyCurrentCamera(cam);
+
+	// Fake orientation toward camera
+	Vector3 zVec = getParentNode()->_getDerivedPosition() - cam->getDerivedPosition();
+	zVec.normalise();
+	Vector3 fixedAxis = cam->getDerivedOrientation() * Vector3::UNIT_Y ;
+	
+	Vector3 xVec = fixedAxis.crossProduct( zVec );
+	xVec.normalise();
+
+	Vector3 yVec = zVec.crossProduct( xVec );
+	yVec.normalise();
+	
+	Quaternion oriQuat;
+	oriQuat.FromAxes( xVec, yVec, zVec );
+	
+	oriQuat.ToRotationMatrix(mFakeOrientation);
+	
+	Matrix3 tempMat;
+	Quaternion q = getParentNode()->_getDerivedOrientation().UnitInverse() * oriQuat ;
+	q.ToRotationMatrix(tempMat);
+	
+	Matrix4 rotMat = Matrix4::IDENTITY;
+	rotMat = tempMat;
+	rotMat.setTrans(Vector3(0.5f, 0.5f, 0.5f));
+	mUnit->setTextureTransform(rotMat);
+}
+
+
+//const Ogre::Quaternion& VolumeRenderable::getWorldOrientation(void) const
+//{
+//	return Ogre::Quaternion::IDENTITY;
+//}
+
+void VolumeRenderable::getWorldTransforms( Matrix4* xform ) const
+{
+	Matrix4 destMatrix(Matrix4::IDENTITY); // this initialisation is needed
+	
+	const Vector3 &position = getParentNode()->_getDerivedPosition();
+	const Vector3 &scale = getParentNode()->_getDerivedScale();
+	Matrix3 scale3x3(Matrix3::ZERO);
+	scale3x3[0][0] = scale.x;
+	scale3x3[1][1] = scale.y;
+	scale3x3[2][2] = scale.z;
+
+	destMatrix = mFakeOrientation * scale3x3;
+	destMatrix.setTrans(position);
+		
+	*xform = destMatrix;
+}
+
+void VolumeRenderable::initialise()
+{
+	// Create geometry
+	size_t nvertices = mSlices*4; // n+1 planes
+	size_t elemsize = 3*3;
+	size_t dsize = elemsize*nvertices;
+	size_t x;
+	
+	Ogre::IndexData *idata = new Ogre::IndexData();
+	Ogre::VertexData *vdata = new Ogre::VertexData();
+	
+	// Create  structures
+	float *vertices = new float[dsize];
+	
+	float coords[4][2] = {
+		{0.0f, 0.0f},
+		{0.0f, 1.0f},
+		{1.0f, 0.0f},
+		{1.0f, 1.0f}
+	};
+	for(x=0; x<mSlices; x++) 
+	{
+		for(size_t y=0; y<4; y++)
+		{
+			float xcoord = coords[y][0]-0.5;
+			float ycoord = coords[y][1]-0.5;
+			float zcoord = -((float)x/(float)(mSlices-1)  - 0.5f);
+			// 1.0f .. a/(a+1)
+			// coordinate
+			vertices[x*4*elemsize+y*elemsize+0] = xcoord*(mSize/2.0f);
+			vertices[x*4*elemsize+y*elemsize+1] = ycoord*(mSize/2.0f);
+			vertices[x*4*elemsize+y*elemsize+2] = zcoord*(mSize/2.0f);
+			// normal
+			vertices[x*4*elemsize+y*elemsize+3] = 0.0f;
+			vertices[x*4*elemsize+y*elemsize+4] = 0.0f;
+			vertices[x*4*elemsize+y*elemsize+5] = 1.0f;
+			// tex
+			vertices[x*4*elemsize+y*elemsize+6] = xcoord*sqrtf(3.0f);
+			vertices[x*4*elemsize+y*elemsize+7] = ycoord*sqrtf(3.0f);
+			vertices[x*4*elemsize+y*elemsize+8] = zcoord*sqrtf(3.0f);
+		} 
+	}
+	unsigned short *faces = new unsigned short[mSlices*6];
+	for(x=0; x<mSlices; x++) 
+	{
+		faces[x*6+0] = x*4+0;
+		faces[x*6+1] = x*4+1;
+		faces[x*6+2] = x*4+2;
+		faces[x*6+3] = x*4+1;
+		faces[x*6+4] = x*4+2;
+		faces[x*6+5] = x*4+3;
+	}
+	// Setup buffers
+	vdata->vertexStart = 0;
+	vdata->vertexCount = nvertices;
+	
+	VertexDeclaration* decl = vdata->vertexDeclaration;
+	VertexBufferBinding* bind = vdata->vertexBufferBinding;
+
+	size_t offset = 0;
+	decl->addElement(0, offset, VET_FLOAT3, VES_POSITION);
+	offset += VertexElement::getTypeSize(VET_FLOAT3);
+	decl->addElement(0, offset, VET_FLOAT3, VES_NORMAL);
+	offset += VertexElement::getTypeSize(VET_FLOAT3);
+	decl->addElement(0, offset, VET_FLOAT3, VES_TEXTURE_COORDINATES);
+	offset += VertexElement::getTypeSize(VET_FLOAT3);
+
+	HardwareVertexBufferSharedPtr vbuf = 
+	HardwareBufferManager::getSingleton().createVertexBuffer(
+		offset, nvertices, HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+
+	bind->setBinding(0, vbuf);
+
+	vbuf->writeData(0, vbuf->getSizeInBytes(), vertices, true);
+	
+	HardwareIndexBufferSharedPtr ibuf = HardwareBufferManager::getSingleton().
+		createIndexBuffer(
+			HardwareIndexBuffer::IT_16BIT, 
+			mSlices*6, 
+			HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+
+	idata->indexBuffer = ibuf;
+	idata->indexCount = mSlices*6;
+	idata->indexStart = 0;
+	ibuf->writeData(0, ibuf->getSizeInBytes(), faces, true);
+
+	// Delete temporary buffers
+	delete [] vertices;
+	delete [] faces;
+	
+	// Now make the render operation
+	mRenderOp.operationType = Ogre::RenderOperation::OT_TRIANGLE_LIST;
+	mRenderOp.indexData = idata;
+	mRenderOp.vertexData = vdata;
+	mRenderOp.useIndexes = true;
+	
+	 // Create a brand new private material
+	MaterialPtr material = 
+		MaterialManager::getSingleton().create(mTexture, "VolumeRenderable",
+			false, 0); // Manual, loader
+
+	// Remove pre-created technique from defaults
+	material->removeAllTechniques();
+	
+	// Create a techinique and a pass and a texture unit
+ 	Technique * technique = material->createTechnique();
+	Pass * pass = technique->createPass();
+	TextureUnitState * textureUnit = pass->createTextureUnitState();
+	
+	// Set pass parameters
+	pass->setSceneBlending(SBT_TRANSPARENT_ALPHA);
+	pass->setDepthWriteEnabled(false);
+	pass->setCullingMode(CULL_NONE);
+	pass->setLightingEnabled(false);
+	
+	// Set texture unit parameters
+	textureUnit->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
+	textureUnit->setTextureName(mTexture, TEX_TYPE_3D);
+	textureUnit->setTextureFiltering(TFO_TRILINEAR);
+	
+	mUnit = textureUnit;
+	m_pMaterial = material;
+}
+
+Ogre::Real VolumeRenderable::getBoundingRadius() const
+{
+	return mRadius;
+}
+Ogre::Real VolumeRenderable::getSquaredViewDepth(const Ogre::Camera* cam) const
+{
+	Ogre::Vector3 min, max, mid, dist;
+
+	min = mBox.getMinimum();
+	max = mBox.getMaximum();
+	mid = ((min - max) * 0.5) + min;
+	dist = cam->getDerivedPosition() - mid;
+                                                                        
+	return dist.squaredLength();
+}
+
Index: /Samples/VolumeTex/src/VolumeTex.cpp
===================================================================
--- /Samples/VolumeTex/src/VolumeTex.cpp	(revision 5)
+++ /Samples/VolumeTex/src/VolumeTex.cpp	(revision 5)
@@ -0,0 +1,324 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+/**	Generate 3D julia sets and render them as volume texture
+	This demonstrates
+	   - User generated textures
+	   - Procedural volume textures (Julia makes nice dust clouds)
+	   - Custom renderables
+	@author W.J. van der Laan
+*/
+
+#include "ExampleApplication.h"
+#include <OgreTexture.h>
+#include <OgreHardwarePixelBuffer.h>
+#include <OgreTextureManager.h>
+#include <OgreLogManager.h>
+#include <sstream>
+
+#include "VolumeRenderable.h"
+#include "ThingRenderable.h"
+#include "Julia.h"
+
+TexturePtr ptex;
+SimpleRenderable *vrend;
+SimpleRenderable *trend;
+Overlay* overlay;
+float xtime = 0.0f;
+SceneNode *snode,*fnode;
+AnimationState* mOgreAnimState = 0;
+
+class VolumeTexFrameListener : public ExampleFrameListener
+{
+public:
+	float global_real, global_imag, global_theta;
+	
+    VolumeTexFrameListener(RenderWindow* win, Camera* cam) : ExampleFrameListener( win, cam )
+    {
+		global_real = 0.4f;
+		global_imag = 0.6f;
+		global_theta = 0.0f;
+		generate();
+		
+		updateInfoParamReal();
+		updateInfoParamImag();
+		updateInfoParamTheta();
+    }
+	
+	void generate()
+	{
+		/* Evaluate julia fractal for each point */
+		Julia julia(global_real, global_imag, global_theta);
+		const float scale = 2.5;
+		const float vcut = 29.0f;
+		const float vscale = 1.0f/vcut;
+		
+		HardwarePixelBufferSharedPtr buffer = ptex->getBuffer(0, 0);
+		std::stringstream d;
+		d << "HardwarePixelBuffer " << buffer->getWidth() << " " << buffer->getHeight() << " " << buffer->getDepth();
+		LogManager::getSingleton().logMessage(d.str());
+		
+		buffer->lock(HardwareBuffer::HBL_NORMAL);
+		const PixelBox &pb = buffer->getCurrentLock();
+		d.str("");
+		d << "PixelBox " << pb.getWidth() << " " << pb.getHeight() << " " << pb.getDepth() << " " << pb.rowPitch << " " << pb.slicePitch << " " << pb.data << " " << PixelUtil::getFormatName(pb.format);
+		LogManager::getSingleton().logMessage(d.str());
+		
+		uint32 *pbptr = static_cast<uint32*>(pb.data);
+		for(size_t z=pb.front; z<pb.back; z++) 
+        {
+            for(size_t y=pb.top; y<pb.bottom; y++)
+            {
+                for(size_t x=pb.left; x<pb.right; x++)
+                {
+                    if(z==pb.front || z==(pb.back-1) || y==pb.top|| y==(pb.bottom-1) ||
+						x==pb.left || x==(pb.right-1))
+					{
+						// On border, must be zero
+						pbptr[x] = 0;
+                    } 
+					else
+					{
+						float val = julia.eval(((float)x/pb.getWidth()-0.5f) * scale, 
+								((float)y/pb.getHeight()-0.5f) * scale, 
+								((float)z/pb.getDepth()-0.5f) * scale);
+						if(val > vcut)
+							val = vcut;
+						
+						PixelUtil::packColour((float)x/pb.getWidth(), (float)y/pb.getHeight(), (float)z/pb.getDepth(), (1.0f-(val*vscale))*0.7f, PF_A8R8G8B8, &pbptr[x]);
+						
+					}	
+                }
+                pbptr += pb.rowPitch;
+            }
+            pbptr += pb.getSliceSkip();
+        }
+		buffer->unlock();
+	}
+	void updateInfoParamReal()
+	{
+		OverlayManager::getSingleton().getOverlayElement("Example/VolTex/Param_real") \
+			->setCaption("[1/2]real: "+StringConverter::toString(global_real));
+	}
+	void updateInfoParamImag()
+	{
+		OverlayManager::getSingleton().getOverlayElement("Example/VolTex/Param_imag") \
+			->setCaption("[3/4]imag: "+StringConverter::toString(global_imag));
+	}
+	void updateInfoParamTheta()
+	{
+		OverlayManager::getSingleton().getOverlayElement("Example/VolTex/Param_theta") \
+			->setCaption("[5/6]theta: "+StringConverter::toString(global_theta));
+	}
+
+    bool frameStarted( const FrameEvent& evt )
+    {
+	using namespace OIS;
+	static float mTimeUntilNextToggle = 0.0f;
+        if( ExampleFrameListener::frameStarted( evt ) == false )
+		return false;
+		
+		mTimeUntilNextToggle -= evt.timeSinceLastFrame;
+		
+        if( (mKeyboard->isKeyDown( KC_1 ) || mKeyboard->isKeyDown( KC_2 )) 
+				&& mTimeUntilNextToggle <= 0) {
+        	global_real += mKeyboard->isKeyDown( KC_1 )? -0.1f : 0.1f;
+			generate();
+			mTimeUntilNextToggle = 0.5;
+			updateInfoParamReal();
+		}
+		 if( (mKeyboard->isKeyDown( KC_3 ) || mKeyboard->isKeyDown( KC_4 )) 
+				&& mTimeUntilNextToggle <= 0) {
+        	global_imag += mKeyboard->isKeyDown( KC_3 )? -0.1f : 0.1f;
+			generate();
+			mTimeUntilNextToggle = 0.5;
+			updateInfoParamImag();
+		}
+		if( (mKeyboard->isKeyDown( KC_5 ) || mKeyboard->isKeyDown( KC_6 )) 
+				&& mTimeUntilNextToggle <= 0) {
+        	global_theta += mKeyboard->isKeyDown( KC_5 )? -0.1f : 0.1f;
+			generate();
+			mTimeUntilNextToggle = 0.5;
+			updateInfoParamTheta();
+		}
+		
+		xtime += evt.timeSinceLastFrame;
+		xtime = fmod(xtime, 10.0f);
+		//snode->roll(Degree(evt.timeSinceLastFrame * 20.0f));
+		//fnode->roll(Degree(evt.timeSinceLastFrame * 20.0f));
+		static_cast<ThingRenderable*>(trend)->addTime(evt.timeSinceLastFrame * 0.05f);
+		mOgreAnimState->addTime(evt.timeSinceLastFrame);
+        return true;
+    }
+	~VolumeTexFrameListener()
+	{
+		delete vrend;
+		delete trend;
+	}
+};
+
+
+
+class VolumeTexApplication : public ExampleApplication
+{
+public:
+    VolumeTexApplication() {}
+
+
+protected:
+	
+    virtual void createFrameListener(void)
+    {
+        mFrameListener= new VolumeTexFrameListener(mWindow, mCamera);
+        mFrameListener->showDebugOverlay(true);
+        mRoot->addFrameListener(mFrameListener);
+    }
+
+
+	virtual void createViewports(void)
+    {
+		// Create one viewport, entire window
+        Viewport* vp = mWindow->addViewport(mCamera);
+        vp->setBackgroundColour(ColourValue(0,0,0));
+
+        // Alter the camera aspect ratio to match the viewport
+        mCamera->setAspectRatio( 
+            Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
+    }
+	void createCamera(void)
+	{
+		// Create the camera
+        mCamera = mSceneMgr->createCamera("PlayerCam");
+        mCamera->setPosition(Vector3(220,-2,176));
+        mCamera->lookAt(Vector3(0,0,0));
+        mCamera->setNearClipDistance(5);
+		mCamera->setFixedYawAxis(false);
+	}
+    // Just override the mandatory create scene method
+    void createScene(void)
+    {
+		// Check capabilities
+        /*
+		const RenderSystemCapabilities* caps = Root::getSingleton().getRenderSystem()->getCapabilities();
+        if (!caps->hasCapability(RSC_TEXTURE_3D))
+        {
+            OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "Your card does not support 3D textures, so cannot "
+                "run this demo. Sorry!", 
+                "VolTex::createScene");
+        }
+        */
+		
+        // Create dynamic texture
+		ptex = TextureManager::getSingleton().createManual(
+			"DynaTex","General", TEX_TYPE_3D, 64, 64, 64, 0, PF_A8R8G8B8);
+		
+
+
+		// Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.6, 0.6, 0.6));
+		mSceneMgr->setSkyBox(true, "Examples/MorningSkyBox", 50 );
+
+        //mRoot->getRenderSystem()->clearFrameBuffer(FBT_COLOUR, ColourValue(255,255,255,0));
+
+        // Create a light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setDiffuseColour(0.75, 0.75, 0.80);
+		l->setSpecularColour(0.9, 0.9, 1);
+        l->setPosition(-100,80,50);
+		mSceneMgr->getRootSceneNode()->attachObject(l);
+
+		// Create manual material
+		
+		
+		// Create volume renderable
+		snode = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(0,0,0));      
+		
+        vrend = new VolumeRenderable(32, 750.0f, "DynaTex");
+        snode->attachObject( vrend );
+		
+		trend = new ThingRenderable(90.0f, 32, 7.5f);
+		trend->setMaterial("Examples/VTDarkStuff");
+		snode->attachObject(trend);
+		
+		// Ogre head node
+		fnode = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(0,0,0));
+		// Load ogre head
+		Entity* head = mSceneMgr->createEntity("head", "ogrehead.mesh");
+		fnode->attachObject(head);
+		
+		// Animation for ogre head
+		// Create a track for the light
+        Animation* anim = mSceneMgr->createAnimation("OgreTrack", 10);
+        // Spline it for nice curves
+        anim->setInterpolationMode(Animation::IM_SPLINE);
+        // Create a track to animate the camera's node
+        NodeAnimationTrack* track = anim->createNodeTrack(0, fnode);
+        // Setup keyframes
+        TransformKeyFrame* key = track->createNodeKeyFrame(0); // A startposition
+        key->setTranslate(Vector3(0.0f, -15.0f, 0.0f));
+        key = track->createNodeKeyFrame(5);//B
+        key->setTranslate(Vector3(0.0f, 15.0f, 0.0f));
+        key = track->createNodeKeyFrame(10);//C
+        key->setTranslate(Vector3(0.0f, -15.0f, 0.0f));
+        // Create a new animation state to track this
+        mOgreAnimState = mSceneMgr->createAnimationState("OgreTrack");
+        mOgreAnimState->setEnabled(true);
+     
+        //mFountainNode->attachObject(pSys2);
+		// show GUI
+		overlay = OverlayManager::getSingleton().getByName("Example/VolTexOverlay");    
+		overlay->show();
+    }
+
+	void destroyScene()
+	{
+		ptex.setNull();
+	}
+
+};
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char *argv[])
+#endif
+{
+    // Create application object
+    VolumeTexApplication app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " <<
+            e.getFullDescription().c_str() << std::endl;
+#endif
+    }
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/Water/Makefile.am
===================================================================
--- /Samples/Water/Makefile.am	(revision 5)
+++ /Samples/Water/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = include src 
Index: /Samples/Water/Makefile.in
===================================================================
--- /Samples/Water/Makefile.in	(revision 5)
+++ /Samples/Water/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Water
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = include src 
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Water/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Water/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Water/include/Makefile.am
===================================================================
--- /Samples/Water/include/Makefile.am	(revision 5)
+++ /Samples/Water/include/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+noinst_HEADERS=WaterMesh.h
Index: /Samples/Water/include/Makefile.in
===================================================================
--- /Samples/Water/include/Makefile.in	(revision 5)
+++ /Samples/Water/include/Makefile.in	(revision 5)
@@ -0,0 +1,436 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Samples/Water/include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_HEADERS = WaterMesh.h
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Water/include/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Water/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Water/include/WaterMesh.h
===================================================================
--- /Samples/Water/include/WaterMesh.h	(revision 5)
+++ /Samples/Water/include/WaterMesh.h	(revision 5)
@@ -0,0 +1,75 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+
+#ifndef _WATER_MESH_H_
+#define _WATER_MESH_H_
+
+#include "OgrePlatform.h"
+#include "Ogre.h"
+
+using namespace Ogre ;
+
+class WaterMesh
+{
+private:
+	MeshPtr mesh ;
+	SubMesh *subMesh ; 
+	float *vertexBuffers[3] ; // we need 3 vertex buffers
+	int currentBuffNumber ;
+	int complexity ;
+	String meshName ;
+	int numFaces ;
+	int numVertices ;
+	Vector3* vNormals ;
+
+	HardwareVertexBufferSharedPtr posVertexBuffer ;
+	HardwareVertexBufferSharedPtr normVertexBuffer ;
+	HardwareVertexBufferSharedPtr texcoordsVertexBuffer ;
+	HardwareIndexBufferSharedPtr indexBuffer ;
+
+	Real lastTimeStamp ;
+	Real lastAnimationTimeStamp;
+	Real lastFrameTime ;
+	
+	void calculateFakeNormals();
+	void calculateNormals();
+public:
+	WaterMesh(const String& meshName, Real planeSize, int complexity) ;
+    
+    virtual ~WaterMesh ();
+
+
+	/** "pushes" a mesh at position [x,y]. Note, that x,y are float, hence 
+	*	4 vertices are actually pushed
+	*	@note 
+	*		This should be replaced by push with 'radius' parameter to simulate
+	*  		big objects falling into water
+	*/
+	void push(Real x, Real y, Real depth, bool absolute=false) ;
+
+	/** gets height at given x and y, takes average value of the closes nodes */
+	Real getHeight(Real x, Real y);
+
+	/** updates mesh */
+	void updateMesh(Real timeSinceLastFrame) ;
+	
+	Real PARAM_C ; // ripple speed 
+	Real PARAM_D ; // distance
+	Real PARAM_U ; // viscosity
+	Real PARAM_T ; // time
+	bool useFakeNormals ;
+} ;
+
+#endif
Index: /Samples/Water/scripts/Demo_Water.cbp
===================================================================
--- /Samples/Water/scripts/Demo_Water.cbp	(revision 5)
+++ /Samples/Water/scripts/Demo_Water.cbp	(revision 5)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Water" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Water.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Water.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\WaterMesh.h" />
+		<Unit filename="..\src\Water.cpp" />
+		<Unit filename="..\src\WaterMesh.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Water/scripts/Demo_Water.vcproj
===================================================================
--- /Samples/Water/scripts/Demo_Water.vcproj	(revision 5)
+++ /Samples/Water/scripts/Demo_Water.vcproj	(revision 5)
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Demo_Water"
+	ProjectGUID="{C7167FBD-F166-4DEA-B50B-9F25E28B75F6}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_Water.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/Demo_Water.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_Water.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\Water.cpp">
+			</File>
+			<File
+				RelativePath="..\src\WaterMesh.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\WaterMesh.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Water/scripts/Demo_Water_linux.cbp
===================================================================
--- /Samples/Water/scripts/Demo_Water_linux.cbp	(revision 5)
+++ /Samples/Water/scripts/Demo_Water_linux.cbp	(revision 5)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="Demo_Water" />
+		<Option platforms="Unix;" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Debug/Demo_Water" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Debug" />
+				<Option object_output="../obj/Debug" />
+				<Option external_deps="../../../lib/libOgreMain_d.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option platforms="Unix;" />
+				<Option output="../../Common/bin/Release/Demo_Water" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="../../Common/bin/Release" />
+				<Option object_output="../obj/Release" />
+				<Option external_deps="../../../lib/libOgreMain.so;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="OIS" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DHAVE_CONFIG_H" />
+			<Add directory="../include" />
+			<Add directory="../../Common/include" />
+			<Add directory="../../../OgreMain/include" />
+		</Compiler>
+		<Linker>
+			<Add directory="../../Common/bin/$(TARGET_NAME)" />
+			<Add directory="/usr/local/lib" />
+		</Linker>
+		<Unit filename="../include/WaterMesh.h" />
+		<Unit filename="../src/Water.cpp" />
+		<Unit filename="../src/WaterMesh.cpp" />
+		<Extensions>
+			<code_completion />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Water/scripts/Demo_Water_stlp.cbp
===================================================================
--- /Samples/Water/scripts/Demo_Water_stlp.cbp	(revision 5)
+++ /Samples/Water/scripts/Demo_Water_stlp.cbp	(revision 5)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Demo_Water" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\Common\bin\Debug\Demo_Water.exe" />
+				<Option working_dir="..\..\Common\bin\Debug" />
+				<Option object_output="..\obj\Debug" />
+				<Option external_deps="..\..\..\lib\OgreMain_d.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="ois_d" />
+					<Add library="stlportstlg.5.1" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\Common\bin\Release\Demo_Water.exe" />
+				<Option working_dir="..\..\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option external_deps="..\..\..\lib\OgreMain.dll;" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="ois" />
+					<Add library="stlport.5.1" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\include" />
+			<Add directory="..\..\Common\include" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Dependencies\include" />
+			<Add directory="..\..\..\Dependencies\include\ois" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\include\WaterMesh.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\Water.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="..\src\WaterMesh.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Samples/Water/scripts/Demo_Water_vc8.vcproj
===================================================================
--- /Samples/Water/scripts/Demo_Water_vc8.vcproj	(revision 5)
+++ /Samples/Water/scripts/Demo_Water_vc8.vcproj	(revision 5)
@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="Demo_Water"
+	ProjectGUID="{C7167FBD-F166-4DEA-B50B-9F25E28B75F6}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/Demo_Water.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/Demo_Water.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)\VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/Demo_Water.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\Water.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\WaterMesh.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\WaterMesh.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Samples/Water/scripts/Demo_Water_vc8.vcproj.user
===================================================================
--- /Samples/Water/scripts/Demo_Water_vc8.vcproj.user	(revision 5)
+++ /Samples/Water/scripts/Demo_Water_vc8.vcproj.user	(revision 5)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="8.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)\$(TargetFileName)"
+				WorkingDirectory="$(SolutionDir)Samples\Common\bin\$(ConfigurationName)"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: /Samples/Water/src/Makefile.am
===================================================================
--- /Samples/Water/src/Makefile.am	(revision 5)
+++ /Samples/Water/src/Makefile.am	(revision 5)
@@ -0,0 +1,7 @@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Water/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+
+ogreexec_PROGRAMS = Water
+
+Water_SOURCES = Water.cpp WaterMesh.cpp
+Water_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Water_LDADD = -lOgreMain $(OIS_LIBS)
Index: /Samples/Water/src/Makefile.in
===================================================================
--- /Samples/Water/src/Makefile.in	(revision 5)
+++ /Samples/Water/src/Makefile.in	(revision 5)
@@ -0,0 +1,527 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ogreexec_PROGRAMS = Water$(EXEEXT)
+subdir = Samples/Water/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(ogreexecdir)"
+ogreexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(ogreexec_PROGRAMS)
+am_Water_OBJECTS = Water.$(OBJEXT) WaterMesh.$(OBJEXT)
+Water_OBJECTS = $(am_Water_OBJECTS)
+am__DEPENDENCIES_1 =
+Water_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(Water_SOURCES)
+DIST_SOURCES = $(Water_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = $(STLPORT_CFLAGS) -I$(top_srcdir)/Samples/Water/include -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Samples/Common/include $(OIS_CFLAGS)
+Water_SOURCES = Water.cpp WaterMesh.cpp
+Water_LDFLAGS = -L$(top_builddir)/OgreMain/src
+Water_LDADD = -lOgreMain $(OIS_LIBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Samples/Water/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Samples/Water/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-ogreexecPROGRAMS: $(ogreexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(ogreexecdir)" || $(mkdir_p) "$(DESTDIR)$(ogreexecdir)"
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(ogreexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ogreexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-ogreexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(ogreexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(ogreexecdir)/$$f"; \
+	done
+
+clean-ogreexecPROGRAMS:
+	@list='$(ogreexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+Water$(EXEEXT): $(Water_OBJECTS) $(Water_DEPENDENCIES) 
+	@rm -f Water$(EXEEXT)
+	$(CXXLINK) $(Water_LDFLAGS) $(Water_OBJECTS) $(Water_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Water.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WaterMesh.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(ogreexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-ogreexecPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-ogreexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-ogreexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-ogreexecPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-ogreexecPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-ogreexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Samples/Water/src/Water.cpp
===================================================================
--- /Samples/Water/src/Water.cpp	(revision 5)
+++ /Samples/Water/src/Water.cpp	(revision 5)
@@ -0,0 +1,677 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+/* Static water simulation by eru
+ * Started 29.05.2003, 20:54:37
+ */
+#include "ExampleApplication.h"
+#include "OgreBillboardParticleRenderer.h"
+#include "WaterMesh.h"
+
+#include <iostream>
+
+AnimationState* mAnimState;
+
+// Mesh stuff
+#define MESH_NAME "WaterMesh"
+#define ENTITY_NAME "WaterEntity"
+#define MATERIAL_PREFIX "Examples/Water"
+#define MATERIAL_NAME "Examples/Water0"
+#define COMPLEXITY 64 		// watch out - number of polys is 2*ACCURACY*ACCURACY !
+#define PLANE_SIZE 3000.0f
+#define CIRCLES_MATERIAL "Examples/Water/Circles"
+
+/* Some global variables */
+SceneNode *headNode ;
+Overlay* waterOverlay ;
+ParticleSystem *particleSystem ;
+ParticleEmitter *particleEmitter ;
+SceneManager *sceneMgr ;
+
+void prepareCircleMaterial()
+{
+	char *bmap = new char[256 * 256 * 4] ;
+	memset(bmap, 127, 256 * 256 * 4);
+	for(int b=0;b<16;b++) {
+		int x0 = b % 4 ;
+		int y0 = b >> 2 ;
+		Real radius = 4.0f + 1.4 * (float) b ;
+		for(int x=0;x<64;x++) {
+			for(int y=0;y<64;y++) {
+				Real dist = Math::Sqrt((x-32)*(x-32)+(y-32)*(y-32)); // 0..ca.45
+				dist = fabs(dist -radius -2) / 2.0f ;
+				dist = dist * 255.0f;
+				if (dist>255)
+					dist=255 ;
+				int colour = 255-(int)dist ;
+				colour = (int)( ((Real)(15-b))/15.0f * (Real) colour );
+
+				bmap[4*(256*(y+64*y0)+x+64*x0)+0]=colour ;
+				bmap[4*(256*(y+64*y0)+x+64*x0)+1]=colour ;
+				bmap[4*(256*(y+64*y0)+x+64*x0)+2]=colour ;
+				bmap[4*(256*(y+64*y0)+x+64*x0)+3]=colour ;
+			}
+		}
+	}
+
+	DataStreamPtr imgstream(new MemoryDataStream(bmap, 256 * 256 * 4));
+	//~ Image img;
+	//~ img.loadRawData( imgstream, 256, 256, PF_A8R8G8B8 );
+	//~ TextureManager::getSingleton().loadImage( CIRCLES_MATERIAL , img );
+	TextureManager::getSingleton().loadRawData(CIRCLES_MATERIAL,
+        ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+		imgstream, 256, 256, PF_A8R8G8B8);
+	MaterialPtr material =
+		MaterialManager::getSingleton().create( CIRCLES_MATERIAL,
+        ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+	TextureUnitState *texLayer = material->getTechnique(0)->getPass(0)->createTextureUnitState( CIRCLES_MATERIAL );
+	texLayer->setTextureAddressingMode( TextureUnitState::TAM_CLAMP );
+	material->setSceneBlending( SBT_ADD );
+	material->setDepthWriteEnabled( false ) ;
+    material->load();
+    // finished with bmap so release the memory
+    delete [] bmap;
+}
+
+
+/* =========================================================================*/
+/*               WaterCircle class                                          */
+/* =========================================================================*/
+#define CIRCLE_SIZE 500.0
+#define CIRCLE_TIME 0.5f
+class WaterCircle
+{
+private:
+	String name ;
+	SceneNode *node ;
+	MeshPtr mesh ;
+	SubMesh *subMesh ;
+	Entity *entity ;
+	Real tm ;
+	static bool first ;
+	// some buffers shared by all circles
+	static HardwareVertexBufferSharedPtr posnormVertexBuffer ;
+	static HardwareIndexBufferSharedPtr indexBuffer ; // indices for 2 faces
+	static HardwareVertexBufferSharedPtr *texcoordsVertexBuffers ;
+
+	float *texBufData;
+	void _prepareMesh()
+	{
+		int i,lvl ;
+
+		mesh = MeshManager::getSingleton().createManual(name,
+            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME) ;
+		subMesh = mesh->createSubMesh();
+		subMesh->useSharedVertices=false;
+
+		int numVertices = 4 ;
+
+		if (first) { // first Circle, create some static common data
+			first = false ;
+
+			// static buffer for position and normals
+			posnormVertexBuffer =
+				HardwareBufferManager::getSingleton().createVertexBuffer(
+					6*sizeof(float), // size of one vertex data
+					4, // number of vertices
+					HardwareBuffer::HBU_STATIC_WRITE_ONLY, // usage
+					false); // no shadow buffer
+			float *posnormBufData = (float*) posnormVertexBuffer->
+				lock(HardwareBuffer::HBL_DISCARD);
+			for(i=0;i<numVertices;i++) {
+				posnormBufData[6*i+0]=((Real)(i%2)-0.5f)*CIRCLE_SIZE; // pos X
+				posnormBufData[6*i+1]=0; // pos Y
+				posnormBufData[6*i+2]=((Real)(i/2)-0.5f)*CIRCLE_SIZE; // pos Z
+				posnormBufData[6*i+3]=0 ; // normal X
+				posnormBufData[6*i+4]=1 ; // normal Y
+				posnormBufData[6*i+5]=0 ; // normal Z
+			}
+			posnormVertexBuffer->unlock();
+
+			// static buffers for 16 sets of texture coordinates
+			texcoordsVertexBuffers = new HardwareVertexBufferSharedPtr[16];
+			for(lvl=0;lvl<16;lvl++) {
+				texcoordsVertexBuffers[lvl] =
+					HardwareBufferManager::getSingleton().createVertexBuffer(
+						2*sizeof(float), // size of one vertex data
+						numVertices, // number of vertices
+						HardwareBuffer::HBU_STATIC_WRITE_ONLY, // usage
+						false); // no shadow buffer
+				float *texcoordsBufData = (float*) texcoordsVertexBuffers[lvl]->
+					lock(HardwareBuffer::HBL_DISCARD);
+				float x0 = (Real)(lvl % 4) * 0.25 ;
+				float y0 = (Real)(lvl / 4) * 0.25 ;
+				y0 = 0.75-y0 ; // upside down
+				for(i=0;i<4;i++) {
+					texcoordsBufData[i*2 + 0]=
+						x0 + 0.25 * (Real)(i%2) ;
+					texcoordsBufData[i*2 + 1]=
+						y0 + 0.25 * (Real)(i/2) ;
+				}
+				texcoordsVertexBuffers[lvl]->unlock();
+			}
+
+			// Index buffer for 2 faces
+			unsigned short faces[6] = {2,1,0,  2,3,1};
+			indexBuffer =
+				HardwareBufferManager::getSingleton().createIndexBuffer(
+					HardwareIndexBuffer::IT_16BIT,
+					6,
+					HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+			indexBuffer->writeData(0,
+				indexBuffer->getSizeInBytes(),
+				faces,
+				true); // true?
+		}
+
+		// Initialize vertex data
+		subMesh->vertexData = new VertexData();
+		subMesh->vertexData->vertexStart = 0;
+		subMesh->vertexData->vertexCount = 4;
+		// first, set vertex buffer bindings
+		VertexBufferBinding *vbind = subMesh->vertexData->vertexBufferBinding ;
+		vbind->setBinding(0, posnormVertexBuffer);
+		vbind->setBinding(1, texcoordsVertexBuffers[0]);
+		// now, set vertex buffer declaration
+		VertexDeclaration *vdecl = subMesh->vertexData->vertexDeclaration ;
+		vdecl->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+		vdecl->addElement(0, 3*sizeof(float), VET_FLOAT3, VES_NORMAL);
+		vdecl->addElement(1, 0, VET_FLOAT2, VES_TEXTURE_COORDINATES);
+
+		// Initialize index data
+		subMesh->indexData->indexBuffer = indexBuffer;
+		subMesh->indexData->indexStart = 0;
+		subMesh->indexData->indexCount = 6;
+
+		// set mesh bounds
+		AxisAlignedBox circleBounds(-CIRCLE_SIZE/2.0f, 0, -CIRCLE_SIZE/2.0f,
+			CIRCLE_SIZE/2.0f, 0, CIRCLE_SIZE/2.0f);
+		mesh->_setBounds(circleBounds);
+        mesh->load();
+        mesh->touch();
+	}
+public:
+	int lvl ;
+	void setTextureLevel()
+	{
+		subMesh->vertexData->vertexBufferBinding->setBinding(1, texcoordsVertexBuffers[lvl]);
+	}
+	WaterCircle(const String& name, Real x, Real y)
+	{
+		this->name = name ;
+		_prepareMesh();
+		node = static_cast<SceneNode*> (sceneMgr->getRootSceneNode()->createChild(name));
+		node->translate(x*(PLANE_SIZE/COMPLEXITY), 10, y*(PLANE_SIZE/COMPLEXITY));
+		entity = sceneMgr->createEntity(name, name);
+		entity->setMaterialName(CIRCLES_MATERIAL);
+		node->attachObject(entity);
+		tm = 0 ;
+		lvl = 0 ;
+		setTextureLevel();
+	}
+	~WaterCircle()
+	{
+		MeshManager::getSingleton().remove(mesh->getHandle());
+		sceneMgr->destroyEntity(entity->getName());
+		static_cast<SceneNode*> (sceneMgr->getRootSceneNode())->removeChild(node->getName());
+	}
+	void animate(Real timeSinceLastFrame)
+	{
+		int lastlvl = lvl ;
+		tm += timeSinceLastFrame ;
+		lvl = (int) ( (Real)(tm)/CIRCLE_TIME * 16 );
+		if (lvl<16 && lvl!=lastlvl) {
+			setTextureLevel();
+		}
+	}
+	static void clearStaticBuffers()
+	{
+		posnormVertexBuffer = HardwareVertexBufferSharedPtr() ;
+		indexBuffer = HardwareIndexBufferSharedPtr() ;
+		for(int i=0;i<16;i++) {
+			texcoordsVertexBuffers[i] = HardwareVertexBufferSharedPtr() ;
+		}
+		delete [] texcoordsVertexBuffers;
+	}
+} ;
+bool WaterCircle::first = true ;
+HardwareVertexBufferSharedPtr WaterCircle::posnormVertexBuffer =
+	HardwareVertexBufferSharedPtr() ;
+HardwareIndexBufferSharedPtr WaterCircle::indexBuffer =
+	HardwareIndexBufferSharedPtr() ;
+HardwareVertexBufferSharedPtr* WaterCircle::texcoordsVertexBuffers = 0 ;
+
+/* =========================================================================*/
+/*               WaterListener class                                          */
+/* =========================================================================*/
+// Event handler
+class WaterListener: public ExampleFrameListener
+{
+protected:
+	WaterMesh *waterMesh ;
+	Entity *waterEntity ;
+	int materialNumber ;
+	bool skyBoxOn ;
+	Real timeoutDelay ;
+
+#define RAIN_HEIGHT_RANDOM 5
+#define RAIN_HEIGHT_CONSTANT 5
+
+
+	typedef std::vector<WaterCircle*> WaterCircles ;
+	WaterCircles circles ;
+
+	void processCircles(Real timeSinceLastFrame)
+	{
+		for(unsigned int i=0;i<circles.size();i++) {
+			circles[i]->animate(timeSinceLastFrame);
+		}
+		bool found ;
+		do {
+			found = false ;
+			for(WaterCircles::iterator it = circles.begin() ;
+					it != circles.end();
+					++it) {
+				if ((*it)->lvl>=16) {
+					delete (*it);
+					circles.erase(it);
+					found = true ;
+					break ;
+				}
+			}
+		} while (found) ;
+	}
+
+	void processParticles()
+	{
+		static int pindex = 0 ;
+		ParticleIterator pit = particleSystem->_getIterator() ;
+		while(!pit.end()) {
+			Particle *particle = pit.getNext();
+			Vector3 ppos = particle->position;
+			if (ppos.y<=0 && particle->timeToLive>0) { // hits the water!
+				// delete particle
+				particle->timeToLive = 0.0f;
+				// push the water
+				float x = ppos.x / PLANE_SIZE * COMPLEXITY ;
+				float y = ppos.z / PLANE_SIZE * COMPLEXITY ;
+				float h = rand() % RAIN_HEIGHT_RANDOM + RAIN_HEIGHT_CONSTANT ;
+				if (x<1) x=1 ;
+				if (x>COMPLEXITY-1) x=COMPLEXITY-1;
+				if (y<1) y=1 ;
+				if (y>COMPLEXITY-1) y=COMPLEXITY-1;
+				waterMesh->push(x,y,-h) ;
+				WaterCircle *circle = new WaterCircle(
+					"Circle#"+StringConverter::toString(pindex++),
+					x, y);
+				circles.push_back(circle);
+			}
+		}
+	}
+
+	/** Head animation */
+	Real headDepth ;
+	void animateHead(Real timeSinceLastFrame)
+	{
+		// sine track? :)
+		static double sines[4] = {0,100,200,300};
+		static const double adds[4] = {0.3,-1.6,1.1,0.5};
+		static Vector3 oldPos = Vector3::UNIT_Z;
+		for(int i=0;i<4;i++) {
+			sines[i]+=adds[i]*timeSinceLastFrame;
+		}
+		Real tx = ((sin(sines[0]) + sin(sines[1])) / 4 + 0.5 ) * (float)(COMPLEXITY-2) + 1 ;
+		Real ty = ((sin(sines[2]) + sin(sines[3])) / 4 + 0.5 ) * (float)(COMPLEXITY-2) + 1 ;
+		waterMesh->push(tx,ty, -headDepth);
+		Real step = PLANE_SIZE / COMPLEXITY ;
+		headNode->resetToInitialState();
+		headNode->scale(3,3,3);
+		Vector3 newPos = Vector3(step*tx, headDepth, step*ty);
+		Vector3 diffPos = newPos - oldPos ;
+		Quaternion headRotation = Vector3::UNIT_Z.getRotationTo(diffPos);
+		oldPos = newPos ;
+		headNode->translate(newPos);
+		headNode->rotate(headRotation);
+	}
+
+	// GUI updaters
+	void updateInfoParamC()
+	{
+		OverlayManager::getSingleton().getOverlayElement("Example/Water/Param_C") \
+			->setCaption("[1/2]Ripple speed: "+StringConverter::toString(waterMesh->PARAM_C));
+	}
+	void updateInfoParamD()
+	{
+		OverlayManager::getSingleton().getOverlayElement("Example/Water/Param_D") \
+			->setCaption("[3/4]Distance: "+StringConverter::toString(waterMesh->PARAM_D));
+	}
+	void updateInfoParamU()
+	{
+		OverlayManager::getSingleton().getOverlayElement("Example/Water/Param_U") \
+			->setCaption("[5/6]Viscosity: "+StringConverter::toString(waterMesh->PARAM_U));
+	}
+	void updateInfoParamT()
+	{
+		OverlayManager::getSingleton().getOverlayElement("Example/Water/Param_T") \
+			->setCaption("[7/8]Frame time: "+StringConverter::toString(waterMesh->PARAM_T));
+	}
+	void updateInfoNormals()
+	{
+		OverlayManager::getSingleton().getOverlayElement("Example/Water/Normals") \
+			->setCaption(String("[N]Normals: ")+((waterMesh->useFakeNormals)?"fake":"real"));
+	}
+	void switchNormals()
+	{
+		waterMesh->useFakeNormals = !waterMesh->useFakeNormals ;
+		updateInfoNormals() ;
+	}
+	void updateInfoHeadDepth()
+	{
+		OverlayManager::getSingleton().getOverlayElement("Example/Water/Depth") \
+			->setCaption(String("[U/J]Head depth: ")+StringConverter::toString(headDepth));
+	}
+	void updateInfoSkyBox()
+	{
+		OverlayManager::getSingleton().getOverlayElement("Example/Water/SkyBox")
+			->setCaption(String("[B]SkyBox: ")+String((skyBoxOn)?"On":"Off") );
+	}
+	void updateMaterial()
+	{
+		String materialName = MATERIAL_PREFIX+StringConverter::toString(materialNumber);
+		MaterialPtr material = MaterialManager::getSingleton().getByName(materialName);
+		if (material.isNull())
+        {
+			if(materialNumber)
+            {
+				materialNumber = 0 ;
+				updateMaterial();
+				return ;
+			}
+            else
+            {
+				OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR,
+					"Material "+materialName+"doesn't exist!",
+					"WaterListener::updateMaterial");
+			}
+		}
+		waterEntity->setMaterialName(materialName);
+		OverlayManager::getSingleton().getOverlayElement("Example/Water/Material") \
+			->setCaption(String("[M]Material: ")+materialName);
+	}
+
+	void switchMaterial()
+	{
+		materialNumber++;
+		updateMaterial();
+	}
+	void switchSkyBox()
+	{
+		skyBoxOn = !skyBoxOn;
+		sceneMgr->setSkyBox(skyBoxOn, "Examples/SceneSkyBox2");
+		updateInfoSkyBox();
+	}
+
+public:
+    WaterListener(RenderWindow* win, Camera* cam,
+		WaterMesh *waterMesh, Entity *waterEntity)
+        : ExampleFrameListener(win, cam)
+    {
+		this->waterMesh = waterMesh ;
+		this->waterEntity = waterEntity ;
+		materialNumber = 8;
+		timeoutDelay = 0.0f;
+		headDepth = 2.0f;
+		skyBoxOn = false ;
+
+		updateMaterial();
+		updateInfoParamC();
+		updateInfoParamD();
+		updateInfoParamU();
+		updateInfoParamT();
+		updateInfoNormals();
+		updateInfoHeadDepth();
+		updateInfoSkyBox();
+    }
+
+ 	virtual ~WaterListener ()
+ 	{
+ 		// If when you finish the application is still raining there
+ 		// are water circles that are still being processed
+ 		unsigned int activeCircles = this->circles.size ();
+
+ 		// Kill the active water circles
+ 		for (unsigned int i = 0; i < activeCircles; i++)
+ 			delete (this->circles[i]);
+ 	}
+
+    bool frameStarted(const FrameEvent& evt)
+    {
+		using namespace OIS;
+
+		if( ExampleFrameListener::frameStarted(evt) == false )
+		{
+			// check if we are exiting, if so, clear static HardwareBuffers to avoid segfault
+			WaterCircle::clearStaticBuffers();
+			return false;
+		}
+
+        mAnimState->addTime(evt.timeSinceLastFrame);
+
+		// process keyboard events
+		Real changeSpeed = evt.timeSinceLastFrame ;
+
+		// adjust keyboard speed with SHIFT (increase) and CONTROL (decrease)
+		if (mKeyboard->isKeyDown(OIS::KC_LSHIFT) || mKeyboard->isKeyDown(OIS::KC_RSHIFT)) {
+			changeSpeed *= 10.0f ;
+		}
+		if (mKeyboard->isKeyDown(OIS::KC_LCONTROL)) { 
+			changeSpeed /= 10.0f ;
+		}
+
+		// rain
+		processCircles(evt.timeSinceLastFrame);
+		if (mKeyboard->isKeyDown(OIS::KC_SPACE)) {
+			particleEmitter->setEmissionRate(20.0f);
+		} else {
+			particleEmitter->setEmissionRate(0.0f);
+		}
+		processParticles();
+
+		// adjust values (some macros for faster change
+#define ADJUST_RANGE(_value,_plus,_minus,_minVal,_maxVal,_change,_macro) {\
+	if (mKeyboard->isKeyDown(_plus)) \
+		{ _value+=_change ; if (_value>=_maxVal) _value = _maxVal ; _macro ; } ; \
+	if (mKeyboard->isKeyDown(_minus)) \
+		{ _value-=_change; if (_value<=_minVal) _value = _minVal ; _macro ; } ; \
+}
+
+		ADJUST_RANGE(headDepth, KC_U, KC_J, 0, 10, 0.5*changeSpeed, updateInfoHeadDepth()) ;
+
+		ADJUST_RANGE(waterMesh->PARAM_C, KC_2, KC_1, 0, 10, 0.1f*changeSpeed, updateInfoParamC()) ;
+
+		ADJUST_RANGE(waterMesh->PARAM_D, KC_4, KC_3, 0.1, 10, 0.1f*changeSpeed, updateInfoParamD()) ;
+
+		ADJUST_RANGE(waterMesh->PARAM_U, KC_6, KC_5, -2, 10, 0.1f*changeSpeed, updateInfoParamU()) ;
+
+		ADJUST_RANGE(waterMesh->PARAM_T, KC_8, KC_7, 0, 10, 0.1f*changeSpeed, updateInfoParamT()) ;
+
+		timeoutDelay-=evt.timeSinceLastFrame ;
+		if (timeoutDelay<=0)
+			timeoutDelay = 0;
+
+#define SWITCH_VALUE(_key,_timeDelay, _macro) { \
+		if (mKeyboard->isKeyDown(_key) && timeoutDelay==0) { \
+			timeoutDelay = _timeDelay ; _macro ;} }
+
+		SWITCH_VALUE(KC_N, 0.5f, switchNormals());
+
+		SWITCH_VALUE(KC_M, 0.5f, switchMaterial());
+
+		SWITCH_VALUE(KC_B, 0.5f, switchSkyBox());
+
+		animateHead(evt.timeSinceLastFrame);
+
+		waterMesh->updateMesh(evt.timeSinceLastFrame);
+
+		return true;
+    }
+};
+
+class WaterApplication : public ExampleApplication
+{
+public:
+    WaterApplication()
+        : waterMesh(0)
+    {
+
+    }
+
+    ~WaterApplication() {
+        delete waterMesh;
+    }
+
+protected:
+	WaterMesh *waterMesh ;
+	Entity *waterEntity ;
+
+// Just override the mandatory create scene method
+    void createScene(void)
+    {
+		sceneMgr = mSceneMgr ;
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.75, 0.75, 0.75));
+
+        // Create a light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        l->setPosition(200,300,100);
+
+		// Create water mesh and entity
+		waterMesh = new WaterMesh(MESH_NAME, PLANE_SIZE, COMPLEXITY);
+		waterEntity = mSceneMgr->createEntity(ENTITY_NAME,
+			MESH_NAME);
+		//~ waterEntity->setMaterialName(MATERIAL_NAME);
+		SceneNode *waterNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		waterNode->attachObject(waterEntity);
+
+        // Add a head, give it it's own node
+        headNode = waterNode->createChildSceneNode();
+        Entity *ent = mSceneMgr->createEntity("head", "ogrehead.mesh");
+        headNode->attachObject(ent);
+
+		// Make sure the camera track this node
+        //~ mCamera->setAutoTracking(true, headNode);
+
+		// Create the camera node, set its position & attach camera
+        SceneNode* camNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		camNode->translate(0, 500, PLANE_SIZE);
+		camNode->yaw(Degree(-45));
+        camNode->attachObject(mCamera);
+
+		// Create light node
+        SceneNode* lightNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		lightNode->attachObject(l);
+
+        // set up spline animation of light node
+        Animation* anim = mSceneMgr->createAnimation("WaterLight", 20);
+		NodeAnimationTrack *track ;
+        TransformKeyFrame *key ;
+		// create a random spline for light
+		track = anim->createNodeTrack(0, lightNode);
+		key = track->createNodeKeyFrame(0);
+		for(int ff=1;ff<=19;ff++) {
+			key = track->createNodeKeyFrame(ff);
+			Vector3 lpos (
+				rand()%(int)PLANE_SIZE , //- PLANE_SIZE/2,
+				rand()%300+100,
+				rand()%(int)PLANE_SIZE //- PLANE_SIZE/2
+				);
+			key->setTranslate(lpos);
+		}
+		key = track->createNodeKeyFrame(20);
+
+        // Create a new animation state to track this
+        mAnimState = mSceneMgr->createAnimationState("WaterLight");
+        mAnimState->setEnabled(true);
+
+        // Put in a bit of fog for the hell of it
+        //mSceneMgr->setFog(FOG_EXP, ColourValue::White, 0.0002);
+
+		// show overlay
+		waterOverlay = OverlayManager::getSingleton().getByName("Example/WaterOverlay");
+		waterOverlay->show();
+
+        // Let there be rain
+        particleSystem = mSceneMgr->createParticleSystem("rain",
+            "Examples/Water/Rain");
+		particleEmitter = particleSystem->getEmitter(0);
+        SceneNode* rNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        rNode->translate(PLANE_SIZE/2.0f, 3000, PLANE_SIZE/2.0f);
+        rNode->attachObject(particleSystem);
+        // Fast-forward the rain so it looks more natural
+        particleSystem->fastForward(20);
+		// It can't be set in .particle file, and we need it ;)
+		static_cast<BillboardParticleRenderer*>(particleSystem->getRenderer())->setBillboardOrigin(BBO_BOTTOM_CENTER);
+
+		prepareCircleMaterial();
+	}
+
+    // Create new frame listener
+    void createFrameListener(void)
+    {
+        mFrameListener= new WaterListener(mWindow, mCamera, waterMesh, waterEntity);
+        mRoot->addFrameListener(mFrameListener);
+    }
+
+};
+
+
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+    // Create application object
+    WaterApplication app;
+
+	srand(time(0));
+
+    try {
+        app.go();
+    } catch( Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: /Samples/Water/src/WaterMesh.cpp
===================================================================
--- /Samples/Water/src/WaterMesh.cpp	(revision 5)
+++ /Samples/Water/src/WaterMesh.cpp	(revision 5)
@@ -0,0 +1,328 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+
+
+#include "WaterMesh.h"
+
+#define ANIMATIONS_PER_SECOND 100.0f
+
+WaterMesh::WaterMesh(const String& meshName, Real planeSize, int complexity)
+{
+	int x,y,b; // I prefer to initialize for() variables inside it, but VC doesn't like it ;(
+
+	this->meshName = meshName ;
+	this->complexity =  complexity ;
+	numFaces = 2 * complexity * complexity;
+	numVertices = (complexity + 1) * (complexity + 1) ;
+	lastTimeStamp = 0 ;
+	lastAnimationTimeStamp = 0;
+	lastFrameTime = 0 ;
+
+	// initialize algorithm parameters
+	PARAM_C = 0.3f ; // ripple speed
+	PARAM_D = 0.4f ; // distance
+	PARAM_U = 0.05f ; // viscosity
+	PARAM_T = 0.13f ; // time
+	useFakeNormals = false ;
+
+	// allocate space for normal calculation
+	vNormals = new Vector3[numVertices];
+
+	// create mesh and submesh
+	mesh = MeshManager::getSingleton().createManual(meshName,
+        ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+	subMesh = mesh->createSubMesh();
+	subMesh->useSharedVertices=false;
+
+	// Vertex buffers
+	subMesh->vertexData = new VertexData();
+	subMesh->vertexData->vertexStart = 0;
+	subMesh->vertexData->vertexCount = numVertices;
+
+	VertexDeclaration* vdecl = subMesh->vertexData->vertexDeclaration;
+	VertexBufferBinding* vbind = subMesh->vertexData->vertexBufferBinding;
+
+
+	vdecl->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+	vdecl->addElement(1, 0, VET_FLOAT3, VES_NORMAL);
+	vdecl->addElement(2, 0, VET_FLOAT2, VES_TEXTURE_COORDINATES);
+
+	// Prepare buffer for positions - todo: first attempt, slow
+	posVertexBuffer =
+         HardwareBufferManager::getSingleton().createVertexBuffer(
+            3*sizeof(float),
+			numVertices,
+			HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE);
+	vbind->setBinding(0, posVertexBuffer);
+
+	// Prepare buffer for normals - write only
+	normVertexBuffer =
+         HardwareBufferManager::getSingleton().createVertexBuffer(
+            3*sizeof(float),
+			numVertices,
+			HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE);
+	vbind->setBinding(1, normVertexBuffer);
+
+	// Prepare texture coords buffer - static one
+	// todo: optimize to write directly into buffer
+	float *texcoordsBufData = new float[numVertices*2];
+	for(y=0;y<=complexity;y++) {
+		for(x=0;x<=complexity;x++) {
+			texcoordsBufData[2*(y*(complexity+1)+x)+0] = (float)x / complexity ;
+			texcoordsBufData[2*(y*(complexity+1)+x)+1] = 1.0f - ((float)y / (complexity)) ;
+		}
+	}
+	texcoordsVertexBuffer =
+         HardwareBufferManager::getSingleton().createVertexBuffer(
+            2*sizeof(float),
+			numVertices,
+			HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+	texcoordsVertexBuffer->writeData(0,
+		texcoordsVertexBuffer->getSizeInBytes(),
+		texcoordsBufData,
+		true); // true?
+	delete [] texcoordsBufData;
+    vbind->setBinding(2, texcoordsVertexBuffer);
+
+	// Prepare buffer for indices
+	indexBuffer =
+		HardwareBufferManager::getSingleton().createIndexBuffer(
+			HardwareIndexBuffer::IT_16BIT,
+			3*numFaces,
+			HardwareBuffer::HBU_STATIC, true);
+	unsigned short *faceVertexIndices = (unsigned short*)
+		indexBuffer->lock(0, numFaces*3*2, HardwareBuffer::HBL_DISCARD);
+	for(y=0 ; y<complexity ; y++) {
+		for(int x=0 ; x<complexity ; x++) {
+			unsigned short *twoface = faceVertexIndices + (y*complexity+x)*2*3;
+			int p0 = y*(complexity+1) + x ;
+			int p1 = y*(complexity+1) + x + 1 ;
+			int p2 = (y+1)*(complexity+1) + x ;
+			int p3 = (y+1)*(complexity+1) + x + 1 ;
+			twoface[0]=p2; //first tri
+			twoface[1]=p1;
+			twoface[2]=p0;
+			twoface[3]=p2; //second tri
+			twoface[4]=p3;
+			twoface[5]=p1;
+		}
+	}
+	indexBuffer->unlock();
+	// Set index buffer for this submesh
+	subMesh->indexData->indexBuffer = indexBuffer;
+	subMesh->indexData->indexStart = 0;
+	subMesh->indexData->indexCount = 3*numFaces;
+
+	/*	prepare vertex positions
+	 *	note - we use 3 vertex buffers, since algorighm uses two last phases
+	 *	to calculate the next one
+	 */
+	for(b=0;b<3;b++) {
+		vertexBuffers[b] = new float[numVertices * 3] ;
+		for(y=0;y<=complexity;y++) {
+			for(x=0;x<=complexity;x++) {
+				int numPoint = y*(complexity+1) + x ;
+				float* vertex = vertexBuffers[b] + 3*numPoint ;
+				vertex[0]=(float)(x) / (float)(complexity) * (float) planeSize ;
+				vertex[1]= 0 ; // rand() % 30 ;
+				vertex[2]=(float)(y) / (float)(complexity) * (float) planeSize ;
+			}
+		}
+	}
+
+	AxisAlignedBox meshBounds(0,0,0,
+		planeSize,0, planeSize);
+	mesh->_setBounds(meshBounds);
+
+	currentBuffNumber = 0 ;
+	posVertexBuffer->writeData(0,
+		posVertexBuffer->getSizeInBytes(), // size
+		vertexBuffers[currentBuffNumber], // source
+		true); // discard?
+
+    mesh->load();
+    mesh->touch();
+}
+/* ========================================================================= */
+WaterMesh::~WaterMesh ()
+{
+ 	delete[] vertexBuffers[0];
+ 	delete[] vertexBuffers[1];
+ 	delete[] vertexBuffers[2];
+
+	delete[] vNormals;
+}
+/* ========================================================================= */
+void WaterMesh::push(Real x, Real y, Real depth, bool absolute)
+{
+	float *buf = vertexBuffers[currentBuffNumber]+1 ;
+	// scale pressure according to time passed
+	depth = depth * lastFrameTime * ANIMATIONS_PER_SECOND ;
+#define _PREP(addx,addy) { \
+	float *vertex=buf+3*((int)(y+addy)*(complexity+1)+(int)(x+addx)) ; \
+	float diffy = y - floor(y+addy); \
+	float diffx = x - floor(x+addx); \
+	float dist=sqrt(diffy*diffy + diffx*diffx) ; \
+	float power = 1 - dist ; \
+	if (power<0)  \
+		power = 0; \
+	if (absolute) \
+		*vertex = depth*power ;  \
+	else \
+		*vertex += depth*power ;  \
+} /* #define */
+	_PREP(0,0);
+	_PREP(0,1);
+	_PREP(1,0);
+	_PREP(1,1);
+#undef _PREP
+}
+/* ========================================================================= */
+Real WaterMesh::getHeight(Real x, Real y)
+{
+#define hat(_x,_y) buf[3*((int)_y*(complexity+1)+(int)(_x))]
+	float *buf = vertexBuffers[currentBuffNumber] ;
+	Real xa = floor(x);
+	Real xb = xa + 1 ;
+	Real ya = floor(y);
+	Real yb = ya + 1 ;
+	Real yaxavg = hat(xa,ya) * (1.0f-fabs(xa-x)) + hat(xb,ya) * (1.0f-fabs(xb-x));
+	Real ybxavg = hat(xa,yb) * (1.0f-fabs(xa-x)) + hat(xb,yb) * (1.0f-fabs(xb-x));
+	Real yavg = yaxavg * (1.0f-fabs(ya-y)) + ybxavg * (1.0f-fabs(yb-y)) ;
+	return yavg ;
+}
+/* ========================================================================= */
+void WaterMesh::calculateFakeNormals()
+{
+	int x,y;
+	float *buf = vertexBuffers[currentBuffNumber] + 1;
+	float *pNormals = (float*) normVertexBuffer->lock(
+		0,normVertexBuffer->getSizeInBytes(), HardwareBuffer::HBL_DISCARD);
+	for(y=1;y<complexity;y++) {
+		float *nrow = pNormals + 3*y*(complexity+1);
+		float *row = buf + 3*y*(complexity+1) ;
+		float *rowup = buf + 3*(y-1)*(complexity+1) ;
+		float *rowdown = buf + 3*(y+1)*(complexity+1) ;
+		for(x=1;x<complexity;x++) {
+			Real xdiff = row[3*x+3] - row[3*x-3] ;
+			Real ydiff = rowup[3*x] - rowdown[3*x-3] ;
+			Vector3 norm(xdiff,30,ydiff);
+			norm.normalise();
+			nrow[3*x+0] = norm.x;
+			nrow[3*x+1] = norm.y;
+			nrow[3*x+2] = norm.z;
+		}
+	}
+	normVertexBuffer->unlock();
+}
+/* ========================================================================= */
+void WaterMesh::calculateNormals()
+{
+	int i,x,y;
+	float *buf = vertexBuffers[currentBuffNumber] + 1;
+	// zero normals
+	for(i=0;i<numVertices;i++) {
+		vNormals[i] = Vector3::ZERO;
+	}
+	// first, calculate normals for faces, add them to proper vertices
+	buf = vertexBuffers[currentBuffNumber] ;
+	unsigned short* vinds = (unsigned short*) indexBuffer->lock(
+		0, indexBuffer->getSizeInBytes(), HardwareBuffer::HBL_READ_ONLY);
+	float *pNormals = (float*) normVertexBuffer->lock(
+		0, normVertexBuffer->getSizeInBytes(), HardwareBuffer::HBL_DISCARD);
+	for(i=0;i<numFaces;i++) {
+		int p0 = vinds[3*i] ;
+		int p1 = vinds[3*i+1] ;
+		int p2 = vinds[3*i+2] ;
+		Vector3 v0(buf[3*p0], buf[3*p0+1], buf[3*p0+2]);
+		Vector3 v1(buf[3*p1], buf[3*p1+1], buf[3*p1+2]);
+		Vector3 v2(buf[3*p2], buf[3*p2+1], buf[3*p2+2]);
+		Vector3 diff1 = v2 - v1 ;
+		Vector3 diff2 = v0 - v1 ;
+		Vector3 fn = diff1.crossProduct(diff2);
+		vNormals[p0] += fn ;
+		vNormals[p1] += fn ;
+		vNormals[p2] += fn ;
+	}
+	// now normalize vertex normals
+	for(y=0;y<=complexity;y++) {
+		for(x=0;x<=complexity;x++) {
+			int numPoint = y*(complexity+1) + x ;
+			Vector3 n = vNormals[numPoint] ;
+			n.normalise() ;
+			float* normal = pNormals + 3*numPoint ;
+			normal[0]=n.x;
+			normal[1]=n.y;
+			normal[2]=n.z;
+		}
+	}
+	indexBuffer->unlock();
+	normVertexBuffer->unlock();
+}
+/* ========================================================================= */
+void WaterMesh::updateMesh(Real timeSinceLastFrame)
+{
+	int x, y ;
+
+	lastFrameTime = timeSinceLastFrame ;
+	lastTimeStamp += timeSinceLastFrame ;
+
+	// do rendering to get ANIMATIONS_PER_SECOND
+	while(lastAnimationTimeStamp <= lastTimeStamp) {
+
+		// switch buffer numbers
+		currentBuffNumber = (currentBuffNumber + 1) % 3 ;
+		float *buf = vertexBuffers[currentBuffNumber] + 1 ; // +1 for Y coordinate
+		float *buf1 = vertexBuffers[(currentBuffNumber+2)%3] + 1 ;
+		float *buf2 = vertexBuffers[(currentBuffNumber+1)%3] + 1;
+
+		/* we use an algorithm from
+		 * http://collective.valve-erc.com/index.php?go=water_simulation
+		 * The params could be dynamically changed every frame ofcourse
+		 */
+		double C = PARAM_C; // ripple speed
+		double D = PARAM_D; // distance
+		double U = PARAM_U; // viscosity
+		double T = PARAM_T; // time
+		Real TERM1 = ( 4.0f - 8.0f*C*C*T*T/(D*D) ) / (U*T+2) ;
+		Real TERM2 = ( U*T-2.0f ) / (U*T+2.0f) ;
+		Real TERM3 = ( 2.0f * C*C*T*T/(D*D) ) / (U*T+2) ;
+		for(y=1;y<complexity;y++) { // don't do anything with border values
+			float *row = buf + 3*y*(complexity+1) ;
+			float *row1 = buf1 + 3*y*(complexity+1) ;
+			float *row1up = buf1 + 3*(y-1)*(complexity+1) ;
+			float *row1down = buf1 + 3*(y+1)*(complexity+1) ;
+			float *row2 = buf2 + 3*y*(complexity+1) ;
+			for(x=1;x<complexity;x++) {
+				row[3*x] = TERM1 * row1[3*x]
+					+ TERM2 * row2[3*x]
+					+ TERM3 * ( row1[3*x-3] + row1[3*x+3] + row1up[3*x]+row1down[3*x] ) ;
+			}
+		}
+
+		lastAnimationTimeStamp += (1.0f / ANIMATIONS_PER_SECOND);
+	}
+
+	if (useFakeNormals) {
+		calculateFakeNormals();
+	} else {
+		calculateNormals();
+	}
+
+	// set vertex buffer
+	posVertexBuffer->writeData(0,
+		posVertexBuffer->getSizeInBytes(), // size
+		vertexBuffers[currentBuffNumber], // source
+		true); // discard?
+}
Index: /Scripts/.keepme
===================================================================
--- /Scripts/.keepme	(revision 5)
+++ /Scripts/.keepme	(revision 5)
@@ -0,0 +1,1 @@
+keep me
Index: /Scripts/m4/cppunit.m4
===================================================================
--- /Scripts/m4/cppunit.m4	(revision 5)
+++ /Scripts/m4/cppunit.m4	(revision 5)
@@ -0,0 +1,80 @@
+dnl
+dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl
+AC_DEFUN([AM_PATH_CPPUNIT],
+[
+
+AC_ARG_WITH(cppunit-prefix,[  --with-cppunit-prefix=PFX   Prefix where CppUnit is installed (optional)],
+            cppunit_config_prefix="$withval", cppunit_config_prefix="")
+AC_ARG_WITH(cppunit-exec-prefix,[  --with-cppunit-exec-prefix=PFX  Exec prefix where CppUnit is installed (optional)],
+            cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="")
+
+  if test x$cppunit_config_exec_prefix != x ; then
+     cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix"
+     if test x${CPPUNIT_CONFIG+set} != xset ; then
+        CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config
+     fi
+  fi
+  if test x$cppunit_config_prefix != x ; then
+     cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix"
+     if test x${CPPUNIT_CONFIG+set} != xset ; then
+        CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config
+     fi
+  fi
+
+  AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no)
+  cppunit_version_min=$1
+
+  AC_MSG_CHECKING(for Cppunit - version >= $cppunit_version_min)
+  no_cppunit=""
+  if test "$CPPUNIT_CONFIG" = "no" ; then
+    no_cppunit=yes
+  else
+    CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags`
+    CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs`
+    cppunit_version=`$CPPUNIT_CONFIG --version`
+
+    cppunit_major_version=`echo $cppunit_version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    cppunit_minor_version=`echo $cppunit_version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    cppunit_micro_version=`echo $cppunit_version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+
+    cppunit_major_min=`echo $cppunit_version_min | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    cppunit_minor_min=`echo $cppunit_version_min | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    cppunit_micro_min=`echo $cppunit_version_min | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+
+    cppunit_version_proper=`expr \
+        $cppunit_major_version \> $cppunit_major_min \| \
+        $cppunit_major_version \= $cppunit_major_min \& \
+        $cppunit_minor_version \> $cppunit_minor_min \| \
+        $cppunit_major_version \= $cppunit_major_min \& \
+        $cppunit_minor_version \= $cppunit_minor_min \& \
+        $cppunit_micro_version \>= $cppunit_micro_min `
+
+    if test "$cppunit_version_proper" = "1" ; then
+      AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version])
+    else
+      AC_MSG_RESULT(no)
+      no_cppunit=yes
+    fi
+  fi
+
+  if test "x$no_cppunit" = x ; then
+     ifelse([$2], , :, [$2])     
+  else
+     CPPUNIT_CFLAGS=""
+     CPPUNIT_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+
+  AC_SUBST(CPPUNIT_CFLAGS)
+  AC_SUBST(CPPUNIT_LIBS)
+])
+
+
+
Index: /Scripts/m4/sdl.m4
===================================================================
--- /Scripts/m4/sdl.m4	(revision 5)
+++ /Scripts/m4/sdl.m4	(revision 5)
@@ -0,0 +1,175 @@
+# Configure paths for SDL
+# Sam Lantinga 9/21/99
+# stolen from Manish Singh
+# stolen back from Frank Belew
+# stolen from Manish Singh
+# Shamelessly stolen from Owen Taylor
+
+dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
+dnl
+AC_DEFUN([AM_PATH_SDL],
+[dnl 
+dnl Get the cflags and libraries from the sdl-config script
+dnl
+AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is installed (optional)],
+            sdl_prefix="$withval", sdl_prefix="")
+AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
+            sdl_exec_prefix="$withval", sdl_exec_prefix="")
+AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run a test SDL program],
+		    , enable_sdltest=yes)
+
+  if test x$sdl_exec_prefix != x ; then
+     sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
+     if test x${SDL_CONFIG+set} != xset ; then
+        SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
+     fi
+  fi
+  if test x$sdl_prefix != x ; then
+     sdl_args="$sdl_args --prefix=$sdl_prefix"
+     if test x${SDL_CONFIG+set} != xset ; then
+        SDL_CONFIG=$sdl_prefix/bin/sdl-config
+     fi
+  fi
+
+  AC_REQUIRE([AC_CANONICAL_TARGET])
+  PATH="$prefix/bin:$prefix/usr/bin:$PATH"
+  AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
+  min_sdl_version=ifelse([$1], ,0.11.0,$1)
+  AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
+  no_sdl=""
+  if test "$SDL_CONFIG" = "no" ; then
+    no_sdl=yes
+  else
+    SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
+    SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
+
+    sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_sdltest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $SDL_CFLAGS"
+      LIBS="$LIBS $SDL_LIBS"
+dnl
+dnl Now check if the installed SDL is sufficiently new. (Also sanity
+dnl checks the results of sdl-config to some extent
+dnl
+      rm -f conf.sdltest
+      AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "SDL.h"
+
+char*
+my_strdup (char *str)
+{
+  char *new_str;
+  
+  if (str)
+    {
+      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
+      strcpy (new_str, str);
+    }
+  else
+    new_str = NULL;
+  
+  return new_str;
+}
+
+int main (int argc, char *argv[])
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  /* This hangs on some systems (?)
+  system ("touch conf.sdltest");
+  */
+  { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = my_strdup("$min_sdl_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_sdl_version");
+     exit(1);
+   }
+
+   if (($sdl_major_version > major) ||
+      (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
+      (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
+    {
+      return 0;
+    }
+  else
+    {
+      printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
+      printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
+      printf("*** best to upgrade to the required version.\n");
+      printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
+      printf("*** to point to the correct copy of sdl-config, and remove the file\n");
+      printf("*** config.cache before re-running configure\n");
+      return 1;
+    }
+}
+
+],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_sdl" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$SDL_CONFIG" = "no" ; then
+       echo "*** The sdl-config script installed by SDL could not be found"
+       echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the SDL_CONFIG environment variable to the"
+       echo "*** full path to sdl-config."
+     else
+       if test -f conf.sdltest ; then
+        :
+       else
+          echo "*** Could not run SDL test program, checking why..."
+          CFLAGS="$CFLAGS $SDL_CFLAGS"
+          LIBS="$LIBS $SDL_LIBS"
+          AC_TRY_LINK([
+#include <stdio.h>
+#include "SDL.h"
+
+int main(int argc, char *argv[])
+{ return 0; }
+#undef  main
+#define main K_and_R_C_main
+],      [ return 0; ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding SDL or finding the wrong"
+          echo "*** version of SDL. If it is not finding SDL, 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 SDL was incorrectly installed"
+          echo "*** or that you have moved SDL since it was installed. In the latter case, you"
+          echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     SDL_CFLAGS=""
+     SDL_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(SDL_CFLAGS)
+  AC_SUBST(SDL_LIBS)
+  rm -f conf.sdltest
+])
Index: /Scripts/null.sh
===================================================================
--- /Scripts/null.sh	(revision 5)
+++ /Scripts/null.sh	(revision 5)
@@ -0,0 +1,1 @@
+#!/bin/sh
Index: /Scripts/remove_debug.sh
===================================================================
--- /Scripts/remove_debug.sh	(revision 5)
+++ /Scripts/remove_debug.sh	(revision 5)
@@ -0,0 +1,3 @@
+#!/bin/sh
+sed "s/ -g//" $1 > $1.new
+mv -f $1.new $1 
Index: /Tests/Makefile.am
===================================================================
--- /Tests/Makefile.am	(revision 5)
+++ /Tests/Makefile.am	(revision 5)
@@ -0,0 +1,1 @@
+SUBDIRS = src
Index: /Tests/Makefile.in
===================================================================
--- /Tests/Makefile.in	(revision 5)
+++ /Tests/Makefile.in	(revision 5)
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = Tests
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = src
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Tests/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Tests/OgreMain/include/BitwiseTests.h
===================================================================
--- /Tests/OgreMain/include/BitwiseTests.h	(revision 5)
+++ /Tests/OgreMain/include/BitwiseTests.h	(revision 5)
@@ -0,0 +1,46 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+class BitwiseTests : public CppUnit::TestFixture
+{
+    // CppUnit macros for setting up the test suite
+    CPPUNIT_TEST_SUITE( BitwiseTests );
+    CPPUNIT_TEST(testFixedPointConversion);
+    CPPUNIT_TEST(testIntReadWrite);
+    CPPUNIT_TEST(testHalf);
+    CPPUNIT_TEST_SUITE_END();
+public:
+    void setUp();
+    void tearDown();
+    void testFixedPointConversion();
+    void testIntReadWrite();
+    void testHalf();
+};
Index: /Tests/OgreMain/include/CompositorScriptCompilerTests.h
===================================================================
--- /Tests/OgreMain/include/CompositorScriptCompilerTests.h	(revision 5)
+++ /Tests/OgreMain/include/CompositorScriptCompilerTests.h	(revision 5)
@@ -0,0 +1,54 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreCompositorScriptCompiler.h"
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+using namespace Ogre;
+
+// subclass from MaterialScriptCompiler class so protected methods can be tested
+class CompositorScriptCompilerTests : public CppUnit::TestFixture, CompositorScriptCompiler
+{
+    // CppUnit macros for setting up the test suite
+    CPPUNIT_TEST_SUITE( CompositorScriptCompilerTests );
+        CPPUNIT_TEST(testPositionToNextSymbol);
+        CPPUNIT_TEST(testIsFloatValue);
+        CPPUNIT_TEST(testIsLexemeMatch);
+        CPPUNIT_TEST(testCompile);
+    CPPUNIT_TEST_SUITE_END();
+protected:
+public:
+    void setUp();
+    void tearDown();
+
+    void testPositionToNextSymbol();
+    void testIsFloatValue();
+    void testIsLexemeMatch();
+    void testCompile();
+};
Index: /Tests/OgreMain/include/EdgeBuilderTests.h
===================================================================
--- /Tests/OgreMain/include/EdgeBuilderTests.h	(revision 5)
+++ /Tests/OgreMain/include/EdgeBuilderTests.h	(revision 5)
@@ -0,0 +1,54 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include "OgreLogManager.h"
+#include "OgreHardwareBufferManager.h"
+
+using namespace Ogre;
+
+class EdgeBuilderTests : public CppUnit::TestFixture
+{
+    // CppUnit macros for setting up the test suite
+    CPPUNIT_TEST_SUITE( EdgeBuilderTests );
+    CPPUNIT_TEST(testSingleIndexBufSingleVertexBuf);
+    CPPUNIT_TEST(testMultiIndexBufSingleVertexBuf);
+    CPPUNIT_TEST(testMultiIndexBufMultiVertexBuf);
+    CPPUNIT_TEST_SUITE_END();
+protected:
+    HardwareBufferManager* mBufMgr;
+    LogManager* mLogMgr;
+public:
+    void setUp();
+    void tearDown();
+    void testSingleIndexBufSingleVertexBuf();
+    void testMultiIndexBufSingleVertexBuf();
+    void testMultiIndexBufMultiVertexBuf();
+
+};
Index: /Tests/OgreMain/include/FileSystemArchiveTests.h
===================================================================
--- /Tests/OgreMain/include/FileSystemArchiveTests.h	(revision 5)
+++ /Tests/OgreMain/include/FileSystemArchiveTests.h	(revision 5)
@@ -0,0 +1,67 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include "OgreString.h"
+
+using namespace Ogre;
+
+class FileSystemArchiveTests : public CppUnit::TestFixture
+{
+    // CppUnit macros for setting up the test suite
+    CPPUNIT_TEST_SUITE( FileSystemArchiveTests );
+    CPPUNIT_TEST(testListNonRecursive);
+    CPPUNIT_TEST(testListRecursive);
+    CPPUNIT_TEST(testListFileInfoNonRecursive);
+    CPPUNIT_TEST(testListFileInfoRecursive);
+    CPPUNIT_TEST(testFindNonRecursive);
+    CPPUNIT_TEST(testFindRecursive);
+    CPPUNIT_TEST(testFindFileInfoNonRecursive);
+    CPPUNIT_TEST(testFindFileInfoRecursive);
+    CPPUNIT_TEST(testFileRead);
+    CPPUNIT_TEST(testReadInterleave);
+    CPPUNIT_TEST_SUITE_END();
+protected:
+    String testPath;
+public:
+    void setUp();
+    void tearDown();
+
+    void testListNonRecursive();
+    void testListRecursive();
+    void testListFileInfoNonRecursive();
+    void testListFileInfoRecursive();
+    void testFindNonRecursive();
+    void testFindRecursive();
+    void testFindFileInfoNonRecursive();
+    void testFindFileInfoRecursive();
+    void testFileRead();
+    void testReadInterleave();
+
+};
Index: /Tests/OgreMain/include/MaterialScriptCompilerTests.h
===================================================================
--- /Tests/OgreMain/include/MaterialScriptCompilerTests.h	(revision 5)
+++ /Tests/OgreMain/include/MaterialScriptCompilerTests.h	(revision 5)
@@ -0,0 +1,54 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreMaterialScriptCompiler.h"
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+using namespace Ogre;
+
+// subclass from MaterialScriptCompiler class so protected methods can be tested
+class MaterialScriptCompilerTests : public CppUnit::TestFixture, MaterialScriptCompiler
+{
+    // CppUnit macros for setting up the test suite
+    CPPUNIT_TEST_SUITE( MaterialScriptCompilerTests );
+        CPPUNIT_TEST(testPositionToNextSymbol);
+        CPPUNIT_TEST(testIsFloatValue);
+        CPPUNIT_TEST(testIsLexemeMatch);
+        CPPUNIT_TEST(testCompileMaterialScript);
+    CPPUNIT_TEST_SUITE_END();
+protected:
+public:
+    void setUp();
+    void tearDown();
+
+    void testPositionToNextSymbol();
+    void testIsFloatValue();
+    void testIsLexemeMatch();
+    void testCompileMaterialScript();
+};
Index: /Tests/OgreMain/include/PixelFormatTests.h
===================================================================
--- /Tests/OgreMain/include/PixelFormatTests.h	(revision 5)
+++ /Tests/OgreMain/include/PixelFormatTests.h	(revision 5)
@@ -0,0 +1,59 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include "OgrePixelFormat.h"
+
+using namespace Ogre;
+
+class PixelFormatTests : public CppUnit::TestFixture
+{
+    // CppUnit macros for setting up the test suite
+    CPPUNIT_TEST_SUITE( PixelFormatTests );
+    CPPUNIT_TEST( testIntegerPackUnpack );
+    CPPUNIT_TEST( testFloatPackUnpack );
+    CPPUNIT_TEST( testBulkConversion );
+    CPPUNIT_TEST_SUITE_END();
+public:
+    void setUp();
+    void tearDown();
+
+    void testIntegerPackUnpack();
+    void testFloatPackUnpack();
+    void testBulkConversion();
+
+    // Utils
+    void setupBoxes(PixelFormat srcFormat, PixelFormat dstFormat);
+    void testCase(PixelFormat srcFormat, PixelFormat dstFormat);
+private:
+    int size;
+    uint8 *randomData;
+    uint8 *temp, *temp2;
+    PixelBox src, dst1, dst2;
+};
Index: /Tests/OgreMain/include/RadixSortTests.h
===================================================================
--- /Tests/OgreMain/include/RadixSortTests.h	(revision 5)
+++ /Tests/OgreMain/include/RadixSortTests.h	(revision 5)
@@ -0,0 +1,54 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+class RadixSortTests : public CppUnit::TestFixture
+{
+	// CppUnit macros for setting up the test suite
+	CPPUNIT_TEST_SUITE( RadixSortTests );
+	CPPUNIT_TEST(testFloatVector);
+	CPPUNIT_TEST(testFloatList);
+	CPPUNIT_TEST(testUnsignedIntList);
+	CPPUNIT_TEST(testIntList);
+	CPPUNIT_TEST(testUnsignedIntVector);
+	CPPUNIT_TEST(testIntVector);
+	CPPUNIT_TEST_SUITE_END();
+protected:
+public:
+	void setUp();
+	void tearDown();
+	void testFloatVector();
+	void testFloatList();
+	void testUnsignedIntList();
+	void testIntList();
+	void testUnsignedIntVector();
+	void testIntVector();
+
+};
Index: /Tests/OgreMain/include/StringTests.h
===================================================================
--- /Tests/OgreMain/include/StringTests.h	(revision 5)
+++ /Tests/OgreMain/include/StringTests.h	(revision 5)
@@ -0,0 +1,93 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include "OgreString.h"
+
+class StringTests : public CppUnit::TestFixture
+{
+    // CppUnit macros for setting up the test suite
+    CPPUNIT_TEST_SUITE( StringTests );
+    CPPUNIT_TEST(testSplitFileNameNoPath);
+    CPPUNIT_TEST(testSplitFileNameRelativePath);
+    CPPUNIT_TEST(testSplitFileNameAbsolutePath);
+    CPPUNIT_TEST(testMatchCaseSensitive);
+    CPPUNIT_TEST(testMatchCaseInSensitive);
+	CPPUNIT_TEST(testMatchGlobAll);
+    CPPUNIT_TEST(testMatchGlobStart);
+    CPPUNIT_TEST(testMatchGlobEnd);
+    CPPUNIT_TEST(testMatchGlobStartAndEnd);
+    CPPUNIT_TEST(testMatchGlobMiddle);
+    CPPUNIT_TEST(testMatchSuperGlobtastic);
+	CPPUNIT_TEST(testParseReal);
+	CPPUNIT_TEST(testParseInt);
+	CPPUNIT_TEST(testParseLong);
+	CPPUNIT_TEST(testParseUnsignedLong);
+	CPPUNIT_TEST(testParseVector3);
+	CPPUNIT_TEST(testParseMatrix4);
+	CPPUNIT_TEST(testParseQuaternion);
+	CPPUNIT_TEST(testParseBool);
+	CPPUNIT_TEST(testParseColourValue);
+
+    CPPUNIT_TEST_SUITE_END();
+protected:
+	Ogre::String testFileNoPath;
+	Ogre::String testFileRelativePathWindows;
+	Ogre::String testFileRelativePathUnix;
+	Ogre::String testFileAbsolutePathWindows;
+	Ogre::String testFileAbsolutePathUnix;
+public:
+    void setUp();
+    void tearDown();
+	// StringUtil::splitFileName tests
+    void testSplitFileNameNoPath();
+    void testSplitFileNameRelativePath();
+    void testSplitFileNameAbsolutePath();
+	// StringUtil::match tests
+    void testMatchCaseSensitive();
+    void testMatchCaseInSensitive();
+	void testMatchGlobAll();
+	void testMatchGlobStart();
+	void testMatchGlobEnd();
+	void testMatchGlobStartAndEnd();
+	void testMatchGlobMiddle();
+	void testMatchSuperGlobtastic();
+	// StringConverter tests
+	void testParseReal();
+	void testParseInt();
+	void testParseLong();
+	void testParseUnsignedLong();
+	void testParseVector3();
+	void testParseMatrix4();
+	void testParseQuaternion();
+	void testParseBool();
+	void testParseColourValue();
+
+
+};
Index: /Tests/OgreMain/include/VectorTests.h
===================================================================
--- /Tests/OgreMain/include/VectorTests.h	(revision 5)
+++ /Tests/OgreMain/include/VectorTests.h	(revision 5)
@@ -0,0 +1,46 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+class VectorTests : public CppUnit::TestFixture
+{
+    // CppUnit macros for setting up the test suite
+    CPPUNIT_TEST_SUITE( VectorTests );
+    CPPUNIT_TEST(testVector2Scaler);
+    CPPUNIT_TEST(testVector3Scaler);
+    CPPUNIT_TEST(testVector4Scaler);
+    CPPUNIT_TEST_SUITE_END();
+public:
+    void setUp();
+    void tearDown();
+    void testVector2Scaler();
+    void testVector3Scaler();
+    void testVector4Scaler();
+};
Index: /Tests/OgreMain/include/ZipArchiveTests.h
===================================================================
--- /Tests/OgreMain/include/ZipArchiveTests.h	(revision 5)
+++ /Tests/OgreMain/include/ZipArchiveTests.h	(revision 5)
@@ -0,0 +1,65 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include "OgreString.h"
+
+class ZipArchiveTests : public CppUnit::TestFixture
+{
+    // CppUnit macros for setting up the test suite
+    CPPUNIT_TEST_SUITE( ZipArchiveTests );
+    CPPUNIT_TEST(testListNonRecursive);
+    CPPUNIT_TEST(testListRecursive);
+    CPPUNIT_TEST(testListFileInfoNonRecursive);
+    CPPUNIT_TEST(testListFileInfoRecursive);
+    CPPUNIT_TEST(testFindNonRecursive);
+    CPPUNIT_TEST(testFindRecursive);
+    CPPUNIT_TEST(testFindFileInfoNonRecursive);
+    CPPUNIT_TEST(testFindFileInfoRecursive);
+    CPPUNIT_TEST(testFileRead);
+    CPPUNIT_TEST(testReadInterleave);
+    CPPUNIT_TEST_SUITE_END();
+protected:
+    Ogre::String testPath;
+public:
+    void setUp();
+    void tearDown();
+
+    void testListNonRecursive();
+    void testListRecursive();
+    void testListFileInfoNonRecursive();
+    void testListFileInfoRecursive();
+    void testFindNonRecursive();
+    void testFindRecursive();
+    void testFindFileInfoNonRecursive();
+    void testFindFileInfoRecursive();
+    void testFileRead();
+    void testReadInterleave();
+
+};
Index: /Tests/OgreMain/misc/ArchiveTest/rootfile.txt
===================================================================
--- /Tests/OgreMain/misc/ArchiveTest/rootfile.txt	(revision 5)
+++ /Tests/OgreMain/misc/ArchiveTest/rootfile.txt	(revision 5)
@@ -0,0 +1,5 @@
+this is line 1 in file 1
+this is line 2 in file 1
+this is line 3 in file 1
+this is line 4 in file 1
+this is line 5 in file 1
Index: /Tests/OgreMain/misc/ArchiveTest/rootfile2.txt
===================================================================
--- /Tests/OgreMain/misc/ArchiveTest/rootfile2.txt	(revision 5)
+++ /Tests/OgreMain/misc/ArchiveTest/rootfile2.txt	(revision 5)
@@ -0,0 +1,6 @@
+this is line 1 in file 2
+this is line 2 in file 2
+this is line 3 in file 2
+this is line 4 in file 2
+this is line 5 in file 2
+this is line 6 in file 2
Index: /Tests/OgreMain/src/BitwiseTests.cpp
===================================================================
--- /Tests/OgreMain/src/BitwiseTests.cpp	(revision 5)
+++ /Tests/OgreMain/src/BitwiseTests.cpp	(revision 5)
@@ -0,0 +1,127 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "BitwiseTests.h"
+#include "OgreBitwise.h"
+// Register the suite
+
+using namespace Ogre;
+
+CPPUNIT_TEST_SUITE_REGISTRATION( BitwiseTests );
+
+void BitwiseTests::setUp()
+{
+}
+
+void BitwiseTests::tearDown()
+{
+}
+
+
+void BitwiseTests::testFixedPointConversion()
+{
+    CPPUNIT_ASSERT_EQUAL(Bitwise::fixedToFixed(0x0,1,8), (unsigned int)0x00);
+    CPPUNIT_ASSERT_EQUAL(Bitwise::fixedToFixed(0x1,1,8), (unsigned int)0xFF);
+    CPPUNIT_ASSERT_EQUAL(Bitwise::fixedToFixed(0x2,2,8), (unsigned int)0xAA); // 10101010
+    CPPUNIT_ASSERT_EQUAL(Bitwise::fixedToFixed(0x1,2,8), (unsigned int)0x55); // 01010101
+    CPPUNIT_ASSERT_EQUAL(Bitwise::fixedToFixed(0x2,2,9), (unsigned int)0x155); // 1 01010101
+    CPPUNIT_ASSERT_EQUAL(Bitwise::fixedToFixed(0x1,2,9), (unsigned int)0x0AA); // 0 10101010
+    CPPUNIT_ASSERT_EQUAL(Bitwise::fixedToFixed(0xFE,8,3), (unsigned int)0x7); // 111
+    CPPUNIT_ASSERT_EQUAL(Bitwise::fixedToFixed(0xFE,8,9), (unsigned int)0x1FD); // 111111101
+
+    CPPUNIT_ASSERT_EQUAL(Bitwise::fixedToFloat(0xFF,8), 1.0f);
+    CPPUNIT_ASSERT_EQUAL(Bitwise::fixedToFloat(0x00,8), 0.0f);
+
+    CPPUNIT_ASSERT_EQUAL(Bitwise::floatToFixed(1.0f,8), (unsigned int)0xFF);
+    CPPUNIT_ASSERT_EQUAL(Bitwise::floatToFixed(0.0f,8), (unsigned int)0x00);
+
+    // Test clamping
+    CPPUNIT_ASSERT_EQUAL(Bitwise::floatToFixed(-1.0f,8), (unsigned int)0x00);
+    CPPUNIT_ASSERT_EQUAL(Bitwise::floatToFixed(2.0f,8), (unsigned int)0xFF);
+
+    // Test circular conversion
+    bool failed = false;
+    for(int x=0; x<0x100; x++)
+        if(Bitwise::floatToFixed(Bitwise::fixedToFloat(x,8),8) != x)
+            failed = true;
+    CPPUNIT_ASSERT_MESSAGE("circular floatToFixed/fixedToFloat for 8 bit failed",!failed);
+
+    failed = false;
+    for(int x=0; x<0x10; x++)
+        if(Bitwise::floatToFixed(Bitwise::fixedToFloat(x,4),4) != x)
+            failed = true;
+    CPPUNIT_ASSERT_MESSAGE("circular floatToFixed/fixedToFloat for 4 bit failed",!failed);
+
+    failed = false;
+    for(int x=0; x<0x1000; x++)
+        if(Bitwise::floatToFixed(Bitwise::fixedToFloat(x,12),12) != x)
+            failed = true;
+    CPPUNIT_ASSERT_MESSAGE("circular floatToFixed/fixedToFloat for 12 bit failed",!failed);
+}
+
+void BitwiseTests::testIntReadWrite()
+{
+    // Test reading and writing ints
+    uint32 testje = 0x12345678;
+    assert(Bitwise::intRead(&testje, 4) == 0x12345678);
+    uint16 testje2 = 0x1234;
+    assert(Bitwise::intRead(&testje2, 2) == 0x1234);
+    uint8 testje3 = 0xD3;
+    assert(Bitwise::intRead(&testje3, 1) == 0xD3);
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+    uint8 testje4[] = {0x12, 0x34, 0x56};
+#else
+    uint8 testje4[] = {0x56, 0x34, 0x12};
+#endif
+    assert(Bitwise::intRead(&testje4, 3) == 0x123456);
+
+    Bitwise::intWrite(&testje, 4, 0x87654321);
+    assert(testje == 0x87654321);
+
+    Bitwise::intWrite(&testje2, 2, 0x4321);
+    assert(testje2 == 0x4321);
+
+    Bitwise::intWrite(&testje3, 1, 0x12);
+    assert(testje3 == 0x12);
+}
+
+void BitwiseTests::testHalf()
+{
+    /*
+    for(int x=0; x<0x100; x++)
+    {
+        float f = (float)x/255.0f;
+        uint32 fi = *reinterpret_cast<uint32*>(&f);
+        uint16 g = Bitwise::floatToHalf(f);
+        float h = Bitwise::halfToFloat(g);
+        uint32 hi = *reinterpret_cast<uint32*>(&h);
+        int i = h*256.0f;
+        std::cerr << x << " " << fi << " " << std::hex << std::setw(4) << g << " " << hi << " " << i << std::endl;
+    }
+    */
+}
Index: /Tests/OgreMain/src/CompositorScriptCompilerTests.cpp
===================================================================
--- /Tests/OgreMain/src/CompositorScriptCompilerTests.cpp	(revision 5)
+++ /Tests/OgreMain/src/CompositorScriptCompilerTests.cpp	(revision 5)
@@ -0,0 +1,237 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "OgreMaterialManager.h"
+#include "OgreCompositorManager.h"
+#include "CompositorScriptCompilerTests.h"
+#include "OgreCompositorScriptCompiler.h"
+#include "OgreStringConverter.h"
+
+#define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0]))
+
+// Regsiter the suite
+CPPUNIT_TEST_SUITE_REGISTRATION( CompositorScriptCompilerTests );
+
+void CompositorScriptCompilerTests::setUp()
+{
+}
+void CompositorScriptCompilerTests::tearDown()
+{
+}
+
+void CompositorScriptCompilerTests::testPositionToNextSymbol()
+{
+  struct test1result{
+    const char character;
+    const int line;
+  };
+
+  const String TestStr1 = "   \n\r  //c  \n\r// test\n\r  \t  c   - \n\r ,  e";
+  const test1result test1results[] = {
+    {'c', 4},
+    {'-', 4},
+    {',', 5},
+    {'e', 5}
+  };
+
+  // first test: see if positionToNextSymbol can find a valid Symbol
+  mSource = &TestStr1;
+  mCharPos = 0;
+  size_t resultID = 0;
+  mCurrentLine = 1;
+  mEndOfSource = mSource->length();
+  while (positionToNextLexeme()) {
+      CPPUNIT_ASSERT_MESSAGE( "test " + StringConverter::toString(resultID) + "  character found: " + (*mSource)[mCharPos] +
+          "  Line:%d  : " + StringConverter::toString(mCurrentLine)
+          , ((*mSource)[mCharPos] == test1results[resultID].character) && (mCurrentLine==test1results[resultID].line) );
+    resultID++;
+    mCharPos++;
+  }
+
+}
+
+void CompositorScriptCompilerTests::testIsFloatValue(void)
+{
+  struct testfloatresult{
+    const String teststr;
+    const float fvalue;
+    const size_t charsize;
+    testfloatresult(const String& _teststr, const float _fvalue, const size_t _charsize)
+        : teststr(_teststr)
+        , fvalue(_fvalue)
+        , charsize(_charsize)
+        {};
+  };
+
+  testfloatresult testfloatresults[] = {
+    testfloatresult("1 test", 1.0f, 1),
+    testfloatresult("2.3f test", 2.3f, 3),
+    testfloatresult("-0.5 test", -0.5f, 4),
+    testfloatresult(" 23.6 test", 23.6f, 5),
+    testfloatresult("  -0.021 test", -0.021f, 8),
+    testfloatresult("12 test", 12.0f, 2),
+    testfloatresult("3test", 3.0f, 1)
+  };
+
+  float fvalue = 0;
+  size_t charsize = 0;
+  mCharPos = 0;
+  size_t testsize = ARRAYSIZE(testfloatresults);
+  for(size_t resultID=0; resultID<testsize; resultID++)
+  {
+    mSource = &testfloatresults[resultID].teststr;
+    isFloatValue(fvalue, charsize);
+    CPPUNIT_ASSERT_MESSAGE( "test " + StringConverter::toString(resultID) + " value returned: " + StringConverter::toString(fvalue)
+        , fvalue == testfloatresults[resultID].fvalue);
+    CPPUNIT_ASSERT_MESSAGE( "test " + StringConverter::toString(resultID) + " char size returned: " + StringConverter::toString(charsize)
+        , charsize == testfloatresults[resultID].charsize);
+  }
+
+}
+
+void CompositorScriptCompilerTests::testIsLexemeMatch(void)
+{
+  const String TestStr = "Compositor test";
+  const String TestSymbols = "compositor";
+
+  mSource = &TestStr;
+  mCharPos = 0;
+  CPPUNIT_ASSERT(isLexemeMatch(TestSymbols, false));
+  //CPPUNIT_ASSERT(isLexemeMatch(TestSymbols, true));
+  mCharPos = 1;
+  CPPUNIT_ASSERT(!isLexemeMatch(TestSymbols, false));
+  CPPUNIT_ASSERT(!isLexemeMatch(TestSymbols, true));
+
+}
+
+void CompositorScriptCompilerTests::testCompile()
+{
+    if (!ResourceGroupManager::getSingletonPtr())
+        new ResourceGroupManager();
+    if (!MaterialManager::getSingletonPtr())
+    {
+        new MaterialManager();
+        MaterialManager::getSingleton().initialise();
+    }
+    if (!CompositorManager::getSingletonPtr())
+        new CompositorManager();
+
+    //compositorMgr->initialise();
+    const String simpleScript = "compositor \"First Test\" { technique { target_output { } } }";
+    CPPUNIT_ASSERT(compile(simpleScript, "Test Compositor"));
+
+    const String BW_Script =
+        "/// Black and white effect \n"
+        "compositor B&W \n"
+        "{ \n"
+        "    technique \n"
+        "    { \n"
+        "        // Temporary textures \n"
+        "        texture scene target_width target_height PF_A8R8G8B8 \n"
+        " \n"
+        "        target scene \n"
+        "        { \n"
+        "            // Render output from previous compositor (or original scene) \n"
+        "            input previous \n"
+        "        }"
+        "        target_output \n"
+        "        { \n"
+        "            // Start with clear output \n"
+        "            input none \n"
+        "            // Draw a fullscreen quad with the blur \n"
+        "            pass render_quad \n"
+        "            { \n"
+        "                // Renders a fullscreen quad with a material \n"
+        "                material PostFilters/BlackAndWhite \n"
+        "                input 0 scene \n"
+        "            } \n"
+        "        } \n"
+        "    } \n"
+        "} \n";
+
+    CPPUNIT_ASSERT(compile(BW_Script, "Test Black & White Script"));
+
+    const String Bloom_Script =
+    "/// Manuel's bloom \n"
+    "/// Needs a scene-sized rtt, but does only one render of the scene \n"
+    "compositor Bloom \n"
+    "{ \n"
+    "    technique \n"
+    "    { \n"
+    "        // Temporary textures \n"
+    "        texture scene target_width target_height PF_A8R8G8B8 \n"
+    "        texture rt0 128 128 PF_A8R8G8B8 \n"
+    "        texture rt1 128 128 PF_A8R8G8B8 \n"
+    "     \n"
+    "        target scene \n"
+    "        { \n"
+    "            // Render output from previous compositor (or original scene) \n"
+    "            input previous \n"
+    "        } \n"
+    "        target rt0 \n"
+    "        { \n"
+    "            // Start with clear texture \n"
+    "            input none \n"
+    "            // Vertical blur pass \n"
+    "            pass render_quad \n"
+    "            { \n"
+    "                // Renders a fullscreen quad with a material \n"
+    "                material PostFilters/Blur0 \n"
+    "                input 0 scene \n"
+    "            } \n"
+    "        } \n"
+    "        target rt1 \n"
+    "        { \n"
+    "            // Start with clear texture \n"
+    "            input none \n"
+    "            // Horizontal blur pass \n"
+    "            pass render_quad \n"
+    "            { \n"
+    "                // Renders a fullscreen quad with a material \n"
+    "                material PostFilters/Blur1 \n"
+    "                input 0 rt0 \n"
+    "            } \n"
+    "        } \n"
+    "        target_output \n"
+    "        { \n"
+    "            // Start with clear output \n"
+    "            input none \n"
+    "            // Draw a fullscreen quad \n"
+    "            pass render_quad \n"
+    "            { \n"
+    "                // Renders a fullscreen quad with a material \n"
+    "                material PostFilters/BloomBlend \n"
+    "                input 0 scene \n"
+    "                input 1 rt1 \n"
+    "            } \n"
+    "        } \n"
+    "    } \n"
+    "} \n";
+    CPPUNIT_ASSERT(compile(Bloom_Script, "Test Bloom Script"));
+}
+
Index: /Tests/OgreMain/src/EdgeBuilderTests.cpp
===================================================================
--- /Tests/OgreMain/src/EdgeBuilderTests.cpp	(revision 5)
+++ /Tests/OgreMain/src/EdgeBuilderTests.cpp	(revision 5)
@@ -0,0 +1,290 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "EdgeBuilderTests.h"
+#include "OgreDefaultHardwareBufferManager.h"
+#include "OgreVertexIndexData.h"
+#include "OgreEdgeListBuilder.h"
+
+// Regsiter the suite
+CPPUNIT_TEST_SUITE_REGISTRATION( EdgeBuilderTests );
+
+void EdgeBuilderTests::setUp()
+{
+    mBufMgr = new DefaultHardwareBufferManager();
+    //mLogMgr = new LogManager();
+    LogManager::getSingleton().createLog("EdgeBuilderTests.log", true);
+}
+void EdgeBuilderTests::tearDown()
+{
+    delete mBufMgr;
+    //delete mLogMgr;
+}
+
+void EdgeBuilderTests::testSingleIndexBufSingleVertexBuf()
+{
+    /* This tests the edge builders ability to find shared edges in the simple case
+    of a single index buffer referencing a single vertex buffer
+    */
+    VertexData vd;
+    IndexData id;
+    // Test pyramid
+    vd.vertexCount = 4;
+    vd.vertexStart = 0;
+    vd.vertexDeclaration = HardwareBufferManager::getSingleton().createVertexDeclaration();
+    vd.vertexDeclaration->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+    HardwareVertexBufferSharedPtr vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(sizeof(float)*3, 4, HardwareBuffer::HBU_STATIC,true);
+    vd.vertexBufferBinding->setBinding(0, vbuf);
+    float* pFloat = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD));
+    *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+    *pFloat++ = 50 ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+    *pFloat++ = 0  ; *pFloat++ = 100; *pFloat++ = 0  ;
+    *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = -50;
+    vbuf->unlock();
+
+    id.indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+        HardwareIndexBuffer::IT_16BIT, 12, HardwareBuffer::HBU_STATIC, true);
+    id.indexCount = 12;
+    id.indexStart = 0;
+    unsigned short* pIdx = static_cast<unsigned short*>(id.indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+    *pIdx++ = 0; *pIdx++ = 1; *pIdx++ = 2;
+    *pIdx++ = 0; *pIdx++ = 2; *pIdx++ = 3;
+    *pIdx++ = 1; *pIdx++ = 3; *pIdx++ = 2;
+    *pIdx++ = 0; *pIdx++ = 3; *pIdx++ = 1;
+    id.indexBuffer->unlock();
+
+    EdgeListBuilder edgeBuilder;
+    edgeBuilder.addVertexData(&vd);
+    edgeBuilder.addIndexData(&id);
+    EdgeData* edgeData = edgeBuilder.build();
+
+    // Should be only one group, since only one vertex buffer
+    CPPUNIT_ASSERT(edgeData->edgeGroups.size() == 1);
+    // 4 tris
+    CPPUNIT_ASSERT(edgeData->triangles.size() == 4);
+    EdgeData::EdgeGroup& eg = edgeData->edgeGroups[0];
+    // 6 edges
+    CPPUNIT_ASSERT(eg.edges.size() == 6);
+
+    delete edgeData;
+
+
+}
+
+void EdgeBuilderTests::testMultiIndexBufSingleVertexBuf()
+{
+    /* This tests the edge builders ability to find shared edges when there are
+    multiple index sets (submeshes) using a single vertex buffer.
+    */
+    VertexData vd;
+    IndexData id[4];
+    // Test pyramid
+    vd.vertexCount = 4;
+    vd.vertexStart = 0;
+    vd.vertexDeclaration = HardwareBufferManager::getSingleton().createVertexDeclaration();
+    vd.vertexDeclaration->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+    HardwareVertexBufferSharedPtr vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(sizeof(float)*3, 4, HardwareBuffer::HBU_STATIC,true);
+    vd.vertexBufferBinding->setBinding(0, vbuf);
+    float* pFloat = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD));
+    *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+    *pFloat++ = 50 ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+    *pFloat++ = 0  ; *pFloat++ = 100; *pFloat++ = 0  ;
+    *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = -50;
+    vbuf->unlock();
+
+    id[0].indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+        HardwareIndexBuffer::IT_16BIT, 3, HardwareBuffer::HBU_STATIC, true);
+    id[0].indexCount = 3;
+    id[0].indexStart = 0;
+    unsigned short* pIdx = static_cast<unsigned short*>(id[0].indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+    *pIdx++ = 0; *pIdx++ = 1; *pIdx++ = 2;
+    id[0].indexBuffer->unlock();
+
+    id[1].indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+        HardwareIndexBuffer::IT_16BIT, 3, HardwareBuffer::HBU_STATIC, true);
+    id[1].indexCount = 3;
+    id[1].indexStart = 0;
+    pIdx = static_cast<unsigned short*>(id[1].indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+    *pIdx++ = 0; *pIdx++ = 2; *pIdx++ = 3;
+    id[1].indexBuffer->unlock();
+
+    id[2].indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+        HardwareIndexBuffer::IT_16BIT, 3, HardwareBuffer::HBU_STATIC, true);
+    id[2].indexCount = 3;
+    id[2].indexStart = 0;
+    pIdx = static_cast<unsigned short*>(id[2].indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+    *pIdx++ = 1; *pIdx++ = 3; *pIdx++ = 2;
+    id[2].indexBuffer->unlock();
+
+    id[3].indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+        HardwareIndexBuffer::IT_16BIT, 3, HardwareBuffer::HBU_STATIC, true);
+    id[3].indexCount = 3;
+    id[3].indexStart = 0;
+    pIdx = static_cast<unsigned short*>(id[3].indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+    *pIdx++ = 0; *pIdx++ = 3; *pIdx++ = 1;
+    id[3].indexBuffer->unlock();
+
+    EdgeListBuilder edgeBuilder;
+    edgeBuilder.addVertexData(&vd);
+    edgeBuilder.addIndexData(&id[0]);
+    edgeBuilder.addIndexData(&id[1]);
+    edgeBuilder.addIndexData(&id[2]);
+    edgeBuilder.addIndexData(&id[3]);
+    EdgeData* edgeData = edgeBuilder.build();
+
+    // Should be only one group, since only one vertex buffer
+    CPPUNIT_ASSERT(edgeData->edgeGroups.size() == 1);
+    // 4 tris
+    CPPUNIT_ASSERT(edgeData->triangles.size() == 4);
+    EdgeData::EdgeGroup& eg = edgeData->edgeGroups[0];
+    // 6 edges
+    CPPUNIT_ASSERT(eg.edges.size() == 6);
+
+    delete edgeData;
+
+
+}
+
+
+void EdgeBuilderTests::testMultiIndexBufMultiVertexBuf()
+{
+    /* This tests the edge builders ability to find shared edges when there are
+    both multiple index sets (submeshes) each using a different vertex buffer
+    (not using shared geoemtry).
+    */
+
+    VertexData vd[4];
+    IndexData id[4];
+    // Test pyramid
+    vd[0].vertexCount = 3;
+    vd[0].vertexStart = 0;
+    vd[0].vertexDeclaration = HardwareBufferManager::getSingleton().createVertexDeclaration();
+    vd[0].vertexDeclaration->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+    HardwareVertexBufferSharedPtr vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(sizeof(float)*3, 3, HardwareBuffer::HBU_STATIC,true);
+    vd[0].vertexBufferBinding->setBinding(0, vbuf);
+    float* pFloat = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD));
+    *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+    *pFloat++ = 50 ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+    *pFloat++ = 0  ; *pFloat++ = 100; *pFloat++ = 0  ;
+    vbuf->unlock();
+
+    vd[1].vertexCount = 3;
+    vd[1].vertexStart = 0;
+    vd[1].vertexDeclaration = HardwareBufferManager::getSingleton().createVertexDeclaration();
+    vd[1].vertexDeclaration->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+    vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(sizeof(float)*3, 3, HardwareBuffer::HBU_STATIC,true);
+    vd[1].vertexBufferBinding->setBinding(0, vbuf);
+    pFloat = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD));
+    *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+    *pFloat++ = 0  ; *pFloat++ = 100; *pFloat++ = 0  ;
+    *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = -50;
+    vbuf->unlock();
+
+    vd[2].vertexCount = 3;
+    vd[2].vertexStart = 0;
+    vd[2].vertexDeclaration = HardwareBufferManager::getSingleton().createVertexDeclaration();
+    vd[2].vertexDeclaration->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+    vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(sizeof(float)*3, 3, HardwareBuffer::HBU_STATIC,true);
+    vd[2].vertexBufferBinding->setBinding(0, vbuf);
+    pFloat = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD));
+    *pFloat++ = 50 ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+    *pFloat++ = 0  ; *pFloat++ = 100; *pFloat++ = 0  ;
+    *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = -50;
+    vbuf->unlock();
+
+    vd[3].vertexCount = 3;
+    vd[3].vertexStart = 0;
+    vd[3].vertexDeclaration = HardwareBufferManager::getSingleton().createVertexDeclaration();
+    vd[3].vertexDeclaration->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+    vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(sizeof(float)*3, 3, HardwareBuffer::HBU_STATIC,true);
+    vd[3].vertexBufferBinding->setBinding(0, vbuf);
+    pFloat = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD));
+    *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+    *pFloat++ = 50 ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+    *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = -50;
+    vbuf->unlock();
+
+    id[0].indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+        HardwareIndexBuffer::IT_16BIT, 3, HardwareBuffer::HBU_STATIC, true);
+    id[0].indexCount = 3;
+    id[0].indexStart = 0;
+    unsigned short* pIdx = static_cast<unsigned short*>(id[0].indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+    *pIdx++ = 0; *pIdx++ = 1; *pIdx++ = 2;
+    id[0].indexBuffer->unlock();
+
+    id[1].indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+        HardwareIndexBuffer::IT_16BIT, 3, HardwareBuffer::HBU_STATIC, true);
+    id[1].indexCount = 3;
+    id[1].indexStart = 0;
+    pIdx = static_cast<unsigned short*>(id[1].indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+    *pIdx++ = 0; *pIdx++ = 1; *pIdx++ = 2;
+    id[1].indexBuffer->unlock();
+
+    id[2].indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+        HardwareIndexBuffer::IT_16BIT, 3, HardwareBuffer::HBU_STATIC, true);
+    id[2].indexCount = 3;
+    id[2].indexStart = 0;
+    pIdx = static_cast<unsigned short*>(id[2].indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+    *pIdx++ = 0; *pIdx++ = 2; *pIdx++ = 1;
+    id[2].indexBuffer->unlock();
+
+    id[3].indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+        HardwareIndexBuffer::IT_16BIT, 3, HardwareBuffer::HBU_STATIC, true);
+    id[3].indexCount = 3;
+    id[3].indexStart = 0;
+    pIdx = static_cast<unsigned short*>(id[3].indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+    *pIdx++ = 0; *pIdx++ = 2; *pIdx++ = 1;
+    id[3].indexBuffer->unlock();
+
+    EdgeListBuilder edgeBuilder;
+    edgeBuilder.addVertexData(&vd[0]);
+    edgeBuilder.addVertexData(&vd[1]);
+    edgeBuilder.addVertexData(&vd[2]);
+    edgeBuilder.addVertexData(&vd[3]);
+    edgeBuilder.addIndexData(&id[0], 0);
+    edgeBuilder.addIndexData(&id[1], 1);
+    edgeBuilder.addIndexData(&id[2], 2);
+    edgeBuilder.addIndexData(&id[3], 3);
+    EdgeData* edgeData = edgeBuilder.build();
+
+    // Should be 4 groups
+    CPPUNIT_ASSERT(edgeData->edgeGroups.size() == 4);
+    // 4 tris
+    CPPUNIT_ASSERT(edgeData->triangles.size() == 4);
+    // 6 edges in total
+    CPPUNIT_ASSERT(
+        (edgeData->edgeGroups[0].edges.size() +
+        edgeData->edgeGroups[1].edges.size() +
+        edgeData->edgeGroups[2].edges.size() +
+        edgeData->edgeGroups[3].edges.size())
+                    == 6);
+
+    delete edgeData;
+
+
+}
Index: /Tests/OgreMain/src/FileSystemArchiveTests.cpp
===================================================================
--- /Tests/OgreMain/src/FileSystemArchiveTests.cpp	(revision 5)
+++ /Tests/OgreMain/src/FileSystemArchiveTests.cpp	(revision 5)
@@ -0,0 +1,279 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "FileSystemArchiveTests.h"
+#include "OgreFileSystem.h"
+#include "OgreException.h"
+
+// Regsiter the suite
+CPPUNIT_TEST_SUITE_REGISTRATION( FileSystemArchiveTests );
+
+void FileSystemArchiveTests::setUp()
+{
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+    testPath = "../../../../Tests/OgreMain/misc/ArchiveTest/";
+#else
+    testPath = "../../../Tests/OgreMain/misc/ArchiveTest/";
+#endif
+}
+void FileSystemArchiveTests::tearDown()
+{
+}
+
+void FileSystemArchiveTests::testListNonRecursive()
+{
+	try {
+		FileSystemArchive arch(testPath, "FileSystem");
+		arch.load();
+		StringVectorPtr vec = arch.list(false);
+
+		CPPUNIT_ASSERT_EQUAL((unsigned int)2, (unsigned int)vec->size());
+		CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), vec->at(0));
+		CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), vec->at(1));
+	}
+	catch (Exception& e)
+	{
+		std::cout << e.getFullDescription();
+	}
+
+}
+void FileSystemArchiveTests::testListRecursive()
+{
+    FileSystemArchive arch(testPath, "FileSystem");
+    arch.load();
+    StringVectorPtr vec = arch.list(true);
+
+    CPPUNIT_ASSERT_EQUAL((size_t)48, vec->size()); // 48 including CVS folders!
+    CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), vec->at(0));
+    CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), vec->at(1));
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file.material"), vec->at(2));
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file2.material"), vec->at(3));
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file3.material"), vec->at(22));
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file4.material"), vec->at(23));
+}
+void FileSystemArchiveTests::testListFileInfoNonRecursive()
+{
+    FileSystemArchive arch(testPath, "FileSystem");
+    arch.load();
+    FileInfoListPtr vec = arch.listFileInfo(false);
+
+    //CPPUNIT_ASSERT_EQUAL((size_t)2, vec->size());
+    //FileInfo& fi1 = vec->at(0);
+    //CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), fi1.filename);
+    //CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), fi1.basename);
+    //CPPUNIT_ASSERT_EQUAL(StringUtil::BLANK, fi1.path);
+    //CPPUNIT_ASSERT_EQUAL((size_t)130, fi1.compressedSize);
+    //CPPUNIT_ASSERT_EQUAL((size_t)130, fi1.uncompressedSize);
+
+    //FileInfo& fi2 = vec->at(1);
+    //CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), fi2.filename);
+    //CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), fi2.basename);
+    //CPPUNIT_ASSERT_EQUAL(StringUtil::BLANK, fi2.path);
+    //CPPUNIT_ASSERT_EQUAL((size_t)156, fi2.compressedSize);
+    //CPPUNIT_ASSERT_EQUAL((size_t)156, fi2.uncompressedSize);
+}
+void FileSystemArchiveTests::testListFileInfoRecursive()
+{
+    FileSystemArchive arch(testPath, "FileSystem");
+    arch.load();
+    FileInfoListPtr vec = arch.listFileInfo(true);
+
+    CPPUNIT_ASSERT_EQUAL((size_t)48, vec->size()); // 48 including CVS folders!
+    FileInfo& fi1 = vec->at(0);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), fi1.filename);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), fi1.basename);
+    CPPUNIT_ASSERT_EQUAL(StringUtil::BLANK, fi1.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)130, fi1.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)130, fi1.uncompressedSize);
+
+    FileInfo& fi2 = vec->at(1);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), fi2.filename);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), fi2.basename);
+    CPPUNIT_ASSERT_EQUAL(StringUtil::BLANK, fi2.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)156, fi2.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)156, fi2.uncompressedSize);
+
+    FileInfo& fi3 = vec->at(2);
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file.material"), fi3.filename);
+    CPPUNIT_ASSERT_EQUAL(String("file.material"), fi3.basename);
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/"), fi3.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi3.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi3.uncompressedSize);
+
+    FileInfo& fi4 = vec->at(3);
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file2.material"), fi4.filename);
+    CPPUNIT_ASSERT_EQUAL(String("file2.material"), fi4.basename);
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/"), fi4.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi4.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi4.uncompressedSize);
+
+
+    FileInfo& fi5 = vec->at(22);
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file3.material"), fi5.filename);
+    CPPUNIT_ASSERT_EQUAL(String("file3.material"), fi5.basename);
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/"), fi5.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi5.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi5.uncompressedSize);
+
+    FileInfo& fi6 = vec->at(23);
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file4.material"), fi6.filename);
+    CPPUNIT_ASSERT_EQUAL(String("file4.material"), fi6.basename);
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/"), fi6.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi6.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi6.uncompressedSize);
+}
+void FileSystemArchiveTests::testFindNonRecursive()
+{
+    FileSystemArchive arch(testPath, "FileSystem");
+    arch.load();
+    StringVectorPtr vec = arch.find("*.txt", false);
+
+    CPPUNIT_ASSERT_EQUAL((size_t)2, vec->size());
+    CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), vec->at(0));
+    CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), vec->at(1));
+}
+void FileSystemArchiveTests::testFindRecursive()
+{
+    FileSystemArchive arch(testPath, "FileSystem");
+    arch.load();
+    StringVectorPtr vec = arch.find("*.material", true);
+
+    CPPUNIT_ASSERT_EQUAL((size_t)4, vec->size());
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file.material"), vec->at(0));
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file2.material"), vec->at(1));
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file3.material"), vec->at(2));
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file4.material"), vec->at(3));
+}
+void FileSystemArchiveTests::testFindFileInfoNonRecursive()
+{
+    FileSystemArchive arch(testPath, "FileSystem");
+    arch.load();
+    FileInfoListPtr vec = arch.findFileInfo("*.txt", false);
+
+    CPPUNIT_ASSERT_EQUAL((size_t)2, vec->size());
+    FileInfo& fi1 = vec->at(0);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), fi1.filename);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), fi1.basename);
+    CPPUNIT_ASSERT_EQUAL(StringUtil::BLANK, fi1.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)130, fi1.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)130, fi1.uncompressedSize);
+
+    FileInfo& fi2 = vec->at(1);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), fi2.filename);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), fi2.basename);
+    CPPUNIT_ASSERT_EQUAL(StringUtil::BLANK, fi2.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)156, fi2.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)156, fi2.uncompressedSize);
+}
+void FileSystemArchiveTests::testFindFileInfoRecursive()
+{
+    FileSystemArchive arch(testPath, "FileSystem");
+    arch.load();
+    FileInfoListPtr vec = arch.findFileInfo("*.material", true);
+
+    CPPUNIT_ASSERT_EQUAL((size_t)4, vec->size());
+
+    FileInfo& fi3 = vec->at(0);
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file.material"), fi3.filename);
+    CPPUNIT_ASSERT_EQUAL(String("file.material"), fi3.basename);
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/"), fi3.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi3.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi3.uncompressedSize);
+
+    FileInfo& fi4 = vec->at(1);
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file2.material"), fi4.filename);
+    CPPUNIT_ASSERT_EQUAL(String("file2.material"), fi4.basename);
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/"), fi4.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi4.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi4.uncompressedSize);
+
+
+    FileInfo& fi5 = vec->at(2);
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file3.material"), fi5.filename);
+    CPPUNIT_ASSERT_EQUAL(String("file3.material"), fi5.basename);
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/"), fi5.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi5.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi5.uncompressedSize);
+
+    FileInfo& fi6 = vec->at(3);
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file4.material"), fi6.filename);
+    CPPUNIT_ASSERT_EQUAL(String("file4.material"), fi6.basename);
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/"), fi6.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi6.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi6.uncompressedSize);
+}
+void FileSystemArchiveTests::testFileRead()
+{
+    FileSystemArchive arch(testPath, "FileSystem");
+    arch.load();
+
+    DataStreamPtr stream = arch.open("rootfile.txt");
+    CPPUNIT_ASSERT_EQUAL(String("this is line 1 in file 1"), stream->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 2 in file 1"), stream->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 3 in file 1"), stream->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 4 in file 1"), stream->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 5 in file 1"), stream->getLine());
+    CPPUNIT_ASSERT_EQUAL(StringUtil::BLANK, stream->getLine()); // blank at end of file
+    CPPUNIT_ASSERT(stream->eof());
+
+}
+void FileSystemArchiveTests::testReadInterleave()
+{
+    // Test overlapping reads from same archive
+
+    FileSystemArchive arch(testPath, "FileSystem");
+    arch.load();
+
+    // File 1
+    DataStreamPtr stream1 = arch.open("rootfile.txt");
+    CPPUNIT_ASSERT_EQUAL(String("this is line 1 in file 1"), stream1->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 2 in file 1"), stream1->getLine());
+
+    // File 2
+    DataStreamPtr stream2 = arch.open("rootfile2.txt");
+    CPPUNIT_ASSERT_EQUAL(String("this is line 1 in file 2"), stream2->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 2 in file 2"), stream2->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 3 in file 2"), stream2->getLine());
+
+
+    // File 1
+    CPPUNIT_ASSERT_EQUAL(String("this is line 3 in file 1"), stream1->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 4 in file 1"), stream1->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 5 in file 1"), stream1->getLine());
+    CPPUNIT_ASSERT_EQUAL(StringUtil::BLANK, stream1->getLine()); // blank at end of file
+    CPPUNIT_ASSERT(stream1->eof());
+
+
+    // File 2
+    CPPUNIT_ASSERT_EQUAL(String("this is line 4 in file 2"), stream2->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 5 in file 2"), stream2->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 6 in file 2"), stream2->getLine());
+    CPPUNIT_ASSERT_EQUAL(StringUtil::BLANK, stream2->getLine()); // blank at end of file
+    CPPUNIT_ASSERT(stream2->eof());
+
+}
Index: /Tests/OgreMain/src/MaterialScriptCompilerTests.cpp
===================================================================
--- /Tests/OgreMain/src/MaterialScriptCompilerTests.cpp	(revision 5)
+++ /Tests/OgreMain/src/MaterialScriptCompilerTests.cpp	(revision 5)
@@ -0,0 +1,261 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#include "OgreMaterialManager.h"
+#include "OgreHighLevelGpuProgramManager.h"
+#include "OgreGpuProgramManager.h"
+#include "MaterialScriptCompilerTests.h"
+#include "OgreStringConverter.h"
+
+#define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0]))
+
+// Regsiter the suite
+CPPUNIT_TEST_SUITE_REGISTRATION( MaterialScriptCompilerTests );
+
+void MaterialScriptCompilerTests::setUp()
+{
+}
+void MaterialScriptCompilerTests::tearDown()
+{
+}
+
+void MaterialScriptCompilerTests::testPositionToNextSymbol()
+{
+  struct test1result{
+    const char character;
+    const int line;
+  };
+
+  const String TestStr1 = "   \n\r  //c  \n\r// test\n\r  \t  c   - \n\r ,  e";
+  const test1result test1results[] = {
+    {'c', 4},
+    {'-', 4},
+    {',', 5},
+    {'e', 5}
+  };
+
+  // first test: see if positionToNextSymbol can find a valid Symbol
+  mSource = &TestStr1;
+  mCharPos = 0;
+  size_t resultID = 0;
+  mCurrentLine = 1;
+  mEndOfSource = mSource->length();
+  while (positionToNextLexeme()) {
+      CPPUNIT_ASSERT_MESSAGE( "test " + StringConverter::toString(resultID) + "  character found: " + (*mSource)[mCharPos] +
+          "  Line:%d  : " + StringConverter::toString(mCurrentLine)
+          , ((*mSource)[mCharPos] == test1results[resultID].character) && (mCurrentLine==test1results[resultID].line) );
+    resultID++;
+    mCharPos++;
+  }
+
+}
+
+void MaterialScriptCompilerTests::testIsFloatValue(void)
+{
+  struct testfloatresult{
+    const String teststr;
+    const float fvalue;
+    const size_t charsize;
+    testfloatresult(const String& _teststr, const float _fvalue, const size_t _charsize)
+        : teststr(_teststr)
+        , fvalue(_fvalue)
+        , charsize(_charsize)
+        {};
+  };
+
+  testfloatresult testfloatresults[] = {
+    testfloatresult("1 test", 1.0f, 1),
+    testfloatresult("2.3f test", 2.3f, 3),
+    testfloatresult("-0.5 test", -0.5f, 4),
+    testfloatresult(" 23.6 test", 23.6f, 5),
+    testfloatresult("  -0.021 test", -0.021f, 8),
+    testfloatresult("12 test", 12.0f, 2),
+    testfloatresult("3test", 3.0f, 1)
+  };
+
+  float fvalue = 0;
+  size_t charsize = 0;
+  mCharPos = 0;
+  size_t testsize = ARRAYSIZE(testfloatresults);
+  for(size_t resultID=0; resultID<testsize; resultID++)
+  {
+    mSource = &testfloatresults[resultID].teststr;
+    isFloatValue(fvalue, charsize);
+    CPPUNIT_ASSERT_MESSAGE( "test " + StringConverter::toString(resultID) + " value returned: " + StringConverter::toString(fvalue)
+        , fvalue == testfloatresults[resultID].fvalue);
+    CPPUNIT_ASSERT_MESSAGE( "test " + StringConverter::toString(resultID) + " char size returned: " + StringConverter::toString(charsize)
+        , charsize == testfloatresults[resultID].charsize);
+  }
+
+}
+
+void MaterialScriptCompilerTests::testIsLexemeMatch(void)
+{
+  const String TestStr = "material test";
+  const String TestSymbols = "material";
+
+  mSource = &TestStr;
+  mCharPos = 0;
+  CPPUNIT_ASSERT(isLexemeMatch(TestSymbols, false));
+  CPPUNIT_ASSERT(isLexemeMatch(TestSymbols, true));
+  mCharPos = 1;
+  CPPUNIT_ASSERT(!isLexemeMatch(TestSymbols, false));
+  CPPUNIT_ASSERT(!isLexemeMatch(TestSymbols, true));
+
+}
+
+void MaterialScriptCompilerTests::testCompileMaterialScript()
+{
+    Math* mth = new Math();
+    if (!ResourceGroupManager::getSingletonPtr())
+        new ResourceGroupManager();
+
+    if (!MaterialManager::getSingletonPtr())
+    {
+        new MaterialManager();
+        MaterialManager::getSingleton().initialise();
+    }
+
+    if (!HighLevelGpuProgramManager::getSingletonPtr())
+        new HighLevelGpuProgramManager();
+
+    //if (!GpuProgramManager::getSingletonPtr())
+    //    new GpuProgramManager();
+
+
+    const String simpleScript =
+        "vertex_program boo cg { \n"
+        "  source program.cg \n"
+        "  entry_point main \n"
+        "  profiles vs_1_1 arbvp1 \n"
+        " } \n"
+        "material test2 { \n"
+        " receive_shadows on lod_distances 100 203.6 700 \n"
+        " set_texture_alias foo-bar MyTexture.png \n"
+        " transparency_casts_shadows on \n"
+        " technique { scheme hdr lod_index 1 \n"
+        " pass pass-1 { \n"
+        "   ambient 0 1 0.5\n"
+        "   ambient 0 1 0.5 1 \n"
+        "   ambient vertexcolour \n"
+        "   diffuse 0.5 1.0 0 0.5 \n"
+        "   specular vertexcolour 40 \n"
+        "   specular 1 1 1 18 \n"
+        "   specular 0 1 0 1 128 \n"
+        "   scene_blend alpha_blend \n"
+        "   scene_blend one src_alpha \n"
+        "   depth_check on \n"
+        "   depth_write off \n"
+        "   depth_func less_equal \n"
+        "   depth_bias 5 \n"
+        "   alpha_rejection not_equal 127 \n"
+        "   cull_hardware clockwise \n"
+        "   cull_software front \n"
+        "   lighting on \n"
+        "   shading gouraud \n"
+        "   polygon_mode wireframe \n"
+        "   fog_override false \n"
+        "   fog_override true exp 1 1 1 0.002 100 10000 \n"
+        "   fog_override true \n"
+        "   colour_write off \n"
+        "   max_lights 7 \n"
+        "   iteration once \n"
+        "   iteration once_per_light point \n"
+        "   iteration 5 \n"
+        "   iteration 5 per_light point \n"
+        "   point_size 3 \n"
+        "   point_sprites on \n"
+        "   point_size_attenuation on \n"
+        "   point_size_min 1.00 \n"
+        "   point_size_max 10 \n"
+        "   texture_unit first {texture MyAlphaTexture.png alpha tex_coord_set 0 } \n"
+        "   texture_unit first { \n"
+        "       cubic_texture cubemap_fr.jpg \t cubemap_bk.jpg cubemap_lf.jpg cubemap_rt.jpg cubemap_up.jpg cubemap_dn.jpg separateUV \n"
+        "   } \n"
+        "   texture_unit \"second one\" { \n"
+        "       texture_alias foo-bar \n"
+        "       anim_texture MyAlphaTexture2.png 4 6.5 \n"
+        "       anim_texture MyAlphaTexture2.png MyAlphaTexture6.png    MyAlphaTexture9.png 6.5 \n"
+        "       anim_texture MyAlphaTexture2.png MyAlphaTexture6.png \n"
+        "           MyAlphaTexture9.png MyAlphaTexture11.png MyAlphaTexture12.png 6.5 \n"
+        "       tex_address_mode wrap \n"
+        "       tex_address_mode wrap mirror \n"
+        "       tex_address_mode wrap mirror border \n"
+        "       tex_border_colour 1.0 0.5 0.7 1.0 \n"
+        "       filtering trilinear \n"
+        "       filtering none \n"
+        "       filtering linear point none \n"
+        "       max_anisotropy 5 \n"
+        "       colour_op replace \n"
+        "       colour_op add \n"
+        "       colour_op_ex add_signed src_manual src_texture 1 1 1 1\n"
+        "       colour_op_multipass_fallback one one_minus_dest_alpha \n"
+        "       alpha_op_ex add_signed src_manual src_current 0.5 \n"
+        "       env_map cubic_reflection \n"
+        "       scroll 5 2 \n"
+        "       scroll_anim  2 4 \n"
+        "       rotate 2.3 \n"
+        "       rotate_anim 0.5 \n"
+        "       scale 1 1.4 \n"
+        "       wave_xform scale_x sine 1.0 0.2 0.0 5.0 \n"
+        "       transform 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 \n"
+
+        "       } \n"
+        "   texture_unit \"second one\" { \n"
+        "       anim_texture MyAlphaTexture2.png MyAlphaTexture3.png 6.5} \n"
+        " \n"
+        " } } } \n"
+        "material clone 1 : test2 {} \n"
+        // GPU Programs
+        "vertex_program miny cg { \n"
+        "  source program.cg \n"
+        "  entry_point main \n"
+        "  profiles vs_1_1 arbvp1 \n"
+        " } \n"
+        "vertex_program tiny hlsl { \n"
+        "  source program.hlsl \n"
+        "  entry_point main \n"
+        "  target vs_1_1 \n"
+        "  default_params { \n"
+        "    param_named google float4 0 1 2 3 \n"
+        "    param_indexed 1 int 0 \n"
+        "    param_indexed_auto 0 blah 0 \n"
+        "    param_named_auto chicken mustard \n"
+        "  } \n"
+        " } \n"
+        "fragment_program better glsl { \n"
+        "   source program.glsl \n"
+        "   attach specular.glsl \n"
+        " } \n"
+        ;
+    CPPUNIT_ASSERT(compile(simpleScript, "MaterialScriptTest"));
+
+    delete mth;
+}
+
Index: /Tests/OgreMain/src/PixelFormatTests.cpp
===================================================================
--- /Tests/OgreMain/src/PixelFormatTests.cpp	(revision 5)
+++ /Tests/OgreMain/src/PixelFormatTests.cpp	(revision 5)
@@ -0,0 +1,227 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "PixelFormatTests.h"
+#include <cstdlib>
+
+// Register the suite
+CPPUNIT_TEST_SUITE_REGISTRATION( PixelFormatTests );
+
+void PixelFormatTests::setUp()
+{
+    size = 4096;
+    randomData = new uint8[size];
+    temp = new uint8[size];
+    temp2 = new uint8[size];
+    // Generate reproducable random data
+    srand(0);
+    for(unsigned int x=0; x<size; x++)
+        randomData[x] = (uint8)rand();
+}
+
+void PixelFormatTests::tearDown()
+{
+    delete [] randomData;
+    delete [] temp;
+    delete [] temp2;
+}
+
+
+void PixelFormatTests::testIntegerPackUnpack()
+{
+
+}
+
+void PixelFormatTests::testFloatPackUnpack()
+{
+    // Float32
+    float data[4] = {1.0f, 2.0f, 3.0f, 4.0f};
+    float r,g,b,a;
+    PixelUtil::unpackColour(&r, &g, &b, &a, PF_FLOAT32_RGBA, data);
+    CPPUNIT_ASSERT_EQUAL(r, 1.0f);
+    CPPUNIT_ASSERT_EQUAL(g, 2.0f);
+    CPPUNIT_ASSERT_EQUAL(b, 3.0f);
+    CPPUNIT_ASSERT_EQUAL(a, 4.0f);
+
+    // Float16
+    setupBoxes(PF_A8B8G8R8, PF_FLOAT16_RGBA);
+    dst2.format = PF_A8B8G8R8;
+    unsigned int eob = src.getWidth()*4;
+
+    PixelUtil::bulkPixelConversion(src, dst1);
+    PixelUtil::bulkPixelConversion(dst1, dst2);
+
+    // Locate errors
+    std::stringstream s;
+    int x;
+    for(x=0; x<eob; x++) {
+        if(temp2[x] != randomData[x])
+            s << std::hex << std::setw(2) << std::setfill('0') << (unsigned int) randomData[x]
+              << "!= " << std::hex << std::setw(2) << std::setfill('0') << (unsigned int) temp2[x] << " ";
+    }
+
+    // src and dst2 should match
+    CPPUNIT_ASSERT_MESSAGE("PF_FLOAT16_RGBA<->PF_A8B8G8R8 conversion was not lossless "+s.str(),
+        memcmp(src.data, dst2.data, eob) == 0);
+}
+
+// Pure 32 bit float precision brute force pixel conversion; for comparision
+void naiveBulkPixelConversion(const PixelBox &src, const PixelBox &dst)
+{
+    uint8 *srcptr = static_cast<uint8*>(src.data);
+    uint8 *dstptr = static_cast<uint8*>(dst.data);
+    unsigned int srcPixelSize = PixelUtil::getNumElemBytes(src.format);
+    unsigned int dstPixelSize = PixelUtil::getNumElemBytes(dst.format);
+
+    // Calculate pitches+skips in bytes
+    int srcRowSkipBytes = src.getRowSkip()*srcPixelSize;
+    int srcSliceSkipBytes = src.getSliceSkip()*srcPixelSize;
+
+    int dstRowSkipBytes = dst.getRowSkip()*dstPixelSize;
+    int dstSliceSkipBytes = dst.getSliceSkip()*dstPixelSize;
+
+	// The brute force fallback
+	float r,g,b,a;
+	for(size_t z=src.front; z<src.back; z++)
+	{
+		for(size_t y=src.top; y<src.bottom; y++)
+		{
+			for(size_t x=src.left; x<src.right; x++)
+			{
+				PixelUtil::unpackColour(&r, &g, &b, &a, src.format, srcptr);
+				PixelUtil::packColour(r, g, b, a, dst.format, dstptr);
+				srcptr += srcPixelSize;
+				dstptr += dstPixelSize;
+			}
+			srcptr += srcRowSkipBytes;
+			dstptr += dstRowSkipBytes;
+		}
+		srcptr += srcSliceSkipBytes;
+		dstptr += dstSliceSkipBytes;
+	}
+
+}
+
+void PixelFormatTests::setupBoxes(PixelFormat srcFormat, PixelFormat dstFormat)
+{
+    unsigned int width = (size-4) / PixelUtil::getNumElemBytes(srcFormat);
+    unsigned int width2 = (size-4) / PixelUtil::getNumElemBytes(dstFormat);
+    if(width > width2)
+        width = width2;
+
+    src = PixelBox(width, 1, 1, srcFormat, randomData);
+	dst1 = PixelBox(width, 1, 1, dstFormat, temp);
+	dst2 = PixelBox(width, 1, 1, dstFormat, temp2);
+
+}
+
+void PixelFormatTests::testCase(PixelFormat srcFormat, PixelFormat dstFormat)
+{
+    setupBoxes(srcFormat, dstFormat);
+    // Check end of buffer
+    unsigned int eob = dst1.getWidth()*PixelUtil::getNumElemBytes(dstFormat);
+    temp[eob] = (unsigned char)0x56;
+    temp[eob+1] = (unsigned char)0x23;
+
+    //std::cerr << "["+PixelUtil::getFormatName(srcFormat)+"->"+PixelUtil::getFormatName(dstFormat)+"]" << " " << eob << std::endl;
+
+    // Do pack/unpacking with both naive and optimized version
+    PixelUtil::bulkPixelConversion(src, dst1);
+    naiveBulkPixelConversion(src, dst2);
+
+    CPPUNIT_ASSERT_EQUAL(temp[eob], (unsigned char)0x56);
+    CPPUNIT_ASSERT_EQUAL(temp[eob+1], (unsigned char)0x23);
+
+    std::stringstream s;
+    int x;
+    s << "src=";
+    for(x=0; x<16; x++)
+        s << std::hex << std::setw(2) << std::setfill('0') << (unsigned int) randomData[x];
+    s << " dst=";
+    for(x=0; x<16; x++)
+        s << std::hex << std::setw(2) << std::setfill('0') << (unsigned int) temp[x];
+    s << " dstRef=";
+    for(x=0; x<16; x++)
+        s << std::hex << std::setw(2) << std::setfill('0') << (unsigned int) temp2[x];
+    s << " ";
+
+    // Compare result
+    CPPUNIT_ASSERT_MESSAGE("Conversion mismatch ["+PixelUtil::getFormatName(srcFormat)+"->"+PixelUtil::getFormatName(dstFormat)+"] "+s.str(),
+        memcmp(dst1.data, dst2.data, eob) == 0);
+}
+
+void PixelFormatTests::testBulkConversion()
+{
+    // Self match
+    testCase(PF_A8R8G8B8, PF_A8R8G8B8);
+    // Optimized
+	testCase(PF_A8R8G8B8,PF_A8B8G8R8);
+	testCase(PF_A8R8G8B8,PF_B8G8R8A8);
+	testCase(PF_A8R8G8B8,PF_R8G8B8A8);
+	testCase(PF_A8B8G8R8,PF_A8R8G8B8);
+	testCase(PF_A8B8G8R8,PF_B8G8R8A8);
+	testCase(PF_A8B8G8R8,PF_R8G8B8A8);
+	testCase(PF_B8G8R8A8,PF_A8R8G8B8);
+	testCase(PF_B8G8R8A8,PF_A8B8G8R8);
+	testCase(PF_B8G8R8A8,PF_R8G8B8A8);
+	testCase(PF_R8G8B8A8,PF_A8R8G8B8);
+	testCase(PF_R8G8B8A8,PF_A8B8G8R8);
+	testCase(PF_R8G8B8A8,PF_B8G8R8A8);
+
+    testCase(PF_A8B8G8R8, PF_L8);
+    testCase(PF_L8, PF_A8B8G8R8);
+    testCase(PF_A8R8G8B8, PF_L8);
+    testCase(PF_L8, PF_A8R8G8B8);
+    testCase(PF_B8G8R8A8, PF_L8);
+    testCase(PF_L8, PF_B8G8R8A8);
+    testCase(PF_L8, PF_L16);
+    testCase(PF_L16, PF_L8);
+    testCase(PF_R8G8B8, PF_B8G8R8);
+    testCase(PF_B8G8R8, PF_R8G8B8);
+    testCase(PF_B8G8R8, PF_R8G8B8);
+    testCase(PF_R8G8B8, PF_B8G8R8);
+    testCase(PF_R8G8B8, PF_A8R8G8B8);
+    testCase(PF_B8G8R8, PF_A8R8G8B8);
+    testCase(PF_R8G8B8, PF_A8B8G8R8);
+    testCase(PF_B8G8R8, PF_A8B8G8R8);
+    testCase(PF_R8G8B8, PF_B8G8R8A8);
+    testCase(PF_B8G8R8, PF_B8G8R8A8);
+	testCase(PF_A8R8G8B8, PF_R8G8B8);
+	testCase(PF_A8R8G8B8, PF_B8G8R8);
+	testCase(PF_X8R8G8B8, PF_A8R8G8B8);
+	testCase(PF_X8R8G8B8, PF_A8B8G8R8);
+	testCase(PF_X8R8G8B8, PF_B8G8R8A8);
+	testCase(PF_X8R8G8B8, PF_R8G8B8A8);
+	testCase(PF_X8B8G8R8, PF_A8R8G8B8);
+	testCase(PF_X8B8G8R8, PF_A8B8G8R8);
+	testCase(PF_X8B8G8R8, PF_B8G8R8A8);
+	testCase(PF_X8B8G8R8, PF_R8G8B8A8);
+
+    //CPPUNIT_ASSERT_MESSAGE("Conversion mismatch", false);
+}
+
Index: /Tests/OgreMain/src/RadixSort.cpp
===================================================================
--- /Tests/OgreMain/src/RadixSort.cpp	(revision 5)
+++ /Tests/OgreMain/src/RadixSort.cpp	(revision 5)
@@ -0,0 +1,205 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "RadixSortTests.h"
+#include "OgreRadixSort.h"
+#include "OgreMath.h"
+
+using namespace Ogre;
+
+// Regsiter the suite
+CPPUNIT_TEST_SUITE_REGISTRATION( RadixSortTests );
+
+void RadixSortTests::setUp()
+{
+	srand(time(0));
+}
+void RadixSortTests::tearDown()
+{
+}
+
+class FloatSortFunctor
+{
+public:
+	float operator()(const float& p) const
+	{
+		return p;
+	}
+
+};
+class IntSortFunctor
+{
+public:
+	int operator()(const int& p) const
+	{
+		return p;
+	}
+
+};
+
+class UnsignedIntSortFunctor
+{
+public:
+	unsigned int operator()(const unsigned int& p) const
+	{
+		return p;
+	}
+
+};
+
+
+void RadixSortTests::testFloatVector()
+{
+	std::vector<float> container;
+	FloatSortFunctor func;
+	RadixSort<std::vector<float>, float, float> sorter;
+
+	for (int i = 0; i < 1000; ++i)
+	{
+		container.push_back((float)Math::RangeRandom(-1e10, 1e10));
+	}
+
+	sorter.sort(container, func);
+
+	std::vector<float>::iterator v = container.begin();
+	float lastValue = *v++;
+	for (;v != container.end(); ++v)
+	{
+		CPPUNIT_ASSERT(*v >= lastValue);
+		lastValue = *v;
+	}
+
+
+}
+void RadixSortTests::testFloatList()
+{
+	std::list<float> container;
+	FloatSortFunctor func;
+	RadixSort<std::list<float>, float, float> sorter;
+
+	for (int i = 0; i < 1000; ++i)
+	{
+		container.push_back((float)Math::RangeRandom(-1e10, 1e10));
+	}
+
+	sorter.sort(container, func);
+
+	std::list<float>::iterator v = container.begin();
+	float lastValue = *v++;
+	for (;v != container.end(); ++v)
+	{
+		CPPUNIT_ASSERT(*v >= lastValue);
+		lastValue = *v;
+	}
+}
+void RadixSortTests::testUnsignedIntList()
+{
+	std::list<unsigned int> container;
+	UnsignedIntSortFunctor func;
+	RadixSort<std::list<unsigned int>, unsigned int, unsigned int> sorter;
+
+	for (int i = 0; i < 1000; ++i)
+	{
+		container.push_back((unsigned int)Math::RangeRandom(0, 1e10));
+	}
+
+	sorter.sort(container, func);
+
+	std::list<unsigned int>::iterator v = container.begin();
+	unsigned int lastValue = *v++;
+	for (;v != container.end(); ++v)
+	{
+		CPPUNIT_ASSERT(*v >= lastValue);
+		lastValue = *v;
+	}
+}
+void RadixSortTests::testIntList()
+{
+	std::list<int> container;
+	IntSortFunctor func;
+	RadixSort<std::list<int>, int, int> sorter;
+
+	for (int i = 0; i < 1000; ++i)
+	{
+		container.push_back((int)Math::RangeRandom(-1e10, 1e10));
+	}
+
+	sorter.sort(container, func);
+
+	std::list<int>::iterator v = container.begin();
+	int lastValue = *v++;
+	for (;v != container.end(); ++v)
+	{
+		CPPUNIT_ASSERT(*v >= lastValue);
+		lastValue = *v;
+	}
+}
+void RadixSortTests::testUnsignedIntVector()
+{
+	std::vector<unsigned int> container;
+	UnsignedIntSortFunctor func;
+	RadixSort<std::vector<unsigned int>, unsigned int, unsigned int> sorter;
+
+	for (int i = 0; i < 1000; ++i)
+	{
+		container.push_back((unsigned int)Math::RangeRandom(0, 1e10));
+	}
+
+	sorter.sort(container, func);
+
+	std::vector<unsigned int>::iterator v = container.begin();
+	unsigned int lastValue = *v++;
+	for (;v != container.end(); ++v)
+	{
+		CPPUNIT_ASSERT(*v >= lastValue);
+		lastValue = *v;
+	}
+}
+void RadixSortTests::testIntVector()
+{
+	std::vector<int> container;
+	IntSortFunctor func;
+	RadixSort<std::vector<int>, int, int> sorter;
+
+	for (int i = 0; i < 1000; ++i)
+	{
+		container.push_back((int)Math::RangeRandom(-1e10, 1e10));
+	}
+
+	sorter.sort(container, func);
+
+	std::vector<int>::iterator v = container.begin();
+	int lastValue = *v++;
+	for (;v != container.end(); ++v)
+	{
+		CPPUNIT_ASSERT(*v >= lastValue);
+		lastValue = *v;
+	}
+}
+
+
Index: /Tests/OgreMain/src/StringTests.cpp
===================================================================
--- /Tests/OgreMain/src/StringTests.cpp	(revision 5)
+++ /Tests/OgreMain/src/StringTests.cpp	(revision 5)
@@ -0,0 +1,225 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "StringTests.h"
+#include "OgreStringConverter.h"
+#include "OgreVector3.h"
+#include "OgreQuaternion.h"
+#include "OgreMatrix4.h"
+#include "OgreColourValue.h"
+
+using namespace Ogre;
+
+// Regsiter the suite
+CPPUNIT_TEST_SUITE_REGISTRATION( StringTests );
+
+void StringTests::setUp()
+{
+	testFileNoPath = "testfile.txt";
+	testFileRelativePathUnix = "this/is/relative/testfile.txt";
+	testFileRelativePathWindows = "this\\is\\relative\\testfile.txt";
+	testFileAbsolutePathUnix = "/this/is/absolute/testfile.txt";
+	testFileAbsolutePathWindows = "c:\\this\\is\\absolute\\testfile.txt";
+}
+void StringTests::tearDown()
+{
+}
+
+void StringTests::testSplitFileNameNoPath()
+{
+	String basename, path;
+	StringUtil::splitFilename(testFileNoPath, basename, path);
+
+    CPPUNIT_ASSERT_EQUAL(testFileNoPath, basename);
+    CPPUNIT_ASSERT(path.empty());
+}
+void StringTests::testSplitFileNameRelativePath()
+{
+	String basename, path;
+	// Unix
+	StringUtil::splitFilename(testFileRelativePathUnix, basename, path);
+    CPPUNIT_ASSERT_EQUAL(String("testfile.txt"), basename);
+    CPPUNIT_ASSERT_EQUAL(String("this/is/relative/"), path);
+	// Windows
+	StringUtil::splitFilename(testFileRelativePathWindows, basename, path);
+    CPPUNIT_ASSERT_EQUAL(String("testfile.txt"), basename);
+    CPPUNIT_ASSERT_EQUAL(String("this/is/relative/"), path);
+
+}
+void StringTests::testSplitFileNameAbsolutePath()
+{
+	String basename, path;
+	// Unix
+	StringUtil::splitFilename(testFileAbsolutePathUnix, basename, path);
+    CPPUNIT_ASSERT_EQUAL(String("testfile.txt"), basename);
+    CPPUNIT_ASSERT_EQUAL(String("/this/is/absolute/"), path);
+	// Windows
+	StringUtil::splitFilename(testFileAbsolutePathWindows, basename, path);
+    CPPUNIT_ASSERT_EQUAL(String("testfile.txt"), basename);
+	CPPUNIT_ASSERT_EQUAL(String("c:/this/is/absolute/"), path);
+}
+
+void StringTests::testMatchCaseSensitive()
+{
+	// Test positive
+	CPPUNIT_ASSERT(StringUtil::match(testFileNoPath, testFileNoPath, true));
+	// Test negative
+	String upperCase = testFileNoPath;
+    StringUtil::toUpperCase(upperCase);
+	CPPUNIT_ASSERT(!StringUtil::match(testFileNoPath, upperCase, true));
+}
+void StringTests::testMatchCaseInSensitive()
+{
+	// Test positive
+	CPPUNIT_ASSERT(StringUtil::match(testFileNoPath, testFileNoPath, false));
+	// Test positive
+	String upperCase = testFileNoPath;
+	StringUtil::toUpperCase(upperCase);
+	CPPUNIT_ASSERT(StringUtil::match(testFileNoPath, upperCase, false));
+}
+void StringTests::testMatchGlobAll()
+{
+	CPPUNIT_ASSERT(StringUtil::match(testFileNoPath, "*", true));
+}
+void StringTests::testMatchGlobStart()
+{
+	CPPUNIT_ASSERT(StringUtil::match(testFileNoPath, "*stfile.txt", true));
+	CPPUNIT_ASSERT(!StringUtil::match(testFileNoPath, "*astfile.txt", true));
+}
+void StringTests::testMatchGlobEnd()
+{
+	CPPUNIT_ASSERT(StringUtil::match(testFileNoPath, "testfile.*", true));
+	CPPUNIT_ASSERT(!StringUtil::match(testFileNoPath, "testfile.d*", true));
+}
+void StringTests::testMatchGlobStartAndEnd()
+{
+	CPPUNIT_ASSERT(StringUtil::match(testFileNoPath, "*stfile.*", true));
+	CPPUNIT_ASSERT(!StringUtil::match(testFileNoPath, "*astfile.d*", true));
+}
+void StringTests::testMatchGlobMiddle()
+{
+	CPPUNIT_ASSERT(StringUtil::match(testFileNoPath, "test*.txt", true));
+	CPPUNIT_ASSERT(!StringUtil::match(testFileNoPath, "last*.txt*", true));
+}
+void StringTests::testMatchSuperGlobtastic()
+{
+	CPPUNIT_ASSERT(StringUtil::match(testFileNoPath, "*e*tf*e.t*t", true));
+}
+void StringTests::testParseReal()
+{
+	Real r = 23.454;
+
+	String s = StringConverter::toString(r);
+	Real t = StringConverter::parseReal(s);
+
+	CPPUNIT_ASSERT_EQUAL(r, t);
+
+
+}
+void StringTests::testParseInt()
+{
+
+	int r = 223546;
+
+	String s = StringConverter::toString(r);
+	int t = StringConverter::parseInt(s);
+
+	CPPUNIT_ASSERT_EQUAL(r, t);
+}
+void StringTests::testParseLong()
+{
+	long r = -223546325346456;
+
+	String s = StringConverter::toString(r);
+	long t = StringConverter::parseLong(s);
+
+	CPPUNIT_ASSERT_EQUAL(r, t);
+
+}
+void StringTests::testParseUnsignedLong()
+{
+	unsigned long r = 1223546325346456;
+
+	String s = StringConverter::toString(r);
+	unsigned long t = StringConverter::parseUnsignedLong(s);
+
+	CPPUNIT_ASSERT_EQUAL(r, t);
+
+}
+void StringTests::testParseVector3()
+{
+	Vector3 r(0.12, 3.22, -4.04);
+
+	String s = StringConverter::toString(r);
+	Vector3 t = StringConverter::parseVector3(s);
+
+	CPPUNIT_ASSERT_EQUAL(r, t);
+
+}
+void StringTests::testParseMatrix4()
+{
+	Matrix4 r(1.12, 0, 0, 34, 0, 0.87, 0, 20, 0, 0, 0.56, 10, 0, 0, 0, 1);
+
+	String s = StringConverter::toString(r);
+	Matrix4 t = StringConverter::parseMatrix4(s);
+
+	CPPUNIT_ASSERT_EQUAL(r, t);
+
+}
+void StringTests::testParseQuaternion()
+{
+	Quaternion r(1.12, 0.87, 0.67, 1);
+
+	String s = StringConverter::toString(r);
+	Quaternion t = StringConverter::parseQuaternion(s);
+
+	CPPUNIT_ASSERT_EQUAL(r, t);
+
+}
+void StringTests::testParseBool()
+{
+	bool r = true;
+	String s = StringConverter::toString(r);
+	bool t = StringConverter::parseBool(s);
+	CPPUNIT_ASSERT_EQUAL(r, t);
+
+	r = false;
+	s = StringConverter::toString(r);
+	t = StringConverter::parseBool(s);
+	CPPUNIT_ASSERT_EQUAL(r, t);
+
+}
+void StringTests::testParseColourValue()
+{
+	ColourValue r(0.34, 0.44, 0.77, 1.0);
+
+	String s = StringConverter::toString(r);
+	ColourValue t = StringConverter::parseColourValue(s);
+	CPPUNIT_ASSERT_EQUAL(r, t);
+
+}
Index: /Tests/OgreMain/src/VectorTests.cpp
===================================================================
--- /Tests/OgreMain/src/VectorTests.cpp	(revision 5)
+++ /Tests/OgreMain/src/VectorTests.cpp	(revision 5)
@@ -0,0 +1,106 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "VectorTests.h"
+#include "OgreVector2.h"
+#include "OgreVector3.h"
+#include "OgreVector4.h"
+
+// Register the suite
+CPPUNIT_TEST_SUITE_REGISTRATION( VectorTests );
+
+using namespace Ogre;
+
+void VectorTests::setUp()
+{
+}
+
+void VectorTests::tearDown()
+{
+}
+
+
+void VectorTests::testVector2Scaler()
+{
+    CPPUNIT_ASSERT_EQUAL(Vector2(1, 1) + Vector2(2, 2), Vector2(3, 3));
+    CPPUNIT_ASSERT_EQUAL(1 + Vector2(2), Vector2(3, 3));
+    Vector2 v1;
+    v1 = 1;
+    CPPUNIT_ASSERT_EQUAL(v1, Vector2(1, 1));
+    v1 = 0.0;
+    CPPUNIT_ASSERT_EQUAL(v1, Vector2::ZERO);
+    v1 += 3;
+    CPPUNIT_ASSERT_EQUAL(v1, Vector2(3, 3));
+
+    v1 = 3 - Vector2(2);
+    CPPUNIT_ASSERT_EQUAL(v1, Vector2(1));
+    v1 = Vector2(5) - 7;
+    CPPUNIT_ASSERT_EQUAL(v1, Vector2(-2));
+    v1 -= 4;
+    CPPUNIT_ASSERT_EQUAL(v1, Vector2(-6));
+}
+
+void VectorTests::testVector3Scaler()
+{
+    CPPUNIT_ASSERT_EQUAL(Vector3(1, 1, 1) + Vector3(2, 2, 2), Vector3(3, 3, 3));
+    CPPUNIT_ASSERT_EQUAL(1 + Vector3(2), Vector3(3, 3, 3));
+    Vector3 v1;
+    v1 = 1;
+    CPPUNIT_ASSERT_EQUAL(v1, Vector3(1));
+    v1 = 0.0;
+    CPPUNIT_ASSERT_EQUAL(v1, Vector3::ZERO);
+    v1 += 3;
+    CPPUNIT_ASSERT_EQUAL(v1, Vector3(3));
+
+    v1 = 3 - Vector3(2);
+    CPPUNIT_ASSERT_EQUAL(v1, Vector3(1));
+    v1 = Vector3(5) - 7;
+    CPPUNIT_ASSERT_EQUAL(v1, Vector3(-2));
+    v1 -= 4;
+    CPPUNIT_ASSERT_EQUAL(v1, Vector3(-6));
+}
+
+void VectorTests::testVector4Scaler()
+{
+    CPPUNIT_ASSERT_EQUAL(Vector4(1, 1, 1, 1) + Vector4(2, 2, 2, 2), Vector4(3, 3, 3, 3));
+    CPPUNIT_ASSERT_EQUAL(1 + Vector4(2, 2, 2, 2), Vector4(3, 3, 3, 3));
+    Vector4 v1;
+    v1 = 1;
+    CPPUNIT_ASSERT_EQUAL(v1, Vector4(1, 1, 1, 1));
+    v1 = 0.0;
+    CPPUNIT_ASSERT_EQUAL(v1, Vector4(0,0,0,0));
+    v1 += 3;
+    CPPUNIT_ASSERT_EQUAL(v1, Vector4(3,3,3,3));
+
+    v1 = 3 - Vector4(2,2,2,2);
+    CPPUNIT_ASSERT_EQUAL(v1, Vector4(1,1,1,1));
+    v1 = Vector4(5,5,5,5) - 7;
+    CPPUNIT_ASSERT_EQUAL(v1, Vector4(-2,-2,-2,-2));
+    v1 -= 4;
+    CPPUNIT_ASSERT_EQUAL(v1, Vector4(-6,-6,-6,-6));
+}
Index: /Tests/OgreMain/src/ZipArchiveTests.cpp
===================================================================
--- /Tests/OgreMain/src/ZipArchiveTests.cpp	(revision 5)
+++ /Tests/OgreMain/src/ZipArchiveTests.cpp	(revision 5)
@@ -0,0 +1,272 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#include "ZipArchiveTests.h"
+#include "OgreZip.h"
+
+using namespace Ogre;
+
+// Regsiter the suite
+CPPUNIT_TEST_SUITE_REGISTRATION( ZipArchiveTests );
+
+void ZipArchiveTests::setUp()
+{
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+    testPath = "../../../../Tests/OgreMain/misc/ArchiveTest.zip";
+#else
+    testPath = "../../../Tests/OgreMain/misc/ArchiveTest.zip";
+#endif
+}
+void ZipArchiveTests::tearDown()
+{
+}
+
+void ZipArchiveTests::testListNonRecursive()
+{
+    ZipArchive arch(testPath, "Zip");
+    arch.load();
+    StringVectorPtr vec = arch.list(false);
+
+    CPPUNIT_ASSERT_EQUAL((size_t)2, vec->size());
+    CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), vec->at(0));
+    CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), vec->at(1));
+
+}
+void ZipArchiveTests::testListRecursive()
+{
+    ZipArchive arch(testPath, "Zip");
+    arch.load();
+    StringVectorPtr vec = arch.list(true);
+
+    CPPUNIT_ASSERT_EQUAL((size_t)6, vec->size());
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file.material"), vec->at(0));
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file2.material"), vec->at(1));
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file3.material"), vec->at(2));
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file4.material"), vec->at(3));
+    CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), vec->at(4));
+    CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), vec->at(5));
+}
+void ZipArchiveTests::testListFileInfoNonRecursive()
+{
+    ZipArchive arch(testPath, "Zip");
+    arch.load();
+    FileInfoListPtr vec = arch.listFileInfo(false);
+
+    CPPUNIT_ASSERT_EQUAL((size_t)2, vec->size());
+    FileInfo& fi1 = vec->at(0);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), fi1.filename);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), fi1.basename);
+    CPPUNIT_ASSERT_EQUAL(StringUtil::BLANK, fi1.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)40, fi1.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)130, fi1.uncompressedSize);
+
+    FileInfo& fi2 = vec->at(1);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), fi2.filename);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), fi2.basename);
+    CPPUNIT_ASSERT_EQUAL(StringUtil::BLANK, fi2.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)45, fi2.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)156, fi2.uncompressedSize);
+}
+void ZipArchiveTests::testListFileInfoRecursive()
+{
+    ZipArchive arch(testPath, "Zip");
+    arch.load();
+    FileInfoListPtr vec = arch.listFileInfo(true);
+
+    CPPUNIT_ASSERT_EQUAL((size_t)6, vec->size());
+    FileInfo& fi3 = vec->at(0);
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file.material"), fi3.filename);
+    CPPUNIT_ASSERT_EQUAL(String("file.material"), fi3.basename);
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/"), fi3.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi3.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi3.uncompressedSize);
+
+    FileInfo& fi4 = vec->at(1);
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file2.material"), fi4.filename);
+    CPPUNIT_ASSERT_EQUAL(String("file2.material"), fi4.basename);
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/"), fi4.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi4.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi4.uncompressedSize);
+
+
+    FileInfo& fi5 = vec->at(2);
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file3.material"), fi5.filename);
+    CPPUNIT_ASSERT_EQUAL(String("file3.material"), fi5.basename);
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/"), fi5.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi5.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi5.uncompressedSize);
+
+    FileInfo& fi6 = vec->at(3);
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file4.material"), fi6.filename);
+    CPPUNIT_ASSERT_EQUAL(String("file4.material"), fi6.basename);
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/"), fi6.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi6.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi6.uncompressedSize);
+
+    FileInfo& fi1 = vec->at(4);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), fi1.filename);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), fi1.basename);
+    CPPUNIT_ASSERT_EQUAL(StringUtil::BLANK, fi1.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)40, fi1.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)130, fi1.uncompressedSize);
+
+    FileInfo& fi2 = vec->at(5);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), fi2.filename);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), fi2.basename);
+    CPPUNIT_ASSERT_EQUAL(StringUtil::BLANK, fi2.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)45, fi2.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)156, fi2.uncompressedSize);
+
+}
+void ZipArchiveTests::testFindNonRecursive()
+{
+    ZipArchive arch(testPath, "Zip");
+    arch.load();
+    StringVectorPtr vec = arch.find("*.txt", false);
+
+    CPPUNIT_ASSERT_EQUAL((size_t)2, vec->size());
+    CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), vec->at(0));
+    CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), vec->at(1));
+}
+void ZipArchiveTests::testFindRecursive()
+{
+    ZipArchive arch(testPath, "Zip");
+    arch.load();
+    StringVectorPtr vec = arch.find("*.material", true);
+
+    CPPUNIT_ASSERT_EQUAL((size_t)4, vec->size());
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file.material"), vec->at(0));
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file2.material"), vec->at(1));
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file3.material"), vec->at(2));
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file4.material"), vec->at(3));
+}
+void ZipArchiveTests::testFindFileInfoNonRecursive()
+{
+    ZipArchive arch(testPath, "Zip");
+    arch.load();
+    FileInfoListPtr vec = arch.findFileInfo("*.txt", false);
+
+    CPPUNIT_ASSERT_EQUAL((size_t)2, vec->size());
+    FileInfo& fi1 = vec->at(0);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), fi1.filename);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), fi1.basename);
+    CPPUNIT_ASSERT_EQUAL(StringUtil::BLANK, fi1.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)40, fi1.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)130, fi1.uncompressedSize);
+
+    FileInfo& fi2 = vec->at(1);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), fi2.filename);
+    CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), fi2.basename);
+    CPPUNIT_ASSERT_EQUAL(StringUtil::BLANK, fi2.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)45, fi2.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)156, fi2.uncompressedSize);
+}
+void ZipArchiveTests::testFindFileInfoRecursive()
+{
+    ZipArchive arch(testPath, "Zip");
+    arch.load();
+    FileInfoListPtr vec = arch.findFileInfo("*.material", true);
+
+    CPPUNIT_ASSERT_EQUAL((size_t)4, vec->size());
+
+    FileInfo& fi3 = vec->at(0);
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file.material"), fi3.filename);
+    CPPUNIT_ASSERT_EQUAL(String("file.material"), fi3.basename);
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/"), fi3.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi3.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi3.uncompressedSize);
+
+    FileInfo& fi4 = vec->at(1);
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file2.material"), fi4.filename);
+    CPPUNIT_ASSERT_EQUAL(String("file2.material"), fi4.basename);
+    CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/"), fi4.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi4.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi4.uncompressedSize);
+
+
+    FileInfo& fi5 = vec->at(2);
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file3.material"), fi5.filename);
+    CPPUNIT_ASSERT_EQUAL(String("file3.material"), fi5.basename);
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/"), fi5.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi5.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi5.uncompressedSize);
+
+    FileInfo& fi6 = vec->at(3);
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file4.material"), fi6.filename);
+    CPPUNIT_ASSERT_EQUAL(String("file4.material"), fi6.basename);
+    CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/"), fi6.path);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi6.compressedSize);
+    CPPUNIT_ASSERT_EQUAL((size_t)0, fi6.uncompressedSize);
+}
+void ZipArchiveTests::testFileRead()
+{
+    ZipArchive arch(testPath, "Zip");
+    arch.load();
+
+    DataStreamPtr stream = arch.open("rootfile.txt");
+    CPPUNIT_ASSERT_EQUAL(String("this is line 1 in file 1"), stream->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 2 in file 1"), stream->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 3 in file 1"), stream->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 4 in file 1"), stream->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 5 in file 1"), stream->getLine());
+    CPPUNIT_ASSERT(stream->eof());
+
+}
+void ZipArchiveTests::testReadInterleave()
+{
+    // Test overlapping reads from same archive
+
+    ZipArchive arch(testPath, "Zip");
+    arch.load();
+
+    // File 1
+    DataStreamPtr stream1 = arch.open("rootfile.txt");
+    CPPUNIT_ASSERT_EQUAL(String("this is line 1 in file 1"), stream1->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 2 in file 1"), stream1->getLine());
+
+    // File 2
+    DataStreamPtr stream2 = arch.open("rootfile2.txt");
+    CPPUNIT_ASSERT_EQUAL(String("this is line 1 in file 2"), stream2->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 2 in file 2"), stream2->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 3 in file 2"), stream2->getLine());
+
+
+    // File 1
+    CPPUNIT_ASSERT_EQUAL(String("this is line 3 in file 1"), stream1->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 4 in file 1"), stream1->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 5 in file 1"), stream1->getLine());
+    CPPUNIT_ASSERT(stream1->eof());
+
+
+    // File 2
+    CPPUNIT_ASSERT_EQUAL(String("this is line 4 in file 2"), stream2->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 5 in file 2"), stream2->getLine());
+    CPPUNIT_ASSERT_EQUAL(String("this is line 6 in file 2"), stream2->getLine());
+    CPPUNIT_ASSERT(stream2->eof());
+
+}
Index: /Tests/OgreTests.sln
===================================================================
--- /Tests/OgreTests.sln	(revision 5)
+++ /Tests/OgreTests.sln	(revision 5)
@@ -0,0 +1,21 @@
+Microsoft Visual Studio Solution File, Format Version 7.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestOgreMain", "TestOgreMain.vcproj", "{0DC410D4-73C1-46F5-9A23-F4026B0B08F7}"
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		ConfigName.0 = Debug
+		ConfigName.1 = Release
+	EndGlobalSection
+	GlobalSection(ProjectDependencies) = postSolution
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{0DC410D4-73C1-46F5-9A23-F4026B0B08F7}.Debug.ActiveCfg = Debug|Win32
+		{0DC410D4-73C1-46F5-9A23-F4026B0B08F7}.Debug.Build.0 = Debug|Win32
+		{0DC410D4-73C1-46F5-9A23-F4026B0B08F7}.Release.ActiveCfg = Release|Win32
+		{0DC410D4-73C1-46F5-9A23-F4026B0B08F7}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
Index: /Tests/OgreTests_vc8.sln
===================================================================
--- /Tests/OgreTests_vc8.sln	(revision 5)
+++ /Tests/OgreTests_vc8.sln	(revision 5)
@@ -0,0 +1,19 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestOgreMain", "TestOgreMain_vc8.vcproj", "{0DC410D4-73C1-46F5-9A23-F4026B0B08F7}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{0DC410D4-73C1-46F5-9A23-F4026B0B08F7}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0DC410D4-73C1-46F5-9A23-F4026B0B08F7}.Debug|Win32.Build.0 = Debug|Win32
+		{0DC410D4-73C1-46F5-9A23-F4026B0B08F7}.Release|Win32.ActiveCfg = Release|Win32
+		{0DC410D4-73C1-46F5-9A23-F4026B0B08F7}.Release|Win32.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: /Tests/PlayPen/include/AnimationBlender.h
===================================================================
--- /Tests/PlayPen/include/AnimationBlender.h	(revision 5)
+++ /Tests/PlayPen/include/AnimationBlender.h	(revision 5)
@@ -0,0 +1,40 @@
+// From http://www.ogre3d.org/wiki/index.php/AnimationBlender
+
+#include "OgreEntity.h"
+
+using namespace Ogre;
+
+class AnimationBlender
+{
+public:
+	enum BlendingTransition
+	{
+		BlendSwitch,         // stop source and start dest
+		BlendWhileAnimating,   // cross fade, blend source animation out while blending destination animation in
+		BlendThenAnimate      // blend source to first frame of dest, when done, start dest anim
+	};
+
+private:
+	Entity *mEntity;
+	AnimationState *mSource;
+	AnimationState *mTarget;
+
+	BlendingTransition mTransition;
+
+	bool loop;
+
+	~AnimationBlender() {}
+
+public: 
+	Real mTimeleft, mDuration;
+
+	bool complete;
+
+	void blend( const String &animation, BlendingTransition transition, Real duration, bool loop );
+	void addTime( Real );
+	Real getProgress() { return mTimeleft/ mDuration; }
+	AnimationState *getSource() { return mSource; }
+	AnimationState *getTarget() { return mTarget; }
+	AnimationBlender( Entity *);
+	void init( const String &animation );
+};
Index: /Tests/PlayPen/include/StaticPluginLoader.h
===================================================================
--- /Tests/PlayPen/include/StaticPluginLoader.h	(revision 5)
+++ /Tests/PlayPen/include/StaticPluginLoader.h	(revision 5)
@@ -0,0 +1,142 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+/*
+-----------------------------------------------------------------------------
+Filename:    StaticPluginLoader.h
+Description: Utility class to load plugins statically
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __StaticPluginLoader_H__
+#define __StaticPluginLoader_H__
+
+#include "Ogre.h"
+#include "OgreConfigFile.h"
+// Static plugin headers
+#ifdef ENABLE_PLUGIN_CgProgramManager
+#  include "OgreCgPlugin.h"
+#endif
+#ifdef ENABLE_PLUGIN_OctreeSceneManager
+#  include "OgreOctreePlugin.h"
+#endif
+#ifdef ENABLE_PLUGIN_ParticleFX
+#  include "OgreParticleFXPlugin.h"
+#endif
+#ifdef ENABLE_PLUGIN_BSPSceneManager
+#  include "OgreBspSceneManagerPlugin.h"
+#endif
+#ifdef ENABLE_PLUGIN_GL
+#  include "OgreGLPlugin.h"
+#endif
+#ifdef ENABLE_PLUGIN_Direct3D9
+#  include "OgreD3D9Plugin.h"
+#endif
+
+namespace Ogre
+{
+	/** Utility class for loading some plugins statically.
+	@remarks
+		When loading plugins statically, you are limited to loading plugins 
+		that are known about at compile time. You should define preprocessor
+		symbols depending on which plugins you want to load - the symbol being
+		ENABLE_PLUGIN_<pluginname>, with pluginname being the usual name of the
+		plugin DLL (no file extension, no debug suffix, and without the Plugin_ 
+		or RenderSystem_ prefix.)
+	*/
+	class StaticPluginLoader
+	{
+	protected:
+#ifdef ENABLE_PLUGIN_CgProgramManager
+		CgPlugin* mCgPlugin;
+#endif
+#ifdef ENABLE_PLUGIN_OctreeSceneManager
+		OctreePlugin* mOctreePlugin;
+#endif
+#ifdef ENABLE_PLUGIN_ParticleFX
+		ParticleFXPlugin* mParticleFXPlugin;
+#endif
+#ifdef ENABLE_PLUGIN_BSPSceneManager
+		BspSceneManagerPlugin* mBSPPlugin;
+#endif
+#ifdef ENABLE_PLUGIN_GL
+		GLPlugin* mGLPlugin;
+#endif
+#ifdef ENABLE_PLUGIN_Direct3D9
+		D3D9Plugin* mD3D9Plugin;
+#endif
+	public:
+		StaticPluginLoader() {}
+
+		/** Load all the enabled plugins against the passed in root object. */
+		void load(Root& root)
+		{
+#ifdef ENABLE_PLUGIN_GL
+			mGLPlugin = new GLPlugin();
+			root.installPlugin(mGLPlugin);
+#endif
+#ifdef ENABLE_PLUGIN_Direct3D9
+			mD3D9Plugin = new D3D9Plugin();
+			root.installPlugin(mD3D9Plugin);
+#endif
+#ifdef ENABLE_PLUGIN_CgProgramManager
+			mCgPlugin = new CgPlugin();
+			root.installPlugin(mCgPlugin);
+#endif
+#ifdef ENABLE_PLUGIN_OctreeSceneManager
+			mOctreePlugin = new OctreePlugin();
+			root.installPlugin(mOctreePlugin);
+#endif
+#ifdef ENABLE_PLUGIN_ParticleFX
+			mParticleFXPlugin = new ParticleFXPlugin();
+			root.installPlugin(mParticleFXPlugin);
+#endif
+#ifdef ENABLE_PLUGIN_BSPSceneManager
+			mBSPPlugin = new BspSceneManagerPlugin();
+			root.installPlugin(mBSPPlugin);
+#endif
+		}
+
+		void unload()
+		{
+			// don't unload plugins, since Root will have done that. Destroy here.
+#ifdef ENABLE_PLUGIN_BSPSceneManager
+			delete mBSPPlugin;
+#endif
+#ifdef ENABLE_PLUGIN_ParticleFX
+			delete mParticleFXPlugin;
+#endif
+#ifdef ENABLE_PLUGIN_OctreeSceneManager
+			delete mOctreePlugin;
+#endif
+#ifdef ENABLE_PLUGIN_CgProgramManager
+			delete mCgPlugin;
+#endif
+#ifdef ENABLE_PLUGIN_Direct3D9
+			delete mD3D9Plugin;
+#endif
+#ifdef ENABLE_PLUGIN_GL
+			delete mGLPlugin;
+#endif
+
+		}
+
+
+
+	};
+
+}
+
+
+#endif
+
Index: /Tests/PlayPen/scripts/PlayPen.cbp
===================================================================
--- /Tests/PlayPen/scripts/PlayPen.cbp	(revision 5)
+++ /Tests/PlayPen/scripts/PlayPen.cbp	(revision 5)
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="5" />
+	<Project>
+		<Option title="Playpen" />
+		<Option default_target="" />
+		<Option compiler="gcc" />
+		<Option virtualFolders="" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\Samples\Common\bin\Debug\PlayPen.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\..\Samples\Common\bin\Debug" />
+				<Option object_output="..\obj\debug" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\Samples\Common\bin\Release\PlayPen.exe" prefix_auto="0" extension_auto="0" />
+				<Option working_dir="..\..\..\Samples\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+				</Linker>
+			</Target>
+		</Build>
+		<VirtualTargets>
+			<Add alias="All" targets="Debug;Release;" />
+		</VirtualTargets>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-pipe" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Samples\Common\include" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\PlayPen.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+	</Project>
+</CodeBlocks_project_file>
Index: /Tests/PlayPen/scripts/PlayPen.vcproj
===================================================================
--- /Tests/PlayPen/scripts/PlayPen.vcproj	(revision 5)
+++ /Tests/PlayPen/scripts/PlayPen.vcproj	(revision 5)
@@ -0,0 +1,293 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="PlayPen"
+	ProjectGUID="{430448E6-E03B-4645-B505-A4857368BB93}"
+	RootNamespace="PlayPen"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\..\Samples\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/PlayPen.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/PlayPen.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\..\Samples\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/PlayPen.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\Bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\..\Samples\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\RenderSystems\GL\include;..\..\..\RenderSystems\GL\src\glsl\include;..\..\..\RenderSystems\Direct3D9\include;..\..\..\Plugins\OctreeSceneManager\include;..\..\..\Plugins\ParticleFX\include;..\..\..\Plugins\BSPSceneManager\include;..\..\..\Plugins\CgProgramManager\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;OGRE_STATIC_LIB"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMainStatic_d.lib OIS_d.lib OgreWin32Resources_d.res RenderSystem_GLStatic_d.lib RenderSystem_Direct3D9Static_d.lib Plugin_OctreeSceneManagerStatic_d.lib Plugin_BSPSceneManagerStatic_d.lib Plugin_ParticleFXStatic_d.lib Plugin_CgProgramManagerStatic_d.lib FreeImaged.lib zziplibd.lib freetype230_D.lib OPENGL32.lib GLU32.lib d3d9.lib d3dx9.lib dxerr9.lib dxguid.lib cg.lib"
+				OutputFile="$(OutDir)/PlayPenStatic.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="..\..\..\lib;..\..\..\Dependencies\lib\Debug"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/PlayPen.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\Bin\Debug"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;..\..\..\Samples\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\RenderSystems\GL\include;..\..\..\RenderSystems\GL\src\glsl\include;..\..\..\RenderSystems\Direct3D9\include;..\..\..\Plugins\OctreeSceneManager\include;..\..\..\Plugins\ParticleFX\include;..\..\..\Plugins\BSPSceneManager\include;..\..\..\Plugins\CgProgramManager\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;OGRE_STATIC_LIB"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMainStatic.lib OIS.lib OgreWin32Resources.res RenderSystem_GLStatic.lib RenderSystem_Direct3D9Static.lib Plugin_OctreeSceneManagerStatic.lib Plugin_BSPSceneManagerStatic.lib Plugin_ParticleFXStatic.lib Plugin_CgProgramManagerStatic.lib FreeImage.lib zziplib.lib freetype230.lib OPENGL32.lib GLU32.lib d3d9.lib d3dx9.lib dxerr9.lib dxguid.lib cg.lib"
+				OutputFile="$(OutDir)/PlayPenStatic.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\..\..\lib;..\..\..\Dependencies\lib\Release"
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\Bin\Release"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\AnimationBlender.cpp">
+			</File>
+			<File
+				RelativePath="..\src\PlayPen.cpp">
+			</File>
+			<File
+				RelativePath="..\src\WindowEmbedding.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\AnimationBlender.h">
+			</File>
+			<File
+				RelativePath="..\..\..\Samples\Common\include\ExampleApplication.h">
+			</File>
+			<File
+				RelativePath="..\..\..\Samples\Common\include\ExampleFrameListener.h">
+			</File>
+			<File
+				RelativePath="..\..\..\Samples\Common\include\ExampleLoadingBar.h">
+			</File>
+			<File
+				RelativePath="..\include\StaticPluginLoader.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Tests/PlayPen/scripts/PlayPen_stlp.cbp
===================================================================
--- /Tests/PlayPen/scripts/PlayPen_stlp.cbp	(revision 5)
+++ /Tests/PlayPen/scripts/PlayPen_stlp.cbp	(revision 5)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="4" />
+	<Project>
+		<Option title="Playpen" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\..\..\Samples\Common\bin\Debug\PlayPen.exe" />
+				<Option working_dir="..\..\..\Samples\Common\bin\Debug" />
+				<Option object_output="..\obj\debug" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option includeInTargetAll="1" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-D_DEBUG" />
+					<Add option="-D_STLP_DEBUG" />
+				</Compiler>
+				<Linker>
+					<Add library="OgreMain_d" />
+					<Add library="stlportstlg.5.0" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\..\..\Samples\Common\bin\Release\PlayPen.exe" />
+				<Option working_dir="..\..\..\Samples\Common\bin\Release" />
+				<Option object_output="..\obj\Release" />
+				<Option type="0" />
+				<Option compiler="gcc" />
+				<Option includeInTargetAll="1" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-DNDEBUG" />
+				</Compiler>
+				<Linker>
+					<Add option="-s" />
+					<Add library="OgreMain" />
+					<Add library="stlport.5.0" />
+				</Linker>
+			</Target>
+		</Build>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-fident" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-D_STLP_USE_DYNAMIC_LIB" />
+			<Add option="-DWIN32" />
+			<Add option="-D_WINDOWS" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+			<Add directory="..\..\..\OgreMain\include" />
+			<Add directory="..\..\..\Samples\Common\include" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\..\..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="..\src\PlayPen.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Extensions />
+	</Project>
+</CodeBlocks_project_file>
Index: /Tests/PlayPen/scripts/PlayPen_vc8.vcproj
===================================================================
--- /Tests/PlayPen/scripts/PlayPen_vc8.vcproj	(revision 5)
+++ /Tests/PlayPen/scripts/PlayPen_vc8.vcproj	(revision 5)
@@ -0,0 +1,447 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="PlayPen"
+	ProjectGUID="{430448E6-E03B-4645-B505-A4857368BB93}"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\Samples\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib OIS_d.lib"
+				OutputFile="$(OutDir)/PlayPen.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/PlayPen.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\..\Samples\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib OIS.lib"
+				OutputFile="$(OutDir)/PlayPen.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+				FixedBaseAddress="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\Bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="DebugStaticLib|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\include;..\..\..\Samples\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\RenderSystems\GL\include;..\..\..\RenderSystems\GL\src\glsl\include;..\..\..\RenderSystems\Direct3D9\include;..\..\..\Plugins\OctreeSceneManager\include;..\..\..\Plugins\ParticleFX\include;..\..\..\Plugins\BSPSceneManager\include;..\..\..\Plugins\CgProgramManager\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;OGRE_STATIC_LIB"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMainStatic_d.lib OIS_d.lib OgreWin32Resources_d.res RenderSystem_GLStatic_d.lib RenderSystem_Direct3D9Static_d.lib Plugin_OctreeSceneManagerStatic_d.lib Plugin_BSPSceneManagerStatic_d.lib Plugin_ParticleFXStatic_d.lib Plugin_CgProgramManagerStatic_d.lib"
+				OutputFile="$(OutDir)/PlayPenStatic.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\Debug&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/PlayPen.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\Bin\Debug"
+			/>
+		</Configuration>
+		<Configuration
+			Name="ReleaseStaticLib|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\include;..\..\..\Samples\Common\include;..\..\..\OgreMain\include;..\..\..\Dependencies\include;..\..\..\RenderSystems\GL\include;..\..\..\RenderSystems\GL\src\glsl\include;..\..\..\RenderSystems\Direct3D9\include;..\..\..\Plugins\OctreeSceneManager\include;..\..\..\Plugins\ParticleFX\include;..\..\..\Plugins\BSPSceneManager\include;..\..\..\Plugins\CgProgramManager\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;OGRE_STATIC_LIB"
+				StringPooling="true"
+				MinimalRebuild="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMainStatic.lib OIS.lib OgreWin32Resources.res RenderSystem_GLStatic.lib RenderSystem_Direct3D9Static.lib Plugin_OctreeSceneManagerStatic.lib Plugin_BSPSceneManagerStatic.lib Plugin_ParticleFXStatic.lib Plugin_CgProgramManagerStatic.lib"
+				OutputFile="$(OutDir)/PlayPenStatic.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\..\..\lib&quot;;&quot;..\..\..\Dependencies\lib\Release&quot;"
+				GenerateDebugInformation="false"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"
+				FixedBaseAddress="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				UseFAT32Workaround="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\Samples\Common\Bin\Release"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="..\src\AnimationBlender.cpp"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						FloatingPointModel="2"
+						DisableLanguageExtensions="false"
+						WarningLevel="4"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="ReleaseStaticLib|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						FloatingPointModel="2"
+						DisableLanguageExtensions="false"
+						WarningLevel="4"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\src\PlayPen.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\WindowEmbedding.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="..\include\AnimationBlender.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\Samples\Common\include\ExampleApplication.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\Samples\Common\include\ExampleFrameListener.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\Samples\Common\include\ExampleLoadingBar.h"
+				>
+			</File>
+			<File
+				RelativePath="..\include\StaticPluginLoader.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Tests/PlayPen/src/AnimationBlender.cpp
===================================================================
--- /Tests/PlayPen/src/AnimationBlender.cpp	(revision 5)
+++ /Tests/PlayPen/src/AnimationBlender.cpp	(revision 5)
@@ -0,0 +1,139 @@
+// from http://www.ogre3d.org/wiki/index.php/AnimationBlender
+
+#include "AnimationBlender.h"
+#include "OgreAnimationState.h"
+
+
+using namespace Ogre;
+
+
+void AnimationBlender::init(const String &animation)
+{
+	AnimationStateSet *set = mEntity->getAllAnimationStates();
+	AnimationStateIterator it = set->getAnimationStateIterator();
+	while(it.hasMoreElements())
+	{
+		AnimationState *anim = it.getNext();
+		anim->setEnabled(false);
+		anim->setWeight(0);
+		anim->setTimePosition(0);
+	}
+	mSource = mEntity->getAnimationState( animation );
+	mSource->setEnabled(true);
+	mSource->setWeight(1);
+	mTimeleft = 0;
+	mDuration = 1;
+	mTarget = 0;
+	complete=false;
+} 
+void AnimationBlender::blend( const String &animation, BlendingTransition transition, Real duration, bool l )
+{
+	loop=l;
+	if( transition == AnimationBlender::BlendSwitch )
+	{
+		if( mSource != 0 )
+			mSource->setEnabled(false);
+		mSource = mEntity->getAnimationState( animation );
+		mSource->setEnabled(true);
+		mSource->setWeight(1);
+		mSource->setTimePosition(0);
+		mTimeleft = 0;
+	} 
+	else 
+	{ 
+		AnimationState *newTarget = mEntity->getAnimationState( animation );
+		if( mTimeleft > 0 )
+		{
+			// oops, weren't finished yet
+			if( newTarget == mTarget )
+			{
+				// nothing to do! (ignoring duration here)
+			}
+			else if( newTarget == mSource )
+			{
+				// going back to the source state, so let's switch
+				mSource = mTarget;
+				mTarget = newTarget;
+				mTimeleft = mDuration - mTimeleft; // i'm ignoring the new duration here
+			}
+			else
+			{
+				// ok, newTarget is really new, so either we simply replace the target with this one, or
+				// we make the target the new source
+				if( mTimeleft < mDuration * 0.5 )
+				{
+					// simply replace the target with this one
+					mTarget->setEnabled(false);
+					mTarget->setWeight(0);
+				}
+				else
+				{
+					// old target becomes new source
+					mSource->setEnabled(false);
+					mSource->setWeight(0);
+					mSource = mTarget;
+				} 
+				mTarget = newTarget;
+				mTarget->setEnabled(true);
+				mTarget->setWeight( 1.0 - mTimeleft / mDuration );
+				mTarget->setTimePosition(0);
+			}
+		}
+		else
+		{
+			if (mSource == newTarget)
+			{
+				mTimeleft = 0;
+				return;
+			}
+			// assert( target == 0, "target should be 0 when not blending" )
+			// mSource->setEnabled(true);
+			// mSource->setWeight(1);
+			mTransition = transition;
+			mTimeleft = mDuration = duration;
+			mTarget = newTarget;
+			mTarget->setEnabled(true);
+			mTarget->setWeight(0);
+			mTarget->setTimePosition(0);
+		}
+	}
+}
+void AnimationBlender::addTime( Real time )
+{
+	if( mSource != 0 )
+	{
+		if( mTimeleft > 0 )
+		{
+			mTimeleft -= time;
+			if( mTimeleft < 0 )
+			{
+				// finish blending
+				mSource->setEnabled(false);
+				mSource->setWeight(0);
+				mSource = mTarget;
+				mSource->setEnabled(true);
+				mSource->setWeight(1);
+				mTarget = 0;
+			}
+			else
+			{
+				// still blending, advance weights
+				mSource->setWeight(mTimeleft / mDuration);
+				mTarget->setWeight(1.0 - mTimeleft / mDuration);
+				if(mTransition == AnimationBlender::BlendWhileAnimating)
+					mTarget->addTime(time);
+			}
+		}
+		if (mSource->getTimePosition() >= mSource->getLength())
+		{
+			complete=true;
+		}
+		else
+		{
+			complete=false;
+		}
+		mSource->addTime(time);
+		mSource->setLoop(loop);
+	}
+}
+AnimationBlender::AnimationBlender( Entity *entity ) : mEntity(entity) {}
Index: /Tests/PlayPen/src/PlayPen.cpp
===================================================================
--- /Tests/PlayPen/src/PlayPen.cpp	(revision 5)
+++ /Tests/PlayPen/src/PlayPen.cpp	(revision 5)
@@ -0,0 +1,6188 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/*
+-----------------------------------------------------------------------------
+Filename:    PlayPen.cpp
+Description: Somewhere to play in the sand...
+-----------------------------------------------------------------------------
+*/
+
+#include "ExampleApplication.h"
+#include "OgreProgressiveMesh.h"
+#include "OgreEdgeListBuilder.h"
+#include "OgreBillboardChain.h"
+#include "OgreTextAreaOverlayElement.h"
+#include "AnimationBlender.h"
+#include "OgreErrorDialog.h"
+#include "OgreFontManager.h"
+// Static plugins declaration section
+// Note that every entry in here adds an extra header / library dependency
+#ifdef OGRE_STATIC_LIB
+#  define ENABLE_PLUGIN_GL
+#  if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#    define ENABLE_PLUGIN_Direct3D9
+#  endif
+#  define ENABLE_PLUGIN_OctreeSceneManager
+#  define ENABLE_PLUGIN_BSPSceneManager
+#  define ENABLE_PLUGIN_ParticleFX
+#  define ENABLE_PLUGIN_CgProgramManager
+#endif
+#include "StaticPluginLoader.h"
+
+/*
+#include "OgreNoMemoryMacros.h"
+#include <ode/odecpp.h>
+#include <ode/odecpp_collision.h>
+#include "OgreMemoryMacros.h"
+*/
+
+/*
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#include "OgreNoMemoryMacros.h"
+#include <crtdbg.h>
+#endi*/
+
+#define NUM_TEST_NODES 5
+SceneNode* mTestNode[NUM_TEST_NODES] = {0,0,0,0,0};
+SceneNode* mLightNode = 0;
+SceneNode* mRootNode;
+SceneNode* camNode;
+Entity* mEntity;
+Real animTime = 0;
+Animation* mAnim = 0;
+std::vector<AnimationState*> mAnimStateList;
+AnimationState* mAnimState = 0;
+Overlay* mpOverlay;
+Entity* pPlaneEnt;
+Camera* testCam = 0;
+SceneNode* camPlaneNode[6];
+Light* mLight;
+IntersectionSceneQuery* intersectionQuery = 0;
+RaySceneQuery* rayQuery = 0;
+Entity* ball = 0;
+Vector3 ballVector;
+bool testreload = false;
+String testBackgroundLoadGroup;
+Sphere* projectionSphere = 0;
+ManualObject* scissorRect = 0;
+
+// Hacky globals
+GpuProgramParametersSharedPtr fragParams;
+GpuProgramParametersSharedPtr vertParams;
+MaterialPtr skin;
+Frustum* frustum = 0;
+Camera* theCam;
+Camera* reflectCam = 0;
+Camera* camera2 = 0;
+Bone* manuallyControlledBone = 0;
+AnimationBlender* animBlender = 0;
+String animBlendTarget[2];
+int animBlendTargetIndex;
+MovablePlane movablePlane("APlane");
+
+
+static const char* HeadPoses[] = {"upperboth", "upperleft", "upperright", "jaw", "face1", "face2"};
+static const char* PoseAnimationStateName = "HeadPoses";
+enum eHeadPose { DMG_BOTH, DMG_UPPER_LEFT, DMG_UPPER_RIGHT, DMG_JAW, FACE_1, FACE_2, NUM_HEAD_POSES };
+
+using namespace OIS;
+
+class RefractionTextureListener : public RenderTargetListener
+{
+public:
+    void preRenderTargetUpdate(const RenderTargetEvent& evt)
+    {
+        pPlaneEnt->setVisible(false);
+
+    }
+    void postRenderTargetUpdate(const RenderTargetEvent& evt)
+    {
+        pPlaneEnt->setVisible(true);
+    }
+
+};
+class ReflectionTextureListener : public RenderTargetListener
+{
+public:
+    void preRenderTargetUpdate(const RenderTargetEvent& evt)
+    {
+        static Plane reflectPlane(Vector3::UNIT_Y, -100);
+        pPlaneEnt->setVisible(false);
+        theCam->enableReflection(reflectPlane);
+
+    }
+    void postRenderTargetUpdate(const RenderTargetEvent& evt)
+    {
+        pPlaneEnt->setVisible(true);
+        theCam->disableReflection();
+    }
+
+};
+
+
+class PlayPenListener : public ExampleFrameListener, public ResourceBackgroundQueue::Listener
+{
+protected:
+	SceneManager* mSceneMgr;
+public:
+    PlayPenListener(SceneManager* mgr, RenderWindow* win, Camera* cam)
+        : ExampleFrameListener(win, cam),mSceneMgr(mgr)
+    {
+    }
+
+	/// Background load completed
+	void operationCompleted(BackgroundProcessTicket ticket)
+	{
+		mDebugText = "Background load complete";
+
+	}
+
+    bool frameStarted(const FrameEvent& evt)
+    {
+		//mMoveSpeed = 0.2;
+
+        if (!vertParams.isNull())
+        {
+            Matrix4 scaleMat = Matrix4::IDENTITY;
+            scaleMat[0][0] = 0.5f;
+            scaleMat[1][1] = -0.5f;
+            scaleMat[2][2] = 0.5f;
+            scaleMat[0][3] = 0.5f;
+            scaleMat[1][3] = 0.5f;
+            scaleMat[2][3] = 0.5f;
+            Matrix4 mat = frustum->getProjectionMatrixWithRSDepth() * 
+                frustum->getViewMatrix();
+            
+            
+            mat = scaleMat * mat;
+
+            vertParams->setNamedConstant("texViewProjMatrix", mat);
+
+
+
+        }
+
+		if (manuallyControlledBone)
+		{
+			manuallyControlledBone->yaw(Degree(evt.timeSinceLastFrame*100)); 
+		}
+
+
+		static float reloadtime = 10.0f;
+		if (testreload)
+		{
+			reloadtime -= evt.timeSinceLastFrame;
+			if (reloadtime <= 0)
+			{
+				Entity* e = mSceneMgr->getEntity("1");
+				e->getParentSceneNode()->detachObject("1");
+				e = mSceneMgr->getEntity("2");
+				e->getParentSceneNode()->detachObject("2");
+				mSceneMgr->destroyAllEntities();
+				ResourceGroupManager::getSingleton().unloadResourceGroup("Sinbad");
+				ResourceGroupManager::getSingleton().loadResourceGroup("Sinbad");
+
+				testreload = false;
+
+			}
+		}
+
+		static float backgroundLoadTime = 5.0f;
+		if (!testBackgroundLoadGroup.empty())
+		{
+			backgroundLoadTime -= evt.timeSinceLastFrame;
+			if (backgroundLoadTime < 0)
+			{
+				ResourceBackgroundQueue::getSingleton().loadResourceGroup(testBackgroundLoadGroup, this);
+				testBackgroundLoadGroup.clear();
+				mDebugText = "Background load queued";
+			}
+
+		}
+
+
+
+
+        bool ret = ExampleFrameListener::frameStarted(evt);
+
+		if (reflectCam)
+		{
+			reflectCam->setOrientation(mCamera->getOrientation());
+			reflectCam->setPosition(mCamera->getPosition());
+		}
+		if (camera2)
+		{
+			camera2->setOrientation(mCamera->getOrientation());
+			camera2->setPosition(mCamera->getPosition());
+		}
+
+
+		if (projectionSphere && scissorRect)
+		{
+			Real left, top, right, bottom;
+			mCamera->projectSphere(*projectionSphere, &left, &top, &right, &bottom);
+
+			scissorRect->beginUpdate(0);
+			scissorRect->position(left, top, 0);
+			scissorRect->position(right, top, 0);
+			scissorRect->position(right, bottom, 0);
+			scissorRect->position(left, bottom, 0);
+			scissorRect->position(left, top, 0);
+			scissorRect->end();
+
+
+		}
+
+		return ret;
+
+    }
+
+    
+    bool frameEnded(const FrameEvent& evt)
+    {
+
+
+
+        // local just to stop toggles flipping too fast
+        static Real timeUntilNextToggle = 0;
+        static bool animate = true;
+        static bool rotate = false;
+
+        static bool firstTime = true;
+
+        if (!firstTime)
+        {
+            //mCamera->yaw(20);
+        }
+        firstTime = false;
+
+        if (timeUntilNextToggle >= 0) 
+            timeUntilNextToggle -= evt.timeSinceLastFrame;
+
+		static bool mWireframe = false;
+		if (mKeyboard->isKeyDown(KC_G) && timeUntilNextToggle <= 0)
+        {
+			mWireframe = !mWireframe;
+			if (mWireframe)
+			{
+				mCamera->setPolygonMode(PM_WIREFRAME);
+			}
+			else
+			{
+				mCamera->setPolygonMode(PM_SOLID);
+			}
+			timeUntilNextToggle = 0.5;
+
+		}
+
+		if (mKeyboard->isKeyDown(KC_MINUS) && timeUntilNextToggle <= 0)
+		{
+			if (mWindow->isFullScreen())
+			{
+				mWindow->setFullscreen(false, 800, 600);
+			}
+			else
+			{
+				mWindow->setFullscreen(true, 1024, 768);
+			}
+			timeUntilNextToggle = 0.5;
+
+		}
+		if (mKeyboard->isKeyDown(KC_EQUALS) && timeUntilNextToggle <= 0)
+		{
+			mWindow->setFullscreen(true, 800, 600);
+			timeUntilNextToggle = 0.5;
+
+		}
+
+
+        MaterialPtr mat = MaterialManager::getSingleton().getByName("Core/StatsBlockBorder/Up");
+        mat->setDepthCheckEnabled(true);
+        mat->setDepthWriteEnabled(true);
+
+        for (int i = 0; i < NUM_TEST_NODES; ++i)
+        {
+            if (mTestNode[i] && rotate)
+            mTestNode[i]->yaw(Degree(evt.timeSinceLastFrame * 15));
+        }
+        
+        if (mAnimState && animate)
+            mAnimState->addTime(evt.timeSinceLastFrame);
+
+		if (animBlender && animate)
+		{
+			if (animBlender->getProgress() <= 0.0f)
+			{
+				animBlender->init(animBlendTarget[animBlendTargetIndex]);
+				animBlendTargetIndex = (animBlendTargetIndex + 1) % 2;
+				animBlender->blend(animBlendTarget[animBlendTargetIndex], AnimationBlender::BlendWhileAnimating, 10, false);
+			}
+			else
+			{
+				animBlender->addTime(evt.timeSinceLastFrame);
+			}
+		}
+
+		std::vector<AnimationState*>::iterator animi;
+		for (animi = mAnimStateList.begin(); animi != mAnimStateList.end(); ++animi)
+		{
+			(*animi)->addTime(evt.timeSinceLastFrame);
+		}
+
+        if (mKeyboard->isKeyDown(KC_R) && timeUntilNextToggle <= 0)
+        {
+            rotate = !rotate;
+            timeUntilNextToggle = 0.5;
+        }
+        if (mKeyboard->isKeyDown(KC_1) && timeUntilNextToggle <= 0)
+        {
+            animate = !animate;
+            timeUntilNextToggle = 0.5;
+        }
+
+
+        if (rayQuery)
+        {
+		    static std::set<Entity*> lastEnts;
+		    rayQuery->setRay(mCamera->getCameraToViewportRay(0.5, 0.5));
+
+		    // Reset last set
+		    for (std::set<Entity*>::iterator lasti = lastEnts.begin();
+				    lasti != lastEnts.end(); ++lasti)
+		    {
+			    (*lasti)->setMaterialName("Examples/OgreLogo");
+		    }
+		    lastEnts.clear();
+    		
+    			
+		    RaySceneQueryResult& results = rayQuery->execute();
+		    for (RaySceneQueryResult::iterator mov = results.begin();
+				    mov != results.end(); ++mov)
+		    {
+                if (mov->movable)
+                {
+			        if (mov->movable->getMovableType() == "Entity")
+			        {
+				        Entity* ent = static_cast<Entity*>(mov->movable);
+				        lastEnts.insert(ent);
+				        ent->setMaterialName("Examples/TextureEffect2");
+        						
+			        }
+                }
+		    }
+        }
+
+        if (intersectionQuery)
+        {
+            static std::set<Entity*> lastEnts;
+
+            // Reset last set
+            for (std::set<Entity*>::iterator lasti = lastEnts.begin();
+                lasti != lastEnts.end(); ++lasti)
+            {
+                (*lasti)->setMaterialName("Examples/OgreLogo");
+            }
+            lastEnts.clear();
+
+
+            IntersectionSceneQueryResult& results = intersectionQuery->execute();
+            for (SceneQueryMovableIntersectionList::iterator mov = results.movables2movables.begin();
+                mov != results.movables2movables.end(); ++mov)
+            {
+                SceneQueryMovableObjectPair& thepair = *mov;
+                if (thepair.first->getMovableType() == "Entity")
+                {
+                    Entity* ent = static_cast<Entity*>(thepair.first);
+                    lastEnts.insert(ent);
+                    ent->setMaterialName("Examples/TextureEffect2");
+
+                }
+                if (thepair.second->getMovableType() == "Entity")
+                {
+                    Entity* ent = static_cast<Entity*>(thepair.second);
+                    lastEnts.insert(ent);
+                    ent->setMaterialName("Examples/TextureEffect2");
+
+                }
+            }
+        }
+
+        /*
+		if (mKeyboard->isKeyDown(KC_V) && timeUntilNextToggle <= 0)
+        {
+            static bool isVP = false;
+            if (!isVP)
+            {
+                skin->getTechnique(0)->getPass(0)->setVertexProgram("SimpleVP");
+                skin->getTechnique(0)->getPass(0)->setVertexProgramParameters(vertParams);
+                isVP = true;
+            }
+            else
+            {
+                skin->getTechnique(0)->getPass(0)->setVertexProgram("");
+                isVP = false;
+            }
+			timeUntilNextToggle = 0.5;
+        }
+        */
+
+		if (mKeyboard->isKeyDown(KC_P))
+        {
+            mTestNode[0]->yaw(Degree(-evt.timeSinceLastFrame * 30));
+        }
+		if (mKeyboard->isKeyDown(KC_O))
+        {
+            mTestNode[0]->yaw(Degree(evt.timeSinceLastFrame * 30));
+        }
+		if (mKeyboard->isKeyDown(KC_K))
+        {
+            mTestNode[0]->roll(Degree(-evt.timeSinceLastFrame * 30));
+        }
+		if (mKeyboard->isKeyDown(KC_L))
+        {
+            mTestNode[0]->roll(Degree(evt.timeSinceLastFrame * 30));
+        }
+		if (mKeyboard->isKeyDown(KC_U))
+        {
+            mTestNode[0]->translate(0,0,-evt.timeSinceLastFrame * 30);
+        }
+		if (mKeyboard->isKeyDown(KC_J))
+        {
+            mTestNode[0]->translate(0,0,evt.timeSinceLastFrame * 30);
+        }
+		if (mKeyboard->isKeyDown(KC_M))
+        {
+            mTestNode[0]->translate(0,evt.timeSinceLastFrame * 30, 0);
+        }
+		if (mKeyboard->isKeyDown(KC_N))
+        {
+            mTestNode[0]->translate(0,-evt.timeSinceLastFrame * 30, 0);
+        }
+
+        if (mKeyboard->isKeyDown(KC_0) && timeUntilNextToggle <= 0)
+        {
+            mAnimState->setEnabled(!mAnimState->getEnabled());
+            timeUntilNextToggle = 0.5;
+        }
+
+		if (mEntity && mKeyboard->isKeyDown(KC_SPACE) && timeUntilNextToggle <= 0)
+		{
+			mSceneMgr->destroyEntity(mEntity);
+			//mLight->setCastShadows(true);
+			mEntity = mSceneMgr->createEntity("newEnt", "robot.mesh");
+			mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(mEntity);
+			mAnimStateList.clear();
+			AnimationState* anim = mEntity->getAnimationState("Walk");
+			anim->setEnabled(true);
+			mAnimStateList.push_back(anim);
+		}
+
+        
+        /** Hack to test frustum vols
+        if (testCam)
+        {
+            // reposition the camera planes
+            PlaneBoundedVolumeList volList = mLight->_getFrustumClipVolumes(testCam);
+
+            PlaneBoundedVolume& vol = volList[1];
+            for (int p = 0; p < 6; ++p)
+            {
+                Plane& pl = vol.planes[p];
+                camPlaneNode[p]->setOrientation(Vector3::UNIT_Z.getRotationTo(pl.normal));
+                camPlaneNode[p]->setPosition(0,0,0);
+                camPlaneNode[p]->translate(0,0, pl.d, Node::TS_LOCAL);
+            }
+
+            vol.intersects(mEntity->getWorldBoundingBox());
+        }
+        */
+
+        // Print camera details
+        //mWindow->setDebugText("P: " + StringConverter::toString(mCamera->getDerivedPosition()) + " " + 
+        //    "O: " + StringConverter::toString(mCamera->getDerivedOrientation()));
+        return ExampleFrameListener::frameStarted(evt) && ExampleFrameListener::frameEnded(evt);        
+
+    }
+
+
+};
+
+class PlayPenApplication : public ExampleApplication
+{
+protected:
+    RefractionTextureListener mRefractionListener;
+    ReflectionTextureListener mReflectionListener;
+	StaticPluginLoader mStaticPluginLoader;
+public:
+    PlayPenApplication() {
+    
+    
+    }
+
+    ~PlayPenApplication() 
+    {
+        if (frustum)
+            delete frustum;
+		// Early delete so we can destroy static plugins
+		if (mFrameListener)
+		{
+			delete mFrameListener;
+			mFrameListener = 0;
+		}
+		if (mRoot)
+		{
+			delete mRoot;
+			mRoot = 0;
+		}
+#ifdef OGRE_STATIC_LIB
+		mStaticPluginLoader.unload();
+#endif
+    }
+protected:
+    
+    void chooseSceneManager(void)
+    {
+		// DefaultSceneManager
+		//mSceneMgr = mRoot->createSceneManager("DefaultSceneManager", "PlayPenSMInstance");
+
+		// BspSceneManager
+		//mSceneMgr = mRoot->createSceneManager("BspSceneManager", "PlayPenSMInstance");
+
+		// OctreeSceneManager
+		//mSceneMgr = mRoot->createSceneManager("OctreeSceneManager", "PlayPenSMInstance");
+
+		// TerrainSceneManager
+		mSceneMgr = mRoot->createSceneManager("TerrainSceneManager", "PlayPenSMInstance");
+	}
+
+
+    void createTestBugPlaneMesh3Streams(const String& testMeshName)
+    {
+        Plane plane(Vector3::UNIT_Z, 0);
+        Real width = 258;
+        Real height = 171;
+        int xsegments = 50;
+        int ysegments = 50;
+        Real xTile = 1.0f;
+        Real yTile = 1.0f;
+        const Vector3& upVector = Vector3::UNIT_Y;
+        MeshPtr pMesh = MeshManager::getSingleton().createManual(testMeshName, 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+        SubMesh *pSub = pMesh->createSubMesh();
+
+        // Set up vertex data
+        // Use a single shared buffer
+        pMesh->sharedVertexData = new VertexData();
+        VertexData* vertexData = pMesh->sharedVertexData;
+        // Set up Vertex Declaration
+        VertexDeclaration* vertexDecl = vertexData->vertexDeclaration;
+        // We always need positions
+        vertexDecl->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+        vertexDecl->addElement(1, 0, VET_FLOAT3, VES_NORMAL);
+        vertexDecl->addElement(2, 0, VET_FLOAT2, VES_TEXTURE_COORDINATES, 0);
+
+        vertexData->vertexCount = (xsegments + 1) * (ysegments + 1);
+
+        // Allocate vertex buffers
+        HardwareVertexBufferSharedPtr vbufpos = 
+            HardwareBufferManager::getSingleton().
+            createVertexBuffer(vertexDecl->getVertexSize(0), vertexData->vertexCount,
+            HardwareBuffer::HBU_STATIC_WRITE_ONLY, false);
+        HardwareVertexBufferSharedPtr vbufnorm = 
+            HardwareBufferManager::getSingleton().
+            createVertexBuffer(vertexDecl->getVertexSize(1), vertexData->vertexCount,
+            HardwareBuffer::HBU_STATIC_WRITE_ONLY, false);
+        HardwareVertexBufferSharedPtr vbuftex = 
+            HardwareBufferManager::getSingleton().
+            createVertexBuffer(vertexDecl->getVertexSize(2), vertexData->vertexCount,
+            HardwareBuffer::HBU_STATIC_WRITE_ONLY, false);
+
+        // Set up the binding (one source only)
+        VertexBufferBinding* binding = vertexData->vertexBufferBinding;
+        binding->setBinding(0, vbufpos);
+        binding->setBinding(1, vbufnorm);
+        binding->setBinding(2, vbuftex);
+
+        // Work out the transform required
+        // Default orientation of plane is normal along +z, distance 0
+        Matrix4 xlate, xform, rot;
+        Matrix3 rot3;
+        xlate = rot = Matrix4::IDENTITY;
+        // Determine axes
+        Vector3 zAxis, yAxis, xAxis;
+        zAxis = plane.normal;
+        zAxis.normalise();
+        yAxis = upVector;
+        yAxis.normalise();
+        xAxis = yAxis.crossProduct(zAxis);
+
+        rot3.FromAxes(xAxis, yAxis, zAxis);
+        rot = rot3;
+
+        // Set up standard xform from origin
+        xlate.setTrans(plane.normal * -plane.d);
+
+        // concatenate
+        xform = xlate * rot;
+
+        // Generate vertex data
+        // Lock the whole buffer
+        float* pPos = static_cast<float*>(
+            vbufpos->lock(HardwareBuffer::HBL_DISCARD) );
+        float* pNorm = static_cast<float*>(
+            vbufnorm->lock(HardwareBuffer::HBL_DISCARD) );
+        float* pTex = static_cast<float*>(
+            vbuftex->lock(HardwareBuffer::HBL_DISCARD) );
+        Real xSpace = width / xsegments;
+        Real ySpace = height / ysegments;
+        Real halfWidth = width / 2;
+        Real halfHeight = height / 2;
+        Real xTex = (1.0f * xTile) / xsegments;
+        Real yTex = (1.0f * yTile) / ysegments;
+        Vector3 vec;
+        Vector3 min, max;
+        Real maxSquaredLength;
+        bool firstTime = true;
+
+        for (int y = 0; y < ysegments + 1; ++y)
+        {
+            for (int x = 0; x < xsegments + 1; ++x)
+            {
+                // Work out centered on origin
+                vec.x = (x * xSpace) - halfWidth;
+                vec.y = (y * ySpace) - halfHeight;
+                vec.z = 0.0f;
+                // Transform by orientation and distance
+                vec = xform * vec;
+                // Assign to geometry
+                *pPos++ = vec.x;
+                *pPos++ = vec.y;
+                *pPos++ = vec.z;
+
+                // Build bounds as we go
+                if (firstTime)
+                {
+                    min = vec;
+                    max = vec;
+                    maxSquaredLength = vec.squaredLength();
+                    firstTime = false;
+                }
+                else
+                {
+                    min.makeFloor(vec);
+                    max.makeCeil(vec);
+                    maxSquaredLength = std::max(maxSquaredLength, vec.squaredLength());
+                }
+
+                // Default normal is along unit Z
+                vec = Vector3::UNIT_Z;
+                // Rotate
+                vec = rot * vec;
+
+                *pNorm++ = vec.x;
+                *pNorm++ = vec.y;
+                *pNorm++ = vec.z;
+
+                *pTex++ = x * xTex;
+                *pTex++ = 1 - (y * yTex);
+
+
+            } // x
+        } // y
+
+        // Unlock
+        vbufpos->unlock();
+        vbufnorm->unlock();
+        vbuftex->unlock();
+        // Generate face list
+        pSub->useSharedVertices = true;
+        //tesselate2DMesh(pSub, xsegments + 1, ysegments + 1, false, indexBufferUsage, indexShadowBuffer);
+        SubMesh* sm = pSub;
+        int meshWidth = xsegments + 1;
+        int meshHeight = ysegments + 1; 
+        bool doubleSided = false;
+        HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY;
+        bool indexShadowBuffer = true;
+        // The mesh is built, just make a list of indexes to spit out the triangles
+        int vInc, uInc, v, u, iterations;
+        int vCount, uCount;
+
+        if (doubleSided)
+        {
+            iterations = 2;
+            vInc = 1;
+            v = 0; // Start with front
+        }
+        else
+        {
+            iterations = 1;
+            vInc = 1;
+            v = 0;
+        }
+
+        // Allocate memory for faces
+        // Num faces, width*height*2 (2 tris per square), index count is * 3 on top
+        sm->indexData->indexCount = (meshWidth-1) * (meshHeight-1) * 2 * iterations * 3;
+        sm->indexData->indexBuffer = HardwareBufferManager::getSingleton().
+            createIndexBuffer(HardwareIndexBuffer::IT_16BIT,
+            sm->indexData->indexCount, indexBufferUsage, indexShadowBuffer);
+
+        int v1, v2, v3;
+        //bool firstTri = true;
+        HardwareIndexBufferSharedPtr ibuf = sm->indexData->indexBuffer;
+        // Lock the whole buffer
+        unsigned short* pIndexes = static_cast<unsigned short*>(
+            ibuf->lock(HardwareBuffer::HBL_DISCARD) );
+
+        while (iterations--)
+        {
+            // Make tris in a zigzag pattern (compatible with strips)
+            u = 0;
+            uInc = 1; // Start with moving +u
+
+            vCount = meshHeight - 1;
+            while (vCount--)
+            {
+                uCount = meshWidth - 1;
+                while (uCount--)
+                {
+                    // First Tri in cell
+                    // -----------------
+                    v1 = ((v + vInc) * meshWidth) + u;
+                    v2 = (v * meshWidth) + u;
+                    v3 = ((v + vInc) * meshWidth) + (u + uInc);
+                    // Output indexes
+                    *pIndexes++ = v1;
+                    *pIndexes++ = v2;
+                    *pIndexes++ = v3;
+                    // Second Tri in cell
+                    // ------------------
+                    v1 = ((v + vInc) * meshWidth) + (u + uInc);
+                    v2 = (v * meshWidth) + u;
+                    v3 = (v * meshWidth) + (u + uInc);
+                    // Output indexes
+                    *pIndexes++ = v1;
+                    *pIndexes++ = v2;
+                    *pIndexes++ = v3;
+
+                    // Next column
+                    u += uInc;
+                }
+                // Next row
+                v += vInc;
+                u = 0;
+
+
+            }
+
+            // Reverse vInc for double sided
+            v = meshHeight - 1;
+            vInc = -vInc;
+
+        }
+        // Unlock
+        ibuf->unlock();
+
+        //pMesh->_updateBounds();
+        pMesh->_setBounds(AxisAlignedBox(min, max));
+        pMesh->_setBoundingSphereRadius(Math::Sqrt(maxSquaredLength));
+        // load
+        pMesh->load();
+        pMesh->touch();
+    }
+
+    void stressTestStaticGeometry(void)
+    {
+
+		// Set ambient light
+		mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+		// Create a point light
+		Light* l = mSceneMgr->createLight("MainLight");
+		l->setType(Light::LT_DIRECTIONAL);
+		Vector3 dir(1, -1, -1.5);
+		dir.normalise();
+		l->setDirection(dir);
+		l->setDiffuseColour(1.0, 0.7, 0.0);
+
+
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 0;
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			4500,4500,10,10,true,1,5,5,Vector3::UNIT_Z);
+		Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("Examples/GrassFloor");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+		Vector3 min(-2000,0,-2000);
+		Vector3 max(2000,0,2000);
+
+
+		Entity* e = mSceneMgr->createEntity("1", "ogrehead.mesh");
+		StaticGeometry* s = 0;
+
+		unsigned int count = 10;
+		while(count--)
+		{
+			if(s) mSceneMgr->destroyStaticGeometry(s);
+			s = mSceneMgr->createStaticGeometry("bing");
+
+			s->addEntity(e, Vector3(100, 100, 100));
+
+			s->build();
+		}
+
+
+		//s->setRenderingDistance(1000);
+		//s->dump("static.txt");
+		//mSceneMgr->showBoundingBoxes(true);
+		mCamera->setLodBias(0.5);
+        
+
+    }
+
+	void testManualBlend()
+	{
+		// create material
+		MaterialPtr mat = MaterialManager::getSingleton().create("TestMat", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass * p = mat->getTechnique(0)->getPass(0);
+		p->setLightingEnabled(false);
+		p->createTextureUnitState("Dirt.jpg");
+		TextureUnitState* t = p->createTextureUnitState("PoolFloorLightingMap.png");
+		t->setColourOperationEx(LBX_BLEND_MANUAL, LBS_TEXTURE, LBS_CURRENT, 
+			ColourValue::White, ColourValue::White, 0.75);
+
+		Entity *planeEnt = mSceneMgr->createEntity("Plane", SceneManager::PT_PLANE);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(planeEnt);
+		planeEnt->setMaterialName("TestManual");
+
+
+
+	}
+
+	void testProjectSphere()
+	{
+		mSceneMgr->setAmbientLight(ColourValue::White);
+
+		
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 0;
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			4500,4500,10,10,true,1,5,5,Vector3::UNIT_Z);
+		Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("Examples/GrassFloor");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+		projectionSphere = new Sphere(Vector3(0, 30.0, 0), 10.0);
+
+		ManualObject* debugSphere = mSceneMgr->createManualObject("debugSphere");
+		debugSphere->begin("BaseWhiteNoLighting", RenderOperation::OT_LINE_STRIP);
+		for (int i = 0; i <= 20; ++i)
+		{
+			Vector3 basePos(projectionSphere->getRadius(), 0, 0);
+			Quaternion quat;
+			quat.FromAngleAxis(Radian(((float)i/(float)20)*Math::TWO_PI), Vector3::UNIT_Y);
+			basePos = quat * basePos;
+			debugSphere->position(basePos);
+		}
+		for (int i = 0; i <= 20; ++i)
+		{
+			Vector3 basePos(projectionSphere->getRadius(), 0, 0);
+			Quaternion quat;
+			quat.FromAngleAxis(Radian(((float)i/(float)20)*Math::TWO_PI), Vector3::UNIT_Z);
+			basePos = quat * basePos;
+			debugSphere->position(basePos);
+		}
+		debugSphere->end();
+
+		mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(0,30,0))->attachObject(debugSphere);
+
+		scissorRect = mSceneMgr->createManualObject("scissorrect");
+		scissorRect->setUseIdentityProjection(true);
+		scissorRect->setUseIdentityView(true);
+		AxisAlignedBox aabb;
+		aabb.setInfinite();
+		scissorRect->setBoundingBox(aabb);
+		scissorRect->begin("BaseWhiteNoLighting", RenderOperation::OT_LINE_STRIP);
+		scissorRect->position(Vector3::ZERO);
+		scissorRect->position(Vector3::ZERO);
+		scissorRect->position(Vector3::ZERO);
+		scissorRect->position(Vector3::ZERO);
+		scissorRect->position(Vector3::ZERO);
+		scissorRect->end();
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(scissorRect);
+
+
+
+
+	}
+
+	void testBug()
+	{
+		/** Bren's problem
+
+		Ogre::Mesh* mesh = Ogre::MeshManager::getSingleton().load("male_civ_head.mesh", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME).getPointer();
+		assert(mesh);
+		Ogre::PoseList pose_list = mesh->getPoseList();
+		unsigned int num_subs = mesh->getNumSubMeshes();
+
+		int cur_pose_index = 0;
+		Animation* anim = mesh->createAnimation(PoseAnimationStateName, (Real)NUM_HEAD_POSES);
+		for (unsigned int cur_sub = 1; cur_sub <= num_subs; ++cur_sub)
+		{
+			Ogre::VertexAnimationTrack* track = anim->createVertexTrack(cur_sub, VAT_POSE);
+
+			for (int cur_pose = 0; cur_pose < NUM_HEAD_POSES; ++cur_pose)
+			{
+				Ogre::VertexPoseKeyFrame* key = track->createVertexPoseKeyFrame((Real)cur_pose);
+
+				bool done = false;
+
+				for (unsigned int cur_key = 0; cur_key < NUM_HEAD_POSES && !done; ++cur_key)
+				{
+					if (pose_list[cur_key]->getName().compare(HeadPoses[cur_pose]) == 0 &&
+						pose_list[cur_key]->getTarget() == cur_sub - 1)
+					{
+						key->addPoseReference(cur_pose_index, 1.f);
+						++cur_pose_index;
+						done = true;
+					}
+				}
+			}          
+		}
+
+		Entity* ent = mSceneMgr->createEntity("1", mesh->getName());
+		num_subs = ent->getNumSubEntities();
+		SubEntity* mStump;
+		for (int i = 0; i < num_subs; ++i)
+		{
+			Ogre::SubEntity* sub_ent = ent->getSubEntity(i);
+			assert(sub_ent);
+			
+			if (sub_ent->getMaterialName().compare(0, strlen("male_civ/neckstump_"), "male_civ/neckstump_") == 0)
+				mStump = sub_ent;
+		}
+
+		assert(mStump && "Couldn't find head stump sub entity!");
+
+		mStump->setVisible(false);
+
+		AnimationState* animState = ent->getAnimationState(PoseAnimationStateName);
+		animState->setLoop(false);                            // else mTimePos becomes undefined?
+		animState->setEnabled(true);
+		animState->setTimePosition((Real)2);
+
+		*/
+	
+		Entity* ent = mSceneMgr->createEntity("test", "fs_raiden03b.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+		mAnimState = ent->getAnimationState("Default");
+		mAnimState->setEnabled(true);
+
+	}
+
+	void testMaterialSerializer()
+	{
+		MaterialSerializer ser;
+
+		// simple material
+		MaterialPtr m = MaterialManager::getSingleton().getByName("Examples/EnvMappedRustySteel");
+		ser.queueForExport(m);
+
+		// scheme-based but otherwise simple material
+		m = MaterialManager::getSingleton().getByName("Examples/MorningSkyBox");
+		ser.queueForExport(m);
+
+		// fairly simple shader, with custom param & default params
+		m = MaterialManager::getSingleton().getByName("Examples/CelShading");
+		ser.queueForExport(m);
+
+		// More complex shader
+		m = MaterialManager::getSingleton().getByName("Examples/BumpMapping/SingleLight");
+		ser.queueForExport(m);
+
+		// more complex shader, with light iteration
+		m = MaterialManager::getSingleton().getByName("Examples/BumpMapping/MultiLight");
+		ser.queueForExport(m);
+
+		// With a unified program
+		m = MaterialManager::getSingleton().getByName("jaiqua");
+		ser.queueForExport(m);
+
+
+		// export
+		ser.exportQueued("testexport.material", true);
+
+		
+
+
+	}
+
+	void testTransparencyMipMaps()
+	{
+		MaterialPtr mat = MaterialManager::getSingleton().create("test", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		// known png with alpha
+		Pass* pass = mat->getTechnique(0)->getPass(0);
+		pass->createTextureUnitState("ogretext.png");
+		pass->setSceneBlending(SBT_TRANSPARENT_ALPHA);
+		// alpha blend
+		pass->setDepthWriteEnabled(false);
+
+		// alpha reject
+		//pass->setDepthWriteEnabled(true);
+		//pass->setAlphaRejectSettings(CMPF_LESS, 128);
+
+		// Define a floor plane mesh
+		Plane p;
+		p.normal = Vector3::UNIT_Y;
+		p.d = 200;
+		MeshManager::getSingleton().createPlane("FloorPlane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+			p,2000,2000,1,1,true,1,5,5,Vector3::UNIT_Z);
+
+		// Create an entity (the floor)
+		Entity* ent = mSceneMgr->createEntity("floor", "FloorPlane");
+		ent->setMaterialName("test");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+
+		mSceneMgr->setSkyDome(true, "Examples/CloudySky", 5, 8);
+		mSceneMgr->setAmbientLight(ColourValue::White);
+
+
+		{
+		
+		Real alphaLevel = 0.5f;
+		MaterialPtr alphamat = MaterialManager::getSingleton().create("testy", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* pass = alphamat->getTechnique(0)->getPass(0);
+		pass->setSceneBlending(SBT_TRANSPARENT_ALPHA);
+		pass->setDepthWriteEnabled(false);
+		TextureUnitState* t = pass->createTextureUnitState();
+		t->setAlphaOperation(LBX_SOURCE1, LBS_MANUAL, LBS_CURRENT, alphaLevel);
+
+		ent = mSceneMgr->createEntity("asd", "ogrehead.mesh");
+		ent->setMaterialName("testy");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+
+		}
+		
+	}
+
+    void testCthNewBlending(void)
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setType(Light::LT_DIRECTIONAL);
+        l->setDirection(-Vector3::UNIT_Y);
+
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        //l->setPosition(20,80,50);
+
+
+        Entity *ent = mSceneMgr->createEntity("head", "ogrehead_2.mesh");
+
+        // Add entity to the root scene node
+        mRootNode = mSceneMgr->getRootSceneNode();
+        static_cast<SceneNode*>(mRootNode->createChild())->attachObject(ent);
+
+        mTestNode[0] = static_cast<SceneNode*>(
+            mRootNode->createChild("TestNode", Vector3(100,0,0)));
+        ent = mSceneMgr->createEntity("head2", "ogrehead.mesh");
+        mTestNode[0]->attachObject(ent);
+
+        mTestNode[0]->attachObject(l);
+        
+
+        // Create a skydome
+        mSceneMgr->setSkyDome(true, "Examples/CloudySky", 5, 8);
+
+        // Define a floor plane mesh
+        Plane p;
+        p.normal = Vector3::UNIT_Y;
+        p.d = 200;
+        MeshManager::getSingleton().createPlane("FloorPlane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+			p,2000,2000,1,1,true,1,5,5,Vector3::UNIT_Z);
+
+        // Create an entity (the floor)
+        ent = mSceneMgr->createEntity("floor", "FloorPlane");
+        ent->setMaterialName("Block/Material1");
+
+        mRootNode->attachObject(ent);
+
+        mCamera->setPosition(0,0,200);
+        mCamera->setDirection(0,0,-1);
+
+        //mSceneMgr->setDisplaySceneNodes(true);
+
+    }
+
+    void testMatrices(void)
+    {
+        mCamera->setPosition(0,0,500);
+        mCamera->lookAt(0,0,0);
+        const Matrix4& view = mCamera->getViewMatrix();
+        const Matrix4& proj = mCamera->getProjectionMatrix();
+
+        Matrix4 viewproj = proj * view;
+
+        Vector3 point3d(100,100,0);
+
+        Vector3 projPoint = viewproj * point3d;
+
+        point3d = Vector3(100,100,400);
+        projPoint = viewproj * point3d;
+    }
+    void testBasicPlane()
+    {
+        /*
+        // Create a light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        l->setPosition(20,80,50);
+        */
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setType(Light::LT_DIRECTIONAL);
+        l->setDirection(-Vector3::UNIT_Y);
+        Entity *ent;
+
+        // Define a floor plane mesh
+        Plane p;
+        p.normal = Vector3::UNIT_Y;
+        p.d = 200;
+        MeshManager::getSingleton().createPlane("FloorPlane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+			p,2000,2000,1,1,true,1,5,5,Vector3::UNIT_Z);
+
+        // Create an entity (the floor)
+        ent = mSceneMgr->createEntity("floor", "FloorPlane");
+        ent->setMaterialName("Examples/RustySteel");
+
+        mSceneMgr->getRootSceneNode()->attachObject(ent);
+
+        Entity* sphereEnt = mSceneMgr->createEntity("ogre", "ogrehead.mesh");
+		
+		mRootNode = mSceneMgr->getRootSceneNode();
+        SceneNode* node = mSceneMgr->createSceneNode();
+        node->attachObject(sphereEnt);
+        mRootNode->addChild(node);
+
+    }
+
+    void testAlpha()
+    {
+        /*
+        // Create a light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        l->setPosition(20,80,50);
+        */
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setType(Light::LT_DIRECTIONAL);
+        l->setDirection(-Vector3::UNIT_Y);
+        Entity *ent;
+
+        // Define a floor plane mesh
+        Plane p;
+        p.normal = Vector3::UNIT_Y;
+        p.d = 200;
+        MeshManager::getSingleton().createPlane("FloorPlane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+			p,2000,2000,1,1,true,1,5,5,Vector3::UNIT_Z);
+
+        p.normal = Vector3::UNIT_Z;
+        p.d = 200;
+        MeshManager::getSingleton().createPlane("WallPlane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+			p,2000,2000,1,1,true,1,5,5,Vector3::UNIT_Y);
+
+        // Create an entity (the floor)
+        ent = mSceneMgr->createEntity("floor", "FloorPlane");
+        ent->setMaterialName("Core/StatsBlockBorder/Up");
+
+        mSceneMgr->getRootSceneNode()->attachObject(ent);
+
+        ent = mSceneMgr->createEntity("wall", "WallPlane");
+        ent->setMaterialName("Core/StatsBlockBorder/Up");
+
+        mSceneMgr->getRootSceneNode()->attachObject(ent);
+
+
+        Entity* sphereEnt = mSceneMgr->createEntity("ogre", "ogrehead.mesh");
+		
+		mRootNode = mSceneMgr->getRootSceneNode();
+        SceneNode* node = mSceneMgr->createSceneNode();
+        node->attachObject(sphereEnt);
+        mRootNode->addChild(node);
+
+        mSceneMgr->showBoundingBoxes(true);
+
+    }
+    void testBsp()
+    {
+        // Load Quake3 locations from a file
+        ConfigFile cf;
+
+        cf.load("quake3settings.cfg");
+
+        String quakePk3 = cf.getSetting("Pak0Location");
+        String quakeLevel = cf.getSetting("Map");
+
+		ResourceGroupManager::getSingleton().addResourceLocation(quakePk3, "Zip");
+
+
+        // Load world geometry
+        mSceneMgr->setWorldGeometry(quakeLevel);
+
+        // modify camera for close work
+        mCamera->setNearClipDistance(4);
+        mCamera->setFarClipDistance(4000);
+
+        // Also change position, and set Quake-type orientation
+        // Get random player start point
+        ViewPoint vp = mSceneMgr->getSuggestedViewpoint(true);
+        mCamera->setPosition(vp.position);
+        mCamera->pitch(Degree(90)); // Quake uses X/Y horizon, Z up
+        mCamera->rotate(vp.orientation);
+        // Don't yaw along variable axis, causes leaning
+        mCamera->setFixedYawAxis(true, Vector3::UNIT_Z);
+
+    }
+
+    void testAnimation()
+    {
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setPosition(200,110,0);
+        l->setType(Light::LT_POINT);
+        Entity *ent;
+
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.4));
+
+        // Create an entity (the plant)
+        ent = mSceneMgr->createEntity("1", "skeletonandpose.mesh");
+
+        SceneNode* node = static_cast<SceneNode*>(mSceneMgr->getRootSceneNode()->createChild(Vector3(-50,0,0)));
+        node->attachObject(ent);
+        node->scale(2,2,2);
+
+        mAnimState = ent->getAnimationState("pose2_Clip");
+        mAnimState->setEnabled(true);
+
+        mWindow->getViewport(0)->setBackgroundColour(ColourValue(1,0,0));
+
+
+    }
+
+	void testAnimationBlend()
+	{
+		Light* l = mSceneMgr->createLight("MainLight");
+		l->setPosition(200,110,0);
+		l->setType(Light::LT_POINT);
+		Entity *ent;
+
+		mWindow->getViewport(0)->setBackgroundColour(ColourValue::Red);
+
+		mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.4));
+
+		// Create an entity (the plant)
+		ent = mSceneMgr->createEntity("1", "sticky.mesh");
+
+		SceneNode* node = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		node->attachObject(ent);
+		node->scale(2,2,2);
+
+		//mAnimState = ent->getAnimationState("triangle");
+		//mAnimState->setEnabled(true);
+
+		animBlender = new AnimationBlender(ent);
+		animBlendTarget[0] = "still";
+		animBlendTarget[1] = "triangle";
+		animBlendTargetIndex = 1;
+		animBlender->init(animBlendTarget[0]);
+		animBlender->blend(animBlendTarget[1], AnimationBlender::BlendWhileAnimating, 10, false);
+
+		mCamera->setPosition(-50,0,0);
+		mCamera->lookAt(0,0,0);
+
+
+	}
+
+    void testGpuPrograms(void)
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setType(Light::LT_DIRECTIONAL);
+        l->setDirection(-Vector3::UNIT_Y);
+
+        Entity* pEnt = mSceneMgr->createEntity( "1", "robot.mesh" );
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pEnt);
+
+        mTestNode[0] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+            
+        pEnt = mSceneMgr->createEntity( "2", "ogrehead.mesh" );
+        mTestNode[0]->attachObject( pEnt );
+        mTestNode[0]->translate(100,0,0);
+
+        // Rejig the ogre skin material
+        // Load the programs first
+
+        pEnt->getSubEntity(1)->setMaterialName("SimpleTest");
+
+    }
+    void testProjection(void)
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setType(Light::LT_DIRECTIONAL);
+        l->setDirection(-Vector3::UNIT_Y);
+
+        Entity* pEnt;
+        //pEnt = mSceneMgr->createEntity( "1", "knot.mesh" );
+        //mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(-30,0,-50))->attachObject(pEnt);
+        //pEnt->setMaterialName("Examples/OgreLogo");
+
+        // Define a floor plane mesh
+        Plane p;
+        p.normal = Vector3::UNIT_Z;
+        p.d = 200;
+        MeshManager::getSingleton().createPlane("WallPlane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+			p,1500,1500,1,1,true,1,5,5,Vector3::UNIT_Y);
+        pEnt = mSceneMgr->createEntity( "5", "WallPlane" );
+        pEnt->setMaterialName("Examples/OgreLogo");
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pEnt);
+
+
+        mTestNode[0] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+            
+        //pEnt = mSceneMgr->createEntity( "2", "ogrehead.mesh" );
+        //mTestNode[0]->attachObject( pEnt );
+        mTestNode[0]->translate(0, 0, 750);
+
+        frustum = new Frustum();
+        frustum->setVisible(true);
+        frustum->setFarClipDistance(5000);
+        frustum->setNearClipDistance(200);
+        frustum->setAspectRatio(1);
+        //frustum->setProjectionType(PT_ORTHOGRAPHIC);
+        mTestNode[0]->attachObject(frustum);
+
+        // Hook the frustum up to the material
+        MaterialPtr mat = MaterialManager::getSingleton().getByName("Examples/OgreLogo");
+        TextureUnitState *t = mat->getTechnique(0)->getPass(0)->getTextureUnitState(0);
+        t->setProjectiveTexturing(true, frustum);
+        //t->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
+
+    }
+
+    void testMultiViewports(void)
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setType(Light::LT_DIRECTIONAL);
+        l->setDirection(-Vector3::UNIT_Y);
+
+        Entity* pEnt = mSceneMgr->createEntity( "1", "knot.mesh" );
+        mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(-30,0,-50))->attachObject(pEnt);
+
+        mTestNode[0] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+            
+        pEnt = mSceneMgr->createEntity( "2", "ogrehead.mesh" );
+        mTestNode[0]->attachObject( pEnt );
+        mTestNode[0]->translate(0, 0, 200);
+
+        frustum = new Frustum();
+        //frustum->setVisible(true);
+        frustum->setFarClipDistance(5000);
+        frustum->setNearClipDistance(100);
+        mTestNode[0]->attachObject(frustum);
+
+        Viewport* vp = mRoot->getAutoCreatedWindow()->addViewport(mCamera, 1, 0.5, 0.5, 0.5, 0.5);
+        vp->setOverlaysEnabled(false);
+        vp->setBackgroundColour(ColourValue(1,0,0));
+
+    }
+
+
+    // Just override the mandatory create scene method
+    void testSceneNodeTracking(void)
+    {
+
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.2, 0.2, 0.2));
+
+        // Create a skydome
+        mSceneMgr->setSkyDome(true, "Examples/CloudySky", 5, 8);
+
+        // Create a light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        l->setPosition(20,80,50);
+
+        Entity *ent;
+
+        // Define a floor plane mesh
+        Plane p;
+        p.normal = Vector3::UNIT_Y;
+        p.d = 200;
+        MeshManager::getSingleton().createPlane("FloorPlane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+			p,200000,200000,20,20,true,1,50,50,Vector3::UNIT_Z);
+
+        // Create an entity (the floor)
+        ent = mSceneMgr->createEntity("floor", "FloorPlane");
+        ent->setMaterialName("Examples/RustySteel");
+        // Attach to child of root node, better for culling (otherwise bounds are the combination of the 2)
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+
+        // Add a head, give it it's own node
+        SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        ent = mSceneMgr->createEntity("head", "ogrehead.mesh");
+        headNode->attachObject(ent);
+
+        // Add another head, give it it's own node
+        SceneNode* headNode2 = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        ent = mSceneMgr->createEntity("head2", "ogrehead.mesh");
+        headNode2->attachObject(ent);
+
+        // Make sure the head node tracks the root
+        headNode->setAutoTracking(true, headNode2, Vector3::UNIT_Z);
+        //headNode->setFixedYawAxis(true);
+
+        // Create the camera node & attach camera
+        //SceneNode* camNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        //camNode->attachObject(mCamera);
+
+        // set up spline animation of node
+        Animation* anim = mSceneMgr->createAnimation("CameraTrack", 10);
+        // Spline it for nice curves
+        anim->setInterpolationMode(Animation::IM_SPLINE);
+        // Create a track to animate the head's node
+        NodeAnimationTrack* track = anim->createNodeTrack(0, headNode);
+        // Setup keyframes
+        TransformKeyFrame* key = track->createNodeKeyFrame(0); // startposition
+        key = track->createNodeKeyFrame(2.5);
+        key->setTranslate(Vector3(500,500,-1000));
+        key = track->createNodeKeyFrame(5);
+        key->setTranslate(Vector3(-1500,1000,-600));
+        key = track->createNodeKeyFrame(7.5);
+        key->setTranslate(Vector3(0,-100,0));
+        key = track->createNodeKeyFrame(10);
+        key->setTranslate(Vector3(0,0,0));
+        // Create a track to animate the second head's node
+        track = anim->createNodeTrack(1, headNode2);
+        // Setup keyframes
+        key = track->createNodeKeyFrame(0); // startposition
+        key = track->createNodeKeyFrame(2.5);
+        key->setTranslate(Vector3(-500,600,-100));
+        key = track->createNodeKeyFrame(5);
+        key->setTranslate(Vector3(800,200,-600));
+        key = track->createNodeKeyFrame(7.5);
+        key->setTranslate(Vector3(200,-1000,0));
+        key = track->createNodeKeyFrame(10);
+        key->setTranslate(Vector3(30,70,110));
+        // Create a new animation state to track this
+        mAnimState = mSceneMgr->createAnimationState("CameraTrack");
+        mAnimState->setEnabled(true);
+
+        // Put in a bit of fog for the hell of it
+        mSceneMgr->setFog(FOG_EXP, ColourValue::White, 0.0002);
+
+    }
+
+
+
+    void testDistortion(void)
+    {
+        theCam = mCamera;
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setType(Light::LT_DIRECTIONAL);
+        l->setDirection(-Vector3::UNIT_Y);
+
+        Entity* pEnt;
+
+        RenderTexture* rttTex = mRoot->getRenderSystem()->createRenderTexture( "Refraction", 512, 512 );
+        {
+            Viewport *v = rttTex->addViewport( mCamera );
+            MaterialPtr mat = MaterialManager::getSingleton().getByName("Examples/FresnelReflectionRefraction");
+            mat->getTechnique(0)->getPass(0)->getTextureUnitState(2)->setTextureName("Refraction");
+            v->setOverlaysEnabled(false);
+            rttTex->addListener(&mRefractionListener);
+        }
+
+        rttTex = mRoot->getRenderSystem()->createRenderTexture( "Reflection", 512, 512 );
+        {
+            Viewport *v = rttTex->addViewport( mCamera );
+            MaterialPtr mat = MaterialManager::getSingleton().getByName("Examples/FresnelReflectionRefraction");
+            mat->getTechnique(0)->getPass(0)->getTextureUnitState(1)->setTextureName("Reflection");
+            v->setOverlaysEnabled(false);
+            rttTex->addListener(&mReflectionListener);
+        }
+        // Define a floor plane mesh
+        Plane p;
+        p.normal = Vector3::UNIT_Y;
+        p.d = 100;
+        MeshManager::getSingleton().createPlane("WallPlane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+			p,1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+        pPlaneEnt = mSceneMgr->createEntity( "5", "WallPlane" );
+        pPlaneEnt->setMaterialName("Examples/FresnelReflectionRefraction");
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+        
+        mSceneMgr->setSkyBox(true, "Examples/CloudyNoonSkyBox");
+
+        mTestNode[0] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        int i;
+        for (i = 0; i < 10; ++i)
+        {
+            pEnt = mSceneMgr->createEntity( "ogre" + StringConverter::toString(i), "ogrehead.mesh" );
+            mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(i*100 - 500, -75, 0))->attachObject(pEnt);
+            pEnt = mSceneMgr->createEntity( "knot" + StringConverter::toString(i), "knot.mesh" );
+            mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(i*100 - 500, 140, 0))->attachObject(pEnt);
+        }
+
+
+
+    }
+
+
+    void testEdgeBuilderSingleIndexBufSingleVertexBuf()
+    {
+        /* This tests the edge builders ability to find shared edges in the simple case
+           of a single index buffer referencing a single vertex buffer
+        */
+        VertexData vd;
+        IndexData id;
+        // Test pyramid
+        vd.vertexCount = 4;
+        vd.vertexStart = 0;
+        vd.vertexDeclaration = HardwareBufferManager::getSingleton().createVertexDeclaration();
+        vd.vertexDeclaration->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+        HardwareVertexBufferSharedPtr vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(sizeof(float)*3, 4, HardwareBuffer::HBU_STATIC,true);
+        vd.vertexBufferBinding->setBinding(0, vbuf);
+        float* pFloat = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD));
+        *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+        *pFloat++ = 50 ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+        *pFloat++ = 0  ; *pFloat++ = 100; *pFloat++ = 0  ;
+        *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = -50;
+        vbuf->unlock();
+            
+        id.indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+            HardwareIndexBuffer::IT_16BIT, 12, HardwareBuffer::HBU_STATIC, true);
+        id.indexCount = 12;
+        id.indexStart = 0;
+        unsigned short* pIdx = static_cast<unsigned short*>(id.indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+        *pIdx++ = 0; *pIdx++ = 1; *pIdx++ = 2;
+        *pIdx++ = 0; *pIdx++ = 2; *pIdx++ = 3;
+        *pIdx++ = 1; *pIdx++ = 3; *pIdx++ = 2;
+        *pIdx++ = 0; *pIdx++ = 3; *pIdx++ = 1;
+        id.indexBuffer->unlock();
+
+        EdgeListBuilder edgeBuilder;
+        edgeBuilder.addVertexData(&vd);
+        edgeBuilder.addIndexData(&id);
+        EdgeData* edgeData = edgeBuilder.build();
+
+        edgeData->log(LogManager::getSingleton().getDefaultLog());
+
+        delete edgeData;
+
+
+    }
+
+    void testEdgeBuilderMultiIndexBufSingleVertexBuf()
+    {
+        /* This tests the edge builders ability to find shared edges when there are
+           multiple index sets (submeshes) using a single vertex buffer.
+        */
+        VertexData vd;
+        IndexData id[4];
+        // Test pyramid
+        vd.vertexCount = 4;
+        vd.vertexStart = 0;
+        vd.vertexDeclaration = HardwareBufferManager::getSingleton().createVertexDeclaration();
+        vd.vertexDeclaration->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+        HardwareVertexBufferSharedPtr vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(sizeof(float)*3, 4, HardwareBuffer::HBU_STATIC,true);
+        vd.vertexBufferBinding->setBinding(0, vbuf);
+        float* pFloat = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD));
+        *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+        *pFloat++ = 50 ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+        *pFloat++ = 0  ; *pFloat++ = 100; *pFloat++ = 0  ;
+        *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = -50;
+        vbuf->unlock();
+            
+        id[0].indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+            HardwareIndexBuffer::IT_16BIT, 3, HardwareBuffer::HBU_STATIC, true);
+        id[0].indexCount = 3;
+        id[0].indexStart = 0;
+        unsigned short* pIdx = static_cast<unsigned short*>(id[0].indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+        *pIdx++ = 0; *pIdx++ = 1; *pIdx++ = 2;
+        id[0].indexBuffer->unlock();
+
+        id[1].indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+            HardwareIndexBuffer::IT_16BIT, 3, HardwareBuffer::HBU_STATIC, true);
+        id[1].indexCount = 3;
+        id[1].indexStart = 0;
+        pIdx = static_cast<unsigned short*>(id[1].indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+        *pIdx++ = 0; *pIdx++ = 2; *pIdx++ = 3;
+        id[1].indexBuffer->unlock();
+
+        id[2].indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+            HardwareIndexBuffer::IT_16BIT, 3, HardwareBuffer::HBU_STATIC, true);
+        id[2].indexCount = 3;
+        id[2].indexStart = 0;
+        pIdx = static_cast<unsigned short*>(id[2].indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+        *pIdx++ = 1; *pIdx++ = 3; *pIdx++ = 2;
+        id[2].indexBuffer->unlock();
+
+        id[3].indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+            HardwareIndexBuffer::IT_16BIT, 3, HardwareBuffer::HBU_STATIC, true);
+        id[3].indexCount = 3;
+        id[3].indexStart = 0;
+        pIdx = static_cast<unsigned short*>(id[3].indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+        *pIdx++ = 0; *pIdx++ = 3; *pIdx++ = 1;
+        id[3].indexBuffer->unlock();
+
+        EdgeListBuilder edgeBuilder;
+        edgeBuilder.addVertexData(&vd);
+        edgeBuilder.addIndexData(&id[0]);
+        edgeBuilder.addIndexData(&id[1]);
+        edgeBuilder.addIndexData(&id[2]);
+        edgeBuilder.addIndexData(&id[3]);
+        EdgeData* edgeData = edgeBuilder.build();
+
+        edgeData->log(LogManager::getSingleton().getDefaultLog());
+
+        delete edgeData;
+
+
+    }
+
+
+    void testEdgeBuilderMultiIndexBufMultiVertexBuf()
+    {
+        /* This tests the edge builders ability to find shared edges when there are
+           both multiple index sets (submeshes) each using a different vertex buffer
+           (not using shared geoemtry). 
+        */
+
+        VertexData vd[4];
+        IndexData id[4];
+        // Test pyramid
+        vd[0].vertexCount = 3;
+        vd[0].vertexStart = 0;
+        vd[0].vertexDeclaration = HardwareBufferManager::getSingleton().createVertexDeclaration();
+        vd[0].vertexDeclaration->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+        HardwareVertexBufferSharedPtr vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(sizeof(float)*3, 3, HardwareBuffer::HBU_STATIC,true);
+        vd[0].vertexBufferBinding->setBinding(0, vbuf);
+        float* pFloat = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD));
+        *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+        *pFloat++ = 50 ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+        *pFloat++ = 0  ; *pFloat++ = 100; *pFloat++ = 0  ;
+        vbuf->unlock();
+
+        vd[1].vertexCount = 3;
+        vd[1].vertexStart = 0;
+        vd[1].vertexDeclaration = HardwareBufferManager::getSingleton().createVertexDeclaration();
+        vd[1].vertexDeclaration->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+        vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(sizeof(float)*3, 3, HardwareBuffer::HBU_STATIC,true);
+        vd[1].vertexBufferBinding->setBinding(0, vbuf);
+        pFloat = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD));
+        *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+        *pFloat++ = 0  ; *pFloat++ = 100; *pFloat++ = 0  ;
+        *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = -50;
+        vbuf->unlock();
+
+        vd[2].vertexCount = 3;
+        vd[2].vertexStart = 0;
+        vd[2].vertexDeclaration = HardwareBufferManager::getSingleton().createVertexDeclaration();
+        vd[2].vertexDeclaration->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+        vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(sizeof(float)*3, 3, HardwareBuffer::HBU_STATIC,true);
+        vd[2].vertexBufferBinding->setBinding(0, vbuf);
+        pFloat = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD));
+        *pFloat++ = 50 ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+        *pFloat++ = 0  ; *pFloat++ = 100; *pFloat++ = 0  ;
+        *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = -50;
+        vbuf->unlock();
+            
+        vd[3].vertexCount = 3;
+        vd[3].vertexStart = 0;
+        vd[3].vertexDeclaration = HardwareBufferManager::getSingleton().createVertexDeclaration();
+        vd[3].vertexDeclaration->addElement(0, 0, VET_FLOAT3, VES_POSITION);
+        vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(sizeof(float)*3, 3, HardwareBuffer::HBU_STATIC,true);
+        vd[3].vertexBufferBinding->setBinding(0, vbuf);
+        pFloat = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD));
+        *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+        *pFloat++ = 50 ; *pFloat++ = 0  ; *pFloat++ = 0  ;
+        *pFloat++ = 0  ; *pFloat++ = 0  ; *pFloat++ = -50;
+        vbuf->unlock();
+
+        id[0].indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+            HardwareIndexBuffer::IT_16BIT, 3, HardwareBuffer::HBU_STATIC, true);
+        id[0].indexCount = 3;
+        id[0].indexStart = 0;
+        unsigned short* pIdx = static_cast<unsigned short*>(id[0].indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+        *pIdx++ = 0; *pIdx++ = 1; *pIdx++ = 2;
+        id[0].indexBuffer->unlock();
+
+        id[1].indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+            HardwareIndexBuffer::IT_16BIT, 3, HardwareBuffer::HBU_STATIC, true);
+        id[1].indexCount = 3;
+        id[1].indexStart = 0;
+        pIdx = static_cast<unsigned short*>(id[1].indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+        *pIdx++ = 0; *pIdx++ = 1; *pIdx++ = 2;
+        id[1].indexBuffer->unlock();
+
+        id[2].indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+            HardwareIndexBuffer::IT_16BIT, 3, HardwareBuffer::HBU_STATIC, true);
+        id[2].indexCount = 3;
+        id[2].indexStart = 0;
+        pIdx = static_cast<unsigned short*>(id[2].indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+        *pIdx++ = 0; *pIdx++ = 2; *pIdx++ = 1;
+        id[2].indexBuffer->unlock();
+
+        id[3].indexBuffer = HardwareBufferManager::getSingleton().createIndexBuffer(
+            HardwareIndexBuffer::IT_16BIT, 3, HardwareBuffer::HBU_STATIC, true);
+        id[3].indexCount = 3;
+        id[3].indexStart = 0;
+        pIdx = static_cast<unsigned short*>(id[3].indexBuffer->lock(HardwareBuffer::HBL_DISCARD));
+        *pIdx++ = 0; *pIdx++ = 2; *pIdx++ = 1;
+        id[3].indexBuffer->unlock();
+
+        EdgeListBuilder edgeBuilder;
+        edgeBuilder.addVertexData(&vd[0]);
+        edgeBuilder.addVertexData(&vd[1]);
+        edgeBuilder.addVertexData(&vd[2]);
+        edgeBuilder.addVertexData(&vd[3]);
+        edgeBuilder.addIndexData(&id[0], 0);
+        edgeBuilder.addIndexData(&id[1], 1);
+        edgeBuilder.addIndexData(&id[2], 2);
+        edgeBuilder.addIndexData(&id[3], 3);
+        EdgeData* edgeData = edgeBuilder.build();
+
+        edgeData->log(LogManager::getSingleton().getDefaultLog());
+
+        delete edgeData;
+
+
+    }
+
+    void testSkeletalAnimation()
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+        //mWindow->getViewport(0)->setBackgroundColour(ColourValue::White);
+
+
+
+        Entity *ent = mSceneMgr->createEntity("robot", "test.mesh");
+        // Uncomment the below to test software skinning
+        //ent->setMaterialName("Examples/Rocky");
+        // Add entity to the scene node
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+        mAnimState = ent->getAnimationState("Default");
+        mAnimState->setEnabled(true);
+
+        // Give it a little ambience with lights
+        Light* l;
+        l = mSceneMgr->createLight("BlueLight");
+        l->setPosition(-200,-80,-100);
+        l->setDiffuseColour(0.5, 0.5, 1.0);
+
+        l = mSceneMgr->createLight("GreenLight");
+        l->setPosition(0,0,-100);
+        l->setDiffuseColour(0.5, 1.0, 0.5);
+
+        // Position the camera
+        mCamera->setPosition(100,50,100);
+        mCamera->lookAt(-50,50,0);
+
+        // Report whether hardware skinning is enabled or not
+        Technique* t = ent->getSubEntity(0)->getMaterial()->getBestTechnique();
+        Pass* p = t->getPass(0);
+		OverlayElement* guiDbg = OverlayManager::getSingleton().getOverlayElement("Core/DebugText");
+        if (p->hasVertexProgram() && 
+            p->getVertexProgram()->isSkeletalAnimationIncluded())
+        {
+			guiDbg->setCaption("Hardware skinning is enabled");
+        }
+        else
+        {
+            guiDbg->setCaption("Software skinning is enabled");
+        }
+
+
+    }
+
+
+    void testPrepareShadowVolume(void)
+    {
+
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setType(Light::LT_DIRECTIONAL);
+        l->setDirection(-Vector3::UNIT_Y);
+
+        mTestNode[0] = (SceneNode*)mSceneMgr->getRootSceneNode()->createChild();
+            
+        Entity* pEnt = mSceneMgr->createEntity( "1", "ogrehead.mesh" );
+        mTestNode[0]->attachObject( pEnt );
+
+        pEnt->getMesh()->prepareForShadowVolume();
+
+    }
+
+    void testWindowedViewportMode()
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setType(Light::LT_DIRECTIONAL);
+        l->setDirection(-Vector3::UNIT_Y);
+
+        mTestNode[0] = (SceneNode*)mSceneMgr->getRootSceneNode()->createChild();
+
+        Entity* pEnt = mSceneMgr->createEntity( "1", "ogrehead.mesh" );
+        mTestNode[0]->attachObject( pEnt );
+
+        mCamera->setWindow(0,0,0.5,0.5);
+
+    }
+    void testSubEntityVisibility()
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setType(Light::LT_DIRECTIONAL);
+        l->setDirection(-Vector3::UNIT_Y);
+
+        mTestNode[0] = (SceneNode*)mSceneMgr->getRootSceneNode()->createChild();
+
+        Entity* pEnt = mSceneMgr->createEntity( "1", "ogrehead.mesh" );
+        mTestNode[0]->attachObject( pEnt );
+
+        pEnt->getSubEntity(1)->setVisible(false);
+
+
+    }
+
+    void testAttachObjectsToBones()
+    {
+        Entity *ent;
+        for (int i = 0; i < 12; ++i)
+        {
+            ent = mSceneMgr->createEntity("robot" + StringConverter::toString(i), "robot.mesh");
+			if (false)//i % 2)
+			{
+				Entity* ent2 = mSceneMgr->createEntity("plane" + StringConverter::toString(i), "razor.mesh");
+				ent->attachObjectToBone("Joint8", ent2);
+			}
+			else
+			{
+				ParticleSystem* psys = mSceneMgr->createParticleSystem("psys" + StringConverter::toString(i), "Examples/PurpleFountain");
+				psys->getEmitter(0)->setTimeToLive(0.2);
+				ent->attachObjectToBone("Joint15", psys);
+			}
+            // Add entity to the scene node
+            mSceneMgr->getRootSceneNode()->createChildSceneNode(
+                Vector3(0,0,(i*200)-(12*200/2)))->attachObject(ent);
+
+			ent->getParentNode()->yaw(Degree(i * 45));
+        }
+        mAnimState = ent->getAnimationState("Walk");
+        mAnimState->setEnabled(true);
+
+
+
+        // Give it a little ambience with lights
+        Light* l;
+        l = mSceneMgr->createLight("BlueLight");
+        l->setPosition(-200,-80,-100);
+        l->setDiffuseColour(0.5, 0.5, 1.0);
+
+        l = mSceneMgr->createLight("GreenLight");
+        l->setPosition(0,0,-100);
+        l->setDiffuseColour(0.5, 1.0, 0.5);
+
+        // Position the camera
+        mCamera->setPosition(100,50,100);
+        mCamera->lookAt(-50,50,0);
+
+        mSceneMgr->setAmbientLight(ColourValue(1,1,1,1));
+        mSceneMgr->showBoundingBoxes(true);
+
+    }
+    void testOrtho()
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.0, 0.0, 0.0));
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setPosition(800,600,0);
+
+        mTestNode[0] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        mLightNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+
+        Entity* pEnt = mSceneMgr->createEntity( "3", "knot.mesh" );
+        mTestNode[1] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(-200, 0, -200));
+        mTestNode[1]->attachObject( pEnt );
+
+        pEnt = mSceneMgr->createEntity( "4", "knot.mesh" );
+        mTestNode[2] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(100, 0, 200));
+        mTestNode[2]->attachObject( pEnt );
+
+
+        mSceneMgr->setSkyBox(true, "Examples/CloudyNoonSkyBox");
+
+
+        Plane plane;
+        plane.normal = Vector3::UNIT_Y;
+        plane.d = 100;
+        MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+            1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+        Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+        pPlaneEnt->setMaterialName("2 - Default");
+        pPlaneEnt->setCastShadows(false);
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+        mCamera->setFixedYawAxis(false);
+        mCamera->setProjectionType(PT_ORTHOGRAPHIC);
+        mCamera->setPosition(0,10000,0);
+        mCamera->lookAt(0,0,0);
+        mCamera->setNearClipDistance(1000);
+
+    }
+
+	void testManualLOD()
+	{
+		MeshPtr msh1 = (MeshPtr)MeshManager::getSingleton().load("robot.mesh", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+
+		msh1->createManualLodLevel(200, "razor.mesh");
+		msh1->createManualLodLevel(500, "sphere.mesh");
+
+		Entity *ent;
+		for (int i = 0; i < 5; ++i)
+		{
+			ent = mSceneMgr->createEntity("robot" + StringConverter::toString(i), "robot.mesh");
+			// Add entity to the scene node
+			mSceneMgr->getRootSceneNode()->createChildSceneNode(
+				Vector3(0,0,(i*50)-(5*50/2)))->attachObject(ent);
+		}
+		mAnimState = ent->getAnimationState("Walk");
+		mAnimState->setEnabled(true);
+
+
+
+		// Give it a little ambience with lights
+		Light* l;
+		l = mSceneMgr->createLight("BlueLight");
+		l->setPosition(-200,-80,-100);
+		l->setDiffuseColour(0.5, 0.5, 1.0);
+
+		l = mSceneMgr->createLight("GreenLight");
+		l->setPosition(0,0,-100);
+		l->setDiffuseColour(0.5, 1.0, 0.5);
+
+		// Position the camera
+		mCamera->setPosition(100,50,100);
+		mCamera->lookAt(-50,50,0);
+
+		mSceneMgr->setAmbientLight(ColourValue::White);
+
+	}
+
+	void testFallbackResourceGroup()
+	{
+		// Load all textures from new resource group "Test"
+		ResourceGroupManager::getSingleton().removeResourceLocation("../../../Media/materials/textures");
+		ResourceGroupManager::getSingleton().removeResourceLocation("../../../Media/models");
+		ResourceGroupManager::getSingleton().createResourceGroup("Test");
+		ResourceGroupManager::getSingleton().addResourceLocation("../../../Media/materials/textures", "FileSystem", "Test");
+		ResourceGroupManager::getSingleton().addResourceLocation("../../../Media/models", "FileSystem", "Test");
+
+		// Load a texture from default group (won't be found there, but should fall back)
+		TextureManager::getSingleton().load("dirt01.jpg", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+
+		ResourceGroupManager::getSingleton().unloadUnreferencedResourcesInGroup("Test");
+
+		// Add a few robots for fun
+		Entity *ent;
+		for (int i = 0; i < 5; ++i)
+		{
+			ent = mSceneMgr->createEntity("robot" + StringConverter::toString(i), "robot.mesh");
+			// Add entity to the scene node
+			mSceneMgr->getRootSceneNode()->createChildSceneNode(
+				Vector3(0,0,(i*50)-(5*50/2)))->attachObject(ent);
+		}
+		// Give it a little ambience with lights
+		Light* l;
+		l = mSceneMgr->createLight("BlueLight");
+		l->setPosition(-200,-80,-100);
+		l->setDiffuseColour(0.5, 0.5, 1.0);
+
+		l = mSceneMgr->createLight("GreenLight");
+		l->setPosition(0,0,-100);
+		l->setDiffuseColour(0.5, 1.0, 0.5);
+
+		// Position the camera
+		mCamera->setPosition(100,50,100);
+		mCamera->lookAt(-50,50,0);
+
+	}
+
+	void testGeneratedLOD()
+	{
+		MeshPtr msh1 = (MeshPtr)MeshManager::getSingleton().load("barrel.mesh", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+
+		msh1->removeLodLevels();
+
+		Mesh::LodDistanceList lodList;
+		lodList.push_back(50);
+		lodList.push_back(100);
+		lodList.push_back(150);
+		lodList.push_back(200);
+		lodList.push_back(250);
+		lodList.push_back(300);
+
+		msh1->generateLodLevels(lodList, ProgressiveMesh::VRQ_PROPORTIONAL, 0.3);
+
+		Entity *ent;
+		for (int i = 0; i < 1; ++i)
+		{
+			ent = mSceneMgr->createEntity("tst" + StringConverter::toString(i), "barrel.mesh");
+			// Add entity to the scene node
+			mSceneMgr->getRootSceneNode()->createChildSceneNode(
+				Vector3(0,0,(i*50)-(5*50/2)))->attachObject(ent);
+		}
+
+		// Give it a little ambience with lights
+		Light* l;
+		l = mSceneMgr->createLight("BlueLight");
+		l->setPosition(-200,-80,-100);
+		l->setDiffuseColour(0.5, 0.5, 1.0);
+
+		l = mSceneMgr->createLight("GreenLight");
+		l->setPosition(0,0,-100);
+		l->setDiffuseColour(0.5, 1.0, 0.5);
+
+		// Position the camera
+		mCamera->setPosition(100,50,100);
+		mCamera->lookAt(-50,50,0);
+
+		mSceneMgr->setAmbientLight(ColourValue::White);
+
+	}
+
+    void clearSceneSetup()
+    {
+        bool showOctree = true;
+        mSceneMgr->setOption("ShowOctree", &showOctree);
+
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.2, 0.2, 0.2));
+
+        // Create a skydome
+        mSceneMgr->setSkyDome(true, "Examples/CloudySky", 5, 8);
+
+        // Create a light
+        Light* l = mSceneMgr->createLight("MainLight");
+        // Accept default settings: point light, white diffuse, just set position
+        // NB I could attach the light to a SceneNode if I wanted it to move automatically with
+        //  other objects, but I don't
+        l->setPosition(20,80,50);
+
+        Entity *ent;
+
+        // Create an entity (the floor)
+        ent = mSceneMgr->createEntity("floor", "FloorPlane");
+        ent->setMaterialName("Examples/RustySteel");
+        // Attach to child of root node, better for culling (otherwise bounds are the combination of the 2)
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+
+        // Add a head, give it it's own node
+        SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        ent = mSceneMgr->createEntity("head", "ogrehead.mesh");
+        headNode->attachObject(ent);
+
+        // Add another head, give it it's own node
+        SceneNode* headNode2 = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        ent = mSceneMgr->createEntity("head2", "ogrehead.mesh");
+        headNode2->attachObject(ent);
+
+        // Make sure the head node tracks the root
+        headNode->setAutoTracking(true, headNode2, Vector3::UNIT_Z);
+        //headNode->setFixedYawAxis(true);
+
+        // Create the camera node & attach camera
+        //SceneNode* camNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        //camNode->attachObject(mCamera);
+
+        // set up spline animation of node
+        Animation* anim = mSceneMgr->createAnimation("CameraTrack", 10);
+        // Spline it for nice curves
+        anim->setInterpolationMode(Animation::IM_SPLINE);
+        // Create a track to animate the head's node
+        NodeAnimationTrack* track = anim->createNodeTrack(0, headNode);
+        // Setup keyframes
+        TransformKeyFrame* key = track->createNodeKeyFrame(0); // startposition
+        key = track->createNodeKeyFrame(2.5);
+        key->setTranslate(Vector3(500,500,-1000));
+        key = track->createNodeKeyFrame(5);
+        key->setTranslate(Vector3(-1500,1000,-600));
+        key = track->createNodeKeyFrame(7.5);
+        key->setTranslate(Vector3(0,-100,0));
+        key = track->createNodeKeyFrame(10);
+        key->setTranslate(Vector3(0,0,0));
+        // Create a track to animate the second head's node
+        track = anim->createNodeTrack(1, headNode2);
+        // Setup keyframes
+        key = track->createNodeKeyFrame(0); // startposition
+        key = track->createNodeKeyFrame(2.5);
+        key->setTranslate(Vector3(-500,600,-100));
+        key = track->createNodeKeyFrame(5);
+        key->setTranslate(Vector3(800,200,-600));
+        key = track->createNodeKeyFrame(7.5);
+        key->setTranslate(Vector3(200,-1000,0));
+        key = track->createNodeKeyFrame(10);
+        key->setTranslate(Vector3(30,70,110));
+        // Create a new animation state to track this
+        mAnimState = mSceneMgr->createAnimationState("CameraTrack");
+        mAnimState->setEnabled(true);
+    }
+    class ClearSceneListener : public FrameListener
+    {
+    protected:
+        SceneManager* mSceneMgr;
+        PlayPenApplication* ppApp;
+
+    public:
+        ClearSceneListener(SceneManager* sm, PlayPenApplication* target)
+        {
+            mSceneMgr = sm;
+            ppApp = target;
+        }
+        bool frameStarted(const FrameEvent& evt)
+        {
+            static Real timeElapsed = 0;
+
+            timeElapsed += evt.timeSinceLastFrame;
+            if (timeElapsed > 15)
+            {
+                mSceneMgr->clearScene();
+                ppApp->clearSceneSetup();
+                timeElapsed = 0;
+            }
+            return true;
+        }
+    };
+    ClearSceneListener* csListener;
+    void testClearScene()
+    {
+        // Define a floor plane mesh
+        Plane p;
+        p.normal = Vector3::UNIT_Y;
+        p.d = 200;
+        MeshManager::getSingleton().createPlane("FloorPlane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+			p,200000,200000,20,20,true,1,50,50,Vector3::UNIT_Z);
+
+
+        // leak here I know
+        csListener = new ClearSceneListener(mSceneMgr, this);
+        Root::getSingleton().addFrameListener(csListener);
+        clearSceneSetup();
+    }
+
+    void testStencilShadows(ShadowTechnique tech, bool pointLight, bool directionalLight)
+    {
+        mSceneMgr->setShadowTechnique(tech);
+        //mSceneMgr->setShowDebugShadows(true);
+        mSceneMgr->setShadowDirectionalLightExtrusionDistance(1000);
+        //mSceneMgr->setShadowColour(ColourValue(0.4, 0.25, 0.25));
+
+        //mSceneMgr->setShadowFarDistance(800);
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.0, 0.0, 0.0));
+        
+        // Point light
+        if(pointLight)
+        {
+            mLight = mSceneMgr->createLight("MainLight");
+            mLight->setPosition(-400,400,-300);
+            mLight->setDiffuseColour(0.9, 0.9, 1);
+            mLight->setSpecularColour(0.9, 0.9, 1);
+            mLight->setAttenuation(6000,1,0.001,0);
+        }
+        // Directional light
+        if (directionalLight)
+        {
+            mLight = mSceneMgr->createLight("Light2");
+            Vector3 dir(-1,-1,0);
+            dir.normalise();
+            mLight->setType(Light::LT_DIRECTIONAL);
+            mLight->setDirection(dir);
+            mLight->setDiffuseColour(1, 1, 0.8);
+            mLight->setSpecularColour(1, 1, 1);
+        }
+
+        mTestNode[0] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+
+		// Hardware skin
+        Entity* pEnt;
+        pEnt = mSceneMgr->createEntity( "1", "robot.mesh" );
+        AnimationState* anim = pEnt->getAnimationState("Walk");
+        anim->setEnabled(true);
+		mAnimStateList.push_back(anim);
+		mTestNode[0]->attachObject( pEnt );
+
+		// Software skin
+		pEnt = mSceneMgr->createEntity( "12", "robot.mesh" );
+		anim = pEnt->getAnimationState("Walk");
+		anim->setEnabled(true);
+		mAnimStateList.push_back(anim);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(100, 0, 0))->attachObject(pEnt);
+		pEnt->setMaterialName("Examples/Rocky");
+
+		// test object
+		//pEnt = mSceneMgr->createEntity("tst", "building.mesh");
+		//mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(300, 0, 0))->attachObject(pEnt);
+
+
+        // Does not receive shadows
+        pEnt = mSceneMgr->createEntity( "3", "knot.mesh" );
+        pEnt->setMaterialName("Examples/EnvMappedRustySteel");
+        MaterialPtr mat2 = MaterialManager::getSingleton().getByName("Examples/EnvMappedRustySteel");
+        mat2->setReceiveShadows(false);
+        mTestNode[2] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(-200, 0, -200));
+        mTestNode[2]->attachObject( pEnt );
+
+        // Transparent object 
+        pEnt = mSceneMgr->createEntity( "3.5", "knot.mesh" );
+        pEnt->setMaterialName("Examples/TransparentTest");
+        MaterialPtr mat3 = MaterialManager::getSingleton().getByName("Examples/TransparentTest");
+		pEnt->setCastShadows(false);
+        mTestNode[3] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(350, 0, -200));
+        mTestNode[3]->attachObject( pEnt );
+
+		// User test
+		/*
+		pEnt = mSceneMgr->createEntity( "3.6", "ogre_male_endCaps.mesh" );
+		mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(0, 0, 100))->attachObject( pEnt );
+		*/
+
+        MeshPtr msh = MeshManager::getSingleton().load("knot.mesh", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+        unsigned short src, dest;
+        if (!msh->suggestTangentVectorBuildParams(VES_TANGENT, src, dest))
+        {
+            msh->buildTangentVectors(VES_TANGENT, src, dest);
+        }
+        pEnt = mSceneMgr->createEntity( "4", "knot.mesh" );
+        pEnt->setMaterialName("Examples/BumpMapping/MultiLightSpecular");
+        mTestNode[2] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(100, 0, 200));
+        mTestNode[2]->attachObject( pEnt );
+
+		// controller based material
+		pEnt = mSceneMgr->createEntity( "432", "knot.mesh" );
+		pEnt->setMaterialName("Examples/TextureEffect2");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(100, 200, 200))->attachObject( pEnt );
+
+        ParticleSystem* pSys2 = mSceneMgr->createParticleSystem("smoke", 
+            "Examples/Smoke");
+        mTestNode[4] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(-300, -100, 200));
+        mTestNode[4]->attachObject(pSys2);
+
+
+        mSceneMgr->setSkyBox(true, "Examples/CloudyNoonSkyBox");
+
+
+        Plane plane;
+        plane.normal = Vector3::UNIT_Y;
+        plane.d = 100;
+        MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+            1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+        Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+        pPlaneEnt->setMaterialName("2 - Default");
+        pPlaneEnt->setCastShadows(false);
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+        mCamera->setPosition(180, 34, 223);
+        mCamera->setOrientation(Quaternion(0.7265, -0.2064, 0.6304, 0.1791));
+
+		// Create a render texture
+		TexturePtr rtt = TextureManager::getSingleton().createManual("rtt0", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+			TEX_TYPE_2D, 512, 512, 0, PF_R8G8B8, TU_RENDERTARGET);
+		rtt->getBuffer()->getRenderTarget()->addViewport(mCamera);
+		// Create an overlay showing the rtt
+		MaterialPtr debugMat = MaterialManager::getSingleton().create(
+			"DebugRTT", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		debugMat->getTechnique(0)->getPass(0)->setLightingEnabled(false);
+		TextureUnitState *t = debugMat->getTechnique(0)->getPass(0)->createTextureUnitState("rtt0");
+		t->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
+		OverlayContainer* debugPanel = (OverlayContainer*)
+			(OverlayManager::getSingleton().createOverlayElement("Panel", "Ogre/DebugShadowPanel"));
+		debugPanel->_setPosition(0.6, 0);
+		debugPanel->_setDimensions(0.4, 0.6);
+		debugPanel->setMaterialName("DebugRTT");
+		Overlay* debugOverlay = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
+		debugOverlay->add2D(debugPanel);
+
+
+    }
+
+	void testStencilShadowsMixedOpSubMeshes(bool pointLight, bool directionalLight)
+	{
+		mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_MODULATIVE);
+		//mSceneMgr->setShowDebugShadows(true);
+		mSceneMgr->setShadowDirectionalLightExtrusionDistance(1000);
+
+		//mSceneMgr->setShadowFarDistance(800);
+		// Set ambient light
+		mSceneMgr->setAmbientLight(ColourValue(0.0, 0.0, 0.0));
+
+		// Point light
+		if(pointLight)
+		{
+			mLight = mSceneMgr->createLight("MainLight");
+			mLight->setPosition(-400,400,-300);
+			mLight->setDiffuseColour(0.9, 0.9, 1);
+			mLight->setSpecularColour(0.9, 0.9, 1);
+			mLight->setAttenuation(6000,1,0.001,0);
+		}
+		// Directional light
+		if (directionalLight)
+		{
+			mLight = mSceneMgr->createLight("Light2");
+			Vector3 dir(-1,-1,0);
+			dir.normalise();
+			mLight->setType(Light::LT_DIRECTIONAL);
+			mLight->setDirection(dir);
+			mLight->setDiffuseColour(1, 1, 0.8);
+			mLight->setSpecularColour(1, 1, 1);
+		}
+
+		mSceneMgr->setSkyBox(true, "Examples/CloudyNoonSkyBox");
+
+
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 100;
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+		Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("2 - Default");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+		mCamera->setPosition(180, 34, 223);
+		mCamera->setOrientation(Quaternion(0.7265, -0.2064, 0.6304, 0.1791));
+
+
+		ManualObject* man = mSceneMgr->createManualObject("testMO");
+		man->begin("2 - Default");
+		man->position(0, 200, 0);
+		man->position(0, 50, 100);
+		man->position(100, 50, -100);
+		man->position(-100, 50, -100);
+		man->triangle(0, 1, 2);
+		man->triangle(0, 2, 3);
+		man->triangle(0, 3, 1);
+		man->end();
+		man->begin("2 - Default", RenderOperation::OT_LINE_STRIP);
+		man->position(0, 200, 0);
+		man->position(50, 250, 0);
+		man->position(200, 300, 0);
+		man->index(0);
+		man->index(1);
+		man->index(2);
+		man->end();
+		MeshPtr msh = man->convertToMesh("testMO.mesh");
+		
+		Entity* e = mSceneMgr->createEntity("34", "testMO.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+
+
+
+	}
+    void test2Spotlights()
+    {
+        mSceneMgr->setAmbientLight(ColourValue(0.3, 0.3, 0.3));
+
+        mLight = mSceneMgr->createLight("MainLight");
+        // Spotlight test
+        mLight->setType(Light::LT_SPOTLIGHT);
+        mLight->setDiffuseColour(1.0, 0.0, 0.8);
+        mLight->setSpotlightRange(Degree(30), Degree(40));
+        mTestNode[0] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        mTestNode[0]->setPosition(800,600,0);
+        mTestNode[0]->lookAt(Vector3(800,0,0), Node::TS_WORLD, Vector3::UNIT_Z);
+        mTestNode[0]->attachObject(mLight);
+
+        mTestNode[1] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        mLight = mSceneMgr->createLight("AnotherLight");
+        // Spotlight test
+        mLight->setType(Light::LT_SPOTLIGHT);
+        mLight->setDiffuseColour(0, 1.0, 0.8);
+        mLight->setSpotlightRange(Degree(30), Degree(40));
+        mTestNode[1] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        mTestNode[1]->setPosition(0,600,800);
+        mTestNode[1]->lookAt(Vector3(0,0,800), Node::TS_WORLD, Vector3::UNIT_Z);
+        mTestNode[1]->attachObject(mLight);
+
+
+        Plane plane;
+        plane.normal = Vector3::UNIT_Y;
+        plane.d = 100;
+        MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+            3500,3500,100,100,true,1,5,5,Vector3::UNIT_Z);
+        Entity* pPlaneEnt;
+        pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+        pPlaneEnt->setMaterialName("2 - Default");
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+    }
+
+	void addTextureShadowDebugOverlay(size_t num)
+	{
+		Overlay* debugOverlay = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
+
+		for (size_t i = 0; i < num; ++i)
+		{
+			// Set up a debug panel to display the shadow
+			MaterialPtr debugMat = MaterialManager::getSingleton().create(
+				"Ogre/DebugShadowMap" + StringConverter::toString(i), 
+				ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+			debugMat->getTechnique(0)->getPass(0)->setLightingEnabled(false);
+			TexturePtr shadowTex = mSceneMgr->getShadowTexture(i);
+			TextureUnitState *t = debugMat->getTechnique(0)->getPass(0)->createTextureUnitState(shadowTex->getName());
+			t->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
+			//t = debugMat->getTechnique(0)->getPass(0)->createTextureUnitState("spot_shadow_fade.png");
+			//t->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
+			//t->setColourOperation(LBO_ADD);
+
+			OverlayContainer* debugPanel = (OverlayContainer*)
+				(OverlayManager::getSingleton().createOverlayElement("Panel", "Ogre/DebugShadowPanel" + StringConverter::toString(i)));
+			debugPanel->_setPosition(0.8, i*0.3);
+			debugPanel->_setDimensions(0.2, 0.28);
+			debugPanel->setMaterialName(debugMat->getName());
+			debugOverlay->add2D(debugPanel);
+
+		}
+
+	}
+
+
+    void testTextureShadows(ShadowTechnique tech)
+    {
+        mSceneMgr->setShadowTextureSize(1024);
+        mSceneMgr->setShadowTechnique(tech);
+
+		FocusedShadowCameraSetup* lispsmSetup = new FocusedShadowCameraSetup();
+		//lispsmSetup->setOptimalAdjustFactor(2);
+		mSceneMgr->setShadowCameraSetup(ShadowCameraSetupPtr(lispsmSetup));
+
+        mSceneMgr->setShadowFarDistance(10000);
+        mSceneMgr->setShadowColour(ColourValue(0.35, 0.35, 0.35));
+        //mSceneMgr->setShadowFarDistance(800);
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.3, 0.3, 0.3));
+
+        mLight = mSceneMgr->createLight("MainLight");
+
+		
+        // Directional test
+		
+        mLight->setType(Light::LT_DIRECTIONAL);
+        Vector3 vec(-1,-1,0);
+        vec.normalise();
+        mLight->setDirection(vec);
+				
+		
+        // Spotlight test
+		/*
+        mLight->setType(Light::LT_SPOTLIGHT);
+        mLight->setDiffuseColour(1.0, 1.0, 0.8);
+        mTestNode[0] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        mTestNode[0]->setPosition(800,600,0);
+        mTestNode[0]->lookAt(Vector3(0,0,0), Node::TS_WORLD, Vector3::UNIT_Z);
+        mTestNode[0]->attachObject(mLight);
+		*/		
+
+        mTestNode[1] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+
+
+        Entity* pEnt;
+        pEnt = mSceneMgr->createEntity( "1", "robot.mesh" );
+		//pEnt->setRenderingDistance(100);
+        mAnimState = pEnt->getAnimationState("Walk");
+        mAnimState->setEnabled(true);
+        //pEnt->setMaterialName("2 - Default");
+        mTestNode[1]->attachObject( pEnt );
+        mTestNode[1]->translate(0,-100,0);
+
+        pEnt = mSceneMgr->createEntity( "3", "knot.mesh" );
+        mTestNode[2] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(-200, 0, -200));
+        mTestNode[2]->attachObject( pEnt );
+
+		createRandomEntityClones(pEnt, 20, Vector3(-1000,0,-1000), Vector3(1000,0,1000));
+
+
+        // Transparent object (can force cast shadows)
+        pEnt = mSceneMgr->createEntity( "3.5", "knot.mesh" );
+		MaterialPtr tmat = MaterialManager::getSingleton().create("TestAlphaTransparency", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		tmat->setTransparencyCastsShadows(true);
+		Pass* tpass = tmat->getTechnique(0)->getPass(0);
+		tpass->setAlphaRejectSettings(CMPF_GREATER, 150);
+		tpass->setSceneBlending(SBT_TRANSPARENT_ALPHA);
+		tpass->createTextureUnitState("gras_02.png");
+		tpass->setCullingMode(CULL_NONE);
+
+        pEnt->setMaterialName("TestAlphaTransparency");
+        mTestNode[3] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(350, 0, -200));
+        mTestNode[3]->attachObject( pEnt );
+
+        MeshPtr msh = MeshManager::getSingleton().load("knot.mesh",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+        msh->buildTangentVectors(VES_TANGENT, 0, 0);
+        pEnt = mSceneMgr->createEntity( "4", "knot.mesh" );
+        //pEnt->setMaterialName("Examples/BumpMapping/MultiLightSpecular");
+        mTestNode[2] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(100, 0, 200));
+        mTestNode[2]->attachObject( pEnt );
+
+        mSceneMgr->setSkyBox(true, "Examples/CloudyNoonSkyBox");
+
+
+
+        movablePlane.normal = Vector3::UNIT_Y;
+        movablePlane.d = 100;
+        MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, movablePlane,
+            2500,2500,10,10,true,1,5,5,Vector3::UNIT_Z);
+        Entity* pPlaneEnt;
+        pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		if (tech & SHADOWDETAILTYPE_INTEGRATED)
+		{
+			pPlaneEnt->setMaterialName("Examples/Plane/IntegratedShadows");
+		}
+		else
+		{
+			pPlaneEnt->setMaterialName("2 - Default");
+		}
+        pPlaneEnt->setCastShadows(false);
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+		addTextureShadowDebugOverlay(1);
+
+
+		/*
+        ParticleSystem* pSys2 = mSceneMgr->createParticleSystem("smoke", 
+            "Examples/Smoke");
+        mTestNode[4] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(-300, -100, 200));
+        mTestNode[4]->attachObject(pSys2);
+		*/
+
+		mCamera->setPosition(0, 1000, 0);
+		mCamera->setFixedYawAxis(false);
+		mCamera->lookAt(0,0,0);
+
+
+    }
+
+	void testTextureShadowsCustomCasterMat(ShadowTechnique tech)
+	{
+
+		testTextureShadows(tech);
+
+		String customCasterMatVp = 
+			"void customCasterVp(float4 position : POSITION,\n"
+			"out float4 oPosition : POSITION,\n"
+			"uniform float4x4 worldViewProj)\n"
+			"{\n"
+			"	oPosition = mul(worldViewProj, position);\n"
+			"}\n";
+		String customCasterMatFp = 
+			"void customCasterFp(\n"
+			"out float4 oColor : COLOR)\n"
+			"{\n"
+			"	oColor = float4(1,1,0,1); // just a test\n"
+			"}\n";
+
+		HighLevelGpuProgramPtr vp = HighLevelGpuProgramManager::getSingleton()
+			.createProgram("CustomShadowCasterVp", 
+				ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+				"cg", GPT_VERTEX_PROGRAM);
+		vp->setSource(customCasterMatVp);
+		vp->setParameter("profiles", "vs_1_1 arbvp1");
+		vp->setParameter("entry_point", "customCasterVp");
+		vp->load();
+
+		HighLevelGpuProgramPtr fp = HighLevelGpuProgramManager::getSingleton()
+			.createProgram("CustomShadowCasterFp", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+			"cg", GPT_FRAGMENT_PROGRAM);
+		fp->setSource(customCasterMatFp);
+		fp->setParameter("profiles", "ps_1_1 arbfp1");
+		fp->setParameter("entry_point", "customCasterFp");
+		fp->load();
+		
+		MaterialPtr mat = MaterialManager::getSingleton().create("CustomShadowCaster", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* p = mat->getTechnique(0)->getPass(0);
+		p->setVertexProgram("CustomShadowCasterVp");
+		p->getVertexProgramParameters()->setNamedAutoConstant(
+			"worldViewProj", GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);
+		p->setFragmentProgram("CustomShadowCasterFp");
+
+		mSceneMgr->setShadowTextureCasterMaterial("CustomShadowCaster");
+
+
+		
+
+
+	}
+
+	void testTextureShadowsCustomReceiverMat(ShadowTechnique tech)
+	{
+		testTextureShadows(tech);
+
+		String customReceiverMatVp = 
+			"void customReceiverVp(float4 position : POSITION,\n"
+			"out float4 oPosition : POSITION,\n"
+			"out float2 oUV : TEXCOORD0,\n"
+			"uniform float4x4 texViewProj,\n"
+			"uniform float4x4 worldViewProj)\n"
+			"{\n"
+			"	oPosition = mul(worldViewProj, position);\n"
+			"	float4 suv = mul(texViewProj, position);\n"
+			"	oUV = suv.xy / suv.w;\n"
+			"}\n";
+		String customReceiverMatFp = 
+			"void customReceiverFp(\n"
+			"float2 uv : TEXCOORD0,\n"
+			"uniform sampler2D shadowTex : register(s0),\n"
+			"out float4 oColor : COLOR)\n"
+			"{\n"
+			"	float4 shadow = tex2D(shadowTex, uv);\n"
+			"	oColor = shadow * float4(1,0,1,1); // just a test\n"
+			"}\n";
+
+		HighLevelGpuProgramPtr vp = HighLevelGpuProgramManager::getSingleton()
+			.createProgram("CustomShadowReceiverVp", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+			"cg", GPT_VERTEX_PROGRAM);
+		vp->setSource(customReceiverMatVp);
+		vp->setParameter("profiles", "vs_1_1 arbvp1");
+		vp->setParameter("entry_point", "customReceiverVp");
+		vp->load();
+
+		HighLevelGpuProgramPtr fp = HighLevelGpuProgramManager::getSingleton()
+			.createProgram("CustomShadowReceiverFp", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+			"cg", GPT_FRAGMENT_PROGRAM);
+		fp->setSource(customReceiverMatFp);
+		fp->setParameter("profiles", "ps_1_1 arbfp1");
+		fp->setParameter("entry_point", "customReceiverFp");
+		fp->load();
+
+		MaterialPtr mat = MaterialManager::getSingleton().create("CustomShadowReceiver", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* p = mat->getTechnique(0)->getPass(0);
+		p->setVertexProgram("CustomShadowReceiverVp");
+		p->getVertexProgramParameters()->setNamedAutoConstant(
+			"worldViewProj", GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);
+		p->getVertexProgramParameters()->setNamedAutoConstant(
+			"texViewProj", GpuProgramParameters::ACT_TEXTURE_VIEWPROJ_MATRIX);
+		p->setFragmentProgram("CustomShadowReceiverFp");
+		p->createTextureUnitState(); // shadow texture will populate
+
+		mSceneMgr->setShadowTextureReceiverMaterial("CustomShadowReceiver");
+
+
+
+	}
+
+
+	//---------------------------------------------------------------------------
+	class GaussianListener: public Ogre::CompositorInstance::Listener
+	{
+	protected:
+		int mVpWidth, mVpHeight;
+		// Array params - have to pack in groups of 4 since this is how Cg generates them
+		// also prevents dependent texture read problems if ops don't require swizzle
+		float mBloomTexWeights[15][4];
+		float mBloomTexOffsetsHorz[15][4];
+		float mBloomTexOffsetsVert[15][4];
+	public:
+		GaussianListener() {}
+		virtual ~GaussianListener() {}
+		void notifyViewportSize(int width, int height)
+		{
+			mVpWidth = width;
+			mVpHeight = height;
+			// Calculate gaussian texture offsets & weights
+			float deviation = 3.0f;
+			float texelSize = 1.0f / (float)std::min(mVpWidth, mVpHeight);
+
+			// central sample, no offset
+			mBloomTexOffsetsHorz[0][0] = 0.0f;
+			mBloomTexOffsetsHorz[0][1] = 0.0f;
+			mBloomTexWeights[0][0] = mBloomTexWeights[0][1] = 
+				mBloomTexWeights[0][2] = Ogre::Math::gaussianDistribution(0, 0, deviation);
+			mBloomTexWeights[0][3] = 1.0f;
+
+			// 'pre' samples
+			for(int i = 1; i < 8; ++i)
+			{
+				mBloomTexWeights[i][0] = mBloomTexWeights[i][1] = 
+					mBloomTexWeights[i][2] = Ogre::Math::gaussianDistribution(i, 0, deviation);
+				mBloomTexWeights[i][3] = 1.0f;
+				mBloomTexOffsetsHorz[i][0] = i * texelSize;
+				mBloomTexOffsetsHorz[i][1] = 0.0f;
+				mBloomTexOffsetsVert[i][0] = 0.0f;
+				mBloomTexOffsetsVert[i][1] = i * texelSize;
+			}
+			// 'post' samples
+			for(int i = 8; i < 15; ++i)
+			{
+				mBloomTexWeights[i][0] = mBloomTexWeights[i][1] = 
+					mBloomTexWeights[i][2] = mBloomTexWeights[i - 7][0];
+				mBloomTexWeights[i][3] = 1.0f;
+
+				mBloomTexOffsetsHorz[i][0] = -mBloomTexOffsetsHorz[i - 7][0];
+				mBloomTexOffsetsHorz[i][1] = 0.0f;
+				mBloomTexOffsetsVert[i][0] = 0.0f;
+				mBloomTexOffsetsVert[i][1] = -mBloomTexOffsetsVert[i - 7][1];
+			}
+
+		}
+		virtual void notifyMaterialSetup(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat)
+		{
+			// Prepare the fragment params offsets
+			switch(pass_id)
+			{
+			case 701: // blur horz
+				{
+					// horizontal bloom
+					mat->load();
+					Ogre::GpuProgramParametersSharedPtr fparams = 
+						mat->getBestTechnique()->getPass(0)->getFragmentProgramParameters();
+					const Ogre::String& progName = mat->getBestTechnique()->getPass(0)->getFragmentProgramName();
+					fparams->setNamedConstant("sampleOffsets", mBloomTexOffsetsHorz[0], 15);
+					fparams->setNamedConstant("sampleWeights", mBloomTexWeights[0], 15);
+
+					break;
+				}
+			case 700: // blur vert
+				{
+					// vertical bloom 
+					mat->load();
+					Ogre::GpuProgramParametersSharedPtr fparams = 
+						mat->getTechnique(0)->getPass(0)->getFragmentProgramParameters();
+					const Ogre::String& progName = mat->getBestTechnique()->getPass(0)->getFragmentProgramName();
+					fparams->setNamedConstant("sampleOffsets", mBloomTexOffsetsVert[0], 15);
+					fparams->setNamedConstant("sampleWeights", mBloomTexWeights[0], 15);
+
+					break;
+				}
+			}
+
+		}
+		virtual void notifyMaterialRender(Ogre::uint32 pass_id, Ogre::MaterialPtr &mat)
+		{
+
+		}
+	};
+	GaussianListener gaussianListener;
+
+	void testCompositorTextureShadows(ShadowTechnique tech)
+	{
+		mSceneMgr->setShadowTextureSize(512);
+		mSceneMgr->setShadowTechnique(tech);
+		mSceneMgr->setShadowFarDistance(1500);
+		mSceneMgr->setShadowColour(ColourValue(0.35, 0.35, 0.35));
+		//mSceneMgr->setShadowFarDistance(800);
+		// Set ambient light
+		mSceneMgr->setAmbientLight(ColourValue(0.3, 0.3, 0.3));
+
+		mLight = mSceneMgr->createLight("MainLight");
+
+		/*
+		// Directional test
+		mLight->setType(Light::LT_DIRECTIONAL);
+		Vector3 vec(-1,-1,0);
+		vec.normalise();
+		mLight->setDirection(vec);
+
+		*/
+		// Spotlight test
+		mLight->setType(Light::LT_SPOTLIGHT);
+		mLight->setDiffuseColour(1.0, 1.0, 0.8);
+		mTestNode[0] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		mTestNode[0]->setPosition(800,600,0);
+		mTestNode[0]->lookAt(Vector3(0,0,0), Node::TS_WORLD, Vector3::UNIT_Z);
+		mTestNode[0]->attachObject(mLight);
+		
+
+		mTestNode[1] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+
+
+		Entity* pEnt;
+		pEnt = mSceneMgr->createEntity( "1", "robot.mesh" );
+		//pEnt->setRenderingDistance(100);
+		mAnimState = pEnt->getAnimationState("Walk");
+		mAnimState->setEnabled(true);
+		//pEnt->setMaterialName("2 - Default");
+		mTestNode[1]->attachObject( pEnt );
+		mTestNode[1]->translate(0,-100,0);
+
+		pEnt = mSceneMgr->createEntity( "3", "knot.mesh" );
+		mTestNode[2] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(-200, 0, -200));
+		mTestNode[2]->attachObject( pEnt );
+
+		// Transparent object (can force cast shadows)
+		pEnt = mSceneMgr->createEntity( "3.5", "knot.mesh" );
+		MaterialPtr tmat = MaterialManager::getSingleton().create("TestAlphaTransparency", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		tmat->setTransparencyCastsShadows(true);
+		Pass* tpass = tmat->getTechnique(0)->getPass(0);
+		tpass->setAlphaRejectSettings(CMPF_GREATER, 150);
+		tpass->setSceneBlending(SBT_TRANSPARENT_ALPHA);
+		tpass->createTextureUnitState("gras_02.png");
+		tpass->setCullingMode(CULL_NONE);
+
+		pEnt->setMaterialName("TestAlphaTransparency");
+		mTestNode[3] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(350, 0, -200));
+		mTestNode[3]->attachObject( pEnt );
+
+		MeshPtr msh = MeshManager::getSingleton().load("knot.mesh",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		msh->buildTangentVectors(VES_TANGENT, 0, 0);
+		pEnt = mSceneMgr->createEntity( "4", "knot.mesh" );
+		//pEnt->setMaterialName("Examples/BumpMapping/MultiLightSpecular");
+		mTestNode[2] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(100, 0, 200));
+		mTestNode[2]->attachObject( pEnt );
+
+		mSceneMgr->setSkyBox(true, "Examples/CloudyNoonSkyBox");
+
+
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 100;
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+		Entity* pPlaneEnt;
+		pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("2 - Default");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+		// Set up a debug panel to display the shadow
+		addTextureShadowDebugOverlay(1);
+
+
+
+		ParticleSystem* pSys2 = mSceneMgr->createParticleSystem("smoke", 
+			"Examples/Smoke");
+		mTestNode[4] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(-300, -100, 200));
+		mTestNode[4]->attachObject(pSys2);
+
+		TexturePtr shadowTex = mSceneMgr->getShadowTexture(0);
+		RenderTarget* shadowRtt = shadowTex->getBuffer()->getRenderTarget();
+		Viewport* vp = shadowRtt->getViewport(0);
+		Ogre::CompositorInstance *instance = 
+			CompositorManager::getSingleton().addCompositor(vp, "Gaussian Blur");
+		CompositorManager::getSingleton().setCompositorEnabled(
+			vp, "Gaussian Blur", true);
+		instance->addListener(&gaussianListener);
+		gaussianListener.notifyViewportSize(vp->getActualWidth(), vp->getActualHeight());
+
+
+
+
+
+	}
+
+    void testOverlayZOrder(void)
+    {
+        Overlay* o = OverlayManager::getSingleton().getByName("Test/Overlay3");
+        o->show();
+        o = OverlayManager::getSingleton().getByName("Test/Overlay2");
+        o->show();
+        o = OverlayManager::getSingleton().getByName("Test/Overlay1");
+        o->show();
+    }
+
+    void createRandomEntityClones(Entity* ent, size_t cloneCount, 
+        const Vector3& min, const Vector3& max)
+    {
+        Entity *cloneEnt;
+        for (size_t n = 0; n < cloneCount; ++n)
+        {
+            // Create a new node under the root
+            SceneNode* node = mSceneMgr->createSceneNode();
+            // Random translate
+            Vector3 nodePos;
+            nodePos.x = Math::RangeRandom(min.x, max.x);
+            nodePos.y = Math::RangeRandom(min.y, max.y);
+            nodePos.z = Math::RangeRandom(min.z, max.z);
+            node->setPosition(nodePos);
+            mSceneMgr->getRootSceneNode()->addChild(node);
+            cloneEnt = ent->clone(ent->getName() + "_clone" + StringConverter::toString(n));
+            // Attach to new node
+            node->attachObject(cloneEnt);
+
+        }
+    }
+
+    void testIntersectionSceneQuery()
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setType(Light::LT_DIRECTIONAL);
+        l->setDirection(-Vector3::UNIT_Y);
+
+        // Create a set of random balls
+        Entity* ent = mSceneMgr->createEntity("Ball", "sphere.mesh");
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+        createRandomEntityClones(ent, 500, Vector3(-5000,-5000,-5000), Vector3(5000,5000,5000));
+
+        intersectionQuery = mSceneMgr->createIntersectionQuery();
+    }
+
+    void testRaySceneQuery()
+    {
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+        // Create a point light
+        Light* l = mSceneMgr->createLight("MainLight");
+        l->setType(Light::LT_DIRECTIONAL);
+        l->setDirection(-Vector3::UNIT_Y);
+
+        // Create a set of random balls
+        Entity* ent = mSceneMgr->createEntity("Ball", "sphere.mesh");
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+        createRandomEntityClones(ent, 100, Vector3(-1000,-1000,-1000), Vector3(1000,1000,1000));
+
+        rayQuery = mSceneMgr->createRayQuery(
+			mCamera->getCameraToViewportRay(0.5, 0.5));
+        rayQuery->setSortByDistance(true, 1);
+
+        bool val = true;
+        mSceneMgr->setOption("ShowOctree", &val);
+
+		//mCamera->setFarClipDistance(0);
+
+    }
+
+	void testLotsAndLotsOfEntities()
+	{
+		// Set ambient light
+		mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+		// Create a point light
+		Light* l = mSceneMgr->createLight("MainLight");
+		l->setType(Light::LT_DIRECTIONAL);
+		l->setDirection(-Vector3::UNIT_Y);
+
+		// Create a set of random balls
+		Entity* ent = mSceneMgr->createEntity("Ball", "ogrehead.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+		createRandomEntityClones(ent, 400, Vector3(-2000,-2000,-2000), Vector3(2000,2000,2000));
+
+		//bool val = true;
+		//mSceneMgr->setOption("ShowOctree", &val);
+
+	}
+
+	void testSimpleMesh()
+	{
+		// Set ambient light
+		mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+		// Create a point light
+		Light* l = mSceneMgr->createLight("MainLight");
+		l->setType(Light::LT_DIRECTIONAL);
+		Vector3 dir(1, -1, 0);
+		dir.normalise();
+		l->setDirection(dir);
+
+		// Create a set of random balls
+		Entity* ent = mSceneMgr->createEntity("test", "xsicylinder.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+
+	}
+
+	void testGLSLTangent()
+	{
+
+		Entity* ent = mSceneMgr->createEntity("test", "athene.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+		ent->setMaterialName("testglsl");
+	}
+
+	void testInfiniteAAB()
+	{
+		// When using the BspSceneManager
+		//mSceneMgr->setWorldGeometry("ogretestmap.bsp");
+
+		// When using the TerrainSceneManager
+		mSceneMgr->setWorldGeometry("terrain.cfg");
+
+		AxisAlignedBox b1; // null
+		assert( b1.isNull() );
+		
+		AxisAlignedBox b2(Vector3::ZERO, 5.0 * Vector3::UNIT_SCALE); // finite
+		assert( b2.isFinite() );
+
+		AxisAlignedBox b3;
+		b3.setInfinite();
+		assert( b3.isInfinite() );
+
+		{
+			// Create background material
+			MaterialPtr material = MaterialManager::getSingleton().create("Background", "General");
+			material->getTechnique(0)->getPass(0)->createTextureUnitState("rockwall.tga");
+			material->getTechnique(0)->getPass(0)->setDepthCheckEnabled(false);
+			material->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
+			material->getTechnique(0)->getPass(0)->setLightingEnabled(false);
+
+			// Create left background rectangle
+			// NOTE: Uses finite aab
+			Rectangle2D* rect1 = new Rectangle2D(true);
+			rect1->setCorners(-0.5, 0.1, -0.1, -0.1);
+			// Hacky, set small bounding box, to show problem
+			rect1->setBoundingBox(AxisAlignedBox(-10.0*Vector3::UNIT_SCALE, 10.0*Vector3::UNIT_SCALE));
+			rect1->setMaterial("Background");
+			rect1->setRenderQueueGroup(RENDER_QUEUE_OVERLAY - 1);
+			SceneNode* node = mSceneMgr->getRootSceneNode()->createChildSceneNode("Background1");
+			node->attachObject(rect1);
+
+			// Create right background rectangle
+			// NOTE: Uses infinite aab
+			Rectangle2D* rect2 = new Rectangle2D(true);
+			rect2->setCorners(0.1, 0.1, 0.5, -0.1);
+			AxisAlignedBox aabInf; aabInf.setInfinite();
+			rect2->setBoundingBox(aabInf);
+			rect2->setMaterial("Background");
+			rect2->setRenderQueueGroup(RENDER_QUEUE_OVERLAY - 1);
+			node = mSceneMgr->getRootSceneNode()->createChildSceneNode("Background2");
+			node->attachObject(rect2);
+
+			// Create a manual object for 2D
+			ManualObject* manual = mSceneMgr->createManualObject("manual");
+			manual->setUseIdentityProjection(true);
+			manual->setUseIdentityView(true);
+			manual->begin("BaseWhiteNoLighting", RenderOperation::OT_LINE_STRIP);
+			manual->position(-0.2, -0.2, 0.0);
+			manual->position( 0.2, -0.2, 0.0);
+			manual->position( 0.2,  0.2, 0.0);
+			manual->position(-0.2,  0.2, 0.0);
+			manual->index(0);
+			manual->index(1);
+			manual->index(2);
+			manual->index(3);
+			manual->index(0);
+			manual->end();
+			manual->setBoundingBox(aabInf); // Use infinite aab to always stay visible
+			rect2->setRenderQueueGroup(RENDER_QUEUE_OVERLAY - 1);
+			mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(manual);
+		}
+
+		mSceneMgr->showBoundingBoxes(true);
+
+		Entity* ent = mSceneMgr->createEntity("test", "ogrehead.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode(
+			"test", 50.0 * Vector3::UNIT_X)->attachObject(ent);
+	}
+
+	void test2Windows(void)
+	{
+		// Set ambient light
+		mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+		// Create a point light
+		Light* l = mSceneMgr->createLight("MainLight");
+		l->setType(Light::LT_DIRECTIONAL);
+		Vector3 dir(1, -1, 0);
+		dir.normalise();
+		l->setDirection(dir);
+
+		Entity* ent = mSceneMgr->createEntity("head", "robot.mesh");
+		AnimationState* a = ent->getAnimationState("Walk");
+		a->setEnabled(true);
+		mAnimStateList.push_back(a);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+
+		NameValuePairList valuePair;
+		valuePair["top"] = StringConverter::toString(0);
+		valuePair["left"] = StringConverter::toString(0);
+
+		RenderWindow* win2 = mRoot->createRenderWindow("window2", 800,600, true, &valuePair);
+		win2->addViewport(mCamera);
+
+
+
+	}
+
+	void testStaticGeometry(void)
+	{
+		mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_ADDITIVE);
+		//mSceneMgr->setShowDebugShadows(true);
+
+		mSceneMgr->setSkyBox(true, "Examples/EveningSkyBox");
+		// Set ambient light
+		mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+
+		// Create a point light
+		Light* l = mSceneMgr->createLight("MainLight");
+		l->setType(Light::LT_DIRECTIONAL);
+		Vector3 dir(0, -1, -1.5);
+		dir.normalise();
+		l->setDirection(dir);
+		l->setDiffuseColour(1.0, 0.7, 0.0);
+
+
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 0;
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			4500,4500,10,10,true,1,5,5,Vector3::UNIT_Z);
+		Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("Examples/GrassFloor");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+		Vector3 min(-2000,0,-2000);
+		Vector3 max(2000,0,2000);
+
+
+		Entity* e = mSceneMgr->createEntity("1", "column.mesh");
+		//createRandomEntityClones(e, 1000, min, max);
+		
+		StaticGeometry* s = mSceneMgr->createStaticGeometry("bing");
+		s->setCastShadows(true);
+		s->setRegionDimensions(Vector3(500,500,500));
+		for (int i = 0; i < 100; ++i)
+		{
+			Vector3 pos;
+			pos.x = Math::RangeRandom(min.x, max.x);
+			pos.y = Math::RangeRandom(min.y, max.y);
+			pos.z = Math::RangeRandom(min.z, max.z);
+
+			s->addEntity(e, pos, Quaternion::IDENTITY);
+
+		}
+
+		s->build();
+		//s->setRenderingDistance(1000);
+		//s->dump("static.txt");
+		//mSceneMgr->showBoundingBoxes(true);
+		mCamera->setLodBias(0.5);
+		
+
+
+
+	}
+
+	void testReloadResources()
+	{
+		mSceneMgr->setAmbientLight(ColourValue::White);
+		ResourceGroupManager::getSingleton().createResourceGroup("Sinbad");
+		Root::getSingleton().addResourceLocation("../../../Media/models", "FileSystem", "Sinbad");
+		MeshManager& mmgr = MeshManager::getSingleton();
+		mmgr.load("robot.mesh", "Sinbad");
+		mmgr.load("knot.mesh", "Sinbad");
+
+		Entity* e = mSceneMgr->createEntity("1", "robot.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+		e = mSceneMgr->createEntity("2", "robot.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(100,0,0))->attachObject(e);
+		e = mSceneMgr->createEntity("3", "knot.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(100,300,0))->attachObject(e);
+
+		testreload = true;
+
+	}
+
+	void testBillboardTextureCoords()
+	{
+		mSceneMgr->setAmbientLight(ColourValue::White);
+
+		BillboardSet* bbs = mSceneMgr->createBillboardSet("test");
+        BillboardSet* bbs2 = mSceneMgr->createBillboardSet("test2");
+		float xsegs = 3;
+		float ysegs = 3;
+		float width = 300;
+		float height = 300;
+		float gap = 20;
+
+		// set up texture coords
+		bbs->setTextureStacksAndSlices(ysegs, xsegs);
+		bbs->setDefaultDimensions(width/xsegs, height/xsegs);
+		bbs2->setDefaultDimensions(width/xsegs, height/xsegs);
+
+		for (float y = 0; y < ysegs; ++y)
+		{
+			for (float x = 0; x < xsegs; ++x)
+			{
+				Vector3 midPoint;
+				midPoint.x = (x * width / xsegs) + ((x-1) * gap);
+				midPoint.y = (y * height / ysegs) + ((y-1) * gap);
+				midPoint.z = 0;
+				Billboard* bb = bbs->createBillboard(midPoint);
+				bb->setTexcoordIndex((ysegs - y - 1)*xsegs + x);
+                Billboard* bb2 = bbs2->createBillboard(midPoint);
+                bb2->setTexcoordRect(
+                    FloatRect((x + 0) / xsegs, (ysegs - y - 1) / ysegs,
+                              (x + 1) / xsegs, (ysegs - y - 0) / ysegs));
+			}
+		}
+
+		bbs->setMaterialName("Examples/OgreLogo");
+        bbs2->setMaterialName("Examples/OgreLogo");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(bbs);
+        mSceneMgr->getRootSceneNode()
+            ->createChildSceneNode(Vector3(- (width + xsegs * gap), 0, 0))
+            ->attachObject(bbs2);
+
+	}
+
+	class SortFunctor
+	{
+	public:
+		int operator()(const int& p) const
+		{
+			return p;
+		}
+
+	};
+	void testRadixSort()
+	{
+		RadixSort<std::list<int>, int, int> rs;
+		SortFunctor f;
+
+		std::list<int> particles;
+		for (int r = 0; r < 20; ++r)
+		{
+			particles.push_back((int)Math::RangeRandom(-1e3f, 1e3f));
+		}
+
+		std::list<int>::iterator i;
+		LogManager::getSingleton().logMessage("BEFORE");
+		for (i = particles.begin(); i != particles.end(); ++i)
+		{
+			StringUtil::StrStreamType str;
+			str << *i;
+			LogManager::getSingleton().logMessage(str.str());
+		}
+
+		rs.sort(particles, f);
+
+
+		LogManager::getSingleton().logMessage("AFTER");
+		for (i = particles.begin(); i != particles.end(); ++i)
+		{
+			StringUtil::StrStreamType str;
+			str << *i;
+			LogManager::getSingleton().logMessage(str.str());
+		}
+
+
+
+	}
+
+	void testMorphAnimation()
+	{
+		bool testStencil = true;
+
+		if (testStencil)
+			mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_MODULATIVE);
+
+		mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+		Vector3 dir(-1, -1, 0.5);
+		dir.normalise();
+		Light* l = mSceneMgr->createLight("light1");
+		l->setType(Light::LT_DIRECTIONAL);
+		l->setDirection(dir);
+
+		
+		MeshPtr mesh = MeshManager::getSingleton().load("cube.mesh", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+
+		SubMesh* sm = mesh->getSubMesh(0);
+		// Re-organise geometry since this mesh has no animation and all 
+		// vertex elements are packed into one buffer
+		VertexDeclaration* newDecl = 
+			sm->vertexData->vertexDeclaration->getAutoOrganisedDeclaration(false, true);
+		sm->vertexData->reorganiseBuffers(newDecl);
+		if (testStencil)
+			sm->vertexData->prepareForShadowVolume(); // need to re-prep since reorganised
+		// get the position buffer (which should now be separate);
+		const VertexElement* posElem = 
+			sm->vertexData->vertexDeclaration->findElementBySemantic(VES_POSITION);
+		HardwareVertexBufferSharedPtr origbuf = 
+			sm->vertexData->vertexBufferBinding->getBuffer(
+				posElem->getSource());
+
+		// Create a new position buffer with updated values
+		HardwareVertexBufferSharedPtr newbuf = 
+			HardwareBufferManager::getSingleton().createVertexBuffer(
+				VertexElement::getTypeSize(VET_FLOAT3),
+				sm->vertexData->vertexCount, 
+				HardwareBuffer::HBU_STATIC, true);
+		float* pSrc = static_cast<float*>(origbuf->lock(HardwareBuffer::HBL_READ_ONLY));
+		float* pDst = static_cast<float*>(newbuf->lock(HardwareBuffer::HBL_DISCARD));
+
+		for (size_t v = 0; v < sm->vertexData->vertexCount; ++v)
+		{
+			// x
+			*pDst++ = *pSrc++;
+			// y (translate)
+			*pDst++ = (*pSrc++) + 100.0f;
+			// z
+			*pDst++ = *pSrc++;
+		}
+
+		origbuf->unlock();
+		newbuf->unlock();
+		
+		// create a morph animation
+		Animation* anim = mesh->createAnimation("testAnim", 10.0f);
+		VertexAnimationTrack* vt = anim->createVertexTrack(1, sm->vertexData, VAT_MORPH);
+		// re-use start positions for frame 0
+		VertexMorphKeyFrame* kf = vt->createVertexMorphKeyFrame(0);
+		kf->setVertexBuffer(origbuf);
+
+		// Use translated buffer for mid frame
+		kf = vt->createVertexMorphKeyFrame(5.0f);
+		kf->setVertexBuffer(newbuf);
+
+		// re-use start positions for final frame
+		kf = vt->createVertexMorphKeyFrame(10.0f);
+		kf->setVertexBuffer(origbuf);
+
+		// write
+		MeshSerializer ser;
+		ser.exportMesh(mesh.get(), "../../../Media/testmorph.mesh");
+		
+
+		Entity* e = mSceneMgr->createEntity("test", "testmorph.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+		AnimationState* animState = e->getAnimationState("testAnim");
+		animState->setEnabled(true);
+		animState->setWeight(1.0f);
+		mAnimStateList.push_back(animState);
+
+		e = mSceneMgr->createEntity("test2", "testmorph.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(100,0,0))->attachObject(e);
+		// test hardware morph
+		e->setMaterialName("Examples/HardwareMorphAnimation");
+		animState = e->getAnimationState("testAnim");
+		animState->setEnabled(true);
+		animState->setWeight(1.0f);
+		mAnimStateList.push_back(animState);
+
+		mCamera->setNearClipDistance(0.5);
+		//mSceneMgr->setShowDebugShadows(true);
+
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 200;
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+		Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("2 - Default");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+
+
+	}
+
+
+	void testPoseAnimation()
+	{
+		bool testStencil = false;
+
+		if (testStencil)
+			mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_MODULATIVE);
+
+		mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+		Vector3 dir(-1, -1, 0.5);
+		dir.normalise();
+		Light* l = mSceneMgr->createLight("light1");
+		l->setType(Light::LT_DIRECTIONAL);
+		l->setDirection(dir);
+
+		MeshPtr mesh = MeshManager::getSingleton().load("cube.mesh", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+
+		SubMesh* sm = mesh->getSubMesh(0);
+		// Re-organise geometry since this mesh has no animation and all 
+		// vertex elements are packed into one buffer
+		VertexDeclaration* newDecl = 
+			sm->vertexData->vertexDeclaration->getAutoOrganisedDeclaration(false, true);
+		sm->vertexData->reorganiseBuffers(newDecl);
+		if (testStencil)
+			sm->vertexData->prepareForShadowVolume(); // need to re-prep since reorganised
+		// get the position buffer (which should now be separate);
+		const VertexElement* posElem = 
+			sm->vertexData->vertexDeclaration->findElementBySemantic(VES_POSITION);
+		HardwareVertexBufferSharedPtr origbuf = 
+			sm->vertexData->vertexBufferBinding->getBuffer(
+			posElem->getSource());
+
+
+		// create 2 poses
+		Pose* pose = mesh->createPose(1, "pose1");
+		// Pose1 moves vertices 0, 1, 2 and 3 upward
+		Vector3 offset1(0, 50, 0);
+		pose->addVertex(0, offset1);
+		pose->addVertex(1, offset1);
+		pose->addVertex(2, offset1);
+		pose->addVertex(3, offset1);
+
+		pose = mesh->createPose(1, "pose2");
+		// Pose2 moves vertices 3, 4, and 5 to the right
+		// Note 3 gets affected by both
+		Vector3 offset2(100, 0, 0);
+		pose->addVertex(3, offset2);
+		pose->addVertex(4, offset2);
+		pose->addVertex(5, offset2);
+
+
+		Animation* anim = mesh->createAnimation("poseanim", 20.0f);
+		VertexAnimationTrack* vt = anim->createVertexTrack(1, sm->vertexData, VAT_POSE);
+		
+		// Frame 0 - no effect 
+		VertexPoseKeyFrame* kf = vt->createVertexPoseKeyFrame(0);
+
+		// Frame 1 - bring in pose 1 (index 0)
+		kf = vt->createVertexPoseKeyFrame(3);
+		kf->addPoseReference(0, 1.0f);
+
+		// Frame 2 - remove all 
+		kf = vt->createVertexPoseKeyFrame(6);
+
+		// Frame 3 - bring in pose 2 (index 1)
+		kf = vt->createVertexPoseKeyFrame(9);
+		kf->addPoseReference(1, 1.0f);
+
+		// Frame 4 - remove all
+		kf = vt->createVertexPoseKeyFrame(12);
+
+
+		// Frame 5 - bring in pose 1 at 50%, pose 2 at 100% 
+		kf = vt->createVertexPoseKeyFrame(15);
+		kf->addPoseReference(0, 0.5f);
+		kf->addPoseReference(1, 1.0f);
+
+		// Frame 6 - bring in pose 1 at 100%, pose 2 at 50% 
+		kf = vt->createVertexPoseKeyFrame(18);
+		kf->addPoseReference(0, 1.0f);
+		kf->addPoseReference(1, 0.5f);
+
+		// Frame 7 - reset
+		kf = vt->createVertexPoseKeyFrame(20);
+
+		// write
+		MeshSerializer ser;
+		ser.exportMesh(mesh.get(), "../../../Media/testpose.mesh");
+
+
+		Entity*  e;
+		AnimationState* animState;
+		// software pose
+		e = mSceneMgr->createEntity("test2", "testpose.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(150,0,0))->attachObject(e);
+		animState = e->getAnimationState("poseanim");
+		animState->setEnabled(true);
+		animState->setWeight(1.0f);
+		mAnimStateList.push_back(animState);
+		
+		// test hardware pose
+		e = mSceneMgr->createEntity("test", "testpose.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+		e->setMaterialName("Examples/HardwarePoseAnimation");
+		animState = e->getAnimationState("poseanim");
+		animState->setEnabled(true);
+		animState->setWeight(1.0f);
+		mAnimStateList.push_back(animState);
+		
+
+		mCamera->setNearClipDistance(0.5);
+		mSceneMgr->setShowDebugShadows(true);
+
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 200;
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+		Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("2 - Default");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+		mCamera->setPosition(0,0,-300);
+		mCamera->lookAt(0,0,0);
+
+
+
+	}
+
+	void testPoseAnimation2()
+	{
+		mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+		Vector3 dir(-1, -1, -0.5);
+		dir.normalise();
+		Light* l = mSceneMgr->createLight("light1");
+		l->setType(Light::LT_DIRECTIONAL);
+		l->setDirection(dir);
+
+		/*
+		MeshPtr mesh = MeshManager::getSingleton().load("facial.mesh", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Animation* anim = mesh->createAnimation("pose", 20);
+		VertexAnimationTrack* track = anim->createVertexTrack(4, VAT_POSE);
+		// Frame 0 - no effect 
+		VertexPoseKeyFrame* kf = track->createVertexPoseKeyFrame(0);
+
+		// bring in pose 4 (happy)
+		kf = track->createVertexPoseKeyFrame(5);
+		kf->addPoseReference(4, 1.0f);
+
+		// bring in pose 5 (sad)
+		kf = track->createVertexPoseKeyFrame(10);
+		kf->addPoseReference(5, 1.0f);
+
+		// bring in pose 6 (mad)
+		kf = track->createVertexPoseKeyFrame(15);
+		kf->addPoseReference(6, 1.0f);
+		
+		kf = track->createVertexPoseKeyFrame(20);
+		*/
+
+		// software pose
+		Entity* e = mSceneMgr->createEntity("test2", "facial.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(150,0,0))->attachObject(e);
+		AnimationState* animState = e->getAnimationState("Speak");
+		animState->setEnabled(true);
+		animState->setWeight(1.0f);
+		mAnimStateList.push_back(animState);
+
+
+		/*
+		// test hardware pose
+		e = mSceneMgr->createEntity("test", "testpose.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+		e->setMaterialName("Examples/HardwarePoseAnimation");
+		animState = e->getAnimationState("poseanim");
+		animState->setEnabled(true);
+		animState->setWeight(1.0f);
+		mAnimStateList.push_back(animState);
+		*/
+
+
+		mCamera->setNearClipDistance(0.5);
+		mSceneMgr->setShowDebugShadows(true);
+
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 200;
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+		Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("2 - Default");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+	}
+
+
+	void testReflectedBillboards()
+	{
+		// Set ambient light
+		mSceneMgr->setAmbientLight(ColourValue(0.2, 0.2, 0.2));
+
+		// Create a light
+		Light* l = mSceneMgr->createLight("MainLight");
+		l->setType(Light::LT_DIRECTIONAL);
+		Vector3 dir(0.5, -1, 0);
+		dir.normalise();
+		l->setDirection(dir);
+		l->setDiffuseColour(1.0f, 1.0f, 0.8f);
+		l->setSpecularColour(1.0f, 1.0f, 1.0f);
+
+
+		// Create a prefab plane
+		Plane plane;
+		plane.d = 0;
+		plane.normal = Vector3::UNIT_Y;
+		MeshManager::getSingleton().createPlane("ReflectionPlane", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+			plane, 2000, 2000, 
+			1, 1, true, 1, 1, 1, Vector3::UNIT_Z);
+		Entity* planeEnt = mSceneMgr->createEntity( "Plane", "ReflectionPlane" );
+
+		// Attach the rtt entity to the root of the scene
+		SceneNode* rootNode = mSceneMgr->getRootSceneNode();
+		SceneNode* planeNode = rootNode->createChildSceneNode();
+
+		// Attach both the plane entity, and the plane definition
+		planeNode->attachObject(planeEnt);
+
+		RenderTexture* rttTex = mRoot->getRenderSystem()->createRenderTexture( "RttTex", 512, 512, TEX_TYPE_2D, PF_R8G8B8 );
+		{
+			reflectCam = mSceneMgr->createCamera("ReflectCam");
+			reflectCam->setNearClipDistance(mCamera->getNearClipDistance());
+			reflectCam->setFarClipDistance(mCamera->getFarClipDistance());
+			reflectCam->setAspectRatio(
+				(Real)mWindow->getViewport(0)->getActualWidth() / 
+				(Real)mWindow->getViewport(0)->getActualHeight());
+
+			Viewport *v = rttTex->addViewport( reflectCam );
+			v->setClearEveryFrame( true );
+			v->setBackgroundColour( ColourValue::Black );
+
+			MaterialPtr mat = MaterialManager::getSingleton().create("RttMat",
+				ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+			TextureUnitState* t = mat->getTechnique(0)->getPass(0)->createTextureUnitState("RustedMetal.jpg");
+			t = mat->getTechnique(0)->getPass(0)->createTextureUnitState("RttTex");
+			// Blend with base texture
+			t->setColourOperationEx(LBX_BLEND_MANUAL, LBS_TEXTURE, LBS_CURRENT, ColourValue::White, 
+				ColourValue::White, 0.25);
+			t->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
+			t->setProjectiveTexturing(true, reflectCam);
+
+			// set up linked reflection
+			reflectCam->enableReflection(plane);
+			// Also clip
+			reflectCam->enableCustomNearClipPlane(plane);
+		}
+
+		// Give the plane a texture
+		planeEnt->setMaterialName("RttMat");
+
+
+		// point billboards
+		ParticleSystem* pSys2 = mSceneMgr->createParticleSystem("fountain1", 
+			"Examples/Smoke");
+		// Point the fountain at an angle
+		SceneNode* fNode = static_cast<SceneNode*>(rootNode->createChild());
+		fNode->attachObject(pSys2);
+
+		// oriented_self billboards
+		ParticleSystem* pSys3 = mSceneMgr->createParticleSystem("fountain2", 
+			"Examples/PurpleFountain");
+		// Point the fountain at an angle
+		fNode = rootNode->createChildSceneNode();
+		fNode->translate(-200,-100,0);
+		fNode->rotate(Vector3::UNIT_Z, Degree(-20));
+		fNode->attachObject(pSys3);
+
+
+
+		// oriented_common billboards
+		ParticleSystem* pSys4 = mSceneMgr->createParticleSystem("rain", 
+			"Examples/Rain");
+		SceneNode* rNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		rNode->translate(0,1000,0);
+		rNode->attachObject(pSys4);
+		// Fast-forward the rain so it looks more natural
+		pSys4->fastForward(5);
+
+
+		mCamera->setPosition(-50, 100, 500);
+		mCamera->lookAt(0,0,0);
+	}
+
+	void testManualObjectNonIndexed()
+	{
+		mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+		Vector3 dir(-1, -1, 0.5);
+		dir.normalise();
+		Light* l = mSceneMgr->createLight("light1");
+		l->setType(Light::LT_DIRECTIONAL);
+		l->setDirection(dir);
+
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 100;
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+		Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("2 - Default");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+		ManualObject* man = static_cast<ManualObject*>(
+			mSceneMgr->createMovableObject("test", ManualObjectFactory::FACTORY_TYPE_NAME));
+
+		man->begin("Examples/OgreLogo");
+		// Define a 40x40 plane, non-indexed
+		man->position(-20, 20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 0);
+
+		man->position(-20, -20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 1);
+
+		man->position(20, 20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(1, 0);
+
+		man->position(-20, -20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 1);
+
+		man->position(20, -20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(1, 1);
+
+		man->position(20, 20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(1, 0);
+
+		man->end();
+
+		man->begin("Examples/BumpyMetal");
+
+		// Define a 40x40 plane, non-indexed
+		man->position(-20, 20, 20);
+		man->normal(0, 1, 0);
+		man->textureCoord(0, 0);
+
+		man->position(20, 20, 20);
+		man->normal(0, 1, 0);
+		man->textureCoord(0, 1);
+
+		man->position(20, 20, -20);
+		man->normal(0, 1, 0);
+		man->textureCoord(1, 1);
+
+		man->position(20, 20, -20);
+		man->normal(0, 1, 0);
+		man->textureCoord(1, 1);
+
+		man->position(-20, 20, -20);
+		man->normal(0, 1, 0);
+		man->textureCoord(1, 0);
+
+		man->position(-20, 20, 20);
+		man->normal(0, 1, 0);
+		man->textureCoord(0, 0);
+
+		man->end();
+
+
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(man);
+
+	}
+
+	void testManualObjectNonIndexedUpdateSmaller()
+	{
+		testManualObjectNonIndexed();
+		ManualObject* man = static_cast<ManualObject*>(
+			mSceneMgr->getMovableObject("test", ManualObjectFactory::FACTORY_TYPE_NAME));
+
+		// Redefine but make smaller (one tri less)
+		man->beginUpdate(0);
+		man->position(-30, 30, 30);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 0);
+
+		man->position(-30, -30, 30);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 1);
+
+		man->position(30, 30, 30);
+		man->normal(0, 0, 1);
+		man->textureCoord(1, 0);
+
+
+		man->end();
+
+	}
+
+	void testManualObjectNonIndexedUpdateLarger()
+	{
+		testManualObjectNonIndexed();
+		ManualObject* man = static_cast<ManualObject*>(
+			mSceneMgr->getMovableObject("test", ManualObjectFactory::FACTORY_TYPE_NAME));
+
+		// Redefine but make larger (2 more tri)
+		man->beginUpdate(0);
+
+		man->position(-20, 20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 0);
+
+		man->position(-20, -20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 1);
+
+		man->position(20, 20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(1, 0);
+
+		man->position(-20, -20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 1);
+
+		man->position(20, -20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(1, 1);
+
+		man->position(20, 20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(1, 0);
+
+
+		man->position(-20, 40, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 0);
+
+		man->position(-20, 20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 1);
+
+		man->position(20, 40, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(1, 0);
+
+		man->position(-20, 20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 1);
+
+		man->position(20, 20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(1, 1);
+
+		man->position(20, 40, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(1, 0);
+
+
+		man->end();
+
+	}
+	void testManualObjectIndexed()
+	{
+		mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+		Vector3 dir(-1, -1, 0.5);
+		dir.normalise();
+		Light* l = mSceneMgr->createLight("light1");
+		l->setType(Light::LT_DIRECTIONAL);
+		l->setDirection(dir);
+
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 100;
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+		Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("2 - Default");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+		ManualObject* man = static_cast<ManualObject*>(
+			mSceneMgr->createMovableObject("test", ManualObjectFactory::FACTORY_TYPE_NAME));
+
+		man->begin("Examples/OgreLogo");
+		// Define a 40x40 plane, indexed
+		man->position(-20, 20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 0);
+
+		man->position(-20, -20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 1);
+
+		man->position(20, -20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(1, 1);
+
+		man->position(20, 20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(1, 0);
+
+		man->quad(0, 1, 2, 3);
+
+		man->end();
+
+		man->begin("Examples/BumpyMetal");
+
+		// Define a 40x40 plane, indexed
+		man->position(-20, 20, 20);
+		man->normal(0, 1, 0);
+		man->textureCoord(0, 0);
+
+		man->position(20, 20, 20);
+		man->normal(0, 1, 0);
+		man->textureCoord(0, 1);
+
+		man->position(20, 20, -20);
+		man->normal(0, 1, 0);
+		man->textureCoord(1, 1);
+
+		man->position(-20, 20, -20);
+		man->normal(0, 1, 0);
+		man->textureCoord(1, 0);
+
+		man->quad(0, 1, 2, 3);
+
+		man->end();
+
+
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(man);
+
+		
+
+	}
+
+	void testManualObjectIndexedUpdateSmaller()
+	{
+		testManualObjectIndexed();
+		ManualObject* man = static_cast<ManualObject*>(
+			mSceneMgr->getMovableObject("test", ManualObjectFactory::FACTORY_TYPE_NAME));
+
+
+		man->beginUpdate(0);
+		// 1 tri smaller
+		man->position(-20, 20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 0);
+
+		man->position(-20, -20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 1);
+
+		man->position(20, -20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(1, 1);
+
+		man->triangle(0, 1, 2);
+
+		man->end();
+
+	}
+
+	void testManualObjectIndexedUpdateLarger()
+	{
+		testManualObjectIndexed();
+		ManualObject* man = static_cast<ManualObject*>(
+			mSceneMgr->getMovableObject("test", ManualObjectFactory::FACTORY_TYPE_NAME));
+
+
+		man->beginUpdate(0);
+		// 1 quad larger
+		man->position(-20, 20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 0);
+
+		man->position(-20, -20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 1);
+
+		man->position(20, -20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(1, 1);
+
+		man->position(20, 20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(1, 0);
+
+
+		man->position(-20, 40, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 0);
+
+		man->position(-20, 20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(0, 1);
+
+		man->position(20, 20, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(1, 1);
+
+		man->position(20, 40, 20);
+		man->normal(0, 0, 1);
+		man->textureCoord(1, 0);
+
+		man->quad(0, 1, 2, 3);
+		man->quad(4, 5, 6, 7);
+
+		man->end();
+
+	}
+
+	void testBillboardChain()
+	{
+		mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+		Vector3 dir(-1, -1, 0.5);
+		dir.normalise();
+		Light* l = mSceneMgr->createLight("light1");
+		l->setType(Light::LT_DIRECTIONAL);
+		l->setDirection(dir);
+
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 100;
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+		Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("2 - Default");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+		BillboardChain* chain = static_cast<BillboardChain*>(
+			mSceneMgr->createMovableObject("1", "BillboardChain"));
+		chain->setUseTextureCoords(true);
+		chain->setUseVertexColours(false);
+		/*
+		BillboardChain::Element elem;
+		elem.width = 10;
+		elem.texCoord = 0;
+		elem.position = Vector3(0,20,0);
+		chain->addChainElement(0, elem);
+		elem.position = Vector3(20,0,0);
+		elem.texCoord = 1.0;
+		chain->addChainElement(0, elem);
+		elem.position = Vector3(40,10,0);
+		elem.texCoord = 2.0;
+		chain->addChainElement(0, elem);
+		elem.position = Vector3(60,20,0);
+		elem.texCoord = 3.0;
+		chain->addChainElement(0, elem);
+		elem.position = Vector3(80,40,0);
+		elem.texCoord = 4.0;
+		chain->addChainElement(0, elem);
+		elem.position = Vector3(100,70,0);
+		elem.texCoord = 5.0;
+		chain->addChainElement(0, elem);
+		*/
+		chain->setMaterialName("Examples/RustySteel");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(chain);
+
+		mSceneMgr->showBoundingBoxes(true);
+	}
+
+	void testCubeDDS()
+	{
+		ResourceGroupManager::getSingleton().addResourceLocation(
+			"../../../../Tests/Media", "FileSystem");
+
+		MaterialPtr mat = MaterialManager::getSingleton().create("testcube", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* p = mat->getTechnique(0)->getPass(0);
+		p->setLightingEnabled(false);
+		TextureUnitState* t = p->createTextureUnitState();
+		t->setTextureName("grace_cube.dds", TEX_TYPE_CUBE_MAP);
+		t->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
+		t->setEnvironmentMap(true, TextureUnitState::ENV_REFLECTION);
+		Entity* e = mSceneMgr->createEntity("1", "sphere.mesh");
+		e->setMaterialName(mat->getName());
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+
+		mCamera->setPosition(300,0,0);
+		mCamera->lookAt(Vector3::ZERO);
+
+	}
+
+	void testDxt1()
+	{
+		ResourceGroupManager::getSingleton().addResourceLocation(
+			"../../../../Tests/Media", "FileSystem");
+
+		MaterialPtr mat = MaterialManager::getSingleton().create("testdxt", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* p = mat->getTechnique(0)->getPass(0);
+		p->setLightingEnabled(false);
+		p->setCullingMode(CULL_NONE);
+		TextureUnitState* t = p->createTextureUnitState("BumpyMetal_dxt1.dds");
+		Entity *e = mSceneMgr->createEntity("Plane", SceneManager::PT_PLANE);
+		e->setMaterialName(mat->getName());
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+
+		mCamera->setPosition(0,0,-300);
+		mCamera->lookAt(Vector3::ZERO);
+
+	}
+	void testDxt1FromMemory()
+	{
+		ResourceGroupManager::getSingleton().addResourceLocation(
+			"../../../../Tests/Media", "FileSystem");
+
+		DataStreamPtr stream = ResourceGroupManager::getSingleton().openResource("BumpyMetal_dxt1.dds");
+		// manually load into image
+		Image img;
+		img.load(stream, "dds");
+		TextureManager::getSingleton().loadImage("testdxtfrommem", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, img);
+
+		
+
+		MaterialPtr mat = MaterialManager::getSingleton().create("testdxt", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* p = mat->getTechnique(0)->getPass(0);
+		p->setLightingEnabled(false);
+		p->setCullingMode(CULL_NONE);
+		TextureUnitState* t = p->createTextureUnitState("testdxtfrommem");
+		Entity *e = mSceneMgr->createEntity("Plane", SceneManager::PT_PLANE);
+		e->setMaterialName(mat->getName());
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+
+		mCamera->setPosition(0,0,-300);
+		mCamera->lookAt(Vector3::ZERO);
+
+	}
+	void testDxt1Alpha()
+	{
+		ResourceGroupManager::getSingleton().addResourceLocation(
+			"../../../../Tests/Media", "FileSystem");
+
+		MaterialPtr mat = MaterialManager::getSingleton().create("testdxt", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* p = mat->getTechnique(0)->getPass(0);
+		p->setSceneBlending(SBT_TRANSPARENT_ALPHA);
+		p->setAlphaRejectSettings(CMPF_GREATER, 128);
+		p->setLightingEnabled(false);
+		p->setCullingMode(CULL_NONE);
+		TextureUnitState* t = p->createTextureUnitState("gras_02_dxt1.dds");
+		Entity *e = mSceneMgr->createEntity("Plane", SceneManager::PT_PLANE);
+		e->setMaterialName(mat->getName());
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+
+		mCamera->setPosition(0,0,300);
+		mCamera->lookAt(Vector3::ZERO);
+
+	}
+	void testDxt3()
+	{
+		ResourceGroupManager::getSingleton().addResourceLocation(
+			"../../../../Tests/Media", "FileSystem");
+
+		MaterialPtr mat = MaterialManager::getSingleton().create("testdxt", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* p = mat->getTechnique(0)->getPass(0);
+		p->setLightingEnabled(false);
+		p->setCullingMode(CULL_NONE);
+		p->setSceneBlending(SBT_TRANSPARENT_ALPHA);
+		TextureUnitState* t = p->createTextureUnitState("ogreborderUp_dxt3.dds");
+		Entity *e = mSceneMgr->createEntity("Plane", SceneManager::PT_PLANE);
+		e->setMaterialName(mat->getName());
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+		mWindow->getViewport(0)->setBackgroundColour(ColourValue::Red);
+
+		mCamera->setPosition(0,0,300);
+		mCamera->lookAt(Vector3::ZERO);
+
+	}
+	void testDxt3FromMemory()
+	{
+		ResourceGroupManager::getSingleton().addResourceLocation(
+			"../../../../Tests/Media", "FileSystem");
+
+		DataStreamPtr stream = ResourceGroupManager::getSingleton().openResource("ogreborderUp_dxt3.dds");
+		// manually load into image
+		Image img;
+		img.load(stream, "dds");
+		TextureManager::getSingleton().loadImage("testdxtfrommem", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, img);
+
+
+
+		MaterialPtr mat = MaterialManager::getSingleton().create("testdxt", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* p = mat->getTechnique(0)->getPass(0);
+		p->setLightingEnabled(false);
+		p->setCullingMode(CULL_NONE);
+		p->setSceneBlending(SBT_TRANSPARENT_ALPHA);
+		TextureUnitState* t = p->createTextureUnitState("testdxtfrommem");
+		Entity *e = mSceneMgr->createEntity("Plane", SceneManager::PT_PLANE);
+		e->setMaterialName(mat->getName());
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+		mWindow->getViewport(0)->setBackgroundColour(ColourValue::Red);
+
+		mCamera->setPosition(0,0,300);
+		mCamera->lookAt(Vector3::ZERO);
+
+	}
+	void testDxt5()
+	{
+		ResourceGroupManager::getSingleton().addResourceLocation(
+			"../../../../Tests/Media", "FileSystem");
+
+		MaterialPtr mat = MaterialManager::getSingleton().create("testdxt", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* p = mat->getTechnique(0)->getPass(0);
+		p->setLightingEnabled(false);
+		p->setCullingMode(CULL_NONE);
+		p->setSceneBlending(SBT_TRANSPARENT_ALPHA);
+		TextureUnitState* t = p->createTextureUnitState("ogreborderUp_dxt5.dds");
+		Entity *e = mSceneMgr->createEntity("Plane", SceneManager::PT_PLANE);
+		e->setMaterialName(mat->getName());
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+		mWindow->getViewport(0)->setBackgroundColour(ColourValue::Red);
+
+		mCamera->setPosition(0,0,300);
+		mCamera->lookAt(Vector3::ZERO);
+
+	}
+	void testFloat64DDS()
+	{
+		ResourceGroupManager::getSingleton().addResourceLocation(
+			"../../../../Tests/Media", "FileSystem");
+
+		MaterialPtr mat = MaterialManager::getSingleton().create("testdds", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* p = mat->getTechnique(0)->getPass(0);
+		p->setLightingEnabled(false);
+		p->setCullingMode(CULL_NONE);
+		p->setSceneBlending(SBT_TRANSPARENT_ALPHA);
+		TextureUnitState* t = p->createTextureUnitState("ogreborderUp_float64.dds");
+		Entity *e = mSceneMgr->createEntity("Plane", SceneManager::PT_PLANE);
+		e->setMaterialName(mat->getName());
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+		mWindow->getViewport(0)->setBackgroundColour(ColourValue::Red);
+
+		mCamera->setPosition(0,0,300);
+		mCamera->lookAt(Vector3::ZERO);
+
+	}
+	void testFloat128DDS()
+	{
+		ResourceGroupManager::getSingleton().addResourceLocation(
+			"../../../../Tests/Media", "FileSystem");
+
+		MaterialPtr mat = MaterialManager::getSingleton().create("testdds", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* p = mat->getTechnique(0)->getPass(0);
+		p->setLightingEnabled(false);
+		p->setCullingMode(CULL_NONE);
+		p->setSceneBlending(SBT_TRANSPARENT_ALPHA);
+		TextureUnitState* t = p->createTextureUnitState("ogreborderUp_float128.dds");
+		Entity *e = mSceneMgr->createEntity("Plane", SceneManager::PT_PLANE);
+		e->setMaterialName(mat->getName());
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+		mWindow->getViewport(0)->setBackgroundColour(ColourValue::Red);
+
+		mCamera->setPosition(0,0,300);
+		mCamera->lookAt(Vector3::ZERO);
+
+	}
+	void testFloat16DDS()
+	{
+		ResourceGroupManager::getSingleton().addResourceLocation(
+			"../../../../Tests/Media", "FileSystem");
+
+		MaterialPtr mat = MaterialManager::getSingleton().create("testdds", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* p = mat->getTechnique(0)->getPass(0);
+		p->setLightingEnabled(false);
+		p->setCullingMode(CULL_NONE);
+		TextureUnitState* t = p->createTextureUnitState("BumpyMetal_float16.dds");
+		Entity *e = mSceneMgr->createEntity("Plane", SceneManager::PT_PLANE);
+		e->setMaterialName(mat->getName());
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+		mWindow->getViewport(0)->setBackgroundColour(ColourValue::Red);
+
+		mCamera->setPosition(0,0,300);
+		mCamera->lookAt(Vector3::ZERO);
+
+	}
+	void testFloat32DDS()
+	{
+		ResourceGroupManager::getSingleton().addResourceLocation(
+			"../../../../Tests/Media", "FileSystem");
+
+		MaterialPtr mat = MaterialManager::getSingleton().create("testdds", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* p = mat->getTechnique(0)->getPass(0);
+		p->setLightingEnabled(false);
+		p->setCullingMode(CULL_NONE);
+		TextureUnitState* t = p->createTextureUnitState("BumpyMetal_float32.dds");
+		Entity *e = mSceneMgr->createEntity("Plane", SceneManager::PT_PLANE);
+		e->setMaterialName(mat->getName());
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+		mWindow->getViewport(0)->setBackgroundColour(ColourValue::Red);
+
+		mCamera->setPosition(0,0,300);
+		mCamera->lookAt(Vector3::ZERO);
+
+	}
+
+
+
+	void testRibbonTrail()
+	{
+		mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+		Vector3 dir(-1, -1, 0.5);
+		dir.normalise();
+		Light* l = mSceneMgr->createLight("light1");
+		l->setType(Light::LT_DIRECTIONAL);
+		l->setDirection(dir);
+
+		NameValuePairList pairList;
+		pairList["numberOfChains"] = "2";
+		pairList["maxElements"] = "80";
+		RibbonTrail* trail = static_cast<RibbonTrail*>(
+			mSceneMgr->createMovableObject("1", "RibbonTrail", &pairList));
+		trail->setMaterialName("Examples/LightRibbonTrail");
+		trail->setTrailLength(400);
+
+
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(trail);
+
+		// Create 3 nodes for trail to follow
+		SceneNode* animNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		animNode->setPosition(0,20,0);
+		Animation* anim = mSceneMgr->createAnimation("an1", 10);
+		anim->setInterpolationMode(Animation::IM_SPLINE);
+		NodeAnimationTrack* track = anim->createNodeTrack(1, animNode);
+		TransformKeyFrame* kf = track->createNodeKeyFrame(0);
+		kf->setTranslate(Vector3::ZERO);
+		kf = track->createNodeKeyFrame(2);
+		kf->setTranslate(Vector3(100, 0, 0));
+		kf = track->createNodeKeyFrame(4);
+		kf->setTranslate(Vector3(200, 0, 300));
+		kf = track->createNodeKeyFrame(6);
+		kf->setTranslate(Vector3(0, 20, 500));
+		kf = track->createNodeKeyFrame(8);
+		kf->setTranslate(Vector3(-100, 10, 100));
+		kf = track->createNodeKeyFrame(10);
+		kf->setTranslate(Vector3::ZERO);
+
+		AnimationState* animState = mSceneMgr->createAnimationState("an1");
+		animState->setEnabled(true);
+		mAnimStateList.push_back(animState);
+
+		trail->addNode(animNode);
+		trail->setInitialColour(0, 1.0, 0.8, 0);
+		trail->setColourChange(0, 0.5, 0.5, 0.5, 0.5);
+		trail->setInitialWidth(0, 5);
+
+		// Add light
+		Light* l2 = mSceneMgr->createLight("l2");
+		l2->setDiffuseColour(trail->getInitialColour(0));
+		animNode->attachObject(l2);
+
+		// Add billboard
+		BillboardSet* bbs = mSceneMgr->createBillboardSet("bb", 1);
+		bbs->createBillboard(Vector3::ZERO, trail->getInitialColour(0));
+		bbs->setMaterialName("Examples/Flare");
+		animNode->attachObject(bbs);
+
+		animNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		animNode->setPosition(-50,10,0);
+		anim = mSceneMgr->createAnimation("an2", 10);
+		anim->setInterpolationMode(Animation::IM_SPLINE);
+		track = anim->createNodeTrack(1, animNode);
+		kf = track->createNodeKeyFrame(0);
+		kf->setTranslate(Vector3::ZERO);
+		kf = track->createNodeKeyFrame(2);
+		kf->setTranslate(Vector3(-100, 150, -30));
+		kf = track->createNodeKeyFrame(4);
+		kf->setTranslate(Vector3(-200, 0, 40));
+		kf = track->createNodeKeyFrame(6);
+		kf->setTranslate(Vector3(0, -150, 70));
+		kf = track->createNodeKeyFrame(8);
+		kf->setTranslate(Vector3(50, 0, 30));
+		kf = track->createNodeKeyFrame(10);
+		kf->setTranslate(Vector3::ZERO);
+
+		animState = mSceneMgr->createAnimationState("an2");
+		animState->setEnabled(true);
+		mAnimStateList.push_back(animState);
+
+		trail->addNode(animNode);
+		trail->setInitialColour(1, 0.0, 1.0, 0.4);
+		trail->setColourChange(1, 0.5, 0.5, 0.5, 0.5);
+		trail->setInitialWidth(1, 5);
+
+
+		// Add light
+		l2 = mSceneMgr->createLight("l3");
+		l2->setDiffuseColour(trail->getInitialColour(1));
+		animNode->attachObject(l2);
+
+		// Add billboard
+		bbs = mSceneMgr->createBillboardSet("bb2", 1);
+		bbs->createBillboard(Vector3::ZERO, trail->getInitialColour(1));
+		bbs->setMaterialName("Examples/Flare");
+		animNode->attachObject(bbs);
+
+
+
+		//mSceneMgr->showBoundingBoxes(true);
+
+	}
+
+	void testBlendDiffuseColour()
+	{
+		MaterialPtr mat = MaterialManager::getSingleton().create(
+			"testBlendDiffuseColour", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* pass = mat->getTechnique(0)->getPass(0);
+		// no lighting, it will mess up vertex colours
+		pass->setLightingEnabled(false);
+		// Make sure we pull in vertex colour as diffuse
+		pass->setVertexColourTracking(TVC_DIFFUSE);
+		// Base layer
+		TextureUnitState* t = pass->createTextureUnitState("BeachStones.jpg");
+		// don't want to bring in vertex diffuse on base layer
+		t->setColourOperation(LBO_REPLACE); 
+		// Second layer (lerp based on colour)
+		t = pass->createTextureUnitState("terr_dirt-grass.jpg");
+		t->setColourOperationEx(LBX_BLEND_DIFFUSE_COLOUR);
+		// third layer (lerp based on alpha)
+		ManualObject* man = mSceneMgr->createManualObject("quad");
+		man->begin("testBlendDiffuseColour");
+		man->position(-100, 100, 0);
+		man->textureCoord(0,0);
+		man->colour(0, 0, 0);
+		man->position(-100, -100, 0);
+		man->textureCoord(0,1);
+		man->colour(0.5, 0.5, 0.5);
+		man->position(100, -100, 0);
+		man->textureCoord(1,1);
+		man->colour(1, 1, 1);
+		man->position(100, 100, 0);
+		man->textureCoord(1,0);
+		man->colour(0.5, 0.5, 0.5);
+		man->quad(0, 1, 2, 3);
+		man->end();
+
+		mSceneMgr->getRootSceneNode()->attachObject(man);
+
+	}
+
+	void testSplitPassesTooManyTexUnits()
+	{
+		MaterialPtr mat = MaterialManager::getSingleton().create(
+			"Test", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+
+		Pass* p = mat->getTechnique(0)->getPass(0);
+		p->createTextureUnitState("gras_02.png");
+		p->createTextureUnitState("gras_02.png");
+		p->createTextureUnitState("gras_02.png");
+		p->createTextureUnitState("gras_02.png");
+		p->createTextureUnitState("gras_02.png");
+		p->createTextureUnitState("gras_02.png");
+		p->createTextureUnitState("gras_02.png");
+		p->createTextureUnitState("gras_02.png");
+		p->createTextureUnitState("gras_02.png");
+
+		mat->compile();
+
+	}
+
+	void testCustomProjectionMatrix()
+	{
+		testLotsAndLotsOfEntities();
+		Matrix4 mat = mCamera->getProjectionMatrix();
+		mCamera->setCustomProjectionMatrix(true, mat);
+		mat = mCamera->getProjectionMatrix();
+
+	}
+
+	void testPointSprites()
+	{
+		MaterialPtr mat = MaterialManager::getSingleton().create("spriteTest1", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* p = mat->getTechnique(0)->getPass(0);
+		p->setPointSpritesEnabled(true);
+		p->createTextureUnitState("flare.png");
+		p->setLightingEnabled(false);
+		p->setDepthWriteEnabled(false);
+		p->setSceneBlending(SBT_ADD);
+		p->setPointAttenuation(true);
+		p->setPointSize(1);
+		srand((unsigned)time( NULL ) );
+
+		ManualObject* man = mSceneMgr->createManualObject("man");
+		man->begin("spriteTest1", RenderOperation::OT_POINT_LIST);
+		/*
+		for (size_t i = 0; i < 1000; ++i)
+		{
+			man->position(Math::SymmetricRandom() * 500, 
+				Math::SymmetricRandom() * 500, 
+				Math::SymmetricRandom() * 500);
+			man->colour(Math::RangeRandom(0.5f, 1.0f), 
+				Math::RangeRandom(0.5f, 1.0f), Math::RangeRandom(0.5f, 1.0f));
+		}
+		*/
+		for (size_t i = 0; i < 20; ++i)
+		{
+			for (size_t j = 0; j < 20; ++j)
+			{
+				for (size_t k = 0; k < 20; ++k)
+				{
+					man->position(i * 30, j * 30, k * 30);
+				}
+			}
+		}
+
+		man->end();
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(man);
+
+	}
+
+	void testSuppressedShadows(ShadowTechnique shadowTech)
+	{
+		mSceneMgr->setShadowTechnique(shadowTech);
+
+		// Setup lighting
+		mSceneMgr->setAmbientLight(ColourValue(0.2, 0.2, 0.2));
+		Light* light = mSceneMgr->createLight("MainLight");
+		light->setType(Light::LT_DIRECTIONAL);
+		Vector3 dir(-1, -1, 0.5);
+		dir.normalise();
+		light->setDirection(dir);
+
+		// Create a skydome
+		//mSceneMgr->setSkyDome(true, "Examples/CloudySky", 5, 8);
+
+		// Create a floor plane mesh
+		Plane plane(Vector3::UNIT_Y, 0.0);
+		MeshManager::getSingleton().createPlane(
+			"FloorPlane", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+			plane, 200000, 200000, 20, 20, true, 1, 500, 500, Vector3::UNIT_Z);
+	
+
+		// Add a floor to the scene
+		Entity* entity = mSceneMgr->createEntity("floor", "FloorPlane");
+		entity->setMaterialName("Examples/RustySteel");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(entity);
+		entity->setCastShadows(false);
+
+		// Add the mandatory ogre head
+		entity = mSceneMgr->createEntity("head", "ogrehead.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(0.0, 10.0, 0.0))->attachObject(entity);
+
+		// Position and orient the camera
+		mCamera->setPosition(-100.0, 50.0, 90.0);
+		mCamera->lookAt(0.0, 10.0, -35.0);
+
+		// Add an additional viewport on top of the other one
+		Viewport* pip = mWindow->addViewport(mCamera, 1, 0.7, 0.0, 0.3, 0.3);
+
+		// Create a render queue invocation sequence for the pip viewport
+		RenderQueueInvocationSequence* invocationSequence =
+			mRoot->createRenderQueueInvocationSequence("pip");
+
+		// Add an invocation to the sequence
+		RenderQueueInvocation* invocation =
+			invocationSequence->add(RENDER_QUEUE_MAIN, "main");
+
+		// Disable render state changes and shadows for that invocation
+		//invocation->setSuppressRenderStateChanges(true);
+		invocation->setSuppressShadows(true);
+
+		// Set the render queue invocation sequence for the pip viewport
+		pip->setRenderQueueInvocationSequenceName("pip");
+	}
+
+	void testViewportNoShadows(ShadowTechnique shadowTech)
+	{
+		mSceneMgr->setShadowTechnique(shadowTech);
+
+		// Setup lighting
+		mSceneMgr->setAmbientLight(ColourValue(0.2, 0.2, 0.2));
+		Light* light = mSceneMgr->createLight("MainLight");
+		light->setType(Light::LT_DIRECTIONAL);
+		Vector3 dir(-1, -1, 0.5);
+		dir.normalise();
+		light->setDirection(dir);
+
+		// Create a skydome
+		//mSceneMgr->setSkyDome(true, "Examples/CloudySky", 5, 8);
+
+		// Create a floor plane mesh
+		Plane plane(Vector3::UNIT_Y, 0.0);
+		MeshManager::getSingleton().createPlane(
+			"FloorPlane", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+			plane, 200000, 200000, 20, 20, true, 1, 500, 500, Vector3::UNIT_Z);
+
+
+		// Add a floor to the scene
+		Entity* entity = mSceneMgr->createEntity("floor", "FloorPlane");
+		entity->setMaterialName("Examples/RustySteel");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(entity);
+		entity->setCastShadows(false);
+
+		// Add the mandatory ogre head
+		entity = mSceneMgr->createEntity("head", "ogrehead.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(0.0, 10.0, 0.0))->attachObject(entity);
+
+		// Position and orient the camera
+		mCamera->setPosition(-100.0, 50.0, 90.0);
+		mCamera->lookAt(0.0, 10.0, -35.0);
+
+		// Add an additional viewport on top of the other one
+		Viewport* pip = mWindow->addViewport(mCamera, 1, 0.7, 0.0, 0.3, 0.3);
+		pip->setShadowsEnabled(false);
+
+	}
+
+	void testSerialisedColour()
+	{
+		mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+		Vector3 dir(-1, -1, 0.5);
+		dir.normalise();
+		Light* l = mSceneMgr->createLight("light1");
+		l->setType(Light::LT_DIRECTIONAL);
+		l->setDirection(dir);
+
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 100;
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+		Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("2 - Default");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+		/*
+		ManualObject* man = static_cast<ManualObject*>(
+			mSceneMgr->createMovableObject("test", ManualObjectFactory::FACTORY_TYPE_NAME));
+
+		man->begin("BaseWhiteNoLighting");
+		// Define a 40x40 plane, non-indexed
+		// Define a 40x40 plane, indexed
+		man->position(-20, 20, 20);
+		man->colour(1, 0, 0);
+
+		man->position(-20, -20, 20);
+		man->colour(1, 0, 0);
+
+		man->position(20, -20, 20);
+		man->colour(1, 0, 0);
+
+		man->position(20, 20, 20);
+		man->colour(1, 0, 0);
+
+		man->quad(0, 1, 2, 3);
+		man->end();
+
+		MeshPtr mesh = man->convertToMesh("colourtest.mesh");
+		MeshSerializer ms;
+		ms.exportMesh(mesh.getPointer(), "colourtest.mesh");
+
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(man);
+		*/
+		Entity* c = mSceneMgr->createEntity("1", "colourtest.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(c);
+
+
+
+	}
+
+	void testBillboardAccurateFacing()
+	{
+		mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+		Vector3 dir(-1, -1, 0.5);
+		dir.normalise();
+		Light* l = mSceneMgr->createLight("light1");
+		l->setType(Light::LT_DIRECTIONAL);
+		l->setDirection(dir);
+
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 100;
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+		Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("2 - Default");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+		BillboardSet* bbs = mSceneMgr->createBillboardSet("1");
+		bbs->setDefaultDimensions(50,50);
+		bbs->createBillboard(-150, 25, 0);
+		bbs->setBillboardType(BBT_ORIENTED_COMMON);
+		bbs->setCommonDirection(Vector3::UNIT_Y);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(bbs);
+
+		bbs = mSceneMgr->createBillboardSet("2");
+		bbs->setDefaultDimensions(50,50);
+		bbs->createBillboard(150, 25, 0);
+		bbs->setUseAccurateFacing(true);
+		bbs->setBillboardType(BBT_ORIENTED_COMMON);
+		bbs->setCommonDirection(Vector3::UNIT_Y);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(bbs);
+	}
+
+	void testMultiSceneManagersSimple()
+	{
+		// Create a secondary scene manager with it's own camera
+		SceneManager* sm2 = Root::getSingleton().createSceneManager(ST_GENERIC);
+		camera2 = sm2->createCamera("cam2");
+		camera2->setPosition(0,0,-500);
+		camera2->lookAt(Vector3::ZERO);
+		Entity* ent = sm2->createEntity("knot2", "knot.mesh");
+		sm2->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+		Light* l = sm2->createLight("l2");
+		l->setPosition(100,50,-100);
+		l->setDiffuseColour(ColourValue::Green);
+		sm2->setAmbientLight(ColourValue(0.2, 0.2, 0.2));
+
+		Viewport* vp = mWindow->addViewport(camera2, 1, 0.67, 0, 0.33, 0.25);
+		vp->setOverlaysEnabled(false);
+
+		// Use original SM for normal scene
+		ent = mSceneMgr->createEntity("head", "ogrehead.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+		l = mSceneMgr->createLight("l2"); // note same name, will work since different SM
+		l->setPosition(100,50,-100);
+		l->setDiffuseColour(ColourValue::Red);
+		mSceneMgr->setAmbientLight(ColourValue(0.2, 0.2, 0.2));
+
+
+	}
+
+	void testMultiSceneManagersComplex()
+	{
+		// Create a secondary scene manager with it's own camera
+		SceneManager* sm2 = Root::getSingleton().createSceneManager("TerrainSceneManager");
+		camera2 = sm2->createCamera("cam2");
+
+		Viewport* vp = mWindow->addViewport(camera2, 1, 0.5, 0, 0.5, 0.5);
+		vp->setOverlaysEnabled(false);
+		// Fog
+		// NB it's VERY important to set this before calling setWorldGeometry 
+		// because the vertex program picked will be different
+		ColourValue fadeColour(0.93, 0.86, 0.76);
+		sm2->setFog( FOG_LINEAR, fadeColour, .001, 500, 1000);
+		vp->setBackgroundColour(fadeColour);
+
+		sm2->setWorldGeometry("terrain.cfg");
+		// Infinite far plane?
+		if (mRoot->getRenderSystem()->getCapabilities()->hasCapability(RSC_INFINITE_FAR_PLANE))
+		{
+			camera2->setFarClipDistance(0);
+		}
+		// Set a nice viewpoint
+		camera2->setPosition(707,3500,528);
+		camera2->lookAt(Vector3::ZERO);
+		camera2->setNearClipDistance( 1 );
+		camera2->setFarClipDistance( 1000 );
+
+
+		// Create a tertiary scene manager with it's own camera
+		SceneManager* sm3 = Root::getSingleton().createSceneManager("BspSceneManager");
+		Camera* camera3 = sm3->createCamera("cam3");
+
+		vp = mWindow->addViewport(camera3, 2, 0.5, 0.5, 0.5, 0.5);
+		vp->setOverlaysEnabled(false);
+
+		// Load Quake3 locations from a file
+		ConfigFile cf;
+
+		cf.load("quake3settings.cfg");
+
+		String pk3 = cf.getSetting("Pak0Location");
+		String level = cf.getSetting("Map");
+
+		ExampleApplication::setupResources();
+		ResourceGroupManager::getSingleton().createResourceGroup("BSP");
+		ResourceGroupManager::getSingleton().setWorldResourceGroupName("BSP");
+		ResourceGroupManager::getSingleton().addResourceLocation(
+			pk3, "Zip", ResourceGroupManager::getSingleton().getWorldResourceGroupName());
+		ResourceGroupManager::getSingleton().initialiseResourceGroup("BSP");
+		sm3->setWorldGeometry(level);
+		// modify camera for close work
+		camera3->setNearClipDistance(4);
+		camera3->setFarClipDistance(4000);
+
+		// Also change position, and set Quake-type orientation
+		// Get random player start point
+		ViewPoint viewp = sm3->getSuggestedViewpoint(true);
+		camera3->setPosition(viewp.position);
+		camera3->pitch(Degree(90)); // Quake uses X/Y horizon, Z up
+		camera3->rotate(viewp.orientation);
+		// Don't yaw along variable axis, causes leaning
+		camera3->setFixedYawAxis(true, Vector3::UNIT_Z);
+		camera3->yaw(Degree(-90));
+
+
+
+
+
+		// Use original SM for normal scene
+		testTextureShadows(SHADOWTYPE_TEXTURE_MODULATIVE);
+
+	}
+
+	void testManualBoneMovement(void)
+	{
+		Entity *ent = mSceneMgr->createEntity("robot", "robot.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+		mSceneMgr->setAmbientLight(ColourValue(0.8, 0.8, 0.8));
+
+		//ent->setMaterialName("Examples/Rocky");
+
+		SkeletonInstance* skel = ent->getSkeleton();
+		Animation* anim = skel->getAnimation("Walk");       
+		manuallyControlledBone = skel->getBone("Joint10");
+		manuallyControlledBone->setManuallyControlled(true);
+		anim->destroyNodeTrack(manuallyControlledBone->getHandle());
+
+		//AnimationState* animState = ent->getAnimationState("Walk");
+		//animState->setEnabled(true);
+
+
+
+	}
+
+	void testMaterialSchemes()
+	{
+
+		Entity *ent = mSceneMgr->createEntity("robot", "robot.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+		mSceneMgr->setAmbientLight(ColourValue(0.8, 0.8, 0.8));
+
+		MaterialPtr mat = MaterialManager::getSingleton().create("schemetest", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		// default scheme
+		mat->getTechnique(0)->getPass(0)->createTextureUnitState("GreenSkin.jpg");
+
+		Technique* t = mat->createTechnique();
+		t->setSchemeName("newscheme");
+		t->createPass()->createTextureUnitState("rockwall.tga");
+		ent->setMaterialName("schemetest");
+
+		// create a second viewport using alternate scheme
+		Viewport* vp = mWindow->addViewport(mCamera, 1, 0.75, 0, 0.25, 0.25);
+		vp->setMaterialScheme("newscheme");
+		vp->setOverlaysEnabled(false);
+
+	}
+	void testMaterialSchemesWithLOD()
+	{
+
+		Entity *ent = mSceneMgr->createEntity("robot", "robot.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+		mSceneMgr->setAmbientLight(ColourValue(0.8, 0.8, 0.8));
+
+		MaterialPtr mat = MaterialManager::getSingleton().create("schemetest", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		// default scheme
+		mat->getTechnique(0)->getPass(0)->createTextureUnitState("GreenSkin.jpg");
+
+		// LOD 0, newscheme 
+		Technique* t = mat->createTechnique();
+		t->setSchemeName("newscheme");
+		t->createPass()->createTextureUnitState("rockwall.tga");
+		ent->setMaterialName("schemetest");
+
+		// LOD 1, default
+		t = mat->createTechnique();
+		t->setLodIndex(1);
+		t->createPass()->createTextureUnitState("WeirdEye.png");
+
+		// LOD 1, newscheme
+		t = mat->createTechnique();
+		t->setLodIndex(1);
+		t->createPass()->createTextureUnitState("r2skin.jpg");
+		t->setSchemeName("newscheme");
+
+		Material::LodDistanceList ldl;
+		ldl.push_back(500.0f);
+		mat->setLodLevels(ldl);
+
+
+		ent->setMaterialName("schemetest");
+
+		// create a second viewport using alternate scheme
+		Viewport* vp = mWindow->addViewport(mCamera, 1, 0.75, 0, 0.25, 0.25);
+		vp->setMaterialScheme("newscheme");
+		vp->setOverlaysEnabled(false);
+
+	}
+	void testMaterialSchemesWithMismatchedLOD()
+	{
+
+		Entity *ent = mSceneMgr->createEntity("robot", "robot.mesh");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+		mSceneMgr->setAmbientLight(ColourValue(0.8, 0.8, 0.8));
+
+		MaterialPtr mat = MaterialManager::getSingleton().create("schemetest", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		// default scheme
+		mat->getTechnique(0)->getPass(0)->createTextureUnitState("GreenSkin.jpg");
+
+		// LOD 0, newscheme 
+		Technique* t = mat->createTechnique();
+		t->setSchemeName("newscheme");
+		t->createPass()->createTextureUnitState("rockwall.tga");
+		ent->setMaterialName("schemetest");
+
+		// LOD 1, default
+		t = mat->createTechnique();
+		t->setLodIndex(1);
+		t->createPass()->createTextureUnitState("WeirdEye.png");
+
+		// LOD 2, default
+		t = mat->createTechnique();
+		t->setLodIndex(2);
+		t->createPass()->createTextureUnitState("clouds.jpg");
+
+		// LOD 1, newscheme
+		t = mat->createTechnique();
+		t->setLodIndex(1);
+		t->createPass()->createTextureUnitState("r2skin.jpg");
+		t->setSchemeName("newscheme");
+
+		// No LOD 2 for newscheme! Should fallback on LOD 1
+
+		Material::LodDistanceList ldl;
+		ldl.push_back(250.0f);
+		ldl.push_back(500.0f);
+		mat->setLodLevels(ldl);
+
+
+		ent->setMaterialName("schemetest");
+
+		// create a second viewport using alternate scheme
+		Viewport* vp = mWindow->addViewport(mCamera, 1, 0.75, 0, 0.25, 0.25);
+		vp->setMaterialScheme("newscheme");
+		vp->setOverlaysEnabled(false);
+
+	}
+    void testSkeletonAnimationOptimise(void)
+    {
+        mSceneMgr->setShadowTextureSize(512);
+        mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_ADDITIVE);
+        mSceneMgr->setShadowFarDistance(1500);
+        mSceneMgr->setShadowColour(ColourValue(0.35, 0.35, 0.35));
+        //mSceneMgr->setShadowFarDistance(800);
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.3, 0.3, 0.3));
+
+        mLight = mSceneMgr->createLight("MainLight");
+
+/*/
+        // Directional test
+        mLight->setType(Light::LT_DIRECTIONAL);
+        Vector3 vec(-1,-1,0);
+        vec.normalise();
+        mLight->setDirection(vec);
+/*/
+        // Point test
+        mLight->setType(Light::LT_POINT);
+        mLight->setPosition(0, 200, 0);
+//*/
+
+        Entity* pEnt;
+
+        // Hardware animation
+        pEnt = mSceneMgr->createEntity( "1", "robot.mesh" );
+        mAnimState = pEnt->getAnimationState("Walk");
+        mAnimState->setEnabled(true);
+        mTestNode[0] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        mTestNode[0]->attachObject( pEnt );
+        mTestNode[0]->translate(+100,-100,0);
+
+        // Software animation
+        pEnt = mSceneMgr->createEntity( "2", "robot.mesh" );
+        pEnt->setMaterialName("BaseWhite");
+/*/
+        mAnimState = pEnt->getAnimationState("Walk");
+        mAnimState->setEnabled(true);
+/*/
+        pEnt->getAnimationState("Walk")->setEnabled(true);
+//*/
+        mTestNode[1] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        mTestNode[1]->attachObject( pEnt );
+        mTestNode[1]->translate(-100,-100,0);
+
+
+        Plane plane;
+        plane.normal = Vector3::UNIT_Y;
+        plane.d = 100;
+        MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+            1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+        Entity* pPlaneEnt;
+        pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+        pPlaneEnt->setMaterialName("2 - Default");
+        pPlaneEnt->setCastShadows(false);
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+    }
+
+    void testBuildTangentOnAnimatedMesh(void)
+    {
+        //mSceneMgr->setShadowTextureSize(512);
+        //mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_ADDITIVE);
+        //mSceneMgr->setShadowFarDistance(1500);
+        //mSceneMgr->setShadowColour(ColourValue(0.35, 0.35, 0.35));
+        //mSceneMgr->setShadowFarDistance(800);
+        // Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.3, 0.3, 0.3));
+
+        mLight = mSceneMgr->createLight("MainLight");
+
+/*/
+        // Directional test
+        mLight->setType(Light::LT_DIRECTIONAL);
+        Vector3 vec(-1,-1,0);
+        vec.normalise();
+        mLight->setDirection(vec);
+/*/
+        // Point test
+        mLight->setType(Light::LT_POINT);
+        mLight->setPosition(0, 200, 0);
+//*/
+        MeshPtr pMesh = MeshManager::getSingleton().load("ninja.mesh",
+            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME/*,    
+            HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, 
+            HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
+            true, true*/); //so we can still read it
+        // Build tangent vectors, all our meshes use only 1 texture coordset 
+        unsigned short src, dest;
+        if (!pMesh->suggestTangentVectorBuildParams(VES_TANGENT, src, dest))
+        {
+            pMesh->buildTangentVectors(VES_TANGENT, src, dest);
+        }
+
+        Entity* pEnt = mSceneMgr->createEntity("Ninja", "ninja.mesh");
+
+/*/
+        mAnimState = pEnt->getAnimationState("Walk");
+        mAnimState->setEnabled(true);
+/*/
+        pEnt->getAnimationState("Walk")->setEnabled(true);
+//*/
+        mTestNode[1] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+        mTestNode[1]->attachObject( pEnt );
+        mTestNode[1]->translate(-100,-100,0);
+
+
+        Plane plane;
+        plane.normal = Vector3::UNIT_Y;
+        plane.d = 100;
+        MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+            1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+        Entity* pPlaneEnt;
+        pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+        pPlaneEnt->setMaterialName("2 - Default");
+        pPlaneEnt->setCastShadows(false);
+        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+    }
+	void testVertexTexture()
+	{
+
+		// NOTE: DirectX only right now
+
+		Light* l = mSceneMgr->createLight("MainLight");
+		l->setType(Light::LT_POINT);
+		l->setPosition(0, 200, 0);
+
+
+		// Create single-channel floating point texture, no mips
+		TexturePtr tex = TextureManager::getSingleton().createManual(
+			"vertexTexture", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, TEX_TYPE_2D, 
+			128, 128, 0, PF_FLOAT32_R);
+		float* pData = static_cast<float*>(
+			tex->getBuffer()->lock(HardwareBuffer::HBL_DISCARD));
+		// write concentric circles into the texture
+		for (int y  = -64; y < 64; ++y)
+		{
+			for (int x = -64; x < 64; ++x)
+			{
+
+				float val = Math::Sqrt(x*x + y*y);
+				// repeat every 20 pixels
+				val = val * Math::TWO_PI / 20.0f;
+				*pData++ = Math::Sin(val);
+			}
+		}
+		tex->getBuffer()->unlock();
+
+		String progSource = 
+			"void main(\n"
+				"float4 pos : POSITION,\n"
+				"float2 uv1 : TEXCOORD0,\n"
+				"uniform float4x4 world, \n"
+				"uniform float4x4 viewProj,\n"
+				"uniform float heightscale,\n"
+				"uniform sampler2D heightmap,\n"
+				"out float4 oPos : POSITION,\n"
+				"out float2 oUv1 : TEXCOORD1,\n"
+				"out float4 col : COLOR)\n"
+			"{\n"
+				"oPos = mul(world, pos);\n"
+				"// tex2Dlod since no mip\n"
+				"float4 t = float4(0,0,0,0);\n"
+				"t.xy = uv1.xy;\n"
+				"float height = tex2Dlod(heightmap, t);\n"
+				"oPos.y = oPos.y + (height * heightscale);\n"
+				"oPos = mul(viewProj, oPos);\n"
+				"oUv1 = uv1;\n"
+				"col = float4(1,1,1,1);\n"
+			"}\n";
+		HighLevelGpuProgramPtr prog = HighLevelGpuProgramManager::getSingleton().createProgram(
+			"TestVertexTextureFetch", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+			"hlsl", GPT_VERTEX_PROGRAM);
+		prog->setSource(progSource);
+		prog->setParameter("target", "vs_3_0");
+		prog->setVertexTextureFetchRequired(true);
+		prog->setParameter("entry_point", "main");
+		prog->load();
+
+
+		MaterialPtr mat = MaterialManager::getSingleton().create("TestVertexTexture", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* pass = mat->getTechnique(0)->getPass(0);
+		pass->setLightingEnabled(false);
+		pass->setVertexProgram("TestVertexTextureFetch");
+		GpuProgramParametersSharedPtr vp = pass->getVertexProgramParameters();
+		vp->setNamedAutoConstant("world", GpuProgramParameters::ACT_WORLD_MATRIX);
+		vp->setNamedAutoConstant("viewProj", GpuProgramParameters::ACT_VIEWPROJ_MATRIX);
+		vp->setNamedConstant("heightscale", 30.0f);
+		// vertex texture
+		TextureUnitState* t = pass->createTextureUnitState("vertexTexture");
+		t->setBindingType(TextureUnitState::BT_VERTEX);
+		// regular texture
+		pass->createTextureUnitState("BumpyMetal.jpg");
+
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 100;
+		// 128 x 128 segment plane
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			1500,1500,128,128,true,1,1,1,Vector3::UNIT_Z);
+		Entity* pPlaneEnt;
+		pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("TestVertexTexture");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+
+	}
+
+	void testBackgroundLoadResourceGroup()
+	{
+		ResourceGroupManager& rgm = ResourceGroupManager::getSingleton();
+		TextureManager& tm = TextureManager::getSingleton();
+		MeshManager& mm = MeshManager::getSingleton();
+
+		testBackgroundLoadGroup = "Deferred";
+
+		rgm.createResourceGroup(testBackgroundLoadGroup);
+
+		// define a bunch of textures as deferred loading
+		rgm.declareResource("egyptrockyfull.jpg", tm.getResourceType(), testBackgroundLoadGroup);
+		rgm.declareResource("fw12b.jpg", tm.getResourceType(), testBackgroundLoadGroup);
+		rgm.declareResource("grass_1024.jpg", tm.getResourceType(), testBackgroundLoadGroup);
+		rgm.declareResource("GreenSkin.jpg", tm.getResourceType(), testBackgroundLoadGroup);
+		rgm.declareResource("MtlPlat2.jpg", tm.getResourceType(), testBackgroundLoadGroup);
+		rgm.declareResource("NMBumpsOut.png", tm.getResourceType(), testBackgroundLoadGroup);
+		rgm.declareResource("ogrehead.mesh", mm.getResourceType(), testBackgroundLoadGroup);
+		// Note: initialise resource group in main thread for this test
+		// We will be able to initialise in the background thread too eventually,
+		// once resources can be created thread safely as well as loaded
+		rgm.initialiseResourceGroup(testBackgroundLoadGroup);
+
+		// we won't load it yet, we'll wait for 5 seconds
+
+
+		// Create a basic plane to have something in the scene to look at
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 100;
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+		Entity* pPlaneEnt;
+		pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("2 - Default");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+
+
+
+	}
+
+
+
+	void testOverlayRelativeMode()
+	{
+
+		Overlay* o = OverlayManager::getSingleton().create("Test");
+		OverlayContainer* c = (OverlayContainer*)OverlayManager::getSingleton().createOverlayElement("Panel", "panel1");
+		c->setMetricsMode(GMM_RELATIVE);
+		c->setDimensions(1.0, 1.0);
+		c->setMaterialName("Core/StatsBlockCenter");
+		c->setPosition(0.0, 0.0);
+
+		TextAreaOverlayElement* t = (TextAreaOverlayElement*)OverlayManager::getSingleton().createOverlayElement("TextArea", "text1");
+		t->setMetricsMode(GMM_RELATIVE);
+		t->setCaption("Hello");
+		t->setPosition(0,0);
+		t->setFontName("BlueHighway");
+		t->setDimensions(0.2, 0.5);
+		t->setCharHeight(0.2);
+		c->addChild(t);
+
+		o->add2D(c);
+		o->show();
+
+	}
+
+	void testBillboardOrigins()
+	{
+		mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+		Vector3 dir(-1, -1, 0.5);
+		dir.normalise();
+		Light* l = mSceneMgr->createLight("light1");
+		l->setType(Light::LT_DIRECTIONAL);
+		l->setDirection(dir);
+
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 0;
+		MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+		Entity* pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		pPlaneEnt->setMaterialName("2 - Default");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+		BillboardSet* bbs = mSceneMgr->createBillboardSet("1");
+		bbs->setDefaultDimensions(50,50);
+		bbs->createBillboard(0, 0, 0);
+		bbs->setBillboardOrigin(BBO_TOP_LEFT);
+		//bbs->setBillboardType(BBT_ORIENTED_COMMON);
+		bbs->setCommonDirection(Vector3::UNIT_Y);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(bbs);
+
+	}
+
+	void testDepthBias()
+	{
+		ResourceGroupManager::getSingleton().addResourceLocation(
+			"../../../../Tests/Media", "FileSystem");
+
+		mSceneMgr->setAmbientLight(ColourValue::White);
+		
+		MaterialPtr mat = MaterialManager::getSingleton().create("mat1", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* p = mat->getTechnique(0)->getPass(0);
+		p->createTextureUnitState("BumpyMetal.jpg");
+		
+		const String meshName("cube.mesh"); 
+		Entity* entity = mSceneMgr->createEntity("base", meshName);
+		entity->setMaterialName("mat1");
+		mSceneMgr->getRootSceneNode()->attachObject(entity);
+
+
+		entity = mSceneMgr->createEntity("base2", meshName);
+		entity->setMaterialName("Examples/EnvMappedRustySteel");
+		SceneNode* n = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		n->setPosition(-30, 0, 0);
+		n->yaw(Degree(45));
+		n->attachObject(entity);
+
+		for (size_t i = 0; i <= 6;++i)
+		{
+			String name("decal");
+			name += StringConverter::toString(i);
+
+			MaterialPtr pMat = static_cast<MaterialPtr>(MaterialManager::getSingleton().create(
+				name, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME));
+
+			pMat->getTechnique(0)->getPass(0)->setLightingEnabled(false);
+			pMat->getTechnique(0)->getPass(0)->setAlphaRejectSettings(CMPF_GREATER_EQUAL, 128);
+			pMat->getTechnique(0)->getPass(0)->setDepthBias(i);
+			pMat->getTechnique(0)->getPass(0)->createTextureUnitState(name + ".png");
+
+			entity = mSceneMgr->createEntity(name, meshName);
+			entity->setMaterialName(name);
+			mSceneMgr->getRootSceneNode()->attachObject(entity);
+		}
+
+
+
+		mCamera->setPosition(0,0,200);
+		mCamera->lookAt(Vector3::ZERO);
+
+
+	}
+
+
+	void testTextureShadowsIntegrated()
+	{
+		mSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED);
+		//mSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_MODULATIVE);
+		MaterialManager::getSingleton().setDefaultTextureFiltering(TFO_ANISOTROPIC);
+		MaterialManager::getSingleton().setDefaultAnisotropy(5);
+
+		mSceneMgr->setShadowTextureSettings(1024, 2);
+
+		mSceneMgr->setAmbientLight(ColourValue::Black);
+		Light* l = mSceneMgr->createLight("Spot1");
+		l->setType(Light::LT_SPOTLIGHT);
+		l->setAttenuation(5000,1,0,0);
+		l->setSpotlightRange(Degree(30),Degree(45),1.0f);
+		SceneNode* lightNode1 = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		lightNode1->attachObject(l);
+		lightNode1->setPosition(400, 250, 500);
+		lightNode1->lookAt(Vector3(0,-200,0), Node::TS_WORLD);
+		l->setDirection(Vector3::NEGATIVE_UNIT_Z);
+		l->setDiffuseColour(0.7, 0.7, 0.5);
+
+		l = mSceneMgr->createLight("Spot2");
+		l->setAttenuation(5000,1,0,0);
+		/* // spotlight */
+		l->setType(Light::LT_SPOTLIGHT);
+		l->setSpotlightRange(Degree(30),Degree(45),1.0f);
+		/**/
+		// point
+		SceneNode* lightNode2 = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		lightNode2->attachObject(l);
+		lightNode2->setPosition(-500, 200, 500);
+		lightNode2->lookAt(Vector3(0,-200,0), Node::TS_WORLD);
+		l->setDirection(Vector3::NEGATIVE_UNIT_Z);
+		/* // directional
+		l->setType(Light::LT_DIRECTIONAL);
+		Vector3 dir(0.5, -1, 0.5);
+		dir.normalise();
+		l->setDirection(dir);
+		*/
+		l->setDiffuseColour(1, 0.2, 0.2);
+
+		/*
+		// Test spot 3
+		l = mSceneMgr->createLight("Spot3");
+		l->setType(Light::LT_SPOTLIGHT);
+		l->setAttenuation(5000,1,0,0);
+		l->setSpotlightRange(Degree(30),Degree(45),1.0f);
+		SceneNode* lightNode3 = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		lightNode3->attachObject(l);
+		lightNode3->setPosition(700, 250, 500);
+		lightNode3->lookAt(Vector3(0,-200,0), Node::TS_WORLD);
+		l->setDirection(Vector3::NEGATIVE_UNIT_Z);
+		l->setDiffuseColour(0.0, 0.7, 1.0);
+		*/
+
+		// Create a basic plane to have something in the scene to look at
+		Plane plane;
+		plane.normal = Vector3::UNIT_Y;
+		plane.d = 100;
+		MeshPtr msh = MeshManager::getSingleton().createPlane("Myplane",
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+			4500,4500,100,100,true,1,40,40,Vector3::UNIT_Z);
+		msh->buildTangentVectors(VES_TANGENT);
+		Entity* pPlaneEnt;
+		pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+		//pPlaneEnt->setMaterialName("Examples/OffsetMapping/Specular");
+		pPlaneEnt->setMaterialName("Examples/OffsetMapping/IntegratedShadows");
+		pPlaneEnt->setCastShadows(false);
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+		pPlaneEnt = mSceneMgr->createEntity( "plane2", "Myplane" );
+		//pPlaneEnt->setMaterialName("Examples/OffsetMapping/Specular");
+		pPlaneEnt->setMaterialName("Examples/OffsetMapping/IntegratedShadows");
+		pPlaneEnt->setCastShadows(false);
+		SceneNode* n = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		n->roll(Degree(90));
+		n->translate(100,0,0);
+		//n->attachObject(pPlaneEnt);
+
+		pPlaneEnt = mSceneMgr->createEntity( "plane3", "Myplane" );
+		//pPlaneEnt->setMaterialName("Examples/OffsetMapping/Specular");
+		pPlaneEnt->setMaterialName("Examples/OffsetMapping/IntegratedShadows");
+		pPlaneEnt->setCastShadows(false);
+		n = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		n->pitch(Degree(90));
+		n->yaw(Degree(-90));
+		n->translate(0,0,-100);
+		n->attachObject(pPlaneEnt);
+
+		mCamera->setPosition(-50, 500, 1000);
+		mCamera->lookAt(Vector3(-50,-100,0));
+
+		Entity* ent = mSceneMgr->createEntity("athene", "athene.mesh");
+		ent->setMaterialName("Examples/Athene/NormalMapped");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(0,-20,0))->attachObject(ent);
+
+		//addTextureShadowDebugOverlay(2);
+
+
+
+	}
+
+	void testTimeCreateDestroyObject()
+	{
+		int iterationCount = 100000;
+
+		// Create names ahead of time
+		StringVector nameList;
+		nameList.reserve(iterationCount);
+		for (int i = 0; i < iterationCount; ++i)
+		{
+			nameList.push_back("somerelativelylongtestname" + StringConverter::toString(i));
+		}
+
+		Timer timer;
+		StringVector::iterator nameIt = nameList.begin();
+		timer.reset();
+		for (int i = 0; i < iterationCount; ++i, ++nameIt)
+		{
+			ManualObject* man = mSceneMgr->createManualObject(*nameIt);
+		}
+		unsigned long createTime = timer.getMilliseconds();
+
+		nameIt = nameList.begin();
+		timer.reset();
+		for (int i = 0; i < iterationCount; ++i, ++nameIt)
+		{
+			ManualObject* man = mSceneMgr->getManualObject(*nameIt);
+			// do something so compiler doesn't think I'm doing nothing
+			man->setVisible(true);
+		}
+		unsigned long lookupTime = timer.getMilliseconds();
+
+		nameIt = nameList.begin();
+		timer.reset();
+		for (int i = 0; i < iterationCount; ++i, ++nameIt)
+		{
+			mSceneMgr->destroyManualObject(*nameIt);
+		}
+		unsigned long destroyTime = timer.getMilliseconds();
+
+		nameIt = nameList.begin();
+		timer.reset();
+		for (int i = 0; i < iterationCount; ++i, ++nameIt)
+		{
+			mSceneMgr->createSceneNode(*nameIt);
+		}
+		unsigned long sncreateTime = timer.getMilliseconds();
+
+		nameIt = nameList.begin();
+		timer.reset();
+		for (int i = 0; i < iterationCount; ++i, ++nameIt)
+		{
+			mSceneMgr->destroySceneNode(*nameIt);
+		}
+		unsigned long sndestroyTime = timer.getMilliseconds();
+
+		StringUtil::StrStreamType str;
+		str << "Object create time: " << ((float)createTime / 1000.0f) << " secs" << std::endl;
+		str << "Object lookup time: " << ((float)lookupTime / 1000.0f) << " secs" << std::endl;
+		str << "Object destroy time: " << ((float)destroyTime / 1000.0f) << " secs" << std::endl;
+		str << "SceneNode create time: " << ((float)sncreateTime / 1000.0f) << " secs" << std::endl;
+		str << "SceneNode destroy time: " << ((float)sndestroyTime / 1000.0f) << " secs" << std::endl;
+		LogManager::getSingleton().logMessage(str.str());
+
+
+	}
+
+
+	void testMRT()
+	{
+		TexturePtr Tex[2];
+		MultiRenderTarget* mrtTex;
+
+		Viewport* viewport = mWindow->getViewport(0);
+		uint width = viewport->getActualWidth();
+		uint height = viewport->getActualHeight();
+
+		Tex[0] = TextureManager::getSingleton().createManual("diffusemap", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, TEX_TYPE_2D,
+			width,height,0,PF_R8G8B8A8,TU_RENDERTARGET);
+		Tex[1] = TextureManager::getSingleton().createManual("normalmap",ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, TEX_TYPE_2D,
+			width,height,0,PF_R8G8B8A8,TU_RENDERTARGET);
+
+		//	assert(Tex[0]->getFormat() == PF_FLOAT16_RGBA);
+
+		mrtTex = Ogre::Root::getSingleton().getRenderSystem()->createMultiRenderTarget("MRT");
+		RenderTexture* rTex[2];
+		rTex[0] = Tex[0]->getBuffer()->getRenderTarget();
+		rTex[1] = Tex[1]->getBuffer()->getRenderTarget();
+
+		rTex[0]->setAutoUpdated(false);
+		rTex[1]->setAutoUpdated(false);
+		mrtTex->bindSurface(0, rTex[0]);
+		mrtTex->bindSurface(1, rTex[1]);
+		mrtTex->setAutoUpdated(true);
+
+		Viewport *v = mrtTex->addViewport(mCamera);
+		v->setMaterialScheme("MRT");
+		v->setClearEveryFrame(true);
+		v->setOverlaysEnabled(false);
+		v->setSkiesEnabled(false);
+		v->setBackgroundColour(ColourValue(0,0,0,0));
+
+		// Create texture overlay here
+		Overlay *debugOverlay = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
+		MaterialPtr debugMat = MaterialManager::getSingleton().create("DebugRTTMat1", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		debugMat->getTechnique(0)->getPass(0)->setLightingEnabled(false);
+		TextureUnitState *t = debugMat->getTechnique(0)->getPass(0)->createTextureUnitState("normalmap");
+		t->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
+		OverlayContainer *debugPanel = (OverlayContainer *) (OverlayManager::getSingleton().createOverlayElement("Panel","DebugRTTPanel1"));
+		debugPanel->_setPosition(0.8,0);
+		debugPanel->_setDimensions(0.2,0.3);
+		debugPanel->setMaterialName(debugMat->getName());
+		debugOverlay->add2D(debugPanel);
+
+		debugMat = MaterialManager::getSingleton().create("DebugRTTMat2", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		debugMat->getTechnique(0)->getPass(0)->setLightingEnabled(false);
+		t = debugMat->getTechnique(0)->getPass(0)->createTextureUnitState("diffusemap");
+		t->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
+		debugPanel = (OverlayContainer *) (OverlayManager::getSingleton().createOverlayElement("Panel","DebugRTTPanel2"));
+		debugPanel->_setPosition(0.8,0.3);
+		debugPanel->_setDimensions(0.2,0.3);
+		debugPanel->setMaterialName(debugMat->getName());
+		debugOverlay->add2D(debugPanel);
+		// Create scene items
+
+		// Create a material to render differently to MRT compared to main viewport
+		MaterialPtr mat = MaterialManager::getSingleton().create("MRTTest", 
+			ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		// normal technique (0), leave as default
+		Technique* mrtTech = mat->createTechnique();
+		mrtTech->setSchemeName("MRT");
+		Pass* mrtPass = mrtTech->createPass();
+		mrtPass->setVertexProgram("DeferredShading/material/hlsl/vs");
+		mrtPass->setFragmentProgram("DeferredShading/material/hlsl/ps");
+		mrtPass->createTextureUnitState("rockwall.tga");
+		mat->load();
+
+		Entity* ent = mSceneMgr->createEntity("knot", "knot.mesh");
+		ent->setMaterialName("MRTTest");
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+
+		mCamera->setPosition(0, 0, 200);
+		mCamera->lookAt(Vector3::ZERO);
+
+
+
+	}
+
+	void test16Textures()
+	{
+
+		HighLevelGpuProgramPtr frag;
+		if (StringUtil::match(Root::getSingleton().getRenderSystem()->getName(), "*GL*"))
+		{
+			frag = HighLevelGpuProgramManager::getSingleton().createProgram("frag16", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+				"glsl", GPT_FRAGMENT_PROGRAM);
+			frag->setSource(" \
+				uniform sampler2D tex0; \
+				uniform sampler2D tex1; \
+				uniform sampler2D tex2; \
+				uniform sampler2D tex3; \
+				uniform sampler2D tex4; \
+				uniform sampler2D tex5; \
+				uniform sampler2D tex6; \
+				uniform sampler2D tex7; \
+				uniform sampler2D tex8; \
+				uniform sampler2D tex9; \
+				uniform sampler2D tex10; \
+				uniform sampler2D tex11; \
+				uniform sampler2D tex12; \
+				uniform sampler2D tex13; \
+				uniform sampler2D tex14; \
+				uniform sampler2D tex15; \
+				void main() \
+				{ \
+					gl_FragColor = texture2D(tex15, gl_TexCoord[0].xy); \
+				} \
+				");
+
+		}
+		else
+		{
+			// DirectX
+			frag = HighLevelGpuProgramManager::getSingleton().createProgram("frag16", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
+				"hlsl", GPT_FRAGMENT_PROGRAM);
+			frag->setParameter("target", "ps_2_0");
+			frag->setParameter("entry_point", "main");
+			frag->setSource(" \
+				float4 main( \
+					float2 uv : TEXCOORD0, \
+					uniform sampler2D tex0 : register(s0), \
+					uniform sampler2D tex1 : register(s1), \
+					uniform sampler2D tex2 : register(s2), \
+					uniform sampler2D tex3 : register(s3), \
+					uniform sampler2D tex4 : register(s4), \
+					uniform sampler2D tex5 : register(s5), \
+					uniform sampler2D tex6 : register(s6), \
+					uniform sampler2D tex7 : register(s7), \
+					uniform sampler2D tex8 : register(s8), \
+					uniform sampler2D tex9 : register(s9), \
+					uniform sampler2D tex10 : register(s10), \
+					uniform sampler2D tex11 : register(s11), \
+					uniform sampler2D tex12 : register(s12), \
+					uniform sampler2D tex13 : register(s13), \
+					uniform sampler2D tex14 : register(s14), \
+					uniform sampler2D tex15 : register(s15) \
+					) : COLOR \
+				{ \
+					return tex2D(tex15, uv); \
+				} \
+				");
+		}
+		frag->load();
+		
+		MaterialPtr mat = MaterialManager::getSingleton().create("test16", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+		Pass* p = mat->getTechnique(0)->getPass(0);
+		p->setVertexProgram("Ogre/BasicVertexPrograms/AmbientOneTextureUnified");
+		p->setFragmentProgram(frag->getName());
+		// create 15 textures the same
+		for (int i = 0; i < 15; ++i)
+		{
+			p->createTextureUnitState("Dirt.jpg");
+		}
+		// create 16th texture differently
+		p->createTextureUnitState("ogrelogo.png");
+		if (StringUtil::match(Root::getSingleton().getRenderSystem()->getName(), "*GL*"))
+		{
+			// map samplers
+			GpuProgramParametersSharedPtr params = p->getFragmentProgramParameters();
+			for (int i = 0; i < 16; ++i)
+			{
+				params->setNamedConstant(String("tex") + StringConverter::toString(i), i);
+			}
+
+		}
+
+		mat->load();
+
+		Entity* e = mSceneMgr->createEntity("1", "knot.mesh");
+		e->setMaterialName(mat->getName());
+		mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+
+		mCamera->setPosition(0,0,200);
+		mCamera->lookAt(0,0,0);
+
+	
+	}
+	struct Foo;
+	typedef Ogre::SharedPtr<Foo> FooPtr;
+	struct Foo { FooPtr ptr; };
+
+    void createScene(void)
+    {
+		// In main() or someplace:
+		FooPtr foo(new Foo);
+		foo->ptr.bind(new Foo);
+		foo = foo->ptr;
+		// foo now contains a wild pointer! 
+		// Just override the mandatory create scene method
+		ErrorDialog e;
+
+		MeshPtr m;
+		ResourcePtr p = m;
+
+		Real d = std::numeric_limits<Real>::infinity();
+		d = std::max(1e10f, d);
+		d = std::min(1e5f, d);
+		/*
+		AnyNumeric anyInt1(43);
+		AnyNumeric anyInt2(5);
+		AnyNumeric anyInt3 = anyInt1 + anyInt2;
+
+		bool tst = StringConverter::isNumber("3");
+		tst = StringConverter::isNumber("-0.3");
+		tst = StringConverter::isNumber("");
+		tst = StringConverter::isNumber("  ");
+		tst = StringConverter::isNumber(" -0.3 ");
+		tst = StringConverter::isNumber(" a-0.3 ");
+
+		const StringVector& l = mCamera->getAnimableValueNames();
+
+		std::cout << anyInt3;
+
+		//Any anyString("test");
+		*/
+
+        //testMatrices();
+        //testBsp();
+        //testAlpha();
+        //testAnimation();
+		//testAnimationBlend();
+
+        //testGpuPrograms();
+        //testMultiViewports();
+        //testDistortion();
+        //testEdgeBuilderSingleIndexBufSingleVertexBuf();
+        //testEdgeBuilderMultiIndexBufSingleVertexBuf();
+        //testEdgeBuilderMultiIndexBufMultiVertexBuf();
+        //testPrepareShadowVolume();
+        //testWindowedViewportMode();
+        //testSubEntityVisibility();
+        //testAttachObjectsToBones();
+        //testSkeletalAnimation();
+        //testOrtho();
+        //testClearScene();
+		//testInfiniteAAB();
+
+        //testProjection();
+        //testStencilShadows(SHADOWTYPE_STENCIL_ADDITIVE, true, true);
+        //testStencilShadows(SHADOWTYPE_STENCIL_MODULATIVE, false, true);
+        //testTextureShadows(SHADOWTYPE_TEXTURE_ADDITIVE);
+		//testTextureShadows(SHADOWTYPE_TEXTURE_MODULATIVE);
+		//testTextureShadowsIntegrated();
+		//testStencilShadowsMixedOpSubMeshes(false, true);
+
+		//testTextureShadowsCustomCasterMat(SHADOWTYPE_TEXTURE_ADDITIVE);
+		//testTextureShadowsCustomReceiverMat(SHADOWTYPE_TEXTURE_MODULATIVE);
+		//testCompositorTextureShadows(SHADOWTYPE_TEXTURE_MODULATIVE);
+		//testSplitPassesTooManyTexUnits();
+        //testOverlayZOrder();
+		//testReflectedBillboards();
+		//testBlendDiffuseColour();
+
+        //testRaySceneQuery();
+		//testMaterialSerializer();
+        //testIntersectionSceneQuery();
+
+        //test2Spotlights();
+		//testDepthBias();
+
+		//testManualLOD();
+		//testGeneratedLOD();
+		//testLotsAndLotsOfEntities();
+		//testSimpleMesh();
+		//test2Windows();
+		//testStaticGeometry();
+		//testBillboardTextureCoords();
+		//testBillboardOrigins();
+		//testReloadResources();
+		//testTransparencyMipMaps();
+		//testRadixSort();
+		//testMorphAnimation();
+		//testPoseAnimation();
+		//testPoseAnimation2();
+		//testBug();
+		//test16Textures();
+		//testProjectSphere();
+		//testTimeCreateDestroyObject();
+		//testManualBlend();
+		//testManualObjectNonIndexed();
+		//testManualObjectIndexed();
+		//testManualObjectNonIndexedUpdateSmaller();
+		//testManualObjectNonIndexedUpdateLarger();
+		//testManualObjectIndexedUpdateSmaller();
+		//testManualObjectIndexedUpdateLarger();
+		//testCustomProjectionMatrix();
+		//testPointSprites();
+		//testFallbackResourceGroup();
+		//testSuppressedShadows(SHADOWTYPE_TEXTURE_ADDITIVE);
+		//testViewportNoShadows(SHADOWTYPE_TEXTURE_ADDITIVE);
+		//testBillboardChain();
+		//testRibbonTrail();
+		//testSerialisedColour();
+		//testBillboardAccurateFacing();
+		//testMultiSceneManagersSimple();
+		//testMultiSceneManagersComplex();
+		//testManualBoneMovement();
+		//testMaterialSchemes();
+		//testMaterialSchemesWithLOD();
+		//testMaterialSchemesWithMismatchedLOD();
+        //testSkeletonAnimationOptimise();
+        //testBuildTangentOnAnimatedMesh();
+		//testOverlayRelativeMode();
+
+		//testCubeDDS();
+		//testDxt1();
+		//testDxt1FromMemory();
+		testDxt3FromMemory();
+		//testDxt1Alpha();
+		//testDxt3();
+		//testDxt5();
+		//testFloat64DDS();
+		//testFloat128DDS();
+		//testFloat16DDS();
+		//testFloat32DDS();
+
+		//testVertexTexture();
+		//testGLSLTangent();
+		//testBackgroundLoadResourceGroup();
+		//testMRT();
+		
+    }
+    // Create new frame listener
+    void createFrameListener(void)
+    {
+        mFrameListener= new PlayPenListener(mSceneMgr, mWindow, mCamera);
+        mFrameListener->showDebugOverlay(true);
+		mRoot->addFrameListener(mFrameListener);
+        //mRoot->addFrameListener(fl);
+
+    }
+    
+
+public:
+    void go(void)
+    {
+        if (!setup())
+            return;
+
+        mRoot->startRendering();
+    }
+
+	bool setup()
+	{
+		String pluginsPath = mResourcePath + "plugins.cfg";
+		// only use plugins.cfg if not static
+#ifdef OGRE_STATIC_LIB
+		mRoot = new Root(StringUtil::BLANK, 
+			mResourcePath + "ogre.cfg", mResourcePath + "Ogre.log");
+		mStaticPluginLoader.load(*mRoot);
+#else
+		mRoot = new Root(pluginsPath, 
+			mResourcePath + "ogre.cfg", mResourcePath + "Ogre.log");
+#endif
+		setupResources();
+
+		bool carryOn = configure();
+		if (!carryOn) return false;
+
+		chooseSceneManager();
+		createCamera();
+		createViewports();
+
+		// Set default mipmap level (NB some APIs ignore this)
+		TextureManager::getSingleton().setDefaultNumMipmaps(5);
+
+		// Create any resource listeners (for loading screens)
+		createResourceListener();
+		// Load resources
+		loadResources();
+
+		// Create the scene
+		createScene();
+
+		createFrameListener();
+
+		return true;
+
+	}
+
+
+
+};
+
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+bool gReload;
+
+// Listener class for frame updates
+class MemoryTestFrameListener : public FrameListener
+{
+protected:
+	Real time;
+	Keyboard* mKeyboard;
+public:
+	MemoryTestFrameListener(RenderWindow * win)
+	{
+		time = 0;
+		ParamList pl;	
+		size_t windowHnd = 0;
+		std::ostringstream windowHndStr;
+
+		win->getCustomAttribute("WINDOW", &windowHnd);
+		windowHndStr << windowHnd;
+		pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
+
+		InputManager &im = *InputManager::createInputSystem( pl );
+
+		//Create all devices (We only catch joystick exceptions here, as, most people have Key/Mouse)
+		mKeyboard = static_cast<Keyboard*>(im.createInputObject( OISKeyboard, false ));
+	}
+	virtual ~MemoryTestFrameListener()
+	{
+		time = 0;            
+	}
+
+	bool frameStarted(const FrameEvent& evt)
+	{
+		if( mKeyboard->isKeyDown( KC_ESCAPE) )
+		{
+			gReload = false;
+			return false;
+		}
+
+		time += evt.timeSinceLastFrame;
+		if(time>5)
+		{
+			LogManager::getSingleton().logMessage("Reloading scene after 5 seconds");
+			gReload = true;
+			time=0;
+			return false;
+		}
+		else
+		{
+			gReload = false;
+			return true;
+		}
+	}
+
+	void keyClicked(KeyEvent* e) {};
+	void keyPressed(KeyEvent* e) {};
+	void keyReleased(KeyEvent* e) {};
+	void keyFocusIn(KeyEvent* e) {}
+	void keyFocusOut(KeyEvent* e) {}
+};
+
+/** Application class */
+class MemoryTestApplication : public ExampleApplication
+{
+protected:
+	MemoryTestFrameListener * mTestFrameListener;
+public:
+
+	void go(void)
+	{
+		mRoot = 0;
+		if (!setup())
+			return;
+
+		mRoot->startRendering();
+
+		while(gReload)
+		{
+			// clean up
+			destroyScene();
+			destroyResources();
+			if (!setup())
+				return;
+			mRoot->startRendering();
+		}
+		// clean up
+		destroyScene();
+	}
+
+	bool setup(void)
+	{
+		if(!gReload)
+		{
+			String pluginsPath = mResourcePath + "plugins.cfg";
+			mRoot = new Root(pluginsPath, 
+				mResourcePath + "ogre.cfg", mResourcePath + "Ogre.log");
+		}
+
+		setupResources();
+
+		if(!gReload)
+		{
+
+			bool carryOn = configure();
+			if (!carryOn)
+				return false;
+
+			chooseSceneManager();
+			createCamera();
+			createViewports();
+
+			// Set default mipmap level (NB some APIs ignore this)
+			TextureManager::getSingleton().setDefaultNumMipmaps(5);
+
+			// Create any resource listeners (for loading screens)
+			createResourceListener();
+
+			createFrameListener();
+		}
+		// Load resources
+		loadResources();
+
+		// Create the scene
+		createScene();        
+
+		return true;
+
+	}
+
+	/// Method which will define the source of resources (other than current folder)
+	virtual void setupResources(void)
+	{
+		// Custom setup
+		ResourceGroupManager::getSingleton().createResourceGroup("CustomResourceGroup");
+		ResourceGroupManager::getSingleton().addResourceLocation(
+			"../../../media/ogrehead.zip", "Zip", "CustomResourceGroup");
+	}
+	void loadResources(void)
+	{
+		// Initialise, parse scripts etc
+		ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+	}
+	void destroyResources()
+	{
+		LogManager::getSingleton().logMessage("Destroying resources");
+		ResourceGroupManager::getSingleton().removeResourceLocation(
+			"../../../media/ogrehead.zip");
+		ResourceGroupManager::getSingleton().destroyResourceGroup("CustomResourceGroup");
+	}
+
+	void createScene(void)
+	{
+		// Set a very low level of ambient lighting
+		mSceneMgr->setAmbientLight(ColourValue(0.1, 0.1, 0.1));
+
+		// Load ogre head
+		MeshManager::getSingleton().load("ogrehead.mesh","CustomResourceGroup");
+		Entity* head = mSceneMgr->createEntity("head", "ogrehead.mesh");
+
+		// Attach the head to the scene
+		mSceneMgr->getRootSceneNode()->attachObject(head);
+
+	}
+
+	void createFrameListener(void)
+	{
+		// This is where we instantiate our own frame listener
+		mTestFrameListener= new MemoryTestFrameListener(mWindow);
+		mRoot->addFrameListener(mTestFrameListener);
+		/*if(!gReload)
+		{
+		ExampleApplication::createFrameListener();
+		}*/
+	}
+
+	void destroyScene(void)
+	{
+		LogManager::getSingleton().logMessage("Clearing scene");
+		mSceneMgr->clearScene();
+	}
+};
+
+
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+
+// External embedded window test
+INT WINAPI EmbeddedMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT );
+
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+	//EmbeddedMain(hInst, 0, strCmdLine, 0);
+
+	// Create application object
+    PlayPenApplication app;
+	//MemoryTestApplication app;
+
+    try {
+        app.go();
+	} catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+
+    return 0;
+}
+
+
+
+
+
+
+
Index: /Tests/PlayPen/src/WindowEmbedding.cpp
===================================================================
--- /Tests/PlayPen/src/WindowEmbedding.cpp	(revision 5)
+++ /Tests/PlayPen/src/WindowEmbedding.cpp	(revision 5)
@@ -0,0 +1,210 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program 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 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/*
+-----------------------------------------------------------------------------
+Filename:    WindowEmbedding.cpp
+Description: Stuff your windows full of OGRE
+-----------------------------------------------------------------------------
+*/
+#include "Ogre.h"
+
+using namespace Ogre;
+
+void setupResources(void)
+{
+	// Load resource paths from config file
+	ConfigFile cf;
+	cf.load("resources.cfg");
+
+	// Go through all sections & settings in the file
+	ConfigFile::SectionIterator seci = cf.getSectionIterator();
+
+	String secName, typeName, archName;
+	while (seci.hasMoreElements())
+	{
+		secName = seci.peekNextKey();
+		ConfigFile::SettingsMultiMap *settings = seci.getNext();
+		ConfigFile::SettingsMultiMap::iterator i;
+		for (i = settings->begin(); i != settings->end(); ++i)
+		{
+			typeName = i->first;
+			archName = i->second;
+			ResourceGroupManager::getSingleton().addResourceLocation(
+				archName, typeName, secName);
+		}
+	}
+}
+
+
+//---------------------------------------------------------------------
+// Windows Test
+//---------------------------------------------------------------------
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#include "windows.h"
+
+RenderWindow* renderWindow = 0;
+bool winActive = false;
+bool winSizing = false;
+
+LRESULT CALLBACK TestWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
+{
+	if (uMsg == WM_CREATE)
+	{
+		return 0;
+	}
+
+
+	if (!renderWindow)
+		return DefWindowProc(hWnd, uMsg, wParam, lParam);
+
+	switch( uMsg )
+	{
+	case WM_ACTIVATE:
+		winActive = (LOWORD(wParam) != WA_INACTIVE);
+		break;
+
+	case WM_ENTERSIZEMOVE:
+		winSizing = true;
+		break;
+
+	case WM_EXITSIZEMOVE:
+		renderWindow->windowMovedOrResized();
+		renderWindow->update();
+		winSizing = false;
+		break;
+
+	case WM_MOVE:
+	case WM_SIZE:
+		if (!winSizing)
+			renderWindow->windowMovedOrResized();
+		break;
+
+	case WM_GETMINMAXINFO:
+		// Prevent the window from going smaller than some min size
+		((MINMAXINFO*)lParam)->ptMinTrackSize.x = 100;
+		((MINMAXINFO*)lParam)->ptMinTrackSize.y = 100;
+		break;
+
+	case WM_CLOSE:
+		renderWindow->destroy(); // cleanup and call DestroyWindow
+		PostQuitMessage(0); 
+		return 0;
+	case WM_PAINT:
+		if (!winSizing)
+		{
+			renderWindow->update();
+			return 0;
+		}
+		break;
+	}
+
+	return DefWindowProc( hWnd, uMsg, wParam, lParam );
+}
+
+
+INT WINAPI EmbeddedMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+{
+	try 
+	{
+		// Create a new window
+
+		// Style & size
+		DWORD dwStyle = WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW;
+
+		// Register the window class
+		WNDCLASS wc = { 0, TestWndProc, 0, 0, hInst,
+			LoadIcon(0, IDI_APPLICATION), LoadCursor(NULL, IDC_ARROW),
+			(HBRUSH)GetStockObject(BLACK_BRUSH), 0, "TestWnd" };
+		RegisterClass(&wc);
+
+		HWND hwnd = CreateWindow("TestWnd", "Test embedding", dwStyle,
+				0, 0, 800, 600, 0, 0, hInst, 0);
+
+		Root root("", "");
+
+		root.loadPlugin("RenderSystem_GL");
+		//root.loadPlugin("RenderSystem_Direct3D9");
+		root.loadPlugin("Plugin_ParticleFX");
+		root.loadPlugin("Plugin_CgProgramManager");
+
+		// select first renderer & init with no window
+		root.setRenderSystem(*(root.getAvailableRenderers()->begin()));
+		root.initialise(false);
+
+		// create first window manually
+		NameValuePairList options;
+		options["externalWindowHandle"] = 
+			StringConverter::toString((size_t)hwnd);
+
+		renderWindow = root.createRenderWindow("embedded", 800, 600, false, &options);
+
+		setupResources();
+		ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+
+		SceneManager *scene = root.createSceneManager(Ogre::ST_GENERIC, "default");
+
+
+		Camera *cam = scene->createCamera("cam");
+
+
+		Viewport* vp = renderWindow->addViewport(cam);
+		vp->setBackgroundColour(Ogre::ColourValue(0.5, 0.5, 0.7));
+		cam->setAutoAspectRatio(true);
+		cam->setPosition(0,0,300);
+		cam->setDirection(0,0,-1);
+
+		Entity* e = scene->createEntity("1", "ogrehead.mesh");
+		scene->getRootSceneNode()->createChildSceneNode()->attachObject(e);
+		Light* l = scene->createLight("l");
+		l->setPosition(300, 100, -100);
+
+		// message loop
+		MSG msg;
+		while(GetMessage(&msg, NULL, 0, 0 ) != 0)
+		{ 
+			TranslateMessage(&msg); 
+			DispatchMessage(&msg); 
+		} 
+
+	} 
+	catch( Exception& e ) 
+	{
+		MessageBox( NULL, e.getFullDescription().c_str(), 
+			"An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+	}
+
+
+	return 0;
+}
+
+#endif
+
+
+
+
Index: /Tests/TestOgreMain.cbp
===================================================================
--- /Tests/TestOgreMain.cbp	(revision 5)
+++ /Tests/TestOgreMain.cbp	(revision 5)
@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="4" />
+	<Project>
+		<Option title="TestOgreMain" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="..\Samples\Common\bin\Debug\TestOgreMain.exe" />
+				<Option working_dir="..\Samples\Common\bin\Debug" />
+				<Option object_output=".\obj\Debug" />
+				<Option external_deps="..\Samples\Common\bin\Debug\OgreMain_d.dll;..\Samples\Common\bin\Debug\Plugin_ScriptParsers.dll;" />
+				<Option type="1" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-g" />
+					<Add option="-DWIN32" />
+					<Add option="-D_DEBUG" />
+					<Add option="-D_WINDOWS" />
+					<Add option="-D_USRDLL" />
+					<Add option="-D_STLP_DEBUG" />
+					<Add directory="OgreMain\include" />
+					<Add directory="..\OgreMain\include" />
+					<Add directory="..\Dependencies\include" />
+				</Compiler>
+				<Linker>
+					<Add library="cppunitd" />
+					<Add library="OgreMain_d" />
+					<Add library="Plugin_Scriptparsers" />
+					<Add library="stlportstlg.5.0" />
+					<Add directory="..\Dependencies\lib\Debug" />
+				</Linker>
+			</Target>
+			<Target title="Release">
+				<Option output="..\lib\Release\TestOgreMain.exe" />
+				<Option object_output="..\obj\Release" />
+				<Option type="1" />
+				<Option compiler="gcc" />
+				<Option projectResourceIncludeDirsRelation="0" />
+				<Compiler>
+					<Add option="-O3" />
+					<Add option="-g" />
+					<Add option="-DWIN32" />
+					<Add option="-DNDEBUG" />
+					<Add option="-D_WINDOWS" />
+					<Add option="-D_USRDLL" />
+					<Add option="-DREFERENCEAPPLAYER_EXPORTS" />
+					<Add directory="OgreMain\include" />
+					<Add directory="..\OgreMain\include" />
+					<Add directory="..\Dependencies\include" />
+				</Compiler>
+				<Linker>
+					<Add library="cppunit" />
+					<Add library="OgreMain" />
+					<Add library="Plugin_Scriptparsers" />
+					<Add library="stlport.5.0" />
+					<Add directory="..\..\..\Dependencies\lib\Release" />
+				</Linker>
+			</Target>
+		</Build>
+		<Compiler>
+			<Add option="-Wall" />
+			<Add option="-pipe" />
+			<Add option="-mthreads" />
+			<Add option="-fmessage-length=0" />
+			<Add option="-fexceptions" />
+			<Add option="-frtti" />
+			<Add option="-D_STLP_NO_CUSTOM_IO" />
+			<Add option="-D_STLP_USE_DYNAMIC_LIB" />
+			<Add directory="$(#STLPORT_DIR)\stlport" />
+		</Compiler>
+		<Linker>
+			<Add option="-Wl,--enable-auto-image-base" />
+			<Add option="-Wl,--add-stdcall-alias" />
+			<Add directory="..\Samples\Common\bin\$(TARGET_NAME)" />
+		</Linker>
+		<Unit filename="OgreMain\include\BitwiseTests.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\include\CompositorScriptCompilerTests.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\include\EdgeBuilderTests.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\include\FileSystemArchiveTests.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\include\MaterialScriptCompilerTests.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\include\PixelFormatTests.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\include\RadixSortTests.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\include\StringTests.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\include\VectorTests.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\include\ZipArchiveTests.h">
+			<Option compilerVar="CPP" />
+			<Option compile="0" />
+			<Option link="0" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\src\BitwiseTests.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\src\CompositorScriptCompilerTests.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\src\EdgeBuilderTests.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\src\FileSystemArchiveTests.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\src\MaterialScriptCompilerTests.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\src\PixelFormatTests.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\src\RadixSort.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\src\StringTests.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\src\VectorTests.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="OgreMain\src\ZipArchiveTests.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+		<Unit filename="src\main.cpp">
+			<Option compilerVar="CPP" />
+			<Option target="Debug" />
+			<Option target="Release" />
+		</Unit>
+	</Project>
+</CodeBlocks_project_file>
Index: /Tests/TestOgreMain.vcproj
===================================================================
--- /Tests/TestOgreMain.vcproj	(revision 5)
+++ /Tests/TestOgreMain.vcproj	(revision 5)
@@ -0,0 +1,277 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="TestOgreMain"
+	ProjectGUID="{0DC410D4-73C1-46F5-9A23-F4026B0B08F7}"
+	RootNamespace="TestOgreMain"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\lib\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="OgreMain\include;..\OgreMain\include;..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;_STLP_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain_d.lib cppunitd.lib"
+				OutputFile="$(OutDir)/TestOgreMain.exe"
+				Version=""
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/TestOgreMain.pdb"
+				SubSystem="1"
+				ImportLibrary="$(OutDir)/TestOgreMain.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\lib\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				EnableFiberSafeOptimizations="true"
+				AdditionalIncludeDirectories="OgreMain\include;..\OgreMain\include;..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;REFERENCEAPPLAYER_EXPORTS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain.lib cppunit.lib"
+				OutputFile="$(OutDir)/TestOgreMain.exe"
+				Version=""
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/TestOgreMain.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="OgreMain\src\EdgeBuilderTests.cpp"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\src\FileSystemArchiveTests.cpp"
+				>
+			</File>
+			<File
+				RelativePath="src\main.cpp"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\src\PixelFormatTests.cpp"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\src\RadixSort.cpp"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\src\StringTests.cpp"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\src\ZipArchiveTests.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="OgreMain\include\EdgeBuilderTests.h"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\include\FileSystemArchiveTests.h"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\include\PixelFormatTests.h"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\include\RadixSortTests.h"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\include\StringTests.h"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\include\ZipArchiveTests.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Tests/TestOgreMain_vc8.vcproj
===================================================================
--- /Tests/TestOgreMain_vc8.vcproj	(revision 5)
+++ /Tests/TestOgreMain_vc8.vcproj	(revision 5)
@@ -0,0 +1,277 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="TestOgreMain"
+	ProjectGUID="{0DC410D4-73C1-46F5-9A23-F4026B0B08F7}"
+	RootNamespace="TestOgreMain"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\lib\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="OgreMain\include;..\OgreMain\include;..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;_STLP_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain_d.lib cppunitd.lib"
+				OutputFile="$(OutDir)/TestOgreMain.exe"
+				Version=""
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/TestOgreMain.pdb"
+				SubSystem="1"
+				ImportLibrary="$(OutDir)/TestOgreMain.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\lib\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				EnableFiberSafeOptimizations="true"
+				AdditionalIncludeDirectories="OgreMain\include;..\OgreMain\include;..\Dependencies\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;REFERENCEAPPLAYER_EXPORTS"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				IgnoreImportLibrary="true"
+				AdditionalDependencies="OgreMain.lib cppunit.lib"
+				OutputFile="$(OutDir)/TestOgreMain.exe"
+				Version=""
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\lib&quot;;&quot;..\..\..\Dependencies\lib\$(ConfigurationName)&quot;"
+				ModuleDefinitionFile=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/TestOgreMain.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\Samples\Common\bin\$(ConfigurationName)"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			>
+			<File
+				RelativePath="OgreMain\src\EdgeBuilderTests.cpp"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\src\FileSystemArchiveTests.cpp"
+				>
+			</File>
+			<File
+				RelativePath="src\main.cpp"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\src\PixelFormatTests.cpp"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\src\RadixSort.cpp"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\src\StringTests.cpp"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\src\ZipArchiveTests.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc"
+			>
+			<File
+				RelativePath="OgreMain\include\EdgeBuilderTests.h"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\include\FileSystemArchiveTests.h"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\include\PixelFormatTests.h"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\include\RadixSortTests.h"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\include\StringTests.h"
+				>
+			</File>
+			<File
+				RelativePath="OgreMain\include\ZipArchiveTests.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /Tests/src/Makefile.am
===================================================================
--- /Tests/src/Makefile.am	(revision 5)
+++ /Tests/src/Makefile.am	(revision 5)
@@ -0,0 +1,16 @@
+INCLUDES = -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Tests/OgreMain/include $(CPPUNIT_CFLAGS)
+
+TESTS = TestSuite
+check_PROGRAMS  = TestSuite
+
+TestSuite_SOURCES = main.cpp \
+                    ../OgreMain/src/EdgeBuilderTests.cpp \
+                    ../OgreMain/src/FileSystemArchiveTests.cpp \
+                    ../OgreMain/src/StringTests.cpp \
+                    ../OgreMain/src/ZipArchiveTests.cpp \
+                    ../OgreMain/src/BitwiseTests.cpp \
+                    ../OgreMain/src/PixelFormatTests.cpp \
+                    ../OgreMain/src/RadixSort.cpp
+
+TestSuite_LDFLAGS = -L$(top_builddir)/OgreMain/src $(CPPUNIT_LIBS)
+TestSuite_LDADD = -lOgreMain
Index: /Tests/src/Makefile.in
===================================================================
--- /Tests/src/Makefile.in	(revision 5)
+++ /Tests/src/Makefile.in	(revision 5)
@@ -0,0 +1,688 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+check_PROGRAMS = TestSuite$(EXEEXT)
+subdir = Tests/src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/Scripts/m4/cppunit.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/OgreMain/include/config.h
+CONFIG_CLEAN_FILES =
+am_TestSuite_OBJECTS = main.$(OBJEXT) EdgeBuilderTests.$(OBJEXT) \
+	FileSystemArchiveTests.$(OBJEXT) StringTests.$(OBJEXT) \
+	ZipArchiveTests.$(OBJEXT) BitwiseTests.$(OBJEXT) \
+	PixelFormatTests.$(OBJEXT) RadixSort.$(OBJEXT)
+TestSuite_OBJECTS = $(am_TestSuite_OBJECTS)
+TestSuite_DEPENDENCIES =
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/OgreMain/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(TestSuite_SOURCES)
+DIST_SOURCES = $(TestSuite_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CGPLUGIN_FALSE = @BUILD_CGPLUGIN_FALSE@
+BUILD_CGPLUGIN_TRUE = @BUILD_CGPLUGIN_TRUE@
+BUILD_DX9RENDERSYSTEM_FALSE = @BUILD_DX9RENDERSYSTEM_FALSE@
+BUILD_DX9RENDERSYSTEM_TRUE = @BUILD_DX9RENDERSYSTEM_TRUE@
+BUILD_EXRPLUGIN_FALSE = @BUILD_EXRPLUGIN_FALSE@
+BUILD_EXRPLUGIN_TRUE = @BUILD_EXRPLUGIN_TRUE@
+BUILD_UNIT_TESTS_FALSE = @BUILD_UNIT_TESTS_FALSE@
+BUILD_UNIT_TESTS_TRUE = @BUILD_UNIT_TESTS_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CEGUI_CFLAGS = @CEGUI_CFLAGS@
+CEGUI_LIBS = @CEGUI_LIBS@
+CFLAGS = @CFLAGS@
+CFLAGS_VISIBILITY = @CFLAGS_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FT2_CFLAGS = @FT2_CFLAGS@
+FT2_CONFIG = @FT2_CONFIG@
+FT2_LIBS = @FT2_LIBS@
+GLSUPPORT_CFLAGS = @GLSUPPORT_CFLAGS@
+GLSUPPORT_LIBS = @GLSUPPORT_LIBS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+HAVE_CEGUI_FALSE = @HAVE_CEGUI_FALSE@
+HAVE_CEGUI_TRUE = @HAVE_CEGUI_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OGRE_BUILDING_DEMOS_FALSE = @OGRE_BUILDING_DEMOS_FALSE@
+OGRE_BUILDING_DEMOS_TRUE = @OGRE_BUILDING_DEMOS_TRUE@
+OGRE_BUILD_SSE_FALSE = @OGRE_BUILD_SSE_FALSE@
+OGRE_BUILD_SSE_TRUE = @OGRE_BUILD_SSE_TRUE@
+OGRE_CFLAGS = @OGRE_CFLAGS@
+OGRE_GLSUPPORT = @OGRE_GLSUPPORT@
+OGRE_GUI = @OGRE_GUI@
+OGRE_LINUX_FALSE = @OGRE_LINUX_FALSE@
+OGRE_LINUX_TRUE = @OGRE_LINUX_TRUE@
+OGRE_NT_FALSE = @OGRE_NT_FALSE@
+OGRE_NT_TRUE = @OGRE_NT_TRUE@
+OGRE_OSX_FALSE = @OGRE_OSX_FALSE@
+OGRE_OSX_TRUE = @OGRE_OSX_TRUE@
+OGRE_PLATFORM = @OGRE_PLATFORM@
+OGRE_THREAD_LIBS = @OGRE_THREAD_LIBS@
+OIS_CFLAGS = @OIS_CFLAGS@
+OIS_LIBS = @OIS_LIBS@
+OPENEXR_CFLAGS = @OPENEXR_CFLAGS@
+OPENEXR_LIBS = @OPENEXR_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLATFORM_CFLAGS = @PLATFORM_CFLAGS@
+PLATFORM_LIBS = @PLATFORM_LIBS@
+PLUGIN_FLAGS = @PLUGIN_FLAGS@
+RANLIB = @RANLIB@
+RC = @RC@
+SAME_PLATFORM_AND_GUI_FALSE = @SAME_PLATFORM_AND_GUI_FALSE@
+SAME_PLATFORM_AND_GUI_TRUE = @SAME_PLATFORM_AND_GUI_TRUE@
+SET_MAKE = @SET_MAKE@
+SHARED_FLAGS = @SHARED_FLAGS@
+SHELL = @SHELL@
+STLPORT_CFLAGS = @STLPORT_CFLAGS@
+STLPORT_LIBS = @STLPORT_LIBS@
+STRIP = @STRIP@
+USE_DEVIL_FALSE = @USE_DEVIL_FALSE@
+USE_DEVIL_TRUE = @USE_DEVIL_TRUE@
+USE_FREEIMAGE_FALSE = @USE_FREEIMAGE_FALSE@
+USE_FREEIMAGE_TRUE = @USE_FREEIMAGE_TRUE@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ZZIPLIB_CFLAGS = @ZZIPLIB_CFLAGS@
+ZZIPLIB_LIBS = @ZZIPLIB_LIBS@
+abs_top_builddir = @abs_top_builddir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+ogreexecdir = @ogreexecdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+INCLUDES = -I$(top_srcdir)/OgreMain/include -I$(top_srcdir)/Tests/OgreMain/include $(CPPUNIT_CFLAGS)
+TESTS = TestSuite
+TestSuite_SOURCES = main.cpp \
+                    ../OgreMain/src/EdgeBuilderTests.cpp \
+                    ../OgreMain/src/FileSystemArchiveTests.cpp \
+                    ../OgreMain/src/StringTests.cpp \
+                    ../OgreMain/src/ZipArchiveTests.cpp \
+                    ../OgreMain/src/BitwiseTests.cpp \
+                    ../OgreMain/src/PixelFormatTests.cpp \
+                    ../OgreMain/src/RadixSort.cpp
+
+TestSuite_LDFLAGS = -L$(top_builddir)/OgreMain/src $(CPPUNIT_LIBS)
+TestSuite_LDADD = -lOgreMain
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Tests/src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Tests/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-checkPROGRAMS:
+	@list='$(check_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+TestSuite$(EXEEXT): $(TestSuite_OBJECTS) $(TestSuite_DEPENDENCIES) 
+	@rm -f TestSuite$(EXEEXT)
+	$(CXXLINK) $(TestSuite_LDFLAGS) $(TestSuite_OBJECTS) $(TestSuite_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BitwiseTests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EdgeBuilderTests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FileSystemArchiveTests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PixelFormatTests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RadixSort.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StringTests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ZipArchiveTests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+EdgeBuilderTests.o: ../OgreMain/src/EdgeBuilderTests.cpp
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT EdgeBuilderTests.o -MD -MP -MF "$(DEPDIR)/EdgeBuilderTests.Tpo" -c -o EdgeBuilderTests.o `test -f '../OgreMain/src/EdgeBuilderTests.cpp' || echo '$(srcdir)/'`../OgreMain/src/EdgeBuilderTests.cpp; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/EdgeBuilderTests.Tpo" "$(DEPDIR)/EdgeBuilderTests.Po"; else rm -f "$(DEPDIR)/EdgeBuilderTests.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../OgreMain/src/EdgeBuilderTests.cpp' object='EdgeBuilderTests.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o EdgeBuilderTests.o `test -f '../OgreMain/src/EdgeBuilderTests.cpp' || echo '$(srcdir)/'`../OgreMain/src/EdgeBuilderTests.cpp
+
+EdgeBuilderTests.obj: ../OgreMain/src/EdgeBuilderTests.cpp
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT EdgeBuilderTests.obj -MD -MP -MF "$(DEPDIR)/EdgeBuilderTests.Tpo" -c -o EdgeBuilderTests.obj `if test -f '../OgreMain/src/EdgeBuilderTests.cpp'; then $(CYGPATH_W) '../OgreMain/src/EdgeBuilderTests.cpp'; else $(CYGPATH_W) '$(srcdir)/../OgreMain/src/EdgeBuilderTests.cpp'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/EdgeBuilderTests.Tpo" "$(DEPDIR)/EdgeBuilderTests.Po"; else rm -f "$(DEPDIR)/EdgeBuilderTests.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../OgreMain/src/EdgeBuilderTests.cpp' object='EdgeBuilderTests.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o EdgeBuilderTests.obj `if test -f '../OgreMain/src/EdgeBuilderTests.cpp'; then $(CYGPATH_W) '../OgreMain/src/EdgeBuilderTests.cpp'; else $(CYGPATH_W) '$(srcdir)/../OgreMain/src/EdgeBuilderTests.cpp'; fi`
+
+FileSystemArchiveTests.o: ../OgreMain/src/FileSystemArchiveTests.cpp
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FileSystemArchiveTests.o -MD -MP -MF "$(DEPDIR)/FileSystemArchiveTests.Tpo" -c -o FileSystemArchiveTests.o `test -f '../OgreMain/src/FileSystemArchiveTests.cpp' || echo '$(srcdir)/'`../OgreMain/src/FileSystemArchiveTests.cpp; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/FileSystemArchiveTests.Tpo" "$(DEPDIR)/FileSystemArchiveTests.Po"; else rm -f "$(DEPDIR)/FileSystemArchiveTests.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../OgreMain/src/FileSystemArchiveTests.cpp' object='FileSystemArchiveTests.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FileSystemArchiveTests.o `test -f '../OgreMain/src/FileSystemArchiveTests.cpp' || echo '$(srcdir)/'`../OgreMain/src/FileSystemArchiveTests.cpp
+
+FileSystemArchiveTests.obj: ../OgreMain/src/FileSystemArchiveTests.cpp
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FileSystemArchiveTests.obj -MD -MP -MF "$(DEPDIR)/FileSystemArchiveTests.Tpo" -c -o FileSystemArchiveTests.obj `if test -f '../OgreMain/src/FileSystemArchiveTests.cpp'; then $(CYGPATH_W) '../OgreMain/src/FileSystemArchiveTests.cpp'; else $(CYGPATH_W) '$(srcdir)/../OgreMain/src/FileSystemArchiveTests.cpp'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/FileSystemArchiveTests.Tpo" "$(DEPDIR)/FileSystemArchiveTests.Po"; else rm -f "$(DEPDIR)/FileSystemArchiveTests.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../OgreMain/src/FileSystemArchiveTests.cpp' object='FileSystemArchiveTests.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FileSystemArchiveTests.obj `if test -f '../OgreMain/src/FileSystemArchiveTests.cpp'; then $(CYGPATH_W) '../OgreMain/src/FileSystemArchiveTests.cpp'; else $(CYGPATH_W) '$(srcdir)/../OgreMain/src/FileSystemArchiveTests.cpp'; fi`
+
+StringTests.o: ../OgreMain/src/StringTests.cpp
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT StringTests.o -MD -MP -MF "$(DEPDIR)/StringTests.Tpo" -c -o StringTests.o `test -f '../OgreMain/src/StringTests.cpp' || echo '$(srcdir)/'`../OgreMain/src/StringTests.cpp; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/StringTests.Tpo" "$(DEPDIR)/StringTests.Po"; else rm -f "$(DEPDIR)/StringTests.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../OgreMain/src/StringTests.cpp' object='StringTests.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o StringTests.o `test -f '../OgreMain/src/StringTests.cpp' || echo '$(srcdir)/'`../OgreMain/src/StringTests.cpp
+
+StringTests.obj: ../OgreMain/src/StringTests.cpp
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT StringTests.obj -MD -MP -MF "$(DEPDIR)/StringTests.Tpo" -c -o StringTests.obj `if test -f '../OgreMain/src/StringTests.cpp'; then $(CYGPATH_W) '../OgreMain/src/StringTests.cpp'; else $(CYGPATH_W) '$(srcdir)/../OgreMain/src/StringTests.cpp'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/StringTests.Tpo" "$(DEPDIR)/StringTests.Po"; else rm -f "$(DEPDIR)/StringTests.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../OgreMain/src/StringTests.cpp' object='StringTests.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o StringTests.obj `if test -f '../OgreMain/src/StringTests.cpp'; then $(CYGPATH_W) '../OgreMain/src/StringTests.cpp'; else $(CYGPATH_W) '$(srcdir)/../OgreMain/src/StringTests.cpp'; fi`
+
+ZipArchiveTests.o: ../OgreMain/src/ZipArchiveTests.cpp
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ZipArchiveTests.o -MD -MP -MF "$(DEPDIR)/ZipArchiveTests.Tpo" -c -o ZipArchiveTests.o `test -f '../OgreMain/src/ZipArchiveTests.cpp' || echo '$(srcdir)/'`../OgreMain/src/ZipArchiveTests.cpp; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/ZipArchiveTests.Tpo" "$(DEPDIR)/ZipArchiveTests.Po"; else rm -f "$(DEPDIR)/ZipArchiveTests.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../OgreMain/src/ZipArchiveTests.cpp' object='ZipArchiveTests.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ZipArchiveTests.o `test -f '../OgreMain/src/ZipArchiveTests.cpp' || echo '$(srcdir)/'`../OgreMain/src/ZipArchiveTests.cpp
+
+ZipArchiveTests.obj: ../OgreMain/src/ZipArchiveTests.cpp
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ZipArchiveTests.obj -MD -MP -MF "$(DEPDIR)/ZipArchiveTests.Tpo" -c -o ZipArchiveTests.obj `if test -f '../OgreMain/src/ZipArchiveTests.cpp'; then $(CYGPATH_W) '../OgreMain/src/ZipArchiveTests.cpp'; else $(CYGPATH_W) '$(srcdir)/../OgreMain/src/ZipArchiveTests.cpp'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/ZipArchiveTests.Tpo" "$(DEPDIR)/ZipArchiveTests.Po"; else rm -f "$(DEPDIR)/ZipArchiveTests.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../OgreMain/src/ZipArchiveTests.cpp' object='ZipArchiveTests.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ZipArchiveTests.obj `if test -f '../OgreMain/src/ZipArchiveTests.cpp'; then $(CYGPATH_W) '../OgreMain/src/ZipArchiveTests.cpp'; else $(CYGPATH_W) '$(srcdir)/../OgreMain/src/ZipArchiveTests.cpp'; fi`
+
+BitwiseTests.o: ../OgreMain/src/BitwiseTests.cpp
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT BitwiseTests.o -MD -MP -MF "$(DEPDIR)/BitwiseTests.Tpo" -c -o BitwiseTests.o `test -f '../OgreMain/src/BitwiseTests.cpp' || echo '$(srcdir)/'`../OgreMain/src/BitwiseTests.cpp; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/BitwiseTests.Tpo" "$(DEPDIR)/BitwiseTests.Po"; else rm -f "$(DEPDIR)/BitwiseTests.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../OgreMain/src/BitwiseTests.cpp' object='BitwiseTests.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o BitwiseTests.o `test -f '../OgreMain/src/BitwiseTests.cpp' || echo '$(srcdir)/'`../OgreMain/src/BitwiseTests.cpp
+
+BitwiseTests.obj: ../OgreMain/src/BitwiseTests.cpp
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT BitwiseTests.obj -MD -MP -MF "$(DEPDIR)/BitwiseTests.Tpo" -c -o BitwiseTests.obj `if test -f '../OgreMain/src/BitwiseTests.cpp'; then $(CYGPATH_W) '../OgreMain/src/BitwiseTests.cpp'; else $(CYGPATH_W) '$(srcdir)/../OgreMain/src/BitwiseTests.cpp'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/BitwiseTests.Tpo" "$(DEPDIR)/BitwiseTests.Po"; else rm -f "$(DEPDIR)/BitwiseTests.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../OgreMain/src/BitwiseTests.cpp' object='BitwiseTests.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o BitwiseTests.obj `if test -f '../OgreMain/src/BitwiseTests.cpp'; then $(CYGPATH_W) '../OgreMain/src/BitwiseTests.cpp'; else $(CYGPATH_W) '$(srcdir)/../OgreMain/src/BitwiseTests.cpp'; fi`
+
+PixelFormatTests.o: ../OgreMain/src/PixelFormatTests.cpp
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT PixelFormatTests.o -MD -MP -MF "$(DEPDIR)/PixelFormatTests.Tpo" -c -o PixelFormatTests.o `test -f '../OgreMain/src/PixelFormatTests.cpp' || echo '$(srcdir)/'`../OgreMain/src/PixelFormatTests.cpp; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/PixelFormatTests.Tpo" "$(DEPDIR)/PixelFormatTests.Po"; else rm -f "$(DEPDIR)/PixelFormatTests.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../OgreMain/src/PixelFormatTests.cpp' object='PixelFormatTests.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o PixelFormatTests.o `test -f '../OgreMain/src/PixelFormatTests.cpp' || echo '$(srcdir)/'`../OgreMain/src/PixelFormatTests.cpp
+
+PixelFormatTests.obj: ../OgreMain/src/PixelFormatTests.cpp
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT PixelFormatTests.obj -MD -MP -MF "$(DEPDIR)/PixelFormatTests.Tpo" -c -o PixelFormatTests.obj `if test -f '../OgreMain/src/PixelFormatTests.cpp'; then $(CYGPATH_W) '../OgreMain/src/PixelFormatTests.cpp'; else $(CYGPATH_W) '$(srcdir)/../OgreMain/src/PixelFormatTests.cpp'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/PixelFormatTests.Tpo" "$(DEPDIR)/PixelFormatTests.Po"; else rm -f "$(DEPDIR)/PixelFormatTests.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../OgreMain/src/PixelFormatTests.cpp' object='PixelFormatTests.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o PixelFormatTests.obj `if test -f '../OgreMain/src/PixelFormatTests.cpp'; then $(CYGPATH_W) '../OgreMain/src/PixelFormatTests.cpp'; else $(CYGPATH_W) '$(srcdir)/../OgreMain/src/PixelFormatTests.cpp'; fi`
+
+RadixSort.o: ../OgreMain/src/RadixSort.cpp
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RadixSort.o -MD -MP -MF "$(DEPDIR)/RadixSort.Tpo" -c -o RadixSort.o `test -f '../OgreMain/src/RadixSort.cpp' || echo '$(srcdir)/'`../OgreMain/src/RadixSort.cpp; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/RadixSort.Tpo" "$(DEPDIR)/RadixSort.Po"; else rm -f "$(DEPDIR)/RadixSort.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../OgreMain/src/RadixSort.cpp' object='RadixSort.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RadixSort.o `test -f '../OgreMain/src/RadixSort.cpp' || echo '$(srcdir)/'`../OgreMain/src/RadixSort.cpp
+
+RadixSort.obj: ../OgreMain/src/RadixSort.cpp
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RadixSort.obj -MD -MP -MF "$(DEPDIR)/RadixSort.Tpo" -c -o RadixSort.obj `if test -f '../OgreMain/src/RadixSort.cpp'; then $(CYGPATH_W) '../OgreMain/src/RadixSort.cpp'; else $(CYGPATH_W) '$(srcdir)/../OgreMain/src/RadixSort.cpp'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/RadixSort.Tpo" "$(DEPDIR)/RadixSort.Po"; else rm -f "$(DEPDIR)/RadixSort.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../OgreMain/src/RadixSort.cpp' object='RadixSort.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RadixSort.obj `if test -f '../OgreMain/src/RadixSort.cpp'; then $(CYGPATH_W) '../OgreMain/src/RadixSort.cpp'; else $(CYGPATH_W) '$(srcdir)/../OgreMain/src/RadixSort.cpp'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+	list='$(TESTS)'; \
+	if test -n "$$list"; then \
+	  for tst in $$list; do \
+	    if test -f ./$$tst; then dir=./; \
+	    elif test -f $$tst; then dir=; \
+	    else dir="$(srcdir)/"; fi; \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *" $$tst "*) \
+		xpass=`expr $$xpass + 1`; \
+		failed=`expr $$failed + 1`; \
+		echo "XPASS: $$tst"; \
+	      ;; \
+	      *) \
+		echo "PASS: $$tst"; \
+	      ;; \
+	      esac; \
+	    elif test $$? -ne 77; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *" $$tst "*) \
+		xfail=`expr $$xfail + 1`; \
+		echo "XFAIL: $$tst"; \
+	      ;; \
+	      *) \
+		failed=`expr $$failed + 1`; \
+		echo "FAIL: $$tst"; \
+	      ;; \
+	      esac; \
+	    else \
+	      skip=`expr $$skip + 1`; \
+	      echo "SKIP: $$tst"; \
+	    fi; \
+	  done; \
+	  if test "$$failed" -eq 0; then \
+	    if test "$$xfail" -eq 0; then \
+	      banner="All $$all tests passed"; \
+	    else \
+	      banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+	    fi; \
+	  else \
+	    if test "$$xpass" -eq 0; then \
+	      banner="$$failed of $$all tests failed"; \
+	    else \
+	      banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+	    fi; \
+	  fi; \
+	  dashes="$$banner"; \
+	  skipped=""; \
+	  if test "$$skip" -ne 0; then \
+	    skipped="($$skip tests were not run)"; \
+	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$skipped"; \
+	  fi; \
+	  report=""; \
+	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+	    report="Please report to $(PACKAGE_BUGREPORT)"; \
+	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$report"; \
+	  fi; \
+	  dashes=`echo "$$dashes" | sed s/./=/g`; \
+	  echo "$$dashes"; \
+	  echo "$$banner"; \
+	  test -z "$$skipped" || echo "$$skipped"; \
+	  test -z "$$report" || echo "$$report"; \
+	  echo "$$dashes"; \
+	  test "$$failed" -eq 0; \
+	else :; fi
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
+	clean-checkPROGRAMS clean-generic clean-libtool ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: /Tests/src/main.cpp
===================================================================
--- /Tests/src/main.cpp	(revision 5)
+++ /Tests/src/main.cpp	(revision 5)
@@ -0,0 +1,50 @@
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+#include "OgreException.h"
+#include "OgreLogManager.h"
+#include "OgreMaterialManager.h"
+#include "OgreCompositorManager.h"
+#include "OgreHighLevelGpuProgramManager.h"
+#include "OgreGpuProgramManager.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+int main( int argc, char **argv)
+{
+    std::auto_ptr<Ogre::LogManager> logMgr(new Ogre::LogManager());
+    logMgr->createLog("OgreTest.log", true, true);
+
+    bool wasSuccessful = false;
+    try {
+        CppUnit::TextUi::TestRunner runner;
+        CppUnit::TestFactoryRegistry &registry = CppUnit::TestFactoryRegistry::getRegistry();
+        runner.addTest( registry.makeTest() );
+        wasSuccessful = runner.run( "", false );
+    }
+    catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+    catch( ... ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, "Unknown exception", "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+    // shutdown and release managers that might have been created
+    delete Ogre::HighLevelGpuProgramManager::getSingletonPtr();
+    delete Ogre::GpuProgramManager::getSingletonPtr();
+    delete Ogre::CompositorManager::getSingletonPtr();
+    delete Ogre::MaterialManager::getSingletonPtr();
+    delete Ogre::ResourceGroupManager::getSingletonPtr();
+
+    return wasSuccessful ? 0 : 1;
+}
Index: /acinclude.m4
===================================================================
--- /acinclude.m4	(revision 5)
+++ /acinclude.m4	(revision 5)
@@ -0,0 +1,611 @@
+# Configure paths for FreeType2
+# Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
+
+dnl AC_CHECK_FT2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for FreeType2, and define FT2_CFLAGS and FT2_LIBS
+dnl
+AC_DEFUN([AC_CHECK_FT2],
+[dnl
+dnl Get the cflags and libraries from the freetype-config script
+dnl
+AC_ARG_WITH(ft-prefix,
+[  --with-ft-prefix=PREFIX
+                          Prefix where FreeType is installed (optional)],
+            ft_config_prefix="$withval", ft_config_prefix="")
+AC_ARG_WITH(ft-exec-prefix,
+[  --with-ft-exec-prefix=PREFIX
+                          Exec prefix where FreeType is installed (optional)],
+            ft_config_exec_prefix="$withval", ft_config_exec_prefix="")
+AC_ARG_ENABLE(freetypetest,
+[  --disable-freetypetest  Do not try to compile and run
+                          a test FreeType program],
+              [], enable_fttest=yes)
+
+if test x$ft_config_exec_prefix != x ; then
+  ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
+  if test x${FT2_CONFIG+set} != xset ; then
+    FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
+  fi
+fi
+if test x$ft_config_prefix != x ; then
+  ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
+  if test x${FT2_CONFIG+set} != xset ; then
+    FT2_CONFIG=$ft_config_prefix/bin/freetype-config
+  fi
+fi
+AC_PATH_PROG(FT2_CONFIG, freetype-config, no)
+
+min_ft_version=ifelse([$1], ,9.1.0,$1)
+AC_MSG_CHECKING(for FreeType - version >= $min_ft_version)
+no_ft=""
+if test "$FT2_CONFIG" = "no" ; then
+  no_ft=yes
+else
+  FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
+  FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
+  ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
+         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+  ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
+         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+  ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
+         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+  ft_min_major_version=`echo $min_ft_version | \
+         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+  ft_min_minor_version=`echo $min_ft_version | \
+         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+  ft_min_micro_version=`echo $min_ft_version | \
+         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+  if test x$enable_fttest = xyes ; then
+    ft_config_is_lt=""
+    if test $ft_config_major_version -lt $ft_min_major_version ; then
+      ft_config_is_lt=yes
+    else
+      if test $ft_config_major_version -eq $ft_min_major_version ; then
+        if test $ft_config_minor_version -lt $ft_min_minor_version ; then
+          ft_config_is_lt=yes
+        else
+          if test $ft_config_minor_version -eq $ft_min_minor_version ; then
+            if test $ft_config_micro_version -lt $ft_min_micro_version ; then
+              ft_config_is_lt=yes
+            fi
+          fi
+        fi
+      fi
+    fi
+    if test x$ft_config_is_lt = xyes ; then
+      no_ft=yes
+    else
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $FT2_CFLAGS"
+      LIBS="$FT2_LIBS $LIBS"
+dnl
+dnl Sanity checks for the results of freetype-config to some extent
+dnl
+      AC_TRY_RUN([
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main()
+{
+  FT_Library library;
+  FT_Error error;
+
+  error = FT_Init_FreeType(&library);
+
+  if (error)
+    return 1;
+  else
+  {
+    FT_Done_FreeType(library);
+    return 0;
+  }
+}
+],, no_ft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+      CFLAGS="$ac_save_CFLAGS"
+      LIBS="$ac_save_LIBS"
+    fi             # test $ft_config_version -lt $ft_min_version
+  fi               # test x$enable_fttest = xyes
+fi                 # test "$FT2_CONFIG" = "no"
+if test x$no_ft = x ; then
+   AC_MSG_RESULT(yes)
+   ifelse([$2], , :, [$2])
+else
+   AC_MSG_RESULT(no)
+   if test "$FT2_CONFIG" = "no" ; then
+     echo "*** The freetype-config script installed by FreeType 2 could not be found."
+     echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in"
+     echo "*** your path, or set the FT2_CONFIG environment variable to the"
+     echo "*** full path to freetype-config."
+   else
+     if test x$ft_config_is_lt = xyes ; then
+       echo "*** Your installed version of the FreeType 2 library is too old."
+       echo "*** If you have different versions of FreeType 2, make sure that"
+       echo "*** correct values for --with-ft-prefix or --with-ft-exec-prefix"
+       echo "*** are used, or set the FT2_CONFIG environment variable to the"
+       echo "*** full path to freetype-config."
+     else
+       echo "*** The FreeType test program failed to run.  If your system uses"
+       echo "*** shared libraries and they are installed outside the normal"
+       echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
+       echo "*** (or whatever is appropiate for your system) is correctly set."
+     fi
+   fi
+   FT2_CFLAGS=""
+   FT2_LIBS=""
+   ifelse([$3], , :, [$3])
+fi
+AC_SUBST(FT2_CFLAGS)
+AC_SUBST(FT2_LIBS)
+])
+
+AC_DEFUN([OGRE_USE_STLPORT],
+[AC_ARG_WITH(stlport, 
+             AC_HELP_STRING([--with-stlport=PATH],
+                           [the path to STLPort.]),
+             ac_cv_use_stlport=$withval,
+             ac_cv_use_stlport=no)
+ AC_CACHE_CHECK([whether to use STLPort], ac_cv_use_stlport,
+                ac_cv_use_stlport=no)
+ if test x$ac_cv_use_stlport != xno; then
+     STLPORT_CFLAGS="-I$ac_cv_use_stlport/stlport"
+     STLPORT_LIBS="-L$ac_cv_use_stlport/lib -lstlport"
+ fi
+ AC_SUBST(STLPORT_CFLAGS)
+ AC_SUBST(STLPORT_LIBS)
+])
+
+AC_DEFUN([OGRE_GET_PLATFORM],
+[OGRE_PLATFORM=GLX
+ AC_ARG_WITH(platform, 
+             AC_HELP_STRING([--with-platform=PLATFORM],
+                            [the platform to build, currently GLX or Win32]),
+             OGRE_PLATFORM=$withval,
+             OGRE_PLATFORM=GLX)
+
+  PLATFORM_CFLAGS=""
+  PLATFORM_LIBS=""
+
+  dnl Do the extra checks per type here
+  case $OGRE_PLATFORM in 
+    GLX)
+      AC_CHECK_HEADERS([X11/Intrinsic.h],, [AC_MSG_ERROR("libxt headers not found")])
+      AC_CHECK_HEADERS([X11/Xaw/Command.h],, [AC_MSG_ERROR("libxaw headers not found")])
+      AC_CHECK_HEADERS([X11/extensions/xf86vmode.h],, [AC_MSG_ERROR("libxf86vm headers not found")],[#include <X11/Xlib.h>])
+      AC_CHECK_HEADERS([X11/extensions/Xrandr.h],, [AC_MSG_ERROR("libxrandr headers not found")],[#include <X11/Xlib.h>])
+      AC_PATH_X
+      if test x"$x_includes" != x; then
+        if test x"$x_includes" != xNONE; then
+          PLATFORM_CFLAGS="-I$x_includes"
+        fi
+      fi
+      if test x"$x_libraries" != x; then
+        if test x"$x_libraries" != xNONE; then
+          PLATFORM_LIBS="-L$x_libraries -lX11 -lXaw"
+        fi
+      dnl In case of xorg 7.x, $x_libraries is empty
+      else
+        PLATFORM_LIBS="-lX11 -lXaw"
+      fi
+    ;;
+    Win32)
+      PLATFORM_CFLAGS=""
+      PLATFORM_LIBS="-lgdi32 -lwinmm -ldinput8 -ldxguid"
+    ;;
+  esac
+
+  AC_SUBST(PLATFORM_CFLAGS)
+  AC_SUBST(PLATFORM_LIBS)
+  AC_SUBST(OGRE_PLATFORM)
+])
+
+AC_DEFUN([OGRE_GET_GLSUPPORT],
+[OGRE_GLSUPPORT=none
+ AC_ARG_WITH(gl-support, 
+             AC_HELP_STRING([--with-gl-support=PLATFORM],
+                            [ The GLsupport to build (GLX or Win32). Defaults to the platform. Only set this if you know what you are doing. Use --with-platform otherwise.]),
+             OGRE_GLSUPPORT=$withval,
+             OGRE_GLSUPPORT=none)
+
+  if test "$OGRE_GLSUPPORT" = "none" ; then
+    OGRE_GLSUPPORT="$OGRE_PLATFORM"
+    AC_MSG_NOTICE([setting gl-support to platform: $OGRE_GLSUPPORT])
+  fi
+  if test "$OGRE_GLSUPPORT" = "Win32" ; then
+    # Uppercase/lowercase
+    OGRE_GLSUPPORT=win32
+  fi
+
+  GLSUPPORT_CFLAGS=""
+  GLSUPPORT_LIBS=""
+
+  dnl Do the extra checks per type here
+  case $OGRE_GLSUPPORT in 
+    GLX)
+        AC_PATH_X
+        if test x"$x_includes" != x; then
+          if test x"$x_includes" != xNONE; then
+            GLSUPPORT_CFLAGS="-I$x_includes"
+          fi
+        fi
+        if test x"$x_libraries" != x; then
+          if test x"$x_libraries" != xNONE; then
+            GLSUPPORT_LIBS="-L$x_libraries -lX11 -lXext -lGL -lXrandr -lXxf86vm"
+          fi
+        dnl In case of xorg 7.x $x_libraries might be empty
+        else
+          GLSUPPORT_LIBS="-lX11 -lXext -lGL -lXrandr -lXxf86vm"
+        fi
+    ;;
+    win32)
+	GLSUPPORT_CFLAGS=""
+	GLSUPPORT_LIBS="-lgdi32 -lwinmm"
+    ;;
+  esac
+
+  AC_SUBST(GLSUPPORT_CFLAGS)
+  AC_SUBST(GLSUPPORT_LIBS)
+  AC_SUBST(OGRE_GLSUPPORT)
+  AC_CONFIG_FILES([RenderSystems/GL/src/GLX/Makefile
+                   RenderSystems/GL/src/win32/Makefile])
+])
+
+AC_DEFUN([OGRE_SETUP_FOR_TARGET],
+[case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+	AC_SUBST(SHARED_FLAGS, "-shared -no-undefined -Xlinker --export-all-symbols")
+	AC_SUBST(PLUGIN_FLAGS, "-shared -no-undefined -avoid-version")
+	AC_SUBST(GL_LIBS, "-lopengl32 -lglu32")	
+	AC_CHECK_TOOL(RC, windres)
+        nt=true
+;;
+*-*-darwin*)
+        AC_SUBST(SHARED_FLAGS, "-shared")
+        AC_SUBST(PLUGIN_FLAGS, "-shared -avoid-version")
+        AC_SUBST(GL_LIBS, "-lGL -lGLU")
+        osx=true
+;;
+ *) dnl default to standard linux
+	AC_SUBST(SHARED_FLAGS, "-shared")
+	AC_SUBST(PLUGIN_FLAGS, "-shared -avoid-version")
+	AC_SUBST(GL_LIBS, "-lGL -lGLU")
+        linux=true
+;;
+esac
+dnl you must arrange for every AM_conditional to run every time configure runs
+AM_CONDITIONAL(OGRE_NT, test x$nt = xtrue)
+AM_CONDITIONAL(OGRE_LINUX, test x$linux = xtrue)
+AM_CONDITIONAL(OGRE_OSX,test x$osx = xtrue )
+])
+
+
+AC_DEFUN([OGRE_DETECT_ENDIAN],
+[AC_TRY_RUN([
+		int main()
+		{
+			short s = 1;
+			short* ptr = &s;
+			unsigned char c = *((char*)ptr);
+			return c;
+		}
+	]
+	,[AC_DEFINE(OGRE_CONFIG_BIG_ENDIAN,,[Big endian machine])
+          OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_CONFIG_BIG_ENDIAN"]
+	,[AC_DEFINE(OGRE_CONFIG_LITTLE_ENDIAN,,[Little endian machine])
+          OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_CONFIG_LITTLE_ENDIAN"])
+])
+
+AC_DEFUN([OGRE_CHECK_OPENEXR],
+[AC_ARG_ENABLE(openexr,
+              AC_HELP_STRING([--enable-openexr],
+                             [Build the OpenEXR plugin]),
+              [build_exr=$enableval],
+              [build_exr=no])
+
+if test "x$build_exr" = "xyes" ; then
+	PKG_CHECK_MODULES(OPENEXR, OpenEXR, [build_exr=yes], [build_exr=no])
+
+	if test "x$build_exr" = "xyes" ; then
+	   	AC_CONFIG_FILES([ PlugIns/EXRCodec/Makefile \
+    					 PlugIns/EXRCodec/src/Makefile \
+    					 PlugIns/EXRCodec/include/Makefile])
+		AC_SUBST(OPENEXR_CFLAGS)
+		AC_SUBST(OPENEXR_LIBS)
+
+	fi
+
+fi
+
+AM_CONDITIONAL(BUILD_EXRPLUGIN, test x$build_exr = xyes)
+
+])
+
+AC_DEFUN([OGRE_CHECK_CG],
+[AC_ARG_ENABLE(cg,
+              AC_HELP_STRING([--disable-cg],
+                             [Do not build the Cg plugin (recommended you do so!)]),
+              [build_cg=$enableval],
+              [build_cg=yes])
+
+if test "x$build_cg" = "xyes" ; then
+	AC_CHECK_LIB(Cg, cgCreateProgram,,AC_MSG_ERROR([
+	****************************************************************
+	* You do not have the nVidia Cg libraries installed.           *
+	* Go to http://developer.nvidia.com/object/cg_toolkit.html     *
+	* (Click on Cg_Linux.tar.gz).                                  *
+	* You can disable the building of Cg support by providing      *	
+	* --disable-cg to this configure script but this is highly     *
+	* discouraged as this breaks many of the examples.             *
+	****************************************************************])
+	)
+fi
+
+AM_CONDITIONAL(BUILD_CGPLUGIN, test x$build_cg = xyes)
+
+])
+
+AC_DEFUN([OGRE_CHECK_CPPUNIT],
+[
+AM_PATH_CPPUNIT([1.10.0], [build_unit_tests=true])
+AM_CONDITIONAL([BUILD_UNIT_TESTS], [test x$build_unit_tests = xtrue])
+])
+
+
+AC_DEFUN([OGRE_CHECK_DX9],
+[AC_ARG_ENABLE(direct3d,
+              AC_HELP_STRING([--enable-direct3d],
+                             [Build the DirectX 9 Render System]),
+              [build_dx9=$enableval],
+              [build_dx9=no])
+
+AM_CONDITIONAL(BUILD_DX9RENDERSYSTEM, test x$build_dx9 = xyes)
+
+])
+
+
+AC_DEFUN([OGRE_CHECK_FREEIMAGE],
+[AC_ARG_ENABLE(freeimage,
+              AC_HELP_STRING([--disable-freeimage],
+                             [Don't use FreeImage for image loading. This is not recommended unless you provide your own image loading codecs.]),
+              [build_freeimage=$enableval],
+              [build_freeimage=yes])
+
+
+AM_CONDITIONAL(USE_FREEIMAGE, test x$build_freeimage = xyes)
+
+if test "x$build_freeimage" = "xyes" ; then
+	AC_CHECK_LIB(freeimage, FreeImage_Load,,AC_MSG_ERROR([
+****************************************************************
+* You do not have FreeImage installed.  This is required.      *
+* You may find it at http://freeimage.sourceforge.net/.        *
+* Note: You can also provide --disable-freeimage to the build  *
+* process to build without it. This is an advanced option      *
+* useful only if you provide your own image loading codecs.    *
+****************************************************************]), -lstdc++)
+	AC_DEFINE([OGRE_NO_FREEIMAGE], [0], [Do not use freeimage to load images])
+else
+	AC_DEFINE([OGRE_NO_FREEIMAGE], [1], [Load images using the freeimage library])
+	OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_NO_FREEIMAGE"
+fi
+
+
+])
+
+
+AC_DEFUN([OGRE_CHECK_DEVIL],
+[AC_ARG_ENABLE(devil,
+              AC_HELP_STRING([--disable-devil],
+                             [Don't use DevIL for image loading. This is not recommended unless you provide your own image loading codecs.]),
+              [build_il=$enableval],
+              [build_il=yes])
+
+AM_CONDITIONAL(USE_DEVIL, test x$build_il = xyes && test x$build_freeimage = xno)
+
+if test "x$build_freeimage" = "xyes"; then
+    AC_MSG_NOTICE([Freeimage is being built, disabling check for DevIL.])
+    [build_il=no]
+	AC_DEFINE([OGRE_NO_DEVIL], [1], [Build devil])
+else
+if test "x$build_il" = "xyes"; then
+	AC_CHECK_LIB(IL, ilInit,,AC_MSG_ERROR([
+****************************************************************
+* You do not have DevIL installed.  This is required to build. *
+* You may find it at http://openil.sourceforge.net/.           *
+* Note: You can also provide --disable-devil to the build      *
+* process to build without DevIL. This is an advanced option   *
+* useful only if you provide your own image loading codecs.    *
+****************************************************************]))
+	AC_CHECK_LIB(ILU, iluFlipImage)
+	AC_DEFINE([OGRE_NO_DEVIL], [0], [Build devil])
+else
+	AC_DEFINE([OGRE_NO_DEVIL], [1], [Build devil])
+fi
+fi
+
+])
+
+
+
+AC_DEFUN([OGRE_CHECK_PIC],
+[
+AC_MSG_CHECKING([whether -fPIC is needed])
+    case $host in
+        x86_64-*)
+            CXXFLAGS="$CXXFLAGS -fPIC"
+            AC_MSG_RESULT(yes)
+        ;;
+        *)
+            AC_MSG_RESULT(no)
+        ;;
+    esac
+])
+
+AC_DEFUN([OGRE_CHECK_CEGUI], [
+    PKG_CHECK_MODULES(CEGUI, CEGUI >= 0.5.0, 
+            [build_cegui_sample=true], [build_cegui_sample=false])
+    if test x$build_cegui_sample = xtrue; then
+        AC_CONFIG_FILES([Samples/Common/CEGUIRenderer/Makefile \
+                         Samples/Common/CEGUIRenderer/CEGUI-OGRE.pc
+                         Samples/Common/CEGUIRenderer/src/Makefile \
+                         Samples/Common/CEGUIRenderer/include/Makefile \
+                         Samples/Gui/Makefile \
+                         Samples/Gui/src/Makefile])
+        AC_SUBST(CEGUI_CFLAGS)
+        AC_SUBST(CEGUI_LIBS)
+        AC_MSG_RESULT([CEGUI available, Gui and FacialAnimation samples will be built])
+    else
+        AC_MSG_RESULT([CEGUI not available, Gui and FacialAnimation samples will not be built])
+    fi
+    AM_CONDITIONAL([HAVE_CEGUI], [test x$build_cegui_sample = xtrue])
+])
+
+AC_DEFUN([OGRE_CHECK_DOUBLE],
+[
+AC_ARG_ENABLE(double,
+              AC_HELP_STRING([--enable-double],
+                             [Build OGRE in double floating point precision mode. This is not recommended for normal use as it is slower.]),
+              [build_double=$enableval],
+              [build_double=no])
+AC_MSG_CHECKING([whether to use double floating point precision])
+	case $build_double in
+        yes)
+			AC_DEFINE([OGRE_DOUBLE_PRECISION], [1], [Build with double precision])
+			OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_DOUBLE_PRECISION"
+			AC_MSG_RESULT(yes)
+        ;;
+        *)
+			AC_DEFINE([OGRE_DOUBLE_PRECISION], [0], [Build with single precision])
+			AC_MSG_RESULT(no)
+        ;;
+    esac
+])
+
+AC_DEFUN([OGRE_CHECK_THREADING],
+[
+AC_ARG_ENABLE(threading,
+              AC_HELP_STRING([--enable-threading],
+                             [Indicate general support for multithreading. This will enable threading support in certain parts of the engine, mainly resource loading and SharedPtr handling. WARNING: highly experimental, use with caution.]),
+              [build_threads=$enableval],
+              [build_threads=no])
+    case $build_threads in
+        yes)
+            AC_DEFINE([OGRE_THREAD_SUPPORT], [1], [Build with thread support])
+            OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_THREAD_SUPPORT"
+            # Check for the C++ Boost library
+            AC_CHECK_LIB(boost_thread, main, OGRE_THREAD_LIBS="-lboost_thread", [
+                AC_CHECK_LIB(boost_thread-mt, main, OGRE_THREAD_LIBS="-lboost_thread-mt", [
+                    AC_MSG_ERROR([You need the C++ boost libraries.])])])
+        ;;
+        *)
+            AC_DEFINE([OGRE_THREAD_SUPPORT], [0], [Build with thread support])
+            OGRE_THREAD_LIBS=""
+            AC_MSG_RESULT(no)
+        ;;
+    esac
+    AC_SUBST(OGRE_THREAD_LIBS)
+])
+
+AC_DEFUN([OGRE_BUILD_DEMOS], [
+    AC_ARG_ENABLE(ogre_demos,
+        AC_HELP_STRING([--disable-ogre-demos], 
+            [Do not build Ogre demos (CEGUI Renderer - if enabled/disabled, is not affected by this]),
+            [build_ogre_demos=$enableval], [build_ogre_demos=yes])
+
+    if test "x$build_ogre_demos" = "xyes" ; then
+        PKG_CHECK_MODULES(OIS, OIS >= 1.0.0, [ois_found=yes],[ois_found=no])
+        AC_SUBST(OIS_CFLAGS)
+        AC_SUBST(OIS_LIBS)
+
+        if test "x$ois_found" = "xyes" ; then
+           AC_MSG_NOTICE([*** Ogre Demos will be built ***])
+        else
+          build_ogre_demos=no
+          AC_MSG_NOTICE([
+****************************************************************
+* You do not have OIS installed.  This is required to build    *
+* Ogre demos. You may find it at:                              *
+* http://www.sourceforge.net/projects/wgois.                   *
+* If you do not want to build the demos, you can safely ignore *
+* this.                                                        *
+****************************************************************])
+        fi
+    else
+        build_ogre_demos=no
+        AC_MSG_NOTICE([*** Building of Ogre demos disabled ***])
+    fi
+
+    AM_CONDITIONAL([OGRE_BUILDING_DEMOS], [test x$build_ogre_demos = xyes])
+])
+
+dnl GUI selection support for configuration/error dialogs
+AC_DEFUN([OGRE_CHECK_GUI],
+[
+    AC_ARG_WITH([gui],
+        AC_HELP_STRING([--with-gui=type], [Select the GUI type to use for dialogs (win32, gtk, Xt) (default: auto)]),
+        [with_gui=${withval}], [with_gui=auto])
+
+    #remove any old files
+    rm -f OgreMain/src/OgreConfigDialog.lo OgreMain/src/OgreErrorDialog.lo
+
+    # Prefer win32, then gtk, then Xt
+    if test "x$with_gui" == "xauto" && test "x$OGRE_PLATFORM" == "xWIN32"; then
+        with_gui=win32
+    fi
+
+    if test "x$with_gui" == "xauto" || test "x$with_gui" == "xgtk"; then
+        PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.0.0, [with_gui=gtk], [
+            if test "x$with_gui" == "xgtk"; then
+                AC_MSG_ERROR([You chose gtk for the GUI but gtk is not available.])
+            fi
+        ])
+    fi
+
+    if test "x$with_gui" == "xauto"; then
+        with_gui=Xt
+    fi
+
+    if test "x$with_gui" == "xwin32"; then
+        OGRE_GUI=WIN32
+    elif test "x$with_gui" == "xgtk"; then
+        OGRE_GUI=gtk
+    elif test "x$with_gui" == "xXt"; then
+        OGRE_GUI=GLX
+        PLATFORM_LIBS="$PLATFORM_LIBS -lXt -lSM -lICE"
+    else
+        AC_MSG_ERROR([The GUI dialogs for $with_gui are not available.])
+    fi
+
+    # Add the OGRE_GUI_xxx flag to compiler command line
+    PLATFORM_CFLAGS="$PLATFORM_CFLAGS -DOGRE_GUI_$OGRE_GUI"
+    # And export it to client applications as well
+    OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_GUI_$OGRE_GUI"
+
+    AC_SUBST(OGRE_GUI)
+    AC_SUBST(GTK_CFLAGS)
+    AC_SUBST(GTK_LIBS)
+])
+
+dnl Check whether Ogre platform and GUI to be built are the same
+dnl Fixes problem with running make distclean
+AC_DEFUN([OGRE_PLATFORM_AND_GUI],
+[AM_CONDITIONAL(SAME_PLATFORM_AND_GUI, test "x$OGRE_PLATFORM" = "x$OGRE_GUI")
+])
+
+dnl SSE support 
+AC_DEFUN([OGRE_CHECK_SSE],
+[
+AC_MSG_CHECKING(whether to use SSE)
+case $target_cpu in
+	i386 | i486 | i586 | i686 | x86_64 | amd64)
+		build_sse=yes
+	;;
+	*)
+		build_sse=no
+	;;
+esac
+AC_MSG_RESULT($build_sse)
+AM_CONDITIONAL(OGRE_BUILD_SSE, test x$build_sse = xyes)
+])
Index: /aclocal.m4
===================================================================
--- /aclocal.m4	(revision 5)
+++ /aclocal.m4	(revision 5)
@@ -0,0 +1,7222 @@
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005  Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+
+# serial 47 AC_PROG_LIBTOOL
+
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If this macro is not defined by Autoconf, define it here.
+m4_ifdef([AC_PROVIDE_IFELSE],
+         [],
+         [m4_define([AC_PROVIDE_IFELSE],
+	         [m4_ifdef([AC_PROVIDE_$1],
+		           [$2], [$3])])])
+
+
+# AC_PROG_LIBTOOL
+# ---------------
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+  AC_PROVIDE_IFELSE([AC_PROG_CXX],
+    [AC_LIBTOOL_CXX],
+    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+  ])])
+dnl And a similar setup for Fortran 77 support
+  AC_PROVIDE_IFELSE([AC_PROG_F77],
+    [AC_LIBTOOL_F77],
+    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+    [AC_LIBTOOL_GCJ],
+    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+      [AC_LIBTOOL_GCJ],
+      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+	[AC_LIBTOOL_GCJ],
+      [ifdef([AC_PROG_GCJ],
+	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([A][M_PROG_GCJ],
+	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([LT_AC_PROG_GCJ],
+	     [define([LT_AC_PROG_GCJ],
+		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])# AC_PROG_LIBTOOL
+
+
+# _AC_PROG_LIBTOOL
+# ----------------
+AC_DEFUN([_AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])# _AC_PROG_LIBTOOL
+
+
+# AC_LIBTOOL_SETUP
+# ----------------
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.50)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
+
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_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.
+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']
+
+# 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 avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    AC_PATH_MAGIC
+  fi
+  ;;
+esac
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE([libtool-lock],
+    [AC_HELP_STRING([--disable-libtool-lock],
+	[avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+AC_ARG_WITH([pic],
+    [AC_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=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])# AC_LIBTOOL_SETUP
+
+
+# _LT_AC_SYS_COMPILER
+# -------------------
+AC_DEFUN([_LT_AC_SYS_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_AC_SYS_COMPILER
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+AC_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_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+AC_DEFUN([_LT_COMPILER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/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.
+AC_DEFUN([_LT_LINKER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_LINKER_BOILERPLATE
+
+
+# _LT_AC_SYS_LIBPATH_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.
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_AC_SYS_LIBPATH_AIX
+
+
+# _LT_AC_SHELL_INIT(ARG)
+# ----------------------
+AC_DEFUN([_LT_AC_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+	 [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_AC_SHELL_INIT
+
+
+# _LT_AC_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.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
+
+echo=${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 <<EOF
+[$]*
+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 "$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 &&
+       echo_test_string=`eval $cmd` &&
+       (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.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])])# _LT_AC_PROG_ECHO_BACKSLASH
+
+
+# _LT_AC_LOCK
+# -----------
+AC_DEFUN([_LT_AC_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+    [AC_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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|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-*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-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          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_TRY_LINK([],[],[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
+  ;;
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+  ])
+esac
+
+need_locks="$enable_libtool_lock"
+
+])# _LT_AC_LOCK
+
+
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
+[AC_REQUIRE([LT_AC_PROG_SED])
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   printf "$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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$5], , :, [$5])
+else
+    ifelse([$6], , :, [$6])
+fi
+])# AC_LIBTOOL_COMPILER_OPTION
+
+
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                          [ACTION-SUCCESS], [ACTION-FAILURE])
+# ------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   printf "$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 > conftest.exp
+       $SED '/^$/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$4], , :, [$4])
+else
+    ifelse([$5], , :, [$5])
+fi
+])# AC_LIBTOOL_LINKER_OPTION
+
+
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
+# --------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
+[# 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*)
+    # 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;
+    ;;
+
+  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`
+    ;;
+  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
+    ;;
+  *)
+    # 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.
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+	       = "XX$teststring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
+	    lt_cv_sys_max_cmd_len=$new_result &&
+	    test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    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`
+    ;;
+  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
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
+
+
+# _LT_AC_CHECK_DLFCN
+# --------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)dnl
+])# _LT_AC_CHECK_DLFCN
+
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_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 <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}]
+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_unknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
+
+
+# AC_LIBTOOL_DLOPEN_SELF
+# -------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_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*)
+    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="-dld"],
+	[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="-dld"])
+	      ])
+	    ])
+	  ])
+	])
+      ])
+    ;;
+  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"
+    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_AC_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
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+    	  lt_cv_dlopen_self_static, [dnl
+	  _LT_AC_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
+])# AC_LIBTOOL_DLOPEN_SELF
+
+
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
+# ---------------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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 > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_AC_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 ..
+   rmdir conftest
+   $rm conftest*
+])
+])# AC_LIBTOOL_PROG_CC_C_O
+
+
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
+# -----------------------------------------
+# Check to see if we can do hard links to lock some files if needed
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
+[AC_REQUIRE([_LT_AC_LOCK])dnl
+
+hard_links="nottested"
+if test "$_LT_AC_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
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
+
+
+# AC_LIBTOOL_OBJDIR
+# -----------------
+AC_DEFUN([AC_LIBTOOL_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
+])# AC_LIBTOOL_OBJDIR
+
+
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
+# ----------------------------------------------
+# Check hardcoding attributes.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
+   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$_LT_AC_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_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_AC_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; 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
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+
+
+# AC_LIBTOOL_SYS_LIB_STRIP
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
+[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"
+         AC_MSG_RESULT([yes])
+       else
+  AC_MSG_RESULT([no])
+fi
+       ;;
+   *)
+  AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+])# AC_LIBTOOL_SYS_LIB_STRIP
+
+
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+[AC_MSG_CHECKING([dynamic linker characteristics])
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;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'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+
+
+# _LT_AC_TAGCONFIG
+# ----------------
+AC_DEFUN([_LT_AC_TAGCONFIG],
+[AC_ARG_WITH([tags],
+    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+        [include additional configurations @<:@automatic@:>@])],
+    [tagnames="$withval"])
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    AC_MSG_WARN([output file `$ofile' does not exist])
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
+    else
+      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+    fi
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+    "") ;;
+    *)  AC_MSG_ERROR([invalid tag name: $tagname])
+	;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      AC_MSG_ERROR([tag name \"$tagname\" already exists])
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      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_LIBTOOL_LANG_CXX_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      F77)
+	if test -n "$F77" && test "X$F77" != "Xno"; then
+	  AC_LIBTOOL_LANG_F77_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      GCJ)
+	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+	  AC_LIBTOOL_LANG_GCJ_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      RC)
+	AC_LIBTOOL_LANG_RC_CONFIG
+	;;
+
+      *)
+	AC_MSG_ERROR([Unsupported tag name: $tagname])
+	;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    AC_MSG_ERROR([unable to update list of available tagged configurations.])
+  fi
+fi
+])# _LT_AC_TAGCONFIG
+
+
+# AC_LIBTOOL_DLOPEN
+# -----------------
+# enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_DLOPEN
+
+
+# AC_LIBTOOL_WIN32_DLL
+# --------------------
+# declare package support for building win32 DLLs
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_WIN32_DLL
+
+
+# AC_ENABLE_SHARED([DEFAULT])
+# ---------------------------
+# implement the --enable-shared flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([shared],
+    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+	[build shared libraries @<:@default=]AC_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=]AC_ENABLE_SHARED_DEFAULT)
+])# AC_ENABLE_SHARED
+
+
+# AC_DISABLE_SHARED
+# -----------------
+#- set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])# AC_DISABLE_SHARED
+
+
+# AC_ENABLE_STATIC([DEFAULT])
+# ---------------------------
+# implement the --enable-static flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([static],
+    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+	[build static libraries @<:@default=]AC_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=]AC_ENABLE_STATIC_DEFAULT)
+])# AC_ENABLE_STATIC
+
+
+# AC_DISABLE_STATIC
+# -----------------
+# set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])# AC_DISABLE_STATIC
+
+
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
+# ---------------------------------
+# implement the --enable-fast-install flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([fast-install],
+    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]AC_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=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])# AC_ENABLE_FAST_INSTALL
+
+
+# AC_DISABLE_FAST_INSTALL
+# -----------------------
+# set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)
+])# AC_DISABLE_FAST_INSTALL
+
+
+# AC_LIBTOOL_PICMODE([MODE])
+# --------------------------
+# implement the --with-pic flag
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])# AC_LIBTOOL_PICMODE
+
+
+# AC_PROG_EGREP
+# -------------
+# This is predefined starting with Autoconf 2.54, so this conditional
+# definition can be removed once we require Autoconf 2.54 or later.
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])])
+
+
+# AC_PATH_TOOL_PREFIX
+# -------------------
+# find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_REQUIRE([AC_PROG_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="ifelse([$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 <<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
+
+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
+])# AC_PATH_TOOL_PREFIX
+
+
+# AC_PATH_MAGIC
+# -------------
+# find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_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
+    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# AC_PATH_MAGIC
+
+
+# AC_PROG_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+    [AC_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])
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])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 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])# AC_PROG_LD
+
+
+# AC_PROG_LD_GNU
+# --------------
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AC_PROG_LD_GNU
+
+
+# AC_PROG_LD_RELOAD_FLAG
+# ----------------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+])# AC_PROG_LD_RELOAD_FLAG
+
+
+# AC_DEPLIBS_CHECK_METHOD
+# -----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[[45]]*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu | 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
+  ;;
+
+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*)
+  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=unknown
+  ;;
+
+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
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  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
+    ;;
+  esac
+  ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+  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
+])# AC_DEPLIBS_CHECK_METHOD
+
+
+# AC_PROG_NM
+# ----------
+# find the pathname to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm="$ac_dir/${ac_tool_prefix}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"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+])# AC_PROG_NM
+
+
+# AC_CHECK_LIBM
+# -------------
+# check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[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_CHECK_LIBM
+
+
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
+# -----------------------------------
+# 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.  If DIRECTORY is not provided,
+# it is assumed to be `libltdl'.  LIBLTDL will be prefixed 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_builddir and top_srcdir appropriately in
+# the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  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='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_CONVENIENCE
+
+
+# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
+# -----------------------------------
+# 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 here.  If DIRECTORY is not provided,
+# and an installed libltdl is not found, it is assumed to be `libltdl'.
+# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
+# '${top_srcdir}/' (note the single quotes!).  If your package is not
+# flat and you're not using automake, define top_builddir and top_srcdir
+# appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  AC_CHECK_LIB(ltdl, lt_dlinit,
+  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+  [if test x"$enable_ltdl_install" = xno; then
+     AC_MSG_WARN([libltdl not installed, but installation disabled])
+   else
+     enable_ltdl_install=yes
+   fi
+  ])
+  if test x"$enable_ltdl_install" = x"yes"; then
+    ac_configure_args="$ac_configure_args --enable-ltdl-install"
+    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  else
+    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+    LIBLTDL="-lltdl"
+    LTDLINCL=
+  fi
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_INSTALLABLE
+
+
+# AC_LIBTOOL_CXX
+# --------------
+# enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX],
+[AC_REQUIRE([_LT_AC_LANG_CXX])
+])# AC_LIBTOOL_CXX
+
+
+# _LT_AC_LANG_CXX
+# ---------------
+AC_DEFUN([_LT_AC_LANG_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+])# _LT_AC_LANG_CXX
+
+# _LT_AC_PROG_CXXCPP
+# ---------------
+AC_DEFUN([_LT_AC_PROG_CXXCPP],
+[
+AC_REQUIRE([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
+fi
+])# _LT_AC_PROG_CXXCPP
+
+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
+
+
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+])# _LT_AC_LANG_F77
+
+
+# AC_LIBTOOL_GCJ
+# --------------
+# enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
+])# AC_LIBTOOL_GCJ
+
+
+# _LT_AC_LANG_GCJ
+# ---------------
+AC_DEFUN([_LT_AC_LANG_GCJ],
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
+])# _LT_AC_LANG_GCJ
+
+
+# AC_LIBTOOL_RC
+# --------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
+])# AC_LIBTOOL_RC
+
+
+# AC_LIBTOOL_LANG_C_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
+[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_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+#
+# Check for any special shared library compilation flags.
+#
+_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
+    ;;
+  esac
+fi
+if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
+  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
+  if echo "$old_CC $old_CFLAGS " | grep "[[ 	]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ 	]]" >/dev/null; then :
+  else
+    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
+    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
+  fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
+  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
+  [],
+  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+# Report which librarie types wil 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
+  ;;
+
+aix4* | aix5*)
+  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])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_C_CONFIG
+
+
+# AC_LIBTOOL_LANG_CXX_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+[AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_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
+  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
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+  AC_PROG_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_AC_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_AC_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_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  aix4* | aix5*)
+    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]].*|aix5*)
+	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_AC_TAGVAR(archive_cmds, $1)=''
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+    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
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	else
+	  # We have old collect2
+	  _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_AC_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
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      _LT_AC_SYS_LIBPATH_AIX
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	_LT_AC_SYS_LIBPATH_AIX
+	_LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	# -bexpall does not export symbols beginning with underscore (_)
+	_LT_AC_TAGVAR(always_export_symbols, $1)=yes
+	# Exported symbols can be pulled into shared objects from archives
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+	# This is similar to how AIX traditionally builds its shared libraries.
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+    # as there is no search path for DLLs.
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+    _LT_AC_TAGVAR(always_export_symbols, $1)=no
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      _LT_AC_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}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+  ;;
+      darwin* | rhapsody*)
+        case $host_os in
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      else
+          _LT_AC_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'
+        fi
+        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
+      fi
+        ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++*)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      ghcx*)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  freebsd[[12]]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  freebsd-elf*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  freebsd* | kfreebsd*-gnu | dragonfly*)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    aCC*)
+      _LT_AC_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) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case $host_cpu in
+      hppa*64*)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+        ;;
+      ia64*)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+        ;;
+      *)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        ;;
+      esac
+    fi
+    case $host_cpu in
+    hppa*64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+    ia64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    *)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      aCC*)
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  _LT_AC_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 $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case $host_cpu in
+	    ia64*|hppa*64*)
+	      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	      ;;
+	    *)
+	      _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC*)
+	# SGI C++
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -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_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	  else
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+	;;
+    esac
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    ;;
+  linux*)
+    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_AC_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_AC_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 $list'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+	_LT_AC_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_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc*)
+	# 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_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+  	  _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  _LT_AC_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_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      pgCC*)
+        # Portland Group C++ compiler
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+  	_LT_AC_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'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	_LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	_LT_AC_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 $templist | $SED "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 $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx*)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_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::"'
+    ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  openbsd*)
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    _LT_AC_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_AC_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_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
+  osf3*)
+    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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      cxx*)
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	_LT_AC_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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	  _LT_AC_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 ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      cxx*)
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_AC_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 -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	_LT_AC_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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	 _LT_AC_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` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  sco*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    case $cc_basename in
+      CC*)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      lcc*)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.2, 5.x and Centerline C++
+        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
+	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	_LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	case $host_os in
+	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker. We must also pass each convience library through
+	    # to the system linker between allextract/defaultextract.
+	    # The C++ compiler will combine linker options so we
+	    # cannot just pass the convience library names through
+	    # without $wl.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	_LT_AC_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_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx*)
+	# Green Hills C++ Compiler
+	_LT_AC_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_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC*)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+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
+])# AC_LIBTOOL_LANG_CXX_CONFIG
+
+# AC_LIBTOOL_POSTDEP_PREDEP([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.
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+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...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+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
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+  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_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	   else
+	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_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_AC_TAGVAR(postdeps, $1)"; then
+	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+	 else
+	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_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_AC_TAGVAR(predep_objects, $1)"; then
+	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
+	 else
+	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+	 fi
+       else
+	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+	 else
+	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_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
+ifelse([$1],[CXX],
+[case $host_os in
+solaris*)
+  case $cc_basename in
+  CC*)
+    # 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.
+    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+    ;;
+  esac
+esac
+])
+
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])# AC_LIBTOOL_POSTDEP_PREDEP
+
+# AC_LIBTOOL_LANG_F77_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_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_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_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"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+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
+  ;;
+aix4* | aix5*)
+  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])
+
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
+
+
+# AC_LIBTOOL_LANG_GCJ_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_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"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
+
+
+# AC_LIBTOOL_LANG_RC_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# 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_AC_SYS_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"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
+
+
+# AC_LIBTOOL_CONFIG([TAGNAME])
+# ----------------------------
+# If TAGNAME is not passed, then 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
+# TAGNAME from the matching tagged config vars.
+AC_DEFUN([AC_LIBTOOL_CONFIG],
+[# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    _LT_AC_TAGVAR(compiler, $1) \
+    _LT_AC_TAGVAR(CC, $1) \
+    _LT_AC_TAGVAR(LD, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+    _LT_AC_TAGVAR(old_archive_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+    _LT_AC_TAGVAR(predep_objects, $1) \
+    _LT_AC_TAGVAR(postdep_objects, $1) \
+    _LT_AC_TAGVAR(predeps, $1) \
+    _LT_AC_TAGVAR(postdeps, $1) \
+    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+    _LT_AC_TAGVAR(archive_cmds, $1) \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(postinstall_cmds, $1) \
+    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+    _LT_AC_TAGVAR(no_undefined_flag, $1) \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+    _LT_AC_TAGVAR(hardcode_automatic, $1) \
+    _LT_AC_TAGVAR(module_cmds, $1) \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+    _LT_AC_TAGVAR(exclude_expsyms, $1) \
+    _LT_AC_TAGVAR(include_expsyms, $1); do
+
+    case $var in
+    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(module_cmds, $1) | \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\[$]0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+    ;;
+  esac
+
+ifelse([$1], [],
+  [cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  AC_MSG_NOTICE([creating $ofile])],
+  [cfgfile="$ofile"])
+
+  cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e 1s/^X//"
+
+# 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
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $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.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
+
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+  case $host_os in
+  aix3*)
+    cat <<\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
+EOF
+    ;;
+  esac
+
+  # 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 '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+])
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+])# AC_LIBTOOL_CONFIG
+
+
+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
+
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
+# 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]]*\)'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+linux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDGIRSTW]]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris* | sysv5*)
+  symcode='[[BDRT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# 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
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Try without a prefix undercore, 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.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+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 <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+	  cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[[]] =
+{
+EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+	  cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+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_AC_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 -f 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
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+
+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
+# ---------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # 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).
+      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # 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*)
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	else
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_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
+	;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           ;;
+         esac
+       ;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    if test "$host_cpu" != ia64; then
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  icpc* | ecpc*)
+	    # Intel C++
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  pgCC*)
+	    # Portland Group C++ compiler.
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      sco*)
+	case $cc_basename in
+	  CC*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      unixware*)
+	;;
+      vxworks*)
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+	;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	_LT_AC_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_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    unicos*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+])
+
+
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
+# ------------------------------------
+# See if the linker supports building shared libraries.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
+[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # 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_AC_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_AC_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_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    _LT_AC_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_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+],[
+  runpath_var=
+  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_AC_TAGVAR(archive_cmds, $1)=
+  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+  _LT_AC_TAGVAR(module_cmds, $1)=
+  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(always_export_symbols, $1)=no
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_AC_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_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  _LT_CC_BASENAME([$compiler])
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` 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
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=no
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	_LT_AC_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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  _LT_AC_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_AC_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' ;;
+	esac
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  _LT_AC_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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+      _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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_AC_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_AC_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]].*|aix5*)
+	  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_AC_TAGVAR(archive_cmds, $1)=''
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+      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
+  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	  else
+  	  # We have old collect2
+  	  _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+  	  _LT_AC_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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       _LT_AC_SYS_LIBPATH_AIX
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 _LT_AC_SYS_LIBPATH_AIX
+	 _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      # see comment about different semantics on the GNU ld section
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    bsdi[[45]]*)
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+      # FIXME: Should let the user specify the lib program.
+      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    freebsd1*)
+      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	_LT_AC_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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_AC_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*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  ;;
+	ia64*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    openbsd*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	   ;;
+	 *)
+	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_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_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_AC_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~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    sco3.2v5*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_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}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	wlarc=''
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_AC_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'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
+      esac
+      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+        ;;
+	motorola)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv5*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_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'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_AC_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*
+      printf "$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_AC_TAGVAR(lt_prog_compiler_wl, $1)
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+        then
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+        else
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+        fi
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+      ;;
+    esac
+  fi
+  ;;
+esac
+])# AC_LIBTOOL_PROG_LD_SHLIBS
+
+
+# _LT_AC_FILE_LTDLL_C
+# -------------------
+# Be careful that the start marker always follows a newline.
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# #  ifdef __CYGWIN32__
+# #    define __CYGWIN__ __CYGWIN32__
+# #  endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+#   __hDllInstance_base = hInst;
+#   return TRUE;
+# }
+# /* ltdll.c ends here */
+])# _LT_AC_FILE_LTDLL_C
+
+
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+# ---------------------------------
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+
+
+# old names
+AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+  AC_SUBST(GCJFLAGS)
+])
+
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
+])
+
+# 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.                               #
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+AC_DEFUN([LT_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
+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_MSG_RESULT([$SED])
+])
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=m4_default([$1], [0.9.0])
+	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		AC_MSG_RESULT([yes])
+	else
+		AC_MSG_RESULT([no])
+		PKG_CONFIG=""
+	fi
+		
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists.  Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+#
+# Similar to PKG_CHECK_MODULES, make sure that the first instance of
+# this or PKG_CHECK_MODULES is called, or make sure to call
+# PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_ifval([$2], [$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$PKG_CONFIG"; then
+    if test -n "$$1"; then
+        pkg_cv_[]$1="$$1"
+    else
+        PKG_CHECK_EXISTS([$3],
+                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+			 [pkg_failed=yes])
+    fi
+else
+	pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
+        else 
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+	ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT
+])],
+		[$4])
+elif test $pkg_failed = untried; then
+	ifelse([$4], , [AC_MSG_FAILURE(dnl
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
+		[$4])
+else
+	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+	ifelse([$3], , :, [$3])
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+	 [AM_AUTOMAKE_VERSION([1.9.6])])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 7
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`AS_DIRNAME("$mf")`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`AS_DIRNAME(["$file"])`
+    AS_MKDIR_P([$dirpart/$fdir])
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.58])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+	      		     [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $1 | $1:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_PROG_LEX
+# -----------
+# Autoconf leaves LEX=: if lex or flex can't be found.  Change that to a
+# "missing" invocation, for better error output.
+AC_DEFUN([AM_PROG_LEX],
+[AC_PREREQ(2.50)dnl
+AC_REQUIRE([AM_MISSING_HAS_RUN])dnl
+AC_REQUIRE([AC_PROG_LEX])dnl
+if test "$LEX" = :; then
+  LEX=${am_missing_run}flex
+fi])
+
+# Check to see how 'make' treats includes.	            -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Copyright (C) 1999, 2000, 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_PROG_CC_C_O
+# --------------
+# Like AC_PROG_CC_C_O, but changed for automake.
+AC_DEFUN([AM_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+#
+# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+# created by `make install' are always world readable, even if the
+# installer happens to have an overly restrictive umask (e.g. 077).
+# This was a mistake.  There are at least two reasons why we must not
+# use `-m 0755':
+#   - it causes special bits like SGID to be ignored,
+#   - it may be too restrictive (some setups expect 775 directories).
+#
+# Do not use -m 0755 and let people choose whatever they expect by
+# setting umask.
+#
+# We cannot accept any implementation of `mkdir' that recognizes `-p'.
+# Some implementations (such as Solaris 8's) are not thread-safe: if a
+# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
+# concurrently, both version can detect that a/ is missing, but only
+# one can create it and the other will error out.  Consequently we
+# restrict ourselves to GNU make (using the --version option ensures
+# this.)
+AC_DEFUN([AM_PROG_MKDIR_P],
+[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+AC_SUBST([mkdir_p])])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([Scripts/m4/cppunit.m4])
+m4_include([acinclude.m4])
Index: /autom4te.cache/output.0
===================================================================
--- /autom4te.cache/output.0	(revision 5)
+++ /autom4te.cache/output.0	(revision 5)
@@ -0,0 +1,29672 @@
+@%:@! /bin/sh
+@%:@ Guess values for system-dependent variables and create Makefiles.
+@%:@ Generated by GNU Autoconf 2.61 for OGRE 1.4.5.
+@%:@ 
+@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+@%:@ 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+@%:@ This configure script is free software; the Free Software Foundation
+@%:@ gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes && 	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  case $as_dir in
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+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
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+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
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+    
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+	case $1 in
+        -*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+  ;;
+esac
+
+echo=${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 <<EOF
+$*
+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 "$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 &&
+       echo_test_string=`eval $cmd` &&
+       (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.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+tagnames=${tagnames+${tagnames},}CXX
+
+tagnames=${tagnames+${tagnames},}F77
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIB@&t@OBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='OGRE'
+PACKAGE_TARNAME='ogre'
+PACKAGE_VERSION='1.4.5'
+PACKAGE_STRING='OGRE 1.4.5'
+PACKAGE_BUGREPORT=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+build
+build_cpu
+build_vendor
+build_os
+host
+host_cpu
+host_vendor
+host_os
+target
+target_cpu
+target_vendor
+target_os
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+CYGPATH_W
+PACKAGE
+VERSION
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+install_sh
+STRIP
+INSTALL_STRIP_PROGRAM
+mkdir_p
+AWK
+SET_MAKE
+am__leading_dot
+AMTAR
+am__tar
+am__untar
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+DEPDIR
+am__include
+am__quote
+AMDEP_TRUE
+AMDEP_FALSE
+AMDEPBACKSLASH
+CCDEPMODE
+am__fastdepCC_TRUE
+am__fastdepCC_FALSE
+CXX
+CXXFLAGS
+ac_ct_CXX
+CXXDEPMODE
+am__fastdepCXX_TRUE
+am__fastdepCXX_FALSE
+YACC
+YFLAGS
+LEX
+LEX_OUTPUT_ROOT
+LEXLIB
+SHARED_FLAGS
+PLUGIN_FLAGS
+GL_LIBS
+RC
+OGRE_NT_TRUE
+OGRE_NT_FALSE
+OGRE_LINUX_TRUE
+OGRE_LINUX_FALSE
+OGRE_OSX_TRUE
+OGRE_OSX_FALSE
+GREP
+EGREP
+LN_S
+ECHO
+AR
+RANLIB
+CPP
+CXXCPP
+F77
+FFLAGS
+ac_ct_F77
+LIBTOOL
+OGRE_CFLAGS
+CFLAGS_VISIBILITY
+STLPORT_CFLAGS
+STLPORT_LIBS
+FT2_CONFIG
+FT2_CFLAGS
+FT2_LIBS
+CPPUNIT_CONFIG
+CPPUNIT_CFLAGS
+CPPUNIT_LIBS
+BUILD_UNIT_TESTS_TRUE
+BUILD_UNIT_TESTS_FALSE
+PKG_CONFIG
+ZZIPLIB_CFLAGS
+ZZIPLIB_LIBS
+XMKMF
+PLATFORM_CFLAGS
+PLATFORM_LIBS
+OGRE_PLATFORM
+GLSUPPORT_CFLAGS
+GLSUPPORT_LIBS
+OGRE_GLSUPPORT
+GTK_CFLAGS
+GTK_LIBS
+OGRE_GUI
+OGRE_THREAD_LIBS
+USE_FREEIMAGE_TRUE
+USE_FREEIMAGE_FALSE
+USE_DEVIL_TRUE
+USE_DEVIL_FALSE
+BUILD_CGPLUGIN_TRUE
+BUILD_CGPLUGIN_FALSE
+OPENEXR_CFLAGS
+OPENEXR_LIBS
+BUILD_EXRPLUGIN_TRUE
+BUILD_EXRPLUGIN_FALSE
+BUILD_DX9RENDERSYSTEM_TRUE
+BUILD_DX9RENDERSYSTEM_FALSE
+OGRE_BUILD_SSE_TRUE
+OGRE_BUILD_SSE_FALSE
+SAME_PLATFORM_AND_GUI_TRUE
+SAME_PLATFORM_AND_GUI_FALSE
+OIS_CFLAGS
+OIS_LIBS
+OGRE_BUILDING_DEMOS_TRUE
+OGRE_BUILDING_DEMOS_FALSE
+CEGUI_CFLAGS
+CEGUI_LIBS
+HAVE_CEGUI_TRUE
+HAVE_CEGUI_FALSE
+abs_top_builddir
+ogreexecdir
+LIB@&t@OBJS
+LTLIBOBJS'
+ac_subst_files=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CXX
+CXXFLAGS
+CCC
+YACC
+YFLAGS
+CPP
+CXXCPP
+F77
+FFLAGS
+PKG_CONFIG
+ZZIPLIB_CFLAGS
+ZZIPLIB_LIBS
+XMKMF
+GTK_CFLAGS
+GTK_LIBS
+OPENEXR_CFLAGS
+OPENEXR_LIBS
+OIS_CFLAGS
+OIS_LIBS
+CEGUI_CFLAGS
+CEGUI_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute directory names.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures OGRE 1.4.5 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+			  [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+			  [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root @<:@DATAROOTDIR/doc/ogre@:>@
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+X features:
+  --x-includes=DIR    X include files are in DIR
+  --x-libraries=DIR   X library files are in DIR
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of OGRE 1.4.5:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-static@<:@=PKGS@:>@  build static libraries @<:@default=no@:>@
+  --enable-shared@<:@=PKGS@:>@  build shared libraries @<:@default=yes@:>@
+  --enable-fast-install@<:@=PKGS@:>@ 
+                          optimize for fast installation @<:@default=yes@:>@
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+  --disable-freetypetest  Do not try to compile and run
+                          a test FreeType program
+  --enable-double         Build OGRE in double floating point precision mode.
+                          This is not recommended for normal use as it is
+                          slower.
+  --enable-threading      Indicate general support for multithreading. This
+                          will enable threading support in certain parts of
+                          the engine, mainly resource loading and SharedPtr
+                          handling. WARNING: highly experimental, use with
+                          caution.
+  --disable-freeimage     Don't use FreeImage for image loading. This is not
+                          recommended unless you provide your own image
+                          loading codecs.
+  --disable-devil         Don't use DevIL for image loading. This is not
+                          recommended unless you provide your own image
+                          loading codecs.
+  --disable-cg            Do not build the Cg plugin (recommended you do so!)
+  --enable-openexr        Build the OpenEXR plugin
+  --enable-direct3d       Build the DirectX 9 Render System
+  --disable-ogre-demos    Do not build Ogre demos (CEGUI Renderer - if
+                          enabled/disabled, is not affected by this
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-gnu-ld           assume the C compiler uses GNU ld @<:@default=no@:>@
+  --with-pic              try to use only PIC/non-PIC objects @<:@default=use
+                          both@:>@
+  --with-tags@<:@=TAGS@:>@      include additional configurations @<:@automatic@:>@
+  --with-stlport=PATH     the path to STLPort.
+  --with-ft-prefix=PREFIX
+                          Prefix where FreeType is installed (optional)
+  --with-ft-exec-prefix=PREFIX
+                          Exec prefix where FreeType is installed (optional)
+  --with-cppunit-prefix=PFX   Prefix where CppUnit is installed (optional)
+  --with-cppunit-exec-prefix=PFX  Exec prefix where CppUnit is installed (optional)
+  --with-platform=PLATFORM 
+                          the platform to build, currently GLX or Win32
+  --with-x                use the X Window System
+  --with-gl-support=PLATFORM 
+                          The GLsupport to build (GLX or Win32). Defaults to
+                          the platform. Only set this if you know what you are
+                          doing. Use --with-platform otherwise.
+  --with-gui=type         Select the GUI type to use for dialogs (win32, gtk,
+                          Xt) (default: auto)
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  YACC        The `Yet Another C Compiler' implementation to use. Defaults to
+              the first program found out of: `bison -y', `byacc', `yacc'.
+  YFLAGS      The list of arguments that will be passed by default to $YACC.
+              This script will default YFLAGS to the empty string to avoid a
+              default value of `-d' given by some make applications.
+  CPP         C preprocessor
+  CXXCPP      C++ preprocessor
+  F77         Fortran 77 compiler command
+  FFLAGS      Fortran 77 compiler flags
+  PKG_CONFIG  path to pkg-config utility
+  ZZIPLIB_CFLAGS 
+              C compiler flags for ZZIPLIB, overriding pkg-config
+  ZZIPLIB_LIBS 
+              linker flags for ZZIPLIB, overriding pkg-config
+  XMKMF       Path to xmkmf, Makefile generator for X Window System
+  GTK_CFLAGS  C compiler flags for GTK, overriding pkg-config
+  GTK_LIBS    linker flags for GTK, overriding pkg-config
+  OPENEXR_CFLAGS 
+              C compiler flags for OPENEXR, overriding pkg-config
+  OPENEXR_LIBS 
+              linker flags for OPENEXR, overriding pkg-config
+  OIS_CFLAGS  C compiler flags for OIS, overriding pkg-config
+  OIS_LIBS    linker flags for OIS, overriding pkg-config
+  CEGUI_CFLAGS 
+              C compiler flags for CEGUI, overriding pkg-config
+  CEGUI_LIBS  linker flags for CEGUI, overriding pkg-config
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" || continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+OGRE configure 1.4.5
+generated by GNU Autoconf 2.61
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by OGRE $as_me 1.4.5, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+@%:@@%:@ --------- @%:@@%:@
+@%:@@%:@ Platform. @%:@@%:@
+@%:@@%:@ --------- @%:@@%:@
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ Core tests. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+@%:@@%:@ ---------------- @%:@@%:@
+@%:@@%:@ Cache variables. @%:@@%:@
+@%:@@%:@ ---------------- @%:@@%:@
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+@%:@@%:@ ----------------- @%:@@%:@
+@%:@@%:@ Output variables. @%:@@%:@
+@%:@@%:@ ----------------- @%:@@%:@
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+@%:@@%:@ ------------------- @%:@@%:@
+@%:@@%:@ File substitutions. @%:@@%:@
+@%:@@%:@ ------------------- @%:@@%:@
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ confdefs.h. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+	"$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
+do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6; }
+if test "${ac_cv_target+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
+echo "$as_me: error: invalid value of canonical target" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+# New syntax; PACKAGE gets defined as 'OGRE' not 'ogre'
+#AM_INIT_AUTOMAKE([OGRE], 1.4.5)
+am__api_version="1.9"
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+IFS=$as_save_IFS
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.  echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm -f conftest.sed
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+  SET_MAKE=
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE=OGRE
+ VERSION=1.4.5
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE "$PACKAGE"
+_ACEOF
+
+ 
+cat >>confdefs.h <<_ACEOF
+@%:@define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+ac_config_headers="$ac_config_headers OgreMain/include/config.h"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $@%:@ != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6; }
+
+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext 
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+{ echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval=$enable_dependency_tracking; 
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+ 
+
+if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC"   am_compiler_list=
+
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ 
+
+if 
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CXXFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX"  am_compiler_list=
+
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ 
+
+if 
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+if test "x$CC" != xcc; then
+  { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
+echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; }
+else
+  { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
+echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; }
+fi
+set dummy $CC; ac_cc=`echo $2 |
+		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+   test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.$ac_ext >&5'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+      rm -f conftest2.*
+      if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+      then
+	# cc works too.
+	:
+      else
+	# cc exists but doesn't like -o.
+	eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define NO_MINUS_C_MINUS_O 1
+_ACEOF
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+IFS=$as_save_IFS
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+for ac_prog in 'bison -y' byacc
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_YACC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$YACC"; then
+  ac_cv_prog_YACC="$YACC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_YACC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+YACC=$ac_cv_prog_YACC
+if test -n "$YACC"; then
+  { echo "$as_me:$LINENO: result: $YACC" >&5
+echo "${ECHO_T}$YACC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$YACC" && break
+done
+test -n "$YACC" || YACC="yacc"
+
+
+for ac_prog in flex lex
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_LEX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$LEX"; then
+  ac_cv_prog_LEX="$LEX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LEX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+LEX=$ac_cv_prog_LEX
+if test -n "$LEX"; then
+  { echo "$as_me:$LINENO: result: $LEX" >&5
+echo "${ECHO_T}$LEX" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$LEX" && break
+done
+test -n "$LEX" || LEX=":"
+
+if test "x$LEX" != "x:"; then
+  cat >conftest.l <<_ACEOF
+%%
+a { ECHO; }
+b { REJECT; }
+c { yymore (); }
+d { yyless (1); }
+e { yyless (input () != 0); }
+f { unput (yytext[0]); }
+. { BEGIN INITIAL; }
+%%
+#ifdef YYTEXT_POINTER
+extern char *yytext;
+#endif
+int
+main (void)
+{
+  return ! yylex () + ! yywrap ();
+}
+_ACEOF
+{ (ac_try="$LEX conftest.l"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$LEX conftest.l") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ echo "$as_me:$LINENO: checking lex output file root" >&5
+echo $ECHO_N "checking lex output file root... $ECHO_C" >&6; }
+if test "${ac_cv_prog_lex_root+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  
+if test -f lex.yy.c; then
+  ac_cv_prog_lex_root=lex.yy
+elif test -f lexyy.c; then
+  ac_cv_prog_lex_root=lexyy
+else
+  { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
+echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
+echo "${ECHO_T}$ac_cv_prog_lex_root" >&6; }
+LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
+
+if test -z "${LEXLIB+set}"; then
+  { echo "$as_me:$LINENO: checking lex library" >&5
+echo $ECHO_N "checking lex library... $ECHO_C" >&6; }
+if test "${ac_cv_lib_lex+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  
+    ac_save_LIBS=$LIBS
+    ac_cv_lib_lex='none needed'
+    for ac_lib in '' -lfl -ll; do
+      LIBS="$ac_lib $ac_save_LIBS"
+      cat >conftest.$ac_ext <<_ACEOF
+`cat $LEX_OUTPUT_ROOT.c`
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_lex=$ac_lib
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+      test "$ac_cv_lib_lex" != 'none needed' && break
+    done
+    LIBS=$ac_save_LIBS
+  
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5
+echo "${ECHO_T}$ac_cv_lib_lex" >&6; }
+  test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex
+fi
+
+
+{ echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
+echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6; }
+if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # POSIX says lex can declare yytext either as a pointer or an array; the
+# default is implementation-dependent.  Figure out which it is, since
+# not all implementations provide the %pointer and %array declarations.
+ac_cv_prog_lex_yytext_pointer=no
+ac_save_LIBS=$LIBS
+LIBS="$LEXLIB $ac_save_LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#define YYTEXT_POINTER 1
+`cat $LEX_OUTPUT_ROOT.c`
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_prog_lex_yytext_pointer=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_save_LIBS
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
+echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6; }
+if test $ac_cv_prog_lex_yytext_pointer = yes; then
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define YYTEXT_POINTER 1
+_ACEOF
+
+fi
+rm -f conftest.l $LEX_OUTPUT_ROOT.c
+
+fi
+if test "$LEX" = :; then
+  LEX=${am_missing_run}flex
+fi
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+	SHARED_FLAGS="-shared -no-undefined -Xlinker --export-all-symbols"
+
+	PLUGIN_FLAGS="-shared -no-undefined -avoid-version"
+
+	GL_LIBS="-lopengl32 -lglu32"
+	
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
+set dummy ${ac_tool_prefix}windres; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_RC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RC"; then
+  ac_cv_prog_RC="$RC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RC="${ac_tool_prefix}windres"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RC=$ac_cv_prog_RC
+if test -n "$RC"; then
+  { echo "$as_me:$LINENO: result: $RC" >&5
+echo "${ECHO_T}$RC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RC"; then
+  ac_ct_RC=$RC
+  # Extract the first word of "windres", so it can be a program name with args.
+set dummy windres; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_RC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RC"; then
+  ac_cv_prog_ac_ct_RC="$ac_ct_RC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RC="windres"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RC=$ac_cv_prog_ac_ct_RC
+if test -n "$ac_ct_RC"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_RC" >&5
+echo "${ECHO_T}$ac_ct_RC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_RC" = x; then
+    RC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    RC=$ac_ct_RC
+  fi
+else
+  RC="$ac_cv_prog_RC"
+fi
+
+        nt=true
+;;
+*-*-darwin*)
+        SHARED_FLAGS="-shared"
+
+        PLUGIN_FLAGS="-shared -avoid-version"
+
+        GL_LIBS="-lGL -lGLU"
+
+        osx=true
+;;
+ *) 	SHARED_FLAGS="-shared"
+
+	PLUGIN_FLAGS="-shared -avoid-version"
+
+	GL_LIBS="-lGL -lGLU"
+
+        linux=true
+;;
+esac
+ 
+
+if test x$nt = xtrue; then
+  OGRE_NT_TRUE=
+  OGRE_NT_FALSE='#'
+else
+  OGRE_NT_TRUE='#'
+  OGRE_NT_FALSE=
+fi
+
+ 
+
+if test x$linux = xtrue; then
+  OGRE_LINUX_TRUE=
+  OGRE_LINUX_FALSE='#'
+else
+  OGRE_LINUX_TRUE='#'
+  OGRE_LINUX_FALSE=
+fi
+
+ 
+
+if test x$osx = xtrue ; then
+  OGRE_OSX_TRUE=
+  OGRE_OSX_FALSE='#'
+else
+  OGRE_OSX_TRUE='#'
+  OGRE_OSX_FALSE=
+fi
+
+
+
+# Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval=$enable_static; 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
+else
+  enable_static=no
+fi
+
+
+
+# Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval=$enable_shared; 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
+else
+  enable_shared=yes
+fi
+
+
+# Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval=$enable_fast_install; 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
+else
+  enable_fast_install=yes
+fi
+
+
+{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; }
+if test "${lt_cv_path_SED+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # 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
+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
+
+fi
+
+SED=$lt_cv_path_SED
+{ echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6; }
+
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+    # Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_GREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+ 
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+    # Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_EGREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+
+   fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+ 
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+else
+  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; }
+if test "${lt_cv_path_NM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm="$ac_dir/${ac_tool_prefix}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"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+echo "${ECHO_T}$lt_cv_path_NM" >&6; }
+NM="$lt_cv_path_NM"
+
+{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6; }
+fi
+
+{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
+echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; }
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu | 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
+  ;;
+
+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*)
+  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=unknown
+  ;;
+
+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
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  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
+    ;;
+  esac
+  ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; }
+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
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval=$enable_libtool_lock; 
+fi
+
+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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.o` in
+    *32-bit*)
+      case $host in
+        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-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          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"
+  { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; }
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  lt_cv_cc_needs_belf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	lt_cv_cc_needs_belf=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; }
+  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
+  ;;
+
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+  
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ 
+fi
+
+done
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ 
+fi
+
+done
+
+
+
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
+if test -z "$CXXCPP"; then
+  if test "${ac_cv_prog_CXXCPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+  
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+fi
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  { echo "$as_me:$LINENO: result: $F77" >&5
+echo "${ECHO_T}$F77" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$F77" && break
+  done
+fi
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_F77="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+echo "${ECHO_T}$ac_ct_F77" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_F77" && break
+done
+
+  if test "x$ac_ct_F77" = x; then
+    F77=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    F77=$ac_ct_F77
+  fi
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; }
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_f77_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_f77_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_prog_f77_g=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; }
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
+
+G77=`test $ac_compiler_gnu = yes && echo yes`
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+
+# find the maximum length of command line arguments
+{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; }
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    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*)
+    # 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;
+    ;;
+
+  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`
+    ;;
+  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
+    ;;
+  *)
+    # 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.
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+	       = "XX$teststring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
+	    lt_cv_sys_max_cmd_len=$new_result &&
+	    test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    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`
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6; }
+fi
+
+
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  
+# 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]*\)'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+linux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDGIRSTW]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris* | sysv5*)
+  symcode='[BDRT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# 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
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Try without a prefix undercore, 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.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && 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 <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+	  cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+	  cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+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_prog_compiler_no_builtin_flag"
+	  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && 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" >&5
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -f 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
+
+fi
+
+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
+  { echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6; }
+else
+  { echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6; }
+fi
+
+{ echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }
+if test "${lt_cv_objdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+echo "${ECHO_T}$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+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.
+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'
+
+# 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 avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+for cc_temp in $compiler""; 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-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      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 <<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
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      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 <<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
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+enable_dlopen=no
+enable_win32_dll=no
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval=$enable_libtool_lock; 
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then
+  withval=$with_pic; pic_mode="$withval"
+else
+  pic_mode=default
+fi
+
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+#
+# Check for any special shared library compilation flags.
+#
+lt_prog_cc_shlib=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    lt_prog_cc_shlib='-belf'
+    ;;
+  esac
+fi
+if test -n "$lt_prog_cc_shlib"; then
+  { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5
+echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;}
+  if echo "$old_CC $old_CFLAGS " | grep "[ 	]$lt_prog_cc_shlib[ 	]" >/dev/null; then :
+  else
+    { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
+echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
+    lt_cv_prog_cc_can_build_shared=no
+  fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_static_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
+   printf "$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>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
+       $SED '/^$/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works=yes
+       fi
+     else
+       lt_prog_compiler_static_works=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; }
+
+if test x"$lt_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+## 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_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+  
+{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # 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\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+ 
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      else
+	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic='-qnocommon'
+         lt_prog_compiler_wl='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-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_prog_compiler_pic='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-KPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fpic'
+	lt_prog_compiler_static='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic='-Kpic'
+      lt_prog_compiler_static='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic='-Kconform_pic'
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+  
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # 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\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  runpath_var=
+  allow_undefined_flag=
+  enable_shared_with_static_runtimes=no
+  archive_cmds=
+  archive_expsym_cmds=
+  old_archive_From_new_cmds=
+  old_archive_from_expsyms_cmds=
+  export_dynamic_flag_spec=
+  whole_archive_flag_spec=
+  thread_safe_flag_spec=
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_flag_spec_ld=
+  hardcode_libdir_separator=
+  hardcode_direct=no
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  link_all_deplibs=unknown
+  hardcode_automatic=no
+  module_cmds=
+  module_expsym_cmds=
+  always_export_symbols=no
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # 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'.
+  exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; 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-%%"`
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=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
+    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${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
+	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` 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
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$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)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$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
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec='${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
+	  whole_archive_flag_spec='${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' ;;
+	esac
+	archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$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.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds='$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].*|aix5*)
+	  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.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+
+      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
+  	  hardcode_direct=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct=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
+  	  hardcode_minus_L=yes
+  	  hardcode_libdir_flag_spec='-L$libdir'
+  	  hardcode_libdir_separator=
+	  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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=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.
+	allow_undefined_flag='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag="-z nodefs"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec='${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.
+	  no_undefined_flag=' ${wl}-bernotok'
+	  allow_undefined_flag=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec=' '
+	  archive_cmds_need_lc=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$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)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec=' '
+      allow_undefined_flag=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.
+      archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc=no
+      hardcode_direct=no
+      hardcode_automatic=yes
+      hardcode_shlibpath_var=unsupported
+      whole_archive_flag_spec=''
+      link_all_deplibs=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs=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*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds='$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
+	archive_cmds='$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
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds='$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*|ia64*)
+	  archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld='+b $libdir'
+	  hardcode_libdir_separator=:
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec='-L$libdir'
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator=:
+	  hardcode_direct=yes
+	  export_dynamic_flag_spec='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      link_all_deplibs=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    openbsd*)
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$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'
+      old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      hardcode_libdir_separator=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z text'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	wlarc=''
+	archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds='$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'
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
+      esac
+      link_all_deplibs=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.
+	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds='$CC -r -o $output$reload_objs'
+	  hardcode_direct=no
+        ;;
+	motorola)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=no
+      hardcode_shlibpath_var=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds='$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'
+      hardcode_libdir_flag_spec=
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+echo "${ECHO_T}$ld_shlibs" >&6; }
+test "$ld_shlibs" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag
+        allow_undefined_flag=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc=no
+        else
+	  archive_cmds_need_lc=yes
+        fi
+        allow_undefined_flag=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+echo "${ECHO_T}$archive_cmds_need_lc" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;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'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+   test -n "$runpath_var" || \
+   test "X$hardcode_automatic" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct" != 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_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action" >&5
+echo "${ECHO_T}$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink; 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
+
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
+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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+fi
+
+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*)
+    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
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    
+fi
+
+   ;;
+
+  *)
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_svld_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_dld_link=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+	      
+fi
+
+	    
+fi
+
+	  
+fi
+
+	
+fi
+
+      
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+    
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+      
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
+    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
+
+
+# Report which librarie types wil actually be built
+{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6; }
+
+{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
+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
+  ;;
+
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+    ;;
+esac
+{ echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6; }
+
+{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+{ echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6; }
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler \
+    CC \
+    LD \
+    lt_prog_compiler_wl \
+    lt_prog_compiler_pic \
+    lt_prog_compiler_static \
+    lt_prog_compiler_no_builtin_flag \
+    export_dynamic_flag_spec \
+    thread_safe_flag_spec \
+    whole_archive_flag_spec \
+    enable_shared_with_static_runtimes \
+    old_archive_cmds \
+    old_archive_from_new_cmds \
+    predep_objects \
+    postdep_objects \
+    predeps \
+    postdeps \
+    compiler_lib_search_path \
+    archive_cmds \
+    archive_expsym_cmds \
+    postinstall_cmds \
+    postuninstall_cmds \
+    old_archive_from_expsyms_cmds \
+    allow_undefined_flag \
+    no_undefined_flag \
+    export_symbols_cmds \
+    hardcode_libdir_flag_spec \
+    hardcode_libdir_flag_spec_ld \
+    hardcode_libdir_separator \
+    hardcode_automatic \
+    module_cmds \
+    module_expsym_cmds \
+    lt_cv_prog_compiler_c_o \
+    exclude_expsyms \
+    include_expsyms; do
+
+    case $var in
+    old_archive_cmds | \
+    old_archive_from_new_cmds | \
+    archive_cmds | \
+    archive_expsym_cmds | \
+    module_cmds | \
+    module_expsym_cmds | \
+    old_archive_from_expsyms_cmds | \
+    export_symbols_cmds | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  { echo "$as_me:$LINENO: creating $ofile" >&5
+echo "$as_me: creating $ofile" >&6;}
+
+  cat <<__EOF__ >> "$cfgfile"
+#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e 1s/^X//"
+
+# 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
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+
+  case $host_os in
+  aix3*)
+    cat <<\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
+EOF
+    ;;
+  esac
+
+  # 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 '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+# Check whether --with-tags was given.
+if test "${with_tags+set}" = set; then
+  withval=$with_tags; tagnames="$withval"
+fi
+
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
+    else
+      { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
+echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
+    fi
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
+    "") ;;
+    *)  { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
+echo "$as_me: error: invalid tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+	;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
+echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      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_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# 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
+  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
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+for cc_temp in $compiler""; 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-%%"`
+
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+  lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+  
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+else
+  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_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
+    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_CXX='${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
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_CXX=
+    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.
+    archive_cmds_CXX='$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
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+ld_shlibs_CXX=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  aix4* | aix5*)
+    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].*|aix5*)
+	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.
+
+    archive_cmds_CXX=''
+    hardcode_direct_CXX=yes
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+
+    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
+	  hardcode_direct_CXX=yes
+	else
+	  # We have old collect2
+	  hardcode_direct_CXX=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
+	  hardcode_minus_L_CXX=yes
+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
+	  hardcode_libdir_separator_CXX=
+	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
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    always_export_symbols_CXX=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.
+      allow_undefined_flag_CXX='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+	allow_undefined_flag_CXX="-z nodefs"
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	hardcode_libdir_flag_spec_CXX='${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.
+	no_undefined_flag_CXX=' ${wl}-bernotok'
+	allow_undefined_flag_CXX=' ${wl}-berok'
+	# -bexpall does not export symbols beginning with underscore (_)
+	always_export_symbols_CXX=yes
+	# Exported symbols can be pulled into shared objects from archives
+	whole_archive_flag_spec_CXX=' '
+	archive_cmds_need_lc_CXX=yes
+	# This is similar to how AIX traditionally builds its shared libraries.
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+    # as there is no search path for DLLs.
+    hardcode_libdir_flag_spec_CXX='-L$libdir'
+    allow_undefined_flag_CXX=unsupported
+    always_export_symbols_CXX=no
+    enable_shared_with_static_runtimes_CXX=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      archive_expsym_cmds_CXX='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}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+  ;;
+      darwin* | rhapsody*)
+        case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      archive_cmds_need_lc_CXX=no
+      hardcode_direct_CXX=no
+      hardcode_automatic_CXX=yes
+      hardcode_shlibpath_var_CXX=unsupported
+      whole_archive_flag_spec_CXX=''
+      link_all_deplibs_CXX=yes
+
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      else
+          archive_cmds_CXX='$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'
+        fi
+        module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_CXX=no
+          ;;
+      esac
+      fi
+        ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      ghcx*)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  freebsd[12]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    ld_shlibs_CXX=no
+    ;;
+  freebsd-elf*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  freebsd* | kfreebsd*-gnu | dragonfly*)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    ld_shlibs_CXX=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    hardcode_direct_CXX=yes
+    hardcode_minus_L_CXX=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
+      ld_shlibs_CXX=no
+      ;;
+    aCC*)
+      archive_cmds_CXX='$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) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        archive_cmds_CXX='$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
+        ld_shlibs_CXX=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case $host_cpu in
+      hppa*64*)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+	hardcode_libdir_separator_CXX=:
+        ;;
+      ia64*)
+	hardcode_libdir_flag_spec_CXX='-L$libdir'
+        ;;
+      *)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+	export_dynamic_flag_spec_CXX='${wl}-E'
+        ;;
+      esac
+    fi
+    case $host_cpu in
+    hppa*64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      ;;
+    ia64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      hardcode_minus_L_CXX=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    *)
+      hardcode_direct_CXX=yes
+      hardcode_minus_L_CXX=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
+	ld_shlibs_CXX=no
+	;;
+      aCC*)
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  archive_cmds_CXX='$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 $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case $host_cpu in
+	    ia64*|hppa*64*)
+	      archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	      ;;
+	    *)
+	      archive_cmds_CXX='$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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC*)
+	# SGI C++
+	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -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.
+	old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test "$with_gnu_ld" = no; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	  else
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	link_all_deplibs_CXX=yes
+	;;
+    esac
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    ;;
+  linux*)
+    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.
+	archive_cmds_CXX='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'
+	archive_expsym_cmds_CXX='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 $list'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc*)
+	# 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."*)
+  	  archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+  	  archive_expsym_cmds_CXX='$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
+  	  archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  ;;
+	esac
+	archive_cmds_need_lc_CXX=no
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      pgCC*)
+        # Portland Group C++ compiler
+	archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+  	archive_expsym_cmds_CXX='$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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${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++
+	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_CXX='$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
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      hardcode_libdir_flag_spec_CXX='-R$libdir'
+      hardcode_direct_CXX=yes
+      hardcode_shlibpath_var_CXX=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::"'
+    ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    ld_shlibs_CXX=no
+    ;;
+  openbsd*)
+    hardcode_direct_CXX=yes
+    hardcode_shlibpath_var_CXX=no
+    archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+      export_dynamic_flag_spec_CXX='${wl}-E'
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
+  osf3*)
+    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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx*)
+	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx*)
+	allow_undefined_flag_CXX=' -expect_unresolved \*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_CXX='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 -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	 archive_cmds_CXX='$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` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  sco*)
+    archive_cmds_need_lc_CXX=no
+    case $cc_basename in
+      CC*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      lcc*)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.2, 5.x and Centerline C++
+        archive_cmds_need_lc_CXX=yes
+	no_undefined_flag_CXX=' -zdefs'
+	archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	archive_expsym_cmds_CXX='$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'
+
+	hardcode_libdir_flag_spec_CXX='-R$libdir'
+	hardcode_shlibpath_var_CXX=no
+	case $host_os in
+	  solaris2.[0-5] | solaris2.[0-5].*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker. We must also pass each convience library through
+	    # to the system linker between allextract/defaultextract.
+	    # The C++ compiler will combine linker options so we
+	    # cannot just pass the convience library names through
+	    # without $wl.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	link_all_deplibs_CXX=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.
+	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx*)
+	# Green Hills C++ Compiler
+	archive_cmds_CXX='$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.
+	old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	;;
+      *)
+	# GNU C++ compiler with Solaris linker
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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.
+	    archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC*)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+esac
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$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...
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+  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 "$compiler_lib_search_path_CXX"; then
+	     compiler_lib_search_path_CXX="${prev}${p}"
+	   else
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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 "$postdeps_CXX"; then
+	   postdeps_CXX="${prev}${p}"
+	 else
+	   postdeps_CXX="${postdeps_CXX} ${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 "$predep_objects_CXX"; then
+	   predep_objects_CXX="$p"
+	 else
+	   predep_objects_CXX="$predep_objects_CXX $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_CXX"; then
+	   postdep_objects_CXX="$p"
+	 else
+	   postdep_objects_CXX="$postdep_objects_CXX $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+solaris*)
+  case $cc_basename in
+  CC*)
+    # 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.
+    postdeps_CXX='-lCstd -lCrun'
+    ;;
+  esac
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+ 
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # 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_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # 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).
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # 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*)
+	;;
+      *)
+	lt_prog_compiler_pic_CXX='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  lt_prog_compiler_static_CXX='-Bstatic'
+	else
+	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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
+	;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           lt_prog_compiler_pic_CXX='-qnocommon'
+           lt_prog_compiler_wl_CXX='-Wl,'
+           ;;
+         esac
+       ;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    if test "$host_cpu" != ia64; then
+	      lt_prog_compiler_pic_CXX='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      lt_prog_compiler_pic_CXX='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  icpc* | ecpc*)
+	    # Intel C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  pgCC*)
+	    # Portland Group C++ compiler.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fpic'
+	    lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    lt_prog_compiler_pic_CXX='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      sco*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    lt_prog_compiler_wl_CXX='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    lt_prog_compiler_pic_CXX='-pic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      unixware*)
+	;;
+      vxworks*)
+	;;
+      *)
+	lt_prog_compiler_can_build_shared_CXX=no
+	;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+  
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_CXX=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   # 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\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; }
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # 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
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    export_symbols_cmds_CXX='$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'
+  ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_CXX
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+        allow_undefined_flag_CXX=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_CXX=no
+        else
+	  archive_cmds_need_lc_CXX=yes
+        fi
+        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;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'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+   test -n "$runpath_var_CXX" || \
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_CXX" != 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_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6; }
+
+if test "$hardcode_action_CXX" = relink; 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
+
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
+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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+fi
+
+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*)
+    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
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    
+fi
+
+   ;;
+
+  *)
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_svld_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_dld_link=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+	      
+fi
+
+	    
+fi
+
+	  
+fi
+
+	
+fi
+
+      
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+    
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+      
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
+    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
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_CXX \
+    CC_CXX \
+    LD_CXX \
+    lt_prog_compiler_wl_CXX \
+    lt_prog_compiler_pic_CXX \
+    lt_prog_compiler_static_CXX \
+    lt_prog_compiler_no_builtin_flag_CXX \
+    export_dynamic_flag_spec_CXX \
+    thread_safe_flag_spec_CXX \
+    whole_archive_flag_spec_CXX \
+    enable_shared_with_static_runtimes_CXX \
+    old_archive_cmds_CXX \
+    old_archive_from_new_cmds_CXX \
+    predep_objects_CXX \
+    postdep_objects_CXX \
+    predeps_CXX \
+    postdeps_CXX \
+    compiler_lib_search_path_CXX \
+    archive_cmds_CXX \
+    archive_expsym_cmds_CXX \
+    postinstall_cmds_CXX \
+    postuninstall_cmds_CXX \
+    old_archive_from_expsyms_cmds_CXX \
+    allow_undefined_flag_CXX \
+    no_undefined_flag_CXX \
+    export_symbols_cmds_CXX \
+    hardcode_libdir_flag_spec_CXX \
+    hardcode_libdir_flag_spec_ld_CXX \
+    hardcode_libdir_separator_CXX \
+    hardcode_automatic_CXX \
+    module_cmds_CXX \
+    module_expsym_cmds_CXX \
+    lt_cv_prog_compiler_c_o_CXX \
+    exclude_expsyms_CXX \
+    include_expsyms_CXX; do
+
+    case $var in
+    old_archive_cmds_CXX | \
+    old_archive_from_new_cmds_CXX | \
+    archive_cmds_CXX | \
+    archive_expsym_cmds_CXX | \
+    module_cmds_CXX | \
+    module_expsym_cmds_CXX | \
+    old_archive_from_expsyms_cmds_CXX | \
+    export_symbols_cmds_CXX | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+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
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      F77)
+	if test -n "$F77" && test "X$F77" != "Xno"; then
+	  
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+compiler_F77=$CC
+for cc_temp in $compiler""; 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-%%"`
+
+
+{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6; }
+
+{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
+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
+  ;;
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+esac
+{ echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6; }
+
+{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+{ echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6; }
+
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+GCC_F77="$G77"
+LD_F77="$LD"
+
+lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+ 
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_F77='-Wl,'
+    lt_prog_compiler_static_F77='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_F77='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_F77=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_F77=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic_F77='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_F77='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      else
+	lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic_F77='-qnocommon'
+         lt_prog_compiler_wl_F77='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_F77='-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_prog_compiler_pic_F77='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-KPIC'
+	lt_prog_compiler_static_F77='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-fpic'
+	lt_prog_compiler_static_F77='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_F77='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_F77='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic_F77='-Kpic'
+      lt_prog_compiler_static_F77='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl_F77='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl_F77='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_F77='-Qoption ld '
+      lt_prog_compiler_pic_F77='-PIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_F77='-Kconform_pic'
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_F77='-pic'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+  
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_F77=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_F77"
+   # 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\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_F77=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; }
+
+if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+    case $lt_prog_compiler_pic_F77 in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+     esac
+else
+    lt_prog_compiler_pic_F77=
+     lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_F77=
+    ;;
+  *)
+    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_F77=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_F77=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  runpath_var=
+  allow_undefined_flag_F77=
+  enable_shared_with_static_runtimes_F77=no
+  archive_cmds_F77=
+  archive_expsym_cmds_F77=
+  old_archive_From_new_cmds_F77=
+  old_archive_from_expsyms_cmds_F77=
+  export_dynamic_flag_spec_F77=
+  whole_archive_flag_spec_F77=
+  thread_safe_flag_spec_F77=
+  hardcode_libdir_flag_spec_F77=
+  hardcode_libdir_flag_spec_ld_F77=
+  hardcode_libdir_separator_F77=
+  hardcode_direct_F77=no
+  hardcode_minus_L_F77=no
+  hardcode_shlibpath_var_F77=unsupported
+  link_all_deplibs_F77=unknown
+  hardcode_automatic_F77=no
+  module_cmds_F77=
+  module_expsym_cmds_F77=
+  always_export_symbols_F77=no
+  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_F77=
+  # 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'.
+  exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; 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-%%"`
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_F77=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
+    hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_F77='${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
+	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_F77=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` 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
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_F77=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$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)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_F77=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_F77=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=no
+      enable_shared_with_static_runtimes_F77=yes
+      export_symbols_cmds_F77='$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
+        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_F77='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec_F77='${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
+	  whole_archive_flag_spec_F77='${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' ;;
+	esac
+	archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_F77=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_F77" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_F77=
+      export_dynamic_flag_spec_F77=
+      whole_archive_flag_spec_F77=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=yes
+      archive_expsym_cmds_F77='$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.
+      hardcode_minus_L_F77=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_F77=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_F77='$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].*|aix5*)
+	  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.
+
+      archive_cmds_F77=''
+      hardcode_direct_F77=yes
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+
+      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
+  	  hardcode_direct_F77=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct_F77=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
+  	  hardcode_minus_L_F77=yes
+  	  hardcode_libdir_flag_spec_F77='-L$libdir'
+  	  hardcode_libdir_separator_F77=
+	  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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_F77=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.
+	allow_undefined_flag_F77='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_F77="-z nodefs"
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec_F77='${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.
+	  no_undefined_flag_F77=' ${wl}-bernotok'
+	  allow_undefined_flag_F77=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols_F77=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec_F77=' '
+	  archive_cmds_need_lc_F77=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$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)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_F77=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_F77=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec_F77=' '
+      allow_undefined_flag_F77=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.
+      archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_F77='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_F77=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc_F77=no
+      hardcode_direct_F77=no
+      hardcode_automatic_F77=yes
+      hardcode_shlibpath_var_F77=unsupported
+      whole_archive_flag_spec_F77=''
+      link_all_deplibs_F77=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_F77=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_F77=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*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$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
+	archive_cmds_F77='$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
+      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_direct_F77=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_F77=yes
+      export_dynamic_flag_spec_F77='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$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*|ia64*)
+	  archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+	  hardcode_libdir_separator_F77=:
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec_F77='-L$libdir'
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_F77=:
+	  hardcode_direct_F77=yes
+	  export_dynamic_flag_spec_F77='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      link_all_deplibs_F77=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    newsos6)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_F77='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec_F77='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      allow_undefined_flag_F77=unsupported
+      archive_cmds_F77='$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'
+      old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag_F77=' -z text'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	wlarc=''
+	archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds_F77='$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'
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_shlibpath_var_F77=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
+      esac
+      link_all_deplibs_F77=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.
+	archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_F77='$CC -r -o $output$reload_objs'
+	  hardcode_direct_F77=no
+        ;;
+	motorola)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_F77=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_F77=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_F77='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag_F77=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_F77='$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'
+      hardcode_libdir_flag_spec_F77=
+      hardcode_shlibpath_var_F77=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      ld_shlibs_F77=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+echo "${ECHO_T}$ld_shlibs_F77" >&6; }
+test "$ld_shlibs_F77" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_F77=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_F77 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_F77
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+        allow_undefined_flag_F77=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_F77=no
+        else
+	  archive_cmds_need_lc_F77=yes
+        fi
+        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;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'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" || \
+   test -n "$runpath_var_F77" || \
+   test "X$hardcode_automatic_F77" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_F77" != 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_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+     test "$hardcode_minus_L_F77" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_F77=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_F77=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_F77=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+echo "${ECHO_T}$hardcode_action_F77" >&6; }
+
+if test "$hardcode_action_F77" = relink; 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
+
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
+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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+fi
+
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_F77 \
+    CC_F77 \
+    LD_F77 \
+    lt_prog_compiler_wl_F77 \
+    lt_prog_compiler_pic_F77 \
+    lt_prog_compiler_static_F77 \
+    lt_prog_compiler_no_builtin_flag_F77 \
+    export_dynamic_flag_spec_F77 \
+    thread_safe_flag_spec_F77 \
+    whole_archive_flag_spec_F77 \
+    enable_shared_with_static_runtimes_F77 \
+    old_archive_cmds_F77 \
+    old_archive_from_new_cmds_F77 \
+    predep_objects_F77 \
+    postdep_objects_F77 \
+    predeps_F77 \
+    postdeps_F77 \
+    compiler_lib_search_path_F77 \
+    archive_cmds_F77 \
+    archive_expsym_cmds_F77 \
+    postinstall_cmds_F77 \
+    postuninstall_cmds_F77 \
+    old_archive_from_expsyms_cmds_F77 \
+    allow_undefined_flag_F77 \
+    no_undefined_flag_F77 \
+    export_symbols_cmds_F77 \
+    hardcode_libdir_flag_spec_F77 \
+    hardcode_libdir_flag_spec_ld_F77 \
+    hardcode_libdir_separator_F77 \
+    hardcode_automatic_F77 \
+    module_cmds_F77 \
+    module_expsym_cmds_F77 \
+    lt_cv_prog_compiler_c_o_F77 \
+    exclude_expsyms_F77 \
+    include_expsyms_F77; do
+
+    case $var in
+    old_archive_cmds_F77 | \
+    old_archive_from_new_cmds_F77 | \
+    archive_cmds_F77 | \
+    archive_expsym_cmds_F77 | \
+    module_cmds_F77 | \
+    module_expsym_cmds_F77 | \
+    old_archive_from_expsyms_cmds_F77 | \
+    export_symbols_cmds_F77 | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_F77
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_F77
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_F77
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_F77"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      GCJ)
+	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+	  
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+objext_GCJ=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+compiler_GCJ=$CC
+for cc_temp in $compiler""; 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-%%"`
+
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+archive_cmds_need_lc_GCJ=no
+
+old_archive_cmds_GCJ=$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...
+
+lt_prog_compiler_no_builtin_flag_GCJ=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+
+  
+{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # 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\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl_GCJ=
+lt_prog_compiler_pic_GCJ=
+lt_prog_compiler_static_GCJ=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+ 
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_GCJ='-Wl,'
+    lt_prog_compiler_static_GCJ='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_GCJ='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_GCJ=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_GCJ=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic_GCJ='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_GCJ='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      else
+	lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic_GCJ='-qnocommon'
+         lt_prog_compiler_wl_GCJ='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_GCJ='-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_prog_compiler_pic_GCJ='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+	lt_prog_compiler_wl_GCJ='-Wl,'
+	lt_prog_compiler_pic_GCJ='-KPIC'
+	lt_prog_compiler_static_GCJ='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl_GCJ='-Wl,'
+	lt_prog_compiler_pic_GCJ='-fpic'
+	lt_prog_compiler_static_GCJ='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_GCJ='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_GCJ='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic_GCJ='-Kpic'
+      lt_prog_compiler_static_GCJ='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl_GCJ='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl_GCJ='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_GCJ='-Qoption ld '
+      lt_prog_compiler_pic_GCJ='-PIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_GCJ='-Kconform_pic'
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_GCJ='-pic'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_GCJ"; then
+  
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_GCJ=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
+   # 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\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_GCJ=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; }
+
+if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+    case $lt_prog_compiler_pic_GCJ in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
+     esac
+else
+    lt_prog_compiler_pic_GCJ=
+     lt_prog_compiler_can_build_shared_GCJ=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_GCJ=
+    ;;
+  *)
+    lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_GCJ=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_GCJ=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  runpath_var=
+  allow_undefined_flag_GCJ=
+  enable_shared_with_static_runtimes_GCJ=no
+  archive_cmds_GCJ=
+  archive_expsym_cmds_GCJ=
+  old_archive_From_new_cmds_GCJ=
+  old_archive_from_expsyms_cmds_GCJ=
+  export_dynamic_flag_spec_GCJ=
+  whole_archive_flag_spec_GCJ=
+  thread_safe_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_ld_GCJ=
+  hardcode_libdir_separator_GCJ=
+  hardcode_direct_GCJ=no
+  hardcode_minus_L_GCJ=no
+  hardcode_shlibpath_var_GCJ=unsupported
+  link_all_deplibs_GCJ=unknown
+  hardcode_automatic_GCJ=no
+  module_cmds_GCJ=
+  module_expsym_cmds_GCJ=
+  always_export_symbols_GCJ=no
+  export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_GCJ=
+  # 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'.
+  exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; 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-%%"`
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_GCJ=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
+    hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_GCJ='${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
+	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_GCJ=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` 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
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_GCJ=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$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)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_GCJ=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_GCJ=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=no
+      enable_shared_with_static_runtimes_GCJ=yes
+      export_symbols_cmds_GCJ='$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
+        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_GCJ='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec_GCJ='${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
+	  whole_archive_flag_spec_GCJ='${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' ;;
+	esac
+	archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_GCJ=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_GCJ" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_GCJ=
+      export_dynamic_flag_spec_GCJ=
+      whole_archive_flag_spec_GCJ=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=yes
+      archive_expsym_cmds_GCJ='$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.
+      hardcode_minus_L_GCJ=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_GCJ=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_GCJ='$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].*|aix5*)
+	  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.
+
+      archive_cmds_GCJ=''
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_separator_GCJ=':'
+      link_all_deplibs_GCJ=yes
+
+      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
+  	  hardcode_direct_GCJ=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct_GCJ=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
+  	  hardcode_minus_L_GCJ=yes
+  	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
+  	  hardcode_libdir_separator_GCJ=
+	  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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_GCJ=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.
+	allow_undefined_flag_GCJ='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_GCJ="-z nodefs"
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec_GCJ='${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.
+	  no_undefined_flag_GCJ=' ${wl}-bernotok'
+	  allow_undefined_flag_GCJ=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols_GCJ=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec_GCJ=' '
+	  archive_cmds_need_lc_GCJ=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$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)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_GCJ=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_GCJ=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec_GCJ=' '
+      allow_undefined_flag_GCJ=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.
+      archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_GCJ='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_GCJ=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc_GCJ=no
+      hardcode_direct_GCJ=no
+      hardcode_automatic_GCJ=yes
+      hardcode_shlibpath_var_GCJ=unsupported
+      whole_archive_flag_spec_GCJ=''
+      link_all_deplibs_GCJ=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_GCJ=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_GCJ=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*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$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
+	archive_cmds_GCJ='$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
+      hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_direct_GCJ=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_GCJ=yes
+      export_dynamic_flag_spec_GCJ='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_GCJ='$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*|ia64*)
+	  archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
+	  hardcode_libdir_separator_GCJ=:
+	  hardcode_direct_GCJ=no
+	  hardcode_shlibpath_var_GCJ=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
+	  hardcode_direct_GCJ=no
+	  hardcode_shlibpath_var_GCJ=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_GCJ=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_GCJ=:
+	  hardcode_direct_GCJ=yes
+	  export_dynamic_flag_spec_GCJ='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_GCJ=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      link_all_deplibs_GCJ=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    newsos6)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_GCJ='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec_GCJ='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      allow_undefined_flag_GCJ=unsupported
+      archive_cmds_GCJ='$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'
+      old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_GCJ=' -expect_unresolved \*'
+	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_GCJ=' -expect_unresolved \*'
+	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag_GCJ=' -z text'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	wlarc=''
+	archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds_GCJ='$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'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
+      esac
+      link_all_deplibs_GCJ=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.
+	archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_GCJ=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_GCJ='$CC -r -o $output$reload_objs'
+	  hardcode_direct_GCJ=no
+        ;;
+	motorola)
+	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_GCJ=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_GCJ=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=no
+      hardcode_shlibpath_var_GCJ=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_GCJ='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag_GCJ=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_GCJ='$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'
+      hardcode_libdir_flag_spec_GCJ=
+      hardcode_shlibpath_var_GCJ=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    *)
+      ld_shlibs_GCJ=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+echo "${ECHO_T}$ld_shlibs_GCJ" >&6; }
+test "$ld_shlibs_GCJ" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_GCJ" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_GCJ=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_GCJ 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_GCJ
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
+        allow_undefined_flag_GCJ=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_GCJ=no
+        else
+	  archive_cmds_need_lc_GCJ=yes
+        fi
+        allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;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'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action_GCJ=
+if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+   test -n "$runpath_var_GCJ" || \
+   test "X$hardcode_automatic_GCJ" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_GCJ" != 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_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
+     test "$hardcode_minus_L_GCJ" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_GCJ=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_GCJ=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_GCJ=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+echo "${ECHO_T}$hardcode_action_GCJ" >&6; }
+
+if test "$hardcode_action_GCJ" = relink; 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
+
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
+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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+fi
+
+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*)
+    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
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    
+fi
+
+   ;;
+
+  *)
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_svld_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_dld_link=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+	      
+fi
+
+	    
+fi
+
+	  
+fi
+
+	
+fi
+
+      
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+    
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+      
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
+    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
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_GCJ \
+    CC_GCJ \
+    LD_GCJ \
+    lt_prog_compiler_wl_GCJ \
+    lt_prog_compiler_pic_GCJ \
+    lt_prog_compiler_static_GCJ \
+    lt_prog_compiler_no_builtin_flag_GCJ \
+    export_dynamic_flag_spec_GCJ \
+    thread_safe_flag_spec_GCJ \
+    whole_archive_flag_spec_GCJ \
+    enable_shared_with_static_runtimes_GCJ \
+    old_archive_cmds_GCJ \
+    old_archive_from_new_cmds_GCJ \
+    predep_objects_GCJ \
+    postdep_objects_GCJ \
+    predeps_GCJ \
+    postdeps_GCJ \
+    compiler_lib_search_path_GCJ \
+    archive_cmds_GCJ \
+    archive_expsym_cmds_GCJ \
+    postinstall_cmds_GCJ \
+    postuninstall_cmds_GCJ \
+    old_archive_from_expsyms_cmds_GCJ \
+    allow_undefined_flag_GCJ \
+    no_undefined_flag_GCJ \
+    export_symbols_cmds_GCJ \
+    hardcode_libdir_flag_spec_GCJ \
+    hardcode_libdir_flag_spec_ld_GCJ \
+    hardcode_libdir_separator_GCJ \
+    hardcode_automatic_GCJ \
+    module_cmds_GCJ \
+    module_expsym_cmds_GCJ \
+    lt_cv_prog_compiler_c_o_GCJ \
+    exclude_expsyms_GCJ \
+    include_expsyms_GCJ; do
+
+    case $var in
+    old_archive_cmds_GCJ | \
+    old_archive_from_new_cmds_GCJ | \
+    archive_cmds_GCJ | \
+    archive_expsym_cmds_GCJ | \
+    module_cmds_GCJ | \
+    module_expsym_cmds_GCJ | \
+    old_archive_from_expsyms_cmds_GCJ | \
+    export_symbols_cmds_GCJ | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_GCJ
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_GCJ
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_GCJ
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_GCJ
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_GCJ
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_GCJ
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_GCJ
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_GCJ
+archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_GCJ
+module_expsym_cmds=$lt_module_expsym_cmds_GCJ
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_GCJ
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_GCJ
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_GCJ
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_GCJ
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_GCJ
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_GCJ
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_GCJ
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_GCJ
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_GCJ
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_GCJ"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_GCJ
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_GCJ
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_GCJ
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_GCJ
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      RC)
+	
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+objext_RC=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# 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.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+compiler_RC=$CC
+for cc_temp in $compiler""; 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_cv_prog_compiler_c_o_RC=yes
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_RC \
+    CC_RC \
+    LD_RC \
+    lt_prog_compiler_wl_RC \
+    lt_prog_compiler_pic_RC \
+    lt_prog_compiler_static_RC \
+    lt_prog_compiler_no_builtin_flag_RC \
+    export_dynamic_flag_spec_RC \
+    thread_safe_flag_spec_RC \
+    whole_archive_flag_spec_RC \
+    enable_shared_with_static_runtimes_RC \
+    old_archive_cmds_RC \
+    old_archive_from_new_cmds_RC \
+    predep_objects_RC \
+    postdep_objects_RC \
+    predeps_RC \
+    postdeps_RC \
+    compiler_lib_search_path_RC \
+    archive_cmds_RC \
+    archive_expsym_cmds_RC \
+    postinstall_cmds_RC \
+    postuninstall_cmds_RC \
+    old_archive_from_expsyms_cmds_RC \
+    allow_undefined_flag_RC \
+    no_undefined_flag_RC \
+    export_symbols_cmds_RC \
+    hardcode_libdir_flag_spec_RC \
+    hardcode_libdir_flag_spec_ld_RC \
+    hardcode_libdir_separator_RC \
+    hardcode_automatic_RC \
+    module_cmds_RC \
+    module_expsym_cmds_RC \
+    lt_cv_prog_compiler_c_o_RC \
+    exclude_expsyms_RC \
+    include_expsyms_RC; do
+
+    case $var in
+    old_archive_cmds_RC | \
+    old_archive_from_new_cmds_RC | \
+    archive_cmds_RC | \
+    archive_expsym_cmds_RC | \
+    module_cmds_RC | \
+    module_expsym_cmds_RC | \
+    old_archive_from_expsyms_cmds_RC | \
+    export_symbols_cmds_RC | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_RC
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_RC
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_RC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_RC
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_RC
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_RC
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_RC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_RC
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_RC
+archive_expsym_cmds=$lt_archive_expsym_cmds_RC
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_RC
+module_expsym_cmds=$lt_module_expsym_cmds_RC
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_RC
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_RC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_RC
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_RC
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_RC
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_RC
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_RC
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_RC
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_RC
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_RC
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_RC"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_RC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_RC
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_RC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_RC
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	;;
+
+      *)
+	{ { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
+echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+	;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
+echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Prevent multiple expansion
+
+
+
+
+
+
+
+
+
+
+
+  
+
+  
+
+
+  
+       
+       
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# 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
+  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
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+for cc_temp in $compiler""; 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-%%"`
+
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+  lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+  
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+else
+  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_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
+    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_CXX='${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
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_CXX=
+    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.
+    archive_cmds_CXX='$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
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+ld_shlibs_CXX=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  aix4* | aix5*)
+    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].*|aix5*)
+	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.
+
+    archive_cmds_CXX=''
+    hardcode_direct_CXX=yes
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+
+    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
+	  hardcode_direct_CXX=yes
+	else
+	  # We have old collect2
+	  hardcode_direct_CXX=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
+	  hardcode_minus_L_CXX=yes
+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
+	  hardcode_libdir_separator_CXX=
+	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
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    always_export_symbols_CXX=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.
+      allow_undefined_flag_CXX='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+	allow_undefined_flag_CXX="-z nodefs"
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	hardcode_libdir_flag_spec_CXX='${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.
+	no_undefined_flag_CXX=' ${wl}-bernotok'
+	allow_undefined_flag_CXX=' ${wl}-berok'
+	# -bexpall does not export symbols beginning with underscore (_)
+	always_export_symbols_CXX=yes
+	# Exported symbols can be pulled into shared objects from archives
+	whole_archive_flag_spec_CXX=' '
+	archive_cmds_need_lc_CXX=yes
+	# This is similar to how AIX traditionally builds its shared libraries.
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+    # as there is no search path for DLLs.
+    hardcode_libdir_flag_spec_CXX='-L$libdir'
+    allow_undefined_flag_CXX=unsupported
+    always_export_symbols_CXX=no
+    enable_shared_with_static_runtimes_CXX=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      archive_expsym_cmds_CXX='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}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+  ;;
+      darwin* | rhapsody*)
+        case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      archive_cmds_need_lc_CXX=no
+      hardcode_direct_CXX=no
+      hardcode_automatic_CXX=yes
+      hardcode_shlibpath_var_CXX=unsupported
+      whole_archive_flag_spec_CXX=''
+      link_all_deplibs_CXX=yes
+
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      else
+          archive_cmds_CXX='$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'
+        fi
+        module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_CXX=no
+          ;;
+      esac
+      fi
+        ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      ghcx*)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  freebsd[12]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    ld_shlibs_CXX=no
+    ;;
+  freebsd-elf*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  freebsd* | kfreebsd*-gnu | dragonfly*)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    ld_shlibs_CXX=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    hardcode_direct_CXX=yes
+    hardcode_minus_L_CXX=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
+      ld_shlibs_CXX=no
+      ;;
+    aCC*)
+      archive_cmds_CXX='$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) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        archive_cmds_CXX='$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
+        ld_shlibs_CXX=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case $host_cpu in
+      hppa*64*)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+	hardcode_libdir_separator_CXX=:
+        ;;
+      ia64*)
+	hardcode_libdir_flag_spec_CXX='-L$libdir'
+        ;;
+      *)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+	export_dynamic_flag_spec_CXX='${wl}-E'
+        ;;
+      esac
+    fi
+    case $host_cpu in
+    hppa*64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      ;;
+    ia64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      hardcode_minus_L_CXX=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    *)
+      hardcode_direct_CXX=yes
+      hardcode_minus_L_CXX=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
+	ld_shlibs_CXX=no
+	;;
+      aCC*)
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  archive_cmds_CXX='$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 $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case $host_cpu in
+	    ia64*|hppa*64*)
+	      archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	      ;;
+	    *)
+	      archive_cmds_CXX='$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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC*)
+	# SGI C++
+	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -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.
+	old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test "$with_gnu_ld" = no; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	  else
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	link_all_deplibs_CXX=yes
+	;;
+    esac
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    ;;
+  linux*)
+    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.
+	archive_cmds_CXX='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'
+	archive_expsym_cmds_CXX='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 $list'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc*)
+	# 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."*)
+  	  archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+  	  archive_expsym_cmds_CXX='$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
+  	  archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  ;;
+	esac
+	archive_cmds_need_lc_CXX=no
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      pgCC*)
+        # Portland Group C++ compiler
+	archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+  	archive_expsym_cmds_CXX='$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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${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++
+	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_CXX='$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
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      hardcode_libdir_flag_spec_CXX='-R$libdir'
+      hardcode_direct_CXX=yes
+      hardcode_shlibpath_var_CXX=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::"'
+    ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    ld_shlibs_CXX=no
+    ;;
+  openbsd*)
+    hardcode_direct_CXX=yes
+    hardcode_shlibpath_var_CXX=no
+    archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+      export_dynamic_flag_spec_CXX='${wl}-E'
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
+  osf3*)
+    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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx*)
+	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx*)
+	allow_undefined_flag_CXX=' -expect_unresolved \*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_CXX='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 -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	 archive_cmds_CXX='$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` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  sco*)
+    archive_cmds_need_lc_CXX=no
+    case $cc_basename in
+      CC*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      lcc*)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.2, 5.x and Centerline C++
+        archive_cmds_need_lc_CXX=yes
+	no_undefined_flag_CXX=' -zdefs'
+	archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	archive_expsym_cmds_CXX='$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'
+
+	hardcode_libdir_flag_spec_CXX='-R$libdir'
+	hardcode_shlibpath_var_CXX=no
+	case $host_os in
+	  solaris2.[0-5] | solaris2.[0-5].*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker. We must also pass each convience library through
+	    # to the system linker between allextract/defaultextract.
+	    # The C++ compiler will combine linker options so we
+	    # cannot just pass the convience library names through
+	    # without $wl.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	link_all_deplibs_CXX=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.
+	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx*)
+	# Green Hills C++ Compiler
+	archive_cmds_CXX='$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.
+	old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	;;
+      *)
+	# GNU C++ compiler with Solaris linker
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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.
+	    archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC*)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+esac
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$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...
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+  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 "$compiler_lib_search_path_CXX"; then
+	     compiler_lib_search_path_CXX="${prev}${p}"
+	   else
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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 "$postdeps_CXX"; then
+	   postdeps_CXX="${prev}${p}"
+	 else
+	   postdeps_CXX="${postdeps_CXX} ${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 "$predep_objects_CXX"; then
+	   predep_objects_CXX="$p"
+	 else
+	   predep_objects_CXX="$predep_objects_CXX $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_CXX"; then
+	   postdep_objects_CXX="$p"
+	 else
+	   postdep_objects_CXX="$postdep_objects_CXX $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+solaris*)
+  case $cc_basename in
+  CC*)
+    # 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.
+    postdeps_CXX='-lCstd -lCrun'
+    ;;
+  esac
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+ 
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # 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_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # 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).
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # 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*)
+	;;
+      *)
+	lt_prog_compiler_pic_CXX='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  lt_prog_compiler_static_CXX='-Bstatic'
+	else
+	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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
+	;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           lt_prog_compiler_pic_CXX='-qnocommon'
+           lt_prog_compiler_wl_CXX='-Wl,'
+           ;;
+         esac
+       ;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    if test "$host_cpu" != ia64; then
+	      lt_prog_compiler_pic_CXX='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      lt_prog_compiler_pic_CXX='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  icpc* | ecpc*)
+	    # Intel C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  pgCC*)
+	    # Portland Group C++ compiler.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fpic'
+	    lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    lt_prog_compiler_pic_CXX='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      sco*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    lt_prog_compiler_wl_CXX='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    lt_prog_compiler_pic_CXX='-pic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      unixware*)
+	;;
+      vxworks*)
+	;;
+      *)
+	lt_prog_compiler_can_build_shared_CXX=no
+	;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+  
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_CXX=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   # 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\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; }
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # 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
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    export_symbols_cmds_CXX='$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'
+  ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_CXX
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+        allow_undefined_flag_CXX=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_CXX=no
+        else
+	  archive_cmds_need_lc_CXX=yes
+        fi
+        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;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'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+   test -n "$runpath_var_CXX" || \
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_CXX" != 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_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6; }
+
+if test "$hardcode_action_CXX" = relink; 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
+
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
+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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+fi
+
+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*)
+    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
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    
+fi
+
+   ;;
+
+  *)
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_svld_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_dld_link=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+	      
+fi
+
+	    
+fi
+
+	  
+fi
+
+	
+fi
+
+      
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+    
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+      
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
+    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
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_CXX \
+    CC_CXX \
+    LD_CXX \
+    lt_prog_compiler_wl_CXX \
+    lt_prog_compiler_pic_CXX \
+    lt_prog_compiler_static_CXX \
+    lt_prog_compiler_no_builtin_flag_CXX \
+    export_dynamic_flag_spec_CXX \
+    thread_safe_flag_spec_CXX \
+    whole_archive_flag_spec_CXX \
+    enable_shared_with_static_runtimes_CXX \
+    old_archive_cmds_CXX \
+    old_archive_from_new_cmds_CXX \
+    predep_objects_CXX \
+    postdep_objects_CXX \
+    predeps_CXX \
+    postdeps_CXX \
+    compiler_lib_search_path_CXX \
+    archive_cmds_CXX \
+    archive_expsym_cmds_CXX \
+    postinstall_cmds_CXX \
+    postuninstall_cmds_CXX \
+    old_archive_from_expsyms_cmds_CXX \
+    allow_undefined_flag_CXX \
+    no_undefined_flag_CXX \
+    export_symbols_cmds_CXX \
+    hardcode_libdir_flag_spec_CXX \
+    hardcode_libdir_flag_spec_ld_CXX \
+    hardcode_libdir_separator_CXX \
+    hardcode_automatic_CXX \
+    module_cmds_CXX \
+    module_expsym_cmds_CXX \
+    lt_cv_prog_compiler_c_o_CXX \
+    exclude_expsyms_CXX \
+    include_expsyms_CXX; do
+
+    case $var in
+    old_archive_cmds_CXX | \
+    old_archive_from_new_cmds_CXX | \
+    archive_cmds_CXX | \
+    archive_expsym_cmds_CXX | \
+    module_cmds_CXX | \
+    module_expsym_cmds_CXX | \
+    old_archive_from_expsyms_cmds_CXX | \
+    export_symbols_cmds_CXX | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+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
+
+
+# OGRE_CFLAGS contains the compiler flags crucial for stand-alone client
+# programs. They are exported via pkg-config, but not used while building
+# Ogre itself; instead, they are defined in config.h.
+
+
+# Check if compiler supports symbol visibility
+# There are quirks for x86_64 and debug builds with gcc < 4.2
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+{ echo "$as_me:$LINENO: checking if $CXX supports -fvisibility" >&5
+echo $ECHO_N "checking if $CXX supports -fvisibility... $ECHO_C" >&6; }
+if test "${ogre_prog_compiler_supports_visibility+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ogre_prog_compiler_supports_visibility=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fvisibility=hidden -fvisibility-inlines-hidden"
+   # 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\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       ogre_prog_compiler_supports_visibility=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $ogre_prog_compiler_supports_visibility" >&5
+echo "${ECHO_T}$ogre_prog_compiler_supports_visibility" >&6; }
+
+if test x"$ogre_prog_compiler_supports_visibility" = xyes; then
+    CFLAGS_VISIBILITY="-fvisibility=hidden -fvisibility-inlines-hidden -DOGRE_GCC_VISIBILITY";
+    case $target_cpu in
+        x86_64* )
+            if ! echo "$CFLAGS $CXXFLAGS" | grep -q "\-O"; then
+                echo "***********************************************************************"
+                echo "WARNING: It looks like you're doing a debug build for an x86_64 target."
+                echo "The -fvisibility-inlines-hidden flag is known to give problems in such"
+                echo "situations with libstdc++ < 4.2. Disabling the compiler flag."
+                echo "***********************************************************************"
+                CFLAGS_VISIBILITY="-fvisibility=hidden -DOGRE_GCC_VISIBILITY"
+            fi
+        ;;
+    esac
+    case $CXX in
+        icpc )
+            echo "***********************************************************************"
+            echo "WARNING: The intel compiler currently has bugs in its -fvisibility"
+            echo "implementation. Disabling the compiler flag."
+            echo "***********************************************************************"
+            CFLAGS_VISIBILITY=""
+        ;;
+    esac
+    
+else
+    :
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# Check whether --with-stlport was given.
+if test "${with_stlport+set}" = set; then
+  withval=$with_stlport; ac_cv_use_stlport=$withval
+else
+  ac_cv_use_stlport=no
+fi
+
+ { echo "$as_me:$LINENO: checking whether to use STLPort" >&5
+echo $ECHO_N "checking whether to use STLPort... $ECHO_C" >&6; }
+if test "${ac_cv_use_stlport+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_use_stlport=no
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_use_stlport" >&5
+echo "${ECHO_T}$ac_cv_use_stlport" >&6; }
+ if test x$ac_cv_use_stlport != xno; then
+     STLPORT_CFLAGS="-I$ac_cv_use_stlport/stlport"
+     STLPORT_LIBS="-L$ac_cv_use_stlport/lib -lstlport"
+ fi
+ 
+ 
+
+
+# Check whether --with-ft-prefix was given.
+if test "${with_ft_prefix+set}" = set; then
+  withval=$with_ft_prefix; ft_config_prefix="$withval"
+else
+  ft_config_prefix=""
+fi
+
+
+# Check whether --with-ft-exec-prefix was given.
+if test "${with_ft_exec_prefix+set}" = set; then
+  withval=$with_ft_exec_prefix; ft_config_exec_prefix="$withval"
+else
+  ft_config_exec_prefix=""
+fi
+
+# Check whether --enable-freetypetest was given.
+if test "${enable_freetypetest+set}" = set; then
+  enableval=$enable_freetypetest; 
+else
+  enable_fttest=yes
+fi
+
+
+if test x$ft_config_exec_prefix != x ; then
+  ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
+  if test x${FT2_CONFIG+set} != xset ; then
+    FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
+  fi
+fi
+if test x$ft_config_prefix != x ; then
+  ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
+  if test x${FT2_CONFIG+set} != xset ; then
+    FT2_CONFIG=$ft_config_prefix/bin/freetype-config
+  fi
+fi
+# Extract the first word of "freetype-config", so it can be a program name with args.
+set dummy freetype-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_FT2_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $FT2_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_FT2_CONFIG="$FT2_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_FT2_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_FT2_CONFIG" && ac_cv_path_FT2_CONFIG="no"
+  ;;
+esac
+fi
+FT2_CONFIG=$ac_cv_path_FT2_CONFIG
+if test -n "$FT2_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $FT2_CONFIG" >&5
+echo "${ECHO_T}$FT2_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+
+min_ft_version=9.0.0
+{ echo "$as_me:$LINENO: checking for FreeType - version >= $min_ft_version" >&5
+echo $ECHO_N "checking for FreeType - version >= $min_ft_version... $ECHO_C" >&6; }
+no_ft=""
+if test "$FT2_CONFIG" = "no" ; then
+  no_ft=yes
+else
+  FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
+  FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
+  ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+  ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+  ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+  ft_min_major_version=`echo $min_ft_version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+  ft_min_minor_version=`echo $min_ft_version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+  ft_min_micro_version=`echo $min_ft_version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+  if test x$enable_fttest = xyes ; then
+    ft_config_is_lt=""
+    if test $ft_config_major_version -lt $ft_min_major_version ; then
+      ft_config_is_lt=yes
+    else
+      if test $ft_config_major_version -eq $ft_min_major_version ; then
+        if test $ft_config_minor_version -lt $ft_min_minor_version ; then
+          ft_config_is_lt=yes
+        else
+          if test $ft_config_minor_version -eq $ft_min_minor_version ; then
+            if test $ft_config_micro_version -lt $ft_min_micro_version ; then
+              ft_config_is_lt=yes
+            fi
+          fi
+        fi
+      fi
+    fi
+    if test x$ft_config_is_lt = xyes ; then
+      no_ft=yes
+    else
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $FT2_CFLAGS"
+      LIBS="$FT2_LIBS $LIBS"
+      if test "$cross_compiling" = yes; then
+  echo $ac_n "cross compiling; assumed OK... $ac_c"
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main()
+{
+  FT_Library library;
+  FT_Error error;
+
+  error = FT_Init_FreeType(&library);
+
+  if (error)
+    return 1;
+  else
+  {
+    FT_Done_FreeType(library);
+    return 0;
+  }
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+no_ft=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+      CFLAGS="$ac_save_CFLAGS"
+      LIBS="$ac_save_LIBS"
+    fi             # test $ft_config_version -lt $ft_min_version
+  fi               # test x$enable_fttest = xyes
+fi                 # test "$FT2_CONFIG" = "no"
+if test x$no_ft = x ; then
+   { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+   :
+else
+   { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+   if test "$FT2_CONFIG" = "no" ; then
+     echo "*** The freetype-config script installed by FreeType 2 could not be found."
+     echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in"
+     echo "*** your path, or set the FT2_CONFIG environment variable to the"
+     echo "*** full path to freetype-config."
+   else
+     if test x$ft_config_is_lt = xyes ; then
+       echo "*** Your installed version of the FreeType 2 library is too old."
+       echo "*** If you have different versions of FreeType 2, make sure that"
+       echo "*** correct values for --with-ft-prefix or --with-ft-exec-prefix"
+       echo "*** are used, or set the FT2_CONFIG environment variable to the"
+       echo "*** full path to freetype-config."
+     else
+       echo "*** The FreeType test program failed to run.  If your system uses"
+       echo "*** shared libraries and they are installed outside the normal"
+       echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
+       echo "*** (or whatever is appropiate for your system) is correctly set."
+     fi
+   fi
+   FT2_CFLAGS=""
+   FT2_LIBS=""
+   :
+fi
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBDL 1
+_ACEOF
+
+  LIBS="-ldl $LIBS"
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for pow in -lm" >&5
+echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6; }
+if test "${ac_cv_lib_m_pow+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pow ();
+int
+main ()
+{
+return pow ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_m_pow=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_m_pow=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5
+echo "${ECHO_T}$ac_cv_lib_m_pow" >&6; }
+if test $ac_cv_lib_m_pow = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for gzopen in -lz" >&5
+echo $ECHO_N "checking for gzopen in -lz... $ECHO_C" >&6; }
+if test "${ac_cv_lib_z_gzopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gzopen ();
+int
+main ()
+{
+return gzopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_z_gzopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_z_gzopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzopen" >&5
+echo "${ECHO_T}$ac_cv_lib_z_gzopen" >&6; }
+if test $ac_cv_lib_z_gzopen = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBZ 1
+_ACEOF
+
+  LIBS="-lz $LIBS"
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
+echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; }
+if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_pthread_pthread_create=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_pthread_pthread_create=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; }
+if test $ac_cv_lib_pthread_pthread_create = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBPTHREAD 1
+_ACEOF
+
+  LIBS="-lpthread $LIBS"
+
+fi
+
+{ echo "$as_me:$LINENO: checking for snprintf" >&5
+echo $ECHO_N "checking for snprintf... $ECHO_C" >&6; }
+if test "${ac_cv_func_snprintf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define snprintf to an innocuous variant, in case <limits.h> declares snprintf.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define snprintf innocuous_snprintf
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char snprintf (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef snprintf
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char snprintf ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_snprintf || defined __stub___snprintf
+choke me
+#endif
+
+int
+main ()
+{
+return snprintf ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_snprintf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_snprintf=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_snprintf" >&5
+echo "${ECHO_T}$ac_cv_func_snprintf" >&6; }
+if test $ac_cv_func_snprintf = yes; then
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_SNPRINTF 
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking for vsnprintf" >&5
+echo $ECHO_N "checking for vsnprintf... $ECHO_C" >&6; }
+if test "${ac_cv_func_vsnprintf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define vsnprintf to an innocuous variant, in case <limits.h> declares vsnprintf.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define vsnprintf innocuous_vsnprintf
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char vsnprintf (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef vsnprintf
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char vsnprintf ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_vsnprintf || defined __stub___vsnprintf
+choke me
+#endif
+
+int
+main ()
+{
+return vsnprintf ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_vsnprintf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_vsnprintf=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_vsnprintf" >&5
+echo "${ECHO_T}$ac_cv_func_vsnprintf" >&6; }
+if test $ac_cv_func_vsnprintf = yes; then
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_VSNPRINTF 
+_ACEOF
+
+fi
+
+
+
+
+
+
+# Check whether --with-cppunit-prefix was given.
+if test "${with_cppunit_prefix+set}" = set; then
+  withval=$with_cppunit_prefix; cppunit_config_prefix="$withval"
+else
+  cppunit_config_prefix=""
+fi
+
+
+# Check whether --with-cppunit-exec-prefix was given.
+if test "${with_cppunit_exec_prefix+set}" = set; then
+  withval=$with_cppunit_exec_prefix; cppunit_config_exec_prefix="$withval"
+else
+  cppunit_config_exec_prefix=""
+fi
+
+
+  if test x$cppunit_config_exec_prefix != x ; then
+     cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix"
+     if test x${CPPUNIT_CONFIG+set} != xset ; then
+        CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config
+     fi
+  fi
+  if test x$cppunit_config_prefix != x ; then
+     cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix"
+     if test x${CPPUNIT_CONFIG+set} != xset ; then
+        CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config
+     fi
+  fi
+
+  # Extract the first word of "cppunit-config", so it can be a program name with args.
+set dummy cppunit-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_CPPUNIT_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $CPPUNIT_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CPPUNIT_CONFIG="$CPPUNIT_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CPPUNIT_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_CPPUNIT_CONFIG" && ac_cv_path_CPPUNIT_CONFIG="no"
+  ;;
+esac
+fi
+CPPUNIT_CONFIG=$ac_cv_path_CPPUNIT_CONFIG
+if test -n "$CPPUNIT_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $CPPUNIT_CONFIG" >&5
+echo "${ECHO_T}$CPPUNIT_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  cppunit_version_min=1.10.0
+
+  { echo "$as_me:$LINENO: checking for Cppunit - version >= $cppunit_version_min" >&5
+echo $ECHO_N "checking for Cppunit - version >= $cppunit_version_min... $ECHO_C" >&6; }
+  no_cppunit=""
+  if test "$CPPUNIT_CONFIG" = "no" ; then
+    no_cppunit=yes
+  else
+    CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags`
+    CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs`
+    cppunit_version=`$CPPUNIT_CONFIG --version`
+
+    cppunit_major_version=`echo $cppunit_version | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+    cppunit_minor_version=`echo $cppunit_version | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+    cppunit_micro_version=`echo $cppunit_version | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+
+    cppunit_major_min=`echo $cppunit_version_min | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+    cppunit_minor_min=`echo $cppunit_version_min | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+    cppunit_micro_min=`echo $cppunit_version_min | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+
+    cppunit_version_proper=`expr \
+        $cppunit_major_version \> $cppunit_major_min \| \
+        $cppunit_major_version \= $cppunit_major_min \& \
+        $cppunit_minor_version \> $cppunit_minor_min \| \
+        $cppunit_major_version \= $cppunit_major_min \& \
+        $cppunit_minor_version \= $cppunit_minor_min \& \
+        $cppunit_micro_version \>= $cppunit_micro_min `
+
+    if test "$cppunit_version_proper" = "1" ; then
+      { echo "$as_me:$LINENO: result: $cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version" >&5
+echo "${ECHO_T}$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version" >&6; }
+    else
+      { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+      no_cppunit=yes
+    fi
+  fi
+
+  if test "x$no_cppunit" = x ; then
+     build_unit_tests=true     
+  else
+     CPPUNIT_CFLAGS=""
+     CPPUNIT_LIBS=""
+     :
+  fi
+
+  
+  
+
+ 
+
+if test x$build_unit_tests = xtrue; then
+  BUILD_UNIT_TESTS_TRUE=
+  BUILD_UNIT_TESTS_FALSE='#'
+else
+  BUILD_UNIT_TESTS_TRUE='#'
+  BUILD_UNIT_TESTS_FALSE=
+fi
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.9.0
+	{ echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; }
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	else
+		{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+		PKG_CONFIG=""
+	fi
+		
+fi
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for ZZIPLIB" >&5
+echo $ECHO_N "checking for ZZIPLIB... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$ZZIPLIB_CFLAGS"; then
+        pkg_cv_ZZIPLIB_CFLAGS="$ZZIPLIB_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"zziplib\"") >&5
+  ($PKG_CONFIG --exists --print-errors "zziplib") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_ZZIPLIB_CFLAGS=`$PKG_CONFIG --cflags "zziplib" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$ZZIPLIB_LIBS"; then
+        pkg_cv_ZZIPLIB_LIBS="$ZZIPLIB_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"zziplib\"") >&5
+  ($PKG_CONFIG --exists --print-errors "zziplib") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_ZZIPLIB_LIBS=`$PKG_CONFIG --libs "zziplib" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+        
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        ZZIPLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "zziplib"`
+        else 
+	        ZZIPLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "zziplib"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$ZZIPLIB_PKG_ERRORS" >&5
+
+	{ { echo "$as_me:$LINENO: error: Package requirements (zziplib) were not met:
+
+$ZZIPLIB_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables ZZIPLIB_CFLAGS
+and ZZIPLIB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&5
+echo "$as_me: error: Package requirements (zziplib) were not met:
+
+$ZZIPLIB_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables ZZIPLIB_CFLAGS
+and ZZIPLIB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&2;}
+   { (exit 1); exit 1; }; }
+elif test $pkg_failed = untried; then
+	{ { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables ZZIPLIB_CFLAGS
+and ZZIPLIB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&5
+echo "$as_me: error: The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables ZZIPLIB_CFLAGS
+and ZZIPLIB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+	ZZIPLIB_CFLAGS=$pkg_cv_ZZIPLIB_CFLAGS
+	ZZIPLIB_LIBS=$pkg_cv_ZZIPLIB_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	:
+fi
+
+
+
+OGRE_PLATFORM=GLX
+ 
+# Check whether --with-platform was given.
+if test "${with_platform+set}" = set; then
+  withval=$with_platform; OGRE_PLATFORM=$withval
+else
+  OGRE_PLATFORM=GLX
+fi
+
+
+  PLATFORM_CFLAGS=""
+  PLATFORM_LIBS=""
+
+    case $OGRE_PLATFORM in 
+    GLX)
+      
+for ac_header in X11/Intrinsic.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ 
+else
+  { { echo "$as_me:$LINENO: error: \"libxt headers not found\"" >&5
+echo "$as_me: error: \"libxt headers not found\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+      
+for ac_header in X11/Xaw/Command.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ 
+else
+  { { echo "$as_me:$LINENO: error: \"libxaw headers not found\"" >&5
+echo "$as_me: error: \"libxaw headers not found\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+      
+for ac_header in X11/extensions/xf86vmode.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ 
+else
+  { { echo "$as_me:$LINENO: error: \"libxf86vm headers not found\"" >&5
+echo "$as_me: error: \"libxf86vm headers not found\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+      
+for ac_header in X11/extensions/Xrandr.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ 
+else
+  { { echo "$as_me:$LINENO: error: \"libxrandr headers not found\"" >&5
+echo "$as_me: error: \"libxrandr headers not found\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+      { echo "$as_me:$LINENO: checking for X" >&5
+echo $ECHO_N "checking for X... $ECHO_C" >&6; }
+
+
+# Check whether --with-x was given.
+if test "${with_x+set}" = set; then
+  withval=$with_x; 
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  case $x_includes,$x_libraries in #(
+    *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5
+echo "$as_me: error: Cannot use X directory names containing '" >&2;}
+   { (exit 1); exit 1; }; };; #(
+    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -f -r conftest.dir
+if mkdir conftest.dir; then
+  cd conftest.dir
+  cat >Imakefile <<'_ACEOF'
+incroot:
+	@echo incroot='${INCROOT}'
+usrlibdir:
+	@echo usrlibdir='${USRLIBDIR}'
+libdir:
+	@echo libdir='${LIBDIR}'
+_ACEOF
+  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    for ac_var in incroot usrlibdir libdir; do
+      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+    done
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl; do
+      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
+	ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case $ac_im_incroot in
+	/usr/include) ac_x_includes= ;;
+	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+    esac
+    case $ac_im_usrlibdir in
+	/usr/lib | /lib) ;;
+	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+    esac
+  fi
+  cd ..
+  rm -f -r conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+  # Guess where to find include files, by looking for Xlib.h.
+  # First, try using that file with no special directory specified.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <X11/Xlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  for ac_dir in $ac_x_header_dirs; do
+  if test -r "$ac_dir/X11/Xlib.h"; then
+    ac_x_includes=$ac_dir
+    break
+  fi
+done
+fi
+
+rm -f conftest.err conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+  # Check for the libraries.
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS=$LIBS
+  LIBS="-lX11 $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize ()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS=$ac_save_LIBS
+for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+  # Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl; do
+    if test -r "$ac_dir/libX11.$ac_extension"; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+case $ac_x_includes,$ac_x_libraries in #(
+  no,* | *,no | *\'*)
+    # Didn't find X, or a directory has "'" in its name.
+    ac_cv_have_x="have_x=no";; #(
+  *)
+    # Record where we found X for the cache.
+    ac_cv_have_x="have_x=yes\
+	ac_x_includes='$ac_x_includes'\
+	ac_x_libraries='$ac_x_libraries'"
+esac
+fi
+;; #(
+    *) have_x=yes;;
+  esac
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  { echo "$as_me:$LINENO: result: $have_x" >&5
+echo "${ECHO_T}$have_x" >&6; }
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes\
+	ac_x_includes='$x_includes'\
+	ac_x_libraries='$x_libraries'"
+  { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; }
+fi
+
+      if test x"$x_includes" != x; then
+        if test x"$x_includes" != xNONE; then
+          PLATFORM_CFLAGS="-I$x_includes"
+        fi
+      fi
+      if test x"$x_libraries" != x; then
+        if test x"$x_libraries" != xNONE; then
+          PLATFORM_LIBS="-L$x_libraries -lX11 -lXaw"
+        fi
+            else
+        PLATFORM_LIBS="-lX11 -lXaw"
+      fi
+    ;;
+    Win32)
+      PLATFORM_CFLAGS=""
+      PLATFORM_LIBS="-lgdi32 -lwinmm -ldinput8 -ldxguid"
+    ;;
+  esac
+
+  
+  
+  
+
+OGRE_GLSUPPORT=none
+ 
+# Check whether --with-gl-support was given.
+if test "${with_gl_support+set}" = set; then
+  withval=$with_gl_support; OGRE_GLSUPPORT=$withval
+else
+  OGRE_GLSUPPORT=none
+fi
+
+
+  if test "$OGRE_GLSUPPORT" = "none" ; then
+    OGRE_GLSUPPORT="$OGRE_PLATFORM"
+    { echo "$as_me:$LINENO: setting gl-support to platform: $OGRE_GLSUPPORT" >&5
+echo "$as_me: setting gl-support to platform: $OGRE_GLSUPPORT" >&6;}
+  fi
+  if test "$OGRE_GLSUPPORT" = "Win32" ; then
+    # Uppercase/lowercase
+    OGRE_GLSUPPORT=win32
+  fi
+
+  GLSUPPORT_CFLAGS=""
+  GLSUPPORT_LIBS=""
+
+    case $OGRE_GLSUPPORT in 
+    GLX)
+        { echo "$as_me:$LINENO: checking for X" >&5
+echo $ECHO_N "checking for X... $ECHO_C" >&6; }
+
+
+# Check whether --with-x was given.
+if test "${with_x+set}" = set; then
+  withval=$with_x; 
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  case $x_includes,$x_libraries in #(
+    *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5
+echo "$as_me: error: Cannot use X directory names containing '" >&2;}
+   { (exit 1); exit 1; }; };; #(
+    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -f -r conftest.dir
+if mkdir conftest.dir; then
+  cd conftest.dir
+  cat >Imakefile <<'_ACEOF'
+incroot:
+	@echo incroot='${INCROOT}'
+usrlibdir:
+	@echo usrlibdir='${USRLIBDIR}'
+libdir:
+	@echo libdir='${LIBDIR}'
+_ACEOF
+  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    for ac_var in incroot usrlibdir libdir; do
+      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+    done
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl; do
+      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
+	ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case $ac_im_incroot in
+	/usr/include) ac_x_includes= ;;
+	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+    esac
+    case $ac_im_usrlibdir in
+	/usr/lib | /lib) ;;
+	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+    esac
+  fi
+  cd ..
+  rm -f -r conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+  # Guess where to find include files, by looking for Xlib.h.
+  # First, try using that file with no special directory specified.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <X11/Xlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  for ac_dir in $ac_x_header_dirs; do
+  if test -r "$ac_dir/X11/Xlib.h"; then
+    ac_x_includes=$ac_dir
+    break
+  fi
+done
+fi
+
+rm -f conftest.err conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+  # Check for the libraries.
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS=$LIBS
+  LIBS="-lX11 $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize ()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS=$ac_save_LIBS
+for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+  # Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl; do
+    if test -r "$ac_dir/libX11.$ac_extension"; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+case $ac_x_includes,$ac_x_libraries in #(
+  no,* | *,no | *\'*)
+    # Didn't find X, or a directory has "'" in its name.
+    ac_cv_have_x="have_x=no";; #(
+  *)
+    # Record where we found X for the cache.
+    ac_cv_have_x="have_x=yes\
+	ac_x_includes='$ac_x_includes'\
+	ac_x_libraries='$ac_x_libraries'"
+esac
+fi
+;; #(
+    *) have_x=yes;;
+  esac
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  { echo "$as_me:$LINENO: result: $have_x" >&5
+echo "${ECHO_T}$have_x" >&6; }
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes\
+	ac_x_includes='$x_includes'\
+	ac_x_libraries='$x_libraries'"
+  { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; }
+fi
+
+        if test x"$x_includes" != x; then
+          if test x"$x_includes" != xNONE; then
+            GLSUPPORT_CFLAGS="-I$x_includes"
+          fi
+        fi
+        if test x"$x_libraries" != x; then
+          if test x"$x_libraries" != xNONE; then
+            GLSUPPORT_LIBS="-L$x_libraries -lX11 -lXext -lGL -lXrandr -lXxf86vm"
+          fi
+                else
+          GLSUPPORT_LIBS="-lX11 -lXext -lGL -lXrandr -lXxf86vm"
+        fi
+    ;;
+    win32)
+	GLSUPPORT_CFLAGS=""
+	GLSUPPORT_LIBS="-lgdi32 -lwinmm"
+    ;;
+  esac
+
+  
+  
+  
+  ac_config_files="$ac_config_files RenderSystems/GL/src/GLX/Makefile RenderSystems/GL/src/win32/Makefile"
+
+
+
+
+    
+# Check whether --with-gui was given.
+if test "${with_gui+set}" = set; then
+  withval=$with_gui; with_gui=${withval}
+else
+  with_gui=auto
+fi
+
+
+    #remove any old files
+    rm -f OgreMain/src/OgreConfigDialog.lo OgreMain/src/OgreErrorDialog.lo
+
+    # Prefer win32, then gtk, then Xt
+    if test "x$with_gui" == "xauto" && test "x$OGRE_PLATFORM" == "xWIN32"; then
+        with_gui=win32
+    fi
+
+    if test "x$with_gui" == "xauto" || test "x$with_gui" == "xgtk"; then
+        
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for GTK" >&5
+echo $ECHO_N "checking for GTK... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$GTK_CFLAGS"; then
+        pkg_cv_GTK_CFLAGS="$GTK_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.0.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.0.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.0.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$GTK_LIBS"; then
+        pkg_cv_GTK_LIBS="$GTK_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.0.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.0.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_GTK_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= 2.0.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+        
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gtk+-2.0 >= 2.0.0"`
+        else 
+	        GTK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gtk+-2.0 >= 2.0.0"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$GTK_PKG_ERRORS" >&5
+
+	
+            if test "x$with_gui" == "xgtk"; then
+                { { echo "$as_me:$LINENO: error: You chose gtk for the GUI but gtk is not available." >&5
+echo "$as_me: error: You chose gtk for the GUI but gtk is not available." >&2;}
+   { (exit 1); exit 1; }; }
+            fi
+        
+elif test $pkg_failed = untried; then
+	
+            if test "x$with_gui" == "xgtk"; then
+                { { echo "$as_me:$LINENO: error: You chose gtk for the GUI but gtk is not available." >&5
+echo "$as_me: error: You chose gtk for the GUI but gtk is not available." >&2;}
+   { (exit 1); exit 1; }; }
+            fi
+        
+else
+	GTK_CFLAGS=$pkg_cv_GTK_CFLAGS
+	GTK_LIBS=$pkg_cv_GTK_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	with_gui=gtk
+fi
+    fi
+
+    if test "x$with_gui" == "xauto"; then
+        with_gui=Xt
+    fi
+
+    if test "x$with_gui" == "xwin32"; then
+        OGRE_GUI=WIN32
+    elif test "x$with_gui" == "xgtk"; then
+        OGRE_GUI=gtk
+    elif test "x$with_gui" == "xXt"; then
+        OGRE_GUI=GLX
+        PLATFORM_LIBS="$PLATFORM_LIBS -lXt -lSM -lICE"
+    else
+        { { echo "$as_me:$LINENO: error: The GUI dialogs for $with_gui are not available." >&5
+echo "$as_me: error: The GUI dialogs for $with_gui are not available." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    # Add the OGRE_GUI_xxx flag to compiler command line
+    PLATFORM_CFLAGS="$PLATFORM_CFLAGS -DOGRE_GUI_$OGRE_GUI"
+    # And export it to client applications as well
+    OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_GUI_$OGRE_GUI"
+
+    
+    
+    
+
+
+# Check whether --enable-double was given.
+if test "${enable_double+set}" = set; then
+  enableval=$enable_double; build_double=$enableval
+else
+  build_double=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether to use double floating point precision" >&5
+echo $ECHO_N "checking whether to use double floating point precision... $ECHO_C" >&6; }
+	case $build_double in
+        yes)
+			
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_DOUBLE_PRECISION 1
+_ACEOF
+
+			OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_DOUBLE_PRECISION"
+			{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+        ;;
+        *)
+			
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_DOUBLE_PRECISION 0
+_ACEOF
+
+			{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+        ;;
+    esac
+
+
+# Check whether --enable-threading was given.
+if test "${enable_threading+set}" = set; then
+  enableval=$enable_threading; build_threads=$enableval
+else
+  build_threads=no
+fi
+
+    case $build_threads in
+        yes)
+            
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_THREAD_SUPPORT 1
+_ACEOF
+
+            OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_THREAD_SUPPORT"
+            # Check for the C++ Boost library
+            { echo "$as_me:$LINENO: checking for main in -lboost_thread" >&5
+echo $ECHO_N "checking for main in -lboost_thread... $ECHO_C" >&6; }
+if test "${ac_cv_lib_boost_thread_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lboost_thread  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_boost_thread_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_boost_thread_main=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_boost_thread_main" >&5
+echo "${ECHO_T}$ac_cv_lib_boost_thread_main" >&6; }
+if test $ac_cv_lib_boost_thread_main = yes; then
+  OGRE_THREAD_LIBS="-lboost_thread"
+else
+  
+                { echo "$as_me:$LINENO: checking for main in -lboost_thread-mt" >&5
+echo $ECHO_N "checking for main in -lboost_thread-mt... $ECHO_C" >&6; }
+if test "${ac_cv_lib_boost_thread_mt_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lboost_thread-mt  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_boost_thread_mt_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_boost_thread_mt_main=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_boost_thread_mt_main" >&5
+echo "${ECHO_T}$ac_cv_lib_boost_thread_mt_main" >&6; }
+if test $ac_cv_lib_boost_thread_mt_main = yes; then
+  OGRE_THREAD_LIBS="-lboost_thread-mt"
+else
+  
+                    { { echo "$as_me:$LINENO: error: You need the C++ boost libraries." >&5
+echo "$as_me: error: You need the C++ boost libraries." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+
+        ;;
+        *)
+            
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_THREAD_SUPPORT 0
+_ACEOF
+
+            OGRE_THREAD_LIBS=""
+            { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+        ;;
+    esac
+    
+
+# Check whether --enable-freeimage was given.
+if test "${enable_freeimage+set}" = set; then
+  enableval=$enable_freeimage; build_freeimage=$enableval
+else
+  build_freeimage=yes
+fi
+
+
+
+ 
+
+if test x$build_freeimage = xyes; then
+  USE_FREEIMAGE_TRUE=
+  USE_FREEIMAGE_FALSE='#'
+else
+  USE_FREEIMAGE_TRUE='#'
+  USE_FREEIMAGE_FALSE=
+fi
+
+
+if test "x$build_freeimage" = "xyes" ; then
+	
+{ echo "$as_me:$LINENO: checking for FreeImage_Load in -lfreeimage" >&5
+echo $ECHO_N "checking for FreeImage_Load in -lfreeimage... $ECHO_C" >&6; }
+if test "${ac_cv_lib_freeimage_FreeImage_Load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lfreeimage -lstdc++ $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char FreeImage_Load ();
+int
+main ()
+{
+return FreeImage_Load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_freeimage_FreeImage_Load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_freeimage_FreeImage_Load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_freeimage_FreeImage_Load" >&5
+echo "${ECHO_T}$ac_cv_lib_freeimage_FreeImage_Load" >&6; }
+if test $ac_cv_lib_freeimage_FreeImage_Load = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBFREEIMAGE 1
+_ACEOF
+
+  LIBS="-lfreeimage $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: 
+****************************************************************
+* You do not have FreeImage installed.  This is required.      *
+* You may find it at http://freeimage.sourceforge.net/.        *
+* Note: You can also provide --disable-freeimage to the build  *
+* process to build without it. This is an advanced option      *
+* useful only if you provide your own image loading codecs.    *
+****************************************************************" >&5
+echo "$as_me: error: 
+****************************************************************
+* You do not have FreeImage installed.  This is required.      *
+* You may find it at http://freeimage.sourceforge.net/.        *
+* Note: You can also provide --disable-freeimage to the build  *
+* process to build without it. This is an advanced option      *
+* useful only if you provide your own image loading codecs.    *
+****************************************************************" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+	
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_NO_FREEIMAGE 0
+_ACEOF
+
+else
+	
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_NO_FREEIMAGE 1
+_ACEOF
+
+	OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_NO_FREEIMAGE"
+fi
+
+
+
+# Check whether --enable-devil was given.
+if test "${enable_devil+set}" = set; then
+  enableval=$enable_devil; build_il=$enableval
+else
+  build_il=yes
+fi
+
+
+ 
+
+if test x$build_il = xyes && test x$build_freeimage = xno; then
+  USE_DEVIL_TRUE=
+  USE_DEVIL_FALSE='#'
+else
+  USE_DEVIL_TRUE='#'
+  USE_DEVIL_FALSE=
+fi
+
+
+if test "x$build_freeimage" = "xyes"; then
+    { echo "$as_me:$LINENO: Freeimage is being built, disabling check for DevIL." >&5
+echo "$as_me: Freeimage is being built, disabling check for DevIL." >&6;}
+    build_il=no
+	
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_NO_DEVIL 1
+_ACEOF
+
+else
+if test "x$build_il" = "xyes"; then
+	
+{ echo "$as_me:$LINENO: checking for ilInit in -lIL" >&5
+echo $ECHO_N "checking for ilInit in -lIL... $ECHO_C" >&6; }
+if test "${ac_cv_lib_IL_ilInit+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lIL  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ilInit ();
+int
+main ()
+{
+return ilInit ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_IL_ilInit=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_IL_ilInit=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_IL_ilInit" >&5
+echo "${ECHO_T}$ac_cv_lib_IL_ilInit" >&6; }
+if test $ac_cv_lib_IL_ilInit = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBIL 1
+_ACEOF
+
+  LIBS="-lIL $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: 
+****************************************************************
+* You do not have DevIL installed.  This is required to build. *
+* You may find it at http://openil.sourceforge.net/.           *
+* Note: You can also provide --disable-devil to the build      *
+* process to build without DevIL. This is an advanced option   *
+* useful only if you provide your own image loading codecs.    *
+****************************************************************" >&5
+echo "$as_me: error: 
+****************************************************************
+* You do not have DevIL installed.  This is required to build. *
+* You may find it at http://openil.sourceforge.net/.           *
+* Note: You can also provide --disable-devil to the build      *
+* process to build without DevIL. This is an advanced option   *
+* useful only if you provide your own image loading codecs.    *
+****************************************************************" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+	
+{ echo "$as_me:$LINENO: checking for iluFlipImage in -lILU" >&5
+echo $ECHO_N "checking for iluFlipImage in -lILU... $ECHO_C" >&6; }
+if test "${ac_cv_lib_ILU_iluFlipImage+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lILU  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char iluFlipImage ();
+int
+main ()
+{
+return iluFlipImage ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_ILU_iluFlipImage=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_ILU_iluFlipImage=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_ILU_iluFlipImage" >&5
+echo "${ECHO_T}$ac_cv_lib_ILU_iluFlipImage" >&6; }
+if test $ac_cv_lib_ILU_iluFlipImage = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBILU 1
+_ACEOF
+
+  LIBS="-lILU $LIBS"
+
+fi
+
+	
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_NO_DEVIL 0
+_ACEOF
+
+else
+	
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_NO_DEVIL 1
+_ACEOF
+
+fi
+fi
+
+
+# Check whether --enable-cg was given.
+if test "${enable_cg+set}" = set; then
+  enableval=$enable_cg; build_cg=$enableval
+else
+  build_cg=yes
+fi
+
+
+if test "x$build_cg" = "xyes" ; then
+	
+{ echo "$as_me:$LINENO: checking for cgCreateProgram in -lCg" >&5
+echo $ECHO_N "checking for cgCreateProgram in -lCg... $ECHO_C" >&6; }
+if test "${ac_cv_lib_Cg_cgCreateProgram+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lCg  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cgCreateProgram ();
+int
+main ()
+{
+return cgCreateProgram ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_Cg_cgCreateProgram=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_Cg_cgCreateProgram=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_Cg_cgCreateProgram" >&5
+echo "${ECHO_T}$ac_cv_lib_Cg_cgCreateProgram" >&6; }
+if test $ac_cv_lib_Cg_cgCreateProgram = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBCG 1
+_ACEOF
+
+  LIBS="-lCg $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: 
+	****************************************************************
+	* You do not have the nVidia Cg libraries installed.           *
+	* Go to http://developer.nvidia.com/object/cg_toolkit.html     *
+	* (Click on Cg_Linux.tar.gz).                                  *
+	* You can disable the building of Cg support by providing      *	
+	* --disable-cg to this configure script but this is highly     *
+	* discouraged as this breaks many of the examples.             *
+	****************************************************************" >&5
+echo "$as_me: error: 
+	****************************************************************
+	* You do not have the nVidia Cg libraries installed.           *
+	* Go to http://developer.nvidia.com/object/cg_toolkit.html     *
+	* (Click on Cg_Linux.tar.gz).                                  *
+	* You can disable the building of Cg support by providing      *	
+	* --disable-cg to this configure script but this is highly     *
+	* discouraged as this breaks many of the examples.             *
+	****************************************************************" >&2;}
+   { (exit 1); exit 1; }; }
+	
+fi
+
+fi
+
+ 
+
+if test x$build_cg = xyes; then
+  BUILD_CGPLUGIN_TRUE=
+  BUILD_CGPLUGIN_FALSE='#'
+else
+  BUILD_CGPLUGIN_TRUE='#'
+  BUILD_CGPLUGIN_FALSE=
+fi
+
+
+
+# Check whether --enable-openexr was given.
+if test "${enable_openexr+set}" = set; then
+  enableval=$enable_openexr; build_exr=$enableval
+else
+  build_exr=no
+fi
+
+
+if test "x$build_exr" = "xyes" ; then
+	
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for OPENEXR" >&5
+echo $ECHO_N "checking for OPENEXR... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$OPENEXR_CFLAGS"; then
+        pkg_cv_OPENEXR_CFLAGS="$OPENEXR_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"OpenEXR\"") >&5
+  ($PKG_CONFIG --exists --print-errors "OpenEXR") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_OPENEXR_CFLAGS=`$PKG_CONFIG --cflags "OpenEXR" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$OPENEXR_LIBS"; then
+        pkg_cv_OPENEXR_LIBS="$OPENEXR_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"OpenEXR\"") >&5
+  ($PKG_CONFIG --exists --print-errors "OpenEXR") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_OPENEXR_LIBS=`$PKG_CONFIG --libs "OpenEXR" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+        
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        OPENEXR_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "OpenEXR"`
+        else 
+	        OPENEXR_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "OpenEXR"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$OPENEXR_PKG_ERRORS" >&5
+
+	build_exr=no
+elif test $pkg_failed = untried; then
+	build_exr=no
+else
+	OPENEXR_CFLAGS=$pkg_cv_OPENEXR_CFLAGS
+	OPENEXR_LIBS=$pkg_cv_OPENEXR_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	build_exr=yes
+fi
+
+	if test "x$build_exr" = "xyes" ; then
+	   	ac_config_files="$ac_config_files PlugIns/EXRCodec/Makefile PlugIns/EXRCodec/src/Makefile PlugIns/EXRCodec/include/Makefile"
+
+		
+		
+
+	fi
+
+fi
+
+ 
+
+if test x$build_exr = xyes; then
+  BUILD_EXRPLUGIN_TRUE=
+  BUILD_EXRPLUGIN_FALSE='#'
+else
+  BUILD_EXRPLUGIN_TRUE='#'
+  BUILD_EXRPLUGIN_FALSE=
+fi
+
+
+
+# Check whether --enable-direct3d was given.
+if test "${enable_direct3d+set}" = set; then
+  enableval=$enable_direct3d; build_dx9=$enableval
+else
+  build_dx9=no
+fi
+
+
+ 
+
+if test x$build_dx9 = xyes; then
+  BUILD_DX9RENDERSYSTEM_TRUE=
+  BUILD_DX9RENDERSYSTEM_FALSE='#'
+else
+  BUILD_DX9RENDERSYSTEM_TRUE='#'
+  BUILD_DX9RENDERSYSTEM_FALSE=
+fi
+
+
+
+
+{ echo "$as_me:$LINENO: checking whether to use SSE" >&5
+echo $ECHO_N "checking whether to use SSE... $ECHO_C" >&6; }
+case $target_cpu in
+	i386 | i486 | i586 | i686 | x86_64 | amd64)
+		build_sse=yes
+	;;
+	*)
+		build_sse=no
+	;;
+esac
+{ echo "$as_me:$LINENO: result: $build_sse" >&5
+echo "${ECHO_T}$build_sse" >&6; }
+ 
+
+if test x$build_sse = xyes; then
+  OGRE_BUILD_SSE_TRUE=
+  OGRE_BUILD_SSE_FALSE='#'
+else
+  OGRE_BUILD_SSE_TRUE='#'
+  OGRE_BUILD_SSE_FALSE=
+fi
+
+
+
+ 
+
+if test "x$OGRE_PLATFORM" = "x$OGRE_GUI"; then
+  SAME_PLATFORM_AND_GUI_TRUE=
+  SAME_PLATFORM_AND_GUI_FALSE='#'
+else
+  SAME_PLATFORM_AND_GUI_TRUE='#'
+  SAME_PLATFORM_AND_GUI_FALSE=
+fi
+
+
+
+
+    # Check whether --enable-ogre_demos was given.
+if test "${enable_ogre_demos+set}" = set; then
+  enableval=$enable_ogre_demos; build_ogre_demos=$enableval
+else
+  build_ogre_demos=yes
+fi
+
+
+    if test "x$build_ogre_demos" = "xyes" ; then
+        
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for OIS" >&5
+echo $ECHO_N "checking for OIS... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$OIS_CFLAGS"; then
+        pkg_cv_OIS_CFLAGS="$OIS_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"OIS >= 1.0.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "OIS >= 1.0.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_OIS_CFLAGS=`$PKG_CONFIG --cflags "OIS >= 1.0.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$OIS_LIBS"; then
+        pkg_cv_OIS_LIBS="$OIS_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"OIS >= 1.0.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "OIS >= 1.0.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_OIS_LIBS=`$PKG_CONFIG --libs "OIS >= 1.0.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+        
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        OIS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "OIS >= 1.0.0"`
+        else 
+	        OIS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "OIS >= 1.0.0"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$OIS_PKG_ERRORS" >&5
+
+	ois_found=no
+elif test $pkg_failed = untried; then
+	ois_found=no
+else
+	OIS_CFLAGS=$pkg_cv_OIS_CFLAGS
+	OIS_LIBS=$pkg_cv_OIS_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	ois_found=yes
+fi
+        
+        
+
+        if test "x$ois_found" = "xyes" ; then
+           { echo "$as_me:$LINENO: *** Ogre Demos will be built ***" >&5
+echo "$as_me: *** Ogre Demos will be built ***" >&6;}
+        else
+          build_ogre_demos=no
+          { echo "$as_me:$LINENO: 
+****************************************************************
+* You do not have OIS installed.  This is required to build    *
+* Ogre demos. You may find it at:                              *
+* http://www.sourceforge.net/projects/wgois.                   *
+* If you do not want to build the demos, you can safely ignore *
+* this.                                                        *
+****************************************************************" >&5
+echo "$as_me: 
+****************************************************************
+* You do not have OIS installed.  This is required to build    *
+* Ogre demos. You may find it at:                              *
+* http://www.sourceforge.net/projects/wgois.                   *
+* If you do not want to build the demos, you can safely ignore *
+* this.                                                        *
+****************************************************************" >&6;}
+        fi
+    else
+        build_ogre_demos=no
+        { echo "$as_me:$LINENO: *** Building of Ogre demos disabled ***" >&5
+echo "$as_me: *** Building of Ogre demos disabled ***" >&6;}
+    fi
+
+     
+
+if test x$build_ogre_demos = xyes; then
+  OGRE_BUILDING_DEMOS_TRUE=
+  OGRE_BUILDING_DEMOS_FALSE='#'
+else
+  OGRE_BUILDING_DEMOS_TRUE='#'
+  OGRE_BUILDING_DEMOS_FALSE=
+fi
+
+
+
+if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+		int main()
+		{
+			short s = 1;
+			short* ptr = &s;
+			unsigned char c = *((char*)ptr);
+			return c;
+		}
+	
+	
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_CONFIG_BIG_ENDIAN 
+_ACEOF
+
+          OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_CONFIG_BIG_ENDIAN"
+	
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_CONFIG_LITTLE_ENDIAN 
+_ACEOF
+
+          OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_CONFIG_LITTLE_ENDIAN"
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking whether -fPIC is needed" >&5
+echo $ECHO_N "checking whether -fPIC is needed... $ECHO_C" >&6; }
+    case $host in
+        x86_64-*)
+            CXXFLAGS="$CXXFLAGS -fPIC"
+            { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+        ;;
+        *)
+            { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+        ;;
+    esac
+
+
+
+    
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for CEGUI" >&5
+echo $ECHO_N "checking for CEGUI... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$CEGUI_CFLAGS"; then
+        pkg_cv_CEGUI_CFLAGS="$CEGUI_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"CEGUI >= 0.5.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "CEGUI >= 0.5.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_CEGUI_CFLAGS=`$PKG_CONFIG --cflags "CEGUI >= 0.5.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$CEGUI_LIBS"; then
+        pkg_cv_CEGUI_LIBS="$CEGUI_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"CEGUI >= 0.5.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "CEGUI >= 0.5.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_CEGUI_LIBS=`$PKG_CONFIG --libs "CEGUI >= 0.5.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+        
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        CEGUI_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "CEGUI >= 0.5.0"`
+        else 
+	        CEGUI_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "CEGUI >= 0.5.0"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$CEGUI_PKG_ERRORS" >&5
+
+	build_cegui_sample=false
+elif test $pkg_failed = untried; then
+	build_cegui_sample=false
+else
+	CEGUI_CFLAGS=$pkg_cv_CEGUI_CFLAGS
+	CEGUI_LIBS=$pkg_cv_CEGUI_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	build_cegui_sample=true
+fi
+    if test x$build_cegui_sample = xtrue; then
+        ac_config_files="$ac_config_files Samples/Common/CEGUIRenderer/Makefile Samples/Common/CEGUIRenderer/CEGUI-OGRE.pc Samples/Common/CEGUIRenderer/src/Makefile Samples/Common/CEGUIRenderer/include/Makefile Samples/Gui/Makefile Samples/Gui/src/Makefile"
+
+        
+        
+        { echo "$as_me:$LINENO: result: CEGUI available, Gui and FacialAnimation samples will be built" >&5
+echo "${ECHO_T}CEGUI available, Gui and FacialAnimation samples will be built" >&6; }
+    else
+        { echo "$as_me:$LINENO: result: CEGUI not available, Gui and FacialAnimation samples will not be built" >&5
+echo "${ECHO_T}CEGUI not available, Gui and FacialAnimation samples will not be built" >&6; }
+    fi
+     
+
+if test x$build_cegui_sample = xtrue; then
+  HAVE_CEGUI_TRUE=
+  HAVE_CEGUI_FALSE='#'
+else
+  HAVE_CEGUI_TRUE='#'
+  HAVE_CEGUI_FALSE=
+fi
+
+
+
+CFLAGS="$CFLAGS"
+CXXFLAGS="$CXXFLAGS"
+LIBS="$LIBS"
+
+ogreexecdir='${abs_top_builddir}/Samples/Common/bin'
+
+
+
+ac_config_files="$ac_config_files Makefile OgreMain/Makefile OgreMain/src/Makefile OgreMain/include/Makefile OgreMain/include/GLX/Makefile OgreMain/include/gtk/Makefile PlugIns/Makefile PlugIns/BSPSceneManager/Makefile PlugIns/BSPSceneManager/src/Makefile PlugIns/BSPSceneManager/include/Makefile PlugIns/CgProgramManager/Makefile PlugIns/CgProgramManager/src/Makefile PlugIns/CgProgramManager/include/Makefile PlugIns/OctreeSceneManager/Makefile PlugIns/OctreeSceneManager/src/Makefile PlugIns/OctreeSceneManager/include/Makefile PlugIns/ParticleFX/Makefile PlugIns/ParticleFX/src/Makefile PlugIns/ParticleFX/include/Makefile RenderSystems/Makefile RenderSystems/GL/Makefile RenderSystems/GL/src/Makefile RenderSystems/GL/include/Makefile RenderSystems/GL/src/atifs/Makefile RenderSystems/GL/src/atifs/include/Makefile RenderSystems/GL/src/atifs/src/Makefile RenderSystems/GL/src/GLSL/Makefile RenderSystems/GL/src/GLSL/include/Makefile RenderSystems/GL/src/GLSL/src/Makefile RenderSystems/GL/src/nvparse/Makefile RenderSystems/Direct3D9/Makefile RenderSystems/Direct3D9/src/Makefile RenderSystems/Direct3D9/include/Makefile Samples/Makefile Samples/Common/Makefile Samples/Common/include/Makefile Samples/Common/bin/Makefile Samples/BezierPatch/Makefile Samples/BezierPatch/src/Makefile Samples/BezierPatch/include/Makefile Samples/CameraTrack/Makefile Samples/CameraTrack/src/Makefile Samples/CelShading/Makefile Samples/CelShading/src/Makefile Samples/Compositor/Makefile Samples/Compositor/src/Makefile Samples/Compositor/include/Makefile Samples/CubeMapping/Makefile Samples/CubeMapping/src/Makefile Samples/CubeMapping/include/Makefile Samples/DeferredShading/Makefile Samples/DeferredShading/src/Makefile Samples/DeferredShading/include/Makefile Samples/Dot3Bump/Makefile Samples/Dot3Bump/src/Makefile Samples/EnvMapping/Makefile Samples/EnvMapping/src/Makefile Samples/EnvMapping/include/Makefile Samples/FacialAnimation/Makefile Samples/FacialAnimation/src/Makefile Samples/Fresnel/Makefile Samples/Fresnel/src/Makefile Samples/Grass/Makefile Samples/Grass/src/Makefile Samples/Transpacency/Makefile Samples/Transpacency/src/Makefile Samples/Transpacency/include/Makefile Samples/Lighting/Makefile Samples/Lighting/src/Makefile Samples/Lighting/include/Makefile Samples/OceanDemo/Makefile Samples/OceanDemo/src/Makefile Samples/OceanDemo/include/Makefile Samples/ParticleFX/Makefile Samples/ParticleFX/src/Makefile Samples/ParticleFX/include/Makefile Samples/RenderToTexture/Makefile Samples/RenderToTexture/src/Makefile Samples/TextureFX/Makefile Samples/TextureFX/src/Makefile Samples/TextureFX/include/Makefile Samples/Shadows/Makefile Samples/Shadows/src/Makefile Samples/SkyBox/Makefile Samples/SkyBox/src/Makefile Samples/SkyBox/include/Makefile Samples/SkyDome/Makefile Samples/SkyDome/src/Makefile Samples/SkyDome/include/Makefile Samples/SkyPlane/Makefile Samples/SkyPlane/src/Makefile Samples/SkyPlane/include/Makefile Samples/Smoke/Makefile Samples/Smoke/src/Makefile Samples/Smoke/include/Makefile Samples/BSP/Makefile Samples/BSP/src/Makefile Samples/SkeletalAnimation/Makefile Samples/SkeletalAnimation/src/Makefile Samples/SkeletalAnimation/include/Makefile Samples/Terrain/Makefile Samples/Terrain/src/Makefile Samples/Terrain/include/Makefile Samples/Water/Makefile Samples/Water/src/Makefile Samples/Water/include/Makefile Samples/DynTex/Makefile Samples/DynTex/src/Makefile Samples/DynTex/include/Makefile Samples/VolumeTex/Makefile Samples/VolumeTex/src/Makefile Samples/VolumeTex/include/Makefile Samples/Instancing/Makefile Samples/Instancing/src/Makefile Samples/Instancing/include/Makefile Tests/Makefile Tests/src/Makefile Tools/Makefile Tools/MaterialUpgrader/Makefile Tools/MaterialUpgrader/src/Makefile Tools/MaterialUpgrader/include/Makefile Tools/MeshUpgrader/Makefile Tools/MeshUpgrader/src/Makefile Tools/XMLConverter/Makefile Tools/XMLConverter/src/Makefile Tools/XMLConverter/include/Makefile Tools/LightwaveConverter/Makefile Tools/LightwaveConverter/src/Makefile Tools/LightwaveConverter/include/Makefile OGRE.pc"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIB@&t@OBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${OGRE_NT_TRUE}" && test -z "${OGRE_NT_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"OGRE_NT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"OGRE_NT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${OGRE_LINUX_TRUE}" && test -z "${OGRE_LINUX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"OGRE_LINUX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"OGRE_LINUX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${OGRE_OSX_TRUE}" && test -z "${OGRE_OSX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"OGRE_OSX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"OGRE_OSX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_UNIT_TESTS_TRUE}" && test -z "${BUILD_UNIT_TESTS_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_UNIT_TESTS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_UNIT_TESTS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${USE_FREEIMAGE_TRUE}" && test -z "${USE_FREEIMAGE_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"USE_FREEIMAGE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"USE_FREEIMAGE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${USE_DEVIL_TRUE}" && test -z "${USE_DEVIL_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"USE_DEVIL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"USE_DEVIL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_CGPLUGIN_TRUE}" && test -z "${BUILD_CGPLUGIN_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_CGPLUGIN\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_CGPLUGIN\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_EXRPLUGIN_TRUE}" && test -z "${BUILD_EXRPLUGIN_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_EXRPLUGIN\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_EXRPLUGIN\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_DX9RENDERSYSTEM_TRUE}" && test -z "${BUILD_DX9RENDERSYSTEM_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_DX9RENDERSYSTEM\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_DX9RENDERSYSTEM\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${OGRE_BUILD_SSE_TRUE}" && test -z "${OGRE_BUILD_SSE_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"OGRE_BUILD_SSE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"OGRE_BUILD_SSE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${SAME_PLATFORM_AND_GUI_TRUE}" && test -z "${SAME_PLATFORM_AND_GUI_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"SAME_PLATFORM_AND_GUI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"SAME_PLATFORM_AND_GUI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${OGRE_BUILDING_DEMOS_TRUE}" && test -z "${OGRE_BUILDING_DEMOS_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"OGRE_BUILDING_DEMOS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"OGRE_BUILDING_DEMOS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_CEGUI_TRUE}" && test -z "${HAVE_CEGUI_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_CEGUI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_CEGUI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+	case $1 in
+        -*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by OGRE $as_me 1.4.5, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet      do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+		   instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+		   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+OGRE config.status 1.4.5
+configured by $0, generated by GNU Autoconf 2.61,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX
+@%:@@%:@ Running $as_me. @%:@@%:@
+_ASBOX
+  echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "OgreMain/include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS OgreMain/include/config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "RenderSystems/GL/src/GLX/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/GLX/Makefile" ;;
+    "RenderSystems/GL/src/win32/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/win32/Makefile" ;;
+    "PlugIns/EXRCodec/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/EXRCodec/Makefile" ;;
+    "PlugIns/EXRCodec/src/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/EXRCodec/src/Makefile" ;;
+    "PlugIns/EXRCodec/include/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/EXRCodec/include/Makefile" ;;
+    "Samples/Common/CEGUIRenderer/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/CEGUIRenderer/Makefile" ;;
+    "Samples/Common/CEGUIRenderer/CEGUI-OGRE.pc") CONFIG_FILES="$CONFIG_FILES Samples/Common/CEGUIRenderer/CEGUI-OGRE.pc" ;;
+    "Samples/Common/CEGUIRenderer/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/CEGUIRenderer/src/Makefile" ;;
+    "Samples/Common/CEGUIRenderer/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/CEGUIRenderer/include/Makefile" ;;
+    "Samples/Gui/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Gui/Makefile" ;;
+    "Samples/Gui/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Gui/src/Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "OgreMain/Makefile") CONFIG_FILES="$CONFIG_FILES OgreMain/Makefile" ;;
+    "OgreMain/src/Makefile") CONFIG_FILES="$CONFIG_FILES OgreMain/src/Makefile" ;;
+    "OgreMain/include/Makefile") CONFIG_FILES="$CONFIG_FILES OgreMain/include/Makefile" ;;
+    "OgreMain/include/GLX/Makefile") CONFIG_FILES="$CONFIG_FILES OgreMain/include/GLX/Makefile" ;;
+    "OgreMain/include/gtk/Makefile") CONFIG_FILES="$CONFIG_FILES OgreMain/include/gtk/Makefile" ;;
+    "PlugIns/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/Makefile" ;;
+    "PlugIns/BSPSceneManager/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/BSPSceneManager/Makefile" ;;
+    "PlugIns/BSPSceneManager/src/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/BSPSceneManager/src/Makefile" ;;
+    "PlugIns/BSPSceneManager/include/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/BSPSceneManager/include/Makefile" ;;
+    "PlugIns/CgProgramManager/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/CgProgramManager/Makefile" ;;
+    "PlugIns/CgProgramManager/src/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/CgProgramManager/src/Makefile" ;;
+    "PlugIns/CgProgramManager/include/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/CgProgramManager/include/Makefile" ;;
+    "PlugIns/OctreeSceneManager/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/OctreeSceneManager/Makefile" ;;
+    "PlugIns/OctreeSceneManager/src/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/OctreeSceneManager/src/Makefile" ;;
+    "PlugIns/OctreeSceneManager/include/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/OctreeSceneManager/include/Makefile" ;;
+    "PlugIns/ParticleFX/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/ParticleFX/Makefile" ;;
+    "PlugIns/ParticleFX/src/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/ParticleFX/src/Makefile" ;;
+    "PlugIns/ParticleFX/include/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/ParticleFX/include/Makefile" ;;
+    "RenderSystems/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/Makefile" ;;
+    "RenderSystems/GL/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/Makefile" ;;
+    "RenderSystems/GL/src/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/Makefile" ;;
+    "RenderSystems/GL/include/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/include/Makefile" ;;
+    "RenderSystems/GL/src/atifs/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/atifs/Makefile" ;;
+    "RenderSystems/GL/src/atifs/include/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/atifs/include/Makefile" ;;
+    "RenderSystems/GL/src/atifs/src/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/atifs/src/Makefile" ;;
+    "RenderSystems/GL/src/GLSL/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/GLSL/Makefile" ;;
+    "RenderSystems/GL/src/GLSL/include/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/GLSL/include/Makefile" ;;
+    "RenderSystems/GL/src/GLSL/src/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/GLSL/src/Makefile" ;;
+    "RenderSystems/GL/src/nvparse/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/nvparse/Makefile" ;;
+    "RenderSystems/Direct3D9/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/Direct3D9/Makefile" ;;
+    "RenderSystems/Direct3D9/src/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/Direct3D9/src/Makefile" ;;
+    "RenderSystems/Direct3D9/include/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/Direct3D9/include/Makefile" ;;
+    "Samples/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Makefile" ;;
+    "Samples/Common/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/Makefile" ;;
+    "Samples/Common/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/include/Makefile" ;;
+    "Samples/Common/bin/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/bin/Makefile" ;;
+    "Samples/BezierPatch/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/BezierPatch/Makefile" ;;
+    "Samples/BezierPatch/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/BezierPatch/src/Makefile" ;;
+    "Samples/BezierPatch/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/BezierPatch/include/Makefile" ;;
+    "Samples/CameraTrack/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CameraTrack/Makefile" ;;
+    "Samples/CameraTrack/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CameraTrack/src/Makefile" ;;
+    "Samples/CelShading/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CelShading/Makefile" ;;
+    "Samples/CelShading/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CelShading/src/Makefile" ;;
+    "Samples/Compositor/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Compositor/Makefile" ;;
+    "Samples/Compositor/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Compositor/src/Makefile" ;;
+    "Samples/Compositor/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Compositor/include/Makefile" ;;
+    "Samples/CubeMapping/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CubeMapping/Makefile" ;;
+    "Samples/CubeMapping/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CubeMapping/src/Makefile" ;;
+    "Samples/CubeMapping/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CubeMapping/include/Makefile" ;;
+    "Samples/DeferredShading/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DeferredShading/Makefile" ;;
+    "Samples/DeferredShading/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DeferredShading/src/Makefile" ;;
+    "Samples/DeferredShading/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DeferredShading/include/Makefile" ;;
+    "Samples/Dot3Bump/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Dot3Bump/Makefile" ;;
+    "Samples/Dot3Bump/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Dot3Bump/src/Makefile" ;;
+    "Samples/EnvMapping/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/EnvMapping/Makefile" ;;
+    "Samples/EnvMapping/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/EnvMapping/src/Makefile" ;;
+    "Samples/EnvMapping/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/EnvMapping/include/Makefile" ;;
+    "Samples/FacialAnimation/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/FacialAnimation/Makefile" ;;
+    "Samples/FacialAnimation/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/FacialAnimation/src/Makefile" ;;
+    "Samples/Fresnel/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Fresnel/Makefile" ;;
+    "Samples/Fresnel/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Fresnel/src/Makefile" ;;
+    "Samples/Grass/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Grass/Makefile" ;;
+    "Samples/Grass/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Grass/src/Makefile" ;;
+    "Samples/Transpacency/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Transpacency/Makefile" ;;
+    "Samples/Transpacency/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Transpacency/src/Makefile" ;;
+    "Samples/Transpacency/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Transpacency/include/Makefile" ;;
+    "Samples/Lighting/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Lighting/Makefile" ;;
+    "Samples/Lighting/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Lighting/src/Makefile" ;;
+    "Samples/Lighting/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Lighting/include/Makefile" ;;
+    "Samples/OceanDemo/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/OceanDemo/Makefile" ;;
+    "Samples/OceanDemo/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/OceanDemo/src/Makefile" ;;
+    "Samples/OceanDemo/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/OceanDemo/include/Makefile" ;;
+    "Samples/ParticleFX/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/ParticleFX/Makefile" ;;
+    "Samples/ParticleFX/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/ParticleFX/src/Makefile" ;;
+    "Samples/ParticleFX/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/ParticleFX/include/Makefile" ;;
+    "Samples/RenderToTexture/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/RenderToTexture/Makefile" ;;
+    "Samples/RenderToTexture/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/RenderToTexture/src/Makefile" ;;
+    "Samples/TextureFX/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/TextureFX/Makefile" ;;
+    "Samples/TextureFX/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/TextureFX/src/Makefile" ;;
+    "Samples/TextureFX/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/TextureFX/include/Makefile" ;;
+    "Samples/Shadows/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Shadows/Makefile" ;;
+    "Samples/Shadows/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Shadows/src/Makefile" ;;
+    "Samples/SkyBox/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyBox/Makefile" ;;
+    "Samples/SkyBox/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyBox/src/Makefile" ;;
+    "Samples/SkyBox/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyBox/include/Makefile" ;;
+    "Samples/SkyDome/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyDome/Makefile" ;;
+    "Samples/SkyDome/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyDome/src/Makefile" ;;
+    "Samples/SkyDome/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyDome/include/Makefile" ;;
+    "Samples/SkyPlane/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyPlane/Makefile" ;;
+    "Samples/SkyPlane/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyPlane/src/Makefile" ;;
+    "Samples/SkyPlane/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyPlane/include/Makefile" ;;
+    "Samples/Smoke/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Smoke/Makefile" ;;
+    "Samples/Smoke/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Smoke/src/Makefile" ;;
+    "Samples/Smoke/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Smoke/include/Makefile" ;;
+    "Samples/BSP/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/BSP/Makefile" ;;
+    "Samples/BSP/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/BSP/src/Makefile" ;;
+    "Samples/SkeletalAnimation/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkeletalAnimation/Makefile" ;;
+    "Samples/SkeletalAnimation/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkeletalAnimation/src/Makefile" ;;
+    "Samples/SkeletalAnimation/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkeletalAnimation/include/Makefile" ;;
+    "Samples/Terrain/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Terrain/Makefile" ;;
+    "Samples/Terrain/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Terrain/src/Makefile" ;;
+    "Samples/Terrain/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Terrain/include/Makefile" ;;
+    "Samples/Water/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Water/Makefile" ;;
+    "Samples/Water/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Water/src/Makefile" ;;
+    "Samples/Water/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Water/include/Makefile" ;;
+    "Samples/DynTex/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DynTex/Makefile" ;;
+    "Samples/DynTex/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DynTex/src/Makefile" ;;
+    "Samples/DynTex/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DynTex/include/Makefile" ;;
+    "Samples/VolumeTex/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/VolumeTex/Makefile" ;;
+    "Samples/VolumeTex/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/VolumeTex/src/Makefile" ;;
+    "Samples/VolumeTex/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/VolumeTex/include/Makefile" ;;
+    "Samples/Instancing/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Instancing/Makefile" ;;
+    "Samples/Instancing/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Instancing/src/Makefile" ;;
+    "Samples/Instancing/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Instancing/include/Makefile" ;;
+    "Tests/Makefile") CONFIG_FILES="$CONFIG_FILES Tests/Makefile" ;;
+    "Tests/src/Makefile") CONFIG_FILES="$CONFIG_FILES Tests/src/Makefile" ;;
+    "Tools/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/Makefile" ;;
+    "Tools/MaterialUpgrader/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/MaterialUpgrader/Makefile" ;;
+    "Tools/MaterialUpgrader/src/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/MaterialUpgrader/src/Makefile" ;;
+    "Tools/MaterialUpgrader/include/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/MaterialUpgrader/include/Makefile" ;;
+    "Tools/MeshUpgrader/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/MeshUpgrader/Makefile" ;;
+    "Tools/MeshUpgrader/src/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/MeshUpgrader/src/Makefile" ;;
+    "Tools/XMLConverter/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/XMLConverter/Makefile" ;;
+    "Tools/XMLConverter/src/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/XMLConverter/src/Makefile" ;;
+    "Tools/XMLConverter/include/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/XMLConverter/include/Makefile" ;;
+    "Tools/LightwaveConverter/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/LightwaveConverter/Makefile" ;;
+    "Tools/LightwaveConverter/src/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/LightwaveConverter/src/Makefile" ;;
+    "Tools/LightwaveConverter/include/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/LightwaveConverter/include/Makefile" ;;
+    "OGRE.pc") CONFIG_FILES="$CONFIG_FILES OGRE.pc" ;;
+
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+#
+# Set up the sed scripts for CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "$CONFIG_FILES"; then
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+target!$target$ac_delim
+target_cpu!$target_cpu$ac_delim
+target_vendor!$target_vendor$ac_delim
+target_os!$target_os$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+CYGPATH_W!$CYGPATH_W$ac_delim
+PACKAGE!$PACKAGE$ac_delim
+VERSION!$VERSION$ac_delim
+ACLOCAL!$ACLOCAL$ac_delim
+AUTOCONF!$AUTOCONF$ac_delim
+AUTOMAKE!$AUTOMAKE$ac_delim
+AUTOHEADER!$AUTOHEADER$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+install_sh!$install_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+mkdir_p!$mkdir_p$ac_delim
+AWK!$AWK$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+am__leading_dot!$am__leading_dot$ac_delim
+AMTAR!$AMTAR$ac_delim
+am__tar!$am__tar$ac_delim
+am__untar!$am__untar$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DEPDIR!$DEPDIR$ac_delim
+am__include!$am__include$ac_delim
+am__quote!$am__quote$ac_delim
+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+CCDEPMODE!$CCDEPMODE$ac_delim
+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+CXX!$CXX$ac_delim
+CXXFLAGS!$CXXFLAGS$ac_delim
+ac_ct_CXX!$ac_ct_CXX$ac_delim
+CXXDEPMODE!$CXXDEPMODE$ac_delim
+am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
+am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
+YACC!$YACC$ac_delim
+YFLAGS!$YFLAGS$ac_delim
+LEX!$LEX$ac_delim
+LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim
+LEXLIB!$LEXLIB$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHARED_FLAGS!$SHARED_FLAGS$ac_delim
+PLUGIN_FLAGS!$PLUGIN_FLAGS$ac_delim
+GL_LIBS!$GL_LIBS$ac_delim
+RC!$RC$ac_delim
+OGRE_NT_TRUE!$OGRE_NT_TRUE$ac_delim
+OGRE_NT_FALSE!$OGRE_NT_FALSE$ac_delim
+OGRE_LINUX_TRUE!$OGRE_LINUX_TRUE$ac_delim
+OGRE_LINUX_FALSE!$OGRE_LINUX_FALSE$ac_delim
+OGRE_OSX_TRUE!$OGRE_OSX_TRUE$ac_delim
+OGRE_OSX_FALSE!$OGRE_OSX_FALSE$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+LN_S!$LN_S$ac_delim
+ECHO!$ECHO$ac_delim
+AR!$AR$ac_delim
+RANLIB!$RANLIB$ac_delim
+CPP!$CPP$ac_delim
+CXXCPP!$CXXCPP$ac_delim
+F77!$F77$ac_delim
+FFLAGS!$FFLAGS$ac_delim
+ac_ct_F77!$ac_ct_F77$ac_delim
+LIBTOOL!$LIBTOOL$ac_delim
+OGRE_CFLAGS!$OGRE_CFLAGS$ac_delim
+CFLAGS_VISIBILITY!$CFLAGS_VISIBILITY$ac_delim
+STLPORT_CFLAGS!$STLPORT_CFLAGS$ac_delim
+STLPORT_LIBS!$STLPORT_LIBS$ac_delim
+FT2_CONFIG!$FT2_CONFIG$ac_delim
+FT2_CFLAGS!$FT2_CFLAGS$ac_delim
+FT2_LIBS!$FT2_LIBS$ac_delim
+CPPUNIT_CONFIG!$CPPUNIT_CONFIG$ac_delim
+CPPUNIT_CFLAGS!$CPPUNIT_CFLAGS$ac_delim
+CPPUNIT_LIBS!$CPPUNIT_LIBS$ac_delim
+BUILD_UNIT_TESTS_TRUE!$BUILD_UNIT_TESTS_TRUE$ac_delim
+BUILD_UNIT_TESTS_FALSE!$BUILD_UNIT_TESTS_FALSE$ac_delim
+PKG_CONFIG!$PKG_CONFIG$ac_delim
+ZZIPLIB_CFLAGS!$ZZIPLIB_CFLAGS$ac_delim
+ZZIPLIB_LIBS!$ZZIPLIB_LIBS$ac_delim
+XMKMF!$XMKMF$ac_delim
+PLATFORM_CFLAGS!$PLATFORM_CFLAGS$ac_delim
+PLATFORM_LIBS!$PLATFORM_LIBS$ac_delim
+OGRE_PLATFORM!$OGRE_PLATFORM$ac_delim
+GLSUPPORT_CFLAGS!$GLSUPPORT_CFLAGS$ac_delim
+GLSUPPORT_LIBS!$GLSUPPORT_LIBS$ac_delim
+OGRE_GLSUPPORT!$OGRE_GLSUPPORT$ac_delim
+GTK_CFLAGS!$GTK_CFLAGS$ac_delim
+GTK_LIBS!$GTK_LIBS$ac_delim
+OGRE_GUI!$OGRE_GUI$ac_delim
+OGRE_THREAD_LIBS!$OGRE_THREAD_LIBS$ac_delim
+USE_FREEIMAGE_TRUE!$USE_FREEIMAGE_TRUE$ac_delim
+USE_FREEIMAGE_FALSE!$USE_FREEIMAGE_FALSE$ac_delim
+USE_DEVIL_TRUE!$USE_DEVIL_TRUE$ac_delim
+USE_DEVIL_FALSE!$USE_DEVIL_FALSE$ac_delim
+BUILD_CGPLUGIN_TRUE!$BUILD_CGPLUGIN_TRUE$ac_delim
+BUILD_CGPLUGIN_FALSE!$BUILD_CGPLUGIN_FALSE$ac_delim
+OPENEXR_CFLAGS!$OPENEXR_CFLAGS$ac_delim
+OPENEXR_LIBS!$OPENEXR_LIBS$ac_delim
+BUILD_EXRPLUGIN_TRUE!$BUILD_EXRPLUGIN_TRUE$ac_delim
+BUILD_EXRPLUGIN_FALSE!$BUILD_EXRPLUGIN_FALSE$ac_delim
+BUILD_DX9RENDERSYSTEM_TRUE!$BUILD_DX9RENDERSYSTEM_TRUE$ac_delim
+BUILD_DX9RENDERSYSTEM_FALSE!$BUILD_DX9RENDERSYSTEM_FALSE$ac_delim
+OGRE_BUILD_SSE_TRUE!$OGRE_BUILD_SSE_TRUE$ac_delim
+OGRE_BUILD_SSE_FALSE!$OGRE_BUILD_SSE_FALSE$ac_delim
+SAME_PLATFORM_AND_GUI_TRUE!$SAME_PLATFORM_AND_GUI_TRUE$ac_delim
+SAME_PLATFORM_AND_GUI_FALSE!$SAME_PLATFORM_AND_GUI_FALSE$ac_delim
+OIS_CFLAGS!$OIS_CFLAGS$ac_delim
+OIS_LIBS!$OIS_LIBS$ac_delim
+OGRE_BUILDING_DEMOS_TRUE!$OGRE_BUILDING_DEMOS_TRUE$ac_delim
+OGRE_BUILDING_DEMOS_FALSE!$OGRE_BUILDING_DEMOS_FALSE$ac_delim
+CEGUI_CFLAGS!$CEGUI_CFLAGS$ac_delim
+CEGUI_LIBS!$CEGUI_LIBS$ac_delim
+HAVE_CEGUI_TRUE!$HAVE_CEGUI_TRUE$ac_delim
+HAVE_CEGUI_FALSE!$HAVE_CEGUI_FALSE$ac_delim
+abs_top_builddir!$abs_top_builddir$ac_delim
+ogreexecdir!$ogreexecdir$ac_delim
+LIB@&t@OBJS!$LIB@&t@OBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 76; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$ac_file_inputs $ac_f"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input="Generated from "`IFS=:
+	  echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+  esac
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([	 #]*\\)[^	 ]*\\([	 ]*'
+ac_dB='\\)[	 (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+  sed -n '
+	t rset
+	:rset
+	s/^[	 ]*#[	 ]*define[	 ][	 ]*//
+	t ok
+	d
+	:ok
+	s/[\\&,]/\\&/g
+	s/^\('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+	s/^\('"$ac_word_re"'\)[	 ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[	 #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:	 sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:	 sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:	 sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
+do
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[	 ]*#[	 ]*undef[	 ][	 ]*$ac_word_re[	 ]*\$/b def
+/^[	 ]*#[	 ]*define[	 ][	 ]*$ac_word_re[(	 ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines conftest.tail
+
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
+cat >>$CONFIG_STATUS <<\_ACEOF
+  if test x"$ac_file" != x-; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
+      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f $ac_file
+      mv "$tmp/config.h" $ac_file
+    fi
+  else
+    echo "/* $configure_input  */"
+    cat "$ac_result"
+  fi
+  rm -f "$tmp/out12"
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $ac_file | $ac_file:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X$ac_file : 'X\(//\)[^/]' \| \
+	 X$ac_file : 'X\(//\)$' \| \
+	 X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
+echo X$ac_file |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+  
+  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+
+
+
+ft_detected=yes
+test "x$no_ft" == "xyes" && ft_detected=no
+
+echo "--------=== Configuration summary ===--------"
+echo "    Target platform                 : $OGRE_PLATFORM"
+echo "    OpenGL Ogre support             : $OGRE_GLSUPPORT"
+echo "    GUI library to use              : $with_gui"
+echo "    Use double precision arithmetic : $build_double"
+echo "    Support for threading           : $build_threads"
+echo "    Use STLport                     : $ac_cv_use_stlport"
+echo "    Use FreeType                    : $ft_detected"
+echo "    Use FreeImage                   : $build_freeimage"
+echo "    Use DevIL                       : $build_il"
+echo "    Build OGRE demos                : $build_ogre_demos"
+test "x$build_ogre_demos" == "xyes" && \
+echo "    Build CEGUI demos               : $build_cegui_sample"
+echo "    Build the OpenEXR plugin        : $build_exr"
+echo "    Build the Cg plugin             : $build_cg"
+echo "    Build the DirectX 9 plugin      : $build_dx9"
+echo "--------===============================--------"
Index: /autom4te.cache/output.1
===================================================================
--- /autom4te.cache/output.1	(revision 5)
+++ /autom4te.cache/output.1	(revision 5)
@@ -0,0 +1,29656 @@
+@%:@! /bin/sh
+@%:@ Guess values for system-dependent variables and create Makefiles.
+@%:@ Generated by GNU Autoconf 2.61 for OGRE 1.4.5.
+@%:@ 
+@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+@%:@ 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+@%:@ This configure script is free software; the Free Software Foundation
+@%:@ gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes && 	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  case $as_dir in
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+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
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+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
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+    
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+	case $1 in
+        -*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+  ;;
+esac
+
+echo=${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 <<EOF
+$*
+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 "$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 &&
+       echo_test_string=`eval $cmd` &&
+       (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.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+tagnames=${tagnames+${tagnames},}CXX
+
+tagnames=${tagnames+${tagnames},}F77
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIB@&t@OBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='OGRE'
+PACKAGE_TARNAME='ogre'
+PACKAGE_VERSION='1.4.5'
+PACKAGE_STRING='OGRE 1.4.5'
+PACKAGE_BUGREPORT=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+build
+build_cpu
+build_vendor
+build_os
+host
+host_cpu
+host_vendor
+host_os
+target
+target_cpu
+target_vendor
+target_os
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+CYGPATH_W
+PACKAGE
+VERSION
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+install_sh
+STRIP
+INSTALL_STRIP_PROGRAM
+mkdir_p
+AWK
+SET_MAKE
+am__leading_dot
+AMTAR
+am__tar
+am__untar
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+DEPDIR
+am__include
+am__quote
+AMDEP_TRUE
+AMDEP_FALSE
+AMDEPBACKSLASH
+CCDEPMODE
+am__fastdepCC_TRUE
+am__fastdepCC_FALSE
+CXX
+CXXFLAGS
+ac_ct_CXX
+CXXDEPMODE
+am__fastdepCXX_TRUE
+am__fastdepCXX_FALSE
+YACC
+YFLAGS
+LEX
+LEX_OUTPUT_ROOT
+LEXLIB
+SHARED_FLAGS
+PLUGIN_FLAGS
+GL_LIBS
+RC
+OGRE_NT_TRUE
+OGRE_NT_FALSE
+OGRE_LINUX_TRUE
+OGRE_LINUX_FALSE
+OGRE_OSX_TRUE
+OGRE_OSX_FALSE
+GREP
+EGREP
+LN_S
+ECHO
+AR
+RANLIB
+CPP
+CXXCPP
+F77
+FFLAGS
+ac_ct_F77
+LIBTOOL
+OGRE_CFLAGS
+CFLAGS_VISIBILITY
+STLPORT_CFLAGS
+STLPORT_LIBS
+FT2_CONFIG
+FT2_CFLAGS
+FT2_LIBS
+CPPUNIT_CONFIG
+CPPUNIT_CFLAGS
+CPPUNIT_LIBS
+BUILD_UNIT_TESTS_TRUE
+BUILD_UNIT_TESTS_FALSE
+PKG_CONFIG
+ZZIPLIB_CFLAGS
+ZZIPLIB_LIBS
+XMKMF
+PLATFORM_CFLAGS
+PLATFORM_LIBS
+OGRE_PLATFORM
+GLSUPPORT_CFLAGS
+GLSUPPORT_LIBS
+OGRE_GLSUPPORT
+GTK_CFLAGS
+GTK_LIBS
+OGRE_GUI
+OGRE_THREAD_LIBS
+USE_FREEIMAGE_TRUE
+USE_FREEIMAGE_FALSE
+USE_DEVIL_TRUE
+USE_DEVIL_FALSE
+BUILD_CGPLUGIN_TRUE
+BUILD_CGPLUGIN_FALSE
+OPENEXR_CFLAGS
+OPENEXR_LIBS
+BUILD_EXRPLUGIN_TRUE
+BUILD_EXRPLUGIN_FALSE
+BUILD_DX9RENDERSYSTEM_TRUE
+BUILD_DX9RENDERSYSTEM_FALSE
+OGRE_BUILD_SSE_TRUE
+OGRE_BUILD_SSE_FALSE
+SAME_PLATFORM_AND_GUI_TRUE
+SAME_PLATFORM_AND_GUI_FALSE
+OIS_CFLAGS
+OIS_LIBS
+OGRE_BUILDING_DEMOS_TRUE
+OGRE_BUILDING_DEMOS_FALSE
+CEGUI_CFLAGS
+CEGUI_LIBS
+HAVE_CEGUI_TRUE
+HAVE_CEGUI_FALSE
+abs_top_builddir
+ogreexecdir
+LIB@&t@OBJS
+LTLIBOBJS'
+ac_subst_files=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CXX
+CXXFLAGS
+CCC
+YACC
+YFLAGS
+CPP
+CXXCPP
+F77
+FFLAGS
+PKG_CONFIG
+ZZIPLIB_CFLAGS
+ZZIPLIB_LIBS
+XMKMF
+GTK_CFLAGS
+GTK_LIBS
+OPENEXR_CFLAGS
+OPENEXR_LIBS
+OIS_CFLAGS
+OIS_LIBS
+CEGUI_CFLAGS
+CEGUI_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute directory names.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures OGRE 1.4.5 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+			  [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+			  [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root @<:@DATAROOTDIR/doc/ogre@:>@
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+X features:
+  --x-includes=DIR    X include files are in DIR
+  --x-libraries=DIR   X library files are in DIR
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of OGRE 1.4.5:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-static@<:@=PKGS@:>@  build static libraries @<:@default=no@:>@
+  --enable-shared@<:@=PKGS@:>@  build shared libraries @<:@default=yes@:>@
+  --enable-fast-install@<:@=PKGS@:>@ 
+                          optimize for fast installation @<:@default=yes@:>@
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+  --disable-freetypetest  Do not try to compile and run
+                          a test FreeType program
+  --enable-double         Build OGRE in double floating point precision mode.
+                          This is not recommended for normal use as it is
+                          slower.
+  --enable-threading      Indicate general support for multithreading. This
+                          will enable threading support in certain parts of
+                          the engine, mainly resource loading and SharedPtr
+                          handling. WARNING: highly experimental, use with
+                          caution.
+  --disable-freeimage     Don't use FreeImage for image loading. This is not
+                          recommended unless you provide your own image
+                          loading codecs.
+  --disable-devil         Don't use DevIL for image loading. This is not
+                          recommended unless you provide your own image
+                          loading codecs.
+  --disable-cg            Do not build the Cg plugin (recommended you do so!)
+  --enable-openexr        Build the OpenEXR plugin
+  --enable-direct3d       Build the DirectX 9 Render System
+  --disable-ogre-demos    Do not build Ogre demos (CEGUI Renderer - if
+                          enabled/disabled, is not affected by this
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-gnu-ld           assume the C compiler uses GNU ld @<:@default=no@:>@
+  --with-pic              try to use only PIC/non-PIC objects @<:@default=use
+                          both@:>@
+  --with-tags@<:@=TAGS@:>@      include additional configurations @<:@automatic@:>@
+  --with-stlport=PATH     the path to STLPort.
+  --with-ft-prefix=PREFIX
+                          Prefix where FreeType is installed (optional)
+  --with-ft-exec-prefix=PREFIX
+                          Exec prefix where FreeType is installed (optional)
+  --with-cppunit-prefix=PFX   Prefix where CppUnit is installed (optional)
+  --with-cppunit-exec-prefix=PFX  Exec prefix where CppUnit is installed (optional)
+  --with-platform=PLATFORM 
+                          the platform to build, currently GLX or Win32
+  --with-x                use the X Window System
+  --with-gl-support=PLATFORM 
+                          The GLsupport to build (GLX or Win32). Defaults to
+                          the platform. Only set this if you know what you are
+                          doing. Use --with-platform otherwise.
+  --with-gui=type         Select the GUI type to use for dialogs (win32, gtk,
+                          Xt) (default: auto)
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  YACC        The `Yet Another C Compiler' implementation to use. Defaults to
+              the first program found out of: `bison -y', `byacc', `yacc'.
+  YFLAGS      The list of arguments that will be passed by default to $YACC.
+              This script will default YFLAGS to the empty string to avoid a
+              default value of `-d' given by some make applications.
+  CPP         C preprocessor
+  CXXCPP      C++ preprocessor
+  F77         Fortran 77 compiler command
+  FFLAGS      Fortran 77 compiler flags
+  PKG_CONFIG  path to pkg-config utility
+  ZZIPLIB_CFLAGS 
+              C compiler flags for ZZIPLIB, overriding pkg-config
+  ZZIPLIB_LIBS 
+              linker flags for ZZIPLIB, overriding pkg-config
+  XMKMF       Path to xmkmf, Makefile generator for X Window System
+  GTK_CFLAGS  C compiler flags for GTK, overriding pkg-config
+  GTK_LIBS    linker flags for GTK, overriding pkg-config
+  OPENEXR_CFLAGS 
+              C compiler flags for OPENEXR, overriding pkg-config
+  OPENEXR_LIBS 
+              linker flags for OPENEXR, overriding pkg-config
+  OIS_CFLAGS  C compiler flags for OIS, overriding pkg-config
+  OIS_LIBS    linker flags for OIS, overriding pkg-config
+  CEGUI_CFLAGS 
+              C compiler flags for CEGUI, overriding pkg-config
+  CEGUI_LIBS  linker flags for CEGUI, overriding pkg-config
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" || continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+OGRE configure 1.4.5
+generated by GNU Autoconf 2.61
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by OGRE $as_me 1.4.5, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+@%:@@%:@ --------- @%:@@%:@
+@%:@@%:@ Platform. @%:@@%:@
+@%:@@%:@ --------- @%:@@%:@
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ Core tests. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+@%:@@%:@ ---------------- @%:@@%:@
+@%:@@%:@ Cache variables. @%:@@%:@
+@%:@@%:@ ---------------- @%:@@%:@
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+@%:@@%:@ ----------------- @%:@@%:@
+@%:@@%:@ Output variables. @%:@@%:@
+@%:@@%:@ ----------------- @%:@@%:@
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+@%:@@%:@ ------------------- @%:@@%:@
+@%:@@%:@ File substitutions. @%:@@%:@
+@%:@@%:@ ------------------- @%:@@%:@
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ confdefs.h. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+	"$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
+do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6; }
+if test "${ac_cv_target+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
+echo "$as_me: error: invalid value of canonical target" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+# New syntax; PACKAGE gets defined as 'OGRE' not 'ogre'
+#AM_INIT_AUTOMAKE([OGRE], 1.4.5)
+am__api_version="1.9"
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+IFS=$as_save_IFS
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.  echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm -f conftest.sed
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+  SET_MAKE=
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE=OGRE
+ VERSION=1.4.5
+
+
+cat >>confdefs.h <<_ACEOF
+@%:@define PACKAGE "$PACKAGE"
+_ACEOF
+
+ 
+cat >>confdefs.h <<_ACEOF
+@%:@define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+ac_config_headers="$ac_config_headers OgreMain/include/config.h"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $@%:@ != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6; }
+
+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext 
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+{ echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval=$enable_dependency_tracking; 
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+ 
+
+if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC"   am_compiler_list=
+
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ 
+
+if 
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CXXFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX"  am_compiler_list=
+
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ 
+
+if 
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+if test "x$CC" != xcc; then
+  { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
+echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; }
+else
+  { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
+echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; }
+fi
+set dummy $CC; ac_cc=`echo $2 |
+		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+   test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.$ac_ext >&5'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+      rm -f conftest2.*
+      if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+      then
+	# cc works too.
+	:
+      else
+	# cc exists but doesn't like -o.
+	eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define NO_MINUS_C_MINUS_O 1
+_ACEOF
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+IFS=$as_save_IFS
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+for ac_prog in 'bison -y' byacc
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_YACC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$YACC"; then
+  ac_cv_prog_YACC="$YACC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_YACC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+YACC=$ac_cv_prog_YACC
+if test -n "$YACC"; then
+  { echo "$as_me:$LINENO: result: $YACC" >&5
+echo "${ECHO_T}$YACC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$YACC" && break
+done
+test -n "$YACC" || YACC="yacc"
+
+
+for ac_prog in flex lex
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_LEX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$LEX"; then
+  ac_cv_prog_LEX="$LEX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LEX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+LEX=$ac_cv_prog_LEX
+if test -n "$LEX"; then
+  { echo "$as_me:$LINENO: result: $LEX" >&5
+echo "${ECHO_T}$LEX" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$LEX" && break
+done
+test -n "$LEX" || LEX=":"
+
+if test "x$LEX" != "x:"; then
+  cat >conftest.l <<_ACEOF
+%%
+a { ECHO; }
+b { REJECT; }
+c { yymore (); }
+d { yyless (1); }
+e { yyless (input () != 0); }
+f { unput (yytext[0]); }
+. { BEGIN INITIAL; }
+%%
+#ifdef YYTEXT_POINTER
+extern char *yytext;
+#endif
+int
+main (void)
+{
+  return ! yylex () + ! yywrap ();
+}
+_ACEOF
+{ (ac_try="$LEX conftest.l"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$LEX conftest.l") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ echo "$as_me:$LINENO: checking lex output file root" >&5
+echo $ECHO_N "checking lex output file root... $ECHO_C" >&6; }
+if test "${ac_cv_prog_lex_root+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  
+if test -f lex.yy.c; then
+  ac_cv_prog_lex_root=lex.yy
+elif test -f lexyy.c; then
+  ac_cv_prog_lex_root=lexyy
+else
+  { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
+echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
+echo "${ECHO_T}$ac_cv_prog_lex_root" >&6; }
+LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
+
+if test -z "${LEXLIB+set}"; then
+  { echo "$as_me:$LINENO: checking lex library" >&5
+echo $ECHO_N "checking lex library... $ECHO_C" >&6; }
+if test "${ac_cv_lib_lex+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  
+    ac_save_LIBS=$LIBS
+    ac_cv_lib_lex='none needed'
+    for ac_lib in '' -lfl -ll; do
+      LIBS="$ac_lib $ac_save_LIBS"
+      cat >conftest.$ac_ext <<_ACEOF
+`cat $LEX_OUTPUT_ROOT.c`
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_lex=$ac_lib
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+      test "$ac_cv_lib_lex" != 'none needed' && break
+    done
+    LIBS=$ac_save_LIBS
+  
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5
+echo "${ECHO_T}$ac_cv_lib_lex" >&6; }
+  test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex
+fi
+
+
+{ echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
+echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6; }
+if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # POSIX says lex can declare yytext either as a pointer or an array; the
+# default is implementation-dependent.  Figure out which it is, since
+# not all implementations provide the %pointer and %array declarations.
+ac_cv_prog_lex_yytext_pointer=no
+ac_save_LIBS=$LIBS
+LIBS="$LEXLIB $ac_save_LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#define YYTEXT_POINTER 1
+`cat $LEX_OUTPUT_ROOT.c`
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_prog_lex_yytext_pointer=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_save_LIBS
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
+echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6; }
+if test $ac_cv_prog_lex_yytext_pointer = yes; then
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define YYTEXT_POINTER 1
+_ACEOF
+
+fi
+rm -f conftest.l $LEX_OUTPUT_ROOT.c
+
+fi
+if test "$LEX" = :; then
+  LEX=${am_missing_run}flex
+fi
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+	SHARED_FLAGS="-shared -no-undefined -Xlinker --export-all-symbols"
+
+	PLUGIN_FLAGS="-shared -no-undefined -avoid-version"
+
+	GL_LIBS="-lopengl32 -lglu32"
+	
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
+set dummy ${ac_tool_prefix}windres; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_RC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RC"; then
+  ac_cv_prog_RC="$RC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RC="${ac_tool_prefix}windres"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RC=$ac_cv_prog_RC
+if test -n "$RC"; then
+  { echo "$as_me:$LINENO: result: $RC" >&5
+echo "${ECHO_T}$RC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RC"; then
+  ac_ct_RC=$RC
+  # Extract the first word of "windres", so it can be a program name with args.
+set dummy windres; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_RC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RC"; then
+  ac_cv_prog_ac_ct_RC="$ac_ct_RC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RC="windres"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RC=$ac_cv_prog_ac_ct_RC
+if test -n "$ac_ct_RC"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_RC" >&5
+echo "${ECHO_T}$ac_ct_RC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_RC" = x; then
+    RC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    RC=$ac_ct_RC
+  fi
+else
+  RC="$ac_cv_prog_RC"
+fi
+
+        nt=true
+;;
+*-*-darwin*)
+        SHARED_FLAGS="-shared"
+
+        PLUGIN_FLAGS="-shared -avoid-version"
+
+        GL_LIBS="-lGL -lGLU"
+
+        osx=true
+;;
+ *) 	SHARED_FLAGS="-shared"
+
+	PLUGIN_FLAGS="-shared -avoid-version"
+
+	GL_LIBS="-lGL -lGLU"
+
+        linux=true
+;;
+esac
+ 
+
+if test x$nt = xtrue; then
+  OGRE_NT_TRUE=
+  OGRE_NT_FALSE='#'
+else
+  OGRE_NT_TRUE='#'
+  OGRE_NT_FALSE=
+fi
+
+ 
+
+if test x$linux = xtrue; then
+  OGRE_LINUX_TRUE=
+  OGRE_LINUX_FALSE='#'
+else
+  OGRE_LINUX_TRUE='#'
+  OGRE_LINUX_FALSE=
+fi
+
+ 
+
+if test x$osx = xtrue ; then
+  OGRE_OSX_TRUE=
+  OGRE_OSX_FALSE='#'
+else
+  OGRE_OSX_TRUE='#'
+  OGRE_OSX_FALSE=
+fi
+
+
+
+# Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval=$enable_static; 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
+else
+  enable_static=no
+fi
+
+
+
+# Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval=$enable_shared; 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
+else
+  enable_shared=yes
+fi
+
+
+# Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval=$enable_fast_install; 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
+else
+  enable_fast_install=yes
+fi
+
+
+{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; }
+if test "${lt_cv_path_SED+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # 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
+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
+
+fi
+
+SED=$lt_cv_path_SED
+{ echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6; }
+
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+    # Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_GREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+ 
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+    # Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_EGREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+
+   fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+ 
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+else
+  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; }
+if test "${lt_cv_path_NM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm="$ac_dir/${ac_tool_prefix}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"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+echo "${ECHO_T}$lt_cv_path_NM" >&6; }
+NM="$lt_cv_path_NM"
+
+{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6; }
+fi
+
+{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
+echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; }
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu | 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
+  ;;
+
+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*)
+  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=unknown
+  ;;
+
+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
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  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
+    ;;
+  esac
+  ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; }
+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
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval=$enable_libtool_lock; 
+fi
+
+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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.o` in
+    *32-bit*)
+      case $host in
+        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-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          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"
+  { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; }
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  lt_cv_cc_needs_belf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	lt_cv_cc_needs_belf=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; }
+  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
+  ;;
+
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+  
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ 
+fi
+
+done
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ 
+fi
+
+done
+
+
+
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
+if test -z "$CXXCPP"; then
+  if test "${ac_cv_prog_CXXCPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+  
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+fi
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  { echo "$as_me:$LINENO: result: $F77" >&5
+echo "${ECHO_T}$F77" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$F77" && break
+  done
+fi
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_F77="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+echo "${ECHO_T}$ac_ct_F77" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_F77" && break
+done
+
+  if test "x$ac_ct_F77" = x; then
+    F77=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    F77=$ac_ct_F77
+  fi
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; }
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_f77_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_f77_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_prog_f77_g=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; }
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
+
+G77=`test $ac_compiler_gnu = yes && echo yes`
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+
+# find the maximum length of command line arguments
+{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; }
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    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*)
+    # 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;
+    ;;
+
+  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`
+    ;;
+  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
+    ;;
+  *)
+    # 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.
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+	       = "XX$teststring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
+	    lt_cv_sys_max_cmd_len=$new_result &&
+	    test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    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`
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6; }
+fi
+
+
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  
+# 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]*\)'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+linux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDGIRSTW]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris* | sysv5*)
+  symcode='[BDRT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# 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
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Try without a prefix undercore, 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.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && 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 <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+	  cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+	  cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+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_prog_compiler_no_builtin_flag"
+	  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && 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" >&5
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -f 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
+
+fi
+
+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
+  { echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6; }
+else
+  { echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6; }
+fi
+
+{ echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }
+if test "${lt_cv_objdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+echo "${ECHO_T}$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+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.
+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'
+
+# 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 avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+for cc_temp in $compiler""; 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-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      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 <<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
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      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 <<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
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+enable_dlopen=no
+enable_win32_dll=no
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval=$enable_libtool_lock; 
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then
+  withval=$with_pic; pic_mode="$withval"
+else
+  pic_mode=default
+fi
+
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+#
+# Check for any special shared library compilation flags.
+#
+lt_prog_cc_shlib=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    lt_prog_cc_shlib='-belf'
+    ;;
+  esac
+fi
+if test -n "$lt_prog_cc_shlib"; then
+  { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5
+echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;}
+  if echo "$old_CC $old_CFLAGS " | grep "[ 	]$lt_prog_cc_shlib[ 	]" >/dev/null; then :
+  else
+    { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
+echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
+    lt_cv_prog_cc_can_build_shared=no
+  fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_static_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
+   printf "$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>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
+       $SED '/^$/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works=yes
+       fi
+     else
+       lt_prog_compiler_static_works=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; }
+
+if test x"$lt_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+  
+{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # 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\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+ 
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      else
+	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic='-qnocommon'
+         lt_prog_compiler_wl='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-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_prog_compiler_pic='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-KPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fpic'
+	lt_prog_compiler_static='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic='-Kpic'
+      lt_prog_compiler_static='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic='-Kconform_pic'
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+  
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # 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\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  runpath_var=
+  allow_undefined_flag=
+  enable_shared_with_static_runtimes=no
+  archive_cmds=
+  archive_expsym_cmds=
+  old_archive_From_new_cmds=
+  old_archive_from_expsyms_cmds=
+  export_dynamic_flag_spec=
+  whole_archive_flag_spec=
+  thread_safe_flag_spec=
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_flag_spec_ld=
+  hardcode_libdir_separator=
+  hardcode_direct=no
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  link_all_deplibs=unknown
+  hardcode_automatic=no
+  module_cmds=
+  module_expsym_cmds=
+  always_export_symbols=no
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # 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'.
+  exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; 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-%%"`
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=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
+    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${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
+	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` 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
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$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)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$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
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec='${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
+	  whole_archive_flag_spec='${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' ;;
+	esac
+	archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$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.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds='$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].*|aix5*)
+	  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.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+
+      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
+  	  hardcode_direct=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct=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
+  	  hardcode_minus_L=yes
+  	  hardcode_libdir_flag_spec='-L$libdir'
+  	  hardcode_libdir_separator=
+	  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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=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.
+	allow_undefined_flag='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag="-z nodefs"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec='${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.
+	  no_undefined_flag=' ${wl}-bernotok'
+	  allow_undefined_flag=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec=' '
+	  archive_cmds_need_lc=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$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)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec=' '
+      allow_undefined_flag=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.
+      archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc=no
+      hardcode_direct=no
+      hardcode_automatic=yes
+      hardcode_shlibpath_var=unsupported
+      whole_archive_flag_spec=''
+      link_all_deplibs=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs=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*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds='$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
+	archive_cmds='$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
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds='$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*|ia64*)
+	  archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld='+b $libdir'
+	  hardcode_libdir_separator=:
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec='-L$libdir'
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator=:
+	  hardcode_direct=yes
+	  export_dynamic_flag_spec='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      link_all_deplibs=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    openbsd*)
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$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'
+      old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      hardcode_libdir_separator=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z text'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	wlarc=''
+	archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds='$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'
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
+      esac
+      link_all_deplibs=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.
+	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds='$CC -r -o $output$reload_objs'
+	  hardcode_direct=no
+        ;;
+	motorola)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=no
+      hardcode_shlibpath_var=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds='$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'
+      hardcode_libdir_flag_spec=
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+echo "${ECHO_T}$ld_shlibs" >&6; }
+test "$ld_shlibs" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag
+        allow_undefined_flag=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc=no
+        else
+	  archive_cmds_need_lc=yes
+        fi
+        allow_undefined_flag=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+echo "${ECHO_T}$archive_cmds_need_lc" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;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'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+   test -n "$runpath_var" || \
+   test "X$hardcode_automatic" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct" != 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_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action" >&5
+echo "${ECHO_T}$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink; 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
+
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
+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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+fi
+
+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*)
+    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
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    
+fi
+
+   ;;
+
+  *)
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_svld_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_dld_link=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+	      
+fi
+
+	    
+fi
+
+	  
+fi
+
+	
+fi
+
+      
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+    
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+      
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
+    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
+
+
+# Report which librarie types wil actually be built
+{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6; }
+
+{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
+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
+  ;;
+
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+    ;;
+esac
+{ echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6; }
+
+{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+{ echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6; }
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler \
+    CC \
+    LD \
+    lt_prog_compiler_wl \
+    lt_prog_compiler_pic \
+    lt_prog_compiler_static \
+    lt_prog_compiler_no_builtin_flag \
+    export_dynamic_flag_spec \
+    thread_safe_flag_spec \
+    whole_archive_flag_spec \
+    enable_shared_with_static_runtimes \
+    old_archive_cmds \
+    old_archive_from_new_cmds \
+    predep_objects \
+    postdep_objects \
+    predeps \
+    postdeps \
+    compiler_lib_search_path \
+    archive_cmds \
+    archive_expsym_cmds \
+    postinstall_cmds \
+    postuninstall_cmds \
+    old_archive_from_expsyms_cmds \
+    allow_undefined_flag \
+    no_undefined_flag \
+    export_symbols_cmds \
+    hardcode_libdir_flag_spec \
+    hardcode_libdir_flag_spec_ld \
+    hardcode_libdir_separator \
+    hardcode_automatic \
+    module_cmds \
+    module_expsym_cmds \
+    lt_cv_prog_compiler_c_o \
+    exclude_expsyms \
+    include_expsyms; do
+
+    case $var in
+    old_archive_cmds | \
+    old_archive_from_new_cmds | \
+    archive_cmds | \
+    archive_expsym_cmds | \
+    module_cmds | \
+    module_expsym_cmds | \
+    old_archive_from_expsyms_cmds | \
+    export_symbols_cmds | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  { echo "$as_me:$LINENO: creating $ofile" >&5
+echo "$as_me: creating $ofile" >&6;}
+
+  cat <<__EOF__ >> "$cfgfile"
+#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e 1s/^X//"
+
+# 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
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+
+  case $host_os in
+  aix3*)
+    cat <<\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
+EOF
+    ;;
+  esac
+
+  # 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 '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+# Check whether --with-tags was given.
+if test "${with_tags+set}" = set; then
+  withval=$with_tags; tagnames="$withval"
+fi
+
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
+    else
+      { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
+echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
+    fi
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
+    "") ;;
+    *)  { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
+echo "$as_me: error: invalid tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+	;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
+echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      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_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# 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
+  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
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+for cc_temp in $compiler""; 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-%%"`
+
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+  lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+  
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+else
+  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_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
+    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_CXX='${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
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_CXX=
+    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.
+    archive_cmds_CXX='$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
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+ld_shlibs_CXX=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  aix4* | aix5*)
+    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].*|aix5*)
+	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.
+
+    archive_cmds_CXX=''
+    hardcode_direct_CXX=yes
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+
+    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
+	  hardcode_direct_CXX=yes
+	else
+	  # We have old collect2
+	  hardcode_direct_CXX=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
+	  hardcode_minus_L_CXX=yes
+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
+	  hardcode_libdir_separator_CXX=
+	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
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    always_export_symbols_CXX=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.
+      allow_undefined_flag_CXX='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+	allow_undefined_flag_CXX="-z nodefs"
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	hardcode_libdir_flag_spec_CXX='${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.
+	no_undefined_flag_CXX=' ${wl}-bernotok'
+	allow_undefined_flag_CXX=' ${wl}-berok'
+	# -bexpall does not export symbols beginning with underscore (_)
+	always_export_symbols_CXX=yes
+	# Exported symbols can be pulled into shared objects from archives
+	whole_archive_flag_spec_CXX=' '
+	archive_cmds_need_lc_CXX=yes
+	# This is similar to how AIX traditionally builds its shared libraries.
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+    # as there is no search path for DLLs.
+    hardcode_libdir_flag_spec_CXX='-L$libdir'
+    allow_undefined_flag_CXX=unsupported
+    always_export_symbols_CXX=no
+    enable_shared_with_static_runtimes_CXX=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      archive_expsym_cmds_CXX='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}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+  ;;
+      darwin* | rhapsody*)
+        case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      archive_cmds_need_lc_CXX=no
+      hardcode_direct_CXX=no
+      hardcode_automatic_CXX=yes
+      hardcode_shlibpath_var_CXX=unsupported
+      whole_archive_flag_spec_CXX=''
+      link_all_deplibs_CXX=yes
+
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      else
+          archive_cmds_CXX='$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'
+        fi
+        module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_CXX=no
+          ;;
+      esac
+      fi
+        ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      ghcx*)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  freebsd[12]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    ld_shlibs_CXX=no
+    ;;
+  freebsd-elf*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  freebsd* | kfreebsd*-gnu | dragonfly*)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    ld_shlibs_CXX=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    hardcode_direct_CXX=yes
+    hardcode_minus_L_CXX=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
+      ld_shlibs_CXX=no
+      ;;
+    aCC*)
+      archive_cmds_CXX='$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) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        archive_cmds_CXX='$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
+        ld_shlibs_CXX=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case $host_cpu in
+      hppa*64*)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+	hardcode_libdir_separator_CXX=:
+        ;;
+      ia64*)
+	hardcode_libdir_flag_spec_CXX='-L$libdir'
+        ;;
+      *)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+	export_dynamic_flag_spec_CXX='${wl}-E'
+        ;;
+      esac
+    fi
+    case $host_cpu in
+    hppa*64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      ;;
+    ia64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      hardcode_minus_L_CXX=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    *)
+      hardcode_direct_CXX=yes
+      hardcode_minus_L_CXX=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
+	ld_shlibs_CXX=no
+	;;
+      aCC*)
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  archive_cmds_CXX='$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 $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case $host_cpu in
+	    ia64*|hppa*64*)
+	      archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	      ;;
+	    *)
+	      archive_cmds_CXX='$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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC*)
+	# SGI C++
+	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -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.
+	old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test "$with_gnu_ld" = no; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	  else
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	link_all_deplibs_CXX=yes
+	;;
+    esac
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    ;;
+  linux*)
+    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.
+	archive_cmds_CXX='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'
+	archive_expsym_cmds_CXX='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 $list'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc*)
+	# 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."*)
+  	  archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+  	  archive_expsym_cmds_CXX='$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
+  	  archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  ;;
+	esac
+	archive_cmds_need_lc_CXX=no
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      pgCC*)
+        # Portland Group C++ compiler
+	archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+  	archive_expsym_cmds_CXX='$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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${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++
+	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_CXX='$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
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      hardcode_libdir_flag_spec_CXX='-R$libdir'
+      hardcode_direct_CXX=yes
+      hardcode_shlibpath_var_CXX=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::"'
+    ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    ld_shlibs_CXX=no
+    ;;
+  openbsd*)
+    hardcode_direct_CXX=yes
+    hardcode_shlibpath_var_CXX=no
+    archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+      export_dynamic_flag_spec_CXX='${wl}-E'
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
+  osf3*)
+    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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx*)
+	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx*)
+	allow_undefined_flag_CXX=' -expect_unresolved \*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_CXX='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 -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	 archive_cmds_CXX='$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` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  sco*)
+    archive_cmds_need_lc_CXX=no
+    case $cc_basename in
+      CC*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      lcc*)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.2, 5.x and Centerline C++
+        archive_cmds_need_lc_CXX=yes
+	no_undefined_flag_CXX=' -zdefs'
+	archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	archive_expsym_cmds_CXX='$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'
+
+	hardcode_libdir_flag_spec_CXX='-R$libdir'
+	hardcode_shlibpath_var_CXX=no
+	case $host_os in
+	  solaris2.[0-5] | solaris2.[0-5].*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker. We must also pass each convience library through
+	    # to the system linker between allextract/defaultextract.
+	    # The C++ compiler will combine linker options so we
+	    # cannot just pass the convience library names through
+	    # without $wl.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	link_all_deplibs_CXX=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.
+	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx*)
+	# Green Hills C++ Compiler
+	archive_cmds_CXX='$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.
+	old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	;;
+      *)
+	# GNU C++ compiler with Solaris linker
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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.
+	    archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC*)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+esac
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$LD"
+
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+  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 "$compiler_lib_search_path_CXX"; then
+	     compiler_lib_search_path_CXX="${prev}${p}"
+	   else
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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 "$postdeps_CXX"; then
+	   postdeps_CXX="${prev}${p}"
+	 else
+	   postdeps_CXX="${postdeps_CXX} ${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 "$predep_objects_CXX"; then
+	   predep_objects_CXX="$p"
+	 else
+	   predep_objects_CXX="$predep_objects_CXX $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_CXX"; then
+	   postdep_objects_CXX="$p"
+	 else
+	   postdep_objects_CXX="$postdep_objects_CXX $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+solaris*)
+  case $cc_basename in
+  CC*)
+    # 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.
+    postdeps_CXX='-lCstd -lCrun'
+    ;;
+  esac
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+ 
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # 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_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # 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).
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # 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*)
+	;;
+      *)
+	lt_prog_compiler_pic_CXX='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  lt_prog_compiler_static_CXX='-Bstatic'
+	else
+	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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
+	;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           lt_prog_compiler_pic_CXX='-qnocommon'
+           lt_prog_compiler_wl_CXX='-Wl,'
+           ;;
+         esac
+       ;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    if test "$host_cpu" != ia64; then
+	      lt_prog_compiler_pic_CXX='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      lt_prog_compiler_pic_CXX='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  icpc* | ecpc*)
+	    # Intel C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  pgCC*)
+	    # Portland Group C++ compiler.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fpic'
+	    lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    lt_prog_compiler_pic_CXX='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      sco*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    lt_prog_compiler_wl_CXX='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    lt_prog_compiler_pic_CXX='-pic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      unixware*)
+	;;
+      vxworks*)
+	;;
+      *)
+	lt_prog_compiler_can_build_shared_CXX=no
+	;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+  
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_CXX=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   # 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\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; }
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # 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
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    export_symbols_cmds_CXX='$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'
+  ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_CXX
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+        allow_undefined_flag_CXX=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_CXX=no
+        else
+	  archive_cmds_need_lc_CXX=yes
+        fi
+        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;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'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+   test -n "$runpath_var_CXX" || \
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_CXX" != 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_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6; }
+
+if test "$hardcode_action_CXX" = relink; 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
+
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
+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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+fi
+
+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*)
+    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
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    
+fi
+
+   ;;
+
+  *)
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_svld_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_dld_link=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+	      
+fi
+
+	    
+fi
+
+	  
+fi
+
+	
+fi
+
+      
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+    
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+      
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
+    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
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_CXX \
+    CC_CXX \
+    LD_CXX \
+    lt_prog_compiler_wl_CXX \
+    lt_prog_compiler_pic_CXX \
+    lt_prog_compiler_static_CXX \
+    lt_prog_compiler_no_builtin_flag_CXX \
+    export_dynamic_flag_spec_CXX \
+    thread_safe_flag_spec_CXX \
+    whole_archive_flag_spec_CXX \
+    enable_shared_with_static_runtimes_CXX \
+    old_archive_cmds_CXX \
+    old_archive_from_new_cmds_CXX \
+    predep_objects_CXX \
+    postdep_objects_CXX \
+    predeps_CXX \
+    postdeps_CXX \
+    compiler_lib_search_path_CXX \
+    archive_cmds_CXX \
+    archive_expsym_cmds_CXX \
+    postinstall_cmds_CXX \
+    postuninstall_cmds_CXX \
+    old_archive_from_expsyms_cmds_CXX \
+    allow_undefined_flag_CXX \
+    no_undefined_flag_CXX \
+    export_symbols_cmds_CXX \
+    hardcode_libdir_flag_spec_CXX \
+    hardcode_libdir_flag_spec_ld_CXX \
+    hardcode_libdir_separator_CXX \
+    hardcode_automatic_CXX \
+    module_cmds_CXX \
+    module_expsym_cmds_CXX \
+    lt_cv_prog_compiler_c_o_CXX \
+    exclude_expsyms_CXX \
+    include_expsyms_CXX; do
+
+    case $var in
+    old_archive_cmds_CXX | \
+    old_archive_from_new_cmds_CXX | \
+    archive_cmds_CXX | \
+    archive_expsym_cmds_CXX | \
+    module_cmds_CXX | \
+    module_expsym_cmds_CXX | \
+    old_archive_from_expsyms_cmds_CXX | \
+    export_symbols_cmds_CXX | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+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
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      F77)
+	if test -n "$F77" && test "X$F77" != "Xno"; then
+	  
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+compiler_F77=$CC
+for cc_temp in $compiler""; 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-%%"`
+
+
+{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6; }
+
+{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
+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
+  ;;
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+esac
+{ echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6; }
+
+{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+{ echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6; }
+
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+GCC_F77="$G77"
+LD_F77="$LD"
+
+lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+ 
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_F77='-Wl,'
+    lt_prog_compiler_static_F77='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_F77='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_F77=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_F77=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic_F77='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_F77='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      else
+	lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic_F77='-qnocommon'
+         lt_prog_compiler_wl_F77='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_F77='-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_prog_compiler_pic_F77='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-KPIC'
+	lt_prog_compiler_static_F77='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-fpic'
+	lt_prog_compiler_static_F77='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_F77='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_F77='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic_F77='-Kpic'
+      lt_prog_compiler_static_F77='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl_F77='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl_F77='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_F77='-Qoption ld '
+      lt_prog_compiler_pic_F77='-PIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_F77='-Kconform_pic'
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_F77='-pic'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+  
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_F77=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_F77"
+   # 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\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_F77=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; }
+
+if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+    case $lt_prog_compiler_pic_F77 in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+     esac
+else
+    lt_prog_compiler_pic_F77=
+     lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_F77=
+    ;;
+  *)
+    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_F77=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_F77=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  runpath_var=
+  allow_undefined_flag_F77=
+  enable_shared_with_static_runtimes_F77=no
+  archive_cmds_F77=
+  archive_expsym_cmds_F77=
+  old_archive_From_new_cmds_F77=
+  old_archive_from_expsyms_cmds_F77=
+  export_dynamic_flag_spec_F77=
+  whole_archive_flag_spec_F77=
+  thread_safe_flag_spec_F77=
+  hardcode_libdir_flag_spec_F77=
+  hardcode_libdir_flag_spec_ld_F77=
+  hardcode_libdir_separator_F77=
+  hardcode_direct_F77=no
+  hardcode_minus_L_F77=no
+  hardcode_shlibpath_var_F77=unsupported
+  link_all_deplibs_F77=unknown
+  hardcode_automatic_F77=no
+  module_cmds_F77=
+  module_expsym_cmds_F77=
+  always_export_symbols_F77=no
+  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_F77=
+  # 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'.
+  exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; 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-%%"`
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_F77=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
+    hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_F77='${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
+	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_F77=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` 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
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_F77=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$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)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_F77=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_F77=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=no
+      enable_shared_with_static_runtimes_F77=yes
+      export_symbols_cmds_F77='$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
+        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_F77='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec_F77='${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
+	  whole_archive_flag_spec_F77='${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' ;;
+	esac
+	archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_F77=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_F77" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_F77=
+      export_dynamic_flag_spec_F77=
+      whole_archive_flag_spec_F77=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=yes
+      archive_expsym_cmds_F77='$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.
+      hardcode_minus_L_F77=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_F77=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_F77='$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].*|aix5*)
+	  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.
+
+      archive_cmds_F77=''
+      hardcode_direct_F77=yes
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+
+      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
+  	  hardcode_direct_F77=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct_F77=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
+  	  hardcode_minus_L_F77=yes
+  	  hardcode_libdir_flag_spec_F77='-L$libdir'
+  	  hardcode_libdir_separator_F77=
+	  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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_F77=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.
+	allow_undefined_flag_F77='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_F77="-z nodefs"
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec_F77='${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.
+	  no_undefined_flag_F77=' ${wl}-bernotok'
+	  allow_undefined_flag_F77=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols_F77=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec_F77=' '
+	  archive_cmds_need_lc_F77=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$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)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_F77=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_F77=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec_F77=' '
+      allow_undefined_flag_F77=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.
+      archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_F77='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_F77=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc_F77=no
+      hardcode_direct_F77=no
+      hardcode_automatic_F77=yes
+      hardcode_shlibpath_var_F77=unsupported
+      whole_archive_flag_spec_F77=''
+      link_all_deplibs_F77=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_F77=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_F77=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*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$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
+	archive_cmds_F77='$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
+      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_direct_F77=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_F77=yes
+      export_dynamic_flag_spec_F77='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$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*|ia64*)
+	  archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+	  hardcode_libdir_separator_F77=:
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec_F77='-L$libdir'
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_F77=:
+	  hardcode_direct_F77=yes
+	  export_dynamic_flag_spec_F77='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      link_all_deplibs_F77=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    newsos6)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_F77='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec_F77='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      allow_undefined_flag_F77=unsupported
+      archive_cmds_F77='$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'
+      old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag_F77=' -z text'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	wlarc=''
+	archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds_F77='$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'
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_shlibpath_var_F77=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
+      esac
+      link_all_deplibs_F77=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.
+	archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_F77='$CC -r -o $output$reload_objs'
+	  hardcode_direct_F77=no
+        ;;
+	motorola)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_F77=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_F77=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_F77='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag_F77=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_F77='$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'
+      hardcode_libdir_flag_spec_F77=
+      hardcode_shlibpath_var_F77=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      ld_shlibs_F77=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+echo "${ECHO_T}$ld_shlibs_F77" >&6; }
+test "$ld_shlibs_F77" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_F77=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_F77 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_F77
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+        allow_undefined_flag_F77=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_F77=no
+        else
+	  archive_cmds_need_lc_F77=yes
+        fi
+        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;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'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" || \
+   test -n "$runpath_var_F77" || \
+   test "X$hardcode_automatic_F77" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_F77" != 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_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+     test "$hardcode_minus_L_F77" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_F77=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_F77=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_F77=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+echo "${ECHO_T}$hardcode_action_F77" >&6; }
+
+if test "$hardcode_action_F77" = relink; 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
+
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
+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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+fi
+
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_F77 \
+    CC_F77 \
+    LD_F77 \
+    lt_prog_compiler_wl_F77 \
+    lt_prog_compiler_pic_F77 \
+    lt_prog_compiler_static_F77 \
+    lt_prog_compiler_no_builtin_flag_F77 \
+    export_dynamic_flag_spec_F77 \
+    thread_safe_flag_spec_F77 \
+    whole_archive_flag_spec_F77 \
+    enable_shared_with_static_runtimes_F77 \
+    old_archive_cmds_F77 \
+    old_archive_from_new_cmds_F77 \
+    predep_objects_F77 \
+    postdep_objects_F77 \
+    predeps_F77 \
+    postdeps_F77 \
+    compiler_lib_search_path_F77 \
+    archive_cmds_F77 \
+    archive_expsym_cmds_F77 \
+    postinstall_cmds_F77 \
+    postuninstall_cmds_F77 \
+    old_archive_from_expsyms_cmds_F77 \
+    allow_undefined_flag_F77 \
+    no_undefined_flag_F77 \
+    export_symbols_cmds_F77 \
+    hardcode_libdir_flag_spec_F77 \
+    hardcode_libdir_flag_spec_ld_F77 \
+    hardcode_libdir_separator_F77 \
+    hardcode_automatic_F77 \
+    module_cmds_F77 \
+    module_expsym_cmds_F77 \
+    lt_cv_prog_compiler_c_o_F77 \
+    exclude_expsyms_F77 \
+    include_expsyms_F77; do
+
+    case $var in
+    old_archive_cmds_F77 | \
+    old_archive_from_new_cmds_F77 | \
+    archive_cmds_F77 | \
+    archive_expsym_cmds_F77 | \
+    module_cmds_F77 | \
+    module_expsym_cmds_F77 | \
+    old_archive_from_expsyms_cmds_F77 | \
+    export_symbols_cmds_F77 | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_F77
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_F77
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_F77
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_F77"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      GCJ)
+	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+	  
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+objext_GCJ=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+compiler_GCJ=$CC
+for cc_temp in $compiler""; 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-%%"`
+
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+archive_cmds_need_lc_GCJ=no
+
+old_archive_cmds_GCJ=$old_archive_cmds
+
+
+lt_prog_compiler_no_builtin_flag_GCJ=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+
+  
+{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # 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\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl_GCJ=
+lt_prog_compiler_pic_GCJ=
+lt_prog_compiler_static_GCJ=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+ 
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_GCJ='-Wl,'
+    lt_prog_compiler_static_GCJ='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_GCJ='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_GCJ=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_GCJ=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic_GCJ='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_GCJ='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      else
+	lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic_GCJ='-qnocommon'
+         lt_prog_compiler_wl_GCJ='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_GCJ='-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_prog_compiler_pic_GCJ='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+	lt_prog_compiler_wl_GCJ='-Wl,'
+	lt_prog_compiler_pic_GCJ='-KPIC'
+	lt_prog_compiler_static_GCJ='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl_GCJ='-Wl,'
+	lt_prog_compiler_pic_GCJ='-fpic'
+	lt_prog_compiler_static_GCJ='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_GCJ='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_GCJ='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic_GCJ='-Kpic'
+      lt_prog_compiler_static_GCJ='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl_GCJ='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl_GCJ='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_GCJ='-Qoption ld '
+      lt_prog_compiler_pic_GCJ='-PIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_GCJ='-Kconform_pic'
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_GCJ='-pic'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_GCJ"; then
+  
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_GCJ=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
+   # 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\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_GCJ=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; }
+
+if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+    case $lt_prog_compiler_pic_GCJ in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
+     esac
+else
+    lt_prog_compiler_pic_GCJ=
+     lt_prog_compiler_can_build_shared_GCJ=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_GCJ=
+    ;;
+  *)
+    lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_GCJ=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_GCJ=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  runpath_var=
+  allow_undefined_flag_GCJ=
+  enable_shared_with_static_runtimes_GCJ=no
+  archive_cmds_GCJ=
+  archive_expsym_cmds_GCJ=
+  old_archive_From_new_cmds_GCJ=
+  old_archive_from_expsyms_cmds_GCJ=
+  export_dynamic_flag_spec_GCJ=
+  whole_archive_flag_spec_GCJ=
+  thread_safe_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_ld_GCJ=
+  hardcode_libdir_separator_GCJ=
+  hardcode_direct_GCJ=no
+  hardcode_minus_L_GCJ=no
+  hardcode_shlibpath_var_GCJ=unsupported
+  link_all_deplibs_GCJ=unknown
+  hardcode_automatic_GCJ=no
+  module_cmds_GCJ=
+  module_expsym_cmds_GCJ=
+  always_export_symbols_GCJ=no
+  export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_GCJ=
+  # 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'.
+  exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; 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-%%"`
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_GCJ=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
+    hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_GCJ='${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
+	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_GCJ=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` 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
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_GCJ=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$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)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_GCJ=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_GCJ=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=no
+      enable_shared_with_static_runtimes_GCJ=yes
+      export_symbols_cmds_GCJ='$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
+        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_GCJ='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec_GCJ='${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
+	  whole_archive_flag_spec_GCJ='${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' ;;
+	esac
+	archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_GCJ=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_GCJ" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_GCJ=
+      export_dynamic_flag_spec_GCJ=
+      whole_archive_flag_spec_GCJ=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=yes
+      archive_expsym_cmds_GCJ='$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.
+      hardcode_minus_L_GCJ=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_GCJ=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_GCJ='$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].*|aix5*)
+	  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.
+
+      archive_cmds_GCJ=''
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_separator_GCJ=':'
+      link_all_deplibs_GCJ=yes
+
+      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
+  	  hardcode_direct_GCJ=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct_GCJ=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
+  	  hardcode_minus_L_GCJ=yes
+  	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
+  	  hardcode_libdir_separator_GCJ=
+	  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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_GCJ=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.
+	allow_undefined_flag_GCJ='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_GCJ="-z nodefs"
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec_GCJ='${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.
+	  no_undefined_flag_GCJ=' ${wl}-bernotok'
+	  allow_undefined_flag_GCJ=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols_GCJ=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec_GCJ=' '
+	  archive_cmds_need_lc_GCJ=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$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)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_GCJ=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_GCJ=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec_GCJ=' '
+      allow_undefined_flag_GCJ=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.
+      archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_GCJ='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_GCJ=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc_GCJ=no
+      hardcode_direct_GCJ=no
+      hardcode_automatic_GCJ=yes
+      hardcode_shlibpath_var_GCJ=unsupported
+      whole_archive_flag_spec_GCJ=''
+      link_all_deplibs_GCJ=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_GCJ=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_GCJ=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*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$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
+	archive_cmds_GCJ='$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
+      hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_direct_GCJ=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_GCJ=yes
+      export_dynamic_flag_spec_GCJ='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_GCJ='$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*|ia64*)
+	  archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
+	  hardcode_libdir_separator_GCJ=:
+	  hardcode_direct_GCJ=no
+	  hardcode_shlibpath_var_GCJ=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
+	  hardcode_direct_GCJ=no
+	  hardcode_shlibpath_var_GCJ=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_GCJ=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_GCJ=:
+	  hardcode_direct_GCJ=yes
+	  export_dynamic_flag_spec_GCJ='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_GCJ=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      link_all_deplibs_GCJ=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    newsos6)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_GCJ='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec_GCJ='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      allow_undefined_flag_GCJ=unsupported
+      archive_cmds_GCJ='$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'
+      old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_GCJ=' -expect_unresolved \*'
+	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_GCJ=' -expect_unresolved \*'
+	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag_GCJ=' -z text'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	wlarc=''
+	archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds_GCJ='$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'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
+      esac
+      link_all_deplibs_GCJ=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.
+	archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_GCJ=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_GCJ='$CC -r -o $output$reload_objs'
+	  hardcode_direct_GCJ=no
+        ;;
+	motorola)
+	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_GCJ=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_GCJ=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=no
+      hardcode_shlibpath_var_GCJ=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_GCJ='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag_GCJ=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_GCJ='$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'
+      hardcode_libdir_flag_spec_GCJ=
+      hardcode_shlibpath_var_GCJ=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    *)
+      ld_shlibs_GCJ=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+echo "${ECHO_T}$ld_shlibs_GCJ" >&6; }
+test "$ld_shlibs_GCJ" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_GCJ" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_GCJ=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_GCJ 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_GCJ
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
+        allow_undefined_flag_GCJ=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_GCJ=no
+        else
+	  archive_cmds_need_lc_GCJ=yes
+        fi
+        allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;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'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action_GCJ=
+if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+   test -n "$runpath_var_GCJ" || \
+   test "X$hardcode_automatic_GCJ" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_GCJ" != 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_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
+     test "$hardcode_minus_L_GCJ" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_GCJ=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_GCJ=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_GCJ=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+echo "${ECHO_T}$hardcode_action_GCJ" >&6; }
+
+if test "$hardcode_action_GCJ" = relink; 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
+
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
+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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+fi
+
+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*)
+    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
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    
+fi
+
+   ;;
+
+  *)
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_svld_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_dld_link=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+	      
+fi
+
+	    
+fi
+
+	  
+fi
+
+	
+fi
+
+      
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+    
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+      
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
+    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
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_GCJ \
+    CC_GCJ \
+    LD_GCJ \
+    lt_prog_compiler_wl_GCJ \
+    lt_prog_compiler_pic_GCJ \
+    lt_prog_compiler_static_GCJ \
+    lt_prog_compiler_no_builtin_flag_GCJ \
+    export_dynamic_flag_spec_GCJ \
+    thread_safe_flag_spec_GCJ \
+    whole_archive_flag_spec_GCJ \
+    enable_shared_with_static_runtimes_GCJ \
+    old_archive_cmds_GCJ \
+    old_archive_from_new_cmds_GCJ \
+    predep_objects_GCJ \
+    postdep_objects_GCJ \
+    predeps_GCJ \
+    postdeps_GCJ \
+    compiler_lib_search_path_GCJ \
+    archive_cmds_GCJ \
+    archive_expsym_cmds_GCJ \
+    postinstall_cmds_GCJ \
+    postuninstall_cmds_GCJ \
+    old_archive_from_expsyms_cmds_GCJ \
+    allow_undefined_flag_GCJ \
+    no_undefined_flag_GCJ \
+    export_symbols_cmds_GCJ \
+    hardcode_libdir_flag_spec_GCJ \
+    hardcode_libdir_flag_spec_ld_GCJ \
+    hardcode_libdir_separator_GCJ \
+    hardcode_automatic_GCJ \
+    module_cmds_GCJ \
+    module_expsym_cmds_GCJ \
+    lt_cv_prog_compiler_c_o_GCJ \
+    exclude_expsyms_GCJ \
+    include_expsyms_GCJ; do
+
+    case $var in
+    old_archive_cmds_GCJ | \
+    old_archive_from_new_cmds_GCJ | \
+    archive_cmds_GCJ | \
+    archive_expsym_cmds_GCJ | \
+    module_cmds_GCJ | \
+    module_expsym_cmds_GCJ | \
+    old_archive_from_expsyms_cmds_GCJ | \
+    export_symbols_cmds_GCJ | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_GCJ
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_GCJ
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_GCJ
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_GCJ
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_GCJ
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_GCJ
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_GCJ
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_GCJ
+archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_GCJ
+module_expsym_cmds=$lt_module_expsym_cmds_GCJ
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_GCJ
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_GCJ
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_GCJ
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_GCJ
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_GCJ
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_GCJ
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_GCJ
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_GCJ
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_GCJ
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_GCJ"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_GCJ
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_GCJ
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_GCJ
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_GCJ
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      RC)
+	
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+objext_RC=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# 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.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+compiler_RC=$CC
+for cc_temp in $compiler""; 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_cv_prog_compiler_c_o_RC=yes
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_RC \
+    CC_RC \
+    LD_RC \
+    lt_prog_compiler_wl_RC \
+    lt_prog_compiler_pic_RC \
+    lt_prog_compiler_static_RC \
+    lt_prog_compiler_no_builtin_flag_RC \
+    export_dynamic_flag_spec_RC \
+    thread_safe_flag_spec_RC \
+    whole_archive_flag_spec_RC \
+    enable_shared_with_static_runtimes_RC \
+    old_archive_cmds_RC \
+    old_archive_from_new_cmds_RC \
+    predep_objects_RC \
+    postdep_objects_RC \
+    predeps_RC \
+    postdeps_RC \
+    compiler_lib_search_path_RC \
+    archive_cmds_RC \
+    archive_expsym_cmds_RC \
+    postinstall_cmds_RC \
+    postuninstall_cmds_RC \
+    old_archive_from_expsyms_cmds_RC \
+    allow_undefined_flag_RC \
+    no_undefined_flag_RC \
+    export_symbols_cmds_RC \
+    hardcode_libdir_flag_spec_RC \
+    hardcode_libdir_flag_spec_ld_RC \
+    hardcode_libdir_separator_RC \
+    hardcode_automatic_RC \
+    module_cmds_RC \
+    module_expsym_cmds_RC \
+    lt_cv_prog_compiler_c_o_RC \
+    exclude_expsyms_RC \
+    include_expsyms_RC; do
+
+    case $var in
+    old_archive_cmds_RC | \
+    old_archive_from_new_cmds_RC | \
+    archive_cmds_RC | \
+    archive_expsym_cmds_RC | \
+    module_cmds_RC | \
+    module_expsym_cmds_RC | \
+    old_archive_from_expsyms_cmds_RC | \
+    export_symbols_cmds_RC | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_RC
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_RC
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_RC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_RC
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_RC
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_RC
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_RC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_RC
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_RC
+archive_expsym_cmds=$lt_archive_expsym_cmds_RC
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_RC
+module_expsym_cmds=$lt_module_expsym_cmds_RC
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_RC
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_RC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_RC
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_RC
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_RC
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_RC
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_RC
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_RC
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_RC
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_RC
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_RC"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_RC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_RC
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_RC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_RC
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	;;
+
+      *)
+	{ { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
+echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+	;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
+echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Prevent multiple expansion
+
+
+
+
+
+
+
+
+
+
+
+  
+
+  
+
+
+  
+       
+       
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# 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
+  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
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+for cc_temp in $compiler""; 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-%%"`
+
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+  lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+  
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+else
+  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_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
+    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_CXX='${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
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_CXX=
+    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.
+    archive_cmds_CXX='$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
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+ld_shlibs_CXX=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  aix4* | aix5*)
+    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].*|aix5*)
+	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.
+
+    archive_cmds_CXX=''
+    hardcode_direct_CXX=yes
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+
+    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
+	  hardcode_direct_CXX=yes
+	else
+	  # We have old collect2
+	  hardcode_direct_CXX=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
+	  hardcode_minus_L_CXX=yes
+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
+	  hardcode_libdir_separator_CXX=
+	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
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    always_export_symbols_CXX=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.
+      allow_undefined_flag_CXX='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+	allow_undefined_flag_CXX="-z nodefs"
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	hardcode_libdir_flag_spec_CXX='${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.
+	no_undefined_flag_CXX=' ${wl}-bernotok'
+	allow_undefined_flag_CXX=' ${wl}-berok'
+	# -bexpall does not export symbols beginning with underscore (_)
+	always_export_symbols_CXX=yes
+	# Exported symbols can be pulled into shared objects from archives
+	whole_archive_flag_spec_CXX=' '
+	archive_cmds_need_lc_CXX=yes
+	# This is similar to how AIX traditionally builds its shared libraries.
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+    # as there is no search path for DLLs.
+    hardcode_libdir_flag_spec_CXX='-L$libdir'
+    allow_undefined_flag_CXX=unsupported
+    always_export_symbols_CXX=no
+    enable_shared_with_static_runtimes_CXX=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      archive_expsym_cmds_CXX='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}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+  ;;
+      darwin* | rhapsody*)
+        case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      archive_cmds_need_lc_CXX=no
+      hardcode_direct_CXX=no
+      hardcode_automatic_CXX=yes
+      hardcode_shlibpath_var_CXX=unsupported
+      whole_archive_flag_spec_CXX=''
+      link_all_deplibs_CXX=yes
+
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      else
+          archive_cmds_CXX='$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'
+        fi
+        module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_CXX=no
+          ;;
+      esac
+      fi
+        ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      ghcx*)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  freebsd[12]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    ld_shlibs_CXX=no
+    ;;
+  freebsd-elf*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  freebsd* | kfreebsd*-gnu | dragonfly*)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    ld_shlibs_CXX=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    hardcode_direct_CXX=yes
+    hardcode_minus_L_CXX=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
+      ld_shlibs_CXX=no
+      ;;
+    aCC*)
+      archive_cmds_CXX='$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) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        archive_cmds_CXX='$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
+        ld_shlibs_CXX=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case $host_cpu in
+      hppa*64*)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+	hardcode_libdir_separator_CXX=:
+        ;;
+      ia64*)
+	hardcode_libdir_flag_spec_CXX='-L$libdir'
+        ;;
+      *)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+	export_dynamic_flag_spec_CXX='${wl}-E'
+        ;;
+      esac
+    fi
+    case $host_cpu in
+    hppa*64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      ;;
+    ia64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      hardcode_minus_L_CXX=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    *)
+      hardcode_direct_CXX=yes
+      hardcode_minus_L_CXX=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
+	ld_shlibs_CXX=no
+	;;
+      aCC*)
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  archive_cmds_CXX='$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 $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case $host_cpu in
+	    ia64*|hppa*64*)
+	      archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	      ;;
+	    *)
+	      archive_cmds_CXX='$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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC*)
+	# SGI C++
+	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -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.
+	old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test "$with_gnu_ld" = no; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	  else
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	link_all_deplibs_CXX=yes
+	;;
+    esac
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    ;;
+  linux*)
+    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.
+	archive_cmds_CXX='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'
+	archive_expsym_cmds_CXX='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 $list'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc*)
+	# 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."*)
+  	  archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+  	  archive_expsym_cmds_CXX='$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
+  	  archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  ;;
+	esac
+	archive_cmds_need_lc_CXX=no
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      pgCC*)
+        # Portland Group C++ compiler
+	archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+  	archive_expsym_cmds_CXX='$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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${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++
+	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_CXX='$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
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      hardcode_libdir_flag_spec_CXX='-R$libdir'
+      hardcode_direct_CXX=yes
+      hardcode_shlibpath_var_CXX=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::"'
+    ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    ld_shlibs_CXX=no
+    ;;
+  openbsd*)
+    hardcode_direct_CXX=yes
+    hardcode_shlibpath_var_CXX=no
+    archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+      export_dynamic_flag_spec_CXX='${wl}-E'
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
+  osf3*)
+    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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx*)
+	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx*)
+	allow_undefined_flag_CXX=' -expect_unresolved \*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_CXX='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 -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	 archive_cmds_CXX='$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` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  sco*)
+    archive_cmds_need_lc_CXX=no
+    case $cc_basename in
+      CC*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      lcc*)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.2, 5.x and Centerline C++
+        archive_cmds_need_lc_CXX=yes
+	no_undefined_flag_CXX=' -zdefs'
+	archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	archive_expsym_cmds_CXX='$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'
+
+	hardcode_libdir_flag_spec_CXX='-R$libdir'
+	hardcode_shlibpath_var_CXX=no
+	case $host_os in
+	  solaris2.[0-5] | solaris2.[0-5].*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker. We must also pass each convience library through
+	    # to the system linker between allextract/defaultextract.
+	    # The C++ compiler will combine linker options so we
+	    # cannot just pass the convience library names through
+	    # without $wl.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	link_all_deplibs_CXX=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.
+	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx*)
+	# Green Hills C++ Compiler
+	archive_cmds_CXX='$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.
+	old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	;;
+      *)
+	# GNU C++ compiler with Solaris linker
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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.
+	    archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC*)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+esac
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$LD"
+
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+  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 "$compiler_lib_search_path_CXX"; then
+	     compiler_lib_search_path_CXX="${prev}${p}"
+	   else
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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 "$postdeps_CXX"; then
+	   postdeps_CXX="${prev}${p}"
+	 else
+	   postdeps_CXX="${postdeps_CXX} ${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 "$predep_objects_CXX"; then
+	   predep_objects_CXX="$p"
+	 else
+	   predep_objects_CXX="$predep_objects_CXX $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_CXX"; then
+	   postdep_objects_CXX="$p"
+	 else
+	   postdep_objects_CXX="$postdep_objects_CXX $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+solaris*)
+  case $cc_basename in
+  CC*)
+    # 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.
+    postdeps_CXX='-lCstd -lCrun'
+    ;;
+  esac
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+ 
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # 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_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # 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).
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # 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*)
+	;;
+      *)
+	lt_prog_compiler_pic_CXX='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  lt_prog_compiler_static_CXX='-Bstatic'
+	else
+	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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
+	;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           lt_prog_compiler_pic_CXX='-qnocommon'
+           lt_prog_compiler_wl_CXX='-Wl,'
+           ;;
+         esac
+       ;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    if test "$host_cpu" != ia64; then
+	      lt_prog_compiler_pic_CXX='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      lt_prog_compiler_pic_CXX='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  icpc* | ecpc*)
+	    # Intel C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  pgCC*)
+	    # Portland Group C++ compiler.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fpic'
+	    lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    lt_prog_compiler_pic_CXX='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      sco*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    lt_prog_compiler_wl_CXX='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    lt_prog_compiler_pic_CXX='-pic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      unixware*)
+	;;
+      vxworks*)
+	;;
+      *)
+	lt_prog_compiler_can_build_shared_CXX=no
+	;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+  
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_CXX=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   # 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\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; }
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # 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
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    export_symbols_cmds_CXX='$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'
+  ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_CXX
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+        allow_undefined_flag_CXX=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_CXX=no
+        else
+	  archive_cmds_need_lc_CXX=yes
+        fi
+        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;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'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+   test -n "$runpath_var_CXX" || \
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_CXX" != 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_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6; }
+
+if test "$hardcode_action_CXX" = relink; 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
+
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
+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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+fi
+
+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*)
+    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
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    
+fi
+
+   ;;
+
+  *)
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_svld_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_dld_link=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+	      
+fi
+
+	    
+fi
+
+	  
+fi
+
+	
+fi
+
+      
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+    
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+      
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
+    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
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_CXX \
+    CC_CXX \
+    LD_CXX \
+    lt_prog_compiler_wl_CXX \
+    lt_prog_compiler_pic_CXX \
+    lt_prog_compiler_static_CXX \
+    lt_prog_compiler_no_builtin_flag_CXX \
+    export_dynamic_flag_spec_CXX \
+    thread_safe_flag_spec_CXX \
+    whole_archive_flag_spec_CXX \
+    enable_shared_with_static_runtimes_CXX \
+    old_archive_cmds_CXX \
+    old_archive_from_new_cmds_CXX \
+    predep_objects_CXX \
+    postdep_objects_CXX \
+    predeps_CXX \
+    postdeps_CXX \
+    compiler_lib_search_path_CXX \
+    archive_cmds_CXX \
+    archive_expsym_cmds_CXX \
+    postinstall_cmds_CXX \
+    postuninstall_cmds_CXX \
+    old_archive_from_expsyms_cmds_CXX \
+    allow_undefined_flag_CXX \
+    no_undefined_flag_CXX \
+    export_symbols_cmds_CXX \
+    hardcode_libdir_flag_spec_CXX \
+    hardcode_libdir_flag_spec_ld_CXX \
+    hardcode_libdir_separator_CXX \
+    hardcode_automatic_CXX \
+    module_cmds_CXX \
+    module_expsym_cmds_CXX \
+    lt_cv_prog_compiler_c_o_CXX \
+    exclude_expsyms_CXX \
+    include_expsyms_CXX; do
+
+    case $var in
+    old_archive_cmds_CXX | \
+    old_archive_from_new_cmds_CXX | \
+    archive_cmds_CXX | \
+    archive_expsym_cmds_CXX | \
+    module_cmds_CXX | \
+    module_expsym_cmds_CXX | \
+    old_archive_from_expsyms_cmds_CXX | \
+    export_symbols_cmds_CXX | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+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
+
+
+# OGRE_CFLAGS contains the compiler flags crucial for stand-alone client
+# programs. They are exported via pkg-config, but not used while building
+# Ogre itself; instead, they are defined in config.h.
+
+
+# Check if compiler supports symbol visibility
+# There are quirks for x86_64 and debug builds with gcc < 4.2
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+{ echo "$as_me:$LINENO: checking if $CXX supports -fvisibility" >&5
+echo $ECHO_N "checking if $CXX supports -fvisibility... $ECHO_C" >&6; }
+if test "${ogre_prog_compiler_supports_visibility+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ogre_prog_compiler_supports_visibility=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fvisibility=hidden -fvisibility-inlines-hidden"
+   # 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\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:__oline__: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       ogre_prog_compiler_supports_visibility=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $ogre_prog_compiler_supports_visibility" >&5
+echo "${ECHO_T}$ogre_prog_compiler_supports_visibility" >&6; }
+
+if test x"$ogre_prog_compiler_supports_visibility" = xyes; then
+    CFLAGS_VISIBILITY="-fvisibility=hidden -fvisibility-inlines-hidden -DOGRE_GCC_VISIBILITY";
+    case $target_cpu in
+        x86_64* )
+            if ! echo "$CFLAGS $CXXFLAGS" | grep -q "\-O"; then
+                echo "***********************************************************************"
+                echo "WARNING: It looks like you're doing a debug build for an x86_64 target."
+                echo "The -fvisibility-inlines-hidden flag is known to give problems in such"
+                echo "situations with libstdc++ < 4.2. Disabling the compiler flag."
+                echo "***********************************************************************"
+                CFLAGS_VISIBILITY="-fvisibility=hidden -DOGRE_GCC_VISIBILITY"
+            fi
+        ;;
+    esac
+    case $CXX in
+        icpc )
+            echo "***********************************************************************"
+            echo "WARNING: The intel compiler currently has bugs in its -fvisibility"
+            echo "implementation. Disabling the compiler flag."
+            echo "***********************************************************************"
+            CFLAGS_VISIBILITY=""
+        ;;
+    esac
+    
+else
+    :
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# Check whether --with-stlport was given.
+if test "${with_stlport+set}" = set; then
+  withval=$with_stlport; ac_cv_use_stlport=$withval
+else
+  ac_cv_use_stlport=no
+fi
+
+ { echo "$as_me:$LINENO: checking whether to use STLPort" >&5
+echo $ECHO_N "checking whether to use STLPort... $ECHO_C" >&6; }
+if test "${ac_cv_use_stlport+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_use_stlport=no
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_use_stlport" >&5
+echo "${ECHO_T}$ac_cv_use_stlport" >&6; }
+ if test x$ac_cv_use_stlport != xno; then
+     STLPORT_CFLAGS="-I$ac_cv_use_stlport/stlport"
+     STLPORT_LIBS="-L$ac_cv_use_stlport/lib -lstlport"
+ fi
+ 
+ 
+
+
+# Check whether --with-ft-prefix was given.
+if test "${with_ft_prefix+set}" = set; then
+  withval=$with_ft_prefix; ft_config_prefix="$withval"
+else
+  ft_config_prefix=""
+fi
+
+
+# Check whether --with-ft-exec-prefix was given.
+if test "${with_ft_exec_prefix+set}" = set; then
+  withval=$with_ft_exec_prefix; ft_config_exec_prefix="$withval"
+else
+  ft_config_exec_prefix=""
+fi
+
+# Check whether --enable-freetypetest was given.
+if test "${enable_freetypetest+set}" = set; then
+  enableval=$enable_freetypetest; 
+else
+  enable_fttest=yes
+fi
+
+
+if test x$ft_config_exec_prefix != x ; then
+  ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
+  if test x${FT2_CONFIG+set} != xset ; then
+    FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
+  fi
+fi
+if test x$ft_config_prefix != x ; then
+  ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
+  if test x${FT2_CONFIG+set} != xset ; then
+    FT2_CONFIG=$ft_config_prefix/bin/freetype-config
+  fi
+fi
+# Extract the first word of "freetype-config", so it can be a program name with args.
+set dummy freetype-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_FT2_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $FT2_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_FT2_CONFIG="$FT2_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_FT2_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_FT2_CONFIG" && ac_cv_path_FT2_CONFIG="no"
+  ;;
+esac
+fi
+FT2_CONFIG=$ac_cv_path_FT2_CONFIG
+if test -n "$FT2_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $FT2_CONFIG" >&5
+echo "${ECHO_T}$FT2_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+
+min_ft_version=9.0.0
+{ echo "$as_me:$LINENO: checking for FreeType - version >= $min_ft_version" >&5
+echo $ECHO_N "checking for FreeType - version >= $min_ft_version... $ECHO_C" >&6; }
+no_ft=""
+if test "$FT2_CONFIG" = "no" ; then
+  no_ft=yes
+else
+  FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
+  FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
+  ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+  ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+  ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+  ft_min_major_version=`echo $min_ft_version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+  ft_min_minor_version=`echo $min_ft_version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+  ft_min_micro_version=`echo $min_ft_version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+  if test x$enable_fttest = xyes ; then
+    ft_config_is_lt=""
+    if test $ft_config_major_version -lt $ft_min_major_version ; then
+      ft_config_is_lt=yes
+    else
+      if test $ft_config_major_version -eq $ft_min_major_version ; then
+        if test $ft_config_minor_version -lt $ft_min_minor_version ; then
+          ft_config_is_lt=yes
+        else
+          if test $ft_config_minor_version -eq $ft_min_minor_version ; then
+            if test $ft_config_micro_version -lt $ft_min_micro_version ; then
+              ft_config_is_lt=yes
+            fi
+          fi
+        fi
+      fi
+    fi
+    if test x$ft_config_is_lt = xyes ; then
+      no_ft=yes
+    else
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $FT2_CFLAGS"
+      LIBS="$FT2_LIBS $LIBS"
+      if test "$cross_compiling" = yes; then
+  echo $ac_n "cross compiling; assumed OK... $ac_c"
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main()
+{
+  FT_Library library;
+  FT_Error error;
+
+  error = FT_Init_FreeType(&library);
+
+  if (error)
+    return 1;
+  else
+  {
+    FT_Done_FreeType(library);
+    return 0;
+  }
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+no_ft=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+      CFLAGS="$ac_save_CFLAGS"
+      LIBS="$ac_save_LIBS"
+    fi             # test $ft_config_version -lt $ft_min_version
+  fi               # test x$enable_fttest = xyes
+fi                 # test "$FT2_CONFIG" = "no"
+if test x$no_ft = x ; then
+   { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+   :
+else
+   { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+   if test "$FT2_CONFIG" = "no" ; then
+     echo "*** The freetype-config script installed by FreeType 2 could not be found."
+     echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in"
+     echo "*** your path, or set the FT2_CONFIG environment variable to the"
+     echo "*** full path to freetype-config."
+   else
+     if test x$ft_config_is_lt = xyes ; then
+       echo "*** Your installed version of the FreeType 2 library is too old."
+       echo "*** If you have different versions of FreeType 2, make sure that"
+       echo "*** correct values for --with-ft-prefix or --with-ft-exec-prefix"
+       echo "*** are used, or set the FT2_CONFIG environment variable to the"
+       echo "*** full path to freetype-config."
+     else
+       echo "*** The FreeType test program failed to run.  If your system uses"
+       echo "*** shared libraries and they are installed outside the normal"
+       echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
+       echo "*** (or whatever is appropiate for your system) is correctly set."
+     fi
+   fi
+   FT2_CFLAGS=""
+   FT2_LIBS=""
+   :
+fi
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBDL 1
+_ACEOF
+
+  LIBS="-ldl $LIBS"
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for pow in -lm" >&5
+echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6; }
+if test "${ac_cv_lib_m_pow+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pow ();
+int
+main ()
+{
+return pow ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_m_pow=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_m_pow=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5
+echo "${ECHO_T}$ac_cv_lib_m_pow" >&6; }
+if test $ac_cv_lib_m_pow = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for gzopen in -lz" >&5
+echo $ECHO_N "checking for gzopen in -lz... $ECHO_C" >&6; }
+if test "${ac_cv_lib_z_gzopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gzopen ();
+int
+main ()
+{
+return gzopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_z_gzopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_z_gzopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzopen" >&5
+echo "${ECHO_T}$ac_cv_lib_z_gzopen" >&6; }
+if test $ac_cv_lib_z_gzopen = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBZ 1
+_ACEOF
+
+  LIBS="-lz $LIBS"
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
+echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; }
+if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_pthread_pthread_create=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_pthread_pthread_create=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; }
+if test $ac_cv_lib_pthread_pthread_create = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBPTHREAD 1
+_ACEOF
+
+  LIBS="-lpthread $LIBS"
+
+fi
+
+{ echo "$as_me:$LINENO: checking for snprintf" >&5
+echo $ECHO_N "checking for snprintf... $ECHO_C" >&6; }
+if test "${ac_cv_func_snprintf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define snprintf to an innocuous variant, in case <limits.h> declares snprintf.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define snprintf innocuous_snprintf
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char snprintf (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef snprintf
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char snprintf ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_snprintf || defined __stub___snprintf
+choke me
+#endif
+
+int
+main ()
+{
+return snprintf ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_snprintf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_snprintf=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_snprintf" >&5
+echo "${ECHO_T}$ac_cv_func_snprintf" >&6; }
+if test $ac_cv_func_snprintf = yes; then
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_SNPRINTF 
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking for vsnprintf" >&5
+echo $ECHO_N "checking for vsnprintf... $ECHO_C" >&6; }
+if test "${ac_cv_func_vsnprintf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define vsnprintf to an innocuous variant, in case <limits.h> declares vsnprintf.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define vsnprintf innocuous_vsnprintf
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char vsnprintf (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef vsnprintf
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char vsnprintf ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_vsnprintf || defined __stub___vsnprintf
+choke me
+#endif
+
+int
+main ()
+{
+return vsnprintf ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_vsnprintf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_vsnprintf=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_vsnprintf" >&5
+echo "${ECHO_T}$ac_cv_func_vsnprintf" >&6; }
+if test $ac_cv_func_vsnprintf = yes; then
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_VSNPRINTF 
+_ACEOF
+
+fi
+
+
+
+
+
+
+# Check whether --with-cppunit-prefix was given.
+if test "${with_cppunit_prefix+set}" = set; then
+  withval=$with_cppunit_prefix; cppunit_config_prefix="$withval"
+else
+  cppunit_config_prefix=""
+fi
+
+
+# Check whether --with-cppunit-exec-prefix was given.
+if test "${with_cppunit_exec_prefix+set}" = set; then
+  withval=$with_cppunit_exec_prefix; cppunit_config_exec_prefix="$withval"
+else
+  cppunit_config_exec_prefix=""
+fi
+
+
+  if test x$cppunit_config_exec_prefix != x ; then
+     cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix"
+     if test x${CPPUNIT_CONFIG+set} != xset ; then
+        CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config
+     fi
+  fi
+  if test x$cppunit_config_prefix != x ; then
+     cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix"
+     if test x${CPPUNIT_CONFIG+set} != xset ; then
+        CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config
+     fi
+  fi
+
+  # Extract the first word of "cppunit-config", so it can be a program name with args.
+set dummy cppunit-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_CPPUNIT_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $CPPUNIT_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CPPUNIT_CONFIG="$CPPUNIT_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CPPUNIT_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_CPPUNIT_CONFIG" && ac_cv_path_CPPUNIT_CONFIG="no"
+  ;;
+esac
+fi
+CPPUNIT_CONFIG=$ac_cv_path_CPPUNIT_CONFIG
+if test -n "$CPPUNIT_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $CPPUNIT_CONFIG" >&5
+echo "${ECHO_T}$CPPUNIT_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  cppunit_version_min=1.10.0
+
+  { echo "$as_me:$LINENO: checking for Cppunit - version >= $cppunit_version_min" >&5
+echo $ECHO_N "checking for Cppunit - version >= $cppunit_version_min... $ECHO_C" >&6; }
+  no_cppunit=""
+  if test "$CPPUNIT_CONFIG" = "no" ; then
+    no_cppunit=yes
+  else
+    CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags`
+    CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs`
+    cppunit_version=`$CPPUNIT_CONFIG --version`
+
+    cppunit_major_version=`echo $cppunit_version | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+    cppunit_minor_version=`echo $cppunit_version | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+    cppunit_micro_version=`echo $cppunit_version | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+
+    cppunit_major_min=`echo $cppunit_version_min | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+    cppunit_minor_min=`echo $cppunit_version_min | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+    cppunit_micro_min=`echo $cppunit_version_min | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+
+    cppunit_version_proper=`expr \
+        $cppunit_major_version \> $cppunit_major_min \| \
+        $cppunit_major_version \= $cppunit_major_min \& \
+        $cppunit_minor_version \> $cppunit_minor_min \| \
+        $cppunit_major_version \= $cppunit_major_min \& \
+        $cppunit_minor_version \= $cppunit_minor_min \& \
+        $cppunit_micro_version \>= $cppunit_micro_min `
+
+    if test "$cppunit_version_proper" = "1" ; then
+      { echo "$as_me:$LINENO: result: $cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version" >&5
+echo "${ECHO_T}$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version" >&6; }
+    else
+      { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+      no_cppunit=yes
+    fi
+  fi
+
+  if test "x$no_cppunit" = x ; then
+     build_unit_tests=true     
+  else
+     CPPUNIT_CFLAGS=""
+     CPPUNIT_LIBS=""
+     :
+  fi
+
+  
+  
+
+ 
+
+if test x$build_unit_tests = xtrue; then
+  BUILD_UNIT_TESTS_TRUE=
+  BUILD_UNIT_TESTS_FALSE='#'
+else
+  BUILD_UNIT_TESTS_TRUE='#'
+  BUILD_UNIT_TESTS_FALSE=
+fi
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.9.0
+	{ echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; }
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	else
+		{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+		PKG_CONFIG=""
+	fi
+		
+fi
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for ZZIPLIB" >&5
+echo $ECHO_N "checking for ZZIPLIB... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$ZZIPLIB_CFLAGS"; then
+        pkg_cv_ZZIPLIB_CFLAGS="$ZZIPLIB_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"zziplib\"") >&5
+  ($PKG_CONFIG --exists --print-errors "zziplib") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_ZZIPLIB_CFLAGS=`$PKG_CONFIG --cflags "zziplib" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$ZZIPLIB_LIBS"; then
+        pkg_cv_ZZIPLIB_LIBS="$ZZIPLIB_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"zziplib\"") >&5
+  ($PKG_CONFIG --exists --print-errors "zziplib") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_ZZIPLIB_LIBS=`$PKG_CONFIG --libs "zziplib" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+        
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        ZZIPLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "zziplib"`
+        else 
+	        ZZIPLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "zziplib"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$ZZIPLIB_PKG_ERRORS" >&5
+
+	{ { echo "$as_me:$LINENO: error: Package requirements (zziplib) were not met:
+
+$ZZIPLIB_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables ZZIPLIB_CFLAGS
+and ZZIPLIB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&5
+echo "$as_me: error: Package requirements (zziplib) were not met:
+
+$ZZIPLIB_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables ZZIPLIB_CFLAGS
+and ZZIPLIB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&2;}
+   { (exit 1); exit 1; }; }
+elif test $pkg_failed = untried; then
+	{ { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables ZZIPLIB_CFLAGS
+and ZZIPLIB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&5
+echo "$as_me: error: The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables ZZIPLIB_CFLAGS
+and ZZIPLIB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+	ZZIPLIB_CFLAGS=$pkg_cv_ZZIPLIB_CFLAGS
+	ZZIPLIB_LIBS=$pkg_cv_ZZIPLIB_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	:
+fi
+
+
+
+OGRE_PLATFORM=GLX
+ 
+# Check whether --with-platform was given.
+if test "${with_platform+set}" = set; then
+  withval=$with_platform; OGRE_PLATFORM=$withval
+else
+  OGRE_PLATFORM=GLX
+fi
+
+
+  PLATFORM_CFLAGS=""
+  PLATFORM_LIBS=""
+
+    case $OGRE_PLATFORM in 
+    GLX)
+      
+for ac_header in X11/Intrinsic.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ 
+else
+  { { echo "$as_me:$LINENO: error: \"libxt headers not found\"" >&5
+echo "$as_me: error: \"libxt headers not found\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+      
+for ac_header in X11/Xaw/Command.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ 
+else
+  { { echo "$as_me:$LINENO: error: \"libxaw headers not found\"" >&5
+echo "$as_me: error: \"libxaw headers not found\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+      
+for ac_header in X11/extensions/xf86vmode.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ 
+else
+  { { echo "$as_me:$LINENO: error: \"libxf86vm headers not found\"" >&5
+echo "$as_me: error: \"libxf86vm headers not found\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+      
+for ac_header in X11/extensions/Xrandr.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+
+@%:@include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ 
+else
+  { { echo "$as_me:$LINENO: error: \"libxrandr headers not found\"" >&5
+echo "$as_me: error: \"libxrandr headers not found\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+      { echo "$as_me:$LINENO: checking for X" >&5
+echo $ECHO_N "checking for X... $ECHO_C" >&6; }
+
+
+# Check whether --with-x was given.
+if test "${with_x+set}" = set; then
+  withval=$with_x; 
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  case $x_includes,$x_libraries in #(
+    *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5
+echo "$as_me: error: Cannot use X directory names containing '" >&2;}
+   { (exit 1); exit 1; }; };; #(
+    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -f -r conftest.dir
+if mkdir conftest.dir; then
+  cd conftest.dir
+  cat >Imakefile <<'_ACEOF'
+incroot:
+	@echo incroot='${INCROOT}'
+usrlibdir:
+	@echo usrlibdir='${USRLIBDIR}'
+libdir:
+	@echo libdir='${LIBDIR}'
+_ACEOF
+  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    for ac_var in incroot usrlibdir libdir; do
+      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+    done
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl; do
+      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
+	ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case $ac_im_incroot in
+	/usr/include) ac_x_includes= ;;
+	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+    esac
+    case $ac_im_usrlibdir in
+	/usr/lib | /lib) ;;
+	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+    esac
+  fi
+  cd ..
+  rm -f -r conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+  # Guess where to find include files, by looking for Xlib.h.
+  # First, try using that file with no special directory specified.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <X11/Xlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  for ac_dir in $ac_x_header_dirs; do
+  if test -r "$ac_dir/X11/Xlib.h"; then
+    ac_x_includes=$ac_dir
+    break
+  fi
+done
+fi
+
+rm -f conftest.err conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+  # Check for the libraries.
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS=$LIBS
+  LIBS="-lX11 $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize ()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS=$ac_save_LIBS
+for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+  # Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl; do
+    if test -r "$ac_dir/libX11.$ac_extension"; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+case $ac_x_includes,$ac_x_libraries in #(
+  no,* | *,no | *\'*)
+    # Didn't find X, or a directory has "'" in its name.
+    ac_cv_have_x="have_x=no";; #(
+  *)
+    # Record where we found X for the cache.
+    ac_cv_have_x="have_x=yes\
+	ac_x_includes='$ac_x_includes'\
+	ac_x_libraries='$ac_x_libraries'"
+esac
+fi
+;; #(
+    *) have_x=yes;;
+  esac
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  { echo "$as_me:$LINENO: result: $have_x" >&5
+echo "${ECHO_T}$have_x" >&6; }
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes\
+	ac_x_includes='$x_includes'\
+	ac_x_libraries='$x_libraries'"
+  { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; }
+fi
+
+      if test x"$x_includes" != x; then
+        if test x"$x_includes" != xNONE; then
+          PLATFORM_CFLAGS="-I$x_includes"
+        fi
+      fi
+      if test x"$x_libraries" != x; then
+        if test x"$x_libraries" != xNONE; then
+          PLATFORM_LIBS="-L$x_libraries -lX11 -lXaw"
+        fi
+            else
+        PLATFORM_LIBS="-lX11 -lXaw"
+      fi
+    ;;
+    Win32)
+      PLATFORM_CFLAGS=""
+      PLATFORM_LIBS="-lgdi32 -lwinmm -ldinput8 -ldxguid"
+    ;;
+  esac
+
+  
+  
+  
+
+OGRE_GLSUPPORT=none
+ 
+# Check whether --with-gl-support was given.
+if test "${with_gl_support+set}" = set; then
+  withval=$with_gl_support; OGRE_GLSUPPORT=$withval
+else
+  OGRE_GLSUPPORT=none
+fi
+
+
+  if test "$OGRE_GLSUPPORT" = "none" ; then
+    OGRE_GLSUPPORT="$OGRE_PLATFORM"
+    { echo "$as_me:$LINENO: setting gl-support to platform: $OGRE_GLSUPPORT" >&5
+echo "$as_me: setting gl-support to platform: $OGRE_GLSUPPORT" >&6;}
+  fi
+  if test "$OGRE_GLSUPPORT" = "Win32" ; then
+    # Uppercase/lowercase
+    OGRE_GLSUPPORT=win32
+  fi
+
+  GLSUPPORT_CFLAGS=""
+  GLSUPPORT_LIBS=""
+
+    case $OGRE_GLSUPPORT in 
+    GLX)
+        { echo "$as_me:$LINENO: checking for X" >&5
+echo $ECHO_N "checking for X... $ECHO_C" >&6; }
+
+
+# Check whether --with-x was given.
+if test "${with_x+set}" = set; then
+  withval=$with_x; 
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  case $x_includes,$x_libraries in #(
+    *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5
+echo "$as_me: error: Cannot use X directory names containing '" >&2;}
+   { (exit 1); exit 1; }; };; #(
+    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -f -r conftest.dir
+if mkdir conftest.dir; then
+  cd conftest.dir
+  cat >Imakefile <<'_ACEOF'
+incroot:
+	@echo incroot='${INCROOT}'
+usrlibdir:
+	@echo usrlibdir='${USRLIBDIR}'
+libdir:
+	@echo libdir='${LIBDIR}'
+_ACEOF
+  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    for ac_var in incroot usrlibdir libdir; do
+      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+    done
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl; do
+      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
+	ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case $ac_im_incroot in
+	/usr/include) ac_x_includes= ;;
+	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+    esac
+    case $ac_im_usrlibdir in
+	/usr/lib | /lib) ;;
+	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+    esac
+  fi
+  cd ..
+  rm -f -r conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+  # Guess where to find include files, by looking for Xlib.h.
+  # First, try using that file with no special directory specified.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <X11/Xlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  for ac_dir in $ac_x_header_dirs; do
+  if test -r "$ac_dir/X11/Xlib.h"; then
+    ac_x_includes=$ac_dir
+    break
+  fi
+done
+fi
+
+rm -f conftest.err conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+  # Check for the libraries.
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS=$LIBS
+  LIBS="-lX11 $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+@%:@include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize ()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS=$ac_save_LIBS
+for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+  # Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl; do
+    if test -r "$ac_dir/libX11.$ac_extension"; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+case $ac_x_includes,$ac_x_libraries in #(
+  no,* | *,no | *\'*)
+    # Didn't find X, or a directory has "'" in its name.
+    ac_cv_have_x="have_x=no";; #(
+  *)
+    # Record where we found X for the cache.
+    ac_cv_have_x="have_x=yes\
+	ac_x_includes='$ac_x_includes'\
+	ac_x_libraries='$ac_x_libraries'"
+esac
+fi
+;; #(
+    *) have_x=yes;;
+  esac
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  { echo "$as_me:$LINENO: result: $have_x" >&5
+echo "${ECHO_T}$have_x" >&6; }
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes\
+	ac_x_includes='$x_includes'\
+	ac_x_libraries='$x_libraries'"
+  { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; }
+fi
+
+        if test x"$x_includes" != x; then
+          if test x"$x_includes" != xNONE; then
+            GLSUPPORT_CFLAGS="-I$x_includes"
+          fi
+        fi
+        if test x"$x_libraries" != x; then
+          if test x"$x_libraries" != xNONE; then
+            GLSUPPORT_LIBS="-L$x_libraries -lX11 -lXext -lGL -lXrandr -lXxf86vm"
+          fi
+                else
+          GLSUPPORT_LIBS="-lX11 -lXext -lGL -lXrandr -lXxf86vm"
+        fi
+    ;;
+    win32)
+	GLSUPPORT_CFLAGS=""
+	GLSUPPORT_LIBS="-lgdi32 -lwinmm"
+    ;;
+  esac
+
+  
+  
+  
+  ac_config_files="$ac_config_files RenderSystems/GL/src/GLX/Makefile RenderSystems/GL/src/win32/Makefile"
+
+
+
+
+    
+# Check whether --with-gui was given.
+if test "${with_gui+set}" = set; then
+  withval=$with_gui; with_gui=${withval}
+else
+  with_gui=auto
+fi
+
+
+    #remove any old files
+    rm -f OgreMain/src/OgreConfigDialog.lo OgreMain/src/OgreErrorDialog.lo
+
+    # Prefer win32, then gtk, then Xt
+    if test "x$with_gui" == "xauto" && test "x$OGRE_PLATFORM" == "xWIN32"; then
+        with_gui=win32
+    fi
+
+    if test "x$with_gui" == "xauto" || test "x$with_gui" == "xgtk"; then
+        
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for GTK" >&5
+echo $ECHO_N "checking for GTK... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$GTK_CFLAGS"; then
+        pkg_cv_GTK_CFLAGS="$GTK_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.0.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.0.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.0.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$GTK_LIBS"; then
+        pkg_cv_GTK_LIBS="$GTK_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.0.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.0.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_GTK_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= 2.0.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+        
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gtk+-2.0 >= 2.0.0"`
+        else 
+	        GTK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gtk+-2.0 >= 2.0.0"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$GTK_PKG_ERRORS" >&5
+
+	
+            if test "x$with_gui" == "xgtk"; then
+                { { echo "$as_me:$LINENO: error: You chose gtk for the GUI but gtk is not available." >&5
+echo "$as_me: error: You chose gtk for the GUI but gtk is not available." >&2;}
+   { (exit 1); exit 1; }; }
+            fi
+        
+elif test $pkg_failed = untried; then
+	
+            if test "x$with_gui" == "xgtk"; then
+                { { echo "$as_me:$LINENO: error: You chose gtk for the GUI but gtk is not available." >&5
+echo "$as_me: error: You chose gtk for the GUI but gtk is not available." >&2;}
+   { (exit 1); exit 1; }; }
+            fi
+        
+else
+	GTK_CFLAGS=$pkg_cv_GTK_CFLAGS
+	GTK_LIBS=$pkg_cv_GTK_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	with_gui=gtk
+fi
+    fi
+
+    if test "x$with_gui" == "xauto"; then
+        with_gui=Xt
+    fi
+
+    if test "x$with_gui" == "xwin32"; then
+        OGRE_GUI=WIN32
+    elif test "x$with_gui" == "xgtk"; then
+        OGRE_GUI=gtk
+    elif test "x$with_gui" == "xXt"; then
+        OGRE_GUI=GLX
+        PLATFORM_LIBS="$PLATFORM_LIBS -lXt -lSM -lICE"
+    else
+        { { echo "$as_me:$LINENO: error: The GUI dialogs for $with_gui are not available." >&5
+echo "$as_me: error: The GUI dialogs for $with_gui are not available." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    # Add the OGRE_GUI_xxx flag to compiler command line
+    PLATFORM_CFLAGS="$PLATFORM_CFLAGS -DOGRE_GUI_$OGRE_GUI"
+    # And export it to client applications as well
+    OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_GUI_$OGRE_GUI"
+
+    
+    
+    
+
+
+# Check whether --enable-double was given.
+if test "${enable_double+set}" = set; then
+  enableval=$enable_double; build_double=$enableval
+else
+  build_double=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether to use double floating point precision" >&5
+echo $ECHO_N "checking whether to use double floating point precision... $ECHO_C" >&6; }
+	case $build_double in
+        yes)
+			
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_DOUBLE_PRECISION 1
+_ACEOF
+
+			OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_DOUBLE_PRECISION"
+			{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+        ;;
+        *)
+			
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_DOUBLE_PRECISION 0
+_ACEOF
+
+			{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+        ;;
+    esac
+
+
+# Check whether --enable-threading was given.
+if test "${enable_threading+set}" = set; then
+  enableval=$enable_threading; build_threads=$enableval
+else
+  build_threads=no
+fi
+
+    case $build_threads in
+        yes)
+            
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_THREAD_SUPPORT 1
+_ACEOF
+
+            OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_THREAD_SUPPORT"
+            # Check for the C++ Boost library
+            { echo "$as_me:$LINENO: checking for main in -lboost_thread" >&5
+echo $ECHO_N "checking for main in -lboost_thread... $ECHO_C" >&6; }
+if test "${ac_cv_lib_boost_thread_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lboost_thread  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_boost_thread_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_boost_thread_main=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_boost_thread_main" >&5
+echo "${ECHO_T}$ac_cv_lib_boost_thread_main" >&6; }
+if test $ac_cv_lib_boost_thread_main = yes; then
+  OGRE_THREAD_LIBS="-lboost_thread"
+else
+  
+                { echo "$as_me:$LINENO: checking for main in -lboost_thread-mt" >&5
+echo $ECHO_N "checking for main in -lboost_thread-mt... $ECHO_C" >&6; }
+if test "${ac_cv_lib_boost_thread_mt_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lboost_thread-mt  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_boost_thread_mt_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_boost_thread_mt_main=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_boost_thread_mt_main" >&5
+echo "${ECHO_T}$ac_cv_lib_boost_thread_mt_main" >&6; }
+if test $ac_cv_lib_boost_thread_mt_main = yes; then
+  OGRE_THREAD_LIBS="-lboost_thread-mt"
+else
+  
+                    { { echo "$as_me:$LINENO: error: You need the C++ boost libraries." >&5
+echo "$as_me: error: You need the C++ boost libraries." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+
+        ;;
+        *)
+            
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_THREAD_SUPPORT 0
+_ACEOF
+
+            OGRE_THREAD_LIBS=""
+            { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+        ;;
+    esac
+    
+
+# Check whether --enable-freeimage was given.
+if test "${enable_freeimage+set}" = set; then
+  enableval=$enable_freeimage; build_freeimage=$enableval
+else
+  build_freeimage=yes
+fi
+
+
+
+ 
+
+if test x$build_freeimage = xyes; then
+  USE_FREEIMAGE_TRUE=
+  USE_FREEIMAGE_FALSE='#'
+else
+  USE_FREEIMAGE_TRUE='#'
+  USE_FREEIMAGE_FALSE=
+fi
+
+
+if test "x$build_freeimage" = "xyes" ; then
+	
+{ echo "$as_me:$LINENO: checking for FreeImage_Load in -lfreeimage" >&5
+echo $ECHO_N "checking for FreeImage_Load in -lfreeimage... $ECHO_C" >&6; }
+if test "${ac_cv_lib_freeimage_FreeImage_Load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lfreeimage -lstdc++ $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char FreeImage_Load ();
+int
+main ()
+{
+return FreeImage_Load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_freeimage_FreeImage_Load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_freeimage_FreeImage_Load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_freeimage_FreeImage_Load" >&5
+echo "${ECHO_T}$ac_cv_lib_freeimage_FreeImage_Load" >&6; }
+if test $ac_cv_lib_freeimage_FreeImage_Load = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBFREEIMAGE 1
+_ACEOF
+
+  LIBS="-lfreeimage $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: 
+****************************************************************
+* You do not have FreeImage installed.  This is required.      *
+* You may find it at http://freeimage.sourceforge.net/.        *
+* Note: You can also provide --disable-freeimage to the build  *
+* process to build without it. This is an advanced option      *
+* useful only if you provide your own image loading codecs.    *
+****************************************************************" >&5
+echo "$as_me: error: 
+****************************************************************
+* You do not have FreeImage installed.  This is required.      *
+* You may find it at http://freeimage.sourceforge.net/.        *
+* Note: You can also provide --disable-freeimage to the build  *
+* process to build without it. This is an advanced option      *
+* useful only if you provide your own image loading codecs.    *
+****************************************************************" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+	
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_NO_FREEIMAGE 0
+_ACEOF
+
+else
+	
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_NO_FREEIMAGE 1
+_ACEOF
+
+	OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_NO_FREEIMAGE"
+fi
+
+
+
+# Check whether --enable-devil was given.
+if test "${enable_devil+set}" = set; then
+  enableval=$enable_devil; build_il=$enableval
+else
+  build_il=yes
+fi
+
+
+ 
+
+if test x$build_il = xyes && test x$build_freeimage = xno; then
+  USE_DEVIL_TRUE=
+  USE_DEVIL_FALSE='#'
+else
+  USE_DEVIL_TRUE='#'
+  USE_DEVIL_FALSE=
+fi
+
+
+if test "x$build_freeimage" = "xyes"; then
+    { echo "$as_me:$LINENO: Freeimage is being built, disabling check for DevIL." >&5
+echo "$as_me: Freeimage is being built, disabling check for DevIL." >&6;}
+    build_il=no
+	
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_NO_DEVIL 1
+_ACEOF
+
+else
+if test "x$build_il" = "xyes"; then
+	
+{ echo "$as_me:$LINENO: checking for ilInit in -lIL" >&5
+echo $ECHO_N "checking for ilInit in -lIL... $ECHO_C" >&6; }
+if test "${ac_cv_lib_IL_ilInit+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lIL  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ilInit ();
+int
+main ()
+{
+return ilInit ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_IL_ilInit=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_IL_ilInit=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_IL_ilInit" >&5
+echo "${ECHO_T}$ac_cv_lib_IL_ilInit" >&6; }
+if test $ac_cv_lib_IL_ilInit = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBIL 1
+_ACEOF
+
+  LIBS="-lIL $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: 
+****************************************************************
+* You do not have DevIL installed.  This is required to build. *
+* You may find it at http://openil.sourceforge.net/.           *
+* Note: You can also provide --disable-devil to the build      *
+* process to build without DevIL. This is an advanced option   *
+* useful only if you provide your own image loading codecs.    *
+****************************************************************" >&5
+echo "$as_me: error: 
+****************************************************************
+* You do not have DevIL installed.  This is required to build. *
+* You may find it at http://openil.sourceforge.net/.           *
+* Note: You can also provide --disable-devil to the build      *
+* process to build without DevIL. This is an advanced option   *
+* useful only if you provide your own image loading codecs.    *
+****************************************************************" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+	
+{ echo "$as_me:$LINENO: checking for iluFlipImage in -lILU" >&5
+echo $ECHO_N "checking for iluFlipImage in -lILU... $ECHO_C" >&6; }
+if test "${ac_cv_lib_ILU_iluFlipImage+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lILU  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char iluFlipImage ();
+int
+main ()
+{
+return iluFlipImage ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_ILU_iluFlipImage=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_ILU_iluFlipImage=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_ILU_iluFlipImage" >&5
+echo "${ECHO_T}$ac_cv_lib_ILU_iluFlipImage" >&6; }
+if test $ac_cv_lib_ILU_iluFlipImage = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBILU 1
+_ACEOF
+
+  LIBS="-lILU $LIBS"
+
+fi
+
+	
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_NO_DEVIL 0
+_ACEOF
+
+else
+	
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_NO_DEVIL 1
+_ACEOF
+
+fi
+fi
+
+
+# Check whether --enable-cg was given.
+if test "${enable_cg+set}" = set; then
+  enableval=$enable_cg; build_cg=$enableval
+else
+  build_cg=yes
+fi
+
+
+if test "x$build_cg" = "xyes" ; then
+	
+{ echo "$as_me:$LINENO: checking for cgCreateProgram in -lCg" >&5
+echo $ECHO_N "checking for cgCreateProgram in -lCg... $ECHO_C" >&6; }
+if test "${ac_cv_lib_Cg_cgCreateProgram+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lCg  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cgCreateProgram ();
+int
+main ()
+{
+return cgCreateProgram ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_Cg_cgCreateProgram=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_Cg_cgCreateProgram=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_Cg_cgCreateProgram" >&5
+echo "${ECHO_T}$ac_cv_lib_Cg_cgCreateProgram" >&6; }
+if test $ac_cv_lib_Cg_cgCreateProgram = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBCG 1
+_ACEOF
+
+  LIBS="-lCg $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: 
+	****************************************************************
+	* You do not have the nVidia Cg libraries installed.           *
+	* Go to http://developer.nvidia.com/object/cg_toolkit.html     *
+	* (Click on Cg_Linux.tar.gz).                                  *
+	* You can disable the building of Cg support by providing      *	
+	* --disable-cg to this configure script but this is highly     *
+	* discouraged as this breaks many of the examples.             *
+	****************************************************************" >&5
+echo "$as_me: error: 
+	****************************************************************
+	* You do not have the nVidia Cg libraries installed.           *
+	* Go to http://developer.nvidia.com/object/cg_toolkit.html     *
+	* (Click on Cg_Linux.tar.gz).                                  *
+	* You can disable the building of Cg support by providing      *	
+	* --disable-cg to this configure script but this is highly     *
+	* discouraged as this breaks many of the examples.             *
+	****************************************************************" >&2;}
+   { (exit 1); exit 1; }; }
+	
+fi
+
+fi
+
+ 
+
+if test x$build_cg = xyes; then
+  BUILD_CGPLUGIN_TRUE=
+  BUILD_CGPLUGIN_FALSE='#'
+else
+  BUILD_CGPLUGIN_TRUE='#'
+  BUILD_CGPLUGIN_FALSE=
+fi
+
+
+
+# Check whether --enable-openexr was given.
+if test "${enable_openexr+set}" = set; then
+  enableval=$enable_openexr; build_exr=$enableval
+else
+  build_exr=no
+fi
+
+
+if test "x$build_exr" = "xyes" ; then
+	
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for OPENEXR" >&5
+echo $ECHO_N "checking for OPENEXR... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$OPENEXR_CFLAGS"; then
+        pkg_cv_OPENEXR_CFLAGS="$OPENEXR_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"OpenEXR\"") >&5
+  ($PKG_CONFIG --exists --print-errors "OpenEXR") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_OPENEXR_CFLAGS=`$PKG_CONFIG --cflags "OpenEXR" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$OPENEXR_LIBS"; then
+        pkg_cv_OPENEXR_LIBS="$OPENEXR_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"OpenEXR\"") >&5
+  ($PKG_CONFIG --exists --print-errors "OpenEXR") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_OPENEXR_LIBS=`$PKG_CONFIG --libs "OpenEXR" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+        
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        OPENEXR_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "OpenEXR"`
+        else 
+	        OPENEXR_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "OpenEXR"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$OPENEXR_PKG_ERRORS" >&5
+
+	build_exr=no
+elif test $pkg_failed = untried; then
+	build_exr=no
+else
+	OPENEXR_CFLAGS=$pkg_cv_OPENEXR_CFLAGS
+	OPENEXR_LIBS=$pkg_cv_OPENEXR_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	build_exr=yes
+fi
+
+	if test "x$build_exr" = "xyes" ; then
+	   	ac_config_files="$ac_config_files PlugIns/EXRCodec/Makefile PlugIns/EXRCodec/src/Makefile PlugIns/EXRCodec/include/Makefile"
+
+		
+		
+
+	fi
+
+fi
+
+ 
+
+if test x$build_exr = xyes; then
+  BUILD_EXRPLUGIN_TRUE=
+  BUILD_EXRPLUGIN_FALSE='#'
+else
+  BUILD_EXRPLUGIN_TRUE='#'
+  BUILD_EXRPLUGIN_FALSE=
+fi
+
+
+
+# Check whether --enable-direct3d was given.
+if test "${enable_direct3d+set}" = set; then
+  enableval=$enable_direct3d; build_dx9=$enableval
+else
+  build_dx9=no
+fi
+
+
+ 
+
+if test x$build_dx9 = xyes; then
+  BUILD_DX9RENDERSYSTEM_TRUE=
+  BUILD_DX9RENDERSYSTEM_FALSE='#'
+else
+  BUILD_DX9RENDERSYSTEM_TRUE='#'
+  BUILD_DX9RENDERSYSTEM_FALSE=
+fi
+
+
+
+
+{ echo "$as_me:$LINENO: checking whether to use SSE" >&5
+echo $ECHO_N "checking whether to use SSE... $ECHO_C" >&6; }
+case $target_cpu in
+	i386 | i486 | i586 | i686 | x86_64 | amd64)
+		build_sse=yes
+	;;
+	*)
+		build_sse=no
+	;;
+esac
+{ echo "$as_me:$LINENO: result: $build_sse" >&5
+echo "${ECHO_T}$build_sse" >&6; }
+ 
+
+if test x$build_sse = xyes; then
+  OGRE_BUILD_SSE_TRUE=
+  OGRE_BUILD_SSE_FALSE='#'
+else
+  OGRE_BUILD_SSE_TRUE='#'
+  OGRE_BUILD_SSE_FALSE=
+fi
+
+
+
+ 
+
+if test "x$OGRE_PLATFORM" = "x$OGRE_GUI"; then
+  SAME_PLATFORM_AND_GUI_TRUE=
+  SAME_PLATFORM_AND_GUI_FALSE='#'
+else
+  SAME_PLATFORM_AND_GUI_TRUE='#'
+  SAME_PLATFORM_AND_GUI_FALSE=
+fi
+
+
+
+
+    # Check whether --enable-ogre_demos was given.
+if test "${enable_ogre_demos+set}" = set; then
+  enableval=$enable_ogre_demos; build_ogre_demos=$enableval
+else
+  build_ogre_demos=yes
+fi
+
+
+    if test "x$build_ogre_demos" = "xyes" ; then
+        
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for OIS" >&5
+echo $ECHO_N "checking for OIS... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$OIS_CFLAGS"; then
+        pkg_cv_OIS_CFLAGS="$OIS_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"OIS >= 1.0.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "OIS >= 1.0.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_OIS_CFLAGS=`$PKG_CONFIG --cflags "OIS >= 1.0.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$OIS_LIBS"; then
+        pkg_cv_OIS_LIBS="$OIS_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"OIS >= 1.0.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "OIS >= 1.0.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_OIS_LIBS=`$PKG_CONFIG --libs "OIS >= 1.0.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+        
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        OIS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "OIS >= 1.0.0"`
+        else 
+	        OIS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "OIS >= 1.0.0"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$OIS_PKG_ERRORS" >&5
+
+	ois_found=no
+elif test $pkg_failed = untried; then
+	ois_found=no
+else
+	OIS_CFLAGS=$pkg_cv_OIS_CFLAGS
+	OIS_LIBS=$pkg_cv_OIS_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	ois_found=yes
+fi
+        
+        
+
+        if test "x$ois_found" = "xyes" ; then
+           { echo "$as_me:$LINENO: *** Ogre Demos will be built ***" >&5
+echo "$as_me: *** Ogre Demos will be built ***" >&6;}
+        else
+          build_ogre_demos=no
+          { echo "$as_me:$LINENO: 
+****************************************************************
+* You do not have OIS installed.  This is required to build    *
+* Ogre demos. You may find it at:                              *
+* http://www.sourceforge.net/projects/wgois.                   *
+* If you do not want to build the demos, you can safely ignore *
+* this.                                                        *
+****************************************************************" >&5
+echo "$as_me: 
+****************************************************************
+* You do not have OIS installed.  This is required to build    *
+* Ogre demos. You may find it at:                              *
+* http://www.sourceforge.net/projects/wgois.                   *
+* If you do not want to build the demos, you can safely ignore *
+* this.                                                        *
+****************************************************************" >&6;}
+        fi
+    else
+        build_ogre_demos=no
+        { echo "$as_me:$LINENO: *** Building of Ogre demos disabled ***" >&5
+echo "$as_me: *** Building of Ogre demos disabled ***" >&6;}
+    fi
+
+     
+
+if test x$build_ogre_demos = xyes; then
+  OGRE_BUILDING_DEMOS_TRUE=
+  OGRE_BUILDING_DEMOS_FALSE='#'
+else
+  OGRE_BUILDING_DEMOS_TRUE='#'
+  OGRE_BUILDING_DEMOS_FALSE=
+fi
+
+
+
+if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+		int main()
+		{
+			short s = 1;
+			short* ptr = &s;
+			unsigned char c = *((char*)ptr);
+			return c;
+		}
+	
+	
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_CONFIG_BIG_ENDIAN 
+_ACEOF
+
+          OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_CONFIG_BIG_ENDIAN"
+	
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+
+cat >>confdefs.h <<\_ACEOF
+@%:@define OGRE_CONFIG_LITTLE_ENDIAN 
+_ACEOF
+
+          OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_CONFIG_LITTLE_ENDIAN"
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking whether -fPIC is needed" >&5
+echo $ECHO_N "checking whether -fPIC is needed... $ECHO_C" >&6; }
+    case $host in
+        x86_64-*)
+            CXXFLAGS="$CXXFLAGS -fPIC"
+            { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+        ;;
+        *)
+            { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+        ;;
+    esac
+
+
+
+    
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for CEGUI" >&5
+echo $ECHO_N "checking for CEGUI... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$CEGUI_CFLAGS"; then
+        pkg_cv_CEGUI_CFLAGS="$CEGUI_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"CEGUI >= 0.5.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "CEGUI >= 0.5.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_CEGUI_CFLAGS=`$PKG_CONFIG --cflags "CEGUI >= 0.5.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$CEGUI_LIBS"; then
+        pkg_cv_CEGUI_LIBS="$CEGUI_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"CEGUI >= 0.5.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "CEGUI >= 0.5.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_CEGUI_LIBS=`$PKG_CONFIG --libs "CEGUI >= 0.5.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+        
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        CEGUI_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "CEGUI >= 0.5.0"`
+        else 
+	        CEGUI_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "CEGUI >= 0.5.0"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$CEGUI_PKG_ERRORS" >&5
+
+	build_cegui_sample=false
+elif test $pkg_failed = untried; then
+	build_cegui_sample=false
+else
+	CEGUI_CFLAGS=$pkg_cv_CEGUI_CFLAGS
+	CEGUI_LIBS=$pkg_cv_CEGUI_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	build_cegui_sample=true
+fi
+    if test x$build_cegui_sample = xtrue; then
+        ac_config_files="$ac_config_files Samples/Common/CEGUIRenderer/Makefile Samples/Common/CEGUIRenderer/CEGUI-OGRE.pc Samples/Common/CEGUIRenderer/src/Makefile Samples/Common/CEGUIRenderer/include/Makefile Samples/Gui/Makefile Samples/Gui/src/Makefile"
+
+        
+        
+        { echo "$as_me:$LINENO: result: CEGUI available, Gui and FacialAnimation samples will be built" >&5
+echo "${ECHO_T}CEGUI available, Gui and FacialAnimation samples will be built" >&6; }
+    else
+        { echo "$as_me:$LINENO: result: CEGUI not available, Gui and FacialAnimation samples will not be built" >&5
+echo "${ECHO_T}CEGUI not available, Gui and FacialAnimation samples will not be built" >&6; }
+    fi
+     
+
+if test x$build_cegui_sample = xtrue; then
+  HAVE_CEGUI_TRUE=
+  HAVE_CEGUI_FALSE='#'
+else
+  HAVE_CEGUI_TRUE='#'
+  HAVE_CEGUI_FALSE=
+fi
+
+
+
+CFLAGS="$CFLAGS"
+CXXFLAGS="$CXXFLAGS"
+LIBS="$LIBS"
+
+ogreexecdir='${abs_top_builddir}/Samples/Common/bin'
+
+
+
+ac_config_files="$ac_config_files Makefile OgreMain/Makefile OgreMain/src/Makefile OgreMain/include/Makefile OgreMain/include/GLX/Makefile OgreMain/include/gtk/Makefile PlugIns/Makefile PlugIns/BSPSceneManager/Makefile PlugIns/BSPSceneManager/src/Makefile PlugIns/BSPSceneManager/include/Makefile PlugIns/CgProgramManager/Makefile PlugIns/CgProgramManager/src/Makefile PlugIns/CgProgramManager/include/Makefile PlugIns/OctreeSceneManager/Makefile PlugIns/OctreeSceneManager/src/Makefile PlugIns/OctreeSceneManager/include/Makefile PlugIns/ParticleFX/Makefile PlugIns/ParticleFX/src/Makefile PlugIns/ParticleFX/include/Makefile RenderSystems/Makefile RenderSystems/GL/Makefile RenderSystems/GL/src/Makefile RenderSystems/GL/include/Makefile RenderSystems/GL/src/atifs/Makefile RenderSystems/GL/src/atifs/include/Makefile RenderSystems/GL/src/atifs/src/Makefile RenderSystems/GL/src/GLSL/Makefile RenderSystems/GL/src/GLSL/include/Makefile RenderSystems/GL/src/GLSL/src/Makefile RenderSystems/GL/src/nvparse/Makefile RenderSystems/Direct3D9/Makefile RenderSystems/Direct3D9/src/Makefile RenderSystems/Direct3D9/include/Makefile Samples/Makefile Samples/Common/Makefile Samples/Common/include/Makefile Samples/Common/bin/Makefile Samples/BezierPatch/Makefile Samples/BezierPatch/src/Makefile Samples/BezierPatch/include/Makefile Samples/CameraTrack/Makefile Samples/CameraTrack/src/Makefile Samples/CelShading/Makefile Samples/CelShading/src/Makefile Samples/Compositor/Makefile Samples/Compositor/src/Makefile Samples/Compositor/include/Makefile Samples/CubeMapping/Makefile Samples/CubeMapping/src/Makefile Samples/CubeMapping/include/Makefile Samples/DeferredShading/Makefile Samples/DeferredShading/src/Makefile Samples/DeferredShading/include/Makefile Samples/Dot3Bump/Makefile Samples/Dot3Bump/src/Makefile Samples/EnvMapping/Makefile Samples/EnvMapping/src/Makefile Samples/EnvMapping/include/Makefile Samples/FacialAnimation/Makefile Samples/FacialAnimation/src/Makefile Samples/Fresnel/Makefile Samples/Fresnel/src/Makefile Samples/Grass/Makefile Samples/Grass/src/Makefile Samples/Transpacency/Makefile Samples/Transpacency/src/Makefile Samples/Transpacency/include/Makefile Samples/Lighting/Makefile Samples/Lighting/src/Makefile Samples/Lighting/include/Makefile Samples/OceanDemo/Makefile Samples/OceanDemo/src/Makefile Samples/OceanDemo/include/Makefile Samples/ParticleFX/Makefile Samples/ParticleFX/src/Makefile Samples/ParticleFX/include/Makefile Samples/RenderToTexture/Makefile Samples/RenderToTexture/src/Makefile Samples/TextureFX/Makefile Samples/TextureFX/src/Makefile Samples/TextureFX/include/Makefile Samples/Shadows/Makefile Samples/Shadows/src/Makefile Samples/SkyBox/Makefile Samples/SkyBox/src/Makefile Samples/SkyBox/include/Makefile Samples/SkyDome/Makefile Samples/SkyDome/src/Makefile Samples/SkyDome/include/Makefile Samples/SkyPlane/Makefile Samples/SkyPlane/src/Makefile Samples/SkyPlane/include/Makefile Samples/Smoke/Makefile Samples/Smoke/src/Makefile Samples/Smoke/include/Makefile Samples/BSP/Makefile Samples/BSP/src/Makefile Samples/SkeletalAnimation/Makefile Samples/SkeletalAnimation/src/Makefile Samples/SkeletalAnimation/include/Makefile Samples/Terrain/Makefile Samples/Terrain/src/Makefile Samples/Terrain/include/Makefile Samples/Water/Makefile Samples/Water/src/Makefile Samples/Water/include/Makefile Samples/DynTex/Makefile Samples/DynTex/src/Makefile Samples/DynTex/include/Makefile Samples/VolumeTex/Makefile Samples/VolumeTex/src/Makefile Samples/VolumeTex/include/Makefile Samples/Instancing/Makefile Samples/Instancing/src/Makefile Samples/Instancing/include/Makefile Tests/Makefile Tests/src/Makefile Tools/Makefile Tools/MaterialUpgrader/Makefile Tools/MaterialUpgrader/src/Makefile Tools/MaterialUpgrader/include/Makefile Tools/MeshUpgrader/Makefile Tools/MeshUpgrader/src/Makefile Tools/XMLConverter/Makefile Tools/XMLConverter/src/Makefile Tools/XMLConverter/include/Makefile Tools/LightwaveConverter/Makefile Tools/LightwaveConverter/src/Makefile Tools/LightwaveConverter/include/Makefile OGRE.pc"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIB@&t@OBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${OGRE_NT_TRUE}" && test -z "${OGRE_NT_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"OGRE_NT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"OGRE_NT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${OGRE_LINUX_TRUE}" && test -z "${OGRE_LINUX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"OGRE_LINUX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"OGRE_LINUX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${OGRE_OSX_TRUE}" && test -z "${OGRE_OSX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"OGRE_OSX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"OGRE_OSX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_UNIT_TESTS_TRUE}" && test -z "${BUILD_UNIT_TESTS_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_UNIT_TESTS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_UNIT_TESTS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${USE_FREEIMAGE_TRUE}" && test -z "${USE_FREEIMAGE_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"USE_FREEIMAGE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"USE_FREEIMAGE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${USE_DEVIL_TRUE}" && test -z "${USE_DEVIL_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"USE_DEVIL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"USE_DEVIL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_CGPLUGIN_TRUE}" && test -z "${BUILD_CGPLUGIN_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_CGPLUGIN\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_CGPLUGIN\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_EXRPLUGIN_TRUE}" && test -z "${BUILD_EXRPLUGIN_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_EXRPLUGIN\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_EXRPLUGIN\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_DX9RENDERSYSTEM_TRUE}" && test -z "${BUILD_DX9RENDERSYSTEM_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_DX9RENDERSYSTEM\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_DX9RENDERSYSTEM\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${OGRE_BUILD_SSE_TRUE}" && test -z "${OGRE_BUILD_SSE_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"OGRE_BUILD_SSE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"OGRE_BUILD_SSE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${SAME_PLATFORM_AND_GUI_TRUE}" && test -z "${SAME_PLATFORM_AND_GUI_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"SAME_PLATFORM_AND_GUI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"SAME_PLATFORM_AND_GUI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${OGRE_BUILDING_DEMOS_TRUE}" && test -z "${OGRE_BUILDING_DEMOS_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"OGRE_BUILDING_DEMOS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"OGRE_BUILDING_DEMOS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_CEGUI_TRUE}" && test -z "${HAVE_CEGUI_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_CEGUI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_CEGUI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+	case $1 in
+        -*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by OGRE $as_me 1.4.5, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet      do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+		   instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+		   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+OGRE config.status 1.4.5
+configured by $0, generated by GNU Autoconf 2.61,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX
+@%:@@%:@ Running $as_me. @%:@@%:@
+_ASBOX
+  echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "OgreMain/include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS OgreMain/include/config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "RenderSystems/GL/src/GLX/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/GLX/Makefile" ;;
+    "RenderSystems/GL/src/win32/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/win32/Makefile" ;;
+    "PlugIns/EXRCodec/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/EXRCodec/Makefile" ;;
+    "PlugIns/EXRCodec/src/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/EXRCodec/src/Makefile" ;;
+    "PlugIns/EXRCodec/include/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/EXRCodec/include/Makefile" ;;
+    "Samples/Common/CEGUIRenderer/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/CEGUIRenderer/Makefile" ;;
+    "Samples/Common/CEGUIRenderer/CEGUI-OGRE.pc") CONFIG_FILES="$CONFIG_FILES Samples/Common/CEGUIRenderer/CEGUI-OGRE.pc" ;;
+    "Samples/Common/CEGUIRenderer/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/CEGUIRenderer/src/Makefile" ;;
+    "Samples/Common/CEGUIRenderer/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/CEGUIRenderer/include/Makefile" ;;
+    "Samples/Gui/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Gui/Makefile" ;;
+    "Samples/Gui/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Gui/src/Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "OgreMain/Makefile") CONFIG_FILES="$CONFIG_FILES OgreMain/Makefile" ;;
+    "OgreMain/src/Makefile") CONFIG_FILES="$CONFIG_FILES OgreMain/src/Makefile" ;;
+    "OgreMain/include/Makefile") CONFIG_FILES="$CONFIG_FILES OgreMain/include/Makefile" ;;
+    "OgreMain/include/GLX/Makefile") CONFIG_FILES="$CONFIG_FILES OgreMain/include/GLX/Makefile" ;;
+    "OgreMain/include/gtk/Makefile") CONFIG_FILES="$CONFIG_FILES OgreMain/include/gtk/Makefile" ;;
+    "PlugIns/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/Makefile" ;;
+    "PlugIns/BSPSceneManager/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/BSPSceneManager/Makefile" ;;
+    "PlugIns/BSPSceneManager/src/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/BSPSceneManager/src/Makefile" ;;
+    "PlugIns/BSPSceneManager/include/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/BSPSceneManager/include/Makefile" ;;
+    "PlugIns/CgProgramManager/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/CgProgramManager/Makefile" ;;
+    "PlugIns/CgProgramManager/src/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/CgProgramManager/src/Makefile" ;;
+    "PlugIns/CgProgramManager/include/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/CgProgramManager/include/Makefile" ;;
+    "PlugIns/OctreeSceneManager/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/OctreeSceneManager/Makefile" ;;
+    "PlugIns/OctreeSceneManager/src/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/OctreeSceneManager/src/Makefile" ;;
+    "PlugIns/OctreeSceneManager/include/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/OctreeSceneManager/include/Makefile" ;;
+    "PlugIns/ParticleFX/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/ParticleFX/Makefile" ;;
+    "PlugIns/ParticleFX/src/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/ParticleFX/src/Makefile" ;;
+    "PlugIns/ParticleFX/include/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/ParticleFX/include/Makefile" ;;
+    "RenderSystems/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/Makefile" ;;
+    "RenderSystems/GL/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/Makefile" ;;
+    "RenderSystems/GL/src/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/Makefile" ;;
+    "RenderSystems/GL/include/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/include/Makefile" ;;
+    "RenderSystems/GL/src/atifs/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/atifs/Makefile" ;;
+    "RenderSystems/GL/src/atifs/include/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/atifs/include/Makefile" ;;
+    "RenderSystems/GL/src/atifs/src/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/atifs/src/Makefile" ;;
+    "RenderSystems/GL/src/GLSL/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/GLSL/Makefile" ;;
+    "RenderSystems/GL/src/GLSL/include/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/GLSL/include/Makefile" ;;
+    "RenderSystems/GL/src/GLSL/src/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/GLSL/src/Makefile" ;;
+    "RenderSystems/GL/src/nvparse/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/nvparse/Makefile" ;;
+    "RenderSystems/Direct3D9/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/Direct3D9/Makefile" ;;
+    "RenderSystems/Direct3D9/src/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/Direct3D9/src/Makefile" ;;
+    "RenderSystems/Direct3D9/include/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/Direct3D9/include/Makefile" ;;
+    "Samples/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Makefile" ;;
+    "Samples/Common/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/Makefile" ;;
+    "Samples/Common/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/include/Makefile" ;;
+    "Samples/Common/bin/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/bin/Makefile" ;;
+    "Samples/BezierPatch/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/BezierPatch/Makefile" ;;
+    "Samples/BezierPatch/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/BezierPatch/src/Makefile" ;;
+    "Samples/BezierPatch/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/BezierPatch/include/Makefile" ;;
+    "Samples/CameraTrack/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CameraTrack/Makefile" ;;
+    "Samples/CameraTrack/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CameraTrack/src/Makefile" ;;
+    "Samples/CelShading/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CelShading/Makefile" ;;
+    "Samples/CelShading/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CelShading/src/Makefile" ;;
+    "Samples/Compositor/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Compositor/Makefile" ;;
+    "Samples/Compositor/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Compositor/src/Makefile" ;;
+    "Samples/Compositor/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Compositor/include/Makefile" ;;
+    "Samples/CubeMapping/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CubeMapping/Makefile" ;;
+    "Samples/CubeMapping/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CubeMapping/src/Makefile" ;;
+    "Samples/CubeMapping/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CubeMapping/include/Makefile" ;;
+    "Samples/DeferredShading/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DeferredShading/Makefile" ;;
+    "Samples/DeferredShading/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DeferredShading/src/Makefile" ;;
+    "Samples/DeferredShading/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DeferredShading/include/Makefile" ;;
+    "Samples/Dot3Bump/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Dot3Bump/Makefile" ;;
+    "Samples/Dot3Bump/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Dot3Bump/src/Makefile" ;;
+    "Samples/EnvMapping/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/EnvMapping/Makefile" ;;
+    "Samples/EnvMapping/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/EnvMapping/src/Makefile" ;;
+    "Samples/EnvMapping/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/EnvMapping/include/Makefile" ;;
+    "Samples/FacialAnimation/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/FacialAnimation/Makefile" ;;
+    "Samples/FacialAnimation/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/FacialAnimation/src/Makefile" ;;
+    "Samples/Fresnel/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Fresnel/Makefile" ;;
+    "Samples/Fresnel/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Fresnel/src/Makefile" ;;
+    "Samples/Grass/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Grass/Makefile" ;;
+    "Samples/Grass/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Grass/src/Makefile" ;;
+    "Samples/Transpacency/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Transpacency/Makefile" ;;
+    "Samples/Transpacency/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Transpacency/src/Makefile" ;;
+    "Samples/Transpacency/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Transpacency/include/Makefile" ;;
+    "Samples/Lighting/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Lighting/Makefile" ;;
+    "Samples/Lighting/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Lighting/src/Makefile" ;;
+    "Samples/Lighting/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Lighting/include/Makefile" ;;
+    "Samples/OceanDemo/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/OceanDemo/Makefile" ;;
+    "Samples/OceanDemo/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/OceanDemo/src/Makefile" ;;
+    "Samples/OceanDemo/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/OceanDemo/include/Makefile" ;;
+    "Samples/ParticleFX/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/ParticleFX/Makefile" ;;
+    "Samples/ParticleFX/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/ParticleFX/src/Makefile" ;;
+    "Samples/ParticleFX/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/ParticleFX/include/Makefile" ;;
+    "Samples/RenderToTexture/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/RenderToTexture/Makefile" ;;
+    "Samples/RenderToTexture/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/RenderToTexture/src/Makefile" ;;
+    "Samples/TextureFX/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/TextureFX/Makefile" ;;
+    "Samples/TextureFX/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/TextureFX/src/Makefile" ;;
+    "Samples/TextureFX/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/TextureFX/include/Makefile" ;;
+    "Samples/Shadows/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Shadows/Makefile" ;;
+    "Samples/Shadows/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Shadows/src/Makefile" ;;
+    "Samples/SkyBox/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyBox/Makefile" ;;
+    "Samples/SkyBox/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyBox/src/Makefile" ;;
+    "Samples/SkyBox/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyBox/include/Makefile" ;;
+    "Samples/SkyDome/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyDome/Makefile" ;;
+    "Samples/SkyDome/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyDome/src/Makefile" ;;
+    "Samples/SkyDome/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyDome/include/Makefile" ;;
+    "Samples/SkyPlane/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyPlane/Makefile" ;;
+    "Samples/SkyPlane/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyPlane/src/Makefile" ;;
+    "Samples/SkyPlane/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyPlane/include/Makefile" ;;
+    "Samples/Smoke/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Smoke/Makefile" ;;
+    "Samples/Smoke/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Smoke/src/Makefile" ;;
+    "Samples/Smoke/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Smoke/include/Makefile" ;;
+    "Samples/BSP/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/BSP/Makefile" ;;
+    "Samples/BSP/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/BSP/src/Makefile" ;;
+    "Samples/SkeletalAnimation/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkeletalAnimation/Makefile" ;;
+    "Samples/SkeletalAnimation/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkeletalAnimation/src/Makefile" ;;
+    "Samples/SkeletalAnimation/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkeletalAnimation/include/Makefile" ;;
+    "Samples/Terrain/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Terrain/Makefile" ;;
+    "Samples/Terrain/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Terrain/src/Makefile" ;;
+    "Samples/Terrain/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Terrain/include/Makefile" ;;
+    "Samples/Water/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Water/Makefile" ;;
+    "Samples/Water/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Water/src/Makefile" ;;
+    "Samples/Water/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Water/include/Makefile" ;;
+    "Samples/DynTex/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DynTex/Makefile" ;;
+    "Samples/DynTex/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DynTex/src/Makefile" ;;
+    "Samples/DynTex/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DynTex/include/Makefile" ;;
+    "Samples/VolumeTex/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/VolumeTex/Makefile" ;;
+    "Samples/VolumeTex/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/VolumeTex/src/Makefile" ;;
+    "Samples/VolumeTex/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/VolumeTex/include/Makefile" ;;
+    "Samples/Instancing/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Instancing/Makefile" ;;
+    "Samples/Instancing/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Instancing/src/Makefile" ;;
+    "Samples/Instancing/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Instancing/include/Makefile" ;;
+    "Tests/Makefile") CONFIG_FILES="$CONFIG_FILES Tests/Makefile" ;;
+    "Tests/src/Makefile") CONFIG_FILES="$CONFIG_FILES Tests/src/Makefile" ;;
+    "Tools/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/Makefile" ;;
+    "Tools/MaterialUpgrader/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/MaterialUpgrader/Makefile" ;;
+    "Tools/MaterialUpgrader/src/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/MaterialUpgrader/src/Makefile" ;;
+    "Tools/MaterialUpgrader/include/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/MaterialUpgrader/include/Makefile" ;;
+    "Tools/MeshUpgrader/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/MeshUpgrader/Makefile" ;;
+    "Tools/MeshUpgrader/src/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/MeshUpgrader/src/Makefile" ;;
+    "Tools/XMLConverter/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/XMLConverter/Makefile" ;;
+    "Tools/XMLConverter/src/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/XMLConverter/src/Makefile" ;;
+    "Tools/XMLConverter/include/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/XMLConverter/include/Makefile" ;;
+    "Tools/LightwaveConverter/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/LightwaveConverter/Makefile" ;;
+    "Tools/LightwaveConverter/src/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/LightwaveConverter/src/Makefile" ;;
+    "Tools/LightwaveConverter/include/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/LightwaveConverter/include/Makefile" ;;
+    "OGRE.pc") CONFIG_FILES="$CONFIG_FILES OGRE.pc" ;;
+
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+#
+# Set up the sed scripts for CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "$CONFIG_FILES"; then
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+target!$target$ac_delim
+target_cpu!$target_cpu$ac_delim
+target_vendor!$target_vendor$ac_delim
+target_os!$target_os$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+CYGPATH_W!$CYGPATH_W$ac_delim
+PACKAGE!$PACKAGE$ac_delim
+VERSION!$VERSION$ac_delim
+ACLOCAL!$ACLOCAL$ac_delim
+AUTOCONF!$AUTOCONF$ac_delim
+AUTOMAKE!$AUTOMAKE$ac_delim
+AUTOHEADER!$AUTOHEADER$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+install_sh!$install_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+mkdir_p!$mkdir_p$ac_delim
+AWK!$AWK$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+am__leading_dot!$am__leading_dot$ac_delim
+AMTAR!$AMTAR$ac_delim
+am__tar!$am__tar$ac_delim
+am__untar!$am__untar$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DEPDIR!$DEPDIR$ac_delim
+am__include!$am__include$ac_delim
+am__quote!$am__quote$ac_delim
+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+CCDEPMODE!$CCDEPMODE$ac_delim
+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+CXX!$CXX$ac_delim
+CXXFLAGS!$CXXFLAGS$ac_delim
+ac_ct_CXX!$ac_ct_CXX$ac_delim
+CXXDEPMODE!$CXXDEPMODE$ac_delim
+am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
+am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
+YACC!$YACC$ac_delim
+YFLAGS!$YFLAGS$ac_delim
+LEX!$LEX$ac_delim
+LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim
+LEXLIB!$LEXLIB$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHARED_FLAGS!$SHARED_FLAGS$ac_delim
+PLUGIN_FLAGS!$PLUGIN_FLAGS$ac_delim
+GL_LIBS!$GL_LIBS$ac_delim
+RC!$RC$ac_delim
+OGRE_NT_TRUE!$OGRE_NT_TRUE$ac_delim
+OGRE_NT_FALSE!$OGRE_NT_FALSE$ac_delim
+OGRE_LINUX_TRUE!$OGRE_LINUX_TRUE$ac_delim
+OGRE_LINUX_FALSE!$OGRE_LINUX_FALSE$ac_delim
+OGRE_OSX_TRUE!$OGRE_OSX_TRUE$ac_delim
+OGRE_OSX_FALSE!$OGRE_OSX_FALSE$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+LN_S!$LN_S$ac_delim
+ECHO!$ECHO$ac_delim
+AR!$AR$ac_delim
+RANLIB!$RANLIB$ac_delim
+CPP!$CPP$ac_delim
+CXXCPP!$CXXCPP$ac_delim
+F77!$F77$ac_delim
+FFLAGS!$FFLAGS$ac_delim
+ac_ct_F77!$ac_ct_F77$ac_delim
+LIBTOOL!$LIBTOOL$ac_delim
+OGRE_CFLAGS!$OGRE_CFLAGS$ac_delim
+CFLAGS_VISIBILITY!$CFLAGS_VISIBILITY$ac_delim
+STLPORT_CFLAGS!$STLPORT_CFLAGS$ac_delim
+STLPORT_LIBS!$STLPORT_LIBS$ac_delim
+FT2_CONFIG!$FT2_CONFIG$ac_delim
+FT2_CFLAGS!$FT2_CFLAGS$ac_delim
+FT2_LIBS!$FT2_LIBS$ac_delim
+CPPUNIT_CONFIG!$CPPUNIT_CONFIG$ac_delim
+CPPUNIT_CFLAGS!$CPPUNIT_CFLAGS$ac_delim
+CPPUNIT_LIBS!$CPPUNIT_LIBS$ac_delim
+BUILD_UNIT_TESTS_TRUE!$BUILD_UNIT_TESTS_TRUE$ac_delim
+BUILD_UNIT_TESTS_FALSE!$BUILD_UNIT_TESTS_FALSE$ac_delim
+PKG_CONFIG!$PKG_CONFIG$ac_delim
+ZZIPLIB_CFLAGS!$ZZIPLIB_CFLAGS$ac_delim
+ZZIPLIB_LIBS!$ZZIPLIB_LIBS$ac_delim
+XMKMF!$XMKMF$ac_delim
+PLATFORM_CFLAGS!$PLATFORM_CFLAGS$ac_delim
+PLATFORM_LIBS!$PLATFORM_LIBS$ac_delim
+OGRE_PLATFORM!$OGRE_PLATFORM$ac_delim
+GLSUPPORT_CFLAGS!$GLSUPPORT_CFLAGS$ac_delim
+GLSUPPORT_LIBS!$GLSUPPORT_LIBS$ac_delim
+OGRE_GLSUPPORT!$OGRE_GLSUPPORT$ac_delim
+GTK_CFLAGS!$GTK_CFLAGS$ac_delim
+GTK_LIBS!$GTK_LIBS$ac_delim
+OGRE_GUI!$OGRE_GUI$ac_delim
+OGRE_THREAD_LIBS!$OGRE_THREAD_LIBS$ac_delim
+USE_FREEIMAGE_TRUE!$USE_FREEIMAGE_TRUE$ac_delim
+USE_FREEIMAGE_FALSE!$USE_FREEIMAGE_FALSE$ac_delim
+USE_DEVIL_TRUE!$USE_DEVIL_TRUE$ac_delim
+USE_DEVIL_FALSE!$USE_DEVIL_FALSE$ac_delim
+BUILD_CGPLUGIN_TRUE!$BUILD_CGPLUGIN_TRUE$ac_delim
+BUILD_CGPLUGIN_FALSE!$BUILD_CGPLUGIN_FALSE$ac_delim
+OPENEXR_CFLAGS!$OPENEXR_CFLAGS$ac_delim
+OPENEXR_LIBS!$OPENEXR_LIBS$ac_delim
+BUILD_EXRPLUGIN_TRUE!$BUILD_EXRPLUGIN_TRUE$ac_delim
+BUILD_EXRPLUGIN_FALSE!$BUILD_EXRPLUGIN_FALSE$ac_delim
+BUILD_DX9RENDERSYSTEM_TRUE!$BUILD_DX9RENDERSYSTEM_TRUE$ac_delim
+BUILD_DX9RENDERSYSTEM_FALSE!$BUILD_DX9RENDERSYSTEM_FALSE$ac_delim
+OGRE_BUILD_SSE_TRUE!$OGRE_BUILD_SSE_TRUE$ac_delim
+OGRE_BUILD_SSE_FALSE!$OGRE_BUILD_SSE_FALSE$ac_delim
+SAME_PLATFORM_AND_GUI_TRUE!$SAME_PLATFORM_AND_GUI_TRUE$ac_delim
+SAME_PLATFORM_AND_GUI_FALSE!$SAME_PLATFORM_AND_GUI_FALSE$ac_delim
+OIS_CFLAGS!$OIS_CFLAGS$ac_delim
+OIS_LIBS!$OIS_LIBS$ac_delim
+OGRE_BUILDING_DEMOS_TRUE!$OGRE_BUILDING_DEMOS_TRUE$ac_delim
+OGRE_BUILDING_DEMOS_FALSE!$OGRE_BUILDING_DEMOS_FALSE$ac_delim
+CEGUI_CFLAGS!$CEGUI_CFLAGS$ac_delim
+CEGUI_LIBS!$CEGUI_LIBS$ac_delim
+HAVE_CEGUI_TRUE!$HAVE_CEGUI_TRUE$ac_delim
+HAVE_CEGUI_FALSE!$HAVE_CEGUI_FALSE$ac_delim
+abs_top_builddir!$abs_top_builddir$ac_delim
+ogreexecdir!$ogreexecdir$ac_delim
+LIB@&t@OBJS!$LIB@&t@OBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 76; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$ac_file_inputs $ac_f"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input="Generated from "`IFS=:
+	  echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+  esac
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([	 #]*\\)[^	 ]*\\([	 ]*'
+ac_dB='\\)[	 (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+  sed -n '
+	t rset
+	:rset
+	s/^[	 ]*#[	 ]*define[	 ][	 ]*//
+	t ok
+	d
+	:ok
+	s/[\\&,]/\\&/g
+	s/^\('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+	s/^\('"$ac_word_re"'\)[	 ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[	 #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:	 sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:	 sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:	 sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
+do
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[	 ]*#[	 ]*undef[	 ][	 ]*$ac_word_re[	 ]*\$/b def
+/^[	 ]*#[	 ]*define[	 ][	 ]*$ac_word_re[(	 ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines conftest.tail
+
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
+cat >>$CONFIG_STATUS <<\_ACEOF
+  if test x"$ac_file" != x-; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
+      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f $ac_file
+      mv "$tmp/config.h" $ac_file
+    fi
+  else
+    echo "/* $configure_input  */"
+    cat "$ac_result"
+  fi
+  rm -f "$tmp/out12"
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $ac_file | $ac_file:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X$ac_file : 'X\(//\)[^/]' \| \
+	 X$ac_file : 'X\(//\)$' \| \
+	 X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
+echo X$ac_file |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+  
+  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+
+
+
+ft_detected=yes
+test "x$no_ft" == "xyes" && ft_detected=no
+
+echo "--------=== Configuration summary ===--------"
+echo "    Target platform                 : $OGRE_PLATFORM"
+echo "    OpenGL Ogre support             : $OGRE_GLSUPPORT"
+echo "    GUI library to use              : $with_gui"
+echo "    Use double precision arithmetic : $build_double"
+echo "    Support for threading           : $build_threads"
+echo "    Use STLport                     : $ac_cv_use_stlport"
+echo "    Use FreeType                    : $ft_detected"
+echo "    Use FreeImage                   : $build_freeimage"
+echo "    Use DevIL                       : $build_il"
+echo "    Build OGRE demos                : $build_ogre_demos"
+test "x$build_ogre_demos" == "xyes" && \
+echo "    Build CEGUI demos               : $build_cegui_sample"
+echo "    Build the OpenEXR plugin        : $build_exr"
+echo "    Build the Cg plugin             : $build_cg"
+echo "    Build the DirectX 9 plugin      : $build_dx9"
+echo "--------===============================--------"
Index: /autom4te.cache/requests
===================================================================
--- /autom4te.cache/requests	(revision 5)
+++ /autom4te.cache/requests	(revision 5)
@@ -0,0 +1,239 @@
+# This file was generated.
+# It contains the lists of macros which have been traced.
+# It can be safely removed.
+
+@request = (
+             bless( [
+                      '0',
+                      1,
+                      [
+                        '/usr/pack/autotools-1.0-sd/share/autoconf'
+                      ],
+                      [
+                        '/usr/pack/autotools-1.0-sd/share/autoconf/autoconf/autoconf.m4f',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/pkg.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/amversion.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/auxdir.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/cond.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/depend.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/depout.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/init.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/install-sh.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/lead-dot.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/lex.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/make.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/minuso.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/missing.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/mkdirp.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/options.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/runlog.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/sanity.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/strip.m4',
+                        '/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/tar.m4',
+                        'Scripts/m4/cppunit.m4',
+                        'acinclude.m4',
+                        'configure.in'
+                      ],
+                      {
+                        'AM_ENABLE_STATIC' => 1,
+                        'AC_LIBTOOL_LANG_RC_CONFIG' => 1,
+                        '_LT_AC_SHELL_INIT' => 1,
+                        'AC_DEFUN' => 1,
+                        'AC_CHECK_FT2' => 1,
+                        '_LT_AC_LANG_CXX_CONFIG' => 1,
+                        'AC_PROG_LIBTOOL' => 1,
+                        'AM_PROG_MKDIR_P' => 1,
+                        'AM_AUTOMAKE_VERSION' => 1,
+                        'AM_MISSING_PROG' => 1,
+                        'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1,
+                        'OGRE_CHECK_THREADING' => 1,
+                        '_LT_AC_LANG_C_CONFIG' => 1,
+                        'AM_PROG_INSTALL_STRIP' => 1,
+                        '_m4_warn' => 1,
+                        'OGRE_CHECK_DEVIL' => 1,
+                        'AC_LIBTOOL_OBJDIR' => 1,
+                        'OGRE_GET_GLSUPPORT' => 1,
+                        'AM_SANITY_CHECK' => 1,
+                        'AC_LIBTOOL_PROG_COMPILER_PIC' => 1,
+                        'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1,
+                        '_LT_AC_CHECK_DLFCN' => 1,
+                        'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1,
+                        '_AM_PROG_TAR' => 1,
+                        'AC_LIBTOOL_GCJ' => 1,
+                        'AC_LIBTOOL_CONFIG' => 1,
+                        '_LT_AC_LANG_F77' => 1,
+                        'AM_DISABLE_SHARED' => 1,
+                        'AM_PROG_LIBTOOL' => 1,
+                        '_LT_AC_LANG_CXX' => 1,
+                        '_LT_AC_FILE_LTDLL_C' => 1,
+                        'AM_PROG_LD' => 1,
+                        'AU_DEFUN' => 1,
+                        'AC_PROG_NM' => 1,
+                        'AC_LIBTOOL_DLOPEN' => 1,
+                        'AM_PATH_CPPUNIT' => 1,
+                        'AC_PROG_LD' => 1,
+                        'AC_PROG_LD_GNU' => 1,
+                        'OGRE_CHECK_CG' => 1,
+                        'AC_ENABLE_FAST_INSTALL' => 1,
+                        'OGRE_DETECT_ENDIAN' => 1,
+                        '_AM_SET_OPTION' => 1,
+                        'OGRE_BUILD_DEMOS' => 1,
+                        '_LT_LINKER_BOILERPLATE' => 1,
+                        'AC_LIBTOOL_LANG_CXX_CONFIG' => 1,
+                        'AC_LIBTOOL_PROG_CC_C_O' => 1,
+                        'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
+                        'AC_DEFUN_ONCE' => 1,
+                        '_LT_AC_LANG_GCJ' => 1,
+                        'OGRE_CHECK_DOUBLE' => 1,
+                        'AC_LIBTOOL_RC' => 1,
+                        'AC_DISABLE_FAST_INSTALL' => 1,
+                        '_LT_AC_PROG_ECHO_BACKSLASH' => 1,
+                        'include' => 1,
+                        '_LT_AC_TRY_DLOPEN_SELF' => 1,
+                        '_LT_AC_SYS_LIBPATH_AIX' => 1,
+                        'LT_AC_PROG_SED' => 1,
+                        'AM_ENABLE_SHARED' => 1,
+                        '_LT_AC_LANG_GCJ_CONFIG' => 1,
+                        'AC_ENABLE_SHARED' => 1,
+                        'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1,
+                        'OGRE_USE_STLPORT' => 1,
+                        'AC_ENABLE_STATIC' => 1,
+                        '_LT_AC_TAGVAR' => 1,
+                        'AM_PROG_CC_C_O' => 1,
+                        'AC_LIBTOOL_LANG_F77_CONFIG' => 1,
+                        'AM_CONDITIONAL' => 1,
+                        'AM_PROG_INSTALL_SH' => 1,
+                        'm4_include' => 1,
+                        'AC_PROG_EGREP' => 1,
+                        '_AC_AM_CONFIG_HEADER_HOOK' => 1,
+                        'AC_PATH_MAGIC' => 1,
+                        'OGRE_CHECK_CPPUNIT' => 1,
+                        'AM_MAKE_INCLUDE' => 1,
+                        '_LT_AC_TAGCONFIG' => 1,
+                        'm4_pattern_forbid' => 1,
+                        'OGRE_GET_PLATFORM' => 1,
+                        'OGRE_SETUP_FOR_TARGET' => 1,
+                        'AC_LIBTOOL_COMPILER_OPTION' => 1,
+                        'AC_DISABLE_SHARED' => 1,
+                        '_LT_COMPILER_BOILERPLATE' => 1,
+                        'AC_LIBTOOL_SETUP' => 1,
+                        'AC_LIBTOOL_WIN32_DLL' => 1,
+                        'AC_PROG_LD_RELOAD_FLAG' => 1,
+                        'OGRE_PLATFORM_AND_GUI' => 1,
+                        'AM_MISSING_HAS_RUN' => 1,
+                        'OGRE_CHECK_SSE' => 1,
+                        'AC_LIBTOOL_DLOPEN_SELF' => 1,
+                        'AC_LIBTOOL_PROG_LD_SHLIBS' => 1,
+                        '_PKG_SHORT_ERRORS_SUPPORTED' => 1,
+                        'OGRE_CHECK_PIC' => 1,
+                        'AC_LIBTOOL_LINKER_OPTION' => 1,
+                        'PKG_CHECK_EXISTS' => 1,
+                        'AC_LIBTOOL_CXX' => 1,
+                        'LT_AC_PROG_RC' => 1,
+                        'LT_AC_PROG_GCJ' => 1,
+                        'AM_DISABLE_STATIC' => 1,
+                        'AM_DEP_TRACK' => 1,
+                        '_LT_AC_PROG_CXXCPP' => 1,
+                        '_AC_PROG_LIBTOOL' => 1,
+                        '_AM_IF_OPTION' => 1,
+                        'OGRE_CHECK_FREEIMAGE' => 1,
+                        'AC_PATH_TOOL_PREFIX' => 1,
+                        'm4_pattern_allow' => 1,
+                        'AC_LIBTOOL_F77' => 1,
+                        'AM_SET_LEADING_DOT' => 1,
+                        '_AM_DEPENDENCIES' => 1,
+                        'AC_LIBTOOL_LANG_C_CONFIG' => 1,
+                        '_LT_AC_SYS_COMPILER' => 1,
+                        'AM_PROG_NM' => 1,
+                        'OGRE_CHECK_DX9' => 1,
+                        'PKG_CHECK_MODULES' => 1,
+                        'AC_LIBLTDL_CONVENIENCE' => 1,
+                        'AC_DEPLIBS_CHECK_METHOD' => 1,
+                        'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
+                        'AC_LIBLTDL_INSTALLABLE' => 1,
+                        'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1,
+                        'AM_INIT_AUTOMAKE' => 1,
+                        'AC_DISABLE_STATIC' => 1,
+                        'OGRE_CHECK_CEGUI' => 1,
+                        '_LT_AC_LOCK' => 1,
+                        '_LT_AC_LANG_RC_CONFIG' => 1,
+                        'AC_LIBTOOL_POSTDEP_PREDEP' => 1,
+                        'OGRE_CHECK_OPENEXR' => 1,
+                        'AM_AUX_DIR_EXPAND' => 1,
+                        'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1,
+                        '_LT_AC_LANG_F77_CONFIG' => 1,
+                        '_AM_SET_OPTIONS' => 1,
+                        '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
+                        'AM_RUN_LOG' => 1,
+                        'AC_LIBTOOL_PICMODE' => 1,
+                        'AM_PROG_LEX' => 1,
+                        'AC_CHECK_LIBM' => 1,
+                        'AC_LIBTOOL_SYS_LIB_STRIP' => 1,
+                        '_AM_MANGLE_OPTION' => 1,
+                        'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1,
+                        'AM_SET_DEPDIR' => 1,
+                        'OGRE_CHECK_GUI' => 1,
+                        '_LT_CC_BASENAME' => 1,
+                        'PKG_PROG_PKG_CONFIG' => 1
+                      }
+                    ], 'Autom4te::Request' ),
+             bless( [
+                      '1',
+                      1,
+                      [
+                        '/usr/pack/autotools-1.0-sd/share/autoconf'
+                      ],
+                      [
+                        '/usr/pack/autotools-1.0-sd/share/autoconf/autoconf/autoconf.m4f',
+                        'aclocal.m4',
+                        'configure.in'
+                      ],
+                      {
+                        '_LT_AC_TAGCONFIG' => 1,
+                        'AM_PROG_F77_C_O' => 1,
+                        'AC_INIT' => 1,
+                        'm4_pattern_forbid' => 1,
+                        'AC_CANONICAL_TARGET' => 1,
+                        'AC_SUBST' => 1,
+                        'AC_CONFIG_LIBOBJ_DIR' => 1,
+                        'AC_FC_SRCEXT' => 1,
+                        'AC_CANONICAL_HOST' => 1,
+                        'AC_PROG_LIBTOOL' => 1,
+                        'AM_INIT_AUTOMAKE' => 1,
+                        'AC_CONFIG_SUBDIRS' => 1,
+                        'AM_AUTOMAKE_VERSION' => 1,
+                        'LT_CONFIG_LTDL_DIR' => 1,
+                        'AC_REQUIRE_AUX_FILE' => 1,
+                        'AC_CONFIG_LINKS' => 1,
+                        'm4_sinclude' => 1,
+                        'LT_SUPPORTED_TAG' => 1,
+                        'AM_MAINTAINER_MODE' => 1,
+                        'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
+                        '_m4_warn' => 1,
+                        'AM_PROG_CXX_C_O' => 1,
+                        'AM_ENABLE_MULTILIB' => 1,
+                        'AC_CONFIG_FILES' => 1,
+                        'include' => 1,
+                        'LT_INIT' => 1,
+                        'AM_GNU_GETTEXT' => 1,
+                        'AC_LIBSOURCE' => 1,
+                        'AM_PROG_FC_C_O' => 1,
+                        'AC_CANONICAL_BUILD' => 1,
+                        'AC_FC_FREEFORM' => 1,
+                        'AH_OUTPUT' => 1,
+                        '_AM_SUBST_NOTMAKE' => 1,
+                        'AC_CONFIG_AUX_DIR' => 1,
+                        'sinclude' => 1,
+                        'AM_PROG_CC_C_O' => 1,
+                        'm4_pattern_allow' => 1,
+                        'AC_CANONICAL_SYSTEM' => 1,
+                        'AM_CONDITIONAL' => 1,
+                        'AC_CONFIG_HEADERS' => 1,
+                        'AC_DEFINE_TRACE_LITERAL' => 1,
+                        'm4_include' => 1,
+                        'AC_SUBST_TRACE' => 1
+                      }
+                    ], 'Autom4te::Request' )
+           );
+
Index: /autom4te.cache/traces.0
===================================================================
--- /autom4te.cache/traces.0	(revision 5)
+++ /autom4te.cache/traces.0	(revision 5)
@@ -0,0 +1,10199 @@
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:55: -1- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+  AC_PROVIDE_IFELSE([AC_PROG_CXX],
+    [AC_LIBTOOL_CXX],
+    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+  ])])
+dnl And a similar setup for Fortran 77 support
+  AC_PROVIDE_IFELSE([AC_PROG_F77],
+    [AC_LIBTOOL_F77],
+    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])
+
+dnl Quote AM_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or AM_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+    [AC_LIBTOOL_GCJ],
+    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+      [AC_LIBTOOL_GCJ],
+      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+	[AC_LIBTOOL_GCJ],
+      [ifdef([AC_PROG_GCJ],
+	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([A][M_PROG_GCJ],
+	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([LT_AC_PROG_GCJ],
+	     [define([LT_AC_PROG_GCJ],
+		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:75: -1- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:219: -1- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
+
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_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.
+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']
+
+# 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 avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    AC_PATH_MAGIC
+  fi
+  ;;
+esac
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE([libtool-lock],
+    [AC_HELP_STRING([--disable-libtool-lock],
+	[avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+AC_ARG_WITH([pic],
+    [AC_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=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:232: -1- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:248: -1- AC_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-%%"`
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:261: -1- AC_DEFUN([_LT_COMPILER_BOILERPLATE], [ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:274: -1- AC_DEFUN([_LT_LINKER_BOILERPLATE], [ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:293: -1- AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:304: -1- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE],
+	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+	 [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:460: -1- AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
+
+echo=${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 <<EOF
+[$]*
+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 "$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 &&
+       echo_test_string=`eval $cmd` &&
+       (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.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:588: -1- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock],
+    [AC_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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|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-*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-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          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_TRY_LINK([],[],[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
+  ;;
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+  ])
+esac
+
+need_locks="$enable_libtool_lock"
+
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:633: -1- AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED])
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   printf "$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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$5], , :, [$5])
+else
+    ifelse([$6], , :, [$6])
+fi
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:670: -1- AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   printf "$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 > conftest.exp
+       $SED '/^$/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$4], , :, [$4])
+else
+    ifelse([$5], , :, [$5])
+fi
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:768: -1- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# 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*)
+    # 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;
+    ;;
+
+  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`
+    ;;
+  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
+    ;;
+  *)
+    # 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.
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+	       = "XX$teststring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
+	    lt_cv_sys_max_cmd_len=$new_result &&
+	    test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    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`
+    ;;
+  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
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:775: -1- AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:864: -1- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_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 <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}]
+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_unknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:977: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_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*)
+    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="-dld"],
+	[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="-dld"])
+	      ])
+	    ])
+	  ])
+	])
+      ])
+    ;;
+  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"
+    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_AC_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
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+    	  lt_cv_dlopen_self_static, [dnl
+	  _LT_AC_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
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1028: -1- AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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 > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_AC_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 ..
+   rmdir conftest
+   $rm conftest*
+])
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1055: -1- AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl
+
+hard_links="nottested"
+if test "$_LT_AC_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
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1072: -1- AC_DEFUN([AC_LIBTOOL_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
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1113: -1- AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
+   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$_LT_AC_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_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_AC_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; 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
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1142: -1- AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [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"
+         AC_MSG_RESULT([yes])
+       else
+  AC_MSG_RESULT([no])
+fi
+       ;;
+   *)
+  AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1704: -1- AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics])
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;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'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1805: -1- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags],
+    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+        [include additional configurations @<:@automatic@:>@])],
+    [tagnames="$withval"])
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    AC_MSG_WARN([output file `$ofile' does not exist])
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
+    else
+      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+    fi
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+    "") ;;
+    *)  AC_MSG_ERROR([invalid tag name: $tagname])
+	;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      AC_MSG_ERROR([tag name \"$tagname\" already exists])
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      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_LIBTOOL_LANG_CXX_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      F77)
+	if test -n "$F77" && test "X$F77" != "Xno"; then
+	  AC_LIBTOOL_LANG_F77_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      GCJ)
+	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+	  AC_LIBTOOL_LANG_GCJ_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      RC)
+	AC_LIBTOOL_LANG_RC_CONFIG
+	;;
+
+      *)
+	AC_MSG_ERROR([Unsupported tag name: $tagname])
+	;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    AC_MSG_ERROR([unable to update list of available tagged configurations.])
+  fi
+fi
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1813: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1821: -1- AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1851: -1- AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([shared],
+    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+	[build shared libraries @<:@default=]AC_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=]AC_ENABLE_SHARED_DEFAULT)
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1860: -1- AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1890: -1- AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([static],
+    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+	[build static libraries @<:@default=]AC_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=]AC_ENABLE_STATIC_DEFAULT)
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1899: -1- AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1929: -1- AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([fast-install],
+    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]AC_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=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1938: -1- AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1948: -1- AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2026: -1- AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_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="ifelse([$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 <<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
+
+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
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2041: -1- AC_DEFUN([AC_PATH_MAGIC], [AC_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
+    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2126: -1- AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld],
+    [AC_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])
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])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 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2144: -1- AC_DEFUN([AC_PROG_LD_GNU], [AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2170: -1- AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], [AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2349: -1- AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], [AC_CACHE_CHECK([how to recognise dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[[45]]*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu | 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
+  ;;
+
+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*)
+  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=unknown
+  ;;
+
+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
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  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
+    ;;
+  esac
+  ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+  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
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2394: -1- AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm="$ac_dir/${ac_tool_prefix}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"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2415: -1- AC_DEFUN([AC_CHECK_LIBM], [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
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2440: -1- AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  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='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2476: -1- AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  AC_CHECK_LIB(ltdl, lt_dlinit,
+  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+  [if test x"$enable_ltdl_install" = xno; then
+     AC_MSG_WARN([libltdl not installed, but installation disabled])
+   else
+     enable_ltdl_install=yes
+   fi
+  ])
+  if test x"$enable_ltdl_install" = x"yes"; then
+    ac_configure_args="$ac_configure_args --enable-ltdl-install"
+    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  else
+    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+    LIBLTDL="-lltdl"
+    LTDLINCL=
+  fi
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2484: -1- AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX])
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2493: -1- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2505: -1- AC_DEFUN([_LT_AC_PROG_CXXCPP], [
+AC_REQUIRE([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
+fi
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2512: -1- AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77])
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2520: -1- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2528: -1- AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ])
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2541: -1- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2550: -1- AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2558: -1- AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2662: -1- AC_DEFUN([_LT_AC_LANG_C_CONFIG], [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_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+#
+# Check for any special shared library compilation flags.
+#
+_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
+    ;;
+  esac
+fi
+if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
+  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
+  if echo "$old_CC $old_CFLAGS " | grep "[[ 	]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ 	]]" >/dev/null; then :
+  else
+    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
+    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
+  fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
+  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
+  [],
+  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+
+
+## 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...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+# Report which librarie types wil 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
+  ;;
+
+aix4* | aix5*)
+  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])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2670: -1- AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:3613: -1- AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_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
+  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
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+  AC_PROG_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_AC_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_AC_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_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  aix4* | aix5*)
+    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]].*|aix5*)
+	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_AC_TAGVAR(archive_cmds, $1)=''
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+    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
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	else
+	  # We have old collect2
+	  _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_AC_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
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      _LT_AC_SYS_LIBPATH_AIX
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	_LT_AC_SYS_LIBPATH_AIX
+	_LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	# -bexpall does not export symbols beginning with underscore (_)
+	_LT_AC_TAGVAR(always_export_symbols, $1)=yes
+	# Exported symbols can be pulled into shared objects from archives
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+	# This is similar to how AIX traditionally builds its shared libraries.
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+    # as there is no search path for DLLs.
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+    _LT_AC_TAGVAR(always_export_symbols, $1)=no
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      _LT_AC_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}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+  ;;
+      darwin* | rhapsody*)
+        case $host_os in
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      else
+          _LT_AC_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'
+        fi
+        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
+      fi
+        ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++*)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      ghcx*)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  freebsd[[12]]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  freebsd-elf*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  freebsd* | kfreebsd*-gnu | dragonfly*)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    aCC*)
+      _LT_AC_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) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case $host_cpu in
+      hppa*64*)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+        ;;
+      ia64*)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+        ;;
+      *)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        ;;
+      esac
+    fi
+    case $host_cpu in
+    hppa*64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+    ia64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    *)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      aCC*)
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  _LT_AC_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 $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case $host_cpu in
+	    ia64*|hppa*64*)
+	      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	      ;;
+	    *)
+	      _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC*)
+	# SGI C++
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -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_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	  else
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+	;;
+    esac
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    ;;
+  linux*)
+    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_AC_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_AC_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 $list'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+	_LT_AC_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_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc*)
+	# 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_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+  	  _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  _LT_AC_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_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      pgCC*)
+        # Portland Group C++ compiler
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+  	_LT_AC_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'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	_LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	_LT_AC_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 $templist | $SED "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 $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx*)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_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::"'
+    ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  openbsd*)
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    _LT_AC_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_AC_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_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
+  osf3*)
+    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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      cxx*)
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	_LT_AC_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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	  _LT_AC_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 ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      cxx*)
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_AC_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 -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	_LT_AC_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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	 _LT_AC_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` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  sco*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    case $cc_basename in
+      CC*)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      lcc*)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.2, 5.x and Centerline C++
+        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
+	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	_LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	case $host_os in
+	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker. We must also pass each convience library through
+	    # to the system linker between allextract/defaultextract.
+	    # The C++ compiler will combine linker options so we
+	    # cannot just pass the convience library names through
+	    # without $wl.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	_LT_AC_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_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx*)
+	# Green Hills C++ Compiler
+	_LT_AC_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_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC*)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_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...
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+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
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:3764: -1- AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP], [
+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...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+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
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+  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_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	   else
+	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_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_AC_TAGVAR(postdeps, $1)"; then
+	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+	 else
+	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_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_AC_TAGVAR(predep_objects, $1)"; then
+	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
+	 else
+	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+	 fi
+       else
+	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+	 else
+	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_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
+ifelse([$1],[CXX],
+[case $host_os in
+solaris*)
+  case $cc_basename in
+  CC*)
+    # 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.
+    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+    ;;
+  esac
+esac
+])
+
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:3771: -1- AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:3869: -1- AC_DEFUN([_LT_AC_LANG_F77_CONFIG], [AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_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_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_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"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+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
+  ;;
+aix4* | aix5*)
+  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])
+
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:3877: -1- AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:3931: -1- AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], [AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_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"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_AC_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...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:3939: -1- AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:3975: -1- AC_DEFUN([_LT_AC_LANG_RC_CONFIG], [AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# 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_AC_SYS_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"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:4466: -1- AC_DEFUN([AC_LIBTOOL_CONFIG], [# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    _LT_AC_TAGVAR(compiler, $1) \
+    _LT_AC_TAGVAR(CC, $1) \
+    _LT_AC_TAGVAR(LD, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+    _LT_AC_TAGVAR(old_archive_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+    _LT_AC_TAGVAR(predep_objects, $1) \
+    _LT_AC_TAGVAR(postdep_objects, $1) \
+    _LT_AC_TAGVAR(predeps, $1) \
+    _LT_AC_TAGVAR(postdeps, $1) \
+    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+    _LT_AC_TAGVAR(archive_cmds, $1) \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(postinstall_cmds, $1) \
+    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+    _LT_AC_TAGVAR(no_undefined_flag, $1) \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+    _LT_AC_TAGVAR(hardcode_automatic, $1) \
+    _LT_AC_TAGVAR(module_cmds, $1) \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+    _LT_AC_TAGVAR(exclude_expsyms, $1) \
+    _LT_AC_TAGVAR(include_expsyms, $1); do
+
+    case $var in
+    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(module_cmds, $1) | \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\[$]0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+    ;;
+  esac
+
+ifelse([$1], [],
+  [cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  AC_MSG_NOTICE([creating $ofile])],
+  [cfgfile="$ofile"])
+
+  cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e 1s/^X//"
+
+# 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
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $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.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
+
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+  case $host_os in
+  aix3*)
+    cat <<\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
+EOF
+    ;;
+  esac
+
+  # 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 '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+])
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:4484: -1- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:4677: -1- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
+# 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]]*\)'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+linux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDGIRSTW]]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris* | sysv5*)
+  symcode='[[BDRT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# 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
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Try without a prefix undercore, 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.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+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 <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+	  cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[[]] =
+{
+EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+	  cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+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_AC_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 -f 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
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:5181: -1- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # 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).
+      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # 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*)
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	else
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_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
+	;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           ;;
+         esac
+       ;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    if test "$host_cpu" != ia64; then
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  icpc* | ecpc*)
+	    # Intel C++
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  pgCC*)
+	    # Portland Group C++ compiler.
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      sco*)
+	case $cc_basename in
+	  CC*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      unixware*)
+	;;
+      vxworks*)
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+	;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	_LT_AC_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_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    unicos*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:6053: -1- AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # 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_AC_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_AC_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_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    _LT_AC_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_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+],[
+  runpath_var=
+  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_AC_TAGVAR(archive_cmds, $1)=
+  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+  _LT_AC_TAGVAR(module_cmds, $1)=
+  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(always_export_symbols, $1)=no
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_AC_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_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  _LT_CC_BASENAME([$compiler])
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` 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
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=no
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	_LT_AC_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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  _LT_AC_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_AC_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' ;;
+	esac
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  _LT_AC_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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+      _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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_AC_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_AC_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]].*|aix5*)
+	  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_AC_TAGVAR(archive_cmds, $1)=''
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+      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
+  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	  else
+  	  # We have old collect2
+  	  _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+  	  _LT_AC_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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       _LT_AC_SYS_LIBPATH_AIX
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 _LT_AC_SYS_LIBPATH_AIX
+	 _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      # see comment about different semantics on the GNU ld section
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    bsdi[[45]]*)
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+      # FIXME: Should let the user specify the lib program.
+      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    freebsd1*)
+      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	_LT_AC_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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_AC_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*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  ;;
+	ia64*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    openbsd*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	   ;;
+	 *)
+	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_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_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_AC_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~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    sco3.2v5*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_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}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	wlarc=''
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_AC_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'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
+      esac
+      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+        ;;
+	motorola)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv5*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_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'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_AC_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*
+      printf "$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_AC_TAGVAR(lt_prog_compiler_wl, $1)
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+        then
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+        else
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+        fi
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+      ;;
+    esac
+  fi
+  ;;
+esac
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:6093: -1- AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# #  ifdef __CYGWIN32__
+# #    define __CYGWIN__ __CYGWIN32__
+# #  endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+#   __hDllInstance_base = hInst;
+#   return TRUE;
+# }
+# /* ltdll.c ends here */
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:6098: -1- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:6102: -1- AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:6103: -1- AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:6104: -1- AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:6105: -1- AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:6106: -1- AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:6107: -1- AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:6108: -1- AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:6117: -1- AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no)
+  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+  AC_SUBST(GCJFLAGS)
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:6121: -1- AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no)
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:6184: -1- AC_DEFUN([LT_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
+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_MSG_RESULT([$SED])
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/pkg.m4:44: -1- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=m4_default([$1], [0.9.0])
+	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		AC_MSG_RESULT([yes])
+	else
+		AC_MSG_RESULT([no])
+		PKG_CONFIG=""
+	fi
+		
+fi[]dnl
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/pkg.m4:63: -1- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_ifval([$2], [$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/pkg.m4:91: -1- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/pkg.m4:156: -1- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
+        else 
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+	ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT
+])],
+		[$4])
+elif test $pkg_failed = untried; then
+	ifelse([$4], , [AC_MSG_FAILURE(dnl
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
+		[$4])
+else
+	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+	ifelse([$3], , :, [$3])
+fi[]dnl
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/amversion.m4:13: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/amversion.m4:20: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.6])])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/auxdir.m4:52: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/cond.m4:32: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/depend.m4:131: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/depend.m4:141: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/depend.m4:156: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/depout.m4:53: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`AS_DIRNAME("$mf")`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`AS_DIRNAME(["$file"])`
+    AS_MKDIR_P([$dirpart/$fdir])
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/depout.m4:67: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/init.m4:92: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+	      		     [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/init.m4:113: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $1 | $1:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/install-sh.m4:14: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/lead-dot.m4:21: -1- AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/lex.m4:22: -1- AC_DEFUN([AM_PROG_LEX], [AC_PREREQ(2.50)dnl
+AC_REQUIRE([AM_MISSING_HAS_RUN])dnl
+AC_REQUIRE([AC_PROG_LEX])dnl
+if test "$LEX" = :; then
+  LEX=${am_missing_run}flex
+fi])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/make.m4:51: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/minuso.m4:28: -1- AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/missing.m4:17: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/missing.m4:34: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/mkdirp.m4:63: -1- AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+AC_SUBST([mkdir_p])])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/options.m4:14: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/options.m4:20: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/options.m4:26: -1- AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/options.m4:32: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/runlog.m4:17: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/sanity.m4:51: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/strip.m4:28: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+m4trace:/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal-1.9/tar.m4:95: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+])
+m4trace:Scripts/m4/cppunit.m4:77: -1- AC_DEFUN([AM_PATH_CPPUNIT], [
+
+AC_ARG_WITH(cppunit-prefix,[  --with-cppunit-prefix=PFX   Prefix where CppUnit is installed (optional)],
+            cppunit_config_prefix="$withval", cppunit_config_prefix="")
+AC_ARG_WITH(cppunit-exec-prefix,[  --with-cppunit-exec-prefix=PFX  Exec prefix where CppUnit is installed (optional)],
+            cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="")
+
+  if test x$cppunit_config_exec_prefix != x ; then
+     cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix"
+     if test x${CPPUNIT_CONFIG+set} != xset ; then
+        CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config
+     fi
+  fi
+  if test x$cppunit_config_prefix != x ; then
+     cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix"
+     if test x${CPPUNIT_CONFIG+set} != xset ; then
+        CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config
+     fi
+  fi
+
+  AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no)
+  cppunit_version_min=$1
+
+  AC_MSG_CHECKING(for Cppunit - version >= $cppunit_version_min)
+  no_cppunit=""
+  if test "$CPPUNIT_CONFIG" = "no" ; then
+    no_cppunit=yes
+  else
+    CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags`
+    CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs`
+    cppunit_version=`$CPPUNIT_CONFIG --version`
+
+    cppunit_major_version=`echo $cppunit_version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    cppunit_minor_version=`echo $cppunit_version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    cppunit_micro_version=`echo $cppunit_version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+
+    cppunit_major_min=`echo $cppunit_version_min | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    cppunit_minor_min=`echo $cppunit_version_min | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    cppunit_micro_min=`echo $cppunit_version_min | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+
+    cppunit_version_proper=`expr \
+        $cppunit_major_version \> $cppunit_major_min \| \
+        $cppunit_major_version \= $cppunit_major_min \& \
+        $cppunit_minor_version \> $cppunit_minor_min \| \
+        $cppunit_major_version \= $cppunit_major_min \& \
+        $cppunit_minor_version \= $cppunit_minor_min \& \
+        $cppunit_micro_version \>= $cppunit_micro_min `
+
+    if test "$cppunit_version_proper" = "1" ; then
+      AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version])
+    else
+      AC_MSG_RESULT(no)
+      no_cppunit=yes
+    fi
+  fi
+
+  if test "x$no_cppunit" = x ; then
+     ifelse([$2], , :, [$2])     
+  else
+     CPPUNIT_CFLAGS=""
+     CPPUNIT_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+
+  AC_SUBST(CPPUNIT_CFLAGS)
+  AC_SUBST(CPPUNIT_LIBS)
+])
+m4trace:acinclude.m4:143: -1- AC_DEFUN([AC_CHECK_FT2], [dnl
+dnl Get the cflags and libraries from the freetype-config script
+dnl
+AC_ARG_WITH(ft-prefix,
+[  --with-ft-prefix=PREFIX
+                          Prefix where FreeType is installed (optional)],
+            ft_config_prefix="$withval", ft_config_prefix="")
+AC_ARG_WITH(ft-exec-prefix,
+[  --with-ft-exec-prefix=PREFIX
+                          Exec prefix where FreeType is installed (optional)],
+            ft_config_exec_prefix="$withval", ft_config_exec_prefix="")
+AC_ARG_ENABLE(freetypetest,
+[  --disable-freetypetest  Do not try to compile and run
+                          a test FreeType program],
+              [], enable_fttest=yes)
+
+if test x$ft_config_exec_prefix != x ; then
+  ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
+  if test x${FT2_CONFIG+set} != xset ; then
+    FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
+  fi
+fi
+if test x$ft_config_prefix != x ; then
+  ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
+  if test x${FT2_CONFIG+set} != xset ; then
+    FT2_CONFIG=$ft_config_prefix/bin/freetype-config
+  fi
+fi
+AC_PATH_PROG(FT2_CONFIG, freetype-config, no)
+
+min_ft_version=ifelse([$1], ,9.1.0,$1)
+AC_MSG_CHECKING(for FreeType - version >= $min_ft_version)
+no_ft=""
+if test "$FT2_CONFIG" = "no" ; then
+  no_ft=yes
+else
+  FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
+  FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
+  ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
+         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+  ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
+         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+  ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
+         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+  ft_min_major_version=`echo $min_ft_version | \
+         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+  ft_min_minor_version=`echo $min_ft_version | \
+         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+  ft_min_micro_version=`echo $min_ft_version | \
+         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+  if test x$enable_fttest = xyes ; then
+    ft_config_is_lt=""
+    if test $ft_config_major_version -lt $ft_min_major_version ; then
+      ft_config_is_lt=yes
+    else
+      if test $ft_config_major_version -eq $ft_min_major_version ; then
+        if test $ft_config_minor_version -lt $ft_min_minor_version ; then
+          ft_config_is_lt=yes
+        else
+          if test $ft_config_minor_version -eq $ft_min_minor_version ; then
+            if test $ft_config_micro_version -lt $ft_min_micro_version ; then
+              ft_config_is_lt=yes
+            fi
+          fi
+        fi
+      fi
+    fi
+    if test x$ft_config_is_lt = xyes ; then
+      no_ft=yes
+    else
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $FT2_CFLAGS"
+      LIBS="$FT2_LIBS $LIBS"
+dnl
+dnl Sanity checks for the results of freetype-config to some extent
+dnl
+      AC_TRY_RUN([
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main()
+{
+  FT_Library library;
+  FT_Error error;
+
+  error = FT_Init_FreeType(&library);
+
+  if (error)
+    return 1;
+  else
+  {
+    FT_Done_FreeType(library);
+    return 0;
+  }
+}
+],, no_ft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+      CFLAGS="$ac_save_CFLAGS"
+      LIBS="$ac_save_LIBS"
+    fi             # test $ft_config_version -lt $ft_min_version
+  fi               # test x$enable_fttest = xyes
+fi                 # test "$FT2_CONFIG" = "no"
+if test x$no_ft = x ; then
+   AC_MSG_RESULT(yes)
+   ifelse([$2], , :, [$2])
+else
+   AC_MSG_RESULT(no)
+   if test "$FT2_CONFIG" = "no" ; then
+     echo "*** The freetype-config script installed by FreeType 2 could not be found."
+     echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in"
+     echo "*** your path, or set the FT2_CONFIG environment variable to the"
+     echo "*** full path to freetype-config."
+   else
+     if test x$ft_config_is_lt = xyes ; then
+       echo "*** Your installed version of the FreeType 2 library is too old."
+       echo "*** If you have different versions of FreeType 2, make sure that"
+       echo "*** correct values for --with-ft-prefix or --with-ft-exec-prefix"
+       echo "*** are used, or set the FT2_CONFIG environment variable to the"
+       echo "*** full path to freetype-config."
+     else
+       echo "*** The FreeType test program failed to run.  If your system uses"
+       echo "*** shared libraries and they are installed outside the normal"
+       echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
+       echo "*** (or whatever is appropiate for your system) is correctly set."
+     fi
+   fi
+   FT2_CFLAGS=""
+   FT2_LIBS=""
+   ifelse([$3], , :, [$3])
+fi
+AC_SUBST(FT2_CFLAGS)
+AC_SUBST(FT2_LIBS)
+])
+m4trace:acinclude.m4:159: -1- AC_DEFUN([OGRE_USE_STLPORT], [AC_ARG_WITH(stlport, 
+             AC_HELP_STRING([--with-stlport=PATH],
+                           [the path to STLPort.]),
+             ac_cv_use_stlport=$withval,
+             ac_cv_use_stlport=no)
+ AC_CACHE_CHECK([whether to use STLPort], ac_cv_use_stlport,
+                ac_cv_use_stlport=no)
+ if test x$ac_cv_use_stlport != xno; then
+     STLPORT_CFLAGS="-I$ac_cv_use_stlport/stlport"
+     STLPORT_LIBS="-L$ac_cv_use_stlport/lib -lstlport"
+ fi
+ AC_SUBST(STLPORT_CFLAGS)
+ AC_SUBST(STLPORT_LIBS)
+])
+m4trace:acinclude.m4:203: -1- AC_DEFUN([OGRE_GET_PLATFORM], [OGRE_PLATFORM=GLX
+ AC_ARG_WITH(platform, 
+             AC_HELP_STRING([--with-platform=PLATFORM],
+                            [the platform to build, currently GLX or Win32]),
+             OGRE_PLATFORM=$withval,
+             OGRE_PLATFORM=GLX)
+
+  PLATFORM_CFLAGS=""
+  PLATFORM_LIBS=""
+
+  dnl Do the extra checks per type here
+  case $OGRE_PLATFORM in 
+    GLX)
+      AC_CHECK_HEADERS([X11/Intrinsic.h],, [AC_MSG_ERROR("libxt headers not found")])
+      AC_CHECK_HEADERS([X11/Xaw/Command.h],, [AC_MSG_ERROR("libxaw headers not found")])
+      AC_CHECK_HEADERS([X11/extensions/xf86vmode.h],, [AC_MSG_ERROR("libxf86vm headers not found")],[#include <X11/Xlib.h>])
+      AC_CHECK_HEADERS([X11/extensions/Xrandr.h],, [AC_MSG_ERROR("libxrandr headers not found")],[#include <X11/Xlib.h>])
+      AC_PATH_X
+      if test x"$x_includes" != x; then
+        if test x"$x_includes" != xNONE; then
+          PLATFORM_CFLAGS="-I$x_includes"
+        fi
+      fi
+      if test x"$x_libraries" != x; then
+        if test x"$x_libraries" != xNONE; then
+          PLATFORM_LIBS="-L$x_libraries -lX11 -lXaw"
+        fi
+      dnl In case of xorg 7.x, $x_libraries is empty
+      else
+        PLATFORM_LIBS="-lX11 -lXaw"
+      fi
+    ;;
+    Win32)
+      PLATFORM_CFLAGS=""
+      PLATFORM_LIBS="-lgdi32 -lwinmm -ldinput8 -ldxguid"
+    ;;
+  esac
+
+  AC_SUBST(PLATFORM_CFLAGS)
+  AC_SUBST(PLATFORM_LIBS)
+  AC_SUBST(OGRE_PLATFORM)
+])
+m4trace:acinclude.m4:254: -1- AC_DEFUN([OGRE_GET_GLSUPPORT], [OGRE_GLSUPPORT=none
+ AC_ARG_WITH(gl-support, 
+             AC_HELP_STRING([--with-gl-support=PLATFORM],
+                            [ The GLsupport to build (GLX or Win32). Defaults to the platform. Only set this if you know what you are doing. Use --with-platform otherwise.]),
+             OGRE_GLSUPPORT=$withval,
+             OGRE_GLSUPPORT=none)
+
+  if test "$OGRE_GLSUPPORT" = "none" ; then
+    OGRE_GLSUPPORT="$OGRE_PLATFORM"
+    AC_MSG_NOTICE([setting gl-support to platform: $OGRE_GLSUPPORT])
+  fi
+  if test "$OGRE_GLSUPPORT" = "Win32" ; then
+    # Uppercase/lowercase
+    OGRE_GLSUPPORT=win32
+  fi
+
+  GLSUPPORT_CFLAGS=""
+  GLSUPPORT_LIBS=""
+
+  dnl Do the extra checks per type here
+  case $OGRE_GLSUPPORT in 
+    GLX)
+        AC_PATH_X
+        if test x"$x_includes" != x; then
+          if test x"$x_includes" != xNONE; then
+            GLSUPPORT_CFLAGS="-I$x_includes"
+          fi
+        fi
+        if test x"$x_libraries" != x; then
+          if test x"$x_libraries" != xNONE; then
+            GLSUPPORT_LIBS="-L$x_libraries -lX11 -lXext -lGL -lXrandr -lXxf86vm"
+          fi
+        dnl In case of xorg 7.x $x_libraries might be empty
+        else
+          GLSUPPORT_LIBS="-lX11 -lXext -lGL -lXrandr -lXxf86vm"
+        fi
+    ;;
+    win32)
+	GLSUPPORT_CFLAGS=""
+	GLSUPPORT_LIBS="-lgdi32 -lwinmm"
+    ;;
+  esac
+
+  AC_SUBST(GLSUPPORT_CFLAGS)
+  AC_SUBST(GLSUPPORT_LIBS)
+  AC_SUBST(OGRE_GLSUPPORT)
+  AC_CONFIG_FILES([RenderSystems/GL/src/GLX/Makefile
+                   RenderSystems/GL/src/win32/Makefile])
+])
+m4trace:acinclude.m4:282: -1- AC_DEFUN([OGRE_SETUP_FOR_TARGET], [case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+	AC_SUBST(SHARED_FLAGS, "-shared -no-undefined -Xlinker --export-all-symbols")
+	AC_SUBST(PLUGIN_FLAGS, "-shared -no-undefined -avoid-version")
+	AC_SUBST(GL_LIBS, "-lopengl32 -lglu32")	
+	AC_CHECK_TOOL(RC, windres)
+        nt=true
+;;
+*-*-darwin*)
+        AC_SUBST(SHARED_FLAGS, "-shared")
+        AC_SUBST(PLUGIN_FLAGS, "-shared -avoid-version")
+        AC_SUBST(GL_LIBS, "-lGL -lGLU")
+        osx=true
+;;
+ *) dnl default to standard linux
+	AC_SUBST(SHARED_FLAGS, "-shared")
+	AC_SUBST(PLUGIN_FLAGS, "-shared -avoid-version")
+	AC_SUBST(GL_LIBS, "-lGL -lGLU")
+        linux=true
+;;
+esac
+dnl you must arrange for every AM_conditional to run every time configure runs
+AM_CONDITIONAL(OGRE_NT, test x$nt = xtrue)
+AM_CONDITIONAL(OGRE_LINUX, test x$linux = xtrue)
+AM_CONDITIONAL(OGRE_OSX,test x$osx = xtrue )
+])
+m4trace:acinclude.m4:299: -1- AC_DEFUN([OGRE_DETECT_ENDIAN], [AC_TRY_RUN([
+		int main()
+		{
+			short s = 1;
+			short* ptr = &s;
+			unsigned char c = *((char*)ptr);
+			return c;
+		}
+	]
+	,[AC_DEFINE(OGRE_CONFIG_BIG_ENDIAN,,[Big endian machine])
+          OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_CONFIG_BIG_ENDIAN"]
+	,[AC_DEFINE(OGRE_CONFIG_LITTLE_ENDIAN,,[Little endian machine])
+          OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_CONFIG_LITTLE_ENDIAN"])
+])
+m4trace:acinclude.m4:324: -1- AC_DEFUN([OGRE_CHECK_OPENEXR], [AC_ARG_ENABLE(openexr,
+              AC_HELP_STRING([--enable-openexr],
+                             [Build the OpenEXR plugin]),
+              [build_exr=$enableval],
+              [build_exr=no])
+
+if test "x$build_exr" = "xyes" ; then
+	PKG_CHECK_MODULES(OPENEXR, OpenEXR, [build_exr=yes], [build_exr=no])
+
+	if test "x$build_exr" = "xyes" ; then
+	   	AC_CONFIG_FILES([ PlugIns/EXRCodec/Makefile \
+    					 PlugIns/EXRCodec/src/Makefile \
+    					 PlugIns/EXRCodec/include/Makefile])
+		AC_SUBST(OPENEXR_CFLAGS)
+		AC_SUBST(OPENEXR_LIBS)
+
+	fi
+
+fi
+
+AM_CONDITIONAL(BUILD_EXRPLUGIN, test x$build_exr = xyes)
+
+])
+m4trace:acinclude.m4:348: -1- AC_DEFUN([OGRE_CHECK_CG], [AC_ARG_ENABLE(cg,
+              AC_HELP_STRING([--disable-cg],
+                             [Do not build the Cg plugin (recommended you do so!)]),
+              [build_cg=$enableval],
+              [build_cg=yes])
+
+if test "x$build_cg" = "xyes" ; then
+	AC_CHECK_LIB(Cg, cgCreateProgram,,AC_MSG_ERROR([
+	****************************************************************
+	* You do not have the nVidia Cg libraries installed.           *
+	* Go to http://developer.nvidia.com/object/cg_toolkit.html     *
+	* (Click on Cg_Linux.tar.gz).                                  *
+	* You can disable the building of Cg support by providing      *	
+	* --disable-cg to this configure script but this is highly     *
+	* discouraged as this breaks many of the examples.             *
+	****************************************************************])
+	)
+fi
+
+AM_CONDITIONAL(BUILD_CGPLUGIN, test x$build_cg = xyes)
+
+])
+m4trace:acinclude.m4:354: -1- AC_DEFUN([OGRE_CHECK_CPPUNIT], [
+AM_PATH_CPPUNIT([1.10.0], [build_unit_tests=true])
+AM_CONDITIONAL([BUILD_UNIT_TESTS], [test x$build_unit_tests = xtrue])
+])
+m4trace:acinclude.m4:366: -1- AC_DEFUN([OGRE_CHECK_DX9], [AC_ARG_ENABLE(direct3d,
+              AC_HELP_STRING([--enable-direct3d],
+                             [Build the DirectX 9 Render System]),
+              [build_dx9=$enableval],
+              [build_dx9=no])
+
+AM_CONDITIONAL(BUILD_DX9RENDERSYSTEM, test x$build_dx9 = xyes)
+
+])
+m4trace:acinclude.m4:395: -1- AC_DEFUN([OGRE_CHECK_FREEIMAGE], [AC_ARG_ENABLE(freeimage,
+              AC_HELP_STRING([--disable-freeimage],
+                             [Don't use FreeImage for image loading. This is not recommended unless you provide your own image loading codecs.]),
+              [build_freeimage=$enableval],
+              [build_freeimage=yes])
+
+
+AM_CONDITIONAL(USE_FREEIMAGE, test x$build_freeimage = xyes)
+
+if test "x$build_freeimage" = "xyes" ; then
+	AC_CHECK_LIB(freeimage, FreeImage_Load,,AC_MSG_ERROR([
+****************************************************************
+* You do not have FreeImage installed.  This is required.      *
+* You may find it at http://freeimage.sourceforge.net/.        *
+* Note: You can also provide --disable-freeimage to the build  *
+* process to build without it. This is an advanced option      *
+* useful only if you provide your own image loading codecs.    *
+****************************************************************]), -lstdc++)
+	AC_DEFINE([OGRE_NO_FREEIMAGE], [0], [Do not use freeimage to load images])
+else
+	AC_DEFINE([OGRE_NO_FREEIMAGE], [1], [Load images using the freeimage library])
+	OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_NO_FREEIMAGE"
+fi
+
+
+])
+m4trace:acinclude.m4:428: -1- AC_DEFUN([OGRE_CHECK_DEVIL], [AC_ARG_ENABLE(devil,
+              AC_HELP_STRING([--disable-devil],
+                             [Don't use DevIL for image loading. This is not recommended unless you provide your own image loading codecs.]),
+              [build_il=$enableval],
+              [build_il=yes])
+
+AM_CONDITIONAL(USE_DEVIL, test x$build_il = xyes && test x$build_freeimage = xno)
+
+if test "x$build_freeimage" = "xyes"; then
+    AC_MSG_NOTICE([Freeimage is being built, disabling check for DevIL.])
+    [build_il=no]
+	AC_DEFINE([OGRE_NO_DEVIL], [1], [Build devil])
+else
+if test "x$build_il" = "xyes"; then
+	AC_CHECK_LIB(IL, ilInit,,AC_MSG_ERROR([
+****************************************************************
+* You do not have DevIL installed.  This is required to build. *
+* You may find it at http://openil.sourceforge.net/.           *
+* Note: You can also provide --disable-devil to the build      *
+* process to build without DevIL. This is an advanced option   *
+* useful only if you provide your own image loading codecs.    *
+****************************************************************]))
+	AC_CHECK_LIB(ILU, iluFlipImage)
+	AC_DEFINE([OGRE_NO_DEVIL], [0], [Build devil])
+else
+	AC_DEFINE([OGRE_NO_DEVIL], [1], [Build devil])
+fi
+fi
+
+])
+m4trace:acinclude.m4:444: -1- AC_DEFUN([OGRE_CHECK_PIC], [
+AC_MSG_CHECKING([whether -fPIC is needed])
+    case $host in
+        x86_64-*)
+            CXXFLAGS="$CXXFLAGS -fPIC"
+            AC_MSG_RESULT(yes)
+        ;;
+        *)
+            AC_MSG_RESULT(no)
+        ;;
+    esac
+])
+m4trace:acinclude.m4:463: -1- AC_DEFUN([OGRE_CHECK_CEGUI], [
+    PKG_CHECK_MODULES(CEGUI, CEGUI >= 0.5.0, 
+            [build_cegui_sample=true], [build_cegui_sample=false])
+    if test x$build_cegui_sample = xtrue; then
+        AC_CONFIG_FILES([Samples/Common/CEGUIRenderer/Makefile \
+                         Samples/Common/CEGUIRenderer/CEGUI-OGRE.pc
+                         Samples/Common/CEGUIRenderer/src/Makefile \
+                         Samples/Common/CEGUIRenderer/include/Makefile \
+                         Samples/Gui/Makefile \
+                         Samples/Gui/src/Makefile])
+        AC_SUBST(CEGUI_CFLAGS)
+        AC_SUBST(CEGUI_LIBS)
+        AC_MSG_RESULT([CEGUI available, Gui and FacialAnimation samples will be built])
+    else
+        AC_MSG_RESULT([CEGUI not available, Gui and FacialAnimation samples will not be built])
+    fi
+    AM_CONDITIONAL([HAVE_CEGUI], [test x$build_cegui_sample = xtrue])
+])
+m4trace:acinclude.m4:484: -1- AC_DEFUN([OGRE_CHECK_DOUBLE], [
+AC_ARG_ENABLE(double,
+              AC_HELP_STRING([--enable-double],
+                             [Build OGRE in double floating point precision mode. This is not recommended for normal use as it is slower.]),
+              [build_double=$enableval],
+              [build_double=no])
+AC_MSG_CHECKING([whether to use double floating point precision])
+	case $build_double in
+        yes)
+			AC_DEFINE([OGRE_DOUBLE_PRECISION], [1], [Build with double precision])
+			OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_DOUBLE_PRECISION"
+			AC_MSG_RESULT(yes)
+        ;;
+        *)
+			AC_DEFINE([OGRE_DOUBLE_PRECISION], [0], [Build with single precision])
+			AC_MSG_RESULT(no)
+        ;;
+    esac
+])
+m4trace:acinclude.m4:509: -1- AC_DEFUN([OGRE_CHECK_THREADING], [
+AC_ARG_ENABLE(threading,
+              AC_HELP_STRING([--enable-threading],
+                             [Indicate general support for multithreading. This will enable threading support in certain parts of the engine, mainly resource loading and SharedPtr handling. WARNING: highly experimental, use with caution.]),
+              [build_threads=$enableval],
+              [build_threads=no])
+    case $build_threads in
+        yes)
+            AC_DEFINE([OGRE_THREAD_SUPPORT], [1], [Build with thread support])
+            OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_THREAD_SUPPORT"
+            # Check for the C++ Boost library
+            AC_CHECK_LIB(boost_thread, main, OGRE_THREAD_LIBS="-lboost_thread", [
+                AC_CHECK_LIB(boost_thread-mt, main, OGRE_THREAD_LIBS="-lboost_thread-mt", [
+                    AC_MSG_ERROR([You need the C++ boost libraries.])])])
+        ;;
+        *)
+            AC_DEFINE([OGRE_THREAD_SUPPORT], [0], [Build with thread support])
+            OGRE_THREAD_LIBS=""
+            AC_MSG_RESULT(no)
+        ;;
+    esac
+    AC_SUBST(OGRE_THREAD_LIBS)
+])
+m4trace:acinclude.m4:541: -1- AC_DEFUN([OGRE_BUILD_DEMOS], [
+    AC_ARG_ENABLE(ogre_demos,
+        AC_HELP_STRING([--disable-ogre-demos], 
+            [Do not build Ogre demos (CEGUI Renderer - if enabled/disabled, is not affected by this]),
+            [build_ogre_demos=$enableval], [build_ogre_demos=yes])
+
+    if test "x$build_ogre_demos" = "xyes" ; then
+        PKG_CHECK_MODULES(OIS, OIS >= 1.0.0, [ois_found=yes],[ois_found=no])
+        AC_SUBST(OIS_CFLAGS)
+        AC_SUBST(OIS_LIBS)
+
+        if test "x$ois_found" = "xyes" ; then
+           AC_MSG_NOTICE([*** Ogre Demos will be built ***])
+        else
+          build_ogre_demos=no
+          AC_MSG_NOTICE([
+****************************************************************
+* You do not have OIS installed.  This is required to build    *
+* Ogre demos. You may find it at:                              *
+* http://www.sourceforge.net/projects/wgois.                   *
+* If you do not want to build the demos, you can safely ignore *
+* this.                                                        *
+****************************************************************])
+        fi
+    else
+        build_ogre_demos=no
+        AC_MSG_NOTICE([*** Building of Ogre demos disabled ***])
+    fi
+
+    AM_CONDITIONAL([OGRE_BUILDING_DEMOS], [test x$build_ogre_demos = xyes])
+])
+m4trace:acinclude.m4:589: -1- AC_DEFUN([OGRE_CHECK_GUI], [
+    AC_ARG_WITH([gui],
+        AC_HELP_STRING([--with-gui=type], [Select the GUI type to use for dialogs (win32, gtk, Xt) (default: auto)]),
+        [with_gui=${withval}], [with_gui=auto])
+
+    #remove any old files
+    rm -f OgreMain/src/OgreConfigDialog.lo OgreMain/src/OgreErrorDialog.lo
+
+    # Prefer win32, then gtk, then Xt
+    if test "x$with_gui" == "xauto" && test "x$OGRE_PLATFORM" == "xWIN32"; then
+        with_gui=win32
+    fi
+
+    if test "x$with_gui" == "xauto" || test "x$with_gui" == "xgtk"; then
+        PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.0.0, [with_gui=gtk], [
+            if test "x$with_gui" == "xgtk"; then
+                AC_MSG_ERROR([You chose gtk for the GUI but gtk is not available.])
+            fi
+        ])
+    fi
+
+    if test "x$with_gui" == "xauto"; then
+        with_gui=Xt
+    fi
+
+    if test "x$with_gui" == "xwin32"; then
+        OGRE_GUI=WIN32
+    elif test "x$with_gui" == "xgtk"; then
+        OGRE_GUI=gtk
+    elif test "x$with_gui" == "xXt"; then
+        OGRE_GUI=GLX
+        PLATFORM_LIBS="$PLATFORM_LIBS -lXt -lSM -lICE"
+    else
+        AC_MSG_ERROR([The GUI dialogs for $with_gui are not available.])
+    fi
+
+    # Add the OGRE_GUI_xxx flag to compiler command line
+    PLATFORM_CFLAGS="$PLATFORM_CFLAGS -DOGRE_GUI_$OGRE_GUI"
+    # And export it to client applications as well
+    OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_GUI_$OGRE_GUI"
+
+    AC_SUBST(OGRE_GUI)
+    AC_SUBST(GTK_CFLAGS)
+    AC_SUBST(GTK_LIBS)
+])
+m4trace:acinclude.m4:595: -1- AC_DEFUN([OGRE_PLATFORM_AND_GUI], [AM_CONDITIONAL(SAME_PLATFORM_AND_GUI, test "x$OGRE_PLATFORM" = "x$OGRE_GUI")
+])
+m4trace:acinclude.m4:611: -1- AC_DEFUN([OGRE_CHECK_SSE], [
+AC_MSG_CHECKING(whether to use SSE)
+case $target_cpu in
+	i386 | i486 | i586 | i686 | x86_64 | amd64)
+		build_sse=yes
+	;;
+	*)
+		build_sse=no
+	;;
+esac
+AC_MSG_RESULT($build_sse)
+AM_CONDITIONAL(OGRE_BUILD_SSE, test x$build_sse = xyes)
+])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^_?A[CHUM]_])
+m4trace:configure.in:3: -1- m4_pattern_forbid([_AC_])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
+m4trace:configure.in:3: -1- m4_pattern_allow([^AS_FLAGS$])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^_?m4_])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^dnl$])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^_?AS_])
+m4trace:configure.in:3: -1- m4_pattern_allow([^SHELL$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PATH_SEPARATOR$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_NAME$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_VERSION$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_STRING$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^exec_prefix$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^prefix$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^program_transform_name$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^bindir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^sbindir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^libexecdir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^datarootdir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^datadir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^sysconfdir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^sharedstatedir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^localstatedir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^includedir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^oldincludedir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^docdir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^infodir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^htmldir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^dvidir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^pdfdir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^psdir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^libdir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^localedir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^mandir$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_NAME$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_VERSION$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_STRING$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^DEFS$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_C$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_N$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_T$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^build_alias$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^host_alias$])
+m4trace:configure.in:3: -1- m4_pattern_allow([^target_alias$])
+m4trace:configure.in:5: -1- m4_pattern_allow([^build$])
+m4trace:configure.in:5: -1- m4_pattern_allow([^build_cpu$])
+m4trace:configure.in:5: -1- m4_pattern_allow([^build_vendor$])
+m4trace:configure.in:5: -1- m4_pattern_allow([^build_os$])
+m4trace:configure.in:5: -1- m4_pattern_allow([^host$])
+m4trace:configure.in:5: -1- m4_pattern_allow([^host_cpu$])
+m4trace:configure.in:5: -1- m4_pattern_allow([^host_vendor$])
+m4trace:configure.in:5: -1- m4_pattern_allow([^host_os$])
+m4trace:configure.in:5: -1- m4_pattern_allow([^target$])
+m4trace:configure.in:5: -1- m4_pattern_allow([^target_cpu$])
+m4trace:configure.in:5: -1- m4_pattern_allow([^target_vendor$])
+m4trace:configure.in:5: -1- m4_pattern_allow([^target_os$])
+m4trace:configure.in:9: -1- AM_INIT_AUTOMAKE([OGRE], [1.4.5])
+m4trace:configure.in:9: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
+m4trace:configure.in:9: -1- AM_SET_CURRENT_AUTOMAKE_VERSION
+m4trace:configure.in:9: -1- AM_AUTOMAKE_VERSION([1.9.6])
+m4trace:configure.in:9: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
+m4trace:configure.in:9: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
+m4trace:configure.in:9: -1- m4_pattern_allow([^INSTALL_DATA$])
+m4trace:configure.in:9: -1- m4_pattern_allow([^CYGPATH_W$])
+m4trace:configure.in:9: -1- m4_pattern_allow([^PACKAGE$])
+m4trace:configure.in:9: -1- m4_pattern_allow([^VERSION$])
+m4trace:configure.in:9: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
+m4trace:configure.in:9: -2- _AM_MANGLE_OPTION([no-define])
+m4trace:configure.in:9: -1- m4_pattern_allow([^PACKAGE$])
+m4trace:configure.in:9: -1- m4_pattern_allow([^VERSION$])
+m4trace:configure.in:9: -1- AM_SANITY_CHECK
+m4trace:configure.in:9: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+m4trace:configure.in:9: -1- AM_MISSING_HAS_RUN
+m4trace:configure.in:9: -1- AM_AUX_DIR_EXPAND
+m4trace:configure.in:9: -1- m4_pattern_allow([^ACLOCAL$])
+m4trace:configure.in:9: -1- AM_MISSING_PROG([AUTOCONF], [autoconf])
+m4trace:configure.in:9: -1- m4_pattern_allow([^AUTOCONF$])
+m4trace:configure.in:9: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+m4trace:configure.in:9: -1- m4_pattern_allow([^AUTOMAKE$])
+m4trace:configure.in:9: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader])
+m4trace:configure.in:9: -1- m4_pattern_allow([^AUTOHEADER$])
+m4trace:configure.in:9: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo])
+m4trace:configure.in:9: -1- m4_pattern_allow([^MAKEINFO$])
+m4trace:configure.in:9: -1- AM_PROG_INSTALL_SH
+m4trace:configure.in:9: -1- m4_pattern_allow([^install_sh$])
+m4trace:configure.in:9: -1- AM_PROG_INSTALL_STRIP
+m4trace:configure.in:9: -1- m4_pattern_allow([^STRIP$])
+m4trace:configure.in:9: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$])
+m4trace:configure.in:9: -1- AM_PROG_MKDIR_P
+m4trace:configure.in:9: -1- m4_pattern_allow([^mkdir_p$])
+m4trace:configure.in:9: -1- m4_pattern_allow([^AWK$])
+m4trace:configure.in:9: -1- m4_pattern_allow([^SET_MAKE$])
+m4trace:configure.in:9: -1- AM_SET_LEADING_DOT
+m4trace:configure.in:9: -1- m4_pattern_allow([^am__leading_dot$])
+m4trace:configure.in:9: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+	      		     [_AM_PROG_TAR([v7])])])
+m4trace:configure.in:9: -2- _AM_MANGLE_OPTION([tar-ustar])
+m4trace:configure.in:9: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])
+m4trace:configure.in:9: -2- _AM_MANGLE_OPTION([tar-pax])
+m4trace:configure.in:9: -1- _AM_PROG_TAR([v7])
+m4trace:configure.in:9: -1- AM_MISSING_PROG([AMTAR], [tar])
+m4trace:configure.in:9: -1- m4_pattern_allow([^AMTAR$])
+m4trace:configure.in:9: -1- m4_pattern_allow([^am__tar$])
+m4trace:configure.in:9: -1- m4_pattern_allow([^am__untar$])
+m4trace:configure.in:9: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+m4trace:configure.in:9: -2- _AM_MANGLE_OPTION([no-dependencies])
+m4trace:configure.in:13: -1- m4_pattern_allow([^CC$])
+m4trace:configure.in:13: -1- m4_pattern_allow([^CFLAGS$])
+m4trace:configure.in:13: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.in:13: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.in:13: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.in:13: -1- m4_pattern_allow([^CC$])
+m4trace:configure.in:13: -1- m4_pattern_allow([^CC$])
+m4trace:configure.in:13: -1- m4_pattern_allow([^CC$])
+m4trace:configure.in:13: -1- m4_pattern_allow([^CC$])
+m4trace:configure.in:13: -1- m4_pattern_allow([^ac_ct_CC$])
+m4trace:configure.in:13: -1- m4_pattern_allow([^EXEEXT$])
+m4trace:configure.in:13: -1- m4_pattern_allow([^OBJEXT$])
+m4trace:configure.in:13: -1- _AM_DEPENDENCIES([CC])
+m4trace:configure.in:13: -1- AM_SET_DEPDIR
+m4trace:configure.in:13: -1- m4_pattern_allow([^DEPDIR$])
+m4trace:configure.in:13: -1- AM_OUTPUT_DEPENDENCY_COMMANDS
+m4trace:configure.in:13: -1- AM_MAKE_INCLUDE
+m4trace:configure.in:13: -1- m4_pattern_allow([^am__include$])
+m4trace:configure.in:13: -1- m4_pattern_allow([^am__quote$])
+m4trace:configure.in:13: -1- AM_DEP_TRACK
+m4trace:configure.in:13: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+m4trace:configure.in:13: -1- m4_pattern_allow([^AMDEP_TRUE$])
+m4trace:configure.in:13: -1- m4_pattern_allow([^AMDEP_FALSE$])
+m4trace:configure.in:13: -1- m4_pattern_allow([^AMDEPBACKSLASH$])
+m4trace:configure.in:13: -1- m4_pattern_allow([^CCDEPMODE$])
+m4trace:configure.in:13: -1- AM_CONDITIONAL([am__fastdepCC], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3])
+m4trace:configure.in:13: -1- m4_pattern_allow([^am__fastdepCC_TRUE$])
+m4trace:configure.in:13: -1- m4_pattern_allow([^am__fastdepCC_FALSE$])
+m4trace:configure.in:14: -1- m4_pattern_allow([^CXX$])
+m4trace:configure.in:14: -1- m4_pattern_allow([^CXXFLAGS$])
+m4trace:configure.in:14: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.in:14: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.in:14: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.in:14: -1- m4_pattern_allow([^CXX$])
+m4trace:configure.in:14: -1- m4_pattern_allow([^ac_ct_CXX$])
+m4trace:configure.in:14: -1- _AM_DEPENDENCIES([CXX])
+m4trace:configure.in:14: -1- m4_pattern_allow([^CXXDEPMODE$])
+m4trace:configure.in:14: -1- AM_CONDITIONAL([am__fastdepCXX], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3])
+m4trace:configure.in:14: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$])
+m4trace:configure.in:14: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$])
+m4trace:configure.in:15: -1- AM_PROG_CC_C_O
+m4trace:configure.in:15: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$])
+m4trace:configure.in:16: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
+m4trace:configure.in:16: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
+m4trace:configure.in:16: -1- m4_pattern_allow([^INSTALL_DATA$])
+m4trace:configure.in:17: -1- m4_pattern_allow([^YACC$])
+m4trace:configure.in:17: -1- m4_pattern_allow([^YACC$])
+m4trace:configure.in:17: -1- m4_pattern_allow([^YFLAGS$])
+m4trace:configure.in:18: -1- AM_PROG_LEX
+m4trace:configure.in:18: -1- m4_pattern_allow([^LEX$])
+m4trace:configure.in:18: -1- m4_pattern_allow([^LEX_OUTPUT_ROOT$])
+m4trace:configure.in:18: -1- m4_pattern_allow([^LEXLIB$])
+m4trace:configure.in:18: -1- m4_pattern_allow([^YYTEXT_POINTER$])
+m4trace:configure.in:21: -1- OGRE_SETUP_FOR_TARGET
+m4trace:configure.in:21: -1- m4_pattern_allow([^SHARED_FLAGS$])
+m4trace:configure.in:21: -1- m4_pattern_allow([^PLUGIN_FLAGS$])
+m4trace:configure.in:21: -1- m4_pattern_allow([^GL_LIBS$])
+m4trace:configure.in:21: -1- m4_pattern_allow([^RC$])
+m4trace:configure.in:21: -1- m4_pattern_allow([^SHARED_FLAGS$])
+m4trace:configure.in:21: -1- m4_pattern_allow([^PLUGIN_FLAGS$])
+m4trace:configure.in:21: -1- m4_pattern_allow([^GL_LIBS$])
+m4trace:configure.in:21: -1- m4_pattern_allow([^SHARED_FLAGS$])
+m4trace:configure.in:21: -1- m4_pattern_allow([^PLUGIN_FLAGS$])
+m4trace:configure.in:21: -1- m4_pattern_allow([^GL_LIBS$])
+m4trace:configure.in:21: -1- AM_CONDITIONAL([OGRE_NT], [test x$nt = xtrue])
+m4trace:configure.in:21: -1- m4_pattern_allow([^OGRE_NT_TRUE$])
+m4trace:configure.in:21: -1- m4_pattern_allow([^OGRE_NT_FALSE$])
+m4trace:configure.in:21: -1- AM_CONDITIONAL([OGRE_LINUX], [test x$linux = xtrue])
+m4trace:configure.in:21: -1- m4_pattern_allow([^OGRE_LINUX_TRUE$])
+m4trace:configure.in:21: -1- m4_pattern_allow([^OGRE_LINUX_FALSE$])
+m4trace:configure.in:21: -1- AM_CONDITIONAL([OGRE_OSX], [test x$osx = xtrue ])
+m4trace:configure.in:21: -1- m4_pattern_allow([^OGRE_OSX_TRUE$])
+m4trace:configure.in:21: -1- m4_pattern_allow([^OGRE_OSX_FALSE$])
+m4trace:configure.in:23: -1- AC_DISABLE_STATIC
+m4trace:configure.in:23: -1- AC_ENABLE_STATIC([no])
+m4trace:configure.in:23: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1373: AC_ARG_ENABLE is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1890: AC_ENABLE_STATIC is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1899: AC_DISABLE_STATIC is expanded from...
+configure.in:23: the top level])
+m4trace:configure.in:24: -1- AC_PROG_LIBTOOL
+m4trace:configure.in:24: -1- _AC_PROG_LIBTOOL
+m4trace:configure.in:24: -1- AC_LIBTOOL_SETUP
+m4trace:configure.in:24: -1- AC_ENABLE_SHARED
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1373: AC_ARG_ENABLE is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1851: AC_ENABLE_SHARED is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:219: AC_LIBTOOL_SETUP is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:75: _AC_PROG_LIBTOOL is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:55: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- AC_ENABLE_FAST_INSTALL
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1373: AC_ARG_ENABLE is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1929: AC_ENABLE_FAST_INSTALL is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:219: AC_LIBTOOL_SETUP is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:75: _AC_PROG_LIBTOOL is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:55: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- AC_PROG_LD
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1391: AC_ARG_WITH is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2126: AC_PROG_LD is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:219: AC_LIBTOOL_SETUP is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:75: _AC_PROG_LIBTOOL is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:55: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- LT_AC_PROG_SED
+m4trace:configure.in:24: -1- AC_PROG_LD_GNU
+m4trace:configure.in:24: -1- AC_PROG_EGREP
+m4trace:configure.in:24: -1- m4_pattern_allow([^GREP$])
+m4trace:configure.in:24: -1- m4_pattern_allow([^GREP$])
+m4trace:configure.in:24: -1- m4_pattern_allow([^EGREP$])
+m4trace:configure.in:24: -1- m4_pattern_allow([^EGREP$])
+m4trace:configure.in:24: -1- AC_PROG_LD_RELOAD_FLAG
+m4trace:configure.in:24: -1- AC_PROG_NM
+m4trace:configure.in:24: -1- m4_pattern_allow([^LN_S$])
+m4trace:configure.in:24: -1- AC_DEPLIBS_CHECK_METHOD
+m4trace:configure.in:24: -1- AC_LIBTOOL_SYS_MAX_CMD_LEN
+m4trace:configure.in:24: -1- AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [])
+m4trace:configure.in:24: -1- AC_LIBTOOL_OBJDIR
+m4trace:configure.in:24: -1- _LT_AC_SYS_COMPILER
+m4trace:configure.in:24: -1- _LT_AC_PROG_ECHO_BACKSLASH
+m4trace:configure.in:24: -1- _LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
+
+echo=${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 <<EOF
+[$]*
+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 "$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 &&
+       echo_test_string=`eval $cmd` &&
+       (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.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])
+m4trace:configure.in:24: -1- m4_pattern_allow([^ECHO$])
+m4trace:configure.in:24: -1- m4_pattern_allow([^AR$])
+m4trace:configure.in:24: -1- m4_pattern_allow([^RANLIB$])
+m4trace:configure.in:24: -1- m4_pattern_allow([^STRIP$])
+m4trace:configure.in:24: -1- _LT_CC_BASENAME([$compiler])
+m4trace:configure.in:24: -1- AC_PATH_MAGIC
+m4trace:configure.in:24: -1- AC_PATH_TOOL_PREFIX([${ac_tool_prefix}file], [/usr/bin$PATH_SEPARATOR$PATH])
+m4trace:configure.in:24: -1- AC_PATH_TOOL_PREFIX([file], [/usr/bin$PATH_SEPARATOR$PATH])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1373: AC_ARG_ENABLE is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:219: AC_LIBTOOL_SETUP is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:75: _AC_PROG_LIBTOOL is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:55: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1391: AC_ARG_WITH is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:219: AC_LIBTOOL_SETUP is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:75: _AC_PROG_LIBTOOL is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:55: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- AC_LIBTOOL_LANG_C_CONFIG
+m4trace:configure.in:24: -1- _LT_AC_LANG_C_CONFIG
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([objext], [])
+m4trace:configure.in:24: -1- _LT_AC_SYS_COMPILER
+m4trace:configure.in:24: -1- _LT_COMPILER_BOILERPLATE
+m4trace:configure.in:24: -1- _LT_LINKER_BOILERPLATE
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_cc_shlib], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_cc_shlib], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_cc_shlib], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_cc_shlib], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_cc_shlib], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_cc_shlib], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_cc_shlib], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_cc_shlib], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_cc_can_build_shared], [])
+m4trace:configure.in:24: -2- _LT_AC_TAGVAR([lt_prog_compiler_static_works], [])
+m4trace:configure.in:24: -2- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, ) works], [lt_prog_compiler_static_works], [$lt_prog_compiler_static], [], [_LT_AC_TAGVAR(lt_prog_compiler_static, )=])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_COMPILER_NO_RTTI([])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [])
+m4trace:configure.in:24: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], [lt_cv_prog_compiler_rtti_exceptions], [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, )="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, ) -fno-rtti -fno-exceptions"])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_COMPILER_PIC([])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -2- _LT_AC_TAGVAR([lt_prog_compiler_pic_works], [])
+m4trace:configure.in:24: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, ) works], [lt_prog_compiler_pic_works], [$_LT_AC_TAGVAR(lt_prog_compiler_pic, )ifelse([],[],[ -DPIC],[ifelse([],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, ) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, )=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, )" ;;
+     esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, )=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, )=no])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_CC_C_O([])
+m4trace:configure.in:24: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:24: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:24: -1- AC_LIBTOOL_SYS_HARD_LINK_LOCKS([])
+m4trace:configure.in:24: -1- _LT_AC_LOCK
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:2415: AC_TRY_LINK is expanded from...
+../../lib/m4sugar/m4sh.m4:523: AS_IF is expanded from...
+autoconf/general.m4:1905: AC_CACHE_VAL is expanded from...
+autoconf/general.m4:1918: AC_CACHE_CHECK is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:588: _LT_AC_LOCK is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1055: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2662: _LT_AC_LANG_C_CONFIG is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:2558: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:219: AC_LIBTOOL_SETUP is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:75: _AC_PROG_LIBTOOL is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:55: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_LD_SHLIBS([])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([include_expsyms], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([exclude_expsyms], [])
+m4trace:configure.in:24: -1- _LT_CC_BASENAME([$compiler])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([fix_srcfile_path], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([reload_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -2- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:24: -1- AC_LIBTOOL_SYS_DYNAMIC_LINKER([])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([runpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [])
+m4trace:configure.in:24: -1- AC_LIBTOOL_SYS_LIB_STRIP
+m4trace:configure.in:24: -1- AC_LIBTOOL_DLOPEN_SELF([])
+m4trace:configure.in:24: -1- _LT_AC_CHECK_DLFCN
+m4trace:configure.in:24: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.in:24: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.in:24: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.in:24: -1- m4_pattern_allow([^STDC_HEADERS$])
+m4trace:configure.in:24: -1- _LT_AC_TRY_DLOPEN_SELF([lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=no], [lt_cv_dlopen_self=cross])
+m4trace:configure.in:24: -1- _LT_AC_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])
+m4trace:configure.in:24: -1- AC_LIBTOOL_CONFIG([])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([CC], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([LD], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predep_objects], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdep_objects], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predeps], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdeps], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postinstall_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postuninstall_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([exclude_expsyms], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([include_expsyms], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([GCC], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([LD], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predep_objects], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdep_objects], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predeps], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdeps], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([fix_srcfile_path], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([exclude_expsyms], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([include_expsyms], [])
+m4trace:configure.in:24: -1- _LT_AC_TAGCONFIG
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1391: AC_ARG_WITH is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1805: _LT_AC_TAGCONFIG is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:219: AC_LIBTOOL_SETUP is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:75: _AC_PROG_LIBTOOL is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:55: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me:$LINENO: error: tag name \"$tagname\" already exists], [/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1805: _LT_AC_TAGCONFIG is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:219: AC_LIBTOOL_SETUP is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:75: _AC_PROG_LIBTOOL is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:55: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me: error: tag name \"$tagname\" already exists], [/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1805: _LT_AC_TAGCONFIG is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:219: AC_LIBTOOL_SETUP is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:75: _AC_PROG_LIBTOOL is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:55: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- AC_LIBTOOL_LANG_CXX_CONFIG
+m4trace:configure.in:24: -1- _LT_AC_LANG_CXX_CONFIG([CXX])
+m4trace:configure.in:24: -1- _LT_AC_PROG_CXXCPP
+m4trace:configure.in:24: -1- m4_pattern_allow([^CXXCPP$])
+m4trace:configure.in:24: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.in:24: -1- m4_pattern_allow([^CXXCPP$])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predeps], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([objext], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_SYS_COMPILER
+m4trace:configure.in:24: -1- _LT_COMPILER_BOILERPLATE
+m4trace:configure.in:24: -1- _LT_LINKER_BOILERPLATE
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler], [CXX])
+m4trace:configure.in:24: -1- _LT_CC_BASENAME([$compiler])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX])
+m4trace:configure.in:24: -1- AC_PROG_LD
+m4trace:configure.in:24: -1- AC_PROG_LD_GNU
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([GCC], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([LD], [CXX])
+m4trace:configure.in:24: -1- AC_LIBTOOL_POSTDEP_PREDEP([CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_COMPILER_PIC([CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -2- _LT_AC_TAGVAR([lt_prog_compiler_pic_works], [CXX])
+m4trace:configure.in:24: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX) works], [lt_prog_compiler_pic_works_CXX], [$_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)ifelse([CXX],[],[ -DPIC],[ifelse([CXX],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)" ;;
+     esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, CXX)=no])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_CC_C_O([CXX])
+m4trace:configure.in:24: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:24: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:24: -1- AC_LIBTOOL_SYS_HARD_LINK_LOCKS([CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_LD_SHLIBS([CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -2- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:24: -1- AC_LIBTOOL_SYS_DYNAMIC_LINKER([CXX])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([runpath_var], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:24: -1- AC_LIBTOOL_SYS_LIB_STRIP
+m4trace:configure.in:24: -1- AC_LIBTOOL_DLOPEN_SELF([CXX])
+m4trace:configure.in:24: -1- _LT_AC_TRY_DLOPEN_SELF([lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=no], [lt_cv_dlopen_self=cross])
+m4trace:configure.in:24: -1- _LT_AC_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])
+m4trace:configure.in:24: -1- AC_LIBTOOL_CONFIG([CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([CC], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([LD], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predeps], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postinstall_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postuninstall_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([exclude_expsyms], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([include_expsyms], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([GCC], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([LD], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predeps], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([fix_srcfile_path], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([exclude_expsyms], [CXX])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([include_expsyms], [CXX])
+m4trace:configure.in:24: -1- AC_LIBTOOL_LANG_F77_CONFIG
+m4trace:configure.in:24: -1- _LT_AC_LANG_F77_CONFIG([F77])
+m4trace:configure.in:24: -1- m4_pattern_allow([^F77$])
+m4trace:configure.in:24: -1- m4_pattern_allow([^FFLAGS$])
+m4trace:configure.in:24: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.in:24: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.in:24: -1- m4_pattern_allow([^F77$])
+m4trace:configure.in:24: -1- m4_pattern_allow([^ac_ct_F77$])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([objext], [F77])
+m4trace:configure.in:24: -1- _LT_AC_SYS_COMPILER
+m4trace:configure.in:24: -1- _LT_COMPILER_BOILERPLATE
+m4trace:configure.in:24: -1- _LT_LINKER_BOILERPLATE
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler], [F77])
+m4trace:configure.in:24: -1- _LT_CC_BASENAME([$compiler])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([GCC], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([LD], [F77])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_COMPILER_PIC([F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -2- _LT_AC_TAGVAR([lt_prog_compiler_pic_works], [F77])
+m4trace:configure.in:24: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, F77) works], [lt_prog_compiler_pic_works_F77], [$_LT_AC_TAGVAR(lt_prog_compiler_pic, F77)ifelse([F77],[],[ -DPIC],[ifelse([F77],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, F77) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, F77)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, F77)" ;;
+     esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, F77)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, F77)=no])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_CC_C_O([F77])
+m4trace:configure.in:24: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:24: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:24: -1- AC_LIBTOOL_SYS_HARD_LINK_LOCKS([F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_LD_SHLIBS([F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([include_expsyms], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([exclude_expsyms], [F77])
+m4trace:configure.in:24: -1- _LT_CC_BASENAME([$compiler])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([fix_srcfile_path], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([reload_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -2- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:24: -1- AC_LIBTOOL_SYS_DYNAMIC_LINKER([F77])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([runpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [F77])
+m4trace:configure.in:24: -1- AC_LIBTOOL_SYS_LIB_STRIP
+m4trace:configure.in:24: -1- AC_LIBTOOL_CONFIG([F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([CC], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([LD], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predep_objects], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdep_objects], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predeps], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdeps], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postinstall_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postuninstall_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([exclude_expsyms], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([include_expsyms], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([GCC], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([LD], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predep_objects], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdep_objects], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predeps], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdeps], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([fix_srcfile_path], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([exclude_expsyms], [F77])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([include_expsyms], [F77])
+m4trace:configure.in:24: -1- AC_LIBTOOL_LANG_GCJ_CONFIG
+m4trace:configure.in:24: -1- _LT_AC_LANG_GCJ_CONFIG([GCJ])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete.
+You should run autoupdate.], [autoconf/lang.m4:170: AC_LANG_SAVE is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:3931: _LT_AC_LANG_GCJ_CONFIG is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:3877: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1805: _LT_AC_TAGCONFIG is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:219: AC_LIBTOOL_SETUP is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:75: _AC_PROG_LIBTOOL is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:55: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([objext], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_SYS_COMPILER
+m4trace:configure.in:24: -1- _LT_COMPILER_BOILERPLATE
+m4trace:configure.in:24: -1- _LT_LINKER_BOILERPLATE
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler], [GCJ])
+m4trace:configure.in:24: -1- _LT_CC_BASENAME([$compiler])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_COMPILER_NO_RTTI([GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ])
+m4trace:configure.in:24: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], [lt_cv_prog_compiler_rtti_exceptions], [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, GCJ)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, GCJ) -fno-rtti -fno-exceptions"])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_COMPILER_PIC([GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -2- _LT_AC_TAGVAR([lt_prog_compiler_pic_works], [GCJ])
+m4trace:configure.in:24: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ) works], [lt_prog_compiler_pic_works_GCJ], [$_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ)ifelse([GCJ],[],[ -DPIC],[ifelse([GCJ],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ)" ;;
+     esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, GCJ)=no])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_CC_C_O([GCJ])
+m4trace:configure.in:24: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:24: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:24: -1- AC_LIBTOOL_SYS_HARD_LINK_LOCKS([GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_LD_SHLIBS([GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([include_expsyms], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([exclude_expsyms], [GCJ])
+m4trace:configure.in:24: -1- _LT_CC_BASENAME([$compiler])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([fix_srcfile_path], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([reload_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -2- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:24: -1- AC_LIBTOOL_SYS_DYNAMIC_LINKER([GCJ])
+m4trace:configure.in:24: -1- AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([runpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ])
+m4trace:configure.in:24: -1- AC_LIBTOOL_SYS_LIB_STRIP
+m4trace:configure.in:24: -1- AC_LIBTOOL_DLOPEN_SELF([GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TRY_DLOPEN_SELF([lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=no], [lt_cv_dlopen_self=cross])
+m4trace:configure.in:24: -1- _LT_AC_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])
+m4trace:configure.in:24: -1- AC_LIBTOOL_CONFIG([GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([CC], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([LD], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predep_objects], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdep_objects], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predeps], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdeps], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postinstall_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postuninstall_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([exclude_expsyms], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([include_expsyms], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([GCC], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([LD], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predep_objects], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdep_objects], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predeps], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdeps], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([fix_srcfile_path], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([exclude_expsyms], [GCJ])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([include_expsyms], [GCJ])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete.
+You should run autoupdate.], [autoconf/lang.m4:176: AC_LANG_RESTORE is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:3931: _LT_AC_LANG_GCJ_CONFIG is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:3877: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1805: _LT_AC_TAGCONFIG is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:219: AC_LIBTOOL_SETUP is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:75: _AC_PROG_LIBTOOL is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:55: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- AC_LIBTOOL_LANG_RC_CONFIG
+m4trace:configure.in:24: -1- _LT_AC_LANG_RC_CONFIG([RC])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete.
+You should run autoupdate.], [autoconf/lang.m4:170: AC_LANG_SAVE is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:3975: _LT_AC_LANG_RC_CONFIG is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:3939: AC_LIBTOOL_LANG_RC_CONFIG is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1805: _LT_AC_TAGCONFIG is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:219: AC_LIBTOOL_SETUP is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:75: _AC_PROG_LIBTOOL is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:55: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([objext], [RC])
+m4trace:configure.in:24: -1- _LT_AC_SYS_COMPILER
+m4trace:configure.in:24: -1- _LT_COMPILER_BOILERPLATE
+m4trace:configure.in:24: -1- _LT_LINKER_BOILERPLATE
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler], [RC])
+m4trace:configure.in:24: -1- _LT_CC_BASENAME([$compiler])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [RC])
+m4trace:configure.in:24: -1- AC_LIBTOOL_CONFIG([RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([CC], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([LD], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predep_objects], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdep_objects], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predeps], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdeps], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postinstall_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postuninstall_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([exclude_expsyms], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([include_expsyms], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([GCC], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([LD], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([module_expsym_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predep_objects], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdep_objects], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([predeps], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([postdeps], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([allow_undefined_flag], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([no_undefined_flag], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_action], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_direct], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_minus_L], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([hardcode_automatic], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([link_all_deplibs], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([fix_srcfile_path], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([always_export_symbols], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([export_symbols_cmds], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([exclude_expsyms], [RC])
+m4trace:configure.in:24: -1- _LT_AC_TAGVAR([include_expsyms], [RC])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete.
+You should run autoupdate.], [autoconf/lang.m4:176: AC_LANG_RESTORE is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:3975: _LT_AC_LANG_RC_CONFIG is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:3939: AC_LIBTOOL_LANG_RC_CONFIG is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:1805: _LT_AC_TAGCONFIG is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:219: AC_LIBTOOL_SETUP is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:75: _AC_PROG_LIBTOOL is expanded from...
+/usr/pack/kde-3.5.1-to/i686-debian-linux3.1/share/aclocal/libtool.m4:55: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- m4_pattern_allow([^LIBTOOL$])
+m4trace:configure.in:24: -1- AC_LIBTOOL_CXX
+m4trace:configure.in:24: -1- _LT_AC_LANG_CXX
+m4trace:configure.in:24: -1- _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+m4trace:configure.in:24: -1- AC_LIBTOOL_F77
+m4trace:configure.in:24: -1- _LT_AC_LANG_F77
+m4trace:configure.in:24: -1- _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+m4trace:configure.in:25: -1- AC_LIBTOOL_LANG_CXX_CONFIG
+m4trace:configure.in:25: -1- _LT_AC_LANG_CXX_CONFIG([CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([module_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([predeps], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([objext], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_SYS_COMPILER
+m4trace:configure.in:25: -1- _LT_COMPILER_BOILERPLATE
+m4trace:configure.in:25: -1- _LT_LINKER_BOILERPLATE
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([compiler], [CXX])
+m4trace:configure.in:25: -1- _LT_CC_BASENAME([$compiler])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX])
+m4trace:configure.in:25: -1- AC_PROG_LD
+m4trace:configure.in:25: -1- AC_PROG_LD_GNU
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_SYS_LIBPATH_AIX
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([module_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([module_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([GCC], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([LD], [CXX])
+m4trace:configure.in:25: -1- AC_LIBTOOL_POSTDEP_PREDEP([CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:25: -1- AC_LIBTOOL_PROG_COMPILER_PIC([CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -2- _LT_AC_TAGVAR([lt_prog_compiler_pic_works], [CXX])
+m4trace:configure.in:25: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX) works], [lt_prog_compiler_pic_works_CXX], [$_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)ifelse([CXX],[],[ -DPIC],[ifelse([CXX],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)" ;;
+     esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, CXX)=no])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- AC_LIBTOOL_PROG_CC_C_O([CXX])
+m4trace:configure.in:25: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:25: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:25: -1- AC_LIBTOOL_SYS_HARD_LINK_LOCKS([CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:25: -1- AC_LIBTOOL_PROG_LD_SHLIBS([CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -2- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:25: -1- AC_LIBTOOL_SYS_DYNAMIC_LINKER([CXX])
+m4trace:configure.in:25: -1- AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([runpath_var], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:25: -1- AC_LIBTOOL_SYS_LIB_STRIP
+m4trace:configure.in:25: -1- AC_LIBTOOL_DLOPEN_SELF([CXX])
+m4trace:configure.in:25: -1- _LT_AC_TRY_DLOPEN_SELF([lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=no], [lt_cv_dlopen_self=cross])
+m4trace:configure.in:25: -1- _LT_AC_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])
+m4trace:configure.in:25: -1- AC_LIBTOOL_CONFIG([CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([compiler], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([CC], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([LD], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([predeps], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postinstall_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postuninstall_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([module_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([exclude_expsyms], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([include_expsyms], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([module_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([compiler], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([GCC], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([LD], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([module_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([predep_objects], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postdep_objects], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([predeps], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([postdeps], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_action], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([fix_srcfile_path], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([exclude_expsyms], [CXX])
+m4trace:configure.in:25: -1- _LT_AC_TAGVAR([include_expsyms], [CXX])
+m4trace:configure.in:30: -1- m4_pattern_allow([^OGRE_CFLAGS$])
+m4trace:configure.in:60: -1- AC_LIBTOOL_COMPILER_OPTION([if $CXX supports -fvisibility], [ogre_prog_compiler_supports_visibility], [-fvisibility=hidden -fvisibility-inlines-hidden], [], [CFLAGS_VISIBILITY="-fvisibility=hidden -fvisibility-inlines-hidden -DOGRE_GCC_VISIBILITY";
+    case $target_cpu in
+        x86_64* )
+            if ! echo "$CFLAGS $CXXFLAGS" | grep -q "\-O"; then
+                echo "***********************************************************************"
+                echo "WARNING: It looks like you're doing a debug build for an x86_64 target."
+                echo "The -fvisibility-inlines-hidden flag is known to give problems in such"
+                echo "situations with libstdc++ < 4.2. Disabling the compiler flag."
+                echo "***********************************************************************"
+                CFLAGS_VISIBILITY="-fvisibility=hidden -DOGRE_GCC_VISIBILITY"
+            fi
+        ;;
+    esac
+    case $CXX in
+        icpc )
+            echo "***********************************************************************"
+            echo "WARNING: The intel compiler currently has bugs in its -fvisibility"
+            echo "implementation. Disabling the compiler flag."
+            echo "***********************************************************************"
+            CFLAGS_VISIBILITY=""
+        ;;
+    esac
+    ])
+m4trace:configure.in:61: -1- m4_pattern_allow([^CFLAGS_VISIBILITY$])
+m4trace:configure.in:65: -1- OGRE_USE_STLPORT
+m4trace:configure.in:65: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:159: OGRE_USE_STLPORT is expanded from...
+configure.in:65: the top level])
+m4trace:configure.in:65: -1- m4_pattern_allow([^STLPORT_CFLAGS$])
+m4trace:configure.in:65: -1- m4_pattern_allow([^STLPORT_LIBS$])
+m4trace:configure.in:66: -1- AC_CHECK_FT2([9.0.0])
+m4trace:configure.in:66: -1- m4_pattern_allow([^FT2_CONFIG$])
+m4trace:configure.in:66: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:2479: AC_TRY_RUN is expanded from...
+acinclude.m4:143: AC_CHECK_FT2 is expanded from...
+configure.in:66: the top level])
+m4trace:configure.in:66: -1- m4_pattern_allow([^FT2_CFLAGS$])
+m4trace:configure.in:66: -1- m4_pattern_allow([^FT2_LIBS$])
+m4trace:configure.in:68: -1- m4_pattern_allow([^HAVE_LIBDL$])
+m4trace:configure.in:69: -1- m4_pattern_allow([^HAVE_LIBM$])
+m4trace:configure.in:70: -1- m4_pattern_allow([^HAVE_LIBZ$])
+m4trace:configure.in:71: -1- m4_pattern_allow([^HAVE_LIBPTHREAD$])
+m4trace:configure.in:72: -2- m4_pattern_allow([^HAVE_SNPRINTF$])
+m4trace:configure.in:73: -2- m4_pattern_allow([^HAVE_VSNPRINTF$])
+m4trace:configure.in:75: -1- OGRE_CHECK_CPPUNIT
+m4trace:configure.in:75: -1- AM_PATH_CPPUNIT([1.10.0], [build_unit_tests=true])
+m4trace:configure.in:75: -1- m4_pattern_allow([^CPPUNIT_CONFIG$])
+m4trace:configure.in:75: -1- m4_pattern_allow([^CPPUNIT_CFLAGS$])
+m4trace:configure.in:75: -1- m4_pattern_allow([^CPPUNIT_LIBS$])
+m4trace:configure.in:75: -1- AM_CONDITIONAL([BUILD_UNIT_TESTS], [test x$build_unit_tests = xtrue])
+m4trace:configure.in:75: -1- m4_pattern_allow([^BUILD_UNIT_TESTS_TRUE$])
+m4trace:configure.in:75: -1- m4_pattern_allow([^BUILD_UNIT_TESTS_FALSE$])
+m4trace:configure.in:77: -1- PKG_CHECK_MODULES([ZZIPLIB], [zziplib])
+m4trace:configure.in:77: -1- PKG_PROG_PKG_CONFIG
+m4trace:configure.in:77: -1- m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4trace:configure.in:77: -1- m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+m4trace:configure.in:77: -1- m4_pattern_allow([^PKG_CONFIG$])
+m4trace:configure.in:77: -1- m4_pattern_allow([^PKG_CONFIG$])
+m4trace:configure.in:77: -1- m4_pattern_allow([^ZZIPLIB_CFLAGS$])
+m4trace:configure.in:77: -1- m4_pattern_allow([^ZZIPLIB_LIBS$])
+m4trace:configure.in:77: -1- PKG_CHECK_EXISTS([zziplib], [pkg_cv_[]ZZIPLIB_CFLAGS=`$PKG_CONFIG --[]cflags "zziplib" 2>/dev/null`], [pkg_failed=yes])
+m4trace:configure.in:77: -1- PKG_CHECK_EXISTS([zziplib], [pkg_cv_[]ZZIPLIB_LIBS=`$PKG_CONFIG --[]libs "zziplib" 2>/dev/null`], [pkg_failed=yes])
+m4trace:configure.in:77: -1- _PKG_SHORT_ERRORS_SUPPORTED
+m4trace:configure.in:78: -1- m4_pattern_allow([^ZZIPLIB_CFLAGS$])
+m4trace:configure.in:79: -1- m4_pattern_allow([^ZZIPLIB_LIBS$])
+m4trace:configure.in:82: -1- OGRE_GET_PLATFORM
+m4trace:configure.in:82: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:203: OGRE_GET_PLATFORM is expanded from...
+configure.in:82: the top level])
+m4trace:configure.in:82: -1- m4_pattern_allow([^XMKMF$])
+m4trace:configure.in:82: -1- m4_pattern_allow([^PLATFORM_CFLAGS$])
+m4trace:configure.in:82: -1- m4_pattern_allow([^PLATFORM_LIBS$])
+m4trace:configure.in:82: -1- m4_pattern_allow([^OGRE_PLATFORM$])
+m4trace:configure.in:83: -1- OGRE_GET_GLSUPPORT
+m4trace:configure.in:83: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:254: OGRE_GET_GLSUPPORT is expanded from...
+configure.in:83: the top level])
+m4trace:configure.in:83: -1- m4_pattern_allow([^XMKMF$])
+m4trace:configure.in:83: -1- m4_pattern_allow([^GLSUPPORT_CFLAGS$])
+m4trace:configure.in:83: -1- m4_pattern_allow([^GLSUPPORT_LIBS$])
+m4trace:configure.in:83: -1- m4_pattern_allow([^OGRE_GLSUPPORT$])
+m4trace:configure.in:86: -1- OGRE_CHECK_GUI
+m4trace:configure.in:86: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:589: OGRE_CHECK_GUI is expanded from...
+configure.in:86: the top level])
+m4trace:configure.in:86: -1- PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.0.0], [with_gui=gtk], [
+            if test "x$with_gui" == "xgtk"; then
+                AC_MSG_ERROR([You chose gtk for the GUI but gtk is not available.])
+            fi
+        ])
+m4trace:configure.in:86: -1- m4_pattern_allow([^GTK_CFLAGS$])
+m4trace:configure.in:86: -1- m4_pattern_allow([^GTK_LIBS$])
+m4trace:configure.in:86: -1- PKG_CHECK_EXISTS([gtk+-2.0 >= 2.0.0], [pkg_cv_[]GTK_CFLAGS=`$PKG_CONFIG --[]cflags "gtk+-2.0 >= 2.0.0" 2>/dev/null`], [pkg_failed=yes])
+m4trace:configure.in:86: -1- PKG_CHECK_EXISTS([gtk+-2.0 >= 2.0.0], [pkg_cv_[]GTK_LIBS=`$PKG_CONFIG --[]libs "gtk+-2.0 >= 2.0.0" 2>/dev/null`], [pkg_failed=yes])
+m4trace:configure.in:86: -1- _PKG_SHORT_ERRORS_SUPPORTED
+m4trace:configure.in:86: -1- m4_pattern_allow([^OGRE_GUI$])
+m4trace:configure.in:86: -1- m4_pattern_allow([^GTK_CFLAGS$])
+m4trace:configure.in:86: -1- m4_pattern_allow([^GTK_LIBS$])
+m4trace:configure.in:87: -1- OGRE_CHECK_DOUBLE
+m4trace:configure.in:87: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:484: OGRE_CHECK_DOUBLE is expanded from...
+configure.in:87: the top level])
+m4trace:configure.in:87: -1- m4_pattern_allow([^OGRE_DOUBLE_PRECISION$])
+m4trace:configure.in:87: -1- m4_pattern_allow([^OGRE_DOUBLE_PRECISION$])
+m4trace:configure.in:88: -1- OGRE_CHECK_THREADING
+m4trace:configure.in:88: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:509: OGRE_CHECK_THREADING is expanded from...
+configure.in:88: the top level])
+m4trace:configure.in:88: -1- m4_pattern_allow([^OGRE_THREAD_SUPPORT$])
+m4trace:configure.in:88: -1- m4_pattern_allow([^OGRE_THREAD_SUPPORT$])
+m4trace:configure.in:88: -1- m4_pattern_allow([^OGRE_THREAD_LIBS$])
+m4trace:configure.in:89: -1- OGRE_CHECK_FREEIMAGE
+m4trace:configure.in:89: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:395: OGRE_CHECK_FREEIMAGE is expanded from...
+configure.in:89: the top level])
+m4trace:configure.in:89: -1- AM_CONDITIONAL([USE_FREEIMAGE], [test x$build_freeimage = xyes])
+m4trace:configure.in:89: -1- m4_pattern_allow([^USE_FREEIMAGE_TRUE$])
+m4trace:configure.in:89: -1- m4_pattern_allow([^USE_FREEIMAGE_FALSE$])
+m4trace:configure.in:89: -1- m4_pattern_allow([^HAVE_LIBFREEIMAGE$])
+m4trace:configure.in:89: -1- m4_pattern_allow([^OGRE_NO_FREEIMAGE$])
+m4trace:configure.in:89: -1- m4_pattern_allow([^OGRE_NO_FREEIMAGE$])
+m4trace:configure.in:90: -1- OGRE_CHECK_DEVIL
+m4trace:configure.in:90: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:428: OGRE_CHECK_DEVIL is expanded from...
+configure.in:90: the top level])
+m4trace:configure.in:90: -1- AM_CONDITIONAL([USE_DEVIL], [test x$build_il = xyes && test x$build_freeimage = xno])
+m4trace:configure.in:90: -1- m4_pattern_allow([^USE_DEVIL_TRUE$])
+m4trace:configure.in:90: -1- m4_pattern_allow([^USE_DEVIL_FALSE$])
+m4trace:configure.in:90: -1- m4_pattern_allow([^OGRE_NO_DEVIL$])
+m4trace:configure.in:90: -1- m4_pattern_allow([^HAVE_LIBIL$])
+m4trace:configure.in:90: -1- m4_pattern_allow([^HAVE_LIBILU$])
+m4trace:configure.in:90: -1- m4_pattern_allow([^OGRE_NO_DEVIL$])
+m4trace:configure.in:90: -1- m4_pattern_allow([^OGRE_NO_DEVIL$])
+m4trace:configure.in:91: -1- OGRE_CHECK_CG
+m4trace:configure.in:91: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:348: OGRE_CHECK_CG is expanded from...
+configure.in:91: the top level])
+m4trace:configure.in:91: -1- m4_pattern_allow([^HAVE_LIBCG$])
+m4trace:configure.in:91: -1- AM_CONDITIONAL([BUILD_CGPLUGIN], [test x$build_cg = xyes])
+m4trace:configure.in:91: -1- m4_pattern_allow([^BUILD_CGPLUGIN_TRUE$])
+m4trace:configure.in:91: -1- m4_pattern_allow([^BUILD_CGPLUGIN_FALSE$])
+m4trace:configure.in:92: -1- OGRE_CHECK_OPENEXR
+m4trace:configure.in:92: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:324: OGRE_CHECK_OPENEXR is expanded from...
+configure.in:92: the top level])
+m4trace:configure.in:92: -1- PKG_CHECK_MODULES([OPENEXR], [OpenEXR], [build_exr=yes], [build_exr=no])
+m4trace:configure.in:92: -1- m4_pattern_allow([^OPENEXR_CFLAGS$])
+m4trace:configure.in:92: -1- m4_pattern_allow([^OPENEXR_LIBS$])
+m4trace:configure.in:92: -1- PKG_CHECK_EXISTS([OpenEXR], [pkg_cv_[]OPENEXR_CFLAGS=`$PKG_CONFIG --[]cflags "OpenEXR" 2>/dev/null`], [pkg_failed=yes])
+m4trace:configure.in:92: -1- PKG_CHECK_EXISTS([OpenEXR], [pkg_cv_[]OPENEXR_LIBS=`$PKG_CONFIG --[]libs "OpenEXR" 2>/dev/null`], [pkg_failed=yes])
+m4trace:configure.in:92: -1- _PKG_SHORT_ERRORS_SUPPORTED
+m4trace:configure.in:92: -1- m4_pattern_allow([^OPENEXR_CFLAGS$])
+m4trace:configure.in:92: -1- m4_pattern_allow([^OPENEXR_LIBS$])
+m4trace:configure.in:92: -1- AM_CONDITIONAL([BUILD_EXRPLUGIN], [test x$build_exr = xyes])
+m4trace:configure.in:92: -1- m4_pattern_allow([^BUILD_EXRPLUGIN_TRUE$])
+m4trace:configure.in:92: -1- m4_pattern_allow([^BUILD_EXRPLUGIN_FALSE$])
+m4trace:configure.in:93: -1- OGRE_CHECK_DX9
+m4trace:configure.in:93: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:366: OGRE_CHECK_DX9 is expanded from...
+configure.in:93: the top level])
+m4trace:configure.in:93: -1- AM_CONDITIONAL([BUILD_DX9RENDERSYSTEM], [test x$build_dx9 = xyes])
+m4trace:configure.in:93: -1- m4_pattern_allow([^BUILD_DX9RENDERSYSTEM_TRUE$])
+m4trace:configure.in:93: -1- m4_pattern_allow([^BUILD_DX9RENDERSYSTEM_FALSE$])
+m4trace:configure.in:94: -1- OGRE_CHECK_SSE
+m4trace:configure.in:94: -1- AM_CONDITIONAL([OGRE_BUILD_SSE], [test x$build_sse = xyes])
+m4trace:configure.in:94: -1- m4_pattern_allow([^OGRE_BUILD_SSE_TRUE$])
+m4trace:configure.in:94: -1- m4_pattern_allow([^OGRE_BUILD_SSE_FALSE$])
+m4trace:configure.in:98: -1- OGRE_PLATFORM_AND_GUI
+m4trace:configure.in:98: -1- AM_CONDITIONAL([SAME_PLATFORM_AND_GUI], [test "x$OGRE_PLATFORM" = "x$OGRE_GUI"])
+m4trace:configure.in:98: -1- m4_pattern_allow([^SAME_PLATFORM_AND_GUI_TRUE$])
+m4trace:configure.in:98: -1- m4_pattern_allow([^SAME_PLATFORM_AND_GUI_FALSE$])
+m4trace:configure.in:101: -1- OGRE_BUILD_DEMOS
+m4trace:configure.in:101: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:541: OGRE_BUILD_DEMOS is expanded from...
+configure.in:101: the top level])
+m4trace:configure.in:101: -1- PKG_CHECK_MODULES([OIS], [OIS >= 1.0.0], [ois_found=yes], [ois_found=no])
+m4trace:configure.in:101: -1- m4_pattern_allow([^OIS_CFLAGS$])
+m4trace:configure.in:101: -1- m4_pattern_allow([^OIS_LIBS$])
+m4trace:configure.in:101: -1- PKG_CHECK_EXISTS([OIS >= 1.0.0], [pkg_cv_[]OIS_CFLAGS=`$PKG_CONFIG --[]cflags "OIS >= 1.0.0" 2>/dev/null`], [pkg_failed=yes])
+m4trace:configure.in:101: -1- PKG_CHECK_EXISTS([OIS >= 1.0.0], [pkg_cv_[]OIS_LIBS=`$PKG_CONFIG --[]libs "OIS >= 1.0.0" 2>/dev/null`], [pkg_failed=yes])
+m4trace:configure.in:101: -1- _PKG_SHORT_ERRORS_SUPPORTED
+m4trace:configure.in:101: -1- m4_pattern_allow([^OIS_CFLAGS$])
+m4trace:configure.in:101: -1- m4_pattern_allow([^OIS_LIBS$])
+m4trace:configure.in:101: -1- AM_CONDITIONAL([OGRE_BUILDING_DEMOS], [test x$build_ogre_demos = xyes])
+m4trace:configure.in:101: -1- m4_pattern_allow([^OGRE_BUILDING_DEMOS_TRUE$])
+m4trace:configure.in:101: -1- m4_pattern_allow([^OGRE_BUILDING_DEMOS_FALSE$])
+m4trace:configure.in:104: -1- OGRE_DETECT_ENDIAN
+m4trace:configure.in:104: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:2479: AC_TRY_RUN is expanded from...
+acinclude.m4:299: OGRE_DETECT_ENDIAN is expanded from...
+configure.in:104: the top level])
+m4trace:configure.in:104: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [autoconf/general.m4:2471: AC_RUN_IFELSE is expanded from...
+autoconf/general.m4:2479: AC_TRY_RUN is expanded from...
+acinclude.m4:299: OGRE_DETECT_ENDIAN is expanded from...
+configure.in:104: the top level])
+m4trace:configure.in:104: -1- m4_pattern_allow([^OGRE_CONFIG_BIG_ENDIAN$])
+m4trace:configure.in:104: -1- m4_pattern_allow([^OGRE_CONFIG_LITTLE_ENDIAN$])
+m4trace:configure.in:107: -1- OGRE_CHECK_PIC
+m4trace:configure.in:110: -1- OGRE_CHECK_CEGUI
+m4trace:configure.in:110: -1- PKG_CHECK_MODULES([CEGUI], [CEGUI >= 0.5.0], [build_cegui_sample=true], [build_cegui_sample=false])
+m4trace:configure.in:110: -1- m4_pattern_allow([^CEGUI_CFLAGS$])
+m4trace:configure.in:110: -1- m4_pattern_allow([^CEGUI_LIBS$])
+m4trace:configure.in:110: -1- PKG_CHECK_EXISTS([CEGUI >= 0.5.0], [pkg_cv_[]CEGUI_CFLAGS=`$PKG_CONFIG --[]cflags "CEGUI >= 0.5.0" 2>/dev/null`], [pkg_failed=yes])
+m4trace:configure.in:110: -1- PKG_CHECK_EXISTS([CEGUI >= 0.5.0], [pkg_cv_[]CEGUI_LIBS=`$PKG_CONFIG --[]libs "CEGUI >= 0.5.0" 2>/dev/null`], [pkg_failed=yes])
+m4trace:configure.in:110: -1- _PKG_SHORT_ERRORS_SUPPORTED
+m4trace:configure.in:110: -1- m4_pattern_allow([^CEGUI_CFLAGS$])
+m4trace:configure.in:110: -1- m4_pattern_allow([^CEGUI_LIBS$])
+m4trace:configure.in:110: -1- AM_CONDITIONAL([HAVE_CEGUI], [test x$build_cegui_sample = xtrue])
+m4trace:configure.in:110: -1- m4_pattern_allow([^HAVE_CEGUI_TRUE$])
+m4trace:configure.in:110: -1- m4_pattern_allow([^HAVE_CEGUI_FALSE$])
+m4trace:configure.in:118: -1- m4_pattern_allow([^abs_top_builddir$])
+m4trace:configure.in:119: -1- m4_pattern_allow([^ogreexecdir$])
+m4trace:configure.in:254: -1- m4_pattern_allow([^LIB@&t@OBJS$])
+m4trace:configure.in:254: -1- m4_pattern_allow([^LTLIBOBJS$])
+m4trace:configure.in:254: -1- _AC_AM_CONFIG_HEADER_HOOK([$ac_file])
+m4trace:configure.in:254: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS
Index: /autom4te.cache/traces.1
===================================================================
--- /autom4te.cache/traces.1	(revision 5)
+++ /autom4te.cache/traces.1	(revision 5)
@@ -0,0 +1,1165 @@
+m4trace:aclocal.m4:7221: -1- m4_include([Scripts/m4/cppunit.m4])
+m4trace:aclocal.m4:7222: -1- m4_include([acinclude.m4])
+m4trace:configure.in:3: -1- AC_INIT([OGRE], [1.4.5])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^_?A[CHUM]_])
+m4trace:configure.in:3: -1- m4_pattern_forbid([_AC_])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
+m4trace:configure.in:3: -1- m4_pattern_allow([^AS_FLAGS$])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^_?m4_])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^dnl$])
+m4trace:configure.in:3: -1- m4_pattern_forbid([^_?AS_])
+m4trace:configure.in:3: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([SHELL])
+m4trace:configure.in:3: -1- m4_pattern_allow([^SHELL$])
+m4trace:configure.in:3: -1- AC_SUBST([PATH_SEPARATOR])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([PATH_SEPARATOR])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PATH_SEPARATOR$])
+m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME],      ['AC_PACKAGE_NAME'])])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_NAME])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_NAME$])
+m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME],   ['AC_PACKAGE_TARNAME'])])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_TARNAME])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
+m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION],   ['AC_PACKAGE_VERSION'])])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_VERSION])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_VERSION$])
+m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING],    ['AC_PACKAGE_STRING'])])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_STRING])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_STRING$])
+m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
+m4trace:configure.in:3: -1- AC_SUBST([exec_prefix], [NONE])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([exec_prefix])
+m4trace:configure.in:3: -1- m4_pattern_allow([^exec_prefix$])
+m4trace:configure.in:3: -1- AC_SUBST([prefix], [NONE])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([prefix])
+m4trace:configure.in:3: -1- m4_pattern_allow([^prefix$])
+m4trace:configure.in:3: -1- AC_SUBST([program_transform_name], [s,x,x,])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([program_transform_name])
+m4trace:configure.in:3: -1- m4_pattern_allow([^program_transform_name$])
+m4trace:configure.in:3: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([bindir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^bindir$])
+m4trace:configure.in:3: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([sbindir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^sbindir$])
+m4trace:configure.in:3: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([libexecdir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^libexecdir$])
+m4trace:configure.in:3: -1- AC_SUBST([datarootdir], ['${prefix}/share'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([datarootdir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^datarootdir$])
+m4trace:configure.in:3: -1- AC_SUBST([datadir], ['${datarootdir}'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([datadir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^datadir$])
+m4trace:configure.in:3: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([sysconfdir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^sysconfdir$])
+m4trace:configure.in:3: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([sharedstatedir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^sharedstatedir$])
+m4trace:configure.in:3: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([localstatedir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^localstatedir$])
+m4trace:configure.in:3: -1- AC_SUBST([includedir], ['${prefix}/include'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([includedir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^includedir$])
+m4trace:configure.in:3: -1- AC_SUBST([oldincludedir], ['/usr/include'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([oldincludedir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^oldincludedir$])
+m4trace:configure.in:3: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
+				     ['${datarootdir}/doc/${PACKAGE_TARNAME}'],
+				     ['${datarootdir}/doc/${PACKAGE}'])])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([docdir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^docdir$])
+m4trace:configure.in:3: -1- AC_SUBST([infodir], ['${datarootdir}/info'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([infodir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^infodir$])
+m4trace:configure.in:3: -1- AC_SUBST([htmldir], ['${docdir}'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([htmldir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^htmldir$])
+m4trace:configure.in:3: -1- AC_SUBST([dvidir], ['${docdir}'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([dvidir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^dvidir$])
+m4trace:configure.in:3: -1- AC_SUBST([pdfdir], ['${docdir}'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([pdfdir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^pdfdir$])
+m4trace:configure.in:3: -1- AC_SUBST([psdir], ['${docdir}'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([psdir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^psdir$])
+m4trace:configure.in:3: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([libdir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^libdir$])
+m4trace:configure.in:3: -1- AC_SUBST([localedir], ['${datarootdir}/locale'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([localedir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^localedir$])
+m4trace:configure.in:3: -1- AC_SUBST([mandir], ['${datarootdir}/man'])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([mandir])
+m4trace:configure.in:3: -1- m4_pattern_allow([^mandir$])
+m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_NAME$])
+m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
+#undef PACKAGE_NAME])
+m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
+m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME])
+m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_VERSION$])
+m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
+#undef PACKAGE_VERSION])
+m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_STRING$])
+m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING])
+m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
+m4trace:configure.in:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
+m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT])
+m4trace:configure.in:3: -1- AC_SUBST([DEFS])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([DEFS])
+m4trace:configure.in:3: -1- m4_pattern_allow([^DEFS$])
+m4trace:configure.in:3: -1- AC_SUBST([ECHO_C])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([ECHO_C])
+m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_C$])
+m4trace:configure.in:3: -1- AC_SUBST([ECHO_N])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([ECHO_N])
+m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_N$])
+m4trace:configure.in:3: -1- AC_SUBST([ECHO_T])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([ECHO_T])
+m4trace:configure.in:3: -1- m4_pattern_allow([^ECHO_T$])
+m4trace:configure.in:3: -1- AC_SUBST([LIBS])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([LIBS])
+m4trace:configure.in:3: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.in:3: -1- AC_SUBST([build_alias])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([build_alias])
+m4trace:configure.in:3: -1- m4_pattern_allow([^build_alias$])
+m4trace:configure.in:3: -1- AC_SUBST([host_alias])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([host_alias])
+m4trace:configure.in:3: -1- m4_pattern_allow([^host_alias$])
+m4trace:configure.in:3: -1- AC_SUBST([target_alias])
+m4trace:configure.in:3: -1- AC_SUBST_TRACE([target_alias])
+m4trace:configure.in:3: -1- m4_pattern_allow([^target_alias$])
+m4trace:configure.in:5: -1- AC_CANONICAL_TARGET
+m4trace:configure.in:5: -1- AC_CANONICAL_HOST
+m4trace:configure.in:5: -1- AC_CANONICAL_BUILD
+m4trace:configure.in:5: -1- AC_REQUIRE_AUX_FILE([config.sub])
+m4trace:configure.in:5: -1- AC_REQUIRE_AUX_FILE([config.guess])
+m4trace:configure.in:5: -1- AC_SUBST([build], [$ac_cv_build])
+m4trace:configure.in:5: -1- AC_SUBST_TRACE([build])
+m4trace:configure.in:5: -1- m4_pattern_allow([^build$])
+m4trace:configure.in:5: -1- AC_SUBST([build_cpu], [$[1]])
+m4trace:configure.in:5: -1- AC_SUBST_TRACE([build_cpu])
+m4trace:configure.in:5: -1- m4_pattern_allow([^build_cpu$])
+m4trace:configure.in:5: -1- AC_SUBST([build_vendor], [$[2]])
+m4trace:configure.in:5: -1- AC_SUBST_TRACE([build_vendor])
+m4trace:configure.in:5: -1- m4_pattern_allow([^build_vendor$])
+m4trace:configure.in:5: -1- AC_SUBST([build_os])
+m4trace:configure.in:5: -1- AC_SUBST_TRACE([build_os])
+m4trace:configure.in:5: -1- m4_pattern_allow([^build_os$])
+m4trace:configure.in:5: -1- AC_SUBST([host], [$ac_cv_host])
+m4trace:configure.in:5: -1- AC_SUBST_TRACE([host])
+m4trace:configure.in:5: -1- m4_pattern_allow([^host$])
+m4trace:configure.in:5: -1- AC_SUBST([host_cpu], [$[1]])
+m4trace:configure.in:5: -1- AC_SUBST_TRACE([host_cpu])
+m4trace:configure.in:5: -1- m4_pattern_allow([^host_cpu$])
+m4trace:configure.in:5: -1- AC_SUBST([host_vendor], [$[2]])
+m4trace:configure.in:5: -1- AC_SUBST_TRACE([host_vendor])
+m4trace:configure.in:5: -1- m4_pattern_allow([^host_vendor$])
+m4trace:configure.in:5: -1- AC_SUBST([host_os])
+m4trace:configure.in:5: -1- AC_SUBST_TRACE([host_os])
+m4trace:configure.in:5: -1- m4_pattern_allow([^host_os$])
+m4trace:configure.in:5: -1- AC_SUBST([target], [$ac_cv_target])
+m4trace:configure.in:5: -1- AC_SUBST_TRACE([target])
+m4trace:configure.in:5: -1- m4_pattern_allow([^target$])
+m4trace:configure.in:5: -1- AC_SUBST([target_cpu], [$[1]])
+m4trace:configure.in:5: -1- AC_SUBST_TRACE([target_cpu])
+m4trace:configure.in:5: -1- m4_pattern_allow([^target_cpu$])
+m4trace:configure.in:5: -1- AC_SUBST([target_vendor], [$[2]])
+m4trace:configure.in:5: -1- AC_SUBST_TRACE([target_vendor])
+m4trace:configure.in:5: -1- m4_pattern_allow([^target_vendor$])
+m4trace:configure.in:5: -1- AC_SUBST([target_os])
+m4trace:configure.in:5: -1- AC_SUBST_TRACE([target_os])
+m4trace:configure.in:5: -1- m4_pattern_allow([^target_os$])
+m4trace:configure.in:9: -1- AM_INIT_AUTOMAKE([OGRE], [1.4.5])
+m4trace:configure.in:9: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
+m4trace:configure.in:9: -1- AM_AUTOMAKE_VERSION([1.9.6])
+m4trace:configure.in:9: -1- AC_REQUIRE_AUX_FILE([install-sh])
+m4trace:configure.in:9: -1- AC_SUBST([INSTALL_PROGRAM])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([INSTALL_PROGRAM])
+m4trace:configure.in:9: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
+m4trace:configure.in:9: -1- AC_SUBST([INSTALL_SCRIPT])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([INSTALL_SCRIPT])
+m4trace:configure.in:9: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
+m4trace:configure.in:9: -1- AC_SUBST([INSTALL_DATA])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([INSTALL_DATA])
+m4trace:configure.in:9: -1- m4_pattern_allow([^INSTALL_DATA$])
+m4trace:configure.in:9: -1- AC_SUBST([CYGPATH_W])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([CYGPATH_W])
+m4trace:configure.in:9: -1- m4_pattern_allow([^CYGPATH_W$])
+m4trace:configure.in:9: -1- AC_SUBST([PACKAGE], [OGRE])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([PACKAGE])
+m4trace:configure.in:9: -1- m4_pattern_allow([^PACKAGE$])
+m4trace:configure.in:9: -1- AC_SUBST([VERSION], [1.4.5])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([VERSION])
+m4trace:configure.in:9: -1- m4_pattern_allow([^VERSION$])
+m4trace:configure.in:9: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE])
+m4trace:configure.in:9: -1- m4_pattern_allow([^PACKAGE$])
+m4trace:configure.in:9: -1- AH_OUTPUT([PACKAGE], [/* Name of package */
+#undef PACKAGE])
+m4trace:configure.in:9: -1- AC_DEFINE_TRACE_LITERAL([VERSION])
+m4trace:configure.in:9: -1- m4_pattern_allow([^VERSION$])
+m4trace:configure.in:9: -1- AH_OUTPUT([VERSION], [/* Version number of package */
+#undef VERSION])
+m4trace:configure.in:9: -1- AC_SUBST([ACLOCAL])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([ACLOCAL])
+m4trace:configure.in:9: -1- m4_pattern_allow([^ACLOCAL$])
+m4trace:configure.in:9: -1- AC_SUBST([AUTOCONF])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([AUTOCONF])
+m4trace:configure.in:9: -1- m4_pattern_allow([^AUTOCONF$])
+m4trace:configure.in:9: -1- AC_SUBST([AUTOMAKE])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([AUTOMAKE])
+m4trace:configure.in:9: -1- m4_pattern_allow([^AUTOMAKE$])
+m4trace:configure.in:9: -1- AC_SUBST([AUTOHEADER])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([AUTOHEADER])
+m4trace:configure.in:9: -1- m4_pattern_allow([^AUTOHEADER$])
+m4trace:configure.in:9: -1- AC_SUBST([MAKEINFO])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([MAKEINFO])
+m4trace:configure.in:9: -1- m4_pattern_allow([^MAKEINFO$])
+m4trace:configure.in:9: -1- AC_SUBST([install_sh])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([install_sh])
+m4trace:configure.in:9: -1- m4_pattern_allow([^install_sh$])
+m4trace:configure.in:9: -1- AC_SUBST([STRIP])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([STRIP])
+m4trace:configure.in:9: -1- m4_pattern_allow([^STRIP$])
+m4trace:configure.in:9: -1- AC_SUBST([INSTALL_STRIP_PROGRAM])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM])
+m4trace:configure.in:9: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$])
+m4trace:configure.in:9: -1- AC_SUBST([mkdir_p])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([mkdir_p])
+m4trace:configure.in:9: -1- m4_pattern_allow([^mkdir_p$])
+m4trace:configure.in:9: -1- AC_SUBST([AWK])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([AWK])
+m4trace:configure.in:9: -1- m4_pattern_allow([^AWK$])
+m4trace:configure.in:9: -1- AC_SUBST([SET_MAKE])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([SET_MAKE])
+m4trace:configure.in:9: -1- m4_pattern_allow([^SET_MAKE$])
+m4trace:configure.in:9: -1- AC_SUBST([am__leading_dot])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([am__leading_dot])
+m4trace:configure.in:9: -1- m4_pattern_allow([^am__leading_dot$])
+m4trace:configure.in:9: -1- AC_SUBST([AMTAR])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([AMTAR])
+m4trace:configure.in:9: -1- m4_pattern_allow([^AMTAR$])
+m4trace:configure.in:9: -1- AC_SUBST([am__tar])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([am__tar])
+m4trace:configure.in:9: -1- m4_pattern_allow([^am__tar$])
+m4trace:configure.in:9: -1- AC_SUBST([am__untar])
+m4trace:configure.in:9: -1- AC_SUBST_TRACE([am__untar])
+m4trace:configure.in:9: -1- m4_pattern_allow([^am__untar$])
+m4trace:configure.in:10: -1- AC_CONFIG_HEADERS([OgreMain/include/config.h])
+m4trace:configure.in:13: -1- AC_SUBST([CC])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([CC])
+m4trace:configure.in:13: -1- m4_pattern_allow([^CC$])
+m4trace:configure.in:13: -1- AC_SUBST([CFLAGS])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([CFLAGS])
+m4trace:configure.in:13: -1- m4_pattern_allow([^CFLAGS$])
+m4trace:configure.in:13: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([LDFLAGS])
+m4trace:configure.in:13: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.in:13: -1- AC_SUBST([LIBS])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([LIBS])
+m4trace:configure.in:13: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.in:13: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([CPPFLAGS])
+m4trace:configure.in:13: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.in:13: -1- AC_SUBST([CC])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([CC])
+m4trace:configure.in:13: -1- m4_pattern_allow([^CC$])
+m4trace:configure.in:13: -1- AC_SUBST([CC])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([CC])
+m4trace:configure.in:13: -1- m4_pattern_allow([^CC$])
+m4trace:configure.in:13: -1- AC_SUBST([CC])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([CC])
+m4trace:configure.in:13: -1- m4_pattern_allow([^CC$])
+m4trace:configure.in:13: -1- AC_SUBST([CC])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([CC])
+m4trace:configure.in:13: -1- m4_pattern_allow([^CC$])
+m4trace:configure.in:13: -1- AC_SUBST([ac_ct_CC])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([ac_ct_CC])
+m4trace:configure.in:13: -1- m4_pattern_allow([^ac_ct_CC$])
+m4trace:configure.in:13: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([EXEEXT])
+m4trace:configure.in:13: -1- m4_pattern_allow([^EXEEXT$])
+m4trace:configure.in:13: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([OBJEXT])
+m4trace:configure.in:13: -1- m4_pattern_allow([^OBJEXT$])
+m4trace:configure.in:13: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([DEPDIR])
+m4trace:configure.in:13: -1- m4_pattern_allow([^DEPDIR$])
+m4trace:configure.in:13: -1- AC_SUBST([am__include])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([am__include])
+m4trace:configure.in:13: -1- m4_pattern_allow([^am__include$])
+m4trace:configure.in:13: -1- AC_SUBST([am__quote])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([am__quote])
+m4trace:configure.in:13: -1- m4_pattern_allow([^am__quote$])
+m4trace:configure.in:13: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+m4trace:configure.in:13: -1- AC_SUBST([AMDEP_TRUE])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([AMDEP_TRUE])
+m4trace:configure.in:13: -1- m4_pattern_allow([^AMDEP_TRUE$])
+m4trace:configure.in:13: -1- AC_SUBST([AMDEP_FALSE])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([AMDEP_FALSE])
+m4trace:configure.in:13: -1- m4_pattern_allow([^AMDEP_FALSE$])
+m4trace:configure.in:13: -1- AC_SUBST([AMDEPBACKSLASH])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([AMDEPBACKSLASH])
+m4trace:configure.in:13: -1- m4_pattern_allow([^AMDEPBACKSLASH$])
+m4trace:configure.in:13: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([CCDEPMODE])
+m4trace:configure.in:13: -1- m4_pattern_allow([^CCDEPMODE$])
+m4trace:configure.in:13: -1- AM_CONDITIONAL([am__fastdepCC], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3])
+m4trace:configure.in:13: -1- AC_SUBST([am__fastdepCC_TRUE])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE])
+m4trace:configure.in:13: -1- m4_pattern_allow([^am__fastdepCC_TRUE$])
+m4trace:configure.in:13: -1- AC_SUBST([am__fastdepCC_FALSE])
+m4trace:configure.in:13: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE])
+m4trace:configure.in:13: -1- m4_pattern_allow([^am__fastdepCC_FALSE$])
+m4trace:configure.in:14: -1- AC_SUBST([CXX])
+m4trace:configure.in:14: -1- AC_SUBST_TRACE([CXX])
+m4trace:configure.in:14: -1- m4_pattern_allow([^CXX$])
+m4trace:configure.in:14: -1- AC_SUBST([CXXFLAGS])
+m4trace:configure.in:14: -1- AC_SUBST_TRACE([CXXFLAGS])
+m4trace:configure.in:14: -1- m4_pattern_allow([^CXXFLAGS$])
+m4trace:configure.in:14: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.in:14: -1- AC_SUBST_TRACE([LDFLAGS])
+m4trace:configure.in:14: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.in:14: -1- AC_SUBST([LIBS])
+m4trace:configure.in:14: -1- AC_SUBST_TRACE([LIBS])
+m4trace:configure.in:14: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.in:14: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.in:14: -1- AC_SUBST_TRACE([CPPFLAGS])
+m4trace:configure.in:14: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.in:14: -1- AC_SUBST([CXX])
+m4trace:configure.in:14: -1- AC_SUBST_TRACE([CXX])
+m4trace:configure.in:14: -1- m4_pattern_allow([^CXX$])
+m4trace:configure.in:14: -1- AC_SUBST([ac_ct_CXX])
+m4trace:configure.in:14: -1- AC_SUBST_TRACE([ac_ct_CXX])
+m4trace:configure.in:14: -1- m4_pattern_allow([^ac_ct_CXX$])
+m4trace:configure.in:14: -1- AC_SUBST([CXXDEPMODE], [depmode=$am_cv_CXX_dependencies_compiler_type])
+m4trace:configure.in:14: -1- AC_SUBST_TRACE([CXXDEPMODE])
+m4trace:configure.in:14: -1- m4_pattern_allow([^CXXDEPMODE$])
+m4trace:configure.in:14: -1- AM_CONDITIONAL([am__fastdepCXX], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3])
+m4trace:configure.in:14: -1- AC_SUBST([am__fastdepCXX_TRUE])
+m4trace:configure.in:14: -1- AC_SUBST_TRACE([am__fastdepCXX_TRUE])
+m4trace:configure.in:14: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$])
+m4trace:configure.in:14: -1- AC_SUBST([am__fastdepCXX_FALSE])
+m4trace:configure.in:14: -1- AC_SUBST_TRACE([am__fastdepCXX_FALSE])
+m4trace:configure.in:14: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$])
+m4trace:configure.in:15: -1- AM_PROG_CC_C_O
+m4trace:configure.in:15: -1- AC_DEFINE_TRACE_LITERAL([NO_MINUS_C_MINUS_O])
+m4trace:configure.in:15: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$])
+m4trace:configure.in:15: -1- AH_OUTPUT([NO_MINUS_C_MINUS_O], [/* Define to 1 if your C compiler doesn\'t accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O])
+m4trace:configure.in:16: -1- AC_REQUIRE_AUX_FILE([install-sh])
+m4trace:configure.in:16: -1- AC_SUBST([INSTALL_PROGRAM])
+m4trace:configure.in:16: -1- AC_SUBST_TRACE([INSTALL_PROGRAM])
+m4trace:configure.in:16: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
+m4trace:configure.in:16: -1- AC_SUBST([INSTALL_SCRIPT])
+m4trace:configure.in:16: -1- AC_SUBST_TRACE([INSTALL_SCRIPT])
+m4trace:configure.in:16: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
+m4trace:configure.in:16: -1- AC_SUBST([INSTALL_DATA])
+m4trace:configure.in:16: -1- AC_SUBST_TRACE([INSTALL_DATA])
+m4trace:configure.in:16: -1- m4_pattern_allow([^INSTALL_DATA$])
+m4trace:configure.in:17: -1- AC_SUBST([YACC])
+m4trace:configure.in:17: -1- AC_SUBST_TRACE([YACC])
+m4trace:configure.in:17: -1- m4_pattern_allow([^YACC$])
+m4trace:configure.in:17: -1- AC_SUBST([YACC])
+m4trace:configure.in:17: -1- AC_SUBST_TRACE([YACC])
+m4trace:configure.in:17: -1- m4_pattern_allow([^YACC$])
+m4trace:configure.in:17: -1- AC_SUBST([YFLAGS])
+m4trace:configure.in:17: -1- AC_SUBST_TRACE([YFLAGS])
+m4trace:configure.in:17: -1- m4_pattern_allow([^YFLAGS$])
+m4trace:configure.in:18: -1- AC_SUBST([LEX])
+m4trace:configure.in:18: -1- AC_SUBST_TRACE([LEX])
+m4trace:configure.in:18: -1- m4_pattern_allow([^LEX$])
+m4trace:configure.in:18: -1- AC_SUBST([LEX_OUTPUT_ROOT], [$ac_cv_prog_lex_root])
+m4trace:configure.in:18: -1- AC_SUBST_TRACE([LEX_OUTPUT_ROOT])
+m4trace:configure.in:18: -1- m4_pattern_allow([^LEX_OUTPUT_ROOT$])
+m4trace:configure.in:18: -1- AC_SUBST([LEXLIB])
+m4trace:configure.in:18: -1- AC_SUBST_TRACE([LEXLIB])
+m4trace:configure.in:18: -1- m4_pattern_allow([^LEXLIB$])
+m4trace:configure.in:18: -1- AC_DEFINE_TRACE_LITERAL([YYTEXT_POINTER])
+m4trace:configure.in:18: -1- m4_pattern_allow([^YYTEXT_POINTER$])
+m4trace:configure.in:18: -1- AH_OUTPUT([YYTEXT_POINTER], [/* Define to 1 if `lex\' declares `yytext\' as a `char *\' by default, not a
+   `char[]\'. */
+#undef YYTEXT_POINTER])
+m4trace:configure.in:21: -1- AC_SUBST([SHARED_FLAGS], ["-shared -no-undefined -Xlinker --export-all-symbols"])
+m4trace:configure.in:21: -1- AC_SUBST_TRACE([SHARED_FLAGS])
+m4trace:configure.in:21: -1- m4_pattern_allow([^SHARED_FLAGS$])
+m4trace:configure.in:21: -1- AC_SUBST([PLUGIN_FLAGS], ["-shared -no-undefined -avoid-version"])
+m4trace:configure.in:21: -1- AC_SUBST_TRACE([PLUGIN_FLAGS])
+m4trace:configure.in:21: -1- m4_pattern_allow([^PLUGIN_FLAGS$])
+m4trace:configure.in:21: -1- AC_SUBST([GL_LIBS], ["-lopengl32 -lglu32"])
+m4trace:configure.in:21: -1- AC_SUBST_TRACE([GL_LIBS])
+m4trace:configure.in:21: -1- m4_pattern_allow([^GL_LIBS$])
+m4trace:configure.in:21: -1- AC_SUBST([RC])
+m4trace:configure.in:21: -1- AC_SUBST_TRACE([RC])
+m4trace:configure.in:21: -1- m4_pattern_allow([^RC$])
+m4trace:configure.in:21: -1- AC_SUBST([SHARED_FLAGS], ["-shared"])
+m4trace:configure.in:21: -1- AC_SUBST_TRACE([SHARED_FLAGS])
+m4trace:configure.in:21: -1- m4_pattern_allow([^SHARED_FLAGS$])
+m4trace:configure.in:21: -1- AC_SUBST([PLUGIN_FLAGS], ["-shared -avoid-version"])
+m4trace:configure.in:21: -1- AC_SUBST_TRACE([PLUGIN_FLAGS])
+m4trace:configure.in:21: -1- m4_pattern_allow([^PLUGIN_FLAGS$])
+m4trace:configure.in:21: -1- AC_SUBST([GL_LIBS], ["-lGL -lGLU"])
+m4trace:configure.in:21: -1- AC_SUBST_TRACE([GL_LIBS])
+m4trace:configure.in:21: -1- m4_pattern_allow([^GL_LIBS$])
+m4trace:configure.in:21: -1- AC_SUBST([SHARED_FLAGS], ["-shared"])
+m4trace:configure.in:21: -1- AC_SUBST_TRACE([SHARED_FLAGS])
+m4trace:configure.in:21: -1- m4_pattern_allow([^SHARED_FLAGS$])
+m4trace:configure.in:21: -1- AC_SUBST([PLUGIN_FLAGS], ["-shared -avoid-version"])
+m4trace:configure.in:21: -1- AC_SUBST_TRACE([PLUGIN_FLAGS])
+m4trace:configure.in:21: -1- m4_pattern_allow([^PLUGIN_FLAGS$])
+m4trace:configure.in:21: -1- AC_SUBST([GL_LIBS], ["-lGL -lGLU"])
+m4trace:configure.in:21: -1- AC_SUBST_TRACE([GL_LIBS])
+m4trace:configure.in:21: -1- m4_pattern_allow([^GL_LIBS$])
+m4trace:configure.in:21: -1- AM_CONDITIONAL([OGRE_NT], [test x$nt = xtrue])
+m4trace:configure.in:21: -1- AC_SUBST([OGRE_NT_TRUE])
+m4trace:configure.in:21: -1- AC_SUBST_TRACE([OGRE_NT_TRUE])
+m4trace:configure.in:21: -1- m4_pattern_allow([^OGRE_NT_TRUE$])
+m4trace:configure.in:21: -1- AC_SUBST([OGRE_NT_FALSE])
+m4trace:configure.in:21: -1- AC_SUBST_TRACE([OGRE_NT_FALSE])
+m4trace:configure.in:21: -1- m4_pattern_allow([^OGRE_NT_FALSE$])
+m4trace:configure.in:21: -1- AM_CONDITIONAL([OGRE_LINUX], [test x$linux = xtrue])
+m4trace:configure.in:21: -1- AC_SUBST([OGRE_LINUX_TRUE])
+m4trace:configure.in:21: -1- AC_SUBST_TRACE([OGRE_LINUX_TRUE])
+m4trace:configure.in:21: -1- m4_pattern_allow([^OGRE_LINUX_TRUE$])
+m4trace:configure.in:21: -1- AC_SUBST([OGRE_LINUX_FALSE])
+m4trace:configure.in:21: -1- AC_SUBST_TRACE([OGRE_LINUX_FALSE])
+m4trace:configure.in:21: -1- m4_pattern_allow([^OGRE_LINUX_FALSE$])
+m4trace:configure.in:21: -1- AM_CONDITIONAL([OGRE_OSX], [test x$osx = xtrue ])
+m4trace:configure.in:21: -1- AC_SUBST([OGRE_OSX_TRUE])
+m4trace:configure.in:21: -1- AC_SUBST_TRACE([OGRE_OSX_TRUE])
+m4trace:configure.in:21: -1- m4_pattern_allow([^OGRE_OSX_TRUE$])
+m4trace:configure.in:21: -1- AC_SUBST([OGRE_OSX_FALSE])
+m4trace:configure.in:21: -1- AC_SUBST_TRACE([OGRE_OSX_FALSE])
+m4trace:configure.in:21: -1- m4_pattern_allow([^OGRE_OSX_FALSE$])
+m4trace:configure.in:23: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1373: AC_ARG_ENABLE is expanded from...
+aclocal.m4:1896: AC_ENABLE_STATIC is expanded from...
+aclocal.m4:1905: AC_DISABLE_STATIC is expanded from...
+configure.in:23: the top level])
+m4trace:configure.in:24: -1- AC_PROG_LIBTOOL
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1373: AC_ARG_ENABLE is expanded from...
+aclocal.m4:1857: AC_ENABLE_SHARED is expanded from...
+aclocal.m4:225: AC_LIBTOOL_SETUP is expanded from...
+aclocal.m4:81: _AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:61: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1373: AC_ARG_ENABLE is expanded from...
+aclocal.m4:1935: AC_ENABLE_FAST_INSTALL is expanded from...
+aclocal.m4:225: AC_LIBTOOL_SETUP is expanded from...
+aclocal.m4:81: _AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:61: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1391: AC_ARG_WITH is expanded from...
+aclocal.m4:2132: AC_PROG_LD is expanded from...
+aclocal.m4:225: AC_LIBTOOL_SETUP is expanded from...
+aclocal.m4:81: _AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:61: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- AC_SUBST([GREP])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([GREP])
+m4trace:configure.in:24: -1- m4_pattern_allow([^GREP$])
+m4trace:configure.in:24: -1- AC_SUBST([GREP])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([GREP])
+m4trace:configure.in:24: -1- m4_pattern_allow([^GREP$])
+m4trace:configure.in:24: -1- AC_SUBST([EGREP])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([EGREP])
+m4trace:configure.in:24: -1- m4_pattern_allow([^EGREP$])
+m4trace:configure.in:24: -1- AC_SUBST([EGREP])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([EGREP])
+m4trace:configure.in:24: -1- m4_pattern_allow([^EGREP$])
+m4trace:configure.in:24: -1- AC_SUBST([LN_S], [$as_ln_s])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([LN_S])
+m4trace:configure.in:24: -1- m4_pattern_allow([^LN_S$])
+m4trace:configure.in:24: -1- AC_SUBST([ECHO])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([ECHO])
+m4trace:configure.in:24: -1- m4_pattern_allow([^ECHO$])
+m4trace:configure.in:24: -1- AC_SUBST([AR])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([AR])
+m4trace:configure.in:24: -1- m4_pattern_allow([^AR$])
+m4trace:configure.in:24: -1- AC_SUBST([RANLIB])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([RANLIB])
+m4trace:configure.in:24: -1- m4_pattern_allow([^RANLIB$])
+m4trace:configure.in:24: -1- AC_SUBST([STRIP])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([STRIP])
+m4trace:configure.in:24: -1- m4_pattern_allow([^STRIP$])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1373: AC_ARG_ENABLE is expanded from...
+aclocal.m4:225: AC_LIBTOOL_SETUP is expanded from...
+aclocal.m4:81: _AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:61: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1391: AC_ARG_WITH is expanded from...
+aclocal.m4:225: AC_LIBTOOL_SETUP is expanded from...
+aclocal.m4:81: _AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:61: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:2415: AC_TRY_LINK is expanded from...
+../../lib/m4sugar/m4sh.m4:523: AS_IF is expanded from...
+autoconf/general.m4:1905: AC_CACHE_VAL is expanded from...
+autoconf/general.m4:1918: AC_CACHE_CHECK is expanded from...
+aclocal.m4:594: _LT_AC_LOCK is expanded from...
+aclocal.m4:1061: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
+aclocal.m4:2664: _LT_AC_LANG_C_CONFIG is expanded from...
+aclocal.m4:2564: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
+aclocal.m4:225: AC_LIBTOOL_SETUP is expanded from...
+aclocal.m4:81: _AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:61: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H])
+m4trace:configure.in:24: -1- AC_SUBST([CPP])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([CPP])
+m4trace:configure.in:24: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.in:24: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([CPPFLAGS])
+m4trace:configure.in:24: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.in:24: -1- AC_SUBST([CPP])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([CPP])
+m4trace:configure.in:24: -1- m4_pattern_allow([^CPP$])
+m4trace:configure.in:24: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
+m4trace:configure.in:24: -1- m4_pattern_allow([^STDC_HEADERS$])
+m4trace:configure.in:24: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS])
+m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H])
+m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H])
+m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H])
+m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H])
+m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H])
+m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H])
+m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H])
+m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H])
+m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H])
+m4trace:configure.in:24: -1- _LT_AC_TAGCONFIG
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+autoconf/general.m4:1391: AC_ARG_WITH is expanded from...
+aclocal.m4:1811: _LT_AC_TAGCONFIG is expanded from...
+aclocal.m4:225: AC_LIBTOOL_SETUP is expanded from...
+aclocal.m4:81: _AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:61: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me:$LINENO: error: tag name \"$tagname\" already exists], [aclocal.m4:1811: _LT_AC_TAGCONFIG is expanded from...
+aclocal.m4:225: AC_LIBTOOL_SETUP is expanded from...
+aclocal.m4:81: _AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:61: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me: error: tag name \"$tagname\" already exists], [aclocal.m4:1811: _LT_AC_TAGCONFIG is expanded from...
+aclocal.m4:225: AC_LIBTOOL_SETUP is expanded from...
+aclocal.m4:81: _AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:61: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- AC_SUBST([CXXCPP])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([CXXCPP])
+m4trace:configure.in:24: -1- m4_pattern_allow([^CXXCPP$])
+m4trace:configure.in:24: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([CPPFLAGS])
+m4trace:configure.in:24: -1- m4_pattern_allow([^CPPFLAGS$])
+m4trace:configure.in:24: -1- AC_SUBST([CXXCPP])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([CXXCPP])
+m4trace:configure.in:24: -1- m4_pattern_allow([^CXXCPP$])
+m4trace:configure.in:24: -1- AC_SUBST([F77])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([F77])
+m4trace:configure.in:24: -1- m4_pattern_allow([^F77$])
+m4trace:configure.in:24: -1- AC_SUBST([FFLAGS])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([FFLAGS])
+m4trace:configure.in:24: -1- m4_pattern_allow([^FFLAGS$])
+m4trace:configure.in:24: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([LDFLAGS])
+m4trace:configure.in:24: -1- m4_pattern_allow([^LDFLAGS$])
+m4trace:configure.in:24: -1- AC_SUBST([LIBS])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([LIBS])
+m4trace:configure.in:24: -1- m4_pattern_allow([^LIBS$])
+m4trace:configure.in:24: -1- AC_SUBST([F77])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([F77])
+m4trace:configure.in:24: -1- m4_pattern_allow([^F77$])
+m4trace:configure.in:24: -1- AC_SUBST([ac_ct_F77])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([ac_ct_F77])
+m4trace:configure.in:24: -1- m4_pattern_allow([^ac_ct_F77$])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete.
+You should run autoupdate.], [autoconf/lang.m4:170: AC_LANG_SAVE is expanded from...
+aclocal.m4:3925: _LT_AC_LANG_GCJ_CONFIG is expanded from...
+aclocal.m4:3875: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
+aclocal.m4:1811: _LT_AC_TAGCONFIG is expanded from...
+aclocal.m4:225: AC_LIBTOOL_SETUP is expanded from...
+aclocal.m4:81: _AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:61: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete.
+You should run autoupdate.], [autoconf/lang.m4:176: AC_LANG_RESTORE is expanded from...
+aclocal.m4:3925: _LT_AC_LANG_GCJ_CONFIG is expanded from...
+aclocal.m4:3875: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
+aclocal.m4:1811: _LT_AC_TAGCONFIG is expanded from...
+aclocal.m4:225: AC_LIBTOOL_SETUP is expanded from...
+aclocal.m4:81: _AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:61: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete.
+You should run autoupdate.], [autoconf/lang.m4:170: AC_LANG_SAVE is expanded from...
+aclocal.m4:3969: _LT_AC_LANG_RC_CONFIG is expanded from...
+aclocal.m4:3933: AC_LIBTOOL_LANG_RC_CONFIG is expanded from...
+aclocal.m4:1811: _LT_AC_TAGCONFIG is expanded from...
+aclocal.m4:225: AC_LIBTOOL_SETUP is expanded from...
+aclocal.m4:81: _AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:61: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete.
+You should run autoupdate.], [autoconf/lang.m4:176: AC_LANG_RESTORE is expanded from...
+aclocal.m4:3969: _LT_AC_LANG_RC_CONFIG is expanded from...
+aclocal.m4:3933: AC_LIBTOOL_LANG_RC_CONFIG is expanded from...
+aclocal.m4:1811: _LT_AC_TAGCONFIG is expanded from...
+aclocal.m4:225: AC_LIBTOOL_SETUP is expanded from...
+aclocal.m4:81: _AC_PROG_LIBTOOL is expanded from...
+aclocal.m4:61: AC_PROG_LIBTOOL is expanded from...
+configure.in:24: the top level])
+m4trace:configure.in:24: -1- AC_SUBST([LIBTOOL])
+m4trace:configure.in:24: -1- AC_SUBST_TRACE([LIBTOOL])
+m4trace:configure.in:24: -1- m4_pattern_allow([^LIBTOOL$])
+m4trace:configure.in:30: -1- AC_SUBST([OGRE_CFLAGS])
+m4trace:configure.in:30: -1- AC_SUBST_TRACE([OGRE_CFLAGS])
+m4trace:configure.in:30: -1- m4_pattern_allow([^OGRE_CFLAGS$])
+m4trace:configure.in:61: -1- AC_SUBST([CFLAGS_VISIBILITY])
+m4trace:configure.in:61: -1- AC_SUBST_TRACE([CFLAGS_VISIBILITY])
+m4trace:configure.in:61: -1- m4_pattern_allow([^CFLAGS_VISIBILITY$])
+m4trace:configure.in:65: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:159: OGRE_USE_STLPORT is expanded from...
+configure.in:65: the top level])
+m4trace:configure.in:65: -1- AC_SUBST([STLPORT_CFLAGS])
+m4trace:configure.in:65: -1- AC_SUBST_TRACE([STLPORT_CFLAGS])
+m4trace:configure.in:65: -1- m4_pattern_allow([^STLPORT_CFLAGS$])
+m4trace:configure.in:65: -1- AC_SUBST([STLPORT_LIBS])
+m4trace:configure.in:65: -1- AC_SUBST_TRACE([STLPORT_LIBS])
+m4trace:configure.in:65: -1- m4_pattern_allow([^STLPORT_LIBS$])
+m4trace:configure.in:66: -1- AC_SUBST([FT2_CONFIG])
+m4trace:configure.in:66: -1- AC_SUBST_TRACE([FT2_CONFIG])
+m4trace:configure.in:66: -1- m4_pattern_allow([^FT2_CONFIG$])
+m4trace:configure.in:66: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:2479: AC_TRY_RUN is expanded from...
+acinclude.m4:143: AC_CHECK_FT2 is expanded from...
+configure.in:66: the top level])
+m4trace:configure.in:66: -1- AC_SUBST([FT2_CFLAGS])
+m4trace:configure.in:66: -1- AC_SUBST_TRACE([FT2_CFLAGS])
+m4trace:configure.in:66: -1- m4_pattern_allow([^FT2_CFLAGS$])
+m4trace:configure.in:66: -1- AC_SUBST([FT2_LIBS])
+m4trace:configure.in:66: -1- AC_SUBST_TRACE([FT2_LIBS])
+m4trace:configure.in:66: -1- m4_pattern_allow([^FT2_LIBS$])
+m4trace:configure.in:68: -1- AH_OUTPUT([HAVE_LIBDL], [/* Define to 1 if you have the `dl\' library (-ldl). */
+#undef HAVE_LIBDL])
+m4trace:configure.in:68: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBDL])
+m4trace:configure.in:68: -1- m4_pattern_allow([^HAVE_LIBDL$])
+m4trace:configure.in:69: -1- AH_OUTPUT([HAVE_LIBM], [/* Define to 1 if you have the `m\' library (-lm). */
+#undef HAVE_LIBM])
+m4trace:configure.in:69: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBM])
+m4trace:configure.in:69: -1- m4_pattern_allow([^HAVE_LIBM$])
+m4trace:configure.in:70: -1- AH_OUTPUT([HAVE_LIBZ], [/* Define to 1 if you have the `z\' library (-lz). */
+#undef HAVE_LIBZ])
+m4trace:configure.in:70: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBZ])
+m4trace:configure.in:70: -1- m4_pattern_allow([^HAVE_LIBZ$])
+m4trace:configure.in:71: -1- AH_OUTPUT([HAVE_LIBPTHREAD], [/* Define to 1 if you have the `pthread\' library (-lpthread). */
+#undef HAVE_LIBPTHREAD])
+m4trace:configure.in:71: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBPTHREAD])
+m4trace:configure.in:71: -1- m4_pattern_allow([^HAVE_LIBPTHREAD$])
+m4trace:configure.in:72: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SNPRINTF])
+m4trace:configure.in:72: -2- m4_pattern_allow([^HAVE_SNPRINTF$])
+m4trace:configure.in:72: -2- AH_OUTPUT([HAVE_SNPRINTF], [/* snprintf */
+#undef HAVE_SNPRINTF])
+m4trace:configure.in:73: -2- AC_DEFINE_TRACE_LITERAL([HAVE_VSNPRINTF])
+m4trace:configure.in:73: -2- m4_pattern_allow([^HAVE_VSNPRINTF$])
+m4trace:configure.in:73: -2- AH_OUTPUT([HAVE_VSNPRINTF], [/* vsnprintf */
+#undef HAVE_VSNPRINTF])
+m4trace:configure.in:75: -1- AC_SUBST([CPPUNIT_CONFIG])
+m4trace:configure.in:75: -1- AC_SUBST_TRACE([CPPUNIT_CONFIG])
+m4trace:configure.in:75: -1- m4_pattern_allow([^CPPUNIT_CONFIG$])
+m4trace:configure.in:75: -1- AC_SUBST([CPPUNIT_CFLAGS])
+m4trace:configure.in:75: -1- AC_SUBST_TRACE([CPPUNIT_CFLAGS])
+m4trace:configure.in:75: -1- m4_pattern_allow([^CPPUNIT_CFLAGS$])
+m4trace:configure.in:75: -1- AC_SUBST([CPPUNIT_LIBS])
+m4trace:configure.in:75: -1- AC_SUBST_TRACE([CPPUNIT_LIBS])
+m4trace:configure.in:75: -1- m4_pattern_allow([^CPPUNIT_LIBS$])
+m4trace:configure.in:75: -1- AM_CONDITIONAL([BUILD_UNIT_TESTS], [test x$build_unit_tests = xtrue])
+m4trace:configure.in:75: -1- AC_SUBST([BUILD_UNIT_TESTS_TRUE])
+m4trace:configure.in:75: -1- AC_SUBST_TRACE([BUILD_UNIT_TESTS_TRUE])
+m4trace:configure.in:75: -1- m4_pattern_allow([^BUILD_UNIT_TESTS_TRUE$])
+m4trace:configure.in:75: -1- AC_SUBST([BUILD_UNIT_TESTS_FALSE])
+m4trace:configure.in:75: -1- AC_SUBST_TRACE([BUILD_UNIT_TESTS_FALSE])
+m4trace:configure.in:75: -1- m4_pattern_allow([^BUILD_UNIT_TESTS_FALSE$])
+m4trace:configure.in:77: -1- m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4trace:configure.in:77: -1- m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+m4trace:configure.in:77: -1- AC_SUBST([PKG_CONFIG])
+m4trace:configure.in:77: -1- AC_SUBST_TRACE([PKG_CONFIG])
+m4trace:configure.in:77: -1- m4_pattern_allow([^PKG_CONFIG$])
+m4trace:configure.in:77: -1- AC_SUBST([PKG_CONFIG])
+m4trace:configure.in:77: -1- AC_SUBST_TRACE([PKG_CONFIG])
+m4trace:configure.in:77: -1- m4_pattern_allow([^PKG_CONFIG$])
+m4trace:configure.in:77: -1- AC_SUBST([ZZIPLIB_CFLAGS])
+m4trace:configure.in:77: -1- AC_SUBST_TRACE([ZZIPLIB_CFLAGS])
+m4trace:configure.in:77: -1- m4_pattern_allow([^ZZIPLIB_CFLAGS$])
+m4trace:configure.in:77: -1- AC_SUBST([ZZIPLIB_LIBS])
+m4trace:configure.in:77: -1- AC_SUBST_TRACE([ZZIPLIB_LIBS])
+m4trace:configure.in:77: -1- m4_pattern_allow([^ZZIPLIB_LIBS$])
+m4trace:configure.in:78: -1- AC_SUBST([ZZIPLIB_CFLAGS])
+m4trace:configure.in:78: -1- AC_SUBST_TRACE([ZZIPLIB_CFLAGS])
+m4trace:configure.in:78: -1- m4_pattern_allow([^ZZIPLIB_CFLAGS$])
+m4trace:configure.in:79: -1- AC_SUBST([ZZIPLIB_LIBS])
+m4trace:configure.in:79: -1- AC_SUBST_TRACE([ZZIPLIB_LIBS])
+m4trace:configure.in:79: -1- m4_pattern_allow([^ZZIPLIB_LIBS$])
+m4trace:configure.in:82: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:203: OGRE_GET_PLATFORM is expanded from...
+configure.in:82: the top level])
+m4trace:configure.in:82: -1- AH_OUTPUT([HAVE_X11_INTRINSIC_H], [/* Define to 1 if you have the <X11/Intrinsic.h> header file. */
+#undef HAVE_X11_INTRINSIC_H])
+m4trace:configure.in:82: -1- AH_OUTPUT([HAVE_X11_XAW_COMMAND_H], [/* Define to 1 if you have the <X11/Xaw/Command.h> header file. */
+#undef HAVE_X11_XAW_COMMAND_H])
+m4trace:configure.in:82: -1- AH_OUTPUT([HAVE_X11_EXTENSIONS_XF86VMODE_H], [/* Define to 1 if you have the <X11/extensions/xf86vmode.h> header file. */
+#undef HAVE_X11_EXTENSIONS_XF86VMODE_H])
+m4trace:configure.in:82: -1- AH_OUTPUT([HAVE_X11_EXTENSIONS_XRANDR_H], [/* Define to 1 if you have the <X11/extensions/Xrandr.h> header file. */
+#undef HAVE_X11_EXTENSIONS_XRANDR_H])
+m4trace:configure.in:82: -1- AC_SUBST([XMKMF])
+m4trace:configure.in:82: -1- AC_SUBST_TRACE([XMKMF])
+m4trace:configure.in:82: -1- m4_pattern_allow([^XMKMF$])
+m4trace:configure.in:82: -1- AC_SUBST([PLATFORM_CFLAGS])
+m4trace:configure.in:82: -1- AC_SUBST_TRACE([PLATFORM_CFLAGS])
+m4trace:configure.in:82: -1- m4_pattern_allow([^PLATFORM_CFLAGS$])
+m4trace:configure.in:82: -1- AC_SUBST([PLATFORM_LIBS])
+m4trace:configure.in:82: -1- AC_SUBST_TRACE([PLATFORM_LIBS])
+m4trace:configure.in:82: -1- m4_pattern_allow([^PLATFORM_LIBS$])
+m4trace:configure.in:82: -1- AC_SUBST([OGRE_PLATFORM])
+m4trace:configure.in:82: -1- AC_SUBST_TRACE([OGRE_PLATFORM])
+m4trace:configure.in:82: -1- m4_pattern_allow([^OGRE_PLATFORM$])
+m4trace:configure.in:83: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:254: OGRE_GET_GLSUPPORT is expanded from...
+configure.in:83: the top level])
+m4trace:configure.in:83: -1- AC_SUBST([XMKMF])
+m4trace:configure.in:83: -1- AC_SUBST_TRACE([XMKMF])
+m4trace:configure.in:83: -1- m4_pattern_allow([^XMKMF$])
+m4trace:configure.in:83: -1- AC_SUBST([GLSUPPORT_CFLAGS])
+m4trace:configure.in:83: -1- AC_SUBST_TRACE([GLSUPPORT_CFLAGS])
+m4trace:configure.in:83: -1- m4_pattern_allow([^GLSUPPORT_CFLAGS$])
+m4trace:configure.in:83: -1- AC_SUBST([GLSUPPORT_LIBS])
+m4trace:configure.in:83: -1- AC_SUBST_TRACE([GLSUPPORT_LIBS])
+m4trace:configure.in:83: -1- m4_pattern_allow([^GLSUPPORT_LIBS$])
+m4trace:configure.in:83: -1- AC_SUBST([OGRE_GLSUPPORT])
+m4trace:configure.in:83: -1- AC_SUBST_TRACE([OGRE_GLSUPPORT])
+m4trace:configure.in:83: -1- m4_pattern_allow([^OGRE_GLSUPPORT$])
+m4trace:configure.in:83: -1- AC_CONFIG_FILES([RenderSystems/GL/src/GLX/Makefile
+                   RenderSystems/GL/src/win32/Makefile])
+m4trace:configure.in:86: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:589: OGRE_CHECK_GUI is expanded from...
+configure.in:86: the top level])
+m4trace:configure.in:86: -1- AC_SUBST([GTK_CFLAGS])
+m4trace:configure.in:86: -1- AC_SUBST_TRACE([GTK_CFLAGS])
+m4trace:configure.in:86: -1- m4_pattern_allow([^GTK_CFLAGS$])
+m4trace:configure.in:86: -1- AC_SUBST([GTK_LIBS])
+m4trace:configure.in:86: -1- AC_SUBST_TRACE([GTK_LIBS])
+m4trace:configure.in:86: -1- m4_pattern_allow([^GTK_LIBS$])
+m4trace:configure.in:86: -1- AC_SUBST([OGRE_GUI])
+m4trace:configure.in:86: -1- AC_SUBST_TRACE([OGRE_GUI])
+m4trace:configure.in:86: -1- m4_pattern_allow([^OGRE_GUI$])
+m4trace:configure.in:86: -1- AC_SUBST([GTK_CFLAGS])
+m4trace:configure.in:86: -1- AC_SUBST_TRACE([GTK_CFLAGS])
+m4trace:configure.in:86: -1- m4_pattern_allow([^GTK_CFLAGS$])
+m4trace:configure.in:86: -1- AC_SUBST([GTK_LIBS])
+m4trace:configure.in:86: -1- AC_SUBST_TRACE([GTK_LIBS])
+m4trace:configure.in:86: -1- m4_pattern_allow([^GTK_LIBS$])
+m4trace:configure.in:87: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:484: OGRE_CHECK_DOUBLE is expanded from...
+configure.in:87: the top level])
+m4trace:configure.in:87: -1- AC_DEFINE_TRACE_LITERAL([OGRE_DOUBLE_PRECISION])
+m4trace:configure.in:87: -1- m4_pattern_allow([^OGRE_DOUBLE_PRECISION$])
+m4trace:configure.in:87: -1- AH_OUTPUT([OGRE_DOUBLE_PRECISION], [/* Build with double precision */
+#undef OGRE_DOUBLE_PRECISION])
+m4trace:configure.in:87: -1- AC_DEFINE_TRACE_LITERAL([OGRE_DOUBLE_PRECISION])
+m4trace:configure.in:87: -1- m4_pattern_allow([^OGRE_DOUBLE_PRECISION$])
+m4trace:configure.in:87: -1- AH_OUTPUT([OGRE_DOUBLE_PRECISION], [/* Build with single precision */
+#undef OGRE_DOUBLE_PRECISION])
+m4trace:configure.in:88: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:509: OGRE_CHECK_THREADING is expanded from...
+configure.in:88: the top level])
+m4trace:configure.in:88: -1- AC_DEFINE_TRACE_LITERAL([OGRE_THREAD_SUPPORT])
+m4trace:configure.in:88: -1- m4_pattern_allow([^OGRE_THREAD_SUPPORT$])
+m4trace:configure.in:88: -1- AH_OUTPUT([OGRE_THREAD_SUPPORT], [/* Build with thread support */
+#undef OGRE_THREAD_SUPPORT])
+m4trace:configure.in:88: -1- AC_DEFINE_TRACE_LITERAL([OGRE_THREAD_SUPPORT])
+m4trace:configure.in:88: -1- m4_pattern_allow([^OGRE_THREAD_SUPPORT$])
+m4trace:configure.in:88: -1- AH_OUTPUT([OGRE_THREAD_SUPPORT], [/* Build with thread support */
+#undef OGRE_THREAD_SUPPORT])
+m4trace:configure.in:88: -1- AC_SUBST([OGRE_THREAD_LIBS])
+m4trace:configure.in:88: -1- AC_SUBST_TRACE([OGRE_THREAD_LIBS])
+m4trace:configure.in:88: -1- m4_pattern_allow([^OGRE_THREAD_LIBS$])
+m4trace:configure.in:89: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:395: OGRE_CHECK_FREEIMAGE is expanded from...
+configure.in:89: the top level])
+m4trace:configure.in:89: -1- AM_CONDITIONAL([USE_FREEIMAGE], [test x$build_freeimage = xyes])
+m4trace:configure.in:89: -1- AC_SUBST([USE_FREEIMAGE_TRUE])
+m4trace:configure.in:89: -1- AC_SUBST_TRACE([USE_FREEIMAGE_TRUE])
+m4trace:configure.in:89: -1- m4_pattern_allow([^USE_FREEIMAGE_TRUE$])
+m4trace:configure.in:89: -1- AC_SUBST([USE_FREEIMAGE_FALSE])
+m4trace:configure.in:89: -1- AC_SUBST_TRACE([USE_FREEIMAGE_FALSE])
+m4trace:configure.in:89: -1- m4_pattern_allow([^USE_FREEIMAGE_FALSE$])
+m4trace:configure.in:89: -1- AH_OUTPUT([HAVE_LIBFREEIMAGE], [/* Define to 1 if you have the `freeimage\' library (-lfreeimage). */
+#undef HAVE_LIBFREEIMAGE])
+m4trace:configure.in:89: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBFREEIMAGE])
+m4trace:configure.in:89: -1- m4_pattern_allow([^HAVE_LIBFREEIMAGE$])
+m4trace:configure.in:89: -1- AC_DEFINE_TRACE_LITERAL([OGRE_NO_FREEIMAGE])
+m4trace:configure.in:89: -1- m4_pattern_allow([^OGRE_NO_FREEIMAGE$])
+m4trace:configure.in:89: -1- AH_OUTPUT([OGRE_NO_FREEIMAGE], [/* Do not use freeimage to load images */
+#undef OGRE_NO_FREEIMAGE])
+m4trace:configure.in:89: -1- AC_DEFINE_TRACE_LITERAL([OGRE_NO_FREEIMAGE])
+m4trace:configure.in:89: -1- m4_pattern_allow([^OGRE_NO_FREEIMAGE$])
+m4trace:configure.in:89: -1- AH_OUTPUT([OGRE_NO_FREEIMAGE], [/* Load images using the freeimage library */
+#undef OGRE_NO_FREEIMAGE])
+m4trace:configure.in:90: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:428: OGRE_CHECK_DEVIL is expanded from...
+configure.in:90: the top level])
+m4trace:configure.in:90: -1- AM_CONDITIONAL([USE_DEVIL], [test x$build_il = xyes && test x$build_freeimage = xno])
+m4trace:configure.in:90: -1- AC_SUBST([USE_DEVIL_TRUE])
+m4trace:configure.in:90: -1- AC_SUBST_TRACE([USE_DEVIL_TRUE])
+m4trace:configure.in:90: -1- m4_pattern_allow([^USE_DEVIL_TRUE$])
+m4trace:configure.in:90: -1- AC_SUBST([USE_DEVIL_FALSE])
+m4trace:configure.in:90: -1- AC_SUBST_TRACE([USE_DEVIL_FALSE])
+m4trace:configure.in:90: -1- m4_pattern_allow([^USE_DEVIL_FALSE$])
+m4trace:configure.in:90: -1- AC_DEFINE_TRACE_LITERAL([OGRE_NO_DEVIL])
+m4trace:configure.in:90: -1- m4_pattern_allow([^OGRE_NO_DEVIL$])
+m4trace:configure.in:90: -1- AH_OUTPUT([OGRE_NO_DEVIL], [/* Build devil */
+#undef OGRE_NO_DEVIL])
+m4trace:configure.in:90: -1- AH_OUTPUT([HAVE_LIBIL], [/* Define to 1 if you have the `IL\' library (-lIL). */
+#undef HAVE_LIBIL])
+m4trace:configure.in:90: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBIL])
+m4trace:configure.in:90: -1- m4_pattern_allow([^HAVE_LIBIL$])
+m4trace:configure.in:90: -1- AH_OUTPUT([HAVE_LIBILU], [/* Define to 1 if you have the `ILU\' library (-lILU). */
+#undef HAVE_LIBILU])
+m4trace:configure.in:90: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBILU])
+m4trace:configure.in:90: -1- m4_pattern_allow([^HAVE_LIBILU$])
+m4trace:configure.in:90: -1- AC_DEFINE_TRACE_LITERAL([OGRE_NO_DEVIL])
+m4trace:configure.in:90: -1- m4_pattern_allow([^OGRE_NO_DEVIL$])
+m4trace:configure.in:90: -1- AH_OUTPUT([OGRE_NO_DEVIL], [/* Build devil */
+#undef OGRE_NO_DEVIL])
+m4trace:configure.in:90: -1- AC_DEFINE_TRACE_LITERAL([OGRE_NO_DEVIL])
+m4trace:configure.in:90: -1- m4_pattern_allow([^OGRE_NO_DEVIL$])
+m4trace:configure.in:90: -1- AH_OUTPUT([OGRE_NO_DEVIL], [/* Build devil */
+#undef OGRE_NO_DEVIL])
+m4trace:configure.in:91: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:348: OGRE_CHECK_CG is expanded from...
+configure.in:91: the top level])
+m4trace:configure.in:91: -1- AH_OUTPUT([HAVE_LIBCG], [/* Define to 1 if you have the `Cg\' library (-lCg). */
+#undef HAVE_LIBCG])
+m4trace:configure.in:91: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBCG])
+m4trace:configure.in:91: -1- m4_pattern_allow([^HAVE_LIBCG$])
+m4trace:configure.in:91: -1- AM_CONDITIONAL([BUILD_CGPLUGIN], [test x$build_cg = xyes])
+m4trace:configure.in:91: -1- AC_SUBST([BUILD_CGPLUGIN_TRUE])
+m4trace:configure.in:91: -1- AC_SUBST_TRACE([BUILD_CGPLUGIN_TRUE])
+m4trace:configure.in:91: -1- m4_pattern_allow([^BUILD_CGPLUGIN_TRUE$])
+m4trace:configure.in:91: -1- AC_SUBST([BUILD_CGPLUGIN_FALSE])
+m4trace:configure.in:91: -1- AC_SUBST_TRACE([BUILD_CGPLUGIN_FALSE])
+m4trace:configure.in:91: -1- m4_pattern_allow([^BUILD_CGPLUGIN_FALSE$])
+m4trace:configure.in:92: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:324: OGRE_CHECK_OPENEXR is expanded from...
+configure.in:92: the top level])
+m4trace:configure.in:92: -1- AC_SUBST([OPENEXR_CFLAGS])
+m4trace:configure.in:92: -1- AC_SUBST_TRACE([OPENEXR_CFLAGS])
+m4trace:configure.in:92: -1- m4_pattern_allow([^OPENEXR_CFLAGS$])
+m4trace:configure.in:92: -1- AC_SUBST([OPENEXR_LIBS])
+m4trace:configure.in:92: -1- AC_SUBST_TRACE([OPENEXR_LIBS])
+m4trace:configure.in:92: -1- m4_pattern_allow([^OPENEXR_LIBS$])
+m4trace:configure.in:92: -1- AC_CONFIG_FILES([ PlugIns/EXRCodec/Makefile \
+    					 PlugIns/EXRCodec/src/Makefile \
+    					 PlugIns/EXRCodec/include/Makefile])
+m4trace:configure.in:92: -1- AC_SUBST([OPENEXR_CFLAGS])
+m4trace:configure.in:92: -1- AC_SUBST_TRACE([OPENEXR_CFLAGS])
+m4trace:configure.in:92: -1- m4_pattern_allow([^OPENEXR_CFLAGS$])
+m4trace:configure.in:92: -1- AC_SUBST([OPENEXR_LIBS])
+m4trace:configure.in:92: -1- AC_SUBST_TRACE([OPENEXR_LIBS])
+m4trace:configure.in:92: -1- m4_pattern_allow([^OPENEXR_LIBS$])
+m4trace:configure.in:92: -1- AM_CONDITIONAL([BUILD_EXRPLUGIN], [test x$build_exr = xyes])
+m4trace:configure.in:92: -1- AC_SUBST([BUILD_EXRPLUGIN_TRUE])
+m4trace:configure.in:92: -1- AC_SUBST_TRACE([BUILD_EXRPLUGIN_TRUE])
+m4trace:configure.in:92: -1- m4_pattern_allow([^BUILD_EXRPLUGIN_TRUE$])
+m4trace:configure.in:92: -1- AC_SUBST([BUILD_EXRPLUGIN_FALSE])
+m4trace:configure.in:92: -1- AC_SUBST_TRACE([BUILD_EXRPLUGIN_FALSE])
+m4trace:configure.in:92: -1- m4_pattern_allow([^BUILD_EXRPLUGIN_FALSE$])
+m4trace:configure.in:93: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:366: OGRE_CHECK_DX9 is expanded from...
+configure.in:93: the top level])
+m4trace:configure.in:93: -1- AM_CONDITIONAL([BUILD_DX9RENDERSYSTEM], [test x$build_dx9 = xyes])
+m4trace:configure.in:93: -1- AC_SUBST([BUILD_DX9RENDERSYSTEM_TRUE])
+m4trace:configure.in:93: -1- AC_SUBST_TRACE([BUILD_DX9RENDERSYSTEM_TRUE])
+m4trace:configure.in:93: -1- m4_pattern_allow([^BUILD_DX9RENDERSYSTEM_TRUE$])
+m4trace:configure.in:93: -1- AC_SUBST([BUILD_DX9RENDERSYSTEM_FALSE])
+m4trace:configure.in:93: -1- AC_SUBST_TRACE([BUILD_DX9RENDERSYSTEM_FALSE])
+m4trace:configure.in:93: -1- m4_pattern_allow([^BUILD_DX9RENDERSYSTEM_FALSE$])
+m4trace:configure.in:94: -1- AM_CONDITIONAL([OGRE_BUILD_SSE], [test x$build_sse = xyes])
+m4trace:configure.in:94: -1- AC_SUBST([OGRE_BUILD_SSE_TRUE])
+m4trace:configure.in:94: -1- AC_SUBST_TRACE([OGRE_BUILD_SSE_TRUE])
+m4trace:configure.in:94: -1- m4_pattern_allow([^OGRE_BUILD_SSE_TRUE$])
+m4trace:configure.in:94: -1- AC_SUBST([OGRE_BUILD_SSE_FALSE])
+m4trace:configure.in:94: -1- AC_SUBST_TRACE([OGRE_BUILD_SSE_FALSE])
+m4trace:configure.in:94: -1- m4_pattern_allow([^OGRE_BUILD_SSE_FALSE$])
+m4trace:configure.in:98: -1- AM_CONDITIONAL([SAME_PLATFORM_AND_GUI], [test "x$OGRE_PLATFORM" = "x$OGRE_GUI"])
+m4trace:configure.in:98: -1- AC_SUBST([SAME_PLATFORM_AND_GUI_TRUE])
+m4trace:configure.in:98: -1- AC_SUBST_TRACE([SAME_PLATFORM_AND_GUI_TRUE])
+m4trace:configure.in:98: -1- m4_pattern_allow([^SAME_PLATFORM_AND_GUI_TRUE$])
+m4trace:configure.in:98: -1- AC_SUBST([SAME_PLATFORM_AND_GUI_FALSE])
+m4trace:configure.in:98: -1- AC_SUBST_TRACE([SAME_PLATFORM_AND_GUI_FALSE])
+m4trace:configure.in:98: -1- m4_pattern_allow([^SAME_PLATFORM_AND_GUI_FALSE$])
+m4trace:configure.in:101: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+acinclude.m4:541: OGRE_BUILD_DEMOS is expanded from...
+configure.in:101: the top level])
+m4trace:configure.in:101: -1- AC_SUBST([OIS_CFLAGS])
+m4trace:configure.in:101: -1- AC_SUBST_TRACE([OIS_CFLAGS])
+m4trace:configure.in:101: -1- m4_pattern_allow([^OIS_CFLAGS$])
+m4trace:configure.in:101: -1- AC_SUBST([OIS_LIBS])
+m4trace:configure.in:101: -1- AC_SUBST_TRACE([OIS_LIBS])
+m4trace:configure.in:101: -1- m4_pattern_allow([^OIS_LIBS$])
+m4trace:configure.in:101: -1- AC_SUBST([OIS_CFLAGS])
+m4trace:configure.in:101: -1- AC_SUBST_TRACE([OIS_CFLAGS])
+m4trace:configure.in:101: -1- m4_pattern_allow([^OIS_CFLAGS$])
+m4trace:configure.in:101: -1- AC_SUBST([OIS_LIBS])
+m4trace:configure.in:101: -1- AC_SUBST_TRACE([OIS_LIBS])
+m4trace:configure.in:101: -1- m4_pattern_allow([^OIS_LIBS$])
+m4trace:configure.in:101: -1- AM_CONDITIONAL([OGRE_BUILDING_DEMOS], [test x$build_ogre_demos = xyes])
+m4trace:configure.in:101: -1- AC_SUBST([OGRE_BUILDING_DEMOS_TRUE])
+m4trace:configure.in:101: -1- AC_SUBST_TRACE([OGRE_BUILDING_DEMOS_TRUE])
+m4trace:configure.in:101: -1- m4_pattern_allow([^OGRE_BUILDING_DEMOS_TRUE$])
+m4trace:configure.in:101: -1- AC_SUBST([OGRE_BUILDING_DEMOS_FALSE])
+m4trace:configure.in:101: -1- AC_SUBST_TRACE([OGRE_BUILDING_DEMOS_FALSE])
+m4trace:configure.in:101: -1- m4_pattern_allow([^OGRE_BUILDING_DEMOS_FALSE$])
+m4trace:configure.in:104: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:2479: AC_TRY_RUN is expanded from...
+acinclude.m4:299: OGRE_DETECT_ENDIAN is expanded from...
+configure.in:104: the top level])
+m4trace:configure.in:104: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [autoconf/general.m4:2471: AC_RUN_IFELSE is expanded from...
+autoconf/general.m4:2479: AC_TRY_RUN is expanded from...
+acinclude.m4:299: OGRE_DETECT_ENDIAN is expanded from...
+configure.in:104: the top level])
+m4trace:configure.in:104: -1- AC_DEFINE_TRACE_LITERAL([OGRE_CONFIG_BIG_ENDIAN])
+m4trace:configure.in:104: -1- m4_pattern_allow([^OGRE_CONFIG_BIG_ENDIAN$])
+m4trace:configure.in:104: -1- AH_OUTPUT([OGRE_CONFIG_BIG_ENDIAN], [/* Big endian machine */
+#undef OGRE_CONFIG_BIG_ENDIAN])
+m4trace:configure.in:104: -1- AC_DEFINE_TRACE_LITERAL([OGRE_CONFIG_LITTLE_ENDIAN])
+m4trace:configure.in:104: -1- m4_pattern_allow([^OGRE_CONFIG_LITTLE_ENDIAN$])
+m4trace:configure.in:104: -1- AH_OUTPUT([OGRE_CONFIG_LITTLE_ENDIAN], [/* Little endian machine */
+#undef OGRE_CONFIG_LITTLE_ENDIAN])
+m4trace:configure.in:110: -1- AC_SUBST([CEGUI_CFLAGS])
+m4trace:configure.in:110: -1- AC_SUBST_TRACE([CEGUI_CFLAGS])
+m4trace:configure.in:110: -1- m4_pattern_allow([^CEGUI_CFLAGS$])
+m4trace:configure.in:110: -1- AC_SUBST([CEGUI_LIBS])
+m4trace:configure.in:110: -1- AC_SUBST_TRACE([CEGUI_LIBS])
+m4trace:configure.in:110: -1- m4_pattern_allow([^CEGUI_LIBS$])
+m4trace:configure.in:110: -1- AC_CONFIG_FILES([Samples/Common/CEGUIRenderer/Makefile \
+                         Samples/Common/CEGUIRenderer/CEGUI-OGRE.pc
+                         Samples/Common/CEGUIRenderer/src/Makefile \
+                         Samples/Common/CEGUIRenderer/include/Makefile \
+                         Samples/Gui/Makefile \
+                         Samples/Gui/src/Makefile])
+m4trace:configure.in:110: -1- AC_SUBST([CEGUI_CFLAGS])
+m4trace:configure.in:110: -1- AC_SUBST_TRACE([CEGUI_CFLAGS])
+m4trace:configure.in:110: -1- m4_pattern_allow([^CEGUI_CFLAGS$])
+m4trace:configure.in:110: -1- AC_SUBST([CEGUI_LIBS])
+m4trace:configure.in:110: -1- AC_SUBST_TRACE([CEGUI_LIBS])
+m4trace:configure.in:110: -1- m4_pattern_allow([^CEGUI_LIBS$])
+m4trace:configure.in:110: -1- AM_CONDITIONAL([HAVE_CEGUI], [test x$build_cegui_sample = xtrue])
+m4trace:configure.in:110: -1- AC_SUBST([HAVE_CEGUI_TRUE])
+m4trace:configure.in:110: -1- AC_SUBST_TRACE([HAVE_CEGUI_TRUE])
+m4trace:configure.in:110: -1- m4_pattern_allow([^HAVE_CEGUI_TRUE$])
+m4trace:configure.in:110: -1- AC_SUBST([HAVE_CEGUI_FALSE])
+m4trace:configure.in:110: -1- AC_SUBST_TRACE([HAVE_CEGUI_FALSE])
+m4trace:configure.in:110: -1- m4_pattern_allow([^HAVE_CEGUI_FALSE$])
+m4trace:configure.in:118: -1- AC_SUBST([abs_top_builddir])
+m4trace:configure.in:118: -1- AC_SUBST_TRACE([abs_top_builddir])
+m4trace:configure.in:118: -1- m4_pattern_allow([^abs_top_builddir$])
+m4trace:configure.in:119: -1- AC_SUBST([ogreexecdir])
+m4trace:configure.in:119: -1- AC_SUBST_TRACE([ogreexecdir])
+m4trace:configure.in:119: -1- m4_pattern_allow([^ogreexecdir$])
+m4trace:configure.in:252: -1- AC_CONFIG_FILES([Makefile \
+    OgreMain/Makefile \
+    OgreMain/src/Makefile \
+    OgreMain/include/Makefile \
+    OgreMain/include/GLX/Makefile \
+    OgreMain/include/gtk/Makefile \
+    PlugIns/Makefile \
+    PlugIns/BSPSceneManager/Makefile \
+    PlugIns/BSPSceneManager/src/Makefile \
+    PlugIns/BSPSceneManager/include/Makefile \
+    PlugIns/CgProgramManager/Makefile \
+    PlugIns/CgProgramManager/src/Makefile \
+    PlugIns/CgProgramManager/include/Makefile \
+    PlugIns/OctreeSceneManager/Makefile \
+    PlugIns/OctreeSceneManager/src/Makefile \
+    PlugIns/OctreeSceneManager/include/Makefile \
+    PlugIns/ParticleFX/Makefile \
+    PlugIns/ParticleFX/src/Makefile \
+    PlugIns/ParticleFX/include/Makefile \
+    RenderSystems/Makefile \
+    RenderSystems/GL/Makefile \
+    RenderSystems/GL/src/Makefile \
+    RenderSystems/GL/include/Makefile \
+    RenderSystems/GL/src/atifs/Makefile \
+    RenderSystems/GL/src/atifs/include/Makefile \
+    RenderSystems/GL/src/atifs/src/Makefile \
+    RenderSystems/GL/src/GLSL/Makefile \
+    RenderSystems/GL/src/GLSL/include/Makefile \
+    RenderSystems/GL/src/GLSL/src/Makefile \
+    RenderSystems/GL/src/nvparse/Makefile \
+    RenderSystems/Direct3D9/Makefile \
+    RenderSystems/Direct3D9/src/Makefile \
+    RenderSystems/Direct3D9/include/Makefile \
+    Samples/Makefile \
+    Samples/Common/Makefile \
+    Samples/Common/include/Makefile \
+    Samples/Common/bin/Makefile \
+    Samples/BezierPatch/Makefile \
+    Samples/BezierPatch/src/Makefile \
+    Samples/BezierPatch/include/Makefile \
+    Samples/CameraTrack/Makefile \
+    Samples/CameraTrack/src/Makefile \
+    Samples/CelShading/Makefile \
+    Samples/CelShading/src/Makefile \
+    Samples/Compositor/Makefile \
+    Samples/Compositor/src/Makefile \
+    Samples/Compositor/include/Makefile \
+    Samples/CubeMapping/Makefile \
+    Samples/CubeMapping/src/Makefile \
+    Samples/CubeMapping/include/Makefile \
+    Samples/DeferredShading/Makefile \
+    Samples/DeferredShading/src/Makefile \
+    Samples/DeferredShading/include/Makefile  \
+    Samples/Dot3Bump/Makefile \
+    Samples/Dot3Bump/src/Makefile \
+    Samples/EnvMapping/Makefile \
+    Samples/EnvMapping/src/Makefile \
+    Samples/EnvMapping/include/Makefile \
+    Samples/FacialAnimation/Makefile \
+    Samples/FacialAnimation/src/Makefile \
+    Samples/Fresnel/Makefile \
+    Samples/Fresnel/src/Makefile \
+    Samples/Grass/Makefile \
+    Samples/Grass/src/Makefile \
+    Samples/Transpacency/Makefile \
+    Samples/Transpacency/src/Makefile \
+    Samples/Transpacency/include/Makefile \
+    Samples/Lighting/Makefile \
+    Samples/Lighting/src/Makefile \
+    Samples/Lighting/include/Makefile \
+    Samples/OceanDemo/Makefile \
+    Samples/OceanDemo/src/Makefile \
+    Samples/OceanDemo/include/Makefile \
+    Samples/ParticleFX/Makefile \
+    Samples/ParticleFX/src/Makefile \
+    Samples/ParticleFX/include/Makefile \
+    Samples/RenderToTexture/Makefile \
+    Samples/RenderToTexture/src/Makefile \
+    Samples/TextureFX/Makefile \
+    Samples/TextureFX/src/Makefile \
+    Samples/TextureFX/include/Makefile \
+    Samples/Shadows/Makefile \
+    Samples/Shadows/src/Makefile \
+    Samples/SkyBox/Makefile \
+    Samples/SkyBox/src/Makefile \
+    Samples/SkyBox/include/Makefile \
+    Samples/SkyDome/Makefile \
+    Samples/SkyDome/src/Makefile \
+    Samples/SkyDome/include/Makefile \
+    Samples/SkyPlane/Makefile \
+    Samples/SkyPlane/src/Makefile \
+    Samples/SkyPlane/include/Makefile \
+    Samples/Smoke/Makefile \
+    Samples/Smoke/src/Makefile \
+    Samples/Smoke/include/Makefile \
+    Samples/BSP/Makefile \
+    Samples/BSP/src/Makefile \
+    Samples/SkeletalAnimation/Makefile \
+    Samples/SkeletalAnimation/src/Makefile \
+    Samples/SkeletalAnimation/include/Makefile \
+    Samples/Terrain/Makefile \
+    Samples/Terrain/src/Makefile \
+    Samples/Terrain/include/Makefile \
+    Samples/Water/Makefile \
+    Samples/Water/src/Makefile \
+    Samples/Water/include/Makefile \
+    Samples/DynTex/Makefile \
+    Samples/DynTex/src/Makefile \
+    Samples/DynTex/include/Makefile \
+    Samples/VolumeTex/Makefile \
+    Samples/VolumeTex/src/Makefile \
+    Samples/VolumeTex/include/Makefile \
+    Samples/Instancing/Makefile \
+    Samples/Instancing/src/Makefile \
+    Samples/Instancing/include/Makefile \
+    Tests/Makefile \
+    Tests/src/Makefile \
+    Tools/Makefile \
+    Tools/MaterialUpgrader/Makefile \
+    Tools/MaterialUpgrader/src/Makefile \
+    Tools/MaterialUpgrader/include/Makefile \
+    Tools/MeshUpgrader/Makefile \
+    Tools/MeshUpgrader/src/Makefile \
+    Tools/XMLConverter/Makefile \
+    Tools/XMLConverter/src/Makefile \
+    Tools/XMLConverter/include/Makefile \
+    Tools/LightwaveConverter/Makefile \
+    Tools/LightwaveConverter/src/Makefile \
+    Tools/LightwaveConverter/include/Makefile \
+    OGRE.pc
+    ])
+m4trace:configure.in:254: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
+m4trace:configure.in:254: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
+m4trace:configure.in:254: -1- m4_pattern_allow([^LIB@&t@OBJS$])
+m4trace:configure.in:254: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
+m4trace:configure.in:254: -1- AC_SUBST_TRACE([LTLIBOBJS])
+m4trace:configure.in:254: -1- m4_pattern_allow([^LTLIBOBJS$])
+m4trace:configure.in:254: -1- AC_SUBST_TRACE([top_builddir])
+m4trace:configure.in:254: -1- AC_SUBST_TRACE([srcdir])
+m4trace:configure.in:254: -1- AC_SUBST_TRACE([abs_srcdir])
+m4trace:configure.in:254: -1- AC_SUBST_TRACE([top_srcdir])
+m4trace:configure.in:254: -1- AC_SUBST_TRACE([abs_top_srcdir])
+m4trace:configure.in:254: -1- AC_SUBST_TRACE([builddir])
+m4trace:configure.in:254: -1- AC_SUBST_TRACE([abs_builddir])
+m4trace:configure.in:254: -1- AC_SUBST_TRACE([abs_top_builddir])
+m4trace:configure.in:254: -1- AC_SUBST_TRACE([INSTALL])
Index: /bootstrap
===================================================================
--- /bootstrap	(revision 5)
+++ /bootstrap	(revision 5)
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# Check for proper versions of autotools
+# We require:
+#  - autoconf 2.50+
+#  - automake 1.6+
+#  - libtool 1.4+
+
+# Deal with some gentoo-specific issues
+export WANT_AUTOMAKE='1.7'
+export WANT_AUTOCONF='2.5'
+
+## Using prereq in autoconf rather than here, mostly for the debian systems at
+## this point
+if test -z "`autoconf --version 2>&1|head -n 1|egrep '2.[56]'`"; then
+	echo "Autoconf 2.50 or above is required. Aborting build...";
+    exit 1;
+fi
+
+if test -z "`automake --version 2>&1|head -n 1|egrep '1.([6-9]|[1-9][0-9])'`"; then
+	echo "Automake 1.6 or above is required. Aborting build...";
+	exit 1;
+fi
+
+if test -z "`libtool --version 2>&1|head -n 1|egrep '1.[4-5]'`"; then
+	echo "Libtool 1.4 or above is required. Aborting build...";
+	exit 1;
+fi
+
+# clean up files which cause confusion when switch versions of auto*
+rm -rf autom4te.cache
+
+# Fire up autotools
+libtoolize --force --copy && aclocal -I Scripts/m4 $ACLOCAL_FLAGS && autoheader && automake --include-deps --add-missing --foreign --copy && autoconf 
Index: /bumpversion.sh
===================================================================
--- /bumpversion.sh	(revision 5)
+++ /bumpversion.sh	(revision 5)
@@ -0,0 +1,95 @@
+# alter the version number
+# required format ./bumpversion.sh <major> <minor> <patch> <codename> [<extra>]
+
+MAJOR=$1
+MINOR=$2
+PATCH=$3
+CODENAME=$4
+EXTRA=$5
+
+if [ -e $MAJOR ]
+then 
+	echo Major version cannot be blank
+	exit 1
+fi
+if [ -e $MINOR ]
+then 
+	echo Minor version cannot be blank
+	exit 1
+fi
+if [ -e $PATCH ]
+then 
+	echo Patch version cannot be blank
+	exit 1
+fi
+if [ -e $CODENAME ]
+then 
+	echo Codename cannot be blank
+	exit 1
+fi
+
+# configure.in
+#	AC_INIT([OGRE], [1.4.0])
+#	AM_INIT_AUTOMAKE([OGRE], 1.4.0)
+sed -i -e "s/AC_INIT(.*$/AC_INIT([OGRE], [$MAJOR.$MINOR.$PATCH])/i" configure.in
+sed -i -e "s/AM_INIT_AUTOMAKE(.*$/AM_INIT_AUTOMAKE([OGRE], $MAJOR.$MINOR.$PATCH)/i" configure.in
+
+# Docs/src/html.cfg
+#	PROJECT_NUMBER         = 1.4.0
+sed -i -e "s/PROJECT_NUMBER.*$/PROJECT_NUMBER         = $MAJOR.$MINOR.$PATCH/i" Docs/src/html.cfg
+
+# Docs/src/manual.texi 
+#	@settitle OGRE Manual v1.4.0 ('Eihort')
+sed -i -e "s/@settitle.*$/@settitle OGRE Manual v$MAJOR.$MINOR.$PATCH ('$CODENAME')/i" Docs/src/manual.texi
+
+# Mac/Ogre/include/config.h
+#	#define PACKAGE_STRING "OGRE 1.4.0"
+#	#define PACKAGE_VERSION "1.4.0"
+#	#define VERSION "1.4.0"
+sed -i -e "s/#define PACKAGE_STRING.*$/#define PACKAGE_STRING \"OGRE $MAJOR.$MINOR.$PATCH\"/i" Mac/Ogre/include/config.h
+sed -i -e "s/#define PACKAGE_VERSION.*$/#define PACKAGE_VERSION \"$MAJOR.$MINOR.$PATCH\"/i" Mac/Ogre/include/config.h
+sed -i -e "s/#define VERSION.*$/#define VERSION \"$MAJOR.$MINOR.$PATCH\"/i" Mac/Ogre/include/config.h
+
+# OgreMain/include/OgrePrerequisites.h 
+#	#define OGRE_VERSION_MAJOR 1
+#	#define OGRE_VERSION_MINOR 4
+#	#define OGRE_VERSION_PATCH 0
+#	#define OGRE_VERSION_SUFFIX "RC1"
+#	#define OGRE_VERSION_NAME "Eihort"
+sed -i -e "s/define OGRE_VERSION_MAJOR.*$/define OGRE_VERSION_MAJOR $MAJOR/i" OgreMain/include/OgrePrerequisites.h
+sed -i -e "s/define OGRE_VERSION_MINOR.*$/define OGRE_VERSION_MINOR $MINOR/i" OgreMain/include/OgrePrerequisites.h
+sed -i -e "s/define OGRE_VERSION_PATCH.*$/define OGRE_VERSION_PATCH $PATCH/i" OgreMain/include/OgrePrerequisites.h
+sed -i -e "s/define OGRE_VERSION_SUFFIX.*$/define OGRE_VERSION_SUFFIX \"$EXTRA\"/i" OgreMain/include/OgrePrerequisites.h
+sed -i -e "s/define OGRE_VERSION_NAME.*$/define OGRE_VERSION_NAME \"$CODENAME\"/i" OgreMain/include/OgrePrerequisites.h
+
+# Samples/Common/setup/demos.wxs
+#	Name='OGRE Demos 1.2.5' 
+#	Version='1.2.5'
+sed -i -e "s/Name='OGRE Demos [0-9]*\.[0-9]*\.[0-9]*'/Name='OGRE Demos $MAJOR.$MINOR.$PATCH'/i" Samples/Common/setup/demos.wxs
+sed -i -e "s/Version='[0-9]*\.[0-9]*\.[0-9]*'/Version='$MAJOR.$MINOR.$PATCH'/i" Samples/Common/setup/demos.wxs
+
+# SDK/Win32/ogresdk.nsh
+#	!define PRODUCT_VERSION "1.2.5"
+sed -i -e "s/PRODUCT_VERSION \".*$/PRODUCT_VERSION \"$MAJOR.$MINOR.$PATCH$EXTRA\"/i" SDK/Win32/ogresdk.nsh
+
+# SDK/OSX/make_osx.sh
+#	OGRE_VERSION="v1.4.4"
+sed -i -e "s/OGRE_VERSION=.*$/OGRE_VERSION=\"v$MAJOR.$MINOR.$PATCH$EXTRA\"/i" SDK/OSX/make_osx.sh
+
+
+# Tools/Common/setup/commandlinetools.wxs
+#	Version='1.2.5'
+sed -i -e "s/Version='[0-9]*\.[0-9]*\.[0-9]*'/Version='$MAJOR.$MINOR.$PATCH'/i" Tools/Common/setup/commandlinetools.wxs
+
+# Tools/MilkshapeExport/setup/milkshapeinstall.wxs
+#	Version='1.2.5'
+sed -i -e "s/Version='[0-9]*\.[0-9]*\.[0-9]*'/Version='$MAJOR.$MINOR.$PATCH'/i" Tools/MilkshapeExport/setup/milkshapeinstall.wxs
+
+# Tools/XSIExport/setup/xsi5install.wxs
+#	Version='1.2.5'
+sed -i -e "s/Version='[0-9]*\.[0-9]*\.[0-9]*'/Version='$MAJOR.$MINOR.$PATCH'/i" Tools/XSIExport/setup/xsi5install.wxs
+
+# Tools/XSIExport/setup/xsi6install.wxs
+#	Version='1.2.5'
+sed -i -e "s/Version='[0-9]*\.[0-9]*\.[0-9]*'/Version='$MAJOR.$MINOR.$PATCH'/i" Tools/XSIExport/setup/xsi6install.wxs
+
Index: /config.guess
===================================================================
--- /config.guess	(revision 5)
+++ /config.guess	(revision 5)
@@ -0,0 +1,1466 @@
+#! /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 Free Software Foundation, Inc.
+
+timestamp='2005-08-03'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d -q "$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 ;;
+	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE_ARCH}" in
+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+		eval $set_cc_for_build
+		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+			| grep __ELF__ >/dev/null
+		then
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+		    # Return netbsd for either.  FIX?
+		    os=netbsd
+		else
+		    os=netbsdelf
+		fi
+		;;
+	    *)
+	        os=netbsd
+		;;
+	esac
+	# The OS release
+	# Debian GNU/NetBSD machines have a different userland, and
+	# thus, need a distinct triplet. However, they do not need
+	# kernel version information, so it can be replaced with a
+	# suitable tag, in the style of linux-gnu.
+	case "${UNAME_VERSION}" in
+	    Debian*)
+		release='-gnu'
+		;;
+	    *)
+		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+		;;
+	esac
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit ;;
+    *:OpenBSD:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
+    *:ekkoBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	exit ;;
+    macppc:MirBSD:*:*)
+	echo powerppc-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    *:MirBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    alpha:OSF1:*:*)
+	case $UNAME_RELEASE in
+	*4.0)
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+		;;
+	*5.*)
+	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		;;
+	esac
+	# According to Compaq, /usr/sbin/psrinfo has been available on
+	# OSF/1 and Tru64 systems produced since 1995.  I hope that
+	# covers most systems running today.  This code pipes the CPU
+	# types through head -n 1, so we only detect the type of CPU 0.
+	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+	case "$ALPHA_CPU_TYPE" in
+	    "EV4 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV4.5 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "LCA4 (21066/21068)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV5 (21164)")
+		UNAME_MACHINE="alphaev5" ;;
+	    "EV5.6 (21164A)")
+		UNAME_MACHINE="alphaev56" ;;
+	    "EV5.6 (21164PC)")
+		UNAME_MACHINE="alphapca56" ;;
+	    "EV5.7 (21164PC)")
+		UNAME_MACHINE="alphapca57" ;;
+	    "EV6 (21264)")
+		UNAME_MACHINE="alphaev6" ;;
+	    "EV6.7 (21264A)")
+		UNAME_MACHINE="alphaev67" ;;
+	    "EV6.8CB (21264C)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8AL (21264B)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8CX (21264D)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.9A (21264/EV69A)")
+		UNAME_MACHINE="alphaev69" ;;
+	    "EV7 (21364)")
+		UNAME_MACHINE="alphaev7" ;;
+	    "EV7.9 (21364A)")
+		UNAME_MACHINE="alphaev79" ;;
+	esac
+	# A Pn.n version is a patched version.
+	# A Vn.n version is a released version.
+	# A Tn.n version is a released field test version.
+	# A Xn.n version is an unreleased experimental baselevel.
+	# 1.2 uses "1.2" for uname -r.
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit ;;
+    Alpha\ *:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
+	echo alpha-pc-interix
+	exit ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit ;;
+    Amiga*:UNIX_System_V:4.0:*)
+	echo m68k-unknown-sysv4
+	exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit ;;
+    *:z/VM:*:*)
+	echo s390-ibm-zvmoe
+	exit ;;
+    *:OS400:*:*)
+        echo powerpc-ibm-os400
+	exit ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+	echo arm-unknown-riscos
+	exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+	echo hppa1.1-hitachi-hiuxmpp
+	exit ;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+	if test "`(/bin/universe) 2>/dev/null`" = att ; then
+		echo pyramid-pyramid-sysv3
+	else
+		echo pyramid-pyramid-bsd
+	fi
+	exit ;;
+    NILE*:*:*:dcosx)
+	echo pyramid-pyramid-svr4
+	exit ;;
+    DRS?6000:unix:4.0:6*)
+	echo sparc-icl-nx6
+	exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+	case `/usr/bin/uname -p` in
+	    sparc) echo sparc-icl-nx7; exit ;;
+	esac ;;
+    sun4H:SunOS:5.*:*)
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    i86pc:SunOS:5.*:*)
+	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:6*:*)
+	# According to config.sub, this is the proper way to canonicalize
+	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+	# it's likely to be more like Solaris than SunOS4.
+	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:*:*)
+	case "`/usr/bin/arch -k`" in
+	    Series*|S4*)
+		UNAME_RELEASE=`uname -v`
+		;;
+	esac
+	# Japanese Language versions have a version number like `4.1.3-JL'.
+	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	exit ;;
+    sun3*:SunOS:*:*)
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit ;;
+    sun*:*:4.2BSD:*)
+	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+	case "`/bin/arch`" in
+	    sun3)
+		echo m68k-sun-sunos${UNAME_RELEASE}
+		;;
+	    sun4)
+		echo sparc-sun-sunos${UNAME_RELEASE}
+		;;
+	esac
+	exit ;;
+    aushp:SunOS:*:*)
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+        exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit ;;
+    m68k:machten:*:*)
+	echo m68k-apple-machten${UNAME_RELEASE}
+	exit ;;
+    powerpc:machten:*:*)
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit ;;
+    RISC*:Mach:*:*)
+	echo mips-dec-mach_bsd4.3
+	exit ;;
+    RISC*:ULTRIX:*:*)
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    VAX*:ULTRIX*:*:*)
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
+	#if defined (host_mips) && defined (MIPSEB)
+	#if defined (SYSTYPE_SYSV)
+	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_SVR4)
+	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	#endif
+	#endif
+	  exit (-1);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c &&
+	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	    { echo "$SYSTEM_NAME"; exit; }
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit ;;
+    Motorola:*:4.3:PL8-*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:Power_UNIX:*:*)
+	echo powerpc-harris-powerunix
+	exit ;;
+    m88k:CX/UX:7*:*)
+	echo m88k-harris-cxux7
+	exit ;;
+    m88k:*:4*:R4*)
+	echo m88k-motorola-sysv4
+	exit ;;
+    m88k:*:3*:R3*)
+	echo m88k-motorola-sysv3
+	exit ;;
+    AViiON:dgux:*:*)
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	then
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    then
+		echo m88k-dg-dgux${UNAME_RELEASE}
+	    else
+		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+	    fi
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
+	fi
+ 	exit ;;
+    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
+	echo m88k-dolphin-sysv3
+	exit ;;
+    M88*:*:R3*:*)
+	# Delta 88k system running SVR3
+	echo m88k-motorola-sysv3
+	exit ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+	echo m88k-tektronix-sysv3
+	exit ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+	echo m68k-tektronix-bsd
+	exit ;;
+    *:IRIX*:*:*)
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+	echo i386-ibm-aix
+	exit ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:2:3)
+	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
+		#include <sys/systemcfg.h>
+
+		main()
+			{
+			if (!__power_pc())
+				exit(1);
+			puts("powerpc-ibm-aix3.2.5");
+			exit(0);
+			}
+EOF
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		then
+			echo "$SYSTEM_NAME"
+		else
+			echo rs6000-ibm-aix3.2.5
+		fi
+	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+		echo rs6000-ibm-aix3.2.4
+	else
+		echo rs6000-ibm-aix3.2
+	fi
+	exit ;;
+    *:AIX:*:[45])
+	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+		IBM_ARCH=rs6000
+	else
+		IBM_ARCH=powerpc
+	fi
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:*:*)
+	echo rs6000-ibm-aix
+	exit ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit ;;                             # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+	echo rs6000-bull-bosx
+	exit ;;
+    DPX/2?00:B.O.S.:*:*)
+	echo m68k-bull-sysv3
+	exit ;;
+    9000/[34]??:4.3bsd:1.*:*)
+	echo m68k-hp-bsd
+	exit ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+	echo m68k-hp-bsd4.4
+	exit ;;
+    9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	case "${UNAME_MACHINE}" in
+	    9000/31? )            HP_ARCH=m68000 ;;
+	    9000/[34]?? )         HP_ARCH=m68k ;;
+	    9000/[678][0-9][0-9])
+		if [ -x /usr/bin/getconf ]; then
+		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
+		fi
+		if [ "${HP_ARCH}" = "" ]; then
+		    eval $set_cc_for_build
+		    sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+              	{
+              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+              	case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+              	    switch (bits)
+              		{
+              		case 64: puts ("hppa2.0w"); break;
+              		case 32: puts ("hppa2.0n"); break;
+              		default: puts ("hppa2.0"); break;
+              		} break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+              	    puts ("hppa2.0"); break;
+              #endif
+              	default: puts ("hppa1.0"); break;
+              	}
+                  exit (0);
+              }
+EOF
+		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    test -z "$HP_ARCH" && HP_ARCH=hppa
+		fi ;;
+	esac
+	if [ ${HP_ARCH} = "hppa2.0w" ]
+	then
+	    eval $set_cc_for_build
+
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
+	    #
+	    # $ CC_FOR_BUILD=cc ./config.guess
+	    # => hppa2.0w-hp-hpux11.23
+	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+	    # => hppa64-hp-hpux11.23
+
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+		grep __LP64__ >/dev/null
+	    then
+		HP_ARCH="hppa2.0w"
+	    else
+		HP_ARCH="hppa64"
+	    fi
+	fi
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit ;;
+    3050*:HI-UX:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <unistd.h>
+	int
+	main ()
+	{
+	  long cpu = sysconf (_SC_CPU_VERSION);
+	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+	     results, however.  */
+	  if (CPU_IS_PA_RISC (cpu))
+	    {
+	      switch (cpu)
+		{
+		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+		  default: puts ("hppa-hitachi-hiuxwe2"); break;
+		}
+	    }
+	  else if (CPU_IS_HP_MC68K (cpu))
+	    puts ("m68k-hitachi-hiuxwe2");
+	  else puts ("unknown-hitachi-hiuxwe2");
+	  exit (0);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+		{ echo "$SYSTEM_NAME"; exit; }
+	echo unknown-hitachi-hiuxwe2
+	exit ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit ;;
+    9000/8??:4.3bsd:*:*)
+	echo hppa1.0-hp-bsd
+	exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit ;;
+    hp8??:OSF1:*:*)
+	echo hppa1.0-hp-osf
+	exit ;;
+    i*86:OSF1:*:*)
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	else
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit ;;
+    parisc*:Lites*:*:*)
+	echo hppa1.1-hp-lites
+	exit ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+	echo c1-convex-bsd
+        exit ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+        exit ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+	echo c34-convex-bsd
+        exit ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+	echo c38-convex-bsd
+        exit ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+	echo c4-convex-bsd
+        exit ;;
+    CRAY*Y-MP:*:*:*)
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*[A-Z]90:*:*:*)
+	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*TS:*:*:*)
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    *:UNICOS/mp:*:*)
+	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit ;;
+    5000:UNIX_System_V:4.*:*)
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:FreeBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit ;;
+    i*: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 ;;
+    x86:Interix*:[34]*)
+	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+	exit ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+	echo i${UNAME_MACHINE}-pc-mks
+	exit ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+	# UNAME_MACHINE based on the output of uname instead of i386?
+	echo i586-pc-interix
+	exit ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+	echo x86_64-unknown-cygwin
+	exit ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    *:GNU:*:*)
+	# the GNU system
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit ;;
+    *:GNU/*:*:*)
+	# other systems with GNU libc and userland
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	exit ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit ;;
+    arm*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    cris:Linux:*:*)
+	echo cris-axis-linux-gnu
+	exit ;;
+    crisv32:Linux:*:*)
+	echo crisv32-axis-linux-gnu
+	exit ;;
+    frv:Linux:*:*)
+    	echo frv-unknown-linux-gnu
+	exit ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m32r*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    mips:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips
+	#undef mipsel
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mipsel
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	;;
+    mips64:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips64
+	#undef mips64el
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mips64el
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips64
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	;;
+    or32:Linux:*:*)
+	echo or32-unknown-linux-gnu
+	exit ;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
+	esac
+	exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit ;;
+    sh64*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    x86_64:Linux:*:*)
+	echo x86_64-unknown-linux-gnu
+	exit ;;
+    i*86:Linux:*:*)
+	# The BFD linker knows what the default object file format is, so
+	# first see if it will tell us. cd to the root directory to prevent
+	# problems with other programs or directories called `ld' in the path.
+	# Set LC_ALL=C to ensure ld outputs messages in English.
+	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+			 | sed -ne '/supported targets:/!d
+				    s/[ 	][ 	]*/ /g
+				    s/.*supported targets: *//
+				    s/ .*//
+				    p'`
+        case "$ld_supported_targets" in
+	  elf32-i386)
+		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+		;;
+	  a.out-i386-linux)
+		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+		exit ;;
+	  coff-i386)
+		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+		exit ;;
+	  "")
+		# Either a pre-BFD a.out linker (linux-gnuoldld) or
+		# one that does not give us useful --help.
+		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+		exit ;;
+	esac
+	# Determine whether the default compiler is a.out or elf
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <features.h>
+	#ifdef __ELF__
+	# ifdef __GLIBC__
+	#  if __GLIBC__ >= 2
+	LIBC=gnu
+	#  else
+	LIBC=gnulibc1
+	#  endif
+	# else
+	LIBC=gnulibc1
+	# endif
+	#else
+	#ifdef __INTEL_COMPILER
+	LIBC=gnu
+	#else
+	LIBC=gnuaout
+	#endif
+	#endif
+	#ifdef __dietlibc__
+	LIBC=dietlibc
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+	test x"${LIBC}" != x && {
+		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+		exit
+	}
+	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+	;;
+    i*86:DYNIX/ptx:4*:*)
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+	# earlier versions are messed up and put the nodename in both
+	# sysname and nodename.
+	echo i386-sequent-sysv4
+	exit ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+        # Unixware is an offshoot of SVR4, but it has its own version
+        # number series starting with 2...
+        # I am not positive that other SVR4 systems won't match this,
+	# I just have to hope.  -- rms.
+        # Use sysv4.2uw... so that sysv4* matches it.
+	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	exit ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit ;;
+    i*86:syllable:*:*)
+	echo ${UNAME_MACHINE}-pc-syllable
+	exit ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+	else
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+	fi
+	exit ;;
+    i*86:*:5:[678]*)
+    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=i486 ;;
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	exit ;;
+    i*86:*:3.2:*)
+	if test -f /usr/options/cb.name; then
+		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+	elif /bin/uname -X 2>/dev/null >/dev/null ; then
+		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+			&& UNAME_MACHINE=i586
+		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+	else
+		echo ${UNAME_MACHINE}-pc-sysv32
+	fi
+	exit ;;
+    pc:*:*:*)
+	# Left here for compatibility:
+        # uname -m prints for DJGPP always 'pc', but it prints nothing about
+        # the processor, so we play safe by assuming i386.
+	echo i386-pc-msdosdjgpp
+        exit ;;
+    Intel:Mach:3*:*)
+	echo i386-pc-mach3
+	exit ;;
+    paragon:*:*:*)
+	echo i860-intel-osf1
+	exit ;;
+    i860:*:4.*:*) # i860-SVR4
+	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	else # Add other i860-SVR4 vendors below as they are discovered.
+	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	fi
+	exit ;;
+    mini*:CTIX:SYS*5:*)
+	# "miniframe"
+	echo m68010-convergent-sysv
+	exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+	echo m68k-convergent-sysv
+	exit ;;
+    M680?0:D-NIX:5.3:*)
+	echo m68k-diab-dnix
+	exit ;;
+    M68*:*:R3V[5678]*:*)
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+	OS_REL=''
+	test -r /etc/.relid \
+	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && { echo i486-ncr-sysv4; exit; } ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    mc68030:UNIX_System_V:4.*:*)
+	echo m68k-atari-sysv4
+	exit ;;
+    TSUNAMI:LynxOS:2.*:*)
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    rs6000:LynxOS:2.*:*)
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    SM[BE]S:UNIX_SV:*:*)
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    RM*:SINIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    *:SINIX-*:*:*)
+	if uname -p 2>/dev/null >/dev/null ; then
+		UNAME_MACHINE=`(uname -p) 2>/dev/null`
+		echo ${UNAME_MACHINE}-sni-sysv4
+	else
+		echo ns32k-sni-sysv
+	fi
+	exit ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes@openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit ;;
+    *:*:*:FTX*)
+	# From seanf@swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit ;;
+    i*86:VOS:*:*)
+	# From Paul.Green@stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit ;;
+    *:VOS:*:*)
+	# From Paul.Green@stratus.com.
+	echo hppa1.1-stratus-vos
+	exit ;;
+    mc68*:A/UX:*:*)
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit ;;
+    news*:NEWS-OS:6*:*)
+	echo mips-sony-newsos6
+	exit ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+	if [ -d /usr/nec ]; then
+	        echo mips-nec-sysv${UNAME_RELEASE}
+	else
+	        echo mips-unknown-sysv${UNAME_RELEASE}
+	fi
+        exit ;;
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
+	echo powerpc-be-beos
+	exit ;;
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
+	echo powerpc-apple-beos
+	exit ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-6:SUPER-UX:*:*)
+	echo sx6-nec-superux${UNAME_RELEASE}
+	exit ;;
+    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
+	    *86) UNAME_PROCESSOR=i686 ;;
+	    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 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+	  ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+	printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+	printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+	echo c1-convex-bsd
+	exit ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit ;;
+    c34*)
+	echo c34-convex-bsd
+	exit ;;
+    c38*)
+	echo c38-convex-bsd
+	exit ;;
+    c4*)
+	echo c4-convex-bsd
+	exit ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
Index: /config.log
===================================================================
--- /config.log	(revision 5)
+++ /config.log	(revision 5)
@@ -0,0 +1,2646 @@
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by OGRE configure 1.4.5, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  $ ./configure 
+
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = tardis-d04
+uname -m = i686
+uname -r = 2.6.21.4-generic32-isg-ee-sm-pxe-smp-1
+uname -s = Linux
+uname -v = #1 SMP Fri Jun 22 08:14:46 CEST 2007
+
+/usr/bin/uname -p = unknown
+/bin/uname -X     = unknown
+
+/bin/arch              = i686
+/usr/bin/arch -k       = unknown
+/usr/convex/getsysinfo = unknown
+/usr/bin/hostinfo      = unknown
+/bin/machine           = unknown
+/usr/bin/oslevel       = unknown
+/bin/universe          = unknown
+
+PATH: /usr/bin_override
+PATH: /usr/pack/kde-3.5.1-to/i686-debian-linux3.1/bin
+PATH: /bin
+PATH: /usr/bin
+PATH: /usr/sepp/bin
+PATH: /usr/isgtc/bin
+PATH: /usr/openwin/bin
+PATH: /usr/X11R6/bin
+PATH: /usr/bin/X11
+PATH: /usr/games
+PATH: /usr/dt/bin
+PATH: /usr/ccs/bin
+PATH: /usr/sbin
+PATH: /opt/SUNWut/bin
+PATH: /usr/local/bin
+PATH: /usr/ucb
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+configure:2114: checking build system type
+configure:2132: result: i686-pc-linux-gnu
+configure:2154: checking host system type
+configure:2169: result: i686-pc-linux-gnu
+configure:2191: checking target system type
+configure:2206: result: i686-pc-linux-gnu
+configure:2251: checking for a BSD-compatible install
+configure:2307: result: /usr/bin/install -c
+configure:2318: checking whether build environment is sane
+configure:2361: result: yes
+configure:2426: checking for gawk
+configure:2442: found /usr/sepp/bin/gawk
+configure:2453: result: gawk
+configure:2464: checking whether make sets $(MAKE)
+configure:2485: result: yes
+configure:2720: checking for gcc
+configure:2736: found /usr/bin/gcc
+configure:2747: result: gcc
+configure:2985: checking for C compiler version
+configure:2992: gcc --version >&5
+gcc (GCC) 3.3.5 (Debian 1:3.3.5-13)
+Copyright (C) 2003 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.
+
+configure:2995: $? = 0
+configure:3002: gcc -v >&5
+Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs
+Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
+Thread model: posix
+gcc version 3.3.5 (Debian 1:3.3.5-13)
+configure:3005: $? = 0
+configure:3012: gcc -V >&5
+gcc: `-V' option must have argument
+configure:3015: $? = 1
+configure:3038: checking for C compiler default output file name
+configure:3065: gcc    conftest.c  >&5
+configure:3068: $? = 0
+configure:3106: result: a.out
+configure:3123: checking whether the C compiler works
+configure:3133: ./a.out
+configure:3136: $? = 0
+configure:3153: result: yes
+configure:3160: checking whether we are cross compiling
+configure:3162: result: no
+configure:3165: checking for suffix of executables
+configure:3172: gcc -o conftest    conftest.c  >&5
+configure:3175: $? = 0
+configure:3199: result: 
+configure:3205: checking for suffix of object files
+configure:3231: gcc -c   conftest.c >&5
+configure:3234: $? = 0
+configure:3257: result: o
+configure:3261: checking whether we are using the GNU C compiler
+configure:3290: gcc -c   conftest.c >&5
+configure:3296: $? = 0
+configure:3313: result: yes
+configure:3318: checking whether gcc accepts -g
+configure:3348: gcc -c -g  conftest.c >&5
+configure:3354: $? = 0
+configure:3453: result: yes
+configure:3470: checking for gcc option to accept ISO C89
+configure:3544: gcc  -c -g -O2  conftest.c >&5
+configure:3550: $? = 0
+configure:3573: result: none needed
+configure:3602: checking for style of include used by make
+configure:3630: result: GNU
+configure:3658: checking dependency style of gcc
+configure:3748: result: gcc3
+configure:3823: checking for g++
+configure:3839: found /usr/bin/g++
+configure:3850: result: g++
+configure:3881: checking for C++ compiler version
+configure:3888: g++ --version >&5
+g++ (GCC) 3.3.5 (Debian 1:3.3.5-13)
+Copyright (C) 2003 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.
+
+configure:3891: $? = 0
+configure:3898: g++ -v >&5
+Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs
+Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
+Thread model: posix
+gcc version 3.3.5 (Debian 1:3.3.5-13)
+configure:3901: $? = 0
+configure:3908: g++ -V >&5
+g++: `-V' option must have argument
+configure:3911: $? = 1
+configure:3914: checking whether we are using the GNU C++ compiler
+configure:3943: g++ -c   conftest.cpp >&5
+configure:3949: $? = 0
+configure:3966: result: yes
+configure:3971: checking whether g++ accepts -g
+configure:4001: g++ -c -g  conftest.cpp >&5
+configure:4007: $? = 0
+configure:4106: result: yes
+configure:4131: checking dependency style of g++
+configure:4221: result: gcc3
+configure:4239: checking whether gcc and cc understand -c and -o together
+configure:4274: gcc -c conftest.c -o conftest2.o >&5
+configure:4277: $? = 0
+configure:4283: gcc -c conftest.c -o conftest2.o >&5
+configure:4286: $? = 0
+configure:4297: cc -c conftest.c >&5
+configure:4300: $? = 0
+configure:4308: cc -c conftest.c -o conftest2.o >&5
+configure:4311: $? = 0
+configure:4317: cc -c conftest.c -o conftest2.o >&5
+configure:4320: $? = 0
+configure:4338: result: yes
+configure:4376: checking for a BSD-compatible install
+configure:4432: result: /usr/bin/install -c
+configure:4447: checking for bison
+configure:4463: found /usr/sepp/bin/bison
+configure:4474: result: bison -y
+configure:4491: checking for flex
+configure:4507: found /usr/bin/flex
+configure:4518: result: flex
+configure:4555: flex conftest.l
+configure:4558: $? = 0
+configure:4560: checking lex output file root
+configure:4576: result: lex.yy
+configure:4581: checking lex library
+configure:4600: gcc -o conftest -g -O2   conftest.c   >&5
+/tmp/ccz8H5yg.o(.text+0x3d5): In function `yylex':
+/home/landauf/orxonoxv2/ogre-linux_osx-v1-4-5/ogrenew/lex.yy.c:825: undefined reference to `yywrap'
+/tmp/ccz8H5yg.o(.text+0xb3d): In function `input':
+/home/landauf/orxonoxv2/ogre-linux_osx-v1-4-5/ogrenew/lex.yy.c:1118: undefined reference to `yywrap'
+/tmp/ccz8H5yg.o(.text+0x1399): In function `main':
+/home/landauf/orxonoxv2/ogre-linux_osx-v1-4-5/ogrenew/conftest.l:17: undefined reference to `yywrap'
+collect2: ld returned 1 exit status
+configure:4606: $? = 1
+configure: failed program was:
+| 
+| #line 3 "lex.yy.c"
+| 
+| #define  YY_INT_ALIGNED short int
+| 
+| /* A lexical scanner generated by flex */
+| 
+| #define FLEX_SCANNER
+| #define YY_FLEX_MAJOR_VERSION 2
+| #define YY_FLEX_MINOR_VERSION 5
+| #define YY_FLEX_SUBMINOR_VERSION 31
+| #if YY_FLEX_SUBMINOR_VERSION > 0
+| #define FLEX_BETA
+| #endif
+| 
+| /* First, we deal with  platform-specific or compiler-specific issues. */
+| 
+| /* begin standard C headers. */
+| #include <stdio.h>
+| #include <string.h>
+| #include <errno.h>
+| #include <stdlib.h>
+| 
+| /* end standard C headers. */
+| 
+| /* flex integer type definitions */
+| 
+| #ifndef FLEXINT_H
+| #define FLEXINT_H
+| 
+| /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+| 
+| #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+| #include <inttypes.h>
+| typedef int8_t flex_int8_t;
+| typedef uint8_t flex_uint8_t;
+| typedef int16_t flex_int16_t;
+| typedef uint16_t flex_uint16_t;
+| typedef int32_t flex_int32_t;
+| typedef uint32_t flex_uint32_t;
+| #else
+| typedef signed char flex_int8_t;
+| typedef short int flex_int16_t;
+| typedef int flex_int32_t;
+| typedef unsigned char flex_uint8_t; 
+| typedef unsigned short int flex_uint16_t;
+| typedef unsigned int flex_uint32_t;
+| #endif /* ! C99 */
+| 
+| /* Limits of integral types. */
+| #ifndef INT8_MIN
+| #define INT8_MIN               (-128)
+| #endif
+| #ifndef INT16_MIN
+| #define INT16_MIN              (-32767-1)
+| #endif
+| #ifndef INT32_MIN
+| #define INT32_MIN              (-2147483647-1)
+| #endif
+| #ifndef INT8_MAX
+| #define INT8_MAX               (127)
+| #endif
+| #ifndef INT16_MAX
+| #define INT16_MAX              (32767)
+| #endif
+| #ifndef INT32_MAX
+| #define INT32_MAX              (2147483647)
+| #endif
+| #ifndef UINT8_MAX
+| #define UINT8_MAX              (255U)
+| #endif
+| #ifndef UINT16_MAX
+| #define UINT16_MAX             (65535U)
+| #endif
+| #ifndef UINT32_MAX
+| #define UINT32_MAX             (4294967295U)
+| #endif
+| 
+| #endif /* ! FLEXINT_H */
+| 
+| #ifdef __cplusplus
+| 
+| /* The "const" storage-class-modifier is valid. */
+| #define YY_USE_CONST
+| 
+| #else	/* ! __cplusplus */
+| 
+| #if __STDC__
+| 
+| #define YY_USE_CONST
+| 
+| #endif	/* __STDC__ */
+| #endif	/* ! __cplusplus */
+| 
+| #ifdef YY_USE_CONST
+| #define yyconst const
+| #else
+| #define yyconst
+| #endif
+| 
+| /* Returned upon end-of-file. */
+| #define YY_NULL 0
+| 
+| /* Promotes a possibly negative, possibly signed char to an unsigned
+|  * integer for use as an array index.  If the signed char is negative,
+|  * we want to instead treat it as an 8-bit unsigned char, hence the
+|  * double cast.
+|  */
+| #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+| 
+| /* Enter a start condition.  This macro really ought to take a parameter,
+|  * but we do it the disgusting crufty way forced on us by the ()-less
+|  * definition of BEGIN.
+|  */
+| #define BEGIN (yy_start) = 1 + 2 *
+| 
+| /* Translate the current start state into a value that can be later handed
+|  * to BEGIN to return to the state.  The YYSTATE alias is for lex
+|  * compatibility.
+|  */
+| #define YY_START (((yy_start) - 1) / 2)
+| #define YYSTATE YY_START
+| 
+| /* Action number for EOF rule of a given start state. */
+| #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+| 
+| /* Special action meaning "start processing a new file". */
+| #define YY_NEW_FILE yyrestart(yyin  )
+| 
+| #define YY_END_OF_BUFFER_CHAR 0
+| 
+| /* Size of default input buffer. */
+| #ifndef YY_BUF_SIZE
+| #define YY_BUF_SIZE 16384
+| #endif
+| 
+| #ifndef YY_TYPEDEF_YY_BUFFER_STATE
+| #define YY_TYPEDEF_YY_BUFFER_STATE
+| typedef struct yy_buffer_state *YY_BUFFER_STATE;
+| #endif
+| 
+| extern int yyleng;
+| 
+| extern FILE *yyin, *yyout;
+| 
+| #define EOB_ACT_CONTINUE_SCAN 0
+| #define EOB_ACT_END_OF_FILE 1
+| #define EOB_ACT_LAST_MATCH 2
+| 
+|     #define YY_LESS_LINENO(n)
+|     
+| /* Return all but the first "n" matched characters back to the input stream. */
+| #define yyless(n) \
+| 	do \
+| 		{ \
+| 		/* Undo effects of setting up yytext. */ \
+|         int yyless_macro_arg = (n); \
+|         YY_LESS_LINENO(yyless_macro_arg);\
+| 		*yy_cp = (yy_hold_char); \
+| 		YY_RESTORE_YY_MORE_OFFSET \
+| 		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+| 		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+| 		} \
+| 	while ( 0 )
+| 
+| #define unput(c) yyunput( c, (yytext_ptr)  )
+| 
+| /* The following is because we cannot portably get our hands on size_t
+|  * (without autoconf's help, which isn't available because we want
+|  * flex-generated scanners to compile on their own).
+|  */
+| 
+| #ifndef YY_TYPEDEF_YY_SIZE_T
+| #define YY_TYPEDEF_YY_SIZE_T
+| typedef unsigned int yy_size_t;
+| #endif
+| 
+| #ifndef YY_STRUCT_YY_BUFFER_STATE
+| #define YY_STRUCT_YY_BUFFER_STATE
+| struct yy_buffer_state
+| 	{
+| 	FILE *yy_input_file;
+| 
+| 	char *yy_ch_buf;		/* input buffer */
+| 	char *yy_buf_pos;		/* current position in input buffer */
+| 
+| 	/* Size of input buffer in bytes, not including room for EOB
+| 	 * characters.
+| 	 */
+| 	yy_size_t yy_buf_size;
+| 
+| 	/* Number of characters read into yy_ch_buf, not including EOB
+| 	 * characters.
+| 	 */
+| 	int yy_n_chars;
+| 
+| 	/* Whether we "own" the buffer - i.e., we know we created it,
+| 	 * and can realloc() it to grow it, and should free() it to
+| 	 * delete it.
+| 	 */
+| 	int yy_is_our_buffer;
+| 
+| 	/* Whether this is an "interactive" input source; if so, and
+| 	 * if we're using stdio for input, then we want to use getc()
+| 	 * instead of fread(), to make sure we stop fetching input after
+| 	 * each newline.
+| 	 */
+| 	int yy_is_interactive;
+| 
+| 	/* Whether we're considered to be at the beginning of a line.
+| 	 * If so, '^' rules will be active on the next match, otherwise
+| 	 * not.
+| 	 */
+| 	int yy_at_bol;
+| 
+|     int yy_bs_lineno; /**< The line count. */
+|     int yy_bs_column; /**< The column count. */
+|     
+| 	/* Whether to try to fill the input buffer when we reach the
+| 	 * end of it.
+| 	 */
+| 	int yy_fill_buffer;
+| 
+| 	int yy_buffer_status;
+| 
+| #define YY_BUFFER_NEW 0
+| #define YY_BUFFER_NORMAL 1
+| 	/* When an EOF's been seen but there's still some text to process
+| 	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+| 	 * shouldn't try reading from the input source any more.  We might
+| 	 * still have a bunch of tokens to match, though, because of
+| 	 * possible backing-up.
+| 	 *
+| 	 * When we actually see the EOF, we change the status to "new"
+| 	 * (via yyrestart()), so that the user can continue scanning by
+| 	 * just pointing yyin at a new input file.
+| 	 */
+| #define YY_BUFFER_EOF_PENDING 2
+| 
+| 	};
+| #endif /* !YY_STRUCT_YY_BUFFER_STATE */
+| 
+| /* Stack of input buffers. */
+| static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+| static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+| static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
+| 
+| /* We provide macros for accessing buffer states in case in the
+|  * future we want to put the buffer states in a more general
+|  * "scanner state".
+|  *
+|  * Returns the top of the stack, or NULL.
+|  */
+| #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+|                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+|                           : NULL)
+| 
+| /* Same as previous macro, but useful when we know that the buffer stack is not
+|  * NULL or when we need an lvalue. For internal use only.
+|  */
+| #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
+| 
+| /* yy_hold_char holds the character lost when yytext is formed. */
+| static char yy_hold_char;
+| static int yy_n_chars;		/* number of characters read into yy_ch_buf */
+| int yyleng;
+| 
+| /* Points to current character in buffer. */
+| static char *yy_c_buf_p = (char *) 0;
+| static int yy_init = 1;		/* whether we need to initialize */
+| static int yy_start = 0;	/* start state number */
+| 
+| /* Flag which is used to allow yywrap()'s to do buffer switches
+|  * instead of setting up a fresh yyin.  A bit of a hack ...
+|  */
+| static int yy_did_buffer_switch_on_eof;
+| 
+| void yyrestart (FILE *input_file  );
+| void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
+| YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
+| void yy_delete_buffer (YY_BUFFER_STATE b  );
+| void yy_flush_buffer (YY_BUFFER_STATE b  );
+| void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
+| void yypop_buffer_state (void );
+| 
+| static void yyensure_buffer_stack (void );
+| static void yy_load_buffer_state (void );
+| static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
+| 
+| #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
+| 
+| YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
+| YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
+| YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
+| 
+| void *yyalloc (yy_size_t  );
+| void *yyrealloc (void *,yy_size_t  );
+| void yyfree (void *  );
+| 
+| #define yy_new_buffer yy_create_buffer
+| 
+| #define yy_set_interactive(is_interactive) \
+| 	{ \
+| 	if ( ! YY_CURRENT_BUFFER ){ \
+|         yyensure_buffer_stack (); \
+| 		YY_CURRENT_BUFFER_LVALUE =    \
+|             yy_create_buffer(yyin,YY_BUF_SIZE ); \
+| 	} \
+| 	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+| 	}
+| 
+| #define yy_set_bol(at_bol) \
+| 	{ \
+| 	if ( ! YY_CURRENT_BUFFER ){\
+|         yyensure_buffer_stack (); \
+| 		YY_CURRENT_BUFFER_LVALUE =    \
+|             yy_create_buffer(yyin,YY_BUF_SIZE ); \
+| 	} \
+| 	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+| 	}
+| 
+| #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+| 
+| /* Begin user sect3 */
+| 
+| typedef unsigned char YY_CHAR;
+| 
+| FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+| 
+| typedef int yy_state_type;
+| 
+| extern int yylineno;
+| 
+| int yylineno = 1;
+| 
+| extern char *yytext;
+| #define yytext_ptr yytext
+| 
+| static yy_state_type yy_get_previous_state (void );
+| static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
+| static int yy_get_next_buffer (void );
+| static void yy_fatal_error (yyconst char msg[]  );
+| 
+| /* Done after the current pattern has been matched and before the
+|  * corresponding action - sets up yytext.
+|  */
+| #define YY_DO_BEFORE_ACTION \
+| 	(yytext_ptr) = yy_bp; \
+| 	(yytext_ptr) -= (yy_more_len); \
+| 	yyleng = (size_t) (yy_cp - (yytext_ptr)); \
+| 	(yy_hold_char) = *yy_cp; \
+| 	*yy_cp = '\0'; \
+| 	(yy_c_buf_p) = yy_cp;
+| 
+| #define YY_NUM_RULES 8
+| #define YY_END_OF_BUFFER 9
+| /* This struct is not used in this scanner,
+|    but its presence is necessary. */
+| struct yy_trans_info
+| 	{
+| 	flex_int32_t yy_verify;
+| 	flex_int32_t yy_nxt;
+| 	};
+| static yyconst flex_int16_t yy_acclist[23] =
+|     {   0,
+|         9,    7,    8,    8,    1,    7,    8,    2,    7,    8,
+|         3,    7,    8,    4,    7,    8,    5,    7,    8,    6,
+|         7,    8
+|     } ;
+| 
+| static yyconst flex_int16_t yy_accept[14] =
+|     {   0,
+|         1,    1,    1,    2,    4,    5,    8,   11,   14,   17,
+|        20,   23,   23
+|     } ;
+| 
+| static yyconst flex_int32_t yy_ec[256] =
+|     {   0,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    2,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    3,    4,    5,    6,
+| 
+|         7,    8,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+| 
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+|         1,    1,    1,    1,    1
+|     } ;
+| 
+| static yyconst flex_int32_t yy_meta[9] =
+|     {   0,
+|         1,    1,    1,    1,    1,    1,    1,    1
+|     } ;
+| 
+| static yyconst flex_int16_t yy_base[13] =
+|     {   0,
+|         0,    0,    9,   10,   10,   10,   10,   10,   10,   10,
+|        10,   10
+|     } ;
+| 
+| static yyconst flex_int16_t yy_def[13] =
+|     {   0,
+|        12,    1,   12,   12,   12,   12,   12,   12,   12,   12,
+|        12,    0
+|     } ;
+| 
+| static yyconst flex_int16_t yy_nxt[19] =
+|     {   0,
+|         4,    5,    6,    7,    8,    9,   10,   11,   12,    3,
+|        12,   12,   12,   12,   12,   12,   12,   12
+|     } ;
+| 
+| static yyconst flex_int16_t yy_chk[19] =
+|     {   0,
+|         1,    1,    1,    1,    1,    1,    1,    1,    3,   12,
+|        12,   12,   12,   12,   12,   12,   12,   12
+|     } ;
+| 
+| extern int yy_flex_debug;
+| int yy_flex_debug = 0;
+| 
+| static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;
+| static char *yy_full_match;
+| static int yy_lp;
+| #define REJECT \
+| { \
+| *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \
+| yy_cp = (yy_full_match); /* restore poss. backed-over text */ \
+| ++(yy_lp); \
+| goto find_rule; \
+| }
+| 
+| static int yy_more_flag = 0;
+| static int yy_more_len = 0;
+| #define yymore() ((yy_more_flag) = 1)
+| #define YY_MORE_ADJ (yy_more_len)
+| #define YY_RESTORE_YY_MORE_OFFSET
+| char *yytext;
+| #line 1 "conftest.l"
+| #line 460 "lex.yy.c"
+| 
+| #define INITIAL 0
+| 
+| #ifndef YY_NO_UNISTD_H
+| /* Special case for "unistd.h", since it is non-ANSI. We include it way
+|  * down here because we want the user's section 1 to have been scanned first.
+|  * The user has a chance to override it with an option.
+|  */
+| #include <unistd.h>
+| #endif
+| 
+| #ifndef YY_EXTRA_TYPE
+| #define YY_EXTRA_TYPE void *
+| #endif
+| 
+| /* Macros after this point can all be overridden by user definitions in
+|  * section 1.
+|  */
+| 
+| #ifndef YY_SKIP_YYWRAP
+| #ifdef __cplusplus
+| extern "C" int yywrap (void );
+| #else
+| extern int yywrap (void );
+| #endif
+| #endif
+| 
+|     static void yyunput (int c,char *buf_ptr  );
+|     
+| #ifndef yytext_ptr
+| static void yy_flex_strncpy (char *,yyconst char *,int );
+| #endif
+| 
+| #ifdef YY_NEED_STRLEN
+| static int yy_flex_strlen (yyconst char * );
+| #endif
+| 
+| #ifndef YY_NO_INPUT
+| 
+| #ifdef __cplusplus
+| static int yyinput (void );
+| #else
+| static int input (void );
+| #endif
+| 
+| #endif
+| 
+| /* Amount of stuff to slurp up with each read. */
+| #ifndef YY_READ_BUF_SIZE
+| #define YY_READ_BUF_SIZE 8192
+| #endif
+| 
+| /* Copy whatever the last rule matched to the standard output. */
+| #ifndef ECHO
+| /* This used to be an fputs(), but since the string might contain NUL's,
+|  * we now use fwrite().
+|  */
+| #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+| #endif
+| 
+| /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+|  * is returned in "result".
+|  */
+| #ifndef YY_INPUT
+| #define YY_INPUT(buf,result,max_size) \
+| 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+| 		{ \
+| 		int c = '*'; \
+| 		size_t n; \
+| 		for ( n = 0; n < max_size && \
+| 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+| 			buf[n] = (char) c; \
+| 		if ( c == '\n' ) \
+| 			buf[n++] = (char) c; \
+| 		if ( c == EOF && ferror( yyin ) ) \
+| 			YY_FATAL_ERROR( "input in flex scanner failed" ); \
+| 		result = n; \
+| 		} \
+| 	else \
+| 		{ \
+| 		errno=0; \
+| 		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+| 			{ \
+| 			if( errno != EINTR) \
+| 				{ \
+| 				YY_FATAL_ERROR( "input in flex scanner failed" ); \
+| 				break; \
+| 				} \
+| 			errno=0; \
+| 			clearerr(yyin); \
+| 			} \
+| 		}\
+| \
+| 
+| #endif
+| 
+| /* No semi-colon after return; correct usage is to write "yyterminate();" -
+|  * we don't want an extra ';' after the "return" because that will cause
+|  * some compilers to complain about unreachable statements.
+|  */
+| #ifndef yyterminate
+| #define yyterminate() return YY_NULL
+| #endif
+| 
+| /* Number of entries by which start-condition stack grows. */
+| #ifndef YY_START_STACK_INCR
+| #define YY_START_STACK_INCR 25
+| #endif
+| 
+| /* Report a fatal error. */
+| #ifndef YY_FATAL_ERROR
+| #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+| #endif
+| 
+| /* end tables serialization structures and prototypes */
+| 
+| /* Default declaration of generated scanner - a define so the user can
+|  * easily add parameters.
+|  */
+| #ifndef YY_DECL
+| #define YY_DECL_IS_OURS 1
+| 
+| extern int yylex (void);
+| 
+| #define YY_DECL int yylex (void)
+| #endif /* !YY_DECL */
+| 
+| /* Code executed at the beginning of each rule, after yytext and yyleng
+|  * have been set up.
+|  */
+| #ifndef YY_USER_ACTION
+| #define YY_USER_ACTION
+| #endif
+| 
+| /* Code executed at the end of each rule. */
+| #ifndef YY_BREAK
+| #define YY_BREAK break;
+| #endif
+| 
+| #define YY_RULE_SETUP \
+| 	YY_USER_ACTION
+| 
+| /** The main scanner function which does all the work.
+|  */
+| YY_DECL
+| {
+| 	register yy_state_type yy_current_state;
+| 	register char *yy_cp, *yy_bp;
+| 	register int yy_act;
+|     
+| #line 1 "conftest.l"
+| 
+| #line 613 "lex.yy.c"
+| 
+| 	if ( (yy_init) )
+| 		{
+| 		(yy_init) = 0;
+| 
+| #ifdef YY_USER_INIT
+| 		YY_USER_INIT;
+| #endif
+| 
+|         if ( ! (yy_state_buf) )
+|             (yy_state_buf) = (yy_state_type *)yyalloc(((YY_BUF_SIZE + 2) * sizeof(yy_state_type))  );
+| 
+| 		if ( ! (yy_start) )
+| 			(yy_start) = 1;	/* first start state */
+| 
+| 		if ( ! yyin )
+| 			yyin = stdin;
+| 
+| 		if ( ! yyout )
+| 			yyout = stdout;
+| 
+| 		if ( ! YY_CURRENT_BUFFER ) {
+| 			yyensure_buffer_stack ();
+| 			YY_CURRENT_BUFFER_LVALUE =
+| 				yy_create_buffer(yyin,YY_BUF_SIZE );
+| 		}
+| 
+| 		yy_load_buffer_state( );
+| 		}
+| 
+| 	while ( 1 )		/* loops until end-of-file is reached */
+| 		{
+| 		(yy_more_len) = 0;
+| 		if ( (yy_more_flag) )
+| 			{
+| 			(yy_more_len) = (yy_c_buf_p) - (yytext_ptr);
+| 			(yy_more_flag) = 0;
+| 			}
+| 		yy_cp = (yy_c_buf_p);
+| 
+| 		/* Support of yytext. */
+| 		*yy_cp = (yy_hold_char);
+| 
+| 		/* yy_bp points to the position in yy_ch_buf of the start of
+| 		 * the current run.
+| 		 */
+| 		yy_bp = yy_cp;
+| 
+| 		yy_current_state = (yy_start);
+| 
+| 		(yy_state_ptr) = (yy_state_buf);
+| 		*(yy_state_ptr)++ = yy_current_state;
+| 
+| yy_match:
+| 		do
+| 			{
+| 			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+| 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+| 				{
+| 				yy_current_state = (int) yy_def[yy_current_state];
+| 				if ( yy_current_state >= 13 )
+| 					yy_c = yy_meta[(unsigned int) yy_c];
+| 				}
+| 			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+| 			*(yy_state_ptr)++ = yy_current_state;
+| 			++yy_cp;
+| 			}
+| 		while ( yy_base[yy_current_state] != 10 );
+| 
+| yy_find_action:
+| 		yy_current_state = *--(yy_state_ptr);
+| 		(yy_lp) = yy_accept[yy_current_state];
+| find_rule: /* we branch to this label when backing up */
+| 		for ( ; ; ) /* until we find what rule we matched */
+| 			{
+| 			if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
+| 				{
+| 				yy_act = yy_acclist[(yy_lp)];
+| 					{
+| 					(yy_full_match) = yy_cp;
+| 					break;
+| 					}
+| 				}
+| 			--yy_cp;
+| 			yy_current_state = *--(yy_state_ptr);
+| 			(yy_lp) = yy_accept[yy_current_state];
+| 			}
+| 
+| 		YY_DO_BEFORE_ACTION;
+| 
+| do_action:	/* This label is used only to access EOF actions. */
+| 
+| 		switch ( yy_act )
+| 	{ /* beginning of action switch */
+| case 1:
+| YY_RULE_SETUP
+| #line 2 "conftest.l"
+| { ECHO; }
+| 	YY_BREAK
+| case 2:
+| YY_RULE_SETUP
+| #line 3 "conftest.l"
+| { REJECT; }
+| 	YY_BREAK
+| case 3:
+| YY_RULE_SETUP
+| #line 4 "conftest.l"
+| { yymore (); }
+| 	YY_BREAK
+| case 4:
+| YY_RULE_SETUP
+| #line 5 "conftest.l"
+| { yyless (1); }
+| 	YY_BREAK
+| case 5:
+| YY_RULE_SETUP
+| #line 6 "conftest.l"
+| { yyless (input () != 0); }
+| 	YY_BREAK
+| case 6:
+| YY_RULE_SETUP
+| #line 7 "conftest.l"
+| { unput (yytext[0]); }
+| 	YY_BREAK
+| case 7:
+| YY_RULE_SETUP
+| #line 8 "conftest.l"
+| { BEGIN INITIAL; }
+| 	YY_BREAK
+| case 8:
+| YY_RULE_SETUP
+| #line 9 "conftest.l"
+| ECHO;
+| 	YY_BREAK
+| #line 748 "lex.yy.c"
+| 			case YY_STATE_EOF(INITIAL):
+| 				yyterminate();
+| 
+| 	case YY_END_OF_BUFFER:
+| 		{
+| 		/* Amount of text matched not including the EOB char. */
+| 		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+| 
+| 		/* Undo the effects of YY_DO_BEFORE_ACTION. */
+| 		*yy_cp = (yy_hold_char);
+| 		YY_RESTORE_YY_MORE_OFFSET
+| 
+| 		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+| 			{
+| 			/* We're scanning a new file or input source.  It's
+| 			 * possible that this happened because the user
+| 			 * just pointed yyin at a new source and called
+| 			 * yylex().  If so, then we have to assure
+| 			 * consistency between YY_CURRENT_BUFFER and our
+| 			 * globals.  Here is the right place to do so, because
+| 			 * this is the first action (other than possibly a
+| 			 * back-up) that will match for the new input source.
+| 			 */
+| 			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+| 			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+| 			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+| 			}
+| 
+| 		/* Note that here we test for yy_c_buf_p "<=" to the position
+| 		 * of the first EOB in the buffer, since yy_c_buf_p will
+| 		 * already have been incremented past the NUL character
+| 		 * (since all states make transitions on EOB to the
+| 		 * end-of-buffer state).  Contrast this with the test
+| 		 * in input().
+| 		 */
+| 		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+| 			{ /* This was really a NUL. */
+| 			yy_state_type yy_next_state;
+| 
+| 			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+| 
+| 			yy_current_state = yy_get_previous_state(  );
+| 
+| 			/* Okay, we're now positioned to make the NUL
+| 			 * transition.  We couldn't have
+| 			 * yy_get_previous_state() go ahead and do it
+| 			 * for us because it doesn't know how to deal
+| 			 * with the possibility of jamming (and we don't
+| 			 * want to build jamming into it because then it
+| 			 * will run more slowly).
+| 			 */
+| 
+| 			yy_next_state = yy_try_NUL_trans( yy_current_state );
+| 
+| 			yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+| 
+| 			if ( yy_next_state )
+| 				{
+| 				/* Consume the NUL. */
+| 				yy_cp = ++(yy_c_buf_p);
+| 				yy_current_state = yy_next_state;
+| 				goto yy_match;
+| 				}
+| 
+| 			else
+| 				{
+| 				yy_cp = (yy_c_buf_p);
+| 				goto yy_find_action;
+| 				}
+| 			}
+| 
+| 		else switch ( yy_get_next_buffer(  ) )
+| 			{
+| 			case EOB_ACT_END_OF_FILE:
+| 				{
+| 				(yy_did_buffer_switch_on_eof) = 0;
+| 
+| 				if ( yywrap( ) )
+| 					{
+| 					/* Note: because we've taken care in
+| 					 * yy_get_next_buffer() to have set up
+| 					 * yytext, we can now set up
+| 					 * yy_c_buf_p so that if some total
+| 					 * hoser (like flex itself) wants to
+| 					 * call the scanner after we return the
+| 					 * YY_NULL, it'll still work - another
+| 					 * YY_NULL will get returned.
+| 					 */
+| 					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+| 
+| 					yy_act = YY_STATE_EOF(YY_START);
+| 					goto do_action;
+| 					}
+| 
+| 				else
+| 					{
+| 					if ( ! (yy_did_buffer_switch_on_eof) )
+| 						YY_NEW_FILE;
+| 					}
+| 				break;
+| 				}
+| 
+| 			case EOB_ACT_CONTINUE_SCAN:
+| 				(yy_c_buf_p) =
+| 					(yytext_ptr) + yy_amount_of_matched_text;
+| 
+| 				yy_current_state = yy_get_previous_state(  );
+| 
+| 				yy_cp = (yy_c_buf_p);
+| 				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+| 				goto yy_match;
+| 
+| 			case EOB_ACT_LAST_MATCH:
+| 				(yy_c_buf_p) =
+| 				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+| 
+| 				yy_current_state = yy_get_previous_state(  );
+| 
+| 				yy_cp = (yy_c_buf_p);
+| 				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+| 				goto yy_find_action;
+| 			}
+| 		break;
+| 		}
+| 
+| 	default:
+| 		YY_FATAL_ERROR(
+| 			"fatal flex scanner internal error--no action found" );
+| 	} /* end of action switch */
+| 		} /* end of scanning one token */
+| } /* end of yylex */
+| 
+| /* yy_get_next_buffer - try to read in a new buffer
+|  *
+|  * Returns a code representing an action:
+|  *	EOB_ACT_LAST_MATCH -
+|  *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+|  *	EOB_ACT_END_OF_FILE - end of file
+|  */
+| static int yy_get_next_buffer (void)
+| {
+|     	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+| 	register char *source = (yytext_ptr);
+| 	register int number_to_move, i;
+| 	int ret_val;
+| 
+| 	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+| 		YY_FATAL_ERROR(
+| 		"fatal flex scanner internal error--end of buffer missed" );
+| 
+| 	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+| 		{ /* Don't try to fill the buffer, so this is an EOF. */
+| 		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+| 			{
+| 			/* We matched a single character, the EOB, so
+| 			 * treat this as a final EOF.
+| 			 */
+| 			return EOB_ACT_END_OF_FILE;
+| 			}
+| 
+| 		else
+| 			{
+| 			/* We matched some text prior to the EOB, first
+| 			 * process it.
+| 			 */
+| 			return EOB_ACT_LAST_MATCH;
+| 			}
+| 		}
+| 
+| 	/* Try to read more data. */
+| 
+| 	/* First move last chars to start of buffer. */
+| 	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+| 
+| 	for ( i = 0; i < number_to_move; ++i )
+| 		*(dest++) = *(source++);
+| 
+| 	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+| 		/* don't do the read, it's not guaranteed to return an EOF,
+| 		 * just force an EOF
+| 		 */
+| 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+| 
+| 	else
+| 		{
+| 			size_t num_to_read =
+| 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+| 
+| 		while ( num_to_read <= 0 )
+| 			{ /* Not enough room in the buffer - grow it. */
+| 
+| 			YY_FATAL_ERROR(
+| "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+| 
+| 			}
+| 
+| 		if ( num_to_read > YY_READ_BUF_SIZE )
+| 			num_to_read = YY_READ_BUF_SIZE;
+| 
+| 		/* Read in more data. */
+| 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+| 			(yy_n_chars), num_to_read );
+| 
+| 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+| 		}
+| 
+| 	if ( (yy_n_chars) == 0 )
+| 		{
+| 		if ( number_to_move == YY_MORE_ADJ )
+| 			{
+| 			ret_val = EOB_ACT_END_OF_FILE;
+| 			yyrestart(yyin  );
+| 			}
+| 
+| 		else
+| 			{
+| 			ret_val = EOB_ACT_LAST_MATCH;
+| 			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+| 				YY_BUFFER_EOF_PENDING;
+| 			}
+| 		}
+| 
+| 	else
+| 		ret_val = EOB_ACT_CONTINUE_SCAN;
+| 
+| 	(yy_n_chars) += number_to_move;
+| 	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+| 	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+| 
+| 	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+| 
+| 	return ret_val;
+| }
+| 
+| /* yy_get_previous_state - get the state just before the EOB char was reached */
+| 
+|     static yy_state_type yy_get_previous_state (void)
+| {
+| 	register yy_state_type yy_current_state;
+| 	register char *yy_cp;
+|     
+| 	yy_current_state = (yy_start);
+| 
+| 	(yy_state_ptr) = (yy_state_buf);
+| 	*(yy_state_ptr)++ = yy_current_state;
+| 
+| 	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+| 		{
+| 		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+| 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+| 			{
+| 			yy_current_state = (int) yy_def[yy_current_state];
+| 			if ( yy_current_state >= 13 )
+| 				yy_c = yy_meta[(unsigned int) yy_c];
+| 			}
+| 		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+| 		*(yy_state_ptr)++ = yy_current_state;
+| 		}
+| 
+| 	return yy_current_state;
+| }
+| 
+| /* yy_try_NUL_trans - try to make a transition on the NUL character
+|  *
+|  * synopsis
+|  *	next_state = yy_try_NUL_trans( current_state );
+|  */
+|     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
+| {
+| 	register int yy_is_jam;
+|     
+| 	register YY_CHAR yy_c = 1;
+| 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+| 		{
+| 		yy_current_state = (int) yy_def[yy_current_state];
+| 		if ( yy_current_state >= 13 )
+| 			yy_c = yy_meta[(unsigned int) yy_c];
+| 		}
+| 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+| 	yy_is_jam = (yy_current_state == 12);
+| 	if ( ! yy_is_jam )
+| 		*(yy_state_ptr)++ = yy_current_state;
+| 
+| 	return yy_is_jam ? 0 : yy_current_state;
+| }
+| 
+|     static void yyunput (int c, register char * yy_bp )
+| {
+| 	register char *yy_cp;
+|     
+|     yy_cp = (yy_c_buf_p);
+| 
+| 	/* undo effects of setting up yytext */
+| 	*yy_cp = (yy_hold_char);
+| 
+| 	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+| 		{ /* need to shift things up to make room */
+| 		/* +2 for EOB chars. */
+| 		register int number_to_move = (yy_n_chars) + 2;
+| 		register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+| 					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
+| 		register char *source =
+| 				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+| 
+| 		while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+| 			*--dest = *--source;
+| 
+| 		yy_cp += (int) (dest - source);
+| 		yy_bp += (int) (dest - source);
+| 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+| 			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+| 
+| 		if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+| 			YY_FATAL_ERROR( "flex scanner push-back overflow" );
+| 		}
+| 
+| 	*--yy_cp = (char) c;
+| 
+| 	(yytext_ptr) = yy_bp;
+| 	(yy_hold_char) = *yy_cp;
+| 	(yy_c_buf_p) = yy_cp;
+| }
+| 
+| #ifndef YY_NO_INPUT
+| #ifdef __cplusplus
+|     static int yyinput (void)
+| #else
+|     static int input  (void)
+| #endif
+| 
+| {
+| 	int c;
+|     
+| 	*(yy_c_buf_p) = (yy_hold_char);
+| 
+| 	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+| 		{
+| 		/* yy_c_buf_p now points to the character we want to return.
+| 		 * If this occurs *before* the EOB characters, then it's a
+| 		 * valid NUL; if not, then we've hit the end of the buffer.
+| 		 */
+| 		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+| 			/* This was really a NUL. */
+| 			*(yy_c_buf_p) = '\0';
+| 
+| 		else
+| 			{ /* need more input */
+| 			int offset = (yy_c_buf_p) - (yytext_ptr);
+| 			++(yy_c_buf_p);
+| 
+| 			switch ( yy_get_next_buffer(  ) )
+| 				{
+| 				case EOB_ACT_LAST_MATCH:
+| 					/* This happens because yy_g_n_b()
+| 					 * sees that we've accumulated a
+| 					 * token and flags that we need to
+| 					 * try matching the token before
+| 					 * proceeding.  But for input(),
+| 					 * there's no matching to consider.
+| 					 * So convert the EOB_ACT_LAST_MATCH
+| 					 * to EOB_ACT_END_OF_FILE.
+| 					 */
+| 
+| 					/* Reset buffer status. */
+| 					yyrestart(yyin );
+| 
+| 					/*FALLTHROUGH*/
+| 
+| 				case EOB_ACT_END_OF_FILE:
+| 					{
+| 					if ( yywrap( ) )
+| 						return EOF;
+| 
+| 					if ( ! (yy_did_buffer_switch_on_eof) )
+| 						YY_NEW_FILE;
+| #ifdef __cplusplus
+| 					return yyinput();
+| #else
+| 					return input();
+| #endif
+| 					}
+| 
+| 				case EOB_ACT_CONTINUE_SCAN:
+| 					(yy_c_buf_p) = (yytext_ptr) + offset;
+| 					break;
+| 				}
+| 			}
+| 		}
+| 
+| 	c = *(unsigned char *) (yy_c_buf_p);	/* cast for 8-bit char's */
+| 	*(yy_c_buf_p) = '\0';	/* preserve yytext */
+| 	(yy_hold_char) = *++(yy_c_buf_p);
+| 
+| 	return c;
+| }
+| #endif	/* ifndef YY_NO_INPUT */
+| 
+| /** Immediately switch to a different input stream.
+|  * @param input_file A readable stream.
+|  * 
+|  * @note This function does not reset the start condition to @c INITIAL .
+|  */
+|     void yyrestart  (FILE * input_file )
+| {
+|     
+| 	if ( ! YY_CURRENT_BUFFER ){
+|         yyensure_buffer_stack ();
+| 		YY_CURRENT_BUFFER_LVALUE =
+|             yy_create_buffer(yyin,YY_BUF_SIZE );
+| 	}
+| 
+| 	yy_init_buffer(YY_CURRENT_BUFFER,input_file );
+| 	yy_load_buffer_state( );
+| }
+| 
+| /** Switch to a different input buffer.
+|  * @param new_buffer The new input buffer.
+|  * 
+|  */
+|     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
+| {
+|     
+| 	/* TODO. We should be able to replace this entire function body
+| 	 * with
+| 	 *		yypop_buffer_state();
+| 	 *		yypush_buffer_state(new_buffer);
+|      */
+| 	yyensure_buffer_stack ();
+| 	if ( YY_CURRENT_BUFFER == new_buffer )
+| 		return;
+| 
+| 	if ( YY_CURRENT_BUFFER )
+| 		{
+| 		/* Flush out information for old buffer. */
+| 		*(yy_c_buf_p) = (yy_hold_char);
+| 		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+| 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+| 		}
+| 
+| 	YY_CURRENT_BUFFER_LVALUE = new_buffer;
+| 	yy_load_buffer_state( );
+| 
+| 	/* We don't actually know whether we did this switch during
+| 	 * EOF (yywrap()) processing, but the only time this flag
+| 	 * is looked at is after yywrap() is called, so it's safe
+| 	 * to go ahead and always set it.
+| 	 */
+| 	(yy_did_buffer_switch_on_eof) = 1;
+| }
+| 
+| static void yy_load_buffer_state  (void)
+| {
+|     	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+| 	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+| 	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+| 	(yy_hold_char) = *(yy_c_buf_p);
+| }
+| 
+| /** Allocate and initialize an input buffer state.
+|  * @param file A readable stream.
+|  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+|  * 
+|  * @return the allocated buffer state.
+|  */
+|     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
+| {
+| 	YY_BUFFER_STATE b;
+|     
+| 	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
+| 	if ( ! b )
+| 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+| 
+| 	b->yy_buf_size = size;
+| 
+| 	/* yy_ch_buf has to be 2 characters longer than the size given because
+| 	 * we need to put in 2 end-of-buffer characters.
+| 	 */
+| 	b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
+| 	if ( ! b->yy_ch_buf )
+| 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+| 
+| 	b->yy_is_our_buffer = 1;
+| 
+| 	yy_init_buffer(b,file );
+| 
+| 	return b;
+| }
+| 
+| /** Destroy the buffer.
+|  * @param b a buffer created with yy_create_buffer()
+|  * 
+|  */
+|     void yy_delete_buffer (YY_BUFFER_STATE  b )
+| {
+|     
+| 	if ( ! b )
+| 		return;
+| 
+| 	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+| 		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+| 
+| 	if ( b->yy_is_our_buffer )
+| 		yyfree((void *) b->yy_ch_buf  );
+| 
+| 	yyfree((void *) b  );
+| }
+| 
+| #ifndef __cplusplus
+| extern int isatty (int );
+| #endif /* __cplusplus */
+|     
+| /* Initializes or reinitializes a buffer.
+|  * This function is sometimes called more than once on the same buffer,
+|  * such as during a yyrestart() or at EOF.
+|  */
+|     static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
+| 
+| {
+| 	int oerrno = errno;
+|     
+| 	yy_flush_buffer(b );
+| 
+| 	b->yy_input_file = file;
+| 	b->yy_fill_buffer = 1;
+| 
+|     /* If b is the current buffer, then yy_init_buffer was _probably_
+|      * called from yyrestart() or through yy_get_next_buffer.
+|      * In that case, we don't want to reset the lineno or column.
+|      */
+|     if (b != YY_CURRENT_BUFFER){
+|         b->yy_bs_lineno = 1;
+|         b->yy_bs_column = 0;
+|     }
+| 
+|         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+|     
+| 	errno = oerrno;
+| }
+| 
+| /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+|  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+|  * 
+|  */
+|     void yy_flush_buffer (YY_BUFFER_STATE  b )
+| {
+|     	if ( ! b )
+| 		return;
+| 
+| 	b->yy_n_chars = 0;
+| 
+| 	/* We always need two end-of-buffer characters.  The first causes
+| 	 * a transition to the end-of-buffer state.  The second causes
+| 	 * a jam in that state.
+| 	 */
+| 	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+| 	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+| 
+| 	b->yy_buf_pos = &b->yy_ch_buf[0];
+| 
+| 	b->yy_at_bol = 1;
+| 	b->yy_buffer_status = YY_BUFFER_NEW;
+| 
+| 	if ( b == YY_CURRENT_BUFFER )
+| 		yy_load_buffer_state( );
+| }
+| 
+| /** Pushes the new state onto the stack. The new state becomes
+|  *  the current state. This function will allocate the stack
+|  *  if necessary.
+|  *  @param new_buffer The new state.
+|  *  
+|  */
+| void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
+| {
+|     	if (new_buffer == NULL)
+| 		return;
+| 
+| 	yyensure_buffer_stack();
+| 
+| 	/* This block is copied from yy_switch_to_buffer. */
+| 	if ( YY_CURRENT_BUFFER )
+| 		{
+| 		/* Flush out information for old buffer. */
+| 		*(yy_c_buf_p) = (yy_hold_char);
+| 		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+| 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+| 		}
+| 
+| 	/* Only push if top exists. Otherwise, replace top. */
+| 	if (YY_CURRENT_BUFFER)
+| 		(yy_buffer_stack_top)++;
+| 	YY_CURRENT_BUFFER_LVALUE = new_buffer;
+| 
+| 	/* copied from yy_switch_to_buffer. */
+| 	yy_load_buffer_state( );
+| 	(yy_did_buffer_switch_on_eof) = 1;
+| }
+| 
+| /** Removes and deletes the top of the stack, if present.
+|  *  The next element becomes the new top.
+|  *  
+|  */
+| void yypop_buffer_state (void)
+| {
+|     	if (!YY_CURRENT_BUFFER)
+| 		return;
+| 
+| 	yy_delete_buffer(YY_CURRENT_BUFFER );
+| 	YY_CURRENT_BUFFER_LVALUE = NULL;
+| 	if ((yy_buffer_stack_top) > 0)
+| 		--(yy_buffer_stack_top);
+| 
+| 	if (YY_CURRENT_BUFFER) {
+| 		yy_load_buffer_state( );
+| 		(yy_did_buffer_switch_on_eof) = 1;
+| 	}
+| }
+| 
+| /* Allocates the stack if it does not exist.
+|  *  Guarantees space for at least one push.
+|  */
+| static void yyensure_buffer_stack (void)
+| {
+| 	int num_to_alloc;
+|     
+| 	if (!(yy_buffer_stack)) {
+| 
+| 		/* First allocation is just for 2 elements, since we don't know if this
+| 		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
+| 		 * immediate realloc on the next call.
+|          */
+| 		num_to_alloc = 1;
+| 		(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+| 								(num_to_alloc * sizeof(struct yy_buffer_state*)
+| 								);
+| 		
+| 		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+| 				
+| 		(yy_buffer_stack_max) = num_to_alloc;
+| 		(yy_buffer_stack_top) = 0;
+| 		return;
+| 	}
+| 
+| 	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+| 
+| 		/* Increase the buffer to prepare for a possible push. */
+| 		int grow_size = 8 /* arbitrary grow size */;
+| 
+| 		num_to_alloc = (yy_buffer_stack_max) + grow_size;
+| 		(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
+| 								((yy_buffer_stack),
+| 								num_to_alloc * sizeof(struct yy_buffer_state*)
+| 								);
+| 
+| 		/* zero only the new slots.*/
+| 		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+| 		(yy_buffer_stack_max) = num_to_alloc;
+| 	}
+| }
+| 
+| /** Setup the input buffer state to scan directly from a user-specified character buffer.
+|  * @param base the character buffer
+|  * @param size the size in bytes of the character buffer
+|  * 
+|  * @return the newly allocated buffer state object. 
+|  */
+| YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
+| {
+| 	YY_BUFFER_STATE b;
+|     
+| 	if ( size < 2 ||
+| 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
+| 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
+| 		/* They forgot to leave room for the EOB's. */
+| 		return 0;
+| 
+| 	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
+| 	if ( ! b )
+| 		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+| 
+| 	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
+| 	b->yy_buf_pos = b->yy_ch_buf = base;
+| 	b->yy_is_our_buffer = 0;
+| 	b->yy_input_file = 0;
+| 	b->yy_n_chars = b->yy_buf_size;
+| 	b->yy_is_interactive = 0;
+| 	b->yy_at_bol = 1;
+| 	b->yy_fill_buffer = 0;
+| 	b->yy_buffer_status = YY_BUFFER_NEW;
+| 
+| 	yy_switch_to_buffer(b  );
+| 
+| 	return b;
+| }
+| 
+| /** Setup the input buffer state to scan a string. The next call to yylex() will
+|  * scan from a @e copy of @a str.
+|  * @param str a NUL-terminated string to scan
+|  * 
+|  * @return the newly allocated buffer state object.
+|  * @note If you want to scan bytes that may contain NUL values, then use
+|  *       yy_scan_bytes() instead.
+|  */
+| YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str )
+| {
+|     
+| 	return yy_scan_bytes(yy_str,strlen(yy_str) );
+| }
+| 
+| /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
+|  * scan from a @e copy of @a bytes.
+|  * @param bytes the byte buffer to scan
+|  * @param len the number of bytes in the buffer pointed to by @a bytes.
+|  * 
+|  * @return the newly allocated buffer state object.
+|  */
+| YY_BUFFER_STATE yy_scan_bytes  (yyconst char * bytes, int  len )
+| {
+| 	YY_BUFFER_STATE b;
+| 	char *buf;
+| 	yy_size_t n;
+| 	int i;
+|     
+| 	/* Get memory for full buffer, including space for trailing EOB's. */
+| 	n = len + 2;
+| 	buf = (char *) yyalloc(n  );
+| 	if ( ! buf )
+| 		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+| 
+| 	for ( i = 0; i < len; ++i )
+| 		buf[i] = bytes[i];
+| 
+| 	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+| 
+| 	b = yy_scan_buffer(buf,n );
+| 	if ( ! b )
+| 		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+| 
+| 	/* It's okay to grow etc. this buffer, and we should throw it
+| 	 * away when we're done.
+| 	 */
+| 	b->yy_is_our_buffer = 1;
+| 
+| 	return b;
+| }
+| 
+| #ifndef YY_EXIT_FAILURE
+| #define YY_EXIT_FAILURE 2
+| #endif
+| 
+| static void yy_fatal_error (yyconst char* msg )
+| {
+|     	(void) fprintf( stderr, "%s\n", msg );
+| 	exit( YY_EXIT_FAILURE );
+| }
+| 
+| /* Redefine yyless() so it works in section 3 code. */
+| 
+| #undef yyless
+| #define yyless(n) \
+| 	do \
+| 		{ \
+| 		/* Undo effects of setting up yytext. */ \
+|         int yyless_macro_arg = (n); \
+|         YY_LESS_LINENO(yyless_macro_arg);\
+| 		yytext[yyleng] = (yy_hold_char); \
+| 		(yy_c_buf_p) = yytext + yyless_macro_arg; \
+| 		(yy_hold_char) = *(yy_c_buf_p); \
+| 		*(yy_c_buf_p) = '\0'; \
+| 		yyleng = yyless_macro_arg; \
+| 		} \
+| 	while ( 0 )
+| 
+| /* Accessor  methods (get/set functions) to struct members. */
+| 
+| /** Get the current line number.
+|  * 
+|  */
+| int yyget_lineno  (void)
+| {
+|         
+|     return yylineno;
+| }
+| 
+| /** Get the input stream.
+|  * 
+|  */
+| FILE *yyget_in  (void)
+| {
+|         return yyin;
+| }
+| 
+| /** Get the output stream.
+|  * 
+|  */
+| FILE *yyget_out  (void)
+| {
+|         return yyout;
+| }
+| 
+| /** Get the length of the current token.
+|  * 
+|  */
+| int yyget_leng  (void)
+| {
+|         return yyleng;
+| }
+| 
+| /** Get the current token.
+|  * 
+|  */
+| 
+| char *yyget_text  (void)
+| {
+|         return yytext;
+| }
+| 
+| /** Set the current line number.
+|  * @param line_number
+|  * 
+|  */
+| void yyset_lineno (int  line_number )
+| {
+|     
+|     yylineno = line_number;
+| }
+| 
+| /** Set the input stream. This does not discard the current
+|  * input buffer.
+|  * @param in_str A readable stream.
+|  * 
+|  * @see yy_switch_to_buffer
+|  */
+| void yyset_in (FILE *  in_str )
+| {
+|         yyin = in_str ;
+| }
+| 
+| void yyset_out (FILE *  out_str )
+| {
+|         yyout = out_str ;
+| }
+| 
+| int yyget_debug  (void)
+| {
+|         return yy_flex_debug;
+| }
+| 
+| void yyset_debug (int  bdebug )
+| {
+|         yy_flex_debug = bdebug ;
+| }
+| 
+| /* yylex_destroy is for both reentrant and non-reentrant scanners. */
+| int yylex_destroy  (void)
+| {
+|     
+|     /* Pop the buffer stack, destroying each element. */
+| 	while(YY_CURRENT_BUFFER){
+| 		yy_delete_buffer(YY_CURRENT_BUFFER  );
+| 		YY_CURRENT_BUFFER_LVALUE = NULL;
+| 		yypop_buffer_state();
+| 	}
+| 
+| 	/* Destroy the stack itself. */
+| 	yyfree((yy_buffer_stack) );
+| 	(yy_buffer_stack) = NULL;
+| 
+|     yyfree ( (yy_state_buf) );
+| 
+|     return 0;
+| }
+| 
+| /*
+|  * Internal utility routines.
+|  */
+| 
+| #ifndef yytext_ptr
+| static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+| {
+| 	register int i;
+|     	for ( i = 0; i < n; ++i )
+| 		s1[i] = s2[i];
+| }
+| #endif
+| 
+| #ifdef YY_NEED_STRLEN
+| static int yy_flex_strlen (yyconst char * s )
+| {
+| 	register int n;
+|     	for ( n = 0; s[n]; ++n )
+| 		;
+| 
+| 	return n;
+| }
+| #endif
+| 
+| void *yyalloc (yy_size_t  size )
+| {
+| 	return (void *) malloc( size );
+| }
+| 
+| void *yyrealloc  (void * ptr, yy_size_t  size )
+| {
+| 	/* The cast to (char *) in the following accommodates both
+| 	 * implementations that use char* generic pointers, and those
+| 	 * that use void* generic pointers.  It works with the latter
+| 	 * because both ANSI C and C++ allow castless assignment from
+| 	 * any pointer type to void*, and deal with argument conversions
+| 	 * as though doing an assignment.
+| 	 */
+| 	return (void *) realloc( (char *) ptr, size );
+| }
+| 
+| void yyfree (void * ptr )
+| {
+| 	free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
+| }
+| 
+| #define YYTABLES_NAME "yytables"
+| 
+| #undef YY_NEW_FILE
+| #undef YY_FLUSH_BUFFER
+| #undef yy_set_bol
+| #undef yy_new_buffer
+| #undef yy_set_interactive
+| #undef yytext_ptr
+| #undef YY_DO_BEFORE_ACTION
+| 
+| #ifdef YY_DECL_IS_OURS
+| #undef YY_DECL_IS_OURS
+| #undef YY_DECL
+| #endif
+| #line 9 "conftest.l"
+| 
+| 
+| #ifdef YYTEXT_POINTER
+| extern char *yytext;
+| #endif
+| int
+| main (void)
+| {
+|   return ! yylex () + ! yywrap ();
+| }
+configure:4600: gcc -o conftest -g -O2   conftest.c -lfl  >&5
+configure:4606: $? = 0
+configure:4627: result: -lfl
+configure:4633: checking whether yytext is a pointer
+configure:4654: gcc -o conftest -g -O2   conftest.c -lfl  >&5
+configure:4660: $? = 0
+configure:4679: result: yes
+configure:4924: checking for a sed that does not truncate output
+configure:4978: result: /bin/sed
+configure:4981: checking for grep that handles long lines and -e
+configure:5055: result: /bin/grep
+configure:5060: checking for egrep
+configure:5138: result: /bin/grep -E
+configure:5154: checking for ld used by gcc
+configure:5221: result: /usr/bin/ld
+configure:5230: checking if the linker (/usr/bin/ld) is GNU ld
+configure:5245: result: yes
+configure:5250: checking for /usr/bin/ld option to reload object files
+configure:5257: result: -r
+configure:5275: checking for BSD-compatible nm
+configure:5317: result: /usr/bin/nm -B
+configure:5321: checking whether ln -s works
+configure:5325: result: yes
+configure:5332: checking how to recognise dependent libraries
+configure:5504: result: pass_all
+configure:5714: checking how to run the C preprocessor
+configure:5754: gcc -E  conftest.c
+configure:5760: $? = 0
+configure:5791: gcc -E  conftest.c
+conftest.c:11:28: ac_nonexistent.h: No such file or directory
+configure:5797: $? = 1
+configure: failed program was:
+| /* confdefs.h.  */
+| #define PACKAGE_NAME "OGRE"
+| #define PACKAGE_TARNAME "ogre"
+| #define PACKAGE_VERSION "1.4.5"
+| #define PACKAGE_STRING "OGRE 1.4.5"
+| #define PACKAGE_BUGREPORT ""
+| #define PACKAGE "OGRE"
+| #define VERSION "1.4.5"
+| #define YYTEXT_POINTER 1
+| /* end confdefs.h.  */
+| #include <ac_nonexistent.h>
+configure:5830: result: gcc -E
+configure:5859: gcc -E  conftest.c
+configure:5865: $? = 0
+configure:5896: gcc -E  conftest.c
+conftest.c:11:28: ac_nonexistent.h: No such file or directory
+configure:5902: $? = 1
+configure: failed program was:
+| /* confdefs.h.  */
+| #define PACKAGE_NAME "OGRE"
+| #define PACKAGE_TARNAME "ogre"
+| #define PACKAGE_VERSION "1.4.5"
+| #define PACKAGE_STRING "OGRE 1.4.5"
+| #define PACKAGE_BUGREPORT ""
+| #define PACKAGE "OGRE"
+| #define VERSION "1.4.5"
+| #define YYTEXT_POINTER 1
+| /* end confdefs.h.  */
+| #include <ac_nonexistent.h>
+configure:5940: checking for ANSI C header files
+configure:5970: gcc -c -g -O2  conftest.c >&5
+configure:5976: $? = 0
+configure:6072: gcc -o conftest -g -O2   conftest.c  >&5
+configure:6075: $? = 0
+configure:6081: ./conftest
+configure:6084: $? = 0
+configure:6101: result: yes
+configure:6125: checking for sys/types.h
+configure:6146: gcc -c -g -O2  conftest.c >&5
+configure:6152: $? = 0
+configure:6168: result: yes
+configure:6125: checking for sys/stat.h
+configure:6146: gcc -c -g -O2  conftest.c >&5
+configure:6152: $? = 0
+configure:6168: result: yes
+configure:6125: checking for stdlib.h
+configure:6146: gcc -c -g -O2  conftest.c >&5
+configure:6152: $? = 0
+configure:6168: result: yes
+configure:6125: checking for string.h
+configure:6146: gcc -c -g -O2  conftest.c >&5
+configure:6152: $? = 0
+configure:6168: result: yes
+configure:6125: checking for memory.h
+configure:6146: gcc -c -g -O2  conftest.c >&5
+configure:6152: $? = 0
+configure:6168: result: yes
+configure:6125: checking for strings.h
+configure:6146: gcc -c -g -O2  conftest.c >&5
+configure:6152: $? = 0
+configure:6168: result: yes
+configure:6125: checking for inttypes.h
+configure:6146: gcc -c -g -O2  conftest.c >&5
+configure:6152: $? = 0
+configure:6168: result: yes
+configure:6125: checking for stdint.h
+configure:6146: gcc -c -g -O2  conftest.c >&5
+configure:6152: $? = 0
+configure:6168: result: yes
+configure:6125: checking for unistd.h
+configure:6146: gcc -c -g -O2  conftest.c >&5
+configure:6152: $? = 0
+configure:6168: result: yes
+configure:6195: checking dlfcn.h usability
+configure:6212: gcc -c -g -O2  conftest.c >&5
+configure:6218: $? = 0
+configure:6232: result: yes
+configure:6236: checking dlfcn.h presence
+configure:6251: gcc -E  conftest.c
+configure:6257: $? = 0
+configure:6271: result: yes
+configure:6299: checking for dlfcn.h
+configure:6307: result: yes
+configure:6330: checking how to run the C++ preprocessor
+configure:6366: g++ -E  conftest.cpp
+configure:6372: $? = 0
+configure:6403: g++ -E  conftest.cpp
+conftest.cpp:22:28: ac_nonexistent.h: No such file or directory
+configure:6409: $? = 1
+configure: failed program was:
+| /* confdefs.h.  */
+| #define PACKAGE_NAME "OGRE"
+| #define PACKAGE_TARNAME "ogre"
+| #define PACKAGE_VERSION "1.4.5"
+| #define PACKAGE_STRING "OGRE 1.4.5"
+| #define PACKAGE_BUGREPORT ""
+| #define PACKAGE "OGRE"
+| #define VERSION "1.4.5"
+| #define YYTEXT_POINTER 1
+| #define STDC_HEADERS 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_INTTYPES_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_DLFCN_H 1
+| /* end confdefs.h.  */
+| #include <ac_nonexistent.h>
+configure:6442: result: g++ -E
+configure:6471: g++ -E  conftest.cpp
+configure:6477: $? = 0
+configure:6508: g++ -E  conftest.cpp
+conftest.cpp:22:28: ac_nonexistent.h: No such file or directory
+configure:6514: $? = 1
+configure: failed program was:
+| /* confdefs.h.  */
+| #define PACKAGE_NAME "OGRE"
+| #define PACKAGE_TARNAME "ogre"
+| #define PACKAGE_VERSION "1.4.5"
+| #define PACKAGE_STRING "OGRE 1.4.5"
+| #define PACKAGE_BUGREPORT ""
+| #define PACKAGE "OGRE"
+| #define VERSION "1.4.5"
+| #define YYTEXT_POINTER 1
+| #define STDC_HEADERS 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_INTTYPES_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_DLFCN_H 1
+| /* end confdefs.h.  */
+| #include <ac_nonexistent.h>
+configure:6607: checking for g77
+configure:6623: found /usr/sepp/bin/g77
+configure:6634: result: g77
+configure:6664: checking for Fortran 77 compiler version
+configure:6671: g77 --version >&5
+GNU Fortran (GCC) 3.3.5
+Copyright (C) 2002 Free Software Foundation, Inc.
+
+GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
+You may redistribute copies of GNU Fortran
+under the terms of the GNU General Public License.
+For more information about these matters, see the file named COPYING
+or type the command `info -f g77 Copying'.
+configure:6674: $? = 0
+configure:6681: g77 -v >&5
+Reading specs from /usr/pack/gcc-3.3.5-mo/i686-debian-linux3.1/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/specs
+Configured with: ../configure --prefix=/usr/pack/gcc-3.3.5-mo --exec-prefix=/usr/pack/gcc-3.3.5-mo/i686-debian-linux3.1 --with-gxx-include-dir=/usr/pack/gcc-3.3.5-mo/include/c++ --disable-nls
+Thread model: posix
+gcc version 3.3.5
+configure:6684: $? = 0
+configure:6691: g77 -V >&5
+g77: `-V' option must have argument
+configure:6694: $? = 1
+configure:6702: checking whether we are using the GNU Fortran 77 compiler
+configure:6721: g77 -c  conftest.F >&5
+configure:6727: $? = 0
+configure:6744: result: yes
+configure:6750: checking whether g77 accepts -g
+configure:6767: g77 -c -g conftest.f >&5
+configure:6773: $? = 0
+configure:6789: result: yes
+configure:6819: checking the maximum length of command line arguments
+configure:6911: result: 32768
+configure:6922: checking command to parse /usr/bin/nm -B output from gcc object
+configure:7018: gcc -c -g -O2  conftest.c >&5
+configure:7021: $? = 0
+configure:7025: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ 	]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ 	][ 	]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' \> conftest.nm
+configure:7028: $? = 0
+configure:7080: gcc -o conftest -g -O2   conftest.c conftstm.o >&5
+configure:7083: $? = 0
+configure:7121: result: ok
+configure:7125: checking for objdir
+configure:7140: result: .libs
+configure:7232: checking for ar
+configure:7248: found /usr/bin/ar
+configure:7259: result: ar
+configure:7328: checking for ranlib
+configure:7344: found /usr/bin/ranlib
+configure:7355: result: ranlib
+configure:7424: checking for strip
+configure:7440: found /usr/bin/strip
+configure:7451: result: strip
+configure:7752: checking if gcc static flag  works
+configure:7780: result: yes
+configure:7798: checking if gcc supports -fno-rtti -fno-exceptions
+configure:7819: gcc -c -g -O2  -fno-rtti -fno-exceptions conftest.c >&5
+cc1: warning: "-fno-rtti" is valid for C++ but not for C/ObjC
+configure:7823: $? = 0
+configure:7833: result: no
+configure:7848: checking for gcc option to produce PIC
+configure:8052: result: -fPIC
+configure:8060: checking if gcc PIC flag -fPIC works
+configure:8081: gcc -c -g -O2  -fPIC -DPIC conftest.c >&5
+configure:8085: $? = 0
+configure:8095: result: yes
+configure:8119: checking if gcc supports -c -o file.o
+configure:8143: gcc -c -g -O2  -o out/conftest2.o conftest.c >&5
+configure:8147: $? = 0
+configure:8166: result: yes
+configure:8192: checking whether the gcc linker (/usr/bin/ld) supports shared libraries
+configure:9084: result: yes
+configure:9110: checking whether -lc should be explicitly linked in
+configure:9115: gcc -c -g -O2  conftest.c >&5
+configure:9118: $? = 0
+configure:9132: gcc -shared conftest.o  -v -Wl,-soname -Wl,conftest -o conftest 2\>\&1 \| grep  -lc  \>/dev/null 2\>\&1
+configure:9135: $? = 0
+configure:9147: result: no
+configure:9155: checking dynamic linker characteristics
+configure:9709: result: GNU/Linux ld.so
+configure:9713: checking how to hardcode library paths into programs
+configure:9738: result: immediate
+configure:9752: checking whether stripping libraries is possible
+configure:9757: result: yes
+configure:10554: checking if libtool supports shared libraries
+configure:10556: result: yes
+configure:10559: checking whether to build shared libraries
+configure:10580: result: yes
+configure:10583: checking whether to build static libraries
+configure:10587: result: no
+configure:10679: creating libtool
+configure:11257: checking for ld used by g++
+configure:11324: result: /usr/bin/ld
+configure:11333: checking if the linker (/usr/bin/ld) is GNU ld
+configure:11348: result: yes
+configure:11399: checking whether the g++ linker (/usr/bin/ld) supports shared libraries
+configure:12275: result: yes
+configure:12293: g++ -c -g -O2  conftest.cpp >&5
+configure:12296: $? = 0
+configure:12406: checking for g++ option to produce PIC
+configure:12674: result: -fPIC
+configure:12682: checking if g++ PIC flag -fPIC works
+configure:12703: g++ -c -g -O2  -fPIC -DPIC conftest.cpp >&5
+configure:12707: $? = 0
+configure:12717: result: yes
+configure:12741: checking if g++ supports -c -o file.o
+configure:12765: g++ -c -g -O2  -o out/conftest2.o conftest.cpp >&5
+configure:12769: $? = 0
+configure:12788: result: yes
+configure:12814: checking whether the g++ linker (/usr/bin/ld) supports shared libraries
+configure:12839: result: yes
+configure:12910: checking dynamic linker characteristics
+configure:13464: result: GNU/Linux ld.so
+configure:13468: checking how to hardcode library paths into programs
+configure:13493: result: immediate
+configure:13507: checking whether stripping libraries is possible
+configure:13512: result: yes
+configure:14815: checking if libtool supports shared libraries
+configure:14817: result: yes
+configure:14820: checking whether to build shared libraries
+configure:14840: result: yes
+configure:14843: checking whether to build static libraries
+configure:14847: result: no
+configure:14859: checking for g77 option to produce PIC
+configure:15063: result: -fPIC
+configure:15071: checking if g77 PIC flag -fPIC works
+configure:15092: g77 -c -g -O2 -fPIC conftest.f >&5
+configure:15096: $? = 0
+configure:15106: result: yes
+configure:15130: checking if g77 supports -c -o file.o
+configure:15154: g77 -c -g -O2 -o out/conftest2.o conftest.f >&5
+configure:15158: $? = 0
+configure:15177: result: yes
+configure:15203: checking whether the g77 linker (/usr/bin/ld) supports shared libraries
+configure:16075: result: yes
+configure:16146: checking dynamic linker characteristics
+configure:16700: result: GNU/Linux ld.so
+configure:16704: checking how to hardcode library paths into programs
+configure:16729: result: immediate
+configure:16743: checking whether stripping libraries is possible
+configure:16748: result: yes
+configure:21083: checking for ld used by g++
+configure:21150: result: /usr/bin/ld
+configure:21159: checking if the linker (/usr/bin/ld) is GNU ld
+configure:21174: result: yes
+configure:21225: checking whether the g++ linker (/usr/bin/ld) supports shared libraries
+configure:22101: result: yes
+configure:22119: g++ -c -g -O2  conftest.cpp >&5
+configure:22122: $? = 0
+configure:22232: checking for g++ option to produce PIC
+configure:22500: result: -fPIC
+configure:22508: checking if g++ PIC flag -fPIC works
+configure:22543: result: yes
+configure:22567: checking if g++ supports -c -o file.o
+configure:22614: result: yes
+configure:22640: checking whether the g++ linker (/usr/bin/ld) supports shared libraries
+configure:22665: result: yes
+configure:22736: checking dynamic linker characteristics
+configure:23290: result: GNU/Linux ld.so
+configure:23294: checking how to hardcode library paths into programs
+configure:23319: result: immediate
+configure:23333: checking whether stripping libraries is possible
+configure:23338: result: yes
+configure:24571: checking if g++ supports -fvisibility
+configure:24592: g++ -c -g -O2  -fvisibility=hidden -fvisibility-inlines-hidden conftest.cpp >&5
+cc1plus: error: unrecognized option `-fvisibility=hidden'
+cc1plus: error: unrecognized option `-fvisibility-inlines-hidden'
+configure:24596: $? = 1
+configure:24606: result: no
+configure:24653: checking whether to use STLPort
+configure:24660: result: no
+configure:24707: checking for freetype-config
+configure:24725: found /usr/bin/freetype-config
+configure:24738: result: /usr/bin/freetype-config
+configure:24748: checking for FreeType - version >= 9.0.0
+configure:24831: gcc -o conftest -g -O2 -I/usr/include/freetype2   conftest.c -lfreetype -lz  >&5
+configure:24834: $? = 0
+configure:24840: ./conftest
+configure:24843: $? = 0
+configure:24864: result: yes
+configure:24898: checking for dlopen in -ldl
+configure:24933: gcc -o conftest -g -O2   conftest.c -ldl   >&5
+configure:24939: $? = 0
+configure:24957: result: yes
+configure:24969: checking for pow in -lm
+configure:25004: gcc -o conftest -g -O2   conftest.c -lm  -ldl  >&5
+configure:25010: $? = 0
+configure:25028: result: yes
+configure:25040: checking for gzopen in -lz
+configure:25075: gcc -o conftest -g -O2   conftest.c -lz  -lm -ldl  >&5
+configure:25081: $? = 0
+configure:25099: result: yes
+configure:25111: checking for pthread_create in -lpthread
+configure:25146: gcc -o conftest -g -O2   conftest.c -lpthread  -lz -lm -ldl  >&5
+configure:25152: $? = 0
+configure:25170: result: yes
+configure:25181: checking for snprintf
+configure:25237: gcc -o conftest -g -O2   conftest.c -lpthread -lz -lm -ldl  >&5
+conftest.c:49: warning: conflicting types for built-in function `snprintf'
+configure:25243: $? = 0
+configure:25260: result: yes
+configure:25270: checking for vsnprintf
+configure:25326: gcc -o conftest -g -O2   conftest.c -lpthread -lz -lm -ldl  >&5
+conftest.c:50: warning: conflicting types for built-in function `vsnprintf'
+configure:25332: $? = 0
+configure:25349: result: yes
+configure:25395: checking for cppunit-config
+configure:25413: found /usr/sepp/bin/cppunit-config
+configure:25426: result: /usr/sepp/bin/cppunit-config
+configure:25436: checking for Cppunit - version >= 1.10.0
+configure:25469: result: 1.12.0
+configure:25550: checking for pkg-config
+configure:25568: found /usr/bin/pkg-config
+configure:25580: result: /usr/bin/pkg-config
+configure:25609: checking pkg-config is at least version 0.9.0
+configure:25612: result: yes
+configure:25623: checking for ZZIPLIB
+configure:25631: $PKG_CONFIG --exists --print-errors "zziplib"
+Package zziplib was not found in the pkg-config search path.
+Perhaps you should add the directory containing `zziplib.pc'
+to the PKG_CONFIG_PATH environment variable
+No package 'zziplib' found
+configure:25634: $? = 1
+configure:25649: $PKG_CONFIG --exists --print-errors "zziplib"
+Package zziplib was not found in the pkg-config search path.
+Perhaps you should add the directory containing `zziplib.pc'
+to the PKG_CONFIG_PATH environment variable
+No package 'zziplib' found
+configure:25652: $? = 1
+Package zziplib was not found in the pkg-config search path.
+Perhaps you should add the directory containing `zziplib.pc'
+to the PKG_CONFIG_PATH environment variable
+No package 'zziplib' found
+configure:25690: error: Package requirements (zziplib) were not met:
+
+Package zziplib was not found in the pkg-config search path.
+Perhaps you should add the directory containing `zziplib.pc'
+to the PKG_CONFIG_PATH environment variable
+No package 'zziplib' found
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables ZZIPLIB_CFLAGS
+and ZZIPLIB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+
+ac_cv_build=i686-pc-linux-gnu
+ac_cv_c_compiler_gnu=yes
+ac_cv_cxx_compiler_gnu=yes
+ac_cv_env_CCC_set=
+ac_cv_env_CCC_value=
+ac_cv_env_CC_set=
+ac_cv_env_CC_value=
+ac_cv_env_CEGUI_CFLAGS_set=
+ac_cv_env_CEGUI_CFLAGS_value=
+ac_cv_env_CEGUI_LIBS_set=
+ac_cv_env_CEGUI_LIBS_value=
+ac_cv_env_CFLAGS_set=
+ac_cv_env_CFLAGS_value=
+ac_cv_env_CPPFLAGS_set=
+ac_cv_env_CPPFLAGS_value=
+ac_cv_env_CPP_set=
+ac_cv_env_CPP_value=
+ac_cv_env_CXXCPP_set=
+ac_cv_env_CXXCPP_value=
+ac_cv_env_CXXFLAGS_set=
+ac_cv_env_CXXFLAGS_value=
+ac_cv_env_CXX_set=
+ac_cv_env_CXX_value=
+ac_cv_env_F77_set=
+ac_cv_env_F77_value=
+ac_cv_env_FFLAGS_set=
+ac_cv_env_FFLAGS_value=
+ac_cv_env_GTK_CFLAGS_set=
+ac_cv_env_GTK_CFLAGS_value=
+ac_cv_env_GTK_LIBS_set=
+ac_cv_env_GTK_LIBS_value=
+ac_cv_env_LDFLAGS_set=
+ac_cv_env_LDFLAGS_value=
+ac_cv_env_LIBS_set=
+ac_cv_env_LIBS_value=
+ac_cv_env_OIS_CFLAGS_set=
+ac_cv_env_OIS_CFLAGS_value=
+ac_cv_env_OIS_LIBS_set=
+ac_cv_env_OIS_LIBS_value=
+ac_cv_env_OPENEXR_CFLAGS_set=
+ac_cv_env_OPENEXR_CFLAGS_value=
+ac_cv_env_OPENEXR_LIBS_set=
+ac_cv_env_OPENEXR_LIBS_value=
+ac_cv_env_PKG_CONFIG_set=
+ac_cv_env_PKG_CONFIG_value=
+ac_cv_env_XMKMF_set=
+ac_cv_env_XMKMF_value=
+ac_cv_env_YACC_set=
+ac_cv_env_YACC_value=
+ac_cv_env_YFLAGS_set=
+ac_cv_env_YFLAGS_value=
+ac_cv_env_ZZIPLIB_CFLAGS_set=
+ac_cv_env_ZZIPLIB_CFLAGS_value=
+ac_cv_env_ZZIPLIB_LIBS_set=
+ac_cv_env_ZZIPLIB_LIBS_value=
+ac_cv_env_build_alias_set=
+ac_cv_env_build_alias_value=
+ac_cv_env_host_alias_set=
+ac_cv_env_host_alias_value=
+ac_cv_env_target_alias_set=
+ac_cv_env_target_alias_value=
+ac_cv_f77_compiler_gnu=yes
+ac_cv_func_snprintf=yes
+ac_cv_func_vsnprintf=yes
+ac_cv_header_dlfcn_h=yes
+ac_cv_header_inttypes_h=yes
+ac_cv_header_memory_h=yes
+ac_cv_header_stdc=yes
+ac_cv_header_stdint_h=yes
+ac_cv_header_stdlib_h=yes
+ac_cv_header_string_h=yes
+ac_cv_header_strings_h=yes
+ac_cv_header_sys_stat_h=yes
+ac_cv_header_sys_types_h=yes
+ac_cv_header_unistd_h=yes
+ac_cv_host=i686-pc-linux-gnu
+ac_cv_lib_dl_dlopen=yes
+ac_cv_lib_lex=-lfl
+ac_cv_lib_m_pow=yes
+ac_cv_lib_pthread_pthread_create=yes
+ac_cv_lib_z_gzopen=yes
+ac_cv_objext=o
+ac_cv_path_CPPUNIT_CONFIG=/usr/sepp/bin/cppunit-config
+ac_cv_path_EGREP='/bin/grep -E'
+ac_cv_path_FT2_CONFIG=/usr/bin/freetype-config
+ac_cv_path_GREP=/bin/grep
+ac_cv_path_ac_pt_PKG_CONFIG=/usr/bin/pkg-config
+ac_cv_path_install='/usr/bin/install -c'
+ac_cv_prog_AWK=gawk
+ac_cv_prog_CPP='gcc -E'
+ac_cv_prog_CXXCPP='g++ -E'
+ac_cv_prog_LEX=flex
+ac_cv_prog_YACC='bison -y'
+ac_cv_prog_ac_ct_AR=ar
+ac_cv_prog_ac_ct_CC=gcc
+ac_cv_prog_ac_ct_CXX=g++
+ac_cv_prog_ac_ct_F77=g77
+ac_cv_prog_ac_ct_RANLIB=ranlib
+ac_cv_prog_ac_ct_STRIP=strip
+ac_cv_prog_cc_c89=
+ac_cv_prog_cc_g=yes
+ac_cv_prog_cc_gcc_c_o=yes
+ac_cv_prog_cxx_g=yes
+ac_cv_prog_f77_g=yes
+ac_cv_prog_lex_root=lex.yy
+ac_cv_prog_lex_yytext_pointer=yes
+ac_cv_prog_make_make_set=yes
+ac_cv_target=i686-pc-linux-gnu
+ac_cv_use_stlport=no
+am_cv_CC_dependencies_compiler_type=gcc3
+am_cv_CXX_dependencies_compiler_type=gcc3
+lt_cv_deplibs_check_method=pass_all
+lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_ld_reload_flag=-r
+lt_cv_objdir=.libs
+lt_cv_path_LD=/usr/bin/ld
+lt_cv_path_LDCXX=/usr/bin/ld
+lt_cv_path_NM='/usr/bin/nm -B'
+lt_cv_path_SED=/bin/sed
+lt_cv_prog_compiler_c_o=yes
+lt_cv_prog_compiler_c_o_CXX=yes
+lt_cv_prog_compiler_c_o_F77=yes
+lt_cv_prog_compiler_rtti_exceptions=no
+lt_cv_prog_gnu_ld=yes
+lt_cv_prog_gnu_ldcxx=yes
+lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ 	]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ 	][ 	]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\'''
+lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\) $/  {\"\1\", (lt_ptr) 0},/p'\'' -e '\''s/^[BCDEGRST] \([^ ]*\) \([^ ]*\)$/  {"\2", (lt_ptr) \&\2},/p'\'''
+lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^. .* \(.*\)$/extern int \1;/p'\'''
+lt_cv_sys_max_cmd_len=32768
+lt_lt_cv_prog_compiler_c_o='"yes"'
+lt_lt_cv_prog_compiler_c_o_CXX='"yes"'
+lt_lt_cv_prog_compiler_c_o_F77='"yes"'
+lt_lt_cv_sys_global_symbol_pipe='"sed -n -e '\''s/^.*[ 	]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ 	][ 	]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'\''"'
+lt_lt_cv_sys_global_symbol_to_c_name_address='"sed -n -e '\''s/^: \\([^ ]*\\) \$/  {\\\"\\1\\\", (lt_ptr) 0},/p'\'' -e '\''s/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/  {\"\\2\", (lt_ptr) \\&\\2},/p'\''"'
+lt_lt_cv_sys_global_symbol_to_cdecl='"sed -n -e '\''s/^. .* \\(.*\\)\$/extern int \\1;/p'\''"'
+
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+
+ACLOCAL='${SHELL} /home/landauf/orxonoxv2/ogre-linux_osx-v1-4-5/ogrenew/missing --run aclocal-1.9'
+AMDEPBACKSLASH='\'
+AMDEP_FALSE='#'
+AMDEP_TRUE=''
+AMTAR='${SHELL} /home/landauf/orxonoxv2/ogre-linux_osx-v1-4-5/ogrenew/missing --run tar'
+AR='ar'
+AUTOCONF='${SHELL} /home/landauf/orxonoxv2/ogre-linux_osx-v1-4-5/ogrenew/missing --run autoconf'
+AUTOHEADER='${SHELL} /home/landauf/orxonoxv2/ogre-linux_osx-v1-4-5/ogrenew/missing --run autoheader'
+AUTOMAKE='${SHELL} /home/landauf/orxonoxv2/ogre-linux_osx-v1-4-5/ogrenew/missing --run automake-1.9'
+AWK='gawk'
+BUILD_CGPLUGIN_FALSE=''
+BUILD_CGPLUGIN_TRUE=''
+BUILD_DX9RENDERSYSTEM_FALSE=''
+BUILD_DX9RENDERSYSTEM_TRUE=''
+BUILD_EXRPLUGIN_FALSE=''
+BUILD_EXRPLUGIN_TRUE=''
+BUILD_UNIT_TESTS_FALSE='#'
+BUILD_UNIT_TESTS_TRUE=''
+CC='gcc'
+CCDEPMODE='depmode=gcc3'
+CEGUI_CFLAGS=''
+CEGUI_LIBS=''
+CFLAGS='-g -O2'
+CFLAGS_VISIBILITY=''
+CPP='gcc -E'
+CPPFLAGS=''
+CPPUNIT_CFLAGS='-I/usr/pack/cppunit-1.12.0-sd/include'
+CPPUNIT_CONFIG='/usr/sepp/bin/cppunit-config'
+CPPUNIT_LIBS='-L/usr/pack/cppunit-1.12.0-sd/i686-debian-linux3.1/lib -lcppunit -ldl'
+CXX='g++'
+CXXCPP='g++ -E'
+CXXDEPMODE='depmode=gcc3'
+CXXFLAGS='-g -O2'
+CYGPATH_W='echo'
+DEFS=''
+DEPDIR='.deps'
+ECHO='echo'
+ECHO_C=''
+ECHO_N='-n'
+ECHO_T=''
+EGREP='/bin/grep -E'
+EXEEXT=''
+F77='g77'
+FFLAGS='-g -O2'
+FT2_CFLAGS='-I/usr/include/freetype2'
+FT2_CONFIG='/usr/bin/freetype-config'
+FT2_LIBS='-lfreetype -lz'
+GLSUPPORT_CFLAGS=''
+GLSUPPORT_LIBS=''
+GL_LIBS='-lGL -lGLU'
+GREP='/bin/grep'
+GTK_CFLAGS=''
+GTK_LIBS=''
+HAVE_CEGUI_FALSE=''
+HAVE_CEGUI_TRUE=''
+INSTALL_DATA='${INSTALL} -m 644'
+INSTALL_PROGRAM='${INSTALL}'
+INSTALL_SCRIPT='${INSTALL}'
+INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
+LDFLAGS=''
+LEX='flex'
+LEXLIB='-lfl'
+LEX_OUTPUT_ROOT='lex.yy'
+LIBOBJS=''
+LIBS='-lpthread -lz -lm -ldl '
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+LN_S='ln -s'
+LTLIBOBJS=''
+MAKEINFO='${SHELL} /home/landauf/orxonoxv2/ogre-linux_osx-v1-4-5/ogrenew/missing --run makeinfo'
+OBJEXT='o'
+OGRE_BUILDING_DEMOS_FALSE=''
+OGRE_BUILDING_DEMOS_TRUE=''
+OGRE_BUILD_SSE_FALSE=''
+OGRE_BUILD_SSE_TRUE=''
+OGRE_CFLAGS=''
+OGRE_GLSUPPORT=''
+OGRE_GUI=''
+OGRE_LINUX_FALSE='#'
+OGRE_LINUX_TRUE=''
+OGRE_NT_FALSE=''
+OGRE_NT_TRUE='#'
+OGRE_OSX_FALSE=''
+OGRE_OSX_TRUE='#'
+OGRE_PLATFORM=''
+OGRE_THREAD_LIBS=''
+OIS_CFLAGS=''
+OIS_LIBS=''
+OPENEXR_CFLAGS=''
+OPENEXR_LIBS=''
+PACKAGE='OGRE'
+PACKAGE_BUGREPORT=''
+PACKAGE_NAME='OGRE'
+PACKAGE_STRING='OGRE 1.4.5'
+PACKAGE_TARNAME='ogre'
+PACKAGE_VERSION='1.4.5'
+PATH_SEPARATOR=':'
+PKG_CONFIG='/usr/bin/pkg-config'
+PLATFORM_CFLAGS=''
+PLATFORM_LIBS=''
+PLUGIN_FLAGS='-shared -avoid-version'
+RANLIB='ranlib'
+RC=''
+SAME_PLATFORM_AND_GUI_FALSE=''
+SAME_PLATFORM_AND_GUI_TRUE=''
+SET_MAKE=''
+SHARED_FLAGS='-shared'
+SHELL='/bin/sh'
+STLPORT_CFLAGS=''
+STLPORT_LIBS=''
+STRIP='strip'
+USE_DEVIL_FALSE=''
+USE_DEVIL_TRUE=''
+USE_FREEIMAGE_FALSE=''
+USE_FREEIMAGE_TRUE=''
+VERSION='1.4.5'
+XMKMF=''
+YACC='bison -y'
+YFLAGS=''
+ZZIPLIB_CFLAGS=''
+ZZIPLIB_LIBS=''
+abs_top_builddir=''
+ac_ct_CC='gcc'
+ac_ct_CXX='g++'
+ac_ct_F77='g77'
+am__fastdepCC_FALSE='#'
+am__fastdepCC_TRUE=''
+am__fastdepCXX_FALSE='#'
+am__fastdepCXX_TRUE=''
+am__include='include'
+am__leading_dot='.'
+am__quote=''
+am__tar='${AMTAR} chof - "$$tardir"'
+am__untar='${AMTAR} xf -'
+bindir='${exec_prefix}/bin'
+build='i686-pc-linux-gnu'
+build_alias=''
+build_cpu='i686'
+build_os='linux-gnu'
+build_vendor='pc'
+datadir='${datarootdir}'
+datarootdir='${prefix}/share'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+dvidir='${docdir}'
+exec_prefix='NONE'
+host='i686-pc-linux-gnu'
+host_alias=''
+host_cpu='i686'
+host_os='linux-gnu'
+host_vendor='pc'
+htmldir='${docdir}'
+includedir='${prefix}/include'
+infodir='${datarootdir}/info'
+install_sh='/home/landauf/orxonoxv2/ogre-linux_osx-v1-4-5/ogrenew/install-sh'
+libdir='${exec_prefix}/lib'
+libexecdir='${exec_prefix}/libexec'
+localedir='${datarootdir}/locale'
+localstatedir='${prefix}/var'
+mandir='${datarootdir}/man'
+mkdir_p='mkdir -p --'
+ogreexecdir=''
+oldincludedir='/usr/include'
+pdfdir='${docdir}'
+prefix='NONE'
+program_transform_name='s,x,x,'
+psdir='${docdir}'
+sbindir='${exec_prefix}/sbin'
+sharedstatedir='${prefix}/com'
+sysconfdir='${prefix}/etc'
+target='i686-pc-linux-gnu'
+target_alias=''
+target_cpu='i686'
+target_os='linux-gnu'
+target_vendor='pc'
+
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+
+#define PACKAGE_NAME "OGRE"
+#define PACKAGE_TARNAME "ogre"
+#define PACKAGE_VERSION "1.4.5"
+#define PACKAGE_STRING "OGRE 1.4.5"
+#define PACKAGE_BUGREPORT ""
+#define PACKAGE "OGRE"
+#define VERSION "1.4.5"
+#define YYTEXT_POINTER 1
+#define STDC_HEADERS 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRING_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_DLFCN_H 1
+#define HAVE_LIBDL 1
+#define HAVE_LIBM 1
+#define HAVE_LIBZ 1
+#define HAVE_LIBPTHREAD 1
+#define HAVE_SNPRINTF
+#define HAVE_VSNPRINTF
+
+configure: exit 1
Index: /config.sub
===================================================================
--- /config.sub	(revision 5)
+++ /config.sub	(revision 5)
@@ -0,0 +1,1579 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+timestamp='2005-07-08'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit ;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
+  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+	-sun*os*)
+		# Prevent following clause from handling this invalid input.
+		;;
+	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+	-apple | -axis | -knuth | -cray)
+		os=
+		basic_machine=$1
+		;;
+	-sim | -cisco | -oki | -wec | -winbond)
+		os=
+		basic_machine=$1
+		;;
+	-scout)
+		;;
+	-wrs)
+		os=-vxworks
+		basic_machine=$1
+		;;
+	-chorusos*)
+		os=-chorusos
+		basic_machine=$1
+		;;
+ 	-chorusrdb)
+ 		os=-chorusrdb
+		basic_machine=$1
+ 		;;
+	-hiux*)
+		os=-hiuxwe2
+		;;
+	-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/'`
+		;;
+	-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 \
+	| bfin \
+	| c4x | clipper \
+	| d10v | d30v | dlx | dsp16xx \
+	| fr30 | frv \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| ip2k | iq2000 \
+	| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
+	| mips | mipsbe | mipseb | mipsel | mipsle \
+	| mips16 \
+	| mips64 | mips64el \
+	| mips64vr | mips64vrel \
+	| mips64orion | mips64orionel \
+	| mips64vr4100 | mips64vr4100el \
+	| mips64vr4300 | mips64vr4300el \
+	| mips64vr5000 | mips64vr5000el \
+	| mips64vr5900 | mips64vr5900el \
+	| mipsisa32 | mipsisa32el \
+	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa64 | mipsisa64el \
+	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64sb1 | mipsisa64sb1el \
+	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipstx39 | mipstx39el \
+	| mn10200 | mn10300 \
+	| ms1 \
+	| msp430 \
+	| ns16k | ns32k \
+	| or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+	| sh64 | sh64le \
+	| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b \
+	| strongarm \
+	| tahoe | thumb | tic4x | tic80 | tron \
+	| v850 | v850e \
+	| we32k \
+	| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
+	| z8k)
+		basic_machine=$basic_machine-unknown
+		;;
+	m32c)
+		basic_machine=$basic_machine-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12)
+		# Motorola 68HC11/12.
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+		;;
+
+	# 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-* \
+	| bfin-* | bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+	| clipper-* | craynv-* | cydra-* \
+	| d10v-* | d30v-* | dlx-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| ip2k-* | iq2000-* \
+	| m32r-* | m32rle-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* \
+	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+	| mips16-* \
+	| mips64-* | mips64el-* \
+	| mips64vr-* | mips64vrel-* \
+	| mips64orion-* | mips64orionel-* \
+	| mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* \
+	| mips64vr5000-* | mips64vr5000el-* \
+	| mips64vr5900-* | mips64vr5900el-* \
+	| mipsisa32-* | mipsisa32el-* \
+	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipstx39-* | mipstx39el-* \
+	| mmix-* \
+	| ms1-* \
+	| msp430-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| pyramid-* \
+	| romp-* | rs6000-* \
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
+	| sparclite-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tron-* \
+	| v850-* | v850e-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| xstormy16-* | xtensa-* \
+	| ymp-* \
+	| z8k-*)
+		;;
+	m32c-*)
+		;;
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
+	386bsd)
+		basic_machine=i386-unknown
+		os=-bsd
+		;;
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		basic_machine=m68000-att
+		;;
+	3b*)
+		basic_machine=we32k-att
+		;;
+	a29khif)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+    	abacus)
+		basic_machine=abacus-unknown
+		;;
+	adobe68k)
+		basic_machine=m68010-adobe
+		os=-scout
+		;;
+	alliant | fx80)
+		basic_machine=fx80-alliant
+		;;
+	altos | altos3068)
+		basic_machine=m68k-altos
+		;;
+	am29k)
+		basic_machine=a29k-none
+		os=-bsd
+		;;
+	amd64)
+		basic_machine=x86_64-pc
+		;;
+	amd64-*)
+		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	amdahl)
+		basic_machine=580-amdahl
+		os=-sysv
+		;;
+	amiga | amiga-*)
+		basic_machine=m68k-unknown
+		;;
+	amigaos | amigados)
+		basic_machine=m68k-unknown
+		os=-amigaos
+		;;
+	amigaunix | amix)
+		basic_machine=m68k-unknown
+		os=-sysv4
+		;;
+	apollo68)
+		basic_machine=m68k-apollo
+		os=-sysv
+		;;
+	apollo68bsd)
+		basic_machine=m68k-apollo
+		os=-bsd
+		;;
+	aux)
+		basic_machine=m68k-apple
+		os=-aux
+		;;
+	balance)
+		basic_machine=ns32k-sequent
+		os=-dynix
+		;;
+	c90)
+		basic_machine=c90-cray
+		os=-unicos
+		;;
+	convex-c1)
+		basic_machine=c1-convex
+		os=-bsd
+		;;
+	convex-c2)
+		basic_machine=c2-convex
+		os=-bsd
+		;;
+	convex-c32)
+		basic_machine=c32-convex
+		os=-bsd
+		;;
+	convex-c34)
+		basic_machine=c34-convex
+		os=-bsd
+		;;
+	convex-c38)
+		basic_machine=c38-convex
+		os=-bsd
+		;;
+	cray | j90)
+		basic_machine=j90-cray
+		os=-unicos
+		;;
+	craynv)
+		basic_machine=craynv-cray
+		os=-unicosmp
+		;;
+	cr16c)
+		basic_machine=cr16c-unknown
+		os=-elf
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	crisv32 | crisv32-* | etraxfs*)
+		basic_machine=crisv32-axis
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	crx)
+		basic_machine=crx-unknown
+		os=-elf
+		;;
+	da30 | da30-*)
+		basic_machine=m68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=mips-dec
+		;;
+	decsystem10* | dec10*)
+		basic_machine=pdp10-dec
+		os=-tops10
+		;;
+	decsystem20* | dec20*)
+		basic_machine=pdp10-dec
+		os=-tops20
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		basic_machine=m68k-motorola
+		;;
+	delta88)
+		basic_machine=m88k-motorola
+		os=-sysv3
+		;;
+	djgpp)
+		basic_machine=i586-pc
+		os=-msdosdjgpp
+		;;
+	dpx20 | dpx20-*)
+		basic_machine=rs6000-bull
+		os=-bosx
+		;;
+	dpx2* | dpx2*-bull)
+		basic_machine=m68k-bull
+		os=-sysv3
+		;;
+	ebmon29k)
+		basic_machine=a29k-amd
+		os=-ebmon
+		;;
+	elxsi)
+		basic_machine=elxsi-elxsi
+		os=-bsd
+		;;
+	encore | umax | mmax)
+		basic_machine=ns32k-encore
+		;;
+	es1800 | OSE68k | ose68k | ose | OSE)
+		basic_machine=m68k-ericsson
+		os=-ose
+		;;
+	fx2800)
+		basic_machine=i860-alliant
+		;;
+	genix)
+		basic_machine=ns32k-ns
+		;;
+	gmicro)
+		basic_machine=tron-gmicro
+		os=-sysv
+		;;
+	go32)
+		basic_machine=i386-pc
+		os=-go32
+		;;
+	h3050r* | hiux*)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	h8300hms)
+		basic_machine=h8300-hitachi
+		os=-hms
+		;;
+	h8300xray)
+		basic_machine=h8300-hitachi
+		os=-xray
+		;;
+	h8500hms)
+		basic_machine=h8500-hitachi
+		os=-hms
+		;;
+	harris)
+		basic_machine=m88k-harris
+		os=-sysv3
+		;;
+	hp300-*)
+		basic_machine=m68k-hp
+		;;
+	hp300bsd)
+		basic_machine=m68k-hp
+		os=-bsd
+		;;
+	hp300hpux)
+		basic_machine=m68k-hp
+		os=-hpux
+		;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		basic_machine=m68000-hp
+		;;
+	hp9k3[2-9][0-9])
+		basic_machine=m68k-hp
+		;;
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k78[0-9] | hp78[0-9])
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][13679] | hp8[0-9][13679])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hppa-next)
+		os=-nextstep3
+		;;
+	hppaosf)
+		basic_machine=hppa1.1-hp
+		os=-osf
+		;;
+	hppro)
+		basic_machine=hppa1.1-hp
+		os=-proelf
+		;;
+	i370-ibm* | ibm*)
+		basic_machine=i370-ibm
+		;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+	i*86v32)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv32
+		;;
+	i*86v4*)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv4
+		;;
+	i*86v)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv
+		;;
+	i*86sol2)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-solaris2
+		;;
+	i386mach)
+		basic_machine=i386-mach
+		os=-mach
+		;;
+	i386-vsta | vsta)
+		basic_machine=i386-unknown
+		os=-vsta
+		;;
+	iris | iris4d)
+		basic_machine=mips-sgi
+		case $os in
+		    -irix*)
+			;;
+		    *)
+			os=-irix4
+			;;
+		esac
+		;;
+	isi68 | isi)
+		basic_machine=m68k-isi
+		os=-sysv
+		;;
+	m88k-omron*)
+		basic_machine=m88k-omron
+		;;
+	magnum | m3230)
+		basic_machine=mips-mips
+		os=-sysv
+		;;
+	merlin)
+		basic_machine=ns32k-utek
+		os=-sysv
+		;;
+	mingw32)
+		basic_machine=i386-pc
+		os=-mingw32
+		;;
+	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
+		;;
+	mvs)
+		basic_machine=i370-ibm
+		os=-mvs
+		;;
+	ncr3000)
+		basic_machine=i486-ncr
+		os=-sysv4
+		;;
+	netbsd386)
+		basic_machine=i386-unknown
+		os=-netbsd
+		;;
+	netwinder)
+		basic_machine=armv4l-rebel
+		os=-linux
+		;;
+	news | news700 | news800 | news900)
+		basic_machine=m68k-sony
+		os=-newsos
+		;;
+	news1000)
+		basic_machine=m68030-sony
+		os=-newsos
+		;;
+	news-3600 | risc-news)
+		basic_machine=mips-sony
+		os=-newsos
+		;;
+	necv70)
+		basic_machine=v70-nec
+		os=-sysv
+		;;
+	next | m*-next )
+		basic_machine=m68k-next
+		case $os in
+		    -nextstep* )
+			;;
+		    -ns2*)
+		      os=-nextstep2
+			;;
+		    *)
+		      os=-nextstep3
+			;;
+		esac
+		;;
+	nh3000)
+		basic_machine=m68k-harris
+		os=-cxux
+		;;
+	nh[45]000)
+		basic_machine=m88k-harris
+		os=-cxux
+		;;
+	nindy960)
+		basic_machine=i960-intel
+		os=-nindy
+		;;
+	mon960)
+		basic_machine=i960-intel
+		os=-mon960
+		;;
+	nonstopux)
+		basic_machine=mips-compaq
+		os=-nonstopux
+		;;
+	np1)
+		basic_machine=np1-gould
+		;;
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	openrisc | openrisc-*)
+		basic_machine=or32-unknown
+		;;
+	os400)
+		basic_machine=powerpc-ibm
+		os=-os400
+		;;
+	OSE68000 | ose68000)
+		basic_machine=m68000-ericsson
+		os=-ose
+		;;
+	os68k)
+		basic_machine=m68k-none
+		os=-os68k
+		;;
+	pa-hitachi)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	paragon)
+		basic_machine=i860-intel
+		os=-osf
+		;;
+	pbd)
+		basic_machine=sparc-tti
+		;;
+	pbb)
+		basic_machine=m68k-tti
+		;;
+	pc532 | pc532-*)
+		basic_machine=ns32k-pc532
+		;;
+	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
+		;;
+	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
+		;;
+	sei)
+		basic_machine=mips-sei
+		os=-seiux
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparclite-wrs | simso-wrs)
+		basic_machine=sparclite-wrs
+		os=-vxworks
+		;;
+	sps7)
+		basic_machine=m68k-bull
+		os=-sysv2
+		;;
+	spur)
+		basic_machine=spur-unknown
+		;;
+	st2000)
+		basic_machine=m68k-tandem
+		;;
+	stratus)
+		basic_machine=i860-stratus
+		os=-sysv4
+		;;
+	sun2)
+		basic_machine=m68000-sun
+		;;
+	sun2os3)
+		basic_machine=m68000-sun
+		os=-sunos3
+		;;
+	sun2os4)
+		basic_machine=m68000-sun
+		os=-sunos4
+		;;
+	sun3os3)
+		basic_machine=m68k-sun
+		os=-sunos3
+		;;
+	sun3os4)
+		basic_machine=m68k-sun
+		os=-sunos4
+		;;
+	sun4os3)
+		basic_machine=sparc-sun
+		os=-sunos3
+		;;
+	sun4os4)
+		basic_machine=sparc-sun
+		os=-sunos4
+		;;
+	sun4sol2)
+		basic_machine=sparc-sun
+		os=-solaris2
+		;;
+	sun3 | sun3-*)
+		basic_machine=m68k-sun
+		;;
+	sun4)
+		basic_machine=sparc-sun
+		;;
+	sun386 | sun386i | roadrunner)
+		basic_machine=i386-sun
+		;;
+	sv1)
+		basic_machine=sv1-cray
+		os=-unicos
+		;;
+	symmetry)
+		basic_machine=i386-sequent
+		os=-dynix
+		;;
+	t3e)
+		basic_machine=alphaev5-cray
+		os=-unicos
+		;;
+	t90)
+		basic_machine=t90-cray
+		os=-unicos
+		;;
+	tic54x | c54x*)
+		basic_machine=tic54x-unknown
+		os=-coff
+		;;
+	tic55x | c55x*)
+		basic_machine=tic55x-unknown
+		os=-coff
+		;;
+	tic6x | c6x*)
+		basic_machine=tic6x-unknown
+		os=-coff
+		;;
+	tx39)
+		basic_machine=mipstx39-unknown
+		;;
+	tx39el)
+		basic_machine=mipstx39el-unknown
+		;;
+	toad1)
+		basic_machine=pdp10-xkl
+		os=-tops20
+		;;
+	tower | tower-32)
+		basic_machine=m68k-ncr
+		;;
+	tpf)
+		basic_machine=s390x-ibm
+		os=-tpf
+		;;
+	udi29k)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	ultra3)
+		basic_machine=a29k-nyu
+		os=-sym1
+		;;
+	v810 | necv810)
+		basic_machine=v810-nec
+		os=-none
+		;;
+	vaxv)
+		basic_machine=vax-dec
+		os=-sysv
+		;;
+	vms)
+		basic_machine=vax-dec
+		os=-vms
+		;;
+	vpp*|vx|vx-*)
+		basic_machine=f301-fujitsu
+		;;
+	vxworks960)
+		basic_machine=i960-wrs
+		os=-vxworks
+		;;
+	vxworks68)
+		basic_machine=m68k-wrs
+		os=-vxworks
+		;;
+	vxworks29k)
+		basic_machine=a29k-wrs
+		os=-vxworks
+		;;
+	w65*)
+		basic_machine=w65-wdc
+		os=-none
+		;;
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
+		;;
+	xbox)
+		basic_machine=i686-pc
+		os=-mingw32
+		;;
+	xps | xps100)
+		basic_machine=xps100-honeywell
+		;;
+	ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	z8k-*-coff)
+		basic_machine=z8k-unknown
+		os=-sim
+		;;
+	none)
+		basic_machine=none-none
+		os=-none
+		;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		basic_machine=hppa1.1-winbond
+		;;
+	op50n)
+		basic_machine=hppa1.1-oki
+		;;
+	op60c)
+		basic_machine=hppa1.1-oki
+		;;
+	romp)
+		basic_machine=romp-ibm
+		;;
+	mmix)
+		basic_machine=mmix-knuth
+		;;
+	rs6000)
+		basic_machine=rs6000-ibm
+		;;
+	vax)
+		basic_machine=vax-dec
+		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
+	pdp11)
+		basic_machine=pdp11-dec
+		;;
+	we32k)
+		basic_machine=we32k-att
+		;;
+	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+		basic_machine=sh-unknown
+		;;
+	sparc | sparcv8 | sparcv9 | sparcv9b)
+		basic_machine=sparc-sun
+		;;
+	cydra)
+		basic_machine=cydra-cydrome
+		;;
+	orion)
+		basic_machine=orion-highlevel
+		;;
+	orion105)
+		basic_machine=clipper-highlevel
+		;;
+	mac | mpw | mac-mpw)
+		basic_machine=m68k-apple
+		;;
+	pmac | pmac-mpw)
+		basic_machine=powerpc-apple
+		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
+	*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+	*-digital*)
+		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+		;;
+	*-commodore*)
+		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		;;
+	*)
+		;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+	# -solaris* is a basic system type, with this one exception.
+	-solaris1 | -solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+		;;
+	-solaris)
+		os=-solaris2
+		;;
+	-svr4*)
+		os=-sysv4
+		;;
+	-unixware*)
+		os=-sysv4.2uw
+		;;
+	-gnu/linux*)
+		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+		;;
+	# First accept the basic system types.
+	# The portable systems comes first.
+	# Each alternative MUST END IN A *, to match a version number.
+	# -sysv* is not here because it comes later, after sysvr4.
+	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* \
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* \
+	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -linux-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*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto-qnx*)
+		;;
+	-nto*)
+		os=`echo $os | sed -e 's|nto|nto-qnx|'`
+		;;
+	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+		;;
+	-mac*)
+		os=`echo $os | sed -e 's|mac|macos|'`
+		;;
+	-linux-dietlibc)
+		os=-linux-dietlibc
+		;;
+	-linux*)
+		os=`echo $os | sed -e 's|linux|linux-gnu|'`
+		;;
+	-sunos5*)
+		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+		;;
+	-sunos6*)
+		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+		;;
+	-opened*)
+		os=-openedition
+		;;
+        -os400*)
+		os=-os400
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-atheos*)
+		os=-atheos
+		;;
+	-syllable*)
+		os=-syllable
+		;;
+	-386bsd)
+		os=-bsd
+		;;
+	-ctix* | -uts*)
+		os=-sysv
+		;;
+	-nova*)
+		os=-rtmk-nova
+		;;
+	-ns2 )
+		os=-nextstep2
+		;;
+	-nsk*)
+		os=-nsk
+		;;
+	# Preserve the version number of sinix5.
+	-sinix5.*)
+		os=`echo $os | sed -e 's|sinix|sysv|'`
+		;;
+	-sinix*)
+		os=-sysv4
+		;;
+        -tpf*)
+		os=-tpf
+		;;
+	-triton*)
+		os=-sysv3
+		;;
+	-oss*)
+		os=-sysv3
+		;;
+	-svr4)
+		os=-sysv4
+		;;
+	-svr3)
+		os=-sysv3
+		;;
+	-sysvr4)
+		os=-sysv4
+		;;
+	# This must come after -sysvr4.
+	-sysv*)
+		;;
+	-ose*)
+		os=-ose
+		;;
+	-es1800*)
+		os=-ose
+		;;
+	-xenix)
+		os=-xenix
+		;;
+	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+		os=-mint
+		;;
+	-aros*)
+		os=-aros
+		;;
+	-kaos*)
+		os=-kaos
+		;;
+	-zvmoe)
+		os=-zvmoe
+		;;
+	-none)
+		;;
+	*)
+		# Get rid of the `-' at the beginning of $os.
+		os=`echo $os | sed 's/[^-]*-//'`
+		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		exit 1
+		;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+	*-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
+		;;
+	mips*-cisco)
+		os=-elf
+		;;
+	mips*-*)
+		os=-elf
+		;;
+	or32-*)
+		os=-coff
+		;;
+	*-tti)	# must be before sparc entry or we get the wrong os.
+		os=-sysv3
+		;;
+	sparc-* | *-sun)
+		os=-sunos4.1.1
+		;;
+	*-be)
+		os=-beos
+		;;
+	*-haiku)
+		os=-haiku
+		;;
+	*-ibm)
+		os=-aix
+		;;
+    	*-knuth)
+		os=-mmixware
+		;;
+	*-wec)
+		os=-proelf
+		;;
+	*-winbond)
+		os=-proelf
+		;;
+	*-oki)
+		os=-proelf
+		;;
+	*-hp)
+		os=-hpux
+		;;
+	*-hitachi)
+		os=-hiux
+		;;
+	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+		os=-sysv
+		;;
+	*-cbm)
+		os=-amigaos
+		;;
+	*-dg)
+		os=-dgux
+		;;
+	*-dolphin)
+		os=-sysv3
+		;;
+	m68k-ccur)
+		os=-rtu
+		;;
+	m88k-omron*)
+		os=-luna
+		;;
+	*-next )
+		os=-nextstep
+		;;
+	*-sequent)
+		os=-ptx
+		;;
+	*-crds)
+		os=-unos
+		;;
+	*-ns)
+		os=-genix
+		;;
+	i370-*)
+		os=-mvs
+		;;
+	*-next)
+		os=-nextstep3
+		;;
+	*-gould)
+		os=-sysv
+		;;
+	*-highlevel)
+		os=-bsd
+		;;
+	*-encore)
+		os=-bsd
+		;;
+	*-sgi)
+		os=-irix
+		;;
+	*-siemens)
+		os=-sysv4
+		;;
+	*-masscomp)
+		os=-rtu
+		;;
+	f30[01]-fujitsu | f700-fujitsu)
+		os=-uxpv
+		;;
+	*-rom68k)
+		os=-coff
+		;;
+	*-*bug)
+		os=-coff
+		;;
+	*-apple)
+		os=-macos
+		;;
+	*-atari*)
+		os=-mint
+		;;
+	*)
+		os=-none
+		;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+	*-unknown)
+		case $os in
+			-riscix*)
+				vendor=acorn
+				;;
+			-sunos*)
+				vendor=sun
+				;;
+			-aix*)
+				vendor=ibm
+				;;
+			-beos*)
+				vendor=be
+				;;
+			-hpux*)
+				vendor=hp
+				;;
+			-mpeix*)
+				vendor=hp
+				;;
+			-hiux*)
+				vendor=hitachi
+				;;
+			-unos*)
+				vendor=crds
+				;;
+			-dgux*)
+				vendor=dg
+				;;
+			-luna*)
+				vendor=omron
+				;;
+			-genix*)
+				vendor=ns
+				;;
+			-mvs* | -opened*)
+				vendor=ibm
+				;;
+			-os400*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-tpf*)
+				vendor=ibm
+				;;
+			-vxsim* | -vxworks* | -windiss*)
+				vendor=wrs
+				;;
+			-aux*)
+				vendor=apple
+				;;
+			-hms*)
+				vendor=hitachi
+				;;
+			-mpw* | -macos*)
+				vendor=apple
+				;;
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+				vendor=atari
+				;;
+			-vos*)
+				vendor=stratus
+				;;
+		esac
+		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+		;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
Index: /configure
===================================================================
--- /configure	(revision 5)
+++ /configure	(revision 5)
@@ -0,0 +1,29656 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.61 for OGRE 1.4.5.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes && 	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  case $as_dir in
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+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
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+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
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+	case $1 in
+        -*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+  ;;
+esac
+
+echo=${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 <<EOF
+$*
+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 "$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 &&
+       echo_test_string=`eval $cmd` &&
+       (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.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+tagnames=${tagnames+${tagnames},}CXX
+
+tagnames=${tagnames+${tagnames},}F77
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='OGRE'
+PACKAGE_TARNAME='ogre'
+PACKAGE_VERSION='1.4.5'
+PACKAGE_STRING='OGRE 1.4.5'
+PACKAGE_BUGREPORT=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+build
+build_cpu
+build_vendor
+build_os
+host
+host_cpu
+host_vendor
+host_os
+target
+target_cpu
+target_vendor
+target_os
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+CYGPATH_W
+PACKAGE
+VERSION
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+install_sh
+STRIP
+INSTALL_STRIP_PROGRAM
+mkdir_p
+AWK
+SET_MAKE
+am__leading_dot
+AMTAR
+am__tar
+am__untar
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+DEPDIR
+am__include
+am__quote
+AMDEP_TRUE
+AMDEP_FALSE
+AMDEPBACKSLASH
+CCDEPMODE
+am__fastdepCC_TRUE
+am__fastdepCC_FALSE
+CXX
+CXXFLAGS
+ac_ct_CXX
+CXXDEPMODE
+am__fastdepCXX_TRUE
+am__fastdepCXX_FALSE
+YACC
+YFLAGS
+LEX
+LEX_OUTPUT_ROOT
+LEXLIB
+SHARED_FLAGS
+PLUGIN_FLAGS
+GL_LIBS
+RC
+OGRE_NT_TRUE
+OGRE_NT_FALSE
+OGRE_LINUX_TRUE
+OGRE_LINUX_FALSE
+OGRE_OSX_TRUE
+OGRE_OSX_FALSE
+GREP
+EGREP
+LN_S
+ECHO
+AR
+RANLIB
+CPP
+CXXCPP
+F77
+FFLAGS
+ac_ct_F77
+LIBTOOL
+OGRE_CFLAGS
+CFLAGS_VISIBILITY
+STLPORT_CFLAGS
+STLPORT_LIBS
+FT2_CONFIG
+FT2_CFLAGS
+FT2_LIBS
+CPPUNIT_CONFIG
+CPPUNIT_CFLAGS
+CPPUNIT_LIBS
+BUILD_UNIT_TESTS_TRUE
+BUILD_UNIT_TESTS_FALSE
+PKG_CONFIG
+ZZIPLIB_CFLAGS
+ZZIPLIB_LIBS
+XMKMF
+PLATFORM_CFLAGS
+PLATFORM_LIBS
+OGRE_PLATFORM
+GLSUPPORT_CFLAGS
+GLSUPPORT_LIBS
+OGRE_GLSUPPORT
+GTK_CFLAGS
+GTK_LIBS
+OGRE_GUI
+OGRE_THREAD_LIBS
+USE_FREEIMAGE_TRUE
+USE_FREEIMAGE_FALSE
+USE_DEVIL_TRUE
+USE_DEVIL_FALSE
+BUILD_CGPLUGIN_TRUE
+BUILD_CGPLUGIN_FALSE
+OPENEXR_CFLAGS
+OPENEXR_LIBS
+BUILD_EXRPLUGIN_TRUE
+BUILD_EXRPLUGIN_FALSE
+BUILD_DX9RENDERSYSTEM_TRUE
+BUILD_DX9RENDERSYSTEM_FALSE
+OGRE_BUILD_SSE_TRUE
+OGRE_BUILD_SSE_FALSE
+SAME_PLATFORM_AND_GUI_TRUE
+SAME_PLATFORM_AND_GUI_FALSE
+OIS_CFLAGS
+OIS_LIBS
+OGRE_BUILDING_DEMOS_TRUE
+OGRE_BUILDING_DEMOS_FALSE
+CEGUI_CFLAGS
+CEGUI_LIBS
+HAVE_CEGUI_TRUE
+HAVE_CEGUI_FALSE
+abs_top_builddir
+ogreexecdir
+LIBOBJS
+LTLIBOBJS'
+ac_subst_files=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CXX
+CXXFLAGS
+CCC
+YACC
+YFLAGS
+CPP
+CXXCPP
+F77
+FFLAGS
+PKG_CONFIG
+ZZIPLIB_CFLAGS
+ZZIPLIB_LIBS
+XMKMF
+GTK_CFLAGS
+GTK_LIBS
+OPENEXR_CFLAGS
+OPENEXR_LIBS
+OIS_CFLAGS
+OIS_LIBS
+CEGUI_CFLAGS
+CEGUI_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute directory names.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures OGRE 1.4.5 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+			  [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+			  [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root [DATAROOTDIR/doc/ogre]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+X features:
+  --x-includes=DIR    X include files are in DIR
+  --x-libraries=DIR   X library files are in DIR
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of OGRE 1.4.5:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-static[=PKGS]  build static libraries [default=no]
+  --enable-shared[=PKGS]  build shared libraries [default=yes]
+  --enable-fast-install[=PKGS]
+                          optimize for fast installation [default=yes]
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+  --disable-freetypetest  Do not try to compile and run
+                          a test FreeType program
+  --enable-double         Build OGRE in double floating point precision mode.
+                          This is not recommended for normal use as it is
+                          slower.
+  --enable-threading      Indicate general support for multithreading. This
+                          will enable threading support in certain parts of
+                          the engine, mainly resource loading and SharedPtr
+                          handling. WARNING: highly experimental, use with
+                          caution.
+  --disable-freeimage     Don't use FreeImage for image loading. This is not
+                          recommended unless you provide your own image
+                          loading codecs.
+  --disable-devil         Don't use DevIL for image loading. This is not
+                          recommended unless you provide your own image
+                          loading codecs.
+  --disable-cg            Do not build the Cg plugin (recommended you do so!)
+  --enable-openexr        Build the OpenEXR plugin
+  --enable-direct3d       Build the DirectX 9 Render System
+  --disable-ogre-demos    Do not build Ogre demos (CEGUI Renderer - if
+                          enabled/disabled, is not affected by this
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-pic              try to use only PIC/non-PIC objects [default=use
+                          both]
+  --with-tags[=TAGS]      include additional configurations [automatic]
+  --with-stlport=PATH     the path to STLPort.
+  --with-ft-prefix=PREFIX
+                          Prefix where FreeType is installed (optional)
+  --with-ft-exec-prefix=PREFIX
+                          Exec prefix where FreeType is installed (optional)
+  --with-cppunit-prefix=PFX   Prefix where CppUnit is installed (optional)
+  --with-cppunit-exec-prefix=PFX  Exec prefix where CppUnit is installed (optional)
+  --with-platform=PLATFORM
+                          the platform to build, currently GLX or Win32
+  --with-x                use the X Window System
+  --with-gl-support=PLATFORM
+                          The GLsupport to build (GLX or Win32). Defaults to
+                          the platform. Only set this if you know what you are
+                          doing. Use --with-platform otherwise.
+  --with-gui=type         Select the GUI type to use for dialogs (win32, gtk,
+                          Xt) (default: auto)
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  YACC        The `Yet Another C Compiler' implementation to use. Defaults to
+              the first program found out of: `bison -y', `byacc', `yacc'.
+  YFLAGS      The list of arguments that will be passed by default to $YACC.
+              This script will default YFLAGS to the empty string to avoid a
+              default value of `-d' given by some make applications.
+  CPP         C preprocessor
+  CXXCPP      C++ preprocessor
+  F77         Fortran 77 compiler command
+  FFLAGS      Fortran 77 compiler flags
+  PKG_CONFIG  path to pkg-config utility
+  ZZIPLIB_CFLAGS
+              C compiler flags for ZZIPLIB, overriding pkg-config
+  ZZIPLIB_LIBS
+              linker flags for ZZIPLIB, overriding pkg-config
+  XMKMF       Path to xmkmf, Makefile generator for X Window System
+  GTK_CFLAGS  C compiler flags for GTK, overriding pkg-config
+  GTK_LIBS    linker flags for GTK, overriding pkg-config
+  OPENEXR_CFLAGS
+              C compiler flags for OPENEXR, overriding pkg-config
+  OPENEXR_LIBS
+              linker flags for OPENEXR, overriding pkg-config
+  OIS_CFLAGS  C compiler flags for OIS, overriding pkg-config
+  OIS_LIBS    linker flags for OIS, overriding pkg-config
+  CEGUI_CFLAGS
+              C compiler flags for CEGUI, overriding pkg-config
+  CEGUI_LIBS  linker flags for CEGUI, overriding pkg-config
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" || continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+OGRE configure 1.4.5
+generated by GNU Autoconf 2.61
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by OGRE $as_me 1.4.5, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+	"$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
+do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6; }
+if test "${ac_cv_target+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
+echo "$as_me: error: invalid value of canonical target" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+# New syntax; PACKAGE gets defined as 'OGRE' not 'ogre'
+#AM_INIT_AUTOMAKE([OGRE], 1.4.5)
+am__api_version="1.9"
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+IFS=$as_save_IFS
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.  echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm -f conftest.sed
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+  SET_MAKE=
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE=OGRE
+ VERSION=1.4.5
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+ac_config_headers="$ac_config_headers OgreMain/include/config.h"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6; }
+
+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+{ echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC"   am_compiler_list=
+
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CXXFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX"  am_compiler_list=
+
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+
+
+if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+if test "x$CC" != xcc; then
+  { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
+echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; }
+else
+  { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
+echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; }
+fi
+set dummy $CC; ac_cc=`echo $2 |
+		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+   test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.$ac_ext >&5'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+      rm -f conftest2.*
+      if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+      then
+	# cc works too.
+	:
+      else
+	# cc exists but doesn't like -o.
+	eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_MINUS_C_MINUS_O 1
+_ACEOF
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+IFS=$as_save_IFS
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+for ac_prog in 'bison -y' byacc
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_YACC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$YACC"; then
+  ac_cv_prog_YACC="$YACC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_YACC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+YACC=$ac_cv_prog_YACC
+if test -n "$YACC"; then
+  { echo "$as_me:$LINENO: result: $YACC" >&5
+echo "${ECHO_T}$YACC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$YACC" && break
+done
+test -n "$YACC" || YACC="yacc"
+
+
+for ac_prog in flex lex
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_LEX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$LEX"; then
+  ac_cv_prog_LEX="$LEX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LEX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+LEX=$ac_cv_prog_LEX
+if test -n "$LEX"; then
+  { echo "$as_me:$LINENO: result: $LEX" >&5
+echo "${ECHO_T}$LEX" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$LEX" && break
+done
+test -n "$LEX" || LEX=":"
+
+if test "x$LEX" != "x:"; then
+  cat >conftest.l <<_ACEOF
+%%
+a { ECHO; }
+b { REJECT; }
+c { yymore (); }
+d { yyless (1); }
+e { yyless (input () != 0); }
+f { unput (yytext[0]); }
+. { BEGIN INITIAL; }
+%%
+#ifdef YYTEXT_POINTER
+extern char *yytext;
+#endif
+int
+main (void)
+{
+  return ! yylex () + ! yywrap ();
+}
+_ACEOF
+{ (ac_try="$LEX conftest.l"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$LEX conftest.l") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ echo "$as_me:$LINENO: checking lex output file root" >&5
+echo $ECHO_N "checking lex output file root... $ECHO_C" >&6; }
+if test "${ac_cv_prog_lex_root+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+if test -f lex.yy.c; then
+  ac_cv_prog_lex_root=lex.yy
+elif test -f lexyy.c; then
+  ac_cv_prog_lex_root=lexyy
+else
+  { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
+echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
+echo "${ECHO_T}$ac_cv_prog_lex_root" >&6; }
+LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
+
+if test -z "${LEXLIB+set}"; then
+  { echo "$as_me:$LINENO: checking lex library" >&5
+echo $ECHO_N "checking lex library... $ECHO_C" >&6; }
+if test "${ac_cv_lib_lex+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+    ac_save_LIBS=$LIBS
+    ac_cv_lib_lex='none needed'
+    for ac_lib in '' -lfl -ll; do
+      LIBS="$ac_lib $ac_save_LIBS"
+      cat >conftest.$ac_ext <<_ACEOF
+`cat $LEX_OUTPUT_ROOT.c`
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_lex=$ac_lib
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+      test "$ac_cv_lib_lex" != 'none needed' && break
+    done
+    LIBS=$ac_save_LIBS
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5
+echo "${ECHO_T}$ac_cv_lib_lex" >&6; }
+  test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex
+fi
+
+
+{ echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
+echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6; }
+if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # POSIX says lex can declare yytext either as a pointer or an array; the
+# default is implementation-dependent.  Figure out which it is, since
+# not all implementations provide the %pointer and %array declarations.
+ac_cv_prog_lex_yytext_pointer=no
+ac_save_LIBS=$LIBS
+LIBS="$LEXLIB $ac_save_LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#define YYTEXT_POINTER 1
+`cat $LEX_OUTPUT_ROOT.c`
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_prog_lex_yytext_pointer=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_save_LIBS
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
+echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6; }
+if test $ac_cv_prog_lex_yytext_pointer = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define YYTEXT_POINTER 1
+_ACEOF
+
+fi
+rm -f conftest.l $LEX_OUTPUT_ROOT.c
+
+fi
+if test "$LEX" = :; then
+  LEX=${am_missing_run}flex
+fi
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+	SHARED_FLAGS="-shared -no-undefined -Xlinker --export-all-symbols"
+
+	PLUGIN_FLAGS="-shared -no-undefined -avoid-version"
+
+	GL_LIBS="-lopengl32 -lglu32"
+
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
+set dummy ${ac_tool_prefix}windres; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_RC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RC"; then
+  ac_cv_prog_RC="$RC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RC="${ac_tool_prefix}windres"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RC=$ac_cv_prog_RC
+if test -n "$RC"; then
+  { echo "$as_me:$LINENO: result: $RC" >&5
+echo "${ECHO_T}$RC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RC"; then
+  ac_ct_RC=$RC
+  # Extract the first word of "windres", so it can be a program name with args.
+set dummy windres; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_RC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RC"; then
+  ac_cv_prog_ac_ct_RC="$ac_ct_RC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RC="windres"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RC=$ac_cv_prog_ac_ct_RC
+if test -n "$ac_ct_RC"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_RC" >&5
+echo "${ECHO_T}$ac_ct_RC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_RC" = x; then
+    RC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    RC=$ac_ct_RC
+  fi
+else
+  RC="$ac_cv_prog_RC"
+fi
+
+        nt=true
+;;
+*-*-darwin*)
+        SHARED_FLAGS="-shared"
+
+        PLUGIN_FLAGS="-shared -avoid-version"
+
+        GL_LIBS="-lGL -lGLU"
+
+        osx=true
+;;
+ *) 	SHARED_FLAGS="-shared"
+
+	PLUGIN_FLAGS="-shared -avoid-version"
+
+	GL_LIBS="-lGL -lGLU"
+
+        linux=true
+;;
+esac
+
+
+if test x$nt = xtrue; then
+  OGRE_NT_TRUE=
+  OGRE_NT_FALSE='#'
+else
+  OGRE_NT_TRUE='#'
+  OGRE_NT_FALSE=
+fi
+
+
+
+if test x$linux = xtrue; then
+  OGRE_LINUX_TRUE=
+  OGRE_LINUX_FALSE='#'
+else
+  OGRE_LINUX_TRUE='#'
+  OGRE_LINUX_FALSE=
+fi
+
+
+
+if test x$osx = xtrue ; then
+  OGRE_OSX_TRUE=
+  OGRE_OSX_FALSE='#'
+else
+  OGRE_OSX_TRUE='#'
+  OGRE_OSX_FALSE=
+fi
+
+
+
+# Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval=$enable_static; 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
+else
+  enable_static=no
+fi
+
+
+
+# Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval=$enable_shared; 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
+else
+  enable_shared=yes
+fi
+
+
+# Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval=$enable_fast_install; 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
+else
+  enable_fast_install=yes
+fi
+
+
+{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; }
+if test "${lt_cv_path_SED+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # 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
+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
+
+fi
+
+SED=$lt_cv_path_SED
+{ echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6; }
+
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+    # Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_GREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+    # Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_EGREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+
+   fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+else
+  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; }
+if test "${lt_cv_path_NM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm="$ac_dir/${ac_tool_prefix}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"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+echo "${ECHO_T}$lt_cv_path_NM" >&6; }
+NM="$lt_cv_path_NM"
+
+{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6; }
+fi
+
+{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
+echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; }
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu | 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
+  ;;
+
+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*)
+  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=unknown
+  ;;
+
+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
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  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
+    ;;
+  esac
+  ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; }
+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
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval=$enable_libtool_lock;
+fi
+
+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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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 5550 "configure"' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.o` in
+    *32-bit*)
+      case $host in
+        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-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          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"
+  { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; }
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  lt_cv_cc_needs_belf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	lt_cv_cc_needs_belf=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; }
+  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
+  ;;
+
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
+if test -z "$CXXCPP"; then
+  if test "${ac_cv_prog_CXXCPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+fi
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  { echo "$as_me:$LINENO: result: $F77" >&5
+echo "${ECHO_T}$F77" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$F77" && break
+  done
+fi
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_F77="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+echo "${ECHO_T}$ac_ct_F77" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_F77" && break
+done
+
+  if test "x$ac_ct_F77" = x; then
+    F77=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    F77=$ac_ct_F77
+  fi
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; }
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_f77_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_f77_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_prog_f77_g=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; }
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
+
+G77=`test $ac_compiler_gnu = yes && echo yes`
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+
+# find the maximum length of command line arguments
+{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; }
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    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*)
+    # 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;
+    ;;
+
+  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`
+    ;;
+  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
+    ;;
+  *)
+    # 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.
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+	       = "XX$teststring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
+	    lt_cv_sys_max_cmd_len=$new_result &&
+	    test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    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`
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6; }
+fi
+
+
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+# 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]*\)'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+linux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDGIRSTW]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris* | sysv5*)
+  symcode='[BDRT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# 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
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Try without a prefix undercore, 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.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && 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 <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+	  cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+	  cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+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_prog_compiler_no_builtin_flag"
+	  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && 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" >&5
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -f 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
+
+fi
+
+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
+  { echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6; }
+else
+  { echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6; }
+fi
+
+{ echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }
+if test "${lt_cv_objdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+echo "${ECHO_T}$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+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.
+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'
+
+# 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 avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+for cc_temp in $compiler""; 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-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      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 <<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
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      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 <<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
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+enable_dlopen=no
+enable_win32_dll=no
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then
+  withval=$with_pic; pic_mode="$withval"
+else
+  pic_mode=default
+fi
+
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+#
+# Check for any special shared library compilation flags.
+#
+lt_prog_cc_shlib=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    lt_prog_cc_shlib='-belf'
+    ;;
+  esac
+fi
+if test -n "$lt_prog_cc_shlib"; then
+  { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5
+echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;}
+  if echo "$old_CC $old_CFLAGS " | grep "[ 	]$lt_prog_cc_shlib[ 	]" >/dev/null; then :
+  else
+    { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
+echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
+    lt_cv_prog_cc_can_build_shared=no
+  fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_static_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
+   printf "$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>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
+       $SED '/^$/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works=yes
+       fi
+     else
+       lt_prog_compiler_static_works=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; }
+
+if test x"$lt_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # 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:7819: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:7823: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      else
+	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic='-qnocommon'
+         lt_prog_compiler_wl='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-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_prog_compiler_pic='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-KPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fpic'
+	lt_prog_compiler_static='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic='-Kpic'
+      lt_prog_compiler_static='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic='-Kconform_pic'
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # 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:8081: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:8085: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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:8143: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:8147: \$? = $ac_status" >&5
+   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 > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  runpath_var=
+  allow_undefined_flag=
+  enable_shared_with_static_runtimes=no
+  archive_cmds=
+  archive_expsym_cmds=
+  old_archive_From_new_cmds=
+  old_archive_from_expsyms_cmds=
+  export_dynamic_flag_spec=
+  whole_archive_flag_spec=
+  thread_safe_flag_spec=
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_flag_spec_ld=
+  hardcode_libdir_separator=
+  hardcode_direct=no
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  link_all_deplibs=unknown
+  hardcode_automatic=no
+  module_cmds=
+  module_expsym_cmds=
+  always_export_symbols=no
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # 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'.
+  exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; 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-%%"`
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=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
+    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${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
+	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` 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
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$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)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$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
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec='${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
+	  whole_archive_flag_spec='${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' ;;
+	esac
+	archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$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.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds='$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].*|aix5*)
+	  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.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+
+      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
+  	  hardcode_direct=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct=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
+  	  hardcode_minus_L=yes
+  	  hardcode_libdir_flag_spec='-L$libdir'
+  	  hardcode_libdir_separator=
+	  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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=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.
+	allow_undefined_flag='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag="-z nodefs"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec='${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.
+	  no_undefined_flag=' ${wl}-bernotok'
+	  allow_undefined_flag=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec=' '
+	  archive_cmds_need_lc=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$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)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec=' '
+      allow_undefined_flag=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.
+      archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc=no
+      hardcode_direct=no
+      hardcode_automatic=yes
+      hardcode_shlibpath_var=unsupported
+      whole_archive_flag_spec=''
+      link_all_deplibs=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs=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*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds='$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
+	archive_cmds='$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
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds='$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*|ia64*)
+	  archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld='+b $libdir'
+	  hardcode_libdir_separator=:
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec='-L$libdir'
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator=:
+	  hardcode_direct=yes
+	  export_dynamic_flag_spec='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      link_all_deplibs=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    openbsd*)
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$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'
+      old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      hardcode_libdir_separator=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z text'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	wlarc=''
+	archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds='$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'
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
+      esac
+      link_all_deplibs=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.
+	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds='$CC -r -o $output$reload_objs'
+	  hardcode_direct=no
+        ;;
+	motorola)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=no
+      hardcode_shlibpath_var=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds='$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'
+      hardcode_libdir_flag_spec=
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+echo "${ECHO_T}$ld_shlibs" >&6; }
+test "$ld_shlibs" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag
+        allow_undefined_flag=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc=no
+        else
+	  archive_cmds_need_lc=yes
+        fi
+        allow_undefined_flag=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+echo "${ECHO_T}$archive_cmds_need_lc" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;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'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+   test -n "$runpath_var" || \
+   test "X$hardcode_automatic" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct" != 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_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action" >&5
+echo "${ECHO_T}$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink; 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
+
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
+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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+fi
+
+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*)
+    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
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+   ;;
+
+  *)
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_svld_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_dld_link=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 10354 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 10452 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
+    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
+
+
+# Report which librarie types wil actually be built
+{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6; }
+
+{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
+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
+  ;;
+
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+    ;;
+esac
+{ echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6; }
+
+{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+{ echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6; }
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler \
+    CC \
+    LD \
+    lt_prog_compiler_wl \
+    lt_prog_compiler_pic \
+    lt_prog_compiler_static \
+    lt_prog_compiler_no_builtin_flag \
+    export_dynamic_flag_spec \
+    thread_safe_flag_spec \
+    whole_archive_flag_spec \
+    enable_shared_with_static_runtimes \
+    old_archive_cmds \
+    old_archive_from_new_cmds \
+    predep_objects \
+    postdep_objects \
+    predeps \
+    postdeps \
+    compiler_lib_search_path \
+    archive_cmds \
+    archive_expsym_cmds \
+    postinstall_cmds \
+    postuninstall_cmds \
+    old_archive_from_expsyms_cmds \
+    allow_undefined_flag \
+    no_undefined_flag \
+    export_symbols_cmds \
+    hardcode_libdir_flag_spec \
+    hardcode_libdir_flag_spec_ld \
+    hardcode_libdir_separator \
+    hardcode_automatic \
+    module_cmds \
+    module_expsym_cmds \
+    lt_cv_prog_compiler_c_o \
+    exclude_expsyms \
+    include_expsyms; do
+
+    case $var in
+    old_archive_cmds | \
+    old_archive_from_new_cmds | \
+    archive_cmds | \
+    archive_expsym_cmds | \
+    module_cmds | \
+    module_expsym_cmds | \
+    old_archive_from_expsyms_cmds | \
+    export_symbols_cmds | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  { echo "$as_me:$LINENO: creating $ofile" >&5
+echo "$as_me: creating $ofile" >&6;}
+
+  cat <<__EOF__ >> "$cfgfile"
+#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e 1s/^X//"
+
+# 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
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+
+  case $host_os in
+  aix3*)
+    cat <<\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
+EOF
+    ;;
+  esac
+
+  # 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 '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+# Check whether --with-tags was given.
+if test "${with_tags+set}" = set; then
+  withval=$with_tags; tagnames="$withval"
+fi
+
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
+    else
+      { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
+echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
+    fi
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
+    "") ;;
+    *)  { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
+echo "$as_me: error: invalid tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+	;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
+echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      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_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# 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
+  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
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+for cc_temp in $compiler""; 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-%%"`
+
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+  lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+else
+  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_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
+    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_CXX='${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
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_CXX=
+    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.
+    archive_cmds_CXX='$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
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+ld_shlibs_CXX=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  aix4* | aix5*)
+    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].*|aix5*)
+	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.
+
+    archive_cmds_CXX=''
+    hardcode_direct_CXX=yes
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+
+    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
+	  hardcode_direct_CXX=yes
+	else
+	  # We have old collect2
+	  hardcode_direct_CXX=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
+	  hardcode_minus_L_CXX=yes
+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
+	  hardcode_libdir_separator_CXX=
+	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
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    always_export_symbols_CXX=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.
+      allow_undefined_flag_CXX='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+	allow_undefined_flag_CXX="-z nodefs"
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	hardcode_libdir_flag_spec_CXX='${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.
+	no_undefined_flag_CXX=' ${wl}-bernotok'
+	allow_undefined_flag_CXX=' ${wl}-berok'
+	# -bexpall does not export symbols beginning with underscore (_)
+	always_export_symbols_CXX=yes
+	# Exported symbols can be pulled into shared objects from archives
+	whole_archive_flag_spec_CXX=' '
+	archive_cmds_need_lc_CXX=yes
+	# This is similar to how AIX traditionally builds its shared libraries.
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+    # as there is no search path for DLLs.
+    hardcode_libdir_flag_spec_CXX='-L$libdir'
+    allow_undefined_flag_CXX=unsupported
+    always_export_symbols_CXX=no
+    enable_shared_with_static_runtimes_CXX=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      archive_expsym_cmds_CXX='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}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+  ;;
+      darwin* | rhapsody*)
+        case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      archive_cmds_need_lc_CXX=no
+      hardcode_direct_CXX=no
+      hardcode_automatic_CXX=yes
+      hardcode_shlibpath_var_CXX=unsupported
+      whole_archive_flag_spec_CXX=''
+      link_all_deplibs_CXX=yes
+
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      else
+          archive_cmds_CXX='$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'
+        fi
+        module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_CXX=no
+          ;;
+      esac
+      fi
+        ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      ghcx*)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  freebsd[12]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    ld_shlibs_CXX=no
+    ;;
+  freebsd-elf*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  freebsd* | kfreebsd*-gnu | dragonfly*)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    ld_shlibs_CXX=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    hardcode_direct_CXX=yes
+    hardcode_minus_L_CXX=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
+      ld_shlibs_CXX=no
+      ;;
+    aCC*)
+      archive_cmds_CXX='$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) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        archive_cmds_CXX='$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
+        ld_shlibs_CXX=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case $host_cpu in
+      hppa*64*)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+	hardcode_libdir_separator_CXX=:
+        ;;
+      ia64*)
+	hardcode_libdir_flag_spec_CXX='-L$libdir'
+        ;;
+      *)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+	export_dynamic_flag_spec_CXX='${wl}-E'
+        ;;
+      esac
+    fi
+    case $host_cpu in
+    hppa*64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      ;;
+    ia64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      hardcode_minus_L_CXX=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    *)
+      hardcode_direct_CXX=yes
+      hardcode_minus_L_CXX=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
+	ld_shlibs_CXX=no
+	;;
+      aCC*)
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  archive_cmds_CXX='$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 $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case $host_cpu in
+	    ia64*|hppa*64*)
+	      archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	      ;;
+	    *)
+	      archive_cmds_CXX='$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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC*)
+	# SGI C++
+	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -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.
+	old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test "$with_gnu_ld" = no; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	  else
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	link_all_deplibs_CXX=yes
+	;;
+    esac
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    ;;
+  linux*)
+    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.
+	archive_cmds_CXX='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'
+	archive_expsym_cmds_CXX='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 $list'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc*)
+	# 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."*)
+  	  archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+  	  archive_expsym_cmds_CXX='$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
+  	  archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  ;;
+	esac
+	archive_cmds_need_lc_CXX=no
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      pgCC*)
+        # Portland Group C++ compiler
+	archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+  	archive_expsym_cmds_CXX='$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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${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++
+	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_CXX='$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
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      hardcode_libdir_flag_spec_CXX='-R$libdir'
+      hardcode_direct_CXX=yes
+      hardcode_shlibpath_var_CXX=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::"'
+    ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    ld_shlibs_CXX=no
+    ;;
+  openbsd*)
+    hardcode_direct_CXX=yes
+    hardcode_shlibpath_var_CXX=no
+    archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+      export_dynamic_flag_spec_CXX='${wl}-E'
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
+  osf3*)
+    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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx*)
+	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx*)
+	allow_undefined_flag_CXX=' -expect_unresolved \*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_CXX='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 -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	 archive_cmds_CXX='$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` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  sco*)
+    archive_cmds_need_lc_CXX=no
+    case $cc_basename in
+      CC*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      lcc*)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.2, 5.x and Centerline C++
+        archive_cmds_need_lc_CXX=yes
+	no_undefined_flag_CXX=' -zdefs'
+	archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	archive_expsym_cmds_CXX='$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'
+
+	hardcode_libdir_flag_spec_CXX='-R$libdir'
+	hardcode_shlibpath_var_CXX=no
+	case $host_os in
+	  solaris2.[0-5] | solaris2.[0-5].*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker. We must also pass each convience library through
+	    # to the system linker between allextract/defaultextract.
+	    # The C++ compiler will combine linker options so we
+	    # cannot just pass the convience library names through
+	    # without $wl.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	link_all_deplibs_CXX=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.
+	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx*)
+	# Green Hills C++ Compiler
+	archive_cmds_CXX='$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.
+	old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	;;
+      *)
+	# GNU C++ compiler with Solaris linker
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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.
+	    archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC*)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+esac
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$LD"
+
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+  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 "$compiler_lib_search_path_CXX"; then
+	     compiler_lib_search_path_CXX="${prev}${p}"
+	   else
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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 "$postdeps_CXX"; then
+	   postdeps_CXX="${prev}${p}"
+	 else
+	   postdeps_CXX="${postdeps_CXX} ${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 "$predep_objects_CXX"; then
+	   predep_objects_CXX="$p"
+	 else
+	   predep_objects_CXX="$predep_objects_CXX $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_CXX"; then
+	   postdep_objects_CXX="$p"
+	 else
+	   postdep_objects_CXX="$postdep_objects_CXX $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+solaris*)
+  case $cc_basename in
+  CC*)
+    # 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.
+    postdeps_CXX='-lCstd -lCrun'
+    ;;
+  esac
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # 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_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # 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).
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # 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*)
+	;;
+      *)
+	lt_prog_compiler_pic_CXX='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  lt_prog_compiler_static_CXX='-Bstatic'
+	else
+	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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
+	;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           lt_prog_compiler_pic_CXX='-qnocommon'
+           lt_prog_compiler_wl_CXX='-Wl,'
+           ;;
+         esac
+       ;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    if test "$host_cpu" != ia64; then
+	      lt_prog_compiler_pic_CXX='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      lt_prog_compiler_pic_CXX='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  icpc* | ecpc*)
+	    # Intel C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  pgCC*)
+	    # Portland Group C++ compiler.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fpic'
+	    lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    lt_prog_compiler_pic_CXX='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      sco*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    lt_prog_compiler_wl_CXX='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    lt_prog_compiler_pic_CXX='-pic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      unixware*)
+	;;
+      vxworks*)
+	;;
+      *)
+	lt_prog_compiler_can_build_shared_CXX=no
+	;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_CXX=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   # 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:12703: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:12707: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; }
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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:12765: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:12769: \$? = $ac_status" >&5
+   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 > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # 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
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    export_symbols_cmds_CXX='$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'
+  ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_CXX
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+        allow_undefined_flag_CXX=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_CXX=no
+        else
+	  archive_cmds_need_lc_CXX=yes
+        fi
+        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;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'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+   test -n "$runpath_var_CXX" || \
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_CXX" != 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_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6; }
+
+if test "$hardcode_action_CXX" = relink; 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
+
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
+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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+fi
+
+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*)
+    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
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+   ;;
+
+  *)
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_svld_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_dld_link=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 14109 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 14207 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
+    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
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_CXX \
+    CC_CXX \
+    LD_CXX \
+    lt_prog_compiler_wl_CXX \
+    lt_prog_compiler_pic_CXX \
+    lt_prog_compiler_static_CXX \
+    lt_prog_compiler_no_builtin_flag_CXX \
+    export_dynamic_flag_spec_CXX \
+    thread_safe_flag_spec_CXX \
+    whole_archive_flag_spec_CXX \
+    enable_shared_with_static_runtimes_CXX \
+    old_archive_cmds_CXX \
+    old_archive_from_new_cmds_CXX \
+    predep_objects_CXX \
+    postdep_objects_CXX \
+    predeps_CXX \
+    postdeps_CXX \
+    compiler_lib_search_path_CXX \
+    archive_cmds_CXX \
+    archive_expsym_cmds_CXX \
+    postinstall_cmds_CXX \
+    postuninstall_cmds_CXX \
+    old_archive_from_expsyms_cmds_CXX \
+    allow_undefined_flag_CXX \
+    no_undefined_flag_CXX \
+    export_symbols_cmds_CXX \
+    hardcode_libdir_flag_spec_CXX \
+    hardcode_libdir_flag_spec_ld_CXX \
+    hardcode_libdir_separator_CXX \
+    hardcode_automatic_CXX \
+    module_cmds_CXX \
+    module_expsym_cmds_CXX \
+    lt_cv_prog_compiler_c_o_CXX \
+    exclude_expsyms_CXX \
+    include_expsyms_CXX; do
+
+    case $var in
+    old_archive_cmds_CXX | \
+    old_archive_from_new_cmds_CXX | \
+    archive_cmds_CXX | \
+    archive_expsym_cmds_CXX | \
+    module_cmds_CXX | \
+    module_expsym_cmds_CXX | \
+    old_archive_from_expsyms_cmds_CXX | \
+    export_symbols_cmds_CXX | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+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
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      F77)
+	if test -n "$F77" && test "X$F77" != "Xno"; then
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+compiler_F77=$CC
+for cc_temp in $compiler""; 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-%%"`
+
+
+{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6; }
+
+{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
+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
+  ;;
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+esac
+{ echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6; }
+
+{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+{ echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6; }
+
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+GCC_F77="$G77"
+LD_F77="$LD"
+
+lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_F77='-Wl,'
+    lt_prog_compiler_static_F77='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_F77='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_F77=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_F77=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic_F77='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_F77='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      else
+	lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic_F77='-qnocommon'
+         lt_prog_compiler_wl_F77='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_F77='-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_prog_compiler_pic_F77='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-KPIC'
+	lt_prog_compiler_static_F77='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-fpic'
+	lt_prog_compiler_static_F77='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_F77='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_F77='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic_F77='-Kpic'
+      lt_prog_compiler_static_F77='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl_F77='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl_F77='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_F77='-Qoption ld '
+      lt_prog_compiler_pic_F77='-PIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_F77='-Kconform_pic'
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_F77='-pic'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_F77=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_F77"
+   # 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:15092: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:15096: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_F77=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; }
+
+if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+    case $lt_prog_compiler_pic_F77 in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+     esac
+else
+    lt_prog_compiler_pic_F77=
+     lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_F77=
+    ;;
+  *)
+    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_F77=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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:15154: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:15158: \$? = $ac_status" >&5
+   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 > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_F77=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  runpath_var=
+  allow_undefined_flag_F77=
+  enable_shared_with_static_runtimes_F77=no
+  archive_cmds_F77=
+  archive_expsym_cmds_F77=
+  old_archive_From_new_cmds_F77=
+  old_archive_from_expsyms_cmds_F77=
+  export_dynamic_flag_spec_F77=
+  whole_archive_flag_spec_F77=
+  thread_safe_flag_spec_F77=
+  hardcode_libdir_flag_spec_F77=
+  hardcode_libdir_flag_spec_ld_F77=
+  hardcode_libdir_separator_F77=
+  hardcode_direct_F77=no
+  hardcode_minus_L_F77=no
+  hardcode_shlibpath_var_F77=unsupported
+  link_all_deplibs_F77=unknown
+  hardcode_automatic_F77=no
+  module_cmds_F77=
+  module_expsym_cmds_F77=
+  always_export_symbols_F77=no
+  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_F77=
+  # 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'.
+  exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; 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-%%"`
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_F77=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
+    hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_F77='${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
+	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_F77=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` 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
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_F77=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$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)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_F77=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_F77=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=no
+      enable_shared_with_static_runtimes_F77=yes
+      export_symbols_cmds_F77='$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
+        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_F77='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec_F77='${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
+	  whole_archive_flag_spec_F77='${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' ;;
+	esac
+	archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_F77=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_F77" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_F77=
+      export_dynamic_flag_spec_F77=
+      whole_archive_flag_spec_F77=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=yes
+      archive_expsym_cmds_F77='$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.
+      hardcode_minus_L_F77=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_F77=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_F77='$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].*|aix5*)
+	  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.
+
+      archive_cmds_F77=''
+      hardcode_direct_F77=yes
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+
+      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
+  	  hardcode_direct_F77=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct_F77=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
+  	  hardcode_minus_L_F77=yes
+  	  hardcode_libdir_flag_spec_F77='-L$libdir'
+  	  hardcode_libdir_separator_F77=
+	  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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_F77=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.
+	allow_undefined_flag_F77='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_F77="-z nodefs"
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec_F77='${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.
+	  no_undefined_flag_F77=' ${wl}-bernotok'
+	  allow_undefined_flag_F77=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols_F77=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec_F77=' '
+	  archive_cmds_need_lc_F77=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$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)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_F77=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_F77=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec_F77=' '
+      allow_undefined_flag_F77=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.
+      archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_F77='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_F77=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc_F77=no
+      hardcode_direct_F77=no
+      hardcode_automatic_F77=yes
+      hardcode_shlibpath_var_F77=unsupported
+      whole_archive_flag_spec_F77=''
+      link_all_deplibs_F77=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_F77=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_F77=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*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$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
+	archive_cmds_F77='$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
+      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_direct_F77=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_F77=yes
+      export_dynamic_flag_spec_F77='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$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*|ia64*)
+	  archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+	  hardcode_libdir_separator_F77=:
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec_F77='-L$libdir'
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_F77=:
+	  hardcode_direct_F77=yes
+	  export_dynamic_flag_spec_F77='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      link_all_deplibs_F77=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    newsos6)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_F77='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec_F77='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      allow_undefined_flag_F77=unsupported
+      archive_cmds_F77='$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'
+      old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag_F77=' -z text'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	wlarc=''
+	archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds_F77='$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'
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_shlibpath_var_F77=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
+      esac
+      link_all_deplibs_F77=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.
+	archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_F77='$CC -r -o $output$reload_objs'
+	  hardcode_direct_F77=no
+        ;;
+	motorola)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_F77=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_F77=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_F77='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag_F77=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_F77='$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'
+      hardcode_libdir_flag_spec_F77=
+      hardcode_shlibpath_var_F77=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      ld_shlibs_F77=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+echo "${ECHO_T}$ld_shlibs_F77" >&6; }
+test "$ld_shlibs_F77" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_F77=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_F77 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_F77
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+        allow_undefined_flag_F77=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_F77=no
+        else
+	  archive_cmds_need_lc_F77=yes
+        fi
+        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;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'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" || \
+   test -n "$runpath_var_F77" || \
+   test "X$hardcode_automatic_F77" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_F77" != 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_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+     test "$hardcode_minus_L_F77" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_F77=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_F77=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_F77=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+echo "${ECHO_T}$hardcode_action_F77" >&6; }
+
+if test "$hardcode_action_F77" = relink; 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
+
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
+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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+fi
+
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_F77 \
+    CC_F77 \
+    LD_F77 \
+    lt_prog_compiler_wl_F77 \
+    lt_prog_compiler_pic_F77 \
+    lt_prog_compiler_static_F77 \
+    lt_prog_compiler_no_builtin_flag_F77 \
+    export_dynamic_flag_spec_F77 \
+    thread_safe_flag_spec_F77 \
+    whole_archive_flag_spec_F77 \
+    enable_shared_with_static_runtimes_F77 \
+    old_archive_cmds_F77 \
+    old_archive_from_new_cmds_F77 \
+    predep_objects_F77 \
+    postdep_objects_F77 \
+    predeps_F77 \
+    postdeps_F77 \
+    compiler_lib_search_path_F77 \
+    archive_cmds_F77 \
+    archive_expsym_cmds_F77 \
+    postinstall_cmds_F77 \
+    postuninstall_cmds_F77 \
+    old_archive_from_expsyms_cmds_F77 \
+    allow_undefined_flag_F77 \
+    no_undefined_flag_F77 \
+    export_symbols_cmds_F77 \
+    hardcode_libdir_flag_spec_F77 \
+    hardcode_libdir_flag_spec_ld_F77 \
+    hardcode_libdir_separator_F77 \
+    hardcode_automatic_F77 \
+    module_cmds_F77 \
+    module_expsym_cmds_F77 \
+    lt_cv_prog_compiler_c_o_F77 \
+    exclude_expsyms_F77 \
+    include_expsyms_F77; do
+
+    case $var in
+    old_archive_cmds_F77 | \
+    old_archive_from_new_cmds_F77 | \
+    archive_cmds_F77 | \
+    archive_expsym_cmds_F77 | \
+    module_cmds_F77 | \
+    module_expsym_cmds_F77 | \
+    old_archive_from_expsyms_cmds_F77 | \
+    export_symbols_cmds_F77 | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_F77
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_F77
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_F77
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_F77"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      GCJ)
+	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+objext_GCJ=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+compiler_GCJ=$CC
+for cc_temp in $compiler""; 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-%%"`
+
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+archive_cmds_need_lc_GCJ=no
+
+old_archive_cmds_GCJ=$old_archive_cmds
+
+
+lt_prog_compiler_no_builtin_flag_GCJ=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # 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:17279: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:17283: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl_GCJ=
+lt_prog_compiler_pic_GCJ=
+lt_prog_compiler_static_GCJ=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_GCJ='-Wl,'
+    lt_prog_compiler_static_GCJ='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_GCJ='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_GCJ=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_GCJ=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_prog_compiler_pic_GCJ='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_GCJ='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      else
+	lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic_GCJ='-qnocommon'
+         lt_prog_compiler_wl_GCJ='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # 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).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_GCJ='-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_prog_compiler_pic_GCJ='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+	lt_prog_compiler_wl_GCJ='-Wl,'
+	lt_prog_compiler_pic_GCJ='-KPIC'
+	lt_prog_compiler_static_GCJ='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl_GCJ='-Wl,'
+	lt_prog_compiler_pic_GCJ='-fpic'
+	lt_prog_compiler_static_GCJ='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_GCJ='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_GCJ='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic_GCJ='-Kpic'
+      lt_prog_compiler_static_GCJ='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl_GCJ='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl_GCJ='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_GCJ='-Qoption ld '
+      lt_prog_compiler_pic_GCJ='-PIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_GCJ='-Kconform_pic'
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_GCJ='-pic'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_GCJ"; then
+
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_GCJ=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
+   # 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:17541: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:17545: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_GCJ=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; }
+
+if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+    case $lt_prog_compiler_pic_GCJ in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
+     esac
+else
+    lt_prog_compiler_pic_GCJ=
+     lt_prog_compiler_can_build_shared_GCJ=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_GCJ=
+    ;;
+  *)
+    lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_GCJ=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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:17603: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:17607: \$? = $ac_status" >&5
+   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 > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_GCJ=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  runpath_var=
+  allow_undefined_flag_GCJ=
+  enable_shared_with_static_runtimes_GCJ=no
+  archive_cmds_GCJ=
+  archive_expsym_cmds_GCJ=
+  old_archive_From_new_cmds_GCJ=
+  old_archive_from_expsyms_cmds_GCJ=
+  export_dynamic_flag_spec_GCJ=
+  whole_archive_flag_spec_GCJ=
+  thread_safe_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_ld_GCJ=
+  hardcode_libdir_separator_GCJ=
+  hardcode_direct_GCJ=no
+  hardcode_minus_L_GCJ=no
+  hardcode_shlibpath_var_GCJ=unsupported
+  link_all_deplibs_GCJ=unknown
+  hardcode_automatic_GCJ=no
+  module_cmds_GCJ=
+  module_expsym_cmds_GCJ=
+  always_export_symbols_GCJ=no
+  export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_GCJ=
+  # 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'.
+  exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; 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-%%"`
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_GCJ=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
+    hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_GCJ='${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
+	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_GCJ=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` 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
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_GCJ=no
+	cat <<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.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$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)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_GCJ=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_GCJ=unsupported
+	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=no
+      enable_shared_with_static_runtimes_GCJ=yes
+      export_symbols_cmds_GCJ='$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
+        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_GCJ='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec_GCJ='${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
+	  whole_archive_flag_spec_GCJ='${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' ;;
+	esac
+	archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_GCJ=no
+	cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_GCJ" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_GCJ=
+      export_dynamic_flag_spec_GCJ=
+      whole_archive_flag_spec_GCJ=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=yes
+      archive_expsym_cmds_GCJ='$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.
+      hardcode_minus_L_GCJ=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_GCJ=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+	  export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_GCJ='$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].*|aix5*)
+	  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.
+
+      archive_cmds_GCJ=''
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_separator_GCJ=':'
+      link_all_deplibs_GCJ=yes
+
+      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
+  	  hardcode_direct_GCJ=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct_GCJ=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
+  	  hardcode_minus_L_GCJ=yes
+  	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
+  	  hardcode_libdir_separator_GCJ=
+	  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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_GCJ=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.
+	allow_undefined_flag_GCJ='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_GCJ="-z nodefs"
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec_GCJ='${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.
+	  no_undefined_flag_GCJ=' ${wl}-bernotok'
+	  allow_undefined_flag_GCJ=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols_GCJ=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec_GCJ=' '
+	  archive_cmds_need_lc_GCJ=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$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)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_GCJ=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_GCJ=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec_GCJ=' '
+      allow_undefined_flag_GCJ=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.
+      archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_GCJ='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_GCJ=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc_GCJ=no
+      hardcode_direct_GCJ=no
+      hardcode_automatic_GCJ=yes
+      hardcode_shlibpath_var_GCJ=unsupported
+      whole_archive_flag_spec_GCJ=''
+      link_all_deplibs_GCJ=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_GCJ=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_GCJ=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*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$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
+	archive_cmds_GCJ='$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
+      hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_direct_GCJ=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_GCJ=yes
+      export_dynamic_flag_spec_GCJ='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_GCJ='$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*|ia64*)
+	  archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
+	  hardcode_libdir_separator_GCJ=:
+	  hardcode_direct_GCJ=no
+	  hardcode_shlibpath_var_GCJ=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
+	  hardcode_direct_GCJ=no
+	  hardcode_shlibpath_var_GCJ=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_GCJ=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_GCJ=:
+	  hardcode_direct_GCJ=yes
+	  export_dynamic_flag_spec_GCJ='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_GCJ=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      link_all_deplibs_GCJ=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    newsos6)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_GCJ='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec_GCJ='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      allow_undefined_flag_GCJ=unsupported
+      archive_cmds_GCJ='$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'
+      old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_GCJ=' -expect_unresolved \*'
+	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_GCJ=' -expect_unresolved \*'
+	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag_GCJ=' -z text'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	wlarc=''
+	archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds_GCJ='$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'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
+      esac
+      link_all_deplibs_GCJ=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.
+	archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_GCJ=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_GCJ='$CC -r -o $output$reload_objs'
+	  hardcode_direct_GCJ=no
+        ;;
+	motorola)
+	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_GCJ=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_GCJ=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=no
+      hardcode_shlibpath_var_GCJ=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_GCJ='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag_GCJ=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_GCJ='$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'
+      hardcode_libdir_flag_spec_GCJ=
+      hardcode_shlibpath_var_GCJ=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    *)
+      ld_shlibs_GCJ=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+echo "${ECHO_T}$ld_shlibs_GCJ" >&6; }
+test "$ld_shlibs_GCJ" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_GCJ" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_GCJ=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_GCJ 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_GCJ
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
+        allow_undefined_flag_GCJ=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_GCJ=no
+        else
+	  archive_cmds_need_lc_GCJ=yes
+        fi
+        allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;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'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action_GCJ=
+if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+   test -n "$runpath_var_GCJ" || \
+   test "X$hardcode_automatic_GCJ" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_GCJ" != 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_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
+     test "$hardcode_minus_L_GCJ" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_GCJ=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_GCJ=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_GCJ=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+echo "${ECHO_T}$hardcode_action_GCJ" >&6; }
+
+if test "$hardcode_action_GCJ" = relink; 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
+
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
+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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+fi
+
+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*)
+    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
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+   ;;
+
+  *)
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_svld_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_dld_link=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 19814 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 19912 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
+    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
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_GCJ \
+    CC_GCJ \
+    LD_GCJ \
+    lt_prog_compiler_wl_GCJ \
+    lt_prog_compiler_pic_GCJ \
+    lt_prog_compiler_static_GCJ \
+    lt_prog_compiler_no_builtin_flag_GCJ \
+    export_dynamic_flag_spec_GCJ \
+    thread_safe_flag_spec_GCJ \
+    whole_archive_flag_spec_GCJ \
+    enable_shared_with_static_runtimes_GCJ \
+    old_archive_cmds_GCJ \
+    old_archive_from_new_cmds_GCJ \
+    predep_objects_GCJ \
+    postdep_objects_GCJ \
+    predeps_GCJ \
+    postdeps_GCJ \
+    compiler_lib_search_path_GCJ \
+    archive_cmds_GCJ \
+    archive_expsym_cmds_GCJ \
+    postinstall_cmds_GCJ \
+    postuninstall_cmds_GCJ \
+    old_archive_from_expsyms_cmds_GCJ \
+    allow_undefined_flag_GCJ \
+    no_undefined_flag_GCJ \
+    export_symbols_cmds_GCJ \
+    hardcode_libdir_flag_spec_GCJ \
+    hardcode_libdir_flag_spec_ld_GCJ \
+    hardcode_libdir_separator_GCJ \
+    hardcode_automatic_GCJ \
+    module_cmds_GCJ \
+    module_expsym_cmds_GCJ \
+    lt_cv_prog_compiler_c_o_GCJ \
+    exclude_expsyms_GCJ \
+    include_expsyms_GCJ; do
+
+    case $var in
+    old_archive_cmds_GCJ | \
+    old_archive_from_new_cmds_GCJ | \
+    archive_cmds_GCJ | \
+    archive_expsym_cmds_GCJ | \
+    module_cmds_GCJ | \
+    module_expsym_cmds_GCJ | \
+    old_archive_from_expsyms_cmds_GCJ | \
+    export_symbols_cmds_GCJ | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_GCJ
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_GCJ
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_GCJ
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_GCJ
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_GCJ
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_GCJ
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_GCJ
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_GCJ
+archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_GCJ
+module_expsym_cmds=$lt_module_expsym_cmds_GCJ
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_GCJ
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_GCJ
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_GCJ
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_GCJ
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_GCJ
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_GCJ
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_GCJ
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_GCJ
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_GCJ
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_GCJ"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_GCJ
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_GCJ
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_GCJ
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_GCJ
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      RC)
+
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+objext_RC=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# 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.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+compiler_RC=$CC
+for cc_temp in $compiler""; 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_cv_prog_compiler_c_o_RC=yes
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_RC \
+    CC_RC \
+    LD_RC \
+    lt_prog_compiler_wl_RC \
+    lt_prog_compiler_pic_RC \
+    lt_prog_compiler_static_RC \
+    lt_prog_compiler_no_builtin_flag_RC \
+    export_dynamic_flag_spec_RC \
+    thread_safe_flag_spec_RC \
+    whole_archive_flag_spec_RC \
+    enable_shared_with_static_runtimes_RC \
+    old_archive_cmds_RC \
+    old_archive_from_new_cmds_RC \
+    predep_objects_RC \
+    postdep_objects_RC \
+    predeps_RC \
+    postdeps_RC \
+    compiler_lib_search_path_RC \
+    archive_cmds_RC \
+    archive_expsym_cmds_RC \
+    postinstall_cmds_RC \
+    postuninstall_cmds_RC \
+    old_archive_from_expsyms_cmds_RC \
+    allow_undefined_flag_RC \
+    no_undefined_flag_RC \
+    export_symbols_cmds_RC \
+    hardcode_libdir_flag_spec_RC \
+    hardcode_libdir_flag_spec_ld_RC \
+    hardcode_libdir_separator_RC \
+    hardcode_automatic_RC \
+    module_cmds_RC \
+    module_expsym_cmds_RC \
+    lt_cv_prog_compiler_c_o_RC \
+    exclude_expsyms_RC \
+    include_expsyms_RC; do
+
+    case $var in
+    old_archive_cmds_RC | \
+    old_archive_from_new_cmds_RC | \
+    archive_cmds_RC | \
+    archive_expsym_cmds_RC | \
+    module_cmds_RC | \
+    module_expsym_cmds_RC | \
+    old_archive_from_expsyms_cmds_RC | \
+    export_symbols_cmds_RC | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_RC
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_RC
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_RC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_RC
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_RC
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_RC
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_RC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_RC
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_RC
+archive_expsym_cmds=$lt_archive_expsym_cmds_RC
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_RC
+module_expsym_cmds=$lt_module_expsym_cmds_RC
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_RC
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_RC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_RC
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_RC
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_RC
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_RC
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_RC
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_RC
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_RC
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_RC
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_RC"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_RC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_RC
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_RC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_RC
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	;;
+
+      *)
+	{ { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
+echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+	;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
+echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Prevent multiple expansion
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# 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
+  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
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+for cc_temp in $compiler""; 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-%%"`
+
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+  lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+else
+  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_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
+    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_CXX='${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
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_CXX=
+    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.
+    archive_cmds_CXX='$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
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+ld_shlibs_CXX=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  aix4* | aix5*)
+    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].*|aix5*)
+	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.
+
+    archive_cmds_CXX=''
+    hardcode_direct_CXX=yes
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+
+    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
+	  hardcode_direct_CXX=yes
+	else
+	  # We have old collect2
+	  hardcode_direct_CXX=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
+	  hardcode_minus_L_CXX=yes
+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
+	  hardcode_libdir_separator_CXX=
+	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
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    always_export_symbols_CXX=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.
+      allow_undefined_flag_CXX='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+	allow_undefined_flag_CXX="-z nodefs"
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	hardcode_libdir_flag_spec_CXX='${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.
+	no_undefined_flag_CXX=' ${wl}-bernotok'
+	allow_undefined_flag_CXX=' ${wl}-berok'
+	# -bexpall does not export symbols beginning with underscore (_)
+	always_export_symbols_CXX=yes
+	# Exported symbols can be pulled into shared objects from archives
+	whole_archive_flag_spec_CXX=' '
+	archive_cmds_need_lc_CXX=yes
+	# This is similar to how AIX traditionally builds its shared libraries.
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+    # as there is no search path for DLLs.
+    hardcode_libdir_flag_spec_CXX='-L$libdir'
+    allow_undefined_flag_CXX=unsupported
+    always_export_symbols_CXX=no
+    enable_shared_with_static_runtimes_CXX=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      archive_expsym_cmds_CXX='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}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+  ;;
+      darwin* | rhapsody*)
+        case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      archive_cmds_need_lc_CXX=no
+      hardcode_direct_CXX=no
+      hardcode_automatic_CXX=yes
+      hardcode_shlibpath_var_CXX=unsupported
+      whole_archive_flag_spec_CXX=''
+      link_all_deplibs_CXX=yes
+
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      else
+          archive_cmds_CXX='$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'
+        fi
+        module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_CXX=no
+          ;;
+      esac
+      fi
+        ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      ghcx*)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  freebsd[12]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    ld_shlibs_CXX=no
+    ;;
+  freebsd-elf*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  freebsd* | kfreebsd*-gnu | dragonfly*)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    ld_shlibs_CXX=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    hardcode_direct_CXX=yes
+    hardcode_minus_L_CXX=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
+      ld_shlibs_CXX=no
+      ;;
+    aCC*)
+      archive_cmds_CXX='$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) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        archive_cmds_CXX='$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
+        ld_shlibs_CXX=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case $host_cpu in
+      hppa*64*)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+	hardcode_libdir_separator_CXX=:
+        ;;
+      ia64*)
+	hardcode_libdir_flag_spec_CXX='-L$libdir'
+        ;;
+      *)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+	export_dynamic_flag_spec_CXX='${wl}-E'
+        ;;
+      esac
+    fi
+    case $host_cpu in
+    hppa*64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      ;;
+    ia64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      hardcode_minus_L_CXX=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    *)
+      hardcode_direct_CXX=yes
+      hardcode_minus_L_CXX=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
+	ld_shlibs_CXX=no
+	;;
+      aCC*)
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  archive_cmds_CXX='$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 $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case $host_cpu in
+	    ia64*|hppa*64*)
+	      archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	      ;;
+	    *)
+	      archive_cmds_CXX='$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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC*)
+	# SGI C++
+	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -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.
+	old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test "$with_gnu_ld" = no; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	  else
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	link_all_deplibs_CXX=yes
+	;;
+    esac
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    ;;
+  linux*)
+    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.
+	archive_cmds_CXX='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'
+	archive_expsym_cmds_CXX='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 $list'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc*)
+	# 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."*)
+  	  archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+  	  archive_expsym_cmds_CXX='$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
+  	  archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  ;;
+	esac
+	archive_cmds_need_lc_CXX=no
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      pgCC*)
+        # Portland Group C++ compiler
+	archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+  	archive_expsym_cmds_CXX='$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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${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++
+	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_CXX='$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
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      hardcode_libdir_flag_spec_CXX='-R$libdir'
+      hardcode_direct_CXX=yes
+      hardcode_shlibpath_var_CXX=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::"'
+    ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    ld_shlibs_CXX=no
+    ;;
+  openbsd*)
+    hardcode_direct_CXX=yes
+    hardcode_shlibpath_var_CXX=no
+    archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+      export_dynamic_flag_spec_CXX='${wl}-E'
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
+  osf3*)
+    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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx*)
+	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  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.
+	archive_cmds_CXX='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'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx*)
+	allow_undefined_flag_CXX=' -expect_unresolved \*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_CXX='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 -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# 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 $templist | $SED "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 $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	 archive_cmds_CXX='$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` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # 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
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  sco*)
+    archive_cmds_need_lc_CXX=no
+    case $cc_basename in
+      CC*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      lcc*)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.2, 5.x and Centerline C++
+        archive_cmds_need_lc_CXX=yes
+	no_undefined_flag_CXX=' -zdefs'
+	archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	archive_expsym_cmds_CXX='$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'
+
+	hardcode_libdir_flag_spec_CXX='-R$libdir'
+	hardcode_shlibpath_var_CXX=no
+	case $host_os in
+	  solaris2.[0-5] | solaris2.[0-5].*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker. We must also pass each convience library through
+	    # to the system linker between allextract/defaultextract.
+	    # The C++ compiler will combine linker options so we
+	    # cannot just pass the convience library names through
+	    # without $wl.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	link_all_deplibs_CXX=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.
+	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx*)
+	# Green Hills C++ Compiler
+	archive_cmds_CXX='$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.
+	old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	;;
+      *)
+	# GNU C++ compiler with Solaris linker
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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.
+	    archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$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
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC*)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+esac
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$LD"
+
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+  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 "$compiler_lib_search_path_CXX"; then
+	     compiler_lib_search_path_CXX="${prev}${p}"
+	   else
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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 "$postdeps_CXX"; then
+	   postdeps_CXX="${prev}${p}"
+	 else
+	   postdeps_CXX="${postdeps_CXX} ${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 "$predep_objects_CXX"; then
+	   predep_objects_CXX="$p"
+	 else
+	   predep_objects_CXX="$predep_objects_CXX $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_CXX"; then
+	   postdep_objects_CXX="$p"
+	 else
+	   postdep_objects_CXX="$postdep_objects_CXX $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+solaris*)
+  case $cc_basename in
+  CC*)
+    # 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.
+    postdeps_CXX='-lCstd -lCrun'
+    ;;
+  esac
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # 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_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # 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).
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # 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*)
+	;;
+      *)
+	lt_prog_compiler_pic_CXX='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  lt_prog_compiler_static_CXX='-Bstatic'
+	else
+	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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
+	;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           lt_prog_compiler_pic_CXX='-qnocommon'
+           lt_prog_compiler_wl_CXX='-Wl,'
+           ;;
+         esac
+       ;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    if test "$host_cpu" != ia64; then
+	      lt_prog_compiler_pic_CXX='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      lt_prog_compiler_pic_CXX='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  icpc* | ecpc*)
+	    # Intel C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  pgCC*)
+	    # Portland Group C++ compiler.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fpic'
+	    lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    lt_prog_compiler_pic_CXX='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      sco*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    lt_prog_compiler_wl_CXX='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    lt_prog_compiler_pic_CXX='-pic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      unixware*)
+	;;
+      vxworks*)
+	;;
+      *)
+	lt_prog_compiler_can_build_shared_CXX=no
+	;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_CXX=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   # 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:22529: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:22533: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; }
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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:22591: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:22595: \$? = $ac_status" >&5
+   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 > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # 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
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    export_symbols_cmds_CXX='$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'
+  ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_CXX
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+        allow_undefined_flag_CXX=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_CXX=no
+        else
+	  archive_cmds_need_lc_CXX=yes
+        fi
+        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  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 ';' >/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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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'
+  ;;
+
+aix4* | aix5*)
+  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<name>.so
+      # instead of lib<name>.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*)
+  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'
+  ;;
+
+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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  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
+  ;;
+
+kfreebsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    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'
+  ;;
+
+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*)
+  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
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;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'
+  ;;
+
+knetbsd*-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
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU 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=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
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+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.2uw2* | sysv4.3* | sysv5*)
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
+
+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
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+   test -n "$runpath_var_CXX" || \
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_CXX" != 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_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6; }
+
+if test "$hardcode_action_CXX" = relink; 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
+
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
+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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+fi
+
+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*)
+    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
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+   ;;
+
+  *)
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_svld_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_dld_link=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 23935 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 24033 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#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); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
+    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
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_CXX \
+    CC_CXX \
+    LD_CXX \
+    lt_prog_compiler_wl_CXX \
+    lt_prog_compiler_pic_CXX \
+    lt_prog_compiler_static_CXX \
+    lt_prog_compiler_no_builtin_flag_CXX \
+    export_dynamic_flag_spec_CXX \
+    thread_safe_flag_spec_CXX \
+    whole_archive_flag_spec_CXX \
+    enable_shared_with_static_runtimes_CXX \
+    old_archive_cmds_CXX \
+    old_archive_from_new_cmds_CXX \
+    predep_objects_CXX \
+    postdep_objects_CXX \
+    predeps_CXX \
+    postdeps_CXX \
+    compiler_lib_search_path_CXX \
+    archive_cmds_CXX \
+    archive_expsym_cmds_CXX \
+    postinstall_cmds_CXX \
+    postuninstall_cmds_CXX \
+    old_archive_from_expsyms_cmds_CXX \
+    allow_undefined_flag_CXX \
+    no_undefined_flag_CXX \
+    export_symbols_cmds_CXX \
+    hardcode_libdir_flag_spec_CXX \
+    hardcode_libdir_flag_spec_ld_CXX \
+    hardcode_libdir_separator_CXX \
+    hardcode_automatic_CXX \
+    module_cmds_CXX \
+    module_expsym_cmds_CXX \
+    lt_cv_prog_compiler_c_o_CXX \
+    exclude_expsyms_CXX \
+    include_expsyms_CXX; do
+
+    case $var in
+    old_archive_cmds_CXX | \
+    old_archive_from_new_cmds_CXX | \
+    archive_cmds_CXX | \
+    archive_expsym_cmds_CXX | \
+    module_cmds_CXX | \
+    module_expsym_cmds_CXX | \
+    old_archive_from_expsyms_cmds_CXX | \
+    export_symbols_cmds_CXX | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# 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.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+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
+
+
+# OGRE_CFLAGS contains the compiler flags crucial for stand-alone client
+# programs. They are exported via pkg-config, but not used while building
+# Ogre itself; instead, they are defined in config.h.
+
+
+# Check if compiler supports symbol visibility
+# There are quirks for x86_64 and debug builds with gcc < 4.2
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+{ echo "$as_me:$LINENO: checking if $CXX supports -fvisibility" >&5
+echo $ECHO_N "checking if $CXX supports -fvisibility... $ECHO_C" >&6; }
+if test "${ogre_prog_compiler_supports_visibility+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ogre_prog_compiler_supports_visibility=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fvisibility=hidden -fvisibility-inlines-hidden"
+   # 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:24592: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:24596: \$? = $ac_status" >&5
+   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 >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       ogre_prog_compiler_supports_visibility=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $ogre_prog_compiler_supports_visibility" >&5
+echo "${ECHO_T}$ogre_prog_compiler_supports_visibility" >&6; }
+
+if test x"$ogre_prog_compiler_supports_visibility" = xyes; then
+    CFLAGS_VISIBILITY="-fvisibility=hidden -fvisibility-inlines-hidden -DOGRE_GCC_VISIBILITY";
+    case $target_cpu in
+        x86_64* )
+            if ! echo "$CFLAGS $CXXFLAGS" | grep -q "\-O"; then
+                echo "***********************************************************************"
+                echo "WARNING: It looks like you're doing a debug build for an x86_64 target."
+                echo "The -fvisibility-inlines-hidden flag is known to give problems in such"
+                echo "situations with libstdc++ < 4.2. Disabling the compiler flag."
+                echo "***********************************************************************"
+                CFLAGS_VISIBILITY="-fvisibility=hidden -DOGRE_GCC_VISIBILITY"
+            fi
+        ;;
+    esac
+    case $CXX in
+        icpc )
+            echo "***********************************************************************"
+            echo "WARNING: The intel compiler currently has bugs in its -fvisibility"
+            echo "implementation. Disabling the compiler flag."
+            echo "***********************************************************************"
+            CFLAGS_VISIBILITY=""
+        ;;
+    esac
+
+else
+    :
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# Check whether --with-stlport was given.
+if test "${with_stlport+set}" = set; then
+  withval=$with_stlport; ac_cv_use_stlport=$withval
+else
+  ac_cv_use_stlport=no
+fi
+
+ { echo "$as_me:$LINENO: checking whether to use STLPort" >&5
+echo $ECHO_N "checking whether to use STLPort... $ECHO_C" >&6; }
+if test "${ac_cv_use_stlport+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_use_stlport=no
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_use_stlport" >&5
+echo "${ECHO_T}$ac_cv_use_stlport" >&6; }
+ if test x$ac_cv_use_stlport != xno; then
+     STLPORT_CFLAGS="-I$ac_cv_use_stlport/stlport"
+     STLPORT_LIBS="-L$ac_cv_use_stlport/lib -lstlport"
+ fi
+
+
+
+
+# Check whether --with-ft-prefix was given.
+if test "${with_ft_prefix+set}" = set; then
+  withval=$with_ft_prefix; ft_config_prefix="$withval"
+else
+  ft_config_prefix=""
+fi
+
+
+# Check whether --with-ft-exec-prefix was given.
+if test "${with_ft_exec_prefix+set}" = set; then
+  withval=$with_ft_exec_prefix; ft_config_exec_prefix="$withval"
+else
+  ft_config_exec_prefix=""
+fi
+
+# Check whether --enable-freetypetest was given.
+if test "${enable_freetypetest+set}" = set; then
+  enableval=$enable_freetypetest;
+else
+  enable_fttest=yes
+fi
+
+
+if test x$ft_config_exec_prefix != x ; then
+  ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
+  if test x${FT2_CONFIG+set} != xset ; then
+    FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
+  fi
+fi
+if test x$ft_config_prefix != x ; then
+  ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
+  if test x${FT2_CONFIG+set} != xset ; then
+    FT2_CONFIG=$ft_config_prefix/bin/freetype-config
+  fi
+fi
+# Extract the first word of "freetype-config", so it can be a program name with args.
+set dummy freetype-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_FT2_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $FT2_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_FT2_CONFIG="$FT2_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_FT2_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_FT2_CONFIG" && ac_cv_path_FT2_CONFIG="no"
+  ;;
+esac
+fi
+FT2_CONFIG=$ac_cv_path_FT2_CONFIG
+if test -n "$FT2_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $FT2_CONFIG" >&5
+echo "${ECHO_T}$FT2_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+
+min_ft_version=9.0.0
+{ echo "$as_me:$LINENO: checking for FreeType - version >= $min_ft_version" >&5
+echo $ECHO_N "checking for FreeType - version >= $min_ft_version... $ECHO_C" >&6; }
+no_ft=""
+if test "$FT2_CONFIG" = "no" ; then
+  no_ft=yes
+else
+  FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
+  FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
+  ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+  ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+  ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+  ft_min_major_version=`echo $min_ft_version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+  ft_min_minor_version=`echo $min_ft_version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+  ft_min_micro_version=`echo $min_ft_version | \
+         sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+  if test x$enable_fttest = xyes ; then
+    ft_config_is_lt=""
+    if test $ft_config_major_version -lt $ft_min_major_version ; then
+      ft_config_is_lt=yes
+    else
+      if test $ft_config_major_version -eq $ft_min_major_version ; then
+        if test $ft_config_minor_version -lt $ft_min_minor_version ; then
+          ft_config_is_lt=yes
+        else
+          if test $ft_config_minor_version -eq $ft_min_minor_version ; then
+            if test $ft_config_micro_version -lt $ft_min_micro_version ; then
+              ft_config_is_lt=yes
+            fi
+          fi
+        fi
+      fi
+    fi
+    if test x$ft_config_is_lt = xyes ; then
+      no_ft=yes
+    else
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $FT2_CFLAGS"
+      LIBS="$FT2_LIBS $LIBS"
+      if test "$cross_compiling" = yes; then
+  echo $ac_n "cross compiling; assumed OK... $ac_c"
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main()
+{
+  FT_Library library;
+  FT_Error error;
+
+  error = FT_Init_FreeType(&library);
+
+  if (error)
+    return 1;
+  else
+  {
+    FT_Done_FreeType(library);
+    return 0;
+  }
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+no_ft=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+      CFLAGS="$ac_save_CFLAGS"
+      LIBS="$ac_save_LIBS"
+    fi             # test $ft_config_version -lt $ft_min_version
+  fi               # test x$enable_fttest = xyes
+fi                 # test "$FT2_CONFIG" = "no"
+if test x$no_ft = x ; then
+   { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+   :
+else
+   { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+   if test "$FT2_CONFIG" = "no" ; then
+     echo "*** The freetype-config script installed by FreeType 2 could not be found."
+     echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in"
+     echo "*** your path, or set the FT2_CONFIG environment variable to the"
+     echo "*** full path to freetype-config."
+   else
+     if test x$ft_config_is_lt = xyes ; then
+       echo "*** Your installed version of the FreeType 2 library is too old."
+       echo "*** If you have different versions of FreeType 2, make sure that"
+       echo "*** correct values for --with-ft-prefix or --with-ft-exec-prefix"
+       echo "*** are used, or set the FT2_CONFIG environment variable to the"
+       echo "*** full path to freetype-config."
+     else
+       echo "*** The FreeType test program failed to run.  If your system uses"
+       echo "*** shared libraries and they are installed outside the normal"
+       echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
+       echo "*** (or whatever is appropiate for your system) is correctly set."
+     fi
+   fi
+   FT2_CFLAGS=""
+   FT2_LIBS=""
+   :
+fi
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDL 1
+_ACEOF
+
+  LIBS="-ldl $LIBS"
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for pow in -lm" >&5
+echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6; }
+if test "${ac_cv_lib_m_pow+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pow ();
+int
+main ()
+{
+return pow ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_m_pow=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_m_pow=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5
+echo "${ECHO_T}$ac_cv_lib_m_pow" >&6; }
+if test $ac_cv_lib_m_pow = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for gzopen in -lz" >&5
+echo $ECHO_N "checking for gzopen in -lz... $ECHO_C" >&6; }
+if test "${ac_cv_lib_z_gzopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gzopen ();
+int
+main ()
+{
+return gzopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_z_gzopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_z_gzopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzopen" >&5
+echo "${ECHO_T}$ac_cv_lib_z_gzopen" >&6; }
+if test $ac_cv_lib_z_gzopen = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBZ 1
+_ACEOF
+
+  LIBS="-lz $LIBS"
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
+echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; }
+if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_pthread_pthread_create=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_pthread_pthread_create=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; }
+if test $ac_cv_lib_pthread_pthread_create = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPTHREAD 1
+_ACEOF
+
+  LIBS="-lpthread $LIBS"
+
+fi
+
+{ echo "$as_me:$LINENO: checking for snprintf" >&5
+echo $ECHO_N "checking for snprintf... $ECHO_C" >&6; }
+if test "${ac_cv_func_snprintf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define snprintf to an innocuous variant, in case <limits.h> declares snprintf.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define snprintf innocuous_snprintf
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char snprintf (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef snprintf
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char snprintf ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_snprintf || defined __stub___snprintf
+choke me
+#endif
+
+int
+main ()
+{
+return snprintf ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_snprintf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_snprintf=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_snprintf" >&5
+echo "${ECHO_T}$ac_cv_func_snprintf" >&6; }
+if test $ac_cv_func_snprintf = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SNPRINTF
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking for vsnprintf" >&5
+echo $ECHO_N "checking for vsnprintf... $ECHO_C" >&6; }
+if test "${ac_cv_func_vsnprintf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define vsnprintf to an innocuous variant, in case <limits.h> declares vsnprintf.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define vsnprintf innocuous_vsnprintf
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char vsnprintf (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef vsnprintf
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char vsnprintf ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_vsnprintf || defined __stub___vsnprintf
+choke me
+#endif
+
+int
+main ()
+{
+return vsnprintf ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_vsnprintf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_vsnprintf=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_vsnprintf" >&5
+echo "${ECHO_T}$ac_cv_func_vsnprintf" >&6; }
+if test $ac_cv_func_vsnprintf = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_VSNPRINTF
+_ACEOF
+
+fi
+
+
+
+
+
+
+# Check whether --with-cppunit-prefix was given.
+if test "${with_cppunit_prefix+set}" = set; then
+  withval=$with_cppunit_prefix; cppunit_config_prefix="$withval"
+else
+  cppunit_config_prefix=""
+fi
+
+
+# Check whether --with-cppunit-exec-prefix was given.
+if test "${with_cppunit_exec_prefix+set}" = set; then
+  withval=$with_cppunit_exec_prefix; cppunit_config_exec_prefix="$withval"
+else
+  cppunit_config_exec_prefix=""
+fi
+
+
+  if test x$cppunit_config_exec_prefix != x ; then
+     cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix"
+     if test x${CPPUNIT_CONFIG+set} != xset ; then
+        CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config
+     fi
+  fi
+  if test x$cppunit_config_prefix != x ; then
+     cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix"
+     if test x${CPPUNIT_CONFIG+set} != xset ; then
+        CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config
+     fi
+  fi
+
+  # Extract the first word of "cppunit-config", so it can be a program name with args.
+set dummy cppunit-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_CPPUNIT_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $CPPUNIT_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CPPUNIT_CONFIG="$CPPUNIT_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CPPUNIT_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_CPPUNIT_CONFIG" && ac_cv_path_CPPUNIT_CONFIG="no"
+  ;;
+esac
+fi
+CPPUNIT_CONFIG=$ac_cv_path_CPPUNIT_CONFIG
+if test -n "$CPPUNIT_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $CPPUNIT_CONFIG" >&5
+echo "${ECHO_T}$CPPUNIT_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  cppunit_version_min=1.10.0
+
+  { echo "$as_me:$LINENO: checking for Cppunit - version >= $cppunit_version_min" >&5
+echo $ECHO_N "checking for Cppunit - version >= $cppunit_version_min... $ECHO_C" >&6; }
+  no_cppunit=""
+  if test "$CPPUNIT_CONFIG" = "no" ; then
+    no_cppunit=yes
+  else
+    CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags`
+    CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs`
+    cppunit_version=`$CPPUNIT_CONFIG --version`
+
+    cppunit_major_version=`echo $cppunit_version | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+    cppunit_minor_version=`echo $cppunit_version | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+    cppunit_micro_version=`echo $cppunit_version | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+
+    cppunit_major_min=`echo $cppunit_version_min | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+    cppunit_minor_min=`echo $cppunit_version_min | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+    cppunit_micro_min=`echo $cppunit_version_min | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+
+    cppunit_version_proper=`expr \
+        $cppunit_major_version \> $cppunit_major_min \| \
+        $cppunit_major_version \= $cppunit_major_min \& \
+        $cppunit_minor_version \> $cppunit_minor_min \| \
+        $cppunit_major_version \= $cppunit_major_min \& \
+        $cppunit_minor_version \= $cppunit_minor_min \& \
+        $cppunit_micro_version \>= $cppunit_micro_min `
+
+    if test "$cppunit_version_proper" = "1" ; then
+      { echo "$as_me:$LINENO: result: $cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version" >&5
+echo "${ECHO_T}$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version" >&6; }
+    else
+      { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+      no_cppunit=yes
+    fi
+  fi
+
+  if test "x$no_cppunit" = x ; then
+     build_unit_tests=true
+  else
+     CPPUNIT_CFLAGS=""
+     CPPUNIT_LIBS=""
+     :
+  fi
+
+
+
+
+
+
+if test x$build_unit_tests = xtrue; then
+  BUILD_UNIT_TESTS_TRUE=
+  BUILD_UNIT_TESTS_FALSE='#'
+else
+  BUILD_UNIT_TESTS_TRUE='#'
+  BUILD_UNIT_TESTS_FALSE=
+fi
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.9.0
+	{ echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; }
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	else
+		{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+		PKG_CONFIG=""
+	fi
+
+fi
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for ZZIPLIB" >&5
+echo $ECHO_N "checking for ZZIPLIB... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$ZZIPLIB_CFLAGS"; then
+        pkg_cv_ZZIPLIB_CFLAGS="$ZZIPLIB_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"zziplib\"") >&5
+  ($PKG_CONFIG --exists --print-errors "zziplib") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_ZZIPLIB_CFLAGS=`$PKG_CONFIG --cflags "zziplib" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$ZZIPLIB_LIBS"; then
+        pkg_cv_ZZIPLIB_LIBS="$ZZIPLIB_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"zziplib\"") >&5
+  ($PKG_CONFIG --exists --print-errors "zziplib") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_ZZIPLIB_LIBS=`$PKG_CONFIG --libs "zziplib" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        ZZIPLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "zziplib"`
+        else
+	        ZZIPLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "zziplib"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$ZZIPLIB_PKG_ERRORS" >&5
+
+	{ { echo "$as_me:$LINENO: error: Package requirements (zziplib) were not met:
+
+$ZZIPLIB_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables ZZIPLIB_CFLAGS
+and ZZIPLIB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&5
+echo "$as_me: error: Package requirements (zziplib) were not met:
+
+$ZZIPLIB_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables ZZIPLIB_CFLAGS
+and ZZIPLIB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&2;}
+   { (exit 1); exit 1; }; }
+elif test $pkg_failed = untried; then
+	{ { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables ZZIPLIB_CFLAGS
+and ZZIPLIB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&5
+echo "$as_me: error: The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables ZZIPLIB_CFLAGS
+and ZZIPLIB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+	ZZIPLIB_CFLAGS=$pkg_cv_ZZIPLIB_CFLAGS
+	ZZIPLIB_LIBS=$pkg_cv_ZZIPLIB_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	:
+fi
+
+
+
+OGRE_PLATFORM=GLX
+
+# Check whether --with-platform was given.
+if test "${with_platform+set}" = set; then
+  withval=$with_platform; OGRE_PLATFORM=$withval
+else
+  OGRE_PLATFORM=GLX
+fi
+
+
+  PLATFORM_CFLAGS=""
+  PLATFORM_LIBS=""
+
+    case $OGRE_PLATFORM in
+    GLX)
+
+for ac_header in X11/Intrinsic.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  { { echo "$as_me:$LINENO: error: \"libxt headers not found\"" >&5
+echo "$as_me: error: \"libxt headers not found\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+
+for ac_header in X11/Xaw/Command.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  { { echo "$as_me:$LINENO: error: \"libxaw headers not found\"" >&5
+echo "$as_me: error: \"libxaw headers not found\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+
+for ac_header in X11/extensions/xf86vmode.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  { { echo "$as_me:$LINENO: error: \"libxf86vm headers not found\"" >&5
+echo "$as_me: error: \"libxf86vm headers not found\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+
+for ac_header in X11/extensions/Xrandr.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  { { echo "$as_me:$LINENO: error: \"libxrandr headers not found\"" >&5
+echo "$as_me: error: \"libxrandr headers not found\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+      { echo "$as_me:$LINENO: checking for X" >&5
+echo $ECHO_N "checking for X... $ECHO_C" >&6; }
+
+
+# Check whether --with-x was given.
+if test "${with_x+set}" = set; then
+  withval=$with_x;
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  case $x_includes,$x_libraries in #(
+    *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5
+echo "$as_me: error: Cannot use X directory names containing '" >&2;}
+   { (exit 1); exit 1; }; };; #(
+    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -f -r conftest.dir
+if mkdir conftest.dir; then
+  cd conftest.dir
+  cat >Imakefile <<'_ACEOF'
+incroot:
+	@echo incroot='${INCROOT}'
+usrlibdir:
+	@echo usrlibdir='${USRLIBDIR}'
+libdir:
+	@echo libdir='${LIBDIR}'
+_ACEOF
+  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    for ac_var in incroot usrlibdir libdir; do
+      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+    done
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl; do
+      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
+	ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case $ac_im_incroot in
+	/usr/include) ac_x_includes= ;;
+	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+    esac
+    case $ac_im_usrlibdir in
+	/usr/lib | /lib) ;;
+	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+    esac
+  fi
+  cd ..
+  rm -f -r conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+  # Guess where to find include files, by looking for Xlib.h.
+  # First, try using that file with no special directory specified.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  for ac_dir in $ac_x_header_dirs; do
+  if test -r "$ac_dir/X11/Xlib.h"; then
+    ac_x_includes=$ac_dir
+    break
+  fi
+done
+fi
+
+rm -f conftest.err conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+  # Check for the libraries.
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS=$LIBS
+  LIBS="-lX11 $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize ()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS=$ac_save_LIBS
+for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+  # Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl; do
+    if test -r "$ac_dir/libX11.$ac_extension"; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+case $ac_x_includes,$ac_x_libraries in #(
+  no,* | *,no | *\'*)
+    # Didn't find X, or a directory has "'" in its name.
+    ac_cv_have_x="have_x=no";; #(
+  *)
+    # Record where we found X for the cache.
+    ac_cv_have_x="have_x=yes\
+	ac_x_includes='$ac_x_includes'\
+	ac_x_libraries='$ac_x_libraries'"
+esac
+fi
+;; #(
+    *) have_x=yes;;
+  esac
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  { echo "$as_me:$LINENO: result: $have_x" >&5
+echo "${ECHO_T}$have_x" >&6; }
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes\
+	ac_x_includes='$x_includes'\
+	ac_x_libraries='$x_libraries'"
+  { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; }
+fi
+
+      if test x"$x_includes" != x; then
+        if test x"$x_includes" != xNONE; then
+          PLATFORM_CFLAGS="-I$x_includes"
+        fi
+      fi
+      if test x"$x_libraries" != x; then
+        if test x"$x_libraries" != xNONE; then
+          PLATFORM_LIBS="-L$x_libraries -lX11 -lXaw"
+        fi
+            else
+        PLATFORM_LIBS="-lX11 -lXaw"
+      fi
+    ;;
+    Win32)
+      PLATFORM_CFLAGS=""
+      PLATFORM_LIBS="-lgdi32 -lwinmm -ldinput8 -ldxguid"
+    ;;
+  esac
+
+
+
+
+
+OGRE_GLSUPPORT=none
+
+# Check whether --with-gl-support was given.
+if test "${with_gl_support+set}" = set; then
+  withval=$with_gl_support; OGRE_GLSUPPORT=$withval
+else
+  OGRE_GLSUPPORT=none
+fi
+
+
+  if test "$OGRE_GLSUPPORT" = "none" ; then
+    OGRE_GLSUPPORT="$OGRE_PLATFORM"
+    { echo "$as_me:$LINENO: setting gl-support to platform: $OGRE_GLSUPPORT" >&5
+echo "$as_me: setting gl-support to platform: $OGRE_GLSUPPORT" >&6;}
+  fi
+  if test "$OGRE_GLSUPPORT" = "Win32" ; then
+    # Uppercase/lowercase
+    OGRE_GLSUPPORT=win32
+  fi
+
+  GLSUPPORT_CFLAGS=""
+  GLSUPPORT_LIBS=""
+
+    case $OGRE_GLSUPPORT in
+    GLX)
+        { echo "$as_me:$LINENO: checking for X" >&5
+echo $ECHO_N "checking for X... $ECHO_C" >&6; }
+
+
+# Check whether --with-x was given.
+if test "${with_x+set}" = set; then
+  withval=$with_x;
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  case $x_includes,$x_libraries in #(
+    *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5
+echo "$as_me: error: Cannot use X directory names containing '" >&2;}
+   { (exit 1); exit 1; }; };; #(
+    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -f -r conftest.dir
+if mkdir conftest.dir; then
+  cd conftest.dir
+  cat >Imakefile <<'_ACEOF'
+incroot:
+	@echo incroot='${INCROOT}'
+usrlibdir:
+	@echo usrlibdir='${USRLIBDIR}'
+libdir:
+	@echo libdir='${LIBDIR}'
+_ACEOF
+  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    for ac_var in incroot usrlibdir libdir; do
+      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+    done
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl; do
+      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
+	ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case $ac_im_incroot in
+	/usr/include) ac_x_includes= ;;
+	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+    esac
+    case $ac_im_usrlibdir in
+	/usr/lib | /lib) ;;
+	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+    esac
+  fi
+  cd ..
+  rm -f -r conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+  # Guess where to find include files, by looking for Xlib.h.
+  # First, try using that file with no special directory specified.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  for ac_dir in $ac_x_header_dirs; do
+  if test -r "$ac_dir/X11/Xlib.h"; then
+    ac_x_includes=$ac_dir
+    break
+  fi
+done
+fi
+
+rm -f conftest.err conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+  # Check for the libraries.
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS=$LIBS
+  LIBS="-lX11 $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize ()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS=$ac_save_LIBS
+for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+  # Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl; do
+    if test -r "$ac_dir/libX11.$ac_extension"; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+case $ac_x_includes,$ac_x_libraries in #(
+  no,* | *,no | *\'*)
+    # Didn't find X, or a directory has "'" in its name.
+    ac_cv_have_x="have_x=no";; #(
+  *)
+    # Record where we found X for the cache.
+    ac_cv_have_x="have_x=yes\
+	ac_x_includes='$ac_x_includes'\
+	ac_x_libraries='$ac_x_libraries'"
+esac
+fi
+;; #(
+    *) have_x=yes;;
+  esac
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  { echo "$as_me:$LINENO: result: $have_x" >&5
+echo "${ECHO_T}$have_x" >&6; }
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes\
+	ac_x_includes='$x_includes'\
+	ac_x_libraries='$x_libraries'"
+  { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; }
+fi
+
+        if test x"$x_includes" != x; then
+          if test x"$x_includes" != xNONE; then
+            GLSUPPORT_CFLAGS="-I$x_includes"
+          fi
+        fi
+        if test x"$x_libraries" != x; then
+          if test x"$x_libraries" != xNONE; then
+            GLSUPPORT_LIBS="-L$x_libraries -lX11 -lXext -lGL -lXrandr -lXxf86vm"
+          fi
+                else
+          GLSUPPORT_LIBS="-lX11 -lXext -lGL -lXrandr -lXxf86vm"
+        fi
+    ;;
+    win32)
+	GLSUPPORT_CFLAGS=""
+	GLSUPPORT_LIBS="-lgdi32 -lwinmm"
+    ;;
+  esac
+
+
+
+
+  ac_config_files="$ac_config_files RenderSystems/GL/src/GLX/Makefile RenderSystems/GL/src/win32/Makefile"
+
+
+
+
+
+# Check whether --with-gui was given.
+if test "${with_gui+set}" = set; then
+  withval=$with_gui; with_gui=${withval}
+else
+  with_gui=auto
+fi
+
+
+    #remove any old files
+    rm -f OgreMain/src/OgreConfigDialog.lo OgreMain/src/OgreErrorDialog.lo
+
+    # Prefer win32, then gtk, then Xt
+    if test "x$with_gui" == "xauto" && test "x$OGRE_PLATFORM" == "xWIN32"; then
+        with_gui=win32
+    fi
+
+    if test "x$with_gui" == "xauto" || test "x$with_gui" == "xgtk"; then
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for GTK" >&5
+echo $ECHO_N "checking for GTK... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$GTK_CFLAGS"; then
+        pkg_cv_GTK_CFLAGS="$GTK_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.0.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.0.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.0.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$GTK_LIBS"; then
+        pkg_cv_GTK_LIBS="$GTK_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.0.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.0.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_GTK_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= 2.0.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gtk+-2.0 >= 2.0.0"`
+        else
+	        GTK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gtk+-2.0 >= 2.0.0"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$GTK_PKG_ERRORS" >&5
+
+
+            if test "x$with_gui" == "xgtk"; then
+                { { echo "$as_me:$LINENO: error: You chose gtk for the GUI but gtk is not available." >&5
+echo "$as_me: error: You chose gtk for the GUI but gtk is not available." >&2;}
+   { (exit 1); exit 1; }; }
+            fi
+
+elif test $pkg_failed = untried; then
+
+            if test "x$with_gui" == "xgtk"; then
+                { { echo "$as_me:$LINENO: error: You chose gtk for the GUI but gtk is not available." >&5
+echo "$as_me: error: You chose gtk for the GUI but gtk is not available." >&2;}
+   { (exit 1); exit 1; }; }
+            fi
+
+else
+	GTK_CFLAGS=$pkg_cv_GTK_CFLAGS
+	GTK_LIBS=$pkg_cv_GTK_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	with_gui=gtk
+fi
+    fi
+
+    if test "x$with_gui" == "xauto"; then
+        with_gui=Xt
+    fi
+
+    if test "x$with_gui" == "xwin32"; then
+        OGRE_GUI=WIN32
+    elif test "x$with_gui" == "xgtk"; then
+        OGRE_GUI=gtk
+    elif test "x$with_gui" == "xXt"; then
+        OGRE_GUI=GLX
+        PLATFORM_LIBS="$PLATFORM_LIBS -lXt -lSM -lICE"
+    else
+        { { echo "$as_me:$LINENO: error: The GUI dialogs for $with_gui are not available." >&5
+echo "$as_me: error: The GUI dialogs for $with_gui are not available." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    # Add the OGRE_GUI_xxx flag to compiler command line
+    PLATFORM_CFLAGS="$PLATFORM_CFLAGS -DOGRE_GUI_$OGRE_GUI"
+    # And export it to client applications as well
+    OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_GUI_$OGRE_GUI"
+
+
+
+
+
+
+# Check whether --enable-double was given.
+if test "${enable_double+set}" = set; then
+  enableval=$enable_double; build_double=$enableval
+else
+  build_double=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether to use double floating point precision" >&5
+echo $ECHO_N "checking whether to use double floating point precision... $ECHO_C" >&6; }
+	case $build_double in
+        yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define OGRE_DOUBLE_PRECISION 1
+_ACEOF
+
+			OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_DOUBLE_PRECISION"
+			{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+        ;;
+        *)
+
+cat >>confdefs.h <<\_ACEOF
+#define OGRE_DOUBLE_PRECISION 0
+_ACEOF
+
+			{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+        ;;
+    esac
+
+
+# Check whether --enable-threading was given.
+if test "${enable_threading+set}" = set; then
+  enableval=$enable_threading; build_threads=$enableval
+else
+  build_threads=no
+fi
+
+    case $build_threads in
+        yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define OGRE_THREAD_SUPPORT 1
+_ACEOF
+
+            OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_THREAD_SUPPORT"
+            # Check for the C++ Boost library
+            { echo "$as_me:$LINENO: checking for main in -lboost_thread" >&5
+echo $ECHO_N "checking for main in -lboost_thread... $ECHO_C" >&6; }
+if test "${ac_cv_lib_boost_thread_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lboost_thread  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_boost_thread_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_boost_thread_main=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_boost_thread_main" >&5
+echo "${ECHO_T}$ac_cv_lib_boost_thread_main" >&6; }
+if test $ac_cv_lib_boost_thread_main = yes; then
+  OGRE_THREAD_LIBS="-lboost_thread"
+else
+
+                { echo "$as_me:$LINENO: checking for main in -lboost_thread-mt" >&5
+echo $ECHO_N "checking for main in -lboost_thread-mt... $ECHO_C" >&6; }
+if test "${ac_cv_lib_boost_thread_mt_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lboost_thread-mt  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_boost_thread_mt_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_boost_thread_mt_main=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_boost_thread_mt_main" >&5
+echo "${ECHO_T}$ac_cv_lib_boost_thread_mt_main" >&6; }
+if test $ac_cv_lib_boost_thread_mt_main = yes; then
+  OGRE_THREAD_LIBS="-lboost_thread-mt"
+else
+
+                    { { echo "$as_me:$LINENO: error: You need the C++ boost libraries." >&5
+echo "$as_me: error: You need the C++ boost libraries." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+
+        ;;
+        *)
+
+cat >>confdefs.h <<\_ACEOF
+#define OGRE_THREAD_SUPPORT 0
+_ACEOF
+
+            OGRE_THREAD_LIBS=""
+            { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+        ;;
+    esac
+
+
+# Check whether --enable-freeimage was given.
+if test "${enable_freeimage+set}" = set; then
+  enableval=$enable_freeimage; build_freeimage=$enableval
+else
+  build_freeimage=yes
+fi
+
+
+
+
+
+if test x$build_freeimage = xyes; then
+  USE_FREEIMAGE_TRUE=
+  USE_FREEIMAGE_FALSE='#'
+else
+  USE_FREEIMAGE_TRUE='#'
+  USE_FREEIMAGE_FALSE=
+fi
+
+
+if test "x$build_freeimage" = "xyes" ; then
+
+{ echo "$as_me:$LINENO: checking for FreeImage_Load in -lfreeimage" >&5
+echo $ECHO_N "checking for FreeImage_Load in -lfreeimage... $ECHO_C" >&6; }
+if test "${ac_cv_lib_freeimage_FreeImage_Load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lfreeimage -lstdc++ $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char FreeImage_Load ();
+int
+main ()
+{
+return FreeImage_Load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_freeimage_FreeImage_Load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_freeimage_FreeImage_Load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_freeimage_FreeImage_Load" >&5
+echo "${ECHO_T}$ac_cv_lib_freeimage_FreeImage_Load" >&6; }
+if test $ac_cv_lib_freeimage_FreeImage_Load = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBFREEIMAGE 1
+_ACEOF
+
+  LIBS="-lfreeimage $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error:
+****************************************************************
+* You do not have FreeImage installed.  This is required.      *
+* You may find it at http://freeimage.sourceforge.net/.        *
+* Note: You can also provide --disable-freeimage to the build  *
+* process to build without it. This is an advanced option      *
+* useful only if you provide your own image loading codecs.    *
+****************************************************************" >&5
+echo "$as_me: error:
+****************************************************************
+* You do not have FreeImage installed.  This is required.      *
+* You may find it at http://freeimage.sourceforge.net/.        *
+* Note: You can also provide --disable-freeimage to the build  *
+* process to build without it. This is an advanced option      *
+* useful only if you provide your own image loading codecs.    *
+****************************************************************" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+cat >>confdefs.h <<\_ACEOF
+#define OGRE_NO_FREEIMAGE 0
+_ACEOF
+
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define OGRE_NO_FREEIMAGE 1
+_ACEOF
+
+	OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_NO_FREEIMAGE"
+fi
+
+
+
+# Check whether --enable-devil was given.
+if test "${enable_devil+set}" = set; then
+  enableval=$enable_devil; build_il=$enableval
+else
+  build_il=yes
+fi
+
+
+
+
+if test x$build_il = xyes && test x$build_freeimage = xno; then
+  USE_DEVIL_TRUE=
+  USE_DEVIL_FALSE='#'
+else
+  USE_DEVIL_TRUE='#'
+  USE_DEVIL_FALSE=
+fi
+
+
+if test "x$build_freeimage" = "xyes"; then
+    { echo "$as_me:$LINENO: Freeimage is being built, disabling check for DevIL." >&5
+echo "$as_me: Freeimage is being built, disabling check for DevIL." >&6;}
+    build_il=no
+
+cat >>confdefs.h <<\_ACEOF
+#define OGRE_NO_DEVIL 1
+_ACEOF
+
+else
+if test "x$build_il" = "xyes"; then
+
+{ echo "$as_me:$LINENO: checking for ilInit in -lIL" >&5
+echo $ECHO_N "checking for ilInit in -lIL... $ECHO_C" >&6; }
+if test "${ac_cv_lib_IL_ilInit+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lIL  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ilInit ();
+int
+main ()
+{
+return ilInit ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_IL_ilInit=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_IL_ilInit=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_IL_ilInit" >&5
+echo "${ECHO_T}$ac_cv_lib_IL_ilInit" >&6; }
+if test $ac_cv_lib_IL_ilInit = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBIL 1
+_ACEOF
+
+  LIBS="-lIL $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error:
+****************************************************************
+* You do not have DevIL installed.  This is required to build. *
+* You may find it at http://openil.sourceforge.net/.           *
+* Note: You can also provide --disable-devil to the build      *
+* process to build without DevIL. This is an advanced option   *
+* useful only if you provide your own image loading codecs.    *
+****************************************************************" >&5
+echo "$as_me: error:
+****************************************************************
+* You do not have DevIL installed.  This is required to build. *
+* You may find it at http://openil.sourceforge.net/.           *
+* Note: You can also provide --disable-devil to the build      *
+* process to build without DevIL. This is an advanced option   *
+* useful only if you provide your own image loading codecs.    *
+****************************************************************" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+{ echo "$as_me:$LINENO: checking for iluFlipImage in -lILU" >&5
+echo $ECHO_N "checking for iluFlipImage in -lILU... $ECHO_C" >&6; }
+if test "${ac_cv_lib_ILU_iluFlipImage+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lILU  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char iluFlipImage ();
+int
+main ()
+{
+return iluFlipImage ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_ILU_iluFlipImage=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_ILU_iluFlipImage=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_ILU_iluFlipImage" >&5
+echo "${ECHO_T}$ac_cv_lib_ILU_iluFlipImage" >&6; }
+if test $ac_cv_lib_ILU_iluFlipImage = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBILU 1
+_ACEOF
+
+  LIBS="-lILU $LIBS"
+
+fi
+
+
+cat >>confdefs.h <<\_ACEOF
+#define OGRE_NO_DEVIL 0
+_ACEOF
+
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define OGRE_NO_DEVIL 1
+_ACEOF
+
+fi
+fi
+
+
+# Check whether --enable-cg was given.
+if test "${enable_cg+set}" = set; then
+  enableval=$enable_cg; build_cg=$enableval
+else
+  build_cg=yes
+fi
+
+
+if test "x$build_cg" = "xyes" ; then
+
+{ echo "$as_me:$LINENO: checking for cgCreateProgram in -lCg" >&5
+echo $ECHO_N "checking for cgCreateProgram in -lCg... $ECHO_C" >&6; }
+if test "${ac_cv_lib_Cg_cgCreateProgram+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lCg  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cgCreateProgram ();
+int
+main ()
+{
+return cgCreateProgram ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_Cg_cgCreateProgram=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_Cg_cgCreateProgram=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_Cg_cgCreateProgram" >&5
+echo "${ECHO_T}$ac_cv_lib_Cg_cgCreateProgram" >&6; }
+if test $ac_cv_lib_Cg_cgCreateProgram = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBCG 1
+_ACEOF
+
+  LIBS="-lCg $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error:
+	****************************************************************
+	* You do not have the nVidia Cg libraries installed.           *
+	* Go to http://developer.nvidia.com/object/cg_toolkit.html     *
+	* (Click on Cg_Linux.tar.gz).                                  *
+	* You can disable the building of Cg support by providing      *
+	* --disable-cg to this configure script but this is highly     *
+	* discouraged as this breaks many of the examples.             *
+	****************************************************************" >&5
+echo "$as_me: error:
+	****************************************************************
+	* You do not have the nVidia Cg libraries installed.           *
+	* Go to http://developer.nvidia.com/object/cg_toolkit.html     *
+	* (Click on Cg_Linux.tar.gz).                                  *
+	* You can disable the building of Cg support by providing      *
+	* --disable-cg to this configure script but this is highly     *
+	* discouraged as this breaks many of the examples.             *
+	****************************************************************" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+
+fi
+
+
+
+if test x$build_cg = xyes; then
+  BUILD_CGPLUGIN_TRUE=
+  BUILD_CGPLUGIN_FALSE='#'
+else
+  BUILD_CGPLUGIN_TRUE='#'
+  BUILD_CGPLUGIN_FALSE=
+fi
+
+
+
+# Check whether --enable-openexr was given.
+if test "${enable_openexr+set}" = set; then
+  enableval=$enable_openexr; build_exr=$enableval
+else
+  build_exr=no
+fi
+
+
+if test "x$build_exr" = "xyes" ; then
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for OPENEXR" >&5
+echo $ECHO_N "checking for OPENEXR... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$OPENEXR_CFLAGS"; then
+        pkg_cv_OPENEXR_CFLAGS="$OPENEXR_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"OpenEXR\"") >&5
+  ($PKG_CONFIG --exists --print-errors "OpenEXR") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_OPENEXR_CFLAGS=`$PKG_CONFIG --cflags "OpenEXR" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$OPENEXR_LIBS"; then
+        pkg_cv_OPENEXR_LIBS="$OPENEXR_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"OpenEXR\"") >&5
+  ($PKG_CONFIG --exists --print-errors "OpenEXR") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_OPENEXR_LIBS=`$PKG_CONFIG --libs "OpenEXR" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        OPENEXR_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "OpenEXR"`
+        else
+	        OPENEXR_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "OpenEXR"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$OPENEXR_PKG_ERRORS" >&5
+
+	build_exr=no
+elif test $pkg_failed = untried; then
+	build_exr=no
+else
+	OPENEXR_CFLAGS=$pkg_cv_OPENEXR_CFLAGS
+	OPENEXR_LIBS=$pkg_cv_OPENEXR_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	build_exr=yes
+fi
+
+	if test "x$build_exr" = "xyes" ; then
+	   	ac_config_files="$ac_config_files PlugIns/EXRCodec/Makefile PlugIns/EXRCodec/src/Makefile PlugIns/EXRCodec/include/Makefile"
+
+
+
+
+	fi
+
+fi
+
+
+
+if test x$build_exr = xyes; then
+  BUILD_EXRPLUGIN_TRUE=
+  BUILD_EXRPLUGIN_FALSE='#'
+else
+  BUILD_EXRPLUGIN_TRUE='#'
+  BUILD_EXRPLUGIN_FALSE=
+fi
+
+
+
+# Check whether --enable-direct3d was given.
+if test "${enable_direct3d+set}" = set; then
+  enableval=$enable_direct3d; build_dx9=$enableval
+else
+  build_dx9=no
+fi
+
+
+
+
+if test x$build_dx9 = xyes; then
+  BUILD_DX9RENDERSYSTEM_TRUE=
+  BUILD_DX9RENDERSYSTEM_FALSE='#'
+else
+  BUILD_DX9RENDERSYSTEM_TRUE='#'
+  BUILD_DX9RENDERSYSTEM_FALSE=
+fi
+
+
+
+
+{ echo "$as_me:$LINENO: checking whether to use SSE" >&5
+echo $ECHO_N "checking whether to use SSE... $ECHO_C" >&6; }
+case $target_cpu in
+	i386 | i486 | i586 | i686 | x86_64 | amd64)
+		build_sse=yes
+	;;
+	*)
+		build_sse=no
+	;;
+esac
+{ echo "$as_me:$LINENO: result: $build_sse" >&5
+echo "${ECHO_T}$build_sse" >&6; }
+
+
+if test x$build_sse = xyes; then
+  OGRE_BUILD_SSE_TRUE=
+  OGRE_BUILD_SSE_FALSE='#'
+else
+  OGRE_BUILD_SSE_TRUE='#'
+  OGRE_BUILD_SSE_FALSE=
+fi
+
+
+
+
+
+if test "x$OGRE_PLATFORM" = "x$OGRE_GUI"; then
+  SAME_PLATFORM_AND_GUI_TRUE=
+  SAME_PLATFORM_AND_GUI_FALSE='#'
+else
+  SAME_PLATFORM_AND_GUI_TRUE='#'
+  SAME_PLATFORM_AND_GUI_FALSE=
+fi
+
+
+
+
+    # Check whether --enable-ogre_demos was given.
+if test "${enable_ogre_demos+set}" = set; then
+  enableval=$enable_ogre_demos; build_ogre_demos=$enableval
+else
+  build_ogre_demos=yes
+fi
+
+
+    if test "x$build_ogre_demos" = "xyes" ; then
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for OIS" >&5
+echo $ECHO_N "checking for OIS... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$OIS_CFLAGS"; then
+        pkg_cv_OIS_CFLAGS="$OIS_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"OIS >= 1.0.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "OIS >= 1.0.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_OIS_CFLAGS=`$PKG_CONFIG --cflags "OIS >= 1.0.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$OIS_LIBS"; then
+        pkg_cv_OIS_LIBS="$OIS_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"OIS >= 1.0.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "OIS >= 1.0.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_OIS_LIBS=`$PKG_CONFIG --libs "OIS >= 1.0.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        OIS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "OIS >= 1.0.0"`
+        else
+	        OIS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "OIS >= 1.0.0"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$OIS_PKG_ERRORS" >&5
+
+	ois_found=no
+elif test $pkg_failed = untried; then
+	ois_found=no
+else
+	OIS_CFLAGS=$pkg_cv_OIS_CFLAGS
+	OIS_LIBS=$pkg_cv_OIS_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	ois_found=yes
+fi
+
+
+
+        if test "x$ois_found" = "xyes" ; then
+           { echo "$as_me:$LINENO: *** Ogre Demos will be built ***" >&5
+echo "$as_me: *** Ogre Demos will be built ***" >&6;}
+        else
+          build_ogre_demos=no
+          { echo "$as_me:$LINENO:
+****************************************************************
+* You do not have OIS installed.  This is required to build    *
+* Ogre demos. You may find it at:                              *
+* http://www.sourceforge.net/projects/wgois.                   *
+* If you do not want to build the demos, you can safely ignore *
+* this.                                                        *
+****************************************************************" >&5
+echo "$as_me:
+****************************************************************
+* You do not have OIS installed.  This is required to build    *
+* Ogre demos. You may find it at:                              *
+* http://www.sourceforge.net/projects/wgois.                   *
+* If you do not want to build the demos, you can safely ignore *
+* this.                                                        *
+****************************************************************" >&6;}
+        fi
+    else
+        build_ogre_demos=no
+        { echo "$as_me:$LINENO: *** Building of Ogre demos disabled ***" >&5
+echo "$as_me: *** Building of Ogre demos disabled ***" >&6;}
+    fi
+
+
+
+if test x$build_ogre_demos = xyes; then
+  OGRE_BUILDING_DEMOS_TRUE=
+  OGRE_BUILDING_DEMOS_FALSE='#'
+else
+  OGRE_BUILDING_DEMOS_TRUE='#'
+  OGRE_BUILDING_DEMOS_FALSE=
+fi
+
+
+
+if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+		int main()
+		{
+			short s = 1;
+			short* ptr = &s;
+			unsigned char c = *((char*)ptr);
+			return c;
+		}
+
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define OGRE_CONFIG_BIG_ENDIAN
+_ACEOF
+
+          OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_CONFIG_BIG_ENDIAN"
+
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+
+cat >>confdefs.h <<\_ACEOF
+#define OGRE_CONFIG_LITTLE_ENDIAN
+_ACEOF
+
+          OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_CONFIG_LITTLE_ENDIAN"
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking whether -fPIC is needed" >&5
+echo $ECHO_N "checking whether -fPIC is needed... $ECHO_C" >&6; }
+    case $host in
+        x86_64-*)
+            CXXFLAGS="$CXXFLAGS -fPIC"
+            { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+        ;;
+        *)
+            { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+        ;;
+    esac
+
+
+
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for CEGUI" >&5
+echo $ECHO_N "checking for CEGUI... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$CEGUI_CFLAGS"; then
+        pkg_cv_CEGUI_CFLAGS="$CEGUI_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"CEGUI >= 0.5.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "CEGUI >= 0.5.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_CEGUI_CFLAGS=`$PKG_CONFIG --cflags "CEGUI >= 0.5.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$CEGUI_LIBS"; then
+        pkg_cv_CEGUI_LIBS="$CEGUI_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"CEGUI >= 0.5.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "CEGUI >= 0.5.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_CEGUI_LIBS=`$PKG_CONFIG --libs "CEGUI >= 0.5.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        CEGUI_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "CEGUI >= 0.5.0"`
+        else
+	        CEGUI_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "CEGUI >= 0.5.0"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$CEGUI_PKG_ERRORS" >&5
+
+	build_cegui_sample=false
+elif test $pkg_failed = untried; then
+	build_cegui_sample=false
+else
+	CEGUI_CFLAGS=$pkg_cv_CEGUI_CFLAGS
+	CEGUI_LIBS=$pkg_cv_CEGUI_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	build_cegui_sample=true
+fi
+    if test x$build_cegui_sample = xtrue; then
+        ac_config_files="$ac_config_files Samples/Common/CEGUIRenderer/Makefile Samples/Common/CEGUIRenderer/CEGUI-OGRE.pc Samples/Common/CEGUIRenderer/src/Makefile Samples/Common/CEGUIRenderer/include/Makefile Samples/Gui/Makefile Samples/Gui/src/Makefile"
+
+
+
+        { echo "$as_me:$LINENO: result: CEGUI available, Gui and FacialAnimation samples will be built" >&5
+echo "${ECHO_T}CEGUI available, Gui and FacialAnimation samples will be built" >&6; }
+    else
+        { echo "$as_me:$LINENO: result: CEGUI not available, Gui and FacialAnimation samples will not be built" >&5
+echo "${ECHO_T}CEGUI not available, Gui and FacialAnimation samples will not be built" >&6; }
+    fi
+
+
+if test x$build_cegui_sample = xtrue; then
+  HAVE_CEGUI_TRUE=
+  HAVE_CEGUI_FALSE='#'
+else
+  HAVE_CEGUI_TRUE='#'
+  HAVE_CEGUI_FALSE=
+fi
+
+
+
+CFLAGS="$CFLAGS"
+CXXFLAGS="$CXXFLAGS"
+LIBS="$LIBS"
+
+ogreexecdir='${abs_top_builddir}/Samples/Common/bin'
+
+
+
+ac_config_files="$ac_config_files Makefile OgreMain/Makefile OgreMain/src/Makefile OgreMain/include/Makefile OgreMain/include/GLX/Makefile OgreMain/include/gtk/Makefile PlugIns/Makefile PlugIns/BSPSceneManager/Makefile PlugIns/BSPSceneManager/src/Makefile PlugIns/BSPSceneManager/include/Makefile PlugIns/CgProgramManager/Makefile PlugIns/CgProgramManager/src/Makefile PlugIns/CgProgramManager/include/Makefile PlugIns/OctreeSceneManager/Makefile PlugIns/OctreeSceneManager/src/Makefile PlugIns/OctreeSceneManager/include/Makefile PlugIns/ParticleFX/Makefile PlugIns/ParticleFX/src/Makefile PlugIns/ParticleFX/include/Makefile RenderSystems/Makefile RenderSystems/GL/Makefile RenderSystems/GL/src/Makefile RenderSystems/GL/include/Makefile RenderSystems/GL/src/atifs/Makefile RenderSystems/GL/src/atifs/include/Makefile RenderSystems/GL/src/atifs/src/Makefile RenderSystems/GL/src/GLSL/Makefile RenderSystems/GL/src/GLSL/include/Makefile RenderSystems/GL/src/GLSL/src/Makefile RenderSystems/GL/src/nvparse/Makefile RenderSystems/Direct3D9/Makefile RenderSystems/Direct3D9/src/Makefile RenderSystems/Direct3D9/include/Makefile Samples/Makefile Samples/Common/Makefile Samples/Common/include/Makefile Samples/Common/bin/Makefile Samples/BezierPatch/Makefile Samples/BezierPatch/src/Makefile Samples/BezierPatch/include/Makefile Samples/CameraTrack/Makefile Samples/CameraTrack/src/Makefile Samples/CelShading/Makefile Samples/CelShading/src/Makefile Samples/Compositor/Makefile Samples/Compositor/src/Makefile Samples/Compositor/include/Makefile Samples/CubeMapping/Makefile Samples/CubeMapping/src/Makefile Samples/CubeMapping/include/Makefile Samples/DeferredShading/Makefile Samples/DeferredShading/src/Makefile Samples/DeferredShading/include/Makefile Samples/Dot3Bump/Makefile Samples/Dot3Bump/src/Makefile Samples/EnvMapping/Makefile Samples/EnvMapping/src/Makefile Samples/EnvMapping/include/Makefile Samples/FacialAnimation/Makefile Samples/FacialAnimation/src/Makefile Samples/Fresnel/Makefile Samples/Fresnel/src/Makefile Samples/Grass/Makefile Samples/Grass/src/Makefile Samples/Transpacency/Makefile Samples/Transpacency/src/Makefile Samples/Transpacency/include/Makefile Samples/Lighting/Makefile Samples/Lighting/src/Makefile Samples/Lighting/include/Makefile Samples/OceanDemo/Makefile Samples/OceanDemo/src/Makefile Samples/OceanDemo/include/Makefile Samples/ParticleFX/Makefile Samples/ParticleFX/src/Makefile Samples/ParticleFX/include/Makefile Samples/RenderToTexture/Makefile Samples/RenderToTexture/src/Makefile Samples/TextureFX/Makefile Samples/TextureFX/src/Makefile Samples/TextureFX/include/Makefile Samples/Shadows/Makefile Samples/Shadows/src/Makefile Samples/SkyBox/Makefile Samples/SkyBox/src/Makefile Samples/SkyBox/include/Makefile Samples/SkyDome/Makefile Samples/SkyDome/src/Makefile Samples/SkyDome/include/Makefile Samples/SkyPlane/Makefile Samples/SkyPlane/src/Makefile Samples/SkyPlane/include/Makefile Samples/Smoke/Makefile Samples/Smoke/src/Makefile Samples/Smoke/include/Makefile Samples/BSP/Makefile Samples/BSP/src/Makefile Samples/SkeletalAnimation/Makefile Samples/SkeletalAnimation/src/Makefile Samples/SkeletalAnimation/include/Makefile Samples/Terrain/Makefile Samples/Terrain/src/Makefile Samples/Terrain/include/Makefile Samples/Water/Makefile Samples/Water/src/Makefile Samples/Water/include/Makefile Samples/DynTex/Makefile Samples/DynTex/src/Makefile Samples/DynTex/include/Makefile Samples/VolumeTex/Makefile Samples/VolumeTex/src/Makefile Samples/VolumeTex/include/Makefile Samples/Instancing/Makefile Samples/Instancing/src/Makefile Samples/Instancing/include/Makefile Tests/Makefile Tests/src/Makefile Tools/Makefile Tools/MaterialUpgrader/Makefile Tools/MaterialUpgrader/src/Makefile Tools/MaterialUpgrader/include/Makefile Tools/MeshUpgrader/Makefile Tools/MeshUpgrader/src/Makefile Tools/XMLConverter/Makefile Tools/XMLConverter/src/Makefile Tools/XMLConverter/include/Makefile Tools/LightwaveConverter/Makefile Tools/LightwaveConverter/src/Makefile Tools/LightwaveConverter/include/Makefile OGRE.pc"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${OGRE_NT_TRUE}" && test -z "${OGRE_NT_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"OGRE_NT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"OGRE_NT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${OGRE_LINUX_TRUE}" && test -z "${OGRE_LINUX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"OGRE_LINUX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"OGRE_LINUX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${OGRE_OSX_TRUE}" && test -z "${OGRE_OSX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"OGRE_OSX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"OGRE_OSX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_UNIT_TESTS_TRUE}" && test -z "${BUILD_UNIT_TESTS_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_UNIT_TESTS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_UNIT_TESTS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${USE_FREEIMAGE_TRUE}" && test -z "${USE_FREEIMAGE_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"USE_FREEIMAGE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"USE_FREEIMAGE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${USE_DEVIL_TRUE}" && test -z "${USE_DEVIL_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"USE_DEVIL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"USE_DEVIL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_CGPLUGIN_TRUE}" && test -z "${BUILD_CGPLUGIN_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_CGPLUGIN\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_CGPLUGIN\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_EXRPLUGIN_TRUE}" && test -z "${BUILD_EXRPLUGIN_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_EXRPLUGIN\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_EXRPLUGIN\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_DX9RENDERSYSTEM_TRUE}" && test -z "${BUILD_DX9RENDERSYSTEM_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_DX9RENDERSYSTEM\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_DX9RENDERSYSTEM\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${OGRE_BUILD_SSE_TRUE}" && test -z "${OGRE_BUILD_SSE_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"OGRE_BUILD_SSE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"OGRE_BUILD_SSE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${SAME_PLATFORM_AND_GUI_TRUE}" && test -z "${SAME_PLATFORM_AND_GUI_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"SAME_PLATFORM_AND_GUI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"SAME_PLATFORM_AND_GUI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${OGRE_BUILDING_DEMOS_TRUE}" && test -z "${OGRE_BUILDING_DEMOS_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"OGRE_BUILDING_DEMOS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"OGRE_BUILDING_DEMOS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_CEGUI_TRUE}" && test -z "${HAVE_CEGUI_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_CEGUI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_CEGUI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # 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
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+	case $1 in
+        -*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by OGRE $as_me 1.4.5, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet      do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+		   instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+		   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+OGRE config.status 1.4.5
+configured by $0, generated by GNU Autoconf 2.61,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "OgreMain/include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS OgreMain/include/config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "RenderSystems/GL/src/GLX/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/GLX/Makefile" ;;
+    "RenderSystems/GL/src/win32/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/win32/Makefile" ;;
+    "PlugIns/EXRCodec/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/EXRCodec/Makefile" ;;
+    "PlugIns/EXRCodec/src/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/EXRCodec/src/Makefile" ;;
+    "PlugIns/EXRCodec/include/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/EXRCodec/include/Makefile" ;;
+    "Samples/Common/CEGUIRenderer/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/CEGUIRenderer/Makefile" ;;
+    "Samples/Common/CEGUIRenderer/CEGUI-OGRE.pc") CONFIG_FILES="$CONFIG_FILES Samples/Common/CEGUIRenderer/CEGUI-OGRE.pc" ;;
+    "Samples/Common/CEGUIRenderer/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/CEGUIRenderer/src/Makefile" ;;
+    "Samples/Common/CEGUIRenderer/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/CEGUIRenderer/include/Makefile" ;;
+    "Samples/Gui/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Gui/Makefile" ;;
+    "Samples/Gui/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Gui/src/Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "OgreMain/Makefile") CONFIG_FILES="$CONFIG_FILES OgreMain/Makefile" ;;
+    "OgreMain/src/Makefile") CONFIG_FILES="$CONFIG_FILES OgreMain/src/Makefile" ;;
+    "OgreMain/include/Makefile") CONFIG_FILES="$CONFIG_FILES OgreMain/include/Makefile" ;;
+    "OgreMain/include/GLX/Makefile") CONFIG_FILES="$CONFIG_FILES OgreMain/include/GLX/Makefile" ;;
+    "OgreMain/include/gtk/Makefile") CONFIG_FILES="$CONFIG_FILES OgreMain/include/gtk/Makefile" ;;
+    "PlugIns/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/Makefile" ;;
+    "PlugIns/BSPSceneManager/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/BSPSceneManager/Makefile" ;;
+    "PlugIns/BSPSceneManager/src/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/BSPSceneManager/src/Makefile" ;;
+    "PlugIns/BSPSceneManager/include/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/BSPSceneManager/include/Makefile" ;;
+    "PlugIns/CgProgramManager/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/CgProgramManager/Makefile" ;;
+    "PlugIns/CgProgramManager/src/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/CgProgramManager/src/Makefile" ;;
+    "PlugIns/CgProgramManager/include/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/CgProgramManager/include/Makefile" ;;
+    "PlugIns/OctreeSceneManager/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/OctreeSceneManager/Makefile" ;;
+    "PlugIns/OctreeSceneManager/src/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/OctreeSceneManager/src/Makefile" ;;
+    "PlugIns/OctreeSceneManager/include/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/OctreeSceneManager/include/Makefile" ;;
+    "PlugIns/ParticleFX/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/ParticleFX/Makefile" ;;
+    "PlugIns/ParticleFX/src/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/ParticleFX/src/Makefile" ;;
+    "PlugIns/ParticleFX/include/Makefile") CONFIG_FILES="$CONFIG_FILES PlugIns/ParticleFX/include/Makefile" ;;
+    "RenderSystems/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/Makefile" ;;
+    "RenderSystems/GL/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/Makefile" ;;
+    "RenderSystems/GL/src/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/Makefile" ;;
+    "RenderSystems/GL/include/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/include/Makefile" ;;
+    "RenderSystems/GL/src/atifs/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/atifs/Makefile" ;;
+    "RenderSystems/GL/src/atifs/include/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/atifs/include/Makefile" ;;
+    "RenderSystems/GL/src/atifs/src/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/atifs/src/Makefile" ;;
+    "RenderSystems/GL/src/GLSL/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/GLSL/Makefile" ;;
+    "RenderSystems/GL/src/GLSL/include/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/GLSL/include/Makefile" ;;
+    "RenderSystems/GL/src/GLSL/src/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/GLSL/src/Makefile" ;;
+    "RenderSystems/GL/src/nvparse/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/GL/src/nvparse/Makefile" ;;
+    "RenderSystems/Direct3D9/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/Direct3D9/Makefile" ;;
+    "RenderSystems/Direct3D9/src/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/Direct3D9/src/Makefile" ;;
+    "RenderSystems/Direct3D9/include/Makefile") CONFIG_FILES="$CONFIG_FILES RenderSystems/Direct3D9/include/Makefile" ;;
+    "Samples/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Makefile" ;;
+    "Samples/Common/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/Makefile" ;;
+    "Samples/Common/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/include/Makefile" ;;
+    "Samples/Common/bin/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Common/bin/Makefile" ;;
+    "Samples/BezierPatch/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/BezierPatch/Makefile" ;;
+    "Samples/BezierPatch/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/BezierPatch/src/Makefile" ;;
+    "Samples/BezierPatch/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/BezierPatch/include/Makefile" ;;
+    "Samples/CameraTrack/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CameraTrack/Makefile" ;;
+    "Samples/CameraTrack/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CameraTrack/src/Makefile" ;;
+    "Samples/CelShading/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CelShading/Makefile" ;;
+    "Samples/CelShading/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CelShading/src/Makefile" ;;
+    "Samples/Compositor/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Compositor/Makefile" ;;
+    "Samples/Compositor/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Compositor/src/Makefile" ;;
+    "Samples/Compositor/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Compositor/include/Makefile" ;;
+    "Samples/CubeMapping/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CubeMapping/Makefile" ;;
+    "Samples/CubeMapping/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CubeMapping/src/Makefile" ;;
+    "Samples/CubeMapping/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/CubeMapping/include/Makefile" ;;
+    "Samples/DeferredShading/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DeferredShading/Makefile" ;;
+    "Samples/DeferredShading/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DeferredShading/src/Makefile" ;;
+    "Samples/DeferredShading/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DeferredShading/include/Makefile" ;;
+    "Samples/Dot3Bump/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Dot3Bump/Makefile" ;;
+    "Samples/Dot3Bump/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Dot3Bump/src/Makefile" ;;
+    "Samples/EnvMapping/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/EnvMapping/Makefile" ;;
+    "Samples/EnvMapping/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/EnvMapping/src/Makefile" ;;
+    "Samples/EnvMapping/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/EnvMapping/include/Makefile" ;;
+    "Samples/FacialAnimation/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/FacialAnimation/Makefile" ;;
+    "Samples/FacialAnimation/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/FacialAnimation/src/Makefile" ;;
+    "Samples/Fresnel/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Fresnel/Makefile" ;;
+    "Samples/Fresnel/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Fresnel/src/Makefile" ;;
+    "Samples/Grass/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Grass/Makefile" ;;
+    "Samples/Grass/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Grass/src/Makefile" ;;
+    "Samples/Transpacency/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Transpacency/Makefile" ;;
+    "Samples/Transpacency/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Transpacency/src/Makefile" ;;
+    "Samples/Transpacency/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Transpacency/include/Makefile" ;;
+    "Samples/Lighting/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Lighting/Makefile" ;;
+    "Samples/Lighting/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Lighting/src/Makefile" ;;
+    "Samples/Lighting/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Lighting/include/Makefile" ;;
+    "Samples/OceanDemo/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/OceanDemo/Makefile" ;;
+    "Samples/OceanDemo/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/OceanDemo/src/Makefile" ;;
+    "Samples/OceanDemo/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/OceanDemo/include/Makefile" ;;
+    "Samples/ParticleFX/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/ParticleFX/Makefile" ;;
+    "Samples/ParticleFX/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/ParticleFX/src/Makefile" ;;
+    "Samples/ParticleFX/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/ParticleFX/include/Makefile" ;;
+    "Samples/RenderToTexture/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/RenderToTexture/Makefile" ;;
+    "Samples/RenderToTexture/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/RenderToTexture/src/Makefile" ;;
+    "Samples/TextureFX/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/TextureFX/Makefile" ;;
+    "Samples/TextureFX/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/TextureFX/src/Makefile" ;;
+    "Samples/TextureFX/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/TextureFX/include/Makefile" ;;
+    "Samples/Shadows/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Shadows/Makefile" ;;
+    "Samples/Shadows/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Shadows/src/Makefile" ;;
+    "Samples/SkyBox/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyBox/Makefile" ;;
+    "Samples/SkyBox/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyBox/src/Makefile" ;;
+    "Samples/SkyBox/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyBox/include/Makefile" ;;
+    "Samples/SkyDome/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyDome/Makefile" ;;
+    "Samples/SkyDome/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyDome/src/Makefile" ;;
+    "Samples/SkyDome/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyDome/include/Makefile" ;;
+    "Samples/SkyPlane/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyPlane/Makefile" ;;
+    "Samples/SkyPlane/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyPlane/src/Makefile" ;;
+    "Samples/SkyPlane/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkyPlane/include/Makefile" ;;
+    "Samples/Smoke/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Smoke/Makefile" ;;
+    "Samples/Smoke/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Smoke/src/Makefile" ;;
+    "Samples/Smoke/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Smoke/include/Makefile" ;;
+    "Samples/BSP/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/BSP/Makefile" ;;
+    "Samples/BSP/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/BSP/src/Makefile" ;;
+    "Samples/SkeletalAnimation/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkeletalAnimation/Makefile" ;;
+    "Samples/SkeletalAnimation/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkeletalAnimation/src/Makefile" ;;
+    "Samples/SkeletalAnimation/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/SkeletalAnimation/include/Makefile" ;;
+    "Samples/Terrain/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Terrain/Makefile" ;;
+    "Samples/Terrain/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Terrain/src/Makefile" ;;
+    "Samples/Terrain/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Terrain/include/Makefile" ;;
+    "Samples/Water/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Water/Makefile" ;;
+    "Samples/Water/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Water/src/Makefile" ;;
+    "Samples/Water/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Water/include/Makefile" ;;
+    "Samples/DynTex/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DynTex/Makefile" ;;
+    "Samples/DynTex/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DynTex/src/Makefile" ;;
+    "Samples/DynTex/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/DynTex/include/Makefile" ;;
+    "Samples/VolumeTex/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/VolumeTex/Makefile" ;;
+    "Samples/VolumeTex/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/VolumeTex/src/Makefile" ;;
+    "Samples/VolumeTex/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/VolumeTex/include/Makefile" ;;
+    "Samples/Instancing/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Instancing/Makefile" ;;
+    "Samples/Instancing/src/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Instancing/src/Makefile" ;;
+    "Samples/Instancing/include/Makefile") CONFIG_FILES="$CONFIG_FILES Samples/Instancing/include/Makefile" ;;
+    "Tests/Makefile") CONFIG_FILES="$CONFIG_FILES Tests/Makefile" ;;
+    "Tests/src/Makefile") CONFIG_FILES="$CONFIG_FILES Tests/src/Makefile" ;;
+    "Tools/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/Makefile" ;;
+    "Tools/MaterialUpgrader/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/MaterialUpgrader/Makefile" ;;
+    "Tools/MaterialUpgrader/src/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/MaterialUpgrader/src/Makefile" ;;
+    "Tools/MaterialUpgrader/include/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/MaterialUpgrader/include/Makefile" ;;
+    "Tools/MeshUpgrader/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/MeshUpgrader/Makefile" ;;
+    "Tools/MeshUpgrader/src/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/MeshUpgrader/src/Makefile" ;;
+    "Tools/XMLConverter/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/XMLConverter/Makefile" ;;
+    "Tools/XMLConverter/src/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/XMLConverter/src/Makefile" ;;
+    "Tools/XMLConverter/include/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/XMLConverter/include/Makefile" ;;
+    "Tools/LightwaveConverter/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/LightwaveConverter/Makefile" ;;
+    "Tools/LightwaveConverter/src/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/LightwaveConverter/src/Makefile" ;;
+    "Tools/LightwaveConverter/include/Makefile") CONFIG_FILES="$CONFIG_FILES Tools/LightwaveConverter/include/Makefile" ;;
+    "OGRE.pc") CONFIG_FILES="$CONFIG_FILES OGRE.pc" ;;
+
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+#
+# Set up the sed scripts for CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "$CONFIG_FILES"; then
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+target!$target$ac_delim
+target_cpu!$target_cpu$ac_delim
+target_vendor!$target_vendor$ac_delim
+target_os!$target_os$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+CYGPATH_W!$CYGPATH_W$ac_delim
+PACKAGE!$PACKAGE$ac_delim
+VERSION!$VERSION$ac_delim
+ACLOCAL!$ACLOCAL$ac_delim
+AUTOCONF!$AUTOCONF$ac_delim
+AUTOMAKE!$AUTOMAKE$ac_delim
+AUTOHEADER!$AUTOHEADER$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+install_sh!$install_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+mkdir_p!$mkdir_p$ac_delim
+AWK!$AWK$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+am__leading_dot!$am__leading_dot$ac_delim
+AMTAR!$AMTAR$ac_delim
+am__tar!$am__tar$ac_delim
+am__untar!$am__untar$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DEPDIR!$DEPDIR$ac_delim
+am__include!$am__include$ac_delim
+am__quote!$am__quote$ac_delim
+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+CCDEPMODE!$CCDEPMODE$ac_delim
+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+CXX!$CXX$ac_delim
+CXXFLAGS!$CXXFLAGS$ac_delim
+ac_ct_CXX!$ac_ct_CXX$ac_delim
+CXXDEPMODE!$CXXDEPMODE$ac_delim
+am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
+am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
+YACC!$YACC$ac_delim
+YFLAGS!$YFLAGS$ac_delim
+LEX!$LEX$ac_delim
+LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim
+LEXLIB!$LEXLIB$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHARED_FLAGS!$SHARED_FLAGS$ac_delim
+PLUGIN_FLAGS!$PLUGIN_FLAGS$ac_delim
+GL_LIBS!$GL_LIBS$ac_delim
+RC!$RC$ac_delim
+OGRE_NT_TRUE!$OGRE_NT_TRUE$ac_delim
+OGRE_NT_FALSE!$OGRE_NT_FALSE$ac_delim
+OGRE_LINUX_TRUE!$OGRE_LINUX_TRUE$ac_delim
+OGRE_LINUX_FALSE!$OGRE_LINUX_FALSE$ac_delim
+OGRE_OSX_TRUE!$OGRE_OSX_TRUE$ac_delim
+OGRE_OSX_FALSE!$OGRE_OSX_FALSE$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+LN_S!$LN_S$ac_delim
+ECHO!$ECHO$ac_delim
+AR!$AR$ac_delim
+RANLIB!$RANLIB$ac_delim
+CPP!$CPP$ac_delim
+CXXCPP!$CXXCPP$ac_delim
+F77!$F77$ac_delim
+FFLAGS!$FFLAGS$ac_delim
+ac_ct_F77!$ac_ct_F77$ac_delim
+LIBTOOL!$LIBTOOL$ac_delim
+OGRE_CFLAGS!$OGRE_CFLAGS$ac_delim
+CFLAGS_VISIBILITY!$CFLAGS_VISIBILITY$ac_delim
+STLPORT_CFLAGS!$STLPORT_CFLAGS$ac_delim
+STLPORT_LIBS!$STLPORT_LIBS$ac_delim
+FT2_CONFIG!$FT2_CONFIG$ac_delim
+FT2_CFLAGS!$FT2_CFLAGS$ac_delim
+FT2_LIBS!$FT2_LIBS$ac_delim
+CPPUNIT_CONFIG!$CPPUNIT_CONFIG$ac_delim
+CPPUNIT_CFLAGS!$CPPUNIT_CFLAGS$ac_delim
+CPPUNIT_LIBS!$CPPUNIT_LIBS$ac_delim
+BUILD_UNIT_TESTS_TRUE!$BUILD_UNIT_TESTS_TRUE$ac_delim
+BUILD_UNIT_TESTS_FALSE!$BUILD_UNIT_TESTS_FALSE$ac_delim
+PKG_CONFIG!$PKG_CONFIG$ac_delim
+ZZIPLIB_CFLAGS!$ZZIPLIB_CFLAGS$ac_delim
+ZZIPLIB_LIBS!$ZZIPLIB_LIBS$ac_delim
+XMKMF!$XMKMF$ac_delim
+PLATFORM_CFLAGS!$PLATFORM_CFLAGS$ac_delim
+PLATFORM_LIBS!$PLATFORM_LIBS$ac_delim
+OGRE_PLATFORM!$OGRE_PLATFORM$ac_delim
+GLSUPPORT_CFLAGS!$GLSUPPORT_CFLAGS$ac_delim
+GLSUPPORT_LIBS!$GLSUPPORT_LIBS$ac_delim
+OGRE_GLSUPPORT!$OGRE_GLSUPPORT$ac_delim
+GTK_CFLAGS!$GTK_CFLAGS$ac_delim
+GTK_LIBS!$GTK_LIBS$ac_delim
+OGRE_GUI!$OGRE_GUI$ac_delim
+OGRE_THREAD_LIBS!$OGRE_THREAD_LIBS$ac_delim
+USE_FREEIMAGE_TRUE!$USE_FREEIMAGE_TRUE$ac_delim
+USE_FREEIMAGE_FALSE!$USE_FREEIMAGE_FALSE$ac_delim
+USE_DEVIL_TRUE!$USE_DEVIL_TRUE$ac_delim
+USE_DEVIL_FALSE!$USE_DEVIL_FALSE$ac_delim
+BUILD_CGPLUGIN_TRUE!$BUILD_CGPLUGIN_TRUE$ac_delim
+BUILD_CGPLUGIN_FALSE!$BUILD_CGPLUGIN_FALSE$ac_delim
+OPENEXR_CFLAGS!$OPENEXR_CFLAGS$ac_delim
+OPENEXR_LIBS!$OPENEXR_LIBS$ac_delim
+BUILD_EXRPLUGIN_TRUE!$BUILD_EXRPLUGIN_TRUE$ac_delim
+BUILD_EXRPLUGIN_FALSE!$BUILD_EXRPLUGIN_FALSE$ac_delim
+BUILD_DX9RENDERSYSTEM_TRUE!$BUILD_DX9RENDERSYSTEM_TRUE$ac_delim
+BUILD_DX9RENDERSYSTEM_FALSE!$BUILD_DX9RENDERSYSTEM_FALSE$ac_delim
+OGRE_BUILD_SSE_TRUE!$OGRE_BUILD_SSE_TRUE$ac_delim
+OGRE_BUILD_SSE_FALSE!$OGRE_BUILD_SSE_FALSE$ac_delim
+SAME_PLATFORM_AND_GUI_TRUE!$SAME_PLATFORM_AND_GUI_TRUE$ac_delim
+SAME_PLATFORM_AND_GUI_FALSE!$SAME_PLATFORM_AND_GUI_FALSE$ac_delim
+OIS_CFLAGS!$OIS_CFLAGS$ac_delim
+OIS_LIBS!$OIS_LIBS$ac_delim
+OGRE_BUILDING_DEMOS_TRUE!$OGRE_BUILDING_DEMOS_TRUE$ac_delim
+OGRE_BUILDING_DEMOS_FALSE!$OGRE_BUILDING_DEMOS_FALSE$ac_delim
+CEGUI_CFLAGS!$CEGUI_CFLAGS$ac_delim
+CEGUI_LIBS!$CEGUI_LIBS$ac_delim
+HAVE_CEGUI_TRUE!$HAVE_CEGUI_TRUE$ac_delim
+HAVE_CEGUI_FALSE!$HAVE_CEGUI_FALSE$ac_delim
+abs_top_builddir!$abs_top_builddir$ac_delim
+ogreexecdir!$ogreexecdir$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 76; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$ac_file_inputs $ac_f"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input="Generated from "`IFS=:
+	  echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+  esac
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([	 #]*\\)[^	 ]*\\([	 ]*'
+ac_dB='\\)[	 (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+  sed -n '
+	t rset
+	:rset
+	s/^[	 ]*#[	 ]*define[	 ][	 ]*//
+	t ok
+	d
+	:ok
+	s/[\\&,]/\\&/g
+	s/^\('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+	s/^\('"$ac_word_re"'\)[	 ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[	 #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:	 sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:	 sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:	 sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
+do
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[	 ]*#[	 ]*undef[	 ][	 ]*$ac_word_re[	 ]*\$/b def
+/^[	 ]*#[	 ]*define[	 ][	 ]*$ac_word_re[(	 ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines conftest.tail
+
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
+cat >>$CONFIG_STATUS <<\_ACEOF
+  if test x"$ac_file" != x-; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
+      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f $ac_file
+      mv "$tmp/config.h" $ac_file
+    fi
+  else
+    echo "/* $configure_input  */"
+    cat "$ac_result"
+  fi
+  rm -f "$tmp/out12"
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $ac_file | $ac_file:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X$ac_file : 'X\(//\)[^/]' \| \
+	 X$ac_file : 'X\(//\)$' \| \
+	 X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
+echo X$ac_file |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+
+
+
+ft_detected=yes
+test "x$no_ft" == "xyes" && ft_detected=no
+
+echo "--------=== Configuration summary ===--------"
+echo "    Target platform                 : $OGRE_PLATFORM"
+echo "    OpenGL Ogre support             : $OGRE_GLSUPPORT"
+echo "    GUI library to use              : $with_gui"
+echo "    Use double precision arithmetic : $build_double"
+echo "    Support for threading           : $build_threads"
+echo "    Use STLport                     : $ac_cv_use_stlport"
+echo "    Use FreeType                    : $ft_detected"
+echo "    Use FreeImage                   : $build_freeimage"
+echo "    Use DevIL                       : $build_il"
+echo "    Build OGRE demos                : $build_ogre_demos"
+test "x$build_ogre_demos" == "xyes" && \
+echo "    Build CEGUI demos               : $build_cegui_sample"
+echo "    Build the OpenEXR plugin        : $build_exr"
+echo "    Build the Cg plugin             : $build_cg"
+echo "    Build the DirectX 9 plugin      : $build_dx9"
+echo "--------===============================--------"
Index: /configure.in
===================================================================
--- /configure.in	(revision 5)
+++ /configure.in	(revision 5)
@@ -0,0 +1,277 @@
+AC_PREREQ(2.50)
+
+AC_INIT([OGRE], [1.4.5])
+
+AC_CANONICAL_TARGET
+
+# New syntax; PACKAGE gets defined as 'OGRE' not 'ogre'
+#AM_INIT_AUTOMAKE([OGRE], 1.4.5)
+AM_INIT_AUTOMAKE([OGRE], 1.4.5)
+AC_CONFIG_HEADERS([OgreMain/include/config.h])
+
+dnl Check for programs
+AC_PROG_CC
+AC_PROG_CXX
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+AC_PROG_YACC
+AM_PROG_LEX
+
+dnl Setup target-specific parameters
+OGRE_SETUP_FOR_TARGET
+
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
+AC_LIBTOOL_LANG_CXX_CONFIG
+
+# OGRE_CFLAGS contains the compiler flags crucial for stand-alone client
+# programs. They are exported via pkg-config, but not used while building
+# Ogre itself; instead, they are defined in config.h.
+AC_SUBST(OGRE_CFLAGS)
+
+# Check if compiler supports symbol visibility
+# There are quirks for x86_64 and debug builds with gcc < 4.2
+AC_LANG_PUSH(C++)
+AC_LIBTOOL_COMPILER_OPTION([if $CXX supports -fvisibility],
+    [ogre_prog_compiler_supports_visibility],
+    [-fvisibility=hidden -fvisibility-inlines-hidden], [],
+    [CFLAGS_VISIBILITY="-fvisibility=hidden -fvisibility-inlines-hidden -DOGRE_GCC_VISIBILITY";
+    case $target_cpu in
+        x86_64* )
+            if ! echo "$CFLAGS $CXXFLAGS" | grep -q "\-O"; then
+                echo "***********************************************************************"
+                echo "WARNING: It looks like you're doing a debug build for an x86_64 target."
+                echo "The -fvisibility-inlines-hidden flag is known to give problems in such"
+                echo "situations with libstdc++ < 4.2. Disabling the compiler flag."
+                echo "***********************************************************************"
+                CFLAGS_VISIBILITY="-fvisibility=hidden -DOGRE_GCC_VISIBILITY"
+            fi
+        ;;
+    esac
+    case $CXX in
+        icpc )
+            echo "***********************************************************************"
+            echo "WARNING: The intel compiler currently has bugs in its -fvisibility"
+            echo "implementation. Disabling the compiler flag."
+            echo "***********************************************************************"
+            CFLAGS_VISIBILITY=""
+        ;;
+    esac
+    ])
+AC_SUBST(CFLAGS_VISIBILITY)
+AC_LANG_POP
+
+dnl Other stuff we need
+OGRE_USE_STLPORT
+AC_CHECK_FT2(9.0.0)
+
+AC_CHECK_LIB(dl, dlopen)
+AC_CHECK_LIB(m, pow)
+AC_CHECK_LIB(z, gzopen)
+AC_CHECK_LIB(pthread, pthread_create)
+AC_CHECK_FUNC(snprintf, AC_DEFINE(HAVE_SNPRINTF,,snprintf))
+AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF,,vsnprintf))
+
+OGRE_CHECK_CPPUNIT
+
+PKG_CHECK_MODULES(ZZIPLIB, zziplib)
+AC_SUBST(ZZIPLIB_CFLAGS)
+AC_SUBST(ZZIPLIB_LIBS)
+
+dnl Get the GL and Platform libs for target build
+OGRE_GET_PLATFORM
+OGRE_GET_GLSUPPORT
+
+dnl Find the optional components we should build
+OGRE_CHECK_GUI
+OGRE_CHECK_DOUBLE
+OGRE_CHECK_THREADING
+OGRE_CHECK_FREEIMAGE
+OGRE_CHECK_DEVIL
+OGRE_CHECK_CG
+OGRE_CHECK_OPENEXR
+OGRE_CHECK_DX9
+OGRE_CHECK_SSE
+
+dnl Check to see if Ogre platform and GUI are the same
+dnl Fixes problem running make distclean when both are set to GLX
+OGRE_PLATFORM_AND_GUI
+
+dnl Check to see if user wants to disable building of demos (defaults is to build) - also checks for OIS
+OGRE_BUILD_DEMOS
+
+dnl Detect endianness
+OGRE_DETECT_ENDIAN
+
+dnl Check to see if -fPIC is required.
+OGRE_CHECK_PIC
+
+dnl Check to see if CEGUI is installed.
+OGRE_CHECK_CEGUI
+
+CFLAGS="$CFLAGS"
+CXXFLAGS="$CXXFLAGS"
+LIBS="$LIBS"
+
+dnl Define samples absolute install path
+ogreexecdir='${abs_top_builddir}/Samples/Common/bin'
+AC_SUBST(abs_top_builddir)
+AC_SUBST(ogreexecdir)
+
+dnl Create the makefiles
+AC_CONFIG_FILES([Makefile \
+    OgreMain/Makefile \
+    OgreMain/src/Makefile \
+    OgreMain/include/Makefile \
+    OgreMain/include/GLX/Makefile \
+    OgreMain/include/gtk/Makefile \
+    PlugIns/Makefile \
+    PlugIns/BSPSceneManager/Makefile \
+    PlugIns/BSPSceneManager/src/Makefile \
+    PlugIns/BSPSceneManager/include/Makefile \
+    PlugIns/CgProgramManager/Makefile \
+    PlugIns/CgProgramManager/src/Makefile \
+    PlugIns/CgProgramManager/include/Makefile \
+    PlugIns/OctreeSceneManager/Makefile \
+    PlugIns/OctreeSceneManager/src/Makefile \
+    PlugIns/OctreeSceneManager/include/Makefile \
+    PlugIns/ParticleFX/Makefile \
+    PlugIns/ParticleFX/src/Makefile \
+    PlugIns/ParticleFX/include/Makefile \
+    RenderSystems/Makefile \
+    RenderSystems/GL/Makefile \
+    RenderSystems/GL/src/Makefile \
+    RenderSystems/GL/include/Makefile \
+    RenderSystems/GL/src/atifs/Makefile \
+    RenderSystems/GL/src/atifs/include/Makefile \
+    RenderSystems/GL/src/atifs/src/Makefile \
+    RenderSystems/GL/src/GLSL/Makefile \
+    RenderSystems/GL/src/GLSL/include/Makefile \
+    RenderSystems/GL/src/GLSL/src/Makefile \
+    RenderSystems/GL/src/nvparse/Makefile \
+    RenderSystems/Direct3D9/Makefile \
+    RenderSystems/Direct3D9/src/Makefile \
+    RenderSystems/Direct3D9/include/Makefile \
+    Samples/Makefile \
+    Samples/Common/Makefile \
+    Samples/Common/include/Makefile \
+    Samples/Common/bin/Makefile \
+    Samples/BezierPatch/Makefile \
+    Samples/BezierPatch/src/Makefile \
+    Samples/BezierPatch/include/Makefile \
+    Samples/CameraTrack/Makefile \
+    Samples/CameraTrack/src/Makefile \
+    Samples/CelShading/Makefile \
+    Samples/CelShading/src/Makefile \
+    Samples/Compositor/Makefile \
+    Samples/Compositor/src/Makefile \
+    Samples/Compositor/include/Makefile \
+    Samples/CubeMapping/Makefile \
+    Samples/CubeMapping/src/Makefile \
+    Samples/CubeMapping/include/Makefile \
+    Samples/DeferredShading/Makefile \
+    Samples/DeferredShading/src/Makefile \
+    Samples/DeferredShading/include/Makefile  \
+    Samples/Dot3Bump/Makefile \
+    Samples/Dot3Bump/src/Makefile \
+    Samples/EnvMapping/Makefile \
+    Samples/EnvMapping/src/Makefile \
+    Samples/EnvMapping/include/Makefile \
+    Samples/FacialAnimation/Makefile \
+    Samples/FacialAnimation/src/Makefile \
+    Samples/Fresnel/Makefile \
+    Samples/Fresnel/src/Makefile \
+    Samples/Grass/Makefile \
+    Samples/Grass/src/Makefile \
+    Samples/Transpacency/Makefile \
+    Samples/Transpacency/src/Makefile \
+    Samples/Transpacency/include/Makefile \
+    Samples/Lighting/Makefile \
+    Samples/Lighting/src/Makefile \
+    Samples/Lighting/include/Makefile \
+    Samples/OceanDemo/Makefile \
+    Samples/OceanDemo/src/Makefile \
+    Samples/OceanDemo/include/Makefile \
+    Samples/ParticleFX/Makefile \
+    Samples/ParticleFX/src/Makefile \
+    Samples/ParticleFX/include/Makefile \
+    Samples/RenderToTexture/Makefile \
+    Samples/RenderToTexture/src/Makefile \
+    Samples/TextureFX/Makefile \
+    Samples/TextureFX/src/Makefile \
+    Samples/TextureFX/include/Makefile \
+    Samples/Shadows/Makefile \
+    Samples/Shadows/src/Makefile \
+    Samples/SkyBox/Makefile \
+    Samples/SkyBox/src/Makefile \
+    Samples/SkyBox/include/Makefile \
+    Samples/SkyDome/Makefile \
+    Samples/SkyDome/src/Makefile \
+    Samples/SkyDome/include/Makefile \
+    Samples/SkyPlane/Makefile \
+    Samples/SkyPlane/src/Makefile \
+    Samples/SkyPlane/include/Makefile \
+    Samples/Smoke/Makefile \
+    Samples/Smoke/src/Makefile \
+    Samples/Smoke/include/Makefile \
+    Samples/BSP/Makefile \
+    Samples/BSP/src/Makefile \
+    Samples/SkeletalAnimation/Makefile \
+    Samples/SkeletalAnimation/src/Makefile \
+    Samples/SkeletalAnimation/include/Makefile \
+    Samples/Terrain/Makefile \
+    Samples/Terrain/src/Makefile \
+    Samples/Terrain/include/Makefile \
+    Samples/Water/Makefile \
+    Samples/Water/src/Makefile \
+    Samples/Water/include/Makefile \
+    Samples/DynTex/Makefile \
+    Samples/DynTex/src/Makefile \
+    Samples/DynTex/include/Makefile \
+    Samples/VolumeTex/Makefile \
+    Samples/VolumeTex/src/Makefile \
+    Samples/VolumeTex/include/Makefile \
+    Samples/Instancing/Makefile \
+    Samples/Instancing/src/Makefile \
+    Samples/Instancing/include/Makefile \
+    Tests/Makefile \
+    Tests/src/Makefile \
+    Tools/Makefile \
+    Tools/MaterialUpgrader/Makefile \
+    Tools/MaterialUpgrader/src/Makefile \
+    Tools/MaterialUpgrader/include/Makefile \
+    Tools/MeshUpgrader/Makefile \
+    Tools/MeshUpgrader/src/Makefile \
+    Tools/XMLConverter/Makefile \
+    Tools/XMLConverter/src/Makefile \
+    Tools/XMLConverter/include/Makefile \
+    Tools/LightwaveConverter/Makefile \
+    Tools/LightwaveConverter/src/Makefile \
+    Tools/LightwaveConverter/include/Makefile \
+    OGRE.pc
+    ])
+
+AC_OUTPUT
+
+dnl Provide a nice final configuration status display
+
+ft_detected=yes
+test "x$no_ft" == "xyes" && ft_detected=no
+
+echo "--------===[ Configuration summary ]===--------"
+echo "    Target platform                 : $OGRE_PLATFORM"
+echo "    OpenGL Ogre support             : $OGRE_GLSUPPORT"
+echo "    GUI library to use              : $with_gui"
+echo "    Use double precision arithmetic : $build_double"
+echo "    Support for threading           : $build_threads"
+echo "    Use STLport                     : $ac_cv_use_stlport"
+echo "    Use FreeType                    : $ft_detected"
+echo "    Use FreeImage                   : $build_freeimage"
+echo "    Use DevIL                       : $build_il"
+echo "    Build OGRE demos                : $build_ogre_demos"
+test "x$build_ogre_demos" == "xyes" && \
+echo "    Build CEGUI demos               : $build_cegui_sample"
+echo "    Build the OpenEXR plugin        : $build_exr"
+echo "    Build the Cg plugin             : $build_cg"
+echo "    Build the DirectX 9 plugin      : $build_dx9"
+echo "--------===============================--------"
Index: /depcomp
===================================================================
--- /depcomp	(revision 5)
+++ /depcomp	(revision 5)
@@ -0,0 +1,529 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2005-02-09.22
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+  tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'.  On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like `#:fec' to the end of the
+    # dependency line.
+    tr ' ' '
+' < "$tmpdepfile" \
+    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+    tr '
+' ' ' >> $depfile
+    echo >> $depfile
+
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' '
+' < "$tmpdepfile" \
+   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+   >> $depfile
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  In older versions, this file always lives in the
+  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+  tmpdepfile="$stripped.u"
+  if test "$libtool" = yes; then
+    "$@" -Wc,-M
+  else
+    "$@" -M
+  fi
+  stat=$?
+
+  if test -f "$tmpdepfile"; then :
+  else
+    stripped=`echo "$stripped" | sed 's,^.*/,,'`
+    tmpdepfile="$stripped.u"
+  fi
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+
+  if test -f "$tmpdepfile"; then
+    outname="$stripped.o"
+    # Each line is of the form `foo.o: dependent.h'.
+    # Do two passes, one to just change these to
+    # `$object: dependent.h' and one to simply `dependent.h:'.
+    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+icc)
+  # Intel's C compiler understands `-MD -MF file'.  However on
+  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # ICC 7.0 will fill foo.d with something like
+  #    foo.o: sub/foo.c
+  #    foo.o: sub/foo.h
+  # which is wrong.  We want:
+  #    sub/foo.o: sub/foo.c
+  #    sub/foo.o: sub/foo.h
+  #    sub/foo.c:
+  #    sub/foo.h:
+  # ICC 7.1 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using \ :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+    sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+   # dependencies in `foo.d' instead, so we check for that too.
+   # Subdirectories are respected.
+   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+   test "x$dir" = "x$object" && dir=
+   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+   if test "$libtool" = yes; then
+      # With Tru64 cc, shared objects can also be used to make a
+      # static library.  This mecanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in in $dir.libs/$base.o.d and
+      # in $dir$base.o.d.  We have to check for both files, because
+      # one of the two compilations can be disabled.  We should prefer
+      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+      # automatically cleaned when .libs/ is deleted, while ignoring
+      # the former would cause a distcleancheck panic.
+      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
+      tmpdepfile2=$dir$base.o.d          # libtool 1.5
+      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
+      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
+      "$@" -Wc,-MD
+   else
+      tmpdepfile1=$dir$base.o.d
+      tmpdepfile2=$dir$base.d
+      tmpdepfile3=$dir$base.d
+      tmpdepfile4=$dir$base.d
+      "$@" -MD
+   fi
+
+   stat=$?
+   if test $stat -eq 0; then :
+   else
+      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+      exit $stat
+   fi
+
+   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+   do
+     test -f "$tmpdepfile" && break
+   done
+   if test -f "$tmpdepfile"; then
+      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+      # That's a tab and a space in the [].
+      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+   else
+      echo "#dummy" > "$depfile"
+   fi
+   rm -f "$tmpdepfile"
+   ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # Require at least two characters before searching for `:'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  "$@" $dashmflag |
+    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no
+  for arg in "$@"; do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix="`echo $object | sed 's/^.*\././'`"
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E |
+    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  "$@" || exit $?
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+	set fnord "$@"
+	shift
+	shift
+	;;
+    *)
+	set fnord "$@" "$arg"
+	shift
+	shift
+	;;
+    esac
+  done
+  "$@" -E |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
+  echo "	" >> "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
Index: /install-sh
===================================================================
--- /install-sh	(revision 5)
+++ /install-sh	(revision 5)
@@ -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:
Index: /libtool
===================================================================
--- /libtool	(revision 5)
+++ /libtool	(revision 5)
@@ -0,0 +1,7788 @@
+#! /bin/sh
+
+# libtoolT - Provide generalized library-building support services.
+# Generated automatically by  (GNU OGRE 1.4.5)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED="/bin/sed"
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="/bin/sed -e 1s/^X//"
+
+# 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
+
+# The names of the tagged configurations supported by this script.
+available_tags=" CXX F77"
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host tardis-d04:
+
+# Shell to use when invoking shell scripts.
+SHELL="/bin/sh"
+
+# Whether or not to build shared libraries.
+build_libtool_libs=yes
+
+# Whether or not to build static libraries.
+build_old_libs=no
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=no
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=no
+
+# Whether or not to optimize for fast installation.
+fast_install=yes
+
+# The host system.
+host_alias=
+host=i686-pc-linux-gnu
+host_os=linux-gnu
+
+# The build system.
+build_alias=
+build=i686-pc-linux-gnu
+build_os=linux-gnu
+
+# An echo program that does not interpret backslashes.
+echo="echo"
+
+# The archiver.
+AR="ar"
+AR_FLAGS="cru"
+
+# A C compiler.
+LTCC="gcc"
+
+# A language-specific compiler.
+CC="gcc"
+
+# Is the compiler the GNU C compiler?
+with_gcc=yes
+
+# An ERE matcher.
+EGREP="/bin/grep -E"
+
+# The linker used to build libraries.
+LD="/usr/bin/ld"
+
+# Whether we need hard or soft links.
+LN_S="ln -s"
+
+# A BSD-compatible nm program.
+NM="/usr/bin/nm -B"
+
+# A symbol stripping program
+STRIP="strip"
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=file
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="dlltool"
+
+# Used on cygwin: object dumper.
+OBJDUMP="objdump"
+
+# Used on cygwin: assembler.
+AS="as"
+
+# The name of the directory that contains temporary libtool files.
+objdir=.libs
+
+# How to create reloadable object files.
+reload_flag=" -r"
+reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
+
+# How to pass a linker flag through the compiler.
+wl="-Wl,"
+
+# Object file suffix (normally "o").
+objext="o"
+
+# Old archive suffix (normally "a").
+libext="a"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='.so'
+
+# Executable file suffix (normally "").
+exeext=""
+
+# Additional compiler flags for building library objects.
+pic_flag=" -fPIC -DPIC"
+pic_mode=default
+
+# What is the maximum length of a command?
+max_cmd_len=32768
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o="yes"
+
+# Must we lock files when doing compilation?
+need_locks="no"
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=no
+
+# Do we need a version for libraries?
+need_version=no
+
+# Whether dlopen is supported.
+dlopen_support=unknown
+
+# Whether dlopen of programs is supported.
+dlopen_self=unknown
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=unknown
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag="-static"
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=" -fno-builtin"
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec="\${wl}--export-dynamic"
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=""
+
+# Library versioning type.
+version_type=linux
+
+# Format of library name prefix.
+libname_spec="lib\$name"
+
+# 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.
+library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
+
+# The coded name of the library, if different from the real name.
+soname_spec="\${libname}\${release}\${shared_ext}\$major"
+
+# Commands used to build and install an old-style archive.
+RANLIB="ranlib"
+old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
+old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
+old_postuninstall_cmds=""
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=""
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=""
+
+# Commands used to build and install a shared archive.
+archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
+archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
+  cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
+  \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
+	  \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
+postinstall_cmds=""
+postuninstall_cmds=""
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=""
+module_expsym_cmds=""
+
+# Commands to strip libraries.
+old_striplib="strip --strip-debug"
+striplib="strip --strip-unneeded"
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=""
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=""
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=""
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=""
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=""
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method="pass_all"
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd="\$MAGIC_CMD"
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=""
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=""
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=""
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe="sed -n -e 's/^.*[ 	]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ 	][ 	]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/  {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/  {\"\\2\", (lt_ptr) \\&\\2},/p'"
+
+# This is the shared library runtime path variable.
+runpath_var=LD_RUN_PATH
+
+# This is the shared library path variable.
+shlibpath_var=LD_LIBRARY_PATH
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=no
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=immediate
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=yes
+
+# Flag to hardcode $libdir into a binary during linking.
+# This must work even if $libdir does not exist.
+hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
+
+# If ld is used when linking, flag to hardcode $libdir into
+# a binary during linking. This must work even if $libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=""
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=""
+
+# Set to yes if using DIR/libNAME during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=no
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=no
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=unsupported
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=no
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="PATH  LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=unknown
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=" /usr/lib/gcc-lib/i486-linux/3.3.5/ /usr/lib/gcc/i486-linux/3.3.5/ /usr/lib/gcc-lib/i486-linux/3.3.5/../../../../i486-linux/lib/i486-linux/3.3.5/ /usr/lib/gcc-lib/i486-linux/3.3.5/../../../../i486-linux/lib/ /usr/lib/gcc-lib/i486-linux/3.3.5/../../../i486-linux/3.3.5/ /usr/lib/gcc-lib/i486-linux/3.3.5/../../../ /lib/i486-linux/3.3.5/ /lib/ /usr/lib/i486-linux/3.3.5/ /usr/lib/"
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/libc5-compat /lib/libc5-compat /usr/i486-linuxlibc1/lib /usr/X11R6/lib /usr/lib/nvidia/lib "
+
+# Fix the shell variable $srcfile for the compiler.
+fix_srcfile_path=""
+
+# Set to yes if exported symbols are required.
+always_export_symbols=no
+
+# The commands to list exported symbols.
+export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=""
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+
+# Symbols that must always be exported.
+include_expsyms=""
+
+# ### END LIBTOOL CONFIG
+
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun configure.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+basename="s,^.*/,,g"
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+progname=`echo "$progpath" | $SED $basename`
+modename="$progname"
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.5.20
+TIMESTAMP=" (1.1220.2.287 2005/08/31 18:54:15)"
+
+# 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
+
+# Check that we have a working $echo.
+if test "X$1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X$1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell, and then maybe $echo will work.
+  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+$*
+EOF
+  exit $EXIT_SUCCESS
+fi
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  SP2NL='tr \040 \012'
+  NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  SP2NL='tr \100 \n'
+  NL2SP='tr \r\n \100\100'
+  ;;
+esac
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+# We save the old values to restore during execute mode.
+if test "${LC_ALL+set}" = set; then
+  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
+fi
+if test "${LANG+set}" = set; then
+  save_LANG="$LANG"; LANG=C; export LANG
+fi
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" 	$lt_nl"
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+  $echo "$modename: not configured to build any kind of library" 1>&2
+  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+  exit $EXIT_FAILURE
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+
+#####################################
+# Shell function definitions:
+# This seems to be the best place for them
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid ()
+{
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
+      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+      win32_nmres=`eval $NM -f posix -A $1 | \
+	sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
+      if test "X$win32_nmres" = "Ximport" ; then
+        win32_libid_type="x86 archive import"
+      else
+        win32_libid_type="x86 archive static"
+      fi
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $echo $win32_libid_type
+}
+
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+	case $arg in
+	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	CC_quoted="$CC_quoted $arg"
+      done
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    CC_quoted=
+	    for arg in $CC; do
+	    # Double-quote args containing other shell metacharacters.
+	    case $arg in
+	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	      arg="\"$arg\""
+	      ;;
+	    esac
+	    CC_quoted="$CC_quoted $arg"
+	  done
+	    case "$@ " in
+	      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
+	      # The compiler in the base compile command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+	  fi
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  $echo "$modename: unable to infer tagged configuration"
+	  $echo "$modename: specify a tag with \`--tag'" 1>&2
+	  exit $EXIT_FAILURE
+#        else
+#          $echo "$modename: using $tagname tagged configuration"
+	fi
+	;;
+      esac
+    fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+
+    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
+    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
+      exit $EXIT_FAILURE
+    fi
+}
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    my_gentop="$1"; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
+    my_status=""
+
+    $show "${rm}r $my_gentop"
+    $run ${rm}r "$my_gentop"
+    $show "$mkdir $my_gentop"
+    $run $mkdir "$my_gentop"
+    my_status=$?
+    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
+      exit $my_status
+    fi
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+	*) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
+      my_xdir="$my_gentop/$my_xlib"
+
+      $show "${rm}r $my_xdir"
+      $run ${rm}r "$my_xdir"
+      $show "$mkdir $my_xdir"
+      $run $mkdir "$my_xdir"
+      status=$?
+      if test "$status" -ne 0 && test ! -d "$my_xdir"; then
+	exit $status
+      fi
+      case $host in
+      *-darwin*)
+	$show "Extracting $my_xabs"
+	# Do not bother doing anything if just a dry run
+	if test -z "$run"; then
+	  darwin_orig_dir=`pwd`
+	  cd $my_xdir || exit $?
+	  darwin_archive=$my_xabs
+	  darwin_curdir=`pwd`
+	  darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
+	  darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
+	  if test -n "$darwin_arches"; then 
+	    darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
+	    darwin_arch=
+	    $show "$darwin_base_archive has multiple architectures $darwin_arches"
+	    for darwin_arch in  $darwin_arches ; do
+	      mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+	      cd "$darwin_curdir"
+	      $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+	    done # $darwin_arches
+      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
+	    darwin_file=
+	    darwin_files=
+	    for darwin_file in $darwin_filelist; do
+	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+	      lipo -create -output "$darwin_file" $darwin_files
+	    done # $darwin_filelist
+	    ${rm}r unfat-$$
+	    cd "$darwin_orig_dir"
+	  else
+	    cd "$darwin_orig_dir"
+ 	    func_extract_an_archive "$my_xdir" "$my_xabs"
+	  fi # $darwin_arches
+	fi # $run
+	;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+        ;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+    done
+    func_extract_archives_result="$my_oldobjs"
+}
+# End of Shell function definitions
+#####################################
+
+# Darwin sucks
+eval std_shrext=\"$shrext_cmds\"
+
+# Parse our command line options once, thoroughly.
+while test "$#" -gt 0
+do
+  arg="$1"
+  shift
+
+  case $arg in
+  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) optarg= ;;
+  esac
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$prev"; then
+    case $prev in
+    execute_dlfiles)
+      execute_dlfiles="$execute_dlfiles $arg"
+      ;;
+    tag)
+      tagname="$arg"
+      preserve_args="${preserve_args}=$arg"
+
+      # Check whether tagname contains only valid characters
+      case $tagname in
+      *[!-_A-Za-z0-9,/]*)
+	$echo "$progname: invalid tag name: $tagname" 1>&2
+	exit $EXIT_FAILURE
+	;;
+      esac
+
+      case $tagname in
+      CC)
+	# Don't test for the "default" C tag, as we know, it's there, but
+	# not specially marked.
+	;;
+      *)
+	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
+	  taglist="$taglist $tagname"
+	  # Evaluate the configuration.
+	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
+	else
+	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
+	fi
+	;;
+      esac
+      ;;
+    *)
+      eval "$prev=\$arg"
+      ;;
+    esac
+
+    prev=
+    prevopt=
+    continue
+  fi
+
+  # Have we seen a non-optional argument yet?
+  case $arg in
+  --help)
+    show_help=yes
+    ;;
+
+  --version)
+    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+    $echo
+    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
+    $echo "This is free software; see the source for copying conditions.  There is NO"
+    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+    exit $?
+    ;;
+
+  --config)
+    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
+    done
+    exit $?
+    ;;
+
+  --debug)
+    $echo "$progname: enabling shell trace mode"
+    set -x
+    preserve_args="$preserve_args $arg"
+    ;;
+
+  --dry-run | -n)
+    run=:
+    ;;
+
+  --features)
+    $echo "host: $host"
+    if test "$build_libtool_libs" = yes; then
+      $echo "enable shared libraries"
+    else
+      $echo "disable shared libraries"
+    fi
+    if test "$build_old_libs" = yes; then
+      $echo "enable static libraries"
+    else
+      $echo "disable static libraries"
+    fi
+    exit $?
+    ;;
+
+  --finish) mode="finish" ;;
+
+  --mode) prevopt="--mode" prev=mode ;;
+  --mode=*) mode="$optarg" ;;
+
+  --preserve-dup-deps) duplicate_deps="yes" ;;
+
+  --quiet | --silent)
+    show=:
+    preserve_args="$preserve_args $arg"
+    ;;
+
+  --tag) prevopt="--tag" prev=tag ;;
+  --tag=*)
+    set tag "$optarg" ${1+"$@"}
+    shift
+    prev=tag
+    preserve_args="$preserve_args --tag"
+    ;;
+
+  -dlopen)
+    prevopt="-dlopen"
+    prev=execute_dlfiles
+    ;;
+
+  -*)
+    $echo "$modename: unrecognized option \`$arg'" 1>&2
+    $echo "$help" 1>&2
+    exit $EXIT_FAILURE
+    ;;
+
+  *)
+    nonopt="$arg"
+    break
+    ;;
+  esac
+done
+
+if test -n "$prevopt"; then
+  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+  $echo "$help" 1>&2
+  exit $EXIT_FAILURE
+fi
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+if test -z "$show_help"; then
+
+  # Infer the operation mode.
+  if test -z "$mode"; then
+    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
+    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
+    case $nonopt in
+    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
+      mode=link
+      for arg
+      do
+	case $arg in
+	-c)
+	   mode=compile
+	   break
+	   ;;
+	esac
+      done
+      ;;
+    *db | *dbx | *strace | *truss)
+      mode=execute
+      ;;
+    *install*|cp|mv)
+      mode=install
+      ;;
+    *rm)
+      mode=uninstall
+      ;;
+    *)
+      # If we have no mode, but dlfiles were specified, then do execute mode.
+      test -n "$execute_dlfiles" && mode=execute
+
+      # Just use the default operation mode.
+      if test -z "$mode"; then
+	if test -n "$nonopt"; then
+	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+	else
+	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+	fi
+      fi
+      ;;
+    esac
+  fi
+
+  # Only execute mode is allowed to have -dlopen flags.
+  if test -n "$execute_dlfiles" && test "$mode" != execute; then
+    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+    $echo "$help" 1>&2
+    exit $EXIT_FAILURE
+  fi
+
+  # Change the help message to a mode-specific one.
+  generic_help="$help"
+  help="Try \`$modename --help --mode=$mode' for more information."
+
+  # These modes are in order of execution frequency so that they run quickly.
+  case $mode in
+  # libtool compile mode
+  compile)
+    modename="$modename: compile"
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    suppress_opt=yes
+    suppress_output=
+    arg_mode=normal
+    libobj=
+    later=
+
+    for arg
+    do
+      case $arg_mode in
+      arg  )
+	# do not "continue".  Instead, add this to base_compile
+	lastarg="$arg"
+	arg_mode=normal
+	;;
+
+      target )
+	libobj="$arg"
+	arg_mode=normal
+	continue
+	;;
+
+      normal )
+	# Accept any command-line options.
+	case $arg in
+	-o)
+	  if test -n "$libobj" ; then
+	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  arg_mode=target
+	  continue
+	  ;;
+
+	-static | -prefer-pic | -prefer-non-pic)
+	  later="$later $arg"
+	  continue
+	  ;;
+
+	-no-suppress)
+	  suppress_opt=no
+	  continue
+	  ;;
+
+	-Xcompiler)
+	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
+	  continue      #  The current "srcfile" will either be retained or
+	  ;;            #  replaced later.  I would guess that would be a bug.
+
+	-Wc,*)
+	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+	  lastarg=
+	  save_ifs="$IFS"; IFS=','
+ 	  for arg in $args; do
+	    IFS="$save_ifs"
+
+	    # Double-quote args containing other shell metacharacters.
+	    # Many Bourne shells cannot handle close brackets correctly
+	    # in scan sets, so we specify it separately.
+	    case $arg in
+	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	      arg="\"$arg\""
+	      ;;
+	    esac
+	    lastarg="$lastarg $arg"
+	  done
+	  IFS="$save_ifs"
+	  lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+
+	  # Add the arguments to base_compile.
+	  base_compile="$base_compile $lastarg"
+	  continue
+	  ;;
+
+	* )
+	  # Accept the current argument as the source file.
+	  # The previous "srcfile" becomes the current argument.
+	  #
+	  lastarg="$srcfile"
+	  srcfile="$arg"
+	  ;;
+	esac  #  case $arg
+	;;
+      esac    #  case $arg_mode
+
+      # Aesthetically quote the previous argument.
+      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+      case $lastarg in
+      # Double-quote args containing other shell metacharacters.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, and some SunOS ksh mistreat backslash-escaping
+      # in scan sets (worked around with variable expansion),
+      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
+      # at all, so we specify them separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	lastarg="\"$lastarg\""
+	;;
+      esac
+
+      base_compile="$base_compile $lastarg"
+    done # for arg
+
+    case $arg_mode in
+    arg)
+      $echo "$modename: you must specify an argument for -Xcompile"
+      exit $EXIT_FAILURE
+      ;;
+    target)
+      $echo "$modename: you must specify a target with \`-o'" 1>&2
+      exit $EXIT_FAILURE
+      ;;
+    *)
+      # Get the name of the library object.
+      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    xform='[cCFSifmso]'
+    case $libobj in
+    *.ada) xform=ada ;;
+    *.adb) xform=adb ;;
+    *.ads) xform=ads ;;
+    *.asm) xform=asm ;;
+    *.c++) xform=c++ ;;
+    *.cc) xform=cc ;;
+    *.ii) xform=ii ;;
+    *.class) xform=class ;;
+    *.cpp) xform=cpp ;;
+    *.cxx) xform=cxx ;;
+    *.f90) xform=f90 ;;
+    *.for) xform=for ;;
+    *.java) xform=java ;;
+    esac
+
+    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+    case $libobj in
+    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+    *)
+      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+      exit $EXIT_FAILURE
+      ;;
+    esac
+
+    func_infer_tag $base_compile
+
+    for arg in $later; do
+      case $arg in
+      -static)
+	build_old_libs=yes
+	continue
+	;;
+
+      -prefer-pic)
+	pic_mode=yes
+	continue
+	;;
+
+      -prefer-non-pic)
+	pic_mode=no
+	continue
+	;;
+      esac
+    done
+
+    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
+    case $qlibobj in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	qlibobj="\"$qlibobj\"" ;;
+    esac
+    test "X$libobj" != "X$qlibobj" \
+	&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' 	&()|`$[]' \
+	&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
+    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$xdir" = "X$obj"; then
+      xdir=
+    else
+      xdir=$xdir/
+    fi
+    lobj=${xdir}$objdir/$objname
+
+    if test -z "$base_compile"; then
+      $echo "$modename: you must specify a compilation command" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
+    fi
+
+    $run $rm $removelist
+    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
+
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case $host_os in
+    cygwin* | mingw* | pw32* | os2*)
+      pic_mode=default
+      ;;
+    esac
+    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
+    fi
+
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test "$compiler_c_o" = no; then
+      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+      lockfile="$output_obj.lock"
+      removelist="$removelist $output_obj $lockfile"
+      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
+    else
+      output_obj=
+      need_locks=no
+      lockfile=
+    fi
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test "$need_locks" = yes; then
+      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
+	$show "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    elif test "$need_locks" = warn; then
+      if test -f "$lockfile"; then
+	$echo "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+      $echo "$srcfile" > "$lockfile"
+    fi
+
+    if test -n "$fix_srcfile_path"; then
+      eval srcfile=\"$fix_srcfile_path\"
+    fi
+    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
+    case $qsrcfile in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+      qsrcfile="\"$qsrcfile\"" ;;
+    esac
+
+    $run $rm "$libobj" "${libobj}T"
+
+    # Create a libtool object file (analogous to a ".la" file),
+    # but don't create it if we're doing a dry run.
+    test -z "$run" && cat > ${libobj}T <<EOF
+# $libobj - a libtool object file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+EOF
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test "$pic_mode" != no; then
+	command="$base_compile $qsrcfile $pic_flag"
+      else
+	# Don't build PIC code
+	command="$base_compile $qsrcfile"
+      fi
+
+      if test ! -d "${xdir}$objdir"; then
+	$show "$mkdir ${xdir}$objdir"
+	$run $mkdir ${xdir}$objdir
+	status=$?
+	if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
+	  exit $status
+	fi
+      fi
+
+      if test -z "$output_obj"; then
+	# Place PIC objects in $objdir
+	command="$command -o $lobj"
+      fi
+
+      $run $rm "$lobj" "$output_obj"
+
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+	test -n "$output_obj" && $run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+	$show "$mv $output_obj $lobj"
+	if $run $mv $output_obj $lobj; then :
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+      fi
+
+      # Append the name of the PIC object to the libtool object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object='$objdir/$objname'
+
+EOF
+
+      # Allow error messages only from the first compilation.
+      if test "$suppress_opt" = yes; then
+        suppress_output=' >/dev/null 2>&1'
+      fi
+    else
+      # No PIC object so indicate it doesn't exist in the libtool
+      # object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object=none
+
+EOF
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
+	# Don't build PIC code
+	command="$base_compile $qsrcfile"
+      else
+	command="$base_compile $qsrcfile $pic_flag"
+      fi
+      if test "$compiler_c_o" = yes; then
+	command="$command -o $obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      command="$command$suppress_output"
+      $run $rm "$obj" "$output_obj"
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+	$run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+	$show "$mv $output_obj $obj"
+	if $run $mv $output_obj $obj; then :
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+      fi
+
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object='$objname'
+
+EOF
+    else
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object=none
+
+EOF
+    fi
+
+    $run $mv "${libobj}T" "${libobj}"
+
+    # Unlock the critical section if it was locked
+    if test "$need_locks" != no; then
+      $run $rm "$lockfile"
+    fi
+
+    exit $EXIT_SUCCESS
+    ;;
+
+  # libtool link mode
+  link | relink)
+    modename="$modename: link"
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # which system we are compiling for in order to pass an extra
+      # flag for every libtool invocation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll which has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args="$nonopt"
+    base_compile="$nonopt $@"
+    compile_command="$nonopt"
+    finalize_command="$nonopt"
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+
+    avoid_version=no
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    non_pic_objects=
+    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
+
+    func_infer_tag $base_compile
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -all-static | -static)
+	if test "X$arg" = "X-all-static"; then
+	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+	  fi
+	  if test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	else
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	fi
+	build_libtool_libs=no
+	build_old_libs=yes
+	prefer_static_libs=yes
+	break
+	;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test "$#" -gt 0; do
+      arg="$1"
+      shift
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
+	;;
+      *) qarg=$arg ;;
+      esac
+      libtool_args="$libtool_args $qarg"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+	case $prev in
+	output)
+	  compile_command="$compile_command @OUTPUT@"
+	  finalize_command="$finalize_command @OUTPUT@"
+	  ;;
+	esac
+
+	case $prev in
+	dlfiles|dlprefiles)
+	  if test "$preload" = no; then
+	    # Add the symbol object into the linking commands.
+	    compile_command="$compile_command @SYMFILE@"
+	    finalize_command="$finalize_command @SYMFILE@"
+	    preload=yes
+	  fi
+	  case $arg in
+	  *.la | *.lo) ;;  # We handle these cases below.
+	  force)
+	    if test "$dlself" = no; then
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  self)
+	    if test "$prev" = dlprefiles; then
+	      dlself=yes
+	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	      dlself=yes
+	    else
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  *)
+	    if test "$prev" = dlfiles; then
+	      dlfiles="$dlfiles $arg"
+	    else
+	      dlprefiles="$dlprefiles $arg"
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  esac
+	  ;;
+	expsyms)
+	  export_symbols="$arg"
+	  if test ! -f "$arg"; then
+	    $echo "$modename: symbol file \`$arg' does not exist"
+	    exit $EXIT_FAILURE
+	  fi
+	  prev=
+	  continue
+	  ;;
+	expsyms_regex)
+	  export_symbols_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	inst_prefix)
+	  inst_prefix_dir="$arg"
+	  prev=
+	  continue
+	  ;;
+	precious_regex)
+	  precious_files_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	release)
+	  release="-$arg"
+	  prev=
+	  continue
+	  ;;
+	objectlist)
+	  if test -f "$arg"; then
+	    save_arg=$arg
+	    moreargs=
+	    for fil in `cat $save_arg`
+	    do
+#	      moreargs="$moreargs $fil"
+	      arg=$fil
+	      # A libtool-controlled object.
+
+	      # Check to see that this really is a libtool object.
+	      if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+		pic_object=
+		non_pic_object=
+
+		# Read the .lo file
+		# If there is no directory component, then add one.
+		case $arg in
+		*/* | *\\*) . $arg ;;
+		*) . ./$arg ;;
+		esac
+
+		if test -z "$pic_object" || \
+		   test -z "$non_pic_object" ||
+		   test "$pic_object" = none && \
+		   test "$non_pic_object" = none; then
+		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+		  exit $EXIT_FAILURE
+		fi
+
+		# Extract subdirectory from the argument.
+		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+		if test "X$xdir" = "X$arg"; then
+		  xdir=
+		else
+		  xdir="$xdir/"
+		fi
+
+		if test "$pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  pic_object="$xdir$pic_object"
+
+		  if test "$prev" = dlfiles; then
+		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		      dlfiles="$dlfiles $pic_object"
+		      prev=
+		      continue
+		    else
+		      # If libtool objects are unsupported, then we need to preload.
+		      prev=dlprefiles
+		    fi
+		  fi
+
+		  # CHECK ME:  I think I busted this.  -Ossama
+		  if test "$prev" = dlprefiles; then
+		    # Preload the old-style object.
+		    dlprefiles="$dlprefiles $pic_object"
+		    prev=
+		  fi
+
+		  # A PIC object.
+		  libobjs="$libobjs $pic_object"
+		  arg="$pic_object"
+		fi
+
+		# Non-PIC object.
+		if test "$non_pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  non_pic_object="$xdir$non_pic_object"
+
+		  # A standard non-PIC object
+		  non_pic_objects="$non_pic_objects $non_pic_object"
+		  if test -z "$pic_object" || test "$pic_object" = none ; then
+		    arg="$non_pic_object"
+		  fi
+		fi
+	      else
+		# Only an error if not doing a dry-run.
+		if test -z "$run"; then
+		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+		  exit $EXIT_FAILURE
+		else
+		  # Dry-run case.
+
+		  # Extract subdirectory from the argument.
+		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+		  if test "X$xdir" = "X$arg"; then
+		    xdir=
+		  else
+		    xdir="$xdir/"
+		  fi
+
+		  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+		  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+		  libobjs="$libobjs $pic_object"
+		  non_pic_objects="$non_pic_objects $non_pic_object"
+		fi
+	      fi
+	    done
+	  else
+	    $echo "$modename: link input file \`$save_arg' does not exist"
+	    exit $EXIT_FAILURE
+	  fi
+	  arg=$save_arg
+	  prev=
+	  continue
+	  ;;
+	rpath | xrpath)
+	  # We need an absolute path.
+	  case $arg in
+	  [\\/]* | [A-Za-z]:[\\/]*) ;;
+	  *)
+	    $echo "$modename: only absolute run-paths are allowed" 1>&2
+	    exit $EXIT_FAILURE
+	    ;;
+	  esac
+	  if test "$prev" = rpath; then
+	    case "$rpath " in
+	    *" $arg "*) ;;
+	    *) rpath="$rpath $arg" ;;
+	    esac
+	  else
+	    case "$xrpath " in
+	    *" $arg "*) ;;
+	    *) xrpath="$xrpath $arg" ;;
+	    esac
+	  fi
+	  prev=
+	  continue
+	  ;;
+	xcompiler)
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  compile_command="$compile_command $qarg"
+	  finalize_command="$finalize_command $qarg"
+	  continue
+	  ;;
+	xlinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $wl$qarg"
+	  prev=
+	  compile_command="$compile_command $wl$qarg"
+	  finalize_command="$finalize_command $wl$qarg"
+	  continue
+	  ;;
+	xcclinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  compile_command="$compile_command $qarg"
+	  finalize_command="$finalize_command $qarg"
+	  continue
+	  ;;
+	shrext)
+  	  shrext_cmds="$arg"
+	  prev=
+	  continue
+	  ;;
+        darwin_framework)
+	  compiler_flags="$compiler_flags $arg"
+	  compile_command="$compile_command $arg"
+	  finalize_command="$finalize_command $arg"
+	  prev=
+	  continue
+	  ;;
+	*)
+	  eval "$prev=\"\$arg\""
+	  prev=
+	  continue
+	  ;;
+	esac
+      fi # test -n "$prev"
+
+      prevarg="$arg"
+
+      case $arg in
+      -all-static)
+	if test -n "$link_static_flag"; then
+	  compile_command="$compile_command $link_static_flag"
+	  finalize_command="$finalize_command $link_static_flag"
+	fi
+	continue
+	;;
+
+      -allow-undefined)
+	# FIXME: remove this flag sometime in the future.
+	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+	continue
+	;;
+
+      -avoid-version)
+	avoid_version=yes
+	continue
+	;;
+
+      -dlopen)
+	prev=dlfiles
+	continue
+	;;
+
+      -dlpreopen)
+	prev=dlprefiles
+	continue
+	;;
+
+      -export-dynamic)
+	export_dynamic=yes
+	continue
+	;;
+
+      -export-symbols | -export-symbols-regex)
+	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	  $echo "$modename: more than one -exported-symbols argument is not allowed"
+	  exit $EXIT_FAILURE
+	fi
+	if test "X$arg" = "X-export-symbols"; then
+	  prev=expsyms
+	else
+	  prev=expsyms_regex
+	fi
+	continue
+	;;
+
+      -framework|-arch)
+        prev=darwin_framework
+        compiler_flags="$compiler_flags $arg"
+	compile_command="$compile_command $arg"
+	finalize_command="$finalize_command $arg"
+        continue
+        ;;
+
+      -inst-prefix-dir)
+	prev=inst_prefix
+	continue
+	;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+	case $with_gcc/$host in
+	no/*-*-irix* | /*-*-irix*)
+	  compile_command="$compile_command $arg"
+	  finalize_command="$finalize_command $arg"
+	  ;;
+	esac
+	continue
+	;;
+
+      -L*)
+	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  absdir=`cd "$dir" && pwd`
+	  if test -z "$absdir"; then
+	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  dir="$absdir"
+	  ;;
+	esac
+	case "$deplibs " in
+	*" -L$dir "*) ;;
+	*)
+	  deplibs="$deplibs -L$dir"
+	  lib_search_path="$lib_search_path $dir"
+	  ;;
+	esac
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  case :$dllsearchpath: in
+	  *":$dir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$dir";;
+	  esac
+	  ;;
+	esac
+	continue
+	;;
+
+      -l*)
+	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+	  case $host in
+	  *-*-cygwin* | *-*-pw32* | *-*-beos*)
+	    # These systems don't actually have a C or math library (as such)
+	    continue
+	    ;;
+	  *-*-mingw* | *-*-os2*)
+	    # These systems don't actually have a C library (as such)
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C and math libraries are in the System framework
+	    deplibs="$deplibs -framework System"
+	    continue
+	  esac
+	elif test "X$arg" = "X-lc_r"; then
+	 case $host in
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	   # Do not include libc_r directly, use -pthread flag.
+	   continue
+	   ;;
+	 esac
+	fi
+	deplibs="$deplibs $arg"
+	continue
+	;;
+
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      -model)
+	compile_command="$compile_command $arg"
+	compiler_flags="$compiler_flags $arg"
+	finalize_command="$finalize_command $arg"
+	prev=xcompiler
+	continue
+	;;
+
+     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+	compiler_flags="$compiler_flags $arg"
+	compile_command="$compile_command $arg"
+	finalize_command="$finalize_command $arg"
+	continue
+	;;
+
+      -module)
+	module=yes
+	continue
+	;;
+
+      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+      # -r[0-9][0-9]* specifies the processor on the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+      # +DA*, +DD* enable 64-bit mode on the HP compiler
+      # -q* pass through compiler args for the IBM compiler
+      # -m* pass through architecture-specific compiler args for GCC
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
+
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+        compile_command="$compile_command $arg"
+        finalize_command="$finalize_command $arg"
+        if test "$with_gcc" = "yes" ; then
+          compiler_flags="$compiler_flags $arg"
+        fi
+        continue
+        ;;
+
+      -shrext)
+	prev=shrext
+	continue
+	;;
+
+      -no-fast-install)
+	fast_install=no
+	continue
+	;;
+
+      -no-install)
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  # The PATH hackery in wrapper scripts is required on Windows
+	  # in order for the loader to find any dlls it needs.
+	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
+	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
+	  fast_install=no
+	  ;;
+	*) no_install=yes ;;
+	esac
+	continue
+	;;
+
+      -no-undefined)
+	allow_undefined=no
+	continue
+	;;
+
+      -objectlist)
+	prev=objectlist
+	continue
+	;;
+
+      -o) prev=output ;;
+
+      -precious-files-regex)
+	prev=precious_regex
+	continue
+	;;
+
+      -release)
+	prev=release
+	continue
+	;;
+
+      -rpath)
+	prev=rpath
+	continue
+	;;
+
+      -R)
+	prev=xrpath
+	continue
+	;;
+
+      -R*)
+	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  $echo "$modename: only absolute run-paths are allowed" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+	case "$xrpath " in
+	*" $dir "*) ;;
+	*) xrpath="$xrpath $dir" ;;
+	esac
+	continue
+	;;
+
+      -static)
+	# The effects of -static are defined in a previous loop.
+	# We used to do the same as -all-static on platforms that
+	# didn't have a PIC flag, but the assumption that the effects
+	# would be equivalent was wrong.  It would break on at least
+	# Digital Unix and AIX.
+	continue
+	;;
+
+      -thread-safe)
+	thread_safe=yes
+	continue
+	;;
+
+      -version-info)
+	prev=vinfo
+	continue
+	;;
+      -version-number)
+	prev=vinfo
+	vinfo_number=yes
+	continue
+	;;
+
+      -Wc,*)
+	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+	  case $flag in
+	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	    flag="\"$flag\""
+	    ;;
+	  esac
+	  arg="$arg $wl$flag"
+	  compiler_flags="$compiler_flags $flag"
+	done
+	IFS="$save_ifs"
+	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	;;
+
+      -Wl,*)
+	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+	  case $flag in
+	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	    flag="\"$flag\""
+	    ;;
+	  esac
+	  arg="$arg $wl$flag"
+	  compiler_flags="$compiler_flags $wl$flag"
+	  linker_flags="$linker_flags $flag"
+	done
+	IFS="$save_ifs"
+	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	;;
+
+      -Xcompiler)
+	prev=xcompiler
+	continue
+	;;
+
+      -Xlinker)
+	prev=xlinker
+	continue
+	;;
+
+      -XCClinker)
+	prev=xcclinker
+	continue
+	;;
+
+      # Some other compiler flag.
+      -* | +*)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	;;
+
+      *.$objext)
+	# A standard object.
+	objs="$objs $arg"
+	;;
+
+      *.lo)
+	# A libtool-controlled object.
+
+	# Check to see that this really is a libtool object.
+	if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  pic_object=
+	  non_pic_object=
+
+	  # Read the .lo file
+	  # If there is no directory component, then add one.
+	  case $arg in
+	  */* | *\\*) . $arg ;;
+	  *) . ./$arg ;;
+	  esac
+
+	  if test -z "$pic_object" || \
+	     test -z "$non_pic_object" ||
+	     test "$pic_object" = none && \
+	     test "$non_pic_object" = none; then
+	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+
+	  # Extract subdirectory from the argument.
+	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+	  if test "X$xdir" = "X$arg"; then
+	    xdir=
+ 	  else
+	    xdir="$xdir/"
+	  fi
+
+	  if test "$pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    pic_object="$xdir$pic_object"
+
+	    if test "$prev" = dlfiles; then
+	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		dlfiles="$dlfiles $pic_object"
+		prev=
+		continue
+	      else
+		# If libtool objects are unsupported, then we need to preload.
+		prev=dlprefiles
+	      fi
+	    fi
+
+	    # CHECK ME:  I think I busted this.  -Ossama
+	    if test "$prev" = dlprefiles; then
+	      # Preload the old-style object.
+	      dlprefiles="$dlprefiles $pic_object"
+	      prev=
+	    fi
+
+	    # A PIC object.
+	    libobjs="$libobjs $pic_object"
+	    arg="$pic_object"
+	  fi
+
+	  # Non-PIC object.
+	  if test "$non_pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    non_pic_object="$xdir$non_pic_object"
+
+	    # A standard non-PIC object
+	    non_pic_objects="$non_pic_objects $non_pic_object"
+	    if test -z "$pic_object" || test "$pic_object" = none ; then
+	      arg="$non_pic_object"
+	    fi
+	  fi
+	else
+	  # Only an error if not doing a dry-run.
+	  if test -z "$run"; then
+	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+	    exit $EXIT_FAILURE
+	  else
+	    # Dry-run case.
+
+	    # Extract subdirectory from the argument.
+	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+	    if test "X$xdir" = "X$arg"; then
+	      xdir=
+	    else
+	      xdir="$xdir/"
+	    fi
+
+	    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+	    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+	    libobjs="$libobjs $pic_object"
+	    non_pic_objects="$non_pic_objects $non_pic_object"
+	  fi
+	fi
+	;;
+
+      *.$libext)
+	# An archive.
+	deplibs="$deplibs $arg"
+	old_deplibs="$old_deplibs $arg"
+	continue
+	;;
+
+      *.la)
+	# A libtool-controlled library.
+
+	if test "$prev" = dlfiles; then
+	  # This library was specified with -dlopen.
+	  dlfiles="$dlfiles $arg"
+	  prev=
+	elif test "$prev" = dlprefiles; then
+	  # The library was specified with -dlpreopen.
+	  dlprefiles="$dlprefiles $arg"
+	  prev=
+	else
+	  deplibs="$deplibs $arg"
+	fi
+	continue
+	;;
+
+      # Some other compiler argument.
+      *)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	;;
+      esac # arg
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+	compile_command="$compile_command $arg"
+	finalize_command="$finalize_command $arg"
+      fi
+    done # argument parsing loop
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      compile_command="$compile_command $arg"
+      finalize_command="$finalize_command $arg"
+    fi
+
+    oldlibs=
+    # calculate the name of the file, without its directory
+    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+    libobjs_save="$libobjs"
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$output_objdir" = "X$output"; then
+      output_objdir="$objdir"
+    else
+      output_objdir="$output_objdir/$objdir"
+    fi
+    # Create the object directory.
+    if test ! -d "$output_objdir"; then
+      $show "$mkdir $output_objdir"
+      $run $mkdir $output_objdir
+      status=$?
+      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
+	exit $status
+      fi
+    fi
+
+    # Determine the type of output
+    case $output in
+    "")
+      $echo "$modename: you must specify an output file" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    case $host in
+    *cygwin* | *mingw* | *pw32*)
+      # don't eliminate duplications in $postdeps and $predeps
+      duplicate_compiler_generated_deps=yes
+      ;;
+    *)
+      duplicate_compiler_generated_deps=$duplicate_deps
+      ;;
+    esac
+    specialdeplibs=
+
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      if test "X$duplicate_deps" = "Xyes" ; then
+	case "$libs " in
+	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	esac
+      fi
+      libs="$libs $deplib"
+    done
+
+    if test "$linkmode" = lib; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
+	for pre_post_dep in $predeps $postdeps; do
+	  case "$pre_post_deps " in
+	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+	  esac
+	  pre_post_deps="$pre_post_deps $pre_post_dep"
+	done
+      fi
+      pre_post_deps=
+    fi
+
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
+    case $linkmode in
+    lib)
+	passes="conv link"
+	for file in $dlfiles $dlprefiles; do
+	  case $file in
+	  *.la) ;;
+	  *)
+	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
+	    exit $EXIT_FAILURE
+	    ;;
+	  esac
+	done
+	;;
+    prog)
+	compile_deplibs=
+	finalize_deplibs=
+	alldeplibs=no
+	newdlfiles=
+	newdlprefiles=
+	passes="conv scan dlopen dlpreopen link"
+	;;
+    *)  passes="conv"
+	;;
+    esac
+    for pass in $passes; do
+      if test "$linkmode,$pass" = "lib,link" ||
+	 test "$linkmode,$pass" = "prog,scan"; then
+	libs="$deplibs"
+	deplibs=
+      fi
+      if test "$linkmode" = prog; then
+	case $pass in
+	dlopen) libs="$dlfiles" ;;
+	dlpreopen) libs="$dlprefiles" ;;
+	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	esac
+      fi
+      if test "$pass" = dlopen; then
+	# Collect dlpreopened libraries
+	save_deplibs="$deplibs"
+	deplibs=
+      fi
+      for deplib in $libs; do
+	lib=
+	found=no
+	case $deplib in
+	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    compiler_flags="$compiler_flags $deplib"
+	  fi
+	  continue
+	  ;;
+	-l*)
+	  if test "$linkmode" != lib && test "$linkmode" != prog; then
+	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+	    continue
+	  fi
+	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
+	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
+	    for search_ext in .la $std_shrext .so .a; do
+	      # Search the libtool library
+	      lib="$searchdir/lib${name}${search_ext}"
+	      if test -f "$lib"; then
+		if test "$search_ext" = ".la"; then
+		  found=yes
+		else
+		  found=no
+		fi
+		break 2
+	      fi
+	    done
+	  done
+	  if test "$found" != yes; then
+	    # deplib doesn't seem to be a libtool library
+	    if test "$linkmode,$pass" = "prog,link"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
+	  else # deplib is a libtool library
+	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+	    # We need to do some special things here, and not later.
+	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      case " $predeps $postdeps " in
+	      *" $deplib "*)
+		if (${SED} -e '2q' $lib |
+                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+		  library_names=
+		  old_library=
+		  case $lib in
+		  */* | *\\*) . $lib ;;
+		  *) . ./$lib ;;
+		  esac
+		  for l in $old_library $library_names; do
+		    ll="$l"
+		  done
+		  if test "X$ll" = "X$old_library" ; then # only static version available
+		    found=no
+		    ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+		    test "X$ladir" = "X$lib" && ladir="."
+		    lib=$ladir/$old_library
+		    if test "$linkmode,$pass" = "prog,link"; then
+		      compile_deplibs="$deplib $compile_deplibs"
+		      finalize_deplibs="$deplib $finalize_deplibs"
+		    else
+		      deplibs="$deplib $deplibs"
+		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+		    fi
+		    continue
+		  fi
+		fi
+	        ;;
+	      *) ;;
+	      esac
+	    fi
+	  fi
+	  ;; # -l
+	-L*)
+	  case $linkmode in
+	  lib)
+	    deplibs="$deplib $deplibs"
+	    test "$pass" = conv && continue
+	    newdependency_libs="$deplib $newdependency_libs"
+	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    ;;
+	  prog)
+	    if test "$pass" = conv; then
+	      deplibs="$deplib $deplibs"
+	      continue
+	    fi
+	    if test "$pass" = scan; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    ;;
+	  *)
+	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
+	    ;;
+	  esac # linkmode
+	  continue
+	  ;; # -L
+	-R*)
+	  if test "$pass" = link; then
+	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+	    # Make sure the xrpath contains only unique directories.
+	    case "$xrpath " in
+	    *" $dir "*) ;;
+	    *) xrpath="$xrpath $dir" ;;
+	    esac
+	  fi
+	  deplibs="$deplib $deplibs"
+	  continue
+	  ;;
+	*.la) lib="$deplib" ;;
+	*.$libext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  case $linkmode in
+	  lib)
+	    valid_a_lib=no
+	    case $deplibs_check_method in
+	      match_pattern*)
+		set dummy $deplibs_check_method
+	        match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+		if eval $echo \"$deplib\" 2>/dev/null \
+		    | $SED 10q \
+		    | $EGREP "$match_pattern_regex" > /dev/null; then
+		  valid_a_lib=yes
+		fi
+		;;
+	      pass_all)
+		valid_a_lib=yes
+		;;
+            esac
+	    if test "$valid_a_lib" != yes; then
+	      $echo
+	      $echo "*** Warning: Trying to link with static lib archive $deplib."
+	      $echo "*** I have the capability to make that library automatically link in when"
+	      $echo "*** you link to this library.  But I can only do this if you have a"
+	      $echo "*** shared version of the library, which you do not appear to have"
+	      $echo "*** because the file extensions .$libext of this argument makes me believe"
+	      $echo "*** that it is just a static archive that I should not used here."
+	    else
+	      $echo
+	      $echo "*** Warning: Linking the shared library $output against the"
+	      $echo "*** static library $deplib is not portable!"
+	      deplibs="$deplib $deplibs"
+	    fi
+	    continue
+	    ;;
+	  prog)
+	    if test "$pass" != link; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    continue
+	    ;;
+	  esac # linkmode
+	  ;; # *.$libext
+	*.lo | *.$objext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	  elif test "$linkmode" = prog; then
+	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	      # If there is no dlopen support or we're linking statically,
+	      # we need to preload.
+	      newdlprefiles="$newdlprefiles $deplib"
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      newdlfiles="$newdlfiles $deplib"
+	    fi
+	  fi
+	  continue
+	  ;;
+	%DEPLIBS%)
+	  alldeplibs=yes
+	  continue
+	  ;;
+	esac # case $deplib
+	if test "$found" = yes || test -f "$lib"; then :
+	else
+	  $echo "$modename: cannot find the library \`$lib'" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$ladir" = "X$lib" && ladir="."
+
+	dlname=
+	dlopen=
+	dlpreopen=
+	libdir=
+	library_names=
+	old_library=
+	# If the library was installed with an old release of libtool,
+	# it will not redefine variables installed, or shouldnotlink
+	installed=yes
+	shouldnotlink=no
+	avoidtemprpath=
+
+
+	# Read the .la file
+	case $lib in
+	*/* | *\\*) . $lib ;;
+	*) . ./$lib ;;
+	esac
+
+	if test "$linkmode,$pass" = "lib,link" ||
+	   test "$linkmode,$pass" = "prog,scan" ||
+	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+	fi
+
+	if test "$pass" = conv; then
+	  # Only check for convenience libraries
+	  deplibs="$lib $deplibs"
+	  if test -z "$libdir"; then
+	    if test -z "$old_library"; then
+	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+	      exit $EXIT_FAILURE
+	    fi
+	    # It is a libtool convenience library, so add in its objects.
+	    convenience="$convenience $ladir/$objdir/$old_library"
+	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
+	    tmp_libs=
+	    for deplib in $dependency_libs; do
+	      deplibs="$deplib $deplibs"
+              if test "X$duplicate_deps" = "Xyes" ; then
+	        case "$tmp_libs " in
+	        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	        esac
+              fi
+	      tmp_libs="$tmp_libs $deplib"
+	    done
+	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
+	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  continue
+	fi # $pass = conv
+
+
+	# Get the name of the library we link against.
+	linklib=
+	for l in $old_library $library_names; do
+	  linklib="$l"
+	done
+	if test -z "$linklib"; then
+	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# This library was specified with -dlopen.
+	if test "$pass" = dlopen; then
+	  if test -z "$libdir"; then
+	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  if test -z "$dlname" ||
+	     test "$dlopen_support" != yes ||
+	     test "$build_libtool_libs" = no; then
+	    # If there is no dlname, no dlopen support or we're linking
+	    # statically, we need to preload.  We also need to preload any
+	    # dependent libraries so libltdl's deplib preloader doesn't
+	    # bomb out in the load deplibs phase.
+	    dlprefiles="$dlprefiles $lib $dependency_libs"
+	  else
+	    newdlfiles="$newdlfiles $lib"
+	  fi
+	  continue
+	fi # $pass = dlopen
+
+	# We need an absolute path.
+	case $ladir in
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	*)
+	  abs_ladir=`cd "$ladir" && pwd`
+	  if test -z "$abs_ladir"; then
+	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
+	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+	    abs_ladir="$ladir"
+	  fi
+	  ;;
+	esac
+	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+
+	# Find the relevant object directory and library name.
+	if test "X$installed" = Xyes; then
+	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    libdir="$abs_ladir"
+	  else
+	    dir="$libdir"
+	    absdir="$libdir"
+	  fi
+	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+	else
+	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    # Remove this search path later
+	    notinst_path="$notinst_path $abs_ladir"
+	  else
+	    dir="$ladir/$objdir"
+	    absdir="$abs_ladir/$objdir"
+	    # Remove this search path later
+	    notinst_path="$notinst_path $abs_ladir"
+	  fi
+	fi # $installed = yes
+	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+
+	# This library was specified with -dlpreopen.
+	if test "$pass" = dlpreopen; then
+	  if test -z "$libdir"; then
+	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  # Prefer using a static library (so that no silly _DYNAMIC symbols
+	  # are required to link).
+	  if test -n "$old_library"; then
+	    newdlprefiles="$newdlprefiles $dir/$old_library"
+	  # Otherwise, use the dlname, so that lt_dlopen finds it.
+	  elif test -n "$dlname"; then
+	    newdlprefiles="$newdlprefiles $dir/$dlname"
+	  else
+	    newdlprefiles="$newdlprefiles $dir/$linklib"
+	  fi
+	fi # $pass = dlpreopen
+
+	if test -z "$libdir"; then
+	  # Link the convenience library
+	  if test "$linkmode" = lib; then
+	    deplibs="$dir/$old_library $deplibs"
+	  elif test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$dir/$old_library $compile_deplibs"
+	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
+	  else
+	    deplibs="$lib $deplibs" # used for prog,scan pass
+	  fi
+	  continue
+	fi
+
+
+	if test "$linkmode" = prog && test "$pass" != link; then
+	  newlib_search_path="$newlib_search_path $ladir"
+	  deplibs="$lib $deplibs"
+
+	  linkalldeplibs=no
+	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
+	     test "$build_libtool_libs" = no; then
+	    linkalldeplibs=yes
+	  fi
+
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    case $deplib in
+	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+	    esac
+	    # Need to link against all dependency_libs?
+	    if test "$linkalldeplibs" = yes; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      # Need to hardcode shared library paths
+	      # or/and link against static libraries
+	      newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    if test "X$duplicate_deps" = "Xyes" ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done # for deplib
+	  continue
+	fi # $linkmode = prog...
+
+	if test "$linkmode,$pass" = "prog,link"; then
+	  if test -n "$library_names" &&
+	     { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+	    # We need to hardcode the library path
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+	      # Make sure the rpath contains only unique directories.
+	      case "$temp_rpath " in
+	      *" $dir "*) ;;
+	      *" $absdir "*) ;;
+	      *) temp_rpath="$temp_rpath $absdir" ;;
+	      esac
+	    fi
+
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi # $linkmode,$pass = prog,link...
+
+	  if test "$alldeplibs" = yes &&
+	     { test "$deplibs_check_method" = pass_all ||
+	       { test "$build_libtool_libs" = yes &&
+		 test -n "$library_names"; }; }; then
+	    # We only need to search for static libraries
+	    continue
+	  fi
+	fi
+
+	link_static=no # Whether the deplib will be linked statically
+	if test -n "$library_names" &&
+	   { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+	  if test "$installed" = no; then
+	    notinst_deplibs="$notinst_deplibs $lib"
+	    need_relink=yes
+	  fi
+	  # This is a shared library
+
+	  # Warn about portability, can't link against -module's on
+	  # some systems (darwin)
+	  if test "$shouldnotlink" = yes && test "$pass" = link ; then
+	    $echo
+	    if test "$linkmode" = prog; then
+	      $echo "*** Warning: Linking the executable $output against the loadable module"
+	    else
+	      $echo "*** Warning: Linking the shared library $output against the loadable module"
+	    fi
+	    $echo "*** $linklib is not portable!"
+	  fi
+	  if test "$linkmode" = lib &&
+	     test "$hardcode_into_libs" = yes; then
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi
+
+	  if test -n "$old_archive_from_expsyms_cmds"; then
+	    # figure out the soname
+	    set dummy $library_names
+	    realname="$2"
+	    shift; shift
+	    libname=`eval \\$echo \"$libname_spec\"`
+	    # use dlname if we got it. it's perfectly good, no?
+	    if test -n "$dlname"; then
+	      soname="$dlname"
+	    elif test -n "$soname_spec"; then
+	      # bleh windows
+	      case $host in
+	      *cygwin* | mingw*)
+		major=`expr $current - $age`
+		versuffix="-$major"
+		;;
+	      esac
+	      eval soname=\"$soname_spec\"
+	    else
+	      soname="$realname"
+	    fi
+
+	    # Make a new name for the extract_expsyms_cmds to use
+	    soroot="$soname"
+	    soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
+	    newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
+
+	    # If the library has no export list, then create one now
+	    if test -f "$output_objdir/$soname-def"; then :
+	    else
+	      $show "extracting exported symbol list from \`$soname'"
+	      save_ifs="$IFS"; IFS='~'
+	      cmds=$extract_expsyms_cmds
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
+		$show "$cmd"
+		$run eval "$cmd" || exit $?
+	      done
+	      IFS="$save_ifs"
+	    fi
+
+	    # Create $newlib
+	    if test -f "$output_objdir/$newlib"; then :; else
+	      $show "generating import library for \`$soname'"
+	      save_ifs="$IFS"; IFS='~'
+	      cmds=$old_archive_from_expsyms_cmds
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
+		$show "$cmd"
+		$run eval "$cmd" || exit $?
+	      done
+	      IFS="$save_ifs"
+	    fi
+	    # make sure the library variables are pointing to the new library
+	    dir=$output_objdir
+	    linklib=$newlib
+	  fi # test -n "$old_archive_from_expsyms_cmds"
+
+	  if test "$linkmode" = prog || test "$mode" != relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    lib_linked=yes
+	    case $hardcode_action in
+	    immediate | unsupported)
+	      if test "$hardcode_direct" = no; then
+		add="$dir/$linklib"
+		case $host in
+		  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
+		  *-*-darwin* )
+		    # if the lib is a module then we can not link against
+		    # it, someone is ignoring the new warnings I added
+		    if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
+		      $echo "** Warning, lib $linklib is a module, not a shared library"
+		      if test -z "$old_library" ; then
+		        $echo
+		        $echo "** And there doesn't seem to be a static archive available"
+		        $echo "** The link will probably fail, sorry"
+		      else
+		        add="$dir/$old_library"
+		      fi
+		    fi
+		esac
+	      elif test "$hardcode_minus_L" = no; then
+		case $host in
+		*-*-sunos*) add_shlibpath="$dir" ;;
+		esac
+		add_dir="-L$dir"
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = no; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    relink)
+	      if test "$hardcode_direct" = yes; then
+		add="$dir/$linklib"
+	      elif test "$hardcode_minus_L" = yes; then
+		add_dir="-L$dir"
+		# Try looking first in the location we're being installed to.
+		if test -n "$inst_prefix_dir"; then
+		  case $libdir in
+		    [\\/]*)
+		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		      ;;
+		  esac
+		fi
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = yes; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    *) lib_linked=no ;;
+	    esac
+
+	    if test "$lib_linked" != yes; then
+	      $echo "$modename: configuration error: unsupported hardcode properties"
+	      exit $EXIT_FAILURE
+	    fi
+
+	    if test -n "$add_shlibpath"; then
+	      case :$compile_shlibpath: in
+	      *":$add_shlibpath:"*) ;;
+	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+	      esac
+	    fi
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	      if test "$hardcode_direct" != yes && \
+		 test "$hardcode_minus_L" != yes && \
+		 test "$hardcode_shlibpath_var" = yes; then
+		case :$finalize_shlibpath: in
+		*":$libdir:"*) ;;
+		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+		esac
+	      fi
+	    fi
+	  fi
+
+	  if test "$linkmode" = prog || test "$mode" = relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    # Finalize command for both is simple: just hardcode it.
+	    if test "$hardcode_direct" = yes; then
+	      add="$libdir/$linklib"
+	    elif test "$hardcode_minus_L" = yes; then
+	      add_dir="-L$libdir"
+	      add="-l$name"
+	    elif test "$hardcode_shlibpath_var" = yes; then
+	      case :$finalize_shlibpath: in
+	      *":$libdir:"*) ;;
+	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+	      esac
+	      add="-l$name"
+	    elif test "$hardcode_automatic" = yes; then
+	      if test -n "$inst_prefix_dir" &&
+		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
+	        add="$inst_prefix_dir$libdir/$linklib"
+	      else
+	        add="$libdir/$linklib"
+	      fi
+	    else
+	      # We cannot seem to hardcode it, guess we'll fake it.
+	      add_dir="-L$libdir"
+	      # Try looking first in the location we're being installed to.
+	      if test -n "$inst_prefix_dir"; then
+		case $libdir in
+		  [\\/]*)
+		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		    ;;
+		esac
+	      fi
+	      add="-l$name"
+	    fi
+
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	    fi
+	  fi
+	elif test "$linkmode" = prog; then
+	  # Here we assume that one of hardcode_direct or hardcode_minus_L
+	  # is not unsupported.  This is valid on all known static and
+	  # shared platforms.
+	  if test "$hardcode_direct" != unsupported; then
+	    test -n "$old_library" && linklib="$old_library"
+	    compile_deplibs="$dir/$linklib $compile_deplibs"
+	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
+	  else
+	    compile_deplibs="-l$name -L$dir $compile_deplibs"
+	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+	  fi
+	elif test "$build_libtool_libs" = yes; then
+	  # Not a shared library
+	  if test "$deplibs_check_method" != pass_all; then
+	    # We're trying link a shared library against a static one
+	    # but the system doesn't support it.
+
+	    # Just print a warning and add the library to dependency_libs so
+	    # that the program can be linked against the static library.
+	    $echo
+	    $echo "*** Warning: This system can not link to static lib archive $lib."
+	    $echo "*** I have the capability to make that library automatically link in when"
+	    $echo "*** you link to this library.  But I can only do this if you have a"
+	    $echo "*** shared version of the library, which you do not appear to have."
+	    if test "$module" = yes; then
+	      $echo "*** But as you try to build a module library, libtool will still create "
+	      $echo "*** a static module, that should work as long as the dlopening application"
+	      $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      if test -z "$global_symbol_pipe"; then
+		$echo
+		$echo "*** However, this would only work if libtool was able to extract symbol"
+		$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		$echo "*** not find such a program.  So, this module is probably useless."
+		$echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      fi
+	      if test "$build_old_libs" = no; then
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  else
+	    deplibs="$dir/$old_library $deplibs"
+	    link_static=yes
+	  fi
+	fi # link shared/static library?
+
+	if test "$linkmode" = lib; then
+	  if test -n "$dependency_libs" &&
+	     { test "$hardcode_into_libs" != yes ||
+	       test "$build_old_libs" = yes ||
+	       test "$link_static" = yes; }; then
+	    # Extract -R from dependency_libs
+	    temp_deplibs=
+	    for libdir in $dependency_libs; do
+	      case $libdir in
+	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
+		   case " $xrpath " in
+		   *" $temp_xrpath "*) ;;
+		   *) xrpath="$xrpath $temp_xrpath";;
+		   esac;;
+	      *) temp_deplibs="$temp_deplibs $libdir";;
+	      esac
+	    done
+	    dependency_libs="$temp_deplibs"
+	  fi
+
+	  newlib_search_path="$newlib_search_path $absdir"
+	  # Link against this library
+	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  # ... and its dependency_libs
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    newdependency_libs="$deplib $newdependency_libs"
+	    if test "X$duplicate_deps" = "Xyes" ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done
+
+	  if test "$link_all_deplibs" != no; then
+	    # Add the search paths of all dependency libraries
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      -L*) path="$deplib" ;;
+	      *.la)
+		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
+		test "X$dir" = "X$deplib" && dir="."
+		# We need an absolute path.
+		case $dir in
+		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		*)
+		  absdir=`cd "$dir" && pwd`
+		  if test -z "$absdir"; then
+		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+		    absdir="$dir"
+		  fi
+		  ;;
+		esac
+		if grep "^installed=no" $deplib > /dev/null; then
+		  path="$absdir/$objdir"
+		else
+		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  if test -z "$libdir"; then
+		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+		    exit $EXIT_FAILURE
+		  fi
+		  if test "$absdir" != "$libdir"; then
+		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
+		  fi
+		  path="$absdir"
+		fi
+		depdepl=
+		case $host in
+		*-*-darwin*)
+		  # we do not want to link against static libs,
+		  # but need to link against shared
+		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names" ; then
+		    for tmp in $deplibrary_names ; do
+		      depdepl=$tmp
+		    done
+		    if test -f "$path/$depdepl" ; then
+		      depdepl="$path/$depdepl"
+		    fi
+		    # do not add paths which are already there
+		    case " $newlib_search_path " in
+		    *" $path "*) ;;
+		    *) newlib_search_path="$newlib_search_path $path";;
+		    esac
+		  fi
+		  path=""
+		  ;;
+		*)
+		  path="-L$path"
+		  ;;
+		esac
+		;;
+	      -l*)
+		case $host in
+		*-*-darwin*)
+		  # Again, we only want to link against shared libraries
+		  eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
+		  for tmp in $newlib_search_path ; do
+		    if test -f "$tmp/lib$tmp_libs.dylib" ; then
+		      eval depdepl="$tmp/lib$tmp_libs.dylib"
+		      break
+		    fi
+		  done
+		  path=""
+		  ;;
+		*) continue ;;
+		esac
+		;;
+	      *) continue ;;
+	      esac
+	      case " $deplibs " in
+	      *" $path "*) ;;
+	      *) deplibs="$path $deplibs" ;;
+	      esac
+	      case " $deplibs " in
+	      *" $depdepl "*) ;;
+	      *) deplibs="$depdepl $deplibs" ;;
+	      esac
+	    done
+	  fi # link_all_deplibs != no
+	fi # linkmode = lib
+      done # for deplib in $libs
+      dependency_libs="$newdependency_libs"
+      if test "$pass" = dlpreopen; then
+	# Link the dlpreopened libraries before other libraries
+	for deplib in $save_deplibs; do
+	  deplibs="$deplib $deplibs"
+	done
+      fi
+      if test "$pass" != dlopen; then
+	if test "$pass" != conv; then
+	  # Make sure lib_search_path contains only unique directories.
+	  lib_search_path=
+	  for dir in $newlib_search_path; do
+	    case "$lib_search_path " in
+	    *" $dir "*) ;;
+	    *) lib_search_path="$lib_search_path $dir" ;;
+	    esac
+	  done
+	  newlib_search_path=
+	fi
+
+	if test "$linkmode,$pass" != "prog,link"; then
+	  vars="deplibs"
+	else
+	  vars="compile_deplibs finalize_deplibs"
+	fi
+	for var in $vars dependency_libs; do
+	  # Add libraries to $var in reverse order
+	  eval tmp_libs=\"\$$var\"
+	  new_libs=
+	  for deplib in $tmp_libs; do
+	    # FIXME: Pedantically, this is the right thing to do, so
+	    #        that some nasty dependency loop isn't accidentally
+	    #        broken:
+	    #new_libs="$deplib $new_libs"
+	    # Pragmatically, this seems to cause very few problems in
+	    # practice:
+	    case $deplib in
+	    -L*) new_libs="$deplib $new_libs" ;;
+	    -R*) ;;
+	    *)
+	      # And here is the reason: when a library appears more
+	      # than once as an explicit dependence of a library, or
+	      # is implicitly linked in more than once by the
+	      # compiler, it is considered special, and multiple
+	      # occurrences thereof are not removed.  Compare this
+	      # with having the same library being listed as a
+	      # dependency of multiple other libraries: in this case,
+	      # we know (pedantically, we assume) the library does not
+	      # need to be listed more than once, so we keep only the
+	      # last copy.  This is not always right, but it is rare
+	      # enough that we require users that really mean to play
+	      # such unportable linking tricks to link the library
+	      # using -Wl,-lname, so that libtool does not consider it
+	      # for duplicate removal.
+	      case " $specialdeplibs " in
+	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
+	      *)
+		case " $new_libs " in
+		*" $deplib "*) ;;
+		*) new_libs="$deplib $new_libs" ;;
+		esac
+		;;
+	      esac
+	      ;;
+	    esac
+	  done
+	  tmp_libs=
+	  for deplib in $new_libs; do
+	    case $deplib in
+	    -L*)
+	      case " $tmp_libs " in
+	      *" $deplib "*) ;;
+	      *) tmp_libs="$tmp_libs $deplib" ;;
+	      esac
+	      ;;
+	    *) tmp_libs="$tmp_libs $deplib" ;;
+	    esac
+	  done
+	  eval $var=\"$tmp_libs\"
+	done # for var
+      fi
+      # Last step: remove runtime libs from dependency_libs
+      # (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs ; do
+	case " $predeps $postdeps $compiler_lib_search_path " in
+	*" $i "*)
+	  i=""
+	  ;;
+	esac
+	if test -n "$i" ; then
+	  tmp_libs="$tmp_libs $i"
+	fi
+      done
+      dependency_libs=$tmp_libs
+    done # for pass
+    if test "$linkmode" = prog; then
+      dlfiles="$newdlfiles"
+      dlprefiles="$newdlprefiles"
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$deplibs"; then
+	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
+      fi
+
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$rpath"; then
+	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$xrpath"; then
+	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
+      fi
+
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs="$output"
+      objs="$objs$old_deplibs"
+      ;;
+
+    lib)
+      # Make sure we only generate libraries of the form `libNAME.la'.
+      case $outputname in
+      lib*)
+	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+	eval shared_ext=\"$shrext_cmds\"
+	eval libname=\"$libname_spec\"
+	;;
+      *)
+	if test "$module" = no; then
+	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+	if test "$need_lib_prefix" != no; then
+	  # Add the "lib" prefix for modules if required
+	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	  eval shared_ext=\"$shrext_cmds\"
+	  eval libname=\"$libname_spec\"
+	else
+	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	fi
+	;;
+      esac
+
+      if test -n "$objs"; then
+	if test "$deplibs_check_method" != pass_all; then
+	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
+	  exit $EXIT_FAILURE
+	else
+	  $echo
+	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
+	  $echo "*** objects $objs is not portable!"
+	  libobjs="$libobjs $objs"
+	fi
+      fi
+
+      if test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
+      fi
+
+      set dummy $rpath
+      if test "$#" -gt 2; then
+	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+      fi
+      install_libdir="$2"
+
+      oldlibs=
+      if test -z "$rpath"; then
+	if test "$build_libtool_libs" = yes; then
+	  # Building a libtool convenience library.
+	  # Some compilers have problems with a `.al' extension so
+	  # convenience libraries should have the same extension an
+	  # archive normally would.
+	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
+	  build_libtool_libs=convenience
+	  build_old_libs=yes
+	fi
+
+	if test -n "$vinfo"; then
+	  $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
+	fi
+
+	if test -n "$release"; then
+	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
+	fi
+      else
+
+	# Parse the version information argument.
+	save_ifs="$IFS"; IFS=':'
+	set dummy $vinfo 0 0 0
+	IFS="$save_ifs"
+
+	if test -n "$8"; then
+	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# convert absolute version numbers to libtool ages
+	# this retains compatibility with .la files and attempts
+	# to make the code below a bit more comprehensible
+
+	case $vinfo_number in
+	yes)
+	  number_major="$2"
+	  number_minor="$3"
+	  number_revision="$4"
+	  #
+	  # There are really only two kinds -- those that
+	  # use the current revision as the major version
+	  # and those that subtract age and use age as
+	  # a minor version.  But, then there is irix
+	  # which has an extra 1 added just for fun
+	  #
+	  case $version_type in
+	  darwin|linux|osf|windows)
+	    current=`expr $number_major + $number_minor`
+	    age="$number_minor"
+	    revision="$number_revision"
+	    ;;
+	  freebsd-aout|freebsd-elf|sunos)
+	    current="$number_major"
+	    revision="$number_minor"
+	    age="0"
+	    ;;
+	  irix|nonstopux)
+	    current=`expr $number_major + $number_minor - 1`
+	    age="$number_minor"
+	    revision="$number_minor"
+	    ;;
+	  esac
+	  ;;
+	no)
+	  current="$2"
+	  revision="$3"
+	  age="$4"
+	  ;;
+	esac
+
+	# Check that each of the things are valid numbers.
+	case $current in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	case $revision in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	case $age in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	if test "$age" -gt "$current"; then
+	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# Calculate the version variables.
+	major=
+	versuffix=
+	verstring=
+	case $version_type in
+	none) ;;
+
+	darwin)
+	  # Like Linux, but with the current version available in
+	  # verstring for coding it into the library header
+	  major=.`expr $current - $age`
+	  versuffix="$major.$age.$revision"
+	  # Darwin ld doesn't like 0 for these options...
+	  minor_current=`expr $current + 1`
+	  verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+	  ;;
+
+	freebsd-aout)
+	  major=".$current"
+	  versuffix=".$current.$revision";
+	  ;;
+
+	freebsd-elf)
+	  major=".$current"
+	  versuffix=".$current";
+	  ;;
+
+	irix | nonstopux)
+	  major=`expr $current - $age + 1`
+
+	  case $version_type in
+	    nonstopux) verstring_prefix=nonstopux ;;
+	    *)         verstring_prefix=sgi ;;
+	  esac
+	  verstring="$verstring_prefix$major.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$revision
+	  while test "$loop" -ne 0; do
+	    iface=`expr $revision - $loop`
+	    loop=`expr $loop - 1`
+	    verstring="$verstring_prefix$major.$iface:$verstring"
+	  done
+
+	  # Before this point, $major must not contain `.'.
+	  major=.$major
+	  versuffix="$major.$revision"
+	  ;;
+
+	linux)
+	  major=.`expr $current - $age`
+	  versuffix="$major.$age.$revision"
+	  ;;
+
+	osf)
+	  major=.`expr $current - $age`
+	  versuffix=".$current.$age.$revision"
+	  verstring="$current.$age.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$age
+	  while test "$loop" -ne 0; do
+	    iface=`expr $current - $loop`
+	    loop=`expr $loop - 1`
+	    verstring="$verstring:${iface}.0"
+	  done
+
+	  # Make executables depend on our current version.
+	  verstring="$verstring:${current}.0"
+	  ;;
+
+	sunos)
+	  major=".$current"
+	  versuffix=".$current.$revision"
+	  ;;
+
+	windows)
+	  # Use '-' rather than '.', since we only want one
+	  # extension on DOS 8.3 filesystems.
+	  major=`expr $current - $age`
+	  versuffix="-$major"
+	  ;;
+
+	*)
+	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
+	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	# Clear the version info if we defaulted, and they specified a release.
+	if test -z "$vinfo" && test -n "$release"; then
+	  major=
+	  case $version_type in
+	  darwin)
+	    # we can't check for "0.0" in archive_cmds due to quoting
+	    # problems, so we reset it completely
+	    verstring=
+	    ;;
+	  *)
+	    verstring="0.0"
+	    ;;
+	  esac
+	  if test "$need_version" = no; then
+	    versuffix=
+	  else
+	    versuffix=".0.0"
+	  fi
+	fi
+
+	# Remove version info from name if versioning should be avoided
+	if test "$avoid_version" = yes && test "$need_version" = no; then
+	  major=
+	  versuffix=
+	  verstring=""
+	fi
+
+	# Check to see if the archive will have undefined symbols.
+	if test "$allow_undefined" = yes; then
+	  if test "$allow_undefined_flag" = unsupported; then
+	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+	    build_libtool_libs=no
+	    build_old_libs=yes
+	  fi
+	else
+	  # Don't allow undefined symbols.
+	  allow_undefined_flag="$no_undefined_flag"
+	fi
+      fi
+
+      if test "$mode" != relink; then
+	# Remove our outputs, but don't remove object files since they
+	# may have been created when compiling PIC objects.
+	removelist=
+	tempremovelist=`$echo "$output_objdir/*"`
+	for p in $tempremovelist; do
+	  case $p in
+	    *.$objext)
+	       ;;
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+	       if test "X$precious_files_regex" != "X"; then
+	         if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+	         then
+		   continue
+		 fi
+	       fi
+	       removelist="$removelist $p"
+	       ;;
+	    *) ;;
+	  esac
+	done
+	if test -n "$removelist"; then
+	  $show "${rm}r $removelist"
+	  $run ${rm}r $removelist
+	fi
+      fi
+
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+	oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+	# Transform .lo files to .o files.
+	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+      for path in $notinst_path; do
+	lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
+	deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
+	dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
+      done
+
+      if test -n "$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	temp_xrpath=
+	for libdir in $xrpath; do
+	  temp_xrpath="$temp_xrpath -R$libdir"
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+	  dependency_libs="$temp_xrpath $dependency_libs"
+	fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles="$dlfiles"
+      dlfiles=
+      for lib in $old_dlfiles; do
+	case " $dlprefiles $dlfiles " in
+	*" $lib "*) ;;
+	*) dlfiles="$dlfiles $lib" ;;
+	esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles="$dlprefiles"
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+	case "$dlprefiles " in
+	*" $lib "*) ;;
+	*) dlprefiles="$dlprefiles $lib" ;;
+	esac
+      done
+
+      if test "$build_libtool_libs" = yes; then
+	if test -n "$rpath"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
+	    # these systems don't actually have a c library (as such)!
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C library is in the System framework
+	    deplibs="$deplibs -framework System"
+	    ;;
+	  *-*-netbsd*)
+	    # Don't link with libc until the a.out ld.so is fixed.
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+ 	  *)
+	    # Add libc to deplibs on all other systems if necessary.
+	    if test "$build_libtool_need_lc" = "yes"; then
+	      deplibs="$deplibs -lc"
+	    fi
+	    ;;
+	  esac
+	fi
+
+	# Transform deplibs into only deplibs that can be linked in shared.
+	name_save=$name
+	libname_save=$libname
+	release_save=$release
+	versuffix_save=$versuffix
+	major_save=$major
+	# I'm not sure if I'm treating the release correctly.  I think
+	# release should show up in the -l (ie -lgmp5) so we don't want to
+	# add it in twice.  Is that correct?
+	release=""
+	versuffix=""
+	major=""
+	newdeplibs=
+	droppeddeps=no
+	case $deplibs_check_method in
+	pass_all)
+	  # Don't check for shared/static.  Everything works.
+	  # This might be a little naive.  We might want to check
+	  # whether the library exists or not.  But this is on
+	  # osf3 & osf4 and I'm not really sure... Just
+	  # implementing what was already the behavior.
+	  newdeplibs=$deplibs
+	  ;;
+	test_compile)
+	  # This code stresses the "libraries are programs" paradigm to its
+	  # limits. Maybe even breaks it.  We compile a program, linking it
+	  # against the deplibs as a proxy for the library.  Then we can check
+	  # whether they linked in statically or dynamically with ldd.
+	  $rm conftest.c
+	  cat > conftest.c <<EOF
+	  int main() { return 0; }
+EOF
+	  $rm conftest
+	  $LTCC -o conftest conftest.c $deplibs
+	  if test "$?" -eq 0 ; then
+	    ldd_output=`ldd conftest`
+	    for i in $deplibs; do
+	      name=`expr $i : '-l\(.*\)'`
+	      # If $name is empty we are operating on a -L argument.
+              if test "$name" != "" && test "$name" -ne "0"; then
+		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		  case " $predeps $postdeps " in
+		  *" $i "*)
+		    newdeplibs="$newdeplibs $i"
+		    i=""
+		    ;;
+		  esac
+	        fi
+		if test -n "$i" ; then
+		  libname=`eval \\$echo \"$libname_spec\"`
+		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
+		  set dummy $deplib_matches
+		  deplib_match=$2
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    newdeplibs="$newdeplibs $i"
+		  else
+		    droppeddeps=yes
+		    $echo
+		    $echo "*** Warning: dynamic linker does not accept needed library $i."
+		    $echo "*** I have the capability to make that library automatically link in when"
+		    $echo "*** you link to this library.  But I can only do this if you have a"
+		    $echo "*** shared version of the library, which I believe you do not have"
+		    $echo "*** because a test_compile did reveal that the linker did not use it for"
+		    $echo "*** its dynamic dependency list that programs get resolved with at runtime."
+		  fi
+		fi
+	      else
+		newdeplibs="$newdeplibs $i"
+	      fi
+	    done
+	  else
+	    # Error occurred in the first compile.  Let's try to salvage
+	    # the situation: Compile a separate program for each library.
+	    for i in $deplibs; do
+	      name=`expr $i : '-l\(.*\)'`
+	      # If $name is empty we are operating on a -L argument.
+              if test "$name" != "" && test "$name" != "0"; then
+		$rm conftest
+		$LTCC -o conftest conftest.c $i
+		# Did it work?
+		if test "$?" -eq 0 ; then
+		  ldd_output=`ldd conftest`
+		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		    case " $predeps $postdeps " in
+		    *" $i "*)
+		      newdeplibs="$newdeplibs $i"
+		      i=""
+		      ;;
+		    esac
+		  fi
+		  if test -n "$i" ; then
+		    libname=`eval \\$echo \"$libname_spec\"`
+		    deplib_matches=`eval \\$echo \"$library_names_spec\"`
+		    set dummy $deplib_matches
+		    deplib_match=$2
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		      newdeplibs="$newdeplibs $i"
+		    else
+		      droppeddeps=yes
+		      $echo
+		      $echo "*** Warning: dynamic linker does not accept needed library $i."
+		      $echo "*** I have the capability to make that library automatically link in when"
+		      $echo "*** you link to this library.  But I can only do this if you have a"
+		      $echo "*** shared version of the library, which you do not appear to have"
+		      $echo "*** because a test_compile did reveal that the linker did not use this one"
+		      $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+		    fi
+		  fi
+		else
+		  droppeddeps=yes
+		  $echo
+		  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
+		  $echo "***  make it link in!  You will probably need to install it or some"
+		  $echo "*** library that it depends on before this library will be fully"
+		  $echo "*** functional.  Installing it before continuing would be even better."
+		fi
+	      else
+		newdeplibs="$newdeplibs $i"
+	      fi
+	    done
+	  fi
+	  ;;
+	file_magic*)
+	  set dummy $deplibs_check_method
+	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    name=`expr $a_deplib : '-l\(.*\)'`
+	    # If $name is empty we are operating on a -L argument.
+            if test "$name" != "" && test  "$name" != "0"; then
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval \\$echo \"$libname_spec\"`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		      # Follow soft links.
+		      if ls -lLd "$potent_lib" 2>/dev/null \
+			 | grep " -> " >/dev/null; then
+			continue
+		      fi
+		      # The statement above tries to avoid entering an
+		      # endless loop below, in case of cyclic links.
+		      # We might still enter an endless loop, since a link
+		      # loop can be closed while we follow links,
+		      # but so what?
+		      potlib="$potent_lib"
+		      while test -h "$potlib" 2>/dev/null; do
+			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			case $potliblink in
+			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+			esac
+		      done
+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+			 | ${SED} 10q \
+			 | $EGREP "$file_magic_regex" > /dev/null; then
+			newdeplibs="$newdeplibs $a_deplib"
+			a_deplib=""
+			break 2
+		      fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		$echo
+		$echo "*** Warning: linker path does not have real file for library $a_deplib."
+		$echo "*** I have the capability to make that library automatically link in when"
+		$echo "*** you link to this library.  But I can only do this if you have a"
+		$echo "*** shared version of the library, which you do not appear to have"
+		$echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $echo "*** with $libname but no candidates were found. (...for file magic test)"
+		else
+		  $echo "*** with $libname and none of the candidates passed a file format test"
+		  $echo "*** using a file magic. Last file checked: $potlib"
+		fi
+	      fi
+	    else
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	    fi
+	  done # Gone through all deplibs.
+	  ;;
+	match_pattern*)
+	  set dummy $deplibs_check_method
+	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    name=`expr $a_deplib : '-l\(.*\)'`
+	    # If $name is empty we are operating on a -L argument.
+	    if test -n "$name" && test "$name" != "0"; then
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval \\$echo \"$libname_spec\"`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		    potlib="$potent_lib" # see symlink-check above in file_magic test
+		    if eval $echo \"$potent_lib\" 2>/dev/null \
+		        | ${SED} 10q \
+		        | $EGREP "$match_pattern_regex" > /dev/null; then
+		      newdeplibs="$newdeplibs $a_deplib"
+		      a_deplib=""
+		      break 2
+		    fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		$echo
+		$echo "*** Warning: linker path does not have real file for library $a_deplib."
+		$echo "*** I have the capability to make that library automatically link in when"
+		$echo "*** you link to this library.  But I can only do this if you have a"
+		$echo "*** shared version of the library, which you do not appear to have"
+		$echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
+		else
+		  $echo "*** with $libname and none of the candidates passed a file format test"
+		  $echo "*** using a regex pattern. Last file checked: $potlib"
+		fi
+	      fi
+	    else
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	    fi
+	  done # Gone through all deplibs.
+	  ;;
+	none | unknown | *)
+	  newdeplibs=""
+	  tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+	    -e 's/ -[LR][^ ]*//g'`
+	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    for i in $predeps $postdeps ; do
+	      # can't use Xsed below, because $i might contain '/'
+	      tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
+	    done
+	  fi
+	  if $echo "X $tmp_deplibs" | $Xsed -e 's/[ 	]//g' \
+	    | grep . >/dev/null; then
+	    $echo
+	    if test "X$deplibs_check_method" = "Xnone"; then
+	      $echo "*** Warning: inter-library dependencies are not supported in this platform."
+	    else
+	      $echo "*** Warning: inter-library dependencies are not known to be supported."
+	    fi
+	    $echo "*** All declared inter-library dependencies are being dropped."
+	    droppeddeps=yes
+	  fi
+	  ;;
+	esac
+	versuffix=$versuffix_save
+	major=$major_save
+	release=$release_save
+	libname=$libname_save
+	name=$name_save
+
+	case $host in
+	*-*-rhapsody* | *-*-darwin1.[012])
+	  # On Rhapsody replace the C library is the System framework
+	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	  ;;
+	esac
+
+	if test "$droppeddeps" = yes; then
+	  if test "$module" = yes; then
+	    $echo
+	    $echo "*** Warning: libtool could not satisfy all declared inter-library"
+	    $echo "*** dependencies of module $libname.  Therefore, libtool will create"
+	    $echo "*** a static module, that should work as long as the dlopening"
+	    $echo "*** application is linked with the -dlopen flag."
+	    if test -z "$global_symbol_pipe"; then
+	      $echo
+	      $echo "*** However, this would only work if libtool was able to extract symbol"
+	      $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      $echo "*** not find such a program.  So, this module is probably useless."
+	      $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	    fi
+	    if test "$build_old_libs" = no; then
+	      oldlibs="$output_objdir/$libname.$libext"
+	      build_libtool_libs=module
+	      build_old_libs=yes
+	    else
+	      build_libtool_libs=no
+	    fi
+	  else
+	    $echo "*** The inter-library dependencies that have been dropped here will be"
+	    $echo "*** automatically added whenever a program is linked with this library"
+	    $echo "*** or is declared to -dlopen it."
+
+	    if test "$allow_undefined" = no; then
+	      $echo
+	      $echo "*** Since this library must not contain undefined symbols,"
+	      $echo "*** because either the platform does not support them or"
+	      $echo "*** it was explicitly requested with -no-undefined,"
+	      $echo "*** libtool will only create a static version of it."
+	      if test "$build_old_libs" = no; then
+		oldlibs="$output_objdir/$libname.$libext"
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  fi
+	fi
+	# Done checking deplibs!
+	deplibs=$newdeplibs
+      fi
+
+      # 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
+	realname="$2"
+	shift; shift
+
+	if test -n "$soname_spec"; then
+	  eval soname=\"$soname_spec\"
+	else
+	  soname="$realname"
+	fi
+	if test -z "$dlname"; then
+	  dlname=$soname
+	fi
+
+	lib="$output_objdir/$realname"
+	for link
+	do
+	  linknames="$linknames $link"
+	done
+
+	# Use standard objects if they are pic
+	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+
+	# Prepare the list of exported symbols
+	if test -z "$export_symbols"; then
+	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+	    $show "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $run $rm $export_symbols
+	    cmds=$export_symbols_cmds
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd in $cmds; do
+	      IFS="$save_ifs"
+	      eval cmd=\"$cmd\"
+	      if len=`expr "X$cmd" : ".*"` &&
+	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	        $show "$cmd"
+	        $run eval "$cmd" || exit $?
+	        skipped_export=false
+	      else
+	        # The command line is too long to execute in one step.
+	        $show "using reloadable object file for export list..."
+	        skipped_export=:
+		# Break out early, otherwise skipped_export may be
+		# set to false by a later but shorter cmd.
+		break
+	      fi
+	    done
+	    IFS="$save_ifs"
+	    if test -n "$export_symbols_regex"; then
+	      $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+	      $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+	fi
+
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+	fi
+
+	tmp_deplibs=
+	for test_deplib in $deplibs; do
+		case " $convenience " in
+		*" $test_deplib "*) ;;
+		*)
+			tmp_deplibs="$tmp_deplibs $test_deplib"
+			;;
+		esac
+	done
+	deplibs="$tmp_deplibs"
+
+	if test -n "$convenience"; then
+	  if test -n "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	  else
+	    gentop="$output_objdir/${outputname}x"
+	    generated="$generated $gentop"
+
+	    func_extract_archives $gentop $convenience
+	    libobjs="$libobjs $func_extract_archives_result"
+	  fi
+	fi
+	
+	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	  eval flag=\"$thread_safe_flag_spec\"
+	  linker_flags="$linker_flags $flag"
+	fi
+
+	# Make a backup of the uninstalled library when relinking
+	if test "$mode" = relink; then
+	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+	fi
+
+	# Do each of the archive commands.
+	if test "$module" = yes && test -n "$module_cmds" ; then
+	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	    eval test_cmds=\"$module_expsym_cmds\"
+	    cmds=$module_expsym_cmds
+	  else
+	    eval test_cmds=\"$module_cmds\"
+	    cmds=$module_cmds
+	  fi
+	else
+	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	  eval test_cmds=\"$archive_expsym_cmds\"
+	  cmds=$archive_expsym_cmds
+	else
+	  eval test_cmds=\"$archive_cmds\"
+	  cmds=$archive_cmds
+	  fi
+	fi
+
+	if test "X$skipped_export" != "X:" &&
+	   len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  :
+	else
+	  # The command line is too long to link in one step, link piecewise.
+	  $echo "creating reloadable object files..."
+
+	  # Save the value of $output and $libobjs because we want to
+	  # use them later.  If we have whole_archive_flag_spec, we
+	  # want to use save_libobjs as it was before
+	  # whole_archive_flag_spec was expanded, because we can't
+	  # assume the linker understands whole_archive_flag_spec.
+	  # This may have to be revisited, in case too many
+	  # convenience libraries get linked in and end up exceeding
+	  # the spec.
+	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	  fi
+	  save_output=$output
+	  output_la=`$echo "X$output" | $Xsed -e "$basename"`
+
+	  # Clear the reloadable object creation command queue and
+	  # initialize k to one.
+	  test_cmds=
+	  concat_cmds=
+	  objlist=
+	  delfiles=
+	  last_robj=
+	  k=1
+	  output=$output_objdir/$output_la-${k}.$objext
+	  # Loop over the list of objects to be linked.
+	  for obj in $save_libobjs
+	  do
+	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
+	    if test "X$objlist" = X ||
+	       { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+		 test "$len" -le "$max_cmd_len"; }; then
+	      objlist="$objlist $obj"
+	    else
+	      # The command $test_cmds is almost too long, add a
+	      # command to the queue.
+	      if test "$k" -eq 1 ; then
+		# The first file doesn't have a previous command to add.
+		eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+	      else
+		# All subsequent reloadable object files will link in
+		# the last one created.
+		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+	      fi
+	      last_robj=$output_objdir/$output_la-${k}.$objext
+	      k=`expr $k + 1`
+	      output=$output_objdir/$output_la-${k}.$objext
+	      objlist=$obj
+	      len=1
+	    fi
+	  done
+	  # Handle the remaining objects by creating one last
+	  # reloadable object file.  All subsequent reloadable object
+	  # files will link in the last one created.
+	  test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	  eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+
+	  if ${skipped_export-false}; then
+	    $show "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $run $rm $export_symbols
+	    libobjs=$output
+	    # Append the command to create the export file.
+	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
+          fi
+
+	  # Set up a command to remove the reloadable object files
+	  # after they are used.
+	  i=0
+	  while test "$i" -lt "$k"
+	  do
+	    i=`expr $i + 1`
+	    delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
+	  done
+
+	  $echo "creating a temporary reloadable object file: $output"
+
+	  # Loop through the commands generated above and execute them.
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $concat_cmds; do
+	    IFS="$save_ifs"
+	    $show "$cmd"
+	    $run eval "$cmd" || exit $?
+	  done
+	  IFS="$save_ifs"
+
+	  libobjs=$output
+	  # Restore the value of output.
+	  output=$save_output
+
+	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	  fi
+	  # Expand the library linking commands again to reset the
+	  # value of $libobjs for piecewise linking.
+
+	  # Do each of the archive commands.
+	  if test "$module" = yes && test -n "$module_cmds" ; then
+	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	      cmds=$module_expsym_cmds
+	    else
+	      cmds=$module_cmds
+	    fi
+	  else
+	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	    cmds=$archive_expsym_cmds
+	  else
+	    cmds=$archive_cmds
+	    fi
+	  fi
+
+	  # Append the command to remove the reloadable object files
+	  # to the just-reset $cmds.
+	  eval cmds=\"\$cmds~\$rm $delfiles\"
+	fi
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  eval cmd=\"$cmd\"
+	  $show "$cmd"
+	  $run eval "$cmd" || {
+	    lt_exit=$?
+
+	    # Restore the uninstalled library and exit
+	    if test "$mode" = relink; then
+	      $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+	    fi
+
+	    exit $lt_exit
+	  }
+	done
+	IFS="$save_ifs"
+
+	# Restore the uninstalled library and exit
+	if test "$mode" = relink; then
+	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+
+	  if test -n "$convenience"; then
+	    if test -z "$whole_archive_flag_spec"; then
+	      $show "${rm}r $gentop"
+	      $run ${rm}r "$gentop"
+	    fi
+	  fi
+
+	  exit $EXIT_SUCCESS
+	fi
+
+	# Create links to the real library.
+	for linkname in $linknames; do
+	  if test "$realname" != "$linkname"; then
+	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
+	    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+	  fi
+	done
+
+	# If -module or -export-dynamic was specified, set the dlname.
+	if test "$module" = yes || test "$export_dynamic" = yes; then
+	  # On all known operating systems, these are identical.
+	  dlname="$soname"
+	fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$deplibs"; then
+	$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
+      fi
+
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$rpath"; then
+	$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$xrpath"; then
+	$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
+      fi
+
+      case $output in
+      *.lo)
+	if test -n "$objs$old_deplibs"; then
+	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+	libobj="$output"
+	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+	;;
+      *)
+	libobj=
+	obj="$output"
+	;;
+      esac
+
+      # Delete the old objects.
+      $run $rm $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec
+      wl=
+
+      if test -n "$convenience"; then
+	if test -n "$whole_archive_flag_spec"; then
+	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+	else
+	  gentop="$output_objdir/${obj}x"
+	  generated="$generated $gentop"
+
+	  func_extract_archives $gentop $convenience
+	  reload_conv_objs="$reload_objs $func_extract_archives_result"
+	fi
+      fi
+
+      # Create the old-style object.
+      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+      output="$obj"
+      cmds=$reload_cmds
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	eval cmd=\"$cmd\"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+	if test -n "$gentop"; then
+	  $show "${rm}r $gentop"
+	  $run ${rm}r $gentop
+	fi
+
+	exit $EXIT_SUCCESS
+      fi
+
+      if test "$build_libtool_libs" != yes; then
+	if test -n "$gentop"; then
+	  $show "${rm}r $gentop"
+	  $run ${rm}r $gentop
+	fi
+
+	# Create an invalid libtool object if no PIC, so that we don't
+	# accidentally link it into a program.
+	# $show "echo timestamp > $libobj"
+	# $run eval "echo timestamp > $libobj" || exit $?
+	exit $EXIT_SUCCESS
+      fi
+
+      if test -n "$pic_flag" || test "$pic_mode" != default; then
+	# Only do commands if we really have different PIC objects.
+	reload_objs="$libobjs $reload_conv_objs"
+	output="$libobj"
+	cmds=$reload_cmds
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  eval cmd=\"$cmd\"
+	  $show "$cmd"
+	  $run eval "$cmd" || exit $?
+	done
+	IFS="$save_ifs"
+      fi
+
+      if test -n "$gentop"; then
+	$show "${rm}r $gentop"
+	$run ${rm}r $gentop
+      fi
+
+      exit $EXIT_SUCCESS
+      ;;
+
+    prog)
+      case $host in
+	*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
+      esac
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
+      fi
+
+      if test "$preload" = yes; then
+	if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
+	   test "$dlopen_self_static" = unknown; then
+	  $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+	fi
+      fi
+
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+	# On Rhapsody replace the C library is the System framework
+	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	;;
+      esac
+
+      case $host in
+      *darwin*)
+        # Don't allow lazy linking, it breaks C++ global constructors
+        if test "$tagname" = CXX ; then
+        compile_command="$compile_command ${wl}-bind_at_load"
+        finalize_command="$finalize_command ${wl}-bind_at_load"
+        fi
+        ;;
+      esac
+
+      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*)
+	  case :$dllsearchpath: in
+	  *":$libdir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$libdir";;
+	  esac
+	  ;;
+	esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath="$rpath"
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$finalize_perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+	  esac
+	fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath="$rpath"
+
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+	# Transform all the library objects into standard objects.
+	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+      fi
+
+      dlsyms=
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	if test -n "$NM" && test -n "$global_symbol_pipe"; then
+	  dlsyms="${outputname}S.c"
+	else
+	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+	fi
+      fi
+
+      if test -n "$dlsyms"; then
+	case $dlsyms in
+	"") ;;
+	*.c)
+	  # Discover the nlist of each of the dlfiles.
+	  nlist="$output_objdir/${outputname}.nm"
+
+	  $show "$rm $nlist ${nlist}S ${nlist}T"
+	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
+
+	  # Parse the name list into a source file.
+	  $show "creating $output_objdir/$dlsyms"
+
+	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define lt_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+	  if test "$dlself" = yes; then
+	    $show "generating symbol list for \`$output'"
+
+	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+	    # Add our own program objects to the symbol list.
+	    progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	    for arg in $progfiles; do
+	      $show "extracting global C symbols from \`$arg'"
+	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+	    done
+
+	    if test -n "$exclude_expsyms"; then
+	      $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+	      $run eval '$mv "$nlist"T "$nlist"'
+	    fi
+
+	    if test -n "$export_symbols_regex"; then
+	      $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+	      $run eval '$mv "$nlist"T "$nlist"'
+	    fi
+
+	    # Prepare the list of exported symbols
+	    if test -z "$export_symbols"; then
+	      export_symbols="$output_objdir/$outputname.exp"
+	      $run $rm $export_symbols
+	      $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	    else
+	      $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+	      $run eval 'mv "$nlist"T "$nlist"'
+	    fi
+	  fi
+
+	  for arg in $dlprefiles; do
+	    $show "extracting global C symbols from \`$arg'"
+	    name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
+	    $run eval '$echo ": $name " >> "$nlist"'
+	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+	  done
+
+	  if test -z "$run"; then
+	    # Make sure we have at least an empty file.
+	    test -f "$nlist" || : > "$nlist"
+
+	    if test -n "$exclude_expsyms"; then
+	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+	      $mv "$nlist"T "$nlist"
+	    fi
+
+	    # Try sorting and uniquifying the output.
+	    if grep -v "^: " < "$nlist" |
+		if sort -k 3 </dev/null >/dev/null 2>&1; then
+		  sort -k 3
+		else
+		  sort +2
+		fi |
+		uniq > "$nlist"S; then
+	      :
+	    else
+	      grep -v "^: " < "$nlist" > "$nlist"S
+	    fi
+
+	    if test -f "$nlist"S; then
+	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
+	    else
+	      $echo '/* NONE */' >> "$output_objdir/$dlsyms"
+	    fi
+
+	    $echo >> "$output_objdir/$dlsyms" "\
+
+#undef lt_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+"
+
+	    case $host in
+	    *cygwin* | *mingw* )
+	  $echo >> "$output_objdir/$dlsyms" "\
+/* DATA imports from DLLs on WIN32 can't be const, because
+   runtime relocations are performed -- see ld's documentation
+   on pseudo-relocs */
+struct {
+"
+	      ;;
+	    * )
+	  $echo >> "$output_objdir/$dlsyms" "\
+const struct {
+"
+	      ;;
+	    esac
+
+
+	  $echo >> "$output_objdir/$dlsyms" "\
+  const char *name;
+  lt_ptr address;
+}
+lt_preloaded_symbols[] =
+{\
+"
+
+	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
+
+	    $echo >> "$output_objdir/$dlsyms" "\
+  {0, (lt_ptr) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+	  fi
+
+	  pic_flag_for_symtable=
+	  case $host in
+	  # compiling the symbol table file with pic_flag works around
+	  # a FreeBSD bug that causes programs to crash when -lm is
+	  # linked before any other PIC object.  But we must not use
+	  # pic_flag when linking with -static.  The problem exists in
+	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	    case "$compile_command " in
+	    *" -static "*) ;;
+	    *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
+	    esac;;
+	  *-*-hpux*)
+	    case "$compile_command " in
+	    *" -static "*) ;;
+	    *) pic_flag_for_symtable=" $pic_flag";;
+	    esac
+	  esac
+
+	  # Now compile the dynamic symbol file.
+	  $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+	  $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+	  # Clean up the generated files.
+	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+
+	  # Transform the symbol file into the correct name.
+	  compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+	  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+	  ;;
+	*)
+	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+      else
+	# We keep going just in case the user didn't refer to
+	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+	# really was required.
+
+	# Nullify the symbol file.
+	compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+	finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+      fi
+
+      if test "$need_relink" = no || test "$build_libtool_libs" != yes; 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.
+	$show "$link_command"
+	$run eval "$link_command"
+	status=$?
+
+	# Delete the generated files.
+	if test -n "$dlsyms"; then
+	  $show "$rm $output_objdir/${outputname}S.${objext}"
+	  $run $rm "$output_objdir/${outputname}S.${objext}"
+	fi
+
+	exit $status
+      fi
+
+      if test -n "$shlibpath_var"; then
+	# We should set the shlibpath_var
+	rpath=
+	for dir in $temp_rpath; do
+	  case $dir in
+	  [\\/]* | [A-Za-z]:[\\/]*)
+	    # Absolute path.
+	    rpath="$rpath$dir:"
+	    ;;
+	  *)
+	    # Relative path: add a thisdir entry.
+	    rpath="$rpath\$thisdir/$dir:"
+	    ;;
+	  esac
+	done
+	temp_rpath="$rpath"
+      fi
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+	if test -n "$perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+	if test -n "$finalize_perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $finalize_perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+      fi
+
+      if test "$no_install" = yes; then
+	# We don't need to create a wrapper script.
+	link_command="$compile_var$compile_command$compile_rpath"
+	# Replace the output file specification.
+	link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	# Delete the old output file.
+	$run $rm $output
+	# Link the executable and exit
+	$show "$link_command"
+	$run eval "$link_command" || exit $?
+	exit $EXIT_SUCCESS
+      fi
+
+      if test "$hardcode_action" = relink; then
+	# Fast installation is not supported
+	link_command="$compile_var$compile_command$compile_rpath"
+	relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+	$echo "$modename: \`$output' will be relinked during installation" 1>&2
+      else
+	if test "$fast_install" != no; then
+	  link_command="$finalize_var$compile_command$finalize_rpath"
+	  if test "$fast_install" = yes; then
+	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $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.
+      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      $show "$link_command"
+      $run eval "$link_command" || exit $?
+
+      # Now create the wrapper script.
+      $show "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+	# Preserve any variables that may affect compiler behavior
+	for var in $variables_saved_for_relink; do
+	  if eval test -z \"\${$var+set}\"; then
+	    relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	  elif eval var_value=\$$var; test -z "$var_value"; then
+	    relink_command="$var=; export $var; $relink_command"
+	  else
+	    var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+	    relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	  fi
+	done
+	relink_command="(cd `pwd`; $relink_command)"
+	relink_command=`$echo "X$relink_command" | $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 our run command is non-null.
+      if test -z "$run"; then
+	# win32 will think the script is a binary if it has
+	# a .exe suffix, so we strip it off here.
+	case $output in
+	  *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
+	esac
+	# test for cygwin because mv fails w/o .exe extensions
+	case $host in
+	  *cygwin*)
+	    exeext=.exe
+	    outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
+	  *) exeext= ;;
+	esac
+	case $host in
+	  *cygwin* | *mingw* )
+	    cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
+	    cwrapper=`$echo ${output}.exe`
+	    $rm $cwrappersource $cwrapper
+	    trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+	    cat > $cwrappersource <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+
+   Currently, it simply execs the wrapper *script* "/bin/sh $output",
+   but could eventually absorb all of the scripts functionality and
+   exec $objdir/$outputname directly.
+*/
+EOF
+	    cat >> $cwrappersource<<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef DIR_SEPARATOR
+#define DIR_SEPARATOR '/'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+#define HAVE_DOS_BASED_FILE_SYSTEM
+#ifndef DIR_SEPARATOR_2
+#define DIR_SEPARATOR_2 '\\'
+#endif
+#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 */
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+const char *program_name = NULL;
+
+void * xmalloc (size_t num);
+char * xstrdup (const char *string);
+char * basename (const char *name);
+char * fnqualify(const char *path);
+char * strendzap(char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int i;
+
+  program_name = (char *) xstrdup ((char *) basename (argv[0]));
+  newargz = XMALLOC(char *, argc+2);
+EOF
+
+	    cat >> $cwrappersource <<EOF
+  newargz[0] = "$SHELL";
+EOF
+
+	    cat >> $cwrappersource <<"EOF"
+  newargz[1] = fnqualify(argv[0]);
+  /* we know the script has the same name, without the .exe */
+  /* so make sure newargz[1] doesn't end in .exe */
+  strendzap(newargz[1],".exe");
+  for (i = 1; i < argc; i++)
+    newargz[i+1] = xstrdup(argv[i]);
+  newargz[argc+1] = NULL;
+EOF
+
+	    cat >> $cwrappersource <<EOF
+  execv("$SHELL",newargz);
+EOF
+
+	    cat >> $cwrappersource <<"EOF"
+  return 127;
+}
+
+void *
+xmalloc (size_t num)
+{
+  void * p = (void *) malloc (num);
+  if (!p)
+    lt_fatal ("Memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
+;
+}
+
+char *
+basename (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha (name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return (char *) base;
+}
+
+char *
+fnqualify(const char *path)
+{
+  size_t size;
+  char *p;
+  char tmp[LT_PATHMAX + 1];
+
+  assert(path != NULL);
+
+  /* Is it qualified already? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha (path[0]) && path[1] == ':')
+    return xstrdup (path);
+#endif
+  if (IS_DIR_SEPARATOR (path[0]))
+    return xstrdup (path);
+
+  /* prepend the current directory */
+  /* doesn't handle '~' */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal ("getcwd failed");
+  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
+  p = XMALLOC(char, size);
+  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
+  return p;
+}
+
+char *
+strendzap(char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert(str != NULL);
+  assert(pat != NULL);
+
+  len = strlen(str);
+  patlen = strlen(pat);
+
+  if (patlen <= len)
+  {
+    str += len - patlen;
+    if (strcmp(str, pat) == 0)
+      *str = '\0';
+  }
+  return str;
+}
+
+static void
+lt_error_core (int exit_status, const char * mode,
+          const char * message, va_list ap)
+{
+  fprintf (stderr, "%s: %s: ", program_name, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+  va_end (ap);
+}
+EOF
+	  # we should really use a build-platform specific compiler
+	  # here, but OTOH, the wrappers (shell script and this C one)
+	  # are only useful if you want to execute the "real" binary.
+	  # Since the "real" binary is built for $host, then this
+	  # wrapper might as well be built for $host, too.
+	  $run $LTCC -s -o $cwrapper $cwrappersource
+	  ;;
+	esac
+	$rm $output
+	trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
+
+	$echo > $output "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variable:
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$echo are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    echo=\"$qecho\"
+    file=\"\$0\"
+    # Make sure echo works.
+    if test \"X\$1\" = X--no-reexec; then
+      # Discard the --no-reexec flag, and continue.
+      shift
+    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
+      # Yippee, \$echo works!
+      :
+    else
+      # Restart under the correct shell, and then maybe \$echo will work.
+      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+    fi
+  fi\
+"
+	$echo >> $output "\
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+  done
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+	if test "$fast_install" = yes; then
+	  $echo >> $output "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" || \\
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $mkdir \"\$progdir\"
+    else
+      $rm \"\$progdir/\$file\"
+    fi"
+
+	  $echo >> $output "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+	$echo \"\$relink_command_output\" >&2
+	$rm \"\$progdir/\$file\"
+	exit $EXIT_FAILURE
+      fi
+    fi
+
+    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $rm \"\$progdir/\$program\";
+      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $rm \"\$progdir/\$file\"
+  fi"
+	else
+	  $echo >> $output "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+	fi
+
+	$echo >> $output "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+	# Export our shlibpath_var if we have one.
+	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	  $echo >> $output "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+	fi
+
+	# fixup the dll searchpath if we need to.
+	if test -n "$dllsearchpath"; then
+	  $echo >> $output "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
+	$echo >> $output "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+"
+	case $host in
+	# Backslashes separate directories on plain windows
+	*-*-mingw | *-*-os2*)
+	  $echo >> $output "\
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+	  ;;
+
+	*)
+	  $echo >> $output "\
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+	  ;;
+	esac
+	$echo >> $output "\
+      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+      exit $EXIT_FAILURE
+    fi
+  else
+    # The program doesn't exist.
+    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$echo \"This script is just a wrapper for \$program.\" 1>&2
+    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit $EXIT_FAILURE
+  fi
+fi\
+"
+	chmod +x $output
+      fi
+      exit $EXIT_SUCCESS
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
+
+      if test "$build_libtool_libs" = convenience; then
+	oldobjs="$libobjs_save"
+	addlibs="$convenience"
+	build_libtool_libs=no
+      else
+	if test "$build_libtool_libs" = module; then
+	  oldobjs="$libobjs_save"
+	  build_libtool_libs=no
+	else
+	  oldobjs="$old_deplibs $non_pic_objects"
+	fi
+	addlibs="$old_convenience"
+      fi
+
+      if test -n "$addlibs"; then
+	gentop="$output_objdir/${outputname}x"
+	generated="$generated $gentop"
+
+	func_extract_archives $gentop $addlibs
+	oldobjs="$oldobjs $func_extract_archives_result"
+      fi
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+       cmds=$old_archive_from_new_cmds
+      else
+	# POSIX demands no paths to be encoded in archives.  We have
+	# to avoid creating archives with duplicate basenames if we
+	# might have to extract them afterwards, e.g., when creating a
+	# static archive out of a convenience library, or when linking
+	# the entirety of a libtool archive into another (currently
+	# not supported by libtool).
+	if (for obj in $oldobjs
+	    do
+	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
+	    done | sort | sort -uc >/dev/null 2>&1); then
+	  :
+	else
+	  $echo "copying selected object files to avoid basename conflicts..."
+
+	  if test -z "$gentop"; then
+	    gentop="$output_objdir/${outputname}x"
+	    generated="$generated $gentop"
+
+	    $show "${rm}r $gentop"
+	    $run ${rm}r "$gentop"
+	    $show "$mkdir $gentop"
+	    $run $mkdir "$gentop"
+	    status=$?
+	    if test "$status" -ne 0 && test ! -d "$gentop"; then
+	      exit $status
+	    fi
+	  fi
+
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  counter=1
+	  for obj in $save_oldobjs
+	  do
+	    objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+	    case " $oldobjs " in
+	    " ") oldobjs=$obj ;;
+	    *[\ /]"$objbase "*)
+	      while :; do
+		# Make sure we don't pick an alternate name that also
+		# overlaps.
+		newobj=lt$counter-$objbase
+		counter=`expr $counter + 1`
+		case " $oldobjs " in
+		*[\ /]"$newobj "*) ;;
+		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
+		esac
+	      done
+	      $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+	      $run ln "$obj" "$gentop/$newobj" ||
+	      $run cp "$obj" "$gentop/$newobj"
+	      oldobjs="$oldobjs $gentop/$newobj"
+	      ;;
+	    *) oldobjs="$oldobjs $obj" ;;
+	    esac
+	  done
+	fi
+
+	eval cmds=\"$old_archive_cmds\"
+
+	if len=`expr "X$cmds" : ".*"` &&
+	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  cmds=$old_archive_cmds
+	else
+	  # the command line is too long to link in one step, link in parts
+	  $echo "using piecewise archive linking..."
+	  save_RANLIB=$RANLIB
+	  RANLIB=:
+	  objlist=
+	  concat_cmds=
+	  save_oldobjs=$oldobjs
+
+	  # Is there a better way of finding the last object in the list?
+	  for obj in $save_oldobjs
+	  do
+	    last_oldobj=$obj
+	  done
+	  for obj in $save_oldobjs
+	  do
+	    oldobjs="$objlist $obj"
+	    objlist="$objlist $obj"
+	    eval test_cmds=\"$old_archive_cmds\"
+	    if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+	       test "$len" -le "$max_cmd_len"; then
+	      :
+	    else
+	      # the above command should be used before it gets too long
+	      oldobjs=$objlist
+	      if test "$obj" = "$last_oldobj" ; then
+	        RANLIB=$save_RANLIB
+	      fi
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+	      objlist=
+	    fi
+	  done
+	  RANLIB=$save_RANLIB
+	  oldobjs=$objlist
+	  if test "X$oldobjs" = "X" ; then
+	    eval cmds=\"\$concat_cmds\"
+	  else
+	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+	  fi
+	fi
+      fi
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+        eval cmd=\"$cmd\"
+	IFS="$save_ifs"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    done
+
+    if test -n "$generated"; then
+      $show "${rm}r$generated"
+      $run ${rm}r$generated
+    fi
+
+    # Now create the libtool archive.
+    case $output in
+    *.la)
+      old_library=
+      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      $show "creating $output"
+
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+	if eval test -z \"\${$var+set}\"; then
+	  relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	elif eval var_value=\$$var; test -z "$var_value"; then
+	  relink_command="$var=; export $var; $relink_command"
+	else
+	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	fi
+      done
+      # Quote the link command for shipping.
+      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      if test "$hardcode_automatic" = yes ; then
+	relink_command=
+      fi
+
+
+      # Only create the output if not a dry run.
+      if test -z "$run"; then
+	for installed in no yes; do
+	  if test "$installed" = yes; then
+	    if test -z "$install_libdir"; then
+	      break
+	    fi
+	    output="$output_objdir/$outputname"i
+	    # Replace all uninstalled libtool libraries with the installed ones
+	    newdependency_libs=
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      *.la)
+		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		if test -z "$libdir"; then
+		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+		  exit $EXIT_FAILURE
+		fi
+		newdependency_libs="$newdependency_libs $libdir/$name"
+		;;
+	      *) newdependency_libs="$newdependency_libs $deplib" ;;
+	      esac
+	    done
+	    dependency_libs="$newdependency_libs"
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+	      if test -z "$libdir"; then
+		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+		exit $EXIT_FAILURE
+	      fi
+	      newdlfiles="$newdlfiles $libdir/$name"
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+	      if test -z "$libdir"; then
+		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+		exit $EXIT_FAILURE
+	      fi
+	      newdlprefiles="$newdlprefiles $libdir/$name"
+	    done
+	    dlprefiles="$newdlprefiles"
+	  else
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      newdlfiles="$newdlfiles $abs"
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      newdlprefiles="$newdlprefiles $abs"
+	    done
+	    dlprefiles="$newdlprefiles"
+	  fi
+	  $rm $output
+	  # place dlname in correct position for cygwin
+	  tdlname=$dlname
+	  case $host,$output,$installed,$module,$dlname in
+	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+	  esac
+	  $echo > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+	  if test "$installed" = no && test "$need_relink" = yes; then
+	    $echo >> $output "\
+relink_command=\"$relink_command\""
+	  fi
+	done
+      fi
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+      ;;
+    esac
+    exit $EXIT_SUCCESS
+    ;;
+
+  # libtool install mode
+  install)
+    modename="$modename: install"
+
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       $echo "X$nonopt" | grep shtool > /dev/null; then
+      # Aesthetically quote it.
+      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	arg="\"$arg\""
+	;;
+      esac
+      install_prog="$arg "
+      arg="$1"
+      shift
+    else
+      install_prog=
+      arg=$nonopt
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+    case $arg in
+    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+      arg="\"$arg\""
+      ;;
+    esac
+    install_prog="$install_prog$arg"
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    for arg
+    do
+      if test -n "$dest"; then
+	files="$files $dest"
+	dest=$arg
+	continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f) 
+      	case " $install_prog " in
+	*[\\\ /]cp\ *) ;;
+	*) prev=$arg ;;
+	esac
+	;;
+      -g | -m | -o) prev=$arg ;;
+      -s)
+	stripme=" -s"
+	continue
+	;;
+      -*)
+	;;
+      *)
+	# If the previous option needed an argument, then skip it.
+	if test -n "$prev"; then
+	  prev=
+	else
+	  dest=$arg
+	  continue
+	fi
+	;;
+      esac
+
+      # Aesthetically quote the argument.
+      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	arg="\"$arg\""
+	;;
+      esac
+      install_prog="$install_prog $arg"
+    done
+
+    if test -z "$install_prog"; then
+      $echo "$modename: you must specify an install program" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prev' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+	$echo "$modename: no file or destination specified" 1>&2
+      else
+	$echo "$modename: you must specify a destination" 1>&2
+      fi
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    # Strip any trailing slash from the destination.
+    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+      test "X$destdir" = "X$dest" && destdir=.
+      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files
+      if test "$#" -gt 2; then
+	$echo "$modename: \`$dest' is not a directory" 1>&2
+	$echo "$help" 1>&2
+	exit $EXIT_FAILURE
+      fi
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+	case $file in
+	*.lo) ;;
+	*)
+	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+	# Do the static libraries later.
+	staticlibs="$staticlibs $file"
+	;;
+
+      *.la)
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	library_names=
+	old_library=
+	relink_command=
+	# If there is no directory component, then add one.
+	case $file in
+	*/* | *\\*) . $file ;;
+	*) . ./$file ;;
+	esac
+
+	# Add the libdir to current_libdirs if it is the destination.
+	if test "X$destdir" = "X$libdir"; then
+	  case "$current_libdirs " in
+	  *" $libdir "*) ;;
+	  *) current_libdirs="$current_libdirs $libdir" ;;
+	  esac
+	else
+	  # Note the libdir as a future libdir.
+	  case "$future_libdirs " in
+	  *" $libdir "*) ;;
+	  *) future_libdirs="$future_libdirs $libdir" ;;
+	  esac
+	fi
+
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
+	test "X$dir" = "X$file/" && dir=
+	dir="$dir$objdir"
+
+	if test -n "$relink_command"; then
+	  # Determine the prefix the user has applied to our future dir.
+	  inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
+
+	  # Don't allow the user to place us outside of our expected
+	  # location b/c this prevents finding dependent libraries that
+	  # are installed to the same prefix.
+	  # At present, this check doesn't affect windows .dll's that
+	  # are installed into $libdir/../bin (currently, that works fine)
+	  # but it's something to keep an eye on.
+	  if test "$inst_prefix_dir" = "$destdir"; then
+	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+
+	  if test -n "$inst_prefix_dir"; then
+	    # Stick the inst_prefix_dir data into the link command.
+	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	  else
+	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+	  fi
+
+	  $echo "$modename: warning: relinking \`$file'" 1>&2
+	  $show "$relink_command"
+	  if $run eval "$relink_command"; then :
+	  else
+	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	fi
+
+	# See the names of the shared library.
+	set dummy $library_names
+	if test -n "$2"; then
+	  realname="$2"
+	  shift
+	  shift
+
+	  srcname="$realname"
+	  test -n "$relink_command" && srcname="$realname"T
+
+	  # Install the shared library and build the symlinks.
+	  $show "$install_prog $dir/$srcname $destdir/$realname"
+	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
+	  if test -n "$stripme" && test -n "$striplib"; then
+	    $show "$striplib $destdir/$realname"
+	    $run eval "$striplib $destdir/$realname" || exit $?
+	  fi
+
+	  if test "$#" -gt 0; then
+	    # Delete the old symlinks, and create new ones.
+	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
+	    # so we also need to try rm && ln -s.
+	    for linkname
+	    do
+	      if test "$linkname" != "$realname"; then
+                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
+                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
+	      fi
+	    done
+	  fi
+
+	  # Do each command in the postinstall commands.
+	  lib="$destdir/$realname"
+	  cmds=$postinstall_cmds
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $cmds; do
+	    IFS="$save_ifs"
+	    eval cmd=\"$cmd\"
+	    $show "$cmd"
+	    $run eval "$cmd" || {
+	      lt_exit=$?
+
+	      # Restore the uninstalled library and exit
+	      if test "$mode" = relink; then
+		$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+	      fi
+
+	      exit $lt_exit
+	    }
+	  done
+	  IFS="$save_ifs"
+	fi
+
+	# Install the pseudo-library for information purposes.
+	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	instname="$dir/$name"i
+	$show "$install_prog $instname $destdir/$name"
+	$run eval "$install_prog $instname $destdir/$name" || exit $?
+
+	# Maybe install the static library, too.
+	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+	;;
+
+      *.lo)
+	# Install (i.e. copy) a libtool object.
+
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	  destfile="$destdir/$destfile"
+	fi
+
+	# Deduce the name of the destination old-style object file.
+	case $destfile in
+	*.lo)
+	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+	  ;;
+	*.$objext)
+	  staticdest="$destfile"
+	  destfile=
+	  ;;
+	*)
+	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	# Install the libtool object if requested.
+	if test -n "$destfile"; then
+	  $show "$install_prog $file $destfile"
+	  $run eval "$install_prog $file $destfile" || exit $?
+	fi
+
+	# Install the old object if enabled.
+	if test "$build_old_libs" = yes; then
+	  # Deduce the name of the old-style object file.
+	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
+
+	  $show "$install_prog $staticobj $staticdest"
+	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+	fi
+	exit $EXIT_SUCCESS
+	;;
+
+      *)
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	  destfile="$destdir/$destfile"
+	fi
+
+	# If the file is missing, and there is a .exe on the end, strip it
+	# because it is most likely a libtool script we actually want to
+	# install
+	stripped_ext=""
+	case $file in
+	  *.exe)
+	    if test ! -f "$file"; then
+	      file=`$echo $file|${SED} 's,.exe$,,'`
+	      stripped_ext=".exe"
+	    fi
+	    ;;
+	esac
+
+	# Do a test to see if this is really a libtool program.
+	case $host in
+	*cygwin*|*mingw*)
+	    wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
+	    ;;
+	*)
+	    wrapper=$file
+	    ;;
+	esac
+	if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
+	  notinst_deplibs=
+	  relink_command=
+
+	  # Note that it is not necessary on cygwin/mingw to append a dot to
+	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
+	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
+	  # `FILE.' does not work on cygwin managed mounts.
+	  #
+	  # If there is no directory component, then add one.
+	  case $wrapper in
+	  */* | *\\*) . ${wrapper} ;;
+	  *) . ./${wrapper} ;;
+	  esac
+
+	  # Check the variables that should have been set.
+	  if test -z "$notinst_deplibs"; then
+	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+
+	  finalize=yes
+	  for lib in $notinst_deplibs; do
+	    # Check to see that each library is installed.
+	    libdir=
+	    if test -f "$lib"; then
+	      # If there is no directory component, then add one.
+	      case $lib in
+	      */* | *\\*) . $lib ;;
+	      *) . ./$lib ;;
+	      esac
+	    fi
+	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    if test -n "$libdir" && test ! -f "$libfile"; then
+	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+	      finalize=no
+	    fi
+	  done
+
+	  relink_command=
+	  # Note that it is not necessary on cygwin/mingw to append a dot to
+	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
+	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
+	  # `FILE.' does not work on cygwin managed mounts.
+	  #
+	  # If there is no directory component, then add one.
+	  case $wrapper in
+	  */* | *\\*) . ${wrapper} ;;
+	  *) . ./${wrapper} ;;
+	  esac
+
+	  outputname=
+	  if test "$fast_install" = no && test -n "$relink_command"; then
+	    if test "$finalize" = yes && test -z "$run"; then
+	      tmpdir="/tmp"
+	      test -n "$TMPDIR" && tmpdir="$TMPDIR"
+	      tmpdir="$tmpdir/libtool-$$"
+	      save_umask=`umask`
+	      umask 0077
+	      if $mkdir "$tmpdir"; then
+	        umask $save_umask
+	      else
+	        umask $save_umask
+		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
+		continue
+	      fi
+	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
+	      outputname="$tmpdir/$file"
+	      # Replace the output file specification.
+	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+	      $show "$relink_command"
+	      if $run eval "$relink_command"; then :
+	      else
+		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+		${rm}r "$tmpdir"
+		continue
+	      fi
+	      file="$outputname"
+	    else
+	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
+	    fi
+	  else
+	    # Install the binary that we compiled earlier.
+	    file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+	  fi
+	fi
+
+	# remove .exe since cygwin /usr/bin/install will append another
+	# one anyway 
+	case $install_prog,$host in
+	*/usr/bin/install*,*cygwin*)
+	  case $file:$destfile in
+	  *.exe:*.exe)
+	    # this is ok
+	    ;;
+	  *.exe:*)
+	    destfile=$destfile.exe
+	    ;;
+	  *:*.exe)
+	    destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
+	    ;;
+	  esac
+	  ;;
+	esac
+	$show "$install_prog$stripme $file $destfile"
+	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+	test -n "$outputname" && ${rm}r "$tmpdir"
+	;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+
+      $show "$install_prog $file $oldlib"
+      $run eval "$install_prog \$file \$oldlib" || exit $?
+
+      if test -n "$stripme" && test -n "$old_striplib"; then
+	$show "$old_striplib $oldlib"
+	$run eval "$old_striplib $oldlib" || exit $?
+      fi
+
+      # Do each command in the postinstall commands.
+      cmds=$old_postinstall_cmds
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	eval cmd=\"$cmd\"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    done
+
+    if test -n "$future_libdirs"; then
+      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+    fi
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      test -n "$run" && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+    ;;
+
+  # libtool finish mode
+  finish)
+    modename="$modename: finish"
+    libdirs="$nonopt"
+    admincmds=
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for dir
+      do
+	libdirs="$libdirs $dir"
+      done
+
+      for libdir in $libdirs; do
+	if test -n "$finish_cmds"; then
+	  # Do each command in the finish commands.
+	  cmds=$finish_cmds
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $cmds; do
+	    IFS="$save_ifs"
+	    eval cmd=\"$cmd\"
+	    $show "$cmd"
+	    $run eval "$cmd" || admincmds="$admincmds
+       $cmd"
+	  done
+	  IFS="$save_ifs"
+	fi
+	if test -n "$finish_eval"; then
+	  # Do the single finish_eval.
+	  eval cmds=\"$finish_eval\"
+	  $run eval "$cmds" || admincmds="$admincmds
+       $cmds"
+	fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    test "$show" = : && exit $EXIT_SUCCESS
+
+    $echo "----------------------------------------------------------------------"
+    $echo "Libraries have been installed in:"
+    for libdir in $libdirs; do
+      $echo "   $libdir"
+    done
+    $echo
+    $echo "If you ever happen to want to link against installed libraries"
+    $echo "in a given directory, LIBDIR, you must either use libtool, and"
+    $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+    $echo "flag during linking and do at least one of the following:"
+    if test -n "$shlibpath_var"; then
+      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+      $echo "     during execution"
+    fi
+    if test -n "$runpath_var"; then
+      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+      $echo "     during linking"
+    fi
+    if test -n "$hardcode_libdir_flag_spec"; then
+      libdir=LIBDIR
+      eval flag=\"$hardcode_libdir_flag_spec\"
+
+      $echo "   - use the \`$flag' linker flag"
+    fi
+    if test -n "$admincmds"; then
+      $echo "   - have your system administrator run these commands:$admincmds"
+    fi
+    if test -f /etc/ld.so.conf; then
+      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+    fi
+    $echo
+    $echo "See any operating system documentation about shared libraries for"
+    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
+    $echo "----------------------------------------------------------------------"
+    exit $EXIT_SUCCESS
+    ;;
+
+  # libtool execute mode
+  execute)
+    modename="$modename: execute"
+
+    # The first argument is the command name.
+    cmd="$nonopt"
+    if test -z "$cmd"; then
+      $echo "$modename: you must specify a COMMAND" 1>&2
+      $echo "$help"
+      exit $EXIT_FAILURE
+    fi
+
+    # Handle -dlopen flags immediately.
+    for file in $execute_dlfiles; do
+      if test ! -f "$file"; then
+	$echo "$modename: \`$file' is not a file" 1>&2
+	$echo "$help" 1>&2
+	exit $EXIT_FAILURE
+      fi
+
+      dir=
+      case $file in
+      *.la)
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# Read the libtool library.
+	dlname=
+	library_names=
+
+	# If there is no directory component, then add one.
+	case $file in
+	*/* | *\\*) . $file ;;
+	*) . ./$file ;;
+	esac
+
+	# Skip this library if it cannot be dlopened.
+	if test -z "$dlname"; then
+	  # Warn if it was a shared library.
+	  test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+	  continue
+	fi
+
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$dir" = "X$file" && dir=.
+
+	if test -f "$dir/$objdir/$dlname"; then
+	  dir="$dir/$objdir"
+	else
+	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+	;;
+
+      *.lo)
+	# Just add the directory containing the .lo file.
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$dir" = "X$file" && dir=.
+	;;
+
+      *)
+	$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+	continue
+	;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+	eval "$shlibpath_var=\"\$dir\""
+      else
+	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -*) ;;
+      *)
+	# Do a test to see if this is really a libtool program.
+	if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  # If there is no directory component, then add one.
+	  case $file in
+	  */* | *\\*) . $file ;;
+	  *) . ./$file ;;
+	  esac
+
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	fi
+	;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+      args="$args \"$file\""
+    done
+
+    if test -z "$run"; then
+      if test -n "$shlibpath_var"; then
+	# Export the shlibpath_var.
+	eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      if test "${save_LC_ALL+set}" = set; then
+	LC_ALL="$save_LC_ALL"; export LC_ALL
+      fi
+      if test "${save_LANG+set}" = set; then
+	LANG="$save_LANG"; export LANG
+      fi
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+	$echo "export $shlibpath_var"
+      fi
+      $echo "$cmd$args"
+      exit $EXIT_SUCCESS
+    fi
+    ;;
+
+  # libtool clean and uninstall mode
+  clean | uninstall)
+    modename="$modename: $mode"
+    rm="$nonopt"
+    files=
+    rmforce=
+    exit_status=0
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    for arg
+    do
+      case $arg in
+      -f) rm="$rm $arg"; rmforce=yes ;;
+      -*) rm="$rm $arg" ;;
+      *) files="$files $arg" ;;
+      esac
+    done
+
+    if test -z "$rm"; then
+      $echo "$modename: you must specify an RM program" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    rmdirs=
+
+    origobjdir="$objdir"
+    for file in $files; do
+      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+      if test "X$dir" = "X$file"; then
+	dir=.
+	objdir="$origobjdir"
+      else
+	objdir="$dir/$origobjdir"
+      fi
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+      test "$mode" = uninstall && objdir="$dir"
+
+      # Remember objdir for removal later, being careful to avoid duplicates
+      if test "$mode" = clean; then
+	case " $rmdirs " in
+	  *" $objdir "*) ;;
+	  *) rmdirs="$rmdirs $objdir" ;;
+	esac
+      fi
+
+      # Don't error if the file doesn't exist and rm -f was used.
+      if (test -L "$file") >/dev/null 2>&1 \
+	|| (test -h "$file") >/dev/null 2>&1 \
+	|| test -f "$file"; then
+	:
+      elif test -d "$file"; then
+	exit_status=1
+	continue
+      elif test "$rmforce" = yes; then
+	continue
+      fi
+
+      rmfiles="$file"
+
+      case $name in
+      *.la)
+	# Possibly a libtool archive, so verify it.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  . $dir/$name
+
+	  # Delete the libtool libraries and symlinks.
+	  for n in $library_names; do
+	    rmfiles="$rmfiles $objdir/$n"
+	  done
+	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+	  test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+
+	  if test "$mode" = uninstall; then
+	    if test -n "$library_names"; then
+	      # Do each command in the postuninstall commands.
+	      cmds=$postuninstall_cmds
+	      save_ifs="$IFS"; IFS='~'
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
+		$show "$cmd"
+		$run eval "$cmd"
+		if test "$?" -ne 0 && test "$rmforce" != yes; then
+		  exit_status=1
+		fi
+	      done
+	      IFS="$save_ifs"
+	    fi
+
+	    if test -n "$old_library"; then
+	      # Do each command in the old_postuninstall commands.
+	      cmds=$old_postuninstall_cmds
+	      save_ifs="$IFS"; IFS='~'
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
+		$show "$cmd"
+		$run eval "$cmd"
+		if test "$?" -ne 0 && test "$rmforce" != yes; then
+		  exit_status=1
+		fi
+	      done
+	      IFS="$save_ifs"
+	    fi
+	    # FIXME: should reinstall the best remaining shared library.
+	  fi
+	fi
+	;;
+
+      *.lo)
+	# Possibly a libtool object, so verify it.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+
+	  # Read the .lo file
+	  . $dir/$name
+
+	  # Add PIC object to the list of files to remove.
+	  if test -n "$pic_object" \
+	     && test "$pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$pic_object"
+	  fi
+
+	  # Add non-PIC object to the list of files to remove.
+	  if test -n "$non_pic_object" \
+	     && test "$non_pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$non_pic_object"
+	  fi
+	fi
+	;;
+
+      *)
+	if test "$mode" = clean ; then
+	  noexename=$name
+	  case $file in
+	  *.exe)
+	    file=`$echo $file|${SED} 's,.exe$,,'`
+	    noexename=`$echo $name|${SED} 's,.exe$,,'`
+	    # $file with .exe has already been added to rmfiles,
+	    # add $file without .exe
+	    rmfiles="$rmfiles $file"
+	    ;;
+	  esac
+	  # Do a test to see if this is a libtool program.
+	  if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	    relink_command=
+	    . $dir/$noexename
+
+	    # note $name still contains .exe if it was in $file originally
+	    # as does the version of $file that was added into $rmfiles
+	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+	    if test "$fast_install" = yes && test -n "$relink_command"; then
+	      rmfiles="$rmfiles $objdir/lt-$name"
+	    fi
+	    if test "X$noexename" != "X$name" ; then
+	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+	    fi
+	  fi
+	fi
+	;;
+      esac
+      $show "$rm $rmfiles"
+      $run $rm $rmfiles || exit_status=1
+    done
+    objdir="$origobjdir"
+
+    # Try to remove the ${objdir}s in the directories where we deleted files
+    for dir in $rmdirs; do
+      if test -d "$dir"; then
+	$show "rmdir $dir"
+	$run rmdir $dir >/dev/null 2>&1
+      fi
+    done
+
+    exit $exit_status
+    ;;
+
+  "")
+    $echo "$modename: you must specify a MODE" 1>&2
+    $echo "$generic_help" 1>&2
+    exit $EXIT_FAILURE
+    ;;
+  esac
+
+  if test -z "$exec_cmd"; then
+    $echo "$modename: invalid operation mode \`$mode'" 1>&2
+    $echo "$generic_help" 1>&2
+    exit $EXIT_FAILURE
+  fi
+fi # test -z "$show_help"
+
+if test -n "$exec_cmd"; then
+  eval exec $exec_cmd
+  exit $EXIT_FAILURE
+fi
+
+# We need to display help for each of the modes.
+case $mode in
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+    --config          show all configuration variables
+    --debug           enable verbose shell tracing
+-n, --dry-run         display commands without modifying any files
+    --features        display basic configuration information and exit
+    --finish          same as \`--mode=finish'
+    --help            display this help message and exit
+    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
+    --quiet           same as \`--silent'
+    --silent          don't print informational messages
+    --tag=TAG         use configuration variables from tag TAG
+    --version         print version information
+
+MODE must be one of the following:
+
+      clean           remove files from the build directory
+      compile         compile a source file into a libtool object
+      execute         automatically set library path, then run a program
+      finish          complete the installation of libtool libraries
+      install         install libraries or executables
+      link            create a library or an executable
+      uninstall       remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE.
+
+Report bugs to <bug-libtool@gnu.org>."
+  exit $EXIT_SUCCESS
+  ;;
+
+clean)
+  $echo \
+"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+compile)
+  $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -prefer-pic       try to building PIC objects only
+  -prefer-non-pic   try to building non-PIC objects only
+  -static           always build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+  ;;
+
+execute)
+  $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+  ;;
+
+finish)
+  $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+  ;;
+
+install)
+  $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+  ;;
+
+link)
+  $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+		    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+		    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -static           do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+		    specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+  ;;
+
+uninstall)
+  $echo \
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+*)
+  $echo "$modename: invalid operation mode \`$mode'" 1>&2
+  $echo "$help" 1>&2
+  exit $EXIT_FAILURE
+  ;;
+esac
+
+$echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit $?
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+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:
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
+
+# Libtool was configured on host tardis-d04:
+
+# Shell to use when invoking shell scripts.
+SHELL="/bin/sh"
+
+# Whether or not to build shared libraries.
+build_libtool_libs=yes
+
+# Whether or not to build static libraries.
+build_old_libs=no
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=no
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=no
+
+# Whether or not to optimize for fast installation.
+fast_install=yes
+
+# The host system.
+host_alias=
+host=i686-pc-linux-gnu
+host_os=linux-gnu
+
+# The build system.
+build_alias=
+build=i686-pc-linux-gnu
+build_os=linux-gnu
+
+# An echo program that does not interpret backslashes.
+echo="echo"
+
+# The archiver.
+AR="ar"
+AR_FLAGS="cru"
+
+# A C compiler.
+LTCC="gcc"
+
+# A language-specific compiler.
+CC="g++"
+
+# Is the compiler the GNU C compiler?
+with_gcc=yes
+
+# An ERE matcher.
+EGREP="/bin/grep -E"
+
+# The linker used to build libraries.
+LD="/usr/bin/ld"
+
+# Whether we need hard or soft links.
+LN_S="ln -s"
+
+# A BSD-compatible nm program.
+NM="/usr/bin/nm -B"
+
+# A symbol stripping program
+STRIP="strip"
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=file
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="dlltool"
+
+# Used on cygwin: object dumper.
+OBJDUMP="objdump"
+
+# Used on cygwin: assembler.
+AS="as"
+
+# The name of the directory that contains temporary libtool files.
+objdir=.libs
+
+# How to create reloadable object files.
+reload_flag=" -r"
+reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
+
+# How to pass a linker flag through the compiler.
+wl="-Wl,"
+
+# Object file suffix (normally "o").
+objext="o"
+
+# Old archive suffix (normally "a").
+libext="a"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='.so'
+
+# Executable file suffix (normally "").
+exeext=""
+
+# Additional compiler flags for building library objects.
+pic_flag=" -fPIC -DPIC"
+pic_mode=default
+
+# What is the maximum length of a command?
+max_cmd_len=32768
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o="yes"
+
+# Must we lock files when doing compilation?
+need_locks="no"
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=no
+
+# Do we need a version for libraries?
+need_version=no
+
+# Whether dlopen is supported.
+dlopen_support=unknown
+
+# Whether dlopen of programs is supported.
+dlopen_self=unknown
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=unknown
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag="-static"
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=" -fno-builtin"
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec="\${wl}--export-dynamic"
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=""
+
+# Library versioning type.
+version_type=linux
+
+# Format of library name prefix.
+libname_spec="lib\$name"
+
+# 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.
+library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
+
+# The coded name of the library, if different from the real name.
+soname_spec="\${libname}\${release}\${shared_ext}\$major"
+
+# Commands used to build and install an old-style archive.
+RANLIB="ranlib"
+old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
+old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
+old_postuninstall_cmds=""
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=""
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=""
+
+# Commands used to build and install a shared archive.
+archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
+archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
+postinstall_cmds=""
+postuninstall_cmds=""
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=""
+module_expsym_cmds=""
+
+# Commands to strip libraries.
+old_striplib="strip --strip-debug"
+striplib="strip --strip-unneeded"
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects="/usr/lib/gcc-lib/i486-linux/3.3.5/../../../crti.o /usr/lib/gcc-lib/i486-linux/3.3.5/crtbeginS.o"
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects="/usr/lib/gcc-lib/i486-linux/3.3.5/crtendS.o /usr/lib/gcc-lib/i486-linux/3.3.5/../../../crtn.o"
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=""
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path="-L/usr/lib/gcc-lib/i486-linux/3.3.5 -L/usr/lib/gcc-lib/i486-linux/3.3.5/../../.."
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method="pass_all"
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd="\$MAGIC_CMD"
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=""
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=""
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=""
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe="sed -n -e 's/^.*[ 	]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ 	][ 	]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/  {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/  {\"\\2\", (lt_ptr) \\&\\2},/p'"
+
+# This is the shared library runtime path variable.
+runpath_var=LD_RUN_PATH
+
+# This is the shared library path variable.
+shlibpath_var=LD_LIBRARY_PATH
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=no
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=immediate
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=yes
+
+# Flag to hardcode $libdir into a binary during linking.
+# This must work even if $libdir does not exist.
+hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
+
+# If ld is used when linking, flag to hardcode $libdir into
+# a binary during linking. This must work even if $libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=""
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=""
+
+# Set to yes if using DIR/libNAME during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=no
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=no
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=no
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=unknown
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=" /usr/lib/gcc-lib/i486-linux/3.3.5/ /usr/lib/gcc/i486-linux/3.3.5/ /usr/lib/gcc-lib/i486-linux/3.3.5/../../../../i486-linux/lib/i486-linux/3.3.5/ /usr/lib/gcc-lib/i486-linux/3.3.5/../../../../i486-linux/lib/ /usr/lib/gcc-lib/i486-linux/3.3.5/../../../i486-linux/3.3.5/ /usr/lib/gcc-lib/i486-linux/3.3.5/../../../ /lib/i486-linux/3.3.5/ /lib/ /usr/lib/i486-linux/3.3.5/ /usr/lib/"
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/libc5-compat /lib/libc5-compat /usr/i486-linuxlibc1/lib /usr/X11R6/lib /usr/lib/nvidia/lib "
+
+# Fix the shell variable $srcfile for the compiler.
+fix_srcfile_path=""
+
+# Set to yes if exported symbols are required.
+always_export_symbols=no
+
+# The commands to list exported symbols.
+export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=""
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=""
+
+# Symbols that must always be exported.
+include_expsyms=""
+
+# ### END LIBTOOL TAG CONFIG: CXX
+
+# ### BEGIN LIBTOOL TAG CONFIG: F77
+
+# Libtool was configured on host tardis-d04:
+
+# Shell to use when invoking shell scripts.
+SHELL="/bin/sh"
+
+# Whether or not to build shared libraries.
+build_libtool_libs=yes
+
+# Whether or not to build static libraries.
+build_old_libs=no
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=no
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=no
+
+# Whether or not to optimize for fast installation.
+fast_install=yes
+
+# The host system.
+host_alias=
+host=i686-pc-linux-gnu
+host_os=linux-gnu
+
+# The build system.
+build_alias=
+build=i686-pc-linux-gnu
+build_os=linux-gnu
+
+# An echo program that does not interpret backslashes.
+echo="echo"
+
+# The archiver.
+AR="ar"
+AR_FLAGS="cru"
+
+# A C compiler.
+LTCC="gcc"
+
+# A language-specific compiler.
+CC="g77"
+
+# Is the compiler the GNU C compiler?
+with_gcc=yes
+
+# An ERE matcher.
+EGREP="/bin/grep -E"
+
+# The linker used to build libraries.
+LD="/usr/bin/ld"
+
+# Whether we need hard or soft links.
+LN_S="ln -s"
+
+# A BSD-compatible nm program.
+NM="/usr/bin/nm -B"
+
+# A symbol stripping program
+STRIP="strip"
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=file
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="dlltool"
+
+# Used on cygwin: object dumper.
+OBJDUMP="objdump"
+
+# Used on cygwin: assembler.
+AS="as"
+
+# The name of the directory that contains temporary libtool files.
+objdir=.libs
+
+# How to create reloadable object files.
+reload_flag=" -r"
+reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
+
+# How to pass a linker flag through the compiler.
+wl="-Wl,"
+
+# Object file suffix (normally "o").
+objext="o"
+
+# Old archive suffix (normally "a").
+libext="a"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='.so'
+
+# Executable file suffix (normally "").
+exeext=""
+
+# Additional compiler flags for building library objects.
+pic_flag=" -fPIC"
+pic_mode=default
+
+# What is the maximum length of a command?
+max_cmd_len=32768
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o="yes"
+
+# Must we lock files when doing compilation?
+need_locks="no"
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=no
+
+# Do we need a version for libraries?
+need_version=no
+
+# Whether dlopen is supported.
+dlopen_support=unknown
+
+# Whether dlopen of programs is supported.
+dlopen_self=unknown
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=unknown
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag="-static"
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=""
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec="\${wl}--export-dynamic"
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=""
+
+# Library versioning type.
+version_type=linux
+
+# Format of library name prefix.
+libname_spec="lib\$name"
+
+# 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.
+library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
+
+# The coded name of the library, if different from the real name.
+soname_spec="\${libname}\${release}\${shared_ext}\$major"
+
+# Commands used to build and install an old-style archive.
+RANLIB="ranlib"
+old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
+old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
+old_postuninstall_cmds=""
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=""
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=""
+
+# Commands used to build and install a shared archive.
+archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
+archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
+  cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
+  \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
+	  \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
+postinstall_cmds=""
+postuninstall_cmds=""
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=""
+module_expsym_cmds=""
+
+# Commands to strip libraries.
+old_striplib="strip --strip-debug"
+striplib="strip --strip-unneeded"
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=""
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=""
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=""
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=""
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=""
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method="pass_all"
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd="\$MAGIC_CMD"
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=""
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=""
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=""
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe="sed -n -e 's/^.*[ 	]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ 	][ 	]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/  {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/  {\"\\2\", (lt_ptr) \\&\\2},/p'"
+
+# This is the shared library runtime path variable.
+runpath_var=LD_RUN_PATH
+
+# This is the shared library path variable.
+shlibpath_var=LD_LIBRARY_PATH
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=no
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=immediate
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=yes
+
+# Flag to hardcode $libdir into a binary during linking.
+# This must work even if $libdir does not exist.
+hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
+
+# If ld is used when linking, flag to hardcode $libdir into
+# a binary during linking. This must work even if $libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=""
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=""
+
+# Set to yes if using DIR/libNAME during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=no
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=no
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=unsupported
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=no
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=unknown
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=" /usr/pack/gcc-3.3.5-mo/i686-debian-linux3.1/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/ /usr/lib/gcc/i686-pc-linux-gnu/3.3.5/ /usr/pack/gcc-3.3.5-mo/i686-debian-linux3.1/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/../../../../i686-pc-linux-gnu/lib/i686-pc-linux-gnu/3.3.5/ /usr/pack/gcc-3.3.5-mo/i686-debian-linux3.1/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/../../../../i686-pc-linux-gnu/lib/ /usr/pack/gcc-3.3.5-mo/i686-debian-linux3.1/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/../../../i686-pc-linux-gnu/3.3.5/ /usr/pack/gcc-3.3.5-mo/i686-debian-linux3.1/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/../../../ /lib/i686-pc-linux-gnu/3.3.5/ /lib/ /usr/lib/i686-pc-linux-gnu/3.3.5/ /usr/lib/"
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/libc5-compat /lib/libc5-compat /usr/i486-linuxlibc1/lib /usr/X11R6/lib /usr/lib/nvidia/lib "
+
+# Fix the shell variable $srcfile for the compiler.
+fix_srcfile_path=""
+
+# Set to yes if exported symbols are required.
+always_export_symbols=no
+
+# The commands to list exported symbols.
+export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=""
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+
+# Symbols that must always be exported.
+include_expsyms=""
+
+# ### END LIBTOOL TAG CONFIG: F77
+
+# ### BEGIN LIBTOOL TAG CONFIG: F77
+
+# Libtool was configured on host tardis-d04:
+
+# Shell to use when invoking shell scripts.
+SHELL="/bin/sh"
+
+# Whether or not to build shared libraries.
+build_libtool_libs=yes
+
+# Whether or not to build static libraries.
+build_old_libs=no
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=no
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=no
+
+# Whether or not to optimize for fast installation.
+fast_install=yes
+
+# The host system.
+host_alias=
+host=i686-pc-linux-gnu
+host_os=linux-gnu
+
+# The build system.
+build_alias=
+build=i686-pc-linux-gnu
+build_os=linux-gnu
+
+# An echo program that does not interpret backslashes.
+echo="echo"
+
+# The archiver.
+AR="ar"
+AR_FLAGS="cru"
+
+# A C compiler.
+LTCC="gcc"
+
+# A language-specific compiler.
+CC="g++"
+
+# Is the compiler the GNU C compiler?
+with_gcc=yes
+
+# An ERE matcher.
+EGREP="/bin/grep -E"
+
+# The linker used to build libraries.
+LD="/usr/bin/ld"
+
+# Whether we need hard or soft links.
+LN_S="ln -s"
+
+# A BSD-compatible nm program.
+NM="/usr/bin/nm -B"
+
+# A symbol stripping program
+STRIP="strip"
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=file
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="dlltool"
+
+# Used on cygwin: object dumper.
+OBJDUMP="objdump"
+
+# Used on cygwin: assembler.
+AS="as"
+
+# The name of the directory that contains temporary libtool files.
+objdir=.libs
+
+# How to create reloadable object files.
+reload_flag=" -r"
+reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
+
+# How to pass a linker flag through the compiler.
+wl="-Wl,"
+
+# Object file suffix (normally "o").
+objext="o"
+
+# Old archive suffix (normally "a").
+libext="a"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='.so'
+
+# Executable file suffix (normally "").
+exeext=""
+
+# Additional compiler flags for building library objects.
+pic_flag=" -fPIC -DPIC"
+pic_mode=default
+
+# What is the maximum length of a command?
+max_cmd_len=32768
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o="yes"
+
+# Must we lock files when doing compilation?
+need_locks="no"
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=no
+
+# Do we need a version for libraries?
+need_version=no
+
+# Whether dlopen is supported.
+dlopen_support=unknown
+
+# Whether dlopen of programs is supported.
+dlopen_self=unknown
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=unknown
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag="-static"
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=" -fno-builtin"
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec="\${wl}--export-dynamic"
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=""
+
+# Library versioning type.
+version_type=linux
+
+# Format of library name prefix.
+libname_spec="lib\$name"
+
+# 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.
+library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
+
+# The coded name of the library, if different from the real name.
+soname_spec="\${libname}\${release}\${shared_ext}\$major"
+
+# Commands used to build and install an old-style archive.
+RANLIB="ranlib"
+old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
+old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
+old_postuninstall_cmds=""
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=""
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=""
+
+# Commands used to build and install a shared archive.
+archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
+archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
+postinstall_cmds=""
+postuninstall_cmds=""
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=""
+module_expsym_cmds=""
+
+# Commands to strip libraries.
+old_striplib="strip --strip-debug"
+striplib="strip --strip-unneeded"
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects="/usr/lib/gcc-lib/i486-linux/3.3.5/../../../crti.o /usr/lib/gcc-lib/i486-linux/3.3.5/crtbeginS.o"
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects="/usr/lib/gcc-lib/i486-linux/3.3.5/crtendS.o /usr/lib/gcc-lib/i486-linux/3.3.5/../../../crtn.o"
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=""
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path="-L/usr/lib/gcc-lib/i486-linux/3.3.5 -L/usr/lib/gcc-lib/i486-linux/3.3.5/../../.."
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method="pass_all"
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd="\$MAGIC_CMD"
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=""
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=""
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=""
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe="sed -n -e 's/^.*[ 	]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ 	][ 	]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/  {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/  {\"\\2\", (lt_ptr) \\&\\2},/p'"
+
+# This is the shared library runtime path variable.
+runpath_var=LD_RUN_PATH
+
+# This is the shared library path variable.
+shlibpath_var=LD_LIBRARY_PATH
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=no
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=immediate
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=yes
+
+# Flag to hardcode $libdir into a binary during linking.
+# This must work even if $libdir does not exist.
+hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
+
+# If ld is used when linking, flag to hardcode $libdir into
+# a binary during linking. This must work even if $libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=""
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=""
+
+# Set to yes if using DIR/libNAME during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=no
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=no
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=no
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=unknown
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=" /usr/lib/gcc-lib/i486-linux/3.3.5/ /usr/lib/gcc/i486-linux/3.3.5/ /usr/lib/gcc-lib/i486-linux/3.3.5/../../../../i486-linux/lib/i486-linux/3.3.5/ /usr/lib/gcc-lib/i486-linux/3.3.5/../../../../i486-linux/lib/ /usr/lib/gcc-lib/i486-linux/3.3.5/../../../i486-linux/3.3.5/ /usr/lib/gcc-lib/i486-linux/3.3.5/../../../ /lib/i486-linux/3.3.5/ /lib/ /usr/lib/i486-linux/3.3.5/ /usr/lib/"
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/libc5-compat /lib/libc5-compat /usr/i486-linuxlibc1/lib /usr/X11R6/lib /usr/lib/nvidia/lib "
+
+# Fix the shell variable $srcfile for the compiler.
+fix_srcfile_path=""
+
+# Set to yes if exported symbols are required.
+always_export_symbols=no
+
+# The commands to list exported symbols.
+export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=""
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=""
+
+# Symbols that must always be exported.
+include_expsyms=""
+
+# ### END LIBTOOL TAG CONFIG: F77
+
Index: /ltmain.sh
===================================================================
--- /ltmain.sh	(revision 5)
+++ /ltmain.sh	(revision 5)
@@ -0,0 +1,6530 @@
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun configure.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+basename="s,^.*/,,g"
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+progname=`echo "$progpath" | $SED $basename`
+modename="$progname"
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.5.20
+TIMESTAMP=" (1.1220.2.287 2005/08/31 18:54:15)"
+
+# 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
+
+# Check that we have a working $echo.
+if test "X$1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X$1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell, and then maybe $echo will work.
+  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+$*
+EOF
+  exit $EXIT_SUCCESS
+fi
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  SP2NL='tr \040 \012'
+  NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  SP2NL='tr \100 \n'
+  NL2SP='tr \r\n \100\100'
+  ;;
+esac
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+# We save the old values to restore during execute mode.
+if test "${LC_ALL+set}" = set; then
+  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
+fi
+if test "${LANG+set}" = set; then
+  save_LANG="$LANG"; LANG=C; export LANG
+fi
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" 	$lt_nl"
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+  $echo "$modename: not configured to build any kind of library" 1>&2
+  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+  exit $EXIT_FAILURE
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+
+#####################################
+# Shell function definitions:
+# This seems to be the best place for them
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid ()
+{
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
+      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+      win32_nmres=`eval $NM -f posix -A $1 | \
+	sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
+      if test "X$win32_nmres" = "Ximport" ; then
+        win32_libid_type="x86 archive import"
+      else
+        win32_libid_type="x86 archive static"
+      fi
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $echo $win32_libid_type
+}
+
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+	case $arg in
+	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	CC_quoted="$CC_quoted $arg"
+      done
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    CC_quoted=
+	    for arg in $CC; do
+	    # Double-quote args containing other shell metacharacters.
+	    case $arg in
+	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	      arg="\"$arg\""
+	      ;;
+	    esac
+	    CC_quoted="$CC_quoted $arg"
+	  done
+	    case "$@ " in
+	      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
+	      # The compiler in the base compile command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+	  fi
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  $echo "$modename: unable to infer tagged configuration"
+	  $echo "$modename: specify a tag with \`--tag'" 1>&2
+	  exit $EXIT_FAILURE
+#        else
+#          $echo "$modename: using $tagname tagged configuration"
+	fi
+	;;
+      esac
+    fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+
+    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
+    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
+      exit $EXIT_FAILURE
+    fi
+}
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    my_gentop="$1"; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
+    my_status=""
+
+    $show "${rm}r $my_gentop"
+    $run ${rm}r "$my_gentop"
+    $show "$mkdir $my_gentop"
+    $run $mkdir "$my_gentop"
+    my_status=$?
+    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
+      exit $my_status
+    fi
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+	*) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
+      my_xdir="$my_gentop/$my_xlib"
+
+      $show "${rm}r $my_xdir"
+      $run ${rm}r "$my_xdir"
+      $show "$mkdir $my_xdir"
+      $run $mkdir "$my_xdir"
+      status=$?
+      if test "$status" -ne 0 && test ! -d "$my_xdir"; then
+	exit $status
+      fi
+      case $host in
+      *-darwin*)
+	$show "Extracting $my_xabs"
+	# Do not bother doing anything if just a dry run
+	if test -z "$run"; then
+	  darwin_orig_dir=`pwd`
+	  cd $my_xdir || exit $?
+	  darwin_archive=$my_xabs
+	  darwin_curdir=`pwd`
+	  darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
+	  darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
+	  if test -n "$darwin_arches"; then 
+	    darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
+	    darwin_arch=
+	    $show "$darwin_base_archive has multiple architectures $darwin_arches"
+	    for darwin_arch in  $darwin_arches ; do
+	      mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+	      cd "$darwin_curdir"
+	      $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+	    done # $darwin_arches
+      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
+	    darwin_file=
+	    darwin_files=
+	    for darwin_file in $darwin_filelist; do
+	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+	      lipo -create -output "$darwin_file" $darwin_files
+	    done # $darwin_filelist
+	    ${rm}r unfat-$$
+	    cd "$darwin_orig_dir"
+	  else
+	    cd "$darwin_orig_dir"
+ 	    func_extract_an_archive "$my_xdir" "$my_xabs"
+	  fi # $darwin_arches
+	fi # $run
+	;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+        ;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+    done
+    func_extract_archives_result="$my_oldobjs"
+}
+# End of Shell function definitions
+#####################################
+
+# Darwin sucks
+eval std_shrext=\"$shrext_cmds\"
+
+# Parse our command line options once, thoroughly.
+while test "$#" -gt 0
+do
+  arg="$1"
+  shift
+
+  case $arg in
+  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) optarg= ;;
+  esac
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$prev"; then
+    case $prev in
+    execute_dlfiles)
+      execute_dlfiles="$execute_dlfiles $arg"
+      ;;
+    tag)
+      tagname="$arg"
+      preserve_args="${preserve_args}=$arg"
+
+      # Check whether tagname contains only valid characters
+      case $tagname in
+      *[!-_A-Za-z0-9,/]*)
+	$echo "$progname: invalid tag name: $tagname" 1>&2
+	exit $EXIT_FAILURE
+	;;
+      esac
+
+      case $tagname in
+      CC)
+	# Don't test for the "default" C tag, as we know, it's there, but
+	# not specially marked.
+	;;
+      *)
+	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
+	  taglist="$taglist $tagname"
+	  # Evaluate the configuration.
+	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
+	else
+	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
+	fi
+	;;
+      esac
+      ;;
+    *)
+      eval "$prev=\$arg"
+      ;;
+    esac
+
+    prev=
+    prevopt=
+    continue
+  fi
+
+  # Have we seen a non-optional argument yet?
+  case $arg in
+  --help)
+    show_help=yes
+    ;;
+
+  --version)
+    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+    $echo
+    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
+    $echo "This is free software; see the source for copying conditions.  There is NO"
+    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+    exit $?
+    ;;
+
+  --config)
+    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
+    done
+    exit $?
+    ;;
+
+  --debug)
+    $echo "$progname: enabling shell trace mode"
+    set -x
+    preserve_args="$preserve_args $arg"
+    ;;
+
+  --dry-run | -n)
+    run=:
+    ;;
+
+  --features)
+    $echo "host: $host"
+    if test "$build_libtool_libs" = yes; then
+      $echo "enable shared libraries"
+    else
+      $echo "disable shared libraries"
+    fi
+    if test "$build_old_libs" = yes; then
+      $echo "enable static libraries"
+    else
+      $echo "disable static libraries"
+    fi
+    exit $?
+    ;;
+
+  --finish) mode="finish" ;;
+
+  --mode) prevopt="--mode" prev=mode ;;
+  --mode=*) mode="$optarg" ;;
+
+  --preserve-dup-deps) duplicate_deps="yes" ;;
+
+  --quiet | --silent)
+    show=:
+    preserve_args="$preserve_args $arg"
+    ;;
+
+  --tag) prevopt="--tag" prev=tag ;;
+  --tag=*)
+    set tag "$optarg" ${1+"$@"}
+    shift
+    prev=tag
+    preserve_args="$preserve_args --tag"
+    ;;
+
+  -dlopen)
+    prevopt="-dlopen"
+    prev=execute_dlfiles
+    ;;
+
+  -*)
+    $echo "$modename: unrecognized option \`$arg'" 1>&2
+    $echo "$help" 1>&2
+    exit $EXIT_FAILURE
+    ;;
+
+  *)
+    nonopt="$arg"
+    break
+    ;;
+  esac
+done
+
+if test -n "$prevopt"; then
+  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+  $echo "$help" 1>&2
+  exit $EXIT_FAILURE
+fi
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+if test -z "$show_help"; then
+
+  # Infer the operation mode.
+  if test -z "$mode"; then
+    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
+    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
+    case $nonopt in
+    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
+      mode=link
+      for arg
+      do
+	case $arg in
+	-c)
+	   mode=compile
+	   break
+	   ;;
+	esac
+      done
+      ;;
+    *db | *dbx | *strace | *truss)
+      mode=execute
+      ;;
+    *install*|cp|mv)
+      mode=install
+      ;;
+    *rm)
+      mode=uninstall
+      ;;
+    *)
+      # If we have no mode, but dlfiles were specified, then do execute mode.
+      test -n "$execute_dlfiles" && mode=execute
+
+      # Just use the default operation mode.
+      if test -z "$mode"; then
+	if test -n "$nonopt"; then
+	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+	else
+	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+	fi
+      fi
+      ;;
+    esac
+  fi
+
+  # Only execute mode is allowed to have -dlopen flags.
+  if test -n "$execute_dlfiles" && test "$mode" != execute; then
+    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+    $echo "$help" 1>&2
+    exit $EXIT_FAILURE
+  fi
+
+  # Change the help message to a mode-specific one.
+  generic_help="$help"
+  help="Try \`$modename --help --mode=$mode' for more information."
+
+  # These modes are in order of execution frequency so that they run quickly.
+  case $mode in
+  # libtool compile mode
+  compile)
+    modename="$modename: compile"
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    suppress_opt=yes
+    suppress_output=
+    arg_mode=normal
+    libobj=
+    later=
+
+    for arg
+    do
+      case $arg_mode in
+      arg  )
+	# do not "continue".  Instead, add this to base_compile
+	lastarg="$arg"
+	arg_mode=normal
+	;;
+
+      target )
+	libobj="$arg"
+	arg_mode=normal
+	continue
+	;;
+
+      normal )
+	# Accept any command-line options.
+	case $arg in
+	-o)
+	  if test -n "$libobj" ; then
+	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  arg_mode=target
+	  continue
+	  ;;
+
+	-static | -prefer-pic | -prefer-non-pic)
+	  later="$later $arg"
+	  continue
+	  ;;
+
+	-no-suppress)
+	  suppress_opt=no
+	  continue
+	  ;;
+
+	-Xcompiler)
+	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
+	  continue      #  The current "srcfile" will either be retained or
+	  ;;            #  replaced later.  I would guess that would be a bug.
+
+	-Wc,*)
+	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+	  lastarg=
+	  save_ifs="$IFS"; IFS=','
+ 	  for arg in $args; do
+	    IFS="$save_ifs"
+
+	    # Double-quote args containing other shell metacharacters.
+	    # Many Bourne shells cannot handle close brackets correctly
+	    # in scan sets, so we specify it separately.
+	    case $arg in
+	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	      arg="\"$arg\""
+	      ;;
+	    esac
+	    lastarg="$lastarg $arg"
+	  done
+	  IFS="$save_ifs"
+	  lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+
+	  # Add the arguments to base_compile.
+	  base_compile="$base_compile $lastarg"
+	  continue
+	  ;;
+
+	* )
+	  # Accept the current argument as the source file.
+	  # The previous "srcfile" becomes the current argument.
+	  #
+	  lastarg="$srcfile"
+	  srcfile="$arg"
+	  ;;
+	esac  #  case $arg
+	;;
+      esac    #  case $arg_mode
+
+      # Aesthetically quote the previous argument.
+      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+      case $lastarg in
+      # Double-quote args containing other shell metacharacters.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, and some SunOS ksh mistreat backslash-escaping
+      # in scan sets (worked around with variable expansion),
+      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
+      # at all, so we specify them separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	lastarg="\"$lastarg\""
+	;;
+      esac
+
+      base_compile="$base_compile $lastarg"
+    done # for arg
+
+    case $arg_mode in
+    arg)
+      $echo "$modename: you must specify an argument for -Xcompile"
+      exit $EXIT_FAILURE
+      ;;
+    target)
+      $echo "$modename: you must specify a target with \`-o'" 1>&2
+      exit $EXIT_FAILURE
+      ;;
+    *)
+      # Get the name of the library object.
+      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    xform='[cCFSifmso]'
+    case $libobj in
+    *.ada) xform=ada ;;
+    *.adb) xform=adb ;;
+    *.ads) xform=ads ;;
+    *.asm) xform=asm ;;
+    *.c++) xform=c++ ;;
+    *.cc) xform=cc ;;
+    *.ii) xform=ii ;;
+    *.class) xform=class ;;
+    *.cpp) xform=cpp ;;
+    *.cxx) xform=cxx ;;
+    *.f90) xform=f90 ;;
+    *.for) xform=for ;;
+    *.java) xform=java ;;
+    esac
+
+    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+    case $libobj in
+    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+    *)
+      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+      exit $EXIT_FAILURE
+      ;;
+    esac
+
+    func_infer_tag $base_compile
+
+    for arg in $later; do
+      case $arg in
+      -static)
+	build_old_libs=yes
+	continue
+	;;
+
+      -prefer-pic)
+	pic_mode=yes
+	continue
+	;;
+
+      -prefer-non-pic)
+	pic_mode=no
+	continue
+	;;
+      esac
+    done
+
+    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
+    case $qlibobj in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	qlibobj="\"$qlibobj\"" ;;
+    esac
+    test "X$libobj" != "X$qlibobj" \
+	&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' 	&()|`$[]' \
+	&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
+    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$xdir" = "X$obj"; then
+      xdir=
+    else
+      xdir=$xdir/
+    fi
+    lobj=${xdir}$objdir/$objname
+
+    if test -z "$base_compile"; then
+      $echo "$modename: you must specify a compilation command" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
+    fi
+
+    $run $rm $removelist
+    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
+
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case $host_os in
+    cygwin* | mingw* | pw32* | os2*)
+      pic_mode=default
+      ;;
+    esac
+    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
+    fi
+
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test "$compiler_c_o" = no; then
+      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+      lockfile="$output_obj.lock"
+      removelist="$removelist $output_obj $lockfile"
+      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
+    else
+      output_obj=
+      need_locks=no
+      lockfile=
+    fi
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test "$need_locks" = yes; then
+      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
+	$show "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    elif test "$need_locks" = warn; then
+      if test -f "$lockfile"; then
+	$echo "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+      $echo "$srcfile" > "$lockfile"
+    fi
+
+    if test -n "$fix_srcfile_path"; then
+      eval srcfile=\"$fix_srcfile_path\"
+    fi
+    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
+    case $qsrcfile in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+      qsrcfile="\"$qsrcfile\"" ;;
+    esac
+
+    $run $rm "$libobj" "${libobj}T"
+
+    # Create a libtool object file (analogous to a ".la" file),
+    # but don't create it if we're doing a dry run.
+    test -z "$run" && cat > ${libobj}T <<EOF
+# $libobj - a libtool object file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+EOF
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test "$pic_mode" != no; then
+	command="$base_compile $qsrcfile $pic_flag"
+      else
+	# Don't build PIC code
+	command="$base_compile $qsrcfile"
+      fi
+
+      if test ! -d "${xdir}$objdir"; then
+	$show "$mkdir ${xdir}$objdir"
+	$run $mkdir ${xdir}$objdir
+	status=$?
+	if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
+	  exit $status
+	fi
+      fi
+
+      if test -z "$output_obj"; then
+	# Place PIC objects in $objdir
+	command="$command -o $lobj"
+      fi
+
+      $run $rm "$lobj" "$output_obj"
+
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+	test -n "$output_obj" && $run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+	$show "$mv $output_obj $lobj"
+	if $run $mv $output_obj $lobj; then :
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+      fi
+
+      # Append the name of the PIC object to the libtool object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object='$objdir/$objname'
+
+EOF
+
+      # Allow error messages only from the first compilation.
+      if test "$suppress_opt" = yes; then
+        suppress_output=' >/dev/null 2>&1'
+      fi
+    else
+      # No PIC object so indicate it doesn't exist in the libtool
+      # object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object=none
+
+EOF
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
+	# Don't build PIC code
+	command="$base_compile $qsrcfile"
+      else
+	command="$base_compile $qsrcfile $pic_flag"
+      fi
+      if test "$compiler_c_o" = yes; then
+	command="$command -o $obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      command="$command$suppress_output"
+      $run $rm "$obj" "$output_obj"
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+	$run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+	$show "$mv $output_obj $obj"
+	if $run $mv $output_obj $obj; then :
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+      fi
+
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object='$objname'
+
+EOF
+    else
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object=none
+
+EOF
+    fi
+
+    $run $mv "${libobj}T" "${libobj}"
+
+    # Unlock the critical section if it was locked
+    if test "$need_locks" != no; then
+      $run $rm "$lockfile"
+    fi
+
+    exit $EXIT_SUCCESS
+    ;;
+
+  # libtool link mode
+  link | relink)
+    modename="$modename: link"
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # which system we are compiling for in order to pass an extra
+      # flag for every libtool invocation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll which has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args="$nonopt"
+    base_compile="$nonopt $@"
+    compile_command="$nonopt"
+    finalize_command="$nonopt"
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+
+    avoid_version=no
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    non_pic_objects=
+    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
+
+    func_infer_tag $base_compile
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -all-static | -static)
+	if test "X$arg" = "X-all-static"; then
+	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+	  fi
+	  if test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	else
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	fi
+	build_libtool_libs=no
+	build_old_libs=yes
+	prefer_static_libs=yes
+	break
+	;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test "$#" -gt 0; do
+      arg="$1"
+      shift
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
+	;;
+      *) qarg=$arg ;;
+      esac
+      libtool_args="$libtool_args $qarg"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+	case $prev in
+	output)
+	  compile_command="$compile_command @OUTPUT@"
+	  finalize_command="$finalize_command @OUTPUT@"
+	  ;;
+	esac
+
+	case $prev in
+	dlfiles|dlprefiles)
+	  if test "$preload" = no; then
+	    # Add the symbol object into the linking commands.
+	    compile_command="$compile_command @SYMFILE@"
+	    finalize_command="$finalize_command @SYMFILE@"
+	    preload=yes
+	  fi
+	  case $arg in
+	  *.la | *.lo) ;;  # We handle these cases below.
+	  force)
+	    if test "$dlself" = no; then
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  self)
+	    if test "$prev" = dlprefiles; then
+	      dlself=yes
+	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	      dlself=yes
+	    else
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  *)
+	    if test "$prev" = dlfiles; then
+	      dlfiles="$dlfiles $arg"
+	    else
+	      dlprefiles="$dlprefiles $arg"
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  esac
+	  ;;
+	expsyms)
+	  export_symbols="$arg"
+	  if test ! -f "$arg"; then
+	    $echo "$modename: symbol file \`$arg' does not exist"
+	    exit $EXIT_FAILURE
+	  fi
+	  prev=
+	  continue
+	  ;;
+	expsyms_regex)
+	  export_symbols_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	inst_prefix)
+	  inst_prefix_dir="$arg"
+	  prev=
+	  continue
+	  ;;
+	precious_regex)
+	  precious_files_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	release)
+	  release="-$arg"
+	  prev=
+	  continue
+	  ;;
+	objectlist)
+	  if test -f "$arg"; then
+	    save_arg=$arg
+	    moreargs=
+	    for fil in `cat $save_arg`
+	    do
+#	      moreargs="$moreargs $fil"
+	      arg=$fil
+	      # A libtool-controlled object.
+
+	      # Check to see that this really is a libtool object.
+	      if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+		pic_object=
+		non_pic_object=
+
+		# Read the .lo file
+		# If there is no directory component, then add one.
+		case $arg in
+		*/* | *\\*) . $arg ;;
+		*) . ./$arg ;;
+		esac
+
+		if test -z "$pic_object" || \
+		   test -z "$non_pic_object" ||
+		   test "$pic_object" = none && \
+		   test "$non_pic_object" = none; then
+		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+		  exit $EXIT_FAILURE
+		fi
+
+		# Extract subdirectory from the argument.
+		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+		if test "X$xdir" = "X$arg"; then
+		  xdir=
+		else
+		  xdir="$xdir/"
+		fi
+
+		if test "$pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  pic_object="$xdir$pic_object"
+
+		  if test "$prev" = dlfiles; then
+		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		      dlfiles="$dlfiles $pic_object"
+		      prev=
+		      continue
+		    else
+		      # If libtool objects are unsupported, then we need to preload.
+		      prev=dlprefiles
+		    fi
+		  fi
+
+		  # CHECK ME:  I think I busted this.  -Ossama
+		  if test "$prev" = dlprefiles; then
+		    # Preload the old-style object.
+		    dlprefiles="$dlprefiles $pic_object"
+		    prev=
+		  fi
+
+		  # A PIC object.
+		  libobjs="$libobjs $pic_object"
+		  arg="$pic_object"
+		fi
+
+		# Non-PIC object.
+		if test "$non_pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  non_pic_object="$xdir$non_pic_object"
+
+		  # A standard non-PIC object
+		  non_pic_objects="$non_pic_objects $non_pic_object"
+		  if test -z "$pic_object" || test "$pic_object" = none ; then
+		    arg="$non_pic_object"
+		  fi
+		fi
+	      else
+		# Only an error if not doing a dry-run.
+		if test -z "$run"; then
+		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+		  exit $EXIT_FAILURE
+		else
+		  # Dry-run case.
+
+		  # Extract subdirectory from the argument.
+		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+		  if test "X$xdir" = "X$arg"; then
+		    xdir=
+		  else
+		    xdir="$xdir/"
+		  fi
+
+		  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+		  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+		  libobjs="$libobjs $pic_object"
+		  non_pic_objects="$non_pic_objects $non_pic_object"
+		fi
+	      fi
+	    done
+	  else
+	    $echo "$modename: link input file \`$save_arg' does not exist"
+	    exit $EXIT_FAILURE
+	  fi
+	  arg=$save_arg
+	  prev=
+	  continue
+	  ;;
+	rpath | xrpath)
+	  # We need an absolute path.
+	  case $arg in
+	  [\\/]* | [A-Za-z]:[\\/]*) ;;
+	  *)
+	    $echo "$modename: only absolute run-paths are allowed" 1>&2
+	    exit $EXIT_FAILURE
+	    ;;
+	  esac
+	  if test "$prev" = rpath; then
+	    case "$rpath " in
+	    *" $arg "*) ;;
+	    *) rpath="$rpath $arg" ;;
+	    esac
+	  else
+	    case "$xrpath " in
+	    *" $arg "*) ;;
+	    *) xrpath="$xrpath $arg" ;;
+	    esac
+	  fi
+	  prev=
+	  continue
+	  ;;
+	xcompiler)
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  compile_command="$compile_command $qarg"
+	  finalize_command="$finalize_command $qarg"
+	  continue
+	  ;;
+	xlinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $wl$qarg"
+	  prev=
+	  compile_command="$compile_command $wl$qarg"
+	  finalize_command="$finalize_command $wl$qarg"
+	  continue
+	  ;;
+	xcclinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  compile_command="$compile_command $qarg"
+	  finalize_command="$finalize_command $qarg"
+	  continue
+	  ;;
+	shrext)
+  	  shrext_cmds="$arg"
+	  prev=
+	  continue
+	  ;;
+        darwin_framework)
+	  compiler_flags="$compiler_flags $arg"
+	  compile_command="$compile_command $arg"
+	  finalize_command="$finalize_command $arg"
+	  prev=
+	  continue
+	  ;;
+	*)
+	  eval "$prev=\"\$arg\""
+	  prev=
+	  continue
+	  ;;
+	esac
+      fi # test -n "$prev"
+
+      prevarg="$arg"
+
+      case $arg in
+      -all-static)
+	if test -n "$link_static_flag"; then
+	  compile_command="$compile_command $link_static_flag"
+	  finalize_command="$finalize_command $link_static_flag"
+	fi
+	continue
+	;;
+
+      -allow-undefined)
+	# FIXME: remove this flag sometime in the future.
+	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+	continue
+	;;
+
+      -avoid-version)
+	avoid_version=yes
+	continue
+	;;
+
+      -dlopen)
+	prev=dlfiles
+	continue
+	;;
+
+      -dlpreopen)
+	prev=dlprefiles
+	continue
+	;;
+
+      -export-dynamic)
+	export_dynamic=yes
+	continue
+	;;
+
+      -export-symbols | -export-symbols-regex)
+	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	  $echo "$modename: more than one -exported-symbols argument is not allowed"
+	  exit $EXIT_FAILURE
+	fi
+	if test "X$arg" = "X-export-symbols"; then
+	  prev=expsyms
+	else
+	  prev=expsyms_regex
+	fi
+	continue
+	;;
+
+      -framework|-arch)
+        prev=darwin_framework
+        compiler_flags="$compiler_flags $arg"
+	compile_command="$compile_command $arg"
+	finalize_command="$finalize_command $arg"
+        continue
+        ;;
+
+      -inst-prefix-dir)
+	prev=inst_prefix
+	continue
+	;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+	case $with_gcc/$host in
+	no/*-*-irix* | /*-*-irix*)
+	  compile_command="$compile_command $arg"
+	  finalize_command="$finalize_command $arg"
+	  ;;
+	esac
+	continue
+	;;
+
+      -L*)
+	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  absdir=`cd "$dir" && pwd`
+	  if test -z "$absdir"; then
+	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  dir="$absdir"
+	  ;;
+	esac
+	case "$deplibs " in
+	*" -L$dir "*) ;;
+	*)
+	  deplibs="$deplibs -L$dir"
+	  lib_search_path="$lib_search_path $dir"
+	  ;;
+	esac
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  case :$dllsearchpath: in
+	  *":$dir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$dir";;
+	  esac
+	  ;;
+	esac
+	continue
+	;;
+
+      -l*)
+	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+	  case $host in
+	  *-*-cygwin* | *-*-pw32* | *-*-beos*)
+	    # These systems don't actually have a C or math library (as such)
+	    continue
+	    ;;
+	  *-*-mingw* | *-*-os2*)
+	    # These systems don't actually have a C library (as such)
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C and math libraries are in the System framework
+	    deplibs="$deplibs -framework System"
+	    continue
+	  esac
+	elif test "X$arg" = "X-lc_r"; then
+	 case $host in
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	   # Do not include libc_r directly, use -pthread flag.
+	   continue
+	   ;;
+	 esac
+	fi
+	deplibs="$deplibs $arg"
+	continue
+	;;
+
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      -model)
+	compile_command="$compile_command $arg"
+	compiler_flags="$compiler_flags $arg"
+	finalize_command="$finalize_command $arg"
+	prev=xcompiler
+	continue
+	;;
+
+     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+	compiler_flags="$compiler_flags $arg"
+	compile_command="$compile_command $arg"
+	finalize_command="$finalize_command $arg"
+	continue
+	;;
+
+      -module)
+	module=yes
+	continue
+	;;
+
+      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+      # -r[0-9][0-9]* specifies the processor on the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+      # +DA*, +DD* enable 64-bit mode on the HP compiler
+      # -q* pass through compiler args for the IBM compiler
+      # -m* pass through architecture-specific compiler args for GCC
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
+
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+        compile_command="$compile_command $arg"
+        finalize_command="$finalize_command $arg"
+        if test "$with_gcc" = "yes" ; then
+          compiler_flags="$compiler_flags $arg"
+        fi
+        continue
+        ;;
+
+      -shrext)
+	prev=shrext
+	continue
+	;;
+
+      -no-fast-install)
+	fast_install=no
+	continue
+	;;
+
+      -no-install)
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  # The PATH hackery in wrapper scripts is required on Windows
+	  # in order for the loader to find any dlls it needs.
+	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
+	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
+	  fast_install=no
+	  ;;
+	*) no_install=yes ;;
+	esac
+	continue
+	;;
+
+      -no-undefined)
+	allow_undefined=no
+	continue
+	;;
+
+      -objectlist)
+	prev=objectlist
+	continue
+	;;
+
+      -o) prev=output ;;
+
+      -precious-files-regex)
+	prev=precious_regex
+	continue
+	;;
+
+      -release)
+	prev=release
+	continue
+	;;
+
+      -rpath)
+	prev=rpath
+	continue
+	;;
+
+      -R)
+	prev=xrpath
+	continue
+	;;
+
+      -R*)
+	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  $echo "$modename: only absolute run-paths are allowed" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+	case "$xrpath " in
+	*" $dir "*) ;;
+	*) xrpath="$xrpath $dir" ;;
+	esac
+	continue
+	;;
+
+      -static)
+	# The effects of -static are defined in a previous loop.
+	# We used to do the same as -all-static on platforms that
+	# didn't have a PIC flag, but the assumption that the effects
+	# would be equivalent was wrong.  It would break on at least
+	# Digital Unix and AIX.
+	continue
+	;;
+
+      -thread-safe)
+	thread_safe=yes
+	continue
+	;;
+
+      -version-info)
+	prev=vinfo
+	continue
+	;;
+      -version-number)
+	prev=vinfo
+	vinfo_number=yes
+	continue
+	;;
+
+      -Wc,*)
+	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+	  case $flag in
+	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	    flag="\"$flag\""
+	    ;;
+	  esac
+	  arg="$arg $wl$flag"
+	  compiler_flags="$compiler_flags $flag"
+	done
+	IFS="$save_ifs"
+	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	;;
+
+      -Wl,*)
+	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+	  case $flag in
+	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	    flag="\"$flag\""
+	    ;;
+	  esac
+	  arg="$arg $wl$flag"
+	  compiler_flags="$compiler_flags $wl$flag"
+	  linker_flags="$linker_flags $flag"
+	done
+	IFS="$save_ifs"
+	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	;;
+
+      -Xcompiler)
+	prev=xcompiler
+	continue
+	;;
+
+      -Xlinker)
+	prev=xlinker
+	continue
+	;;
+
+      -XCClinker)
+	prev=xcclinker
+	continue
+	;;
+
+      # Some other compiler flag.
+      -* | +*)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	;;
+
+      *.$objext)
+	# A standard object.
+	objs="$objs $arg"
+	;;
+
+      *.lo)
+	# A libtool-controlled object.
+
+	# Check to see that this really is a libtool object.
+	if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  pic_object=
+	  non_pic_object=
+
+	  # Read the .lo file
+	  # If there is no directory component, then add one.
+	  case $arg in
+	  */* | *\\*) . $arg ;;
+	  *) . ./$arg ;;
+	  esac
+
+	  if test -z "$pic_object" || \
+	     test -z "$non_pic_object" ||
+	     test "$pic_object" = none && \
+	     test "$non_pic_object" = none; then
+	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+
+	  # Extract subdirectory from the argument.
+	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+	  if test "X$xdir" = "X$arg"; then
+	    xdir=
+ 	  else
+	    xdir="$xdir/"
+	  fi
+
+	  if test "$pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    pic_object="$xdir$pic_object"
+
+	    if test "$prev" = dlfiles; then
+	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		dlfiles="$dlfiles $pic_object"
+		prev=
+		continue
+	      else
+		# If libtool objects are unsupported, then we need to preload.
+		prev=dlprefiles
+	      fi
+	    fi
+
+	    # CHECK ME:  I think I busted this.  -Ossama
+	    if test "$prev" = dlprefiles; then
+	      # Preload the old-style object.
+	      dlprefiles="$dlprefiles $pic_object"
+	      prev=
+	    fi
+
+	    # A PIC object.
+	    libobjs="$libobjs $pic_object"
+	    arg="$pic_object"
+	  fi
+
+	  # Non-PIC object.
+	  if test "$non_pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    non_pic_object="$xdir$non_pic_object"
+
+	    # A standard non-PIC object
+	    non_pic_objects="$non_pic_objects $non_pic_object"
+	    if test -z "$pic_object" || test "$pic_object" = none ; then
+	      arg="$non_pic_object"
+	    fi
+	  fi
+	else
+	  # Only an error if not doing a dry-run.
+	  if test -z "$run"; then
+	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+	    exit $EXIT_FAILURE
+	  else
+	    # Dry-run case.
+
+	    # Extract subdirectory from the argument.
+	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+	    if test "X$xdir" = "X$arg"; then
+	      xdir=
+	    else
+	      xdir="$xdir/"
+	    fi
+
+	    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+	    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+	    libobjs="$libobjs $pic_object"
+	    non_pic_objects="$non_pic_objects $non_pic_object"
+	  fi
+	fi
+	;;
+
+      *.$libext)
+	# An archive.
+	deplibs="$deplibs $arg"
+	old_deplibs="$old_deplibs $arg"
+	continue
+	;;
+
+      *.la)
+	# A libtool-controlled library.
+
+	if test "$prev" = dlfiles; then
+	  # This library was specified with -dlopen.
+	  dlfiles="$dlfiles $arg"
+	  prev=
+	elif test "$prev" = dlprefiles; then
+	  # The library was specified with -dlpreopen.
+	  dlprefiles="$dlprefiles $arg"
+	  prev=
+	else
+	  deplibs="$deplibs $arg"
+	fi
+	continue
+	;;
+
+      # Some other compiler argument.
+      *)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	;;
+      esac # arg
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+	compile_command="$compile_command $arg"
+	finalize_command="$finalize_command $arg"
+      fi
+    done # argument parsing loop
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      compile_command="$compile_command $arg"
+      finalize_command="$finalize_command $arg"
+    fi
+
+    oldlibs=
+    # calculate the name of the file, without its directory
+    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+    libobjs_save="$libobjs"
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$output_objdir" = "X$output"; then
+      output_objdir="$objdir"
+    else
+      output_objdir="$output_objdir/$objdir"
+    fi
+    # Create the object directory.
+    if test ! -d "$output_objdir"; then
+      $show "$mkdir $output_objdir"
+      $run $mkdir $output_objdir
+      status=$?
+      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
+	exit $status
+      fi
+    fi
+
+    # Determine the type of output
+    case $output in
+    "")
+      $echo "$modename: you must specify an output file" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    case $host in
+    *cygwin* | *mingw* | *pw32*)
+      # don't eliminate duplications in $postdeps and $predeps
+      duplicate_compiler_generated_deps=yes
+      ;;
+    *)
+      duplicate_compiler_generated_deps=$duplicate_deps
+      ;;
+    esac
+    specialdeplibs=
+
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      if test "X$duplicate_deps" = "Xyes" ; then
+	case "$libs " in
+	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	esac
+      fi
+      libs="$libs $deplib"
+    done
+
+    if test "$linkmode" = lib; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
+	for pre_post_dep in $predeps $postdeps; do
+	  case "$pre_post_deps " in
+	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+	  esac
+	  pre_post_deps="$pre_post_deps $pre_post_dep"
+	done
+      fi
+      pre_post_deps=
+    fi
+
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
+    case $linkmode in
+    lib)
+	passes="conv link"
+	for file in $dlfiles $dlprefiles; do
+	  case $file in
+	  *.la) ;;
+	  *)
+	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
+	    exit $EXIT_FAILURE
+	    ;;
+	  esac
+	done
+	;;
+    prog)
+	compile_deplibs=
+	finalize_deplibs=
+	alldeplibs=no
+	newdlfiles=
+	newdlprefiles=
+	passes="conv scan dlopen dlpreopen link"
+	;;
+    *)  passes="conv"
+	;;
+    esac
+    for pass in $passes; do
+      if test "$linkmode,$pass" = "lib,link" ||
+	 test "$linkmode,$pass" = "prog,scan"; then
+	libs="$deplibs"
+	deplibs=
+      fi
+      if test "$linkmode" = prog; then
+	case $pass in
+	dlopen) libs="$dlfiles" ;;
+	dlpreopen) libs="$dlprefiles" ;;
+	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	esac
+      fi
+      if test "$pass" = dlopen; then
+	# Collect dlpreopened libraries
+	save_deplibs="$deplibs"
+	deplibs=
+      fi
+      for deplib in $libs; do
+	lib=
+	found=no
+	case $deplib in
+	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    compiler_flags="$compiler_flags $deplib"
+	  fi
+	  continue
+	  ;;
+	-l*)
+	  if test "$linkmode" != lib && test "$linkmode" != prog; then
+	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+	    continue
+	  fi
+	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
+	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
+	    for search_ext in .la $std_shrext .so .a; do
+	      # Search the libtool library
+	      lib="$searchdir/lib${name}${search_ext}"
+	      if test -f "$lib"; then
+		if test "$search_ext" = ".la"; then
+		  found=yes
+		else
+		  found=no
+		fi
+		break 2
+	      fi
+	    done
+	  done
+	  if test "$found" != yes; then
+	    # deplib doesn't seem to be a libtool library
+	    if test "$linkmode,$pass" = "prog,link"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
+	  else # deplib is a libtool library
+	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+	    # We need to do some special things here, and not later.
+	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      case " $predeps $postdeps " in
+	      *" $deplib "*)
+		if (${SED} -e '2q' $lib |
+                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+		  library_names=
+		  old_library=
+		  case $lib in
+		  */* | *\\*) . $lib ;;
+		  *) . ./$lib ;;
+		  esac
+		  for l in $old_library $library_names; do
+		    ll="$l"
+		  done
+		  if test "X$ll" = "X$old_library" ; then # only static version available
+		    found=no
+		    ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+		    test "X$ladir" = "X$lib" && ladir="."
+		    lib=$ladir/$old_library
+		    if test "$linkmode,$pass" = "prog,link"; then
+		      compile_deplibs="$deplib $compile_deplibs"
+		      finalize_deplibs="$deplib $finalize_deplibs"
+		    else
+		      deplibs="$deplib $deplibs"
+		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+		    fi
+		    continue
+		  fi
+		fi
+	        ;;
+	      *) ;;
+	      esac
+	    fi
+	  fi
+	  ;; # -l
+	-L*)
+	  case $linkmode in
+	  lib)
+	    deplibs="$deplib $deplibs"
+	    test "$pass" = conv && continue
+	    newdependency_libs="$deplib $newdependency_libs"
+	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    ;;
+	  prog)
+	    if test "$pass" = conv; then
+	      deplibs="$deplib $deplibs"
+	      continue
+	    fi
+	    if test "$pass" = scan; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    ;;
+	  *)
+	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
+	    ;;
+	  esac # linkmode
+	  continue
+	  ;; # -L
+	-R*)
+	  if test "$pass" = link; then
+	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+	    # Make sure the xrpath contains only unique directories.
+	    case "$xrpath " in
+	    *" $dir "*) ;;
+	    *) xrpath="$xrpath $dir" ;;
+	    esac
+	  fi
+	  deplibs="$deplib $deplibs"
+	  continue
+	  ;;
+	*.la) lib="$deplib" ;;
+	*.$libext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  case $linkmode in
+	  lib)
+	    valid_a_lib=no
+	    case $deplibs_check_method in
+	      match_pattern*)
+		set dummy $deplibs_check_method
+	        match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+		if eval $echo \"$deplib\" 2>/dev/null \
+		    | $SED 10q \
+		    | $EGREP "$match_pattern_regex" > /dev/null; then
+		  valid_a_lib=yes
+		fi
+		;;
+	      pass_all)
+		valid_a_lib=yes
+		;;
+            esac
+	    if test "$valid_a_lib" != yes; then
+	      $echo
+	      $echo "*** Warning: Trying to link with static lib archive $deplib."
+	      $echo "*** I have the capability to make that library automatically link in when"
+	      $echo "*** you link to this library.  But I can only do this if you have a"
+	      $echo "*** shared version of the library, which you do not appear to have"
+	      $echo "*** because the file extensions .$libext of this argument makes me believe"
+	      $echo "*** that it is just a static archive that I should not used here."
+	    else
+	      $echo
+	      $echo "*** Warning: Linking the shared library $output against the"
+	      $echo "*** static library $deplib is not portable!"
+	      deplibs="$deplib $deplibs"
+	    fi
+	    continue
+	    ;;
+	  prog)
+	    if test "$pass" != link; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    continue
+	    ;;
+	  esac # linkmode
+	  ;; # *.$libext
+	*.lo | *.$objext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	  elif test "$linkmode" = prog; then
+	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	      # If there is no dlopen support or we're linking statically,
+	      # we need to preload.
+	      newdlprefiles="$newdlprefiles $deplib"
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      newdlfiles="$newdlfiles $deplib"
+	    fi
+	  fi
+	  continue
+	  ;;
+	%DEPLIBS%)
+	  alldeplibs=yes
+	  continue
+	  ;;
+	esac # case $deplib
+	if test "$found" = yes || test -f "$lib"; then :
+	else
+	  $echo "$modename: cannot find the library \`$lib'" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$ladir" = "X$lib" && ladir="."
+
+	dlname=
+	dlopen=
+	dlpreopen=
+	libdir=
+	library_names=
+	old_library=
+	# If the library was installed with an old release of libtool,
+	# it will not redefine variables installed, or shouldnotlink
+	installed=yes
+	shouldnotlink=no
+	avoidtemprpath=
+
+
+	# Read the .la file
+	case $lib in
+	*/* | *\\*) . $lib ;;
+	*) . ./$lib ;;
+	esac
+
+	if test "$linkmode,$pass" = "lib,link" ||
+	   test "$linkmode,$pass" = "prog,scan" ||
+	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+	fi
+
+	if test "$pass" = conv; then
+	  # Only check for convenience libraries
+	  deplibs="$lib $deplibs"
+	  if test -z "$libdir"; then
+	    if test -z "$old_library"; then
+	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+	      exit $EXIT_FAILURE
+	    fi
+	    # It is a libtool convenience library, so add in its objects.
+	    convenience="$convenience $ladir/$objdir/$old_library"
+	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
+	    tmp_libs=
+	    for deplib in $dependency_libs; do
+	      deplibs="$deplib $deplibs"
+              if test "X$duplicate_deps" = "Xyes" ; then
+	        case "$tmp_libs " in
+	        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	        esac
+              fi
+	      tmp_libs="$tmp_libs $deplib"
+	    done
+	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
+	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  continue
+	fi # $pass = conv
+
+
+	# Get the name of the library we link against.
+	linklib=
+	for l in $old_library $library_names; do
+	  linklib="$l"
+	done
+	if test -z "$linklib"; then
+	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# This library was specified with -dlopen.
+	if test "$pass" = dlopen; then
+	  if test -z "$libdir"; then
+	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  if test -z "$dlname" ||
+	     test "$dlopen_support" != yes ||
+	     test "$build_libtool_libs" = no; then
+	    # If there is no dlname, no dlopen support or we're linking
+	    # statically, we need to preload.  We also need to preload any
+	    # dependent libraries so libltdl's deplib preloader doesn't
+	    # bomb out in the load deplibs phase.
+	    dlprefiles="$dlprefiles $lib $dependency_libs"
+	  else
+	    newdlfiles="$newdlfiles $lib"
+	  fi
+	  continue
+	fi # $pass = dlopen
+
+	# We need an absolute path.
+	case $ladir in
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	*)
+	  abs_ladir=`cd "$ladir" && pwd`
+	  if test -z "$abs_ladir"; then
+	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
+	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+	    abs_ladir="$ladir"
+	  fi
+	  ;;
+	esac
+	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+
+	# Find the relevant object directory and library name.
+	if test "X$installed" = Xyes; then
+	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    libdir="$abs_ladir"
+	  else
+	    dir="$libdir"
+	    absdir="$libdir"
+	  fi
+	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+	else
+	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    # Remove this search path later
+	    notinst_path="$notinst_path $abs_ladir"
+	  else
+	    dir="$ladir/$objdir"
+	    absdir="$abs_ladir/$objdir"
+	    # Remove this search path later
+	    notinst_path="$notinst_path $abs_ladir"
+	  fi
+	fi # $installed = yes
+	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+
+	# This library was specified with -dlpreopen.
+	if test "$pass" = dlpreopen; then
+	  if test -z "$libdir"; then
+	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  # Prefer using a static library (so that no silly _DYNAMIC symbols
+	  # are required to link).
+	  if test -n "$old_library"; then
+	    newdlprefiles="$newdlprefiles $dir/$old_library"
+	  # Otherwise, use the dlname, so that lt_dlopen finds it.
+	  elif test -n "$dlname"; then
+	    newdlprefiles="$newdlprefiles $dir/$dlname"
+	  else
+	    newdlprefiles="$newdlprefiles $dir/$linklib"
+	  fi
+	fi # $pass = dlpreopen
+
+	if test -z "$libdir"; then
+	  # Link the convenience library
+	  if test "$linkmode" = lib; then
+	    deplibs="$dir/$old_library $deplibs"
+	  elif test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$dir/$old_library $compile_deplibs"
+	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
+	  else
+	    deplibs="$lib $deplibs" # used for prog,scan pass
+	  fi
+	  continue
+	fi
+
+
+	if test "$linkmode" = prog && test "$pass" != link; then
+	  newlib_search_path="$newlib_search_path $ladir"
+	  deplibs="$lib $deplibs"
+
+	  linkalldeplibs=no
+	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
+	     test "$build_libtool_libs" = no; then
+	    linkalldeplibs=yes
+	  fi
+
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    case $deplib in
+	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+	    esac
+	    # Need to link against all dependency_libs?
+	    if test "$linkalldeplibs" = yes; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      # Need to hardcode shared library paths
+	      # or/and link against static libraries
+	      newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    if test "X$duplicate_deps" = "Xyes" ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done # for deplib
+	  continue
+	fi # $linkmode = prog...
+
+	if test "$linkmode,$pass" = "prog,link"; then
+	  if test -n "$library_names" &&
+	     { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+	    # We need to hardcode the library path
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+	      # Make sure the rpath contains only unique directories.
+	      case "$temp_rpath " in
+	      *" $dir "*) ;;
+	      *" $absdir "*) ;;
+	      *) temp_rpath="$temp_rpath $absdir" ;;
+	      esac
+	    fi
+
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi # $linkmode,$pass = prog,link...
+
+	  if test "$alldeplibs" = yes &&
+	     { test "$deplibs_check_method" = pass_all ||
+	       { test "$build_libtool_libs" = yes &&
+		 test -n "$library_names"; }; }; then
+	    # We only need to search for static libraries
+	    continue
+	  fi
+	fi
+
+	link_static=no # Whether the deplib will be linked statically
+	if test -n "$library_names" &&
+	   { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+	  if test "$installed" = no; then
+	    notinst_deplibs="$notinst_deplibs $lib"
+	    need_relink=yes
+	  fi
+	  # This is a shared library
+
+	  # Warn about portability, can't link against -module's on
+	  # some systems (darwin)
+	  if test "$shouldnotlink" = yes && test "$pass" = link ; then
+	    $echo
+	    if test "$linkmode" = prog; then
+	      $echo "*** Warning: Linking the executable $output against the loadable module"
+	    else
+	      $echo "*** Warning: Linking the shared library $output against the loadable module"
+	    fi
+	    $echo "*** $linklib is not portable!"
+	  fi
+	  if test "$linkmode" = lib &&
+	     test "$hardcode_into_libs" = yes; then
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi
+
+	  if test -n "$old_archive_from_expsyms_cmds"; then
+	    # figure out the soname
+	    set dummy $library_names
+	    realname="$2"
+	    shift; shift
+	    libname=`eval \\$echo \"$libname_spec\"`
+	    # use dlname if we got it. it's perfectly good, no?
+	    if test -n "$dlname"; then
+	      soname="$dlname"
+	    elif test -n "$soname_spec"; then
+	      # bleh windows
+	      case $host in
+	      *cygwin* | mingw*)
+		major=`expr $current - $age`
+		versuffix="-$major"
+		;;
+	      esac
+	      eval soname=\"$soname_spec\"
+	    else
+	      soname="$realname"
+	    fi
+
+	    # Make a new name for the extract_expsyms_cmds to use
+	    soroot="$soname"
+	    soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
+	    newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
+
+	    # If the library has no export list, then create one now
+	    if test -f "$output_objdir/$soname-def"; then :
+	    else
+	      $show "extracting exported symbol list from \`$soname'"
+	      save_ifs="$IFS"; IFS='~'
+	      cmds=$extract_expsyms_cmds
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
+		$show "$cmd"
+		$run eval "$cmd" || exit $?
+	      done
+	      IFS="$save_ifs"
+	    fi
+
+	    # Create $newlib
+	    if test -f "$output_objdir/$newlib"; then :; else
+	      $show "generating import library for \`$soname'"
+	      save_ifs="$IFS"; IFS='~'
+	      cmds=$old_archive_from_expsyms_cmds
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
+		$show "$cmd"
+		$run eval "$cmd" || exit $?
+	      done
+	      IFS="$save_ifs"
+	    fi
+	    # make sure the library variables are pointing to the new library
+	    dir=$output_objdir
+	    linklib=$newlib
+	  fi # test -n "$old_archive_from_expsyms_cmds"
+
+	  if test "$linkmode" = prog || test "$mode" != relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    lib_linked=yes
+	    case $hardcode_action in
+	    immediate | unsupported)
+	      if test "$hardcode_direct" = no; then
+		add="$dir/$linklib"
+		case $host in
+		  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
+		  *-*-darwin* )
+		    # if the lib is a module then we can not link against
+		    # it, someone is ignoring the new warnings I added
+		    if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
+		      $echo "** Warning, lib $linklib is a module, not a shared library"
+		      if test -z "$old_library" ; then
+		        $echo
+		        $echo "** And there doesn't seem to be a static archive available"
+		        $echo "** The link will probably fail, sorry"
+		      else
+		        add="$dir/$old_library"
+		      fi
+		    fi
+		esac
+	      elif test "$hardcode_minus_L" = no; then
+		case $host in
+		*-*-sunos*) add_shlibpath="$dir" ;;
+		esac
+		add_dir="-L$dir"
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = no; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    relink)
+	      if test "$hardcode_direct" = yes; then
+		add="$dir/$linklib"
+	      elif test "$hardcode_minus_L" = yes; then
+		add_dir="-L$dir"
+		# Try looking first in the location we're being installed to.
+		if test -n "$inst_prefix_dir"; then
+		  case $libdir in
+		    [\\/]*)
+		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		      ;;
+		  esac
+		fi
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = yes; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    *) lib_linked=no ;;
+	    esac
+
+	    if test "$lib_linked" != yes; then
+	      $echo "$modename: configuration error: unsupported hardcode properties"
+	      exit $EXIT_FAILURE
+	    fi
+
+	    if test -n "$add_shlibpath"; then
+	      case :$compile_shlibpath: in
+	      *":$add_shlibpath:"*) ;;
+	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+	      esac
+	    fi
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	      if test "$hardcode_direct" != yes && \
+		 test "$hardcode_minus_L" != yes && \
+		 test "$hardcode_shlibpath_var" = yes; then
+		case :$finalize_shlibpath: in
+		*":$libdir:"*) ;;
+		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+		esac
+	      fi
+	    fi
+	  fi
+
+	  if test "$linkmode" = prog || test "$mode" = relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    # Finalize command for both is simple: just hardcode it.
+	    if test "$hardcode_direct" = yes; then
+	      add="$libdir/$linklib"
+	    elif test "$hardcode_minus_L" = yes; then
+	      add_dir="-L$libdir"
+	      add="-l$name"
+	    elif test "$hardcode_shlibpath_var" = yes; then
+	      case :$finalize_shlibpath: in
+	      *":$libdir:"*) ;;
+	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+	      esac
+	      add="-l$name"
+	    elif test "$hardcode_automatic" = yes; then
+	      if test -n "$inst_prefix_dir" &&
+		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
+	        add="$inst_prefix_dir$libdir/$linklib"
+	      else
+	        add="$libdir/$linklib"
+	      fi
+	    else
+	      # We cannot seem to hardcode it, guess we'll fake it.
+	      add_dir="-L$libdir"
+	      # Try looking first in the location we're being installed to.
+	      if test -n "$inst_prefix_dir"; then
+		case $libdir in
+		  [\\/]*)
+		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		    ;;
+		esac
+	      fi
+	      add="-l$name"
+	    fi
+
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	    fi
+	  fi
+	elif test "$linkmode" = prog; then
+	  # Here we assume that one of hardcode_direct or hardcode_minus_L
+	  # is not unsupported.  This is valid on all known static and
+	  # shared platforms.
+	  if test "$hardcode_direct" != unsupported; then
+	    test -n "$old_library" && linklib="$old_library"
+	    compile_deplibs="$dir/$linklib $compile_deplibs"
+	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
+	  else
+	    compile_deplibs="-l$name -L$dir $compile_deplibs"
+	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+	  fi
+	elif test "$build_libtool_libs" = yes; then
+	  # Not a shared library
+	  if test "$deplibs_check_method" != pass_all; then
+	    # We're trying link a shared library against a static one
+	    # but the system doesn't support it.
+
+	    # Just print a warning and add the library to dependency_libs so
+	    # that the program can be linked against the static library.
+	    $echo
+	    $echo "*** Warning: This system can not link to static lib archive $lib."
+	    $echo "*** I have the capability to make that library automatically link in when"
+	    $echo "*** you link to this library.  But I can only do this if you have a"
+	    $echo "*** shared version of the library, which you do not appear to have."
+	    if test "$module" = yes; then
+	      $echo "*** But as you try to build a module library, libtool will still create "
+	      $echo "*** a static module, that should work as long as the dlopening application"
+	      $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      if test -z "$global_symbol_pipe"; then
+		$echo
+		$echo "*** However, this would only work if libtool was able to extract symbol"
+		$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		$echo "*** not find such a program.  So, this module is probably useless."
+		$echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      fi
+	      if test "$build_old_libs" = no; then
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  else
+	    deplibs="$dir/$old_library $deplibs"
+	    link_static=yes
+	  fi
+	fi # link shared/static library?
+
+	if test "$linkmode" = lib; then
+	  if test -n "$dependency_libs" &&
+	     { test "$hardcode_into_libs" != yes ||
+	       test "$build_old_libs" = yes ||
+	       test "$link_static" = yes; }; then
+	    # Extract -R from dependency_libs
+	    temp_deplibs=
+	    for libdir in $dependency_libs; do
+	      case $libdir in
+	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
+		   case " $xrpath " in
+		   *" $temp_xrpath "*) ;;
+		   *) xrpath="$xrpath $temp_xrpath";;
+		   esac;;
+	      *) temp_deplibs="$temp_deplibs $libdir";;
+	      esac
+	    done
+	    dependency_libs="$temp_deplibs"
+	  fi
+
+	  newlib_search_path="$newlib_search_path $absdir"
+	  # Link against this library
+	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  # ... and its dependency_libs
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    newdependency_libs="$deplib $newdependency_libs"
+	    if test "X$duplicate_deps" = "Xyes" ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done
+
+	  if test "$link_all_deplibs" != no; then
+	    # Add the search paths of all dependency libraries
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      -L*) path="$deplib" ;;
+	      *.la)
+		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
+		test "X$dir" = "X$deplib" && dir="."
+		# We need an absolute path.
+		case $dir in
+		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		*)
+		  absdir=`cd "$dir" && pwd`
+		  if test -z "$absdir"; then
+		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+		    absdir="$dir"
+		  fi
+		  ;;
+		esac
+		if grep "^installed=no" $deplib > /dev/null; then
+		  path="$absdir/$objdir"
+		else
+		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  if test -z "$libdir"; then
+		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+		    exit $EXIT_FAILURE
+		  fi
+		  if test "$absdir" != "$libdir"; then
+		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
+		  fi
+		  path="$absdir"
+		fi
+		depdepl=
+		case $host in
+		*-*-darwin*)
+		  # we do not want to link against static libs,
+		  # but need to link against shared
+		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names" ; then
+		    for tmp in $deplibrary_names ; do
+		      depdepl=$tmp
+		    done
+		    if test -f "$path/$depdepl" ; then
+		      depdepl="$path/$depdepl"
+		    fi
+		    # do not add paths which are already there
+		    case " $newlib_search_path " in
+		    *" $path "*) ;;
+		    *) newlib_search_path="$newlib_search_path $path";;
+		    esac
+		  fi
+		  path=""
+		  ;;
+		*)
+		  path="-L$path"
+		  ;;
+		esac
+		;;
+	      -l*)
+		case $host in
+		*-*-darwin*)
+		  # Again, we only want to link against shared libraries
+		  eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
+		  for tmp in $newlib_search_path ; do
+		    if test -f "$tmp/lib$tmp_libs.dylib" ; then
+		      eval depdepl="$tmp/lib$tmp_libs.dylib"
+		      break
+		    fi
+		  done
+		  path=""
+		  ;;
+		*) continue ;;
+		esac
+		;;
+	      *) continue ;;
+	      esac
+	      case " $deplibs " in
+	      *" $path "*) ;;
+	      *) deplibs="$path $deplibs" ;;
+	      esac
+	      case " $deplibs " in
+	      *" $depdepl "*) ;;
+	      *) deplibs="$depdepl $deplibs" ;;
+	      esac
+	    done
+	  fi # link_all_deplibs != no
+	fi # linkmode = lib
+      done # for deplib in $libs
+      dependency_libs="$newdependency_libs"
+      if test "$pass" = dlpreopen; then
+	# Link the dlpreopened libraries before other libraries
+	for deplib in $save_deplibs; do
+	  deplibs="$deplib $deplibs"
+	done
+      fi
+      if test "$pass" != dlopen; then
+	if test "$pass" != conv; then
+	  # Make sure lib_search_path contains only unique directories.
+	  lib_search_path=
+	  for dir in $newlib_search_path; do
+	    case "$lib_search_path " in
+	    *" $dir "*) ;;
+	    *) lib_search_path="$lib_search_path $dir" ;;
+	    esac
+	  done
+	  newlib_search_path=
+	fi
+
+	if test "$linkmode,$pass" != "prog,link"; then
+	  vars="deplibs"
+	else
+	  vars="compile_deplibs finalize_deplibs"
+	fi
+	for var in $vars dependency_libs; do
+	  # Add libraries to $var in reverse order
+	  eval tmp_libs=\"\$$var\"
+	  new_libs=
+	  for deplib in $tmp_libs; do
+	    # FIXME: Pedantically, this is the right thing to do, so
+	    #        that some nasty dependency loop isn't accidentally
+	    #        broken:
+	    #new_libs="$deplib $new_libs"
+	    # Pragmatically, this seems to cause very few problems in
+	    # practice:
+	    case $deplib in
+	    -L*) new_libs="$deplib $new_libs" ;;
+	    -R*) ;;
+	    *)
+	      # And here is the reason: when a library appears more
+	      # than once as an explicit dependence of a library, or
+	      # is implicitly linked in more than once by the
+	      # compiler, it is considered special, and multiple
+	      # occurrences thereof are not removed.  Compare this
+	      # with having the same library being listed as a
+	      # dependency of multiple other libraries: in this case,
+	      # we know (pedantically, we assume) the library does not
+	      # need to be listed more than once, so we keep only the
+	      # last copy.  This is not always right, but it is rare
+	      # enough that we require users that really mean to play
+	      # such unportable linking tricks to link the library
+	      # using -Wl,-lname, so that libtool does not consider it
+	      # for duplicate removal.
+	      case " $specialdeplibs " in
+	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
+	      *)
+		case " $new_libs " in
+		*" $deplib "*) ;;
+		*) new_libs="$deplib $new_libs" ;;
+		esac
+		;;
+	      esac
+	      ;;
+	    esac
+	  done
+	  tmp_libs=
+	  for deplib in $new_libs; do
+	    case $deplib in
+	    -L*)
+	      case " $tmp_libs " in
+	      *" $deplib "*) ;;
+	      *) tmp_libs="$tmp_libs $deplib" ;;
+	      esac
+	      ;;
+	    *) tmp_libs="$tmp_libs $deplib" ;;
+	    esac
+	  done
+	  eval $var=\"$tmp_libs\"
+	done # for var
+      fi
+      # Last step: remove runtime libs from dependency_libs
+      # (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs ; do
+	case " $predeps $postdeps $compiler_lib_search_path " in
+	*" $i "*)
+	  i=""
+	  ;;
+	esac
+	if test -n "$i" ; then
+	  tmp_libs="$tmp_libs $i"
+	fi
+      done
+      dependency_libs=$tmp_libs
+    done # for pass
+    if test "$linkmode" = prog; then
+      dlfiles="$newdlfiles"
+      dlprefiles="$newdlprefiles"
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$deplibs"; then
+	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
+      fi
+
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$rpath"; then
+	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$xrpath"; then
+	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
+      fi
+
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs="$output"
+      objs="$objs$old_deplibs"
+      ;;
+
+    lib)
+      # Make sure we only generate libraries of the form `libNAME.la'.
+      case $outputname in
+      lib*)
+	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+	eval shared_ext=\"$shrext_cmds\"
+	eval libname=\"$libname_spec\"
+	;;
+      *)
+	if test "$module" = no; then
+	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+	if test "$need_lib_prefix" != no; then
+	  # Add the "lib" prefix for modules if required
+	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	  eval shared_ext=\"$shrext_cmds\"
+	  eval libname=\"$libname_spec\"
+	else
+	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	fi
+	;;
+      esac
+
+      if test -n "$objs"; then
+	if test "$deplibs_check_method" != pass_all; then
+	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
+	  exit $EXIT_FAILURE
+	else
+	  $echo
+	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
+	  $echo "*** objects $objs is not portable!"
+	  libobjs="$libobjs $objs"
+	fi
+      fi
+
+      if test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
+      fi
+
+      set dummy $rpath
+      if test "$#" -gt 2; then
+	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+      fi
+      install_libdir="$2"
+
+      oldlibs=
+      if test -z "$rpath"; then
+	if test "$build_libtool_libs" = yes; then
+	  # Building a libtool convenience library.
+	  # Some compilers have problems with a `.al' extension so
+	  # convenience libraries should have the same extension an
+	  # archive normally would.
+	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
+	  build_libtool_libs=convenience
+	  build_old_libs=yes
+	fi
+
+	if test -n "$vinfo"; then
+	  $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
+	fi
+
+	if test -n "$release"; then
+	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
+	fi
+      else
+
+	# Parse the version information argument.
+	save_ifs="$IFS"; IFS=':'
+	set dummy $vinfo 0 0 0
+	IFS="$save_ifs"
+
+	if test -n "$8"; then
+	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# convert absolute version numbers to libtool ages
+	# this retains compatibility with .la files and attempts
+	# to make the code below a bit more comprehensible
+
+	case $vinfo_number in
+	yes)
+	  number_major="$2"
+	  number_minor="$3"
+	  number_revision="$4"
+	  #
+	  # There are really only two kinds -- those that
+	  # use the current revision as the major version
+	  # and those that subtract age and use age as
+	  # a minor version.  But, then there is irix
+	  # which has an extra 1 added just for fun
+	  #
+	  case $version_type in
+	  darwin|linux|osf|windows)
+	    current=`expr $number_major + $number_minor`
+	    age="$number_minor"
+	    revision="$number_revision"
+	    ;;
+	  freebsd-aout|freebsd-elf|sunos)
+	    current="$number_major"
+	    revision="$number_minor"
+	    age="0"
+	    ;;
+	  irix|nonstopux)
+	    current=`expr $number_major + $number_minor - 1`
+	    age="$number_minor"
+	    revision="$number_minor"
+	    ;;
+	  esac
+	  ;;
+	no)
+	  current="$2"
+	  revision="$3"
+	  age="$4"
+	  ;;
+	esac
+
+	# Check that each of the things are valid numbers.
+	case $current in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	case $revision in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	case $age in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	if test "$age" -gt "$current"; then
+	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# Calculate the version variables.
+	major=
+	versuffix=
+	verstring=
+	case $version_type in
+	none) ;;
+
+	darwin)
+	  # Like Linux, but with the current version available in
+	  # verstring for coding it into the library header
+	  major=.`expr $current - $age`
+	  versuffix="$major.$age.$revision"
+	  # Darwin ld doesn't like 0 for these options...
+	  minor_current=`expr $current + 1`
+	  verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+	  ;;
+
+	freebsd-aout)
+	  major=".$current"
+	  versuffix=".$current.$revision";
+	  ;;
+
+	freebsd-elf)
+	  major=".$current"
+	  versuffix=".$current";
+	  ;;
+
+	irix | nonstopux)
+	  major=`expr $current - $age + 1`
+
+	  case $version_type in
+	    nonstopux) verstring_prefix=nonstopux ;;
+	    *)         verstring_prefix=sgi ;;
+	  esac
+	  verstring="$verstring_prefix$major.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$revision
+	  while test "$loop" -ne 0; do
+	    iface=`expr $revision - $loop`
+	    loop=`expr $loop - 1`
+	    verstring="$verstring_prefix$major.$iface:$verstring"
+	  done
+
+	  # Before this point, $major must not contain `.'.
+	  major=.$major
+	  versuffix="$major.$revision"
+	  ;;
+
+	linux)
+	  major=.`expr $current - $age`
+	  versuffix="$major.$age.$revision"
+	  ;;
+
+	osf)
+	  major=.`expr $current - $age`
+	  versuffix=".$current.$age.$revision"
+	  verstring="$current.$age.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$age
+	  while test "$loop" -ne 0; do
+	    iface=`expr $current - $loop`
+	    loop=`expr $loop - 1`
+	    verstring="$verstring:${iface}.0"
+	  done
+
+	  # Make executables depend on our current version.
+	  verstring="$verstring:${current}.0"
+	  ;;
+
+	sunos)
+	  major=".$current"
+	  versuffix=".$current.$revision"
+	  ;;
+
+	windows)
+	  # Use '-' rather than '.', since we only want one
+	  # extension on DOS 8.3 filesystems.
+	  major=`expr $current - $age`
+	  versuffix="-$major"
+	  ;;
+
+	*)
+	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
+	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	# Clear the version info if we defaulted, and they specified a release.
+	if test -z "$vinfo" && test -n "$release"; then
+	  major=
+	  case $version_type in
+	  darwin)
+	    # we can't check for "0.0" in archive_cmds due to quoting
+	    # problems, so we reset it completely
+	    verstring=
+	    ;;
+	  *)
+	    verstring="0.0"
+	    ;;
+	  esac
+	  if test "$need_version" = no; then
+	    versuffix=
+	  else
+	    versuffix=".0.0"
+	  fi
+	fi
+
+	# Remove version info from name if versioning should be avoided
+	if test "$avoid_version" = yes && test "$need_version" = no; then
+	  major=
+	  versuffix=
+	  verstring=""
+	fi
+
+	# Check to see if the archive will have undefined symbols.
+	if test "$allow_undefined" = yes; then
+	  if test "$allow_undefined_flag" = unsupported; then
+	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+	    build_libtool_libs=no
+	    build_old_libs=yes
+	  fi
+	else
+	  # Don't allow undefined symbols.
+	  allow_undefined_flag="$no_undefined_flag"
+	fi
+      fi
+
+      if test "$mode" != relink; then
+	# Remove our outputs, but don't remove object files since they
+	# may have been created when compiling PIC objects.
+	removelist=
+	tempremovelist=`$echo "$output_objdir/*"`
+	for p in $tempremovelist; do
+	  case $p in
+	    *.$objext)
+	       ;;
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+	       if test "X$precious_files_regex" != "X"; then
+	         if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+	         then
+		   continue
+		 fi
+	       fi
+	       removelist="$removelist $p"
+	       ;;
+	    *) ;;
+	  esac
+	done
+	if test -n "$removelist"; then
+	  $show "${rm}r $removelist"
+	  $run ${rm}r $removelist
+	fi
+      fi
+
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+	oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+	# Transform .lo files to .o files.
+	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+      for path in $notinst_path; do
+	lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
+	deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
+	dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
+      done
+
+      if test -n "$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	temp_xrpath=
+	for libdir in $xrpath; do
+	  temp_xrpath="$temp_xrpath -R$libdir"
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+	  dependency_libs="$temp_xrpath $dependency_libs"
+	fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles="$dlfiles"
+      dlfiles=
+      for lib in $old_dlfiles; do
+	case " $dlprefiles $dlfiles " in
+	*" $lib "*) ;;
+	*) dlfiles="$dlfiles $lib" ;;
+	esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles="$dlprefiles"
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+	case "$dlprefiles " in
+	*" $lib "*) ;;
+	*) dlprefiles="$dlprefiles $lib" ;;
+	esac
+      done
+
+      if test "$build_libtool_libs" = yes; then
+	if test -n "$rpath"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
+	    # these systems don't actually have a c library (as such)!
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C library is in the System framework
+	    deplibs="$deplibs -framework System"
+	    ;;
+	  *-*-netbsd*)
+	    # Don't link with libc until the a.out ld.so is fixed.
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+ 	  *)
+	    # Add libc to deplibs on all other systems if necessary.
+	    if test "$build_libtool_need_lc" = "yes"; then
+	      deplibs="$deplibs -lc"
+	    fi
+	    ;;
+	  esac
+	fi
+
+	# Transform deplibs into only deplibs that can be linked in shared.
+	name_save=$name
+	libname_save=$libname
+	release_save=$release
+	versuffix_save=$versuffix
+	major_save=$major
+	# I'm not sure if I'm treating the release correctly.  I think
+	# release should show up in the -l (ie -lgmp5) so we don't want to
+	# add it in twice.  Is that correct?
+	release=""
+	versuffix=""
+	major=""
+	newdeplibs=
+	droppeddeps=no
+	case $deplibs_check_method in
+	pass_all)
+	  # Don't check for shared/static.  Everything works.
+	  # This might be a little naive.  We might want to check
+	  # whether the library exists or not.  But this is on
+	  # osf3 & osf4 and I'm not really sure... Just
+	  # implementing what was already the behavior.
+	  newdeplibs=$deplibs
+	  ;;
+	test_compile)
+	  # This code stresses the "libraries are programs" paradigm to its
+	  # limits. Maybe even breaks it.  We compile a program, linking it
+	  # against the deplibs as a proxy for the library.  Then we can check
+	  # whether they linked in statically or dynamically with ldd.
+	  $rm conftest.c
+	  cat > conftest.c <<EOF
+	  int main() { return 0; }
+EOF
+	  $rm conftest
+	  $LTCC -o conftest conftest.c $deplibs
+	  if test "$?" -eq 0 ; then
+	    ldd_output=`ldd conftest`
+	    for i in $deplibs; do
+	      name=`expr $i : '-l\(.*\)'`
+	      # If $name is empty we are operating on a -L argument.
+              if test "$name" != "" && test "$name" -ne "0"; then
+		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		  case " $predeps $postdeps " in
+		  *" $i "*)
+		    newdeplibs="$newdeplibs $i"
+		    i=""
+		    ;;
+		  esac
+	        fi
+		if test -n "$i" ; then
+		  libname=`eval \\$echo \"$libname_spec\"`
+		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
+		  set dummy $deplib_matches
+		  deplib_match=$2
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    newdeplibs="$newdeplibs $i"
+		  else
+		    droppeddeps=yes
+		    $echo
+		    $echo "*** Warning: dynamic linker does not accept needed library $i."
+		    $echo "*** I have the capability to make that library automatically link in when"
+		    $echo "*** you link to this library.  But I can only do this if you have a"
+		    $echo "*** shared version of the library, which I believe you do not have"
+		    $echo "*** because a test_compile did reveal that the linker did not use it for"
+		    $echo "*** its dynamic dependency list that programs get resolved with at runtime."
+		  fi
+		fi
+	      else
+		newdeplibs="$newdeplibs $i"
+	      fi
+	    done
+	  else
+	    # Error occurred in the first compile.  Let's try to salvage
+	    # the situation: Compile a separate program for each library.
+	    for i in $deplibs; do
+	      name=`expr $i : '-l\(.*\)'`
+	      # If $name is empty we are operating on a -L argument.
+              if test "$name" != "" && test "$name" != "0"; then
+		$rm conftest
+		$LTCC -o conftest conftest.c $i
+		# Did it work?
+		if test "$?" -eq 0 ; then
+		  ldd_output=`ldd conftest`
+		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		    case " $predeps $postdeps " in
+		    *" $i "*)
+		      newdeplibs="$newdeplibs $i"
+		      i=""
+		      ;;
+		    esac
+		  fi
+		  if test -n "$i" ; then
+		    libname=`eval \\$echo \"$libname_spec\"`
+		    deplib_matches=`eval \\$echo \"$library_names_spec\"`
+		    set dummy $deplib_matches
+		    deplib_match=$2
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		      newdeplibs="$newdeplibs $i"
+		    else
+		      droppeddeps=yes
+		      $echo
+		      $echo "*** Warning: dynamic linker does not accept needed library $i."
+		      $echo "*** I have the capability to make that library automatically link in when"
+		      $echo "*** you link to this library.  But I can only do this if you have a"
+		      $echo "*** shared version of the library, which you do not appear to have"
+		      $echo "*** because a test_compile did reveal that the linker did not use this one"
+		      $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+		    fi
+		  fi
+		else
+		  droppeddeps=yes
+		  $echo
+		  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
+		  $echo "***  make it link in!  You will probably need to install it or some"
+		  $echo "*** library that it depends on before this library will be fully"
+		  $echo "*** functional.  Installing it before continuing would be even better."
+		fi
+	      else
+		newdeplibs="$newdeplibs $i"
+	      fi
+	    done
+	  fi
+	  ;;
+	file_magic*)
+	  set dummy $deplibs_check_method
+	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    name=`expr $a_deplib : '-l\(.*\)'`
+	    # If $name is empty we are operating on a -L argument.
+            if test "$name" != "" && test  "$name" != "0"; then
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval \\$echo \"$libname_spec\"`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		      # Follow soft links.
+		      if ls -lLd "$potent_lib" 2>/dev/null \
+			 | grep " -> " >/dev/null; then
+			continue
+		      fi
+		      # The statement above tries to avoid entering an
+		      # endless loop below, in case of cyclic links.
+		      # We might still enter an endless loop, since a link
+		      # loop can be closed while we follow links,
+		      # but so what?
+		      potlib="$potent_lib"
+		      while test -h "$potlib" 2>/dev/null; do
+			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			case $potliblink in
+			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+			esac
+		      done
+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+			 | ${SED} 10q \
+			 | $EGREP "$file_magic_regex" > /dev/null; then
+			newdeplibs="$newdeplibs $a_deplib"
+			a_deplib=""
+			break 2
+		      fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		$echo
+		$echo "*** Warning: linker path does not have real file for library $a_deplib."
+		$echo "*** I have the capability to make that library automatically link in when"
+		$echo "*** you link to this library.  But I can only do this if you have a"
+		$echo "*** shared version of the library, which you do not appear to have"
+		$echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $echo "*** with $libname but no candidates were found. (...for file magic test)"
+		else
+		  $echo "*** with $libname and none of the candidates passed a file format test"
+		  $echo "*** using a file magic. Last file checked: $potlib"
+		fi
+	      fi
+	    else
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	    fi
+	  done # Gone through all deplibs.
+	  ;;
+	match_pattern*)
+	  set dummy $deplibs_check_method
+	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    name=`expr $a_deplib : '-l\(.*\)'`
+	    # If $name is empty we are operating on a -L argument.
+	    if test -n "$name" && test "$name" != "0"; then
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval \\$echo \"$libname_spec\"`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		    potlib="$potent_lib" # see symlink-check above in file_magic test
+		    if eval $echo \"$potent_lib\" 2>/dev/null \
+		        | ${SED} 10q \
+		        | $EGREP "$match_pattern_regex" > /dev/null; then
+		      newdeplibs="$newdeplibs $a_deplib"
+		      a_deplib=""
+		      break 2
+		    fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		$echo
+		$echo "*** Warning: linker path does not have real file for library $a_deplib."
+		$echo "*** I have the capability to make that library automatically link in when"
+		$echo "*** you link to this library.  But I can only do this if you have a"
+		$echo "*** shared version of the library, which you do not appear to have"
+		$echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
+		else
+		  $echo "*** with $libname and none of the candidates passed a file format test"
+		  $echo "*** using a regex pattern. Last file checked: $potlib"
+		fi
+	      fi
+	    else
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	    fi
+	  done # Gone through all deplibs.
+	  ;;
+	none | unknown | *)
+	  newdeplibs=""
+	  tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+	    -e 's/ -[LR][^ ]*//g'`
+	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    for i in $predeps $postdeps ; do
+	      # can't use Xsed below, because $i might contain '/'
+	      tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
+	    done
+	  fi
+	  if $echo "X $tmp_deplibs" | $Xsed -e 's/[ 	]//g' \
+	    | grep . >/dev/null; then
+	    $echo
+	    if test "X$deplibs_check_method" = "Xnone"; then
+	      $echo "*** Warning: inter-library dependencies are not supported in this platform."
+	    else
+	      $echo "*** Warning: inter-library dependencies are not known to be supported."
+	    fi
+	    $echo "*** All declared inter-library dependencies are being dropped."
+	    droppeddeps=yes
+	  fi
+	  ;;
+	esac
+	versuffix=$versuffix_save
+	major=$major_save
+	release=$release_save
+	libname=$libname_save
+	name=$name_save
+
+	case $host in
+	*-*-rhapsody* | *-*-darwin1.[012])
+	  # On Rhapsody replace the C library is the System framework
+	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	  ;;
+	esac
+
+	if test "$droppeddeps" = yes; then
+	  if test "$module" = yes; then
+	    $echo
+	    $echo "*** Warning: libtool could not satisfy all declared inter-library"
+	    $echo "*** dependencies of module $libname.  Therefore, libtool will create"
+	    $echo "*** a static module, that should work as long as the dlopening"
+	    $echo "*** application is linked with the -dlopen flag."
+	    if test -z "$global_symbol_pipe"; then
+	      $echo
+	      $echo "*** However, this would only work if libtool was able to extract symbol"
+	      $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      $echo "*** not find such a program.  So, this module is probably useless."
+	      $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	    fi
+	    if test "$build_old_libs" = no; then
+	      oldlibs="$output_objdir/$libname.$libext"
+	      build_libtool_libs=module
+	      build_old_libs=yes
+	    else
+	      build_libtool_libs=no
+	    fi
+	  else
+	    $echo "*** The inter-library dependencies that have been dropped here will be"
+	    $echo "*** automatically added whenever a program is linked with this library"
+	    $echo "*** or is declared to -dlopen it."
+
+	    if test "$allow_undefined" = no; then
+	      $echo
+	      $echo "*** Since this library must not contain undefined symbols,"
+	      $echo "*** because either the platform does not support them or"
+	      $echo "*** it was explicitly requested with -no-undefined,"
+	      $echo "*** libtool will only create a static version of it."
+	      if test "$build_old_libs" = no; then
+		oldlibs="$output_objdir/$libname.$libext"
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  fi
+	fi
+	# Done checking deplibs!
+	deplibs=$newdeplibs
+      fi
+
+      # 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
+	realname="$2"
+	shift; shift
+
+	if test -n "$soname_spec"; then
+	  eval soname=\"$soname_spec\"
+	else
+	  soname="$realname"
+	fi
+	if test -z "$dlname"; then
+	  dlname=$soname
+	fi
+
+	lib="$output_objdir/$realname"
+	for link
+	do
+	  linknames="$linknames $link"
+	done
+
+	# Use standard objects if they are pic
+	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+
+	# Prepare the list of exported symbols
+	if test -z "$export_symbols"; then
+	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+	    $show "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $run $rm $export_symbols
+	    cmds=$export_symbols_cmds
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd in $cmds; do
+	      IFS="$save_ifs"
+	      eval cmd=\"$cmd\"
+	      if len=`expr "X$cmd" : ".*"` &&
+	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	        $show "$cmd"
+	        $run eval "$cmd" || exit $?
+	        skipped_export=false
+	      else
+	        # The command line is too long to execute in one step.
+	        $show "using reloadable object file for export list..."
+	        skipped_export=:
+		# Break out early, otherwise skipped_export may be
+		# set to false by a later but shorter cmd.
+		break
+	      fi
+	    done
+	    IFS="$save_ifs"
+	    if test -n "$export_symbols_regex"; then
+	      $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+	      $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+	fi
+
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+	fi
+
+	tmp_deplibs=
+	for test_deplib in $deplibs; do
+		case " $convenience " in
+		*" $test_deplib "*) ;;
+		*)
+			tmp_deplibs="$tmp_deplibs $test_deplib"
+			;;
+		esac
+	done
+	deplibs="$tmp_deplibs"
+
+	if test -n "$convenience"; then
+	  if test -n "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	  else
+	    gentop="$output_objdir/${outputname}x"
+	    generated="$generated $gentop"
+
+	    func_extract_archives $gentop $convenience
+	    libobjs="$libobjs $func_extract_archives_result"
+	  fi
+	fi
+	
+	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	  eval flag=\"$thread_safe_flag_spec\"
+	  linker_flags="$linker_flags $flag"
+	fi
+
+	# Make a backup of the uninstalled library when relinking
+	if test "$mode" = relink; then
+	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+	fi
+
+	# Do each of the archive commands.
+	if test "$module" = yes && test -n "$module_cmds" ; then
+	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	    eval test_cmds=\"$module_expsym_cmds\"
+	    cmds=$module_expsym_cmds
+	  else
+	    eval test_cmds=\"$module_cmds\"
+	    cmds=$module_cmds
+	  fi
+	else
+	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	  eval test_cmds=\"$archive_expsym_cmds\"
+	  cmds=$archive_expsym_cmds
+	else
+	  eval test_cmds=\"$archive_cmds\"
+	  cmds=$archive_cmds
+	  fi
+	fi
+
+	if test "X$skipped_export" != "X:" &&
+	   len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  :
+	else
+	  # The command line is too long to link in one step, link piecewise.
+	  $echo "creating reloadable object files..."
+
+	  # Save the value of $output and $libobjs because we want to
+	  # use them later.  If we have whole_archive_flag_spec, we
+	  # want to use save_libobjs as it was before
+	  # whole_archive_flag_spec was expanded, because we can't
+	  # assume the linker understands whole_archive_flag_spec.
+	  # This may have to be revisited, in case too many
+	  # convenience libraries get linked in and end up exceeding
+	  # the spec.
+	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	  fi
+	  save_output=$output
+	  output_la=`$echo "X$output" | $Xsed -e "$basename"`
+
+	  # Clear the reloadable object creation command queue and
+	  # initialize k to one.
+	  test_cmds=
+	  concat_cmds=
+	  objlist=
+	  delfiles=
+	  last_robj=
+	  k=1
+	  output=$output_objdir/$output_la-${k}.$objext
+	  # Loop over the list of objects to be linked.
+	  for obj in $save_libobjs
+	  do
+	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
+	    if test "X$objlist" = X ||
+	       { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+		 test "$len" -le "$max_cmd_len"; }; then
+	      objlist="$objlist $obj"
+	    else
+	      # The command $test_cmds is almost too long, add a
+	      # command to the queue.
+	      if test "$k" -eq 1 ; then
+		# The first file doesn't have a previous command to add.
+		eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+	      else
+		# All subsequent reloadable object files will link in
+		# the last one created.
+		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+	      fi
+	      last_robj=$output_objdir/$output_la-${k}.$objext
+	      k=`expr $k + 1`
+	      output=$output_objdir/$output_la-${k}.$objext
+	      objlist=$obj
+	      len=1
+	    fi
+	  done
+	  # Handle the remaining objects by creating one last
+	  # reloadable object file.  All subsequent reloadable object
+	  # files will link in the last one created.
+	  test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	  eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+
+	  if ${skipped_export-false}; then
+	    $show "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $run $rm $export_symbols
+	    libobjs=$output
+	    # Append the command to create the export file.
+	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
+          fi
+
+	  # Set up a command to remove the reloadable object files
+	  # after they are used.
+	  i=0
+	  while test "$i" -lt "$k"
+	  do
+	    i=`expr $i + 1`
+	    delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
+	  done
+
+	  $echo "creating a temporary reloadable object file: $output"
+
+	  # Loop through the commands generated above and execute them.
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $concat_cmds; do
+	    IFS="$save_ifs"
+	    $show "$cmd"
+	    $run eval "$cmd" || exit $?
+	  done
+	  IFS="$save_ifs"
+
+	  libobjs=$output
+	  # Restore the value of output.
+	  output=$save_output
+
+	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	  fi
+	  # Expand the library linking commands again to reset the
+	  # value of $libobjs for piecewise linking.
+
+	  # Do each of the archive commands.
+	  if test "$module" = yes && test -n "$module_cmds" ; then
+	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	      cmds=$module_expsym_cmds
+	    else
+	      cmds=$module_cmds
+	    fi
+	  else
+	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	    cmds=$archive_expsym_cmds
+	  else
+	    cmds=$archive_cmds
+	    fi
+	  fi
+
+	  # Append the command to remove the reloadable object files
+	  # to the just-reset $cmds.
+	  eval cmds=\"\$cmds~\$rm $delfiles\"
+	fi
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  eval cmd=\"$cmd\"
+	  $show "$cmd"
+	  $run eval "$cmd" || {
+	    lt_exit=$?
+
+	    # Restore the uninstalled library and exit
+	    if test "$mode" = relink; then
+	      $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+	    fi
+
+	    exit $lt_exit
+	  }
+	done
+	IFS="$save_ifs"
+
+	# Restore the uninstalled library and exit
+	if test "$mode" = relink; then
+	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+
+	  if test -n "$convenience"; then
+	    if test -z "$whole_archive_flag_spec"; then
+	      $show "${rm}r $gentop"
+	      $run ${rm}r "$gentop"
+	    fi
+	  fi
+
+	  exit $EXIT_SUCCESS
+	fi
+
+	# Create links to the real library.
+	for linkname in $linknames; do
+	  if test "$realname" != "$linkname"; then
+	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
+	    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+	  fi
+	done
+
+	# If -module or -export-dynamic was specified, set the dlname.
+	if test "$module" = yes || test "$export_dynamic" = yes; then
+	  # On all known operating systems, these are identical.
+	  dlname="$soname"
+	fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$deplibs"; then
+	$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
+      fi
+
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$rpath"; then
+	$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$xrpath"; then
+	$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
+      fi
+
+      case $output in
+      *.lo)
+	if test -n "$objs$old_deplibs"; then
+	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+	libobj="$output"
+	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+	;;
+      *)
+	libobj=
+	obj="$output"
+	;;
+      esac
+
+      # Delete the old objects.
+      $run $rm $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec
+      wl=
+
+      if test -n "$convenience"; then
+	if test -n "$whole_archive_flag_spec"; then
+	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+	else
+	  gentop="$output_objdir/${obj}x"
+	  generated="$generated $gentop"
+
+	  func_extract_archives $gentop $convenience
+	  reload_conv_objs="$reload_objs $func_extract_archives_result"
+	fi
+      fi
+
+      # Create the old-style object.
+      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+      output="$obj"
+      cmds=$reload_cmds
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	eval cmd=\"$cmd\"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+	if test -n "$gentop"; then
+	  $show "${rm}r $gentop"
+	  $run ${rm}r $gentop
+	fi
+
+	exit $EXIT_SUCCESS
+      fi
+
+      if test "$build_libtool_libs" != yes; then
+	if test -n "$gentop"; then
+	  $show "${rm}r $gentop"
+	  $run ${rm}r $gentop
+	fi
+
+	# Create an invalid libtool object if no PIC, so that we don't
+	# accidentally link it into a program.
+	# $show "echo timestamp > $libobj"
+	# $run eval "echo timestamp > $libobj" || exit $?
+	exit $EXIT_SUCCESS
+      fi
+
+      if test -n "$pic_flag" || test "$pic_mode" != default; then
+	# Only do commands if we really have different PIC objects.
+	reload_objs="$libobjs $reload_conv_objs"
+	output="$libobj"
+	cmds=$reload_cmds
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  eval cmd=\"$cmd\"
+	  $show "$cmd"
+	  $run eval "$cmd" || exit $?
+	done
+	IFS="$save_ifs"
+      fi
+
+      if test -n "$gentop"; then
+	$show "${rm}r $gentop"
+	$run ${rm}r $gentop
+      fi
+
+      exit $EXIT_SUCCESS
+      ;;
+
+    prog)
+      case $host in
+	*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
+      esac
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
+      fi
+
+      if test "$preload" = yes; then
+	if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
+	   test "$dlopen_self_static" = unknown; then
+	  $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+	fi
+      fi
+
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+	# On Rhapsody replace the C library is the System framework
+	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	;;
+      esac
+
+      case $host in
+      *darwin*)
+        # Don't allow lazy linking, it breaks C++ global constructors
+        if test "$tagname" = CXX ; then
+        compile_command="$compile_command ${wl}-bind_at_load"
+        finalize_command="$finalize_command ${wl}-bind_at_load"
+        fi
+        ;;
+      esac
+
+      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*)
+	  case :$dllsearchpath: in
+	  *":$libdir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$libdir";;
+	  esac
+	  ;;
+	esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath="$rpath"
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$finalize_perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+	  esac
+	fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath="$rpath"
+
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+	# Transform all the library objects into standard objects.
+	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+      fi
+
+      dlsyms=
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	if test -n "$NM" && test -n "$global_symbol_pipe"; then
+	  dlsyms="${outputname}S.c"
+	else
+	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+	fi
+      fi
+
+      if test -n "$dlsyms"; then
+	case $dlsyms in
+	"") ;;
+	*.c)
+	  # Discover the nlist of each of the dlfiles.
+	  nlist="$output_objdir/${outputname}.nm"
+
+	  $show "$rm $nlist ${nlist}S ${nlist}T"
+	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
+
+	  # Parse the name list into a source file.
+	  $show "creating $output_objdir/$dlsyms"
+
+	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define lt_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+	  if test "$dlself" = yes; then
+	    $show "generating symbol list for \`$output'"
+
+	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+	    # Add our own program objects to the symbol list.
+	    progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	    for arg in $progfiles; do
+	      $show "extracting global C symbols from \`$arg'"
+	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+	    done
+
+	    if test -n "$exclude_expsyms"; then
+	      $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+	      $run eval '$mv "$nlist"T "$nlist"'
+	    fi
+
+	    if test -n "$export_symbols_regex"; then
+	      $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+	      $run eval '$mv "$nlist"T "$nlist"'
+	    fi
+
+	    # Prepare the list of exported symbols
+	    if test -z "$export_symbols"; then
+	      export_symbols="$output_objdir/$outputname.exp"
+	      $run $rm $export_symbols
+	      $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	    else
+	      $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+	      $run eval 'mv "$nlist"T "$nlist"'
+	    fi
+	  fi
+
+	  for arg in $dlprefiles; do
+	    $show "extracting global C symbols from \`$arg'"
+	    name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
+	    $run eval '$echo ": $name " >> "$nlist"'
+	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+	  done
+
+	  if test -z "$run"; then
+	    # Make sure we have at least an empty file.
+	    test -f "$nlist" || : > "$nlist"
+
+	    if test -n "$exclude_expsyms"; then
+	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+	      $mv "$nlist"T "$nlist"
+	    fi
+
+	    # Try sorting and uniquifying the output.
+	    if grep -v "^: " < "$nlist" |
+		if sort -k 3 </dev/null >/dev/null 2>&1; then
+		  sort -k 3
+		else
+		  sort +2
+		fi |
+		uniq > "$nlist"S; then
+	      :
+	    else
+	      grep -v "^: " < "$nlist" > "$nlist"S
+	    fi
+
+	    if test -f "$nlist"S; then
+	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
+	    else
+	      $echo '/* NONE */' >> "$output_objdir/$dlsyms"
+	    fi
+
+	    $echo >> "$output_objdir/$dlsyms" "\
+
+#undef lt_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+"
+
+	    case $host in
+	    *cygwin* | *mingw* )
+	  $echo >> "$output_objdir/$dlsyms" "\
+/* DATA imports from DLLs on WIN32 can't be const, because
+   runtime relocations are performed -- see ld's documentation
+   on pseudo-relocs */
+struct {
+"
+	      ;;
+	    * )
+	  $echo >> "$output_objdir/$dlsyms" "\
+const struct {
+"
+	      ;;
+	    esac
+
+
+	  $echo >> "$output_objdir/$dlsyms" "\
+  const char *name;
+  lt_ptr address;
+}
+lt_preloaded_symbols[] =
+{\
+"
+
+	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
+
+	    $echo >> "$output_objdir/$dlsyms" "\
+  {0, (lt_ptr) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+	  fi
+
+	  pic_flag_for_symtable=
+	  case $host in
+	  # compiling the symbol table file with pic_flag works around
+	  # a FreeBSD bug that causes programs to crash when -lm is
+	  # linked before any other PIC object.  But we must not use
+	  # pic_flag when linking with -static.  The problem exists in
+	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	    case "$compile_command " in
+	    *" -static "*) ;;
+	    *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
+	    esac;;
+	  *-*-hpux*)
+	    case "$compile_command " in
+	    *" -static "*) ;;
+	    *) pic_flag_for_symtable=" $pic_flag";;
+	    esac
+	  esac
+
+	  # Now compile the dynamic symbol file.
+	  $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+	  $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+	  # Clean up the generated files.
+	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+
+	  # Transform the symbol file into the correct name.
+	  compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+	  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+	  ;;
+	*)
+	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+      else
+	# We keep going just in case the user didn't refer to
+	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+	# really was required.
+
+	# Nullify the symbol file.
+	compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+	finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+      fi
+
+      if test "$need_relink" = no || test "$build_libtool_libs" != yes; 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.
+	$show "$link_command"
+	$run eval "$link_command"
+	status=$?
+
+	# Delete the generated files.
+	if test -n "$dlsyms"; then
+	  $show "$rm $output_objdir/${outputname}S.${objext}"
+	  $run $rm "$output_objdir/${outputname}S.${objext}"
+	fi
+
+	exit $status
+      fi
+
+      if test -n "$shlibpath_var"; then
+	# We should set the shlibpath_var
+	rpath=
+	for dir in $temp_rpath; do
+	  case $dir in
+	  [\\/]* | [A-Za-z]:[\\/]*)
+	    # Absolute path.
+	    rpath="$rpath$dir:"
+	    ;;
+	  *)
+	    # Relative path: add a thisdir entry.
+	    rpath="$rpath\$thisdir/$dir:"
+	    ;;
+	  esac
+	done
+	temp_rpath="$rpath"
+      fi
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+	if test -n "$perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+	if test -n "$finalize_perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $finalize_perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+      fi
+
+      if test "$no_install" = yes; then
+	# We don't need to create a wrapper script.
+	link_command="$compile_var$compile_command$compile_rpath"
+	# Replace the output file specification.
+	link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	# Delete the old output file.
+	$run $rm $output
+	# Link the executable and exit
+	$show "$link_command"
+	$run eval "$link_command" || exit $?
+	exit $EXIT_SUCCESS
+      fi
+
+      if test "$hardcode_action" = relink; then
+	# Fast installation is not supported
+	link_command="$compile_var$compile_command$compile_rpath"
+	relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+	$echo "$modename: \`$output' will be relinked during installation" 1>&2
+      else
+	if test "$fast_install" != no; then
+	  link_command="$finalize_var$compile_command$finalize_rpath"
+	  if test "$fast_install" = yes; then
+	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $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.
+      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      $show "$link_command"
+      $run eval "$link_command" || exit $?
+
+      # Now create the wrapper script.
+      $show "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+	# Preserve any variables that may affect compiler behavior
+	for var in $variables_saved_for_relink; do
+	  if eval test -z \"\${$var+set}\"; then
+	    relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	  elif eval var_value=\$$var; test -z "$var_value"; then
+	    relink_command="$var=; export $var; $relink_command"
+	  else
+	    var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+	    relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	  fi
+	done
+	relink_command="(cd `pwd`; $relink_command)"
+	relink_command=`$echo "X$relink_command" | $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 our run command is non-null.
+      if test -z "$run"; then
+	# win32 will think the script is a binary if it has
+	# a .exe suffix, so we strip it off here.
+	case $output in
+	  *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
+	esac
+	# test for cygwin because mv fails w/o .exe extensions
+	case $host in
+	  *cygwin*)
+	    exeext=.exe
+	    outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
+	  *) exeext= ;;
+	esac
+	case $host in
+	  *cygwin* | *mingw* )
+	    cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
+	    cwrapper=`$echo ${output}.exe`
+	    $rm $cwrappersource $cwrapper
+	    trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+	    cat > $cwrappersource <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+
+   Currently, it simply execs the wrapper *script* "/bin/sh $output",
+   but could eventually absorb all of the scripts functionality and
+   exec $objdir/$outputname directly.
+*/
+EOF
+	    cat >> $cwrappersource<<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef DIR_SEPARATOR
+#define DIR_SEPARATOR '/'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+#define HAVE_DOS_BASED_FILE_SYSTEM
+#ifndef DIR_SEPARATOR_2
+#define DIR_SEPARATOR_2 '\\'
+#endif
+#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 */
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+const char *program_name = NULL;
+
+void * xmalloc (size_t num);
+char * xstrdup (const char *string);
+char * basename (const char *name);
+char * fnqualify(const char *path);
+char * strendzap(char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int i;
+
+  program_name = (char *) xstrdup ((char *) basename (argv[0]));
+  newargz = XMALLOC(char *, argc+2);
+EOF
+
+	    cat >> $cwrappersource <<EOF
+  newargz[0] = "$SHELL";
+EOF
+
+	    cat >> $cwrappersource <<"EOF"
+  newargz[1] = fnqualify(argv[0]);
+  /* we know the script has the same name, without the .exe */
+  /* so make sure newargz[1] doesn't end in .exe */
+  strendzap(newargz[1],".exe");
+  for (i = 1; i < argc; i++)
+    newargz[i+1] = xstrdup(argv[i]);
+  newargz[argc+1] = NULL;
+EOF
+
+	    cat >> $cwrappersource <<EOF
+  execv("$SHELL",newargz);
+EOF
+
+	    cat >> $cwrappersource <<"EOF"
+  return 127;
+}
+
+void *
+xmalloc (size_t num)
+{
+  void * p = (void *) malloc (num);
+  if (!p)
+    lt_fatal ("Memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
+;
+}
+
+char *
+basename (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha (name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return (char *) base;
+}
+
+char *
+fnqualify(const char *path)
+{
+  size_t size;
+  char *p;
+  char tmp[LT_PATHMAX + 1];
+
+  assert(path != NULL);
+
+  /* Is it qualified already? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha (path[0]) && path[1] == ':')
+    return xstrdup (path);
+#endif
+  if (IS_DIR_SEPARATOR (path[0]))
+    return xstrdup (path);
+
+  /* prepend the current directory */
+  /* doesn't handle '~' */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal ("getcwd failed");
+  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
+  p = XMALLOC(char, size);
+  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
+  return p;
+}
+
+char *
+strendzap(char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert(str != NULL);
+  assert(pat != NULL);
+
+  len = strlen(str);
+  patlen = strlen(pat);
+
+  if (patlen <= len)
+  {
+    str += len - patlen;
+    if (strcmp(str, pat) == 0)
+      *str = '\0';
+  }
+  return str;
+}
+
+static void
+lt_error_core (int exit_status, const char * mode,
+          const char * message, va_list ap)
+{
+  fprintf (stderr, "%s: %s: ", program_name, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+  va_end (ap);
+}
+EOF
+	  # we should really use a build-platform specific compiler
+	  # here, but OTOH, the wrappers (shell script and this C one)
+	  # are only useful if you want to execute the "real" binary.
+	  # Since the "real" binary is built for $host, then this
+	  # wrapper might as well be built for $host, too.
+	  $run $LTCC -s -o $cwrapper $cwrappersource
+	  ;;
+	esac
+	$rm $output
+	trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
+
+	$echo > $output "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variable:
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$echo are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    echo=\"$qecho\"
+    file=\"\$0\"
+    # Make sure echo works.
+    if test \"X\$1\" = X--no-reexec; then
+      # Discard the --no-reexec flag, and continue.
+      shift
+    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
+      # Yippee, \$echo works!
+      :
+    else
+      # Restart under the correct shell, and then maybe \$echo will work.
+      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+    fi
+  fi\
+"
+	$echo >> $output "\
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+  done
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+	if test "$fast_install" = yes; then
+	  $echo >> $output "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" || \\
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $mkdir \"\$progdir\"
+    else
+      $rm \"\$progdir/\$file\"
+    fi"
+
+	  $echo >> $output "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+	$echo \"\$relink_command_output\" >&2
+	$rm \"\$progdir/\$file\"
+	exit $EXIT_FAILURE
+      fi
+    fi
+
+    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $rm \"\$progdir/\$program\";
+      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $rm \"\$progdir/\$file\"
+  fi"
+	else
+	  $echo >> $output "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+	fi
+
+	$echo >> $output "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+	# Export our shlibpath_var if we have one.
+	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	  $echo >> $output "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+	fi
+
+	# fixup the dll searchpath if we need to.
+	if test -n "$dllsearchpath"; then
+	  $echo >> $output "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
+	$echo >> $output "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+"
+	case $host in
+	# Backslashes separate directories on plain windows
+	*-*-mingw | *-*-os2*)
+	  $echo >> $output "\
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+	  ;;
+
+	*)
+	  $echo >> $output "\
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+	  ;;
+	esac
+	$echo >> $output "\
+      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+      exit $EXIT_FAILURE
+    fi
+  else
+    # The program doesn't exist.
+    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$echo \"This script is just a wrapper for \$program.\" 1>&2
+    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit $EXIT_FAILURE
+  fi
+fi\
+"
+	chmod +x $output
+      fi
+      exit $EXIT_SUCCESS
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
+
+      if test "$build_libtool_libs" = convenience; then
+	oldobjs="$libobjs_save"
+	addlibs="$convenience"
+	build_libtool_libs=no
+      else
+	if test "$build_libtool_libs" = module; then
+	  oldobjs="$libobjs_save"
+	  build_libtool_libs=no
+	else
+	  oldobjs="$old_deplibs $non_pic_objects"
+	fi
+	addlibs="$old_convenience"
+      fi
+
+      if test -n "$addlibs"; then
+	gentop="$output_objdir/${outputname}x"
+	generated="$generated $gentop"
+
+	func_extract_archives $gentop $addlibs
+	oldobjs="$oldobjs $func_extract_archives_result"
+      fi
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+       cmds=$old_archive_from_new_cmds
+      else
+	# POSIX demands no paths to be encoded in archives.  We have
+	# to avoid creating archives with duplicate basenames if we
+	# might have to extract them afterwards, e.g., when creating a
+	# static archive out of a convenience library, or when linking
+	# the entirety of a libtool archive into another (currently
+	# not supported by libtool).
+	if (for obj in $oldobjs
+	    do
+	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
+	    done | sort | sort -uc >/dev/null 2>&1); then
+	  :
+	else
+	  $echo "copying selected object files to avoid basename conflicts..."
+
+	  if test -z "$gentop"; then
+	    gentop="$output_objdir/${outputname}x"
+	    generated="$generated $gentop"
+
+	    $show "${rm}r $gentop"
+	    $run ${rm}r "$gentop"
+	    $show "$mkdir $gentop"
+	    $run $mkdir "$gentop"
+	    status=$?
+	    if test "$status" -ne 0 && test ! -d "$gentop"; then
+	      exit $status
+	    fi
+	  fi
+
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  counter=1
+	  for obj in $save_oldobjs
+	  do
+	    objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+	    case " $oldobjs " in
+	    " ") oldobjs=$obj ;;
+	    *[\ /]"$objbase "*)
+	      while :; do
+		# Make sure we don't pick an alternate name that also
+		# overlaps.
+		newobj=lt$counter-$objbase
+		counter=`expr $counter + 1`
+		case " $oldobjs " in
+		*[\ /]"$newobj "*) ;;
+		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
+		esac
+	      done
+	      $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+	      $run ln "$obj" "$gentop/$newobj" ||
+	      $run cp "$obj" "$gentop/$newobj"
+	      oldobjs="$oldobjs $gentop/$newobj"
+	      ;;
+	    *) oldobjs="$oldobjs $obj" ;;
+	    esac
+	  done
+	fi
+
+	eval cmds=\"$old_archive_cmds\"
+
+	if len=`expr "X$cmds" : ".*"` &&
+	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  cmds=$old_archive_cmds
+	else
+	  # the command line is too long to link in one step, link in parts
+	  $echo "using piecewise archive linking..."
+	  save_RANLIB=$RANLIB
+	  RANLIB=:
+	  objlist=
+	  concat_cmds=
+	  save_oldobjs=$oldobjs
+
+	  # Is there a better way of finding the last object in the list?
+	  for obj in $save_oldobjs
+	  do
+	    last_oldobj=$obj
+	  done
+	  for obj in $save_oldobjs
+	  do
+	    oldobjs="$objlist $obj"
+	    objlist="$objlist $obj"
+	    eval test_cmds=\"$old_archive_cmds\"
+	    if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+	       test "$len" -le "$max_cmd_len"; then
+	      :
+	    else
+	      # the above command should be used before it gets too long
+	      oldobjs=$objlist
+	      if test "$obj" = "$last_oldobj" ; then
+	        RANLIB=$save_RANLIB
+	      fi
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+	      objlist=
+	    fi
+	  done
+	  RANLIB=$save_RANLIB
+	  oldobjs=$objlist
+	  if test "X$oldobjs" = "X" ; then
+	    eval cmds=\"\$concat_cmds\"
+	  else
+	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+	  fi
+	fi
+      fi
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+        eval cmd=\"$cmd\"
+	IFS="$save_ifs"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    done
+
+    if test -n "$generated"; then
+      $show "${rm}r$generated"
+      $run ${rm}r$generated
+    fi
+
+    # Now create the libtool archive.
+    case $output in
+    *.la)
+      old_library=
+      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      $show "creating $output"
+
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+	if eval test -z \"\${$var+set}\"; then
+	  relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	elif eval var_value=\$$var; test -z "$var_value"; then
+	  relink_command="$var=; export $var; $relink_command"
+	else
+	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	fi
+      done
+      # Quote the link command for shipping.
+      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      if test "$hardcode_automatic" = yes ; then
+	relink_command=
+      fi
+
+
+      # Only create the output if not a dry run.
+      if test -z "$run"; then
+	for installed in no yes; do
+	  if test "$installed" = yes; then
+	    if test -z "$install_libdir"; then
+	      break
+	    fi
+	    output="$output_objdir/$outputname"i
+	    # Replace all uninstalled libtool libraries with the installed ones
+	    newdependency_libs=
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      *.la)
+		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		if test -z "$libdir"; then
+		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+		  exit $EXIT_FAILURE
+		fi
+		newdependency_libs="$newdependency_libs $libdir/$name"
+		;;
+	      *) newdependency_libs="$newdependency_libs $deplib" ;;
+	      esac
+	    done
+	    dependency_libs="$newdependency_libs"
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+	      if test -z "$libdir"; then
+		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+		exit $EXIT_FAILURE
+	      fi
+	      newdlfiles="$newdlfiles $libdir/$name"
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+	      if test -z "$libdir"; then
+		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+		exit $EXIT_FAILURE
+	      fi
+	      newdlprefiles="$newdlprefiles $libdir/$name"
+	    done
+	    dlprefiles="$newdlprefiles"
+	  else
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      newdlfiles="$newdlfiles $abs"
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      newdlprefiles="$newdlprefiles $abs"
+	    done
+	    dlprefiles="$newdlprefiles"
+	  fi
+	  $rm $output
+	  # place dlname in correct position for cygwin
+	  tdlname=$dlname
+	  case $host,$output,$installed,$module,$dlname in
+	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+	  esac
+	  $echo > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+	  if test "$installed" = no && test "$need_relink" = yes; then
+	    $echo >> $output "\
+relink_command=\"$relink_command\""
+	  fi
+	done
+      fi
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+      ;;
+    esac
+    exit $EXIT_SUCCESS
+    ;;
+
+  # libtool install mode
+  install)
+    modename="$modename: install"
+
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       $echo "X$nonopt" | grep shtool > /dev/null; then
+      # Aesthetically quote it.
+      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	arg="\"$arg\""
+	;;
+      esac
+      install_prog="$arg "
+      arg="$1"
+      shift
+    else
+      install_prog=
+      arg=$nonopt
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+    case $arg in
+    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+      arg="\"$arg\""
+      ;;
+    esac
+    install_prog="$install_prog$arg"
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    for arg
+    do
+      if test -n "$dest"; then
+	files="$files $dest"
+	dest=$arg
+	continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f) 
+      	case " $install_prog " in
+	*[\\\ /]cp\ *) ;;
+	*) prev=$arg ;;
+	esac
+	;;
+      -g | -m | -o) prev=$arg ;;
+      -s)
+	stripme=" -s"
+	continue
+	;;
+      -*)
+	;;
+      *)
+	# If the previous option needed an argument, then skip it.
+	if test -n "$prev"; then
+	  prev=
+	else
+	  dest=$arg
+	  continue
+	fi
+	;;
+      esac
+
+      # Aesthetically quote the argument.
+      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	arg="\"$arg\""
+	;;
+      esac
+      install_prog="$install_prog $arg"
+    done
+
+    if test -z "$install_prog"; then
+      $echo "$modename: you must specify an install program" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prev' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+	$echo "$modename: no file or destination specified" 1>&2
+      else
+	$echo "$modename: you must specify a destination" 1>&2
+      fi
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    # Strip any trailing slash from the destination.
+    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+      test "X$destdir" = "X$dest" && destdir=.
+      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files
+      if test "$#" -gt 2; then
+	$echo "$modename: \`$dest' is not a directory" 1>&2
+	$echo "$help" 1>&2
+	exit $EXIT_FAILURE
+      fi
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+	case $file in
+	*.lo) ;;
+	*)
+	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+	# Do the static libraries later.
+	staticlibs="$staticlibs $file"
+	;;
+
+      *.la)
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	library_names=
+	old_library=
+	relink_command=
+	# If there is no directory component, then add one.
+	case $file in
+	*/* | *\\*) . $file ;;
+	*) . ./$file ;;
+	esac
+
+	# Add the libdir to current_libdirs if it is the destination.
+	if test "X$destdir" = "X$libdir"; then
+	  case "$current_libdirs " in
+	  *" $libdir "*) ;;
+	  *) current_libdirs="$current_libdirs $libdir" ;;
+	  esac
+	else
+	  # Note the libdir as a future libdir.
+	  case "$future_libdirs " in
+	  *" $libdir "*) ;;
+	  *) future_libdirs="$future_libdirs $libdir" ;;
+	  esac
+	fi
+
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
+	test "X$dir" = "X$file/" && dir=
+	dir="$dir$objdir"
+
+	if test -n "$relink_command"; then
+	  # Determine the prefix the user has applied to our future dir.
+	  inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
+
+	  # Don't allow the user to place us outside of our expected
+	  # location b/c this prevents finding dependent libraries that
+	  # are installed to the same prefix.
+	  # At present, this check doesn't affect windows .dll's that
+	  # are installed into $libdir/../bin (currently, that works fine)
+	  # but it's something to keep an eye on.
+	  if test "$inst_prefix_dir" = "$destdir"; then
+	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+
+	  if test -n "$inst_prefix_dir"; then
+	    # Stick the inst_prefix_dir data into the link command.
+	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	  else
+	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+	  fi
+
+	  $echo "$modename: warning: relinking \`$file'" 1>&2
+	  $show "$relink_command"
+	  if $run eval "$relink_command"; then :
+	  else
+	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	fi
+
+	# See the names of the shared library.
+	set dummy $library_names
+	if test -n "$2"; then
+	  realname="$2"
+	  shift
+	  shift
+
+	  srcname="$realname"
+	  test -n "$relink_command" && srcname="$realname"T
+
+	  # Install the shared library and build the symlinks.
+	  $show "$install_prog $dir/$srcname $destdir/$realname"
+	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
+	  if test -n "$stripme" && test -n "$striplib"; then
+	    $show "$striplib $destdir/$realname"
+	    $run eval "$striplib $destdir/$realname" || exit $?
+	  fi
+
+	  if test "$#" -gt 0; then
+	    # Delete the old symlinks, and create new ones.
+	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
+	    # so we also need to try rm && ln -s.
+	    for linkname
+	    do
+	      if test "$linkname" != "$realname"; then
+                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
+                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
+	      fi
+	    done
+	  fi
+
+	  # Do each command in the postinstall commands.
+	  lib="$destdir/$realname"
+	  cmds=$postinstall_cmds
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $cmds; do
+	    IFS="$save_ifs"
+	    eval cmd=\"$cmd\"
+	    $show "$cmd"
+	    $run eval "$cmd" || {
+	      lt_exit=$?
+
+	      # Restore the uninstalled library and exit
+	      if test "$mode" = relink; then
+		$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+	      fi
+
+	      exit $lt_exit
+	    }
+	  done
+	  IFS="$save_ifs"
+	fi
+
+	# Install the pseudo-library for information purposes.
+	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	instname="$dir/$name"i
+	$show "$install_prog $instname $destdir/$name"
+	$run eval "$install_prog $instname $destdir/$name" || exit $?
+
+	# Maybe install the static library, too.
+	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+	;;
+
+      *.lo)
+	# Install (i.e. copy) a libtool object.
+
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	  destfile="$destdir/$destfile"
+	fi
+
+	# Deduce the name of the destination old-style object file.
+	case $destfile in
+	*.lo)
+	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+	  ;;
+	*.$objext)
+	  staticdest="$destfile"
+	  destfile=
+	  ;;
+	*)
+	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	# Install the libtool object if requested.
+	if test -n "$destfile"; then
+	  $show "$install_prog $file $destfile"
+	  $run eval "$install_prog $file $destfile" || exit $?
+	fi
+
+	# Install the old object if enabled.
+	if test "$build_old_libs" = yes; then
+	  # Deduce the name of the old-style object file.
+	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
+
+	  $show "$install_prog $staticobj $staticdest"
+	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+	fi
+	exit $EXIT_SUCCESS
+	;;
+
+      *)
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	  destfile="$destdir/$destfile"
+	fi
+
+	# If the file is missing, and there is a .exe on the end, strip it
+	# because it is most likely a libtool script we actually want to
+	# install
+	stripped_ext=""
+	case $file in
+	  *.exe)
+	    if test ! -f "$file"; then
+	      file=`$echo $file|${SED} 's,.exe$,,'`
+	      stripped_ext=".exe"
+	    fi
+	    ;;
+	esac
+
+	# Do a test to see if this is really a libtool program.
+	case $host in
+	*cygwin*|*mingw*)
+	    wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
+	    ;;
+	*)
+	    wrapper=$file
+	    ;;
+	esac
+	if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
+	  notinst_deplibs=
+	  relink_command=
+
+	  # Note that it is not necessary on cygwin/mingw to append a dot to
+	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
+	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
+	  # `FILE.' does not work on cygwin managed mounts.
+	  #
+	  # If there is no directory component, then add one.
+	  case $wrapper in
+	  */* | *\\*) . ${wrapper} ;;
+	  *) . ./${wrapper} ;;
+	  esac
+
+	  # Check the variables that should have been set.
+	  if test -z "$notinst_deplibs"; then
+	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+
+	  finalize=yes
+	  for lib in $notinst_deplibs; do
+	    # Check to see that each library is installed.
+	    libdir=
+	    if test -f "$lib"; then
+	      # If there is no directory component, then add one.
+	      case $lib in
+	      */* | *\\*) . $lib ;;
+	      *) . ./$lib ;;
+	      esac
+	    fi
+	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    if test -n "$libdir" && test ! -f "$libfile"; then
+	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+	      finalize=no
+	    fi
+	  done
+
+	  relink_command=
+	  # Note that it is not necessary on cygwin/mingw to append a dot to
+	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
+	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
+	  # `FILE.' does not work on cygwin managed mounts.
+	  #
+	  # If there is no directory component, then add one.
+	  case $wrapper in
+	  */* | *\\*) . ${wrapper} ;;
+	  *) . ./${wrapper} ;;
+	  esac
+
+	  outputname=
+	  if test "$fast_install" = no && test -n "$relink_command"; then
+	    if test "$finalize" = yes && test -z "$run"; then
+	      tmpdir="/tmp"
+	      test -n "$TMPDIR" && tmpdir="$TMPDIR"
+	      tmpdir="$tmpdir/libtool-$$"
+	      save_umask=`umask`
+	      umask 0077
+	      if $mkdir "$tmpdir"; then
+	        umask $save_umask
+	      else
+	        umask $save_umask
+		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
+		continue
+	      fi
+	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
+	      outputname="$tmpdir/$file"
+	      # Replace the output file specification.
+	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+	      $show "$relink_command"
+	      if $run eval "$relink_command"; then :
+	      else
+		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+		${rm}r "$tmpdir"
+		continue
+	      fi
+	      file="$outputname"
+	    else
+	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
+	    fi
+	  else
+	    # Install the binary that we compiled earlier.
+	    file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+	  fi
+	fi
+
+	# remove .exe since cygwin /usr/bin/install will append another
+	# one anyway 
+	case $install_prog,$host in
+	*/usr/bin/install*,*cygwin*)
+	  case $file:$destfile in
+	  *.exe:*.exe)
+	    # this is ok
+	    ;;
+	  *.exe:*)
+	    destfile=$destfile.exe
+	    ;;
+	  *:*.exe)
+	    destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
+	    ;;
+	  esac
+	  ;;
+	esac
+	$show "$install_prog$stripme $file $destfile"
+	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+	test -n "$outputname" && ${rm}r "$tmpdir"
+	;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+
+      $show "$install_prog $file $oldlib"
+      $run eval "$install_prog \$file \$oldlib" || exit $?
+
+      if test -n "$stripme" && test -n "$old_striplib"; then
+	$show "$old_striplib $oldlib"
+	$run eval "$old_striplib $oldlib" || exit $?
+      fi
+
+      # Do each command in the postinstall commands.
+      cmds=$old_postinstall_cmds
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	eval cmd=\"$cmd\"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    done
+
+    if test -n "$future_libdirs"; then
+      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+    fi
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      test -n "$run" && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+    ;;
+
+  # libtool finish mode
+  finish)
+    modename="$modename: finish"
+    libdirs="$nonopt"
+    admincmds=
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for dir
+      do
+	libdirs="$libdirs $dir"
+      done
+
+      for libdir in $libdirs; do
+	if test -n "$finish_cmds"; then
+	  # Do each command in the finish commands.
+	  cmds=$finish_cmds
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $cmds; do
+	    IFS="$save_ifs"
+	    eval cmd=\"$cmd\"
+	    $show "$cmd"
+	    $run eval "$cmd" || admincmds="$admincmds
+       $cmd"
+	  done
+	  IFS="$save_ifs"
+	fi
+	if test -n "$finish_eval"; then
+	  # Do the single finish_eval.
+	  eval cmds=\"$finish_eval\"
+	  $run eval "$cmds" || admincmds="$admincmds
+       $cmds"
+	fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    test "$show" = : && exit $EXIT_SUCCESS
+
+    $echo "----------------------------------------------------------------------"
+    $echo "Libraries have been installed in:"
+    for libdir in $libdirs; do
+      $echo "   $libdir"
+    done
+    $echo
+    $echo "If you ever happen to want to link against installed libraries"
+    $echo "in a given directory, LIBDIR, you must either use libtool, and"
+    $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+    $echo "flag during linking and do at least one of the following:"
+    if test -n "$shlibpath_var"; then
+      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+      $echo "     during execution"
+    fi
+    if test -n "$runpath_var"; then
+      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+      $echo "     during linking"
+    fi
+    if test -n "$hardcode_libdir_flag_spec"; then
+      libdir=LIBDIR
+      eval flag=\"$hardcode_libdir_flag_spec\"
+
+      $echo "   - use the \`$flag' linker flag"
+    fi
+    if test -n "$admincmds"; then
+      $echo "   - have your system administrator run these commands:$admincmds"
+    fi
+    if test -f /etc/ld.so.conf; then
+      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+    fi
+    $echo
+    $echo "See any operating system documentation about shared libraries for"
+    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
+    $echo "----------------------------------------------------------------------"
+    exit $EXIT_SUCCESS
+    ;;
+
+  # libtool execute mode
+  execute)
+    modename="$modename: execute"
+
+    # The first argument is the command name.
+    cmd="$nonopt"
+    if test -z "$cmd"; then
+      $echo "$modename: you must specify a COMMAND" 1>&2
+      $echo "$help"
+      exit $EXIT_FAILURE
+    fi
+
+    # Handle -dlopen flags immediately.
+    for file in $execute_dlfiles; do
+      if test ! -f "$file"; then
+	$echo "$modename: \`$file' is not a file" 1>&2
+	$echo "$help" 1>&2
+	exit $EXIT_FAILURE
+      fi
+
+      dir=
+      case $file in
+      *.la)
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# Read the libtool library.
+	dlname=
+	library_names=
+
+	# If there is no directory component, then add one.
+	case $file in
+	*/* | *\\*) . $file ;;
+	*) . ./$file ;;
+	esac
+
+	# Skip this library if it cannot be dlopened.
+	if test -z "$dlname"; then
+	  # Warn if it was a shared library.
+	  test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+	  continue
+	fi
+
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$dir" = "X$file" && dir=.
+
+	if test -f "$dir/$objdir/$dlname"; then
+	  dir="$dir/$objdir"
+	else
+	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+	;;
+
+      *.lo)
+	# Just add the directory containing the .lo file.
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$dir" = "X$file" && dir=.
+	;;
+
+      *)
+	$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+	continue
+	;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+	eval "$shlibpath_var=\"\$dir\""
+      else
+	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -*) ;;
+      *)
+	# Do a test to see if this is really a libtool program.
+	if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  # If there is no directory component, then add one.
+	  case $file in
+	  */* | *\\*) . $file ;;
+	  *) . ./$file ;;
+	  esac
+
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	fi
+	;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+      args="$args \"$file\""
+    done
+
+    if test -z "$run"; then
+      if test -n "$shlibpath_var"; then
+	# Export the shlibpath_var.
+	eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      if test "${save_LC_ALL+set}" = set; then
+	LC_ALL="$save_LC_ALL"; export LC_ALL
+      fi
+      if test "${save_LANG+set}" = set; then
+	LANG="$save_LANG"; export LANG
+      fi
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+	$echo "export $shlibpath_var"
+      fi
+      $echo "$cmd$args"
+      exit $EXIT_SUCCESS
+    fi
+    ;;
+
+  # libtool clean and uninstall mode
+  clean | uninstall)
+    modename="$modename: $mode"
+    rm="$nonopt"
+    files=
+    rmforce=
+    exit_status=0
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    for arg
+    do
+      case $arg in
+      -f) rm="$rm $arg"; rmforce=yes ;;
+      -*) rm="$rm $arg" ;;
+      *) files="$files $arg" ;;
+      esac
+    done
+
+    if test -z "$rm"; then
+      $echo "$modename: you must specify an RM program" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    rmdirs=
+
+    origobjdir="$objdir"
+    for file in $files; do
+      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+      if test "X$dir" = "X$file"; then
+	dir=.
+	objdir="$origobjdir"
+      else
+	objdir="$dir/$origobjdir"
+      fi
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+      test "$mode" = uninstall && objdir="$dir"
+
+      # Remember objdir for removal later, being careful to avoid duplicates
+      if test "$mode" = clean; then
+	case " $rmdirs " in
+	  *" $objdir "*) ;;
+	  *) rmdirs="$rmdirs $objdir" ;;
+	esac
+      fi
+
+      # Don't error if the file doesn't exist and rm -f was used.
+      if (test -L "$file") >/dev/null 2>&1 \
+	|| (test -h "$file") >/dev/null 2>&1 \
+	|| test -f "$file"; then
+	:
+      elif test -d "$file"; then
+	exit_status=1
+	continue
+      elif test "$rmforce" = yes; then
+	continue
+      fi
+
+      rmfiles="$file"
+
+      case $name in
+      *.la)
+	# Possibly a libtool archive, so verify it.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  . $dir/$name
+
+	  # Delete the libtool libraries and symlinks.
+	  for n in $library_names; do
+	    rmfiles="$rmfiles $objdir/$n"
+	  done
+	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+	  test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+
+	  if test "$mode" = uninstall; then
+	    if test -n "$library_names"; then
+	      # Do each command in the postuninstall commands.
+	      cmds=$postuninstall_cmds
+	      save_ifs="$IFS"; IFS='~'
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
+		$show "$cmd"
+		$run eval "$cmd"
+		if test "$?" -ne 0 && test "$rmforce" != yes; then
+		  exit_status=1
+		fi
+	      done
+	      IFS="$save_ifs"
+	    fi
+
+	    if test -n "$old_library"; then
+	      # Do each command in the old_postuninstall commands.
+	      cmds=$old_postuninstall_cmds
+	      save_ifs="$IFS"; IFS='~'
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
+		$show "$cmd"
+		$run eval "$cmd"
+		if test "$?" -ne 0 && test "$rmforce" != yes; then
+		  exit_status=1
+		fi
+	      done
+	      IFS="$save_ifs"
+	    fi
+	    # FIXME: should reinstall the best remaining shared library.
+	  fi
+	fi
+	;;
+
+      *.lo)
+	# Possibly a libtool object, so verify it.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+
+	  # Read the .lo file
+	  . $dir/$name
+
+	  # Add PIC object to the list of files to remove.
+	  if test -n "$pic_object" \
+	     && test "$pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$pic_object"
+	  fi
+
+	  # Add non-PIC object to the list of files to remove.
+	  if test -n "$non_pic_object" \
+	     && test "$non_pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$non_pic_object"
+	  fi
+	fi
+	;;
+
+      *)
+	if test "$mode" = clean ; then
+	  noexename=$name
+	  case $file in
+	  *.exe)
+	    file=`$echo $file|${SED} 's,.exe$,,'`
+	    noexename=`$echo $name|${SED} 's,.exe$,,'`
+	    # $file with .exe has already been added to rmfiles,
+	    # add $file without .exe
+	    rmfiles="$rmfiles $file"
+	    ;;
+	  esac
+	  # Do a test to see if this is a libtool program.
+	  if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	    relink_command=
+	    . $dir/$noexename
+
+	    # note $name still contains .exe if it was in $file originally
+	    # as does the version of $file that was added into $rmfiles
+	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+	    if test "$fast_install" = yes && test -n "$relink_command"; then
+	      rmfiles="$rmfiles $objdir/lt-$name"
+	    fi
+	    if test "X$noexename" != "X$name" ; then
+	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+	    fi
+	  fi
+	fi
+	;;
+      esac
+      $show "$rm $rmfiles"
+      $run $rm $rmfiles || exit_status=1
+    done
+    objdir="$origobjdir"
+
+    # Try to remove the ${objdir}s in the directories where we deleted files
+    for dir in $rmdirs; do
+      if test -d "$dir"; then
+	$show "rmdir $dir"
+	$run rmdir $dir >/dev/null 2>&1
+      fi
+    done
+
+    exit $exit_status
+    ;;
+
+  "")
+    $echo "$modename: you must specify a MODE" 1>&2
+    $echo "$generic_help" 1>&2
+    exit $EXIT_FAILURE
+    ;;
+  esac
+
+  if test -z "$exec_cmd"; then
+    $echo "$modename: invalid operation mode \`$mode'" 1>&2
+    $echo "$generic_help" 1>&2
+    exit $EXIT_FAILURE
+  fi
+fi # test -z "$show_help"
+
+if test -n "$exec_cmd"; then
+  eval exec $exec_cmd
+  exit $EXIT_FAILURE
+fi
+
+# We need to display help for each of the modes.
+case $mode in
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+    --config          show all configuration variables
+    --debug           enable verbose shell tracing
+-n, --dry-run         display commands without modifying any files
+    --features        display basic configuration information and exit
+    --finish          same as \`--mode=finish'
+    --help            display this help message and exit
+    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
+    --quiet           same as \`--silent'
+    --silent          don't print informational messages
+    --tag=TAG         use configuration variables from tag TAG
+    --version         print version information
+
+MODE must be one of the following:
+
+      clean           remove files from the build directory
+      compile         compile a source file into a libtool object
+      execute         automatically set library path, then run a program
+      finish          complete the installation of libtool libraries
+      install         install libraries or executables
+      link            create a library or an executable
+      uninstall       remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE.
+
+Report bugs to <bug-libtool@gnu.org>."
+  exit $EXIT_SUCCESS
+  ;;
+
+clean)
+  $echo \
+"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+compile)
+  $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -prefer-pic       try to building PIC objects only
+  -prefer-non-pic   try to building non-PIC objects only
+  -static           always build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+  ;;
+
+execute)
+  $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+  ;;
+
+finish)
+  $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+  ;;
+
+install)
+  $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+  ;;
+
+link)
+  $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+		    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+		    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -static           do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+		    specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+  ;;
+
+uninstall)
+  $echo \
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+*)
+  $echo "$modename: invalid operation mode \`$mode'" 1>&2
+  $echo "$help" 1>&2
+  exit $EXIT_FAILURE
+  ;;
+esac
+
+$echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit $?
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+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:
Index: /missing
===================================================================
--- /missing	(revision 5)
+++ /missing	(revision 5)
@@ -0,0 +1,357 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2005-02-08.22
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+#   Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case "$1" in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg="probably too old"
+  fi
+  ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case "$1" in
+  lex|yacc)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case "$f" in
+      *:*) touch_files="$touch_files "`echo "$f" |
+				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+	   sed 's/\.am$/.in/' |
+	   while read f; do touch "$f"; done
+    ;;
+
+  autom4te)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+    if test -f "$file"; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo "#! /bin/sh"
+	echo "# Created by GNU Automake missing as a replacement of"
+	echo "#  $ $@"
+	echo "exit 0"
+	chmod +x $file
+	exit 1
+    fi
+    ;;
+
+  bison|yacc)
+    echo 1>&2 "\
+WARNING: \`$1' $msg.  You should only need it if
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site."
+    rm -f y.tab.c y.tab.h
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+	case "$LASTARG" in
+	*.y)
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" y.tab.c
+	    fi
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" y.tab.h
+	    fi
+	  ;;
+	esac
+    fi
+    if [ ! -f y.tab.h ]; then
+	echo >y.tab.h
+    fi
+    if [ ! -f y.tab.c ]; then
+	echo 'main() { return 0; }' >y.tab.c
+    fi
+    ;;
+
+  lex|flex)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site."
+    rm -f lex.yy.c
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+	case "$LASTARG" in
+	*.l)
+	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" lex.yy.c
+	    fi
+	  ;;
+	esac
+    fi
+    if [ ! -f lex.yy.c ]; then
+	echo 'main() { return 0; }' >lex.yy.c
+    fi
+    ;;
+
+  help2man)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+	 you modified a dependency of a manual page.  You may need the
+	 \`Help2man' package in order for those modifications to take
+	 effect.  You can get \`Help2man' from any GNU archive site."
+
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+	file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+    fi
+    if [ -f "$file" ]; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo ".ab help2man is required to generate this page"
+	exit 1
+    fi
+    ;;
+
+  makeinfo)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site."
+    # The file to touch is that specified with -o ...
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+      # ... or it is derived from the source name (dir/f.texi becomes f.info)
+      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+    fi
+    touch $file
+    ;;
+
+  tar)
+    shift
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version > /dev/null 2>&1); then
+       gnutar "$@" && exit 0
+    fi
+    if (gtar --version > /dev/null 2>&1); then
+       gtar "$@" && exit 0
+    fi
+    firstarg="$1"
+    if shift; then
+	case "$firstarg" in
+	*o*)
+	    firstarg=`echo "$firstarg" | sed s/o//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+	case "$firstarg" in
+	*h*)
+	    firstarg=`echo "$firstarg" | sed s/h//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
+  *)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequisites for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program."
+    exit 1
+    ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
